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
package/README.md
CHANGED
|
@@ -1,373 +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
4
|
|
|
5
|
-
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
Run the CLI from the root of a React app:
|
|
8
|
+
|
|
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 autocomplete
|
|
20
|
-
npx banhaten add date-picker
|
|
21
|
-
npx banhaten add slider
|
|
22
|
-
npx banhaten add skeleton
|
|
23
|
-
npx banhaten add progress
|
|
24
|
-
npx banhaten add progress-slider
|
|
25
|
-
npx banhaten add textarea
|
|
26
|
-
npx banhaten add toggle
|
|
27
|
-
npx banhaten add attribute
|
|
28
|
-
npx banhaten add card
|
|
29
|
-
npx banhaten add accordion
|
|
30
|
-
npx banhaten add avatar
|
|
31
|
-
npx banhaten add badge
|
|
32
|
-
npx banhaten add tag
|
|
33
|
-
npx banhaten add tooltip
|
|
11
|
+
npx banhaten add button input select
|
|
34
12
|
```
|
|
35
13
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
- 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.
|
|
44
|
-
- 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.
|
|
45
|
-
- 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.
|
|
46
|
-
- 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.
|
|
47
|
-
- A Figma-matched `pagination` registry item with numeric, simple, and summary layouts, soft and ghost styles, exact 32px controls, captions, and RTL labels.
|
|
48
|
-
- A Figma-matched `toolbar` registry item with search, select triggers, filter actions, chips, selected-count badges, desktop/mobile wrapping, and RTL-safe composition.
|
|
49
|
-
- 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.
|
|
50
|
-
- A token-built `attribute` registry item for semantic key-value rows, detail cards, alignment variants, copyable values, loading rows, and RTL layouts.
|
|
51
|
-
- A token-built `card` registry item with vertical, horizontal, full-image, mobile, footer action, and RTL surface use cases.
|
|
52
|
-
- An `avatar` registry item with image, fallback, badge, group, group count, size scale, and RTL-safe overlap.
|
|
53
|
-
- An `accordion` registry item with Radix disclosure behavior, variants, sizes, animation, and RTL-safe text alignment.
|
|
54
|
-
- A Figma-matched `badge` registry item with light, outline, and solid styles, semantic accent colors, dot, flag, icon, numeric, and RTL-safe composition.
|
|
55
|
-
- 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.
|
|
56
|
-
- 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.
|
|
57
|
-
- A Figma-matched `textarea` registry item with label, helper text, error, default and tags modes, placeholder, filled, disabled, and RTL states.
|
|
58
|
-
- 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.
|
|
59
|
-
- A composed `autocomplete` registry item with Input field anatomy, Select menu rows, Tag selections, filtering, keyboard navigation, controlled state, and RTL layout.
|
|
60
|
-
- 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.
|
|
61
|
-
- A Radix Slider-backed `slider` registry item with single, range, multi-thumb, text/tooltip indicators, ticks, vertical layout, pill treatment, tones, and RTL behavior.
|
|
62
|
-
- A token-built `skeleton` registry item with primitive, text, avatar, button, input, card, list, table, form, shimmer, reduced-motion, and RTL loading compositions.
|
|
63
|
-
- A read-only `progress` registry item with value meters, label placements, helper text, indicators, spinner, and RTL fill direction.
|
|
64
|
-
- A Radix-based `progress-slider` registry item with semantic tones, ticks, focus treatment, and RTL-aware keyboard behavior.
|
|
65
|
-
- A `spinner` registry item with steady `Spinner`, variable-arc `DynamicSpinner`, inherited text color, and CSS variable sizing.
|
|
66
|
-
- A Radix Tooltip-backed `tooltip` registry item with dark/default variants, small/large sizes, pointer positions, shortcut and close slots, and RTL-safe layout.
|
|
67
|
-
- Token CSS generated from the local token exports in `tokens`, with the Banhaten alias layer kept in the same generated stylesheet.
|
|
68
|
-
- Inter as the single font family, loaded through `@fontsource/inter` weights 400, 500, 600, and 700.
|
|
69
|
-
- Figma-sourced typography tokens for all 43 local text styles across Display, Heading, and Body.
|
|
70
|
-
|
|
71
|
-
## Local Usage
|
|
72
|
-
|
|
73
|
-
From this repository:
|
|
74
|
-
|
|
75
|
-
```text
|
|
76
|
-
node src/cli/index.js init --cwd ./playground
|
|
77
|
-
node src/cli/index.js add button --cwd ./playground
|
|
78
|
-
node src/cli/index.js add button-group --cwd ./playground
|
|
79
|
-
node src/cli/index.js add menu --cwd ./playground
|
|
80
|
-
node src/cli/index.js add modal --cwd ./playground
|
|
81
|
-
node src/cli/index.js add checkbox --cwd ./playground
|
|
82
|
-
node src/cli/index.js add radio-card --cwd ./playground
|
|
83
|
-
node src/cli/index.js add divider --cwd ./playground
|
|
84
|
-
node src/cli/index.js add pagination --cwd ./playground
|
|
85
|
-
node src/cli/index.js add toolbar --cwd ./playground
|
|
86
|
-
node src/cli/index.js add social-button --cwd ./playground
|
|
87
|
-
node src/cli/index.js add input --cwd ./playground
|
|
88
|
-
node src/cli/index.js add select --cwd ./playground
|
|
89
|
-
node src/cli/index.js add autocomplete --cwd ./playground
|
|
90
|
-
node src/cli/index.js add date-picker --cwd ./playground
|
|
91
|
-
node src/cli/index.js add slider --cwd ./playground
|
|
92
|
-
node src/cli/index.js add skeleton --cwd ./playground
|
|
93
|
-
node src/cli/index.js add spinner --cwd ./playground
|
|
94
|
-
node src/cli/index.js add progress --cwd ./playground
|
|
95
|
-
node src/cli/index.js add progress-slider --cwd ./playground
|
|
96
|
-
node src/cli/index.js add textarea --cwd ./playground
|
|
97
|
-
node src/cli/index.js add toggle --cwd ./playground
|
|
98
|
-
node src/cli/index.js add attribute --cwd ./playground
|
|
99
|
-
node src/cli/index.js add card --cwd ./playground
|
|
100
|
-
node src/cli/index.js add accordion --cwd ./playground
|
|
101
|
-
node src/cli/index.js add avatar --cwd ./playground
|
|
102
|
-
node src/cli/index.js add badge --cwd ./playground
|
|
103
|
-
node src/cli/index.js add tag --cwd ./playground
|
|
104
|
-
node src/cli/index.js add tooltip --cwd ./playground
|
|
14
|
+
When dependencies are added, the CLI prints the install command for your package manager.
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install
|
|
18
|
+
pnpm install
|
|
19
|
+
yarn install
|
|
20
|
+
bun install
|
|
105
21
|
```
|
|
106
22
|
|
|
107
|
-
|
|
23
|
+
## What Init Adds
|
|
108
24
|
|
|
109
|
-
|
|
110
|
-
npm --prefix playground install
|
|
111
|
-
npm run playground:dev
|
|
112
|
-
```
|
|
25
|
+
`banhaten init` writes:
|
|
113
26
|
|
|
114
|
-
|
|
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.
|
|
115
32
|
|
|
116
|
-
|
|
117
|
-
npx banhaten init
|
|
118
|
-
npx banhaten add button
|
|
119
|
-
npx banhaten add button-group
|
|
120
|
-
npx banhaten add menu
|
|
121
|
-
npx banhaten add modal
|
|
122
|
-
npx banhaten add checkbox
|
|
123
|
-
npx banhaten add radio-card
|
|
124
|
-
npx banhaten add divider
|
|
125
|
-
npx banhaten add pagination
|
|
126
|
-
npx banhaten add toolbar
|
|
127
|
-
npx banhaten add social-button
|
|
128
|
-
npx banhaten add input
|
|
129
|
-
npx banhaten add select
|
|
130
|
-
npx banhaten add autocomplete
|
|
131
|
-
npx banhaten add date-picker
|
|
132
|
-
npx banhaten add slider
|
|
133
|
-
npx banhaten add skeleton
|
|
134
|
-
npx banhaten add spinner
|
|
135
|
-
npx banhaten add progress
|
|
136
|
-
npx banhaten add progress-slider
|
|
137
|
-
npx banhaten add textarea
|
|
138
|
-
npx banhaten add toggle
|
|
139
|
-
npx banhaten add attribute
|
|
140
|
-
npx banhaten add card
|
|
141
|
-
npx banhaten add accordion
|
|
142
|
-
npx banhaten add avatar
|
|
143
|
-
npx banhaten add badge
|
|
144
|
-
npx banhaten add tag
|
|
145
|
-
npx banhaten add tooltip
|
|
146
|
-
```
|
|
33
|
+
`banhaten add` and `banhaten update` also refresh the generated token stylesheet, so installed projects receive token changes as the registry evolves.
|
|
147
34
|
|
|
148
|
-
|
|
35
|
+
## CLI
|
|
149
36
|
|
|
150
|
-
```
|
|
151
|
-
|
|
37
|
+
```bash
|
|
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
|
|
152
47
|
```
|
|
153
48
|
|
|
154
|
-
|
|
49
|
+
Global flags:
|
|
155
50
|
|
|
156
|
-
|
|
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.
|
|
157
58
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
59
|
+
## Generated File Ownership
|
|
60
|
+
|
|
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:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
npx banhaten diff
|
|
67
|
+
npx banhaten update button
|
|
162
68
|
```
|
|
163
69
|
|
|
164
|
-
|
|
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.
|
|
165
71
|
|
|
166
|
-
##
|
|
72
|
+
## Tokens
|
|
167
73
|
|
|
168
|
-
|
|
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.
|
|
169
75
|
|
|
170
|
-
|
|
171
|
-
@import "tailwindcss";
|
|
172
|
-
```
|
|
76
|
+
Token modes:
|
|
173
77
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
```json
|
|
179
|
-
{
|
|
180
|
-
"tailwind": {
|
|
181
|
-
"css": "src/app/globals.css"
|
|
182
|
-
},
|
|
183
|
-
"aliases": {
|
|
184
|
-
"ui": "@/components/ui",
|
|
185
|
-
"utils": "@/lib/utils",
|
|
186
|
-
"hooks": "@/hooks"
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
```
|
|
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.
|
|
190
82
|
|
|
191
|
-
|
|
83
|
+
Example:
|
|
192
84
|
|
|
193
|
-
|
|
85
|
+
```tsx
|
|
86
|
+
<html className="dark" data-theme="brown" data-radius="rounded" dir="rtl" lang="ar">
|
|
87
|
+
```
|
|
194
88
|
|
|
195
|
-
|
|
89
|
+
Typography utilities are generated as `.bh-text-*` classes and map directly to token variables.
|
|
196
90
|
|
|
197
91
|
```tsx
|
|
198
92
|
<h1 className="bh-text-heading-xl-bold">...</h1>
|
|
199
93
|
<p className="bh-text-body-md-regular">...</p>
|
|
200
|
-
<button className="bh-text-button">...</button>
|
|
201
94
|
```
|
|
202
95
|
|
|
203
|
-
|
|
96
|
+
## Registry Formats
|
|
204
97
|
|
|
205
|
-
|
|
98
|
+
Banhaten maintains two registry artifacts:
|
|
206
99
|
|
|
207
|
-
Banhaten
|
|
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.
|
|
208
102
|
|
|
209
|
-
|
|
210
|
-
<html className="dark" data-theme="brown" data-radius="rounded" dir="rtl" lang="ar">
|
|
211
|
-
```
|
|
103
|
+
Regenerate the shadcn-compatible export after registry changes:
|
|
212
104
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
- Radius mode: set `data-radius` to `default`, `rounded`, or `sharp`.
|
|
216
|
-
- Direction: set `dir` to `ltr` or `rtl`; components prefer explicit `dir` props for nested direction changes.
|
|
217
|
-
|
|
218
|
-
## Component API Quick Reference
|
|
219
|
-
|
|
220
|
-
| Component | Primary props |
|
|
221
|
-
| --- | --- |
|
|
222
|
-
| `Button` | `variant`, `size`, `asChild`, `loading`, `data-icon`, `data-rtl-flip` |
|
|
223
|
-
| `ButtonGroup` | `size`, `mode`, `dir`; `ButtonGroupItem` supports `active`, `disabled`, `aria-label` |
|
|
224
|
-
| `Attribute` | `layout`, `density`, `dividers`, `bordered`, `labelWidth`, rich value slots |
|
|
225
|
-
| `Card` | `orientation`, `type`, `breakpoint`, `dir`, `title`, `description`, footer/media slots |
|
|
226
|
-
| `Input` | `kind`, `size`, `variant`, `state`, `dir`, `label`, `message`, `hasHelperText` |
|
|
227
|
-
| `Select` | `size`, `variant`, `state`, `open`, `dir`, `value`, `label`, `SelectMenuItem` |
|
|
228
|
-
| `DatePicker` | `Calendar`, `RangeCalendar`, `DatePicker`, `DateRangePicker`, `view`, `type`, `dir` |
|
|
229
|
-
| `Menu` | `width`; `MenuItem` supports `kind`, `disabled`, slotted icons, badges, actions, and progress |
|
|
230
|
-
| `Modal` | `size`, `dir`, `title`, `description`, `showIcon`, `showCloseButton`, `showDivider`, `showFooter`, `showCheckbox`, `footer`; `ConfirmModal` adds `intent`, `confirmLabel`, `confirmLoading`, `preventOutsideDismiss` |
|
|
231
|
-
| `Pagination` | `type`, `variant`, `dir`, `page`, `totalPages`, `labels` |
|
|
232
|
-
| `Progress` | `value`, `min`, `max`, `size`, `labelPosition`, `helperText`, `showIndicator`, `showSpinner` |
|
|
233
|
-
| `Spinner` | `Spinner`, `DynamicSpinner`, inherited text color, `--bh-spinner-size` CSS variable |
|
|
234
|
-
| `Slider` | `value`, `defaultValue`, `tone`, `size`, `variant`, `orientation`, `showTicks` |
|
|
235
|
-
| `ProgressSlider` | `value`, `defaultValue`, `tone`, `size`, `showTicks`, `ariaValueText` |
|
|
236
|
-
| `Toggle` | `size`, `showIcon`, `disabled`; `ToggleField` supports `controlPosition`, `label`, `description` |
|
|
237
|
-
| `Toolbar` | `layout`, `wrap`; slots include `ToolbarSearch`, `ToolbarSelect`, `ToolbarButton`, `ToolbarBadge` |
|
|
238
|
-
| `Tooltip` | `variant`, `size`, `pointerPosition`, `showPointer`, `supportText`, shortcut/close slots |
|
|
239
|
-
| `Checkbox` | Radix checkbox props, plus `CheckboxCard` for labeled card layouts |
|
|
240
|
-
| `Badge` / `Tag` | `color`, `type`, `size`, `dir`; `Tag` also supports `showCloseButton` |
|
|
241
|
-
|
|
242
|
-
## Updating Installed Components
|
|
243
|
-
|
|
244
|
-
Check for local drift without writing files:
|
|
245
|
-
|
|
246
|
-
```text
|
|
247
|
-
npx banhaten diff
|
|
248
|
-
npx banhaten diff button
|
|
105
|
+
```bash
|
|
106
|
+
npm run registry:export
|
|
249
107
|
```
|
|
250
108
|
|
|
251
|
-
|
|
109
|
+
## Documentation
|
|
252
110
|
|
|
253
|
-
|
|
254
|
-
npx banhaten update
|
|
255
|
-
npx banhaten update button
|
|
256
|
-
```
|
|
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.
|
|
257
112
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
## Component Phases
|
|
261
|
-
|
|
262
|
-
Phase 1 focuses on the foundation and Button:
|
|
263
|
-
|
|
264
|
-
- Button variants: `default`, `secondary`, `soft`, `outline`, `ghost`, `ghost-primary`, `danger`, `soft-danger`, `white`.
|
|
265
|
-
- Backward-compatible aliases: `destructive`, `soft-destructive`, and `link`.
|
|
266
|
-
- Button sizes: `xs` 32px, `sm` 36px, `default` 40px, `lg` 48px, plus icon-only equivalents.
|
|
267
|
-
- Button typography: Figma text style `Body/body-md (base)/medium` using Inter Medium, 15px font size, 24px line height, and 0px letter spacing.
|
|
268
|
-
- Base typography: Figma text style `Body/body-md (base)/regular` using Inter Regular, 15px font size, 24px line height, and 0px letter spacing.
|
|
269
|
-
- 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`.
|
|
270
|
-
- Icon placement: add `data-icon="inline-start"` or `data-icon="inline-end"` to icons.
|
|
271
|
-
- RTL directional icons: add `data-rtl-flip="true"` to arrows and chevrons that should mirror.
|
|
272
|
-
- Loading composition: use the generated `Spinner` inside `Button` instead of an `isLoading` prop.
|
|
273
|
-
|
|
274
|
-
Current social primitives:
|
|
275
|
-
|
|
276
|
-
- Button Group modes: `default` and `iconOnly`.
|
|
277
|
-
- Button Group sizes: `md` 40px, `sm` 36px, and `xs` 32px.
|
|
278
|
-
- 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`.
|
|
279
|
-
- 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`.
|
|
280
|
-
- Button Group typography: Figma text style `Body/body-md (base)/medium` using Inter Medium, 15px font size, 24px line height, and 0px letter spacing.
|
|
281
|
-
- Button Group shadows: `--shadow-button-group`, `--shadow-button-group-focus-ring`, and `--shadow-button-group-focus`.
|
|
282
|
-
- Button Group dividers: 1px logical separators using `--bh-button-group-divider`, with the outer 1px border using `--bh-button-group-border`.
|
|
283
|
-
|
|
284
|
-
- 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.
|
|
285
|
-
- Menu item types: `default`, `multiline`, `action`, `progress`, `button`, plus `MenuLabel`, `MenuCaption`, and `MenuSeparator` for non-interactive rows.
|
|
286
|
-
- 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.
|
|
287
|
-
- Menu slots: leading and trailing icons, avatar, text, description, meta text, badge, switch, outline action, progress bar, and RTL-flipping directional icons.
|
|
288
|
-
- Menu tokens: all colors, typography, radius, spacing, border, and elevation resolve through the Banhaten CSS variables, including `--shadow-menu`.
|
|
289
|
-
|
|
290
|
-
- Social Button platforms: `apple`, `facebook`, `google`, `linkedin`, `twitter`, `whatsapp`.
|
|
291
|
-
- Social Button variants: `solid` and `outline`.
|
|
292
|
-
- Social Button sizes: `default` 36px height and `icon` 36px square.
|
|
293
|
-
- Social Button typography: Figma text style `Body/body-md (base)/medium` using Inter Medium, 15px font size, 24px line height, and 0px letter spacing.
|
|
294
|
-
- Social Button shadows: `--shadow-social-button`, `--shadow-social-button-focus-ring`, and `--shadow-social-button-focus`.
|
|
295
|
-
- Social Button focus: Figma 4px outside blue ring at 30% opacity, combined with the social button surface shadow.
|
|
296
|
-
- Social Button RTL: Arabic platform labels are included and can be passed through the `label` prop for nested RTL surfaces.
|
|
297
|
-
|
|
298
|
-
- Pagination types: `numeric`, `simple`, and `summary`.
|
|
299
|
-
- Pagination styles: `soft` and `ghost`.
|
|
300
|
-
- Pagination dimensions: numeric rows use 560px, simple and summary rows use 458px, controls are 32px, and icons are 20px.
|
|
301
|
-
- Pagination typography: Figma text style `Body/body-md (base)` using Inter 15px, 24px line height, and 0px letter spacing.
|
|
302
|
-
- Pagination shadows: `--shadow-pagination-control`, `--shadow-pagination-active`, and `--shadow-pagination-focus`.
|
|
303
|
-
- Pagination RTL: pass `dir="rtl"` or set the document direction to render Arabic labels and mirrored directional arrows.
|
|
304
|
-
|
|
305
|
-
Phase 2 expands the registry into the rest of the system: form controls, overlays, navigation, feedback, data display, layout primitives, and typography.
|
|
306
|
-
|
|
307
|
-
Current layout primitives:
|
|
308
|
-
|
|
309
|
-
- Accordion variants: `default`, `bordered`, `cards`, `soft`.
|
|
310
|
-
- Accordion sizes: `sm`, `default`, `lg`.
|
|
311
|
-
- Accordion modes: Radix `type="single"` and `type="multiple"` are supported.
|
|
312
|
-
- Divider directions: `horizontal` and `vertical`.
|
|
313
|
-
- Divider types: `solid` and `dotted`.
|
|
314
|
-
- Divider color: `--bh-border-subtle`, resolving from the Figma `Color mode / border/subtle` variable.
|
|
315
|
-
- 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`.
|
|
316
|
-
|
|
317
|
-
Current data-display primitives:
|
|
318
|
-
|
|
319
|
-
- Badge styles: `light`, `outline`, `solid`.
|
|
320
|
-
- Badge colors: `neutral`, `blue`, `green`, `amber`, `danger`, `purple`, `fuchsia`, `rose`, `sky`, `golden`.
|
|
321
|
-
- Badge types: `default`, `leading-icon`, `trailing-icon`, `dot`, `flag`, plus `showNumber` for numeric badges.
|
|
322
|
-
- Badge sizes: `sm` 24px and `lg` 28px. `xs` and `default` remain accepted as compatibility aliases.
|
|
323
|
-
- 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.
|
|
324
|
-
- Badge compatibility: the previous `variant` values are still accepted and mapped onto the new Figma axes.
|
|
325
|
-
- Tag types: `simple`, `dot`, `flag`, `avatar`, and `icon`, with optional `showCloseButton`.
|
|
326
|
-
- Tag states: `default`, `active`, and `disabled`, with native hover and focus-visible styling resolving through Banhaten tokens.
|
|
327
|
-
- Tag sizes: `xs` 24px, `md` 28px, and `lg` 36px using `Body/body-xs`, `Body/body-sm`, and `Body/body-md (base)` medium text styles.
|
|
328
|
-
- Tag RTL: pass `dir="rtl"` or inherit document direction; logical padding mirrors leading media, label, and close-button placement.
|
|
329
|
-
- Attribute layouts: `inline`, `end`, `stacked`, and `two-column` with compact/default/comfortable densities.
|
|
330
|
-
- Card layouts: vertical, horizontal, full-image, and mobile spacing variants with Button-composed actions.
|
|
331
|
-
|
|
332
|
-
Current form primitives:
|
|
333
|
-
|
|
334
|
-
- Checkbox primitive: 20px interactive root, 16px centered control, 12px `check-fill` icon, 4px radius, `Shadow/component/default`, and Color mode checkbox tokens.
|
|
335
|
-
- 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.
|
|
336
|
-
- 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.
|
|
337
|
-
- Toggle sizes: `sm` and `md`, with optional handle icons and `ToggleField` leading/trailing label compositions.
|
|
338
|
-
- Date Picker modes: single calendar, month/year view, double range calendar, preset list, date picker, and date range picker.
|
|
339
|
-
- Slider modes: single value, range, multi-thumb, ticked, vertical, pill, text indicator, tooltip indicator, and RTL.
|
|
340
|
-
- Textarea modes: `default` and `tags`.
|
|
341
|
-
- Textarea states: `placeholder`, `filled`, and `disabled`; `hasError` switches the border and helper text to the danger tokens.
|
|
342
|
-
- Textarea typography: labels use `Body/body-sm/medium`, body text uses `Body/body-md (base)/regular`, and helper/tag text uses `Body/body-xs`.
|
|
343
|
-
- Textarea dimensions: 320px default width, 80px minimum input surface, 10px surface padding, 8px field gap, and 8px radius from the Figma component set.
|
|
344
|
-
- Textarea RTL: pass `dir="rtl"` or inherit document direction so label, helper, and tag-chip ordering mirrors without physical left/right styling.
|
|
345
|
-
|
|
346
|
-
## Token Source
|
|
347
|
-
|
|
348
|
-
The current source of truth is the local token exports:
|
|
349
|
-
|
|
350
|
-
- `tokens/Color mode.zip`
|
|
351
|
-
- `tokens/Theme.zip`
|
|
352
|
-
- `tokens/Numbers.zip`
|
|
353
|
-
- `tokens/Radius.zip`
|
|
354
|
-
|
|
355
|
-
`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.
|
|
356
|
-
|
|
357
|
-
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.
|
|
358
|
-
|
|
359
|
-
## Direction
|
|
360
|
-
|
|
361
|
-
Banhaten assumes UI can run in either direction:
|
|
113
|
+
Markdown docs live in `docs/design-system/components`. They are checked for install, API, examples, token contract, RTL rules, and accessibility sections.
|
|
362
114
|
|
|
363
|
-
|
|
364
|
-
|
|
115
|
+
Useful commands:
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
npm run docs:check
|
|
119
|
+
npm run docs:normalize
|
|
120
|
+
npm run playground:dev
|
|
365
121
|
```
|
|
366
122
|
|
|
367
|
-
|
|
123
|
+
## Components
|
|
368
124
|
|
|
369
|
-
|
|
370
|
-
|
|
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.
|
|
126
|
+
|
|
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.
|
|
128
|
+
|
|
129
|
+
## Development
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
npm run check
|
|
133
|
+
npm run tokens:check
|
|
134
|
+
npm run registry:check
|
|
135
|
+
npm run playground:test
|
|
371
136
|
```
|
|
372
137
|
|
|
373
|
-
|
|
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.
|