@cognite/aura 0.3.2 → 0.3.4
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 +134 -5
- package/README.md +24 -3
- package/dist/components/index.d.ts +5 -1
- package/dist/components/index.js +59 -327
- 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/calendar/calendar-header.js +63 -0
- package/dist/components/ui/core/calendar/calendar-utils.js +39 -0
- package/dist/components/ui/core/calendar/calendar.js +68 -0
- package/dist/components/ui/core/calendar/constants.d.ts +1 -0
- 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/data-grid/data-grid-cell.d.ts +10 -0
- package/dist/components/ui/core/data-grid/data-grid-header-row.d.ts +13 -0
- package/dist/components/ui/core/data-grid/data-grid-row.d.ts +18 -0
- package/dist/components/ui/core/data-grid/data-grid.d.ts +43 -0
- package/dist/components/ui/core/data-grid/data-grid.fixtures.d.ts +12 -0
- package/dist/components/ui/core/data-grid/data-grid.utils.d.ts +9 -0
- package/dist/components/ui/core/date-time-pickers/date-picker/date-picker.js +60 -72
- package/dist/components/ui/core/date-time-pickers/date-picker/types.d.ts +2 -1
- package/dist/components/ui/core/date-time-pickers/date-picker/use-date-picker.js +36 -51
- package/dist/components/ui/core/date-time-pickers/date-range-picker/date-range-picker.js +63 -87
- package/dist/components/ui/core/date-time-pickers/date-range-picker/types.d.ts +2 -1
- package/dist/components/ui/core/date-time-pickers/date-range-picker/use-date-range-picker.js +60 -68
- package/dist/components/ui/core/date-time-pickers/date-time-picker/index.d.ts +1 -0
- package/dist/components/ui/core/date-time-pickers/date-time-picker/types.d.ts +36 -0
- package/dist/components/ui/core/date-time-pickers/date-time-picker/use-date-time-picker.d.ts +3 -0
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/date-time-range-picker.js +118 -174
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/types.d.ts +7 -6
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/use-date-time-range-picker.js +104 -145
- package/dist/components/ui/core/date-time-pickers/index.d.ts +3 -1
- package/dist/components/ui/core/date-time-pickers/index.js +6 -10
- package/dist/components/ui/core/date-time-pickers/shared/am-pm-scroll/am-pm-scroll.d.ts +3 -2
- 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/constants.d.ts +3 -8
- 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.js +23 -23
- 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.d.ts +3 -3
- 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.d.ts +3 -2
- 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/time-picker-panel.d.ts +3 -2
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/time-picker-panel.js +40 -40
- 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/time-picker.js +78 -99
- package/dist/components/ui/core/date-time-pickers/time-picker/types.d.ts +5 -4
- package/dist/components/ui/core/date-time-pickers/time-picker/use-time-picker.js +41 -63
- package/dist/components/ui/core/date-time-pickers/time-range-picker/index.d.ts +1 -0
- package/dist/components/ui/core/date-time-pickers/time-range-picker/types.d.ts +40 -0
- package/dist/components/ui/core/date-time-pickers/time-range-picker/use-time-range-picker.d.ts +3 -0
- package/dist/components/ui/core/date-time-pickers/utils/format-utils.d.ts +1 -0
- package/dist/components/ui/core/date-time-pickers/utils/time-utils.d.ts +3 -3
- 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 +2 -2
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.js +150 -248
- 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/overflow-list/overflow-list.utils.d.ts +52 -0
- 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/slider/slider.d.ts +9 -0
- package/dist/components/ui/core/slider/slider.js +40 -0
- 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/index.d.ts +1 -1
- 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 +26 -0
- package/package.json +42 -8
- package/dist/components/ui/core/date-time-pickers/shared/calendar/calendar.js +0 -119
- package/dist/components/ui/core/date-time-pickers/shared/calendar-header/calendar-header.js +0 -93
- package/dist/components/ui/core/date-time-pickers/shared/constants.js +0 -14
- package/dist/components/ui/core/date-time-pickers/utils/calendar-utils.js +0 -52
- /package/dist/components/ui/core/{date-time-pickers/shared/calendar-header → calendar}/calendar-header.d.ts +0 -0
- /package/dist/components/ui/core/{date-time-pickers/utils → calendar}/calendar-utils.d.ts +0 -0
- /package/dist/components/ui/core/{date-time-pickers/shared/calendar → calendar}/calendar.d.ts +0 -0
|
@@ -1,207 +1,159 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
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
|
-
switch (r) {
|
|
44
|
-
case "warning":
|
|
45
|
-
return /* @__PURE__ */ a(z, { ...t });
|
|
46
|
-
case "error":
|
|
47
|
-
return /* @__PURE__ */ a(V, { ...t });
|
|
48
|
-
default:
|
|
49
|
-
return /* @__PURE__ */ a(I, { ...t });
|
|
50
|
-
}
|
|
1
|
+
import { cn as e } from "../../../../lib/utils.js";
|
|
2
|
+
import { Button as t } from "../button/button.js";
|
|
3
|
+
import { useControllableState as n } from "../../../../lib/use-controllable-state.js";
|
|
4
|
+
import { createContext as r, forwardRef as i, useContext as a, useMemo as o } from "react";
|
|
5
|
+
import { IconAlertCircleFilled as s, IconAlertTriangleFilled as c, IconInfoCircleFilled as l, IconX as u } from "@tabler/icons-react";
|
|
6
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
7
|
+
import { cva as p } from "class-variance-authority";
|
|
8
|
+
//#region libs/aura/src/components/ui/core/alert/alert.tsx
|
|
9
|
+
var m = r({
|
|
10
|
+
show: !0,
|
|
11
|
+
setShow: () => {},
|
|
12
|
+
variant: "default",
|
|
13
|
+
alertStyle: "card"
|
|
14
|
+
}), h = p([
|
|
15
|
+
"[&_svg]:shrink-0",
|
|
16
|
+
"[&_svg:not([class*='size-']):not([class*='w-'])]:w-4",
|
|
17
|
+
"[&_svg:not([class*='size-']):not([class*='h-'])]:h-4"
|
|
18
|
+
].join(" ")), g = p("relative w-full rounded-md pt-2.5 pr-3 has-[>button[data-slot=alert-close]]:pr-12 pb-2 pl-3 text-sm grid has-[>[data-slot=alert-icon]]:grid-cols-[auto_1fr] grid-cols-[0_1fr] has-[>[data-slot=alert-icon]]:gap-x-2 has-[>[data-slot=alert-icon]]:gap-y-1 items-start", {
|
|
19
|
+
variants: {
|
|
20
|
+
variant: {
|
|
21
|
+
default: "bg-neutral-muted-background text-foreground [&>[data-slot=alert-icon]]:text-muted-foreground",
|
|
22
|
+
info: "bg-info-muted-background text-foreground [&>[data-slot=alert-icon]]:text-info-foreground",
|
|
23
|
+
warning: "bg-warning-muted-background [&>[data-slot=alert-icon]]:text-warning-foreground",
|
|
24
|
+
error: "bg-destructive-muted-background text-foreground [&>[data-slot=alert-icon]]:text-destructive-foreground"
|
|
25
|
+
},
|
|
26
|
+
alertStyle: {
|
|
27
|
+
card: "pt-3 pr-5 pb-3 pl-3 [&>[data-slot=alert-title]+[data-slot=alert-description]]:mt-2 [&>[data-slot=alert-icon]]:mt-0.5",
|
|
28
|
+
strip: "flex min-h-11 items-center gap-2 py-2 pr-3 pl-3 [&>[data-slot=alert-title]]:hidden"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
defaultVariants: {
|
|
32
|
+
variant: "default",
|
|
33
|
+
alertStyle: "card"
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
function _(e) {
|
|
37
|
+
let t = { "aria-hidden": !0 };
|
|
38
|
+
switch (e) {
|
|
39
|
+
case "warning": return /* @__PURE__ */ d(c, { ...t });
|
|
40
|
+
case "error": return /* @__PURE__ */ d(s, { ...t });
|
|
41
|
+
default: return /* @__PURE__ */ d(l, { ...t });
|
|
42
|
+
}
|
|
51
43
|
}
|
|
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
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
size: "sm",
|
|
169
|
-
className: s(X[t], r),
|
|
170
|
-
...e
|
|
171
|
-
}
|
|
172
|
-
));
|
|
173
|
-
q.displayName = "AlertButton";
|
|
174
|
-
const y = l(
|
|
175
|
-
({ className: r, onClick: t, ...e }, o) => {
|
|
176
|
-
const { setShow: n, alertStyle: d } = g(i), c = e["aria-label"] ?? "Close alert", f = (m) => {
|
|
177
|
-
n(!1), t?.(m);
|
|
178
|
-
};
|
|
179
|
-
return /* @__PURE__ */ a(
|
|
180
|
-
b,
|
|
181
|
-
{
|
|
182
|
-
ref: o,
|
|
183
|
-
"data-slot": "alert-close",
|
|
184
|
-
variant: "ghost",
|
|
185
|
-
size: "sm",
|
|
186
|
-
className: s(
|
|
187
|
-
"shrink-0 size-7 rounded-md p-0 text-secondary-foreground hover:bg-transparent hover:text-foreground",
|
|
188
|
-
d === "card" && "absolute right-2 top-2",
|
|
189
|
-
r
|
|
190
|
-
),
|
|
191
|
-
"aria-label": c,
|
|
192
|
-
onClick: f,
|
|
193
|
-
...e,
|
|
194
|
-
children: /* @__PURE__ */ a(S, { "aria-hidden": "true", className: "size-4" })
|
|
195
|
-
}
|
|
196
|
-
);
|
|
197
|
-
}
|
|
198
|
-
);
|
|
199
|
-
y.displayName = "AlertClose";
|
|
200
|
-
export {
|
|
201
|
-
j as Alert,
|
|
202
|
-
R as AlertActions,
|
|
203
|
-
q as AlertButton,
|
|
204
|
-
y as AlertClose,
|
|
205
|
-
M as AlertDescription,
|
|
206
|
-
P as AlertTitle
|
|
207
|
-
};
|
|
44
|
+
var v = i(({ className: t, variant: r = "default", alertStyle: i = "card", visible: a, defaultVisible: s = !0, onClose: c, icon: l, children: u, ...p }, v) => {
|
|
45
|
+
let [y, b] = n({
|
|
46
|
+
defaultProp: s,
|
|
47
|
+
prop: a,
|
|
48
|
+
onChange: c
|
|
49
|
+
}), x = r === "secondary" ? "info" : r ?? "default", S = o(() => ({
|
|
50
|
+
show: y,
|
|
51
|
+
setShow: b,
|
|
52
|
+
variant: x,
|
|
53
|
+
alertStyle: i
|
|
54
|
+
}), [
|
|
55
|
+
y,
|
|
56
|
+
b,
|
|
57
|
+
x,
|
|
58
|
+
i
|
|
59
|
+
]);
|
|
60
|
+
if (!y) return null;
|
|
61
|
+
let C = l === void 0 ? _(x) : l;
|
|
62
|
+
return /* @__PURE__ */ d(m.Provider, {
|
|
63
|
+
value: S,
|
|
64
|
+
children: /* @__PURE__ */ f("div", {
|
|
65
|
+
ref: v,
|
|
66
|
+
"data-slot": "alert",
|
|
67
|
+
role: "alert",
|
|
68
|
+
className: e(g({
|
|
69
|
+
variant: x,
|
|
70
|
+
alertStyle: i
|
|
71
|
+
}), t),
|
|
72
|
+
...p,
|
|
73
|
+
children: [
|
|
74
|
+
C && /* @__PURE__ */ d("span", {
|
|
75
|
+
"data-slot": "alert-icon",
|
|
76
|
+
className: h(),
|
|
77
|
+
children: C
|
|
78
|
+
}),
|
|
79
|
+
u,
|
|
80
|
+
c && /* @__PURE__ */ d(E, {})
|
|
81
|
+
]
|
|
82
|
+
})
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
v.displayName = "Alert";
|
|
86
|
+
var y = {
|
|
87
|
+
default: "text-foreground",
|
|
88
|
+
info: "text-foreground",
|
|
89
|
+
warning: "text-foreground",
|
|
90
|
+
error: "text-foreground"
|
|
91
|
+
}, b = i(({ className: t, ...n }, r) => {
|
|
92
|
+
let { variant: i, alertStyle: o } = a(m);
|
|
93
|
+
return /* @__PURE__ */ d("div", {
|
|
94
|
+
ref: r,
|
|
95
|
+
"data-slot": "alert-title",
|
|
96
|
+
className: e(o === "strip" ? "text-sm font-medium leading-[18px] tracking-normal" : "col-start-2 text-base font-medium leading-5 tracking-tighter", y[i], t),
|
|
97
|
+
...n
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
b.displayName = "AlertTitle";
|
|
101
|
+
var x = {
|
|
102
|
+
default: "text-secondary-foreground",
|
|
103
|
+
info: "text-secondary-foreground",
|
|
104
|
+
warning: "text-secondary-foreground",
|
|
105
|
+
error: "text-secondary-foreground"
|
|
106
|
+
}, S = i(({ className: t, ...n }, r) => {
|
|
107
|
+
let { variant: i, alertStyle: o } = a(m);
|
|
108
|
+
return /* @__PURE__ */ d("div", {
|
|
109
|
+
ref: r,
|
|
110
|
+
"data-slot": "alert-description",
|
|
111
|
+
className: e(o === "strip" ? "flex-1 min-w-0 pr-4 text-sm font-normal leading-[18px] tracking-tight" : "col-start-2 text-sm font-normal leading-[18px] tracking-tight", x[i], t),
|
|
112
|
+
...n
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
S.displayName = "AlertDescription";
|
|
116
|
+
var C = i(({ className: t, ...n }, r) => {
|
|
117
|
+
let { alertStyle: i } = a(m);
|
|
118
|
+
return /* @__PURE__ */ d("div", {
|
|
119
|
+
ref: r,
|
|
120
|
+
"data-slot": "alert-actions",
|
|
121
|
+
className: e(i === "strip" ? "ml-auto flex shrink-0 items-center gap-3" : "col-start-2 flex flex-wrap items-center gap-3 pt-2", t),
|
|
122
|
+
...n
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
C.displayName = "AlertActions";
|
|
126
|
+
var w = {
|
|
127
|
+
default: "gap-2 rounded-md",
|
|
128
|
+
ghost: "h-auto p-0 hover:bg-transparent"
|
|
129
|
+
}, T = i(({ className: n, variant: r = "default", ...i }, a) => /* @__PURE__ */ d(t, {
|
|
130
|
+
ref: a,
|
|
131
|
+
"data-slot": "alert-button",
|
|
132
|
+
variant: r === "ghost" ? "ghost" : void 0,
|
|
133
|
+
size: "sm",
|
|
134
|
+
className: e(w[r], n),
|
|
135
|
+
...i
|
|
136
|
+
}));
|
|
137
|
+
T.displayName = "AlertButton";
|
|
138
|
+
var E = i(({ className: n, onClick: r, ...i }, o) => {
|
|
139
|
+
let { setShow: s, alertStyle: c } = a(m), l = i["aria-label"] ?? "Close alert";
|
|
140
|
+
return /* @__PURE__ */ d(t, {
|
|
141
|
+
ref: o,
|
|
142
|
+
"data-slot": "alert-close",
|
|
143
|
+
variant: "ghost",
|
|
144
|
+
size: "sm",
|
|
145
|
+
className: e("shrink-0 size-7 rounded-md p-0 text-secondary-foreground hover:bg-transparent hover:text-foreground", c === "card" && "absolute right-2 top-2", n),
|
|
146
|
+
"aria-label": l,
|
|
147
|
+
onClick: (e) => {
|
|
148
|
+
s(!1), r?.(e);
|
|
149
|
+
},
|
|
150
|
+
...i,
|
|
151
|
+
children: /* @__PURE__ */ d(u, {
|
|
152
|
+
"aria-hidden": "true",
|
|
153
|
+
className: "size-4"
|
|
154
|
+
})
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
E.displayName = "AlertClose";
|
|
158
|
+
//#endregion
|
|
159
|
+
export { v as Alert, C as AlertActions, T as AlertButton, E as AlertClose, S as AlertDescription, b as AlertTitle };
|
|
@@ -1,91 +1,65 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { cn as e } from "../../../../lib/utils.js";
|
|
2
2
|
import { forwardRef as t } from "react";
|
|
3
|
-
import {
|
|
4
|
-
import { cva as
|
|
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
|
-
ref: r,
|
|
68
|
-
"data-slot": "avatar-fallback",
|
|
69
|
-
className: d(" flex size-full items-center justify-center", a),
|
|
70
|
-
...e
|
|
71
|
-
}
|
|
72
|
-
));
|
|
73
|
-
f.displayName = "AvatarFallback";
|
|
74
|
-
const m = t(
|
|
75
|
-
({ className: a, ...e }, r) => /* @__PURE__ */ o(
|
|
76
|
-
"span",
|
|
77
|
-
{
|
|
78
|
-
ref: r,
|
|
79
|
-
"data-slot": "avatar-icon",
|
|
80
|
-
className: d("flex size-full items-center justify-center", a),
|
|
81
|
-
...e
|
|
82
|
-
}
|
|
83
|
-
)
|
|
84
|
-
);
|
|
85
|
-
m.displayName = "AvatarIcon";
|
|
86
|
-
export {
|
|
87
|
-
l as Avatar,
|
|
88
|
-
f as AvatarFallback,
|
|
89
|
-
m as AvatarIcon,
|
|
90
|
-
b as AvatarImage
|
|
91
|
-
};
|
|
3
|
+
import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
4
|
+
import { cva as a } from "class-variance-authority";
|
|
5
|
+
import { Avatar as o } from "@base-ui/react/avatar";
|
|
6
|
+
//#region libs/aura/src/components/ui/core/avatar/avatar.tsx
|
|
7
|
+
var s = a("group/avatar relative inline-flex text-base font-medium leading-5 shrink-0 overflow-hidden flex-col justify-center items-center box-border", {
|
|
8
|
+
variants: {
|
|
9
|
+
variant: {
|
|
10
|
+
default: "bg-decorative-background-mountain text-decorative-foreground-mountain hover:bg-decorative-background-mountain-hover",
|
|
11
|
+
nordic: "bg-decorative-background-nordic text-decorative-foreground-nordic hover:bg-decorative-background-nordic-hover",
|
|
12
|
+
aurora: "bg-decorative-background-aurora text-decorative-foreground-aurora hover:bg-decorative-background-aurora-hover",
|
|
13
|
+
fjord: "bg-decorative-background-fjord text-decorative-foreground-fjord hover:bg-decorative-background-fjord-hover",
|
|
14
|
+
dusk: "bg-decorative-background-dusk text-decorative-foreground-dusk hover:bg-decorative-background-dusk-hover",
|
|
15
|
+
orange: "bg-decorative-background-orange text-decorative-foreground-orange hover:bg-decorative-background-orange-hover",
|
|
16
|
+
sky: "bg-decorative-background-sky text-decorative-foreground-sky hover:bg-decorative-background-sky-hover",
|
|
17
|
+
overflow: "bg-secondary-background text-secondary-foreground hover:bg-secondary-background-hover"
|
|
18
|
+
},
|
|
19
|
+
sizes: {
|
|
20
|
+
default: "size-9 rounded-lg text-sm [&_svg]:w-5 [&_svg]:h-5",
|
|
21
|
+
xsm: "size-7 rounded-md text-xs [&_svg]:w-4 [&_svg]:h-4",
|
|
22
|
+
xxsm: "size-5 rounded-sm text-2xs [&_svg]:w-3 [&_svg]:h-3"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
defaultVariants: {
|
|
26
|
+
variant: "default",
|
|
27
|
+
sizes: "default"
|
|
28
|
+
}
|
|
29
|
+
}), c = t(({ className: t, variant: n, sizes: i, ...a }, c) => /* @__PURE__ */ r(o.Root, {
|
|
30
|
+
ref: c,
|
|
31
|
+
"data-slot": "avatar",
|
|
32
|
+
className: e(s({
|
|
33
|
+
variant: n,
|
|
34
|
+
sizes: i
|
|
35
|
+
}), t),
|
|
36
|
+
...a
|
|
37
|
+
}));
|
|
38
|
+
c.displayName = "Avatar";
|
|
39
|
+
var l = t(({ className: t, ...a }, s) => /* @__PURE__ */ i(n, { children: [/* @__PURE__ */ r(o.Image, {
|
|
40
|
+
ref: s,
|
|
41
|
+
"data-slot": "avatar-image",
|
|
42
|
+
className: e("aspect-square size-full object-cover object-center", t),
|
|
43
|
+
...a
|
|
44
|
+
}), /* @__PURE__ */ r("span", {
|
|
45
|
+
"data-slot": "avatar-image-backdrop",
|
|
46
|
+
className: "absolute inset-0 bg-overlay-background opacity-0 transition-opacity group-hover/avatar:opacity-100 pointer-events-none",
|
|
47
|
+
"aria-hidden": "true"
|
|
48
|
+
})] }));
|
|
49
|
+
l.displayName = "AvatarImage";
|
|
50
|
+
var u = t(({ className: t, ...n }, i) => /* @__PURE__ */ r(o.Fallback, {
|
|
51
|
+
ref: i,
|
|
52
|
+
"data-slot": "avatar-fallback",
|
|
53
|
+
className: e(" flex size-full items-center justify-center", t),
|
|
54
|
+
...n
|
|
55
|
+
}));
|
|
56
|
+
u.displayName = "AvatarFallback";
|
|
57
|
+
var d = t(({ className: t, ...n }, i) => /* @__PURE__ */ r("span", {
|
|
58
|
+
ref: i,
|
|
59
|
+
"data-slot": "avatar-icon",
|
|
60
|
+
className: e("flex size-full items-center justify-center", t),
|
|
61
|
+
...n
|
|
62
|
+
}));
|
|
63
|
+
d.displayName = "AvatarIcon";
|
|
64
|
+
//#endregion
|
|
65
|
+
export { c as Avatar, u as AvatarFallback, d as AvatarIcon, l as AvatarImage };
|