@leitware/composables 2.0.0 → 3.1.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/README.md +16 -0
- package/dist/presets/brutalist.css +16 -17
- package/dist/presets/default.css +11 -13
- package/dist/presets/editorial-grid.css +12 -13
- package/dist/presets/kumo.css +14 -20
- package/dist/presets/signal-pop.css +14 -26
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +20 -0
- package/package.json +13 -12
- package/rules/composables.md +24 -21
- package/skills/use-composables/references/public-api.md +2 -2
- package/skills/use-composables/references/semantic-utilities.md +5 -0
- package/src/_internal/accordion.tsx +10 -10
- package/src/_internal/ai-elements/reasoning.tsx +2 -0
- package/src/_internal/alert-dialog.tsx +3 -3
- package/src/_internal/alert.tsx +9 -7
- package/src/_internal/avatar.tsx +25 -14
- package/src/_internal/badge.tsx +2 -1
- package/src/_internal/bubble.tsx +2 -2
- package/src/_internal/button.tsx +16 -8
- package/src/_internal/calendar.tsx +3 -3
- package/src/_internal/card.tsx +53 -17
- package/src/_internal/checkbox.tsx +2 -2
- package/src/_internal/combobox.tsx +2 -2
- package/src/_internal/dialog.tsx +29 -9
- package/src/_internal/divider.tsx +14 -16
- package/src/_internal/dropdown-menu.tsx +4 -4
- package/src/_internal/empty.tsx +6 -3
- package/src/_internal/field.tsx +11 -7
- package/src/_internal/hover-card.tsx +1 -1
- package/src/_internal/input-group.tsx +17 -12
- package/src/_internal/input.tsx +33 -4
- package/src/_internal/item.tsx +2 -2
- package/src/_internal/label.tsx +1 -1
- package/src/_internal/message.tsx +1 -1
- package/src/_internal/native-select.tsx +1 -1
- package/src/_internal/popover.tsx +9 -3
- package/src/_internal/progress.tsx +37 -7
- package/src/_internal/radio-group.tsx +39 -4
- package/src/_internal/select.tsx +2 -2
- package/src/_internal/separator.tsx +1 -1
- package/src/_internal/sheet.tsx +9 -3
- package/src/_internal/sidebar.tsx +0 -35
- package/src/_internal/skeleton.tsx +26 -3
- package/src/_internal/slider.tsx +9 -7
- package/src/_internal/sonner.tsx +4 -4
- package/src/_internal/spinner.tsx +43 -3
- package/src/_internal/switch.tsx +2 -2
- package/src/_internal/table.tsx +20 -5
- package/src/_internal/tabs.tsx +4 -1
- package/src/_internal/textarea.tsx +1 -1
- package/src/_internal/toggle.tsx +1 -1
- package/src/_internal/tooltip.tsx +53 -8
- package/src/_internal/typography.tsx +4 -2
- package/src/index.ts +25 -1
- package/src/lib/utils.ts +2 -2
- package/src/opinionated/alert.tsx +8 -10
- package/src/opinionated/avatar.tsx +2 -2
- package/src/opinionated/button.tsx +13 -3
- package/src/opinionated/command.tsx +23 -0
- package/src/opinionated/data-grid.tsx +125 -0
- package/src/opinionated/dialog.tsx +10 -1
- package/src/opinionated/form-calendar-popover.tsx +5 -10
- package/src/opinionated/form-checkbox.tsx +2 -2
- package/src/opinionated/form-date-of-birth.tsx +12 -8
- package/src/opinionated/form-input-group.tsx +1 -1
- package/src/opinionated/form-radiogroup.tsx +24 -7
- package/src/opinionated/form-switch.tsx +7 -6
- package/src/opinionated/progress.tsx +7 -2
- package/src/opinionated/select.tsx +4 -1
- package/src/opinionated/sidebar.tsx +0 -1
- package/src/opinionated/skeleton.tsx +3 -13
- package/src/opinionated/spinner.tsx +2 -0
- package/src/opinionated/token-config-panel/spacing-editor.tsx +21 -3
- package/src/opinionated/tooltip.tsx +20 -2
- package/src/styles/presets/brutalist.css +16 -17
- package/src/styles/presets/default.css +11 -13
- package/src/styles/presets/editorial-grid.css +12 -13
- package/src/styles/presets/kumo.css +14 -20
- package/src/styles/presets/signal-pop.css +14 -26
- package/src/styles/presets-data/brutalist.ts +16 -19
- package/src/styles/presets-data/default.ts +11 -15
- package/src/styles/presets-data/editorial-grid.ts +12 -6
- package/src/styles/presets-data/kumo.ts +12 -6
- package/src/styles/presets-data/signal-pop.ts +14 -30
- package/src/styles/tokens/components.css +64 -20
- package/src/styles/tokens/registry.ts +33 -0
- package/src/styles/tokens/semantic-utilities.css +20 -0
- package/src/styles/tokens/semantic.css +10 -0
- package/src/styles/tokens/tailwind-color-adapter.css +3 -0
- package/src/styles/tokens/tailwind-public-utilities.css +20 -0
package/src/_internal/button.tsx
CHANGED
|
@@ -7,18 +7,24 @@ import { cn, FOCUS_RING, FOCUS_RING_DESTRUCTIVE, HOVER_RING } from '../lib/utils
|
|
|
7
7
|
// border (no bg-clip-padding) so filled and outlined buttons read as the same
|
|
8
8
|
// size regardless of --border-width-base.
|
|
9
9
|
const buttonVariants = cva(
|
|
10
|
-
`${FOCUS_RING} ${HOVER_RING} rounded-(--button-radius) border border-transparent text-
|
|
10
|
+
`${FOCUS_RING} ${HOVER_RING} rounded-(--button-radius) border border-transparent text-(length:--control-font-size) leading-relaxed font-medium [&_svg:not([class*='size-'])]:size-4 inline-flex items-center justify-center whitespace-nowrap transition-[opacity,box-shadow,transform] duration-(--motion-duration-interaction) ease-(--motion-ease-standard) active:[transform:scale(var(--active-scale,0.98))] disabled:pointer-events-none disabled:opacity-disabled [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none`,
|
|
11
11
|
{
|
|
12
12
|
variants: {
|
|
13
13
|
variant: {
|
|
14
14
|
default:
|
|
15
|
-
'bg-primary text-primary-foreground border-(--button-primary-border) bg-[image:var(--button-primary-background-image)] shadow-(--button-primary-shadow) hover:shadow-[var(--button-primary-hover-shadow,var(--hover-shadow))] hover:bg-[image:var(--button-primary-hover-background-image)] hover:border-[var(--button-primary-hover-border,var(--hover-ring-color))]',
|
|
15
|
+
'bg-primary text-primary-foreground border-(--button-primary-border) bg-[image:var(--button-primary-background-image)] shadow-(--button-primary-shadow) hover:bg-(--bg-fill-primary-hover) hover:shadow-[var(--button-primary-hover-shadow,var(--hover-shadow))] hover:bg-[image:var(--button-primary-hover-background-image)] hover:border-[var(--button-primary-hover-border,var(--hover-ring-color))]',
|
|
16
16
|
outline:
|
|
17
17
|
'border-stroke shadow-(--button-outline-shadow) hover:shadow-[var(--button-outline-hover-shadow,var(--hover-shadow))] hover:bg-[var(--button-quiet-hover-bg,transparent)] hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground',
|
|
18
18
|
secondary:
|
|
19
|
-
'bg-secondary text-secondary-foreground border-(--button-secondary-border) shadow-(--button-secondary-shadow) hover:shadow-[var(--button-secondary-hover-shadow,var(--hover-shadow))] hover:bg-[var(--button-secondary-hover-bg,var(--bg-fill-secondary))] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground',
|
|
19
|
+
'bg-secondary text-secondary-foreground border-(--button-secondary-border) shadow-(--button-secondary-shadow) hover:shadow-[var(--button-secondary-hover-shadow,var(--hover-shadow))] hover:bg-[var(--button-secondary-hover-bg,var(--bg-fill-secondary-hover))] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground',
|
|
20
|
+
// Neutral (white) and ghost fill on hover, like filled buttons, rather
|
|
21
|
+
// than drawing the hover ring's border.
|
|
22
|
+
neutral:
|
|
23
|
+
'bg-(--bg-fill-secondary-inverse) text-foreground hover:bg-(--bg-surface-hover) hover:border-(color:--bg-surface-hover) focus-visible:border-(color:--bg-fill-secondary-inverse) aria-expanded:bg-(--bg-surface-hover)',
|
|
24
|
+
inverse:
|
|
25
|
+
'bg-(--bg-inverse) text-(color:--text-inverse) hover:bg-(--bg-inverse)/85 hover:border-transparent focus-visible:border-(color:--bg-inverse)',
|
|
20
26
|
ghost:
|
|
21
|
-
'hover:bg-[var(--button-quiet-hover-bg,
|
|
27
|
+
'hover:bg-[var(--button-quiet-hover-bg,var(--bg-surface-hover))] hover:border-[var(--button-quiet-hover-bg,var(--bg-surface-hover))] hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground',
|
|
22
28
|
destructive: `bg-[var(--button-destructive-bg,var(--bg-surface-critical))] ${FOCUS_RING_DESTRUCTIVE} text-[var(--button-destructive-text,var(--text-critical))] border-[var(--button-destructive-border,var(--border-critical))] bg-[image:var(--button-destructive-background-image)] shadow-(--button-destructive-shadow) hover:shadow-[var(--button-destructive-hover-shadow,var(--hover-shadow))] hover:bg-[image:var(--button-destructive-hover-background-image)] hover:border-[var(--button-destructive-hover-border,var(--hover-ring-color))]`,
|
|
23
29
|
success: 'bg-surface-success text-success border-stroke-success',
|
|
24
30
|
warning: 'bg-surface-warning text-warning border-stroke-warning',
|
|
@@ -34,14 +40,14 @@ const buttonVariants = cva(
|
|
|
34
40
|
'brand-5':
|
|
35
41
|
'font-(--button-brand-font-weight) text-shadow-(--button-brand-text-shadow) bg-[var(--button-brand-5-bg,var(--bg-surface-brand-5))] text-[var(--button-brand-5-text,var(--text-brand-5))] border-[var(--button-brand-5-border,var(--border-brand-5))] bg-[image:var(--button-brand-5-background-image)] shadow-(--button-brand-5-shadow) hover:shadow-[var(--button-brand-5-hover-shadow,var(--hover-shadow))] hover:bg-[image:var(--button-brand-5-hover-background-image)] hover:border-[var(--button-brand-5-hover-border,var(--hover-ring-color))]',
|
|
36
42
|
emphasis: 'bg-surface-emphasis text-emphasis border-stroke-emphasis',
|
|
37
|
-
link: 'text-
|
|
43
|
+
link: 'text-link underline underline-offset-4 hover:text-(--text-secondary) hover:border-transparent hover:ring-0',
|
|
38
44
|
},
|
|
39
45
|
size: {
|
|
40
46
|
default:
|
|
41
|
-
"h-(--button-height) gap-(--button-gap) px-3 text-(length:--button-font-size)/relaxed has-data-[icon=inline-end]:pr-2.5 has-data-[icon=inline-start]:pl-2.5 [&_svg:not([class*='size-'])]:size-3.5",
|
|
47
|
+
"h-(--button-height) min-w-[calc(var(--button-height)*var(--button-min-width-ratio))] gap-(--button-gap) px-3 text-(length:--button-font-size)/relaxed has-data-[icon=inline-end]:pr-2.5 has-data-[icon=inline-start]:pl-2.5 [&_svg:not([class*='size-'])]:size-3.5",
|
|
42
48
|
xs: "h-(--button-height-xs) rounded-(--button-radius-xs) gap-1 px-2.5 text-(length:--button-font-size-xs) has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-2.5",
|
|
43
|
-
sm: "h-(--button-height-sm) rounded-(--button-radius-sm) gap-1 px-2.5 text-(length:--button-font-size-sm)/relaxed has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-3",
|
|
44
|
-
lg: "h-(--button-height-lg) gap-(--button-gap) px-3.5 text-(length:--button-font-size)/relaxed has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3 [&_svg:not([class*='size-'])]:size-4",
|
|
49
|
+
sm: "h-(--button-height-sm) min-w-[calc(var(--button-height-sm)*var(--button-min-width-ratio))] rounded-(--button-radius-sm) gap-1 px-2.5 text-(length:--button-font-size-sm)/relaxed has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-3",
|
|
50
|
+
lg: "h-(--button-height-lg) min-w-[calc(var(--button-height-lg)*var(--button-min-width-ratio))] gap-(--button-gap) px-3.5 text-(length:--button-font-size)/relaxed has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3 [&_svg:not([class*='size-'])]:size-4",
|
|
45
51
|
icon: "size-(--button-height) [&_svg:not([class*='size-'])]:size-3.5",
|
|
46
52
|
'icon-xs':
|
|
47
53
|
"size-(--button-height-xs) rounded-(--button-radius-xs) [&_svg:not([class*='size-'])]:size-2.5",
|
|
@@ -56,6 +62,8 @@ const buttonVariants = cva(
|
|
|
56
62
|
pill: 'rounded-full',
|
|
57
63
|
},
|
|
58
64
|
},
|
|
65
|
+
// Links sit inline with text: no control height or side padding.
|
|
66
|
+
compoundVariants: [{ variant: 'link', class: 'h-auto min-w-0 px-0' }],
|
|
59
67
|
defaultVariants: {
|
|
60
68
|
variant: 'default',
|
|
61
69
|
size: 'default',
|
|
@@ -22,7 +22,7 @@ function Calendar({
|
|
|
22
22
|
<DayPicker
|
|
23
23
|
showOutsideDays={showOutsideDays}
|
|
24
24
|
className={cn(
|
|
25
|
-
'p-3 [--cell-radius:var(--radius-md)] [--cell-size:--spacing(8)] bg-page rounded-lg border shadow-sm group/calendar [[data-slot=card-content]_&]:bg-transparent [[data-slot=card-content]_&]:border-0 [[data-slot=card-content]_&]:shadow-none [[data-slot=popover-content]_&]:bg-transparent [[data-slot=popover-content]_&]:border-0 [[data-slot=popover-content]_&]:shadow-none
|
|
25
|
+
'p-3 [--cell-radius:var(--radius-md)] [--cell-size:--spacing(8)] bg-page rounded-lg border shadow-sm group/calendar [[data-slot=card-content]_&]:bg-transparent [[data-slot=card-content]_&]:border-0 [[data-slot=card-content]_&]:shadow-none [[data-slot=popover-content]_&]:bg-transparent [[data-slot=popover-content]_&]:border-0 [[data-slot=popover-content]_&]:shadow-none',
|
|
26
26
|
String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
|
|
27
27
|
String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
|
|
28
28
|
className,
|
|
@@ -80,7 +80,7 @@ function Calendar({
|
|
|
80
80
|
week_number_header: cn('select-none w-(--cell-size)', defaultClassNames.week_number_header),
|
|
81
81
|
week_number: cn('text-xs select-none text-muted-foreground', defaultClassNames.week_number),
|
|
82
82
|
day: cn(
|
|
83
|
-
'relative w-full rounded-(--cell-radius) h-full p-0 text-center [&:last-child[data-selected=true]_button]:rounded-r-(--cell-radius) group/day aspect-square select-none',
|
|
83
|
+
'relative flex w-full items-center justify-center rounded-(--cell-radius) h-full p-0 text-center text-(length:--body-font-size) leading-none [&:last-child[data-selected=true]_button]:rounded-r-(--cell-radius) group/day aspect-square select-none',
|
|
84
84
|
props.showWeekNumber
|
|
85
85
|
? '[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)'
|
|
86
86
|
: '[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)',
|
|
@@ -167,7 +167,7 @@ function CalendarDayButton({
|
|
|
167
167
|
data-range-end={modifiers.range_end}
|
|
168
168
|
data-range-middle={modifiers.range_middle}
|
|
169
169
|
className={cn(
|
|
170
|
-
'data-[selected-single=true]:bg-
|
|
170
|
+
'data-[selected-single=true]:bg-selected data-[selected-single=true]:text-selected-foreground data-[selected-single=true]:hover:bg-selected/90 data-[range-middle=true]:bg-muted data-[range-middle=true]:text-foreground data-[range-start=true]:bg-selected data-[range-start=true]:text-selected-foreground data-[range-end=true]:bg-selected data-[range-end=true]:text-selected-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[color:var(--focus-ring-color)]/50 dark:hover:text-foreground relative isolate z-10 flex aspect-square h-auto w-full flex-col gap-1 rounded-(--cell-radius) border-0 text-(length:--body-font-size) leading-none font-normal transition-colors group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[length:var(--focus-ring-width)] data-[range-end=true]:rounded-r-(--cell-radius) data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-l-(--cell-radius) [&>span]:text-[0.75em] [&>span]:opacity-70',
|
|
171
171
|
defaultClassNames.day,
|
|
172
172
|
className,
|
|
173
173
|
)}
|
package/src/_internal/card.tsx
CHANGED
|
@@ -1,20 +1,41 @@
|
|
|
1
|
+
import { cva, type VariantProps } from 'class-variance-authority'
|
|
1
2
|
import type * as React from 'react'
|
|
2
3
|
|
|
3
4
|
import { cn } from '../lib/utils'
|
|
4
5
|
|
|
6
|
+
// Every card gap and inset reads the card-scoped --card-space, derived from
|
|
7
|
+
// the --card-padding token: sm sits one spacing step tighter. Presets tune a
|
|
8
|
+
// single token and every size stays on the spacing scale.
|
|
9
|
+
const cardVariants = cva(
|
|
10
|
+
'border-(length:--card-border-width) border-stroke text-card-foreground gap-(--card-space) overflow-hidden rounded-(--card-radius) py-(--card-space) text-(length:--body-font-size) leading-relaxed has-[>img:first-child]:pt-0 *:[img:first-child]:rounded-t-(--card-radius) *:[img:last-child]:rounded-b-(--card-radius) group/card flex flex-col',
|
|
11
|
+
{
|
|
12
|
+
variants: {
|
|
13
|
+
size: {
|
|
14
|
+
default: '[--card-space:var(--card-padding)]',
|
|
15
|
+
sm: '[--card-space:calc(var(--card-padding)_-_var(--spacing))]',
|
|
16
|
+
},
|
|
17
|
+
variant: {
|
|
18
|
+
default: 'bg-card',
|
|
19
|
+
// On the popover surface (white in light themes).
|
|
20
|
+
raised: 'bg-popover',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
defaultVariants: { size: 'default', variant: 'default' },
|
|
24
|
+
},
|
|
25
|
+
)
|
|
26
|
+
|
|
5
27
|
function Card({
|
|
6
28
|
className,
|
|
7
29
|
size = 'default',
|
|
30
|
+
variant = 'default',
|
|
8
31
|
...props
|
|
9
|
-
}: React.ComponentProps<'div'> &
|
|
32
|
+
}: React.ComponentProps<'div'> & VariantProps<typeof cardVariants>) {
|
|
10
33
|
return (
|
|
11
34
|
<div
|
|
12
35
|
data-slot="card"
|
|
13
36
|
data-size={size}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
className,
|
|
17
|
-
)}
|
|
37
|
+
data-variant={variant}
|
|
38
|
+
className={cn(cardVariants({ size, variant }), className)}
|
|
18
39
|
{...props}
|
|
19
40
|
/>
|
|
20
41
|
)
|
|
@@ -25,7 +46,7 @@ function CardHeader({ className, ...props }: React.ComponentProps<'div'>) {
|
|
|
25
46
|
<div
|
|
26
47
|
data-slot="card-header"
|
|
27
48
|
className={cn(
|
|
28
|
-
'gap-1 rounded-t-(--card-radius) px-(--card-
|
|
49
|
+
'gap-1 rounded-t-(--card-radius) px-(--card-space) [.border-b]:pb-(--card-space) group/card-header @container/card-header grid auto-rows-min items-start has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto]',
|
|
29
50
|
className,
|
|
30
51
|
)}
|
|
31
52
|
{...props}
|
|
@@ -34,14 +55,26 @@ function CardHeader({ className, ...props }: React.ComponentProps<'div'>) {
|
|
|
34
55
|
}
|
|
35
56
|
|
|
36
57
|
function CardTitle({ className, ...props }: React.ComponentProps<'div'>) {
|
|
37
|
-
return
|
|
58
|
+
return (
|
|
59
|
+
<div
|
|
60
|
+
data-slot="card-title"
|
|
61
|
+
className={cn(
|
|
62
|
+
'text-(length:--title-font-size) leading-(--title-line-height) font-medium',
|
|
63
|
+
className,
|
|
64
|
+
)}
|
|
65
|
+
{...props}
|
|
66
|
+
/>
|
|
67
|
+
)
|
|
38
68
|
}
|
|
39
69
|
|
|
40
70
|
function CardDescription({ className, ...props }: React.ComponentProps<'div'>) {
|
|
41
71
|
return (
|
|
42
72
|
<div
|
|
43
73
|
data-slot="card-description"
|
|
44
|
-
className={cn(
|
|
74
|
+
className={cn(
|
|
75
|
+
'text-muted-foreground text-(length:--body-font-size) leading-relaxed',
|
|
76
|
+
className,
|
|
77
|
+
)}
|
|
45
78
|
{...props}
|
|
46
79
|
/>
|
|
47
80
|
)
|
|
@@ -58,13 +91,7 @@ function CardAction({ className, ...props }: React.ComponentProps<'div'>) {
|
|
|
58
91
|
}
|
|
59
92
|
|
|
60
93
|
function CardContent({ className, ...props }: React.ComponentProps<'div'>) {
|
|
61
|
-
return (
|
|
62
|
-
<div
|
|
63
|
-
data-slot="card-content"
|
|
64
|
-
className={cn('px-(--card-padding) group-data-[size=sm]/card:px-3', className)}
|
|
65
|
-
{...props}
|
|
66
|
-
/>
|
|
67
|
-
)
|
|
94
|
+
return <div data-slot="card-content" className={cn('px-(--card-space)', className)} {...props} />
|
|
68
95
|
}
|
|
69
96
|
|
|
70
97
|
function CardFooter({ className, ...props }: React.ComponentProps<'div'>) {
|
|
@@ -72,7 +99,7 @@ function CardFooter({ className, ...props }: React.ComponentProps<'div'>) {
|
|
|
72
99
|
<div
|
|
73
100
|
data-slot="card-footer"
|
|
74
101
|
className={cn(
|
|
75
|
-
'rounded-b-(--card-radius) px-(--card-
|
|
102
|
+
'rounded-b-(--card-radius) px-(--card-space) [.border-t]:pt-(--card-space) flex items-center',
|
|
76
103
|
className,
|
|
77
104
|
)}
|
|
78
105
|
{...props}
|
|
@@ -80,4 +107,13 @@ function CardFooter({ className, ...props }: React.ComponentProps<'div'>) {
|
|
|
80
107
|
)
|
|
81
108
|
}
|
|
82
109
|
|
|
83
|
-
export {
|
|
110
|
+
export {
|
|
111
|
+
cardVariants,
|
|
112
|
+
Card,
|
|
113
|
+
CardHeader,
|
|
114
|
+
CardFooter,
|
|
115
|
+
CardTitle,
|
|
116
|
+
CardAction,
|
|
117
|
+
CardDescription,
|
|
118
|
+
CardContent,
|
|
119
|
+
}
|
|
@@ -9,14 +9,14 @@ function Checkbox({ className, ...props }: CheckboxPrimitive.Root.Props) {
|
|
|
9
9
|
className={cn(
|
|
10
10
|
FOCUS_RING,
|
|
11
11
|
HOVER_RING,
|
|
12
|
-
'border-
|
|
12
|
+
'border-(color:--choice-border-color) not-data-checked:hover:bg-(--bg-surface-hover) dark:bg-surface-field/30 data-checked:bg-selected data-checked:text-selected-foreground dark:data-checked:bg-selected data-checked:border-selected aria-invalid:aria-checked:border-selected flex size-(--choice-size) items-center justify-center rounded-(--checkbox-radius) border transition-shadow group-has-disabled/field:opacity-disabled peer relative shrink-0 outline-none after:absolute after:-inset-x-3 after:-inset-y-2 disabled:cursor-not-allowed disabled:opacity-disabled',
|
|
13
13
|
className,
|
|
14
14
|
)}
|
|
15
15
|
{...props}
|
|
16
16
|
>
|
|
17
17
|
<CheckboxPrimitive.Indicator
|
|
18
18
|
data-slot="checkbox-indicator"
|
|
19
|
-
className="[&>svg]:size-3
|
|
19
|
+
className="size-full [&>svg]:size-full [&>svg]:stroke-[3] grid place-content-center text-current transition-none"
|
|
20
20
|
>
|
|
21
21
|
<CheckIcon />
|
|
22
22
|
</CheckboxPrimitive.Indicator>
|
|
@@ -124,7 +124,7 @@ function ComboboxItem({ className, children, ...props }: ComboboxPrimitive.Item.
|
|
|
124
124
|
<ComboboxPrimitive.Item
|
|
125
125
|
data-slot="combobox-item"
|
|
126
126
|
className={cn(
|
|
127
|
-
"data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground min-h-7 gap-2 rounded-md px-2 py-1 text-
|
|
127
|
+
"data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground min-h-7 gap-2 rounded-md px-2 py-1 text-(length:--control-font-size) leading-relaxed [&_svg:not([class*='size-'])]:size-3.5 relative flex w-full cursor-default items-center outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-disabled [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
128
128
|
FOCUS_RING,
|
|
129
129
|
className,
|
|
130
130
|
)}
|
|
@@ -193,7 +193,7 @@ function ComboboxChips({
|
|
|
193
193
|
className={cn(
|
|
194
194
|
GROUP_FOCUS_RING,
|
|
195
195
|
HOVER_RING,
|
|
196
|
-
'bg-surface-
|
|
196
|
+
'bg-surface-input border-field flex min-h-(--control-size-md) flex-wrap items-center gap-1 rounded-(--input-radius) border bg-clip-padding px-2 py-0.5 text-(length:--control-font-size) leading-relaxed has-data-[slot=combobox-chip]:px-1',
|
|
197
197
|
className,
|
|
198
198
|
)}
|
|
199
199
|
{...props}
|
package/src/_internal/dialog.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Dialog as DialogPrimitive } from '@base-ui/react/dialog'
|
|
2
|
+
import { cva, type VariantProps } from 'class-variance-authority'
|
|
2
3
|
import { XIcon } from 'lucide-react'
|
|
3
4
|
import type * as React from 'react'
|
|
4
5
|
import { Button } from './button'
|
|
@@ -33,23 +34,38 @@ function DialogOverlay({ className, ...props }: DialogPrimitive.Backdrop.Props)
|
|
|
33
34
|
)
|
|
34
35
|
}
|
|
35
36
|
|
|
37
|
+
const dialogContentVariants = cva(
|
|
38
|
+
'bg-page data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 ring-foreground/10 grid max-w-[calc(100%-2rem)] max-h-[calc(100dvh-var(--spacing)*8)] overflow-y-auto gap-4 rounded-(--dialog-radius) p-4 text-(length:--body-font-size) leading-relaxed ring-(length:--dialog-border-width) duration-fast sm:w-auto sm:max-w-(--dialog-max-width) fixed top-1/2 left-1/2 z-modal w-full -translate-x-1/2 -translate-y-1/2 outline-none',
|
|
39
|
+
{
|
|
40
|
+
variants: {
|
|
41
|
+
placement: {
|
|
42
|
+
center: '',
|
|
43
|
+
// Docks to the bottom of the viewport below `sm`, like a drawer.
|
|
44
|
+
responsive:
|
|
45
|
+
'max-sm:top-auto max-sm:bottom-0 max-sm:max-w-full max-sm:max-h-[90dvh] max-sm:translate-y-0 max-sm:rounded-b-none max-sm:data-open:slide-in-from-bottom max-sm:data-closed:slide-out-to-bottom max-sm:data-open:zoom-in-100 max-sm:data-closed:zoom-out-100',
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
defaultVariants: { placement: 'center' },
|
|
49
|
+
},
|
|
50
|
+
)
|
|
51
|
+
|
|
36
52
|
function DialogContent({
|
|
37
53
|
className,
|
|
38
54
|
children,
|
|
39
55
|
showCloseButton = true,
|
|
56
|
+
placement,
|
|
40
57
|
...props
|
|
41
|
-
}: DialogPrimitive.Popup.Props &
|
|
42
|
-
|
|
43
|
-
|
|
58
|
+
}: DialogPrimitive.Popup.Props &
|
|
59
|
+
VariantProps<typeof dialogContentVariants> & {
|
|
60
|
+
showCloseButton?: boolean
|
|
61
|
+
}) {
|
|
44
62
|
return (
|
|
45
63
|
<DialogPortal>
|
|
46
64
|
<DialogOverlay />
|
|
47
65
|
<DialogPrimitive.Popup
|
|
48
66
|
data-slot="dialog-content"
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
className,
|
|
52
|
-
)}
|
|
67
|
+
data-placement={placement ?? 'center'}
|
|
68
|
+
className={cn(dialogContentVariants({ placement }), className)}
|
|
53
69
|
{...props}
|
|
54
70
|
>
|
|
55
71
|
{children}
|
|
@@ -99,7 +115,10 @@ function DialogTitle({ className, ...props }: DialogPrimitive.Title.Props) {
|
|
|
99
115
|
return (
|
|
100
116
|
<DialogPrimitive.Title
|
|
101
117
|
data-slot="dialog-title"
|
|
102
|
-
className={cn(
|
|
118
|
+
className={cn(
|
|
119
|
+
'text-(length:--heading-font-size) leading-(--heading-line-height) font-medium',
|
|
120
|
+
className,
|
|
121
|
+
)}
|
|
103
122
|
{...props}
|
|
104
123
|
/>
|
|
105
124
|
)
|
|
@@ -110,7 +129,7 @@ function DialogDescription({ className, ...props }: DialogPrimitive.Description.
|
|
|
110
129
|
<DialogPrimitive.Description
|
|
111
130
|
data-slot="dialog-description"
|
|
112
131
|
className={cn(
|
|
113
|
-
'text-muted-foreground *:[a]:hover:text-foreground text-
|
|
132
|
+
'text-muted-foreground *:[a]:hover:text-foreground text-(length:--body-font-size) leading-relaxed *:[a]:underline *:[a]:underline-offset-3',
|
|
114
133
|
className,
|
|
115
134
|
)}
|
|
116
135
|
{...props}
|
|
@@ -119,6 +138,7 @@ function DialogDescription({ className, ...props }: DialogPrimitive.Description.
|
|
|
119
138
|
}
|
|
120
139
|
|
|
121
140
|
export {
|
|
141
|
+
dialogContentVariants,
|
|
122
142
|
Dialog,
|
|
123
143
|
DialogClose,
|
|
124
144
|
DialogContent,
|
|
@@ -23,32 +23,32 @@ const dividerVariants = cva('shrink-0', {
|
|
|
23
23
|
{
|
|
24
24
|
variant: 'solid',
|
|
25
25
|
orientation: 'horizontal',
|
|
26
|
-
class: 'h-[var(--
|
|
26
|
+
class: 'h-[var(--rule-width)] bg-[var(--divider-color,var(--border-default))]',
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
variant: 'solid',
|
|
30
30
|
orientation: 'vertical',
|
|
31
|
-
class: 'w-[var(--
|
|
31
|
+
class: 'w-[var(--rule-width)] bg-[var(--divider-color,var(--border-default))]',
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
34
|
variant: 'dots',
|
|
35
35
|
orientation: 'horizontal',
|
|
36
|
-
class: 'h-[var(--
|
|
36
|
+
class: 'h-[var(--rule-width)]',
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
39
|
variant: 'dots',
|
|
40
40
|
orientation: 'vertical',
|
|
41
|
-
class: 'w-[var(--
|
|
41
|
+
class: 'w-[var(--rule-width)]',
|
|
42
42
|
},
|
|
43
43
|
{
|
|
44
44
|
variant: 'pills',
|
|
45
45
|
orientation: 'horizontal',
|
|
46
|
-
class: 'h-[var(--
|
|
46
|
+
class: 'h-[var(--rule-width)]',
|
|
47
47
|
},
|
|
48
48
|
{
|
|
49
49
|
variant: 'pills',
|
|
50
50
|
orientation: 'vertical',
|
|
51
|
-
class: 'w-[var(--
|
|
51
|
+
class: 'w-[var(--rule-width)]',
|
|
52
52
|
},
|
|
53
53
|
],
|
|
54
54
|
defaultVariants: {
|
|
@@ -65,7 +65,7 @@ interface DividerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
65
65
|
orientation?: 'horizontal' | 'vertical'
|
|
66
66
|
/** Vertical alignment of the divider within its line. @default "center" */
|
|
67
67
|
align?: 'start' | 'center' | 'end'
|
|
68
|
-
/** Width multiplier for pills. Controls pill width as calc(var(--
|
|
68
|
+
/** Width multiplier for pills. Controls pill width as calc(var(--rule-width) * n). @default 4 */
|
|
69
69
|
pillsMultiplier?: number
|
|
70
70
|
/** CSS color value for dots/pills patterns. Sets --divider-color. @default "var(--border-default)" */
|
|
71
71
|
color?: string
|
|
@@ -82,37 +82,35 @@ function getPatternStyle(
|
|
|
82
82
|
return orientation === 'horizontal'
|
|
83
83
|
? {
|
|
84
84
|
backgroundImage:
|
|
85
|
-
'radial-gradient(circle, var(--divider-color, var(--border-default)) calc(var(--
|
|
86
|
-
backgroundSize:
|
|
87
|
-
'calc(var(--border-width-base) + var(--spacing) * 1) var(--border-width-base)',
|
|
85
|
+
'radial-gradient(circle, var(--divider-color, var(--border-default)) calc(var(--rule-width) / 2), transparent 0)',
|
|
86
|
+
backgroundSize: 'calc(var(--rule-width) + var(--spacing) * 1) var(--rule-width)',
|
|
88
87
|
backgroundRepeat: 'repeat-x',
|
|
89
88
|
backgroundPosition: 'left center',
|
|
90
89
|
}
|
|
91
90
|
: {
|
|
92
91
|
backgroundImage:
|
|
93
|
-
'radial-gradient(circle, var(--divider-color, var(--border-default)) calc(var(--
|
|
94
|
-
backgroundSize:
|
|
95
|
-
'var(--border-width-base) calc(var(--border-width-base) + var(--spacing) * 1)',
|
|
92
|
+
'radial-gradient(circle, var(--divider-color, var(--border-default)) calc(var(--rule-width) / 2), transparent 0)',
|
|
93
|
+
backgroundSize: 'var(--rule-width) calc(var(--rule-width) + var(--spacing) * 1)',
|
|
96
94
|
backgroundRepeat: 'repeat-y',
|
|
97
95
|
backgroundPosition: 'center top',
|
|
98
96
|
}
|
|
99
97
|
}
|
|
100
98
|
|
|
101
99
|
// pills
|
|
102
|
-
const pillLen = `calc(var(--
|
|
100
|
+
const pillLen = `calc(var(--rule-width) * ${pillsMultiplier})`
|
|
103
101
|
const unit = `calc(${pillLen} + var(--spacing) * 1)`
|
|
104
102
|
|
|
105
103
|
return orientation === 'horizontal'
|
|
106
104
|
? {
|
|
107
105
|
backgroundImage: `repeating-linear-gradient(to right, var(--divider-color, var(--border-default)) 0, var(--divider-color, var(--border-default)) ${pillLen}, transparent ${pillLen}, transparent ${unit})`,
|
|
108
|
-
backgroundSize: `${unit} var(--
|
|
106
|
+
backgroundSize: `${unit} var(--rule-width)`,
|
|
109
107
|
backgroundRepeat: 'repeat-x',
|
|
110
108
|
backgroundPosition: 'left center',
|
|
111
109
|
borderRadius: 'var(--radius)',
|
|
112
110
|
}
|
|
113
111
|
: {
|
|
114
112
|
backgroundImage: `repeating-linear-gradient(to bottom, var(--divider-color, var(--border-default)) 0, var(--divider-color, var(--border-default)) ${pillLen}, transparent ${pillLen}, transparent ${unit})`,
|
|
115
|
-
backgroundSize: `var(--
|
|
113
|
+
backgroundSize: `var(--rule-width) ${unit}`,
|
|
116
114
|
backgroundRepeat: 'repeat-y',
|
|
117
115
|
backgroundPosition: 'center top',
|
|
118
116
|
borderRadius: 'var(--radius)',
|
|
@@ -85,7 +85,7 @@ function DropdownMenuItem({
|
|
|
85
85
|
data-inset={inset}
|
|
86
86
|
data-variant={variant}
|
|
87
87
|
className={cn(
|
|
88
|
-
"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-critical data-[variant=destructive]:focus:bg-surface-critical data-[variant=destructive]:focus:text-critical data-[variant=destructive]:*:[svg]:text-icon-critical not-data-[variant=destructive]:focus:**:text-accent-foreground min-h-7 gap-2 rounded-md px-2 py-1 text-
|
|
88
|
+
"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-critical data-[variant=destructive]:focus:bg-surface-critical data-[variant=destructive]:focus:text-critical data-[variant=destructive]:*:[svg]:text-icon-critical not-data-[variant=destructive]:focus:**:text-accent-foreground min-h-7 gap-2 rounded-md px-2 py-1 text-(length:--control-font-size) leading-relaxed [&_svg:not([class*='size-'])]:size-3.5 group/dropdown-menu-item relative flex cursor-default items-center outline-none select-none data-disabled:pointer-events-none data-disabled:opacity-disabled data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
89
89
|
FOCUS_RING,
|
|
90
90
|
className,
|
|
91
91
|
)}
|
|
@@ -111,7 +111,7 @@ function DropdownMenuSubTrigger({
|
|
|
111
111
|
data-slot="dropdown-menu-sub-trigger"
|
|
112
112
|
data-inset={inset}
|
|
113
113
|
className={cn(
|
|
114
|
-
"focus:bg-accent focus:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground min-h-7 gap-2 rounded-md px-2 py-1 text-xs [&_svg:not([class*='size-'])]:size-3.5 flex cursor-default items-center outline-none select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
114
|
+
"focus:bg-accent focus:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground min-h-7 gap-2 rounded-md px-2 py-1 text-(length:--control-font-size) leading-(--text-xs--line-height) [&_svg:not([class*='size-'])]:size-3.5 flex cursor-default items-center outline-none select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
115
115
|
FOCUS_RING,
|
|
116
116
|
className,
|
|
117
117
|
)}
|
|
@@ -157,7 +157,7 @@ function DropdownMenuCheckboxItem({
|
|
|
157
157
|
<MenuPrimitive.CheckboxItem
|
|
158
158
|
data-slot="dropdown-menu-checkbox-item"
|
|
159
159
|
className={cn(
|
|
160
|
-
"focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground min-h-7 gap-2 rounded-md py-1.5 pr-8 pl-2 text-xs [&_svg:not([class*='size-'])]:size-3.5 relative flex cursor-default items-center outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-disabled [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
160
|
+
"focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground min-h-7 gap-2 rounded-md py-1.5 pr-8 pl-2 text-(length:--control-font-size) leading-(--text-xs--line-height) [&_svg:not([class*='size-'])]:size-3.5 relative flex cursor-default items-center outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-disabled [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
161
161
|
FOCUS_RING,
|
|
162
162
|
className,
|
|
163
163
|
)}
|
|
@@ -186,7 +186,7 @@ function DropdownMenuRadioItem({ className, children, ...props }: MenuPrimitive.
|
|
|
186
186
|
<MenuPrimitive.RadioItem
|
|
187
187
|
data-slot="dropdown-menu-radio-item"
|
|
188
188
|
className={cn(
|
|
189
|
-
"focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground min-h-7 gap-2 rounded-md py-1.5 pr-8 pl-2 text-xs [&_svg:not([class*='size-'])]:size-3.5 relative flex cursor-default items-center outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-disabled [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
189
|
+
"focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground min-h-7 gap-2 rounded-md py-1.5 pr-8 pl-2 text-(length:--control-font-size) leading-(--text-xs--line-height) [&_svg:not([class*='size-'])]:size-3.5 relative flex cursor-default items-center outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-disabled [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
190
190
|
FOCUS_RING,
|
|
191
191
|
className,
|
|
192
192
|
)}
|
package/src/_internal/empty.tsx
CHANGED
|
@@ -59,7 +59,10 @@ function EmptyTitle({ className, ...props }: React.ComponentProps<'div'>) {
|
|
|
59
59
|
return (
|
|
60
60
|
<div
|
|
61
61
|
data-slot="empty-title"
|
|
62
|
-
className={cn(
|
|
62
|
+
className={cn(
|
|
63
|
+
'text-(length:--title-font-size) leading-(--title-line-height) font-medium tracking-tight',
|
|
64
|
+
className,
|
|
65
|
+
)}
|
|
63
66
|
{...props}
|
|
64
67
|
/>
|
|
65
68
|
)
|
|
@@ -70,7 +73,7 @@ function EmptyDescription({ className, ...props }: React.ComponentProps<'p'>) {
|
|
|
70
73
|
<div
|
|
71
74
|
data-slot="empty-description"
|
|
72
75
|
className={cn(
|
|
73
|
-
'text-
|
|
76
|
+
'text-(length:--body-font-size) leading-relaxed text-muted-foreground [&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4',
|
|
74
77
|
className,
|
|
75
78
|
)}
|
|
76
79
|
{...props}
|
|
@@ -83,7 +86,7 @@ function EmptyContent({ className, ...props }: React.ComponentProps<'div'>) {
|
|
|
83
86
|
<div
|
|
84
87
|
data-slot="empty-content"
|
|
85
88
|
className={cn(
|
|
86
|
-
'gap-2 text-
|
|
89
|
+
'gap-2 text-(length:--body-font-size) leading-relaxed flex w-full max-w-sm min-w-0 flex-col items-center text-balance',
|
|
87
90
|
className,
|
|
88
91
|
)}
|
|
89
92
|
{...props}
|
package/src/_internal/field.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { cva, type VariantProps } from 'class-variance-authority'
|
|
2
|
+
import { CircleAlertIcon } from 'lucide-react'
|
|
2
3
|
import { useMemo } from 'react'
|
|
3
4
|
import { Label } from './label'
|
|
4
5
|
import { Separator } from './separator'
|
|
@@ -27,7 +28,7 @@ function FieldLegend({
|
|
|
27
28
|
data-slot="field-legend"
|
|
28
29
|
data-variant={variant}
|
|
29
30
|
className={cn(
|
|
30
|
-
'mb-2 font-medium data-[variant=label]:text-
|
|
31
|
+
'mb-2 font-medium data-[variant=label]:text-(length:--label-font-size) data-[variant=label]:leading-relaxed data-[variant=label]:text-(color:--label-color) data-[variant=label]:[text-transform:var(--label-text-transform)] data-[variant=legend]:text-(length:--heading-font-size) data-[variant=legend]:leading-(--heading-line-height)',
|
|
31
32
|
className,
|
|
32
33
|
)}
|
|
33
34
|
{...props}
|
|
@@ -83,7 +84,7 @@ function FieldContent({ className, ...props }: React.ComponentProps<'div'>) {
|
|
|
83
84
|
return (
|
|
84
85
|
<div
|
|
85
86
|
data-slot="field-content"
|
|
86
|
-
className={cn('gap-
|
|
87
|
+
className={cn('gap-1.5 group/field-content flex flex-1 flex-col leading-snug', className)}
|
|
87
88
|
{...props}
|
|
88
89
|
/>
|
|
89
90
|
)
|
|
@@ -108,7 +109,7 @@ function FieldTitle({ className, ...props }: React.ComponentProps<'div'>) {
|
|
|
108
109
|
<div
|
|
109
110
|
data-slot="field-label"
|
|
110
111
|
className={cn(
|
|
111
|
-
'gap-2 text-
|
|
112
|
+
'gap-2 text-(length:--label-font-size) text-(color:--label-color) [text-transform:var(--label-text-transform)] group-data-[invalid=true]/field:text-critical font-medium group-data-[disabled=true]/field:opacity-disabled flex w-fit items-center leading-snug',
|
|
112
113
|
className,
|
|
113
114
|
)}
|
|
114
115
|
{...props}
|
|
@@ -121,8 +122,7 @@ function FieldDescription({ className, ...props }: React.ComponentProps<'p'>) {
|
|
|
121
122
|
<p
|
|
122
123
|
data-slot="field-description"
|
|
123
124
|
className={cn(
|
|
124
|
-
'text-muted-foreground text-left text-xs/relaxed [[data-variant=legend]+&]:-mt-1.5 leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance',
|
|
125
|
-
'last:mt-0 nth-last-2:-mt-1',
|
|
125
|
+
'text-muted-foreground group-data-[invalid=true]/field:text-critical text-left text-xs/relaxed [[data-variant=legend]+&]:-mt-1.5 leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance',
|
|
126
126
|
'[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4',
|
|
127
127
|
className,
|
|
128
128
|
)}
|
|
@@ -199,10 +199,14 @@ function FieldError({
|
|
|
199
199
|
<div
|
|
200
200
|
role="alert"
|
|
201
201
|
data-slot="field-error"
|
|
202
|
-
className={cn(
|
|
202
|
+
className={cn(
|
|
203
|
+
'text-critical text-xs/relaxed font-normal break-all flex items-start gap-1 [&>svg]:size-[1.25em] [&>svg]:shrink-0 [&>svg]:mt-[0.125em]',
|
|
204
|
+
className,
|
|
205
|
+
)}
|
|
203
206
|
{...props}
|
|
204
207
|
>
|
|
205
|
-
|
|
208
|
+
<CircleAlertIcon aria-hidden="true" />
|
|
209
|
+
<div className="min-w-0">{content}</div>
|
|
206
210
|
</div>
|
|
207
211
|
)
|
|
208
212
|
}
|
|
@@ -32,7 +32,7 @@ function HoverCardContent({
|
|
|
32
32
|
<HoverCardPrimitive.Popup
|
|
33
33
|
data-slot="hover-card-content"
|
|
34
34
|
className={cn(
|
|
35
|
-
'bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 rounded-lg p-4 text-
|
|
35
|
+
'bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 rounded-lg p-4 text-(length:--body-font-size) leading-(--body-line-height) shadow-md ring-[length:var(--border-width)] duration-fast z-popover w-80 origin-(--transform-origin) outline-hidden',
|
|
36
36
|
className,
|
|
37
37
|
)}
|
|
38
38
|
{...props}
|