@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,258 @@
|
|
|
1
|
+
# PRIMITIVE_RULES
|
|
2
|
+
|
|
3
|
+
## Goal
|
|
4
|
+
|
|
5
|
+
Primitives are the stable building blocks of `ternent-ui` v2.
|
|
6
|
+
They must be easy for humans and AI agents to understand, extend, and compose.
|
|
7
|
+
|
|
8
|
+
## Current repo baseline
|
|
9
|
+
|
|
10
|
+
The current primitive layer is only partially aligned with this document.
|
|
11
|
+
|
|
12
|
+
- `src/primitives/Button/*` established the first canonical template and should remain the baseline for future primitive structure.
|
|
13
|
+
- `src/primitives/Accordion/*` is canonical, while `Accordian/*` remains a compatibility layer during migration.
|
|
14
|
+
- `SplitButton/*` still exists from earlier work and should be reconciled with the newer primitive contract when touched.
|
|
15
|
+
- `src/patterns/*` now exists for higher-level reusable compositions.
|
|
16
|
+
- Primitive `*.spec.md` files now exist for the active v2 surface and must stay aligned with implementation changes.
|
|
17
|
+
|
|
18
|
+
## Placement
|
|
19
|
+
|
|
20
|
+
All new reusable low-level and mid-level components go in `src/primitives`.
|
|
21
|
+
|
|
22
|
+
Do not place new reusable primitives in:
|
|
23
|
+
|
|
24
|
+
- `src/components`
|
|
25
|
+
- app-specific directories
|
|
26
|
+
- ad hoc utility folders
|
|
27
|
+
|
|
28
|
+
## Canonical file structure
|
|
29
|
+
|
|
30
|
+
Each primitive should normally use this shape:
|
|
31
|
+
|
|
32
|
+
```txt
|
|
33
|
+
Component/
|
|
34
|
+
Component.vue
|
|
35
|
+
Component.props.ts
|
|
36
|
+
Component.types.ts
|
|
37
|
+
Component.variants.ts
|
|
38
|
+
Component.spec.md
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
This may be slightly simplified for very small components, but the default expectation is consistency.
|
|
42
|
+
|
|
43
|
+
## File responsibilities
|
|
44
|
+
|
|
45
|
+
### `Component.vue`
|
|
46
|
+
|
|
47
|
+
Responsible for:
|
|
48
|
+
|
|
49
|
+
- rendering structure
|
|
50
|
+
- wiring props to classes and attributes
|
|
51
|
+
- small computed class composition
|
|
52
|
+
- slot rendering
|
|
53
|
+
|
|
54
|
+
Avoid putting large variant maps directly in the SFC.
|
|
55
|
+
|
|
56
|
+
### `Component.props.ts`
|
|
57
|
+
|
|
58
|
+
Responsible for:
|
|
59
|
+
|
|
60
|
+
- prop definitions
|
|
61
|
+
- defaults
|
|
62
|
+
- shared prop naming consistency
|
|
63
|
+
|
|
64
|
+
### `Component.types.ts`
|
|
65
|
+
|
|
66
|
+
Responsible for:
|
|
67
|
+
|
|
68
|
+
- exported unions
|
|
69
|
+
- helper types
|
|
70
|
+
- public type surface
|
|
71
|
+
|
|
72
|
+
### `Component.variants.ts`
|
|
73
|
+
|
|
74
|
+
Responsible for:
|
|
75
|
+
|
|
76
|
+
- base classes
|
|
77
|
+
- size maps
|
|
78
|
+
- variant maps
|
|
79
|
+
- stateful class combinations
|
|
80
|
+
- token-based class composition
|
|
81
|
+
|
|
82
|
+
### `Component.spec.md`
|
|
83
|
+
|
|
84
|
+
Responsible for:
|
|
85
|
+
|
|
86
|
+
- purpose
|
|
87
|
+
- category
|
|
88
|
+
- anatomy
|
|
89
|
+
- API
|
|
90
|
+
- variants
|
|
91
|
+
- sizes
|
|
92
|
+
- states
|
|
93
|
+
- accessibility requirements
|
|
94
|
+
- examples
|
|
95
|
+
- do and don’t guidance
|
|
96
|
+
|
|
97
|
+
## API design rules
|
|
98
|
+
|
|
99
|
+
1. prefer small APIs
|
|
100
|
+
2. prefer consistent prop names across primitives
|
|
101
|
+
3. prefer composition over one-off prop expansion
|
|
102
|
+
4. do not import legacy API quirks without evaluating them
|
|
103
|
+
5. use slots when they create a cleaner public surface
|
|
104
|
+
6. expose only what is needed for stable usage
|
|
105
|
+
|
|
106
|
+
## Shared prop conventions
|
|
107
|
+
|
|
108
|
+
Use these consistently where relevant:
|
|
109
|
+
|
|
110
|
+
- `variant`
|
|
111
|
+
- `size`
|
|
112
|
+
- `tone`
|
|
113
|
+
- `disabled`
|
|
114
|
+
- `invalid`
|
|
115
|
+
- `loading`
|
|
116
|
+
- `modelValue` for input-like primitives following Vue conventions
|
|
117
|
+
- `as` only where polymorphism is genuinely needed
|
|
118
|
+
|
|
119
|
+
Avoid drift such as:
|
|
120
|
+
|
|
121
|
+
- `kind` vs `variant`
|
|
122
|
+
- `error` vs `invalid`
|
|
123
|
+
- `regular` vs `md`
|
|
124
|
+
- `tiny` vs `xs`
|
|
125
|
+
|
|
126
|
+
## Variant philosophy
|
|
127
|
+
|
|
128
|
+
Use a restrained and repeatable vocabulary.
|
|
129
|
+
|
|
130
|
+
Preferred baseline:
|
|
131
|
+
|
|
132
|
+
- `solid`
|
|
133
|
+
- `soft`
|
|
134
|
+
- `outline`
|
|
135
|
+
- `ghost`
|
|
136
|
+
- `plain`
|
|
137
|
+
|
|
138
|
+
Where a component needs a different axis based on existing repo reality, document it clearly.
|
|
139
|
+
|
|
140
|
+
Because the current Button already uses variants like `primary`, `secondary`, and `critical`, the first refactor may preserve that vocabulary temporarily. If so, document it and avoid inventing yet another scheme in parallel.
|
|
141
|
+
|
|
142
|
+
## Size philosophy
|
|
143
|
+
|
|
144
|
+
Preferred baseline:
|
|
145
|
+
|
|
146
|
+
- `sm`
|
|
147
|
+
- `md`
|
|
148
|
+
- `lg`
|
|
149
|
+
|
|
150
|
+
Extra sizes such as `xs`, `xl`, or `micro` are allowed only when there is demonstrated usage.
|
|
151
|
+
If a component uses extra sizes, the reason should be documented.
|
|
152
|
+
|
|
153
|
+
## State requirements
|
|
154
|
+
|
|
155
|
+
Interactive primitives should define and support relevant states.
|
|
156
|
+
|
|
157
|
+
Common states:
|
|
158
|
+
|
|
159
|
+
- default
|
|
160
|
+
- hover
|
|
161
|
+
- active
|
|
162
|
+
- focus-visible
|
|
163
|
+
- disabled
|
|
164
|
+
- invalid
|
|
165
|
+
- loading
|
|
166
|
+
- selected
|
|
167
|
+
- open
|
|
168
|
+
|
|
169
|
+
Not every state applies to every primitive, but omission should be intentional.
|
|
170
|
+
|
|
171
|
+
## Styling rules
|
|
172
|
+
|
|
173
|
+
1. use semantic tokens only
|
|
174
|
+
2. no raw Tailwind palette classes
|
|
175
|
+
3. no arbitrary radius or spacing values
|
|
176
|
+
4. no inline styles unless technically necessary and documented
|
|
177
|
+
5. keep class logic centralized in `*.variants.ts` where practical
|
|
178
|
+
6. keep the component silhouette consistent with the system
|
|
179
|
+
|
|
180
|
+
## Composition rules
|
|
181
|
+
|
|
182
|
+
Primitives should be:
|
|
183
|
+
|
|
184
|
+
- composable
|
|
185
|
+
- generic
|
|
186
|
+
- not tied to app business logic
|
|
187
|
+
- not tied to a single product layout
|
|
188
|
+
|
|
189
|
+
If a component starts needing app-shell opinions or form grouping logic, consider making it a pattern instead.
|
|
190
|
+
If the work belongs in `src/patterns`, create that layer intentionally rather than pretending it already exists.
|
|
191
|
+
|
|
192
|
+
## Slots
|
|
193
|
+
|
|
194
|
+
Use slots when they improve flexibility without bloating the prop API.
|
|
195
|
+
|
|
196
|
+
Common slot use cases:
|
|
197
|
+
|
|
198
|
+
- leading or trailing adornments
|
|
199
|
+
- icon areas
|
|
200
|
+
- content override areas
|
|
201
|
+
- label or description composition in pattern-level components
|
|
202
|
+
|
|
203
|
+
Avoid creating a prop for every possible visual arrangement when a slot is cleaner.
|
|
204
|
+
|
|
205
|
+
## Accessibility expectations
|
|
206
|
+
|
|
207
|
+
All primitives must meet the accessibility contract defined in `ACCESSIBILITY_RULES.md`.
|
|
208
|
+
Where Ark UI is used, rely on it correctly rather than partially reimplementing behavior.
|
|
209
|
+
|
|
210
|
+
## Spec requirement
|
|
211
|
+
|
|
212
|
+
Every primitive should have a `Component.spec.md` file.
|
|
213
|
+
This is not optional documentation fluff.
|
|
214
|
+
It is part of the AI contract.
|
|
215
|
+
|
|
216
|
+
Current repo note: this requirement is now satisfied for the active v2 primitive surface, so future primitive changes should update the relevant spec file instead of letting it drift.
|
|
217
|
+
|
|
218
|
+
The spec should describe:
|
|
219
|
+
|
|
220
|
+
- purpose
|
|
221
|
+
- anatomy
|
|
222
|
+
- props
|
|
223
|
+
- emitted events if relevant
|
|
224
|
+
- slots
|
|
225
|
+
- variants
|
|
226
|
+
- sizes
|
|
227
|
+
- states
|
|
228
|
+
- accessibility
|
|
229
|
+
- token usage
|
|
230
|
+
- examples
|
|
231
|
+
|
|
232
|
+
## Export rules
|
|
233
|
+
|
|
234
|
+
Every primitive added to `src/primitives` must also be reviewed for export in `src/primitives/index.ts`.
|
|
235
|
+
Exports should be deliberate and stable.
|
|
236
|
+
When adjusting existing primitives, account for the current exported surface, including `Button`, `SplitButton`, and the misspelled `Accordian` exports.
|
|
237
|
+
|
|
238
|
+
## Refactor policy for legacy equivalents
|
|
239
|
+
|
|
240
|
+
If a legacy `S*` component exists:
|
|
241
|
+
|
|
242
|
+
- inspect it for behavior and usage reference only
|
|
243
|
+
- do not port line by line
|
|
244
|
+
- identify whether the v2 version should be a primitive or a pattern
|
|
245
|
+
- preserve useful behavior but redesign the API if needed
|
|
246
|
+
|
|
247
|
+
## Review checklist
|
|
248
|
+
|
|
249
|
+
Before a primitive is considered ready, confirm:
|
|
250
|
+
|
|
251
|
+
- it lives in `src/primitives`
|
|
252
|
+
- it follows the canonical file shape
|
|
253
|
+
- it uses tokens only
|
|
254
|
+
- it has a documented API
|
|
255
|
+
- it has relevant states
|
|
256
|
+
- it is not leaking app logic
|
|
257
|
+
- it is exported intentionally
|
|
258
|
+
- it has a spec file
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
# TOKEN_RULES
|
|
2
|
+
|
|
3
|
+
## Goal
|
|
4
|
+
|
|
5
|
+
Tokens are the contract that makes multi-theme support, visual consistency, and AI-driven implementation possible.
|
|
6
|
+
|
|
7
|
+
Primitives must consume tokens, not raw visual values.
|
|
8
|
+
|
|
9
|
+
## Token layers
|
|
10
|
+
|
|
11
|
+
Use three conceptual layers.
|
|
12
|
+
|
|
13
|
+
### 1. Raw tokens
|
|
14
|
+
|
|
15
|
+
Raw tokens represent palette and scale values.
|
|
16
|
+
These are theme authoring values, not component consumption values.
|
|
17
|
+
|
|
18
|
+
Examples:
|
|
19
|
+
|
|
20
|
+
- raw color values in theme files
|
|
21
|
+
- scale values for radius, shadow, duration, spacing
|
|
22
|
+
|
|
23
|
+
Raw tokens are allowed inside theme definitions and token generation logic.
|
|
24
|
+
Primitives should not consume them directly.
|
|
25
|
+
|
|
26
|
+
### 2. System semantic tokens
|
|
27
|
+
|
|
28
|
+
These are the tokens primitives should consume.
|
|
29
|
+
In this repo, the existing `--ui-*` tokens are already acting as the semantic layer.
|
|
30
|
+
|
|
31
|
+
Existing examples include:
|
|
32
|
+
|
|
33
|
+
- `--ui-bg`
|
|
34
|
+
- `--ui-fg`
|
|
35
|
+
- `--ui-fg-muted`
|
|
36
|
+
- `--ui-surface`
|
|
37
|
+
- `--ui-surface-hover`
|
|
38
|
+
- `--ui-border`
|
|
39
|
+
- `--ui-primary`
|
|
40
|
+
- `--ui-on-primary`
|
|
41
|
+
- `--ui-primary-muted`
|
|
42
|
+
- `--ui-primary-hover`
|
|
43
|
+
- `--ui-primary-active`
|
|
44
|
+
- `--ui-accent`
|
|
45
|
+
- `--ui-on-accent`
|
|
46
|
+
- `--ui-secondary`
|
|
47
|
+
- `--ui-on-secondary`
|
|
48
|
+
- `--ui-critical`
|
|
49
|
+
- `--ui-on-critical`
|
|
50
|
+
- `--ui-success`
|
|
51
|
+
- `--ui-on-success`
|
|
52
|
+
- `--ui-warning`
|
|
53
|
+
- `--ui-on-warning`
|
|
54
|
+
- `--ui-info`
|
|
55
|
+
- `--ui-on-info`
|
|
56
|
+
- `--ui-tonal-secondary`
|
|
57
|
+
- `--ui-tonal-tertiary`
|
|
58
|
+
- `--ui-ring`
|
|
59
|
+
- `--ui-glow-primary`
|
|
60
|
+
- `--ui-radius-md`
|
|
61
|
+
- `--ui-shadow-sm`
|
|
62
|
+
- `--ui-duration-normal`
|
|
63
|
+
- `--ui-ease-out`
|
|
64
|
+
- `--ui-lift-hover`
|
|
65
|
+
- `--ui-scale-active`
|
|
66
|
+
|
|
67
|
+
These are acceptable as the current canonical consumption layer.
|
|
68
|
+
|
|
69
|
+
Compatibility aliases also exist where needed, for example the `--ui-danger*` aliases that currently map to the `--ui-critical*` family.
|
|
70
|
+
|
|
71
|
+
### 3. Optional component aliases
|
|
72
|
+
|
|
73
|
+
Component aliases may be introduced sparingly when a primitive has a stable, repeated need that is too specific for the general semantic layer.
|
|
74
|
+
|
|
75
|
+
Examples:
|
|
76
|
+
|
|
77
|
+
- `--button-bg-primary`
|
|
78
|
+
- `--input-border-default`
|
|
79
|
+
- `--card-surface-default`
|
|
80
|
+
|
|
81
|
+
Avoid component aliases unless the general token model cannot express the need cleanly.
|
|
82
|
+
|
|
83
|
+
## Current repo strategy
|
|
84
|
+
|
|
85
|
+
Do not perform a giant token rewrite first.
|
|
86
|
+
Use the existing `--ui-*` family as the active semantic contract.
|
|
87
|
+
Improve coverage and naming gradually.
|
|
88
|
+
|
|
89
|
+
That means:
|
|
90
|
+
|
|
91
|
+
- reuse the current token family wherever possible
|
|
92
|
+
- expand carefully when a real gap appears
|
|
93
|
+
- only rename tokens when the system meaning becomes meaningfully clearer
|
|
94
|
+
- treat `src/design-system/tokens.css` as the current source of truth for the active semantic contract
|
|
95
|
+
- preserve the current light/dark remapping behavior, which is defined in the core token file using `prefers-color-scheme`
|
|
96
|
+
|
|
97
|
+
## Consumption rules
|
|
98
|
+
|
|
99
|
+
Primitives must:
|
|
100
|
+
|
|
101
|
+
1. consume existing `--ui-*` tokens or approved new semantic tokens only
|
|
102
|
+
2. never hard-code hex, rgb, hsl, oklch, or named colors
|
|
103
|
+
3. never use Tailwind palette utilities like `bg-zinc-900` or `text-red-500`
|
|
104
|
+
4. never introduce arbitrary motion or radius values without updating the token contract
|
|
105
|
+
5. prefer semantic token combinations over one-off visual hacks
|
|
106
|
+
|
|
107
|
+
## Allowed primitive usage examples
|
|
108
|
+
|
|
109
|
+
Good:
|
|
110
|
+
|
|
111
|
+
- `bg-[var(--ui-primary)]`
|
|
112
|
+
- `text-[var(--ui-on-primary)]`
|
|
113
|
+
- `rounded-[var(--ui-radius-md)]`
|
|
114
|
+
- `shadow-[var(--ui-shadow-sm)]`
|
|
115
|
+
- `duration-[var(--ui-duration-normal)]`
|
|
116
|
+
- `focus-visible:ring-[var(--ui-ring)]`
|
|
117
|
+
|
|
118
|
+
Bad:
|
|
119
|
+
|
|
120
|
+
- `bg-purple-700`
|
|
121
|
+
- `text-zinc-100`
|
|
122
|
+
- `rounded-[13px]`
|
|
123
|
+
- `duration-150`
|
|
124
|
+
- `shadow-[0_8px_30px_rgba(0,0,0,0.18)]` unless the shadow token is added first
|
|
125
|
+
|
|
126
|
+
## Minimal semantic categories to preserve
|
|
127
|
+
|
|
128
|
+
Even if token names evolve, the system should continue to support these semantic roles.
|
|
129
|
+
|
|
130
|
+
### Base and text
|
|
131
|
+
|
|
132
|
+
- canvas background
|
|
133
|
+
- primary foreground
|
|
134
|
+
- muted foreground
|
|
135
|
+
- inverse foreground where needed
|
|
136
|
+
|
|
137
|
+
### Surfaces
|
|
138
|
+
|
|
139
|
+
- surface
|
|
140
|
+
- surface hover
|
|
141
|
+
- border
|
|
142
|
+
- tonal surfaces
|
|
143
|
+
|
|
144
|
+
### Interactive accents
|
|
145
|
+
|
|
146
|
+
- primary
|
|
147
|
+
- on primary
|
|
148
|
+
- primary muted
|
|
149
|
+
- primary hover
|
|
150
|
+
- primary active
|
|
151
|
+
|
|
152
|
+
### Feedback tones
|
|
153
|
+
|
|
154
|
+
- critical
|
|
155
|
+
- success
|
|
156
|
+
- warning
|
|
157
|
+
- info
|
|
158
|
+
- corresponding “on” colors and muted or hover states where relevant
|
|
159
|
+
|
|
160
|
+
### Utility tokens
|
|
161
|
+
|
|
162
|
+
- focus ring
|
|
163
|
+
- radii
|
|
164
|
+
- shadows
|
|
165
|
+
- durations
|
|
166
|
+
- easing
|
|
167
|
+
- interaction lift or active scale if retained
|
|
168
|
+
|
|
169
|
+
## Adding a new token
|
|
170
|
+
|
|
171
|
+
A new token may be added only when all of the following are true:
|
|
172
|
+
|
|
173
|
+
1. a real component need exists
|
|
174
|
+
2. the need cannot be expressed cleanly with current tokens
|
|
175
|
+
3. the token has a clear semantic meaning
|
|
176
|
+
4. it can be themed consistently across all supported themes
|
|
177
|
+
5. the addition is documented in both token docs and affected components
|
|
178
|
+
|
|
179
|
+
## Updating themes
|
|
180
|
+
|
|
181
|
+
When a new semantic token is added:
|
|
182
|
+
|
|
183
|
+
1. define it in the base token layer
|
|
184
|
+
2. add it to every supported theme or ensure it safely falls back
|
|
185
|
+
3. verify both light and dark behavior if relevant
|
|
186
|
+
4. update any generated theme outputs if the build pipeline requires it
|
|
187
|
+
|
|
188
|
+
AI must not add a new token in only one theme.
|
|
189
|
+
|
|
190
|
+
## Token naming guidance
|
|
191
|
+
|
|
192
|
+
Prefer names that describe role, not appearance.
|
|
193
|
+
|
|
194
|
+
Prefer:
|
|
195
|
+
|
|
196
|
+
- `--ui-surface`
|
|
197
|
+
- `--ui-primary`
|
|
198
|
+
- `--ui-fg-muted`
|
|
199
|
+
- `--ui-ring`
|
|
200
|
+
|
|
201
|
+
Avoid:
|
|
202
|
+
|
|
203
|
+
- `--ui-purple`
|
|
204
|
+
- `--ui-dark-border`
|
|
205
|
+
- `--ui-button-green`
|
|
206
|
+
|
|
207
|
+
If a name includes a component, it should only be because the token is a deliberate component alias.
|
|
208
|
+
|
|
209
|
+
## Migration guidance
|
|
210
|
+
|
|
211
|
+
Because the repo already has a working token family, migration should be staged.
|
|
212
|
+
|
|
213
|
+
### Good migration work
|
|
214
|
+
|
|
215
|
+
- replacing hard-coded values with existing `--ui-*` tokens
|
|
216
|
+
- expanding missing states using current tokens
|
|
217
|
+
- rationalizing inconsistent use of `surface`, `tonal`, and `primary` roles
|
|
218
|
+
- preserving existing compatibility aliases until the consuming surface is deliberately migrated
|
|
219
|
+
- introducing missing utility tokens with documentation
|
|
220
|
+
|
|
221
|
+
### Bad migration work
|
|
222
|
+
|
|
223
|
+
- renaming many tokens at once without a real need
|
|
224
|
+
- introducing a second semantic vocabulary in parallel without a plan
|
|
225
|
+
- forcing every primitive to adopt a new naming model before the token layer is stable
|
|
226
|
+
|
|
227
|
+
## Review checklist
|
|
228
|
+
|
|
229
|
+
Before merging token-related changes, confirm:
|
|
230
|
+
|
|
231
|
+
- does the primitive use tokens only?
|
|
232
|
+
- is the token meaning clear?
|
|
233
|
+
- does the token work across all themes?
|
|
234
|
+
- is the token documented?
|
|
235
|
+
- is the change incremental rather than disruptive?
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# VISUAL_DIRECTION
|
|
2
|
+
|
|
3
|
+
## Design intent
|
|
4
|
+
|
|
5
|
+
`ternent-ui` should feel:
|
|
6
|
+
|
|
7
|
+
- premium but not luxurious
|
|
8
|
+
- technical but not sterile
|
|
9
|
+
- calm, restrained, and modern
|
|
10
|
+
- slightly soft in geometry
|
|
11
|
+
- dense enough for serious app interfaces
|
|
12
|
+
- polished in dark mode
|
|
13
|
+
- quietly expressive rather than loud
|
|
14
|
+
|
|
15
|
+
## Current repo baseline
|
|
16
|
+
|
|
17
|
+
This visual direction should be applied through the existing semantic token system, not through one-off component styling.
|
|
18
|
+
The active token contract already includes surface, border, accent, feedback, shadow, radius, duration, easing, and interaction-motion tokens.
|
|
19
|
+
Legacy `S*` styling is not the visual standard for new primitive work.
|
|
20
|
+
|
|
21
|
+
## Benchmark energy
|
|
22
|
+
|
|
23
|
+
Aim closer to:
|
|
24
|
+
|
|
25
|
+
- Stripe-level restraint
|
|
26
|
+
- Vercel-level clarity
|
|
27
|
+
- HeroUI-level polish in component finish
|
|
28
|
+
|
|
29
|
+
Avoid:
|
|
30
|
+
|
|
31
|
+
- generic Tailwind demo aesthetics
|
|
32
|
+
- over-glassy or over-neumorphic effects
|
|
33
|
+
- heavy gradients as a default surface strategy
|
|
34
|
+
- toy-like radii and novelty motion
|
|
35
|
+
|
|
36
|
+
## Surface model
|
|
37
|
+
|
|
38
|
+
- canvas should feel quiet
|
|
39
|
+
- surfaces should separate subtly from the canvas
|
|
40
|
+
- interactive controls should read clearly from their container
|
|
41
|
+
- elevation should be visible but restrained
|
|
42
|
+
- borders should support structure without looking muddy
|
|
43
|
+
|
|
44
|
+
## Shape model
|
|
45
|
+
|
|
46
|
+
- controls should have consistent silhouette language
|
|
47
|
+
- radius should feel modern and deliberate
|
|
48
|
+
- default geometry should be rounded, not playful
|
|
49
|
+
|
|
50
|
+
## Motion model
|
|
51
|
+
|
|
52
|
+
- fast
|
|
53
|
+
- subtle
|
|
54
|
+
- purposeful
|
|
55
|
+
- no decorative bounce
|
|
56
|
+
- motion should support comprehension, not spectacle
|
|
57
|
+
|
|
58
|
+
## Content density
|
|
59
|
+
|
|
60
|
+
Default density should support real product work.
|
|
61
|
+
Not cramped, not oversized.
|
|
62
|
+
Aim for a professional app density that still feels breathable.
|
|
63
|
+
|
|
64
|
+
## Theme strategy
|
|
65
|
+
|
|
66
|
+
Multiple branded themes are a feature, but the system should still feel like one family.
|
|
67
|
+
Theme changes should alter mood, not break structural consistency.
|
|
68
|
+
The current default light/dark behavior comes from token remapping in the core token file, and future theme work should preserve that contract.
|