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,72 @@
|
|
|
1
|
+
# Empty State
|
|
2
|
+
|
|
3
|
+
Empty State is a reusable result-state composition for no-results, first-run, or cleared workflow moments. It uses a neutral tokenized icon halo, 17px semibold title text, 15px regular supporting copy, and optional Banhaten Button actions.
|
|
4
|
+
|
|
5
|
+
## API
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
<EmptyState
|
|
9
|
+
title="No results found"
|
|
10
|
+
description="Try adjusting your search or filters"
|
|
11
|
+
actions={[
|
|
12
|
+
{ label: "Reset filters", variant: "secondary" },
|
|
13
|
+
{ label: "Create item" },
|
|
14
|
+
]}
|
|
15
|
+
/>
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
| Prop | Values | Default |
|
|
19
|
+
| --- | --- | --- |
|
|
20
|
+
| `title` | `ReactNode` | required |
|
|
21
|
+
| `description` | `ReactNode` | none |
|
|
22
|
+
| `icon` | `ReactNode` | `SearchIcon` |
|
|
23
|
+
| `iconLabel` | `string` | decorative icon |
|
|
24
|
+
| `actions` | `EmptyStateAction[]` | `[]` |
|
|
25
|
+
| `align` | `center`, `start` | `center` |
|
|
26
|
+
| `size` | `default`, `compact` | `default` |
|
|
27
|
+
| `dir` | `ltr`, `rtl`, `auto` | `ltr` |
|
|
28
|
+
|
|
29
|
+
## Token Contract
|
|
30
|
+
|
|
31
|
+
- Icon halo: `--bh-bg-neutral-subtle`, `--bh-bg-neutral-soft`, `--bh-radius-full`
|
|
32
|
+
- Title: `--bh-text-heading-xs-semibold-*`, `--bh-content-default`
|
|
33
|
+
- Description: `--bh-text-body-md-regular-*`, `--bh-content-subtle`
|
|
34
|
+
- Spacing and sizing: `--bh-space-*`
|
|
35
|
+
- Actions: existing `Button` component variants and token contract
|
|
36
|
+
|
|
37
|
+
## RTL Rules
|
|
38
|
+
|
|
39
|
+
`EmptyState` inherits logical alignment through `dir`. Text uses `dir="auto"` so Arabic and English copy resolve naturally, while the action row preserves logical order in RTL containers.
|
|
40
|
+
|
|
41
|
+
## Install
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npx banhaten add empty-state
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Examples
|
|
48
|
+
|
|
49
|
+
Primary registry example: `examples/expanded/empty-state-demo.tsx`.
|
|
50
|
+
|
|
51
|
+
Open the live component page or run `npx banhaten docs empty-state` to inspect source files, install command, and examples.
|
|
52
|
+
|
|
53
|
+
## Accessibility
|
|
54
|
+
|
|
55
|
+
Keep native semantics, accessible names, keyboard reachability, focus-visible treatment, and status/error announcements intact when composing this component.
|
|
56
|
+
|
|
57
|
+
<!-- registry-contract:start -->
|
|
58
|
+
## Registry Contract
|
|
59
|
+
|
|
60
|
+
This table is generated from `registry/index.json`; edit the component-owned source under `registry/catalog/components/`, not this table or the compiled index.
|
|
61
|
+
`supportedExports` is the exhaustive runtime import contract grouped by source module. `parts` is an ordered, non-exhaustive anatomy list.
|
|
62
|
+
|
|
63
|
+
| Field | Values |
|
|
64
|
+
| --- | --- |
|
|
65
|
+
| `supportedExports` | `components/expanded/EmptyState.tsx: EmptyState` |
|
|
66
|
+
| `parts` | `EmptyState` |
|
|
67
|
+
| `registryDependencies` | `button` |
|
|
68
|
+
| `alignments` | `center`, `start` |
|
|
69
|
+
| `features` | `neutral icon halo`, `title and description copy`, `primary and secondary actions`, `custom icon`, `RTL` |
|
|
70
|
+
| `sizes` | `default`, `compact` |
|
|
71
|
+
| `tokens` | `--bh-bg-neutral-subtle`, `--bh-content-default`, `--bh-content-subtle`, `--bh-empty-state-icon-stroke-width`, `--bh-font-family`, `--bh-radius-full`, `--bh-space-10xl-80`, `--bh-space-13xl-160`, `--bh-space-16xl-256`, `--bh-space-19xl-384`, `--bh-space-3xl-16`, `--bh-space-5xl-24`, `--bh-space-6xl-32`, `--bh-space-9xl-64`, `--bh-space-xl-12`, `--bh-space-xs-4`, `--bh-text-base-letter-spacing`, `--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-xs-semibold-font-size`, `--bh-text-heading-xs-semibold-font-weight`, `--bh-text-heading-xs-semibold-letter-spacing`, `--bh-text-heading-xs-semibold-line-height` |
|
|
72
|
+
<!-- registry-contract:end -->
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# Field
|
|
2
|
+
|
|
3
|
+
Field composes labels, controls, descriptions, and validation errors into accessible form rows. It gives Banhaten a shared form anatomy without forcing a validation library.
|
|
4
|
+
|
|
5
|
+
## API
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
<Field invalid>
|
|
9
|
+
<FieldLabel>Email</FieldLabel>
|
|
10
|
+
<FieldControl>
|
|
11
|
+
<Input state="error" />
|
|
12
|
+
</FieldControl>
|
|
13
|
+
<FieldError>Enter a valid email address.</FieldError>
|
|
14
|
+
</Field>
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
| Part | Purpose |
|
|
18
|
+
| --- | --- |
|
|
19
|
+
| `Field` | row context, ids, invalid and disabled state |
|
|
20
|
+
| `FieldLabel` | label connected to the control id |
|
|
21
|
+
| `FieldControl` | `asChild` slot that wires id and ARIA state |
|
|
22
|
+
| `FieldDescription` | helper text |
|
|
23
|
+
| `FieldError` | validation message with alert role |
|
|
24
|
+
| `FieldSet`, `FieldLegend`, `FieldGroup`, `FieldContent` | grouped form layout |
|
|
25
|
+
|
|
26
|
+
## Validation Pattern
|
|
27
|
+
|
|
28
|
+
Use native state for plain forms, or map your validation library state into `invalid`, `FieldError`, and the child control state.
|
|
29
|
+
|
|
30
|
+
```tsx
|
|
31
|
+
<Field invalid={Boolean(errors.email)}>
|
|
32
|
+
<FieldLabel>Email</FieldLabel>
|
|
33
|
+
<FieldControl>
|
|
34
|
+
<Input state={errors.email ? "error" : "default"} />
|
|
35
|
+
</FieldControl>
|
|
36
|
+
{errors.email ? <FieldError>{errors.email.message}</FieldError> : null}
|
|
37
|
+
</Field>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Token Contract
|
|
41
|
+
|
|
42
|
+
Field uses Banhaten spacing, content, danger, field, typography, and disabled tokens. Child controls keep ownership of their own surface tokens.
|
|
43
|
+
|
|
44
|
+
## RTL
|
|
45
|
+
|
|
46
|
+
Field uses logical grid and text-start alignment. Horizontal and responsive orientations mirror naturally under inherited `dir`.
|
|
47
|
+
|
|
48
|
+
## Install
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
npx banhaten add field
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Examples
|
|
55
|
+
|
|
56
|
+
Primary registry example: `examples/field-demo.tsx`.
|
|
57
|
+
|
|
58
|
+
Open the live component page or run `npx banhaten docs field` to inspect source files, install command, and examples.
|
|
59
|
+
|
|
60
|
+
## RTL Rules
|
|
61
|
+
|
|
62
|
+
- `inheritsDirection`: true
|
|
63
|
+
- `layout`: Vertical, horizontal, and responsive layouts use CSS grid and logical text alignment so field rows mirror naturally.
|
|
64
|
+
- `textDirection`: Labels, descriptions, and errors use dir="auto" through Label and field text parts.
|
|
65
|
+
- `semantics`: FieldControl wires the generated control id, invalid state, disabled announcement, and description/error ids into the child control.
|
|
66
|
+
|
|
67
|
+
## Accessibility
|
|
68
|
+
|
|
69
|
+
This component relies on `@radix-ui/react-slot` for its base accessibility behavior. Keep required labels, titles, descriptions, and focusable trigger/content relationships intact when composing it.
|
|
70
|
+
|
|
71
|
+
<!-- registry-contract:start -->
|
|
72
|
+
## Registry Contract
|
|
73
|
+
|
|
74
|
+
This table is generated from `registry/index.json`; edit the component-owned source under `registry/catalog/components/`, not this table or the compiled index.
|
|
75
|
+
`supportedExports` is the exhaustive runtime import contract grouped by source module. `parts` is an ordered, non-exhaustive anatomy list.
|
|
76
|
+
|
|
77
|
+
| Field | Values |
|
|
78
|
+
| --- | --- |
|
|
79
|
+
| `supportedExports` | `components/field.tsx: Field, FieldContent, FieldControl, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSet` |
|
|
80
|
+
| `parts` | `Field`, `FieldLabel`, `FieldControl`, `FieldDescription`, `FieldError`, `FieldGroup`, `FieldSet`, `FieldLegend`, `FieldContent` |
|
|
81
|
+
| `registryDependencies` | `label` |
|
|
82
|
+
| `features` | `generated ids`, `control slot`, `description text`, `error text`, `field groups`, `validation mapping` |
|
|
83
|
+
| `orientations` | `vertical`, `horizontal`, `responsive` |
|
|
84
|
+
| `states` | `default`, `invalid`, `disabled` |
|
|
85
|
+
| `tokens` | `--bh-content-danger-default`, `--bh-content-default`, `--bh-content-subtle`, `--bh-space-17xl-288`, `--bh-space-3xl-16`, `--bh-space-md-8`, `--bh-space-xs-4`, `--bh-text-body-md-semibold-font-size`, `--bh-text-body-md-semibold-font-weight`, `--bh-text-body-md-semibold-letter-spacing`, `--bh-text-body-md-semibold-line-height`, `--bh-text-body-xs-regular-font-size`, `--bh-text-body-xs-regular-font-weight`, `--bh-text-body-xs-regular-letter-spacing`, `--bh-text-body-xs-regular-line-height` |
|
|
86
|
+
<!-- registry-contract:end -->
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
# File Upload
|
|
2
|
+
|
|
3
|
+
`FileUpload` lets people drag files into a drop zone, browse for files, and review queued upload items. Use it when the workflow supports one or more files and the user needs clear per-file status feedback.
|
|
4
|
+
|
|
5
|
+
Figma reference: `File upload`, node `254:3195`.
|
|
6
|
+
|
|
7
|
+
## Variants
|
|
8
|
+
|
|
9
|
+
The Figma component defines these top-level variants:
|
|
10
|
+
|
|
11
|
+
| Size | Direction |
|
|
12
|
+
| --- | --- |
|
|
13
|
+
| `lg` | LTR |
|
|
14
|
+
| `sm` | LTR |
|
|
15
|
+
| `lg` | RTL |
|
|
16
|
+
| `sm` | RTL |
|
|
17
|
+
|
|
18
|
+
Queued file rows define these states:
|
|
19
|
+
|
|
20
|
+
| State | Meaning |
|
|
21
|
+
| --- | --- |
|
|
22
|
+
| `uploaded` | The file finished uploading successfully. |
|
|
23
|
+
| `uploading` | The file is uploading and progress is unknown. |
|
|
24
|
+
| `uploading-progress` | The file is uploading and exposes a progress bar. |
|
|
25
|
+
| `error` | The file failed and needs a retry or removal action. |
|
|
26
|
+
|
|
27
|
+
## API
|
|
28
|
+
|
|
29
|
+
Use semantic names in code and let the implementation map them to the current appearance preset.
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
type FileUploadSize = "lg" | "sm";
|
|
33
|
+
type FileUploadVariant = "default" | "button";
|
|
34
|
+
type FileUploadDropzoneState = "default" | "hover";
|
|
35
|
+
type FileUploadItemStatus = "uploaded" | "uploading" | "uploading-progress" | "error";
|
|
36
|
+
|
|
37
|
+
type FileUploadFile = {
|
|
38
|
+
id: string;
|
|
39
|
+
name: string;
|
|
40
|
+
sizeLabel: string;
|
|
41
|
+
versionLabel?: string;
|
|
42
|
+
progress?: number;
|
|
43
|
+
progressLabel?: string;
|
|
44
|
+
extensionLabel?: string;
|
|
45
|
+
status: FileUploadItemStatus;
|
|
46
|
+
errorLabel?: string;
|
|
47
|
+
uploadedLabel?: string;
|
|
48
|
+
uploadLabel?: string;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
type FileUploadProps = {
|
|
52
|
+
size?: FileUploadSize;
|
|
53
|
+
variant?: FileUploadVariant;
|
|
54
|
+
dropzoneState?: FileUploadDropzoneState;
|
|
55
|
+
dir?: "ltr" | "rtl" | "auto";
|
|
56
|
+
files?: FileUploadFile[];
|
|
57
|
+
title?: string;
|
|
58
|
+
prompt?: string;
|
|
59
|
+
browseLabel?: string;
|
|
60
|
+
helperText?: string;
|
|
61
|
+
disabled?: boolean;
|
|
62
|
+
accept?: string;
|
|
63
|
+
multiple?: boolean;
|
|
64
|
+
onBrowse?: () => void;
|
|
65
|
+
onDrop?: (files: FileList) => void;
|
|
66
|
+
onMore?: (fileId: string) => void;
|
|
67
|
+
onCancel?: (fileId: string) => void;
|
|
68
|
+
onRemove?: (fileId: string) => void;
|
|
69
|
+
onRetry?: (fileId: string) => void;
|
|
70
|
+
};
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
`files` controls whether the queued file list renders. Do not expose a separate `hasFilesQueued` prop in production code; the rendered state should follow from the file array.
|
|
74
|
+
|
|
75
|
+
## Layout
|
|
76
|
+
|
|
77
|
+
- The root stacks the drop zone and queued file list vertically.
|
|
78
|
+
- Large width is 500px in the Figma source; small width is 343px. Implementations may use `width: 100%` with those values as max-widths.
|
|
79
|
+
- The default drop zone is 500px by 180px; the title-plus-button variant is 500px by 256px.
|
|
80
|
+
- The drop zone is centered, uses a 2px dashed border, and hover strengthens the border without changing the surface.
|
|
81
|
+
- The upload icon container is 48px square with a subtle border and the current control radius.
|
|
82
|
+
- Large file rows use 16px padding, a 40px file icon, and 12px gaps.
|
|
83
|
+
- Small file rows use 12px padding, a 32px file icon, and 8px gaps.
|
|
84
|
+
- Row actions are icon-only: more, close/cancel, and trash.
|
|
85
|
+
- The queued list uses a 12px vertical gap.
|
|
86
|
+
- RTL mode mirrors visual order and aligns file metadata to the end while preserving logical reading order.
|
|
87
|
+
|
|
88
|
+
## Tokens
|
|
89
|
+
|
|
90
|
+
The Figma source uses design tokens such as `bg/raised`, `interactive/secondary/default`, `border/subtle`, `border/danger/strong`, `space/*`, and `radius/*`. Implementations should map those to the design system's semantic token contract.
|
|
91
|
+
|
|
92
|
+
```ts
|
|
93
|
+
export const fileUploadTokens = {
|
|
94
|
+
dropzoneBackground: "background.subtle",
|
|
95
|
+
dropzoneBorder: "border.default",
|
|
96
|
+
dropzoneIconBackground: "background.default",
|
|
97
|
+
dropzoneIconBorder: "border.subtle",
|
|
98
|
+
rowBackground: "background.card",
|
|
99
|
+
rowBorder: "border.subtle",
|
|
100
|
+
rowErrorBorder: "border.danger",
|
|
101
|
+
rowElevation: "elevation.card",
|
|
102
|
+
textColor: "content.default",
|
|
103
|
+
helperTextColor: "content.subtle",
|
|
104
|
+
linkColor: "content.link",
|
|
105
|
+
successColor: "content.success",
|
|
106
|
+
dangerColor: "content.danger",
|
|
107
|
+
rowRadiusLarge: "shape.card",
|
|
108
|
+
rowRadiusSmall: "shape.control",
|
|
109
|
+
};
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Do not hard-code the Figma fallback values in component code. For example, the error state should resolve through `border.danger` and `content.danger`, not through the Figma fallback hex values.
|
|
113
|
+
|
|
114
|
+
## Behavior
|
|
115
|
+
|
|
116
|
+
- Clicking the browse text or drop zone should open the platform file picker.
|
|
117
|
+
- Dragging files over the drop zone should show the same target without changing the component API.
|
|
118
|
+
- `uploading` rows should expose a close/cancel action.
|
|
119
|
+
- `uploading-progress` rows should expose a real progress bar and percent label.
|
|
120
|
+
- `uploaded` rows should expose remove and overflow actions when the product has secondary file actions.
|
|
121
|
+
- `error` rows should expose remove and retry actions.
|
|
122
|
+
- The component should support both single-file and multi-file use through the `multiple` prop or equivalent platform API.
|
|
123
|
+
|
|
124
|
+
## Accessibility
|
|
125
|
+
|
|
126
|
+
- Use a real file input or a button connected to a file input.
|
|
127
|
+
- Preserve keyboard access for browse, cancel, remove, retry, and overflow actions.
|
|
128
|
+
- Announce upload status changes through an accessible live region when status changes after initial render.
|
|
129
|
+
- Keep file names as real text and avoid icon-only status communication.
|
|
130
|
+
- Icon-only actions need accessible labels such as `Cancel upload`, `Remove file`, `Retry upload`, and `More file actions`.
|
|
131
|
+
- The drop zone should not be the only way to select files.
|
|
132
|
+
|
|
133
|
+
## Usage
|
|
134
|
+
|
|
135
|
+
```tsx
|
|
136
|
+
<FileUpload
|
|
137
|
+
files={[
|
|
138
|
+
{ id: "1", name: "file-name.pdf", sizeLabel: "32mb", versionLabel: "v1.2.2", status: "uploaded" },
|
|
139
|
+
{ id: "2", name: "file-name.pdf", sizeLabel: "32mb", versionLabel: "v1.2.2", status: "uploading" },
|
|
140
|
+
{ id: "3", name: "file-name.pdf", sizeLabel: "32 KB", progress: 40, status: "uploading-progress" },
|
|
141
|
+
{ id: "4", name: "file-name.pdf", sizeLabel: "32mb", versionLabel: "v1.2.2", status: "error" },
|
|
142
|
+
]}
|
|
143
|
+
multiple
|
|
144
|
+
/>
|
|
145
|
+
|
|
146
|
+
<FileUpload size="sm" files={[{ id: "1", name: "file-name.pdf", sizeLabel: "32 KB", status: "uploaded" }]} />
|
|
147
|
+
|
|
148
|
+
<FileUpload dir="rtl" size="lg" />
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## Preset Impact
|
|
152
|
+
|
|
153
|
+
- `default`: white rows on a subtle drop-zone background, modest radius, quiet shadow, and balanced spacing.
|
|
154
|
+
- `rounded`: softer drop-zone and row corners, slightly more padding, and gentler borders.
|
|
155
|
+
- `sharp`: square or near-square row treatment, denser spacing, stronger borders, and minimal row elevation.
|
|
156
|
+
|
|
157
|
+
## Implementation Notes
|
|
158
|
+
|
|
159
|
+
- Keep the drop zone and file row primitives separate so rows can be reused in compact upload summaries.
|
|
160
|
+
- Prefer existing icon components for upload, file type, success, loading, close, more, trash, and warning actions.
|
|
161
|
+
- Use a real progress indicator when the product can report upload progress; use the `uploading` label when progress is unknown.
|
|
162
|
+
- Truncate long file names in the middle or end, but keep the full file name available to assistive technology and tooltips.
|
|
163
|
+
- Avoid coupling RTL behavior to translated strings. Direction should come from `dir` or document context.
|
|
164
|
+
|
|
165
|
+
## Install
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
npx banhaten add file-upload
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
## Examples
|
|
172
|
+
|
|
173
|
+
Primary registry example: `examples/expanded/file-upload-demo.tsx`.
|
|
174
|
+
|
|
175
|
+
Open the live component page or run `npx banhaten docs file-upload` to inspect source files, install command, and examples.
|
|
176
|
+
|
|
177
|
+
## Token Contract
|
|
178
|
+
|
|
179
|
+
Component styles must resolve through Banhaten semantic tokens, component aliases, or documented exception-ledger values.
|
|
180
|
+
Do not add raw colors, pixel values, opacity utilities, z-index values, durations, or shadow literals directly to component source.
|
|
181
|
+
Covered source files: `components/expanded/fileUpload.css`, `components/expanded/FileUpload.tsx`.
|
|
182
|
+
|
|
183
|
+
## RTL Rules
|
|
184
|
+
|
|
185
|
+
This component has no special RTL contract beyond inherited document direction and logical spacing.
|
|
186
|
+
|
|
187
|
+
<!-- registry-contract:start -->
|
|
188
|
+
## Registry Contract
|
|
189
|
+
|
|
190
|
+
This table is generated from `registry/index.json`; edit the component-owned source under `registry/catalog/components/`, not this table or the compiled index.
|
|
191
|
+
`supportedExports` is the exhaustive runtime import contract grouped by source module. `parts` is an ordered, non-exhaustive anatomy list.
|
|
192
|
+
|
|
193
|
+
| Field | Values |
|
|
194
|
+
| --- | --- |
|
|
195
|
+
| `supportedExports` | `components/expanded/FileUpload.tsx: FileUpload` |
|
|
196
|
+
| `parts` | `FileUpload` |
|
|
197
|
+
| `registryDependencies` | `button` |
|
|
198
|
+
| `tokens` | `--bh-bg-accent-amber-default`, `--bh-bg-accent-aqua-default`, `--bh-bg-accent-blue-default`, `--bh-bg-accent-fuchsia-default`, `--bh-bg-accent-golden-default`, `--bh-bg-accent-green-default`, `--bh-bg-accent-lime-default`, `--bh-bg-accent-purple-default`, `--bh-bg-accent-red-default`, `--bh-bg-accent-rose-default`, `--bh-bg-accent-sky-base`, `--bh-bg-default`, `--bh-bg-dim`, `--bh-bg-neutral-default`, `--bh-bg-neutral-subtle`, `--bh-bg-raised`, `--bh-bg-subtle`, `--bh-bg-success-default`, `--bh-border-danger-strong`, `--bh-border-default`, `--bh-border-disabled`, `--bh-border-focus`, `--bh-border-strong`, `--bh-border-subtle`, `--bh-border-width-default`, `--bh-border-width-strong`, `--bh-content-brand-default`, `--bh-content-danger-default`, `--bh-content-default`, `--bh-content-disabled`, `--bh-content-link`, `--bh-content-link-hover`, `--bh-content-on-color`, `--bh-content-subtle`, `--bh-content-success-default`, `--bh-duration-fast`, `--bh-easing-standard`, `--bh-file-upload-content-max-width`, `--bh-file-upload-root-max-width`, `--bh-file-upload-spin-duration`, `--bh-focus-ring-width`, `--bh-font-family`, `--bh-font-weight-bold`, `--bh-font-weight-medium`, `--bh-font-weight-regular`, `--bh-font-weight-semibold`, `--bh-icon-stroke-200`, `--bh-icon-stroke-220`, `--bh-radius-2xl-12`, `--bh-radius-full`, `--bh-radius-lg-8`, `--bh-radius-sm-4`, `--bh-space-13xl-160`, `--bh-space-16xl-256`, `--bh-space-3xl-16`, `--bh-space-4xl-20`, `--bh-space-5xl-24`, `--bh-space-6xl-32`, `--bh-space-7xl-40`, `--bh-space-8xl-48`, `--bh-space-9xl-64`, `--bh-space-lg-10`, `--bh-space-md-8`, `--bh-space-none`, `--bh-space-sm-6`, `--bh-space-xl-12`, `--bh-space-xs-4`, `--bh-space-xxs-2`, `--bh-space-xxxs-1`, `--bh-text-base-letter-spacing`, `--bh-text-body-lg-semibold-font-size`, `--bh-text-body-lg-semibold-line-height`, `--bh-text-body-md-medium-font-size`, `--bh-text-body-md-medium-line-height`, `--bh-text-body-md-regular-font-size`, `--bh-text-body-md-regular-line-height`, `--bh-text-body-sm-medium-font-size`, `--bh-text-body-sm-medium-line-height`, `--bh-text-body-sm-regular-font-size`, `--bh-text-body-sm-regular-line-height`, `--bh-text-body-xs-regular-font-size`, `--bh-text-body-xs-regular-line-height`, `--bh-underline-offset-default`, `--shadow-component-default`, `--shadow-xs` |
|
|
199
|
+
<!-- registry-contract:end -->
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Hover Card
|
|
2
|
+
|
|
3
|
+
Hover Card wraps Radix HoverCard for rich preview content on hover and focus.
|
|
4
|
+
|
|
5
|
+
## API
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
<HoverCard>
|
|
9
|
+
<HoverCardTrigger>Workspace profile</HoverCardTrigger>
|
|
10
|
+
<HoverCardContent>Preview content</HoverCardContent>
|
|
11
|
+
</HoverCard>
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
| Part | Purpose |
|
|
15
|
+
| --- | --- |
|
|
16
|
+
| `HoverCard`, `HoverCardTrigger`, `HoverCardPortal` | Radix shell |
|
|
17
|
+
| `HoverCardContent` | tokenized preview surface |
|
|
18
|
+
|
|
19
|
+
## Token Contract
|
|
20
|
+
|
|
21
|
+
Hover Card uses Banhaten raised background, popover shadow, radius, spacing, and content tokens.
|
|
22
|
+
|
|
23
|
+
## RTL
|
|
24
|
+
|
|
25
|
+
Content inherits direction and uses logical text alignment.
|
|
26
|
+
|
|
27
|
+
## Accessibility
|
|
28
|
+
|
|
29
|
+
Radix manages hover/focus timing and content relationships.
|
|
30
|
+
|
|
31
|
+
## Install
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npx banhaten add hover-card
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Examples
|
|
38
|
+
|
|
39
|
+
Primary registry example: `examples/hover-card-demo.tsx`.
|
|
40
|
+
|
|
41
|
+
Open the live component page or run `npx banhaten docs hover-card` to inspect source files, install command, and examples.
|
|
42
|
+
|
|
43
|
+
## RTL Rules
|
|
44
|
+
|
|
45
|
+
- `inheritsDirection`: true
|
|
46
|
+
- `textDirection`: Content inherits direction and uses logical text alignment.
|
|
47
|
+
|
|
48
|
+
<!-- registry-contract:start -->
|
|
49
|
+
## Registry Contract
|
|
50
|
+
|
|
51
|
+
This table is generated from `registry/index.json`; edit the component-owned source under `registry/catalog/components/`, not this table or the compiled index.
|
|
52
|
+
`supportedExports` is the exhaustive runtime import contract grouped by source module. `parts` is an ordered, non-exhaustive anatomy list.
|
|
53
|
+
|
|
54
|
+
| Field | Values |
|
|
55
|
+
| --- | --- |
|
|
56
|
+
| `supportedExports` | `components/hover-card.tsx: HoverCard, HoverCardContent, HoverCardPortal, HoverCardTrigger` |
|
|
57
|
+
| `parts` | `HoverCard`, `HoverCardTrigger`, `HoverCardContent`, `HoverCardPortal` |
|
|
58
|
+
| `registryDependencies` | None |
|
|
59
|
+
| `features` | `hover preview`, `focus preview`, `open delay`, `close delay` |
|
|
60
|
+
| `tokens` | `--bh-bg-raised`, `--bh-content-default`, `--bh-radius-2xl-12`, `--bh-space-18xl-320`, `--bh-space-3xl-16`, `--bh-space-md-8`, `--bh-z-popover`, `--shadow-popover` |
|
|
61
|
+
<!-- registry-contract:end -->
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Icons
|
|
2
|
+
|
|
3
|
+
Icons is an expanded-tier explorer for reviewing open-source icon packs, semantic mappings, shortlist comparisons, and Iconify catalog options.
|
|
4
|
+
|
|
5
|
+
## API
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
<IconExplorer />
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
| Feature | Notes |
|
|
12
|
+
| --- | --- |
|
|
13
|
+
| Icon pack review | compares candidate open-source packs |
|
|
14
|
+
| Semantic mapping | maps product concepts to icon candidates |
|
|
15
|
+
| Shortlist comparison | supports side-by-side review |
|
|
16
|
+
| Iconify inspection | loads Iconify catalog data at runtime |
|
|
17
|
+
|
|
18
|
+
## Runtime
|
|
19
|
+
|
|
20
|
+
The explorer may load `https://code.iconify.design/iconify-icon/3.0.0/iconify-icon.min.js` and query `https://api.iconify.design`.
|
|
21
|
+
|
|
22
|
+
## Token Contract
|
|
23
|
+
|
|
24
|
+
The explorer uses expanded-tier CSS plus Banhaten surface, typography, border, spacing, focus, and content tokens. Product components should still use their local icon contracts instead of depending on this explorer.
|
|
25
|
+
|
|
26
|
+
## RTL
|
|
27
|
+
|
|
28
|
+
Explorer layout should inherit page direction for navigation, labels, and comparison rows. Icon glyphs themselves should only mirror when they are directional.
|
|
29
|
+
|
|
30
|
+
## Accessibility
|
|
31
|
+
|
|
32
|
+
Icon candidates must be reviewed for accessible usage. Decorative icons should be hidden with `aria-hidden`; actionable icon-only controls need clear accessible names.
|
|
33
|
+
|
|
34
|
+
## Install
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npx banhaten add icons
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Examples
|
|
41
|
+
|
|
42
|
+
Primary registry example: `examples/expanded/icons-demo.tsx`.
|
|
43
|
+
|
|
44
|
+
Open the live component page or run `npx banhaten docs icons` to inspect source files, install command, and examples.
|
|
45
|
+
|
|
46
|
+
## RTL Rules
|
|
47
|
+
|
|
48
|
+
This component has no special RTL contract beyond inherited document direction and logical spacing.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Input Group
|
|
2
|
+
|
|
3
|
+
Input Group provides a tokenized shell for text inputs with protocol add-ons, prefixes, suffixes, and inline actions.
|
|
4
|
+
|
|
5
|
+
## API
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
<InputGroup>
|
|
9
|
+
<InputGroupAddon>https://</InputGroupAddon>
|
|
10
|
+
<InputGroupInput aria-label="Workspace URL" />
|
|
11
|
+
<InputGroupButton>Save</InputGroupButton>
|
|
12
|
+
</InputGroup>
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
| Part | Purpose |
|
|
16
|
+
| --- | --- |
|
|
17
|
+
| `InputGroup` | shared input shell |
|
|
18
|
+
| `InputGroupAddon` | prefix or suffix content |
|
|
19
|
+
| `InputGroupInput` | native input |
|
|
20
|
+
| `InputGroupButton` | inline action |
|
|
21
|
+
|
|
22
|
+
| Prop | Values |
|
|
23
|
+
| --- | --- |
|
|
24
|
+
| `size` | `md`, `lg` |
|
|
25
|
+
| `variant` | `default`, `soft` |
|
|
26
|
+
| `state` | `default`, `error` |
|
|
27
|
+
|
|
28
|
+
## Token Contract
|
|
29
|
+
|
|
30
|
+
Input Group reuses Banhaten input width, height, radius, border, shadow, typography, and focus tokens.
|
|
31
|
+
|
|
32
|
+
## RTL
|
|
33
|
+
|
|
34
|
+
Use logical add-on order. Border placement uses logical inline sides.
|
|
35
|
+
|
|
36
|
+
## Accessibility
|
|
37
|
+
|
|
38
|
+
Give `InputGroupInput` an accessible label through `aria-label`, `aria-labelledby`, or a surrounding Field.
|
|
39
|
+
|
|
40
|
+
## Install
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
npx banhaten add input-group
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Examples
|
|
47
|
+
|
|
48
|
+
Primary registry example: `examples/input-group-demo.tsx`.
|
|
49
|
+
|
|
50
|
+
Open the live component page or run `npx banhaten docs input-group` to inspect source files, install command, and examples.
|
|
51
|
+
|
|
52
|
+
## RTL Rules
|
|
53
|
+
|
|
54
|
+
- `inheritsDirection`: true
|
|
55
|
+
- `spacing`: Add-ons and input segments use logical borders and inherited direction.
|
|
56
|
+
- `textDirection`: Input text uses text-start so mixed Arabic and English values align naturally.
|
|
57
|
+
|
|
58
|
+
<!-- registry-contract:start -->
|
|
59
|
+
## Registry Contract
|
|
60
|
+
|
|
61
|
+
This table is generated from `registry/index.json`; edit the component-owned source under `registry/catalog/components/`, not this table or the compiled index.
|
|
62
|
+
`supportedExports` is the exhaustive runtime import contract grouped by source module. `parts` is an ordered, non-exhaustive anatomy list.
|
|
63
|
+
|
|
64
|
+
| Field | Values |
|
|
65
|
+
| --- | --- |
|
|
66
|
+
| `supportedExports` | `components/input-group.tsx: InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, inputGroupVariants` |
|
|
67
|
+
| `parts` | `InputGroup`, `InputGroupInput`, `InputGroupAddon`, `InputGroupButton` |
|
|
68
|
+
| `registryDependencies` | `button` |
|
|
69
|
+
| `sizes` | `md`, `lg` |
|
|
70
|
+
| `states` | `default`, `error` |
|
|
71
|
+
| `tokens` | `--bh-border-danger-strong`, `--bh-border-disabled`, `--bh-border-input`, `--bh-border-width-default`, `--bh-content-default`, `--bh-content-disabled`, `--bh-content-muted`, `--bh-content-subtle`, `--bh-input-border`, `--bh-input-lg-height`, `--bh-input-lg-padding-x`, `--bh-input-md-height`, `--bh-input-radius`, `--bh-input-width`, `--bh-interactive-input-default`, `--bh-interactive-input-disabled`, `--bh-interactive-input-soft`, `--bh-space-sm-6`, `--bh-space-xl-12`, `--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-body-sm-medium-font-size`, `--bh-text-body-sm-medium-font-weight`, `--bh-text-body-sm-medium-letter-spacing`, `--bh-text-body-sm-medium-line-height`, `--shadow-component-default`, `--shadow-input`, `--shadow-input-focus-ring` |
|
|
72
|
+
| `variants` | `default`, `soft` |
|
|
73
|
+
<!-- registry-contract:end -->
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Input OTP
|
|
2
|
+
|
|
3
|
+
Input OTP captures one-time passcodes and short verification codes. It reuses the Banhaten Input surface and typography while adding grouped slots, paste distribution, hidden form value, masking, custom length, and RTL-aware keyboard navigation.
|
|
4
|
+
|
|
5
|
+
## API
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
<InputOTP
|
|
9
|
+
label="Verification code"
|
|
10
|
+
length={6}
|
|
11
|
+
name="code"
|
|
12
|
+
onValueChange={setCode}
|
|
13
|
+
/>
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
| Prop | Values |
|
|
17
|
+
| --- | --- |
|
|
18
|
+
| `value`, `defaultValue` | controlled or uncontrolled string |
|
|
19
|
+
| `length` | slot count |
|
|
20
|
+
| `groupPattern` | array of slot group sizes |
|
|
21
|
+
| `masked` | `boolean` |
|
|
22
|
+
| `variant` | `default`, `soft` |
|
|
23
|
+
| `size` | `md`, `lg` |
|
|
24
|
+
| `state` | `default`, `filled`, `error`, `disabled` |
|
|
25
|
+
|
|
26
|
+
## Token Contract
|
|
27
|
+
|
|
28
|
+
Input OTP uses Input field tokens for surfaces, typography, focus, border, error, helper text, labels, slot gaps, and disabled states.
|
|
29
|
+
|
|
30
|
+
## RTL
|
|
31
|
+
|
|
32
|
+
Slot groups inherit direction. Arrow navigation mirrors in RTL so visual previous and next follow the rendered direction.
|
|
33
|
+
|
|
34
|
+
## Accessibility
|
|
35
|
+
|
|
36
|
+
Provide a clear label and helper text describing how many digits are expected. The hidden form value lets the component participate in standard form submission.
|
|
37
|
+
|
|
38
|
+
## Install
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
npx banhaten add input-otp
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Examples
|
|
45
|
+
|
|
46
|
+
Primary registry example: `examples/input-otp-demo.tsx`.
|
|
47
|
+
|
|
48
|
+
Open the live component page or run `npx banhaten docs input-otp` to inspect source files, install command, and examples.
|
|
49
|
+
|
|
50
|
+
## RTL Rules
|
|
51
|
+
|
|
52
|
+
- `inheritsDirection`: true
|
|
53
|
+
- `keyboard`: Arrow navigation mirrors for RTL: visual previous and next follow the inherited direction.
|
|
54
|
+
- `spacing`: Slot groups, separators, labels, and helper text use inherited direction plus Input spacing tokens.
|
|
55
|
+
- `composition`: Each slot reuses the Banhaten Input surface and control typography instead of a separate field style.
|
|
56
|
+
|
|
57
|
+
<!-- registry-contract:start -->
|
|
58
|
+
## Registry Contract
|
|
59
|
+
|
|
60
|
+
This table is generated from `registry/index.json`; edit the component-owned source under `registry/catalog/components/`, not this table or the compiled index.
|
|
61
|
+
`supportedExports` is the exhaustive runtime import contract grouped by source module. `parts` is an ordered, non-exhaustive anatomy list.
|
|
62
|
+
|
|
63
|
+
| Field | Values |
|
|
64
|
+
| --- | --- |
|
|
65
|
+
| `supportedExports` | `components/input-otp.tsx: InputOTP, InputOTPSeparator` |
|
|
66
|
+
| `parts` | `InputOTP`, `InputOTPSeparator` |
|
|
67
|
+
| `registryDependencies` | `input` |
|
|
68
|
+
| `features` | `controlled value`, `uncontrolled value`, `paste distribution`, `hidden form value`, `masked slots`, `custom length`, `custom grouping` |
|
|
69
|
+
| `sizes` | `md`, `lg` |
|
|
70
|
+
| `states` | `default`, `filled`, `error`, `disabled` |
|
|
71
|
+
| `tokens` | `--bh-bg-brand-soft`, `--bh-border-default`, `--bh-content-danger-default`, `--bh-content-default`, `--bh-content-muted`, `--bh-content-subtle`, `--bh-input-helper-gap`, `--bh-input-inline-gap`, `--bh-input-label-gap`, `--bh-input-lg-height`, `--bh-input-otp-group-gap`, `--bh-input-otp-separator-height`, `--bh-input-otp-separator-width`, `--bh-input-otp-slot-comfortable-width`, `--bh-input-otp-slot-gap`, `--bh-input-otp-slot-lg-width`, `--bh-input-otp-slot-md-width`, `--bh-input-otp-width`, `--bh-input-width`, `--bh-radius-full`, `--bh-space-none`, `--bh-text-body-md-medium-font-weight`, `--bh-text-body-sm-medium-font-size`, `--bh-text-body-sm-medium-font-weight`, `--bh-text-body-sm-medium-letter-spacing`, `--bh-text-body-sm-medium-line-height`, `--bh-text-body-xs-regular-font-size`, `--bh-text-body-xs-regular-font-weight`, `--bh-text-body-xs-regular-letter-spacing`, `--bh-text-body-xs-regular-line-height` |
|
|
72
|
+
| `variants` | `default`, `soft` |
|
|
73
|
+
<!-- registry-contract:end -->
|