@octanejs/shadcn 0.0.52 → 0.0.53
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/package.json +9 -9
- package/src/bases/base-ui/ui/accordion.tsrx +3 -1
- package/src/bases/base-ui/ui/alert-dialog.tsrx +6 -5
- package/src/bases/base-ui/ui/alert.tsrx +3 -2
- package/src/bases/base-ui/ui/aspect-ratio.tsrx +5 -3
- package/src/bases/base-ui/ui/badge.tsrx +2 -1
- package/src/bases/base-ui/ui/breadcrumb.tsrx +4 -4
- package/src/bases/base-ui/ui/button.tsrx +17 -10
- package/src/bases/base-ui/ui/context-menu.tsrx +37 -29
- package/src/bases/base-ui/ui/dialog.tsrx +6 -4
- package/src/bases/base-ui/ui/dropdown-menu.tsrx +37 -29
- package/src/bases/base-ui/ui/empty.tsrx +1 -1
- package/src/bases/base-ui/ui/field.tsrx +17 -11
- package/src/bases/base-ui/ui/hover-card.tsrx +15 -16
- package/src/bases/base-ui/ui/item.tsrx +3 -2
- package/src/bases/base-ui/ui/kbd.tsrx +1 -1
- package/src/bases/base-ui/ui/menubar.tsrx +38 -34
- package/src/bases/base-ui/ui/native-select.tsrx +3 -4
- package/src/bases/base-ui/ui/navigation-menu.tsrx +113 -87
- package/src/bases/base-ui/ui/pagination.tsrx +6 -2
- package/src/bases/base-ui/ui/popover.tsrx +15 -16
- package/src/bases/base-ui/ui/radio-group.tsrx +1 -3
- package/src/bases/base-ui/ui/scroll-area.tsrx +33 -27
- package/src/bases/base-ui/ui/select.tsrx +138 -106
- package/src/bases/base-ui/ui/sheet.tsrx +6 -4
- package/src/bases/base-ui/ui/sidebar.tsrx +65 -44
- package/src/bases/base-ui/ui/slider.tsrx +1 -3
- package/src/bases/base-ui/ui/tabs.tsrx +1 -1
- package/src/bases/base-ui/ui/toggle-group.tsrx +3 -3
- package/src/bases/base-ui/ui/toggle.tsrx +3 -2
- package/src/bases/base-ui/ui/tooltip.tsrx +17 -17
- package/src/bases/radix/ui/accordion.tsrx +3 -1
- package/src/bases/radix/ui/alert-dialog.tsrx +1 -1
- package/src/bases/radix/ui/alert.tsrx +15 -14
- package/src/bases/radix/ui/badge.tsrx +2 -1
- package/src/bases/radix/ui/button.tsrx +17 -10
- package/src/bases/radix/ui/context-menu.tsrx +20 -10
- package/src/bases/radix/ui/dropdown-menu.tsrx +16 -9
- package/src/bases/radix/ui/empty.tsrx +1 -1
- package/src/bases/radix/ui/field.tsrx +17 -11
- package/src/bases/radix/ui/item.tsrx +3 -2
- package/src/bases/radix/ui/menubar.tsrx +17 -14
- package/src/bases/radix/ui/native-select.tsrx +8 -8
- package/src/bases/radix/ui/navigation-menu.tsrx +2 -3
- package/src/bases/radix/ui/pagination.tsrx +6 -2
- package/src/bases/radix/ui/radio-group.tsrx +1 -3
- package/src/bases/radix/ui/scroll-area.tsrx +8 -2
- package/src/bases/radix/ui/select.tsrx +10 -5
- package/src/bases/radix/ui/sidebar.tsrx +61 -42
- package/src/bases/radix/ui/slider.tsrx +9 -7
- package/src/bases/radix/ui/tabs.tsrx +11 -5
- package/src/bases/radix/ui/toggle.tsrx +3 -2
- package/src/bases/radix/ui/tooltip.tsrx +2 -1
- package/src/bases/react-aria/ui/accordion.tsrx +58 -47
- package/src/bases/react-aria/ui/alert-dialog.tsrx +118 -92
- package/src/bases/react-aria/ui/alert.tsrx +39 -32
- package/src/bases/react-aria/ui/aspect-ratio.tsrx +12 -8
- package/src/bases/react-aria/ui/avatar.tsrx +73 -57
- package/src/bases/react-aria/ui/badge.tsrx +19 -12
- package/src/bases/react-aria/ui/breadcrumb.tsrx +66 -57
- package/src/bases/react-aria/ui/button.tsrx +17 -10
- package/src/bases/react-aria/ui/card.tsrx +63 -49
- package/src/bases/react-aria/ui/checkbox.tsrx +25 -19
- package/src/bases/react-aria/ui/dialog.tsrx +103 -83
- package/src/bases/react-aria/ui/empty.tsrx +58 -44
- package/src/bases/react-aria/ui/field.tsrx +142 -100
- package/src/bases/react-aria/ui/input.tsrx +2 -3
- package/src/bases/react-aria/ui/item.tsrx +98 -78
- package/src/bases/react-aria/ui/kbd.tsrx +1 -1
- package/src/bases/react-aria/ui/label.tsrx +12 -10
- package/src/bases/react-aria/ui/native-select.tsrx +38 -30
- package/src/bases/react-aria/ui/pagination.tsrx +76 -60
- package/src/bases/react-aria/ui/popover.tsrx +32 -22
- package/src/bases/react-aria/ui/radio-group.tsrx +30 -23
- package/src/bases/react-aria/ui/scroll-area.tsrx +12 -8
- package/src/bases/react-aria/ui/sheet.tsrx +92 -73
- package/src/bases/react-aria/ui/skeleton.tsrx +7 -5
- package/src/bases/react-aria/ui/slider.tsrx +44 -38
- package/src/bases/react-aria/ui/switch.tsrx +28 -20
- package/src/bases/react-aria/ui/table.tsrx +67 -51
- package/src/bases/react-aria/ui/tabs.tsrx +40 -31
- package/src/bases/react-aria/ui/textarea.tsrx +2 -3
- package/src/bases/react-aria/ui/toggle.tsrx +11 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@octanejs/shadcn",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.53",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -154,25 +154,25 @@
|
|
|
154
154
|
"./theme.css": "./src/styles/theme.css"
|
|
155
155
|
},
|
|
156
156
|
"dependencies": {
|
|
157
|
-
"@octanejs/aria": "0.0.
|
|
158
|
-
"@octanejs/base-ui": "0.1.
|
|
159
|
-
"@octanejs/lucide": "0.1.
|
|
160
|
-
"@octanejs/radix": "0.1.
|
|
161
|
-
"@octanejs/sonner": "0.1.
|
|
157
|
+
"@octanejs/aria": "0.0.60",
|
|
158
|
+
"@octanejs/base-ui": "0.1.64",
|
|
159
|
+
"@octanejs/lucide": "0.1.57",
|
|
160
|
+
"@octanejs/radix": "0.1.64",
|
|
161
|
+
"@octanejs/sonner": "0.1.58",
|
|
162
162
|
"class-variance-authority": "0.7.1",
|
|
163
163
|
"cn": "0.2.6"
|
|
164
164
|
},
|
|
165
165
|
"peerDependencies": {
|
|
166
|
-
"octane": "^0.
|
|
166
|
+
"octane": "^0.11.0"
|
|
167
167
|
},
|
|
168
168
|
"devDependencies": {
|
|
169
169
|
"@base-ui/react": "1.8.0",
|
|
170
|
-
"@tsrx/react": "^0.
|
|
170
|
+
"@tsrx/react": "^0.4.5",
|
|
171
171
|
"@types/react": "^19.2.17",
|
|
172
172
|
"clsx": "^2.1.1",
|
|
173
173
|
"esbuild": "^0.28.1",
|
|
174
174
|
"lucide-react": "1.24.0",
|
|
175
|
-
"octane": "0.
|
|
175
|
+
"octane": "0.11.0",
|
|
176
176
|
"radix-ui": "^1.6.4",
|
|
177
177
|
"react": "19.2.7",
|
|
178
178
|
"react-dom": "19.2.7",
|
|
@@ -66,6 +66,8 @@ export function AccordionContent({ className, children, ...props }: Record<strin
|
|
|
66
66
|
'h-(--accordion-panel-height) pt-0 pb-2.5 data-ending-style:h-0 data-starting-style:h-0 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4',
|
|
67
67
|
className,
|
|
68
68
|
)}
|
|
69
|
-
>
|
|
69
|
+
>
|
|
70
|
+
{children}
|
|
71
|
+
</div>
|
|
70
72
|
</AccordionPrimitive.Panel>
|
|
71
73
|
}
|
|
@@ -44,10 +44,11 @@ export function AlertDialogOverlay({ className, ...props }: Record<string, any>)
|
|
|
44
44
|
/>
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
export function AlertDialogContent({
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
export function AlertDialogContent({
|
|
48
|
+
className,
|
|
49
|
+
size = 'default',
|
|
50
|
+
...props
|
|
51
|
+
}: Record<string, any>) @{
|
|
51
52
|
<AlertDialogPortal>
|
|
52
53
|
<AlertDialogOverlay key="overlay" />
|
|
53
54
|
<AlertDialogPrimitive.Popup
|
|
@@ -89,7 +90,7 @@ export function AlertDialogMedia({ className, ...props }: DivProps) @{
|
|
|
89
90
|
<div
|
|
90
91
|
data-slot="alert-dialog-media"
|
|
91
92
|
className={cn(
|
|
92
|
-
|
|
93
|
+
"mb-2 inline-flex size-10 items-center justify-center rounded-md bg-muted sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-6",
|
|
93
94
|
className,
|
|
94
95
|
)}
|
|
95
96
|
{...props}
|
|
@@ -14,12 +14,13 @@ import { cn } from 'cn';
|
|
|
14
14
|
import type { DivProps } from '../../../lib/types';
|
|
15
15
|
|
|
16
16
|
export const alertVariants = cva(
|
|
17
|
-
|
|
17
|
+
"group/alert relative grid w-full gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4",
|
|
18
18
|
{
|
|
19
19
|
variants: {
|
|
20
20
|
variant: {
|
|
21
21
|
default: 'bg-card text-card-foreground',
|
|
22
|
-
destructive:
|
|
22
|
+
destructive:
|
|
23
|
+
'bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current',
|
|
23
24
|
},
|
|
24
25
|
},
|
|
25
26
|
defaultVariants: {
|
|
@@ -15,9 +15,11 @@ export interface AspectRatioProps extends DivProps {
|
|
|
15
15
|
export function AspectRatio({ ratio, className, ...props }: AspectRatioProps) @{
|
|
16
16
|
<div
|
|
17
17
|
data-slot="aspect-ratio"
|
|
18
|
-
style={
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
style={
|
|
19
|
+
{
|
|
20
|
+
'--ratio': ratio,
|
|
21
|
+
} as Record<string, string | number>
|
|
22
|
+
}
|
|
21
23
|
className={cn('relative aspect-(--ratio)', className)}
|
|
22
24
|
{...props}
|
|
23
25
|
/>
|
|
@@ -28,7 +28,8 @@ export const badgeVariants = cva(
|
|
|
28
28
|
variant: {
|
|
29
29
|
default: 'bg-primary text-primary-foreground [a]:hover:bg-primary/80',
|
|
30
30
|
secondary: 'bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80',
|
|
31
|
-
destructive:
|
|
31
|
+
destructive:
|
|
32
|
+
'bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20',
|
|
32
33
|
outline: 'border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground',
|
|
33
34
|
ghost: 'hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50',
|
|
34
35
|
link: 'text-primary underline-offset-4 hover:underline',
|
|
@@ -55,10 +55,10 @@ export function BreadcrumbItem({ className, ...props }: Props) @{
|
|
|
55
55
|
|
|
56
56
|
export interface BreadcrumbLinkProps extends Props {
|
|
57
57
|
/**
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
* NOT SUPPORTED in this base — see the header. Declared as `never` so markup carrying it over
|
|
59
|
+
* from the radix base fails to compile instead of silently rendering the anchor AND the child,
|
|
60
|
+
* which nests one link inside another.
|
|
61
|
+
*/
|
|
62
62
|
asChild?: never;
|
|
63
63
|
}
|
|
64
64
|
|
|
@@ -18,25 +18,32 @@ import { Button as ButtonPrimitive } from '@octanejs/base-ui/button';
|
|
|
18
18
|
import { cn } from 'cn';
|
|
19
19
|
|
|
20
20
|
export const buttonVariants = cva(
|
|
21
|
-
|
|
21
|
+
"group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
22
22
|
{
|
|
23
23
|
variants: {
|
|
24
24
|
variant: {
|
|
25
25
|
default: 'bg-primary text-primary-foreground hover:bg-primary/80',
|
|
26
|
-
outline:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
outline:
|
|
27
|
+
'border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50',
|
|
28
|
+
secondary:
|
|
29
|
+
'bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground',
|
|
30
|
+
ghost:
|
|
31
|
+
'hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50',
|
|
32
|
+
destructive:
|
|
33
|
+
'bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40',
|
|
30
34
|
link: 'text-primary underline-offset-4 hover:underline',
|
|
31
35
|
},
|
|
32
36
|
size: {
|
|
33
|
-
default:
|
|
34
|
-
|
|
35
|
-
|
|
37
|
+
default:
|
|
38
|
+
'h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',
|
|
39
|
+
xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
40
|
+
sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
|
|
36
41
|
lg: 'h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',
|
|
37
42
|
icon: 'size-8',
|
|
38
|
-
'icon-xs':
|
|
39
|
-
|
|
43
|
+
'icon-xs':
|
|
44
|
+
"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
|
|
45
|
+
'icon-sm':
|
|
46
|
+
'size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg',
|
|
40
47
|
'icon-lg': 'size-9',
|
|
41
48
|
},
|
|
42
49
|
},
|
|
@@ -31,22 +31,21 @@ import { cn } from 'cn';
|
|
|
31
31
|
type Props = { className?: string; children?: OctaneNode } & Record<string, unknown>;
|
|
32
32
|
|
|
33
33
|
/** Props routed to the Positioner rather than the popup. */
|
|
34
|
-
export type BaseUiPositioningProps =
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
>;
|
|
34
|
+
export type BaseUiPositioningProps = Pick<
|
|
35
|
+
ContextMenuPrimitive.Positioner.Props,
|
|
36
|
+
| 'side'
|
|
37
|
+
| 'sideOffset'
|
|
38
|
+
| 'align'
|
|
39
|
+
| 'alignOffset'
|
|
40
|
+
| 'anchor'
|
|
41
|
+
| 'positionMethod'
|
|
42
|
+
| 'collisionBoundary'
|
|
43
|
+
| 'collisionPadding'
|
|
44
|
+
| 'collisionAvoidance'
|
|
45
|
+
| 'arrowPadding'
|
|
46
|
+
| 'sticky'
|
|
47
|
+
| 'disableAnchorTracking'
|
|
48
|
+
>;
|
|
50
49
|
|
|
51
50
|
export function ContextMenu(props: Record<string, unknown>) @{
|
|
52
51
|
<ContextMenuPrimitive.Root data-slot="context-menu" {...props} />
|
|
@@ -119,7 +118,12 @@ export function ContextMenuContent({
|
|
|
119
118
|
</ContextMenuPrimitive.Portal>
|
|
120
119
|
}
|
|
121
120
|
|
|
122
|
-
export function ContextMenuItem({
|
|
121
|
+
export function ContextMenuItem({
|
|
122
|
+
className,
|
|
123
|
+
inset,
|
|
124
|
+
variant = 'default',
|
|
125
|
+
...props
|
|
126
|
+
}: Props & {
|
|
123
127
|
inset?: boolean;
|
|
124
128
|
variant?: 'default' | 'destructive';
|
|
125
129
|
}) @{
|
|
@@ -128,7 +132,7 @@ export function ContextMenuItem({ className, inset, variant = 'default', ...prop
|
|
|
128
132
|
data-inset={inset}
|
|
129
133
|
data-variant={variant}
|
|
130
134
|
className={cn(
|
|
131
|
-
|
|
135
|
+
"group/context-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 focus:*:[svg]:text-accent-foreground data-[variant=destructive]:*:[svg]:text-destructive",
|
|
132
136
|
className,
|
|
133
137
|
)}
|
|
134
138
|
{...props}
|
|
@@ -142,7 +146,7 @@ export function ContextMenuSubTrigger(props: Props & { inset?: boolean }) @{
|
|
|
142
146
|
data-slot="context-menu-sub-trigger"
|
|
143
147
|
data-inset={inset}
|
|
144
148
|
className={cn(
|
|
145
|
-
|
|
149
|
+
"flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-popup-open:bg-accent data-popup-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
146
150
|
className,
|
|
147
151
|
)}
|
|
148
152
|
{...rest}
|
|
@@ -195,17 +199,19 @@ export function ContextMenuSubContent({
|
|
|
195
199
|
</ContextMenuPrimitive.Portal>
|
|
196
200
|
}
|
|
197
201
|
|
|
198
|
-
export function ContextMenuCheckboxItem(
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
+
export function ContextMenuCheckboxItem(
|
|
203
|
+
props: Props & {
|
|
204
|
+
checked?: boolean;
|
|
205
|
+
inset?: boolean;
|
|
206
|
+
},
|
|
207
|
+
) @{
|
|
202
208
|
const { className, children: _children, checked, inset, ...rest } = props;
|
|
203
209
|
|
|
204
210
|
<ContextMenuPrimitive.CheckboxItem
|
|
205
211
|
data-slot="context-menu-checkbox-item"
|
|
206
212
|
data-inset={inset}
|
|
207
213
|
className={cn(
|
|
208
|
-
|
|
214
|
+
"relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
209
215
|
className,
|
|
210
216
|
)}
|
|
211
217
|
checked={checked}
|
|
@@ -223,17 +229,19 @@ export function ContextMenuCheckboxItem(props: Props & {
|
|
|
223
229
|
</ContextMenuPrimitive.CheckboxItem>
|
|
224
230
|
}
|
|
225
231
|
|
|
226
|
-
export function ContextMenuRadioItem(
|
|
227
|
-
ContextMenuPrimitive.RadioItem.Props,
|
|
228
|
-
|
|
229
|
-
|
|
232
|
+
export function ContextMenuRadioItem(
|
|
233
|
+
props: Omit<ContextMenuPrimitive.RadioItem.Props, 'className'> & {
|
|
234
|
+
className?: string;
|
|
235
|
+
inset?: boolean;
|
|
236
|
+
},
|
|
237
|
+
) @{
|
|
230
238
|
const { className, children: _children, inset, ...rest } = props;
|
|
231
239
|
|
|
232
240
|
<ContextMenuPrimitive.RadioItem
|
|
233
241
|
data-slot="context-menu-radio-item"
|
|
234
242
|
data-inset={inset}
|
|
235
243
|
className={cn(
|
|
236
|
-
|
|
244
|
+
"relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
237
245
|
className,
|
|
238
246
|
)}
|
|
239
247
|
{...rest}
|
|
@@ -72,10 +72,12 @@ export function DialogContent({
|
|
|
72
72
|
<DialogPrimitive.Close
|
|
73
73
|
data-slot="dialog-close"
|
|
74
74
|
className="absolute top-2 right-2"
|
|
75
|
-
render={
|
|
76
|
-
<
|
|
77
|
-
|
|
78
|
-
|
|
75
|
+
render={
|
|
76
|
+
<Button variant="ghost" size="icon-sm">
|
|
77
|
+
<XIcon />
|
|
78
|
+
<span className="sr-only">Close</span>
|
|
79
|
+
</Button>
|
|
80
|
+
}
|
|
79
81
|
/>
|
|
80
82
|
}
|
|
81
83
|
</DialogPrimitive.Popup>
|
|
@@ -58,22 +58,21 @@ export function DropdownMenuTrigger(props: Record<string, unknown>) @{
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
/** Props routed to the Positioner rather than the popup. */
|
|
61
|
-
export type BaseUiPositioningProps =
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
>;
|
|
61
|
+
export type BaseUiPositioningProps = Pick<
|
|
62
|
+
MenuPrimitive.Positioner.Props,
|
|
63
|
+
| 'side'
|
|
64
|
+
| 'sideOffset'
|
|
65
|
+
| 'align'
|
|
66
|
+
| 'alignOffset'
|
|
67
|
+
| 'anchor'
|
|
68
|
+
| 'positionMethod'
|
|
69
|
+
| 'collisionBoundary'
|
|
70
|
+
| 'collisionPadding'
|
|
71
|
+
| 'collisionAvoidance'
|
|
72
|
+
| 'arrowPadding'
|
|
73
|
+
| 'sticky'
|
|
74
|
+
| 'disableAnchorTracking'
|
|
75
|
+
>;
|
|
77
76
|
|
|
78
77
|
export interface DropdownMenuContentProps extends Props, BaseUiPositioningProps {}
|
|
79
78
|
|
|
@@ -124,7 +123,12 @@ export function DropdownMenuGroup(props: Record<string, unknown>) @{
|
|
|
124
123
|
<MenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />
|
|
125
124
|
}
|
|
126
125
|
|
|
127
|
-
export function DropdownMenuItem({
|
|
126
|
+
export function DropdownMenuItem({
|
|
127
|
+
className,
|
|
128
|
+
inset,
|
|
129
|
+
variant = 'default',
|
|
130
|
+
...props
|
|
131
|
+
}: Props & {
|
|
128
132
|
inset?: boolean;
|
|
129
133
|
variant?: 'default' | 'destructive';
|
|
130
134
|
}) @{
|
|
@@ -133,24 +137,26 @@ export function DropdownMenuItem({ className, inset, variant = 'default', ...pro
|
|
|
133
137
|
data-inset={inset}
|
|
134
138
|
data-variant={variant}
|
|
135
139
|
className={cn(
|
|
136
|
-
|
|
140
|
+
"group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",
|
|
137
141
|
className,
|
|
138
142
|
)}
|
|
139
143
|
{...props}
|
|
140
144
|
/>
|
|
141
145
|
}
|
|
142
146
|
|
|
143
|
-
export function DropdownMenuCheckboxItem(
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
+
export function DropdownMenuCheckboxItem(
|
|
148
|
+
props: Props & {
|
|
149
|
+
checked?: boolean;
|
|
150
|
+
inset?: boolean;
|
|
151
|
+
},
|
|
152
|
+
) @{
|
|
147
153
|
const { className, children: _children, checked, inset, ...rest } = props;
|
|
148
154
|
|
|
149
155
|
<MenuPrimitive.CheckboxItem
|
|
150
156
|
data-slot="dropdown-menu-checkbox-item"
|
|
151
157
|
data-inset={inset}
|
|
152
158
|
className={cn(
|
|
153
|
-
|
|
159
|
+
"relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
154
160
|
className,
|
|
155
161
|
)}
|
|
156
162
|
checked={checked}
|
|
@@ -172,17 +178,19 @@ export function DropdownMenuRadioGroup(props: Record<string, unknown>) @{
|
|
|
172
178
|
<MenuPrimitive.RadioGroup data-slot="dropdown-menu-radio-group" {...props} />
|
|
173
179
|
}
|
|
174
180
|
|
|
175
|
-
export function DropdownMenuRadioItem(
|
|
176
|
-
className
|
|
177
|
-
|
|
178
|
-
|
|
181
|
+
export function DropdownMenuRadioItem(
|
|
182
|
+
props: Omit<MenuPrimitive.RadioItem.Props, 'className'> & {
|
|
183
|
+
className?: string;
|
|
184
|
+
inset?: boolean;
|
|
185
|
+
},
|
|
186
|
+
) @{
|
|
179
187
|
const { className, children: _children, inset, ...rest } = props;
|
|
180
188
|
|
|
181
189
|
<MenuPrimitive.RadioItem
|
|
182
190
|
data-slot="dropdown-menu-radio-item"
|
|
183
191
|
data-inset={inset}
|
|
184
192
|
className={cn(
|
|
185
|
-
|
|
193
|
+
"relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
186
194
|
className,
|
|
187
195
|
)}
|
|
188
196
|
{...rest}
|
|
@@ -243,7 +251,7 @@ export function DropdownMenuSubTrigger(props: Props & { inset?: boolean }) @{
|
|
|
243
251
|
data-slot="dropdown-menu-sub-trigger"
|
|
244
252
|
data-inset={inset}
|
|
245
253
|
className={cn(
|
|
246
|
-
|
|
254
|
+
"flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-popup-open:bg-accent data-popup-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
247
255
|
className,
|
|
248
256
|
)}
|
|
249
257
|
{...rest}
|
|
@@ -33,7 +33,7 @@ export const emptyMediaVariants = cva(
|
|
|
33
33
|
variants: {
|
|
34
34
|
variant: {
|
|
35
35
|
default: 'bg-transparent',
|
|
36
|
-
icon:
|
|
36
|
+
icon: "flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-4",
|
|
37
37
|
},
|
|
38
38
|
},
|
|
39
39
|
defaultVariants: {
|
|
@@ -36,7 +36,11 @@ export function FieldSet({ className, ...props }: Props) @{
|
|
|
36
36
|
/>
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
export function FieldLegend({
|
|
39
|
+
export function FieldLegend({
|
|
40
|
+
className,
|
|
41
|
+
variant = 'legend',
|
|
42
|
+
...props
|
|
43
|
+
}: Props & {
|
|
40
44
|
variant?: 'legend' | 'label';
|
|
41
45
|
}) @{
|
|
42
46
|
<legend
|
|
@@ -67,8 +71,10 @@ export const fieldVariants = cva(
|
|
|
67
71
|
variants: {
|
|
68
72
|
orientation: {
|
|
69
73
|
vertical: 'flex-col *:w-full [&>.sr-only]:w-auto',
|
|
70
|
-
horizontal:
|
|
71
|
-
|
|
74
|
+
horizontal:
|
|
75
|
+
'flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px',
|
|
76
|
+
responsive:
|
|
77
|
+
'flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px',
|
|
72
78
|
},
|
|
73
79
|
},
|
|
74
80
|
defaultVariants: {
|
|
@@ -77,7 +83,11 @@ export const fieldVariants = cva(
|
|
|
77
83
|
},
|
|
78
84
|
);
|
|
79
85
|
|
|
80
|
-
export function Field({
|
|
86
|
+
export function Field({
|
|
87
|
+
className,
|
|
88
|
+
orientation = 'vertical',
|
|
89
|
+
...props
|
|
90
|
+
}: Props & {
|
|
81
91
|
orientation?: VariantProps<typeof fieldVariants>['orientation'];
|
|
82
92
|
}) @{
|
|
83
93
|
<div
|
|
@@ -169,19 +179,15 @@ export function FieldError(props: Props & { errors?: Array<{ message?: string }
|
|
|
169
179
|
const errors = props.errors;
|
|
170
180
|
if (!errors?.length) return null;
|
|
171
181
|
|
|
172
|
-
const uniqueErrors = [
|
|
173
|
-
...new Map(errors.map((error) => [error?.message, error])).values(),
|
|
174
|
-
];
|
|
182
|
+
const uniqueErrors = [...new Map(errors.map((error) => [error?.message, error])).values()];
|
|
175
183
|
|
|
176
184
|
if (uniqueErrors?.length == 1) return uniqueErrors[0]?.message;
|
|
177
185
|
|
|
178
186
|
return createElement(
|
|
179
187
|
'ul',
|
|
180
188
|
{ className: 'ml-4 flex list-disc flex-col gap-1' },
|
|
181
|
-
uniqueErrors.map(
|
|
182
|
-
(
|
|
183
|
-
? createElement('li', { key: index }, error.message)
|
|
184
|
-
: null,
|
|
189
|
+
uniqueErrors.map((error, index) =>
|
|
190
|
+
error?.message ? createElement('li', { key: index }, error.message) : null,
|
|
185
191
|
),
|
|
186
192
|
);
|
|
187
193
|
});
|
|
@@ -29,22 +29,21 @@ import { PreviewCard as PreviewCardPrimitive } from '@octanejs/base-ui/preview-c
|
|
|
29
29
|
import { cn } from 'cn';
|
|
30
30
|
|
|
31
31
|
/** Props routed to the Positioner rather than the popup. */
|
|
32
|
-
export type BaseUiPositioningProps =
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
>;
|
|
32
|
+
export type BaseUiPositioningProps = Pick<
|
|
33
|
+
PreviewCardPrimitive.Positioner.Props,
|
|
34
|
+
| 'side'
|
|
35
|
+
| 'sideOffset'
|
|
36
|
+
| 'align'
|
|
37
|
+
| 'alignOffset'
|
|
38
|
+
| 'anchor'
|
|
39
|
+
| 'positionMethod'
|
|
40
|
+
| 'collisionBoundary'
|
|
41
|
+
| 'collisionPadding'
|
|
42
|
+
| 'collisionAvoidance'
|
|
43
|
+
| 'arrowPadding'
|
|
44
|
+
| 'sticky'
|
|
45
|
+
| 'disableAnchorTracking'
|
|
46
|
+
>;
|
|
48
47
|
|
|
49
48
|
export function HoverCard(props: Record<string, unknown>) @{
|
|
50
49
|
<PreviewCardPrimitive.Root data-slot="hover-card" {...props} />
|
|
@@ -85,8 +85,9 @@ export const itemMediaVariants = cva(
|
|
|
85
85
|
variants: {
|
|
86
86
|
variant: {
|
|
87
87
|
default: 'bg-transparent',
|
|
88
|
-
icon:
|
|
89
|
-
image:
|
|
88
|
+
icon: "[&_svg:not([class*='size-'])]:size-4",
|
|
89
|
+
image:
|
|
90
|
+
'size-10 overflow-hidden rounded-sm group-data-[size=sm]/item:size-8 group-data-[size=xs]/item:size-6 [&_img]:size-full [&_img]:object-cover',
|
|
90
91
|
},
|
|
91
92
|
},
|
|
92
93
|
defaultVariants: {
|
|
@@ -11,7 +11,7 @@ export function Kbd({ className, ...props }: HostProps<'kbd'>) @{
|
|
|
11
11
|
<kbd
|
|
12
12
|
data-slot="kbd"
|
|
13
13
|
className={cn(
|
|
14
|
-
|
|
14
|
+
"pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm bg-muted px-1 font-sans text-xs font-medium text-muted-foreground select-none in-data-[slot=tooltip-content]:bg-background/20 in-data-[slot=tooltip-content]:text-background dark:in-data-[slot=tooltip-content]:bg-background/10 [&_svg:not([class*='size-'])]:size-3",
|
|
15
15
|
className,
|
|
16
16
|
)}
|
|
17
17
|
{...props}
|