banhaten 0.1.2 → 0.2.0
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/CHANGELOG.md +45 -0
- package/CONTRIBUTING.md +44 -0
- package/README.md +145 -328
- package/SECURITY.md +15 -0
- package/banhaten.config.example.json +1 -3
- package/docs/design-system/README.md +20 -0
- package/docs/design-system/adoption-quality-remediation.md +87 -0
- package/docs/design-system/agent-usage.md +13 -0
- package/docs/design-system/appearance-presets.md +189 -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-docs-pattern.md +81 -0
- package/docs/design-system/component-showcase-consistency-report.md +217 -0
- package/docs/design-system/component-token-consistency-audit.md +173 -0
- package/docs/design-system/components/README.md +75 -0
- package/docs/design-system/components/accordion.md +67 -0
- package/docs/design-system/components/activity-feed.md +106 -0
- package/docs/design-system/components/alert-dialog.md +87 -0
- package/docs/design-system/components/alert.md +111 -0
- package/docs/design-system/components/aspect-ratio.md +59 -0
- package/docs/design-system/components/attribute.md +103 -0
- package/docs/design-system/components/autocomplete.md +93 -0
- package/docs/design-system/components/avatar.md +70 -0
- package/docs/design-system/components/badge.md +72 -0
- package/docs/design-system/components/banner.md +99 -0
- package/docs/design-system/components/breadcrumbs.md +188 -0
- package/docs/design-system/components/button-group.md +117 -0
- package/docs/design-system/components/button.md +95 -0
- package/docs/design-system/components/card.md +95 -0
- package/docs/design-system/components/carousel.md +61 -0
- package/docs/design-system/components/catalog-components.md +59 -0
- package/docs/design-system/components/chart.md +58 -0
- package/docs/design-system/components/checkbox.md +68 -0
- package/docs/design-system/components/collapsible.md +63 -0
- package/docs/design-system/components/command.md +75 -0
- package/docs/design-system/components/context-menu.md +59 -0
- package/docs/design-system/components/date-picker.md +97 -0
- package/docs/design-system/components/divider.md +117 -0
- package/docs/design-system/components/empty-state.md +72 -0
- package/docs/design-system/components/field.md +86 -0
- package/docs/design-system/components/file-upload.md +199 -0
- package/docs/design-system/components/hover-card.md +61 -0
- package/docs/design-system/components/icons.md +48 -0
- package/docs/design-system/components/input-group.md +73 -0
- package/docs/design-system/components/input-otp.md +73 -0
- package/docs/design-system/components/input.md +84 -0
- package/docs/design-system/components/item.md +72 -0
- package/docs/design-system/components/kbd.md +62 -0
- package/docs/design-system/components/label.md +64 -0
- package/docs/design-system/components/menu.md +76 -0
- package/docs/design-system/components/menubar.md +60 -0
- package/docs/design-system/components/modal.md +119 -0
- package/docs/design-system/components/native-select.md +70 -0
- package/docs/design-system/components/navigation-menu.md +63 -0
- package/docs/design-system/components/onboarding-step-list-item.md +94 -0
- package/docs/design-system/components/page-header.md +98 -0
- package/docs/design-system/components/pagination.md +71 -0
- package/docs/design-system/components/popover.md +77 -0
- package/docs/design-system/components/progress-slider.md +66 -0
- package/docs/design-system/components/progress.md +92 -0
- package/docs/design-system/components/radio-card.md +65 -0
- package/docs/design-system/components/radio-group.md +72 -0
- package/docs/design-system/components/resizable.md +57 -0
- package/docs/design-system/components/scroll-area.md +60 -0
- package/docs/design-system/components/segmented-control.md +71 -0
- package/docs/design-system/components/select.md +87 -0
- package/docs/design-system/components/sheet.md +82 -0
- package/docs/design-system/components/sidebar.md +83 -0
- package/docs/design-system/components/skeleton.md +91 -0
- package/docs/design-system/components/slideout.md +77 -0
- package/docs/design-system/components/slider.md +81 -0
- package/docs/design-system/components/social-button.md +65 -0
- package/docs/design-system/components/spinner.md +77 -0
- package/docs/design-system/components/steps.md +77 -0
- package/docs/design-system/components/table.md +411 -0
- package/docs/design-system/components/tabs.md +69 -0
- package/docs/design-system/components/tag.md +95 -0
- package/docs/design-system/components/textarea.md +64 -0
- package/docs/design-system/components/timeline.md +95 -0
- package/docs/design-system/components/toast.md +73 -0
- package/docs/design-system/components/toggle.md +96 -0
- package/docs/design-system/components/toolbar.md +105 -0
- package/docs/design-system/components/tooltip.md +107 -0
- package/docs/design-system/components/typography.md +18 -0
- package/docs/design-system/density-and-elevation.md +44 -0
- package/docs/design-system/design-system-test-missing-items.md +368 -0
- package/docs/design-system/direction-and-localization.md +23 -0
- package/docs/design-system/form-recipes.md +73 -0
- package/docs/design-system/gap-promotion-policy.md +21 -0
- package/docs/design-system/gap-promotion-report.md +166 -0
- package/docs/design-system/icons.md +69 -0
- package/docs/design-system/installation.md +68 -0
- package/docs/design-system/launch-comparison-shadcn.md +98 -0
- package/docs/design-system/registry-and-cli.md +64 -0
- package/docs/design-system/release-policy.md +30 -0
- package/docs/design-system/roadmap.md +14 -0
- package/docs/design-system/support-matrix.md +23 -0
- package/docs/design-system/tabs.md +53 -0
- package/docs/design-system/token-governance.md +60 -0
- package/package.json +97 -65
- package/registry/component-contract.json +40 -0
- package/registry/components/alert-dialog.tsx +297 -0
- package/registry/components/alert.tsx +86 -65
- package/registry/components/aspect-ratio.tsx +30 -0
- package/registry/components/autocomplete.tsx +23 -9
- package/registry/components/avatar.tsx +7 -7
- package/registry/components/badge.tsx +1 -1
- package/registry/components/button-group.tsx +321 -4
- package/registry/components/button.tsx +38 -17
- package/registry/components/card.tsx +68 -59
- package/registry/components/carousel.tsx +282 -0
- package/registry/components/chart.tsx +203 -0
- package/registry/components/checkbox.tsx +3 -3
- 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 +246 -105
- package/registry/components/expanded/ActivityFeed.tsx +6 -15
- package/registry/components/expanded/Banner.tsx +3 -3
- package/registry/components/expanded/Breadcrumbs.tsx +5 -5
- package/registry/components/expanded/CatalogComponentsShowcase.tsx +13 -13
- package/registry/components/expanded/CatalogDivider.tsx +1 -1
- package/registry/components/expanded/EmptyState.tsx +1 -1
- package/registry/components/expanded/FileUpload.tsx +9 -2
- package/registry/components/expanded/OnboardingStepListItem.tsx +2 -4
- package/registry/components/expanded/PageHeader.tsx +14 -14
- package/registry/components/expanded/Slideout.tsx +15 -415
- package/registry/components/expanded/Steps.tsx +4 -4
- package/registry/components/expanded/Table.tsx +116 -69
- package/registry/components/expanded/Timeline.tsx +3 -3
- package/registry/components/expanded/activityFeed.css +1 -1
- package/registry/components/expanded/breadcrumbs.css +139 -139
- package/registry/components/expanded/catalogComponentsShowcase.css +83 -83
- package/registry/components/expanded/divider.css +1 -1
- package/registry/components/expanded/emptyState.css +1 -1
- package/registry/components/expanded/fileUpload.css +6 -6
- package/registry/components/expanded/slideout.css +9 -685
- package/registry/components/expanded/steps.css +274 -274
- package/registry/components/expanded/table.css +2 -2
- 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-content.ts +1 -0
- package/registry/components/input-group.tsx +130 -0
- package/registry/components/input-otp.tsx +13 -3
- package/registry/components/input.tsx +70 -45
- package/registry/components/item.tsx +189 -0
- package/registry/components/kbd.tsx +151 -0
- package/registry/components/label.tsx +78 -0
- package/registry/components/menu.tsx +34 -246
- package/registry/components/menubar.tsx +226 -0
- package/registry/components/modal.tsx +216 -143
- package/registry/components/native-select.tsx +205 -0
- package/registry/components/navigation-menu.tsx +171 -0
- package/registry/components/pagination.tsx +80 -58
- package/registry/components/popover.tsx +162 -664
- package/registry/components/radio-card.tsx +116 -87
- 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/segmented-control.tsx +87 -0
- package/registry/components/select-content.tsx +2 -2
- package/registry/components/select.tsx +54 -20
- package/registry/components/sheet.tsx +305 -0
- package/registry/components/sidebar.tsx +352 -0
- package/registry/components/skeleton.css +0 -3
- package/registry/components/social-button.tsx +116 -30
- package/registry/components/spinner.tsx +18 -55
- package/registry/components/{expanded/tabs.css → tabs.css} +127 -106
- package/registry/components/tabs.tsx +246 -0
- package/registry/components/tag.tsx +2 -2
- package/registry/components/textarea.tsx +4 -4
- package/registry/components/toast.tsx +136 -0
- package/registry/components/toggle.tsx +2 -2
- package/registry/components/toolbar.tsx +89 -17
- package/registry/components/tooltip.tsx +1 -1
- package/registry/examples/alert-demo.tsx +25 -5
- package/registry/examples/alert-dialog-demo.tsx +42 -0
- package/registry/examples/aspect-ratio-demo.tsx +11 -0
- package/registry/examples/attribute-demo.tsx +1 -1
- package/registry/examples/autocomplete-demo.tsx +3 -3
- package/registry/examples/avatar-demo.tsx +7 -7
- package/registry/examples/badge-demo.tsx +1 -1
- package/registry/examples/button-demo.tsx +6 -6
- package/registry/examples/button-group-demo.tsx +23 -2
- package/registry/examples/card-demo.tsx +46 -8
- package/registry/examples/carousel-demo.tsx +43 -0
- package/registry/examples/chart-demo.tsx +33 -0
- package/registry/examples/checkbox-demo.tsx +5 -5
- package/registry/examples/collapsible-demo.tsx +16 -0
- package/registry/examples/collection-filter-bar-demo.tsx +135 -0
- package/registry/examples/command-demo.tsx +42 -0
- package/registry/examples/{expanded/command-bar-demo.tsx → command-palette-demo.tsx} +5 -15
- package/registry/examples/context-menu-demo.tsx +29 -0
- package/registry/examples/control-density-contract-demo.tsx +61 -0
- package/registry/examples/date-picker-demo.tsx +12 -12
- package/registry/examples/divider-demo.tsx +3 -3
- package/registry/examples/expanded/banner-demo.tsx +1 -1
- package/registry/examples/expanded/breadcrumbs-demo.tsx +1 -1
- package/registry/examples/expanded/empty-state-demo.tsx +1 -1
- package/registry/examples/expanded/file-upload-demo.tsx +1 -1
- package/registry/examples/expanded/onboarding-step-demo.tsx +1 -1
- package/registry/examples/expanded/slideout-demo.tsx +2 -2
- package/registry/examples/expanded/steps-demo.tsx +1 -1
- package/registry/examples/expanded/tabs-demo.tsx +2 -2
- package/registry/examples/expanded/timeline-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 +6 -6
- package/registry/examples/input-group-demo.tsx +16 -0
- package/registry/examples/input-otp-demo.tsx +4 -4
- package/registry/examples/item-demo.tsx +46 -0
- package/registry/examples/kbd-demo.tsx +11 -0
- package/registry/examples/label-demo.tsx +20 -0
- package/registry/examples/menu-demo.tsx +1 -1
- package/registry/examples/menubar-demo.tsx +34 -0
- package/registry/examples/modal-demo.tsx +67 -9
- package/registry/examples/native-select-demo.tsx +16 -0
- package/registry/examples/navigation-menu-demo.tsx +29 -0
- package/registry/examples/pagination-demo.tsx +6 -3
- package/registry/examples/popover-demo.tsx +19 -19
- package/registry/examples/progress-demo.tsx +1 -1
- package/registry/examples/progress-slider-demo.tsx +1 -1
- package/registry/examples/radio-card-demo.tsx +4 -4
- package/registry/examples/radio-group-demo.tsx +2 -2
- package/registry/examples/resizable-demo.tsx +22 -0
- package/registry/examples/results-toolbar-demo.tsx +44 -0
- package/registry/examples/scroll-area-demo.tsx +15 -0
- package/registry/examples/segmented-control-demo.tsx +39 -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/slider-demo.tsx +3 -3
- package/registry/examples/social-button-demo.tsx +18 -8
- package/registry/examples/spinner-demo.tsx +13 -13
- package/registry/examples/tabs-demo.tsx +13 -0
- package/registry/examples/tag-demo.tsx +1 -1
- package/registry/examples/textarea-demo.tsx +4 -4
- package/registry/examples/toast-demo.tsx +35 -0
- package/registry/examples/toggle-demo.tsx +6 -6
- package/registry/examples/tooltip-demo.tsx +4 -4
- package/registry/guidance/USAGE.md +27 -0
- package/registry/hooks/use-direction.ts +193 -13
- package/registry/index.json +6010 -432
- package/registry/styles/globals.css +3112 -4690
- package/registry.json +1582 -0
- package/schema/config.schema.json +51 -0
- package/schema/registry.schema.json +190 -0
- package/schema/tokens.schema.json +163 -0
- package/src/cli/command-line.js +194 -0
- package/src/cli/config-editors.js +9 -0
- package/src/cli/doctor.js +399 -0
- package/src/cli/file-transaction.js +295 -0
- package/src/cli/global-css.js +153 -0
- package/src/cli/index.js +639 -1391
- package/src/cli/install-plan.js +592 -0
- package/src/cli/install-receipt.js +171 -0
- package/src/cli/jsonc.js +203 -0
- package/src/cli/package-install-state.js +254 -0
- package/src/cli/package-manager.js +238 -0
- package/src/cli/package-plan.js +185 -0
- package/src/cli/package-version.js +97 -0
- package/src/cli/registry-query.js +207 -0
- package/src/cli/reporting.js +55 -0
- package/src/cli/schema-validation.js +19 -0
- package/src/cli/source-scanner.js +686 -0
- package/src/cli/vite-config.js +478 -0
- package/tokens/banhaten.tokens.json +4313 -310
- 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/BannerBoard.tsx +0 -225
- package/registry/components/expanded/CatalogTag.tsx +0 -85
- package/registry/components/expanded/CommandBar.tsx +0 -386
- package/registry/components/expanded/IconExplorer.tsx +0 -612
- package/registry/components/expanded/Tabs.tsx +0 -86
- package/registry/components/expanded/TimelineShowcase.tsx +0 -158
- package/registry/components/expanded/commandBar.css +0 -470
- package/registry/components/expanded/iconExplorer.css +0 -764
- package/registry/components/expanded/iconPacks.ts +0 -866
- package/registry/components/expanded/tag.css +0 -148
- package/registry/examples/expanded/icons-demo.tsx +0 -5
- package/tokens/Color mode.zip +0 -0
- package/tokens/Numbers.zip +0 -0
- package/tokens/Radius.zip +0 -0
- package/tokens/Theme.zip +0 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable Banhaten changes are recorded here. Releases follow the policy in `docs/design-system/release-policy.md`.
|
|
4
|
+
|
|
5
|
+
## 0.2.0 - 2026-08-08
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Canonical JSON-driven token generation and strict component token enforcement.
|
|
10
|
+
- Color Contrast documentation covering every audited theme, mode, foreground, and background scenario.
|
|
11
|
+
- Item and Toggle Group primitives, inherited direction context, Arabic font installation, and named categorical chart tokens.
|
|
12
|
+
- Receipt-backed CLI drift protection, unified diffs, and isolated compilation for every registry component.
|
|
13
|
+
- Documentation search, token search/copy, stable component and pattern separation, and dedicated lab navigation.
|
|
14
|
+
- `SegmentedControl` and `KbdShortcut` primitives with accessibility, RTL, registry metadata, examples, and tests.
|
|
15
|
+
- Semantic `compact`, `default`, and `comfortable` density across Button, Input, Select, DatePicker, ButtonGroup, SegmentedControl, and Toolbar controls.
|
|
16
|
+
- Canonical collection-filter, results-toolbar, and control-density recipes with accessibility and visual-regression coverage.
|
|
17
|
+
- Install-time coding-agent guidance, a read-only `banhaten doctor` adoption audit, and recurring-gap promotion reporting.
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
|
|
21
|
+
- Production components no longer invent demo content, fake actions, or fixed sample dates.
|
|
22
|
+
- Input and Select no longer invent optional leading, information, or trailing icons when those props are omitted; explicit flags retain the previous built-in adornments.
|
|
23
|
+
- Registry component metadata now publishes machine-readable prop types, rendered defaults, and descriptions for optional visual slots.
|
|
24
|
+
- Registry component token metadata is generated from source references.
|
|
25
|
+
- Pagination, OTP, Carousel, Alert, and Toast direction behavior now resolves from explicit props, provider context, or the nearest document boundary.
|
|
26
|
+
- The default appearance keeps blue brand roles but now composes all neutral surfaces, borders, content, and interaction roles from the reviewed gray ramp in light and dark modes.
|
|
27
|
+
- Registry metadata now declares capability defaults, recommended uses, avoid guidance, recipes, and deprecated props instead of inferring defaults from array order.
|
|
28
|
+
- Toolbar controls default to the shared 36px density; use `density="comfortable"` for the previous 40px toolbar height.
|
|
29
|
+
|
|
30
|
+
### Fixed
|
|
31
|
+
|
|
32
|
+
- Undefined token references, raw component values, inaccessible progress semantics, no-op controls, and the Arabic Pagination “Previous” label.
|
|
33
|
+
- Documentation section anchors, narrow Input preview overflow, Popover arrow sizing, Slideout icon geometry, and playground bundle chunking.
|
|
34
|
+
- High-severity playground advisories in Nano ID, PostCSS, and Undici through patched lockfile versions.
|
|
35
|
+
|
|
36
|
+
### Migration
|
|
37
|
+
|
|
38
|
+
- Prefer `density` over legacy component-specific sizes when controls share a row. Legacy size props continue to work.
|
|
39
|
+
- Replace Input `hasLeadingIcon` and `hasInformationIcon` with explicit `leadingIcon`/`trailingIcon`, or use `showAtSign`/`showInfo` for those exact affordances. The legacy flags remain supported for this deprecation window.
|
|
40
|
+
- Replace single-glyph Input shortcuts with `shortcutKeys={["Mod", "K"]}` or `KbdShortcut` for platform-aware keycaps.
|
|
41
|
+
- Run `npx banhaten init` to install `.banhaten/USAGE.md`, then run `npx banhaten doctor` and `npx banhaten diff` before updating consumer components.
|
|
42
|
+
|
|
43
|
+
## 0.1.3
|
|
44
|
+
|
|
45
|
+
- Pre-launch registry and documentation baseline.
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Contributing to Banhaten
|
|
2
|
+
|
|
3
|
+
## Local checks
|
|
4
|
+
|
|
5
|
+
Use Node 18.18 or newer, install the root and playground dependencies, then run:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm run check
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
The full check validates schemas, CLI behavior, token generation, token-only component styling, registry mirrors, isolated installs, documentation coverage, browser tests, and the production bundle.
|
|
12
|
+
|
|
13
|
+
## Component rules
|
|
14
|
+
|
|
15
|
+
- Build component styling from canonical `--bh-*` and `--shadow-*` tokens. Add
|
|
16
|
+
new values to the appropriate owned fragment under `tokens/source/` before
|
|
17
|
+
using them in component source.
|
|
18
|
+
- Keep product copy, sample dates, and product actions in examples rather than production defaults.
|
|
19
|
+
- Preserve inherited direction and use logical CSS properties. Test both LTR and RTL keyboard behavior.
|
|
20
|
+
- Use native semantics or proven accessible primitives, and document the public API, examples, tokens, RTL behavior, and accessibility contract.
|
|
21
|
+
- Keep stable primitives in Components, larger compositions in Patterns, and experiments in Lab.
|
|
22
|
+
|
|
23
|
+
## Generated artifacts
|
|
24
|
+
|
|
25
|
+
Edit the owned fragments under `tokens/source/` for structured tokens and
|
|
26
|
+
aliases, and edit `registry/catalog/components/<id>.json` for component registry
|
|
27
|
+
metadata. `tokens/banhaten.tokens.json` and `registry/index.json` are compiled
|
|
28
|
+
publication artifacts. Edit `tokens/banhaten.utilities.css` for authored
|
|
29
|
+
Tailwind mappings, keyframes, global rules, accessibility rules, and typography
|
|
30
|
+
utilities. The generated `registry/styles/globals.css` is rebuilt from the
|
|
31
|
+
compiled token catalog and that authored CSS source.
|
|
32
|
+
|
|
33
|
+
After token or registry metadata changes, run:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npm run tokens:build
|
|
37
|
+
npm run components:tokens:metadata -- --write
|
|
38
|
+
npm run registry:export
|
|
39
|
+
npm run docs:normalize
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Do not hand-edit `tokens/banhaten.tokens.json`, `registry/index.json`,
|
|
43
|
+
`registry/styles/globals.css`, `registry.json`, or generated registry contract
|
|
44
|
+
tables.
|
package/README.md
CHANGED
|
@@ -1,373 +1,190 @@
|
|
|
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
|
+
- `.banhaten/USAGE.md` with agent-readable defaults, recipes, and component-selection rules.
|
|
30
|
+
- The generated Banhaten token stylesheet in your configured CSS file.
|
|
31
|
+
- Tailwind v4 and Vite alias setup when those files are detected.
|
|
32
|
+
- Required package dependencies.
|
|
115
33
|
|
|
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
|
-
```
|
|
34
|
+
`banhaten add` and `banhaten update` also refresh the generated token stylesheet, so installed projects receive token changes as the registry evolves.
|
|
147
35
|
|
|
148
|
-
|
|
36
|
+
## CLI
|
|
149
37
|
|
|
150
|
-
```
|
|
151
|
-
|
|
38
|
+
```bash
|
|
39
|
+
npx banhaten init [--cwd <path>] [--force] [--dry-run] [--json]
|
|
40
|
+
npx banhaten add <component...> [--cwd <path>] [--force] [--dry-run] [--json]
|
|
41
|
+
npx banhaten diff [component...] [--cwd <path>] [--json]
|
|
42
|
+
npx banhaten update [component...] [--cwd <path>] [--force] [--dry-run] [--json]
|
|
43
|
+
npx banhaten list [--json]
|
|
44
|
+
npx banhaten search <query> [--json]
|
|
45
|
+
npx banhaten docs <component> [--json]
|
|
46
|
+
npx banhaten view <component> [--file <registry-source>] [--json]
|
|
47
|
+
npx banhaten doctor [--cwd <path>] [--json]
|
|
48
|
+
npx banhaten version
|
|
152
49
|
```
|
|
153
50
|
|
|
154
|
-
|
|
51
|
+
The CLI validates each command before doing project work: unknown flags, missing
|
|
52
|
+
flag values, duplicate flags, and unexpected arguments fail without writing.
|
|
53
|
+
Mutating commands then compute one install plan from the configured destinations
|
|
54
|
+
and the existing TypeScript/Vite root aliases. An alias declared on only one side
|
|
55
|
+
is mirrored to the other; conflicting, ambiguous, or dynamic aliases stop before
|
|
56
|
+
files are staged. The install receipt records the resolved destinations so later
|
|
57
|
+
runs cannot silently create a second generated tree.
|
|
155
58
|
|
|
156
|
-
|
|
59
|
+
Dependency ranges follow a guarantee policy: every version admitted by the
|
|
60
|
+
consumer declaration must satisfy Banhaten's requirement. Broader semver ranges
|
|
61
|
+
are safely narrowed when possible and trigger an install hint; partial overlaps,
|
|
62
|
+
disjoint ranges, and opaque package protocols fail without writes. A lockfile is
|
|
63
|
+
never accepted instead of that manifest guarantee. When the manifest is already
|
|
64
|
+
safe, the CLI verifies the bounded installed resolution and npm lock state;
|
|
65
|
+
stale or unverifiable lock state keeps a project-rooted install action visible.
|
|
157
66
|
|
|
158
|
-
|
|
159
|
-
npx banhaten init
|
|
160
|
-
npx banhaten add button input select
|
|
161
|
-
npm install
|
|
162
|
-
```
|
|
67
|
+
Command flags:
|
|
163
68
|
|
|
164
|
-
|
|
69
|
+
- `--cwd <path>` runs `init`, `add`, `diff`, `update`, or `doctor` against another project directory.
|
|
70
|
+
- `--dry-run` previews `init`, `add`, or `update` writes.
|
|
71
|
+
- `--force` replaces locally modified generated files after you review `banhaten diff`.
|
|
72
|
+
- `--json` prints machine-readable output for commands that show it above.
|
|
165
73
|
|
|
166
|
-
|
|
74
|
+
Global flags:
|
|
167
75
|
|
|
168
|
-
|
|
76
|
+
- `--help` or `-h` prints help.
|
|
77
|
+
- `--silent` or `-s` suppresses normal command output.
|
|
78
|
+
- `--yes` or `-y` is accepted for non-interactive scripts.
|
|
79
|
+
- `--version` or `-v` prints the CLI version.
|
|
169
80
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
81
|
+
## Generated File Ownership
|
|
82
|
+
|
|
83
|
+
Banhaten is a source registry. The install receipt records the exact generated hash for every managed file. Unmodified files update automatically; locally modified component files and token blocks are never replaced unless you pass `--force`.
|
|
84
|
+
|
|
85
|
+
Use `banhaten diff` before updating if you edit generated component files locally:
|
|
173
86
|
|
|
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
|
-
}
|
|
87
|
+
```bash
|
|
88
|
+
npx banhaten diff
|
|
89
|
+
npx banhaten update button --force # only after reviewing intentional replacement
|
|
189
90
|
```
|
|
190
91
|
|
|
191
|
-
|
|
92
|
+
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.
|
|
192
93
|
|
|
193
|
-
##
|
|
94
|
+
## Tokens
|
|
194
95
|
|
|
195
|
-
|
|
96
|
+
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.
|
|
196
97
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
98
|
+
Structured token values and aliases are authored in the owned fragments under
|
|
99
|
+
`tokens/source/`; `tokens/banhaten.tokens.json` is their compiled publication
|
|
100
|
+
artifact. Tailwind mappings, keyframes, global and accessibility rules, and
|
|
101
|
+
typography utilities are authored in `tokens/banhaten.utilities.css`.
|
|
102
|
+
`registry/styles/globals.css` is generated from the compiled token catalog and
|
|
103
|
+
the utility source; neither generated file should be edited directly.
|
|
202
104
|
|
|
203
|
-
|
|
105
|
+
Token modes:
|
|
204
106
|
|
|
205
|
-
|
|
107
|
+
- Color mode: light and dark.
|
|
108
|
+
- Brand theme: `blue`, `gray`, `brown`, `orange`, `green`, `purple`, `teal`.
|
|
109
|
+
- Radius mode: `default`, `rounded`, `sharp`.
|
|
110
|
+
- Direction: inherited LTR or RTL, with component-level `dir` support where needed.
|
|
206
111
|
|
|
207
|
-
|
|
112
|
+
The default appearance is the `blue` brand theme composed with the achromatic
|
|
113
|
+
`gray` neutral scale. This keeps page, card, border, and muted surfaces neutral
|
|
114
|
+
while links, focus states, and primary actions remain blue. The `gray` theme is
|
|
115
|
+
still a separate monochrome brand option; it changes the brand roles as well.
|
|
116
|
+
|
|
117
|
+
Example:
|
|
208
118
|
|
|
209
119
|
```tsx
|
|
210
120
|
<html className="dark" data-theme="brown" data-radius="rounded" dir="rtl" lang="ar">
|
|
211
121
|
```
|
|
212
122
|
|
|
213
|
-
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
-
|
|
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
|
|
123
|
+
Typography utilities are generated as `.bh-text-*` classes and map directly to token variables.
|
|
124
|
+
|
|
125
|
+
```tsx
|
|
126
|
+
<h1 className="bh-text-heading-xl-bold">...</h1>
|
|
127
|
+
<p className="bh-text-body-md-regular">...</p>
|
|
249
128
|
```
|
|
250
129
|
|
|
251
|
-
|
|
130
|
+
## Registry Formats
|
|
252
131
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
132
|
+
Banhaten maintains component-owned registry sources and two compiled
|
|
133
|
+
publication artifacts:
|
|
134
|
+
|
|
135
|
+
- `registry/catalog/components/<id>.json` owns each component contract, while
|
|
136
|
+
`registry/catalog/base.json` and `manifest.json` own the shared contract and
|
|
137
|
+
publication order.
|
|
138
|
+
- `registry/index.json` is the compiled Banhaten artifact used by the CLI. It
|
|
139
|
+
includes an exhaustive, module-aware `supportedExports` runtime contract plus
|
|
140
|
+
non-exhaustive `parts` anatomy, RTL behavior, examples, files, and
|
|
141
|
+
dependencies.
|
|
142
|
+
- `registry.json` is a generated shadcn-compatible export for tools that expect the public shadcn registry schema.
|
|
143
|
+
|
|
144
|
+
Compile both registry publication artifacts after authored catalog changes:
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
npm run registry:export
|
|
256
148
|
```
|
|
257
149
|
|
|
258
|
-
`
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
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:
|
|
150
|
+
`supportedExports` is checked against the installed TypeScript modules during
|
|
151
|
+
`npm run registry:check`; a renamed, moved, added, or removed runtime export
|
|
152
|
+
fails the release gate. Run `npm run registry:exports` only after reviewing an
|
|
153
|
+
intentional public runtime API change. Type-only exports are outside this
|
|
154
|
+
manifest. `parts` remains an ordered composition aid and does not claim API
|
|
155
|
+
completeness.
|
|
362
156
|
|
|
363
|
-
|
|
364
|
-
|
|
157
|
+
## Documentation
|
|
158
|
+
|
|
159
|
+
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.
|
|
160
|
+
|
|
161
|
+
Markdown docs live in `docs/design-system/components`. They are checked for install, API, examples, token contract, RTL rules, and accessibility sections.
|
|
162
|
+
|
|
163
|
+
Launch guides cover [installation](docs/design-system/installation.md), [direction and localization](docs/design-system/direction-and-localization.md), [form recipes](docs/design-system/form-recipes.md), [density and elevation](docs/design-system/density-and-elevation.md), the [support matrix](docs/design-system/support-matrix.md), and the [release policy](docs/design-system/release-policy.md).
|
|
164
|
+
|
|
165
|
+
The durable [launch comparison with shadcn/ui](docs/design-system/launch-comparison-shadcn.md) records every audited area, remediation, verification gate, contrast exception, and deliberate non-copying decision.
|
|
166
|
+
|
|
167
|
+
Useful commands:
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
npm run docs:check
|
|
171
|
+
npm run docs:normalize
|
|
172
|
+
npm run playground:dev
|
|
365
173
|
```
|
|
366
174
|
|
|
367
|
-
|
|
175
|
+
## Components
|
|
368
176
|
|
|
369
|
-
|
|
370
|
-
|
|
177
|
+
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.
|
|
178
|
+
|
|
179
|
+
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.
|
|
180
|
+
|
|
181
|
+
## Development
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
npm run check
|
|
185
|
+
npm run tokens:check
|
|
186
|
+
npm run registry:check
|
|
187
|
+
npm run playground:test
|
|
371
188
|
```
|
|
372
189
|
|
|
373
|
-
|
|
190
|
+
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.
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
## Supported versions
|
|
4
|
+
|
|
5
|
+
Until Banhaten reaches 1.0, security fixes are applied to the latest published minor release. Consumers should keep the CLI and copied registry components current.
|
|
6
|
+
|
|
7
|
+
## Reporting a vulnerability
|
|
8
|
+
|
|
9
|
+
Report vulnerabilities privately through GitHub’s security-advisory workflow for this repository. Do not open a public issue containing exploit details, credentials, or consumer data.
|
|
10
|
+
|
|
11
|
+
Include the affected Banhaten version, component or CLI command, reproduction steps, impact, and any known mitigation. Maintainers will acknowledge a complete report, assess severity, and coordinate a fix and disclosure.
|
|
12
|
+
|
|
13
|
+
## Scope
|
|
14
|
+
|
|
15
|
+
The CLI, registry source, generated CSS, dependency declarations, documentation application, and release artifacts are in scope. Vulnerabilities in an upstream dependency should also be reported to that upstream project when appropriate.
|