@uselets/ui 1.5.0 → 1.6.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 +4 -4
- package/dist/components/anchor.d.ts +1 -1
- package/dist/components/badge.d.ts +2 -2
- package/dist/components/button-group.d.ts +1 -1
- package/dist/components/button.d.ts +2 -2
- package/dist/components/button.js +1 -1
- package/dist/components/button.js.map +1 -1
- package/dist/components/center.d.ts +2 -2
- package/dist/components/dialog.d.ts +7 -2
- package/dist/components/dialog.js +1 -1
- package/dist/components/dialog.js.map +1 -1
- package/dist/components/dropzone.js +1 -1
- package/dist/components/dropzone.js.map +1 -1
- package/dist/components/empty.d.ts +1 -1
- package/dist/components/field.d.ts +1 -1
- package/dist/components/field.js +1 -1
- package/dist/components/field.js.map +1 -1
- package/dist/components/flex.d.ts +3 -3
- package/dist/components/group.d.ts +3 -3
- package/dist/components/heading.d.ts +1 -1
- package/dist/components/input-group.d.ts +1 -1
- package/dist/components/list.d.ts +2 -2
- package/dist/components/mask-input.d.ts +1 -0
- package/dist/components/mask-input.js +1 -1
- package/dist/components/mask-input.js.map +1 -1
- package/dist/components/sidebar.d.ts +1 -1
- package/dist/components/stack.d.ts +3 -3
- package/dist/components/table.d.ts +1 -1
- package/dist/components/tabs.js +1 -1
- package/dist/components/tabs.js.map +1 -1
- package/dist/components/text.d.ts +1 -1
- package/dist/components/timeline.d.ts +2 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +1 -1
- package/dist/lib/compose-refs.d.ts +9 -0
- package/dist/lib/compose-refs.js +2 -0
- package/dist/lib/compose-refs.js.map +1 -0
- package/dist/skills/uselets-ui/references/component-catalog.md +8 -3
- package/dist/skills/uselets-ui/references/package-guide.md +1 -1
- package/package.json +1 -1
- package/skills/uselets-ui/references/component-catalog.md +8 -3
- package/skills/uselets-ui/references/package-guide.md +1 -1
package/README.md
CHANGED
|
@@ -319,7 +319,7 @@ You can import from the package root (`@uselets/ui`) or by subpath (`@uselets/ui
|
|
|
319
319
|
| `anchor` | `Anchor`, `anchorVariants` | Link primitive rendered as `<a>` with `size: 'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'`, `underline: 'always' \| 'hover' \| 'never' \| 'not-hover'` (default: `hover`), and `asChild`. |
|
|
320
320
|
| `avatar` | `Avatar`, `AvatarImage`, `AvatarFallback`, `AvatarBadge`, `AvatarGroup`, `AvatarGroupCount` | `Avatar` supports `size: 'sm' \| 'md' \| 'lg'` (default: `md`). |
|
|
321
321
|
| `badge` | `Badge`, `badgeVariants` | `size: 'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` (default: `md`); `variant: 'solid' \| 'outline' \| 'subtle' \| 'ghost' \| 'link'` (default: `solid`); `color: UIColor` (default: `primary`); `asChild?: boolean`. |
|
|
322
|
-
| `button` | `Button`, `buttonVariants` | `variant: 'solid' \| 'outline' \| 'subtle' \| 'ghost' \| 'link'` (default: `solid`); `color: UIColor` (default: `primary`); `size: 'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'icon-xs' \| 'icon-sm' \| 'icon' \| 'icon-lg' \| 'icon-xl'`; `loading?: boolean`. |
|
|
322
|
+
| `button` | `Button`, `buttonVariants` | `variant: 'solid' \| 'secondary' \| 'outline' \| 'subtle' \| 'ghost' \| 'link'` (default: `solid`); `color: UIColor` (default: `primary`); `size: 'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'icon-xs' \| 'icon-sm' \| 'icon' \| 'icon-lg' \| 'icon-xl'`; `loading?: boolean`. |
|
|
323
323
|
| `unstyled-button` | `UnstyledButton` | Button primitive with reset styles, pointer cursor, accessible focus ring, default `type="button"`, and `asChild`. |
|
|
324
324
|
| `calendar` | `Calendar`, `CalendarDayButton` | Also exports the `DateRange` type. Weekends render with destructive text, week numbers are low-emphasis, and selected single/range endpoints use the `primary` palette with a subtle primary range fill. |
|
|
325
325
|
| `date-range-picker` | `DateRangePicker`, `DateRangePickerTrigger`, `DateRangePickerValue`, `DateRangePickerContent`, `DateRangePickerPresets`, `DateRangePickerPreset`, `DateRangePickerCalendar`, `DateRangePickerDateFields`, `DateRangePickerActions`, `DateRangePickerApply`, `DateRangePickerReset` | Compound popover picker backed by `Calendar` range mode. Draft edits from fixed presets, relative-day inputs, date inputs, and calendar stay in sync until `Apply`; reset/clear emits `null` through `onValueChange`. |
|
|
@@ -327,7 +327,7 @@ You can import from the package root (`@uselets/ui`) or by subpath (`@uselets/ui
|
|
|
327
327
|
| `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. |
|
|
328
328
|
| `code` | `Code` | Inline code primitive rendered as `<code>`. |
|
|
329
329
|
| `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. |
|
|
330
|
-
| `dialog` | `Dialog`, `DialogTrigger`, `DialogPortal`, `DialogClose`, `DialogOverlay`, `DialogContent`, `DialogHeader`, `DialogFooter`, `DialogTitle`, `DialogDescription` | `Dialog` supports `size: 'sm' \| 'md' \| 'lg' \| 'xl' \| '2xl'` (default: `
|
|
330
|
+
| `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`). |
|
|
331
331
|
| `drawer` | `Drawer`, `DrawerTrigger`, `DrawerPortal`, `DrawerClose`, `DrawerOverlay`, `DrawerContent`, `DrawerHeader`, `DrawerBody`, `DrawerFooter`, `DrawerTitle`, `DrawerDescription` | `Drawer` supports `size: 'sm' \| 'md' \| 'lg' \| 'xl'` (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`). Direction (`top/right/bottom/left`) is handled by Vaul root props. |
|
|
332
332
|
| `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. |
|
|
333
333
|
| `dropdown-menu` | `DropdownMenu`, `DropdownMenuTrigger`, `DropdownMenuContent`, `DropdownMenuItem`, `DropdownMenuCheckboxItem`, `DropdownMenuRadioGroup`, `DropdownMenuRadioItem`, `DropdownMenuSub`, `DropdownMenuSubTrigger`, `DropdownMenuSubContent`, `DropdownMenuSeparator`, `DropdownMenuShortcut` | `DropdownMenuContent` supports `side`, `sideOffset`, `align`, `alignOffset`; items support `inset`, and `DropdownMenuItem` supports `variant: 'default' \| 'destructive'`. |
|
|
@@ -338,7 +338,7 @@ You can import from the package root (`@uselets/ui`) or by subpath (`@uselets/ui
|
|
|
338
338
|
| `heading` | `Heading`, `headingVariants` | Heading primitive with `size: 'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` (default: `md`) and `asChild`. |
|
|
339
339
|
| `input` | `Input` | Wrapper for Base UI Input with all native `<input>` props. |
|
|
340
340
|
| `input-otp` | `InputOTP`, `InputOTPGroup`, `InputOTPSlot`, `InputOTPSeparator`, `REGEXP_ONLY_CHARS`, `REGEXP_ONLY_DIGITS`, `REGEXP_ONLY_DIGITS_AND_CHARS` | `InputOTP` supports all `input-otp` props plus `containerClassName`; use `maxLength` and `pattern` for validation. |
|
|
341
|
-
| `mask-input` | `MaskInput` | Formatted input backed by `@react-input/mask`. Accepts `mask` plus optional `replacement`, `showMask`, `separate`, `track`, `modify`. Default replacement tokens: `9` (digit), `a` (letter), `*` (any). The `useMask` hook is also exported from `@uselets/ui/hooks/use-mask` for custom inputs. |
|
|
341
|
+
| `mask-input` | `MaskInput` | Formatted input backed by `@react-input/mask`. Accepts `mask` plus optional `replacement`, `showMask`, `separate`, `track`, `modify`. Default replacement tokens: `9` (digit), `a` (letter), `*` (any). Forwards an external `ref` prop to the underlying `<input>`, composed with the mask ref. The `useMask` hook is also exported from `@uselets/ui/hooks/use-mask` for custom inputs. |
|
|
342
342
|
| `kbd` | `Kbd`, `KbdGroup` | Keyboard shortcut presentation primitives. |
|
|
343
343
|
| `label` | `Label` | Styled `<label>` wrapper. |
|
|
344
344
|
| `list` | `List`, `ListItem`, `ListIcon`, `listVariants` | `List.type: 'unordered' \| 'ordered'`; `size` and `spacing` use the `xs` to `xl` scale; `ListIcon` can use `asChild` and replaces the default marker with a primary-colored icon. |
|
|
@@ -406,7 +406,7 @@ const [draft, setDraft] = useLocalStorage('draft', {
|
|
|
406
406
|
})
|
|
407
407
|
```
|
|
408
408
|
|
|
409
|
-
Utilities are exported from the package root and `@uselets/ui/utils`, including `cn` and `randomId`.
|
|
409
|
+
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`).
|
|
410
410
|
|
|
411
411
|
### Sonner example
|
|
412
412
|
|
|
@@ -4,7 +4,7 @@ import * as React from "react";
|
|
|
4
4
|
|
|
5
5
|
//#region src/components/anchor.d.ts
|
|
6
6
|
declare const anchorVariants: (props?: ({
|
|
7
|
-
size?: "
|
|
7
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
8
8
|
underline?: "always" | "hover" | "never" | "not-hover" | null | undefined;
|
|
9
9
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
10
|
type AnchorProps = React.ComponentProps<'a'> & VariantProps<typeof anchorVariants> & {
|
|
@@ -4,8 +4,8 @@ import * as React from "react";
|
|
|
4
4
|
|
|
5
5
|
//#region src/components/badge.d.ts
|
|
6
6
|
declare const badgeVariants: (props?: ({
|
|
7
|
-
size?: "
|
|
8
|
-
variant?: "
|
|
7
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
8
|
+
variant?: "solid" | "outline" | "subtle" | "ghost" | "link" | null | undefined;
|
|
9
9
|
color?: "primary" | "brand" | "gray" | "zinc" | "red" | "yellow" | "blue" | "indigo" | "pink" | "green" | null | undefined;
|
|
10
10
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
11
11
|
type BadgeProps = React.ComponentProps<'span'> & VariantProps<typeof badgeVariants> & {
|
|
@@ -4,7 +4,7 @@ import { VariantProps } from "class-variance-authority";
|
|
|
4
4
|
|
|
5
5
|
//#region src/components/button-group.d.ts
|
|
6
6
|
declare const buttonGroupVariants: (props?: ({
|
|
7
|
-
orientation?: "
|
|
7
|
+
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
8
8
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
9
|
type ButtonGroupProps = React.ComponentProps<'div'> & VariantProps<typeof buttonGroupVariants>;
|
|
10
10
|
type ButtonGroupTextProps = React.ComponentProps<'div'> & {
|
|
@@ -4,9 +4,9 @@ import * as React from "react";
|
|
|
4
4
|
|
|
5
5
|
//#region src/components/button.d.ts
|
|
6
6
|
declare const buttonVariants: (props?: ({
|
|
7
|
-
variant?: "
|
|
7
|
+
variant?: "solid" | "outline" | "subtle" | "ghost" | "link" | "secondary" | null | undefined;
|
|
8
8
|
color?: "primary" | "brand" | "gray" | "zinc" | "red" | "yellow" | "blue" | "indigo" | "pink" | "green" | null | undefined;
|
|
9
|
-
size?: "
|
|
9
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | "icon-xl" | null | undefined;
|
|
10
10
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
11
11
|
type ButtonProps = React.ComponentProps<'button'> & VariantProps<typeof buttonVariants> & {
|
|
12
12
|
asChild?: boolean;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{buttonColorVariants as t}from"../lib/button.js";import{Spinner as n}from"./spinner.js";import{Slot as r}from"radix-ui";import{Fragment as i,jsx as a,jsxs as o}from"react/jsx-runtime";import{cva as s}from"class-variance-authority";const c=s(`focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 relative rounded-full border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-3 aria-invalid:ring-3 [&_svg:not([class*='size-'])]:size-4 inline-flex items-center justify-center whitespace-nowrap transition-all [&_svg]:transition-colors disabled:pointer-events-none disabled:opacity-50 disabled:data-[loading=true]:pointer-events-auto disabled:data-[loading=true]:cursor-not-allowed disabled:data-[loading=true]:opacity-100 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none`,{variants:{variant:{solid:`bg-(--button-solid) text-(--button-solid-foreground) hover:bg-(--button-solid-hover) data-[loading=true]:hover:bg-(--button-solid)`,outline:`border-(--button-outline-border) bg-transparent text-(--button-outline-foreground) hover:bg-(--button-solid) hover:text-(--button-solid-foreground) hover:[&_svg]:text-(--button-solid-foreground) data-[loading=true]:hover:bg-background data-[loading=true]:hover:text-(--button-outline-foreground) aria-expanded:bg-(--button-solid) aria-expanded:text-(--button-solid-foreground) aria-expanded:[&_svg]:text-(--button-solid-foreground)`,subtle:`bg-(--button-soft) text-(--button-soft-foreground) hover:bg-(--button-soft-hover) hover:text-(--button-soft-foreground) data-[loading=true]:hover:bg-(--button-soft) data-[loading=true]:hover:text-(--button-soft-foreground) aria-expanded:bg-(--button-soft-hover) aria-expanded:text-(--button-soft-foreground)`,ghost:`text-(--button-ghost-foreground) hover:bg-(--button-ghost-hover) hover:text-(--button-ghost-foreground) data-[loading=true]:hover:bg-transparent data-[loading=true]:hover:text-(--button-ghost-foreground) aria-expanded:bg-(--button-ghost-hover) aria-expanded:text-(--button-ghost-foreground)`,link:`text-(--button-link-foreground) underline-offset-4 hover:underline data-[loading=true]:hover:no-underline`},color:t,size:{xs:`h-7 gap-1 px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-8 gap-1 px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,md:`h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,lg:`h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3`,xl:`h-11 gap-2 px-3 has-data-[icon=inline-end]:pr-4 has-data-[icon=inline-start]:pl-4`,icon:`size-9`,"icon-xs":`size-7 in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-8 in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-10`,"icon-xl":`size-11`}},defaultVariants:{variant:`solid`,color:`primary`,size:`md`}});function Button({children:t,className:s,variant:l=`solid`,color:u=`primary`,size:d=`md`,asChild:f=!1,disabled:p,loading:m=!1,...h}){return a(f?r.Root:`button`,{type:f?void 0:`button`,"data-slot":`button`,"data-variant":l,"data-color":u,"data-size":d,"data-loading":m,"aria-busy":m?!0:void 0,disabled:p||m,className:e(c({variant:l,color:u,size:d,className:s})),...h,children:m&&!f?o(i,{children:[a(`span`,{className:`invisible inline-flex items-center gap-[inherit]`,children:t}),a(`span`,{className:`absolute inset-0 inline-flex items-center justify-center`,children:a(n,{})})]}):m?a(n,{}):t})}export{Button,c as buttonVariants};
|
|
1
|
+
import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{buttonColorVariants as t}from"../lib/button.js";import{Spinner as n}from"./spinner.js";import{Slot as r}from"radix-ui";import{Fragment as i,jsx as a,jsxs as o}from"react/jsx-runtime";import{cva as s}from"class-variance-authority";const c=s(`focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 relative rounded-full border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-3 aria-invalid:ring-3 [&_svg:not([class*='size-'])]:size-4 inline-flex items-center justify-center whitespace-nowrap transition-all [&_svg]:transition-colors disabled:pointer-events-none disabled:opacity-50 disabled:data-[loading=true]:pointer-events-auto disabled:data-[loading=true]:cursor-not-allowed disabled:data-[loading=true]:opacity-100 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none`,{variants:{variant:{solid:`bg-(--button-solid) text-(--button-solid-foreground) hover:bg-(--button-solid-hover) data-[loading=true]:hover:bg-(--button-solid)`,secondary:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,outline:`border-(--button-outline-border) bg-transparent text-(--button-outline-foreground) hover:bg-(--button-solid) hover:text-(--button-solid-foreground) hover:[&_svg]:text-(--button-solid-foreground) data-[loading=true]:hover:bg-background data-[loading=true]:hover:text-(--button-outline-foreground) aria-expanded:bg-(--button-solid) aria-expanded:text-(--button-solid-foreground) aria-expanded:[&_svg]:text-(--button-solid-foreground)`,subtle:`bg-(--button-soft) text-(--button-soft-foreground) hover:bg-(--button-soft-hover) hover:text-(--button-soft-foreground) data-[loading=true]:hover:bg-(--button-soft) data-[loading=true]:hover:text-(--button-soft-foreground) aria-expanded:bg-(--button-soft-hover) aria-expanded:text-(--button-soft-foreground)`,ghost:`text-(--button-ghost-foreground) hover:bg-(--button-ghost-hover) hover:text-(--button-ghost-foreground) data-[loading=true]:hover:bg-transparent data-[loading=true]:hover:text-(--button-ghost-foreground) aria-expanded:bg-(--button-ghost-hover) aria-expanded:text-(--button-ghost-foreground)`,link:`text-(--button-link-foreground) underline-offset-4 hover:underline data-[loading=true]:hover:no-underline`},color:t,size:{xs:`h-7 gap-1 px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-8 gap-1 px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,md:`h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,lg:`h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3`,xl:`h-11 gap-2 px-3 has-data-[icon=inline-end]:pr-4 has-data-[icon=inline-start]:pl-4`,icon:`size-9`,"icon-xs":`size-7 in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-8 in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-10`,"icon-xl":`size-11`}},defaultVariants:{variant:`solid`,color:`primary`,size:`md`}});function Button({children:t,className:s,variant:l=`solid`,color:u=`primary`,size:d=`md`,asChild:f=!1,disabled:p,loading:m=!1,...h}){return a(f?r.Root:`button`,{type:f?void 0:`button`,"data-slot":`button`,"data-variant":l,"data-color":u,"data-size":d,"data-loading":m,"aria-busy":m?!0:void 0,disabled:p||m,className:e(c({variant:l,color:u,size:d,className:s})),...h,children:m&&!f?o(i,{children:[a(`span`,{className:`invisible inline-flex items-center gap-[inherit]`,children:t}),a(`span`,{className:`absolute inset-0 inline-flex items-center justify-center`,children:a(n,{})})]}):m?a(n,{}):t})}export{Button,c as buttonVariants};
|
|
2
2
|
//# sourceMappingURL=button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","names":[],"sources":["../../src/components/button.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { Slot } from 'radix-ui'\n\nimport { buttonColorVariants } from '../lib/button'\nimport { cn } from '../lib/utils'\nimport { Spinner } from './spinner'\n\nconst buttonVariants = cva(\n \"focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 relative rounded-full border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-3 aria-invalid:ring-3 [&_svg:not([class*='size-'])]:size-4 inline-flex items-center justify-center whitespace-nowrap transition-all [&_svg]:transition-colors disabled:pointer-events-none disabled:opacity-50 disabled:data-[loading=true]:pointer-events-auto disabled:data-[loading=true]:cursor-not-allowed disabled:data-[loading=true]:opacity-100 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none\",\n {\n variants: {\n variant: {\n solid:\n 'bg-(--button-solid) text-(--button-solid-foreground) hover:bg-(--button-solid-hover) data-[loading=true]:hover:bg-(--button-solid)',\n outline:\n 'border-(--button-outline-border) bg-transparent text-(--button-outline-foreground) hover:bg-(--button-solid) hover:text-(--button-solid-foreground) hover:[&_svg]:text-(--button-solid-foreground) data-[loading=true]:hover:bg-background data-[loading=true]:hover:text-(--button-outline-foreground) aria-expanded:bg-(--button-solid) aria-expanded:text-(--button-solid-foreground) aria-expanded:[&_svg]:text-(--button-solid-foreground)',\n subtle:\n 'bg-(--button-soft) text-(--button-soft-foreground) hover:bg-(--button-soft-hover) hover:text-(--button-soft-foreground) data-[loading=true]:hover:bg-(--button-soft) data-[loading=true]:hover:text-(--button-soft-foreground) aria-expanded:bg-(--button-soft-hover) aria-expanded:text-(--button-soft-foreground)',\n ghost:\n 'text-(--button-ghost-foreground) hover:bg-(--button-ghost-hover) hover:text-(--button-ghost-foreground) data-[loading=true]:hover:bg-transparent data-[loading=true]:hover:text-(--button-ghost-foreground) aria-expanded:bg-(--button-ghost-hover) aria-expanded:text-(--button-ghost-foreground)',\n link: 'text-(--button-link-foreground) underline-offset-4 hover:underline data-[loading=true]:hover:no-underline'\n },\n color: buttonColorVariants,\n size: {\n xs: \"h-7 gap-1 px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3\",\n sm: \"h-8 gap-1 px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5\",\n md: 'h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',\n lg: 'h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3',\n xl: 'h-11 gap-2 px-3 has-data-[icon=inline-end]:pr-4 has-data-[icon=inline-start]:pl-4',\n icon: 'size-9',\n 'icon-xs': \"size-7 in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3\",\n 'icon-sm': 'size-8 in-data-[slot=button-group]:rounded-lg',\n 'icon-lg': 'size-10',\n 'icon-xl': 'size-11'\n }\n },\n defaultVariants: {\n variant: 'solid',\n color: 'primary',\n size: 'md'\n }\n }\n)\n\nexport type ButtonProps = React.ComponentProps<'button'> &\n VariantProps<typeof buttonVariants> & {\n asChild?: boolean\n loading?: boolean\n }\n\nfunction Button({\n children,\n className,\n variant = 'solid',\n color = 'primary',\n size = 'md',\n asChild = false,\n disabled,\n loading = false,\n ...props\n}: ButtonProps) {\n const Comp = asChild ? Slot.Root : 'button'\n const isDisabled = disabled || loading\n\n return (\n <Comp\n type={!asChild ? 'button' : undefined}\n data-slot=\"button\"\n data-variant={variant}\n data-color={color}\n data-size={size}\n data-loading={loading}\n aria-busy={loading ? true : undefined}\n disabled={isDisabled}\n className={cn(buttonVariants({ variant, color, size, className }))}\n {...props}\n >\n {loading && !asChild ? (\n <>\n <span className=\"invisible inline-flex items-center gap-[inherit]\">{children}</span>\n <span className=\"absolute inset-0 inline-flex items-center justify-center\">\n <Spinner />\n </span>\n </>\n ) : loading ? (\n <Spinner />\n ) : (\n children\n )}\n </Comp>\n )\n}\n\nexport { Button, buttonVariants }\n"],"mappings":"+SASA,MAAM,EAAiB,EACrB,kuBACA,CACE,SAAU,CACR,QAAS,CACP,MACE,qIACF,QACE,kbACF,OACE,sTACF,MACE,qSACF,KAAM,2GACR,EACA,MAAO,EACP,KAAM,CACJ,GAAI,2KACJ,GAAI,qLACJ,GAAI,8HACJ,GAAI,wFACJ,GAAI,oFACJ,KAAM,SACN,UAAW,qFACX,UAAW,gDACX,UAAW,UACX,UAAW,SACb,CACF,EACA,gBAAiB,CACf,QAAS,QACT,MAAO,UACP,KAAM,IACR,CACF,CACF,EAQA,SAAS,OAAO,CACd,WACA,YACA,UAAU,QACV,QAAQ,UACR,OAAO,KACP,UAAU,GACV,WACA,UAAU,GACV,GAAG,GACW,CAId,OACE,EAJW,EAAU,EAAK,KAAO,SAIjC,CACE,KAAO,EAAqB,IAAA,GAAX,SACjB,YAAU,SACV,eAAc,EACd,aAAY,EACZ,YAAW,EACX,eAAc,EACd,YAAW,EAAU,GAAO,IAAA,GAC5B,SAXe,GAAY,EAY3B,UAAW,EAAG,EAAe,CAAE,UAAS,QAAO,OAAM,WAAU,CAAC,CAAC,EACjE,GAAI,WAEH,GAAW,CAAC,EACX,EAAA,EAAA,CAAA,SAAA,CACE,EAAC,OAAD,CAAM,UAAU,mDAAoD,UAAe,CAAA,EACnF,EAAC,OAAD,CAAM,UAAU,oEACd,EAAC,EAAD,CAAU,CAAA,CACN,CAAA,CACN,CAAA,CAAA,EACA,EACF,EAAC,EAAD,CAAU,CAAA,EAEV,CAEE,CAAA,CAEV"}
|
|
1
|
+
{"version":3,"file":"button.js","names":[],"sources":["../../src/components/button.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { Slot } from 'radix-ui'\n\nimport { buttonColorVariants } from '../lib/button'\nimport { cn } from '../lib/utils'\nimport { Spinner } from './spinner'\n\nconst buttonVariants = cva(\n \"focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 relative rounded-full border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-3 aria-invalid:ring-3 [&_svg:not([class*='size-'])]:size-4 inline-flex items-center justify-center whitespace-nowrap transition-all [&_svg]:transition-colors disabled:pointer-events-none disabled:opacity-50 disabled:data-[loading=true]:pointer-events-auto disabled:data-[loading=true]:cursor-not-allowed disabled:data-[loading=true]:opacity-100 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none\",\n {\n variants: {\n variant: {\n solid:\n 'bg-(--button-solid) text-(--button-solid-foreground) hover:bg-(--button-solid-hover) data-[loading=true]:hover:bg-(--button-solid)',\n secondary:\n 'border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50',\n outline:\n 'border-(--button-outline-border) bg-transparent text-(--button-outline-foreground) hover:bg-(--button-solid) hover:text-(--button-solid-foreground) hover:[&_svg]:text-(--button-solid-foreground) data-[loading=true]:hover:bg-background data-[loading=true]:hover:text-(--button-outline-foreground) aria-expanded:bg-(--button-solid) aria-expanded:text-(--button-solid-foreground) aria-expanded:[&_svg]:text-(--button-solid-foreground)',\n subtle:\n 'bg-(--button-soft) text-(--button-soft-foreground) hover:bg-(--button-soft-hover) hover:text-(--button-soft-foreground) data-[loading=true]:hover:bg-(--button-soft) data-[loading=true]:hover:text-(--button-soft-foreground) aria-expanded:bg-(--button-soft-hover) aria-expanded:text-(--button-soft-foreground)',\n ghost:\n 'text-(--button-ghost-foreground) hover:bg-(--button-ghost-hover) hover:text-(--button-ghost-foreground) data-[loading=true]:hover:bg-transparent data-[loading=true]:hover:text-(--button-ghost-foreground) aria-expanded:bg-(--button-ghost-hover) aria-expanded:text-(--button-ghost-foreground)',\n link: 'text-(--button-link-foreground) underline-offset-4 hover:underline data-[loading=true]:hover:no-underline'\n },\n color: buttonColorVariants,\n size: {\n xs: \"h-7 gap-1 px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3\",\n sm: \"h-8 gap-1 px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5\",\n md: 'h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',\n lg: 'h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3',\n xl: 'h-11 gap-2 px-3 has-data-[icon=inline-end]:pr-4 has-data-[icon=inline-start]:pl-4',\n icon: 'size-9',\n 'icon-xs': \"size-7 in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3\",\n 'icon-sm': 'size-8 in-data-[slot=button-group]:rounded-lg',\n 'icon-lg': 'size-10',\n 'icon-xl': 'size-11'\n }\n },\n defaultVariants: {\n variant: 'solid',\n color: 'primary',\n size: 'md'\n }\n }\n)\n\nexport type ButtonProps = React.ComponentProps<'button'> &\n VariantProps<typeof buttonVariants> & {\n asChild?: boolean\n loading?: boolean\n }\n\nfunction Button({\n children,\n className,\n variant = 'solid',\n color = 'primary',\n size = 'md',\n asChild = false,\n disabled,\n loading = false,\n ...props\n}: ButtonProps) {\n const Comp = asChild ? Slot.Root : 'button'\n const isDisabled = disabled || loading\n\n return (\n <Comp\n type={!asChild ? 'button' : undefined}\n data-slot=\"button\"\n data-variant={variant}\n data-color={color}\n data-size={size}\n data-loading={loading}\n aria-busy={loading ? true : undefined}\n disabled={isDisabled}\n className={cn(buttonVariants({ variant, color, size, className }))}\n {...props}\n >\n {loading && !asChild ? (\n <>\n <span className=\"invisible inline-flex items-center gap-[inherit]\">{children}</span>\n <span className=\"absolute inset-0 inline-flex items-center justify-center\">\n <Spinner />\n </span>\n </>\n ) : loading ? (\n <Spinner />\n ) : (\n children\n )}\n </Comp>\n )\n}\n\nexport { Button, buttonVariants }\n"],"mappings":"+SASA,MAAM,EAAiB,EACrB,kuBACA,CACE,SAAU,CACR,QAAS,CACP,MACE,qIACF,UACE,kLACF,QACE,kbACF,OACE,sTACF,MACE,qSACF,KAAM,2GACR,EACA,MAAO,EACP,KAAM,CACJ,GAAI,2KACJ,GAAI,qLACJ,GAAI,8HACJ,GAAI,wFACJ,GAAI,oFACJ,KAAM,SACN,UAAW,qFACX,UAAW,gDACX,UAAW,UACX,UAAW,SACb,CACF,EACA,gBAAiB,CACf,QAAS,QACT,MAAO,UACP,KAAM,IACR,CACF,CACF,EAQA,SAAS,OAAO,CACd,WACA,YACA,UAAU,QACV,QAAQ,UACR,OAAO,KACP,UAAU,GACV,WACA,UAAU,GACV,GAAG,GACW,CAId,OACE,EAJW,EAAU,EAAK,KAAO,SAIjC,CACE,KAAO,EAAqB,IAAA,GAAX,SACjB,YAAU,SACV,eAAc,EACd,aAAY,EACZ,YAAW,EACX,eAAc,EACd,YAAW,EAAU,GAAO,IAAA,GAC5B,SAXe,GAAY,EAY3B,UAAW,EAAG,EAAe,CAAE,UAAS,QAAO,OAAM,WAAU,CAAC,CAAC,EACjE,GAAI,WAEH,GAAW,CAAC,EACX,EAAA,EAAA,CAAA,SAAA,CACE,EAAC,OAAD,CAAM,UAAU,mDAAoD,UAAe,CAAA,EACnF,EAAC,OAAD,CAAM,UAAU,oEACd,EAAC,EAAD,CAAU,CAAA,CACN,CAAA,CACN,CAAA,CAAA,EACA,EACF,EAAC,EAAD,CAAU,CAAA,EAEV,CAEE,CAAA,CAEV"}
|
|
@@ -4,8 +4,8 @@ import * as React from "react";
|
|
|
4
4
|
|
|
5
5
|
//#region src/components/center.d.ts
|
|
6
6
|
declare const centerVariants: (props?: ({
|
|
7
|
-
direction?: "
|
|
8
|
-
size?: "
|
|
7
|
+
direction?: "horizontal" | "vertical" | null | undefined;
|
|
8
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
9
9
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
10
|
type CenterProps = React.ComponentProps<'div'> & VariantProps<typeof centerVariants>;
|
|
11
11
|
declare function Center({
|
|
@@ -5,7 +5,7 @@ import * as React from "react";
|
|
|
5
5
|
|
|
6
6
|
//#region src/components/dialog.d.ts
|
|
7
7
|
declare const dialogContentVariants: (props?: ({
|
|
8
|
-
size?: "sm" | "md" | "lg" | "xl" | "2xl" | null | undefined;
|
|
8
|
+
size?: "sm" | "md" | "lg" | "xl" | "full" | "2xl" | "3xl" | null | undefined;
|
|
9
9
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
10
|
type DialogSize = NonNullable<VariantProps<typeof dialogContentVariants>['size']>;
|
|
11
11
|
type DialogProps = React.ComponentProps<typeof Dialog$1.Root> & {
|
|
@@ -20,6 +20,7 @@ type DialogContentProps = React.ComponentProps<typeof Dialog$1.Content> & {
|
|
|
20
20
|
overlayRef?: React.Ref<HTMLDivElement>;
|
|
21
21
|
};
|
|
22
22
|
type DialogHeaderProps = React.ComponentProps<'div'>;
|
|
23
|
+
type DialogBodyProps = React.ComponentProps<'div'>;
|
|
23
24
|
type DialogFooterProps = React.ComponentProps<'div'> & {
|
|
24
25
|
showCloseButton?: boolean;
|
|
25
26
|
};
|
|
@@ -53,6 +54,10 @@ declare function DialogHeader({
|
|
|
53
54
|
className,
|
|
54
55
|
...props
|
|
55
56
|
}: DialogHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
57
|
+
declare function DialogBody({
|
|
58
|
+
className,
|
|
59
|
+
...props
|
|
60
|
+
}: DialogBodyProps): import("react/jsx-runtime").JSX.Element;
|
|
56
61
|
declare function DialogFooter({
|
|
57
62
|
className,
|
|
58
63
|
showCloseButton,
|
|
@@ -68,5 +73,5 @@ declare function DialogDescription({
|
|
|
68
73
|
...props
|
|
69
74
|
}: DialogDescriptionProps): import("react/jsx-runtime").JSX.Element;
|
|
70
75
|
//#endregion
|
|
71
|
-
export { Dialog, DialogClose, DialogCloseProps, DialogContent, DialogContentProps, DialogDescription, DialogDescriptionProps, DialogFooter, DialogFooterProps, DialogHeader, DialogHeaderProps, DialogOverlay, DialogOverlayProps, DialogPortal, DialogPortalProps, DialogProps, DialogTitle, DialogTitleProps, DialogTrigger, DialogTriggerProps };
|
|
76
|
+
export { Dialog, DialogBody, DialogBodyProps, DialogClose, DialogCloseProps, DialogContent, DialogContentProps, DialogDescription, DialogDescriptionProps, DialogFooter, DialogFooterProps, DialogHeader, DialogHeaderProps, DialogOverlay, DialogOverlayProps, DialogPortal, DialogPortalProps, DialogProps, DialogTitle, DialogTitleProps, DialogTrigger, DialogTriggerProps };
|
|
72
77
|
//# sourceMappingURL=dialog.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{Button as t}from"./button.js";import{IconX as n}from"@tabler/icons-react";import{Dialog as r}from"radix-ui";import{jsx as i,jsxs as a}from"react/jsx-runtime";import{cva as o}from"class-variance-authority";import*as s from"react";const c=o(`bg-background
|
|
1
|
+
import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{Button as t}from"./button.js";import{IconX as n}from"@tabler/icons-react";import{Dialog as r}from"radix-ui";import{jsx as i,jsxs as a}from"react/jsx-runtime";import{cva as o}from"class-variance-authority";import*as s from"react";const c=o([`bg-background ring-foreground/10 fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 outline-none`,`flex flex-col gap-4 rounded-xl p-4 text-sm ring-1 duration-100`,`max-w-[calc(100%-2rem)] max-h-[calc(100dvh-2rem)] overflow-hidden`,`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95`],{variants:{size:{sm:`sm:max-w-sm`,md:`sm:max-w-md`,lg:`sm:max-w-lg`,xl:`sm:max-w-xl`,"2xl":`sm:max-w-2xl`,"3xl":`sm:max-w-3xl`,full:`w-screen h-screen max-w-none max-h-screen rounded-none sm:max-w-none`}},defaultVariants:{size:`md`}}),l=s.createContext({size:`sm`});function Dialog({size:e=`sm`,...t}){let n=s.useMemo(()=>({size:e}),[e]);return i(l.Provider,{value:n,children:i(r.Root,{"data-slot":`dialog`,...t})})}function DialogTrigger({...e}){return i(r.Trigger,{"data-slot":`dialog-trigger`,...e})}function DialogPortal({...e}){return i(r.Portal,{"data-slot":`dialog-portal`,...e})}function DialogClose({...e}){return i(r.Close,{"data-slot":`dialog-close`,...e})}function DialogOverlay({className:t,...n}){return i(r.Overlay,{"data-slot":`dialog-overlay`,className:e(`bg-black/10 fixed inset-0 isolate z-50`,`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0`,`duration-100 supports-backdrop-filter:backdrop-blur-xs`,t),...n})}function DialogContent({className:o,children:u,showCloseButton:d=!0,overlayRef:f,...p}){let{size:m}=s.useContext(l);return a(DialogPortal,{children:[i(DialogOverlay,{ref:f}),a(r.Content,{"data-slot":`dialog-content`,className:e(c({size:m}),o),...p,children:[u,d&&i(r.Close,{"data-slot":`dialog-close`,asChild:!0,children:a(t,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`,children:[i(n,{}),i(`span`,{className:`sr-only`,children:`Close`})]})})]})]})}function DialogHeader({className:t,...n}){return i(`div`,{"data-slot":`dialog-header`,className:e(`gap-2 flex flex-col shrink-0`,t),...n})}function DialogBody({className:t,...n}){return i(`div`,{"data-slot":`dialog-body`,className:e(`-mx-4 px-4 flex-1 overflow-y-auto`,t),...n})}function DialogFooter({className:n,showCloseButton:o=!1,children:s,...c}){return a(`div`,{"data-slot":`dialog-footer`,className:e(`bg-muted/50 -mx-4 -mb-4 rounded-b-xl border-t p-4 shrink-0`,`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,n),...c,children:[s,o&&i(r.Close,{asChild:!0,children:i(t,{variant:`outline`,children:`Close`})})]})}function DialogTitle({className:t,...n}){return i(r.Title,{"data-slot":`dialog-title`,className:e(`text-base leading-none font-medium`,t),...n})}function DialogDescription({className:t,...n}){return i(r.Description,{"data-slot":`dialog-description`,className:e(`text-muted-foreground text-sm`,`*:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,t),...n})}export{Dialog,DialogBody,DialogClose,DialogContent,DialogDescription,DialogFooter,DialogHeader,DialogOverlay,DialogPortal,DialogTitle,DialogTrigger};
|
|
2
2
|
//# sourceMappingURL=dialog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.js","names":["DialogPrimitive"],"sources":["../../src/components/dialog.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { IconX } from '@tabler/icons-react'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { Dialog as DialogPrimitive } from 'radix-ui'\n\nimport { cn } from '../lib/utils'\nimport { Button } from './button'\n\nconst dialogContentVariants = cva(\n 'bg-background
|
|
1
|
+
{"version":3,"file":"dialog.js","names":["DialogPrimitive"],"sources":["../../src/components/dialog.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { IconX } from '@tabler/icons-react'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { Dialog as DialogPrimitive } from 'radix-ui'\n\nimport { cn } from '../lib/utils'\nimport { Button } from './button'\n\nconst dialogContentVariants = cva(\n [\n 'bg-background ring-foreground/10 fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 outline-none',\n 'flex flex-col gap-4 rounded-xl p-4 text-sm ring-1 duration-100',\n 'max-w-[calc(100%-2rem)] max-h-[calc(100dvh-2rem)] overflow-hidden',\n 'data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95'\n ],\n {\n variants: {\n size: {\n sm: 'sm:max-w-sm',\n md: 'sm:max-w-md',\n lg: 'sm:max-w-lg',\n xl: 'sm:max-w-xl',\n '2xl': 'sm:max-w-2xl',\n '3xl': 'sm:max-w-3xl',\n full: 'w-screen h-screen max-w-none max-h-screen rounded-none sm:max-w-none'\n }\n },\n defaultVariants: {\n size: 'md'\n }\n }\n)\n\ntype DialogSize = NonNullable<VariantProps<typeof dialogContentVariants>['size']>\ntype DialogSizeContextValue = { size: DialogSize }\nconst DialogSizeContext = React.createContext<DialogSizeContextValue>({ size: 'sm' })\n\nexport type DialogProps = React.ComponentProps<typeof DialogPrimitive.Root> & { size?: DialogSize }\nexport type DialogTriggerProps = React.ComponentProps<typeof DialogPrimitive.Trigger>\nexport type DialogPortalProps = React.ComponentProps<typeof DialogPrimitive.Portal>\nexport type DialogCloseProps = React.ComponentProps<typeof DialogPrimitive.Close>\nexport type DialogOverlayProps = React.ComponentProps<typeof DialogPrimitive.Overlay>\nexport type DialogContentProps = React.ComponentProps<typeof DialogPrimitive.Content> & {\n showCloseButton?: boolean\n overlayRef?: React.Ref<HTMLDivElement>\n}\nexport type DialogHeaderProps = React.ComponentProps<'div'>\nexport type DialogBodyProps = React.ComponentProps<'div'>\nexport type DialogFooterProps = React.ComponentProps<'div'> & { showCloseButton?: boolean }\nexport type DialogTitleProps = React.ComponentProps<typeof DialogPrimitive.Title>\nexport type DialogDescriptionProps = React.ComponentProps<typeof DialogPrimitive.Description>\n\nfunction Dialog({ size = 'sm', ...props }: DialogProps) {\n const contextValue = React.useMemo<DialogSizeContextValue>(() => ({ size }), [size])\n\n return (\n <DialogSizeContext.Provider value={contextValue}>\n <DialogPrimitive.Root data-slot=\"dialog\" {...props} />\n </DialogSizeContext.Provider>\n )\n}\n\nfunction DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />\n}\n\nfunction DialogPortal({ ...props }: DialogPortalProps) {\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />\n}\n\nfunction DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />\n}\n\nfunction DialogOverlay({ className, ...props }: DialogOverlayProps) {\n return (\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n className={cn(\n 'bg-black/10 fixed inset-0 isolate z-50',\n 'data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0',\n 'duration-100 supports-backdrop-filter:backdrop-blur-xs',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DialogContent({ className, children, showCloseButton = true, overlayRef, ...props }: DialogContentProps) {\n const { size } = React.useContext(DialogSizeContext)\n\n return (\n <DialogPortal>\n <DialogOverlay ref={overlayRef} />\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n className={cn(dialogContentVariants({ size }), className)}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close data-slot=\"dialog-close\" asChild>\n <Button variant=\"ghost\" className=\"absolute top-2 right-2\" size=\"icon-sm\">\n <IconX />\n <span className=\"sr-only\">Close</span>\n </Button>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </DialogPortal>\n )\n}\n\nfunction DialogHeader({ className, ...props }: DialogHeaderProps) {\n return <div data-slot=\"dialog-header\" className={cn('gap-2 flex flex-col shrink-0', className)} {...props} />\n}\n\nfunction DialogBody({ className, ...props }: DialogBodyProps) {\n return <div data-slot=\"dialog-body\" className={cn('-mx-4 px-4 flex-1 overflow-y-auto', className)} {...props} />\n}\n\nfunction DialogFooter({ className, showCloseButton = false, children, ...props }: DialogFooterProps) {\n return (\n <div\n data-slot=\"dialog-footer\"\n className={cn(\n 'bg-muted/50 -mx-4 -mb-4 rounded-b-xl border-t p-4 shrink-0',\n 'flex flex-col-reverse gap-2 sm:flex-row sm:justify-end',\n className\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close asChild>\n <Button variant=\"outline\">Close</Button>\n </DialogPrimitive.Close>\n )}\n </div>\n )\n}\n\nfunction DialogTitle({ className, ...props }: DialogTitleProps) {\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn('text-base leading-none font-medium', className)}\n {...props}\n />\n )\n}\n\nfunction DialogDescription({ className, ...props }: DialogDescriptionProps) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn(\n 'text-muted-foreground text-sm',\n '*:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground',\n className\n )}\n {...props}\n />\n )\n}\n\nexport {\n Dialog,\n DialogBody,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger\n}\n"],"mappings":"8SASA,MAAM,EAAwB,EAC5B,CACE,qHACA,iEACA,oEACA,sIACF,EACA,CACE,SAAU,CACR,KAAM,CACJ,GAAI,cACJ,GAAI,cACJ,GAAI,cACJ,GAAI,cACJ,MAAO,eACP,MAAO,eACP,KAAM,sEACR,CACF,EACA,gBAAiB,CACf,KAAM,IACR,CACF,CACF,EAIM,EAAoB,EAAM,cAAsC,CAAE,KAAM,IAAK,CAAC,EAiBpF,SAAS,OAAO,CAAE,OAAO,KAAM,GAAG,GAAsB,CACtD,IAAM,EAAe,EAAM,aAAuC,CAAE,MAAK,GAAI,CAAC,CAAI,CAAC,EAEnF,OACE,EAAC,EAAkB,SAAnB,CAA4B,MAAO,WACjC,EAACA,EAAgB,KAAjB,CAAsB,YAAU,SAAS,GAAI,CAAQ,CAAA,CAC3B,CAAA,CAEhC,CAEA,SAAS,cAAc,CAAE,GAAG,GAA+D,CACzF,OAAO,EAACA,EAAgB,QAAjB,CAAyB,YAAU,iBAAiB,GAAI,CAAQ,CAAA,CACzE,CAEA,SAAS,aAAa,CAAE,GAAG,GAA4B,CACrD,OAAO,EAACA,EAAgB,OAAjB,CAAwB,YAAU,gBAAgB,GAAI,CAAQ,CAAA,CACvE,CAEA,SAAS,YAAY,CAAE,GAAG,GAA6D,CACrF,OAAO,EAACA,EAAgB,MAAjB,CAAuB,YAAU,eAAe,GAAI,CAAQ,CAAA,CACrE,CAEA,SAAS,cAAc,CAAE,YAAW,GAAG,GAA6B,CAClE,OACE,EAACA,EAAgB,QAAjB,CACE,YAAU,iBACV,UAAW,EACT,yCACA,0FACA,yDACA,CACF,EACA,GAAI,CACL,CAAA,CAEL,CAEA,SAAS,cAAc,CAAE,YAAW,WAAU,kBAAkB,GAAM,aAAY,GAAG,GAA6B,CAChH,GAAM,CAAE,QAAS,EAAM,WAAW,CAAiB,EAEnD,OAC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U,qBACV,UAAW,EACT,gCACA,uEACA,CACF,EACA,GAAI,CACL,CAAA,CAEL"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{Button as t}from"./button.js";import{jsx as
|
|
1
|
+
import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{Button as t}from"./button.js";import{composeRefs as n}from"../lib/compose-refs.js";import{jsx as r,jsxs as i}from"react/jsx-runtime";import*as a from"react";import{ErrorCode as o,useDropzone as s}from"react-dropzone";const c=[o.FileInvalidType,o.FileTooLarge,o.FileTooSmall,o.TooManyFiles],l=new Set(c),u={pending:`indeterminate`,success:`100%`,error:`error`},d=a.createContext(null),f=a.createContext(null);function fileStatusReducer(e,t){switch(t.type){case`add`:return[...e,{id:t.id,fileName:t.fileName,file:t.file,status:`pending`,tries:1}];case`remove`:return e.filter(e=>e.id!==t.id);case`update-status`:return e.map(e=>e.id===t.id?t.status===`pending`?{...e,status:`pending`,error:void 0,message:void 0,result:void 0,tries:e.tries+1}:t.status===`error`?{...e,status:`error`,error:t.error,message:t.message,result:void 0}:{...e,status:`success`,result:t.result,error:void 0,message:void 0}:e)}}function formatAcceptedTypes(e){if(!e)return;let t=Object.entries(e).flatMap(([e,t])=>t.length>0?t:[e]);return t.length>0?t.join(`, `):void 0}function getDropzoneErrorCodes(e){let t=e.flatMap(e=>e.errors.map(e=>e.code).filter(e=>l.has(e)));return Array.from(new Set(t))}function getRootError(e,t){let n=e.flatMap(e=>{switch(e){case`file-invalid-type`:{let e=formatAcceptedTypes(t.accept);return e?[`only ${e} files are allowed`]:[`this file type is not allowed`]}case`file-too-large`:return t.maxSize?[`max size is ${(t.maxSize/(1024*1024)).toFixed(2)} MB`]:[`this file is too large`];case`file-too-small`:return t.minSize?[`min size is ${(t.minSize/(1024*1024)).toFixed(2)} MB`]:[`this file is too small`];case`too-many-files`:return t.maxFiles?[`max ${t.maxFiles} files`]:[`too many files`];default:return[]}});if(n.length===0)return`Unable to add the selected files`;let[r,...i]=n;return`${r.charAt(0).toUpperCase()}${r.slice(1)}${i.length>0?`, ${i.join(`, `)}`:``}`}function getRejectionMessage(e,t){let n=getDropzoneErrorCodes(e);return n.length>0?getRootError(n,t):e[0]?.errors[0]?.message??`Unable to add the selected files`}function getUploadErrorMessage(e,t){if(t){let n=t(e);if(n!==void 0)return n}if(typeof e==`string`)return e;if(e instanceof Error)return e.message}function useDropzoneContext(){let e=a.useContext(d);if(!e)throw Error(`Dropzone components must be used within a Dropzone.`);return e}function useDropzoneFileListContext(){let e=a.useContext(f);if(!e)throw Error(`Dropzone file actions must be used within a DropzoneFileListItem.`);return e}function useDropzone(e){let{onDropFile:t,onRemoveFile:n,shapeUploadError:r,onFileUploaded:i,onFileUploadError:c,onAllUploaded:l,onRootError:u,maxRetryCount:d,autoRetry:f=!1,validation:p,shiftOnMaxFiles:m=!1}=e,h=a.useId(),g=`${h}-message`,_=`${h}-description`,[v,y]=a.useState(void 0),b=a.useCallback(e=>{y(e),u?.(e)},[u]),[x,S]=a.useReducer(fileStatusReducer,[]),C=a.useCallback(e=>`${h}-${e}-message`,[h]),w=a.useMemo(()=>v!==void 0||x.some(e=>e.status===`error`),[x,v]),T=a.useCallback(async(e,n,a=0)=>{try{let o=await t(e);if(o.status===`error`){if(f&&a<(d??1/0))return S({type:`update-status`,id:n,status:`pending`}),T(e,n,a+1);S({type:`update-status`,id:n,status:`error`,error:o.error,message:getUploadErrorMessage(o.error,r)}),c?.(o.error);return}S({type:`update-status`,id:n,status:`success`,result:o.result}),i?.(o.result)}catch(e){let t=e;S({type:`update-status`,id:n,status:`error`,error:t,message:getUploadErrorMessage(t,r)}),c?.(t)}},[f,t,d,c,i,r]),E=a.useCallback(async e=>{await n?.(e),S({type:`remove`,id:e})},[n]),D=a.useCallback(e=>{let t=x.find(t=>t.id===e);return t?.status===`error`&&t.tries<=(d??1/0)},[x,d]),O=a.useCallback(async e=>{if(!D(e))return;let t=x.find(t=>t.id===e);!t||t.status!==`error`||(S({type:`update-status`,id:e,status:`pending`}),await T(t.file,e))},[D,x,T]),k=s({accept:p?.accept,minSize:p?.minSize,maxSize:p?.maxSize,maxFiles:p?.maxFiles,noClick:!0,noKeyboard:!0,onDropAccepted:async e=>{b(void 0);let t=e,n=p?.maxFiles??1/0,r=Number.isFinite(n)?Math.max(x.length+e.length-n,0):0;if(r>0)if(m){let n=x.slice(0,Math.min(r,x.length));await Promise.all(n.map(e=>E(e.id)));let i=r-n.length;i>0&&(t=e.slice(i))}else{b(getRootError([o.TooManyFiles],p??{}));let r=Math.max(n-x.length,0);t=e.slice(0,r)}t.length!==0&&(await Promise.all(t.map(async e=>{let t=crypto.randomUUID();S({type:`add`,id:t,fileName:e.name,file:e}),await T(e,t)})),l?.())},onDropRejected:e=>{b(getRejectionMessage(e,p??{}))}});return{getRootProps:k.getRootProps,getInputProps:k.getInputProps,open:k.open,onRemoveFile:E,onRetry:O,canRetry:D,fileStatuses:x,isInvalid:w,isDragActive:k.isDragActive,rootError:v,inputId:h,rootMessageId:g,rootDescriptionId:_,getFileMessageId:C}}function Dropzone({children:e,...t}){return r(d.Provider,{value:t,children:e})}const p=a.forwardRef(({className:t,children:a,...o},s)=>{let c=useDropzoneContext(),l=[c.rootDescriptionId,c.isInvalid?c.rootMessageId:void 0].filter(Boolean).join(` `)||void 0,{ref:u,...d}=c.getRootProps({...o,"data-slot":`dropzone-area`,"aria-describedby":l,"aria-invalid":c.isInvalid||void 0,className:e(`flex min-h-44 flex-col items-center justify-center gap-4 rounded-xl border border-dashed border-input bg-muted/20 px-6 py-8 text-center transition-colors`,c.isDragActive&&`border-primary bg-primary/5`,c.isInvalid&&`border-destructive bg-destructive/5`,t)}),f=c.getInputProps({id:c.inputId,className:`sr-only`,"aria-describedby":l,"aria-invalid":c.isInvalid,tabIndex:-1});return i(`div`,{...d,ref:n(s,u),children:[r(`input`,{...f}),a]})}),m=a.forwardRef(({className:t,...n},i)=>r(`p`,{ref:i,id:useDropzoneContext().rootDescriptionId,"data-slot":`dropzone-description`,className:e(`text-sm text-muted-foreground`,t),...n})),h=a.forwardRef(({className:t,...n},i)=>(useDropzoneContext(),r(`ol`,{ref:i,"data-slot":`dropzone-file-list`,className:e(`space-y-3`,t),...n}))),g=a.forwardRef(({className:t,file:n,children:i,...o},s)=>{let c=useDropzoneContext(),l=c.getFileMessageId(n.id),u=n.status===`error`,d=c.canRetry(n.id),p=a.useMemo(()=>({onRemoveFile:()=>c.onRemoveFile(n.id),onRetry:()=>c.onRetry(n.id),fileStatus:n,canRetry:d,dropzoneId:c.inputId,messageId:l}),[d,c,n,l]);return r(f.Provider,{value:p,children:r(`li`,{ref:s,"data-slot":`dropzone-file-item`,"data-status":n.status,"aria-describedby":u?l:void 0,className:e(`rounded-xl border bg-card px-4 py-3 shadow-xs`,n.status===`error`&&`border-destructive/50`,t),...o,children:i})})}),_=a.forwardRef(({className:t,children:n,...i},a)=>{let o=useDropzoneFileListContext(),s=o.fileStatus.status===`error`?o.fileStatus.message??String(o.fileStatus.error):n;return r(`p`,{ref:a,id:o.messageId,"data-slot":`dropzone-file-message`,className:e(`min-h-5 text-[0.8rem] font-medium`,o.fileStatus.status===`error`&&`text-destructive`,t),...i,children:s})}),v=a.forwardRef(({className:t,children:n,...i},a)=>{let o=useDropzoneContext(),s=o.rootError??n;return r(`p`,{ref:a,id:o.rootMessageId,"data-slot":`dropzone-message`,className:e(`min-h-5 text-[0.8rem] font-medium text-destructive`,t),...i,children:s})}),y=a.forwardRef(({className:n,onClick:i,size:o=`icon-sm`,type:s=`button`,variant:c=`ghost`,...l},u)=>{let d=useDropzoneFileListContext(),f=a.useCallback(e=>{i?.(e),!e.defaultPrevented&&d.onRemoveFile()},[d,i]);return r(t,{ref:u,"data-slot":`dropzone-remove-file`,className:e(n),onClick:f,size:o,type:s,variant:c,...l})}),b=a.forwardRef(({className:n,disabled:i,onClick:o,size:s=`icon-sm`,type:c=`button`,variant:l=`ghost`,...u},d)=>{let f=useDropzoneFileListContext(),p=i||!f.canRetry,m=a.useCallback(e=>{o?.(e),!(e.defaultPrevented||p)&&f.onRetry()},[f,p,o]);return r(t,{ref:d,"data-slot":`dropzone-retry-file`,className:e(n),disabled:p,onClick:m,size:s,type:c,variant:l,...u})}),x=a.forwardRef(({className:n,onClick:i,size:o=`sm`,type:s=`button`,variant:c=`subtle`,...l},u)=>{let d=useDropzoneContext(),f=[d.rootDescriptionId,d.isInvalid?d.rootMessageId:void 0].filter(Boolean).join(` `)||void 0,p=a.useCallback(e=>{i?.(e),!e.defaultPrevented&&d.open()},[d,i]);return r(t,{ref:u,"aria-controls":d.inputId,"aria-describedby":f,"aria-invalid":d.isInvalid||void 0,"data-slot":`dropzone-trigger`,className:e(n),onClick:p,size:o,type:s,variant:c,...l})}),S=a.forwardRef(({className:t,status:n,...i},a)=>{let o=n===`success`||n===`error`,s=n===`error`;return r(`div`,{ref:a,"aria-valuemax":100,"aria-valuemin":0,"aria-valuetext":u[n],"data-slot":`dropzone-progress`,"data-status":n,role:`progressbar`,className:e(`relative h-2 w-full overflow-hidden rounded-full bg-muted`,t),...i,children:r(`div`,{className:e(`h-full w-full rounded-full bg-primary transition-transform`,o?`translate-x-0`:`animate-infinite-progress`,s&&`bg-destructive`)})})});Dropzone.displayName=`Dropzone`,p.displayName=`DropzoneArea`,m.displayName=`DropzoneDescription`,h.displayName=`DropzoneFileList`,g.displayName=`DropzoneFileListItem`,_.displayName=`DropzoneFileMessage`,v.displayName=`DropzoneMessage`,y.displayName=`DropzoneRemoveFile`,b.displayName=`DropzoneRetryFile`,x.displayName=`DropzoneTrigger`,S.displayName=`InfiniteProgress`;export{Dropzone,p as DropzoneArea,m as DropzoneDescription,h as DropzoneFileList,g as DropzoneFileListItem,_ as DropzoneFileMessage,v as DropzoneMessage,y as DropzoneRemoveFile,b as DropzoneRetryFile,x as DropzoneTrigger,o as ErrorCode,S as InfiniteProgress,useDropzone};
|
|
2
2
|
//# sourceMappingURL=dropzone.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropzone.js","names":["useReactDropzone"],"sources":["../../src/components/dropzone.tsx"],"sourcesContent":["import * as React from 'react'\nimport {\n type Accept,\n ErrorCode,\n type FileError,\n type FileRejection,\n useDropzone as useReactDropzone\n} from 'react-dropzone'\n\nimport { cn } from '../lib/utils'\nimport { Button, type ButtonProps } from './button'\n\nconst dropzoneErrorCodes = [\n ErrorCode.FileInvalidType,\n ErrorCode.FileTooLarge,\n ErrorCode.FileTooSmall,\n ErrorCode.TooManyFiles\n]\n\ntype DropzoneAction<TUploadResult, TUploadError> =\n | {\n type: 'add'\n id: string\n fileName: string\n file: File\n }\n | {\n type: 'remove'\n id: string\n }\n | {\n type: 'update-status'\n id: string\n status: 'pending'\n }\n | {\n type: 'update-status'\n id: string\n status: 'error'\n error: TUploadError\n message?: string\n }\n | {\n type: 'update-status'\n id: string\n status: 'success'\n result: TUploadResult\n }\n\nexport type DropzoneUploadResult<TUploadResult, TUploadError> =\n | {\n status: 'error'\n error: TUploadError\n }\n | {\n status: 'success'\n result: TUploadResult\n }\n\nexport type DropzoneFileStatus<TUploadResult, TUploadError> = {\n id: string\n fileName: string\n file: File\n tries: number\n} & (\n | {\n status: 'pending'\n error?: undefined\n message?: undefined\n result?: undefined\n }\n | {\n status: 'error'\n error: TUploadError\n message?: string\n result?: undefined\n }\n | {\n status: 'success'\n result: TUploadResult\n error?: undefined\n message?: undefined\n }\n)\n\nexport type FileStatus<TUploadResult, TUploadError> = DropzoneFileStatus<TUploadResult, TUploadError>\n\nexport type DropzoneValidation = {\n accept?: Accept\n minSize?: number\n maxSize?: number\n maxFiles?: number\n}\n\nexport type UseDropzoneProps<TUploadResult, TUploadError = string> = {\n onDropFile: (file: File) => Promise<DropzoneUploadResult<TUploadResult, TUploadError>>\n onRemoveFile?: (id: string) => void | Promise<void>\n onFileUploaded?: (result: TUploadResult) => void\n onFileUploadError?: (error: TUploadError) => void\n onAllUploaded?: () => void\n onRootError?: (error: string | undefined) => void\n shapeUploadError?: (error: TUploadError) => string | undefined\n maxRetryCount?: number\n autoRetry?: boolean\n validation?: DropzoneValidation\n shiftOnMaxFiles?: boolean\n}\n\nexport interface UseDropzoneReturn<TUploadResult, TUploadError> {\n getRootProps: ReturnType<typeof useReactDropzone>['getRootProps']\n getInputProps: ReturnType<typeof useReactDropzone>['getInputProps']\n open: () => void\n onRemoveFile: (id: string) => Promise<void>\n onRetry: (id: string) => Promise<void>\n canRetry: (id: string) => boolean\n fileStatuses: DropzoneFileStatus<TUploadResult, TUploadError>[]\n isInvalid: boolean\n isDragActive: boolean\n rootError: string | undefined\n inputId: string\n rootMessageId: string\n rootDescriptionId: string\n getFileMessageId: (id: string) => string\n}\n\nexport type DropzoneProps<TUploadResult, TUploadError> = React.PropsWithChildren<\n UseDropzoneReturn<TUploadResult, TUploadError>\n>\n\nexport type DropzoneAreaProps = React.ComponentProps<'div'>\n\nexport type DropzoneDescriptionProps = React.ComponentProps<'p'>\n\nexport type DropzoneFileListProps = React.ComponentProps<'ol'>\n\nexport type DropzoneFileListItemProps<TUploadResult, TUploadError> = React.ComponentProps<'li'> & {\n file: DropzoneFileStatus<TUploadResult, TUploadError>\n}\n\nexport type DropzoneFileMessageProps = React.ComponentProps<'p'>\n\nexport type DropzoneMessageProps = React.ComponentProps<'p'>\n\nexport type DropzoneRemoveFileProps = ButtonProps\n\nexport type DropzoneRetryFileProps = ButtonProps\n\nexport type DropzoneTriggerProps = ButtonProps\n\nexport type InfiniteProgressProps = React.ComponentProps<'div'> & {\n status: 'pending' | 'success' | 'error'\n}\n\ntype DropzoneFileListContextValue<TUploadResult, TUploadError> = {\n onRemoveFile: () => Promise<void>\n onRetry: () => Promise<void>\n fileStatus: DropzoneFileStatus<TUploadResult, TUploadError>\n canRetry: boolean\n dropzoneId: string\n messageId: string\n}\n\nconst dropzoneErrorCodeSet = new Set<ErrorCode>(dropzoneErrorCodes)\n\nconst valueTextMap = {\n pending: 'indeterminate',\n success: '100%',\n error: 'error'\n} as const\n\nconst DropzoneContext = React.createContext<UseDropzoneReturn<unknown, unknown> | null>(null)\n\nconst DropzoneFileListContext = React.createContext<DropzoneFileListContextValue<unknown, unknown> | null>(null)\n\nfunction fileStatusReducer<TUploadResult, TUploadError>(\n state: DropzoneFileStatus<TUploadResult, TUploadError>[],\n action: DropzoneAction<TUploadResult, TUploadError>\n): DropzoneFileStatus<TUploadResult, TUploadError>[] {\n switch (action.type) {\n case 'add':\n return [\n ...state,\n {\n id: action.id,\n fileName: action.fileName,\n file: action.file,\n status: 'pending',\n tries: 1\n }\n ]\n case 'remove':\n return state.filter((fileStatus) => fileStatus.id !== action.id)\n case 'update-status':\n return state.map((fileStatus) => {\n if (fileStatus.id !== action.id) {\n return fileStatus\n }\n\n if (action.status === 'pending') {\n return {\n ...fileStatus,\n status: 'pending',\n error: undefined,\n message: undefined,\n result: undefined,\n tries: fileStatus.tries + 1\n }\n }\n\n if (action.status === 'error') {\n return {\n ...fileStatus,\n status: 'error',\n error: action.error,\n message: action.message,\n result: undefined\n }\n }\n\n return {\n ...fileStatus,\n status: 'success',\n result: action.result,\n error: undefined,\n message: undefined\n }\n })\n }\n}\n\nfunction formatAcceptedTypes(accept?: Accept) {\n if (!accept) {\n return undefined\n }\n\n const acceptedTypes = Object.entries(accept).flatMap(([mimeType, extensions]) => {\n return extensions.length > 0 ? extensions : [mimeType]\n })\n\n return acceptedTypes.length > 0 ? acceptedTypes.join(', ') : undefined\n}\n\nfunction getDropzoneErrorCodes(fileRejections: FileRejection[]) {\n const errorCodes = fileRejections.flatMap((rejection) =>\n rejection.errors.map((error) => error.code as ErrorCode).filter((errorCode) => dropzoneErrorCodeSet.has(errorCode))\n )\n\n return Array.from(new Set(errorCodes))\n}\n\nfunction getRootError(errorCodes: ErrorCode[], limits: DropzoneValidation) {\n const errors = errorCodes.flatMap((errorCode) => {\n switch (errorCode) {\n case 'file-invalid-type': {\n const acceptedTypes = formatAcceptedTypes(limits.accept)\n return acceptedTypes ? [`only ${acceptedTypes} files are allowed`] : ['this file type is not allowed']\n }\n case 'file-too-large': {\n if (!limits.maxSize) {\n return ['this file is too large']\n }\n\n return [`max size is ${(limits.maxSize / (1024 * 1024)).toFixed(2)} MB`]\n }\n case 'file-too-small': {\n if (!limits.minSize) {\n return ['this file is too small']\n }\n\n return [`min size is ${(limits.minSize / (1024 * 1024)).toFixed(2)} MB`]\n }\n case 'too-many-files':\n return limits.maxFiles ? [`max ${limits.maxFiles} files`] : ['too many files']\n default:\n return []\n }\n })\n\n if (errors.length === 0) {\n return 'Unable to add the selected files'\n }\n\n const [firstError, ...restErrors] = errors as [string, ...string[]]\n return `${firstError.charAt(0).toUpperCase()}${firstError.slice(1)}${restErrors.length > 0 ? `, ${restErrors.join(', ')}` : ''}`\n}\n\nfunction getRejectionMessage(fileRejections: FileRejection[], limits: DropzoneValidation) {\n const errorCodes = getDropzoneErrorCodes(fileRejections)\n\n if (errorCodes.length > 0) {\n return getRootError(errorCodes, limits)\n }\n\n return fileRejections[0]?.errors[0]?.message ?? 'Unable to add the selected files'\n}\n\nfunction getUploadErrorMessage<TUploadError>(\n error: TUploadError,\n shapeUploadError?: (error: TUploadError) => string | undefined\n) {\n if (shapeUploadError) {\n const message = shapeUploadError(error)\n if (message !== undefined) {\n return message\n }\n }\n\n if (typeof error === 'string') {\n return error\n }\n\n if (error instanceof Error) {\n return error.message\n }\n\n return undefined\n}\n\nfunction setRef<T>(ref: React.Ref<T> | undefined, value: T | null) {\n if (typeof ref === 'function') {\n ref(value)\n return\n }\n\n if (ref) {\n ref.current = value\n }\n}\n\nfunction composeRefs<T>(...refs: Array<React.Ref<T> | undefined>) {\n return (value: T | null) => {\n refs.forEach((ref) => {\n setRef(ref, value)\n })\n }\n}\n\nfunction useDropzoneContext<TUploadResult, TUploadError>() {\n const context = React.useContext(DropzoneContext)\n\n if (!context) {\n throw new Error('Dropzone components must be used within a Dropzone.')\n }\n\n return context as UseDropzoneReturn<TUploadResult, TUploadError>\n}\n\nfunction useDropzoneFileListContext<TUploadResult, TUploadError>() {\n const context = React.useContext(DropzoneFileListContext)\n\n if (!context) {\n throw new Error('Dropzone file actions must be used within a DropzoneFileListItem.')\n }\n\n return context as DropzoneFileListContextValue<TUploadResult, TUploadError>\n}\n\nfunction useDropzone<TUploadResult, TUploadError = string>(\n props: UseDropzoneProps<TUploadResult, TUploadError>\n): UseDropzoneReturn<TUploadResult, TUploadError> {\n const {\n onDropFile: handleDropFile,\n onRemoveFile: handleRemoveFile,\n shapeUploadError,\n onFileUploaded,\n onFileUploadError,\n onAllUploaded,\n onRootError,\n maxRetryCount,\n autoRetry = false,\n validation,\n shiftOnMaxFiles = false\n } = props\n\n const inputId = React.useId()\n const rootMessageId = `${inputId}-message`\n const rootDescriptionId = `${inputId}-description`\n const [rootError, setRootErrorState] = React.useState<string | undefined>(undefined)\n\n const setRootError = React.useCallback(\n (error: string | undefined) => {\n setRootErrorState(error)\n onRootError?.(error)\n },\n [onRootError]\n )\n\n const [fileStatuses, dispatch] = React.useReducer(\n fileStatusReducer<TUploadResult, TUploadError>,\n [] as DropzoneFileStatus<TUploadResult, TUploadError>[]\n )\n\n const getFileMessageId = React.useCallback((id: string) => `${inputId}-${id}-message`, [inputId])\n\n const isInvalid = React.useMemo(() => {\n return rootError !== undefined || fileStatuses.some((fileStatus) => fileStatus.status === 'error')\n }, [fileStatuses, rootError])\n\n const uploadFile = React.useCallback(\n async (file: File, id: string, retryCount = 0) => {\n try {\n const result = await handleDropFile(file)\n\n if (result.status === 'error') {\n if (autoRetry && retryCount < (maxRetryCount ?? Number.POSITIVE_INFINITY)) {\n dispatch({ type: 'update-status', id, status: 'pending' })\n return uploadFile(file, id, retryCount + 1)\n }\n\n dispatch({\n type: 'update-status',\n id,\n status: 'error',\n error: result.error,\n message: getUploadErrorMessage(result.error, shapeUploadError)\n })\n onFileUploadError?.(result.error)\n return\n }\n\n dispatch({\n type: 'update-status',\n id,\n status: 'success',\n result: result.result\n })\n onFileUploaded?.(result.result)\n } catch (error) {\n const uploadError = error as TUploadError\n\n dispatch({\n type: 'update-status',\n id,\n status: 'error',\n error: uploadError,\n message: getUploadErrorMessage(uploadError, shapeUploadError)\n })\n onFileUploadError?.(uploadError)\n }\n },\n [autoRetry, handleDropFile, maxRetryCount, onFileUploadError, onFileUploaded, shapeUploadError]\n )\n\n const onRemoveFile = React.useCallback(\n async (id: string) => {\n await handleRemoveFile?.(id)\n dispatch({ type: 'remove', id })\n },\n [handleRemoveFile]\n )\n\n const canRetry = React.useCallback(\n (id: string) => {\n const fileStatus = fileStatuses.find((item) => item.id === id)\n\n return fileStatus?.status === 'error' && fileStatus.tries <= (maxRetryCount ?? Number.POSITIVE_INFINITY)\n },\n [fileStatuses, maxRetryCount]\n )\n\n const onRetry = React.useCallback(\n async (id: string) => {\n if (!canRetry(id)) {\n return\n }\n\n const fileStatus = fileStatuses.find((item) => item.id === id)\n\n if (!fileStatus || fileStatus.status !== 'error') {\n return\n }\n\n dispatch({ type: 'update-status', id, status: 'pending' })\n await uploadFile(fileStatus.file, id)\n },\n [canRetry, fileStatuses, uploadFile]\n )\n\n const dropzone = useReactDropzone({\n accept: validation?.accept,\n minSize: validation?.minSize,\n maxSize: validation?.maxSize,\n maxFiles: validation?.maxFiles,\n noClick: true,\n noKeyboard: true,\n onDropAccepted: async (acceptedFiles) => {\n setRootError(undefined)\n\n let nextFiles = acceptedFiles\n const maxFiles = validation?.maxFiles ?? Number.POSITIVE_INFINITY\n const overflow = Number.isFinite(maxFiles)\n ? Math.max(fileStatuses.length + acceptedFiles.length - maxFiles, 0)\n : 0\n\n if (overflow > 0) {\n if (shiftOnMaxFiles) {\n const filesToRemove = fileStatuses.slice(0, Math.min(overflow, fileStatuses.length))\n\n await Promise.all(filesToRemove.map((fileStatus) => onRemoveFile(fileStatus.id)))\n\n const remainingOverflow = overflow - filesToRemove.length\n if (remainingOverflow > 0) {\n nextFiles = acceptedFiles.slice(remainingOverflow)\n }\n } else {\n setRootError(getRootError([ErrorCode.TooManyFiles], validation ?? {}))\n const availableSlots = Math.max(maxFiles - fileStatuses.length, 0)\n nextFiles = acceptedFiles.slice(0, availableSlots)\n }\n }\n\n if (nextFiles.length === 0) {\n return\n }\n\n await Promise.all(\n nextFiles.map(async (file) => {\n const id = crypto.randomUUID()\n dispatch({ type: 'add', id, fileName: file.name, file })\n await uploadFile(file, id)\n })\n )\n\n onAllUploaded?.()\n },\n onDropRejected: (fileRejections) => {\n setRootError(getRejectionMessage(fileRejections, validation ?? {}))\n }\n })\n\n return {\n getRootProps: dropzone.getRootProps,\n getInputProps: dropzone.getInputProps,\n open: dropzone.open,\n onRemoveFile,\n onRetry,\n canRetry,\n fileStatuses,\n isInvalid,\n isDragActive: dropzone.isDragActive,\n rootError,\n inputId,\n rootMessageId,\n rootDescriptionId,\n getFileMessageId\n }\n}\n\nfunction Dropzone<TUploadResult, TUploadError>({ children, ...dropzone }: DropzoneProps<TUploadResult, TUploadError>) {\n return <DropzoneContext.Provider value={dropzone}>{children}</DropzoneContext.Provider>\n}\n\nconst DropzoneArea = React.forwardRef<HTMLDivElement, DropzoneAreaProps>(\n ({ className, children, ...props }, forwardedRef) => {\n const context = useDropzoneContext()\n const describedBy =\n [context.rootDescriptionId, context.isInvalid ? context.rootMessageId : undefined].filter(Boolean).join(' ') ||\n undefined\n\n const { ref: rootRef, ...rootProps } = context.getRootProps({\n ...props,\n 'data-slot': 'dropzone-area',\n 'aria-describedby': describedBy,\n 'aria-invalid': context.isInvalid || undefined,\n className: cn(\n 'flex min-h-44 flex-col items-center justify-center gap-4 rounded-xl border border-dashed border-input bg-muted/20 px-6 py-8 text-center transition-colors',\n context.isDragActive && 'border-primary bg-primary/5',\n context.isInvalid && 'border-destructive bg-destructive/5',\n className\n )\n }) as React.HTMLAttributes<HTMLDivElement> & {\n ref?: React.Ref<HTMLDivElement>\n }\n\n const inputProps = context.getInputProps({\n id: context.inputId,\n className: 'sr-only',\n 'aria-describedby': describedBy,\n 'aria-invalid': context.isInvalid,\n tabIndex: -1\n })\n\n return (\n <div {...rootProps} ref={composeRefs(forwardedRef, rootRef)}>\n <input {...inputProps} />\n {children}\n </div>\n )\n }\n)\n\nconst DropzoneDescription = React.forwardRef<HTMLParagraphElement, DropzoneDescriptionProps>(\n ({ className, ...props }, ref) => {\n const context = useDropzoneContext()\n\n return (\n <p\n ref={ref}\n id={context.rootDescriptionId}\n data-slot=\"dropzone-description\"\n className={cn('text-sm text-muted-foreground', className)}\n {...props}\n />\n )\n }\n)\n\nconst DropzoneFileList = React.forwardRef<HTMLOListElement, DropzoneFileListProps>(({ className, ...props }, ref) => {\n useDropzoneContext()\n\n return <ol ref={ref} data-slot=\"dropzone-file-list\" className={cn('space-y-3', className)} {...props} />\n})\n\nconst DropzoneFileListItem = React.forwardRef<HTMLLIElement, DropzoneFileListItemProps<unknown, unknown>>(\n ({ className, file, children, ...props }, ref) => {\n const context = useDropzoneContext()\n const messageId = context.getFileMessageId(file.id)\n const isInvalid = file.status === 'error'\n const canRetry = context.canRetry(file.id)\n\n const value = React.useMemo<DropzoneFileListContextValue<unknown, unknown>>(\n () => ({\n onRemoveFile: () => context.onRemoveFile(file.id),\n onRetry: () => context.onRetry(file.id),\n fileStatus: file,\n canRetry,\n dropzoneId: context.inputId,\n messageId\n }),\n [canRetry, context, file, messageId]\n )\n\n return (\n <DropzoneFileListContext.Provider value={value}>\n <li\n ref={ref}\n data-slot=\"dropzone-file-item\"\n data-status={file.status}\n aria-describedby={isInvalid ? messageId : undefined}\n className={cn(\n 'rounded-xl border bg-card px-4 py-3 shadow-xs',\n file.status === 'error' && 'border-destructive/50',\n className\n )}\n {...props}\n >\n {children}\n </li>\n </DropzoneFileListContext.Provider>\n )\n }\n)\n\nconst DropzoneFileMessage = React.forwardRef<HTMLParagraphElement, DropzoneFileMessageProps>(\n ({ className, children, ...props }, ref) => {\n const context = useDropzoneFileListContext()\n const body =\n context.fileStatus.status === 'error'\n ? (context.fileStatus.message ?? String(context.fileStatus.error))\n : children\n\n return (\n <p\n ref={ref}\n id={context.messageId}\n data-slot=\"dropzone-file-message\"\n className={cn(\n 'min-h-5 text-[0.8rem] font-medium',\n context.fileStatus.status === 'error' && 'text-destructive',\n className\n )}\n {...props}\n >\n {body}\n </p>\n )\n }\n)\n\nconst DropzoneMessage = React.forwardRef<HTMLParagraphElement, DropzoneMessageProps>(\n ({ className, children, ...props }, ref) => {\n const context = useDropzoneContext()\n const body = context.rootError ?? children\n\n return (\n <p\n ref={ref}\n id={context.rootMessageId}\n data-slot=\"dropzone-message\"\n className={cn('min-h-5 text-[0.8rem] font-medium text-destructive', className)}\n {...props}\n >\n {body}\n </p>\n )\n }\n)\n\nconst DropzoneRemoveFile = React.forwardRef<HTMLButtonElement, DropzoneRemoveFileProps>(\n ({ className, onClick, size = 'icon-sm', type = 'button', variant = 'ghost', ...props }, ref) => {\n const context = useDropzoneFileListContext()\n\n const handleClick = React.useCallback<React.MouseEventHandler<HTMLButtonElement>>(\n (event) => {\n onClick?.(event)\n if (event.defaultPrevented) {\n return\n }\n\n void context.onRemoveFile()\n },\n [context, onClick]\n )\n\n return (\n <Button\n ref={ref}\n data-slot=\"dropzone-remove-file\"\n className={cn(className)}\n onClick={handleClick}\n size={size}\n type={type}\n variant={variant}\n {...props}\n />\n )\n }\n)\n\nconst DropzoneRetryFile = React.forwardRef<HTMLButtonElement, DropzoneRetryFileProps>(\n ({ className, disabled, onClick, size = 'icon-sm', type = 'button', variant = 'ghost', ...props }, ref) => {\n const context = useDropzoneFileListContext()\n const isDisabled = disabled || !context.canRetry\n\n const handleClick = React.useCallback<React.MouseEventHandler<HTMLButtonElement>>(\n (event) => {\n onClick?.(event)\n if (event.defaultPrevented || isDisabled) {\n return\n }\n\n void context.onRetry()\n },\n [context, isDisabled, onClick]\n )\n\n return (\n <Button\n ref={ref}\n data-slot=\"dropzone-retry-file\"\n className={cn(className)}\n disabled={isDisabled}\n onClick={handleClick}\n size={size}\n type={type}\n variant={variant}\n {...props}\n />\n )\n }\n)\n\nconst DropzoneTrigger = React.forwardRef<HTMLButtonElement, DropzoneTriggerProps>(\n ({ className, onClick, size = 'sm', type = 'button', variant = 'subtle', ...props }, ref) => {\n const context = useDropzoneContext()\n const describedBy =\n [context.rootDescriptionId, context.isInvalid ? context.rootMessageId : undefined].filter(Boolean).join(' ') ||\n undefined\n\n const handleClick = React.useCallback<React.MouseEventHandler<HTMLButtonElement>>(\n (event) => {\n onClick?.(event)\n if (event.defaultPrevented) {\n return\n }\n\n context.open()\n },\n [context, onClick]\n )\n\n return (\n <Button\n ref={ref}\n aria-controls={context.inputId}\n aria-describedby={describedBy}\n aria-invalid={context.isInvalid || undefined}\n data-slot=\"dropzone-trigger\"\n className={cn(className)}\n onClick={handleClick}\n size={size}\n type={type}\n variant={variant}\n {...props}\n />\n )\n }\n)\n\nconst InfiniteProgress = React.forwardRef<HTMLDivElement, InfiniteProgressProps>(\n ({ className, status, ...props }, ref) => {\n const done = status === 'success' || status === 'error'\n const isError = status === 'error'\n\n return (\n <div\n ref={ref}\n aria-valuemax={100}\n aria-valuemin={0}\n aria-valuetext={valueTextMap[status]}\n data-slot=\"dropzone-progress\"\n data-status={status}\n role=\"progressbar\"\n className={cn('relative h-2 w-full overflow-hidden rounded-full bg-muted', className)}\n {...props}\n >\n <div\n className={cn(\n 'h-full w-full rounded-full bg-primary transition-transform',\n done ? 'translate-x-0' : 'animate-infinite-progress',\n isError && 'bg-destructive'\n )}\n />\n </div>\n )\n }\n)\n\nDropzone.displayName = 'Dropzone'\nDropzoneArea.displayName = 'DropzoneArea'\nDropzoneDescription.displayName = 'DropzoneDescription'\nDropzoneFileList.displayName = 'DropzoneFileList'\nDropzoneFileListItem.displayName = 'DropzoneFileListItem'\nDropzoneFileMessage.displayName = 'DropzoneFileMessage'\nDropzoneMessage.displayName = 'DropzoneMessage'\nDropzoneRemoveFile.displayName = 'DropzoneRemoveFile'\nDropzoneRetryFile.displayName = 'DropzoneRetryFile'\nDropzoneTrigger.displayName = 'DropzoneTrigger'\nInfiniteProgress.displayName = 'InfiniteProgress'\n\nexport {\n Dropzone,\n DropzoneArea,\n DropzoneDescription,\n DropzoneFileList,\n DropzoneFileListItem,\n DropzoneFileMessage,\n DropzoneMessage,\n DropzoneRemoveFile,\n DropzoneRetryFile,\n DropzoneTrigger,\n ErrorCode,\n type FileError,\n InfiniteProgress,\n useDropzone\n}\n"],"mappings":"6OAYA,MAAM,EAAqB,CACzB,EAAU,gBACV,EAAU,aACV,EAAU,aACV,EAAU,YACZ,EAiJM,EAAuB,IAAI,IAAe,CAAkB,EAE5D,EAAe,CACnB,QAAS,gBACT,QAAS,OACT,MAAO,OACT,EAEM,EAAkB,EAAM,cAA0D,IAAI,EAEtF,EAA0B,EAAM,cAAqE,IAAI,EAE/G,SAAS,kBACP,EACA,EACmD,CACnD,OAAQ,EAAO,KAAf,CACE,IAAK,MACH,MAAO,CACL,GAAG,EACH,CACE,GAAI,EAAO,GACX,SAAU,EAAO,SACjB,KAAM,EAAO,KACb,OAAQ,UACR,MAAO,CACT,CACF,EACF,IAAK,SACH,OAAO,EAAM,OAAQ,GAAe,EAAW,KAAO,EAAO,EAAE,EACjE,IAAK,gBACH,OAAO,EAAM,IAAK,GACZ,EAAW,KAAO,EAAO,GAIzB,EAAO,SAAW,UACb,CACL,GAAG,EACH,OAAQ,UACR,MAAO,IAAA,GACP,QAAS,IAAA,GACT,OAAQ,IAAA,GACR,MAAO,EAAW,MAAQ,CAC5B,EAGE,EAAO,SAAW,QACb,CACL,GAAG,EACH,OAAQ,QACR,MAAO,EAAO,MACd,QAAS,EAAO,QAChB,OAAQ,IAAA,EACV,EAGK,CACL,GAAG,EACH,OAAQ,UACR,OAAQ,EAAO,OACf,MAAO,IAAA,GACP,QAAS,IAAA,EACX,EA9BS,CA+BV,CACL,CACF,CAEA,SAAS,oBAAoB,EAAiB,CAC5C,GAAI,CAAC,EACH,OAGF,IAAM,EAAgB,OAAO,QAAQ,CAAM,EAAE,SAAS,CAAC,EAAU,KACxD,EAAW,OAAS,EAA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AAQ,WAAa,IAAA,GACnC,YAAU,mBACV,UAAW,EAAG,CAAS,EACvB,QAAS,EACH,OACA,OACG,UACT,GAAI,CACL,CAAA,CAEL,CACF,EAEM,EAAmB,EAAM,YAC5B,CAAE,YAAW,SAAQ,GAAG,GAAS,IAAQ,CACxC,IAAM,EAAO,IAAW,WAAa,IAAW,QAC1C,EAAU,IAAW,QAE3B,OACE,EAAC,MAAD,CACO,MACL,gBAAe,IACf,gBAAe,EACf,iBAAgB,EAAa,GAC7B,YAAU,oBACV,cAAa,EACb,KAAK,cACL,UAAW,EAAG,4DAA6D,CAAS,EACpF,GAAI,WAEJ,EAAC,MAAD,CACE,UAAW,EACT,6DACA,EAAO,gBAAkB,4BACzB,GAAW,gBACb,CACD,CAAA,CACE,CAAA,CAET,CACF,EAEA,SAAS,YAAc,WACvB,EAAa,YAAc,eAC3B,EAAoB,YAAc,sBAClC,EAAiB,YAAc,mBAC/B,EAAqB,YAAc,uBACnC,EAAoB,YAAc,sBAClC,EAAgB,YAAc,kBAC9B,EAAmB,YAAc,qBACjC,EAAkB,YAAc,oBAChC,EAAgB,YAAc,kBAC9B,EAAiB,YAAc"}
|
|
1
|
+
{"version":3,"file":"dropzone.js","names":["useReactDropzone"],"sources":["../../src/components/dropzone.tsx"],"sourcesContent":["import * as React from 'react'\nimport {\n type Accept,\n ErrorCode,\n type FileError,\n type FileRejection,\n useDropzone as useReactDropzone\n} from 'react-dropzone'\n\nimport { composeRefs } from '../lib/compose-refs'\nimport { cn } from '../lib/utils'\nimport { Button, type ButtonProps } from './button'\n\nconst dropzoneErrorCodes = [\n ErrorCode.FileInvalidType,\n ErrorCode.FileTooLarge,\n ErrorCode.FileTooSmall,\n ErrorCode.TooManyFiles\n]\n\ntype DropzoneAction<TUploadResult, TUploadError> =\n | {\n type: 'add'\n id: string\n fileName: string\n file: File\n }\n | {\n type: 'remove'\n id: string\n }\n | {\n type: 'update-status'\n id: string\n status: 'pending'\n }\n | {\n type: 'update-status'\n id: string\n status: 'error'\n error: TUploadError\n message?: string\n }\n | {\n type: 'update-status'\n id: string\n status: 'success'\n result: TUploadResult\n }\n\nexport type DropzoneUploadResult<TUploadResult, TUploadError> =\n | {\n status: 'error'\n error: TUploadError\n }\n | {\n status: 'success'\n result: TUploadResult\n }\n\nexport type DropzoneFileStatus<TUploadResult, TUploadError> = {\n id: string\n fileName: string\n file: File\n tries: number\n} & (\n | {\n status: 'pending'\n error?: undefined\n message?: undefined\n result?: undefined\n }\n | {\n status: 'error'\n error: TUploadError\n message?: string\n result?: undefined\n }\n | {\n status: 'success'\n result: TUploadResult\n error?: undefined\n message?: undefined\n }\n)\n\nexport type FileStatus<TUploadResult, TUploadError> = DropzoneFileStatus<TUploadResult, TUploadError>\n\nexport type DropzoneValidation = {\n accept?: Accept\n minSize?: number\n maxSize?: number\n maxFiles?: number\n}\n\nexport type UseDropzoneProps<TUploadResult, TUploadError = string> = {\n onDropFile: (file: File) => Promise<DropzoneUploadResult<TUploadResult, TUploadError>>\n onRemoveFile?: (id: string) => void | Promise<void>\n onFileUploaded?: (result: TUploadResult) => void\n onFileUploadError?: (error: TUploadError) => void\n onAllUploaded?: () => void\n onRootError?: (error: string | undefined) => void\n shapeUploadError?: (error: TUploadError) => string | undefined\n maxRetryCount?: number\n autoRetry?: boolean\n validation?: DropzoneValidation\n shiftOnMaxFiles?: boolean\n}\n\nexport interface UseDropzoneReturn<TUploadResult, TUploadError> {\n getRootProps: ReturnType<typeof useReactDropzone>['getRootProps']\n getInputProps: ReturnType<typeof useReactDropzone>['getInputProps']\n open: () => void\n onRemoveFile: (id: string) => Promise<void>\n onRetry: (id: string) => Promise<void>\n canRetry: (id: string) => boolean\n fileStatuses: DropzoneFileStatus<TUploadResult, TUploadError>[]\n isInvalid: boolean\n isDragActive: boolean\n rootError: string | undefined\n inputId: string\n rootMessageId: string\n rootDescriptionId: string\n getFileMessageId: (id: string) => string\n}\n\nexport type DropzoneProps<TUploadResult, TUploadError> = React.PropsWithChildren<\n UseDropzoneReturn<TUploadResult, TUploadError>\n>\n\nexport type DropzoneAreaProps = React.ComponentProps<'div'>\n\nexport type DropzoneDescriptionProps = React.ComponentProps<'p'>\n\nexport type DropzoneFileListProps = React.ComponentProps<'ol'>\n\nexport type DropzoneFileListItemProps<TUploadResult, TUploadError> = React.ComponentProps<'li'> & {\n file: DropzoneFileStatus<TUploadResult, TUploadError>\n}\n\nexport type DropzoneFileMessageProps = React.ComponentProps<'p'>\n\nexport type DropzoneMessageProps = React.ComponentProps<'p'>\n\nexport type DropzoneRemoveFileProps = ButtonProps\n\nexport type DropzoneRetryFileProps = ButtonProps\n\nexport type DropzoneTriggerProps = ButtonProps\n\nexport type InfiniteProgressProps = React.ComponentProps<'div'> & {\n status: 'pending' | 'success' | 'error'\n}\n\ntype DropzoneFileListContextValue<TUploadResult, TUploadError> = {\n onRemoveFile: () => Promise<void>\n onRetry: () => Promise<void>\n fileStatus: DropzoneFileStatus<TUploadResult, TUploadError>\n canRetry: boolean\n dropzoneId: string\n messageId: string\n}\n\nconst dropzoneErrorCodeSet = new Set<ErrorCode>(dropzoneErrorCodes)\n\nconst valueTextMap = {\n pending: 'indeterminate',\n success: '100%',\n error: 'error'\n} as const\n\nconst DropzoneContext = React.createContext<UseDropzoneReturn<unknown, unknown> | null>(null)\n\nconst DropzoneFileListContext = React.createContext<DropzoneFileListContextValue<unknown, unknown> | null>(null)\n\nfunction fileStatusReducer<TUploadResult, TUploadError>(\n state: DropzoneFileStatus<TUploadResult, TUploadError>[],\n action: DropzoneAction<TUploadResult, TUploadError>\n): DropzoneFileStatus<TUploadResult, TUploadError>[] {\n switch (action.type) {\n case 'add':\n return [\n ...state,\n {\n id: action.id,\n fileName: action.fileName,\n file: action.file,\n status: 'pending',\n tries: 1\n }\n ]\n case 'remove':\n return state.filter((fileStatus) => fileStatus.id !== action.id)\n case 'update-status':\n return state.map((fileStatus) => {\n if (fileStatus.id !== action.id) {\n return fileStatus\n }\n\n if (action.status === 'pending') {\n return {\n ...fileStatus,\n status: 'pending',\n error: undefined,\n message: undefined,\n result: undefined,\n tries: fileStatus.tries + 1\n }\n }\n\n if (action.status === 'error') {\n return {\n ...fileStatus,\n status: 'error',\n error: action.error,\n message: action.message,\n result: undefined\n }\n }\n\n return {\n ...fileStatus,\n status: 'success',\n result: action.result,\n error: undefined,\n message: undefined\n }\n })\n }\n}\n\nfunction formatAcceptedTypes(accept?: Accept) {\n if (!accept) {\n return undefined\n }\n\n const acceptedTypes = Object.entries(accept).flatMap(([mimeType, extensions]) => {\n return extensions.length > 0 ? extensions : [mimeType]\n })\n\n return acceptedTypes.length > 0 ? acceptedTypes.join(', ') : undefined\n}\n\nfunction getDropzoneErrorCodes(fileRejections: FileRejection[]) {\n const errorCodes = fileRejections.flatMap((rejection) =>\n rejection.errors.map((error) => error.code as ErrorCode).filter((errorCode) => dropzoneErrorCodeSet.has(errorCode))\n )\n\n return Array.from(new Set(errorCodes))\n}\n\nfunction getRootError(errorCodes: ErrorCode[], limits: DropzoneValidation) {\n const errors = errorCodes.flatMap((errorCode) => {\n switch (errorCode) {\n case 'file-invalid-type': {\n const acceptedTypes = formatAcceptedTypes(limits.accept)\n return acceptedTypes ? [`only ${acceptedTypes} files are allowed`] : ['this file type is not allowed']\n }\n case 'file-too-large': {\n if (!limits.maxSize) {\n return ['this file is too large']\n }\n\n return [`max size is ${(limits.maxSize / (1024 * 1024)).toFixed(2)} MB`]\n }\n case 'file-too-small': {\n if (!limits.minSize) {\n return ['this file is too small']\n }\n\n return [`min size is ${(limits.minSize / (1024 * 1024)).toFixed(2)} MB`]\n }\n case 'too-many-files':\n return limits.maxFiles ? [`max ${limits.maxFiles} files`] : ['too many files']\n default:\n return []\n }\n })\n\n if (errors.length === 0) {\n return 'Unable to add the selected files'\n }\n\n const [firstError, ...restErrors] = errors as [string, ...string[]]\n return `${firstError.charAt(0).toUpperCase()}${firstError.slice(1)}${restErrors.length > 0 ? `, ${restErrors.join(', ')}` : ''}`\n}\n\nfunction getRejectionMessage(fileRejections: FileRejection[], limits: DropzoneValidation) {\n const errorCodes = getDropzoneErrorCodes(fileRejections)\n\n if (errorCodes.length > 0) {\n return getRootError(errorCodes, limits)\n }\n\n return fileRejections[0]?.errors[0]?.message ?? 'Unable to add the selected files'\n}\n\nfunction getUploadErrorMessage<TUploadError>(\n error: TUploadError,\n shapeUploadError?: (error: TUploadError) => string | undefined\n) {\n if (shapeUploadError) {\n const message = shapeUploadError(error)\n if (message !== undefined) {\n return message\n }\n }\n\n if (typeof error === 'string') {\n return error\n }\n\n if (error instanceof Error) {\n return error.message\n }\n\n return undefined\n}\n\nfunction useDropzoneContext<TUploadResult, TUploadError>() {\n const context = React.useContext(DropzoneContext)\n\n if (!context) {\n throw new Error('Dropzone components must be used within a Dropzone.')\n }\n\n return context as UseDropzoneReturn<TUploadResult, TUploadError>\n}\n\nfunction useDropzoneFileListContext<TUploadResult, TUploadError>() {\n const context = React.useContext(DropzoneFileListContext)\n\n if (!context) {\n throw new Error('Dropzone file actions must be used within a DropzoneFileListItem.')\n }\n\n return context as DropzoneFileListContextValue<TUploadResult, TUploadError>\n}\n\nfunction useDropzone<TUploadResult, TUploadError = string>(\n props: UseDropzoneProps<TUploadResult, TUploadError>\n): UseDropzoneReturn<TUploadResult, TUploadError> {\n const {\n onDropFile: handleDropFile,\n onRemoveFile: handleRemoveFile,\n shapeUploadError,\n onFileUploaded,\n onFileUploadError,\n onAllUploaded,\n onRootError,\n maxRetryCount,\n autoRetry = false,\n validation,\n shiftOnMaxFiles = false\n } = props\n\n const inputId = React.useId()\n const rootMessageId = `${inputId}-message`\n const rootDescriptionId = `${inputId}-description`\n const [rootError, setRootErrorState] = React.useState<string | undefined>(undefined)\n\n const setRootError = React.useCallback(\n (error: string | undefined) => {\n setRootErrorState(error)\n onRootError?.(error)\n },\n [onRootError]\n )\n\n const [fileStatuses, dispatch] = React.useReducer(\n fileStatusReducer<TUploadResult, TUploadError>,\n [] as DropzoneFileStatus<TUploadResult, TUploadError>[]\n )\n\n const getFileMessageId = React.useCallback((id: string) => `${inputId}-${id}-message`, [inputId])\n\n const isInvalid = React.useMemo(() => {\n return rootError !== undefined || fileStatuses.some((fileStatus) => fileStatus.status === 'error')\n }, [fileStatuses, rootError])\n\n const uploadFile = React.useCallback(\n async (file: File, id: string, retryCount = 0) => {\n try {\n const result = await handleDropFile(file)\n\n if (result.status === 'error') {\n if (autoRetry && retryCount < (maxRetryCount ?? Number.POSITIVE_INFINITY)) {\n dispatch({ type: 'update-status', id, status: 'pending' })\n return uploadFile(file, id, retryCount + 1)\n }\n\n dispatch({\n type: 'update-status',\n id,\n status: 'error',\n error: result.error,\n message: getUploadErrorMessage(result.error, shapeUploadError)\n })\n onFileUploadError?.(result.error)\n return\n }\n\n dispatch({\n type: 'update-status',\n id,\n status: 'success',\n result: result.result\n })\n onFileUploaded?.(result.result)\n } catch (error) {\n const uploadError = error as TUploadError\n\n dispatch({\n type: 'update-status',\n id,\n status: 'error',\n error: uploadError,\n message: getUploadErrorMessage(uploadError, shapeUploadError)\n })\n onFileUploadError?.(uploadError)\n }\n },\n [autoRetry, handleDropFile, maxRetryCount, onFileUploadError, onFileUploaded, shapeUploadError]\n )\n\n const onRemoveFile = React.useCallback(\n async (id: string) => {\n await handleRemoveFile?.(id)\n dispatch({ type: 'remove', id })\n },\n [handleRemoveFile]\n )\n\n const canRetry = React.useCallback(\n (id: string) => {\n const fileStatus = fileStatuses.find((item) => item.id === id)\n\n return fileStatus?.status === 'error' && fileStatus.tries <= (maxRetryCount ?? Number.POSITIVE_INFINITY)\n },\n [fileStatuses, maxRetryCount]\n )\n\n const onRetry = React.useCallback(\n async (id: string) => {\n if (!canRetry(id)) {\n return\n }\n\n const fileStatus = fileStatuses.find((item) => item.id === id)\n\n if (!fileStatus || fileStatus.status !== 'error') {\n return\n }\n\n dispatch({ type: 'update-status', id, status: 'pending' })\n await uploadFile(fileStatus.file, id)\n },\n [canRetry, fileStatuses, uploadFile]\n )\n\n const dropzone = useReactDropzone({\n accept: validation?.accept,\n minSize: validation?.minSize,\n maxSize: validation?.maxSize,\n maxFiles: validation?.maxFiles,\n noClick: true,\n noKeyboard: true,\n onDropAccepted: async (acceptedFiles) => {\n setRootError(undefined)\n\n let nextFiles = acceptedFiles\n const maxFiles = validation?.maxFiles ?? Number.POSITIVE_INFINITY\n const overflow = Number.isFinite(maxFiles)\n ? Math.max(fileStatuses.length + acceptedFiles.length - maxFiles, 0)\n : 0\n\n if (overflow > 0) {\n if (shiftOnMaxFiles) {\n const filesToRemove = fileStatuses.slice(0, Math.min(overflow, fileStatuses.length))\n\n await Promise.all(filesToRemove.map((fileStatus) => onRemoveFile(fileStatus.id)))\n\n const remainingOverflow = overflow - filesToRemove.length\n if (remainingOverflow > 0) {\n nextFiles = acceptedFiles.slice(remainingOverflow)\n }\n } else {\n setRootError(getRootError([ErrorCode.TooManyFiles], validation ?? {}))\n const availableSlots = Math.max(maxFiles - fileStatuses.length, 0)\n nextFiles = acceptedFiles.slice(0, availableSlots)\n }\n }\n\n if (nextFiles.length === 0) {\n return\n }\n\n await Promise.all(\n nextFiles.map(async (file) => {\n const id = crypto.randomUUID()\n dispatch({ type: 'add', id, fileName: file.name, file })\n await uploadFile(file, id)\n })\n )\n\n onAllUploaded?.()\n },\n onDropRejected: (fileRejections) => {\n setRootError(getRejectionMessage(fileRejections, validation ?? {}))\n }\n })\n\n return {\n getRootProps: dropzone.getRootProps,\n getInputProps: dropzone.getInputProps,\n open: dropzone.open,\n onRemoveFile,\n onRetry,\n canRetry,\n fileStatuses,\n isInvalid,\n isDragActive: dropzone.isDragActive,\n rootError,\n inputId,\n rootMessageId,\n rootDescriptionId,\n getFileMessageId\n }\n}\n\nfunction Dropzone<TUploadResult, TUploadError>({ children, ...dropzone }: DropzoneProps<TUploadResult, TUploadError>) {\n return <DropzoneContext.Provider value={dropzone}>{children}</DropzoneContext.Provider>\n}\n\nconst DropzoneArea = React.forwardRef<HTMLDivElement, DropzoneAreaProps>(\n ({ className, children, ...props }, forwardedRef) => {\n const context = useDropzoneContext()\n const describedBy =\n [context.rootDescriptionId, context.isInvalid ? context.rootMessageId : undefined].filter(Boolean).join(' ') ||\n undefined\n\n const { ref: rootRef, ...rootProps } = context.getRootProps({\n ...props,\n 'data-slot': 'dropzone-area',\n 'aria-describedby': describedBy,\n 'aria-invalid': context.isInvalid || undefined,\n className: cn(\n 'flex min-h-44 flex-col items-center justify-center gap-4 rounded-xl border border-dashed border-input bg-muted/20 px-6 py-8 text-center transition-colors',\n context.isDragActive && 'border-primary bg-primary/5',\n context.isInvalid && 'border-destructive bg-destructive/5',\n className\n )\n }) as React.HTMLAttributes<HTMLDivElement> & {\n ref?: React.Ref<HTMLDivElement>\n }\n\n const inputProps = context.getInputProps({\n id: context.inputId,\n className: 'sr-only',\n 'aria-describedby': describedBy,\n 'aria-invalid': context.isInvalid,\n tabIndex: -1\n })\n\n return (\n <div {...rootProps} ref={composeRefs(forwardedRef, rootRef)}>\n <input {...inputProps} />\n {children}\n </div>\n )\n }\n)\n\nconst DropzoneDescription = React.forwardRef<HTMLParagraphElement, DropzoneDescriptionProps>(\n ({ className, ...props }, ref) => {\n const context = useDropzoneContext()\n\n return (\n <p\n ref={ref}\n id={context.rootDescriptionId}\n data-slot=\"dropzone-description\"\n className={cn('text-sm text-muted-foreground', className)}\n {...props}\n />\n )\n }\n)\n\nconst DropzoneFileList = React.forwardRef<HTMLOListElement, DropzoneFileListProps>(({ className, ...props }, ref) => {\n useDropzoneContext()\n\n return <ol ref={ref} data-slot=\"dropzone-file-list\" className={cn('space-y-3', className)} {...props} />\n})\n\nconst DropzoneFileListItem = React.forwardRef<HTMLLIElement, DropzoneFileListItemProps<unknown, unknown>>(\n ({ className, file, children, ...props }, ref) => {\n const context = useDropzoneContext()\n const messageId = context.getFileMessageId(file.id)\n const isInvalid = file.status === 'error'\n const canRetry = context.canRetry(file.id)\n\n const value = React.useMemo<DropzoneFileListContextValue<unknown, unknown>>(\n () => ({\n onRemoveFile: () => context.onRemoveFile(file.id),\n onRetry: () => context.onRetry(file.id),\n fileStatus: file,\n canRetry,\n dropzoneId: context.inputId,\n messageId\n }),\n [canRetry, context, file, messageId]\n )\n\n return (\n <DropzoneFileListContext.Provider value={value}>\n <li\n ref={ref}\n data-slot=\"dropzone-file-item\"\n data-status={file.status}\n aria-describedby={isInvalid ? messageId : undefined}\n className={cn(\n 'rounded-xl border bg-card px-4 py-3 shadow-xs',\n file.status === 'error' && 'border-destructive/50',\n className\n )}\n {...props}\n >\n {children}\n </li>\n </DropzoneFileListContext.Provider>\n )\n }\n)\n\nconst DropzoneFileMessage = React.forwardRef<HTMLParagraphElement, DropzoneFileMessageProps>(\n ({ className, children, ...props }, ref) => {\n const context = useDropzoneFileListContext()\n const body =\n context.fileStatus.status === 'error'\n ? (context.fileStatus.message ?? String(context.fileStatus.error))\n : children\n\n return (\n <p\n ref={ref}\n id={context.messageId}\n data-slot=\"dropzone-file-message\"\n className={cn(\n 'min-h-5 text-[0.8rem] font-medium',\n context.fileStatus.status === 'error' && 'text-destructive',\n className\n )}\n {...props}\n >\n {body}\n </p>\n )\n }\n)\n\nconst DropzoneMessage = React.forwardRef<HTMLParagraphElement, DropzoneMessageProps>(\n ({ className, children, ...props }, ref) => {\n const context = useDropzoneContext()\n const body = context.rootError ?? children\n\n return (\n <p\n ref={ref}\n id={context.rootMessageId}\n data-slot=\"dropzone-message\"\n className={cn('min-h-5 text-[0.8rem] font-medium text-destructive', className)}\n {...props}\n >\n {body}\n </p>\n )\n }\n)\n\nconst DropzoneRemoveFile = React.forwardRef<HTMLButtonElement, DropzoneRemoveFileProps>(\n ({ className, onClick, size = 'icon-sm', type = 'button', variant = 'ghost', ...props }, ref) => {\n const context = useDropzoneFileListContext()\n\n const handleClick = React.useCallback<React.MouseEventHandler<HTMLButtonElement>>(\n (event) => {\n onClick?.(event)\n if (event.defaultPrevented) {\n return\n }\n\n void context.onRemoveFile()\n },\n [context, onClick]\n )\n\n return (\n <Button\n ref={ref}\n data-slot=\"dropzone-remove-file\"\n className={cn(className)}\n onClick={handleClick}\n size={size}\n type={type}\n variant={variant}\n {...props}\n />\n )\n }\n)\n\nconst DropzoneRetryFile = React.forwardRef<HTMLButtonElement, DropzoneRetryFileProps>(\n ({ className, disabled, onClick, size = 'icon-sm', type = 'button', variant = 'ghost', ...props }, ref) => {\n const context = useDropzoneFileListContext()\n const isDisabled = disabled || !context.canRetry\n\n const handleClick = React.useCallback<React.MouseEventHandler<HTMLButtonElement>>(\n (event) => {\n onClick?.(event)\n if (event.defaultPrevented || isDisabled) {\n return\n }\n\n void context.onRetry()\n },\n [context, isDisabled, onClick]\n )\n\n return (\n <Button\n ref={ref}\n data-slot=\"dropzone-retry-file\"\n className={cn(className)}\n disabled={isDisabled}\n onClick={handleClick}\n size={size}\n type={type}\n variant={variant}\n {...props}\n />\n )\n }\n)\n\nconst DropzoneTrigger = React.forwardRef<HTMLButtonElement, DropzoneTriggerProps>(\n ({ className, onClick, size = 'sm', type = 'button', variant = 'subtle', ...props }, ref) => {\n const context = useDropzoneContext()\n const describedBy =\n [context.rootDescriptionId, context.isInvalid ? context.rootMessageId : undefined].filter(Boolean).join(' ') ||\n undefined\n\n const handleClick = React.useCallback<React.MouseEventHandler<HTMLButtonElement>>(\n (event) => {\n onClick?.(event)\n if (event.defaultPrevented) {\n return\n }\n\n context.open()\n },\n [context, onClick]\n )\n\n return (\n <Button\n ref={ref}\n aria-controls={context.inputId}\n aria-describedby={describedBy}\n aria-invalid={context.isInvalid || undefined}\n data-slot=\"dropzone-trigger\"\n className={cn(className)}\n onClick={handleClick}\n size={size}\n type={type}\n variant={variant}\n {...props}\n />\n )\n }\n)\n\nconst InfiniteProgress = React.forwardRef<HTMLDivElement, InfiniteProgressProps>(\n ({ className, status, ...props }, ref) => {\n const done = status === 'success' || status === 'error'\n const isError = status === 'error'\n\n return (\n <div\n ref={ref}\n aria-valuemax={100}\n aria-valuemin={0}\n aria-valuetext={valueTextMap[status]}\n data-slot=\"dropzone-progress\"\n data-status={status}\n role=\"progressbar\"\n className={cn('relative h-2 w-full overflow-hidden rounded-full bg-muted', className)}\n {...props}\n >\n <div\n className={cn(\n 'h-full w-full rounded-full bg-primary transition-transform',\n done ? 'translate-x-0' : 'animate-infinite-progress',\n isError && 'bg-destructive'\n )}\n />\n </div>\n )\n }\n)\n\nDropzone.displayName = 'Dropzone'\nDropzoneArea.displayName = 'DropzoneArea'\nDropzoneDescription.displayName = 'DropzoneDescription'\nDropzoneFileList.displayName = 'DropzoneFileList'\nDropzoneFileListItem.displayName = 'DropzoneFileListItem'\nDropzoneFileMessage.displayName = 'DropzoneFileMessage'\nDropzoneMessage.displayName = 'DropzoneMessage'\nDropzoneRemoveFile.displayName = 'DropzoneRemoveFile'\nDropzoneRetryFile.displayName = 'DropzoneRetryFile'\nDropzoneTrigger.displayName = 'DropzoneTrigger'\nInfiniteProgress.displayName = 'InfiniteProgress'\n\nexport {\n Dropzone,\n DropzoneArea,\n DropzoneDescription,\n DropzoneFileList,\n DropzoneFileListItem,\n DropzoneFileMessage,\n DropzoneMessage,\n DropzoneRemoveFile,\n DropzoneRetryFile,\n DropzoneTrigger,\n ErrorCode,\n type FileError,\n InfiniteProgress,\n useDropzone\n}\n"],"mappings":"kSAaA,MAAM,EAAqB,CACzB,EAAU,gBACV,EAAU,aACV,EAAU,aACV,EAAU,YACZ,EAiJM,EAAuB,IAAI,IAAe,CAAkB,EAE5D,EAAe,CACnB,QAAS,gBACT,QAAS,OACT,MAAO,OACT,EAEM,EAAkB,EAAM,cAA0D,IAAI,EAEtF,EAA0B,EAAM,cAAqE,IAAI,EAE/G,SAAS,kBACP,EACA,EACmD,CACnD,OAAQ,EAAO,KAAf,CACE,IAAK,MACH,MAAO,CACL,GAAG,EACH,CACE,GAAI,EAAO,GACX,SAAU,EAAO,SACjB,KAAM,EAAO,KACb,OAAQ,UACR,MAAO,CACT,CACF,EACF,IAAK,SACH,OAAO,EAAM,OAAQ,GAAe,EAAW,KAAO,EAAO,EAAE,EACjE,IAAK,gBACH,OA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AQ,UAAY,EAAQ,cAAgB,IAAA,EAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,GAC3G,IAAA,GAEI,EAAc,EAAM,YACvB,GAAU,CACT,IAAU,CAAK,EACX,GAAM,kBAIV,EAAQ,KAAK,CACf,EACA,CAAC,EAAS,CAAO,CACnB,EAEA,OACE,EAAC,EAAD,CACO,MACL,gBAAe,EAAQ,QACvB,mBAAkB,EAClB,eAAc,EAAQ,WAAa,IAAA,GACnC,YAAU,mBACV,UAAW,EAAG,CAAS,EACvB,QAAS,EACH,OACA,OACG,UACT,GAAI,CACL,CAAA,CAEL,CACF,EAEM,EAAmB,EAAM,YAC5B,CAAE,YAAW,SAAQ,GAAG,GAAS,IAAQ,CACxC,IAAM,EAAO,IAAW,WAAa,IAAW,QAC1C,EAAU,IAAW,QAE3B,OACE,EAAC,MAAD,CACO,MACL,gBAAe,IACf,gBAAe,EACf,iBAAgB,EAAa,GAC7B,YAAU,oBACV,cAAa,EACb,KAAK,cACL,UAAW,EAAG,4DAA6D,CAAS,EACpF,GAAI,WAEJ,EAAC,MAAD,CACE,UAAW,EACT,6DACA,EAAO,gBAAkB,4BACzB,GAAW,gBACb,CACD,CAAA,CACE,CAAA,CAET,CACF,EAEA,SAAS,YAAc,WACvB,EAAa,YAAc,eAC3B,EAAoB,YAAc,sBAClC,EAAiB,YAAc,mBAC/B,EAAqB,YAAc,uBACnC,EAAoB,YAAc,sBAClC,EAAgB,YAAc,kBAC9B,EAAmB,YAAc,qBACjC,EAAkB,YAAc,oBAChC,EAAgB,YAAc,kBAC9B,EAAiB,YAAc"}
|
|
@@ -17,7 +17,7 @@ declare function EmptyHeader({
|
|
|
17
17
|
...props
|
|
18
18
|
}: EmptyHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
19
19
|
declare const emptyMediaVariants: (props?: ({
|
|
20
|
-
variant?: "
|
|
20
|
+
variant?: "default" | "icon" | null | undefined;
|
|
21
21
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
22
22
|
declare function EmptyMedia({
|
|
23
23
|
className,
|
|
@@ -35,7 +35,7 @@ declare function FieldGroup({
|
|
|
35
35
|
...props
|
|
36
36
|
}: FieldGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
37
37
|
declare const fieldVariants: (props?: ({
|
|
38
|
-
orientation?: "
|
|
38
|
+
orientation?: "horizontal" | "vertical" | "responsive" | null | undefined;
|
|
39
39
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
40
40
|
type FieldProps = React.ComponentProps<'div'> & VariantProps<typeof fieldVariants>;
|
|
41
41
|
declare function Field({
|
package/dist/components/field.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{Separator as t}from"./separator.js";import{Label as n}from"./label.js";import{jsx as r,jsxs as i}from"react/jsx-runtime";import{cva as a}from"class-variance-authority";import{createContext as o,useContext as s,useId as c,useMemo as l}from"react";const u=o(null);function useFieldControlId(e){let t=s(u);return e??t?.controlId}function FieldSet({className:t,...n}){return r(`fieldset`,{"data-slot":`field-set`,className:e(`flex flex-col gap-4`,`has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3`,t),...n})}function FieldLegend({className:t,variant:n=`legend`,...i}){return r(`legend`,{"data-slot":`field-legend`,"data-variant":n,className:e(`mb-1.5 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base`,t),...i})}function FieldGroup({className:t,...n}){return r(`div`,{"data-slot":`field-group`,className:e(`group/field-group @container/field-group flex w-full flex-col gap-5`,`data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4`,t),...n})}const d=a(`data-[invalid=true]:text-destructive gap-1 group/field flex w-full`,{variants:{orientation:{vertical:`flex-col *:w-full [&>.sr-only]:w-auto`,horizontal:`flex-row items-center *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`,responsive:`flex-col *:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:*:data-[slot=field-label]:flex-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`}},defaultVariants:{orientation:`vertical`}});function Field({className:t,orientation:n=`vertical`,...i}){let a=c(),o=l(()=>({controlId:a}),[a]);return r(u.Provider,{value:o,children:r(`div`,{"data-slot":`field`,"data-orientation":n,className:e(d({orientation:n}),t),...i})})}function FieldContent({className:t,...n}){return r(`div`,{"data-slot":`field-content`,className:e(`gap-0.5 group/field-content flex flex-1 flex-col leading-snug`,t),...n})}function FieldLabel({className:t,htmlFor:i,...a}){return r(n,{"data-slot":`field-label`,htmlFor:useFieldControlId(i),className:e(`group/field-label peer/field-label flex w-fit gap-2 leading-snug`,`has-data-checked:bg-primary/5 has-data-checked:border-primary/30 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10`,`has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border *:data-[slot=field]:p-2.5`,`group-data-[disabled=true]/field:opacity-50`,t),...a})}function FieldTitle({className:t,...n}){return r(`div`,{"data-slot":`field-label`,className:e(`gap-2 text-sm font-medium group-data-[disabled=true]/field:opacity-50 flex w-fit items-center leading-snug`,t),...n})}function FieldDescription({className:t,...n}){return r(`p`,{"data-slot":`field-description`,className:e(`text-muted-foreground text-left text-
|
|
1
|
+
import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{Separator as t}from"./separator.js";import{Label as n}from"./label.js";import{jsx as r,jsxs as i}from"react/jsx-runtime";import{cva as a}from"class-variance-authority";import{createContext as o,useContext as s,useId as c,useMemo as l}from"react";const u=o(null);function useFieldControlId(e){let t=s(u);return e??t?.controlId}function FieldSet({className:t,...n}){return r(`fieldset`,{"data-slot":`field-set`,className:e(`flex flex-col gap-4`,`has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3`,t),...n})}function FieldLegend({className:t,variant:n=`legend`,...i}){return r(`legend`,{"data-slot":`field-legend`,"data-variant":n,className:e(`mb-1.5 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base`,t),...i})}function FieldGroup({className:t,...n}){return r(`div`,{"data-slot":`field-group`,className:e(`group/field-group @container/field-group flex w-full flex-col gap-5`,`data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4`,t),...n})}const d=a(`data-[invalid=true]:text-destructive gap-1 group/field flex w-full`,{variants:{orientation:{vertical:`flex-col *:w-full [&>.sr-only]:w-auto`,horizontal:`flex-row items-center *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`,responsive:`flex-col *:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:*:data-[slot=field-label]:flex-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`}},defaultVariants:{orientation:`vertical`}});function Field({className:t,orientation:n=`vertical`,...i}){let a=c(),o=l(()=>({controlId:a}),[a]);return r(u.Provider,{value:o,children:r(`div`,{"data-slot":`field`,"data-orientation":n,className:e(d({orientation:n}),t),...i})})}function FieldContent({className:t,...n}){return r(`div`,{"data-slot":`field-content`,className:e(`gap-0.5 group/field-content flex flex-1 flex-col leading-snug`,t),...n})}function FieldLabel({className:t,htmlFor:i,...a}){return r(n,{"data-slot":`field-label`,htmlFor:useFieldControlId(i),className:e(`group/field-label peer/field-label flex w-fit gap-2 leading-snug`,`has-data-checked:bg-primary/5 has-data-checked:border-primary/30 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10`,`has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border *:data-[slot=field]:p-2.5`,`group-data-[disabled=true]/field:opacity-50`,t),...a})}function FieldTitle({className:t,...n}){return r(`div`,{"data-slot":`field-label`,className:e(`gap-2 text-sm font-medium group-data-[disabled=true]/field:opacity-50 flex w-fit items-center leading-snug`,t),...n})}function FieldDescription({className:t,...n}){return r(`p`,{"data-slot":`field-description`,className:e(`text-muted-foreground text-left text-xs leading-normal font-normal`,`[[data-variant=legend]+&]:-mt-1.5 group-has-data-horizontal/field:text-balance last:mt-0 nth-last-2:-mt-1`,`[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,t),...n})}function FieldSeparator({children:n,className:a,...o}){return i(`div`,{"data-slot":`field-separator`,"data-content":!!n,className:e(`-my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2 relative`,a),...o,children:[r(t,{className:`absolute inset-0 top-1/2`}),n&&r(`span`,{className:`text-muted-foreground px-2 bg-background relative mx-auto block w-fit`,"data-slot":`field-separator-content`,children:n})]})}function FieldError({className:t,children:n,errors:i,...a}){let o=l(()=>{if(n)return n;if(!i?.length)return null;let e=[...new Map(i.map(e=>[e?.message,e])).values()];return e?.length===1?e[0]?.message:r(`ul`,{className:`ml-4 flex list-disc flex-col gap-1`,children:e.map(e=>e?.message&&r(`li`,{children:e.message},e.message))})},[n,i]);return o?r(`div`,{role:`alert`,"data-slot":`field-error`,className:e(`text-destructive text-sm font-normal`,t),...a,children:o}):null}export{Field,FieldContent,FieldDescription,FieldError,FieldGroup,FieldLabel,FieldLegend,FieldSeparator,FieldSet,FieldTitle,useFieldControlId};
|
|
2
2
|
//# sourceMappingURL=field.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field.js","names":[],"sources":["../../src/components/field.tsx"],"sourcesContent":["import { createContext, useContext, useId, useMemo } from 'react'\n\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nimport { cn } from '../lib/utils'\nimport { Label } from './label'\nimport { Separator } from './separator'\n\nexport type FieldSetProps = React.ComponentProps<'fieldset'>\n\nexport type FieldLegendProps = React.ComponentProps<'legend'> & { variant?: 'legend' | 'label' }\n\nexport type FieldGroupProps = React.ComponentProps<'div'>\n\nexport type FieldContentProps = React.ComponentProps<'div'>\n\nexport type FieldLabelProps = React.ComponentProps<typeof Label>\n\nexport type FieldTitleProps = React.ComponentProps<'div'>\n\nexport type FieldDescriptionProps = React.ComponentProps<'p'>\n\nexport type FieldSeparatorProps = React.ComponentProps<'div'> & {\n children?: React.ReactNode\n}\n\nexport type FieldErrorProps = React.ComponentProps<'div'> & {\n errors?: Array<{ message?: string } | undefined>\n}\n\ntype FieldContextValue = {\n controlId: string\n}\n\nconst FieldContext = createContext<FieldContextValue | null>(null)\n\nfunction useFieldControlId(id?: string) {\n const context = useContext(FieldContext)\n\n return id ?? context?.controlId\n}\n\nfunction FieldSet({ className, ...props }: FieldSetProps) {\n return (\n <fieldset\n data-slot=\"field-set\"\n className={cn(\n 'flex flex-col gap-4',\n 'has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction FieldLegend({ className, variant = 'legend', ...props }: FieldLegendProps) {\n return (\n <legend\n data-slot=\"field-legend\"\n data-variant={variant}\n className={cn('mb-1.5 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base', className)}\n {...props}\n />\n )\n}\n\nfunction FieldGroup({ className, ...props }: FieldGroupProps) {\n return (\n <div\n data-slot=\"field-group\"\n className={cn(\n 'group/field-group @container/field-group flex w-full flex-col gap-5',\n 'data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4',\n className\n )}\n {...props}\n />\n )\n}\n\nconst fieldVariants = cva('data-[invalid=true]:text-destructive gap-1 group/field flex w-full', {\n variants: {\n orientation: {\n vertical: 'flex-col *:w-full [&>.sr-only]:w-auto',\n horizontal:\n 'flex-row items-center *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px',\n responsive:\n 'flex-col *:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:*:data-[slot=field-label]:flex-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px'\n }\n },\n defaultVariants: {\n orientation: 'vertical'\n }\n})\n\nexport type FieldProps = React.ComponentProps<'div'> & VariantProps<typeof fieldVariants>\n\nfunction Field({ className, orientation = 'vertical', ...props }: FieldProps) {\n const controlId = useId()\n const contextValue = useMemo(() => ({ controlId }), [controlId])\n\n return (\n <FieldContext.Provider value={contextValue}>\n <div\n data-slot=\"field\"\n data-orientation={orientation}\n className={cn(fieldVariants({ orientation }), className)}\n {...props}\n />\n </FieldContext.Provider>\n )\n}\n\nfunction FieldContent({ className, ...props }: FieldContentProps) {\n return (\n <div\n data-slot=\"field-content\"\n className={cn('gap-0.5 group/field-content flex flex-1 flex-col leading-snug', className)}\n {...props}\n />\n )\n}\n\nfunction FieldLabel({ className, htmlFor, ...props }: FieldLabelProps) {\n const fieldControlId = useFieldControlId(htmlFor)\n\n return (\n <Label\n data-slot=\"field-label\"\n htmlFor={fieldControlId}\n className={cn(\n 'group/field-label peer/field-label flex w-fit gap-2 leading-snug',\n 'has-data-checked:bg-primary/5 has-data-checked:border-primary/30 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10',\n 'has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border *:data-[slot=field]:p-2.5',\n 'group-data-[disabled=true]/field:opacity-50',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction FieldTitle({ className, ...props }: FieldTitleProps) {\n return (\n <div\n data-slot=\"field-label\"\n className={cn(\n 'gap-2 text-sm font-medium group-data-[disabled=true]/field:opacity-50 flex w-fit items-center leading-snug',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction FieldDescription({ className, ...props }: FieldDescriptionProps) {\n return (\n <p\n data-slot=\"field-description\"\n className={cn(\n 'text-muted-foreground text-left text-
|
|
1
|
+
{"version":3,"file":"field.js","names":[],"sources":["../../src/components/field.tsx"],"sourcesContent":["import { createContext, useContext, useId, useMemo } from 'react'\n\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nimport { cn } from '../lib/utils'\nimport { Label } from './label'\nimport { Separator } from './separator'\n\nexport type FieldSetProps = React.ComponentProps<'fieldset'>\n\nexport type FieldLegendProps = React.ComponentProps<'legend'> & { variant?: 'legend' | 'label' }\n\nexport type FieldGroupProps = React.ComponentProps<'div'>\n\nexport type FieldContentProps = React.ComponentProps<'div'>\n\nexport type FieldLabelProps = React.ComponentProps<typeof Label>\n\nexport type FieldTitleProps = React.ComponentProps<'div'>\n\nexport type FieldDescriptionProps = React.ComponentProps<'p'>\n\nexport type FieldSeparatorProps = React.ComponentProps<'div'> & {\n children?: React.ReactNode\n}\n\nexport type FieldErrorProps = React.ComponentProps<'div'> & {\n errors?: Array<{ message?: string } | undefined>\n}\n\ntype FieldContextValue = {\n controlId: string\n}\n\nconst FieldContext = createContext<FieldContextValue | null>(null)\n\nfunction useFieldControlId(id?: string) {\n const context = useContext(FieldContext)\n\n return id ?? context?.controlId\n}\n\nfunction FieldSet({ className, ...props }: FieldSetProps) {\n return (\n <fieldset\n data-slot=\"field-set\"\n className={cn(\n 'flex flex-col gap-4',\n 'has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction FieldLegend({ className, variant = 'legend', ...props }: FieldLegendProps) {\n return (\n <legend\n data-slot=\"field-legend\"\n data-variant={variant}\n className={cn('mb-1.5 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base', className)}\n {...props}\n />\n )\n}\n\nfunction FieldGroup({ className, ...props }: FieldGroupProps) {\n return (\n <div\n data-slot=\"field-group\"\n className={cn(\n 'group/field-group @container/field-group flex w-full flex-col gap-5',\n 'data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4',\n className\n )}\n {...props}\n />\n )\n}\n\nconst fieldVariants = cva('data-[invalid=true]:text-destructive gap-1 group/field flex w-full', {\n variants: {\n orientation: {\n vertical: 'flex-col *:w-full [&>.sr-only]:w-auto',\n horizontal:\n 'flex-row items-center *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px',\n responsive:\n 'flex-col *:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:*:data-[slot=field-label]:flex-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px'\n }\n },\n defaultVariants: {\n orientation: 'vertical'\n }\n})\n\nexport type FieldProps = React.ComponentProps<'div'> & VariantProps<typeof fieldVariants>\n\nfunction Field({ className, orientation = 'vertical', ...props }: FieldProps) {\n const controlId = useId()\n const contextValue = useMemo(() => ({ controlId }), [controlId])\n\n return (\n <FieldContext.Provider value={contextValue}>\n <div\n data-slot=\"field\"\n data-orientation={orientation}\n className={cn(fieldVariants({ orientation }), className)}\n {...props}\n />\n </FieldContext.Provider>\n )\n}\n\nfunction FieldContent({ className, ...props }: FieldContentProps) {\n return (\n <div\n data-slot=\"field-content\"\n className={cn('gap-0.5 group/field-content flex flex-1 flex-col leading-snug', className)}\n {...props}\n />\n )\n}\n\nfunction FieldLabel({ className, htmlFor, ...props }: FieldLabelProps) {\n const fieldControlId = useFieldControlId(htmlFor)\n\n return (\n <Label\n data-slot=\"field-label\"\n htmlFor={fieldControlId}\n className={cn(\n 'group/field-label peer/field-label flex w-fit gap-2 leading-snug',\n 'has-data-checked:bg-primary/5 has-data-checked:border-primary/30 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10',\n 'has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border *:data-[slot=field]:p-2.5',\n 'group-data-[disabled=true]/field:opacity-50',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction FieldTitle({ className, ...props }: FieldTitleProps) {\n return (\n <div\n data-slot=\"field-label\"\n className={cn(\n 'gap-2 text-sm font-medium group-data-[disabled=true]/field:opacity-50 flex w-fit items-center leading-snug',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction FieldDescription({ className, ...props }: FieldDescriptionProps) {\n return (\n <p\n data-slot=\"field-description\"\n className={cn(\n 'text-muted-foreground text-left text-xs leading-normal font-normal',\n '[[data-variant=legend]+&]:-mt-1.5 group-has-data-horizontal/field:text-balance last:mt-0 nth-last-2:-mt-1',\n '[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction FieldSeparator({ children, className, ...props }: FieldSeparatorProps) {\n return (\n <div\n data-slot=\"field-separator\"\n data-content={!!children}\n className={cn('-my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2 relative', className)}\n {...props}\n >\n <Separator className=\"absolute inset-0 top-1/2\" />\n {children && (\n <span\n className=\"text-muted-foreground px-2 bg-background relative mx-auto block w-fit\"\n data-slot=\"field-separator-content\"\n >\n {children}\n </span>\n )}\n </div>\n )\n}\n\nfunction FieldError({ className, children, errors, ...props }: FieldErrorProps) {\n const content = useMemo(() => {\n if (children) {\n return children\n }\n\n if (!errors?.length) {\n return null\n }\n\n const uniqueErrors = [...new Map(errors.map((error) => [error?.message, error])).values()]\n\n if (uniqueErrors?.length === 1) {\n return uniqueErrors[0]?.message\n }\n\n return (\n <ul className=\"ml-4 flex list-disc flex-col gap-1\">\n {uniqueErrors.map((error) => error?.message && <li key={error.message}>{error.message}</li>)}\n </ul>\n )\n }, [children, errors])\n\n if (!content) {\n return null\n }\n\n return (\n <div\n role=\"alert\"\n data-slot=\"field-error\"\n className={cn('text-destructive text-sm font-normal', className)}\n {...props}\n >\n {content}\n </div>\n )\n}\n\nexport {\n Field,\n FieldContent,\n FieldDescription,\n FieldError,\n FieldGroup,\n FieldLabel,\n FieldLegend,\n FieldSeparator,\n FieldSet,\n FieldTitle,\n useFieldControlId\n}\n"],"mappings":"+TAkCA,MAAM,EAAe,EAAwC,IAAI,EAEjE,SAAS,kBAAkB,EAAa,CACtC,IAAM,EAAU,EAAW,CAAY,EAEvC,OAAO,GAAM,GAAS,SACxB,CAEA,SAAS,SAAS,CAAE,YAAW,GAAG,GAAwB,CACxD,OACE,EAAC,WAAD,CACE,YAAU,YACV,UAAW,EACT,sBACA,+EACA,CACF,EACA,GAAI,CACL,CAAA,CAEL,CAEA,SAAS,YAAY,CAAE,YAAW,UAAU,SAAU,GAAG,GAA2B,CAClF,OACE,EAAC,SAAD,CACE,YAAU,eACV,eAAc,EACd,UAAW,EAAG,kFAAmF,CAAS,EAC1G,GAAI,CACL,CAAA,CAEL,CAEA,SAAS,WAAW,CAAE,YAAW,GAAG,GAA0B,CAC5D,OACE,EAAC,MAAD,CACE,YAAU,cACV,UAAW,EACT,sEACA,mEACA,CACF,EACA,GAAI,CACL,CAAA,CAEL,CAEA,MAAM,EAAgB,EAAI,qEAAsE,CAC9F,SAAU,CACR,YAAa,CACX,SAAU,wCACV,WACE,iLACF,WACE,+TACJ,CACF,EACA,gBAAiB,CACf,YAAa,UACf,CACF,CAAC,EAID,SAAS,MAAM,CAAE,YAAW,cAAc,WAAY,GAAG,GAAqB,CAC5E,IAAM,EAAY,EAAM,EAClB,EAAe,OAAe,CAAE,WAAU,GAAI,CAAC,CAAS,CAAC,EAE/D,OACE,EAAC,EAAa,SAAd,CAAuB,MAAO,WAC5B,EAAC,MAAD,CACE,YAAU,QACV,mBAAkB,EAClB,UAAW,EAAG,EAAc,CAAE,aAAY,CAAC,EAAG,CAAS,EACvD,GAAI,CACL,CAAA,CACoB,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IAAK,GAAU,GAAO,SAAW,EAAC,KAAD,CAAA,SAAyB,EAAM,OAAY,EAAlC,EAAM,OAA4B,CAAC,CACzF,CAAA,CAER,EAAG,CAAC,EAAU,CAAM,CAAC,EAMrB,OAJK,EAKH,EAAC,MAAD,CACE,KAAK,QACL,YAAU,cACV,UAAW,EAAG,uCAAwC,CAAS,EAC/D,GAAI,WAEH,CACE,CAAA,EAXE,IAaX"}
|
|
@@ -5,10 +5,10 @@ import * as React from "react";
|
|
|
5
5
|
//#region src/components/flex.d.ts
|
|
6
6
|
declare const flexVariants: (props?: ({
|
|
7
7
|
direction?: "row" | "row-reverse" | "column" | "column-reverse" | null | undefined;
|
|
8
|
-
align?: "
|
|
9
|
-
justify?: "
|
|
8
|
+
align?: "end" | "center" | "start" | "baseline" | "stretch" | null | undefined;
|
|
9
|
+
justify?: "end" | "center" | "start" | "between" | "around" | "evenly" | null | undefined;
|
|
10
10
|
wrap?: boolean | null | undefined;
|
|
11
|
-
gap?: "
|
|
11
|
+
gap?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
12
12
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
13
13
|
type FlexProps = React.ComponentProps<'div'> & VariantProps<typeof flexVariants>;
|
|
14
14
|
declare function Flex({
|
|
@@ -4,9 +4,9 @@ import * as React from "react";
|
|
|
4
4
|
|
|
5
5
|
//#region src/components/group.d.ts
|
|
6
6
|
declare const groupVariants: (props?: ({
|
|
7
|
-
align?: "
|
|
8
|
-
justify?: "
|
|
9
|
-
gap?: "
|
|
7
|
+
align?: "end" | "center" | "start" | "baseline" | "stretch" | null | undefined;
|
|
8
|
+
justify?: "end" | "center" | "start" | "between" | "around" | "evenly" | null | undefined;
|
|
9
|
+
gap?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
10
10
|
wrap?: boolean | null | undefined;
|
|
11
11
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
12
12
|
type GroupProps = React.ComponentProps<'div'> & VariantProps<typeof groupVariants>;
|
|
@@ -4,7 +4,7 @@ import * as React from "react";
|
|
|
4
4
|
|
|
5
5
|
//#region src/components/heading.d.ts
|
|
6
6
|
declare const headingVariants: (props?: ({
|
|
7
|
-
size?: "
|
|
7
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
8
8
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
9
|
type HeadingProps = React.ComponentProps<'h2'> & VariantProps<typeof headingVariants> & {
|
|
10
10
|
asChild?: boolean;
|
|
@@ -23,7 +23,7 @@ declare function InputGroupAddon({
|
|
|
23
23
|
...props
|
|
24
24
|
}: InputGroupAddonProps): import("react/jsx-runtime").JSX.Element;
|
|
25
25
|
declare const inputGroupButtonVariants: (props?: ({
|
|
26
|
-
size?: "
|
|
26
|
+
size?: "xs" | "sm" | "icon-xs" | "icon-sm" | null | undefined;
|
|
27
27
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
28
28
|
declare function InputGroupButton({
|
|
29
29
|
className,
|
|
@@ -8,8 +8,8 @@ type InternalListItemProps = {
|
|
|
8
8
|
__index?: number;
|
|
9
9
|
};
|
|
10
10
|
declare const listVariants: (props?: ({
|
|
11
|
-
size?: "
|
|
12
|
-
spacing?: "
|
|
11
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
12
|
+
spacing?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
13
13
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
14
14
|
type ListProps = Omit<React.ComponentProps<'ul'>, 'ref' | 'type'> & Omit<React.ComponentProps<'ol'>, 'ref' | 'type'> & VariantProps<typeof listVariants> & {
|
|
15
15
|
type?: ListType;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunk-CHh1Zzun.js";import{Input as e}from"./input.js";import{
|
|
1
|
+
import"../chunk-CHh1Zzun.js";import{Input as e}from"./input.js";import{composeRefs as t}from"../lib/compose-refs.js";import{useMask as n}from"../hooks/use-mask.js";import{jsx as r}from"react/jsx-runtime";function MaskInput({ref:i,mask:a,replacement:o,showMask:s,separate:c,track:l,modify:u,...d}){let f=n({mask:a,replacement:o,showMask:s,separate:c,track:l,modify:u});return r(e,{"data-slot":`mask-input`,...d,ref:t(i,f)})}export{MaskInput};
|
|
2
2
|
//# sourceMappingURL=mask-input.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mask-input.js","names":[],"sources":["../../src/components/mask-input.tsx"],"sourcesContent":["import { type Modify, type Replacement, type Track, useMask } from '../hooks/use-mask'\nimport { Input, type InputProps } from './input'\n\nexport type MaskInputProps = InputProps & {\n mask: string\n replacement?: string | Replacement\n showMask?: boolean\n separate?: boolean\n track?: Track\n modify?: Modify\n}\n\nfunction MaskInput({ mask, replacement, showMask, separate, track, modify, ...props }: MaskInputProps) {\n const
|
|
1
|
+
{"version":3,"file":"mask-input.js","names":[],"sources":["../../src/components/mask-input.tsx"],"sourcesContent":["import { type Modify, type Replacement, type Track, useMask } from '../hooks/use-mask'\nimport { composeRefs } from '../lib/compose-refs'\nimport { Input, type InputProps } from './input'\n\nexport type MaskInputProps = InputProps & {\n mask: string\n replacement?: string | Replacement\n showMask?: boolean\n separate?: boolean\n track?: Track\n modify?: Modify\n}\n\nfunction MaskInput({ ref, mask, replacement, showMask, separate, track, modify, ...props }: MaskInputProps) {\n const maskRef = useMask({ mask, replacement, showMask, separate, track, modify })\n\n return <Input data-slot=\"mask-input\" {...props} ref={composeRefs<HTMLInputElement>(ref, maskRef)} />\n}\n\nexport { MaskInput }\n"],"mappings":"4MAaA,SAAS,UAAU,CAAE,MAAK,OAAM,cAAa,WAAU,WAAU,QAAO,SAAQ,GAAG,GAAyB,CAC1G,IAAM,EAAU,EAAQ,CAAE,OAAM,cAAa,WAAU,WAAU,QAAO,QAAO,CAAC,EAEhF,OAAO,EAAC,EAAD,CAAO,YAAU,aAAa,GAAI,EAAO,IAAK,EAA8B,EAAK,CAAO,CAAI,CAAA,CACrG"}
|
|
@@ -123,7 +123,7 @@ declare function SidebarMenuItem({
|
|
|
123
123
|
...props
|
|
124
124
|
}: SidebarMenuItemProps): import("react/jsx-runtime").JSX.Element;
|
|
125
125
|
declare const sidebarMenuButtonVariants: (props?: ({
|
|
126
|
-
variant?: "
|
|
126
|
+
variant?: "default" | "outline" | null | undefined;
|
|
127
127
|
size?: "sm" | "md" | "lg" | null | undefined;
|
|
128
128
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
129
129
|
type SidebarMenuButtonProps = React.ComponentProps<'button'> & {
|
|
@@ -4,9 +4,9 @@ import * as React from "react";
|
|
|
4
4
|
|
|
5
5
|
//#region src/components/stack.d.ts
|
|
6
6
|
declare const stackVariants: (props?: ({
|
|
7
|
-
align?: "
|
|
8
|
-
justify?: "
|
|
9
|
-
gap?: "
|
|
7
|
+
align?: "end" | "center" | "start" | "baseline" | "stretch" | null | undefined;
|
|
8
|
+
justify?: "end" | "center" | "start" | "between" | "around" | "evenly" | null | undefined;
|
|
9
|
+
gap?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
10
10
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
11
11
|
type StackProps = React.ComponentProps<'div'> & VariantProps<typeof stackVariants>;
|
|
12
12
|
declare function Stack({
|
|
@@ -7,7 +7,7 @@ type TableContainerProps = React.ComponentProps<'div'> & {
|
|
|
7
7
|
minWidth?: number | string;
|
|
8
8
|
};
|
|
9
9
|
declare const tableVariants: (props?: ({
|
|
10
|
-
variant?: "
|
|
10
|
+
variant?: "outline" | "line" | null | undefined;
|
|
11
11
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
12
12
|
type TableProps = React.ComponentProps<'table'> & VariantProps<typeof tableVariants> & {
|
|
13
13
|
striped?: boolean;
|
package/dist/components/tabs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{Tabs as t}from"radix-ui";import{jsx as n}from"react/jsx-runtime";import{cva as r}from"class-variance-authority";function Tabs({className:r,orientation:i=`horizontal`,...a}){return n(t.Root,{"data-slot":`tabs`,"data-orientation":i,className:e(`group/tabs flex gap-2 data-horizontal:flex-col`,r),...a})}const i=r(`group/tabs-list inline-flex items-center justify-start rounded-lg
|
|
1
|
+
import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{Tabs as t}from"radix-ui";import{jsx as n}from"react/jsx-runtime";import{cva as r}from"class-variance-authority";function Tabs({className:r,orientation:i=`horizontal`,...a}){return n(t.Root,{"data-slot":`tabs`,"data-orientation":i,className:e(`group/tabs flex gap-2 data-horizontal:flex-col`,r),...a})}const i=r(`group/tabs-list inline-flex items-center justify-start rounded-lg h-fit group-data-horizontal/tabs:w-full group-data-vertical/tabs:w-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{enclosed:`bg-muted p-0.75`,line:`gap-1 bg-transparent group-data-horizontal/tabs:border-b group-data-horizontal/tabs:border-b-border group-data-vertical/tabs:border-r group-data-vertical/tabs:border-r-border`}},defaultVariants:{variant:`line`}});function TabsList({className:r,variant:a=`line`,grow:o=!1,...s}){return n(t.List,{"data-slot":`tabs-list`,"data-variant":a,"data-grow":o,className:e(i({variant:a}),r),...s})}function TabsTrigger({className:r,...i}){return n(t.Trigger,{"data-slot":`tabs-trigger`,className:e(`relative inline-flex items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-normal whitespace-nowrap text-foreground transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:bg-muted focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 group-data-[variant=enclosed]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-horizontal/tabs:group-data-[grow=true]/tabs-list:flex-1`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-horizontal/tabs:group-data-[variant=line]/tabs-list:rounded-t-[8px] group-data-horizontal/tabs:group-data-[variant=line]/tabs-list:rounded-b-none group-data-vertical/tabs:group-data-[variant=line]/tabs-list:rounded-l-[8px] group-data-vertical/tabs:group-data-[variant=line]/tabs-list:rounded-r-none`,`group-data-[variant=line]/tabs-list:h-8 group-data-horizontal/tabs:group-data-[variant=line]/tabs-list:data-active:border-b-primary-500 group-data-vertical/tabs:group-data-[variant=line]/tabs-list:data-active:border-r-primary-500`,`group-data-[variant=enclosed]/tabs-list:h-[calc(100%-1px)] group-data-[variant=enclosed]/tabs-list:data-active:bg-background group-data-[variant=enclosed]/tabs-list:data-active:hover:bg-muted dark:group-data-[variant=enclosed]/tabs-list:data-active:border-input dark:group-data-[variant=enclosed]/tabs-list:data-active:bg-input/30`,r),...i})}function TabsContent({className:r,...i}){return n(t.Content,{"data-slot":`tabs-content`,className:e(`flex-1 text-sm outline-none`,r),...i})}export{Tabs,TabsContent,TabsList,TabsTrigger,i as tabsListVariants};
|
|
2
2
|
//# sourceMappingURL=tabs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.js","names":["TabsPrimitive"],"sources":["../../src/components/tabs.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { Tabs as TabsPrimitive } from 'radix-ui'\n\nimport { cn } from '../lib/utils'\n\nexport type TabsProps = React.ComponentProps<typeof TabsPrimitive.Root>\n\nfunction Tabs({ className, orientation = 'horizontal', ...props }: TabsProps) {\n return (\n <TabsPrimitive.Root\n data-slot=\"tabs\"\n data-orientation={orientation}\n className={cn('group/tabs flex gap-2 data-horizontal:flex-col', className)}\n {...props}\n />\n )\n}\n\nconst tabsListVariants = cva(\n 'group/tabs-list inline-flex items-center justify-start rounded-lg
|
|
1
|
+
{"version":3,"file":"tabs.js","names":["TabsPrimitive"],"sources":["../../src/components/tabs.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { Tabs as TabsPrimitive } from 'radix-ui'\n\nimport { cn } from '../lib/utils'\n\nexport type TabsProps = React.ComponentProps<typeof TabsPrimitive.Root>\n\nfunction Tabs({ className, orientation = 'horizontal', ...props }: TabsProps) {\n return (\n <TabsPrimitive.Root\n data-slot=\"tabs\"\n data-orientation={orientation}\n className={cn('group/tabs flex gap-2 data-horizontal:flex-col', className)}\n {...props}\n />\n )\n}\n\nconst tabsListVariants = cva(\n 'group/tabs-list inline-flex items-center justify-start rounded-lg h-fit group-data-horizontal/tabs:w-full group-data-vertical/tabs:w-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none',\n {\n variants: {\n variant: {\n enclosed: 'bg-muted p-0.75',\n line: 'gap-1 bg-transparent group-data-horizontal/tabs:border-b group-data-horizontal/tabs:border-b-border group-data-vertical/tabs:border-r group-data-vertical/tabs:border-r-border'\n }\n },\n defaultVariants: {\n variant: 'line'\n }\n }\n)\n\nexport type TabsListProps = React.ComponentProps<typeof TabsPrimitive.List> &\n VariantProps<typeof tabsListVariants> & {\n grow?: boolean\n }\n\nexport type TabsTriggerProps = React.ComponentProps<typeof TabsPrimitive.Trigger>\n\nexport type TabsContentProps = React.ComponentProps<typeof TabsPrimitive.Content>\n\nfunction TabsList({ className, variant = 'line', grow = false, ...props }: TabsListProps) {\n return (\n <TabsPrimitive.List\n data-slot=\"tabs-list\"\n data-variant={variant}\n data-grow={grow}\n className={cn(tabsListVariants({ variant }), className)}\n {...props}\n />\n )\n}\n\nfunction TabsTrigger({ className, ...props }: TabsTriggerProps) {\n return (\n <TabsPrimitive.Trigger\n data-slot=\"tabs-trigger\"\n className={cn(\n \"relative inline-flex items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-normal whitespace-nowrap text-foreground transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:bg-muted focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 group-data-[variant=enclosed]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n 'group-data-horizontal/tabs:group-data-[grow=true]/tabs-list:flex-1',\n 'group-data-[variant=line]/tabs-list:bg-transparent group-data-horizontal/tabs:group-data-[variant=line]/tabs-list:rounded-t-[8px] group-data-horizontal/tabs:group-data-[variant=line]/tabs-list:rounded-b-none group-data-vertical/tabs:group-data-[variant=line]/tabs-list:rounded-l-[8px] group-data-vertical/tabs:group-data-[variant=line]/tabs-list:rounded-r-none',\n 'group-data-[variant=line]/tabs-list:h-8 group-data-horizontal/tabs:group-data-[variant=line]/tabs-list:data-active:border-b-primary-500 group-data-vertical/tabs:group-data-[variant=line]/tabs-list:data-active:border-r-primary-500',\n 'group-data-[variant=enclosed]/tabs-list:h-[calc(100%-1px)] group-data-[variant=enclosed]/tabs-list:data-active:bg-background group-data-[variant=enclosed]/tabs-list:data-active:hover:bg-muted dark:group-data-[variant=enclosed]/tabs-list:data-active:border-input dark:group-data-[variant=enclosed]/tabs-list:data-active:bg-input/30',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction TabsContent({ className, ...props }: TabsContentProps) {\n return (\n <TabsPrimitive.Content\n data-slot=\"tabs-content\"\n className={cn('flex-1 text-sm outline-none', className)}\n {...props}\n />\n )\n}\n\nexport { Tabs, TabsContent, TabsList, TabsTrigger, tabsListVariants }\n"],"mappings":"yLASA,SAAS,KAAK,CAAE,YAAW,cAAc,aAAc,GAAG,GAAoB,CAC5E,OACE,EAACA,EAAc,KAAf,CACE,YAAU,OACV,mBAAkB,EAClB,UAAW,EAAG,iDAAkD,CAAS,EACzE,GAAI,CACL,CAAA,CAEL,CAEA,MAAM,EAAmB,EACvB,8MACA,CACE,SAAU,CACR,QAAS,CACP,SAAU,kBACV,KAAM,gLACR,CACF,EACA,gBAAiB,CACf,QAAS,MACX,CACF,CACF,EAWA,SAAS,SAAS,CAAE,YAAW,UAAU,OAAQ,OAAO,GAAO,GAAG,GAAwB,CACxF,OACE,EAACA,EAAc,KAAf,CACE,YAAU,YACV,eAAc,EACd,YAAW,EACX,UAAW,EAAG,EAAiB,CAAE,SAAQ,CAAC,EAAG,CAAS,EACtD,GAAI,CACL,CAAA,CAEL,CAEA,SAAS,YAAY,CAAE,YAAW,GAAG,GAA2B,CAC9D,OACE,EAACA,EAAc,QAAf,CACE,YAAU,eACV,UAAW,EACT,uoBACA,qEACA,2WACA,wOACA,6UACA,CACF,EACA,GAAI,CACL,CAAA,CAEL,CAEA,SAAS,YAAY,CAAE,YAAW,GAAG,GAA2B,CAC9D,OACE,EAACA,EAAc,QAAf,CACE,YAAU,eACV,UAAW,EAAG,8BAA+B,CAAS,EACtD,GAAI,CACL,CAAA,CAEL"}
|
|
@@ -4,7 +4,7 @@ import * as React from "react";
|
|
|
4
4
|
|
|
5
5
|
//#region src/components/text.d.ts
|
|
6
6
|
declare const textVariants: (props?: ({
|
|
7
|
-
size?: "
|
|
7
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
8
8
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
9
|
type TextProps = React.ComponentProps<'p'> & VariantProps<typeof textVariants> & {
|
|
10
10
|
asChild?: boolean;
|
|
@@ -8,10 +8,10 @@ declare const timelineVariants: (props?: ({
|
|
|
8
8
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
9
|
declare const timelineConnectorVariants: (props?: ({
|
|
10
10
|
status?: "pending" | "completed" | "in-progress" | null | undefined;
|
|
11
|
-
color?: "
|
|
11
|
+
color?: "destructive" | "primary" | "secondary" | "muted" | "accent" | "gradient" | null | undefined;
|
|
12
12
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
13
13
|
declare const timelineIconVariants: (props?: ({
|
|
14
|
-
color?: "
|
|
14
|
+
color?: "destructive" | "primary" | "secondary" | "muted" | "accent" | null | undefined;
|
|
15
15
|
size?: "sm" | "md" | "lg" | null | undefined;
|
|
16
16
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
17
17
|
type TimelineIconSize = NonNullable<VariantProps<typeof timelineIconVariants>['size']>;
|
package/dist/index.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ import { Checkbox, CheckboxProps } from "./components/checkbox.js";
|
|
|
21
21
|
import { Code, CodeProps } from "./components/code.js";
|
|
22
22
|
import { Collapsible, CollapsibleContent, CollapsibleContentProps, CollapsibleProps, CollapsibleTrigger, CollapsibleTriggerProps } from "./components/collapsible.js";
|
|
23
23
|
import { 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, useComboboxAnchor } from "./components/combobox.js";
|
|
24
|
-
import { Dialog, DialogClose, DialogCloseProps, DialogContent, DialogContentProps, DialogDescription, DialogDescriptionProps, DialogFooter, DialogFooterProps, DialogHeader, DialogHeaderProps, DialogOverlay, DialogOverlayProps, DialogPortal, DialogPortalProps, DialogProps, DialogTitle, DialogTitleProps, DialogTrigger, DialogTriggerProps } from "./components/dialog.js";
|
|
24
|
+
import { Dialog, DialogBody, DialogBodyProps, DialogClose, DialogCloseProps, DialogContent, DialogContentProps, DialogDescription, DialogDescriptionProps, DialogFooter, DialogFooterProps, DialogHeader, DialogHeaderProps, DialogOverlay, DialogOverlayProps, DialogPortal, DialogPortalProps, DialogProps, DialogTitle, DialogTitleProps, DialogTrigger, DialogTriggerProps } from "./components/dialog.js";
|
|
25
25
|
import { Command, CommandDialog, CommandDialogProps, CommandEmpty, CommandEmptyProps, CommandGroup, CommandGroupProps, CommandInput, CommandInputProps, CommandItem, CommandItemProps, CommandList, CommandListProps, CommandProps, CommandSeparator, CommandSeparatorProps, CommandShortcut, CommandShortcutProps } from "./components/command.js";
|
|
26
26
|
import { Container, ContainerProps, containerVariants } from "./components/container.js";
|
|
27
27
|
import { Table, TableBody, TableBodyProps, TableCaption, TableCaptionProps, TableCell, TableCellProps, TableContainer, TableContainerProps, TableFooter, TableFooterProps, TableHead, TableHeadProps, TableHeader, TableHeaderProps, TableProps, TableRow, TableRowProps, tableVariants } from "./components/table.js";
|
|
@@ -83,5 +83,6 @@ import { UseLocalStorageOptions, useLocalStorage } from "./hooks/use-local-stora
|
|
|
83
83
|
import { useIsMobile } from "./hooks/use-mobile.js";
|
|
84
84
|
import { BadgeColor, badgeColorVariants } from "./lib/badge.js";
|
|
85
85
|
import { ButtonColor, buttonColorVariants } from "./lib/button.js";
|
|
86
|
+
import { composeRefs, setRef } from "./lib/compose-refs.js";
|
|
86
87
|
import { cn, randomId } from "./lib/utils.js";
|
|
87
|
-
export { Accordion, AccordionContent, AccordionContentProps, AccordionItem, AccordionItemProps, AccordionProps, AccordionTrigger, AccordionTriggerProps, Alert, AlertAction, AlertActionProps, AlertDescription, AlertDescriptionProps, AlertDialog, AlertDialogAction, AlertDialogActionProps, AlertDialogCancel, AlertDialogCancelProps, AlertDialogContent, AlertDialogContentProps, AlertDialogDescription, AlertDialogDescriptionProps, AlertDialogFooter, AlertDialogFooterProps, AlertDialogHeader, AlertDialogHeaderProps, AlertDialogMedia, AlertDialogMediaProps, AlertDialogOverlay, AlertDialogOverlayProps, AlertDialogPortal, AlertDialogPortalProps, AlertDialogProps, AlertDialogTitle, AlertDialogTitleProps, AlertDialogTrigger, AlertDialogTriggerProps, AlertProps, AlertTitle, AlertTitleProps, Anchor, AnchorProps, AreaChart, AreaChartCurveType, AreaChartGridAxis, AreaChartProps, AreaChartSeries, AreaChartType, Avatar, AvatarBadge, AvatarBadgeProps, AvatarFallback, AvatarFallbackProps, AvatarGroup, AvatarGroupCount, AvatarGroupCountProps, AvatarGroupProps, AvatarImage, AvatarImageProps, AvatarProps, Badge, BadgeColor, BadgeProps, BarChart, BarChartGridAxis, BarChartOrientation, BarChartProps, BarChartSeries, BarChartType, Breadcrumb, BreadcrumbEllipsis, BreadcrumbEllipsisProps, BreadcrumbItem, BreadcrumbItemProps, BreadcrumbLink, BreadcrumbLinkProps, BreadcrumbList, BreadcrumbListProps, BreadcrumbPage, BreadcrumbPageProps, BreadcrumbProps, BreadcrumbSeparator, BreadcrumbSeparatorProps, Breakpoint, Button, ButtonColor, ButtonGroup, ButtonGroupProps, ButtonGroupSeparator, ButtonGroupSeparatorProps, ButtonGroupText, ButtonGroupTextProps, ButtonProps, 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, 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, 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, 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, containerVariants, createDataTableSelectColumn, defaultDataTableLabels, flexVariants, groupVariants, headingVariants, listVariants, locale, navigationMenuTriggerStyle, randomId, selectionControlColorVariants, 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 };
|
|
88
|
+
export { Accordion, AccordionContent, AccordionContentProps, AccordionItem, AccordionItemProps, AccordionProps, AccordionTrigger, AccordionTriggerProps, Alert, AlertAction, AlertActionProps, AlertDescription, AlertDescriptionProps, AlertDialog, AlertDialogAction, AlertDialogActionProps, AlertDialogCancel, AlertDialogCancelProps, AlertDialogContent, AlertDialogContentProps, AlertDialogDescription, AlertDialogDescriptionProps, AlertDialogFooter, AlertDialogFooterProps, AlertDialogHeader, AlertDialogHeaderProps, AlertDialogMedia, AlertDialogMediaProps, AlertDialogOverlay, AlertDialogOverlayProps, AlertDialogPortal, AlertDialogPortalProps, AlertDialogProps, AlertDialogTitle, AlertDialogTitleProps, AlertDialogTrigger, AlertDialogTriggerProps, AlertProps, AlertTitle, AlertTitleProps, Anchor, AnchorProps, AreaChart, AreaChartCurveType, AreaChartGridAxis, AreaChartProps, AreaChartSeries, AreaChartType, Avatar, AvatarBadge, AvatarBadgeProps, AvatarFallback, AvatarFallbackProps, AvatarGroup, AvatarGroupCount, AvatarGroupCountProps, AvatarGroupProps, AvatarImage, AvatarImageProps, AvatarProps, Badge, BadgeColor, BadgeProps, BarChart, BarChartGridAxis, BarChartOrientation, BarChartProps, BarChartSeries, BarChartType, Breadcrumb, BreadcrumbEllipsis, BreadcrumbEllipsisProps, BreadcrumbItem, BreadcrumbItemProps, BreadcrumbLink, BreadcrumbLinkProps, BreadcrumbList, BreadcrumbListProps, BreadcrumbPage, BreadcrumbPageProps, BreadcrumbProps, BreadcrumbSeparator, BreadcrumbSeparatorProps, Breakpoint, Button, ButtonColor, ButtonGroup, ButtonGroupProps, ButtonGroupSeparator, ButtonGroupSeparatorProps, ButtonGroupText, ButtonGroupTextProps, ButtonProps, 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, 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, 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, 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 };
|
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{ChartContainer as k,ChartLegend as A,ChartLegendContent as j,ChartStyle as M,ChartTooltip as N,ChartTooltipContent as P}from"./components/chart.js";import{AreaChart as F}from"./components/area-chart.js";import{Avatar as I,AvatarBadge as L,AvatarFallback as R,AvatarGroup as z,AvatarGroupCount as B,AvatarImage as V}from"./components/avatar.js";import{badgeColorVariants as H}from"./lib/badge.js";import{Badge as U,badgeVariants as W}from"./components/badge.js";import{BarChart as G}from"./components/bar-chart.js";import{Breadcrumb as K,BreadcrumbEllipsis as q,BreadcrumbItem as J,BreadcrumbLink as Y,BreadcrumbList as X,BreadcrumbPage as Z,BreadcrumbSeparator as Q}from"./components/breadcrumb.js";import{Separator as $}from"./components/separator.js";import{ButtonGroup as ee,ButtonGroupSeparator as te,ButtonGroupText as ne,buttonGroupVariants as re}from"./components/button-group.js";import{Calendar as ie,CalendarDayButton as ae,locale as oe}from"./components/calendar.js";import{Card as se,CardAction as ce,CardContent as le,CardDescription as ue,CardFooter as de,CardHeader as fe,CardTitle as pe}from"./components/card.js";import{Carousel as me,CarouselContent as he,CarouselIndicators as ge,CarouselItem as _e,CarouselNext as ve,CarouselPrevious as ye,useCarousel as be}from"./components/carousel.js";import{Center as xe,centerVariants as Se}from"./components/center.js";import{selectionControlColorVariants as Ce,uiColors as we}from"./lib/color.js";import{Label as Te}from"./components/label.js";import{Field as Ee,FieldContent as De,FieldDescription as Oe,FieldError as ke,FieldGroup as Ae,FieldLabel as je,FieldLegend as Me,FieldSeparator as Ne,FieldSet as Pe,FieldTitle as Fe,useFieldControlId as Ie}from"./components/field.js";import{Checkbox as Le}from"./components/checkbox.js";import{Code as Re}from"./components/code.js";import{Collapsible as ze,CollapsibleContent as Be,CollapsibleTrigger as Ve}from"./components/collapsible.js";import{Input as He}from"./components/input.js";import{Textarea as Ue}from"./components/textarea.js";import{InputGroup as We,InputGroupAddon as Ge,InputGroupButton as Ke,InputGroupInput as qe,InputGroupText as Je,InputGroupTextarea as Ye}from"./components/input-group.js";import{Combobox as Xe,ComboboxChip as Ze,ComboboxChips as Qe,ComboboxChipsInput as $e,ComboboxClear as et,ComboboxCollection as tt,ComboboxContent as nt,ComboboxEmpty as rt,ComboboxGroup as it,ComboboxInput as at,ComboboxItem as ot,ComboboxLabel as st,ComboboxList as ct,ComboboxSeparator as lt,ComboboxTrigger as ut,ComboboxValue as dt,useComboboxAnchor as ft}from"./components/combobox.js";import{Dialog as pt,DialogClose as mt,DialogContent as ht,DialogDescription as gt,DialogFooter as _t,DialogHeader as vt,DialogOverlay as yt,DialogPortal as bt,DialogTitle as xt,DialogTrigger as St}from"./components/dialog.js";import{Command as Ct,CommandDialog as wt,CommandEmpty as Tt,CommandGroup as Et,CommandInput as Dt,CommandItem as Ot,CommandList as kt,CommandSeparator as At,CommandShortcut as jt}from"./components/command.js";import{Container as Mt,containerVariants as Nt}from"./components/container.js";import{DropdownMenu as Pt,DropdownMenuCheckboxItem as Ft,DropdownMenuContent as It,DropdownMenuGroup as Lt,DropdownMenuItem as Rt,DropdownMenuLabel as zt,DropdownMenuPortal as Bt,DropdownMenuRadioGroup as Vt,DropdownMenuRadioItem as Ht,DropdownMenuSeparator as Ut,DropdownMenuShortcut as Wt,DropdownMenuSub as Gt,DropdownMenuSubContent as Kt,DropdownMenuSubTrigger as qt,DropdownMenuTrigger as Jt}from"./components/dropdown-menu.js";import{Select as Yt,SelectContent as Xt,SelectGroup as Zt,SelectItem as Qt,SelectLabel as $t,SelectScrollDownButton as en,SelectScrollUpButton as tn,SelectSeparator as nn,SelectTrigger as rn,SelectValue as an}from"./components/select.js";import{Table as on,TableBody as sn,TableCaption as cn,TableCell as ln,TableContainer as un,TableFooter as dn,TableHead as fn,TableHeader as pn,TableRow as mn,tableVariants as hn}from"./components/table.js";import{DataTable as gn,DataTableBody as _n,DataTableColumnHeader as vn,DataTableHeader as yn,DataTablePagination as bn,DataTableRoot as xn,DataTableToolbar as Sn,DataTableViewOptions as Cn,createDataTableSelectColumn as wn,defaultDataTableLabels as Tn,useDataTable as En,useDataTableContext as Dn}from"./components/data-table.js";import{Popover as On,PopoverAnchor as kn,PopoverContent as An,PopoverDescription as jn,PopoverHeader as Mn,PopoverTitle as Nn,PopoverTrigger as Pn}from"./components/popover.js";import{DateRangePicker as Fn,DateRangePickerActions as In,DateRangePickerApply as Ln,DateRangePickerCalendar as Rn,DateRangePickerContent as zn,DateRangePickerDateFields as Bn,DateRangePickerPreset as Vn,DateRangePickerPresets as Hn,DateRangePickerReset as Un,DateRangePickerTrigger as Wn,DateRangePickerValue as Gn}from"./components/date-range-picker.js";import{PieChart as Kn,PieChartBase as qn,buildPieConfig as Jn}from"./components/pie-chart.js";import{DonutChart as Yn}from"./components/donut-chart.js";import{Drawer as Xn,DrawerBody as Zn,DrawerClose as Qn,DrawerContent as $n,DrawerDescription as er,DrawerFooter as tr,DrawerHeader as nr,DrawerOverlay as rr,DrawerPortal as ir,DrawerTitle as ar,DrawerTrigger as or}from"./components/drawer.js";import{Dropzone as sr,DropzoneArea as cr,DropzoneDescription as lr,DropzoneFileList as ur,DropzoneFileListItem as dr,DropzoneFileMessage as fr,DropzoneMessage as pr,DropzoneRemoveFile as mr,DropzoneRetryFile as hr,DropzoneTrigger as gr,ErrorCode as _r,InfiniteProgress as vr,useDropzone as yr}from"./components/dropzone.js";import{Empty as br,EmptyContent as xr,EmptyDescription as Sr,EmptyHeader as Cr,EmptyMedia as wr,EmptyTitle as Tr}from"./components/empty.js";import{Flex as Er,flexVariants as Dr}from"./components/flex.js";import{Grid as Or,GridItem as kr}from"./components/grid.js";import{Group as Ar,groupVariants as jr}from"./components/group.js";import{Heading as Mr,headingVariants as Nr}from"./components/heading.js";import{HoverCard as Pr,HoverCardContent as Fr,HoverCardTrigger as Ir}from"./components/hover-card.js";import{InputOTP as Lr,InputOTPGroup as Rr,InputOTPSeparator as zr,InputOTPSlot as Br,REGEXP_ONLY_CHARS as Vr,REGEXP_ONLY_DIGITS as Hr,REGEXP_ONLY_DIGITS_AND_CHARS as Ur}from"./components/input-otp.js";import{Kbd as Wr,KbdGroup as Gr}from"./components/kbd.js";import{List as Kr,ListIcon as qr,ListItem as Jr,listVariants as Yr}from"./components/list.js";import{useMask as Xr}from"./hooks/use-mask.js";import{MaskInput as Zr}from"./components/mask-input.js";import{NativeSelect as Qr,NativeSelectOptGroup as $r,NativeSelectOption as ei}from"./components/native-select.js";import{NavigationMenu as ti,NavigationMenuContent as ni,NavigationMenuIndicator as ri,NavigationMenuItem as ii,NavigationMenuLink as ai,NavigationMenuList as oi,NavigationMenuTrigger as si,NavigationMenuViewport as ci,navigationMenuTriggerStyle as li}from"./components/navigation-menu.js";import{Pagination as ui,PaginationContent as di,PaginationEllipsis as fi,PaginationItem as pi,PaginationLink as mi,PaginationNext as hi,PaginationPrevious as gi}from"./components/pagination.js";import{Progress as _i}from"./components/progress.js";import{RadioGroup as vi,RadioGroupItem as yi}from"./components/radio-group.js";import{ResizableHandle as bi,ResizablePanel as xi,ResizablePanelGroup as Si}from"./components/resizable.js";import{ScrollArea as Ci,ScrollBar as wi}from"./components/scroll-area.js";import{useIsMobile as Ti}from"./hooks/use-mobile.js";import{Skeleton as Ei}from"./components/skeleton.js";import{Tooltip as Di,TooltipContent as Oi,TooltipProvider as ki,TooltipRoot as Ai,TooltipTrigger as ji}from"./components/tooltip.js";import{Sidebar as Mi,SidebarContent as Ni,SidebarFooter as Pi,SidebarGroup as Fi,SidebarGroupAction as Ii,SidebarGroupContent as Li,SidebarGroupLabel as Ri,SidebarHeader as zi,SidebarInput as Bi,SidebarInset as Vi,SidebarMenu as Hi,SidebarMenuAction as Ui,SidebarMenuBadge as Wi,SidebarMenuButton as Gi,SidebarMenuItem as Ki,SidebarMenuSkeleton as qi,SidebarMenuSub as Ji,SidebarMenuSubButton as Yi,SidebarMenuSubItem as Xi,SidebarProvider as Zi,SidebarRail as Qi,SidebarSeparator as $i,SidebarTrigger as ea,useSidebar as ta}from"./components/sidebar.js";import{SimpleGrid as na}from"./components/simple-grid.js";import{Slider as ra}from"./components/slider.js";import{Toaster as ia,toast as aa}from"./components/sonner.js";import{Stack as oa,stackVariants as sa}from"./components/stack.js";import{Switch as ca}from"./components/switch.js";import{Tabs as la,TabsContent as ua,TabsList as da,TabsTrigger as fa,tabsListVariants as pa}from"./components/tabs.js";import{Text as ma,textVariants as ha}from"./components/text.js";import{ModeToggle as ga,ThemeProvider as _a,useTheme as va}from"./components/theme.js";import{Timeline as ya,TimelineConnector as ba,TimelineContent as xa,TimelineDescription as Sa,TimelineEmpty as Ca,TimelineHeader as wa,TimelineIcon as Ta,TimelineItem as Ea,TimelineTime as Da,TimelineTitle as Oa,timelineVariants as ka}from"./components/timeline.js";import{Toggle as Aa,toggleVariants as ja}from"./components/toggle.js";import{ToggleGroup as Ma,ToggleGroupItem as Na}from"./components/toggle-group.js";import{UnstyledButton as Pa}from"./components/unstyled-button.js";import{breakpointValues as Fa,useBreakpoint as Ia}from"./hooks/use-breakpoint.js";import{HiddenFrom as La,VisibleFrom as Ra}from"./components/visibility.js";import{useBreakpointValue as za}from"./hooks/use-breakpoint-value.js";import{useDisclosure as Ba}from"./hooks/use-disclosure.js";import{useDocumentVisibility as Va}from"./hooks/use-document-visibility.js";import{useIdle as Ha}from"./hooks/use-idle.js";import{useInterval as Ua}from"./hooks/use-interval.js";import{useLocalStorage as Wa}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,F as AreaChart,I as Avatar,L as AvatarBadge,R as AvatarFallback,z as AvatarGroup,B as AvatarGroupCount,V as AvatarImage,U as Badge,G as BarChart,K as Breadcrumb,q as BreadcrumbEllipsis,J as BreadcrumbItem,Y as BreadcrumbLink,X as BreadcrumbList,Z as BreadcrumbPage,Q as BreadcrumbSeparator,p as Button,ee as ButtonGroup,te as ButtonGroupSeparator,ne as ButtonGroupText,ie as Calendar,ae as CalendarDayButton,se as Card,ce as CardAction,le as CardContent,ue as CardDescription,de as CardFooter,fe as CardHeader,pe as CardTitle,me as Carousel,he as CarouselContent,ge as CarouselIndicators,_e as CarouselItem,ve as CarouselNext,ye as CarouselPrevious,xe as Center,k as ChartContainer,A as ChartLegend,j as ChartLegendContent,M as ChartStyle,N as ChartTooltip,P as ChartTooltipContent,Le as Checkbox,Re as Code,ze as Collapsible,Be as CollapsibleContent,Ve as CollapsibleTrigger,Xe as Combobox,Ze as ComboboxChip,Qe as ComboboxChips,$e as ComboboxChipsInput,et as ComboboxClear,tt as ComboboxCollection,nt as ComboboxContent,rt as ComboboxEmpty,it as ComboboxGroup,at as ComboboxInput,ot as ComboboxItem,st as ComboboxLabel,ct as ComboboxList,lt as ComboboxSeparator,ut as ComboboxTrigger,dt as ComboboxValue,Ct as Command,wt as CommandDialog,Tt as CommandEmpty,Et as CommandGroup,Dt as CommandInput,Ot as CommandItem,kt as CommandList,At as CommandSeparator,jt as CommandShortcut,Mt as Container,gn as DataTable,_n as DataTableBody,vn as DataTableColumnHeader,yn as DataTableHeader,bn as DataTablePagination,xn as DataTableRoot,Sn as DataTableToolbar,Cn as DataTableViewOptions,Fn as DateRangePicker,In as DateRangePickerActions,Ln as DateRangePickerApply,Rn as DateRangePickerCalendar,zn as DateRangePickerContent,Bn as DateRangePickerDateFields,Vn as DateRangePickerPreset,Hn as DateRangePickerPresets,Un as DateRangePickerReset,Wn as DateRangePickerTrigger,Gn as DateRangePickerValue,pt as Dialog,mt as DialogClose,ht as DialogContent,gt as DialogDescription,_t as DialogFooter,vt as DialogHeader,yt as DialogOverlay,bt as DialogPortal,xt as DialogTitle,St as DialogTrigger,Yn as DonutChart,Xn as Drawer,Zn as DrawerBody,Qn as DrawerClose,$n as DrawerContent,er as DrawerDescription,tr as DrawerFooter,nr as DrawerHeader,rr as DrawerOverlay,ir as DrawerPortal,ar as DrawerTitle,or as DrawerTrigger,Pt as DropdownMenu,Ft as DropdownMenuCheckboxItem,It as DropdownMenuContent,Lt as DropdownMenuGroup,Rt as DropdownMenuItem,zt as DropdownMenuLabel,Bt as DropdownMenuPortal,Vt as DropdownMenuRadioGroup,Ht as DropdownMenuRadioItem,Ut as DropdownMenuSeparator,Wt as DropdownMenuShortcut,Gt as DropdownMenuSub,Kt as DropdownMenuSubContent,qt as DropdownMenuSubTrigger,Jt as DropdownMenuTrigger,sr as Dropzone,cr as DropzoneArea,lr as DropzoneDescription,ur as DropzoneFileList,dr as DropzoneFileListItem,fr as DropzoneFileMessage,pr as DropzoneMessage,mr as DropzoneRemoveFile,hr as DropzoneRetryFile,gr as DropzoneTrigger,br as Empty,xr as EmptyContent,Sr as EmptyDescription,Cr as EmptyHeader,wr as EmptyMedia,Tr as EmptyTitle,_r as ErrorCode,Ee as Field,De as FieldContent,Oe as FieldDescription,ke as FieldError,Ae as FieldGroup,je as FieldLabel,Me as FieldLegend,Ne as FieldSeparator,Pe as FieldSet,Fe as FieldTitle,Er as Flex,Or as Grid,kr as GridItem,Ar as Group,Mr as Heading,La as HiddenFrom,Pr as HoverCard,Fr as HoverCardContent,Ir as HoverCardTrigger,vr as InfiniteProgress,He as Input,We as InputGroup,Ge as InputGroupAddon,Ke as InputGroupButton,qe as InputGroupInput,Je as InputGroupText,Ye as InputGroupTextarea,Lr as InputOTP,Rr as InputOTPGroup,zr as InputOTPSeparator,Br as InputOTPSlot,Wr as Kbd,Gr as KbdGroup,Te as Label,Kr as List,qr as ListIcon,Jr as ListItem,Zr as MaskInput,ga as ModeToggle,Qr as NativeSelect,$r as NativeSelectOptGroup,ei as NativeSelectOption,ti as NavigationMenu,ni as NavigationMenuContent,ri as NavigationMenuIndicator,ii as NavigationMenuItem,ai as NavigationMenuLink,oi as NavigationMenuList,si as NavigationMenuTrigger,ci as NavigationMenuViewport,ui as Pagination,di as PaginationContent,fi as PaginationEllipsis,pi as PaginationItem,mi as PaginationLink,hi as PaginationNext,gi as PaginationPrevious,Kn as PieChart,qn as PieChartBase,On as Popover,kn as PopoverAnchor,An as PopoverContent,jn as PopoverDescription,Mn as PopoverHeader,Nn as PopoverTitle,Pn as PopoverTrigger,_i as Progress,Vr as REGEXP_ONLY_CHARS,Hr as REGEXP_ONLY_DIGITS,Ur as REGEXP_ONLY_DIGITS_AND_CHARS,vi as RadioGroup,yi as RadioGroupItem,bi as ResizableHandle,xi as ResizablePanel,Si as ResizablePanelGroup,Ci as ScrollArea,wi as ScrollBar,Yt as Select,Xt as SelectContent,Zt as SelectGroup,Qt as SelectItem,$t as SelectLabel,en as SelectScrollDownButton,tn as SelectScrollUpButton,nn as SelectSeparator,rn as SelectTrigger,an as SelectValue,$ as Separator,Mi as Sidebar,Ni as SidebarContent,Pi as SidebarFooter,Fi as SidebarGroup,Ii as SidebarGroupAction,Li as SidebarGroupContent,Ri as SidebarGroupLabel,zi as SidebarHeader,Bi as SidebarInput,Vi as SidebarInset,Hi as SidebarMenu,Ui as SidebarMenuAction,Wi as SidebarMenuBadge,Gi as SidebarMenuButton,Ki as SidebarMenuItem,qi as SidebarMenuSkeleton,Ji as SidebarMenuSub,Yi as SidebarMenuSubButton,Xi as SidebarMenuSubItem,Zi as SidebarProvider,Qi as SidebarRail,$i as SidebarSeparator,ea as SidebarTrigger,na as SimpleGrid,Ei as Skeleton,ra as Slider,d as Spinner,oa as Stack,ca as Switch,on as Table,sn as TableBody,cn as TableCaption,ln as TableCell,un as TableContainer,dn as TableFooter,fn as TableHead,pn as TableHeader,mn as TableRow,la as Tabs,ua as TabsContent,da as TabsList,fa as TabsTrigger,ma as Text,Ue as Textarea,_a as ThemeProvider,ya as Timeline,ba as TimelineConnector,xa as TimelineContent,Sa as TimelineDescription,Ca as TimelineEmpty,wa as TimelineHeader,Ta as TimelineIcon,Ea as TimelineItem,Da as TimelineTime,Oa as TimelineTitle,ia as Toaster,Aa as Toggle,Ma as ToggleGroup,Na as ToggleGroupItem,Di as Tooltip,Oi as TooltipContent,ki as TooltipProvider,Ai as TooltipRoot,ji as TooltipTrigger,Pa as UnstyledButton,Ra as VisibleFrom,O as anchorVariants,H as badgeColorVariants,W as badgeVariants,Fa as breakpointValues,Jn as buildPieConfig,u as buttonColorVariants,re as buttonGroupVariants,m as buttonVariants,Se as centerVariants,e as cn,Nt as containerVariants,wn as createDataTableSelectColumn,Tn as defaultDataTableLabels,Dr as flexVariants,jr as groupVariants,Nr as headingVariants,Yr as listVariants,oe as locale,li as navigationMenuTriggerStyle,t as randomId,Ce as selectionControlColorVariants,f as spinnerVariants,sa as stackVariants,hn as tableVariants,pa as tabsListVariants,ha as textVariants,ka as timelineVariants,aa as toast,ja as toggleVariants,we as uiColors,Ia as useBreakpoint,za as useBreakpointValue,be as useCarousel,ft as useComboboxAnchor,En as useDataTable,Dn as useDataTableContext,Ba as useDisclosure,Va as useDocumentVisibility,yr as useDropzone,Ie as useFieldControlId,Ha as useIdle,Ua as useInterval,Ti as useIsMobile,Wa as useLocalStorage,Xr as useMask,ta as useSidebar,va 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{ChartContainer as k,ChartLegend as A,ChartLegendContent as j,ChartStyle as M,ChartTooltip as N,ChartTooltipContent as P}from"./components/chart.js";import{AreaChart as F}from"./components/area-chart.js";import{Avatar as I,AvatarBadge as L,AvatarFallback as R,AvatarGroup as z,AvatarGroupCount as B,AvatarImage as V}from"./components/avatar.js";import{badgeColorVariants as H}from"./lib/badge.js";import{Badge as U,badgeVariants as W}from"./components/badge.js";import{BarChart as G}from"./components/bar-chart.js";import{Breadcrumb as K,BreadcrumbEllipsis as q,BreadcrumbItem as J,BreadcrumbLink as Y,BreadcrumbList as X,BreadcrumbPage as Z,BreadcrumbSeparator as Q}from"./components/breadcrumb.js";import{Separator as $}from"./components/separator.js";import{ButtonGroup as ee,ButtonGroupSeparator as te,ButtonGroupText as ne,buttonGroupVariants as re}from"./components/button-group.js";import{Calendar as ie,CalendarDayButton as ae,locale as oe}from"./components/calendar.js";import{Card as se,CardAction as ce,CardContent as le,CardDescription as ue,CardFooter as de,CardHeader as fe,CardTitle as pe}from"./components/card.js";import{Carousel as me,CarouselContent as he,CarouselIndicators as ge,CarouselItem as _e,CarouselNext as ve,CarouselPrevious as ye,useCarousel as be}from"./components/carousel.js";import{Center as xe,centerVariants as Se}from"./components/center.js";import{selectionControlColorVariants as Ce,uiColors as we}from"./lib/color.js";import{Label as Te}from"./components/label.js";import{Field as Ee,FieldContent as De,FieldDescription as Oe,FieldError as ke,FieldGroup as Ae,FieldLabel as je,FieldLegend as Me,FieldSeparator as Ne,FieldSet as Pe,FieldTitle as Fe,useFieldControlId as Ie}from"./components/field.js";import{Checkbox as Le}from"./components/checkbox.js";import{Code as Re}from"./components/code.js";import{Collapsible as ze,CollapsibleContent as Be,CollapsibleTrigger as Ve}from"./components/collapsible.js";import{Input as He}from"./components/input.js";import{Textarea as Ue}from"./components/textarea.js";import{InputGroup as We,InputGroupAddon as Ge,InputGroupButton as Ke,InputGroupInput as qe,InputGroupText as Je,InputGroupTextarea as Ye}from"./components/input-group.js";import{Combobox as Xe,ComboboxChip as Ze,ComboboxChips as Qe,ComboboxChipsInput as $e,ComboboxClear as et,ComboboxCollection as tt,ComboboxContent as nt,ComboboxEmpty as rt,ComboboxGroup as it,ComboboxInput as at,ComboboxItem as ot,ComboboxLabel as st,ComboboxList as ct,ComboboxSeparator as lt,ComboboxTrigger as ut,ComboboxValue as dt,useComboboxAnchor as ft}from"./components/combobox.js";import{Dialog as pt,DialogBody as mt,DialogClose as ht,DialogContent as gt,DialogDescription as _t,DialogFooter as vt,DialogHeader as yt,DialogOverlay as bt,DialogPortal as xt,DialogTitle as St,DialogTrigger as Ct}from"./components/dialog.js";import{Command as wt,CommandDialog as Tt,CommandEmpty as Et,CommandGroup as Dt,CommandInput as Ot,CommandItem as kt,CommandList as At,CommandSeparator as jt,CommandShortcut as Mt}from"./components/command.js";import{Container as Nt,containerVariants as Pt}from"./components/container.js";import{DropdownMenu as Ft,DropdownMenuCheckboxItem as It,DropdownMenuContent as Lt,DropdownMenuGroup as Rt,DropdownMenuItem as zt,DropdownMenuLabel as Bt,DropdownMenuPortal as Vt,DropdownMenuRadioGroup as Ht,DropdownMenuRadioItem as Ut,DropdownMenuSeparator as Wt,DropdownMenuShortcut as Gt,DropdownMenuSub as Kt,DropdownMenuSubContent as qt,DropdownMenuSubTrigger as Jt,DropdownMenuTrigger as Yt}from"./components/dropdown-menu.js";import{Select as Xt,SelectContent as Zt,SelectGroup as Qt,SelectItem as $t,SelectLabel as en,SelectScrollDownButton as tn,SelectScrollUpButton as nn,SelectSeparator as rn,SelectTrigger as an,SelectValue as on}from"./components/select.js";import{Table as sn,TableBody as cn,TableCaption as ln,TableCell as un,TableContainer as dn,TableFooter as fn,TableHead as pn,TableHeader as mn,TableRow as hn,tableVariants as gn}from"./components/table.js";import{DataTable as _n,DataTableBody as vn,DataTableColumnHeader as yn,DataTableHeader as bn,DataTablePagination as xn,DataTableRoot as Sn,DataTableToolbar as Cn,DataTableViewOptions as wn,createDataTableSelectColumn as Tn,defaultDataTableLabels as En,useDataTable as Dn,useDataTableContext as On}from"./components/data-table.js";import{Popover as kn,PopoverAnchor as An,PopoverContent as jn,PopoverDescription as Mn,PopoverHeader as Nn,PopoverTitle as Pn,PopoverTrigger as Fn}from"./components/popover.js";import{DateRangePicker as In,DateRangePickerActions as Ln,DateRangePickerApply as Rn,DateRangePickerCalendar as zn,DateRangePickerContent as Bn,DateRangePickerDateFields as Vn,DateRangePickerPreset as Hn,DateRangePickerPresets as Un,DateRangePickerReset as Wn,DateRangePickerTrigger as Gn,DateRangePickerValue as Kn}from"./components/date-range-picker.js";import{PieChart as qn,PieChartBase as Jn,buildPieConfig as Yn}from"./components/pie-chart.js";import{DonutChart as Xn}from"./components/donut-chart.js";import{Drawer as Zn,DrawerBody as Qn,DrawerClose as $n,DrawerContent as er,DrawerDescription as tr,DrawerFooter as nr,DrawerHeader as rr,DrawerOverlay as ir,DrawerPortal as ar,DrawerTitle as or,DrawerTrigger as sr}from"./components/drawer.js";import{composeRefs as cr,setRef as lr}from"./lib/compose-refs.js";import{Dropzone as ur,DropzoneArea as dr,DropzoneDescription as fr,DropzoneFileList as pr,DropzoneFileListItem as mr,DropzoneFileMessage as hr,DropzoneMessage as gr,DropzoneRemoveFile as _r,DropzoneRetryFile as vr,DropzoneTrigger as yr,ErrorCode as br,InfiniteProgress as xr,useDropzone as Sr}from"./components/dropzone.js";import{Empty as Cr,EmptyContent as wr,EmptyDescription as Tr,EmptyHeader as Er,EmptyMedia as Dr,EmptyTitle as Or}from"./components/empty.js";import{Flex as kr,flexVariants as Ar}from"./components/flex.js";import{Grid as jr,GridItem as Mr}from"./components/grid.js";import{Group as Nr,groupVariants as Pr}from"./components/group.js";import{Heading as Fr,headingVariants as Ir}from"./components/heading.js";import{HoverCard as Lr,HoverCardContent as Rr,HoverCardTrigger as zr}from"./components/hover-card.js";import{InputOTP as Br,InputOTPGroup as Vr,InputOTPSeparator as Hr,InputOTPSlot as Ur,REGEXP_ONLY_CHARS as Wr,REGEXP_ONLY_DIGITS as Gr,REGEXP_ONLY_DIGITS_AND_CHARS as Kr}from"./components/input-otp.js";import{Kbd as qr,KbdGroup as Jr}from"./components/kbd.js";import{List as Yr,ListIcon as Xr,ListItem as Zr,listVariants as Qr}from"./components/list.js";import{useMask as $r}from"./hooks/use-mask.js";import{MaskInput as ei}from"./components/mask-input.js";import{NativeSelect as ti,NativeSelectOptGroup as ni,NativeSelectOption as ri}from"./components/native-select.js";import{NavigationMenu as ii,NavigationMenuContent as ai,NavigationMenuIndicator as oi,NavigationMenuItem as si,NavigationMenuLink as ci,NavigationMenuList as li,NavigationMenuTrigger as ui,NavigationMenuViewport as di,navigationMenuTriggerStyle as fi}from"./components/navigation-menu.js";import{Pagination as pi,PaginationContent as mi,PaginationEllipsis as hi,PaginationItem as gi,PaginationLink as _i,PaginationNext as vi,PaginationPrevious as yi}from"./components/pagination.js";import{Progress as bi}from"./components/progress.js";import{RadioGroup as xi,RadioGroupItem as Si}from"./components/radio-group.js";import{ResizableHandle as Ci,ResizablePanel as wi,ResizablePanelGroup as Ti}from"./components/resizable.js";import{ScrollArea as Ei,ScrollBar as Di}from"./components/scroll-area.js";import{useIsMobile as Oi}from"./hooks/use-mobile.js";import{Skeleton as ki}from"./components/skeleton.js";import{Tooltip as Ai,TooltipContent as ji,TooltipProvider as Mi,TooltipRoot as Ni,TooltipTrigger as Pi}from"./components/tooltip.js";import{Sidebar as Fi,SidebarContent as Ii,SidebarFooter as Li,SidebarGroup as Ri,SidebarGroupAction as zi,SidebarGroupContent as Bi,SidebarGroupLabel as Vi,SidebarHeader as Hi,SidebarInput as Ui,SidebarInset as Wi,SidebarMenu as Gi,SidebarMenuAction as Ki,SidebarMenuBadge as qi,SidebarMenuButton as Ji,SidebarMenuItem as Yi,SidebarMenuSkeleton as Xi,SidebarMenuSub as Zi,SidebarMenuSubButton as Qi,SidebarMenuSubItem as $i,SidebarProvider as ea,SidebarRail as ta,SidebarSeparator as na,SidebarTrigger as ra,useSidebar as ia}from"./components/sidebar.js";import{SimpleGrid as aa}from"./components/simple-grid.js";import{Slider as oa}from"./components/slider.js";import{Toaster as sa,toast as ca}from"./components/sonner.js";import{Stack as la,stackVariants as ua}from"./components/stack.js";import{Switch as da}from"./components/switch.js";import{Tabs as fa,TabsContent as pa,TabsList as ma,TabsTrigger as ha,tabsListVariants as ga}from"./components/tabs.js";import{Text as _a,textVariants as va}from"./components/text.js";import{ModeToggle as ya,ThemeProvider as ba,useTheme as xa}from"./components/theme.js";import{Timeline as Sa,TimelineConnector as Ca,TimelineContent as wa,TimelineDescription as Ta,TimelineEmpty as Ea,TimelineHeader as Da,TimelineIcon as Oa,TimelineItem as ka,TimelineTime as Aa,TimelineTitle as ja,timelineVariants as Ma}from"./components/timeline.js";import{Toggle as Na,toggleVariants as Pa}from"./components/toggle.js";import{ToggleGroup as Fa,ToggleGroupItem as Ia}from"./components/toggle-group.js";import{UnstyledButton as La}from"./components/unstyled-button.js";import{breakpointValues as Ra,useBreakpoint as za}from"./hooks/use-breakpoint.js";import{HiddenFrom as Ba,VisibleFrom as Va}from"./components/visibility.js";import{useBreakpointValue as Ha}from"./hooks/use-breakpoint-value.js";import{useDisclosure as Ua}from"./hooks/use-disclosure.js";import{useDocumentVisibility as Wa}from"./hooks/use-document-visibility.js";import{useIdle as Ga}from"./hooks/use-idle.js";import{useInterval as Ka}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,F as AreaChart,I as Avatar,L as AvatarBadge,R as AvatarFallback,z as AvatarGroup,B as AvatarGroupCount,V as AvatarImage,U as Badge,G as BarChart,K as Breadcrumb,q as BreadcrumbEllipsis,J as BreadcrumbItem,Y as BreadcrumbLink,X as BreadcrumbList,Z as BreadcrumbPage,Q as BreadcrumbSeparator,p as Button,ee as ButtonGroup,te as ButtonGroupSeparator,ne as ButtonGroupText,ie as Calendar,ae as CalendarDayButton,se as Card,ce as CardAction,le as CardContent,ue as CardDescription,de as CardFooter,fe as CardHeader,pe as CardTitle,me as Carousel,he as CarouselContent,ge as CarouselIndicators,_e as CarouselItem,ve as CarouselNext,ye as CarouselPrevious,xe as Center,k as ChartContainer,A as ChartLegend,j as ChartLegendContent,M as ChartStyle,N as ChartTooltip,P as ChartTooltipContent,Le as Checkbox,Re as Code,ze as Collapsible,Be as CollapsibleContent,Ve as CollapsibleTrigger,Xe as Combobox,Ze as ComboboxChip,Qe as ComboboxChips,$e as ComboboxChipsInput,et as ComboboxClear,tt as ComboboxCollection,nt as ComboboxContent,rt as ComboboxEmpty,it as ComboboxGroup,at as ComboboxInput,ot as ComboboxItem,st as ComboboxLabel,ct as ComboboxList,lt as ComboboxSeparator,ut as ComboboxTrigger,dt as ComboboxValue,wt as Command,Tt as CommandDialog,Et as CommandEmpty,Dt as CommandGroup,Ot as CommandInput,kt as CommandItem,At as CommandList,jt as CommandSeparator,Mt as CommandShortcut,Nt as Container,_n as DataTable,vn as DataTableBody,yn as DataTableColumnHeader,bn as DataTableHeader,xn as DataTablePagination,Sn as DataTableRoot,Cn as DataTableToolbar,wn as DataTableViewOptions,In as DateRangePicker,Ln as DateRangePickerActions,Rn as DateRangePickerApply,zn as DateRangePickerCalendar,Bn as DateRangePickerContent,Vn as DateRangePickerDateFields,Hn as DateRangePickerPreset,Un as DateRangePickerPresets,Wn as DateRangePickerReset,Gn as DateRangePickerTrigger,Kn as DateRangePickerValue,pt as Dialog,mt as DialogBody,ht as DialogClose,gt as DialogContent,_t as DialogDescription,vt as DialogFooter,yt as DialogHeader,bt as DialogOverlay,xt as DialogPortal,St as DialogTitle,Ct as DialogTrigger,Xn as DonutChart,Zn as Drawer,Qn as DrawerBody,$n as DrawerClose,er as DrawerContent,tr as DrawerDescription,nr as DrawerFooter,rr as DrawerHeader,ir as DrawerOverlay,ar as DrawerPortal,or as DrawerTitle,sr as DrawerTrigger,Ft as DropdownMenu,It as DropdownMenuCheckboxItem,Lt as DropdownMenuContent,Rt as DropdownMenuGroup,zt as DropdownMenuItem,Bt as DropdownMenuLabel,Vt as DropdownMenuPortal,Ht as DropdownMenuRadioGroup,Ut as DropdownMenuRadioItem,Wt as DropdownMenuSeparator,Gt as DropdownMenuShortcut,Kt as DropdownMenuSub,qt as DropdownMenuSubContent,Jt as DropdownMenuSubTrigger,Yt as DropdownMenuTrigger,ur as Dropzone,dr as DropzoneArea,fr as DropzoneDescription,pr as DropzoneFileList,mr as DropzoneFileListItem,hr as DropzoneFileMessage,gr as DropzoneMessage,_r as DropzoneRemoveFile,vr as DropzoneRetryFile,yr as DropzoneTrigger,Cr as Empty,wr as EmptyContent,Tr as EmptyDescription,Er as EmptyHeader,Dr as EmptyMedia,Or as EmptyTitle,br as ErrorCode,Ee as Field,De as FieldContent,Oe as FieldDescription,ke as FieldError,Ae as FieldGroup,je as FieldLabel,Me as FieldLegend,Ne as FieldSeparator,Pe as FieldSet,Fe as FieldTitle,kr as Flex,jr as Grid,Mr as GridItem,Nr as Group,Fr as Heading,Ba as HiddenFrom,Lr as HoverCard,Rr as HoverCardContent,zr as HoverCardTrigger,xr as InfiniteProgress,He as Input,We as InputGroup,Ge as InputGroupAddon,Ke as InputGroupButton,qe as InputGroupInput,Je as InputGroupText,Ye as InputGroupTextarea,Br as InputOTP,Vr as InputOTPGroup,Hr as InputOTPSeparator,Ur as InputOTPSlot,qr as Kbd,Jr as KbdGroup,Te as Label,Yr as List,Xr as ListIcon,Zr as ListItem,ei as MaskInput,ya as ModeToggle,ti as NativeSelect,ni as NativeSelectOptGroup,ri as NativeSelectOption,ii as NavigationMenu,ai as NavigationMenuContent,oi as NavigationMenuIndicator,si as NavigationMenuItem,ci as NavigationMenuLink,li as NavigationMenuList,ui as NavigationMenuTrigger,di as NavigationMenuViewport,pi as Pagination,mi as PaginationContent,hi as PaginationEllipsis,gi as PaginationItem,_i as PaginationLink,vi as PaginationNext,yi as PaginationPrevious,qn as PieChart,Jn as PieChartBase,kn as Popover,An as PopoverAnchor,jn as PopoverContent,Mn as PopoverDescription,Nn as PopoverHeader,Pn as PopoverTitle,Fn as PopoverTrigger,bi as Progress,Wr as REGEXP_ONLY_CHARS,Gr as REGEXP_ONLY_DIGITS,Kr as REGEXP_ONLY_DIGITS_AND_CHARS,xi as RadioGroup,Si as RadioGroupItem,Ci as ResizableHandle,wi as ResizablePanel,Ti as ResizablePanelGroup,Ei as ScrollArea,Di as ScrollBar,Xt as Select,Zt as SelectContent,Qt as SelectGroup,$t as SelectItem,en as SelectLabel,tn as SelectScrollDownButton,nn as SelectScrollUpButton,rn as SelectSeparator,an as SelectTrigger,on as SelectValue,$ as Separator,Fi as Sidebar,Ii as SidebarContent,Li as SidebarFooter,Ri as SidebarGroup,zi as SidebarGroupAction,Bi as SidebarGroupContent,Vi as SidebarGroupLabel,Hi as SidebarHeader,Ui as SidebarInput,Wi as SidebarInset,Gi as SidebarMenu,Ki as SidebarMenuAction,qi as SidebarMenuBadge,Ji as SidebarMenuButton,Yi as SidebarMenuItem,Xi as SidebarMenuSkeleton,Zi as SidebarMenuSub,Qi as SidebarMenuSubButton,$i as SidebarMenuSubItem,ea as SidebarProvider,ta as SidebarRail,na as SidebarSeparator,ra as SidebarTrigger,aa as SimpleGrid,ki as Skeleton,oa as Slider,d as Spinner,la as Stack,da as Switch,sn as Table,cn as TableBody,ln as TableCaption,un as TableCell,dn as TableContainer,fn as TableFooter,pn as TableHead,mn as TableHeader,hn as TableRow,fa as Tabs,pa as TabsContent,ma as TabsList,ha as TabsTrigger,_a as Text,Ue as Textarea,ba as ThemeProvider,Sa as Timeline,Ca as TimelineConnector,wa as TimelineContent,Ta as TimelineDescription,Ea as TimelineEmpty,Da as TimelineHeader,Oa as TimelineIcon,ka as TimelineItem,Aa as TimelineTime,ja as TimelineTitle,sa as Toaster,Na as Toggle,Fa as ToggleGroup,Ia as ToggleGroupItem,Ai as Tooltip,ji as TooltipContent,Mi as TooltipProvider,Ni as TooltipRoot,Pi as TooltipTrigger,La as UnstyledButton,Va as VisibleFrom,O as anchorVariants,H as badgeColorVariants,W as badgeVariants,Ra as breakpointValues,Yn as buildPieConfig,u as buttonColorVariants,re as buttonGroupVariants,m as buttonVariants,Se as centerVariants,e as cn,cr as composeRefs,Pt as containerVariants,Tn as createDataTableSelectColumn,En as defaultDataTableLabels,Ar as flexVariants,Pr as groupVariants,Ir as headingVariants,Qr as listVariants,oe as locale,fi as navigationMenuTriggerStyle,t as randomId,Ce as selectionControlColorVariants,lr as setRef,f as spinnerVariants,ua as stackVariants,gn as tableVariants,ga as tabsListVariants,va as textVariants,Ma as timelineVariants,ca as toast,Pa as toggleVariants,we as uiColors,za as useBreakpoint,Ha as useBreakpointValue,be as useCarousel,ft as useComboboxAnchor,Dn as useDataTable,On as useDataTableContext,Ua as useDisclosure,Wa as useDocumentVisibility,Sr as useDropzone,Ie as useFieldControlId,Ga as useIdle,Ka as useInterval,Oi as useIsMobile,qa as useLocalStorage,$r as useMask,ia as useSidebar,xa as useTheme};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { n as __name } from "../chunk-CHh1Zzun.js";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/lib/compose-refs.d.ts
|
|
5
|
+
declare function setRef<T>(ref: React.Ref<T> | undefined, value: T | null): void;
|
|
6
|
+
declare function composeRefs<T>(...refs: Array<React.Ref<T> | undefined>): React.RefCallback<T>;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { composeRefs, setRef };
|
|
9
|
+
//# sourceMappingURL=compose-refs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compose-refs.js","names":[],"sources":["../../src/lib/compose-refs.ts"],"sourcesContent":["import type * as React from 'react'\n\nexport function setRef<T>(ref: React.Ref<T> | undefined, value: T | null) {\n if (typeof ref === 'function') {\n ref(value)\n return\n }\n\n if (ref) {\n ref.current = value\n }\n}\n\nexport function composeRefs<T>(...refs: Array<React.Ref<T> | undefined>): React.RefCallback<T> {\n return (value) => {\n refs.forEach((ref) => {\n setRef(ref, value)\n })\n }\n}\n"],"mappings":"6BAEA,SAAgB,OAAU,EAA+B,EAAiB,CACxE,GAAI,OAAO,GAAQ,WAAY,CAC7B,EAAI,CAAK,EACT,MACF,CAEI,IACF,EAAI,QAAU,EAElB,CAEA,SAAgB,YAAe,GAAG,EAA6D,CAC7F,MAAQ,IAAU,CAChB,EAAK,QAAS,GAAQ,CACpB,OAAO,EAAK,CAAK,CACnB,CAAC,CACH,CACF"}
|
|
@@ -61,6 +61,10 @@ Unless noted otherwise, each module also exports its public `*Props` types from
|
|
|
61
61
|
- Import path: `@uselets/ui/lib/color`
|
|
62
62
|
- Exports: `uiColors`, `UIColor`, `selectionControlColorVariants`
|
|
63
63
|
- Notes: canonical public color list used by `Button`, `Toggle`, `Checkbox`, `RadioGroupItem`, and `Switch`; `ButtonColor` is a compatibility alias for `UIColor`; `selectionControlColorVariants` is an internal styling map for checked selection controls
|
|
64
|
+
- `compose-refs`
|
|
65
|
+
- Import path: `@uselets/ui/lib/compose-refs`
|
|
66
|
+
- Exports: `composeRefs`, `setRef`
|
|
67
|
+
- Notes: helpers for composing multiple refs into a single callback ref. Use `composeRefs<T>(...refs)` when a component needs to merge a forwarded `ref` with an internal one (for example, `MaskInput` composes the consumer `ref` with the internal mask ref)
|
|
64
68
|
- `sonner`
|
|
65
69
|
- Import path: `@uselets/ui/sonner`
|
|
66
70
|
- Exports: `Toaster`, `toast`
|
|
@@ -104,7 +108,7 @@ Unless noted otherwise, each module also exports its public `*Props` types from
|
|
|
104
108
|
- Notes: pill-shaped tag with `size: 'xs' | 'sm' | 'md' | 'lg' | 'xl'` (default `md`), `solid`/`outline`/`subtle`/`ghost`/`link` variants, `color: UIColor` (`primary` default), and `asChild`
|
|
105
109
|
- `button`
|
|
106
110
|
- Exports: `Button`, `buttonVariants`
|
|
107
|
-
- Notes: action button with `solid`, `outline`, `subtle`, `ghost`, and `link` variants, `color: UIColor` (`primary` default), sizes from `xs` through `xl` plus icon sizes through `icon-xl`, and `loading`
|
|
111
|
+
- Notes: action button with `solid`, `secondary`, `outline`, `subtle`, `ghost`, and `link` variants, `color: UIColor` (`primary` default), sizes from `xs` through `xl` plus icon sizes through `icon-xl`, and `loading`
|
|
108
112
|
- `button-group`
|
|
109
113
|
- Exports: `ButtonGroup`, `ButtonGroupSeparator`, `ButtonGroupText`, `buttonGroupVariants`
|
|
110
114
|
- `empty`
|
|
@@ -142,7 +146,7 @@ Unless noted otherwise, each module also exports its public `*Props` types from
|
|
|
142
146
|
- Exports: `InputOTP`, `InputOTPGroup`, `InputOTPSeparator`, `InputOTPSlot`, `REGEXP_ONLY_CHARS`, `REGEXP_ONLY_DIGITS`, `REGEXP_ONLY_DIGITS_AND_CHARS`
|
|
143
147
|
- `mask-input`
|
|
144
148
|
- Exports: `MaskInput`
|
|
145
|
-
- Notes: formatted input backed by `@react-input/mask`. Required prop `mask`; optional `replacement` (string or `Record<string, RegExp>`), `showMask`, `separate`, `track`, `modify`. Default replacement tokens are `9` (digit), `a` (letter), `*` (any). Renders the standard `Input`, so `Field`/`FieldLabel` and all native `<input>` props work as usual.
|
|
149
|
+
- Notes: formatted input backed by `@react-input/mask`. Required prop `mask`; optional `replacement` (string or `Record<string, RegExp>`), `showMask`, `separate`, `track`, `modify`. Default replacement tokens are `9` (digit), `a` (letter), `*` (any). Renders the standard `Input`, so `Field`/`FieldLabel` and all native `<input>` props work as usual. Forwards a `ref` prop to the underlying `<input>`, composed with the internal mask ref via `composeRefs`.
|
|
146
150
|
- `checkbox`
|
|
147
151
|
- Exports: `Checkbox`
|
|
148
152
|
- Notes: supports `size: 'sm' | 'md' | 'lg'`, `color: UIColor` (default `primary`), `label?: React.ReactNode`, `labelProps`, and automatic `id`/`htmlFor` wiring when a label is provided without an explicit `id`; composed label text follows checkbox size (`sm` 12px, `md` 14px, `lg` 20px)
|
|
@@ -181,7 +185,8 @@ Unless noted otherwise, each module also exports its public `*Props` types from
|
|
|
181
185
|
## Overlays and floating UI
|
|
182
186
|
|
|
183
187
|
- `dialog`
|
|
184
|
-
- Exports: `Dialog`, `DialogClose`, `DialogContent`, `DialogDescription`, `DialogFooter`, `DialogHeader`, `DialogOverlay`, `DialogPortal`, `DialogTitle`, `DialogTrigger`
|
|
188
|
+
- Exports: `Dialog`, `DialogBody`, `DialogClose`, `DialogContent`, `DialogDescription`, `DialogFooter`, `DialogHeader`, `DialogOverlay`, `DialogPortal`, `DialogTitle`, `DialogTrigger`
|
|
189
|
+
- Notes: `Dialog` supports `size: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'full'` with default `md`; `full` occupies the entire viewport. `DialogContent` caps its height at `calc(100dvh - 2rem)` and lays out children as a flex column. For long content, wrap the middle in `DialogBody` (`flex-1 overflow-y-auto`) so the body scrolls while `DialogHeader` and `DialogFooter` remain pinned; for short content, omit `DialogBody`. `DialogContent.showCloseButton` defaults to `true`; `DialogFooter.showCloseButton` defaults to `false`
|
|
185
190
|
- `drawer`
|
|
186
191
|
- Exports: `Drawer`, `DrawerBody`, `DrawerClose`, `DrawerContent`, `DrawerDescription`, `DrawerFooter`, `DrawerHeader`, `DrawerOverlay`, `DrawerPortal`, `DrawerTitle`, `DrawerTrigger`
|
|
187
192
|
- Notes: `Drawer` supports `size: 'sm' | 'md' | 'lg' | 'xl'` with default `md`; `DrawerBody` provides padded auto-scroll content; `DrawerFooter` stacks actions on mobile and aligns them to the end on larger breakpoints; `DrawerContent.showCloseButton` controls the automatic close button and defaults to `true`
|
|
@@ -281,7 +281,7 @@ Additional tokens:
|
|
|
281
281
|
- `text-destructive-foreground`
|
|
282
282
|
- `--gradient-primary`
|
|
283
283
|
|
|
284
|
-
The `Button` component can apply those palette families directly through `color: UIColor`, with `primary` as the default. Its public variants are `solid`, `outline`, `subtle`, `ghost`, and `link`, with `solid` as the default. Its public sizes are `xs`, `sm`, `md`, `lg`, `xl`, `icon-xs`, `icon-sm`, `icon`, `icon-lg`, and `icon-xl`; `loading` shows a centered spinner, keeps native button content invisible to preserve size, and disables the button without dimming it.
|
|
284
|
+
The `Button` component can apply those palette families directly through `color: UIColor`, with `primary` as the default. Its public variants are `solid`, `secondary`, `outline`, `subtle`, `ghost`, and `link`, with `solid` as the default. Its public sizes are `xs`, `sm`, `md`, `lg`, `xl`, `icon-xs`, `icon-sm`, `icon`, `icon-lg`, and `icon-xl`; `loading` shows a centered spinner, keeps native button content invisible to preserve size, and disables the button without dimming it.
|
|
285
285
|
|
|
286
286
|
The `Checkbox` component can be used as a bare checkbox or with `label?: React.ReactNode`. It supports `size: 'sm' | 'md' | 'lg'` and `color: UIColor`, with `primary` as the default color. When `label` is provided, it composes the package `Label`, accepts `labelProps` for that label, and generates an accessible `id`/`htmlFor` pair when no `id` prop is passed. Composed label text follows checkbox size: `sm` 12px, `md` 14px, and `lg` 20px.
|
|
287
287
|
|
package/package.json
CHANGED
|
@@ -61,6 +61,10 @@ Unless noted otherwise, each module also exports its public `*Props` types from
|
|
|
61
61
|
- Import path: `@uselets/ui/lib/color`
|
|
62
62
|
- Exports: `uiColors`, `UIColor`, `selectionControlColorVariants`
|
|
63
63
|
- Notes: canonical public color list used by `Button`, `Toggle`, `Checkbox`, `RadioGroupItem`, and `Switch`; `ButtonColor` is a compatibility alias for `UIColor`; `selectionControlColorVariants` is an internal styling map for checked selection controls
|
|
64
|
+
- `compose-refs`
|
|
65
|
+
- Import path: `@uselets/ui/lib/compose-refs`
|
|
66
|
+
- Exports: `composeRefs`, `setRef`
|
|
67
|
+
- Notes: helpers for composing multiple refs into a single callback ref. Use `composeRefs<T>(...refs)` when a component needs to merge a forwarded `ref` with an internal one (for example, `MaskInput` composes the consumer `ref` with the internal mask ref)
|
|
64
68
|
- `sonner`
|
|
65
69
|
- Import path: `@uselets/ui/sonner`
|
|
66
70
|
- Exports: `Toaster`, `toast`
|
|
@@ -104,7 +108,7 @@ Unless noted otherwise, each module also exports its public `*Props` types from
|
|
|
104
108
|
- Notes: pill-shaped tag with `size: 'xs' | 'sm' | 'md' | 'lg' | 'xl'` (default `md`), `solid`/`outline`/`subtle`/`ghost`/`link` variants, `color: UIColor` (`primary` default), and `asChild`
|
|
105
109
|
- `button`
|
|
106
110
|
- Exports: `Button`, `buttonVariants`
|
|
107
|
-
- Notes: action button with `solid`, `outline`, `subtle`, `ghost`, and `link` variants, `color: UIColor` (`primary` default), sizes from `xs` through `xl` plus icon sizes through `icon-xl`, and `loading`
|
|
111
|
+
- Notes: action button with `solid`, `secondary`, `outline`, `subtle`, `ghost`, and `link` variants, `color: UIColor` (`primary` default), sizes from `xs` through `xl` plus icon sizes through `icon-xl`, and `loading`
|
|
108
112
|
- `button-group`
|
|
109
113
|
- Exports: `ButtonGroup`, `ButtonGroupSeparator`, `ButtonGroupText`, `buttonGroupVariants`
|
|
110
114
|
- `empty`
|
|
@@ -142,7 +146,7 @@ Unless noted otherwise, each module also exports its public `*Props` types from
|
|
|
142
146
|
- Exports: `InputOTP`, `InputOTPGroup`, `InputOTPSeparator`, `InputOTPSlot`, `REGEXP_ONLY_CHARS`, `REGEXP_ONLY_DIGITS`, `REGEXP_ONLY_DIGITS_AND_CHARS`
|
|
143
147
|
- `mask-input`
|
|
144
148
|
- Exports: `MaskInput`
|
|
145
|
-
- Notes: formatted input backed by `@react-input/mask`. Required prop `mask`; optional `replacement` (string or `Record<string, RegExp>`), `showMask`, `separate`, `track`, `modify`. Default replacement tokens are `9` (digit), `a` (letter), `*` (any). Renders the standard `Input`, so `Field`/`FieldLabel` and all native `<input>` props work as usual.
|
|
149
|
+
- Notes: formatted input backed by `@react-input/mask`. Required prop `mask`; optional `replacement` (string or `Record<string, RegExp>`), `showMask`, `separate`, `track`, `modify`. Default replacement tokens are `9` (digit), `a` (letter), `*` (any). Renders the standard `Input`, so `Field`/`FieldLabel` and all native `<input>` props work as usual. Forwards a `ref` prop to the underlying `<input>`, composed with the internal mask ref via `composeRefs`.
|
|
146
150
|
- `checkbox`
|
|
147
151
|
- Exports: `Checkbox`
|
|
148
152
|
- Notes: supports `size: 'sm' | 'md' | 'lg'`, `color: UIColor` (default `primary`), `label?: React.ReactNode`, `labelProps`, and automatic `id`/`htmlFor` wiring when a label is provided without an explicit `id`; composed label text follows checkbox size (`sm` 12px, `md` 14px, `lg` 20px)
|
|
@@ -181,7 +185,8 @@ Unless noted otherwise, each module also exports its public `*Props` types from
|
|
|
181
185
|
## Overlays and floating UI
|
|
182
186
|
|
|
183
187
|
- `dialog`
|
|
184
|
-
- Exports: `Dialog`, `DialogClose`, `DialogContent`, `DialogDescription`, `DialogFooter`, `DialogHeader`, `DialogOverlay`, `DialogPortal`, `DialogTitle`, `DialogTrigger`
|
|
188
|
+
- Exports: `Dialog`, `DialogBody`, `DialogClose`, `DialogContent`, `DialogDescription`, `DialogFooter`, `DialogHeader`, `DialogOverlay`, `DialogPortal`, `DialogTitle`, `DialogTrigger`
|
|
189
|
+
- Notes: `Dialog` supports `size: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'full'` with default `md`; `full` occupies the entire viewport. `DialogContent` caps its height at `calc(100dvh - 2rem)` and lays out children as a flex column. For long content, wrap the middle in `DialogBody` (`flex-1 overflow-y-auto`) so the body scrolls while `DialogHeader` and `DialogFooter` remain pinned; for short content, omit `DialogBody`. `DialogContent.showCloseButton` defaults to `true`; `DialogFooter.showCloseButton` defaults to `false`
|
|
185
190
|
- `drawer`
|
|
186
191
|
- Exports: `Drawer`, `DrawerBody`, `DrawerClose`, `DrawerContent`, `DrawerDescription`, `DrawerFooter`, `DrawerHeader`, `DrawerOverlay`, `DrawerPortal`, `DrawerTitle`, `DrawerTrigger`
|
|
187
192
|
- Notes: `Drawer` supports `size: 'sm' | 'md' | 'lg' | 'xl'` with default `md`; `DrawerBody` provides padded auto-scroll content; `DrawerFooter` stacks actions on mobile and aligns them to the end on larger breakpoints; `DrawerContent.showCloseButton` controls the automatic close button and defaults to `true`
|
|
@@ -281,7 +281,7 @@ Additional tokens:
|
|
|
281
281
|
- `text-destructive-foreground`
|
|
282
282
|
- `--gradient-primary`
|
|
283
283
|
|
|
284
|
-
The `Button` component can apply those palette families directly through `color: UIColor`, with `primary` as the default. Its public variants are `solid`, `outline`, `subtle`, `ghost`, and `link`, with `solid` as the default. Its public sizes are `xs`, `sm`, `md`, `lg`, `xl`, `icon-xs`, `icon-sm`, `icon`, `icon-lg`, and `icon-xl`; `loading` shows a centered spinner, keeps native button content invisible to preserve size, and disables the button without dimming it.
|
|
284
|
+
The `Button` component can apply those palette families directly through `color: UIColor`, with `primary` as the default. Its public variants are `solid`, `secondary`, `outline`, `subtle`, `ghost`, and `link`, with `solid` as the default. Its public sizes are `xs`, `sm`, `md`, `lg`, `xl`, `icon-xs`, `icon-sm`, `icon`, `icon-lg`, and `icon-xl`; `loading` shows a centered spinner, keeps native button content invisible to preserve size, and disables the button without dimming it.
|
|
285
285
|
|
|
286
286
|
The `Checkbox` component can be used as a bare checkbox or with `label?: React.ReactNode`. It supports `size: 'sm' | 'md' | 'lg'` and `color: UIColor`, with `primary` as the default color. When `label` is provided, it composes the package `Label`, accepts `labelProps` for that label, and generates an accessible `id`/`htmlFor` pair when no `id` prop is passed. Composed label text follows checkbox size: `sm` 12px, `md` 14px, and `lg` 20px.
|
|
287
287
|
|