@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,186 @@
|
|
|
1
|
+
# ACCESSIBILITY_RULES
|
|
2
|
+
|
|
3
|
+
## Goal
|
|
4
|
+
|
|
5
|
+
Accessibility is a built-in requirement of the design system, not a later enhancement.
|
|
6
|
+
AI must treat accessibility as part of the primitive contract.
|
|
7
|
+
|
|
8
|
+
## Current repo baseline
|
|
9
|
+
|
|
10
|
+
The accessibility contract is ahead of the current primitive implementation.
|
|
11
|
+
|
|
12
|
+
- `Button` established the baseline for focus treatment in the current v2 primitive layer.
|
|
13
|
+
- `Accordion` is the canonical disclosure primitive in `src/primitives`, and several Ark-backed accessibility patterns also exist in legacy `src/components/S*` files as behavior reference only.
|
|
14
|
+
- Some existing primitives such as `SplitButton` predate the full contract in this document.
|
|
15
|
+
- Primitive `*.spec.md` files now exist for the active v2 surface, so future interactive primitive work must update them rather than assume documentation can lag behind behavior.
|
|
16
|
+
|
|
17
|
+
## Core principles
|
|
18
|
+
|
|
19
|
+
1. keyboard access must work without mouse interaction
|
|
20
|
+
2. focus visibility must be present and consistent
|
|
21
|
+
3. semantics must match the component role
|
|
22
|
+
4. ARIA must be correct, not decorative
|
|
23
|
+
5. disabled and invalid states must remain understandable
|
|
24
|
+
6. stateful behavior must be operable and perceivable
|
|
25
|
+
|
|
26
|
+
## Focus treatment
|
|
27
|
+
|
|
28
|
+
All interactive primitives must implement a consistent focus-visible style using system tokens.
|
|
29
|
+
|
|
30
|
+
Preferred pattern based on current repo tokens:
|
|
31
|
+
|
|
32
|
+
- `focus-visible:outline-none`
|
|
33
|
+
- `focus-visible:ring-2`
|
|
34
|
+
- `focus-visible:ring-[var(--ui-ring)]`
|
|
35
|
+
|
|
36
|
+
The exact ring width may vary if the system later defines a dedicated token, but the treatment must remain consistent across primitives.
|
|
37
|
+
|
|
38
|
+
## Native elements first
|
|
39
|
+
|
|
40
|
+
Use native semantics whenever practical.
|
|
41
|
+
|
|
42
|
+
Examples:
|
|
43
|
+
|
|
44
|
+
- use `<button>` for clickable button behavior
|
|
45
|
+
- use `<input>` for text entry
|
|
46
|
+
- use `<textarea>` for multiline text
|
|
47
|
+
- use `<label>` for labels
|
|
48
|
+
|
|
49
|
+
Do not replace native semantics with generic elements unless the component model truly requires it.
|
|
50
|
+
|
|
51
|
+
## Polymorphism caution
|
|
52
|
+
|
|
53
|
+
If a primitive supports `as` or similar polymorphism:
|
|
54
|
+
|
|
55
|
+
- ensure semantic responsibility stays correct
|
|
56
|
+
- do not allow broken combinations silently
|
|
57
|
+
- do not apply button-only attributes to links
|
|
58
|
+
- document expectations in the spec
|
|
59
|
+
|
|
60
|
+
## Disabled state
|
|
61
|
+
|
|
62
|
+
Disabled controls must:
|
|
63
|
+
|
|
64
|
+
- be visibly distinguishable
|
|
65
|
+
- not appear interactive
|
|
66
|
+
- not retain misleading hover behavior
|
|
67
|
+
- not trap focus unexpectedly
|
|
68
|
+
|
|
69
|
+
If a component uses a non-native disabled pattern, it must still communicate state through both semantics and styling.
|
|
70
|
+
|
|
71
|
+
## Invalid state
|
|
72
|
+
|
|
73
|
+
When a control supports invalid state:
|
|
74
|
+
|
|
75
|
+
- expose the state clearly in styling
|
|
76
|
+
- wire ARIA invalid semantics where appropriate
|
|
77
|
+
- ensure associated messages can be referenced where relevant
|
|
78
|
+
|
|
79
|
+
## Ark UI usage
|
|
80
|
+
|
|
81
|
+
Ark UI should be the default foundation for primitives with meaningful a11y/state complexity.
|
|
82
|
+
|
|
83
|
+
Use Ark UI for:
|
|
84
|
+
|
|
85
|
+
- Checkbox
|
|
86
|
+
- RadioGroup
|
|
87
|
+
- Switch
|
|
88
|
+
- Dialog
|
|
89
|
+
- Tooltip
|
|
90
|
+
- Popover
|
|
91
|
+
- Menu
|
|
92
|
+
- Tabs
|
|
93
|
+
- Select
|
|
94
|
+
- Combobox
|
|
95
|
+
- Accordion
|
|
96
|
+
|
|
97
|
+
When using Ark UI:
|
|
98
|
+
|
|
99
|
+
1. rely on its semantics rather than reimplementing them poorly
|
|
100
|
+
2. expose a clean system-level API on top
|
|
101
|
+
3. keep styling token-driven
|
|
102
|
+
4. document keyboard behavior in the spec
|
|
103
|
+
5. use legacy Ark-backed `S*` components for behavior reference only, not as implementation dependencies
|
|
104
|
+
|
|
105
|
+
## Keyboard expectations by primitive type
|
|
106
|
+
|
|
107
|
+
### Button-like
|
|
108
|
+
|
|
109
|
+
- Enter and Space should activate native buttons as expected
|
|
110
|
+
- focus-visible must be present
|
|
111
|
+
|
|
112
|
+
### Input-like
|
|
113
|
+
|
|
114
|
+
- labels should be connectable
|
|
115
|
+
- invalid and disabled state must remain clear
|
|
116
|
+
- placeholder must not be the only form of instruction
|
|
117
|
+
|
|
118
|
+
### Checkbox, RadioGroup, Switch
|
|
119
|
+
|
|
120
|
+
- keyboard interaction must match expected native or ARIA behavior
|
|
121
|
+
- labels must be clearly associated
|
|
122
|
+
- state change must be perceivable
|
|
123
|
+
|
|
124
|
+
### Dialog
|
|
125
|
+
|
|
126
|
+
- focus should move into the dialog on open
|
|
127
|
+
- focus should be constrained appropriately while open
|
|
128
|
+
- Escape behavior should be documented if supported
|
|
129
|
+
- returning focus on close should be handled correctly when possible
|
|
130
|
+
|
|
131
|
+
### Menu and Popover
|
|
132
|
+
|
|
133
|
+
- keyboard navigation must be coherent
|
|
134
|
+
- open and close behavior must be predictable
|
|
135
|
+
- menu items must have correct semantics
|
|
136
|
+
|
|
137
|
+
### Tabs
|
|
138
|
+
|
|
139
|
+
- tablist semantics must be correct
|
|
140
|
+
- active tab state must be exposed properly
|
|
141
|
+
- keyboard movement should follow expected conventions
|
|
142
|
+
|
|
143
|
+
## Icon-only controls
|
|
144
|
+
|
|
145
|
+
If a control is icon-only, it must have an accessible name.
|
|
146
|
+
This may come from:
|
|
147
|
+
|
|
148
|
+
- `aria-label`
|
|
149
|
+
- visually hidden text
|
|
150
|
+
- a clearly connected accessible label
|
|
151
|
+
|
|
152
|
+
Do not ship icon-only controls with no accessible name.
|
|
153
|
+
|
|
154
|
+
## Content and contrast
|
|
155
|
+
|
|
156
|
+
The design system should prefer token combinations that maintain sufficient contrast.
|
|
157
|
+
AI should avoid creating states that sacrifice readability for stylistic subtlety.
|
|
158
|
+
|
|
159
|
+
## Motion
|
|
160
|
+
|
|
161
|
+
Motion should support clarity and state change, not create confusion.
|
|
162
|
+
Avoid flashy or unnecessary animation in primitives.
|
|
163
|
+
|
|
164
|
+
## Spec requirement
|
|
165
|
+
|
|
166
|
+
Each interactive primitive spec should document:
|
|
167
|
+
|
|
168
|
+
- semantics used
|
|
169
|
+
- keyboard behavior
|
|
170
|
+
- focus behavior
|
|
171
|
+
- disabled behavior
|
|
172
|
+
- invalid behavior where relevant
|
|
173
|
+
- Ark UI dependency if present
|
|
174
|
+
|
|
175
|
+
Current repo note: interactive primitive changes should update the relevant spec file as part of the implementation work.
|
|
176
|
+
|
|
177
|
+
## Review checklist
|
|
178
|
+
|
|
179
|
+
Before merging an interactive primitive, confirm:
|
|
180
|
+
|
|
181
|
+
- can it be used by keyboard?
|
|
182
|
+
- does it have visible focus?
|
|
183
|
+
- are semantics correct?
|
|
184
|
+
- is ARIA meaningful rather than decorative?
|
|
185
|
+
- does disabled state behave correctly?
|
|
186
|
+
- is the behavior documented?
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
# AI_SYSTEM
|
|
2
|
+
|
|
3
|
+
## Mission
|
|
4
|
+
|
|
5
|
+
Build `ternent-ui` into a coherent, token-driven, multi-theme Vue design system that can be safely extended by AI without architectural or visual drift.
|
|
6
|
+
|
|
7
|
+
The system must allow Sam to operate primarily as reviewer, orchestrator, and approver rather than hands-on implementer.
|
|
8
|
+
|
|
9
|
+
## Repo model
|
|
10
|
+
|
|
11
|
+
Treat the codebase as three layers.
|
|
12
|
+
|
|
13
|
+
### 1. Legacy layer
|
|
14
|
+
|
|
15
|
+
`src/components/S*`
|
|
16
|
+
|
|
17
|
+
This is the old UI kit.
|
|
18
|
+
It may be used as behavior reference and migration reference only.
|
|
19
|
+
No new reusable UI should be added here.
|
|
20
|
+
Do not use legacy components as dependencies for new primitives.
|
|
21
|
+
Do not copy legacy APIs blindly.
|
|
22
|
+
|
|
23
|
+
### 2. Design-system core
|
|
24
|
+
|
|
25
|
+
`src/primitives/*`
|
|
26
|
+
|
|
27
|
+
This is the future-facing reusable UI surface.
|
|
28
|
+
All new reusable components must be built here.
|
|
29
|
+
This is the only layer that should be exported as the stable primitive API.
|
|
30
|
+
|
|
31
|
+
### 3. Composed patterns
|
|
32
|
+
|
|
33
|
+
`src/patterns/*`
|
|
34
|
+
|
|
35
|
+
This layer is for higher-level reusable compositions built from primitives.
|
|
36
|
+
It now exists in the repo and should be used deliberately for product-agnostic compositions.
|
|
37
|
+
Patterns are not low-level primitives.
|
|
38
|
+
Patterns may be opinionated but must remain product-agnostic.
|
|
39
|
+
|
|
40
|
+
## Current repo state
|
|
41
|
+
|
|
42
|
+
The v2 layer is not a clean slate yet.
|
|
43
|
+
|
|
44
|
+
- `src/primitives/Button/*` established the first canonical template and remains the baseline for future primitive structure.
|
|
45
|
+
- `src/primitives/Accordion/*` is the canonical disclosure primitive, while `Accordian/*` remains as compatibility debt during migration.
|
|
46
|
+
- `src/primitives/SplitButton/*` is exported today, but it is not yet documented by the current primitive contract.
|
|
47
|
+
- Primitive `*.spec.md` files now exist for the current v2 surface and should be updated alongside implementation changes.
|
|
48
|
+
- `src/primitives/index.ts` is the current public primitive export surface.
|
|
49
|
+
|
|
50
|
+
## Taxonomy
|
|
51
|
+
|
|
52
|
+
### Primitive
|
|
53
|
+
|
|
54
|
+
A primitive is:
|
|
55
|
+
|
|
56
|
+
- reusable across products
|
|
57
|
+
- token-driven
|
|
58
|
+
- not business-specific
|
|
59
|
+
- usually small or medium in scope
|
|
60
|
+
- safe for broad public export
|
|
61
|
+
- visually and behaviorally consistent with the system
|
|
62
|
+
|
|
63
|
+
Examples:
|
|
64
|
+
|
|
65
|
+
- Button
|
|
66
|
+
- Input
|
|
67
|
+
- Textarea
|
|
68
|
+
- Checkbox
|
|
69
|
+
- RadioGroup
|
|
70
|
+
- Switch
|
|
71
|
+
- Dialog
|
|
72
|
+
- Tooltip
|
|
73
|
+
- Popover
|
|
74
|
+
- Tabs
|
|
75
|
+
- Badge
|
|
76
|
+
- Card
|
|
77
|
+
- Spinner
|
|
78
|
+
- Skeleton
|
|
79
|
+
- Separator
|
|
80
|
+
|
|
81
|
+
### Pattern
|
|
82
|
+
|
|
83
|
+
A pattern is:
|
|
84
|
+
|
|
85
|
+
- composed from primitives
|
|
86
|
+
- opinionated in layout or grouping
|
|
87
|
+
- still product-agnostic
|
|
88
|
+
- not the lowest-level building block
|
|
89
|
+
|
|
90
|
+
Examples:
|
|
91
|
+
|
|
92
|
+
- FormField
|
|
93
|
+
- SearchField
|
|
94
|
+
- EmptyState
|
|
95
|
+
- FilterBar
|
|
96
|
+
- PageHeader
|
|
97
|
+
- SidebarNav
|
|
98
|
+
- AppShell
|
|
99
|
+
- CommandMenu
|
|
100
|
+
|
|
101
|
+
### App component
|
|
102
|
+
|
|
103
|
+
An app component is:
|
|
104
|
+
|
|
105
|
+
- business-specific
|
|
106
|
+
- domain-specific
|
|
107
|
+
- not part of the shared design-system core
|
|
108
|
+
|
|
109
|
+
Examples:
|
|
110
|
+
|
|
111
|
+
- PackRevealPanel
|
|
112
|
+
- LedgerAuditHeader
|
|
113
|
+
- ProjectStatusCard
|
|
114
|
+
|
|
115
|
+
App components must not be added to the design system package unless there is a clear shared-system reason.
|
|
116
|
+
|
|
117
|
+
## Non-negotiable rules
|
|
118
|
+
|
|
119
|
+
1. `src/primitives` is the only source for new reusable UI.
|
|
120
|
+
2. `src/components/S*` is legacy and must not be extended with new work.
|
|
121
|
+
3. New primitives must not depend on legacy `S*` components.
|
|
122
|
+
4. Product-specific logic must not enter `src/primitives`.
|
|
123
|
+
5. All reusable public exports must come from `src/primitives/index.ts` or `src/patterns/index.ts`.
|
|
124
|
+
6. All primitives must consume semantic design tokens only.
|
|
125
|
+
7. No raw Tailwind color utilities in primitives.
|
|
126
|
+
8. No arbitrary spacing, radius, or motion values unless first added to the system contract.
|
|
127
|
+
9. Theme support must come from token mapping, not per-component theme branching.
|
|
128
|
+
10. AI must favor consistency and composability over cleverness.
|
|
129
|
+
|
|
130
|
+
## Existing token reality
|
|
131
|
+
|
|
132
|
+
The current system already uses a token family such as:
|
|
133
|
+
|
|
134
|
+
- `--ui-bg`
|
|
135
|
+
- `--ui-fg`
|
|
136
|
+
- `--ui-fg-muted`
|
|
137
|
+
- `--ui-surface`
|
|
138
|
+
- `--ui-surface-hover`
|
|
139
|
+
- `--ui-border`
|
|
140
|
+
- `--ui-primary`
|
|
141
|
+
- `--ui-accent`
|
|
142
|
+
- `--ui-secondary`
|
|
143
|
+
- `--ui-critical`
|
|
144
|
+
- `--ui-success`
|
|
145
|
+
- `--ui-warning`
|
|
146
|
+
- `--ui-info`
|
|
147
|
+
- `--ui-tonal-secondary`
|
|
148
|
+
- `--ui-tonal-tertiary`
|
|
149
|
+
- `--ui-ring`
|
|
150
|
+
- `--ui-radius-md`
|
|
151
|
+
- `--ui-shadow-sm`
|
|
152
|
+
- `--ui-duration-normal`
|
|
153
|
+
- `--ui-lift-hover`
|
|
154
|
+
- `--ui-scale-active`
|
|
155
|
+
|
|
156
|
+
These are acceptable as the starting contract.
|
|
157
|
+
AI should prefer reusing and rationalizing these tokens before inventing new ones.
|
|
158
|
+
A broader semantic model can be introduced gradually, but migration should be deliberate.
|
|
159
|
+
The core token file also handles the default dark-mode remapping via `prefers-color-scheme`.
|
|
160
|
+
|
|
161
|
+
## Visual direction
|
|
162
|
+
|
|
163
|
+
Default design direction:
|
|
164
|
+
|
|
165
|
+
- premium but not luxurious
|
|
166
|
+
- technical but not sterile
|
|
167
|
+
- calm, restrained, and modern
|
|
168
|
+
- slightly soft geometry
|
|
169
|
+
- strong dark mode support
|
|
170
|
+
- subtle depth, not showy effects
|
|
171
|
+
- polished indie product energy
|
|
172
|
+
- close to modern product tooling, not generic Tailwind demo aesthetics
|
|
173
|
+
|
|
174
|
+
When making visual choices, prefer restraint over novelty.
|
|
175
|
+
|
|
176
|
+
## Styling rules
|
|
177
|
+
|
|
178
|
+
1. Use semantic tokens or existing system tokens only.
|
|
179
|
+
2. Never hard-code colors in primitives.
|
|
180
|
+
3. Prefer class composition in `*.variants.ts` rather than giant inline strings in the SFC.
|
|
181
|
+
4. Keep render templates small.
|
|
182
|
+
5. Keep spacing and sizing aligned to shared scale.
|
|
183
|
+
6. Use system radius tokens for silhouette consistency.
|
|
184
|
+
7. Use system motion tokens for transitions.
|
|
185
|
+
8. Focus treatment must be consistent across all interactive primitives.
|
|
186
|
+
|
|
187
|
+
## API rules
|
|
188
|
+
|
|
189
|
+
1. Prefer stable, small APIs.
|
|
190
|
+
2. Keep naming consistent across primitives.
|
|
191
|
+
3. Use `variant` consistently rather than inventing synonyms like `kind` or `appearance` unless absolutely required.
|
|
192
|
+
4. Use `size` consistently.
|
|
193
|
+
5. Use `disabled`, `invalid`, and `loading` consistently where relevant.
|
|
194
|
+
6. Prefer composition over one-off prop sprawl.
|
|
195
|
+
7. Support slots when they produce a cleaner API than multiple special props.
|
|
196
|
+
|
|
197
|
+
## File conventions
|
|
198
|
+
|
|
199
|
+
Each primitive should normally follow this structure:
|
|
200
|
+
|
|
201
|
+
```txt
|
|
202
|
+
Component/
|
|
203
|
+
Component.vue
|
|
204
|
+
Component.props.ts
|
|
205
|
+
Component.types.ts
|
|
206
|
+
Component.variants.ts
|
|
207
|
+
Component.spec.md
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
Responsibilities:
|
|
211
|
+
|
|
212
|
+
- `Component.vue`: rendering and small computed composition only
|
|
213
|
+
- `Component.props.ts`: prop definitions and defaults
|
|
214
|
+
- `Component.types.ts`: exported unions and helper types
|
|
215
|
+
- `Component.variants.ts`: size and variant maps, token-aware class composition
|
|
216
|
+
- `Component.spec.md`: purpose, anatomy, props, variants, states, accessibility, usage
|
|
217
|
+
|
|
218
|
+
## Ark UI policy
|
|
219
|
+
|
|
220
|
+
Use Ark UI when it solves real interaction and accessibility complexity.
|
|
221
|
+
|
|
222
|
+
Prefer Ark UI for:
|
|
223
|
+
|
|
224
|
+
- Accordion
|
|
225
|
+
- Checkbox
|
|
226
|
+
- RadioGroup
|
|
227
|
+
- Switch
|
|
228
|
+
- Dialog
|
|
229
|
+
- Popover
|
|
230
|
+
- Tooltip
|
|
231
|
+
- Menu
|
|
232
|
+
- Tabs
|
|
233
|
+
- Select
|
|
234
|
+
- Combobox
|
|
235
|
+
|
|
236
|
+
Do not force Ark UI for:
|
|
237
|
+
|
|
238
|
+
- Button
|
|
239
|
+
- Badge
|
|
240
|
+
- Card
|
|
241
|
+
- Spinner
|
|
242
|
+
- Skeleton
|
|
243
|
+
- Separator
|
|
244
|
+
- Avatar wrapper
|
|
245
|
+
|
|
246
|
+
## Required states for interactive primitives
|
|
247
|
+
|
|
248
|
+
Where relevant, primitives must define and visually support:
|
|
249
|
+
|
|
250
|
+
- default
|
|
251
|
+
- hover
|
|
252
|
+
- active
|
|
253
|
+
- focus-visible
|
|
254
|
+
- disabled
|
|
255
|
+
- invalid
|
|
256
|
+
- loading
|
|
257
|
+
- open or selected where relevant
|
|
258
|
+
|
|
259
|
+
## Forbidden AI behavior
|
|
260
|
+
|
|
261
|
+
AI must not:
|
|
262
|
+
|
|
263
|
+
- add new reusable UI under legacy `S*`
|
|
264
|
+
- use raw Tailwind color utilities in primitives
|
|
265
|
+
- invent arbitrary spacing or radius values ad hoc
|
|
266
|
+
- create one-off variants without documenting the reason
|
|
267
|
+
- bake theme differences into component logic when token mapping can solve it
|
|
268
|
+
- copy legacy APIs line for line without evaluating their suitability for v2
|
|
269
|
+
- place product-specific compositions into `src/primitives`
|
|
270
|
+
|
|
271
|
+
## Output expectations
|
|
272
|
+
|
|
273
|
+
When implementing or refactoring components, AI should:
|
|
274
|
+
|
|
275
|
+
- state assumptions clearly
|
|
276
|
+
- preserve good existing behavior when sensible
|
|
277
|
+
- improve structure without unnecessary abstraction
|
|
278
|
+
- keep code understandable for future agents
|
|
279
|
+
- update the relevant spec file
|
|
280
|
+
- update exports where appropriate
|
|
281
|
+
- avoid unrelated churn
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# PATTERN_RULES
|
|
2
|
+
|
|
3
|
+
## Goal
|
|
4
|
+
|
|
5
|
+
Patterns are reusable compositions built from primitives.
|
|
6
|
+
They provide common UI arrangements without turning the core primitive layer into an app-specific dumping ground.
|
|
7
|
+
|
|
8
|
+
## Current repo baseline
|
|
9
|
+
|
|
10
|
+
`src/patterns/*` now exists as an architectural layer for shared compositions.
|
|
11
|
+
`FormField` is the first established pattern and should be treated as the baseline for future pattern work.
|
|
12
|
+
|
|
13
|
+
## What belongs in `src/patterns`
|
|
14
|
+
|
|
15
|
+
Patterns should be:
|
|
16
|
+
|
|
17
|
+
- composed from existing primitives
|
|
18
|
+
- reusable across products or screens
|
|
19
|
+
- somewhat opinionated in structure
|
|
20
|
+
- still independent from business logic
|
|
21
|
+
|
|
22
|
+
Examples:
|
|
23
|
+
|
|
24
|
+
- FormField
|
|
25
|
+
- SearchField
|
|
26
|
+
- PageHeader
|
|
27
|
+
- EmptyState
|
|
28
|
+
- FilterBar
|
|
29
|
+
- SidebarNav
|
|
30
|
+
- AppShell
|
|
31
|
+
- CommandMenu
|
|
32
|
+
|
|
33
|
+
## What does not belong in `src/patterns`
|
|
34
|
+
|
|
35
|
+
Do not place business or domain-specific components here.
|
|
36
|
+
Examples of components that do not belong here:
|
|
37
|
+
|
|
38
|
+
- billing-specific cards
|
|
39
|
+
- product-only dashboard widgets
|
|
40
|
+
- card reveal flows
|
|
41
|
+
- domain-specific tables with business logic built in
|
|
42
|
+
|
|
43
|
+
## Pattern rules
|
|
44
|
+
|
|
45
|
+
1. patterns must be composed from primitives first
|
|
46
|
+
2. patterns may add layout and grouping opinion
|
|
47
|
+
3. patterns must still consume tokens, not raw visual values
|
|
48
|
+
4. patterns may not bypass primitive behavior or accessibility contracts
|
|
49
|
+
5. patterns should avoid owning business data transformations
|
|
50
|
+
|
|
51
|
+
## API guidance
|
|
52
|
+
|
|
53
|
+
Pattern APIs should remain relatively small.
|
|
54
|
+
Patterns should expose only the knobs that are likely to matter broadly.
|
|
55
|
+
If a pattern needs many highly product-specific switches, it is probably not a pattern.
|
|
56
|
+
|
|
57
|
+
## Typical pattern structure
|
|
58
|
+
|
|
59
|
+
```txt
|
|
60
|
+
Pattern/
|
|
61
|
+
Pattern.vue
|
|
62
|
+
Pattern.types.ts
|
|
63
|
+
Pattern.spec.md
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
A `Pattern.variants.ts` file is optional if the pattern has enough variant logic to justify it.
|
|
67
|
+
`src/patterns/index.ts` is part of the public pattern export surface and should be updated deliberately when new patterns are added.
|
|
68
|
+
|
|
69
|
+
## Relationship to app code
|
|
70
|
+
|
|
71
|
+
Applications should prefer using patterns where they fit.
|
|
72
|
+
If a product needs a highly specific composition, build that in the product app rather than force it into the shared package.
|
|
73
|
+
Legacy `S*` components may be inspected for composition ideas, but patterns must still be rebuilt from primitives rather than wrapped around legacy implementations.
|
|
74
|
+
|
|
75
|
+
## Review checklist
|
|
76
|
+
|
|
77
|
+
Before adding a pattern, confirm:
|
|
78
|
+
|
|
79
|
+
- is it composed from primitives?
|
|
80
|
+
- is it still product-agnostic?
|
|
81
|
+
- does it belong above primitives but below app code?
|
|
82
|
+
- is its API restrained?
|
|
83
|
+
- is it documented?
|