Skip to content

Commit

Permalink
Add docs site code to develop branch (#1460)
Browse files Browse the repository at this point in the history
* Update route name + formatting

* run yarn format

* add named layout for homepage and apply

* Add packags

* Use builtin navbar

* Fix layout

* remove comment

* add head info for homepage layout

* rename index file to use homepage layout

* remove max-width override

We don't want all pages to have max-width of 100%.

This is only relevant for the home page and this is a reason why we're using different layouts. We want to keep things separate.

* add NavBar import back.

* move low-level components to /base folder and update imports

* remove content-max-width check

We're using two different layouts. We don't need this fix for homepage on the docs layout. Please add homepage relevant changes to the relevant layout.

* import normalize into homepage layout

* add media queries to themes graphic

- rename files
- update import names

* remove height and width attributes from svgs

* add responsive styles for features graphics

- rename svg files+ imports
- hide scroll bars on scroll containers

* add ScrollContainer component

- create new base component
- use ScrollContainer in appropriate sections

* update favicon

* add more props to Flexbox component

* add link urls and use unplugin icons in Footer

* Adds back tabs for installation + fixes fonts

* add wallet connect image + remove examples link

* add kit-docs sidebar to homepage layout

* Create [...3]migration-guide.md

migrated the migration guide

* add slot to TextBlock component

remove placeholder anchor element

* update Button component

- add link + icon styles
- use anchor element
- tweak button style

* update Button usage instances

- add section id

* add hover transitions to social links

* add learn more and view demo links

* remove height and width from svg graphic

* add spacer div

* remove faux code block tabs

* remove Blocknative text from nav

* replace Blocknative nav text

* add local kit-docs theme variables

- override --kd-font-family-sans
- override --kd-color-gray-body

* update layouts

- use local theme variables file
- don't import vars.css or fonts.css
- remove Button import
- update brand color var

* update testimonials section

- add new graphic
- simplify styles

* add getting started markdown guide

* update getting started section

- import md file to access CodeFence features
- use .prose text styling from tailwind
- remove unused css
- remove unused markup

* remove empty spaces from code

* move font-face styles

- move @font-face declarations to fonts.css
- update layout imports

* add line numbers to code fence

* remove old code snippets + add tabs to all packages

* move app.css import to top of files

- This is currently causing conflicts. There are some yet to be resolved issues with our tailwind install. It seems like we're double-importing the Tailwind directives. Once in app.css from us and again in theme.css from kit-docs.

- This is a temp fix

* add max-width styles

- remove tailwind width classes. Not working as expected.

* add github social link to layouts

* move Tabs component to global components folder

- this makes it so they're imported into every single Markdown file
- move components to src/kit-docs
- remove imports from components/index.ts
- remove imports from md files

* tweak Tabs design

* update theming section

- add updated graphic
- add theming-code CodeFence

* update frameworks section

- add install-code CodeFence

* update installation md

- add white space
- remove extra spaces

* add the same nav links on both layouts

* add simple faq page

* update top nav

- add faq links
- add discord links
- add prerender to homepage

* update footer

- add youtube link
- spacing tweaks

* Prepare repo for static deployment + formating

* add last marketing pixel

* remove console log

* add current branch to workflow trigger for testing

* add Global site tag

* update tracking codes

* Create [...4]resources

* added resource links

* updated titles

* added supported networks list

* added init options link

* create faq.md

* added link to supported chains docs

* Re-org/re-name sidebar items

* fixed typo

* intro final draft

* updated title & intro

* core-updates

* Move examples to separate page

* added natively supported wallets

* Add react & svelte connect wallet example

* Fix build error

* Change sidebar title + fix connect wallet example

* modify workflow to allow manual trigger

* update workflow

* update workflow

* update workflow - add back current branch

* change which adapter is used

* update workflow for debugging

* update workflow path to built files

* update workflow path to built files

* remove hubspot embed code

* fix some broken links

* update landing page graphics

- center wallets row on larger screens

* add responsive code for themes graphic

* replace connect wallet image

* change FAQ route

* edit FAQ markdown

- add correct link
- remove old faq.md

* update images for hero section

- update hero-img.svg
- remove unused HeroBackground.svelte file
- small style updates to Button and HeroSection

* update theming section graphics

- add updated wallet-row graphic
- remove unused svg components
- style tweaks to theming section

* update wallets graphic

- add updated wallet-row svg
- update imports
- remove unused components

* fix svgs not displaying correctly in Safari

* update connect modal svg

* update blog link

* link added to faq

* customization file added

* fixed link & formatting

* added hint/info styling and customization

* Update onboard graphics

- fixed typo

* add zapper to users graphics

* remove unused svg

* svg updates

- update powered by badge code
- remove unused svgs

* Documentation - Theming Customizer (#1275)

* Update docs/src/lib/components/HeroSection.svelte

* Update docs/src/routes/docs/[...2]getting-started/[...2]customization.md

* Update docs/src/routes/docs/[...2]getting-started/[...2]customization.md

* change description on homepage

* Bump internal version, add enter submit for ifram url, reset btn closes onboard and resets mapping (#1278)

* remove unused import

* vercel adapter fix

* rename /theming to /theming-tool

* remove theming section for core package md

- reduce having the same info on two places

* update customization page

- rework admonition types.
- reduce the use of 'theming' in language. We don't really support themes. We support customizing some css properties via variables.
- remove fonts and borders section.
- update language to use css custom properties vs variables for clarity.

* update language

* fix unused selector warning

* add type to a favicon link

* add meta tag image

* add SEO components

- add twitter meta tags
- add OpenGraph meta tags
- add SEO index component

* add SEO component to homepage layout

* update favicon url

- it's not rendering correctly live for some reason

* Update branch for gh-pages workflow

* Update branch name for deploy trigger

* update favicon asset path

Co-authored-by: Taylor Dawson <taylorjdawson@gmail.com>

* Feature/uniswap example (#1280)

* Remove broken uniswap widget
* Use vercel adapter when ran in vercel
* Finish up example
* Remove unused deps
* Update formatting
* added explainer text
* Revert faq change
* lock sveltekit version

Co-authored-by: Murat Akdeniz <maa357@cornell.edu>

* added explainer text to injected page

* change title of example page

* add description

* update versioning

* Revert "update versioning"

This reverts commit d6cef07.

* move meta image to assets folder

* Update docs/src/lib/components/SEO/index.svelte

Co-authored-by: Taylor Dawson <taylorjdawson@gmail.com>

* updated docs faq styling

added link to discord
tabbed over faq answers

* Update README.md

replaced initial svelt README with README for contributors

* Update [...2]onboard.js-migration-guide.md

updated links, punctuation and grammar.

* Update docs/README.md

Co-authored-by: Adam Carpenter <adamcarpenter86@gmail.com>

* Update docs/README.md

Co-authored-by: Adam Carpenter <adamcarpenter86@gmail.com>

* Update README.md

* Update [...2]onboard.js-migration-guide.md

* Rename [...2]onboard.js-migration-guide.md to [...3]onboard.js-migration-guide.md

* creating contribution guide

* added docs contribution guidelines

* minor typo fix

* addressed comments from PR and updated links

* Create [...2]onboard.js-migration-guide.md

* Remove duplicate cmigration guide

* Add changes that were part of duplicate mig guide

* Revert relative path for external

* Update link from expired docs to examples folder

* injected wallets doc fix

* no version bump needed

* Add Search to Docs (#1322)

* Update layout
* Update homepage
* Add algolia packages
* Update index name
* Update search keys
* yarn it

* Remove algolia from layout-homepage

* Update docs/src/routes/__layout-homepage.svelte

* Update docs/src/routes/__layout-homepage.svelte

* Docs Releases - Search and Migration Guide Updates (#1342)

* Update [...2]onboard.js-migration-guide.md

updated links, punctuation and grammar.

* addressed comments from PR and updated links

* Create [...2]onboard.js-migration-guide.md

* Remove duplicate cmigration guide

* Add changes that were part of duplicate mig guide

* Revert relative path for external

* Update link from expired docs to examples folder

* injected wallets doc fix

* no version bump needed

* Add Search to Docs (#1322)

* Update layout
* Update homepage
* Add algolia packages
* Update index name
* Update search keys
* yarn it

* Remove algolia from layout-homepage

Co-authored-by: laurencedelisle <53497147+laurencedelisle@users.noreply.github.com>
Co-authored-by: mhchaudhry3 <mobeen@blocknative.com>

* Update index name

* HotFix - Add Algolia Index (#1343)

* Update [...2]onboard.js-migration-guide.md

updated links, punctuation and grammar.

* addressed comments from PR and updated links

* Create [...2]onboard.js-migration-guide.md

* Remove duplicate cmigration guide

* Add changes that were part of duplicate mig guide

* Revert relative path for external

* Update link from expired docs to examples folder

* injected wallets doc fix

* no version bump needed

* Add Search to Docs (#1322)

* Update layout
* Update homepage
* Add algolia packages
* Update index name
* Update search keys
* yarn it

* Remove algolia from layout-homepage

* Update docs/src/routes/__layout-homepage.svelte

* Update docs/src/routes/__layout-homepage.svelte

* Update index name

Co-authored-by: laurencedelisle <53497147+laurencedelisle@users.noreply.github.com>
Co-authored-by: mhchaudhry3 <mobeen@blocknative.com>

* Docs gas example (#1333)

* site seo content edits

* Docs release (#1350)

* Update [...2]onboard.js-migration-guide.md

updated links, punctuation and grammar.

* addressed comments from PR and updated links

* Create [...2]onboard.js-migration-guide.md

* Remove duplicate cmigration guide

* Add changes that were part of duplicate mig guide

* Revert relative path for external

* Update link from expired docs to examples folder

* injected wallets doc fix

* no version bump needed

* Add Search to Docs (#1322)

* Update layout
* Update homepage
* Add algolia packages
* Update index name
* Update search keys
* yarn it

* Remove algolia from layout-homepage

* Update docs/src/routes/__layout-homepage.svelte

* Update docs/src/routes/__layout-homepage.svelte

* Update index name

* Docs gas example (#1333)

* site seo content edits

Co-authored-by: laurencedelisle <53497147+laurencedelisle@users.noreply.github.com>
Co-authored-by: Adam Carpenter <adamcarpenter86@gmail.com>
Co-authored-by: mhchaudhry3 <mobeen@blocknative.com>

* Update api keys

* API key update - keys have had origins restricted (#1356)

* Update [...2]onboard.js-migration-guide.md

updated links, punctuation and grammar.

* addressed comments from PR and updated links

* Create [...2]onboard.js-migration-guide.md

* Remove duplicate cmigration guide

* Add changes that were part of duplicate mig guide

* Revert relative path for external

* Update link from expired docs to examples folder

* injected wallets doc fix

* no version bump needed

* Add Search to Docs (#1322)

* Update layout
* Update homepage
* Add algolia packages
* Update index name
* Update search keys
* yarn it

* Remove algolia from layout-homepage

* Update docs/src/routes/__layout-homepage.svelte

* Update docs/src/routes/__layout-homepage.svelte

* Update index name

* Docs gas example (#1333)

* site seo content edits

* Update api keys

Co-authored-by: laurencedelisle <53497147+laurencedelisle@users.noreply.github.com>
Co-authored-by: mhchaudhry3 <mobeen@blocknative.com>
Co-authored-by: Gustavo Esquinca <g.esq.ca@gmail.com>

* Add gas unsubscribe on destroy (#1360)

* Re-org side menu + TOS in the footer (#1361)

* Re-org side menu + TOS in the footer

* fix typo

* fix paths

* update path

* re-style footer

Co-authored-by: Gustavo Esquinca <g.esq.ca@gmail.com>

* Add containerEl docs and update quickstart to remove deprecated chains and add new hot chains (#1382)

* Add conatinerEl docs and update quickstart to remove deprecated chains and add new hot chains

* Mark AC containerEl props as deprecated

* Add uauth docs

* Add enkrypt, mew-wallet, dep notice to mew package

* Cleanup

* Fix spelling

* Rename mewWallet md file to allow for proper md reading of mew

* Rename mewWallet md file to allow for proper md reading of mew

* remove common.md page

* Update mewwallet path (#1387)

* Update mew-wallet name

* Update mewwallet path (#1387) (#1388)

* Update mewwallet path (#1387)

* Feature - Add docs for Transaction Preview (#1395)

* Add docs for TransactionPreview

* Rename file with hyphen

* Add linking to api key info

* Add docs for Transaction Preview (#1400)

* Update mewwallet path (#1387)

* Update mew-wallet name

* Feature - Add docs for Transaction Preview (#1395)

* Add docs for TransactionPreview

* Rename file with hyphen

* Add linking to api key info

* Add wallet connect btn to navbar of Docs (#1396)

* Working with the exception of a few wallets

* Checking uauth issue

* Updated uauath wallet usage but still needs joi fix

* Committing with a couple of issues

* Connect example with icon

* Add o2 service for consistency when wallet is connected

* Refactor to simplify

* Add gas to optimizeDeps arr

* Add ga package back into deps

* Update versions to latest

* Everything working except torus

* All packages working, sveltekit config updated, w3o packages updated

* Add more build infor for create react app projects

* Add falsback to webpack config

* Add build env links to wallet modules and build env info to module docs

* Add build info to TP docs

* reorder onboard wallet mods

* Docs Release - Transaction Preview docs, Expanded build env documentation, Connect wallet btn and latest W3O packages (#1417)

* Update mewwallet path (#1387)

* Update mew-wallet name

* Feature - Add docs for Transaction Preview (#1395)

* Add docs for TransactionPreview

* Rename file with hyphen

* Add linking to api key info

* Add wallet connect btn to navbar of Docs (#1396)

* Working with the exception of a few wallets

* Checking uauth issue

* Updated uauath wallet usage but still needs joi fix

* Committing with a couple of issues

* Connect example with icon

* Add o2 service for consistency when wallet is connected

* Refactor to simplify

* Add gas to optimizeDeps arr

* Add ga package back into deps

* Update versions to latest

* Everything working except torus

* All packages working, sveltekit config updated, w3o packages updated

* Add more build infor for create react app projects

* Add falsback to webpack config

* Add build env links to wallet modules and build env info to module docs

* Add build info to TP docs

* reorder onboard wallet mods

* Testing deploy with upped node space

* Removing deploy test on docs-develop as its a protected env

* Increase JS heap to enable build (#1418)

* Update mewwallet path (#1387)

* Update mew-wallet name

* Feature - Add docs for Transaction Preview (#1395)

* Add docs for TransactionPreview

* Rename file with hyphen

* Add linking to api key info

* Add wallet connect btn to navbar of Docs (#1396)

* Working with the exception of a few wallets

* Checking uauth issue

* Updated uauath wallet usage but still needs joi fix

* Committing with a couple of issues

* Connect example with icon

* Add o2 service for consistency when wallet is connected

* Refactor to simplify

* Add gas to optimizeDeps arr

* Add ga package back into deps

* Update versions to latest

* Everything working except torus

* All packages working, sveltekit config updated, w3o packages updated

* Add more build infor for create react app projects

* Add falsback to webpack config

* Add build env links to wallet modules and build env info to module docs

* Add build info to TP docs

* reorder onboard wallet mods

* Testing deploy with upped node space

* Removing deploy test on docs-develop as its a protected env

* Bumnp js heap to 8gb

* Docs - Bump heap size to 8gb (#1419)

* Bumnp js heap to 8gb

* Update build for Torus which is working locally

* Update to svelte.config

* Add node options to yarn build

* Remove development flag from node polyfils within plugins

* add include array to nodePolyfills

* Add torus to include array from optimizeDeps

* Update externals

* More refinement

* Revert external array update

* update docs deps (#1430)

* update docs deps
* remove alpha

* Update new Ledger init options

* Add Zeal wallet

* Add Zeal docs

* Add Phantom docs

* Add link to appMetaData docs within Getting Started -> Installation -  per gh issue

Co-authored-by: Taylor Dawson <taylorjdawson@gmail.com>
Co-authored-by: Gustavo Esquinca <g.esq.ca@gmail.com>
Co-authored-by: Murat Akdeniz <maa357@cornell.edu>
Co-authored-by: Chris Meisl <cmeisl@gmail.com>
Co-authored-by: laurencedelisle <53497147+laurencedelisle@users.noreply.github.com>
Co-authored-by: mhchaudhry3 <mobeen@blocknative.com>
  • Loading branch information
7 people authored Jan 12, 2023
1 parent 74ee90e commit 528a5d7
Show file tree
Hide file tree
Showing 154 changed files with 37,972 additions and 3 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy documentation to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["docs-main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./docs
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Pages
uses: actions/configure-pages@v2

- name: Setup Nodejs and yarn
uses: actions/setup-node@v2
with:
node-version: "16"
cache: yarn

- name: Install dependencies
run: yarn install --immutable

- name: Build Documentation
env:
NODE_OPTIONS: "--max_old_space_size=8192"
run: yarn build

- name: Peak at folder contents
run: ls -al

- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
# Upload entire repository
path: './docs/build'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ If you're coming from v1, we've created a [migration guide for you](https://onbo

## Documentation

For full documentation, check out the README.md for each package:
For full documentation, check out the README.md for each package or the [docs page here](https://onboard.blocknative.com/docs/overview/introduction#features):

**Core Repo**

Expand Down
13 changes: 13 additions & 0 deletions docs/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.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
20 changes: 20 additions & 0 deletions docs/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
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
}
}
9 changes: 9 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example
.vercel
1 change: 1 addition & 0 deletions docs/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
engine-strict=true
13 changes: 13 additions & 0 deletions docs/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.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
8 changes: 8 additions & 0 deletions docs/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"useTabs": false,
"tabWidth": 2,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100,
"semi": false
}
25 changes: 25 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Docs

## Prereqs

Install [yarn](https://classic.yarnpkg.com/en/docs/install)

## Running docs server locally

Run the following command within the `docs/` folder

```sh
yarn && yarn dev
```

The server should start on [localhost:3000](http://localhost:3000/).

## Contributing

Confirm changes look as expected on local instance.

Run `yarn build` and confirm no errors present from the proposed changes.

Confirm vercel build within PR builds without error and check instance deployment for accuracy.

PR should target branch [docs-develop](https://github.com/blocknative/web3-onboard/tree/docs-develop).
81 changes: 81 additions & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{
"name": "docs",
"version": "0.0.1",
"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=. ."
},
"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",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rollup-plugin-polyfill-node": "^0.11.0",
"shiki": "^0.10.1",
"svelte": "^3.44.0",
"svelte-check": "^2.7.1",
"svelte-preprocess": "^4.10.7",
"tslib": "^2.3.1",
"typescript": "^4.7.2",
"unplugin-icons": "^0.13.4"
},
"type": "module",
"dependencies": {
"@web3-onboard/coinbase": "^2.1.4",
"@web3-onboard/core": "^2.12.0",
"@web3-onboard/dcent": "^2.2.2",
"@web3-onboard/enkrypt": "^2.0.0",
"@web3-onboard/fortmatic": "^2.0.14",
"@web3-onboard/gas": "^2.1.4",
"@web3-onboard/gnosis": "^2.1.5",
"@web3-onboard/injected-wallets": "^2.4.0",
"@web3-onboard/keepkey": "^2.3.2",
"@web3-onboard/keystone": "^2.3.2",
"@web3-onboard/ledger": "^2.3.2",
"@web3-onboard/magic": "^2.1.3",
"@web3-onboard/mew-wallet": "^2.0.0",
"@web3-onboard/portis": "^2.1.3",
"@web3-onboard/sequence": "^2.0.4",
"@web3-onboard/tallyho": "^2.0.1",
"@web3-onboard/torus": "^2.2.0",
"@web3-onboard/trezor": "^2.3.2",
"@web3-onboard/uauth": "^2.0.1",
"@web3-onboard/walletconnect": "^2.2.1",
"@web3-onboard/web3auth": "^2.1.4",
"animejs": "^3.2.1",
"ethers": "^5.7.0"
}
}
10 changes: 10 additions & 0 deletions docs/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import type { PlaywrightTestConfig } from '@playwright/test'

const config: PlaywrightTestConfig = {
webServer: {
command: 'npm run build && npm run preview',
port: 3000
}
}

export default config
6 changes: 6 additions & 0 deletions docs/postcss.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {}
}
}
3 changes: 3 additions & 0 deletions docs/src/app.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
14 changes: 14 additions & 0 deletions docs/src/app.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/// <reference types="@sveltejs/kit" />
/// <reference types="@svelteness/kit-docs/globals" />

// 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 module '@svelteness/kit-docs/tailwind.config.cjs'
33 changes: 33 additions & 0 deletions docs/src/app.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" type="image/x-icon" href="%sveltekit.assets%/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
%sveltekit.head%

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-121780722-2"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-121780722-2');
gtag('config', 'G-WQ8M55VX1Z');
</script>

<script>
const key = 'svelteness::color-scheme'
const scheme = localStorage[key]
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches
if (scheme === 'dark' || (scheme !== 'light' && prefersDark)) {
document.documentElement.classList.add('dark')
} else {
document.documentElement.classList.remove('dark')
}
</script>
</head>
<body>
<div>%sveltekit.body%</div>
</body>
</html>
1 change: 1 addition & 0 deletions docs/src/img/svelte-horizontal.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/src/kit-docs/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { Tabs, TabPanel, TabItem } from './tabs'
53 changes: 53 additions & 0 deletions docs/src/kit-docs/tabs/TabItem.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<script>
import { toTitleCase } from './utils'
import { useTabsRegistry } from './tabsRegistry'
/** @type {string} */
export let value
/** @type {string} */
export let label = value ? toTitleCase(value) : 'Unknown'
const { addTab, selectTab, currentValue } = useTabsRegistry()
addTab({ value, label })
$: selected = $currentValue === value
function onSelect() {
selectTab(value)
}
</script>

<li
class="tab hover:text-gray-inverse"
role="tab"
aria-selected={selected ? 'true' : 'false'}
tabindex="0"
class:selected
on:pointerdown={onSelect}
on:keydown={(e) => e.key === 'Enter' && onSelect()}
>
<slot>
{label}
</slot>
</li>

<style>
.tab[role='tab'] {
display: flex;
align-items: center;
justify-content: center;
margin: 0;
padding: 0.75rem 1.25rem;
cursor: pointer;
border-radius: 0 !important;
border-bottom: 0.25rem solid transparent;
font-weight: bold;
}
.tab.selected {
color: var(--kd-color-brand);
border-color: currentColor;
}
</style>
14 changes: 14 additions & 0 deletions docs/src/kit-docs/tabs/TabPanel.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<script>
import { useTabsRegistry } from './tabsRegistry'
/** @type {string} */
export let value
const { currentValue } = useTabsRegistry()
$: selected = $currentValue === value
</script>

<div role="tabpanel" hidden={!selected}>
<slot />
</div>
Loading

0 comments on commit 528a5d7

Please sign in to comment.