@uselets/ui 1.10.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 +14 -1
- package/dist/components/chart.js +2 -2
- package/dist/components/chart.js.map +1 -1
- package/dist/components/combobox.d.ts +5 -1
- package/dist/components/combobox.js +1 -1
- package/dist/components/combobox.js.map +1 -1
- package/dist/hooks/use-hotkeys.d.ts +2 -0
- package/dist/hooks/use-hotkeys.js +1 -0
- package/dist/hooks/use-hotkeys.spec.d.ts +1 -0
- package/dist/hooks/use-hotkeys.spec.js +2 -0
- package/dist/hooks/use-hotkeys.spec.js.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -1
- package/dist/skills/uselets-ui/references/component-catalog.md +5 -1
- package/dist/skills/uselets-ui/references/package-guide.md +1 -1
- package/dist/use-hotkeys-BOfOFxb5.js +2 -0
- package/dist/use-hotkeys-BOfOFxb5.js.map +1 -0
- package/dist/use-hotkeys-Cl1cV6e8.d.ts +19 -0
- package/package.json +1 -1
- package/skills/uselets-ui/references/component-catalog.md +5 -1
- package/skills/uselets-ui/references/package-guide.md +1 -1
package/README.md
CHANGED
|
@@ -343,7 +343,7 @@ You can import from the package root (`@uselets/ui`) or by subpath (`@uselets/ui
|
|
|
343
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
|
package/dist/components/chart.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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}
|
|
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 flex-wrap gap-
|
|
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 <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-4',\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.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-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,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,C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,CAAA,CAAA,CAED,EAhDE,OAAO,EAAK,OAAO,CAgDrB,CAET,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,CACE,UAAW,EACT,mDACA,IAAkB,MAAQ,OAAS,OACnC,CACF,WAEC,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,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"}
|
|
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,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E,UAAW,EACT,mDACA,IAAkB,MAAQ,OAAS,OACnC,CACF,WAEC,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:
|
|
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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,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
|
+
{"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,GACo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";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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C,CAAC,EAE/D,EAAW,SAAS,cAAc,KAAK,EAC7C,OAAO,eAAe,EAAU,oBAAqB,CAAE,aAAc,GAAM,MAAO,EAAK,CAAC,EACxF,SAAS,KAAK,YAAY,CAAQ,EAElC,gBAAgB,EAAU,CAAE,IAAK,IAAK,QAAS,EAAK,CAAC,EACrD,OAAO,CAAO,CAAC,CAAC,IAAI,iBAAiB,EAErC,EAAQ,EAER,MAAiB,EAAW,CAAC,CAAC,QAAS,CAAO,CAAC,EAAG,CAAC,QAAS,WAAY,QAAQ,EAAG,EAAI,CAAC,EACxF,gBAAgB,EAAU,CAAE,IAAK,IAAK,QAAS,EAAK,CAAC,EACrD,EAAS,OAAO,EAEhB,OAAO,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
|
@@ -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, 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, 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`
|
|
@@ -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,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EAAO,CAAe,CAC7E,CASA,SAAgB,iBAAiB,EAAuB,CACtD,MAAQ,IAA4D,CAClE,IAAM,EAAS,gBAAiB,EAAQ,EAAM,YAAc,EAC5D,EAAQ,SAAS,CAAC,EAAQ,EAAS,EAAU,CAAE,eAAgB,GAAM,gBAAiB,EAAM,KAAO,CAC7F,iBAAiB,EAAQ,EAAQ,eAAe,CAAC,CAAC,CAAM,IACtD,EAAQ,gBACV,EAAM,eAAe,EAGvB,EAAQ,CAAM,EAElB,CAAC,CACH,CACF,CCtHA,SAAS,gBAAgB,EAAsB,EAAwB,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
|
@@ -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`
|
|
@@ -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
|
|