@codefast/ui 0.3.9 → 0.3.10

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 (245) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/components/accordion.cjs +97 -1
  3. package/dist/components/accordion.d.ts +4 -4
  4. package/dist/components/accordion.js +51 -1
  5. package/dist/components/alert-dialog.cjs +155 -1
  6. package/dist/components/alert-dialog.d.ts +11 -11
  7. package/dist/components/alert-dialog.js +94 -1
  8. package/dist/components/alert.cjs +84 -1
  9. package/dist/components/alert.d.ts +5 -5
  10. package/dist/components/alert.js +41 -1
  11. package/dist/components/aspect-ratio.cjs +43 -1
  12. package/dist/components/aspect-ratio.d.ts +2 -2
  13. package/dist/components/aspect-ratio.js +9 -1
  14. package/dist/components/avatar.cjs +65 -1
  15. package/dist/components/avatar.d.ts +2 -2
  16. package/dist/components/avatar.js +25 -1
  17. package/dist/components/badge.cjs +66 -1
  18. package/dist/components/badge.d.ts +3 -3
  19. package/dist/components/badge.js +29 -1
  20. package/dist/components/breadcrumb.cjs +126 -1
  21. package/dist/components/breadcrumb.d.ts +8 -8
  22. package/dist/components/breadcrumb.js +74 -1
  23. package/dist/components/button-group.cjs +86 -1
  24. package/dist/components/button-group.d.ts +5 -5
  25. package/dist/components/button-group.js +43 -1
  26. package/dist/components/button.cjs +92 -1
  27. package/dist/components/button.d.ts +6 -6
  28. package/dist/components/button.js +55 -1
  29. package/dist/components/calendar.cjs +150 -1
  30. package/dist/components/calendar.d.ts +12 -19
  31. package/dist/components/calendar.js +113 -1
  32. package/dist/components/card.cjs +105 -1
  33. package/dist/components/card.d.ts +8 -8
  34. package/dist/components/card.js +53 -1
  35. package/dist/components/carousel.cjs +210 -1
  36. package/dist/components/carousel.d.ts +10 -10
  37. package/dist/components/carousel.js +151 -1
  38. package/dist/components/chart.cjs +250 -3
  39. package/dist/components/chart.d.ts +9 -9
  40. package/dist/components/chart.js +198 -3
  41. package/dist/components/checkbox-cards.cjs +69 -1
  42. package/dist/components/checkbox-cards.d.ts +2 -2
  43. package/dist/components/checkbox-cards.js +32 -1
  44. package/dist/components/checkbox-group.cjs +63 -1
  45. package/dist/components/checkbox-group.d.ts +2 -2
  46. package/dist/components/checkbox-group.js +26 -1
  47. package/dist/components/checkbox.cjs +53 -1
  48. package/dist/components/checkbox.d.ts +2 -2
  49. package/dist/components/checkbox.js +19 -1
  50. package/dist/components/collapsible.cjs +61 -1
  51. package/dist/components/collapsible.d.ts +2 -2
  52. package/dist/components/collapsible.js +21 -1
  53. package/dist/components/command.cjs +167 -1
  54. package/dist/components/command.d.ts +4 -4
  55. package/dist/components/command.js +106 -1
  56. package/dist/components/context-menu.cjs +218 -1
  57. package/dist/components/context-menu.d.ts +4 -4
  58. package/dist/components/context-menu.js +142 -1
  59. package/dist/components/dialog.cjs +164 -1
  60. package/dist/components/dialog.d.ts +10 -10
  61. package/dist/components/dialog.js +106 -1
  62. package/dist/components/drawer.cjs +143 -1
  63. package/dist/components/drawer.d.ts +9 -9
  64. package/dist/components/drawer.js +85 -1
  65. package/dist/components/dropdown-menu.cjs +221 -1
  66. package/dist/components/dropdown-menu.d.ts +4 -4
  67. package/dist/components/dropdown-menu.js +145 -1
  68. package/dist/components/empty.cjs +113 -1
  69. package/dist/components/empty.d.ts +9 -9
  70. package/dist/components/empty.js +61 -1
  71. package/dist/components/field.cjs +193 -1
  72. package/dist/components/field.d.ts +14 -14
  73. package/dist/components/field.js +129 -1
  74. package/dist/components/form.cjs +151 -1
  75. package/dist/components/form.d.ts +10 -10
  76. package/dist/components/form.js +96 -1
  77. package/dist/components/hover-card.cjs +77 -1
  78. package/dist/components/hover-card.d.ts +2 -2
  79. package/dist/components/hover-card.js +34 -1
  80. package/dist/components/input-group.cjs +155 -1
  81. package/dist/components/input-group.d.ts +15 -15
  82. package/dist/components/input-group.js +97 -1
  83. package/dist/components/input-number.cjs +98 -1
  84. package/dist/components/input-number.d.ts +2 -2
  85. package/dist/components/input-number.js +64 -1
  86. package/dist/components/input-otp.cjs +101 -1
  87. package/dist/components/input-otp.d.ts +6 -6
  88. package/dist/components/input-otp.js +49 -1
  89. package/dist/components/input-password.cjs +71 -1
  90. package/dist/components/input-password.d.ts +3 -3
  91. package/dist/components/input-password.js +37 -1
  92. package/dist/components/input-search.cjs +80 -1
  93. package/dist/components/input-search.d.ts +3 -3
  94. package/dist/components/input-search.js +46 -1
  95. package/dist/components/input.cjs +45 -1
  96. package/dist/components/input.d.ts +2 -2
  97. package/dist/components/input.js +11 -1
  98. package/dist/components/item.cjs +186 -1
  99. package/dist/components/item.d.ts +12 -12
  100. package/dist/components/item.js +119 -1
  101. package/dist/components/kbd.cjs +54 -1
  102. package/dist/components/kbd.d.ts +3 -3
  103. package/dist/components/kbd.js +17 -1
  104. package/dist/components/label.cjs +45 -1
  105. package/dist/components/label.d.ts +2 -2
  106. package/dist/components/label.js +11 -1
  107. package/dist/components/menubar.cjs +232 -1
  108. package/dist/components/menubar.d.ts +4 -4
  109. package/dist/components/menubar.js +153 -1
  110. package/dist/components/native-select.cjs +75 -1
  111. package/dist/components/native-select.d.ts +4 -4
  112. package/dist/components/native-select.js +35 -1
  113. package/dist/components/navigation-menu.cjs +146 -2
  114. package/dist/components/navigation-menu.d.ts +2 -2
  115. package/dist/components/navigation-menu.js +94 -2
  116. package/dist/components/pagination.cjs +138 -1
  117. package/dist/components/pagination.d.ts +10 -10
  118. package/dist/components/pagination.js +86 -1
  119. package/dist/components/popover.cjs +86 -1
  120. package/dist/components/popover.d.ts +3 -3
  121. package/dist/components/popover.js +40 -1
  122. package/dist/components/progress-circle.cjs +184 -1
  123. package/dist/components/progress-circle.d.ts +5 -5
  124. package/dist/components/progress-circle.js +147 -1
  125. package/dist/components/progress.cjs +52 -1
  126. package/dist/components/progress.d.ts +2 -2
  127. package/dist/components/progress.js +18 -1
  128. package/dist/components/radio-cards.cjs +66 -1
  129. package/dist/components/radio-cards.d.ts +2 -2
  130. package/dist/components/radio-cards.js +29 -1
  131. package/dist/components/radio-group.cjs +59 -1
  132. package/dist/components/radio-group.d.ts +2 -2
  133. package/dist/components/radio-group.js +22 -1
  134. package/dist/components/radio.cjs +47 -1
  135. package/dist/components/radio.d.ts +2 -2
  136. package/dist/components/radio.js +13 -1
  137. package/dist/components/resizable.cjs +71 -1
  138. package/dist/components/resizable.d.ts +8 -8
  139. package/dist/components/resizable.js +31 -1
  140. package/dist/components/scroll-area.cjs +140 -1
  141. package/dist/components/scroll-area.d.ts +5 -5
  142. package/dist/components/scroll-area.js +100 -1
  143. package/dist/components/select.cjs +180 -1
  144. package/dist/components/select.d.ts +5 -5
  145. package/dist/components/select.js +119 -1
  146. package/dist/components/separator.cjs +82 -1
  147. package/dist/components/separator.d.ts +5 -5
  148. package/dist/components/separator.js +42 -1
  149. package/dist/components/sheet.cjs +184 -1
  150. package/dist/components/sheet.d.ts +9 -9
  151. package/dist/components/sheet.js +123 -1
  152. package/dist/components/sidebar.cjs +506 -1
  153. package/dist/components/sidebar.d.ts +31 -31
  154. package/dist/components/sidebar.js +400 -1
  155. package/dist/components/skeleton.cjs +44 -1
  156. package/dist/components/skeleton.d.ts +2 -2
  157. package/dist/components/skeleton.js +10 -1
  158. package/dist/components/slider.cjs +79 -1
  159. package/dist/components/slider.d.ts +2 -2
  160. package/dist/components/slider.js +45 -1
  161. package/dist/components/sonner.cjs +57 -1
  162. package/dist/components/sonner.d.ts +3 -3
  163. package/dist/components/sonner.js +17 -1
  164. package/dist/components/spinner.cjs +75 -1
  165. package/dist/components/spinner.d.ts +2 -2
  166. package/dist/components/spinner.js +41 -1
  167. package/dist/components/switch.cjs +49 -1
  168. package/dist/components/switch.d.ts +2 -2
  169. package/dist/components/switch.js +15 -1
  170. package/dist/components/table.cjs +118 -1
  171. package/dist/components/table.d.ts +9 -9
  172. package/dist/components/table.js +63 -1
  173. package/dist/components/tabs.cjs +75 -1
  174. package/dist/components/tabs.d.ts +3 -3
  175. package/dist/components/tabs.js +32 -1
  176. package/dist/components/textarea.cjs +44 -1
  177. package/dist/components/textarea.d.ts +2 -2
  178. package/dist/components/textarea.js +10 -1
  179. package/dist/components/toggle-group.cjs +90 -1
  180. package/dist/components/toggle-group.d.ts +10 -12
  181. package/dist/components/toggle-group.js +53 -1
  182. package/dist/components/toggle.cjs +71 -1
  183. package/dist/components/toggle.d.ts +10 -12
  184. package/dist/components/toggle.js +34 -1
  185. package/dist/components/tooltip.cjs +90 -1
  186. package/dist/components/tooltip.d.ts +3 -3
  187. package/dist/components/tooltip.js +44 -1
  188. package/dist/css/amber.css +95 -1
  189. package/dist/css/blue.css +95 -1
  190. package/dist/css/cyan.css +95 -1
  191. package/dist/css/emerald.css +95 -1
  192. package/dist/css/fuchsia.css +95 -1
  193. package/dist/css/gray.css +95 -1
  194. package/dist/css/green.css +95 -1
  195. package/dist/css/indigo.css +95 -1
  196. package/dist/css/lime.css +95 -1
  197. package/dist/css/neutral.css +95 -1
  198. package/dist/css/orange.css +95 -1
  199. package/dist/css/pink.css +95 -1
  200. package/dist/css/preset.css +118 -1
  201. package/dist/css/purple.css +95 -1
  202. package/dist/css/red.css +95 -1
  203. package/dist/css/rose.css +95 -1
  204. package/dist/css/sky.css +95 -1
  205. package/dist/css/slate.css +95 -1
  206. package/dist/css/stone.css +95 -1
  207. package/dist/css/style.css +3 -1
  208. package/dist/css/teal.css +95 -1
  209. package/dist/css/violet.css +95 -1
  210. package/dist/css/yellow.css +95 -1
  211. package/dist/css/zinc.css +95 -1
  212. package/dist/hooks/use-animated-value.cjs +74 -1
  213. package/dist/hooks/use-animated-value.d.ts +9 -10
  214. package/dist/hooks/use-animated-value.js +40 -1
  215. package/dist/hooks/use-copy-to-clipboard.cjs +57 -1
  216. package/dist/hooks/use-copy-to-clipboard.d.ts +18 -1
  217. package/dist/hooks/use-copy-to-clipboard.js +23 -1
  218. package/dist/hooks/use-is-mobile.cjs +39 -1
  219. package/dist/hooks/use-is-mobile.d.ts +15 -6
  220. package/dist/hooks/use-is-mobile.js +5 -1
  221. package/dist/hooks/use-media-query.cjs +56 -1
  222. package/dist/hooks/use-media-query.d.ts +11 -3
  223. package/dist/hooks/use-media-query.js +22 -1
  224. package/dist/hooks/use-mutation-observer.cjs +56 -1
  225. package/dist/hooks/use-mutation-observer.d.ts +8 -12
  226. package/dist/hooks/use-mutation-observer.js +22 -1
  227. package/dist/hooks/use-pagination.cjs +92 -1
  228. package/dist/hooks/use-pagination.d.ts +12 -10
  229. package/dist/hooks/use-pagination.js +55 -1
  230. package/dist/index.cjs +1081 -1
  231. package/dist/index.d.ts +130 -131
  232. package/dist/index.js +69 -1
  233. package/dist/primitives/checkbox-group.cjs +151 -1
  234. package/dist/primitives/checkbox-group.d.ts +11 -11
  235. package/dist/primitives/checkbox-group.js +99 -1
  236. package/dist/primitives/input-number.cjs +439 -1
  237. package/dist/primitives/input-number.d.ts +8 -8
  238. package/dist/primitives/input-number.js +381 -1
  239. package/dist/primitives/input.cjs +99 -1
  240. package/dist/primitives/input.d.ts +4 -4
  241. package/dist/primitives/input.js +53 -1
  242. package/dist/primitives/progress-circle.cjs +198 -1
  243. package/dist/primitives/progress-circle.d.ts +7 -7
  244. package/dist/primitives/progress-circle.js +128 -1
  245. package/package.json +385 -38
@@ -1,2 +1,114 @@
1
1
  "use client";
2
- import{jsx as e,jsxs as r}from"react/jsx-runtime";import{format as t}from"date-fns";import{ChevronDownIcon as o,ChevronLeftIcon as a,ChevronRightIcon as n,ChevronUpIcon as s,DotIcon as d}from"lucide-react";import{DayFlag as i,DayPicker as l,SelectionState as u,UI as c}from"react-day-picker";import{buttonVariants as g}from"./button.js";import{cn as m}from"@codefast/tailwind-variants";function p({className:r,orientation:t,...i}){switch(t){case"up":return e(s,{className:m("size-4",r),...i});case"down":return e(o,{className:m("size-4",r),...i});case"left":return e(a,{className:m("size-4",r),...i});case"right":return e(n,{className:m("size-4",r),...i});case void 0:throw Error("Not implemented yet: undefined case");default:return e(d,{className:m("size-4",r),...i})}}function f({classNames:r,showOutsideDays:t=!0,...o}){let a=void 0!==o.mode||void 0!==o.onDayClick;return e(l,{classNames:{[c.CaptionLabel]:m("flex items-center gap-2 [&>svg]:opacity-50",r?.[c.CaptionLabel]),[c.Chevron]:m(r?.[c.Chevron]),[c.Day]:m("grid place-items-center text-center text-sm",a?"min-w-8.5 has-focus-visible:z-20 group":"min-w-8.5 h-8",r?.[c.Day]),[c.DayButton]:m("group-[.is-outside]:text-muted-foreground hover:not-disabled:not-group-aria-selected:bg-secondary hover:not-disabled:not-group-aria-selected:text-secondary-foreground group-data-today:not-group-aria-selected:bg-secondary group-data-today:not-group-aria-selected:text-secondary-foreground group-aria-selected:not-group-[.is-range-middle]:bg-primary group-aria-selected:not-group-[.is-range-middle]:text-primary-foreground outline-hidden focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3 group-[.is-selected]:not-group-[.is-range-middle]:focus-visible:ring-primary/20 dark:group-[.is-selected]:not-group-[.is-range-middle]:focus-visible:ring-primary/40 group-[.is-selected]:not-group-[.is-range-middle]:focus-visible:border-primary size-8 rounded-lg border border-transparent disabled:opacity-50",r?.[c.DayButton]),[c.Dropdown]:m("absolute opacity-0",r?.[c.Dropdown]),[c.DropdownRoot]:m("relative",r?.[c.DropdownRoot]),[c.Dropdowns]:m("flex gap-4",r?.[c.Dropdowns]),[c.Footer]:m(r?.[c.Footer]),[c.Month]:m("flex flex-col gap-4",r?.[c.Month]),[c.MonthCaption]:m("py-1 text-sm font-medium",r?.[c.MonthCaption]),[c.MonthGrid]:m(r?.[c.MonthGrid]),[c.Months]:m("relative flex gap-4",r?.[c.Months]),[c.MonthsDropdown]:m(r?.[c.MonthsDropdown]),[c.Nav]:m("absolute end-0 flex gap-2",r?.[c.Nav]),[c.NextMonthButton]:g({className:["size-7",r?.[c.NextMonthButton]],size:"icon",variant:"ghost"}),[c.PreviousMonthButton]:g({className:["size-7",r?.[c.PreviousMonthButton]],size:"icon",variant:"ghost"}),[c.Root]:m("p-3",r?.[c.Root]),[c.Week]:m("mt-2 flex justify-between",r?.[c.Week]),[c.Weekday]:m("text-muted-foreground min-w-8.5 text-xs font-medium",r?.[c.Weekday]),[c.Weekdays]:m("flex w-full justify-between",r?.[c.Weekdays]),[c.WeekNumber]:m("text-muted-foreground min-w-8.5 grid h-8 place-items-center text-xs font-normal [&+*]:rounded-l-lg",r?.[c.WeekNumber]),[c.WeekNumberHeader]:m("min-w-8.5",r?.[c.WeekNumberHeader]),[c.Weeks]:m(r?.[c.Weeks]),[c.YearsDropdown]:m(r?.[c.YearsDropdown]),[u.range_end]:m("to-secondary is-range-end rounded-r-lg bg-gradient-to-l first:rounded-l-lg",r?.[u.range_end]),[u.range_middle]:m("is-range-middle bg-secondary text-secondary-foreground first:rounded-l-lg last:rounded-r-lg",r?.[u.range_middle]),[u.range_start]:m("to-secondary is-range-start rounded-l-lg bg-gradient-to-r last:rounded-r-lg",r?.[u.range_start]),[u.selected]:m("is-selected",r?.[u.selected]),[i.disabled]:m("is-disabled",r?.[i.disabled]),[i.focused]:m("is-focused",r?.[i.focused]),[i.hidden]:m("is-hidden size-8",r?.[i.hidden]),[i.outside]:m("is-outside",r?.[i.outside]),[i.today]:m("is-today",r?.[i.today])},components:{Chevron:p},showOutsideDays:t,...o})}function y({date:o,formatStr:a="LLL dd, y",placeholder:n="Pick a date"}){if(!o?.from)return e("span",{className:"truncate",children:n});let s=t(o.from,a);return o.to?r("span",{className:"truncate",children:[s," - ",t(o.to,a)]}):e("span",{className:"truncate",children:s})}function b({date:r,formatStr:o="PPP",placeholder:a="Pick a date"}){return r?e("span",{className:"truncate",children:t(r,o)}):e("span",{className:"truncate",children:a})}export{f as Calendar,b as CalendarLabel,y as CalendarRangeLabel};
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { cn } from "@codefast/tailwind-variants";
4
+ import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
5
+ import { useEffect, useRef } from "react";
6
+ import { DayPicker, getDefaultClassNames } from "react-day-picker";
7
+ import { Button, buttonVariants } from "./button.js";
8
+ 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('bg-background group/calendar 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) aria-disabled:opacity-50 p-0 select-none', defaultClassNames.button_next),
17
+ button_previous: cn(buttonVariants({
18
+ variant: buttonVariant
19
+ }), 'size-(--cell-size) aria-disabled:opacity-50 p-0 select-none', defaultClassNames.button_previous),
20
+ caption_label: cn('select-none font-medium', 'label' === captionLayout ? 'text-sm' : 'rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5', defaultClassNames.caption_label),
21
+ day: cn('relative w-full h-full p-0 text-center [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none', 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 bg-popover inset-0 opacity-0', defaultClassNames.dropdown),
24
+ dropdown_root: cn('relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-3 rounded-md', defaultClassNames.dropdown_root),
25
+ dropdowns: cn('w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5', defaultClassNames.dropdowns),
26
+ hidden: cn('invisible', defaultClassNames.hidden),
27
+ month: cn('flex flex-col w-full gap-4', defaultClassNames.month),
28
+ month_caption: cn('flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)', defaultClassNames.month_caption),
29
+ months: cn('flex gap-4 flex-col md:flex-row relative', defaultClassNames.months),
30
+ nav: cn('flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between', 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('bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none', defaultClassNames.today),
38
+ week: cn('flex w-full mt-2', defaultClassNames.week),
39
+ week_number: cn('text-[0.8rem] select-none text-muted-foreground', defaultClassNames.week_number),
40
+ week_number_header: cn('select-none w-(--cell-size)', defaultClassNames.week_number_header),
41
+ weekday: cn('text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] 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
+ });
61
+ }
62
+ 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
+ });
75
+ }
76
+ function CalendarRoot({ className, rootRef, ...props }) {
77
+ return /*#__PURE__*/ jsx("div", {
78
+ ref: rootRef,
79
+ className: cn(className),
80
+ "data-slot": "calendar",
81
+ ...props
82
+ });
83
+ }
84
+ 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
+ });
92
+ }
93
+ 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('data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground 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:ring-3 data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>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
+ });
113
+ }
114
+ export { Calendar, CalendarDayButton };
@@ -1 +1,105 @@
1
- "use strict";const __rslib_import_meta_url__="undefined"==typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.d=(e,r)=>{for(var a in r)__webpack_require__.o(r,a)&&!__webpack_require__.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:r[a]})},__webpack_require__.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{CardFooter:()=>CardFooter,CardAction:()=>CardAction,CardContent:()=>CardContent,CardDescription:()=>CardDescription,CardHeader:()=>CardHeader,CardTitle:()=>CardTitle,Card:()=>Card});const jsx_runtime_namespaceObject=require("react/jsx-runtime"),tailwind_variants_namespaceObject=require("@codefast/tailwind-variants");function Card({className:e,...r}){return(0,jsx_runtime_namespaceObject.jsx)("div",{className:(0,tailwind_variants_namespaceObject.cn)("bg-card text-card-foreground flex flex-col gap-6 overflow-auto rounded-xl border py-6 shadow-sm",e),"data-slot":"card",...r})}function CardHeader({className:e,...r}){return(0,jsx_runtime_namespaceObject.jsx)("div",{className:(0,tailwind_variants_namespaceObject.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",e),"data-slot":"card-header",...r})}function CardTitle({children:e,className:r,...a}){return(0,jsx_runtime_namespaceObject.jsx)("div",{className:(0,tailwind_variants_namespaceObject.cn)("leading-none font-semibold",r),"data-slot":"card-title",...a,children:e})}function CardDescription({className:e,...r}){return(0,jsx_runtime_namespaceObject.jsx)("div",{className:(0,tailwind_variants_namespaceObject.cn)("text-muted-foreground text-sm",e),"data-slot":"card-description",...r})}function CardContent({className:e,...r}){return(0,jsx_runtime_namespaceObject.jsx)("div",{className:(0,tailwind_variants_namespaceObject.cn)("px-6",e),"data-slot":"card-content",...r})}function CardFooter({className:e,...r}){return(0,jsx_runtime_namespaceObject.jsx)("div",{className:(0,tailwind_variants_namespaceObject.cn)("flex items-center px-6 [.border-t]:pt-6",e),"data-slot":"card-footer",...r})}function CardAction({className:e,...r}){return(0,jsx_runtime_namespaceObject.jsx)("div",{className:(0,tailwind_variants_namespaceObject.cn)("col-start-2 row-span-2 row-start-1 self-start justify-self-end",e),"data-slot":"card-action",...r})}for(var __webpack_i__ in exports.Card=__webpack_exports__.Card,exports.CardAction=__webpack_exports__.CardAction,exports.CardContent=__webpack_exports__.CardContent,exports.CardDescription=__webpack_exports__.CardDescription,exports.CardFooter=__webpack_exports__.CardFooter,exports.CardHeader=__webpack_exports__.CardHeader,exports.CardTitle=__webpack_exports__.CardTitle,__webpack_exports__)-1===["Card","CardAction","CardContent","CardDescription","CardFooter","CardHeader","CardTitle"].indexOf(__webpack_i__)&&(exports[__webpack_i__]=__webpack_exports__[__webpack_i__]);Object.defineProperty(exports,"__esModule",{value:!0});
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ CardFooter: ()=>CardFooter,
28
+ CardAction: ()=>CardAction,
29
+ CardContent: ()=>CardContent,
30
+ CardDescription: ()=>CardDescription,
31
+ CardHeader: ()=>CardHeader,
32
+ CardTitle: ()=>CardTitle,
33
+ Card: ()=>Card
34
+ });
35
+ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
36
+ const tailwind_variants_namespaceObject = require("@codefast/tailwind-variants");
37
+ function Card({ className, ...props }) {
38
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
39
+ className: (0, tailwind_variants_namespaceObject.cn)('bg-card text-card-foreground flex flex-col gap-6 overflow-auto rounded-xl border py-6 shadow-sm', className),
40
+ "data-slot": "card",
41
+ ...props
42
+ });
43
+ }
44
+ function CardHeader({ className, ...props }) {
45
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
46
+ className: (0, tailwind_variants_namespaceObject.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),
47
+ "data-slot": "card-header",
48
+ ...props
49
+ });
50
+ }
51
+ function CardTitle({ children, className, ...props }) {
52
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
53
+ className: (0, tailwind_variants_namespaceObject.cn)('leading-none font-semibold', className),
54
+ "data-slot": "card-title",
55
+ ...props,
56
+ children: children
57
+ });
58
+ }
59
+ function CardDescription({ className, ...props }) {
60
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
61
+ className: (0, tailwind_variants_namespaceObject.cn)('text-muted-foreground text-sm', className),
62
+ "data-slot": "card-description",
63
+ ...props
64
+ });
65
+ }
66
+ function CardContent({ className, ...props }) {
67
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
68
+ className: (0, tailwind_variants_namespaceObject.cn)('px-6', className),
69
+ "data-slot": "card-content",
70
+ ...props
71
+ });
72
+ }
73
+ function CardFooter({ className, ...props }) {
74
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
75
+ className: (0, tailwind_variants_namespaceObject.cn)('flex items-center px-6 [.border-t]:pt-6', className),
76
+ "data-slot": "card-footer",
77
+ ...props
78
+ });
79
+ }
80
+ function CardAction({ className, ...props }) {
81
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
82
+ className: (0, tailwind_variants_namespaceObject.cn)('col-start-2 row-span-2 row-start-1 self-start justify-self-end', className),
83
+ "data-slot": "card-action",
84
+ ...props
85
+ });
86
+ }
87
+ exports.Card = __webpack_exports__.Card;
88
+ exports.CardAction = __webpack_exports__.CardAction;
89
+ exports.CardContent = __webpack_exports__.CardContent;
90
+ exports.CardDescription = __webpack_exports__.CardDescription;
91
+ exports.CardFooter = __webpack_exports__.CardFooter;
92
+ exports.CardHeader = __webpack_exports__.CardHeader;
93
+ exports.CardTitle = __webpack_exports__.CardTitle;
94
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
95
+ "Card",
96
+ "CardAction",
97
+ "CardContent",
98
+ "CardDescription",
99
+ "CardFooter",
100
+ "CardHeader",
101
+ "CardTitle"
102
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
103
+ Object.defineProperty(exports, '__esModule', {
104
+ value: true
105
+ });
@@ -1,17 +1,17 @@
1
- import type { ComponentProps, JSX } from "react";
2
- type CardProps = ComponentProps<"div">;
1
+ import type { ComponentProps, JSX } from 'react';
2
+ type CardProps = ComponentProps<'div'>;
3
3
  declare function Card({ className, ...props }: CardProps): JSX.Element;
4
- type CardHeaderProps = ComponentProps<"div">;
4
+ type CardHeaderProps = ComponentProps<'div'>;
5
5
  declare function CardHeader({ className, ...props }: CardHeaderProps): JSX.Element;
6
- type CardTitleProps = ComponentProps<"div">;
6
+ type CardTitleProps = ComponentProps<'div'>;
7
7
  declare function CardTitle({ children, className, ...props }: CardTitleProps): JSX.Element;
8
- type CardDescriptionProps = ComponentProps<"div">;
8
+ type CardDescriptionProps = ComponentProps<'div'>;
9
9
  declare function CardDescription({ className, ...props }: CardDescriptionProps): JSX.Element;
10
- type CardContentProps = ComponentProps<"div">;
10
+ type CardContentProps = ComponentProps<'div'>;
11
11
  declare function CardContent({ className, ...props }: CardContentProps): JSX.Element;
12
- type CardFooterProps = ComponentProps<"div">;
12
+ type CardFooterProps = ComponentProps<'div'>;
13
13
  declare function CardFooter({ className, ...props }: CardFooterProps): JSX.Element;
14
- type CardActionProps = ComponentProps<"div">;
14
+ type CardActionProps = ComponentProps<'div'>;
15
15
  declare function CardAction({ className, ...props }: CardActionProps): JSX.Element;
16
16
  export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
17
17
  export type { CardActionProps, CardContentProps, CardDescriptionProps, CardFooterProps, CardHeaderProps, CardProps, CardTitleProps, };
@@ -1 +1,53 @@
1
- import{jsx as t}from"react/jsx-runtime";import{cn as a}from"@codefast/tailwind-variants";function r({className:r,...o}){return t("div",{className:a("bg-card text-card-foreground flex flex-col gap-6 overflow-auto rounded-xl border py-6 shadow-sm",r),"data-slot":"card",...o})}function o({className:r,...o}){return t("div",{className:a("@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",r),"data-slot":"card-header",...o})}function e({children:r,className:o,...e}){return t("div",{className:a("leading-none font-semibold",o),"data-slot":"card-title",...e,children:r})}function d({className:r,...o}){return t("div",{className:a("text-muted-foreground text-sm",r),"data-slot":"card-description",...o})}function n({className:r,...o}){return t("div",{className:a("px-6",r),"data-slot":"card-content",...o})}function s({className:r,...o}){return t("div",{className:a("flex items-center px-6 [.border-t]:pt-6",r),"data-slot":"card-footer",...o})}function i({className:r,...o}){return t("div",{className:a("col-start-2 row-span-2 row-start-1 self-start justify-self-end",r),"data-slot":"card-action",...o})}export{r as Card,i as CardAction,n as CardContent,d as CardDescription,s as CardFooter,o as CardHeader,e as CardTitle};
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { cn } from "@codefast/tailwind-variants";
3
+ function Card({ className, ...props }) {
4
+ return /*#__PURE__*/ jsx("div", {
5
+ className: cn('bg-card text-card-foreground flex flex-col gap-6 overflow-auto rounded-xl border py-6 shadow-sm', className),
6
+ "data-slot": "card",
7
+ ...props
8
+ });
9
+ }
10
+ 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
+ });
16
+ }
17
+ 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
+ });
24
+ }
25
+ function CardDescription({ className, ...props }) {
26
+ return /*#__PURE__*/ jsx("div", {
27
+ className: cn('text-muted-foreground text-sm', className),
28
+ "data-slot": "card-description",
29
+ ...props
30
+ });
31
+ }
32
+ function CardContent({ className, ...props }) {
33
+ return /*#__PURE__*/ jsx("div", {
34
+ className: cn('px-6', className),
35
+ "data-slot": "card-content",
36
+ ...props
37
+ });
38
+ }
39
+ 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
+ });
45
+ }
46
+ 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
+ });
52
+ }
53
+ export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
@@ -1,2 +1,211 @@
1
+ "use strict";
1
2
  "use client";
2
- "use strict";const __rslib_import_meta_url__="undefined"==typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(a,{a:a}),a},__webpack_require__.d=(e,a)=>{for(var t in a)__webpack_require__.o(a,t)&&!__webpack_require__.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:a[t]})},__webpack_require__.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{CarouselPrevious:()=>CarouselPrevious,Carousel:()=>Carousel,createCarouselScope:()=>createCarouselScope,CarouselContent:()=>CarouselContent,CarouselItem:()=>CarouselItem,CarouselNext:()=>CarouselNext});const jsx_runtime_namespaceObject=require("react/jsx-runtime"),external_embla_carousel_react_namespaceObject=require("embla-carousel-react");var external_embla_carousel_react_default=__webpack_require__.n(external_embla_carousel_react_namespaceObject);const external_lucide_react_namespaceObject=require("lucide-react"),external_react_namespaceObject=require("react"),external_button_cjs_namespaceObject=require("./button.cjs"),tailwind_variants_namespaceObject=require("@codefast/tailwind-variants"),react_context_namespaceObject=require("@radix-ui/react-context"),CAROUSEL_NAME="Carousel",[createCarouselContext,createCarouselScope]=(0,react_context_namespaceObject.createContextScope)(CAROUSEL_NAME),[CarouselContextProvider,useCarouselContext]=createCarouselContext(CAROUSEL_NAME);function Carousel({__scopeCarousel:e,children:a,className:t,opts:r,orientation:s,plugins:_,setApi:c,...o}){let[n,l]=external_embla_carousel_react_default()({...r,axis:"vertical"===s?"y":"x"},_),[u,i]=(0,external_react_namespaceObject.useState)(!1),[p,x]=(0,external_react_namespaceObject.useState)(!1),b=(0,external_react_namespaceObject.useCallback)(e=>{e&&(i(e.canScrollPrev()),x(e.canScrollNext()))},[]),m=(0,external_react_namespaceObject.useCallback)(()=>{l?.scrollPrev()},[l]),C=(0,external_react_namespaceObject.useCallback)(()=>{l?.scrollNext()},[l]),j=(0,external_react_namespaceObject.useCallback)(e=>{"ArrowLeft"===e.key?(e.preventDefault(),m()):"ArrowRight"===e.key&&(e.preventDefault(),C())},[m,C]);return(0,external_react_namespaceObject.useEffect)(()=>{l&&c&&c(l)},[l,c]),(0,external_react_namespaceObject.useEffect)(()=>{if(l)return queueMicrotask(()=>{b(l)}),l.on("reInit",b),l.on("select",b),()=>{l.off("select",b)}},[l,b]),(0,jsx_runtime_namespaceObject.jsx)(CarouselContextProvider,{api:l,canScrollNext:p,canScrollPrev:u,carouselRef:n,opts:r,orientation:s??(r?.axis==="y"?"vertical":"horizontal"),scope:e,scrollNext:C,scrollPrev:m,children:(0,jsx_runtime_namespaceObject.jsx)("div",{className:(0,tailwind_variants_namespaceObject.cn)("relative",t),"data-slot":"carousel",onKeyDownCapture:j,...o,children:a})})}const CAROUSEL_CONTENT_NAME="CarouselContent";function CarouselContent({__scopeCarousel:e,className:a,classNames:t,...r}){let{carouselRef:s,orientation:_}=useCarouselContext("CarouselContent",e);return(0,jsx_runtime_namespaceObject.jsx)("div",{ref:s,className:(0,tailwind_variants_namespaceObject.cn)("overflow-hidden",t?.wrapper),"data-slot":"carousel-content",children:(0,jsx_runtime_namespaceObject.jsx)("div",{className:(0,tailwind_variants_namespaceObject.cn)("flex","horizontal"===_?"-ml-4":"-mt-4 flex-col",t?.content,a),...r})})}const CAROUSEL_ITEM_NAME="CarouselItem";function CarouselItem({__scopeCarousel:e,className:a,...t}){let{orientation:r}=useCarouselContext("CarouselItem",e);return(0,jsx_runtime_namespaceObject.jsx)("div",{"aria-roledescription":"slide",className:(0,tailwind_variants_namespaceObject.cn)("min-w-0 shrink-0 grow-0 basis-full","horizontal"===r?"pl-4":"pt-4",a),"data-slot":"carousel-item",role:"group",...t})}const CAROUSEL_PREVIOUS_NAME="CarouselPrevious";function CarouselPrevious({__scopeCarousel:e,className:a,size:t="icon",variant:r="outline",...s}){let{canScrollPrev:_,orientation:c,scrollPrev:o}=useCarouselContext("CarouselPrevious",e);return(0,jsx_runtime_namespaceObject.jsxs)(external_button_cjs_namespaceObject.Button,{"aria-label":"Previous slide",className:(0,tailwind_variants_namespaceObject.cn)("absolute size-8 shadow-none","horizontal"===c?"top-1/2 -left-12 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",a),"data-slot":"carousel-previous",disabled:!_,size:t,variant:r,onClick:o,...s,children:[(0,jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.ArrowLeftIcon,{}),(0,jsx_runtime_namespaceObject.jsx)("span",{className:"sr-only",children:"Previous slide"})]})}const CAROUSEL_NEXT_NAME="CarouselNext";function CarouselNext({__scopeCarousel:e,className:a,size:t="icon",variant:r="outline",...s}){let{canScrollNext:_,orientation:c,scrollNext:o}=useCarouselContext("CarouselNext",e);return(0,jsx_runtime_namespaceObject.jsxs)(external_button_cjs_namespaceObject.Button,{"aria-label":"Next slide",className:(0,tailwind_variants_namespaceObject.cn)("absolute size-8 shadow-none","horizontal"===c?"top-1/2 -right-12 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",a),"data-slot":"carousel-next",disabled:!_,size:t,variant:r,onClick:o,...s,children:[(0,jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.ArrowRightIcon,{}),(0,jsx_runtime_namespaceObject.jsx)("span",{className:"sr-only",children:"Next slide"})]})}for(var __webpack_i__ in exports.Carousel=__webpack_exports__.Carousel,exports.CarouselContent=__webpack_exports__.CarouselContent,exports.CarouselItem=__webpack_exports__.CarouselItem,exports.CarouselNext=__webpack_exports__.CarouselNext,exports.CarouselPrevious=__webpack_exports__.CarouselPrevious,exports.createCarouselScope=__webpack_exports__.createCarouselScope,__webpack_exports__)-1===["Carousel","CarouselContent","CarouselItem","CarouselNext","CarouselPrevious","createCarouselScope"].indexOf(__webpack_i__)&&(exports[__webpack_i__]=__webpack_exports__[__webpack_i__]);Object.defineProperty(exports,"__esModule",{value:!0});
3
+ var __webpack_require__ = {};
4
+ (()=>{
5
+ __webpack_require__.n = (module)=>{
6
+ var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
7
+ __webpack_require__.d(getter, {
8
+ a: getter
9
+ });
10
+ return getter;
11
+ };
12
+ })();
13
+ (()=>{
14
+ __webpack_require__.d = (exports1, definition)=>{
15
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
16
+ enumerable: true,
17
+ get: definition[key]
18
+ });
19
+ };
20
+ })();
21
+ (()=>{
22
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
23
+ })();
24
+ (()=>{
25
+ __webpack_require__.r = (exports1)=>{
26
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
27
+ value: 'Module'
28
+ });
29
+ Object.defineProperty(exports1, '__esModule', {
30
+ value: true
31
+ });
32
+ };
33
+ })();
34
+ var __webpack_exports__ = {};
35
+ __webpack_require__.r(__webpack_exports__);
36
+ __webpack_require__.d(__webpack_exports__, {
37
+ CarouselPrevious: ()=>CarouselPrevious,
38
+ Carousel: ()=>Carousel,
39
+ createCarouselScope: ()=>createCarouselScope,
40
+ CarouselContent: ()=>CarouselContent,
41
+ CarouselItem: ()=>CarouselItem,
42
+ CarouselNext: ()=>CarouselNext
43
+ });
44
+ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
45
+ const tailwind_variants_namespaceObject = require("@codefast/tailwind-variants");
46
+ const react_context_namespaceObject = require("@radix-ui/react-context");
47
+ const external_embla_carousel_react_namespaceObject = require("embla-carousel-react");
48
+ var external_embla_carousel_react_default = /*#__PURE__*/ __webpack_require__.n(external_embla_carousel_react_namespaceObject);
49
+ const external_lucide_react_namespaceObject = require("lucide-react");
50
+ const external_react_namespaceObject = require("react");
51
+ const external_button_cjs_namespaceObject = require("./button.cjs");
52
+ const CAROUSEL_NAME = 'Carousel';
53
+ const [createCarouselContext, createCarouselScope] = (0, react_context_namespaceObject.createContextScope)(CAROUSEL_NAME);
54
+ const [CarouselContextProvider, useCarouselContext] = createCarouselContext(CAROUSEL_NAME);
55
+ function Carousel({ __scopeCarousel, children, className, opts, orientation, plugins, setApi, ...props }) {
56
+ const [carouselRef, api] = external_embla_carousel_react_default()({
57
+ ...opts,
58
+ axis: 'vertical' === orientation ? 'y' : 'x'
59
+ }, plugins);
60
+ const [canScrollPrevious, setCanScrollPrevious] = (0, external_react_namespaceObject.useState)(false);
61
+ const [canScrollNext, setCanScrollNext] = (0, external_react_namespaceObject.useState)(false);
62
+ const onSelect = (0, external_react_namespaceObject.useCallback)((carouselApi)=>{
63
+ if (!carouselApi) return;
64
+ setCanScrollPrevious(carouselApi.canScrollPrev());
65
+ setCanScrollNext(carouselApi.canScrollNext());
66
+ }, []);
67
+ const scrollPrevious = (0, external_react_namespaceObject.useCallback)(()=>{
68
+ api?.scrollPrev();
69
+ }, [
70
+ api
71
+ ]);
72
+ const scrollNext = (0, external_react_namespaceObject.useCallback)(()=>{
73
+ api?.scrollNext();
74
+ }, [
75
+ api
76
+ ]);
77
+ const handleKeyDown = (0, external_react_namespaceObject.useCallback)((event)=>{
78
+ if ('ArrowLeft' === event.key) {
79
+ event.preventDefault();
80
+ scrollPrevious();
81
+ } else if ('ArrowRight' === event.key) {
82
+ event.preventDefault();
83
+ scrollNext();
84
+ }
85
+ }, [
86
+ scrollPrevious,
87
+ scrollNext
88
+ ]);
89
+ (0, external_react_namespaceObject.useEffect)(()=>{
90
+ if (!api || !setApi) return;
91
+ setApi(api);
92
+ }, [
93
+ api,
94
+ setApi
95
+ ]);
96
+ (0, external_react_namespaceObject.useEffect)(()=>{
97
+ if (!api) return;
98
+ queueMicrotask(()=>{
99
+ onSelect(api);
100
+ });
101
+ api.on('reInit', onSelect);
102
+ api.on('select', onSelect);
103
+ return ()=>{
104
+ api.off('select', onSelect);
105
+ };
106
+ }, [
107
+ api,
108
+ onSelect
109
+ ]);
110
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(CarouselContextProvider, {
111
+ api: api,
112
+ canScrollNext: canScrollNext,
113
+ canScrollPrev: canScrollPrevious,
114
+ carouselRef: carouselRef,
115
+ opts: opts,
116
+ orientation: orientation ?? (opts?.axis === 'y' ? 'vertical' : 'horizontal'),
117
+ scope: __scopeCarousel,
118
+ scrollNext: scrollNext,
119
+ scrollPrev: scrollPrevious,
120
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
121
+ className: (0, tailwind_variants_namespaceObject.cn)('relative', className),
122
+ "data-slot": "carousel",
123
+ onKeyDownCapture: handleKeyDown,
124
+ ...props,
125
+ children: children
126
+ })
127
+ });
128
+ }
129
+ const CAROUSEL_CONTENT_NAME = 'CarouselContent';
130
+ function CarouselContent({ __scopeCarousel, className, classNames, ...props }) {
131
+ const { carouselRef, orientation } = useCarouselContext(CAROUSEL_CONTENT_NAME, __scopeCarousel);
132
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
133
+ ref: carouselRef,
134
+ className: (0, tailwind_variants_namespaceObject.cn)('overflow-hidden', classNames?.wrapper),
135
+ "data-slot": "carousel-content",
136
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
137
+ className: (0, tailwind_variants_namespaceObject.cn)('flex', 'horizontal' === orientation ? '-ml-4' : '-mt-4 flex-col', classNames?.content, className),
138
+ ...props
139
+ })
140
+ });
141
+ }
142
+ const CAROUSEL_ITEM_NAME = 'CarouselItem';
143
+ function CarouselItem({ __scopeCarousel, className, ...props }) {
144
+ const { orientation } = useCarouselContext(CAROUSEL_ITEM_NAME, __scopeCarousel);
145
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
146
+ "aria-roledescription": "slide",
147
+ className: (0, tailwind_variants_namespaceObject.cn)('min-w-0 shrink-0 grow-0 basis-full', 'horizontal' === orientation ? 'pl-4' : 'pt-4', className),
148
+ "data-slot": "carousel-item",
149
+ role: "group",
150
+ ...props
151
+ });
152
+ }
153
+ const CAROUSEL_PREVIOUS_NAME = 'CarouselPrevious';
154
+ function CarouselPrevious({ __scopeCarousel, className, size = 'icon', variant = 'outline', ...props }) {
155
+ const { canScrollPrev, orientation, scrollPrev } = useCarouselContext(CAROUSEL_PREVIOUS_NAME, __scopeCarousel);
156
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_button_cjs_namespaceObject.Button, {
157
+ "aria-label": "Previous slide",
158
+ className: (0, tailwind_variants_namespaceObject.cn)('absolute size-8 shadow-none', 'horizontal' === orientation ? 'top-1/2 -left-12 -translate-y-1/2' : '-top-12 left-1/2 -translate-x-1/2 rotate-90', className),
159
+ "data-slot": "carousel-previous",
160
+ disabled: !canScrollPrev,
161
+ size: size,
162
+ variant: variant,
163
+ onClick: scrollPrev,
164
+ ...props,
165
+ children: [
166
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.ArrowLeftIcon, {}),
167
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
168
+ className: "sr-only",
169
+ children: "Previous slide"
170
+ })
171
+ ]
172
+ });
173
+ }
174
+ const CAROUSEL_NEXT_NAME = 'CarouselNext';
175
+ function CarouselNext({ __scopeCarousel, className, size = 'icon', variant = 'outline', ...props }) {
176
+ const { canScrollNext, orientation, scrollNext } = useCarouselContext(CAROUSEL_NEXT_NAME, __scopeCarousel);
177
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_button_cjs_namespaceObject.Button, {
178
+ "aria-label": "Next slide",
179
+ className: (0, tailwind_variants_namespaceObject.cn)('absolute size-8 shadow-none', 'horizontal' === orientation ? 'top-1/2 -right-12 -translate-y-1/2' : '-bottom-12 left-1/2 -translate-x-1/2 rotate-90', className),
180
+ "data-slot": "carousel-next",
181
+ disabled: !canScrollNext,
182
+ size: size,
183
+ variant: variant,
184
+ onClick: scrollNext,
185
+ ...props,
186
+ children: [
187
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.ArrowRightIcon, {}),
188
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
189
+ className: "sr-only",
190
+ children: "Next slide"
191
+ })
192
+ ]
193
+ });
194
+ }
195
+ exports.Carousel = __webpack_exports__.Carousel;
196
+ exports.CarouselContent = __webpack_exports__.CarouselContent;
197
+ exports.CarouselItem = __webpack_exports__.CarouselItem;
198
+ exports.CarouselNext = __webpack_exports__.CarouselNext;
199
+ exports.CarouselPrevious = __webpack_exports__.CarouselPrevious;
200
+ exports.createCarouselScope = __webpack_exports__.createCarouselScope;
201
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
202
+ "Carousel",
203
+ "CarouselContent",
204
+ "CarouselItem",
205
+ "CarouselNext",
206
+ "CarouselPrevious",
207
+ "createCarouselScope"
208
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
209
+ Object.defineProperty(exports, '__esModule', {
210
+ value: true
211
+ });
@@ -1,8 +1,8 @@
1
- import type { UseEmblaCarouselType } from "embla-carousel-react";
2
- import type { ComponentProps, JSX } from "react";
3
- import useEmblaCarousel from "embla-carousel-react";
4
- import type { Scope } from "@radix-ui/react-context";
5
- import { Button } from "./button";
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';
6
6
  type ScopedProps<P> = P & {
7
7
  __scopeCarousel?: Scope;
8
8
  };
@@ -13,25 +13,25 @@ type CarouselOptions = UseCarouselParameters[0];
13
13
  type CarouselPlugin = UseCarouselParameters[1];
14
14
  interface BaseCarouselProps {
15
15
  opts?: CarouselOptions;
16
- orientation?: "horizontal" | "vertical";
16
+ orientation?: 'horizontal' | 'vertical';
17
17
  plugins?: CarouselPlugin;
18
18
  setApi?: (api: CarouselApi) => void;
19
19
  }
20
- interface CarouselProps extends BaseCarouselProps, ComponentProps<"div"> {
20
+ interface CarouselProps extends BaseCarouselProps, ComponentProps<'div'> {
21
21
  }
22
22
  declare function Carousel({ __scopeCarousel, children, className, opts, orientation, plugins, setApi, ...props }: ScopedProps<CarouselProps>): JSX.Element;
23
- interface CarouselContentProps extends ComponentProps<"div"> {
23
+ interface CarouselContentProps extends ComponentProps<'div'> {
24
24
  classNames?: {
25
25
  content?: string;
26
26
  wrapper?: string;
27
27
  };
28
28
  }
29
29
  declare function CarouselContent({ __scopeCarousel, className, classNames, ...props }: ScopedProps<CarouselContentProps>): JSX.Element;
30
- type CarouselItemProps = ComponentProps<"div">;
30
+ type CarouselItemProps = ComponentProps<'div'>;
31
31
  declare function CarouselItem({ __scopeCarousel, className, ...props }: ScopedProps<CarouselItemProps>): JSX.Element;
32
32
  type CarouselPreviousProps = ComponentProps<typeof Button>;
33
33
  declare function CarouselPrevious({ __scopeCarousel, className, size, variant, ...props }: ScopedProps<CarouselPreviousProps>): JSX.Element;
34
34
  type CarouselNextProps = ComponentProps<typeof Button>;
35
35
  declare function CarouselNext({ __scopeCarousel, className, size, variant, ...props }: ScopedProps<CarouselNextProps>): JSX.Element;
36
36
  export type { CarouselApi, CarouselContentProps, CarouselItemProps, CarouselNextProps, CarouselPreviousProps, CarouselProps, };
37
- export { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, createCarouselScope, };
37
+ export { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, createCarouselScope };