@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,55 +1,57 @@
1
- import { jsx } from "react/jsx-runtime";
2
1
  import { tv } from "@codefast/tailwind-variants";
3
2
  import { Slot } from "@radix-ui/react-slot";
3
+ import { jsx } from "react/jsx-runtime";
4
+ //#region src/components/button.tsx
4
5
  const buttonVariants = tv({
5
- base: "inline-flex shrink-0 items-center justify-center gap-2 rounded-lg text-sm font-medium whitespace-nowrap outline-hidden transition select-none focus-visible:ring-3 disabled:opacity-50 [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
6
- defaultVariants: {
7
- size: "md",
8
- variant: "default"
9
- },
10
- variants: {
11
- size: {
12
- "icon-sm": "size-8",
13
- icon: "size-9",
14
- "icon-lg": "size-10",
15
- sm: "h-8 px-3 has-[>svg]:px-2.5",
16
- md: "h-9 px-4 has-[>svg]:px-3",
17
- lg: "h-10 px-6 has-[>svg]:px-4"
18
- },
19
- variant: {
20
- default: "bg-primary text-primary-foreground hover:not-disabled:bg-primary/80 focus-visible:ring-primary/20 dark:focus-visible:ring-primary/40",
21
- destructive: "bg-destructive text-white hover:not-disabled:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",
22
- ghost: "hover:not-disabled:bg-secondary hover:not-disabled:text-secondary-foreground focus-visible:ring-ring/50 dark:hover:not-disabled:bg-secondary/50",
23
- link: "text-primary underline-offset-4 hover:not-disabled:underline focus-visible:ring-ring/50",
24
- outline: "border border-input shadow-xs hover:not-disabled:border-ring/60 hover:not-disabled:bg-secondary hover:not-disabled:text-secondary-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive focus-within:aria-invalid:ring-destructive/20 hover:not-disabled:aria-invalid:border-destructive/60 dark:bg-input/30 dark:hover:not-disabled:bg-input/50 dark:aria-invalid:border-destructive/70 dark:focus-within:aria-invalid:ring-destructive/40",
25
- secondary: "bg-secondary text-secondary-foreground hover:not-disabled:bg-secondary/80 focus-visible:ring-ring/50"
26
- }
27
- }
6
+ base: "inline-flex shrink-0 items-center justify-center gap-2 rounded-lg text-sm font-medium whitespace-nowrap outline-hidden transition select-none focus-visible:ring-3 disabled:opacity-50 [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
7
+ defaultVariants: {
8
+ size: "md",
9
+ variant: "default"
10
+ },
11
+ variants: {
12
+ size: {
13
+ "icon-sm": "size-8",
14
+ icon: "size-9",
15
+ "icon-lg": "size-10",
16
+ sm: "h-8 px-3 has-[>svg]:px-2.5",
17
+ md: "h-9 px-4 has-[>svg]:px-3",
18
+ lg: "h-10 px-6 has-[>svg]:px-4"
19
+ },
20
+ variant: {
21
+ default: "bg-primary text-primary-foreground hover:not-disabled:bg-primary/80 focus-visible:ring-primary/20 dark:focus-visible:ring-primary/40",
22
+ destructive: "bg-destructive text-white hover:not-disabled:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",
23
+ ghost: "hover:not-disabled:bg-secondary hover:not-disabled:text-secondary-foreground focus-visible:ring-ring/50 dark:hover:not-disabled:bg-secondary/50",
24
+ link: "text-primary underline-offset-4 hover:not-disabled:underline focus-visible:ring-ring/50",
25
+ outline: "border border-input shadow-xs hover:not-disabled:border-ring/60 hover:not-disabled:bg-secondary hover:not-disabled:text-secondary-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive focus-within:aria-invalid:ring-destructive/20 hover:not-disabled:aria-invalid:border-destructive/60 dark:bg-input/30 dark:hover:not-disabled:bg-input/50 dark:aria-invalid:border-destructive/70 dark:focus-within:aria-invalid:ring-destructive/40",
26
+ secondary: "bg-secondary text-secondary-foreground hover:not-disabled:bg-secondary/80 focus-visible:ring-ring/50"
27
+ }
28
+ }
28
29
  });
29
30
  function Button({ asChild = false, children, className, size, type = "button", variant, ...props }) {
30
- const Comp = asChild ? Slot : "button";
31
- if (asChild) return /*#__PURE__*/ jsx(Comp, {
32
- className: buttonVariants({
33
- className,
34
- size,
35
- variant
36
- }),
37
- "data-slot": "button",
38
- "data-variant": variant,
39
- ...props,
40
- children: children
41
- });
42
- return /*#__PURE__*/ jsx("button", {
43
- className: buttonVariants({
44
- className,
45
- size,
46
- variant
47
- }),
48
- "data-slot": "button",
49
- "data-variant": variant,
50
- type: type,
51
- ...props,
52
- children: children
53
- });
31
+ const Comp = asChild ? Slot : "button";
32
+ if (asChild) return /* @__PURE__ */ jsx(Comp, {
33
+ className: buttonVariants({
34
+ className,
35
+ size,
36
+ variant
37
+ }),
38
+ "data-slot": "button",
39
+ "data-variant": variant,
40
+ ...props,
41
+ children
42
+ });
43
+ return /* @__PURE__ */ jsx("button", {
44
+ className: buttonVariants({
45
+ className,
46
+ size,
47
+ variant
48
+ }),
49
+ "data-slot": "button",
50
+ "data-variant": variant,
51
+ type,
52
+ ...props,
53
+ children
54
+ });
54
55
  }
56
+ //#endregion
55
57
  export { Button, buttonVariants };
@@ -1,12 +1,27 @@
1
- import type { ComponentProps, JSX } from "react";
2
- import type { DayButton } from "react-day-picker";
3
- import { DayPicker } from "react-day-picker";
4
- import { Button } from "./button";
1
+ import { Button } from "./button.js";
2
+ import { ComponentProps, JSX } from "react";
3
+ import { DayButton, DayPicker } from "react-day-picker";
4
+
5
+ //#region src/components/calendar.d.ts
5
6
  type CalendarProps = ComponentProps<typeof DayPicker> & {
6
- buttonVariant?: ComponentProps<typeof Button>["variant"];
7
+ buttonVariant?: ComponentProps<typeof Button>["variant"];
7
8
  };
8
- declare function Calendar({ buttonVariant, captionLayout, className, classNames, components, formatters, showOutsideDays, ...props }: CalendarProps): JSX.Element;
9
+ declare function Calendar({
10
+ buttonVariant,
11
+ captionLayout,
12
+ className,
13
+ classNames,
14
+ components,
15
+ formatters,
16
+ showOutsideDays,
17
+ ...props
18
+ }: CalendarProps): JSX.Element;
9
19
  type CalendarDayButtonProps = ComponentProps<typeof DayButton>;
10
- declare function CalendarDayButton({ className, day, modifiers, ...props }: CalendarDayButtonProps): JSX.Element;
11
- export { Calendar, CalendarDayButton };
12
- export type { CalendarDayButtonProps, CalendarProps };
20
+ declare function CalendarDayButton({
21
+ className,
22
+ day,
23
+ modifiers,
24
+ ...props
25
+ }: CalendarDayButtonProps): JSX.Element;
26
+ //#endregion
27
+ export { Calendar, CalendarDayButton, type CalendarDayButtonProps, type CalendarProps };
@@ -1,114 +1,108 @@
1
1
  "use client";
2
- import { jsx } from "react/jsx-runtime";
2
+ import { Button, buttonVariants } from "./button.js";
3
3
  import { cn } from "@codefast/tailwind-variants";
4
4
  import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
5
+ import { jsx } from "react/jsx-runtime";
5
6
  import { useEffect, useRef } from "react";
6
7
  import { DayPicker, getDefaultClassNames } from "react-day-picker";
7
- import { Button, buttonVariants } from "./button.js";
8
+ //#region src/components/calendar.tsx
8
9
  function Calendar({ buttonVariant = "ghost", captionLayout = "label", className, classNames, components, formatters, showOutsideDays = true, ...props }) {
9
- const defaultClassNames = getDefaultClassNames();
10
- return /*#__PURE__*/ jsx(DayPicker, {
11
- captionLayout: captionLayout,
12
- className: cn("group/calendar bg-background p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent", "rtl:**:[.rdp-button_next>svg]:rotate-180", "rtl:**:[.rdp-button_previous>svg]:rotate-180", className),
13
- classNames: {
14
- button_next: cn(buttonVariants({
15
- variant: buttonVariant
16
- }), "size-(--cell-size) p-0 select-none aria-disabled:opacity-50", defaultClassNames.button_next),
17
- button_previous: cn(buttonVariants({
18
- variant: buttonVariant
19
- }), "size-(--cell-size) p-0 select-none aria-disabled:opacity-50", defaultClassNames.button_previous),
20
- caption_label: cn("font-medium select-none", "label" === captionLayout ? "text-sm" : "flex h-8 items-center gap-1 rounded-md pr-1 pl-2 text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground", defaultClassNames.caption_label),
21
- day: cn("group/day relative aspect-square h-full w-full p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-r-md", props.showWeekNumber ? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-md" : "[&:first-child[data-selected=true]_button]:rounded-l-md", defaultClassNames.day),
22
- disabled: cn("text-muted-foreground opacity-50", defaultClassNames.disabled),
23
- dropdown: cn("absolute inset-0 bg-popover opacity-0", defaultClassNames.dropdown),
24
- dropdown_root: cn("relative rounded-md border border-input shadow-xs has-focus:border-ring has-focus:ring-3 has-focus:ring-ring/50", defaultClassNames.dropdown_root),
25
- dropdowns: cn("flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium", defaultClassNames.dropdowns),
26
- hidden: cn("invisible", defaultClassNames.hidden),
27
- month: cn("flex w-full flex-col gap-4", defaultClassNames.month),
28
- month_caption: cn("flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)", defaultClassNames.month_caption),
29
- months: cn("relative flex flex-col gap-4 md:flex-row", defaultClassNames.months),
30
- nav: cn("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1", defaultClassNames.nav),
31
- outside: cn("text-muted-foreground aria-selected:text-muted-foreground", defaultClassNames.outside),
32
- range_end: cn("rounded-r-md bg-accent", defaultClassNames.range_end),
33
- range_middle: cn("rounded-none", defaultClassNames.range_middle),
34
- range_start: cn("rounded-l-md bg-accent", defaultClassNames.range_start),
35
- root: cn("w-fit", defaultClassNames.root),
36
- table: "w-full border-collapse",
37
- today: cn("rounded-md bg-accent text-accent-foreground data-[selected=true]:rounded-none", defaultClassNames.today),
38
- week: cn("mt-2 flex w-full", defaultClassNames.week),
39
- week_number: cn("text-[0.8rem] text-muted-foreground select-none", defaultClassNames.week_number),
40
- week_number_header: cn("w-(--cell-size) select-none", defaultClassNames.week_number_header),
41
- weekday: cn("flex-1 rounded-md text-[0.8rem] font-normal text-muted-foreground select-none", defaultClassNames.weekday),
42
- weekdays: cn("flex", defaultClassNames.weekdays),
43
- ...classNames
44
- },
45
- components: {
46
- Chevron: CalendarChevron,
47
- DayButton: CalendarDayButton,
48
- Root: CalendarRoot,
49
- WeekNumber: CalendarWeekNumber,
50
- ...components
51
- },
52
- formatters: {
53
- formatMonthDropdown: (date)=>date.toLocaleString("default", {
54
- month: "short"
55
- }),
56
- ...formatters
57
- },
58
- showOutsideDays: showOutsideDays,
59
- ...props
60
- });
10
+ const defaultClassNames = getDefaultClassNames();
11
+ return /* @__PURE__ */ jsx(DayPicker, {
12
+ captionLayout,
13
+ className: cn("group/calendar bg-background p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent", "rtl:**:[.rdp-button_next>svg]:rotate-180", "rtl:**:[.rdp-button_previous>svg]:rotate-180", className),
14
+ classNames: {
15
+ button_next: cn(buttonVariants({ variant: buttonVariant }), "size-(--cell-size) p-0 select-none aria-disabled:opacity-50", defaultClassNames.button_next),
16
+ button_previous: cn(buttonVariants({ variant: buttonVariant }), "size-(--cell-size) p-0 select-none aria-disabled:opacity-50", defaultClassNames.button_previous),
17
+ caption_label: cn("font-medium select-none", captionLayout === "label" ? "text-sm" : "flex h-8 items-center gap-1 rounded-md pr-1 pl-2 text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground", defaultClassNames.caption_label),
18
+ day: cn("group/day relative aspect-square h-full w-full p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-r-md", props.showWeekNumber ? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-md" : "[&:first-child[data-selected=true]_button]:rounded-l-md", defaultClassNames.day),
19
+ disabled: cn("text-muted-foreground opacity-50", defaultClassNames.disabled),
20
+ dropdown: cn("absolute inset-0 bg-popover opacity-0", defaultClassNames.dropdown),
21
+ dropdown_root: cn("relative rounded-md border border-input shadow-xs has-focus:border-ring has-focus:ring-3 has-focus:ring-ring/50", defaultClassNames.dropdown_root),
22
+ dropdowns: cn("flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium", defaultClassNames.dropdowns),
23
+ hidden: cn("invisible", defaultClassNames.hidden),
24
+ month: cn("flex w-full flex-col gap-4", defaultClassNames.month),
25
+ month_caption: cn("flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)", defaultClassNames.month_caption),
26
+ months: cn("relative flex flex-col gap-4 md:flex-row", defaultClassNames.months),
27
+ nav: cn("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1", defaultClassNames.nav),
28
+ outside: cn("text-muted-foreground aria-selected:text-muted-foreground", defaultClassNames.outside),
29
+ range_end: cn("rounded-r-md bg-accent", defaultClassNames.range_end),
30
+ range_middle: cn("rounded-none", defaultClassNames.range_middle),
31
+ range_start: cn("rounded-l-md bg-accent", defaultClassNames.range_start),
32
+ root: cn("w-fit", defaultClassNames.root),
33
+ table: "w-full border-collapse",
34
+ today: cn("rounded-md bg-accent text-accent-foreground data-[selected=true]:rounded-none", defaultClassNames.today),
35
+ week: cn("mt-2 flex w-full", defaultClassNames.week),
36
+ week_number: cn("text-[0.8rem] text-muted-foreground select-none", defaultClassNames.week_number),
37
+ week_number_header: cn("w-(--cell-size) select-none", defaultClassNames.week_number_header),
38
+ weekday: cn("flex-1 rounded-md text-[0.8rem] font-normal text-muted-foreground select-none", defaultClassNames.weekday),
39
+ weekdays: cn("flex", defaultClassNames.weekdays),
40
+ ...classNames
41
+ },
42
+ components: {
43
+ Chevron: CalendarChevron,
44
+ DayButton: CalendarDayButton,
45
+ Root: CalendarRoot,
46
+ WeekNumber: CalendarWeekNumber,
47
+ ...components
48
+ },
49
+ formatters: {
50
+ formatMonthDropdown: (date) => date.toLocaleString("default", { month: "short" }),
51
+ ...formatters
52
+ },
53
+ showOutsideDays,
54
+ ...props
55
+ });
61
56
  }
62
57
  function CalendarChevron({ className, orientation, ...props }) {
63
- if ("left" === orientation) return /*#__PURE__*/ jsx(ChevronLeftIcon, {
64
- className: cn("size-4", className),
65
- ...props
66
- });
67
- if ("right" === orientation) return /*#__PURE__*/ jsx(ChevronRightIcon, {
68
- className: cn("size-4", className),
69
- ...props
70
- });
71
- return /*#__PURE__*/ jsx(ChevronDownIcon, {
72
- className: cn("size-4", className),
73
- ...props
74
- });
58
+ if (orientation === "left") return /* @__PURE__ */ jsx(ChevronLeftIcon, {
59
+ className: cn("size-4", className),
60
+ ...props
61
+ });
62
+ if (orientation === "right") return /* @__PURE__ */ jsx(ChevronRightIcon, {
63
+ className: cn("size-4", className),
64
+ ...props
65
+ });
66
+ return /* @__PURE__ */ jsx(ChevronDownIcon, {
67
+ className: cn("size-4", className),
68
+ ...props
69
+ });
75
70
  }
76
71
  function CalendarRoot({ className, rootRef, ...props }) {
77
- return /*#__PURE__*/ jsx("div", {
78
- ref: rootRef,
79
- className: cn(className),
80
- "data-slot": "calendar",
81
- ...props
82
- });
72
+ return /* @__PURE__ */ jsx("div", {
73
+ ref: rootRef,
74
+ className: cn(className),
75
+ "data-slot": "calendar",
76
+ ...props
77
+ });
83
78
  }
84
79
  function CalendarWeekNumber({ children, ...props }) {
85
- return /*#__PURE__*/ jsx("td", {
86
- ...props,
87
- children: /*#__PURE__*/ jsx("div", {
88
- className: "flex size-(--cell-size) items-center justify-center text-center",
89
- children: children
90
- })
91
- });
80
+ return /* @__PURE__ */ jsx("td", {
81
+ ...props,
82
+ children: /* @__PURE__ */ jsx("div", {
83
+ className: "flex size-(--cell-size) items-center justify-center text-center",
84
+ children
85
+ })
86
+ });
92
87
  }
93
88
  function CalendarDayButton({ className, day, modifiers, ...props }) {
94
- const defaultClassNames = getDefaultClassNames();
95
- const ref = useRef(null);
96
- useEffect(()=>{
97
- if (modifiers.focused) ref.current?.focus();
98
- }, [
99
- modifiers.focused
100
- ]);
101
- return /*#__PURE__*/ jsx(Button, {
102
- ref: ref,
103
- className: cn("flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-3 group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground dark:hover:text-accent-foreground [&>span]:text-xs [&>span]:opacity-70", defaultClassNames.day, className),
104
- "data-day": day.date.toLocaleDateString(),
105
- "data-range-end": modifiers.range_end,
106
- "data-range-middle": modifiers.range_middle,
107
- "data-range-start": modifiers.range_start,
108
- "data-selected-single": modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle,
109
- size: "icon",
110
- variant: "ghost",
111
- ...props
112
- });
89
+ const defaultClassNames = getDefaultClassNames();
90
+ const ref = useRef(null);
91
+ useEffect(() => {
92
+ if (modifiers.focused) ref.current?.focus();
93
+ }, [modifiers.focused]);
94
+ return /* @__PURE__ */ jsx(Button, {
95
+ ref,
96
+ className: cn("flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-3 group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground dark:hover:text-accent-foreground [&>span]:text-xs [&>span]:opacity-70", defaultClassNames.day, className),
97
+ "data-day": day.date.toLocaleDateString(),
98
+ "data-range-end": modifiers.range_end,
99
+ "data-range-middle": modifiers.range_middle,
100
+ "data-range-start": modifiers.range_start,
101
+ "data-selected-single": modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle,
102
+ size: "icon",
103
+ variant: "ghost",
104
+ ...props
105
+ });
113
106
  }
107
+ //#endregion
114
108
  export { Calendar, CalendarDayButton };
@@ -1,17 +1,41 @@
1
- import type { ComponentProps, JSX } from "react";
1
+ import { ComponentProps, JSX } from "react";
2
+
3
+ //#region src/components/card.d.ts
2
4
  type CardProps = ComponentProps<"div">;
3
- declare function Card({ className, ...props }: CardProps): JSX.Element;
5
+ declare function Card({
6
+ className,
7
+ ...props
8
+ }: CardProps): JSX.Element;
4
9
  type CardHeaderProps = ComponentProps<"div">;
5
- declare function CardHeader({ className, ...props }: CardHeaderProps): JSX.Element;
10
+ declare function CardHeader({
11
+ className,
12
+ ...props
13
+ }: CardHeaderProps): JSX.Element;
6
14
  type CardTitleProps = ComponentProps<"div">;
7
- declare function CardTitle({ children, className, ...props }: CardTitleProps): JSX.Element;
15
+ declare function CardTitle({
16
+ children,
17
+ className,
18
+ ...props
19
+ }: CardTitleProps): JSX.Element;
8
20
  type CardDescriptionProps = ComponentProps<"div">;
9
- declare function CardDescription({ className, ...props }: CardDescriptionProps): JSX.Element;
21
+ declare function CardDescription({
22
+ className,
23
+ ...props
24
+ }: CardDescriptionProps): JSX.Element;
10
25
  type CardContentProps = ComponentProps<"div">;
11
- declare function CardContent({ className, ...props }: CardContentProps): JSX.Element;
26
+ declare function CardContent({
27
+ className,
28
+ ...props
29
+ }: CardContentProps): JSX.Element;
12
30
  type CardFooterProps = ComponentProps<"div">;
13
- declare function CardFooter({ className, ...props }: CardFooterProps): JSX.Element;
31
+ declare function CardFooter({
32
+ className,
33
+ ...props
34
+ }: CardFooterProps): JSX.Element;
14
35
  type CardActionProps = ComponentProps<"div">;
15
- declare function CardAction({ className, ...props }: CardActionProps): JSX.Element;
16
- export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
17
- export type { CardActionProps, CardContentProps, CardDescriptionProps, CardFooterProps, CardHeaderProps, CardProps, CardTitleProps, };
36
+ declare function CardAction({
37
+ className,
38
+ ...props
39
+ }: CardActionProps): JSX.Element;
40
+ //#endregion
41
+ export { Card, CardAction, type CardActionProps, CardContent, type CardContentProps, CardDescription, type CardDescriptionProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, CardTitle, type CardTitleProps };
@@ -1,53 +1,55 @@
1
- import { jsx } from "react/jsx-runtime";
2
1
  import { cn } from "@codefast/tailwind-variants";
2
+ import { jsx } from "react/jsx-runtime";
3
+ //#region src/components/card.tsx
3
4
  function Card({ className, ...props }) {
4
- return /*#__PURE__*/ jsx("div", {
5
- className: cn("flex flex-col gap-6 overflow-auto rounded-xl border bg-card py-6 text-card-foreground shadow-sm", className),
6
- "data-slot": "card",
7
- ...props
8
- });
5
+ return /* @__PURE__ */ jsx("div", {
6
+ className: cn("flex flex-col gap-6 overflow-auto rounded-xl border bg-card py-6 text-card-foreground shadow-sm", className),
7
+ "data-slot": "card",
8
+ ...props
9
+ });
9
10
  }
10
11
  function CardHeader({ className, ...props }) {
11
- return /*#__PURE__*/ jsx("div", {
12
- className: cn("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-[data-slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6", className),
13
- "data-slot": "card-header",
14
- ...props
15
- });
12
+ return /* @__PURE__ */ jsx("div", {
13
+ className: cn("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-[data-slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6", className),
14
+ "data-slot": "card-header",
15
+ ...props
16
+ });
16
17
  }
17
18
  function CardTitle({ children, className, ...props }) {
18
- return /*#__PURE__*/ jsx("div", {
19
- className: cn("leading-none font-semibold", className),
20
- "data-slot": "card-title",
21
- ...props,
22
- children: children
23
- });
19
+ return /* @__PURE__ */ jsx("div", {
20
+ className: cn("leading-none font-semibold", className),
21
+ "data-slot": "card-title",
22
+ ...props,
23
+ children
24
+ });
24
25
  }
25
26
  function CardDescription({ className, ...props }) {
26
- return /*#__PURE__*/ jsx("div", {
27
- className: cn("text-sm text-muted-foreground", className),
28
- "data-slot": "card-description",
29
- ...props
30
- });
27
+ return /* @__PURE__ */ jsx("div", {
28
+ className: cn("text-sm text-muted-foreground", className),
29
+ "data-slot": "card-description",
30
+ ...props
31
+ });
31
32
  }
32
33
  function CardContent({ className, ...props }) {
33
- return /*#__PURE__*/ jsx("div", {
34
- className: cn("px-6", className),
35
- "data-slot": "card-content",
36
- ...props
37
- });
34
+ return /* @__PURE__ */ jsx("div", {
35
+ className: cn("px-6", className),
36
+ "data-slot": "card-content",
37
+ ...props
38
+ });
38
39
  }
39
40
  function CardFooter({ className, ...props }) {
40
- return /*#__PURE__*/ jsx("div", {
41
- className: cn("flex items-center px-6 [.border-t]:pt-6", className),
42
- "data-slot": "card-footer",
43
- ...props
44
- });
41
+ return /* @__PURE__ */ jsx("div", {
42
+ className: cn("flex items-center px-6 [.border-t]:pt-6", className),
43
+ "data-slot": "card-footer",
44
+ ...props
45
+ });
45
46
  }
46
47
  function CardAction({ className, ...props }) {
47
- return /*#__PURE__*/ jsx("div", {
48
- className: cn("col-start-2 row-span-2 row-start-1 self-start justify-self-end", className),
49
- "data-slot": "card-action",
50
- ...props
51
- });
48
+ return /* @__PURE__ */ jsx("div", {
49
+ className: cn("col-start-2 row-span-2 row-start-1 self-start justify-self-end", className),
50
+ "data-slot": "card-action",
51
+ ...props
52
+ });
52
53
  }
54
+ //#endregion
53
55
  export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
@@ -1,37 +1,68 @@
1
- import type { Scope } from "@radix-ui/react-context";
2
- import type { UseEmblaCarouselType } from "embla-carousel-react";
3
- import type { ComponentProps, JSX } from "react";
4
- import useEmblaCarousel from "embla-carousel-react";
5
- import { Button } from "./button";
1
+ import { Button } from "./button.js";
2
+ import { ComponentProps, JSX } from "react";
3
+ import * as _$_radix_ui_react_context0 from "@radix-ui/react-context";
4
+ import { Scope } from "@radix-ui/react-context";
5
+ import useEmblaCarousel, { UseEmblaCarouselType } from "embla-carousel-react";
6
+
7
+ //#region src/components/carousel.d.ts
6
8
  type ScopedProps<P> = P & {
7
- __scopeCarousel?: Scope;
9
+ __scopeCarousel?: Scope;
8
10
  };
9
- declare const createCarouselScope: import("@radix-ui/react-context").CreateScope;
11
+ declare const createCarouselScope: _$_radix_ui_react_context0.CreateScope;
10
12
  type CarouselApi = UseEmblaCarouselType[1];
11
13
  type UseCarouselParameters = Parameters<typeof useEmblaCarousel>;
12
14
  type CarouselOptions = UseCarouselParameters[0];
13
15
  type CarouselPlugin = UseCarouselParameters[1];
14
16
  interface BaseCarouselProps {
15
- opts?: CarouselOptions;
16
- orientation?: "horizontal" | "vertical";
17
- plugins?: CarouselPlugin;
18
- setApi?: (api: CarouselApi) => void;
17
+ opts?: CarouselOptions;
18
+ orientation?: "horizontal" | "vertical";
19
+ plugins?: CarouselPlugin;
20
+ setApi?: (api: CarouselApi) => void;
19
21
  }
20
- interface CarouselProps extends BaseCarouselProps, ComponentProps<"div"> {
21
- }
22
- declare function Carousel({ __scopeCarousel, children, className, opts, orientation, plugins, setApi, ...props }: ScopedProps<CarouselProps>): JSX.Element;
22
+ interface CarouselProps extends BaseCarouselProps, ComponentProps<"div"> {}
23
+ declare function Carousel({
24
+ __scopeCarousel,
25
+ children,
26
+ className,
27
+ opts,
28
+ orientation,
29
+ plugins,
30
+ setApi,
31
+ ...props
32
+ }: ScopedProps<CarouselProps>): JSX.Element;
23
33
  interface CarouselContentProps extends ComponentProps<"div"> {
24
- classNames?: {
25
- content?: string;
26
- wrapper?: string;
27
- };
34
+ classNames?: {
35
+ content?: string;
36
+ wrapper?: string;
37
+ };
28
38
  }
29
- declare function CarouselContent({ __scopeCarousel, className, classNames, ...props }: ScopedProps<CarouselContentProps>): JSX.Element;
39
+ declare function CarouselContent({
40
+ __scopeCarousel,
41
+ className,
42
+ classNames,
43
+ ...props
44
+ }: ScopedProps<CarouselContentProps>): JSX.Element;
30
45
  type CarouselItemProps = ComponentProps<"div">;
31
- declare function CarouselItem({ __scopeCarousel, className, ...props }: ScopedProps<CarouselItemProps>): JSX.Element;
46
+ declare function CarouselItem({
47
+ __scopeCarousel,
48
+ className,
49
+ ...props
50
+ }: ScopedProps<CarouselItemProps>): JSX.Element;
32
51
  type CarouselPreviousProps = ComponentProps<typeof Button>;
33
- declare function CarouselPrevious({ __scopeCarousel, className, size, variant, ...props }: ScopedProps<CarouselPreviousProps>): JSX.Element;
52
+ declare function CarouselPrevious({
53
+ __scopeCarousel,
54
+ className,
55
+ size,
56
+ variant,
57
+ ...props
58
+ }: ScopedProps<CarouselPreviousProps>): JSX.Element;
34
59
  type CarouselNextProps = ComponentProps<typeof Button>;
35
- declare function CarouselNext({ __scopeCarousel, className, size, variant, ...props }: ScopedProps<CarouselNextProps>): JSX.Element;
36
- export type { CarouselApi, CarouselContentProps, CarouselItemProps, CarouselNextProps, CarouselPreviousProps, CarouselProps, };
37
- export { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, createCarouselScope, };
60
+ declare function CarouselNext({
61
+ __scopeCarousel,
62
+ className,
63
+ size,
64
+ variant,
65
+ ...props
66
+ }: ScopedProps<CarouselNextProps>): JSX.Element;
67
+ //#endregion
68
+ export { Carousel, type CarouselApi, CarouselContent, type CarouselContentProps, CarouselItem, type CarouselItemProps, CarouselNext, type CarouselNextProps, CarouselPrevious, type CarouselPreviousProps, type CarouselProps, createCarouselScope };