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
package/README.md
CHANGED
|
@@ -1,361 +1,138 @@
|
|
|
1
|
-
# Banhaten
|
|
1
|
+
# Banhaten Design System
|
|
2
2
|
|
|
3
|
-
Banhaten
|
|
3
|
+
Banhaten is an Arabic and English-first React design system with source-installed components, generated design tokens, and first-class RTL behavior. It uses a shadcn-style distribution model without copying shadcn visuals: components are built around Banhaten tokens, Banhaten component aliases, and Banhaten Figma-derived interaction patterns.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
Run the CLI from the root of a React app:
|
|
4
8
|
|
|
5
9
|
```bash
|
|
6
10
|
npx banhaten init
|
|
7
|
-
npx banhaten add button
|
|
8
|
-
npx banhaten add button-group
|
|
9
|
-
npx banhaten add menu
|
|
10
|
-
npx banhaten add modal
|
|
11
|
-
npx banhaten add checkbox
|
|
12
|
-
npx banhaten add radio-card
|
|
13
|
-
npx banhaten add divider
|
|
14
|
-
npx banhaten add pagination
|
|
15
|
-
npx banhaten add toolbar
|
|
16
|
-
npx banhaten add social-button
|
|
17
|
-
npx banhaten add input
|
|
18
|
-
npx banhaten add select
|
|
19
|
-
npx banhaten add date-picker
|
|
20
|
-
npx banhaten add slider
|
|
21
|
-
npx banhaten add progress
|
|
22
|
-
npx banhaten add progress-slider
|
|
23
|
-
npx banhaten add textarea
|
|
24
|
-
npx banhaten add toggle
|
|
25
|
-
npx banhaten add attribute
|
|
26
|
-
npx banhaten add card
|
|
27
|
-
npx banhaten add accordion
|
|
28
|
-
npx banhaten add avatar
|
|
29
|
-
npx banhaten add badge
|
|
30
|
-
npx banhaten add tag
|
|
31
|
-
npx banhaten add tooltip
|
|
11
|
+
npx banhaten add button input select
|
|
32
12
|
```
|
|
33
13
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
- A publishable `banhaten` CLI.
|
|
37
|
-
- Design-token CSS with light, dark, LTR, and RTL foundations.
|
|
38
|
-
- A complete Figma-matched `button` registry item using React, Radix Slot, CVA variants, reusable shadow tokens, icon placement attributes, and RTL directional-icon flipping.
|
|
39
|
-
- A Figma-matched `button-group` registry item with connected md/sm/xs rows, default and icon-only modes, dividers, reusable group shadow, RTL widths, native hover/focus/pressed styling, and active/disabled states.
|
|
40
|
-
- A Radix DropdownMenu-backed, Figma-matched `menu` registry item with the raised menu surface, default, multiline, call-to-action, progress, button, label, caption, and divider item compositions, plus badges, switches, avatars, actions, meta text, and RTL-safe slots.
|
|
41
|
-
- A Radix Dialog-backed, Figma-matched `modal` registry item with Small, Default, and Large sizes, tokenized raised surface, header/body/footer slots, ConfirmModal guardrails, Button actions, Checkbox opt-out, and RTL layout.
|
|
42
|
-
- A Figma-matched `checkbox` registry item with Radix checkbox behavior, a 20px root, 16px visual control, selected and disabled states, checkbox cards, component shadow, and RTL layout.
|
|
43
|
-
- A Figma-matched `radio-card` registry item with icon, payment, avatar, company, support-label, and label-only layouts across LTR/RTL with native hover styling plus active and disabled states.
|
|
44
|
-
- A Figma-matched `divider` registry item with horizontal and vertical directions, solid and dotted types, 1px stroke, 2px dash rhythm, and Color mode divider tokens.
|
|
45
|
-
- A Figma-matched `pagination` registry item with numeric, simple, and summary layouts, soft and ghost styles, exact 32px controls, captions, and RTL labels.
|
|
46
|
-
- A Figma-matched `toolbar` registry item with search, select triggers, filter actions, chips, selected-count badges, desktop/mobile wrapping, and RTL-safe composition.
|
|
47
|
-
- A Figma-matched `social-button` registry item for Apple, Facebook, Google, LinkedIn, Twitter (new), and WhatsApp sign-in buttons with solid, outlined, icon-only, native focus-visible, and RTL states.
|
|
48
|
-
- A token-built `attribute` registry item for semantic key-value rows, detail cards, alignment variants, copyable values, loading rows, and RTL layouts.
|
|
49
|
-
- A token-built `card` registry item with vertical, horizontal, full-image, mobile, footer action, and RTL surface use cases.
|
|
50
|
-
- An `avatar` registry item with image, fallback, badge, group, group count, size scale, and RTL-safe overlap.
|
|
51
|
-
- An `accordion` registry item with Radix disclosure behavior, variants, sizes, animation, and RTL-safe text alignment.
|
|
52
|
-
- A Figma-matched `badge` registry item with light, outline, and solid styles, semantic accent colors, dot, flag, icon, numeric, and RTL-safe composition.
|
|
53
|
-
- A Figma-matched `tag` registry item with simple, dot, flag, avatar, and icon types, default/active/disabled states, native hover/focus-visible styling, xs/md/lg sizes, optional close button, and RTL-safe composition.
|
|
54
|
-
- A Radix Switch-backed `toggle` registry item with sm/md geometry, active/disabled states, optional handle icons, labeled fields, supporting text, and RTL-safe label placement.
|
|
55
|
-
- A Figma-matched `textarea` registry item with label, helper text, error, default and tags modes, placeholder, filled, disabled, and RTL states.
|
|
56
|
-
- A Radix Select-backed, Figma-matched `select` registry item with default and soft triggers, error/filled/disabled states, menu surface, checkbox and check selection, and item media for text, icons, users, companies, payment methods, and status dots.
|
|
57
|
-
- A Figma-matched `date-picker` registry item with Calendar, Range Calendar, Date Picker, Date Range Picker, presets, time rows, open states, month/year view, and RTL.
|
|
58
|
-
- A Radix Slider-backed `slider` registry item with single, range, multi-thumb, text/tooltip indicators, ticks, vertical layout, pill treatment, tones, and RTL behavior.
|
|
59
|
-
- A read-only `progress` registry item with value meters, label placements, helper text, indicators, spinner, and RTL fill direction.
|
|
60
|
-
- A Radix-based `progress-slider` registry item with semantic tones, ticks, focus treatment, and RTL-aware keyboard behavior.
|
|
61
|
-
- A Radix Tooltip-backed `tooltip` registry item with dark/default variants, small/large sizes, pointer positions, shortcut and close slots, and RTL-safe layout.
|
|
62
|
-
- Token CSS generated from the local token exports in `tokens`, with the Banhaten alias layer kept in the same generated stylesheet.
|
|
63
|
-
- Inter as the single font family, loaded through `@fontsource/inter` weights 400, 500, 600, and 700.
|
|
64
|
-
- Figma-sourced typography tokens for all 43 local text styles across Display, Heading, and Body.
|
|
65
|
-
|
|
66
|
-
## Local Usage
|
|
67
|
-
|
|
68
|
-
From this repository:
|
|
14
|
+
When dependencies are added, the CLI prints the install command for your package manager.
|
|
69
15
|
|
|
70
16
|
```bash
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
node src/cli/index.js add modal --cwd ./playground
|
|
76
|
-
node src/cli/index.js add checkbox --cwd ./playground
|
|
77
|
-
node src/cli/index.js add radio-card --cwd ./playground
|
|
78
|
-
node src/cli/index.js add divider --cwd ./playground
|
|
79
|
-
node src/cli/index.js add pagination --cwd ./playground
|
|
80
|
-
node src/cli/index.js add toolbar --cwd ./playground
|
|
81
|
-
node src/cli/index.js add social-button --cwd ./playground
|
|
82
|
-
node src/cli/index.js add input --cwd ./playground
|
|
83
|
-
node src/cli/index.js add select --cwd ./playground
|
|
84
|
-
node src/cli/index.js add date-picker --cwd ./playground
|
|
85
|
-
node src/cli/index.js add slider --cwd ./playground
|
|
86
|
-
node src/cli/index.js add progress --cwd ./playground
|
|
87
|
-
node src/cli/index.js add progress-slider --cwd ./playground
|
|
88
|
-
node src/cli/index.js add textarea --cwd ./playground
|
|
89
|
-
node src/cli/index.js add toggle --cwd ./playground
|
|
90
|
-
node src/cli/index.js add attribute --cwd ./playground
|
|
91
|
-
node src/cli/index.js add card --cwd ./playground
|
|
92
|
-
node src/cli/index.js add accordion --cwd ./playground
|
|
93
|
-
node src/cli/index.js add avatar --cwd ./playground
|
|
94
|
-
node src/cli/index.js add badge --cwd ./playground
|
|
95
|
-
node src/cli/index.js add tag --cwd ./playground
|
|
96
|
-
node src/cli/index.js add tooltip --cwd ./playground
|
|
17
|
+
npm install
|
|
18
|
+
pnpm install
|
|
19
|
+
yarn install
|
|
20
|
+
bun install
|
|
97
21
|
```
|
|
98
22
|
|
|
99
|
-
|
|
23
|
+
## What Init Adds
|
|
100
24
|
|
|
101
|
-
|
|
102
|
-
npm --prefix playground install
|
|
103
|
-
npm run playground:dev
|
|
104
|
-
```
|
|
25
|
+
`banhaten init` writes:
|
|
105
26
|
|
|
106
|
-
|
|
27
|
+
- `banhaten.config.json` with schema-backed aliases.
|
|
28
|
+
- The base `cn` utility and `use-direction` hook.
|
|
29
|
+
- The generated Banhaten token stylesheet in your configured CSS file.
|
|
30
|
+
- Tailwind v4 and Vite alias setup when those files are detected.
|
|
31
|
+
- Required package dependencies.
|
|
107
32
|
|
|
108
|
-
|
|
109
|
-
npx banhaten init
|
|
110
|
-
npx banhaten add button
|
|
111
|
-
npx banhaten add button-group
|
|
112
|
-
npx banhaten add menu
|
|
113
|
-
npx banhaten add modal
|
|
114
|
-
npx banhaten add checkbox
|
|
115
|
-
npx banhaten add radio-card
|
|
116
|
-
npx banhaten add divider
|
|
117
|
-
npx banhaten add pagination
|
|
118
|
-
npx banhaten add toolbar
|
|
119
|
-
npx banhaten add social-button
|
|
120
|
-
npx banhaten add input
|
|
121
|
-
npx banhaten add select
|
|
122
|
-
npx banhaten add date-picker
|
|
123
|
-
npx banhaten add slider
|
|
124
|
-
npx banhaten add progress
|
|
125
|
-
npx banhaten add progress-slider
|
|
126
|
-
npx banhaten add textarea
|
|
127
|
-
npx banhaten add toggle
|
|
128
|
-
npx banhaten add attribute
|
|
129
|
-
npx banhaten add card
|
|
130
|
-
npx banhaten add accordion
|
|
131
|
-
npx banhaten add avatar
|
|
132
|
-
npx banhaten add badge
|
|
133
|
-
npx banhaten add tag
|
|
134
|
-
npx banhaten add tooltip
|
|
135
|
-
```
|
|
33
|
+
`banhaten add` and `banhaten update` also refresh the generated token stylesheet, so installed projects receive token changes as the registry evolves.
|
|
136
34
|
|
|
137
|
-
|
|
35
|
+
## CLI
|
|
138
36
|
|
|
139
37
|
```bash
|
|
140
|
-
|
|
38
|
+
npx banhaten init [--cwd <path>] [--force] [--dry-run]
|
|
39
|
+
npx banhaten add <component...> [--cwd <path>] [--force] [--dry-run]
|
|
40
|
+
npx banhaten diff [component...] [--cwd <path>] [--force]
|
|
41
|
+
npx banhaten update [component...] [--cwd <path>] [--force] [--dry-run]
|
|
42
|
+
npx banhaten list [--json]
|
|
43
|
+
npx banhaten search <query> [--json]
|
|
44
|
+
npx banhaten docs <component> [--json]
|
|
45
|
+
npx banhaten view <component> [--file <registry-source>] [--json]
|
|
46
|
+
npx banhaten version
|
|
141
47
|
```
|
|
142
48
|
|
|
143
|
-
|
|
49
|
+
Global flags:
|
|
50
|
+
|
|
51
|
+
- `--cwd <path>` runs against another project directory.
|
|
52
|
+
- `--dry-run` previews writes.
|
|
53
|
+
- `--force` rewrites generated files even when already current.
|
|
54
|
+
- `--json` prints machine-readable output where supported.
|
|
55
|
+
- `--silent` or `-s` suppresses normal command output.
|
|
56
|
+
- `--yes` or `-y` is accepted for non-interactive scripts.
|
|
57
|
+
- `--version` or `-v` prints the CLI version.
|
|
58
|
+
|
|
59
|
+
## Generated File Ownership
|
|
144
60
|
|
|
145
|
-
|
|
61
|
+
Banhaten is a source registry. Installed component files are generated from the registry and are replaceable by `banhaten add` or `banhaten update` when registry content differs.
|
|
62
|
+
|
|
63
|
+
Use `banhaten diff` before updating if you edit generated component files locally:
|
|
146
64
|
|
|
147
65
|
```bash
|
|
148
|
-
npx banhaten
|
|
149
|
-
npx banhaten
|
|
150
|
-
npm install
|
|
66
|
+
npx banhaten diff
|
|
67
|
+
npx banhaten update button
|
|
151
68
|
```
|
|
152
69
|
|
|
153
|
-
|
|
70
|
+
Keep product-specific composition outside generated files when possible. Use local wrapper components for app behavior and keep Banhaten files focused on tokens, layout, accessibility primitives, and direction behavior.
|
|
154
71
|
|
|
155
|
-
##
|
|
72
|
+
## Tokens
|
|
156
73
|
|
|
157
|
-
|
|
74
|
+
Every component must style through Banhaten CSS variables, component aliases, or documented exception-ledger values. Raw colors, pixel values, opacity utilities, z-index utilities, durations, and shadow literals are blocked by the component token check.
|
|
158
75
|
|
|
159
|
-
|
|
160
|
-
@import "tailwindcss";
|
|
161
|
-
```
|
|
76
|
+
Token modes:
|
|
162
77
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
```json
|
|
168
|
-
{
|
|
169
|
-
"tailwind": {
|
|
170
|
-
"css": "src/app/globals.css"
|
|
171
|
-
},
|
|
172
|
-
"aliases": {
|
|
173
|
-
"ui": "@/components/ui",
|
|
174
|
-
"utils": "@/lib/utils",
|
|
175
|
-
"hooks": "@/hooks"
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
```
|
|
78
|
+
- Color mode: light and dark.
|
|
79
|
+
- Brand theme: `blue`, `gray`, `brown`, `orange`, `green`, `purple`, `teal`.
|
|
80
|
+
- Radius mode: `default`, `rounded`, `sharp`.
|
|
81
|
+
- Direction: inherited LTR or RTL, with component-level `dir` support where needed.
|
|
179
82
|
|
|
180
|
-
|
|
83
|
+
Example:
|
|
181
84
|
|
|
182
|
-
|
|
85
|
+
```tsx
|
|
86
|
+
<html className="dark" data-theme="brown" data-radius="rounded" dir="rtl" lang="ar">
|
|
87
|
+
```
|
|
183
88
|
|
|
184
|
-
|
|
89
|
+
Typography utilities are generated as `.bh-text-*` classes and map directly to token variables.
|
|
185
90
|
|
|
186
91
|
```tsx
|
|
187
92
|
<h1 className="bh-text-heading-xl-bold">...</h1>
|
|
188
93
|
<p className="bh-text-body-md-regular">...</p>
|
|
189
|
-
<button className="bh-text-button">...</button>
|
|
190
94
|
```
|
|
191
95
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
## Theming
|
|
96
|
+
## Registry Formats
|
|
195
97
|
|
|
196
|
-
Banhaten
|
|
98
|
+
Banhaten maintains two registry artifacts:
|
|
197
99
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
```
|
|
100
|
+
- `registry/index.json` is the Banhaten source of truth used by the Banhaten CLI. It includes rich metadata for RTL behavior, parts, examples, files, and dependencies.
|
|
101
|
+
- `registry.json` is a generated shadcn-compatible export for tools that expect the public shadcn registry schema.
|
|
201
102
|
|
|
202
|
-
|
|
203
|
-
- Brand theme: set `data-theme` to `blue`, `gray`, `brown`, `orange`, `green`, `purple`, or `teal`.
|
|
204
|
-
- Radius mode: set `data-radius` to `default`, `rounded`, or `sharp`.
|
|
205
|
-
- Direction: set `dir` to `ltr` or `rtl`; components prefer explicit `dir` props for nested direction changes.
|
|
206
|
-
|
|
207
|
-
## Component API Quick Reference
|
|
208
|
-
|
|
209
|
-
| Component | Primary props |
|
|
210
|
-
| --- | --- |
|
|
211
|
-
| `Button` | `variant`, `size`, `asChild`, `loading`, `data-icon`, `data-rtl-flip` |
|
|
212
|
-
| `ButtonGroup` | `size`, `mode`, `dir`; `ButtonGroupItem` supports `active`, `disabled`, `aria-label` |
|
|
213
|
-
| `Attribute` | `layout`, `density`, `dividers`, `bordered`, `labelWidth`, rich value slots |
|
|
214
|
-
| `Card` | `orientation`, `type`, `breakpoint`, `dir`, `title`, `description`, footer/media slots |
|
|
215
|
-
| `Input` | `kind`, `size`, `variant`, `state`, `dir`, `label`, `message`, `hasHelperText` |
|
|
216
|
-
| `Select` | `size`, `variant`, `state`, `open`, `dir`, `value`, `label`, `SelectMenuItem` |
|
|
217
|
-
| `DatePicker` | `Calendar`, `RangeCalendar`, `DatePicker`, `DateRangePicker`, `view`, `type`, `dir` |
|
|
218
|
-
| `Menu` | `width`; `MenuItem` supports `kind`, `disabled`, slotted icons, badges, actions, and progress |
|
|
219
|
-
| `Modal` | `size`, `dir`, `title`, `description`, `showIcon`, `showCloseButton`, `showDivider`, `showFooter`, `showCheckbox`, `footer`; `ConfirmModal` adds `intent`, `confirmLabel`, `confirmLoading`, `preventOutsideDismiss` |
|
|
220
|
-
| `Pagination` | `type`, `variant`, `dir`, `page`, `totalPages`, `labels` |
|
|
221
|
-
| `Progress` | `value`, `min`, `max`, `size`, `labelPosition`, `helperText`, `showIndicator`, `showSpinner` |
|
|
222
|
-
| `Slider` | `value`, `defaultValue`, `tone`, `size`, `variant`, `orientation`, `showTicks` |
|
|
223
|
-
| `ProgressSlider` | `value`, `defaultValue`, `tone`, `size`, `showTicks`, `ariaValueText` |
|
|
224
|
-
| `Toggle` | `size`, `showIcon`, `disabled`; `ToggleField` supports `controlPosition`, `label`, `description` |
|
|
225
|
-
| `Toolbar` | `layout`, `wrap`; slots include `ToolbarSearch`, `ToolbarSelect`, `ToolbarButton`, `ToolbarBadge` |
|
|
226
|
-
| `Tooltip` | `variant`, `size`, `pointerPosition`, `showPointer`, `supportText`, shortcut/close slots |
|
|
227
|
-
| `Checkbox` | Radix checkbox props, plus `CheckboxCard` for labeled card layouts |
|
|
228
|
-
| `Badge` / `Tag` | `color`, `type`, `size`, `dir`; `Tag` also supports `showCloseButton` |
|
|
229
|
-
|
|
230
|
-
## Updating Installed Components
|
|
231
|
-
|
|
232
|
-
Check for local drift without writing files:
|
|
103
|
+
Regenerate the shadcn-compatible export after registry changes:
|
|
233
104
|
|
|
234
105
|
```bash
|
|
235
|
-
|
|
236
|
-
npx banhaten diff button
|
|
106
|
+
npm run registry:export
|
|
237
107
|
```
|
|
238
108
|
|
|
239
|
-
|
|
109
|
+
## Documentation
|
|
110
|
+
|
|
111
|
+
Primary docs live in the playground and render live registry-backed previews, install commands, source snippets, API tables, registry files, RTL behavior, and copyable code panels.
|
|
112
|
+
|
|
113
|
+
Markdown docs live in `docs/design-system/components`. They are checked for install, API, examples, token contract, RTL rules, and accessibility sections.
|
|
114
|
+
|
|
115
|
+
Useful commands:
|
|
240
116
|
|
|
241
117
|
```bash
|
|
242
|
-
|
|
243
|
-
|
|
118
|
+
npm run docs:check
|
|
119
|
+
npm run docs:normalize
|
|
120
|
+
npm run playground:dev
|
|
244
121
|
```
|
|
245
122
|
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
## Component Phases
|
|
249
|
-
|
|
250
|
-
Phase 1 focuses on the foundation and Button:
|
|
251
|
-
|
|
252
|
-
- Button variants: `default`, `secondary`, `soft`, `outline`, `ghost`, `ghost-primary`, `danger`, `soft-danger`, `white`.
|
|
253
|
-
- Backward-compatible aliases: `destructive`, `soft-destructive`, and `link`.
|
|
254
|
-
- Button sizes: `xs` 32px, `sm` 36px, `default` 40px, `lg` 48px, plus icon-only equivalents.
|
|
255
|
-
- Button typography: Figma text style `Body/body-md (base)/medium` using Inter Medium, 15px font size, 24px line height, and 0px letter spacing.
|
|
256
|
-
- Base typography: Figma text style `Body/body-md (base)/regular` using Inter Regular, 15px font size, 24px line height, and 0px letter spacing.
|
|
257
|
-
- Button shadows: `--shadow-button-raised`, `--shadow-button-surface`, `--shadow-button-secondary`, `--shadow-button-secondary-focus`, `--shadow-button-soft`, `--shadow-button-focus`, and `--shadow-button-danger-focus`.
|
|
258
|
-
- Icon placement: add `data-icon="inline-start"` or `data-icon="inline-end"` to icons.
|
|
259
|
-
- RTL directional icons: add `data-rtl-flip="true"` to arrows and chevrons that should mirror.
|
|
260
|
-
- Loading composition: use the generated `Spinner` inside `Button` instead of an `isLoading` prop.
|
|
261
|
-
|
|
262
|
-
Current social primitives:
|
|
263
|
-
|
|
264
|
-
- Button Group modes: `default` and `iconOnly`.
|
|
265
|
-
- Button Group sizes: `md` 40px, `sm` 36px, and `xs` 32px.
|
|
266
|
-
- Button Group default item widths: `md` 128px, `sm` 120px, and `xs` 112px in LTR; `md` 124px, `sm` 116px, and `xs` 108px in RTL. Icon-only groups stay square at `40px`, `36px`, and `32px`.
|
|
267
|
-
- Button Group states: default and disabled are transparent; hover uses `--bh-interactive-ghost-hover`; pressed and active use the stronger ghost fill; active upgrades content to `--bh-content-default`.
|
|
268
|
-
- Button Group typography: Figma text style `Body/body-md (base)/medium` using Inter Medium, 15px font size, 24px line height, and 0px letter spacing.
|
|
269
|
-
- Button Group shadows: `--shadow-button-group`, `--shadow-button-group-focus-ring`, and `--shadow-button-group-focus`.
|
|
270
|
-
- Button Group dividers: 1px logical separators using `--bh-button-group-divider`, with the outer 1px border using `--bh-button-group-border`.
|
|
271
|
-
|
|
272
|
-
- Menu width: 228px for the raised surface, with 355px default-item, 402px multiline-item, and 240px call-to-action item variants matching the Figma component set.
|
|
273
|
-
- Menu item types: `default`, `multiline`, `action`, `progress`, `button`, plus `MenuLabel`, `MenuCaption`, and `MenuSeparator` for non-interactive rows.
|
|
274
|
-
- Menu behavior: `MenuRoot`, `MenuTrigger`, `MenuContent`, `MenuItem`, `MenuLabel`, and `MenuSeparator` are backed by Radix DropdownMenu primitives for roving focus, Escape, click-outside dismissal, and screen-reader roles.
|
|
275
|
-
- Menu slots: leading and trailing icons, avatar, text, description, meta text, badge, switch, outline action, progress bar, and RTL-flipping directional icons.
|
|
276
|
-
- Menu tokens: all colors, typography, radius, spacing, border, and elevation resolve through the Banhaten CSS variables, including `--shadow-menu`.
|
|
277
|
-
|
|
278
|
-
- Social Button platforms: `apple`, `facebook`, `google`, `linkedin`, `twitter`, `whatsapp`.
|
|
279
|
-
- Social Button variants: `solid` and `outline`.
|
|
280
|
-
- Social Button sizes: `default` 36px height and `icon` 36px square.
|
|
281
|
-
- Social Button typography: Figma text style `Body/body-md (base)/medium` using Inter Medium, 15px font size, 24px line height, and 0px letter spacing.
|
|
282
|
-
- Social Button shadows: `--shadow-social-button`, `--shadow-social-button-focus-ring`, and `--shadow-social-button-focus`.
|
|
283
|
-
- Social Button focus: Figma 4px outside blue ring at 30% opacity, combined with the social button surface shadow.
|
|
284
|
-
- Social Button RTL: Arabic platform labels are included and can be passed through the `label` prop for nested RTL surfaces.
|
|
285
|
-
|
|
286
|
-
- Pagination types: `numeric`, `simple`, and `summary`.
|
|
287
|
-
- Pagination styles: `soft` and `ghost`.
|
|
288
|
-
- Pagination dimensions: numeric rows use 560px, simple and summary rows use 458px, controls are 32px, and icons are 20px.
|
|
289
|
-
- Pagination typography: Figma text style `Body/body-md (base)` using Inter 15px, 24px line height, and 0px letter spacing.
|
|
290
|
-
- Pagination shadows: `--shadow-pagination-control`, `--shadow-pagination-active`, and `--shadow-pagination-focus`.
|
|
291
|
-
- Pagination RTL: pass `dir="rtl"` or set the document direction to render Arabic labels and mirrored directional arrows.
|
|
292
|
-
|
|
293
|
-
Phase 2 expands the registry into the rest of the system: form controls, overlays, navigation, feedback, data display, layout primitives, and typography.
|
|
294
|
-
|
|
295
|
-
Current layout primitives:
|
|
296
|
-
|
|
297
|
-
- Accordion variants: `default`, `bordered`, `cards`, `soft`.
|
|
298
|
-
- Accordion sizes: `sm`, `default`, `lg`.
|
|
299
|
-
- Accordion modes: Radix `type="single"` and `type="multiple"` are supported.
|
|
300
|
-
- Divider directions: `horizontal` and `vertical`.
|
|
301
|
-
- Divider types: `solid` and `dotted`.
|
|
302
|
-
- Divider color: `--bh-border-subtle`, resolving from the Figma `Color mode / border/subtle` variable.
|
|
303
|
-
- Divider geometry: 1px stroke via `--bh-space-xxxs-1`, 2px dash/gap via `--bh-space-xxs-2`, and 224px Figma component length via `--bh-space-15xl-224`.
|
|
304
|
-
|
|
305
|
-
Current data-display primitives:
|
|
306
|
-
|
|
307
|
-
- Badge styles: `light`, `outline`, `solid`.
|
|
308
|
-
- Badge colors: `neutral`, `blue`, `green`, `amber`, `danger`, `purple`, `fuchsia`, `rose`, `sky`, `golden`.
|
|
309
|
-
- Badge types: `default`, `leading-icon`, `trailing-icon`, `dot`, `flag`, plus `showNumber` for numeric badges.
|
|
310
|
-
- Badge sizes: `sm` 24px and `lg` 28px. `xs` and `default` remain accepted as compatibility aliases.
|
|
311
|
-
- Badge icons: set `type="leading-icon"` or `type="trailing-icon"` and add `data-icon="inline-start"` or `data-icon="inline-end"` to icons and spinners.
|
|
312
|
-
- Badge compatibility: the previous `variant` values are still accepted and mapped onto the new Figma axes.
|
|
313
|
-
- Tag types: `simple`, `dot`, `flag`, `avatar`, and `icon`, with optional `showCloseButton`.
|
|
314
|
-
- Tag states: `default`, `active`, and `disabled`, with native hover and focus-visible styling resolving through Banhaten tokens.
|
|
315
|
-
- Tag sizes: `xs` 24px, `md` 28px, and `lg` 36px using `Body/body-xs`, `Body/body-sm`, and `Body/body-md (base)` medium text styles.
|
|
316
|
-
- Tag RTL: pass `dir="rtl"` or inherit document direction; logical padding mirrors leading media, label, and close-button placement.
|
|
317
|
-
- Attribute layouts: `inline`, `end`, `stacked`, and `two-column` with compact/default/comfortable densities.
|
|
318
|
-
- Card layouts: vertical, horizontal, full-image, and mobile spacing variants with Button-composed actions.
|
|
319
|
-
|
|
320
|
-
Current form primitives:
|
|
321
|
-
|
|
322
|
-
- Checkbox primitive: 20px interactive root, 16px centered control, 12px `check-fill` icon, 4px radius, `Shadow/component/default`, and Color mode checkbox tokens.
|
|
323
|
-
- Checkbox Card: 338px Figma width, 16px padding, 16px card gap, 12px content gap, selected 2px brand border, hover raised background, disabled background/border/content tokens, and RTL-safe start/end control placement.
|
|
324
|
-
- Radio Card: 338px Figma width, 16px padding, 10px card gap, 10px radius, 20px radio wrapper, 16px radio control, selected 6px dot, raised/card and control shadows, and design-system color and typography tokens.
|
|
325
|
-
- Toggle sizes: `sm` and `md`, with optional handle icons and `ToggleField` leading/trailing label compositions.
|
|
326
|
-
- Date Picker modes: single calendar, month/year view, double range calendar, preset list, date picker, and date range picker.
|
|
327
|
-
- Slider modes: single value, range, multi-thumb, ticked, vertical, pill, text indicator, tooltip indicator, and RTL.
|
|
328
|
-
- Textarea modes: `default` and `tags`.
|
|
329
|
-
- Textarea states: `placeholder`, `filled`, and `disabled`; `hasError` switches the border and helper text to the danger tokens.
|
|
330
|
-
- Textarea typography: labels use `Body/body-sm/medium`, body text uses `Body/body-md (base)/regular`, and helper/tag text uses `Body/body-xs`.
|
|
331
|
-
- Textarea dimensions: 320px default width, 80px minimum input surface, 10px surface padding, 8px field gap, and 8px radius from the Figma component set.
|
|
332
|
-
- Textarea RTL: pass `dir="rtl"` or inherit document direction so label, helper, and tag-chip ordering mirrors without physical left/right styling.
|
|
333
|
-
|
|
334
|
-
## Token Source
|
|
335
|
-
|
|
336
|
-
The current source of truth is the local token exports:
|
|
337
|
-
|
|
338
|
-
- `tokens/Color mode.zip`
|
|
339
|
-
- `tokens/Theme.zip`
|
|
340
|
-
- `tokens/Numbers.zip`
|
|
341
|
-
- `tokens/Radius.zip`
|
|
342
|
-
|
|
343
|
-
`registry/styles/globals.css` maps those exports into Banhaten semantic CSS variables, including light/dark color mode, Blue/Gray/Brown/Orange/Green/Purple/Teal brand themes, and Default/Rounded/Sharp radius modes.
|
|
344
|
-
|
|
345
|
-
Run `npm run tokens:build` after updating `tokens/banhaten.tokens.json`; it regenerates the JSON-backed token declarations while preserving local component aliases and utilities. Run `npm run tokens:check` before committing token changes. The check verifies generated CSS drift, token source files, theme/radius selectors, shadcn aliases, generated `--bh-*` variables, and retired typo tokens.
|
|
346
|
-
|
|
347
|
-
## Direction
|
|
348
|
-
|
|
349
|
-
Banhaten assumes UI can run in either direction:
|
|
123
|
+
## Components
|
|
350
124
|
|
|
351
|
-
|
|
352
|
-
<html lang="ar" dir="rtl">
|
|
353
|
-
```
|
|
125
|
+
The registry includes core primitives such as Button, Input, Select, Field, Modal, Sheet, Sidebar, Menu, Tabs, Toast, Table, and Chart. It also includes Banhaten-specific and product-oriented components such as Attribute, Radio Card, Progress Slider, Social Button, Tag, Toolbar, Timeline, Banner, File Upload, Page Header, Command Bar, Slideout, Activity Feed, and Steps.
|
|
354
126
|
|
|
355
|
-
|
|
127
|
+
Expanded components are larger app compositions. They are installed through the same CLI but documented as a separate tier because their layout contracts are broader than primitive controls.
|
|
356
128
|
|
|
357
|
-
|
|
358
|
-
|
|
129
|
+
## Development
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
npm run check
|
|
133
|
+
npm run tokens:check
|
|
134
|
+
npm run registry:check
|
|
135
|
+
npm run playground:test
|
|
359
136
|
```
|
|
360
137
|
|
|
361
|
-
|
|
138
|
+
The full check verifies CLI behavior, generated token CSS, token contract, raw token violations, registry mirrors, shadcn-compatible registry export, markdown docs, and playground coverage.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Banhaten Design System Docs
|
|
2
|
+
|
|
3
|
+
Use these docs with the live playground.
|
|
4
|
+
|
|
5
|
+
- [Registry and CLI](./registry-and-cli.md): registry formats, generated-file ownership, CLI commands, and schema behavior.
|
|
6
|
+
- [Token Governance](./token-governance.md): token-only component rules, exception ledger, and public override surface.
|
|
7
|
+
- [Appearance Presets](./appearance-presets.md): theme and radius mode guidance.
|
|
8
|
+
- [Components](./components/README.md): component markdown catalog.
|
|
9
|
+
- [Icon System](./icons.md): icon guidance and explorer notes.
|
|
10
|
+
|
|
11
|
+
The playground remains the primary documentation surface because it renders live registry-backed previews, source snippets, copyable code panels, API tables, file links, and RTL behavior.
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
# Appearance Presets
|
|
2
|
+
|
|
3
|
+
Appearance presets change the feel of the design system without changing component APIs.
|
|
4
|
+
|
|
5
|
+
Components keep semantic variants such as `primary`, `secondary`, `subtle`, `danger`, and `ghost`. Presets decide how those meanings look through design tokens: color, radius, density, border, and elevation.
|
|
6
|
+
|
|
7
|
+
## Presets
|
|
8
|
+
|
|
9
|
+
- `default`: The baseline product UI. Gray application background, white cards, modest radius, conservative spacing.
|
|
10
|
+
- `rounded`: A softer UI. White application background, stronger radius, relaxed spacing, gentler separation.
|
|
11
|
+
- `sharp`: A precise UI. Square edges, tighter spacing, clearer borders, minimal elevation.
|
|
12
|
+
|
|
13
|
+
Each preset has its own markdown file:
|
|
14
|
+
|
|
15
|
+
- [Default](./appearances/default.md)
|
|
16
|
+
- [Rounded](./appearances/rounded.md)
|
|
17
|
+
- [Sharp](./appearances/sharp.md)
|
|
18
|
+
|
|
19
|
+
Component specs:
|
|
20
|
+
|
|
21
|
+
- [Icons](./icons.md)
|
|
22
|
+
- [Tabs](./tabs.md)
|
|
23
|
+
- [Tag](./components/tag.md)
|
|
24
|
+
- [Timeline](./components/timeline.md)
|
|
25
|
+
|
|
26
|
+
Component guidance lives in:
|
|
27
|
+
|
|
28
|
+
- [Components](./components/README.md)
|
|
29
|
+
- [Banner](./components/banner.md)
|
|
30
|
+
- [Breadcrumbs](./components/breadcrumbs.md)
|
|
31
|
+
- [Divider](./components/divider.md)
|
|
32
|
+
- [File Upload](./components/file-upload.md)
|
|
33
|
+
- [Tag](./components/tag.md)
|
|
34
|
+
- [Timeline](./components/timeline.md)
|
|
35
|
+
|
|
36
|
+
## Token Contract
|
|
37
|
+
|
|
38
|
+
The design system should use semantic tokens instead of importing naming patterns from a framework. Tokens describe where they are used, not how they happen to look in one theme.
|
|
39
|
+
|
|
40
|
+
### Content
|
|
41
|
+
|
|
42
|
+
`content` tokens apply to text and icons.
|
|
43
|
+
|
|
44
|
+
- `content.default`
|
|
45
|
+
- `content.primary`
|
|
46
|
+
- `content.subtle`
|
|
47
|
+
- `content.muted`
|
|
48
|
+
- `content.disabled`
|
|
49
|
+
- `content.inverse`
|
|
50
|
+
- `content.link`
|
|
51
|
+
- `content.linkHover`
|
|
52
|
+
- `content.onColor`
|
|
53
|
+
- `content.onLight`
|
|
54
|
+
- `content.onBrand`
|
|
55
|
+
- `content.success`
|
|
56
|
+
- `content.warning`
|
|
57
|
+
- `content.danger`
|
|
58
|
+
|
|
59
|
+
### Background
|
|
60
|
+
|
|
61
|
+
`background` tokens apply to page, layout, component, and interactive fills.
|
|
62
|
+
|
|
63
|
+
- `background.app`
|
|
64
|
+
- `background.default`
|
|
65
|
+
- `background.card`
|
|
66
|
+
- `background.subtle`
|
|
67
|
+
- `background.muted`
|
|
68
|
+
- `background.disabled`
|
|
69
|
+
- `background.inverse`
|
|
70
|
+
- `background.overlay`
|
|
71
|
+
- `background.brand`
|
|
72
|
+
- `background.brandHover`
|
|
73
|
+
- `background.brandPressed`
|
|
74
|
+
- `background.selected`
|
|
75
|
+
- `background.hover`
|
|
76
|
+
- `background.pressed`
|
|
77
|
+
- `background.success`
|
|
78
|
+
- `background.warning`
|
|
79
|
+
- `background.danger`
|
|
80
|
+
|
|
81
|
+
### Border
|
|
82
|
+
|
|
83
|
+
`border` tokens apply to component outlines, dividers, focus states, and validation states.
|
|
84
|
+
|
|
85
|
+
- `border.default`
|
|
86
|
+
- `border.subtle`
|
|
87
|
+
- `border.strong`
|
|
88
|
+
- `border.disabled`
|
|
89
|
+
- `border.focus`
|
|
90
|
+
- `border.brand`
|
|
91
|
+
- `border.success`
|
|
92
|
+
- `border.warning`
|
|
93
|
+
- `border.danger`
|
|
94
|
+
|
|
95
|
+
### Shape
|
|
96
|
+
|
|
97
|
+
`shape` tokens control radius by usage, not component name.
|
|
98
|
+
|
|
99
|
+
- `shape.action`
|
|
100
|
+
- `shape.control`
|
|
101
|
+
- `shape.card`
|
|
102
|
+
- `shape.panel`
|
|
103
|
+
- `shape.modal`
|
|
104
|
+
- `shape.popover`
|
|
105
|
+
- `shape.badge`
|
|
106
|
+
- `shape.avatar`
|
|
107
|
+
|
|
108
|
+
### Density
|
|
109
|
+
|
|
110
|
+
`density` tokens control repeated spacing and sizing decisions.
|
|
111
|
+
|
|
112
|
+
- `density.controlHeight`
|
|
113
|
+
- `density.controlPaddingX`
|
|
114
|
+
- `density.cardPadding`
|
|
115
|
+
- `density.panelPadding`
|
|
116
|
+
- `density.sectionGap`
|
|
117
|
+
- `density.listRowHeight`
|
|
118
|
+
- `density.tableRowHeight`
|
|
119
|
+
|
|
120
|
+
### Elevation
|
|
121
|
+
|
|
122
|
+
`elevation` tokens control shadows and stacking treatment.
|
|
123
|
+
|
|
124
|
+
- `elevation.card`
|
|
125
|
+
- `elevation.panel`
|
|
126
|
+
- `elevation.popover`
|
|
127
|
+
- `elevation.modal`
|
|
128
|
+
- `elevation.none`
|
|
129
|
+
|
|
130
|
+
## Component Rule
|
|
131
|
+
|
|
132
|
+
Components consume semantic tokens and component-scoped aliases. They must not hard-code preset-specific values or Figma fallback literals in component source.
|
|
133
|
+
|
|
134
|
+
If a Figma reference exposes a literal color, size, radius, shadow, or opacity, promote it into the generated token contract or a component-level `--bh-*` alias in `registry/styles/globals.css`, then consume that token from the component. Component docs may record Figma references for audit and QA, but those literals are not implementation fallbacks.
|
|
135
|
+
|
|
136
|
+
Good:
|
|
137
|
+
|
|
138
|
+
```tsx
|
|
139
|
+
<Button variant="primary" />
|
|
140
|
+
<Card />
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Avoid:
|
|
144
|
+
|
|
145
|
+
```tsx
|
|
146
|
+
<Button rounded />
|
|
147
|
+
<Card sharp />
|
|
148
|
+
<Card className="rounded-[16px]" />
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
The preset is selected at the design-system root:
|
|
152
|
+
|
|
153
|
+
```tsx
|
|
154
|
+
<DesignSystemProvider appearance="default">
|
|
155
|
+
<App />
|
|
156
|
+
</DesignSystemProvider>
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
or through a root attribute:
|
|
160
|
+
|
|
161
|
+
```html
|
|
162
|
+
<body data-appearance="default">
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
## Preset Responsibilities
|
|
166
|
+
|
|
167
|
+
An appearance preset may change:
|
|
168
|
+
|
|
169
|
+
- Page and layout background treatment
|
|
170
|
+
- Card and panel background treatment
|
|
171
|
+
- Radius for actions, controls, cards, modals, popovers, badges, and tabs
|
|
172
|
+
- Component density and padding
|
|
173
|
+
- Border prominence
|
|
174
|
+
- Elevation and shadow strength
|
|
175
|
+
- Hover, pressed, selected, and disabled treatment
|
|
176
|
+
|
|
177
|
+
An appearance preset should not change:
|
|
178
|
+
|
|
179
|
+
- Component behavior
|
|
180
|
+
- Component variant names
|
|
181
|
+
- Accessibility requirements
|
|
182
|
+
- Interaction contracts
|
|
183
|
+
- Information hierarchy
|
|
184
|
+
- Meaning of semantic color roles
|