From 1c58fac5430b12c71b70c7b1774cbff3f09941ed Mon Sep 17 00:00:00 2001 From: Kat Leight Date: Thu, 27 Apr 2023 11:02:42 +0200 Subject: [PATCH 01/36] initial docs folder replacement --- docs/.eslintignore | 13 - docs/.eslintrc.cjs | 20 - docs/.gitignore | 3 +- docs/.prettierrc | 13 +- docs/README.md | 39 +- docs/package.json | 86 +- docs/playwright.config.ts | 10 - docs/postcss.config.cjs | 10 +- docs/src/app.css | 2 +- docs/src/app.d.ts | 16 +- docs/src/app.html | 41 +- docs/src/{lib => }/fonts/FiraCode-VF.woff | Bin docs/src/{lib => }/fonts/FiraCode-VF.woff2 | Bin .../fonts/Inter-VF.italic-latin.woff2 | Bin .../fonts/Inter-VF.roman-latin.woff2 | Bin docs/src/{lib => }/fonts/SofiaPro-Light.eot | Bin docs/src/{lib => }/fonts/SofiaPro-Light.svg | 0 docs/src/{lib => }/fonts/SofiaPro-Light.ttf | Bin docs/src/{lib => }/fonts/SofiaPro-Light.woff | Bin docs/src/{lib => }/fonts/SofiaPro-Light.woff2 | Bin docs/src/{lib => }/fonts/SofiaPro-Regular.eot | Bin docs/src/{lib => }/fonts/SofiaPro-Regular.svg | 0 docs/src/{lib => }/fonts/SofiaPro-Regular.ttf | Bin .../src/{lib => }/fonts/SofiaPro-Regular.woff | Bin .../{lib => }/fonts/SofiaPro-Regular.woff2 | Bin .../src/{lib => }/fonts/SofiaPro-SemiBold.eot | Bin .../src/{lib => }/fonts/SofiaPro-SemiBold.svg | 0 .../src/{lib => }/fonts/SofiaPro-SemiBold.ttf | Bin .../{lib => }/fonts/SofiaPro-SemiBold.woff | Bin .../{lib => }/fonts/SofiaPro-SemiBold.woff2 | Bin docs/src/img/svelte-horizontal.svg | 1 - docs/src/kit-docs/README.md | 120 + docs/src/kit-docs/index.ts | 1 - docs/src/lib/assets/favicon.ico | Bin 0 -> 861 bytes .../lib/components/ConnectWalletButton.svelte | 76 +- .../src/lib/components/FeaturesSection.svelte | 14 +- docs/src/lib/components/GettingStarted.svelte | 6 +- docs/src/lib/components/HeroSection.svelte | 3 +- docs/src/lib/components/HomeLayout.svelte | 81 +- docs/src/lib/components/PrismJS.svelte | 0 .../src/lib/components/ThemeCustomizer.svelte | 547 -- docs/src/lib/components/ThemingSection.svelte | 4 +- .../code-snippet/getting-started-guide.md | 57 - .../code-snippet/install-code-tp.md | 16 - .../components/code-snippet/install-code.md | 16 - .../components/code-snippet/theming-code.md | 10 - .../connect-wallet/SvelteConnectWallet.md | 205 - docs/src/lib/components/examples/index.ts | 4 +- docs/src/lib/components/index.ts | 1 - docs/src/lib/components/tabs/TabItem.svelte | 53 + docs/src/lib/components/tabs/TabPanel.svelte | 14 + docs/src/lib/components/tabs/Tabs.svelte | 40 + docs/src/lib/components/tabs/index.ts | 4 + docs/src/lib/components/tabs/tabsRegistry.ts | 107 + docs/src/lib/components/tabs/utils.ts | 25 + docs/src/lib/styles/docsearch.css | 275 + docs/src/lib/styles/kit-docs.css | 38 +- docs/src/routes/+layout.js | 13 + docs/src/routes/+layout.svelte | 94 + docs/src/routes/+page.md | 148 + docs/src/routes/__layout-homepage.svelte | 69 - docs/src/routes/__layout-kit-docs.svelte | 104 - docs/src/routes/docs/+page.js | 8 + .../+page.md} | 3 +- .../+page.md} | 2 +- .../+page.md} | 3 +- .../+page.md} | 6 +- .../+page.md} | 6 +- .../+page.md} | 6 +- .../{core.md => [...1]core/+page.md} | 6 +- .../{gas.md => [...2]gas/+page.md} | 6 +- .../{react.md => [...3]react/+page.md} | 6 +- .../+page.md} | 6 +- .../{vue.md => [...5]vue/+page.md} | 33 +- .../{keystone.md => [...10]keystone/+page.md} | 6 +- .../{ledger.md => [...11]ledger/+page.md} | 6 +- .../{magic.md => [...12]magic/+page.md} | 6 +- .../{mew.md => [...13]mew/+page.md} | 6 +- .../+page.md} | 6 +- .../{phantom.md => [...15]phantom/+page.md} | 6 +- .../{portis.md => [...16]portis/+page.md} | 7 +- .../{taho.md => [...17]taho/+page.md} | 5 +- .../{tallyho.md => [...18]tallyho/+page.md} | 5 +- .../{torus.md => [...19]torus/+page.md} | 6 +- .../{coinbase.md => [...1]coinbase/+page.md} | 6 +- .../{trezor.md => [...20]trezor/+page.md} | 6 +- .../{uauth.md => [...21]uauth/+page.md} | 6 +- .../+page.md} | 6 +- .../+page.md} | 6 +- .../{web3auth.md => [...24]web3auth/+page.md} | 6 +- .../{xdefi.md => [...25]xdefi/+page.md} | 5 +- .../{zeal.md => [...26]zeal/+page.md} | 5 +- .../{dcent.md => [...2]dcent/+page.md} | 6 +- .../{enkrypt.md => [...3]enkrypt/+page.md} | 6 +- .../{formatic.md => [...4]fortmatic/+page.md} | 6 +- .../{frontier.md => [...5]frontier/+page.md} | 6 +- .../{gnosis.md => [...6]gnosis/+page.md} | 6 +- .../+page.md} | 5 +- .../{injected.md => [...8]injected/+page.md} | 7 +- .../{keepkey.md => [...9]keepkey/+page.md} | 6 +- .../+page.md} | 6 +- .../+page.md} | 6 +- docs/src/routes/docs/__layout@kit-docs.svelte | 3 - docs/src/routes/docs/index.svelte | 11 - docs/src/routes/examples/+page.js | 8 + .../examples/[...1]connect-wallet/+page.md} | 231 + .../+page.md} | 11 +- .../routes/examples/__layout@kit-docs.svelte | 3 - docs/src/routes/examples/connect-wallet.md | 25 - docs/src/routes/examples/index.svelte | 11 - docs/src/routes/faq/{index.md => +page.md} | 6 +- docs/src/routes/faq/__layout@kit-docs.svelte | 3 - docs/src/routes/index@homepage.svelte | 5 - .../+server.js} | 4 +- .../+server.js} | 4 +- .../theming-tool/__layout@homepage.svelte | 3 - docs/src/routes/theming-tool/index.md | 4 - docs/static/favicon.ico | Bin 0 -> 861 bytes docs/svelte.config.js | 89 +- docs/tailwind.config.cjs | 241 +- docs/tests/test.ts | 6 - docs/tsconfig.json | 4 +- docs/vite.config.js | 44 + docs/yarn.lock | 5014 +++++++---------- 124 files changed, 3778 insertions(+), 4607 deletions(-) delete mode 100644 docs/.eslintignore delete mode 100644 docs/.eslintrc.cjs delete mode 100644 docs/playwright.config.ts rename docs/src/{lib => }/fonts/FiraCode-VF.woff (100%) rename docs/src/{lib => }/fonts/FiraCode-VF.woff2 (100%) rename docs/src/{lib => }/fonts/Inter-VF.italic-latin.woff2 (100%) rename docs/src/{lib => }/fonts/Inter-VF.roman-latin.woff2 (100%) rename docs/src/{lib => }/fonts/SofiaPro-Light.eot (100%) rename docs/src/{lib => }/fonts/SofiaPro-Light.svg (100%) rename docs/src/{lib => }/fonts/SofiaPro-Light.ttf (100%) rename docs/src/{lib => }/fonts/SofiaPro-Light.woff (100%) rename docs/src/{lib => }/fonts/SofiaPro-Light.woff2 (100%) rename docs/src/{lib => }/fonts/SofiaPro-Regular.eot (100%) rename docs/src/{lib => }/fonts/SofiaPro-Regular.svg (100%) rename docs/src/{lib => }/fonts/SofiaPro-Regular.ttf (100%) rename docs/src/{lib => }/fonts/SofiaPro-Regular.woff (100%) rename docs/src/{lib => }/fonts/SofiaPro-Regular.woff2 (100%) rename docs/src/{lib => }/fonts/SofiaPro-SemiBold.eot (100%) rename docs/src/{lib => }/fonts/SofiaPro-SemiBold.svg (100%) rename docs/src/{lib => }/fonts/SofiaPro-SemiBold.ttf (100%) rename docs/src/{lib => }/fonts/SofiaPro-SemiBold.woff (100%) rename docs/src/{lib => }/fonts/SofiaPro-SemiBold.woff2 (100%) delete mode 100644 docs/src/img/svelte-horizontal.svg create mode 100644 docs/src/kit-docs/README.md delete mode 100644 docs/src/kit-docs/index.ts create mode 100644 docs/src/lib/assets/favicon.ico create mode 100644 docs/src/lib/components/PrismJS.svelte delete mode 100644 docs/src/lib/components/ThemeCustomizer.svelte delete mode 100644 docs/src/lib/components/code-snippet/getting-started-guide.md delete mode 100644 docs/src/lib/components/code-snippet/install-code-tp.md delete mode 100644 docs/src/lib/components/code-snippet/install-code.md delete mode 100644 docs/src/lib/components/code-snippet/theming-code.md delete mode 100644 docs/src/lib/components/examples/connect-wallet/SvelteConnectWallet.md create mode 100644 docs/src/lib/components/tabs/TabItem.svelte create mode 100644 docs/src/lib/components/tabs/TabPanel.svelte create mode 100644 docs/src/lib/components/tabs/Tabs.svelte create mode 100644 docs/src/lib/components/tabs/index.ts create mode 100644 docs/src/lib/components/tabs/tabsRegistry.ts create mode 100644 docs/src/lib/components/tabs/utils.ts create mode 100644 docs/src/lib/styles/docsearch.css create mode 100644 docs/src/routes/+layout.js create mode 100644 docs/src/routes/+layout.svelte create mode 100644 docs/src/routes/+page.md delete mode 100644 docs/src/routes/__layout-homepage.svelte delete mode 100644 docs/src/routes/__layout-kit-docs.svelte create mode 100644 docs/src/routes/docs/+page.js rename docs/src/routes/docs/[...1]overview/{[...1]introduction.md => [...1]Introduction/+page.md} (99%) rename docs/src/routes/docs/[...1]overview/{[...2]contribution-guide.md => [...2]contribution-guide/+page.md} (99%) rename docs/src/routes/docs/[...1]overview/{[...3]onboard.js-migration-guide.md => [...3]onboard.js-migration-guide/+page.md} (99%) rename docs/src/routes/docs/[...2]getting-started/{[...1]installation.md => [...1]installation/+page.md} (97%) rename docs/src/routes/docs/[...2]getting-started/{[...2]theming.md => [...2]theming/+page.md} (99%) rename docs/src/routes/docs/[...2]getting-started/{[...3]custom-styling.md => [...3]custom-styling/+page.md} (99%) rename docs/src/routes/docs/[...3]modules/{core.md => [...1]core/+page.md} (99%) rename docs/src/routes/docs/[...3]modules/{gas.md => [...2]gas/+page.md} (98%) rename docs/src/routes/docs/[...3]modules/{react.md => [...3]react/+page.md} (99%) rename docs/src/routes/docs/[...3]modules/{transaction-preview.md => [...4]transaction-preview/+page.md} (99%) rename docs/src/routes/docs/[...3]modules/{vue.md => [...5]vue/+page.md} (98%) rename docs/src/routes/docs/[...4]wallets/{keystone.md => [...10]keystone/+page.md} (96%) rename docs/src/routes/docs/[...4]wallets/{ledger.md => [...11]ledger/+page.md} (95%) rename docs/src/routes/docs/[...4]wallets/{magic.md => [...12]magic/+page.md} (98%) rename docs/src/routes/docs/[...4]wallets/{mew.md => [...13]mew/+page.md} (95%) rename docs/src/routes/docs/[...4]wallets/{mewwallet.md => [...14]mewwallet/+page.md} (94%) rename docs/src/routes/docs/[...4]wallets/{phantom.md => [...15]phantom/+page.md} (97%) rename docs/src/routes/docs/[...4]wallets/{portis.md => [...16]portis/+page.md} (94%) rename docs/src/routes/docs/[...4]wallets/{taho.md => [...17]taho/+page.md} (92%) rename docs/src/routes/docs/[...4]wallets/{tallyho.md => [...18]tallyho/+page.md} (94%) rename docs/src/routes/docs/[...4]wallets/{torus.md => [...19]torus/+page.md} (97%) rename docs/src/routes/docs/[...4]wallets/{coinbase.md => [...1]coinbase/+page.md} (96%) rename docs/src/routes/docs/[...4]wallets/{trezor.md => [...20]trezor/+page.md} (97%) rename docs/src/routes/docs/[...4]wallets/{uauth.md => [...21]uauth/+page.md} (98%) rename docs/src/routes/docs/[...4]wallets/{walletconnect.md => [...22]walletconnect/+page.md} (98%) rename docs/src/routes/docs/[...4]wallets/{walletlink.md => [...23]walletlink/+page.md} (95%) rename docs/src/routes/docs/[...4]wallets/{web3auth.md => [...24]web3auth/+page.md} (99%) rename docs/src/routes/docs/[...4]wallets/{xdefi.md => [...25]xdefi/+page.md} (94%) rename docs/src/routes/docs/[...4]wallets/{zeal.md => [...26]zeal/+page.md} (95%) rename docs/src/routes/docs/[...4]wallets/{dcent.md => [...2]dcent/+page.md} (94%) rename docs/src/routes/docs/[...4]wallets/{enkrypt.md => [...3]enkrypt/+page.md} (94%) rename docs/src/routes/docs/[...4]wallets/{formatic.md => [...4]fortmatic/+page.md} (94%) rename docs/src/routes/docs/[...4]wallets/{frontier.md => [...5]frontier/+page.md} (94%) rename docs/src/routes/docs/[...4]wallets/{gnosis.md => [...6]gnosis/+page.md} (97%) rename docs/src/routes/docs/[...4]wallets/{infinitywallet.md => [...7]infinitywallet/+page.md} (96%) rename docs/src/routes/docs/[...4]wallets/{injected.md => [...8]injected/+page.md} (99%) rename docs/src/routes/docs/[...4]wallets/{keepkey.md => [...9]keepkey/+page.md} (96%) rename docs/src/routes/docs/[...5]resources/{[...1]resources.md => [...1]resources/+page.md} (96%) rename docs/src/routes/docs/[...5]resources/{[...2]troubleshooting.md => [...2]troubleshooting/+page.md} (98%) delete mode 100644 docs/src/routes/docs/__layout@kit-docs.svelte delete mode 100644 docs/src/routes/docs/index.svelte create mode 100644 docs/src/routes/examples/+page.js rename docs/src/{lib/components/examples/connect-wallet/ReactConnectWallet.md => routes/examples/[...1]connect-wallet/+page.md} (53%) rename docs/src/routes/examples/{uniswap-widget.md => [...2]uniswap-widget/+page.md} (97%) delete mode 100644 docs/src/routes/examples/__layout@kit-docs.svelte delete mode 100644 docs/src/routes/examples/connect-wallet.md delete mode 100644 docs/src/routes/examples/index.svelte rename docs/src/routes/faq/{index.md => +page.md} (94%) delete mode 100644 docs/src/routes/faq/__layout@kit-docs.svelte delete mode 100644 docs/src/routes/index@homepage.svelte rename docs/src/routes/kit-docs/{[dir].sidebar.json.js => [dir].sidebar/+server.js} (52%) rename docs/src/routes/kit-docs/{[slug].meta.json.js => [slug].meta/+server.js} (55%) delete mode 100644 docs/src/routes/theming-tool/__layout@homepage.svelte delete mode 100644 docs/src/routes/theming-tool/index.md create mode 100644 docs/static/favicon.ico delete mode 100644 docs/tests/test.ts create mode 100644 docs/vite.config.js diff --git a/docs/.eslintignore b/docs/.eslintignore deleted file mode 100644 index 38972655f..000000000 --- a/docs/.eslintignore +++ /dev/null @@ -1,13 +0,0 @@ -.DS_Store -node_modules -/build -/.svelte-kit -/package -.env -.env.* -!.env.example - -# Ignore files for PNPM, NPM and YARN -pnpm-lock.yaml -package-lock.json -yarn.lock diff --git a/docs/.eslintrc.cjs b/docs/.eslintrc.cjs deleted file mode 100644 index c9c248180..000000000 --- a/docs/.eslintrc.cjs +++ /dev/null @@ -1,20 +0,0 @@ -module.exports = { - root: true, - parser: '@typescript-eslint/parser', - extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'], - plugins: ['svelte3', '@typescript-eslint'], - ignorePatterns: ['*.cjs'], - overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }], - settings: { - 'svelte3/typescript': () => require('typescript') - }, - parserOptions: { - sourceType: 'module', - ecmaVersion: 2020 - }, - env: { - browser: true, - es2017: true, - node: true - } -} diff --git a/docs/.gitignore b/docs/.gitignore index 43cdd4575..6635cf554 100644 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -6,4 +6,5 @@ node_modules .env .env.* !.env.example -.vercel +vite.config.js.timestamp-* +vite.config.ts.timestamp-* diff --git a/docs/.prettierrc b/docs/.prettierrc index 4b35d552b..a77fddea9 100644 --- a/docs/.prettierrc +++ b/docs/.prettierrc @@ -1,8 +1,9 @@ { - "useTabs": false, - "tabWidth": 2, - "singleQuote": true, - "trailingComma": "none", - "printWidth": 100, - "semi": false + "useTabs": true, + "singleQuote": true, + "trailingComma": "none", + "printWidth": 100, + "plugins": ["prettier-plugin-svelte"], + "pluginSearchDirs": ["."], + "overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }] } diff --git a/docs/README.md b/docs/README.md index c3385e03e..5c91169b0 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,25 +1,38 @@ -# Docs +# create-svelte -## Prereqs +Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte). -Install [yarn](https://classic.yarnpkg.com/en/docs/install) +## Creating a project -## Running docs server locally +If you're seeing this, you've probably already done this step. Congrats! -Run the following command within the `docs/` folder +```bash +# create a new project in the current directory +npm create svelte@latest -```sh -yarn && yarn dev +# create a new project in my-app +npm create svelte@latest my-app ``` -The server should start on [localhost:3000](http://localhost:3000/). +## Developing -## Contributing +Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server: -Confirm changes look as expected on local instance. +```bash +npm run dev -Run `yarn build` and confirm no errors present from the proposed changes. +# or start the server and open the app in a new browser tab +npm run dev -- --open +``` + +## Building + +To create a production version of your app: + +```bash +npm run build +``` -Confirm vercel build within PR builds without error and check instance deployment for accuracy. +You can preview the production build with `npm run preview`. -PR should target branch the main develop branch - [develop](https://github.com/blocknative/web3-onboard/tree/develop). \ No newline at end of file +> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment. diff --git a/docs/package.json b/docs/package.json index d3a850473..4898af880 100644 --- a/docs/package.json +++ b/docs/package.json @@ -1,57 +1,46 @@ { - "name": "docs", + "name": "mydocs", "version": "0.0.1", + "private": true, "scripts": { - "dev": "svelte-kit dev", - "build": "NODE_OPTIONS=--max_old_space_size=8192 svelte-kit build", - "package": "svelte-kit package", - "preview": "svelte-kit preview", - "prepare": "svelte-kit sync", - "test": "playwright test", - "check": "svelte-check --tsconfig ./tsconfig.json", - "check:watch": "svelte-check --tsconfig ./tsconfig.json --watch", - "lint": "prettier --check --plugin-search-dir=. . && eslint .", - "format": "prettier --write --plugin-search-dir=. .", - "update-w3o-to-prod": "yarn add '@web3-onboard/coinbase@next' '@web3-onboard/core@next' '@web3-onboard/dcent@next' '@web3-onboard/enkrypt@next' '@web3-onboard/fortmatic@next' '@web3-onboard/gas@next' '@web3-onboard/gnosis@next' '@web3-onboard/infinity-wallet@next' '@web3-onboard/injected-wallets@next' '@web3-onboard/keepkey@next' '@web3-onboard/keystone@next' '@web3-onboard/ledger@next' '@web3-onboard/magic@next' '@web3-onboard/mew-wallet@next' '@web3-onboard/portis@next' '@web3-onboard/sequence@next' '@web3-onboard/taho@next' '@web3-onboard/torus@next' '@web3-onboard/transaction-preview@next' '@web3-onboard/trezor@next' '@web3-onboard/trust@next' '@web3-onboard/uauth@next' '@web3-onboard/walletconnect@next' '@web3-onboard/web3auth@next' '@web3-onboard/xdefi@next'" + "dev": "vite dev", + "build": "vite build", + "preview": "vite preview", + "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", + "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", + "lint": "prettier --plugin-search-dir . --check .", + "format": "prettier --plugin-search-dir . --write .", + "prepare": "svelte-kit sync" }, "devDependencies": { - "@algolia/client-search": "^4.14.2", - "@docsearch/css": "^3.2.1", - "@docsearch/js": "^3.2.1", - "@iconify-json/ri": "^1.1.3", - "@playwright/test": "^1.22.2", - "@sveltejs/adapter-static": "^1.0.0-next.39", - "@sveltejs/adapter-vercel": "next", - "@sveltejs/kit": "1.0.0-next.357", - "@svelteness/kit-docs": "^0.22.12", - "@tailwindcss/typography": "^0.5.2", - "@types/react": "^18.0.21", - "@types/react-dom": "^18.0.6", - "@typescript-eslint/eslint-plugin": "^5.27.0", - "@typescript-eslint/parser": "^5.27.0", - "@vitebook/client": "^0.100.5", - "@vitebook/core": "^0.100.5", - "@vitebook/markdown-shiki": "^0.100.5", - "@vitebook/markdown-svelte": "^0.100.5", - "autoprefixer": "^10.4.7", - "clsx": "^1.1.1", - "daisyui": "^2.17.0", - "eslint": "^8.16.0", - "eslint-config-prettier": "^8.3.0", - "eslint-plugin-svelte3": "^4.0.0", - "postcss": "^8.4.14", - "prettier": "^2.6.2", - "prettier-plugin-svelte": "^2.7.0", + "@algolia/client-search": "^4.17.0", + "@docsearch/css": "^3.3.3", + "@docsearch/js": "^3.3.3", + "@iconify-json/ri": "^1.0.0", + "@sveltejs/adapter-auto": "^2.0.0", + "@sveltejs/kit": "^1.5.0", + "@svelteness/kit-docs": "^1.1.3", + "@tailwindcss/typography": "^0.5.9", + "@types/animejs": "^3.1.7", + "@types/react": "^18.0.37", + "assert": "^2.0.0", + "autoprefixer": "^10.4.14", + "clsx": "^1.0.0", + "crypto-browserify": "^3.12.0", + "prettier": "^2.8.0", + "prettier-plugin-svelte": "^2.8.1", "react": "^18.2.0", "react-dom": "^18.2.0", - "rollup-plugin-polyfill-node": "^0.11.0", - "shiki": "^0.10.1", - "svelte": "^3.49.0", - "svelte-check": "^2.7.1", - "svelte-preprocess": "^4.10.7", - "tslib": "^2.3.1", - "typescript": "^4.7.2", - "unplugin-icons": "^0.13.4" + "rollup-plugin-polyfill-node": "^0.12.0", + "shiki": "^0.12.0", + "stream-browserify": "^3.0.0", + "svelte": "^3.54.0", + "svelte-check": "^3.0.1", + "svelte-preprocess": "^5.0.3", + "tslib": "^2.4.1", + "typescript": "^5.0.4", + "unplugin-icons": "^0.14.0", + "vite": "^4.2.2" }, "type": "module", "dependencies": { @@ -82,6 +71,7 @@ "@web3-onboard/xdefi": "^2.0.2-alpha.1", "animejs": "^3.2.1", "bnc-sdk": "^4.6.6", - "ethers": "^5.7.0" + "ethers": "^5.7.0", + "tailwindcss": "^3.3.1" } } diff --git a/docs/playwright.config.ts b/docs/playwright.config.ts deleted file mode 100644 index 086f60504..000000000 --- a/docs/playwright.config.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { PlaywrightTestConfig } from '@playwright/test' - -const config: PlaywrightTestConfig = { - webServer: { - command: 'npm run build && npm run preview', - port: 3000 - } -} - -export default config diff --git a/docs/postcss.config.cjs b/docs/postcss.config.cjs index 85f717cc0..054c147cb 100644 --- a/docs/postcss.config.cjs +++ b/docs/postcss.config.cjs @@ -1,6 +1,6 @@ module.exports = { - plugins: { - tailwindcss: {}, - autoprefixer: {} - } -} + plugins: { + tailwindcss: {}, + autoprefixer: {} + } +}; diff --git a/docs/src/app.css b/docs/src/app.css index b5c61c956..bd6213e1d 100644 --- a/docs/src/app.css +++ b/docs/src/app.css @@ -1,3 +1,3 @@ @tailwind base; @tailwind components; -@tailwind utilities; +@tailwind utilities; \ No newline at end of file diff --git a/docs/src/app.d.ts b/docs/src/app.d.ts index 02d3fab72..0a0a6f2ec 100644 --- a/docs/src/app.d.ts +++ b/docs/src/app.d.ts @@ -1,14 +1,14 @@ -/// /// // See https://kit.svelte.dev/docs/types#app // for information about these interfaces -// and what to do when importing types -declare namespace App { - // interface Locals {} - // interface Platform {} - // interface Session {} - // interface Stuff {} +declare global { + namespace App { + // interface Error {} + // interface Locals {} + // interface PageData {} + // interface Platform {} + } } -declare module '@svelteness/kit-docs/tailwind.config.cjs' +export {}; diff --git a/docs/src/app.html b/docs/src/app.html index 008b56e67..7d5137c4f 100644 --- a/docs/src/app.html +++ b/docs/src/app.html @@ -1,33 +1,24 @@ - - - - - %sveltekit.head% - - - - - + + + + + - - -
%sveltekit.body%
- + + %sveltekit.head% + + +
%sveltekit.body%
+ diff --git a/docs/src/lib/fonts/FiraCode-VF.woff b/docs/src/fonts/FiraCode-VF.woff similarity index 100% rename from docs/src/lib/fonts/FiraCode-VF.woff rename to docs/src/fonts/FiraCode-VF.woff diff --git a/docs/src/lib/fonts/FiraCode-VF.woff2 b/docs/src/fonts/FiraCode-VF.woff2 similarity index 100% rename from docs/src/lib/fonts/FiraCode-VF.woff2 rename to docs/src/fonts/FiraCode-VF.woff2 diff --git a/docs/src/lib/fonts/Inter-VF.italic-latin.woff2 b/docs/src/fonts/Inter-VF.italic-latin.woff2 similarity index 100% rename from docs/src/lib/fonts/Inter-VF.italic-latin.woff2 rename to docs/src/fonts/Inter-VF.italic-latin.woff2 diff --git a/docs/src/lib/fonts/Inter-VF.roman-latin.woff2 b/docs/src/fonts/Inter-VF.roman-latin.woff2 similarity index 100% rename from docs/src/lib/fonts/Inter-VF.roman-latin.woff2 rename to docs/src/fonts/Inter-VF.roman-latin.woff2 diff --git a/docs/src/lib/fonts/SofiaPro-Light.eot b/docs/src/fonts/SofiaPro-Light.eot similarity index 100% rename from docs/src/lib/fonts/SofiaPro-Light.eot rename to docs/src/fonts/SofiaPro-Light.eot diff --git a/docs/src/lib/fonts/SofiaPro-Light.svg b/docs/src/fonts/SofiaPro-Light.svg similarity index 100% rename from docs/src/lib/fonts/SofiaPro-Light.svg rename to docs/src/fonts/SofiaPro-Light.svg diff --git a/docs/src/lib/fonts/SofiaPro-Light.ttf b/docs/src/fonts/SofiaPro-Light.ttf similarity index 100% rename from docs/src/lib/fonts/SofiaPro-Light.ttf rename to docs/src/fonts/SofiaPro-Light.ttf diff --git a/docs/src/lib/fonts/SofiaPro-Light.woff b/docs/src/fonts/SofiaPro-Light.woff similarity index 100% rename from docs/src/lib/fonts/SofiaPro-Light.woff rename to docs/src/fonts/SofiaPro-Light.woff diff --git a/docs/src/lib/fonts/SofiaPro-Light.woff2 b/docs/src/fonts/SofiaPro-Light.woff2 similarity index 100% rename from docs/src/lib/fonts/SofiaPro-Light.woff2 rename to docs/src/fonts/SofiaPro-Light.woff2 diff --git a/docs/src/lib/fonts/SofiaPro-Regular.eot b/docs/src/fonts/SofiaPro-Regular.eot similarity index 100% rename from docs/src/lib/fonts/SofiaPro-Regular.eot rename to docs/src/fonts/SofiaPro-Regular.eot diff --git a/docs/src/lib/fonts/SofiaPro-Regular.svg b/docs/src/fonts/SofiaPro-Regular.svg similarity index 100% rename from docs/src/lib/fonts/SofiaPro-Regular.svg rename to docs/src/fonts/SofiaPro-Regular.svg diff --git a/docs/src/lib/fonts/SofiaPro-Regular.ttf b/docs/src/fonts/SofiaPro-Regular.ttf similarity index 100% rename from docs/src/lib/fonts/SofiaPro-Regular.ttf rename to docs/src/fonts/SofiaPro-Regular.ttf diff --git a/docs/src/lib/fonts/SofiaPro-Regular.woff b/docs/src/fonts/SofiaPro-Regular.woff similarity index 100% rename from docs/src/lib/fonts/SofiaPro-Regular.woff rename to docs/src/fonts/SofiaPro-Regular.woff diff --git a/docs/src/lib/fonts/SofiaPro-Regular.woff2 b/docs/src/fonts/SofiaPro-Regular.woff2 similarity index 100% rename from docs/src/lib/fonts/SofiaPro-Regular.woff2 rename to docs/src/fonts/SofiaPro-Regular.woff2 diff --git a/docs/src/lib/fonts/SofiaPro-SemiBold.eot b/docs/src/fonts/SofiaPro-SemiBold.eot similarity index 100% rename from docs/src/lib/fonts/SofiaPro-SemiBold.eot rename to docs/src/fonts/SofiaPro-SemiBold.eot diff --git a/docs/src/lib/fonts/SofiaPro-SemiBold.svg b/docs/src/fonts/SofiaPro-SemiBold.svg similarity index 100% rename from docs/src/lib/fonts/SofiaPro-SemiBold.svg rename to docs/src/fonts/SofiaPro-SemiBold.svg diff --git a/docs/src/lib/fonts/SofiaPro-SemiBold.ttf b/docs/src/fonts/SofiaPro-SemiBold.ttf similarity index 100% rename from docs/src/lib/fonts/SofiaPro-SemiBold.ttf rename to docs/src/fonts/SofiaPro-SemiBold.ttf diff --git a/docs/src/lib/fonts/SofiaPro-SemiBold.woff b/docs/src/fonts/SofiaPro-SemiBold.woff similarity index 100% rename from docs/src/lib/fonts/SofiaPro-SemiBold.woff rename to docs/src/fonts/SofiaPro-SemiBold.woff diff --git a/docs/src/lib/fonts/SofiaPro-SemiBold.woff2 b/docs/src/fonts/SofiaPro-SemiBold.woff2 similarity index 100% rename from docs/src/lib/fonts/SofiaPro-SemiBold.woff2 rename to docs/src/fonts/SofiaPro-SemiBold.woff2 diff --git a/docs/src/img/svelte-horizontal.svg b/docs/src/img/svelte-horizontal.svg deleted file mode 100644 index fadf24d5e..000000000 --- a/docs/src/img/svelte-horizontal.svg +++ /dev/null @@ -1 +0,0 @@ -svelte-horizontal diff --git a/docs/src/kit-docs/README.md b/docs/src/kit-docs/README.md new file mode 100644 index 000000000..a58198a69 --- /dev/null +++ b/docs/src/kit-docs/README.md @@ -0,0 +1,120 @@ +# `kit-docs` + +## Global Components + +You can create Svelte components that are global by placing them in this directory. Global +components are imported into every single Markdown file. In addition, they're automatically +mapped to Markdown containers, on which you can pass in props and dynamic slot elements. + +First, create a component in this directory: + +``` +src +└─ kit-docs + ├─ Button.svelte <- +``` + +Now, inside your markdown files you can use the ` +``` + +## Default Components + +There's a few components we provide out of the box such as `CodeFence`, `CodeInline`, `Link` and +others. You can find all of our [default components](https://github.com/svelteness/kit-docs/tree/main/packages/kit-docs/src/lib/kit-docs) +on GitHub. + +### Overriding + +If you want to override any of the default components, simply create a Svelte component with the +same name in this directory and make sure it accepts the same props. + +For example, you can override `CodeFence` by creating it in this directory like so: + +``` +src +└─ kit-docs + ├─ CodeFence.svelte <- +``` + +Finally, you can use the following minimal boilerplate and style the component as desired: + +```svelte title=CodeFence.svelte|copy + + +
+ {@html code} +
+``` diff --git a/docs/src/kit-docs/index.ts b/docs/src/kit-docs/index.ts deleted file mode 100644 index cc3f9f4d6..000000000 --- a/docs/src/kit-docs/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { Tabs, TabPanel, TabItem } from './tabs' diff --git a/docs/src/lib/assets/favicon.ico b/docs/src/lib/assets/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..9aae6c08a88bdaed7545f2a613104394e5fb6e31 GIT binary patch literal 861 zcmV-j1ETziP)o) z6G0Sxn-(KRL$FOEMC{3;2caTpP*5A{JHwWH-n5J*Dh+GOtLR`9bhLZ5kzyp|t-EPCJ8&`Gh3<;R|GArf7 z3z)^}Q(kxvAK=<>tDqc-g{??Ulpw6E0V^Ubt5O49U8B#-pT`g%xIn#Lk7#cQon8H! z>l%uHwaEpS_atb~7KDnqzu9?weDxIZN3|nFA`l4&upt309o>|iQj21RhMDmpdL<=G zs-_lrWvMH`dCZ5MZATPRk!g^wA~MsjQT&~yvoDFtn{C13jVIbtJ;nro3L+#9@BHO{Sq&Q=?u zM;mI+#WD`WCacFk&1KLrB}*m{m~81W_pZ9Fb0ZKN8Pz-sNJwiX*8ZD=W#mvrNUwA< zVNL*n)>%M8N@~0u&BuM%QnqDK?nEp;8$~I*WL^O8EQo~tN~dewW`n0aq~wa6vIM1U z20!1_KAsKr0p5uyN5OqoN?4~`$yOEt_LplfRq*^tt6C58E<9dDK7mm - import { onMount } from 'svelte' - import type { OnboardAPI, WalletState } from '@web3-onboard/core' - import getOnboard from '$lib/services/onboard.js' - let onboard: OnboardAPI - let connectedWallets: WalletState[] - let buttonText = 'Connect' + import { onMount } from 'svelte'; + import type { OnboardAPI, WalletState } from '@web3-onboard/core'; + import getOnboard from '$lib/services/onboard.js'; + import { Button } from '@svelteness/kit-docs'; + let onboard: OnboardAPI; + let connectedWallets: WalletState[]; + let buttonText = 'Connect'; - async function connectWallet() { - if (!onboard) await initOnboard() - if (onboard && onboard.state.get().wallets.length) { - onboard.disconnectWallet({ label: onboard.state.get().wallets[0].label }) - buttonText = 'Connect' - return - } - if (onboard) { - await onboard.connectWallet() - } - } + async function connectWallet() { + if (!onboard) await initOnboard(); + if (onboard && onboard.state.get().wallets.length) { + onboard.disconnectWallet({ label: onboard.state.get().wallets[0].label }); + buttonText = 'Connect'; + return; + } + if (onboard) { + await onboard.connectWallet(); + } + } - const initOnboard = async () => { - if (document.location.href.includes('theming-tool')) { - onboard = await getOnboard('default') - } else { - onboard = await getOnboard() - } - } + const initOnboard = async () => { + if (document.location.href.includes('theming-tool')) { + onboard = await getOnboard('default'); + } else { + onboard = await getOnboard(); + } + }; - onMount(async () => { - if (!onboard) { - await initOnboard() - } - onboard.state.select('wallets').subscribe((wallets) => { - connectedWallets = wallets - buttonText = wallets.length ? 'Disconnect' : (buttonText = 'Connect') - }) - buttonText = onboard.state.get().wallets.length ? 'Disconnect' : (buttonText = 'Connect') - }) + onMount(async () => { + if (!onboard) { + await initOnboard(); + } + onboard.state.select('wallets').subscribe((wallets) => { + connectedWallets = wallets; + buttonText = wallets.length ? 'Disconnect' : (buttonText = 'Connect'); + }); + buttonText = onboard.state.get().wallets.length ? 'Disconnect' : (buttonText = 'Connect'); + }); - diff --git a/docs/src/lib/components/FeaturesSection.svelte b/docs/src/lib/components/FeaturesSection.svelte index 718d1a6f8..c6d41c421 100644 --- a/docs/src/lib/components/FeaturesSection.svelte +++ b/docs/src/lib/components/FeaturesSection.svelte @@ -12,9 +12,6 @@ import AccountCenterGraphic from './svg/account-center-graphic.svg' import WalletsGraphic from './svg/wallet-row.svg' import TransactionPreviewGraphic from './svg/transaction-preview-graphic.svg' - - import InstallCode from './code-snippet/install-code.md' - import InstallCodeTp from './code-snippet/install-code-tp.md'
@@ -31,8 +28,8 @@
-
- +
+
@@ -113,7 +110,8 @@ >
- + +
@@ -211,6 +209,10 @@ flex: 50%; } + .fixed-width { + max-width: 800px; + } + @media screen and (min-width: 640px) { .flexbox { flex-flow: row nowrap; diff --git a/docs/src/lib/components/GettingStarted.svelte b/docs/src/lib/components/GettingStarted.svelte index aad08a930..ecfd754d6 100644 --- a/docs/src/lib/components/GettingStarted.svelte +++ b/docs/src/lib/components/GettingStarted.svelte @@ -1,10 +1,6 @@ - -
- +
diff --git a/docs/src/lib/components/HeroSection.svelte b/docs/src/lib/components/HeroSection.svelte index e3e077be5..d5ff33653 100644 --- a/docs/src/lib/components/HeroSection.svelte +++ b/docs/src/lib/components/HeroSection.svelte @@ -1,7 +1,6 @@ @@ -13,7 +12,7 @@ {'Open-source, framework-agnostic JavaScript library to onboard users to web3 apps. Help your users transact with ease by enabling wallet connection, real-time transaction states, and more.'}
- +