@uselets/ui 2.0.0 → 2.0.2

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 (209) hide show
  1. package/dist/{as-child-Dxg3Xo1G.d.ts → as-child-T9W73ZYU.d.ts} +1 -3
  2. package/dist/{chart-B_6nC_ih.d.ts → chart-8rgtsk95.d.ts} +1 -3
  3. package/dist/cli/uselets.mjs.map +1 -1
  4. package/dist/components/accordion.d.ts +1 -3
  5. package/dist/components/accordion.js.map +1 -1
  6. package/dist/components/alert-dialog.d.ts +5 -5
  7. package/dist/components/alert-dialog.js +1 -1
  8. package/dist/components/alert-dialog.js.map +1 -1
  9. package/dist/components/alert.d.ts +0 -2
  10. package/dist/components/alert.js.map +1 -1
  11. package/dist/components/anchor.d.ts +1 -3
  12. package/dist/components/anchor.js.map +1 -1
  13. package/dist/components/area-chart.d.ts +1 -3
  14. package/dist/components/area-chart.js.map +1 -1
  15. package/dist/components/avatar.d.ts +1 -3
  16. package/dist/components/avatar.js.map +1 -1
  17. package/dist/components/badge.d.ts +1 -3
  18. package/dist/components/badge.js.map +1 -1
  19. package/dist/components/bar-chart.d.ts +1 -3
  20. package/dist/components/bar-chart.js.map +1 -1
  21. package/dist/components/bottom-nav.d.ts +1 -3
  22. package/dist/components/bottom-nav.js.map +1 -1
  23. package/dist/components/breadcrumb.d.ts +1 -3
  24. package/dist/components/breadcrumb.js.map +1 -1
  25. package/dist/components/button-group.d.ts +1 -3
  26. package/dist/components/button-group.js.map +1 -1
  27. package/dist/components/button.d.ts +1 -3
  28. package/dist/components/button.js.map +1 -1
  29. package/dist/components/calendar.d.ts +0 -2
  30. package/dist/components/calendar.js +1 -1
  31. package/dist/components/calendar.js.map +1 -1
  32. package/dist/components/card.d.ts +0 -2
  33. package/dist/components/card.js.map +1 -1
  34. package/dist/components/carousel.d.ts +0 -2
  35. package/dist/components/carousel.js.map +1 -1
  36. package/dist/components/center.d.ts +0 -2
  37. package/dist/components/center.js.map +1 -1
  38. package/dist/components/chart.d.ts +1 -1
  39. package/dist/components/chart.js.map +1 -1
  40. package/dist/components/checkbox.d.ts +0 -2
  41. package/dist/components/checkbox.js.map +1 -1
  42. package/dist/components/code.d.ts +0 -2
  43. package/dist/components/code.js.map +1 -1
  44. package/dist/components/collapsible.d.ts +1 -3
  45. package/dist/components/collapsible.js.map +1 -1
  46. package/dist/components/combobox.d.ts +1 -3
  47. package/dist/components/combobox.js.map +1 -1
  48. package/dist/components/command.d.ts +0 -2
  49. package/dist/components/command.js.map +1 -1
  50. package/dist/components/container.d.ts +0 -2
  51. package/dist/components/container.js.map +1 -1
  52. package/dist/components/data-table.d.ts +0 -2
  53. package/dist/components/data-table.js.map +1 -1
  54. package/dist/components/date-range-picker.d.ts +0 -2
  55. package/dist/components/date-range-picker.js.map +1 -1
  56. package/dist/components/dialog.d.ts +5 -5
  57. package/dist/components/dialog.js +1 -1
  58. package/dist/components/dialog.js.map +1 -1
  59. package/dist/components/direction.d.ts +0 -2
  60. package/dist/components/donut-chart.d.ts +0 -2
  61. package/dist/components/donut-chart.js.map +1 -1
  62. package/dist/components/drawer.d.ts +2 -4
  63. package/dist/components/drawer.js +1 -1
  64. package/dist/components/drawer.js.map +1 -1
  65. package/dist/components/dropdown-menu.d.ts +1 -3
  66. package/dist/components/dropdown-menu.js.map +1 -1
  67. package/dist/components/dropzone.d.ts +0 -2
  68. package/dist/components/dropzone.js.map +1 -1
  69. package/dist/components/empty.d.ts +0 -2
  70. package/dist/components/empty.js.map +1 -1
  71. package/dist/components/field.d.ts +0 -2
  72. package/dist/components/field.js.map +1 -1
  73. package/dist/components/flex.d.ts +0 -2
  74. package/dist/components/flex.js.map +1 -1
  75. package/dist/components/grid.d.ts +0 -2
  76. package/dist/components/grid.js.map +1 -1
  77. package/dist/components/group.d.ts +0 -2
  78. package/dist/components/group.js.map +1 -1
  79. package/dist/components/heading.d.ts +1 -3
  80. package/dist/components/heading.js.map +1 -1
  81. package/dist/components/hover-card.d.ts +1 -3
  82. package/dist/components/hover-card.js.map +1 -1
  83. package/dist/components/input-group.d.ts +0 -2
  84. package/dist/components/input-group.js.map +1 -1
  85. package/dist/components/input-otp.d.ts +0 -2
  86. package/dist/components/input-otp.js.map +1 -1
  87. package/dist/components/input.d.ts +0 -2
  88. package/dist/components/input.js.map +1 -1
  89. package/dist/components/kbd.d.ts +0 -2
  90. package/dist/components/kbd.js.map +1 -1
  91. package/dist/components/label.d.ts +1 -3
  92. package/dist/components/label.js.map +1 -1
  93. package/dist/components/list.d.ts +1 -3
  94. package/dist/components/list.js.map +1 -1
  95. package/dist/components/logo.d.ts +0 -2
  96. package/dist/components/marker.d.ts +1 -3
  97. package/dist/components/marker.js.map +1 -1
  98. package/dist/components/mask-input.d.ts +0 -2
  99. package/dist/components/mask-input.js.map +1 -1
  100. package/dist/components/native-select.d.ts +0 -2
  101. package/dist/components/native-select.js.map +1 -1
  102. package/dist/components/navigation-menu.d.ts +1 -3
  103. package/dist/components/navigation-menu.js.map +1 -1
  104. package/dist/components/number-field.d.ts +1 -3
  105. package/dist/components/number-field.js.map +1 -1
  106. package/dist/components/pagination.d.ts +0 -2
  107. package/dist/components/pagination.js.map +1 -1
  108. package/dist/components/phone-input.d.ts +0 -2
  109. package/dist/components/phone-input.js.map +1 -1
  110. package/dist/components/pie-chart.d.ts +1 -3
  111. package/dist/components/pie-chart.js.map +1 -1
  112. package/dist/components/popover.d.ts +1 -3
  113. package/dist/components/popover.js.map +1 -1
  114. package/dist/components/progress.d.ts +0 -2
  115. package/dist/components/progress.js.map +1 -1
  116. package/dist/components/radio-group.d.ts +0 -2
  117. package/dist/components/radio-group.js.map +1 -1
  118. package/dist/components/resizable.d.ts +0 -2
  119. package/dist/components/resizable.js.map +1 -1
  120. package/dist/components/ring-progress.d.ts +0 -2
  121. package/dist/components/ring-progress.js.map +1 -1
  122. package/dist/components/scroll-area.d.ts +0 -2
  123. package/dist/components/scroll-area.js.map +1 -1
  124. package/dist/components/select.d.ts +1 -3
  125. package/dist/components/select.js.map +1 -1
  126. package/dist/components/separator.d.ts +1 -3
  127. package/dist/components/separator.js.map +1 -1
  128. package/dist/components/sidebar.d.ts +1 -3
  129. package/dist/components/sidebar.js.map +1 -1
  130. package/dist/components/simple-grid.d.ts +0 -2
  131. package/dist/components/simple-grid.js.map +1 -1
  132. package/dist/components/skeleton.d.ts +0 -2
  133. package/dist/components/skeleton.js.map +1 -1
  134. package/dist/components/slider.d.ts +0 -2
  135. package/dist/components/slider.js.map +1 -1
  136. package/dist/components/sonner.d.ts +0 -2
  137. package/dist/components/sonner.js.map +1 -1
  138. package/dist/components/spinner.d.ts +0 -2
  139. package/dist/components/spinner.js.map +1 -1
  140. package/dist/components/stack.d.ts +0 -2
  141. package/dist/components/stack.js.map +1 -1
  142. package/dist/components/stepper.d.ts +1 -3
  143. package/dist/components/stepper.js.map +1 -1
  144. package/dist/components/switch.d.ts +0 -2
  145. package/dist/components/switch.js.map +1 -1
  146. package/dist/components/table.d.ts +0 -2
  147. package/dist/components/table.js.map +1 -1
  148. package/dist/components/tabs.d.ts +1 -3
  149. package/dist/components/tabs.js.map +1 -1
  150. package/dist/components/text.d.ts +1 -3
  151. package/dist/components/text.js.map +1 -1
  152. package/dist/components/textarea.d.ts +0 -2
  153. package/dist/components/textarea.js.map +1 -1
  154. package/dist/components/theme.d.ts +0 -2
  155. package/dist/components/theme.js.map +1 -1
  156. package/dist/components/timeline.d.ts +0 -2
  157. package/dist/components/timeline.js.map +1 -1
  158. package/dist/components/toggle-group.d.ts +1 -3
  159. package/dist/components/toggle-group.js.map +1 -1
  160. package/dist/components/toggle.d.ts +1 -3
  161. package/dist/components/toggle.js.map +1 -1
  162. package/dist/components/tooltip.d.ts +1 -3
  163. package/dist/components/tooltip.js.map +1 -1
  164. package/dist/components/unstyled-button.d.ts +1 -3
  165. package/dist/components/unstyled-button.js.map +1 -1
  166. package/dist/components/visibility.d.ts +0 -2
  167. package/dist/components/visibility.js.map +1 -1
  168. package/dist/hooks/use-breakpoint-value.d.ts +0 -2
  169. package/dist/hooks/use-breakpoint-value.js.map +1 -1
  170. package/dist/hooks/use-breakpoint.d.ts +0 -2
  171. package/dist/hooks/use-breakpoint.js.map +1 -1
  172. package/dist/hooks/use-disclosure.d.ts +0 -2
  173. package/dist/hooks/use-disclosure.js.map +1 -1
  174. package/dist/hooks/use-document-visibility.d.ts +0 -2
  175. package/dist/hooks/use-document-visibility.js.map +1 -1
  176. package/dist/hooks/use-hotkeys.d.ts +1 -1
  177. package/dist/hooks/use-idle.d.ts +0 -2
  178. package/dist/hooks/use-idle.js.map +1 -1
  179. package/dist/hooks/use-interval.d.ts +0 -2
  180. package/dist/hooks/use-interval.js.map +1 -1
  181. package/dist/hooks/use-local-storage.d.ts +0 -2
  182. package/dist/hooks/use-local-storage.js.map +1 -1
  183. package/dist/hooks/use-mask.d.ts +0 -2
  184. package/dist/hooks/use-mask.js.map +1 -1
  185. package/dist/hooks/use-mobile.d.ts +0 -2
  186. package/dist/hooks/use-mobile.js.map +1 -1
  187. package/dist/index.d.ts +3 -3
  188. package/dist/lib/as-child.d.ts +1 -1
  189. package/dist/lib/as-child.js.map +1 -1
  190. package/dist/lib/badge.d.ts +0 -2
  191. package/dist/lib/badge.js.map +1 -1
  192. package/dist/lib/button.d.ts +0 -2
  193. package/dist/lib/button.js.map +1 -1
  194. package/dist/lib/color.d.ts +0 -2
  195. package/dist/lib/color.js.map +1 -1
  196. package/dist/lib/compose-refs.d.ts +0 -2
  197. package/dist/lib/compose-refs.js.map +1 -1
  198. package/dist/lib/progress.d.ts +0 -2
  199. package/dist/lib/progress.js.map +1 -1
  200. package/dist/lib/utils.d.ts +0 -2
  201. package/dist/lib/utils.js.map +1 -1
  202. package/dist/logo--R3_XDgA.js.map +1 -1
  203. package/dist/postcss.config.js.map +1 -1
  204. package/dist/resolve-class-name-BurP8ngI.js.map +1 -1
  205. package/dist/skills/uselets-ui/references/component-catalog.md +3 -3
  206. package/dist/{use-hotkeys-D1_TEIwN.d.ts → use-hotkeys-BVm0IGb8.d.ts} +1 -5
  207. package/dist/use-hotkeys-YDJmGWX6.js.map +1 -1
  208. package/package.json +9 -9
  209. package/skills/uselets-ui/references/component-catalog.md +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"bar-chart.js","names":["RechartsBarChart","React","BarChart$1","series","item","resolveChartColor","DEFAULT_CHART_PALETTE","index","acc","props","config","stackId","type","stackOffset","isHorizontal","orientation","categoryAxisProps","valueTickFormatter","value","unit","ChartContainer","cn","className","barChartProps","gridAxis","CartesianGrid","withXAxis","XAxis","withYAxis","YAxis","withTooltip","Tooltip","ChartTooltipContent","tooltipProps","withLegend","Legend","ChartLegendContent","legendProps","seriesColor","Bar","animationDuration","row","shapeProps","fill","Rectangle","barProps"],"sources":["../../src/components/bar-chart.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { Bar, CartesianGrid, Legend, BarChart as RechartsBarChart, Rectangle, Tooltip, XAxis, YAxis } from 'recharts'\n\nimport { cn } from '../lib/utils'\nimport {\n type ChartColorKey,\n type ChartConfig,\n ChartContainer,\n ChartLegendContent,\n type ChartLegendContentProps,\n ChartTooltipContent,\n type ChartTooltipContentProps,\n DEFAULT_CHART_PALETTE,\n resolveChartColor\n} from './chart'\n\nexport type BarChartSeries = {\n /** Field of each `data` row holding this series’ values. Also the default label. */\n name: string\n /** Name shown in the tooltip and legend. Defaults to `name`. */\n label?: string\n /** Any CSS color. Wins over `colorKey`. */\n color?: string\n /** Palette family, resolved to its semantic color `var(--{key})`. */\n colorKey?: ChartColorKey\n}\n\nexport type BarChartDatum = Record<string, unknown> & {\n /** Colors every bar in this row. Wins over the series color. */\n color?: string\n /** Palette family for every bar in this row. Wins over the series color. */\n colorKey?: ChartColorKey\n}\n\nexport type BarChartType = 'default' | 'stacked' | 'percent'\nexport type BarChartOrientation = 'vertical' | 'horizontal'\nexport type BarChartGridAxis = 'none' | 'x' | 'y' | 'xy'\n\nexport type BarChartProps = Omit<React.ComponentProps<'div'>, 'children'> & {\n /** Rows to plot. */\n data: BarChartDatum[]\n /** Series to draw, one per field of `data`. */\n series: BarChartSeries[]\n /** Field of `data` used for the categories axis. */\n dataKey: string\n /**\n * `stacked` stacks the series, `percent` stacks them to 100%.\n * @default 'default'\n */\n type?: BarChartType\n /**\n * `vertical` draws vertical bars; `horizontal` draws horizontal bars.\n * @default 'vertical'\n */\n orientation?: BarChartOrientation\n /**\n * Shows the x axis.\n * @default true\n */\n withXAxis?: boolean\n /**\n * Shows the y axis.\n * @default true\n */\n withYAxis?: boolean\n /**\n * Grid lines to draw.\n * @default 'x'\n */\n gridAxis?: BarChartGridAxis\n /**\n * Shows a tooltip on hover.\n * @default true\n */\n withTooltip?: boolean\n /**\n * Shows the legend.\n * @default false\n */\n withLegend?: boolean\n /** Fixed bar width in px. */\n barSize?: number\n /**\n * Corner radius of the bars.\n * @default 4\n */\n radius?: number | [number, number, number, number]\n /** Appended to the axis and tooltip values. */\n unit?: string\n /** Animation length in ms. */\n animationDuration?: number\n /** Props for the tooltip content. */\n tooltipProps?: ChartTooltipContentProps\n /** Props for the legend content. */\n legendProps?: ChartLegendContentProps\n /** Props for each Recharts `<Bar>`. */\n barProps?: Partial<React.ComponentProps<typeof Bar>>\n /** Props for the Recharts `<BarChart>`. */\n barChartProps?: Omit<React.ComponentProps<typeof RechartsBarChart>, 'data' | 'layout' | 'stackOffset'>\n}\n\nfunction buildConfig(series: BarChartSeries[]): ChartConfig {\n return series.reduce<ChartConfig>((acc, item, index) => {\n acc[item.name] = {\n label: item.label ?? item.name,\n color:\n item.color ?? resolveChartColor(item.colorKey) ?? DEFAULT_CHART_PALETTE[index % DEFAULT_CHART_PALETTE.length]\n }\n return acc\n }, {})\n}\n\nfunction BarChart({\n className,\n data,\n series,\n dataKey,\n type = 'default',\n orientation = 'vertical',\n withXAxis = true,\n withYAxis = true,\n gridAxis = 'x',\n withTooltip = true,\n withLegend = false,\n barSize,\n radius = 4,\n unit,\n animationDuration,\n tooltipProps,\n legendProps,\n barProps,\n barChartProps,\n ...props\n}: BarChartProps) {\n const config = React.useMemo(() => buildConfig(series), [series])\n const stackId = type === 'default' ? undefined : 'stack'\n const stackOffset = type === 'percent' ? 'expand' : undefined\n const isHorizontal = orientation === 'horizontal'\n\n const categoryAxisProps = {\n dataKey,\n tickLine: false,\n axisLine: false,\n tickMargin: 8\n } as const\n\n const valueTickFormatter =\n type === 'percent'\n ? (value: number) => `${Math.round(value * 100)}%`\n : unit\n ? (value: number) => `${value}${unit}`\n : undefined\n\n return (\n <ChartContainer data-slot=\"bar-chart\" className={cn('w-full', className)} config={config} {...props}>\n <RechartsBarChart\n {...barChartProps}\n data={data}\n stackOffset={stackOffset}\n layout={isHorizontal ? 'vertical' : 'horizontal'}\n >\n {gridAxis !== 'none' && (\n <CartesianGrid\n vertical={gridAxis === 'y' || gridAxis === 'xy'}\n horizontal={gridAxis === 'x' || gridAxis === 'xy'}\n />\n )}\n {withXAxis &&\n (isHorizontal ? (\n <XAxis type=\"number\" tickLine={false} axisLine={false} tickMargin={8} tickFormatter={valueTickFormatter} />\n ) : (\n <XAxis type=\"category\" {...categoryAxisProps} />\n ))}\n {withYAxis &&\n (isHorizontal ? (\n <YAxis type=\"category\" {...categoryAxisProps} />\n ) : (\n <YAxis type=\"number\" tickLine={false} axisLine={false} tickMargin={8} tickFormatter={valueTickFormatter} />\n ))}\n {withTooltip && <Tooltip cursor={false} content={<ChartTooltipContent {...tooltipProps} />} />}\n {withLegend && <Legend content={<ChartLegendContent {...legendProps} />} />}\n {series.map((item) => {\n const seriesColor = config[item.name]?.color\n return (\n <Bar\n key={item.name}\n dataKey={item.name}\n stackId={stackId}\n fill={seriesColor}\n radius={radius}\n barSize={barSize}\n animationDuration={animationDuration}\n isAnimationActive={animationDuration !== 0}\n shape={(shapeProps) => {\n const row = shapeProps.payload as BarChartDatum | undefined\n const fill = row?.color ?? resolveChartColor(row?.colorKey) ?? seriesColor\n return <Rectangle {...shapeProps} fill={fill} />\n }}\n {...barProps}\n />\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1G,kBAACU,EAAD,CAAO,KAAK,WAAW,GAAIX,CAAoB,CAAA,GAElDY,IACEd,EACC,kBAACe,EAAD,CAAO,KAAK,WAAW,GAAIb,CAAoB,CAAA,EAE/C,kBAACa,EAAD,CAAO,KAAK,SAAS,SAAU,GAAO,SAAU,GAAO,WAAY,EAAG,cAAeZ,CAAqB,CAAA,GAE7Ga,GAAe,kBAACC,EAAD,CAAS,OAAQ,GAAO,QAAS,kBAACC,EAAD,CAAqB,GAAIC,CAAe,CAAA,CAAI,CAAA,EAC5FC,GAAc,kBAACC,EAAD,CAAQ,QAAS,kBAACC,EAAD,CAAoB,GAAIC,CAAc,CAAA,CAAI,CAAA,EACzElC,EAAO,IAAK,GAAS,CACpB,IAAMmC,EAAc5B,EAAON,EAAK,KAAK,EAAE,MACvC,MACE,kBAACmC,EAAD,CAEE,QAASnC,EAAK,KACL,UACT,KAAMkC,EACE,SACC,UACU,oBACnB,kBAAmBE,IAAsB,EACzC,MAAQ,GAAe,CACrB,IAAMC,EAAMC,EAAW,QACjBC,EAAOF,GAAK,OAASpC,EAAkBoC,GAAK,QAAQ,GAAKH,EAC/D,MAAO,kBAACM,EAAD,CAAW,GAAIF,EAAkB,MAAO,CAAA,CACjD,EACA,GAAIG,CACL,EAdMzC,EAAK,IAcX,CAEL,CAAC,CACe,GACJ,CAAA,CAEpB"}
1
+ {"version":3,"file":"bar-chart.js","names":["RechartsBarChart","React","BarChart$1","series","item","resolveChartColor","DEFAULT_CHART_PALETTE","index","acc","props","config","stackId","type","stackOffset","isHorizontal","orientation","categoryAxisProps","valueTickFormatter","value","unit","ChartContainer","cn","className","barChartProps","gridAxis","CartesianGrid","withXAxis","XAxis","withYAxis","YAxis","withTooltip","Tooltip","ChartTooltipContent","tooltipProps","withLegend","Legend","ChartLegendContent","legendProps","seriesColor","Bar","animationDuration","row","shapeProps","fill","Rectangle","barProps"],"sources":["../../src/components/bar-chart.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { Bar, CartesianGrid, Legend, BarChart as RechartsBarChart, Rectangle, Tooltip, XAxis, YAxis } from 'recharts'\n\nimport { cn } from '../lib/utils'\nimport {\n type ChartColorKey,\n type ChartConfig,\n ChartContainer,\n ChartLegendContent,\n type ChartLegendContentProps,\n ChartTooltipContent,\n type ChartTooltipContentProps,\n DEFAULT_CHART_PALETTE,\n resolveChartColor\n} from './chart'\n\nexport type BarChartSeries = {\n /** Field of each `data` row holding this series’ values. Also the default label. */\n name: string\n /** Name shown in the tooltip and legend. Defaults to `name`. */\n label?: string\n /** Any CSS color. Wins over `colorKey`. */\n color?: string\n /** Palette family, resolved to its semantic color `var(--{key})`. */\n colorKey?: ChartColorKey\n}\n\nexport type BarChartDatum = Record<string, unknown> & {\n /** Colors every bar in this row. Wins over the series color. */\n color?: string\n /** Palette family for every bar in this row. Wins over the series color. */\n colorKey?: ChartColorKey\n}\n\nexport type BarChartType = 'default' | 'stacked' | 'percent'\nexport type BarChartOrientation = 'vertical' | 'horizontal'\nexport type BarChartGridAxis = 'none' | 'x' | 'y' | 'xy'\n\nexport type BarChartProps = Omit<React.ComponentProps<'div'>, 'children'> & {\n /** Rows to plot. */\n data: BarChartDatum[]\n /** Series to draw, one per field of `data`. */\n series: BarChartSeries[]\n /** Field of `data` used for the categories axis. */\n dataKey: string\n /**\n * `stacked` stacks the series, `percent` stacks them to 100%.\n * @default 'default'\n */\n type?: BarChartType\n /**\n * `vertical` draws vertical bars; `horizontal` draws horizontal bars.\n * @default 'vertical'\n */\n orientation?: BarChartOrientation\n /**\n * Shows the x axis.\n * @default true\n */\n withXAxis?: boolean\n /**\n * Shows the y axis.\n * @default true\n */\n withYAxis?: boolean\n /**\n * Grid lines to draw.\n * @default 'x'\n */\n gridAxis?: BarChartGridAxis\n /**\n * Shows a tooltip on hover.\n * @default true\n */\n withTooltip?: boolean\n /**\n * Shows the legend.\n * @default false\n */\n withLegend?: boolean\n /** Fixed bar width in px. */\n barSize?: number\n /**\n * Corner radius of the bars.\n * @default 4\n */\n radius?: number | [number, number, number, number]\n /** Appended to the axis and tooltip values. */\n unit?: string\n /** Animation length in ms. */\n animationDuration?: number\n /** Props for the tooltip content. */\n tooltipProps?: ChartTooltipContentProps\n /** Props for the legend content. */\n legendProps?: ChartLegendContentProps\n /** Props for each Recharts `<Bar>`. */\n barProps?: Partial<React.ComponentProps<typeof Bar>>\n /** Props for the Recharts `<BarChart>`. */\n barChartProps?: Omit<React.ComponentProps<typeof RechartsBarChart>, 'data' | 'layout' | 'stackOffset'>\n}\n\nfunction buildConfig(series: BarChartSeries[]): ChartConfig {\n return series.reduce<ChartConfig>((acc, item, index) => {\n acc[item.name] = {\n label: item.label ?? item.name,\n color:\n item.color ?? resolveChartColor(item.colorKey) ?? DEFAULT_CHART_PALETTE[index % DEFAULT_CHART_PALETTE.length]\n }\n return acc\n }, {})\n}\n\nfunction BarChart({\n className,\n data,\n series,\n dataKey,\n type = 'default',\n orientation = 'vertical',\n withXAxis = true,\n withYAxis = true,\n gridAxis = 'x',\n withTooltip = true,\n withLegend = false,\n barSize,\n radius = 4,\n unit,\n animationDuration,\n tooltipProps,\n legendProps,\n barProps,\n barChartProps,\n ...props\n}: BarChartProps) {\n const config = React.useMemo(() => buildConfig(series), [series])\n const stackId = type === 'default' ? undefined : 'stack'\n const stackOffset = type === 'percent' ? 'expand' : undefined\n const isHorizontal = orientation === 'horizontal'\n\n const categoryAxisProps = {\n dataKey,\n tickLine: false,\n axisLine: false,\n tickMargin: 8\n } as const\n\n const valueTickFormatter =\n type === 'percent'\n ? (value: number) => `${Math.round(value * 100)}%`\n : unit\n ? (value: number) => `${value}${unit}`\n : undefined\n\n return (\n <ChartContainer data-slot=\"bar-chart\" className={cn('w-full', className)} config={config} {...props}>\n <RechartsBarChart\n {...barChartProps}\n data={data}\n stackOffset={stackOffset}\n layout={isHorizontal ? 'vertical' : 'horizontal'}\n >\n {gridAxis !== 'none' && (\n <CartesianGrid\n vertical={gridAxis === 'y' || gridAxis === 'xy'}\n horizontal={gridAxis === 'x' || gridAxis === 'xy'}\n />\n )}\n {withXAxis &&\n (isHorizontal ? (\n <XAxis type=\"number\" tickLine={false} axisLine={false} tickMargin={8} tickFormatter={valueTickFormatter} />\n ) : (\n <XAxis type=\"category\" {...categoryAxisProps} />\n ))}\n {withYAxis &&\n (isHorizontal ? (\n <YAxis type=\"category\" {...categoryAxisProps} />\n ) : (\n <YAxis type=\"number\" tickLine={false} axisLine={false} tickMargin={8} tickFormatter={valueTickFormatter} />\n ))}\n {withTooltip && <Tooltip cursor={false} content={<ChartTooltipContent {...tooltipProps} />} />}\n {withLegend && <Legend content={<ChartLegendContent {...legendProps} />} />}\n {series.map((item) => {\n const seriesColor = config[item.name]?.color\n return (\n <Bar\n key={item.name}\n dataKey={item.name}\n stackId={stackId}\n fill={seriesColor}\n radius={radius}\n barSize={barSize}\n animationDuration={animationDuration}\n isAnimationActive={animationDuration !== 0}\n shape={(shapeProps) => {\n const row = shapeProps.payload as BarChartDatum | undefined\n const fill = row?.color ?? resolveChartColor(row?.colorKey) ?? seriesColor\n return <Rectangle {...shapeProps} fill={fill} />\n }}\n {...barProps}\n />\n )\n })}\n </RechartsBarChart>\n </ChartContainer>\n )\n}\n\nexport { BarChart }\n"],"mappings":"A,oaAsGA,SAAS,YAAY,EAAuC,CAC1D,OAAOG,EAAO,QAAqB,EAAK,EAAM,KAC5C,EAAIC,EAAK,MAAQ,CACf,MAAOA,EAAK,OAASA,EAAK,KAC1B,MACEA,EAAK,OAASC,EAAkBD,EAAK,QAAQ,GAAKE,EAAsBC,EAAQD,EAAsB,OAC1G,EACOE,GACN,CAAC,CAAC,CACP,CAEA,SAAS,SAAS,CAChB,YACA,OACA,SACA,UACA,OAAO,UACP,cAAc,WACd,YAAY,GACZ,YAAY,GACZ,WAAW,IACX,cAAc,GACd,aAAa,GACb,UACA,SAAS,EACT,OACA,oBACA,eACA,cACA,WACA,gBACA,GAAGC,GACa,CAChB,IAAMC,EAAST,EAAM,YAAc,YAAYE,CAAM,EAAG,CAAC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L,UACT,KAAMkC,EACE,SACC,UACU,oBACnB,kBAAmBE,IAAsB,EACzC,MAAQ,GAAe,CACrB,IAAMC,EAAMC,EAAW,QACjBC,EAAOF,GAAK,OAASpC,EAAkBoC,GAAK,QAAQ,GAAKH,EAC/D,MAAO,kBAACM,EAAD,CAAW,GAAIF,EAAkB,MAAO,CAAA,CACjD,EACA,GAAIG,CACL,EAdMzC,EAAK,IAcX,CAEL,CAAC,CACe,C,EACJ,CAAA,CAEpB,C"}
@@ -1,7 +1,6 @@
1
1
  import { t as __name } from "../rolldown-runtime-BhWHdk3m.js";
2
- import { n as AsChildProps } from "../as-child-Dxg3Xo1G.js";
2
+ import { n as AsChildProps } from "../as-child-T9W73ZYU.js";
3
3
  import * as React from "react";
4
- //#region src/components/bottom-nav.d.ts
5
4
  export type BottomNavProps = React.ComponentProps<'nav'>;
6
5
  export type BottomNavItemProps = AsChildProps<'button'> & {
7
6
  /**
@@ -12,6 +11,5 @@ export type BottomNavItemProps = AsChildProps<'button'> & {
12
11
  };
13
12
  declare function BottomNav({ className, ...props }: BottomNavProps): React.JSX.Element;
14
13
  declare function BottomNavItem({ className, type, asChild, isActive, ...props }: BottomNavItemProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
15
- //#endregion
16
14
  export { BottomNav, BottomNavItem };
17
15
  //# sourceMappingURL=bottom-nav.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bottom-nav.js","names":["props","cn","className","useAsChild","asChild","type","isActive"],"sources":["../../src/components/bottom-nav.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { type AsChildProps, useAsChild } from '../lib/as-child'\nimport { cn } from '../lib/utils'\n\nexport type BottomNavProps = React.ComponentProps<'nav'>\n\nexport type BottomNavItemProps = AsChildProps<'button'> & {\n /**\n * Marks the item as the current page (`aria-current=\"page\"`).\n * @default false\n */\n isActive?: boolean\n}\n\nfunction BottomNav({ className, ...props }: BottomNavProps) {\n return (\n <nav\n aria-label=\"bottom navigation\"\n data-slot=\"bottom-nav\"\n className={cn(\n 'fixed inset-x-0 bottom-0 z-30 flex border-t bg-background',\n 'px-2 pt-2 pb-[calc(--spacing(2)+var(--spacing-safe-bottom))]',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction BottomNavItem({\n className,\n type = 'button',\n asChild = false,\n isActive = false,\n ...props\n}: BottomNavItemProps) {\n return useAsChild('button', {\n asChild,\n type: !asChild ? type : undefined,\n 'data-slot': 'bottom-nav-item',\n 'data-active': isActive,\n 'aria-current': isActive ? 'page' : undefined,\n className: cn(\n 'flex flex-1 flex-col items-center justify-center gap-1 rounded-md py-1 text-xs font-medium text-muted-foreground',\n 'transition-colors data-[active=true]:font-semibold data-[active=true]:text-primary',\n 'focus-visible:ring-3 focus-visible:ring-ring/50 outline-hidden',\n '[&_svg]:size-5 [&_svg]:shrink-0 [&>span:last-child]:truncate',\n className\n ),\n ...props\n })\n}\n\nexport { BottomNav, BottomNavItem }\n"],"mappings":"qKAeA,SAAS,UAAU,CAAE,YAAW,GAAGA,GAAyB,CAC1D,MACE,kBAAC,MAAD,CACE,aAAW,oBACX,YAAU,aACV,UAAWC,EACT,4DACA,+DACAC,CACF,EACA,GAAIF,CACL,CAAA,CAEL,CAEA,SAAS,cAAc,CACrB,YACA,OAAO,SACP,UAAU,GACV,WAAW,GACX,GAAGA,GACkB,CACrB,OAAOG,EAAW,SAAU,CAC1B,UACA,KAAOC,EAAiB,IAAA,GAAPC,EACjB,YAAa,kBACb,cAAeC,EACf,eAAgBA,EAAW,OAAS,IAAA,GACpC,UAAWL,EACT,mHACA,qFACA,iEACA,+DACAC,CACF,EACA,GAAGF,CACL,CAAC,CACH"}
1
+ {"version":3,"file":"bottom-nav.js","names":["props","cn","className","useAsChild","asChild","type","isActive"],"sources":["../../src/components/bottom-nav.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { type AsChildProps, useAsChild } from '../lib/as-child'\nimport { cn } from '../lib/utils'\n\nexport type BottomNavProps = React.ComponentProps<'nav'>\n\nexport type BottomNavItemProps = AsChildProps<'button'> & {\n /**\n * Marks the item as the current page (`aria-current=\"page\"`).\n * @default false\n */\n isActive?: boolean\n}\n\nfunction BottomNav({ className, ...props }: BottomNavProps) {\n return (\n <nav\n aria-label=\"bottom navigation\"\n data-slot=\"bottom-nav\"\n className={cn(\n 'fixed inset-x-0 bottom-0 z-30 flex border-t bg-background',\n 'px-2 pt-2 pb-[calc(--spacing(2)+var(--spacing-safe-bottom))]',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction BottomNavItem({\n className,\n type = 'button',\n asChild = false,\n isActive = false,\n ...props\n}: BottomNavItemProps) {\n return useAsChild('button', {\n asChild,\n type: !asChild ? type : undefined,\n 'data-slot': 'bottom-nav-item',\n 'data-active': isActive,\n 'aria-current': isActive ? 'page' : undefined,\n className: cn(\n 'flex flex-1 flex-col items-center justify-center gap-1 rounded-md py-1 text-xs font-medium text-muted-foreground',\n 'transition-colors data-[active=true]:font-semibold data-[active=true]:text-primary',\n 'focus-visible:ring-3 focus-visible:ring-ring/50 outline-hidden',\n '[&_svg]:size-5 [&_svg]:shrink-0 [&>span:last-child]:truncate',\n className\n ),\n ...props\n })\n}\n\nexport { BottomNav, BottomNavItem }\n"],"mappings":"A,qKAeA,SAAS,UAAU,CAAE,YAAW,GAAGA,GAAyB,CAC1D,MACE,kBAAC,MAAD,CACE,aAAW,oBACX,YAAU,aACV,UAAWC,EACT,4DACA,+DACAC,CACF,EACA,GAAIF,CACL,CAAA,CAEL,CAEA,SAAS,cAAc,CACrB,YACA,OAAO,SACP,UAAU,GACV,WAAW,GACX,GAAGA,GACkB,CACrB,OAAOG,EAAW,SAAU,CAC1B,UACA,KAAOC,EAAiB,IAAA,GAAPC,EACjB,YAAa,kBACb,cAAeC,EACf,eAAgBA,EAAW,OAAS,IAAA,GACpC,UAAWL,EACT,mHACA,qFACA,iEACA,+DACAC,CACF,EACA,GAAGF,CACL,CAAC,CACH,C"}
@@ -1,7 +1,6 @@
1
1
  import { t as __name } from "../rolldown-runtime-BhWHdk3m.js";
2
- import { n as AsChildProps } from "../as-child-Dxg3Xo1G.js";
2
+ import { n as AsChildProps } from "../as-child-T9W73ZYU.js";
3
3
  import * as React from "react";
4
- //#region src/components/breadcrumb.d.ts
5
4
  export type BreadcrumbProps = React.ComponentProps<'nav'>;
6
5
  export type BreadcrumbListProps = React.ComponentProps<'ol'>;
7
6
  export type BreadcrumbItemProps = React.ComponentProps<'li'>;
@@ -16,6 +15,5 @@ declare function BreadcrumbLink({ className, ...props }: BreadcrumbLinkProps): R
16
15
  declare function BreadcrumbPage({ className, ...props }: BreadcrumbPageProps): React.JSX.Element;
17
16
  declare function BreadcrumbSeparator({ children, className, ...props }: BreadcrumbSeparatorProps): React.JSX.Element;
18
17
  declare function BreadcrumbEllipsis({ className, ...props }: BreadcrumbEllipsisProps): React.JSX.Element;
19
- //#endregion
20
18
  export { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator };
21
19
  //# sourceMappingURL=breadcrumb.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"breadcrumb.js","names":["props","cn","className","useAsChild","children","IconChevronRight","IconDots"],"sources":["../../src/components/breadcrumb.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { IconChevronRight, IconDots } from '@tabler/icons-react'\n\nimport { type AsChildProps, useAsChild } from '../lib/as-child'\nimport { cn } from '../lib/utils'\n\nexport type BreadcrumbProps = React.ComponentProps<'nav'>\n\nexport type BreadcrumbListProps = React.ComponentProps<'ol'>\n\nexport type BreadcrumbItemProps = React.ComponentProps<'li'>\n\nexport type BreadcrumbLinkProps = AsChildProps<'a'>\n\nexport type BreadcrumbPageProps = React.ComponentProps<'span'>\n\nexport type BreadcrumbSeparatorProps = React.ComponentProps<'li'>\n\nexport type BreadcrumbEllipsisProps = React.ComponentProps<'span'>\n\nfunction Breadcrumb({ className, ...props }: BreadcrumbProps) {\n return <nav aria-label=\"breadcrumb\" data-slot=\"breadcrumb\" className={cn(className)} {...props} />\n}\n\nfunction BreadcrumbList({ className, ...props }: BreadcrumbListProps) {\n return (\n <ol\n data-slot=\"breadcrumb-list\"\n className={cn('flex flex-wrap items-center gap-1.5 text-sm wrap-break-word text-muted-foreground', className)}\n {...props}\n />\n )\n}\n\nfunction BreadcrumbItem({ className, ...props }: BreadcrumbItemProps) {\n return <li data-slot=\"breadcrumb-item\" className={cn('inline-flex items-center gap-1', className)} {...props} />\n}\n\nfunction BreadcrumbLink({ className, ...props }: BreadcrumbLinkProps) {\n return useAsChild('a', {\n 'data-slot': 'breadcrumb-link',\n className: cn('transition-colors hover:text-foreground', className),\n ...props\n })\n}\n\nfunction BreadcrumbPage({ className, ...props }: BreadcrumbPageProps) {\n return (\n <span\n data-slot=\"breadcrumb-page\"\n aria-current=\"page\"\n className={cn('font-normal text-foreground', className)}\n {...props}\n />\n )\n}\n\nfunction BreadcrumbSeparator({ children, className, ...props }: BreadcrumbSeparatorProps) {\n return (\n <li\n data-slot=\"breadcrumb-separator\"\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn('[&>svg]:size-3.5', className)}\n {...props}\n >\n {children ?? <IconChevronRight />}\n </li>\n )\n}\n\nfunction BreadcrumbEllipsis({ className, ...props }: BreadcrumbEllipsisProps) {\n return (\n <span\n data-slot=\"breadcrumb-ellipsis\"\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn('flex size-5 items-center justify-center [&>svg]:size-4', className)}\n {...props}\n >\n <IconDots />\n <span className=\"sr-only\">More</span>\n </span>\n )\n}\n\nexport {\n Breadcrumb,\n BreadcrumbEllipsis,\n BreadcrumbItem,\n BreadcrumbLink,\n BreadcrumbList,\n BreadcrumbPage,\n BreadcrumbSeparator\n}\n"],"mappings":"oPAqBA,SAAS,WAAW,CAAE,YAAW,GAAGA,GAA0B,CAC5D,MAAO,kBAAC,MAAD,CAAK,aAAW,aAAa,YAAU,aAAa,UAAWC,EAAGC,CAAS,EAAG,GAAIF,CAAQ,CAAA,CACnG,CAEA,SAAS,eAAe,CAAE,YAAW,GAAGA,GAA8B,CACpE,MACE,kBAAC,KAAD,CACE,YAAU,kBACV,UAAWC,EAAG,oFAAqFC,CAAS,EAC5G,GAAIF,CACL,CAAA,CAEL,CAEA,SAAS,eAAe,CAAE,YAAW,GAAGA,GAA8B,CACpE,MAAO,kBAAC,KAAD,CAAI,YAAU,kBAAkB,UAAWC,EAAG,iCAAkCC,CAAS,EAAG,GAAIF,CAAQ,CAAA,CACjH,CAEA,SAAS,eAAe,CAAE,YAAW,GAAGA,GAA8B,CACpE,OAAOG,EAAW,IAAK,CACrB,YAAa,kBACb,UAAWF,EAAG,0CAA2CC,CAAS,EAClE,GAAGF,CACL,CAAC,CACH,CAEA,SAAS,eAAe,CAAE,YAAW,GAAGA,GAA8B,CACpE,MACE,kBAAC,OAAD,CACE,YAAU,kBACV,eAAa,OACb,UAAWC,EAAG,8BAA+BC,CAAS,EACtD,GAAIF,CACL,CAAA,CAEL,CAEA,SAAS,oBAAoB,CAAE,WAAU,YAAW,GAAGA,GAAmC,CACxF,MACE,kBAAC,KAAD,CACE,YAAU,uBACV,KAAK,eACL,cAAY,OACZ,UAAWC,EAAG,mBAAoBC,CAAS,EAC3C,GAAIF,EAEH,SAAAI,GAAY,kBAACC,EAAD,CAAmB,CAAA,CAC9B,CAAA,CAER,CAEA,SAAS,mBAAmB,CAAE,YAAW,GAAGL,GAAkC,CAC5E,MACE,kBAAC,OAAD,CACE,YAAU,sBACV,KAAK,eACL,cAAY,OACZ,UAAWC,EAAG,yDAA0DC,CAAS,EACjF,GAAIF,EALN,SAAA,CAOE,kBAACM,EAAD,CAAW,CAAA,EACX,kBAAC,OAAD,CAAM,UAAU,UAAU,SAAA,MAAU,CAAA,CAChC,GAEV"}
1
+ {"version":3,"file":"breadcrumb.js","names":["props","cn","className","useAsChild","children","IconChevronRight","IconDots"],"sources":["../../src/components/breadcrumb.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { IconChevronRight, IconDots } from '@tabler/icons-react'\n\nimport { type AsChildProps, useAsChild } from '../lib/as-child'\nimport { cn } from '../lib/utils'\n\nexport type BreadcrumbProps = React.ComponentProps<'nav'>\n\nexport type BreadcrumbListProps = React.ComponentProps<'ol'>\n\nexport type BreadcrumbItemProps = React.ComponentProps<'li'>\n\nexport type BreadcrumbLinkProps = AsChildProps<'a'>\n\nexport type BreadcrumbPageProps = React.ComponentProps<'span'>\n\nexport type BreadcrumbSeparatorProps = React.ComponentProps<'li'>\n\nexport type BreadcrumbEllipsisProps = React.ComponentProps<'span'>\n\nfunction Breadcrumb({ className, ...props }: BreadcrumbProps) {\n return <nav aria-label=\"breadcrumb\" data-slot=\"breadcrumb\" className={cn(className)} {...props} />\n}\n\nfunction BreadcrumbList({ className, ...props }: BreadcrumbListProps) {\n return (\n <ol\n data-slot=\"breadcrumb-list\"\n className={cn('flex flex-wrap items-center gap-1.5 text-sm wrap-break-word text-muted-foreground', className)}\n {...props}\n />\n )\n}\n\nfunction BreadcrumbItem({ className, ...props }: BreadcrumbItemProps) {\n return <li data-slot=\"breadcrumb-item\" className={cn('inline-flex items-center gap-1', className)} {...props} />\n}\n\nfunction BreadcrumbLink({ className, ...props }: BreadcrumbLinkProps) {\n return useAsChild('a', {\n 'data-slot': 'breadcrumb-link',\n className: cn('transition-colors hover:text-foreground', className),\n ...props\n })\n}\n\nfunction BreadcrumbPage({ className, ...props }: BreadcrumbPageProps) {\n return (\n <span\n data-slot=\"breadcrumb-page\"\n aria-current=\"page\"\n className={cn('font-normal text-foreground', className)}\n {...props}\n />\n )\n}\n\nfunction BreadcrumbSeparator({ children, className, ...props }: BreadcrumbSeparatorProps) {\n return (\n <li\n data-slot=\"breadcrumb-separator\"\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn('[&>svg]:size-3.5', className)}\n {...props}\n >\n {children ?? <IconChevronRight />}\n </li>\n )\n}\n\nfunction BreadcrumbEllipsis({ className, ...props }: BreadcrumbEllipsisProps) {\n return (\n <span\n data-slot=\"breadcrumb-ellipsis\"\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn('flex size-5 items-center justify-center [&>svg]:size-4', className)}\n {...props}\n >\n <IconDots />\n <span className=\"sr-only\">More</span>\n </span>\n )\n}\n\nexport {\n Breadcrumb,\n BreadcrumbEllipsis,\n BreadcrumbItem,\n BreadcrumbLink,\n BreadcrumbList,\n BreadcrumbPage,\n BreadcrumbSeparator\n}\n"],"mappings":"A,oPAqBA,SAAS,WAAW,CAAE,YAAW,GAAGA,GAA0B,CAC5D,MAAO,kBAAC,MAAD,CAAK,aAAW,aAAa,YAAU,aAAa,UAAWC,EAAGC,CAAS,EAAG,GAAIF,CAAQ,CAAA,CACnG,CAEA,SAAS,eAAe,CAAE,YAAW,GAAGA,GAA8B,CACpE,MACE,kBAAC,KAAD,CACE,YAAU,kBACV,UAAWC,EAAG,oFAAqFC,CAAS,EAC5G,GAAIF,CACL,CAAA,CAEL,CAEA,SAAS,eAAe,CAAE,YAAW,GAAGA,GAA8B,CACpE,MAAO,kBAAC,KAAD,CAAI,YAAU,kBAAkB,UAAWC,EAAG,iCAAkCC,CAAS,EAAG,GAAIF,CAAQ,CAAA,CACjH,CAEA,SAAS,eAAe,CAAE,YAAW,GAAGA,GAA8B,CACpE,OAAOG,EAAW,IAAK,CACrB,YAAa,kBACb,UAAWF,EAAG,0CAA2CC,CAAS,EAClE,GAAGF,CACL,CAAC,CACH,CAEA,SAAS,eAAe,CAAE,YAAW,GAAGA,GAA8B,CACpE,MACE,kBAAC,OAAD,CACE,YAAU,kBACV,eAAa,OACb,UAAWC,EAAG,8BAA+BC,CAAS,EACtD,GAAIF,CACL,CAAA,CAEL,CAEA,SAAS,oBAAoB,CAAE,WAAU,YAAW,GAAGA,GAAmC,CACxF,MACE,kBAAC,KAAD,CACE,YAAU,uBACV,KAAK,eACL,cAAY,OACZ,UAAWC,EAAG,mBAAoBC,CAAS,EAC3C,GAAIF,EAEH,SAAAI,GAAY,kBAACC,EAAD,CAAmB,CAAA,CAC9B,CAAA,CAER,CAEA,SAAS,mBAAmB,CAAE,YAAW,GAAGL,GAAkC,CAC5E,MACE,kBAAC,OAAD,CACE,YAAU,sBACV,KAAK,eACL,cAAY,OACZ,UAAWC,EAAG,yDAA0DC,CAAS,EACjF,GAAIF,EALN,SAAA,CAOE,kBAACM,EAAD,CAAW,CAAA,EACX,kBAAC,OAAD,CAAM,UAAU,UAAU,SAAA,MAAU,CAAA,CAChC,C,EAEV,C"}
@@ -1,8 +1,7 @@
1
1
  import { t as __name } from "../rolldown-runtime-BhWHdk3m.js";
2
- import { n as AsChildProps } from "../as-child-Dxg3Xo1G.js";
2
+ import { n as AsChildProps } from "../as-child-T9W73ZYU.js";
3
3
  import { Separator } from "./separator.js";
4
4
  import { VariantProps } from "class-variance-authority";
5
- //#region src/components/button-group.d.ts
6
5
  declare const buttonGroupVariants: (props?: ({
7
6
  orientation?: "horizontal" | "vertical" | null | undefined;
8
7
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
@@ -12,6 +11,5 @@ export type ButtonGroupSeparatorProps = React.ComponentProps<typeof Separator>;
12
11
  declare function ButtonGroup({ className, orientation, ...props }: ButtonGroupProps): import("react").JSX.Element;
13
12
  declare function ButtonGroupText({ className, ...props }: ButtonGroupTextProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
14
13
  declare function ButtonGroupSeparator({ className, orientation, ...props }: ButtonGroupSeparatorProps): import("react").JSX.Element;
15
- //#endregion
16
14
  export { ButtonGroup, ButtonGroupSeparator, ButtonGroupText, buttonGroupVariants };
17
15
  //# sourceMappingURL=button-group.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"button-group.js","names":["resolveClassName","buttonGroupVariants","cva","props","orientation","cn","className","useAsChild","Separator","state"],"sources":["../../src/components/button-group.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority'\n\nimport { type AsChildProps, useAsChild } from '../lib/as-child'\nimport { cn } from '../lib/utils'\nimport { resolveClassName } from '../utils/resolve-class-name'\nimport { Separator } from './separator'\n\nconst buttonGroupVariants = cva(\n \"flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-lg [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1\",\n {\n variants: {\n orientation: {\n horizontal:\n '[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-lg!',\n vertical:\n 'flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-lg!'\n }\n },\n defaultVariants: {\n orientation: 'horizontal'\n }\n }\n)\n\nexport type ButtonGroupProps = React.ComponentProps<'div'> & VariantProps<typeof buttonGroupVariants>\n\nexport type ButtonGroupTextProps = AsChildProps<'div'>\n\nexport type ButtonGroupSeparatorProps = React.ComponentProps<typeof Separator>\n\nfunction ButtonGroup({ className, orientation, ...props }: ButtonGroupProps) {\n return (\n <div\n data-slot=\"button-group\"\n data-orientation={orientation}\n className={cn(buttonGroupVariants({ orientation }), className)}\n {...props}\n />\n )\n}\n\nfunction ButtonGroupText({ className, ...props }: ButtonGroupTextProps) {\n return useAsChild('div', {\n className: cn(\n \"flex items-center gap-2 rounded-lg border bg-muted px-2.5 text-sm font-medium [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4\",\n className\n ),\n ...props\n })\n}\n\nfunction ButtonGroupSeparator({ className, orientation = 'vertical', ...props }: ButtonGroupSeparatorProps) {\n return (\n <Separator\n data-slot=\"button-group-separator\"\n orientation={orientation}\n className={(state) =>\n cn(\n 'relative self-stretch bg-input data-horizontal:mx-px data-horizontal:w-auto data-vertical:my-px data-vertical:h-auto',\n resolveClassName(className, state)\n )\n }\n {...props}\n />\n )\n}\n\nexport { ButtonGroup, ButtonGroupSeparator, ButtonGroupText, buttonGroupVariants }\n"],"mappings":"qTAOA,MAAMC,EAAsBC,EAC1B,2RACA,CACE,SAAU,CACR,YAAa,CACX,WACE,wKACF,SACE,gLACJ,CACF,EACA,gBAAiB,CACf,YAAa,YACf,CACF,CACF,EAQA,SAAS,YAAY,CAAE,YAAW,cAAa,GAAGC,GAA2B,CAC3E,MACE,kBAAC,MAAD,CACE,YAAU,eACV,mBAAkBC,EAClB,UAAWC,EAAGJ,EAAoB,CAAE,aAAY,CAAC,EAAGK,CAAS,EAC7D,GAAIH,CACL,CAAA,CAEL,CAEA,SAAS,gBAAgB,CAAE,YAAW,GAAGA,GAA+B,CACtE,OAAOI,EAAW,MAAO,CACvB,UAAWF,EACT,iJACAC,CACF,EACA,GAAGH,CACL,CAAC,CACH,CAEA,SAAS,qBAAqB,CAAE,YAAW,cAAc,WAAY,GAAGA,GAAoC,CAC1G,MACE,kBAACK,EAAD,CACE,YAAU,yBACG,cACb,UAAY,GACVH,EACE,uHACAL,EAAiBM,EAAWG,CAAK,CACnC,EAEF,GAAIN,CACL,CAAA,CAEL"}
1
+ {"version":3,"file":"button-group.js","names":["resolveClassName","buttonGroupVariants","cva","props","orientation","cn","className","useAsChild","Separator","state"],"sources":["../../src/components/button-group.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority'\n\nimport { type AsChildProps, useAsChild } from '../lib/as-child'\nimport { cn } from '../lib/utils'\nimport { resolveClassName } from '../utils/resolve-class-name'\nimport { Separator } from './separator'\n\nconst buttonGroupVariants = cva(\n \"flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-lg [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1\",\n {\n variants: {\n orientation: {\n horizontal:\n '[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-lg!',\n vertical:\n 'flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-lg!'\n }\n },\n defaultVariants: {\n orientation: 'horizontal'\n }\n }\n)\n\nexport type ButtonGroupProps = React.ComponentProps<'div'> & VariantProps<typeof buttonGroupVariants>\n\nexport type ButtonGroupTextProps = AsChildProps<'div'>\n\nexport type ButtonGroupSeparatorProps = React.ComponentProps<typeof Separator>\n\nfunction ButtonGroup({ className, orientation, ...props }: ButtonGroupProps) {\n return (\n <div\n data-slot=\"button-group\"\n data-orientation={orientation}\n className={cn(buttonGroupVariants({ orientation }), className)}\n {...props}\n />\n )\n}\n\nfunction ButtonGroupText({ className, ...props }: ButtonGroupTextProps) {\n return useAsChild('div', {\n className: cn(\n \"flex items-center gap-2 rounded-lg border bg-muted px-2.5 text-sm font-medium [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4\",\n className\n ),\n ...props\n })\n}\n\nfunction ButtonGroupSeparator({ className, orientation = 'vertical', ...props }: ButtonGroupSeparatorProps) {\n return (\n <Separator\n data-slot=\"button-group-separator\"\n orientation={orientation}\n className={(state) =>\n cn(\n 'relative self-stretch bg-input data-horizontal:mx-px data-horizontal:w-auto data-vertical:my-px data-vertical:h-auto',\n resolveClassName(className, state)\n )\n }\n {...props}\n />\n )\n}\n\nexport { ButtonGroup, ButtonGroupSeparator, ButtonGroupText, buttonGroupVariants }\n"],"mappings":"A,qTAOA,MAAMC,EAAsBC,EAC1B,2RACA,CACE,SAAU,CACR,YAAa,CACX,WACE,wKACF,SACE,gLACJ,CACF,EACA,gBAAiB,CACf,YAAa,YACf,CACF,CACF,EAQA,SAAS,YAAY,CAAE,YAAW,cAAa,GAAGC,GAA2B,CAC3E,MACE,kBAAC,MAAD,CACE,YAAU,eACV,mBAAkBC,EAClB,UAAWC,EAAGJ,EAAoB,CAAE,aAAY,CAAC,EAAGK,CAAS,EAC7D,GAAIH,CACL,CAAA,CAEL,CAEA,SAAS,gBAAgB,CAAE,YAAW,GAAGA,GAA+B,CACtE,OAAOI,EAAW,MAAO,CACvB,UAAWF,EACT,iJACAC,CACF,EACA,GAAGH,CACL,CAAC,CACH,CAEA,SAAS,qBAAqB,CAAE,YAAW,cAAc,WAAY,GAAGA,GAAoC,CAC1G,MACE,kBAACK,EAAD,CACE,YAAU,yBACG,cACb,UAAY,GACVH,EACE,uHACAL,EAAiBM,EAAWG,CAAK,CACnC,EAEF,GAAIN,CACL,CAAA,CAEL,C"}
@@ -1,8 +1,7 @@
1
1
  import { t as __name } from "../rolldown-runtime-BhWHdk3m.js";
2
- import { n as AsChildProps } from "../as-child-Dxg3Xo1G.js";
2
+ import { n as AsChildProps } from "../as-child-T9W73ZYU.js";
3
3
  import * as React from "react";
4
4
  import { VariantProps } from "class-variance-authority";
5
- //#region src/components/button.d.ts
6
5
  declare const buttonVariants: (props?: ({
7
6
  variant?: "ghost" | "link" | "outline" | "secondary" | "solid" | "subtle" | null | undefined;
8
7
  color?: "blue" | "brand" | "gray" | "green" | "indigo" | "pink" | "primary" | "red" | "yellow" | "zinc" | null | undefined;
@@ -16,6 +15,5 @@ export type ButtonProps = AsChildProps<'button'> & VariantProps<typeof buttonVar
16
15
  loading?: boolean;
17
16
  };
18
17
  declare function Button({ children, className, variant, color, size, asChild, disabled, loading, onClick, ...props }: ButtonProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
19
- //#endregion
20
18
  export { Button, buttonVariants };
21
19
  //# sourceMappingURL=button.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"button.js","names":["React","buttonVariants","cva","buttonColorVariants","Fragment","Spinner","props","isDisabled","disabled","loading","isAriaDisabled","asChild","content","children","child","useAsChild","variant","color","size","event","onClick","cn"],"sources":["../../src/components/button.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nimport { type AsChildProps, useAsChild } from '../lib/as-child'\nimport { buttonColorVariants } from '../lib/button'\nimport { cn } from '../lib/utils'\nimport { Spinner } from './spinner'\n\nconst buttonVariants = cva(\n \"focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 relative rounded-full border border-transparent bg-clip-padding text-sm font-semibold focus-visible:ring-3 aria-invalid:ring-3 [&_svg:not([class*='size-'])]:size-4 inline-flex items-center justify-center whitespace-nowrap transition-all [&_svg]:transition-colors disabled:pointer-events-none disabled:opacity-50 disabled:data-[loading=true]:pointer-events-auto disabled:data-[loading=true]:cursor-not-allowed disabled:data-[loading=true]:opacity-100 aria-disabled:pointer-events-none aria-disabled:opacity-50 aria-disabled:data-[loading=true]:pointer-events-auto aria-disabled:data-[loading=true]:cursor-not-allowed aria-disabled:data-[loading=true]:opacity-100 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none\",\n {\n variants: {\n variant: {\n solid:\n 'bg-(--button-solid) text-(--button-solid-foreground) hover:bg-(--button-solid-hover) data-[loading=true]:hover:bg-(--button-solid)',\n secondary:\n 'border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50',\n outline:\n 'border-(--button-outline-border) bg-transparent text-(--button-outline-foreground) hover:bg-(--button-solid) hover:text-(--button-solid-foreground) hover:[&_svg]:text-(--button-solid-foreground) data-[loading=true]:hover:bg-transparent data-[loading=true]:hover:text-(--button-outline-foreground) data-[loading=true]:hover:[&_svg]:text-(--button-outline-foreground) aria-expanded:bg-(--button-solid) aria-expanded:text-(--button-solid-foreground) aria-expanded:[&_svg]:text-(--button-solid-foreground)',\n subtle:\n 'bg-(--button-soft) text-(--button-soft-foreground) hover:bg-(--button-soft-hover) hover:text-(--button-soft-foreground) data-[loading=true]:hover:bg-(--button-soft) data-[loading=true]:hover:text-(--button-soft-foreground) aria-expanded:bg-(--button-soft-hover) aria-expanded:text-(--button-soft-foreground)',\n ghost:\n 'text-(--button-ghost-foreground) hover:bg-(--button-ghost-hover) hover:text-(--button-ghost-foreground) data-[loading=true]:hover:bg-transparent data-[loading=true]:hover:text-(--button-ghost-foreground) aria-expanded:bg-(--button-ghost-hover) aria-expanded:text-(--button-ghost-foreground)',\n link: 'text-(--button-link-foreground) underline-offset-4 hover:underline data-[loading=true]:hover:no-underline'\n },\n color: buttonColorVariants,\n size: {\n xs: \"h-7 gap-1 px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3\",\n sm: \"h-8 gap-1 px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5\",\n md: 'h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',\n lg: 'h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3',\n xl: 'h-11 gap-2 px-3 has-data-[icon=inline-end]:pr-4 has-data-[icon=inline-start]:pl-4',\n icon: 'size-9',\n 'icon-xs': \"size-7 in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3\",\n 'icon-sm': 'size-8 in-data-[slot=button-group]:rounded-lg',\n 'icon-lg': 'size-10',\n 'icon-xl': 'size-11'\n }\n },\n defaultVariants: {\n variant: 'solid',\n color: 'primary',\n size: 'md'\n }\n }\n)\n\nexport type ButtonProps = AsChildProps<'button'> &\n VariantProps<typeof buttonVariants> & {\n /**\n * Shows a spinner, disables the button and sets `aria-busy`.\n * @default false\n */\n loading?: boolean\n }\n\nfunction renderLoadingContent(children: React.ReactNode) {\n return (\n <>\n <span className=\"invisible inline-flex items-center gap-[inherit]\">{children}</span>\n <span className=\"absolute inset-0 inline-flex items-center justify-center\">\n <Spinner />\n </span>\n </>\n )\n}\n\nfunction Button({\n children,\n className,\n variant = 'solid',\n color = 'primary',\n size = 'md',\n asChild = false,\n disabled,\n loading = false,\n onClick,\n ...props\n}: ButtonProps) {\n const isDisabled = disabled || loading\n // A non-button child (e.g. a link) can't be natively disabled, so it gets `aria-disabled` and a\n // click guard instead.\n const isAriaDisabled = asChild && isDisabled\n\n let content = children\n if (loading && asChild) {\n const child = React.Children.only(children) as React.ReactElement<{ children?: React.ReactNode }>\n content = React.cloneElement(child, undefined, renderLoadingContent(child.props.children))\n } else if (loading) {\n content = renderLoadingContent(children)\n }\n\n return useAsChild('button', {\n asChild,\n type: !asChild ? 'button' : undefined,\n 'data-slot': 'button',\n 'data-variant': variant,\n 'data-color': color,\n 'data-size': size,\n 'data-loading': loading,\n 'aria-busy': loading ? true : undefined,\n 'aria-disabled': isAriaDisabled ? true : undefined,\n disabled: asChild ? undefined : isDisabled,\n onClick: isAriaDisabled ? (event: React.MouseEvent) => event.preventDefault() : onClick,\n className: cn(buttonVariants({ variant, color, size, className })),\n ...props,\n children: content\n })\n}\n\nexport { Button, buttonVariants }\n"],"mappings":"kWASA,MAAMC,EAAiBC,EACrB,w7BACA,CACE,SAAU,CACR,QAAS,CACP,MACE,qIACF,UACE,kLACF,QACE,wfACF,OACE,sTACF,MACE,qSACF,KAAM,2GACR,EACA,MAAOC,EACP,KAAM,CACJ,GAAI,2KACJ,GAAI,qLACJ,GAAI,8HACJ,GAAI,wFACJ,GAAI,oFACJ,KAAM,SACN,UAAW,qFACX,UAAW,gDACX,UAAW,UACX,UAAW,SACb,CACF,EACA,gBAAiB,CACf,QAAS,QACT,MAAO,UACP,KAAM,IACR,CACF,CACF,EAWA,SAAS,qBAAqB,EAA2B,CACvD,MACE,kBAAAC,EAAA,CAAA,SAAA,CACE,kBAAC,OAAD,CAAM,UAAU,mDAAoD,UAAe,CAAA,EACnF,kBAAC,OAAD,CAAM,UAAU,2DACd,SAAA,kBAACC,EAAD,CAAU,CAAA,CACN,CAAA,CACN,CAAA,CAAA,CAEN,CAEA,SAAS,OAAO,CACd,WACA,YACA,UAAU,QACV,QAAQ,UACR,OAAO,KACP,UAAU,GACV,WACA,UAAU,GACV,UACA,GAAGC,GACW,CACd,IAAMC,EAAaC,GAAYC,EAGzBC,EAAiBC,GAAWJ,EAE9BK,EAAUC,EACd,GAAIJ,GAAWE,EAAS,CACtB,IAAMG,EAAQd,EAAM,SAAS,KAAKa,CAAQ,EAC1C,EAAUb,EAAM,aAAac,EAAO,IAAA,GAAW,qBAAqBA,EAAM,MAAM,QAAQ,CAAC,CAC3F,MAAWL,IACT,EAAU,qBAAqBI,CAAQ,GAGzC,OAAOE,EAAW,SAAU,CAC1B,UACA,KAAOJ,EAAqB,IAAA,GAAX,SACjB,YAAa,SACb,eAAgBK,EAChB,aAAcC,EACd,YAAaC,EACb,eAAgBT,EAChB,YAAaA,EAAU,GAAO,IAAA,GAC9B,gBAAiBC,EAAiB,GAAO,IAAA,GACzC,SAAUC,EAAU,IAAA,GAAYJ,EAChC,QAASG,EAAkB,GAA4BS,EAAM,eAAe,EAAIC,EAChF,UAAWC,EAAGpB,EAAe,CAAE,UAAS,QAAO,OAAM,WAAU,CAAC,CAAC,EACjE,GAAGK,EACH,SAAUM,CACZ,CAAC,CACH"}
1
+ {"version":3,"file":"button.js","names":["React","buttonVariants","cva","buttonColorVariants","Fragment","Spinner","props","isDisabled","disabled","loading","isAriaDisabled","asChild","content","children","child","useAsChild","variant","color","size","event","onClick","cn"],"sources":["../../src/components/button.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nimport { type AsChildProps, useAsChild } from '../lib/as-child'\nimport { buttonColorVariants } from '../lib/button'\nimport { cn } from '../lib/utils'\nimport { Spinner } from './spinner'\n\nconst buttonVariants = cva(\n \"focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 relative rounded-full border border-transparent bg-clip-padding text-sm font-semibold focus-visible:ring-3 aria-invalid:ring-3 [&_svg:not([class*='size-'])]:size-4 inline-flex items-center justify-center whitespace-nowrap transition-all [&_svg]:transition-colors disabled:pointer-events-none disabled:opacity-50 disabled:data-[loading=true]:pointer-events-auto disabled:data-[loading=true]:cursor-not-allowed disabled:data-[loading=true]:opacity-100 aria-disabled:pointer-events-none aria-disabled:opacity-50 aria-disabled:data-[loading=true]:pointer-events-auto aria-disabled:data-[loading=true]:cursor-not-allowed aria-disabled:data-[loading=true]:opacity-100 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none\",\n {\n variants: {\n variant: {\n solid:\n 'bg-(--button-solid) text-(--button-solid-foreground) hover:bg-(--button-solid-hover) data-[loading=true]:hover:bg-(--button-solid)',\n secondary:\n 'border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50',\n outline:\n 'border-(--button-outline-border) bg-transparent text-(--button-outline-foreground) hover:bg-(--button-solid) hover:text-(--button-solid-foreground) hover:[&_svg]:text-(--button-solid-foreground) data-[loading=true]:hover:bg-transparent data-[loading=true]:hover:text-(--button-outline-foreground) data-[loading=true]:hover:[&_svg]:text-(--button-outline-foreground) aria-expanded:bg-(--button-solid) aria-expanded:text-(--button-solid-foreground) aria-expanded:[&_svg]:text-(--button-solid-foreground)',\n subtle:\n 'bg-(--button-soft) text-(--button-soft-foreground) hover:bg-(--button-soft-hover) hover:text-(--button-soft-foreground) data-[loading=true]:hover:bg-(--button-soft) data-[loading=true]:hover:text-(--button-soft-foreground) aria-expanded:bg-(--button-soft-hover) aria-expanded:text-(--button-soft-foreground)',\n ghost:\n 'text-(--button-ghost-foreground) hover:bg-(--button-ghost-hover) hover:text-(--button-ghost-foreground) data-[loading=true]:hover:bg-transparent data-[loading=true]:hover:text-(--button-ghost-foreground) aria-expanded:bg-(--button-ghost-hover) aria-expanded:text-(--button-ghost-foreground)',\n link: 'text-(--button-link-foreground) underline-offset-4 hover:underline data-[loading=true]:hover:no-underline'\n },\n color: buttonColorVariants,\n size: {\n xs: \"h-7 gap-1 px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3\",\n sm: \"h-8 gap-1 px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5\",\n md: 'h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',\n lg: 'h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3',\n xl: 'h-11 gap-2 px-3 has-data-[icon=inline-end]:pr-4 has-data-[icon=inline-start]:pl-4',\n icon: 'size-9',\n 'icon-xs': \"size-7 in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3\",\n 'icon-sm': 'size-8 in-data-[slot=button-group]:rounded-lg',\n 'icon-lg': 'size-10',\n 'icon-xl': 'size-11'\n }\n },\n defaultVariants: {\n variant: 'solid',\n color: 'primary',\n size: 'md'\n }\n }\n)\n\nexport type ButtonProps = AsChildProps<'button'> &\n VariantProps<typeof buttonVariants> & {\n /**\n * Shows a spinner, disables the button and sets `aria-busy`.\n * @default false\n */\n loading?: boolean\n }\n\nfunction renderLoadingContent(children: React.ReactNode) {\n return (\n <>\n <span className=\"invisible inline-flex items-center gap-[inherit]\">{children}</span>\n <span className=\"absolute inset-0 inline-flex items-center justify-center\">\n <Spinner />\n </span>\n </>\n )\n}\n\nfunction Button({\n children,\n className,\n variant = 'solid',\n color = 'primary',\n size = 'md',\n asChild = false,\n disabled,\n loading = false,\n onClick,\n ...props\n}: ButtonProps) {\n const isDisabled = disabled || loading\n // A non-button child (e.g. a link) can't be natively disabled, so it gets `aria-disabled` and a\n // click guard instead.\n const isAriaDisabled = asChild && isDisabled\n\n let content = children\n if (loading && asChild) {\n const child = React.Children.only(children) as React.ReactElement<{ children?: React.ReactNode }>\n content = React.cloneElement(child, undefined, renderLoadingContent(child.props.children))\n } else if (loading) {\n content = renderLoadingContent(children)\n }\n\n return useAsChild('button', {\n asChild,\n type: !asChild ? 'button' : undefined,\n 'data-slot': 'button',\n 'data-variant': variant,\n 'data-color': color,\n 'data-size': size,\n 'data-loading': loading,\n 'aria-busy': loading ? true : undefined,\n 'aria-disabled': isAriaDisabled ? true : undefined,\n disabled: asChild ? undefined : isDisabled,\n onClick: isAriaDisabled ? (event: React.MouseEvent) => event.preventDefault() : onClick,\n className: cn(buttonVariants({ variant, color, size, className })),\n ...props,\n children: content\n })\n}\n\nexport { Button, buttonVariants }\n"],"mappings":"A,kWASA,MAAMC,EAAiBC,EACrB,w7BACA,CACE,SAAU,CACR,QAAS,CACP,MACE,qIACF,UACE,kLACF,QACE,wfACF,OACE,sTACF,MACE,qSACF,KAAM,2GACR,EACA,MAAOC,EACP,KAAM,CACJ,GAAI,2KACJ,GAAI,qLACJ,GAAI,8HACJ,GAAI,wFACJ,GAAI,oFACJ,KAAM,SACN,UAAW,qFACX,UAAW,gDACX,UAAW,UACX,UAAW,SACb,CACF,EACA,gBAAiB,CACf,QAAS,QACT,MAAO,UACP,KAAM,IACR,CACF,CACF,EAWA,SAAS,qBAAqB,EAA2B,CACvD,MACE,kBAAAC,EAAA,CAAA,SAAA,CACE,kBAAC,OAAD,CAAM,UAAU,mDAAoD,UAAe,CAAA,EACnF,kBAAC,OAAD,CAAM,UAAU,2DACd,SAAA,kBAACC,EAAD,CAAU,CAAA,CACN,CAAA,CACN,CAAA,CAAA,CAEN,CAEA,SAAS,OAAO,CACd,WACA,YACA,UAAU,QACV,QAAQ,UACR,OAAO,KACP,UAAU,GACV,WACA,UAAU,GACV,UACA,GAAGC,GACW,CACd,IAAMC,EAAaC,GAAYC,EAGzBC,EAAiBC,GAAWJ,EAE9BK,EAAUC,EACd,GAAIJ,GAAWE,EAAS,CACtB,IAAMG,EAAQd,EAAM,SAAS,KAAKa,CAAQ,EAC1C,EAAUb,EAAM,aAAac,EAAO,IAAA,GAAW,qBAAqBA,EAAM,MAAM,QAAQ,CAAC,CAC3F,MAAWL,IACT,EAAU,qBAAqBI,CAAQ,GAGzC,OAAOE,EAAW,SAAU,CAC1B,UACA,KAAOJ,EAAqB,IAAA,GAAX,SACjB,YAAa,SACb,eAAgBK,EAChB,aAAcC,EACd,YAAaC,EACb,eAAgBT,EAChB,YAAaA,EAAU,GAAO,IAAA,GAC9B,gBAAiBC,EAAiB,GAAO,IAAA,GACzC,SAAUC,EAAU,IAAA,GAAYJ,EAChC,QAASG,EAAkB,GAA4BS,EAAM,eAAe,EAAIC,EAChF,UAAWC,EAAGpB,EAAe,CAAE,UAAS,QAAO,OAAM,WAAU,CAAC,CAAC,EACjE,GAAGK,EACH,SAAUM,CACZ,CAAC,CACH,C"}
@@ -3,7 +3,6 @@ import { Button } from "./button.js";
3
3
  import * as React from "react";
4
4
  import { DateRange, DayButton, DayPicker, Locale } from "react-day-picker";
5
5
  import * as locale from "react-day-picker/locale";
6
- //#region src/components/calendar.d.ts
7
6
  export type CalendarProps = React.ComponentProps<typeof DayPicker> & {
8
7
  /**
9
8
  * `Button` variant of the previous/next month buttons.
@@ -16,6 +15,5 @@ export type CalendarDayButtonProps = Omit<React.ComponentProps<typeof DayButton>
16
15
  };
17
16
  declare function Calendar({ className, classNames, showOutsideDays, captionLayout, buttonVariant, locale, formatters, components, ...props }: CalendarProps): React.JSX.Element;
18
17
  declare function CalendarDayButton({ className, day, modifiers, locale, ...props }: CalendarDayButtonProps): React.JSX.Element;
19
- //#endregion
20
18
  export { Calendar, CalendarDayButton, type DateRange, locale };
21
19
  //# sourceMappingURL=calendar.d.ts.map
@@ -1,2 +1,2 @@
1
- import"../rolldown-runtime-BhWHdk3m.js";import{cn as e}from"../lib/utils.js";import{Button as t,buttonVariants as n}from"./button.js";import{IconChevronDown as r,IconChevronLeft as i,IconChevronRight as a}from"@tabler/icons-react";import*as o from"react";import{jsx as s}from"react/jsx-runtime";import{DayPicker as c,getDefaultClassNames as l}from"react-day-picker";import*as u from"react-day-picker/locale";function Calendar({className:t,classNames:o,showOutsideDays:u=!0,captionLayout:d=`label`,buttonVariant:f=`ghost`,locale:p,formatters:m,components:h,...g}){let _=l();return/* @__PURE__ */ s(c,{showOutsideDays:u,className:e(`group/calendar bg-background p-2 [--cell-radius:var(--radius-md)] [--cell-size:--spacing(7)] in-data-[slot=card-content]:bg-transparent in-data-[slot=popover-content]:bg-transparent`,String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,t),captionLayout:d,locale:p,formatters:{formatMonthDropdown:e=>e.toLocaleString(p?.code,{month:`short`}),...m},classNames:{root:e(`w-fit`,_.root),months:e(`relative flex gap-4`,_.months),month:e(`flex w-full flex-col gap-4`,_.month),nav:e(`absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1`,_.nav),button_previous:e(n({variant:f}),`size-(--cell-size) p-0 select-none aria-disabled:opacity-50`,_.button_previous),button_next:e(n({variant:f}),`size-(--cell-size) p-0 select-none aria-disabled:opacity-50`,_.button_next),month_caption:e(`flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)`,_.month_caption),dropdowns:e(`flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium`,_.dropdowns),dropdown_root:e(`relative rounded-(--cell-radius)`,_.dropdown_root),dropdown:e(`absolute inset-0 bg-popover opacity-0`,_.dropdown),caption_label:e(`font-medium select-none`,d===`label`?`text-sm`:`flex items-center gap-1 rounded-(--cell-radius) text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground`,_.caption_label),month_grid:`w-full border-collapse`,weekdays:e(`flex`,_.weekdays),weekday:e(`flex-1 rounded-(--cell-radius) text-[0.8rem] font-normal text-muted-foreground select-none`,_.weekday),week:e(`mt-2 flex w-full`,_.week),week_number_header:e(`w-(--cell-size) text-xs font-normal text-muted-foreground select-none`,_.week_number_header),week_number:e(`text-xs font-normal tabular-nums text-muted-foreground select-none`,_.week_number),day:e(`group/day relative aspect-square h-full w-full rounded-(--cell-radius) p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-r-(--cell-radius)`,g.showWeekNumber?`[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)`:`[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)`,_.day),range_start:e(`relative isolate z-0 rounded-l-(--cell-radius) bg-primary-50 after:absolute after:inset-y-0 after:right-0 after:w-4 after:bg-primary-50 dark:bg-primary-950 dark:after:bg-primary-950`,_.range_start),range_middle:e(`rounded-none`,_.range_middle),range_end:e(`relative isolate z-0 rounded-r-(--cell-radius) bg-primary-50 after:absolute after:inset-y-0 after:left-0 after:w-4 after:bg-primary-50 dark:bg-primary-950 dark:after:bg-primary-950`,_.range_end),today:e(`rounded-(--cell-radius) bg-muted text-foreground data-[selected=true]:rounded-none`,_.today),outside:e(`text-muted-foreground aria-selected:text-muted-foreground`,_.outside),disabled:e(`text-muted-foreground opacity-50`,_.disabled),hidden:e(`invisible`,_.hidden),...o},components:{Root:({className:t,rootRef:n,...r})=>/* @__PURE__ */ s(`div`,{"data-slot":`calendar`,ref:n,className:e(t),...r}),Chevron:({className:t,orientation:n,...o})=>s(n===`left`?i:n===`right`?a:r,{className:e(`size-4`,t),...o}),DayButton:({...e})=>/* @__PURE__ */ s(CalendarDayButton,{locale:p,...e}),WeekNumber:({children:e,...t})=>/* @__PURE__ */ s(`td`,{...t,children:/* @__PURE__ */ s(`div`,{className:`flex size-(--cell-size) items-center justify-center text-center text-xs font-normal tabular-nums`,children:e})}),...h},...g})}function CalendarDayButton({className:n,day:r,modifiers:i,locale:a,...c}){let u=l(),d=r.date.getDay()===0||r.date.getDay()===6,f=o.useRef(null);return o.useEffect(()=>{i.focused&&f.current?.focus()},[i.focused]),/* @__PURE__ */ s(t,{ref:f,variant:`ghost`,size:`icon`,color:`zinc`,"data-day":r.date.toLocaleDateString(a?.code),"data-weekend":d,"data-selected-single":i.selected&&!i.range_start&&!i.range_end&&!i.range_middle,"data-range-start":i.range_start,"data-range-end":i.range_end,"data-range-middle":i.range_middle,className:e(`relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 border-0 text-foreground leading-none font-normal`,`hover:bg-primary-50 hover:text-foreground dark:hover:bg-primary-950 dark:hover:text-foreground`,`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-[3px] group-data-[focused=true]/day:ring-ring/50`,`data-[weekend=true]:text-destructive data-[weekend=true]:hover:bg-red-50 data-[weekend=true]:hover:text-destructive dark:data-[weekend=true]:hover:bg-red-950`,`data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-primary-50 data-[range-middle=true]:text-foreground data-[range-middle=true]:hover:bg-primary-50 data-[range-middle=true]:hover:text-foreground dark:data-[range-middle=true]:bg-primary-950 dark:data-[range-middle=true]:hover:bg-primary-950`,`data-[range-middle=true]:data-[weekend=true]:text-destructive data-[range-middle=true]:data-[weekend=true]:hover:bg-red-50 data-[range-middle=true]:data-[weekend=true]:hover:text-destructive dark:data-[range-middle=true]:data-[weekend=true]:hover:bg-red-950`,`data-[range-end=true]:rounded-(--cell-radius) data-[range-end=true]:rounded-r-(--cell-radius) data-[range-end=true]:bg-primary-500 data-[range-end=true]:text-white data-[range-end=true]:hover:bg-primary-500 data-[range-end=true]:hover:text-white dark:data-[range-end=true]:hover:bg-primary-500`,`data-[range-end=true]:data-[weekend=true]:text-white data-[range-end=true]:data-[weekend=true]:hover:text-white`,`data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-l-(--cell-radius) data-[range-start=true]:bg-primary-500 data-[range-start=true]:text-white data-[range-start=true]:hover:bg-primary-500 data-[range-start=true]:hover:text-white dark:data-[range-start=true]:hover:bg-primary-500`,`data-[range-start=true]:data-[weekend=true]:text-white data-[range-start=true]:data-[weekend=true]:hover:text-white`,`data-[selected-single=true]:bg-primary-500 data-[selected-single=true]:text-white data-[selected-single=true]:hover:bg-primary-500 data-[selected-single=true]:hover:text-white dark:data-[selected-single=true]:hover:bg-primary-500`,`data-[selected-single=true]:data-[weekend=true]:text-white data-[selected-single=true]:data-[weekend=true]:hover:text-white`,`[&>span]:text-xs [&>span]:opacity-70`,u.day,n),...c})}export{Calendar,CalendarDayButton,u as locale};
1
+ import"../rolldown-runtime-BhWHdk3m.js";import{cn as e}from"../lib/utils.js";import{Button as t,buttonVariants as n}from"./button.js";import{IconChevronDown as r,IconChevronLeft as i,IconChevronRight as a}from"@tabler/icons-react";import*as o from"react";import{jsx as s}from"react/jsx-runtime";import{DayPicker as c,getDefaultClassNames as l,useDayPicker as u}from"react-day-picker";import*as d from"react-day-picker/locale";function Calendar({className:t,classNames:r,showOutsideDays:i=!0,captionLayout:a=`label`,buttonVariant:o=`ghost`,locale:u,formatters:d,components:f,...p}){let m=l();return/* @__PURE__ */ s(c,{showOutsideDays:i,className:e(`group/calendar bg-background p-2 [--cell-radius:var(--radius-md)] [--cell-size:--spacing(7)] in-data-[slot=card-content]:bg-transparent in-data-[slot=popover-content]:bg-transparent`,String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,t),captionLayout:a,locale:u,formatters:{formatMonthDropdown:e=>e.toLocaleString(u?.code,{month:`short`}),...d},classNames:{root:e(`w-fit`,m.root),months:e(`relative flex gap-4`,m.months),month:e(`flex w-full flex-col gap-4`,m.month),nav:e(`absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1`,m.nav),button_previous:e(n({variant:o}),`size-(--cell-size) p-0 select-none aria-disabled:opacity-50`,m.button_previous),button_next:e(n({variant:o}),`size-(--cell-size) p-0 select-none aria-disabled:opacity-50`,m.button_next),month_caption:e(`flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)`,m.month_caption),dropdowns:e(`flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium`,m.dropdowns),dropdown_root:e(`relative rounded-(--cell-radius)`,m.dropdown_root),dropdown:e(`absolute inset-0 bg-popover opacity-0`,m.dropdown),caption_label:e(`font-medium select-none`,a===`label`?`text-sm`:`flex items-center gap-1 rounded-(--cell-radius) text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground`,m.caption_label),month_grid:`w-full border-collapse`,weekdays:e(`flex`,m.weekdays),weekday:e(`flex-1 rounded-(--cell-radius) text-[0.8rem] font-normal text-muted-foreground select-none`,m.weekday),week:e(`mt-2 flex w-full`,m.week),week_number_header:e(`w-(--cell-size) text-xs font-normal text-muted-foreground select-none`,m.week_number_header),week_number:e(`text-xs font-normal tabular-nums text-muted-foreground select-none`,m.week_number),day:e(`group/day relative aspect-square h-full w-full rounded-(--cell-radius) p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-r-(--cell-radius)`,p.showWeekNumber?`[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)`:`[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)`,m.day),range_start:e(`relative isolate z-0 rounded-l-(--cell-radius) bg-primary-50 after:absolute after:inset-y-0 after:right-0 after:w-4 after:bg-primary-50 dark:bg-primary-950 dark:after:bg-primary-950`,m.range_start),range_middle:e(`rounded-none`,m.range_middle),range_end:e(`relative isolate z-0 rounded-r-(--cell-radius) bg-primary-50 after:absolute after:inset-y-0 after:left-0 after:w-4 after:bg-primary-50 dark:bg-primary-950 dark:after:bg-primary-950`,m.range_end),today:e(`rounded-(--cell-radius) bg-muted text-foreground data-[selected=true]:rounded-none`,m.today),outside:e(`text-muted-foreground aria-selected:text-muted-foreground`,m.outside),disabled:e(`text-muted-foreground opacity-50`,m.disabled),hidden:e(`invisible`,m.hidden),...r},components:{Root:CalendarRoot,Chevron:CalendarChevron,DayButton:CalendarDayButtonSlot,WeekNumber:CalendarWeekNumber,...f},...p})}function CalendarRoot({className:t,rootRef:n,...r}){return/* @__PURE__ */ s(`div`,{"data-slot":`calendar`,ref:n,className:e(t),...r})}function CalendarChevron({className:t,orientation:n,...o}){return s(n===`left`?i:n===`right`?a:r,{className:e(`size-4`,t),...o})}function CalendarDayButtonSlot(e){let{dayPickerProps:t}=u();return/* @__PURE__ */ s(CalendarDayButton,{locale:t.locale,...e})}function CalendarWeekNumber({children:e,...t}){return/* @__PURE__ */ s(`td`,{...t,children:/* @__PURE__ */ s(`div`,{className:`flex size-(--cell-size) items-center justify-center text-center text-xs font-normal tabular-nums`,children:e})})}function CalendarDayButton({className:n,day:r,modifiers:i,locale:a,...c}){let u=l(),d=r.date.getDay()===0||r.date.getDay()===6,f=o.useRef(null);return o.useEffect(()=>{i.focused&&f.current?.focus()},[i.focused]),/* @__PURE__ */ s(t,{ref:f,variant:`ghost`,size:`icon`,color:`zinc`,"data-day":r.date.toLocaleDateString(a?.code),"data-weekend":d,"data-selected-single":i.selected&&!i.range_start&&!i.range_end&&!i.range_middle,"data-range-start":i.range_start,"data-range-end":i.range_end,"data-range-middle":i.range_middle,className:e(`relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 border-0 text-foreground leading-none font-normal`,`hover:bg-primary-50 hover:text-foreground dark:hover:bg-primary-950 dark:hover:text-foreground`,`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-[3px] group-data-[focused=true]/day:ring-ring/50`,`data-[weekend=true]:text-destructive data-[weekend=true]:hover:bg-red-50 data-[weekend=true]:hover:text-destructive dark:data-[weekend=true]:hover:bg-red-950`,`data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-primary-50 data-[range-middle=true]:text-foreground data-[range-middle=true]:hover:bg-primary-50 data-[range-middle=true]:hover:text-foreground dark:data-[range-middle=true]:bg-primary-950 dark:data-[range-middle=true]:hover:bg-primary-950`,`data-[range-middle=true]:data-[weekend=true]:text-destructive data-[range-middle=true]:data-[weekend=true]:hover:bg-red-50 data-[range-middle=true]:data-[weekend=true]:hover:text-destructive dark:data-[range-middle=true]:data-[weekend=true]:hover:bg-red-950`,`data-[range-end=true]:rounded-(--cell-radius) data-[range-end=true]:rounded-r-(--cell-radius) data-[range-end=true]:bg-primary-500 data-[range-end=true]:text-white data-[range-end=true]:hover:bg-primary-500 data-[range-end=true]:hover:text-white dark:data-[range-end=true]:hover:bg-primary-500`,`data-[range-end=true]:data-[weekend=true]:text-white data-[range-end=true]:data-[weekend=true]:hover:text-white`,`data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-l-(--cell-radius) data-[range-start=true]:bg-primary-500 data-[range-start=true]:text-white data-[range-start=true]:hover:bg-primary-500 data-[range-start=true]:hover:text-white dark:data-[range-start=true]:hover:bg-primary-500`,`data-[range-start=true]:data-[weekend=true]:text-white data-[range-start=true]:data-[weekend=true]:hover:text-white`,`data-[selected-single=true]:bg-primary-500 data-[selected-single=true]:text-white data-[selected-single=true]:hover:bg-primary-500 data-[selected-single=true]:hover:text-white dark:data-[selected-single=true]:hover:bg-primary-500`,`data-[selected-single=true]:data-[weekend=true]:text-white data-[selected-single=true]:data-[weekend=true]:hover:text-white`,`[&>span]:text-xs [&>span]:opacity-70`,u.day,n),...c})}export{Calendar,CalendarDayButton,d as locale};
2
2
  //# sourceMappingURL=calendar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"calendar.js","names":["React","locale","props","defaultClassNames","getDefaultClassNames","DayPicker","cn","className","date","formatters","buttonVariants","buttonVariant","captionLayout","classNames","rootRef","jsx","orientation","IconChevronLeft","IconChevronRight","IconChevronDown","components","isWeekend","day","ref","modifiers","Button"],"sources":["../../src/components/calendar.tsx"],"sourcesContent":["import * as React from 'react'\nimport { type DateRange, type DayButton, DayPicker, getDefaultClassNames, type Locale } from 'react-day-picker'\nimport * as locale from 'react-day-picker/locale'\n\nimport { IconChevronDown, IconChevronLeft, IconChevronRight } from '@tabler/icons-react'\n\nimport { cn } from '../lib/utils'\nimport { Button, buttonVariants } from './button'\n\nexport type CalendarProps = React.ComponentProps<typeof DayPicker> & {\n /**\n * `Button` variant of the previous/next month buttons.\n * @default 'ghost'\n */\n buttonVariant?: React.ComponentProps<typeof Button>['variant']\n}\n\nexport type CalendarDayButtonProps = Omit<React.ComponentProps<typeof DayButton>, 'color'> & {\n locale?: Partial<Locale>\n}\n\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n captionLayout = 'label',\n buttonVariant = 'ghost',\n locale,\n formatters,\n components,\n ...props\n}: CalendarProps) {\n const defaultClassNames = getDefaultClassNames()\n\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n className={cn(\n 'group/calendar bg-background p-2 [--cell-radius:var(--radius-md)] [--cell-size:--spacing(7)] in-data-[slot=card-content]:bg-transparent in-data-[slot=popover-content]:bg-transparent',\n String.raw`rtl:**:[.rdp-button\\_next>svg]:rotate-180`,\n String.raw`rtl:**:[.rdp-button\\_previous>svg]:rotate-180`,\n className\n )}\n captionLayout={captionLayout}\n locale={locale}\n formatters={{\n formatMonthDropdown: (date) => date.toLocaleString(locale?.code, { month: 'short' }),\n ...formatters\n }}\n classNames={{\n root: cn('w-fit', defaultClassNames.root),\n months: cn('relative flex gap-4', defaultClassNames.months),\n month: cn('flex w-full flex-col gap-4', defaultClassNames.month),\n nav: cn('absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1', defaultClassNames.nav),\n button_previous: cn(\n buttonVariants({ variant: buttonVariant }),\n 'size-(--cell-size) p-0 select-none aria-disabled:opacity-50',\n defaultClassNames.button_previous\n ),\n button_next: cn(\n buttonVariants({ variant: buttonVariant }),\n 'size-(--cell-size) p-0 select-none aria-disabled:opacity-50',\n defaultClassNames.button_next\n ),\n month_caption: cn(\n 'flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)',\n defaultClassNames.month_caption\n ),\n dropdowns: cn(\n 'flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium',\n defaultClassNames.dropdowns\n ),\n dropdown_root: cn('relative rounded-(--cell-radius)', defaultClassNames.dropdown_root),\n dropdown: cn('absolute inset-0 bg-popover opacity-0', defaultClassNames.dropdown),\n caption_label: cn(\n 'font-medium select-none',\n captionLayout === 'label'\n ? 'text-sm'\n : 'flex items-center gap-1 rounded-(--cell-radius) text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground',\n defaultClassNames.caption_label\n ),\n month_grid: 'w-full border-collapse',\n weekdays: cn('flex', defaultClassNames.weekdays),\n weekday: cn(\n 'flex-1 rounded-(--cell-radius) text-[0.8rem] font-normal text-muted-foreground select-none',\n defaultClassNames.weekday\n ),\n week: cn('mt-2 flex w-full', defaultClassNames.week),\n week_number_header: cn(\n 'w-(--cell-size) text-xs font-normal text-muted-foreground select-none',\n defaultClassNames.week_number_header\n ),\n week_number: cn(\n 'text-xs font-normal tabular-nums text-muted-foreground select-none',\n defaultClassNames.week_number\n ),\n day: cn(\n 'group/day relative aspect-square h-full w-full rounded-(--cell-radius) p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-r-(--cell-radius)',\n props.showWeekNumber\n ? '[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)'\n : '[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)',\n defaultClassNames.day\n ),\n range_start: cn(\n 'relative isolate z-0 rounded-l-(--cell-radius) bg-primary-50 after:absolute after:inset-y-0 after:right-0 after:w-4 after:bg-primary-50 dark:bg-primary-950 dark:after:bg-primary-950',\n defaultClassNames.range_start\n ),\n range_middle: cn('rounded-none', defaultClassNames.range_middle),\n range_end: cn(\n 'relative isolate z-0 rounded-r-(--cell-radius) bg-primary-50 after:absolute after:inset-y-0 after:left-0 after:w-4 after:bg-primary-50 dark:bg-primary-950 dark:after:bg-primary-950',\n defaultClassNames.range_end\n ),\n today: cn(\n 'rounded-(--cell-radius) bg-muted text-foreground data-[selected=true]:rounded-none',\n defaultClassNames.today\n ),\n outside: cn('text-muted-foreground aria-selected:text-muted-foreground', defaultClassNames.outside),\n disabled: cn('text-muted-foreground opacity-50', defaultClassNames.disabled),\n hidden: cn('invisible', defaultClassNames.hidden),\n ...classNames\n }}\n components={{\n Root: ({ className, rootRef, ...props }) => {\n return (\n <div data-slot=\"calendar\" ref={rootRef as React.Ref<HTMLDivElement>} className={cn(className)} {...props} />\n )\n },\n Chevron: ({ className, orientation, ...props }) => {\n if (orientation === 'left') {\n return <IconChevronLeft className={cn('size-4', className)} {...props} />\n }\n\n if (orientation === 'right') {\n return <IconChevronRight className={cn('size-4', className)} {...props} />\n }\n\n return <IconChevronDown className={cn('size-4', className)} {...props} />\n },\n DayButton: ({ ...props }) => <CalendarDayButton locale={locale} {...props} />,\n WeekNumber: ({ children, ...props }) => {\n return (\n <td {...props}>\n <div className=\"flex size-(--cell-size) items-center justify-center text-center text-xs font-normal tabular-nums\">\n {children}\n </div>\n </td>\n )\n },\n ...components\n }}\n {...props}\n />\n )\n}\n\nfunction CalendarDayButton({ className, day, modifiers, locale, ...props }: CalendarDayButtonProps) {\n const defaultClassNames = getDefaultClassNames()\n const isWeekend = day.date.getDay() === 0 || day.date.getDay() === 6\n\n const ref = React.useRef<HTMLButtonElement>(null)\n React.useEffect(() => {\n if (modifiers.focused) ref.current?.focus()\n }, [modifiers.focused])\n\n return (\n <Button\n ref={ref}\n variant=\"ghost\"\n size=\"icon\"\n color=\"zinc\"\n data-day={day.date.toLocaleDateString(locale?.code)}\n data-weekend={isWeekend}\n data-selected-single={\n modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle\n }\n data-range-start={modifiers.range_start}\n data-range-end={modifiers.range_end}\n data-range-middle={modifiers.range_middle}\n className={cn(\n 'relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 border-0 text-foreground leading-none font-normal',\n 'hover:bg-primary-50 hover:text-foreground dark:hover:bg-primary-950 dark:hover:text-foreground',\n '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-[3px] group-data-[focused=true]/day:ring-ring/50',\n 'data-[weekend=true]:text-destructive data-[weekend=true]:hover:bg-red-50 data-[weekend=true]:hover:text-destructive dark:data-[weekend=true]:hover:bg-red-950',\n 'data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-primary-50 data-[range-middle=true]:text-foreground data-[range-middle=true]:hover:bg-primary-50 data-[range-middle=true]:hover:text-foreground dark:data-[range-middle=true]:bg-primary-950 dark:data-[range-middle=true]:hover:bg-primary-950',\n 'data-[range-middle=true]:data-[weekend=true]:text-destructive data-[range-middle=true]:data-[weekend=true]:hover:bg-red-50 data-[range-middle=true]:data-[weekend=true]:hover:text-destructive dark:data-[range-middle=true]:data-[weekend=true]:hover:bg-red-950',\n 'data-[range-end=true]:rounded-(--cell-radius) data-[range-end=true]:rounded-r-(--cell-radius) data-[range-end=true]:bg-primary-500 data-[range-end=true]:text-white data-[range-end=true]:hover:bg-primary-500 data-[range-end=true]:hover:text-white dark:data-[range-end=true]:hover:bg-primary-500',\n 'data-[range-end=true]:data-[weekend=true]:text-white data-[range-end=true]:data-[weekend=true]:hover:text-white',\n 'data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-l-(--cell-radius) data-[range-start=true]:bg-primary-500 data-[range-start=true]:text-white data-[range-start=true]:hover:bg-primary-500 data-[range-start=true]:hover:text-white dark:data-[range-start=true]:hover:bg-primary-500',\n 'data-[range-start=true]:data-[weekend=true]:text-white data-[range-start=true]:data-[weekend=true]:hover:text-white',\n 'data-[selected-single=true]:bg-primary-500 data-[selected-single=true]:text-white data-[selected-single=true]:hover:bg-primary-500 data-[selected-single=true]:hover:text-white dark:data-[selected-single=true]:hover:bg-primary-500',\n 'data-[selected-single=true]:data-[weekend=true]:text-white data-[selected-single=true]:data-[weekend=true]:hover:text-white',\n '[&>span]:text-xs [&>span]:opacity-70',\n defaultClassNames.day,\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Calendar, CalendarDayButton, type DateRange, locale }\n"],"mappings":"wZAqBA,SAAS,SAAS,CAChB,YACA,aACA,kBAAkB,GAClB,gBAAgB,QAChB,gBAAgB,QAChB,SACA,aACA,aACA,GAAGE,GACa,CAChB,IAAMC,EAAoBC,EAAqB,EAE/C,MACE,kBAACC,EAAD,CACmB,kBACjB,UAAWC,EACT,wLACA,OAAO,GAAG,4CACV,OAAO,GAAG,gDACVC,CACF,EACe,gBACP,SACR,WAAY,CACV,oBAAsB,GAASC,EAAK,eAAeP,GAAQ,KAAM,CAAE,MAAO,OAAQ,CAAC,EACnF,GAAGQ,CACL,EACA,WAAY,CACV,KAAMH,EAAG,QAASH,EAAkB,IAAI,EACxC,OAAQG,EAAG,sBAAuBH,EAAkB,MAAM,EAC1D,MAAOG,EAAG,6BAA8BH,EAAkB,KAAK,EAC/D,IAAKG,EAAG,0EAA2EH,EAAkB,GAAG,EACxG,gBAAiBG,EACfI,EAAe,CAAE,QAASC,CAAc,CAAC,EACzC,8DACAR,EAAkB,eACpB,EACA,YAAaG,EACXI,EAAe,CAAE,QAASC,CAAc,CAAC,EACzC,8DACAR,EAAkB,WACpB,EACA,cAAeG,EACb,2EACAH,EAAkB,aACpB,EACA,UAAWG,EACT,sFACAH,EAAkB,SACpB,EACA,cAAeG,EAAG,mCAAoCH,EAAkB,aAAa,EACrF,SAAUG,EAAG,wCAAyCH,EAAkB,QAAQ,EAChF,cAAeG,EACb,0BACAM,IAAkB,QACd,UACA,yGACJT,EAAkB,aACpB,EACA,WAAY,yBACZ,SAAUG,EAAG,OAAQH,EAAkB,QAAQ,EAC/C,QAASG,EACP,6FACAH,E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C,EAAMvB,EAAM,OAA0B,IAAI,EAKhD,OAJAA,EAAM,cAAgB,CAChBwB,EAAU,SAASD,EAAI,SAAS,MAAM,CAC5C,EAAG,CAACC,EAAU,OAAO,CAAC,EAGpB,kBAACC,EAAD,CACO,MACL,QAAQ,QACR,KAAK,OACL,MAAM,OACN,WAAUH,EAAI,KAAK,mBAAmBrB,GAAQ,IAAI,EAClD,eAAcoB,EACd,uBACEG,EAAU,UAAY,CAACA,EAAU,aAAe,CAACA,EAAU,WAAa,CAACA,EAAU,aAErF,mBAAkBA,EAAU,YAC5B,iBAAgBA,EAAU,UAC1B,oBAAmBA,EAAU,aAC7B,UAAWlB,EACT,iJACA,iGACA,0MACA,gKACA,oTACA,oQACA,wSACA,kHACA,sTACA,sHACA,wOACA,8HACA,uCACAH,EAAkB,IAClBI,CACF,EACA,GAAIL,CACL,CAAA,CAEL"}
1
+ {"version":3,"file":"calendar.js","names":["React","locale","props","defaultClassNames","getDefaultClassNames","DayPicker","cn","className","date","formatters","buttonVariants","buttonVariant","captionLayout","classNames","components","rootRef","jsx","orientation","IconChevronLeft","IconChevronRight","IconChevronDown","useDayPicker","dayPickerProps","isWeekend","day","ref","modifiers","Button"],"sources":["../../src/components/calendar.tsx"],"sourcesContent":["import * as React from 'react'\nimport {\n type DateRange,\n type DayButton,\n DayPicker,\n type Chevron as DayPickerChevron,\n type Root as DayPickerRoot,\n type WeekNumber as DayPickerWeekNumber,\n getDefaultClassNames,\n type Locale,\n useDayPicker\n} from 'react-day-picker'\nimport * as locale from 'react-day-picker/locale'\n\nimport { IconChevronDown, IconChevronLeft, IconChevronRight } from '@tabler/icons-react'\n\nimport { cn } from '../lib/utils'\nimport { Button, buttonVariants } from './button'\n\nexport type CalendarProps = React.ComponentProps<typeof DayPicker> & {\n /**\n * `Button` variant of the previous/next month buttons.\n * @default 'ghost'\n */\n buttonVariant?: React.ComponentProps<typeof Button>['variant']\n}\n\nexport type CalendarDayButtonProps = Omit<React.ComponentProps<typeof DayButton>, 'color'> & {\n locale?: Partial<Locale>\n}\n\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n captionLayout = 'label',\n buttonVariant = 'ghost',\n locale,\n formatters,\n components,\n ...props\n}: CalendarProps) {\n const defaultClassNames = getDefaultClassNames()\n\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n className={cn(\n 'group/calendar bg-background p-2 [--cell-radius:var(--radius-md)] [--cell-size:--spacing(7)] in-data-[slot=card-content]:bg-transparent in-data-[slot=popover-content]:bg-transparent',\n String.raw`rtl:**:[.rdp-button\\_next>svg]:rotate-180`,\n String.raw`rtl:**:[.rdp-button\\_previous>svg]:rotate-180`,\n className\n )}\n captionLayout={captionLayout}\n locale={locale}\n formatters={{\n formatMonthDropdown: (date) => date.toLocaleString(locale?.code, { month: 'short' }),\n ...formatters\n }}\n classNames={{\n root: cn('w-fit', defaultClassNames.root),\n months: cn('relative flex gap-4', defaultClassNames.months),\n month: cn('flex w-full flex-col gap-4', defaultClassNames.month),\n nav: cn('absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1', defaultClassNames.nav),\n button_previous: cn(\n buttonVariants({ variant: buttonVariant }),\n 'size-(--cell-size) p-0 select-none aria-disabled:opacity-50',\n defaultClassNames.button_previous\n ),\n button_next: cn(\n buttonVariants({ variant: buttonVariant }),\n 'size-(--cell-size) p-0 select-none aria-disabled:opacity-50',\n defaultClassNames.button_next\n ),\n month_caption: cn(\n 'flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)',\n defaultClassNames.month_caption\n ),\n dropdowns: cn(\n 'flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium',\n defaultClassNames.dropdowns\n ),\n dropdown_root: cn('relative rounded-(--cell-radius)', defaultClassNames.dropdown_root),\n dropdown: cn('absolute inset-0 bg-popover opacity-0', defaultClassNames.dropdown),\n caption_label: cn(\n 'font-medium select-none',\n captionLayout === 'label'\n ? 'text-sm'\n : 'flex items-center gap-1 rounded-(--cell-radius) text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground',\n defaultClassNames.caption_label\n ),\n month_grid: 'w-full border-collapse',\n weekdays: cn('flex', defaultClassNames.weekdays),\n weekday: cn(\n 'flex-1 rounded-(--cell-radius) text-[0.8rem] font-normal text-muted-foreground select-none',\n defaultClassNames.weekday\n ),\n week: cn('mt-2 flex w-full', defaultClassNames.week),\n week_number_header: cn(\n 'w-(--cell-size) text-xs font-normal text-muted-foreground select-none',\n defaultClassNames.week_number_header\n ),\n week_number: cn(\n 'text-xs font-normal tabular-nums text-muted-foreground select-none',\n defaultClassNames.week_number\n ),\n day: cn(\n 'group/day relative aspect-square h-full w-full rounded-(--cell-radius) p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-r-(--cell-radius)',\n props.showWeekNumber\n ? '[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)'\n : '[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)',\n defaultClassNames.day\n ),\n range_start: cn(\n 'relative isolate z-0 rounded-l-(--cell-radius) bg-primary-50 after:absolute after:inset-y-0 after:right-0 after:w-4 after:bg-primary-50 dark:bg-primary-950 dark:after:bg-primary-950',\n defaultClassNames.range_start\n ),\n range_middle: cn('rounded-none', defaultClassNames.range_middle),\n range_end: cn(\n 'relative isolate z-0 rounded-r-(--cell-radius) bg-primary-50 after:absolute after:inset-y-0 after:left-0 after:w-4 after:bg-primary-50 dark:bg-primary-950 dark:after:bg-primary-950',\n defaultClassNames.range_end\n ),\n today: cn(\n 'rounded-(--cell-radius) bg-muted text-foreground data-[selected=true]:rounded-none',\n defaultClassNames.today\n ),\n outside: cn('text-muted-foreground aria-selected:text-muted-foreground', defaultClassNames.outside),\n disabled: cn('text-muted-foreground opacity-50', defaultClassNames.disabled),\n hidden: cn('invisible', defaultClassNames.hidden),\n ...classNames\n }}\n components={{\n Root: CalendarRoot,\n Chevron: CalendarChevron,\n DayButton: CalendarDayButtonSlot,\n WeekNumber: CalendarWeekNumber,\n ...components\n }}\n {...props}\n />\n )\n}\n\nfunction CalendarRoot({ className, rootRef, ...props }: React.ComponentProps<typeof DayPickerRoot>) {\n return <div data-slot=\"calendar\" ref={rootRef as React.Ref<HTMLDivElement>} className={cn(className)} {...props} />\n}\n\nfunction CalendarChevron({ className, orientation, ...props }: React.ComponentProps<typeof DayPickerChevron>) {\n if (orientation === 'left') {\n return <IconChevronLeft className={cn('size-4', className)} {...props} />\n }\n\n if (orientation === 'right') {\n return <IconChevronRight className={cn('size-4', className)} {...props} />\n }\n\n return <IconChevronDown className={cn('size-4', className)} {...props} />\n}\n\nfunction CalendarDayButtonSlot(props: React.ComponentProps<typeof DayButton>) {\n const { dayPickerProps } = useDayPicker()\n return <CalendarDayButton locale={dayPickerProps.locale} {...props} />\n}\n\nfunction CalendarWeekNumber({ children, ...props }: React.ComponentProps<typeof DayPickerWeekNumber>) {\n return (\n <td {...props}>\n <div className=\"flex size-(--cell-size) items-center justify-center text-center text-xs font-normal tabular-nums\">\n {children}\n </div>\n </td>\n )\n}\n\nfunction CalendarDayButton({ className, day, modifiers, locale, ...props }: CalendarDayButtonProps) {\n const defaultClassNames = getDefaultClassNames()\n const isWeekend = day.date.getDay() === 0 || day.date.getDay() === 6\n\n const ref = React.useRef<HTMLButtonElement>(null)\n React.useEffect(() => {\n if (modifiers.focused) ref.current?.focus()\n }, [modifiers.focused])\n\n return (\n <Button\n ref={ref}\n variant=\"ghost\"\n size=\"icon\"\n color=\"zinc\"\n data-day={day.date.toLocaleDateString(locale?.code)}\n data-weekend={isWeekend}\n data-selected-single={\n modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle\n }\n data-range-start={modifiers.range_start}\n data-range-end={modifiers.range_end}\n data-range-middle={modifiers.range_middle}\n className={cn(\n 'relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 border-0 text-foreground leading-none font-normal',\n 'hover:bg-primary-50 hover:text-foreground dark:hover:bg-primary-950 dark:hover:text-foreground',\n '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-[3px] group-data-[focused=true]/day:ring-ring/50',\n 'data-[weekend=true]:text-destructive data-[weekend=true]:hover:bg-red-50 data-[weekend=true]:hover:text-destructive dark:data-[weekend=true]:hover:bg-red-950',\n 'data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-primary-50 data-[range-middle=true]:text-foreground data-[range-middle=true]:hover:bg-primary-50 data-[range-middle=true]:hover:text-foreground dark:data-[range-middle=true]:bg-primary-950 dark:data-[range-middle=true]:hover:bg-primary-950',\n 'data-[range-middle=true]:data-[weekend=true]:text-destructive data-[range-middle=true]:data-[weekend=true]:hover:bg-red-50 data-[range-middle=true]:data-[weekend=true]:hover:text-destructive dark:data-[range-middle=true]:data-[weekend=true]:hover:bg-red-950',\n 'data-[range-end=true]:rounded-(--cell-radius) data-[range-end=true]:rounded-r-(--cell-radius) data-[range-end=true]:bg-primary-500 data-[range-end=true]:text-white data-[range-end=true]:hover:bg-primary-500 data-[range-end=true]:hover:text-white dark:data-[range-end=true]:hover:bg-primary-500',\n 'data-[range-end=true]:data-[weekend=true]:text-white data-[range-end=true]:data-[weekend=true]:hover:text-white',\n 'data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-l-(--cell-radius) data-[range-start=true]:bg-primary-500 data-[range-start=true]:text-white data-[range-start=true]:hover:bg-primary-500 data-[range-start=true]:hover:text-white dark:data-[range-start=true]:hover:bg-primary-500',\n 'data-[range-start=true]:data-[weekend=true]:text-white data-[range-start=true]:data-[weekend=true]:hover:text-white',\n 'data-[selected-single=true]:bg-primary-500 data-[selected-single=true]:text-white data-[selected-single=true]:hover:bg-primary-500 data-[selected-single=true]:hover:text-white dark:data-[selected-single=true]:hover:bg-primary-500',\n 'data-[selected-single=true]:data-[weekend=true]:text-white data-[selected-single=true]:data-[weekend=true]:hover:text-white',\n '[&>span]:text-xs [&>span]:opacity-70',\n defaultClassNames.day,\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Calendar, CalendarDayButton, type DateRange, locale }\n"],"mappings":"A,0aA+BA,SAAS,SAAS,CAChB,YACA,aACA,kBAAkB,GAClB,gBAAgB,QAChB,gBAAgB,QAChB,SACA,aACA,aACA,GAAGE,GACa,CAChB,IAAMC,EAAoBC,EAAqB,EAE/C,MACE,kBAACC,EAAD,CACmB,kBACjB,UAAWC,EACT,wLACA,OAAO,GAAG,4CACV,OAAO,GAAG,gDACVC,CACF,EACe,gBACP,SACR,WAAY,CACV,oBAAsB,GAASC,EAAK,eAAeP,GAAQ,KAAM,CAAE,MAAO,OAAQ,CAAC,EACnF,GAAGQ,CACL,EACA,WAAY,CACV,KAAMH,EAAG,QAASH,EAAkB,IAAI,EACxC,OAAQG,EAAG,sBAAuBH,EAAkB,MAAM,EAC1D,MAAOG,EAAG,6BAA8BH,EAAkB,KAAK,EAC/D,IAAKG,EAAG,0EAA2EH,EAAkB,GAAG,EACxG,gBAAiBG,EACfI,EAAe,CAAE,QAASC,CAAc,CAAC,EACzC,8DACAR,EAAkB,eACpB,EACA,YAAaG,EACXI,EAAe,CAAE,QAASC,CAAc,CAAC,EACzC,8DACAR,EAAkB,WACpB,EACA,cAAeG,EACb,2EACAH,EAAkB,aACpB,EACA,UAAWG,EACT,sFACAH,EAAkB,SACpB,EACA,cAAeG,EAAG,mCAAoCH,EAAkB,aAAa,EACrF,SAAUG,EAAG,wCAAyCH,EAAkB,QAAQ,EAChF,cAAeG,EACb,0BACAM,IAAkB,QACd,UACA,yGACJT,EAAkB,aACpB,EACA,WAAY,yBACZ,SAAUG,EAAG,OAAQH,EAAkB,QAAQ,EAC/C,QAASG,EACP,6FACAH,EAAkB,OACpB,EACA,KAAMG,EAAG,mBAAoBH,EAAkB,IAAI,EACnD,mBAAoBG,EAClB,wEACAH,EAAkB,kBACpB,EACA,YAAaG,EACX,qEACAH,EAAkB,WACpB,EACA,IAAKG,EACH,yKACAJ,EAAM,eACF,wEACA,uEACJC,EAAkB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EAAMzB,EAAM,OAA0B,IAAI,EAKhD,OAJAA,EAAM,cAAgB,CAChB0B,EAAU,SAASD,EAAI,SAAS,MAAM,CAC5C,EAAG,CAACC,EAAU,OAAO,CAAC,EAGpB,kBAACC,EAAD,CACO,MACL,QAAQ,QACR,KAAK,OACL,MAAM,OACN,WAAUH,EAAI,KAAK,mBAAmBvB,GAAQ,IAAI,EAClD,eAAcsB,EACd,uBACEG,EAAU,UAAY,CAACA,EAAU,aAAe,CAACA,EAAU,WAAa,CAACA,EAAU,aAErF,mBAAkBA,EAAU,YAC5B,iBAAgBA,EAAU,UAC1B,oBAAmBA,EAAU,aAC7B,UAAWpB,EACT,iJACA,iGACA,0MACA,gKACA,oTACA,oQACA,wSACA,kHACA,sTACA,sHACA,wOACA,8HACA,uCACAH,EAAkB,IAClBI,CACF,EACA,GAAIL,CACL,CAAA,CAEL,C"}
@@ -1,6 +1,5 @@
1
1
  import { t as __name } from "../rolldown-runtime-BhWHdk3m.js";
2
2
  import * as React from "react";
3
- //#region src/components/card.d.ts
4
3
  export type CardProps = React.ComponentProps<'div'> & {
5
4
  /**
6
5
  * Padding and gap between parts.
@@ -21,6 +20,5 @@ declare function CardDescription({ className, ...props }: CardDescriptionProps):
21
20
  declare function CardAction({ className, ...props }: CardActionProps): React.JSX.Element;
22
21
  declare function CardContent({ className, ...props }: CardContentProps): React.JSX.Element;
23
22
  declare function CardFooter({ className, ...props }: CardFooterProps): React.JSX.Element;
24
- //#endregion
25
23
  export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
26
24
  //# sourceMappingURL=card.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"card.js","names":["props","size","cn","className"],"sources":["../../src/components/card.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { cn } from '../lib/utils'\n\nexport type CardProps = React.ComponentProps<'div'> & {\n /**\n * Padding and gap between parts.\n * @default 'md'\n */\n size?: 'sm' | 'md' | 'lg'\n}\n\nexport type CardHeaderProps = React.ComponentProps<'div'>\n\nexport type CardTitleProps = React.ComponentProps<'div'>\n\nexport type CardDescriptionProps = React.ComponentProps<'div'>\n\nexport type CardActionProps = React.ComponentProps<'div'>\n\nexport type CardContentProps = React.ComponentProps<'div'>\n\nexport type CardFooterProps = React.ComponentProps<'div'>\n\nfunction Card({ className, size = 'md', ...props }: CardProps) {\n return (\n <div\n data-slot=\"card\"\n data-size={size}\n className={cn(\n 'group/card flex flex-col gap-4 overflow-hidden rounded-xl py-4 text-sm bg-card text-card-foreground ring-foreground/10 ring-1',\n 'has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0',\n 'data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0',\n 'data-[size=lg]:gap-6 data-[size=lg]:py-6 data-[size=lg]:has-data-[slot=card-footer]:pb-0',\n '*:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CardHeader({ className, ...props }: CardHeaderProps) {\n return (\n <div\n data-slot=\"card-header\"\n className={cn(\n 'group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4',\n 'group-data-[size=sm]/card:px-3 [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3',\n 'group-data-[size=lg]/card:px-6',\n 'has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto]',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CardTitle({ className, ...props }: CardTitleProps) {\n return (\n <div\n data-slot=\"card-title\"\n className={cn(\n 'text-lg leading-snug font-bold group-data-[size=sm]/card:text-sm group-data-[size=lg]/card:text-xl',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CardDescription({ className, ...props }: CardDescriptionProps) {\n return <div data-slot=\"card-description\" className={cn('text-muted-foreground text-sm', className)} {...props} />\n}\n\nfunction CardAction({ className, ...props }: CardActionProps) {\n return (\n <div\n data-slot=\"card-action\"\n className={cn('col-start-2 row-span-2 row-start-1 self-start justify-self-end', className)}\n {...props}\n />\n )\n}\n\nfunction CardContent({ className, ...props }: CardContentProps) {\n return (\n <div\n data-slot=\"card-content\"\n className={cn('px-4 group-data-[size=sm]/card:px-3 group-data-[size=lg]/card:px-6', className)}\n {...props}\n />\n )\n}\n\nfunction CardFooter({ className, ...props }: CardFooterProps) {\n return (\n <div\n data-slot=\"card-footer\"\n className={cn(\n 'bg-muted/50 flex items-center rounded-b-xl border-t p-4',\n 'group-data-[size=sm]/card:p-3 group-data-[size=lg]/card:p-6',\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle }\n"],"mappings":"qHAwBA,SAAS,KAAK,CAAE,YAAW,OAAO,KAAM,GAAGA,GAAoB,CAC7D,MACE,kBAAC,MAAD,CACE,YAAU,OACV,YAAWC,EACX,UAAWC,EACT,gIACA,+DACA,2FACA,2FACA,mEACAC,CACF,EACA,GAAIH,CACL,CAAA,CAEL,CAEA,SAAS,WAAW,CAAE,YAAW,GAAGA,GAA0B,CAC5D,MACE,kBAAC,MAAD,CACE,YAAU,cACV,UAAWE,EACT,kGACA,6FACA,iCACA,0GACAC,CACF,EACA,GAAIH,CACL,CAAA,CAEL,CAEA,SAAS,UAAU,CAAE,YAAW,GAAGA,GAAyB,CAC1D,MACE,kBAAC,MAAD,CACE,YAAU,aACV,UAAWE,EACT,qGACAC,CACF,EACA,GAAIH,CACL,CAAA,CAEL,CAEA,SAAS,gBAAgB,CAAE,YAAW,GAAGA,GAA+B,CACtE,MAAO,kBAAC,MAAD,CAAK,YAAU,mBAAmB,UAAWE,EAAG,gCAAiCC,CAAS,EAAG,GAAIH,CAAQ,CAAA,CAClH,CAEA,SAAS,WAAW,CAAE,YAAW,GAAGA,GAA0B,CAC5D,MACE,kBAAC,MAAD,CACE,YAAU,cACV,UAAWE,EAAG,iEAAkEC,CAAS,EACzF,GAAIH,CACL,CAAA,CAEL,CAEA,SAAS,YAAY,CAAE,YAAW,GAAGA,GAA2B,CAC9D,MACE,kBAAC,MAAD,CACE,YAAU,eACV,UAAWE,EAAG,qEAAsEC,CAAS,EAC7F,GAAIH,CACL,CAAA,CAEL,CAEA,SAAS,WAAW,CAAE,YAAW,GAAGA,GAA0B,CAC5D,MACE,kBAAC,MAAD,CACE,YAAU,cACV,UAAWE,EACT,0DACA,8DACAC,CACF,EACA,GAAIH,CACL,CAAA,CAEL"}
1
+ {"version":3,"file":"card.js","names":["props","size","cn","className"],"sources":["../../src/components/card.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { cn } from '../lib/utils'\n\nexport type CardProps = React.ComponentProps<'div'> & {\n /**\n * Padding and gap between parts.\n * @default 'md'\n */\n size?: 'sm' | 'md' | 'lg'\n}\n\nexport type CardHeaderProps = React.ComponentProps<'div'>\n\nexport type CardTitleProps = React.ComponentProps<'div'>\n\nexport type CardDescriptionProps = React.ComponentProps<'div'>\n\nexport type CardActionProps = React.ComponentProps<'div'>\n\nexport type CardContentProps = React.ComponentProps<'div'>\n\nexport type CardFooterProps = React.ComponentProps<'div'>\n\nfunction Card({ className, size = 'md', ...props }: CardProps) {\n return (\n <div\n data-slot=\"card\"\n data-size={size}\n className={cn(\n 'group/card flex flex-col gap-4 overflow-hidden rounded-xl py-4 text-sm bg-card text-card-foreground ring-foreground/10 ring-1',\n 'has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0',\n 'data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0',\n 'data-[size=lg]:gap-6 data-[size=lg]:py-6 data-[size=lg]:has-data-[slot=card-footer]:pb-0',\n '*:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CardHeader({ className, ...props }: CardHeaderProps) {\n return (\n <div\n data-slot=\"card-header\"\n className={cn(\n 'group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4',\n 'group-data-[size=sm]/card:px-3 [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3',\n 'group-data-[size=lg]/card:px-6',\n 'has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto]',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CardTitle({ className, ...props }: CardTitleProps) {\n return (\n <div\n data-slot=\"card-title\"\n className={cn(\n 'text-lg leading-snug font-bold group-data-[size=sm]/card:text-sm group-data-[size=lg]/card:text-xl',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CardDescription({ className, ...props }: CardDescriptionProps) {\n return <div data-slot=\"card-description\" className={cn('text-muted-foreground text-sm', className)} {...props} />\n}\n\nfunction CardAction({ className, ...props }: CardActionProps) {\n return (\n <div\n data-slot=\"card-action\"\n className={cn('col-start-2 row-span-2 row-start-1 self-start justify-self-end', className)}\n {...props}\n />\n )\n}\n\nfunction CardContent({ className, ...props }: CardContentProps) {\n return (\n <div\n data-slot=\"card-content\"\n className={cn('px-4 group-data-[size=sm]/card:px-3 group-data-[size=lg]/card:px-6', className)}\n {...props}\n />\n )\n}\n\nfunction CardFooter({ className, ...props }: CardFooterProps) {\n return (\n <div\n data-slot=\"card-footer\"\n className={cn(\n 'bg-muted/50 flex items-center rounded-b-xl border-t p-4',\n 'group-data-[size=sm]/card:p-3 group-data-[size=lg]/card:p-6',\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle }\n"],"mappings":"A,qHAwBA,SAAS,KAAK,CAAE,YAAW,OAAO,KAAM,GAAGA,GAAoB,CAC7D,MACE,kBAAC,MAAD,CACE,YAAU,OACV,YAAWC,EACX,UAAWC,EACT,gIACA,+DACA,2FACA,2FACA,mEACAC,CACF,EACA,GAAIH,CACL,CAAA,CAEL,CAEA,SAAS,WAAW,CAAE,YAAW,GAAGA,GAA0B,CAC5D,MACE,kBAAC,MAAD,CACE,YAAU,cACV,UAAWE,EACT,kGACA,6FACA,iCACA,0GACAC,CACF,EACA,GAAIH,CACL,CAAA,CAEL,CAEA,SAAS,UAAU,CAAE,YAAW,GAAGA,GAAyB,CAC1D,MACE,kBAAC,MAAD,CACE,YAAU,aACV,UAAWE,EACT,qGACAC,CACF,EACA,GAAIH,CACL,CAAA,CAEL,CAEA,SAAS,gBAAgB,CAAE,YAAW,GAAGA,GAA+B,CACtE,MAAO,kBAAC,MAAD,CAAK,YAAU,mBAAmB,UAAWE,EAAG,gCAAiCC,CAAS,EAAG,GAAIH,CAAQ,CAAA,CAClH,CAEA,SAAS,WAAW,CAAE,YAAW,GAAGA,GAA0B,CAC5D,MACE,kBAAC,MAAD,CACE,YAAU,cACV,UAAWE,EAAG,iEAAkEC,CAAS,EACzF,GAAIH,CACL,CAAA,CAEL,CAEA,SAAS,YAAY,CAAE,YAAW,GAAGA,GAA2B,CAC9D,MACE,kBAAC,MAAD,CACE,YAAU,eACV,UAAWE,EAAG,qEAAsEC,CAAS,EAC7F,GAAIH,CACL,CAAA,CAEL,CAEA,SAAS,WAAW,CAAE,YAAW,GAAGA,GAA0B,CAC5D,MACE,kBAAC,MAAD,CACE,YAAU,cACV,UAAWE,EACT,0DACA,8DACAC,CACF,EACA,GAAIH,CACL,CAAA,CAEL,C"}
@@ -2,7 +2,6 @@ import { t as __name } from "../rolldown-runtime-BhWHdk3m.js";
2
2
  import { Button } from "./button.js";
3
3
  import * as React from "react";
4
4
  import useEmblaCarousel, { UseEmblaCarouselType } from "embla-carousel-react";
5
- //#region src/components/carousel.d.ts
6
5
  type UseCarouselParameters = Parameters<typeof useEmblaCarousel>;
7
6
  type CarouselOptions = UseCarouselParameters[0];
8
7
  type CarouselPlugin = UseCarouselParameters[1];
@@ -46,6 +45,5 @@ declare function CarouselItem({ className, ...props }: CarouselItemProps): React
46
45
  declare function CarouselPrevious({ className, variant, size, onClick, ...props }: CarouselPreviousProps): React.JSX.Element;
47
46
  declare function CarouselNext({ className, variant, size, onClick, ...props }: CarouselNextProps): React.JSX.Element;
48
47
  declare function CarouselIndicators({ className, getIndicatorProps, ...props }: CarouselIndicatorsProps): React.JSX.Element | null;
49
- //#endregion
50
48
  export { Carousel, CarouselContent, CarouselIndicators, CarouselItem, CarouselNext, CarouselPrevious, useCarousel };
51
49
  //# sourceMappingURL=carousel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"carousel.js","names":["React","useEmblaCarousel","CarouselContext","context","target","props","carouselRef","api","opts","orientation","plugins","canScrollPrev","setCanScrollPrev","canScrollNext","setCanScrollNext","selectedIndex","setSelectedIndex","scrollSnaps","setScrollSnaps","onSelect","scrollPrev","scrollNext","scrollTo","index","isRtl","handleKeyDown","onKeyDown","event","prevKey","nextKey","setApi","cn","className","Button","onClick","IconChevronLeft","IconChevronRight","indicatorClassName","indicatorProps","getIndicatorProps","snap"],"sources":["../../src/components/carousel.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { IconChevronLeft, IconChevronRight } from '@tabler/icons-react'\nimport useEmblaCarousel, { type UseEmblaCarouselType } from 'embla-carousel-react'\n\nimport { cn } from '../lib/utils'\nimport { Button } from './button'\n\ntype UseCarouselParameters = Parameters<typeof useEmblaCarousel>\ntype CarouselOptions = UseCarouselParameters[0]\ntype CarouselPlugin = UseCarouselParameters[1]\n\nexport type CarouselApi = UseEmblaCarouselType[1]\n\nexport type CarouselProps = React.ComponentProps<'div'> & {\n /** Embla Carousel options, such as `loop`, `align` and `slidesToScroll`. */\n opts?: CarouselOptions\n /** Embla Carousel plugins, such as autoplay. */\n plugins?: CarouselPlugin\n /**\n * Scroll direction.\n * @default 'horizontal'\n */\n orientation?: 'horizontal' | 'vertical'\n /** Receives the Embla API once the carousel is ready. */\n setApi?: (api: CarouselApi) => void\n}\n\nexport type CarouselContentProps = React.ComponentProps<'div'>\n\nexport type CarouselItemProps = React.ComponentProps<'div'>\n\nexport type CarouselPreviousProps = React.ComponentProps<typeof Button>\n\nexport type CarouselNextProps = React.ComponentProps<typeof Button>\n\nexport type CarouselIndicatorsProps = React.ComponentProps<'div'> & {\n /** Returns extra props for the dot of each slide index. */\n getIndicatorProps?: (index: number) => React.ComponentProps<'button'>\n}\n\ntype CarouselContextProps = {\n carouselRef: ReturnType<typeof useEmblaCarousel>[0]\n api: ReturnType<typeof useEmblaCarousel>[1]\n scrollPrev: () => void\n scrollNext: () => void\n scrollTo: (index: number) => void\n canScrollPrev: boolean\n canScrollNext: boolean\n selectedIndex: number\n scrollSnaps: number[]\n} & CarouselProps\n\nconst CarouselContext = React.createContext<CarouselContextProps | null>(null)\n\nfunction useCarousel() {\n const context = React.useContext(CarouselContext)\n\n if (!context) {\n throw new Error('useCarousel must be used within a <Carousel />')\n }\n\n return context\n}\n\nconst EDITABLE_TARGET_SELECTOR = 'input, textarea, select, [contenteditable]:not([contenteditable=\"false\"])'\n\nfunction isEditableTarget(target: EventTarget) {\n return target instanceof Element && target.closest(EDITABLE_TARGET_SELECTOR) !== null\n}\n\nfunction Carousel({\n orientation = 'horizontal',\n opts,\n setApi,\n plugins,\n className,\n children,\n onKeyDown,\n ...props\n}: CarouselProps) {\n const [carouselRef, api] = useEmblaCarousel(\n {\n ...opts,\n axis: orientation === 'horizontal' ? 'x' : 'y'\n },\n plugins\n )\n const [canScrollPrev, setCanScrollPrev] = React.useState(false)\n const [canScrollNext, setCanScrollNext] = React.useState(false)\n const [selectedIndex, setSelectedIndex] = React.useState(0)\n const [scrollSnaps, setScrollSnaps] = React.useState<number[]>([])\n\n const onSelect = React.useCallback((api: CarouselApi) => {\n if (!api) return\n setCanScrollPrev(api.canScrollPrev())\n setCanScrollNext(api.canScrollNext())\n setSelectedIndex(api.selectedScrollSnap())\n setScrollSnaps(api.scrollSnapList())\n }, [])\n\n const scrollPrev = React.useCallback(() => {\n api?.scrollPrev()\n }, [api])\n\n const scrollNext = React.useCallback(() => {\n api?.scrollNext()\n }, [api])\n\n const scrollTo = React.useCallback(\n (index: number) => {\n api?.scrollTo(index)\n },\n [api]\n )\n\n const isRtl = opts?.direction === 'rtl'\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLElement>) => {\n onKeyDown?.(event as React.KeyboardEvent<HTMLDivElement>)\n // Leave arrows to text fields and to controls inside a slide (slider, radio group...) that handle them.\n if (event.defaultPrevented || isEditableTarget(event.target)) return\n\n const [prevKey, nextKey] =\n orientation === 'vertical'\n ? ['ArrowUp', 'ArrowDown']\n : isRtl\n ? ['ArrowRight', 'ArrowLeft']\n : ['ArrowLeft', 'ArrowRight']\n\n if (event.key === prevKey) {\n event.preventDefault()\n scrollPrev()\n } else if (event.key === nextKey) {\n event.preventDefault()\n scrollNext()\n }\n },\n [onKeyDown, orientation, isRtl, scrollPrev, scrollNext]\n )\n\n React.useEffect(() => {\n if (!api || !setApi) return\n setApi(api)\n }, [api, setApi])\n\n React.useEffect(() => {\n if (!api) return\n onSelect(api)\n api.on('reInit', onSelect)\n api.on('select', onSelect)\n\n return () => {\n api?.off('reInit', onSelect)\n api?.off('select', onSelect)\n }\n }, [api, onSelect])\n\n return (\n <CarouselContext.Provider\n value={{\n carouselRef,\n api: api,\n opts,\n orientation: orientation || (opts?.axis === 'y' ? 'vertical' : 'horizontal'),\n scrollPrev,\n scrollNext,\n scrollTo,\n canScrollPrev,\n canScrollNext,\n selectedIndex,\n scrollSnaps\n }}\n >\n <section\n role=\"region\"\n aria-roledescription=\"carousel\"\n onKeyDown={handleKeyDown}\n className={cn('relative', className)}\n data-slot=\"carousel\"\n {...props}\n >\n {children}\n </section>\n </CarouselContext.Provider>\n )\n}\n\nfunction CarouselContent({ className, ...props }: CarouselContentProps) {\n const { carouselRef, orientation } = useCarousel()\n\n return (\n <div ref={carouselRef} className=\"overflow-hidden\" data-slot=\"carousel-content\">\n <div className={cn('flex', orientation === 'horizontal' ? '-ml-4' : '-mt-4 flex-col', className)} {...props} />\n </div>\n )\n}\n\nfunction CarouselItem({ className, ...props }: CarouselItemProps) {\n const { orientation } = useCarousel()\n\n return (\n <div\n data-slot=\"carousel-item\"\n className={cn('min-w-0 shrink-0 grow-0 basis-full', orientation === 'horizontal' ? 'pl-4' : 'pt-4', className)}\n {...props}\n />\n )\n}\n\nfunction CarouselPrevious({\n className,\n variant = 'secondary',\n size = 'icon-sm',\n onClick,\n ...props\n}: CarouselPreviousProps) {\n const { orientation, scrollPrev, canScrollPrev } = useCarousel()\n\n return (\n <Button\n data-slot=\"carousel-previous\"\n variant={variant}\n size={size}\n className={cn(\n 'absolute touch-manipulation rounded-full',\n orientation === 'horizontal'\n ? 'top-1/2 -left-12 -translate-y-1/2'\n : '-top-12 left-1/2 -translate-x-1/2 rotate-90',\n className\n )}\n disabled={!canScrollPrev}\n onClick={(event) => {\n onClick?.(event)\n if (!event.defaultPrevented) scrollPrev()\n }}\n {...props}\n >\n <IconChevronLeft />\n <span className=\"sr-only\">Previous slide</span>\n </Button>\n )\n}\n\nfunction CarouselNext({ className, variant = 'secondary', size = 'icon-sm', onClick, ...props }: CarouselNextProps) {\n const { orientation, scrollNext, canScrollNext } = useCarousel()\n\n return (\n <Button\n data-slot=\"carousel-next\"\n variant={variant}\n size={size}\n className={cn(\n 'absolute touch-manipulation rounded-full',\n orientation === 'horizontal'\n ? 'top-1/2 -right-12 -translate-y-1/2'\n : '-bottom-12 left-1/2 -translate-x-1/2 rotate-90',\n className\n )}\n disabled={!canScrollNext}\n onClick={(event) => {\n onClick?.(event)\n if (!event.defaultPrevented) scrollNext()\n }}\n {...props}\n >\n <IconChevronRight />\n <span className=\"sr-only\">Next slide</span>\n </Button>\n )\n}\n\nfunction CarouselIndicators({ className, getIndicatorProps, ...props }: CarouselIndicatorsProps) {\n const { orientation, scrollSnaps, selectedIndex, scrollTo } = useCarousel()\n\n if (scrollSnaps.length === 0) {\n return null\n }\n\n return (\n <div\n data-slot=\"carousel-indicators\"\n className={cn(\n 'pointer-events-none absolute flex justify-center gap-2',\n orientation === 'horizontal' ? 'inset-x-0 bottom-4 flex-row' : 'inset-y-0 right-4 flex-col items-center',\n className\n )}\n {...props}\n >\n {scrollSnaps.map((snap, index) => {\n const { className: indicatorClassName, onClick, ...indicatorProps } = getIndicatorProps?.(index) ?? {}\n\n return (\n <button\n key={snap}\n aria-label={`Go to slide ${index + 1}`}\n {...indicatorProps}\n type=\"button\"\n data-slot=\"carousel-indicator\"\n data-active={selectedIndex === index ? true : undefined}\n className={cn(\n 'pointer-events-auto cursor-pointer size-2.5 touch-manipulation rounded-full bg-background opacity-60 shadow-sm ring-1 ring-border transition-opacity hover:opacity-100 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3 focus-visible:outline-none data-[active=true]:opacity-100',\n indicatorClassName\n )}\n onClick={(event) => {\n scrollTo(index)\n onClick?.(event)\n }}\n />\n )\n })}\n </div>\n )\n}\n\nexport { Carousel, CarouselContent, CarouselIndicators, CarouselItem, CarouselNext, CarouselPrevious, useCarousel }\n"],"mappings":"4SAqDA,MAAME,EAAkBF,EAAM,cAA2C,IAAI,EAE7E,SAAS,aAAc,CACrB,IAAMG,EAAUH,EAAM,WAAWE,CAAe,EAEhD,GAAI,CAACC,EACH,MAAU,MAAM,gDAAgD,EAGlE,OAAOA,CACT,CAIA,SAAS,iBAAiB,EAAqB,CAC7C,OAAOC,aAAkB,SAAWA,EAAO,QAAQ,2EAAwB,IAAM,IACnF,CAEA,SAAS,SAAS,CAChB,cAAc,aACd,OACA,SACA,UACA,YACA,WACA,YACA,GAAGC,GACa,CAChB,GAAM,CAACC,EAAaC,GAAON,EACzB,CACE,GAAGO,EACH,KAAMC,IAAgB,aAAe,IAAM,GAC7C,EACAC,CACF,EACM,CAACC,EAAeC,GAAoBZ,EAAM,SAAS,EAAK,EACxD,CAACa,EAAeC,GAAoBd,EAAM,SAAS,EAAK,EACxD,CAACe,EAAeC,GAAoBhB,EAAM,SAAS,CAAC,EACpD,CAACiB,EAAaC,GAAkBlB,EAAM,SAAmB,CAAC,CAAC,EAE3DmB,EAAWnB,EAAM,YAAa,GAAqB,CAClDO,IACLK,EAAiBL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AAO,UAAW,UAAS,GAAG9B,GAA4B,CAClH,GAAM,CAAE,cAAa,aAAY,iBAAkB,YAAY,EAE/D,MACE,kBAAC4B,EAAD,CACE,YAAU,gBACD,UACH,OACN,UAAWF,EACT,2CACAtB,IAAgB,aACZ,qCACA,iDACJuB,CACF,EACA,SAAU,CAACnB,EACX,QAAU,GAAU,CAClBqB,IAAUP,CAAK,EACVA,EAAM,kBAAkBN,EAAW,CAC1C,EACA,GAAIhB,EAhBN,SAAA,CAkBE,kBAAC+B,EAAD,CAAmB,CAAA,EACnB,kBAAC,OAAD,CAAM,UAAU,UAAU,SAAA,YAAgB,CAAA,CACpC,GAEZ,CAEA,SAAS,mBAAmB,CAAE,YAAW,oBAAmB,GAAG/B,GAAkC,CAC/F,GAAM,CAAE,cAAa,cAAa,gBAAe,YAAa,YAAY,EAM1E,OAJIY,EAAY,SAAW,EAClB,KAIP,kBAAC,MAAD,CACE,YAAU,sBACV,UAAWc,EACT,yDACAtB,IAAgB,aAAe,8BAAgC,0CAC/DuB,CACF,EACA,GAAI3B,EAEH,SAAAY,EAAY,KAAK,EAAM,IAAU,CAChC,GAAM,CAAE,UAAWoB,EAAoB,UAAS,GAAGC,GAAmBC,IAAoBhB,CAAK,GAAK,CAAC,EAErG,MACE,kBAAC,SAAD,CAEE,aAAY,eAAeA,EAAQ,IACnC,GAAIe,EACJ,KAAK,SACL,YAAU,qBACV,cAAavB,IAAkBQ,GAAe,IAAA,GAC9C,UAAWQ,EACT,6SACAM,CACF,EACA,QAAU,GAAU,CAClBf,EAASC,CAAK,EACdW,IAAUP,CAAK,CACjB,CACD,EAdMa,CAcN,CAEL,CAAC,CACE,CAAA,CAET"}
1
+ {"version":3,"file":"carousel.js","names":["React","useEmblaCarousel","CarouselContext","context","target","props","carouselRef","api","opts","orientation","plugins","canScrollPrev","setCanScrollPrev","canScrollNext","setCanScrollNext","selectedIndex","setSelectedIndex","scrollSnaps","setScrollSnaps","onSelect","scrollPrev","scrollNext","scrollTo","index","isRtl","handleKeyDown","onKeyDown","event","prevKey","nextKey","setApi","cn","className","Button","onClick","IconChevronLeft","IconChevronRight","indicatorClassName","indicatorProps","getIndicatorProps","snap"],"sources":["../../src/components/carousel.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { IconChevronLeft, IconChevronRight } from '@tabler/icons-react'\nimport useEmblaCarousel, { type UseEmblaCarouselType } from 'embla-carousel-react'\n\nimport { cn } from '../lib/utils'\nimport { Button } from './button'\n\ntype UseCarouselParameters = Parameters<typeof useEmblaCarousel>\ntype CarouselOptions = UseCarouselParameters[0]\ntype CarouselPlugin = UseCarouselParameters[1]\n\nexport type CarouselApi = UseEmblaCarouselType[1]\n\nexport type CarouselProps = React.ComponentProps<'div'> & {\n /** Embla Carousel options, such as `loop`, `align` and `slidesToScroll`. */\n opts?: CarouselOptions\n /** Embla Carousel plugins, such as autoplay. */\n plugins?: CarouselPlugin\n /**\n * Scroll direction.\n * @default 'horizontal'\n */\n orientation?: 'horizontal' | 'vertical'\n /** Receives the Embla API once the carousel is ready. */\n setApi?: (api: CarouselApi) => void\n}\n\nexport type CarouselContentProps = React.ComponentProps<'div'>\n\nexport type CarouselItemProps = React.ComponentProps<'div'>\n\nexport type CarouselPreviousProps = React.ComponentProps<typeof Button>\n\nexport type CarouselNextProps = React.ComponentProps<typeof Button>\n\nexport type CarouselIndicatorsProps = React.ComponentProps<'div'> & {\n /** Returns extra props for the dot of each slide index. */\n getIndicatorProps?: (index: number) => React.ComponentProps<'button'>\n}\n\ntype CarouselContextProps = {\n carouselRef: ReturnType<typeof useEmblaCarousel>[0]\n api: ReturnType<typeof useEmblaCarousel>[1]\n scrollPrev: () => void\n scrollNext: () => void\n scrollTo: (index: number) => void\n canScrollPrev: boolean\n canScrollNext: boolean\n selectedIndex: number\n scrollSnaps: number[]\n} & CarouselProps\n\nconst CarouselContext = React.createContext<CarouselContextProps | null>(null)\n\nfunction useCarousel() {\n const context = React.useContext(CarouselContext)\n\n if (!context) {\n throw new Error('useCarousel must be used within a <Carousel />')\n }\n\n return context\n}\n\nconst EDITABLE_TARGET_SELECTOR = 'input, textarea, select, [contenteditable]:not([contenteditable=\"false\"])'\n\nfunction isEditableTarget(target: EventTarget) {\n return target instanceof Element && target.closest(EDITABLE_TARGET_SELECTOR) !== null\n}\n\nfunction Carousel({\n orientation = 'horizontal',\n opts,\n setApi,\n plugins,\n className,\n children,\n onKeyDown,\n ...props\n}: CarouselProps) {\n const [carouselRef, api] = useEmblaCarousel(\n {\n ...opts,\n axis: orientation === 'horizontal' ? 'x' : 'y'\n },\n plugins\n )\n const [canScrollPrev, setCanScrollPrev] = React.useState(false)\n const [canScrollNext, setCanScrollNext] = React.useState(false)\n const [selectedIndex, setSelectedIndex] = React.useState(0)\n const [scrollSnaps, setScrollSnaps] = React.useState<number[]>([])\n\n const onSelect = React.useCallback((api: CarouselApi) => {\n if (!api) return\n setCanScrollPrev(api.canScrollPrev())\n setCanScrollNext(api.canScrollNext())\n setSelectedIndex(api.selectedScrollSnap())\n setScrollSnaps(api.scrollSnapList())\n }, [])\n\n const scrollPrev = React.useCallback(() => {\n api?.scrollPrev()\n }, [api])\n\n const scrollNext = React.useCallback(() => {\n api?.scrollNext()\n }, [api])\n\n const scrollTo = React.useCallback(\n (index: number) => {\n api?.scrollTo(index)\n },\n [api]\n )\n\n const isRtl = opts?.direction === 'rtl'\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLElement>) => {\n onKeyDown?.(event as React.KeyboardEvent<HTMLDivElement>)\n // Leave arrows to text fields and to controls inside a slide (slider, radio group...) that handle them.\n if (event.defaultPrevented || isEditableTarget(event.target)) return\n\n const [prevKey, nextKey] =\n orientation === 'vertical'\n ? ['ArrowUp', 'ArrowDown']\n : isRtl\n ? ['ArrowRight', 'ArrowLeft']\n : ['ArrowLeft', 'ArrowRight']\n\n if (event.key === prevKey) {\n event.preventDefault()\n scrollPrev()\n } else if (event.key === nextKey) {\n event.preventDefault()\n scrollNext()\n }\n },\n [onKeyDown, orientation, isRtl, scrollPrev, scrollNext]\n )\n\n React.useEffect(() => {\n if (!api || !setApi) return\n setApi(api)\n }, [api, setApi])\n\n React.useEffect(() => {\n if (!api) return\n onSelect(api)\n api.on('reInit', onSelect)\n api.on('select', onSelect)\n\n return () => {\n api?.off('reInit', onSelect)\n api?.off('select', onSelect)\n }\n }, [api, onSelect])\n\n return (\n <CarouselContext.Provider\n value={{\n carouselRef,\n api: api,\n opts,\n orientation: orientation || (opts?.axis === 'y' ? 'vertical' : 'horizontal'),\n scrollPrev,\n scrollNext,\n scrollTo,\n canScrollPrev,\n canScrollNext,\n selectedIndex,\n scrollSnaps\n }}\n >\n <section\n role=\"region\"\n aria-roledescription=\"carousel\"\n onKeyDown={handleKeyDown}\n className={cn('relative', className)}\n data-slot=\"carousel\"\n {...props}\n >\n {children}\n </section>\n </CarouselContext.Provider>\n )\n}\n\nfunction CarouselContent({ className, ...props }: CarouselContentProps) {\n const { carouselRef, orientation } = useCarousel()\n\n return (\n <div ref={carouselRef} className=\"overflow-hidden\" data-slot=\"carousel-content\">\n <div className={cn('flex', orientation === 'horizontal' ? '-ml-4' : '-mt-4 flex-col', className)} {...props} />\n </div>\n )\n}\n\nfunction CarouselItem({ className, ...props }: CarouselItemProps) {\n const { orientation } = useCarousel()\n\n return (\n <div\n data-slot=\"carousel-item\"\n className={cn('min-w-0 shrink-0 grow-0 basis-full', orientation === 'horizontal' ? 'pl-4' : 'pt-4', className)}\n {...props}\n />\n )\n}\n\nfunction CarouselPrevious({\n className,\n variant = 'secondary',\n size = 'icon-sm',\n onClick,\n ...props\n}: CarouselPreviousProps) {\n const { orientation, scrollPrev, canScrollPrev } = useCarousel()\n\n return (\n <Button\n data-slot=\"carousel-previous\"\n variant={variant}\n size={size}\n className={cn(\n 'absolute touch-manipulation rounded-full',\n orientation === 'horizontal'\n ? 'top-1/2 -left-12 -translate-y-1/2'\n : '-top-12 left-1/2 -translate-x-1/2 rotate-90',\n className\n )}\n disabled={!canScrollPrev}\n onClick={(event) => {\n onClick?.(event)\n if (!event.defaultPrevented) scrollPrev()\n }}\n {...props}\n >\n <IconChevronLeft />\n <span className=\"sr-only\">Previous slide</span>\n </Button>\n )\n}\n\nfunction CarouselNext({ className, variant = 'secondary', size = 'icon-sm', onClick, ...props }: CarouselNextProps) {\n const { orientation, scrollNext, canScrollNext } = useCarousel()\n\n return (\n <Button\n data-slot=\"carousel-next\"\n variant={variant}\n size={size}\n className={cn(\n 'absolute touch-manipulation rounded-full',\n orientation === 'horizontal'\n ? 'top-1/2 -right-12 -translate-y-1/2'\n : '-bottom-12 left-1/2 -translate-x-1/2 rotate-90',\n className\n )}\n disabled={!canScrollNext}\n onClick={(event) => {\n onClick?.(event)\n if (!event.defaultPrevented) scrollNext()\n }}\n {...props}\n >\n <IconChevronRight />\n <span className=\"sr-only\">Next slide</span>\n </Button>\n )\n}\n\nfunction CarouselIndicators({ className, getIndicatorProps, ...props }: CarouselIndicatorsProps) {\n const { orientation, scrollSnaps, selectedIndex, scrollTo } = useCarousel()\n\n if (scrollSnaps.length === 0) {\n return null\n }\n\n return (\n <div\n data-slot=\"carousel-indicators\"\n className={cn(\n 'pointer-events-none absolute flex justify-center gap-2',\n orientation === 'horizontal' ? 'inset-x-0 bottom-4 flex-row' : 'inset-y-0 right-4 flex-col items-center',\n className\n )}\n {...props}\n >\n {scrollSnaps.map((snap, index) => {\n const { className: indicatorClassName, onClick, ...indicatorProps } = getIndicatorProps?.(index) ?? {}\n\n return (\n <button\n key={snap}\n aria-label={`Go to slide ${index + 1}`}\n {...indicatorProps}\n type=\"button\"\n data-slot=\"carousel-indicator\"\n data-active={selectedIndex === index ? true : undefined}\n className={cn(\n 'pointer-events-auto cursor-pointer size-2.5 touch-manipulation rounded-full bg-background opacity-60 shadow-sm ring-1 ring-border transition-opacity hover:opacity-100 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3 focus-visible:outline-none data-[active=true]:opacity-100',\n indicatorClassName\n )}\n onClick={(event) => {\n scrollTo(index)\n onClick?.(event)\n }}\n />\n )\n })}\n </div>\n )\n}\n\nexport { Carousel, CarouselContent, CarouselIndicators, CarouselItem, CarouselNext, CarouselPrevious, useCarousel }\n"],"mappings":"A,4SAqDA,MAAME,EAAkBF,EAAM,cAA2C,IAAI,EAE7E,SAAS,aAAc,CACrB,IAAMG,EAAUH,EAAM,WAAWE,CAAe,EAEhD,GAAI,CAACC,EACH,MAAU,MAAM,gDAAgD,EAGlE,OAAOA,CACT,CAIA,SAAS,iBAAiB,EAAqB,CAC7C,OAAOC,aAAkB,SAAWA,EAAO,QAAQ,2EAAwB,IAAM,IACnF,CAEA,SAAS,SAAS,CAChB,cAAc,aACd,OACA,SACA,UACA,YACA,WACA,YACA,GAAGC,GACa,CAChB,GAAM,CAACC,EAAaC,GAAON,EACzB,CACE,GAAGO,EACH,KAAMC,IAAgB,aAAe,IAAM,GAC7C,EACAC,CACF,EACM,CAACC,EAAeC,GAAoBZ,EAAM,SAAS,EAAK,EACxD,CAACa,EAAeC,GAAoBd,EAAM,SAAS,EAAK,EACxD,CAACe,EAAeC,GAAoBhB,EAAM,SAAS,CAAC,EACpD,CAACiB,EAAaC,GAAkBlB,EAAM,SAAmB,CAAC,CAAC,EAE3DmB,EAAWnB,EAAM,YAAa,GAAqB,CAClDO,IACLK,EAAiBL,EAAI,cAAc,CAAC,EACpCO,EAAiBP,EAAI,cAAc,CAAC,EACpCS,EAAiBT,EAAI,mBAAmB,CAAC,EACzCW,EAAeX,EAAI,eAAe,CAAC,EACrC,EAAG,CAAC,CAAC,EAECa,EAAapB,EAAM,gBAAkB,CACzCO,GAAK,WAAW,CAClB,EAAG,CAACA,CAAG,CAAC,EAEFc,EAAarB,EAAM,gBAAkB,CACzCO,GAAK,WAAW,CAClB,EAAG,CAACA,CAAG,CAAC,EAEFe,EAAWtB,EAAM,YACpB,GAAkB,CACjBO,GAAK,SAASgB,CAAK,CACrB,EACA,CAAChB,CAAG,CACN,EAEMiB,EAAQhB,GAAM,YAAc,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AAS,mBAAmB,CAAE,YAAW,oBAAmB,GAAG/B,GAAkC,CAC/F,GAAM,CAAE,cAAa,cAAa,gBAAe,YAAa,YAAY,EAM1E,OAJIY,EAAY,SAAW,EAClB,KAIP,kBAAC,MAAD,CACE,YAAU,sBACV,UAAWc,EACT,yDACAtB,IAAgB,aAAe,8BAAgC,0CAC/DuB,CACF,EACA,GAAI3B,EAEH,SAAAY,EAAY,KAAK,EAAM,IAAU,CAChC,GAAM,CAAE,UAAWoB,EAAoB,UAAS,GAAGC,GAAmBC,IAAoBhB,CAAK,GAAK,CAAC,EAErG,MACE,kBAAC,SAAD,CAEE,aAAY,eAAeA,EAAQ,IACnC,GAAIe,EACJ,KAAK,SACL,YAAU,qBACV,cAAavB,IAAkBQ,GAAe,IAAA,GAC9C,UAAWQ,EACT,6SACAM,CACF,EACA,QAAU,GAAU,CAClBf,EAASC,CAAK,EACdW,IAAUP,CAAK,CACjB,CACD,EAdMa,CAcN,CAEL,CAAC,CACE,CAAA,CAET,C"}
@@ -1,13 +1,11 @@
1
1
  import { t as __name } from "../rolldown-runtime-BhWHdk3m.js";
2
2
  import * as React from "react";
3
3
  import { VariantProps } from "class-variance-authority";
4
- //#region src/components/center.d.ts
5
4
  declare const centerVariants: (props?: ({
6
5
  direction?: "horizontal" | "vertical" | null | undefined;
7
6
  size?: "lg" | "md" | "sm" | "xl" | "xs" | null | undefined;
8
7
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
9
8
  export type CenterProps = React.ComponentProps<'div'> & VariantProps<typeof centerVariants>;
10
9
  declare function Center({ className, direction, size, ...props }: CenterProps): React.JSX.Element;
11
- //#endregion
12
10
  export { Center, centerVariants };
13
11
  //# sourceMappingURL=center.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"center.js","names":["centerVariants","cva","props","direction","size","cn","className"],"sources":["../../src/components/center.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nimport { cn } from '../lib/utils'\n\nconst centerVariants = cva('flex items-center justify-center', {\n variants: {\n direction: {\n horizontal: 'flex-row',\n vertical: 'flex-col'\n },\n size: {\n xs: 'gap-1',\n sm: 'gap-2',\n md: 'gap-3',\n lg: 'gap-4',\n xl: 'gap-6'\n }\n },\n defaultVariants: {\n direction: 'horizontal',\n size: 'md'\n }\n})\n\nexport type CenterProps = React.ComponentProps<'div'> & VariantProps<typeof centerVariants>\n\nfunction Center({ className, direction = 'horizontal', size = 'md', ...props }: CenterProps) {\n return (\n <div\n data-slot=\"center\"\n data-direction={direction}\n data-size={size}\n className={cn(centerVariants({ direction, size }), className)}\n {...props}\n />\n )\n}\n\nexport { Center, centerVariants }\n"],"mappings":"oKAMA,MAAMA,EAAiBC,EAAI,mCAAoC,CAC7D,SAAU,CACR,UAAW,CACT,WAAY,WACZ,SAAU,UACZ,EACA,KAAM,CACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,OACN,CACF,EACA,gBAAiB,CACf,UAAW,aACX,KAAM,IACR,CACF,CAAC,EAID,SAAS,OAAO,CAAE,YAAW,YAAY,aAAc,OAAO,KAAM,GAAGC,GAAsB,CAC3F,MACE,kBAAC,MAAD,CACE,YAAU,SACV,iBAAgBC,EAChB,YAAWC,EACX,UAAWC,EAAGL,EAAe,CAAE,YAAW,MAAK,CAAC,EAAGM,CAAS,EAC5D,GAAIJ,CACL,CAAA,CAEL"}
1
+ {"version":3,"file":"center.js","names":["centerVariants","cva","props","direction","size","cn","className"],"sources":["../../src/components/center.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nimport { cn } from '../lib/utils'\n\nconst centerVariants = cva('flex items-center justify-center', {\n variants: {\n direction: {\n horizontal: 'flex-row',\n vertical: 'flex-col'\n },\n size: {\n xs: 'gap-1',\n sm: 'gap-2',\n md: 'gap-3',\n lg: 'gap-4',\n xl: 'gap-6'\n }\n },\n defaultVariants: {\n direction: 'horizontal',\n size: 'md'\n }\n})\n\nexport type CenterProps = React.ComponentProps<'div'> & VariantProps<typeof centerVariants>\n\nfunction Center({ className, direction = 'horizontal', size = 'md', ...props }: CenterProps) {\n return (\n <div\n data-slot=\"center\"\n data-direction={direction}\n data-size={size}\n className={cn(centerVariants({ direction, size }), className)}\n {...props}\n />\n )\n}\n\nexport { Center, centerVariants }\n"],"mappings":"A,oKAMA,MAAMA,EAAiBC,EAAI,mCAAoC,CAC7D,SAAU,CACR,UAAW,CACT,WAAY,WACZ,SAAU,UACZ,EACA,KAAM,CACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,OACN,CACF,EACA,gBAAiB,CACf,UAAW,aACX,KAAM,IACR,CACF,CAAC,EAID,SAAS,OAAO,CAAE,YAAW,YAAY,aAAc,OAAO,KAAM,GAAGC,GAAsB,CAC3F,MACE,kBAAC,MAAD,CACE,YAAU,SACV,iBAAgBC,EAChB,YAAWC,EACX,UAAWC,EAAGL,EAAe,CAAE,YAAW,MAAK,CAAC,EAAGM,CAAS,EAC5D,GAAIJ,CACL,CAAA,CAEL,C"}
@@ -1,2 +1,2 @@
1
- import { _ as resolveChartColor, a as ChartContainerProps, c as ChartLegendContentProps, d as ChartStyleProps, f as ChartTooltip, g as DEFAULT_CHART_PALETTE, h as ChartTooltipProps, i as ChartContainer, l as ChartLegendProps, m as ChartTooltipContentProps, n as ChartColorKey, o as ChartLegend, p as ChartTooltipContent, r as ChartConfig, s as ChartLegendContent, t as CHART_COLOR_KEYS, u as ChartStyle } from "../chart-B_6nC_ih.js";
1
+ import { _ as resolveChartColor, a as ChartContainerProps, c as ChartLegendContentProps, d as ChartStyleProps, f as ChartTooltip, g as DEFAULT_CHART_PALETTE, h as ChartTooltipProps, i as ChartContainer, l as ChartLegendProps, m as ChartTooltipContentProps, n as ChartColorKey, o as ChartLegend, p as ChartTooltipContent, r as ChartConfig, s as ChartLegendContent, t as CHART_COLOR_KEYS, u as ChartStyle } from "../chart-8rgtsk95.js";
2
2
  export { CHART_COLOR_KEYS, ChartColorKey, ChartConfig, ChartContainer, ChartContainerProps, ChartLegend, ChartLegendContent, ChartLegendContentProps, ChartLegendProps, ChartStyle, ChartStyleProps, ChartTooltip, ChartTooltipContent, ChartTooltipContentProps, ChartTooltipProps, DEFAULT_CHART_PALETTE, resolveChartColor };