diff --git a/bun.lockb b/bun.lockb index 3533af74a6..977c17a17c 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index db6cabc4ea..4973049369 100644 --- a/package.json +++ b/package.json @@ -1,39 +1,45 @@ { - "name": "root", - "type": "module", - "private": true, - "workspaces": ["packages/*", "scripts", "website"], - "scripts": { - "postinstall": "lefthook install", - "build": "turbo run build --filter='!./templates/**' --filter='!./website/**'", - "exports:check": "bun scripts check:exports", - "exports:sync": "bun scripts exports:sync", - "local:sync": "bun scripts local:sync", - "local:revert": "bun scripts local:sync --revert", - "format": "bun prettier --write .", - "lint": "turbo run lint", - "test": "turbo run test:ci", - "typecheck": "turbo run typecheck", - "react": "bun run --cwd packages/react", - "scripts": "bun run --cwd scripts", - "solid": "bun run --cwd packages/solid", - "svelte": "bun run --cwd packages/svelte", - "vue": "bun run --cwd packages/vue", - "web": "bun run --cwd website" - }, - "dependencies": { - "root": "." - }, - "devDependencies": { - "@biomejs/biome": "1.9.4", - "@types/bun": "1.1.14", - "lefthook": "1.10.1", - "prettier": "3.4.2", - "prettier-plugin-svelte": "3.3.2", - "turbo": "2.3.3", - "typescript": "5.7.2", - "vercel": "39.2.6" - }, - "packageManager": "bun@1.1.42", - "trustedDependencies": ["@ark-ui/website"] + "name": "root", + "type": "module", + "private": true, + "workspaces": [ + "packages/*", + "scripts", + "website" + ], + "scripts": { + "postinstall": "lefthook install", + "build": "turbo run build --filter='!./templates/**' --filter='!./website/**'", + "exports:check": "bun scripts check:exports", + "exports:sync": "bun scripts exports:sync", + "local:sync": "bun scripts local:sync", + "local:revert": "bun scripts local:sync --revert", + "format": "bun prettier --write .", + "lint": "turbo run lint", + "test": "turbo run test:ci", + "typecheck": "turbo run typecheck", + "react": "bun run --cwd packages/react", + "scripts": "bun run --cwd scripts", + "solid": "bun run --cwd packages/solid", + "svelte": "bun run --cwd packages/svelte", + "vue": "bun run --cwd packages/vue", + "web": "bun run --cwd website" + }, + "dependencies": { + "root": "." + }, + "devDependencies": { + "@biomejs/biome": "1.9.4", + "@types/bun": "1.1.14", + "lefthook": "1.10.1", + "prettier": "3.4.2", + "prettier-plugin-svelte": "3.3.2", + "turbo": "2.3.3", + "typescript": "5.7.2", + "vercel": "39.2.6" + }, + "packageManager": "bun@1.1.42", + "trustedDependencies": [ + "@ark-ui/website" + ] } diff --git a/packages/react/.storybook/main.css b/packages/react/.storybook/main.css index fdf555c40e..1b4c3e8686 100644 --- a/packages/react/.storybook/main.css +++ b/packages/react/.storybook/main.css @@ -33,4 +33,5 @@ @import url('./styles/toast.css'); @import url('./styles/toggle-group.css'); @import url('./styles/tooltip.css'); +@import url('./styles/tour.css'); @import url('./styles/tree-view.css'); diff --git a/packages/react/.storybook/styles/tour.css b/packages/react/.storybook/styles/tour.css new file mode 100644 index 0000000000..e5fb7d0890 --- /dev/null +++ b/packages/react/.storybook/styles/tour.css @@ -0,0 +1,138 @@ +[data-scope='tour'][data-part='positioner'][data-type='floating'] { + position: absolute; +} + +[data-scope='tour'][data-part='positioner'][data-type='floating'][data-placement*='bottom'] { + bottom: 24px; +} + +[data-scope='tour'][data-part='positioner'][data-type='floating'][data-placement*='top'] { + top: 24px; +} + +[data-scope='tour'][data-part='positioner'][data-type='floating'][data-placement*='end'] { + inset-inline-end: 24px; +} + +[data-scope='tour'][data-part='positioner'][data-type='floating'][data-placement*='start'] { + inset-inline-start: 24px; +} + +[data-scope='tour'][data-part='positioner'][data-type='dialog'] { + width: 100%; + position: fixed; + inset: 0; + margin: auto; + display: flex; + align-items: center; + justify-content: center; +} + +[data-scope='tour'][data-part='content'] { + --arrow-background: white; + --arrow-size: 10px; + background: white; + padding: 24px; + position: relative; + border-radius: 4px; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); + width: 300px; +} + +[data-scope='tour'][data-part='content'][data-type='dialog'] { + width: 500px; + background: lightblue; +} + +[data-scope='tour'][data-part='content'][data-type='floating'] { + width: 500px; + background: rgb(15, 39, 136); + color: white; +} + +[data-scope='tour'][data-part='arrow'] { + --arrow-background: white; + --arrow-shadow-color: #ebebeb; + box-shadow: var(--box-shadow); +} + +[data-scope='tour'][data-part='title'] { + font-weight: 600; +} + +[data-scope='tour'][data-part='description'] { + margin-bottom: 20px; +} + +[data-scope='tour'][data-part='progress-text'] { + margin-bottom: 20px; + opacity: 0.72; +} + +[data-scope='tour'][data-part='backdrop'] { + background-color: rgba(0, 0, 0, 0.5); +} + +[data-scope='tour'][data-part='spotlight'] { + border: 3px solid pink; +} + +[data-scope='tour'][data-part='close-trigger'] { + font-family: inherit; + height: 25px; + width: 25px; + display: inline-flex; + align-items: center; + justify-content: center; + position: absolute; + top: 10px; + right: 10px; +} + +.tour.button__group { + display: flex; + align-items: flex-end; + gap: 10px; +} + +.tour .steps__container { + display: flex; + flex-direction: column; + align-items: flex-start; + gap: 50vh; +} + +.tour .overflow__container { + width: 500px; + height: 400px; + max-height: 200px; + overflow: auto; + border: 2px solid teal; + position: relative; +} + +.tour .overflow__container::before { + content: 'Overflow'; + display: block; + position: sticky; + background-color: teal; + color: white; + padding: 2px 4px 3px; + top: 0px; +} + +.tour .overflow__container .h-200px { + height: 200px; +} + +.tour .overflow__container .h-100px { + height: 100px; +} + +body { + position: relative; +} + +:where(*, *::before, *::after) { + box-sizing: border-box; +} diff --git a/packages/react/package.json b/packages/react/package.json index 19325ef70f..327d0a00bb 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -187,8 +187,8 @@ "@zag-js/dom-query": "0.81.1", "@zag-js/editable": "0.81.1", "@zag-js/file-upload": "0.81.1", - "@zag-js/focus-trap": "0.81.1", "@zag-js/file-utils": "0.81.1", + "@zag-js/focus-trap": "0.81.1", "@zag-js/highlight-word": "0.81.1", "@zag-js/hover-card": "0.81.1", "@zag-js/i18n-utils": "0.81.1", @@ -216,6 +216,7 @@ "@zag-js/toast": "0.81.1", "@zag-js/toggle-group": "0.81.1", "@zag-js/tooltip": "0.81.1", + "@zag-js/tour": "0.81.1", "@zag-js/tree-view": "0.81.1", "@zag-js/types": "0.81.1" }, diff --git a/packages/react/src/components/focus-trap/examples/autofocus.tsx b/packages/react/src/components/focus-trap/examples/autofocus.tsx index b2e14fae78..20cf895b6a 100644 --- a/packages/react/src/components/focus-trap/examples/autofocus.tsx +++ b/packages/react/src/components/focus-trap/examples/autofocus.tsx @@ -20,7 +20,12 @@ export const Autofocus = () => { {trapped && (
{/* biome-ignore lint/a11y/noAutofocus: */} diff --git a/packages/react/src/components/focus-trap/examples/basic.tsx b/packages/react/src/components/focus-trap/examples/basic.tsx index 1a625d4724..7a95741e6b 100644 --- a/packages/react/src/components/focus-trap/examples/basic.tsx +++ b/packages/react/src/components/focus-trap/examples/basic.tsx @@ -8,7 +8,12 @@ export const Basic = () => {