@uselets/ui 0.2.0 → 0.4.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 +90 -2
- package/dist/components/accordion.d.ts +31 -0
- package/dist/components/accordion.js +2 -0
- package/dist/components/accordion.js.map +1 -0
- package/dist/components/alert-dialog.d.ts +74 -0
- package/dist/components/alert-dialog.js +2 -0
- package/dist/components/alert-dialog.js.map +1 -0
- package/dist/components/alert.d.ts +1 -1
- package/dist/components/alert.js +1 -1
- package/dist/components/alert.js.map +1 -1
- package/dist/components/avatar.d.ts +4 -4
- package/dist/components/avatar.js +1 -1
- package/dist/components/avatar.js.map +1 -1
- package/dist/components/badge.d.ts +22 -0
- package/dist/components/badge.js +2 -0
- package/dist/components/badge.js.map +1 -0
- package/dist/components/breadcrumb.d.ts +47 -0
- package/dist/components/breadcrumb.js +2 -0
- package/dist/components/breadcrumb.js.map +1 -0
- package/dist/components/button-group.d.ts +33 -0
- package/dist/components/button-group.js +2 -0
- package/dist/components/button-group.js.map +1 -0
- package/dist/components/button.d.ts +8 -5
- package/dist/components/button.js +1 -1
- package/dist/components/button.js.map +1 -1
- package/dist/components/calendar.d.ts +34 -0
- package/dist/components/calendar.js +2 -0
- package/dist/components/calendar.js.map +1 -0
- package/dist/components/card.js +1 -1
- package/dist/components/card.js.map +1 -1
- package/dist/components/carousel.d.ts +62 -0
- package/dist/components/carousel.js +2 -0
- package/dist/components/carousel.js.map +1 -0
- package/dist/components/center.d.ts +21 -0
- package/dist/components/center.js +2 -0
- package/dist/components/center.js.map +1 -0
- package/dist/components/chart.d.ts +263 -0
- package/dist/components/chart.js +8 -0
- package/dist/components/chart.js.map +1 -0
- package/dist/components/checkbox.d.ts +20 -0
- package/dist/components/checkbox.js +2 -0
- package/dist/components/checkbox.js.map +1 -0
- package/dist/components/collapsible.d.ts +20 -0
- package/dist/components/collapsible.js +2 -0
- package/dist/components/collapsible.js.map +1 -0
- package/dist/components/combobox.d.ts +103 -0
- package/dist/components/combobox.js +2 -0
- package/dist/components/combobox.js.map +1 -0
- package/dist/components/command.d.ts +65 -0
- package/dist/components/command.js +2 -0
- package/dist/components/command.js.map +1 -0
- package/dist/components/container.d.ts +19 -0
- package/dist/components/container.js +2 -0
- package/dist/components/container.js.map +1 -0
- package/dist/components/dialog.d.ts +18 -10
- package/dist/components/dialog.js +1 -1
- package/dist/components/dialog.js.map +1 -1
- package/dist/components/drawer.d.ts +1 -1
- package/dist/components/drawer.js +1 -1
- package/dist/components/drawer.js.map +1 -1
- package/dist/components/dropdown-menu.d.ts +36 -42
- package/dist/components/dropdown-menu.js +1 -1
- package/dist/components/dropdown-menu.js.map +1 -1
- package/dist/components/empty.d.ts +1 -1
- package/dist/components/empty.js +1 -1
- package/dist/components/empty.js.map +1 -1
- package/dist/components/field.d.ts +2 -2
- package/dist/components/field.js +1 -1
- package/dist/components/field.js.map +1 -1
- package/dist/components/group.d.ts +21 -0
- package/dist/components/group.js +2 -0
- package/dist/components/group.js.map +1 -0
- package/dist/components/hover-card.d.ts +24 -0
- package/dist/components/hover-card.js +2 -0
- package/dist/components/hover-card.js.map +1 -0
- package/dist/components/input-group.d.ts +51 -0
- package/dist/components/input-group.js +2 -0
- package/dist/components/input-group.js.map +1 -0
- package/dist/components/input-otp.js +1 -1
- package/dist/components/input-otp.js.map +1 -1
- package/dist/components/input.js +1 -1
- package/dist/components/input.js.map +1 -1
- package/dist/components/kbd.d.ts +6 -3
- package/dist/components/kbd.js +1 -1
- package/dist/components/kbd.js.map +1 -1
- package/dist/components/label.d.ts +2 -1
- package/dist/components/label.js +1 -1
- package/dist/components/label.js.map +1 -1
- package/dist/components/native-select.js +1 -1
- package/dist/components/native-select.js.map +1 -1
- package/dist/components/navigation-menu.d.ts +56 -0
- package/dist/components/navigation-menu.js +2 -0
- package/dist/components/navigation-menu.js.map +1 -0
- package/dist/components/pagination.d.ts +53 -0
- package/dist/components/pagination.js +2 -0
- package/dist/components/pagination.js.map +1 -0
- package/dist/components/popover.d.ts +43 -0
- package/dist/components/popover.js +2 -0
- package/dist/components/popover.js.map +1 -0
- package/dist/components/progress.d.ts +15 -0
- package/dist/components/progress.js +2 -0
- package/dist/components/progress.js.map +1 -0
- package/dist/components/radio-group.d.ts +19 -0
- package/dist/components/radio-group.js +2 -0
- package/dist/components/radio-group.js.map +1 -0
- package/dist/components/resizable.d.ts +25 -0
- package/dist/components/resizable.js +2 -0
- package/dist/components/resizable.js.map +1 -0
- package/dist/components/scroll-area.d.ts +21 -0
- package/dist/components/scroll-area.js +2 -0
- package/dist/components/scroll-area.js.map +1 -0
- package/dist/components/select.d.ts +15 -17
- package/dist/components/select.js +1 -1
- package/dist/components/select.js.map +1 -1
- package/dist/components/separator.d.ts +4 -2
- package/dist/components/separator.js +1 -1
- package/dist/components/separator.js.map +1 -1
- package/dist/components/sheet.d.ts +61 -0
- package/dist/components/sheet.js +2 -0
- package/dist/components/sheet.js.map +1 -0
- package/dist/components/sidebar.d.ts +192 -0
- package/dist/components/sidebar.js +2 -0
- package/dist/components/sidebar.js.map +1 -0
- package/dist/components/skeleton.js +1 -1
- package/dist/components/skeleton.js.map +1 -1
- package/dist/components/slider.d.ts +18 -0
- package/dist/components/slider.js +2 -0
- package/dist/components/slider.js.map +1 -0
- package/dist/components/sonner.js +1 -1
- package/dist/components/sonner.js.map +1 -1
- package/dist/components/spinner.d.ts +10 -2
- package/dist/components/spinner.js +1 -1
- package/dist/components/spinner.js.map +1 -1
- package/dist/components/stack.d.ts +19 -0
- package/dist/components/stack.js +2 -0
- package/dist/components/stack.js.map +1 -0
- package/dist/components/switch.d.ts +17 -0
- package/dist/components/switch.js +2 -0
- package/dist/components/switch.js.map +1 -0
- package/dist/components/table.d.ts +48 -0
- package/dist/components/table.js +2 -0
- package/dist/components/table.js.map +1 -0
- package/dist/components/tabs.d.ts +36 -0
- package/dist/components/tabs.js +2 -0
- package/dist/components/tabs.js.map +1 -0
- package/dist/components/textarea.d.ts +13 -0
- package/dist/components/textarea.js +2 -0
- package/dist/components/textarea.js.map +1 -0
- package/dist/components/theme.d.ts +5 -2
- package/dist/components/theme.js +1 -1
- package/dist/components/theme.js.map +1 -1
- package/dist/components/toggle-group.d.ts +32 -0
- package/dist/components/toggle-group.js +2 -0
- package/dist/components/toggle-group.js.map +1 -0
- package/dist/components/toggle.d.ts +22 -0
- package/dist/components/toggle.js +2 -0
- package/dist/components/toggle.js.map +1 -0
- package/dist/components/tooltip.d.ts +29 -0
- package/dist/components/tooltip.js +2 -0
- package/dist/components/tooltip.js.map +1 -0
- package/dist/hooks/use-mobile.d.ts +7 -0
- package/dist/hooks/use-mobile.js +2 -0
- package/dist/hooks/use-mobile.js.map +1 -0
- package/dist/index.d.ts +42 -5
- package/dist/index.js +1 -1
- package/dist/lib/utils.js +1 -1
- package/dist/lib/utils.js.map +1 -1
- package/dist/styles.css +1436 -3
- package/package.json +21 -10
- package/dist/styles.css.map +0 -1
- package/dist/styles.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox.js","names":["CheckboxPrimitive"],"sources":["../../src/components/checkbox.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { IconCheck } from '@tabler/icons-react'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { Checkbox as CheckboxPrimitive } from 'radix-ui'\n\nimport { cn } from '../lib/utils'\n\nconst checkboxVariants = cva(\n 'border-input dark:bg-input/30 data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary data-checked:border-primary aria-invalid:aria-checked:border-primary aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 flex items-center justify-center border transition-colors group-has-disabled/field:opacity-50 focus-visible:ring-3 aria-invalid:ring-3 peer relative shrink-0 outline-none after:absolute after:-inset-x-3 after:-inset-y-2 disabled:cursor-not-allowed disabled:opacity-50',\n {\n variants: {\n size: {\n sm: 'size-3.5 rounded-[3px] [&_[data-slot=checkbox-indicator]>svg]:size-3',\n default: 'size-4 rounded-[4px] [&_[data-slot=checkbox-indicator]>svg]:size-3.5',\n lg: 'size-5 rounded-[5px] [&_[data-slot=checkbox-indicator]>svg]:size-4'\n }\n },\n defaultVariants: {\n size: 'default'\n }\n }\n)\n\nexport type CheckboxProps = React.ComponentProps<typeof CheckboxPrimitive.Root> & VariantProps<typeof checkboxVariants>\n\nfunction Checkbox({ className, size = 'default', ...props }: CheckboxProps) {\n return (\n <CheckboxPrimitive.Root\n data-slot=\"checkbox\"\n data-size={size}\n className={cn(checkboxVariants({ size }), className)}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"grid place-content-center text-current transition-none\"\n >\n <IconCheck />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n )\n}\n\nexport { Checkbox }\n"],"mappings":"6OAQA,MAAM,EAAmB,EACvB,+oBACA,CACE,SAAU,CACR,KAAM,CACJ,GAAI,uEACJ,QAAS,uEACT,GAAI,qEACL,CACF,CACD,gBAAiB,CACf,KAAM,UACP,CACF,CACF,CAID,SAAS,SAAS,CAAE,YAAW,OAAO,UAAW,GAAG,GAAwB,CAC1E,OACE,EAACA,EAAkB,KAAnB,CACE,YAAU,WACV,YAAW,EACX,UAAW,EAAG,EAAiB,CAAE,OAAM,CAAC,CAAE,EAAU,CACpD,GAAI,WAEJ,EAACA,EAAkB,UAAnB,CACE,YAAU,qBACV,UAAU,kEAEV,EAAC,EAAD,EAAa,CAAA,CACe,CAAA,CACP,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { t as __name } from "../chunk-IpJEthwI.js";
|
|
2
|
+
import { Collapsible as Collapsible$1 } from "radix-ui";
|
|
3
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/components/collapsible.d.ts
|
|
6
|
+
type CollapsibleProps = React.ComponentProps<typeof Collapsible$1.Root>;
|
|
7
|
+
type CollapsibleTriggerProps = React.ComponentProps<typeof Collapsible$1.CollapsibleTrigger>;
|
|
8
|
+
type CollapsibleContentProps = React.ComponentProps<typeof Collapsible$1.CollapsibleContent>;
|
|
9
|
+
declare function Collapsible({
|
|
10
|
+
...props
|
|
11
|
+
}: CollapsibleProps): react_jsx_runtime0.JSX.Element;
|
|
12
|
+
declare function CollapsibleTrigger({
|
|
13
|
+
...props
|
|
14
|
+
}: CollapsibleTriggerProps): react_jsx_runtime0.JSX.Element;
|
|
15
|
+
declare function CollapsibleContent({
|
|
16
|
+
...props
|
|
17
|
+
}: CollapsibleContentProps): react_jsx_runtime0.JSX.Element;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { Collapsible, CollapsibleContent, CollapsibleContentProps, CollapsibleProps, CollapsibleTrigger, CollapsibleTriggerProps };
|
|
20
|
+
//# sourceMappingURL=collapsible.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"../chunk-IpJEthwI.js";import{Collapsible as e}from"radix-ui";import{jsx as t}from"react/jsx-runtime";function Collapsible({...n}){return t(e.Root,{"data-slot":`collapsible`,...n})}function CollapsibleTrigger({...n}){return t(e.CollapsibleTrigger,{"data-slot":`collapsible-trigger`,...n})}function CollapsibleContent({...n}){return t(e.CollapsibleContent,{"data-slot":`collapsible-content`,...n})}export{Collapsible,CollapsibleContent,CollapsibleTrigger};
|
|
2
|
+
//# sourceMappingURL=collapsible.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collapsible.js","names":["CollapsiblePrimitive"],"sources":["../../src/components/collapsible.tsx"],"sourcesContent":["import { Collapsible as CollapsiblePrimitive } from 'radix-ui'\n\nexport type CollapsibleProps = React.ComponentProps<typeof CollapsiblePrimitive.Root>\n\nexport type CollapsibleTriggerProps = React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>\n\nexport type CollapsibleContentProps = React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>\n\nfunction Collapsible({ ...props }: CollapsibleProps) {\n return <CollapsiblePrimitive.Root data-slot=\"collapsible\" {...props} />\n}\n\nfunction CollapsibleTrigger({ ...props }: CollapsibleTriggerProps) {\n return <CollapsiblePrimitive.CollapsibleTrigger data-slot=\"collapsible-trigger\" {...props} />\n}\n\nfunction CollapsibleContent({ ...props }: CollapsibleContentProps) {\n return <CollapsiblePrimitive.CollapsibleContent data-slot=\"collapsible-content\" {...props} />\n}\n\nexport { Collapsible, CollapsibleTrigger, CollapsibleContent }\n"],"mappings":"4GAQA,SAAS,YAAY,CAAE,GAAG,GAA2B,CACnD,OAAO,EAACA,EAAqB,KAAtB,CAA2B,YAAU,cAAc,GAAI,EAAS,CAAA,CAGzE,SAAS,mBAAmB,CAAE,GAAG,GAAkC,CACjE,OAAO,EAACA,EAAqB,mBAAtB,CAAyC,YAAU,sBAAsB,GAAI,EAAS,CAAA,CAG/F,SAAS,mBAAmB,CAAE,GAAG,GAAkC,CACjE,OAAO,EAACA,EAAqB,mBAAtB,CAAyC,YAAU,sBAAsB,GAAI,EAAS,CAAA"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { t as __name } from "../chunk-IpJEthwI.js";
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Combobox as Combobox$1 } from "@base-ui/react";
|
|
5
|
+
|
|
6
|
+
//#region src/components/combobox.d.ts
|
|
7
|
+
type ComboboxProps = React.ComponentProps<typeof Combobox$1.Root>;
|
|
8
|
+
type ComboboxValueProps = Combobox$1.Value.Props;
|
|
9
|
+
type ComboboxTriggerProps = Combobox$1.Trigger.Props;
|
|
10
|
+
type ComboboxClearProps = Combobox$1.Clear.Props;
|
|
11
|
+
type ComboboxInputProps = Combobox$1.Input.Props & {
|
|
12
|
+
showTrigger?: boolean;
|
|
13
|
+
showClear?: boolean;
|
|
14
|
+
};
|
|
15
|
+
type ComboboxContentProps = Combobox$1.Popup.Props & Pick<Combobox$1.Positioner.Props, 'side' | 'align' | 'sideOffset' | 'alignOffset' | 'anchor'>;
|
|
16
|
+
type ComboboxListProps = Combobox$1.List.Props;
|
|
17
|
+
type ComboboxItemProps = Combobox$1.Item.Props;
|
|
18
|
+
type ComboboxGroupProps = Combobox$1.Group.Props;
|
|
19
|
+
type ComboboxLabelProps = Combobox$1.GroupLabel.Props;
|
|
20
|
+
type ComboboxCollectionProps = Combobox$1.Collection.Props;
|
|
21
|
+
type ComboboxEmptyProps = Combobox$1.Empty.Props;
|
|
22
|
+
type ComboboxSeparatorProps = Combobox$1.Separator.Props;
|
|
23
|
+
type ComboboxChipsProps = React.ComponentPropsWithRef<typeof Combobox$1.Chips> & Combobox$1.Chips.Props;
|
|
24
|
+
type ComboboxChipProps = Combobox$1.Chip.Props & {
|
|
25
|
+
showRemove?: boolean;
|
|
26
|
+
};
|
|
27
|
+
type ComboboxChipsInputProps = Combobox$1.Input.Props;
|
|
28
|
+
declare const Combobox: typeof Combobox$1.Root;
|
|
29
|
+
declare function ComboboxValue({
|
|
30
|
+
...props
|
|
31
|
+
}: ComboboxValueProps): react_jsx_runtime0.JSX.Element;
|
|
32
|
+
declare function ComboboxTrigger({
|
|
33
|
+
className,
|
|
34
|
+
children,
|
|
35
|
+
...props
|
|
36
|
+
}: ComboboxTriggerProps): react_jsx_runtime0.JSX.Element;
|
|
37
|
+
declare function ComboboxClear({
|
|
38
|
+
className,
|
|
39
|
+
...props
|
|
40
|
+
}: ComboboxClearProps): react_jsx_runtime0.JSX.Element;
|
|
41
|
+
declare function ComboboxInput({
|
|
42
|
+
className,
|
|
43
|
+
children,
|
|
44
|
+
disabled,
|
|
45
|
+
showTrigger,
|
|
46
|
+
showClear,
|
|
47
|
+
...props
|
|
48
|
+
}: ComboboxInputProps): react_jsx_runtime0.JSX.Element;
|
|
49
|
+
declare function ComboboxContent({
|
|
50
|
+
className,
|
|
51
|
+
side,
|
|
52
|
+
sideOffset,
|
|
53
|
+
align,
|
|
54
|
+
alignOffset,
|
|
55
|
+
anchor,
|
|
56
|
+
...props
|
|
57
|
+
}: ComboboxContentProps): react_jsx_runtime0.JSX.Element;
|
|
58
|
+
declare function ComboboxList({
|
|
59
|
+
className,
|
|
60
|
+
...props
|
|
61
|
+
}: ComboboxListProps): react_jsx_runtime0.JSX.Element;
|
|
62
|
+
declare function ComboboxItem({
|
|
63
|
+
className,
|
|
64
|
+
children,
|
|
65
|
+
...props
|
|
66
|
+
}: ComboboxItemProps): react_jsx_runtime0.JSX.Element;
|
|
67
|
+
declare function ComboboxGroup({
|
|
68
|
+
className,
|
|
69
|
+
...props
|
|
70
|
+
}: ComboboxGroupProps): react_jsx_runtime0.JSX.Element;
|
|
71
|
+
declare function ComboboxLabel({
|
|
72
|
+
className,
|
|
73
|
+
...props
|
|
74
|
+
}: ComboboxLabelProps): react_jsx_runtime0.JSX.Element;
|
|
75
|
+
declare function ComboboxCollection({
|
|
76
|
+
...props
|
|
77
|
+
}: ComboboxCollectionProps): react_jsx_runtime0.JSX.Element;
|
|
78
|
+
declare function ComboboxEmpty({
|
|
79
|
+
className,
|
|
80
|
+
...props
|
|
81
|
+
}: ComboboxEmptyProps): react_jsx_runtime0.JSX.Element;
|
|
82
|
+
declare function ComboboxSeparator({
|
|
83
|
+
className,
|
|
84
|
+
...props
|
|
85
|
+
}: ComboboxSeparatorProps): react_jsx_runtime0.JSX.Element;
|
|
86
|
+
declare function ComboboxChips({
|
|
87
|
+
className,
|
|
88
|
+
...props
|
|
89
|
+
}: ComboboxChipsProps): react_jsx_runtime0.JSX.Element;
|
|
90
|
+
declare function ComboboxChip({
|
|
91
|
+
className,
|
|
92
|
+
children,
|
|
93
|
+
showRemove,
|
|
94
|
+
...props
|
|
95
|
+
}: ComboboxChipProps): react_jsx_runtime0.JSX.Element;
|
|
96
|
+
declare function ComboboxChipsInput({
|
|
97
|
+
className,
|
|
98
|
+
...props
|
|
99
|
+
}: ComboboxChipsInputProps): react_jsx_runtime0.JSX.Element;
|
|
100
|
+
declare function useComboboxAnchor(): React.RefObject<HTMLDivElement | null>;
|
|
101
|
+
//#endregion
|
|
102
|
+
export { 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 };
|
|
103
|
+
//# sourceMappingURL=combobox.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"../chunk-IpJEthwI.js";import{cn as e}from"../lib/utils.js";import{Button as t}from"./button.js";import{InputGroup as n,InputGroupAddon as r,InputGroupButton as i,InputGroupInput as a}from"./input-group.js";import{IconCheck as o,IconChevronDown as s,IconX as c}from"@tabler/icons-react";import{jsx as l,jsxs as u}from"react/jsx-runtime";import*as d from"react";import{Combobox as f}from"@base-ui/react";const p=f.Root;function ComboboxValue({...e}){return l(f.Value,{"data-slot":`combobox-value`,...e})}function ComboboxTrigger({className:t,children:n,...r}){return u(f.Trigger,{"data-slot":`combobox-trigger`,className:e(`[&_svg:not([class*='size-'])]:size-4`,t),...r,children:[n,l(s,{className:`pointer-events-none size-4 text-muted-foreground`})]})}function ComboboxClear({className:t,...n}){return l(f.Clear,{"data-slot":`combobox-clear`,render:l(i,{variant:`ghost`,size:`icon-xs`}),className:e(t),...n,children:l(c,{className:`pointer-events-none`})})}function ComboboxInput({className:t,children:o,disabled:s=!1,showTrigger:c=!0,showClear:d=!1,...p}){return u(n,{className:e(`w-auto`,t),children:[l(f.Input,{render:l(a,{disabled:s}),...p}),u(r,{align:`inline-end`,children:[c&&l(i,{size:`icon-xs`,variant:`ghost`,asChild:!0,"data-slot":`input-group-button`,className:`group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent`,disabled:s,children:l(ComboboxTrigger,{})}),d&&l(ComboboxClear,{disabled:s})]}),o]})}function ComboboxContent({className:t,side:n=`bottom`,sideOffset:r=6,align:i=`start`,alignOffset:a=0,anchor:o,...s}){return l(f.Portal,{children:l(f.Positioner,{side:n,sideOffset:r,align:i,alignOffset:a,anchor:o,className:`isolate z-50`,children:l(f.Popup,{"data-slot":`combobox-content`,"data-chips":!!o,className:e(`group/combobox-content max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) overflow-hidden rounded-lg text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[chips=true]:min-w-(--anchor-width) data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-8 *:data-[slot=input-group]:border-input/30 *:data-[slot=input-group]:bg-input/30 *:data-[slot=input-group]:shadow-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 animate-none! relative bg-popover/70 before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit] before:backdrop-blur-2xl before:backdrop-saturate-150 **:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10 **:data-[slot$=-separator]:bg-foreground/5 **:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10! **:data-[variant=destructive]:focus:bg-foreground/10! **:data-[variant=destructive]:text-accent-foreground! **:data-[variant=destructive]:**:text-accent-foreground!`,t),...s})})})}function ComboboxList({className:t,...n}){return l(f.List,{"data-slot":`combobox-list`,className:e(`no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto overscroll-contain p-1 data-empty:p-0`,t),...n})}function ComboboxItem({className:t,children:n,...r}){return u(f.Item,{"data-slot":`combobox-item`,className:e(`relative flex w-full cursor-default items-center gap-2 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,t),...r,children:[n,l(f.ItemIndicator,{render:l(`span`,{className:`pointer-events-none absolute right-2 flex size-4 items-center justify-center`}),children:l(o,{className:`pointer-events-none`})})]})}function ComboboxGroup({className:t,...n}){return l(f.Group,{"data-slot":`combobox-group`,className:e(t),...n})}function ComboboxLabel({className:t,...n}){return l(f.GroupLabel,{"data-slot":`combobox-label`,className:e(`px-2 py-1.5 text-xs text-muted-foreground`,t),...n})}function ComboboxCollection({...e}){return l(f.Collection,{"data-slot":`combobox-collection`,...e})}function ComboboxEmpty({className:t,...n}){return l(f.Empty,{"data-slot":`combobox-empty`,className:e(`hidden w-full justify-center py-2 text-center text-sm text-muted-foreground group-data-empty/combobox-content:flex`,t),...n})}function ComboboxSeparator({className:t,...n}){return l(f.Separator,{"data-slot":`combobox-separator`,className:e(`-mx-1 my-1 h-px bg-border`,t),...n})}function ComboboxChips({className:t,...n}){return l(f.Chips,{"data-slot":`combobox-chips`,className:e(`flex min-h-8 flex-wrap items-center gap-1 rounded-lg border border-input bg-transparent bg-clip-padding px-2.5 py-1 text-sm transition-colors focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50 has-aria-invalid:border-destructive has-aria-invalid:ring-3 has-aria-invalid:ring-destructive/20 has-data-[slot=combobox-chip]:px-1 dark:bg-input/30 dark:has-aria-invalid:border-destructive/50 dark:has-aria-invalid:ring-destructive/40`,t),...n})}function ComboboxChip({className:n,children:r,showRemove:i=!0,...a}){return u(f.Chip,{"data-slot":`combobox-chip`,className:e(`flex h-[calc(--spacing(5.25))] w-fit items-center justify-center gap-1 rounded-sm bg-muted px-1.5 text-xs font-medium whitespace-nowrap text-foreground has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50 has-data-[slot=combobox-chip-remove]:pr-0`,n),...a,children:[r,i&&l(f.ChipRemove,{render:l(t,{variant:`ghost`,size:`icon-xs`}),className:`-ml-1 opacity-50 hover:opacity-100`,"data-slot":`combobox-chip-remove`,children:l(c,{className:`pointer-events-none`})})]})}function ComboboxChipsInput({className:t,...n}){return l(f.Input,{"data-slot":`combobox-chip-input`,className:e(`min-w-16 flex-1 outline-none`,t),...n})}function useComboboxAnchor(){return d.useRef(null)}export{p as Combobox,ComboboxChip,ComboboxChips,ComboboxChipsInput,ComboboxClear,ComboboxCollection,ComboboxContent,ComboboxEmpty,ComboboxGroup,ComboboxInput,ComboboxItem,ComboboxLabel,ComboboxList,ComboboxSeparator,ComboboxTrigger,ComboboxValue,useComboboxAnchor};
|
|
2
|
+
//# sourceMappingURL=combobox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combobox.js","names":["ComboboxPrimitive"],"sources":["../../src/components/combobox.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { Combobox as ComboboxPrimitive } from '@base-ui/react'\nimport { IconCheck, IconChevronDown, IconX } from '@tabler/icons-react'\n\nimport { cn } from '../lib/utils'\nimport { Button } from './button'\nimport { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from './input-group'\n\nexport type ComboboxProps = React.ComponentProps<typeof ComboboxPrimitive.Root>\n\nexport type ComboboxValueProps = ComboboxPrimitive.Value.Props\n\nexport type ComboboxTriggerProps = ComboboxPrimitive.Trigger.Props\n\nexport type ComboboxClearProps = ComboboxPrimitive.Clear.Props\n\nexport type ComboboxInputProps = ComboboxPrimitive.Input.Props & {\n showTrigger?: boolean\n showClear?: boolean\n}\n\nexport type ComboboxContentProps = ComboboxPrimitive.Popup.Props &\n Pick<ComboboxPrimitive.Positioner.Props, 'side' | 'align' | 'sideOffset' | 'alignOffset' | 'anchor'>\n\nexport type ComboboxListProps = ComboboxPrimitive.List.Props\n\nexport type ComboboxItemProps = ComboboxPrimitive.Item.Props\n\nexport type ComboboxGroupProps = ComboboxPrimitive.Group.Props\n\nexport type ComboboxLabelProps = ComboboxPrimitive.GroupLabel.Props\n\nexport type ComboboxCollectionProps = ComboboxPrimitive.Collection.Props\n\nexport type ComboboxEmptyProps = ComboboxPrimitive.Empty.Props\n\nexport type ComboboxSeparatorProps = ComboboxPrimitive.Separator.Props\n\nexport type ComboboxChipsProps = React.ComponentPropsWithRef<typeof ComboboxPrimitive.Chips> &\n ComboboxPrimitive.Chips.Props\n\nexport type ComboboxChipProps = ComboboxPrimitive.Chip.Props & {\n showRemove?: boolean\n}\n\nexport type ComboboxChipsInputProps = ComboboxPrimitive.Input.Props\n\nconst Combobox = ComboboxPrimitive.Root\n\nfunction ComboboxValue({ ...props }: ComboboxValueProps) {\n return <ComboboxPrimitive.Value data-slot=\"combobox-value\" {...props} />\n}\n\nfunction ComboboxTrigger({ className, children, ...props }: ComboboxTriggerProps) {\n return (\n <ComboboxPrimitive.Trigger\n data-slot=\"combobox-trigger\"\n className={cn(\"[&_svg:not([class*='size-'])]:size-4\", className)}\n {...props}\n >\n {children}\n <IconChevronDown className=\"pointer-events-none size-4 text-muted-foreground\" />\n </ComboboxPrimitive.Trigger>\n )\n}\n\nfunction ComboboxClear({ className, ...props }: ComboboxClearProps) {\n return (\n <ComboboxPrimitive.Clear\n data-slot=\"combobox-clear\"\n render={<InputGroupButton variant=\"ghost\" size=\"icon-xs\" />}\n className={cn(className)}\n {...props}\n >\n <IconX className=\"pointer-events-none\" />\n </ComboboxPrimitive.Clear>\n )\n}\n\nfunction ComboboxInput({\n className,\n children,\n disabled = false,\n showTrigger = true,\n showClear = false,\n ...props\n}: ComboboxInputProps) {\n return (\n <InputGroup className={cn('w-auto', className)}>\n <ComboboxPrimitive.Input render={<InputGroupInput disabled={disabled} />} {...props} />\n <InputGroupAddon align=\"inline-end\">\n {showTrigger && (\n <InputGroupButton\n size=\"icon-xs\"\n variant=\"ghost\"\n asChild\n data-slot=\"input-group-button\"\n className=\"group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent\"\n disabled={disabled}\n >\n <ComboboxTrigger />\n </InputGroupButton>\n )}\n {showClear && <ComboboxClear disabled={disabled} />}\n </InputGroupAddon>\n {children}\n </InputGroup>\n )\n}\n\nfunction ComboboxContent({\n className,\n side = 'bottom',\n sideOffset = 6,\n align = 'start',\n alignOffset = 0,\n anchor,\n ...props\n}: ComboboxContentProps) {\n return (\n <ComboboxPrimitive.Portal>\n <ComboboxPrimitive.Positioner\n side={side}\n sideOffset={sideOffset}\n align={align}\n alignOffset={alignOffset}\n anchor={anchor}\n className=\"isolate z-50\"\n >\n <ComboboxPrimitive.Popup\n data-slot=\"combobox-content\"\n data-chips={!!anchor}\n className={cn(\n 'group/combobox-content max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) overflow-hidden rounded-lg text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[chips=true]:min-w-(--anchor-width) data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-8 *:data-[slot=input-group]:border-input/30 *:data-[slot=input-group]:bg-input/30 *:data-[slot=input-group]:shadow-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 animate-none! relative bg-popover/70 before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit] before:backdrop-blur-2xl before:backdrop-saturate-150 **:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10 **:data-[slot$=-separator]:bg-foreground/5 **:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10! **:data-[variant=destructive]:focus:bg-foreground/10! **:data-[variant=destructive]:text-accent-foreground! **:data-[variant=destructive]:**:text-accent-foreground!',\n className\n )}\n {...props}\n />\n </ComboboxPrimitive.Positioner>\n </ComboboxPrimitive.Portal>\n )\n}\n\nfunction ComboboxList({ className, ...props }: ComboboxListProps) {\n return (\n <ComboboxPrimitive.List\n data-slot=\"combobox-list\"\n className={cn(\n 'no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto overscroll-contain p-1 data-empty:p-0',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction ComboboxItem({ className, children, ...props }: ComboboxItemProps) {\n return (\n <ComboboxPrimitive.Item\n data-slot=\"combobox-item\"\n className={cn(\n \"relative flex w-full cursor-default items-center gap-2 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n {children}\n <ComboboxPrimitive.ItemIndicator\n render={<span className=\"pointer-events-none absolute right-2 flex size-4 items-center justify-center\" />}\n >\n <IconCheck className=\"pointer-events-none\" />\n </ComboboxPrimitive.ItemIndicator>\n </ComboboxPrimitive.Item>\n )\n}\n\nfunction ComboboxGroup({ className, ...props }: ComboboxGroupProps) {\n return <ComboboxPrimitive.Group data-slot=\"combobox-group\" className={cn(className)} {...props} />\n}\n\nfunction ComboboxLabel({ className, ...props }: ComboboxLabelProps) {\n return (\n <ComboboxPrimitive.GroupLabel\n data-slot=\"combobox-label\"\n className={cn('px-2 py-1.5 text-xs text-muted-foreground', className)}\n {...props}\n />\n )\n}\n\nfunction ComboboxCollection({ ...props }: ComboboxCollectionProps) {\n return <ComboboxPrimitive.Collection data-slot=\"combobox-collection\" {...props} />\n}\n\nfunction ComboboxEmpty({ className, ...props }: ComboboxEmptyProps) {\n return (\n <ComboboxPrimitive.Empty\n data-slot=\"combobox-empty\"\n className={cn(\n 'hidden w-full justify-center py-2 text-center text-sm text-muted-foreground group-data-empty/combobox-content:flex',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction ComboboxSeparator({ className, ...props }: ComboboxSeparatorProps) {\n return (\n <ComboboxPrimitive.Separator\n data-slot=\"combobox-separator\"\n className={cn('-mx-1 my-1 h-px bg-border', className)}\n {...props}\n />\n )\n}\n\nfunction ComboboxChips({ className, ...props }: ComboboxChipsProps) {\n return (\n <ComboboxPrimitive.Chips\n data-slot=\"combobox-chips\"\n className={cn(\n 'flex min-h-8 flex-wrap items-center gap-1 rounded-lg border border-input bg-transparent bg-clip-padding px-2.5 py-1 text-sm transition-colors focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50 has-aria-invalid:border-destructive has-aria-invalid:ring-3 has-aria-invalid:ring-destructive/20 has-data-[slot=combobox-chip]:px-1 dark:bg-input/30 dark:has-aria-invalid:border-destructive/50 dark:has-aria-invalid:ring-destructive/40',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction ComboboxChip({ className, children, showRemove = true, ...props }: ComboboxChipProps) {\n return (\n <ComboboxPrimitive.Chip\n data-slot=\"combobox-chip\"\n className={cn(\n 'flex h-[calc(--spacing(5.25))] w-fit items-center justify-center gap-1 rounded-sm bg-muted px-1.5 text-xs font-medium whitespace-nowrap text-foreground has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50 has-data-[slot=combobox-chip-remove]:pr-0',\n className\n )}\n {...props}\n >\n {children}\n {showRemove && (\n <ComboboxPrimitive.ChipRemove\n render={<Button variant=\"ghost\" size=\"icon-xs\" />}\n className=\"-ml-1 opacity-50 hover:opacity-100\"\n data-slot=\"combobox-chip-remove\"\n >\n <IconX className=\"pointer-events-none\" />\n </ComboboxPrimitive.ChipRemove>\n )}\n </ComboboxPrimitive.Chip>\n )\n}\n\nfunction ComboboxChipsInput({ className, ...props }: ComboboxChipsInputProps) {\n return (\n <ComboboxPrimitive.Input\n data-slot=\"combobox-chip-input\"\n className={cn('min-w-16 flex-1 outline-none', className)}\n {...props}\n />\n )\n}\n\nfunction useComboboxAnchor() {\n return React.useRef<HTMLDivElement | null>(null)\n}\n\nexport {\n Combobox,\n ComboboxInput,\n ComboboxContent,\n ComboboxList,\n ComboboxItem,\n ComboboxGroup,\n ComboboxLabel,\n ComboboxCollection,\n ComboboxClear,\n ComboboxEmpty,\n ComboboxSeparator,\n ComboboxChips,\n ComboboxChip,\n ComboboxChipsInput,\n ComboboxTrigger,\n ComboboxValue,\n useComboboxAnchor\n}\n"],"mappings":"yZAgDA,MAAM,EAAWA,EAAkB,KAEnC,SAAS,cAAc,CAAE,GAAG,GAA6B,CACvD,OAAO,EAACA,EAAkB,MAAnB,CAAyB,YAAU,iBAAiB,GAAI,EAAS,CAAA,CAG1E,SAAS,gBAAgB,CAAE,YAAW,WAAU,GAAG,GAA+B,CAChF,OACE,EAACA,EAAkB,QAAnB,CACE,YAAU,mBACV,UAAW,EAAG,uCAAwC,EAAU,CAChE,GAAI,WAHN,CAKG,EACD,EAAC,EAAD,CAAiB,UAAU,mDAAqD,CAAA,CACtD,GAIhC,SAAS,cAAc,CAAE,YAAW,GAAG,GAA6B,CAClE,OACE,EAACA,EAAkB,MAAnB,CACE,YAAU,iBACV,OAAQ,EAAC,EAAD,CAAkB,QAAQ,QAAQ,KAAK,UAAY,CAA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,SAAS,mBAAmB,CAAE,YAAW,GAAG,GAAkC,CAC5E,OACE,EAACA,EAAkB,MAAnB,CACE,YAAU,sBACV,UAAW,EAAG,+BAAgC,EAAU,CACxD,GAAI,EACJ,CAAA,CAIN,SAAS,mBAAoB,CAC3B,OAAO,EAAM,OAA8B,KAAK"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { t as __name } from "../chunk-IpJEthwI.js";
|
|
2
|
+
import { Dialog } from "./dialog.js";
|
|
3
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { Command as Command$1 } from "cmdk";
|
|
6
|
+
|
|
7
|
+
//#region src/components/command.d.ts
|
|
8
|
+
type CommandProps = React.ComponentProps<typeof Command$1>;
|
|
9
|
+
type CommandDialogProps = React.ComponentProps<typeof Dialog> & {
|
|
10
|
+
title?: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
className?: string;
|
|
13
|
+
showCloseButton?: boolean;
|
|
14
|
+
};
|
|
15
|
+
type CommandInputProps = React.ComponentProps<typeof Command$1.Input>;
|
|
16
|
+
type CommandListProps = React.ComponentProps<typeof Command$1.List>;
|
|
17
|
+
type CommandEmptyProps = React.ComponentProps<typeof Command$1.Empty>;
|
|
18
|
+
type CommandGroupProps = React.ComponentProps<typeof Command$1.Group>;
|
|
19
|
+
type CommandSeparatorProps = React.ComponentProps<typeof Command$1.Separator>;
|
|
20
|
+
type CommandItemProps = React.ComponentProps<typeof Command$1.Item>;
|
|
21
|
+
type CommandShortcutProps = React.ComponentProps<'span'>;
|
|
22
|
+
declare function Command({
|
|
23
|
+
className,
|
|
24
|
+
...props
|
|
25
|
+
}: CommandProps): react_jsx_runtime0.JSX.Element;
|
|
26
|
+
declare function CommandDialog({
|
|
27
|
+
title,
|
|
28
|
+
description,
|
|
29
|
+
children,
|
|
30
|
+
className,
|
|
31
|
+
showCloseButton,
|
|
32
|
+
...props
|
|
33
|
+
}: CommandDialogProps): react_jsx_runtime0.JSX.Element;
|
|
34
|
+
declare function CommandInput({
|
|
35
|
+
className,
|
|
36
|
+
...props
|
|
37
|
+
}: CommandInputProps): react_jsx_runtime0.JSX.Element;
|
|
38
|
+
declare function CommandList({
|
|
39
|
+
className,
|
|
40
|
+
...props
|
|
41
|
+
}: CommandListProps): react_jsx_runtime0.JSX.Element;
|
|
42
|
+
declare function CommandEmpty({
|
|
43
|
+
className,
|
|
44
|
+
...props
|
|
45
|
+
}: CommandEmptyProps): react_jsx_runtime0.JSX.Element;
|
|
46
|
+
declare function CommandGroup({
|
|
47
|
+
className,
|
|
48
|
+
...props
|
|
49
|
+
}: CommandGroupProps): react_jsx_runtime0.JSX.Element;
|
|
50
|
+
declare function CommandSeparator({
|
|
51
|
+
className,
|
|
52
|
+
...props
|
|
53
|
+
}: CommandSeparatorProps): react_jsx_runtime0.JSX.Element;
|
|
54
|
+
declare function CommandItem({
|
|
55
|
+
className,
|
|
56
|
+
children,
|
|
57
|
+
...props
|
|
58
|
+
}: CommandItemProps): react_jsx_runtime0.JSX.Element;
|
|
59
|
+
declare function CommandShortcut({
|
|
60
|
+
className,
|
|
61
|
+
...props
|
|
62
|
+
}: CommandShortcutProps): react_jsx_runtime0.JSX.Element;
|
|
63
|
+
//#endregion
|
|
64
|
+
export { Command, CommandDialog, CommandDialogProps, CommandEmpty, CommandEmptyProps, CommandGroup, CommandGroupProps, CommandInput, CommandInputProps, CommandItem, CommandItemProps, CommandList, CommandListProps, CommandProps, CommandSeparator, CommandSeparatorProps, CommandShortcut, CommandShortcutProps };
|
|
65
|
+
//# sourceMappingURL=command.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"../chunk-IpJEthwI.js";import{cn as e}from"../lib/utils.js";import{InputGroup as t,InputGroupAddon as n}from"./input-group.js";import{Dialog as r,DialogContent as i,DialogDescription as a,DialogHeader as o,DialogTitle as s}from"./dialog.js";import{IconCheck as c,IconSearch as l}from"@tabler/icons-react";import{jsx as u,jsxs as d}from"react/jsx-runtime";import{Command as f}from"cmdk";function Command({className:t,...n}){return u(f,{"data-slot":`command`,className:e(`flex size-full flex-col overflow-hidden rounded-xl! bg-popover p-1 text-popover-foreground`,t),...n})}function CommandDialog({title:t=`Command Palette`,description:n=`Search for a command to run...`,children:c,className:l,showCloseButton:f=!1,...p}){return d(r,{...p,children:[d(o,{className:`sr-only`,children:[u(s,{children:t}),u(a,{children:n})]}),u(i,{className:e(`top-1/3 translate-y-0 overflow-hidden rounded-xl! p-0`,l),showCloseButton:f,children:c})]})}function CommandInput({className:r,...i}){return u(`div`,{"data-slot":`command-input-wrapper`,className:`p-1 pb-0`,children:d(t,{className:e(`h-8! rounded-lg! border-input/30 bg-input/30 shadow-none!`,`*:data-[slot=input-group-addon]:pl-2!`),children:[u(f.Input,{"data-slot":`command-input`,className:e(`w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,r),...i}),u(n,{children:u(l,{className:`size-4 shrink-0 opacity-50`})})]})})}function CommandList({className:t,...n}){return u(f.List,{"data-slot":`command-list`,className:e(`no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none`,t),...n})}function CommandEmpty({className:t,...n}){return u(f.Empty,{"data-slot":`command-empty`,className:e(`py-6 text-center text-sm`,t),...n})}function CommandGroup({className:t,...n}){return u(f.Group,{"data-slot":`command-group`,className:e(`overflow-hidden p-1 text-foreground`,`**:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5`,`**:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium`,`**:[[cmdk-group-heading]]:text-muted-foreground`,t),...n})}function CommandSeparator({className:t,...n}){return u(f.Separator,{"data-slot":`command-separator`,className:e(`-mx-1 h-px bg-border`,t),...n})}function CommandItem({className:t,children:n,...r}){return d(f.Item,{"data-slot":`command-item`,className:e(`group/command-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none`,`in-data-[slot=dialog-content]:rounded-lg!`,`data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50`,`data-selected:bg-muted data-selected:text-foreground data-selected:*:[svg]:text-foreground`,`[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,t),...r,children:[n,u(c,{className:e(`ml-auto opacity-0`,`group-has-data-[slot=command-shortcut]/command-item:hidden`,`group-data-[checked=true]/command-item:opacity-100`)})]})}function CommandShortcut({className:t,...n}){return u(`span`,{"data-slot":`command-shortcut`,className:e(`ml-auto text-xs tracking-widest text-muted-foreground group-data-selected/command-item:text-foreground`,t),...n})}export{Command,CommandDialog,CommandEmpty,CommandGroup,CommandInput,CommandItem,CommandList,CommandSeparator,CommandShortcut};
|
|
2
|
+
//# sourceMappingURL=command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command.js","names":["CommandPrimitive"],"sources":["../../src/components/command.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { IconCheck, IconSearch } from '@tabler/icons-react'\nimport { Command as CommandPrimitive } from 'cmdk'\n\nimport { cn } from '../lib/utils'\nimport { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from './dialog'\nimport { InputGroup, InputGroupAddon } from './input-group'\n\nexport type CommandProps = React.ComponentProps<typeof CommandPrimitive>\n\nexport type CommandDialogProps = React.ComponentProps<typeof Dialog> & {\n title?: string\n description?: string\n className?: string\n showCloseButton?: boolean\n}\n\nexport type CommandInputProps = React.ComponentProps<typeof CommandPrimitive.Input>\n\nexport type CommandListProps = React.ComponentProps<typeof CommandPrimitive.List>\n\nexport type CommandEmptyProps = React.ComponentProps<typeof CommandPrimitive.Empty>\n\nexport type CommandGroupProps = React.ComponentProps<typeof CommandPrimitive.Group>\n\nexport type CommandSeparatorProps = React.ComponentProps<typeof CommandPrimitive.Separator>\n\nexport type CommandItemProps = React.ComponentProps<typeof CommandPrimitive.Item>\n\nexport type CommandShortcutProps = React.ComponentProps<'span'>\n\nfunction Command({ className, ...props }: CommandProps) {\n return (\n <CommandPrimitive\n data-slot=\"command\"\n className={cn(\n 'flex size-full flex-col overflow-hidden rounded-xl! bg-popover p-1 text-popover-foreground',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CommandDialog({\n title = 'Command Palette',\n description = 'Search for a command to run...',\n children,\n className,\n showCloseButton = false,\n ...props\n}: CommandDialogProps) {\n return (\n <Dialog {...props}>\n <DialogHeader className=\"sr-only\">\n <DialogTitle>{title}</DialogTitle>\n <DialogDescription>{description}</DialogDescription>\n </DialogHeader>\n <DialogContent\n className={cn('top-1/3 translate-y-0 overflow-hidden rounded-xl! p-0', className)}\n showCloseButton={showCloseButton}\n >\n {children}\n </DialogContent>\n </Dialog>\n )\n}\n\nfunction CommandInput({ className, ...props }: CommandInputProps) {\n return (\n <div data-slot=\"command-input-wrapper\" className=\"p-1 pb-0\">\n <InputGroup\n className={cn(\n 'h-8! rounded-lg! border-input/30 bg-input/30 shadow-none!',\n '*:data-[slot=input-group-addon]:pl-2!'\n )}\n >\n <CommandPrimitive.Input\n data-slot=\"command-input\"\n className={cn('w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50', className)}\n {...props}\n />\n <InputGroupAddon>\n <IconSearch className=\"size-4 shrink-0 opacity-50\" />\n </InputGroupAddon>\n </InputGroup>\n </div>\n )\n}\n\nfunction CommandList({ className, ...props }: CommandListProps) {\n return (\n <CommandPrimitive.List\n data-slot=\"command-list\"\n className={cn('no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none', className)}\n {...props}\n />\n )\n}\n\nfunction CommandEmpty({ className, ...props }: CommandEmptyProps) {\n return (\n <CommandPrimitive.Empty\n data-slot=\"command-empty\"\n className={cn('py-6 text-center text-sm', className)}\n {...props}\n />\n )\n}\n\nfunction CommandGroup({ className, ...props }: CommandGroupProps) {\n return (\n <CommandPrimitive.Group\n data-slot=\"command-group\"\n className={cn(\n 'overflow-hidden p-1 text-foreground',\n '**:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5',\n '**:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium',\n '**:[[cmdk-group-heading]]:text-muted-foreground',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CommandSeparator({ className, ...props }: CommandSeparatorProps) {\n return (\n <CommandPrimitive.Separator\n data-slot=\"command-separator\"\n className={cn('-mx-1 h-px bg-border', className)}\n {...props}\n />\n )\n}\n\nfunction CommandItem({ className, children, ...props }: CommandItemProps) {\n return (\n <CommandPrimitive.Item\n data-slot=\"command-item\"\n className={cn(\n 'group/command-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none',\n 'in-data-[slot=dialog-content]:rounded-lg!',\n 'data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50',\n 'data-selected:bg-muted data-selected:text-foreground data-selected:*:[svg]:text-foreground',\n \"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n {children}\n <IconCheck\n className={cn(\n 'ml-auto opacity-0',\n 'group-has-data-[slot=command-shortcut]/command-item:hidden',\n 'group-data-[checked=true]/command-item:opacity-100'\n )}\n />\n </CommandPrimitive.Item>\n )\n}\n\nfunction CommandShortcut({ className, ...props }: CommandShortcutProps) {\n return (\n <span\n data-slot=\"command-shortcut\"\n className={cn(\n 'ml-auto text-xs tracking-widest text-muted-foreground group-data-selected/command-item:text-foreground',\n className\n )}\n {...props}\n />\n )\n}\n\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandShortcut,\n CommandSeparator\n}\n"],"mappings":"wYAgCA,SAAS,QAAQ,CAAE,YAAW,GAAG,GAAuB,CACtD,OACE,EAACA,EAAD,CACE,YAAU,UACV,UAAW,EACT,6FACA,EACD,CACD,GAAI,EACJ,CAAA,CAIN,SAAS,cAAc,CACrB,QAAQ,kBACR,cAAc,iCACd,WAC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WAAU,GAAG,GAA2B,CACxE,OACE,EAACA,EAAiB,KAAlB,CACE,YAAU,eACV,UAAW,EACT,+HACA,4CACA,2EACA,6FACA,oFACA,EACD,CACD,GAAI,WAVN,CAYG,EACD,EAAC,EAAD,CACE,UAAW,EACT,oBACA,6DACA,qDACD,CACD,CAAA,CACoB,GAI5B,SAAS,gBAAgB,CAAE,YAAW,GAAG,GAA+B,CACtE,OACE,EAAC,OAAD,CACE,YAAU,mBACV,UAAW,EACT,yGACA,EACD,CACD,GAAI,EACJ,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { t as __name } from "../chunk-IpJEthwI.js";
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
import { VariantProps } from "class-variance-authority";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import * as class_variance_authority_types0 from "class-variance-authority/types";
|
|
6
|
+
|
|
7
|
+
//#region src/components/container.d.ts
|
|
8
|
+
declare const containerVariants: (props?: ({
|
|
9
|
+
size?: "sm" | "lg" | "md" | "full" | null | undefined;
|
|
10
|
+
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
11
|
+
type ContainerProps = React.ComponentProps<'div'> & VariantProps<typeof containerVariants>;
|
|
12
|
+
declare function Container({
|
|
13
|
+
className,
|
|
14
|
+
size,
|
|
15
|
+
...props
|
|
16
|
+
}: ContainerProps): react_jsx_runtime0.JSX.Element;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { Container, ContainerProps, containerVariants };
|
|
19
|
+
//# sourceMappingURL=container.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"../chunk-IpJEthwI.js";import{cn as e}from"../lib/utils.js";import{jsx as t}from"react/jsx-runtime";import{cva as n}from"class-variance-authority";const r=n(`mx-auto w-full`,{variants:{size:{sm:`max-w-3xl px-4 sm:px-6`,md:`max-w-5xl px-4 sm:px-6 lg:px-8`,lg:`max-w-7xl px-4 sm:px-6 lg:px-8`,full:`max-w-none px-4 sm:px-6 lg:px-8`}},defaultVariants:{size:`lg`}});function Container({className:n,size:i=`lg`,...a}){return t(`div`,{"data-slot":`container`,"data-size":i,className:e(r({size:i}),n),...a})}export{Container,r as containerVariants};
|
|
2
|
+
//# sourceMappingURL=container.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"container.js","names":[],"sources":["../../src/components/container.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nimport { cn } from '../lib/utils'\n\nconst containerVariants = cva('mx-auto w-full', {\n variants: {\n size: {\n sm: 'max-w-3xl px-4 sm:px-6',\n md: 'max-w-5xl px-4 sm:px-6 lg:px-8',\n lg: 'max-w-7xl px-4 sm:px-6 lg:px-8',\n full: 'max-w-none px-4 sm:px-6 lg:px-8'\n }\n },\n defaultVariants: {\n size: 'lg'\n }\n})\n\nexport type ContainerProps = React.ComponentProps<'div'> & VariantProps<typeof containerVariants>\n\nfunction Container({ className, size = 'lg', ...props }: ContainerProps) {\n return (\n <div data-slot=\"container\" data-size={size} className={cn(containerVariants({ size }), className)} {...props} />\n )\n}\n\nexport { Container, containerVariants }\n"],"mappings":"yJAMA,MAAM,EAAoB,EAAI,iBAAkB,CAC9C,SAAU,CACR,KAAM,CACJ,GAAI,yBACJ,GAAI,iCACJ,GAAI,iCACJ,KAAM,kCACP,CACF,CACD,gBAAiB,CACf,KAAM,KACP,CACF,CAAC,CAIF,SAAS,UAAU,CAAE,YAAW,OAAO,KAAM,GAAG,GAAyB,CACvE,OACE,EAAC,MAAD,CAAK,YAAU,YAAY,YAAW,EAAM,UAAW,EAAG,EAAkB,CAAE,OAAM,CAAC,CAAE,EAAU,CAAE,GAAI,EAAS,CAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as __name } from "../chunk-IpJEthwI.js";
|
|
2
|
-
import {
|
|
2
|
+
import { Dialog as Dialog$1 } from "radix-ui";
|
|
3
3
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
+
import { VariantProps } from "class-variance-authority";
|
|
4
5
|
import * as React from "react";
|
|
5
|
-
import { Dialog as Dialog$1 } from "@base-ui/react/dialog";
|
|
6
6
|
import * as class_variance_authority_types0 from "class-variance-authority/types";
|
|
7
7
|
|
|
8
8
|
//#region src/components/dialog.d.ts
|
|
@@ -10,33 +10,41 @@ declare const dialogContentVariants: (props?: ({
|
|
|
10
10
|
size?: "sm" | "lg" | "md" | "xl" | "2xl" | null | undefined;
|
|
11
11
|
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
12
12
|
type DialogSize = NonNullable<VariantProps<typeof dialogContentVariants>['size']>;
|
|
13
|
-
type DialogProps = Dialog$1.Root
|
|
13
|
+
type DialogProps = React.ComponentProps<typeof Dialog$1.Root> & {
|
|
14
14
|
size?: DialogSize;
|
|
15
15
|
};
|
|
16
|
-
type DialogTriggerProps = Dialog$1.Trigger
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
type
|
|
20
|
-
type
|
|
16
|
+
type DialogTriggerProps = React.ComponentProps<typeof Dialog$1.Trigger> & {
|
|
17
|
+
render?: React.ReactElement;
|
|
18
|
+
};
|
|
19
|
+
type DialogPortalProps = React.ComponentProps<typeof Dialog$1.Portal>;
|
|
20
|
+
type DialogCloseProps = React.ComponentProps<typeof Dialog$1.Close> & {
|
|
21
|
+
render?: React.ReactElement;
|
|
22
|
+
};
|
|
23
|
+
type DialogOverlayProps = React.ComponentProps<typeof Dialog$1.Overlay>;
|
|
24
|
+
type DialogContentProps = React.ComponentProps<typeof Dialog$1.Content> & {
|
|
21
25
|
showCloseButton?: boolean;
|
|
22
26
|
};
|
|
23
27
|
type DialogHeaderProps = React.ComponentProps<'div'>;
|
|
24
28
|
type DialogFooterProps = React.ComponentProps<'div'> & {
|
|
25
29
|
showCloseButton?: boolean;
|
|
26
30
|
};
|
|
27
|
-
type DialogTitleProps = Dialog$1.Title
|
|
28
|
-
type DialogDescriptionProps = Dialog$1.Description
|
|
31
|
+
type DialogTitleProps = React.ComponentProps<typeof Dialog$1.Title>;
|
|
32
|
+
type DialogDescriptionProps = React.ComponentProps<typeof Dialog$1.Description>;
|
|
29
33
|
declare function Dialog({
|
|
30
34
|
size,
|
|
31
35
|
...props
|
|
32
36
|
}: DialogProps): react_jsx_runtime0.JSX.Element;
|
|
33
37
|
declare function DialogTrigger({
|
|
38
|
+
render,
|
|
39
|
+
children,
|
|
34
40
|
...props
|
|
35
41
|
}: DialogTriggerProps): react_jsx_runtime0.JSX.Element;
|
|
36
42
|
declare function DialogPortal({
|
|
37
43
|
...props
|
|
38
44
|
}: DialogPortalProps): react_jsx_runtime0.JSX.Element;
|
|
39
45
|
declare function DialogClose({
|
|
46
|
+
render,
|
|
47
|
+
children,
|
|
40
48
|
...props
|
|
41
49
|
}: DialogCloseProps): react_jsx_runtime0.JSX.Element;
|
|
42
50
|
declare function DialogOverlay({
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import"../chunk-IpJEthwI.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 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 ring-foreground/10 grid max-w-[calc(100%-2rem)] gap-4 rounded-xl p-4 text-sm ring-1 duration-100 fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 outline-none`,{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`}},defaultVariants:{size:`sm`}}),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({render:e,children:t,...n}){return e?i(r.Trigger,{"data-slot":`dialog-trigger`,asChild:!0,...n,children:e}):i(r.Trigger,{"data-slot":`dialog-trigger`,...n,children:t})}function DialogPortal({...e}){return i(r.Portal,{"data-slot":`dialog-portal`,...e})}function DialogClose({render:e,children:t,...n}){return e?i(r.Close,{"data-slot":`dialog-close`,asChild:!0,...n,children:e}):i(r.Close,{"data-slot":`dialog-close`,...n,children:t})}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,...f}){let{size:p}=s.useContext(l);return a(DialogPortal,{children:[i(DialogOverlay,{}),a(r.Content,{"data-slot":`dialog-content`,className:e(c({size:p}),o),...f,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`,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`,`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,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 {
|
|
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 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 ring-foreground/10 grid max-w-[calc(100%-2rem)] gap-4 rounded-xl p-4 text-sm ring-1 duration-100 fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 outline-none',\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 }\n },\n defaultVariants: {\n size: 'sm'\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> & { render?: React.ReactElement }\nexport type DialogPortalProps = React.ComponentProps<typeof DialogPrimitive.Portal>\nexport type DialogCloseProps = React.ComponentProps<typeof DialogPrimitive.Close> & { render?: React.ReactElement }\nexport type DialogOverlayProps = React.ComponentProps<typeof DialogPrimitive.Overlay>\nexport type DialogContentProps = React.ComponentProps<typeof DialogPrimitive.Content> & {\n showCloseButton?: boolean\n}\nexport type DialogHeaderProps = 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({ render, children, ...props }: DialogTriggerProps) {\n if (render) {\n return (\n <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" asChild {...props}>\n {render}\n </DialogPrimitive.Trigger>\n )\n }\n\n return (\n <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props}>\n {children}\n </DialogPrimitive.Trigger>\n )\n}\n\nfunction DialogPortal({ ...props }: DialogPortalProps) {\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />\n}\n\nfunction DialogClose({ render, children, ...props }: DialogCloseProps) {\n if (render) {\n return (\n <DialogPrimitive.Close data-slot=\"dialog-close\" asChild {...props}>\n {render}\n </DialogPrimitive.Close>\n )\n }\n\n return (\n <DialogPrimitive.Close data-slot=\"dialog-close\" {...props}>\n {children}\n </DialogPrimitive.Close>\n )\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, ...props }: DialogContentProps) {\n const { size } = React.useContext(DialogSizeContext)\n\n return (\n <DialogPortal>\n <DialogOverlay />\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', 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',\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 DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger\n}\n"],"mappings":"8SASA,MAAM,EAA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-authority";
|
|
3
2
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
import { VariantProps } from "class-variance-authority";
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
import { Drawer as Drawer$1 } from "vaul";
|
|
6
6
|
import * as class_variance_authority_types0 from "class-variance-authority/types";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import"../chunk-IpJEthwI.js";import{cn as e}from"../lib/utils.js";import{jsx as t,jsxs as n}from"react/jsx-runtime";import{cva as r}from"class-variance-authority";import*as i from"react";import{Drawer as a}from"vaul";const o=r(`bg-background flex h-auto flex-col text-sm data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:rounded-t-xl data-[vaul-drawer-direction=bottom]:border-t data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:rounded-r-xl data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:rounded-l-xl data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:rounded-b-xl data-[vaul-drawer-direction=top]:border-b group/drawer-content fixed z-50`,{variants:{size:{sm:`data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:sm:max-w-sm data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:sm:max-w-sm`,md:`data-[vaul-drawer-direction=bottom]:mt-20 data-[vaul-drawer-direction=bottom]:max-h-[85vh] data-[vaul-drawer-direction=top]:mb-20 data-[vaul-drawer-direction=top]:max-h-[85vh] data-[vaul-drawer-direction=left]:w-4/5 data-[vaul-drawer-direction=left]:sm:max-w-md data-[vaul-drawer-direction=right]:w-4/5 data-[vaul-drawer-direction=right]:sm:max-w-md`,lg:`data-[vaul-drawer-direction=bottom]:mt-12 data-[vaul-drawer-direction=bottom]:max-h-[90vh] data-[vaul-drawer-direction=top]:mb-12 data-[vaul-drawer-direction=top]:max-h-[90vh] data-[vaul-drawer-direction=left]:w-[90%] data-[vaul-drawer-direction=left]:sm:max-w-lg data-[vaul-drawer-direction=right]:w-[90%] data-[vaul-drawer-direction=right]:sm:max-w-lg`}},defaultVariants:{size:`sm`}}),s=i.createContext({size:`sm`});function Drawer({size:e=`sm`,...n}){let r=i.useMemo(()=>({size:e}),[e]);return t(s.Provider,{value:r,children:t(a.Root,{"data-slot":`drawer`,...n})})}function DrawerTrigger({...e}){return t(a.Trigger,{"data-slot":`drawer-trigger`,...e})}function DrawerPortal({...e}){return t(a.Portal,{"data-slot":`drawer-portal`,...e})}function DrawerClose({...e}){return t(a.Close,{"data-slot":`drawer-close`,...e})}function DrawerOverlay({className:n,...r}){return t(a.Overlay,{"data-slot":`drawer-overlay`,className:e(`bg-black/10 fixed inset-0 z-50`,`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0`,`supports-backdrop-filter:backdrop-blur-xs`,n),...r})}function DrawerContent({className:r,children:c,...l}){let{size:u}=i.useContext(s);return n(DrawerPortal,{"data-slot":`drawer-portal`,children:[t(DrawerOverlay,{}),n(a.Content,{"data-slot":`drawer-content`,className:e(o({size:u}),r),...l,children:[t(`div`,{className:`bg-muted mt-4 h-1 w-25 rounded-full mx-auto hidden shrink-0 group-data-[vaul-drawer-direction=bottom]/drawer-content:block`}),c]})]})}function DrawerHeader({className:n,...r}){return t(`div`,{"data-slot":`drawer-header`,className:e(`p-4 flex flex-col gap-0.5 md:gap-0.5`,`group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center`,`group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:text-left`,n),...r})}function DrawerFooter({className:n,...r}){return t(`div`,{"data-slot":`drawer-footer`,className:e(`gap-2 p-4 mt-auto flex flex-col`,n),...r})}function DrawerTitle({className:n,...r}){return t(a.Title,{"data-slot":`drawer-title`,className:e(`text-foreground text-base font-medium`,n),...r})}function DrawerDescription({className:n,...r}){return t(a.Description,{"data-slot":`drawer-description`,className:e(`text-muted-foreground text-sm`,n),...r})}export{Drawer,DrawerClose,DrawerContent,DrawerDescription,DrawerFooter,DrawerHeader,DrawerOverlay,DrawerPortal,DrawerTitle,DrawerTrigger};
|
|
2
2
|
//# sourceMappingURL=drawer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawer.js","names":["DrawerPrimitive"],"sources":["../../src/components/drawer.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { Drawer as DrawerPrimitive } from 'vaul'\n\nimport { cn } from '../lib/utils'\n\nconst drawerContentVariants = cva(\n 'bg-background flex h-auto flex-col text-sm data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:rounded-t-xl data-[vaul-drawer-direction=bottom]:border-t data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:rounded-r-xl data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:rounded-l-xl data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:rounded-b-xl data-[vaul-drawer-direction=top]:border-b group/drawer-content fixed z-50',\n {\n variants: {\n size: {\n sm: 'data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:sm:max-w-sm data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:sm:max-w-sm',\n md: 'data-[vaul-drawer-direction=bottom]:mt-20 data-[vaul-drawer-direction=bottom]:max-h-[85vh] data-[vaul-drawer-direction=top]:mb-20 data-[vaul-drawer-direction=top]:max-h-[85vh] data-[vaul-drawer-direction=left]:w-4/5 data-[vaul-drawer-direction=left]:sm:max-w-md data-[vaul-drawer-direction=right]:w-4/5 data-[vaul-drawer-direction=right]:sm:max-w-md',\n lg: 'data-[vaul-drawer-direction=bottom]:mt-12 data-[vaul-drawer-direction=bottom]:max-h-[90vh] data-[vaul-drawer-direction=top]:mb-12 data-[vaul-drawer-direction=top]:max-h-[90vh] data-[vaul-drawer-direction=left]:w-[90%] data-[vaul-drawer-direction=left]:sm:max-w-lg data-[vaul-drawer-direction=right]:w-[90%] data-[vaul-drawer-direction=right]:sm:max-w-lg'\n }\n },\n defaultVariants: {\n size: 'sm'\n }\n }\n)\n\ntype DrawerSize = NonNullable<VariantProps<typeof drawerContentVariants>['size']>\
|
|
1
|
+
{"version":3,"file":"drawer.js","names":["DrawerPrimitive"],"sources":["../../src/components/drawer.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { Drawer as DrawerPrimitive } from 'vaul'\n\nimport { cn } from '../lib/utils'\n\nconst drawerContentVariants = cva(\n 'bg-background flex h-auto flex-col text-sm data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:rounded-t-xl data-[vaul-drawer-direction=bottom]:border-t data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:rounded-r-xl data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:rounded-l-xl data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:rounded-b-xl data-[vaul-drawer-direction=top]:border-b group/drawer-content fixed z-50',\n {\n variants: {\n size: {\n sm: 'data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:sm:max-w-sm data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:sm:max-w-sm',\n md: 'data-[vaul-drawer-direction=bottom]:mt-20 data-[vaul-drawer-direction=bottom]:max-h-[85vh] data-[vaul-drawer-direction=top]:mb-20 data-[vaul-drawer-direction=top]:max-h-[85vh] data-[vaul-drawer-direction=left]:w-4/5 data-[vaul-drawer-direction=left]:sm:max-w-md data-[vaul-drawer-direction=right]:w-4/5 data-[vaul-drawer-direction=right]:sm:max-w-md',\n lg: 'data-[vaul-drawer-direction=bottom]:mt-12 data-[vaul-drawer-direction=bottom]:max-h-[90vh] data-[vaul-drawer-direction=top]:mb-12 data-[vaul-drawer-direction=top]:max-h-[90vh] data-[vaul-drawer-direction=left]:w-[90%] data-[vaul-drawer-direction=left]:sm:max-w-lg data-[vaul-drawer-direction=right]:w-[90%] data-[vaul-drawer-direction=right]:sm:max-w-lg'\n }\n },\n defaultVariants: {\n size: 'sm'\n }\n }\n)\n\ntype DrawerSize = NonNullable<VariantProps<typeof drawerContentVariants>['size']>\ntype DrawerSizeContextValue = { size: DrawerSize }\nconst DrawerSizeContext = React.createContext<DrawerSizeContextValue>({ size: 'sm' })\n\nexport type DrawerProps = React.ComponentProps<typeof DrawerPrimitive.Root> & { size?: DrawerSize }\nexport type DrawerTriggerProps = React.ComponentProps<typeof DrawerPrimitive.Trigger>\nexport type DrawerPortalProps = React.ComponentProps<typeof DrawerPrimitive.Portal>\nexport type DrawerCloseProps = React.ComponentProps<typeof DrawerPrimitive.Close>\nexport type DrawerOverlayProps = React.ComponentProps<typeof DrawerPrimitive.Overlay>\nexport type DrawerContentProps = React.ComponentProps<typeof DrawerPrimitive.Content>\nexport type DrawerHeaderProps = React.ComponentProps<'div'>\nexport type DrawerFooterProps = React.ComponentProps<'div'>\nexport type DrawerTitleProps = React.ComponentProps<typeof DrawerPrimitive.Title>\nexport type DrawerDescriptionProps = React.ComponentProps<typeof DrawerPrimitive.Description>\n\nfunction Drawer({ size = 'sm', ...props }: DrawerProps) {\n const contextValue = React.useMemo<DrawerSizeContextValue>(() => ({ size }), [size])\n\n return (\n <DrawerSizeContext.Provider value={contextValue}>\n <DrawerPrimitive.Root data-slot=\"drawer\" {...props} />\n </DrawerSizeContext.Provider>\n )\n}\n\nfunction DrawerTrigger({ ...props }: DrawerTriggerProps) {\n return <DrawerPrimitive.Trigger data-slot=\"drawer-trigger\" {...props} />\n}\n\nfunction DrawerPortal({ ...props }: DrawerPortalProps) {\n return <DrawerPrimitive.Portal data-slot=\"drawer-portal\" {...props} />\n}\n\nfunction DrawerClose({ ...props }: DrawerCloseProps) {\n return <DrawerPrimitive.Close data-slot=\"drawer-close\" {...props} />\n}\n\nfunction DrawerOverlay({ className, ...props }: DrawerOverlayProps) {\n return (\n <DrawerPrimitive.Overlay\n data-slot=\"drawer-overlay\"\n className={cn(\n 'bg-black/10 fixed inset-0 z-50',\n 'data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0',\n 'supports-backdrop-filter:backdrop-blur-xs',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DrawerContent({ className, children, ...props }: DrawerContentProps) {\n const { size } = React.useContext(DrawerSizeContext)\n\n return (\n <DrawerPortal data-slot=\"drawer-portal\">\n <DrawerOverlay />\n <DrawerPrimitive.Content\n data-slot=\"drawer-content\"\n className={cn(drawerContentVariants({ size }), className)}\n {...props}\n >\n <div className=\"bg-muted mt-4 h-1 w-25 rounded-full mx-auto hidden shrink-0 group-data-[vaul-drawer-direction=bottom]/drawer-content:block\" />\n {children}\n </DrawerPrimitive.Content>\n </DrawerPortal>\n )\n}\n\nfunction DrawerHeader({ className, ...props }: DrawerHeaderProps) {\n return (\n <div\n data-slot=\"drawer-header\"\n className={cn(\n 'p-4 flex flex-col gap-0.5 md:gap-0.5',\n 'group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center',\n 'group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:text-left',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DrawerFooter({ className, ...props }: DrawerFooterProps) {\n return <div data-slot=\"drawer-footer\" className={cn('gap-2 p-4 mt-auto flex flex-col', className)} {...props} />\n}\n\nfunction DrawerTitle({ className, ...props }: DrawerTitleProps) {\n return (\n <DrawerPrimitive.Title\n data-slot=\"drawer-title\"\n className={cn('text-foreground text-base font-medium', className)}\n {...props}\n />\n )\n}\n\nfunction DrawerDescription({ className, ...props }: DrawerDescriptionProps) {\n return (\n <DrawerPrimitive.Description\n data-slot=\"drawer-description\"\n className={cn('text-muted-foreground text-sm', className)}\n {...props}\n />\n )\n}\n\nexport {\n Drawer,\n DrawerClose,\n DrawerContent,\n DrawerDescription,\n DrawerFooter,\n DrawerHeader,\n DrawerOverlay,\n DrawerPortal,\n DrawerTitle,\n DrawerTrigger\n}\n"],"mappings":"yNAOA,MAAM,EAAwB,EAC5B,mxBACA,CACE,SAAU,CACR,KAAM,CACJ,GAAI,gWACJ,GAAI,gWACJ,GAAI,oWACL,CACF,CACD,gBAAiB,CACf,KAAM,KACP,CACF,CACF,CAIK,EAAoB,EAAM,cAAsC,CAAE,KAAM,KAAM,CAAC,CAarF,SAAS,OAAO,CAAE,OAAO,KAAM,GAAG,GAAsB,CACtD,IAAM,EAAe,EAAM,aAAuC,CAAE,OAAM,EAAG,CAAC,EAAK,CAAC,CAEpF,OACE,EAAC,EAAkB,SAAnB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