@exsto/ds 0.0.1-rc.13 → 0.0.1-rc.14
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/dist/date-picker.js +1 -344
- package/dist/index.js +75 -4513
- package/dist/rich-text-editor.js +3 -904
- package/dist/source-hash.txt +1 -1
- package/dist/styles.css +5 -19
- package/dist/theme.css +2 -1
- package/dist/ui/src/components/edyn/animated-number/animated-number.js +108 -0
- package/dist/ui/src/components/edyn/animated-number/animated-number.js.map +1 -0
- package/dist/ui/src/components/edyn/audio-player/audio-player.js +86 -0
- package/dist/ui/src/components/edyn/audio-player/audio-player.js.map +1 -0
- package/dist/ui/src/components/edyn/date-picker/date-picker.js +250 -0
- package/dist/ui/src/components/edyn/date-picker/date-picker.js.map +1 -0
- package/dist/ui/src/components/edyn/date-picker/date-text.js +105 -0
- package/dist/ui/src/components/edyn/date-picker/date-text.js.map +1 -0
- package/dist/ui/src/components/edyn/date-range-picker/date-range-picker.js +59 -0
- package/dist/ui/src/components/edyn/date-range-picker/date-range-picker.js.map +1 -0
- package/dist/ui/src/components/edyn/initials-avatar/initials-avatar.js +86 -0
- package/dist/ui/src/components/edyn/initials-avatar/initials-avatar.js.map +1 -0
- package/dist/ui/src/components/edyn/multi-select/multi-select.js +332 -0
- package/dist/ui/src/components/edyn/multi-select/multi-select.js.map +1 -0
- package/dist/ui/src/components/edyn/progress-line/progress-line.js +100 -0
- package/dist/ui/src/components/edyn/progress-line/progress-line.js.map +1 -0
- package/dist/ui/src/components/edyn/rich-text-content/allow-list.js +37 -0
- package/dist/ui/src/components/edyn/rich-text-content/allow-list.js.map +1 -0
- package/dist/ui/src/components/edyn/rich-text-content/rich-text-content.js +124 -0
- package/dist/ui/src/components/edyn/rich-text-content/rich-text-content.js.map +1 -0
- package/dist/ui/src/components/edyn/rich-text-editor/extensions.js +124 -0
- package/dist/ui/src/components/edyn/rich-text-editor/extensions.js.map +1 -0
- package/dist/ui/src/components/edyn/rich-text-editor/mention-list.js +232 -0
- package/dist/ui/src/components/edyn/rich-text-editor/mention-list.js.map +1 -0
- package/dist/ui/src/components/edyn/rich-text-editor/rich-text-editor.js +244 -0
- package/dist/ui/src/components/edyn/rich-text-editor/rich-text-editor.js.map +1 -0
- package/dist/ui/src/components/edyn/rich-text-editor/serialize.js +55 -0
- package/dist/ui/src/components/edyn/rich-text-editor/serialize.js.map +1 -0
- package/dist/ui/src/components/edyn/rich-text-editor/sync.js +34 -0
- package/dist/ui/src/components/edyn/rich-text-editor/sync.js.map +1 -0
- package/dist/ui/src/components/edyn/rich-text-editor/toolbar.js +235 -0
- package/dist/ui/src/components/edyn/rich-text-editor/toolbar.js.map +1 -0
- package/dist/ui/src/components/edyn/rich-text-editor/types.js +26 -0
- package/dist/ui/src/components/edyn/rich-text-editor/types.js.map +1 -0
- package/dist/ui/src/components/edyn/video-player/video-player.js +132 -0
- package/dist/ui/src/components/edyn/video-player/video-player.js.map +1 -0
- package/dist/ui/src/components/ui/accordion/accordion.js +83 -0
- package/dist/ui/src/components/ui/accordion/accordion.js.map +1 -0
- package/dist/ui/src/components/ui/alert/alert.js +47 -0
- package/dist/ui/src/components/ui/alert/alert.js.map +1 -0
- package/dist/ui/src/components/ui/alert-dialog/alert-dialog.js +95 -0
- package/dist/ui/src/components/ui/alert-dialog/alert-dialog.js.map +1 -0
- package/dist/ui/src/components/ui/aspect-ratio/aspect-ratio.js +15 -0
- package/dist/ui/src/components/ui/aspect-ratio/aspect-ratio.js.map +1 -0
- package/dist/ui/src/components/ui/attachment/attachment.js +105 -0
- package/dist/ui/src/components/ui/attachment/attachment.js.map +1 -0
- package/dist/ui/src/components/ui/avatar/avatar.js +51 -0
- package/dist/ui/src/components/ui/avatar/avatar.js.map +1 -0
- package/dist/ui/src/components/ui/badge/badge.js +47 -0
- package/dist/ui/src/components/ui/badge/badge.js.map +1 -0
- package/dist/ui/src/components/ui/breadcrumb/breadcrumb.js +73 -0
- package/dist/ui/src/components/ui/breadcrumb/breadcrumb.js.map +1 -0
- package/dist/ui/src/components/ui/bubble/bubble.js +74 -0
- package/dist/ui/src/components/ui/bubble/bubble.js.map +1 -0
- package/dist/{chunks/input-syWxjY2U.js → ui/src/components/ui/button/button.js} +3 -82
- package/dist/ui/src/components/ui/button/button.js.map +1 -0
- package/dist/ui/src/components/ui/button-group/button-group.js +37 -0
- package/dist/ui/src/components/ui/button-group/button-group.js.map +1 -0
- package/dist/{chunks/date-range-picker-CWVcHgy2.js → ui/src/components/ui/calendar/calendar.js} +6 -100
- package/dist/ui/src/components/ui/calendar/calendar.js.map +1 -0
- package/dist/ui/src/components/ui/card/card.js +57 -0
- package/dist/ui/src/components/ui/card/card.js.map +1 -0
- package/dist/ui/src/components/ui/carousel/carousel.js +136 -0
- package/dist/ui/src/components/ui/carousel/carousel.js.map +1 -0
- package/dist/ui/src/components/ui/chart/chart.js +168 -0
- package/dist/ui/src/components/ui/chart/chart.js.map +1 -0
- package/dist/ui/src/components/ui/checkbox/checkbox.js +21 -0
- package/dist/ui/src/components/ui/checkbox/checkbox.js.map +1 -0
- package/dist/ui/src/components/ui/collapsible/collapsible.js +26 -0
- package/dist/ui/src/components/ui/collapsible/collapsible.js.map +1 -0
- package/dist/ui/src/components/ui/combobox/combobox.js +85 -0
- package/dist/ui/src/components/ui/combobox/combobox.js.map +1 -0
- package/dist/ui/src/components/ui/command/command.js +118 -0
- package/dist/ui/src/components/ui/command/command.js.map +1 -0
- package/dist/ui/src/components/ui/context-menu/context-menu.js +134 -0
- package/dist/ui/src/components/ui/context-menu/context-menu.js.map +1 -0
- package/dist/ui/src/components/ui/dialog/dialog.js +92 -0
- package/dist/ui/src/components/ui/dialog/dialog.js.map +1 -0
- package/dist/ui/src/components/ui/direction/direction.js +2 -0
- package/dist/ui/src/components/ui/drawer/drawer.js +86 -0
- package/dist/ui/src/components/ui/drawer/drawer.js.map +1 -0
- package/dist/ui/src/components/ui/dropdown-menu/dropdown-menu.js +160 -0
- package/dist/ui/src/components/ui/dropdown-menu/dropdown-menu.js.map +1 -0
- package/dist/ui/src/components/ui/empty/empty.js +61 -0
- package/dist/ui/src/components/ui/empty/empty.js.map +1 -0
- package/dist/ui/src/components/ui/field/field.js +36 -0
- package/dist/ui/src/components/ui/field/field.js.map +1 -0
- package/dist/ui/src/components/ui/hover-card/hover-card.js +38 -0
- package/dist/ui/src/components/ui/hover-card/hover-card.js.map +1 -0
- package/dist/ui/src/components/ui/indicator/indicator.js +79 -0
- package/dist/ui/src/components/ui/indicator/indicator.js.map +1 -0
- package/dist/ui/src/components/ui/input/input.js +16 -0
- package/dist/ui/src/components/ui/input/input.js.map +1 -0
- package/dist/ui/src/components/ui/input-group/input-group.js +77 -0
- package/dist/ui/src/components/ui/input-group/input-group.js.map +1 -0
- package/dist/ui/src/components/ui/input-otp/input-otp.js +48 -0
- package/dist/ui/src/components/ui/input-otp/input-otp.js.map +1 -0
- package/dist/ui/src/components/ui/item/item.js +122 -0
- package/dist/ui/src/components/ui/item/item.js.map +1 -0
- package/dist/ui/src/components/ui/kbd/kbd.js +21 -0
- package/dist/ui/src/components/ui/kbd/kbd.js.map +1 -0
- package/dist/ui/src/components/ui/label/label.js +14 -0
- package/dist/ui/src/components/ui/label/label.js.map +1 -0
- package/dist/ui/src/components/ui/marker/marker.js +44 -0
- package/dist/ui/src/components/ui/marker/marker.js.map +1 -0
- package/dist/ui/src/components/ui/menubar/menubar.js +137 -0
- package/dist/ui/src/components/ui/menubar/menubar.js.map +1 -0
- package/dist/ui/src/components/ui/message/message.js +50 -0
- package/dist/ui/src/components/ui/message/message.js.map +1 -0
- package/dist/ui/src/components/ui/message-scroller/message-scroller.js +61 -0
- package/dist/ui/src/components/ui/message-scroller/message-scroller.js.map +1 -0
- package/dist/ui/src/components/ui/native-select/native-select.js +39 -0
- package/dist/ui/src/components/ui/native-select/native-select.js.map +1 -0
- package/dist/ui/src/components/ui/navigation-menu/navigation-menu.js +84 -0
- package/dist/ui/src/components/ui/navigation-menu/navigation-menu.js.map +1 -0
- package/dist/ui/src/components/ui/pagination/pagination.js +104 -0
- package/dist/ui/src/components/ui/pagination/pagination.js.map +1 -0
- package/dist/ui/src/components/ui/popover/popover.js +56 -0
- package/dist/ui/src/components/ui/popover/popover.js.map +1 -0
- package/dist/ui/src/components/ui/progress/progress.js +70 -0
- package/dist/ui/src/components/ui/progress/progress.js.map +1 -0
- package/dist/ui/src/components/ui/questionnaire/questionnaire.js +171 -0
- package/dist/ui/src/components/ui/questionnaire/questionnaire.js.map +1 -0
- package/dist/ui/src/components/ui/radio-group/radio-group.js +29 -0
- package/dist/ui/src/components/ui/radio-group/radio-group.js.map +1 -0
- package/dist/ui/src/components/ui/resizable/resizable.js +29 -0
- package/dist/ui/src/components/ui/resizable/resizable.js.map +1 -0
- package/dist/ui/src/components/ui/scroll-area/scroll-area.js +119 -0
- package/dist/ui/src/components/ui/scroll-area/scroll-area.js.map +1 -0
- package/dist/ui/src/components/ui/select/select.js +99 -0
- package/dist/ui/src/components/ui/select/select.js.map +1 -0
- package/dist/ui/src/components/ui/separator/separator.js +30 -0
- package/dist/ui/src/components/ui/separator/separator.js.map +1 -0
- package/dist/ui/src/components/ui/sheet/sheet.js +89 -0
- package/dist/ui/src/components/ui/sheet/sheet.js.map +1 -0
- package/dist/ui/src/components/ui/sidebar/sidebar.js +383 -0
- package/dist/ui/src/components/ui/sidebar/sidebar.js.map +1 -0
- package/dist/ui/src/components/ui/skeleton/skeleton.js +14 -0
- package/dist/ui/src/components/ui/skeleton/skeleton.js.map +1 -0
- package/dist/ui/src/components/ui/slider/slider.js +49 -0
- package/dist/ui/src/components/ui/slider/slider.js.map +1 -0
- package/dist/ui/src/components/ui/spinner/spinner.js +28 -0
- package/dist/ui/src/components/ui/spinner/spinner.js.map +1 -0
- package/dist/ui/src/components/ui/switch/switch.js +20 -0
- package/dist/ui/src/components/ui/switch/switch.js.map +1 -0
- package/dist/ui/src/components/ui/table/table.js +68 -0
- package/dist/ui/src/components/ui/table/table.js.map +1 -0
- package/dist/ui/src/components/ui/tabs/tabs.js +50 -0
- package/dist/ui/src/components/ui/tabs/tabs.js.map +1 -0
- package/dist/ui/src/components/ui/textarea/textarea.js +14 -0
- package/dist/ui/src/components/ui/textarea/textarea.js.map +1 -0
- package/dist/ui/src/components/ui/toast/toast.js +124 -0
- package/dist/ui/src/components/ui/toast/toast.js.map +1 -0
- package/dist/ui/src/components/ui/toggle/toggle.js +37 -0
- package/dist/ui/src/components/ui/toggle/toggle.js.map +1 -0
- package/dist/ui/src/components/ui/toggle-group/toggle-group.js +56 -0
- package/dist/ui/src/components/ui/toggle-group/toggle-group.js.map +1 -0
- package/dist/ui/src/components/ui/tooltip/tooltip.js +42 -0
- package/dist/ui/src/components/ui/tooltip/tooltip.js.map +1 -0
- package/dist/ui/src/hooks/use-media-player.js +140 -0
- package/dist/ui/src/hooks/use-media-player.js.map +1 -0
- package/dist/ui/src/hooks/use-merged-refs.js +18 -0
- package/dist/ui/src/hooks/use-merged-refs.js.map +1 -0
- package/dist/ui/src/hooks/use-mobile.js +20 -0
- package/dist/ui/src/hooks/use-mobile.js.map +1 -0
- package/dist/ui/src/lib/first-weekday.js +34 -0
- package/dist/ui/src/lib/first-weekday.js.map +1 -0
- package/dist/ui/src/lib/popup-list.js +26 -0
- package/dist/ui/src/lib/popup-list.js.map +1 -0
- package/dist/ui/src/lib/utils.js +21 -0
- package/dist/ui/src/lib/utils.js.map +1 -0
- package/package.json +1 -1
- package/dist/chunks/date-range-picker-CWVcHgy2.js.map +0 -1
- package/dist/chunks/input-syWxjY2U.js.map +0 -1
- package/dist/chunks/toggle-Bxg8P-61.js +0 -490
- package/dist/chunks/toggle-Bxg8P-61.js.map +0 -1
- package/dist/date-picker.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/rich-text-editor.js.map +0 -1
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { cn } from "../../../lib/utils.js";
|
|
2
|
+
import { ScrollArea } from "../scroll-area/scroll-area.js";
|
|
3
|
+
import { POPUP_ITEM_INDICATOR_CLASS, popupItemClass } from "../../../lib/popup-list.js";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { IconCheck, IconChevronDown } from "@tabler/icons-react";
|
|
6
|
+
import { Select } from "@base-ui/react/select";
|
|
7
|
+
//#region ../ui/src/components/ui/select/select.tsx
|
|
8
|
+
var Select$1 = ({ ...props }) => {
|
|
9
|
+
return /* @__PURE__ */ jsx(Select.Root, {
|
|
10
|
+
"data-slot": "select",
|
|
11
|
+
...props
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
var SelectTrigger = ({ className, size = "default", children, ...props }) => {
|
|
15
|
+
return /* @__PURE__ */ jsxs(Select.Trigger, {
|
|
16
|
+
"data-slot": "select-trigger",
|
|
17
|
+
className: cn("flex w-full cursor-pointer items-center justify-between gap-2 rounded-lg border border-input bg-transparent text-sm text-foreground transition-colors outline-none", "focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50", "disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50", "aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20", "data-popup-open:border-ring data-popup-open:ring-3 data-popup-open:ring-ring/50", "dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40", size === "sm" ? "h-7 px-2.5 text-[0.8rem]" : "h-8 px-2.5", className),
|
|
18
|
+
...props,
|
|
19
|
+
children: [children, /* @__PURE__ */ jsx(Select.Icon, {
|
|
20
|
+
"data-slot": "select-icon",
|
|
21
|
+
className: "shrink-0 text-muted-foreground",
|
|
22
|
+
children: /* @__PURE__ */ jsx(IconChevronDown, { className: "size-4" })
|
|
23
|
+
})]
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
var SelectValue = ({ className, ...props }) => {
|
|
27
|
+
return /* @__PURE__ */ jsx(Select.Value, {
|
|
28
|
+
"data-slot": "select-value",
|
|
29
|
+
className: cn("truncate data-placeholder:text-muted-foreground", className),
|
|
30
|
+
...props
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
var SelectContent = ({ className, children, portalContainer, ...props }) => {
|
|
34
|
+
return /* @__PURE__ */ jsx(Select.Portal, {
|
|
35
|
+
container: portalContainer,
|
|
36
|
+
children: /* @__PURE__ */ jsx(Select.Positioner, {
|
|
37
|
+
"data-slot": "select-positioner",
|
|
38
|
+
sideOffset: 4,
|
|
39
|
+
align: "start",
|
|
40
|
+
alignItemWithTrigger: false,
|
|
41
|
+
children: /* @__PURE__ */ jsx(Select.Popup, {
|
|
42
|
+
"data-slot": "select-content",
|
|
43
|
+
className: cn("z-50 min-w-[var(--anchor-width)] overflow-hidden rounded-xl border border-border bg-popover p-1 text-popover-foreground shadow-md outline-none", "origin-[var(--transform-origin)]", "transition-[transform,scale,opacity] motion-reduce:animate-none motion-reduce:transition-none data-open:scale-100 data-open:opacity-100 data-closed:scale-95 data-closed:opacity-0 data-open:animate-in data-closed:animate-out data-open:fade-in-0 data-closed:fade-out-0", className),
|
|
44
|
+
...props,
|
|
45
|
+
children: /* @__PURE__ */ jsx(ScrollArea, {
|
|
46
|
+
type: "always",
|
|
47
|
+
fade: true,
|
|
48
|
+
fadeFrom: "popover",
|
|
49
|
+
className: "max-h-(--available-height)",
|
|
50
|
+
children: /* @__PURE__ */ jsx(Select.List, {
|
|
51
|
+
"data-slot": "select-list",
|
|
52
|
+
children
|
|
53
|
+
})
|
|
54
|
+
})
|
|
55
|
+
})
|
|
56
|
+
})
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
var SelectGroup = ({ className, ...props }) => {
|
|
60
|
+
return /* @__PURE__ */ jsx(Select.Group, {
|
|
61
|
+
"data-slot": "select-group",
|
|
62
|
+
className: cn("flex flex-col gap-0.5", className),
|
|
63
|
+
...props
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
var SelectLabel = ({ className, ...props }) => {
|
|
67
|
+
return /* @__PURE__ */ jsx(Select.GroupLabel, {
|
|
68
|
+
"data-slot": "select-label",
|
|
69
|
+
className: cn("px-2 py-1 text-xs font-semibold text-muted-foreground", className),
|
|
70
|
+
...props
|
|
71
|
+
});
|
|
72
|
+
};
|
|
73
|
+
var SelectItem = ({ className, children, ...props }) => {
|
|
74
|
+
return /* @__PURE__ */ jsxs(Select.Item, {
|
|
75
|
+
"data-slot": "select-item",
|
|
76
|
+
className: cn(popupItemClass("base-ui", true), className),
|
|
77
|
+
...props,
|
|
78
|
+
children: [/* @__PURE__ */ jsx(Select.ItemText, {
|
|
79
|
+
"data-slot": "select-item-text",
|
|
80
|
+
children
|
|
81
|
+
}), /* @__PURE__ */ jsx(Select.ItemIndicator, {
|
|
82
|
+
"data-slot": "select-item-indicator",
|
|
83
|
+
className: POPUP_ITEM_INDICATOR_CLASS,
|
|
84
|
+
children: /* @__PURE__ */ jsx(IconCheck, { className: "size-3.5" })
|
|
85
|
+
})]
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
var SelectSeparator = ({ className, ...props }) => {
|
|
89
|
+
return /* @__PURE__ */ jsx("div", {
|
|
90
|
+
"data-slot": "select-separator",
|
|
91
|
+
className: cn("-mx-1 my-1 h-px bg-border", className),
|
|
92
|
+
"aria-hidden": "true",
|
|
93
|
+
...props
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
//#endregion
|
|
97
|
+
export { Select$1 as Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue };
|
|
98
|
+
|
|
99
|
+
//# sourceMappingURL=select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.js","names":[],"sources":["../../../../../../../ui/src/components/ui/select/select.tsx"],"sourcesContent":["import { Select as SelectPrimitive } from '@base-ui/react/select';\nimport { POPUP_ITEM_INDICATOR_CLASS, popupItemClass } from '@edyn/ui/lib/popup-list';\nimport { cn } from '@edyn/ui/lib/utils';\nimport { IconCheck, IconChevronDown } from '@tabler/icons-react';\nimport type * as React from 'react';\nimport { ScrollArea } from '../scroll-area';\n\nexport const Select = <TValue,>({ ...props }: SelectPrimitive.Root.Props<TValue>) => {\n return <SelectPrimitive.Root data-slot=\"select\" {...props} />;\n};\n\nexport type TSelectTriggerSize = 'sm' | 'default';\n\nexport interface ISelectTriggerProps extends SelectPrimitive.Trigger.Props {\n size?: TSelectTriggerSize;\n}\n\nexport const SelectTrigger = ({ className, size = 'default', children, ...props }: ISelectTriggerProps) => {\n return (\n <SelectPrimitive.Trigger\n data-slot=\"select-trigger\"\n className={cn(\n 'flex w-full cursor-pointer items-center justify-between gap-2 rounded-lg border border-input bg-transparent text-sm text-foreground transition-colors outline-none',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50',\n 'disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',\n 'aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20',\n 'data-popup-open:border-ring data-popup-open:ring-3 data-popup-open:ring-ring/50',\n 'dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40',\n size === 'sm' ? 'h-7 px-2.5 text-[0.8rem]' : 'h-8 px-2.5',\n className,\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon data-slot=\"select-icon\" className=\"shrink-0 text-muted-foreground\">\n <IconChevronDown className=\"size-4\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n );\n};\n\nexport const SelectValue = ({ className, ...props }: SelectPrimitive.Value.Props) => {\n return <SelectPrimitive.Value data-slot=\"select-value\" className={cn('truncate data-placeholder:text-muted-foreground', className)} {...props} />;\n};\n\nexport interface ISelectContentProps extends SelectPrimitive.Popup.Props {\n portalContainer?: SelectPrimitive.Portal.Props['container'];\n}\n\nexport const SelectContent = ({ className, children, portalContainer, ...props }: ISelectContentProps) => {\n return (\n <SelectPrimitive.Portal container={portalContainer}>\n {/* alignItemWithTrigger=false: drop below the trigger (shadcn style), not Base UI's macOS-style overlay */}\n <SelectPrimitive.Positioner data-slot=\"select-positioner\" sideOffset={4} align=\"start\" alignItemWithTrigger={false}>\n <SelectPrimitive.Popup\n data-slot=\"select-content\"\n className={cn(\n 'z-50 min-w-[var(--anchor-width)] overflow-hidden rounded-xl border border-border bg-popover p-1 text-popover-foreground shadow-md outline-none',\n 'origin-[var(--transform-origin)]',\n 'transition-[transform,scale,opacity] motion-reduce:animate-none motion-reduce:transition-none data-open:scale-100 data-open:opacity-100 data-closed:scale-95 data-closed:opacity-0 data-open:animate-in data-closed:animate-out data-open:fade-in-0 data-closed:fade-out-0',\n className,\n )}\n {...props}\n >\n {/* A long option list has to scroll inside the popup: the popup clips\n (overflow-hidden) and carries no height of its own, so the options\n past the fold were simply unreachable. --available-height is the\n room the positioner measured for it. */}\n {/* Select.List is what makes the wrappers legal: with a list present Base\n UI moves `role=\"listbox\"` off the popup and onto it, so the options\n stay direct children of the role and the ScrollArea sits outside it. */}\n <ScrollArea type=\"always\" fade fadeFrom=\"popover\" className=\"max-h-(--available-height)\">\n <SelectPrimitive.List data-slot=\"select-list\">{children}</SelectPrimitive.List>\n </ScrollArea>\n </SelectPrimitive.Popup>\n </SelectPrimitive.Positioner>\n </SelectPrimitive.Portal>\n );\n};\n\nexport const SelectGroup = ({ className, ...props }: SelectPrimitive.Group.Props) => {\n return <SelectPrimitive.Group data-slot=\"select-group\" className={cn('flex flex-col gap-0.5', className)} {...props} />;\n};\n\nexport const SelectLabel = ({ className, ...props }: SelectPrimitive.GroupLabel.Props) => {\n return (\n <SelectPrimitive.GroupLabel\n data-slot=\"select-label\"\n className={cn('px-2 py-1 text-xs font-semibold text-muted-foreground', className)}\n {...props}\n />\n );\n};\n\nexport const SelectItem = ({ className, children, ...props }: SelectPrimitive.Item.Props) => {\n return (\n <SelectPrimitive.Item data-slot=\"select-item\" className={cn(popupItemClass('base-ui', true), className)} {...props}>\n <SelectPrimitive.ItemText data-slot=\"select-item-text\">{children}</SelectPrimitive.ItemText>\n {/* After the text, not before it: the check marks the end of the item in\n every list in the system, so the labels all start on one line. */}\n <SelectPrimitive.ItemIndicator data-slot=\"select-item-indicator\" className={POPUP_ITEM_INDICATOR_CLASS}>\n <IconCheck className=\"size-3.5\" />\n </SelectPrimitive.ItemIndicator>\n </SelectPrimitive.Item>\n );\n};\n\nexport const SelectSeparator = ({ className, ...props }: React.ComponentProps<'div'>) => {\n return <div data-slot=\"select-separator\" className={cn('-mx-1 my-1 h-px bg-border', className)} aria-hidden=\"true\" {...props} />;\n};\n"],"mappings":";;;;;;;AAOA,IAAa,YAAmB,EAAE,GAAG,YAAgD;CACnF,OAAO,oBAAC,OAAgB,MAAjB;EAAsB,aAAU;EAAS,GAAI;CAAQ,CAAA;AAC9D;AAQA,IAAa,iBAAiB,EAAE,WAAW,OAAO,WAAW,UAAU,GAAG,YAAiC;CACzG,OACE,qBAAC,OAAgB,SAAjB;EACE,aAAU;EACV,WAAW,GACT,sKACA,6EACA,gFACA,wFACA,mFACA,4HACA,SAAS,OAAO,6BAA6B,cAC7C,SACF;EACA,GAAI;EAZN,UAAA,CAcG,UACD,oBAAC,OAAgB,MAAjB;GAAsB,aAAU;GAAc,WAAU;GACtD,UAAA,oBAAC,iBAAD,EAAiB,WAAU,SAAU,CAAA;EACjB,CAAA,CACC;;AAE7B;AAEA,IAAa,eAAe,EAAE,WAAW,GAAG,YAAyC;CACnF,OAAO,oBAAC,OAAgB,OAAjB;EAAuB,aAAU;EAAe,WAAW,GAAG,mDAAmD,SAAS;EAAG,GAAI;CAAQ,CAAA;AAClJ;AAMA,IAAa,iBAAiB,EAAE,WAAW,UAAU,iBAAiB,GAAG,YAAiC;CACxG,OACE,oBAAC,OAAgB,QAAjB;EAAwB,WAAW;EAEjC,UAAA,oBAAC,OAAgB,YAAjB;GAA4B,aAAU;GAAoB,YAAY;GAAG,OAAM;GAAQ,sBAAsB;GAC3G,UAAA,oBAAC,OAAgB,OAAjB;IACE,aAAU;IACV,WAAW,GACT,kJACA,oCACA,8QACA,SACF;IACA,GAAI;IASJ,UAAA,oBAAC,YAAD;KAAY,MAAK;KAAS,MAAA;KAAK,UAAS;KAAU,WAAU;KAC1D,UAAA,oBAAC,OAAgB,MAAjB;MAAsB,aAAU;MAAe;KAA+B,CAAA;IACpE,CAAA;GACS,CAAA;EACG,CAAA;CACN,CAAA;AAE5B;AAEA,IAAa,eAAe,EAAE,WAAW,GAAG,YAAyC;CACnF,OAAO,oBAAC,OAAgB,OAAjB;EAAuB,aAAU;EAAe,WAAW,GAAG,yBAAyB,SAAS;EAAG,GAAI;CAAQ,CAAA;AACxH;AAEA,IAAa,eAAe,EAAE,WAAW,GAAG,YAA8C;CACxF,OACE,oBAAC,OAAgB,YAAjB;EACE,aAAU;EACV,WAAW,GAAG,yDAAyD,SAAS;EAChF,GAAI;CACL,CAAA;AAEL;AAEA,IAAa,cAAc,EAAE,WAAW,UAAU,GAAG,YAAwC;CAC3F,OACE,qBAAC,OAAgB,MAAjB;EAAsB,aAAU;EAAc,WAAW,GAAG,eAAe,WAAW,IAAI,GAAG,SAAS;EAAG,GAAI;EAA7G,UAAA,CACE,oBAAC,OAAgB,UAAjB;GAA0B,aAAU;GAAoB;EAAmC,CAAA,GAG3F,oBAAC,OAAgB,eAAjB;GAA+B,aAAU;GAAwB,WAAW;GAC1E,UAAA,oBAAC,WAAD,EAAW,WAAU,WAAY,CAAA;EACJ,CAAA,CACX;;AAE1B;AAEA,IAAa,mBAAmB,EAAE,WAAW,GAAG,YAAyC;CACvF,OAAO,oBAAC,OAAD;EAAK,aAAU;EAAmB,WAAW,GAAG,6BAA6B,SAAS;EAAG,eAAY;EAAO,GAAI;CAAQ,CAAA;AACjI"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { cn } from "../../../lib/utils.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Separator } from "@base-ui/react/separator";
|
|
4
|
+
//#region ../ui/src/components/ui/separator/separator.tsx
|
|
5
|
+
/**
|
|
6
|
+
* Hairline rule between content, announced as `role="separator"`.
|
|
7
|
+
*
|
|
8
|
+
* The orientation styles are branched in TS rather than written as
|
|
9
|
+
* `data-[orientation=*]:` variants on purpose. A variant carries two
|
|
10
|
+
* selectors' worth of specificity, so it would outrank a plain class passed in
|
|
11
|
+
* by the caller: the sidebar's own `w-auto` lost to `w-full` that way. Branching
|
|
12
|
+
* emits one plain class per axis, which `cn` can dedupe and a caller can
|
|
13
|
+
* override.
|
|
14
|
+
*
|
|
15
|
+
* Vertical uses `self-stretch` instead of `h-full`: a percentage height needs a
|
|
16
|
+
* definite parent, and the usual host is an `items-center` row whose height
|
|
17
|
+
* comes from its content.
|
|
18
|
+
*/
|
|
19
|
+
var Separator$1 = ({ className, orientation = "horizontal", ...props }) => {
|
|
20
|
+
return /* @__PURE__ */ jsx(Separator, {
|
|
21
|
+
"data-slot": "separator",
|
|
22
|
+
orientation,
|
|
23
|
+
className: cn("shrink-0 bg-border", orientation === "horizontal" ? "h-px w-full" : "w-px self-stretch", className),
|
|
24
|
+
...props
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
//#endregion
|
|
28
|
+
export { Separator$1 as Separator };
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=separator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"separator.js","names":[],"sources":["../../../../../../../ui/src/components/ui/separator/separator.tsx"],"sourcesContent":["import { Separator as SeparatorPrimitive } from '@base-ui/react/separator';\n\nimport { cn } from '@edyn/ui/lib/utils';\n\n/**\n * Hairline rule between content, announced as `role=\"separator\"`.\n *\n * The orientation styles are branched in TS rather than written as\n * `data-[orientation=*]:` variants on purpose. A variant carries two\n * selectors' worth of specificity, so it would outrank a plain class passed in\n * by the caller: the sidebar's own `w-auto` lost to `w-full` that way. Branching\n * emits one plain class per axis, which `cn` can dedupe and a caller can\n * override.\n *\n * Vertical uses `self-stretch` instead of `h-full`: a percentage height needs a\n * definite parent, and the usual host is an `items-center` row whose height\n * comes from its content.\n */\nexport const Separator = ({ className, orientation = 'horizontal', ...props }: SeparatorPrimitive.Props) => {\n return (\n <SeparatorPrimitive\n data-slot=\"separator\"\n orientation={orientation}\n className={cn('shrink-0 bg-border', orientation === 'horizontal' ? 'h-px w-full' : 'w-px self-stretch', className)}\n {...props}\n />\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAkBA,IAAa,eAAa,EAAE,WAAW,cAAc,cAAc,GAAG,YAAsC;CAC1G,OACE,oBAAC,WAAD;EACE,aAAU;EACG;EACb,WAAW,GAAG,sBAAsB,gBAAgB,eAAe,gBAAgB,qBAAqB,SAAS;EACjH,GAAI;CACL,CAAA;AAEL"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { cn } from "../../../lib/utils.js";
|
|
2
|
+
import { Button } from "../button/button.js";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { IconX } from "@tabler/icons-react";
|
|
5
|
+
import { Dialog } from "@base-ui/react/dialog";
|
|
6
|
+
//#region ../ui/src/components/ui/sheet/sheet.tsx
|
|
7
|
+
var Sheet = ({ ...props }) => {
|
|
8
|
+
return /* @__PURE__ */ jsx(Dialog.Root, {
|
|
9
|
+
"data-slot": "sheet",
|
|
10
|
+
...props
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var SheetTrigger = ({ ...props }) => {
|
|
14
|
+
return /* @__PURE__ */ jsx(Dialog.Trigger, {
|
|
15
|
+
"data-slot": "sheet-trigger",
|
|
16
|
+
...props
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
var SheetClose = ({ ...props }) => {
|
|
20
|
+
return /* @__PURE__ */ jsx(Dialog.Close, {
|
|
21
|
+
"data-slot": "sheet-close",
|
|
22
|
+
...props
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
var SheetPortal = ({ ...props }) => {
|
|
26
|
+
return /* @__PURE__ */ jsx(Dialog.Portal, {
|
|
27
|
+
"data-slot": "sheet-portal",
|
|
28
|
+
...props
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
var SheetOverlay = ({ className, ...props }) => {
|
|
32
|
+
return /* @__PURE__ */ jsx(Dialog.Backdrop, {
|
|
33
|
+
"data-slot": "sheet-overlay",
|
|
34
|
+
className: cn("fixed inset-0 z-50 bg-overlay transition-opacity duration-150 motion-reduce:transition-none data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs", className),
|
|
35
|
+
...props
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
var SheetContent = ({ className, children, side = "right", showCloseButton = true, ...props }) => {
|
|
39
|
+
return /* @__PURE__ */ jsxs(SheetPortal, { children: [/* @__PURE__ */ jsx(SheetOverlay, {}), /* @__PURE__ */ jsxs(Dialog.Popup, {
|
|
40
|
+
"data-slot": "sheet-content",
|
|
41
|
+
"data-side": side,
|
|
42
|
+
className: cn("fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 motion-reduce:transition-none ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm", className),
|
|
43
|
+
...props,
|
|
44
|
+
children: [children, showCloseButton && /* @__PURE__ */ jsxs(Dialog.Close, {
|
|
45
|
+
"data-slot": "sheet-close",
|
|
46
|
+
render: /* @__PURE__ */ jsx(Button, {
|
|
47
|
+
variant: "ghost",
|
|
48
|
+
className: "absolute top-3 right-3",
|
|
49
|
+
size: "icon-sm"
|
|
50
|
+
}),
|
|
51
|
+
children: [/* @__PURE__ */ jsx(IconX, {}), /* @__PURE__ */ jsx("span", {
|
|
52
|
+
className: "sr-only",
|
|
53
|
+
children: "Close"
|
|
54
|
+
})]
|
|
55
|
+
})]
|
|
56
|
+
})] });
|
|
57
|
+
};
|
|
58
|
+
var SheetHeader = ({ className, ...props }) => {
|
|
59
|
+
return /* @__PURE__ */ jsx("div", {
|
|
60
|
+
"data-slot": "sheet-header",
|
|
61
|
+
className: cn("flex flex-col gap-0.5 p-4", className),
|
|
62
|
+
...props
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
var SheetFooter = ({ className, ...props }) => {
|
|
66
|
+
return /* @__PURE__ */ jsx("div", {
|
|
67
|
+
"data-slot": "sheet-footer",
|
|
68
|
+
className: cn("mt-auto flex flex-col gap-2 p-4", className),
|
|
69
|
+
...props
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
var SheetTitle = ({ className, ...props }) => {
|
|
73
|
+
return /* @__PURE__ */ jsx(Dialog.Title, {
|
|
74
|
+
"data-slot": "sheet-title",
|
|
75
|
+
className: cn("font-heading text-base font-medium text-foreground", className),
|
|
76
|
+
...props
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
var SheetDescription = ({ className, ...props }) => {
|
|
80
|
+
return /* @__PURE__ */ jsx(Dialog.Description, {
|
|
81
|
+
"data-slot": "sheet-description",
|
|
82
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
83
|
+
...props
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
//#endregion
|
|
87
|
+
export { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger };
|
|
88
|
+
|
|
89
|
+
//# sourceMappingURL=sheet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sheet.js","names":[],"sources":["../../../../../../../ui/src/components/ui/sheet/sheet.tsx"],"sourcesContent":["import { Dialog as SheetPrimitive } from '@base-ui/react/dialog';\nimport { cn } from '@edyn/ui/lib/utils';\nimport { IconX } from '@tabler/icons-react';\nimport type * as React from 'react';\nimport { Button } from '../button';\n\nexport const Sheet = ({ ...props }: SheetPrimitive.Root.Props) => {\n return <SheetPrimitive.Root data-slot=\"sheet\" {...props} />;\n};\n\nexport const SheetTrigger = ({ ...props }: SheetPrimitive.Trigger.Props) => {\n return <SheetPrimitive.Trigger data-slot=\"sheet-trigger\" {...props} />;\n};\n\nexport const SheetClose = ({ ...props }: SheetPrimitive.Close.Props) => {\n return <SheetPrimitive.Close data-slot=\"sheet-close\" {...props} />;\n};\n\nconst SheetPortal = ({ ...props }: SheetPrimitive.Portal.Props) => {\n return <SheetPrimitive.Portal data-slot=\"sheet-portal\" {...props} />;\n};\n\nconst SheetOverlay = ({ className, ...props }: SheetPrimitive.Backdrop.Props) => {\n return (\n <SheetPrimitive.Backdrop\n data-slot=\"sheet-overlay\"\n className={cn(\n 'fixed inset-0 z-50 bg-overlay transition-opacity duration-150 motion-reduce:transition-none data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs',\n className,\n )}\n {...props}\n />\n );\n};\n\nexport const SheetContent = ({\n className,\n children,\n side = 'right',\n showCloseButton = true,\n ...props\n}: SheetPrimitive.Popup.Props & {\n side?: 'top' | 'right' | 'bottom' | 'left';\n showCloseButton?: boolean;\n}) => {\n return (\n <SheetPortal>\n <SheetOverlay />\n <SheetPrimitive.Popup\n data-slot=\"sheet-content\"\n data-side={side}\n className={cn(\n 'fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 motion-reduce:transition-none ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm',\n className,\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <SheetPrimitive.Close data-slot=\"sheet-close\" render={<Button variant=\"ghost\" className=\"absolute top-3 right-3\" size=\"icon-sm\" />}>\n <IconX />\n <span className=\"sr-only\">Close</span>\n </SheetPrimitive.Close>\n )}\n </SheetPrimitive.Popup>\n </SheetPortal>\n );\n};\n\nexport const SheetHeader = ({ className, ...props }: React.ComponentProps<'div'>) => {\n return <div data-slot=\"sheet-header\" className={cn('flex flex-col gap-0.5 p-4', className)} {...props} />;\n};\n\nexport const SheetFooter = ({ className, ...props }: React.ComponentProps<'div'>) => {\n return <div data-slot=\"sheet-footer\" className={cn('mt-auto flex flex-col gap-2 p-4', className)} {...props} />;\n};\n\nexport const SheetTitle = ({ className, ...props }: SheetPrimitive.Title.Props) => {\n return <SheetPrimitive.Title data-slot=\"sheet-title\" className={cn('font-heading text-base font-medium text-foreground', className)} {...props} />;\n};\n\nexport const SheetDescription = ({ className, ...props }: SheetPrimitive.Description.Props) => {\n return <SheetPrimitive.Description data-slot=\"sheet-description\" className={cn('text-sm text-muted-foreground', className)} {...props} />;\n};\n"],"mappings":";;;;;;AAMA,IAAa,SAAS,EAAE,GAAG,YAAuC;CAChE,OAAO,oBAAC,OAAe,MAAhB;EAAqB,aAAU;EAAQ,GAAI;CAAQ,CAAA;AAC5D;AAEA,IAAa,gBAAgB,EAAE,GAAG,YAA0C;CAC1E,OAAO,oBAAC,OAAe,SAAhB;EAAwB,aAAU;EAAgB,GAAI;CAAQ,CAAA;AACvE;AAEA,IAAa,cAAc,EAAE,GAAG,YAAwC;CACtE,OAAO,oBAAC,OAAe,OAAhB;EAAsB,aAAU;EAAc,GAAI;CAAQ,CAAA;AACnE;AAEA,IAAM,eAAe,EAAE,GAAG,YAAyC;CACjE,OAAO,oBAAC,OAAe,QAAhB;EAAuB,aAAU;EAAe,GAAI;CAAQ,CAAA;AACrE;AAEA,IAAM,gBAAgB,EAAE,WAAW,GAAG,YAA2C;CAC/E,OACE,oBAAC,OAAe,UAAhB;EACE,aAAU;EACV,WAAW,GACT,mMACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,IAAa,gBAAgB,EAC3B,WACA,UACA,OAAO,SACP,kBAAkB,MAClB,GAAG,YAIC;CACJ,OACE,qBAAC,aAAD,EAAA,UAAA,CACE,oBAAC,cAAD,CAAe,CAAA,GACf,qBAAC,OAAe,OAAhB;EACE,aAAU;EACV,aAAW;EACX,WAAW,GACT,2rCACA,SACF;EACA,GAAI;EAPN,UAAA,CASG,UACA,mBACC,qBAAC,OAAe,OAAhB;GAAsB,aAAU;GAAc,QAAQ,oBAAC,QAAD;IAAQ,SAAQ;IAAQ,WAAU;IAAyB,MAAK;GAAW,CAAA;GAAjI,UAAA,CACE,oBAAC,OAAD,CAAQ,CAAA,GACR,oBAAC,QAAD;IAAM,WAAU;IAAU,UAAA;GAAW,CAAA,CACjB;EAEJ,CAAA,CAAA;CACX,CAAA,CAAA,EAAA,CAAA;AAEjB;AAEA,IAAa,eAAe,EAAE,WAAW,GAAG,YAAyC;CACnF,OAAO,oBAAC,OAAD;EAAK,aAAU;EAAe,WAAW,GAAG,6BAA6B,SAAS;EAAG,GAAI;CAAQ,CAAA;AAC1G;AAEA,IAAa,eAAe,EAAE,WAAW,GAAG,YAAyC;CACnF,OAAO,oBAAC,OAAD;EAAK,aAAU;EAAe,WAAW,GAAG,mCAAmC,SAAS;EAAG,GAAI;CAAQ,CAAA;AAChH;AAEA,IAAa,cAAc,EAAE,WAAW,GAAG,YAAwC;CACjF,OAAO,oBAAC,OAAe,OAAhB;EAAsB,aAAU;EAAc,WAAW,GAAG,sDAAsD,SAAS;EAAG,GAAI;CAAQ,CAAA;AACnJ;AAEA,IAAa,oBAAoB,EAAE,WAAW,GAAG,YAA8C;CAC7F,OAAO,oBAAC,OAAe,aAAhB;EAA4B,aAAU;EAAoB,WAAW,GAAG,iCAAiC,SAAS;EAAG,GAAI;CAAQ,CAAA;AAC1I"}
|
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
import { cn } from "../../../lib/utils.js";
|
|
2
|
+
import { Button } from "../button/button.js";
|
|
3
|
+
import { useIsMobile } from "../../../hooks/use-mobile.js";
|
|
4
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "../tooltip/tooltip.js";
|
|
5
|
+
import { Input } from "../input/input.js";
|
|
6
|
+
import { Separator } from "../separator/separator.js";
|
|
7
|
+
import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle } from "../sheet/sheet.js";
|
|
8
|
+
import { Skeleton } from "../skeleton/skeleton.js";
|
|
9
|
+
import * as React from "react";
|
|
10
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
import { cva } from "class-variance-authority";
|
|
12
|
+
import { IconLayoutSidebar } from "@tabler/icons-react";
|
|
13
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
14
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
15
|
+
//#region ../ui/src/components/ui/sidebar/sidebar.tsx
|
|
16
|
+
var SIDEBAR_COOKIE_NAME = "sidebar_state";
|
|
17
|
+
var SIDEBAR_COOKIE_MAX_AGE = 604800;
|
|
18
|
+
var SIDEBAR_WIDTH = "16rem";
|
|
19
|
+
var SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
20
|
+
var SIDEBAR_WIDTH_ICON = "3rem";
|
|
21
|
+
var SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
22
|
+
var SidebarContext = React.createContext(null);
|
|
23
|
+
var useSidebar = () => {
|
|
24
|
+
const context = React.useContext(SidebarContext);
|
|
25
|
+
if (!context) throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
26
|
+
return context;
|
|
27
|
+
};
|
|
28
|
+
var SidebarProvider = ({ defaultOpen = true, open: openProp, onOpenChange: setOpenProp, className, style, children, ...props }) => {
|
|
29
|
+
const isMobile = useIsMobile();
|
|
30
|
+
const [openMobile, setOpenMobile] = React.useState(false);
|
|
31
|
+
const [_open, _setOpen] = React.useState(defaultOpen);
|
|
32
|
+
const open = openProp ?? _open;
|
|
33
|
+
const setOpen = React.useCallback((value) => {
|
|
34
|
+
const openState = typeof value === "function" ? value(open) : value;
|
|
35
|
+
if (setOpenProp) setOpenProp(openState);
|
|
36
|
+
else _setOpen(openState);
|
|
37
|
+
document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
|
|
38
|
+
}, [setOpenProp, open]);
|
|
39
|
+
const toggleSidebar = React.useCallback(() => {
|
|
40
|
+
return isMobile ? setOpenMobile((open) => !open) : setOpen((open) => !open);
|
|
41
|
+
}, [isMobile, setOpen]);
|
|
42
|
+
React.useEffect(() => {
|
|
43
|
+
const handleKeyDown = (event) => {
|
|
44
|
+
if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
|
|
45
|
+
event.preventDefault();
|
|
46
|
+
toggleSidebar();
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
50
|
+
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
51
|
+
}, [toggleSidebar]);
|
|
52
|
+
const state = open ? "expanded" : "collapsed";
|
|
53
|
+
const contextValue = React.useMemo(() => ({
|
|
54
|
+
state,
|
|
55
|
+
open,
|
|
56
|
+
setOpen,
|
|
57
|
+
isMobile,
|
|
58
|
+
openMobile,
|
|
59
|
+
setOpenMobile,
|
|
60
|
+
toggleSidebar
|
|
61
|
+
}), [
|
|
62
|
+
state,
|
|
63
|
+
open,
|
|
64
|
+
setOpen,
|
|
65
|
+
isMobile,
|
|
66
|
+
openMobile,
|
|
67
|
+
toggleSidebar
|
|
68
|
+
]);
|
|
69
|
+
return /* @__PURE__ */ jsx(SidebarContext.Provider, {
|
|
70
|
+
value: contextValue,
|
|
71
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
72
|
+
"data-slot": "sidebar-wrapper",
|
|
73
|
+
style: {
|
|
74
|
+
"--sidebar-width": SIDEBAR_WIDTH,
|
|
75
|
+
"--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
|
|
76
|
+
...style
|
|
77
|
+
},
|
|
78
|
+
className: cn("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar", className),
|
|
79
|
+
...props,
|
|
80
|
+
children
|
|
81
|
+
})
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
var Sidebar = ({ side = "left", variant = "sidebar", collapsible = "offcanvas", className, children, dir, ...props }) => {
|
|
85
|
+
const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
|
|
86
|
+
if (collapsible === "none") return /* @__PURE__ */ jsx("div", {
|
|
87
|
+
"data-slot": "sidebar",
|
|
88
|
+
className: cn("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground", className),
|
|
89
|
+
...props,
|
|
90
|
+
children
|
|
91
|
+
});
|
|
92
|
+
if (isMobile) return /* @__PURE__ */ jsx(Sheet, {
|
|
93
|
+
open: openMobile,
|
|
94
|
+
onOpenChange: setOpenMobile,
|
|
95
|
+
...props,
|
|
96
|
+
children: /* @__PURE__ */ jsxs(SheetContent, {
|
|
97
|
+
dir,
|
|
98
|
+
"data-sidebar": "sidebar",
|
|
99
|
+
"data-slot": "sidebar",
|
|
100
|
+
"data-mobile": "true",
|
|
101
|
+
className: "w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",
|
|
102
|
+
style: { "--sidebar-width": SIDEBAR_WIDTH_MOBILE },
|
|
103
|
+
side,
|
|
104
|
+
children: [/* @__PURE__ */ jsxs(SheetHeader, {
|
|
105
|
+
className: "sr-only",
|
|
106
|
+
children: [/* @__PURE__ */ jsx(SheetTitle, { children: "Sidebar" }), /* @__PURE__ */ jsx(SheetDescription, { children: "Displays the mobile sidebar." })]
|
|
107
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
108
|
+
className: "flex h-full w-full flex-col",
|
|
109
|
+
children
|
|
110
|
+
})]
|
|
111
|
+
})
|
|
112
|
+
});
|
|
113
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
114
|
+
className: "group peer hidden text-sidebar-foreground md:block",
|
|
115
|
+
"data-state": state,
|
|
116
|
+
"data-collapsible": state === "collapsed" ? collapsible : "",
|
|
117
|
+
"data-variant": variant,
|
|
118
|
+
"data-side": side,
|
|
119
|
+
"data-slot": "sidebar",
|
|
120
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
121
|
+
"data-slot": "sidebar-gap",
|
|
122
|
+
className: cn("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 motion-reduce:transition-none ease-linear", "group-data-[collapsible=offcanvas]:w-0", "group-data-[side=right]:rotate-180", variant === "floating" || variant === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)")
|
|
123
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
124
|
+
"data-slot": "sidebar-container",
|
|
125
|
+
"data-side": side,
|
|
126
|
+
className: cn("fixed inset-y-0 top-(--sidebar-top) z-10 hidden h-[calc(100svh-var(--sidebar-top))] w-(--sidebar-width) transition-[left,right,width] duration-200 motion-reduce:transition-none ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex", variant === "floating" || variant === "inset" ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l", className),
|
|
127
|
+
...props,
|
|
128
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
129
|
+
"data-sidebar": "sidebar",
|
|
130
|
+
"data-slot": "sidebar-inner",
|
|
131
|
+
className: "flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border",
|
|
132
|
+
children
|
|
133
|
+
})
|
|
134
|
+
})]
|
|
135
|
+
});
|
|
136
|
+
};
|
|
137
|
+
var SidebarTrigger = ({ className, onClick, ...props }) => {
|
|
138
|
+
const { toggleSidebar } = useSidebar();
|
|
139
|
+
return /* @__PURE__ */ jsxs(Button, {
|
|
140
|
+
"data-sidebar": "trigger",
|
|
141
|
+
"data-slot": "sidebar-trigger",
|
|
142
|
+
variant: "ghost",
|
|
143
|
+
size: "icon-sm",
|
|
144
|
+
className: cn(className),
|
|
145
|
+
onClick: (event) => {
|
|
146
|
+
onClick?.(event);
|
|
147
|
+
toggleSidebar();
|
|
148
|
+
},
|
|
149
|
+
...props,
|
|
150
|
+
children: [/* @__PURE__ */ jsx(IconLayoutSidebar, {}), /* @__PURE__ */ jsx("span", {
|
|
151
|
+
className: "sr-only",
|
|
152
|
+
children: "Toggle Sidebar"
|
|
153
|
+
})]
|
|
154
|
+
});
|
|
155
|
+
};
|
|
156
|
+
var SidebarRail = ({ className, ...props }) => {
|
|
157
|
+
const { toggleSidebar } = useSidebar();
|
|
158
|
+
return /* @__PURE__ */ jsx("button", {
|
|
159
|
+
"data-sidebar": "rail",
|
|
160
|
+
"data-slot": "sidebar-rail",
|
|
161
|
+
"aria-label": "Toggle Sidebar",
|
|
162
|
+
tabIndex: -1,
|
|
163
|
+
onClick: toggleSidebar,
|
|
164
|
+
title: "Toggle Sidebar",
|
|
165
|
+
className: cn("absolute inset-y-0 z-20 hidden w-4 transition-all motion-reduce:transition-none ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:start-1/2 after:w-[2px] hover:after:bg-sidebar-border sm:flex ltr:-translate-x-1/2 rtl:-translate-x-1/2", "in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize", "[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize", "group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar", "[[data-side=left][data-collapsible=offcanvas]_&]:-right-2", "[[data-side=right][data-collapsible=offcanvas]_&]:-left-2", className),
|
|
166
|
+
...props
|
|
167
|
+
});
|
|
168
|
+
};
|
|
169
|
+
var SidebarInset = ({ className, ...props }) => {
|
|
170
|
+
return /* @__PURE__ */ jsx("main", {
|
|
171
|
+
"data-slot": "sidebar-inset",
|
|
172
|
+
className: cn("relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2", className),
|
|
173
|
+
...props
|
|
174
|
+
});
|
|
175
|
+
};
|
|
176
|
+
var SidebarInput = ({ className, ...props }) => {
|
|
177
|
+
return /* @__PURE__ */ jsx(Input, {
|
|
178
|
+
"data-slot": "sidebar-input",
|
|
179
|
+
"data-sidebar": "input",
|
|
180
|
+
className: cn("h-8 w-full bg-background shadow-none", className),
|
|
181
|
+
...props
|
|
182
|
+
});
|
|
183
|
+
};
|
|
184
|
+
var SidebarHeader = ({ className, ...props }) => {
|
|
185
|
+
return /* @__PURE__ */ jsx("div", {
|
|
186
|
+
"data-slot": "sidebar-header",
|
|
187
|
+
"data-sidebar": "header",
|
|
188
|
+
className: cn("flex flex-col gap-2 p-2", className),
|
|
189
|
+
...props
|
|
190
|
+
});
|
|
191
|
+
};
|
|
192
|
+
var SidebarFooter = ({ className, ...props }) => {
|
|
193
|
+
return /* @__PURE__ */ jsx("div", {
|
|
194
|
+
"data-slot": "sidebar-footer",
|
|
195
|
+
"data-sidebar": "footer",
|
|
196
|
+
className: cn("flex flex-col gap-2 p-2", className),
|
|
197
|
+
...props
|
|
198
|
+
});
|
|
199
|
+
};
|
|
200
|
+
var SidebarSeparator = ({ className, ...props }) => {
|
|
201
|
+
return /* @__PURE__ */ jsx(Separator, {
|
|
202
|
+
"data-slot": "sidebar-separator",
|
|
203
|
+
"data-sidebar": "separator",
|
|
204
|
+
className: cn("mx-2 w-auto bg-sidebar-border", className),
|
|
205
|
+
...props
|
|
206
|
+
});
|
|
207
|
+
};
|
|
208
|
+
var SidebarContent = ({ className, ...props }) => {
|
|
209
|
+
return /* @__PURE__ */ jsx("div", {
|
|
210
|
+
"data-slot": "sidebar-content",
|
|
211
|
+
"data-sidebar": "content",
|
|
212
|
+
"data-focus": "inset",
|
|
213
|
+
className: cn("no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden", className),
|
|
214
|
+
...props
|
|
215
|
+
});
|
|
216
|
+
};
|
|
217
|
+
var SidebarGroup = ({ className, ...props }) => {
|
|
218
|
+
return /* @__PURE__ */ jsx("div", {
|
|
219
|
+
"data-slot": "sidebar-group",
|
|
220
|
+
"data-sidebar": "group",
|
|
221
|
+
className: cn("relative flex w-full min-w-0 flex-col p-2", className),
|
|
222
|
+
...props
|
|
223
|
+
});
|
|
224
|
+
};
|
|
225
|
+
var SidebarGroupLabel = ({ className, render, ...props }) => {
|
|
226
|
+
return useRender({
|
|
227
|
+
defaultTagName: "div",
|
|
228
|
+
props: mergeProps({ className: cn("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 motion-reduce:transition-none ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0", className) }, props),
|
|
229
|
+
render,
|
|
230
|
+
state: {
|
|
231
|
+
slot: "sidebar-group-label",
|
|
232
|
+
sidebar: "group-label"
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
};
|
|
236
|
+
var SidebarGroupAction = ({ className, render, ...props }) => {
|
|
237
|
+
return useRender({
|
|
238
|
+
defaultTagName: "button",
|
|
239
|
+
props: mergeProps({ className: cn("absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform motion-reduce:transition-none group-data-[collapsible=icon]:hidden after:absolute after:-inset-2 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0", className) }, props),
|
|
240
|
+
render,
|
|
241
|
+
state: {
|
|
242
|
+
slot: "sidebar-group-action",
|
|
243
|
+
sidebar: "group-action"
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
};
|
|
247
|
+
var SidebarGroupContent = ({ className, ...props }) => {
|
|
248
|
+
return /* @__PURE__ */ jsx("div", {
|
|
249
|
+
"data-slot": "sidebar-group-content",
|
|
250
|
+
"data-sidebar": "group-content",
|
|
251
|
+
className: cn("w-full text-sm", className),
|
|
252
|
+
...props
|
|
253
|
+
});
|
|
254
|
+
};
|
|
255
|
+
var SidebarMenu = ({ className, ...props }) => {
|
|
256
|
+
return /* @__PURE__ */ jsx("ul", {
|
|
257
|
+
"data-slot": "sidebar-menu",
|
|
258
|
+
"data-sidebar": "menu",
|
|
259
|
+
className: cn("flex w-full min-w-0 flex-col gap-0", className),
|
|
260
|
+
...props
|
|
261
|
+
});
|
|
262
|
+
};
|
|
263
|
+
var SidebarMenuItem = ({ className, ...props }) => {
|
|
264
|
+
return /* @__PURE__ */ jsx("li", {
|
|
265
|
+
"data-slot": "sidebar-menu-item",
|
|
266
|
+
"data-sidebar": "menu-item",
|
|
267
|
+
className: cn("group/menu-item relative", className),
|
|
268
|
+
...props
|
|
269
|
+
});
|
|
270
|
+
};
|
|
271
|
+
var sidebarMenuButtonVariants = cva("peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] motion-reduce:transition-none group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate", {
|
|
272
|
+
variants: {
|
|
273
|
+
variant: {
|
|
274
|
+
default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
|
|
275
|
+
outline: "bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]"
|
|
276
|
+
},
|
|
277
|
+
size: {
|
|
278
|
+
default: "h-8 text-sm",
|
|
279
|
+
sm: "h-7 text-xs",
|
|
280
|
+
lg: "h-12 text-sm group-data-[collapsible=icon]:p-0!"
|
|
281
|
+
}
|
|
282
|
+
},
|
|
283
|
+
defaultVariants: {
|
|
284
|
+
variant: "default",
|
|
285
|
+
size: "default"
|
|
286
|
+
}
|
|
287
|
+
});
|
|
288
|
+
var SidebarMenuButton = ({ render, isActive = false, variant = "default", size = "default", tooltip, className, ...props }) => {
|
|
289
|
+
const { isMobile, state } = useSidebar();
|
|
290
|
+
const comp = useRender({
|
|
291
|
+
defaultTagName: "button",
|
|
292
|
+
props: mergeProps({ className: cn(sidebarMenuButtonVariants({
|
|
293
|
+
variant,
|
|
294
|
+
size
|
|
295
|
+
}), className) }, props),
|
|
296
|
+
render: !tooltip ? render : /* @__PURE__ */ jsx(TooltipTrigger, { render }),
|
|
297
|
+
state: {
|
|
298
|
+
slot: "sidebar-menu-button",
|
|
299
|
+
sidebar: "menu-button",
|
|
300
|
+
size,
|
|
301
|
+
active: isActive
|
|
302
|
+
}
|
|
303
|
+
});
|
|
304
|
+
if (!tooltip) return comp;
|
|
305
|
+
if (typeof tooltip === "string") tooltip = { children: tooltip };
|
|
306
|
+
return /* @__PURE__ */ jsxs(Tooltip, { children: [comp, /* @__PURE__ */ jsx(TooltipContent, {
|
|
307
|
+
side: "right",
|
|
308
|
+
align: "center",
|
|
309
|
+
hidden: state !== "collapsed" || isMobile,
|
|
310
|
+
...tooltip
|
|
311
|
+
})] });
|
|
312
|
+
};
|
|
313
|
+
var SidebarMenuAction = ({ className, render, showOnHover = false, ...props }) => {
|
|
314
|
+
return useRender({
|
|
315
|
+
defaultTagName: "button",
|
|
316
|
+
props: mergeProps({ className: cn("absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform motion-reduce:transition-none group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 after:absolute after:-inset-2 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0", showOnHover && "group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 peer-data-active/menu-button:text-sidebar-accent-foreground aria-expanded:opacity-100 md:opacity-0", className) }, props),
|
|
317
|
+
render,
|
|
318
|
+
state: {
|
|
319
|
+
slot: "sidebar-menu-action",
|
|
320
|
+
sidebar: "menu-action"
|
|
321
|
+
}
|
|
322
|
+
});
|
|
323
|
+
};
|
|
324
|
+
var SidebarMenuBadge = ({ className, ...props }) => {
|
|
325
|
+
return /* @__PURE__ */ jsx("div", {
|
|
326
|
+
"data-slot": "sidebar-menu-badge",
|
|
327
|
+
"data-sidebar": "menu-badge",
|
|
328
|
+
className: cn("pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium text-sidebar-foreground tabular-nums select-none group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 peer-data-active/menu-button:text-sidebar-accent-foreground", className),
|
|
329
|
+
...props
|
|
330
|
+
});
|
|
331
|
+
};
|
|
332
|
+
var SidebarMenuSkeleton = ({ className, showIcon = false, ...props }) => {
|
|
333
|
+
const [width] = React.useState(() => {
|
|
334
|
+
return `${Math.floor(Math.random() * 40) + 50}%`;
|
|
335
|
+
});
|
|
336
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
337
|
+
"data-slot": "sidebar-menu-skeleton",
|
|
338
|
+
"data-sidebar": "menu-skeleton",
|
|
339
|
+
className: cn("flex h-8 items-center gap-2 rounded-md px-2", className),
|
|
340
|
+
...props,
|
|
341
|
+
children: [showIcon && /* @__PURE__ */ jsx(Skeleton, {
|
|
342
|
+
className: "size-4 rounded-md",
|
|
343
|
+
"data-sidebar": "menu-skeleton-icon"
|
|
344
|
+
}), /* @__PURE__ */ jsx(Skeleton, {
|
|
345
|
+
className: "h-4 max-w-(--skeleton-width) flex-1",
|
|
346
|
+
"data-sidebar": "menu-skeleton-text",
|
|
347
|
+
style: { "--skeleton-width": width }
|
|
348
|
+
})]
|
|
349
|
+
});
|
|
350
|
+
};
|
|
351
|
+
var SidebarMenuSub = ({ className, ...props }) => {
|
|
352
|
+
return /* @__PURE__ */ jsx("ul", {
|
|
353
|
+
"data-slot": "sidebar-menu-sub",
|
|
354
|
+
"data-sidebar": "menu-sub",
|
|
355
|
+
className: cn("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5 group-data-[collapsible=icon]:hidden", className),
|
|
356
|
+
...props
|
|
357
|
+
});
|
|
358
|
+
};
|
|
359
|
+
var SidebarMenuSubItem = ({ className, ...props }) => {
|
|
360
|
+
return /* @__PURE__ */ jsx("li", {
|
|
361
|
+
"data-slot": "sidebar-menu-sub-item",
|
|
362
|
+
"data-sidebar": "menu-sub-item",
|
|
363
|
+
className: cn("group/menu-sub-item relative", className),
|
|
364
|
+
...props
|
|
365
|
+
});
|
|
366
|
+
};
|
|
367
|
+
var SidebarMenuSubButton = ({ render, size = "md", isActive = false, className, ...props }) => {
|
|
368
|
+
return useRender({
|
|
369
|
+
defaultTagName: "a",
|
|
370
|
+
props: mergeProps({ className: cn("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground ring-sidebar-ring outline-hidden group-data-[collapsible=icon]:hidden hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[size=md]:text-sm data-[size=sm]:text-xs data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground", className) }, props),
|
|
371
|
+
render,
|
|
372
|
+
state: {
|
|
373
|
+
slot: "sidebar-menu-sub-button",
|
|
374
|
+
sidebar: "menu-sub-button",
|
|
375
|
+
size,
|
|
376
|
+
active: isActive
|
|
377
|
+
}
|
|
378
|
+
});
|
|
379
|
+
};
|
|
380
|
+
//#endregion
|
|
381
|
+
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 };
|
|
382
|
+
|
|
383
|
+
//# sourceMappingURL=sidebar.js.map
|