@toa.io/extensions.configuration 1.0.0-alpha.272 → 1.0.0-alpha.274
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +210 -0
- package/components/configuration.values/manifest.toa.yaml +158 -0
- package/components/configuration.values/source/create.ts +56 -0
- package/components/configuration.values/source/fetch.ts +24 -0
- package/components/configuration.values/source/get.ts +33 -0
- package/components/configuration.values/source/lib/map.test.ts +34 -0
- package/components/configuration.values/source/lib/map.ts +34 -0
- package/components/configuration.values/source/lib/resolve.ts +54 -0
- package/components/configuration.values/source/list.ts +19 -0
- package/components/configuration.values/tsconfig.json +9 -0
- package/cucumber.js +8 -0
- package/features/site/_app/immutable/asset.js +1 -0
- package/features/site/index.html +6 -0
- package/features/steps/UI.ts +88 -0
- package/features/steps/tsconfig.json +9 -0
- package/features/ui.feature +85 -0
- package/package.json +14 -7
- package/readme.md +160 -47
- package/schemas/annotation.cos.yaml +29 -1
- package/schemas/manifest.cos.yaml +9 -3
- package/source/Aspect.test.ts +84 -8
- package/source/Aspect.ts +59 -5
- package/source/Client.test.ts +104 -0
- package/source/Client.ts +258 -0
- package/source/Composition.ts +57 -0
- package/source/Factory.ts +28 -5
- package/source/Secret.test.ts +29 -0
- package/source/Secret.ts +29 -0
- package/source/UI.ts +197 -0
- package/source/configuration.test.ts +92 -39
- package/source/configuration.ts +30 -11
- package/source/const.ts +17 -0
- package/source/deployment.test.ts +80 -1
- package/source/deployment.ts +73 -24
- package/source/epoch.test.ts +26 -0
- package/source/epoch.ts +21 -0
- package/source/index.ts +2 -1
- package/transpiled/Aspect.d.ts +18 -4
- package/transpiled/Aspect.js +47 -3
- package/transpiled/Aspect.js.map +1 -1
- package/transpiled/Aspect.test.js +59 -9
- package/transpiled/Aspect.test.js.map +1 -1
- package/transpiled/Client.d.ts +61 -0
- package/transpiled/Client.js +173 -0
- package/transpiled/Client.js.map +1 -0
- package/transpiled/Client.test.d.ts +1 -0
- package/transpiled/Client.test.js +77 -0
- package/transpiled/Client.test.js.map +1 -0
- package/transpiled/Composition.d.ts +14 -0
- package/transpiled/Composition.js +43 -0
- package/transpiled/Composition.js.map +1 -0
- package/transpiled/Factory.d.ts +8 -2
- package/transpiled/Factory.js +17 -2
- package/transpiled/Factory.js.map +1 -1
- package/transpiled/Secret.d.ts +13 -0
- package/transpiled/Secret.js +26 -0
- package/transpiled/Secret.js.map +1 -0
- package/transpiled/Secret.test.d.ts +1 -0
- package/transpiled/Secret.test.js +26 -0
- package/transpiled/Secret.test.js.map +1 -0
- package/transpiled/UI.d.ts +25 -0
- package/transpiled/UI.js +186 -0
- package/transpiled/UI.js.map +1 -0
- package/transpiled/configuration.d.ts +7 -2
- package/transpiled/configuration.js +31 -13
- package/transpiled/configuration.js.map +1 -1
- package/transpiled/configuration.test.js +84 -37
- package/transpiled/configuration.test.js.map +1 -1
- package/transpiled/const.d.ts +11 -0
- package/transpiled/const.js +14 -0
- package/transpiled/const.js.map +1 -0
- package/transpiled/deployment.d.ts +10 -4
- package/transpiled/deployment.js +57 -21
- package/transpiled/deployment.js.map +1 -1
- package/transpiled/deployment.test.js +60 -0
- package/transpiled/deployment.test.js.map +1 -1
- package/transpiled/epoch.d.ts +2 -0
- package/transpiled/epoch.js +21 -0
- package/transpiled/epoch.js.map +1 -0
- package/transpiled/epoch.test.d.ts +1 -0
- package/transpiled/epoch.test.js +22 -0
- package/transpiled/epoch.test.js.map +1 -0
- package/transpiled/index.d.ts +2 -1
- package/transpiled/index.js +4 -1
- package/transpiled/index.js.map +1 -1
- package/transpiled/tsconfig.tsbuildinfo +1 -1
- package/ui/.agents/skills/antcn/SKILL.md +91 -0
- package/ui/.agents/skills/antcn/references/analytics.md +78 -0
- package/ui/.agents/skills/antcn/references/bridge.md +41 -0
- package/ui/.agents/skills/antcn/references/clipboard.md +23 -0
- package/ui/.agents/skills/antcn/references/dismissable.md +75 -0
- package/ui/.agents/skills/antcn/references/dropdown.md +153 -0
- package/ui/.agents/skills/antcn/references/fragments.md +29 -0
- package/ui/.agents/skills/antcn/references/fullscreen.md +157 -0
- package/ui/.agents/skills/antcn/references/geo.md +27 -0
- package/ui/.agents/skills/antcn/references/globals.md +31 -0
- package/ui/.agents/skills/antcn/references/grammatical-form.md +69 -0
- package/ui/.agents/skills/antcn/references/hints.md +44 -0
- package/ui/.agents/skills/antcn/references/hold.md +34 -0
- package/ui/.agents/skills/antcn/references/iam.md +117 -0
- package/ui/.agents/skills/antcn/references/input-form.md +34 -0
- package/ui/.agents/skills/antcn/references/locale.md +66 -0
- package/ui/.agents/skills/antcn/references/net.md +33 -0
- package/ui/.agents/skills/antcn/references/panel.md +44 -0
- package/ui/.agents/skills/antcn/references/passkeys.md +27 -0
- package/ui/.agents/skills/antcn/references/payments.md +99 -0
- package/ui/.agents/skills/antcn/references/realtime.md +69 -0
- package/ui/.agents/skills/antcn/references/scrollable.md +39 -0
- package/ui/.agents/skills/antcn/references/selector.md +71 -0
- package/ui/.agents/skills/antcn/references/shake.md +36 -0
- package/ui/.agents/skills/antcn/references/share.md +28 -0
- package/ui/.agents/skills/antcn/references/shell.md +139 -0
- package/ui/.agents/skills/antcn/references/stack.md +53 -0
- package/ui/.agents/skills/antcn/references/system.md +149 -0
- package/ui/.agents/skills/antcn/references/taptap.md +28 -0
- package/ui/.agents/skills/antcn/references/tools.md +68 -0
- package/ui/.agents/skills/antcn/references/transmission.md +96 -0
- package/ui/.agents/skills/shadcn-svelte/SKILL.md +227 -0
- package/ui/.agents/skills/shadcn-svelte/agents/openai.yml +5 -0
- package/ui/.agents/skills/shadcn-svelte/assets/shadcn-svelte-small.png +0 -0
- package/ui/.agents/skills/shadcn-svelte/assets/shadcn-svelte.png +0 -0
- package/ui/.agents/skills/shadcn-svelte/cli.md +166 -0
- package/ui/.agents/skills/shadcn-svelte/customization.md +213 -0
- package/ui/.agents/skills/shadcn-svelte/evals/evals.json +47 -0
- package/ui/.agents/skills/shadcn-svelte/rules/composition.md +244 -0
- package/ui/.agents/skills/shadcn-svelte/rules/forms.md +234 -0
- package/ui/.agents/skills/shadcn-svelte/rules/icons.md +107 -0
- package/ui/.agents/skills/shadcn-svelte/rules/styling.md +195 -0
- package/ui/.agents/skills/svas/SKILL.md +169 -0
- package/ui/.agents/skills/svas/references/patterns.md +95 -0
- package/ui/.agents/skills/svintl/SKILL.md +176 -0
- package/ui/.claude/settings.json +15 -0
- package/ui/.codex/hooks.json +15 -0
- package/ui/.cursor/hooks.json +11 -0
- package/ui/.env.example +1 -0
- package/ui/.prettierrc +9 -0
- package/ui/.vscode/extensions.json +7 -0
- package/ui/.vscode/settings.json +27 -0
- package/ui/AGENTS.md +51 -0
- package/ui/architecture.md +390 -0
- package/ui/components.json +20 -0
- package/ui/eslint.config.js +152 -0
- package/ui/features/base.ts +2 -0
- package/ui/features/boot.feature +5 -0
- package/ui/features/steps/authentication.ts +34 -0
- package/ui/features/steps/navigaton.ts +37 -0
- package/ui/features/steps/typing.ts +24 -0
- package/ui/package-lock.json +8173 -0
- package/ui/package.json +76 -0
- package/ui/playwright.config.ts +13 -0
- package/ui/skills-lock.json +30 -0
- package/ui/src/@/configuration/index.ts +1 -0
- package/ui/src/@/configuration/svc/create.ts +29 -0
- package/ui/src/@/configuration/svc/index.ts +3 -0
- package/ui/src/@/configuration/svc/net/Configuration.ts +18 -0
- package/ui/src/@/configuration/svc/net/index.ts +2 -0
- package/ui/src/@/configuration/svc/net/interface.ts +35 -0
- package/ui/src/@/configuration/svc/store.ts +14 -0
- package/ui/src/@/configuration/ui/Configurations.svelte +85 -0
- package/ui/src/@/configuration/ui/Configurations.ts +5 -0
- package/ui/src/@/configuration/ui/Create.svelte +64 -0
- package/ui/src/@/configuration/ui/Create.ts +7 -0
- package/ui/src/@/configuration/ui/Form.svelte +75 -0
- package/ui/src/@/configuration/ui/Form.ts +79 -0
- package/ui/src/@/configuration/ui/Row.svelte +44 -0
- package/ui/src/@/configuration/ui/Row.ts +9 -0
- package/ui/src/@/configuration/ui/Value.svelte +33 -0
- package/ui/src/@/configuration/ui/Value.ts +6 -0
- package/ui/src/@/configuration/ui/index.ts +9 -0
- package/ui/src/@/configuration/ui/intl/built.js +38 -0
- package/ui/src/@/configuration/ui/intl/context.yaml +51 -0
- package/ui/src/@/configuration/ui/intl/en-US.yaml +21 -0
- package/ui/src/@/configuration/ui/intl/index.ts +9 -0
- package/ui/src/@/configuration/ui/intl/types.ts +31 -0
- package/ui/src/@/configuration/ui/read.test.ts +75 -0
- package/ui/src/@/configuration/ui/read.ts +102 -0
- package/ui/src/@/configuration/ui/ui.test.ts +69 -0
- package/ui/src/@/configuration/ui/ui.ts +115 -0
- package/ui/src/@/iam/index.ts +1 -0
- package/ui/src/@/iam/rc.ts +22 -0
- package/ui/src/@/iam/svc/authenticated.ts +17 -0
- package/ui/src/@/iam/svc/basic.ts +23 -0
- package/ui/src/@/iam/svc/index.ts +10 -0
- package/ui/src/@/iam/svc/logout.ts +5 -0
- package/ui/src/@/iam/svc/named.ts +16 -0
- package/ui/src/@/iam/svc/net/Echo.ts +9 -0
- package/ui/src/@/iam/svc/net/basic/index.ts +1 -0
- package/ui/src/@/iam/svc/net/basic/interface.ts +15 -0
- package/ui/src/@/iam/svc/net/federation/index.ts +1 -0
- package/ui/src/@/iam/svc/net/federation/interface.ts +12 -0
- package/ui/src/@/iam/svc/net/index.ts +6 -0
- package/ui/src/@/iam/svc/net/interface.ts +17 -0
- package/ui/src/@/iam/svc/net/otp/index.ts +1 -0
- package/ui/src/@/iam/svc/net/otp/interface.ts +14 -0
- package/ui/src/@/iam/svc/net/passkeys/index.ts +1 -0
- package/ui/src/@/iam/svc/net/passkeys/interface.ts +12 -0
- package/ui/src/@/iam/svc/oidc/apple.ts +47 -0
- package/ui/src/@/iam/svc/oidc/authenticate.ts +62 -0
- package/ui/src/@/iam/svc/oidc/google.ts +45 -0
- package/ui/src/@/iam/svc/oidc/hello.ts +82 -0
- package/ui/src/@/iam/svc/oidc/index.ts +3 -0
- package/ui/src/@/iam/svc/oidc/nonce.ts +5 -0
- package/ui/src/@/iam/svc/oidc/providers.ts +28 -0
- package/ui/src/@/iam/svc/oidc/standard.ts +28 -0
- package/ui/src/@/iam/svc/otp.ts +18 -0
- package/ui/src/@/iam/svc/passkeys/create.ts +20 -0
- package/ui/src/@/iam/svc/passkeys/index.ts +2 -0
- package/ui/src/@/iam/svc/passkeys/login.ts +21 -0
- package/ui/src/@/iam/svc/store.ts +36 -0
- package/ui/src/@/iam/svc/sync.ts +18 -0
- package/ui/src/@/iam/svc/transfer.ts +11 -0
- package/ui/src/@/iam/svc/update.ts +8 -0
- package/ui/src/@/iam/ui/AccountLike.ts +4 -0
- package/ui/src/@/iam/ui/Authenticated.svelte +37 -0
- package/ui/src/@/iam/ui/Authenticated.ts +10 -0
- package/ui/src/@/iam/ui/Authentication.svelte +50 -0
- package/ui/src/@/iam/ui/Authentication.ts +9 -0
- package/ui/src/@/iam/ui/Authorized.svelte +32 -0
- package/ui/src/@/iam/ui/Authorized.ts +65 -0
- package/ui/src/@/iam/ui/Card.svelte +14 -0
- package/ui/src/@/iam/ui/Card.ts +7 -0
- package/ui/src/@/iam/ui/Refresh.svelte +39 -0
- package/ui/src/@/iam/ui/credentials/Credentials.svelte +26 -0
- package/ui/src/@/iam/ui/credentials/Credentials.ts +5 -0
- package/ui/src/@/iam/ui/credentials/Provider.svelte +24 -0
- package/ui/src/@/iam/ui/credentials/Provider.ts +5 -0
- package/ui/src/@/iam/ui/credentials/index.ts +1 -0
- package/ui/src/@/iam/ui/credentials/passkeys/Key.svelte +42 -0
- package/ui/src/@/iam/ui/credentials/passkeys/Key.ts +29 -0
- package/ui/src/@/iam/ui/credentials/passkeys/Manager.svelte +83 -0
- package/ui/src/@/iam/ui/credentials/passkeys/Manager.ts +5 -0
- package/ui/src/@/iam/ui/credentials/passkeys/Passkeys.svelte +39 -0
- package/ui/src/@/iam/ui/credentials/passkeys/Summary.svelte +27 -0
- package/ui/src/@/iam/ui/credentials/passkeys/Summary.ts +5 -0
- package/ui/src/@/iam/ui/credentials/passkeys/index.ts +1 -0
- package/ui/src/@/iam/ui/credentials/providers.ts +15 -0
- package/ui/src/@/iam/ui/credentials/transfer/Qr.svelte +24 -0
- package/ui/src/@/iam/ui/credentials/transfer/Qr.ts +3 -0
- package/ui/src/@/iam/ui/credentials/transfer/Transfer.svelte +48 -0
- package/ui/src/@/iam/ui/credentials/transfer/Transfer.ts +5 -0
- package/ui/src/@/iam/ui/credentials/transfer/index.ts +1 -0
- package/ui/src/@/iam/ui/index.ts +3 -0
- package/ui/src/@/iam/ui/intl/built.js +79 -0
- package/ui/src/@/iam/ui/intl/context.yaml +91 -0
- package/ui/src/@/iam/ui/intl/en-US.yaml +64 -0
- package/ui/src/@/iam/ui/intl/index.ts +10 -0
- package/ui/src/@/iam/ui/intl/types.ts +70 -0
- package/ui/src/@/iam/ui/oidc/Authentication.svelte +16 -0
- package/ui/src/@/iam/ui/oidc/Authentication.ts +5 -0
- package/ui/src/@/iam/ui/oidc/Button.svelte +36 -0
- package/ui/src/@/iam/ui/oidc/Button.ts +11 -0
- package/ui/src/@/iam/ui/oidc/Refresh.svelte +16 -0
- package/ui/src/@/iam/ui/oidc/icons/Apple.svelte +19 -0
- package/ui/src/@/iam/ui/oidc/icons/Google.svelte +31 -0
- package/ui/src/@/iam/ui/oidc/icons/index.ts +11 -0
- package/ui/src/@/iam/ui/oidc/index.ts +2 -0
- package/ui/src/@/iam/ui/passkey/Authentication.svelte +64 -0
- package/ui/src/@/iam/ui/passkey/Authentication.ts +8 -0
- package/ui/src/@/iam/ui/passkey/Create.svelte +53 -0
- package/ui/src/@/iam/ui/passkey/Create.ts +7 -0
- package/ui/src/@/iam/ui/passkey/Login.svelte +29 -0
- package/ui/src/@/iam/ui/passkey/Refresh.svelte +29 -0
- package/ui/src/@/iam/ui/passkey/index.ts +2 -0
- package/ui/src/@/iam/ui/password/Authentication.svelte +19 -0
- package/ui/src/@/iam/ui/password/Authentication.ts +8 -0
- package/ui/src/@/iam/ui/password/Form.svelte +151 -0
- package/ui/src/@/iam/ui/password/Form.ts +6 -0
- package/ui/src/@/iam/ui/password/Password.svelte +39 -0
- package/ui/src/@/iam/ui/password/Password.ts +6 -0
- package/ui/src/@/iam/ui/password/Refresh.svelte +5 -0
- package/ui/src/@/iam/ui/password/index.ts +2 -0
- package/ui/src/@/net/index.ts +1 -0
- package/ui/src/@/net/svc/index.ts +3 -0
- package/ui/src/@/net/svc/origin.ts +8 -0
- package/ui/src/@/net/svc/query.test.ts +45 -0
- package/ui/src/@/net/svc/query.ts +25 -0
- package/ui/src/@/passkeys/index.ts +1 -0
- package/ui/src/@/passkeys/svc/add.ts +15 -0
- package/ui/src/@/passkeys/svc/create.ts +58 -0
- package/ui/src/@/passkeys/svc/credentials/convert.ts +32 -0
- package/ui/src/@/passkeys/svc/credentials/create.ts +34 -0
- package/ui/src/@/passkeys/svc/credentials/get.ts +14 -0
- package/ui/src/@/passkeys/svc/credentials/index.ts +3 -0
- package/ui/src/@/passkeys/svc/credentials/key.ts +10 -0
- package/ui/src/@/passkeys/svc/get.ts +10 -0
- package/ui/src/@/passkeys/svc/index.ts +6 -0
- package/ui/src/@/passkeys/svc/net/CreationResponse.ts +15 -0
- package/ui/src/@/passkeys/svc/net/Passkey.ts +8 -0
- package/ui/src/@/passkeys/svc/net/RequestResponse.ts +12 -0
- package/ui/src/@/passkeys/svc/net/challenges/Options.ts +21 -0
- package/ui/src/@/passkeys/svc/net/challenges/index.ts +2 -0
- package/ui/src/@/passkeys/svc/net/challenges/interface.ts +16 -0
- package/ui/src/@/passkeys/svc/net/index.ts +4 -0
- package/ui/src/@/passkeys/svc/net/interface.ts +29 -0
- package/ui/src/@/passkeys/svc/remove.ts +13 -0
- package/ui/src/@/passkeys/svc/request.ts +50 -0
- package/ui/src/@/passkeys/svc/store.ts +13 -0
- package/ui/src/@/passkeys/svc/supported.ts +1 -0
- package/ui/src/@/passkeys/ui/aaguid.json +150 -0
- package/ui/src/@/realtime/events.ts +1 -0
- package/ui/src/@/realtime/index.ts +1 -0
- package/ui/src/@/realtime/rc.ts +13 -0
- package/ui/src/@/realtime/svc/connect.ts +67 -0
- package/ui/src/@/realtime/svc/events.ts +17 -0
- package/ui/src/@/realtime/svc/index.ts +5 -0
- package/ui/src/@/realtime/svc/net/Message.ts +6 -0
- package/ui/src/@/realtime/svc/net/index.ts +2 -0
- package/ui/src/@/realtime/svc/net/interface.ts +13 -0
- package/ui/src/@/realtime/svc/reset.ts +5 -0
- package/ui/src/@/realtime/svc/status.ts +12 -0
- package/ui/src/@/realtime/svc/store.ts +30 -0
- package/ui/src/@/realtime/svc/time.ts +15 -0
- package/ui/src/app.d.ts +20 -0
- package/ui/src/app.html +13 -0
- package/ui/src/config/index.ts +70 -0
- package/ui/src/lib/assets/favicon.svg +1 -0
- package/ui/src/lib/components/clipboard/Clipboard.svelte +63 -0
- package/ui/src/lib/components/clipboard/Clipboard.ts +12 -0
- package/ui/src/lib/components/clipboard/index.ts +1 -0
- package/ui/src/lib/components/dismissable/Dismissable.svelte +81 -0
- package/ui/src/lib/components/dismissable/Dismissable.ts +7 -0
- package/ui/src/lib/components/dismissable/index.ts +1 -0
- package/ui/src/lib/components/dropdown/Back.svelte +14 -0
- package/ui/src/lib/components/dropdown/Back.ts +3 -0
- package/ui/src/lib/components/dropdown/Content.svelte +76 -0
- package/ui/src/lib/components/dropdown/Content.ts +13 -0
- package/ui/src/lib/components/dropdown/Context.ts +18 -0
- package/ui/src/lib/components/dropdown/Group.svelte +24 -0
- package/ui/src/lib/components/dropdown/Group.ts +8 -0
- package/ui/src/lib/components/dropdown/GroupContext.ts +15 -0
- package/ui/src/lib/components/dropdown/Item.svelte +31 -0
- package/ui/src/lib/components/dropdown/Item.ts +5 -0
- package/ui/src/lib/components/dropdown/Layer.svelte +11 -0
- package/ui/src/lib/components/dropdown/Layer.ts +7 -0
- package/ui/src/lib/components/dropdown/Root.svelte +88 -0
- package/ui/src/lib/components/dropdown/Root.ts +6 -0
- package/ui/src/lib/components/dropdown/Separator.svelte +13 -0
- package/ui/src/lib/components/dropdown/Separator.ts +5 -0
- package/ui/src/lib/components/dropdown/Trigger.svelte +33 -0
- package/ui/src/lib/components/dropdown/Trigger.ts +5 -0
- package/ui/src/lib/components/dropdown/index.ts +8 -0
- package/ui/src/lib/components/fullscreen/Fullscreen.svelte +97 -0
- package/ui/src/lib/components/fullscreen/Fullscreen.ts +18 -0
- package/ui/src/lib/components/fullscreen/Overlay.svelte +15 -0
- package/ui/src/lib/components/fullscreen/Overlay.ts +7 -0
- package/ui/src/lib/components/fullscreen/index.ts +2 -0
- package/ui/src/lib/components/hold/Hold.svelte +133 -0
- package/ui/src/lib/components/hold/Hold.ts +23 -0
- package/ui/src/lib/components/hold/index.ts +1 -0
- package/ui/src/lib/components/scrollable/Scrollable.svelte +49 -0
- package/ui/src/lib/components/scrollable/Scrollable.ts +117 -0
- package/ui/src/lib/components/scrollable/index.ts +2 -0
- package/ui/src/lib/components/shake/Shake.svelte +62 -0
- package/ui/src/lib/components/shake/Shake.ts +7 -0
- package/ui/src/lib/components/shake/index.ts +1 -0
- package/ui/src/lib/components/share/Share.svelte +58 -0
- package/ui/src/lib/components/share/Share.ts +9 -0
- package/ui/src/lib/components/share/index.ts +1 -0
- package/ui/src/lib/components/shell/Attention.svelte +11 -0
- package/ui/src/lib/components/shell/Attention.ts +6 -0
- package/ui/src/lib/components/shell/Header.svelte +18 -0
- package/ui/src/lib/components/shell/Header.ts +7 -0
- package/ui/src/lib/components/shell/Screen.svelte +28 -0
- package/ui/src/lib/components/shell/Screen.ts +11 -0
- package/ui/src/lib/components/shell/Sticky.svelte +23 -0
- package/ui/src/lib/components/shell/Sticky.ts +8 -0
- package/ui/src/lib/components/shell/Underlay.svelte +21 -0
- package/ui/src/lib/components/shell/Underlay.ts +6 -0
- package/ui/src/lib/components/shell/index.ts +6 -0
- package/ui/src/lib/components/shell/nav/Actions.svelte +31 -0
- package/ui/src/lib/components/shell/nav/Actions.ts +16 -0
- package/ui/src/lib/components/shell/nav/Back.svelte +20 -0
- package/ui/src/lib/components/shell/nav/Back.ts +9 -0
- package/ui/src/lib/components/shell/nav/Bar.svelte +24 -0
- package/ui/src/lib/components/shell/nav/Bar.ts +3 -0
- package/ui/src/lib/components/shell/nav/Button.svelte +64 -0
- package/ui/src/lib/components/shell/nav/Button.ts +7 -0
- package/ui/src/lib/components/shell/nav/Nav.svelte +62 -0
- package/ui/src/lib/components/shell/nav/Nav.ts +35 -0
- package/ui/src/lib/components/shell/nav/Return.svelte +29 -0
- package/ui/src/lib/components/shell/nav/Return.ts +15 -0
- package/ui/src/lib/components/shell/nav/Sections.svelte +58 -0
- package/ui/src/lib/components/shell/nav/Sections.ts +6 -0
- package/ui/src/lib/components/shell/nav/Toolbar.svelte +73 -0
- package/ui/src/lib/components/shell/nav/Toolbar.ts +3 -0
- package/ui/src/lib/components/shell/nav/history.ts +36 -0
- package/ui/src/lib/components/shell/nav/index.ts +5 -0
- package/ui/src/lib/components/shell/nav/store.ts +24 -0
- package/ui/src/lib/components/ui/alert/alert-action.svelte +20 -0
- package/ui/src/lib/components/ui/alert/alert-description.svelte +23 -0
- package/ui/src/lib/components/ui/alert/alert-title.svelte +23 -0
- package/ui/src/lib/components/ui/alert/alert.svelte +43 -0
- package/ui/src/lib/components/ui/alert/index.ts +17 -0
- package/ui/src/lib/components/ui/alert-dialog/alert-dialog-action.svelte +27 -0
- package/ui/src/lib/components/ui/alert-dialog/alert-dialog-cancel.svelte +27 -0
- package/ui/src/lib/components/ui/alert-dialog/alert-dialog-content.svelte +32 -0
- package/ui/src/lib/components/ui/alert-dialog/alert-dialog-description.svelte +17 -0
- package/ui/src/lib/components/ui/alert-dialog/alert-dialog-footer.svelte +23 -0
- package/ui/src/lib/components/ui/alert-dialog/alert-dialog-header.svelte +20 -0
- package/ui/src/lib/components/ui/alert-dialog/alert-dialog-media.svelte +20 -0
- package/ui/src/lib/components/ui/alert-dialog/alert-dialog-overlay.svelte +17 -0
- package/ui/src/lib/components/ui/alert-dialog/alert-dialog-portal.svelte +7 -0
- package/ui/src/lib/components/ui/alert-dialog/alert-dialog-title.svelte +17 -0
- package/ui/src/lib/components/ui/alert-dialog/alert-dialog-trigger.svelte +7 -0
- package/ui/src/lib/components/ui/alert-dialog/alert-dialog.svelte +7 -0
- package/ui/src/lib/components/ui/alert-dialog/index.ts +40 -0
- package/ui/src/lib/components/ui/badge/badge.svelte +49 -0
- package/ui/src/lib/components/ui/badge/index.ts +2 -0
- package/ui/src/lib/components/ui/button/button.svelte +82 -0
- package/ui/src/lib/components/ui/button/index.ts +17 -0
- package/ui/src/lib/components/ui/button-group/button-group-separator.svelte +23 -0
- package/ui/src/lib/components/ui/button-group/button-group-text.svelte +28 -0
- package/ui/src/lib/components/ui/button-group/button-group.svelte +46 -0
- package/ui/src/lib/components/ui/button-group/index.ts +15 -0
- package/ui/src/lib/components/ui/card/card-action.svelte +23 -0
- package/ui/src/lib/components/ui/card/card-content.svelte +20 -0
- package/ui/src/lib/components/ui/card/card-description.svelte +20 -0
- package/ui/src/lib/components/ui/card/card-footer.svelte +20 -0
- package/ui/src/lib/components/ui/card/card-header.svelte +23 -0
- package/ui/src/lib/components/ui/card/card-title.svelte +20 -0
- package/ui/src/lib/components/ui/card/card.svelte +22 -0
- package/ui/src/lib/components/ui/card/index.ts +25 -0
- package/ui/src/lib/components/ui/checkbox/checkbox.svelte +39 -0
- package/ui/src/lib/components/ui/checkbox/index.ts +6 -0
- package/ui/src/lib/components/ui/collapsible/collapsible-content.svelte +7 -0
- package/ui/src/lib/components/ui/collapsible/collapsible-trigger.svelte +7 -0
- package/ui/src/lib/components/ui/collapsible/collapsible.svelte +20 -0
- package/ui/src/lib/components/ui/collapsible/index.ts +13 -0
- package/ui/src/lib/components/ui/input/index.ts +7 -0
- package/ui/src/lib/components/ui/input/input.svelte +48 -0
- package/ui/src/lib/components/ui/input-otp/index.ts +15 -0
- package/ui/src/lib/components/ui/input-otp/input-otp-group.svelte +20 -0
- package/ui/src/lib/components/ui/input-otp/input-otp-separator.svelte +27 -0
- package/ui/src/lib/components/ui/input-otp/input-otp-slot.svelte +31 -0
- package/ui/src/lib/components/ui/input-otp/input-otp.svelte +23 -0
- package/ui/src/lib/components/ui/item/index.ts +34 -0
- package/ui/src/lib/components/ui/item/item-actions.svelte +20 -0
- package/ui/src/lib/components/ui/item/item-content.svelte +23 -0
- package/ui/src/lib/components/ui/item/item-description.svelte +23 -0
- package/ui/src/lib/components/ui/item/item-footer.svelte +20 -0
- package/ui/src/lib/components/ui/item/item-group.svelte +21 -0
- package/ui/src/lib/components/ui/item/item-header.svelte +20 -0
- package/ui/src/lib/components/ui/item/item-media.svelte +42 -0
- package/ui/src/lib/components/ui/item/item-separator.svelte +19 -0
- package/ui/src/lib/components/ui/item/item-title.svelte +20 -0
- package/ui/src/lib/components/ui/item/item.svelte +61 -0
- package/ui/src/lib/components/ui/kbd/index.ts +10 -0
- package/ui/src/lib/components/ui/kbd/kbd-group.svelte +20 -0
- package/ui/src/lib/components/ui/kbd/kbd.svelte +23 -0
- package/ui/src/lib/components/ui/label/index.ts +7 -0
- package/ui/src/lib/components/ui/label/label.svelte +20 -0
- package/ui/src/lib/components/ui/progress/index.ts +7 -0
- package/ui/src/lib/components/ui/progress/progress.svelte +27 -0
- package/ui/src/lib/components/ui/select/index.ts +37 -0
- package/ui/src/lib/components/ui/select/select-content.svelte +45 -0
- package/ui/src/lib/components/ui/select/select-group-heading.svelte +21 -0
- package/ui/src/lib/components/ui/select/select-group.svelte +17 -0
- package/ui/src/lib/components/ui/select/select-item.svelte +40 -0
- package/ui/src/lib/components/ui/select/select-label.svelte +20 -0
- package/ui/src/lib/components/ui/select/select-portal.svelte +7 -0
- package/ui/src/lib/components/ui/select/select-scroll-down-button.svelte +20 -0
- package/ui/src/lib/components/ui/select/select-scroll-up-button.svelte +20 -0
- package/ui/src/lib/components/ui/select/select-separator.svelte +18 -0
- package/ui/src/lib/components/ui/select/select-trigger.svelte +29 -0
- package/ui/src/lib/components/ui/select/select.svelte +11 -0
- package/ui/src/lib/components/ui/separator/index.ts +7 -0
- package/ui/src/lib/components/ui/separator/separator.svelte +23 -0
- package/ui/src/lib/components/ui/spinner/index.ts +1 -0
- package/ui/src/lib/components/ui/spinner/spinner.svelte +18 -0
- package/ui/src/lib/components/ui/tabs/index.ts +18 -0
- package/ui/src/lib/components/ui/tabs/tabs-content.svelte +17 -0
- package/ui/src/lib/components/ui/tabs/tabs-list.svelte +40 -0
- package/ui/src/lib/components/ui/tabs/tabs-trigger.svelte +23 -0
- package/ui/src/lib/components/ui/tabs/tabs.svelte +19 -0
- package/ui/src/lib/components/ui/textarea/index.ts +7 -0
- package/ui/src/lib/components/ui/textarea/textarea.svelte +22 -0
- package/ui/src/lib/intl/bcp.ts +25 -0
- package/ui/src/lib/intl/built.js +18 -0
- package/ui/src/lib/intl/context.yaml +18 -0
- package/ui/src/lib/intl/en-US.yaml +6 -0
- package/ui/src/lib/intl/index.ts +65 -0
- package/ui/src/lib/intl/types.ts +19 -0
- package/ui/src/lib/tools/ago.ts +10 -0
- package/ui/src/lib/tools/assert.ts +3 -0
- package/ui/src/lib/tools/cap.ts +5 -0
- package/ui/src/lib/tools/clicks.ts +25 -0
- package/ui/src/lib/tools/contextmenu.ts +19 -0
- package/ui/src/lib/tools/convert.ts +32 -0
- package/ui/src/lib/tools/currency.test.ts +10 -0
- package/ui/src/lib/tools/currency.ts +55 -0
- package/ui/src/lib/tools/date.test.ts +21 -0
- package/ui/src/lib/tools/date.ts +35 -0
- package/ui/src/lib/tools/delay.ts +7 -0
- package/ui/src/lib/tools/image.ts +39 -0
- package/ui/src/lib/tools/index.ts +20 -0
- package/ui/src/lib/tools/location.ts +41 -0
- package/ui/src/lib/tools/metronome.ts +11 -0
- package/ui/src/lib/tools/mq.ts +84 -0
- package/ui/src/lib/tools/onsubmit.ts +21 -0
- package/ui/src/lib/tools/random.ts +15 -0
- package/ui/src/lib/tools/search.ts +25 -0
- package/ui/src/lib/tools/timeout.ts +26 -0
- package/ui/src/lib/tools/transition.ts +207 -0
- package/ui/src/lib/tools/types.ts +3 -0
- package/ui/src/lib/tools/uuid.test.ts +28 -0
- package/ui/src/lib/tools/uuid.ts +9 -0
- package/ui/src/lib/typeset.css +502 -0
- package/ui/src/lib/utils.ts +12 -0
- package/ui/src/routes/(private)/+layout.svelte +112 -0
- package/ui/src/routes/(private)/+page.svelte +7 -0
- package/ui/src/routes/(private)/[component]/+page.svelte +77 -0
- package/ui/src/routes/+layout.svelte +25 -0
- package/ui/src/routes/+layout.ts +14 -0
- package/ui/src/routes/layout.css +232 -0
- package/ui/static/robots.txt +3 -0
- package/ui/svelte.config.js +36 -0
- package/ui/tools/feat.js +43 -0
- package/ui/tools/hooks/README.md +13 -0
- package/ui/tools/hooks/guard-intl.sh +40 -0
- package/ui/tools/shad.js +7 -0
- package/ui/tsconfig.json +20 -0
- package/ui/vite.config.ts +8 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ClassValue } from 'svelte/elements'
|
|
2
|
+
import type { Icon } from '@lucide/svelte'
|
|
3
|
+
|
|
4
|
+
export interface Props {
|
|
5
|
+
sections?: Section[]
|
|
6
|
+
position?: 'start' | 'center' | 'end'
|
|
7
|
+
underlay?: boolean
|
|
8
|
+
class?: ClassValue
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface Section {
|
|
12
|
+
id: string
|
|
13
|
+
href: string
|
|
14
|
+
nested?: string[]
|
|
15
|
+
label: string
|
|
16
|
+
Icon: typeof Icon
|
|
17
|
+
unseen?: boolean
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function match(section: Section, path: string): boolean {
|
|
21
|
+
if (section.href === '/') // special case for home screen
|
|
22
|
+
if (path === '/') return true
|
|
23
|
+
else return section.nested?.some((nested) => path.startsWith(nested)) === true
|
|
24
|
+
|
|
25
|
+
return path.startsWith(section.href) || section.nested?.some((nested) => path.startsWith(nested)) === true
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function exact(section: Section, path: string): boolean {
|
|
29
|
+
if (section.href === '/') return path === '/'
|
|
30
|
+
else return path === section.href
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function nested(section: Section, path: string): boolean {
|
|
34
|
+
return match(section, path) && !exact(section, path)
|
|
35
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { onMount } from 'svelte'
|
|
3
|
+
import { returns } from './store'
|
|
4
|
+
import type { Props } from './Return'
|
|
5
|
+
|
|
6
|
+
const { children, href = '..', class: classes }: Props = $props()
|
|
7
|
+
|
|
8
|
+
onMount(() => {
|
|
9
|
+
const id = Math.random().toString(36).substring(2, 15)
|
|
10
|
+
|
|
11
|
+
function add() {
|
|
12
|
+
returns.update((back) => {
|
|
13
|
+
back.push({ id, href, children, class: classes })
|
|
14
|
+
|
|
15
|
+
return back
|
|
16
|
+
})
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function remove() {
|
|
20
|
+
returns.update((back) => {
|
|
21
|
+
return back.filter((back) => back.id !== id)
|
|
22
|
+
})
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
add()
|
|
26
|
+
|
|
27
|
+
return () => remove()
|
|
28
|
+
})
|
|
29
|
+
</script>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ClassValue } from 'svelte/elements'
|
|
2
|
+
import type { Snippet } from 'svelte'
|
|
3
|
+
|
|
4
|
+
export interface Props {
|
|
5
|
+
href?: string
|
|
6
|
+
class?: ClassValue
|
|
7
|
+
children?: Snippet
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface Return {
|
|
11
|
+
id: string
|
|
12
|
+
href: string
|
|
13
|
+
class?: ClassValue
|
|
14
|
+
children?: Snippet
|
|
15
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { onMount } from 'svelte'
|
|
3
|
+
import { page } from '$app/state'
|
|
4
|
+
import { goto, preloadCode } from '$app/navigation'
|
|
5
|
+
import { faded } from './store'
|
|
6
|
+
import { exact, nested, type Section } from './Nav'
|
|
7
|
+
import Button from './Button.svelte'
|
|
8
|
+
import Back from './Back.svelte'
|
|
9
|
+
import type { Props } from './Sections'
|
|
10
|
+
|
|
11
|
+
const { sections, section: active }: Props = $props()
|
|
12
|
+
|
|
13
|
+
const collapsed = $derived(active ? nested(active, page.url.pathname) : false)
|
|
14
|
+
const visible = $derived(sections.filter(({ id }) => !collapsed || id === active?.id))
|
|
15
|
+
|
|
16
|
+
onMount(() => {
|
|
17
|
+
for (const section of sections) {
|
|
18
|
+
preloadCode(section.href)
|
|
19
|
+
section.nested?.forEach((nested) => preloadCode(nested))
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
function href(section: Section) {
|
|
24
|
+
if (collapsed) return null
|
|
25
|
+
else return exact(section, page.url.pathname) ? null : section.href
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function click(section: Section) {
|
|
29
|
+
if (collapsed) void goto(section.href)
|
|
30
|
+
else {
|
|
31
|
+
const ref = href(section)
|
|
32
|
+
|
|
33
|
+
if (ref === null) window.scrollTo({ top: 0, behavior: 'smooth' })
|
|
34
|
+
else void goto(ref)
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
{#each sections as section (section.href)}
|
|
40
|
+
{@const hidden = !visible.includes(section)}
|
|
41
|
+
{#if collapsed && !hidden}
|
|
42
|
+
{@const ret = { href: section.href }}
|
|
43
|
+
<Back {ret} {section} />
|
|
44
|
+
{:else}
|
|
45
|
+
<div>
|
|
46
|
+
<Button
|
|
47
|
+
id={`nav-${section.id}-button`}
|
|
48
|
+
onclick={() => click(section)}
|
|
49
|
+
active={section.id === active?.id}
|
|
50
|
+
unseen={section.unseen}
|
|
51
|
+
faded={$faded}
|
|
52
|
+
class={[hidden && 'hidden']}>
|
|
53
|
+
<section.Icon color="var(--muted-foreground)" />
|
|
54
|
+
<span>{section.label}</span>
|
|
55
|
+
</Button>
|
|
56
|
+
</div>
|
|
57
|
+
{/if}
|
|
58
|
+
{/each}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import * as ButtonGroup from '$ui/button-group'
|
|
3
|
+
import { actions } from './store'
|
|
4
|
+
import type { Props } from './Toolbar'
|
|
5
|
+
|
|
6
|
+
const { position }: Props = $props()
|
|
7
|
+
|
|
8
|
+
const action = $derived($actions.at(-1) ?? null)
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
{#if action && position !== 'center'}
|
|
12
|
+
<div
|
|
13
|
+
class="flex h-full py-1 sm:me-4 transition-all duration-300 [&_svg:not([class*='size-'])]:size-5"
|
|
14
|
+
style="view-transition-name: shell-actions-{position}; view-transition-class: shell-actions">
|
|
15
|
+
<ButtonGroup.Root class={['flex h-full', action?.class]}>
|
|
16
|
+
{@render action.snippet()}
|
|
17
|
+
</ButtonGroup.Root>
|
|
18
|
+
</div>
|
|
19
|
+
{/if}
|
|
20
|
+
|
|
21
|
+
<style>
|
|
22
|
+
::view-transition-group(.shell-actions) {
|
|
23
|
+
z-index: 1;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
::view-transition-old(shell-actions-start),
|
|
27
|
+
::view-transition-new(shell-actions-start),
|
|
28
|
+
::view-transition-old(shell-actions-end),
|
|
29
|
+
::view-transition-new(shell-actions-end) {
|
|
30
|
+
width: auto;
|
|
31
|
+
isolation: isolate;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@keyframes slide-out-right {
|
|
35
|
+
to {
|
|
36
|
+
transform: translateX(150%);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@keyframes slide-in-left {
|
|
41
|
+
from {
|
|
42
|
+
transform: translateX(150%);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@keyframes slide-out-left {
|
|
47
|
+
to {
|
|
48
|
+
transform: translateX(-150%);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@keyframes slide-in-right {
|
|
53
|
+
from {
|
|
54
|
+
transform: translateX(-150%);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
::view-transition-old(shell-actions-start):only-child {
|
|
59
|
+
animation: slide-out-right 0.3s ease-out both;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
::view-transition-new(shell-actions-start):only-child {
|
|
63
|
+
animation: slide-in-left 0.3s ease-out both;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
::view-transition-old(shell-actions-end):only-child {
|
|
67
|
+
animation: slide-out-left 0.3s ease-out both;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
::view-transition-new(shell-actions-end):only-child {
|
|
71
|
+
animation: slide-in-right 0.3s ease-out both;
|
|
72
|
+
}
|
|
73
|
+
</style>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/// <reference types="@types/dom-navigation" />
|
|
2
|
+
import { goto } from '$app/navigation'
|
|
3
|
+
|
|
4
|
+
function path(url: URL): string {
|
|
5
|
+
return url.pathname + url.search + url.hash
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
function closest(target: string): number {
|
|
9
|
+
const entry = window.navigation.currentEntry
|
|
10
|
+
|
|
11
|
+
if (entry === null) return -1
|
|
12
|
+
|
|
13
|
+
const entries = window.navigation.entries()
|
|
14
|
+
|
|
15
|
+
for (let i = entry.index - 1; i >= 0; i--) {
|
|
16
|
+
const url = entries[i].url
|
|
17
|
+
|
|
18
|
+
if (url !== null && path(new URL(url)) === target)
|
|
19
|
+
return entry.index - i
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return -1
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export async function back(href: string): Promise<void> {
|
|
26
|
+
if (window.navigation.canGoBack) window.history.back()
|
|
27
|
+
else await goto(href)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export async function jump(href: string): Promise<void> {
|
|
31
|
+
const target = path(new URL(href, window.location.href))
|
|
32
|
+
const index = closest(target)
|
|
33
|
+
|
|
34
|
+
if (index > 0 && index <= 42) window.history.go(-index)
|
|
35
|
+
else await goto(href)
|
|
36
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { derived, writable } from 'svelte/store'
|
|
2
|
+
import type { Return } from './Return'
|
|
3
|
+
import type { Action } from './Actions'
|
|
4
|
+
|
|
5
|
+
export const actions = writable<Action[]>([])
|
|
6
|
+
export const returns = writable<Return[]>([])
|
|
7
|
+
|
|
8
|
+
export const faded = derived(
|
|
9
|
+
actions,
|
|
10
|
+
($actions, set) => {
|
|
11
|
+
const a = $actions.at(-1) ?? null
|
|
12
|
+
|
|
13
|
+
if (a === null || a.active === undefined) {
|
|
14
|
+
set(false)
|
|
15
|
+
|
|
16
|
+
return
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const unsub = a.active.subscribe(set)
|
|
20
|
+
|
|
21
|
+
return unsub
|
|
22
|
+
},
|
|
23
|
+
false,
|
|
24
|
+
)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn, type WithElementRef } from "$lib/utils.js";
|
|
3
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
children,
|
|
9
|
+
...restProps
|
|
10
|
+
}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<div
|
|
14
|
+
bind:this={ref}
|
|
15
|
+
data-slot="alert-action"
|
|
16
|
+
class={cn("absolute top-2 right-2", className)}
|
|
17
|
+
{...restProps}
|
|
18
|
+
>
|
|
19
|
+
{@render children?.()}
|
|
20
|
+
</div>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn, type WithElementRef } from "$lib/utils.js";
|
|
3
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
children,
|
|
9
|
+
...restProps
|
|
10
|
+
}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<div
|
|
14
|
+
bind:this={ref}
|
|
15
|
+
data-slot="alert-description"
|
|
16
|
+
class={cn(
|
|
17
|
+
"text-sm text-balance text-muted-foreground md:text-pretty [&_p:not(:last-child)]:mb-4 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground",
|
|
18
|
+
className
|
|
19
|
+
)}
|
|
20
|
+
{...restProps}
|
|
21
|
+
>
|
|
22
|
+
{@render children?.()}
|
|
23
|
+
</div>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn, type WithElementRef } from "$lib/utils.js";
|
|
3
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
children,
|
|
9
|
+
...restProps
|
|
10
|
+
}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<div
|
|
14
|
+
bind:this={ref}
|
|
15
|
+
data-slot="alert-title"
|
|
16
|
+
class={cn(
|
|
17
|
+
"font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground",
|
|
18
|
+
className
|
|
19
|
+
)}
|
|
20
|
+
{...restProps}
|
|
21
|
+
>
|
|
22
|
+
{@render children?.()}
|
|
23
|
+
</div>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import { type VariantProps, tv } from "tailwind-variants";
|
|
3
|
+
|
|
4
|
+
export const alertVariants = tv({
|
|
5
|
+
base: "grid gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4 group/alert relative w-full",
|
|
6
|
+
variants: {
|
|
7
|
+
variant: {
|
|
8
|
+
default: "bg-card text-card-foreground",
|
|
9
|
+
destructive: "bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current",
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
defaultVariants: {
|
|
13
|
+
variant: "default",
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export type AlertVariant = VariantProps<typeof alertVariants>["variant"];
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<script lang="ts">
|
|
21
|
+
import { cn, type WithElementRef } from "$lib/utils.js";
|
|
22
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
23
|
+
|
|
24
|
+
let {
|
|
25
|
+
ref = $bindable(null),
|
|
26
|
+
class: className,
|
|
27
|
+
variant = "default",
|
|
28
|
+
children,
|
|
29
|
+
...restProps
|
|
30
|
+
}: WithElementRef<HTMLAttributes<HTMLDivElement>> & {
|
|
31
|
+
variant?: AlertVariant;
|
|
32
|
+
} = $props();
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<div
|
|
36
|
+
bind:this={ref}
|
|
37
|
+
data-slot="alert"
|
|
38
|
+
role="alert"
|
|
39
|
+
class={cn(alertVariants({ variant }), className)}
|
|
40
|
+
{...restProps}
|
|
41
|
+
>
|
|
42
|
+
{@render children?.()}
|
|
43
|
+
</div>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import Action from "./alert-action.svelte";
|
|
2
|
+
import Description from "./alert-description.svelte";
|
|
3
|
+
import Title from "./alert-title.svelte";
|
|
4
|
+
import Root from "./alert.svelte";
|
|
5
|
+
export { alertVariants, type AlertVariant } from "./alert.svelte";
|
|
6
|
+
|
|
7
|
+
export {
|
|
8
|
+
Root,
|
|
9
|
+
Description,
|
|
10
|
+
Title,
|
|
11
|
+
Action,
|
|
12
|
+
//
|
|
13
|
+
Root as Alert,
|
|
14
|
+
Description as AlertDescription,
|
|
15
|
+
Title as AlertTitle,
|
|
16
|
+
Action as AlertAction,
|
|
17
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { AlertDialog as AlertDialogPrimitive } from "bits-ui";
|
|
3
|
+
import {
|
|
4
|
+
buttonVariants,
|
|
5
|
+
type ButtonVariant,
|
|
6
|
+
type ButtonSize,
|
|
7
|
+
} from "$ui/button/index.js";
|
|
8
|
+
import { cn } from "$lib/utils.js";
|
|
9
|
+
|
|
10
|
+
let {
|
|
11
|
+
ref = $bindable(null),
|
|
12
|
+
class: className,
|
|
13
|
+
variant = "default",
|
|
14
|
+
size = "default",
|
|
15
|
+
...restProps
|
|
16
|
+
}: AlertDialogPrimitive.ActionProps & {
|
|
17
|
+
variant?: ButtonVariant;
|
|
18
|
+
size?: ButtonSize;
|
|
19
|
+
} = $props();
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<AlertDialogPrimitive.Action
|
|
23
|
+
bind:ref
|
|
24
|
+
data-slot="alert-dialog-action"
|
|
25
|
+
class={cn(buttonVariants({ variant, size }), "cn-alert-dialog-action", className)}
|
|
26
|
+
{...restProps}
|
|
27
|
+
/>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { AlertDialog as AlertDialogPrimitive } from "bits-ui";
|
|
3
|
+
import {
|
|
4
|
+
buttonVariants,
|
|
5
|
+
type ButtonVariant,
|
|
6
|
+
type ButtonSize,
|
|
7
|
+
} from "$ui/button/index.js";
|
|
8
|
+
import { cn } from "$lib/utils.js";
|
|
9
|
+
|
|
10
|
+
let {
|
|
11
|
+
ref = $bindable(null),
|
|
12
|
+
class: className,
|
|
13
|
+
variant = "outline",
|
|
14
|
+
size = "default",
|
|
15
|
+
...restProps
|
|
16
|
+
}: AlertDialogPrimitive.CancelProps & {
|
|
17
|
+
variant?: ButtonVariant;
|
|
18
|
+
size?: ButtonSize;
|
|
19
|
+
} = $props();
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<AlertDialogPrimitive.Cancel
|
|
23
|
+
bind:ref
|
|
24
|
+
data-slot="alert-dialog-cancel"
|
|
25
|
+
class={cn(buttonVariants({ variant, size }), "cn-alert-dialog-cancel", className)}
|
|
26
|
+
{...restProps}
|
|
27
|
+
/>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { AlertDialog as AlertDialogPrimitive } from "bits-ui";
|
|
3
|
+
import { cn, type WithoutChild, type WithoutChildrenOrChild } from "$lib/utils.js";
|
|
4
|
+
import AlertDialogOverlay from "./alert-dialog-overlay.svelte";
|
|
5
|
+
import AlertDialogPortal from "./alert-dialog-portal.svelte";
|
|
6
|
+
import type { ComponentProps } from "svelte";
|
|
7
|
+
|
|
8
|
+
let {
|
|
9
|
+
ref = $bindable(null),
|
|
10
|
+
class: className,
|
|
11
|
+
size = "default",
|
|
12
|
+
portalProps,
|
|
13
|
+
...restProps
|
|
14
|
+
}: WithoutChild<AlertDialogPrimitive.ContentProps> & {
|
|
15
|
+
size?: "default" | "sm";
|
|
16
|
+
portalProps?: WithoutChildrenOrChild<ComponentProps<typeof AlertDialogPortal>>;
|
|
17
|
+
} = $props();
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<AlertDialogPortal {...portalProps}>
|
|
21
|
+
<AlertDialogOverlay />
|
|
22
|
+
<AlertDialogPrimitive.Content
|
|
23
|
+
bind:ref
|
|
24
|
+
data-slot="alert-dialog-content"
|
|
25
|
+
data-size={size}
|
|
26
|
+
class={cn(
|
|
27
|
+
"gap-4 rounded-xl bg-popover p-4 text-popover-foreground ring-1 ring-foreground/10 duration-100 data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 outline-none",
|
|
28
|
+
className
|
|
29
|
+
)}
|
|
30
|
+
{...restProps}
|
|
31
|
+
/>
|
|
32
|
+
</AlertDialogPortal>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { AlertDialog as AlertDialogPrimitive } from "bits-ui";
|
|
3
|
+
import { cn } from "$lib/utils.js";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
...restProps
|
|
9
|
+
}: AlertDialogPrimitive.DescriptionProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<AlertDialogPrimitive.Description
|
|
13
|
+
bind:ref
|
|
14
|
+
data-slot="alert-dialog-description"
|
|
15
|
+
class={cn("text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground", className)}
|
|
16
|
+
{...restProps}
|
|
17
|
+
/>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn, type WithElementRef } from "$lib/utils.js";
|
|
3
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
children,
|
|
9
|
+
...restProps
|
|
10
|
+
}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<div
|
|
14
|
+
bind:this={ref}
|
|
15
|
+
data-slot="alert-dialog-footer"
|
|
16
|
+
class={cn(
|
|
17
|
+
"-mx-4 -mb-4 rounded-b-xl border-t bg-muted/50 p-4 flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",
|
|
18
|
+
className
|
|
19
|
+
)}
|
|
20
|
+
{...restProps}
|
|
21
|
+
>
|
|
22
|
+
{@render children?.()}
|
|
23
|
+
</div>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn, type WithElementRef } from "$lib/utils.js";
|
|
3
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
children,
|
|
9
|
+
...restProps
|
|
10
|
+
}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<div
|
|
14
|
+
bind:this={ref}
|
|
15
|
+
data-slot="alert-dialog-header"
|
|
16
|
+
class={cn("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]", className)}
|
|
17
|
+
{...restProps}
|
|
18
|
+
>
|
|
19
|
+
{@render children?.()}
|
|
20
|
+
</div>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn, type WithElementRef } from "$lib/utils.js";
|
|
3
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
children,
|
|
9
|
+
...restProps
|
|
10
|
+
}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<div
|
|
14
|
+
bind:this={ref}
|
|
15
|
+
data-slot="alert-dialog-media"
|
|
16
|
+
class={cn("mb-2 inline-flex size-10 items-center justify-center rounded-md bg-muted sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-6", className)}
|
|
17
|
+
{...restProps}
|
|
18
|
+
>
|
|
19
|
+
{@render children?.()}
|
|
20
|
+
</div>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { AlertDialog as AlertDialogPrimitive } from "bits-ui";
|
|
3
|
+
import { cn } from "$lib/utils.js";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
...restProps
|
|
9
|
+
}: AlertDialogPrimitive.OverlayProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<AlertDialogPrimitive.Overlay
|
|
13
|
+
bind:ref
|
|
14
|
+
data-slot="alert-dialog-overlay"
|
|
15
|
+
class={cn("bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0 fixed inset-0 z-50", className)}
|
|
16
|
+
{...restProps}
|
|
17
|
+
/>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { AlertDialog as AlertDialogPrimitive } from "bits-ui";
|
|
3
|
+
import { cn } from "$lib/utils.js";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
...restProps
|
|
9
|
+
}: AlertDialogPrimitive.TitleProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<AlertDialogPrimitive.Title
|
|
13
|
+
bind:ref
|
|
14
|
+
data-slot="alert-dialog-title"
|
|
15
|
+
class={cn("text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2", className)}
|
|
16
|
+
{...restProps}
|
|
17
|
+
/>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { AlertDialog as AlertDialogPrimitive } from "bits-ui";
|
|
3
|
+
|
|
4
|
+
let { ref = $bindable(null), ...restProps }: AlertDialogPrimitive.TriggerProps = $props();
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<AlertDialogPrimitive.Trigger bind:ref data-slot="alert-dialog-trigger" {...restProps} />
|