@codefast/ui 0.3.11-canary.1 → 0.3.11

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 (149) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/README.md +34 -14
  3. package/dist/components/accordion.d.ts +29 -10
  4. package/dist/components/accordion.js +38 -37
  5. package/dist/components/alert-dialog.d.ts +60 -24
  6. package/dist/components/alert-dialog.js +69 -72
  7. package/dist/components/alert.d.ts +27 -15
  8. package/dist/components/alert.js +29 -31
  9. package/dist/components/aspect-ratio.d.ts +8 -4
  10. package/dist/components/aspect-ratio.js +7 -5
  11. package/dist/components/avatar.d.ts +17 -6
  12. package/dist/components/avatar.js +19 -17
  13. package/dist/components/badge.d.ts +21 -14
  14. package/dist/components/badge.js +19 -22
  15. package/dist/components/breadcrumb.d.ts +35 -12
  16. package/dist/components/breadcrumb.js +48 -54
  17. package/dist/components/button-group.d.ts +29 -14
  18. package/dist/components/button-group.js +27 -32
  19. package/dist/components/button.d.ts +35 -25
  20. package/dist/components/button.js +50 -48
  21. package/dist/components/calendar.d.ts +24 -9
  22. package/dist/components/calendar.js +92 -98
  23. package/dist/components/card.d.ts +34 -10
  24. package/dist/components/card.js +39 -37
  25. package/dist/components/carousel.d.ts +55 -24
  26. package/dist/components/carousel.js +113 -130
  27. package/dist/components/chart.d.ts +72 -36
  28. package/dist/components/chart.js +154 -166
  29. package/dist/components/checkbox-cards.d.ts +15 -8
  30. package/dist/components/checkbox-cards.js +22 -25
  31. package/dist/components/checkbox-group.d.ts +16 -8
  32. package/dist/components/checkbox-group.js +19 -19
  33. package/dist/components/checkbox.d.ts +9 -4
  34. package/dist/components/checkbox.js +14 -14
  35. package/dist/components/collapsible.d.ts +14 -6
  36. package/dist/components/collapsible.js +18 -16
  37. package/dist/components/command.d.ts +55 -23
  38. package/dist/components/command.js +70 -85
  39. package/dist/components/context-menu.d.ts +72 -22
  40. package/dist/components/context-menu.js +88 -109
  41. package/dist/components/dialog.d.ts +53 -22
  42. package/dist/components/dialog.js +71 -85
  43. package/dist/components/drawer.d.ts +60 -28
  44. package/dist/components/drawer.js +59 -67
  45. package/dist/components/dropdown-menu.d.ts +73 -22
  46. package/dist/components/dropdown-menu.js +95 -112
  47. package/dist/components/empty.d.ts +37 -15
  48. package/dist/components/empty.js +43 -45
  49. package/dist/components/field.d.ts +63 -25
  50. package/dist/components/field.js +88 -104
  51. package/dist/components/form.d.ts +37 -15
  52. package/dist/components/form.js +65 -70
  53. package/dist/components/hover-card.d.ts +21 -7
  54. package/dist/components/hover-card.js +24 -24
  55. package/dist/components/input-group.d.ts +53 -28
  56. package/dist/components/input-group.js +63 -77
  57. package/dist/components/input-number.d.ts +28 -7
  58. package/dist/components/input-number.js +55 -59
  59. package/dist/components/input-otp.d.ts +24 -10
  60. package/dist/components/input-otp.js +33 -37
  61. package/dist/components/input-password.d.ts +12 -5
  62. package/dist/components/input-password.js +31 -32
  63. package/dist/components/input-search.d.ts +18 -8
  64. package/dist/components/input-search.js +43 -41
  65. package/dist/components/input.d.ts +10 -4
  66. package/dist/components/input.js +9 -7
  67. package/dist/components/item.d.ts +69 -32
  68. package/dist/components/item.js +89 -92
  69. package/dist/components/kbd.d.ts +13 -5
  70. package/dist/components/kbd.js +13 -11
  71. package/dist/components/label.d.ts +9 -4
  72. package/dist/components/label.js +9 -7
  73. package/dist/components/menubar.d.ts +80 -23
  74. package/dist/components/menubar.js +97 -118
  75. package/dist/components/native-select.d.ts +16 -6
  76. package/dist/components/native-select.js +25 -26
  77. package/dist/components/navigation-menu.d.ts +36 -12
  78. package/dist/components/navigation-menu.js +60 -75
  79. package/dist/components/pagination.d.ts +35 -14
  80. package/dist/components/pagination.js +54 -69
  81. package/dist/components/popover.d.ts +24 -8
  82. package/dist/components/popover.js +28 -28
  83. package/dist/components/progress-circle.d.ts +106 -88
  84. package/dist/components/progress-circle.js +106 -138
  85. package/dist/components/progress.d.ts +10 -4
  86. package/dist/components/progress.js +14 -14
  87. package/dist/components/radio-cards.d.ts +10 -4
  88. package/dist/components/radio-cards.js +22 -23
  89. package/dist/components/radio-group.d.ts +13 -5
  90. package/dist/components/radio-group.js +18 -16
  91. package/dist/components/radio.d.ts +12 -5
  92. package/dist/components/radio.js +10 -8
  93. package/dist/components/resizable.d.ts +18 -7
  94. package/dist/components/resizable.js +22 -22
  95. package/dist/components/scroll-area.d.ts +33 -20
  96. package/dist/components/scroll-area.js +84 -88
  97. package/dist/components/select.d.ts +50 -16
  98. package/dist/components/select.js +77 -96
  99. package/dist/components/separator.d.ts +29 -19
  100. package/dist/components/separator.js +36 -34
  101. package/dist/components/sheet.d.ts +62 -29
  102. package/dist/components/sheet.js +79 -100
  103. package/dist/components/sidebar.d.ts +160 -66
  104. package/dist/components/sidebar.js +294 -336
  105. package/dist/components/skeleton.d.ts +9 -4
  106. package/dist/components/skeleton.js +8 -6
  107. package/dist/components/slider.d.ts +13 -4
  108. package/dist/components/slider.js +34 -40
  109. package/dist/components/sonner.d.ts +10 -7
  110. package/dist/components/sonner.js +16 -14
  111. package/dist/components/spinner.d.ts +12 -5
  112. package/dist/components/spinner.js +33 -35
  113. package/dist/components/switch.d.ts +9 -4
  114. package/dist/components/switch.js +13 -11
  115. package/dist/components/table.d.ts +37 -11
  116. package/dist/components/table.js +47 -45
  117. package/dist/components/tabs.d.ts +21 -7
  118. package/dist/components/tabs.js +24 -22
  119. package/dist/components/textarea.d.ts +9 -4
  120. package/dist/components/textarea.js +8 -6
  121. package/dist/components/toggle-group.d.ts +24 -9
  122. package/dist/components/toggle-group.js +41 -42
  123. package/dist/components/toggle.d.ts +25 -17
  124. package/dist/components/toggle.js +30 -28
  125. package/dist/components/tooltip.d.ts +24 -8
  126. package/dist/components/tooltip.js +29 -32
  127. package/dist/hooks/use-animated-value.d.ts +4 -1
  128. package/dist/hooks/use-animated-value.js +57 -36
  129. package/dist/hooks/use-copy-to-clipboard.d.ts +11 -5
  130. package/dist/hooks/use-copy-to-clipboard.js +39 -20
  131. package/dist/hooks/use-is-mobile.d.ts +4 -1
  132. package/dist/hooks/use-is-mobile.js +21 -1
  133. package/dist/hooks/use-media-query.d.ts +4 -1
  134. package/dist/hooks/use-media-query.js +45 -18
  135. package/dist/hooks/use-mutation-observer.d.ts +6 -2
  136. package/dist/hooks/use-mutation-observer.js +34 -16
  137. package/dist/hooks/use-pagination.d.ts +22 -14
  138. package/dist/hooks/use-pagination.js +100 -49
  139. package/dist/index.d.ts +69 -130
  140. package/dist/index.js +11 -11
  141. package/dist/primitives/checkbox-group.d.ts +105 -83
  142. package/dist/primitives/checkbox-group.js +111 -84
  143. package/dist/primitives/input-number.d.ts +51 -40
  144. package/dist/primitives/input-number.js +483 -350
  145. package/dist/primitives/input.d.ts +48 -42
  146. package/dist/primitives/input.js +65 -43
  147. package/dist/primitives/progress-circle.d.ts +79 -48
  148. package/dist/primitives/progress-circle.js +154 -105
  149. package/package.json +6 -7
@@ -1,27 +1,40 @@
1
- import type { VariantProps } from "@codefast/tailwind-variants";
2
- import type { Scope } from "@radix-ui/react-context";
3
- import type { ComponentProps, JSX } from "react";
1
+ import * as _$_codefast_tailwind_variants0 from "@codefast/tailwind-variants";
2
+ import { VariantProps } from "@codefast/tailwind-variants";
3
+ import { ComponentProps, JSX } from "react";
4
+ import { Scope } from "@radix-ui/react-context";
4
5
  import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
5
- declare const scrollAreaScrollbarVariants: import("@codefast/tailwind-variants").VariantFunctionType<{
6
- orientation: {
7
- horizontal: string;
8
- vertical: string;
9
- };
10
- size: {
11
- none: string;
12
- sm: string;
13
- md: string;
14
- lg: string;
15
- };
6
+
7
+ //#region src/components/scroll-area.d.ts
8
+ declare const scrollAreaScrollbarVariants: _$_codefast_tailwind_variants0.VariantFunctionType<{
9
+ orientation: {
10
+ horizontal: string;
11
+ vertical: string;
12
+ };
13
+ size: {
14
+ none: string;
15
+ sm: string;
16
+ md: string;
17
+ lg: string;
18
+ };
16
19
  }, Record<string, never>>;
17
20
  type ScopedProps<P> = P & {
18
- __scopeScrollArea?: Scope;
21
+ __scopeScrollArea?: Scope;
19
22
  };
20
23
  type ScrollAreaContextValue = Pick<VariantProps<typeof scrollAreaScrollbarVariants>, "size">;
21
24
  type ScrollAreaProps = ScopedProps<ComponentProps<typeof ScrollAreaPrimitive.Root> & ScrollAreaContextValue>;
22
- declare function ScrollArea({ __scopeScrollArea, children, className, size, ...props }: ScrollAreaProps): JSX.Element;
25
+ declare function ScrollArea({
26
+ __scopeScrollArea,
27
+ children,
28
+ className,
29
+ size,
30
+ ...props
31
+ }: ScrollAreaProps): JSX.Element;
23
32
  type ScrollAreaScrollbarProps = ScopedProps<ComponentProps<typeof ScrollAreaPrimitive.Scrollbar>>;
24
- declare function ScrollAreaScrollbar({ __scopeScrollArea, className, orientation, ...props }: ScrollAreaScrollbarProps): JSX.Element;
25
- export { scrollAreaScrollbarVariants };
26
- export { ScrollArea, ScrollAreaScrollbar };
27
- export type { ScrollAreaProps, ScrollAreaScrollbarProps };
33
+ declare function ScrollAreaScrollbar({
34
+ __scopeScrollArea,
35
+ className,
36
+ orientation,
37
+ ...props
38
+ }: ScrollAreaScrollbarProps): JSX.Element;
39
+ //#endregion
40
+ export { ScrollArea, type ScrollAreaProps, ScrollAreaScrollbar, type ScrollAreaScrollbarProps, scrollAreaScrollbarVariants };
@@ -1,101 +1,97 @@
1
1
  "use client";
2
- import { jsx, jsxs } from "react/jsx-runtime";
3
2
  import { cn, tv } from "@codefast/tailwind-variants";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
4
  import { createContextScope } from "@radix-ui/react-context";
5
- import { Corner, Root, ScrollAreaThumb, Scrollbar, Viewport } from "@radix-ui/react-scroll-area";
5
+ import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
6
+ //#region src/components/scroll-area.tsx
6
7
  const scrollAreaScrollbarVariants = tv({
7
- base: "flex touch-none p-px transition-colors select-none",
8
- compoundVariants: [
9
- {
10
- className: "w-1.5",
11
- orientation: "vertical",
12
- size: "sm"
13
- },
14
- {
15
- className: "w-2",
16
- orientation: "vertical",
17
- size: "md"
18
- },
19
- {
20
- className: "w-2.5",
21
- orientation: "vertical",
22
- size: "lg"
23
- },
24
- {
25
- className: "h-1.5",
26
- orientation: "horizontal",
27
- size: "sm"
28
- },
29
- {
30
- className: "h-2",
31
- orientation: "horizontal",
32
- size: "md"
33
- },
34
- {
35
- className: "h-2.5",
36
- orientation: "horizontal",
37
- size: "lg"
38
- }
39
- ],
40
- defaultVariants: {
41
- orientation: "vertical",
42
- size: "md"
43
- },
44
- variants: {
45
- orientation: {
46
- horizontal: "w-full flex-col border-t border-t-transparent",
47
- vertical: "h-full flex-row border-l border-l-transparent"
48
- },
49
- size: {
50
- none: "",
51
- sm: "",
52
- md: "",
53
- lg: ""
54
- }
55
- }
8
+ base: "flex touch-none p-px transition-colors select-none",
9
+ compoundVariants: [
10
+ {
11
+ className: "w-1.5",
12
+ orientation: "vertical",
13
+ size: "sm"
14
+ },
15
+ {
16
+ className: "w-2",
17
+ orientation: "vertical",
18
+ size: "md"
19
+ },
20
+ {
21
+ className: "w-2.5",
22
+ orientation: "vertical",
23
+ size: "lg"
24
+ },
25
+ {
26
+ className: "h-1.5",
27
+ orientation: "horizontal",
28
+ size: "sm"
29
+ },
30
+ {
31
+ className: "h-2",
32
+ orientation: "horizontal",
33
+ size: "md"
34
+ },
35
+ {
36
+ className: "h-2.5",
37
+ orientation: "horizontal",
38
+ size: "lg"
39
+ }
40
+ ],
41
+ defaultVariants: {
42
+ orientation: "vertical",
43
+ size: "md"
44
+ },
45
+ variants: {
46
+ orientation: {
47
+ horizontal: "w-full flex-col border-t border-t-transparent",
48
+ vertical: "h-full flex-row border-l border-l-transparent"
49
+ },
50
+ size: {
51
+ none: "",
52
+ sm: "",
53
+ md: "",
54
+ lg: ""
55
+ }
56
+ }
56
57
  });
57
58
  const SCROLL_AREA_NAME = "ScrollArea";
58
59
  const [createScrollAreaContext] = createContextScope(SCROLL_AREA_NAME);
59
60
  const [ScrollAreaContextProvider, useScrollAreaContext] = createScrollAreaContext(SCROLL_AREA_NAME);
60
61
  function ScrollArea({ __scopeScrollArea, children, className, size, ...props }) {
61
- return /*#__PURE__*/ jsx(ScrollAreaContextProvider, {
62
- scope: __scopeScrollArea,
63
- size: size,
64
- children: /*#__PURE__*/ jsxs(Root, {
65
- className: cn("relative", className),
66
- "data-slot": "scroll-area",
67
- ...props,
68
- children: [
69
- /*#__PURE__*/ jsx(Viewport, {
70
- className: "size-full rounded-[inherit] ring-ring/50 outline-ring transition focus-visible:ring-4 focus-visible:outline-1",
71
- "data-slot": "scroll-area-viewport",
72
- children: children
73
- }),
74
- /*#__PURE__*/ jsx(ScrollAreaScrollbar, {
75
- orientation: "vertical"
76
- }),
77
- /*#__PURE__*/ jsx(ScrollAreaScrollbar, {
78
- orientation: "horizontal"
79
- }),
80
- /*#__PURE__*/ jsx(Corner, {})
81
- ]
82
- })
83
- });
62
+ return /* @__PURE__ */ jsx(ScrollAreaContextProvider, {
63
+ scope: __scopeScrollArea,
64
+ size,
65
+ children: /* @__PURE__ */ jsxs(ScrollAreaPrimitive.Root, {
66
+ className: cn("relative", className),
67
+ "data-slot": "scroll-area",
68
+ ...props,
69
+ children: [
70
+ /* @__PURE__ */ jsx(ScrollAreaPrimitive.Viewport, {
71
+ className: "size-full rounded-[inherit] ring-ring/50 outline-ring transition focus-visible:ring-4 focus-visible:outline-1",
72
+ "data-slot": "scroll-area-viewport",
73
+ children
74
+ }),
75
+ /* @__PURE__ */ jsx(ScrollAreaScrollbar, { orientation: "vertical" }),
76
+ /* @__PURE__ */ jsx(ScrollAreaScrollbar, { orientation: "horizontal" }),
77
+ /* @__PURE__ */ jsx(ScrollAreaPrimitive.Corner, {})
78
+ ]
79
+ })
80
+ });
84
81
  }
85
82
  function ScrollAreaScrollbar({ __scopeScrollArea, className, orientation, ...props }) {
86
- const { size } = useScrollAreaContext(SCROLL_AREA_NAME, __scopeScrollArea);
87
- return /*#__PURE__*/ jsx(Scrollbar, {
88
- className: scrollAreaScrollbarVariants({
89
- className,
90
- orientation,
91
- size
92
- }),
93
- "data-slot": "scroll-area-scrollbar",
94
- orientation: orientation,
95
- ...props,
96
- children: /*#__PURE__*/ jsx(ScrollAreaThumb, {
97
- className: "relative flex-1 rounded-full bg-border"
98
- })
99
- });
83
+ const { size } = useScrollAreaContext(SCROLL_AREA_NAME, __scopeScrollArea);
84
+ return /* @__PURE__ */ jsx(ScrollAreaPrimitive.Scrollbar, {
85
+ className: scrollAreaScrollbarVariants({
86
+ className,
87
+ orientation,
88
+ size
89
+ }),
90
+ "data-slot": "scroll-area-scrollbar",
91
+ orientation,
92
+ ...props,
93
+ children: /* @__PURE__ */ jsx(ScrollAreaPrimitive.ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-border" })
94
+ });
100
95
  }
96
+ //#endregion
101
97
  export { ScrollArea, ScrollAreaScrollbar, scrollAreaScrollbarVariants };
@@ -1,28 +1,62 @@
1
- import type { VariantProps } from "@codefast/tailwind-variants";
2
- import type { ComponentProps, JSX } from "react";
1
+ import { buttonVariants } from "./button.js";
2
+ import { VariantProps } from "@codefast/tailwind-variants";
3
+ import { ComponentProps, JSX } from "react";
3
4
  import * as SelectPrimitive from "@radix-ui/react-select";
4
- import { buttonVariants } from "./button";
5
+
6
+ //#region src/components/select.d.ts
5
7
  type SelectProps = ComponentProps<typeof SelectPrimitive.Root>;
6
- declare function Select({ ...props }: SelectProps): JSX.Element;
8
+ declare function Select({
9
+ ...props
10
+ }: SelectProps): JSX.Element;
7
11
  type SelectGroupProps = ComponentProps<typeof SelectPrimitive.Group>;
8
- declare function SelectGroup({ ...props }: SelectGroupProps): JSX.Element;
12
+ declare function SelectGroup({
13
+ ...props
14
+ }: SelectGroupProps): JSX.Element;
9
15
  type SelectValueProps = ComponentProps<typeof SelectPrimitive.Value>;
10
- declare function SelectValue({ ...props }: SelectValueProps): JSX.Element;
16
+ declare function SelectValue({
17
+ ...props
18
+ }: SelectValueProps): JSX.Element;
11
19
  interface SelectTriggerProps extends ComponentProps<typeof SelectPrimitive.Trigger> {
12
- size?: VariantProps<typeof buttonVariants>["size"];
20
+ size?: VariantProps<typeof buttonVariants>["size"];
13
21
  }
14
- declare function SelectTrigger({ children, className, size, ...props }: SelectTriggerProps): JSX.Element;
22
+ declare function SelectTrigger({
23
+ children,
24
+ className,
25
+ size,
26
+ ...props
27
+ }: SelectTriggerProps): JSX.Element;
15
28
  type SelectScrollUpButtonProps = ComponentProps<typeof SelectPrimitive.ScrollUpButton>;
16
- declare function SelectScrollUpButton({ className, ...props }: SelectScrollUpButtonProps): JSX.Element;
29
+ declare function SelectScrollUpButton({
30
+ className,
31
+ ...props
32
+ }: SelectScrollUpButtonProps): JSX.Element;
17
33
  type SelectScrollDownButtonProps = ComponentProps<typeof SelectPrimitive.ScrollDownButton>;
18
- declare function SelectScrollDownButton({ className, ...props }: SelectScrollDownButtonProps): JSX.Element;
34
+ declare function SelectScrollDownButton({
35
+ className,
36
+ ...props
37
+ }: SelectScrollDownButtonProps): JSX.Element;
19
38
  type SelectContentProps = ComponentProps<typeof SelectPrimitive.Content>;
20
- declare function SelectContent({ children, className, position, ...props }: SelectContentProps): JSX.Element;
39
+ declare function SelectContent({
40
+ children,
41
+ className,
42
+ position,
43
+ ...props
44
+ }: SelectContentProps): JSX.Element;
21
45
  type SelectLabelProps = ComponentProps<typeof SelectPrimitive.Label>;
22
- declare function SelectLabel({ className, ...props }: SelectLabelProps): JSX.Element;
46
+ declare function SelectLabel({
47
+ className,
48
+ ...props
49
+ }: SelectLabelProps): JSX.Element;
23
50
  type SelectItemProps = ComponentProps<typeof SelectPrimitive.Item>;
24
- declare function SelectItem({ children, className, ...props }: SelectItemProps): JSX.Element;
51
+ declare function SelectItem({
52
+ children,
53
+ className,
54
+ ...props
55
+ }: SelectItemProps): JSX.Element;
25
56
  type SelectSeparatorProps = ComponentProps<typeof SelectPrimitive.Separator>;
26
- declare function SelectSeparator({ className, ...props }: SelectSeparatorProps): JSX.Element;
27
- export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, };
28
- export type { SelectContentProps, SelectGroupProps, SelectItemProps, SelectLabelProps, SelectProps, SelectScrollDownButtonProps, SelectScrollUpButtonProps, SelectSeparatorProps, SelectTriggerProps, SelectValueProps, };
57
+ declare function SelectSeparator({
58
+ className,
59
+ ...props
60
+ }: SelectSeparatorProps): JSX.Element;
61
+ //#endregion
62
+ export { Select, SelectContent, type SelectContentProps, SelectGroup, type SelectGroupProps, SelectItem, type SelectItemProps, SelectLabel, type SelectLabelProps, type SelectProps, SelectScrollDownButton, type SelectScrollDownButtonProps, SelectScrollUpButton, type SelectScrollUpButtonProps, SelectSeparator, type SelectSeparatorProps, SelectTrigger, type SelectTriggerProps, SelectValue, type SelectValueProps };
@@ -1,120 +1,101 @@
1
1
  "use client";
2
- import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { buttonVariants } from "./button.js";
3
3
  import { cn } from "@codefast/tailwind-variants";
4
- import { Content, Group, Icon, Item, ItemIndicator, ItemText, Label, Portal, Root, ScrollDownButton, ScrollUpButton, Separator, Trigger, Value, Viewport } from "@radix-ui/react-select";
5
4
  import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react";
6
- import { buttonVariants } from "./button.js";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ import * as SelectPrimitive from "@radix-ui/react-select";
7
+ //#region src/components/select.tsx
7
8
  function Select({ ...props }) {
8
- return /*#__PURE__*/ jsx(Root, {
9
- "data-slot": "select",
10
- ...props
11
- });
9
+ return /* @__PURE__ */ jsx(SelectPrimitive.Root, {
10
+ "data-slot": "select",
11
+ ...props
12
+ });
12
13
  }
13
14
  function SelectGroup({ ...props }) {
14
- return /*#__PURE__*/ jsx(Group, {
15
- "data-slot": "select-group",
16
- ...props
17
- });
15
+ return /* @__PURE__ */ jsx(SelectPrimitive.Group, {
16
+ "data-slot": "select-group",
17
+ ...props
18
+ });
18
19
  }
19
20
  function SelectValue({ ...props }) {
20
- return /*#__PURE__*/ jsx(Value, {
21
- "data-slot": "select-value",
22
- ...props
23
- });
21
+ return /* @__PURE__ */ jsx(SelectPrimitive.Value, {
22
+ "data-slot": "select-value",
23
+ ...props
24
+ });
24
25
  }
25
26
  function SelectTrigger({ children, className, size, ...props }) {
26
- return /*#__PURE__*/ jsxs(Trigger, {
27
- className: buttonVariants({
28
- className: [
29
- "[&_svg:not([class*='text-'])]:text-muted-foreground focus:ring-ring/50 focus:border-ring w-fit justify-between px-3 font-normal focus:ring-3 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 *:data-[slot=select-value]:truncate",
30
- className
31
- ],
32
- size,
33
- variant: "outline"
34
- }),
35
- "data-size": size,
36
- "data-slot": "select-trigger",
37
- ...props,
38
- children: [
39
- children,
40
- /*#__PURE__*/ jsx(Icon, {
41
- asChild: true,
42
- className: "size-4 shrink-0 opacity-50",
43
- children: /*#__PURE__*/ jsx(ChevronDownIcon, {})
44
- })
45
- ]
46
- });
27
+ return /* @__PURE__ */ jsxs(SelectPrimitive.Trigger, {
28
+ className: buttonVariants({
29
+ className: ["[&_svg:not([class*='text-'])]:text-muted-foreground focus:ring-ring/50 focus:border-ring w-fit justify-between px-3 font-normal focus:ring-3 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 *:data-[slot=select-value]:truncate", className],
30
+ size,
31
+ variant: "outline"
32
+ }),
33
+ "data-size": size,
34
+ "data-slot": "select-trigger",
35
+ ...props,
36
+ children: [children, /* @__PURE__ */ jsx(SelectPrimitive.Icon, {
37
+ asChild: true,
38
+ className: "size-4 shrink-0 opacity-50",
39
+ children: /* @__PURE__ */ jsx(ChevronDownIcon, {})
40
+ })]
41
+ });
47
42
  }
48
43
  function SelectScrollUpButton({ className, ...props }) {
49
- return /*#__PURE__*/ jsx(ScrollUpButton, {
50
- className: cn("flex items-center justify-center py-1 text-muted-foreground", className),
51
- "data-slot": "select-scroll-up-button",
52
- ...props,
53
- children: /*#__PURE__*/ jsx(ChevronUpIcon, {
54
- size: 16
55
- })
56
- });
44
+ return /* @__PURE__ */ jsx(SelectPrimitive.ScrollUpButton, {
45
+ className: cn("flex items-center justify-center py-1 text-muted-foreground", className),
46
+ "data-slot": "select-scroll-up-button",
47
+ ...props,
48
+ children: /* @__PURE__ */ jsx(ChevronUpIcon, { size: 16 })
49
+ });
57
50
  }
58
51
  function SelectScrollDownButton({ className, ...props }) {
59
- return /*#__PURE__*/ jsx(ScrollDownButton, {
60
- className: cn("flex items-center justify-center py-1 text-muted-foreground", className),
61
- "data-slot": "select-scroll-down-button",
62
- ...props,
63
- children: /*#__PURE__*/ jsx(ChevronDownIcon, {
64
- size: 16
65
- })
66
- });
52
+ return /* @__PURE__ */ jsx(SelectPrimitive.ScrollDownButton, {
53
+ className: cn("flex items-center justify-center py-1 text-muted-foreground", className),
54
+ "data-slot": "select-scroll-down-button",
55
+ ...props,
56
+ children: /* @__PURE__ */ jsx(ChevronDownIcon, { size: 16 })
57
+ });
67
58
  }
68
59
  function SelectContent({ children, className, position = "popper", ...props }) {
69
- return /*#__PURE__*/ jsx(Portal, {
70
- children: /*#__PURE__*/ jsxs(Content, {
71
- className: cn("relative z-50 max-h-(--radix-select-content-available-height) min-w-32 origin-(--radix-select-content-transform-origin) overflow-hidden rounded-lg border bg-popover text-popover-foreground shadow-lg ease-ui data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=top]:slide-in-from-bottom-2", "popper" === position && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", className),
72
- "data-slot": "select-content",
73
- position: position,
74
- ...props,
75
- children: [
76
- /*#__PURE__*/ jsx(SelectScrollUpButton, {}),
77
- /*#__PURE__*/ jsx(Viewport, {
78
- className: cn("p-1", "popper" === position && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),
79
- children: children
80
- }),
81
- /*#__PURE__*/ jsx(SelectScrollDownButton, {})
82
- ]
83
- })
84
- });
60
+ return /* @__PURE__ */ jsx(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs(SelectPrimitive.Content, {
61
+ className: cn("relative z-50 max-h-(--radix-select-content-available-height) min-w-32 origin-(--radix-select-content-transform-origin) overflow-hidden rounded-lg border bg-popover text-popover-foreground shadow-lg ease-ui data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=top]:slide-in-from-bottom-2", position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", className),
62
+ "data-slot": "select-content",
63
+ position,
64
+ ...props,
65
+ children: [
66
+ /* @__PURE__ */ jsx(SelectScrollUpButton, {}),
67
+ /* @__PURE__ */ jsx(SelectPrimitive.Viewport, {
68
+ className: cn("p-1", position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),
69
+ children
70
+ }),
71
+ /* @__PURE__ */ jsx(SelectScrollDownButton, {})
72
+ ]
73
+ }) });
85
74
  }
86
75
  function SelectLabel({ className, ...props }) {
87
- return /*#__PURE__*/ jsx(Label, {
88
- className: cn("flex items-center gap-x-2 px-2 py-1.5 text-sm font-semibold", className),
89
- "data-slot": "select-label",
90
- ...props
91
- });
76
+ return /* @__PURE__ */ jsx(SelectPrimitive.Label, {
77
+ className: cn("flex items-center gap-x-2 px-2 py-1.5 text-sm font-semibold", className),
78
+ "data-slot": "select-label",
79
+ ...props
80
+ });
92
81
  }
93
82
  function SelectItem({ children, className, ...props }) {
94
- return /*#__PURE__*/ jsxs(Item, {
95
- className: cn("relative flex w-full cursor-default items-center rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground aria-disabled:opacity-50 [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:[&_svg:not([class*='text-'])]:text-destructive/80 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", className),
96
- "data-slot": "select-item",
97
- ...props,
98
- children: [
99
- /*#__PURE__*/ jsx("span", {
100
- className: "absolute right-2 flex items-center justify-center",
101
- children: /*#__PURE__*/ jsx(ItemIndicator, {
102
- children: /*#__PURE__*/ jsx(CheckIcon, {
103
- className: "size-4"
104
- })
105
- })
106
- }),
107
- /*#__PURE__*/ jsx(ItemText, {
108
- children: children
109
- })
110
- ]
111
- });
83
+ return /* @__PURE__ */ jsxs(SelectPrimitive.Item, {
84
+ className: cn("relative flex w-full cursor-default items-center rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground aria-disabled:opacity-50 [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:[&_svg:not([class*='text-'])]:text-destructive/80 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", className),
85
+ "data-slot": "select-item",
86
+ ...props,
87
+ children: [/* @__PURE__ */ jsx("span", {
88
+ className: "absolute right-2 flex items-center justify-center",
89
+ children: /* @__PURE__ */ jsx(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-4" }) })
90
+ }), /* @__PURE__ */ jsx(SelectPrimitive.ItemText, { children })]
91
+ });
112
92
  }
113
93
  function SelectSeparator({ className, ...props }) {
114
- return /*#__PURE__*/ jsx(Separator, {
115
- className: cn("mx-2 my-1 h-px bg-border", className),
116
- "data-slot": "select-separator",
117
- ...props
118
- });
94
+ return /* @__PURE__ */ jsx(SelectPrimitive.Separator, {
95
+ className: cn("mx-2 my-1 h-px bg-border", className),
96
+ "data-slot": "select-separator",
97
+ ...props
98
+ });
119
99
  }
100
+ //#endregion
120
101
  export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue };
@@ -1,22 +1,32 @@
1
- import type { VariantProps } from "@codefast/tailwind-variants";
2
- import type { ComponentProps, JSX } from "react";
1
+ import * as _$_codefast_tailwind_variants0 from "@codefast/tailwind-variants";
2
+ import { VariantProps } from "@codefast/tailwind-variants";
3
3
  import * as SeparatorPrimitive from "@radix-ui/react-separator";
4
- declare const separatorVariants: import("@codefast/tailwind-variants").VariantFunctionType<{
5
- align: {
6
- center: string;
7
- end: string;
8
- start: string;
9
- };
10
- orientation: {
11
- horizontal: string;
12
- vertical: string;
13
- };
4
+ import { ComponentProps, JSX } from "react";
5
+
6
+ //#region src/components/separator.d.ts
7
+ declare const separatorVariants: _$_codefast_tailwind_variants0.VariantFunctionType<{
8
+ align: {
9
+ center: string;
10
+ end: string;
11
+ start: string;
12
+ };
13
+ orientation: {
14
+ horizontal: string;
15
+ vertical: string;
16
+ };
14
17
  }, Record<string, never>>;
15
- interface SeparatorProps extends ComponentProps<typeof SeparatorPrimitive.Root>, Omit<VariantProps<typeof separatorVariants>, "orientation"> {
16
- }
17
- declare function Separator({ align, className, decorative, orientation, ...props }: SeparatorProps): JSX.Element;
18
+ interface SeparatorProps extends ComponentProps<typeof SeparatorPrimitive.Root>, Omit<VariantProps<typeof separatorVariants>, "orientation"> {}
19
+ declare function Separator({
20
+ align,
21
+ className,
22
+ decorative,
23
+ orientation,
24
+ ...props
25
+ }: SeparatorProps): JSX.Element;
18
26
  type SeparatorItemProps = ComponentProps<"div">;
19
- declare function SeparatorItem({ className, ...props }: SeparatorItemProps): JSX.Element;
20
- export { separatorVariants };
21
- export { Separator, SeparatorItem };
22
- export type { SeparatorItemProps, SeparatorProps };
27
+ declare function SeparatorItem({
28
+ className,
29
+ ...props
30
+ }: SeparatorItemProps): JSX.Element;
31
+ //#endregion
32
+ export { Separator, SeparatorItem, type SeparatorItemProps, type SeparatorProps, separatorVariants };