banhaten 0.1.1 → 0.1.3
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/README.md +86 -309
- package/banhaten.config.example.json +1 -1
- package/docs/design-system/README.md +11 -0
- package/docs/design-system/appearance-presets.md +184 -0
- package/docs/design-system/appearances/default.md +94 -0
- package/docs/design-system/appearances/rounded.md +95 -0
- package/docs/design-system/appearances/sharp.md +95 -0
- package/docs/design-system/component-showcase-consistency-report.md +217 -0
- package/docs/design-system/component-token-consistency-audit.md +163 -0
- package/docs/design-system/components/README.md +74 -0
- package/docs/design-system/components/accordion.md +51 -0
- package/docs/design-system/components/activity-feed.md +92 -0
- package/docs/design-system/components/alert-dialog.md +70 -0
- package/docs/design-system/components/alert.md +79 -0
- package/docs/design-system/components/aspect-ratio.md +44 -0
- package/docs/design-system/components/attribute.md +87 -0
- package/docs/design-system/components/autocomplete.md +74 -0
- package/docs/design-system/components/avatar.md +52 -0
- package/docs/design-system/components/badge.md +53 -0
- package/docs/design-system/components/banner.md +85 -0
- package/docs/design-system/components/breadcrumbs.md +174 -0
- package/docs/design-system/components/button-group.md +83 -0
- package/docs/design-system/components/button.md +77 -0
- package/docs/design-system/components/card.md +78 -0
- package/docs/design-system/components/carousel.md +44 -0
- package/docs/design-system/components/catalog-components.md +45 -0
- package/docs/design-system/components/chart.md +43 -0
- package/docs/design-system/components/checkbox.md +52 -0
- package/docs/design-system/components/collapsible.md +48 -0
- package/docs/design-system/components/command-bar.md +57 -0
- package/docs/design-system/components/command.md +60 -0
- package/docs/design-system/components/context-menu.md +44 -0
- package/docs/design-system/components/date-picker.md +77 -0
- package/docs/design-system/components/divider.md +101 -0
- package/docs/design-system/components/empty-state.md +55 -0
- package/docs/design-system/components/field.md +69 -0
- package/docs/design-system/components/file-upload.md +185 -0
- package/docs/design-system/components/hover-card.md +46 -0
- package/docs/design-system/components/icons.md +48 -0
- package/docs/design-system/components/input-group.md +56 -0
- package/docs/design-system/components/input-otp.md +55 -0
- package/docs/design-system/components/input.md +48 -0
- package/docs/design-system/components/kbd.md +44 -0
- package/docs/design-system/components/label.md +48 -0
- package/docs/design-system/components/menu.md +59 -0
- package/docs/design-system/components/menubar.md +45 -0
- package/docs/design-system/components/modal.md +98 -0
- package/docs/design-system/components/native-select.md +52 -0
- package/docs/design-system/components/navigation-menu.md +48 -0
- package/docs/design-system/components/onboarding-step-list-item.md +80 -0
- package/docs/design-system/components/page-header.md +84 -0
- package/docs/design-system/components/pagination.md +49 -0
- package/docs/design-system/components/popover.md +58 -0
- package/docs/design-system/components/progress-slider.md +48 -0
- package/docs/design-system/components/progress.md +75 -0
- package/docs/design-system/components/radio-card.md +49 -0
- package/docs/design-system/components/radio-group.md +55 -0
- package/docs/design-system/components/resizable.md +42 -0
- package/docs/design-system/components/scroll-area.md +45 -0
- package/docs/design-system/components/select.md +50 -0
- package/docs/design-system/components/sheet.md +65 -0
- package/docs/design-system/components/sidebar.md +68 -0
- package/docs/design-system/components/skeleton.md +73 -0
- package/docs/design-system/components/slideout.md +63 -0
- package/docs/design-system/components/slider.md +61 -0
- package/docs/design-system/components/social-button.md +47 -0
- package/docs/design-system/components/spinner.md +61 -0
- package/docs/design-system/components/steps.md +63 -0
- package/docs/design-system/components/table.md +397 -0
- package/docs/design-system/components/tabs.md +52 -0
- package/docs/design-system/components/tag.md +78 -0
- package/docs/design-system/components/textarea.md +48 -0
- package/docs/design-system/components/timeline.md +81 -0
- package/docs/design-system/components/toast.md +56 -0
- package/docs/design-system/components/toggle.md +79 -0
- package/docs/design-system/components/toolbar.md +85 -0
- package/docs/design-system/components/tooltip.md +90 -0
- package/docs/design-system/components/typography.md +18 -0
- package/docs/design-system/design-system-test-missing-items.md +368 -0
- package/docs/design-system/icons.md +69 -0
- package/docs/design-system/registry-and-cli.md +41 -0
- package/docs/design-system/tabs.md +53 -0
- package/docs/design-system/token-governance.md +38 -0
- package/package.json +83 -59
- package/registry/components/alert-dialog.tsx +297 -0
- package/registry/components/aspect-ratio.tsx +30 -0
- package/registry/components/autocomplete.tsx +637 -0
- package/registry/components/avatar.tsx +258 -22
- package/registry/components/badge.tsx +97 -35
- package/registry/components/carousel.tsx +234 -0
- package/registry/components/chart.tsx +170 -0
- package/registry/components/collapsible.tsx +69 -0
- package/registry/components/command.tsx +174 -0
- package/registry/components/context-menu.tsx +236 -0
- package/registry/components/date-picker-state.ts +253 -0
- package/registry/components/date-picker.tsx +116 -159
- package/registry/components/expanded/EmptyState.tsx +155 -0
- package/registry/components/expanded/PageHeader.tsx +1 -1
- package/registry/components/expanded/breadcrumbs.css +139 -139
- package/registry/components/expanded/catalogComponentsShowcase.css +83 -83
- package/registry/components/expanded/emptyState.css +111 -0
- package/registry/components/expanded/slideout.css +1 -0
- package/registry/components/expanded/steps.css +274 -274
- package/registry/components/expanded/table.css +1 -0
- package/registry/components/expanded/timeline.css +264 -264
- package/registry/components/field.tsx +230 -0
- package/registry/components/hover-card.tsx +48 -0
- package/registry/components/input-group.tsx +130 -0
- package/registry/components/input-otp.tsx +574 -0
- package/registry/components/input.tsx +22 -12
- package/registry/components/kbd.tsx +44 -0
- package/registry/components/label.tsx +78 -0
- package/registry/components/menu.tsx +373 -8
- package/registry/components/menubar.tsx +226 -0
- package/registry/components/modal.tsx +109 -76
- package/registry/components/native-select.tsx +205 -0
- package/registry/components/navigation-menu.tsx +171 -0
- package/registry/components/popover.tsx +840 -0
- package/registry/components/radio-group.tsx +1 -1
- package/registry/components/resizable.tsx +74 -0
- package/registry/components/scroll-area.tsx +67 -0
- package/registry/components/select.tsx +6 -4
- package/registry/components/sheet.tsx +305 -0
- package/registry/components/sidebar.tsx +352 -0
- package/registry/components/skeleton.css +57 -0
- package/registry/components/skeleton.tsx +482 -0
- package/registry/components/social-button.tsx +74 -10
- package/registry/components/spinner.tsx +79 -11
- package/registry/components/{expanded/tabs.css → tabs.css} +127 -106
- package/registry/components/tabs.tsx +242 -0
- package/registry/components/textarea.tsx +2 -2
- package/registry/components/toast.tsx +131 -0
- package/registry/components/tooltip.tsx +4 -0
- package/registry/examples/alert-dialog-demo.tsx +42 -0
- package/registry/examples/aspect-ratio-demo.tsx +11 -0
- package/registry/examples/autocomplete-demo.tsx +109 -0
- package/registry/examples/avatar-demo.tsx +102 -47
- package/registry/examples/badge-demo.tsx +16 -0
- package/registry/examples/carousel-demo.tsx +25 -0
- package/registry/examples/chart-demo.tsx +33 -0
- package/registry/examples/collapsible-demo.tsx +16 -0
- package/registry/examples/command-demo.tsx +42 -0
- package/registry/examples/context-menu-demo.tsx +29 -0
- package/registry/examples/expanded/command-bar-demo.tsx +236 -0
- package/registry/examples/expanded/empty-state-demo.tsx +39 -0
- package/registry/examples/expanded/tabs-demo.tsx +1 -1
- package/registry/examples/field-demo.tsx +51 -0
- package/registry/examples/hover-card-demo.tsx +23 -0
- package/registry/examples/input-demo.tsx +1 -1
- package/registry/examples/input-group-demo.tsx +16 -0
- package/registry/examples/input-otp-demo.tsx +72 -0
- package/registry/examples/kbd-demo.tsx +11 -0
- package/registry/examples/label-demo.tsx +20 -0
- package/registry/examples/menu-demo.tsx +101 -88
- package/registry/examples/menubar-demo.tsx +34 -0
- package/registry/examples/native-select-demo.tsx +16 -0
- package/registry/examples/navigation-menu-demo.tsx +29 -0
- package/registry/examples/popover-demo.tsx +546 -0
- package/registry/examples/resizable-demo.tsx +22 -0
- package/registry/examples/scroll-area-demo.tsx +15 -0
- package/registry/examples/select-demo.tsx +1 -1
- package/registry/examples/sheet-demo.tsx +47 -0
- package/registry/examples/sidebar-demo.tsx +55 -0
- package/registry/examples/skeleton-demo.tsx +56 -0
- package/registry/examples/spinner-demo.tsx +23 -1
- package/registry/examples/tabs-demo.tsx +13 -0
- package/registry/examples/textarea-demo.tsx +1 -1
- package/registry/examples/toast-demo.tsx +35 -0
- package/registry/index.json +895 -19
- package/registry/styles/globals.css +4733 -4602
- package/registry.json +1612 -0
- package/schema/config.schema.json +48 -0
- package/schema/registry.schema.json +85 -0
- package/schema/tokens.schema.json +63 -0
- package/src/cli/index.js +1413 -184
- package/tokens/banhaten.tokens.json +1 -1
- package/registry/assets/avatars/avatar-02.jpg +0 -0
- package/registry/assets/avatars/avatar-03.jpg +0 -0
- package/registry/assets/avatars/avatar-04.jpg +0 -0
- package/registry/assets/avatars/avatar-05.jpg +0 -0
- package/registry/assets/avatars/avatar-06.jpg +0 -0
- package/registry/assets/avatars/avatar-07.jpg +0 -0
- package/registry/assets/avatars/avatar-08.jpg +0 -0
- package/registry/assets/avatars/avatar-09.jpg +0 -0
- package/registry/assets/avatars/avatar-10.jpg +0 -0
- package/registry/assets/avatars/avatar-11.jpg +0 -0
- package/registry/assets/avatars/avatar-12.jpg +0 -0
- package/registry/assets/avatars/avatar-13.jpg +0 -0
- package/registry/assets/avatars/avatar-14.jpg +0 -0
- package/registry/assets/avatars/avatar-15.jpg +0 -0
- package/registry/assets/avatars/avatar-16.jpg +0 -0
- package/registry/assets/avatars/avatar-17.jpg +0 -0
- package/registry/assets/avatars/avatar-18.jpg +0 -0
- package/registry/assets/avatars/avatar-19.jpg +0 -0
- package/registry/assets/avatars/avatar-20.jpg +0 -0
- package/registry/assets/avatars/avatar-21.jpg +0 -0
- package/registry/assets/avatars/avatar-22.jpg +0 -0
- package/registry/assets/avatars/avatar-23.jpg +0 -0
- package/registry/assets/avatars/avatar-24.jpg +0 -0
- package/registry/assets/avatars/avatar-25.jpg +0 -0
- package/registry/assets/avatars/avatar-26.jpg +0 -0
- package/registry/assets/avatars/avatar-27.jpg +0 -0
- package/registry/assets/avatars/avatar-28.jpg +0 -0
- package/registry/assets/avatars/avatar-29.jpg +0 -0
- package/registry/assets/avatars/avatar-30.jpg +0 -0
- package/registry/assets/avatars/avatar-31.jpg +0 -0
- package/registry/assets/avatars/avatar-32.jpg +0 -0
- package/registry/assets/avatars/avatar-33.jpg +0 -0
- package/registry/assets/avatars/avatar-34.jpg +0 -0
- package/registry/assets/avatars/avatar-35.jpg +0 -0
- package/registry/assets/image-assets.json +0 -744
- package/registry/assets/images/art-02.jpg +0 -0
- package/registry/assets/images/art-03.jpg +0 -0
- package/registry/assets/images/art-04.jpg +0 -0
- package/registry/assets/images/art-05.jpg +0 -0
- package/registry/assets/images/art-06.jpg +0 -0
- package/registry/assets/images/art-07.jpg +0 -0
- package/registry/assets/images/art-08.jpg +0 -0
- package/registry/assets/images/art-09.jpg +0 -0
- package/registry/assets/images/art-10.jpg +0 -0
- package/registry/assets/images/art-11.jpg +0 -0
- package/registry/assets/images/art-12.jpg +0 -0
- package/registry/assets/images/art-13.jpg +0 -0
- package/registry/assets/images/art-14.jpg +0 -0
- package/registry/assets/images/art-15.jpg +0 -0
- package/registry/assets/images/art-16.jpg +0 -0
- package/registry/assets/images/art-17.jpg +0 -0
- package/registry/assets/images/art-18.jpg +0 -0
- package/registry/assets/images/art-19.jpg +0 -0
- package/registry/assets/images/art-20.jpg +0 -0
- package/registry/assets/images/art-21.jpg +0 -0
- package/registry/assets/images/art-22.jpg +0 -0
- package/registry/assets/images/art-23.jpg +0 -0
- package/registry/assets/images/art-24.jpg +0 -0
- package/registry/assets/images/art-25.jpg +0 -0
- package/registry/assets/images/art-26.jpg +0 -0
- package/registry/assets/images/art-27.jpg +0 -0
- package/registry/assets/images/nature-01.jpg +0 -0
- package/registry/assets/images/nature-02.jpg +0 -0
- package/registry/assets/images/nature-03.jpg +0 -0
- package/registry/assets/images/nature-04.jpg +0 -0
- package/registry/assets/images/nature-05.jpg +0 -0
- package/registry/assets/images/nature-06.jpg +0 -0
- package/registry/assets/images/nature-07.jpg +0 -0
- package/registry/assets/images/nature-08.jpg +0 -0
- package/registry/assets/images/nature-09.jpg +0 -0
- package/registry/assets/images/nature-10.jpg +0 -0
- package/registry/assets/images/nature-11.jpg +0 -0
- package/registry/assets/images/nature-12.jpg +0 -0
- package/registry/assets/images/nature-13.jpg +0 -0
- package/registry/assets/images/nature-14.jpg +0 -0
- package/registry/assets/images/nature-15.jpg +0 -0
- package/registry/assets/images/nature-16.jpg +0 -0
- package/registry/assets/images/nature-17.jpg +0 -0
- package/registry/assets/images/nature-18.jpg +0 -0
- package/registry/assets/images/nature-19.jpg +0 -0
- package/registry/assets/images/nature-20.jpg +0 -0
- package/registry/components/expanded/Tabs.tsx +0 -86
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# Default Appearance
|
|
2
|
+
|
|
3
|
+
`default` is the baseline product appearance.
|
|
4
|
+
|
|
5
|
+
It should feel practical, calm, and balanced: a gray application background, white cards, modest radius, restrained elevation, and conservative spacing.
|
|
6
|
+
|
|
7
|
+
## Visual Character
|
|
8
|
+
|
|
9
|
+
- Application background is gray or off-white.
|
|
10
|
+
- Cards and primary content areas are white.
|
|
11
|
+
- Actions and controls have a modest radius.
|
|
12
|
+
- Spacing is comfortable but compact enough for daily product use.
|
|
13
|
+
- Shadows are subtle and used only to separate floating or raised elements.
|
|
14
|
+
|
|
15
|
+
## Token Direction
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
export const defaultAppearance = {
|
|
19
|
+
content: {
|
|
20
|
+
default: "#171717",
|
|
21
|
+
primary: "#000000",
|
|
22
|
+
subtle: "#404040",
|
|
23
|
+
muted: "#737373",
|
|
24
|
+
disabled: "#a3a3a3",
|
|
25
|
+
inverse: "#ffffff",
|
|
26
|
+
link: "#1d4ed8",
|
|
27
|
+
linkHover: "#1e40af",
|
|
28
|
+
onColor: "#ffffff",
|
|
29
|
+
onLight: "#171717",
|
|
30
|
+
onBrand: "#ffffff",
|
|
31
|
+
},
|
|
32
|
+
background: {
|
|
33
|
+
app: "#f4f4f5",
|
|
34
|
+
default: "#ffffff",
|
|
35
|
+
card: "#ffffff",
|
|
36
|
+
subtle: "#fafafa",
|
|
37
|
+
muted: "#f5f5f5",
|
|
38
|
+
disabled: "#e5e5e5",
|
|
39
|
+
inverse: "#171717",
|
|
40
|
+
overlay: "rgba(23, 23, 23, 0.48)",
|
|
41
|
+
brand: "#171717",
|
|
42
|
+
brandHover: "#262626",
|
|
43
|
+
brandPressed: "#0a0a0a",
|
|
44
|
+
selected: "#e5e7eb",
|
|
45
|
+
hover: "#f5f5f5",
|
|
46
|
+
pressed: "#e5e5e5",
|
|
47
|
+
},
|
|
48
|
+
border: {
|
|
49
|
+
default: "#d4d4d4",
|
|
50
|
+
subtle: "#e5e5e5",
|
|
51
|
+
strong: "#a3a3a3",
|
|
52
|
+
disabled: "#e5e5e5",
|
|
53
|
+
focus: "#2563eb",
|
|
54
|
+
brand: "#171717",
|
|
55
|
+
},
|
|
56
|
+
shape: {
|
|
57
|
+
action: "10px",
|
|
58
|
+
control: "10px",
|
|
59
|
+
card: "12px",
|
|
60
|
+
panel: "12px",
|
|
61
|
+
modal: "16px",
|
|
62
|
+
popover: "12px",
|
|
63
|
+
badge: "999px",
|
|
64
|
+
avatar: "999px",
|
|
65
|
+
},
|
|
66
|
+
density: {
|
|
67
|
+
controlHeight: "40px",
|
|
68
|
+
controlPaddingX: "14px",
|
|
69
|
+
cardPadding: "20px",
|
|
70
|
+
panelPadding: "20px",
|
|
71
|
+
sectionGap: "24px",
|
|
72
|
+
listRowHeight: "44px",
|
|
73
|
+
tableRowHeight: "44px",
|
|
74
|
+
},
|
|
75
|
+
elevation: {
|
|
76
|
+
card: "0 1px 2px rgba(0, 0, 0, 0.04)",
|
|
77
|
+
panel: "0 1px 3px rgba(0, 0, 0, 0.06)",
|
|
78
|
+
popover: "0 12px 28px rgba(0, 0, 0, 0.14)",
|
|
79
|
+
modal: "0 24px 64px rgba(0, 0, 0, 0.20)",
|
|
80
|
+
none: "none",
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Component Impact
|
|
86
|
+
|
|
87
|
+
- Buttons: modest radius, dark primary action, balanced padding.
|
|
88
|
+
- Breadcrumbs: inline trails stay quiet; raised trails use `background.card`, `border.subtle`, and the modest control radius.
|
|
89
|
+
- Inputs: modest radius, visible but quiet border.
|
|
90
|
+
- Cards: white on gray app background, subtle border or shadow.
|
|
91
|
+
- Dividers: quiet 1px separators using `border.subtle`, with compact spacing around labels or inline actions.
|
|
92
|
+
- File uploads: subtle dashed drop zones with white queued rows, modest radius, and quiet row elevation.
|
|
93
|
+
- Modals and popovers: slightly more radius than inline components.
|
|
94
|
+
- Tables and lists: normal row height for readable operational screens.
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# Rounded Appearance
|
|
2
|
+
|
|
3
|
+
`rounded` is the softer appearance.
|
|
4
|
+
|
|
5
|
+
It should feel open, approachable, and more polished: a white application background, larger radii, softer borders, relaxed spacing, and less visual heaviness.
|
|
6
|
+
|
|
7
|
+
## Visual Character
|
|
8
|
+
|
|
9
|
+
- Application background is white.
|
|
10
|
+
- Cards use white or near-white backgrounds with light borders.
|
|
11
|
+
- Primary actions can be pill-shaped.
|
|
12
|
+
- Panels and cards have visibly larger radius.
|
|
13
|
+
- Spacing is a little more relaxed than `default`.
|
|
14
|
+
- Shadows are soft and optional.
|
|
15
|
+
|
|
16
|
+
## Token Direction
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
export const roundedAppearance = {
|
|
20
|
+
content: {
|
|
21
|
+
default: "#18181b",
|
|
22
|
+
primary: "#09090b",
|
|
23
|
+
subtle: "#52525b",
|
|
24
|
+
muted: "#71717a",
|
|
25
|
+
disabled: "#a1a1aa",
|
|
26
|
+
inverse: "#ffffff",
|
|
27
|
+
link: "#0f766e",
|
|
28
|
+
linkHover: "#115e59",
|
|
29
|
+
onColor: "#ffffff",
|
|
30
|
+
onLight: "#18181b",
|
|
31
|
+
onBrand: "#ffffff",
|
|
32
|
+
},
|
|
33
|
+
background: {
|
|
34
|
+
app: "#ffffff",
|
|
35
|
+
default: "#ffffff",
|
|
36
|
+
card: "#ffffff",
|
|
37
|
+
subtle: "#fafafa",
|
|
38
|
+
muted: "#f6f7f7",
|
|
39
|
+
disabled: "#e4e4e7",
|
|
40
|
+
inverse: "#18181b",
|
|
41
|
+
overlay: "rgba(24, 24, 27, 0.42)",
|
|
42
|
+
brand: "#0f766e",
|
|
43
|
+
brandHover: "#115e59",
|
|
44
|
+
brandPressed: "#134e4a",
|
|
45
|
+
selected: "#ccfbf1",
|
|
46
|
+
hover: "#f4f7f6",
|
|
47
|
+
pressed: "#e7f3f0",
|
|
48
|
+
},
|
|
49
|
+
border: {
|
|
50
|
+
default: "#dedede",
|
|
51
|
+
subtle: "#eeeeee",
|
|
52
|
+
strong: "#b8b8b8",
|
|
53
|
+
disabled: "#e4e4e7",
|
|
54
|
+
focus: "#0f766e",
|
|
55
|
+
brand: "#0f766e",
|
|
56
|
+
},
|
|
57
|
+
shape: {
|
|
58
|
+
action: "999px",
|
|
59
|
+
control: "16px",
|
|
60
|
+
card: "22px",
|
|
61
|
+
panel: "24px",
|
|
62
|
+
modal: "28px",
|
|
63
|
+
popover: "20px",
|
|
64
|
+
badge: "999px",
|
|
65
|
+
avatar: "999px",
|
|
66
|
+
},
|
|
67
|
+
density: {
|
|
68
|
+
controlHeight: "44px",
|
|
69
|
+
controlPaddingX: "18px",
|
|
70
|
+
cardPadding: "24px",
|
|
71
|
+
panelPadding: "24px",
|
|
72
|
+
sectionGap: "32px",
|
|
73
|
+
listRowHeight: "48px",
|
|
74
|
+
tableRowHeight: "48px",
|
|
75
|
+
},
|
|
76
|
+
elevation: {
|
|
77
|
+
card: "0 8px 24px rgba(15, 23, 42, 0.06)",
|
|
78
|
+
panel: "0 10px 32px rgba(15, 23, 42, 0.08)",
|
|
79
|
+
popover: "0 18px 40px rgba(15, 23, 42, 0.16)",
|
|
80
|
+
modal: "0 28px 72px rgba(15, 23, 42, 0.22)",
|
|
81
|
+
none: "none",
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Component Impact
|
|
87
|
+
|
|
88
|
+
- Buttons: pill-like primary and action buttons.
|
|
89
|
+
- Breadcrumbs: raised trails inherit the softer control radius and can use slightly more relaxed spacing.
|
|
90
|
+
- Inputs: rounded controls with slightly taller height.
|
|
91
|
+
- Cards: larger radius with light borders and soft separation.
|
|
92
|
+
- Dividers: quiet 1px separators using `border.subtle`, with softer action backgrounds and the preset control radius.
|
|
93
|
+
- File uploads: softer drop zones and queued rows, relaxed padding, and gentle borders.
|
|
94
|
+
- Modals and popovers: rounded, friendly containers.
|
|
95
|
+
- Tables and lists: slightly more vertical breathing room.
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# Sharp Appearance
|
|
2
|
+
|
|
3
|
+
`sharp` is the precise appearance.
|
|
4
|
+
|
|
5
|
+
It should feel structured, architectural, and efficient: square edges, tighter spacing, stronger borders, flatter surfaces, and minimal elevation.
|
|
6
|
+
|
|
7
|
+
## Visual Character
|
|
8
|
+
|
|
9
|
+
- Application background can be white or a very light gray.
|
|
10
|
+
- Cards are flat panels with clear borders.
|
|
11
|
+
- Radius is zero or nearly zero across most UI.
|
|
12
|
+
- Spacing is tighter than `default`.
|
|
13
|
+
- Borders carry most of the separation work.
|
|
14
|
+
- Shadows are reserved for overlays only.
|
|
15
|
+
|
|
16
|
+
## Token Direction
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
export const sharpAppearance = {
|
|
20
|
+
content: {
|
|
21
|
+
default: "#111111",
|
|
22
|
+
primary: "#000000",
|
|
23
|
+
subtle: "#3f3f46",
|
|
24
|
+
muted: "#6b7280",
|
|
25
|
+
disabled: "#9ca3af",
|
|
26
|
+
inverse: "#ffffff",
|
|
27
|
+
link: "#7c2d12",
|
|
28
|
+
linkHover: "#431407",
|
|
29
|
+
onColor: "#ffffff",
|
|
30
|
+
onLight: "#111111",
|
|
31
|
+
onBrand: "#ffffff",
|
|
32
|
+
},
|
|
33
|
+
background: {
|
|
34
|
+
app: "#f7f7f7",
|
|
35
|
+
default: "#ffffff",
|
|
36
|
+
card: "#ffffff",
|
|
37
|
+
subtle: "#f9fafb",
|
|
38
|
+
muted: "#f3f4f6",
|
|
39
|
+
disabled: "#e5e7eb",
|
|
40
|
+
inverse: "#111111",
|
|
41
|
+
overlay: "rgba(17, 17, 17, 0.52)",
|
|
42
|
+
brand: "#111111",
|
|
43
|
+
brandHover: "#262626",
|
|
44
|
+
brandPressed: "#000000",
|
|
45
|
+
selected: "#e5e7eb",
|
|
46
|
+
hover: "#f3f4f6",
|
|
47
|
+
pressed: "#e5e7eb",
|
|
48
|
+
},
|
|
49
|
+
border: {
|
|
50
|
+
default: "#c7c7c7",
|
|
51
|
+
subtle: "#dedede",
|
|
52
|
+
strong: "#737373",
|
|
53
|
+
disabled: "#dedede",
|
|
54
|
+
focus: "#111111",
|
|
55
|
+
brand: "#111111",
|
|
56
|
+
},
|
|
57
|
+
shape: {
|
|
58
|
+
action: "0px",
|
|
59
|
+
control: "0px",
|
|
60
|
+
card: "0px",
|
|
61
|
+
panel: "0px",
|
|
62
|
+
modal: "0px",
|
|
63
|
+
popover: "0px",
|
|
64
|
+
badge: "2px",
|
|
65
|
+
avatar: "0px",
|
|
66
|
+
},
|
|
67
|
+
density: {
|
|
68
|
+
controlHeight: "38px",
|
|
69
|
+
controlPaddingX: "12px",
|
|
70
|
+
cardPadding: "16px",
|
|
71
|
+
panelPadding: "16px",
|
|
72
|
+
sectionGap: "20px",
|
|
73
|
+
listRowHeight: "40px",
|
|
74
|
+
tableRowHeight: "38px",
|
|
75
|
+
},
|
|
76
|
+
elevation: {
|
|
77
|
+
card: "none",
|
|
78
|
+
panel: "none",
|
|
79
|
+
popover: "0 12px 24px rgba(0, 0, 0, 0.18)",
|
|
80
|
+
modal: "0 20px 56px rgba(0, 0, 0, 0.24)",
|
|
81
|
+
none: "none",
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Component Impact
|
|
87
|
+
|
|
88
|
+
- Buttons: square edges, compact padding, strong hover and pressed states.
|
|
89
|
+
- Breadcrumbs: raised trails use square or near-square corners with tight separator rhythm.
|
|
90
|
+
- Inputs: square controls with clear border states.
|
|
91
|
+
- Cards: flat panels with borders instead of visible rounding.
|
|
92
|
+
- Dividers: clear 1px separators using `border.subtle`, with square action treatment and tight spacing.
|
|
93
|
+
- File uploads: precise dashed drop zones, square queued rows, tighter spacing, and border-led error states.
|
|
94
|
+
- Modals and popovers: square containers with overlay separation.
|
|
95
|
+
- Tables and lists: denser rows for scanning and comparison.
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
# Component Showcase Consistency Report
|
|
2
|
+
|
|
3
|
+
Date: 2026-06-16
|
|
4
|
+
|
|
5
|
+
## Purpose
|
|
6
|
+
|
|
7
|
+
This report audits how registry-backed Banhaten components are presented across the playground and docs. The immediate question was whether `Button` is the most complete example and whether the rest of the components should be made consistent with it.
|
|
8
|
+
|
|
9
|
+
## Short Answer
|
|
10
|
+
|
|
11
|
+
`Button` is the strongest content baseline, but it is not ready to be copied as the implementation template.
|
|
12
|
+
|
|
13
|
+
Use `Button` as the reference for what a complete component page should explain: install, usage, examples, composition, API, RTL, states, variants, sizes, and token/effect readouts. Use the shared `RegistryComponentDocs` renderer as the scalable page skeleton, then attach optional deep reference sections when the component needs visual matrices, state grids, size scales, or token readouts.
|
|
14
|
+
|
|
15
|
+
## Checks Run
|
|
16
|
+
|
|
17
|
+
- `npm exec -- tsc -p tsconfig.json --noEmit` from `playground` passed.
|
|
18
|
+
- `npm --prefix playground run test:docs` passed.
|
|
19
|
+
- Component docs coverage audit passed for 41 registry-backed pages.
|
|
20
|
+
- `catalog-components` is intentionally covered as a registry bundle alias.
|
|
21
|
+
- `npm run registry:check` passed.
|
|
22
|
+
- Registry mirrors and expanded ownership match across 149 files.
|
|
23
|
+
|
|
24
|
+
## Current Inventory
|
|
25
|
+
|
|
26
|
+
- Registry items: 42 total.
|
|
27
|
+
- Core items: 28.
|
|
28
|
+
- Expanded items: 14.
|
|
29
|
+
- Playground pages: 41 registry-backed pages plus 1 bundle-only registry item.
|
|
30
|
+
- Pages using shared `RegistryComponentDocs`: 32.
|
|
31
|
+
- Interactive inspector sections rendered on component pages: 0. The previous custom inspector panels and shared inspector helper were removed from the playground.
|
|
32
|
+
- Bespoke pages with hand-authored docs navigation: 9.
|
|
33
|
+
- Components with markdown docs in `docs/design-system/components` or known top-level docs: 27 of 42.
|
|
34
|
+
- Components with registry RTL metadata: 27 of 42.
|
|
35
|
+
|
|
36
|
+
## Recommended Standard
|
|
37
|
+
|
|
38
|
+
Every public component page should use this consistent pattern:
|
|
39
|
+
|
|
40
|
+
1. Page header with short component purpose.
|
|
41
|
+
2. Above-the-fold live preview:
|
|
42
|
+
- Small title and concise subtitle.
|
|
43
|
+
- The real component visible immediately without scrolling past long prose.
|
|
44
|
+
- A vertical stack of example cards so wide components, such as tables, do not get squeezed into a two-column preview.
|
|
45
|
+
- English/LTR example first, then Arabic/RTL directly below it for every component where direction, copy, icon placement, or layout can change.
|
|
46
|
+
3. Shared registry docs:
|
|
47
|
+
- Preview
|
|
48
|
+
- Installation
|
|
49
|
+
- Usage
|
|
50
|
+
- Examples
|
|
51
|
+
- Composition
|
|
52
|
+
- API Reference
|
|
53
|
+
- RTL Behavior
|
|
54
|
+
- Live Variants
|
|
55
|
+
4. Visual reference, state matrix, size scale, placement matrix, or token reference rendered from live components when deeper inspection is useful.
|
|
56
|
+
5. No interactive inspector section in the component page body.
|
|
57
|
+
6. Registry metadata that matches the real source, example, and playground spec.
|
|
58
|
+
7. Markdown docs linked from the component docs index when the component is public.
|
|
59
|
+
8. Tests that catch missing docs routes, registry mirror drift, and obvious source/metadata drift.
|
|
60
|
+
|
|
61
|
+
## Button Baseline Audit
|
|
62
|
+
|
|
63
|
+
### What Button Does Well
|
|
64
|
+
|
|
65
|
+
`Button` is currently the most complete component page by depth. It has:
|
|
66
|
+
|
|
67
|
+
- Installation, usage, example, composition, API, RTL, visual reference, size scale, state matrix, and shadow reference sections.
|
|
68
|
+
- Rich examples for variants, sizes, icons, loading, `asChild`, and RTL.
|
|
69
|
+
- Token readouts for fill, text, stroke, effects, geometry, and typography.
|
|
70
|
+
- Registry demo coverage for variants, text sizes, icon sizes, icon placement, loading, and RTL.
|
|
71
|
+
|
|
72
|
+
### What Button Is Missing Or Inconsistent
|
|
73
|
+
|
|
74
|
+
- Registry size metadata now matches the implementation and examples, including `xl` and `icon-xl`.
|
|
75
|
+
- Source supports compatibility variants that are not part of the visible registry contract: `destructive`, `soft-destructive`, `success`, `warning`, and `link`. Decide whether these are public aliases, deprecated aliases, or should be removed.
|
|
76
|
+
- Button now has a component markdown page and is listed in the component docs index.
|
|
77
|
+
- The interactive inspector has been removed from the Button page, matching the new page direction.
|
|
78
|
+
- The page is a high-quality bespoke file rather than a scalable shared template. Copying it component by component would increase drift.
|
|
79
|
+
- Test coverage only smoke-renders a basic Button. It does not assert the variant/size contract, `asChild`, loading composition, icon sizing, or source/metadata parity.
|
|
80
|
+
|
|
81
|
+
### Verdict
|
|
82
|
+
|
|
83
|
+
Button should be the content-quality model, not the code-shape model. Its opening preview, registry size metadata, and component markdown docs now match the proposed standard. The remaining work is the source-supported alias policy and a metadata parity check.
|
|
84
|
+
|
|
85
|
+
## Presentation Families
|
|
86
|
+
|
|
87
|
+
| Family | Components | Current read |
|
|
88
|
+
| --- | --- | --- |
|
|
89
|
+
| Bespoke rich docs plus deep reference | Button, Attribute, Card, Toggle, Modal, Toolbar, Slider, Progress, Alert | Most complete editorially, but highest drift risk because docs are hand-authored per page. Inspector sections should stay removed. |
|
|
90
|
+
| Shared registry docs plus live reference examples | Accordion, Avatar, Badge, Button Group, Checkbox, Date Picker, Divider, Input, Menu, Pagination, Progress Slider, Radio Card, Radio Group, Select, Social Button, Tag, Textarea | Best scalable direction. These already get consistent docs structure from the shared renderer and should add early examples where missing. |
|
|
91
|
+
| Shared registry docs plus expanded custom page | Activity Feed, Banner, Breadcrumbs, Command Bar, File Upload, Onboarding Step, Page Header, Slideout, Steps, Table, Tabs, Timeline | Consistent shell, but registry metadata is under-specified for capabilities and RTL. Expanded/core contract needs a decision. |
|
|
92
|
+
| Shared docs only or custom examples | Tooltip, Spinner, Icons | Acceptable for Spinner and maybe Icons. Tooltip should keep a placement/pointer matrix rather than an inspector. |
|
|
93
|
+
| Bundle-only registry item | Catalog Components | No direct playground page. This is fine if it remains an internal bundle alias; otherwise it needs a public docs page or should be marked as non-public. |
|
|
94
|
+
|
|
95
|
+
## Component-by-Component Status
|
|
96
|
+
|
|
97
|
+
| Component | Status | Current presentation | Recommendation |
|
|
98
|
+
| --- | --- | --- | --- |
|
|
99
|
+
| Accordion | Core | Shared docs plus live reference | Keep template. Add markdown docs if public. |
|
|
100
|
+
| Activity Feed | Expanded | Shared docs plus expanded custom page | Add registry capability and RTL metadata. Decide whether it is production or showcase. |
|
|
101
|
+
| Alert | Core | Bespoke rich docs plus deep reference | Strong page. Migrate structure into shared standard or extract page data. |
|
|
102
|
+
| Attribute | Core | Bespoke rich docs plus deep reference | Strong page. Migrate to shared standard; keep detailed slot/composition examples. |
|
|
103
|
+
| Avatar | Core | Shared docs plus live reference | Keep template. Add markdown docs if public. |
|
|
104
|
+
| Badge | Core | Shared docs plus live reference | Keep template. Add markdown docs if public. |
|
|
105
|
+
| Banner | Expanded | Shared docs plus expanded custom page | Add capability and RTL metadata. Promotion candidate for feedback components. |
|
|
106
|
+
| Breadcrumbs | Expanded | Shared docs plus expanded custom page | Add capability and RTL metadata. Promotion candidate with Page Header. |
|
|
107
|
+
| Button | Core | Bespoke baseline | Treat as content baseline. Keep the new above-the-fold examples; resolve variant alias policy and parity tests. |
|
|
108
|
+
| Button Group | Core | Shared docs plus live reference | Good scalable page. Already has markdown docs. |
|
|
109
|
+
| Card | Core | Bespoke rich docs plus deep reference | Strong page. Migrate to shared standard; preserve image/layout coverage. |
|
|
110
|
+
| Checkbox | Core | Shared docs plus live reference | Keep template. Add markdown docs if public. |
|
|
111
|
+
| Command Bar | Expanded | Shared docs plus expanded custom page | Add capability and RTL metadata. Clarify keyboard/search contract before promotion. |
|
|
112
|
+
| Date Picker | Core | Shared docs plus live reference | Good scalable page. Keep as shared-docs example for complex form components. |
|
|
113
|
+
| Divider | Core | Shared docs plus live reference | Good. Simple component can keep a lighter visual reference. |
|
|
114
|
+
| File Upload | Expanded | Shared docs plus expanded custom page | Add accessibility/error/queue contract before core promotion. |
|
|
115
|
+
| Icons | Expanded/foundation | Shared docs/explorer only | Treat as foundation tooling, not a normal component. Keep top-level docs or move into components index intentionally. |
|
|
116
|
+
| Input | Core | Shared docs plus live reference | Keep template. Add markdown docs if public. |
|
|
117
|
+
| Menu | Core | Shared docs plus live reference | Keep template. Add markdown docs if public. Confirm trigger/anchoring expectations. |
|
|
118
|
+
| Modal | Core | Bespoke rich docs plus deep reference | Strong page. Migrate to shared standard; preserve ConfirmModal guardrail docs. |
|
|
119
|
+
| Onboarding Step | Expanded | Shared docs plus expanded custom page | Add capability and RTL metadata. Rename docs/page consistently around `onboarding-step` vs `onboarding-step-list-item`. |
|
|
120
|
+
| Page Header | Expanded | Shared docs plus expanded custom page | Add capability and RTL metadata. Likely app composition pattern, not primitive. |
|
|
121
|
+
| Pagination | Core | Shared docs plus live reference | Keep template. Add markdown docs if public. |
|
|
122
|
+
| Progress | Core | Bespoke rich docs plus deep reference | Strong page. Migrate to shared standard; preserve label/RTL fill coverage. |
|
|
123
|
+
| Progress Slider | Core | Shared docs plus live reference | Keep template. Add markdown docs if public. |
|
|
124
|
+
| Radio Card | Core | Shared docs plus live reference | Keep template. Add markdown docs if public. Clarify explicit RTL behavior in docs. |
|
|
125
|
+
| Radio Group | Core | Shared docs plus live reference | Keep template. Add markdown docs if public. |
|
|
126
|
+
| Select | Core | Shared docs plus live reference | Keep template. Add markdown docs if public. Good candidate for metadata parity tests because it has many item types. |
|
|
127
|
+
| Slideout | Expanded | Shared docs plus expanded custom page | Add focus/portal/mobile contract before core promotion. |
|
|
128
|
+
| Slider | Core | Bespoke rich docs plus deep reference | Strong page. Migrate to shared standard; preserve value mode and indicator examples. |
|
|
129
|
+
| Social Button | Core | Shared docs plus live reference | Keep template. Add markdown docs if public and document provider-color exceptions. |
|
|
130
|
+
| Spinner | Core | Shared docs only | Probably acceptable as a simple primitive. Add markdown docs or explicitly mark as helper primitive. |
|
|
131
|
+
| Steps | Expanded | Shared docs plus expanded custom page | Add capability and RTL metadata. Promotion candidate. |
|
|
132
|
+
| Table | Expanded | Shared docs plus expanded custom page | Add capability and RTL metadata. Clarify Table vs DataTable public contract. |
|
|
133
|
+
| Tabs | Expanded | Shared docs plus expanded custom page | Move or link top-level `docs/design-system/tabs.md` from the component index. Promotion candidate. |
|
|
134
|
+
| Tag | Core | Shared docs plus live reference | Good scalable page. Already has markdown docs. |
|
|
135
|
+
| Textarea | Core | Shared docs plus live reference | Keep template. Add markdown docs if public. |
|
|
136
|
+
| Timeline | Expanded | Shared docs plus expanded custom page | Add capability and RTL metadata. Clarify event/progress variants before promotion. |
|
|
137
|
+
| Toggle | Core | Bespoke rich docs plus deep reference | Strong page. Migrate to shared standard; preserve labeled field composition. |
|
|
138
|
+
| Toolbar | Core | Bespoke rich docs plus deep reference | Strong page. Migrate to shared standard; preserve responsive/filter examples. |
|
|
139
|
+
| Tooltip | Core | Shared docs plus custom pointer examples | Keep the placement matrix as the equivalent deep reference. Already has markdown docs. |
|
|
140
|
+
| Catalog Components | Expanded bundle | No playground page | Mark private/bundle-only, keep alias coverage, or create a real public docs page. |
|
|
141
|
+
|
|
142
|
+
## Cross-Cutting Gaps
|
|
143
|
+
|
|
144
|
+
### P0: Fix Contract Drift
|
|
145
|
+
|
|
146
|
+
- Decide the public/deprecated status of Button compatibility variants: `destructive`, `soft-destructive`, `success`, `warning`, and `link`.
|
|
147
|
+
- Add a parity check that compares registry metadata values against obvious exported spec/example usage for variants and sizes.
|
|
148
|
+
|
|
149
|
+
### P0: Pick One Page Standard
|
|
150
|
+
|
|
151
|
+
Adopt this as the canonical implementation pattern:
|
|
152
|
+
|
|
153
|
+
- Above-the-fold hero preview that shows the component immediately after the title/subtitle.
|
|
154
|
+
- Early stacked examples: English/LTR first, Arabic/RTL directly below when the component can reasonably render Arabic copy or direction-aware layout.
|
|
155
|
+
- Shared `RegistryComponentDocs` for the common docs surface.
|
|
156
|
+
- Optional "Deep Reference" section for state matrices, size scales, pointer matrices, token readouts, and layout grids.
|
|
157
|
+
|
|
158
|
+
This keeps the consistency of the shared renderer while preserving the richness of Button/Slider/Modal-style pages.
|
|
159
|
+
|
|
160
|
+
### P1: Normalize Markdown Docs
|
|
161
|
+
|
|
162
|
+
The component docs index currently covers only part of the registry surface. Public components missing component markdown docs are:
|
|
163
|
+
|
|
164
|
+
- Accordion
|
|
165
|
+
- Avatar
|
|
166
|
+
- Badge
|
|
167
|
+
- Checkbox
|
|
168
|
+
- Input
|
|
169
|
+
- Menu
|
|
170
|
+
- Pagination
|
|
171
|
+
- Progress Slider
|
|
172
|
+
- Radio Card
|
|
173
|
+
- Radio Group
|
|
174
|
+
- Select
|
|
175
|
+
- Social Button
|
|
176
|
+
- Spinner
|
|
177
|
+
- Textarea
|
|
178
|
+
- Catalog Components, if public
|
|
179
|
+
|
|
180
|
+
Tabs and Icons have top-level docs, but not under `docs/design-system/components`. Either link them explicitly from the component index or move them under the components directory.
|
|
181
|
+
|
|
182
|
+
### P1: Fill Expanded Metadata
|
|
183
|
+
|
|
184
|
+
Expanded components often show RTL and multiple states in demos, but their registry metadata does not expose RTL or capability keys. Add metadata for:
|
|
185
|
+
|
|
186
|
+
- Activity Feed
|
|
187
|
+
- Banner
|
|
188
|
+
- Breadcrumbs
|
|
189
|
+
- Command Bar
|
|
190
|
+
- File Upload
|
|
191
|
+
- Onboarding Step
|
|
192
|
+
- Page Header
|
|
193
|
+
- Slideout
|
|
194
|
+
- Steps
|
|
195
|
+
- Table
|
|
196
|
+
- Tabs
|
|
197
|
+
- Timeline
|
|
198
|
+
|
|
199
|
+
This makes the shared API/RTL sections truthful instead of generic.
|
|
200
|
+
|
|
201
|
+
### P1: Define Simple-Component Exceptions
|
|
202
|
+
|
|
203
|
+
Spinner probably does not need a deep reference section. Icons is closer to foundation tooling than a reusable component primitive. These exceptions should be explicit so they do not look accidentally incomplete.
|
|
204
|
+
|
|
205
|
+
### P2: Migrate Bespoke Pages Gradually
|
|
206
|
+
|
|
207
|
+
Do not rewrite the best pages all at once. Start with one or two:
|
|
208
|
+
|
|
209
|
+
1. Button: fix metadata and use it to define the standard.
|
|
210
|
+
2. Alert or Progress: migrate a smaller bespoke rich page to validate the shared-plus-reference pattern.
|
|
211
|
+
3. Modal or Slider: migrate a complex page once the pattern feels stable.
|
|
212
|
+
|
|
213
|
+
## Suggested Decision
|
|
214
|
+
|
|
215
|
+
Make Button the quality bar, but make `above-the-fold examples + RegistryComponentDocs + optional Deep Reference` the page architecture. Then measure every component against that architecture.
|
|
216
|
+
|
|
217
|
+
That gives us a consistent system without losing the parts that make the Button page valuable.
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# Component Token Consistency Audit
|
|
2
|
+
|
|
3
|
+
Date: 2026-06-13
|
|
4
|
+
|
|
5
|
+
## Scope
|
|
6
|
+
|
|
7
|
+
Reviewed the distributable component surface in `registry/components`, expanded component files in `registry/components/expanded`, generated/global token CSS in `registry/styles/globals.css`, token generation and contract scripts, and the playground mirrors.
|
|
8
|
+
|
|
9
|
+
This audit is focused on whether component color, spacing, sizing, radius, typography, opacity, focus, z-index, shadow, and motion values are driven by Banhaten tokens or documented component aliases.
|
|
10
|
+
|
|
11
|
+
## Checks Run
|
|
12
|
+
|
|
13
|
+
- `npm run tokens:check` passed.
|
|
14
|
+
- `npm run registry:check` passed.
|
|
15
|
+
- `npm --prefix playground run test:components` passed with 97 component tests.
|
|
16
|
+
|
|
17
|
+
Current automated coverage:
|
|
18
|
+
|
|
19
|
+
- `scripts/generate-token-css.mjs` imports `componentAliasDeclarations()` and emits component aliases into `registry/styles/globals.css`.
|
|
20
|
+
- `scripts/check-token-contract.mjs` verifies those component aliases exist in the generated CSS.
|
|
21
|
+
- `scripts/check-component-token-usage.mjs` scans `registry/components` for raw component-source values.
|
|
22
|
+
- `scripts/check-registry-mirrors.mjs` verifies playground mirrors stay in sync with registry files.
|
|
23
|
+
|
|
24
|
+
## Current Status
|
|
25
|
+
|
|
26
|
+
The component library is mostly token-consistent now. The major items from the previous audit have been completed:
|
|
27
|
+
|
|
28
|
+
- Component aliases are centralized in `scripts/component-token-aliases.mjs`.
|
|
29
|
+
- Generated CSS is current.
|
|
30
|
+
- Component aliases are contract-checked.
|
|
31
|
+
- Registry component source passes the token-usage check.
|
|
32
|
+
- Registry and playground mirrors match.
|
|
33
|
+
- Core focus, z-index, duration, spacing, radius, typography, icon sizing, and common opacity patterns are now tokenized.
|
|
34
|
+
|
|
35
|
+
The remaining changes are smaller consistency and governance items.
|
|
36
|
+
|
|
37
|
+
## Required Changes
|
|
38
|
+
|
|
39
|
+
### P1: Replace Remaining Raw `opacity-0` Utilities
|
|
40
|
+
|
|
41
|
+
`--bh-opacity-0` already exists, and most components use tokenized opacity. Replace the remaining Tailwind raw zero-opacity utilities with token-backed forms:
|
|
42
|
+
|
|
43
|
+
- `registry/components/date-picker.tsx`: replace `disabled:opacity-0` with `disabled:opacity-[var(--bh-opacity-0)]`.
|
|
44
|
+
- `registry/components/radio-group.tsx`: replace the hidden input `opacity-0` with `opacity-[var(--bh-opacity-0)]`.
|
|
45
|
+
- `registry/components/textarea.tsx`: replace `after:opacity-0` with `after:opacity-[var(--bh-opacity-0)]`.
|
|
46
|
+
- Sync mirrors through `npm run registry:sync` or the existing mirror workflow.
|
|
47
|
+
|
|
48
|
+
This is not a visual bug, but it is a token-discipline cleanup.
|
|
49
|
+
|
|
50
|
+
### P1: Tighten The Token-Usage Check For Zero And Full Opacity
|
|
51
|
+
|
|
52
|
+
`scripts/check-component-token-usage.mjs` currently flags raw Tailwind opacity only for `50`, `55`, `60`, and `70`. Extend that rule so component source also flags raw `opacity-0` and `opacity-100`, unless an explicit exception is added.
|
|
53
|
+
|
|
54
|
+
Recommended pattern target:
|
|
55
|
+
|
|
56
|
+
- Flag: `opacity-0`, `opacity-100`, `disabled:opacity-0`, `after:opacity-0`, grouped/state-prefixed variants.
|
|
57
|
+
- Allow: `opacity-[var(--bh-opacity-0)]`, `opacity-[var(--bh-opacity-100)]`.
|
|
58
|
+
|
|
59
|
+
### P2: Create A Formal Exception Ledger For Non-Token Literals In Alias Source
|
|
60
|
+
|
|
61
|
+
Raw values inside `scripts/component-token-aliases.mjs` are no longer leaking into component source, but several are intentional external or Figma-specific values. Document them so future cleanup does not accidentally erase brand/media fidelity.
|
|
62
|
+
|
|
63
|
+
Document as approved exceptions or promote into a clearer token group:
|
|
64
|
+
|
|
65
|
+
- Social provider colors: Facebook, Google, LinkedIn, WhatsApp.
|
|
66
|
+
- Radio-card illustrative/payment colors and dimensions.
|
|
67
|
+
- Fractional icon/media geometry such as `28.333px`, `13.333px`, and `6.364px`.
|
|
68
|
+
- Effect/shadow color stops, since the supplied token zips do not include effect tokens.
|
|
69
|
+
- Expanded layout widths and breakpoints for showcase/product-sized components.
|
|
70
|
+
- `--bh-activity-feed-completed-brightness: 0.99`, or replace it with a semantic completed-state color if the visual can be expressed without a brightness filter.
|
|
71
|
+
|
|
72
|
+
### P2: Keep JS Numeric Offsets Paired With CSS Tokens
|
|
73
|
+
|
|
74
|
+
Radix APIs require numeric `sideOffset` values, so these cannot directly consume CSS variables:
|
|
75
|
+
|
|
76
|
+
- `registry/components/select.tsx` uses `SELECT_MENU_SIDE_OFFSET_PX = 4`, mirroring `--bh-select-menu-offset`.
|
|
77
|
+
- `registry/components/tooltip.tsx` uses pointer and pointerless numeric offsets, mirroring tooltip spacing aliases.
|
|
78
|
+
|
|
79
|
+
The comments are already present. The remaining change is to add these cases to the exception ledger or add a small assertion/test that keeps the JS numbers aligned with their matching aliases.
|
|
80
|
+
|
|
81
|
+
### P3: Clarify Expanded Component Contract
|
|
82
|
+
|
|
83
|
+
Expanded components are registered with `status: "expanded"` and have many layout aliases, especially Icon Explorer, Table, Timeline, Steps, Catalog Components, and File Upload. Decide whether these are production component contracts or documentation/showcase layouts.
|
|
84
|
+
|
|
85
|
+
If production:
|
|
86
|
+
|
|
87
|
+
- Keep the `--bh-*` layout aliases as public component tokens.
|
|
88
|
+
- Add docs for which layout aliases are safe to override.
|
|
89
|
+
- Add them to any token documentation tables.
|
|
90
|
+
|
|
91
|
+
If documentation/showcase only:
|
|
92
|
+
|
|
93
|
+
- Mark them as documentation-level layout tokens.
|
|
94
|
+
- Keep them under the static token check, but document that their large fixed widths are layout constraints rather than primitive spacing tokens.
|
|
95
|
+
|
|
96
|
+
## Component Matrix
|
|
97
|
+
|
|
98
|
+
### Core Components
|
|
99
|
+
|
|
100
|
+
Needs token cleanup:
|
|
101
|
+
|
|
102
|
+
- Date Picker: raw `disabled:opacity-0`.
|
|
103
|
+
- Radio Group: raw hidden-input `opacity-0`.
|
|
104
|
+
- Textarea: raw focus-ring pseudo-element `after:opacity-0`.
|
|
105
|
+
|
|
106
|
+
Token-clean under current checks:
|
|
107
|
+
|
|
108
|
+
- Accordion
|
|
109
|
+
- Alert
|
|
110
|
+
- Attribute
|
|
111
|
+
- Avatar
|
|
112
|
+
- Badge
|
|
113
|
+
- Button
|
|
114
|
+
- Button Group
|
|
115
|
+
- Card
|
|
116
|
+
- Checkbox
|
|
117
|
+
- Divider
|
|
118
|
+
- Input
|
|
119
|
+
- Menu
|
|
120
|
+
- Modal
|
|
121
|
+
- Pagination
|
|
122
|
+
- Progress
|
|
123
|
+
- Progress Slider
|
|
124
|
+
- Radio Card
|
|
125
|
+
- Select
|
|
126
|
+
- Select Content
|
|
127
|
+
- Slider
|
|
128
|
+
- Social Button
|
|
129
|
+
- Spinner
|
|
130
|
+
- Tag
|
|
131
|
+
- Toggle
|
|
132
|
+
- Toolbar
|
|
133
|
+
- Tooltip
|
|
134
|
+
|
|
135
|
+
### Expanded Components
|
|
136
|
+
|
|
137
|
+
No direct component-source token violations remain under the current static check. Their remaining work is contract clarity and exception documentation:
|
|
138
|
+
|
|
139
|
+
- Activity Feed
|
|
140
|
+
- Banner
|
|
141
|
+
- Breadcrumbs
|
|
142
|
+
- Catalog Components Showcase
|
|
143
|
+
- Command Bar
|
|
144
|
+
- Expanded Divider
|
|
145
|
+
- File Upload
|
|
146
|
+
- Icon Explorer
|
|
147
|
+
- Onboarding Step List Item
|
|
148
|
+
- Page Header
|
|
149
|
+
- Slideout
|
|
150
|
+
- Steps
|
|
151
|
+
- Table
|
|
152
|
+
- Tabs
|
|
153
|
+
- Timeline
|
|
154
|
+
|
|
155
|
+
Approved literal media-query breakpoints remain in CSS `@media` conditions because CSS custom properties are not reliable media-query operands. Geometry inside those media query blocks should continue using Banhaten tokens or component aliases.
|
|
156
|
+
|
|
157
|
+
## Suggested Implementation Order
|
|
158
|
+
|
|
159
|
+
1. Replace the three raw `opacity-0` utilities in registry components and sync mirrors.
|
|
160
|
+
2. Extend `scripts/check-component-token-usage.mjs` to catch raw `opacity-0` and `opacity-100`.
|
|
161
|
+
3. Add an exception ledger for alias-source literals and Radix numeric offsets.
|
|
162
|
+
4. Decide and document the expanded-component token contract.
|
|
163
|
+
5. Re-run `npm run tokens:check`, `npm run registry:check`, and `npm --prefix playground run test:components`.
|