banhaten 0.1.0 → 0.1.2
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 +21 -9
- package/package.json +8 -2
- package/registry/components/accordion.tsx +37 -1
- package/registry/components/alert.tsx +14 -28
- package/registry/components/attribute.tsx +6 -10
- package/registry/components/autocomplete.tsx +637 -0
- package/registry/components/avatar.tsx +259 -24
- package/registry/components/badge.tsx +97 -35
- package/registry/components/button-group.tsx +1 -1
- package/registry/components/card.tsx +1 -1
- package/registry/components/checkbox.tsx +19 -16
- package/registry/components/date-picker-state.ts +253 -0
- package/registry/components/date-picker.tsx +115 -158
- package/registry/components/expanded/ActivityFeed.tsx +37 -23
- package/registry/components/expanded/Banner.tsx +54 -19
- package/registry/components/expanded/Breadcrumbs.tsx +10 -38
- package/registry/components/expanded/CatalogComponentsShowcase.tsx +11 -16
- package/registry/components/expanded/CatalogTag.tsx +4 -11
- package/registry/components/expanded/CommandBar.tsx +33 -53
- package/registry/components/expanded/EmptyState.tsx +155 -0
- package/registry/components/expanded/FileUpload.tsx +362 -59
- package/registry/components/expanded/OnboardingStepListItem.tsx +6 -10
- package/registry/components/expanded/PageHeader.tsx +2 -11
- package/registry/components/expanded/Slideout.tsx +12 -23
- package/registry/components/expanded/Steps.tsx +6 -8
- package/registry/components/expanded/Table.tsx +18 -40
- package/registry/components/expanded/Timeline.tsx +5 -24
- package/registry/components/expanded/activityFeed.css +10 -54
- package/registry/components/expanded/banner.css +8 -75
- package/registry/components/expanded/breadcrumbs.css +1 -1
- package/registry/components/expanded/commandBar.css +23 -26
- package/registry/components/expanded/divider.css +1 -1
- package/registry/components/expanded/emptyState.css +111 -0
- package/registry/components/expanded/fileUpload.css +304 -75
- package/registry/components/expanded/pageHeader.css +1 -1
- package/registry/components/expanded/slideout.css +1 -0
- package/registry/components/expanded/steps.css +15 -51
- package/registry/components/expanded/table.css +6 -1
- package/registry/components/expanded/timeline.css +18 -15
- package/registry/components/input-otp.tsx +574 -0
- package/registry/components/input.tsx +140 -59
- package/registry/components/menu.tsx +470 -80
- package/registry/components/pagination.tsx +6 -18
- package/registry/components/popover.tsx +840 -0
- package/registry/components/radio-card.tsx +25 -31
- package/registry/components/select-content.tsx +28 -123
- package/registry/components/select.tsx +13 -9
- package/registry/components/skeleton.css +57 -0
- package/registry/components/skeleton.tsx +482 -0
- package/registry/components/social-button.tsx +24 -90
- package/registry/components/spinner.tsx +91 -7
- package/registry/components/textarea.tsx +21 -36
- package/registry/components/toggle.tsx +7 -23
- package/registry/components/tooltip.tsx +8 -4
- package/registry/examples/attribute-demo.tsx +2 -2
- 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/checkbox-demo.tsx +3 -8
- package/registry/examples/date-picker-demo.tsx +75 -22
- package/registry/examples/expanded/banner-demo.tsx +31 -6
- package/registry/examples/expanded/breadcrumbs-demo.tsx +59 -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/file-upload-demo.tsx +60 -0
- package/registry/examples/expanded/steps-demo.tsx +11 -0
- package/registry/examples/expanded/table-demo.tsx +142 -0
- package/registry/examples/input-demo.tsx +1 -1
- package/registry/examples/input-otp-demo.tsx +72 -0
- package/registry/examples/menu-demo.tsx +101 -88
- package/registry/examples/popover-demo.tsx +546 -0
- package/registry/examples/progress-demo.tsx +2 -2
- package/registry/examples/select-demo.tsx +32 -18
- package/registry/examples/skeleton-demo.tsx +56 -0
- package/registry/examples/social-button-demo.tsx +33 -33
- package/registry/examples/spinner-demo.tsx +59 -0
- package/registry/examples/tag-demo.tsx +1 -1
- package/registry/examples/textarea-demo.tsx +1 -1
- package/registry/index.json +266 -20
- package/registry/styles/globals.css +93 -3
- package/src/cli/index.js +997 -62
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Banhaten design system is an Arabic and English-first React design system. It installs source components into a project, shadcn-style:
|
|
4
4
|
|
|
5
|
-
```
|
|
5
|
+
```text
|
|
6
6
|
npx banhaten init
|
|
7
7
|
npx banhaten add button
|
|
8
8
|
npx banhaten add button-group
|
|
@@ -16,8 +16,10 @@ npx banhaten add toolbar
|
|
|
16
16
|
npx banhaten add social-button
|
|
17
17
|
npx banhaten add input
|
|
18
18
|
npx banhaten add select
|
|
19
|
+
npx banhaten add autocomplete
|
|
19
20
|
npx banhaten add date-picker
|
|
20
21
|
npx banhaten add slider
|
|
22
|
+
npx banhaten add skeleton
|
|
21
23
|
npx banhaten add progress
|
|
22
24
|
npx banhaten add progress-slider
|
|
23
25
|
npx banhaten add textarea
|
|
@@ -53,11 +55,14 @@ The current scaffold includes:
|
|
|
53
55
|
- A Figma-matched `tag` registry item with simple, dot, flag, avatar, and icon types, default/active/disabled states, native hover/focus-visible styling, xs/md/lg sizes, optional close button, and RTL-safe composition.
|
|
54
56
|
- A Radix Switch-backed `toggle` registry item with sm/md geometry, active/disabled states, optional handle icons, labeled fields, supporting text, and RTL-safe label placement.
|
|
55
57
|
- A Figma-matched `textarea` registry item with label, helper text, error, default and tags modes, placeholder, filled, disabled, and RTL states.
|
|
56
|
-
- A Radix Select-backed, Figma-matched `select` registry item with default and soft triggers, error/filled/disabled states, menu surface, checkbox and check selection, and item media for text,
|
|
58
|
+
- A Radix Select-backed, Figma-matched `select` registry item with default and soft triggers, error/filled/disabled states, menu surface, checkbox and check selection, and item media for text, icons, users, companies, payment methods, and status dots.
|
|
59
|
+
- A composed `autocomplete` registry item with Input field anatomy, Select menu rows, Tag selections, filtering, keyboard navigation, controlled state, and RTL layout.
|
|
57
60
|
- A Figma-matched `date-picker` registry item with Calendar, Range Calendar, Date Picker, Date Range Picker, presets, time rows, open states, month/year view, and RTL.
|
|
58
61
|
- A Radix Slider-backed `slider` registry item with single, range, multi-thumb, text/tooltip indicators, ticks, vertical layout, pill treatment, tones, and RTL behavior.
|
|
62
|
+
- A token-built `skeleton` registry item with primitive, text, avatar, button, input, card, list, table, form, shimmer, reduced-motion, and RTL loading compositions.
|
|
59
63
|
- A read-only `progress` registry item with value meters, label placements, helper text, indicators, spinner, and RTL fill direction.
|
|
60
64
|
- A Radix-based `progress-slider` registry item with semantic tones, ticks, focus treatment, and RTL-aware keyboard behavior.
|
|
65
|
+
- A `spinner` registry item with steady `Spinner`, variable-arc `DynamicSpinner`, inherited text color, and CSS variable sizing.
|
|
61
66
|
- A Radix Tooltip-backed `tooltip` registry item with dark/default variants, small/large sizes, pointer positions, shortcut and close slots, and RTL-safe layout.
|
|
62
67
|
- Token CSS generated from the local token exports in `tokens`, with the Banhaten alias layer kept in the same generated stylesheet.
|
|
63
68
|
- Inter as the single font family, loaded through `@fontsource/inter` weights 400, 500, 600, and 700.
|
|
@@ -67,7 +72,7 @@ The current scaffold includes:
|
|
|
67
72
|
|
|
68
73
|
From this repository:
|
|
69
74
|
|
|
70
|
-
```
|
|
75
|
+
```text
|
|
71
76
|
node src/cli/index.js init --cwd ./playground
|
|
72
77
|
node src/cli/index.js add button --cwd ./playground
|
|
73
78
|
node src/cli/index.js add button-group --cwd ./playground
|
|
@@ -81,8 +86,11 @@ node src/cli/index.js add toolbar --cwd ./playground
|
|
|
81
86
|
node src/cli/index.js add social-button --cwd ./playground
|
|
82
87
|
node src/cli/index.js add input --cwd ./playground
|
|
83
88
|
node src/cli/index.js add select --cwd ./playground
|
|
89
|
+
node src/cli/index.js add autocomplete --cwd ./playground
|
|
84
90
|
node src/cli/index.js add date-picker --cwd ./playground
|
|
85
91
|
node src/cli/index.js add slider --cwd ./playground
|
|
92
|
+
node src/cli/index.js add skeleton --cwd ./playground
|
|
93
|
+
node src/cli/index.js add spinner --cwd ./playground
|
|
86
94
|
node src/cli/index.js add progress --cwd ./playground
|
|
87
95
|
node src/cli/index.js add progress-slider --cwd ./playground
|
|
88
96
|
node src/cli/index.js add textarea --cwd ./playground
|
|
@@ -98,14 +106,14 @@ node src/cli/index.js add tooltip --cwd ./playground
|
|
|
98
106
|
|
|
99
107
|
Run the local component playground:
|
|
100
108
|
|
|
101
|
-
```
|
|
109
|
+
```text
|
|
102
110
|
npm --prefix playground install
|
|
103
111
|
npm run playground:dev
|
|
104
112
|
```
|
|
105
113
|
|
|
106
114
|
In a published package:
|
|
107
115
|
|
|
108
|
-
```
|
|
116
|
+
```text
|
|
109
117
|
npx banhaten init
|
|
110
118
|
npx banhaten add button
|
|
111
119
|
npx banhaten add button-group
|
|
@@ -119,8 +127,11 @@ npx banhaten add toolbar
|
|
|
119
127
|
npx banhaten add social-button
|
|
120
128
|
npx banhaten add input
|
|
121
129
|
npx banhaten add select
|
|
130
|
+
npx banhaten add autocomplete
|
|
122
131
|
npx banhaten add date-picker
|
|
123
132
|
npx banhaten add slider
|
|
133
|
+
npx banhaten add skeleton
|
|
134
|
+
npx banhaten add spinner
|
|
124
135
|
npx banhaten add progress
|
|
125
136
|
npx banhaten add progress-slider
|
|
126
137
|
npx banhaten add textarea
|
|
@@ -136,7 +147,7 @@ npx banhaten add tooltip
|
|
|
136
147
|
|
|
137
148
|
After `init` or `add`, run your package manager install command when the CLI reports new dependencies:
|
|
138
149
|
|
|
139
|
-
```
|
|
150
|
+
```text
|
|
140
151
|
npm install
|
|
141
152
|
```
|
|
142
153
|
|
|
@@ -144,7 +155,7 @@ npm install
|
|
|
144
155
|
|
|
145
156
|
Use the CLI from the root of a React app:
|
|
146
157
|
|
|
147
|
-
```
|
|
158
|
+
```text
|
|
148
159
|
npx banhaten init
|
|
149
160
|
npx banhaten add button input select
|
|
150
161
|
npm install
|
|
@@ -219,6 +230,7 @@ Banhaten themes are controlled by attributes on the document element:
|
|
|
219
230
|
| `Modal` | `size`, `dir`, `title`, `description`, `showIcon`, `showCloseButton`, `showDivider`, `showFooter`, `showCheckbox`, `footer`; `ConfirmModal` adds `intent`, `confirmLabel`, `confirmLoading`, `preventOutsideDismiss` |
|
|
220
231
|
| `Pagination` | `type`, `variant`, `dir`, `page`, `totalPages`, `labels` |
|
|
221
232
|
| `Progress` | `value`, `min`, `max`, `size`, `labelPosition`, `helperText`, `showIndicator`, `showSpinner` |
|
|
233
|
+
| `Spinner` | `Spinner`, `DynamicSpinner`, inherited text color, `--bh-spinner-size` CSS variable |
|
|
222
234
|
| `Slider` | `value`, `defaultValue`, `tone`, `size`, `variant`, `orientation`, `showTicks` |
|
|
223
235
|
| `ProgressSlider` | `value`, `defaultValue`, `tone`, `size`, `showTicks`, `ariaValueText` |
|
|
224
236
|
| `Toggle` | `size`, `showIcon`, `disabled`; `ToggleField` supports `controlPosition`, `label`, `description` |
|
|
@@ -231,14 +243,14 @@ Banhaten themes are controlled by attributes on the document element:
|
|
|
231
243
|
|
|
232
244
|
Check for local drift without writing files:
|
|
233
245
|
|
|
234
|
-
```
|
|
246
|
+
```text
|
|
235
247
|
npx banhaten diff
|
|
236
248
|
npx banhaten diff button
|
|
237
249
|
```
|
|
238
250
|
|
|
239
251
|
Refresh all detected installed components, or target a specific component:
|
|
240
252
|
|
|
241
|
-
```
|
|
253
|
+
```text
|
|
242
254
|
npx banhaten update
|
|
243
255
|
npx banhaten update button
|
|
244
256
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "banhaten",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Banhaten design system: an Arabic and English-first React design system with shadcn-style component installation.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -55,5 +55,11 @@
|
|
|
55
55
|
"bugs": {
|
|
56
56
|
"url": "https://github.com/AhmadGalal85/Banhaten-design-system/issues"
|
|
57
57
|
},
|
|
58
|
-
"homepage": "https://github.com/AhmadGalal85/Banhaten-design-system#readme"
|
|
58
|
+
"homepage": "https://github.com/AhmadGalal85/Banhaten-design-system#readme",
|
|
59
|
+
"main": "index.js",
|
|
60
|
+
"directories": {
|
|
61
|
+
"doc": "docs"
|
|
62
|
+
},
|
|
63
|
+
"devDependencies": {},
|
|
64
|
+
"author": ""
|
|
59
65
|
}
|
|
@@ -67,11 +67,15 @@ function AccordionItem({
|
|
|
67
67
|
function AccordionTrigger({
|
|
68
68
|
className,
|
|
69
69
|
children,
|
|
70
|
+
dir,
|
|
70
71
|
...props
|
|
71
72
|
}: React.ComponentProps<typeof AccordionPrimitive.Trigger>) {
|
|
73
|
+
const triggerDirection = dir ?? getTextDirection(children)
|
|
74
|
+
|
|
72
75
|
return (
|
|
73
76
|
<AccordionPrimitive.Header className="flex">
|
|
74
77
|
<AccordionPrimitive.Trigger
|
|
78
|
+
dir={triggerDirection}
|
|
75
79
|
data-slot="accordion-trigger"
|
|
76
80
|
className={cn(
|
|
77
81
|
"flex flex-1 items-start justify-between gap-[var(--bh-space-3xl-16)] rounded-[var(--bh-radius-md-6)] py-[var(--bh-space-3xl-16)] text-start text-[length:var(--bh-text-body-sm-medium-font-size)] font-[var(--bh-text-body-sm-medium-font-weight)] leading-[var(--bh-text-body-sm-medium-line-height)] tracking-[var(--bh-text-body-sm-medium-letter-spacing)] text-[var(--bh-content-default)] outline-none transition-[background-color,color,box-shadow] hover:text-[var(--bh-content-default)] focus-visible:shadow-[var(--shadow-button-focus)] disabled:pointer-events-none disabled:opacity-[var(--bh-opacity-50)] data-[disabled]:pointer-events-none data-[disabled]:opacity-[var(--bh-opacity-50)] [&[data-state=open]>svg]:rotate-180 [&_svg]:size-[var(--bh-space-3xl-16)]",
|
|
@@ -79,7 +83,7 @@ function AccordionTrigger({
|
|
|
79
83
|
)}
|
|
80
84
|
{...props}
|
|
81
85
|
>
|
|
82
|
-
<span dir="auto" className="min-w-0">
|
|
86
|
+
<span dir="auto" className="min-w-0 flex-1 text-start">
|
|
83
87
|
{children}
|
|
84
88
|
</span>
|
|
85
89
|
<ChevronDownIcon
|
|
@@ -110,6 +114,38 @@ function AccordionContent({
|
|
|
110
114
|
)
|
|
111
115
|
}
|
|
112
116
|
|
|
117
|
+
function getTextDirection(children: React.ReactNode) {
|
|
118
|
+
const text = getNodeText(children)
|
|
119
|
+
|
|
120
|
+
for (const character of text) {
|
|
121
|
+
if (/[\u0590-\u08ff]/.test(character)) {
|
|
122
|
+
return "rtl"
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
if (/[A-Za-z]/.test(character)) {
|
|
126
|
+
return "ltr"
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return undefined
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function getNodeText(node: React.ReactNode): string {
|
|
134
|
+
if (typeof node === "string" || typeof node === "number") {
|
|
135
|
+
return String(node)
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
if (Array.isArray(node)) {
|
|
139
|
+
return node.map(getNodeText).join("")
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
if (React.isValidElement<{ children?: React.ReactNode }>(node)) {
|
|
143
|
+
return getNodeText(node.props.children)
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
return ""
|
|
147
|
+
}
|
|
148
|
+
|
|
113
149
|
export {
|
|
114
150
|
Accordion,
|
|
115
151
|
AccordionItem,
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import * as React from "react"
|
|
2
2
|
import { cva, type VariantProps } from "class-variance-authority"
|
|
3
|
+
import {
|
|
4
|
+
CircleAlertIcon,
|
|
5
|
+
CircleCheckIcon,
|
|
6
|
+
InfoIcon,
|
|
7
|
+
StarIcon,
|
|
8
|
+
TriangleAlertIcon,
|
|
9
|
+
XIcon,
|
|
10
|
+
} from "lucide-react"
|
|
3
11
|
|
|
4
12
|
import { cn } from "@/lib/utils"
|
|
5
13
|
|
|
@@ -226,49 +234,27 @@ function AlertActions({ actions }: { actions: AlertAction[] }) {
|
|
|
226
234
|
|
|
227
235
|
function AlertStatusIcon({ status }: { status: AlertStatus }) {
|
|
228
236
|
if (status === "success") {
|
|
229
|
-
return (
|
|
230
|
-
<svg aria-hidden="true" className="size-[var(--bh-alert-icon-size)] fill-current" viewBox="0 0 16.6667 16.6667">
|
|
231
|
-
<path d="M8.33333 16.6667C12.9357 16.6667 16.6667 12.9357 16.6667 8.33333C16.6667 3.73096 12.9357 0 8.33333 0C3.73096 0 0 3.73096 0 8.33333C0 12.9357 3.73096 16.6667 8.33333 16.6667ZM12.8809 6.21426L7.5 11.5952L3.99407 8.08925L5.17259 6.91075L7.5 9.23817L11.7024 5.03574L12.8809 6.21426Z" />
|
|
232
|
-
</svg>
|
|
233
|
-
)
|
|
237
|
+
return <CircleCheckIcon aria-hidden="true" className="size-[var(--bh-alert-icon-size)]" strokeWidth={2.25} />
|
|
234
238
|
}
|
|
235
239
|
|
|
236
240
|
if (status === "warning") {
|
|
237
|
-
return (
|
|
238
|
-
<svg aria-hidden="true" className="size-[var(--bh-alert-icon-size)] fill-current" viewBox="0 0 17.544 15.4168">
|
|
239
|
-
<path d="M9.49356 0.416809L17.4321 14.1668C17.6623 14.5654 17.5257 15.0751 17.1271 15.3052C17.0005 15.3783 16.8567 15.4168 16.7105 15.4168H0.833333C0.3731 15.4168 0 15.0438 0 14.5835C0 14.4372 0.0385084 14.2935 0.11165 14.1668L8.05022 0.416809C8.28031 0.0182258 8.78997 -0.118333 9.18856 0.111784C9.31522 0.184926 9.42047 0.290126 9.49356 0.416809ZM7.93856 11.2502V12.9168H9.60522V11.2502H7.93856ZM7.93856 5.41681V9.5835H9.60522V5.41681H7.93856Z" />
|
|
240
|
-
</svg>
|
|
241
|
-
)
|
|
241
|
+
return <TriangleAlertIcon aria-hidden="true" className="size-[var(--bh-alert-icon-size)]" strokeWidth={2.25} />
|
|
242
242
|
}
|
|
243
243
|
|
|
244
244
|
if (status === "info") {
|
|
245
|
-
return (
|
|
246
|
-
<svg aria-hidden="true" className="size-[var(--bh-alert-icon-size)] fill-current" viewBox="0 0 16.6667 16.6667">
|
|
247
|
-
<path d="M8.33333 16.6667C3.73096 16.6667 0 12.9357 0 8.33333C0 3.73096 3.73096 0 8.33333 0C12.9357 0 16.6667 3.73096 16.6667 8.33333C16.6667 12.9357 12.9357 16.6667 8.33333 16.6667ZM8.33333 6.25C9.02367 6.25 9.58333 5.69036 9.58333 5C9.58333 4.30964 9.02367 3.75 8.33333 3.75C7.643 3.75 7.08333 4.30964 7.08333 5C7.08333 5.69036 7.643 6.25 8.33333 6.25ZM10 10.8333H9.16667V7.08333H6.66667V8.75H7.5V10.8333H6.66667V12.5H10V10.8333Z" />
|
|
248
|
-
</svg>
|
|
249
|
-
)
|
|
245
|
+
return <InfoIcon aria-hidden="true" className="size-[var(--bh-alert-icon-size)]" strokeWidth={2.25} />
|
|
250
246
|
}
|
|
251
247
|
|
|
252
248
|
if (status === "neutral") {
|
|
253
|
-
return (
|
|
254
|
-
<svg aria-hidden="true" className="size-[var(--bh-alert-icon-size)] fill-current" viewBox="0 0 15.851 15.0752">
|
|
255
|
-
<path d="M7.92545 12.0833L3.02726 15.0752L4.35901 9.49217L0 5.75819L5.72128 5.29952L7.92545 0L10.1297 5.29952L15.851 5.75819L11.492 9.49217L12.8237 15.0752L7.92545 12.0833Z" />
|
|
256
|
-
</svg>
|
|
257
|
-
)
|
|
249
|
+
return <StarIcon aria-hidden="true" className="size-[var(--bh-alert-icon-size)]" strokeWidth={2.25} />
|
|
258
250
|
}
|
|
259
251
|
|
|
260
|
-
return (
|
|
261
|
-
<svg aria-hidden="true" className="size-[var(--bh-alert-icon-size)] fill-current" viewBox="0 0 16.6667 16.6667">
|
|
262
|
-
<path d="M8.33333 16.6667C3.73096 16.6667 0 12.9357 0 8.33333C0 3.73096 3.73096 0 8.33333 0C12.9357 0 16.6667 3.73096 16.6667 8.33333C16.6667 12.9357 12.9357 16.6667 8.33333 16.6667ZM7.5 10.8333V12.5H9.16667V10.8333H7.5ZM7.5 4.16667V9.16667H9.16667V4.16667H7.5Z" />
|
|
263
|
-
</svg>
|
|
264
|
-
)
|
|
252
|
+
return <CircleAlertIcon aria-hidden="true" className="size-[var(--bh-alert-icon-size)]" strokeWidth={2.25} />
|
|
265
253
|
}
|
|
266
254
|
|
|
267
255
|
function CloseIcon() {
|
|
268
256
|
return (
|
|
269
|
-
<
|
|
270
|
-
<path d="M8.00004 7.05723L11.2999 3.75739L12.2427 4.7002L8.94284 8.00003L12.2427 11.2998L11.2999 12.2427L8.00004 8.94283L4.70021 12.2427L3.75739 11.2998L7.05723 8.00003L3.75739 4.7002L4.70021 3.75739L8.00004 7.05723Z" />
|
|
271
|
-
</svg>
|
|
257
|
+
<XIcon aria-hidden="true" className="size-[var(--bh-alert-icon-size)]" strokeWidth={2.25} />
|
|
272
258
|
)
|
|
273
259
|
}
|
|
274
260
|
|
|
@@ -3,9 +3,9 @@ import { cva, type VariantProps } from "class-variance-authority"
|
|
|
3
3
|
|
|
4
4
|
import { cn } from "@/lib/utils"
|
|
5
5
|
|
|
6
|
-
type AttributeLayout = "inline" | "
|
|
6
|
+
type AttributeLayout = "inline" | "stacked" | "two-column"
|
|
7
7
|
type AttributeDensity = "compact" | "default" | "comfortable"
|
|
8
|
-
type AttributeAlign = "start" | "
|
|
8
|
+
type AttributeAlign = "start" | "stretch"
|
|
9
9
|
type AttributeValueDir = "auto" | "ltr" | "rtl"
|
|
10
10
|
|
|
11
11
|
type AttributeContextValue = {
|
|
@@ -70,13 +70,13 @@ const attributeListVariants = cva("grid min-w-0", {
|
|
|
70
70
|
variants: {
|
|
71
71
|
layout: {
|
|
72
72
|
inline: "grid-cols-1",
|
|
73
|
-
end: "grid-cols-1",
|
|
74
73
|
stacked: "grid-cols-1",
|
|
75
74
|
"two-column":
|
|
76
75
|
"grid-cols-1 gap-x-[var(--bh-space-6xl-32)] sm:grid-cols-2",
|
|
77
76
|
},
|
|
78
77
|
bordered: {
|
|
79
|
-
true:
|
|
78
|
+
true:
|
|
79
|
+
"overflow-hidden rounded-[var(--bh-radius-lg-8)] border border-[var(--bh-border-subtle)] [&>[data-slot='attribute-item']]:px-[var(--bh-space-3xl-16)] sm:[&>[data-slot='attribute-item']]:px-[var(--bh-space-4xl-20)]",
|
|
80
80
|
false: "",
|
|
81
81
|
},
|
|
82
82
|
},
|
|
@@ -91,8 +91,6 @@ const attributeItemVariants = cva("min-w-0", {
|
|
|
91
91
|
layout: {
|
|
92
92
|
inline:
|
|
93
93
|
"grid grid-cols-1 items-center gap-x-[var(--bh-space-xs-4)] sm:grid-cols-[var(--bh-attribute-label-width)_minmax(0,1fr)]",
|
|
94
|
-
end:
|
|
95
|
-
"grid grid-cols-1 items-center gap-x-[var(--bh-space-xs-4)] sm:grid-cols-[var(--bh-attribute-label-width)_minmax(0,1fr)]",
|
|
96
94
|
stacked:
|
|
97
95
|
"flex flex-col items-start justify-center gap-[var(--bh-space-xs-4)]",
|
|
98
96
|
"two-column":
|
|
@@ -100,7 +98,7 @@ const attributeItemVariants = cva("min-w-0", {
|
|
|
100
98
|
},
|
|
101
99
|
density: {
|
|
102
100
|
compact: "py-[var(--bh-space-md-8)]",
|
|
103
|
-
default: "py-[var(--bh-space-
|
|
101
|
+
default: "py-[var(--bh-space-3xl-16)]",
|
|
104
102
|
comfortable: "py-[var(--bh-space-3xl-16)]",
|
|
105
103
|
},
|
|
106
104
|
divided: {
|
|
@@ -154,7 +152,6 @@ const attributeValueVariants = cva(
|
|
|
154
152
|
variants: {
|
|
155
153
|
align: {
|
|
156
154
|
start: "justify-self-start text-start",
|
|
157
|
-
end: "justify-self-end justify-end text-end rtl:justify-self-start rtl:justify-start rtl:text-right",
|
|
158
155
|
stretch: "w-full justify-self-stretch text-start",
|
|
159
156
|
},
|
|
160
157
|
truncate: {
|
|
@@ -323,8 +320,7 @@ const AttributeItem = React.forwardRef<HTMLDivElement, AttributeItemProps>(
|
|
|
323
320
|
const selectedLayout = layout || context.layout
|
|
324
321
|
const selectedDensity = density || context.density
|
|
325
322
|
const selectedDivided = divided ?? context.dividers
|
|
326
|
-
const selectedAlign =
|
|
327
|
-
valueAlign || (selectedLayout === "end" ? "end" : "start")
|
|
323
|
+
const selectedAlign = valueAlign || "start"
|
|
328
324
|
|
|
329
325
|
return (
|
|
330
326
|
<div
|