banhaten 0.5.0 → 0.6.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 +177 -139
- package/CONTRIBUTING.md +46 -46
- package/README.md +192 -192
- package/SECURITY.md +15 -15
- package/banhaten.config.example.json +11 -11
- package/docs/design-spacing.md +13 -13
- package/docs/design-system/README.md +22 -22
- package/docs/design-system/adoption-quality-remediation.md +87 -87
- package/docs/design-system/agent-usage.md +13 -13
- package/docs/design-system/appearance-presets.md +189 -189
- package/docs/design-system/appearances/default.md +94 -94
- package/docs/design-system/appearances/rounded.md +95 -95
- package/docs/design-system/appearances/sharp.md +95 -95
- package/docs/design-system/component-docs-pattern.md +81 -81
- package/docs/design-system/component-implementation-ownership-audit.md +245 -245
- package/docs/design-system/component-quality-audit-2026-08-20.md +225 -225
- package/docs/design-system/component-showcase-consistency-report.md +219 -219
- package/docs/design-system/component-token-consistency-audit.md +173 -173
- package/docs/design-system/components/README.md +91 -90
- package/docs/design-system/components/accordion.md +52 -52
- package/docs/design-system/components/activity-feed.md +93 -93
- package/docs/design-system/components/activity-heatmap.md +56 -56
- package/docs/design-system/components/alert-dialog.md +71 -71
- package/docs/design-system/components/alert.md +103 -97
- package/docs/design-system/components/app-header.md +97 -0
- package/docs/design-system/components/aspect-ratio.md +45 -45
- package/docs/design-system/components/attribute.md +101 -89
- package/docs/design-system/components/autocomplete.md +75 -75
- package/docs/design-system/components/avatar.md +53 -53
- package/docs/design-system/components/badge.md +55 -55
- package/docs/design-system/components/banner.md +86 -86
- package/docs/design-system/components/breadcrumbs.md +181 -177
- package/docs/design-system/components/button-group.md +97 -97
- package/docs/design-system/components/button.md +80 -80
- package/docs/design-system/components/card.md +102 -88
- package/docs/design-system/components/carousel.md +46 -46
- package/docs/design-system/components/catalog-components.md +46 -46
- package/docs/design-system/components/checkbox.md +53 -53
- package/docs/design-system/components/collapsible.md +63 -63
- package/docs/design-system/components/command.md +61 -61
- package/docs/design-system/components/context-menu.md +45 -45
- package/docs/design-system/components/date-picker.md +80 -80
- package/docs/design-system/components/divider.md +102 -102
- package/docs/design-system/components/empty-state.md +56 -56
- package/docs/design-system/components/field.md +70 -70
- package/docs/design-system/components/file-upload.md +186 -186
- package/docs/design-system/components/hover-card.md +47 -47
- package/docs/design-system/components/icons.md +48 -48
- package/docs/design-system/components/input-group.md +57 -57
- package/docs/design-system/components/input-otp.md +56 -56
- package/docs/design-system/components/input.md +111 -109
- package/docs/design-system/components/item.md +58 -58
- package/docs/design-system/components/kbd.md +49 -49
- package/docs/design-system/components/label.md +49 -49
- package/docs/design-system/components/menu.md +94 -73
- package/docs/design-system/components/menubar.md +46 -46
- package/docs/design-system/components/modal.md +104 -104
- package/docs/design-system/components/native-select.md +53 -53
- package/docs/design-system/components/navigation-menu.md +49 -49
- package/docs/design-system/components/onboarding-step-list-item.md +81 -81
- package/docs/design-system/components/page-header.md +127 -93
- package/docs/design-system/components/pagination.md +56 -56
- package/docs/design-system/components/popover.md +59 -59
- package/docs/design-system/components/progress-slider.md +49 -49
- package/docs/design-system/components/progress.md +76 -76
- package/docs/design-system/components/radio-card.md +50 -50
- package/docs/design-system/components/radio-group.md +56 -56
- package/docs/design-system/components/resizable.md +43 -43
- package/docs/design-system/components/scroll-area.md +50 -50
- package/docs/design-system/components/segmented-control.md +54 -54
- package/docs/design-system/components/select.md +68 -64
- package/docs/design-system/components/sheet.md +66 -66
- package/docs/design-system/components/sidebar.md +167 -111
- package/docs/design-system/components/skeleton.md +74 -74
- package/docs/design-system/components/slideout.md +64 -64
- package/docs/design-system/components/slider.md +62 -62
- package/docs/design-system/components/social-button.md +49 -49
- package/docs/design-system/components/spinner.md +62 -62
- package/docs/design-system/components/steps.md +65 -65
- package/docs/design-system/components/table.md +499 -422
- package/docs/design-system/components/tabs.md +74 -59
- package/docs/design-system/components/tag.md +79 -79
- package/docs/design-system/components/textarea.md +49 -49
- package/docs/design-system/components/timeline.md +82 -82
- package/docs/design-system/components/toast.md +57 -57
- package/docs/design-system/components/toggle.md +80 -80
- package/docs/design-system/components/toolbar.md +89 -89
- package/docs/design-system/components/tooltip.md +92 -92
- package/docs/design-system/components/typography.md +18 -18
- package/docs/design-system/density-and-elevation.md +65 -65
- package/docs/design-system/design-system-test-missing-items.md +368 -368
- package/docs/design-system/direction-and-localization.md +23 -23
- package/docs/design-system/form-recipes.md +73 -73
- package/docs/design-system/gap-promotion-policy.md +21 -21
- package/docs/design-system/icons.md +74 -74
- package/docs/design-system/installation.md +70 -70
- package/docs/design-system/launch-comparison-shadcn.md +98 -98
- package/docs/design-system/registry-and-cli.md +64 -64
- package/docs/design-system/release-policy.md +30 -30
- package/docs/design-system/roadmap.md +14 -14
- package/docs/design-system/support-matrix.md +23 -23
- package/docs/design-system/tabs.md +54 -54
- package/docs/design-system/template-gap-audit.md +32 -32
- package/docs/design-system/templates.md +59 -59
- package/docs/design-system/token-governance.md +72 -72
- package/package.json +98 -98
- package/registry/component-contract.json +40 -40
- package/registry/components/accordion.tsx +155 -155
- package/registry/components/alert-dialog.tsx +297 -297
- package/registry/components/alert.tsx +309 -293
- package/registry/components/app-header.tsx +151 -0
- package/registry/components/aspect-ratio.tsx +30 -30
- package/registry/components/attribute.tsx +489 -454
- package/registry/components/autocomplete.tsx +598 -598
- package/registry/components/avatar.tsx +385 -385
- package/registry/components/badge.tsx +630 -629
- package/registry/components/button-group.tsx +565 -565
- package/registry/components/button.tsx +128 -127
- package/registry/components/card.tsx +651 -638
- package/registry/components/carousel.tsx +296 -296
- package/registry/components/chart.tsx +203 -203
- package/registry/components/checkbox.tsx +247 -247
- package/registry/components/collapsible.tsx +109 -109
- package/registry/components/command.tsx +208 -208
- package/registry/components/context-menu.tsx +236 -236
- package/registry/components/date-picker.tsx +1289 -1289
- package/registry/components/expanded/ActivityFeed.tsx +227 -227
- package/registry/components/expanded/ActivityHeatmap.tsx +64 -64
- package/registry/components/expanded/Banner.tsx +179 -179
- package/registry/components/expanded/Breadcrumbs.tsx +135 -131
- package/registry/components/expanded/CatalogComponentsShowcase.tsx +205 -205
- package/registry/components/expanded/CatalogDivider.tsx +49 -49
- package/registry/components/expanded/EmptyState.tsx +155 -155
- package/registry/components/expanded/FileUpload.tsx +543 -543
- package/registry/components/expanded/OnboardingStepListItem.tsx +60 -60
- package/registry/components/expanded/PageHeader.tsx +209 -179
- package/registry/components/expanded/Slideout.tsx +108 -108
- package/registry/components/expanded/Steps.tsx +402 -402
- package/registry/components/expanded/Table.tsx +1109 -1092
- package/registry/components/expanded/Timeline.tsx +203 -203
- package/registry/components/expanded/activityFeed.css +248 -248
- package/registry/components/expanded/activityHeatmap.css +66 -66
- package/registry/components/expanded/banner.css +260 -260
- package/registry/components/expanded/breadcrumbs.css +157 -140
- package/registry/components/expanded/catalogComponentsShowcase.css +87 -87
- package/registry/components/expanded/divider.css +75 -75
- package/registry/components/expanded/emptyState.css +111 -111
- package/registry/components/expanded/fileUpload.css +457 -457
- package/registry/components/expanded/onboardingStepListItem.css +135 -135
- package/registry/components/expanded/pageHeader.css +284 -248
- package/registry/components/expanded/slideout.css +276 -276
- package/registry/components/expanded/steps.css +356 -356
- package/registry/components/expanded/table.css +655 -606
- package/registry/components/expanded/timeline.css +286 -286
- package/registry/components/field.tsx +283 -283
- package/registry/components/hover-card.tsx +48 -48
- package/registry/components/input-content.ts +107 -107
- package/registry/components/input-group.tsx +130 -130
- package/registry/components/input-otp.tsx +584 -584
- package/registry/components/input.tsx +992 -990
- package/registry/components/item.tsx +189 -189
- package/registry/components/kbd.tsx +246 -246
- package/registry/components/label.tsx +78 -78
- package/registry/components/menu.tsx +1091 -978
- package/registry/components/menubar.tsx +226 -226
- package/registry/components/modal.tsx +872 -872
- package/registry/components/native-select.tsx +205 -205
- package/registry/components/navigation-menu.tsx +171 -171
- package/registry/components/pagination.css +36 -36
- package/registry/components/pagination.tsx +560 -560
- package/registry/components/popover.tsx +338 -338
- package/registry/components/progress-slider.tsx +216 -216
- package/registry/components/radio-card.tsx +676 -676
- package/registry/components/radio-group.tsx +570 -570
- package/registry/components/resizable.tsx +108 -108
- package/registry/components/scroll-area.tsx +91 -91
- package/registry/components/segmented-control.tsx +87 -87
- package/registry/components/select-content.tsx +218 -218
- package/registry/components/select.tsx +937 -937
- package/registry/components/sheet.tsx +305 -305
- package/registry/components/sidebar.tsx +1535 -1433
- package/registry/components/skeleton.css +54 -54
- package/registry/components/skeleton.tsx +482 -482
- package/registry/components/slider.tsx +380 -380
- package/registry/components/social-button.tsx +387 -387
- package/registry/components/spinner.tsx +78 -78
- package/registry/components/table-elements.tsx +287 -128
- package/registry/components/tabs.css +246 -222
- package/registry/components/tabs.tsx +245 -241
- package/registry/components/tag.tsx +423 -423
- package/registry/components/textarea.tsx +610 -610
- package/registry/components/toast.tsx +136 -136
- package/registry/components/toggle.tsx +256 -256
- package/registry/components/toolbar.tsx +539 -539
- package/registry/components/tooltip.tsx +433 -433
- package/registry/examples/alert-demo.tsx +34 -34
- package/registry/examples/alert-dialog-demo.tsx +42 -42
- package/registry/examples/app-header-demo.tsx +40 -0
- package/registry/examples/aspect-ratio-demo.tsx +11 -11
- package/registry/examples/attribute-demo.tsx +65 -65
- package/registry/examples/autocomplete-demo.tsx +109 -109
- package/registry/examples/avatar-demo.tsx +132 -132
- package/registry/examples/badge-demo.tsx +69 -69
- package/registry/examples/button-demo.tsx +86 -86
- package/registry/examples/button-group-demo.tsx +63 -63
- package/registry/examples/card-demo.tsx +86 -86
- package/registry/examples/carousel-demo.tsx +43 -43
- package/registry/examples/chart-demo.tsx +18 -18
- package/registry/examples/checkbox-demo.tsx +62 -62
- package/registry/examples/collapsible-demo.tsx +16 -16
- package/registry/examples/collection-filter-bar-demo.tsx +135 -135
- package/registry/examples/command-demo.tsx +42 -42
- package/registry/examples/command-palette-demo.tsx +235 -235
- package/registry/examples/context-menu-demo.tsx +29 -29
- package/registry/examples/control-density-contract-demo.tsx +65 -65
- package/registry/examples/date-picker-demo.tsx +127 -127
- package/registry/examples/divider-demo.tsx +17 -17
- package/registry/examples/expanded/activity-heatmap-demo.tsx +29 -29
- package/registry/examples/expanded/banner-demo.tsx +48 -48
- package/registry/examples/expanded/breadcrumbs-demo.tsx +59 -59
- package/registry/examples/expanded/empty-state-demo.tsx +39 -39
- package/registry/examples/expanded/file-upload-demo.tsx +60 -60
- package/registry/examples/expanded/onboarding-step-demo.tsx +11 -11
- package/registry/examples/expanded/slideout-demo.tsx +15 -15
- package/registry/examples/expanded/steps-demo.tsx +29 -29
- package/registry/examples/expanded/tabs-demo.tsx +13 -13
- package/registry/examples/expanded/timeline-demo.tsx +18 -18
- package/registry/examples/field-demo.tsx +51 -51
- package/registry/examples/hover-card-demo.tsx +23 -23
- package/registry/examples/input-actions-demo.tsx +36 -36
- package/registry/examples/input-demo.tsx +87 -87
- package/registry/examples/input-group-demo.tsx +16 -16
- package/registry/examples/input-otp-demo.tsx +72 -72
- package/registry/examples/item-demo.tsx +46 -46
- package/registry/examples/kbd-demo.tsx +12 -12
- package/registry/examples/label-demo.tsx +20 -20
- package/registry/examples/menu-demo.tsx +122 -122
- package/registry/examples/menubar-demo.tsx +34 -34
- package/registry/examples/modal-demo.tsx +74 -74
- package/registry/examples/native-select-demo.tsx +16 -16
- package/registry/examples/navigation-menu-demo.tsx +29 -29
- package/registry/examples/pagination-demo.tsx +20 -20
- package/registry/examples/popover-demo.tsx +547 -547
- package/registry/examples/progress-demo.tsx +37 -37
- package/registry/examples/progress-slider-demo.tsx +29 -29
- package/registry/examples/radio-card-demo.tsx +51 -51
- package/registry/examples/radio-group-demo.tsx +62 -62
- package/registry/examples/resizable-demo.tsx +22 -22
- package/registry/examples/results-toolbar-demo.tsx +44 -44
- package/registry/examples/scroll-area-demo.tsx +15 -15
- package/registry/examples/segmented-control-demo.tsx +39 -39
- package/registry/examples/select-demo.tsx +87 -87
- package/registry/examples/sheet-demo.tsx +47 -47
- package/registry/examples/sidebar-demo.tsx +101 -101
- package/registry/examples/slider-demo.tsx +31 -31
- package/registry/examples/social-button-demo.tsx +61 -61
- package/registry/examples/spinner-demo.tsx +59 -59
- package/registry/examples/tabs-demo.tsx +13 -13
- package/registry/examples/tag-demo.tsx +29 -29
- package/registry/examples/textarea-demo.tsx +79 -79
- package/registry/examples/toast-demo.tsx +35 -35
- package/registry/examples/toggle-demo.tsx +59 -59
- package/registry/examples/tooltip-demo.tsx +115 -115
- package/registry/guidance/USAGE.md +27 -27
- package/registry/hooks/use-direction.ts +207 -207
- package/registry/index.json +387 -17
- package/registry/styles/globals.css +46 -0
- package/registry.json +24 -2
- package/schema/config.schema.json +51 -51
- package/schema/registry.schema.json +194 -194
- package/schema/tokens.schema.json +167 -167
- package/src/cli/command-line.js +194 -194
- package/src/cli/config-editors.js +9 -9
- package/src/cli/doctor.js +399 -399
- package/src/cli/file-transaction.js +302 -302
- package/src/cli/global-css.js +153 -153
- package/src/cli/index.js +1002 -1002
- package/src/cli/install-plan.js +592 -592
- package/src/cli/install-receipt.js +171 -171
- package/src/cli/jsonc.js +203 -203
- package/src/cli/package-install-state.js +254 -254
- package/src/cli/package-manager.js +238 -238
- package/src/cli/package-plan.js +185 -185
- package/src/cli/package-version.js +97 -97
- package/src/cli/registry-query.js +207 -207
- package/src/cli/reporting.js +55 -55
- package/src/cli/schema-validation.js +19 -19
- package/src/cli/source-scanner.js +686 -686
- package/src/cli/vite-config.js +478 -478
- package/tokens/banhaten.tokens.json +184 -0
|
@@ -1,100 +1,103 @@
|
|
|
1
|
-
# Alert
|
|
2
|
-
|
|
3
|
-
`Alert` presents contextual feedback with compact and expandable layouts.
|
|
4
|
-
|
|
5
|
-
Figma reference: `Design system 3.0 Copy / Alert`, node `158:4645`.
|
|
6
|
-
|
|
7
|
-
## Variants
|
|
8
|
-
|
|
9
|
-
The implementation covers the Alert matrix from Figma:
|
|
10
|
-
|
|
11
|
-
| Prop | Values |
|
|
12
|
-
| --- | --- |
|
|
13
|
-
| `status` | `danger`, `success`, `warning`, `info`, `neutral` |
|
|
14
|
-
| `isExpandable` | `false`, `true` |
|
|
15
|
-
| `
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
<Alert
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
|
32
|
-
|
|
|
33
|
-
| `
|
|
34
|
-
| `
|
|
35
|
-
| `
|
|
36
|
-
| `
|
|
37
|
-
| `
|
|
38
|
-
| `
|
|
39
|
-
| `
|
|
40
|
-
| `
|
|
41
|
-
| `
|
|
42
|
-
| `
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
- Compact
|
|
50
|
-
-
|
|
51
|
-
-
|
|
52
|
-
-
|
|
53
|
-
-
|
|
54
|
-
-
|
|
55
|
-
- Expanded
|
|
56
|
-
-
|
|
57
|
-
-
|
|
58
|
-
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
-
|
|
68
|
-
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
-
|
|
76
|
-
-
|
|
77
|
-
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
- `
|
|
97
|
-
|
|
1
|
+
# Alert
|
|
2
|
+
|
|
3
|
+
`Alert` presents contextual feedback with compact and expandable layouts.
|
|
4
|
+
|
|
5
|
+
Figma reference: `Design system 3.0 Copy / Alert`, node `158:4645`.
|
|
6
|
+
|
|
7
|
+
## Variants
|
|
8
|
+
|
|
9
|
+
The implementation covers the Alert matrix from Figma:
|
|
10
|
+
|
|
11
|
+
| Prop | Values |
|
|
12
|
+
| --- | --- |
|
|
13
|
+
| `status` | `danger`, `success`, `warning`, `info`, `neutral` |
|
|
14
|
+
| `isExpandable` | `false`, `true` |
|
|
15
|
+
| `descriptionColor` | `status`, `default` |
|
|
16
|
+
| `dir` | `ltr`, `rtl` |
|
|
17
|
+
|
|
18
|
+
## API
|
|
19
|
+
|
|
20
|
+
```tsx
|
|
21
|
+
<Alert status="danger" title="Unable to save" />
|
|
22
|
+
<Alert
|
|
23
|
+
actions={[{ label: "عرض التفاصيل", onClick: openDetails }]}
|
|
24
|
+
status="success"
|
|
25
|
+
isExpandable
|
|
26
|
+
dir="rtl"
|
|
27
|
+
title="تم الحفظ"
|
|
28
|
+
/>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
| Prop | Default |
|
|
32
|
+
| --- | --- |
|
|
33
|
+
| `status` | `neutral` |
|
|
34
|
+
| `isExpandable` | `false`; expands when there is a description or a visible action |
|
|
35
|
+
| `dir` | inherited |
|
|
36
|
+
| `title` | none |
|
|
37
|
+
| `description` | none |
|
|
38
|
+
| `descriptionColor` | `status`: the description in the status colour; `default` sets it in `content/default`, as the ATS360 frames do |
|
|
39
|
+
| `icon` | the status icon; pass a node to replace it |
|
|
40
|
+
| `messages` | English close-button message; accepts partial localized overrides |
|
|
41
|
+
| `closeLabel` | overrides `messages.close` |
|
|
42
|
+
| `actions` | none |
|
|
43
|
+
| `showActions` | auto when actions exist |
|
|
44
|
+
| `showCloseButton` | auto when `onClose` exists |
|
|
45
|
+
| `onClose` | none |
|
|
46
|
+
|
|
47
|
+
## Pixel Rules
|
|
48
|
+
|
|
49
|
+
- Compact alerts are `470px` wide and `56px` tall with `16px` padding.
|
|
50
|
+
- Expandable alerts are `500px` wide, content-sized, and use `20px 16px` padding.
|
|
51
|
+
- `isExpandable` falls back to the compact layout when there is no description and no visible action. A description without actions matches the library Alert with Actions Links turned off.
|
|
52
|
+
- Compact rows use `8px` radius; expandable rows use `10px` radius.
|
|
53
|
+
- Status glyphs are `18px` in `20px` slots; close controls are `20px` with a `16px` close glyph.
|
|
54
|
+
- Compact content uses `8px` between icon and title.
|
|
55
|
+
- Expanded titles align to the block-start edge of the status icon.
|
|
56
|
+
- Expandable content uses `12px` between icon, copy, close, and action rows.
|
|
57
|
+
- The description-to-actions gap remains exactly `12px` as copy wraps.
|
|
58
|
+
- Expanded action rows retain `20px` of block-end padding.
|
|
59
|
+
- Expanded height grows with title and description content; direction does not select a height.
|
|
60
|
+
- Titles use `15px / 24px` medium text.
|
|
61
|
+
- Descriptions use `14px / 20px` regular text in the status colour (`content/{status}/default`, as in the library), or `content/default` with `descriptionColor="default"`. Titles use the strong status colour.
|
|
62
|
+
|
|
63
|
+
## Token Contract
|
|
64
|
+
|
|
65
|
+
The component consumes Banhaten semantic tokens and component aliases. Do not hard-code Figma fallback literals in component source; promote any Figma value into its owned `tokens/source/` fragment as a `--bh-*` token or alias first.
|
|
66
|
+
|
|
67
|
+
- Backgrounds: `--bh-bg-danger-subtle`, `--bh-bg-success-subtle`, `--bh-bg-warning-subtle`, `--bh-bg-info-subtle`, `--bh-bg-neutral-subtle`
|
|
68
|
+
- Borders: `--bh-border-danger-subtle`, `--bh-border-success-subtle`, `--bh-border-warning-subtle`, `--bh-border-info-subtle`, `--bh-border-subtle`, `--bh-border-default`
|
|
69
|
+
- Content: `--bh-content-danger-strong`, `--bh-content-success-strong`, `--bh-content-warning-strong`, `--bh-content-brand-strong` for titles; `--bh-content-danger-default`, `--bh-content-success-default`, `--bh-content-warning-default`, `--bh-content-brand-default` for descriptions and icons; `--bh-content-default`
|
|
70
|
+
- Shape: `--bh-radius-lg-8`, `--bh-radius-xl-10`, `--bh-radius-full`
|
|
71
|
+
- Space: `--bh-space-md-8`, `--bh-space-xl-12`, `--bh-space-3xl-16`, `--bh-space-4xl-20`
|
|
72
|
+
|
|
73
|
+
## Accessibility
|
|
74
|
+
|
|
75
|
+
- The close affordance is a real button.
|
|
76
|
+
- Action links are rendered as real buttons to support product actions.
|
|
77
|
+
- Warning and danger use `role="alert"`; other statuses use `role="status"` unless overridden.
|
|
78
|
+
- `dir` inherits by default and controls visual and reading direction only.
|
|
79
|
+
- The close button keeps its English default under RTL. Pass `closeLabel` or `messages` for localized accessibility copy.
|
|
80
|
+
- Product copy and action behavior are always explicit; the component does not ship demo text or no-op controls.
|
|
81
|
+
|
|
82
|
+
## Install
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
npx banhaten add alert
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Examples
|
|
89
|
+
|
|
90
|
+
Primary registry example: `examples/alert-demo.tsx`.
|
|
91
|
+
|
|
92
|
+
Open the live component page or run `npx banhaten docs alert` to inspect source files, install command, and examples.
|
|
93
|
+
|
|
94
|
+
## RTL Rules
|
|
95
|
+
|
|
96
|
+
- `inheritsDirection`: true
|
|
97
|
+
- `messages`: Direction does not select the close-button language. Pass closeLabel or messages explicitly.
|
|
98
|
+
- `textAlignment`: Uses dir="auto" on title and description while the root dir prop mirrors icon, action, and close placement.
|
|
99
|
+
- `spacing`: Uses flexbox, gap, and logical direction so compact and expandable RTL layouts match the Figma matrix.
|
|
100
|
+
|
|
98
101
|
<!-- registry-contract:start -->
|
|
99
102
|
## Registry Contract
|
|
100
103
|
|
|
@@ -106,6 +109,9 @@ This table is generated from `registry/index.json`; edit the component-owned sou
|
|
|
106
109
|
| `supportedExports` | `components/alert.tsx: Alert, alertVariants, arabicAlertMessages` |
|
|
107
110
|
| `parts` | `Alert` |
|
|
108
111
|
| `registryDependencies` | `button` |
|
|
112
|
+
| `props.Alert.descriptionColor` | `"status" \| "default"; default "status"; status sets the description in the status colour, as in the library; default sets it in content/default, as the ATS360 frames do.` |
|
|
113
|
+
| `props.Alert.icon` | `ReactNode; default null; Replaces the status icon in its 20px slot.` |
|
|
114
|
+
| `props.Alert.isExpandable` | `boolean; default false; Uses the expanded layout when the alert has a description or a visible action; otherwise it stays compact.` |
|
|
109
115
|
| `tokens` | `--bh-alert-compact-height`, `--bh-alert-compact-padding`, `--bh-alert-compact-radius`, `--bh-alert-compact-width`, `--bh-alert-expanded-padding-x`, `--bh-alert-expanded-padding-y`, `--bh-alert-expanded-radius`, `--bh-alert-expanded-width`, `--bh-alert-icon-size`, `--bh-alert-icon-slot-size`, `--bh-bg-danger-subtle`, `--bh-bg-info-subtle`, `--bh-bg-neutral-subtle`, `--bh-bg-success-subtle`, `--bh-bg-warning-subtle`, `--bh-border-danger-subtle`, `--bh-border-default`, `--bh-border-info-subtle`, `--bh-border-subtle`, `--bh-border-success-subtle`, `--bh-border-warning-subtle`, `--bh-border-width-default`, `--bh-content-brand-default`, `--bh-content-brand-strong`, `--bh-content-danger-default`, `--bh-content-danger-strong`, `--bh-content-default`, `--bh-content-subtle`, `--bh-content-success-default`, `--bh-content-success-strong`, `--bh-content-warning-default`, `--bh-content-warning-strong`, `--bh-font-family`, `--bh-font-weight-medium`, `--bh-font-weight-regular`, `--bh-icon-stroke-225`, `--bh-radius-full`, `--bh-space-3xl-16`, `--bh-space-md-8`, `--bh-space-xl-12`, `--bh-space-xs-4`, `--bh-space-xxs-2`, `--bh-text-base-letter-spacing`, `--bh-text-body-md-medium-font-size`, `--bh-text-body-md-medium-letter-spacing`, `--bh-text-body-md-medium-line-height`, `--bh-text-body-md-underline-font-size`, `--bh-text-body-md-underline-font-weight`, `--bh-text-body-md-underline-letter-spacing`, `--bh-text-body-md-underline-line-height`, `--bh-text-body-sm-regular-font-size`, `--bh-text-body-sm-regular-letter-spacing`, `--bh-text-body-sm-regular-line-height` |
|
|
110
116
|
| `variants` | `danger`, `success`, `warning`, `info`, `neutral` |
|
|
111
117
|
<!-- registry-contract:end -->
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# App Header
|
|
2
|
+
|
|
3
|
+
App Header is the workspace bar above page content in a sidebar shell. It holds the reader's location at the start and workspace tools such as search, notifications, help, or language at the end.
|
|
4
|
+
|
|
5
|
+
Use Page Header inside the page for the page title, description, and page actions. Use Toolbar for controls that act on a selection or a document.
|
|
6
|
+
|
|
7
|
+
## API
|
|
8
|
+
|
|
9
|
+
Put Breadcrumbs or a short location label in `AppHeaderStart`, and search and actions in `AppHeaderEnd`. Give the nested Input and every icon-only action an accessible name.
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
<AppHeader>
|
|
13
|
+
<AppHeaderStart>
|
|
14
|
+
<Breadcrumbs
|
|
15
|
+
aria-label="Breadcrumb"
|
|
16
|
+
items={[{ label: "Recruiting", href: "#overview" }, { label: "Overview" }]}
|
|
17
|
+
size="sm"
|
|
18
|
+
/>
|
|
19
|
+
</AppHeaderStart>
|
|
20
|
+
<AppHeaderEnd>
|
|
21
|
+
<AppHeaderSearch onSubmit={search}>
|
|
22
|
+
<Input
|
|
23
|
+
aria-label="Search workspace"
|
|
24
|
+
hasHelperText={false}
|
|
25
|
+
hasLabel={false}
|
|
26
|
+
placeholder="Search workspace"
|
|
27
|
+
type="search"
|
|
28
|
+
/>
|
|
29
|
+
</AppHeaderSearch>
|
|
30
|
+
<AppHeaderAction aria-label="Notifications" icon={<BellIcon />} />
|
|
31
|
+
<AppHeaderAction aria-label="EN, switch language to Arabic" size="sm">
|
|
32
|
+
EN
|
|
33
|
+
</AppHeaderAction>
|
|
34
|
+
</AppHeaderEnd>
|
|
35
|
+
</AppHeader>
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
The bar is 72px tall with 24px inline padding, a 24px gap between items, and a subtle bottom border inside that height. `AppHeaderStart` fills the free space, so the end group stays on the content edge. When space runs short, the start keeps at least 160px and the search narrows first. The bar does not wrap, so on phone widths hide the search or render a compact mobile bar.
|
|
39
|
+
|
|
40
|
+
`AppHeaderAction` is flush: at rest it takes only the space of its icon or label, so it lines up with the design. Padding and a matching negative margin give it a 40px pointer target and hover surface without moving it.
|
|
41
|
+
|
|
42
|
+
- Icon-only: pass `icon` and `aria-label`. The icon is 24px.
|
|
43
|
+
- `size="md"`, the default: a text action in body-md medium.
|
|
44
|
+
- `size="sm"`: a quieter text action in body-sm medium subtle content. It reserves 32px and aligns its label to the end edge, so a language code can change without moving the controls before it.
|
|
45
|
+
- `asChild`: renders the action styles on a link.
|
|
46
|
+
|
|
47
|
+
`AppHeaderSearch` is a form with the search landmark role. It sets the nested Input to the 320px search width.
|
|
48
|
+
|
|
49
|
+
Breadcrumbs inside App Header show their current item in the same subtle color as the rest of the trail. Use `size="sm"` so the trail matches the 14/20 location text.
|
|
50
|
+
|
|
51
|
+
## Install
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
npx banhaten add app-header
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Add Breadcrumbs and Input separately when the header uses them.
|
|
58
|
+
|
|
59
|
+
## Examples
|
|
60
|
+
|
|
61
|
+
Primary registry example: `examples/app-header-demo.tsx`.
|
|
62
|
+
|
|
63
|
+
## Token Contract
|
|
64
|
+
|
|
65
|
+
App Header owns `--bh-app-header-*` tokens for its height, inline padding, gaps, start minimum width, background, border, location color, search width, icon size, and action content, hover, radius, and pointer-target inset. It sets `--bh-breadcrumbs-current-content` to the location color and `--bh-input-width` to fill the search landmark. Do not replace these values with local literals.
|
|
66
|
+
|
|
67
|
+
Covered source file: `components/app-header.tsx`.
|
|
68
|
+
|
|
69
|
+
## RTL Rules
|
|
70
|
+
|
|
71
|
+
- The header inherits document direction.
|
|
72
|
+
- Start and End regions, inline padding, and the reserved end-aligned width of small text actions use logical layout and mirror without alternate markup.
|
|
73
|
+
- Breadcrumb separators and labels follow the Breadcrumbs RTL contract.
|
|
74
|
+
|
|
75
|
+
## Accessibility
|
|
76
|
+
|
|
77
|
+
The root is a `header` element. `AppHeaderSearch` is a search landmark and needs a labeled Input. Icon-only actions require `aria-label`. When a text action has an `aria-label`, start it with the visible label, such as “EN, switch language to Arabic”. Actions keep a 40px pointer target and a visible focus ring.
|
|
78
|
+
|
|
79
|
+
<!-- registry-contract:start -->
|
|
80
|
+
## Registry Contract
|
|
81
|
+
|
|
82
|
+
This table is generated from `registry/index.json`; edit the component-owned source under `registry/catalog/components/`, not this table or the compiled index.
|
|
83
|
+
`supportedExports` is the exhaustive runtime import contract grouped by source module. `parts` is an ordered, non-exhaustive anatomy list.
|
|
84
|
+
|
|
85
|
+
| Field | Values |
|
|
86
|
+
| --- | --- |
|
|
87
|
+
| `supportedExports` | `components/app-header.tsx: AppHeader, AppHeaderAction, AppHeaderEnd, AppHeaderSearch, AppHeaderStart` |
|
|
88
|
+
| `parts` | `AppHeader`, `AppHeaderStart`, `AppHeaderEnd`, `AppHeaderSearch`, `AppHeaderAction` |
|
|
89
|
+
| `registryDependencies` | None |
|
|
90
|
+
| `props.AppHeaderAction.icon` | `ReactNode; default null; Icon content. Without children the action is icon-only and needs aria-label; the icon occupies 24px and the pointer target is 40px.` |
|
|
91
|
+
| `props.AppHeaderAction.size` | `"sm" \| "md"; default "md"; md uses body-md medium default content. sm uses body-sm medium subtle content and reserves 32px at the end edge, so a short label such as a language code can change without moving earlier controls.` |
|
|
92
|
+
| `props.AppHeaderAction.asChild` | `boolean; default false; Renders the action styles on the child element, such as a link.` |
|
|
93
|
+
| `props.AppHeaderSearch.role` | `string; default "search"; Search landmark role on the wrapping form. Nest an Input with an accessible name; the header sets its width to the 320px search token.` |
|
|
94
|
+
| `features` | `72px bar with 24px inline padding, a 24px item gap, and a subtle bottom border`, `flexible start region for Breadcrumbs or a location label in body-sm medium subtle content`, `Breadcrumbs inside the header render their current item in the location color`, `search landmark that sizes a nested Input to 320px`, `flush icon actions with a 24px footprint and a 40px target`, `flush text actions in md and sm sizes`, `logical layout that mirrors in RTL` |
|
|
95
|
+
| `sizes` | `md`, `sm` |
|
|
96
|
+
| `tokens` | `--bh-app-header-action-bg-hover`, `--bh-app-header-action-content`, `--bh-app-header-action-hit-inset`, `--bh-app-header-action-radius`, `--bh-app-header-action-sm-content`, `--bh-app-header-action-sm-min-width`, `--bh-app-header-bg`, `--bh-app-header-border`, `--bh-app-header-gap`, `--bh-app-header-height`, `--bh-app-header-icon-size`, `--bh-app-header-location-content`, `--bh-app-header-padding-x`, `--bh-app-header-search-width`, `--bh-app-header-start-gap`, `--bh-app-header-start-min-width`, `--bh-border-width-default`, `--bh-breadcrumbs-current-content`, `--bh-content-default`, `--bh-content-disabled`, `--bh-input-width`, `--bh-space-xs-4`, `--bh-text-body-md-medium-font-size`, `--bh-text-body-md-medium-font-weight`, `--bh-text-body-md-medium-letter-spacing`, `--bh-text-body-md-medium-line-height`, `--bh-text-body-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`, `--elevation-button-focus` |
|
|
97
|
+
<!-- registry-contract:end -->
|
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
# Aspect Ratio
|
|
2
|
-
|
|
3
|
-
Aspect Ratio wraps Radix AspectRatio for fixed-format media, screenshots, and preview surfaces.
|
|
4
|
-
|
|
5
|
-
## API
|
|
6
|
-
|
|
7
|
-
```tsx
|
|
8
|
-
<AspectRatio ratio={16 / 9}>
|
|
9
|
-
<img src="/preview.png" alt="Preview" />
|
|
10
|
-
</AspectRatio>
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
| Prop | Values |
|
|
14
|
-
| --- | --- |
|
|
15
|
-
| `ratio` | any positive number |
|
|
16
|
-
|
|
17
|
-
## Token Contract
|
|
18
|
-
|
|
19
|
-
Aspect Ratio uses Banhaten neutral background and radius tokens by default.
|
|
20
|
-
|
|
21
|
-
## RTL
|
|
22
|
-
|
|
23
|
-
Aspect Ratio is direction-neutral.
|
|
24
|
-
|
|
25
|
-
## Accessibility
|
|
26
|
-
|
|
27
|
-
Provide accessible names for media rendered inside the ratio box.
|
|
28
|
-
|
|
29
|
-
## Install
|
|
30
|
-
|
|
31
|
-
```bash
|
|
32
|
-
npx banhaten add aspect-ratio
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
## Examples
|
|
36
|
-
|
|
37
|
-
Primary registry example: `examples/aspect-ratio-demo.tsx`.
|
|
38
|
-
|
|
39
|
-
Open the live component page or run `npx banhaten docs aspect-ratio` to inspect source files, install command, and examples.
|
|
40
|
-
|
|
41
|
-
## RTL Rules
|
|
42
|
-
|
|
43
|
-
- `inheritsDirection`: false
|
|
44
|
-
- `geometry`: Aspect Ratio controls media geometry and does not alter text direction.
|
|
45
|
-
|
|
1
|
+
# Aspect Ratio
|
|
2
|
+
|
|
3
|
+
Aspect Ratio wraps Radix AspectRatio for fixed-format media, screenshots, and preview surfaces.
|
|
4
|
+
|
|
5
|
+
## API
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
<AspectRatio ratio={16 / 9}>
|
|
9
|
+
<img src="/preview.png" alt="Preview" />
|
|
10
|
+
</AspectRatio>
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
| Prop | Values |
|
|
14
|
+
| --- | --- |
|
|
15
|
+
| `ratio` | any positive number |
|
|
16
|
+
|
|
17
|
+
## Token Contract
|
|
18
|
+
|
|
19
|
+
Aspect Ratio uses Banhaten neutral background and radius tokens by default.
|
|
20
|
+
|
|
21
|
+
## RTL
|
|
22
|
+
|
|
23
|
+
Aspect Ratio is direction-neutral.
|
|
24
|
+
|
|
25
|
+
## Accessibility
|
|
26
|
+
|
|
27
|
+
Provide accessible names for media rendered inside the ratio box.
|
|
28
|
+
|
|
29
|
+
## Install
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npx banhaten add aspect-ratio
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Examples
|
|
36
|
+
|
|
37
|
+
Primary registry example: `examples/aspect-ratio-demo.tsx`.
|
|
38
|
+
|
|
39
|
+
Open the live component page or run `npx banhaten docs aspect-ratio` to inspect source files, install command, and examples.
|
|
40
|
+
|
|
41
|
+
## RTL Rules
|
|
42
|
+
|
|
43
|
+
- `inheritsDirection`: false
|
|
44
|
+
- `geometry`: Aspect Ratio controls media geometry and does not alter text direction.
|
|
45
|
+
|
|
46
46
|
<!-- registry-contract:start -->
|
|
47
47
|
## Registry Contract
|
|
48
48
|
|
|
@@ -1,91 +1,102 @@
|
|
|
1
|
-
# Attribute
|
|
2
|
-
|
|
3
|
-
Attribute is a semantic description-list component for key-value information. It supports card headers, inline rows, right-aligned values, stacked mobile rows, two-column summaries, row dividers, bordered row groups, compact density, and RTL direction.
|
|
4
|
-
|
|
5
|
-
The implementation follows the Figma component at `Design system 3.0 Copy / Attribute Card` (`255:123238`) and uses only existing Banhaten tokens.
|
|
6
|
-
|
|
7
|
-
## API
|
|
8
|
-
|
|
9
|
-
Use `AttributeCard` for the surface, `AttributeHeader` for optional title and description content, `AttributeList` for the `dl`, and `AttributeItem` for each `dt`/`dd` pair.
|
|
10
|
-
|
|
11
|
-
```tsx
|
|
12
|
-
<AttributeCard>
|
|
13
|
-
<AttributeHeader
|
|
14
|
-
title="Company profile"
|
|
15
|
-
description="Key-value information in a scannable card."
|
|
16
|
-
/>
|
|
17
|
-
<AttributeList>
|
|
18
|
-
<AttributeItem label="Name">Acme Corporation</AttributeItem>
|
|
19
|
-
<AttributeItem label="Type">Business</AttributeItem>
|
|
20
|
-
<AttributeItem label="Industry">Software</AttributeItem>
|
|
21
|
-
</AttributeList>
|
|
22
|
-
</AttributeCard>
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## Variants
|
|
26
|
-
|
|
27
|
-
| Prop | Values |
|
|
28
|
-
| --- | --- |
|
|
29
|
-
| `AttributeCard padding` | `default`, `compact` |
|
|
30
|
-
| `AttributeList layout` | `inline`, `end`, `stacked`, `two-column` |
|
|
31
|
-
| `AttributeList density` | `compact`, `default`, `comfortable` |
|
|
32
|
-
| `AttributeList dividers` | `boolean` |
|
|
33
|
-
| `AttributeList bordered` | `boolean` |
|
|
34
|
-
| `AttributeList labelWidth` | CSS length, default `220px` |
|
|
35
|
-
| `AttributeItem fullSpan` | `boolean`, useful in `two-column` layouts |
|
|
36
|
-
| `AttributeItem truncate` | `boolean` |
|
|
37
|
-
|
|
38
|
-
##
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
```tsx
|
|
43
|
-
<AttributeList
|
|
44
|
-
<AttributeItem label="
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
1
|
+
# Attribute
|
|
2
|
+
|
|
3
|
+
Attribute is a semantic description-list component for key-value information. It supports card headers, inline rows, right-aligned values, stacked mobile rows, two-column summaries, row dividers, bordered row groups, compact density, and RTL direction.
|
|
4
|
+
|
|
5
|
+
The implementation follows the Figma component at `Design system 3.0 Copy / Attribute Card` (`255:123238`) and uses only existing Banhaten tokens.
|
|
6
|
+
|
|
7
|
+
## API
|
|
8
|
+
|
|
9
|
+
Use `AttributeCard` for the surface, `AttributeHeader` for optional title and description content, `AttributeList` for the `dl`, and `AttributeItem` for each `dt`/`dd` pair.
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
<AttributeCard>
|
|
13
|
+
<AttributeHeader
|
|
14
|
+
title="Company profile"
|
|
15
|
+
description="Key-value information in a scannable card."
|
|
16
|
+
/>
|
|
17
|
+
<AttributeList>
|
|
18
|
+
<AttributeItem label="Name">Acme Corporation</AttributeItem>
|
|
19
|
+
<AttributeItem label="Type">Business</AttributeItem>
|
|
20
|
+
<AttributeItem label="Industry">Software</AttributeItem>
|
|
21
|
+
</AttributeList>
|
|
22
|
+
</AttributeCard>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Variants
|
|
26
|
+
|
|
27
|
+
| Prop | Values |
|
|
28
|
+
| --- | --- |
|
|
29
|
+
| `AttributeCard padding` | `default`, `compact` |
|
|
30
|
+
| `AttributeList layout` | `inline`, `end`, `stacked`, `two-column` |
|
|
31
|
+
| `AttributeList density` | `compact`, `default`, `comfortable` |
|
|
32
|
+
| `AttributeList dividers` | `boolean` |
|
|
33
|
+
| `AttributeList bordered` | `boolean` |
|
|
34
|
+
| `AttributeList labelWidth` | CSS length, default `220px` (`176px` at comfortable density) |
|
|
35
|
+
| `AttributeItem fullSpan` | `boolean`, useful in `two-column` layouts |
|
|
36
|
+
| `AttributeItem truncate` | `boolean` |
|
|
37
|
+
|
|
38
|
+
## Comfortable density
|
|
39
|
+
|
|
40
|
+
`density="comfortable"` is the label/value row of a detail card inside an app shell. Rows have no block padding and sit `16px` apart, so the list follows its card's own gap. The label is body-sm (`14px / 20px`) in content/subtle, in a `176px` column (`--bh-attribute-comfortable-label-width`), and the value is body-md medium, `16px` after it. Label and value align to the top of the row.
|
|
41
|
+
|
|
42
|
+
```tsx
|
|
43
|
+
<AttributeList density="comfortable">
|
|
44
|
+
<AttributeItem label="Requester">Mohamed Ali</AttributeItem>
|
|
45
|
+
<AttributeItem label="Start date">1 December 2026</AttributeItem>
|
|
46
|
+
</AttributeList>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Composition
|
|
50
|
+
|
|
51
|
+
Values are open React slots. Compose existing primitives for status badges, copy buttons, file rows, progress bars, skeleton bars, links, and custom details.
|
|
52
|
+
|
|
53
|
+
```tsx
|
|
54
|
+
<AttributeList layout="end" dividers>
|
|
55
|
+
<AttributeItem label="Subscription">
|
|
56
|
+
<Badge color="green" type="dot">Active</Badge>
|
|
57
|
+
</AttributeItem>
|
|
58
|
+
<AttributeItem label="API key" truncate>
|
|
59
|
+
sk_live_************1234
|
|
60
|
+
<Button aria-label="Copy API key" size="icon-xs" variant="outline">
|
|
61
|
+
<CopyIcon />
|
|
62
|
+
</Button>
|
|
63
|
+
</AttributeItem>
|
|
64
|
+
</AttributeList>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## RTL
|
|
68
|
+
|
|
69
|
+
Attribute inherits direction from any parent. The component uses logical text alignment and `dir="auto"` wrappers for string labels and values, so Arabic and English content can sit in the same card without manual left/right classes.
|
|
70
|
+
|
|
71
|
+
## Install
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
npx banhaten add attribute
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Examples
|
|
78
|
+
|
|
79
|
+
Primary registry example: `examples/attribute-demo.tsx`.
|
|
80
|
+
|
|
81
|
+
Open the live component page or run `npx banhaten docs attribute` to inspect source files, install command, and examples.
|
|
82
|
+
|
|
83
|
+
## Token Contract
|
|
84
|
+
|
|
85
|
+
Component styles must resolve through Banhaten semantic tokens, component aliases, or documented exception-ledger values.
|
|
86
|
+
Do not add raw colors, pixel values, opacity utilities, z-index values, durations, or shadow literals directly to component source.
|
|
87
|
+
Covered source files: `components/attribute.tsx`.
|
|
88
|
+
|
|
89
|
+
## RTL Rules
|
|
90
|
+
|
|
91
|
+
- `inheritsDirection`: true
|
|
92
|
+
- `layout`: Uses logical text alignment and inherited direction so label and value columns mirror naturally.
|
|
93
|
+
- `textDirection`: String labels and values use dir="auto" wrappers while custom slots can control their own direction.
|
|
94
|
+
- `composition`: Rows accept ReactNode values, so badges, buttons, links, progress bars, skeletons, files, and custom content can be composed from existing Banhaten primitives.
|
|
95
|
+
|
|
96
|
+
## Accessibility
|
|
97
|
+
|
|
98
|
+
Keep native semantics, accessible names, keyboard reachability, focus-visible treatment, and status/error announcements intact when composing this component.
|
|
99
|
+
|
|
89
100
|
<!-- registry-contract:start -->
|
|
90
101
|
## Registry Contract
|
|
91
102
|
|
|
@@ -97,7 +108,8 @@ This table is generated from `registry/index.json`; edit the component-owned sou
|
|
|
97
108
|
| `supportedExports` | `components/attribute.tsx: AttributeCard, AttributeHeader, AttributeItem, AttributeLabel, AttributeList, AttributeValue, attributeCardVariants, attributeHeaderVariants, attributeItemVariants, attributeLabelVariants, attributeListVariants, attributeValueVariants` |
|
|
98
109
|
| `parts` | `AttributeCard`, `AttributeHeader`, `AttributeList`, `AttributeItem`, `AttributeLabel`, `AttributeValue` |
|
|
99
110
|
| `registryDependencies` | None |
|
|
111
|
+
| `props.AttributeList.density` | `"compact" \| "default" \| "comfortable"; default "default"; compact and default set the row padding (8px, 16px). comfortable is the app-shell detail row: no row padding, rows 16px apart, a 14/20 label in a 176px column and 16px before the value.` |
|
|
100
112
|
| `densities` | `compact`, `default`, `comfortable` |
|
|
101
113
|
| `layouts` | `inline`, `end`, `stacked`, `two-column` |
|
|
102
|
-
| `tokens` | `--bh-attribute-header-icon-size`, `--bh-attribute-header-icon-size-lg`, `--bh-attribute-label-width`, `--bh-bg-default`, `--bh-bg-neutral-soft`, `--bh-border-subtle`, `--bh-content-default`, `--bh-content-subtle`, `--bh-icon-size-default`, `--bh-icon-slot-size-default`, `--bh-radius-2xl-12`, `--bh-radius-full`, `--bh-radius-lg-8`, `--bh-space-3xl-16`, `--bh-space-4xl-20`, `--bh-space-5xl-24`, `--bh-space-6xl-32`, `--bh-space-md-8`, `--bh-space-sm-6`, `--bh-space-xl-12`, `--bh-space-xs-4`, `--bh-text-body-md-medium-font-size`, `--bh-text-body-md-medium-font-weight`, `--bh-text-body-md-medium-letter-spacing`, `--bh-text-body-md-medium-line-height`, `--bh-text-body-md-regular-font-size`, `--bh-text-body-md-regular-font-weight`, `--bh-text-body-md-regular-letter-spacing`, `--bh-text-body-md-regular-line-height`, `--bh-text-heading-sm-medium-font-size`, `--bh-text-heading-sm-medium-font-weight`, `--bh-text-heading-sm-medium-letter-spacing`, `--bh-text-heading-sm-medium-line-height` |
|
|
114
|
+
| `tokens` | `--bh-attribute-comfortable-label-width`, `--bh-attribute-header-icon-size`, `--bh-attribute-header-icon-size-lg`, `--bh-attribute-label-width`, `--bh-bg-default`, `--bh-bg-neutral-soft`, `--bh-border-subtle`, `--bh-content-default`, `--bh-content-subtle`, `--bh-icon-size-default`, `--bh-icon-slot-size-default`, `--bh-radius-2xl-12`, `--bh-radius-full`, `--bh-radius-lg-8`, `--bh-space-3xl-16`, `--bh-space-4xl-20`, `--bh-space-5xl-24`, `--bh-space-6xl-32`, `--bh-space-md-8`, `--bh-space-none`, `--bh-space-sm-6`, `--bh-space-xl-12`, `--bh-space-xs-4`, `--bh-text-body-md-medium-font-size`, `--bh-text-body-md-medium-font-weight`, `--bh-text-body-md-medium-letter-spacing`, `--bh-text-body-md-medium-line-height`, `--bh-text-body-md-regular-font-size`, `--bh-text-body-md-regular-font-weight`, `--bh-text-body-md-regular-letter-spacing`, `--bh-text-body-md-regular-line-height`, `--bh-text-body-sm-regular-font-size`, `--bh-text-body-sm-regular-font-weight`, `--bh-text-body-sm-regular-letter-spacing`, `--bh-text-body-sm-regular-line-height`, `--bh-text-heading-sm-medium-font-size`, `--bh-text-heading-sm-medium-font-weight`, `--bh-text-heading-sm-medium-letter-spacing`, `--bh-text-heading-sm-medium-line-height` |
|
|
103
115
|
<!-- registry-contract:end -->
|