@uselets/ui 1.9.0 → 1.11.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.
package/README.md CHANGED
@@ -340,10 +340,10 @@ You can import from the package root (`@uselets/ui`) or by subpath (`@uselets/ui
340
340
  | `calendar` | `Calendar`, `CalendarDayButton` | Also exports the `DateRange` type. Weekends render with destructive text, week numbers are low-emphasis, and selected single/range endpoints use the `primary` palette with a subtle primary range fill. |
341
341
  | `date-range-picker` | `DateRangePicker`, `DateRangePickerTrigger`, `DateRangePickerValue`, `DateRangePickerContent`, `DateRangePickerPresets`, `DateRangePickerPreset`, `DateRangePickerCalendar`, `DateRangePickerDateFields`, `DateRangePickerActions`, `DateRangePickerApply`, `DateRangePickerReset` | Compound popover picker backed by `Calendar` range mode. Draft edits from fixed presets, relative-day inputs, date inputs, and calendar stay in sync until `Apply`; reset/clear emits `null` through `onValueChange`. |
342
342
  | `card` | `Card`, `CardHeader`, `CardTitle`, `CardDescription`, `CardAction`, `CardContent`, `CardFooter` | `Card` supports `size: 'sm' \| 'md' \| 'lg'` (default: `md`). |
343
- | `area-chart` / `bar-chart` / `pie-chart` / `donut-chart` | `AreaChart`, `BarChart`, `PieChart`, `DonutChart` (each with their series/datum types) | Recharts-backed charts with a mantine-shaped API. Each series/datum accepts `color` (raw CSS) or `colorKey: ChartColorKey` (`'primary' \| 'brand' \| 'gray' \| 'zinc' \| 'red' \| 'yellow' \| 'green' \| 'blue' \| 'indigo' \| 'pink'`) which resolves to `var(--{key}-500)`. Pass `areaProps` / `barProps` / `pieProps` to forward props (e.g. `onClick`, `cursor`) to the underlying recharts primitive. `PieChart` / `DonutChart` add `strokeColor` (default: `var(--background)`) alongside `strokeWidth` so the segment gaps are now visible by default. Re-exports `ChartColorKey`, `CHART_COLOR_KEYS`, `DEFAULT_CHART_PALETTE`, and `resolveChartColor` from `@uselets/ui/chart` for custom compositions. |
343
+ | `area-chart` / `bar-chart` / `pie-chart` / `donut-chart` | `AreaChart`, `BarChart`, `PieChart`, `DonutChart` (each with their series/datum types) | Recharts-backed charts with a mantine-shaped API. Each series/datum accepts `color` (raw CSS) or `colorKey: ChartColorKey` (`'primary' \| 'brand' \| 'gray' \| 'zinc' \| 'red' \| 'yellow' \| 'green' \| 'blue' \| 'indigo' \| 'pink'`) which resolves to `var(--{key}-500)`. Series/datum `name` is free-form and may contain spaces or non-ASCII characters. `BarChart` also accepts `color` / `colorKey` on each `data` row (`BarChartDatum`); when set, the row color wins over the series color and applies to every bar in that row. Pass `areaProps` / `barProps` / `pieProps` to forward props (e.g. `onClick`, `cursor`) to the underlying recharts series primitive (`<Area>` / `<Bar>` / `<Pie>`); pass `areaChartProps` / `barChartProps` to forward props (e.g. `margin`, `barCategoryGap`, `onClick`) to the wrapping recharts `<AreaChart>` / `<BarChart>`. `PieChart` / `DonutChart` add `strokeColor` (default: `var(--background)`) alongside `strokeWidth` so the segment gaps are now visible by default. Re-exports `ChartColorKey`, `CHART_COLOR_KEYS`, `DEFAULT_CHART_PALETTE`, and `resolveChartColor` from `@uselets/ui/chart` for custom compositions. |
344
344
  | `checkbox` | `Checkbox` | `Checkbox` supports `size: 'sm' \| 'md' \| 'lg'` (default: `md`), `color: UIColor` (default: `primary`), `label?: React.ReactNode`, and `labelProps` for the composed `Label`. When `label` is provided without `id`, it generates an id and wires `htmlFor` automatically. Label text follows checkbox size: `sm` 12px, `md` 14px, `lg` 20px. |
345
345
  | `code` | `Code` | Inline code primitive rendered as `<code>`. |
346
- | `combobox` | `Combobox`, `ComboboxInput`, `ComboboxContent`, `ComboboxList`, `ComboboxItem`, `ComboboxGroup`, `ComboboxLabel`, `ComboboxCollection`, `ComboboxClear`, `ComboboxEmpty`, `ComboboxSeparator`, `ComboboxChips`, `ComboboxChip`, `ComboboxChipsInput`, `ComboboxTrigger`, `ComboboxValue`, `useComboboxAnchor` | `ComboboxInput` supports `icon?: React.ReactNode`, `triggerIcon?: React.ReactNode`, `showTrigger?: boolean`, and `showClear?: boolean`; `ComboboxContent` supports `container` for rendering inside overlays such as dialogs. |
346
+ | `combobox` | `Combobox`, `ComboboxInput`, `ComboboxContent`, `ComboboxList`, `ComboboxItem`, `ComboboxGroup`, `ComboboxLabel`, `ComboboxCollection`, `ComboboxClear`, `ComboboxEmpty`, `ComboboxSeparator`, `ComboboxChips`, `ComboboxChip`, `ComboboxChipsInput`, `ComboboxTrigger`, `ComboboxValue`, `useComboboxAnchor` | `ComboboxInput` supports `icon?: React.ReactNode`, `triggerIcon?: React.ReactNode`, `showTrigger?: boolean`, and `showClear?: boolean`; `ComboboxChips` supports `showClear?: boolean` to render a button that clears all selected chips at once; `ComboboxContent` supports `container` for rendering inside overlays such as dialogs. |
347
347
  | `dialog` | `Dialog`, `DialogTrigger`, `DialogPortal`, `DialogClose`, `DialogOverlay`, `DialogContent`, `DialogHeader`, `DialogBody`, `DialogFooter`, `DialogTitle`, `DialogDescription` | `Dialog` supports `size: 'sm' \| 'md' \| 'lg' \| 'xl' \| '2xl' \| '3xl' \| 'full'` (default: `md`); `full` occupies the entire viewport. `DialogContent` caps its height at `calc(100dvh - 2rem)` and arranges children as a flex column; wrap long content in `DialogBody` (`flex-1 overflow-y-auto`) so the body scrolls while `DialogHeader` and `DialogFooter` stay pinned. `DialogContent.showCloseButton` (default: `true`); `DialogFooter.showCloseButton` (default: `false`). `Dialog.dismissible` (default: `true`); when `false`, clicking outside and pressing Esc no longer close the dialog (the close button and `DialogClose` still work). |
348
348
  | `drawer` | `Drawer`, `DrawerTrigger`, `DrawerPortal`, `DrawerClose`, `DrawerOverlay`, `DrawerContent`, `DrawerHeader`, `DrawerBody`, `DrawerFooter`, `DrawerTitle`, `DrawerDescription` | `Drawer` supports `size: 'sm' \| 'md' \| 'lg' \| 'xl' \| '2xl' \| '3xl' \| 'full'` (default: `md`); `DrawerBody` provides padded auto-scroll content; `DrawerFooter` stacks actions on mobile and aligns them to the end on larger breakpoints; `DrawerContent.showCloseButton` (default: `true`). `Drawer.dismissible` (default: `true`); when `false`, clicking outside and pressing Esc no longer close the drawer (the close button and `DrawerClose` still work). `Drawer.direction: 'top' \| 'right' \| 'bottom' \| 'left'` (default: `right`) controls which edge the drawer slides in from. |
349
349
  | `dropzone` | `Dropzone`, `DropzoneArea`, `DropzoneDescription`, `DropzoneFileList`, `DropzoneFileListItem`, `DropzoneFileMessage`, `DropzoneMessage`, `DropzoneRemoveFile`, `DropzoneRetryFile`, `DropzoneTrigger`, `InfiniteProgress`, `useDropzone` | `useDropzone` manages upload lifecycle, validation (`accept`, `minSize`, `maxSize`, `maxFiles`), retry handling, and optional `shiftOnMaxFiles` replacement. Compose the returned state with `Dropzone` and its subcomponents. |
@@ -396,6 +396,7 @@ Public hooks are exported from the package root and from the `@uselets/ui/hooks/
396
396
  - `useInterval` from `@uselets/ui/hooks/use-interval`
397
397
  - `useIdle` from `@uselets/ui/hooks/use-idle`
398
398
  - `useDocumentVisibility` from `@uselets/ui/hooks/use-document-visibility`
399
+ - `useHotkeys` from `@uselets/ui/hooks/use-hotkeys`
399
400
  - `useLocalStorage` from `@uselets/ui/hooks/use-local-storage`
400
401
  - `useMask` from `@uselets/ui/hooks/use-mask`
401
402
  - `useIsMobile` from `@uselets/ui/hooks/use-mobile`
@@ -423,6 +424,18 @@ const [draft, setDraft] = useLocalStorage('draft', {
423
424
  })
424
425
  ```
425
426
 
427
+ `useHotkeys` registers global keyboard shortcuts on the document. Each item is a tuple `[hotkey, handler, options?]`, where `hotkey` is a string like `'mod+k'` (`mod` matches `ctrl` on Windows/Linux and `meta` on macOS). Events fired from `INPUT`, `TEXTAREA`, and `SELECT` are ignored by default (configurable via the `tagsToIgnore` and `triggerOnContentEditable` arguments), and `options` accepts `preventDefault` (default `true`) and `usePhysicalKeys`. The `getHotkeyHandler` helper is also exported for binding shortcuts to a single element instead of the document:
428
+
429
+ ```tsx
430
+ useHotkeys([
431
+ ['mod+k', () => openCommandPalette()],
432
+ ['escape', () => close(), { preventDefault: false }]
433
+ ])
434
+
435
+ // or scoped to one element
436
+ <input onKeyDown={getHotkeyHandler([['mod+enter', submit]])} />
437
+ ```
438
+
426
439
  Utilities are exported from the package root and `@uselets/ui/utils`, including `cn` and `randomId`. The package also exports `composeRefs` (and `setRef`) from `@uselets/ui/lib/compose-refs` for composing multiple refs into a single callback ref — handy when a component needs to merge a forwarded `ref` with an internal one (for example `MaskInput`).
427
440
 
428
441
  ### Sonner example
@@ -1,7 +1,7 @@
1
1
  import { n as __name } from "../rolldown-runtime-Bdj-bS2b.js";
2
2
  import { c as ChartLegendContentProps, m as ChartTooltipContentProps, n as ChartColorKey } from "../chart-lqgodZYQ.js";
3
3
  import * as React from "react";
4
- import { Area } from "recharts";
4
+ import { Area, AreaChart as AreaChart$1 } from "recharts";
5
5
 
6
6
  //#region src/components/area-chart.d.ts
7
7
  type AreaChartSeries = {
@@ -33,6 +33,7 @@ type AreaChartProps = Omit<React.ComponentProps<'div'>, 'children'> & {
33
33
  tooltipProps?: ChartTooltipContentProps;
34
34
  legendProps?: ChartLegendContentProps;
35
35
  areaProps?: Partial<React.ComponentProps<typeof Area>>;
36
+ areaChartProps?: Omit<React.ComponentProps<typeof AreaChart$1>, 'data' | 'stackOffset'>;
36
37
  };
37
38
  declare function AreaChart({
38
39
  className,
@@ -55,6 +56,7 @@ declare function AreaChart({
55
56
  tooltipProps,
56
57
  legendProps,
57
58
  areaProps,
59
+ areaChartProps,
58
60
  ...props
59
61
  }: AreaChartProps): React.JSX.Element;
60
62
  //#endregion
@@ -1,2 +1,2 @@
1
- import"../rolldown-runtime-Bdj-bS2b.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,...P}){let F=c.useMemo(()=>buildConfig(g),[g]),I=v==="default"?void 0:`stack`,L=v===`percent`?`expand`:v===`split`?`silhouette`:void 0;return o(t,{"data-slot":`area-chart`,className:e(`w-full`,i),config:F,...P,children:s(u,{data:a,stackOffset:L,children:[S!==`none`&&o(d,{vertical:S===`y`||S===`xy`,horizontal:S===`x`||S===`xy`}),b&&o(m,{dataKey:_,tickLine:!1,axisLine:!1,tickMargin:8}),x&&o(h,{tickLine:!1,axisLine:!1,tickMargin:8,tickFormatter:v===`percent`?e=>`${Math.round(e*100)}%`:D?e=>`${e}${D}`:void 0}),w&&o(p,{cursor:!1,content:o(r,{...j})}),T&&o(f,{content:o(n,{...M})}),g.map(e=>o(l,{type:y,dataKey:e.name,stackId:I,stroke:`var(--color-${e.name})`,fill:`var(--color-${e.name})`,fillOpacity:O,strokeWidth:k,dot:C,connectNulls:E,animationDuration:A,isAnimationActive:A!==0,...N},e.name))]})})}export{AreaChart};
1
+ import"../rolldown-runtime-Bdj-bS2b.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 o(t,{"data-slot":`area-chart`,className:e(`w-full`,i),config:I,...F,children:s(u,{...P,data:a,stackOffset:R,children:[S!==`none`&&o(d,{vertical:S===`y`||S===`xy`,horizontal:S===`x`||S===`xy`}),b&&o(m,{dataKey:_,tickLine:!1,axisLine:!1,tickMargin:8}),x&&o(h,{tickLine:!1,axisLine:!1,tickMargin:8,tickFormatter:v===`percent`?e=>`${Math.round(e*100)}%`:D?e=>`${e}${D}`:void 0}),w&&o(p,{cursor:!1,content:o(r,{...j})}),T&&o(f,{content:o(n,{...M})}),g.map(e=>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};
2
2
  //# sourceMappingURL=area-chart.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"area-chart.js","names":["RechartsAreaChart"],"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}\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 ...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 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={`var(--color-${item.name})`}\n fill={`var(--color-${item.name})`}\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":"uZAkDA,SAAS,YAAY,EAAwC,CAC3D,OAAO,EAAO,QAAqB,EAAK,EAAM,KAC5C,EAAI,EAAK,MAAQ,CACf,MAAO,EAAK,OAAS,EAAK,KAC1B,MACE,EAAK,OAAS,EAAkB,EAAK,QAAQ,GAAK,EAAsB,EAAQ,EAAsB,OAC1G,EACO,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,GAAG,GACc,CACjB,IAAM,EAAS,EAAM,YAAc,YAAY,CAAM,EAAG,CAAC,CAAM,CAAC,EAC1D,EAAU,IAAS,UAAY,IAAA,GAAY,QAC3C,EAAc,IAAS,UAAY,SAAW,IAAS,QAAU,aAAe,IAAA,GAEtF,OACE,EAAC,EAAD,CAAgB,YAAU,aAAa,UAAW,EAAG,SAAU,CAAS,EAAW,SAAQ,GAAI,WAC7F,EAACA,EAAD,CAAyB,OAAmB,uBAA5C,CACG,IAAa,QACZ,EAAC,EAAD,CACE,SAAU,IAAa,KAAO,IAAa,KAC3C,WAAY,IAAa,KAAO,IAAa,IAC9C,CAAA,EAEF,GAAa,EAAC,EAAD,CAAgB,UAAS,SAAU,GAAO,SAAU,GAAO,WAAY,CAAI,CAAA,EACxF,GACC,EAAC,EAAD,CACE,SAAU,GACV,SAAU,GACV,WAAY,EACZ,cACE,IAAS,UACJ,GAAkB,GAAG,KAAK,MAAM,EAAQ,GAAG,EAAE,GAC9C,EACG,GAAU,GAAG,IAAQ,IACtB,IAAA,EAET,CAAA,EAEF,GAAe,EAAC,EAAD,CAAS,OAAQ,GAAO,QAAS,EAAC,EAAD,CAAqB,GAAI,CAAe,CAAA,CAAI,CAAA,EAC5F,GAAc,EAAC,EAAD,CAAQ,QAAS,EAAC,EAAD,CAAoB,GAAI,CAAc,CAAA,CAAI,CAAA,EACzE,EAAO,IAAK,GACX,EAAC,EAAD,CAEE,KAAM,EACN,QAAS,EAAK,KACL,UACT,OAAQ,eAAe,EAAK,KAAK,GACjC,KAAM,eAAe,EAAK,KAAK,GAClB,cACA,cACb,IAAK,EACS,eACK,oBACnB,kBAAmB,IAAsB,EACzC,GAAI,CACL,EAbM,EAAK,IAaX,CACF,CACgB,GACL,CAAA,CAEpB"}
1
+ {"version":3,"file":"area-chart.js","names":["RechartsAreaChart"],"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,OAAO,EAAO,QAAqB,EAAK,EAAM,KAC5C,EAAI,EAAK,MAAQ,CACf,MAAO,EAAK,OAAS,EAAK,KAC1B,MACE,EAAK,OAAS,EAAkB,EAAK,QAAQ,GAAK,EAAsB,EAAQ,EAAsB,OAC1G,EACO,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,GAAG,GACc,CACjB,IAAM,EAAS,EAAM,YAAc,YAAY,CAAM,EAAG,CAAC,CAAM,CAAC,EAC1D,EAAU,IAAS,UAAY,IAAA,GAAY,QAC3C,EAAc,IAAS,UAAY,SAAW,IAAS,QAAU,aAAe,IAAA,GAEtF,OACE,EAAC,EAAD,CAAgB,YAAU,aAAa,UAAW,EAAG,SAAU,CAAS,EAAW,SAAQ,GAAI,WAC7F,EAACA,EAAD,CAAmB,GAAI,EAAsB,OAAmB,uBAAhE,CACG,IAAa,QACZ,EAAC,EAAD,CACE,SAAU,IAAa,KAAO,IAAa,KAC3C,WAAY,IAAa,KAAO,IAAa,IAC9C,CAAA,EAEF,GAAa,EAAC,EAAD,CAAgB,UAAS,SAAU,GAAO,SAAU,GAAO,WAAY,CAAI,CAAA,EACxF,GACC,EAAC,EAAD,CACE,SAAU,GACV,SAAU,GACV,WAAY,EACZ,cACE,IAAS,UACJ,GAAkB,GAAG,KAAK,MAAM,EAAQ,GAAG,EAAE,GAC9C,EACG,GAAU,GAAG,IAAQ,IACtB,IAAA,EAET,CAAA,EAEF,GAAe,EAAC,EAAD,CAAS,OAAQ,GAAO,QAAS,EAAC,EAAD,CAAqB,GAAI,CAAe,CAAA,CAAI,CAAA,EAC5F,GAAc,EAAC,EAAD,CAAQ,QAAS,EAAC,EAAD,CAAoB,GAAI,CAAc,CAAA,CAAI,CAAA,EACzE,EAAO,IAAK,GACX,EAAC,EAAD,CAEE,KAAM,EACN,QAAS,EAAK,KACL,UACT,OAAQ,EAAO,EAAK,KAAK,EAAE,MAC3B,KAAM,EAAO,EAAK,KAAK,EAAE,MACZ,cACA,cACb,IAAK,EACS,eACK,oBACnB,kBAAmB,IAAsB,EACzC,GAAI,CACL,EAbM,EAAK,IAaX,CACF,CACgB,GACL,CAAA,CAEpB"}
@@ -1,7 +1,7 @@
1
1
  import { n as __name } from "../rolldown-runtime-Bdj-bS2b.js";
2
2
  import { c as ChartLegendContentProps, m as ChartTooltipContentProps, n as ChartColorKey } from "../chart-lqgodZYQ.js";
3
3
  import * as React from "react";
4
- import { Bar } from "recharts";
4
+ import { Bar, BarChart as BarChart$1 } from "recharts";
5
5
 
6
6
  //#region src/components/bar-chart.d.ts
7
7
  type BarChartSeries = {
@@ -10,11 +10,15 @@ type BarChartSeries = {
10
10
  color?: string;
11
11
  colorKey?: ChartColorKey;
12
12
  };
13
+ type BarChartDatum = Record<string, unknown> & {
14
+ color?: string;
15
+ colorKey?: ChartColorKey;
16
+ };
13
17
  type BarChartType = 'default' | 'stacked' | 'percent';
14
18
  type BarChartOrientation = 'vertical' | 'horizontal';
15
19
  type BarChartGridAxis = 'none' | 'x' | 'y' | 'xy';
16
20
  type BarChartProps = Omit<React.ComponentProps<'div'>, 'children'> & {
17
- data: Array<Record<string, unknown>>;
21
+ data: BarChartDatum[];
18
22
  series: BarChartSeries[];
19
23
  dataKey: string;
20
24
  type?: BarChartType;
@@ -31,6 +35,7 @@ type BarChartProps = Omit<React.ComponentProps<'div'>, 'children'> & {
31
35
  tooltipProps?: ChartTooltipContentProps;
32
36
  legendProps?: ChartLegendContentProps;
33
37
  barProps?: Partial<React.ComponentProps<typeof Bar>>;
38
+ barChartProps?: Omit<React.ComponentProps<typeof BarChart$1>, 'data' | 'layout' | 'stackOffset'>;
34
39
  };
35
40
  declare function BarChart({
36
41
  className,
@@ -51,8 +56,9 @@ declare function BarChart({
51
56
  tooltipProps,
52
57
  legendProps,
53
58
  barProps,
59
+ barChartProps,
54
60
  ...props
55
61
  }: BarChartProps): React.JSX.Element;
56
62
  //#endregion
57
- export { BarChart, BarChartGridAxis, BarChartOrientation, BarChartProps, BarChartSeries, BarChartType };
63
+ export { BarChart, BarChartDatum, BarChartGridAxis, BarChartOrientation, BarChartProps, BarChartSeries, BarChartType };
58
64
  //# sourceMappingURL=bar-chart.d.ts.map
@@ -1,2 +1,2 @@
1
- import"../rolldown-runtime-Bdj-bS2b.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,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 BarChart({className:i,data:a,series:g,dataKey:_,type:v=`default`,orientation:y=`vertical`,withXAxis:b=!0,withYAxis:x=!0,gridAxis:S=`x`,withTooltip:C=!0,withLegend:w=!1,barSize:T,radius:E=4,unit:D,animationDuration:O,tooltipProps:k,legendProps:A,barProps:j,...M}){let N=c.useMemo(()=>buildConfig(g),[g]),P=v==="default"?void 0:`stack`,F=v===`percent`?`expand`:void 0,I=y===`horizontal`,L={dataKey:_,tickLine:!1,axisLine:!1,tickMargin:8},R=v===`percent`?e=>`${Math.round(e*100)}%`:D?e=>`${e}${D}`:void 0;return o(t,{"data-slot":`bar-chart`,className:e(`w-full`,i),config:N,...M,children:s(u,{data:a,stackOffset:F,layout:I?`vertical`:`horizontal`,children:[S!==`none`&&o(d,{vertical:S===`y`||S===`xy`,horizontal:S===`x`||S===`xy`}),b&&(I?o(m,{type:`number`,tickLine:!1,axisLine:!1,tickMargin:8,tickFormatter:R}):o(m,{type:`category`,...L})),x&&(I?o(h,{type:`category`,...L}):o(h,{type:`number`,tickLine:!1,axisLine:!1,tickMargin:8,tickFormatter:R})),C&&o(p,{cursor:!1,content:o(r,{...k})}),w&&o(f,{content:o(n,{...A})}),g.map(e=>o(l,{dataKey:e.name,stackId:P,fill:`var(--color-${e.name})`,radius:E,barSize:T,animationDuration:O,isAnimationActive:O!==0,...j},e.name))]})})}export{BarChart};
1
+ import"../rolldown-runtime-Bdj-bS2b.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 o(t,{"data-slot":`bar-chart`,className:e(`w-full`,i),config:I,...F,children:s(u,{...P,data:_,stackOffset:R,layout:z?`vertical`:`horizontal`,children:[w!==`none`&&o(d,{vertical:w===`y`||w===`xy`,horizontal:w===`x`||w===`xy`}),S&&(z?o(h,{type:`number`,tickLine:!1,axisLine:!1,tickMargin:8,tickFormatter:V}):o(h,{type:`category`,...B})),C&&(z?o(g,{type:`category`,...B}):o(g,{type:`number`,tickLine:!1,axisLine:!1,tickMargin:8,tickFormatter:V})),T&&o(m,{cursor:!1,content:o(r,{...j})}),E&&o(f,{content:o(n,{...M})}),v.map(e=>{let t=I[e.name]?.color;return 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 o(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"],"sources":["../../src/components/bar-chart.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { Bar, CartesianGrid, Legend, BarChart as RechartsBarChart, 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 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: Array<Record<string, unknown>>\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}\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 ...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 data={data} stackOffset={stackOffset} layout={isHorizontal ? 'vertical' : 'horizontal'}>\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 <Bar\n key={item.name}\n dataKey={item.name}\n stackId={stackId}\n fill={`var(--color-${item.name})`}\n radius={radius}\n barSize={barSize}\n animationDuration={animationDuration}\n isAnimationActive={animationDuration !== 0}\n {...barProps}\n />\n ))}\n </RechartsBarChart>\n </ChartContainer>\n )\n}\n\nexport { BarChart }\n"],"mappings":"qZAgDA,SAAS,YAAY,EAAuC,CAC1D,OAAO,EAAO,QAAqB,EAAK,EAAM,KAC5C,EAAI,EAAK,MAAQ,CACf,MAAO,EAAK,OAAS,EAAK,KAC1B,MACE,EAAK,OAAS,EAAkB,EAAK,QAAQ,GA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A,EAC5F,GAAc,EAAC,EAAD,CAAQ,QAAS,EAAC,EAAD,CAAoB,GAAI,CAAc,CAAA,CAAI,CAAA,EACzE,EAAO,IAAK,GACX,EAAC,EAAD,CAEE,QAAS,EAAK,KACL,UACT,KAAM,eAAe,EAAK,KAAK,GACvB,SACC,UACU,oBACnB,kBAAmB,IAAsB,EACzC,GAAI,CACL,EATM,EAAK,IASX,CACF,CACe,GACJ,CAAA,CAEpB"}
1
+ {"version":3,"file":"bar-chart.js","names":["RechartsBarChart"],"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,OAAO,EAAO,QAAqB,EAAK,EAAM,KAC5C,EAAI,EAAK,MAAQ,CACf,MAAO,EAAK,OAAS,EAAK,KAC1B,MACE,EAAK,OAAS,EAAkB,EAAK,QAAQ,GAAK,EAAsB,EAAQ,EAAsB,OAC1G,EACO,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,GAAG,GACa,CAChB,IAAM,EAAS,EAAM,YAAc,YAAY,CAAM,EAAG,CAAC,CAAM,CAAC,EAC1D,EAAU,IAAS,UAAY,IAAA,GAAY,QAC3C,EAAc,IAAS,UAAY,SAAW,IAAA,GAC9C,EAAe,IAAgB,aAE/B,EAAoB,CACxB,UACA,SAAU,GACV,SAAU,GACV,WAAY,CACd,EAEM,EACJ,IAAS,UACJ,GAAkB,GAAG,KAAK,MAAM,EAAQ,GAAG,EAAE,GAC9C,EACG,GAAkB,GAAG,IAAQ,IAC9B,IAAA,GAER,OACE,EAAC,EAAD,CAAgB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-runtime";import*as i from"react";import*as a from"recharts";const o={light:``,dark:`.dark`},s=[`primary`,`brand`,`gray`,`zinc`,`red`,`yellow`,`green`,`blue`,`indigo`,`pink`];function resolveChartColor(e){if(e)return s.includes(e)?`var(--${e}-500)`:e}const c=[`var(--chart-1)`,`var(--chart-2)`,`var(--chart-3)`,`var(--chart-4)`,`var(--chart-5)`],l=i.createContext(null);function useChart(){let e=i.useContext(l);if(!e)throw Error(`useChart must be used within a <ChartContainer />`);return e}function ChartContainer({id:t,className:o,children:s,config:c,...u}){let d=i.useId(),f=`chart-${t||d.replace(/:/g,``)}`;return n(l.Provider,{value:{config:c},children:r(`div`,{"data-slot":`chart`,"data-chart":f,className:e(`flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden`,o),...u,children:[n(ChartStyle,{id:f,config:c}),n(a.ResponsiveContainer,{children:s})]})})}const ChartStyle=({id:e,config:t})=>{let r=Object.entries(t).filter(([,e])=>e.theme||e.color);return r.length?n(`style`,{children:Object.entries(o).map(([t,n])=>`
1
+ import"../rolldown-runtime-Bdj-bS2b.js";import{cn as e}from"../lib/utils.js";import{Fragment as t,jsx as n,jsxs as r}from"react/jsx-runtime";import*as i from"react";import*as a from"recharts";const o={light:``,dark:`.dark`},s=[`primary`,`brand`,`gray`,`zinc`,`red`,`yellow`,`green`,`blue`,`indigo`,`pink`];function resolveChartColor(e){if(e)return s.includes(e)?`var(--${e})`:e}const c=[`var(--chart-1)`,`var(--chart-2)`,`var(--chart-3)`,`var(--chart-4)`,`var(--chart-5)`],l=i.createContext(null);function useChart(){let e=i.useContext(l);if(!e)throw Error(`useChart must be used within a <ChartContainer />`);return e}function ChartContainer({id:t,className:r,children:o,config:s,...c}){let u=i.useId(),d=`chart-${t||u.replace(/:/g,``)}`;return n(l.Provider,{value:{config:s},children:n(`div`,{"data-slot":`chart`,"data-chart":d,className:e(`flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden`,r),...c,children:n(a.ResponsiveContainer,{children:o})})})}const ChartStyle=({id:e,config:t})=>{let r=Object.entries(t).filter(([,e])=>e.theme||e.color);return r.length?n(`style`,{children:Object.entries(o).map(([t,n])=>`
2
2
  ${n} [data-chart=${e}] {
3
3
  ${r.map(([e,n])=>{let r=n.theme?.[t]||n.color;return r?` --color-${e}: ${r};`:null}).join(`
4
4
  `)}
5
5
  }
6
6
  `).join(`
7
- `)}):null},u=a.Tooltip;function ChartTooltipContent({active:a,payload:o,className:s,indicator:c=`dot`,hideLabel:l=!1,hideIndicator:u=!1,label:d,labelFormatter:f,labelClassName:p,formatter:m,color:h,nameKey:g,labelKey:_}){let{config:v}=useChart(),y=i.useMemo(()=>{if(l||!o?.length)return null;let[t]=o,r=getPayloadConfigFromPayload(v,t,`${_||t?.dataKey||t?.name||`value`}`),i=!_&&typeof d==`string`?v[d]?.label||d:r?.label;return f?n(`div`,{className:e(`font-medium`,p),children:f(i,o)}):i?n(`div`,{className:e(`font-medium`,p),children:i}):null},[d,f,o,l,p,v,_]);if(!a||!o?.length)return null;let b=o.length===1&&c!==`dot`;return r(`div`,{className:e(`grid min-w-32 items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl`,s),children:[b?null:y,n(`div`,{className:`grid gap-1.5`,children:o.filter(e=>e.type!==`none`).map((i,a)=>{let o=getPayloadConfigFromPayload(v,i,`${g||i.name||i.dataKey||`value`}`),s=h||i.payload.fill||i.color;return n(`div`,{className:e(`flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground`,c===`dot`&&`items-center`),children:m&&i?.value!==void 0&&i.name?m(i.value,i.name,i,a,i.payload):r(t,{children:[o?.icon?n(o.icon,{}):!u&&n(`div`,{className:e(`shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)`,{"h-2.5 w-2.5":c===`dot`,"w-1":c===`line`,"w-0 border-[1.5px] border-dashed bg-transparent":c===`dashed`,"my-0.5":b&&c===`dashed`}),style:{"--color-bg":s,"--color-border":s}}),r(`div`,{className:e(`flex flex-1 justify-between leading-none`,b?`items-end`:`items-center`),children:[r(`div`,{className:`grid gap-1.5`,children:[b?y:null,n(`span`,{className:`text-muted-foreground`,children:o?.label||i.name})]}),i.value&&n(`span`,{className:`font-mono font-medium text-foreground tabular-nums`,children:i.value.toLocaleString()})]})]})},String(i.dataKey))})})]})}const d=a.Legend;function ChartLegendContent({className:t,hideIcon:i=!1,payload:a,verticalAlign:o=`bottom`,nameKey:s}){let{config:c}=useChart();return a?.length?n(`div`,{className:e(`flex items-center justify-center gap-4`,o===`top`?`pb-3`:`pt-3`,t),children:a.filter(e=>e.type!==`none`).map(t=>{let a=getPayloadConfigFromPayload(c,t,`${s||t.dataKey||`value`}`);return r(`div`,{className:e(`flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground`),children:[a?.icon&&!i?n(a.icon,{}):n(`div`,{className:`h-2 w-2 shrink-0 rounded-[2px]`,style:{backgroundColor:t.color}}),a?.label]},t.value)})}):null}function getPayloadConfigFromPayload(e,t,n){if(typeof t!=`object`||!t)return;let r=`payload`in t&&typeof t.payload==`object`&&t.payload!==null?t.payload:void 0,i=n;return n in t&&typeof t[n]==`string`?i=t[n]:r&&n in r&&typeof r[n]==`string`&&(i=r[n]),i in e?e[i]:e[n]}export{s as CHART_COLOR_KEYS,ChartContainer,d as ChartLegend,ChartLegendContent,ChartStyle,u as ChartTooltip,ChartTooltipContent,c as DEFAULT_CHART_PALETTE,resolveChartColor};
7
+ `)}):null},u=a.Tooltip;function ChartTooltipContent({active:a,payload:o,className:s,indicator:c=`dot`,hideLabel:l=!1,hideIndicator:u=!1,label:d,labelFormatter:f,labelClassName:p,formatter:m,color:h,nameKey:g,labelKey:_}){let{config:v}=useChart(),y=i.useMemo(()=>{if(l||!o?.length)return null;let[t]=o,r=getPayloadConfigFromPayload(v,t,`${_||t?.dataKey||t?.name||`value`}`),i=!_&&typeof d==`string`?v[d]?.label||d:r?.label;return f?n(`div`,{className:e(`font-medium`,p),children:f(i,o)}):i?n(`div`,{className:e(`font-medium`,p),children:i}):null},[d,f,o,l,p,v,_]);if(!a||!o?.length)return null;let b=o.length===1&&c!==`dot`;return r(`div`,{className:e(`grid min-w-32 items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl`,s),children:[b?null:y,n(`div`,{className:`grid gap-1.5`,children:o.filter(e=>e.type!==`none`).map((i,a)=>{let o=getPayloadConfigFromPayload(v,i,`${g||i.name||i.dataKey||`value`}`),s=h||i.payload.fill||i.color;return n(`div`,{className:e(`flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground`,c===`dot`&&`items-center`),children:m&&i?.value!==void 0&&i.name?m(i.value,i.name,i,a,i.payload):r(t,{children:[o?.icon?n(o.icon,{}):!u&&n(`div`,{className:e(`shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)`,{"h-2.5 w-2.5":c===`dot`,"w-1":c===`line`,"w-0 border-[1.5px] border-dashed bg-transparent":c===`dashed`,"my-0.5":b&&c===`dashed`}),style:{"--color-bg":s,"--color-border":s}}),r(`div`,{className:e(`flex flex-1 justify-between leading-none`,b?`items-end`:`items-center`),children:[r(`div`,{className:`grid gap-1.5`,children:[b?y:null,n(`span`,{className:`text-muted-foreground`,children:o?.label||i.name})]}),i.value&&n(`span`,{className:`font-mono font-medium text-foreground tabular-nums`,children:i.value.toLocaleString()})]})]})},String(i.dataKey))})})]})}const d=a.Legend;function ChartLegendContent({className:t,hideIcon:i=!1,payload:a,verticalAlign:o=`bottom`,nameKey:s}){let{config:c}=useChart();return a?.length?n(`div`,{className:e(`flex items-center justify-center flex-wrap gap-2`,o===`top`?`pb-3`:`pt-3`,t),children:a.filter(e=>e.type!==`none`).map(t=>{let a=getPayloadConfigFromPayload(c,t,`${s||t.dataKey||`value`}`);return r(`div`,{className:e(`flex items-center gap-1 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground`),children:[a?.icon&&!i?n(a.icon,{}):n(`div`,{className:`h-3 w-3 shrink-0 rounded-[2px]`,style:{backgroundColor:t.color}}),a?.label]},t.value)})}):null}function getPayloadConfigFromPayload(e,t,n){if(typeof t!=`object`||!t)return;let r=`payload`in t&&typeof t.payload==`object`&&t.payload!==null?t.payload:void 0,i=n;return n in t&&typeof t[n]==`string`?i=t[n]:r&&n in r&&typeof r[n]==`string`&&(i=r[n]),i in e?e[i]:e[n]}export{s as CHART_COLOR_KEYS,ChartContainer,d as ChartLegend,ChartLegendContent,ChartStyle,u as ChartTooltip,ChartTooltipContent,c as DEFAULT_CHART_PALETTE,resolveChartColor};
8
8
  //# sourceMappingURL=chart.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"chart.js","names":[],"sources":["../../src/components/chart.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport * as RechartsPrimitive from 'recharts'\n\nimport { cn } from '../lib/utils'\n\n// Format: { THEME_NAME: CSS_SELECTOR }\nconst THEMES = { light: '', dark: '.dark' } as const\n\nexport type ChartColorKey =\n | 'primary'\n | 'brand'\n | 'gray'\n | 'zinc'\n | 'red'\n | 'yellow'\n | 'green'\n | 'blue'\n | 'indigo'\n | 'pink'\n\nconst CHART_COLOR_KEYS: readonly ChartColorKey[] = [\n 'primary',\n 'brand',\n 'gray',\n 'zinc',\n 'red',\n 'yellow',\n 'green',\n 'blue',\n 'indigo',\n 'pink'\n]\n\nexport function resolveChartColor(value: string | undefined): string | undefined {\n if (!value) return undefined\n if ((CHART_COLOR_KEYS as readonly string[]).includes(value)) {\n return `var(--${value}-500)`\n }\n return value\n}\n\nexport const DEFAULT_CHART_PALETTE = [\n 'var(--chart-1)',\n 'var(--chart-2)',\n 'var(--chart-3)',\n 'var(--chart-4)',\n 'var(--chart-5)'\n] as const\n\nexport type ChartConfig = {\n [k in string]: {\n label?: React.ReactNode\n icon?: React.ComponentType\n } & ({ color?: string; theme?: never } | { color?: never; theme: Record<keyof typeof THEMES, string> })\n}\n\ntype ChartContextProps = {\n config: ChartConfig\n}\n\nexport type ChartContainerProps = React.ComponentProps<'div'> & {\n config: ChartConfig\n children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>['children']\n}\n\nexport type ChartStyleProps = {\n id: string\n config: ChartConfig\n}\n\nexport type ChartTooltipProps = React.ComponentProps<typeof RechartsPrimitive.Tooltip>\n\nexport type ChartTooltipContentProps = Partial<\n RechartsPrimitive.DefaultTooltipContentProps<number | string | Array<number | string>, number | string>\n> &\n Omit<React.ComponentProps<'div'>, 'formatter'> & {\n active?: boolean\n color?: string\n hideLabel?: boolean\n hideIndicator?: boolean\n indicator?: 'line' | 'dot' | 'dashed'\n nameKey?: string\n labelKey?: string\n }\n\nexport type ChartLegendProps = React.ComponentProps<typeof RechartsPrimitive.Legend>\n\nexport type ChartLegendContentProps = React.ComponentProps<'div'> &\n Pick<RechartsPrimitive.DefaultLegendContentProps, 'payload' | 'verticalAlign'> & {\n hideIcon?: boolean\n nameKey?: string\n }\n\nconst ChartContext = React.createContext<ChartContextProps | null>(null)\n\nfunction useChart() {\n const context = React.useContext(ChartContext)\n\n if (!context) {\n throw new Error('useChart must be used within a <ChartContainer />')\n }\n\n return context\n}\n\nfunction ChartContainer({ id, className, children, config, ...props }: ChartContainerProps) {\n const uniqueId = React.useId()\n const chartId = `chart-${id || uniqueId.replace(/:/g, '')}`\n\n return (\n <ChartContext.Provider value={{ config }}>\n <div\n data-slot=\"chart\"\n data-chart={chartId}\n className={cn(\n \"flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden\",\n className\n )}\n {...props}\n >\n <ChartStyle id={chartId} config={config} />\n <RechartsPrimitive.ResponsiveContainer>{children}</RechartsPrimitive.ResponsiveContainer>\n </div>\n </ChartContext.Provider>\n )\n}\n\nconst ChartStyle = ({ id, config }: ChartStyleProps) => {\n const colorConfig = Object.entries(config).filter(([, config]) => config.theme || config.color)\n\n if (!colorConfig.length) {\n return null\n }\n\n const styles = Object.entries(THEMES)\n .map(\n ([theme, prefix]) => `\n${prefix} [data-chart=${id}] {\n${colorConfig\n .map(([key, itemConfig]) => {\n const color = itemConfig.theme?.[theme as keyof typeof itemConfig.theme] || itemConfig.color\n return color ? ` --color-${key}: ${color};` : null\n })\n .join('\\n')}\n}\n`\n )\n .join('\\n')\n\n return <style>{styles}</style>\n}\n\nconst ChartTooltip = RechartsPrimitive.Tooltip\n\nfunction ChartTooltipContent({\n active,\n payload,\n className,\n indicator = 'dot',\n hideLabel = false,\n hideIndicator = false,\n label,\n labelFormatter,\n labelClassName,\n formatter,\n color,\n nameKey,\n labelKey\n}: ChartTooltipContentProps) {\n const { config } = useChart()\n\n const tooltipLabel = React.useMemo(() => {\n if (hideLabel || !payload?.length) {\n return null\n }\n\n const [item] = payload\n const key = `${labelKey || item?.dataKey || item?.name || 'value'}`\n const itemConfig = getPayloadConfigFromPayload(config, item, key)\n const value =\n !labelKey && typeof label === 'string' ? config[label as keyof typeof config]?.label || label : itemConfig?.label\n\n if (labelFormatter) {\n return <div className={cn('font-medium', labelClassName)}>{labelFormatter(value, payload)}</div>\n }\n\n if (!value) {\n return null\n }\n\n return <div className={cn('font-medium', labelClassName)}>{value}</div>\n }, [label, labelFormatter, payload, hideLabel, labelClassName, config, labelKey])\n\n if (!active || !payload?.length) {\n return null\n }\n\n const nestLabel = payload.length === 1 && indicator !== 'dot'\n\n return (\n <div\n className={cn(\n 'grid min-w-32 items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl',\n className\n )}\n >\n {!nestLabel ? tooltipLabel : null}\n <div className=\"grid gap-1.5\">\n {payload\n .filter((item) => item.type !== 'none')\n .map((item, index) => {\n const key = `${nameKey || item.name || item.dataKey || 'value'}`\n const itemConfig = getPayloadConfigFromPayload(config, item, key)\n const indicatorColor = color || item.payload.fill || item.color\n\n return (\n <div\n key={String(item.dataKey)}\n className={cn(\n 'flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground',\n indicator === 'dot' && 'items-center'\n )}\n >\n {formatter && item?.value !== undefined && item.name ? (\n formatter(item.value, item.name, item, index, item.payload)\n ) : (\n <>\n {itemConfig?.icon ? (\n <itemConfig.icon />\n ) : (\n !hideIndicator && (\n <div\n className={cn('shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)', {\n 'h-2.5 w-2.5': indicator === 'dot',\n 'w-1': indicator === 'line',\n 'w-0 border-[1.5px] border-dashed bg-transparent': indicator === 'dashed',\n 'my-0.5': nestLabel && indicator === 'dashed'\n })}\n style={\n {\n '--color-bg': indicatorColor,\n '--color-border': indicatorColor\n } as React.CSSProperties\n }\n />\n )\n )}\n <div\n className={cn(\n 'flex flex-1 justify-between leading-none',\n nestLabel ? 'items-end' : 'items-center'\n )}\n >\n <div className=\"grid gap-1.5\">\n {nestLabel ? tooltipLabel : null}\n <span className=\"text-muted-foreground\">{itemConfig?.label || item.name}</span>\n </div>\n {item.value && (\n <span className=\"font-mono font-medium text-foreground tabular-nums\">\n {item.value.toLocaleString()}\n </span>\n )}\n </div>\n </>\n )}\n </div>\n )\n })}\n </div>\n </div>\n )\n}\n\nconst ChartLegend = RechartsPrimitive.Legend\n\nfunction ChartLegendContent({\n className,\n hideIcon = false,\n payload,\n verticalAlign = 'bottom',\n nameKey\n}: ChartLegendContentProps) {\n const { config } = useChart()\n\n if (!payload?.length) {\n return null\n }\n\n return (\n <div className={cn('flex items-center justify-center gap-4', verticalAlign === 'top' ? 'pb-3' : 'pt-3', className)}>\n {payload\n .filter((item) => item.type !== 'none')\n .map((item) => {\n const key = `${nameKey || item.dataKey || 'value'}`\n const itemConfig = getPayloadConfigFromPayload(config, item, key)\n\n return (\n <div\n key={item.value}\n className={cn('flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground')}\n >\n {itemConfig?.icon && !hideIcon ? (\n <itemConfig.icon />\n ) : (\n <div\n className=\"h-2 w-2 shrink-0 rounded-[2px]\"\n style={{\n backgroundColor: item.color\n }}\n />\n )}\n {itemConfig?.label}\n </div>\n )\n })}\n </div>\n )\n}\n\nfunction getPayloadConfigFromPayload(config: ChartConfig, payload: unknown, key: string) {\n if (typeof payload !== 'object' || payload === null) {\n return undefined\n }\n\n const payloadPayload =\n 'payload' in payload && typeof payload.payload === 'object' && payload.payload !== null\n ? payload.payload\n : undefined\n\n let configLabelKey: string = key\n\n if (key in payload && typeof payload[key as keyof typeof payload] === 'string') {\n configLabelKey = payload[key as keyof typeof payload] as string\n } else if (\n payloadPayload &&\n key in payloadPayload &&\n typeof payloadPayload[key as keyof typeof payloadPayload] === 'string'\n ) {\n configLabelKey = payloadPayload[key as keyof typeof payloadPayload] as string\n }\n\n return configLabelKey in config ? config[configLabelKey] : config[key as keyof typeof config]\n}\n\nexport {\n CHART_COLOR_KEYS,\n ChartContainer,\n ChartLegend,\n ChartLegendContent,\n ChartStyle,\n ChartTooltip,\n ChartTooltipContent\n}\n"],"mappings":"gMAOA,MAAM,EAAS,CAAE,MAAO,GAAI,KAAM,OAAQ,EAcpC,EAA6C,CACjD,UACA,QACA,OACA,OACA,MACA,SACA,QACA,OACA,SACA,MACF,EAEA,SAAgB,kBAAkB,EAA+C,CAC1E,KAIL,OAHK,EAAuC,SAAS,CAAK,EACjD,SAAS,EAAM,OAEjB,CACT,CAEA,MAAa,EAAwB,CACnC,iBACA,iBACA,iBACA,iBACA,gBACF,EA8CM,EAAe,EAAM,cAAwC,IAAI,EAEvE,SAAS,UAAW,CAClB,IAAM,EAAU,EAAM,WAAW,CAAY,EAE7C,GAAI,CAAC,EACH,MAAU,MAAM,mDAAmD,EAGrE,OAAO,CACT,CAEA,SAAS,eAAe,CAAE,KAAI,YAAW,WAAU,SAAQ,GAAG,GAA8B,CAC1F,IAAM,EAAW,EAAM,MAAM,EACvB,EAAU,SAAS,GAAM,EAAS,QAAQ,KAAM,EAAE,IAExD,OACE,EAAC,EAAa,SAAd,CAAuB,MAAO,CAAE,QAAO,WACrC,EAAC,MAAD,CACE,YAAU,QACV,aAAY,EACZ,UAAW,EACT,8pBACA,CACF,EACA,GAAI,WAPN,CASE,EA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,CAAC,CACA,CAAA,CACF,GAET,CAEA,MAAM,EAAc,EAAkB,OAEtC,SAAS,mBAAmB,CAC1B,YACA,WAAW,GACX,UACA,gBAAgB,SAChB,WAC0B,CAC1B,GAAM,CAAE,UAAW,SAAS,EAM5B,OAJK,GAAS,OAKZ,EAAC,MAAD,CAAK,UAAW,EAAG,yCAA0C,IAAkB,MAAQ,OAAS,OAAQ,CAAS,WAC9G,EACE,OAAQ,GAAS,EAAK,OAAS,MAAM,CAAC,CACtC,IAAK,GAAS,CAEb,IAAM,EAAa,4BAA4B,EAAQ,EAAM,GAD9C,GAAW,EAAK,SAAW,SACsB,EAEhE,OACE,EAAC,MAAD,CAEE,UAAW,EAAG,iFAAiF,WAFjG,CAIG,GAAY,MAAQ,CAAC,EACpB,EAAC,EAAW,KAAZ,CAAkB,CAAA,EAElB,EAAC,MAAD,CACE,UAAU,iCACV,MAAO,CACL,gBAAiB,EAAK,KACxB,CACD,CAAA,EAEF,GAAY,KACV,GAdE,EAAK,KAcP,CAET,CAAC,CACA,CAAA,EA9BE,IAgCX,CAEA,SAAS,4BAA4B,EAAqB,EAAkB,EAAa,CACvF,GAAI,OAAO,GAAY,WAAY,EACjC,OAGF,IAAM,EACJ,YAAa,GAAW,OAAO,EAAQ,SAAY,UAAY,EAAQ,UAAY,KAC/E,EAAQ,QACR,IAAA,GAEF,EAAyB,EAY7B,OAVI,KAAO,GAAW,OAAO,EAAQ,IAAiC,SACpE,EAAiB,EAAQ,GAEzB,GACA,KAAO,GACP,OAAO,EAAe,IAAwC,WAE9D,EAAiB,EAAe,IAG3B,KAAkB,EAAS,EAAO,GAAkB,EAAO,EACpE"}
1
+ {"version":3,"file":"chart.js","names":[],"sources":["../../src/components/chart.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport * as RechartsPrimitive from 'recharts'\n\nimport { cn } from '../lib/utils'\n\n// Format: { THEME_NAME: CSS_SELECTOR }\nconst THEMES = { light: '', dark: '.dark' } as const\n\nexport type ChartColorKey =\n | 'primary'\n | 'brand'\n | 'gray'\n | 'zinc'\n | 'red'\n | 'yellow'\n | 'green'\n | 'blue'\n | 'indigo'\n | 'pink'\n\nconst CHART_COLOR_KEYS: readonly ChartColorKey[] = [\n 'primary',\n 'brand',\n 'gray',\n 'zinc',\n 'red',\n 'yellow',\n 'green',\n 'blue',\n 'indigo',\n 'pink'\n]\n\nexport function resolveChartColor(value: string | undefined): string | undefined {\n if (!value) return undefined\n if ((CHART_COLOR_KEYS as readonly string[]).includes(value)) {\n return `var(--${value})`\n }\n return value\n}\n\nexport const DEFAULT_CHART_PALETTE = [\n 'var(--chart-1)',\n 'var(--chart-2)',\n 'var(--chart-3)',\n 'var(--chart-4)',\n 'var(--chart-5)'\n] as const\n\nexport type ChartConfig = {\n [k in string]: {\n label?: React.ReactNode\n icon?: React.ComponentType\n } & ({ color?: string; theme?: never } | { color?: never; theme: Record<keyof typeof THEMES, string> })\n}\n\ntype ChartContextProps = {\n config: ChartConfig\n}\n\nexport type ChartContainerProps = React.ComponentProps<'div'> & {\n config: ChartConfig\n children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>['children']\n}\n\nexport type ChartStyleProps = {\n id: string\n config: ChartConfig\n}\n\nexport type ChartTooltipProps = React.ComponentProps<typeof RechartsPrimitive.Tooltip>\n\nexport type ChartTooltipContentProps = Partial<\n RechartsPrimitive.DefaultTooltipContentProps<number | string | Array<number | string>, number | string>\n> &\n Omit<React.ComponentProps<'div'>, 'formatter'> & {\n active?: boolean\n color?: string\n hideLabel?: boolean\n hideIndicator?: boolean\n indicator?: 'line' | 'dot' | 'dashed'\n nameKey?: string\n labelKey?: string\n }\n\nexport type ChartLegendProps = React.ComponentProps<typeof RechartsPrimitive.Legend>\n\nexport type ChartLegendContentProps = React.ComponentProps<'div'> &\n Pick<RechartsPrimitive.DefaultLegendContentProps, 'payload' | 'verticalAlign'> & {\n hideIcon?: boolean\n nameKey?: string\n }\n\nconst ChartContext = React.createContext<ChartContextProps | null>(null)\n\nfunction useChart() {\n const context = React.useContext(ChartContext)\n\n if (!context) {\n throw new Error('useChart must be used within a <ChartContainer />')\n }\n\n return context\n}\n\nfunction ChartContainer({ id, className, children, config, ...props }: ChartContainerProps) {\n const uniqueId = React.useId()\n const chartId = `chart-${id || uniqueId.replace(/:/g, '')}`\n\n return (\n <ChartContext.Provider value={{ config }}>\n <div\n data-slot=\"chart\"\n data-chart={chartId}\n className={cn(\n \"flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden\",\n className\n )}\n {...props}\n >\n <RechartsPrimitive.ResponsiveContainer>{children}</RechartsPrimitive.ResponsiveContainer>\n </div>\n </ChartContext.Provider>\n )\n}\n\nconst ChartStyle = ({ id, config }: ChartStyleProps) => {\n const colorConfig = Object.entries(config).filter(([, config]) => config.theme || config.color)\n\n if (!colorConfig.length) {\n return null\n }\n\n const styles = Object.entries(THEMES)\n .map(\n ([theme, prefix]) => `\n${prefix} [data-chart=${id}] {\n${colorConfig\n .map(([key, itemConfig]) => {\n const color = itemConfig.theme?.[theme as keyof typeof itemConfig.theme] || itemConfig.color\n return color ? ` --color-${key}: ${color};` : null\n })\n .join('\\n')}\n}\n`\n )\n .join('\\n')\n\n return <style>{styles}</style>\n}\n\nconst ChartTooltip = RechartsPrimitive.Tooltip\n\nfunction ChartTooltipContent({\n active,\n payload,\n className,\n indicator = 'dot',\n hideLabel = false,\n hideIndicator = false,\n label,\n labelFormatter,\n labelClassName,\n formatter,\n color,\n nameKey,\n labelKey\n}: ChartTooltipContentProps) {\n const { config } = useChart()\n\n const tooltipLabel = React.useMemo(() => {\n if (hideLabel || !payload?.length) {\n return null\n }\n\n const [item] = payload\n const key = `${labelKey || item?.dataKey || item?.name || 'value'}`\n const itemConfig = getPayloadConfigFromPayload(config, item, key)\n const value =\n !labelKey && typeof label === 'string' ? config[label as keyof typeof config]?.label || label : itemConfig?.label\n\n if (labelFormatter) {\n return <div className={cn('font-medium', labelClassName)}>{labelFormatter(value, payload)}</div>\n }\n\n if (!value) {\n return null\n }\n\n return <div className={cn('font-medium', labelClassName)}>{value}</div>\n }, [label, labelFormatter, payload, hideLabel, labelClassName, config, labelKey])\n\n if (!active || !payload?.length) {\n return null\n }\n\n const nestLabel = payload.length === 1 && indicator !== 'dot'\n\n return (\n <div\n className={cn(\n 'grid min-w-32 items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl',\n className\n )}\n >\n {!nestLabel ? tooltipLabel : null}\n <div className=\"grid gap-1.5\">\n {payload\n .filter((item) => item.type !== 'none')\n .map((item, index) => {\n const key = `${nameKey || item.name || item.dataKey || 'value'}`\n const itemConfig = getPayloadConfigFromPayload(config, item, key)\n const indicatorColor = color || item.payload.fill || item.color\n\n return (\n <div\n key={String(item.dataKey)}\n className={cn(\n 'flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground',\n indicator === 'dot' && 'items-center'\n )}\n >\n {formatter && item?.value !== undefined && item.name ? (\n formatter(item.value, item.name, item, index, item.payload)\n ) : (\n <>\n {itemConfig?.icon ? (\n <itemConfig.icon />\n ) : (\n !hideIndicator && (\n <div\n className={cn('shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)', {\n 'h-2.5 w-2.5': indicator === 'dot',\n 'w-1': indicator === 'line',\n 'w-0 border-[1.5px] border-dashed bg-transparent': indicator === 'dashed',\n 'my-0.5': nestLabel && indicator === 'dashed'\n })}\n style={\n {\n '--color-bg': indicatorColor,\n '--color-border': indicatorColor\n } as React.CSSProperties\n }\n />\n )\n )}\n <div\n className={cn(\n 'flex flex-1 justify-between leading-none',\n nestLabel ? 'items-end' : 'items-center'\n )}\n >\n <div className=\"grid gap-1.5\">\n {nestLabel ? tooltipLabel : null}\n <span className=\"text-muted-foreground\">{itemConfig?.label || item.name}</span>\n </div>\n {item.value && (\n <span className=\"font-mono font-medium text-foreground tabular-nums\">\n {item.value.toLocaleString()}\n </span>\n )}\n </div>\n </>\n )}\n </div>\n )\n })}\n </div>\n </div>\n )\n}\n\nconst ChartLegend = RechartsPrimitive.Legend\n\nfunction ChartLegendContent({\n className,\n hideIcon = false,\n payload,\n verticalAlign = 'bottom',\n nameKey\n}: ChartLegendContentProps) {\n const { config } = useChart()\n\n if (!payload?.length) {\n return null\n }\n\n return (\n <div\n className={cn(\n 'flex items-center justify-center flex-wrap gap-2',\n verticalAlign === 'top' ? 'pb-3' : 'pt-3',\n className\n )}\n >\n {payload\n .filter((item) => item.type !== 'none')\n .map((item) => {\n const key = `${nameKey || item.dataKey || 'value'}`\n const itemConfig = getPayloadConfigFromPayload(config, item, key)\n\n return (\n <div\n key={item.value}\n className={cn('flex items-center gap-1 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground')}\n >\n {itemConfig?.icon && !hideIcon ? (\n <itemConfig.icon />\n ) : (\n <div\n className=\"h-3 w-3 shrink-0 rounded-[2px]\"\n style={{\n backgroundColor: item.color\n }}\n />\n )}\n {itemConfig?.label}\n </div>\n )\n })}\n </div>\n )\n}\n\nfunction getPayloadConfigFromPayload(config: ChartConfig, payload: unknown, key: string) {\n if (typeof payload !== 'object' || payload === null) {\n return undefined\n }\n\n const payloadPayload =\n 'payload' in payload && typeof payload.payload === 'object' && payload.payload !== null\n ? payload.payload\n : undefined\n\n let configLabelKey: string = key\n\n if (key in payload && typeof payload[key as keyof typeof payload] === 'string') {\n configLabelKey = payload[key as keyof typeof payload] as string\n } else if (\n payloadPayload &&\n key in payloadPayload &&\n typeof payloadPayload[key as keyof typeof payloadPayload] === 'string'\n ) {\n configLabelKey = payloadPayload[key as keyof typeof payloadPayload] as string\n }\n\n return configLabelKey in config ? config[configLabelKey] : config[key as keyof typeof config]\n}\n\nexport {\n CHART_COLOR_KEYS,\n ChartContainer,\n ChartLegend,\n ChartLegendContent,\n ChartStyle,\n ChartTooltip,\n ChartTooltipContent\n}\n"],"mappings":"gMAOA,MAAM,EAAS,CAAE,MAAO,GAAI,KAAM,OAAQ,EAcpC,EAA6C,CACjD,UACA,QACA,OACA,OACA,MACA,SACA,QACA,OACA,SACA,MACF,EAEA,SAAgB,kBAAkB,EAA+C,CAC1E,KAIL,OAHK,EAAuC,SAAS,CAAK,EACjD,SAAS,EAAM,GAEjB,CACT,CAEA,MAAa,EAAwB,CACnC,iBACA,iBACA,iBACA,iBACA,gBACF,EA8CM,EAAe,EAAM,cAAwC,IAAI,EAEvE,SAAS,UAAW,CAClB,IAAM,EAAU,EAAM,WAAW,CAAY,EAE7C,GAAI,CAAC,EACH,MAAU,MAAM,mDAAmD,EAGrE,OAAO,CACT,CAEA,SAAS,eAAe,CAAE,KAAI,YAAW,WAAU,SAAQ,GAAG,GAA8B,CAC1F,IAAM,EAAW,EAAM,MAAM,EACvB,EAAU,SAAS,GAAM,EAAS,QAAQ,KAAM,EAAE,IAExD,OACE,EAAC,EAAa,SAAd,CAAuB,MAAO,CAAE,QAAO,WACrC,EAAC,MAAD,CACE,YAAU,QACV,aAAY,EACZ,UAAW,EACT,8pBACA,CACF,EACA,GAAI,WAEJ,EAAC,EAAkB,oBAAnB,CAAwC,UAAgD,CAAA,CACrF,CAAA,CACgB,CAAA,CAE3B,CAEA,MAAM,YAAc,CAAE,KAAI,YAA8B,CACtD,IAAM,EAAc,OAAO,QAAQ,CAAM,CAAC,CAAC,QAAQ,EAAG,KAAY,EAAO,OAAS,EAAO,KAAK,EAq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EC,EACE,OAAQ,GAAS,EAAK,OAAS,MAAM,CAAC,CACtC,IAAK,GAAS,CAEb,IAAM,EAAa,4BAA4B,EAAQ,EAAM,GAD9C,GAAW,EAAK,SAAW,SACsB,EAEhE,OACE,EAAC,MAAD,CAEE,UAAW,EAAG,+EAA+E,WAF/F,CAIG,GAAY,MAAQ,CAAC,EACpB,EAAC,EAAW,KAAZ,CAAkB,CAAA,EAElB,EAAC,MAAD,CACE,UAAU,iCACV,MAAO,CACL,gBAAiB,EAAK,KACxB,CACD,CAAA,EAEF,GAAY,KACV,GAdE,EAAK,KAcP,CAET,CAAC,CACA,CAAA,EApCE,IAsCX,CAEA,SAAS,4BAA4B,EAAqB,EAAkB,EAAa,CACvF,GAAI,OAAO,GAAY,WAAY,EACjC,OAGF,IAAM,EACJ,YAAa,GAAW,OAAO,EAAQ,SAAY,UAAY,EAAQ,UAAY,KAC/E,EAAQ,QACR,IAAA,GAEF,EAAyB,EAY7B,OAVI,KAAO,GAAW,OAAO,EAAQ,IAAiC,SACpE,EAAiB,EAAQ,GAEzB,GACA,KAAO,GACP,OAAO,EAAe,IAAwC,WAE9D,EAAiB,EAAe,IAG3B,KAAkB,EAAS,EAAO,GAAkB,EAAO,EACpE"}
@@ -23,7 +23,9 @@ type ComboboxLabelProps = Combobox$1.GroupLabel.Props;
23
23
  type ComboboxCollectionProps = Combobox$1.Collection.Props;
24
24
  type ComboboxEmptyProps = Combobox$1.Empty.Props;
25
25
  type ComboboxSeparatorProps = Combobox$1.Separator.Props;
26
- type ComboboxChipsProps = React.ComponentPropsWithRef<typeof Combobox$1.Chips> & Combobox$1.Chips.Props;
26
+ type ComboboxChipsProps = React.ComponentPropsWithRef<typeof Combobox$1.Chips> & Combobox$1.Chips.Props & {
27
+ showClear?: boolean;
28
+ };
27
29
  type ComboboxChipProps = Combobox$1.Chip.Props & {
28
30
  showRemove?: boolean;
29
31
  };
@@ -93,6 +95,8 @@ declare function ComboboxSeparator({
93
95
  }: ComboboxSeparatorProps): React.JSX.Element;
94
96
  declare function ComboboxChips({
95
97
  className,
98
+ children,
99
+ showClear,
96
100
  ...props
97
101
  }: ComboboxChipsProps): React.JSX.Element;
98
102
  declare function ComboboxChip({
@@ -1,2 +1,2 @@
1
- import"../rolldown-runtime-Bdj-bS2b.js";import{cn as e}from"../lib/utils.js";import{Button as t}from"./button.js";import{useFieldControlId as n}from"./field.js";import{InputGroup as r,InputGroupAddon as i,InputGroupButton as a,InputGroupInput as o}from"./input-group.js";import{IconCheck as s,IconSelector as c,IconX as l}from"@tabler/icons-react";import{jsx as u,jsxs as d}from"react/jsx-runtime";import*as f from"react";import{Combobox as p}from"@base-ui/react";const m=p.Root;function ComboboxValue({...e}){return u(p.Value,{"data-slot":`combobox-value`,...e})}function ComboboxTrigger({className:t,children:n,icon:r=u(c,{className:`pointer-events-none size-4 text-muted-foreground`}),...i}){return d(p.Trigger,{"data-slot":`combobox-trigger`,className:e(`[&_svg:not([class*='size-'])]:size-4`,t),...i,children:[n,r]})}function ComboboxClear({className:t,...n}){return u(p.Clear,{"data-slot":`combobox-clear`,render:u(a,{variant:`ghost`,size:`icon-xs`}),className:e(t),...n,children:u(l,{className:`pointer-events-none`})})}function ComboboxInput({className:t,children:s,disabled:c=!1,icon:l,id:f,showTrigger:m=!0,showClear:h=!1,triggerIcon:g,..._}){let v=n(f);return d(r,{className:e(`w-auto`,t),children:[l&&u(i,{align:`inline-start`,children:l}),u(p.Input,{id:v,render:u(o,{disabled:c}),..._}),d(i,{align:`inline-end`,children:[m&&u(a,{size:`icon-xs`,variant:`ghost`,asChild:!0,"data-slot":`input-group-button`,className:`group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent`,disabled:c,children:u(ComboboxTrigger,{icon:g})}),h&&u(ComboboxClear,{disabled:c})]}),s]})}function ComboboxContent({className:t,side:n=`bottom`,sideOffset:r=6,align:i=`start`,alignOffset:a=0,anchor:o,container:s,...c}){return u(p.Portal,{container:s,className:`absolute`,children:u(p.Positioner,{side:n,sideOffset:r,align:i,alignOffset:a,anchor:o,className:`isolate z-50`,children:u(p.Popup,{"data-slot":`combobox-content`,"data-chips":!!o,className:e(`group/combobox-content max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+(--spacing(7)))] origin-(--transform-origin) overflow-hidden rounded-lg text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[chips=true]:min-w-(--anchor-width) data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-8 *:data-[slot=input-group]:border-input/30 *:data-[slot=input-group]:bg-input/30 *:data-[slot=input-group]:shadow-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 animate-none! relative bg-popover/70 before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit] before:backdrop-blur-2xl before:backdrop-saturate-150 **:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10 **:data-[slot$=-separator]:bg-foreground/5 **:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10! **:data-[variant=destructive]:focus:bg-foreground/10! **:data-[variant=destructive]:text-accent-foreground! **:data-[variant=destructive]:**:text-accent-foreground!`,t),...c})})})}function ComboboxList({className:t,...n}){return u(p.List,{"data-slot":`combobox-list`,className:e(`no-scrollbar max-h-[min(calc(--spacing(72)-(--spacing(9))),calc(var(--available-height)-(--spacing(9))))] scroll-py-1 overflow-y-auto overscroll-contain p-1 data-empty:p-0`,t),...n})}function ComboboxItem({className:t,children:n,...r}){return d(p.Item,{"data-slot":`combobox-item`,className:e(`relative flex w-full cursor-default items-center gap-2 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,t),...r,children:[n,u(p.ItemIndicator,{render:u(`span`,{className:`pointer-events-none absolute right-2 flex size-4 items-center justify-center`}),children:u(s,{className:`pointer-events-none`})})]})}function ComboboxGroup({className:t,...n}){return u(p.Group,{"data-slot":`combobox-group`,className:e(t),...n})}function ComboboxLabel({className:t,...n}){return u(p.GroupLabel,{"data-slot":`combobox-label`,className:e(`px-2 py-1.5 text-xs text-muted-foreground`,t),...n})}function ComboboxCollection({...e}){return u(p.Collection,{"data-slot":`combobox-collection`,...e})}function ComboboxEmpty({className:t,...n}){return u(p.Empty,{"data-slot":`combobox-empty`,className:e(`hidden w-full justify-center py-2 text-center text-sm text-muted-foreground group-data-empty/combobox-content:flex`,t),...n})}function ComboboxSeparator({className:t,...n}){return u(p.Separator,{"data-slot":`combobox-separator`,className:e(`-mx-1 my-1 h-px bg-border`,t),...n})}function ComboboxChips({className:t,...n}){return u(p.Chips,{"data-slot":`combobox-chips`,className:e(`flex min-h-8 overflow-hidden flex-wrap items-center gap-1 rounded-lg border border-input bg-transparent bg-clip-padding px-2.5 py-1 text-sm transition-colors focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50 has-aria-invalid:border-destructive has-aria-invalid:ring-3 has-aria-invalid:ring-destructive/20 has-data-[slot=combobox-chip]:px-1 dark:bg-input/30 dark:has-aria-invalid:border-destructive/50 dark:has-aria-invalid:ring-destructive/40`,t),...n})}function ComboboxChip({className:n,children:r,showRemove:i=!0,...a}){return d(p.Chip,{"data-slot":`combobox-chip`,className:e(`flex h-[calc(--spacing(5.25))] w-fit text-left max-w-full items-center justify-start gap-1 rounded-sm bg-muted px-1.5 text-xs font-medium whitespace-nowrap text-foreground has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50 has-data-[slot=combobox-chip-remove]:pr-0`,n),...a,children:[u(`span`,{className:`flex-1 truncate`,children:r}),i&&u(p.ChipRemove,{render:u(t,{variant:`ghost`,color:`zinc`,size:`icon-xs`}),className:`-ml-1 opacity-50 shrink-0 hover:opacity-100`,"data-slot":`combobox-chip-remove`,children:u(l,{className:`pointer-events-none`})})]})}function ComboboxChipsInput({className:t,id:r,...i}){let a=n(r);return u(p.Input,{id:a,"data-slot":`combobox-chip-input`,className:e(`min-w-16 flex-1 outline-none`,t),...i})}function useComboboxAnchor(){return f.useRef(null)}export{m as Combobox,ComboboxChip,ComboboxChips,ComboboxChipsInput,ComboboxClear,ComboboxCollection,ComboboxContent,ComboboxEmpty,ComboboxGroup,ComboboxInput,ComboboxItem,ComboboxLabel,ComboboxList,ComboboxSeparator,ComboboxTrigger,ComboboxValue,useComboboxAnchor};
1
+ import"../rolldown-runtime-Bdj-bS2b.js";import{cn as e}from"../lib/utils.js";import{Button as t}from"./button.js";import{useFieldControlId as n}from"./field.js";import{InputGroup as r,InputGroupAddon as i,InputGroupButton as a,InputGroupInput as o}from"./input-group.js";import{IconCheck as s,IconSelector as c,IconX as l}from"@tabler/icons-react";import{jsx as u,jsxs as d}from"react/jsx-runtime";import*as f from"react";import{Combobox as p}from"@base-ui/react";const m=p.Root;function ComboboxValue({...e}){return u(p.Value,{"data-slot":`combobox-value`,...e})}function ComboboxTrigger({className:t,children:n,icon:r=u(c,{className:`pointer-events-none size-4 text-muted-foreground`}),...i}){return d(p.Trigger,{"data-slot":`combobox-trigger`,className:e(`[&_svg:not([class*='size-'])]:size-4`,t),...i,children:[n,r]})}function ComboboxClear({className:t,...n}){return u(p.Clear,{"data-slot":`combobox-clear`,render:u(a,{variant:`ghost`,size:`icon-xs`}),className:e(t),...n,children:u(l,{className:`pointer-events-none`})})}function ComboboxInput({className:t,children:s,disabled:c=!1,icon:l,id:f,showTrigger:m=!0,showClear:h=!1,triggerIcon:g,..._}){let v=n(f);return d(r,{className:e(`w-auto`,t),children:[l&&u(i,{align:`inline-start`,children:l}),u(p.Input,{id:v,render:u(o,{disabled:c}),..._}),d(i,{align:`inline-end`,children:[m&&u(a,{size:`icon-xs`,variant:`ghost`,asChild:!0,"data-slot":`input-group-button`,className:`group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent`,disabled:c,children:u(ComboboxTrigger,{icon:g})}),h&&u(ComboboxClear,{disabled:c})]}),s]})}function ComboboxContent({className:t,side:n=`bottom`,sideOffset:r=6,align:i=`start`,alignOffset:a=0,anchor:o,container:s,...c}){return u(p.Portal,{container:s,className:`absolute`,children:u(p.Positioner,{side:n,sideOffset:r,align:i,alignOffset:a,anchor:o,className:`isolate z-50`,children:u(p.Popup,{"data-slot":`combobox-content`,"data-chips":!!o,className:e(`group/combobox-content max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+(--spacing(7)))] origin-(--transform-origin) overflow-hidden rounded-lg text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[chips=true]:min-w-(--anchor-width) data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-8 *:data-[slot=input-group]:border-input/30 *:data-[slot=input-group]:bg-input/30 *:data-[slot=input-group]:shadow-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 animate-none! relative bg-popover/70 before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit] before:backdrop-blur-2xl before:backdrop-saturate-150 **:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10 **:data-[slot$=-separator]:bg-foreground/5 **:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10! **:data-[variant=destructive]:focus:bg-foreground/10! **:data-[variant=destructive]:text-accent-foreground! **:data-[variant=destructive]:**:text-accent-foreground!`,t),...c})})})}function ComboboxList({className:t,...n}){return u(p.List,{"data-slot":`combobox-list`,className:e(`no-scrollbar max-h-[min(calc(--spacing(72)-(--spacing(9))),calc(var(--available-height)-(--spacing(9))))] scroll-py-1 overflow-y-auto overscroll-contain p-1 data-empty:p-0`,t),...n})}function ComboboxItem({className:t,children:n,...r}){return d(p.Item,{"data-slot":`combobox-item`,className:e(`relative flex w-full cursor-default items-center gap-2 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,t),...r,children:[n,u(p.ItemIndicator,{render:u(`span`,{className:`pointer-events-none absolute right-2 flex size-4 items-center justify-center`}),children:u(s,{className:`pointer-events-none`})})]})}function ComboboxGroup({className:t,...n}){return u(p.Group,{"data-slot":`combobox-group`,className:e(t),...n})}function ComboboxLabel({className:t,...n}){return u(p.GroupLabel,{"data-slot":`combobox-label`,className:e(`px-2 py-1.5 text-xs text-muted-foreground`,t),...n})}function ComboboxCollection({...e}){return u(p.Collection,{"data-slot":`combobox-collection`,...e})}function ComboboxEmpty({className:t,...n}){return u(p.Empty,{"data-slot":`combobox-empty`,className:e(`hidden w-full justify-center py-2 text-center text-sm text-muted-foreground group-data-empty/combobox-content:flex`,t),...n})}function ComboboxSeparator({className:t,...n}){return u(p.Separator,{"data-slot":`combobox-separator`,className:e(`-mx-1 my-1 h-px bg-border`,t),...n})}function ComboboxChips({className:n,children:r,showClear:i=!1,...a}){return d(p.Chips,{"data-slot":`combobox-chips`,className:e(`flex min-h-8 overflow-hidden flex-wrap items-center gap-1 rounded-lg border border-input bg-transparent bg-clip-padding px-2.5 py-1 text-sm transition-colors focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50 has-aria-invalid:border-destructive has-aria-invalid:ring-3 has-aria-invalid:ring-destructive/20 has-data-[slot=combobox-chip]:px-1 dark:bg-input/30 dark:has-aria-invalid:border-destructive/50 dark:has-aria-invalid:ring-destructive/40`,n),...a,children:[r,i&&u(p.Clear,{"data-slot":`combobox-chips-clear`,render:u(t,{variant:`ghost`,color:`zinc`,size:`icon-xs`}),className:`shrink-0 self-center size-5`,children:u(l,{className:`pointer-events-none`})})]})}function ComboboxChip({className:n,children:r,showRemove:i=!0,...a}){return d(p.Chip,{"data-slot":`combobox-chip`,className:e(`flex h-[calc(--spacing(5.25))] w-fit text-left max-w-full items-center justify-start gap-1 rounded-sm bg-muted px-1.5 text-xs font-medium whitespace-nowrap text-foreground has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50 has-data-[slot=combobox-chip-remove]:pr-0`,n),...a,children:[u(`span`,{className:`flex-1 truncate`,children:r}),i&&u(p.ChipRemove,{render:u(t,{variant:`ghost`,color:`zinc`,size:`icon-xs`}),className:`-ml-1 opacity-50 shrink-0 hover:opacity-100`,"data-slot":`combobox-chip-remove`,children:u(l,{className:`pointer-events-none`})})]})}function ComboboxChipsInput({className:t,id:r,...i}){let a=n(r);return u(p.Input,{id:a,"data-slot":`combobox-chip-input`,className:e(`min-w-16 flex-1 outline-none`,t),...i})}function useComboboxAnchor(){return f.useRef(null)}export{m as Combobox,ComboboxChip,ComboboxChips,ComboboxChipsInput,ComboboxClear,ComboboxCollection,ComboboxContent,ComboboxEmpty,ComboboxGroup,ComboboxInput,ComboboxItem,ComboboxLabel,ComboboxList,ComboboxSeparator,ComboboxTrigger,ComboboxValue,useComboboxAnchor};
2
2
  //# sourceMappingURL=combobox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"combobox.js","names":["ComboboxPrimitive"],"sources":["../../src/components/combobox.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { Combobox as ComboboxPrimitive } from '@base-ui/react'\nimport { IconCheck, IconSelector, IconX } from '@tabler/icons-react'\n\nimport { cn } from '../lib/utils'\nimport { Button } from './button'\nimport { useFieldControlId } from './field'\nimport { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from './input-group'\n\nexport type ComboboxProps = React.ComponentProps<typeof ComboboxPrimitive.Root>\n\nexport type ComboboxValueProps = ComboboxPrimitive.Value.Props\n\nexport type ComboboxTriggerProps = ComboboxPrimitive.Trigger.Props & {\n icon?: React.ReactNode\n}\n\nexport type ComboboxClearProps = ComboboxPrimitive.Clear.Props\n\nexport type ComboboxInputProps = ComboboxPrimitive.Input.Props & {\n icon?: React.ReactNode\n triggerIcon?: React.ReactNode\n showTrigger?: boolean\n showClear?: boolean\n}\n\nexport type ComboboxContentProps = ComboboxPrimitive.Popup.Props &\n Pick<ComboboxPrimitive.Positioner.Props, 'side' | 'align' | 'sideOffset' | 'alignOffset' | 'anchor'> &\n Pick<ComboboxPrimitive.Portal.Props, 'container'>\n\nexport type ComboboxListProps = ComboboxPrimitive.List.Props\n\nexport type ComboboxItemProps = ComboboxPrimitive.Item.Props\n\nexport type ComboboxGroupProps = ComboboxPrimitive.Group.Props\n\nexport type ComboboxLabelProps = ComboboxPrimitive.GroupLabel.Props\n\nexport type ComboboxCollectionProps = ComboboxPrimitive.Collection.Props\n\nexport type ComboboxEmptyProps = ComboboxPrimitive.Empty.Props\n\nexport type ComboboxSeparatorProps = ComboboxPrimitive.Separator.Props\n\nexport type ComboboxChipsProps = React.ComponentPropsWithRef<typeof ComboboxPrimitive.Chips> &\n ComboboxPrimitive.Chips.Props\n\nexport type ComboboxChipProps = ComboboxPrimitive.Chip.Props & {\n showRemove?: boolean\n}\n\nexport type ComboboxChipsInputProps = ComboboxPrimitive.Input.Props\n\nconst Combobox = ComboboxPrimitive.Root\n\nfunction ComboboxValue({ ...props }: ComboboxValueProps) {\n return <ComboboxPrimitive.Value data-slot=\"combobox-value\" {...props} />\n}\n\nfunction ComboboxTrigger({\n className,\n children,\n icon = <IconSelector className=\"pointer-events-none size-4 text-muted-foreground\" />,\n ...props\n}: ComboboxTriggerProps) {\n return (\n <ComboboxPrimitive.Trigger\n data-slot=\"combobox-trigger\"\n className={cn(\"[&_svg:not([class*='size-'])]:size-4\", className)}\n {...props}\n >\n {children}\n {icon}\n </ComboboxPrimitive.Trigger>\n )\n}\n\nfunction ComboboxClear({ className, ...props }: ComboboxClearProps) {\n return (\n <ComboboxPrimitive.Clear\n data-slot=\"combobox-clear\"\n render={<InputGroupButton variant=\"ghost\" size=\"icon-xs\" />}\n className={cn(className)}\n {...props}\n >\n <IconX className=\"pointer-events-none\" />\n </ComboboxPrimitive.Clear>\n )\n}\n\nfunction ComboboxInput({\n className,\n children,\n disabled = false,\n icon,\n id,\n showTrigger = true,\n showClear = false,\n triggerIcon,\n ...props\n}: ComboboxInputProps) {\n const fieldControlId = useFieldControlId(id)\n\n return (\n <InputGroup className={cn('w-auto', className)}>\n {icon && <InputGroupAddon align=\"inline-start\">{icon}</InputGroupAddon>}\n <ComboboxPrimitive.Input id={fieldControlId} render={<InputGroupInput disabled={disabled} />} {...props} />\n <InputGroupAddon align=\"inline-end\">\n {showTrigger && (\n <InputGroupButton\n size=\"icon-xs\"\n variant=\"ghost\"\n asChild\n data-slot=\"input-group-button\"\n className=\"group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent\"\n disabled={disabled}\n >\n <ComboboxTrigger icon={triggerIcon} />\n </InputGroupButton>\n )}\n {showClear && <ComboboxClear disabled={disabled} />}\n </InputGroupAddon>\n {children}\n </InputGroup>\n )\n}\n\nfunction ComboboxContent({\n className,\n side = 'bottom',\n sideOffset = 6,\n align = 'start',\n alignOffset = 0,\n anchor,\n container,\n ...props\n}: ComboboxContentProps) {\n return (\n <ComboboxPrimitive.Portal container={container} className=\"absolute\">\n <ComboboxPrimitive.Positioner\n side={side}\n sideOffset={sideOffset}\n align={align}\n alignOffset={alignOffset}\n anchor={anchor}\n className=\"isolate z-50\"\n >\n <ComboboxPrimitive.Popup\n data-slot=\"combobox-content\"\n data-chips={!!anchor}\n className={cn(\n 'group/combobox-content max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+(--spacing(7)))] origin-(--transform-origin) overflow-hidden rounded-lg text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[chips=true]:min-w-(--anchor-width) data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-8 *:data-[slot=input-group]:border-input/30 *:data-[slot=input-group]:bg-input/30 *:data-[slot=input-group]:shadow-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 animate-none! relative bg-popover/70 before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit] before:backdrop-blur-2xl before:backdrop-saturate-150 **:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10 **:data-[slot$=-separator]:bg-foreground/5 **:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10! **:data-[variant=destructive]:focus:bg-foreground/10! **:data-[variant=destructive]:text-accent-foreground! **:data-[variant=destructive]:**:text-accent-foreground!',\n className\n )}\n {...props}\n />\n </ComboboxPrimitive.Positioner>\n </ComboboxPrimitive.Portal>\n )\n}\n\nfunction ComboboxList({ className, ...props }: ComboboxListProps) {\n return (\n <ComboboxPrimitive.List\n data-slot=\"combobox-list\"\n className={cn(\n 'no-scrollbar max-h-[min(calc(--spacing(72)-(--spacing(9))),calc(var(--available-height)-(--spacing(9))))] scroll-py-1 overflow-y-auto overscroll-contain p-1 data-empty:p-0',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction ComboboxItem({ className, children, ...props }: ComboboxItemProps) {\n return (\n <ComboboxPrimitive.Item\n data-slot=\"combobox-item\"\n className={cn(\n \"relative flex w-full cursor-default items-center gap-2 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n {children}\n <ComboboxPrimitive.ItemIndicator\n render={<span className=\"pointer-events-none absolute right-2 flex size-4 items-center justify-center\" />}\n >\n <IconCheck className=\"pointer-events-none\" />\n </ComboboxPrimitive.ItemIndicator>\n </ComboboxPrimitive.Item>\n )\n}\n\nfunction ComboboxGroup({ className, ...props }: ComboboxGroupProps) {\n return <ComboboxPrimitive.Group data-slot=\"combobox-group\" className={cn(className)} {...props} />\n}\n\nfunction ComboboxLabel({ className, ...props }: ComboboxLabelProps) {\n return (\n <ComboboxPrimitive.GroupLabel\n data-slot=\"combobox-label\"\n className={cn('px-2 py-1.5 text-xs text-muted-foreground', className)}\n {...props}\n />\n )\n}\n\nfunction ComboboxCollection({ ...props }: ComboboxCollectionProps) {\n return <ComboboxPrimitive.Collection data-slot=\"combobox-collection\" {...props} />\n}\n\nfunction ComboboxEmpty({ className, ...props }: ComboboxEmptyProps) {\n return (\n <ComboboxPrimitive.Empty\n data-slot=\"combobox-empty\"\n className={cn(\n 'hidden w-full justify-center py-2 text-center text-sm text-muted-foreground group-data-empty/combobox-content:flex',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction ComboboxSeparator({ className, ...props }: ComboboxSeparatorProps) {\n return (\n <ComboboxPrimitive.Separator\n data-slot=\"combobox-separator\"\n className={cn('-mx-1 my-1 h-px bg-border', className)}\n {...props}\n />\n )\n}\n\nfunction ComboboxChips({ className, ...props }: ComboboxChipsProps) {\n return (\n <ComboboxPrimitive.Chips\n data-slot=\"combobox-chips\"\n className={cn(\n 'flex min-h-8 overflow-hidden flex-wrap items-center gap-1 rounded-lg border border-input bg-transparent bg-clip-padding px-2.5 py-1 text-sm transition-colors focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50 has-aria-invalid:border-destructive has-aria-invalid:ring-3 has-aria-invalid:ring-destructive/20 has-data-[slot=combobox-chip]:px-1 dark:bg-input/30 dark:has-aria-invalid:border-destructive/50 dark:has-aria-invalid:ring-destructive/40',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction ComboboxChip({ className, children, showRemove = true, ...props }: ComboboxChipProps) {\n return (\n <ComboboxPrimitive.Chip\n data-slot=\"combobox-chip\"\n className={cn(\n 'flex h-[calc(--spacing(5.25))] w-fit text-left max-w-full items-center justify-start gap-1 rounded-sm bg-muted px-1.5 text-xs font-medium whitespace-nowrap text-foreground has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50 has-data-[slot=combobox-chip-remove]:pr-0',\n className\n )}\n {...props}\n >\n <span className=\"flex-1 truncate\">{children}</span>\n {showRemove && (\n <ComboboxPrimitive.ChipRemove\n render={<Button variant=\"ghost\" color=\"zinc\" size=\"icon-xs\" />}\n className=\"-ml-1 opacity-50 shrink-0 hover:opacity-100\"\n data-slot=\"combobox-chip-remove\"\n >\n <IconX className=\"pointer-events-none\" />\n </ComboboxPrimitive.ChipRemove>\n )}\n </ComboboxPrimitive.Chip>\n )\n}\n\nfunction ComboboxChipsInput({ className, id, ...props }: ComboboxChipsInputProps) {\n const fieldControlId = useFieldControlId(id)\n\n return (\n <ComboboxPrimitive.Input\n id={fieldControlId}\n data-slot=\"combobox-chip-input\"\n className={cn('min-w-16 flex-1 outline-none', className)}\n {...props}\n />\n )\n}\n\nfunction useComboboxAnchor() {\n return React.useRef<HTMLDivElement | null>(null)\n}\n\nexport {\n Combobox,\n ComboboxChip,\n ComboboxChips,\n ComboboxChipsInput,\n ComboboxClear,\n ComboboxCollection,\n ComboboxContent,\n ComboboxEmpty,\n ComboboxGroup,\n ComboboxInput,\n ComboboxItem,\n ComboboxLabel,\n ComboboxList,\n ComboboxSeparator,\n ComboboxTrigger,\n ComboboxValue,\n useComboboxAnchor\n}\n"],"mappings":"gdAsDA,MAAM,EAAWA,EAAkB,KAEnC,SAAS,cAAc,CAAE,GAAG,GAA6B,CACvD,OAAO,EAACA,EAAkB,MAAnB,CAAyB,YAAU,iBAAiB,GAAI,CAAQ,CAAA,CACzE,CAEA,SAAS,gBAAgB,CACvB,YACA,WACA,OAAO,EAAC,EAAD,CAAc,UAAU,kDAAoD,CAAA,EACnF,GAAG,GACoB,CACvB,OACE,EAACA,EAAkB,QAAnB,CACE,YAAU,mBACV,UAAW,EAAG,uCAAwC,CAAS,EAC/D,GAAI,WAHN,CAKG,EACA,CACwB,GAE/B,CAEA,SAAS,cAAc,CAAE,YAAW,GAAG,GAA6B,CAClE,OACE,EAACA,EAAkB,MAAnB,CACE,YAAU,iBACV,OAAQ,EAAC,EAAD,CAAkB,QAAQ,QAAQ,KAAK,SAAW,CAAA,EAC1D,UAAW,EAAG,CAAS,EACvB,GAAI,WAEJ,EAAC,EAAD,CAAO,UAAU,qBAAuB,CAAA,CACjB,CAAA,CAE7B,CAEA,SAAS,cAAc,CACrB,YACA,WACA,WAAW,GACX,OACA,KACA,cAAc,GACd,YAAY,GACZ,cACA,GAAG,GACkB,CACrB,IAAM,EAAiB,EAAkB,CAAE,EAE3C,OACE,EAAC,EAAD,CAAY,UAAW,EAAG,SAAU,CAAS,WAA7C,CACG,GAAQ,EAAC,EAAD,CAAiB,MAAM,wBAAgB,CAAsB,CAAA,EACtE,EAACA,EAAkB,MAAnB,CAAyB,GAAI,EAAgB,OAAQ,EAAC,EAAD,CAA2B,UAAW,CAAA,EAAG,GAAI,CAAQ,CAAA,EAC1G,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A,CAEL,CAEA,SAAS,mBAAoB,CAC3B,OAAO,EAAM,OAA8B,IAAI,CACjD"}
1
+ {"version":3,"file":"combobox.js","names":["ComboboxPrimitive"],"sources":["../../src/components/combobox.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { Combobox as ComboboxPrimitive } from '@base-ui/react'\nimport { IconCheck, IconSelector, IconX } from '@tabler/icons-react'\n\nimport { cn } from '../lib/utils'\nimport { Button } from './button'\nimport { useFieldControlId } from './field'\nimport { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from './input-group'\n\nexport type ComboboxProps = React.ComponentProps<typeof ComboboxPrimitive.Root>\n\nexport type ComboboxValueProps = ComboboxPrimitive.Value.Props\n\nexport type ComboboxTriggerProps = ComboboxPrimitive.Trigger.Props & {\n icon?: React.ReactNode\n}\n\nexport type ComboboxClearProps = ComboboxPrimitive.Clear.Props\n\nexport type ComboboxInputProps = ComboboxPrimitive.Input.Props & {\n icon?: React.ReactNode\n triggerIcon?: React.ReactNode\n showTrigger?: boolean\n showClear?: boolean\n}\n\nexport type ComboboxContentProps = ComboboxPrimitive.Popup.Props &\n Pick<ComboboxPrimitive.Positioner.Props, 'side' | 'align' | 'sideOffset' | 'alignOffset' | 'anchor'> &\n Pick<ComboboxPrimitive.Portal.Props, 'container'>\n\nexport type ComboboxListProps = ComboboxPrimitive.List.Props\n\nexport type ComboboxItemProps = ComboboxPrimitive.Item.Props\n\nexport type ComboboxGroupProps = ComboboxPrimitive.Group.Props\n\nexport type ComboboxLabelProps = ComboboxPrimitive.GroupLabel.Props\n\nexport type ComboboxCollectionProps = ComboboxPrimitive.Collection.Props\n\nexport type ComboboxEmptyProps = ComboboxPrimitive.Empty.Props\n\nexport type ComboboxSeparatorProps = ComboboxPrimitive.Separator.Props\n\nexport type ComboboxChipsProps = React.ComponentPropsWithRef<typeof ComboboxPrimitive.Chips> &\n ComboboxPrimitive.Chips.Props & {\n showClear?: boolean\n }\n\nexport type ComboboxChipProps = ComboboxPrimitive.Chip.Props & {\n showRemove?: boolean\n}\n\nexport type ComboboxChipsInputProps = ComboboxPrimitive.Input.Props\n\nconst Combobox = ComboboxPrimitive.Root\n\nfunction ComboboxValue({ ...props }: ComboboxValueProps) {\n return <ComboboxPrimitive.Value data-slot=\"combobox-value\" {...props} />\n}\n\nfunction ComboboxTrigger({\n className,\n children,\n icon = <IconSelector className=\"pointer-events-none size-4 text-muted-foreground\" />,\n ...props\n}: ComboboxTriggerProps) {\n return (\n <ComboboxPrimitive.Trigger\n data-slot=\"combobox-trigger\"\n className={cn(\"[&_svg:not([class*='size-'])]:size-4\", className)}\n {...props}\n >\n {children}\n {icon}\n </ComboboxPrimitive.Trigger>\n )\n}\n\nfunction ComboboxClear({ className, ...props }: ComboboxClearProps) {\n return (\n <ComboboxPrimitive.Clear\n data-slot=\"combobox-clear\"\n render={<InputGroupButton variant=\"ghost\" size=\"icon-xs\" />}\n className={cn(className)}\n {...props}\n >\n <IconX className=\"pointer-events-none\" />\n </ComboboxPrimitive.Clear>\n )\n}\n\nfunction ComboboxInput({\n className,\n children,\n disabled = false,\n icon,\n id,\n showTrigger = true,\n showClear = false,\n triggerIcon,\n ...props\n}: ComboboxInputProps) {\n const fieldControlId = useFieldControlId(id)\n\n return (\n <InputGroup className={cn('w-auto', className)}>\n {icon && <InputGroupAddon align=\"inline-start\">{icon}</InputGroupAddon>}\n <ComboboxPrimitive.Input id={fieldControlId} render={<InputGroupInput disabled={disabled} />} {...props} />\n <InputGroupAddon align=\"inline-end\">\n {showTrigger && (\n <InputGroupButton\n size=\"icon-xs\"\n variant=\"ghost\"\n asChild\n data-slot=\"input-group-button\"\n className=\"group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent\"\n disabled={disabled}\n >\n <ComboboxTrigger icon={triggerIcon} />\n </InputGroupButton>\n )}\n {showClear && <ComboboxClear disabled={disabled} />}\n </InputGroupAddon>\n {children}\n </InputGroup>\n )\n}\n\nfunction ComboboxContent({\n className,\n side = 'bottom',\n sideOffset = 6,\n align = 'start',\n alignOffset = 0,\n anchor,\n container,\n ...props\n}: ComboboxContentProps) {\n return (\n <ComboboxPrimitive.Portal container={container} className=\"absolute\">\n <ComboboxPrimitive.Positioner\n side={side}\n sideOffset={sideOffset}\n align={align}\n alignOffset={alignOffset}\n anchor={anchor}\n className=\"isolate z-50\"\n >\n <ComboboxPrimitive.Popup\n data-slot=\"combobox-content\"\n data-chips={!!anchor}\n className={cn(\n 'group/combobox-content max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+(--spacing(7)))] origin-(--transform-origin) overflow-hidden rounded-lg text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[chips=true]:min-w-(--anchor-width) data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-8 *:data-[slot=input-group]:border-input/30 *:data-[slot=input-group]:bg-input/30 *:data-[slot=input-group]:shadow-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 animate-none! relative bg-popover/70 before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit] before:backdrop-blur-2xl before:backdrop-saturate-150 **:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10 **:data-[slot$=-separator]:bg-foreground/5 **:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10! **:data-[variant=destructive]:focus:bg-foreground/10! **:data-[variant=destructive]:text-accent-foreground! **:data-[variant=destructive]:**:text-accent-foreground!',\n className\n )}\n {...props}\n />\n </ComboboxPrimitive.Positioner>\n </ComboboxPrimitive.Portal>\n )\n}\n\nfunction ComboboxList({ className, ...props }: ComboboxListProps) {\n return (\n <ComboboxPrimitive.List\n data-slot=\"combobox-list\"\n className={cn(\n 'no-scrollbar max-h-[min(calc(--spacing(72)-(--spacing(9))),calc(var(--available-height)-(--spacing(9))))] scroll-py-1 overflow-y-auto overscroll-contain p-1 data-empty:p-0',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction ComboboxItem({ className, children, ...props }: ComboboxItemProps) {\n return (\n <ComboboxPrimitive.Item\n data-slot=\"combobox-item\"\n className={cn(\n \"relative flex w-full cursor-default items-center gap-2 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n {children}\n <ComboboxPrimitive.ItemIndicator\n render={<span className=\"pointer-events-none absolute right-2 flex size-4 items-center justify-center\" />}\n >\n <IconCheck className=\"pointer-events-none\" />\n </ComboboxPrimitive.ItemIndicator>\n </ComboboxPrimitive.Item>\n )\n}\n\nfunction ComboboxGroup({ className, ...props }: ComboboxGroupProps) {\n return <ComboboxPrimitive.Group data-slot=\"combobox-group\" className={cn(className)} {...props} />\n}\n\nfunction ComboboxLabel({ className, ...props }: ComboboxLabelProps) {\n return (\n <ComboboxPrimitive.GroupLabel\n data-slot=\"combobox-label\"\n className={cn('px-2 py-1.5 text-xs text-muted-foreground', className)}\n {...props}\n />\n )\n}\n\nfunction ComboboxCollection({ ...props }: ComboboxCollectionProps) {\n return <ComboboxPrimitive.Collection data-slot=\"combobox-collection\" {...props} />\n}\n\nfunction ComboboxEmpty({ className, ...props }: ComboboxEmptyProps) {\n return (\n <ComboboxPrimitive.Empty\n data-slot=\"combobox-empty\"\n className={cn(\n 'hidden w-full justify-center py-2 text-center text-sm text-muted-foreground group-data-empty/combobox-content:flex',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction ComboboxSeparator({ className, ...props }: ComboboxSeparatorProps) {\n return (\n <ComboboxPrimitive.Separator\n data-slot=\"combobox-separator\"\n className={cn('-mx-1 my-1 h-px bg-border', className)}\n {...props}\n />\n )\n}\n\nfunction ComboboxChips({ className, children, showClear = false, ...props }: ComboboxChipsProps) {\n return (\n <ComboboxPrimitive.Chips\n data-slot=\"combobox-chips\"\n className={cn(\n 'flex min-h-8 overflow-hidden flex-wrap items-center gap-1 rounded-lg border border-input bg-transparent bg-clip-padding px-2.5 py-1 text-sm transition-colors focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50 has-aria-invalid:border-destructive has-aria-invalid:ring-3 has-aria-invalid:ring-destructive/20 has-data-[slot=combobox-chip]:px-1 dark:bg-input/30 dark:has-aria-invalid:border-destructive/50 dark:has-aria-invalid:ring-destructive/40',\n className\n )}\n {...props}\n >\n {children}\n {showClear && (\n <ComboboxPrimitive.Clear\n data-slot=\"combobox-chips-clear\"\n render={<Button variant=\"ghost\" color=\"zinc\" size=\"icon-xs\" />}\n className=\"shrink-0 self-center size-5\"\n >\n <IconX className=\"pointer-events-none\" />\n </ComboboxPrimitive.Clear>\n )}\n </ComboboxPrimitive.Chips>\n )\n}\n\nfunction ComboboxChip({ className, children, showRemove = true, ...props }: ComboboxChipProps) {\n return (\n <ComboboxPrimitive.Chip\n data-slot=\"combobox-chip\"\n className={cn(\n 'flex h-[calc(--spacing(5.25))] w-fit text-left max-w-full items-center justify-start gap-1 rounded-sm bg-muted px-1.5 text-xs font-medium whitespace-nowrap text-foreground has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50 has-data-[slot=combobox-chip-remove]:pr-0',\n className\n )}\n {...props}\n >\n <span className=\"flex-1 truncate\">{children}</span>\n {showRemove && (\n <ComboboxPrimitive.ChipRemove\n render={<Button variant=\"ghost\" color=\"zinc\" size=\"icon-xs\" />}\n className=\"-ml-1 opacity-50 shrink-0 hover:opacity-100\"\n data-slot=\"combobox-chip-remove\"\n >\n <IconX className=\"pointer-events-none\" />\n </ComboboxPrimitive.ChipRemove>\n )}\n </ComboboxPrimitive.Chip>\n )\n}\n\nfunction ComboboxChipsInput({ className, id, ...props }: ComboboxChipsInputProps) {\n const fieldControlId = useFieldControlId(id)\n\n return (\n <ComboboxPrimitive.Input\n id={fieldControlId}\n data-slot=\"combobox-chip-input\"\n className={cn('min-w-16 flex-1 outline-none', className)}\n {...props}\n />\n )\n}\n\nfunction useComboboxAnchor() {\n return React.useRef<HTMLDivElement | null>(null)\n}\n\nexport {\n Combobox,\n ComboboxChip,\n ComboboxChips,\n ComboboxChipsInput,\n ComboboxClear,\n ComboboxCollection,\n ComboboxContent,\n ComboboxEmpty,\n ComboboxGroup,\n ComboboxInput,\n ComboboxItem,\n ComboboxLabel,\n ComboboxList,\n ComboboxSeparator,\n ComboboxTrigger,\n ComboboxValue,\n useComboboxAnchor\n}\n"],"mappings":"gdAwDA,MAAM,EAAWA,EAAkB,KAEnC,SAAS,cAAc,CAAE,GAAG,GAA6B,CACvD,OAAO,EAACA,EAAkB,MAAnB,CAAyB,YAAU,iBAAiB,GAAI,CAAQ,CAAA,CACzE,CAEA,SAAS,gBAAgB,CACvB,YACA,WACA,OAAO,EAAC,EAAD,CAAc,UAAU,kDAAoD,CAAA,EACnF,GAAG,GACoB,CACvB,OACE,EAACA,EAAkB,QAAnB,CACE,YAAU,mBACV,UAAW,EAAG,uCAAwC,CAAS,EAC/D,GAAI,WAHN,CAKG,EACA,CACwB,GAE/B,CAEA,SAAS,cAAc,CAAE,YAAW,GAAG,GAA6B,CAClE,OACE,EAACA,EAAkB,MAAnB,CACE,YAAU,iBACV,OAAQ,EAAC,EAAD,CAAkB,QAAQ,QAAQ,KAAK,SAAW,CAAA,EAC1D,UAAW,EAAG,CAAS,EACvB,GAAI,WAEJ,EAAC,EAAD,CAAO,UAAU,qBAAuB,CAAA,CACjB,CAAA,CAE7B,CAEA,SAAS,cAAc,CACrB,Y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Aa,GAAM,GAAG,GAA4B,CAC7F,OACE,EAACA,EAAkB,KAAnB,CACE,YAAU,gBACV,UAAW,EACT,iTACA,CACF,EACA,GAAI,WANN,CAQE,EAAC,OAAD,CAAM,UAAU,kBAAmB,UAAe,CAAA,EACjD,GACC,EAACA,EAAkB,WAAnB,CACE,OAAQ,EAAC,EAAD,CAAQ,QAAQ,QAAQ,MAAM,OAAO,KAAK,SAAW,CAAA,EAC7D,UAAU,8CACV,YAAU,gCAEV,EAAC,EAAD,CAAO,UAAU,qBAAuB,CAAA,CACZ,CAAA,CAEV,GAE5B,CAEA,SAAS,mBAAmB,CAAE,YAAW,KAAI,GAAG,GAAkC,CAChF,IAAM,EAAiB,EAAkB,CAAE,EAE3C,OACE,EAACA,EAAkB,MAAnB,CACE,GAAI,EACJ,YAAU,sBACV,UAAW,EAAG,+BAAgC,CAAS,EACvD,GAAI,CACL,CAAA,CAEL,CAEA,SAAS,mBAAoB,CAC3B,OAAO,EAAM,OAA8B,IAAI,CACjD"}
@@ -1,2 +1,2 @@
1
- import"../rolldown-runtime-Bdj-bS2b.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{Legend as l,Pie as u,PieChart as d,Tooltip as f}from"recharts";function buildPieConfig(e){return e.reduce((e,t,n)=>(e[t.name]={label:t.name,color:t.color??a(t.colorKey)??i[n%i.length]},e),{})}function PieChartBase({className:i,data:p,withTooltip:m=!0,withLegend:h=!1,withLabels:g=!1,labelsPosition:_=`outside`,startAngle:v=90,endAngle:y=-270,paddingAngle:b=0,strokeWidth:x=1,strokeColor:S=`var(--background)`,innerRadius:C=0,outerRadius:w=`80%`,animationDuration:T,tooltipProps:E,legendProps:D,pieProps:O,dataSlot:k,centerSlot:A,...j}){let M=c.useMemo(()=>buildPieConfig(p),[p]),N=a(S)??S,P=c.useMemo(()=>p.map(e=>({...e,fill:`var(--color-${e.name})`,stroke:N})),[p,N]);return o(t,{"data-slot":k,className:e(`relative aspect-square w-full`,i),config:M,...j,children:s(d,{children:[m&&o(f,{cursor:!1,content:o(r,{hideLabel:!0,...E})}),h&&o(l,{content:o(n,{nameKey:`name`,...D})}),o(u,{data:P,dataKey:`value`,nameKey:`name`,startAngle:v,endAngle:y,innerRadius:C,outerRadius:w,paddingAngle:b,strokeWidth:x,label:g?{fontSize:12}:void 0,labelLine:g&&_===`outside`,animationDuration:T,isAnimationActive:T!==0,...O,children:A})]})})}function PieChart(e){return o(PieChartBase,{...e,dataSlot:`pie-chart`})}export{PieChart,PieChartBase,buildPieConfig};
1
+ import"../rolldown-runtime-Bdj-bS2b.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{Legend as l,Pie as u,PieChart as d,Tooltip as f}from"recharts";function buildPieConfig(e){return e.reduce((e,t,n)=>(e[t.name]={label:t.name,color:t.color??a(t.colorKey)??i[n%i.length]},e),{})}function PieChartBase({className:i,data:p,withTooltip:m=!0,withLegend:h=!1,withLabels:g=!1,labelsPosition:_=`outside`,startAngle:v=90,endAngle:y=-270,paddingAngle:b=0,strokeWidth:x=1,strokeColor:S=`var(--background)`,innerRadius:C=0,outerRadius:w=`80%`,animationDuration:T,tooltipProps:E,legendProps:D,pieProps:O,dataSlot:k,centerSlot:A,...j}){let M=c.useMemo(()=>buildPieConfig(p),[p]),N=a(S)??S,P=c.useMemo(()=>p.map(e=>({...e,fill:M[e.name]?.color,stroke:N})),[p,N,M]);return o(t,{"data-slot":k,className:e(`relative aspect-square w-full`,i),config:M,...j,children:s(d,{children:[m&&o(f,{cursor:!1,content:o(r,{hideLabel:!0,...E})}),h&&o(l,{content:o(n,{nameKey:`name`,...D})}),o(u,{data:P,dataKey:`value`,nameKey:`name`,startAngle:v,endAngle:y,innerRadius:C,outerRadius:w,paddingAngle:b,strokeWidth:x,label:g?{fontSize:12}:void 0,labelLine:g&&_===`outside`,animationDuration:T,isAnimationActive:T!==0,...O,children:A})]})})}function PieChart(e){return o(PieChartBase,{...e,dataSlot:`pie-chart`})}export{PieChart,PieChartBase,buildPieConfig};
2
2
  //# sourceMappingURL=pie-chart.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pie-chart.js","names":["RechartsPieChart"],"sources":["../../src/components/pie-chart.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { Legend, Pie, PieChart as RechartsPieChart, Tooltip } 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 PieChartDatum = {\n name: string\n value: number\n color?: string\n colorKey?: ChartColorKey\n}\n\nexport type PieChartProps = Omit<React.ComponentProps<'div'>, 'children'> & {\n data: PieChartDatum[]\n withTooltip?: boolean\n withLegend?: boolean\n withLabels?: boolean\n labelsPosition?: 'inside' | 'outside'\n startAngle?: number\n endAngle?: number\n paddingAngle?: number\n strokeWidth?: number\n strokeColor?: ChartColorKey | string\n innerRadius?: number | string\n outerRadius?: number | string\n animationDuration?: number\n tooltipProps?: ChartTooltipContentProps\n legendProps?: ChartLegendContentProps\n pieProps?: Partial<React.ComponentProps<typeof Pie>>\n children?: React.ReactNode\n}\n\nexport function buildPieConfig(data: PieChartDatum[]): ChartConfig {\n return data.reduce<ChartConfig>((acc, item, index) => {\n acc[item.name] = {\n 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\nexport type PieChartBaseProps = Omit<PieChartProps, 'children'> & {\n dataSlot: string\n innerRadius?: number | string\n outerRadius?: number | string\n centerSlot?: React.ReactNode\n}\n\nfunction PieChartBase({\n className,\n data,\n withTooltip = true,\n withLegend = false,\n withLabels = false,\n labelsPosition = 'outside',\n startAngle = 90,\n endAngle = -270,\n paddingAngle = 0,\n strokeWidth = 1,\n strokeColor = 'var(--background)',\n innerRadius = 0,\n outerRadius = '80%',\n animationDuration,\n tooltipProps,\n legendProps,\n pieProps,\n dataSlot,\n centerSlot,\n ...props\n}: PieChartBaseProps) {\n const config = React.useMemo(() => buildPieConfig(data), [data])\n const resolvedStroke = resolveChartColor(strokeColor) ?? strokeColor\n const styledData = React.useMemo(\n () => data.map((item) => ({ ...item, fill: `var(--color-${item.name})`, stroke: resolvedStroke })),\n [data, resolvedStroke]\n )\n\n return (\n <ChartContainer\n data-slot={dataSlot}\n className={cn('relative aspect-square w-full', className)}\n config={config}\n {...props}\n >\n <RechartsPieChart>\n {withTooltip && <Tooltip cursor={false} content={<ChartTooltipContent hideLabel {...tooltipProps} />} />}\n {withLegend && <Legend content={<ChartLegendContent nameKey=\"name\" {...legendProps} />} />}\n <Pie\n data={styledData}\n dataKey=\"value\"\n nameKey=\"name\"\n startAngle={startAngle}\n endAngle={endAngle}\n innerRadius={innerRadius}\n outerRadius={outerRadius}\n paddingAngle={paddingAngle}\n strokeWidth={strokeWidth}\n label={withLabels ? { fontSize: 12 } : undefined}\n labelLine={withLabels && labelsPosition === 'outside'}\n animationDuration={animationDuration}\n isAnimationActive={animationDuration !== 0}\n {...pieProps}\n >\n {centerSlot}\n </Pie>\n </RechartsPieChart>\n </ChartContainer>\n )\n}\n\nfunction PieChart(props: PieChartProps) {\n return <PieChartBase {...props} dataSlot=\"pie-chart\" />\n}\n\nexport { PieChart, PieChartBase }\n"],"mappings":"4WA4CA,SAAgB,eAAe,EAAoC,CACjE,OAAO,EAAK,QAAqB,EAAK,EAAM,KAC1C,EAAI,EAAK,MAAQ,CACf,MAAO,EAAK,KACZ,MACE,EAAK,OAAS,EAA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components/pie-chart.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { Legend, Pie, PieChart as RechartsPieChart, Tooltip } 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 PieChartDatum = {\n name: string\n value: number\n color?: string\n colorKey?: ChartColorKey\n}\n\nexport type PieChartProps = Omit<React.ComponentProps<'div'>, 'children'> & {\n data: PieChartDatum[]\n withTooltip?: boolean\n withLegend?: boolean\n withLabels?: boolean\n labelsPosition?: 'inside' | 'outside'\n startAngle?: number\n endAngle?: number\n paddingAngle?: number\n strokeWidth?: number\n strokeColor?: ChartColorKey | string\n innerRadius?: number | string\n outerRadius?: number | string\n animationDuration?: number\n tooltipProps?: ChartTooltipContentProps\n legendProps?: ChartLegendContentProps\n pieProps?: Partial<React.ComponentProps<typeof Pie>>\n children?: React.ReactNode\n}\n\nexport function buildPieConfig(data: PieChartDatum[]): ChartConfig {\n return data.reduce<ChartConfig>((acc, item, index) => {\n acc[item.name] = {\n 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\nexport type PieChartBaseProps = Omit<PieChartProps, 'children'> & {\n dataSlot: string\n innerRadius?: number | string\n outerRadius?: number | string\n centerSlot?: React.ReactNode\n}\n\nfunction PieChartBase({\n className,\n data,\n withTooltip = true,\n withLegend = false,\n withLabels = false,\n labelsPosition = 'outside',\n startAngle = 90,\n endAngle = -270,\n paddingAngle = 0,\n strokeWidth = 1,\n strokeColor = 'var(--background)',\n innerRadius = 0,\n outerRadius = '80%',\n animationDuration,\n tooltipProps,\n legendProps,\n pieProps,\n dataSlot,\n centerSlot,\n ...props\n}: PieChartBaseProps) {\n const config = React.useMemo(() => buildPieConfig(data), [data])\n const resolvedStroke = resolveChartColor(strokeColor) ?? strokeColor\n const styledData = React.useMemo(\n () => data.map((item) => ({ ...item, fill: config[item.name]?.color, stroke: resolvedStroke })),\n [data, resolvedStroke, config]\n )\n\n return (\n <ChartContainer\n data-slot={dataSlot}\n className={cn('relative aspect-square w-full', className)}\n config={config}\n {...props}\n >\n <RechartsPieChart>\n {withTooltip && <Tooltip cursor={false} content={<ChartTooltipContent hideLabel {...tooltipProps} />} />}\n {withLegend && <Legend content={<ChartLegendContent nameKey=\"name\" {...legendProps} />} />}\n <Pie\n data={styledData}\n dataKey=\"value\"\n nameKey=\"name\"\n startAngle={startAngle}\n endAngle={endAngle}\n innerRadius={innerRadius}\n outerRadius={outerRadius}\n paddingAngle={paddingAngle}\n strokeWidth={strokeWidth}\n label={withLabels ? { fontSize: 12 } : undefined}\n labelLine={withLabels && labelsPosition === 'outside'}\n animationDuration={animationDuration}\n isAnimationActive={animationDuration !== 0}\n {...pieProps}\n >\n {centerSlot}\n </Pie>\n </RechartsPieChart>\n </ChartContainer>\n )\n}\n\nfunction PieChart(props: PieChartProps) {\n return <PieChartBase {...props} dataSlot=\"pie-chart\" />\n}\n\nexport { PieChart, PieChartBase }\n"],"mappings":"4WA4CA,SAAgB,eAAe,EAAoC,CACjE,OAAO,EAAK,QAAqB,EAAK,EAAM,KAC1C,EAAI,EAAK,MAAQ,CACf,MAAO,EAAK,KACZ,MACE,EAAK,OAAS,EAAkB,EAAK,QAAQ,GAAK,EAAsB,EAAQ,EAAsB,OAC1G,EACO,GACN,CAAC,CAAC,CACP,CASA,SAAS,aAAa,CACpB,YACA,OACA,cAAc,GACd,aAAa,GACb,aAAa,GACb,iBAAiB,UACjB,aAAa,GACb,WAAW,KACX,eAAe,EACf,cAAc,EACd,cAAc,oBACd,cAAc,EACd,cAAc,MACd,oBACA,eACA,cACA,WACA,WACA,aACA,GAAG,GACiB,CACpB,IAAM,EAAS,EAAM,YAAc,eAAe,CAAI,EAAG,CAAC,CAAI,CAAC,EACzD,EAAiB,EAAkB,CAAW,GAAK,EACnD,EAAa,EAAM,YACjB,EAAK,IAAK,IAAU,CAAE,GAAG,EAAM,KAAM,EAAO,EAAK,KAAK,EAAE,MAAO,OAAQ,CAAe,EAAE,EAC9F,CAAC,EAAM,EAAgB,CAAM,CAC/B,EAEA,OACE,EAAC,EAAD,CACE,YAAW,EACX,UAAW,EAAG,gCAAiC,CAAS,EAChD,SACR,GAAI,WAEJ,EAACA,EAAD,CAAA,SAAA,CACG,GAAe,EAAC,EAAD,CAAS,OAAQ,GAAO,QAAS,EAAC,EAAD,CAAqB,UAAA,GAAU,GAAI,CAAe,CAAA,CAAI,CAAA,EACtG,GAAc,EAAC,EAAD,CAAQ,QAAS,EAAC,EAAD,CAAoB,QAAQ,OAAO,GAAI,CAAc,CAAA,CAAI,CAAA,EACzF,EAAC,EAAD,CACE,KAAM,EACN,QAAQ,QACR,QAAQ,OACI,aACF,WACG,cACA,cACC,eACD,cACb,MAAO,EAAa,CAAE,SAAU,EAAG,EAAI,IAAA,GACvC,UAAW,GAAc,IAAmB,UACzB,oBACnB,kBAAmB,IAAsB,EACzC,GAAI,WAEH,CACE,CAAA,CACW,CAAA,CAAA,CACJ,CAAA,CAEpB,CAEA,SAAS,SAAS,EAAsB,CACtC,OAAO,EAAC,aAAD,CAAc,GAAI,EAAO,SAAS,WAAa,CAAA,CACxD"}
@@ -123,7 +123,7 @@ declare function SidebarMenuItem({
123
123
  ...props
124
124
  }: SidebarMenuItemProps): React.JSX.Element;
125
125
  declare const sidebarMenuButtonVariants: (props?: ({
126
- variant?: "outline" | "default" | null | undefined;
126
+ variant?: "default" | "outline" | null | undefined;
127
127
  size?: "sm" | "md" | "lg" | null | undefined;
128
128
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
129
129
  type SidebarMenuButtonProps = React.ComponentProps<'button'> & {
@@ -8,10 +8,10 @@ declare const timelineVariants: (props?: ({
8
8
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
9
9
  declare const timelineConnectorVariants: (props?: ({
10
10
  status?: "pending" | "completed" | "in-progress" | null | undefined;
11
- color?: "secondary" | "primary" | "destructive" | "muted" | "accent" | "gradient" | null | undefined;
11
+ color?: "destructive" | "secondary" | "primary" | "muted" | "accent" | "gradient" | null | undefined;
12
12
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
13
13
  declare const timelineIconVariants: (props?: ({
14
- color?: "secondary" | "primary" | "destructive" | "muted" | "accent" | null | undefined;
14
+ color?: "destructive" | "secondary" | "primary" | "muted" | "accent" | null | undefined;
15
15
  size?: "sm" | "md" | "lg" | null | undefined;
16
16
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
17
17
  type TimelineIconSize = NonNullable<VariantProps<typeof timelineIconVariants>['size']>;
@@ -0,0 +1,2 @@
1
+ import { i as getHotkeyHandler, n as useHotkeys, r as HotkeyItemOptions, t as HotkeyItem } from "../use-hotkeys-Cl1cV6e8.js";
2
+ export { HotkeyItem, type HotkeyItemOptions, getHotkeyHandler, useHotkeys };
@@ -0,0 +1 @@
1
+ import{n as e,t}from"../use-hotkeys-BOfOFxb5.js";export{e as getHotkeyHandler,t as useHotkeys};
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,2 @@
1
+ import"../rolldown-runtime-Bdj-bS2b.js";import{t as e}from"../use-hotkeys-BOfOFxb5.js";import{i as t}from"../react.esm-D88qr0ij.js";function dispatchKeydown(e,t){let n=new KeyboardEvent(`keydown`,{bubbles:!0,cancelable:!0,...t});return e.dispatchEvent(n),n}describe(`useHotkeys`,()=>{it(`runs the handler when the matching hotkey is pressed`,()=>{let n=vi.fn();t(()=>e([[`mod+k`,n]])),dispatchKeydown(document.documentElement,{key:`k`,metaKey:!0}),expect(n).toHaveBeenCalledTimes(1)}),it(`prevents the default behavior by default`,()=>{let n=vi.fn();t(()=>e([[`mod+k`,n]]));let r=dispatchKeydown(document.documentElement,{key:`k`,metaKey:!0});expect(r.defaultPrevented).toBe(!0)}),it(`does not prevent the default behavior when the option is disabled`,()=>{let n=vi.fn();t(()=>e([[`mod+k`,n,{preventDefault:!1}]]));let r=dispatchKeydown(document.documentElement,{key:`k`,metaKey:!0});expect(n).toHaveBeenCalledTimes(1),expect(r.defaultPrevented).toBe(!1)}),it(`ignores events coming from form controls by default`,()=>{let n=vi.fn();t(()=>e([[`mod+k`,n]]));let r=document.createElement(`input`);document.body.appendChild(r),dispatchKeydown(r,{key:`k`,metaKey:!0}),r.remove(),expect(n).not.toHaveBeenCalled()}),it(`honors a custom tagsToIgnore list`,()=>{let n=vi.fn();t(()=>e([[`mod+k`,n]],[`TEXTAREA`]));let r=document.createElement(`input`);document.body.appendChild(r),dispatchKeydown(r,{key:`k`,metaKey:!0}),r.remove(),expect(n).toHaveBeenCalledTimes(1)}),it(`skips content-editable targets unless triggerOnContentEditable is enabled`,()=>{let n=vi.fn(),{unmount:r}=t(()=>e([[`mod+k`,n]])),i=document.createElement(`div`);Object.defineProperty(i,"isContentEditable",{configurable:!0,value:!0}),document.body.appendChild(i),dispatchKeydown(i,{key:`k`,metaKey:!0}),expect(n).not.toHaveBeenCalled(),r(),t(()=>e([[`mod+k`,n]],[`INPUT`,`TEXTAREA`,`SELECT`],!0)),dispatchKeydown(i,{key:`k`,metaKey:!0}),i.remove(),expect(n).toHaveBeenCalledTimes(1)}),it(`removes the keydown listener on unmount`,()=>{let n=vi.fn(),{unmount:r}=t(()=>e([[`mod+k`,n]]));r(),dispatchKeydown(document.documentElement,{key:`k`,metaKey:!0}),expect(n).not.toHaveBeenCalled()})});
2
+ //# sourceMappingURL=use-hotkeys.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-hotkeys.spec.js","names":[],"sources":["../../src/hooks/use-hotkeys.spec.ts"],"sourcesContent":["import { renderHook } from '@testing-library/react'\n\nimport { useHotkeys } from './use-hotkeys'\n\nfunction dispatchKeydown(target: EventTarget, init: KeyboardEventInit) {\n const event = new KeyboardEvent('keydown', { bubbles: true, cancelable: true, ...init })\n target.dispatchEvent(event)\n return event\n}\n\ndescribe('useHotkeys', () => {\n it('runs the handler when the matching hotkey is pressed', () => {\n const handler = vi.fn()\n renderHook(() => useHotkeys([['mod+k', handler]]))\n\n dispatchKeydown(document.documentElement, { key: 'k', metaKey: true })\n\n expect(handler).toHaveBeenCalledTimes(1)\n })\n\n it('prevents the default behavior by default', () => {\n const handler = vi.fn()\n renderHook(() => useHotkeys([['mod+k', handler]]))\n\n const event = dispatchKeydown(document.documentElement, { key: 'k', metaKey: true })\n\n expect(event.defaultPrevented).toBe(true)\n })\n\n it('does not prevent the default behavior when the option is disabled', () => {\n const handler = vi.fn()\n renderHook(() => useHotkeys([['mod+k', handler, { preventDefault: false }]]))\n\n const event = dispatchKeydown(document.documentElement, { key: 'k', metaKey: true })\n\n expect(handler).toHaveBeenCalledTimes(1)\n expect(event.defaultPrevented).toBe(false)\n })\n\n it('ignores events coming from form controls by default', () => {\n const handler = vi.fn()\n renderHook(() => useHotkeys([['mod+k', handler]]))\n\n const input = document.createElement('input')\n document.body.appendChild(input)\n dispatchKeydown(input, { key: 'k', metaKey: true })\n input.remove()\n\n expect(handler).not.toHaveBeenCalled()\n })\n\n it('honors a custom tagsToIgnore list', () => {\n const handler = vi.fn()\n renderHook(() => useHotkeys([['mod+k', handler]], ['TEXTAREA']))\n\n const input = document.createElement('input')\n document.body.appendChild(input)\n dispatchKeydown(input, { key: 'k', metaKey: true })\n input.remove()\n\n expect(handler).toHaveBeenCalledTimes(1)\n })\n\n it('skips content-editable targets unless triggerOnContentEditable is enabled', () => {\n const handler = vi.fn()\n const { unmount } = renderHook(() => useHotkeys([['mod+k', handler]]))\n\n const editable = document.createElement('div')\n Object.defineProperty(editable, 'isContentEditable', { configurable: true, value: true })\n document.body.appendChild(editable)\n\n dispatchKeydown(editable, { key: 'k', metaKey: true })\n expect(handler).not.toHaveBeenCalled()\n\n unmount()\n\n renderHook(() => useHotkeys([['mod+k', handler]], ['INPUT', 'TEXTAREA', 'SELECT'], true))\n dispatchKeydown(editable, { key: 'k', metaKey: true })\n editable.remove()\n\n expect(handler).toHaveBeenCalledTimes(1)\n })\n\n it('removes the keydown listener on unmount', () => {\n const handler = vi.fn()\n const { unmount } = renderHook(() => useHotkeys([['mod+k', handler]]))\n\n unmount()\n dispatchKeydown(document.documentElement, { key: 'k', metaKey: true })\n\n expect(handler).not.toHaveBeenCalled()\n })\n})\n"],"mappings":"oIAIA,SAAS,gBAAgB,EAAqB,EAAyB,CACrE,IAAM,EAAQ,IAAI,cAAc,UAAW,CAAE,QAAS,GAAM,WAAY,GAAM,GAAG,CAAK,CAAC,EAEvF,OADA,EAAO,cAAc,CAAK,EACnB,CACT,CAEA,SAAS,iBAAoB,CAC3B,GAAG,2DAA8D,CAC/D,IAAM,EAAU,GAAG,GAAG,EACtB,MAAiB,EAAW,CAAC,CAAC,QAAS,CAAO,CAAC,CAAC,CAAC,EAEjD,gBAAgB,SAAS,gBAAiB,CAAE,IAAK,IAAK,QAAS,EAAK,CAAC,EAErE,OAAO,CAAO,CAAC,CAAC,sBAAsB,CAAC,CACzC,CAAC,EAED,GAAG,+CAAkD,CACnD,IAAM,EAAU,GAAG,GAAG,EACtB,MAAiB,EAAW,CAAC,CAAC,QAAS,CAAO,CAAC,CAAC,CAAC,EAEjD,IAAM,EAAQ,gBAAgB,SAAS,gBAAiB,CAAE,IAAK,IAAK,QAAS,EAAK,CAAC,EAEnF,OAAO,EAAM,gBAAgB,CAAC,CAAC,KAAK,EAAI,CAC1C,CAAC,EAED,GAAG,wEAA2E,CAC5E,IAAM,EAAU,GAAG,GAAG,EACtB,MAAiB,EAAW,CAAC,CAAC,QAAS,EAAS,CAAE,eAAgB,EAAM,CAAC,CAAC,CAAC,CAAC,EAE5E,IAAM,EAAQ,gBAAgB,SAAS,gBAAiB,CAAE,IAAK,IAAK,QAAS,EAAK,CAAC,EAEnF,OAAO,CAAO,CAAC,CAAC,sBAAsB,CAAC,EACvC,OAAO,EAAM,gBAAgB,CAAC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,CAAO,CAAC,CAAC,sBAAsB,CAAC,CACzC,CAAC,EAED,GAAG,8CAAiD,CAClD,IAAM,EAAU,GAAG,GAAG,EAChB,CAAE,WAAY,MAAiB,EAAW,CAAC,CAAC,QAAS,CAAO,CAAC,CAAC,CAAC,EAErE,EAAQ,EACR,gBAAgB,SAAS,gBAAiB,CAAE,IAAK,IAAK,QAAS,EAAK,CAAC,EAErE,OAAO,CAAO,CAAC,CAAC,IAAI,iBAAiB,CACvC,CAAC,CACH,CAAC"}
package/dist/index.d.ts CHANGED
@@ -7,7 +7,7 @@ import { _ as resolveChartColor, a as ChartContainerProps, c as ChartLegendConte
7
7
  import { AreaChart, AreaChartCurveType, AreaChartGridAxis, AreaChartProps, AreaChartSeries, AreaChartType } from "./components/area-chart.js";
8
8
  import { Avatar, AvatarBadge, AvatarBadgeProps, AvatarFallback, AvatarFallbackProps, AvatarGroup, AvatarGroupCount, AvatarGroupCountProps, AvatarGroupProps, AvatarImage, AvatarImageProps, AvatarProps } from "./components/avatar.js";
9
9
  import { Badge, BadgeProps, badgeVariants } from "./components/badge.js";
10
- import { BarChart, BarChartGridAxis, BarChartOrientation, BarChartProps, BarChartSeries, BarChartType } from "./components/bar-chart.js";
10
+ import { BarChart, BarChartDatum, BarChartGridAxis, BarChartOrientation, BarChartProps, BarChartSeries, BarChartType } from "./components/bar-chart.js";
11
11
  import { Breadcrumb, BreadcrumbEllipsis, BreadcrumbEllipsisProps, BreadcrumbItem, BreadcrumbItemProps, BreadcrumbLink, BreadcrumbLinkProps, BreadcrumbList, BreadcrumbListProps, BreadcrumbPage, BreadcrumbPageProps, BreadcrumbProps, BreadcrumbSeparator, BreadcrumbSeparatorProps } from "./components/breadcrumb.js";
12
12
  import { Separator, SeparatorProps } from "./components/separator.js";
13
13
  import { ButtonGroup, ButtonGroupProps, ButtonGroupSeparator, ButtonGroupSeparatorProps, ButtonGroupText, ButtonGroupTextProps, buttonGroupVariants } from "./components/button-group.js";
@@ -77,6 +77,7 @@ import { HiddenFrom, HiddenFromProps, VisibleFrom, VisibleFromProps } from "./co
77
77
  import { ResponsiveValueMap, useBreakpointValue } from "./hooks/use-breakpoint-value.js";
78
78
  import { UseDisclosureHandlers, UseDisclosureOptions, UseDisclosureReturnValue, useDisclosure } from "./hooks/use-disclosure.js";
79
79
  import { useDocumentVisibility } from "./hooks/use-document-visibility.js";
80
+ import { i as getHotkeyHandler, n as useHotkeys, r as HotkeyItemOptions, t as HotkeyItem } from "./use-hotkeys-Cl1cV6e8.js";
80
81
  import { UseIdleOptions, useIdle } from "./hooks/use-idle.js";
81
82
  import { UseIntervalOptions, UseIntervalReturnValue, useInterval } from "./hooks/use-interval.js";
82
83
  import { UseLocalStorageOptions, useLocalStorage } from "./hooks/use-local-storage.js";
@@ -85,4 +86,4 @@ import { BadgeColor, badgeColorVariants } from "./lib/badge.js";
85
86
  import { ButtonColor, buttonColorVariants } from "./lib/button.js";
86
87
  import { composeRefs, setRef } from "./lib/compose-refs.js";
87
88
  import { cn, randomId } from "./lib/utils.js";
88
- export { Accordion, AccordionContent, AccordionContentProps, AccordionItem, AccordionItemProps, AccordionProps, AccordionTrigger, AccordionTriggerProps, Alert, AlertAction, AlertActionProps, AlertDescription, AlertDescriptionProps, AlertDialog, AlertDialogAction, AlertDialogActionProps, AlertDialogCancel, AlertDialogCancelProps, AlertDialogContent, AlertDialogContentProps, AlertDialogDescription, AlertDialogDescriptionProps, AlertDialogFooter, AlertDialogFooterProps, AlertDialogHeader, AlertDialogHeaderProps, AlertDialogMedia, AlertDialogMediaProps, AlertDialogOverlay, AlertDialogOverlayProps, AlertDialogPortal, AlertDialogPortalProps, AlertDialogProps, AlertDialogTitle, AlertDialogTitleProps, AlertDialogTrigger, AlertDialogTriggerProps, AlertProps, AlertTitle, AlertTitleProps, Anchor, AnchorProps, AreaChart, AreaChartCurveType, AreaChartGridAxis, AreaChartProps, AreaChartSeries, AreaChartType, Avatar, AvatarBadge, AvatarBadgeProps, AvatarFallback, AvatarFallbackProps, AvatarGroup, AvatarGroupCount, AvatarGroupCountProps, AvatarGroupProps, AvatarImage, AvatarImageProps, AvatarProps, Badge, BadgeColor, BadgeProps, BarChart, BarChartGridAxis, BarChartOrientation, BarChartProps, BarChartSeries, BarChartType, Breadcrumb, BreadcrumbEllipsis, BreadcrumbEllipsisProps, BreadcrumbItem, BreadcrumbItemProps, BreadcrumbLink, BreadcrumbLinkProps, BreadcrumbList, BreadcrumbListProps, BreadcrumbPage, BreadcrumbPageProps, BreadcrumbProps, BreadcrumbSeparator, BreadcrumbSeparatorProps, Breakpoint, Button, ButtonColor, ButtonGroup, ButtonGroupProps, ButtonGroupSeparator, ButtonGroupSeparatorProps, ButtonGroupText, ButtonGroupTextProps, ButtonProps, CHART_COLOR_KEYS, Calendar, CalendarDayButton, CalendarDayButtonProps, CalendarProps, Card, CardAction, CardActionProps, CardContent, CardContentProps, CardDescription, CardDescriptionProps, CardFooter, CardFooterProps, CardHeader, CardHeaderProps, CardProps, CardTitle, CardTitleProps, Carousel, CarouselApi, CarouselContent, CarouselContentProps, CarouselIndicators, CarouselIndicatorsProps, CarouselItem, CarouselItemProps, CarouselNext, CarouselNextProps, CarouselPrevious, CarouselPreviousProps, CarouselProps, Center, CenterProps, ChartColorKey, ChartConfig, ChartContainer, ChartContainerProps, ChartLegend, ChartLegendContent, ChartLegendContentProps, ChartLegendProps, ChartStyle, ChartStyleProps, ChartTooltip, ChartTooltipContent, ChartTooltipContentProps, ChartTooltipProps, Checkbox, CheckboxProps, Code, CodeProps, Collapsible, CollapsibleContent, CollapsibleContentProps, CollapsibleProps, CollapsibleTrigger, CollapsibleTriggerProps, type Column, type ColumnDef, Combobox, ComboboxChip, ComboboxChipProps, ComboboxChips, ComboboxChipsInput, ComboboxChipsInputProps, ComboboxChipsProps, ComboboxClear, ComboboxClearProps, ComboboxCollection, ComboboxCollectionProps, ComboboxContent, ComboboxContentProps, ComboboxEmpty, ComboboxEmptyProps, ComboboxGroup, ComboboxGroupProps, ComboboxInput, ComboboxInputProps, ComboboxItem, ComboboxItemProps, ComboboxLabel, ComboboxLabelProps, ComboboxList, ComboboxListProps, ComboboxProps, ComboboxSeparator, ComboboxSeparatorProps, ComboboxTrigger, ComboboxTriggerProps, ComboboxValue, ComboboxValueProps, Command, CommandDialog, CommandDialogProps, CommandEmpty, CommandEmptyProps, CommandGroup, CommandGroupProps, CommandInput, CommandInputProps, CommandItem, CommandItemProps, CommandList, CommandListProps, CommandProps, CommandSeparator, CommandSeparatorProps, CommandShortcut, CommandShortcutProps, Container, ContainerProps, DEFAULT_CHART_PALETTE, DataTable, DataTableBody, DataTableBodyProps, DataTableColumnHeader, DataTableColumnHeaderProps, DataTableHeader, DataTableHeaderProps, DataTableLabels, DataTablePagination, DataTablePaginationProps, DataTableProps, DataTableRoot, DataTableRootProps, DataTableToolbar, DataTableToolbarProps, DataTableViewOptions, DataTableViewOptionsProps, type DateRange, DateRangePicker, DateRangePickerActions, DateRangePickerActionsProps, DateRangePickerApply, DateRangePickerApplyProps, DateRangePickerCalendar, DateRangePickerCalendarProps, DateRangePickerContent, DateRangePickerContentProps, DateRangePickerDateFields, DateRangePickerDateFieldsProps, DateRangePickerPreset, DateRangePickerPresetOption, DateRangePickerPresetProps, DateRangePickerPresets, DateRangePickerPresetsProps, DateRangePickerProps, DateRangePickerReset, DateRangePickerResetProps, DateRangePickerTrigger, DateRangePickerTriggerProps, DateRangePickerValue, DateRangePickerValueProps, Dialog, DialogBody, DialogBodyProps, DialogClose, DialogCloseProps, DialogContent, DialogContentProps, DialogDescription, DialogDescriptionProps, DialogFooter, DialogFooterProps, DialogHeader, DialogHeaderProps, DialogOverlay, DialogOverlayProps, DialogPortal, DialogPortalProps, DialogProps, DialogTitle, DialogTitleProps, DialogTrigger, DialogTriggerProps, DonutChart, DonutChartProps, Drawer, DrawerBody, DrawerBodyProps, DrawerClose, DrawerCloseProps, DrawerContent, DrawerContentProps, DrawerDescription, DrawerDescriptionProps, DrawerFooter, DrawerFooterProps, DrawerHeader, DrawerHeaderProps, DrawerOverlay, DrawerOverlayProps, DrawerPortal, DrawerPortalProps, DrawerProps, DrawerTitle, DrawerTitleProps, DrawerTrigger, DrawerTriggerProps, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuCheckboxItemProps, DropdownMenuContent, DropdownMenuContentProps, DropdownMenuGroup, DropdownMenuGroupProps, DropdownMenuItem, DropdownMenuItemProps, DropdownMenuLabel, DropdownMenuLabelProps, DropdownMenuPortal, DropdownMenuPortalProps, DropdownMenuProps, DropdownMenuRadioGroup, DropdownMenuRadioGroupProps, DropdownMenuRadioItem, DropdownMenuRadioItemProps, DropdownMenuSeparator, DropdownMenuSeparatorProps, DropdownMenuShortcut, DropdownMenuShortcutProps, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubContentProps, DropdownMenuSubProps, DropdownMenuSubTrigger, DropdownMenuSubTriggerProps, DropdownMenuTrigger, DropdownMenuTriggerProps, Dropzone, DropzoneArea, DropzoneAreaProps, DropzoneDescription, DropzoneDescriptionProps, DropzoneFileList, DropzoneFileListItem, DropzoneFileListItemProps, DropzoneFileListProps, DropzoneFileMessage, DropzoneFileMessageProps, DropzoneFileStatus, DropzoneMessage, DropzoneMessageProps, DropzoneProps, DropzoneRemoveFile, DropzoneRemoveFileProps, DropzoneRetryFile, DropzoneRetryFileProps, DropzoneTrigger, DropzoneTriggerProps, DropzoneUploadResult, DropzoneValidation, Empty, EmptyContent, EmptyContentProps, EmptyDescription, EmptyDescriptionProps, EmptyHeader, EmptyHeaderProps, EmptyMedia, EmptyMediaProps, EmptyProps, EmptyTitle, EmptyTitleProps, ErrorCode, Field, FieldContent, FieldContentProps, FieldDescription, FieldDescriptionProps, FieldError, FieldErrorProps, FieldGroup, FieldGroupProps, FieldLabel, FieldLabelProps, FieldLegend, FieldLegendProps, FieldProps, FieldSeparator, FieldSeparatorProps, FieldSet, FieldSetProps, FieldTitle, FieldTitleProps, type FileError, FileStatus, Flex, FlexProps, Grid, GridItem, GridItemProps, GridProps, Group, GroupProps, Heading, HeadingProps, HiddenFrom, HiddenFromProps, HoverCard, HoverCardContent, HoverCardContentProps, HoverCardProps, HoverCardTrigger, HoverCardTriggerProps, InfiniteProgress, InfiniteProgressProps, Input, InputGroup, InputGroupAddon, InputGroupAddonProps, InputGroupButton, InputGroupButtonProps, InputGroupInput, InputGroupInputProps, InputGroupProps, InputGroupText, InputGroupTextProps, InputGroupTextarea, InputGroupTextareaProps, InputOTP, InputOTPGroup, InputOTPGroupProps, InputOTPProps, InputOTPSeparator, InputOTPSeparatorProps, InputOTPSlot, InputOTPSlotProps, InputProps, Kbd, KbdGroup, KbdGroupProps, KbdProps, Label, LabelProps, List, ListIcon, ListIconProps, ListItem, ListItemProps, ListProps, MaskInput, MaskInputProps, type MaskOptions, ModeToggle, ModeToggleProps, type ModifiedData, type Modify, NativeSelect, NativeSelectOptGroup, NativeSelectOptGroupProps, NativeSelectOption, NativeSelectOptionProps, NativeSelectProps, NavigationMenu, NavigationMenuContent, NavigationMenuContentProps, NavigationMenuIndicator, NavigationMenuIndicatorProps, NavigationMenuItem, NavigationMenuItemProps, NavigationMenuLink, NavigationMenuLinkProps, NavigationMenuList, NavigationMenuListProps, NavigationMenuProps, NavigationMenuTrigger, NavigationMenuTriggerProps, NavigationMenuViewport, NavigationMenuViewportProps, Pagination, PaginationContent, PaginationContentProps, PaginationEllipsis, PaginationEllipsisProps, PaginationItem, PaginationItemProps, PaginationLink, PaginationLinkProps, PaginationNext, PaginationNextProps, PaginationPrevious, PaginationPreviousProps, PaginationProps, PieChart, PieChartBase, PieChartBaseProps, PieChartDatum, PieChartProps, Popover, PopoverAnchor, PopoverAnchorProps, PopoverContent, PopoverContentProps, PopoverDescription, PopoverDescriptionProps, PopoverHeader, PopoverHeaderProps, PopoverProps, PopoverTitle, PopoverTitleProps, PopoverTrigger, PopoverTriggerProps, Progress, ProgressProps, REGEXP_ONLY_CHARS, REGEXP_ONLY_DIGITS, REGEXP_ONLY_DIGITS_AND_CHARS, RadioGroup, RadioGroupItem, RadioGroupItemProps, RadioGroupProps, type Replacement, ResizableHandle, ResizableHandleProps, ResizablePanel, ResizablePanelGroup, ResizablePanelGroupProps, ResizablePanelProps, ResponsiveValueMap, type RowData, ScrollArea, ScrollAreaProps, ScrollBar, ScrollBarProps, Select, SelectContent, SelectContentProps, SelectGroup, SelectGroupProps, SelectItem, SelectItemProps, SelectLabel, SelectLabelProps, SelectProps, SelectScrollDownButton, SelectScrollDownButtonProps, SelectScrollUpButton, SelectScrollUpButtonProps, SelectSeparator, SelectSeparatorProps, SelectTrigger, SelectTriggerProps, SelectValue, SelectValueProps, Separator, SeparatorProps, Sidebar, SidebarContent, SidebarContentProps, SidebarFooter, SidebarFooterProps, SidebarGroup, SidebarGroupAction, SidebarGroupActionProps, SidebarGroupContent, SidebarGroupContentProps, SidebarGroupLabel, SidebarGroupLabelProps, SidebarGroupProps, SidebarHeader, SidebarHeaderProps, SidebarInput, SidebarInputProps, SidebarInset, SidebarInsetProps, SidebarMenu, SidebarMenuAction, SidebarMenuActionProps, SidebarMenuBadge, SidebarMenuBadgeProps, SidebarMenuButton, SidebarMenuButtonProps, SidebarMenuItem, SidebarMenuItemProps, SidebarMenuProps, SidebarMenuSkeleton, SidebarMenuSkeletonProps, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubButtonProps, SidebarMenuSubItem, SidebarMenuSubItemProps, SidebarMenuSubProps, SidebarProps, SidebarProvider, SidebarProviderProps, SidebarRail, SidebarRailProps, SidebarSeparator, SidebarSeparatorProps, SidebarTrigger, SidebarTriggerProps, SimpleGrid, SimpleGridProps, Skeleton, SkeletonProps, Slider, SliderProps, Spinner, SpinnerProps, Stack, StackProps, Switch, SwitchProps, Table, TableBody, TableBodyProps, TableCaption, TableCaptionProps, TableCell, TableCellProps, TableContainer, TableContainerProps, TableFooter, TableFooterProps, TableHead, TableHeadProps, TableHeader, TableHeaderProps, TableProps, TableRow, TableRowProps, Tabs, TabsContent, TabsContentProps, TabsList, TabsListProps, TabsProps, TabsTrigger, TabsTriggerProps, type TanStackTable, Text, TextProps, Textarea, TextareaProps, Theme, ThemeProvider, ThemeProviderProps, ThemeProviderState, Timeline, TimelineConnector, TimelineConnectorColor, TimelineConnectorProps, TimelineContent, TimelineContentProps, TimelineDescription, TimelineDescriptionProps, TimelineEmpty, TimelineEmptyProps, TimelineHeader, TimelineHeaderProps, TimelineIcon, TimelineIconColor, TimelineIconProps, TimelineIconSize, TimelineItem, TimelineItemProps, TimelineProps, TimelineStatus, TimelineTime, TimelineTimeProps, TimelineTitle, TimelineTitleProps, Toaster, ToasterProps, Toggle, ToggleGroup, ToggleGroupItem, ToggleGroupItemProps, ToggleGroupProps, ToggleProps, Tooltip, TooltipContent, TooltipContentProps, TooltipProps, TooltipProvider, TooltipProviderProps, TooltipRoot, TooltipRootProps, TooltipTrigger, TooltipTriggerProps, type Track, type TrackingData, UIColor, UnstyledButton, UnstyledButtonProps, UseDataTableOptions, UseDisclosureHandlers, UseDisclosureOptions, UseDisclosureReturnValue, UseDropzoneProps, UseDropzoneReturn, UseIdleOptions, UseIntervalOptions, UseIntervalReturnValue, UseLocalStorageOptions, UseMaskOptions, VisibleFrom, VisibleFromProps, anchorVariants, badgeColorVariants, badgeVariants, breakpointValues, buildPieConfig, buttonColorVariants, buttonGroupVariants, buttonVariants, centerVariants, cn, composeRefs, containerVariants, createDataTableSelectColumn, defaultDataTableLabels, flexVariants, groupVariants, headingVariants, listVariants, locale, navigationMenuTriggerStyle, randomId, resolveChartColor, selectionControlColorVariants, setRef, spinnerVariants, stackVariants, tableVariants, tabsListVariants, textVariants, timelineVariants, toast, toggleVariants, uiColors, useBreakpoint, useBreakpointValue, useCarousel, useComboboxAnchor, useDataTable, useDataTableContext, useDisclosure, useDocumentVisibility, useDropzone, useFieldControlId, useIdle, useInterval, useIsMobile, useLocalStorage, useMask, useSidebar, useTheme };
89
+ export { Accordion, AccordionContent, AccordionContentProps, AccordionItem, AccordionItemProps, AccordionProps, AccordionTrigger, AccordionTriggerProps, Alert, AlertAction, AlertActionProps, AlertDescription, AlertDescriptionProps, AlertDialog, AlertDialogAction, AlertDialogActionProps, AlertDialogCancel, AlertDialogCancelProps, AlertDialogContent, AlertDialogContentProps, AlertDialogDescription, AlertDialogDescriptionProps, AlertDialogFooter, AlertDialogFooterProps, AlertDialogHeader, AlertDialogHeaderProps, AlertDialogMedia, AlertDialogMediaProps, AlertDialogOverlay, AlertDialogOverlayProps, AlertDialogPortal, AlertDialogPortalProps, AlertDialogProps, AlertDialogTitle, AlertDialogTitleProps, AlertDialogTrigger, AlertDialogTriggerProps, AlertProps, AlertTitle, AlertTitleProps, Anchor, AnchorProps, AreaChart, AreaChartCurveType, AreaChartGridAxis, AreaChartProps, AreaChartSeries, AreaChartType, Avatar, AvatarBadge, AvatarBadgeProps, AvatarFallback, AvatarFallbackProps, AvatarGroup, AvatarGroupCount, AvatarGroupCountProps, AvatarGroupProps, AvatarImage, AvatarImageProps, AvatarProps, Badge, BadgeColor, BadgeProps, BarChart, BarChartDatum, BarChartGridAxis, BarChartOrientation, BarChartProps, BarChartSeries, BarChartType, Breadcrumb, BreadcrumbEllipsis, BreadcrumbEllipsisProps, BreadcrumbItem, BreadcrumbItemProps, BreadcrumbLink, BreadcrumbLinkProps, BreadcrumbList, BreadcrumbListProps, BreadcrumbPage, BreadcrumbPageProps, BreadcrumbProps, BreadcrumbSeparator, BreadcrumbSeparatorProps, Breakpoint, Button, ButtonColor, ButtonGroup, ButtonGroupProps, ButtonGroupSeparator, ButtonGroupSeparatorProps, ButtonGroupText, ButtonGroupTextProps, ButtonProps, CHART_COLOR_KEYS, Calendar, CalendarDayButton, CalendarDayButtonProps, CalendarProps, Card, CardAction, CardActionProps, CardContent, CardContentProps, CardDescription, CardDescriptionProps, CardFooter, CardFooterProps, CardHeader, CardHeaderProps, CardProps, CardTitle, CardTitleProps, Carousel, CarouselApi, CarouselContent, CarouselContentProps, CarouselIndicators, CarouselIndicatorsProps, CarouselItem, CarouselItemProps, CarouselNext, CarouselNextProps, CarouselPrevious, CarouselPreviousProps, CarouselProps, Center, CenterProps, ChartColorKey, ChartConfig, ChartContainer, ChartContainerProps, ChartLegend, ChartLegendContent, ChartLegendContentProps, ChartLegendProps, ChartStyle, ChartStyleProps, ChartTooltip, ChartTooltipContent, ChartTooltipContentProps, ChartTooltipProps, Checkbox, CheckboxProps, Code, CodeProps, Collapsible, CollapsibleContent, CollapsibleContentProps, CollapsibleProps, CollapsibleTrigger, CollapsibleTriggerProps, type Column, type ColumnDef, Combobox, ComboboxChip, ComboboxChipProps, ComboboxChips, ComboboxChipsInput, ComboboxChipsInputProps, ComboboxChipsProps, ComboboxClear, ComboboxClearProps, ComboboxCollection, ComboboxCollectionProps, ComboboxContent, ComboboxContentProps, ComboboxEmpty, ComboboxEmptyProps, ComboboxGroup, ComboboxGroupProps, ComboboxInput, ComboboxInputProps, ComboboxItem, ComboboxItemProps, ComboboxLabel, ComboboxLabelProps, ComboboxList, ComboboxListProps, ComboboxProps, ComboboxSeparator, ComboboxSeparatorProps, ComboboxTrigger, ComboboxTriggerProps, ComboboxValue, ComboboxValueProps, Command, CommandDialog, CommandDialogProps, CommandEmpty, CommandEmptyProps, CommandGroup, CommandGroupProps, CommandInput, CommandInputProps, CommandItem, CommandItemProps, CommandList, CommandListProps, CommandProps, CommandSeparator, CommandSeparatorProps, CommandShortcut, CommandShortcutProps, Container, ContainerProps, DEFAULT_CHART_PALETTE, DataTable, DataTableBody, DataTableBodyProps, DataTableColumnHeader, DataTableColumnHeaderProps, DataTableHeader, DataTableHeaderProps, DataTableLabels, DataTablePagination, DataTablePaginationProps, DataTableProps, DataTableRoot, DataTableRootProps, DataTableToolbar, DataTableToolbarProps, DataTableViewOptions, DataTableViewOptionsProps, type DateRange, DateRangePicker, DateRangePickerActions, DateRangePickerActionsProps, DateRangePickerApply, DateRangePickerApplyProps, DateRangePickerCalendar, DateRangePickerCalendarProps, DateRangePickerContent, DateRangePickerContentProps, DateRangePickerDateFields, DateRangePickerDateFieldsProps, DateRangePickerPreset, DateRangePickerPresetOption, DateRangePickerPresetProps, DateRangePickerPresets, DateRangePickerPresetsProps, DateRangePickerProps, DateRangePickerReset, DateRangePickerResetProps, DateRangePickerTrigger, DateRangePickerTriggerProps, DateRangePickerValue, DateRangePickerValueProps, Dialog, DialogBody, DialogBodyProps, DialogClose, DialogCloseProps, DialogContent, DialogContentProps, DialogDescription, DialogDescriptionProps, DialogFooter, DialogFooterProps, DialogHeader, DialogHeaderProps, DialogOverlay, DialogOverlayProps, DialogPortal, DialogPortalProps, DialogProps, DialogTitle, DialogTitleProps, DialogTrigger, DialogTriggerProps, DonutChart, DonutChartProps, Drawer, DrawerBody, DrawerBodyProps, DrawerClose, DrawerCloseProps, DrawerContent, DrawerContentProps, DrawerDescription, DrawerDescriptionProps, DrawerFooter, DrawerFooterProps, DrawerHeader, DrawerHeaderProps, DrawerOverlay, DrawerOverlayProps, DrawerPortal, DrawerPortalProps, DrawerProps, DrawerTitle, DrawerTitleProps, DrawerTrigger, DrawerTriggerProps, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuCheckboxItemProps, DropdownMenuContent, DropdownMenuContentProps, DropdownMenuGroup, DropdownMenuGroupProps, DropdownMenuItem, DropdownMenuItemProps, DropdownMenuLabel, DropdownMenuLabelProps, DropdownMenuPortal, DropdownMenuPortalProps, DropdownMenuProps, DropdownMenuRadioGroup, DropdownMenuRadioGroupProps, DropdownMenuRadioItem, DropdownMenuRadioItemProps, DropdownMenuSeparator, DropdownMenuSeparatorProps, DropdownMenuShortcut, DropdownMenuShortcutProps, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubContentProps, DropdownMenuSubProps, DropdownMenuSubTrigger, DropdownMenuSubTriggerProps, DropdownMenuTrigger, DropdownMenuTriggerProps, Dropzone, DropzoneArea, DropzoneAreaProps, DropzoneDescription, DropzoneDescriptionProps, DropzoneFileList, DropzoneFileListItem, DropzoneFileListItemProps, DropzoneFileListProps, DropzoneFileMessage, DropzoneFileMessageProps, DropzoneFileStatus, DropzoneMessage, DropzoneMessageProps, DropzoneProps, DropzoneRemoveFile, DropzoneRemoveFileProps, DropzoneRetryFile, DropzoneRetryFileProps, DropzoneTrigger, DropzoneTriggerProps, DropzoneUploadResult, DropzoneValidation, Empty, EmptyContent, EmptyContentProps, EmptyDescription, EmptyDescriptionProps, EmptyHeader, EmptyHeaderProps, EmptyMedia, EmptyMediaProps, EmptyProps, EmptyTitle, EmptyTitleProps, ErrorCode, Field, FieldContent, FieldContentProps, FieldDescription, FieldDescriptionProps, FieldError, FieldErrorProps, FieldGroup, FieldGroupProps, FieldLabel, FieldLabelProps, FieldLegend, FieldLegendProps, FieldProps, FieldSeparator, FieldSeparatorProps, FieldSet, FieldSetProps, FieldTitle, FieldTitleProps, type FileError, FileStatus, Flex, FlexProps, Grid, GridItem, GridItemProps, GridProps, Group, GroupProps, Heading, HeadingProps, HiddenFrom, HiddenFromProps, HotkeyItem, type HotkeyItemOptions, HoverCard, HoverCardContent, HoverCardContentProps, HoverCardProps, HoverCardTrigger, HoverCardTriggerProps, InfiniteProgress, InfiniteProgressProps, Input, InputGroup, InputGroupAddon, InputGroupAddonProps, InputGroupButton, InputGroupButtonProps, InputGroupInput, InputGroupInputProps, InputGroupProps, InputGroupText, InputGroupTextProps, InputGroupTextarea, InputGroupTextareaProps, InputOTP, InputOTPGroup, InputOTPGroupProps, InputOTPProps, InputOTPSeparator, InputOTPSeparatorProps, InputOTPSlot, InputOTPSlotProps, InputProps, Kbd, KbdGroup, KbdGroupProps, KbdProps, Label, LabelProps, List, ListIcon, ListIconProps, ListItem, ListItemProps, ListProps, MaskInput, MaskInputProps, type MaskOptions, ModeToggle, ModeToggleProps, type ModifiedData, type Modify, NativeSelect, NativeSelectOptGroup, NativeSelectOptGroupProps, NativeSelectOption, NativeSelectOptionProps, NativeSelectProps, NavigationMenu, NavigationMenuContent, NavigationMenuContentProps, NavigationMenuIndicator, NavigationMenuIndicatorProps, NavigationMenuItem, NavigationMenuItemProps, NavigationMenuLink, NavigationMenuLinkProps, NavigationMenuList, NavigationMenuListProps, NavigationMenuProps, NavigationMenuTrigger, NavigationMenuTriggerProps, NavigationMenuViewport, NavigationMenuViewportProps, Pagination, PaginationContent, PaginationContentProps, PaginationEllipsis, PaginationEllipsisProps, PaginationItem, PaginationItemProps, PaginationLink, PaginationLinkProps, PaginationNext, PaginationNextProps, PaginationPrevious, PaginationPreviousProps, PaginationProps, PieChart, PieChartBase, PieChartBaseProps, PieChartDatum, PieChartProps, Popover, PopoverAnchor, PopoverAnchorProps, PopoverContent, PopoverContentProps, PopoverDescription, PopoverDescriptionProps, PopoverHeader, PopoverHeaderProps, PopoverProps, PopoverTitle, PopoverTitleProps, PopoverTrigger, PopoverTriggerProps, Progress, ProgressProps, REGEXP_ONLY_CHARS, REGEXP_ONLY_DIGITS, REGEXP_ONLY_DIGITS_AND_CHARS, RadioGroup, RadioGroupItem, RadioGroupItemProps, RadioGroupProps, type Replacement, ResizableHandle, ResizableHandleProps, ResizablePanel, ResizablePanelGroup, ResizablePanelGroupProps, ResizablePanelProps, ResponsiveValueMap, type RowData, ScrollArea, ScrollAreaProps, ScrollBar, ScrollBarProps, Select, SelectContent, SelectContentProps, SelectGroup, SelectGroupProps, SelectItem, SelectItemProps, SelectLabel, SelectLabelProps, SelectProps, SelectScrollDownButton, SelectScrollDownButtonProps, SelectScrollUpButton, SelectScrollUpButtonProps, SelectSeparator, SelectSeparatorProps, SelectTrigger, SelectTriggerProps, SelectValue, SelectValueProps, Separator, SeparatorProps, Sidebar, SidebarContent, SidebarContentProps, SidebarFooter, SidebarFooterProps, SidebarGroup, SidebarGroupAction, SidebarGroupActionProps, SidebarGroupContent, SidebarGroupContentProps, SidebarGroupLabel, SidebarGroupLabelProps, SidebarGroupProps, SidebarHeader, SidebarHeaderProps, SidebarInput, SidebarInputProps, SidebarInset, SidebarInsetProps, SidebarMenu, SidebarMenuAction, SidebarMenuActionProps, SidebarMenuBadge, SidebarMenuBadgeProps, SidebarMenuButton, SidebarMenuButtonProps, SidebarMenuItem, SidebarMenuItemProps, SidebarMenuProps, SidebarMenuSkeleton, SidebarMenuSkeletonProps, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubButtonProps, SidebarMenuSubItem, SidebarMenuSubItemProps, SidebarMenuSubProps, SidebarProps, SidebarProvider, SidebarProviderProps, SidebarRail, SidebarRailProps, SidebarSeparator, SidebarSeparatorProps, SidebarTrigger, SidebarTriggerProps, SimpleGrid, SimpleGridProps, Skeleton, SkeletonProps, Slider, SliderProps, Spinner, SpinnerProps, Stack, StackProps, Switch, SwitchProps, Table, TableBody, TableBodyProps, TableCaption, TableCaptionProps, TableCell, TableCellProps, TableContainer, TableContainerProps, TableFooter, TableFooterProps, TableHead, TableHeadProps, TableHeader, TableHeaderProps, TableProps, TableRow, TableRowProps, Tabs, TabsContent, TabsContentProps, TabsList, TabsListProps, TabsProps, TabsTrigger, TabsTriggerProps, type TanStackTable, Text, TextProps, Textarea, TextareaProps, Theme, ThemeProvider, ThemeProviderProps, ThemeProviderState, Timeline, TimelineConnector, TimelineConnectorColor, TimelineConnectorProps, TimelineContent, TimelineContentProps, TimelineDescription, TimelineDescriptionProps, TimelineEmpty, TimelineEmptyProps, TimelineHeader, TimelineHeaderProps, TimelineIcon, TimelineIconColor, TimelineIconProps, TimelineIconSize, TimelineItem, TimelineItemProps, TimelineProps, TimelineStatus, TimelineTime, TimelineTimeProps, TimelineTitle, TimelineTitleProps, Toaster, ToasterProps, Toggle, ToggleGroup, ToggleGroupItem, ToggleGroupItemProps, ToggleGroupProps, ToggleProps, Tooltip, TooltipContent, TooltipContentProps, TooltipProps, TooltipProvider, TooltipProviderProps, TooltipRoot, TooltipRootProps, TooltipTrigger, TooltipTriggerProps, type Track, type TrackingData, UIColor, UnstyledButton, UnstyledButtonProps, UseDataTableOptions, UseDisclosureHandlers, UseDisclosureOptions, UseDisclosureReturnValue, UseDropzoneProps, UseDropzoneReturn, UseIdleOptions, UseIntervalOptions, UseIntervalReturnValue, UseLocalStorageOptions, UseMaskOptions, VisibleFrom, VisibleFromProps, anchorVariants, badgeColorVariants, badgeVariants, breakpointValues, buildPieConfig, buttonColorVariants, buttonGroupVariants, buttonVariants, centerVariants, cn, composeRefs, containerVariants, createDataTableSelectColumn, defaultDataTableLabels, flexVariants, getHotkeyHandler, groupVariants, headingVariants, listVariants, locale, navigationMenuTriggerStyle, randomId, resolveChartColor, selectionControlColorVariants, setRef, spinnerVariants, stackVariants, tableVariants, tabsListVariants, textVariants, timelineVariants, toast, toggleVariants, uiColors, useBreakpoint, useBreakpointValue, useCarousel, useComboboxAnchor, useDataTable, useDataTableContext, useDisclosure, useDocumentVisibility, useDropzone, useFieldControlId, useHotkeys, useIdle, useInterval, useIsMobile, useLocalStorage, useMask, useSidebar, useTheme };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{cn as e,randomId as t}from"./lib/utils.js";import{Accordion as n,AccordionContent as r,AccordionItem as i,AccordionTrigger as a}from"./components/accordion.js";import{Alert as o,AlertAction as s,AlertDescription as c,AlertTitle as l}from"./components/alert.js";import{buttonColorVariants as u}from"./lib/button.js";import{Spinner as d,spinnerVariants as f}from"./components/spinner.js";import{Button as p,buttonVariants as m}from"./components/button.js";import{AlertDialog as h,AlertDialogAction as g,AlertDialogCancel as _,AlertDialogContent as v,AlertDialogDescription as y,AlertDialogFooter as b,AlertDialogHeader as x,AlertDialogMedia as S,AlertDialogOverlay as C,AlertDialogPortal as w,AlertDialogTitle as T,AlertDialogTrigger as E}from"./components/alert-dialog.js";import{Anchor as D,anchorVariants as O}from"./components/anchor.js";import{CHART_COLOR_KEYS as k,ChartContainer as A,ChartLegend as j,ChartLegendContent as M,ChartStyle as N,ChartTooltip as P,ChartTooltipContent as F,DEFAULT_CHART_PALETTE as I,resolveChartColor as L}from"./components/chart.js";import{AreaChart as R}from"./components/area-chart.js";import{Avatar as z,AvatarBadge as B,AvatarFallback as V,AvatarGroup as H,AvatarGroupCount as U,AvatarImage as W}from"./components/avatar.js";import{badgeColorVariants as G}from"./lib/badge.js";import{Badge as K,badgeVariants as q}from"./components/badge.js";import{BarChart as J}from"./components/bar-chart.js";import{Breadcrumb as Y,BreadcrumbEllipsis as X,BreadcrumbItem as Z,BreadcrumbLink as Q,BreadcrumbList as $,BreadcrumbPage as ee,BreadcrumbSeparator as te}from"./components/breadcrumb.js";import{Separator as ne}from"./components/separator.js";import{ButtonGroup as re,ButtonGroupSeparator as ie,ButtonGroupText as ae,buttonGroupVariants as oe}from"./components/button-group.js";import{Calendar as se,CalendarDayButton as ce,locale as le}from"./components/calendar.js";import{Card as ue,CardAction as de,CardContent as fe,CardDescription as pe,CardFooter as me,CardHeader as he,CardTitle as ge}from"./components/card.js";import{Carousel as _e,CarouselContent as ve,CarouselIndicators as ye,CarouselItem as be,CarouselNext as xe,CarouselPrevious as Se,useCarousel as Ce}from"./components/carousel.js";import{Center as we,centerVariants as Te}from"./components/center.js";import{selectionControlColorVariants as Ee,uiColors as De}from"./lib/color.js";import{Label as Oe}from"./components/label.js";import{Field as ke,FieldContent as Ae,FieldDescription as je,FieldError as Me,FieldGroup as Ne,FieldLabel as Pe,FieldLegend as Fe,FieldSeparator as Ie,FieldSet as Le,FieldTitle as Re,useFieldControlId as ze}from"./components/field.js";import{Checkbox as Be}from"./components/checkbox.js";import{Code as Ve}from"./components/code.js";import{Collapsible as He,CollapsibleContent as Ue,CollapsibleTrigger as We}from"./components/collapsible.js";import{Input as Ge}from"./components/input.js";import{Textarea as Ke}from"./components/textarea.js";import{InputGroup as qe,InputGroupAddon as Je,InputGroupButton as Ye,InputGroupInput as Xe,InputGroupText as Ze,InputGroupTextarea as Qe}from"./components/input-group.js";import{Combobox as $e,ComboboxChip as et,ComboboxChips as tt,ComboboxChipsInput as nt,ComboboxClear as rt,ComboboxCollection as it,ComboboxContent as at,ComboboxEmpty as ot,ComboboxGroup as st,ComboboxInput as ct,ComboboxItem as lt,ComboboxLabel as ut,ComboboxList as dt,ComboboxSeparator as ft,ComboboxTrigger as pt,ComboboxValue as mt,useComboboxAnchor as ht}from"./components/combobox.js";import{Dialog as gt,DialogBody as _t,DialogClose as vt,DialogContent as yt,DialogDescription as bt,DialogFooter as xt,DialogHeader as St,DialogOverlay as Ct,DialogPortal as wt,DialogTitle as Tt,DialogTrigger as Et}from"./components/dialog.js";import{Command as Dt,CommandDialog as Ot,CommandEmpty as kt,CommandGroup as At,CommandInput as jt,CommandItem as Mt,CommandList as Nt,CommandSeparator as Pt,CommandShortcut as Ft}from"./components/command.js";import{Container as It,containerVariants as Lt}from"./components/container.js";import{DropdownMenu as Rt,DropdownMenuCheckboxItem as zt,DropdownMenuContent as Bt,DropdownMenuGroup as Vt,DropdownMenuItem as Ht,DropdownMenuLabel as Ut,DropdownMenuPortal as Wt,DropdownMenuRadioGroup as Gt,DropdownMenuRadioItem as Kt,DropdownMenuSeparator as qt,DropdownMenuShortcut as Jt,DropdownMenuSub as Yt,DropdownMenuSubContent as Xt,DropdownMenuSubTrigger as Zt,DropdownMenuTrigger as Qt}from"./components/dropdown-menu.js";import{Select as $t,SelectContent as en,SelectGroup as tn,SelectItem as nn,SelectLabel as rn,SelectScrollDownButton as an,SelectScrollUpButton as on,SelectSeparator as sn,SelectTrigger as cn,SelectValue as ln}from"./components/select.js";import{Table as un,TableBody as dn,TableCaption as fn,TableCell as pn,TableContainer as mn,TableFooter as hn,TableHead as gn,TableHeader as _n,TableRow as vn,tableVariants as yn}from"./components/table.js";import{DataTable as bn,DataTableBody as xn,DataTableColumnHeader as Sn,DataTableHeader as Cn,DataTablePagination as wn,DataTableRoot as Tn,DataTableToolbar as En,DataTableViewOptions as Dn,createDataTableSelectColumn as On,defaultDataTableLabels as kn,useDataTable as An,useDataTableContext as jn}from"./components/data-table.js";import{Popover as Mn,PopoverAnchor as Nn,PopoverContent as Pn,PopoverDescription as Fn,PopoverHeader as In,PopoverTitle as Ln,PopoverTrigger as Rn}from"./components/popover.js";import{DateRangePicker as zn,DateRangePickerActions as Bn,DateRangePickerApply as Vn,DateRangePickerCalendar as Hn,DateRangePickerContent as Un,DateRangePickerDateFields as Wn,DateRangePickerPreset as Gn,DateRangePickerPresets as Kn,DateRangePickerReset as qn,DateRangePickerTrigger as Jn,DateRangePickerValue as Yn}from"./components/date-range-picker.js";import{PieChart as Xn,PieChartBase as Zn,buildPieConfig as Qn}from"./components/pie-chart.js";import{DonutChart as $n}from"./components/donut-chart.js";import{Drawer as er,DrawerBody as tr,DrawerClose as nr,DrawerContent as rr,DrawerDescription as ir,DrawerFooter as ar,DrawerHeader as or,DrawerOverlay as sr,DrawerPortal as cr,DrawerTitle as lr,DrawerTrigger as ur}from"./components/drawer.js";import{composeRefs as dr,setRef as fr}from"./lib/compose-refs.js";import{Dropzone as pr,DropzoneArea as mr,DropzoneDescription as hr,DropzoneFileList as gr,DropzoneFileListItem as _r,DropzoneFileMessage as vr,DropzoneMessage as yr,DropzoneRemoveFile as br,DropzoneRetryFile as xr,DropzoneTrigger as Sr,ErrorCode as Cr,InfiniteProgress as wr,useDropzone as Tr}from"./components/dropzone.js";import{Empty as Er,EmptyContent as Dr,EmptyDescription as Or,EmptyHeader as kr,EmptyMedia as Ar,EmptyTitle as jr}from"./components/empty.js";import{Flex as Mr,flexVariants as Nr}from"./components/flex.js";import{Grid as Pr,GridItem as Fr}from"./components/grid.js";import{Group as Ir,groupVariants as Lr}from"./components/group.js";import{Heading as Rr,headingVariants as zr}from"./components/heading.js";import{HoverCard as Br,HoverCardContent as Vr,HoverCardTrigger as Hr}from"./components/hover-card.js";import{InputOTP as Ur,InputOTPGroup as Wr,InputOTPSeparator as Gr,InputOTPSlot as Kr,REGEXP_ONLY_CHARS as qr,REGEXP_ONLY_DIGITS as Jr,REGEXP_ONLY_DIGITS_AND_CHARS as Yr}from"./components/input-otp.js";import{Kbd as Xr,KbdGroup as Zr}from"./components/kbd.js";import{List as Qr,ListIcon as $r,ListItem as ei,listVariants as ti}from"./components/list.js";import{useMask as ni}from"./hooks/use-mask.js";import{MaskInput as ri}from"./components/mask-input.js";import{NativeSelect as ii,NativeSelectOptGroup as ai,NativeSelectOption as oi}from"./components/native-select.js";import{NavigationMenu as si,NavigationMenuContent as ci,NavigationMenuIndicator as li,NavigationMenuItem as ui,NavigationMenuLink as di,NavigationMenuList as fi,NavigationMenuTrigger as pi,NavigationMenuViewport as mi,navigationMenuTriggerStyle as hi}from"./components/navigation-menu.js";import{Pagination as gi,PaginationContent as _i,PaginationEllipsis as vi,PaginationItem as yi,PaginationLink as bi,PaginationNext as xi,PaginationPrevious as Si}from"./components/pagination.js";import{Progress as Ci}from"./components/progress.js";import{RadioGroup as wi,RadioGroupItem as Ti}from"./components/radio-group.js";import{ResizableHandle as Ei,ResizablePanel as Di,ResizablePanelGroup as Oi}from"./components/resizable.js";import{ScrollArea as ki,ScrollBar as Ai}from"./components/scroll-area.js";import{useIsMobile as ji}from"./hooks/use-mobile.js";import{Skeleton as Mi}from"./components/skeleton.js";import{Tooltip as Ni,TooltipContent as Pi,TooltipProvider as Fi,TooltipRoot as Ii,TooltipTrigger as Li}from"./components/tooltip.js";import{Sidebar as Ri,SidebarContent as zi,SidebarFooter as Bi,SidebarGroup as Vi,SidebarGroupAction as Hi,SidebarGroupContent as Ui,SidebarGroupLabel as Wi,SidebarHeader as Gi,SidebarInput as Ki,SidebarInset as qi,SidebarMenu as Ji,SidebarMenuAction as Yi,SidebarMenuBadge as Xi,SidebarMenuButton as Zi,SidebarMenuItem as Qi,SidebarMenuSkeleton as $i,SidebarMenuSub as ea,SidebarMenuSubButton as ta,SidebarMenuSubItem as na,SidebarProvider as ra,SidebarRail as ia,SidebarSeparator as aa,SidebarTrigger as oa,useSidebar as sa}from"./components/sidebar.js";import{SimpleGrid as ca}from"./components/simple-grid.js";import{Slider as la}from"./components/slider.js";import{Toaster as ua,toast as da}from"./components/sonner.js";import{Stack as fa,stackVariants as pa}from"./components/stack.js";import{Switch as ma}from"./components/switch.js";import{Tabs as ha,TabsContent as ga,TabsList as _a,TabsTrigger as va,tabsListVariants as ya}from"./components/tabs.js";import{Text as ba,textVariants as xa}from"./components/text.js";import{ModeToggle as Sa,ThemeProvider as Ca,useTheme as wa}from"./components/theme.js";import{Timeline as Ta,TimelineConnector as Ea,TimelineContent as Da,TimelineDescription as Oa,TimelineEmpty as ka,TimelineHeader as Aa,TimelineIcon as ja,TimelineItem as Ma,TimelineTime as Na,TimelineTitle as Pa,timelineVariants as Fa}from"./components/timeline.js";import{Toggle as Ia,toggleVariants as La}from"./components/toggle.js";import{ToggleGroup as Ra,ToggleGroupItem as za}from"./components/toggle-group.js";import{UnstyledButton as Ba}from"./components/unstyled-button.js";import{breakpointValues as Va,useBreakpoint as Ha}from"./hooks/use-breakpoint.js";import{HiddenFrom as Ua,VisibleFrom as Wa}from"./components/visibility.js";import{useBreakpointValue as Ga}from"./hooks/use-breakpoint-value.js";import{useDisclosure as Ka}from"./hooks/use-disclosure.js";import{useDocumentVisibility as qa}from"./hooks/use-document-visibility.js";import{useIdle as Ja}from"./hooks/use-idle.js";import{useInterval as Ya}from"./hooks/use-interval.js";import{useLocalStorage as Xa}from"./hooks/use-local-storage.js";export{n as Accordion,r as AccordionContent,i as AccordionItem,a as AccordionTrigger,o as Alert,s as AlertAction,c as AlertDescription,h as AlertDialog,g as AlertDialogAction,_ as AlertDialogCancel,v as AlertDialogContent,y as AlertDialogDescription,b as AlertDialogFooter,x as AlertDialogHeader,S as AlertDialogMedia,C as AlertDialogOverlay,w as AlertDialogPortal,T as AlertDialogTitle,E as AlertDialogTrigger,l as AlertTitle,D as Anchor,R as AreaChart,z as Avatar,B as AvatarBadge,V as AvatarFallback,H as AvatarGroup,U as AvatarGroupCount,W as AvatarImage,K as Badge,J as BarChart,Y as Breadcrumb,X as BreadcrumbEllipsis,Z as BreadcrumbItem,Q as BreadcrumbLink,$ as BreadcrumbList,ee as BreadcrumbPage,te as BreadcrumbSeparator,p as Button,re as ButtonGroup,ie as ButtonGroupSeparator,ae as ButtonGroupText,k as CHART_COLOR_KEYS,se as Calendar,ce as CalendarDayButton,ue as Card,de as CardAction,fe as CardContent,pe as CardDescription,me as CardFooter,he as CardHeader,ge as CardTitle,_e as Carousel,ve as CarouselContent,ye as CarouselIndicators,be as CarouselItem,xe as CarouselNext,Se as CarouselPrevious,we as Center,A as ChartContainer,j as ChartLegend,M as ChartLegendContent,N as ChartStyle,P as ChartTooltip,F as ChartTooltipContent,Be as Checkbox,Ve as Code,He as Collapsible,Ue as CollapsibleContent,We as CollapsibleTrigger,$e as Combobox,et as ComboboxChip,tt as ComboboxChips,nt as ComboboxChipsInput,rt as ComboboxClear,it as ComboboxCollection,at as ComboboxContent,ot as ComboboxEmpty,st as ComboboxGroup,ct as ComboboxInput,lt as ComboboxItem,ut as ComboboxLabel,dt as ComboboxList,ft as ComboboxSeparator,pt as ComboboxTrigger,mt as ComboboxValue,Dt as Command,Ot as CommandDialog,kt as CommandEmpty,At as CommandGroup,jt as CommandInput,Mt as CommandItem,Nt as CommandList,Pt as CommandSeparator,Ft as CommandShortcut,It as Container,I as DEFAULT_CHART_PALETTE,bn as DataTable,xn as DataTableBody,Sn as DataTableColumnHeader,Cn as DataTableHeader,wn as DataTablePagination,Tn as DataTableRoot,En as DataTableToolbar,Dn as DataTableViewOptions,zn as DateRangePicker,Bn as DateRangePickerActions,Vn as DateRangePickerApply,Hn as DateRangePickerCalendar,Un as DateRangePickerContent,Wn as DateRangePickerDateFields,Gn as DateRangePickerPreset,Kn as DateRangePickerPresets,qn as DateRangePickerReset,Jn as DateRangePickerTrigger,Yn as DateRangePickerValue,gt as Dialog,_t as DialogBody,vt as DialogClose,yt as DialogContent,bt as DialogDescription,xt as DialogFooter,St as DialogHeader,Ct as DialogOverlay,wt as DialogPortal,Tt as DialogTitle,Et as DialogTrigger,$n as DonutChart,er as Drawer,tr as DrawerBody,nr as DrawerClose,rr as DrawerContent,ir as DrawerDescription,ar as DrawerFooter,or as DrawerHeader,sr as DrawerOverlay,cr as DrawerPortal,lr as DrawerTitle,ur as DrawerTrigger,Rt as DropdownMenu,zt as DropdownMenuCheckboxItem,Bt as DropdownMenuContent,Vt as DropdownMenuGroup,Ht as DropdownMenuItem,Ut as DropdownMenuLabel,Wt as DropdownMenuPortal,Gt as DropdownMenuRadioGroup,Kt as DropdownMenuRadioItem,qt as DropdownMenuSeparator,Jt as DropdownMenuShortcut,Yt as DropdownMenuSub,Xt as DropdownMenuSubContent,Zt as DropdownMenuSubTrigger,Qt as DropdownMenuTrigger,pr as Dropzone,mr as DropzoneArea,hr as DropzoneDescription,gr as DropzoneFileList,_r as DropzoneFileListItem,vr as DropzoneFileMessage,yr as DropzoneMessage,br as DropzoneRemoveFile,xr as DropzoneRetryFile,Sr as DropzoneTrigger,Er as Empty,Dr as EmptyContent,Or as EmptyDescription,kr as EmptyHeader,Ar as EmptyMedia,jr as EmptyTitle,Cr as ErrorCode,ke as Field,Ae as FieldContent,je as FieldDescription,Me as FieldError,Ne as FieldGroup,Pe as FieldLabel,Fe as FieldLegend,Ie as FieldSeparator,Le as FieldSet,Re as FieldTitle,Mr as Flex,Pr as Grid,Fr as GridItem,Ir as Group,Rr as Heading,Ua as HiddenFrom,Br as HoverCard,Vr as HoverCardContent,Hr as HoverCardTrigger,wr as InfiniteProgress,Ge as Input,qe as InputGroup,Je as InputGroupAddon,Ye as InputGroupButton,Xe as InputGroupInput,Ze as InputGroupText,Qe as InputGroupTextarea,Ur as InputOTP,Wr as InputOTPGroup,Gr as InputOTPSeparator,Kr as InputOTPSlot,Xr as Kbd,Zr as KbdGroup,Oe as Label,Qr as List,$r as ListIcon,ei as ListItem,ri as MaskInput,Sa as ModeToggle,ii as NativeSelect,ai as NativeSelectOptGroup,oi as NativeSelectOption,si as NavigationMenu,ci as NavigationMenuContent,li as NavigationMenuIndicator,ui as NavigationMenuItem,di as NavigationMenuLink,fi as NavigationMenuList,pi as NavigationMenuTrigger,mi as NavigationMenuViewport,gi as Pagination,_i as PaginationContent,vi as PaginationEllipsis,yi as PaginationItem,bi as PaginationLink,xi as PaginationNext,Si as PaginationPrevious,Xn as PieChart,Zn as PieChartBase,Mn as Popover,Nn as PopoverAnchor,Pn as PopoverContent,Fn as PopoverDescription,In as PopoverHeader,Ln as PopoverTitle,Rn as PopoverTrigger,Ci as Progress,qr as REGEXP_ONLY_CHARS,Jr as REGEXP_ONLY_DIGITS,Yr as REGEXP_ONLY_DIGITS_AND_CHARS,wi as RadioGroup,Ti as RadioGroupItem,Ei as ResizableHandle,Di as ResizablePanel,Oi as ResizablePanelGroup,ki as ScrollArea,Ai as ScrollBar,$t as Select,en as SelectContent,tn as SelectGroup,nn as SelectItem,rn as SelectLabel,an as SelectScrollDownButton,on as SelectScrollUpButton,sn as SelectSeparator,cn as SelectTrigger,ln as SelectValue,ne as Separator,Ri as Sidebar,zi as SidebarContent,Bi as SidebarFooter,Vi as SidebarGroup,Hi as SidebarGroupAction,Ui as SidebarGroupContent,Wi as SidebarGroupLabel,Gi as SidebarHeader,Ki as SidebarInput,qi as SidebarInset,Ji as SidebarMenu,Yi as SidebarMenuAction,Xi as SidebarMenuBadge,Zi as SidebarMenuButton,Qi as SidebarMenuItem,$i as SidebarMenuSkeleton,ea as SidebarMenuSub,ta as SidebarMenuSubButton,na as SidebarMenuSubItem,ra as SidebarProvider,ia as SidebarRail,aa as SidebarSeparator,oa as SidebarTrigger,ca as SimpleGrid,Mi as Skeleton,la as Slider,d as Spinner,fa as Stack,ma as Switch,un as Table,dn as TableBody,fn as TableCaption,pn as TableCell,mn as TableContainer,hn as TableFooter,gn as TableHead,_n as TableHeader,vn as TableRow,ha as Tabs,ga as TabsContent,_a as TabsList,va as TabsTrigger,ba as Text,Ke as Textarea,Ca as ThemeProvider,Ta as Timeline,Ea as TimelineConnector,Da as TimelineContent,Oa as TimelineDescription,ka as TimelineEmpty,Aa as TimelineHeader,ja as TimelineIcon,Ma as TimelineItem,Na as TimelineTime,Pa as TimelineTitle,ua as Toaster,Ia as Toggle,Ra as ToggleGroup,za as ToggleGroupItem,Ni as Tooltip,Pi as TooltipContent,Fi as TooltipProvider,Ii as TooltipRoot,Li as TooltipTrigger,Ba as UnstyledButton,Wa as VisibleFrom,O as anchorVariants,G as badgeColorVariants,q as badgeVariants,Va as breakpointValues,Qn as buildPieConfig,u as buttonColorVariants,oe as buttonGroupVariants,m as buttonVariants,Te as centerVariants,e as cn,dr as composeRefs,Lt as containerVariants,On as createDataTableSelectColumn,kn as defaultDataTableLabels,Nr as flexVariants,Lr as groupVariants,zr as headingVariants,ti as listVariants,le as locale,hi as navigationMenuTriggerStyle,t as randomId,L as resolveChartColor,Ee as selectionControlColorVariants,fr as setRef,f as spinnerVariants,pa as stackVariants,yn as tableVariants,ya as tabsListVariants,xa as textVariants,Fa as timelineVariants,da as toast,La as toggleVariants,De as uiColors,Ha as useBreakpoint,Ga as useBreakpointValue,Ce as useCarousel,ht as useComboboxAnchor,An as useDataTable,jn as useDataTableContext,Ka as useDisclosure,qa as useDocumentVisibility,Tr as useDropzone,ze as useFieldControlId,Ja as useIdle,Ya as useInterval,ji as useIsMobile,Xa as useLocalStorage,ni as useMask,sa as useSidebar,wa as useTheme};
1
+ import{cn as e,randomId as t}from"./lib/utils.js";import{Accordion as n,AccordionContent as r,AccordionItem as i,AccordionTrigger as a}from"./components/accordion.js";import{Alert as o,AlertAction as s,AlertDescription as c,AlertTitle as l}from"./components/alert.js";import{buttonColorVariants as u}from"./lib/button.js";import{Spinner as d,spinnerVariants as f}from"./components/spinner.js";import{Button as p,buttonVariants as m}from"./components/button.js";import{AlertDialog as h,AlertDialogAction as g,AlertDialogCancel as _,AlertDialogContent as v,AlertDialogDescription as y,AlertDialogFooter as b,AlertDialogHeader as x,AlertDialogMedia as S,AlertDialogOverlay as C,AlertDialogPortal as w,AlertDialogTitle as T,AlertDialogTrigger as E}from"./components/alert-dialog.js";import{Anchor as D,anchorVariants as O}from"./components/anchor.js";import{CHART_COLOR_KEYS as k,ChartContainer as A,ChartLegend as j,ChartLegendContent as M,ChartStyle as N,ChartTooltip as P,ChartTooltipContent as F,DEFAULT_CHART_PALETTE as I,resolveChartColor as L}from"./components/chart.js";import{AreaChart as R}from"./components/area-chart.js";import{Avatar as z,AvatarBadge as B,AvatarFallback as V,AvatarGroup as H,AvatarGroupCount as U,AvatarImage as W}from"./components/avatar.js";import{badgeColorVariants as G}from"./lib/badge.js";import{Badge as K,badgeVariants as q}from"./components/badge.js";import{BarChart as J}from"./components/bar-chart.js";import{Breadcrumb as Y,BreadcrumbEllipsis as X,BreadcrumbItem as Z,BreadcrumbLink as Q,BreadcrumbList as $,BreadcrumbPage as ee,BreadcrumbSeparator as te}from"./components/breadcrumb.js";import{Separator as ne}from"./components/separator.js";import{ButtonGroup as re,ButtonGroupSeparator as ie,ButtonGroupText as ae,buttonGroupVariants as oe}from"./components/button-group.js";import{Calendar as se,CalendarDayButton as ce,locale as le}from"./components/calendar.js";import{Card as ue,CardAction as de,CardContent as fe,CardDescription as pe,CardFooter as me,CardHeader as he,CardTitle as ge}from"./components/card.js";import{Carousel as _e,CarouselContent as ve,CarouselIndicators as ye,CarouselItem as be,CarouselNext as xe,CarouselPrevious as Se,useCarousel as Ce}from"./components/carousel.js";import{Center as we,centerVariants as Te}from"./components/center.js";import{selectionControlColorVariants as Ee,uiColors as De}from"./lib/color.js";import{Label as Oe}from"./components/label.js";import{Field as ke,FieldContent as Ae,FieldDescription as je,FieldError as Me,FieldGroup as Ne,FieldLabel as Pe,FieldLegend as Fe,FieldSeparator as Ie,FieldSet as Le,FieldTitle as Re,useFieldControlId as ze}from"./components/field.js";import{Checkbox as Be}from"./components/checkbox.js";import{Code as Ve}from"./components/code.js";import{Collapsible as He,CollapsibleContent as Ue,CollapsibleTrigger as We}from"./components/collapsible.js";import{Input as Ge}from"./components/input.js";import{Textarea as Ke}from"./components/textarea.js";import{InputGroup as qe,InputGroupAddon as Je,InputGroupButton as Ye,InputGroupInput as Xe,InputGroupText as Ze,InputGroupTextarea as Qe}from"./components/input-group.js";import{Combobox as $e,ComboboxChip as et,ComboboxChips as tt,ComboboxChipsInput as nt,ComboboxClear as rt,ComboboxCollection as it,ComboboxContent as at,ComboboxEmpty as ot,ComboboxGroup as st,ComboboxInput as ct,ComboboxItem as lt,ComboboxLabel as ut,ComboboxList as dt,ComboboxSeparator as ft,ComboboxTrigger as pt,ComboboxValue as mt,useComboboxAnchor as ht}from"./components/combobox.js";import{Dialog as gt,DialogBody as _t,DialogClose as vt,DialogContent as yt,DialogDescription as bt,DialogFooter as xt,DialogHeader as St,DialogOverlay as Ct,DialogPortal as wt,DialogTitle as Tt,DialogTrigger as Et}from"./components/dialog.js";import{Command as Dt,CommandDialog as Ot,CommandEmpty as kt,CommandGroup as At,CommandInput as jt,CommandItem as Mt,CommandList as Nt,CommandSeparator as Pt,CommandShortcut as Ft}from"./components/command.js";import{Container as It,containerVariants as Lt}from"./components/container.js";import{DropdownMenu as Rt,DropdownMenuCheckboxItem as zt,DropdownMenuContent as Bt,DropdownMenuGroup as Vt,DropdownMenuItem as Ht,DropdownMenuLabel as Ut,DropdownMenuPortal as Wt,DropdownMenuRadioGroup as Gt,DropdownMenuRadioItem as Kt,DropdownMenuSeparator as qt,DropdownMenuShortcut as Jt,DropdownMenuSub as Yt,DropdownMenuSubContent as Xt,DropdownMenuSubTrigger as Zt,DropdownMenuTrigger as Qt}from"./components/dropdown-menu.js";import{Select as $t,SelectContent as en,SelectGroup as tn,SelectItem as nn,SelectLabel as rn,SelectScrollDownButton as an,SelectScrollUpButton as on,SelectSeparator as sn,SelectTrigger as cn,SelectValue as ln}from"./components/select.js";import{Table as un,TableBody as dn,TableCaption as fn,TableCell as pn,TableContainer as mn,TableFooter as hn,TableHead as gn,TableHeader as _n,TableRow as vn,tableVariants as yn}from"./components/table.js";import{DataTable as bn,DataTableBody as xn,DataTableColumnHeader as Sn,DataTableHeader as Cn,DataTablePagination as wn,DataTableRoot as Tn,DataTableToolbar as En,DataTableViewOptions as Dn,createDataTableSelectColumn as On,defaultDataTableLabels as kn,useDataTable as An,useDataTableContext as jn}from"./components/data-table.js";import{Popover as Mn,PopoverAnchor as Nn,PopoverContent as Pn,PopoverDescription as Fn,PopoverHeader as In,PopoverTitle as Ln,PopoverTrigger as Rn}from"./components/popover.js";import{DateRangePicker as zn,DateRangePickerActions as Bn,DateRangePickerApply as Vn,DateRangePickerCalendar as Hn,DateRangePickerContent as Un,DateRangePickerDateFields as Wn,DateRangePickerPreset as Gn,DateRangePickerPresets as Kn,DateRangePickerReset as qn,DateRangePickerTrigger as Jn,DateRangePickerValue as Yn}from"./components/date-range-picker.js";import{PieChart as Xn,PieChartBase as Zn,buildPieConfig as Qn}from"./components/pie-chart.js";import{DonutChart as $n}from"./components/donut-chart.js";import{Drawer as er,DrawerBody as tr,DrawerClose as nr,DrawerContent as rr,DrawerDescription as ir,DrawerFooter as ar,DrawerHeader as or,DrawerOverlay as sr,DrawerPortal as cr,DrawerTitle as lr,DrawerTrigger as ur}from"./components/drawer.js";import{composeRefs as dr,setRef as fr}from"./lib/compose-refs.js";import{Dropzone as pr,DropzoneArea as mr,DropzoneDescription as hr,DropzoneFileList as gr,DropzoneFileListItem as _r,DropzoneFileMessage as vr,DropzoneMessage as yr,DropzoneRemoveFile as br,DropzoneRetryFile as xr,DropzoneTrigger as Sr,ErrorCode as Cr,InfiniteProgress as wr,useDropzone as Tr}from"./components/dropzone.js";import{Empty as Er,EmptyContent as Dr,EmptyDescription as Or,EmptyHeader as kr,EmptyMedia as Ar,EmptyTitle as jr}from"./components/empty.js";import{Flex as Mr,flexVariants as Nr}from"./components/flex.js";import{Grid as Pr,GridItem as Fr}from"./components/grid.js";import{Group as Ir,groupVariants as Lr}from"./components/group.js";import{Heading as Rr,headingVariants as zr}from"./components/heading.js";import{HoverCard as Br,HoverCardContent as Vr,HoverCardTrigger as Hr}from"./components/hover-card.js";import{InputOTP as Ur,InputOTPGroup as Wr,InputOTPSeparator as Gr,InputOTPSlot as Kr,REGEXP_ONLY_CHARS as qr,REGEXP_ONLY_DIGITS as Jr,REGEXP_ONLY_DIGITS_AND_CHARS as Yr}from"./components/input-otp.js";import{Kbd as Xr,KbdGroup as Zr}from"./components/kbd.js";import{List as Qr,ListIcon as $r,ListItem as ei,listVariants as ti}from"./components/list.js";import{useMask as ni}from"./hooks/use-mask.js";import{MaskInput as ri}from"./components/mask-input.js";import{NativeSelect as ii,NativeSelectOptGroup as ai,NativeSelectOption as oi}from"./components/native-select.js";import{NavigationMenu as si,NavigationMenuContent as ci,NavigationMenuIndicator as li,NavigationMenuItem as ui,NavigationMenuLink as di,NavigationMenuList as fi,NavigationMenuTrigger as pi,NavigationMenuViewport as mi,navigationMenuTriggerStyle as hi}from"./components/navigation-menu.js";import{Pagination as gi,PaginationContent as _i,PaginationEllipsis as vi,PaginationItem as yi,PaginationLink as bi,PaginationNext as xi,PaginationPrevious as Si}from"./components/pagination.js";import{Progress as Ci}from"./components/progress.js";import{RadioGroup as wi,RadioGroupItem as Ti}from"./components/radio-group.js";import{ResizableHandle as Ei,ResizablePanel as Di,ResizablePanelGroup as Oi}from"./components/resizable.js";import{ScrollArea as ki,ScrollBar as Ai}from"./components/scroll-area.js";import{useIsMobile as ji}from"./hooks/use-mobile.js";import{Skeleton as Mi}from"./components/skeleton.js";import{Tooltip as Ni,TooltipContent as Pi,TooltipProvider as Fi,TooltipRoot as Ii,TooltipTrigger as Li}from"./components/tooltip.js";import{Sidebar as Ri,SidebarContent as zi,SidebarFooter as Bi,SidebarGroup as Vi,SidebarGroupAction as Hi,SidebarGroupContent as Ui,SidebarGroupLabel as Wi,SidebarHeader as Gi,SidebarInput as Ki,SidebarInset as qi,SidebarMenu as Ji,SidebarMenuAction as Yi,SidebarMenuBadge as Xi,SidebarMenuButton as Zi,SidebarMenuItem as Qi,SidebarMenuSkeleton as $i,SidebarMenuSub as ea,SidebarMenuSubButton as ta,SidebarMenuSubItem as na,SidebarProvider as ra,SidebarRail as ia,SidebarSeparator as aa,SidebarTrigger as oa,useSidebar as sa}from"./components/sidebar.js";import{SimpleGrid as ca}from"./components/simple-grid.js";import{Slider as la}from"./components/slider.js";import{Toaster as ua,toast as da}from"./components/sonner.js";import{Stack as fa,stackVariants as pa}from"./components/stack.js";import{Switch as ma}from"./components/switch.js";import{Tabs as ha,TabsContent as ga,TabsList as _a,TabsTrigger as va,tabsListVariants as ya}from"./components/tabs.js";import{Text as ba,textVariants as xa}from"./components/text.js";import{ModeToggle as Sa,ThemeProvider as Ca,useTheme as wa}from"./components/theme.js";import{Timeline as Ta,TimelineConnector as Ea,TimelineContent as Da,TimelineDescription as Oa,TimelineEmpty as ka,TimelineHeader as Aa,TimelineIcon as ja,TimelineItem as Ma,TimelineTime as Na,TimelineTitle as Pa,timelineVariants as Fa}from"./components/timeline.js";import{Toggle as Ia,toggleVariants as La}from"./components/toggle.js";import{ToggleGroup as Ra,ToggleGroupItem as za}from"./components/toggle-group.js";import{UnstyledButton as Ba}from"./components/unstyled-button.js";import{breakpointValues as Va,useBreakpoint as Ha}from"./hooks/use-breakpoint.js";import{HiddenFrom as Ua,VisibleFrom as Wa}from"./components/visibility.js";import{useBreakpointValue as Ga}from"./hooks/use-breakpoint-value.js";import{useDisclosure as Ka}from"./hooks/use-disclosure.js";import{useDocumentVisibility as qa}from"./hooks/use-document-visibility.js";import{n as Ja,t as Ya}from"./use-hotkeys-BOfOFxb5.js";import{useIdle as Xa}from"./hooks/use-idle.js";import{useInterval as Za}from"./hooks/use-interval.js";import{useLocalStorage as Qa}from"./hooks/use-local-storage.js";export{n as Accordion,r as AccordionContent,i as AccordionItem,a as AccordionTrigger,o as Alert,s as AlertAction,c as AlertDescription,h as AlertDialog,g as AlertDialogAction,_ as AlertDialogCancel,v as AlertDialogContent,y as AlertDialogDescription,b as AlertDialogFooter,x as AlertDialogHeader,S as AlertDialogMedia,C as AlertDialogOverlay,w as AlertDialogPortal,T as AlertDialogTitle,E as AlertDialogTrigger,l as AlertTitle,D as Anchor,R as AreaChart,z as Avatar,B as AvatarBadge,V as AvatarFallback,H as AvatarGroup,U as AvatarGroupCount,W as AvatarImage,K as Badge,J as BarChart,Y as Breadcrumb,X as BreadcrumbEllipsis,Z as BreadcrumbItem,Q as BreadcrumbLink,$ as BreadcrumbList,ee as BreadcrumbPage,te as BreadcrumbSeparator,p as Button,re as ButtonGroup,ie as ButtonGroupSeparator,ae as ButtonGroupText,k as CHART_COLOR_KEYS,se as Calendar,ce as CalendarDayButton,ue as Card,de as CardAction,fe as CardContent,pe as CardDescription,me as CardFooter,he as CardHeader,ge as CardTitle,_e as Carousel,ve as CarouselContent,ye as CarouselIndicators,be as CarouselItem,xe as CarouselNext,Se as CarouselPrevious,we as Center,A as ChartContainer,j as ChartLegend,M as ChartLegendContent,N as ChartStyle,P as ChartTooltip,F as ChartTooltipContent,Be as Checkbox,Ve as Code,He as Collapsible,Ue as CollapsibleContent,We as CollapsibleTrigger,$e as Combobox,et as ComboboxChip,tt as ComboboxChips,nt as ComboboxChipsInput,rt as ComboboxClear,it as ComboboxCollection,at as ComboboxContent,ot as ComboboxEmpty,st as ComboboxGroup,ct as ComboboxInput,lt as ComboboxItem,ut as ComboboxLabel,dt as ComboboxList,ft as ComboboxSeparator,pt as ComboboxTrigger,mt as ComboboxValue,Dt as Command,Ot as CommandDialog,kt as CommandEmpty,At as CommandGroup,jt as CommandInput,Mt as CommandItem,Nt as CommandList,Pt as CommandSeparator,Ft as CommandShortcut,It as Container,I as DEFAULT_CHART_PALETTE,bn as DataTable,xn as DataTableBody,Sn as DataTableColumnHeader,Cn as DataTableHeader,wn as DataTablePagination,Tn as DataTableRoot,En as DataTableToolbar,Dn as DataTableViewOptions,zn as DateRangePicker,Bn as DateRangePickerActions,Vn as DateRangePickerApply,Hn as DateRangePickerCalendar,Un as DateRangePickerContent,Wn as DateRangePickerDateFields,Gn as DateRangePickerPreset,Kn as DateRangePickerPresets,qn as DateRangePickerReset,Jn as DateRangePickerTrigger,Yn as DateRangePickerValue,gt as Dialog,_t as DialogBody,vt as DialogClose,yt as DialogContent,bt as DialogDescription,xt as DialogFooter,St as DialogHeader,Ct as DialogOverlay,wt as DialogPortal,Tt as DialogTitle,Et as DialogTrigger,$n as DonutChart,er as Drawer,tr as DrawerBody,nr as DrawerClose,rr as DrawerContent,ir as DrawerDescription,ar as DrawerFooter,or as DrawerHeader,sr as DrawerOverlay,cr as DrawerPortal,lr as DrawerTitle,ur as DrawerTrigger,Rt as DropdownMenu,zt as DropdownMenuCheckboxItem,Bt as DropdownMenuContent,Vt as DropdownMenuGroup,Ht as DropdownMenuItem,Ut as DropdownMenuLabel,Wt as DropdownMenuPortal,Gt as DropdownMenuRadioGroup,Kt as DropdownMenuRadioItem,qt as DropdownMenuSeparator,Jt as DropdownMenuShortcut,Yt as DropdownMenuSub,Xt as DropdownMenuSubContent,Zt as DropdownMenuSubTrigger,Qt as DropdownMenuTrigger,pr as Dropzone,mr as DropzoneArea,hr as DropzoneDescription,gr as DropzoneFileList,_r as DropzoneFileListItem,vr as DropzoneFileMessage,yr as DropzoneMessage,br as DropzoneRemoveFile,xr as DropzoneRetryFile,Sr as DropzoneTrigger,Er as Empty,Dr as EmptyContent,Or as EmptyDescription,kr as EmptyHeader,Ar as EmptyMedia,jr as EmptyTitle,Cr as ErrorCode,ke as Field,Ae as FieldContent,je as FieldDescription,Me as FieldError,Ne as FieldGroup,Pe as FieldLabel,Fe as FieldLegend,Ie as FieldSeparator,Le as FieldSet,Re as FieldTitle,Mr as Flex,Pr as Grid,Fr as GridItem,Ir as Group,Rr as Heading,Ua as HiddenFrom,Br as HoverCard,Vr as HoverCardContent,Hr as HoverCardTrigger,wr as InfiniteProgress,Ge as Input,qe as InputGroup,Je as InputGroupAddon,Ye as InputGroupButton,Xe as InputGroupInput,Ze as InputGroupText,Qe as InputGroupTextarea,Ur as InputOTP,Wr as InputOTPGroup,Gr as InputOTPSeparator,Kr as InputOTPSlot,Xr as Kbd,Zr as KbdGroup,Oe as Label,Qr as List,$r as ListIcon,ei as ListItem,ri as MaskInput,Sa as ModeToggle,ii as NativeSelect,ai as NativeSelectOptGroup,oi as NativeSelectOption,si as NavigationMenu,ci as NavigationMenuContent,li as NavigationMenuIndicator,ui as NavigationMenuItem,di as NavigationMenuLink,fi as NavigationMenuList,pi as NavigationMenuTrigger,mi as NavigationMenuViewport,gi as Pagination,_i as PaginationContent,vi as PaginationEllipsis,yi as PaginationItem,bi as PaginationLink,xi as PaginationNext,Si as PaginationPrevious,Xn as PieChart,Zn as PieChartBase,Mn as Popover,Nn as PopoverAnchor,Pn as PopoverContent,Fn as PopoverDescription,In as PopoverHeader,Ln as PopoverTitle,Rn as PopoverTrigger,Ci as Progress,qr as REGEXP_ONLY_CHARS,Jr as REGEXP_ONLY_DIGITS,Yr as REGEXP_ONLY_DIGITS_AND_CHARS,wi as RadioGroup,Ti as RadioGroupItem,Ei as ResizableHandle,Di as ResizablePanel,Oi as ResizablePanelGroup,ki as ScrollArea,Ai as ScrollBar,$t as Select,en as SelectContent,tn as SelectGroup,nn as SelectItem,rn as SelectLabel,an as SelectScrollDownButton,on as SelectScrollUpButton,sn as SelectSeparator,cn as SelectTrigger,ln as SelectValue,ne as Separator,Ri as Sidebar,zi as SidebarContent,Bi as SidebarFooter,Vi as SidebarGroup,Hi as SidebarGroupAction,Ui as SidebarGroupContent,Wi as SidebarGroupLabel,Gi as SidebarHeader,Ki as SidebarInput,qi as SidebarInset,Ji as SidebarMenu,Yi as SidebarMenuAction,Xi as SidebarMenuBadge,Zi as SidebarMenuButton,Qi as SidebarMenuItem,$i as SidebarMenuSkeleton,ea as SidebarMenuSub,ta as SidebarMenuSubButton,na as SidebarMenuSubItem,ra as SidebarProvider,ia as SidebarRail,aa as SidebarSeparator,oa as SidebarTrigger,ca as SimpleGrid,Mi as Skeleton,la as Slider,d as Spinner,fa as Stack,ma as Switch,un as Table,dn as TableBody,fn as TableCaption,pn as TableCell,mn as TableContainer,hn as TableFooter,gn as TableHead,_n as TableHeader,vn as TableRow,ha as Tabs,ga as TabsContent,_a as TabsList,va as TabsTrigger,ba as Text,Ke as Textarea,Ca as ThemeProvider,Ta as Timeline,Ea as TimelineConnector,Da as TimelineContent,Oa as TimelineDescription,ka as TimelineEmpty,Aa as TimelineHeader,ja as TimelineIcon,Ma as TimelineItem,Na as TimelineTime,Pa as TimelineTitle,ua as Toaster,Ia as Toggle,Ra as ToggleGroup,za as ToggleGroupItem,Ni as Tooltip,Pi as TooltipContent,Fi as TooltipProvider,Ii as TooltipRoot,Li as TooltipTrigger,Ba as UnstyledButton,Wa as VisibleFrom,O as anchorVariants,G as badgeColorVariants,q as badgeVariants,Va as breakpointValues,Qn as buildPieConfig,u as buttonColorVariants,oe as buttonGroupVariants,m as buttonVariants,Te as centerVariants,e as cn,dr as composeRefs,Lt as containerVariants,On as createDataTableSelectColumn,kn as defaultDataTableLabels,Nr as flexVariants,Ja as getHotkeyHandler,Lr as groupVariants,zr as headingVariants,ti as listVariants,le as locale,hi as navigationMenuTriggerStyle,t as randomId,L as resolveChartColor,Ee as selectionControlColorVariants,fr as setRef,f as spinnerVariants,pa as stackVariants,yn as tableVariants,ya as tabsListVariants,xa as textVariants,Fa as timelineVariants,da as toast,La as toggleVariants,De as uiColors,Ha as useBreakpoint,Ga as useBreakpointValue,Ce as useCarousel,ht as useComboboxAnchor,An as useDataTable,jn as useDataTableContext,Ka as useDisclosure,qa as useDocumentVisibility,Tr as useDropzone,ze as useFieldControlId,Ya as useHotkeys,Xa as useIdle,Za as useInterval,ji as useIsMobile,Qa as useLocalStorage,ni as useMask,sa as useSidebar,wa as useTheme};
@@ -46,6 +46,10 @@ Unless noted otherwise, each module also exports its public `*Props` types from
46
46
  - `use-document-visibility`
47
47
  - Import path: `@uselets/ui/hooks/use-document-visibility`
48
48
  - Exports: `useDocumentVisibility`
49
+ - `use-hotkeys`
50
+ - Import path: `@uselets/ui/hooks/use-hotkeys`
51
+ - Exports: `useHotkeys`, `HotkeyItem`, `getHotkeyHandler`, `HotkeyItemOptions`
52
+ - Notes: registers global keyboard shortcuts on the document; each item is `[hotkey, handler, options?]`; supports `mod` (ctrl/meta), `usePhysicalKeys`, and `preventDefault`; ignores INPUT/TEXTAREA/SELECT by default. `getHotkeyHandler` binds the same shortcut tuples to a single element's `onKeyDown`.
49
53
  - `use-local-storage`
50
54
  - Import path: `@uselets/ui/hooks/use-local-storage`
51
55
  - Exports: `useLocalStorage`, `UseLocalStorageOptions`
@@ -162,7 +166,7 @@ Unless noted otherwise, each module also exports its public `*Props` types from
162
166
  - Exports: `NativeSelect`, `NativeSelectOptGroup`, `NativeSelectOption`
163
167
  - `combobox`
164
168
  - Exports: `Combobox`, `ComboboxInput`, `ComboboxContent`, `ComboboxList`, `ComboboxItem`, `ComboboxGroup`, `ComboboxLabel`, `ComboboxCollection`, `ComboboxClear`, `ComboboxEmpty`, `ComboboxSeparator`, `ComboboxChips`, `ComboboxChip`, `ComboboxChipsInput`, `ComboboxTrigger`, `ComboboxValue`, `useComboboxAnchor`
165
- - Notes: `ComboboxInput` supports `icon?: React.ReactNode`, `triggerIcon?: React.ReactNode`, `showTrigger?: boolean`, and `showClear?: boolean`; `ComboboxContent` supports `container` for rendering inside overlays such as dialogs
169
+ - Notes: `ComboboxInput` supports `icon?: React.ReactNode`, `triggerIcon?: React.ReactNode`, `showTrigger?: boolean`, and `showClear?: boolean`; `ComboboxChips` supports `showClear?: boolean` to render a button that clears all selected chips at once; `ComboboxContent` supports `container` for rendering inside overlays such as dialogs
166
170
  - `dropzone`
167
171
  - Exports: `Dropzone`, `DropzoneArea`, `DropzoneDescription`, `DropzoneFileList`, `DropzoneFileListItem`, `DropzoneFileMessage`, `DropzoneMessage`, `DropzoneRemoveFile`, `DropzoneRetryFile`, `DropzoneTrigger`, `InfiniteProgress`, `useDropzone`
168
172
  - Notes: upload composition with validation, retry handling, status list UI, and optional `shiftOnMaxFiles`
@@ -231,10 +235,10 @@ Unless noted otherwise, each module also exports its public `*Props` types from
231
235
  - Notes: low-level chart primitives. For app usage prefer the high-level `area-chart`, `bar-chart`, `pie-chart`, `donut-chart` modules. Import raw recharts primitives (`Bar`, `XAxis`, etc.) directly from `recharts` when composing with `ChartContainer`. `ChartColorKey` is the union of theme color tokens accepted by every high-level chart (`primary | brand | gray | zinc | red | yellow | green | blue | indigo | pink`) and resolves to `var(--{key}-500)` via `resolveChartColor`.
232
236
  - `area-chart`
233
237
  - Exports: `AreaChart`, `AreaChartSeries`, `AreaChartType`, `AreaChartCurveType`, `AreaChartGridAxis`
234
- - Notes: high-level area chart. Pass `data`, `series` (array of `{ name, label?, color?, colorKey? }`), and `dataKey` (X axis field). Supports `type` (default/stacked/percent/split), `curveType`, `withXAxis`, `withYAxis`, `gridAxis`, `withDots`, `withTooltip`, `withLegend`. Use `colorKey: ChartColorKey` for theme colors (`'blue'`, `'primary'`, etc.) or `color` for raw CSS values; explicit `color` wins. Defaults to chart colors `--chart-1..5`. Pass `areaProps` to spread props (e.g. `onClick`) onto each underlying recharts `<Area>`.
238
+ - Notes: high-level area chart. Pass `data`, `series` (array of `{ name, label?, color?, colorKey? }`), and `dataKey` (X axis field). Supports `type` (default/stacked/percent/split), `curveType`, `withXAxis`, `withYAxis`, `gridAxis`, `withDots`, `withTooltip`, `withLegend`. Use `colorKey: ChartColorKey` for theme colors (`'blue'`, `'primary'`, etc.) or `color` for raw CSS values; explicit `color` wins. Defaults to chart colors `--chart-1..5`. Pass `areaProps` to spread props (e.g. `onClick`) onto each underlying recharts `<Area>`. Pass `areaChartProps` to spread props (e.g. `margin`) onto the wrapping recharts `<AreaChart>`.
235
239
  - `bar-chart`
236
- - Exports: `BarChart`, `BarChartSeries`, `BarChartType`, `BarChartOrientation`, `BarChartGridAxis`
237
- - Notes: high-level bar chart. Same shape as `area-chart` plus `orientation` (vertical/horizontal), `barSize`, `radius`. Series accept `color` / `colorKey`. Supports stacked and percent types. Pass `barProps` to spread props (e.g. `onClick`, `cursor`) onto each underlying recharts `<Bar>`.
240
+ - Exports: `BarChart`, `BarChartSeries`, `BarChartDatum`, `BarChartType`, `BarChartOrientation`, `BarChartGridAxis`
241
+ - Notes: high-level bar chart. Same shape as `area-chart` plus `orientation` (vertical/horizontal), `barSize`, `radius`. Series accept `color` / `colorKey`. Each `data` row (`BarChartDatum`) can also set `color` / `colorKey`; when present, the row color wins over the series color and applies to every bar in that row. Series/datum `name` is free-form (spaces and non-ASCII are fine). Supports stacked and percent types. Pass `barProps` to spread props (e.g. `onClick`, `cursor`) onto each underlying recharts `<Bar>`. Pass `barChartProps` to spread props (e.g. `margin`, `barCategoryGap`) onto the wrapping recharts `<BarChart>`.
238
242
  - `pie-chart`
239
243
  - Exports: `PieChart`, `PieChartBase`, `PieChartDatum`, `buildPieConfig`
240
244
  - Notes: high-level pie chart. Pass `data` as `Array<{ name, value, color?, colorKey? }>`. Supports `withLabels`, `labelsPosition`, `startAngle`, `endAngle`, `paddingAngle`, `withLegend`, `withTooltip`, `strokeWidth`, and `strokeColor` (theme key or CSS value, defaults to `var(--background)` so segment gaps match the page background). Pass `pieProps` to spread props (e.g. `onClick`) onto the underlying recharts `<Pie>`. `PieChartBase` is the shared internal renderer used by `donut-chart`.
@@ -166,7 +166,7 @@ Guidance:
166
166
  - Use `@uselets/ui/hooks/<hook-module>` for dedicated hook subpaths.
167
167
  - Do not invent undocumented subpaths.
168
168
 
169
- Public hook subpaths currently include `hooks/use-mobile`, `hooks/use-disclosure`, `hooks/use-interval`, `hooks/use-idle`, `hooks/use-document-visibility`, `hooks/use-local-storage`, and `hooks/use-mask`. Legacy `@uselets/ui/use-*` paths are not public entrypoints. Utility helpers are available from `@uselets/ui/utils`, and shared UI color helpers are available from the root barrel or `@uselets/ui/lib/color`.
169
+ Public hook subpaths currently include `hooks/use-mobile`, `hooks/use-disclosure`, `hooks/use-interval`, `hooks/use-idle`, `hooks/use-document-visibility`, `hooks/use-hotkeys`, `hooks/use-local-storage`, and `hooks/use-mask`. Legacy `@uselets/ui/use-*` paths are not public entrypoints. Utility helpers are available from `@uselets/ui/utils`, and shared UI color helpers are available from the root barrel or `@uselets/ui/lib/color`.
170
170
 
171
171
  Use `DataTable` from `@uselets/ui/data-table` for client-side tables with sorting, filtering, pagination, row selection, column visibility, formatted cells, and custom action columns. All user-facing labels default to Portuguese (pt-BR) and can be overridden through the `labels` prop (`Partial<DataTableLabels>`); the full defaults are exported as `defaultDataTableLabels`.
172
172
 
@@ -0,0 +1,2 @@
1
+ import"./rolldown-runtime-Bdj-bS2b.js";import{useEffect as e,useEffectEvent as t}from"react";const n={" ":`space`,ArrowLeft:`arrowleft`,ArrowRight:`arrowright`,ArrowUp:`arrowup`,ArrowDown:`arrowdown`,Escape:`escape`,Esc:`escape`,esc:`escape`,Enter:`enter`,Tab:`tab`,Backspace:`backspace`,Delete:`delete`,Insert:`insert`,Home:`home`,End:`end`,PageUp:`pageup`,PageDown:`pagedown`,"+":`plus`,"-":`minus`,"*":`asterisk`,"/":`slash`};function normalizeKey(e){let t=e.replace(`Key`,``).toLowerCase();return n[e]||t}function parseHotkey(e){let t=e.toLowerCase().split(`+`).map(e=>e.trim()),n={alt:t.includes(`alt`),ctrl:t.includes(`ctrl`),meta:t.includes(`meta`),mod:t.includes(`mod`),shift:t.includes(`shift`)},r=[`alt`,`ctrl`,`meta`,`shift`,`mod`],i=t.find(e=>!r.includes(e));return{...n,key:i===`[plus]`?`+`:i}}function isExactHotkey(e,t,n){let{alt:r,ctrl:i,meta:a,mod:o,shift:s,key:c}=e,{altKey:l,ctrlKey:u,metaKey:d,shiftKey:f,key:p,code:m}=t;if(r!==l)return!1;if(o){if(!u&&!d)return!1}else if(i!==u||a!==d)return!1;return s===f?!!(c&&(n?normalizeKey(m)===normalizeKey(c):normalizeKey(p??m)===normalizeKey(c))):!1}function getHotkeyMatcher(e,t){return n=>isExactHotkey(parseHotkey(e),n,t)}function getHotkeyHandler(e){return t=>{let n=`nativeEvent`in t?t.nativeEvent:t;e.forEach(([e,r,i={preventDefault:!0,usePhysicalKeys:!1}])=>{getHotkeyMatcher(e,i.usePhysicalKeys)(n)&&(i.preventDefault&&t.preventDefault(),r(n))})}}function shouldFireEvent(e,t,n=!1){return e.target instanceof HTMLElement?(n||!e.target.isContentEditable)&&!t.includes(e.target.tagName):!0}function useHotkeys(n,r=[`INPUT`,`TEXTAREA`,`SELECT`],i=!1){let a=t(e=>{n.forEach(([t,n,a={preventDefault:!0,usePhysicalKeys:!1}])=>{getHotkeyMatcher(t,a.usePhysicalKeys)(e)&&shouldFireEvent(e,r,i)&&(a.preventDefault&&e.preventDefault(),n(e))})});e(()=>(document.documentElement.addEventListener(`keydown`,a),()=>document.documentElement.removeEventListener(`keydown`,a)),[])}export{getHotkeyHandler as n,useHotkeys as t};
2
+ //# sourceMappingURL=use-hotkeys-BOfOFxb5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-hotkeys-BOfOFxb5.js","names":[],"sources":["../src/utils/parse-hotkey.ts","../src/hooks/use-hotkeys.ts"],"sourcesContent":["export type KeyboardModifiers = {\n alt: boolean\n ctrl: boolean\n meta: boolean\n mod: boolean\n shift: boolean\n}\n\nexport type Hotkey = KeyboardModifiers & {\n key?: string\n}\n\ntype CheckHotkeyMatch = (event: KeyboardEvent) => boolean\n\nconst keyNameMap: Record<string, string> = {\n ' ': 'space',\n ArrowLeft: 'arrowleft',\n ArrowRight: 'arrowright',\n ArrowUp: 'arrowup',\n ArrowDown: 'arrowdown',\n Escape: 'escape',\n Esc: 'escape',\n esc: 'escape',\n Enter: 'enter',\n Tab: 'tab',\n Backspace: 'backspace',\n Delete: 'delete',\n Insert: 'insert',\n Home: 'home',\n End: 'end',\n PageUp: 'pageup',\n PageDown: 'pagedown',\n '+': 'plus',\n '-': 'minus',\n '*': 'asterisk',\n '/': 'slash'\n}\n\nfunction normalizeKey(key: string): string {\n const lowerKey = key.replace('Key', '').toLowerCase()\n return keyNameMap[key] || lowerKey\n}\n\nexport function parseHotkey(hotkey: string): Hotkey {\n const keys = hotkey\n .toLowerCase()\n .split('+')\n .map((part) => part.trim())\n\n const modifiers: KeyboardModifiers = {\n alt: keys.includes('alt'),\n ctrl: keys.includes('ctrl'),\n meta: keys.includes('meta'),\n mod: keys.includes('mod'),\n shift: keys.includes('shift')\n }\n\n const reservedKeys = ['alt', 'ctrl', 'meta', 'shift', 'mod']\n\n const freeKey = keys.find((key) => !reservedKeys.includes(key))\n\n return {\n ...modifiers,\n key: freeKey === '[plus]' ? '+' : freeKey\n }\n}\n\nfunction isExactHotkey(hotkey: Hotkey, event: KeyboardEvent, usePhysicalKeys?: boolean): boolean {\n const { alt, ctrl, meta, mod, shift, key } = hotkey\n const { altKey, ctrlKey, metaKey, shiftKey, key: pressedKey, code: pressedCode } = event\n\n if (alt !== altKey) {\n return false\n }\n\n if (mod) {\n if (!ctrlKey && !metaKey) {\n return false\n }\n } else {\n if (ctrl !== ctrlKey) {\n return false\n }\n if (meta !== metaKey) {\n return false\n }\n }\n if (shift !== shiftKey) {\n return false\n }\n\n if (\n key &&\n (usePhysicalKeys\n ? normalizeKey(pressedCode) === normalizeKey(key)\n : normalizeKey(pressedKey ?? pressedCode) === normalizeKey(key))\n ) {\n return true\n }\n\n return false\n}\n\nexport function getHotkeyMatcher(hotkey: string, usePhysicalKeys?: boolean): CheckHotkeyMatch {\n return (event) => isExactHotkey(parseHotkey(hotkey), event, usePhysicalKeys)\n}\n\nexport type HotkeyItemOptions = {\n preventDefault?: boolean\n usePhysicalKeys?: boolean\n}\n\ntype HotkeyItem = [string, (event: unknown) => void, HotkeyItemOptions?]\n\nexport function getHotkeyHandler(hotkeys: HotkeyItem[]) {\n return (event: React.KeyboardEvent<HTMLElement> | KeyboardEvent) => {\n const _event = 'nativeEvent' in event ? event.nativeEvent : event\n hotkeys.forEach(([hotkey, handler, options = { preventDefault: true, usePhysicalKeys: false }]) => {\n if (getHotkeyMatcher(hotkey, options.usePhysicalKeys)(_event)) {\n if (options.preventDefault) {\n event.preventDefault()\n }\n\n handler(_event)\n }\n })\n }\n}\n","import { useEffect, useEffectEvent } from 'react'\n\nimport { getHotkeyHandler, getHotkeyMatcher, type HotkeyItemOptions } from '../utils/parse-hotkey'\n\nexport type { HotkeyItemOptions }\nexport { getHotkeyHandler }\n\nexport type HotkeyItem = [string, (event: KeyboardEvent) => void, HotkeyItemOptions?]\n\nfunction shouldFireEvent(event: KeyboardEvent, tagsToIgnore: string[], triggerOnContentEditable = false) {\n if (event.target instanceof HTMLElement) {\n if (triggerOnContentEditable) {\n return !tagsToIgnore.includes(event.target.tagName)\n }\n\n return !event.target.isContentEditable && !tagsToIgnore.includes(event.target.tagName)\n }\n\n return true\n}\n\nexport function useHotkeys(\n hotkeys: HotkeyItem[],\n tagsToIgnore: string[] = ['INPUT', 'TEXTAREA', 'SELECT'],\n triggerOnContentEditable = false\n) {\n const handleKeydown = useEffectEvent((event: KeyboardEvent) => {\n hotkeys.forEach(([hotkey, handler, options = { preventDefault: true, usePhysicalKeys: false }]) => {\n if (\n getHotkeyMatcher(hotkey, options.usePhysicalKeys)(event) &&\n shouldFireEvent(event, tagsToIgnore, triggerOnContentEditable)\n ) {\n if (options.preventDefault) {\n event.preventDefault()\n }\n\n handler(event)\n }\n })\n })\n\n useEffect(() => {\n document.documentElement.addEventListener('keydown', handleKeydown)\n return () => document.documentElement.removeEventListener('keydown', handleKeydown)\n }, [])\n}\n\nexport namespace useHotkeys {\n export type Hotkey = HotkeyItem\n}\n"],"mappings":"6FAcA,MAAM,EAAqC,CACzC,IAAK,QACL,UAAW,YACX,WAAY,aACZ,QAAS,UACT,UAAW,YACX,OAAQ,SACR,IAAK,SACL,IAAK,SACL,MAAO,QACP,IAAK,MACL,UAAW,YACX,OAAQ,SACR,OAAQ,SACR,KAAM,OACN,IAAK,MACL,OAAQ,SACR,SAAU,WACV,IAAK,OACL,IAAK,QACL,IAAK,WACL,IAAK,OACP,EAEA,SAAS,aAAa,EAAqB,CACzC,IAAM,EAAW,EAAI,QAAQ,MAAO,EAAE,CAAC,CAAC,YAAY,EACpD,OAAO,EAAW,IAAQ,CAC5B,CAEA,SAAgB,YAAY,EAAwB,CAClD,IAAM,EAAO,EACV,YAAY,CAAC,CACb,MAAM,GAAG,CAAC,CAC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,EAA2B,GAAO,CASvG,OARI,EAAM,kBAAkB,aACtB,GAIG,CAAC,EAAM,OAAO,oBAHZ,CAAC,EAAa,SAAS,EAAM,OAAO,OAAO,EAM/C,EACT,CAEA,SAAgB,WACd,EACA,EAAyB,CAAC,QAAS,WAAY,QAAQ,EACvD,EAA2B,GAC3B,CACA,IAAM,EAAgB,EAAgB,GAAyB,CAC7D,EAAQ,SAAS,CAAC,EAAQ,EAAS,EAAU,CAAE,eAAgB,GAAM,gBAAiB,EAAM,KAAO,CAE/F,iBAAiB,EAAQ,EAAQ,eAAe,CAAC,CAAC,CAAK,GACvD,gBAAgB,EAAO,EAAc,CAAwB,IAEzD,EAAQ,gBACV,EAAM,eAAe,EAGvB,EAAQ,CAAK,EAEjB,CAAC,CACH,CAAC,EAED,OACE,SAAS,gBAAgB,iBAAiB,UAAW,CAAa,MACrD,SAAS,gBAAgB,oBAAoB,UAAW,CAAa,GACjF,CAAC,CAAC,CACP"}
@@ -0,0 +1,19 @@
1
+ import { n as __name } from "./rolldown-runtime-Bdj-bS2b.js";
2
+
3
+ //#region src/utils/parse-hotkey.d.ts
4
+ type HotkeyItemOptions = {
5
+ preventDefault?: boolean;
6
+ usePhysicalKeys?: boolean;
7
+ };
8
+ type HotkeyItem$1 = [string, (event: unknown) => void, HotkeyItemOptions?];
9
+ declare function getHotkeyHandler(hotkeys: HotkeyItem$1[]): (event: React.KeyboardEvent<HTMLElement> | KeyboardEvent) => void;
10
+ //#endregion
11
+ //#region src/hooks/use-hotkeys.d.ts
12
+ type HotkeyItem = [string, (event: KeyboardEvent) => void, HotkeyItemOptions?];
13
+ declare function useHotkeys(hotkeys: HotkeyItem[], tagsToIgnore?: string[], triggerOnContentEditable?: boolean): void;
14
+ declare namespace useHotkeys {
15
+ type Hotkey = HotkeyItem;
16
+ }
17
+ //#endregion
18
+ export { getHotkeyHandler as i, useHotkeys as n, HotkeyItemOptions as r, HotkeyItem as t };
19
+ //# sourceMappingURL=use-hotkeys-Cl1cV6e8.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uselets/ui",
3
- "version": "1.9.0",
3
+ "version": "1.11.0",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "description": "React component library for the LET'S design system.",
@@ -46,6 +46,10 @@ Unless noted otherwise, each module also exports its public `*Props` types from
46
46
  - `use-document-visibility`
47
47
  - Import path: `@uselets/ui/hooks/use-document-visibility`
48
48
  - Exports: `useDocumentVisibility`
49
+ - `use-hotkeys`
50
+ - Import path: `@uselets/ui/hooks/use-hotkeys`
51
+ - Exports: `useHotkeys`, `HotkeyItem`, `getHotkeyHandler`, `HotkeyItemOptions`
52
+ - Notes: registers global keyboard shortcuts on the document; each item is `[hotkey, handler, options?]`; supports `mod` (ctrl/meta), `usePhysicalKeys`, and `preventDefault`; ignores INPUT/TEXTAREA/SELECT by default. `getHotkeyHandler` binds the same shortcut tuples to a single element's `onKeyDown`.
49
53
  - `use-local-storage`
50
54
  - Import path: `@uselets/ui/hooks/use-local-storage`
51
55
  - Exports: `useLocalStorage`, `UseLocalStorageOptions`
@@ -162,7 +166,7 @@ Unless noted otherwise, each module also exports its public `*Props` types from
162
166
  - Exports: `NativeSelect`, `NativeSelectOptGroup`, `NativeSelectOption`
163
167
  - `combobox`
164
168
  - Exports: `Combobox`, `ComboboxInput`, `ComboboxContent`, `ComboboxList`, `ComboboxItem`, `ComboboxGroup`, `ComboboxLabel`, `ComboboxCollection`, `ComboboxClear`, `ComboboxEmpty`, `ComboboxSeparator`, `ComboboxChips`, `ComboboxChip`, `ComboboxChipsInput`, `ComboboxTrigger`, `ComboboxValue`, `useComboboxAnchor`
165
- - Notes: `ComboboxInput` supports `icon?: React.ReactNode`, `triggerIcon?: React.ReactNode`, `showTrigger?: boolean`, and `showClear?: boolean`; `ComboboxContent` supports `container` for rendering inside overlays such as dialogs
169
+ - Notes: `ComboboxInput` supports `icon?: React.ReactNode`, `triggerIcon?: React.ReactNode`, `showTrigger?: boolean`, and `showClear?: boolean`; `ComboboxChips` supports `showClear?: boolean` to render a button that clears all selected chips at once; `ComboboxContent` supports `container` for rendering inside overlays such as dialogs
166
170
  - `dropzone`
167
171
  - Exports: `Dropzone`, `DropzoneArea`, `DropzoneDescription`, `DropzoneFileList`, `DropzoneFileListItem`, `DropzoneFileMessage`, `DropzoneMessage`, `DropzoneRemoveFile`, `DropzoneRetryFile`, `DropzoneTrigger`, `InfiniteProgress`, `useDropzone`
168
172
  - Notes: upload composition with validation, retry handling, status list UI, and optional `shiftOnMaxFiles`
@@ -231,10 +235,10 @@ Unless noted otherwise, each module also exports its public `*Props` types from
231
235
  - Notes: low-level chart primitives. For app usage prefer the high-level `area-chart`, `bar-chart`, `pie-chart`, `donut-chart` modules. Import raw recharts primitives (`Bar`, `XAxis`, etc.) directly from `recharts` when composing with `ChartContainer`. `ChartColorKey` is the union of theme color tokens accepted by every high-level chart (`primary | brand | gray | zinc | red | yellow | green | blue | indigo | pink`) and resolves to `var(--{key}-500)` via `resolveChartColor`.
232
236
  - `area-chart`
233
237
  - Exports: `AreaChart`, `AreaChartSeries`, `AreaChartType`, `AreaChartCurveType`, `AreaChartGridAxis`
234
- - Notes: high-level area chart. Pass `data`, `series` (array of `{ name, label?, color?, colorKey? }`), and `dataKey` (X axis field). Supports `type` (default/stacked/percent/split), `curveType`, `withXAxis`, `withYAxis`, `gridAxis`, `withDots`, `withTooltip`, `withLegend`. Use `colorKey: ChartColorKey` for theme colors (`'blue'`, `'primary'`, etc.) or `color` for raw CSS values; explicit `color` wins. Defaults to chart colors `--chart-1..5`. Pass `areaProps` to spread props (e.g. `onClick`) onto each underlying recharts `<Area>`.
238
+ - Notes: high-level area chart. Pass `data`, `series` (array of `{ name, label?, color?, colorKey? }`), and `dataKey` (X axis field). Supports `type` (default/stacked/percent/split), `curveType`, `withXAxis`, `withYAxis`, `gridAxis`, `withDots`, `withTooltip`, `withLegend`. Use `colorKey: ChartColorKey` for theme colors (`'blue'`, `'primary'`, etc.) or `color` for raw CSS values; explicit `color` wins. Defaults to chart colors `--chart-1..5`. Pass `areaProps` to spread props (e.g. `onClick`) onto each underlying recharts `<Area>`. Pass `areaChartProps` to spread props (e.g. `margin`) onto the wrapping recharts `<AreaChart>`.
235
239
  - `bar-chart`
236
- - Exports: `BarChart`, `BarChartSeries`, `BarChartType`, `BarChartOrientation`, `BarChartGridAxis`
237
- - Notes: high-level bar chart. Same shape as `area-chart` plus `orientation` (vertical/horizontal), `barSize`, `radius`. Series accept `color` / `colorKey`. Supports stacked and percent types. Pass `barProps` to spread props (e.g. `onClick`, `cursor`) onto each underlying recharts `<Bar>`.
240
+ - Exports: `BarChart`, `BarChartSeries`, `BarChartDatum`, `BarChartType`, `BarChartOrientation`, `BarChartGridAxis`
241
+ - Notes: high-level bar chart. Same shape as `area-chart` plus `orientation` (vertical/horizontal), `barSize`, `radius`. Series accept `color` / `colorKey`. Each `data` row (`BarChartDatum`) can also set `color` / `colorKey`; when present, the row color wins over the series color and applies to every bar in that row. Series/datum `name` is free-form (spaces and non-ASCII are fine). Supports stacked and percent types. Pass `barProps` to spread props (e.g. `onClick`, `cursor`) onto each underlying recharts `<Bar>`. Pass `barChartProps` to spread props (e.g. `margin`, `barCategoryGap`) onto the wrapping recharts `<BarChart>`.
238
242
  - `pie-chart`
239
243
  - Exports: `PieChart`, `PieChartBase`, `PieChartDatum`, `buildPieConfig`
240
244
  - Notes: high-level pie chart. Pass `data` as `Array<{ name, value, color?, colorKey? }>`. Supports `withLabels`, `labelsPosition`, `startAngle`, `endAngle`, `paddingAngle`, `withLegend`, `withTooltip`, `strokeWidth`, and `strokeColor` (theme key or CSS value, defaults to `var(--background)` so segment gaps match the page background). Pass `pieProps` to spread props (e.g. `onClick`) onto the underlying recharts `<Pie>`. `PieChartBase` is the shared internal renderer used by `donut-chart`.
@@ -166,7 +166,7 @@ Guidance:
166
166
  - Use `@uselets/ui/hooks/<hook-module>` for dedicated hook subpaths.
167
167
  - Do not invent undocumented subpaths.
168
168
 
169
- Public hook subpaths currently include `hooks/use-mobile`, `hooks/use-disclosure`, `hooks/use-interval`, `hooks/use-idle`, `hooks/use-document-visibility`, `hooks/use-local-storage`, and `hooks/use-mask`. Legacy `@uselets/ui/use-*` paths are not public entrypoints. Utility helpers are available from `@uselets/ui/utils`, and shared UI color helpers are available from the root barrel or `@uselets/ui/lib/color`.
169
+ Public hook subpaths currently include `hooks/use-mobile`, `hooks/use-disclosure`, `hooks/use-interval`, `hooks/use-idle`, `hooks/use-document-visibility`, `hooks/use-hotkeys`, `hooks/use-local-storage`, and `hooks/use-mask`. Legacy `@uselets/ui/use-*` paths are not public entrypoints. Utility helpers are available from `@uselets/ui/utils`, and shared UI color helpers are available from the root barrel or `@uselets/ui/lib/color`.
170
170
 
171
171
  Use `DataTable` from `@uselets/ui/data-table` for client-side tables with sorting, filtering, pagination, row selection, column visibility, formatted cells, and custom action columns. All user-facing labels default to Portuguese (pt-BR) and can be overridden through the `labels` prop (`Partial<DataTableLabels>`); the full defaults are exported as `defaultDataTableLabels`.
172
172