rockin 0.0.33 → 0.0.35

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 (90) hide show
  1. package/dist/chunk-3CZ2LLUN.js +198 -0
  2. package/dist/{chunk-7ZCRGTLA.js → chunk-54ZJAEO5.js} +5 -5
  3. package/dist/chunk-5GM3YR42.js +228 -0
  4. package/dist/chunk-6XUTSMTJ.js +183 -0
  5. package/dist/chunk-7JJBATB2.js +35 -0
  6. package/dist/chunk-BITCJZQZ.js +31 -0
  7. package/dist/chunk-COPQJFDI.js +158 -0
  8. package/dist/chunk-D6TULSM6.js +785 -0
  9. package/dist/chunk-DVNTJNDP.js +55 -0
  10. package/dist/chunk-EKDBYSMI.js +87 -0
  11. package/dist/chunk-FGWWRPMR.js +71 -0
  12. package/dist/chunk-G233W3IR.js +17 -0
  13. package/dist/chunk-G4NDAZTB.js +13 -0
  14. package/dist/chunk-GY2BX5SK.js +26 -0
  15. package/dist/chunk-MZBLIA6C.js +20 -0
  16. package/dist/chunk-OSVLAX37.js +101 -0
  17. package/dist/chunk-PRGKTXJU.js +20 -0
  18. package/dist/chunk-RUKQ532H.js +253 -0
  19. package/dist/chunk-S4H2HENE.js +113 -0
  20. package/dist/chunk-UHZTEDHK.js +61 -0
  21. package/dist/chunk-VFDNWPOI.js +293 -0
  22. package/dist/chunk-W4EIJWHF.js +150 -0
  23. package/dist/hooks/index.js +23 -16
  24. package/dist/index.js +4 -4
  25. package/dist/provider.js +3 -3
  26. package/dist/ui/accordion.js +95 -0
  27. package/dist/ui/alert-dialog.js +178 -0
  28. package/dist/ui/apple/english.js +7 -0
  29. package/dist/ui/apple/hindi.js +7 -0
  30. package/dist/ui/apple/index.js +52 -0
  31. package/dist/ui/apple/spanish.js +7 -0
  32. package/dist/ui/ariakit.js +7 -0
  33. package/dist/ui/autocomplete.js +296 -0
  34. package/dist/ui/avatar.js +106 -0
  35. package/dist/ui/badge.js +50 -0
  36. package/dist/ui/bridge.js +109 -0
  37. package/dist/ui/bubble.js +118 -0
  38. package/dist/ui/button-group.js +14 -0
  39. package/dist/ui/button.js +9 -0
  40. package/dist/ui/card.js +102 -0
  41. package/dist/ui/carousel.js +205 -0
  42. package/dist/ui/chart.js +253 -0
  43. package/dist/ui/checkbox.js +34 -0
  44. package/dist/ui/code-block.js +128 -0
  45. package/dist/ui/combobox.js +41 -0
  46. package/dist/ui/command.js +199 -0
  47. package/dist/ui/dashed.js +57 -0
  48. package/dist/ui/data-table/index.js +233 -0
  49. package/dist/ui/dialog.js +26 -0
  50. package/dist/ui/dock.js +86 -0
  51. package/dist/ui/drawer.js +216 -0
  52. package/dist/ui/dropdown-menu.js +35 -0
  53. package/dist/ui/empty.js +17 -0
  54. package/dist/ui/farmer/div.js +38 -0
  55. package/dist/ui/farmer/variants.js +314 -0
  56. package/dist/ui/field.js +224 -0
  57. package/dist/ui/filters.js +1524 -0
  58. package/dist/ui/image.js +88 -0
  59. package/dist/ui/index.d.ts +1 -1
  60. package/dist/ui/index.js +57 -8502
  61. package/dist/ui/input-group.js +20 -0
  62. package/dist/ui/input-otp.js +83 -0
  63. package/dist/ui/input.js +7 -0
  64. package/dist/ui/item.js +200 -0
  65. package/dist/ui/jelly.js +30 -0
  66. package/dist/ui/kbd.js +9 -0
  67. package/dist/ui/label.js +7 -0
  68. package/dist/ui/message-scroller.js +122 -0
  69. package/dist/ui/message.js +93 -0
  70. package/dist/ui/numberstepper.js +416 -0
  71. package/dist/ui/otp.js +403 -0
  72. package/dist/ui/popover.js +83 -0
  73. package/dist/ui/qr-code.js +124 -0
  74. package/dist/ui/quantity.js +48 -0
  75. package/dist/ui/radio-group.js +42 -0
  76. package/dist/ui/resizable.js +52 -0
  77. package/dist/ui/scroll-area.js +9 -0
  78. package/dist/ui/select.js +194 -0
  79. package/dist/ui/separator.js +7 -0
  80. package/dist/ui/skeleton.js +25 -0
  81. package/dist/ui/sonner.js +22 -0
  82. package/dist/ui/sortable.js +503 -0
  83. package/dist/ui/swipe-actions.js +45 -0
  84. package/dist/ui/switch.js +34 -0
  85. package/dist/ui/textarea.js +7 -0
  86. package/dist/ui/theme-toggle.js +141 -0
  87. package/dist/ui/tooltip.js +13 -0
  88. package/package.json +1 -1
  89. package/dist/chunk-4KFB6AJH.js +0 -1330
  90. /package/dist/{chunk-FYFBWCMJ.js → chunk-GBVAFFZR.js} +0 -0
@@ -0,0 +1,55 @@
1
+ // src/ui/button.tsx
2
+ import { Button as ButtonPrimitive } from "@base-ui/react/button";
3
+ import { cva } from "class-variance-authority";
4
+ import { cn } from "cn";
5
+ import { jsx } from "react/jsx-runtime";
6
+ var buttonVariants = cva(
7
+ "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-[background-color,border-color,color,box-shadow,opacity,transform] duration-150 ease-[var(--ease-out)] outline-none select-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/50 not-data-disabled:active:not-aria-[haspopup]:translate-y-px disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 motion-reduce:transition-none dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-disabled:cursor-not-allowed data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:opacity-70 [&_svg:not([class*='size-'])]:size-4",
8
+ {
9
+ variants: {
10
+ variant: {
11
+ default: "bg-primary text-primary-foreground not-data-disabled:hover:bg-primary/80",
12
+ outline: "border-border bg-background not-data-disabled:hover:bg-muted not-data-disabled:hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:not-data-disabled:hover:bg-input/50",
13
+ secondary: "bg-secondary text-secondary-foreground not-data-disabled:hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
14
+ ghost: "not-data-disabled:hover:bg-muted not-data-disabled:hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:not-data-disabled:hover:bg-muted/50",
15
+ destructive: "bg-destructive/10 text-destructive not-data-disabled:hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:not-data-disabled:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
16
+ link: "text-primary underline-offset-4 not-data-disabled:hover:underline"
17
+ },
18
+ size: {
19
+ default: "h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
20
+ 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",
21
+ 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",
22
+ lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
23
+ icon: "size-8",
24
+ "icon-xs": "size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
25
+ "icon-sm": "size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg",
26
+ "icon-lg": "size-9",
27
+ "icon-title": "size-8 sm:h-8 sm:w-auto sm:gap-1.5 sm:px-2.5 sm:has-data-[icon=inline-end]:pr-2 sm:has-data-[icon=inline-start]:pl-2"
28
+ }
29
+ },
30
+ defaultVariants: {
31
+ variant: "default",
32
+ size: "default"
33
+ }
34
+ }
35
+ );
36
+ function Button({
37
+ className,
38
+ variant = "default",
39
+ size = "default",
40
+ ...props
41
+ }) {
42
+ return /* @__PURE__ */ jsx(
43
+ ButtonPrimitive,
44
+ {
45
+ "data-slot": "button",
46
+ className: cn(buttonVariants({ variant, size, className })),
47
+ ...props
48
+ }
49
+ );
50
+ }
51
+
52
+ export {
53
+ buttonVariants,
54
+ Button
55
+ };
@@ -0,0 +1,87 @@
1
+ import {
2
+ Separator
3
+ } from "./chunk-GY2BX5SK.js";
4
+
5
+ // src/ui/button-group.tsx
6
+ import { mergeProps } from "@base-ui/react/merge-props";
7
+ import { useRender } from "@base-ui/react/use-render";
8
+ import { cva } from "class-variance-authority";
9
+ import { cn } from "cn";
10
+ import { jsx } from "react/jsx-runtime";
11
+ var buttonGroupVariants = cva(
12
+ "flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-lg [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1",
13
+ {
14
+ variants: {
15
+ orientation: {
16
+ horizontal: "*:data-slot:rounded-r-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-lg! [&>[data-slot]~[data-slot]]:rounded-l-none [&>[data-slot]~[data-slot]]:border-l-0",
17
+ vertical: "flex-col *:data-slot:rounded-b-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-lg! [&>[data-slot]~[data-slot]]:rounded-t-none [&>[data-slot]~[data-slot]]:border-t-0"
18
+ }
19
+ },
20
+ defaultVariants: {
21
+ orientation: "horizontal"
22
+ }
23
+ }
24
+ );
25
+ function ButtonGroup({
26
+ className,
27
+ orientation,
28
+ ...props
29
+ }) {
30
+ return /* @__PURE__ */ jsx(
31
+ "div",
32
+ {
33
+ role: "group",
34
+ "data-slot": "button-group",
35
+ "data-orientation": orientation,
36
+ className: cn(buttonGroupVariants({ orientation }), className),
37
+ ...props
38
+ }
39
+ );
40
+ }
41
+ function ButtonGroupText({
42
+ className,
43
+ render,
44
+ ...props
45
+ }) {
46
+ return useRender({
47
+ defaultTagName: "div",
48
+ props: mergeProps(
49
+ {
50
+ className: cn(
51
+ "flex items-center gap-2 rounded-lg border bg-muted px-2.5 text-sm font-medium [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
52
+ className
53
+ )
54
+ },
55
+ props
56
+ ),
57
+ render,
58
+ state: {
59
+ slot: "button-group-text"
60
+ }
61
+ });
62
+ }
63
+ function ButtonGroupSeparator({
64
+ className,
65
+ orientation = "vertical",
66
+ ...props
67
+ }) {
68
+ return /* @__PURE__ */ jsx(
69
+ Separator,
70
+ {
71
+ "data-slot": "button-group-separator",
72
+ orientation,
73
+ className: cn(
74
+ "relative self-stretch bg-input data-horizontal:mx-px data-horizontal:w-auto data-vertical:my-px data-vertical:h-auto",
75
+ className
76
+ ),
77
+ ...props
78
+ }
79
+ );
80
+ }
81
+
82
+ export {
83
+ buttonGroupVariants,
84
+ ButtonGroup,
85
+ ButtonGroupText,
86
+ ButtonGroupSeparator
87
+ };
@@ -0,0 +1,71 @@
1
+ // src/ui/apple/english.tsx
2
+ import { cn } from "cn";
3
+ import { motion } from "motion/react";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ var initialProps = {
6
+ pathLength: 0,
7
+ opacity: 0
8
+ };
9
+ var animateProps = {
10
+ pathLength: 1,
11
+ opacity: 1
12
+ };
13
+ function AppleHelloEffectEnglish({
14
+ className,
15
+ durationScale = 1,
16
+ onAnimationComplete,
17
+ ...props
18
+ }) {
19
+ const calc = (x) => x * durationScale;
20
+ return /* @__PURE__ */ jsxs(
21
+ motion.svg,
22
+ {
23
+ className: cn("h-20", className),
24
+ xmlns: "http://www.w3.org/2000/svg",
25
+ viewBox: "0 0 638 200",
26
+ fill: "none",
27
+ stroke: "currentColor",
28
+ strokeWidth: "14.8883",
29
+ strokeLinecap: "round",
30
+ initial: { opacity: 1 },
31
+ exit: { opacity: 0 },
32
+ transition: { duration: 0.5 },
33
+ ...props,
34
+ children: [
35
+ /* @__PURE__ */ jsx("title", { children: "hello" }),
36
+ /* @__PURE__ */ jsx(
37
+ motion.path,
38
+ {
39
+ d: "M8.69214 166.553C36.2393 151.239 61.3409 131.548 89.8191 98.0295C109.203 75.1488 119.625 49.0228 120.122 31.0026C120.37 17.6036 113.836 7.43883 101.759 7.43883C88.3598 7.43883 79.9231 17.6036 74.7122 40.9363C69.005 66.5793 64.7866 96.0036 54.1166 190.356",
40
+ initial: initialProps,
41
+ animate: animateProps,
42
+ transition: {
43
+ duration: calc(0.8),
44
+ ease: "easeInOut",
45
+ opacity: { duration: 0.4 }
46
+ }
47
+ }
48
+ ),
49
+ /* @__PURE__ */ jsx(
50
+ motion.path,
51
+ {
52
+ d: "M55.1624 181.135C60.6251 133.114 81.4118 98.0479 107.963 98.0479C123.844 98.0479 133.937 110.703 131.071 128.817C129.457 139.487 127.587 150.405 125.408 163.06C122.869 178.941 130.128 191.348 152.122 191.348C184.197 191.348 219.189 173.523 237.097 145.915C243.198 136.509 245.68 128.073 245.928 119.884C246.176 104.996 237.739 93.8296 222.851 93.8296C203.992 93.8296 189.6 115.17 189.6 142.465C189.6 171.745 205.481 192.341 239.208 192.341C285.066 192.341 335.86 137.292 359.199 75.8585C365.788 58.513 368.26 42.4065 368.26 31.1512C368.26 17.8057 364.042 7.55823 352.131 7.55823C340.469 7.55823 332.777 16.6141 325.829 30.9129C317.688 47.4967 311.667 71.4162 309.203 98.4549C303 166.301 316.896 191.348 349.936 191.348C390 191.348 434.542 135.534 457.286 75.6686C463.803 58.513 466.275 42.4065 466.275 31.1512C466.275 17.8057 462.057 7.55823 450.146 7.55823C438.484 7.55823 430.792 16.6141 423.844 30.9129C415.703 47.4967 409.682 71.4162 407.218 98.4549C401.015 166.301 414.911 191.348 444.416 191.348C473.874 191.348 489.877 165.67 499.471 138.402C508.955 111.447 520.618 94.8221 544.935 94.8221C565.035 94.8221 580.916 109.71 580.916 137.75C580.916 168.768 560.792 192.093 535.362 192.341C512.984 192.589 498.285 174.475 499.774 147.179C501.511 116.907 519.873 94.8221 543.943 94.8221C557.839 94.8221 569.51 100.999 578.682 107.725C603.549 125.866 622.709 114.656 630.047 96.7186",
53
+ initial: initialProps,
54
+ animate: animateProps,
55
+ transition: {
56
+ duration: calc(2.8),
57
+ ease: "easeInOut",
58
+ delay: calc(0.7),
59
+ opacity: { duration: 0.7, delay: calc(0.7) }
60
+ },
61
+ onAnimationComplete
62
+ }
63
+ )
64
+ ]
65
+ }
66
+ );
67
+ }
68
+
69
+ export {
70
+ AppleHelloEffectEnglish
71
+ };
@@ -0,0 +1,17 @@
1
+ // src/hooks/useMediaQuery.ts
2
+ import { useEffect, useState } from "react";
3
+ function useMediaQuery(query) {
4
+ const [matches, setMatches] = useState(false);
5
+ useEffect(() => {
6
+ const mediaQuery = window.matchMedia(query);
7
+ const handleChange = () => setMatches(mediaQuery.matches);
8
+ handleChange();
9
+ mediaQuery.addEventListener("change", handleChange);
10
+ return () => mediaQuery.removeEventListener("change", handleChange);
11
+ }, [query]);
12
+ return matches;
13
+ }
14
+
15
+ export {
16
+ useMediaQuery
17
+ };
@@ -0,0 +1,13 @@
1
+ // src/hooks/useMounted.ts
2
+ import { useEffect, useState } from "react";
3
+ function useMounted() {
4
+ const [mounted, setMounted] = useState(false);
5
+ useEffect(() => {
6
+ setMounted(true);
7
+ }, []);
8
+ return { mounted };
9
+ }
10
+
11
+ export {
12
+ useMounted
13
+ };
@@ -0,0 +1,26 @@
1
+ // src/ui/separator.tsx
2
+ import { Separator as SeparatorPrimitive } from "@base-ui/react/separator";
3
+ import { cn } from "cn";
4
+ import { jsx } from "react/jsx-runtime";
5
+ function Separator({
6
+ className,
7
+ orientation = "horizontal",
8
+ ...props
9
+ }) {
10
+ return /* @__PURE__ */ jsx(
11
+ SeparatorPrimitive,
12
+ {
13
+ "data-slot": "separator",
14
+ orientation,
15
+ className: cn(
16
+ "shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",
17
+ className
18
+ ),
19
+ ...props
20
+ }
21
+ );
22
+ }
23
+
24
+ export {
25
+ Separator
26
+ };
@@ -0,0 +1,20 @@
1
+ // src/ui/textarea.tsx
2
+ import { cn } from "cn";
3
+ import { jsx } from "react/jsx-runtime";
4
+ function Textarea({ className, ...props }) {
5
+ return /* @__PURE__ */ jsx(
6
+ "textarea",
7
+ {
8
+ "data-slot": "textarea",
9
+ className: cn(
10
+ "flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",
11
+ className
12
+ ),
13
+ ...props
14
+ }
15
+ );
16
+ }
17
+
18
+ export {
19
+ Textarea
20
+ };
@@ -0,0 +1,101 @@
1
+ // src/ui/empty.tsx
2
+ import { cva } from "class-variance-authority";
3
+ import { cn } from "cn";
4
+ import { jsx } from "react/jsx-runtime";
5
+ function Empty({ className, ...props }) {
6
+ return /* @__PURE__ */ jsx(
7
+ "div",
8
+ {
9
+ "data-slot": "empty",
10
+ className: cn(
11
+ "flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-xl border-dashed p-6 text-center text-balance",
12
+ className
13
+ ),
14
+ ...props
15
+ }
16
+ );
17
+ }
18
+ function EmptyHeader({ className, ...props }) {
19
+ return /* @__PURE__ */ jsx(
20
+ "div",
21
+ {
22
+ "data-slot": "empty-header",
23
+ className: cn("flex max-w-sm flex-col items-center gap-2", className),
24
+ ...props
25
+ }
26
+ );
27
+ }
28
+ var emptyMediaVariants = cva(
29
+ "mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0",
30
+ {
31
+ variants: {
32
+ variant: {
33
+ default: "bg-transparent",
34
+ icon: "flex size-14 shrink-0 items-center justify-center rounded-2xl bg-muted text-foreground [&_svg:not([class*='size-'])]:size-7"
35
+ }
36
+ },
37
+ defaultVariants: {
38
+ variant: "default"
39
+ }
40
+ }
41
+ );
42
+ function EmptyMedia({
43
+ className,
44
+ variant = "default",
45
+ ...props
46
+ }) {
47
+ return /* @__PURE__ */ jsx(
48
+ "div",
49
+ {
50
+ "data-slot": "empty-icon",
51
+ "data-variant": variant,
52
+ className: cn(emptyMediaVariants({ variant, className })),
53
+ ...props
54
+ }
55
+ );
56
+ }
57
+ function EmptyTitle({ className, ...props }) {
58
+ return /* @__PURE__ */ jsx(
59
+ "div",
60
+ {
61
+ "data-slot": "empty-title",
62
+ className: cn("text-sm font-medium tracking-tight", className),
63
+ ...props
64
+ }
65
+ );
66
+ }
67
+ function EmptyDescription({ className, ...props }) {
68
+ return /* @__PURE__ */ jsx(
69
+ "div",
70
+ {
71
+ "data-slot": "empty-description",
72
+ className: cn(
73
+ "text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",
74
+ className
75
+ ),
76
+ ...props
77
+ }
78
+ );
79
+ }
80
+ function EmptyContent({ className, ...props }) {
81
+ return /* @__PURE__ */ jsx(
82
+ "div",
83
+ {
84
+ "data-slot": "empty-content",
85
+ className: cn(
86
+ "flex w-full max-w-sm min-w-0 flex-col items-center gap-2.5 text-sm text-balance",
87
+ className
88
+ ),
89
+ ...props
90
+ }
91
+ );
92
+ }
93
+
94
+ export {
95
+ Empty,
96
+ EmptyHeader,
97
+ EmptyMedia,
98
+ EmptyTitle,
99
+ EmptyDescription,
100
+ EmptyContent
101
+ };
@@ -0,0 +1,20 @@
1
+ // src/ui/label.tsx
2
+ import { cn } from "cn";
3
+ import { jsx } from "react/jsx-runtime";
4
+ function Label({ className, ...props }) {
5
+ return /* @__PURE__ */ jsx(
6
+ "label",
7
+ {
8
+ "data-slot": "label",
9
+ className: cn(
10
+ "flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
11
+ className
12
+ ),
13
+ ...props
14
+ }
15
+ );
16
+ }
17
+
18
+ export {
19
+ Label
20
+ };
@@ -0,0 +1,253 @@
1
+ // src/ui/dropdown-menu.tsx
2
+ import { Menu as MenuPrimitive } from "@base-ui/react/menu";
3
+ import { cn } from "cn";
4
+ import { CheckIcon, ChevronRightIcon } from "lucide-react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ function DropdownMenu({ ...props }) {
7
+ return /* @__PURE__ */ jsx(MenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
8
+ }
9
+ function DropdownMenuPortal({ ...props }) {
10
+ return /* @__PURE__ */ jsx(MenuPrimitive.Portal, { "data-slot": "dropdown-menu-portal", ...props });
11
+ }
12
+ function DropdownMenuTrigger({ ...props }) {
13
+ return /* @__PURE__ */ jsx(MenuPrimitive.Trigger, { "data-slot": "dropdown-menu-trigger", ...props });
14
+ }
15
+ function DropdownMenuContent({
16
+ align = "start",
17
+ alignOffset = 0,
18
+ side = "bottom",
19
+ sideOffset = 4,
20
+ className,
21
+ ...props
22
+ }) {
23
+ return /* @__PURE__ */ jsx(MenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
24
+ MenuPrimitive.Positioner,
25
+ {
26
+ className: "isolate z-50 outline-none",
27
+ align,
28
+ alignOffset,
29
+ side,
30
+ sideOffset,
31
+ children: /* @__PURE__ */ jsx(
32
+ MenuPrimitive.Popup,
33
+ {
34
+ "data-slot": "dropdown-menu-content",
35
+ className: cn(
36
+ "z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-background p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95",
37
+ className
38
+ ),
39
+ ...props
40
+ }
41
+ )
42
+ }
43
+ ) });
44
+ }
45
+ function DropdownMenuGroup({ ...props }) {
46
+ return /* @__PURE__ */ jsx(MenuPrimitive.Group, { "data-slot": "dropdown-menu-group", ...props });
47
+ }
48
+ function DropdownMenuLabel({
49
+ className,
50
+ inset,
51
+ ...props
52
+ }) {
53
+ return /* @__PURE__ */ jsx(
54
+ MenuPrimitive.GroupLabel,
55
+ {
56
+ "data-slot": "dropdown-menu-label",
57
+ "data-inset": inset,
58
+ className: cn(
59
+ "px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7",
60
+ className
61
+ ),
62
+ ...props
63
+ }
64
+ );
65
+ }
66
+ function DropdownMenuItem({
67
+ className,
68
+ inset,
69
+ variant = "default",
70
+ ...props
71
+ }) {
72
+ return /* @__PURE__ */ jsx(
73
+ MenuPrimitive.Item,
74
+ {
75
+ "data-slot": "dropdown-menu-item",
76
+ "data-inset": inset,
77
+ "data-variant": variant,
78
+ className: cn(
79
+ "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",
80
+ className
81
+ ),
82
+ ...props
83
+ }
84
+ );
85
+ }
86
+ function DropdownMenuSub({ ...props }) {
87
+ return /* @__PURE__ */ jsx(MenuPrimitive.SubmenuRoot, { "data-slot": "dropdown-menu-sub", ...props });
88
+ }
89
+ function DropdownMenuSubTrigger({
90
+ className,
91
+ inset,
92
+ children,
93
+ ...props
94
+ }) {
95
+ return /* @__PURE__ */ jsxs(
96
+ MenuPrimitive.SubmenuTrigger,
97
+ {
98
+ "data-slot": "dropdown-menu-sub-trigger",
99
+ "data-inset": inset,
100
+ className: cn(
101
+ "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 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
102
+ className
103
+ ),
104
+ ...props,
105
+ children: [
106
+ children,
107
+ /* @__PURE__ */ jsx(ChevronRightIcon, { className: "ml-auto" })
108
+ ]
109
+ }
110
+ );
111
+ }
112
+ function DropdownMenuSubContent({
113
+ align = "start",
114
+ alignOffset = -3,
115
+ side = "right",
116
+ sideOffset = 0,
117
+ className,
118
+ ...props
119
+ }) {
120
+ return /* @__PURE__ */ jsx(
121
+ DropdownMenuContent,
122
+ {
123
+ "data-slot": "dropdown-menu-sub-content",
124
+ className: cn(
125
+ "w-auto min-w-[96px] rounded-lg bg-background p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
126
+ className
127
+ ),
128
+ align,
129
+ alignOffset,
130
+ side,
131
+ sideOffset,
132
+ ...props
133
+ }
134
+ );
135
+ }
136
+ function DropdownMenuCheckboxItem({
137
+ className,
138
+ children,
139
+ checked,
140
+ inset,
141
+ ...props
142
+ }) {
143
+ return /* @__PURE__ */ jsxs(
144
+ MenuPrimitive.CheckboxItem,
145
+ {
146
+ "data-slot": "dropdown-menu-checkbox-item",
147
+ "data-inset": inset,
148
+ className: cn(
149
+ "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",
150
+ className
151
+ ),
152
+ checked,
153
+ ...props,
154
+ children: [
155
+ /* @__PURE__ */ jsx(
156
+ "span",
157
+ {
158
+ className: "pointer-events-none absolute right-2 flex items-center justify-center",
159
+ "data-slot": "dropdown-menu-checkbox-item-indicator",
160
+ children: /* @__PURE__ */ jsx(MenuPrimitive.CheckboxItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, {}) })
161
+ }
162
+ ),
163
+ children
164
+ ]
165
+ }
166
+ );
167
+ }
168
+ function DropdownMenuRadioGroup({ ...props }) {
169
+ return /* @__PURE__ */ jsx(
170
+ MenuPrimitive.RadioGroup,
171
+ {
172
+ "data-slot": "dropdown-menu-radio-group",
173
+ ...props
174
+ }
175
+ );
176
+ }
177
+ function DropdownMenuRadioItem({
178
+ className,
179
+ children,
180
+ inset,
181
+ ...props
182
+ }) {
183
+ return /* @__PURE__ */ jsxs(
184
+ MenuPrimitive.RadioItem,
185
+ {
186
+ "data-slot": "dropdown-menu-radio-item",
187
+ "data-inset": inset,
188
+ className: cn(
189
+ "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",
190
+ className
191
+ ),
192
+ ...props,
193
+ children: [
194
+ /* @__PURE__ */ jsx(
195
+ "span",
196
+ {
197
+ className: "pointer-events-none absolute right-2 flex items-center justify-center",
198
+ "data-slot": "dropdown-menu-radio-item-indicator",
199
+ children: /* @__PURE__ */ jsx(MenuPrimitive.RadioItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, {}) })
200
+ }
201
+ ),
202
+ children
203
+ ]
204
+ }
205
+ );
206
+ }
207
+ function DropdownMenuSeparator({
208
+ className,
209
+ ...props
210
+ }) {
211
+ return /* @__PURE__ */ jsx(
212
+ MenuPrimitive.Separator,
213
+ {
214
+ "data-slot": "dropdown-menu-separator",
215
+ className: cn("-mx-1 my-1 h-px bg-border", className),
216
+ ...props
217
+ }
218
+ );
219
+ }
220
+ function DropdownMenuShortcut({
221
+ className,
222
+ ...props
223
+ }) {
224
+ return /* @__PURE__ */ jsx(
225
+ "span",
226
+ {
227
+ "data-slot": "dropdown-menu-shortcut",
228
+ className: cn(
229
+ "ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground",
230
+ className
231
+ ),
232
+ ...props
233
+ }
234
+ );
235
+ }
236
+
237
+ export {
238
+ DropdownMenu,
239
+ DropdownMenuPortal,
240
+ DropdownMenuTrigger,
241
+ DropdownMenuContent,
242
+ DropdownMenuGroup,
243
+ DropdownMenuLabel,
244
+ DropdownMenuItem,
245
+ DropdownMenuSub,
246
+ DropdownMenuSubTrigger,
247
+ DropdownMenuSubContent,
248
+ DropdownMenuCheckboxItem,
249
+ DropdownMenuRadioGroup,
250
+ DropdownMenuRadioItem,
251
+ DropdownMenuSeparator,
252
+ DropdownMenuShortcut
253
+ };