@inspirare/design-system 0.0.22 → 0.0.24
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 +82 -61
- package/dist/book-logo-filled.svg +55 -0
- package/dist/components/ui/accessibility-improvements.js +26 -23
- package/dist/components/ui/accordion.js +34 -24
- package/dist/components/ui/alert-dialog.js +91 -57
- package/dist/components/ui/alert.js +38 -26
- package/dist/components/ui/aspect-ratio.js +11 -3
- package/dist/components/ui/avatar.js +30 -8
- package/dist/components/ui/badge.js +20 -14
- package/dist/components/ui/breadcrumb.js +69 -56
- package/dist/components/ui/button-group.js +17 -13
- package/dist/components/ui/button.js +19 -15
- package/dist/components/ui/calendar.js +63 -59
- package/dist/components/ui/card.js +11 -9
- package/dist/components/ui/carousel.js +70 -75
- package/dist/components/ui/chart.js +75 -72
- package/dist/components/ui/checkbox.js +4 -5
- package/dist/components/ui/collapsible.js +12 -14
- package/dist/components/ui/color-picker.js +60 -80
- package/dist/components/ui/combobox.js +153 -33
- package/dist/components/ui/command.js +50 -48
- package/dist/components/ui/context-menu.js +129 -68
- package/dist/components/ui/dialog.js +65 -60
- package/dist/components/ui/drawer.js +81 -40
- package/dist/components/ui/dropdown-menu.js +100 -87
- package/dist/components/ui/empty.js +7 -6
- package/dist/components/ui/field.js +44 -47
- package/dist/components/ui/form.js +22 -23
- package/dist/components/ui/hover-card.js +14 -11
- package/dist/components/ui/input-group.js +16 -13
- package/dist/components/ui/input-otp.js +37 -32
- package/dist/components/ui/input.js +9 -7
- package/dist/components/ui/item.js +42 -36
- package/dist/components/ui/kbd.js +2 -1
- package/dist/components/ui/label.js +6 -7
- package/dist/components/ui/menubar.js +124 -93
- package/dist/components/ui/navigation-menu.js +79 -54
- package/dist/components/ui/pagination.js +78 -58
- package/dist/components/ui/popover.js +35 -16
- package/dist/components/ui/progress.js +37 -13
- package/dist/components/ui/radio-group.js +14 -14
- package/dist/components/ui/resizable.js +24 -15
- package/dist/components/ui/scroll-area.js +29 -11
- package/dist/components/ui/select.js +98 -56
- package/dist/components/ui/separator.js +5 -7
- package/dist/components/ui/sheet.js +47 -42
- package/dist/components/ui/sidebar.js +279 -248
- package/dist/components/ui/skeleton.js +4 -40
- package/dist/components/ui/slider.js +27 -29
- package/dist/components/ui/sonner.js +27 -10
- package/dist/components/ui/spinner.js +2 -0
- package/dist/components/ui/switch.js +3 -4
- package/dist/components/ui/table.js +6 -6
- package/dist/components/ui/tabs.js +45 -22
- package/dist/components/ui/textarea.js +3 -2
- package/dist/components/ui/theme-toggle.js +38 -41
- package/dist/components/ui/toggle-group.js +30 -21
- package/dist/components/ui/toggle.js +8 -9
- package/dist/components/ui/tooltip.js +28 -23
- package/dist/index.css +1 -1
- package/dist/index.d.ts +446 -468
- package/dist/index.js +58 -58
- package/package.json +42 -41
- package/src/App.tsx +28 -34
- package/src/components/branding/assets/book-logo-filled.svg +55 -0
- package/src/components/branding/logo/logo.tsx +56 -0
- package/src/components/ui/accessibility-improvements.stories.tsx +18 -0
- package/src/components/ui/accessibility-improvements.test.tsx +13 -0
- package/src/components/ui/accessibility-improvements.tsx +16 -6
- package/src/components/ui/accordion.stories.tsx +19 -0
- package/src/components/ui/accordion.test.tsx +14 -0
- package/src/components/ui/accordion.tsx +28 -20
- package/src/components/ui/alert-dialog.stories.tsx +19 -0
- package/src/components/ui/alert-dialog.test.tsx +14 -0
- package/src/components/ui/alert-dialog.tsx +159 -123
- package/src/components/ui/alert.stories.tsx +19 -0
- package/src/components/ui/alert.test.tsx +14 -0
- package/src/components/ui/alert.tsx +60 -41
- package/src/components/ui/aspect-ratio.stories.tsx +19 -0
- package/src/components/ui/aspect-ratio.test.tsx +14 -0
- package/src/components/ui/aspect-ratio.tsx +19 -2
- package/src/components/ui/attachment.stories.tsx +19 -0
- package/src/components/ui/attachment.test.tsx +14 -0
- package/src/components/ui/attachment.tsx +209 -0
- package/src/components/ui/avatar.stories.tsx +19 -0
- package/src/components/ui/avatar.test.tsx +14 -0
- package/src/components/ui/avatar.tsx +73 -17
- package/src/components/ui/badge.stories.tsx +19 -0
- package/src/components/ui/badge.test.tsx +14 -0
- package/src/components/ui/badge.tsx +33 -25
- package/src/components/ui/breadcrumb.stories.tsx +19 -0
- package/src/components/ui/breadcrumb.test.tsx +14 -0
- package/src/components/ui/breadcrumb.tsx +98 -86
- package/src/components/ui/bubble.stories.tsx +19 -0
- package/src/components/ui/bubble.test.tsx +14 -0
- package/src/components/ui/bubble.tsx +130 -0
- package/src/components/ui/button-group.stories.tsx +19 -0
- package/src/components/ui/button-group.test.tsx +14 -0
- package/src/components/ui/button-group.tsx +26 -20
- package/src/components/ui/button.stories.tsx +19 -0
- package/src/components/ui/button.test.tsx +14 -0
- package/src/components/ui/button.tsx +30 -31
- package/src/components/ui/calendar.stories.tsx +19 -0
- package/src/components/ui/calendar.test.tsx +14 -0
- package/src/components/ui/calendar.tsx +28 -26
- package/src/components/ui/card.stories.tsx +19 -0
- package/src/components/ui/card.test.tsx +14 -0
- package/src/components/ui/card.tsx +30 -17
- package/src/components/ui/carousel.stories.tsx +19 -0
- package/src/components/ui/carousel.test.tsx +14 -0
- package/src/components/ui/carousel.tsx +115 -135
- package/src/components/ui/chart.stories.tsx +18 -0
- package/src/components/ui/chart.test.tsx +13 -0
- package/src/components/ui/chart.tsx +220 -216
- package/src/components/ui/checkbox.stories.tsx +19 -0
- package/src/components/ui/checkbox.test.tsx +14 -0
- package/src/components/ui/checkbox.tsx +7 -10
- package/src/components/ui/collapsible.stories.tsx +19 -0
- package/src/components/ui/collapsible.test.tsx +14 -0
- package/src/components/ui/collapsible.tsx +11 -26
- package/src/components/ui/color-picker.stories.tsx +19 -0
- package/src/components/ui/color-picker.test.tsx +14 -0
- package/src/components/ui/color-picker.tsx +36 -26
- package/src/components/ui/combobox.stories.tsx +19 -0
- package/src/components/ui/combobox.test.tsx +14 -0
- package/src/components/ui/combobox.tsx +281 -96
- package/src/components/ui/command.stories.tsx +19 -0
- package/src/components/ui/command.test.tsx +14 -0
- package/src/components/ui/command.tsx +59 -47
- package/src/components/ui/context-menu.stories.tsx +19 -0
- package/src/components/ui/context-menu.test.tsx +14 -0
- package/src/components/ui/context-menu.tsx +231 -160
- package/src/components/ui/dialog.stories.tsx +19 -0
- package/src/components/ui/dialog.test.tsx +14 -0
- package/src/components/ui/dialog.tsx +81 -72
- package/src/components/ui/direction.stories.tsx +19 -0
- package/src/components/ui/direction.test.tsx +14 -0
- package/src/components/ui/direction.tsx +6 -0
- package/src/components/ui/drawer.stories.tsx +19 -0
- package/src/components/ui/drawer.test.tsx +14 -0
- package/src/components/ui/drawer.tsx +143 -64
- package/src/components/ui/dropdown-menu.stories.tsx +19 -0
- package/src/components/ui/dropdown-menu.test.tsx +14 -0
- package/src/components/ui/dropdown-menu.tsx +199 -153
- package/src/components/ui/empty.stories.tsx +18 -0
- package/src/components/ui/empty.test.tsx +13 -0
- package/src/components/ui/empty.tsx +11 -9
- package/src/components/ui/field.stories.tsx +18 -0
- package/src/components/ui/field.test.tsx +13 -0
- package/src/components/ui/field.tsx +26 -32
- package/src/components/ui/form.stories.tsx +22 -0
- package/src/components/ui/form.test.tsx +15 -0
- package/src/components/ui/form.tsx +1 -2
- package/src/components/ui/hover-card.stories.tsx +19 -0
- package/src/components/ui/hover-card.test.tsx +14 -0
- package/src/components/ui/hover-card.tsx +34 -32
- package/src/components/ui/input-group.stories.tsx +18 -0
- package/src/components/ui/input-group.test.tsx +13 -0
- package/src/components/ui/input-group.tsx +21 -28
- package/src/components/ui/input-otp.stories.tsx +19 -0
- package/src/components/ui/input-otp.test.tsx +14 -0
- package/src/components/ui/input-otp.tsx +58 -42
- package/src/components/ui/input.stories.tsx +19 -0
- package/src/components/ui/input.test.tsx +14 -0
- package/src/components/ui/input.tsx +9 -8
- package/src/components/ui/item.stories.tsx +18 -0
- package/src/components/ui/item.test.tsx +13 -0
- package/src/components/ui/item.tsx +38 -28
- package/src/components/ui/kbd.stories.tsx +18 -0
- package/src/components/ui/kbd.test.tsx +13 -0
- package/src/components/ui/kbd.tsx +3 -3
- package/src/components/ui/label.stories.tsx +18 -0
- package/src/components/ui/label.test.tsx +13 -0
- package/src/components/ui/label.tsx +7 -11
- package/src/components/ui/marker.stories.tsx +19 -0
- package/src/components/ui/marker.test.tsx +14 -0
- package/src/components/ui/marker.tsx +73 -0
- package/src/components/ui/menubar.stories.tsx +19 -0
- package/src/components/ui/menubar.test.tsx +14 -0
- package/src/components/ui/menubar.tsx +226 -202
- package/src/components/ui/message-scroller.stories.tsx +19 -0
- package/src/components/ui/message-scroller.test.tsx +14 -0
- package/src/components/ui/message-scroller.tsx +131 -0
- package/src/components/ui/message.stories.tsx +19 -0
- package/src/components/ui/message.test.tsx +14 -0
- package/src/components/ui/message.tsx +94 -0
- package/src/components/ui/native-select.stories.tsx +18 -0
- package/src/components/ui/native-select.test.tsx +13 -0
- package/src/components/ui/native-select.tsx +63 -0
- package/src/components/ui/navigation-menu.stories.tsx +19 -0
- package/src/components/ui/navigation-menu.test.tsx +14 -0
- package/src/components/ui/navigation-menu.tsx +145 -103
- package/src/components/ui/pagination.stories.tsx +19 -0
- package/src/components/ui/pagination.test.tsx +14 -0
- package/src/components/ui/pagination.tsx +114 -83
- package/src/components/ui/popover.stories.tsx +19 -0
- package/src/components/ui/popover.test.tsx +14 -0
- package/src/components/ui/popover.tsx +68 -33
- package/src/components/ui/progress.stories.tsx +19 -0
- package/src/components/ui/progress.test.tsx +14 -0
- package/src/components/ui/progress.tsx +67 -15
- package/src/components/ui/questionnaire.stories.tsx +19 -0
- package/src/components/ui/questionnaire.test.tsx +14 -0
- package/src/components/ui/questionnaire.tsx +324 -0
- package/src/components/ui/radio-group.stories.tsx +19 -0
- package/src/components/ui/radio-group.test.tsx +14 -0
- package/src/components/ui/radio-group.tsx +15 -20
- package/src/components/ui/resizable.stories.tsx +19 -0
- package/src/components/ui/resizable.test.tsx +14 -0
- package/src/components/ui/resizable.tsx +37 -30
- package/src/components/ui/scroll-area.stories.tsx +19 -0
- package/src/components/ui/scroll-area.test.tsx +14 -0
- package/src/components/ui/scroll-area.tsx +41 -19
- package/src/components/ui/select.stories.tsx +19 -0
- package/src/components/ui/select.test.tsx +14 -0
- package/src/components/ui/select.tsx +145 -78
- package/src/components/ui/separator.stories.tsx +19 -0
- package/src/components/ui/separator.test.tsx +14 -0
- package/src/components/ui/separator.tsx +8 -11
- package/src/components/ui/sheet.stories.tsx +19 -0
- package/src/components/ui/sheet.test.tsx +14 -0
- package/src/components/ui/sheet.tsx +56 -71
- package/src/components/ui/sidebar.stories.tsx +18 -0
- package/src/components/ui/sidebar.test.tsx +13 -0
- package/src/components/ui/sidebar.tsx +469 -513
- package/src/components/ui/skeleton.stories.tsx +19 -0
- package/src/components/ui/skeleton.test.tsx +14 -0
- package/src/components/ui/skeleton.tsx +8 -114
- package/src/components/ui/slider.stories.tsx +19 -0
- package/src/components/ui/slider.test.tsx +14 -0
- package/src/components/ui/slider.tsx +31 -40
- package/src/components/ui/sonner.stories.tsx +19 -0
- package/src/components/ui/sonner.test.tsx +14 -0
- package/src/components/ui/sonner.tsx +39 -7
- package/src/components/ui/spinner.stories.tsx +18 -0
- package/src/components/ui/spinner.test.tsx +13 -0
- package/src/components/ui/spinner.tsx +3 -7
- package/src/components/ui/switch.stories.tsx +19 -0
- package/src/components/ui/switch.test.tsx +14 -0
- package/src/components/ui/switch.tsx +4 -7
- package/src/components/ui/table.stories.tsx +19 -0
- package/src/components/ui/table.test.tsx +14 -0
- package/src/components/ui/table.tsx +17 -17
- package/src/components/ui/tabs.stories.tsx +19 -0
- package/src/components/ui/tabs.test.tsx +14 -0
- package/src/components/ui/tabs.tsx +71 -31
- package/src/components/ui/textarea.stories.tsx +19 -0
- package/src/components/ui/textarea.test.tsx +14 -0
- package/src/components/ui/textarea.tsx +7 -5
- package/src/components/ui/theme-toggle.stories.tsx +18 -0
- package/src/components/ui/theme-toggle.test.tsx +13 -0
- package/src/components/ui/theme-toggle.tsx +35 -37
- package/src/components/ui/toggle-group.stories.tsx +19 -0
- package/src/components/ui/toggle-group.test.tsx +14 -0
- package/src/components/ui/toggle-group.tsx +41 -25
- package/src/components/ui/toggle.stories.tsx +19 -0
- package/src/components/ui/toggle.test.tsx +14 -0
- package/src/components/ui/toggle.tsx +17 -19
- package/src/components/ui/tooltip.stories.tsx +19 -0
- package/src/components/ui/tooltip.test.tsx +14 -0
- package/src/components/ui/tooltip.tsx +53 -44
- package/src/demo/AIDemo.tsx +50 -0
- package/src/demo/ButtonsDemo.tsx +41 -18
- package/src/demo/CalendarDemo.tsx +1 -1
- package/src/demo/FeedbackDemo.tsx +4 -6
- package/src/demo/FormsDemo.tsx +34 -11
- package/src/demo/NavigationDemo.tsx +38 -13
- package/src/demo/OverlaysDemo.tsx +22 -36
- package/src/demo/update-demos.js +82 -0
- package/src/index.css +66 -46
- package/src/lib/utils.ts +3 -3
- package/src/stories/Button.stories.ts +54 -0
- package/src/stories/Button.tsx +36 -0
- package/src/stories/Configure.mdx +388 -0
- package/src/stories/Header.stories.ts +34 -0
- package/src/stories/Header.tsx +55 -0
- package/src/stories/Page.stories.ts +33 -0
- package/src/stories/Page.tsx +73 -0
- package/src/stories/assets/accessibility.png +0 -0
- package/src/stories/assets/accessibility.svg +1 -0
- package/src/stories/assets/addon-library.png +0 -0
- package/src/stories/assets/assets.png +0 -0
- package/src/stories/assets/avif-test-image.avif +0 -0
- package/src/stories/assets/context.png +0 -0
- package/src/stories/assets/discord.svg +1 -0
- package/src/stories/assets/docs.png +0 -0
- package/src/stories/assets/figma-plugin.png +0 -0
- package/src/stories/assets/github.svg +1 -0
- package/src/stories/assets/share.png +0 -0
- package/src/stories/assets/styling.png +0 -0
- package/src/stories/assets/testing.png +0 -0
- package/src/stories/assets/theming.png +0 -0
- package/src/stories/assets/tutorials.svg +1 -0
- package/src/stories/assets/youtube.svg +1 -0
- package/src/stories/button.css +30 -0
- package/src/stories/header.css +32 -0
- package/src/stories/page.css +68 -0
|
@@ -1,124 +1,137 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn as e } from "../../lib/utils.js";
|
|
3
|
-
import "react";
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
3
|
+
import { CheckIcon as t, ChevronRightIcon as n } from "lucide-react";
|
|
4
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
|
+
import * as a from "react";
|
|
6
|
+
import { Menu as o } from "@base-ui/react/menu";
|
|
7
7
|
//#region src/components/ui/dropdown-menu.tsx
|
|
8
8
|
function s({ ...e }) {
|
|
9
|
-
return /* @__PURE__ */
|
|
9
|
+
return /* @__PURE__ */ r(o.Root, {
|
|
10
10
|
"data-slot": "dropdown-menu",
|
|
11
11
|
...e
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
14
|
function c({ ...e }) {
|
|
15
|
-
return /* @__PURE__ */
|
|
15
|
+
return /* @__PURE__ */ r(o.Portal, {
|
|
16
16
|
"data-slot": "dropdown-menu-portal",
|
|
17
17
|
...e
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
20
|
+
var l = a.forwardRef(({ ...e }, t) => /* @__PURE__ */ r(o.Trigger, {
|
|
21
|
+
ref: t,
|
|
22
|
+
"data-slot": "dropdown-menu-trigger",
|
|
23
|
+
...e
|
|
24
|
+
}));
|
|
25
|
+
l.displayName = "DropdownMenuTrigger";
|
|
26
|
+
var u = a.forwardRef(({ align: t = "start", alignOffset: n = 0, side: i = "bottom", sideOffset: a = 4, className: s, ...c }, l) => /* @__PURE__ */ r(o.Portal, { children: /* @__PURE__ */ r(o.Positioner, {
|
|
27
|
+
className: "isolate z-50 outline-none",
|
|
28
|
+
align: t,
|
|
29
|
+
alignOffset: n,
|
|
30
|
+
side: i,
|
|
31
|
+
sideOffset: a,
|
|
32
|
+
children: /* @__PURE__ */ r(o.Popup, {
|
|
33
|
+
ref: l,
|
|
29
34
|
"data-slot": "dropdown-menu-content",
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
className: e("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95", s),
|
|
36
|
+
...c
|
|
37
|
+
})
|
|
38
|
+
}) }));
|
|
39
|
+
u.displayName = "DropdownMenuContent";
|
|
35
40
|
function d({ ...e }) {
|
|
36
|
-
return /* @__PURE__ */
|
|
41
|
+
return /* @__PURE__ */ r(o.Group, {
|
|
37
42
|
"data-slot": "dropdown-menu-group",
|
|
38
43
|
...e
|
|
39
44
|
});
|
|
40
45
|
}
|
|
41
|
-
function f({ className: t, inset: n,
|
|
42
|
-
return /* @__PURE__ */
|
|
43
|
-
"data-slot": "dropdown-menu-
|
|
46
|
+
function f({ className: t, inset: n, ...i }) {
|
|
47
|
+
return /* @__PURE__ */ r(o.GroupLabel, {
|
|
48
|
+
"data-slot": "dropdown-menu-label",
|
|
44
49
|
"data-inset": n,
|
|
45
|
-
"data-
|
|
46
|
-
|
|
47
|
-
...a
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
function p({ className: n, children: r, checked: s, ...c }) {
|
|
51
|
-
return /* @__PURE__ */ a(o.CheckboxItem, {
|
|
52
|
-
"data-slot": "dropdown-menu-checkbox-item",
|
|
53
|
-
className: e("focus:bg-accent focus:text-accent-foreground relative flex cursor-pointer items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", n),
|
|
54
|
-
checked: s,
|
|
55
|
-
...c,
|
|
56
|
-
children: [/* @__PURE__ */ i("span", {
|
|
57
|
-
className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",
|
|
58
|
-
children: /* @__PURE__ */ i(o.ItemIndicator, { children: /* @__PURE__ */ i(t, { className: "size-4" }) })
|
|
59
|
-
}), r]
|
|
50
|
+
className: e("px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7", t),
|
|
51
|
+
...i
|
|
60
52
|
});
|
|
61
53
|
}
|
|
54
|
+
var p = a.forwardRef(({ className: t, inset: n, variant: i = "default", ...a }, s) => /* @__PURE__ */ r(o.Item, {
|
|
55
|
+
ref: s,
|
|
56
|
+
"data-slot": "dropdown-menu-item",
|
|
57
|
+
"data-inset": n,
|
|
58
|
+
"data-variant": i,
|
|
59
|
+
className: e("group/dropdown-menu-item relative flex cursor-pointer items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive", t),
|
|
60
|
+
...a
|
|
61
|
+
}));
|
|
62
|
+
p.displayName = "DropdownMenuItem";
|
|
62
63
|
function m({ ...e }) {
|
|
63
|
-
return /* @__PURE__ */
|
|
64
|
-
"data-slot": "dropdown-menu-
|
|
64
|
+
return /* @__PURE__ */ r(o.SubmenuRoot, {
|
|
65
|
+
"data-slot": "dropdown-menu-sub",
|
|
65
66
|
...e
|
|
66
67
|
});
|
|
67
68
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
69
|
+
var h = a.forwardRef(({ className: t, inset: a, children: s, ...c }, l) => /* @__PURE__ */ i(o.SubmenuTrigger, {
|
|
70
|
+
ref: l,
|
|
71
|
+
"data-slot": "dropdown-menu-sub-trigger",
|
|
72
|
+
"data-inset": a,
|
|
73
|
+
className: e("flex cursor-pointer items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-popup-open:bg-accent data-popup-open:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", t),
|
|
74
|
+
...c,
|
|
75
|
+
children: [s, /* @__PURE__ */ r(n, { className: "ml-auto" })]
|
|
76
|
+
}));
|
|
77
|
+
h.displayName = "DropdownMenuSubTrigger";
|
|
78
|
+
var g = a.forwardRef(({ align: t = "start", alignOffset: n = -3, side: i = "right", sideOffset: a = 0, className: o, ...s }, c) => /* @__PURE__ */ r(u, {
|
|
79
|
+
ref: c,
|
|
80
|
+
"data-slot": "dropdown-menu-sub-content",
|
|
81
|
+
className: e("w-auto min-w-[96px] rounded-lg bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", o),
|
|
82
|
+
align: t,
|
|
83
|
+
alignOffset: n,
|
|
84
|
+
side: i,
|
|
85
|
+
sideOffset: a,
|
|
86
|
+
...s
|
|
87
|
+
}));
|
|
88
|
+
g.displayName = "DropdownMenuSubContent";
|
|
89
|
+
var _ = a.forwardRef(({ className: n, children: a, checked: s, inset: c, ...l }, u) => /* @__PURE__ */ i(o.CheckboxItem, {
|
|
90
|
+
ref: u,
|
|
91
|
+
"data-slot": "dropdown-menu-checkbox-item",
|
|
92
|
+
"data-inset": c,
|
|
93
|
+
className: e("relative flex cursor-pointer items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", n),
|
|
94
|
+
checked: s,
|
|
95
|
+
...l,
|
|
96
|
+
children: [/* @__PURE__ */ r("span", {
|
|
97
|
+
className: "pointer-events-none absolute right-2 flex items-center justify-center",
|
|
98
|
+
"data-slot": "dropdown-menu-checkbox-item-indicator",
|
|
99
|
+
children: /* @__PURE__ */ r(o.CheckboxItemIndicator, { children: /* @__PURE__ */ r(t, {}) })
|
|
100
|
+
}), a]
|
|
101
|
+
}));
|
|
102
|
+
_.displayName = "DropdownMenuCheckboxItem";
|
|
103
|
+
function v({ ...e }) {
|
|
104
|
+
return /* @__PURE__ */ r(o.RadioGroup, {
|
|
105
|
+
"data-slot": "dropdown-menu-radio-group",
|
|
106
|
+
...e
|
|
85
107
|
});
|
|
86
108
|
}
|
|
87
|
-
|
|
88
|
-
|
|
109
|
+
var y = a.forwardRef(({ className: n, children: a, inset: s, ...c }, l) => /* @__PURE__ */ i(o.RadioItem, {
|
|
110
|
+
ref: l,
|
|
111
|
+
"data-slot": "dropdown-menu-radio-item",
|
|
112
|
+
"data-inset": s,
|
|
113
|
+
className: e("relative flex cursor-pointer items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", n),
|
|
114
|
+
...c,
|
|
115
|
+
children: [/* @__PURE__ */ r("span", {
|
|
116
|
+
className: "pointer-events-none absolute right-2 flex items-center justify-center",
|
|
117
|
+
"data-slot": "dropdown-menu-radio-item-indicator",
|
|
118
|
+
children: /* @__PURE__ */ r(o.RadioItemIndicator, { children: /* @__PURE__ */ r(t, {}) })
|
|
119
|
+
}), a]
|
|
120
|
+
}));
|
|
121
|
+
y.displayName = "DropdownMenuRadioItem";
|
|
122
|
+
function b({ className: t, ...n }) {
|
|
123
|
+
return /* @__PURE__ */ r(o.Separator, {
|
|
89
124
|
"data-slot": "dropdown-menu-separator",
|
|
90
|
-
className: e("
|
|
125
|
+
className: e("-mx-1 my-1 h-px bg-border", t),
|
|
91
126
|
...n
|
|
92
127
|
});
|
|
93
128
|
}
|
|
94
|
-
function v({ className: t, ...n }) {
|
|
95
|
-
return /* @__PURE__ */ i("span", {
|
|
96
|
-
"data-slot": "dropdown-menu-shortcut",
|
|
97
|
-
className: e("text-muted-foreground ml-auto text-xs tracking-widest", t),
|
|
98
|
-
...n
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
function y({ ...e }) {
|
|
102
|
-
return /* @__PURE__ */ i(o.Sub, {
|
|
103
|
-
"data-slot": "dropdown-menu-sub",
|
|
104
|
-
...e
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
function b({ className: t, inset: r, children: s, ...c }) {
|
|
108
|
-
return /* @__PURE__ */ a(o.SubTrigger, {
|
|
109
|
-
"data-slot": "dropdown-menu-sub-trigger",
|
|
110
|
-
"data-inset": r,
|
|
111
|
-
className: e("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-pointer items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8", t),
|
|
112
|
-
...c,
|
|
113
|
-
children: [s, /* @__PURE__ */ i(n, { className: "ml-auto size-4" })]
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
129
|
function x({ className: t, ...n }) {
|
|
117
|
-
return /* @__PURE__ */
|
|
118
|
-
"data-slot": "dropdown-menu-
|
|
119
|
-
className: e("
|
|
130
|
+
return /* @__PURE__ */ r("span", {
|
|
131
|
+
"data-slot": "dropdown-menu-shortcut",
|
|
132
|
+
className: e("ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground", t),
|
|
120
133
|
...n
|
|
121
134
|
});
|
|
122
135
|
}
|
|
123
136
|
//#endregion
|
|
124
|
-
export { s as DropdownMenu,
|
|
137
|
+
export { s as DropdownMenu, _ as DropdownMenuCheckboxItem, u as DropdownMenuContent, d as DropdownMenuGroup, p as DropdownMenuItem, f as DropdownMenuLabel, c as DropdownMenuPortal, v as DropdownMenuRadioGroup, y as DropdownMenuRadioItem, b as DropdownMenuSeparator, x as DropdownMenuShortcut, m as DropdownMenuSub, g as DropdownMenuSubContent, h as DropdownMenuSubTrigger, l as DropdownMenuTrigger };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { cn as e } from "../../lib/utils.js";
|
|
2
3
|
import { jsx as t } from "react/jsx-runtime";
|
|
3
4
|
import { cva as n } from "class-variance-authority";
|
|
@@ -5,21 +6,21 @@ import { cva as n } from "class-variance-authority";
|
|
|
5
6
|
function r({ className: n, ...r }) {
|
|
6
7
|
return /* @__PURE__ */ t("div", {
|
|
7
8
|
"data-slot": "empty",
|
|
8
|
-
className: e("flex min-w-0 flex-1 flex-col items-center justify-center gap-
|
|
9
|
+
className: e("flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-xl border-dashed p-6 text-center text-balance", n),
|
|
9
10
|
...r
|
|
10
11
|
});
|
|
11
12
|
}
|
|
12
13
|
function i({ className: n, ...r }) {
|
|
13
14
|
return /* @__PURE__ */ t("div", {
|
|
14
15
|
"data-slot": "empty-header",
|
|
15
|
-
className: e("flex max-w-sm flex-col items-center gap-2
|
|
16
|
+
className: e("flex max-w-sm flex-col items-center gap-2", n),
|
|
16
17
|
...r
|
|
17
18
|
});
|
|
18
19
|
}
|
|
19
20
|
var a = n("mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0", {
|
|
20
21
|
variants: { variant: {
|
|
21
22
|
default: "bg-transparent",
|
|
22
|
-
icon: "
|
|
23
|
+
icon: "flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-4"
|
|
23
24
|
} },
|
|
24
25
|
defaultVariants: { variant: "default" }
|
|
25
26
|
});
|
|
@@ -37,21 +38,21 @@ function o({ className: n, variant: r = "default", ...i }) {
|
|
|
37
38
|
function s({ className: n, ...r }) {
|
|
38
39
|
return /* @__PURE__ */ t("div", {
|
|
39
40
|
"data-slot": "empty-title",
|
|
40
|
-
className: e("text-
|
|
41
|
+
className: e("font-heading text-sm font-medium tracking-tight", n),
|
|
41
42
|
...r
|
|
42
43
|
});
|
|
43
44
|
}
|
|
44
45
|
function c({ className: n, ...r }) {
|
|
45
46
|
return /* @__PURE__ */ t("div", {
|
|
46
47
|
"data-slot": "empty-description",
|
|
47
|
-
className: e("text-muted-foreground [&>a
|
|
48
|
+
className: e("text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary", n),
|
|
48
49
|
...r
|
|
49
50
|
});
|
|
50
51
|
}
|
|
51
52
|
function l({ className: n, ...r }) {
|
|
52
53
|
return /* @__PURE__ */ t("div", {
|
|
53
54
|
"data-slot": "empty-content",
|
|
54
|
-
className: e("flex w-full
|
|
55
|
+
className: e("flex w-full max-w-sm min-w-0 flex-col items-center gap-2.5 text-sm text-balance", n),
|
|
55
56
|
...r
|
|
56
57
|
});
|
|
57
58
|
}
|
|
@@ -2,107 +2,104 @@
|
|
|
2
2
|
import { cn as e } from "../../lib/utils.js";
|
|
3
3
|
import { Separator as t } from "./separator.js";
|
|
4
4
|
import { Label as n } from "./label.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
6
|
+
import { useMemo as a } from "react";
|
|
7
7
|
import { cva as o } from "class-variance-authority";
|
|
8
8
|
//#region src/components/ui/field.tsx
|
|
9
9
|
function s({ className: t, ...n }) {
|
|
10
|
-
return /* @__PURE__ */
|
|
10
|
+
return /* @__PURE__ */ r("fieldset", {
|
|
11
11
|
"data-slot": "field-set",
|
|
12
|
-
className: e("flex flex-col gap-
|
|
12
|
+
className: e("flex flex-col gap-4 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3", t),
|
|
13
13
|
...n
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
|
-
function c({ className: t, variant: n = "legend", ...
|
|
17
|
-
return /* @__PURE__ */
|
|
16
|
+
function c({ className: t, variant: n = "legend", ...i }) {
|
|
17
|
+
return /* @__PURE__ */ r("legend", {
|
|
18
18
|
"data-slot": "field-legend",
|
|
19
19
|
"data-variant": n,
|
|
20
|
-
className: e("mb-
|
|
21
|
-
...
|
|
20
|
+
className: e("mb-1.5 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base", t),
|
|
21
|
+
...i
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
24
|
function l({ className: t, ...n }) {
|
|
25
|
-
return /* @__PURE__ */
|
|
25
|
+
return /* @__PURE__ */ r("div", {
|
|
26
26
|
"data-slot": "field-group",
|
|
27
|
-
className: e("group/field-group @container/field-group flex w-full flex-col gap-
|
|
27
|
+
className: e("group/field-group @container/field-group flex w-full flex-col gap-5 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4", t),
|
|
28
28
|
...n
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
|
-
var u = o("group/field data-[invalid=true]:text-destructive
|
|
31
|
+
var u = o("group/field flex w-full gap-2 data-[invalid=true]:text-destructive", {
|
|
32
32
|
variants: { orientation: {
|
|
33
|
-
vertical:
|
|
34
|
-
horizontal: [
|
|
35
|
-
|
|
36
|
-
"[&>[data-slot=field-label]]:flex-auto",
|
|
37
|
-
"has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px has-[>[data-slot=field-content]]:items-start"
|
|
38
|
-
],
|
|
39
|
-
responsive: [
|
|
40
|
-
"@md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto flex-col [&>*]:w-full [&>.sr-only]:w-auto",
|
|
41
|
-
"@md/field-group:[&>[data-slot=field-label]]:flex-auto",
|
|
42
|
-
"@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
|
|
43
|
-
]
|
|
33
|
+
vertical: "flex-col *:w-full [&>.sr-only]:w-auto",
|
|
34
|
+
horizontal: "flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
|
|
35
|
+
responsive: "flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
|
|
44
36
|
} },
|
|
45
37
|
defaultVariants: { orientation: "vertical" }
|
|
46
38
|
});
|
|
47
|
-
function d({ className: t, orientation: n = "vertical", ...
|
|
48
|
-
return /* @__PURE__ */
|
|
39
|
+
function d({ className: t, orientation: n = "vertical", ...i }) {
|
|
40
|
+
return /* @__PURE__ */ r("div", {
|
|
49
41
|
role: "group",
|
|
50
42
|
"data-slot": "field",
|
|
51
43
|
"data-orientation": n,
|
|
52
44
|
className: e(u({ orientation: n }), t),
|
|
53
|
-
...
|
|
45
|
+
...i
|
|
54
46
|
});
|
|
55
47
|
}
|
|
56
48
|
function f({ className: t, ...n }) {
|
|
57
|
-
return /* @__PURE__ */
|
|
49
|
+
return /* @__PURE__ */ r("div", {
|
|
58
50
|
"data-slot": "field-content",
|
|
59
|
-
className: e("group/field-content flex flex-1 flex-col gap-
|
|
51
|
+
className: e("group/field-content flex flex-1 flex-col gap-0.5 leading-snug", t),
|
|
60
52
|
...n
|
|
61
53
|
});
|
|
62
54
|
}
|
|
63
|
-
function p({ className: t, ...
|
|
64
|
-
return /* @__PURE__ */
|
|
55
|
+
function p({ className: t, ...i }) {
|
|
56
|
+
return /* @__PURE__ */ r(n, {
|
|
65
57
|
"data-slot": "field-label",
|
|
66
|
-
className: e("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50
|
|
67
|
-
...
|
|
58
|
+
className: e("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border has-[>[data-slot=field]]:not-has-[:disabled,[data-disabled]]:hover:bg-muted/50 has-[>[data-slot=field]]:has-[:focus-visible]:border-ring has-[>[data-slot=field]]:has-[:focus-visible]:ring-3 has-[>[data-slot=field]]:has-[:focus-visible]:ring-ring/50 *:data-[slot=field]:p-2.5 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10", "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col", t),
|
|
59
|
+
...i
|
|
68
60
|
});
|
|
69
61
|
}
|
|
70
62
|
function m({ className: t, ...n }) {
|
|
71
|
-
return /* @__PURE__ */
|
|
63
|
+
return /* @__PURE__ */ r("div", {
|
|
72
64
|
"data-slot": "field-label",
|
|
73
|
-
className: e("flex w-fit items-center gap-2 text-sm font-medium
|
|
65
|
+
className: e("flex w-fit items-center gap-2 text-sm font-medium group-data-[disabled=true]/field:opacity-50", t),
|
|
74
66
|
...n
|
|
75
67
|
});
|
|
76
68
|
}
|
|
77
69
|
function h({ className: t, ...n }) {
|
|
78
|
-
return /* @__PURE__ */
|
|
70
|
+
return /* @__PURE__ */ r("p", {
|
|
79
71
|
"data-slot": "field-description",
|
|
80
|
-
className: e("text-
|
|
72
|
+
className: e("text-left text-sm leading-normal font-normal text-muted-foreground group-has-data-horizontal/field:text-balance [[data-variant=legend]+&]:-mt-1.5", "last:mt-0 nth-last-2:-mt-1", "[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary", t),
|
|
81
73
|
...n
|
|
82
74
|
});
|
|
83
75
|
}
|
|
84
|
-
function g({ children: n, className:
|
|
85
|
-
return /* @__PURE__ */
|
|
76
|
+
function g({ children: n, className: a, ...o }) {
|
|
77
|
+
return /* @__PURE__ */ i("div", {
|
|
86
78
|
"data-slot": "field-separator",
|
|
87
79
|
"data-content": !!n,
|
|
88
|
-
className: e("relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2",
|
|
80
|
+
className: e("relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2", a),
|
|
89
81
|
...o,
|
|
90
|
-
children: [/* @__PURE__ */
|
|
91
|
-
className: "
|
|
82
|
+
children: [/* @__PURE__ */ r(t, { className: "absolute inset-0 top-1/2" }), n && /* @__PURE__ */ r("span", {
|
|
83
|
+
className: "relative mx-auto block w-fit bg-background px-2 text-muted-foreground",
|
|
92
84
|
"data-slot": "field-separator-content",
|
|
93
85
|
children: n
|
|
94
86
|
})]
|
|
95
87
|
});
|
|
96
88
|
}
|
|
97
|
-
function _({ className: t, children: n, errors:
|
|
98
|
-
let s =
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
89
|
+
function _({ className: t, children: n, errors: i, ...o }) {
|
|
90
|
+
let s = a(() => {
|
|
91
|
+
if (n) return n;
|
|
92
|
+
if (!i?.length) return null;
|
|
93
|
+
let e = [...new Map(i.map((e) => [e?.message, e])).values()];
|
|
94
|
+
return e?.length == 1 ? e[0]?.message : /* @__PURE__ */ r("ul", {
|
|
95
|
+
className: "ml-4 flex list-disc flex-col gap-1",
|
|
96
|
+
children: e.map((e, t) => e?.message && /* @__PURE__ */ r("li", { children: e.message }, t))
|
|
97
|
+
});
|
|
98
|
+
}, [n, i]);
|
|
99
|
+
return s ? /* @__PURE__ */ r("div", {
|
|
103
100
|
role: "alert",
|
|
104
101
|
"data-slot": "field-error",
|
|
105
|
-
className: e("text-
|
|
102
|
+
className: e("text-sm font-normal text-destructive", t),
|
|
106
103
|
...o,
|
|
107
104
|
children: s
|
|
108
105
|
}) : null;
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn as e } from "../../lib/utils.js";
|
|
3
3
|
import { Label as t } from "./label.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
5
|
+
import * as r from "react";
|
|
6
6
|
import { Slot as i } from "@radix-ui/react-slot";
|
|
7
|
-
import "@radix-ui/react-label";
|
|
8
7
|
import { Controller as a, FormProvider as o, useFormContext as s, useFormState as c } from "react-hook-form";
|
|
9
8
|
//#region src/components/ui/form.tsx
|
|
10
|
-
var l = o, u =
|
|
9
|
+
var l = o, u = r.createContext({}), d = ({ ...e }) => /* @__PURE__ */ n(u.Provider, {
|
|
11
10
|
value: { name: e.name },
|
|
12
|
-
children: /* @__PURE__ */
|
|
11
|
+
children: /* @__PURE__ */ n(a, { ...e })
|
|
13
12
|
}), f = () => {
|
|
14
|
-
let e =
|
|
13
|
+
let e = r.useContext(u), t = r.useContext(p), { getFieldState: n } = s(), i = c({ name: e.name }), a = n(e.name, i);
|
|
15
14
|
if (!e) throw Error("useFormField should be used within <FormField>");
|
|
16
15
|
let { id: o } = t;
|
|
17
16
|
return {
|
|
@@ -22,54 +21,54 @@ var l = o, u = n.createContext({}), d = ({ ...e }) => /* @__PURE__ */ r(u.Provid
|
|
|
22
21
|
formMessageId: `${o}-form-item-message`,
|
|
23
22
|
...a
|
|
24
23
|
};
|
|
25
|
-
}, p =
|
|
24
|
+
}, p = r.createContext({});
|
|
26
25
|
function m({ className: t, ...i }) {
|
|
27
|
-
let a =
|
|
28
|
-
return /* @__PURE__ */
|
|
26
|
+
let a = r.useId();
|
|
27
|
+
return /* @__PURE__ */ n(p.Provider, {
|
|
29
28
|
value: { id: a },
|
|
30
|
-
children: /* @__PURE__ */
|
|
29
|
+
children: /* @__PURE__ */ n("div", {
|
|
31
30
|
"data-slot": "form-item",
|
|
32
31
|
className: e("grid gap-2", t),
|
|
33
32
|
...i
|
|
34
33
|
})
|
|
35
34
|
});
|
|
36
35
|
}
|
|
37
|
-
function h({ className:
|
|
36
|
+
function h({ className: r, ...i }) {
|
|
38
37
|
let { error: a, formItemId: o } = f();
|
|
39
|
-
return /* @__PURE__ */
|
|
38
|
+
return /* @__PURE__ */ n(t, {
|
|
40
39
|
"data-slot": "form-label",
|
|
41
40
|
"data-error": !!a,
|
|
42
|
-
className: e("data-[error=true]:text-destructive",
|
|
41
|
+
className: e("data-[error=true]:text-destructive", r),
|
|
43
42
|
htmlFor: o,
|
|
44
43
|
...i
|
|
45
44
|
});
|
|
46
45
|
}
|
|
47
46
|
function g({ ...e }) {
|
|
48
|
-
let { error: t, formItemId:
|
|
49
|
-
return /* @__PURE__ */
|
|
47
|
+
let { error: t, formItemId: r, formDescriptionId: a, formMessageId: o } = f();
|
|
48
|
+
return /* @__PURE__ */ n(i, {
|
|
50
49
|
"data-slot": "form-control",
|
|
51
|
-
id:
|
|
50
|
+
id: r,
|
|
52
51
|
"aria-describedby": t ? `${a} ${o}` : `${a}`,
|
|
53
52
|
"aria-invalid": !!t,
|
|
54
53
|
...e
|
|
55
54
|
});
|
|
56
55
|
}
|
|
57
|
-
function _({ className: t, ...
|
|
56
|
+
function _({ className: t, ...r }) {
|
|
58
57
|
let { formDescriptionId: i } = f();
|
|
59
|
-
return /* @__PURE__ */
|
|
58
|
+
return /* @__PURE__ */ n("p", {
|
|
60
59
|
"data-slot": "form-description",
|
|
61
60
|
id: i,
|
|
62
61
|
className: e("text-muted-foreground text-sm", t),
|
|
63
|
-
...
|
|
62
|
+
...r
|
|
64
63
|
});
|
|
65
64
|
}
|
|
66
|
-
function v({ className: t, ...
|
|
67
|
-
let { error: i, formMessageId: a } = f(), o = i ? String(i?.message ?? "") :
|
|
68
|
-
return o ? /* @__PURE__ */
|
|
65
|
+
function v({ className: t, ...r }) {
|
|
66
|
+
let { error: i, formMessageId: a } = f(), o = i ? String(i?.message ?? "") : r.children;
|
|
67
|
+
return o ? /* @__PURE__ */ n("p", {
|
|
69
68
|
"data-slot": "form-message",
|
|
70
69
|
id: a,
|
|
71
70
|
className: e("text-destructive text-sm", t),
|
|
72
|
-
...
|
|
71
|
+
...r,
|
|
73
72
|
children: o
|
|
74
73
|
}) : null;
|
|
75
74
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn as e } from "../../lib/utils.js";
|
|
3
|
-
import "react";
|
|
4
3
|
import { jsx as t } from "react/jsx-runtime";
|
|
5
|
-
import
|
|
4
|
+
import { PreviewCard as n } from "@base-ui/react/preview-card";
|
|
6
5
|
//#region src/components/ui/hover-card.tsx
|
|
7
6
|
function r({ ...e }) {
|
|
8
7
|
return /* @__PURE__ */ t(n.Root, {
|
|
@@ -10,22 +9,26 @@ function r({ ...e }) {
|
|
|
10
9
|
...e
|
|
11
10
|
});
|
|
12
11
|
}
|
|
13
|
-
function i({
|
|
12
|
+
function i({ ...e }) {
|
|
14
13
|
return /* @__PURE__ */ t(n.Trigger, {
|
|
15
14
|
"data-slot": "hover-card-trigger",
|
|
16
|
-
|
|
17
|
-
...i
|
|
15
|
+
...e
|
|
18
16
|
});
|
|
19
17
|
}
|
|
20
|
-
function a({ className: r,
|
|
18
|
+
function a({ className: r, side: i = "bottom", sideOffset: a = 4, align: o = "center", alignOffset: s = 4, ...c }) {
|
|
21
19
|
return /* @__PURE__ */ t(n.Portal, {
|
|
22
20
|
"data-slot": "hover-card-portal",
|
|
23
|
-
children: /* @__PURE__ */ t(n.
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
children: /* @__PURE__ */ t(n.Positioner, {
|
|
22
|
+
align: o,
|
|
23
|
+
alignOffset: s,
|
|
24
|
+
side: i,
|
|
26
25
|
sideOffset: a,
|
|
27
|
-
className:
|
|
28
|
-
|
|
26
|
+
className: "isolate z-50",
|
|
27
|
+
children: /* @__PURE__ */ t(n.Popup, {
|
|
28
|
+
"data-slot": "hover-card-content",
|
|
29
|
+
className: e("z-50 w-64 origin-(--transform-origin) rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", r),
|
|
30
|
+
...c
|
|
31
|
+
})
|
|
29
32
|
})
|
|
30
33
|
});
|
|
31
34
|
}
|