banhaten 0.1.2 → 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 +93 -328
- 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 -65
- package/registry/components/alert-dialog.tsx +297 -0
- package/registry/components/aspect-ratio.tsx +30 -0
- 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.tsx +1 -1
- 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/steps.css +274 -274
- 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.tsx +2 -2
- package/registry/components/kbd.tsx +44 -0
- package/registry/components/label.tsx +78 -0
- package/registry/components/menu.tsx +3 -1
- 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/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 +2 -4
- package/registry/components/sheet.tsx +305 -0
- package/registry/components/sidebar.tsx +352 -0
- package/registry/components/social-button.tsx +74 -10
- package/registry/components/{expanded/tabs.css → tabs.css} +127 -106
- package/registry/components/tabs.tsx +242 -0
- package/registry/components/textarea.tsx +1 -1
- package/registry/components/toast.tsx +131 -0
- package/registry/examples/alert-dialog-demo.tsx +42 -0
- package/registry/examples/aspect-ratio-demo.tsx +11 -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/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-group-demo.tsx +16 -0
- package/registry/examples/kbd-demo.tsx +11 -0
- package/registry/examples/label-demo.tsx +20 -0
- 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/resizable-demo.tsx +22 -0
- package/registry/examples/scroll-area-demo.tsx +15 -0
- package/registry/examples/sheet-demo.tsx +47 -0
- package/registry/examples/sidebar-demo.tsx +55 -0
- package/registry/examples/tabs-demo.tsx +13 -0
- package/registry/examples/toast-demo.tsx +35 -0
- package/registry/index.json +655 -11
- package/registry/styles/globals.css +4733 -4690
- 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 +312 -18
- 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,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`.
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Components
|
|
2
|
+
|
|
3
|
+
Design-system components use semantic props and tokens. Appearance presets may change their visual treatment, but they should not change component APIs.
|
|
4
|
+
|
|
5
|
+
## Component Catalog
|
|
6
|
+
|
|
7
|
+
- [Accordion](./accordion.md): Radix-backed disclosure primitive with variants, size scale, animation, and RTL-safe text alignment.
|
|
8
|
+
- [Activity Feed](./activity-feed.md): vertical activity timeline with avatars, status dots, captions or slot content, actions, and RTL support.
|
|
9
|
+
- [Alert](./alert.md): compact and expandable contextual feedback with semantic status colors, action links, close control, and RTL support.
|
|
10
|
+
- [Alert Dialog](./alert-dialog.md): Radix AlertDialog-backed confirmation surface for destructive or consequential actions with semantic intent styling.
|
|
11
|
+
- [Aspect Ratio](./aspect-ratio.md): Radix AspectRatio wrapper for fixed-format media, previews, and product surfaces.
|
|
12
|
+
- [Attribute](./attribute.md): semantic key-value description lists with alignment variants, density, bordered rows, rich value slots, and RTL support.
|
|
13
|
+
- [Autocomplete](./autocomplete.md): searchable combobox field composed from Input, Select menu rows, and Tag chips for single or multiple selection.
|
|
14
|
+
- [Avatar](./avatar.md): user avatar primitive with image, fallback, status, action overlays, groups, and RTL-safe overlap.
|
|
15
|
+
- [Badge](./badge.md): compact status and metadata primitive with semantic colors, icons, dots, flags, counts, and RTL support.
|
|
16
|
+
- [Banner](./banner.md): announcement and notice strip with slim, action, inline-action, input, color, size, content, and RTL variants.
|
|
17
|
+
- [Button](./button.md): semantic action primitive with variants, text and icon sizes, loading composition, link composition, and Arabic/RTL-safe icon behavior.
|
|
18
|
+
- [Button Group](./button-group.md): connected action groups with text and icon-only modes, md/sm/xs sizes, RTL widths, dividers, native interaction styling, and active/disabled states.
|
|
19
|
+
- [Breadcrumbs](./breadcrumbs.md): hierarchical page navigation with slash or chevron separators, raised or inline styles, and RTL support.
|
|
20
|
+
- [Card](./card.md): token-built content surface with image placements, footer actions, desktop/mobile spacing, and RTL-safe copy.
|
|
21
|
+
- [Carousel](./carousel.md): Embla-backed carousel with content, item, previous, and next controls.
|
|
22
|
+
- [Catalog Components](./catalog-components.md): expanded catalog showcase bundle for breadcrumbs, dividers, tags, file upload states, and table previews.
|
|
23
|
+
- [Chart](./chart.md): Recharts wrapper with Banhaten chart tokens, responsive container, tooltip content, and legend content.
|
|
24
|
+
- [Checkbox](./checkbox.md): Radix checkbox primitive plus checkbox-card composition with selected, disabled, hover, and RTL states.
|
|
25
|
+
- [Collapsible](./collapsible.md): Radix Collapsible wrapper for disclosure sections with tokenized trigger and content slots.
|
|
26
|
+
- [Command](./command.md): cmdk-backed command menu with search, groups, shortcuts, separators, and empty state.
|
|
27
|
+
- [Command Bar](./command-bar.md): keyboard-friendly command palette with search, recent items, results, empty states, and RTL support.
|
|
28
|
+
- [Context Menu](./context-menu.md): Radix ContextMenu-backed right-click menu with labels, separators, submenus, checks, radios, and shortcuts.
|
|
29
|
+
- [Date Picker](./date-picker.md): calendar and range-picker suite with presets, open states, triggers, time rows, and RTL support.
|
|
30
|
+
- [Divider](./divider.md): horizontal and vertical separator with solid or dotted rules.
|
|
31
|
+
- [Empty State](./empty-state.md): no-results and first-run state with a neutral icon halo, title, supporting copy, actions, and RTL support.
|
|
32
|
+
- [File Upload](./file-upload.md): drag-and-drop upload target with queued file rows, status feedback, and LTR/RTL size variants.
|
|
33
|
+
- [Field](./field.md): accessible form-row composition for labels, controls, descriptions, errors, grouped fields, and validation state.
|
|
34
|
+
- [Hover Card](./hover-card.md): Radix HoverCard-backed preview surface for rich hover and focus context.
|
|
35
|
+
- [Icons](./icons.md): expanded icon explorer for pack review, semantic mapping, shortlist comparison, and Iconify inspection.
|
|
36
|
+
- [Input](./input.md): text-entry field with labels, helper and error text, add-ons, tags, shortcuts, adornments, and RTL states.
|
|
37
|
+
- [Input Group](./input-group.md): grouped input shell for protocol add-ons, inline actions, prefixes, suffixes, and compact rows.
|
|
38
|
+
- [Input OTP](./input-otp.md): one-time-code field with grouped slots, paste distribution, masked values, hidden form value, and RTL keyboard behavior.
|
|
39
|
+
- [Kbd](./kbd.md): keyboard hint primitive for shortcuts, command rows, and form help text.
|
|
40
|
+
- [Label](./label.md): Radix-backed accessible label primitive with required, optional, tone, disabled, and RTL-safe text behavior.
|
|
41
|
+
- [Menu](./menu.md): Radix DropdownMenu-backed command surface with rich item slots, submenus, progress rows, labels, captions, and RTL layout.
|
|
42
|
+
- [Menubar](./menubar.md): Radix Menubar-backed application menu with keyboard navigation and menu item slots.
|
|
43
|
+
- [Modal](./modal.md): Radix Dialog-backed modal surface with size variants, header/body/footer slots, ConfirmModal guardrails, Button actions, Checkbox opt-out, and RTL support.
|
|
44
|
+
- [Native Select](./native-select.md): tokenized native select field for platform forms, mobile fallback, and lightweight option sets.
|
|
45
|
+
- [Navigation Menu](./navigation-menu.md): Radix NavigationMenu-backed top navigation with trigger, content, link, viewport, and indicator parts.
|
|
46
|
+
- [Onboarding Step List Item](./onboarding-step-list-item.md): vertical progress-list row with finished, active, and inactive states plus RTL support.
|
|
47
|
+
- [Page Header](./page-header.md): page hierarchy, title metadata, actions, description, and local tabs.
|
|
48
|
+
- [Pagination](./pagination.md): numeric, simple, and summary pagination layouts with soft or ghost styling, captions, and RTL labels.
|
|
49
|
+
- [Popover](./popover.md): contextual overlay primitive with click, focus, hover, positioning, arrows, close affordance, and RTL-safe composition.
|
|
50
|
+
- [Progress](./progress.md): read-only progress meter with value fill, labels, helper text, indicator, spinner, and RTL support.
|
|
51
|
+
- [Progress Slider](./progress-slider.md): Radix Slider-based progress control with start-anchored fill, semantic tones, ticks, and RTL keyboard behavior.
|
|
52
|
+
- [Radio Card](./radio-card.md): rich single-choice option card with Figma content types, active/disabled states, and explicit RTL variants.
|
|
53
|
+
- [Radio Group](./radio-group.md): native-input radio group with labels, descriptions, errors, controlled/uncontrolled values, and RTL-safe field rows.
|
|
54
|
+
- [Select](./select.md): Radix Select-backed field and menu item system with item media, selection styles, validation states, and RTL layout.
|
|
55
|
+
- [Resizable](./resizable.md): react-resizable-panels-backed split pane primitive with tokenized resize handle.
|
|
56
|
+
- [Sheet](./sheet.md): Radix Dialog-based edge panel with logical start/end placement, top/bottom placement, size variants, and RTL support.
|
|
57
|
+
- [Sidebar](./sidebar.md): composable app sidebar with collapse state, grouped menu items, logical placement, and sidebar tokens.
|
|
58
|
+
- [Slideout](./slideout.md): desktop and mobile side panel with header/footer actions, scrollable slots, example content, and RTL support.
|
|
59
|
+
- [Scroll Area](./scroll-area.md): Radix ScrollArea wrapper with tokenized viewport, scrollbar, thumb, and corner styling.
|
|
60
|
+
- [Slider](./slider.md): accessible value and range control with single, range, multi-thumb, vertical, ticked, pill, tone, size, disabled, and RTL variants.
|
|
61
|
+
- [Skeleton](./skeleton.md): token-built loading placeholders for text, avatars, actions, forms, cards, lists, tables, shimmer motion, and RTL surfaces.
|
|
62
|
+
- [Social Button](./social-button.md): sign-in action primitive for supported providers with solid, outline, icon-only, focus, and RTL states.
|
|
63
|
+
- [Spinner](./spinner.md): compact steady and dynamic loading spinners with inherited color and tokenized sizing.
|
|
64
|
+
- [Steps](./steps.md): horizontal and vertical progress indicators with icon or number markers, item-level slots/actions, and RTL support.
|
|
65
|
+
- [Table](./table.md): composable table and data-table workflow with selectable rows, sortable headers, search, filters, pagination, row states, RTL support, and reusable cell item variants.
|
|
66
|
+
- [Tabs](./tabs.md): Radix Tabs-backed local navigation with underline, segmented, and rounded treatments across LTR and RTL.
|
|
67
|
+
- [Textarea](./textarea.md): multiline field with labels, helper and error text, default and tags modes, placeholder, filled, disabled, and RTL states.
|
|
68
|
+
- [Timeline](./timeline.md): vertical and horizontal progress/event sequences with default or icon markers, states, dates, captions, and RTL support.
|
|
69
|
+
- [Toast](./toast.md): Sonner-style feedback primitive with semantic intents, action support, Banhaten token styling, and logical RTL placement.
|
|
70
|
+
- [Tag](./tag.md): compact metadata, filter, and removable-selection chip with type, state, size, close-button, and RTL variants.
|
|
71
|
+
- [Toggle](./toggle.md): switch-style boolean control with sm/md sizes, optional handle icons, labeled leading/trailing rows, supporting text, and RTL support.
|
|
72
|
+
- [Toolbar](./toolbar.md): filter and action toolbar with search, select triggers, icon buttons, chips, summaries, desktop/mobile styles, and RTL support.
|
|
73
|
+
- [Tooltip](./tooltip.md): Radix Tooltip-backed help surface with dark/default variants, pointer positions, shortcut/close slots, and RTL support.
|
|
74
|
+
- [Typography](./typography.md): documentation for existing `.bh-text-*` token utility classes.
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Accordion
|
|
2
|
+
|
|
3
|
+
Accordion is the disclosure primitive for grouped details, settings, FAQs, and compact content sections. It is backed by Radix Accordion and supports single or multiple expansion, size variants, visual treatments, animation, and RTL-safe copy.
|
|
4
|
+
|
|
5
|
+
## API
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
<Accordion type="single" collapsible>
|
|
9
|
+
<AccordionItem value="billing">
|
|
10
|
+
<AccordionTrigger>Billing</AccordionTrigger>
|
|
11
|
+
<AccordionContent>Invoice and payment details.</AccordionContent>
|
|
12
|
+
</AccordionItem>
|
|
13
|
+
</Accordion>
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
| Prop | Values | Default |
|
|
17
|
+
| --- | --- | --- |
|
|
18
|
+
| `variant` | `default`, `bordered`, `cards`, `soft` | `default` |
|
|
19
|
+
| `size` | `sm`, `default`, `lg` | `default` |
|
|
20
|
+
| `type` | Radix `single`, `multiple` | required |
|
|
21
|
+
| `collapsible` | `boolean` | Radix default |
|
|
22
|
+
|
|
23
|
+
## Token Contract
|
|
24
|
+
|
|
25
|
+
Accordion uses Banhaten spacing, border, radius, content, interactive, typography, and animation tokens. Avoid raw colors or pixel values in local variants.
|
|
26
|
+
|
|
27
|
+
## RTL
|
|
28
|
+
|
|
29
|
+
Accordion inherits direction from its parent. Triggers and content use logical spacing and `text-start`; text labels use `dir="auto"` where the component renders string copy.
|
|
30
|
+
|
|
31
|
+
## Accessibility
|
|
32
|
+
|
|
33
|
+
Radix provides button semantics, `aria-expanded`, roving state, and keyboard behavior. Keep trigger content concise and do not put nested interactive controls inside `AccordionTrigger`.
|
|
34
|
+
|
|
35
|
+
## Install
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npx banhaten add accordion
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Examples
|
|
42
|
+
|
|
43
|
+
Primary registry example: `examples/accordion-demo.tsx`.
|
|
44
|
+
|
|
45
|
+
Open the live component page or run `npx banhaten docs accordion` to inspect source files, install command, and examples.
|
|
46
|
+
|
|
47
|
+
## RTL Rules
|
|
48
|
+
|
|
49
|
+
- `inheritsDirection`: true
|
|
50
|
+
- `textAlignment`: Uses text-start and dir="auto" so Arabic and English copy align and punctuate naturally.
|
|
51
|
+
- `spacing`: Uses gap and logical inherited direction rather than physical left/right spacing.
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# Activity Feed
|
|
2
|
+
|
|
3
|
+
`ActivityFeed` renders a vertical timeline of activity items with avatars, status dots, captions or slot content, timestamps, and action buttons.
|
|
4
|
+
|
|
5
|
+
Figma reference: `Design system 3.0 Copy / ActivityFeed`, component set node `587:19445`.
|
|
6
|
+
|
|
7
|
+
## Variants
|
|
8
|
+
|
|
9
|
+
The Figma component defines these top-level variants:
|
|
10
|
+
|
|
11
|
+
| Direction | Node |
|
|
12
|
+
| --- | --- |
|
|
13
|
+
| LTR | `587:19381` |
|
|
14
|
+
| RTL | `587:19711` |
|
|
15
|
+
|
|
16
|
+
`ActivityFeedItem` also supports `caption` and `slot` item types through the `type` prop.
|
|
17
|
+
|
|
18
|
+
## API
|
|
19
|
+
|
|
20
|
+
```tsx
|
|
21
|
+
<ActivityFeed
|
|
22
|
+
dir="ltr"
|
|
23
|
+
items={[
|
|
24
|
+
{
|
|
25
|
+
label: "Label",
|
|
26
|
+
supportText: "Support Text",
|
|
27
|
+
link: "#Link",
|
|
28
|
+
caption: "Caption text",
|
|
29
|
+
timestamp: "Mar 15. 2050",
|
|
30
|
+
type: "caption",
|
|
31
|
+
},
|
|
32
|
+
]}
|
|
33
|
+
/>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
| Prop | Values | Default |
|
|
37
|
+
| --- | --- | --- |
|
|
38
|
+
| `dir` | `ltr`, `rtl` | `ltr` |
|
|
39
|
+
| `items` | `ActivityFeedItemProps[]` | ten caption items |
|
|
40
|
+
| `avatarSrc` | `string` | local Figma avatar asset |
|
|
41
|
+
| `type` | `caption`, `slot` | `caption` |
|
|
42
|
+
| `hasStatus` | `boolean` | `true` |
|
|
43
|
+
| `hasActionButtons` | `boolean` | `true` |
|
|
44
|
+
| `hasTwoActionButtons` | `boolean` | `true` |
|
|
45
|
+
| `showLine` | `boolean` | `true` |
|
|
46
|
+
| `showPaddingBottom` | `boolean` | `true` |
|
|
47
|
+
|
|
48
|
+
## Token Contract
|
|
49
|
+
|
|
50
|
+
The component consumes Banhaten semantic tokens and component aliases. Do not hard-code Figma fallback literals in component source; promote any Figma value into `registry/styles/globals.css` as a `--bh-*` token or alias first.
|
|
51
|
+
|
|
52
|
+
- Backgrounds: `--bh-bg-raised`, `--bh-bg-success-default`
|
|
53
|
+
- Borders: `--bh-border-default`, `--bh-border-subtle`
|
|
54
|
+
- Content: `--bh-content-default`, `--bh-content-link`, `--bh-content-on-brand`, `--bh-content-subtle`
|
|
55
|
+
- Interactive: `--bh-interactive-brand-default`, `--bh-interactive-secondary-default`
|
|
56
|
+
- Shape: `--bh-radius-full`, `--bh-radius-sm-4`, `--bh-control-default`
|
|
57
|
+
- Space: `--bh-space-xxs-2`, `--bh-space-xs-4`, `--bh-space-md-8`, `--bh-space-lg-10`, `--bh-space-xl-12`
|
|
58
|
+
|
|
59
|
+
## Pixel Rules
|
|
60
|
+
|
|
61
|
+
- Feed width is `600px`.
|
|
62
|
+
- Items use a `12px` gap between the indicator rail and content.
|
|
63
|
+
- Avatar is `32px` square with a full radius and subtle border.
|
|
64
|
+
- The status dot renders in a `16px` box with a `6px` success fill.
|
|
65
|
+
- Body text is Inter `15px / 24px`; timestamps are `14px / 20px`.
|
|
66
|
+
- Captions use `12px` padding, subtle border, white raised fill, and `4px` radius.
|
|
67
|
+
- Slot content is `76px` high with purple dashed border and subtle purple fill.
|
|
68
|
+
- Actions use `8px` top padding, `8px` button gap, and `36px` tall buttons.
|
|
69
|
+
- The repeated-item default uses a `22px` decorative bottom spacer so ten items fit the `2000px` Figma feed frame.
|
|
70
|
+
- RTL mirrors the avatar rail to the right and right-aligns text content.
|
|
71
|
+
|
|
72
|
+
## Accessibility
|
|
73
|
+
|
|
74
|
+
- The feed uses a labelled `section`; provide `ariaLabel` when the surrounding context is not explicit.
|
|
75
|
+
- Status dots and connector lines are decorative. Use item copy or parent-level announcements for meaningful state.
|
|
76
|
+
- Action buttons are real `button` or `a` elements and support `ariaLabel`, `disabled`, `href`, and `onClick`.
|
|
77
|
+
|
|
78
|
+
## Install
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
npx banhaten add activity-feed
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Examples
|
|
85
|
+
|
|
86
|
+
Primary registry example: `examples/expanded/activity-feed-demo.tsx`.
|
|
87
|
+
|
|
88
|
+
Open the live component page or run `npx banhaten docs activity-feed` to inspect source files, install command, and examples.
|
|
89
|
+
|
|
90
|
+
## RTL Rules
|
|
91
|
+
|
|
92
|
+
This component has no special RTL contract beyond inherited document direction and logical spacing.
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Alert Dialog
|
|
2
|
+
|
|
3
|
+
Alert Dialog is the destructive or consequential confirmation primitive. It is backed by Radix AlertDialog so focus, Escape behavior, outside interaction, and alert-dialog semantics are handled by the correct primitive.
|
|
4
|
+
|
|
5
|
+
## API
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
<AlertDialog>
|
|
9
|
+
<AlertDialogTrigger asChild>
|
|
10
|
+
<Button variant="danger">Delete project</Button>
|
|
11
|
+
</AlertDialogTrigger>
|
|
12
|
+
<AlertDialogContent>
|
|
13
|
+
<AlertDialogHeader>
|
|
14
|
+
<AlertDialogIcon intent="danger" />
|
|
15
|
+
<AlertDialogTitle>Delete project?</AlertDialogTitle>
|
|
16
|
+
</AlertDialogHeader>
|
|
17
|
+
<AlertDialogBody>
|
|
18
|
+
<AlertDialogDescription>This cannot be undone.</AlertDialogDescription>
|
|
19
|
+
</AlertDialogBody>
|
|
20
|
+
<AlertDialogFooter>
|
|
21
|
+
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
|
22
|
+
<AlertDialogAction>Delete project</AlertDialogAction>
|
|
23
|
+
</AlertDialogFooter>
|
|
24
|
+
</AlertDialogContent>
|
|
25
|
+
</AlertDialog>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
| Part | Purpose |
|
|
29
|
+
| --- | --- |
|
|
30
|
+
| `AlertDialog`, `AlertDialogTrigger`, `AlertDialogPortal` | Radix AlertDialog shell |
|
|
31
|
+
| `AlertDialogOverlay`, `AlertDialogContent` | modal alert surface |
|
|
32
|
+
| `AlertDialogHeader`, `AlertDialogBody`, `AlertDialogFooter` | layout regions |
|
|
33
|
+
| `AlertDialogTitle`, `AlertDialogDescription`, `AlertDialogIcon` | accessible warning copy |
|
|
34
|
+
| `AlertDialogCancel`, `AlertDialogAction` | safe cancel and confirm actions |
|
|
35
|
+
|
|
36
|
+
| Prop | Values |
|
|
37
|
+
| --- | --- |
|
|
38
|
+
| `size` | `sm`, `default`, `lg` |
|
|
39
|
+
| `intent` | `default`, `warning`, `danger` |
|
|
40
|
+
|
|
41
|
+
## Token Contract
|
|
42
|
+
|
|
43
|
+
Alert Dialog uses Banhaten raised surface, backdrop, border, radius, shadow, semantic intent, body typography, focus, and button tokens.
|
|
44
|
+
|
|
45
|
+
## RTL
|
|
46
|
+
|
|
47
|
+
The surface inherits direction. Title and description use `dir="auto"` and action layout uses logical flex order.
|
|
48
|
+
|
|
49
|
+
## Accessibility
|
|
50
|
+
|
|
51
|
+
Use Alert Dialog for destructive or irreversible choices. Focus should land on the cancel action by default when you build higher-level confirmations. `ConfirmModal` is wired on top of this alert-dialog primitive for the constrained confirmation pattern.
|
|
52
|
+
|
|
53
|
+
## Install
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
npx banhaten add alert-dialog
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Examples
|
|
60
|
+
|
|
61
|
+
Primary registry example: `examples/alert-dialog-demo.tsx`.
|
|
62
|
+
|
|
63
|
+
Open the live component page or run `npx banhaten docs alert-dialog` to inspect source files, install command, and examples.
|
|
64
|
+
|
|
65
|
+
## RTL Rules
|
|
66
|
+
|
|
67
|
+
- `inheritsDirection`: true
|
|
68
|
+
- `textDirection`: Title and description use dir="auto" for Arabic and English copy.
|
|
69
|
+
- `spacing`: Header, body, and footer use logical layout and Banhaten spacing tokens so action order and copy mirror naturally.
|
|
70
|
+
- `semantics`: Radix AlertDialog provides the modal alert role, focus trap, and safe cancellation behavior.
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Alert
|
|
2
|
+
|
|
3
|
+
`Alert` presents contextual feedback with compact and expandable layouts.
|
|
4
|
+
|
|
5
|
+
Figma reference: `Design system 3.0 Copy / Alert`, node `158:4645`.
|
|
6
|
+
|
|
7
|
+
## Variants
|
|
8
|
+
|
|
9
|
+
The implementation covers the Alert matrix from Figma:
|
|
10
|
+
|
|
11
|
+
| Prop | Values |
|
|
12
|
+
| --- | --- |
|
|
13
|
+
| `status` | `danger`, `success`, `warning`, `info`, `neutral` |
|
|
14
|
+
| `isExpandable` | `false`, `true` |
|
|
15
|
+
| `dir` | `ltr`, `rtl` |
|
|
16
|
+
|
|
17
|
+
## API
|
|
18
|
+
|
|
19
|
+
```tsx
|
|
20
|
+
<Alert status="danger" />
|
|
21
|
+
<Alert status="success" isExpandable dir="rtl" />
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
| Prop | Default |
|
|
25
|
+
| --- | --- |
|
|
26
|
+
| `status` | `danger` |
|
|
27
|
+
| `isExpandable` | `false` |
|
|
28
|
+
| `dir` | `ltr` |
|
|
29
|
+
| `title` | localized demo title |
|
|
30
|
+
| `description` | localized demo description |
|
|
31
|
+
| `actions` | localized link actions |
|
|
32
|
+
| `showActions` | `true` |
|
|
33
|
+
| `showCloseButton` | `true` |
|
|
34
|
+
| `onClose` | none |
|
|
35
|
+
|
|
36
|
+
## Pixel Rules
|
|
37
|
+
|
|
38
|
+
- Compact alerts are `470px` wide and `56px` tall with `16px` padding.
|
|
39
|
+
- Expandable alerts are `500px` wide with `20px 16px` padding.
|
|
40
|
+
- Compact rows use `8px` radius; expandable rows use `10px` radius.
|
|
41
|
+
- Status icons and close controls are `20px`; the close glyph is `16px`.
|
|
42
|
+
- Compact content uses `8px` between icon and title.
|
|
43
|
+
- Expandable content uses `12px` between icon, copy, close, and action rows.
|
|
44
|
+
- Titles use `15px / 24px` medium text.
|
|
45
|
+
- Descriptions use `14px / 20px` regular text at `80%` opacity.
|
|
46
|
+
|
|
47
|
+
## Token Contract
|
|
48
|
+
|
|
49
|
+
The component consumes Banhaten semantic tokens and component aliases. Do not hard-code Figma fallback literals in component source; promote any Figma value into `registry/styles/globals.css` as a `--bh-*` token or alias first.
|
|
50
|
+
|
|
51
|
+
- Backgrounds: `--bh-bg-danger-subtle`, `--bh-bg-success-subtle`, `--bh-bg-warning-subtle`, `--bh-bg-info-subtle`, `--bh-bg-neutral-subtle`
|
|
52
|
+
- Borders: `--bh-border-danger-subtle`, `--bh-border-success-subtle`, `--bh-border-warning-subtle`, `--bh-border-info-subtle`, `--bh-border-subtle`, `--bh-border-default`
|
|
53
|
+
- Content: `--bh-content-danger-strong`, `--bh-content-success-strong`, `--bh-content-warning-strong`, `--bh-content-brand-strong`, `--bh-content-default`
|
|
54
|
+
- Shape: `--bh-radius-lg-8`, `--bh-radius-xl-10`, `--bh-radius-full`
|
|
55
|
+
- Space: `--bh-space-md-8`, `--bh-space-xl-12`, `--bh-space-3xl-16`, `--bh-space-4xl-20`
|
|
56
|
+
|
|
57
|
+
## Accessibility
|
|
58
|
+
|
|
59
|
+
- The close affordance is a real button.
|
|
60
|
+
- Action links are rendered as real buttons to support product actions.
|
|
61
|
+
- `dir` controls visual and reading direction for English and Arabic states.
|
|
62
|
+
|
|
63
|
+
## Install
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
npx banhaten add alert
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Examples
|
|
70
|
+
|
|
71
|
+
Primary registry example: `examples/alert-demo.tsx`.
|
|
72
|
+
|
|
73
|
+
Open the live component page or run `npx banhaten docs alert` to inspect source files, install command, and examples.
|
|
74
|
+
|
|
75
|
+
## RTL Rules
|
|
76
|
+
|
|
77
|
+
- `inheritsDirection`: false
|
|
78
|
+
- `textAlignment`: Uses dir="auto" on title and description while the root dir prop mirrors icon, action, and close placement.
|
|
79
|
+
- `spacing`: Uses flexbox, gap, and logical direction so compact and expandable RTL layouts match the Figma matrix.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Aspect Ratio
|
|
2
|
+
|
|
3
|
+
Aspect Ratio wraps Radix AspectRatio for fixed-format media, screenshots, and preview surfaces.
|
|
4
|
+
|
|
5
|
+
## API
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
<AspectRatio ratio={16 / 9}>
|
|
9
|
+
<img src="/preview.png" alt="Preview" />
|
|
10
|
+
</AspectRatio>
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
| Prop | Values |
|
|
14
|
+
| --- | --- |
|
|
15
|
+
| `ratio` | any positive number |
|
|
16
|
+
|
|
17
|
+
## Token Contract
|
|
18
|
+
|
|
19
|
+
Aspect Ratio uses Banhaten neutral background and radius tokens by default.
|
|
20
|
+
|
|
21
|
+
## RTL
|
|
22
|
+
|
|
23
|
+
Aspect Ratio is direction-neutral.
|
|
24
|
+
|
|
25
|
+
## Accessibility
|
|
26
|
+
|
|
27
|
+
Provide accessible names for media rendered inside the ratio box.
|
|
28
|
+
|
|
29
|
+
## Install
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npx banhaten add aspect-ratio
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Examples
|
|
36
|
+
|
|
37
|
+
Primary registry example: `examples/aspect-ratio-demo.tsx`.
|
|
38
|
+
|
|
39
|
+
Open the live component page or run `npx banhaten docs aspect-ratio` to inspect source files, install command, and examples.
|
|
40
|
+
|
|
41
|
+
## RTL Rules
|
|
42
|
+
|
|
43
|
+
- `inheritsDirection`: false
|
|
44
|
+
- `geometry`: Aspect Ratio controls media geometry and does not alter text direction.
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Attribute
|
|
2
|
+
|
|
3
|
+
Attribute is a semantic description-list component for key-value information. It supports card headers, inline rows, right-aligned values, stacked mobile rows, two-column summaries, row dividers, bordered row groups, compact density, and RTL direction.
|
|
4
|
+
|
|
5
|
+
The implementation follows the Figma component at `Design system 3.0 Copy / Attribute Card` (`255:123238`) and uses only existing Banhaten tokens.
|
|
6
|
+
|
|
7
|
+
## API
|
|
8
|
+
|
|
9
|
+
Use `AttributeCard` for the surface, `AttributeHeader` for optional title and description content, `AttributeList` for the `dl`, and `AttributeItem` for each `dt`/`dd` pair.
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
<AttributeCard>
|
|
13
|
+
<AttributeHeader
|
|
14
|
+
title="Company profile"
|
|
15
|
+
description="Key-value information in a scannable card."
|
|
16
|
+
/>
|
|
17
|
+
<AttributeList>
|
|
18
|
+
<AttributeItem label="Name">Acme Corporation</AttributeItem>
|
|
19
|
+
<AttributeItem label="Type">Business</AttributeItem>
|
|
20
|
+
<AttributeItem label="Industry">Software</AttributeItem>
|
|
21
|
+
</AttributeList>
|
|
22
|
+
</AttributeCard>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Variants
|
|
26
|
+
|
|
27
|
+
| Prop | Values |
|
|
28
|
+
| --- | --- |
|
|
29
|
+
| `AttributeCard padding` | `default`, `compact` |
|
|
30
|
+
| `AttributeList layout` | `inline`, `end`, `stacked`, `two-column` |
|
|
31
|
+
| `AttributeList density` | `compact`, `default`, `comfortable` |
|
|
32
|
+
| `AttributeList dividers` | `boolean` |
|
|
33
|
+
| `AttributeList bordered` | `boolean` |
|
|
34
|
+
| `AttributeList labelWidth` | CSS length, default `220px` |
|
|
35
|
+
| `AttributeItem fullSpan` | `boolean`, useful in `two-column` layouts |
|
|
36
|
+
| `AttributeItem truncate` | `boolean` |
|
|
37
|
+
|
|
38
|
+
## Composition
|
|
39
|
+
|
|
40
|
+
Values are open React slots. Compose existing primitives for status badges, copy buttons, file rows, progress bars, skeleton bars, links, and custom details.
|
|
41
|
+
|
|
42
|
+
```tsx
|
|
43
|
+
<AttributeList layout="end" dividers>
|
|
44
|
+
<AttributeItem label="Subscription">
|
|
45
|
+
<Badge color="green" type="dot">Active</Badge>
|
|
46
|
+
</AttributeItem>
|
|
47
|
+
<AttributeItem label="API key" truncate>
|
|
48
|
+
sk_live_************1234
|
|
49
|
+
<Button aria-label="Copy API key" size="icon-xs" variant="outline">
|
|
50
|
+
<CopyIcon />
|
|
51
|
+
</Button>
|
|
52
|
+
</AttributeItem>
|
|
53
|
+
</AttributeList>
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## RTL
|
|
57
|
+
|
|
58
|
+
Attribute inherits direction from any parent. The component uses logical text alignment and `dir="auto"` wrappers for string labels and values, so Arabic and English content can sit in the same card without manual left/right classes.
|
|
59
|
+
|
|
60
|
+
## Install
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
npx banhaten add attribute
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Examples
|
|
67
|
+
|
|
68
|
+
Primary registry example: `examples/attribute-demo.tsx`.
|
|
69
|
+
|
|
70
|
+
Open the live component page or run `npx banhaten docs attribute` to inspect source files, install command, and examples.
|
|
71
|
+
|
|
72
|
+
## Token Contract
|
|
73
|
+
|
|
74
|
+
Component styles must resolve through Banhaten semantic tokens, component aliases, or documented exception-ledger values.
|
|
75
|
+
Do not add raw colors, pixel values, opacity utilities, z-index values, durations, or shadow literals directly to component source.
|
|
76
|
+
Covered source files: `components/attribute.tsx`.
|
|
77
|
+
|
|
78
|
+
## RTL Rules
|
|
79
|
+
|
|
80
|
+
- `inheritsDirection`: true
|
|
81
|
+
- `layout`: Uses logical text alignment and inherited direction so label and value columns mirror naturally.
|
|
82
|
+
- `textDirection`: String labels and values use dir="auto" wrappers while custom slots can control their own direction.
|
|
83
|
+
- `composition`: Rows accept ReactNode values, so badges, buttons, links, progress bars, skeletons, files, and custom content can be composed from existing Banhaten primitives.
|
|
84
|
+
|
|
85
|
+
## Accessibility
|
|
86
|
+
|
|
87
|
+
Keep native semantics, accessible names, keyboard reachability, focus-visible treatment, and status/error announcements intact when composing this component.
|