@ternent/core 0.0.1
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/.changeset/README.md +8 -0
- package/.changeset/config.json +17 -0
- package/.github/workflows/deploy-armour.yml +42 -0
- package/.github/workflows/deploy-identity.yml +42 -0
- package/.github/workflows/deploy-seal.yml +42 -0
- package/.github/workflows/deploy-ui.yml +42 -0
- package/.github/workflows/deploy-utils.yml +42 -0
- package/.github/workflows/release-create.yml +59 -0
- package/.github/workflows/release-publish.yml +54 -0
- package/.nvmrc +1 -0
- package/.ops/publish.mjs +31 -0
- package/package.json +16 -0
- package/packages/README.md +0 -0
- package/packages/armour/CHANGELOG.md +66 -0
- package/packages/armour/CLAUDE.md +8 -0
- package/packages/armour/README.md +103 -0
- package/packages/armour/SPEC.md +92 -0
- package/packages/armour/package.json +45 -0
- package/packages/armour/src/constants.ts +5 -0
- package/packages/armour/src/deps.d.ts +56 -0
- package/packages/armour/src/errors.ts +172 -0
- package/packages/armour/src/files.ts +73 -0
- package/packages/armour/src/identity.ts +72 -0
- package/packages/armour/src/index.ts +56 -0
- package/packages/armour/src/init.ts +10 -0
- package/packages/armour/src/passphrase.ts +33 -0
- package/packages/armour/src/recipients.ts +73 -0
- package/packages/armour/src/text.ts +68 -0
- package/packages/armour/src/types.ts +93 -0
- package/packages/armour/test/armour.test.ts +270 -0
- package/packages/armour/tsconfig.build.json +12 -0
- package/packages/armour/tsconfig.json +12 -0
- package/packages/armour/vite.config.ts +29 -0
- package/packages/concord/CHANGELOG.md +83 -0
- package/packages/concord/CLAUDE.md +9 -0
- package/packages/concord/README.md +146 -0
- package/packages/concord/SPEC.md +287 -0
- package/packages/concord/package.json +51 -0
- package/packages/concord/src/app.ts +717 -0
- package/packages/concord/src/errors.ts +9 -0
- package/packages/concord/src/index.ts +20 -0
- package/packages/concord/src/types.ts +127 -0
- package/packages/concord/test/concord.test.ts +978 -0
- package/packages/concord/tsconfig.json +12 -0
- package/packages/concord/vite.browser.config.ts +27 -0
- package/packages/concord/vite.config.ts +35 -0
- package/packages/concord/vite.config.ts.timestamp-1774262297922-ffd76e35ea668.mjs +83 -0
- package/packages/identity/CHANGELOG.md +47 -0
- package/packages/identity/README.md +236 -0
- package/packages/identity/package.json +41 -0
- package/packages/identity/src/index.ts +538 -0
- package/packages/identity/test/identity.test.ts +172 -0
- package/packages/identity/tsconfig.build.json +12 -0
- package/packages/identity/vite.config.ts +17 -0
- package/packages/ledger/CHANGELOG.md +69 -0
- package/packages/ledger/CLAUDE.md +9 -0
- package/packages/ledger/SPEC.md +304 -0
- package/packages/ledger/package.json +48 -0
- package/packages/ledger/src/index.ts +2 -0
- package/packages/ledger/src/ledger.ts +1286 -0
- package/packages/ledger/src/seal-cli.d.ts +25 -0
- package/packages/ledger/src/types.ts +294 -0
- package/packages/ledger/test/ledger.test.ts +838 -0
- package/packages/ledger/tsconfig.json +12 -0
- package/packages/ledger/vite.browser.config.ts +27 -0
- package/packages/ledger/vite.config.ts +39 -0
- package/packages/seal/CHANGELOG.md +137 -0
- package/packages/seal/CLAUDE.md +8 -0
- package/packages/seal/README.md +258 -0
- package/packages/seal/bin/seal +6 -0
- package/packages/seal/package.json +59 -0
- package/packages/seal/src/artifact.ts +380 -0
- package/packages/seal/src/cli.ts +372 -0
- package/packages/seal/src/commands/identity.ts +52 -0
- package/packages/seal/src/commands/manifest.ts +71 -0
- package/packages/seal/src/commands/publicKey.ts +7 -0
- package/packages/seal/src/commands/sign.ts +56 -0
- package/packages/seal/src/commands/verify.ts +54 -0
- package/packages/seal/src/crypto.ts +85 -0
- package/packages/seal/src/errors.ts +88 -0
- package/packages/seal/src/index.ts +5 -0
- package/packages/seal/src/manifest.ts +114 -0
- package/packages/seal/src/node.ts +18 -0
- package/packages/seal/src/proof.ts +344 -0
- package/packages/seal/test/artifact.test.ts +86 -0
- package/packages/seal/test/cli.test.ts +208 -0
- package/packages/seal/test/crypto.test.ts +21 -0
- package/packages/seal/test/manifest.test.ts +32 -0
- package/packages/seal/test/proof.test.ts +60 -0
- package/packages/seal/tsconfig.json +12 -0
- package/packages/seal/vite.config.ts +54 -0
- package/packages/ui/CHANGELOG.md +393 -0
- package/packages/ui/README.md +57 -0
- package/packages/ui/jsconfig.json +19 -0
- package/packages/ui/package.json +64 -0
- package/packages/ui/scripts/check-tokens.js +56 -0
- package/packages/ui/scripts/generate-theme-css.mjs +85 -0
- package/packages/ui/src/design-system/base.css +8 -0
- package/packages/ui/src/design-system/docs/ACCESSIBILITY_RULES.md +186 -0
- package/packages/ui/src/design-system/docs/AI_SYSTEM.md +281 -0
- package/packages/ui/src/design-system/docs/PATTERN_RULES.md +83 -0
- package/packages/ui/src/design-system/docs/PRIMITIVE_RULES.md +258 -0
- package/packages/ui/src/design-system/docs/TOKEN_RULES.md +235 -0
- package/packages/ui/src/design-system/docs/VISUAL_DIRECTION.md +68 -0
- package/packages/ui/src/design-system/foundation.js +420 -0
- package/packages/ui/src/design-system/tokens.css +140 -0
- package/packages/ui/src/design-system/tokens.js +327 -0
- package/packages/ui/src/design-system/utils.js +246 -0
- package/packages/ui/src/main.js +4 -0
- package/packages/ui/src/patterns/FeatureCard/FeatureCard.spec.md +24 -0
- package/packages/ui/src/patterns/FeatureCard/FeatureCard.types.ts +8 -0
- package/packages/ui/src/patterns/FeatureCard/FeatureCard.vue +175 -0
- package/packages/ui/src/patterns/FormField/FormField.spec.md +65 -0
- package/packages/ui/src/patterns/FormField/FormField.types.ts +11 -0
- package/packages/ui/src/patterns/FormField/FormField.vue +87 -0
- package/packages/ui/src/patterns/IdentityGlyph/IdentityGlyph.vue +61 -0
- package/packages/ui/src/patterns/IdentityGlyph/IdentityHandle.vue +58 -0
- package/packages/ui/src/patterns/IdentityGlyph/identityGlyph.types.ts +36 -0
- package/packages/ui/src/patterns/IdentityGlyph/identityGlyph.utils.ts +585 -0
- package/packages/ui/src/patterns/IdentityGlyph/index.ts +5 -0
- package/packages/ui/src/patterns/KeyValueList/KeyValueList.spec.md +28 -0
- package/packages/ui/src/patterns/KeyValueList/KeyValueList.types.ts +16 -0
- package/packages/ui/src/patterns/KeyValueList/KeyValueList.vue +50 -0
- package/packages/ui/src/patterns/LandingPage/LandingIcon.vue +90 -0
- package/packages/ui/src/patterns/LandingPage/LandingPage.spec.md +24 -0
- package/packages/ui/src/patterns/LandingPage/LandingPage.types.ts +212 -0
- package/packages/ui/src/patterns/LandingPage/LandingPage.vue +599 -0
- package/packages/ui/src/patterns/ListWorkspaceLayout/ListWorkspaceLayout.test.ts +33 -0
- package/packages/ui/src/patterns/ListWorkspaceLayout/ListWorkspaceLayout.vue +44 -0
- package/packages/ui/src/patterns/Logo/Logo.spec.md +22 -0
- package/packages/ui/src/patterns/Logo/Logo.vue +160 -0
- package/packages/ui/src/patterns/PageSurface/PageSurface.spec.md +15 -0
- package/packages/ui/src/patterns/PageSurface/PageSurface.vue +85 -0
- package/packages/ui/src/patterns/PanelChrome/PanelChrome.spec.md +39 -0
- package/packages/ui/src/patterns/PanelChrome/PanelChrome.types.ts +1 -0
- package/packages/ui/src/patterns/PanelChrome/PanelChrome.vue +187 -0
- package/packages/ui/src/patterns/PreviewPanel/PreviewPanel.spec.md +31 -0
- package/packages/ui/src/patterns/PreviewPanel/PreviewPanel.types.ts +23 -0
- package/packages/ui/src/patterns/PreviewPanel/PreviewPanel.vue +354 -0
- package/packages/ui/src/patterns/RecordList/RecordList.spec.md +35 -0
- package/packages/ui/src/patterns/RecordList/RecordList.test.ts +42 -0
- package/packages/ui/src/patterns/RecordList/RecordList.types.ts +9 -0
- package/packages/ui/src/patterns/RecordList/RecordList.utils.ts +5 -0
- package/packages/ui/src/patterns/RecordList/RecordList.vue +134 -0
- package/packages/ui/src/patterns/SectionClarifier/SectionClarifier.vue +85 -0
- package/packages/ui/src/patterns/SectionIntro/SectionIntro.spec.md +25 -0
- package/packages/ui/src/patterns/SectionIntro/SectionIntro.types.ts +7 -0
- package/packages/ui/src/patterns/SectionIntro/SectionIntro.vue +141 -0
- package/packages/ui/src/patterns/SidebarNav/SidebarNav.spec.md +34 -0
- package/packages/ui/src/patterns/SidebarNav/SidebarNav.types.ts +17 -0
- package/packages/ui/src/patterns/SidebarNav/SidebarNav.vue +110 -0
- package/packages/ui/src/patterns/SplitView/SplitView.spec.md +28 -0
- package/packages/ui/src/patterns/SplitView/SplitView.test.ts +22 -0
- package/packages/ui/src/patterns/SplitView/SplitView.types.ts +3 -0
- package/packages/ui/src/patterns/SplitView/SplitView.utils.ts +13 -0
- package/packages/ui/src/patterns/SplitView/SplitView.vue +39 -0
- package/packages/ui/src/patterns/StepList/StepList.spec.md +15 -0
- package/packages/ui/src/patterns/StepList/StepList.types.ts +4 -0
- package/packages/ui/src/patterns/StepList/StepList.vue +91 -0
- package/packages/ui/src/patterns/Verification/VerificationBadge.vue +97 -0
- package/packages/ui/src/patterns/Verification/VerificationComponents.test.ts +153 -0
- package/packages/ui/src/patterns/Verification/VerificationDetailsPanel.vue +270 -0
- package/packages/ui/src/patterns/Verification/VerificationSummary.vue +171 -0
- package/packages/ui/src/patterns/Verification/index.ts +6 -0
- package/packages/ui/src/patterns/Verification/verification.types.ts +8 -0
- package/packages/ui/src/patterns/Verification/verification.utils.test.ts +37 -0
- package/packages/ui/src/patterns/Verification/verification.utils.ts +75 -0
- package/packages/ui/src/patterns/index.ts +25 -0
- package/packages/ui/src/primitives/Accordian/Accordian.vue +11 -0
- package/packages/ui/src/primitives/Accordian/AccordianItem.vue +14 -0
- package/packages/ui/src/primitives/Accordion/Accordion.props.ts +21 -0
- package/packages/ui/src/primitives/Accordion/Accordion.spec.md +50 -0
- package/packages/ui/src/primitives/Accordion/Accordion.types.ts +4 -0
- package/packages/ui/src/primitives/Accordion/Accordion.variants.ts +12 -0
- package/packages/ui/src/primitives/Accordion/Accordion.vue +71 -0
- package/packages/ui/src/primitives/Accordion/AccordionItem.props.ts +14 -0
- package/packages/ui/src/primitives/Accordion/AccordionItem.vue +40 -0
- package/packages/ui/src/primitives/Badge/Badge.props.ts +17 -0
- package/packages/ui/src/primitives/Badge/Badge.spec.md +17 -0
- package/packages/ui/src/primitives/Badge/Badge.types.ts +15 -0
- package/packages/ui/src/primitives/Badge/Badge.variants.ts +48 -0
- package/packages/ui/src/primitives/Badge/Badge.vue +31 -0
- package/packages/ui/src/primitives/Button/Button.props.ts +29 -0
- package/packages/ui/src/primitives/Button/Button.spec.md +139 -0
- package/packages/ui/src/primitives/Button/Button.types.ts +19 -0
- package/packages/ui/src/primitives/Button/Button.variants.ts +72 -0
- package/packages/ui/src/primitives/Button/Button.vue +90 -0
- package/packages/ui/src/primitives/Card/Card.props.ts +17 -0
- package/packages/ui/src/primitives/Card/Card.spec.md +29 -0
- package/packages/ui/src/primitives/Card/Card.types.ts +12 -0
- package/packages/ui/src/primitives/Card/Card.variants.ts +27 -0
- package/packages/ui/src/primitives/Card/Card.vue +37 -0
- package/packages/ui/src/primitives/Checkbox/Checkbox.props.ts +21 -0
- package/packages/ui/src/primitives/Checkbox/Checkbox.spec.md +51 -0
- package/packages/ui/src/primitives/Checkbox/Checkbox.types.ts +4 -0
- package/packages/ui/src/primitives/Checkbox/Checkbox.variants.ts +34 -0
- package/packages/ui/src/primitives/Checkbox/Checkbox.vue +92 -0
- package/packages/ui/src/primitives/Dialog/Dialog.props.ts +29 -0
- package/packages/ui/src/primitives/Dialog/Dialog.spec.md +52 -0
- package/packages/ui/src/primitives/Dialog/Dialog.types.ts +3 -0
- package/packages/ui/src/primitives/Dialog/Dialog.variants.ts +27 -0
- package/packages/ui/src/primitives/Dialog/Dialog.vue +78 -0
- package/packages/ui/src/primitives/Drawer/Drawer.props.ts +33 -0
- package/packages/ui/src/primitives/Drawer/Drawer.spec.md +50 -0
- package/packages/ui/src/primitives/Drawer/Drawer.types.ts +5 -0
- package/packages/ui/src/primitives/Drawer/Drawer.variants.ts +35 -0
- package/packages/ui/src/primitives/Drawer/Drawer.vue +88 -0
- package/packages/ui/src/primitives/FieldMessage/FieldMessage.props.ts +17 -0
- package/packages/ui/src/primitives/FieldMessage/FieldMessage.spec.md +35 -0
- package/packages/ui/src/primitives/FieldMessage/FieldMessage.types.ts +5 -0
- package/packages/ui/src/primitives/FieldMessage/FieldMessage.variants.ts +14 -0
- package/packages/ui/src/primitives/FieldMessage/FieldMessage.vue +40 -0
- package/packages/ui/src/primitives/FileInput/FileInput.props.ts +41 -0
- package/packages/ui/src/primitives/FileInput/FileInput.types.ts +6 -0
- package/packages/ui/src/primitives/FileInput/FileInput.variants.ts +46 -0
- package/packages/ui/src/primitives/FileInput/FileInput.vue +163 -0
- package/packages/ui/src/primitives/Input/Input.props.ts +29 -0
- package/packages/ui/src/primitives/Input/Input.spec.md +79 -0
- package/packages/ui/src/primitives/Input/Input.types.ts +13 -0
- package/packages/ui/src/primitives/Input/Input.variants.ts +54 -0
- package/packages/ui/src/primitives/Input/Input.vue +99 -0
- package/packages/ui/src/primitives/Label/Label.props.ts +25 -0
- package/packages/ui/src/primitives/Label/Label.spec.md +31 -0
- package/packages/ui/src/primitives/Label/Label.types.ts +3 -0
- package/packages/ui/src/primitives/Label/Label.variants.ts +17 -0
- package/packages/ui/src/primitives/Label/Label.vue +38 -0
- package/packages/ui/src/primitives/Menu/Menu.props.ts +17 -0
- package/packages/ui/src/primitives/Menu/Menu.spec.md +38 -0
- package/packages/ui/src/primitives/Menu/Menu.types.ts +10 -0
- package/packages/ui/src/primitives/Menu/Menu.variants.ts +10 -0
- package/packages/ui/src/primitives/Menu/Menu.vue +57 -0
- package/packages/ui/src/primitives/Popover/Popover.props.ts +25 -0
- package/packages/ui/src/primitives/Popover/Popover.spec.md +49 -0
- package/packages/ui/src/primitives/Popover/Popover.types.ts +3 -0
- package/packages/ui/src/primitives/Popover/Popover.variants.ts +18 -0
- package/packages/ui/src/primitives/Popover/Popover.vue +74 -0
- package/packages/ui/src/primitives/RadioGroup/RadioGroup.props.ts +29 -0
- package/packages/ui/src/primitives/RadioGroup/RadioGroup.spec.md +50 -0
- package/packages/ui/src/primitives/RadioGroup/RadioGroup.types.ts +12 -0
- package/packages/ui/src/primitives/RadioGroup/RadioGroup.variants.ts +48 -0
- package/packages/ui/src/primitives/RadioGroup/RadioGroup.vue +87 -0
- package/packages/ui/src/primitives/Separator/Separator.props.ts +9 -0
- package/packages/ui/src/primitives/Separator/Separator.spec.md +15 -0
- package/packages/ui/src/primitives/Separator/Separator.types.ts +3 -0
- package/packages/ui/src/primitives/Separator/Separator.variants.ts +8 -0
- package/packages/ui/src/primitives/Separator/Separator.vue +23 -0
- package/packages/ui/src/primitives/Skeleton/Skeleton.props.ts +21 -0
- package/packages/ui/src/primitives/Skeleton/Skeleton.spec.md +18 -0
- package/packages/ui/src/primitives/Skeleton/Skeleton.types.ts +5 -0
- package/packages/ui/src/primitives/Skeleton/Skeleton.variants.ts +18 -0
- package/packages/ui/src/primitives/Skeleton/Skeleton.vue +37 -0
- package/packages/ui/src/primitives/Spinner/Spinner.props.ts +13 -0
- package/packages/ui/src/primitives/Spinner/Spinner.spec.md +16 -0
- package/packages/ui/src/primitives/Spinner/Spinner.types.ts +5 -0
- package/packages/ui/src/primitives/Spinner/Spinner.variants.ts +15 -0
- package/packages/ui/src/primitives/Spinner/Spinner.vue +33 -0
- package/packages/ui/src/primitives/SplitButton/SplitButton.vue +108 -0
- package/packages/ui/src/primitives/Switch/Switch.props.ts +21 -0
- package/packages/ui/src/primitives/Switch/Switch.spec.md +49 -0
- package/packages/ui/src/primitives/Switch/Switch.types.ts +3 -0
- package/packages/ui/src/primitives/Switch/Switch.variants.ts +34 -0
- package/packages/ui/src/primitives/Switch/Switch.vue +71 -0
- package/packages/ui/src/primitives/Tabs/Tabs.props.ts +25 -0
- package/packages/ui/src/primitives/Tabs/Tabs.spec.md +48 -0
- package/packages/ui/src/primitives/Tabs/Tabs.types.ts +11 -0
- package/packages/ui/src/primitives/Tabs/Tabs.variants.ts +28 -0
- package/packages/ui/src/primitives/Tabs/Tabs.vue +59 -0
- package/packages/ui/src/primitives/Textarea/Textarea.props.ts +33 -0
- package/packages/ui/src/primitives/Textarea/Textarea.spec.md +59 -0
- package/packages/ui/src/primitives/Textarea/Textarea.types.ts +5 -0
- package/packages/ui/src/primitives/Textarea/Textarea.variants.ts +27 -0
- package/packages/ui/src/primitives/Textarea/Textarea.vue +74 -0
- package/packages/ui/src/primitives/Tooltip/Tooltip.props.ts +21 -0
- package/packages/ui/src/primitives/Tooltip/Tooltip.spec.md +45 -0
- package/packages/ui/src/primitives/Tooltip/Tooltip.types.ts +3 -0
- package/packages/ui/src/primitives/Tooltip/Tooltip.variants.ts +4 -0
- package/packages/ui/src/primitives/Tooltip/Tooltip.vue +31 -0
- package/packages/ui/src/primitives/TreeView/TreeView.types.ts +10 -0
- package/packages/ui/src/primitives/TreeView/TreeView.vue +113 -0
- package/packages/ui/src/primitives/TreeView/TreeViewNode.vue +190 -0
- package/packages/ui/src/primitives/index.ts +29 -0
- package/packages/ui/src/style.css +7 -0
- package/packages/ui/src/style.js +1 -0
- package/packages/ui/src/themes/armour.css +147 -0
- package/packages/ui/src/themes/aurora.css +147 -0
- package/packages/ui/src/themes/citrine-ash.css +147 -0
- package/packages/ui/src/themes/concord.css +147 -0
- package/packages/ui/src/themes/garnet-honey.css +147 -0
- package/packages/ui/src/themes/harbor-rose.css +147 -0
- package/packages/ui/src/themes/ledger.css +147 -0
- package/packages/ui/src/themes/neon-noir.css +74 -0
- package/packages/ui/src/themes/obsidian-iris.css +147 -0
- package/packages/ui/src/themes/pixpax.css +147 -0
- package/packages/ui/src/themes/print.css +147 -0
- package/packages/ui/src/themes/prism.css +147 -0
- package/packages/ui/src/themes/proof.css +145 -0
- package/packages/ui/src/themes/semanticThemeContract.js +2256 -0
- package/packages/ui/src/themes/spruce-ink.css +147 -0
- package/packages/ui/src/themes/sunset.css +147 -0
- package/packages/ui/tailwind.config.js +64 -0
- package/packages/ui/vite.config.js +35 -0
- package/packages/ui/vite.config.js.timestamp-1780697224943-89fbc929987bc.mjs +38 -0
- package/packages/utils/CHANGELOG.md +111 -0
- package/packages/utils/README.md +3 -0
- package/packages/utils/package.json +46 -0
- package/packages/utils/src/index.test.js +39 -0
- package/packages/utils/src/index.ts +289 -0
- package/packages/utils/tsconfig.build.json +12 -0
- package/packages/utils/vite.config.js +28 -0
- package/pnpm-workspace.yaml +8 -0
- package/scripts/vite/package-lib-config.ts +59 -0
- package/tsconfig.json +24 -0
- package/tsconfig.node.json +9 -0
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Design System Tokens
|
|
3
|
+
* Inspired by Stripe and Airbnb design systems
|
|
4
|
+
*
|
|
5
|
+
* This file defines the foundational design tokens that create
|
|
6
|
+
* a cohesive, premium visual language across all components.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { colors as foundationColors } from "./foundation.js";
|
|
10
|
+
|
|
11
|
+
export const designTokens = {
|
|
12
|
+
// === COLOR SYSTEM ===
|
|
13
|
+
colors: {
|
|
14
|
+
...foundationColors,
|
|
15
|
+
},
|
|
16
|
+
|
|
17
|
+
// === SPACING SCALE ===
|
|
18
|
+
// Based on 4px base unit with strategic scaling
|
|
19
|
+
spacing: {
|
|
20
|
+
px: "1px",
|
|
21
|
+
0: "0",
|
|
22
|
+
0.5: "2px", // 0.125rem
|
|
23
|
+
1: "4px", // 0.25rem
|
|
24
|
+
1.5: "6px", // 0.375rem
|
|
25
|
+
2: "8px", // 0.5rem
|
|
26
|
+
2.5: "10px", // 0.625rem
|
|
27
|
+
3: "12px", // 0.75rem
|
|
28
|
+
3.5: "14px", // 0.875rem
|
|
29
|
+
4: "16px", // 1rem
|
|
30
|
+
5: "20px", // 1.25rem
|
|
31
|
+
6: "24px", // 1.5rem
|
|
32
|
+
7: "28px", // 1.75rem
|
|
33
|
+
8: "32px", // 2rem
|
|
34
|
+
9: "36px", // 2.25rem
|
|
35
|
+
10: "40px", // 2.5rem
|
|
36
|
+
11: "44px", // 2.75rem
|
|
37
|
+
12: "48px", // 3rem
|
|
38
|
+
14: "56px", // 3.5rem
|
|
39
|
+
16: "64px", // 4rem
|
|
40
|
+
20: "80px", // 5rem
|
|
41
|
+
24: "96px", // 6rem
|
|
42
|
+
28: "112px", // 7rem
|
|
43
|
+
32: "128px", // 8rem
|
|
44
|
+
36: "144px", // 9rem
|
|
45
|
+
40: "160px", // 10rem
|
|
46
|
+
44: "176px", // 11rem
|
|
47
|
+
48: "192px", // 12rem
|
|
48
|
+
52: "208px", // 13rem
|
|
49
|
+
56: "224px", // 14rem
|
|
50
|
+
60: "240px", // 15rem
|
|
51
|
+
64: "256px", // 16rem
|
|
52
|
+
72: "288px", // 18rem
|
|
53
|
+
80: "320px", // 20rem
|
|
54
|
+
96: "384px", // 24rem
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
// === TYPOGRAPHY SCALE ===
|
|
58
|
+
// Carefully crafted type scale for hierarchy and readability
|
|
59
|
+
typography: {
|
|
60
|
+
fontSize: {
|
|
61
|
+
xs: ["12px", "16px"], // 0.75rem, line-height 1.33
|
|
62
|
+
sm: ["14px", "20px"], // 0.875rem, line-height 1.43
|
|
63
|
+
base: ["16px", "24px"], // 1rem, line-height 1.5
|
|
64
|
+
lg: ["18px", "28px"], // 1.125rem, line-height 1.56
|
|
65
|
+
xl: ["20px", "28px"], // 1.25rem, line-height 1.4
|
|
66
|
+
"2xl": ["24px", "32px"], // 1.5rem, line-height 1.33
|
|
67
|
+
"3xl": ["30px", "36px"], // 1.875rem, line-height 1.2
|
|
68
|
+
"4xl": ["36px", "40px"], // 2.25rem, line-height 1.11
|
|
69
|
+
"5xl": ["48px", "56px"], // 3rem, line-height 1.17
|
|
70
|
+
"6xl": ["60px", "72px"], // 3.75rem, line-height 1.2
|
|
71
|
+
"7xl": ["72px", "80px"], // 4.5rem, line-height 1.11
|
|
72
|
+
"8xl": ["96px", "104px"], // 6rem, line-height 1.08
|
|
73
|
+
"9xl": ["128px", "136px"], // 8rem, line-height 1.06
|
|
74
|
+
},
|
|
75
|
+
fontWeight: {
|
|
76
|
+
thin: "100",
|
|
77
|
+
extralight: "200",
|
|
78
|
+
light: "300",
|
|
79
|
+
normal: "400",
|
|
80
|
+
medium: "500",
|
|
81
|
+
semibold: "600",
|
|
82
|
+
bold: "700",
|
|
83
|
+
extrabold: "800",
|
|
84
|
+
black: "900",
|
|
85
|
+
},
|
|
86
|
+
fontFamily: {
|
|
87
|
+
sans: [
|
|
88
|
+
"Inter",
|
|
89
|
+
"-apple-system",
|
|
90
|
+
"BlinkMacSystemFont",
|
|
91
|
+
'"Segoe UI"',
|
|
92
|
+
"Roboto",
|
|
93
|
+
'"Helvetica Neue"',
|
|
94
|
+
"Arial",
|
|
95
|
+
"sans-serif",
|
|
96
|
+
],
|
|
97
|
+
mono: ['"JetBrains Mono"', '"Fira Code"', "Consolas", '"SF Mono"', "Monaco", "monospace"],
|
|
98
|
+
},
|
|
99
|
+
letterSpacing: {
|
|
100
|
+
tighter: "-0.05em",
|
|
101
|
+
tight: "-0.025em",
|
|
102
|
+
normal: "0em",
|
|
103
|
+
wide: "0.025em",
|
|
104
|
+
wider: "0.05em",
|
|
105
|
+
widest: "0.1em",
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
|
|
109
|
+
// === BORDER RADIUS ===
|
|
110
|
+
// Consistent rounded corners that feel modern but not overly rounded
|
|
111
|
+
borderRadius: {
|
|
112
|
+
none: "0",
|
|
113
|
+
xs: "2px",
|
|
114
|
+
sm: "4px",
|
|
115
|
+
base: "6px", // Default for most elements
|
|
116
|
+
md: "8px",
|
|
117
|
+
lg: "12px",
|
|
118
|
+
xl: "16px",
|
|
119
|
+
"2xl": "20px",
|
|
120
|
+
"3xl": "24px",
|
|
121
|
+
full: "9999px",
|
|
122
|
+
},
|
|
123
|
+
|
|
124
|
+
// === SHADOWS ===
|
|
125
|
+
// Subtle, layered shadows that create depth without being heavy
|
|
126
|
+
shadow: {
|
|
127
|
+
xs: "0 1px 2px 0 rgb(0 0 0 / 0.05)",
|
|
128
|
+
sm: "0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",
|
|
129
|
+
base: "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",
|
|
130
|
+
md: "0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",
|
|
131
|
+
lg: "0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)",
|
|
132
|
+
xl: "0 25px 50px -12px rgb(0 0 0 / 0.25)",
|
|
133
|
+
"2xl": "0 25px 50px -12px rgb(0 0 0 / 0.25)",
|
|
134
|
+
inner: "inset 0 2px 4px 0 rgb(0 0 0 / 0.05)",
|
|
135
|
+
|
|
136
|
+
// Colored shadows for interactive elements
|
|
137
|
+
primary: "0 4px 14px 0 rgb(99 91 255 / 0.15)",
|
|
138
|
+
success: "0 4px 14px 0 rgb(0 217 36 / 0.15)",
|
|
139
|
+
warning: "0 4px 14px 0 rgb(255 167 38 / 0.15)",
|
|
140
|
+
error: "0 4px 14px 0 rgb(226 89 80 / 0.15)",
|
|
141
|
+
},
|
|
142
|
+
|
|
143
|
+
// === TRANSITIONS ===
|
|
144
|
+
// Smooth, professional animation timings
|
|
145
|
+
transition: {
|
|
146
|
+
duration: {
|
|
147
|
+
fastest: "75ms",
|
|
148
|
+
fast: "150ms",
|
|
149
|
+
base: "200ms",
|
|
150
|
+
medium: "300ms",
|
|
151
|
+
slow: "500ms",
|
|
152
|
+
slowest: "1000ms",
|
|
153
|
+
},
|
|
154
|
+
easing: {
|
|
155
|
+
linear: "linear",
|
|
156
|
+
out: "cubic-bezier(0, 0, 0.2, 1)",
|
|
157
|
+
in: "cubic-bezier(0.4, 0, 1, 1)",
|
|
158
|
+
"in-out": "cubic-bezier(0.4, 0, 0.2, 1)",
|
|
159
|
+
|
|
160
|
+
// Custom Stripe-inspired easings
|
|
161
|
+
smooth: "cubic-bezier(0.25, 0.46, 0.45, 0.94)",
|
|
162
|
+
bounce: "cubic-bezier(0.68, -0.55, 0.265, 1.55)",
|
|
163
|
+
elastic: "cubic-bezier(0.175, 0.885, 0.32, 1.275)",
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
|
|
167
|
+
// === Z-INDEX SCALE ===
|
|
168
|
+
// Organized layering system
|
|
169
|
+
zIndex: {
|
|
170
|
+
hide: -1,
|
|
171
|
+
auto: "auto",
|
|
172
|
+
base: 0,
|
|
173
|
+
docked: 10,
|
|
174
|
+
dropdown: 1000,
|
|
175
|
+
sticky: 1100,
|
|
176
|
+
banner: 1200,
|
|
177
|
+
overlay: 1300,
|
|
178
|
+
modal: 1400,
|
|
179
|
+
popover: 1500,
|
|
180
|
+
skipLink: 1600,
|
|
181
|
+
toast: 1700,
|
|
182
|
+
tooltip: 1800,
|
|
183
|
+
},
|
|
184
|
+
|
|
185
|
+
// === COMPONENT SIZING ===
|
|
186
|
+
// Consistent sizing for interactive elements
|
|
187
|
+
size: {
|
|
188
|
+
button: {
|
|
189
|
+
micro: { height: "28px", padding: "0 10px", fontSize: "12px" },
|
|
190
|
+
xs: { height: "32px", padding: "0 12px", fontSize: "12px" },
|
|
191
|
+
sm: { height: "36px", padding: "0 14px", fontSize: "13px" },
|
|
192
|
+
base: { height: "40px", padding: "0 16px", fontSize: "14px" },
|
|
193
|
+
lg: { height: "44px", padding: "0 18px", fontSize: "15px" },
|
|
194
|
+
xl: { height: "48px", padding: "0 20px", fontSize: "16px" },
|
|
195
|
+
},
|
|
196
|
+
input: {
|
|
197
|
+
sm: { height: "32px", padding: "0 8px", fontSize: "sm" },
|
|
198
|
+
base: { height: "40px", padding: "0 12px", fontSize: "base" },
|
|
199
|
+
lg: { height: "48px", padding: "0 16px", fontSize: "lg" },
|
|
200
|
+
},
|
|
201
|
+
avatar: {
|
|
202
|
+
xs: "20px",
|
|
203
|
+
sm: "24px",
|
|
204
|
+
base: "32px",
|
|
205
|
+
lg: "40px",
|
|
206
|
+
xl: "48px",
|
|
207
|
+
"2xl": "56px",
|
|
208
|
+
"3xl": "64px",
|
|
209
|
+
},
|
|
210
|
+
},
|
|
211
|
+
|
|
212
|
+
// === LAYOUT CONSTANTS ===
|
|
213
|
+
layout: {
|
|
214
|
+
maxWidth: {
|
|
215
|
+
xs: "320px",
|
|
216
|
+
sm: "384px",
|
|
217
|
+
md: "448px",
|
|
218
|
+
lg: "512px",
|
|
219
|
+
xl: "576px",
|
|
220
|
+
"2xl": "672px",
|
|
221
|
+
"3xl": "768px",
|
|
222
|
+
"4xl": "896px",
|
|
223
|
+
"5xl": "1024px",
|
|
224
|
+
"6xl": "1152px",
|
|
225
|
+
"7xl": "1280px",
|
|
226
|
+
full: "100%",
|
|
227
|
+
},
|
|
228
|
+
container: {
|
|
229
|
+
padding: "16px",
|
|
230
|
+
maxWidth: "1200px",
|
|
231
|
+
},
|
|
232
|
+
sidebar: {
|
|
233
|
+
width: "240px",
|
|
234
|
+
collapsedWidth: "64px",
|
|
235
|
+
},
|
|
236
|
+
header: {
|
|
237
|
+
height: "64px",
|
|
238
|
+
},
|
|
239
|
+
},
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
// Export individual token categories for easy imports
|
|
243
|
+
export const {
|
|
244
|
+
colors,
|
|
245
|
+
spacing,
|
|
246
|
+
typography,
|
|
247
|
+
borderRadius,
|
|
248
|
+
shadow,
|
|
249
|
+
transition,
|
|
250
|
+
zIndex,
|
|
251
|
+
size,
|
|
252
|
+
layout,
|
|
253
|
+
} = designTokens;
|
|
254
|
+
|
|
255
|
+
export const uiCssTokenDocs = {
|
|
256
|
+
"--ui-bg": "App background (paper).",
|
|
257
|
+
"--ui-fg": "Primary text (ink).",
|
|
258
|
+
"--ui-fg-muted": "Muted text.",
|
|
259
|
+
"--ui-surface": "Raised surface background.",
|
|
260
|
+
"--ui-surface-hover": "Hover surface background.",
|
|
261
|
+
"--ui-border": "Dividers and hairlines.",
|
|
262
|
+
"--ui-primary": "Primary action/brand color.",
|
|
263
|
+
"--ui-on-primary": "Text/icon on primary.",
|
|
264
|
+
"--ui-primary-muted": "Primary tint for subtle fills.",
|
|
265
|
+
"--ui-primary-hover": "Primary hover fill.",
|
|
266
|
+
"--ui-primary-active": "Primary active fill.",
|
|
267
|
+
"--ui-accent": "Accent/attention color.",
|
|
268
|
+
"--ui-on-accent": "Text/icon on accent.",
|
|
269
|
+
"--ui-accent-muted": "Accent tint for subtle fills.",
|
|
270
|
+
"--ui-accent-hover": "Accent hover fill.",
|
|
271
|
+
"--ui-accent-active": "Accent active fill.",
|
|
272
|
+
"--ui-secondary": "Secondary action color.",
|
|
273
|
+
"--ui-on-secondary": "Text/icon on secondary.",
|
|
274
|
+
"--ui-secondary-muted": "Secondary tint for subtle fills.",
|
|
275
|
+
"--ui-secondary-hover": "Secondary hover fill.",
|
|
276
|
+
"--ui-secondary-active": "Secondary active fill.",
|
|
277
|
+
"--ui-critical": "Critical/danger tone.",
|
|
278
|
+
"--ui-on-critical": "Text/icon on critical.",
|
|
279
|
+
"--ui-critical-muted": "Critical tint for subtle fills.",
|
|
280
|
+
"--ui-critical-hover": "Critical hover fill.",
|
|
281
|
+
"--ui-critical-active": "Critical active fill.",
|
|
282
|
+
"--ui-success": "Success/positive tone.",
|
|
283
|
+
"--ui-on-success": "Text/icon on success.",
|
|
284
|
+
"--ui-success-muted": "Success tint for subtle fills.",
|
|
285
|
+
"--ui-success-hover": "Success hover fill.",
|
|
286
|
+
"--ui-success-active": "Success active fill.",
|
|
287
|
+
"--ui-warning": "Warning tone.",
|
|
288
|
+
"--ui-on-warning": "Text/icon on warning.",
|
|
289
|
+
"--ui-warning-muted": "Warning tint for subtle fills.",
|
|
290
|
+
"--ui-warning-hover": "Warning hover fill.",
|
|
291
|
+
"--ui-warning-active": "Warning active fill.",
|
|
292
|
+
"--ui-info": "Info tone.",
|
|
293
|
+
"--ui-on-info": "Text/icon on info.",
|
|
294
|
+
"--ui-info-muted": "Info tint for subtle fills.",
|
|
295
|
+
"--ui-info-hover": "Info hover fill.",
|
|
296
|
+
"--ui-info-active": "Info active fill.",
|
|
297
|
+
"--ui-danger": "Alias of --ui-critical for app configs.",
|
|
298
|
+
"--ui-on-danger": "Alias of --ui-on-critical for app configs.",
|
|
299
|
+
"--ui-danger-muted": "Alias of --ui-critical-muted for app configs.",
|
|
300
|
+
"--ui-danger-hover": "Alias of --ui-critical-hover for app configs.",
|
|
301
|
+
"--ui-danger-active": "Alias of --ui-critical-active for app configs.",
|
|
302
|
+
"--ui-tonal-secondary": "Subtle neutral fill.",
|
|
303
|
+
"--ui-tonal-secondary-hover": "Subtle neutral hover fill.",
|
|
304
|
+
"--ui-tonal-tertiary": "Extra light neutral fill.",
|
|
305
|
+
"--ui-tonal-tertiary-hover": "Extra light neutral hover fill.",
|
|
306
|
+
"--ui-ring": "Focus ring color.",
|
|
307
|
+
"--ui-glow-primary": "Primary glow shadow.",
|
|
308
|
+
"--ui-glow-accent": "Accent glow shadow.",
|
|
309
|
+
"--ui-glow-critical": "Critical glow shadow.",
|
|
310
|
+
"--ui-glow-success": "Success glow shadow.",
|
|
311
|
+
"--ui-logo-start": "Logo gradient start color.",
|
|
312
|
+
"--ui-logo-end": "Logo gradient end color.",
|
|
313
|
+
"--ui-logo-cutout": "Logo interior cutout fill.",
|
|
314
|
+
"--ui-radius-sm": "Small radius.",
|
|
315
|
+
"--ui-radius-md": "Medium radius.",
|
|
316
|
+
"--ui-radius-lg": "Large radius.",
|
|
317
|
+
"--ui-duration-fast": "Fast transition duration.",
|
|
318
|
+
"--ui-duration-normal": "Default transition duration.",
|
|
319
|
+
"--ui-duration-slow": "Slow transition duration.",
|
|
320
|
+
"--ui-ease-out": "Default easing curve.",
|
|
321
|
+
"--ui-shadow-sm": "Small elevation shadow.",
|
|
322
|
+
"--ui-shadow-md": "Medium elevation shadow.",
|
|
323
|
+
"--ui-lift-hover": "Hover translate offset.",
|
|
324
|
+
"--ui-scale-active": "Active press scale.",
|
|
325
|
+
};
|
|
326
|
+
|
|
327
|
+
export const uiCssTokens = Object.keys(uiCssTokenDocs);
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Component Utilities
|
|
3
|
+
* Core utilities for building consistent, premium components
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { designTokens } from "./tokens.js";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Generate consistent component classes based on size and variant
|
|
10
|
+
*/
|
|
11
|
+
export const createComponentClasses = {
|
|
12
|
+
/**
|
|
13
|
+
* Button class generator - creates premium button styles
|
|
14
|
+
*/
|
|
15
|
+
button: ({ variant = "primary", size = "base", state = "default" }) => {
|
|
16
|
+
const baseClasses = [
|
|
17
|
+
"inline-flex items-center justify-center",
|
|
18
|
+
"font-medium tracking-wide",
|
|
19
|
+
"border border-transparent",
|
|
20
|
+
"transition-all duration-200 ease-smooth",
|
|
21
|
+
"focus:outline-none focus:ring-2 focus:ring-offset-2",
|
|
22
|
+
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
23
|
+
"disabled:transform-none",
|
|
24
|
+
"transform hover:scale-[1.02] active:scale-[0.98]",
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
// Size-specific classes
|
|
28
|
+
const sizeClasses = {
|
|
29
|
+
micro: ["text-xs", "px-2", "py-1", "h-5", "rounded", "min-w-[20px]"],
|
|
30
|
+
xs: ["text-xs", "px-2.5", "py-1.5", "h-6", "rounded", "min-w-[24px]"],
|
|
31
|
+
sm: ["text-sm", "px-3", "py-2", "h-8", "rounded-md", "min-w-[32px]"],
|
|
32
|
+
base: ["text-base", "px-4", "py-2.5", "h-10", "rounded-md", "min-w-[40px]"],
|
|
33
|
+
lg: ["text-lg", "px-6", "py-3", "h-12", "rounded-lg", "min-w-[48px]"],
|
|
34
|
+
xl: ["text-xl", "px-8", "py-4", "h-14", "rounded-lg", "min-w-[56px]"],
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
// Variant-specific classes
|
|
38
|
+
const variantClasses = {
|
|
39
|
+
primary: [
|
|
40
|
+
"bg-primary text-primary-content",
|
|
41
|
+
"hover:bg-primary-focus hover:shadow-primary",
|
|
42
|
+
"focus:ring-primary/50",
|
|
43
|
+
"active:bg-primary-focus",
|
|
44
|
+
],
|
|
45
|
+
secondary: [
|
|
46
|
+
"bg-secondary text-secondary-content",
|
|
47
|
+
"hover:bg-secondary-focus hover:shadow-success",
|
|
48
|
+
"focus:ring-secondary/50",
|
|
49
|
+
"active:bg-secondary-focus",
|
|
50
|
+
],
|
|
51
|
+
accent: [
|
|
52
|
+
"bg-accent text-accent-content",
|
|
53
|
+
"hover:bg-accent-focus hover:shadow-primary",
|
|
54
|
+
"focus:ring-accent/50",
|
|
55
|
+
"active:bg-accent-focus",
|
|
56
|
+
],
|
|
57
|
+
outline: [
|
|
58
|
+
"bg-transparent text-base-content border-base-300",
|
|
59
|
+
"hover:bg-base-200 hover:border-base-400 hover:shadow-sm",
|
|
60
|
+
"focus:ring-primary/30 focus:border-primary",
|
|
61
|
+
"active:bg-base-300",
|
|
62
|
+
],
|
|
63
|
+
ghost: [
|
|
64
|
+
"bg-transparent text-base-content border-transparent",
|
|
65
|
+
"hover:bg-base-200 hover:shadow-sm",
|
|
66
|
+
"focus:ring-primary/30",
|
|
67
|
+
"active:bg-base-300",
|
|
68
|
+
],
|
|
69
|
+
"ghost-icon": [
|
|
70
|
+
"bg-transparent text-base-content border-transparent p-2",
|
|
71
|
+
"hover:bg-base-200 hover:shadow-sm rounded-lg",
|
|
72
|
+
"focus:ring-primary/30",
|
|
73
|
+
"active:bg-base-300",
|
|
74
|
+
"aspect-square justify-center",
|
|
75
|
+
],
|
|
76
|
+
link: [
|
|
77
|
+
"bg-transparent text-primary border-transparent",
|
|
78
|
+
"hover:text-primary-focus hover:underline",
|
|
79
|
+
"focus:ring-primary/30",
|
|
80
|
+
"active:text-primary-focus",
|
|
81
|
+
"px-0 h-auto py-0 min-w-0",
|
|
82
|
+
],
|
|
83
|
+
success: [
|
|
84
|
+
"bg-success text-success-content",
|
|
85
|
+
"hover:bg-success/90 hover:shadow-success",
|
|
86
|
+
"focus:ring-success/50",
|
|
87
|
+
],
|
|
88
|
+
warning: [
|
|
89
|
+
"bg-warning text-warning-content",
|
|
90
|
+
"hover:bg-warning/90 hover:shadow-warning",
|
|
91
|
+
"focus:ring-warning/50",
|
|
92
|
+
],
|
|
93
|
+
error: [
|
|
94
|
+
"bg-error text-error-content",
|
|
95
|
+
"hover:bg-error/90 hover:shadow-error",
|
|
96
|
+
"focus:ring-error/50",
|
|
97
|
+
],
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
return [
|
|
101
|
+
...baseClasses,
|
|
102
|
+
...(sizeClasses[size] || sizeClasses.base),
|
|
103
|
+
...(variantClasses[variant] || variantClasses.primary),
|
|
104
|
+
].join(" ");
|
|
105
|
+
},
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Card class generator - creates premium card styles
|
|
109
|
+
*/
|
|
110
|
+
card: ({ variant = "default", padding = "base", elevated = false }) => {
|
|
111
|
+
const baseClasses = [
|
|
112
|
+
"bg-base-100 border border-base-300",
|
|
113
|
+
"transition-all duration-200 ease-smooth",
|
|
114
|
+
];
|
|
115
|
+
|
|
116
|
+
const paddingClasses = {
|
|
117
|
+
none: [],
|
|
118
|
+
sm: ["p-4"],
|
|
119
|
+
base: ["p-6"],
|
|
120
|
+
lg: ["p-8"],
|
|
121
|
+
xl: ["p-10"],
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
const variantClasses = {
|
|
125
|
+
default: ["rounded-lg"],
|
|
126
|
+
elevated: ["rounded-lg shadow-md hover:shadow-lg"],
|
|
127
|
+
bordered: ["rounded-lg border-2"],
|
|
128
|
+
glass: ["rounded-xl backdrop-blur-sm bg-base-100/80 border-base-300/50"],
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
const elevationClasses = elevated
|
|
132
|
+
? ["shadow-lg hover:shadow-xl"]
|
|
133
|
+
: ["shadow-sm hover:shadow-md"];
|
|
134
|
+
|
|
135
|
+
return [
|
|
136
|
+
...baseClasses,
|
|
137
|
+
...(paddingClasses[padding] || paddingClasses.base),
|
|
138
|
+
...(variantClasses[variant] || variantClasses.default),
|
|
139
|
+
...elevationClasses,
|
|
140
|
+
].join(" ");
|
|
141
|
+
},
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Input class generator - creates premium input styles
|
|
145
|
+
*/
|
|
146
|
+
input: ({ size = "base", state = "default", variant = "default" }) => {
|
|
147
|
+
const baseClasses = [
|
|
148
|
+
"w-full border rounded-md",
|
|
149
|
+
"bg-base-100 text-base-content placeholder-base-content/50",
|
|
150
|
+
"transition-all duration-200 ease-smooth",
|
|
151
|
+
"focus:outline-none focus:ring-2 focus:ring-primary/30 focus:border-primary",
|
|
152
|
+
"disabled:opacity-50 disabled:cursor-not-allowed disabled:bg-base-200",
|
|
153
|
+
];
|
|
154
|
+
|
|
155
|
+
const sizeClasses = {
|
|
156
|
+
sm: ["text-sm", "px-3", "py-2", "h-8"],
|
|
157
|
+
base: ["text-base", "px-4", "py-2.5", "h-10"],
|
|
158
|
+
lg: ["text-lg", "px-5", "py-3", "h-12"],
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
const stateClasses = {
|
|
162
|
+
default: ["border-base-300 hover:border-base-400"],
|
|
163
|
+
error: ["border-error focus:ring-error/30 focus:border-error"],
|
|
164
|
+
success: ["border-success focus:ring-success/30 focus:border-success"],
|
|
165
|
+
warning: ["border-warning focus:ring-warning/30 focus:border-warning"],
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
return [
|
|
169
|
+
...baseClasses,
|
|
170
|
+
...(sizeClasses[size] || sizeClasses.base),
|
|
171
|
+
...(stateClasses[state] || stateClasses.default),
|
|
172
|
+
].join(" ");
|
|
173
|
+
},
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Badge class generator - creates premium badge styles
|
|
177
|
+
*/
|
|
178
|
+
badge: ({ variant = "default", size = "base" }) => {
|
|
179
|
+
const baseClasses = [
|
|
180
|
+
"inline-flex items-center justify-center",
|
|
181
|
+
"font-medium rounded-full",
|
|
182
|
+
"transition-all duration-200 ease-smooth",
|
|
183
|
+
];
|
|
184
|
+
|
|
185
|
+
const sizeClasses = {
|
|
186
|
+
xs: ["text-xs", "px-2", "py-0.5", "h-4"],
|
|
187
|
+
sm: ["text-xs", "px-2.5", "py-1", "h-5"],
|
|
188
|
+
base: ["text-sm", "px-3", "py-1", "h-6"],
|
|
189
|
+
lg: ["text-base", "px-4", "py-1.5", "h-7"],
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
const variantClasses = {
|
|
193
|
+
default: ["bg-base-200 text-base-content"],
|
|
194
|
+
primary: ["bg-primary/10 text-primary border border-primary/20"],
|
|
195
|
+
secondary: ["bg-secondary/10 text-secondary border border-secondary/20"],
|
|
196
|
+
accent: ["bg-accent/10 text-accent border border-accent/20"],
|
|
197
|
+
success: ["bg-success/10 text-success border border-success/20"],
|
|
198
|
+
warning: ["bg-warning/10 text-warning border border-warning/20"],
|
|
199
|
+
error: ["bg-error/10 text-error border border-error/20"],
|
|
200
|
+
neutral: ["bg-neutral/10 text-neutral border border-neutral/20"],
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
return [
|
|
204
|
+
...baseClasses,
|
|
205
|
+
...(sizeClasses[size] || sizeClasses.base),
|
|
206
|
+
...(variantClasses[variant] || variantClasses.default),
|
|
207
|
+
].join(" ");
|
|
208
|
+
},
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Animation utilities for premium interactions
|
|
213
|
+
*/
|
|
214
|
+
export const animations = {
|
|
215
|
+
fadeIn: "animate-in fade-in duration-200",
|
|
216
|
+
fadeOut: "animate-out fade-out duration-200",
|
|
217
|
+
slideInFromTop: "animate-in slide-in-from-top-2 duration-300",
|
|
218
|
+
slideInFromBottom: "animate-in slide-in-from-bottom-2 duration-300",
|
|
219
|
+
slideInFromLeft: "animate-in slide-in-from-left-2 duration-300",
|
|
220
|
+
slideInFromRight: "animate-in slide-in-from-right-2 duration-300",
|
|
221
|
+
scaleIn: "animate-in zoom-in-95 duration-200",
|
|
222
|
+
scaleOut: "animate-out zoom-out-95 duration-200",
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Focus management utilities
|
|
227
|
+
*/
|
|
228
|
+
export const focus = {
|
|
229
|
+
ring: "focus:outline-none focus:ring-2 focus:ring-primary/30 focus:ring-offset-2",
|
|
230
|
+
visible: "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/30",
|
|
231
|
+
within: "focus-within:ring-2 focus-within:ring-primary/30",
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Layout utilities for consistent spacing and structure
|
|
236
|
+
*/
|
|
237
|
+
export const layout = {
|
|
238
|
+
container: "container mx-auto px-4 sm:px-6 lg:px-8",
|
|
239
|
+
section: "py-12 sm:py-16 lg:py-20",
|
|
240
|
+
stack: "space-y-6",
|
|
241
|
+
stackSm: "space-y-4",
|
|
242
|
+
stackLg: "space-y-8",
|
|
243
|
+
grid: "grid gap-6",
|
|
244
|
+
flex: "flex items-center gap-4",
|
|
245
|
+
center: "flex items-center justify-center",
|
|
246
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# FeatureCard
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Reusable marketing or product-summary tile with optional icon, title, and description.
|
|
6
|
+
|
|
7
|
+
## Category
|
|
8
|
+
|
|
9
|
+
Pattern
|
|
10
|
+
|
|
11
|
+
## Public API
|
|
12
|
+
|
|
13
|
+
Props:
|
|
14
|
+
|
|
15
|
+
- `title`
|
|
16
|
+
- `description`
|
|
17
|
+
- `tone`: `primary | secondary | accent | success | info`
|
|
18
|
+
- `size`: `md | sm`
|
|
19
|
+
- `surface`: `elevated | panel | subtle`
|
|
20
|
+
|
|
21
|
+
Slots:
|
|
22
|
+
|
|
23
|
+
- `icon`
|
|
24
|
+
- default
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export const featureCardToneValues = ["primary", "secondary", "accent", "success", "info"] as const;
|
|
2
|
+
|
|
3
|
+
export const featureCardSizeValues = ["md", "sm"] as const;
|
|
4
|
+
export const featureCardSurfaceValues = ["elevated", "panel", "subtle"] as const;
|
|
5
|
+
|
|
6
|
+
export type FeatureCardTone = (typeof featureCardToneValues)[number];
|
|
7
|
+
export type FeatureCardSize = (typeof featureCardSizeValues)[number];
|
|
8
|
+
export type FeatureCardSurface = (typeof featureCardSurfaceValues)[number];
|