@aaas-pro/library 0.0.0-stage → 0.1.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 +107 -2
- package/dist/components/address-picker.d.ts +18 -0
- package/dist/components/address-picker.js +46 -0
- package/dist/components/card-date-filter.d.ts +12 -0
- package/dist/components/card-date-filter.js +95 -0
- package/dist/components/date-time-picker.d.ts +12 -0
- package/dist/components/date-time-picker.js +96 -0
- package/dist/components/detail-dialog.d.ts +48 -0
- package/dist/components/detail-dialog.js +97 -0
- package/dist/components/document-links.d.ts +13 -0
- package/dist/components/document-links.js +19 -0
- package/dist/components/draft-row-actions.d.ts +14 -0
- package/dist/components/draft-row-actions.js +70 -0
- package/dist/components/error-boundary.d.ts +14 -0
- package/dist/components/error-boundary.js +35 -0
- package/dist/components/glow-card.d.ts +13 -0
- package/dist/components/glow-card.js +48 -0
- package/dist/components/org-picker.d.ts +17 -0
- package/dist/components/org-picker.js +56 -0
- package/dist/components/overflow-row-actions.d.ts +29 -0
- package/dist/components/overflow-row-actions.js +135 -0
- package/dist/components/page-header.d.ts +21 -0
- package/dist/components/page-header.js +21 -0
- package/dist/components/permission-button.d.ts +4 -0
- package/dist/components/permission-button.js +17 -0
- package/dist/components/permission-context.d.ts +12 -0
- package/dist/components/permission-context.js +17 -0
- package/dist/components/person-picker.d.ts +20 -0
- package/dist/components/person-picker.js +38 -0
- package/dist/components/process-flow-bar.d.ts +15 -0
- package/dist/components/process-flow-bar.js +19 -0
- package/dist/components/product-picker.d.ts +19 -0
- package/dist/components/product-picker.js +155 -0
- package/dist/components/ref-doc-picker.d.ts +24 -0
- package/dist/components/ref-doc-picker.js +139 -0
- package/dist/components/scroll-to-top.d.ts +1 -0
- package/dist/components/scroll-to-top.js +20 -0
- package/dist/components/state-view.d.ts +26 -0
- package/dist/components/state-view.js +75 -0
- package/dist/components/theme-switcher.d.ts +27 -0
- package/dist/components/theme-switcher.js +77 -0
- package/dist/components/time-filter.d.ts +7 -0
- package/dist/components/time-filter.js +65 -0
- package/dist/components/ui/accordion.d.ts +7 -0
- package/dist/components/ui/accordion.js +64 -0
- package/dist/components/ui/alert-dialog.d.ts +15 -0
- package/dist/components/ui/alert-dialog.js +160 -0
- package/dist/components/ui/alert.d.ts +12 -0
- package/dist/components/ui/alert.js +66 -0
- package/dist/components/ui/aspect-ratio.d.ts +3 -0
- package/dist/components/ui/aspect-ratio.js +10 -0
- package/dist/components/ui/avatar.d.ts +6 -0
- package/dist/components/ui/avatar.js +53 -0
- package/dist/components/ui/badge.d.ts +12 -0
- package/dist/components/ui/badge.js +44 -0
- package/dist/components/ui/breadcrumb.d.ts +11 -0
- package/dist/components/ui/breadcrumb.js +103 -0
- package/dist/components/ui/button-group.d.ts +14 -0
- package/dist/components/ui/button-group.js +76 -0
- package/dist/components/ui/button.d.ts +20 -0
- package/dist/components/ui/button.js +93 -0
- package/dist/components/ui/calendar.d.ts +73 -0
- package/dist/components/ui/calendar.js +103 -0
- package/dist/components/ui/card.d.ts +9 -0
- package/dist/components/ui/card.js +90 -0
- package/dist/components/ui/carousel.d.ts +14 -0
- package/dist/components/ui/carousel.js +200 -0
- package/dist/components/ui/chart.d.ts +43 -0
- package/dist/components/ui/chart.js +252 -0
- package/dist/components/ui/checkbox.d.ts +4 -0
- package/dist/components/ui/checkbox.js +31 -0
- package/dist/components/ui/collapsible.d.ts +5 -0
- package/dist/components/ui/collapsible.js +34 -0
- package/dist/components/ui/command.d.ts +18 -0
- package/dist/components/ui/command.js +170 -0
- package/dist/components/ui/context-menu.d.ts +26 -0
- package/dist/components/ui/context-menu.js +237 -0
- package/dist/components/ui/dialog.d.ts +17 -0
- package/dist/components/ui/dialog.js +139 -0
- package/dist/components/ui/drawer.d.ts +13 -0
- package/dist/components/ui/drawer.js +129 -0
- package/dist/components/ui/dropdown-menu.d.ts +26 -0
- package/dist/components/ui/dropdown-menu.js +245 -0
- package/dist/components/ui/empty.d.ts +14 -0
- package/dist/components/ui/empty.js +102 -0
- package/dist/components/ui/field.d.ts +27 -0
- package/dist/components/ui/field.js +229 -0
- package/dist/components/ui/form.d.ts +26 -0
- package/dist/components/ui/form.js +118 -0
- package/dist/components/ui/hover-card.d.ts +6 -0
- package/dist/components/ui/hover-card.js +39 -0
- package/dist/components/ui/input-group.d.ts +22 -0
- package/dist/components/ui/input-group.js +156 -0
- package/dist/components/ui/input-otp.d.ts +11 -0
- package/dist/components/ui/input-otp.js +66 -0
- package/dist/components/ui/input.d.ts +3 -0
- package/dist/components/ui/input.js +21 -0
- package/dist/components/ui/item.d.ts +29 -0
- package/dist/components/ui/item.js +187 -0
- package/dist/components/ui/kbd.d.ts +3 -0
- package/dist/components/ui/kbd.js +31 -0
- package/dist/components/ui/label.d.ts +4 -0
- package/dist/components/ui/label.js +22 -0
- package/dist/components/ui/menubar.d.ts +26 -0
- package/dist/components/ui/menubar.js +252 -0
- package/dist/components/ui/navigation-menu.d.ts +17 -0
- package/dist/components/ui/navigation-menu.js +170 -0
- package/dist/components/ui/pagination.d.ts +13 -0
- package/dist/components/ui/pagination.js +118 -0
- package/dist/components/ui/popover.d.ts +8 -0
- package/dist/components/ui/popover.js +47 -0
- package/dist/components/ui/progress.d.ts +4 -0
- package/dist/components/ui/progress.js +34 -0
- package/dist/components/ui/radio-group.d.ts +5 -0
- package/dist/components/ui/radio-group.js +45 -0
- package/dist/components/ui/resizable.d.ts +7 -0
- package/dist/components/ui/resizable.js +49 -0
- package/dist/components/ui/scroll-area.d.ts +5 -0
- package/dist/components/ui/scroll-area.js +60 -0
- package/dist/components/ui/select.d.ts +17 -0
- package/dist/components/ui/select.js +215 -0
- package/dist/components/ui/separator.d.ts +4 -0
- package/dist/components/ui/separator.js +26 -0
- package/dist/components/ui/sheet.d.ts +13 -0
- package/dist/components/ui/sheet.js +127 -0
- package/dist/components/ui/sidebar.d.ts +72 -0
- package/dist/components/ui/sidebar.js +656 -0
- package/dist/components/ui/skeleton.d.ts +2 -0
- package/dist/components/ui/skeleton.js +15 -0
- package/dist/components/ui/slider.d.ts +4 -0
- package/dist/components/ui/slider.js +63 -0
- package/dist/components/ui/sonner.d.ts +4 -0
- package/dist/components/ui/sonner.js +34 -0
- package/dist/components/ui/spinner.d.ts +2 -0
- package/dist/components/ui/spinner.js +17 -0
- package/dist/components/ui/switch.d.ts +4 -0
- package/dist/components/ui/switch.js +31 -0
- package/dist/components/ui/table.d.ts +10 -0
- package/dist/components/ui/table.js +114 -0
- package/dist/components/ui/tabs.d.ts +7 -0
- package/dist/components/ui/tabs.js +67 -0
- package/dist/components/ui/textarea.d.ts +3 -0
- package/dist/components/ui/textarea.js +18 -0
- package/dist/components/ui/toggle-group.d.ts +9 -0
- package/dist/components/ui/toggle-group.js +68 -0
- package/dist/components/ui/toggle.d.ts +12 -0
- package/dist/components/ui/toggle.js +43 -0
- package/dist/components/ui/tooltip.d.ts +7 -0
- package/dist/components/ui/tooltip.js +56 -0
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/hooks/use-mobile.js +18 -0
- package/dist/icons/index.d.ts +57 -0
- package/dist/icons/index.js +115 -0
- package/dist/icons/paths.d.ts +556 -0
- package/dist/icons/paths.js +231 -0
- package/dist/index.d.ts +68 -0
- package/dist/index.js +399 -0
- package/dist/internal/selection-base.d.ts +37 -0
- package/dist/internal/selection-base.js +40 -0
- package/dist/lib/class-names.d.ts +6 -0
- package/dist/lib/class-names.js +159 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.js +7 -0
- package/dist/lib/variants.d.ts +21 -0
- package/dist/lib/variants.js +21 -0
- package/dist/primitives/accordion.d.ts +29 -0
- package/dist/primitives/accordion.js +49 -0
- package/dist/primitives/alert-dialog.d.ts +10 -0
- package/dist/primitives/alert-dialog.js +22 -0
- package/dist/primitives/aspect-ratio.d.ts +4 -0
- package/dist/primitives/aspect-ratio.js +7 -0
- package/dist/primitives/avatar.d.ts +8 -0
- package/dist/primitives/avatar.js +45 -0
- package/dist/primitives/carousel.d.ts +22 -0
- package/dist/primitives/carousel.js +78 -0
- package/dist/primitives/chart.d.ts +71 -0
- package/dist/primitives/chart.js +125 -0
- package/dist/primitives/checkbox.d.ts +13 -0
- package/dist/primitives/checkbox.js +24 -0
- package/dist/primitives/collapsible.d.ts +14 -0
- package/dist/primitives/collapsible.js +29 -0
- package/dist/primitives/command.d.ts +43 -0
- package/dist/primitives/command.js +98 -0
- package/dist/primitives/context-menu.d.ts +24 -0
- package/dist/primitives/context-menu.js +19 -0
- package/dist/primitives/core.d.ts +25 -0
- package/dist/primitives/core.js +89 -0
- package/dist/primitives/dialog.d.ts +7 -0
- package/dist/primitives/dialog.js +15 -0
- package/dist/primitives/drawer.d.ts +30 -0
- package/dist/primitives/drawer.js +39 -0
- package/dist/primitives/dropdown-menu.d.ts +24 -0
- package/dist/primitives/dropdown-menu.js +19 -0
- package/dist/primitives/form.d.ts +154 -0
- package/dist/primitives/form.js +139 -0
- package/dist/primitives/hover-card.d.ts +4 -0
- package/dist/primitives/hover-card.js +8 -0
- package/dist/primitives/input-otp.d.ts +21 -0
- package/dist/primitives/input-otp.js +78 -0
- package/dist/primitives/label.d.ts +2 -0
- package/dist/primitives/label.js +7 -0
- package/dist/primitives/layer.d.ts +84 -0
- package/dist/primitives/layer.js +300 -0
- package/dist/primitives/menu.d.ts +56 -0
- package/dist/primitives/menu.js +126 -0
- package/dist/primitives/menubar.d.ts +91 -0
- package/dist/primitives/menubar.js +44 -0
- package/dist/primitives/navigation-menu.d.ts +32 -0
- package/dist/primitives/navigation-menu.js +121 -0
- package/dist/primitives/popover.d.ts +4 -0
- package/dist/primitives/popover.js +12 -0
- package/dist/primitives/progress.d.ts +7 -0
- package/dist/primitives/progress.js +13 -0
- package/dist/primitives/radio-group.d.ts +18 -0
- package/dist/primitives/radio-group.js +36 -0
- package/dist/primitives/resizable.d.ts +19 -0
- package/dist/primitives/resizable.js +91 -0
- package/dist/primitives/scroll-area.d.ts +12 -0
- package/dist/primitives/scroll-area.js +26 -0
- package/dist/primitives/select.d.ts +42 -0
- package/dist/primitives/select.js +167 -0
- package/dist/primitives/separator.d.ts +5 -0
- package/dist/primitives/separator.js +7 -0
- package/dist/primitives/slider.d.ts +25 -0
- package/dist/primitives/slider.js +98 -0
- package/dist/primitives/slot.d.ts +1 -0
- package/dist/primitives/slot.js +4 -0
- package/dist/primitives/switch.d.ts +11 -0
- package/dist/primitives/switch.js +22 -0
- package/dist/primitives/tabs.d.ts +23 -0
- package/dist/primitives/tabs.js +38 -0
- package/dist/primitives/toast.d.ts +55 -0
- package/dist/primitives/toast.js +86 -0
- package/dist/primitives/toggle-group.d.ts +24 -0
- package/dist/primitives/toggle-group.js +33 -0
- package/dist/primitives/toggle.d.ts +7 -0
- package/dist/primitives/toggle.js +13 -0
- package/dist/primitives/tooltip.d.ts +7 -0
- package/dist/primitives/tooltip.js +10 -0
- package/dist/style-entry.d.ts +1 -0
- package/dist/style-entry.js +1 -0
- package/dist/styles.css +7016 -0
- package/dist/styles.js +1 -0
- package/dist/theme/index.d.ts +110 -0
- package/dist/theme/index.js +199 -0
- package/licenses/Lucide.txt +15 -0
- package/package.json +67 -4
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useThemePortalContainer } from "../../theme/index.js";
|
|
3
|
+
import { Root, Portal, Content, Viewport, Group, Item, ItemIndicator, ItemText, Label, ScrollDownButton, ScrollUpButton, Separator, useSelectState, Trigger, Icon, Value } from "../../primitives/select.js";
|
|
4
|
+
import { CheckIcon, ChevronDownIcon, ChevronUpIcon, XIcon } from "../../icons/index.js";
|
|
5
|
+
import { cn } from "../../lib/utils.js";
|
|
6
|
+
function Select({
|
|
7
|
+
...props
|
|
8
|
+
}) {
|
|
9
|
+
return /* @__PURE__ */ jsx(Root, { "data-slot": "select", ...props });
|
|
10
|
+
}
|
|
11
|
+
function SelectGroup({
|
|
12
|
+
...props
|
|
13
|
+
}) {
|
|
14
|
+
return /* @__PURE__ */ jsx(Group, { "data-slot": "select-group", ...props });
|
|
15
|
+
}
|
|
16
|
+
function SelectValue({
|
|
17
|
+
className,
|
|
18
|
+
...props
|
|
19
|
+
}) {
|
|
20
|
+
return /* @__PURE__ */ jsx(Value, { "data-slot": "select-value", className: cn("flex min-w-0 items-center gap-2 truncate", className), ...props });
|
|
21
|
+
}
|
|
22
|
+
function SelectTrigger({
|
|
23
|
+
className,
|
|
24
|
+
size = "default",
|
|
25
|
+
children,
|
|
26
|
+
onClear,
|
|
27
|
+
...props
|
|
28
|
+
}) {
|
|
29
|
+
const selection = useSelectState();
|
|
30
|
+
const disabled = Boolean(props.disabled || selection.disabled);
|
|
31
|
+
return /* @__PURE__ */ jsxs(
|
|
32
|
+
Trigger,
|
|
33
|
+
{
|
|
34
|
+
"data-slot": "select-trigger",
|
|
35
|
+
"data-size": size,
|
|
36
|
+
className: cn(
|
|
37
|
+
"group border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/15 data-[state=open]:border-ring data-[state=open]:ring-2 data-[state=open]:ring-ring/15 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive flex w-fit items-center gap-2 rounded-md border bg-card px-3 py-2 text-sm whitespace-nowrap transition-[color,border-color,box-shadow] duration-150 outline-none focus-visible:ring-2 hover:not-disabled:border-primary disabled:cursor-not-allowed disabled:bg-muted disabled:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
38
|
+
className
|
|
39
|
+
),
|
|
40
|
+
...props,
|
|
41
|
+
children: [
|
|
42
|
+
/* @__PURE__ */ jsx("span", { "data-slot": "select-trigger-label", className: "flex min-w-0 flex-1 items-center gap-2 overflow-hidden text-start", children }),
|
|
43
|
+
/* @__PURE__ */ jsxs("span", { "data-slot": "select-trigger-actions", className: "ml-auto inline-flex shrink-0 items-center gap-1", children: [
|
|
44
|
+
onClear && selection.value && !disabled && /* @__PURE__ */ jsx(
|
|
45
|
+
"span",
|
|
46
|
+
{
|
|
47
|
+
"data-slot": "select-clear",
|
|
48
|
+
role: "button",
|
|
49
|
+
"aria-label": "清空选择",
|
|
50
|
+
tabIndex: 0,
|
|
51
|
+
className: "pointer-events-auto grid size-5 shrink-0 cursor-pointer place-items-center rounded-full text-muted-foreground opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100 hover:bg-muted hover:text-foreground focus-visible:opacity-100 focus-visible:outline-2 focus-visible:outline-ring",
|
|
52
|
+
onPointerDown: (e) => {
|
|
53
|
+
e.stopPropagation();
|
|
54
|
+
},
|
|
55
|
+
onKeyDown: (e) => {
|
|
56
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
57
|
+
e.preventDefault();
|
|
58
|
+
e.stopPropagation();
|
|
59
|
+
onClear();
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
onClick: (e) => {
|
|
63
|
+
e.preventDefault();
|
|
64
|
+
e.stopPropagation();
|
|
65
|
+
onClear();
|
|
66
|
+
},
|
|
67
|
+
children: /* @__PURE__ */ jsx(XIcon, { className: "size-3 text-current" })
|
|
68
|
+
}
|
|
69
|
+
),
|
|
70
|
+
/* @__PURE__ */ jsx(Icon, { asChild: true, children: /* @__PURE__ */ jsx(ChevronDownIcon, { className: "size-3.5 text-muted-foreground transition-transform duration-150 group-data-[state=open]:rotate-180" }) })
|
|
71
|
+
] })
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
function SelectContent({
|
|
77
|
+
className,
|
|
78
|
+
children,
|
|
79
|
+
position = "popper",
|
|
80
|
+
align = "start",
|
|
81
|
+
sideOffset = 4,
|
|
82
|
+
style,
|
|
83
|
+
...props
|
|
84
|
+
}) {
|
|
85
|
+
return /* @__PURE__ */ jsx(Portal, { container: useThemePortalContainer(), children: /* @__PURE__ */ jsxs(
|
|
86
|
+
Content,
|
|
87
|
+
{
|
|
88
|
+
"data-slot": "select-content",
|
|
89
|
+
className: cn(
|
|
90
|
+
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 relative z-[80] flex max-h-[min(20rem,var(--aaas-content-available-height))] max-w-[calc(100vw-16px)] min-w-[8rem] flex-col origin-(--aaas-content-transform-origin) overflow-hidden rounded-lg border border-border p-1 shadow-md",
|
|
91
|
+
className
|
|
92
|
+
),
|
|
93
|
+
position,
|
|
94
|
+
align,
|
|
95
|
+
sideOffset,
|
|
96
|
+
style: { maxHeight: "min(20rem, var(--aaas-content-available-height))", ...style },
|
|
97
|
+
...props,
|
|
98
|
+
children: [
|
|
99
|
+
/* @__PURE__ */ jsx(SelectScrollUpButton, {}),
|
|
100
|
+
/* @__PURE__ */ jsx(
|
|
101
|
+
Viewport,
|
|
102
|
+
{
|
|
103
|
+
"data-slot": "select-viewport",
|
|
104
|
+
className: cn(
|
|
105
|
+
"min-h-0 flex-1",
|
|
106
|
+
position === "popper" && "w-full scroll-my-1"
|
|
107
|
+
),
|
|
108
|
+
children
|
|
109
|
+
}
|
|
110
|
+
),
|
|
111
|
+
/* @__PURE__ */ jsx(SelectScrollDownButton, {})
|
|
112
|
+
]
|
|
113
|
+
}
|
|
114
|
+
) });
|
|
115
|
+
}
|
|
116
|
+
function SelectLabel({
|
|
117
|
+
className,
|
|
118
|
+
...props
|
|
119
|
+
}) {
|
|
120
|
+
return /* @__PURE__ */ jsx(
|
|
121
|
+
Label,
|
|
122
|
+
{
|
|
123
|
+
"data-slot": "select-label",
|
|
124
|
+
className: cn("text-muted-foreground px-3 py-2 text-xs font-medium", className),
|
|
125
|
+
...props
|
|
126
|
+
}
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
function SelectItem({
|
|
130
|
+
className,
|
|
131
|
+
children,
|
|
132
|
+
...props
|
|
133
|
+
}) {
|
|
134
|
+
return /* @__PURE__ */ jsxs(
|
|
135
|
+
Item,
|
|
136
|
+
{
|
|
137
|
+
"data-slot": "select-item",
|
|
138
|
+
className: cn(
|
|
139
|
+
"hover:bg-muted focus:bg-muted focus:text-foreground data-[state=checked]:bg-primary/10 data-[state=checked]:font-medium data-[state=checked]:text-primary data-[state=checked]:hover:bg-primary/15 data-[state=checked]:focus:bg-primary/15 [&_svg:not([class*='text-'])]:text-muted-foreground relative flex min-h-8 w-full cursor-pointer items-center gap-2 rounded-md py-1.5 pr-9 pl-3 text-left text-sm outline-none select-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-45 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
|
|
140
|
+
className
|
|
141
|
+
),
|
|
142
|
+
...props,
|
|
143
|
+
children: [
|
|
144
|
+
/* @__PURE__ */ jsx(
|
|
145
|
+
"span",
|
|
146
|
+
{
|
|
147
|
+
"data-slot": "select-item-indicator",
|
|
148
|
+
className: "absolute right-3 flex size-3.5 items-center justify-center",
|
|
149
|
+
children: /* @__PURE__ */ jsx(ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-3.5 text-primary" }) })
|
|
150
|
+
}
|
|
151
|
+
),
|
|
152
|
+
/* @__PURE__ */ jsx(ItemText, { children })
|
|
153
|
+
]
|
|
154
|
+
}
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
function SelectSeparator({
|
|
158
|
+
className,
|
|
159
|
+
...props
|
|
160
|
+
}) {
|
|
161
|
+
return /* @__PURE__ */ jsx(
|
|
162
|
+
Separator,
|
|
163
|
+
{
|
|
164
|
+
"data-slot": "select-separator",
|
|
165
|
+
className: cn("bg-border pointer-events-none my-1 h-px", className),
|
|
166
|
+
...props
|
|
167
|
+
}
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
function SelectScrollUpButton({
|
|
171
|
+
className,
|
|
172
|
+
...props
|
|
173
|
+
}) {
|
|
174
|
+
return /* @__PURE__ */ jsx(
|
|
175
|
+
ScrollUpButton,
|
|
176
|
+
{
|
|
177
|
+
"data-slot": "select-scroll-up-button",
|
|
178
|
+
className: cn(
|
|
179
|
+
"flex h-6 w-full shrink-0 cursor-pointer items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
180
|
+
className
|
|
181
|
+
),
|
|
182
|
+
...props,
|
|
183
|
+
children: /* @__PURE__ */ jsx(ChevronUpIcon, { className: "size-4" })
|
|
184
|
+
}
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
function SelectScrollDownButton({
|
|
188
|
+
className,
|
|
189
|
+
...props
|
|
190
|
+
}) {
|
|
191
|
+
return /* @__PURE__ */ jsx(
|
|
192
|
+
ScrollDownButton,
|
|
193
|
+
{
|
|
194
|
+
"data-slot": "select-scroll-down-button",
|
|
195
|
+
className: cn(
|
|
196
|
+
"flex h-6 w-full shrink-0 cursor-pointer items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
197
|
+
className
|
|
198
|
+
),
|
|
199
|
+
...props,
|
|
200
|
+
children: /* @__PURE__ */ jsx(ChevronDownIcon, { className: "size-4" })
|
|
201
|
+
}
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
export {
|
|
205
|
+
Select,
|
|
206
|
+
SelectContent,
|
|
207
|
+
SelectGroup,
|
|
208
|
+
SelectItem,
|
|
209
|
+
SelectLabel,
|
|
210
|
+
SelectScrollDownButton,
|
|
211
|
+
SelectScrollUpButton,
|
|
212
|
+
SelectSeparator,
|
|
213
|
+
SelectTrigger,
|
|
214
|
+
SelectValue
|
|
215
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as SeparatorPrimitive from "../../primitives/separator";
|
|
3
|
+
declare function Separator({ className, orientation, decorative, ...props }: React.ComponentProps<typeof SeparatorPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
export { Separator };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Root } from "../../primitives/separator.js";
|
|
3
|
+
import { cn } from "../../lib/utils.js";
|
|
4
|
+
function Separator({
|
|
5
|
+
className,
|
|
6
|
+
orientation = "horizontal",
|
|
7
|
+
decorative = true,
|
|
8
|
+
...props
|
|
9
|
+
}) {
|
|
10
|
+
return /* @__PURE__ */ jsx(
|
|
11
|
+
Root,
|
|
12
|
+
{
|
|
13
|
+
"data-slot": "separator",
|
|
14
|
+
decorative,
|
|
15
|
+
orientation,
|
|
16
|
+
className: cn(
|
|
17
|
+
"bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
|
|
18
|
+
className
|
|
19
|
+
),
|
|
20
|
+
...props
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
Separator
|
|
26
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as SheetPrimitive from "../../primitives/dialog";
|
|
3
|
+
declare function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
declare function SheetTrigger({ ...props }: React.ComponentProps<typeof SheetPrimitive.Trigger>): React.JSX.Element;
|
|
5
|
+
declare function SheetClose({ ...props }: React.ComponentProps<typeof SheetPrimitive.Close>): React.JSX.Element;
|
|
6
|
+
declare function SheetContent({ className, children, side, ...props }: React.ComponentProps<typeof SheetPrimitive.Content> & {
|
|
7
|
+
side?: "top" | "right" | "bottom" | "left";
|
|
8
|
+
}): React.JSX.Element;
|
|
9
|
+
declare function SheetHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
10
|
+
declare function SheetFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
11
|
+
declare function SheetTitle({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Title>): React.JSX.Element;
|
|
12
|
+
declare function SheetDescription({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Description>): React.JSX.Element;
|
|
13
|
+
export { Sheet, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, };
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useThemePortalContainer } from "../../theme/index.js";
|
|
3
|
+
import { Root, Close, Content, Description, Title, Trigger, Portal, Overlay } from "../../primitives/dialog.js";
|
|
4
|
+
import { XIcon } from "../../icons/index.js";
|
|
5
|
+
import { cn } from "../../lib/utils.js";
|
|
6
|
+
function Sheet({ ...props }) {
|
|
7
|
+
return /* @__PURE__ */ jsx(Root, { "data-slot": "sheet", ...props });
|
|
8
|
+
}
|
|
9
|
+
function SheetTrigger({
|
|
10
|
+
...props
|
|
11
|
+
}) {
|
|
12
|
+
return /* @__PURE__ */ jsx(Trigger, { "data-slot": "sheet-trigger", ...props });
|
|
13
|
+
}
|
|
14
|
+
function SheetClose({
|
|
15
|
+
...props
|
|
16
|
+
}) {
|
|
17
|
+
return /* @__PURE__ */ jsx(Close, { "data-slot": "sheet-close", ...props });
|
|
18
|
+
}
|
|
19
|
+
function SheetPortal({
|
|
20
|
+
...props
|
|
21
|
+
}) {
|
|
22
|
+
return /* @__PURE__ */ jsx(Portal, { container: useThemePortalContainer(), "data-slot": "sheet-portal", ...props });
|
|
23
|
+
}
|
|
24
|
+
function SheetOverlay({
|
|
25
|
+
className,
|
|
26
|
+
...props
|
|
27
|
+
}) {
|
|
28
|
+
return /* @__PURE__ */ jsx(
|
|
29
|
+
Overlay,
|
|
30
|
+
{
|
|
31
|
+
"data-slot": "sheet-overlay",
|
|
32
|
+
className: cn(
|
|
33
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-[60] bg-[rgb(12_22_18/0.45)] backdrop-blur-[2px]",
|
|
34
|
+
className
|
|
35
|
+
),
|
|
36
|
+
...props
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
function SheetContent({
|
|
41
|
+
className,
|
|
42
|
+
children,
|
|
43
|
+
side = "right",
|
|
44
|
+
...props
|
|
45
|
+
}) {
|
|
46
|
+
return /* @__PURE__ */ jsxs(SheetPortal, { children: [
|
|
47
|
+
/* @__PURE__ */ jsx(SheetOverlay, {}),
|
|
48
|
+
/* @__PURE__ */ jsxs(
|
|
49
|
+
Content,
|
|
50
|
+
{
|
|
51
|
+
"data-slot": "sheet-content",
|
|
52
|
+
className: cn(
|
|
53
|
+
"bg-card text-card-foreground data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-[60] flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
|
|
54
|
+
side === "right" && "data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",
|
|
55
|
+
side === "left" && "data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",
|
|
56
|
+
side === "top" && "data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",
|
|
57
|
+
side === "bottom" && "data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",
|
|
58
|
+
className
|
|
59
|
+
),
|
|
60
|
+
...props,
|
|
61
|
+
children: [
|
|
62
|
+
children,
|
|
63
|
+
/* @__PURE__ */ jsxs(Close, { className: "ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none", children: [
|
|
64
|
+
/* @__PURE__ */ jsx(XIcon, { className: "size-4" }),
|
|
65
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
66
|
+
] })
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
)
|
|
70
|
+
] });
|
|
71
|
+
}
|
|
72
|
+
function SheetHeader({ className, ...props }) {
|
|
73
|
+
return /* @__PURE__ */ jsx(
|
|
74
|
+
"div",
|
|
75
|
+
{
|
|
76
|
+
"data-slot": "sheet-header",
|
|
77
|
+
className: cn("flex flex-col gap-1.5 p-4", className),
|
|
78
|
+
...props
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
function SheetFooter({ className, ...props }) {
|
|
83
|
+
return /* @__PURE__ */ jsx(
|
|
84
|
+
"div",
|
|
85
|
+
{
|
|
86
|
+
"data-slot": "sheet-footer",
|
|
87
|
+
className: cn("mt-auto flex flex-col gap-2 p-4", className),
|
|
88
|
+
...props
|
|
89
|
+
}
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
function SheetTitle({
|
|
93
|
+
className,
|
|
94
|
+
...props
|
|
95
|
+
}) {
|
|
96
|
+
return /* @__PURE__ */ jsx(
|
|
97
|
+
Title,
|
|
98
|
+
{
|
|
99
|
+
"data-slot": "sheet-title",
|
|
100
|
+
className: cn("text-foreground font-semibold", className),
|
|
101
|
+
...props
|
|
102
|
+
}
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
function SheetDescription({
|
|
106
|
+
className,
|
|
107
|
+
...props
|
|
108
|
+
}) {
|
|
109
|
+
return /* @__PURE__ */ jsx(
|
|
110
|
+
Description,
|
|
111
|
+
{
|
|
112
|
+
"data-slot": "sheet-description",
|
|
113
|
+
className: cn("text-muted-foreground text-sm", className),
|
|
114
|
+
...props
|
|
115
|
+
}
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
export {
|
|
119
|
+
Sheet,
|
|
120
|
+
SheetClose,
|
|
121
|
+
SheetContent,
|
|
122
|
+
SheetDescription,
|
|
123
|
+
SheetFooter,
|
|
124
|
+
SheetHeader,
|
|
125
|
+
SheetTitle,
|
|
126
|
+
SheetTrigger
|
|
127
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type VariantProps } from '../../lib/variants';
|
|
3
|
+
import { Button } from './button';
|
|
4
|
+
import { Input } from './input';
|
|
5
|
+
import { Separator } from './separator';
|
|
6
|
+
import { TooltipContent } from './tooltip';
|
|
7
|
+
type SidebarContextProps = {
|
|
8
|
+
state: 'expanded' | 'collapsed';
|
|
9
|
+
open: boolean;
|
|
10
|
+
setOpen: (open: boolean) => void;
|
|
11
|
+
openMobile: boolean;
|
|
12
|
+
setOpenMobile: (open: boolean) => void;
|
|
13
|
+
isMobile: boolean;
|
|
14
|
+
toggleSidebar: () => void;
|
|
15
|
+
};
|
|
16
|
+
declare function useSidebar(): SidebarContextProps;
|
|
17
|
+
declare function SidebarProvider({ defaultOpen, open: openProp, onOpenChange: setOpenProp, className, style, children, ...props }: React.ComponentProps<'div'> & {
|
|
18
|
+
defaultOpen?: boolean;
|
|
19
|
+
open?: boolean;
|
|
20
|
+
onOpenChange?: (open: boolean) => void;
|
|
21
|
+
}): React.JSX.Element;
|
|
22
|
+
declare function Sidebar({ side, variant, collapsible, className, children, ...props }: React.ComponentProps<'div'> & {
|
|
23
|
+
side?: 'left' | 'right';
|
|
24
|
+
variant?: 'sidebar' | 'floating' | 'inset';
|
|
25
|
+
collapsible?: 'offcanvas' | 'icon' | 'none';
|
|
26
|
+
}): React.JSX.Element;
|
|
27
|
+
declare function SidebarTrigger({ className, onClick, ...props }: React.ComponentProps<typeof Button>): React.JSX.Element;
|
|
28
|
+
declare function SidebarRail({ className, ...props }: React.ComponentProps<'button'>): React.JSX.Element;
|
|
29
|
+
declare function SidebarInset({ className, ...props }: React.ComponentProps<'main'>): React.JSX.Element;
|
|
30
|
+
declare function SidebarInput({ className, ...props }: React.ComponentProps<typeof Input>): React.JSX.Element;
|
|
31
|
+
declare function SidebarHeader({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
32
|
+
declare function SidebarFooter({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
33
|
+
declare function SidebarSeparator({ className, ...props }: React.ComponentProps<typeof Separator>): React.JSX.Element;
|
|
34
|
+
declare function SidebarContent({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
35
|
+
declare function SidebarGroup({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
36
|
+
declare function SidebarGroupLabel({ className, asChild, ...props }: React.ComponentProps<'div'> & {
|
|
37
|
+
asChild?: boolean;
|
|
38
|
+
}): React.JSX.Element;
|
|
39
|
+
declare function SidebarGroupAction({ className, asChild, ...props }: React.ComponentProps<'button'> & {
|
|
40
|
+
asChild?: boolean;
|
|
41
|
+
}): React.JSX.Element;
|
|
42
|
+
declare function SidebarGroupContent({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
43
|
+
declare function SidebarMenu({ className, ...props }: React.ComponentProps<'ul'>): React.JSX.Element;
|
|
44
|
+
declare function SidebarMenuItem({ className, ...props }: React.ComponentProps<'li'>): React.JSX.Element;
|
|
45
|
+
declare const sidebarMenuButtonVariants: (props?: ({
|
|
46
|
+
variant?: "outline" | "default" | null | undefined;
|
|
47
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
48
|
+
} & {
|
|
49
|
+
class?: import("../../lib/class-names").ClassValue;
|
|
50
|
+
className?: import("../../lib/class-names").ClassValue;
|
|
51
|
+
}) | undefined) => string;
|
|
52
|
+
declare function SidebarMenuButton({ asChild, isActive, variant, size, tooltip, className, ...props }: React.ComponentProps<'button'> & {
|
|
53
|
+
asChild?: boolean;
|
|
54
|
+
isActive?: boolean;
|
|
55
|
+
tooltip?: string | React.ComponentProps<typeof TooltipContent>;
|
|
56
|
+
} & VariantProps<typeof sidebarMenuButtonVariants>): React.JSX.Element;
|
|
57
|
+
declare function SidebarMenuAction({ className, asChild, showOnHover, ...props }: React.ComponentProps<'button'> & {
|
|
58
|
+
asChild?: boolean;
|
|
59
|
+
showOnHover?: boolean;
|
|
60
|
+
}): React.JSX.Element;
|
|
61
|
+
declare function SidebarMenuBadge({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
62
|
+
declare function SidebarMenuSkeleton({ className, showIcon, ...props }: React.ComponentProps<'div'> & {
|
|
63
|
+
showIcon?: boolean;
|
|
64
|
+
}): React.JSX.Element;
|
|
65
|
+
declare function SidebarMenuSub({ className, ...props }: React.ComponentProps<'ul'>): React.JSX.Element;
|
|
66
|
+
declare function SidebarMenuSubItem({ className, ...props }: React.ComponentProps<'li'>): React.JSX.Element;
|
|
67
|
+
declare function SidebarMenuSubButton({ asChild, size, isActive, className, ...props }: React.ComponentProps<'a'> & {
|
|
68
|
+
asChild?: boolean;
|
|
69
|
+
size?: 'sm' | 'md';
|
|
70
|
+
isActive?: boolean;
|
|
71
|
+
}): React.JSX.Element;
|
|
72
|
+
export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar, };
|