@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,73 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
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
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
props: p(
|
|
75
|
-
{
|
|
76
|
-
className: x(
|
|
77
|
-
k({
|
|
78
|
-
variant: r,
|
|
79
|
-
size: a,
|
|
80
|
-
outline: e,
|
|
81
|
-
background: e ? !1 : i,
|
|
82
|
-
dot: o
|
|
83
|
-
}),
|
|
84
|
-
e && r === "error" && "text-destructive-foreground",
|
|
85
|
-
e && r === "warning" && "text-warning-foreground",
|
|
86
|
-
e && r === "success" && "text-success-foreground",
|
|
87
|
-
e && r === "inProgress" && "text-info-foreground",
|
|
88
|
-
e && r === "archived" && "text-neutral-foreground",
|
|
89
|
-
o && b && "h-2 w-2 min-h-2 min-w-2 max-h-2 max-w-2 rounded-full p-0 border-0",
|
|
90
|
-
o && s && "bg-destructive-background text-destructive-foreground-on-critical",
|
|
91
|
-
t
|
|
92
|
-
)
|
|
93
|
-
},
|
|
94
|
-
{ ...g, children: n }
|
|
95
|
-
),
|
|
96
|
-
render: u,
|
|
97
|
-
state: {
|
|
98
|
-
slot: "badge",
|
|
99
|
-
variant: r
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
);
|
|
104
|
-
w.displayName = "Badge";
|
|
105
|
-
export {
|
|
106
|
-
w as Badge,
|
|
107
|
-
k as badgeVariants
|
|
108
|
-
};
|
|
1
|
+
import { cn as e } from "../../../../lib/utils.js";
|
|
2
|
+
import { forwardRef as t } from "react";
|
|
3
|
+
import { cva as n } from "class-variance-authority";
|
|
4
|
+
import { mergeProps as r } from "@base-ui/react/merge-props";
|
|
5
|
+
import { useRender as i } from "@base-ui/react/use-render";
|
|
6
|
+
//#region libs/aura/src/components/ui/core/badge/badge.tsx
|
|
7
|
+
var a = n("inline-flex h-5 items-center align-middle justify-center rounded-md border px-1 text-sm font-medium leading-[18px] w-fit whitespace-nowrap shrink-0 gap-1 [&>svg]:pointer-events-none [&>svg]:size-3 outline-none focus-visible:border-ring focus-visible:ring-ring-muted focus-visible:ring aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden", {
|
|
8
|
+
variants: {
|
|
9
|
+
variant: {
|
|
10
|
+
default: "border-transparent bg-neutral-background text-foreground-on-neutral",
|
|
11
|
+
fjord: "border-transparent bg-decorative-background-fjord text-decorative-foreground-fjord",
|
|
12
|
+
nordic: "border-transparent bg-decorative-background-nordic text-decorative-foreground-nordic",
|
|
13
|
+
aurora: "border-transparent bg-decorative-background-aurora text-decorative-foreground-aurora",
|
|
14
|
+
sky: "border-transparent bg-decorative-background-sky text-decorative-foreground-sky",
|
|
15
|
+
dusk: "border-transparent bg-decorative-background-dusk text-decorative-foreground-dusk",
|
|
16
|
+
orange: "border-transparent bg-decorative-background-orange text-decorative-foreground-orange",
|
|
17
|
+
gray: "border-transparent bg-decorative-background-mountain text-decorative-foreground-mountain",
|
|
18
|
+
mountain: "border-transparent bg-decorative-background-mountain text-decorative-foreground-mountain",
|
|
19
|
+
secondary: "border-transparent bg-secondary-background text-secondary-foreground",
|
|
20
|
+
error: "border-transparent bg-destructive-background text-destructive-foreground-on-critical",
|
|
21
|
+
warning: "border-transparent bg-warning-background text-warning-foreground-on-warning",
|
|
22
|
+
success: "border-transparent bg-success-background text-success-foreground-on-success",
|
|
23
|
+
inProgress: "border-transparent bg-info-background text-info-foreground-on-info",
|
|
24
|
+
archived: "border-transparent bg-neutral-background text-neutral-foreground-on-neutral",
|
|
25
|
+
closable: "border-transparent bg-secondary-background text-secondary-foreground hover:bg-secondary-background-hover cursor-pointer"
|
|
26
|
+
},
|
|
27
|
+
size: {
|
|
28
|
+
default: "",
|
|
29
|
+
icon: "w-5 px-0 py-0"
|
|
30
|
+
},
|
|
31
|
+
outline: { true: "border-border" },
|
|
32
|
+
background: { false: "bg-transparent" },
|
|
33
|
+
dot: { true: "min-w-5 rounded-md border border-background px-1 gap-0" }
|
|
34
|
+
},
|
|
35
|
+
defaultVariants: {
|
|
36
|
+
variant: "default",
|
|
37
|
+
size: "default",
|
|
38
|
+
outline: !1,
|
|
39
|
+
background: !0,
|
|
40
|
+
dot: !1
|
|
41
|
+
}
|
|
42
|
+
}), o = t(({ className: t, variant: n, size: o, outline: s, dot: c, background: l, urgent: u = !1, children: d, render: f, ...p }, m) => {
|
|
43
|
+
let h = !d, g = n && !(/* @__PURE__ */ new Set([
|
|
44
|
+
"mountain",
|
|
45
|
+
"fjord",
|
|
46
|
+
"nordic",
|
|
47
|
+
"aurora",
|
|
48
|
+
"dusk",
|
|
49
|
+
"orange"
|
|
50
|
+
])).has(n), _ = s === !0 && g;
|
|
51
|
+
return i({
|
|
52
|
+
defaultTagName: "span",
|
|
53
|
+
ref: m,
|
|
54
|
+
props: r({ className: e(a({
|
|
55
|
+
variant: n,
|
|
56
|
+
size: o,
|
|
57
|
+
outline: _,
|
|
58
|
+
background: !_ && l,
|
|
59
|
+
dot: c
|
|
60
|
+
}), _ && n === "error" && "text-destructive-foreground", _ && n === "warning" && "text-warning-foreground", _ && n === "success" && "text-success-foreground", _ && n === "inProgress" && "text-info-foreground", _ && n === "archived" && "text-neutral-foreground", c && h && "h-2 w-2 min-h-2 min-w-2 max-h-2 max-w-2 rounded-full p-0 border-0", c && u && "bg-destructive-background text-destructive-foreground-on-critical", t) }, {
|
|
61
|
+
...p,
|
|
62
|
+
children: d
|
|
63
|
+
}),
|
|
64
|
+
render: f,
|
|
65
|
+
state: {
|
|
66
|
+
slot: "badge",
|
|
67
|
+
variant: n
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
o.displayName = "Badge";
|
|
72
|
+
//#endregion
|
|
73
|
+
export { o as Badge, a as badgeVariants };
|
|
@@ -1,218 +1,149 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
variant: "default"
|
|
1
|
+
import { cn as e } from "../../../../lib/utils.js";
|
|
2
|
+
import { Button as t } from "../button/button.js";
|
|
3
|
+
import { Badge as n } from "../badge/badge.js";
|
|
4
|
+
import { createContext as r, forwardRef as i, useCallback as a, useContext as o, useEffect as s, useMemo as c, useRef as l, useState as u } from "react";
|
|
5
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
6
|
+
import { cva as f } from "class-variance-authority";
|
|
7
|
+
var p = r({
|
|
8
|
+
show: !0,
|
|
9
|
+
setShow: (e) => {},
|
|
10
|
+
variant: "default"
|
|
12
11
|
});
|
|
13
|
-
function
|
|
14
|
-
|
|
12
|
+
function m(e) {
|
|
13
|
+
return typeof e == "function";
|
|
15
14
|
}
|
|
16
|
-
function
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
a((c) => {
|
|
32
|
-
const f = p(o) ? o(c) : o;
|
|
33
|
-
return f || d.current?.(), f;
|
|
34
|
-
});
|
|
35
|
-
},
|
|
36
|
-
[i, e]
|
|
37
|
-
);
|
|
38
|
-
return [g, x];
|
|
15
|
+
function h({ visible: e, defaultVisible: t, onClose: n }) {
|
|
16
|
+
let [r, i] = u(t), o = e !== void 0, c = o ? e : r, d = l(n);
|
|
17
|
+
return s(() => {
|
|
18
|
+
d.current = n;
|
|
19
|
+
}, [n]), [c, a((t) => {
|
|
20
|
+
if (o) {
|
|
21
|
+
(m(t) ? t(e) : t) || d.current?.();
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
i((e) => {
|
|
25
|
+
let n = m(t) ? t(e) : t;
|
|
26
|
+
return n || d.current?.(), n;
|
|
27
|
+
});
|
|
28
|
+
}, [o, e])];
|
|
39
29
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
)
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
)
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
)
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
);
|
|
161
|
-
}
|
|
162
|
-
);
|
|
163
|
-
L.displayName = "BannerStatus";
|
|
164
|
-
const P = l(
|
|
165
|
-
({ className: e, ...t }, n) => /* @__PURE__ */ s(
|
|
166
|
-
"div",
|
|
167
|
-
{
|
|
168
|
-
ref: n,
|
|
169
|
-
"data-slot": "banner-actions",
|
|
170
|
-
className: u("ml-auto flex h-7 shrink-0 items-center gap-2", e),
|
|
171
|
-
...t
|
|
172
|
-
}
|
|
173
|
-
)
|
|
174
|
-
);
|
|
175
|
-
P.displayName = "BannerActions";
|
|
176
|
-
const v = l(
|
|
177
|
-
({ variant: e = "ghost", size: t = "sm", className: n, ...r }, a) => /* @__PURE__ */ s(
|
|
178
|
-
A,
|
|
179
|
-
{
|
|
180
|
-
ref: a,
|
|
181
|
-
"data-slot": "banner-action",
|
|
182
|
-
className: u(
|
|
183
|
-
"h-7 min-w-16 shrink-0 rounded px-2 text-sm font-medium leading-4.5 text-foreground-fixed-dark hover:bg-transparent dark:hover:bg-transparent hover:text-foreground-secondary-fixed-dark disabled:bg-transparent dark:disabled:bg-transparent disabled:text-disabled-foreground",
|
|
184
|
-
n
|
|
185
|
-
),
|
|
186
|
-
size: t,
|
|
187
|
-
variant: e,
|
|
188
|
-
...r
|
|
189
|
-
}
|
|
190
|
-
)
|
|
191
|
-
);
|
|
192
|
-
v.displayName = "BannerAction";
|
|
193
|
-
const T = l(
|
|
194
|
-
({ onClick: e, ...t }, n) => {
|
|
195
|
-
const { setShow: r } = b(m);
|
|
196
|
-
return /* @__PURE__ */ s(
|
|
197
|
-
v,
|
|
198
|
-
{
|
|
199
|
-
ref: n,
|
|
200
|
-
"data-slot": "banner-close",
|
|
201
|
-
onClick: (i) => {
|
|
202
|
-
r(!1), e?.(i);
|
|
203
|
-
},
|
|
204
|
-
...t
|
|
205
|
-
}
|
|
206
|
-
);
|
|
207
|
-
}
|
|
208
|
-
);
|
|
209
|
-
T.displayName = "BannerClose";
|
|
210
|
-
export {
|
|
211
|
-
M as Banner,
|
|
212
|
-
v as BannerAction,
|
|
213
|
-
P as BannerActions,
|
|
214
|
-
T as BannerClose,
|
|
215
|
-
_ as BannerIcon,
|
|
216
|
-
L as BannerStatus,
|
|
217
|
-
E as BannerTitle
|
|
218
|
-
};
|
|
30
|
+
var g = f("flex w-full h-11 flex-col items-start justify-center px-3 py-0", {
|
|
31
|
+
variants: {
|
|
32
|
+
variant: {
|
|
33
|
+
default: "bg-neutral-background text-foreground-fixed-dark",
|
|
34
|
+
info: "bg-info-background text-foreground-fixed-dark",
|
|
35
|
+
warning: "bg-warning-background text-foreground-fixed-dark",
|
|
36
|
+
destructive: "bg-destructive-background text-foreground-fixed-dark"
|
|
37
|
+
},
|
|
38
|
+
inset: {
|
|
39
|
+
true: "rounded-lg",
|
|
40
|
+
false: ""
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
defaultVariants: {
|
|
44
|
+
variant: "default",
|
|
45
|
+
inset: !1
|
|
46
|
+
}
|
|
47
|
+
}), _ = i(({ children: t, visible: n, defaultVisible: r = !0, onClose: i, className: a, inset: o = !1, variant: s = "default", ...l }, u) => {
|
|
48
|
+
let f = s ?? "default", [m, _] = h({
|
|
49
|
+
defaultVisible: r,
|
|
50
|
+
visible: n,
|
|
51
|
+
onClose: i
|
|
52
|
+
}), v = c(() => ({
|
|
53
|
+
show: m ?? !0,
|
|
54
|
+
setShow: _,
|
|
55
|
+
variant: f
|
|
56
|
+
}), [
|
|
57
|
+
m,
|
|
58
|
+
_,
|
|
59
|
+
f
|
|
60
|
+
]);
|
|
61
|
+
return m ? /* @__PURE__ */ d(p.Provider, {
|
|
62
|
+
value: v,
|
|
63
|
+
children: /* @__PURE__ */ d("div", {
|
|
64
|
+
ref: u,
|
|
65
|
+
"data-slot": "banner",
|
|
66
|
+
className: e(g({
|
|
67
|
+
variant: f,
|
|
68
|
+
inset: o
|
|
69
|
+
}), a),
|
|
70
|
+
...l,
|
|
71
|
+
children: /* @__PURE__ */ d("div", {
|
|
72
|
+
"data-slot": "banner-content",
|
|
73
|
+
className: "flex h-7 w-full items-center self-stretch gap-2",
|
|
74
|
+
children: t
|
|
75
|
+
})
|
|
76
|
+
})
|
|
77
|
+
}) : null;
|
|
78
|
+
});
|
|
79
|
+
_.displayName = "Banner";
|
|
80
|
+
var v = {
|
|
81
|
+
default: "text-neutral-foreground-on-neutral",
|
|
82
|
+
info: "text-info-foreground-on-info",
|
|
83
|
+
warning: "text-warning-foreground-on-warning",
|
|
84
|
+
destructive: "text-destructive-foreground-on-critical"
|
|
85
|
+
}, y = i(({ icon: t, className: n, ...r }, i) => {
|
|
86
|
+
let { variant: a } = o(p);
|
|
87
|
+
return /* @__PURE__ */ d("div", {
|
|
88
|
+
ref: i,
|
|
89
|
+
"data-slot": "banner-icon",
|
|
90
|
+
className: e("flex h-4 w-4 shrink-0 items-center justify-center", v[a], n),
|
|
91
|
+
...r,
|
|
92
|
+
children: /* @__PURE__ */ d(t, { size: 16 })
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
y.displayName = "BannerIcon";
|
|
96
|
+
var b = i(({ className: t, ...n }, r) => /* @__PURE__ */ d("p", {
|
|
97
|
+
ref: r,
|
|
98
|
+
"data-slot": "banner-title",
|
|
99
|
+
className: e("flex min-w-0 flex-1 items-center text-base font-medium leading-5 tracking-tighter text-foreground-fixed-dark", t),
|
|
100
|
+
...n
|
|
101
|
+
}));
|
|
102
|
+
b.displayName = "BannerTitle";
|
|
103
|
+
var x = i(({ outline: t = !0, variant: r, className: i, ...a }, s) => {
|
|
104
|
+
let { variant: c } = o(p);
|
|
105
|
+
return /* @__PURE__ */ d(n, {
|
|
106
|
+
ref: s,
|
|
107
|
+
"data-slot": "banner-status",
|
|
108
|
+
outline: t,
|
|
109
|
+
variant: r ?? {
|
|
110
|
+
default: "default",
|
|
111
|
+
info: "inProgress",
|
|
112
|
+
destructive: "error",
|
|
113
|
+
warning: "warning"
|
|
114
|
+
}[c],
|
|
115
|
+
className: e("shrink-0", i),
|
|
116
|
+
...a
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
x.displayName = "BannerStatus";
|
|
120
|
+
var S = i(({ className: t, ...n }, r) => /* @__PURE__ */ d("div", {
|
|
121
|
+
ref: r,
|
|
122
|
+
"data-slot": "banner-actions",
|
|
123
|
+
className: e("ml-auto flex h-7 shrink-0 items-center gap-2", t),
|
|
124
|
+
...n
|
|
125
|
+
}));
|
|
126
|
+
S.displayName = "BannerActions";
|
|
127
|
+
var C = i(({ variant: n = "ghost", size: r = "sm", className: i, ...a }, o) => /* @__PURE__ */ d(t, {
|
|
128
|
+
ref: o,
|
|
129
|
+
"data-slot": "banner-action",
|
|
130
|
+
className: e("h-7 min-w-16 shrink-0 rounded px-2 text-sm font-medium leading-4.5 text-foreground-fixed-dark hover:bg-transparent dark:hover:bg-transparent hover:text-foreground-secondary-fixed-dark disabled:bg-transparent dark:disabled:bg-transparent disabled:text-disabled-foreground", i),
|
|
131
|
+
size: r,
|
|
132
|
+
variant: n,
|
|
133
|
+
...a
|
|
134
|
+
}));
|
|
135
|
+
C.displayName = "BannerAction";
|
|
136
|
+
var w = i(({ onClick: e, ...t }, n) => {
|
|
137
|
+
let { setShow: r } = o(p);
|
|
138
|
+
return /* @__PURE__ */ d(C, {
|
|
139
|
+
ref: n,
|
|
140
|
+
"data-slot": "banner-close",
|
|
141
|
+
onClick: (t) => {
|
|
142
|
+
r(!1), e?.(t);
|
|
143
|
+
},
|
|
144
|
+
...t
|
|
145
|
+
});
|
|
146
|
+
});
|
|
147
|
+
w.displayName = "BannerClose";
|
|
148
|
+
//#endregion
|
|
149
|
+
export { _ as Banner, C as BannerAction, S as BannerActions, w as BannerClose, y as BannerIcon, x as BannerStatus, b as BannerTitle };
|