@uselets/ui 1.20.4 → 2.0.0

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 (252) hide show
  1. package/README.md +309 -426
  2. package/dist/as-child-Dxg3Xo1G.d.ts +41 -0
  3. package/dist/cli/uselets.mjs +5 -4
  4. package/dist/cli/uselets.mjs.map +1 -1
  5. package/dist/components/accordion.d.ts +12 -8
  6. package/dist/components/accordion.js +1 -1
  7. package/dist/components/accordion.js.map +1 -1
  8. package/dist/components/alert-dialog.d.ts +20 -15
  9. package/dist/components/alert-dialog.js +1 -1
  10. package/dist/components/alert-dialog.js.map +1 -1
  11. package/dist/components/alert.d.ts +1 -1
  12. package/dist/components/anchor.d.ts +3 -5
  13. package/dist/components/anchor.js +1 -1
  14. package/dist/components/anchor.js.map +1 -1
  15. package/dist/components/area-chart.d.ts +54 -0
  16. package/dist/components/area-chart.js +1 -1
  17. package/dist/components/area-chart.js.map +1 -1
  18. package/dist/components/avatar.d.ts +12 -7
  19. package/dist/components/avatar.js +1 -1
  20. package/dist/components/avatar.js.map +1 -1
  21. package/dist/components/badge.d.ts +3 -5
  22. package/dist/components/badge.js +1 -1
  23. package/dist/components/badge.js.map +1 -1
  24. package/dist/components/bar-chart.d.ts +48 -0
  25. package/dist/components/bar-chart.js +1 -1
  26. package/dist/components/bar-chart.js.map +1 -1
  27. package/dist/components/bottom-nav.d.ts +7 -3
  28. package/dist/components/bottom-nav.js +1 -1
  29. package/dist/components/bottom-nav.js.map +1 -1
  30. package/dist/components/breadcrumb.d.ts +3 -4
  31. package/dist/components/breadcrumb.js +1 -1
  32. package/dist/components/breadcrumb.js.map +1 -1
  33. package/dist/components/button-group.d.ts +3 -4
  34. package/dist/components/button-group.js +1 -1
  35. package/dist/components/button-group.js.map +1 -1
  36. package/dist/components/button.d.ts +8 -4
  37. package/dist/components/button.js +1 -1
  38. package/dist/components/button.js.map +1 -1
  39. package/dist/components/calendar.d.ts +4 -0
  40. package/dist/components/calendar.js +1 -1
  41. package/dist/components/calendar.js.map +1 -1
  42. package/dist/components/card.d.ts +4 -0
  43. package/dist/components/card.js.map +1 -1
  44. package/dist/components/carousel.d.ts +11 -3
  45. package/dist/components/carousel.js +1 -1
  46. package/dist/components/carousel.js.map +1 -1
  47. package/dist/components/center.d.ts +1 -1
  48. package/dist/components/chart.js +4 -4
  49. package/dist/components/checkbox.d.ts +14 -4
  50. package/dist/components/checkbox.js +1 -1
  51. package/dist/components/checkbox.js.map +1 -1
  52. package/dist/components/collapsible.d.ts +8 -7
  53. package/dist/components/collapsible.js +1 -1
  54. package/dist/components/collapsible.js.map +1 -1
  55. package/dist/components/combobox.d.ts +48 -26
  56. package/dist/components/combobox.js +1 -1
  57. package/dist/components/combobox.js.map +1 -1
  58. package/dist/components/command.d.ts +16 -2
  59. package/dist/components/command.js +1 -1
  60. package/dist/components/command.js.map +1 -1
  61. package/dist/components/container.d.ts +1 -1
  62. package/dist/components/data-table.d.ts +39 -0
  63. package/dist/components/data-table.js +1 -1
  64. package/dist/components/data-table.js.map +1 -1
  65. package/dist/components/date-range-picker.d.ts +24 -2
  66. package/dist/components/date-range-picker.js +1 -1
  67. package/dist/components/date-range-picker.js.map +1 -1
  68. package/dist/components/dialog.d.ts +33 -15
  69. package/dist/components/dialog.js +1 -1
  70. package/dist/components/dialog.js.map +1 -1
  71. package/dist/components/direction.d.ts +7 -0
  72. package/dist/components/direction.js +1 -0
  73. package/dist/components/donut-chart.d.ts +12 -0
  74. package/dist/components/donut-chart.js +1 -1
  75. package/dist/components/donut-chart.js.map +1 -1
  76. package/dist/components/drawer.d.ts +33 -15
  77. package/dist/components/drawer.js +1 -1
  78. package/dist/components/drawer.js.map +1 -1
  79. package/dist/components/dropdown-menu.d.ts +36 -26
  80. package/dist/components/dropdown-menu.js +1 -1
  81. package/dist/components/dropdown-menu.js.map +1 -1
  82. package/dist/components/dropzone.d.ts +19 -0
  83. package/dist/components/dropzone.js +1 -1
  84. package/dist/components/dropzone.js.map +1 -1
  85. package/dist/components/field.d.ts +16 -4
  86. package/dist/components/field.js +1 -1
  87. package/dist/components/field.js.map +1 -1
  88. package/dist/components/flex.d.ts +1 -1
  89. package/dist/components/grid.d.ts +13 -0
  90. package/dist/components/grid.js.map +1 -1
  91. package/dist/components/group.d.ts +1 -1
  92. package/dist/components/heading.d.ts +3 -5
  93. package/dist/components/heading.js +1 -1
  94. package/dist/components/heading.js.map +1 -1
  95. package/dist/components/hover-card.d.ts +7 -6
  96. package/dist/components/hover-card.js +1 -1
  97. package/dist/components/hover-card.js.map +1 -1
  98. package/dist/components/input-group.d.ts +2 -2
  99. package/dist/components/input-group.js +1 -1
  100. package/dist/components/input-group.js.map +1 -1
  101. package/dist/components/input-otp.d.ts +4 -2
  102. package/dist/components/input-otp.js +1 -1
  103. package/dist/components/input-otp.js.map +1 -1
  104. package/dist/components/input.d.ts +1 -1
  105. package/dist/components/input.js +1 -1
  106. package/dist/components/input.js.map +1 -1
  107. package/dist/components/label.d.ts +3 -4
  108. package/dist/components/label.js +1 -1
  109. package/dist/components/label.js.map +1 -1
  110. package/dist/components/list.d.ts +8 -5
  111. package/dist/components/list.js +1 -1
  112. package/dist/components/list.js.map +1 -1
  113. package/dist/components/logo.d.ts +113 -0
  114. package/dist/components/marker.d.ts +4 -5
  115. package/dist/components/marker.js +1 -1
  116. package/dist/components/marker.js.map +1 -1
  117. package/dist/components/mask-input.d.ts +6 -0
  118. package/dist/components/mask-input.js.map +1 -1
  119. package/dist/components/native-select.d.ts +5 -1
  120. package/dist/components/native-select.js +1 -1
  121. package/dist/components/native-select.js.map +1 -1
  122. package/dist/components/navigation-menu.d.ts +19 -20
  123. package/dist/components/navigation-menu.js +1 -1
  124. package/dist/components/navigation-menu.js.map +1 -1
  125. package/dist/components/number-field.d.ts +18 -13
  126. package/dist/components/number-field.js +1 -1
  127. package/dist/components/number-field.js.map +1 -1
  128. package/dist/components/pagination.d.ts +9 -0
  129. package/dist/components/pagination.js +1 -1
  130. package/dist/components/pagination.js.map +1 -1
  131. package/dist/components/phone-input.d.ts +3 -0
  132. package/dist/components/phone-input.js +1 -1
  133. package/dist/components/phone-input.js.map +1 -1
  134. package/dist/components/pie-chart.d.ts +53 -0
  135. package/dist/components/pie-chart.js +1 -1
  136. package/dist/components/pie-chart.js.map +1 -1
  137. package/dist/components/popover.d.ts +13 -12
  138. package/dist/components/popover.js +1 -1
  139. package/dist/components/popover.js.map +1 -1
  140. package/dist/components/progress.d.ts +9 -3
  141. package/dist/components/progress.js +1 -1
  142. package/dist/components/progress.js.map +1 -1
  143. package/dist/components/radio-group.d.ts +20 -6
  144. package/dist/components/radio-group.js +1 -1
  145. package/dist/components/radio-group.js.map +1 -1
  146. package/dist/components/resizable.d.ts +1 -0
  147. package/dist/components/resizable.js.map +1 -1
  148. package/dist/components/ring-progress.d.ts +9 -1
  149. package/dist/components/ring-progress.js.map +1 -1
  150. package/dist/components/scroll-area.d.ts +3 -3
  151. package/dist/components/scroll-area.js +1 -1
  152. package/dist/components/scroll-area.js.map +1 -1
  153. package/dist/components/select.d.ts +25 -20
  154. package/dist/components/select.js +1 -1
  155. package/dist/components/select.js.map +1 -1
  156. package/dist/components/separator.d.ts +9 -4
  157. package/dist/components/separator.js +1 -1
  158. package/dist/components/separator.js.map +1 -1
  159. package/dist/components/sidebar.d.ts +63 -18
  160. package/dist/components/sidebar.js +1 -1
  161. package/dist/components/sidebar.js.map +1 -1
  162. package/dist/components/simple-grid.d.ts +7 -0
  163. package/dist/components/simple-grid.js +1 -1
  164. package/dist/components/simple-grid.js.map +1 -1
  165. package/dist/components/skeleton.d.ts +4 -0
  166. package/dist/components/skeleton.js.map +1 -1
  167. package/dist/components/slider.d.ts +2 -2
  168. package/dist/components/slider.js +1 -1
  169. package/dist/components/slider.js.map +1 -1
  170. package/dist/components/spinner.d.ts +1 -1
  171. package/dist/components/stack.d.ts +1 -1
  172. package/dist/components/stepper.d.ts +46 -25
  173. package/dist/components/stepper.js +1 -1
  174. package/dist/components/stepper.js.map +1 -1
  175. package/dist/components/switch.d.ts +17 -3
  176. package/dist/components/switch.js +1 -1
  177. package/dist/components/switch.js.map +1 -1
  178. package/dist/components/table.d.ts +10 -1
  179. package/dist/components/table.js +1 -1
  180. package/dist/components/table.js.map +1 -1
  181. package/dist/components/tabs.d.ts +14 -10
  182. package/dist/components/tabs.js +1 -1
  183. package/dist/components/tabs.js.map +1 -1
  184. package/dist/components/text.d.ts +3 -5
  185. package/dist/components/text.js +1 -1
  186. package/dist/components/text.js.map +1 -1
  187. package/dist/components/textarea.d.ts +1 -1
  188. package/dist/components/textarea.js +1 -1
  189. package/dist/components/textarea.js.map +1 -1
  190. package/dist/components/theme.d.ts +12 -0
  191. package/dist/components/theme.js +1 -1
  192. package/dist/components/theme.js.map +1 -1
  193. package/dist/components/timeline.d.ts +25 -1
  194. package/dist/components/timeline.js +1 -1
  195. package/dist/components/timeline.js.map +1 -1
  196. package/dist/components/toggle-group.d.ts +16 -6
  197. package/dist/components/toggle-group.js +1 -1
  198. package/dist/components/toggle-group.js.map +1 -1
  199. package/dist/components/toggle.d.ts +4 -4
  200. package/dist/components/toggle.js +1 -1
  201. package/dist/components/toggle.js.map +1 -1
  202. package/dist/components/tooltip.d.ts +15 -8
  203. package/dist/components/tooltip.js +1 -1
  204. package/dist/components/tooltip.js.map +1 -1
  205. package/dist/components/unstyled-button.d.ts +3 -5
  206. package/dist/components/unstyled-button.js +1 -1
  207. package/dist/components/unstyled-button.js.map +1 -1
  208. package/dist/components/visibility.d.ts +2 -0
  209. package/dist/components/visibility.js +1 -1
  210. package/dist/components/visibility.js.map +1 -1
  211. package/dist/hooks/use-breakpoint-value.d.ts +1 -0
  212. package/dist/hooks/use-breakpoint-value.js.map +1 -1
  213. package/dist/hooks/use-breakpoint.d.ts +1 -0
  214. package/dist/hooks/use-breakpoint.js.map +1 -1
  215. package/dist/hooks/use-disclosure.d.ts +3 -0
  216. package/dist/hooks/use-disclosure.js +1 -1
  217. package/dist/hooks/use-disclosure.js.map +1 -1
  218. package/dist/hooks/use-document-visibility.d.ts +1 -0
  219. package/dist/hooks/use-document-visibility.js.map +1 -1
  220. package/dist/hooks/use-hotkeys.d.ts +1 -1
  221. package/dist/hooks/use-idle.d.ts +9 -0
  222. package/dist/hooks/use-idle.js.map +1 -1
  223. package/dist/hooks/use-interval.d.ts +1 -0
  224. package/dist/hooks/use-interval.js.map +1 -1
  225. package/dist/hooks/use-local-storage.d.ts +6 -0
  226. package/dist/hooks/use-local-storage.js +1 -1
  227. package/dist/hooks/use-local-storage.js.map +1 -1
  228. package/dist/hooks/use-mask.d.ts +1 -0
  229. package/dist/hooks/use-mask.js.map +1 -1
  230. package/dist/hooks/use-mobile.d.ts +1 -0
  231. package/dist/hooks/use-mobile.js.map +1 -1
  232. package/dist/index.d.ts +7 -5
  233. package/dist/index.js +1 -1
  234. package/dist/lib/as-child.d.ts +2 -0
  235. package/dist/lib/as-child.js +2 -0
  236. package/dist/lib/as-child.js.map +1 -0
  237. package/dist/lib/utils.d.ts +1 -1
  238. package/dist/logo--R3_XDgA.js.map +1 -1
  239. package/dist/resolve-class-name-BurP8ngI.js +2 -0
  240. package/dist/resolve-class-name-BurP8ngI.js.map +1 -0
  241. package/dist/skills/uselets-ui/SKILL.md +8 -3
  242. package/dist/skills/uselets-ui/references/component-catalog.md +31 -16
  243. package/dist/skills/uselets-ui/references/migration-v1-to-v2.md +599 -0
  244. package/dist/skills/uselets-ui/references/package-guide.md +7 -7
  245. package/dist/styles/base.css +21 -0
  246. package/dist/{use-hotkeys-DOjcX9Tt.d.ts → use-hotkeys-D1_TEIwN.d.ts} +2 -1
  247. package/dist/use-hotkeys-YDJmGWX6.js.map +1 -1
  248. package/package.json +16 -17
  249. package/skills/uselets-ui/SKILL.md +8 -3
  250. package/skills/uselets-ui/references/component-catalog.md +31 -16
  251. package/skills/uselets-ui/references/migration-v1-to-v2.md +599 -0
  252. package/skills/uselets-ui/references/package-guide.md +7 -7
@@ -1,2 +1,2 @@
1
- import"../rolldown-runtime-BhWHdk3m.js";import{cn as e}from"../lib/utils.js";import{ChartContainer as t,ChartLegendContent as n,ChartTooltipContent as r,DEFAULT_CHART_PALETTE as i,resolveChartColor as a}from"./chart.js";import{jsx as o,jsxs as s}from"react/jsx-runtime";import*as c from"react";import{Area as l,AreaChart as u,CartesianGrid as d,Legend as f,Tooltip as p,XAxis as m,YAxis as h}from"recharts";function buildConfig(e){return e.reduce((e,t,n)=>(e[t.name]={label:t.label??t.name,color:t.color??a(t.colorKey)??i[n%i.length]},e),{})}function AreaChart({className:i,data:a,series:g,dataKey:_,type:v=`default`,curveType:y=`monotone`,withXAxis:b=!0,withYAxis:x=!0,gridAxis:S=`x`,withDots:C=!1,withTooltip:w=!0,withLegend:T=!1,connectNulls:E,unit:D,fillOpacity:O=.2,strokeWidth:k=2,animationDuration:A,tooltipProps:j,legendProps:M,areaProps:N,areaChartProps:P,...F}){let I=c.useMemo(()=>buildConfig(g),[g]),L=v==="default"?void 0:`stack`,R=v===`percent`?`expand`:v===`split`?`silhouette`:void 0;return/* @__PURE__ */ o(t,{"data-slot":`area-chart`,className:e(`w-full`,i),config:I,...F,children:/* @__PURE__ */ s(u,{...P,data:a,stackOffset:R,children:[S!==`none`&&/* @__PURE__ */ o(d,{vertical:S===`y`||S===`xy`,horizontal:S===`x`||S===`xy`}),b&&/* @__PURE__ */ o(m,{dataKey:_,tickLine:!1,axisLine:!1,tickMargin:8}),x&&/* @__PURE__ */ o(h,{tickLine:!1,axisLine:!1,tickMargin:8,tickFormatter:v===`percent`?e=>`${Math.round(e*100)}%`:D?e=>`${e}${D}`:void 0}),w&&/* @__PURE__ */ o(p,{cursor:!1,content:/* @__PURE__ */ o(r,{...j})}),T&&/* @__PURE__ */ o(f,{content:/* @__PURE__ */ o(n,{...M})}),g.map(e=>/* @__PURE__ */ o(l,{type:y,dataKey:e.name,stackId:L,stroke:I[e.name]?.color,fill:I[e.name]?.color,fillOpacity:O,strokeWidth:k,dot:C,connectNulls:E,animationDuration:A,isAnimationActive:A!==0,...N},e.name))]})})}export{AreaChart};
1
+ import"../rolldown-runtime-BhWHdk3m.js";import{cn as e}from"../lib/utils.js";import{ChartContainer as t,ChartLegendContent as n,ChartTooltipContent as r,DEFAULT_CHART_PALETTE as i,resolveChartColor as a}from"./chart.js";import*as o from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";import{Area as l,AreaChart as u,CartesianGrid as d,Legend as f,Tooltip as p,XAxis as m,YAxis as h}from"recharts";function buildConfig(e){return e.reduce((e,t,n)=>(e[t.name]={label:t.label??t.name,color:t.color??a(t.colorKey)??i[n%i.length]},e),{})}function AreaChart({className:i,data:a,series:g,dataKey:_,type:v=`default`,curveType:y=`monotone`,withXAxis:b=!0,withYAxis:x=!0,gridAxis:S=`x`,withDots:C=!1,withTooltip:w=!0,withLegend:T=!1,connectNulls:E,unit:D,fillOpacity:O=.2,strokeWidth:k=2,animationDuration:A,tooltipProps:j,legendProps:M,areaProps:N,areaChartProps:P,...F}){let I=o.useMemo(()=>buildConfig(g),[g]),L=v==="default"?void 0:`stack`,R=v===`percent`?`expand`:v===`split`?`silhouette`:void 0;return/* @__PURE__ */ s(t,{"data-slot":`area-chart`,className:e(`w-full`,i),config:I,...F,children:/* @__PURE__ */ c(u,{...P,data:a,stackOffset:R,children:[S!==`none`&&/* @__PURE__ */ s(d,{vertical:S===`y`||S===`xy`,horizontal:S===`x`||S===`xy`}),b&&/* @__PURE__ */ s(m,{dataKey:_,tickLine:!1,axisLine:!1,tickMargin:8}),x&&/* @__PURE__ */ s(h,{tickLine:!1,axisLine:!1,tickMargin:8,tickFormatter:v===`percent`?e=>`${Math.round(e*100)}%`:D?e=>`${e}${D}`:void 0}),w&&/* @__PURE__ */ s(p,{cursor:!1,content:/* @__PURE__ */ s(r,{...j})}),T&&/* @__PURE__ */ s(f,{content:/* @__PURE__ */ s(n,{...M})}),g.map(e=>/* @__PURE__ */ s(l,{type:y,dataKey:e.name,stackId:L,stroke:I[e.name]?.color,fill:I[e.name]?.color,fillOpacity:O,strokeWidth:k,dot:C,connectNulls:E,animationDuration:A,isAnimationActive:A!==0,...N},e.name))]})})}export{AreaChart};
2
2
  //# sourceMappingURL=area-chart.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"area-chart.js","names":["RechartsAreaChart","React","AreaChart$1","series","item","resolveChartColor","DEFAULT_CHART_PALETTE","index","acc","props","config","stackId","type","stackOffset","ChartContainer","cn","className","areaChartProps","gridAxis","CartesianGrid","withXAxis","XAxis","withYAxis","YAxis","value","unit","withTooltip","Tooltip","ChartTooltipContent","tooltipProps","withLegend","Legend","ChartLegendContent","legendProps","Area","curveType","withDots","animationDuration","areaProps"],"sources":["../../src/components/area-chart.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { Area, CartesianGrid, Legend, AreaChart as RechartsAreaChart, 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 AreaChartSeries = {\n name: string\n label?: string\n color?: string\n colorKey?: ChartColorKey\n}\n\nexport type AreaChartType = 'default' | 'stacked' | 'percent' | 'split'\nexport type AreaChartCurveType = 'linear' | 'monotone' | 'natural' | 'step' | 'bump' | 'stepAfter' | 'stepBefore'\nexport type AreaChartGridAxis = 'none' | 'x' | 'y' | 'xy'\n\nexport type AreaChartProps = Omit<React.ComponentProps<'div'>, 'children'> & {\n data: Array<Record<string, unknown>>\n series: AreaChartSeries[]\n dataKey: string\n type?: AreaChartType\n curveType?: AreaChartCurveType\n withXAxis?: boolean\n withYAxis?: boolean\n gridAxis?: AreaChartGridAxis\n withDots?: boolean\n withTooltip?: boolean\n withLegend?: boolean\n connectNulls?: boolean\n unit?: string\n fillOpacity?: number\n strokeWidth?: number\n animationDuration?: number\n tooltipProps?: ChartTooltipContentProps\n legendProps?: ChartLegendContentProps\n areaProps?: Partial<React.ComponentProps<typeof Area>>\n areaChartProps?: Omit<React.ComponentProps<typeof RechartsAreaChart>, 'data' | 'stackOffset'>\n}\n\nfunction buildConfig(series: AreaChartSeries[]): 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 AreaChart({\n className,\n data,\n series,\n dataKey,\n type = 'default',\n curveType = 'monotone',\n withXAxis = true,\n withYAxis = true,\n gridAxis = 'x',\n withDots = false,\n withTooltip = true,\n withLegend = false,\n connectNulls,\n unit,\n fillOpacity = 0.2,\n strokeWidth = 2,\n animationDuration,\n tooltipProps,\n legendProps,\n areaProps,\n areaChartProps,\n ...props\n}: AreaChartProps) {\n const config = React.useMemo(() => buildConfig(series), [series])\n const stackId = type === 'default' ? undefined : 'stack'\n const stackOffset = type === 'percent' ? 'expand' : type === 'split' ? 'silhouette' : undefined\n\n return (\n <ChartContainer data-slot=\"area-chart\" className={cn('w-full', className)} config={config} {...props}>\n <RechartsAreaChart {...areaChartProps} data={data} stackOffset={stackOffset}>\n {gridAxis !== 'none' && (\n <CartesianGrid\n vertical={gridAxis === 'y' || gridAxis === 'xy'}\n horizontal={gridAxis === 'x' || gridAxis === 'xy'}\n />\n )}\n {withXAxis && <XAxis dataKey={dataKey} tickLine={false} axisLine={false} tickMargin={8} />}\n {withYAxis && (\n <YAxis\n tickLine={false}\n axisLine={false}\n tickMargin={8}\n tickFormatter={\n type === 'percent'\n ? (value: number) => `${Math.round(value * 100)}%`\n : unit\n ? (value) => `${value}${unit}`\n : undefined\n }\n />\n )}\n {withTooltip && <Tooltip cursor={false} content={<ChartTooltipContent {...tooltipProps} />} />}\n {withLegend && <Legend content={<ChartLegendContent {...legendProps} />} />}\n {series.map((item) => (\n <Area\n key={item.name}\n type={curveType}\n dataKey={item.name}\n stackId={stackId}\n stroke={config[item.name]?.color}\n fill={config[item.name]?.color}\n fillOpacity={fillOpacity}\n strokeWidth={strokeWidth}\n dot={withDots}\n connectNulls={connectNulls}\n animationDuration={animationDuration}\n isAnimationActive={animationDuration !== 0}\n {...areaProps}\n />\n ))}\n </RechartsAreaChart>\n </ChartContainer>\n )\n}\n\nexport { AreaChart }\n"],"mappings":"uZAmDA,SAAS,YAAY,EAAwC,CAC3D,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,UAAU,CACjB,YACA,OACA,SACA,UACA,OAAO,UACP,YAAY,WACZ,YAAY,GACZ,YAAY,GACZ,WAAW,IACX,WAAW,GACX,cAAc,GACd,aAAa,GACb,eACA,OACA,cAAc,GACd,cAAc,EACd,oBACA,eACA,cACA,YACA,iBACA,GAAGC,GACc,CACjB,IAAMC,EAAST,EAAM,YAAc,YAAYE,CAAM,EAAG,CAACA,CAAM,CAAC,EAC1DQ,EAAUC,IAAS,UAAY,IAAA,GAAY,QAC3CC,EAAcD,IAAS,UAAY,SAAWA,IAAS,QAAU,aAAe,IAAA,GAEtF,MACE,kBAACE,EAAD,CAAgB,YAAU,aAAa,UAAWC,EAAG,SAAUC,CAAS,EAAW,SAAQ,GAAIP,EAC7F,SAAA,kBAACT,EAAD,CAAmB,GAAIiB,EAAsB,OAAmB,cAAhE,SAAA,CACGC,IAAa,QACZ,kBAACC,EAAD,CACE,SAAUD,IAAa,KAAOA,IAAa,KAC3C,WAAYA,IAAa,KAAOA,IAAa,IAC9C,CAAA,EAEFE,GAAa,kBAACC,EAAD,CAAgB,UAAS,SAAU,GAAO,SAAU,GAAO,WAAY,CAAI,CAAA,EACxFC,GACC,kBAACC,EAAD,CACE,SAAU,GACV,SAAU,GACV,WAAY,EACZ,cACEX,IAAS,UACJ,GAAkB,GAAG,KAAK,MAAMY,EAAQ,GAAG,EAAE,GAC9CC,EACG,GAAU,GAAGD,IAAQC,IACtB,IAAA,EAET,CAAA,EAEFC,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,EACzE9B,EAAO,IAAK,GACX,kBAAC+B,EAAD,CAEE,KAAMC,EACN,QAAS/B,EAAK,KACL,UACT,OAAQM,EAAON,EAAK,KAAK,EAAE,MAC3B,KAAMM,EAAON,EAAK,KAAK,EAAE,MACZ,cACA,cACb,IAAKgC,EACS,eACK,oBACnB,kBAAmBC,IAAsB,EACzC,GAAIC,CACL,EAbMlC,EAAK,IAaX,CACF,CACgB,GACL,CAAA,CAEpB"}
1
+ {"version":3,"file":"area-chart.js","names":["RechartsAreaChart","React","AreaChart$1","series","item","resolveChartColor","DEFAULT_CHART_PALETTE","index","acc","props","config","stackId","type","stackOffset","ChartContainer","cn","className","areaChartProps","gridAxis","CartesianGrid","withXAxis","XAxis","withYAxis","YAxis","value","unit","withTooltip","Tooltip","ChartTooltipContent","tooltipProps","withLegend","Legend","ChartLegendContent","legendProps","Area","curveType","withDots","animationDuration","areaProps"],"sources":["../../src/components/area-chart.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { Area, CartesianGrid, Legend, AreaChart as RechartsAreaChart, 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 AreaChartSeries = {\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 AreaChartType = 'default' | 'stacked' | 'percent' | 'split'\nexport type AreaChartCurveType = 'linear' | 'monotone' | 'natural' | 'step' | 'bump' | 'stepAfter' | 'stepBefore'\nexport type AreaChartGridAxis = 'none' | 'x' | 'y' | 'xy'\n\nexport type AreaChartProps = Omit<React.ComponentProps<'div'>, 'children'> & {\n /** Rows to plot. */\n data: Array<Record<string, unknown>>\n /** Series to draw, one per field of `data`. */\n series: AreaChartSeries[]\n /** Field of `data` used for the categories axis. */\n dataKey: string\n /**\n * `stacked` stacks the series, `percent` stacks them to 100%, `split` stacks them around a center line.\n * @default 'default'\n */\n type?: AreaChartType\n /**\n * Shape of the lines between points.\n * @default 'monotone'\n */\n curveType?: AreaChartCurveType\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?: AreaChartGridAxis\n /**\n * Draws a dot on each point.\n * @default false\n */\n withDots?: boolean\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 /** Connects the line across missing values. */\n connectNulls?: boolean\n /** Appended to the axis and tooltip values. */\n unit?: string\n /**\n * Opacity of the area fill.\n * @default 0.2\n */\n fillOpacity?: number\n /**\n * Width of the lines.\n * @default 2\n */\n strokeWidth?: number\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 `<Area>`. */\n areaProps?: Partial<React.ComponentProps<typeof Area>>\n /** Props for the Recharts `<AreaChart>`. */\n areaChartProps?: Omit<React.ComponentProps<typeof RechartsAreaChart>, 'data' | 'stackOffset'>\n}\n\nfunction buildConfig(series: AreaChartSeries[]): 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 AreaChart({\n className,\n data,\n series,\n dataKey,\n type = 'default',\n curveType = 'monotone',\n withXAxis = true,\n withYAxis = true,\n gridAxis = 'x',\n withDots = false,\n withTooltip = true,\n withLegend = false,\n connectNulls,\n unit,\n fillOpacity = 0.2,\n strokeWidth = 2,\n animationDuration,\n tooltipProps,\n legendProps,\n areaProps,\n areaChartProps,\n ...props\n}: AreaChartProps) {\n const config = React.useMemo(() => buildConfig(series), [series])\n const stackId = type === 'default' ? undefined : 'stack'\n const stackOffset = type === 'percent' ? 'expand' : type === 'split' ? 'silhouette' : undefined\n\n return (\n <ChartContainer data-slot=\"area-chart\" className={cn('w-full', className)} config={config} {...props}>\n <RechartsAreaChart {...areaChartProps} data={data} stackOffset={stackOffset}>\n {gridAxis !== 'none' && (\n <CartesianGrid\n vertical={gridAxis === 'y' || gridAxis === 'xy'}\n horizontal={gridAxis === 'x' || gridAxis === 'xy'}\n />\n )}\n {withXAxis && <XAxis dataKey={dataKey} tickLine={false} axisLine={false} tickMargin={8} />}\n {withYAxis && (\n <YAxis\n tickLine={false}\n axisLine={false}\n tickMargin={8}\n tickFormatter={\n type === 'percent'\n ? (value: number) => `${Math.round(value * 100)}%`\n : unit\n ? (value) => `${value}${unit}`\n : undefined\n }\n />\n )}\n {withTooltip && <Tooltip cursor={false} content={<ChartTooltipContent {...tooltipProps} />} />}\n {withLegend && <Legend content={<ChartLegendContent {...legendProps} />} />}\n {series.map((item) => (\n <Area\n key={item.name}\n type={curveType}\n dataKey={item.name}\n stackId={stackId}\n stroke={config[item.name]?.color}\n fill={config[item.name]?.color}\n fillOpacity={fillOpacity}\n strokeWidth={strokeWidth}\n dot={withDots}\n connectNulls={connectNulls}\n animationDuration={animationDuration}\n isAnimationActive={animationDuration !== 0}\n {...areaProps}\n />\n ))}\n </RechartsAreaChart>\n </ChartContainer>\n )\n}\n\nexport { AreaChart }\n"],"mappings":"uZAyGA,SAAS,YAAY,EAAwC,CAC3D,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,UAAU,CACjB,YACA,OACA,SACA,UACA,OAAO,UACP,YAAY,WACZ,YAAY,GACZ,YAAY,GACZ,WAAW,IACX,WAAW,GACX,cAAc,GACd,aAAa,GACb,eACA,OACA,cAAc,GACd,cAAc,EACd,oBACA,eACA,cACA,YACA,iBACA,GAAGC,GACc,CACjB,IAAMC,EAAST,EAAM,YAAc,YAAYE,CAAM,EAAG,CAACA,CAAM,CAAC,EAC1DQ,EAAUC,IAAS,UAAY,IAAA,GAAY,QAC3CC,EAAcD,IAAS,UAAY,SAAWA,IAAS,QAAU,aAAe,IAAA,GAEtF,MACE,kBAACE,EAAD,CAAgB,YAAU,aAAa,UAAWC,EAAG,SAAUC,CAAS,EAAW,SAAQ,GAAIP,EAC7F,SAAA,kBAACT,EAAD,CAAmB,GAAIiB,EAAsB,OAAmB,cAAhE,SAAA,CACGC,IAAa,QACZ,kBAACC,EAAD,CACE,SAAUD,IAAa,KAAOA,IAAa,KAC3C,WAAYA,IAAa,KAAOA,IAAa,IAC9C,CAAA,EAEFE,GAAa,kBAACC,EAAD,CAAgB,UAAS,SAAU,GAAO,SAAU,GAAO,WAAY,CAAI,CAAA,EACxFC,GACC,kBAACC,EAAD,CACE,SAAU,GACV,SAAU,GACV,WAAY,EACZ,cACEX,IAAS,UACJ,GAAkB,GAAG,KAAK,MAAMY,EAAQ,GAAG,EAAE,GAC9CC,EACG,GAAU,GAAGD,IAAQC,IACtB,IAAA,EAET,CAAA,EAEFC,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,EACzE9B,EAAO,IAAK,GACX,kBAAC+B,EAAD,CAEE,KAAMC,EACN,QAAS/B,EAAK,KACL,UACT,OAAQM,EAAON,EAAK,KAAK,EAAE,MAC3B,KAAMM,EAAON,EAAK,KAAK,EAAE,MACZ,cACA,cACb,IAAKgC,EACS,eACK,oBACnB,kBAAmBC,IAAsB,EACzC,GAAIC,CACL,EAbMlC,EAAK,IAaX,CACF,CACgB,GACL,CAAA,CAEpB"}
@@ -1,18 +1,23 @@
1
1
  import { t as __name } from "../rolldown-runtime-BhWHdk3m.js";
2
- import { Avatar as Avatar$1 } from "radix-ui";
2
+ import { t as AsChildPrimitiveProps } from "../as-child-Dxg3Xo1G.js";
3
3
  import * as React from "react";
4
+ import { Avatar as Avatar$1 } from "@base-ui/react/avatar";
4
5
  //#region src/components/avatar.d.ts
5
- export type AvatarProps = React.ComponentProps<typeof Avatar$1.Root> & {
6
+ export type AvatarProps = AsChildPrimitiveProps<typeof Avatar$1.Root> & {
7
+ /**
8
+ * Avatar size.
9
+ * @default 'md'
10
+ */
6
11
  size?: 'sm' | 'md' | 'lg';
7
12
  };
8
- export type AvatarImageProps = React.ComponentProps<typeof Avatar$1.Image>;
9
- export type AvatarFallbackProps = React.ComponentProps<typeof Avatar$1.Fallback>;
13
+ export type AvatarImageProps = AsChildPrimitiveProps<typeof Avatar$1.Image>;
14
+ export type AvatarFallbackProps = AsChildPrimitiveProps<typeof Avatar$1.Fallback>;
10
15
  export type AvatarBadgeProps = React.ComponentProps<'span'>;
11
16
  export type AvatarGroupProps = React.ComponentProps<'div'>;
12
17
  export type AvatarGroupCountProps = React.ComponentProps<'div'>;
13
- declare function Avatar({ className, size, ...props }: AvatarProps): React.JSX.Element;
14
- declare function AvatarImage({ className, ...props }: AvatarImageProps): React.JSX.Element;
15
- declare function AvatarFallback({ className, ...props }: AvatarFallbackProps): React.JSX.Element;
18
+ declare function Avatar({ className, size, asChild, children, ...props }: AvatarProps): React.JSX.Element;
19
+ declare function AvatarImage({ className, asChild, children, ...props }: AvatarImageProps): React.JSX.Element;
20
+ declare function AvatarFallback({ className, asChild, children, ...props }: AvatarFallbackProps): React.JSX.Element;
16
21
  declare function AvatarBadge({ className, ...props }: AvatarBadgeProps): React.JSX.Element;
17
22
  declare function AvatarGroup({ className, ...props }: AvatarGroupProps): React.JSX.Element;
18
23
  declare function AvatarGroupCount({ className, ...props }: AvatarGroupCountProps): React.JSX.Element;
@@ -1,2 +1,2 @@
1
- import"../rolldown-runtime-BhWHdk3m.js";import{cn as e}from"../lib/utils.js";import{Avatar as t}from"radix-ui";import{jsx as n}from"react/jsx-runtime";function Avatar({className:r,size:i=`md`,...a}){return/* @__PURE__ */ n(t.Root,{"data-slot":`avatar`,"data-size":i,className:e(`group/avatar relative flex shrink-0 size-8 rounded-full select-none`,`data-[size=lg]:size-10 data-[size=sm]:size-6`,`after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken dark:after:mix-blend-lighten`,r),...a})}function AvatarImage({className:r,...i}){return/* @__PURE__ */ n(t.Image,{"data-slot":`avatar-image`,className:e(`rounded-full aspect-square size-full object-cover`,r),...i})}function AvatarFallback({className:r,...i}){return/* @__PURE__ */ n(t.Fallback,{"data-slot":`avatar-fallback`,className:e(`bg-muted text-muted-foreground rounded-full flex size-full items-center justify-center text-sm group-data-[size=sm]/avatar:text-xs`,r),...i})}function AvatarBadge({className:t,...r}){return/* @__PURE__ */ n(`span`,{"data-slot":`avatar-badge`,className:e(`bg-primary text-primary-foreground ring-background absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full bg-blend-color ring-2 select-none`,`group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden`,`group-data-[size=md]/avatar:size-2.5 group-data-[size=md]/avatar:[&>svg]:size-2`,`group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2`,t),...r})}function AvatarGroup({className:t,...r}){return/* @__PURE__ */ n(`div`,{"data-slot":`avatar-group`,className:e(`*:data-[slot=avatar]:ring-background group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2`,t),...r})}function AvatarGroupCount({className:t,...r}){return/* @__PURE__ */ n(`div`,{"data-slot":`avatar-group-count`,className:e(`bg-muted text-muted-foreground ring-background relative flex shrink-0 items-center justify-center size-8 rounded-full text-sm ring-2`,`group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6`,`[&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3`,t),...r})}export{Avatar,AvatarBadge,AvatarFallback,AvatarGroup,AvatarGroupCount,AvatarImage};
1
+ import"../rolldown-runtime-BhWHdk3m.js";import{toAsChildRenderProps as e}from"../lib/as-child.js";import{cn as t}from"../lib/utils.js";import{t as n}from"../resolve-class-name-BurP8ngI.js";import{jsx as r}from"react/jsx-runtime";import{Avatar as i}from"@base-ui/react/avatar";function Avatar({className:a,size:o=`md`,asChild:s,children:c,...l}){return/* @__PURE__ */ r(i.Root,{"data-slot":`avatar`,"data-size":o,className:e=>t(`group/avatar relative flex shrink-0 size-8 rounded-full select-none`,`data-[size=lg]:size-10 data-[size=sm]:size-6`,`after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken dark:after:mix-blend-lighten`,n(a,e)),...l,...e(s,c)})}function AvatarImage({className:a,asChild:o,children:s,...c}){return/* @__PURE__ */ r(i.Image,{"data-slot":`avatar-image`,className:e=>t(`rounded-full aspect-square size-full object-cover`,n(a,e)),...c,...e(o,s)})}function AvatarFallback({className:a,asChild:o,children:s,...c}){return/* @__PURE__ */ r(i.Fallback,{"data-slot":`avatar-fallback`,className:e=>t(`bg-muted text-muted-foreground rounded-full flex size-full items-center justify-center text-sm group-data-[size=sm]/avatar:text-xs`,n(a,e)),...c,...e(o,s)})}function AvatarBadge({className:e,...n}){return/* @__PURE__ */ r(`span`,{"data-slot":`avatar-badge`,className:t(`bg-primary text-primary-foreground ring-background absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full bg-blend-color ring-2 select-none`,`group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden`,`group-data-[size=md]/avatar:size-2.5 group-data-[size=md]/avatar:[&>svg]:size-2`,`group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2`,e),...n})}function AvatarGroup({className:e,...n}){return/* @__PURE__ */ r(`div`,{"data-slot":`avatar-group`,className:t(`*:data-[slot=avatar]:ring-background group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2`,e),...n})}function AvatarGroupCount({className:e,...n}){return/* @__PURE__ */ r(`div`,{"data-slot":`avatar-group-count`,className:t(`bg-muted text-muted-foreground ring-background relative flex shrink-0 items-center justify-center size-8 rounded-full text-sm ring-2`,`group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6`,`[&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3`,e),...n})}export{Avatar,AvatarBadge,AvatarFallback,AvatarGroup,AvatarGroupCount,AvatarImage};
2
2
  //# sourceMappingURL=avatar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"avatar.js","names":["AvatarPrimitive","Avatar$1","props","size","cn","className"],"sources":["../../src/components/avatar.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { Avatar as AvatarPrimitive } from 'radix-ui'\n\nimport { cn } from '../lib/utils'\n\nexport type AvatarProps = React.ComponentProps<typeof AvatarPrimitive.Root> & {\n size?: 'sm' | 'md' | 'lg'\n}\n\nexport type AvatarImageProps = React.ComponentProps<typeof AvatarPrimitive.Image>\n\nexport type AvatarFallbackProps = React.ComponentProps<typeof AvatarPrimitive.Fallback>\n\nexport type AvatarBadgeProps = React.ComponentProps<'span'>\n\nexport type AvatarGroupProps = React.ComponentProps<'div'>\n\nexport type AvatarGroupCountProps = React.ComponentProps<'div'>\n\nfunction Avatar({ className, size = 'md', ...props }: AvatarProps) {\n return (\n <AvatarPrimitive.Root\n data-slot=\"avatar\"\n data-size={size}\n className={cn(\n 'group/avatar relative flex shrink-0 size-8 rounded-full select-none',\n 'data-[size=lg]:size-10 data-[size=sm]:size-6',\n 'after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken dark:after:mix-blend-lighten',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AvatarImage({ className, ...props }: AvatarImageProps) {\n return (\n <AvatarPrimitive.Image\n data-slot=\"avatar-image\"\n className={cn('rounded-full aspect-square size-full object-cover', className)}\n {...props}\n />\n )\n}\n\nfunction AvatarFallback({ className, ...props }: AvatarFallbackProps) {\n return (\n <AvatarPrimitive.Fallback\n data-slot=\"avatar-fallback\"\n className={cn(\n 'bg-muted text-muted-foreground rounded-full flex size-full items-center justify-center text-sm group-data-[size=sm]/avatar:text-xs',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AvatarBadge({ className, ...props }: AvatarBadgeProps) {\n return (\n <span\n data-slot=\"avatar-badge\"\n className={cn(\n 'bg-primary text-primary-foreground ring-background absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full bg-blend-color ring-2 select-none',\n 'group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden',\n 'group-data-[size=md]/avatar:size-2.5 group-data-[size=md]/avatar:[&>svg]:size-2',\n 'group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AvatarGroup({ className, ...props }: AvatarGroupProps) {\n return (\n <div\n data-slot=\"avatar-group\"\n className={cn(\n '*:data-[slot=avatar]:ring-background group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AvatarGroupCount({ className, ...props }: AvatarGroupCountProps) {\n return (\n <div\n data-slot=\"avatar-group-count\"\n className={cn(\n 'bg-muted text-muted-foreground ring-background relative flex shrink-0 items-center justify-center size-8 rounded-full text-sm ring-2',\n 'group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6',\n '[&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3',\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage }\n"],"mappings":"uJAoBA,SAAS,OAAO,CAAE,YAAW,OAAO,KAAM,GAAGE,GAAsB,CACjE,MACE,kBAACF,EAAgB,KAAjB,CACE,YAAU,SACV,YAAWG,EACX,UAAWC,EACT,sEACA,+CACA,uIACAC,CACF,EACA,GAAIH,CACL,CAAA,CAEL,CAEA,SAAS,YAAY,CAAE,YAAW,GAAGA,GAA2B,CAC9D,MACE,kBAACF,EAAgB,MAAjB,CACE,YAAU,eACV,UAAWI,EAAG,oDAAqDC,CAAS,EAC5E,GAAIH,CACL,CAAA,CAEL,CAEA,SAAS,eAAe,CAAE,YAAW,GAAGA,GAA8B,CACpE,MACE,kBAACF,EAAgB,SAAjB,CACE,YAAU,kBACV,UAAWI,EACT,qIACAC,CACF,EACA,GAAIH,CACL,CAAA,CAEL,CAEA,SAAS,YAAY,CAAE,YAAW,GAAGA,GAA2B,CAC9D,MACE,kBAAC,OAAD,CACE,YAAU,eACV,UAAWE,EACT,2KACA,gFACA,kFACA,gFACAC,CACF,EACA,GAAIH,CACL,CAAA,CAEL,CAEA,SAAS,YAAY,CAAE,YAAW,GAAGA,GAA2B,CAC9D,MACE,kBAAC,MAAD,CACE,YAAU,eACV,UAAWE,EACT,sGACAC,CACF,EACA,GAAIH,CACL,CAAA,CAEL,CAEA,SAAS,iBAAiB,CAAE,YAAW,GAAGA,GAAgC,CACxE,MACE,kBAAC,MAAD,CACE,YAAU,qBACV,UAAWE,EACT,uIACA,6FACA,2HACAC,CACF,EACA,GAAIH,CACL,CAAA,CAEL"}
1
+ {"version":3,"file":"avatar.js","names":["AvatarPrimitive","resolveClassName","Avatar$1","props","size","cn","className","state","toAsChildRenderProps","asChild","children"],"sources":["../../src/components/avatar.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { Avatar as AvatarPrimitive } from '@base-ui/react/avatar'\n\nimport { type AsChildPrimitiveProps, toAsChildRenderProps } from '../lib/as-child'\nimport { cn } from '../lib/utils'\nimport { resolveClassName } from '../utils/resolve-class-name'\n\nexport type AvatarProps = AsChildPrimitiveProps<typeof AvatarPrimitive.Root> & {\n /**\n * Avatar size.\n * @default 'md'\n */\n size?: 'sm' | 'md' | 'lg'\n}\n\nexport type AvatarImageProps = AsChildPrimitiveProps<typeof AvatarPrimitive.Image>\n\nexport type AvatarFallbackProps = AsChildPrimitiveProps<typeof AvatarPrimitive.Fallback>\n\nexport type AvatarBadgeProps = React.ComponentProps<'span'>\n\nexport type AvatarGroupProps = React.ComponentProps<'div'>\n\nexport type AvatarGroupCountProps = React.ComponentProps<'div'>\n\nfunction Avatar({ className, size = 'md', asChild, children, ...props }: AvatarProps) {\n return (\n <AvatarPrimitive.Root\n data-slot=\"avatar\"\n data-size={size}\n className={(state) =>\n cn(\n 'group/avatar relative flex shrink-0 size-8 rounded-full select-none',\n 'data-[size=lg]:size-10 data-[size=sm]:size-6',\n 'after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken dark:after:mix-blend-lighten',\n resolveClassName(className, state)\n )\n }\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction AvatarImage({ className, asChild, children, ...props }: AvatarImageProps) {\n return (\n <AvatarPrimitive.Image\n data-slot=\"avatar-image\"\n className={(state) => cn('rounded-full aspect-square size-full object-cover', resolveClassName(className, state))}\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction AvatarFallback({ className, asChild, children, ...props }: AvatarFallbackProps) {\n return (\n <AvatarPrimitive.Fallback\n data-slot=\"avatar-fallback\"\n className={(state) =>\n cn(\n 'bg-muted text-muted-foreground rounded-full flex size-full items-center justify-center text-sm group-data-[size=sm]/avatar:text-xs',\n resolveClassName(className, state)\n )\n }\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction AvatarBadge({ className, ...props }: AvatarBadgeProps) {\n return (\n <span\n data-slot=\"avatar-badge\"\n className={cn(\n 'bg-primary text-primary-foreground ring-background absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full bg-blend-color ring-2 select-none',\n 'group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden',\n 'group-data-[size=md]/avatar:size-2.5 group-data-[size=md]/avatar:[&>svg]:size-2',\n 'group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AvatarGroup({ className, ...props }: AvatarGroupProps) {\n return (\n <div\n data-slot=\"avatar-group\"\n className={cn(\n '*:data-[slot=avatar]:ring-background group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AvatarGroupCount({ className, ...props }: AvatarGroupCountProps) {\n return (\n <div\n data-slot=\"avatar-group-count\"\n className={cn(\n 'bg-muted text-muted-foreground ring-background relative flex shrink-0 items-center justify-center size-8 rounded-full text-sm ring-2',\n 'group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6',\n '[&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3',\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage }\n"],"mappings":"oRA0BA,SAAS,OAAO,CAAE,YAAW,OAAO,KAAM,UAAS,WAAU,GAAGG,GAAsB,CACpF,MACE,kBAACH,EAAgB,KAAjB,CACE,YAAU,SACV,YAAWI,EACX,UAAY,GACVC,EACE,sEACA,+CACA,uIACAJ,EAAiBK,EAAWC,CAAK,CACnC,EAEF,GAAIJ,EACJ,GAAIK,EAAqBC,EAASC,CAAQ,CAC3C,CAAA,CAEL,CAEA,SAAS,YAAY,CAAE,YAAW,UAAS,WAAU,GAAGP,GAA2B,CACjF,MACE,kBAACH,EAAgB,MAAjB,CACE,YAAU,eACV,UAAY,GAAUK,EAAG,oDAAqDJ,EAAiBK,EAAWC,CAAK,CAAC,EAChH,GAAIJ,EACJ,GAAIK,EAAqBC,EAASC,CAAQ,CAC3C,CAAA,CAEL,CAEA,SAAS,eAAe,CAAE,YAAW,UAAS,WAAU,GAAGP,GAA8B,CACvF,MACE,kBAACH,EAAgB,SAAjB,CACE,YAAU,kBACV,UAAY,GACVK,EACE,qIACAJ,EAAiBK,EAAWC,CAAK,CACnC,EAEF,GAAIJ,EACJ,GAAIK,EAAqBC,EAASC,CAAQ,CAC3C,CAAA,CAEL,CAEA,SAAS,YAAY,CAAE,YAAW,GAAGP,GAA2B,CAC9D,MACE,kBAAC,OAAD,CACE,YAAU,eACV,UAAWE,EACT,2KACA,gFACA,kFACA,gFACAC,CACF,EACA,GAAIH,CACL,CAAA,CAEL,CAEA,SAAS,YAAY,CAAE,YAAW,GAAGA,GAA2B,CAC9D,MACE,kBAAC,MAAD,CACE,YAAU,eACV,UAAWE,EACT,sGACAC,CACF,EACA,GAAIH,CACL,CAAA,CAEL,CAEA,SAAS,iBAAiB,CAAE,YAAW,GAAGA,GAAgC,CACxE,MACE,kBAAC,MAAD,CACE,YAAU,qBACV,UAAWE,EACT,uIACA,6FACA,2HACAC,CACF,EACA,GAAIH,CACL,CAAA,CAEL"}
@@ -1,16 +1,14 @@
1
1
  import { t as __name } from "../rolldown-runtime-BhWHdk3m.js";
2
+ import { n as AsChildProps } from "../as-child-Dxg3Xo1G.js";
2
3
  import { VariantProps } from "class-variance-authority";
3
- import * as React from "react";
4
4
  //#region src/components/badge.d.ts
5
5
  declare const badgeVariants: (props?: ({
6
6
  size?: "lg" | "md" | "sm" | "xl" | "xs" | null | undefined;
7
7
  variant?: "outline" | "secondary" | "solid" | "subtle" | null | undefined;
8
8
  color?: "blue" | "brand" | "gray" | "green" | "indigo" | "pink" | "primary" | "red" | "yellow" | "zinc" | null | undefined;
9
9
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
10
- export type BadgeProps = React.ComponentProps<'span'> & VariantProps<typeof badgeVariants> & {
11
- asChild?: boolean;
12
- };
13
- declare function Badge({ className, size, variant, color, asChild, ...props }: BadgeProps): React.JSX.Element;
10
+ export type BadgeProps = AsChildProps<'span'> & VariantProps<typeof badgeVariants>;
11
+ declare function Badge({ className, size, variant, color, ...props }: BadgeProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
14
12
  //#endregion
15
13
  export { Badge, badgeVariants };
16
14
  //# sourceMappingURL=badge.d.ts.map
@@ -1,2 +1,2 @@
1
- import"../rolldown-runtime-BhWHdk3m.js";import{cn as e}from"../lib/utils.js";import{badgeColorVariants as t}from"../lib/badge.js";import{Slot as n}from"radix-ui";import{jsx as r}from"react/jsx-runtime";import{cva as i}from"class-variance-authority";const a=i(`group/badge inline-flex w-fit items-center justify-center overflow-hidden border border-transparent font-semibold whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none`,{variants:{size:{xs:`h-4 gap-0.5 px-1.5 text-[10px] rounded-[4px] [&>svg]:size-2.5! has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1`,sm:`h-4.5 gap-0.5 px-2 text-[11px] rounded-[5px] [&>svg]:size-2.5! has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5`,md:`h-5 gap-1 px-2 py-0.5 text-xs rounded-[6px] [&>svg]:size-3! has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5`,lg:`h-6 gap-1 px-2.5 text-xs rounded-[7px] [&>svg]:size-3.5! has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xl:`h-7 gap-1.5 px-3 text-sm rounded-[8px] [&>svg]:size-4! has-data-[icon=inline-end]:pr-2.5 has-data-[icon=inline-start]:pl-2.5`},variant:{solid:`bg-(--badge-solid) text-(--badge-solid-foreground) [a]:hover:opacity-90`,secondary:`border-border bg-background text-foreground [a]:hover:bg-muted dark:border-input dark:bg-input/30 dark:[a]:hover:bg-input/50`,outline:`border-(--badge-outline-border) text-(--badge-outline-foreground) [a]:hover:bg-(--badge-soft) [a]:hover:text-(--badge-soft-foreground)`,subtle:`bg-(--badge-soft) text-(--badge-soft-foreground) [a]:hover:bg-(--badge-soft-hover)`},color:t},defaultVariants:{size:`md`,variant:`solid`,color:`primary`}});function Badge({className:t,size:i=`md`,variant:o=`solid`,color:s=`primary`,asChild:c=!1,...l}){let u=c?n.Root:`span`;return/* @__PURE__ */ r(u,{"data-slot":`badge`,"data-size":i,"data-variant":o,"data-color":s,className:e(a({size:i,variant:o,color:s}),t),...l})}export{Badge,a as badgeVariants};
1
+ import"../rolldown-runtime-BhWHdk3m.js";import{useAsChild as e}from"../lib/as-child.js";import{cn as t}from"../lib/utils.js";import{badgeColorVariants as n}from"../lib/badge.js";import{cva as r}from"class-variance-authority";const i=r(`group/badge inline-flex w-fit items-center justify-center overflow-hidden border border-transparent font-semibold whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none`,{variants:{size:{xs:`h-4 gap-0.5 px-1.5 text-[10px] rounded-[4px] [&>svg]:size-2.5! has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1`,sm:`h-4.5 gap-0.5 px-2 text-[11px] rounded-[5px] [&>svg]:size-2.5! has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5`,md:`h-5 gap-1 px-2 py-0.5 text-xs rounded-[6px] [&>svg]:size-3! has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5`,lg:`h-6 gap-1 px-2.5 text-xs rounded-[7px] [&>svg]:size-3.5! has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xl:`h-7 gap-1.5 px-3 text-sm rounded-[8px] [&>svg]:size-4! has-data-[icon=inline-end]:pr-2.5 has-data-[icon=inline-start]:pl-2.5`},variant:{solid:`bg-(--badge-solid) text-(--badge-solid-foreground) [a]:hover:opacity-90`,secondary:`border-border bg-background text-foreground [a]:hover:bg-muted dark:border-input dark:bg-input/30 dark:[a]:hover:bg-input/50`,outline:`border-(--badge-outline-border) text-(--badge-outline-foreground) [a]:hover:bg-(--badge-soft) [a]:hover:text-(--badge-soft-foreground)`,subtle:`bg-(--badge-soft) text-(--badge-soft-foreground) [a]:hover:bg-(--badge-soft-hover)`},color:n},defaultVariants:{size:`md`,variant:`solid`,color:`primary`}});function Badge({className:n,size:r=`md`,variant:a=`solid`,color:o=`primary`,...s}){return e(`span`,{"data-slot":`badge`,"data-size":r,"data-variant":a,"data-color":o,className:t(i({size:r,variant:a,color:o}),n),...s})}export{Badge,i as badgeVariants};
2
2
  //# sourceMappingURL=badge.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"badge.js","names":["badgeVariants","cva","badgeColorVariants","props","Comp","asChild","Slot","size","variant","color","cn","className"],"sources":["../../src/components/badge.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { Slot } from 'radix-ui'\n\nimport { badgeColorVariants } from '../lib/badge'\nimport { cn } from '../lib/utils'\n\nconst badgeVariants = cva(\n 'group/badge inline-flex w-fit items-center justify-center overflow-hidden border border-transparent font-semibold whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none',\n {\n variants: {\n size: {\n xs: 'h-4 gap-0.5 px-1.5 text-[10px] rounded-[4px] [&>svg]:size-2.5! has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1',\n sm: 'h-4.5 gap-0.5 px-2 text-[11px] rounded-[5px] [&>svg]:size-2.5! has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5',\n md: 'h-5 gap-1 px-2 py-0.5 text-xs rounded-[6px] [&>svg]:size-3! has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5',\n lg: 'h-6 gap-1 px-2.5 text-xs rounded-[7px] [&>svg]:size-3.5! has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',\n xl: 'h-7 gap-1.5 px-3 text-sm rounded-[8px] [&>svg]:size-4! has-data-[icon=inline-end]:pr-2.5 has-data-[icon=inline-start]:pl-2.5'\n },\n variant: {\n solid: 'bg-(--badge-solid) text-(--badge-solid-foreground) [a]:hover:opacity-90',\n secondary:\n 'border-border bg-background text-foreground [a]:hover:bg-muted dark:border-input dark:bg-input/30 dark:[a]:hover:bg-input/50',\n outline:\n 'border-(--badge-outline-border) text-(--badge-outline-foreground) [a]:hover:bg-(--badge-soft) [a]:hover:text-(--badge-soft-foreground)',\n subtle: 'bg-(--badge-soft) text-(--badge-soft-foreground) [a]:hover:bg-(--badge-soft-hover)'\n },\n color: badgeColorVariants\n },\n defaultVariants: {\n size: 'md',\n variant: 'solid',\n color: 'primary'\n }\n }\n)\n\nexport type BadgeProps = React.ComponentProps<'span'> &\n VariantProps<typeof badgeVariants> & {\n asChild?: boolean\n }\n\nfunction Badge({\n className,\n size = 'md',\n variant = 'solid',\n color = 'primary',\n asChild = false,\n ...props\n}: BadgeProps) {\n const Comp = asChild ? Slot.Root : 'span'\n\n return (\n <Comp\n data-slot=\"badge\"\n data-size={size}\n data-variant={variant}\n data-color={color}\n className={cn(badgeVariants({ size, variant, color }), className)}\n {...props}\n />\n )\n}\n\nexport { Badge, badgeVariants }\n"],"mappings":"yPAQA,MAAMA,EAAgBC,EACpB,sWACA,CACE,SAAU,CACR,KAAM,CACJ,GAAI,mIACJ,GAAI,uIACJ,GAAI,oIACJ,GAAI,6HACJ,GAAI,8HACN,EACA,QAAS,CACP,MAAO,0EACP,UACE,+HACF,QACE,yIACF,OAAQ,oFACV,EACA,MAAOC,CACT,EACA,gBAAiB,CACf,KAAM,KACN,QAAS,QACT,MAAO,SACT,CACF,CACF,EAOA,SAAS,MAAM,CACb,YACA,OAAO,KACP,UAAU,QACV,QAAQ,UACR,UAAU,GACV,GAAGC,GACU,CACb,IAAMC,EAAOC,EAAUC,EAAK,KAAO,OAEnC,MACE,kBAACF,EAAD,CACE,YAAU,QACV,YAAWG,EACX,eAAcC,EACd,aAAYC,EACZ,UAAWC,EAAGV,EAAc,CAAE,OAAM,UAAS,OAAM,CAAC,EAAGW,CAAS,EAChE,GAAIR,CACL,CAAA,CAEL"}
1
+ {"version":3,"file":"badge.js","names":["badgeVariants","cva","badgeColorVariants","props","useAsChild","size","variant","color","cn","className"],"sources":["../../src/components/badge.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority'\n\nimport { type AsChildProps, useAsChild } from '../lib/as-child'\nimport { badgeColorVariants } from '../lib/badge'\nimport { cn } from '../lib/utils'\n\nconst badgeVariants = cva(\n 'group/badge inline-flex w-fit items-center justify-center overflow-hidden border border-transparent font-semibold whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none',\n {\n variants: {\n size: {\n xs: 'h-4 gap-0.5 px-1.5 text-[10px] rounded-[4px] [&>svg]:size-2.5! has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1',\n sm: 'h-4.5 gap-0.5 px-2 text-[11px] rounded-[5px] [&>svg]:size-2.5! has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5',\n md: 'h-5 gap-1 px-2 py-0.5 text-xs rounded-[6px] [&>svg]:size-3! has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5',\n lg: 'h-6 gap-1 px-2.5 text-xs rounded-[7px] [&>svg]:size-3.5! has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',\n xl: 'h-7 gap-1.5 px-3 text-sm rounded-[8px] [&>svg]:size-4! has-data-[icon=inline-end]:pr-2.5 has-data-[icon=inline-start]:pl-2.5'\n },\n variant: {\n solid: 'bg-(--badge-solid) text-(--badge-solid-foreground) [a]:hover:opacity-90',\n secondary:\n 'border-border bg-background text-foreground [a]:hover:bg-muted dark:border-input dark:bg-input/30 dark:[a]:hover:bg-input/50',\n outline:\n 'border-(--badge-outline-border) text-(--badge-outline-foreground) [a]:hover:bg-(--badge-soft) [a]:hover:text-(--badge-soft-foreground)',\n subtle: 'bg-(--badge-soft) text-(--badge-soft-foreground) [a]:hover:bg-(--badge-soft-hover)'\n },\n color: badgeColorVariants\n },\n defaultVariants: {\n size: 'md',\n variant: 'solid',\n color: 'primary'\n }\n }\n)\n\nexport type BadgeProps = AsChildProps<'span'> & VariantProps<typeof badgeVariants>\n\nfunction Badge({ className, size = 'md', variant = 'solid', color = 'primary', ...props }: BadgeProps) {\n return useAsChild('span', {\n 'data-slot': 'badge',\n 'data-size': size,\n 'data-variant': variant,\n 'data-color': color,\n className: cn(badgeVariants({ size, variant, color }), className),\n ...props\n })\n}\n\nexport { Badge, badgeVariants }\n"],"mappings":"iOAMA,MAAMA,EAAgBC,EACpB,sWACA,CACE,SAAU,CACR,KAAM,CACJ,GAAI,mIACJ,GAAI,uIACJ,GAAI,oIACJ,GAAI,6HACJ,GAAI,8HACN,EACA,QAAS,CACP,MAAO,0EACP,UACE,+HACF,QACE,yIACF,OAAQ,oFACV,EACA,MAAOC,CACT,EACA,gBAAiB,CACf,KAAM,KACN,QAAS,QACT,MAAO,SACT,CACF,CACF,EAIA,SAAS,MAAM,CAAE,YAAW,OAAO,KAAM,UAAU,QAAS,QAAQ,UAAW,GAAGC,GAAqB,CACrG,OAAOC,EAAW,OAAQ,CACxB,YAAa,QACb,YAAaC,EACb,eAAgBC,EAChB,aAAcC,EACd,UAAWC,EAAGR,EAAc,CAAE,OAAM,UAAS,OAAM,CAAC,EAAGS,CAAS,EAChE,GAAGN,CACL,CAAC,CACH"}
@@ -4,36 +4,84 @@ import * as React from "react";
4
4
  import { Bar, BarChart as BarChart$1 } from "recharts";
5
5
  //#region src/components/bar-chart.d.ts
6
6
  export type BarChartSeries = {
7
+ /** Field of each `data` row holding this series’ values. Also the default label. */
7
8
  name: string;
9
+ /** Name shown in the tooltip and legend. Defaults to `name`. */
8
10
  label?: string;
11
+ /** Any CSS color. Wins over `colorKey`. */
9
12
  color?: string;
13
+ /** Palette family, resolved to its semantic color `var(--{key})`. */
10
14
  colorKey?: ChartColorKey;
11
15
  };
12
16
  export type BarChartDatum = Record<string, unknown> & {
17
+ /** Colors every bar in this row. Wins over the series color. */
13
18
  color?: string;
19
+ /** Palette family for every bar in this row. Wins over the series color. */
14
20
  colorKey?: ChartColorKey;
15
21
  };
16
22
  export type BarChartType = 'default' | 'stacked' | 'percent';
17
23
  export type BarChartOrientation = 'vertical' | 'horizontal';
18
24
  export type BarChartGridAxis = 'none' | 'x' | 'y' | 'xy';
19
25
  export type BarChartProps = Omit<React.ComponentProps<'div'>, 'children'> & {
26
+ /** Rows to plot. */
20
27
  data: BarChartDatum[];
28
+ /** Series to draw, one per field of `data`. */
21
29
  series: BarChartSeries[];
30
+ /** Field of `data` used for the categories axis. */
22
31
  dataKey: string;
32
+ /**
33
+ * `stacked` stacks the series, `percent` stacks them to 100%.
34
+ * @default 'default'
35
+ */
23
36
  type?: BarChartType;
37
+ /**
38
+ * `vertical` draws vertical bars; `horizontal` draws horizontal bars.
39
+ * @default 'vertical'
40
+ */
24
41
  orientation?: BarChartOrientation;
42
+ /**
43
+ * Shows the x axis.
44
+ * @default true
45
+ */
25
46
  withXAxis?: boolean;
47
+ /**
48
+ * Shows the y axis.
49
+ * @default true
50
+ */
26
51
  withYAxis?: boolean;
52
+ /**
53
+ * Grid lines to draw.
54
+ * @default 'x'
55
+ */
27
56
  gridAxis?: BarChartGridAxis;
57
+ /**
58
+ * Shows a tooltip on hover.
59
+ * @default true
60
+ */
28
61
  withTooltip?: boolean;
62
+ /**
63
+ * Shows the legend.
64
+ * @default false
65
+ */
29
66
  withLegend?: boolean;
67
+ /** Fixed bar width in px. */
30
68
  barSize?: number;
69
+ /**
70
+ * Corner radius of the bars.
71
+ * @default 4
72
+ */
31
73
  radius?: number | [number, number, number, number];
74
+ /** Appended to the axis and tooltip values. */
32
75
  unit?: string;
76
+ /** Animation length in ms. */
33
77
  animationDuration?: number;
78
+ /** Props for the tooltip content. */
34
79
  tooltipProps?: ChartTooltipContentProps;
80
+ /** Props for the legend content. */
35
81
  legendProps?: ChartLegendContentProps;
82
+ /** Props for each Recharts `<Bar>`. */
36
83
  barProps?: Partial<React.ComponentProps<typeof Bar>>;
84
+ /** Props for the Recharts `<BarChart>`. */
37
85
  barChartProps?: Omit<React.ComponentProps<typeof BarChart$1>, 'data' | 'layout' | 'stackOffset'>;
38
86
  };
39
87
  declare function BarChart({ className, data, series, dataKey, type, orientation, withXAxis, withYAxis, gridAxis, withTooltip, withLegend, barSize, radius, unit, animationDuration, tooltipProps, legendProps, barProps, barChartProps, ...props }: BarChartProps): React.JSX.Element;
@@ -1,2 +1,2 @@
1
- import"../rolldown-runtime-BhWHdk3m.js";import{cn as e}from"../lib/utils.js";import{ChartContainer as t,ChartLegendContent as n,ChartTooltipContent as r,DEFAULT_CHART_PALETTE as i,resolveChartColor as a}from"./chart.js";import{jsx as o,jsxs as s}from"react/jsx-runtime";import*as c from"react";import{Bar as l,BarChart as u,CartesianGrid as d,Legend as f,Rectangle as p,Tooltip as m,XAxis as h,YAxis as g}from"recharts";function buildConfig(e){return e.reduce((e,t,n)=>(e[t.name]={label:t.label??t.name,color:t.color??a(t.colorKey)??i[n%i.length]},e),{})}function BarChart({className:i,data:_,series:v,dataKey:y,type:b=`default`,orientation:x=`vertical`,withXAxis:S=!0,withYAxis:C=!0,gridAxis:w=`x`,withTooltip:T=!0,withLegend:E=!1,barSize:D,radius:O=4,unit:k,animationDuration:A,tooltipProps:j,legendProps:M,barProps:N,barChartProps:P,...F}){let I=c.useMemo(()=>buildConfig(v),[v]),L=b==="default"?void 0:`stack`,R=b===`percent`?`expand`:void 0,z=x===`horizontal`,B={dataKey:y,tickLine:!1,axisLine:!1,tickMargin:8},V=b===`percent`?e=>`${Math.round(e*100)}%`:k?e=>`${e}${k}`:void 0;return/* @__PURE__ */ o(t,{"data-slot":`bar-chart`,className:e(`w-full`,i),config:I,...F,children:/* @__PURE__ */ s(u,{...P,data:_,stackOffset:R,layout:z?`vertical`:`horizontal`,children:[w!==`none`&&/* @__PURE__ */ o(d,{vertical:w===`y`||w===`xy`,horizontal:w===`x`||w===`xy`}),S&&(z?/* @__PURE__ */ o(h,{type:`number`,tickLine:!1,axisLine:!1,tickMargin:8,tickFormatter:V}):/* @__PURE__ */ o(h,{type:`category`,...B})),C&&(z?/* @__PURE__ */ o(g,{type:`category`,...B}):/* @__PURE__ */ o(g,{type:`number`,tickLine:!1,axisLine:!1,tickMargin:8,tickFormatter:V})),T&&/* @__PURE__ */ o(m,{cursor:!1,content:/* @__PURE__ */ o(r,{...j})}),E&&/* @__PURE__ */ o(f,{content:/* @__PURE__ */ o(n,{...M})}),v.map(e=>{let t=I[e.name]?.color;return/* @__PURE__ */ o(l,{dataKey:e.name,stackId:L,fill:t,radius:O,barSize:D,animationDuration:A,isAnimationActive:A!==0,shape:e=>{let n=e.payload,r=n?.color??a(n?.colorKey)??t;return/* @__PURE__ */ o(p,{...e,fill:r})},...N},e.name)})]})})}export{BarChart};
1
+ import"../rolldown-runtime-BhWHdk3m.js";import{cn as e}from"../lib/utils.js";import{ChartContainer as t,ChartLegendContent as n,ChartTooltipContent as r,DEFAULT_CHART_PALETTE as i,resolveChartColor as a}from"./chart.js";import*as o from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";import{Bar as l,BarChart as u,CartesianGrid as d,Legend as f,Rectangle as p,Tooltip as m,XAxis as h,YAxis as g}from"recharts";function buildConfig(e){return e.reduce((e,t,n)=>(e[t.name]={label:t.label??t.name,color:t.color??a(t.colorKey)??i[n%i.length]},e),{})}function BarChart({className:i,data:_,series:v,dataKey:y,type:b=`default`,orientation:x=`vertical`,withXAxis:S=!0,withYAxis:C=!0,gridAxis:w=`x`,withTooltip:T=!0,withLegend:E=!1,barSize:D,radius:O=4,unit:k,animationDuration:A,tooltipProps:j,legendProps:M,barProps:N,barChartProps:P,...F}){let I=o.useMemo(()=>buildConfig(v),[v]),L=b==="default"?void 0:`stack`,R=b===`percent`?`expand`:void 0,z=x===`horizontal`,B={dataKey:y,tickLine:!1,axisLine:!1,tickMargin:8},V=b===`percent`?e=>`${Math.round(e*100)}%`:k?e=>`${e}${k}`:void 0;return/* @__PURE__ */ s(t,{"data-slot":`bar-chart`,className:e(`w-full`,i),config:I,...F,children:/* @__PURE__ */ c(u,{...P,data:_,stackOffset:R,layout:z?`vertical`:`horizontal`,children:[w!==`none`&&/* @__PURE__ */ s(d,{vertical:w===`y`||w===`xy`,horizontal:w===`x`||w===`xy`}),S&&(z?/* @__PURE__ */ s(h,{type:`number`,tickLine:!1,axisLine:!1,tickMargin:8,tickFormatter:V}):/* @__PURE__ */ s(h,{type:`category`,...B})),C&&(z?/* @__PURE__ */ s(g,{type:`category`,...B}):/* @__PURE__ */ s(g,{type:`number`,tickLine:!1,axisLine:!1,tickMargin:8,tickFormatter:V})),T&&/* @__PURE__ */ s(m,{cursor:!1,content:/* @__PURE__ */ s(r,{...j})}),E&&/* @__PURE__ */ s(f,{content:/* @__PURE__ */ s(n,{...M})}),v.map(e=>{let t=I[e.name]?.color;return/* @__PURE__ */ s(l,{dataKey:e.name,stackId:L,fill:t,radius:O,barSize:D,animationDuration:A,isAnimationActive:A!==0,shape:e=>{let n=e.payload,r=n?.color??a(n?.colorKey)??t;return/* @__PURE__ */ s(p,{...e,fill:r})},...N},e.name)})]})})}export{BarChart};
2
2
  //# sourceMappingURL=bar-chart.js.map
@@ -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 name: string\n label?: string\n color?: string\n colorKey?: ChartColorKey\n}\n\nexport type BarChartDatum = Record<string, unknown> & {\n color?: string\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 data: BarChartDatum[]\n series: BarChartSeries[]\n dataKey: string\n type?: BarChartType\n orientation?: BarChartOrientation\n withXAxis?: boolean\n withYAxis?: boolean\n gridAxis?: BarChartGridAxis\n withTooltip?: boolean\n withLegend?: boolean\n barSize?: number\n radius?: number | [number, number, number, number]\n unit?: string\n animationDuration?: number\n tooltipProps?: ChartTooltipContentProps\n legendProps?: ChartLegendContentProps\n barProps?: Partial<React.ComponentProps<typeof Bar>>\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":"oaAsDA,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,CAACA,CAAM,CAAC,EAC1DQ,EAAUC,IAAS,UAAY,IAAA,GAAY,QAC3CC,EAAcD,IAAS,UAAY,SAAW,IAAA,GAC9CE,EAAeC,IAAgB,aAE/BC,EAAoB,CACxB,UACA,SAAU,GACV,SAAU,GACV,WAAY,CACd,EAEMC,EACJL,IAAS,UACJ,GAAkB,GAAG,KAAK,MAAMM,EAAQ,GAAG,EAAE,GAC9CC,EACG,GAAkB,GAAGD,IAAQC,IAC9B,IAAA,GAER,MACE,kBAACC,EAAD,CAAgB,YAAU,YAAY,UAAWC,EAAG,SAAUC,CAAS,EAAW,SAAQ,GAAIb,EAC5F,SAAA,kBAACT,EAAD,CACE,GAAIuB,EACE,OACO,cACb,OAAQT,EAAe,WAAa,aAJtC,SAAA,CAMGU,IAAa,QACZ,kBAACC,EAAD,CACE,SAAUD,IAAa,KAAOA,IAAa,KAC3C,WAAYA,IAAa,KAAOA,IAAa,IAC9C,CAAA,EAEFE,IACEZ,EACC,kBAACa,EAAD,CAAO,KAAK,SAAS,SAAU,GAAO,SAAU,GAAO,WAAY,EAAG,cAAeV,CAAqB,CAAA,EAE1G,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":"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,CAACA,CAAM,CAAC,EAC1DQ,EAAUC,IAAS,UAAY,IAAA,GAAY,QAC3CC,EAAcD,IAAS,UAAY,SAAW,IAAA,GAC9CE,EAAeC,IAAgB,aAE/BC,EAAoB,CACxB,UACA,SAAU,GACV,SAAU,GACV,WAAY,CACd,EAEMC,EACJL,IAAS,UACJ,GAAkB,GAAG,KAAK,MAAMM,EAAQ,GAAG,EAAE,GAC9CC,EACG,GAAkB,GAAGD,IAAQC,IAC9B,IAAA,GAER,MACE,kBAACC,EAAD,CAAgB,YAAU,YAAY,UAAWC,EAAG,SAAUC,CAAS,EAAW,SAAQ,GAAIb,EAC5F,SAAA,kBAACT,EAAD,CACE,GAAIuB,EACE,OACO,cACb,OAAQT,EAAe,WAAa,aAJtC,SAAA,CAMGU,IAAa,QACZ,kBAACC,EAAD,CACE,SAAUD,IAAa,KAAOA,IAAa,KAC3C,WAAYA,IAAa,KAAOA,IAAa,IAC9C,CAAA,EAEFE,IACEZ,EACC,kBAACa,EAAD,CAAO,KAAK,SAAS,SAAU,GAAO,SAAU,GAAO,WAAY,EAAG,cAAeV,CAAqB,CAAA,EAE1G,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,13 +1,17 @@
1
1
  import { t as __name } from "../rolldown-runtime-BhWHdk3m.js";
2
+ import { n as AsChildProps } from "../as-child-Dxg3Xo1G.js";
2
3
  import * as React from "react";
3
4
  //#region src/components/bottom-nav.d.ts
4
5
  export type BottomNavProps = React.ComponentProps<'nav'>;
5
- export type BottomNavItemProps = React.ComponentProps<'button'> & {
6
- asChild?: boolean;
6
+ export type BottomNavItemProps = AsChildProps<'button'> & {
7
+ /**
8
+ * Marks the item as the current page (`aria-current="page"`).
9
+ * @default false
10
+ */
7
11
  isActive?: boolean;
8
12
  };
9
13
  declare function BottomNav({ className, ...props }: BottomNavProps): React.JSX.Element;
10
- declare function BottomNavItem({ className, type, asChild, isActive, ...props }: BottomNavItemProps): React.JSX.Element;
14
+ declare function BottomNavItem({ className, type, asChild, isActive, ...props }: BottomNavItemProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
11
15
  //#endregion
12
16
  export { BottomNav, BottomNavItem };
13
17
  //# sourceMappingURL=bottom-nav.d.ts.map
@@ -1,2 +1,2 @@
1
- import"../rolldown-runtime-BhWHdk3m.js";import{cn as e}from"../lib/utils.js";import{Slot as t}from"radix-ui";import{jsx as n}from"react/jsx-runtime";function BottomNav({className:t,...r}){return/* @__PURE__ */ n(`nav`,{"aria-label":`bottom navigation`,"data-slot":`bottom-nav`,className:e(`fixed inset-x-0 bottom-0 z-30 flex border-t bg-background`,`px-2 pt-2 pb-[calc(--spacing(2)+var(--spacing-safe-bottom))]`,t),...r})}function BottomNavItem({className:r,type:i=`button`,asChild:a=!1,isActive:o=!1,...s}){let c=a?t.Root:`button`;return/* @__PURE__ */ n(c,{type:a?void 0:i,"data-slot":`bottom-nav-item`,"data-active":o,"aria-current":o?`page`:void 0,className:e(`flex flex-1 flex-col items-center justify-center gap-1 rounded-md py-1 text-xs font-medium text-muted-foreground`,`transition-colors data-[active=true]:font-semibold data-[active=true]:text-primary`,`focus-visible:ring-3 focus-visible:ring-ring/50 outline-hidden`,`[&_svg]:size-5 [&_svg]:shrink-0 [&>span:last-child]:truncate`,r),...s})}export{BottomNav,BottomNavItem};
1
+ import"../rolldown-runtime-BhWHdk3m.js";import{useAsChild as e}from"../lib/as-child.js";import{cn as t}from"../lib/utils.js";import{jsx as n}from"react/jsx-runtime";function BottomNav({className:e,...r}){return/* @__PURE__ */ n(`nav`,{"aria-label":`bottom navigation`,"data-slot":`bottom-nav`,className:t(`fixed inset-x-0 bottom-0 z-30 flex border-t bg-background`,`px-2 pt-2 pb-[calc(--spacing(2)+var(--spacing-safe-bottom))]`,e),...r})}function BottomNavItem({className:n,type:r=`button`,asChild:i=!1,isActive:a=!1,...o}){return e(`button`,{asChild:i,type:i?void 0:r,"data-slot":`bottom-nav-item`,"data-active":a,"aria-current":a?`page`:void 0,className:t(`flex flex-1 flex-col items-center justify-center gap-1 rounded-md py-1 text-xs font-medium text-muted-foreground`,`transition-colors data-[active=true]:font-semibold data-[active=true]:text-primary`,`focus-visible:ring-3 focus-visible:ring-ring/50 outline-hidden`,`[&_svg]:size-5 [&_svg]:shrink-0 [&>span:last-child]:truncate`,n),...o})}export{BottomNav,BottomNavItem};
2
2
  //# sourceMappingURL=bottom-nav.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"bottom-nav.js","names":["props","cn","className","Comp","asChild","Slot","type","isActive"],"sources":["../../src/components/bottom-nav.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { Slot } from 'radix-ui'\n\nimport { cn } from '../lib/utils'\n\nexport type BottomNavProps = React.ComponentProps<'nav'>\n\nexport type BottomNavItemProps = React.ComponentProps<'button'> & {\n asChild?: boolean\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 const Comp = asChild ? Slot.Root : 'button'\n\n return (\n <Comp\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}\n\nexport { BottomNav, BottomNavItem }\n"],"mappings":"qJAaA,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,IAAMG,EAAOC,EAAUC,EAAK,KAAO,SAEnC,MACE,kBAACF,EAAD,CACE,KAAOC,EAAiB,IAAA,GAAPE,EACjB,YAAU,kBACV,cAAaC,EACb,eAAcA,EAAW,OAAS,IAAA,GAClC,UAAWN,EACT,mHACA,qFACA,iEACA,+DACAC,CACF,EACA,GAAIF,CACL,CAAA,CAEL"}
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,19 +1,18 @@
1
1
  import { t as __name } from "../rolldown-runtime-BhWHdk3m.js";
2
+ import { n as AsChildProps } from "../as-child-Dxg3Xo1G.js";
2
3
  import * as React from "react";
3
4
  //#region src/components/breadcrumb.d.ts
4
5
  export type BreadcrumbProps = React.ComponentProps<'nav'>;
5
6
  export type BreadcrumbListProps = React.ComponentProps<'ol'>;
6
7
  export type BreadcrumbItemProps = React.ComponentProps<'li'>;
7
- export type BreadcrumbLinkProps = React.ComponentProps<'a'> & {
8
- asChild?: boolean;
9
- };
8
+ export type BreadcrumbLinkProps = AsChildProps<'a'>;
10
9
  export type BreadcrumbPageProps = React.ComponentProps<'span'>;
11
10
  export type BreadcrumbSeparatorProps = React.ComponentProps<'li'>;
12
11
  export type BreadcrumbEllipsisProps = React.ComponentProps<'span'>;
13
12
  declare function Breadcrumb({ className, ...props }: BreadcrumbProps): React.JSX.Element;
14
13
  declare function BreadcrumbList({ className, ...props }: BreadcrumbListProps): React.JSX.Element;
15
14
  declare function BreadcrumbItem({ className, ...props }: BreadcrumbItemProps): React.JSX.Element;
16
- declare function BreadcrumbLink({ asChild, className, ...props }: BreadcrumbLinkProps): React.JSX.Element;
15
+ declare function BreadcrumbLink({ className, ...props }: BreadcrumbLinkProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
17
16
  declare function BreadcrumbPage({ className, ...props }: BreadcrumbPageProps): React.JSX.Element;
18
17
  declare function BreadcrumbSeparator({ children, className, ...props }: BreadcrumbSeparatorProps): React.JSX.Element;
19
18
  declare function BreadcrumbEllipsis({ className, ...props }: BreadcrumbEllipsisProps): React.JSX.Element;
@@ -1,2 +1,2 @@
1
- import"../rolldown-runtime-BhWHdk3m.js";import{cn as e}from"../lib/utils.js";import{IconChevronRight as t,IconDots as n}from"@tabler/icons-react";import{Slot as r}from"radix-ui";import{jsx as i,jsxs as a}from"react/jsx-runtime";function Breadcrumb({className:t,...n}){return/* @__PURE__ */ i(`nav`,{"aria-label":`breadcrumb`,"data-slot":`breadcrumb`,className:e(t),...n})}function BreadcrumbList({className:t,...n}){return/* @__PURE__ */ i(`ol`,{"data-slot":`breadcrumb-list`,className:e(`flex flex-wrap items-center gap-1.5 text-sm wrap-break-word text-muted-foreground`,t),...n})}function BreadcrumbItem({className:t,...n}){return/* @__PURE__ */ i(`li`,{"data-slot":`breadcrumb-item`,className:e(`inline-flex items-center gap-1`,t),...n})}function BreadcrumbLink({asChild:t,className:n,...a}){let o=t?r.Root:`a`;return/* @__PURE__ */ i(o,{"data-slot":`breadcrumb-link`,className:e(`transition-colors hover:text-foreground`,n),...a})}function BreadcrumbPage({className:t,...n}){return/* @__PURE__ */ i(`span`,{"data-slot":`breadcrumb-page`,"aria-current":`page`,className:e(`font-normal text-foreground`,t),...n})}function BreadcrumbSeparator({children:n,className:r,...a}){return/* @__PURE__ */ i(`li`,{"data-slot":`breadcrumb-separator`,role:`presentation`,"aria-hidden":`true`,className:e(`[&>svg]:size-3.5`,r),...a,children:n??/* @__PURE__ */ i(t,{})})}function BreadcrumbEllipsis({className:t,...r}){return/* @__PURE__ */ a(`span`,{"data-slot":`breadcrumb-ellipsis`,role:`presentation`,"aria-hidden":`true`,className:e(`flex size-5 items-center justify-center [&>svg]:size-4`,t),...r,children:[/* @__PURE__ */ i(n,{}),/* @__PURE__ */ i(`span`,{className:`sr-only`,children:`More`})]})}export{Breadcrumb,BreadcrumbEllipsis,BreadcrumbItem,BreadcrumbLink,BreadcrumbList,BreadcrumbPage,BreadcrumbSeparator};
1
+ import"../rolldown-runtime-BhWHdk3m.js";import{useAsChild as e}from"../lib/as-child.js";import{cn as t}from"../lib/utils.js";import{IconChevronRight as n,IconDots as r}from"@tabler/icons-react";import{jsx as i,jsxs as a}from"react/jsx-runtime";function Breadcrumb({className:e,...n}){return/* @__PURE__ */ i(`nav`,{"aria-label":`breadcrumb`,"data-slot":`breadcrumb`,className:t(e),...n})}function BreadcrumbList({className:e,...n}){return/* @__PURE__ */ i(`ol`,{"data-slot":`breadcrumb-list`,className:t(`flex flex-wrap items-center gap-1.5 text-sm wrap-break-word text-muted-foreground`,e),...n})}function BreadcrumbItem({className:e,...n}){return/* @__PURE__ */ i(`li`,{"data-slot":`breadcrumb-item`,className:t(`inline-flex items-center gap-1`,e),...n})}function BreadcrumbLink({className:n,...r}){return e(`a`,{"data-slot":`breadcrumb-link`,className:t(`transition-colors hover:text-foreground`,n),...r})}function BreadcrumbPage({className:e,...n}){return/* @__PURE__ */ i(`span`,{"data-slot":`breadcrumb-page`,"aria-current":`page`,className:t(`font-normal text-foreground`,e),...n})}function BreadcrumbSeparator({children:e,className:r,...a}){return/* @__PURE__ */ i(`li`,{"data-slot":`breadcrumb-separator`,role:`presentation`,"aria-hidden":`true`,className:t(`[&>svg]:size-3.5`,r),...a,children:e??/* @__PURE__ */ i(n,{})})}function BreadcrumbEllipsis({className:e,...n}){return/* @__PURE__ */ a(`span`,{"data-slot":`breadcrumb-ellipsis`,role:`presentation`,"aria-hidden":`true`,className:t(`flex size-5 items-center justify-center [&>svg]:size-4`,e),...n,children:[/* @__PURE__ */ i(r,{}),/* @__PURE__ */ i(`span`,{className:`sr-only`,children:`More`})]})}export{Breadcrumb,BreadcrumbEllipsis,BreadcrumbItem,BreadcrumbLink,BreadcrumbList,BreadcrumbPage,BreadcrumbSeparator};
2
2
  //# sourceMappingURL=breadcrumb.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"breadcrumb.js","names":["props","cn","className","Comp","asChild","Slot","children","IconChevronRight","IconDots"],"sources":["../../src/components/breadcrumb.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { IconChevronRight, IconDots } from '@tabler/icons-react'\nimport { Slot } from 'radix-ui'\n\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 = React.ComponentProps<'a'> & {\n asChild?: boolean\n}\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({ asChild, className, ...props }: BreadcrumbLinkProps) {\n const Comp = asChild ? Slot.Root : 'a'\n\n return (\n <Comp data-slot=\"breadcrumb-link\" className={cn('transition-colors hover:text-foreground', className)} {...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":"oOAuBA,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,UAAS,YAAW,GAAGA,GAA8B,CAC7E,IAAMG,EAAOC,EAAUC,EAAK,KAAO,IAEnC,MACE,kBAACF,EAAD,CAAM,YAAU,kBAAkB,UAAWF,EAAG,0CAA2CC,CAAS,EAAG,GAAIF,CAAQ,CAAA,CAEvH,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,SAAAM,GAAY,kBAACC,EAAD,CAAmB,CAAA,CAC9B,CAAA,CAER,CAEA,SAAS,mBAAmB,CAAE,YAAW,GAAGP,GAAkC,CAC5E,MACE,kBAAC,OAAD,CACE,YAAU,sBACV,KAAK,eACL,cAAY,OACZ,UAAWC,EAAG,yDAA0DC,CAAS,EACjF,GAAIF,EALN,SAAA,CAOE,kBAACQ,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":"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,4 +1,5 @@
1
1
  import { t as __name } from "../rolldown-runtime-BhWHdk3m.js";
2
+ import { n as AsChildProps } from "../as-child-Dxg3Xo1G.js";
2
3
  import { Separator } from "./separator.js";
3
4
  import { VariantProps } from "class-variance-authority";
4
5
  //#region src/components/button-group.d.ts
@@ -6,12 +7,10 @@ declare const buttonGroupVariants: (props?: ({
6
7
  orientation?: "horizontal" | "vertical" | null | undefined;
7
8
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
9
  export type ButtonGroupProps = React.ComponentProps<'div'> & VariantProps<typeof buttonGroupVariants>;
9
- export type ButtonGroupTextProps = React.ComponentProps<'div'> & {
10
- asChild?: boolean;
11
- };
10
+ export type ButtonGroupTextProps = AsChildProps<'div'>;
12
11
  export type ButtonGroupSeparatorProps = React.ComponentProps<typeof Separator>;
13
12
  declare function ButtonGroup({ className, orientation, ...props }: ButtonGroupProps): import("react").JSX.Element;
14
- declare function ButtonGroupText({ className, asChild, ...props }: ButtonGroupTextProps): import("react").JSX.Element;
13
+ declare function ButtonGroupText({ className, ...props }: ButtonGroupTextProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
15
14
  declare function ButtonGroupSeparator({ className, orientation, ...props }: ButtonGroupSeparatorProps): import("react").JSX.Element;
16
15
  //#endregion
17
16
  export { ButtonGroup, ButtonGroupSeparator, ButtonGroupText, buttonGroupVariants };
@@ -1,2 +1,2 @@
1
- import"../rolldown-runtime-BhWHdk3m.js";import{cn as e}from"../lib/utils.js";import{Separator as t}from"./separator.js";import{Slot as n}from"radix-ui";import{jsx as r}from"react/jsx-runtime";import{cva as i}from"class-variance-authority";const a=i(`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`,{variants:{orientation:{horizontal:`[&>*: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!`,vertical:`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!`}},defaultVariants:{orientation:`horizontal`}});function ButtonGroup({className:t,orientation:n,...i}){return/* @__PURE__ */ r(`div`,{"data-slot":`button-group`,"data-orientation":n,className:e(a({orientation:n}),t),...i})}function ButtonGroupText({className:t,asChild:i=!1,...a}){let o=i?n.Root:`div`;return/* @__PURE__ */ r(o,{className:e(`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`,t),...a})}function ButtonGroupSeparator({className:n,orientation:i=`vertical`,...a}){return/* @__PURE__ */ r(t,{"data-slot":`button-group-separator`,orientation:i,className:e(`relative self-stretch bg-input data-horizontal:mx-px data-horizontal:w-auto data-vertical:my-px data-vertical:h-auto`,n),...a})}export{ButtonGroup,ButtonGroupSeparator,ButtonGroupText,a as buttonGroupVariants};
1
+ import"../rolldown-runtime-BhWHdk3m.js";import{useAsChild as e}from"../lib/as-child.js";import{cn as t}from"../lib/utils.js";import{t as n}from"../resolve-class-name-BurP8ngI.js";import{Separator as r}from"./separator.js";import{jsx as i}from"react/jsx-runtime";import{cva as a}from"class-variance-authority";const o=a(`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`,{variants:{orientation:{horizontal:`[&>*: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!`,vertical:`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!`}},defaultVariants:{orientation:`horizontal`}});function ButtonGroup({className:e,orientation:n,...r}){return/* @__PURE__ */ i(`div`,{"data-slot":`button-group`,"data-orientation":n,className:t(o({orientation:n}),e),...r})}function ButtonGroupText({className:n,...r}){return e(`div`,{className:t(`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),...r})}function ButtonGroupSeparator({className:e,orientation:a=`vertical`,...o}){return/* @__PURE__ */ i(r,{"data-slot":`button-group-separator`,orientation:a,className:r=>t(`relative self-stretch bg-input data-horizontal:mx-px data-horizontal:w-auto data-vertical:my-px data-vertical:h-auto`,n(e,r)),...o})}export{ButtonGroup,ButtonGroupSeparator,ButtonGroupText,o as buttonGroupVariants};
2
2
  //# sourceMappingURL=button-group.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"button-group.js","names":["Separator","Separator$1","buttonGroupVariants","cva","props","orientation","cn","className","Comp","asChild","Slot"],"sources":["../../src/components/button-group.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority'\nimport { Slot } from 'radix-ui'\n\nimport { cn } from '../lib/utils'\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 = React.ComponentProps<'div'> & {\n asChild?: boolean\n}\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, asChild = false, ...props }: ButtonGroupTextProps) {\n const Comp = asChild ? Slot.Root : 'div'\n\n return (\n <Comp\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}\n\nfunction ButtonGroupSeparator({ className, orientation = 'vertical', ...props }: ButtonGroupSeparatorProps) {\n return (\n <Separator\n data-slot=\"button-group-separator\"\n orientation={orientation}\n className={cn(\n 'relative self-stretch bg-input data-horizontal:mx-px data-horizontal:w-auto data-vertical:my-px data-vertical:h-auto',\n className\n )}\n {...props}\n />\n )\n}\n\nexport { ButtonGroup, ButtonGroupSeparator, ButtonGroupText, buttonGroupVariants }\n"],"mappings":"+OAMA,MAAME,EAAsBC,EAC1B,2RACA,CACE,SAAU,CACR,YAAa,CACX,WACE,wKACF,SACE,gLACJ,CACF,EACA,gBAAiB,CACf,YAAa,YACf,CACF,CACF,EAUA,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,UAAU,GAAO,GAAGA,GAA+B,CACvF,IAAMI,EAAOC,EAAUC,EAAK,KAAO,MAEnC,MACE,kBAACF,EAAD,CACE,UAAWF,EACT,iJACAC,CACF,EACA,GAAIH,CACL,CAAA,CAEL,CAEA,SAAS,qBAAqB,CAAE,YAAW,cAAc,WAAY,GAAGA,GAAoC,CAC1G,MACE,kBAACJ,EAAD,CACE,YAAU,yBACG,cACb,UAAWM,EACT,uHACAC,CACF,EACA,GAAIH,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":"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,17 +1,21 @@
1
1
  import { t as __name } from "../rolldown-runtime-BhWHdk3m.js";
2
- import { VariantProps } from "class-variance-authority";
2
+ import { n as AsChildProps } from "../as-child-Dxg3Xo1G.js";
3
3
  import * as React from "react";
4
+ import { VariantProps } from "class-variance-authority";
4
5
  //#region src/components/button.d.ts
5
6
  declare const buttonVariants: (props?: ({
6
7
  variant?: "ghost" | "link" | "outline" | "secondary" | "solid" | "subtle" | null | undefined;
7
8
  color?: "blue" | "brand" | "gray" | "green" | "indigo" | "pink" | "primary" | "red" | "yellow" | "zinc" | null | undefined;
8
9
  size?: "icon" | "icon-lg" | "icon-sm" | "icon-xl" | "icon-xs" | "lg" | "md" | "sm" | "xl" | "xs" | null | undefined;
9
10
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
10
- export type ButtonProps = React.ComponentProps<'button'> & VariantProps<typeof buttonVariants> & {
11
- asChild?: boolean;
11
+ export type ButtonProps = AsChildProps<'button'> & VariantProps<typeof buttonVariants> & {
12
+ /**
13
+ * Shows a spinner, disables the button and sets `aria-busy`.
14
+ * @default false
15
+ */
12
16
  loading?: boolean;
13
17
  };
14
- declare function Button({ children, className, variant, color, size, asChild, disabled, loading, ...props }: ButtonProps): React.JSX.Element;
18
+ declare function Button({ children, className, variant, color, size, asChild, disabled, loading, onClick, ...props }: ButtonProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
15
19
  //#endregion
16
20
  export { Button, buttonVariants };
17
21
  //# sourceMappingURL=button.d.ts.map
@@ -1,2 +1,2 @@
1
- import"../rolldown-runtime-BhWHdk3m.js";import{cn as e}from"../lib/utils.js";import{buttonColorVariants as t}from"../lib/button.js";import{Spinner as n}from"./spinner.js";import{Slot as r}from"radix-ui";import{Fragment as i,jsx as a,jsxs as o}from"react/jsx-runtime";import{cva as s}from"class-variance-authority";const c=s(`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 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none`,{variants:{variant:{solid:`bg-(--button-solid) text-(--button-solid-foreground) hover:bg-(--button-solid-hover) data-[loading=true]:hover:bg-(--button-solid)`,secondary:`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`,outline:`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-background data-[loading=true]:hover:text-(--button-outline-foreground) aria-expanded:bg-(--button-solid) aria-expanded:text-(--button-solid-foreground) aria-expanded:[&_svg]:text-(--button-solid-foreground)`,subtle:`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)`,ghost:`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)`,link:`text-(--button-link-foreground) underline-offset-4 hover:underline data-[loading=true]:hover:no-underline`},color:t,size:{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`,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`,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`,lg:`h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3`,xl:`h-11 gap-2 px-3 has-data-[icon=inline-end]:pr-4 has-data-[icon=inline-start]:pl-4`,icon:`size-9`,"icon-xs":`size-7 in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-8 in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-10`,"icon-xl":`size-11`}},defaultVariants:{variant:`solid`,color:`primary`,size:`md`}});function Button({children:t,className:s,variant:l=`solid`,color:u=`primary`,size:d=`md`,asChild:f=!1,disabled:p,loading:m=!1,...h}){let g=f?r.Root:`button`;return/* @__PURE__ */ a(g,{type:f?void 0:`button`,"data-slot":`button`,"data-variant":l,"data-color":u,"data-size":d,"data-loading":m,"aria-busy":m?!0:void 0,disabled:p||m,className:e(c({variant:l,color:u,size:d,className:s})),...h,children:m&&!f?/* @__PURE__ */ o(i,{children:[/* @__PURE__ */ a(`span`,{className:`invisible inline-flex items-center gap-[inherit]`,children:t}),/* @__PURE__ */ a(`span`,{className:`absolute inset-0 inline-flex items-center justify-center`,children:/* @__PURE__ */ a(n,{})})]}):m?/* @__PURE__ */ a(n,{}):t})}export{Button,c as buttonVariants};
1
+ import"../rolldown-runtime-BhWHdk3m.js";import{useAsChild as e}from"../lib/as-child.js";import{cn as t}from"../lib/utils.js";import{buttonColorVariants as n}from"../lib/button.js";import{Spinner as r}from"./spinner.js";import*as i from"react";import{Fragment as a,jsx as o,jsxs as s}from"react/jsx-runtime";import{cva as c}from"class-variance-authority";const l=c(`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`,{variants:{variant:{solid:`bg-(--button-solid) text-(--button-solid-foreground) hover:bg-(--button-solid-hover) data-[loading=true]:hover:bg-(--button-solid)`,secondary:`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`,outline:`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)`,subtle:`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)`,ghost:`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)`,link:`text-(--button-link-foreground) underline-offset-4 hover:underline data-[loading=true]:hover:no-underline`},color:n,size:{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`,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`,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`,lg:`h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3`,xl:`h-11 gap-2 px-3 has-data-[icon=inline-end]:pr-4 has-data-[icon=inline-start]:pl-4`,icon:`size-9`,"icon-xs":`size-7 in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-8 in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-10`,"icon-xl":`size-11`}},defaultVariants:{variant:`solid`,color:`primary`,size:`md`}});function renderLoadingContent(e){return/* @__PURE__ */ s(a,{children:[/* @__PURE__ */ o(`span`,{className:`invisible inline-flex items-center gap-[inherit]`,children:e}),/* @__PURE__ */ o(`span`,{className:`absolute inset-0 inline-flex items-center justify-center`,children:/* @__PURE__ */ o(r,{})})]})}function Button({children:n,className:r,variant:a=`solid`,color:o=`primary`,size:s=`md`,asChild:c=!1,disabled:u,loading:d=!1,onClick:f,...p}){let m=u||d,h=c&&m,g=n;if(d&&c){let e=i.Children.only(n);g=i.cloneElement(e,void 0,renderLoadingContent(e.props.children))}else d&&(g=renderLoadingContent(n));return e(`button`,{asChild:c,type:c?void 0:`button`,"data-slot":`button`,"data-variant":a,"data-color":o,"data-size":s,"data-loading":d,"aria-busy":d?!0:void 0,"aria-disabled":h?!0:void 0,disabled:c?void 0:m,onClick:h?e=>e.preventDefault():f,className:t(l({variant:a,color:o,size:s,className:r})),...p,children:g})}export{Button,l as buttonVariants};
2
2
  //# sourceMappingURL=button.js.map