banhaten 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (231) hide show
  1. package/README.md +93 -328
  2. package/banhaten.config.example.json +1 -1
  3. package/docs/design-system/README.md +11 -0
  4. package/docs/design-system/appearance-presets.md +184 -0
  5. package/docs/design-system/appearances/default.md +94 -0
  6. package/docs/design-system/appearances/rounded.md +95 -0
  7. package/docs/design-system/appearances/sharp.md +95 -0
  8. package/docs/design-system/component-showcase-consistency-report.md +217 -0
  9. package/docs/design-system/component-token-consistency-audit.md +163 -0
  10. package/docs/design-system/components/README.md +74 -0
  11. package/docs/design-system/components/accordion.md +51 -0
  12. package/docs/design-system/components/activity-feed.md +92 -0
  13. package/docs/design-system/components/alert-dialog.md +70 -0
  14. package/docs/design-system/components/alert.md +79 -0
  15. package/docs/design-system/components/aspect-ratio.md +44 -0
  16. package/docs/design-system/components/attribute.md +87 -0
  17. package/docs/design-system/components/autocomplete.md +74 -0
  18. package/docs/design-system/components/avatar.md +52 -0
  19. package/docs/design-system/components/badge.md +53 -0
  20. package/docs/design-system/components/banner.md +85 -0
  21. package/docs/design-system/components/breadcrumbs.md +174 -0
  22. package/docs/design-system/components/button-group.md +83 -0
  23. package/docs/design-system/components/button.md +77 -0
  24. package/docs/design-system/components/card.md +78 -0
  25. package/docs/design-system/components/carousel.md +44 -0
  26. package/docs/design-system/components/catalog-components.md +45 -0
  27. package/docs/design-system/components/chart.md +43 -0
  28. package/docs/design-system/components/checkbox.md +52 -0
  29. package/docs/design-system/components/collapsible.md +48 -0
  30. package/docs/design-system/components/command-bar.md +57 -0
  31. package/docs/design-system/components/command.md +60 -0
  32. package/docs/design-system/components/context-menu.md +44 -0
  33. package/docs/design-system/components/date-picker.md +77 -0
  34. package/docs/design-system/components/divider.md +101 -0
  35. package/docs/design-system/components/empty-state.md +55 -0
  36. package/docs/design-system/components/field.md +69 -0
  37. package/docs/design-system/components/file-upload.md +185 -0
  38. package/docs/design-system/components/hover-card.md +46 -0
  39. package/docs/design-system/components/icons.md +48 -0
  40. package/docs/design-system/components/input-group.md +56 -0
  41. package/docs/design-system/components/input-otp.md +55 -0
  42. package/docs/design-system/components/input.md +48 -0
  43. package/docs/design-system/components/kbd.md +44 -0
  44. package/docs/design-system/components/label.md +48 -0
  45. package/docs/design-system/components/menu.md +59 -0
  46. package/docs/design-system/components/menubar.md +45 -0
  47. package/docs/design-system/components/modal.md +98 -0
  48. package/docs/design-system/components/native-select.md +52 -0
  49. package/docs/design-system/components/navigation-menu.md +48 -0
  50. package/docs/design-system/components/onboarding-step-list-item.md +80 -0
  51. package/docs/design-system/components/page-header.md +84 -0
  52. package/docs/design-system/components/pagination.md +49 -0
  53. package/docs/design-system/components/popover.md +58 -0
  54. package/docs/design-system/components/progress-slider.md +48 -0
  55. package/docs/design-system/components/progress.md +75 -0
  56. package/docs/design-system/components/radio-card.md +49 -0
  57. package/docs/design-system/components/radio-group.md +55 -0
  58. package/docs/design-system/components/resizable.md +42 -0
  59. package/docs/design-system/components/scroll-area.md +45 -0
  60. package/docs/design-system/components/select.md +50 -0
  61. package/docs/design-system/components/sheet.md +65 -0
  62. package/docs/design-system/components/sidebar.md +68 -0
  63. package/docs/design-system/components/skeleton.md +73 -0
  64. package/docs/design-system/components/slideout.md +63 -0
  65. package/docs/design-system/components/slider.md +61 -0
  66. package/docs/design-system/components/social-button.md +47 -0
  67. package/docs/design-system/components/spinner.md +61 -0
  68. package/docs/design-system/components/steps.md +63 -0
  69. package/docs/design-system/components/table.md +397 -0
  70. package/docs/design-system/components/tabs.md +52 -0
  71. package/docs/design-system/components/tag.md +78 -0
  72. package/docs/design-system/components/textarea.md +48 -0
  73. package/docs/design-system/components/timeline.md +81 -0
  74. package/docs/design-system/components/toast.md +56 -0
  75. package/docs/design-system/components/toggle.md +79 -0
  76. package/docs/design-system/components/toolbar.md +85 -0
  77. package/docs/design-system/components/tooltip.md +90 -0
  78. package/docs/design-system/components/typography.md +18 -0
  79. package/docs/design-system/design-system-test-missing-items.md +368 -0
  80. package/docs/design-system/icons.md +69 -0
  81. package/docs/design-system/registry-and-cli.md +41 -0
  82. package/docs/design-system/tabs.md +53 -0
  83. package/docs/design-system/token-governance.md +38 -0
  84. package/package.json +83 -65
  85. package/registry/components/alert-dialog.tsx +297 -0
  86. package/registry/components/aspect-ratio.tsx +30 -0
  87. package/registry/components/carousel.tsx +234 -0
  88. package/registry/components/chart.tsx +170 -0
  89. package/registry/components/collapsible.tsx +69 -0
  90. package/registry/components/command.tsx +174 -0
  91. package/registry/components/context-menu.tsx +236 -0
  92. package/registry/components/date-picker.tsx +1 -1
  93. package/registry/components/expanded/PageHeader.tsx +1 -1
  94. package/registry/components/expanded/breadcrumbs.css +139 -139
  95. package/registry/components/expanded/catalogComponentsShowcase.css +83 -83
  96. package/registry/components/expanded/steps.css +274 -274
  97. package/registry/components/expanded/timeline.css +264 -264
  98. package/registry/components/field.tsx +230 -0
  99. package/registry/components/hover-card.tsx +48 -0
  100. package/registry/components/input-group.tsx +130 -0
  101. package/registry/components/input.tsx +2 -2
  102. package/registry/components/kbd.tsx +44 -0
  103. package/registry/components/label.tsx +78 -0
  104. package/registry/components/menu.tsx +3 -1
  105. package/registry/components/menubar.tsx +226 -0
  106. package/registry/components/modal.tsx +109 -76
  107. package/registry/components/native-select.tsx +205 -0
  108. package/registry/components/navigation-menu.tsx +171 -0
  109. package/registry/components/radio-group.tsx +1 -1
  110. package/registry/components/resizable.tsx +74 -0
  111. package/registry/components/scroll-area.tsx +67 -0
  112. package/registry/components/select.tsx +2 -4
  113. package/registry/components/sheet.tsx +305 -0
  114. package/registry/components/sidebar.tsx +352 -0
  115. package/registry/components/social-button.tsx +74 -10
  116. package/registry/components/{expanded/tabs.css → tabs.css} +127 -106
  117. package/registry/components/tabs.tsx +242 -0
  118. package/registry/components/textarea.tsx +1 -1
  119. package/registry/components/toast.tsx +131 -0
  120. package/registry/examples/alert-dialog-demo.tsx +42 -0
  121. package/registry/examples/aspect-ratio-demo.tsx +11 -0
  122. package/registry/examples/carousel-demo.tsx +25 -0
  123. package/registry/examples/chart-demo.tsx +33 -0
  124. package/registry/examples/collapsible-demo.tsx +16 -0
  125. package/registry/examples/command-demo.tsx +42 -0
  126. package/registry/examples/context-menu-demo.tsx +29 -0
  127. package/registry/examples/expanded/tabs-demo.tsx +1 -1
  128. package/registry/examples/field-demo.tsx +51 -0
  129. package/registry/examples/hover-card-demo.tsx +23 -0
  130. package/registry/examples/input-group-demo.tsx +16 -0
  131. package/registry/examples/kbd-demo.tsx +11 -0
  132. package/registry/examples/label-demo.tsx +20 -0
  133. package/registry/examples/menubar-demo.tsx +34 -0
  134. package/registry/examples/native-select-demo.tsx +16 -0
  135. package/registry/examples/navigation-menu-demo.tsx +29 -0
  136. package/registry/examples/resizable-demo.tsx +22 -0
  137. package/registry/examples/scroll-area-demo.tsx +15 -0
  138. package/registry/examples/sheet-demo.tsx +47 -0
  139. package/registry/examples/sidebar-demo.tsx +55 -0
  140. package/registry/examples/tabs-demo.tsx +13 -0
  141. package/registry/examples/toast-demo.tsx +35 -0
  142. package/registry/index.json +655 -11
  143. package/registry/styles/globals.css +4733 -4690
  144. package/registry.json +1612 -0
  145. package/schema/config.schema.json +48 -0
  146. package/schema/registry.schema.json +85 -0
  147. package/schema/tokens.schema.json +63 -0
  148. package/src/cli/index.js +312 -18
  149. package/tokens/banhaten.tokens.json +1 -1
  150. package/registry/assets/avatars/avatar-02.jpg +0 -0
  151. package/registry/assets/avatars/avatar-03.jpg +0 -0
  152. package/registry/assets/avatars/avatar-04.jpg +0 -0
  153. package/registry/assets/avatars/avatar-05.jpg +0 -0
  154. package/registry/assets/avatars/avatar-06.jpg +0 -0
  155. package/registry/assets/avatars/avatar-07.jpg +0 -0
  156. package/registry/assets/avatars/avatar-08.jpg +0 -0
  157. package/registry/assets/avatars/avatar-09.jpg +0 -0
  158. package/registry/assets/avatars/avatar-10.jpg +0 -0
  159. package/registry/assets/avatars/avatar-11.jpg +0 -0
  160. package/registry/assets/avatars/avatar-12.jpg +0 -0
  161. package/registry/assets/avatars/avatar-13.jpg +0 -0
  162. package/registry/assets/avatars/avatar-14.jpg +0 -0
  163. package/registry/assets/avatars/avatar-15.jpg +0 -0
  164. package/registry/assets/avatars/avatar-16.jpg +0 -0
  165. package/registry/assets/avatars/avatar-17.jpg +0 -0
  166. package/registry/assets/avatars/avatar-18.jpg +0 -0
  167. package/registry/assets/avatars/avatar-19.jpg +0 -0
  168. package/registry/assets/avatars/avatar-20.jpg +0 -0
  169. package/registry/assets/avatars/avatar-21.jpg +0 -0
  170. package/registry/assets/avatars/avatar-22.jpg +0 -0
  171. package/registry/assets/avatars/avatar-23.jpg +0 -0
  172. package/registry/assets/avatars/avatar-24.jpg +0 -0
  173. package/registry/assets/avatars/avatar-25.jpg +0 -0
  174. package/registry/assets/avatars/avatar-26.jpg +0 -0
  175. package/registry/assets/avatars/avatar-27.jpg +0 -0
  176. package/registry/assets/avatars/avatar-28.jpg +0 -0
  177. package/registry/assets/avatars/avatar-29.jpg +0 -0
  178. package/registry/assets/avatars/avatar-30.jpg +0 -0
  179. package/registry/assets/avatars/avatar-31.jpg +0 -0
  180. package/registry/assets/avatars/avatar-32.jpg +0 -0
  181. package/registry/assets/avatars/avatar-33.jpg +0 -0
  182. package/registry/assets/avatars/avatar-34.jpg +0 -0
  183. package/registry/assets/avatars/avatar-35.jpg +0 -0
  184. package/registry/assets/image-assets.json +0 -744
  185. package/registry/assets/images/art-02.jpg +0 -0
  186. package/registry/assets/images/art-03.jpg +0 -0
  187. package/registry/assets/images/art-04.jpg +0 -0
  188. package/registry/assets/images/art-05.jpg +0 -0
  189. package/registry/assets/images/art-06.jpg +0 -0
  190. package/registry/assets/images/art-07.jpg +0 -0
  191. package/registry/assets/images/art-08.jpg +0 -0
  192. package/registry/assets/images/art-09.jpg +0 -0
  193. package/registry/assets/images/art-10.jpg +0 -0
  194. package/registry/assets/images/art-11.jpg +0 -0
  195. package/registry/assets/images/art-12.jpg +0 -0
  196. package/registry/assets/images/art-13.jpg +0 -0
  197. package/registry/assets/images/art-14.jpg +0 -0
  198. package/registry/assets/images/art-15.jpg +0 -0
  199. package/registry/assets/images/art-16.jpg +0 -0
  200. package/registry/assets/images/art-17.jpg +0 -0
  201. package/registry/assets/images/art-18.jpg +0 -0
  202. package/registry/assets/images/art-19.jpg +0 -0
  203. package/registry/assets/images/art-20.jpg +0 -0
  204. package/registry/assets/images/art-21.jpg +0 -0
  205. package/registry/assets/images/art-22.jpg +0 -0
  206. package/registry/assets/images/art-23.jpg +0 -0
  207. package/registry/assets/images/art-24.jpg +0 -0
  208. package/registry/assets/images/art-25.jpg +0 -0
  209. package/registry/assets/images/art-26.jpg +0 -0
  210. package/registry/assets/images/art-27.jpg +0 -0
  211. package/registry/assets/images/nature-01.jpg +0 -0
  212. package/registry/assets/images/nature-02.jpg +0 -0
  213. package/registry/assets/images/nature-03.jpg +0 -0
  214. package/registry/assets/images/nature-04.jpg +0 -0
  215. package/registry/assets/images/nature-05.jpg +0 -0
  216. package/registry/assets/images/nature-06.jpg +0 -0
  217. package/registry/assets/images/nature-07.jpg +0 -0
  218. package/registry/assets/images/nature-08.jpg +0 -0
  219. package/registry/assets/images/nature-09.jpg +0 -0
  220. package/registry/assets/images/nature-10.jpg +0 -0
  221. package/registry/assets/images/nature-11.jpg +0 -0
  222. package/registry/assets/images/nature-12.jpg +0 -0
  223. package/registry/assets/images/nature-13.jpg +0 -0
  224. package/registry/assets/images/nature-14.jpg +0 -0
  225. package/registry/assets/images/nature-15.jpg +0 -0
  226. package/registry/assets/images/nature-16.jpg +0 -0
  227. package/registry/assets/images/nature-17.jpg +0 -0
  228. package/registry/assets/images/nature-18.jpg +0 -0
  229. package/registry/assets/images/nature-19.jpg +0 -0
  230. package/registry/assets/images/nature-20.jpg +0 -0
  231. package/registry/components/expanded/Tabs.tsx +0 -86
@@ -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.
@@ -0,0 +1,185 @@
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.
@@ -0,0 +1,46 @@
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.
@@ -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,56 @@
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.
@@ -0,0 +1,55 @@
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.
@@ -0,0 +1,48 @@
1
+ # Input
2
+
3
+ Input is the text-entry field primitive for forms, filters, search, numeric entry, tags, shortcuts, add-ons, and action-adorned fields. It supports default and soft variants, md/lg sizing, helper and error text, and RTL-safe slot placement.
4
+
5
+ ## API
6
+
7
+ ```tsx
8
+ <Input label="Email" placeholder="name@example.com" />
9
+ <Input state="error" label="Amount" message="Enter a valid amount" />
10
+ ```
11
+
12
+ | Prop | Values |
13
+ | --- | --- |
14
+ | `kind` | `default`, `shortcut`, `add-on`, `inline-add-on`, `tags`, `inline-tags`, `trailing-dropdown`, `leading-dropdown`, `quantity`, `quantity-2`, `trailing-button`, `leading-button` |
15
+ | `variant` | `default`, `soft` |
16
+ | `size` | `md`, `lg` |
17
+ | `state` | `default`, `filled`, `error`, `disabled` |
18
+ | `label`, `message` | `ReactNode` |
19
+
20
+ ## Token Contract
21
+
22
+ Input consumes Banhaten field, control, typography, spacing, border, radius, content, disabled, error, and focus tokens. Add-on and button segments should use logical borders and shared field tokens.
23
+
24
+ ## RTL
25
+
26
+ Input uses logical start/end slots and `text-start`. Labels, values, add-ons, tags, and helper text use `dir="auto"` where string copy is rendered.
27
+
28
+ ## Accessibility
29
+
30
+ Connect labels and helper/error text through the component props when possible. Use `state="error"` with visible error copy instead of relying only on red borders.
31
+
32
+ ## Install
33
+
34
+ ```bash
35
+ npx banhaten add input
36
+ ```
37
+
38
+ ## Examples
39
+
40
+ Primary registry example: `examples/input-demo.tsx`.
41
+
42
+ Open the live component page or run `npx banhaten docs input` to inspect source files, install command, and examples.
43
+
44
+ ## RTL Rules
45
+
46
+ - `inheritsDirection`: true
47
+ - `textAlignment`: Uses text-start and dir="auto" so Arabic and English labels, values, add-ons, tags, and helper text align naturally.
48
+ - `spacing`: Uses logical start/end borders and inherited direction so leading and trailing segments mirror in RTL.
@@ -0,0 +1,44 @@
1
+ # Kbd
2
+
3
+ Kbd renders compact keyboard hints for shortcuts, command rows, and form help text.
4
+
5
+ ## API
6
+
7
+ ```tsx
8
+ <Kbd>⌘</Kbd>
9
+ <Kbd>K</Kbd>
10
+ <Kbd size="md">Shift</Kbd>
11
+ ```
12
+
13
+ | Prop | Values |
14
+ | --- | --- |
15
+ | `size` | `sm`, `md` |
16
+
17
+ ## Token Contract
18
+
19
+ Kbd uses Banhaten border, soft interactive background, radius, body-xs typography, and button shadow tokens.
20
+
21
+ ## RTL
22
+
23
+ Kbd is direction-neutral. Use surrounding text direction for shortcut descriptions.
24
+
25
+ ## Accessibility
26
+
27
+ Use Kbd as supporting text, not as the only label for an action.
28
+
29
+ ## Install
30
+
31
+ ```bash
32
+ npx banhaten add kbd
33
+ ```
34
+
35
+ ## Examples
36
+
37
+ Primary registry example: `examples/kbd-demo.tsx`.
38
+
39
+ Open the live component page or run `npx banhaten docs kbd` to inspect source files, install command, and examples.
40
+
41
+ ## RTL Rules
42
+
43
+ - `inheritsDirection`: false
44
+ - `semantics`: Kbd is direction-neutral and should be paired with surrounding text labels.
@@ -0,0 +1,48 @@
1
+ # Label
2
+
3
+ Label renders accessible control labels with Banhaten typography, required markers, optional text, tone variants, and RTL-safe copy. It is backed by Radix Label.
4
+
5
+ ## API
6
+
7
+ ```tsx
8
+ <Label htmlFor="email" required>
9
+ Email address
10
+ </Label>
11
+ ```
12
+
13
+ | Prop | Values |
14
+ | --- | --- |
15
+ | `htmlFor` | target control id |
16
+ | `tone` | `default`, `subtle`, `danger` |
17
+ | `required` | `boolean` |
18
+ | `optionalText` | `ReactNode` |
19
+
20
+ ## Token Contract
21
+
22
+ Label consumes Banhaten body-sm, body-xs, content, danger, spacing, and disabled-state tokens.
23
+
24
+ ## RTL
25
+
26
+ Label uses logical inline spacing and `dir="auto"` for label and optional text.
27
+
28
+ ## Accessibility
29
+
30
+ Use `htmlFor` for native controls. For complete form rows with description and error text, use `Field`.
31
+
32
+ ## Install
33
+
34
+ ```bash
35
+ npx banhaten add label
36
+ ```
37
+
38
+ ## Examples
39
+
40
+ Primary registry example: `examples/label-demo.tsx`.
41
+
42
+ Open the live component page or run `npx banhaten docs label` to inspect source files, install command, and examples.
43
+
44
+ ## RTL Rules
45
+
46
+ - `inheritsDirection`: true
47
+ - `textDirection`: Label and optional text use dir="auto" so Arabic and English labels resolve naturally.
48
+ - `spacing`: Uses logical inline spacing between label text, required marker, and optional text.
@@ -0,0 +1,59 @@
1
+ # Menu
2
+
3
+ Menu is a Radix DropdownMenu-backed action surface for contextual commands, navigation, progress rows, labels, captions, call-to-action rows, submenus, and rich item media.
4
+
5
+ ## API
6
+
7
+ ```tsx
8
+ <MenuRoot>
9
+ <MenuTrigger>Open menu</MenuTrigger>
10
+ <MenuContent width="menu">
11
+ <MenuItem>Profile</MenuItem>
12
+ <MenuSeparator />
13
+ <MenuItem kind="button">Upgrade plan</MenuItem>
14
+ </MenuContent>
15
+ </MenuRoot>
16
+ ```
17
+
18
+ | Part | Purpose |
19
+ | --- | --- |
20
+ | `MenuRoot`, `MenuTrigger`, `MenuContent`, `MenuPortal` | Radix-backed menu shell |
21
+ | `MenuItem`, `MenuItemContent`, media slots | interactive rows |
22
+ | `MenuSub`, `MenuSubTrigger`, `MenuSubContent` | nested menus |
23
+ | `MenuLabel`, `MenuCaption`, `MenuSeparator` | non-interactive structure |
24
+
25
+ | Prop | Values |
26
+ | --- | --- |
27
+ | `width` | `menu`, `default`, `multiline`, `action`, `auto` |
28
+ | `kind` | `default`, `multiline`, `action`, `progress`, `button` |
29
+
30
+ ## Token Contract
31
+
32
+ Menu uses Banhaten raised surface, menu shadow, item typography, border, radius, spacing, progress, badge, switch, and focus tokens.
33
+
34
+ ## RTL
35
+
36
+ Menu uses logical padding and flex direction so leading icons, trailing actions, badges, switches, meta text, and submenus mirror naturally. Directional icons should use `data-rtl-flip="true"`.
37
+
38
+ ## Accessibility
39
+
40
+ Radix provides menu roles, focus management, typeahead, keyboard navigation, Escape handling, and outside dismissal. Keep non-command copy in labels or captions, not disabled menu items.
41
+
42
+ ## Install
43
+
44
+ ```bash
45
+ npx banhaten add menu
46
+ ```
47
+
48
+ ## Examples
49
+
50
+ Primary registry example: `examples/menu-demo.tsx`.
51
+
52
+ Open the live component page or run `npx banhaten docs menu` to inspect source files, install command, and examples.
53
+
54
+ ## RTL Rules
55
+
56
+ - `inheritsDirection`: true
57
+ - `spacing`: Uses logical padding and flex direction so leading, trailing, badge, switch, right text, and action slots mirror naturally.
58
+ - `directionalIconFlip`: Use data-rtl-flip="true" on chevrons and arrows that should mirror.
59
+ - `textDirection`: Text slots use dir="auto" by default for Arabic and English labels.