banhaten 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +86 -309
- package/banhaten.config.example.json +1 -1
- package/docs/design-system/README.md +11 -0
- package/docs/design-system/appearance-presets.md +184 -0
- package/docs/design-system/appearances/default.md +94 -0
- package/docs/design-system/appearances/rounded.md +95 -0
- package/docs/design-system/appearances/sharp.md +95 -0
- package/docs/design-system/component-showcase-consistency-report.md +217 -0
- package/docs/design-system/component-token-consistency-audit.md +163 -0
- package/docs/design-system/components/README.md +74 -0
- package/docs/design-system/components/accordion.md +51 -0
- package/docs/design-system/components/activity-feed.md +92 -0
- package/docs/design-system/components/alert-dialog.md +70 -0
- package/docs/design-system/components/alert.md +79 -0
- package/docs/design-system/components/aspect-ratio.md +44 -0
- package/docs/design-system/components/attribute.md +87 -0
- package/docs/design-system/components/autocomplete.md +74 -0
- package/docs/design-system/components/avatar.md +52 -0
- package/docs/design-system/components/badge.md +53 -0
- package/docs/design-system/components/banner.md +85 -0
- package/docs/design-system/components/breadcrumbs.md +174 -0
- package/docs/design-system/components/button-group.md +83 -0
- package/docs/design-system/components/button.md +77 -0
- package/docs/design-system/components/card.md +78 -0
- package/docs/design-system/components/carousel.md +44 -0
- package/docs/design-system/components/catalog-components.md +45 -0
- package/docs/design-system/components/chart.md +43 -0
- package/docs/design-system/components/checkbox.md +52 -0
- package/docs/design-system/components/collapsible.md +48 -0
- package/docs/design-system/components/command-bar.md +57 -0
- package/docs/design-system/components/command.md +60 -0
- package/docs/design-system/components/context-menu.md +44 -0
- package/docs/design-system/components/date-picker.md +77 -0
- package/docs/design-system/components/divider.md +101 -0
- package/docs/design-system/components/empty-state.md +55 -0
- package/docs/design-system/components/field.md +69 -0
- package/docs/design-system/components/file-upload.md +185 -0
- package/docs/design-system/components/hover-card.md +46 -0
- package/docs/design-system/components/icons.md +48 -0
- package/docs/design-system/components/input-group.md +56 -0
- package/docs/design-system/components/input-otp.md +55 -0
- package/docs/design-system/components/input.md +48 -0
- package/docs/design-system/components/kbd.md +44 -0
- package/docs/design-system/components/label.md +48 -0
- package/docs/design-system/components/menu.md +59 -0
- package/docs/design-system/components/menubar.md +45 -0
- package/docs/design-system/components/modal.md +98 -0
- package/docs/design-system/components/native-select.md +52 -0
- package/docs/design-system/components/navigation-menu.md +48 -0
- package/docs/design-system/components/onboarding-step-list-item.md +80 -0
- package/docs/design-system/components/page-header.md +84 -0
- package/docs/design-system/components/pagination.md +49 -0
- package/docs/design-system/components/popover.md +58 -0
- package/docs/design-system/components/progress-slider.md +48 -0
- package/docs/design-system/components/progress.md +75 -0
- package/docs/design-system/components/radio-card.md +49 -0
- package/docs/design-system/components/radio-group.md +55 -0
- package/docs/design-system/components/resizable.md +42 -0
- package/docs/design-system/components/scroll-area.md +45 -0
- package/docs/design-system/components/select.md +50 -0
- package/docs/design-system/components/sheet.md +65 -0
- package/docs/design-system/components/sidebar.md +68 -0
- package/docs/design-system/components/skeleton.md +73 -0
- package/docs/design-system/components/slideout.md +63 -0
- package/docs/design-system/components/slider.md +61 -0
- package/docs/design-system/components/social-button.md +47 -0
- package/docs/design-system/components/spinner.md +61 -0
- package/docs/design-system/components/steps.md +63 -0
- package/docs/design-system/components/table.md +397 -0
- package/docs/design-system/components/tabs.md +52 -0
- package/docs/design-system/components/tag.md +78 -0
- package/docs/design-system/components/textarea.md +48 -0
- package/docs/design-system/components/timeline.md +81 -0
- package/docs/design-system/components/toast.md +56 -0
- package/docs/design-system/components/toggle.md +79 -0
- package/docs/design-system/components/toolbar.md +85 -0
- package/docs/design-system/components/tooltip.md +90 -0
- package/docs/design-system/components/typography.md +18 -0
- package/docs/design-system/design-system-test-missing-items.md +368 -0
- package/docs/design-system/icons.md +69 -0
- package/docs/design-system/registry-and-cli.md +41 -0
- package/docs/design-system/tabs.md +53 -0
- package/docs/design-system/token-governance.md +38 -0
- package/package.json +83 -59
- package/registry/components/alert-dialog.tsx +297 -0
- package/registry/components/aspect-ratio.tsx +30 -0
- package/registry/components/autocomplete.tsx +637 -0
- package/registry/components/avatar.tsx +258 -22
- package/registry/components/badge.tsx +97 -35
- package/registry/components/carousel.tsx +234 -0
- package/registry/components/chart.tsx +170 -0
- package/registry/components/collapsible.tsx +69 -0
- package/registry/components/command.tsx +174 -0
- package/registry/components/context-menu.tsx +236 -0
- package/registry/components/date-picker-state.ts +253 -0
- package/registry/components/date-picker.tsx +116 -159
- package/registry/components/expanded/EmptyState.tsx +155 -0
- package/registry/components/expanded/PageHeader.tsx +1 -1
- package/registry/components/expanded/breadcrumbs.css +139 -139
- package/registry/components/expanded/catalogComponentsShowcase.css +83 -83
- package/registry/components/expanded/emptyState.css +111 -0
- package/registry/components/expanded/slideout.css +1 -0
- package/registry/components/expanded/steps.css +274 -274
- package/registry/components/expanded/table.css +1 -0
- package/registry/components/expanded/timeline.css +264 -264
- package/registry/components/field.tsx +230 -0
- package/registry/components/hover-card.tsx +48 -0
- package/registry/components/input-group.tsx +130 -0
- package/registry/components/input-otp.tsx +574 -0
- package/registry/components/input.tsx +22 -12
- package/registry/components/kbd.tsx +44 -0
- package/registry/components/label.tsx +78 -0
- package/registry/components/menu.tsx +373 -8
- package/registry/components/menubar.tsx +226 -0
- package/registry/components/modal.tsx +109 -76
- package/registry/components/native-select.tsx +205 -0
- package/registry/components/navigation-menu.tsx +171 -0
- package/registry/components/popover.tsx +840 -0
- package/registry/components/radio-group.tsx +1 -1
- package/registry/components/resizable.tsx +74 -0
- package/registry/components/scroll-area.tsx +67 -0
- package/registry/components/select.tsx +6 -4
- package/registry/components/sheet.tsx +305 -0
- package/registry/components/sidebar.tsx +352 -0
- package/registry/components/skeleton.css +57 -0
- package/registry/components/skeleton.tsx +482 -0
- package/registry/components/social-button.tsx +74 -10
- package/registry/components/spinner.tsx +79 -11
- package/registry/components/{expanded/tabs.css → tabs.css} +127 -106
- package/registry/components/tabs.tsx +242 -0
- package/registry/components/textarea.tsx +2 -2
- package/registry/components/toast.tsx +131 -0
- package/registry/components/tooltip.tsx +4 -0
- package/registry/examples/alert-dialog-demo.tsx +42 -0
- package/registry/examples/aspect-ratio-demo.tsx +11 -0
- package/registry/examples/autocomplete-demo.tsx +109 -0
- package/registry/examples/avatar-demo.tsx +102 -47
- package/registry/examples/badge-demo.tsx +16 -0
- package/registry/examples/carousel-demo.tsx +25 -0
- package/registry/examples/chart-demo.tsx +33 -0
- package/registry/examples/collapsible-demo.tsx +16 -0
- package/registry/examples/command-demo.tsx +42 -0
- package/registry/examples/context-menu-demo.tsx +29 -0
- package/registry/examples/expanded/command-bar-demo.tsx +236 -0
- package/registry/examples/expanded/empty-state-demo.tsx +39 -0
- package/registry/examples/expanded/tabs-demo.tsx +1 -1
- package/registry/examples/field-demo.tsx +51 -0
- package/registry/examples/hover-card-demo.tsx +23 -0
- package/registry/examples/input-demo.tsx +1 -1
- package/registry/examples/input-group-demo.tsx +16 -0
- package/registry/examples/input-otp-demo.tsx +72 -0
- package/registry/examples/kbd-demo.tsx +11 -0
- package/registry/examples/label-demo.tsx +20 -0
- package/registry/examples/menu-demo.tsx +101 -88
- package/registry/examples/menubar-demo.tsx +34 -0
- package/registry/examples/native-select-demo.tsx +16 -0
- package/registry/examples/navigation-menu-demo.tsx +29 -0
- package/registry/examples/popover-demo.tsx +546 -0
- package/registry/examples/resizable-demo.tsx +22 -0
- package/registry/examples/scroll-area-demo.tsx +15 -0
- package/registry/examples/select-demo.tsx +1 -1
- package/registry/examples/sheet-demo.tsx +47 -0
- package/registry/examples/sidebar-demo.tsx +55 -0
- package/registry/examples/skeleton-demo.tsx +56 -0
- package/registry/examples/spinner-demo.tsx +23 -1
- package/registry/examples/tabs-demo.tsx +13 -0
- package/registry/examples/textarea-demo.tsx +1 -1
- package/registry/examples/toast-demo.tsx +35 -0
- package/registry/index.json +895 -19
- package/registry/styles/globals.css +4733 -4602
- package/registry.json +1612 -0
- package/schema/config.schema.json +48 -0
- package/schema/registry.schema.json +85 -0
- package/schema/tokens.schema.json +63 -0
- package/src/cli/index.js +1413 -184
- package/tokens/banhaten.tokens.json +1 -1
- package/registry/assets/avatars/avatar-02.jpg +0 -0
- package/registry/assets/avatars/avatar-03.jpg +0 -0
- package/registry/assets/avatars/avatar-04.jpg +0 -0
- package/registry/assets/avatars/avatar-05.jpg +0 -0
- package/registry/assets/avatars/avatar-06.jpg +0 -0
- package/registry/assets/avatars/avatar-07.jpg +0 -0
- package/registry/assets/avatars/avatar-08.jpg +0 -0
- package/registry/assets/avatars/avatar-09.jpg +0 -0
- package/registry/assets/avatars/avatar-10.jpg +0 -0
- package/registry/assets/avatars/avatar-11.jpg +0 -0
- package/registry/assets/avatars/avatar-12.jpg +0 -0
- package/registry/assets/avatars/avatar-13.jpg +0 -0
- package/registry/assets/avatars/avatar-14.jpg +0 -0
- package/registry/assets/avatars/avatar-15.jpg +0 -0
- package/registry/assets/avatars/avatar-16.jpg +0 -0
- package/registry/assets/avatars/avatar-17.jpg +0 -0
- package/registry/assets/avatars/avatar-18.jpg +0 -0
- package/registry/assets/avatars/avatar-19.jpg +0 -0
- package/registry/assets/avatars/avatar-20.jpg +0 -0
- package/registry/assets/avatars/avatar-21.jpg +0 -0
- package/registry/assets/avatars/avatar-22.jpg +0 -0
- package/registry/assets/avatars/avatar-23.jpg +0 -0
- package/registry/assets/avatars/avatar-24.jpg +0 -0
- package/registry/assets/avatars/avatar-25.jpg +0 -0
- package/registry/assets/avatars/avatar-26.jpg +0 -0
- package/registry/assets/avatars/avatar-27.jpg +0 -0
- package/registry/assets/avatars/avatar-28.jpg +0 -0
- package/registry/assets/avatars/avatar-29.jpg +0 -0
- package/registry/assets/avatars/avatar-30.jpg +0 -0
- package/registry/assets/avatars/avatar-31.jpg +0 -0
- package/registry/assets/avatars/avatar-32.jpg +0 -0
- package/registry/assets/avatars/avatar-33.jpg +0 -0
- package/registry/assets/avatars/avatar-34.jpg +0 -0
- package/registry/assets/avatars/avatar-35.jpg +0 -0
- package/registry/assets/image-assets.json +0 -744
- package/registry/assets/images/art-02.jpg +0 -0
- package/registry/assets/images/art-03.jpg +0 -0
- package/registry/assets/images/art-04.jpg +0 -0
- package/registry/assets/images/art-05.jpg +0 -0
- package/registry/assets/images/art-06.jpg +0 -0
- package/registry/assets/images/art-07.jpg +0 -0
- package/registry/assets/images/art-08.jpg +0 -0
- package/registry/assets/images/art-09.jpg +0 -0
- package/registry/assets/images/art-10.jpg +0 -0
- package/registry/assets/images/art-11.jpg +0 -0
- package/registry/assets/images/art-12.jpg +0 -0
- package/registry/assets/images/art-13.jpg +0 -0
- package/registry/assets/images/art-14.jpg +0 -0
- package/registry/assets/images/art-15.jpg +0 -0
- package/registry/assets/images/art-16.jpg +0 -0
- package/registry/assets/images/art-17.jpg +0 -0
- package/registry/assets/images/art-18.jpg +0 -0
- package/registry/assets/images/art-19.jpg +0 -0
- package/registry/assets/images/art-20.jpg +0 -0
- package/registry/assets/images/art-21.jpg +0 -0
- package/registry/assets/images/art-22.jpg +0 -0
- package/registry/assets/images/art-23.jpg +0 -0
- package/registry/assets/images/art-24.jpg +0 -0
- package/registry/assets/images/art-25.jpg +0 -0
- package/registry/assets/images/art-26.jpg +0 -0
- package/registry/assets/images/art-27.jpg +0 -0
- package/registry/assets/images/nature-01.jpg +0 -0
- package/registry/assets/images/nature-02.jpg +0 -0
- package/registry/assets/images/nature-03.jpg +0 -0
- package/registry/assets/images/nature-04.jpg +0 -0
- package/registry/assets/images/nature-05.jpg +0 -0
- package/registry/assets/images/nature-06.jpg +0 -0
- package/registry/assets/images/nature-07.jpg +0 -0
- package/registry/assets/images/nature-08.jpg +0 -0
- package/registry/assets/images/nature-09.jpg +0 -0
- package/registry/assets/images/nature-10.jpg +0 -0
- package/registry/assets/images/nature-11.jpg +0 -0
- package/registry/assets/images/nature-12.jpg +0 -0
- package/registry/assets/images/nature-13.jpg +0 -0
- package/registry/assets/images/nature-14.jpg +0 -0
- package/registry/assets/images/nature-15.jpg +0 -0
- package/registry/assets/images/nature-16.jpg +0 -0
- package/registry/assets/images/nature-17.jpg +0 -0
- package/registry/assets/images/nature-18.jpg +0 -0
- package/registry/assets/images/nature-19.jpg +0 -0
- package/registry/assets/images/nature-20.jpg +0 -0
- package/registry/components/expanded/Tabs.tsx +0 -86
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Checkbox
|
|
2
|
+
|
|
3
|
+
Checkbox is the binary selection primitive for forms, preferences, batch actions, and card-style options. It includes the base Radix checkbox control plus `CheckboxCard` for labeled option rows.
|
|
4
|
+
|
|
5
|
+
## API
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
<Checkbox aria-label="Accept terms" />
|
|
9
|
+
|
|
10
|
+
<CheckboxCard
|
|
11
|
+
title="Email updates"
|
|
12
|
+
description="Receive product and billing notifications."
|
|
13
|
+
controlPosition="start"
|
|
14
|
+
/>
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
| Prop | Values |
|
|
18
|
+
| --- | --- |
|
|
19
|
+
| `checked` | Radix checkbox checked state |
|
|
20
|
+
| `disabled` | `boolean` |
|
|
21
|
+
| `CheckboxCard.controlPosition` | `start`, `end` |
|
|
22
|
+
| `CheckboxCard.state` | default, selected, disabled |
|
|
23
|
+
|
|
24
|
+
## Token Contract
|
|
25
|
+
|
|
26
|
+
Checkbox consumes Banhaten control size, radius, component shadow, border, background, content, interactive, disabled, and typography tokens.
|
|
27
|
+
|
|
28
|
+
## RTL
|
|
29
|
+
|
|
30
|
+
`CheckboxCard` uses logical start/end control placement. Labels and descriptions use tokenized body text and `dir="auto"` for mixed Arabic and English copy.
|
|
31
|
+
|
|
32
|
+
## Accessibility
|
|
33
|
+
|
|
34
|
+
Use native labels or `aria-label` for standalone checkboxes. Prefer `CheckboxCard` when the selection target needs title and description text.
|
|
35
|
+
|
|
36
|
+
## Install
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
npx banhaten add checkbox
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Examples
|
|
43
|
+
|
|
44
|
+
Primary registry example: `examples/checkbox-demo.tsx`.
|
|
45
|
+
|
|
46
|
+
Open the live component page or run `npx banhaten docs checkbox` to inspect source files, install command, and examples.
|
|
47
|
+
|
|
48
|
+
## RTL Rules
|
|
49
|
+
|
|
50
|
+
- `inheritsDirection`: true
|
|
51
|
+
- `controlPlacement`: The card uses start/end control placement so the checkbox mirrors correctly in RTL.
|
|
52
|
+
- `textDirection`: Labels and descriptions use dir="auto" and tokenized body-md/body-sm typography.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Collapsible
|
|
2
|
+
|
|
3
|
+
Collapsible wraps Radix Collapsible for disclosure sections with Banhaten trigger and content styling.
|
|
4
|
+
|
|
5
|
+
## API
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
<Collapsible defaultOpen>
|
|
9
|
+
<CollapsibleTrigger>Workspace details</CollapsibleTrigger>
|
|
10
|
+
<CollapsibleContent>Billing and team settings.</CollapsibleContent>
|
|
11
|
+
</Collapsible>
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
| Part | Purpose |
|
|
15
|
+
| --- | --- |
|
|
16
|
+
| `Collapsible` | Radix root |
|
|
17
|
+
| `CollapsibleTrigger` | disclosure button |
|
|
18
|
+
| `CollapsibleContent` | expandable content region |
|
|
19
|
+
|
|
20
|
+
## Token Contract
|
|
21
|
+
|
|
22
|
+
Collapsible uses Banhaten spacing, radius, body typography, ghost hover, focus, and content tokens.
|
|
23
|
+
|
|
24
|
+
## RTL
|
|
25
|
+
|
|
26
|
+
The trigger and content use logical text alignment and inherit document direction.
|
|
27
|
+
|
|
28
|
+
## Accessibility
|
|
29
|
+
|
|
30
|
+
Radix manages expanded state, trigger attributes, and content relationships.
|
|
31
|
+
|
|
32
|
+
## Install
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npx banhaten add collapsible
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Examples
|
|
39
|
+
|
|
40
|
+
Primary registry example: `examples/collapsible-demo.tsx`.
|
|
41
|
+
|
|
42
|
+
Open the live component page or run `npx banhaten docs collapsible` to inspect source files, install command, and examples.
|
|
43
|
+
|
|
44
|
+
## RTL Rules
|
|
45
|
+
|
|
46
|
+
- `inheritsDirection`: true
|
|
47
|
+
- `textAlignment`: Trigger and content use logical text alignment and inherit direction.
|
|
48
|
+
- `spacing`: Icon and label spacing uses flex gap so it mirrors with document direction.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Command Bar
|
|
2
|
+
|
|
3
|
+
Command Bar gives users a keyboard-friendly command palette with search, recent items, filtered results, and empty states.
|
|
4
|
+
|
|
5
|
+
The implementation follows the Figma component at `Design system 3.0 Copy / CommandBar` (`259:4097`). It supports `default`, `recent`, `results`, and `no-result`; `desktop` and `mobile`; LTR and RTL.
|
|
6
|
+
|
|
7
|
+
## API
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
<CommandBar type="results" breakpoint="desktop" dir="ltr" />
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
| Prop | Values | Default |
|
|
14
|
+
| --- | --- | --- |
|
|
15
|
+
| `type` | `default`, `recent`, `results`, `no-result` | `default` |
|
|
16
|
+
| `breakpoint` | `desktop`, `mobile` | `desktop` |
|
|
17
|
+
| `dir` | `ltr`, `rtl` | `ltr` |
|
|
18
|
+
|
|
19
|
+
## Token Contract
|
|
20
|
+
|
|
21
|
+
The component consumes Banhaten semantic tokens and component aliases. Do not hard-code Figma fallback literals in component source; promote any Figma value into `registry/styles/globals.css` as a `--bh-*` token or alias first.
|
|
22
|
+
|
|
23
|
+
- Backgrounds: `--bh-bg-raised`, `--bh-bg-neutral-soft`, `--bh-bg-neutral-subtle`
|
|
24
|
+
- Borders: `--bh-border-default`, `--bh-border-input`, `--bh-border-subtle`
|
|
25
|
+
- Content: `--bh-content-default`, `--bh-content-muted`, `--bh-content-subtle`
|
|
26
|
+
- Shape: `--bh-radius-md-6`, `--bh-radius-lg-8`, `--bh-radius-3xl-16`, `--bh-radius-full`
|
|
27
|
+
|
|
28
|
+
## Pixel Rules
|
|
29
|
+
|
|
30
|
+
- Text is Inter `15px / 24px`; item descriptions are `12px / 16px`.
|
|
31
|
+
- Desktop command bars are `640px` wide with `16px` radius and `Shadow/xl`.
|
|
32
|
+
- Mobile command bars are `375px x 812px`, flush-edged, with an inset search field.
|
|
33
|
+
- Desktop search rows are `60px` high; mobile search fields are `48px`.
|
|
34
|
+
- Expanded desktop content uses a clipped results area and a `48px` footer for recent/results.
|
|
35
|
+
- Result filters use `36px` chips with `12px` horizontal padding.
|
|
36
|
+
- Items use `32px` leading visuals, `12px` gaps, and a `56px` minimum row height.
|
|
37
|
+
- RTL mirrors row order and uses Arabic labels from the Figma variants.
|
|
38
|
+
|
|
39
|
+
## Install
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
npx banhaten add command-bar
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Examples
|
|
46
|
+
|
|
47
|
+
Primary registry example: `examples/expanded/command-bar-demo.tsx`.
|
|
48
|
+
|
|
49
|
+
Open the live component page or run `npx banhaten docs command-bar` to inspect source files, install command, and examples.
|
|
50
|
+
|
|
51
|
+
## RTL Rules
|
|
52
|
+
|
|
53
|
+
This component has no special RTL contract beyond inherited document direction and logical spacing.
|
|
54
|
+
|
|
55
|
+
## Accessibility
|
|
56
|
+
|
|
57
|
+
Keep native semantics, accessible names, keyboard reachability, focus-visible treatment, and status/error announcements intact when composing this component.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Command
|
|
2
|
+
|
|
3
|
+
Command is a cmdk-backed command menu with search input, grouped results, keyboard navigation, shortcuts, separators, and empty state.
|
|
4
|
+
|
|
5
|
+
## API
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
<Command>
|
|
9
|
+
<CommandInput />
|
|
10
|
+
<CommandList>
|
|
11
|
+
<CommandEmpty>No results found.</CommandEmpty>
|
|
12
|
+
<CommandGroup heading="Pages">
|
|
13
|
+
<CommandItem value="profile">
|
|
14
|
+
Profile
|
|
15
|
+
<CommandShortcut>⌘P</CommandShortcut>
|
|
16
|
+
</CommandItem>
|
|
17
|
+
</CommandGroup>
|
|
18
|
+
</CommandList>
|
|
19
|
+
</Command>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
| Part | Purpose |
|
|
23
|
+
| --- | --- |
|
|
24
|
+
| `Command` | cmdk root |
|
|
25
|
+
| `CommandInput` | search input |
|
|
26
|
+
| `CommandList` | result list |
|
|
27
|
+
| `CommandEmpty` | empty state |
|
|
28
|
+
| `CommandGroup` | grouped results |
|
|
29
|
+
| `CommandItem` | selectable command |
|
|
30
|
+
| `CommandSeparator`, `CommandShortcut` | supporting row UI |
|
|
31
|
+
|
|
32
|
+
## Token Contract
|
|
33
|
+
|
|
34
|
+
Command uses Banhaten raised surface, menu shadow, border, ghost hover, body typography, muted content, and radius tokens.
|
|
35
|
+
|
|
36
|
+
## RTL
|
|
37
|
+
|
|
38
|
+
Command inherits direction. Labels and shortcuts use logical spacing.
|
|
39
|
+
|
|
40
|
+
## Accessibility
|
|
41
|
+
|
|
42
|
+
cmdk handles keyboard navigation and selection. Provide stable `value` props for dynamic items.
|
|
43
|
+
|
|
44
|
+
## Install
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
npx banhaten add command
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Examples
|
|
51
|
+
|
|
52
|
+
Primary registry example: `examples/command-demo.tsx`.
|
|
53
|
+
|
|
54
|
+
Open the live component page or run `npx banhaten docs command` to inspect source files, install command, and examples.
|
|
55
|
+
|
|
56
|
+
## RTL Rules
|
|
57
|
+
|
|
58
|
+
- `inheritsDirection`: true
|
|
59
|
+
- `spacing`: Command rows and shortcuts use logical spacing so shortcut placement mirrors naturally.
|
|
60
|
+
- `textDirection`: Command copy inherits document direction; individual row labels can use dir="auto" when needed.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Context Menu
|
|
2
|
+
|
|
3
|
+
Context Menu wraps Radix ContextMenu for right-click actions with labels, separators, submenus, checkboxes, radios, and shortcuts.
|
|
4
|
+
|
|
5
|
+
## API
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
<ContextMenu>
|
|
9
|
+
<ContextMenuTrigger>Right click</ContextMenuTrigger>
|
|
10
|
+
<ContextMenuContent>
|
|
11
|
+
<ContextMenuItem>Open</ContextMenuItem>
|
|
12
|
+
</ContextMenuContent>
|
|
13
|
+
</ContextMenu>
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Token Contract
|
|
17
|
+
|
|
18
|
+
Context Menu reuses Banhaten menu width, item height, raised surface, hover, shadow, spacing, and typography tokens.
|
|
19
|
+
|
|
20
|
+
## RTL
|
|
21
|
+
|
|
22
|
+
Items and shortcuts use logical spacing. Directional submenu icons flip in RTL.
|
|
23
|
+
|
|
24
|
+
## Accessibility
|
|
25
|
+
|
|
26
|
+
Radix manages keyboard navigation, focus movement, item state, and submenu behavior.
|
|
27
|
+
|
|
28
|
+
## Install
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npx banhaten add context-menu
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Examples
|
|
35
|
+
|
|
36
|
+
Primary registry example: `examples/context-menu-demo.tsx`.
|
|
37
|
+
|
|
38
|
+
Open the live component page or run `npx banhaten docs context-menu` to inspect source files, install command, and examples.
|
|
39
|
+
|
|
40
|
+
## RTL Rules
|
|
41
|
+
|
|
42
|
+
- `inheritsDirection`: true
|
|
43
|
+
- `directionalIconFlip`: Submenu chevrons flip in RTL.
|
|
44
|
+
- `spacing`: Items and shortcuts use logical spacing.
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# Date Picker
|
|
2
|
+
|
|
3
|
+
Date Picker is the calendar and range-selection suite for Banhaten forms. It covers single calendars, month/year views, double calendars, preset lists, date-picker triggers, date-range pickers, open/closed states, time rows, and RTL use cases.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npx banhaten add date-picker
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Anatomy
|
|
12
|
+
|
|
13
|
+
- `Calendar`: single calendar surface with day and month/year views.
|
|
14
|
+
- `RangeCalendar`: single or double range calendar with optional preset list.
|
|
15
|
+
- `DatePicker`: trigger plus single-date calendar surface.
|
|
16
|
+
- `DateRangePicker`: trigger plus range calendar surface.
|
|
17
|
+
- `DatePickerTrigger`: standalone tokenized trigger.
|
|
18
|
+
|
|
19
|
+
## Example
|
|
20
|
+
|
|
21
|
+
```tsx
|
|
22
|
+
import { DatePicker, DateRangePicker } from "@/components/ui/date-picker"
|
|
23
|
+
|
|
24
|
+
export function Example() {
|
|
25
|
+
return (
|
|
26
|
+
<div className="grid gap-4">
|
|
27
|
+
<DatePicker defaultOpen />
|
|
28
|
+
<DateRangePicker type="double" />
|
|
29
|
+
</div>
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Variants
|
|
35
|
+
|
|
36
|
+
| API | Values |
|
|
37
|
+
| --- | --- |
|
|
38
|
+
| `Calendar view` | `days`, `month-year` |
|
|
39
|
+
| `RangeCalendar type` | `single`, `double`, `double-with-presets` |
|
|
40
|
+
| `DatePicker state` | `open`, `closed` |
|
|
41
|
+
| `dir` | inherited, `ltr`, `rtl` |
|
|
42
|
+
|
|
43
|
+
## RTL
|
|
44
|
+
|
|
45
|
+
The trigger, calendar header, preset list, day cells, range fill, and time rows use logical spacing and borders. Range endpoints keep their visual start/end rounding in both LTR and RTL.
|
|
46
|
+
|
|
47
|
+
## API
|
|
48
|
+
|
|
49
|
+
Public exports: `Calendar`, `RangeCalendar`, `DatePicker`, `DateRangePicker`, `DatePickerTrigger`.
|
|
50
|
+
|
|
51
|
+
| Contract | Values |
|
|
52
|
+
| --- | --- |
|
|
53
|
+
| `modes` | `single-calendar`, `single-month-year`, `double-calendar`, `double-calendar-with-presets`, `single-range-calendar`, `date-picker`, `date-range-picker` |
|
|
54
|
+
| `states` | `open`, `closed` |
|
|
55
|
+
|
|
56
|
+
## Examples
|
|
57
|
+
|
|
58
|
+
Primary registry example: `examples/date-picker-demo.tsx`.
|
|
59
|
+
|
|
60
|
+
Open the live component page or run `npx banhaten docs date-picker` to inspect source files, install command, and examples.
|
|
61
|
+
|
|
62
|
+
## Token Contract
|
|
63
|
+
|
|
64
|
+
Component styles must resolve through Banhaten semantic tokens, component aliases, or documented exception-ledger values.
|
|
65
|
+
Do not add raw colors, pixel values, opacity utilities, z-index values, durations, or shadow literals directly to component source.
|
|
66
|
+
Covered source files: `components/date-picker.tsx`, `components/date-picker-state.ts`.
|
|
67
|
+
|
|
68
|
+
## RTL Rules
|
|
69
|
+
|
|
70
|
+
- `inheritsDirection`: true
|
|
71
|
+
- `triggerLayout`: The trigger uses inherited direction so the calendar icon and value mirror naturally.
|
|
72
|
+
- `calendarLayout`: Calendar headers, range presets, date cells, and time rows use logical borders, spacing, and text alignment for LTR and RTL surfaces.
|
|
73
|
+
- `rangeSelection`: Range fill uses logical start/end rounding for week edges and keeps selected endpoints tokenized with brand colors.
|
|
74
|
+
|
|
75
|
+
## Accessibility
|
|
76
|
+
|
|
77
|
+
Keep native semantics, accessible names, keyboard reachability, focus-visible treatment, and status/error announcements intact when composing this component.
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# Divider
|
|
2
|
+
|
|
3
|
+
Dividers, also called separators, separate related content without creating a new surface. `Divider` is the canonical separator primitive for plain horizontal and vertical rules.
|
|
4
|
+
|
|
5
|
+
Figma reference: `Divider`, node `165:3111`.
|
|
6
|
+
|
|
7
|
+
## Variants
|
|
8
|
+
|
|
9
|
+
The component defines these variants:
|
|
10
|
+
|
|
11
|
+
| Direction | Type |
|
|
12
|
+
| --- | --- |
|
|
13
|
+
| `horizontal` | `solid`, `dotted` |
|
|
14
|
+
| `vertical` | `solid`, `dotted` |
|
|
15
|
+
|
|
16
|
+
## API
|
|
17
|
+
|
|
18
|
+
Use semantic names in code even if the Figma variant labels are title-cased.
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
type DividerDirection = "horizontal" | "vertical";
|
|
22
|
+
type DividerType = "solid" | "dotted";
|
|
23
|
+
|
|
24
|
+
type DividerProps = {
|
|
25
|
+
direction?: DividerDirection;
|
|
26
|
+
type?: DividerType;
|
|
27
|
+
decorative?: boolean;
|
|
28
|
+
};
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Layout
|
|
32
|
+
|
|
33
|
+
- Horizontal dividers render as a `1px` high rule with the Figma component length.
|
|
34
|
+
- Vertical dividers render as a `1px` wide rule with the same tokenized length.
|
|
35
|
+
- Dotted dividers use a 2px dash/gap rhythm from the number scale.
|
|
36
|
+
- Direction does not require a separate RTL prop; plain separators are direction-neutral.
|
|
37
|
+
|
|
38
|
+
## Tokens
|
|
39
|
+
|
|
40
|
+
Dividers should consume existing semantic tokens:
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
export const dividerTokens = {
|
|
44
|
+
ruleColor: "border.subtle",
|
|
45
|
+
strokeWidth: "space.xxxs-1",
|
|
46
|
+
dash: "space.xxs-2",
|
|
47
|
+
length: "space.15xl-224",
|
|
48
|
+
};
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Do not hard-code the Figma fallback values in component code. The current Figma fallback for the rule is `rgba(55, 83, 122, 0.13)`, but the implementation should resolve through `border.subtle`.
|
|
52
|
+
|
|
53
|
+
## Accessibility
|
|
54
|
+
|
|
55
|
+
- Decorative divider lines should be hidden from assistive technology.
|
|
56
|
+
- A standalone semantic separator may render as `<hr />` or `role="separator"` when it conveys structure.
|
|
57
|
+
- Do not use the divider as the only indicator of a required grouping if the grouping needs a visible heading.
|
|
58
|
+
|
|
59
|
+
## Usage
|
|
60
|
+
|
|
61
|
+
```tsx
|
|
62
|
+
<Divider />
|
|
63
|
+
<Divider type="dotted" />
|
|
64
|
+
<Divider direction="vertical" />
|
|
65
|
+
<Divider decorative />
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Preset Impact
|
|
69
|
+
|
|
70
|
+
- `default`: quiet 1px rule using `border.subtle`.
|
|
71
|
+
- `rounded`: same rule weight; surrounding compositions may use softer radius tokens.
|
|
72
|
+
- `sharp`: same rule weight; surrounding compositions may use square or near-square containers.
|
|
73
|
+
|
|
74
|
+
## Implementation Notes
|
|
75
|
+
|
|
76
|
+
- Prefer `border-top` or a 1px block rule instead of a filled rectangle.
|
|
77
|
+
- Use `border-style: dashed` for the Figma dotted variant unless the platform has a distinct dotted token or renderer.
|
|
78
|
+
- Compose labeled section breaks outside `Divider`; the core primitive should stay a small separator.
|
|
79
|
+
|
|
80
|
+
## Install
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
npx banhaten add divider
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Examples
|
|
87
|
+
|
|
88
|
+
Primary registry example: `examples/divider-demo.tsx`.
|
|
89
|
+
|
|
90
|
+
Open the live component page or run `npx banhaten docs divider` to inspect source files, install command, and examples.
|
|
91
|
+
|
|
92
|
+
## Token Contract
|
|
93
|
+
|
|
94
|
+
Component styles must resolve through Banhaten semantic tokens, component aliases, or documented exception-ledger values.
|
|
95
|
+
Do not add raw colors, pixel values, opacity utilities, z-index values, durations, or shadow literals directly to component source.
|
|
96
|
+
Covered source files: `components/divider.tsx`.
|
|
97
|
+
|
|
98
|
+
## RTL Rules
|
|
99
|
+
|
|
100
|
+
- `inheritsDirection`: false
|
|
101
|
+
- `geometry`: Direction maps to component orientation, not document text direction.
|
|
@@ -0,0 +1,55 @@
|
|
|
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.
|
|
@@ -0,0 +1,69 @@
|
|
|
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.
|