@foundrykit/primitives 2.0.8 → 2.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/{chunk-D4X2ZO5T.js → chunk-2SBGU5XA.js} +2 -2
  3. package/dist/{chunk-3MEIDBWZ.js → chunk-3QUMCM5K.js} +2 -2
  4. package/dist/{chunk-5OSYIETI.js → chunk-FRIOQFPE.js} +1 -1
  5. package/dist/{chunk-EDKSYP4L.js → chunk-G2YBCHWR.js} +1 -1
  6. package/dist/{chunk-DKBMAFIR.js → chunk-GKCBSG2W.js} +2 -0
  7. package/dist/chunk-HS46TIMU.js +75 -0
  8. package/dist/{chunk-R3IEOV2B.js → chunk-P5KEJOBH.js} +1 -1
  9. package/dist/{chunk-FIRYLO5W.js → chunk-SDYKJVXX.js} +2 -2
  10. package/dist/{chunk-2PXD7LAX.js → chunk-U7JIOR7A.js} +3 -3
  11. package/dist/{chunk-VA4MKQN7.js → chunk-W4XY3SNY.js} +1 -1
  12. package/dist/chunk-XCPGTXEJ.js +23 -0
  13. package/dist/components/alert-dialog/index.cjs +1 -1
  14. package/dist/components/alert-dialog/index.js +1 -1
  15. package/dist/components/card/index.cjs +63 -61
  16. package/dist/components/card/index.d.cts +8 -7
  17. package/dist/components/card/index.d.ts +8 -7
  18. package/dist/components/card/index.js +1 -1
  19. package/dist/components/context-menu/index.cjs +2 -2
  20. package/dist/components/context-menu/index.js +1 -1
  21. package/dist/components/dropdown/index.cjs +2 -2
  22. package/dist/components/dropdown/index.js +1 -1
  23. package/dist/components/hover-card/index.cjs +1 -1
  24. package/dist/components/hover-card/index.js +1 -1
  25. package/dist/components/input/index.cjs +16 -28
  26. package/dist/components/input/index.d.cts +6 -5
  27. package/dist/components/input/index.d.ts +6 -5
  28. package/dist/components/input/index.js +1 -1
  29. package/dist/components/menubar/index.cjs +2 -2
  30. package/dist/components/menubar/index.js +1 -1
  31. package/dist/components/navigation-menu/index.cjs +3 -3
  32. package/dist/components/navigation-menu/index.js +1 -1
  33. package/dist/components/popover/index.cjs +1 -1
  34. package/dist/components/popover/index.js +1 -1
  35. package/dist/components/select/index.cjs +1 -1
  36. package/dist/components/select/index.js +1 -1
  37. package/dist/components/slider/index.cjs +2 -0
  38. package/dist/components/slider/index.d.cts +3 -2
  39. package/dist/components/slider/index.d.ts +3 -2
  40. package/dist/components/slider/index.js +1 -1
  41. package/dist/index.cjs +107 -95
  42. package/dist/index.js +23 -23
  43. package/package.json +1 -1
  44. package/src/components/alert-dialog/index.tsx +1 -1
  45. package/src/components/card/index.tsx +59 -67
  46. package/src/components/context-menu/index.tsx +2 -2
  47. package/src/components/dialog/index.tsx +1 -1
  48. package/src/components/dropdown/index.tsx +2 -2
  49. package/src/components/hover-card/index.tsx +1 -1
  50. package/src/components/input/index.tsx +20 -21
  51. package/src/components/menubar/index.tsx +2 -2
  52. package/src/components/navigation-menu/index.tsx +3 -3
  53. package/src/components/popover/index.tsx +1 -1
  54. package/src/components/select/index.tsx +1 -1
  55. package/src/components/sheet/index.tsx +4 -4
  56. package/src/components/slider/index.tsx +4 -1
  57. package/src/components/tooltip/index.tsx +1 -1
  58. package/.turbo/turbo-build.log +0 -235
  59. package/.turbo/turbo-type-check.log +0 -4
  60. package/dist/chunk-DFGLEAZI.js +0 -63
  61. package/dist/chunk-RDQF3IQE.js +0 -25
@@ -1,10 +1,10 @@
1
1
  import { cn } from '@foundrykit/utils';
2
- import * as React from 'react';
2
+ import type * as React from 'react';
3
3
 
4
4
  /**
5
5
  * Bordered, rounded surface container for grouping related content. Compose with
6
6
  * {@link CardHeader}, {@link CardTitle}, {@link CardDescription},
7
- * {@link CardContent} and {@link CardFooter}. Forwards its ref to the root `<div>`.
7
+ * {@link CardContent} and {@link CardFooter}.
8
8
  *
9
9
  * @example
10
10
  * ```tsx
@@ -17,76 +17,68 @@ import * as React from 'react';
17
17
  * </Card>
18
18
  * ```
19
19
  */
20
- const Card = React.forwardRef<
21
- HTMLDivElement,
22
- React.HTMLAttributes<HTMLDivElement>
23
- >(({ className, ...props }, ref) => (
24
- <div
25
- ref={ref}
26
- className={cn(
27
- 'bg-card text-card-foreground rounded-xl border shadow',
28
- className
29
- )}
30
- {...props}
31
- />
32
- ));
33
- Card.displayName = 'Card';
20
+ function Card({ className, ...props }: React.ComponentProps<'div'>) {
21
+ return (
22
+ <div
23
+ data-slot='card'
24
+ className={cn(
25
+ 'bg-card text-card-foreground rounded-xl border shadow',
26
+ className
27
+ )}
28
+ {...props}
29
+ />
30
+ );
31
+ }
34
32
 
35
- const CardHeader = React.forwardRef<
36
- HTMLDivElement,
37
- React.HTMLAttributes<HTMLDivElement>
38
- >(({ className, ...props }, ref) => (
39
- <div
40
- ref={ref}
41
- className={cn('flex flex-col space-y-1.5 p-6', className)}
42
- {...props}
43
- />
44
- ));
45
- CardHeader.displayName = 'CardHeader';
33
+ function CardHeader({ className, ...props }: React.ComponentProps<'div'>) {
34
+ return (
35
+ <div
36
+ data-slot='card-header'
37
+ className={cn('flex flex-col space-y-1.5 p-6', className)}
38
+ {...props}
39
+ />
40
+ );
41
+ }
46
42
 
47
- const CardTitle = React.forwardRef<
48
- HTMLParagraphElement,
49
- React.HTMLAttributes<HTMLHeadingElement>
50
- >(({ className, ...props }, ref) => (
51
- <h3
52
- ref={ref}
53
- className={cn('leading-none font-semibold tracking-tight', className)}
54
- {...props}
55
- />
56
- ));
57
- CardTitle.displayName = 'CardTitle';
43
+ function CardTitle({ className, ...props }: React.ComponentProps<'h3'>) {
44
+ return (
45
+ <h3
46
+ data-slot='card-title'
47
+ className={cn('leading-none font-semibold tracking-tight', className)}
48
+ {...props}
49
+ />
50
+ );
51
+ }
58
52
 
59
- const CardDescription = React.forwardRef<
60
- HTMLParagraphElement,
61
- React.HTMLAttributes<HTMLParagraphElement>
62
- >(({ className, ...props }, ref) => (
63
- <p
64
- ref={ref}
65
- className={cn('text-muted-foreground text-sm', className)}
66
- {...props}
67
- />
68
- ));
69
- CardDescription.displayName = 'CardDescription';
53
+ function CardDescription({ className, ...props }: React.ComponentProps<'p'>) {
54
+ return (
55
+ <p
56
+ data-slot='card-description'
57
+ className={cn('text-muted-foreground text-sm', className)}
58
+ {...props}
59
+ />
60
+ );
61
+ }
70
62
 
71
- const CardContent = React.forwardRef<
72
- HTMLDivElement,
73
- React.HTMLAttributes<HTMLDivElement>
74
- >(({ className, ...props }, ref) => (
75
- <div ref={ref} className={cn('p-6 pt-0', className)} {...props} />
76
- ));
77
- CardContent.displayName = 'CardContent';
63
+ function CardContent({ className, ...props }: React.ComponentProps<'div'>) {
64
+ return (
65
+ <div
66
+ data-slot='card-content'
67
+ className={cn('p-6 pt-0', className)}
68
+ {...props}
69
+ />
70
+ );
71
+ }
78
72
 
79
- const CardFooter = React.forwardRef<
80
- HTMLDivElement,
81
- React.HTMLAttributes<HTMLDivElement>
82
- >(({ className, ...props }, ref) => (
83
- <div
84
- ref={ref}
85
- className={cn('flex items-center p-6 pt-0', className)}
86
- {...props}
87
- />
88
- ));
89
- CardFooter.displayName = 'CardFooter';
73
+ function CardFooter({ className, ...props }: React.ComponentProps<'div'>) {
74
+ return (
75
+ <div
76
+ data-slot='card-footer'
77
+ className={cn('flex items-center p-6 pt-0', className)}
78
+ {...props}
79
+ />
80
+ );
81
+ }
90
82
 
91
83
  export {
92
84
  Card,
@@ -104,7 +104,7 @@ function ContextMenuSubContent({
104
104
  <ContextMenuPrimitive.SubContent
105
105
  data-slot='context-menu-sub-content'
106
106
  className={cn(
107
- 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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 z-50 min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg',
107
+ 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[state=open]:zoom-in-95 motion-safe:data-[side=bottom]:slide-in-from-top-2 motion-safe:data-[side=left]:slide-in-from-right-2 motion-safe:data-[side=right]:slide-in-from-left-2 motion-safe:data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg',
108
108
  className
109
109
  )}
110
110
  {...props}
@@ -121,7 +121,7 @@ function ContextMenuContent({
121
121
  <ContextMenuPrimitive.Content
122
122
  data-slot='context-menu-content'
123
123
  className={cn(
124
- 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md',
124
+ 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[state=open]:zoom-in-95 motion-safe:data-[side=bottom]:slide-in-from-top-2 motion-safe:data-[side=left]:slide-in-from-right-2 motion-safe:data-[side=right]:slide-in-from-left-2 motion-safe:data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md',
125
125
  className
126
126
  )}
127
127
  {...props}
@@ -79,7 +79,7 @@ function DialogContent({
79
79
  <DialogPrimitive.Content
80
80
  data-slot='dialog-content'
81
81
  className={cn(
82
- 'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg',
82
+ 'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg',
83
83
  className
84
84
  )}
85
85
  {...props}
@@ -61,7 +61,7 @@ function DropdownMenuContent({
61
61
  data-slot='dropdown-menu-content'
62
62
  sideOffset={sideOffset}
63
63
  className={cn(
64
- 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md',
64
+ 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[state=open]:zoom-in-95 motion-safe:data-[side=bottom]:slide-in-from-top-2 motion-safe:data-[side=left]:slide-in-from-right-2 motion-safe:data-[side=right]:slide-in-from-left-2 motion-safe:data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md',
65
65
  className
66
66
  )}
67
67
  {...props}
@@ -253,7 +253,7 @@ function DropdownMenuSubContent({
253
253
  <DropdownMenuPrimitive.SubContent
254
254
  data-slot='dropdown-menu-sub-content'
255
255
  className={cn(
256
- 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg',
256
+ 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[state=open]:zoom-in-95 motion-safe:data-[side=bottom]:slide-in-from-top-2 motion-safe:data-[side=left]:slide-in-from-right-2 motion-safe:data-[side=right]:slide-in-from-left-2 motion-safe:data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg',
257
257
  className
258
258
  )}
259
259
  {...props}
@@ -44,7 +44,7 @@ function HoverCardContent({
44
44
  align={align}
45
45
  sideOffset={sideOffset}
46
46
  className={cn(
47
- 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden',
47
+ 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[state=open]:zoom-in-95 motion-safe:data-[side=bottom]:slide-in-from-top-2 motion-safe:data-[side=left]:slide-in-from-right-2 motion-safe:data-[side=right]:slide-in-from-left-2 motion-safe:data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden',
48
48
  className
49
49
  )}
50
50
  {...props}
@@ -1,33 +1,32 @@
1
1
  import { cn } from '@foundrykit/utils';
2
- import * as React from 'react';
2
+ import type * as React from 'react';
3
3
 
4
- export type InputProps = React.InputHTMLAttributes<HTMLInputElement>;
4
+ export type InputProps = React.ComponentProps<'input'>;
5
5
 
6
6
  /**
7
- * Styled text input wrapping the native `<input>`; forwards its ref and accepts
8
- * all standard input attributes (including `type`). Includes focus-ring and
9
- * disabled styling.
7
+ * Styled text input wrapping the native `<input>`; accepts all standard input
8
+ * attributes (including `type` and `ref`). Includes focus-ring, disabled and
9
+ * `aria-invalid` styling.
10
10
  *
11
11
  * @example
12
12
  * ```tsx
13
13
  * <Input type="email" placeholder="you@example.com" />
14
14
  * ```
15
15
  */
16
- const Input = React.forwardRef<HTMLInputElement, InputProps>(
17
- ({ className, type, ...props }, ref) => {
18
- return (
19
- <input
20
- type={type}
21
- className={cn(
22
- 'border-input file:text-foreground placeholder:text-muted-foreground focus-visible:ring-ring flex h-9 w-full rounded-md border bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:ring-1 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50',
23
- className
24
- )}
25
- ref={ref}
26
- {...props}
27
- />
28
- );
29
- }
30
- );
31
- Input.displayName = 'Input';
16
+ function Input({ className, type, ...props }: InputProps) {
17
+ return (
18
+ <input
19
+ type={type}
20
+ data-slot='input'
21
+ className={cn(
22
+ 'border-input file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm',
23
+ 'focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]',
24
+ 'aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive',
25
+ className
26
+ )}
27
+ {...props}
28
+ />
29
+ );
30
+ }
32
31
 
33
32
  export { Input };
@@ -98,7 +98,7 @@ function MenubarContent({
98
98
  alignOffset={alignOffset}
99
99
  sideOffset={sideOffset}
100
100
  className={cn(
101
- 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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 z-50 min-w-[12rem] origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-md',
101
+ 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[state=open]:zoom-in-95 motion-safe:data-[side=bottom]:slide-in-from-top-2 motion-safe:data-[side=left]:slide-in-from-right-2 motion-safe:data-[side=right]:slide-in-from-left-2 motion-safe:data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[12rem] origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-md',
102
102
  className
103
103
  )}
104
104
  {...props}
@@ -267,7 +267,7 @@ function MenubarSubContent({
267
267
  <MenubarPrimitive.SubContent
268
268
  data-slot='menubar-sub-content'
269
269
  className={cn(
270
- 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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 z-50 min-w-[8rem] origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg',
270
+ 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[state=open]:zoom-in-95 motion-safe:data-[side=bottom]:slide-in-from-top-2 motion-safe:data-[side=left]:slide-in-from-right-2 motion-safe:data-[side=right]:slide-in-from-left-2 motion-safe:data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg',
271
271
  className
272
272
  )}
273
273
  {...props}
@@ -110,8 +110,8 @@ function NavigationMenuContent({
110
110
  <NavigationMenuPrimitive.Content
111
111
  data-slot='navigation-menu-content'
112
112
  className={cn(
113
- 'data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 top-0 left-0 w-full p-2 pr-2.5 md:absolute md:w-auto',
114
- 'group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:data-[state=open]:animate-in group-data-[viewport=false]/navigation-menu:data-[state=closed]:animate-out group-data-[viewport=false]/navigation-menu:data-[state=closed]:zoom-out-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:zoom-in-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0 group-data-[viewport=false]/navigation-menu:data-[state=closed]:fade-out-0 group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-1.5 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-md group-data-[viewport=false]/navigation-menu:border group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=false]/navigation-menu:duration-200 **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-none',
113
+ 'data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out motion-safe:data-[motion=from-end]:slide-in-from-right-52 motion-safe:data-[motion=from-start]:slide-in-from-left-52 motion-safe:data-[motion=to-end]:slide-out-to-right-52 motion-safe:data-[motion=to-start]:slide-out-to-left-52 top-0 left-0 w-full p-2 pr-2.5 md:absolute md:w-auto',
114
+ 'group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:data-[state=open]:animate-in group-data-[viewport=false]/navigation-menu:data-[state=closed]:animate-out motion-safe:group-data-[viewport=false]/navigation-menu:data-[state=closed]:zoom-out-95 motion-safe:group-data-[viewport=false]/navigation-menu:data-[state=open]:zoom-in-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0 group-data-[viewport=false]/navigation-menu:data-[state=closed]:fade-out-0 group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-1.5 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-md group-data-[viewport=false]/navigation-menu:border group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=false]/navigation-menu:duration-200',
115
115
  className
116
116
  )}
117
117
  {...props}
@@ -132,7 +132,7 @@ function NavigationMenuViewport({
132
132
  <NavigationMenuPrimitive.Viewport
133
133
  data-slot='navigation-menu-viewport'
134
134
  className={cn(
135
- 'origin-top-center bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border shadow md:w-[var(--radix-navigation-menu-viewport-width)]',
135
+ 'origin-top-center bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[state=open]:zoom-in-90 relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border shadow md:w-[var(--radix-navigation-menu-viewport-width)]',
136
136
  className
137
137
  )}
138
138
  {...props}
@@ -42,7 +42,7 @@ function PopoverContent({
42
42
  align={align}
43
43
  sideOffset={sideOffset}
44
44
  className={cn(
45
- 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden',
45
+ 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[state=open]:zoom-in-95 motion-safe:data-[side=bottom]:slide-in-from-top-2 motion-safe:data-[side=left]:slide-in-from-right-2 motion-safe:data-[side=right]:slide-in-from-left-2 motion-safe:data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden',
46
46
  className
47
47
  )}
48
48
  {...props}
@@ -78,7 +78,7 @@ function SelectContent({
78
78
  <SelectPrimitive.Content
79
79
  data-slot='select-content'
80
80
  className={cn(
81
- 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md',
81
+ 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[state=open]:zoom-in-95 motion-safe:data-[side=bottom]:slide-in-from-top-2 motion-safe:data-[side=left]:slide-in-from-right-2 motion-safe:data-[side=right]:slide-in-from-left-2 motion-safe:data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md',
82
82
  position === 'popper' &&
83
83
  'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',
84
84
  className
@@ -74,13 +74,13 @@ function SheetContent({
74
74
  className={cn(
75
75
  'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500',
76
76
  side === 'right' &&
77
- 'data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm',
77
+ 'motion-safe:data-[state=closed]:slide-out-to-right motion-safe:data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm',
78
78
  side === 'left' &&
79
- 'data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm',
79
+ 'motion-safe:data-[state=closed]:slide-out-to-left motion-safe:data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm',
80
80
  side === 'top' &&
81
- 'data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b',
81
+ 'motion-safe:data-[state=closed]:slide-out-to-top motion-safe:data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b',
82
82
  side === 'bottom' &&
83
- 'data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t',
83
+ 'motion-safe:data-[state=closed]:slide-out-to-bottom motion-safe:data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t',
84
84
  className
85
85
  )}
86
86
  {...props}
@@ -7,7 +7,8 @@ import * as React from 'react';
7
7
  /**
8
8
  * Slider built on Radix `Slider.Root`. Supports single or multiple thumbs by
9
9
  * passing an array to `value`/`defaultValue`. Works horizontally or vertically
10
- * via the `orientation` prop.
10
+ * via the `orientation` prop. `aria-label` names each thumb (the focusable
11
+ * `role="slider"` element), not the root.
11
12
  *
12
13
  * @example
13
14
  * ```tsx
@@ -21,6 +22,7 @@ function Slider({
21
22
  value,
22
23
  min = 0,
23
24
  max = 100,
25
+ 'aria-label': ariaLabel,
24
26
  ...props
25
27
  }: React.ComponentProps<typeof SliderPrimitive.Root>) {
26
28
  const _values = React.useMemo(
@@ -63,6 +65,7 @@ function Slider({
63
65
  <SliderPrimitive.Thumb
64
66
  data-slot='slider-thumb'
65
67
  key={index}
68
+ aria-label={ariaLabel}
66
69
  className='border-primary bg-background ring-ring/50 block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50'
67
70
  />
68
71
  ))}
@@ -60,7 +60,7 @@ function TooltipContent({
60
60
  data-slot='tooltip-content'
61
61
  sideOffset={sideOffset}
62
62
  className={cn(
63
- 'bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance',
63
+ 'bg-primary text-primary-foreground animate-in fade-in-0 motion-safe:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[side=bottom]:slide-in-from-top-2 motion-safe:data-[side=left]:slide-in-from-right-2 motion-safe:data-[side=right]:slide-in-from-left-2 motion-safe:data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance',
64
64
  className
65
65
  )}
66
66
  {...props}