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
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Alert Dialog
|
|
2
|
+
|
|
3
|
+
Alert Dialog is the destructive or consequential confirmation primitive. It is backed by Radix AlertDialog so focus, Escape behavior, outside interaction, and alert-dialog semantics are handled by the correct primitive.
|
|
4
|
+
|
|
5
|
+
## API
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
<AlertDialog>
|
|
9
|
+
<AlertDialogTrigger asChild>
|
|
10
|
+
<Button variant="danger">Delete project</Button>
|
|
11
|
+
</AlertDialogTrigger>
|
|
12
|
+
<AlertDialogContent>
|
|
13
|
+
<AlertDialogHeader>
|
|
14
|
+
<AlertDialogIcon intent="danger" />
|
|
15
|
+
<AlertDialogTitle>Delete project?</AlertDialogTitle>
|
|
16
|
+
</AlertDialogHeader>
|
|
17
|
+
<AlertDialogBody>
|
|
18
|
+
<AlertDialogDescription>This cannot be undone.</AlertDialogDescription>
|
|
19
|
+
</AlertDialogBody>
|
|
20
|
+
<AlertDialogFooter>
|
|
21
|
+
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
|
22
|
+
<AlertDialogAction>Delete project</AlertDialogAction>
|
|
23
|
+
</AlertDialogFooter>
|
|
24
|
+
</AlertDialogContent>
|
|
25
|
+
</AlertDialog>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
| Part | Purpose |
|
|
29
|
+
| --- | --- |
|
|
30
|
+
| `AlertDialog`, `AlertDialogTrigger`, `AlertDialogPortal` | Radix AlertDialog shell |
|
|
31
|
+
| `AlertDialogOverlay`, `AlertDialogContent` | modal alert surface |
|
|
32
|
+
| `AlertDialogHeader`, `AlertDialogBody`, `AlertDialogFooter` | layout regions |
|
|
33
|
+
| `AlertDialogTitle`, `AlertDialogDescription`, `AlertDialogIcon` | accessible warning copy |
|
|
34
|
+
| `AlertDialogCancel`, `AlertDialogAction` | safe cancel and confirm actions |
|
|
35
|
+
|
|
36
|
+
| Prop | Values |
|
|
37
|
+
| --- | --- |
|
|
38
|
+
| `size` | `sm`, `default`, `lg` |
|
|
39
|
+
| `intent` | `default`, `warning`, `danger` |
|
|
40
|
+
|
|
41
|
+
## Token Contract
|
|
42
|
+
|
|
43
|
+
Alert Dialog uses Banhaten raised surface, backdrop, border, radius, shadow, semantic intent, body typography, focus, and button tokens.
|
|
44
|
+
|
|
45
|
+
## RTL
|
|
46
|
+
|
|
47
|
+
The surface inherits direction. Title and description use `dir="auto"` and action layout uses logical flex order.
|
|
48
|
+
|
|
49
|
+
## Accessibility
|
|
50
|
+
|
|
51
|
+
Use Alert Dialog for destructive or irreversible choices. Focus should land on the cancel action by default when you build higher-level confirmations. `ConfirmModal` is wired on top of this alert-dialog primitive for the constrained confirmation pattern.
|
|
52
|
+
|
|
53
|
+
## Install
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
npx banhaten add alert-dialog
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Examples
|
|
60
|
+
|
|
61
|
+
Primary registry example: `examples/alert-dialog-demo.tsx`.
|
|
62
|
+
|
|
63
|
+
Open the live component page or run `npx banhaten docs alert-dialog` to inspect source files, install command, and examples.
|
|
64
|
+
|
|
65
|
+
## RTL Rules
|
|
66
|
+
|
|
67
|
+
- `inheritsDirection`: true
|
|
68
|
+
- `textDirection`: Title and description use dir="auto" for Arabic and English copy.
|
|
69
|
+
- `spacing`: Header, body, and footer use logical layout and Banhaten spacing tokens so action order and copy mirror naturally.
|
|
70
|
+
- `semantics`: Radix AlertDialog provides the modal alert role, focus trap, and safe cancellation behavior.
|
|
71
|
+
|
|
72
|
+
<!-- registry-contract:start -->
|
|
73
|
+
## Registry Contract
|
|
74
|
+
|
|
75
|
+
This table is generated from `registry/index.json`; edit the component-owned source under `registry/catalog/components/`, not this table or the compiled index.
|
|
76
|
+
`supportedExports` is the exhaustive runtime import contract grouped by source module. `parts` is an ordered, non-exhaustive anatomy list.
|
|
77
|
+
|
|
78
|
+
| Field | Values |
|
|
79
|
+
| --- | --- |
|
|
80
|
+
| `supportedExports` | `components/alert-dialog.tsx: AlertDialog, AlertDialogAction, AlertDialogBody, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogIcon, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, alertDialogContentVariants` |
|
|
81
|
+
| `parts` | `AlertDialog`, `AlertDialogTrigger`, `AlertDialogContent`, `AlertDialogPortal`, `AlertDialogOverlay`, `AlertDialogHeader`, `AlertDialogIcon`, `AlertDialogTitle`, `AlertDialogDescription`, `AlertDialogBody`, `AlertDialogFooter`, `AlertDialogCancel`, `AlertDialogAction` |
|
|
82
|
+
| `registryDependencies` | `button` |
|
|
83
|
+
| `features` | `alert-dialog semantics`, `cancel focus pattern`, `safe cancel action`, `destructive action`, `semantic intent icon` |
|
|
84
|
+
| `intents` | `default`, `warning`, `danger` |
|
|
85
|
+
| `sizes` | `sm`, `default`, `lg` |
|
|
86
|
+
| `tokens` | `--bh-alert-dialog-border`, `--bh-alert-dialog-width`, `--bh-bg-backdrop`, `--bh-bg-danger-subtle`, `--bh-bg-neutral-subtle`, `--bh-bg-raised`, `--bh-bg-warning-subtle`, `--bh-border-subtle`, `--bh-border-width-default`, `--bh-content-danger-default`, `--bh-content-default`, `--bh-content-subtle`, `--bh-content-warning-default`, `--bh-icon-stroke-200`, `--bh-radius-2xl-12`, `--bh-radius-full`, `--bh-space-12xl-128`, `--bh-space-16xl-256`, `--bh-space-19xl-384`, `--bh-space-3xl-16`, `--bh-space-4xl-20`, `--bh-space-5xl-24`, `--bh-space-8xl-48`, `--bh-space-9xl-64`, `--bh-space-lg-10`, `--bh-space-md-8`, `--bh-space-sm-6`, `--bh-space-xs-4`, `--bh-text-body-md-regular-font-size`, `--bh-text-body-md-regular-font-weight`, `--bh-text-body-md-regular-letter-spacing`, `--bh-text-body-md-regular-line-height`, `--bh-text-heading-sm-semibold-font-size`, `--bh-text-heading-sm-semibold-font-weight`, `--bh-text-heading-sm-semibold-letter-spacing`, `--bh-text-heading-sm-semibold-line-height`, `--bh-z-overlay`, `--shadow-component-default`, `--shadow-modal` |
|
|
87
|
+
<!-- registry-contract:end -->
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# Alert
|
|
2
|
+
|
|
3
|
+
`Alert` presents contextual feedback with compact and expandable layouts.
|
|
4
|
+
|
|
5
|
+
Figma reference: `Design system 3.0 Copy / Alert`, node `158:4645`.
|
|
6
|
+
|
|
7
|
+
## Variants
|
|
8
|
+
|
|
9
|
+
The implementation covers the Alert matrix from Figma:
|
|
10
|
+
|
|
11
|
+
| Prop | Values |
|
|
12
|
+
| --- | --- |
|
|
13
|
+
| `status` | `danger`, `success`, `warning`, `info`, `neutral` |
|
|
14
|
+
| `isExpandable` | `false`, `true` |
|
|
15
|
+
| `dir` | `ltr`, `rtl` |
|
|
16
|
+
|
|
17
|
+
## API
|
|
18
|
+
|
|
19
|
+
```tsx
|
|
20
|
+
<Alert status="danger" title="Unable to save" />
|
|
21
|
+
<Alert
|
|
22
|
+
actions={[{ label: "عرض التفاصيل", onClick: openDetails }]}
|
|
23
|
+
status="success"
|
|
24
|
+
isExpandable
|
|
25
|
+
dir="rtl"
|
|
26
|
+
title="تم الحفظ"
|
|
27
|
+
/>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
| Prop | Default |
|
|
31
|
+
| --- | --- |
|
|
32
|
+
| `status` | `neutral` |
|
|
33
|
+
| `isExpandable` | `false`; requires at least one visible action |
|
|
34
|
+
| `dir` | inherited |
|
|
35
|
+
| `title` | none |
|
|
36
|
+
| `description` | none |
|
|
37
|
+
| `messages` | English close-button message; accepts partial localized overrides |
|
|
38
|
+
| `closeLabel` | overrides `messages.close` |
|
|
39
|
+
| `actions` | none |
|
|
40
|
+
| `showActions` | auto when actions exist |
|
|
41
|
+
| `showCloseButton` | auto when `onClose` exists |
|
|
42
|
+
| `onClose` | none |
|
|
43
|
+
|
|
44
|
+
## Pixel Rules
|
|
45
|
+
|
|
46
|
+
- Compact alerts are `470px` wide and `56px` tall with `16px` padding.
|
|
47
|
+
- Expandable alerts are `500px` wide, content-sized, and use `20px 16px` padding.
|
|
48
|
+
- `isExpandable` falls back to the compact layout when no action is visible.
|
|
49
|
+
- Compact rows use `8px` radius; expandable rows use `10px` radius.
|
|
50
|
+
- Status icons and close controls are `20px`; the close glyph is `16px`.
|
|
51
|
+
- Compact content uses `8px` between icon and title.
|
|
52
|
+
- Expanded titles align to the block-start edge of the status icon.
|
|
53
|
+
- Expandable content uses `12px` between icon, copy, close, and action rows.
|
|
54
|
+
- The description-to-actions gap remains exactly `12px` as copy wraps.
|
|
55
|
+
- Expanded action rows retain `20px` of block-end padding.
|
|
56
|
+
- Expanded height grows with title and description content; direction does not select a height.
|
|
57
|
+
- Titles use `15px / 24px` medium text.
|
|
58
|
+
- Descriptions use `14px / 20px` regular text at `80%` opacity.
|
|
59
|
+
|
|
60
|
+
## Token Contract
|
|
61
|
+
|
|
62
|
+
The component consumes Banhaten semantic tokens and component aliases. Do not hard-code Figma fallback literals in component source; promote any Figma value into its owned `tokens/source/` fragment as a `--bh-*` token or alias first.
|
|
63
|
+
|
|
64
|
+
- Backgrounds: `--bh-bg-danger-subtle`, `--bh-bg-success-subtle`, `--bh-bg-warning-subtle`, `--bh-bg-info-subtle`, `--bh-bg-neutral-subtle`
|
|
65
|
+
- Borders: `--bh-border-danger-subtle`, `--bh-border-success-subtle`, `--bh-border-warning-subtle`, `--bh-border-info-subtle`, `--bh-border-subtle`, `--bh-border-default`
|
|
66
|
+
- Content: `--bh-content-danger-strong`, `--bh-content-success-strong`, `--bh-content-warning-strong`, `--bh-content-brand-strong`, `--bh-content-default`
|
|
67
|
+
- Shape: `--bh-radius-lg-8`, `--bh-radius-xl-10`, `--bh-radius-full`
|
|
68
|
+
- Space: `--bh-space-md-8`, `--bh-space-xl-12`, `--bh-space-3xl-16`, `--bh-space-4xl-20`
|
|
69
|
+
|
|
70
|
+
## Accessibility
|
|
71
|
+
|
|
72
|
+
- The close affordance is a real button.
|
|
73
|
+
- Action links are rendered as real buttons to support product actions.
|
|
74
|
+
- Warning and danger use `role="alert"`; other statuses use `role="status"` unless overridden.
|
|
75
|
+
- `dir` inherits by default and controls visual and reading direction only.
|
|
76
|
+
- The close button keeps its English default under RTL. Pass `closeLabel` or `messages` for localized accessibility copy.
|
|
77
|
+
- Product copy and action behavior are always explicit; the component does not ship demo text or no-op controls.
|
|
78
|
+
|
|
79
|
+
## Install
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
npx banhaten add alert
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Examples
|
|
86
|
+
|
|
87
|
+
Primary registry example: `examples/alert-demo.tsx`.
|
|
88
|
+
|
|
89
|
+
Open the live component page or run `npx banhaten docs alert` to inspect source files, install command, and examples.
|
|
90
|
+
|
|
91
|
+
## RTL Rules
|
|
92
|
+
|
|
93
|
+
- `inheritsDirection`: true
|
|
94
|
+
- `messages`: Direction does not select the close-button language. Pass closeLabel or messages explicitly.
|
|
95
|
+
- `textAlignment`: Uses dir="auto" on title and description while the root dir prop mirrors icon, action, and close placement.
|
|
96
|
+
- `spacing`: Uses flexbox, gap, and logical direction so compact and expandable RTL layouts match the Figma matrix.
|
|
97
|
+
|
|
98
|
+
<!-- registry-contract:start -->
|
|
99
|
+
## Registry Contract
|
|
100
|
+
|
|
101
|
+
This table is generated from `registry/index.json`; edit the component-owned source under `registry/catalog/components/`, not this table or the compiled index.
|
|
102
|
+
`supportedExports` is the exhaustive runtime import contract grouped by source module. `parts` is an ordered, non-exhaustive anatomy list.
|
|
103
|
+
|
|
104
|
+
| Field | Values |
|
|
105
|
+
| --- | --- |
|
|
106
|
+
| `supportedExports` | `components/alert.tsx: Alert, alertVariants, arabicAlertMessages` |
|
|
107
|
+
| `parts` | `Alert` |
|
|
108
|
+
| `registryDependencies` | None |
|
|
109
|
+
| `tokens` | `--bh-alert-compact-height`, `--bh-alert-compact-padding`, `--bh-alert-compact-radius`, `--bh-alert-compact-width`, `--bh-alert-expanded-padding-x`, `--bh-alert-expanded-padding-y`, `--bh-alert-expanded-radius`, `--bh-alert-expanded-width`, `--bh-alert-icon-size`, `--bh-bg-danger-subtle`, `--bh-bg-info-subtle`, `--bh-bg-neutral-subtle`, `--bh-bg-success-subtle`, `--bh-bg-warning-subtle`, `--bh-border-danger-subtle`, `--bh-border-default`, `--bh-border-info-subtle`, `--bh-border-subtle`, `--bh-border-success-subtle`, `--bh-border-warning-subtle`, `--bh-border-width-default`, `--bh-content-brand-default`, `--bh-content-brand-strong`, `--bh-content-danger-default`, `--bh-content-danger-strong`, `--bh-content-default`, `--bh-content-subtle`, `--bh-content-success-default`, `--bh-content-success-strong`, `--bh-content-warning-default`, `--bh-content-warning-strong`, `--bh-font-family`, `--bh-font-weight-medium`, `--bh-font-weight-regular`, `--bh-icon-stroke-225`, `--bh-opacity-80`, `--bh-radius-full`, `--bh-space-3xl-16`, `--bh-space-md-8`, `--bh-space-xl-12`, `--bh-space-xs-4`, `--bh-space-xxs-2`, `--bh-text-base-letter-spacing`, `--bh-text-body-md-medium-font-size`, `--bh-text-body-md-medium-letter-spacing`, `--bh-text-body-md-medium-line-height`, `--bh-text-body-md-underline-font-size`, `--bh-text-body-md-underline-font-weight`, `--bh-text-body-md-underline-letter-spacing`, `--bh-text-body-md-underline-line-height`, `--bh-text-body-sm-regular-font-size`, `--bh-text-body-sm-regular-letter-spacing`, `--bh-text-body-sm-regular-line-height`, `--shadow-button-focus` |
|
|
110
|
+
| `variants` | `danger`, `success`, `warning`, `info`, `neutral` |
|
|
111
|
+
<!-- registry-contract:end -->
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Aspect Ratio
|
|
2
|
+
|
|
3
|
+
Aspect Ratio wraps Radix AspectRatio for fixed-format media, screenshots, and preview surfaces.
|
|
4
|
+
|
|
5
|
+
## API
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
<AspectRatio ratio={16 / 9}>
|
|
9
|
+
<img src="/preview.png" alt="Preview" />
|
|
10
|
+
</AspectRatio>
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
| Prop | Values |
|
|
14
|
+
| --- | --- |
|
|
15
|
+
| `ratio` | any positive number |
|
|
16
|
+
|
|
17
|
+
## Token Contract
|
|
18
|
+
|
|
19
|
+
Aspect Ratio uses Banhaten neutral background and radius tokens by default.
|
|
20
|
+
|
|
21
|
+
## RTL
|
|
22
|
+
|
|
23
|
+
Aspect Ratio is direction-neutral.
|
|
24
|
+
|
|
25
|
+
## Accessibility
|
|
26
|
+
|
|
27
|
+
Provide accessible names for media rendered inside the ratio box.
|
|
28
|
+
|
|
29
|
+
## Install
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npx banhaten add aspect-ratio
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Examples
|
|
36
|
+
|
|
37
|
+
Primary registry example: `examples/aspect-ratio-demo.tsx`.
|
|
38
|
+
|
|
39
|
+
Open the live component page or run `npx banhaten docs aspect-ratio` to inspect source files, install command, and examples.
|
|
40
|
+
|
|
41
|
+
## RTL Rules
|
|
42
|
+
|
|
43
|
+
- `inheritsDirection`: false
|
|
44
|
+
- `geometry`: Aspect Ratio controls media geometry and does not alter text direction.
|
|
45
|
+
|
|
46
|
+
<!-- registry-contract:start -->
|
|
47
|
+
## Registry Contract
|
|
48
|
+
|
|
49
|
+
This table is generated from `registry/index.json`; edit the component-owned source under `registry/catalog/components/`, not this table or the compiled index.
|
|
50
|
+
`supportedExports` is the exhaustive runtime import contract grouped by source module. `parts` is an ordered, non-exhaustive anatomy list.
|
|
51
|
+
|
|
52
|
+
| Field | Values |
|
|
53
|
+
| --- | --- |
|
|
54
|
+
| `supportedExports` | `components/aspect-ratio.tsx: AspectRatio` |
|
|
55
|
+
| `parts` | `AspectRatio` |
|
|
56
|
+
| `registryDependencies` | None |
|
|
57
|
+
| `features` | `fixed media ratios`, `preview surfaces`, `responsive sizing` |
|
|
58
|
+
| `tokens` | `--bh-bg-neutral-subtle`, `--bh-radius-xl-10` |
|
|
59
|
+
<!-- registry-contract:end -->
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# Attribute
|
|
2
|
+
|
|
3
|
+
Attribute is a semantic description-list component for key-value information. It supports card headers, inline rows, right-aligned values, stacked mobile rows, two-column summaries, row dividers, bordered row groups, compact density, and RTL direction.
|
|
4
|
+
|
|
5
|
+
The implementation follows the Figma component at `Design system 3.0 Copy / Attribute Card` (`255:123238`) and uses only existing Banhaten tokens.
|
|
6
|
+
|
|
7
|
+
## API
|
|
8
|
+
|
|
9
|
+
Use `AttributeCard` for the surface, `AttributeHeader` for optional title and description content, `AttributeList` for the `dl`, and `AttributeItem` for each `dt`/`dd` pair.
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
<AttributeCard>
|
|
13
|
+
<AttributeHeader
|
|
14
|
+
title="Company profile"
|
|
15
|
+
description="Key-value information in a scannable card."
|
|
16
|
+
/>
|
|
17
|
+
<AttributeList>
|
|
18
|
+
<AttributeItem label="Name">Acme Corporation</AttributeItem>
|
|
19
|
+
<AttributeItem label="Type">Business</AttributeItem>
|
|
20
|
+
<AttributeItem label="Industry">Software</AttributeItem>
|
|
21
|
+
</AttributeList>
|
|
22
|
+
</AttributeCard>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Variants
|
|
26
|
+
|
|
27
|
+
| Prop | Values |
|
|
28
|
+
| --- | --- |
|
|
29
|
+
| `AttributeCard padding` | `default`, `compact` |
|
|
30
|
+
| `AttributeList layout` | `inline`, `end`, `stacked`, `two-column` |
|
|
31
|
+
| `AttributeList density` | `compact`, `default`, `comfortable` |
|
|
32
|
+
| `AttributeList dividers` | `boolean` |
|
|
33
|
+
| `AttributeList bordered` | `boolean` |
|
|
34
|
+
| `AttributeList labelWidth` | CSS length, default `220px` |
|
|
35
|
+
| `AttributeItem fullSpan` | `boolean`, useful in `two-column` layouts |
|
|
36
|
+
| `AttributeItem truncate` | `boolean` |
|
|
37
|
+
|
|
38
|
+
## Composition
|
|
39
|
+
|
|
40
|
+
Values are open React slots. Compose existing primitives for status badges, copy buttons, file rows, progress bars, skeleton bars, links, and custom details.
|
|
41
|
+
|
|
42
|
+
```tsx
|
|
43
|
+
<AttributeList layout="end" dividers>
|
|
44
|
+
<AttributeItem label="Subscription">
|
|
45
|
+
<Badge color="green" type="dot">Active</Badge>
|
|
46
|
+
</AttributeItem>
|
|
47
|
+
<AttributeItem label="API key" truncate>
|
|
48
|
+
sk_live_************1234
|
|
49
|
+
<Button aria-label="Copy API key" size="icon-xs" variant="outline">
|
|
50
|
+
<CopyIcon />
|
|
51
|
+
</Button>
|
|
52
|
+
</AttributeItem>
|
|
53
|
+
</AttributeList>
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## RTL
|
|
57
|
+
|
|
58
|
+
Attribute inherits direction from any parent. The component uses logical text alignment and `dir="auto"` wrappers for string labels and values, so Arabic and English content can sit in the same card without manual left/right classes.
|
|
59
|
+
|
|
60
|
+
## Install
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
npx banhaten add attribute
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Examples
|
|
67
|
+
|
|
68
|
+
Primary registry example: `examples/attribute-demo.tsx`.
|
|
69
|
+
|
|
70
|
+
Open the live component page or run `npx banhaten docs attribute` to inspect source files, install command, and examples.
|
|
71
|
+
|
|
72
|
+
## Token Contract
|
|
73
|
+
|
|
74
|
+
Component styles must resolve through Banhaten semantic tokens, component aliases, or documented exception-ledger values.
|
|
75
|
+
Do not add raw colors, pixel values, opacity utilities, z-index values, durations, or shadow literals directly to component source.
|
|
76
|
+
Covered source files: `components/attribute.tsx`.
|
|
77
|
+
|
|
78
|
+
## RTL Rules
|
|
79
|
+
|
|
80
|
+
- `inheritsDirection`: true
|
|
81
|
+
- `layout`: Uses logical text alignment and inherited direction so label and value columns mirror naturally.
|
|
82
|
+
- `textDirection`: String labels and values use dir="auto" wrappers while custom slots can control their own direction.
|
|
83
|
+
- `composition`: Rows accept ReactNode values, so badges, buttons, links, progress bars, skeletons, files, and custom content can be composed from existing Banhaten primitives.
|
|
84
|
+
|
|
85
|
+
## Accessibility
|
|
86
|
+
|
|
87
|
+
Keep native semantics, accessible names, keyboard reachability, focus-visible treatment, and status/error announcements intact when composing this component.
|
|
88
|
+
|
|
89
|
+
<!-- registry-contract:start -->
|
|
90
|
+
## Registry Contract
|
|
91
|
+
|
|
92
|
+
This table is generated from `registry/index.json`; edit the component-owned source under `registry/catalog/components/`, not this table or the compiled index.
|
|
93
|
+
`supportedExports` is the exhaustive runtime import contract grouped by source module. `parts` is an ordered, non-exhaustive anatomy list.
|
|
94
|
+
|
|
95
|
+
| Field | Values |
|
|
96
|
+
| --- | --- |
|
|
97
|
+
| `supportedExports` | `components/attribute.tsx: AttributeCard, AttributeHeader, AttributeItem, AttributeLabel, AttributeList, AttributeValue, attributeCardVariants, attributeHeaderVariants, attributeItemVariants, attributeLabelVariants, attributeListVariants, attributeValueVariants` |
|
|
98
|
+
| `parts` | `AttributeCard`, `AttributeHeader`, `AttributeList`, `AttributeItem`, `AttributeLabel`, `AttributeValue` |
|
|
99
|
+
| `registryDependencies` | None |
|
|
100
|
+
| `densities` | `compact`, `default`, `comfortable` |
|
|
101
|
+
| `layouts` | `inline`, `end`, `stacked`, `two-column` |
|
|
102
|
+
| `tokens` | `--bh-attribute-header-icon-size`, `--bh-attribute-header-icon-size-lg`, `--bh-attribute-label-width`, `--bh-bg-default`, `--bh-bg-neutral-soft`, `--bh-border-subtle`, `--bh-content-default`, `--bh-content-subtle`, `--bh-radius-2xl-12`, `--bh-radius-full`, `--bh-radius-lg-8`, `--bh-space-3xl-16`, `--bh-space-4xl-20`, `--bh-space-5xl-24`, `--bh-space-6xl-32`, `--bh-space-md-8`, `--bh-space-sm-6`, `--bh-space-xl-12`, `--bh-space-xs-4`, `--bh-text-body-md-medium-font-size`, `--bh-text-body-md-medium-font-weight`, `--bh-text-body-md-medium-letter-spacing`, `--bh-text-body-md-medium-line-height`, `--bh-text-body-md-regular-font-size`, `--bh-text-body-md-regular-font-weight`, `--bh-text-body-md-regular-letter-spacing`, `--bh-text-body-md-regular-line-height`, `--bh-text-heading-sm-medium-font-size`, `--bh-text-heading-sm-medium-font-weight`, `--bh-text-heading-sm-medium-letter-spacing`, `--bh-text-heading-sm-medium-line-height` |
|
|
103
|
+
<!-- registry-contract:end -->
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# Autocomplete
|
|
2
|
+
|
|
3
|
+
Autocomplete is a searchable combobox field for choosing one or many known options.
|
|
4
|
+
|
|
5
|
+
The implementation is intentionally composed from existing Banhaten primitives: `Input` owns the field surface, `SelectMenu` and `SelectMenuItem` own the result list, and `Tag` owns selected multi-value chips. The component adds filtering, selected-value state, keyboard navigation, ARIA combobox wiring, and controlled or uncontrolled APIs.
|
|
6
|
+
|
|
7
|
+
## API
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
<Autocomplete
|
|
11
|
+
label="Owner"
|
|
12
|
+
placeholder="Search people"
|
|
13
|
+
options={[
|
|
14
|
+
{ value: "ahmed", label: "Ahmed Galal", addonText: "Design system" },
|
|
15
|
+
{ value: "nora", label: "Nora Ali", addonText: "Product" },
|
|
16
|
+
]}
|
|
17
|
+
/>
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
| Prop | Values | Default |
|
|
21
|
+
| --- | --- | --- |
|
|
22
|
+
| `options` | `{ value, label, addonText, itemType, media, keywords, disabled }[]` | required |
|
|
23
|
+
| `selectionMode` | `single`, `multiple` | `single` |
|
|
24
|
+
| `value` / `defaultValue` | `string` or `string[]` | none |
|
|
25
|
+
| `inputValue` / `defaultInputValue` | `string` | inferred from selected single value |
|
|
26
|
+
| `open` / `defaultOpen` | `boolean` | `false` |
|
|
27
|
+
| `filterOptions` | custom filtering function | label, value, and keywords filter |
|
|
28
|
+
| `size` | `md`, `lg` | `lg` |
|
|
29
|
+
| `variant` | `default`, `soft` | `default` |
|
|
30
|
+
| `state` | `default`, `filled`, `error`, `disabled` | inferred |
|
|
31
|
+
| `dir` | `ltr`, `rtl`, `auto` | inherited |
|
|
32
|
+
|
|
33
|
+
## Composition Rules
|
|
34
|
+
|
|
35
|
+
- Use autocomplete for known option sets that benefit from search.
|
|
36
|
+
- Use `Select` when the option set is short and browsing is faster than typing.
|
|
37
|
+
- Use `selectionMode="multiple"` when selected options need removable chips; chips render with `Tag`.
|
|
38
|
+
- Keep async fetching, debouncing, and remote loading in product code by controlling `inputValue`, `open`, and `options`.
|
|
39
|
+
- Keep option labels concise. Use `addonText` for secondary metadata.
|
|
40
|
+
|
|
41
|
+
## Accessibility
|
|
42
|
+
|
|
43
|
+
- The input uses `role="combobox"`, `aria-autocomplete="list"`, `aria-expanded`, `aria-controls`, and `aria-activedescendant`.
|
|
44
|
+
- Results render as a `listbox` using Select menu rows.
|
|
45
|
+
- Arrow keys move the active option, `Enter` selects, `Escape` closes, and `Backspace` removes the last selected tag in multiple mode when the search field is empty.
|
|
46
|
+
- Labels and helper text are associated with the input, and error state maps to `aria-invalid`.
|
|
47
|
+
|
|
48
|
+
## Token Contract
|
|
49
|
+
|
|
50
|
+
Autocomplete consumes tokens through the primitives it composes:
|
|
51
|
+
|
|
52
|
+
- Field surface, typography, icon sizing, focus ring, and disabled/error states from `Input`.
|
|
53
|
+
- Menu surface, item rows, hover state, selected check, and item media slots from `Select`.
|
|
54
|
+
- Removable selected chips from `Tag`.
|
|
55
|
+
- Additional layout uses spacing, content, and z-index tokens only.
|
|
56
|
+
|
|
57
|
+
## Install
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
npx banhaten add autocomplete
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Examples
|
|
64
|
+
|
|
65
|
+
Primary registry example: `examples/autocomplete-demo.tsx`.
|
|
66
|
+
|
|
67
|
+
Open the live component page or run `npx banhaten docs autocomplete` to inspect source files, install command, and examples.
|
|
68
|
+
|
|
69
|
+
## RTL Rules
|
|
70
|
+
|
|
71
|
+
- `inheritsDirection`: true
|
|
72
|
+
- `composition`: Uses the existing Input field, Select menu and menu item rows, and Tag chips instead of introducing new visual primitives.
|
|
73
|
+
- `spacing`: Uses logical positioning, logical gaps, and inherited direction so the input, menu rows, checks, helper text, and selected tags mirror naturally.
|
|
74
|
+
- `textDirection`: Labels, option text, helper text, and tag labels use dir="auto" through the composed primitives.
|
|
75
|
+
|
|
76
|
+
<!-- registry-contract:start -->
|
|
77
|
+
## Registry Contract
|
|
78
|
+
|
|
79
|
+
This table is generated from `registry/index.json`; edit the component-owned source under `registry/catalog/components/`, not this table or the compiled index.
|
|
80
|
+
`supportedExports` is the exhaustive runtime import contract grouped by source module. `parts` is an ordered, non-exhaustive anatomy list.
|
|
81
|
+
|
|
82
|
+
| Field | Values |
|
|
83
|
+
| --- | --- |
|
|
84
|
+
| `supportedExports` | `components/autocomplete.tsx: Autocomplete, defaultFilterOptions` |
|
|
85
|
+
| `parts` | `Autocomplete` |
|
|
86
|
+
| `registryDependencies` | `input`, `popover`, `select`, `tag` |
|
|
87
|
+
| `features` | `filtering`, `keyboard navigation`, `controlled value`, `controlled input value`, `controlled open state`, `selected tags`, `empty state` |
|
|
88
|
+
| `modes` | `single`, `multiple` |
|
|
89
|
+
| `sizes` | `md`, `lg` |
|
|
90
|
+
| `states` | `default`, `filled`, `error`, `disabled` |
|
|
91
|
+
| `tokens` | `--bh-autocomplete-menu-max-height`, `--bh-content-subtle`, `--bh-icon-stroke-225`, `--bh-input-icon-size`, `--bh-input-width`, `--bh-select-item-hover-bg`, `--bh-select-item-padding-x`, `--bh-select-menu-width`, `--bh-select-width`, `--bh-space-18xl-320`, `--bh-space-md-8`, `--bh-space-xs-4`, `--bh-text-body-sm-regular-font-size`, `--bh-text-body-sm-regular-font-weight`, `--bh-text-body-sm-regular-letter-spacing`, `--bh-text-body-sm-regular-line-height` |
|
|
92
|
+
| `variants` | `default`, `soft` |
|
|
93
|
+
<!-- registry-contract:end -->
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Avatar
|
|
2
|
+
|
|
3
|
+
Avatar represents people, accounts, teams, and system actors. It supports images, initials, icon fallback, circular or rounded forms, status dots, action overlays, stacked groups, group counts, size scale, and RTL-safe overlap.
|
|
4
|
+
|
|
5
|
+
## API
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
<Avatar name="Ahmed Galal" src="/avatars/avatar-01.jpg" status="available" />
|
|
9
|
+
|
|
10
|
+
<AvatarGroup>
|
|
11
|
+
<Avatar name="Nora" />
|
|
12
|
+
<Avatar name="Omar" />
|
|
13
|
+
<AvatarGroupCount>+4</AvatarGroupCount>
|
|
14
|
+
</AvatarGroup>
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
| Prop | Values |
|
|
18
|
+
| --- | --- |
|
|
19
|
+
| `size` | `2xs`, `xs`, `sm`, `md`, `lg`, `xl`, `2xl`, `3xl`, `4xl` |
|
|
20
|
+
| `form` | `circular`, `rounded` |
|
|
21
|
+
| `status` | `offline`, `busy`, `blocked`, `available`, `away` |
|
|
22
|
+
| `action` | `custom`, `edit`, `verified`, `remove` |
|
|
23
|
+
|
|
24
|
+
## Token Contract
|
|
25
|
+
|
|
26
|
+
Avatar consumes Banhaten radius, sizing, border, shadow, status, background, and content tokens. Status and action markers should stay token-bound so themes and dark mode remain consistent.
|
|
27
|
+
|
|
28
|
+
## RTL
|
|
29
|
+
|
|
30
|
+
Avatar groups use logical negative margin so overlap reverses naturally in RTL. Status and action affordances use logical end placement.
|
|
31
|
+
|
|
32
|
+
## Accessibility
|
|
33
|
+
|
|
34
|
+
Use `name` or accessible image alt text for user avatars. Decorative grouped avatars can be hidden from assistive tech when the surrounding row already names the people.
|
|
35
|
+
|
|
36
|
+
## Install
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
npx banhaten add avatar
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Examples
|
|
43
|
+
|
|
44
|
+
Primary registry example: `examples/avatar-demo.tsx`.
|
|
45
|
+
|
|
46
|
+
Open the live component page or run `npx banhaten docs avatar` to inspect source files, install command, and examples.
|
|
47
|
+
|
|
48
|
+
## RTL Rules
|
|
49
|
+
|
|
50
|
+
- `inheritsDirection`: true
|
|
51
|
+
- `groupOverlap`: Uses logical -ms spacing so overlap reverses naturally in RTL.
|
|
52
|
+
- `badgePlacement`: Status dots use logical end/bottom positioning; avatar actions use logical end/top positioning.
|
|
53
|
+
|
|
54
|
+
<!-- registry-contract:start -->
|
|
55
|
+
## Registry Contract
|
|
56
|
+
|
|
57
|
+
This table is generated from `registry/index.json`; edit the component-owned source under `registry/catalog/components/`, not this table or the compiled index.
|
|
58
|
+
`supportedExports` is the exhaustive runtime import contract grouped by source module. `parts` is an ordered, non-exhaustive anatomy list.
|
|
59
|
+
|
|
60
|
+
| Field | Values |
|
|
61
|
+
| --- | --- |
|
|
62
|
+
| `supportedExports` | `components/avatar.tsx: Avatar, AvatarAction, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarIcon, AvatarImage, AvatarStatus, avatarActionVariants, avatarStatusVariants, avatarVariants` |
|
|
63
|
+
| `parts` | `Avatar`, `AvatarImage`, `AvatarFallback`, `AvatarIcon`, `AvatarBadge`, `AvatarStatus`, `AvatarAction`, `AvatarGroup`, `AvatarGroupCount` |
|
|
64
|
+
| `registryDependencies` | None |
|
|
65
|
+
| `actions` | `custom`, `edit`, `verified`, `remove` |
|
|
66
|
+
| `forms` | `circular`, `rounded` |
|
|
67
|
+
| `sizes` | `2xs`, `xs`, `sm`, `md`, `lg`, `xl`, `2xl`, `3xl`, `4xl` |
|
|
68
|
+
| `statusColors` | `offline`, `busy`, `blocked`, `available`, `away` |
|
|
69
|
+
| `tokens` | `--bh-avatar-action-icon-size`, `--bh-avatar-action-icon-size-2xl`, `--bh-avatar-action-icon-size-3xl`, `--bh-avatar-action-icon-size-4xl`, `--bh-avatar-action-icon-size-large`, `--bh-avatar-action-icon-size-medium`, `--bh-avatar-action-icon-size-small`, `--bh-avatar-action-icon-size-tiny`, `--bh-avatar-action-icon-size-xlarge`, `--bh-avatar-action-icon-size-xsmall`, `--bh-avatar-action-size`, `--bh-avatar-action-size-2xl`, `--bh-avatar-action-size-3xl`, `--bh-avatar-action-size-4xl`, `--bh-avatar-action-size-large`, `--bh-avatar-action-size-medium`, `--bh-avatar-action-size-small`, `--bh-avatar-action-size-tiny`, `--bh-avatar-action-size-xlarge`, `--bh-avatar-action-size-xsmall`, `--bh-avatar-fallback-font-size-2xl`, `--bh-avatar-fallback-font-size-2xs`, `--bh-avatar-fallback-font-size-3xl`, `--bh-avatar-fallback-font-size-4xl`, `--bh-avatar-fallback-font-size-lg`, `--bh-avatar-fallback-font-size-md`, `--bh-avatar-fallback-font-size-sm`, `--bh-avatar-fallback-font-size-xl`, `--bh-avatar-fallback-font-size-xs`, `--bh-avatar-fallback-size`, `--bh-avatar-icon-size`, `--bh-avatar-icon-size-2xl`, `--bh-avatar-icon-size-2xs`, `--bh-avatar-icon-size-3xl`, `--bh-avatar-icon-size-4xl`, `--bh-avatar-icon-size-lg`, `--bh-avatar-icon-size-md`, `--bh-avatar-icon-size-sm`, `--bh-avatar-icon-size-xl`, `--bh-avatar-icon-size-xs`, `--bh-avatar-radius`, `--bh-avatar-size`, `--bh-avatar-size-2xl`, `--bh-avatar-size-2xs`, `--bh-avatar-size-3xl`, `--bh-avatar-size-4xl`, `--bh-avatar-size-lg`, `--bh-avatar-size-md`, `--bh-avatar-size-sm`, `--bh-avatar-size-xl`, `--bh-avatar-size-xs`, `--bh-avatar-status-ring`, `--bh-avatar-status-ring-default`, `--bh-avatar-status-ring-thin`, `--bh-avatar-status-size`, `--bh-avatar-status-size-large`, `--bh-avatar-status-size-medium`, `--bh-avatar-status-size-small`, `--bh-avatar-status-size-tiny`, `--bh-avatar-status-size-xlarge`, `--bh-avatar-status-size-xsmall`, `--bh-bg-accent-golden-default`, `--bh-bg-accent-red-default`, `--bh-bg-accent-sky-base`, `--bh-bg-default`, `--bh-bg-neutral-default`, `--bh-bg-neutral-medium`, `--bh-bg-neutral-subtle`, `--bh-bg-success-default`, `--bh-border-width-default`, `--bh-content-on-brand`, `--bh-content-subtle`, `--bh-font-weight-semibold`, `--bh-icon-stroke-210`, `--bh-icon-stroke-240`, `--bh-icon-stroke-260`, `--bh-icon-stroke-280`, `--bh-interactive-brand-default`, `--bh-interactive-danger-default`, `--bh-radius-full`, `--bh-radius-lg-8`, `--bh-space-md-8`, `--bh-space-none`, `--bh-space-xl-12`, `--bh-space-xxs-2`, `--bh-text-body-sm-medium-font-size`, `--shadow-avatar-badge` |
|
|
70
|
+
<!-- registry-contract:end -->
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Badge
|
|
2
|
+
|
|
3
|
+
Badge is a compact status, count, classification, or metadata primitive. It supports light, outline, and solid styles; semantic color families; dot, flag, leading icon, trailing icon, numeric, and split-action compositions; and RTL-safe layout.
|
|
4
|
+
|
|
5
|
+
## API
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
<Badge color="green">Active</Badge>
|
|
9
|
+
<Badge color="blue" type="dot">New</Badge>
|
|
10
|
+
<Badge color="neutral" type="trailing-icon" splitAction>
|
|
11
|
+
Filter
|
|
12
|
+
</Badge>
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
| Prop | Values | Default |
|
|
16
|
+
| --- | --- | --- |
|
|
17
|
+
| `style` | `light`, `outline`, `solid` | `light` |
|
|
18
|
+
| `color` | `neutral`, `blue`, `green`, `amber`, `danger`, `purple`, `fuchsia`, `rose`, `sky`, `golden` | `neutral` |
|
|
19
|
+
| `type` | `default`, `leading-icon`, `trailing-icon`, `dot`, `flag` | `default` |
|
|
20
|
+
| `size` | `sm`, `lg` | `sm` |
|
|
21
|
+
| `splitAction` | `boolean` | `false` |
|
|
22
|
+
|
|
23
|
+
## Token Contract
|
|
24
|
+
|
|
25
|
+
Badge uses semantic content, background, border, radius, typography, icon, opacity, and focus tokens. Provider or brand colors should be added through semantic aliases, not raw literals.
|
|
26
|
+
|
|
27
|
+
## RTL
|
|
28
|
+
|
|
29
|
+
Use `data-icon="inline-start"` or `data-icon="inline-end"` on icons. Directional arrows should also set `data-rtl-flip="true"`.
|
|
30
|
+
|
|
31
|
+
## Accessibility
|
|
32
|
+
|
|
33
|
+
Badges are usually descriptive text. Do not use color alone for critical status; include a readable label such as `Failed`, `Warning`, or `Active`.
|
|
34
|
+
|
|
35
|
+
## Install
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npx banhaten add badge
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Examples
|
|
42
|
+
|
|
43
|
+
Primary registry example: `examples/badge-demo.tsx`.
|
|
44
|
+
|
|
45
|
+
Open the live component page or run `npx banhaten docs badge` to inspect source files, install command, and examples.
|
|
46
|
+
|
|
47
|
+
## RTL Rules
|
|
48
|
+
|
|
49
|
+
- `inheritsDirection`: true
|
|
50
|
+
- `iconPlacement`: Set type="leading-icon" or type="trailing-icon" and use data-icon="inline-start" or data-icon="inline-end". Add splitAction to give a trailing icon its own token-sized compartment.
|
|
51
|
+
- `directionalIconFlip`: Use data-rtl-flip="true" on arrows that should mirror.
|
|
52
|
+
- `textDirection`: Uses dir="auto" by default for short Arabic and English labels.
|
|
53
|
+
- `legacyVariants`: The previous variant prop is still accepted as a compatibility shim.
|
|
54
|
+
|
|
55
|
+
<!-- registry-contract:start -->
|
|
56
|
+
## Registry Contract
|
|
57
|
+
|
|
58
|
+
This table is generated from `registry/index.json`; edit the component-owned source under `registry/catalog/components/`, not this table or the compiled index.
|
|
59
|
+
`supportedExports` is the exhaustive runtime import contract grouped by source module. `parts` is an ordered, non-exhaustive anatomy list.
|
|
60
|
+
|
|
61
|
+
| Field | Values |
|
|
62
|
+
| --- | --- |
|
|
63
|
+
| `supportedExports` | `components/badge.tsx: Badge, badgeVariants` |
|
|
64
|
+
| `parts` | `Badge` |
|
|
65
|
+
| `registryDependencies` | None |
|
|
66
|
+
| `colors` | `neutral`, `blue`, `green`, `amber`, `danger`, `purple`, `fuchsia`, `rose`, `sky`, `golden` |
|
|
67
|
+
| `options` | `splitAction` |
|
|
68
|
+
| `sizes` | `sm`, `lg` |
|
|
69
|
+
| `styles` | `light`, `outline`, `solid` |
|
|
70
|
+
| `tokens` | `--bh-badge-focus-ring-width`, `--bh-badge-outline-border-width`, `--bh-bg-accent-amber-default`, `--bh-bg-accent-amber-subtle`, `--bh-bg-accent-blue-default`, `--bh-bg-accent-blue-subtle`, `--bh-bg-accent-fuchsia-default`, `--bh-bg-accent-fuchsia-subtle`, `--bh-bg-accent-golden-default`, `--bh-bg-accent-golden-subtle`, `--bh-bg-accent-green-default`, `--bh-bg-accent-green-subtle`, `--bh-bg-accent-purple-default`, `--bh-bg-accent-purple-subtle`, `--bh-bg-accent-red-default`, `--bh-bg-accent-red-subtle`, `--bh-bg-accent-rose-default`, `--bh-bg-accent-rose-subtle`, `--bh-bg-accent-sky-base`, `--bh-bg-accent-sky-subtle`, `--bh-bg-neutral-default`, `--bh-bg-neutral-subtle`, `--bh-border-accent-amber-strong`, `--bh-border-accent-amber-subtle`, `--bh-border-accent-blue-strong`, `--bh-border-accent-blue-subtle`, `--bh-border-accent-fuchsia-strong`, `--bh-border-accent-fuchsia-subtle`, `--bh-border-accent-golden-strong`, `--bh-border-accent-golden-subtle`, `--bh-border-accent-green-strong`, `--bh-border-accent-green-subtle`, `--bh-border-accent-purple-strong`, `--bh-border-accent-purple-subtle`, `--bh-border-accent-red-strong`, `--bh-border-accent-red-subtle`, `--bh-border-accent-rose-strong`, `--bh-border-accent-rose-subtle`, `--bh-border-accent-sky-strong`, `--bh-border-accent-sky-subtle`, `--bh-border-default`, `--bh-border-focus`, `--bh-border-focus-danger`, `--bh-border-strong`, `--bh-border-subtle`, `--bh-content-accent-amber-default`, `--bh-content-accent-amber-strong`, `--bh-content-accent-blue-default`, `--bh-content-accent-blue-strong`, `--bh-content-accent-fuchsia-default`, `--bh-content-accent-fuchsia-strong`, `--bh-content-accent-golden-default`, `--bh-content-accent-golden-strong`, `--bh-content-accent-green-default`, `--bh-content-accent-green-strong`, `--bh-content-accent-purple-default`, `--bh-content-accent-purple-strong`, `--bh-content-accent-red-default`, `--bh-content-accent-red-strong`, `--bh-content-accent-rose-default`, `--bh-content-accent-rose-strong`, `--bh-content-accent-sky-default`, `--bh-content-accent-sky-strong`, `--bh-content-default`, `--bh-content-link`, `--bh-content-muted`, `--bh-content-on-color`, `--bh-content-on-light`, `--bh-content-subtle`, `--bh-interactive-ghost-default`, `--bh-opacity-35`, `--bh-radius-full`, `--bh-radius-xs-2`, `--bh-space-2xl-14`, `--bh-space-3xl-16`, `--bh-space-5xl-24`, `--bh-space-md-8`, `--bh-space-none`, `--bh-space-sm-6`, `--bh-space-xl-12`, `--bh-space-xs-4`, `--bh-text-body-2xs-medium-font-size`, `--bh-text-body-2xs-medium-font-weight`, `--bh-text-body-2xs-medium-letter-spacing`, `--bh-text-body-2xs-medium-line-height`, `--bh-text-body-2xs-semibold-font-weight`, `--bh-text-body-3xs-medium-font-size`, `--bh-text-body-3xs-medium-font-weight`, `--bh-text-body-3xs-medium-letter-spacing`, `--bh-text-body-3xs-medium-line-height`, `--bh-text-body-3xs-semibold-font-weight` |
|
|
71
|
+
| `types` | `default`, `leading-icon`, `trailing-icon`, `dot`, `flag` |
|
|
72
|
+
<!-- registry-contract:end -->
|