@cognite/aura 0.3.1 → 0.3.3
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/DESIGN.md +1651 -7
- package/README.md +45 -3
- package/dist/components/index.d.ts +4 -2
- package/dist/components/index.js +58 -325
- package/dist/components/ui/core/accordion/accordion.js +79 -114
- package/dist/components/ui/core/action-toolbar/action-toolbar.js +108 -176
- package/dist/components/ui/core/alert/alert.js +158 -206
- package/dist/components/ui/core/avatar/avatar.js +64 -90
- package/dist/components/ui/core/badge/badge.js +73 -108
- package/dist/components/ui/core/banner/banner.js +146 -215
- package/dist/components/ui/core/breadcrumb/breadcrumb.js +105 -200
- package/dist/components/ui/core/button/button.js +47 -52
- package/dist/components/ui/core/button-group/button-group.js +40 -79
- package/dist/components/ui/core/card/card.js +102 -185
- package/dist/components/ui/core/chart/chart.js +116 -206
- package/dist/components/ui/core/chart/index.js +2 -8
- package/dist/components/ui/core/checkbox/checkbox.js +67 -132
- package/dist/components/ui/core/checkbox/checkbox.metadata.js +7 -7
- package/dist/components/ui/core/code-block/code-block.d.ts +1 -1
- package/dist/components/ui/core/code-block/code-block.js +179 -267
- package/dist/components/ui/core/collapsible/collapsible.js +29 -49
- package/dist/components/ui/core/combobox/combobox.js +41 -0
- package/dist/components/ui/core/command/command.js +85 -150
- package/dist/components/ui/core/count/count.js +21 -32
- package/dist/components/ui/core/date-time-pickers/date-picker/date-picker.js +60 -83
- package/dist/components/ui/core/date-time-pickers/date-picker/types.d.ts +1 -2
- package/dist/components/ui/core/date-time-pickers/date-picker/use-date-picker.js +36 -62
- package/dist/components/ui/core/date-time-pickers/date-range-picker/date-range-picker.js +63 -98
- package/dist/components/ui/core/date-time-pickers/date-range-picker/types.d.ts +1 -2
- package/dist/components/ui/core/date-time-pickers/date-range-picker/use-date-range-picker.js +60 -81
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/date-time-range-picker.js +118 -189
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/types.d.ts +1 -2
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/use-date-time-range-picker.js +104 -158
- package/dist/components/ui/core/date-time-pickers/index.d.ts +2 -0
- package/dist/components/ui/core/date-time-pickers/index.js +5 -8
- package/dist/components/ui/core/date-time-pickers/shared/am-pm-scroll/am-pm-scroll.js +42 -56
- package/dist/components/ui/core/date-time-pickers/shared/calendar/calendar.js +66 -117
- package/dist/components/ui/core/date-time-pickers/shared/calendar-header/calendar-header.js +63 -93
- package/dist/components/ui/core/date-time-pickers/shared/date-time-input/date-time-input.d.ts +1 -1
- package/dist/components/ui/core/date-time-pickers/shared/date-time-input/date-time-input.js +64 -98
- package/dist/components/ui/core/date-time-pickers/shared/date-time-input/range-input-display.js +38 -67
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-popover-state.d.ts +0 -2
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-popover-state.js +23 -39
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-date-state.js +52 -62
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-step-manager.js +18 -18
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-single-date-state.js +24 -31
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-time-state.js +24 -33
- package/dist/components/ui/core/date-time-pickers/shared/scroll-cell-classes.js +4 -7
- package/dist/components/ui/core/date-time-pickers/shared/shortcuts-panel/shortcuts-panel.js +17 -31
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/index.d.ts +2 -0
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/time-picker-panel.d.ts +19 -0
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/time-picker-panel.js +41 -0
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-scroll/time-picker-scroll.js +33 -50
- package/dist/components/ui/core/date-time-pickers/time-picker/index.d.ts +3 -0
- package/dist/components/ui/core/date-time-pickers/time-picker/time-picker.d.ts +16 -0
- package/dist/components/ui/core/date-time-pickers/time-picker/time-picker.js +79 -0
- package/dist/components/ui/core/date-time-pickers/time-picker/types.d.ts +23 -0
- package/dist/components/ui/core/date-time-pickers/time-picker/use-time-picker.d.ts +3 -0
- package/dist/components/ui/core/date-time-pickers/time-picker/use-time-picker.js +42 -0
- package/dist/components/ui/core/date-time-pickers/utils/calendar-utils.js +39 -52
- package/dist/components/ui/core/date-time-pickers/utils/time-utils.js +7 -15
- package/dist/components/ui/core/dialog/dialog.js +82 -155
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.d.ts +19 -17
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.js +150 -250
- package/dist/components/ui/core/empty-state/empty-state.context.js +5 -8
- package/dist/components/ui/core/empty-state/empty-state.js +86 -138
- package/dist/components/ui/core/helper-text/helper-text.js +37 -65
- package/dist/components/ui/core/hover-card/hover-card.js +54 -80
- package/dist/components/ui/core/inline-citation/inline-citation.js +98 -181
- package/dist/components/ui/core/input/input.js +12 -27
- package/dist/components/ui/core/input-group/input-group.js +76 -173
- package/dist/components/ui/core/kbd/kbd.js +20 -36
- package/dist/components/ui/core/label/label.js +26 -43
- package/dist/components/ui/core/loader/loader.js +80 -117
- package/dist/components/ui/core/message/message-response-default-streamdown-controls.js +12 -12
- package/dist/components/ui/core/message/message.d.ts +2 -2
- package/dist/components/ui/core/message/message.js +316 -542
- package/dist/components/ui/core/pagination/pagination-size-context.js +5 -6
- package/dist/components/ui/core/pagination/pagination-teleport.js +86 -106
- package/dist/components/ui/core/pagination/pagination-teleport.utils.js +6 -6
- package/dist/components/ui/core/pagination/pagination.js +231 -334
- package/dist/components/ui/core/popover/popover.js +90 -157
- package/dist/components/ui/core/progress/progress.js +36 -61
- package/dist/components/ui/core/prompt-input/prompt-input.js +274 -413
- package/dist/components/ui/core/radio-group/radio-group.js +58 -113
- package/dist/components/ui/core/reasoning/reasoning.js +55 -86
- package/dist/components/ui/core/scroll-area/scroll-area.js +41 -71
- package/dist/components/ui/core/search/search.js +77 -99
- package/dist/components/ui/core/segmented-control/segmented-control.js +110 -167
- package/dist/components/ui/core/select/select.js +168 -293
- package/dist/components/ui/core/separator/separator.js +13 -23
- package/dist/components/ui/core/shimmer/shimmer.d.ts +2 -4
- package/dist/components/ui/core/shimmer/shimmer.js +40 -107
- package/dist/components/ui/core/skeleton/skeleton.js +13 -18
- package/dist/components/ui/core/sonner-toast/sonner-toast.js +54 -47
- package/dist/components/ui/core/sources/sources.d.ts +5 -1
- package/dist/components/ui/core/sources/sources.js +58 -79
- package/dist/components/ui/core/switch/switch.js +62 -0
- package/dist/components/ui/core/tabs/tabs.js +149 -223
- package/dist/components/ui/core/tabs/tabs.utils.js +6 -8
- package/dist/components/ui/core/textarea/textarea.js +13 -27
- package/dist/components/ui/core/toggle/toggle.js +55 -74
- package/dist/components/ui/core/tool/tool.js +127 -163
- package/dist/components/ui/core/tooltip/tooltip.js +47 -86
- package/dist/components/ui/core/topbar/topbar.js +106 -190
- package/dist/eslint/index.js +5 -10
- package/dist/eslint/no-overriding-styles.js +178 -237
- package/dist/icons/index.d.ts +1 -0
- package/dist/icons/index.js +1 -0
- package/dist/lib/highlight-code.d.ts +9 -0
- package/dist/lib/highlight-code.js +42 -0
- package/dist/lib/portal-container-context.js +8 -9
- package/dist/lib/style-scope.js +6 -6
- package/dist/lib/use-controllable-state.js +21 -30
- package/dist/lib/utils.d.ts +0 -2
- package/dist/lib/utils.js +32 -112
- package/dist/styles.css +1 -1
- package/dist/styles.source.css +23 -0
- package/package.json +23 -7
- package/dist/components/ui/core/date-time-pickers/shared/constants.js +0 -14
|
@@ -1,108 +1,41 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { memo as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
};
|
|
16
|
-
function
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
1
|
+
import { cn as e } from "../../../../lib/utils.js";
|
|
2
|
+
import { memo as t, useMemo as n } from "react";
|
|
3
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
4
|
+
import { motion as i } from "framer-motion";
|
|
5
|
+
//#region libs/aura/src/components/ui/core/shimmer/shimmer.tsx
|
|
6
|
+
var a = {
|
|
7
|
+
nordic: "var(--gradient-nordic)",
|
|
8
|
+
aurora: "var(--gradient-aurora)",
|
|
9
|
+
dusk: "var(--gradient-dusk)",
|
|
10
|
+
equinox: "var(--gradient-equinox)",
|
|
11
|
+
summer: "var(--gradient-summer)",
|
|
12
|
+
spring: "var(--gradient-spring)",
|
|
13
|
+
fall: "var(--gradient-fall)",
|
|
14
|
+
active: "var(--gradient-active)"
|
|
15
|
+
}, o = { backgroundPosition: ["100% center, center", "0% center, center"] }, s = { backgroundPosition: ["0% center, 0% center", "-200% center, -200% center"] };
|
|
16
|
+
function c({ children: t, as: c = "p", className: l, duration: u = 2, spread: d = 2, variant: f = "default" }) {
|
|
17
|
+
let p = n(() => (t?.length ?? 0) * d, [t, d]), m = n(() => {
|
|
18
|
+
let e = "linear-gradient(90deg, transparent calc(50% - var(--spread)), rgba(255, 255, 255, 0.4), transparent calc(50% + var(--spread)))";
|
|
19
|
+
return f === "default" ? `${e}, linear-gradient(var(--color-muted-foreground), var(--color-muted-foreground))` : `${e}, ${a[f]}`;
|
|
20
|
+
}, [f]), h = {
|
|
21
|
+
"--spread": `${p}px`,
|
|
22
|
+
backgroundImage: m,
|
|
23
|
+
backgroundSize: f === "active" ? "200% 100%, 200% 100%" : "250% 100%, 100% 100%"
|
|
24
|
+
}, g = {
|
|
25
|
+
repeat: Infinity,
|
|
26
|
+
duration: u,
|
|
27
|
+
ease: "linear"
|
|
28
|
+
}, _ = i[c];
|
|
29
|
+
return /* @__PURE__ */ r(_, {
|
|
30
|
+
"data-slot": "shimmer",
|
|
31
|
+
className: e("relative inline-block bg-clip-text text-transparent rounded-md", l),
|
|
32
|
+
animate: f === "active" ? s : o,
|
|
33
|
+
style: h,
|
|
34
|
+
transition: g,
|
|
35
|
+
children: t
|
|
36
|
+
});
|
|
29
37
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
className: l,
|
|
35
|
-
duration: g = 2,
|
|
36
|
-
spread: d = 2,
|
|
37
|
-
variant: n = "default"
|
|
38
|
-
}) {
|
|
39
|
-
const k = p(
|
|
40
|
-
() => (e?.length ?? 0) * d,
|
|
41
|
-
[e, d]
|
|
42
|
-
), f = p(() => {
|
|
43
|
-
const t = "linear-gradient(90deg, transparent calc(50% - var(--spread)), rgba(255, 255, 255, 0.4), transparent calc(50% + var(--spread)))";
|
|
44
|
-
return n === "default" ? `${t}, linear-gradient(var(--color-muted-foreground), var(--color-muted-foreground))` : `${t}, ${v[n]}`;
|
|
45
|
-
}, [n]), i = {
|
|
46
|
-
"--spread": `${k}px`,
|
|
47
|
-
backgroundImage: f,
|
|
48
|
-
backgroundSize: "250% 100%, 100% 100%"
|
|
49
|
-
}, o = {
|
|
50
|
-
repeat: Number.POSITIVE_INFINITY,
|
|
51
|
-
duration: g,
|
|
52
|
-
ease: "linear"
|
|
53
|
-
};
|
|
54
|
-
if (!a) {
|
|
55
|
-
const t = m[r];
|
|
56
|
-
return /* @__PURE__ */ s(
|
|
57
|
-
t,
|
|
58
|
-
{
|
|
59
|
-
"data-slot": "shimmer",
|
|
60
|
-
className: u(
|
|
61
|
-
"relative inline-block bg-clip-text text-transparent rounded-md",
|
|
62
|
-
l
|
|
63
|
-
),
|
|
64
|
-
animate: c,
|
|
65
|
-
style: i,
|
|
66
|
-
transition: o,
|
|
67
|
-
children: e
|
|
68
|
-
}
|
|
69
|
-
);
|
|
70
|
-
}
|
|
71
|
-
return /* @__PURE__ */ b(
|
|
72
|
-
r,
|
|
73
|
-
{
|
|
74
|
-
"data-slot": "shimmer",
|
|
75
|
-
className: u(
|
|
76
|
-
"relative rounded-md inline-flex items-center gap-1.5",
|
|
77
|
-
l
|
|
78
|
-
),
|
|
79
|
-
children: [
|
|
80
|
-
/* @__PURE__ */ s(
|
|
81
|
-
m.span,
|
|
82
|
-
{
|
|
83
|
-
"aria-hidden": !0,
|
|
84
|
-
className: "inline-block size-[1em] shrink-0",
|
|
85
|
-
animate: c,
|
|
86
|
-
style: x(a, i),
|
|
87
|
-
transition: o
|
|
88
|
-
}
|
|
89
|
-
),
|
|
90
|
-
/* @__PURE__ */ s(
|
|
91
|
-
m.span,
|
|
92
|
-
{
|
|
93
|
-
className: "inline-block bg-clip-text text-transparent",
|
|
94
|
-
animate: c,
|
|
95
|
-
style: i,
|
|
96
|
-
transition: o,
|
|
97
|
-
children: e
|
|
98
|
-
}
|
|
99
|
-
)
|
|
100
|
-
]
|
|
101
|
-
}
|
|
102
|
-
);
|
|
103
|
-
}
|
|
104
|
-
const I = h(S);
|
|
105
|
-
I.displayName = "Shimmer";
|
|
106
|
-
export {
|
|
107
|
-
I as Shimmer
|
|
108
|
-
};
|
|
38
|
+
var l = t(c);
|
|
39
|
+
l.displayName = "Shimmer";
|
|
40
|
+
//#endregion
|
|
41
|
+
export { l as Shimmer };
|
|
@@ -1,18 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
);
|
|
15
|
-
n.displayName = "Skeleton";
|
|
16
|
-
export {
|
|
17
|
-
n as Skeleton
|
|
18
|
-
};
|
|
1
|
+
import { cn as e } from "../../../../lib/utils.js";
|
|
2
|
+
import { forwardRef as t } from "react";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
//#region libs/aura/src/components/ui/core/skeleton/skeleton.tsx
|
|
5
|
+
var r = t(({ className: t, ...r }, i) => /* @__PURE__ */ n("div", {
|
|
6
|
+
ref: i,
|
|
7
|
+
"data-slot": "skeleton",
|
|
8
|
+
className: e("bg-accent-background animate-pulse rounded-md", t),
|
|
9
|
+
...r
|
|
10
|
+
}));
|
|
11
|
+
r.displayName = "Skeleton";
|
|
12
|
+
//#endregion
|
|
13
|
+
export { r as Skeleton };
|
|
@@ -1,48 +1,55 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { toast as
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
},
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
1
|
+
import { cn as e } from "../../../../lib/utils.js";
|
|
2
|
+
import { IconAlertOctagonFilled as t, IconAlertTriangleFilled as n, IconCircleCheckFilled as r, IconInfoCircleFilled as i, IconLoader2 as a, IconX as o } from "@tabler/icons-react";
|
|
3
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
4
|
+
import { Toaster as c, toast as l } from "sonner";
|
|
5
|
+
//#region libs/aura/src/components/ui/core/sonner-toast/sonner-toast.tsx
|
|
6
|
+
var u = {
|
|
7
|
+
"--normal-bg": "var(--raised-background)",
|
|
8
|
+
"--normal-text": "var(--foreground-fixed-light)",
|
|
9
|
+
"--normal-border": "transparent",
|
|
10
|
+
"--border-radius": "var(--radius-lg)"
|
|
11
|
+
}, d = ({ ...l }) => {
|
|
12
|
+
let d = "flex h-5 min-w-5 items-center justify-center rounded-md px-1";
|
|
13
|
+
return /* @__PURE__ */ s(c, {
|
|
14
|
+
"data-slot": "sonner-toast",
|
|
15
|
+
theme: "system",
|
|
16
|
+
className: "toaster group",
|
|
17
|
+
icons: {
|
|
18
|
+
close: /* @__PURE__ */ s(o, { className: "size-4 text-foreground-fixed-light" }),
|
|
19
|
+
success: /* @__PURE__ */ s("span", {
|
|
20
|
+
className: e(d, "bg-success-background"),
|
|
21
|
+
children: /* @__PURE__ */ s(r, { className: "size-3 text-success-foreground-on-success" })
|
|
22
|
+
}),
|
|
23
|
+
info: /* @__PURE__ */ s("span", {
|
|
24
|
+
className: e(d, "bg-info-background"),
|
|
25
|
+
children: /* @__PURE__ */ s(i, { className: "size-3 text-info-foreground-on-info" })
|
|
26
|
+
}),
|
|
27
|
+
warning: /* @__PURE__ */ s("span", {
|
|
28
|
+
className: e(d, "bg-warning-background"),
|
|
29
|
+
children: /* @__PURE__ */ s(n, { className: "size-3 text-warning-foreground-on-warning" })
|
|
30
|
+
}),
|
|
31
|
+
error: /* @__PURE__ */ s("span", {
|
|
32
|
+
className: e(d, "bg-destructive-background"),
|
|
33
|
+
children: /* @__PURE__ */ s(t, { className: "size-3 text-destructive-foreground-on-critical" })
|
|
34
|
+
}),
|
|
35
|
+
loading: /* @__PURE__ */ s(a, { className: "size-4 animate-spin" })
|
|
36
|
+
},
|
|
37
|
+
style: u,
|
|
38
|
+
toastOptions: {
|
|
39
|
+
unstyled: !0,
|
|
40
|
+
classNames: {
|
|
41
|
+
toast: "flex w-[384px] min-h-11 items-center gap-2 rounded-lg bg-raised-background p-3 shadow-md has-[[data-description]]:[&_[data-icon]]:hidden",
|
|
42
|
+
icon: "order-1 m-0 shrink-0 flex items-start",
|
|
43
|
+
content: "order-2 flex flex-1 basis-0 flex-col items-start gap-0.5",
|
|
44
|
+
title: "w-full self-stretch text-sm font-medium leading-[18px] tracking-normal text-foreground-fixed-light",
|
|
45
|
+
description: "w-full self-stretch text-sm font-normal leading-[18px] tracking-tight text-muted-foreground-fixed-light",
|
|
46
|
+
actionButton: "order-3 ml-auto inline-flex h-7 items-center justify-center gap-1.5 rounded-md bg-transparent px-2 text-sm font-medium leading-[18px] tracking-normal text-foreground-fixed-light transition-all hover:cursor-pointer",
|
|
47
|
+
cancelButton: "order-3 ml-auto inline-flex h-7 items-center justify-center gap-1.5 rounded-md bg-transparent px-2 text-sm font-medium leading-[18px] tracking-normal text-foreground-fixed-light transition-all hover:cursor-pointer",
|
|
48
|
+
closeButton: "order-4 inline-flex size-7 items-center justify-center rounded-md text-foreground-fixed-light transition-all hover:cursor-pointer hover:text-foreground-fixed-light hover:!bg-transparent"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
...l
|
|
52
|
+
});
|
|
48
53
|
};
|
|
54
|
+
//#endregion
|
|
55
|
+
export { d as Toaster, l as toast };
|
|
@@ -2,8 +2,12 @@ import { ComponentProps, ReactNode } from 'react';
|
|
|
2
2
|
import { InlineCitationLink } from '../inline-citation/inline-citation';
|
|
3
3
|
type SourcesProps = Omit<ComponentProps<'div'>, 'title'> & {
|
|
4
4
|
title?: ReactNode | boolean;
|
|
5
|
+
collapsible?: boolean;
|
|
6
|
+
defaultOpen?: boolean;
|
|
7
|
+
open?: boolean;
|
|
8
|
+
onOpenChange?: (open: boolean) => void;
|
|
5
9
|
};
|
|
6
|
-
declare const Sources: ({ className, title, children, ...props }: SourcesProps) => ReactNode;
|
|
10
|
+
declare const Sources: ({ className, title, children, collapsible, defaultOpen, open, onOpenChange, ...props }: SourcesProps) => ReactNode;
|
|
7
11
|
type SourcesTitleProps = ComponentProps<'div'> & {
|
|
8
12
|
title?: string;
|
|
9
13
|
};
|
|
@@ -1,80 +1,59 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
className: d,
|
|
58
|
-
children: u,
|
|
59
|
-
...m
|
|
60
|
-
}) => {
|
|
61
|
-
const a = r || e;
|
|
62
|
-
return a ? /* @__PURE__ */ s(p, { children: /* @__PURE__ */ s(
|
|
63
|
-
x,
|
|
64
|
-
{
|
|
65
|
-
"data-slot": "source",
|
|
66
|
-
href: a,
|
|
67
|
-
target: n,
|
|
68
|
-
variant: o,
|
|
69
|
-
icon: i,
|
|
70
|
-
className: d,
|
|
71
|
-
...m,
|
|
72
|
-
children: u ?? t
|
|
73
|
-
}
|
|
74
|
-
) }) : null;
|
|
75
|
-
};
|
|
76
|
-
export {
|
|
77
|
-
I as Source,
|
|
78
|
-
S as Sources,
|
|
79
|
-
h as SourcesTitle
|
|
1
|
+
import { cn as e } from "../../../../lib/utils.js";
|
|
2
|
+
import { InlineCitation as t, InlineCitationLink as n } from "../inline-citation/inline-citation.js";
|
|
3
|
+
import { IconChevronDown as r, IconMist as i } from "@tabler/icons-react";
|
|
4
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
5
|
+
import { Collapsible as s } from "@base-ui/react/collapsible";
|
|
6
|
+
//#region libs/aura/src/components/ui/core/sources/sources.tsx
|
|
7
|
+
var c = ({ className: t, title: n, children: i, collapsible: c = !1, defaultOpen: u = !1, open: d, onOpenChange: f, ...p }) => {
|
|
8
|
+
let m = n === !1 || n === "false", h = n === void 0 || n === !0 ? /* @__PURE__ */ a(l, {}) : n;
|
|
9
|
+
return c ? /* @__PURE__ */ a(s.Root, {
|
|
10
|
+
open: d,
|
|
11
|
+
defaultOpen: u,
|
|
12
|
+
onOpenChange: f,
|
|
13
|
+
children: /* @__PURE__ */ o("div", {
|
|
14
|
+
"data-slot": "sources",
|
|
15
|
+
className: e("flex flex-col gap-2 py-2", t),
|
|
16
|
+
...p,
|
|
17
|
+
children: [m ? null : /* @__PURE__ */ o(s.Trigger, {
|
|
18
|
+
"data-slot": "sources-trigger",
|
|
19
|
+
className: "group/sources-trigger flex w-fit items-center gap-2 outline-none",
|
|
20
|
+
children: [h, /* @__PURE__ */ a(r, { className: "size-4 shrink-0 text-muted-foreground transition-transform duration-200 group-data-panel-open/sources-trigger:rotate-180" })]
|
|
21
|
+
}), /* @__PURE__ */ a(s.Panel, {
|
|
22
|
+
"data-slot": "sources-items",
|
|
23
|
+
className: "h-(--collapsible-panel-height) overflow-hidden transition-all duration-200 ease-out data-ending-style:h-0 data-starting-style:h-0",
|
|
24
|
+
children: /* @__PURE__ */ a("div", {
|
|
25
|
+
className: "flex flex-wrap gap-2 pt-2 [&>*]:min-w-0",
|
|
26
|
+
children: i
|
|
27
|
+
})
|
|
28
|
+
})]
|
|
29
|
+
})
|
|
30
|
+
}) : /* @__PURE__ */ o("div", {
|
|
31
|
+
"data-slot": "sources",
|
|
32
|
+
className: e("flex flex-col gap-2 py-2", t),
|
|
33
|
+
...p,
|
|
34
|
+
children: [m ? null : h, /* @__PURE__ */ a("div", {
|
|
35
|
+
"data-slot": "sources-items",
|
|
36
|
+
className: "flex flex-wrap gap-2 [&>*]:min-w-0",
|
|
37
|
+
children: i
|
|
38
|
+
})]
|
|
39
|
+
});
|
|
40
|
+
}, l = ({ className: t, title: n = "Sources", children: r, ...s }) => /* @__PURE__ */ o("div", {
|
|
41
|
+
"data-slot": "sources-title",
|
|
42
|
+
className: e("flex items-center gap-2 text-base leading-5 tracking-tighter text-muted-foreground", t),
|
|
43
|
+
...s,
|
|
44
|
+
children: [/* @__PURE__ */ a(i, { className: "size-4 shrink-0" }), r ?? /* @__PURE__ */ a("span", { children: n })]
|
|
45
|
+
}), u = ({ href: e, url: r, title: i, variant: o = "mountain", target: s = "_blank", icon: c, className: l, children: u, ...d }) => {
|
|
46
|
+
let f = e || r;
|
|
47
|
+
return f ? /* @__PURE__ */ a(t, { children: /* @__PURE__ */ a(n, {
|
|
48
|
+
"data-slot": "source",
|
|
49
|
+
href: f,
|
|
50
|
+
target: s,
|
|
51
|
+
variant: o,
|
|
52
|
+
icon: c,
|
|
53
|
+
className: l,
|
|
54
|
+
...d,
|
|
55
|
+
children: u ?? i
|
|
56
|
+
}) }) : null;
|
|
80
57
|
};
|
|
58
|
+
//#endregion
|
|
59
|
+
export { u as Source, c as Sources, l as SourcesTitle };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { cn as e } from "../../../../lib/utils.js";
|
|
2
|
+
import { Label as t } from "../label/label.js";
|
|
3
|
+
import { forwardRef as n, useId as r } from "react";
|
|
4
|
+
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
5
|
+
import { Switch as s } from "@base-ui/react/switch";
|
|
6
|
+
//#region libs/aura/src/components/ui/core/switch/switch.tsx
|
|
7
|
+
var c = n(({ className: n, disabled: c, id: l, "aria-label": u, "aria-labelledby": d, label: f, textLeft: p, textRight: m, checkedText: h = "On", uncheckedText: g = "Off", ..._ }, v) => {
|
|
8
|
+
let y = r(), b = !!p, x = !!m, S = b || x, C = b && x, w = l ?? (f || S ? y : void 0), T = /* @__PURE__ */ a(s.Root, {
|
|
9
|
+
ref: v,
|
|
10
|
+
"data-slot": "switch",
|
|
11
|
+
id: w,
|
|
12
|
+
disabled: c,
|
|
13
|
+
"aria-label": u,
|
|
14
|
+
"aria-labelledby": d,
|
|
15
|
+
className: e("peer inline-flex h-5 w-10 shrink-0 cursor-pointer items-center rounded-md p-0.5 transition-colors outline-none", "bg-secondary-background hover:bg-secondary-background-hover", "data-checked:bg-active-background data-checked:hover:bg-active-background-hover", "disabled:bg-disabled-background disabled:cursor-not-allowed", "focus-visible:ring-ring focus-visible:ring-2", n),
|
|
16
|
+
..._,
|
|
17
|
+
children: /* @__PURE__ */ a(s.Thumb, {
|
|
18
|
+
"data-slot": "switch-thumb",
|
|
19
|
+
className: e("pointer-events-none block size-4 rounded-sm ring-0 transition-transform bg-background shadow-none", "translate-x-0 data-checked:translate-x-5", "data-disabled:bg-secondary-background data-disabled:shadow-none", "data-checked:shadow-sm")
|
|
20
|
+
})
|
|
21
|
+
});
|
|
22
|
+
return !f && !S ? T : /* @__PURE__ */ o("div", {
|
|
23
|
+
className: "inline-flex items-center gap-3",
|
|
24
|
+
children: [f ? /* @__PURE__ */ a(t, {
|
|
25
|
+
htmlFor: w,
|
|
26
|
+
className: "pb-0",
|
|
27
|
+
children: f
|
|
28
|
+
}) : null, /* @__PURE__ */ o("div", {
|
|
29
|
+
className: "inline-flex items-center gap-1",
|
|
30
|
+
children: [
|
|
31
|
+
T,
|
|
32
|
+
b ? /* @__PURE__ */ a("label", {
|
|
33
|
+
htmlFor: w,
|
|
34
|
+
"aria-hidden": "true",
|
|
35
|
+
className: e("order-first text-sm leading-4.5 tracking-tight cursor-pointer", "peer-disabled:text-disabled-foreground peer-disabled:cursor-not-allowed", C ? "text-foreground font-medium peer-data-checked:text-inactive-foreground peer-data-checked:font-normal" : "text-inactive-foreground"),
|
|
36
|
+
children: C ? g : /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a("span", {
|
|
37
|
+
className: "hidden peer-data-checked:inline",
|
|
38
|
+
children: h
|
|
39
|
+
}), /* @__PURE__ */ a("span", {
|
|
40
|
+
className: "inline peer-data-checked:hidden",
|
|
41
|
+
children: g
|
|
42
|
+
})] })
|
|
43
|
+
}) : null,
|
|
44
|
+
x ? /* @__PURE__ */ a("label", {
|
|
45
|
+
htmlFor: w,
|
|
46
|
+
"aria-hidden": "true",
|
|
47
|
+
className: e("text-sm leading-4.5 tracking-tight cursor-pointer", "peer-disabled:text-disabled-foreground peer-disabled:cursor-not-allowed", C ? "text-inactive-foreground peer-data-checked:text-foreground peer-data-checked:font-medium" : "text-inactive-foreground"),
|
|
48
|
+
children: C ? h : /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a("span", {
|
|
49
|
+
className: "hidden peer-data-checked:inline",
|
|
50
|
+
children: h
|
|
51
|
+
}), /* @__PURE__ */ a("span", {
|
|
52
|
+
className: "inline peer-data-checked:hidden",
|
|
53
|
+
children: g
|
|
54
|
+
})] })
|
|
55
|
+
}) : null
|
|
56
|
+
]
|
|
57
|
+
})]
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
c.displayName = "Switch";
|
|
61
|
+
//#endregion
|
|
62
|
+
export { c as Switch };
|