@inspirare/design-system 0.0.23 → 0.0.25
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 +116 -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 +38 -37
- 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 +32 -0
- package/src/components/ui/select.tsx +172 -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,32 +1,34 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { cn as e } from "../../lib/utils.js";
|
|
2
|
-
import "react";
|
|
3
3
|
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
+
import "react";
|
|
4
5
|
//#region src/components/ui/card.tsx
|
|
5
|
-
function n({ className: n,
|
|
6
|
+
function n({ className: n, size: r = "default", ...i }) {
|
|
6
7
|
return /* @__PURE__ */ t("div", {
|
|
7
8
|
"data-slot": "card",
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
"data-size": r,
|
|
10
|
+
className: e("group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground border border-border/50 shadow-sm [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl", n),
|
|
11
|
+
...i
|
|
10
12
|
});
|
|
11
13
|
}
|
|
12
14
|
function r({ className: n, ...r }) {
|
|
13
15
|
return /* @__PURE__ */ t("div", {
|
|
14
16
|
"data-slot": "card-header",
|
|
15
|
-
className: e("@container/card-header grid auto-rows-min
|
|
17
|
+
className: e("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)", n),
|
|
16
18
|
...r
|
|
17
19
|
});
|
|
18
20
|
}
|
|
19
21
|
function i({ className: n, ...r }) {
|
|
20
22
|
return /* @__PURE__ */ t("div", {
|
|
21
23
|
"data-slot": "card-title",
|
|
22
|
-
className: e("leading-
|
|
24
|
+
className: e("font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm", n),
|
|
23
25
|
...r
|
|
24
26
|
});
|
|
25
27
|
}
|
|
26
28
|
function a({ className: n, ...r }) {
|
|
27
29
|
return /* @__PURE__ */ t("div", {
|
|
28
30
|
"data-slot": "card-description",
|
|
29
|
-
className: e("text-muted-foreground
|
|
31
|
+
className: e("text-sm text-muted-foreground", n),
|
|
30
32
|
...r
|
|
31
33
|
});
|
|
32
34
|
}
|
|
@@ -40,14 +42,14 @@ function o({ className: n, ...r }) {
|
|
|
40
42
|
function s({ className: n, ...r }) {
|
|
41
43
|
return /* @__PURE__ */ t("div", {
|
|
42
44
|
"data-slot": "card-content",
|
|
43
|
-
className: e("px-
|
|
45
|
+
className: e("px-(--card-spacing)", n),
|
|
44
46
|
...r
|
|
45
47
|
});
|
|
46
48
|
}
|
|
47
49
|
function c({ className: n, ...r }) {
|
|
48
50
|
return /* @__PURE__ */ t("div", {
|
|
49
51
|
"data-slot": "card-footer",
|
|
50
|
-
className: e("flex items-center
|
|
52
|
+
className: e("flex items-center rounded-b-xl border-t bg-muted/50 p-(--card-spacing)", n),
|
|
51
53
|
...r
|
|
52
54
|
});
|
|
53
55
|
}
|
|
@@ -1,116 +1,111 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn as e } from "../../lib/utils.js";
|
|
3
3
|
import { Button as t } from "./button.js";
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
4
|
+
import { ChevronLeftIcon as n, ChevronRightIcon as r } from "lucide-react";
|
|
5
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
+
import * as o from "react";
|
|
7
7
|
import s from "embla-carousel-react";
|
|
8
8
|
//#region src/components/ui/carousel.tsx
|
|
9
|
-
var c =
|
|
9
|
+
var c = o.createContext(null);
|
|
10
10
|
function l() {
|
|
11
|
-
let e =
|
|
11
|
+
let e = o.useContext(c);
|
|
12
12
|
if (!e) throw Error("useCarousel must be used within a <Carousel />");
|
|
13
13
|
return e;
|
|
14
14
|
}
|
|
15
|
-
|
|
16
|
-
let [
|
|
17
|
-
...
|
|
15
|
+
function u({ orientation: t = "horizontal", opts: n, setApi: r, plugins: a, className: l, children: u, ...d }) {
|
|
16
|
+
let [f, p] = s({
|
|
17
|
+
...n,
|
|
18
18
|
axis: t === "horizontal" ? "x" : "y"
|
|
19
|
-
},
|
|
20
|
-
e && (
|
|
21
|
-
}, []),
|
|
22
|
-
|
|
23
|
-
}, [
|
|
24
|
-
|
|
25
|
-
}, [
|
|
26
|
-
e.key === "ArrowLeft" ? (e.preventDefault(),
|
|
27
|
-
}, [
|
|
28
|
-
return
|
|
29
|
-
!
|
|
30
|
-
}, [
|
|
31
|
-
if (
|
|
32
|
-
|
|
19
|
+
}, a), [m, h] = o.useState(!1), [g, _] = o.useState(!1), v = o.useCallback((e) => {
|
|
20
|
+
e && (h(e.canScrollPrev()), _(e.canScrollNext()));
|
|
21
|
+
}, []), y = o.useCallback(() => {
|
|
22
|
+
p?.scrollPrev();
|
|
23
|
+
}, [p]), b = o.useCallback(() => {
|
|
24
|
+
p?.scrollNext();
|
|
25
|
+
}, [p]), x = o.useCallback((e) => {
|
|
26
|
+
e.key === "ArrowLeft" ? (e.preventDefault(), y()) : e.key === "ArrowRight" && (e.preventDefault(), b());
|
|
27
|
+
}, [y, b]);
|
|
28
|
+
return o.useEffect(() => {
|
|
29
|
+
!p || !r || r(p);
|
|
30
|
+
}, [p, r]), o.useEffect(() => {
|
|
31
|
+
if (p) return v(p), p.on("reInit", v), p.on("select", v), () => {
|
|
32
|
+
p?.off("select", v);
|
|
33
33
|
};
|
|
34
|
-
}, [
|
|
34
|
+
}, [p, v]), /* @__PURE__ */ i(c.Provider, {
|
|
35
35
|
value: {
|
|
36
|
-
carouselRef:
|
|
37
|
-
api:
|
|
38
|
-
opts:
|
|
39
|
-
orientation: t || (
|
|
40
|
-
scrollPrev:
|
|
41
|
-
scrollNext:
|
|
42
|
-
canScrollPrev:
|
|
43
|
-
canScrollNext:
|
|
36
|
+
carouselRef: f,
|
|
37
|
+
api: p,
|
|
38
|
+
opts: n,
|
|
39
|
+
orientation: t || (n?.axis === "y" ? "vertical" : "horizontal"),
|
|
40
|
+
scrollPrev: y,
|
|
41
|
+
scrollNext: b,
|
|
42
|
+
canScrollPrev: m,
|
|
43
|
+
canScrollNext: g
|
|
44
44
|
},
|
|
45
|
-
children: /* @__PURE__ */
|
|
46
|
-
|
|
47
|
-
onKeyDownCapture: S,
|
|
45
|
+
children: /* @__PURE__ */ i("div", {
|
|
46
|
+
onKeyDownCapture: x,
|
|
48
47
|
className: e("relative", l),
|
|
49
48
|
role: "region",
|
|
50
49
|
"aria-roledescription": "carousel",
|
|
50
|
+
"data-slot": "carousel",
|
|
51
51
|
...d,
|
|
52
52
|
children: u
|
|
53
53
|
})
|
|
54
54
|
});
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
ref: i,
|
|
55
|
+
}
|
|
56
|
+
function d({ className: t, ...n }) {
|
|
57
|
+
let { carouselRef: r, orientation: a } = l();
|
|
58
|
+
return /* @__PURE__ */ i("div", {
|
|
59
|
+
ref: r,
|
|
61
60
|
className: "overflow-hidden",
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
className: e("flex",
|
|
61
|
+
"data-slot": "carousel-content",
|
|
62
|
+
children: /* @__PURE__ */ i("div", {
|
|
63
|
+
className: e("flex", a === "horizontal" ? "-ml-4" : "-mt-4 flex-col", t),
|
|
65
64
|
...n
|
|
66
65
|
})
|
|
67
66
|
});
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
return /* @__PURE__ */ a("div", {
|
|
73
|
-
ref: r,
|
|
67
|
+
}
|
|
68
|
+
function f({ className: t, ...n }) {
|
|
69
|
+
let { orientation: r } = l();
|
|
70
|
+
return /* @__PURE__ */ i("div", {
|
|
74
71
|
role: "group",
|
|
75
72
|
"aria-roledescription": "slide",
|
|
76
|
-
|
|
73
|
+
"data-slot": "carousel-item",
|
|
74
|
+
className: e("min-w-0 shrink-0 grow-0 basis-full", r === "horizontal" ? "pl-4" : "pt-4", t),
|
|
77
75
|
...n
|
|
78
76
|
});
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
variant: i,
|
|
77
|
+
}
|
|
78
|
+
function p({ className: r, variant: o = "outline", size: s = "icon-sm", ...c }) {
|
|
79
|
+
let { orientation: u, scrollPrev: d, canScrollPrev: f } = l();
|
|
80
|
+
return /* @__PURE__ */ a(t, {
|
|
81
|
+
"data-slot": "carousel-previous",
|
|
82
|
+
variant: o,
|
|
86
83
|
size: s,
|
|
87
|
-
className: e("absolute
|
|
88
|
-
disabled: !
|
|
89
|
-
onClick:
|
|
84
|
+
className: e("absolute touch-manipulation rounded-full", u === "horizontal" ? "inset-y-0 -left-12 my-auto" : "-top-12 left-1/2 -translate-x-1/2 rotate-90", r),
|
|
85
|
+
disabled: !f,
|
|
86
|
+
onClick: d,
|
|
90
87
|
...c,
|
|
91
|
-
children: [/* @__PURE__ */
|
|
88
|
+
children: [/* @__PURE__ */ i(n, {}), /* @__PURE__ */ i("span", {
|
|
92
89
|
className: "sr-only",
|
|
93
90
|
children: "Previous slide"
|
|
94
91
|
})]
|
|
95
92
|
});
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
variant: r,
|
|
93
|
+
}
|
|
94
|
+
function m({ className: n, variant: o = "outline", size: s = "icon-sm", ...c }) {
|
|
95
|
+
let { orientation: u, scrollNext: d, canScrollNext: f } = l();
|
|
96
|
+
return /* @__PURE__ */ a(t, {
|
|
97
|
+
"data-slot": "carousel-next",
|
|
98
|
+
variant: o,
|
|
103
99
|
size: s,
|
|
104
|
-
className: e("absolute
|
|
105
|
-
disabled: !
|
|
106
|
-
onClick:
|
|
100
|
+
className: e("absolute touch-manipulation rounded-full", u === "horizontal" ? "inset-y-0 -right-12 my-auto" : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90", n),
|
|
101
|
+
disabled: !f,
|
|
102
|
+
onClick: d,
|
|
107
103
|
...c,
|
|
108
|
-
children: [/* @__PURE__ */
|
|
104
|
+
children: [/* @__PURE__ */ i(r, {}), /* @__PURE__ */ i("span", {
|
|
109
105
|
className: "sr-only",
|
|
110
106
|
children: "Next slide"
|
|
111
107
|
})]
|
|
112
108
|
});
|
|
113
|
-
}
|
|
114
|
-
m.displayName = "CarouselNext";
|
|
109
|
+
}
|
|
115
110
|
//#endregion
|
|
116
|
-
export { u as Carousel, d as CarouselContent, f as CarouselItem, m as CarouselNext, p as CarouselPrevious };
|
|
111
|
+
export { u as Carousel, d as CarouselContent, f as CarouselItem, m as CarouselNext, p as CarouselPrevious, l as useCarousel };
|
|
@@ -1,53 +1,59 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn as e } from "../../lib/utils.js";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import { Fragment as t, jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
import * as i from "react";
|
|
5
5
|
import * as a from "recharts";
|
|
6
6
|
//#region src/components/ui/chart.tsx
|
|
7
7
|
var o = {
|
|
8
8
|
light: "",
|
|
9
9
|
dark: ".dark"
|
|
10
|
-
}, s =
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
}, s = {
|
|
11
|
+
width: 320,
|
|
12
|
+
height: 200
|
|
13
|
+
}, c = i.createContext(null);
|
|
14
|
+
function l() {
|
|
15
|
+
let e = i.useContext(c);
|
|
13
16
|
if (!e) throw Error("useChart must be used within a <ChartContainer />");
|
|
14
17
|
return e;
|
|
15
18
|
}
|
|
16
|
-
|
|
17
|
-
let
|
|
18
|
-
return /* @__PURE__ */
|
|
19
|
-
value: { config:
|
|
20
|
-
children: /* @__PURE__ */
|
|
21
|
-
"data-
|
|
22
|
-
|
|
23
|
-
className: e("flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-
|
|
24
|
-
...
|
|
25
|
-
children: [/* @__PURE__ */
|
|
26
|
-
id:
|
|
27
|
-
config:
|
|
28
|
-
}), /* @__PURE__ */
|
|
19
|
+
function u({ id: t, className: o, children: l, config: u, initialDimension: f = s, ...p }) {
|
|
20
|
+
let m = i.useId(), h = `chart-${t ?? m.replace(/:/g, "")}`;
|
|
21
|
+
return /* @__PURE__ */ n(c.Provider, {
|
|
22
|
+
value: { config: u },
|
|
23
|
+
children: /* @__PURE__ */ r("div", {
|
|
24
|
+
"data-slot": "chart",
|
|
25
|
+
"data-chart": h,
|
|
26
|
+
className: e("flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden", o),
|
|
27
|
+
...p,
|
|
28
|
+
children: [/* @__PURE__ */ n(d, {
|
|
29
|
+
id: h,
|
|
30
|
+
config: u
|
|
31
|
+
}), /* @__PURE__ */ n(a.ResponsiveContainer, {
|
|
32
|
+
initialDimension: f,
|
|
33
|
+
children: l
|
|
34
|
+
})]
|
|
29
35
|
})
|
|
30
36
|
});
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
${r
|
|
37
|
-
|
|
38
|
-
let r = n.theme?.[t] || n.color;
|
|
37
|
+
}
|
|
38
|
+
var d = ({ id: e, config: t }) => {
|
|
39
|
+
let r = Object.entries(t).filter(([, e]) => e.theme ?? e.color);
|
|
40
|
+
return r.length ? /* @__PURE__ */ n("style", { dangerouslySetInnerHTML: { __html: Object.entries(o).map(([t, n]) => `
|
|
41
|
+
${n} [data-chart=${e}] {
|
|
42
|
+
${r.map(([e, n]) => {
|
|
43
|
+
let r = n.theme?.[t] ?? n.color;
|
|
39
44
|
return r ? ` --color-${e}: ${r};` : null;
|
|
40
45
|
}).join("\n")}
|
|
41
46
|
}
|
|
42
47
|
`).join("\n") } }) : null;
|
|
43
|
-
},
|
|
44
|
-
|
|
48
|
+
}, f = a.Tooltip;
|
|
49
|
+
function p({ active: a, payload: o, className: s, indicator: c = "dot", hideLabel: u = !1, hideIndicator: d = !1, label: f, labelFormatter: p, labelClassName: m, formatter: h, color: _, nameKey: v, labelKey: y }) {
|
|
50
|
+
let { config: b } = l(), x = i.useMemo(() => {
|
|
45
51
|
if (u || !o?.length) return null;
|
|
46
|
-
let [t] = o,
|
|
47
|
-
return p ? /* @__PURE__ */
|
|
52
|
+
let [t] = o, r = g(b, t, `${y ?? t?.dataKey ?? t?.name ?? "value"}`), i = !y && typeof f == "string" ? b[f]?.label ?? f : r?.label;
|
|
53
|
+
return p ? /* @__PURE__ */ n("div", {
|
|
48
54
|
className: e("font-medium", m),
|
|
49
55
|
children: p(i, o)
|
|
50
|
-
}) : i ? /* @__PURE__ */
|
|
56
|
+
}) : i ? /* @__PURE__ */ n("div", {
|
|
51
57
|
className: e("font-medium", m),
|
|
52
58
|
children: i
|
|
53
59
|
}) : null;
|
|
@@ -57,72 +63,69 @@ ${n.map(([e, n]) => {
|
|
|
57
63
|
o,
|
|
58
64
|
u,
|
|
59
65
|
m,
|
|
60
|
-
|
|
66
|
+
b,
|
|
61
67
|
y
|
|
62
68
|
]);
|
|
63
69
|
if (!a || !o?.length) return null;
|
|
64
|
-
let
|
|
65
|
-
return /* @__PURE__ */
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
children: [C ? null : S, /* @__PURE__ */ r("div", {
|
|
70
|
+
let S = o.length === 1 && c !== "dot";
|
|
71
|
+
return /* @__PURE__ */ r("div", {
|
|
72
|
+
className: e("grid min-w-32 items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl", s),
|
|
73
|
+
children: [S ? null : x, /* @__PURE__ */ n("div", {
|
|
69
74
|
className: "grid gap-1.5",
|
|
70
|
-
children: o.filter((e) => e.type !== "none").map((
|
|
71
|
-
let o =
|
|
72
|
-
return /* @__PURE__ */
|
|
73
|
-
className: e("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground",
|
|
74
|
-
children:
|
|
75
|
-
className: e("shrink-0 rounded-[2px] border-
|
|
76
|
-
"h-2.5 w-2.5":
|
|
77
|
-
"w-1":
|
|
78
|
-
"w-0 border-[1.5px] border-dashed bg-transparent":
|
|
79
|
-
"my-0.5":
|
|
75
|
+
children: o.filter((e) => e.type !== "none").map((i, a) => {
|
|
76
|
+
let o = g(b, i, `${v ?? i.name ?? i.dataKey ?? "value"}`), s = _ ?? i.payload?.fill ?? i.color;
|
|
77
|
+
return /* @__PURE__ */ n("div", {
|
|
78
|
+
className: e("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground", c === "dot" && "items-center"),
|
|
79
|
+
children: h && i?.value !== void 0 && i.name ? h(i.value, i.name, i, a, i.payload) : /* @__PURE__ */ r(t, { children: [o?.icon ? /* @__PURE__ */ n(o.icon, {}) : !d && /* @__PURE__ */ n("div", {
|
|
80
|
+
className: e("shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)", {
|
|
81
|
+
"h-2.5 w-2.5": c === "dot",
|
|
82
|
+
"w-1": c === "line",
|
|
83
|
+
"w-0 border-[1.5px] border-dashed bg-transparent": c === "dashed",
|
|
84
|
+
"my-0.5": S && c === "dashed"
|
|
80
85
|
}),
|
|
81
86
|
style: {
|
|
82
87
|
"--color-bg": s,
|
|
83
88
|
"--color-border": s
|
|
84
89
|
}
|
|
85
|
-
}), /* @__PURE__ */
|
|
86
|
-
className: e("flex flex-1 justify-between leading-none",
|
|
87
|
-
children: [/* @__PURE__ */
|
|
90
|
+
}), /* @__PURE__ */ r("div", {
|
|
91
|
+
className: e("flex flex-1 justify-between leading-none", S ? "items-end" : "items-center"),
|
|
92
|
+
children: [/* @__PURE__ */ r("div", {
|
|
88
93
|
className: "grid gap-1.5",
|
|
89
|
-
children: [
|
|
94
|
+
children: [S ? x : null, /* @__PURE__ */ n("span", {
|
|
90
95
|
className: "text-muted-foreground",
|
|
91
|
-
children: o?.label
|
|
96
|
+
children: o?.label ?? i.name
|
|
92
97
|
})]
|
|
93
|
-
}),
|
|
94
|
-
className: "font-mono font-medium tabular-nums
|
|
95
|
-
children:
|
|
98
|
+
}), i.value != null && /* @__PURE__ */ n("span", {
|
|
99
|
+
className: "font-mono font-medium text-foreground tabular-nums",
|
|
100
|
+
children: typeof i.value == "number" ? i.value.toLocaleString() : String(i.value)
|
|
96
101
|
})]
|
|
97
102
|
})] })
|
|
98
|
-
},
|
|
103
|
+
}, a);
|
|
99
104
|
})
|
|
100
105
|
})]
|
|
101
106
|
});
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
let { config:
|
|
106
|
-
return a?.length ? /* @__PURE__ */
|
|
107
|
-
ref: l,
|
|
107
|
+
}
|
|
108
|
+
var m = a.Legend;
|
|
109
|
+
function h({ className: t, hideIcon: i = !1, payload: a, verticalAlign: o = "bottom", nameKey: s }) {
|
|
110
|
+
let { config: c } = l();
|
|
111
|
+
return a?.length ? /* @__PURE__ */ n("div", {
|
|
108
112
|
className: e("flex items-center justify-center gap-4", o === "top" ? "pb-3" : "pt-3", t),
|
|
109
|
-
children: a.filter((e) => e.type !== "none").map((t) => {
|
|
110
|
-
let
|
|
111
|
-
return /* @__PURE__ */
|
|
113
|
+
children: a.filter((e) => e.type !== "none").map((t, a) => {
|
|
114
|
+
let o = g(c, t, `${s ?? t.dataKey ?? "value"}`);
|
|
115
|
+
return /* @__PURE__ */ r("div", {
|
|
112
116
|
className: e("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"),
|
|
113
|
-
children: [
|
|
117
|
+
children: [o?.icon && !i ? /* @__PURE__ */ n(o.icon, {}) : /* @__PURE__ */ n("div", {
|
|
114
118
|
className: "h-2 w-2 shrink-0 rounded-[2px]",
|
|
115
119
|
style: { backgroundColor: t.color }
|
|
116
|
-
}),
|
|
117
|
-
},
|
|
120
|
+
}), o?.label]
|
|
121
|
+
}, a);
|
|
118
122
|
})
|
|
119
123
|
}) : null;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
function h(e, t, n) {
|
|
124
|
+
}
|
|
125
|
+
function g(e, t, n) {
|
|
123
126
|
if (typeof t != "object" || !t) return;
|
|
124
127
|
let r = "payload" in t && typeof t.payload == "object" && t.payload !== null ? t.payload : void 0, i = n;
|
|
125
128
|
return n in t && typeof t[n] == "string" ? i = t[n] : r && n in r && typeof r[n] == "string" && (i = r[n]), i in e ? e[i] : e[n];
|
|
126
129
|
}
|
|
127
130
|
//#endregion
|
|
128
|
-
export {
|
|
131
|
+
export { u as ChartContainer, m as ChartLegend, h as ChartLegendContent, d as ChartStyle, f as ChartTooltip, p as ChartTooltipContent };
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn as e } from "../../lib/utils.js";
|
|
3
|
-
import "react";
|
|
4
3
|
import { CheckIcon as t } from "lucide-react";
|
|
5
4
|
import { jsx as n } from "react/jsx-runtime";
|
|
6
|
-
import { Checkbox as r } from "
|
|
5
|
+
import { Checkbox as r } from "@base-ui/react/checkbox";
|
|
7
6
|
//#region src/components/ui/checkbox.tsx
|
|
8
7
|
function i({ className: i, ...a }) {
|
|
9
8
|
return /* @__PURE__ */ n(r.Root, {
|
|
10
9
|
"data-slot": "checkbox",
|
|
11
|
-
className: e("peer size-4 shrink-0 rounded-[4px] border border-input
|
|
10
|
+
className: e("peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-colors outline-none group-has-disabled/field:opacity-50 group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:not-data-checked:border-input after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary cursor-pointer dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary cursor-pointer data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary cursor-pointer dark:data-checked:bg-primary", i),
|
|
12
11
|
...a,
|
|
13
12
|
children: /* @__PURE__ */ n(r.Indicator, {
|
|
14
13
|
"data-slot": "checkbox-indicator",
|
|
15
|
-
className: "grid place-content-center text-current transition-none",
|
|
16
|
-
children: /* @__PURE__ */ n(t, {
|
|
14
|
+
className: "grid place-content-center text-current transition-none [&>svg]:size-3.5",
|
|
15
|
+
children: /* @__PURE__ */ n(t, {})
|
|
17
16
|
})
|
|
18
17
|
});
|
|
19
18
|
}
|
|
@@ -1,26 +1,24 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import * as n from "@radix-ui/react-collapsible";
|
|
2
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import { Collapsible as t } from "@base-ui/react/collapsible";
|
|
5
4
|
//#region src/components/ui/collapsible.tsx
|
|
6
|
-
function
|
|
7
|
-
return /* @__PURE__ */ t
|
|
5
|
+
function n({ ...n }) {
|
|
6
|
+
return /* @__PURE__ */ e(t.Root, {
|
|
8
7
|
"data-slot": "collapsible",
|
|
9
|
-
...
|
|
8
|
+
...n
|
|
10
9
|
});
|
|
11
10
|
}
|
|
12
|
-
function
|
|
13
|
-
return /* @__PURE__ */ t
|
|
11
|
+
function r({ ...n }) {
|
|
12
|
+
return /* @__PURE__ */ e(t.Trigger, {
|
|
14
13
|
"data-slot": "collapsible-trigger",
|
|
15
|
-
|
|
16
|
-
...i
|
|
14
|
+
...n
|
|
17
15
|
});
|
|
18
16
|
}
|
|
19
|
-
function
|
|
20
|
-
return /* @__PURE__ */ t
|
|
17
|
+
function i({ ...n }) {
|
|
18
|
+
return /* @__PURE__ */ e(t.Panel, {
|
|
21
19
|
"data-slot": "collapsible-content",
|
|
22
|
-
...
|
|
20
|
+
...n
|
|
23
21
|
});
|
|
24
22
|
}
|
|
25
23
|
//#endregion
|
|
26
|
-
export {
|
|
24
|
+
export { n as Collapsible, i as CollapsibleContent, r as CollapsibleTrigger };
|