@cognite/aura 0.1.5 → 0.1.7
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 +1269 -0
- package/README.md +24 -0
- package/dist/colors.css +824 -0
- package/dist/components/index.d.ts +11 -2
- package/dist/components/index.js +284 -249
- package/dist/components/ui/core/accordion/accordion.d.ts +24 -0
- package/dist/components/ui/core/accordion/accordion.js +113 -0
- package/dist/components/ui/core/accordion/accordion.metadata.d.ts +2 -0
- package/dist/components/ui/core/accordion/accordion.metadata.js +9 -0
- package/dist/components/ui/core/alert/alert.d.ts +2 -1
- package/dist/components/ui/core/alert/alert.js +120 -96
- package/dist/components/ui/core/alert/alert.metadata.js +1 -1
- package/dist/components/ui/core/avatar/avatar.js +29 -32
- package/dist/components/ui/core/badge/badge.d.ts +1 -1
- package/dist/components/ui/core/badge/badge.js +44 -52
- package/dist/components/ui/core/banner/banner.d.ts +40 -0
- package/dist/components/ui/core/banner/banner.js +218 -0
- package/dist/components/ui/core/banner/banner.metadata.d.ts +2 -0
- package/dist/components/ui/core/banner/banner.metadata.js +9 -0
- package/dist/components/ui/core/button/button.d.ts +2 -2
- package/dist/components/ui/core/button/button.js +19 -20
- package/dist/components/ui/core/button-group/button-group.js +10 -10
- package/dist/components/ui/core/card/card.js +1 -1
- package/dist/components/ui/core/code-block/code-block.d.ts +14 -3
- package/dist/components/ui/core/code-block/code-block.js +218 -97
- package/dist/components/ui/core/code-block/code-block.metadata.js +1 -1
- package/dist/components/ui/core/collapsible/collapsible.js +30 -24
- package/dist/components/ui/core/command/command.d.ts +2 -2
- package/dist/components/ui/core/command/command.js +30 -30
- package/dist/components/ui/core/dialog/dialog.js +8 -8
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.d.ts +1 -1
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.js +65 -62
- package/dist/components/ui/core/helper-text/helper-text.js +8 -8
- package/dist/components/ui/core/hover-card/hover-card.js +5 -5
- package/dist/components/ui/core/inline-citation/inline-citation.js +19 -16
- package/dist/components/ui/core/input/input.d.ts +1 -5
- package/dist/components/ui/core/input/input.js +24 -30
- package/dist/components/ui/core/input-group/input-group.d.ts +2 -2
- package/dist/components/ui/core/input-group/input-group.js +104 -74
- package/dist/components/ui/core/label/label.d.ts +3 -1
- package/dist/components/ui/core/label/label.js +39 -16
- package/dist/components/ui/core/label/label.metadata.js +2 -2
- package/dist/components/ui/core/message/message-response-default-streamdown-controls.d.ts +11 -0
- package/dist/components/ui/core/message/message-response-default-streamdown-controls.js +13 -0
- package/dist/components/ui/core/message/message.d.ts +1 -1
- package/dist/components/ui/core/message/message.js +62 -44
- package/dist/components/ui/core/popover/popover.d.ts +10 -1
- package/dist/components/ui/core/popover/popover.js +137 -34
- package/dist/components/ui/core/popover/popover.metadata.js +9 -0
- package/dist/components/ui/core/progress/progress.d.ts +10 -0
- package/dist/components/ui/core/progress/progress.js +61 -0
- package/dist/components/ui/core/progress/progress.metadata.d.ts +2 -0
- package/dist/components/ui/core/progress/progress.metadata.js +9 -0
- package/dist/components/ui/core/prompt-input/prompt-input.d.ts +2 -2
- package/dist/components/ui/core/prompt-input/prompt-input.js +100 -100
- package/dist/components/ui/core/scroll-area/scroll-area.d.ts +3 -0
- package/dist/components/ui/core/scroll-area/scroll-area.js +71 -0
- package/dist/components/ui/core/scroll-area/scroll-area.metadata.d.ts +2 -0
- package/dist/components/ui/core/scroll-area/scroll-area.metadata.js +9 -0
- package/dist/components/ui/core/select/select.d.ts +3 -3
- package/dist/components/ui/core/select/select.js +69 -73
- package/dist/components/ui/core/skeleton/skeleton.js +6 -6
- package/dist/components/ui/core/sources/sources.js +8 -1
- package/dist/components/ui/core/textarea/textarea.d.ts +1 -8
- package/dist/components/ui/core/textarea/textarea.js +21 -45
- package/dist/components/ui/core/tool/tool.js +58 -50
- package/dist/components/ui/core/tooltip/tooltip.js +10 -10
- package/dist/index.d.ts +1 -1
- package/dist/index.js +281 -249
- package/dist/lib/utils.d.ts +6 -6
- package/dist/lib/utils.js +26 -26
- package/dist/styles.css +1 -1
- package/dist/styles.source.css +3 -812
- package/package.json +28 -9
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
import { Accordion as AccordionPrimitive } from '@base-ui/react/accordion';
|
|
3
|
+
import { Icon } from '@tabler/icons-react';
|
|
4
|
+
type AccordionCommonProps = Omit<ComponentProps<typeof AccordionPrimitive.Root>, 'multiple' | 'value' | 'defaultValue' | 'onValueChange'>;
|
|
5
|
+
type AccordionSingleProps = {
|
|
6
|
+
type?: 'single';
|
|
7
|
+
collapsible?: boolean;
|
|
8
|
+
value?: string;
|
|
9
|
+
defaultValue?: string;
|
|
10
|
+
onValueChange?: (value: string) => void;
|
|
11
|
+
};
|
|
12
|
+
type AccordionMultipleProps = {
|
|
13
|
+
type: 'multiple';
|
|
14
|
+
value?: string[];
|
|
15
|
+
defaultValue?: string[];
|
|
16
|
+
onValueChange?: (value: string[]) => void;
|
|
17
|
+
};
|
|
18
|
+
declare const Accordion: import('react').ForwardRefExoticComponent<(Omit<AccordionCommonProps & AccordionSingleProps, "ref"> | Omit<AccordionCommonProps & AccordionMultipleProps, "ref">) & import('react').RefAttributes<HTMLDivElement>>;
|
|
19
|
+
declare const AccordionItem: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').AccordionItemProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
20
|
+
declare const AccordionTrigger: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').AccordionTriggerProps & {
|
|
21
|
+
icon?: Icon;
|
|
22
|
+
}, "ref"> & import('react').RefAttributes<HTMLElement>>;
|
|
23
|
+
declare const AccordionContent: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').AccordionPanelProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
24
|
+
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { jsx as o, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as d } from "react";
|
|
3
|
+
import { Accordion as r } from "@base-ui/react/accordion";
|
|
4
|
+
import { IconChevronDown as A } from "@tabler/icons-react";
|
|
5
|
+
import { cn as u } from "../../../../lib/utils.js";
|
|
6
|
+
const w = d((e, t) => {
|
|
7
|
+
if (e.type === "multiple") {
|
|
8
|
+
const {
|
|
9
|
+
type: s,
|
|
10
|
+
value: c,
|
|
11
|
+
defaultValue: b,
|
|
12
|
+
onValueChange: f,
|
|
13
|
+
...x
|
|
14
|
+
} = e;
|
|
15
|
+
return /* @__PURE__ */ o(
|
|
16
|
+
r.Root,
|
|
17
|
+
{
|
|
18
|
+
ref: t,
|
|
19
|
+
"data-slot": "accordion",
|
|
20
|
+
multiple: !0,
|
|
21
|
+
value: c,
|
|
22
|
+
defaultValue: b,
|
|
23
|
+
onValueChange: (y) => {
|
|
24
|
+
if (!f) return;
|
|
25
|
+
const N = y.filter(
|
|
26
|
+
(V) => V != null
|
|
27
|
+
);
|
|
28
|
+
f(N);
|
|
29
|
+
},
|
|
30
|
+
...x
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
const {
|
|
35
|
+
type: a,
|
|
36
|
+
collapsible: i = !1,
|
|
37
|
+
value: l,
|
|
38
|
+
defaultValue: n,
|
|
39
|
+
onValueChange: g,
|
|
40
|
+
...p
|
|
41
|
+
} = e, h = l === void 0 ? void 0 : l === "" ? [] : [l], v = n === void 0 ? void 0 : n === "" ? [] : [n];
|
|
42
|
+
return /* @__PURE__ */ o(
|
|
43
|
+
r.Root,
|
|
44
|
+
{
|
|
45
|
+
ref: t,
|
|
46
|
+
"data-slot": "accordion",
|
|
47
|
+
multiple: !1,
|
|
48
|
+
value: h,
|
|
49
|
+
defaultValue: v,
|
|
50
|
+
onValueChange: (s, c) => {
|
|
51
|
+
if (g) {
|
|
52
|
+
if (!i && s.length === 0) {
|
|
53
|
+
c.cancel();
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
g(s[0] ?? "");
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
...p
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
});
|
|
63
|
+
w.displayName = "Accordion";
|
|
64
|
+
const C = d(({ className: e, ...t }, a) => /* @__PURE__ */ o(
|
|
65
|
+
r.Item,
|
|
66
|
+
{
|
|
67
|
+
ref: a,
|
|
68
|
+
"data-slot": "accordion-item",
|
|
69
|
+
className: u("mt-2 first:mt-0 rounded-md", e),
|
|
70
|
+
...t
|
|
71
|
+
}
|
|
72
|
+
));
|
|
73
|
+
C.displayName = "AccordionItem";
|
|
74
|
+
const k = d(({ className: e, children: t, icon: a, ...i }, l) => {
|
|
75
|
+
const n = a;
|
|
76
|
+
return /* @__PURE__ */ o(r.Header, { className: "flex", children: /* @__PURE__ */ m(
|
|
77
|
+
r.Trigger,
|
|
78
|
+
{
|
|
79
|
+
ref: l,
|
|
80
|
+
"data-slot": "accordion-trigger",
|
|
81
|
+
className: u(
|
|
82
|
+
"focus-visible:border-ring focus-visible:ring-ring-shadow group/accordion-trigger flex flex-1 items-center justify-between gap-4.5 rounded-lg px-3 py-2 text-left hover:bg-muted-background hover:text-foreground focus-visible:ring text-base font-normal tracking-tightest transition-all outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:text-disabled-foreground aria-disabled:pointer-events-none aria-disabled:cursor-not-allowed aria-disabled:text-disabled-foreground data-[disabled]:pointer-events-none data-[disabled]:cursor-not-allowed data-[disabled]:text-disabled-foreground",
|
|
83
|
+
e
|
|
84
|
+
),
|
|
85
|
+
...i,
|
|
86
|
+
children: [
|
|
87
|
+
/* @__PURE__ */ m("div", { className: "flex items-center gap-2", children: [
|
|
88
|
+
n && /* @__PURE__ */ o(n, { className: "pointer-events-none size-4 shrink-0 transition-transform duration-200" }),
|
|
89
|
+
/* @__PURE__ */ o("span", { children: t })
|
|
90
|
+
] }),
|
|
91
|
+
/* @__PURE__ */ o(A, { className: "pointer-events-none size-4 shrink-0 transition-transform duration-200 group-aria-expanded/accordion-trigger:rotate-180" })
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
) });
|
|
95
|
+
});
|
|
96
|
+
k.displayName = "AccordionTrigger";
|
|
97
|
+
const I = d(({ className: e, children: t, ...a }, i) => /* @__PURE__ */ o(
|
|
98
|
+
r.Panel,
|
|
99
|
+
{
|
|
100
|
+
ref: i,
|
|
101
|
+
"data-slot": "accordion-content",
|
|
102
|
+
className: "h-(--accordion-panel-height) overflow-hidden text-sm font-normal tracking-tightest text-secondary-foreground transition-all duration-200 ease-out data-ending-style:h-0 data-starting-style:h-0",
|
|
103
|
+
...a,
|
|
104
|
+
children: /* @__PURE__ */ o("div", { className: u("px-3 pb-3 pt-2", e), children: t })
|
|
105
|
+
}
|
|
106
|
+
));
|
|
107
|
+
I.displayName = "AccordionContent";
|
|
108
|
+
export {
|
|
109
|
+
w as Accordion,
|
|
110
|
+
I as AccordionContent,
|
|
111
|
+
C as AccordionItem,
|
|
112
|
+
k as AccordionTrigger
|
|
113
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const o = {
|
|
2
|
+
name: "Accordion",
|
|
3
|
+
status: "experimental",
|
|
4
|
+
description: "An accessible accordion with smooth expand/collapse built on Base UI primitives.",
|
|
5
|
+
llmUsage: "Use `<Accordion>` with `<AccordionItem>`, `<AccordionTrigger>`, and `<AccordionContent>` for collapsible sections."
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
o as AccordionMetadata
|
|
9
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComponentProps } from 'react';
|
|
1
|
+
import { ComponentProps, ReactNode } from 'react';
|
|
2
2
|
import { VariantProps } from 'class-variance-authority';
|
|
3
3
|
type AlertVariant = 'default' | 'secondary' | 'warning' | 'error';
|
|
4
4
|
declare const alertVariants: (props?: ({
|
|
@@ -9,6 +9,7 @@ type AlertProps = ComponentProps<'div'> & Omit<VariantProps<typeof alertVariants
|
|
|
9
9
|
visible?: boolean;
|
|
10
10
|
defaultVisible?: boolean;
|
|
11
11
|
onClose?: () => void;
|
|
12
|
+
icon?: ReactNode;
|
|
12
13
|
};
|
|
13
14
|
declare const Alert: import('react').ForwardRefExoticComponent<Omit<AlertProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
14
15
|
declare const AlertTitle: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -1,180 +1,204 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { IconX as
|
|
4
|
-
import { cva as
|
|
5
|
-
import { useControllableState as
|
|
1
|
+
import { jsx as e, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as N, forwardRef as n, useMemo as k, useContext as u } from "react";
|
|
3
|
+
import { IconX as C, IconInfoCircle as I, IconAlertHexagon as V, IconAlertTriangle as _ } from "@tabler/icons-react";
|
|
4
|
+
import { cva as h } from "class-variance-authority";
|
|
5
|
+
import { useControllableState as z } from "../../../../lib/use-controllable-state.js";
|
|
6
6
|
import { cn as s } from "../../../../lib/utils.js";
|
|
7
|
-
import { Button as
|
|
8
|
-
const i =
|
|
7
|
+
import { Button as x } from "../button/button.js";
|
|
8
|
+
const i = N({
|
|
9
9
|
show: !0,
|
|
10
10
|
setShow: () => {
|
|
11
11
|
},
|
|
12
12
|
variant: "default"
|
|
13
|
-
}),
|
|
14
|
-
|
|
13
|
+
}), j = h(
|
|
14
|
+
[
|
|
15
|
+
"[&_svg]:shrink-0",
|
|
16
|
+
"[&_svg:not([class*='size-']):not([class*='w-'])]:w-3.5",
|
|
17
|
+
"[&_svg:not([class*='size-']):not([class*='h-'])]:h-3.5",
|
|
18
|
+
"[&_svg:not([class*='mt-'])]:mt-0.5"
|
|
19
|
+
].join(" ")
|
|
20
|
+
), D = h(
|
|
21
|
+
"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",
|
|
15
22
|
{
|
|
16
23
|
variants: {
|
|
17
24
|
variant: {
|
|
18
|
-
default: "bg-
|
|
19
|
-
secondary: "bg-
|
|
20
|
-
warning: "bg-warning-
|
|
21
|
-
error: "bg-destructive-
|
|
25
|
+
default: "bg-neutral-muted-background text-foreground [&>[data-slot=alert-icon]]:text-info-foreground",
|
|
26
|
+
secondary: "bg-info-muted-background text-foreground [&>[data-slot=alert-icon]]:text-info-foreground",
|
|
27
|
+
warning: "bg-warning-muted-background [&>[data-slot=alert-icon]]:text-warning-foreground",
|
|
28
|
+
error: "bg-destructive-muted-background text-foreground [&>[data-slot=alert-icon]]:text-destructive-foreground"
|
|
22
29
|
}
|
|
23
30
|
},
|
|
24
31
|
defaultVariants: {
|
|
25
32
|
variant: "default"
|
|
26
33
|
}
|
|
27
34
|
}
|
|
28
|
-
)
|
|
35
|
+
);
|
|
36
|
+
function S(r) {
|
|
37
|
+
const t = { "aria-hidden": !0 };
|
|
38
|
+
switch (r) {
|
|
39
|
+
case "warning":
|
|
40
|
+
return /* @__PURE__ */ e(_, { ...t });
|
|
41
|
+
case "error":
|
|
42
|
+
return /* @__PURE__ */ e(V, { ...t });
|
|
43
|
+
default:
|
|
44
|
+
return /* @__PURE__ */ e(I, { ...t });
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
const T = n(
|
|
29
48
|
({
|
|
30
|
-
className:
|
|
31
|
-
variant:
|
|
32
|
-
visible:
|
|
33
|
-
defaultVisible:
|
|
49
|
+
className: r,
|
|
50
|
+
variant: t = "default",
|
|
51
|
+
visible: a,
|
|
52
|
+
defaultVisible: o = !0,
|
|
34
53
|
onClose: l,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
54
|
+
icon: c,
|
|
55
|
+
children: g,
|
|
56
|
+
...w
|
|
57
|
+
}, A) => {
|
|
58
|
+
const [f, m] = z({
|
|
59
|
+
defaultProp: o,
|
|
60
|
+
prop: a,
|
|
41
61
|
onChange: l
|
|
42
|
-
}),
|
|
43
|
-
() => ({ show:
|
|
44
|
-
[
|
|
62
|
+
}), d = t ?? "default", y = k(
|
|
63
|
+
() => ({ show: f, setShow: m, variant: d }),
|
|
64
|
+
[f, m, d]
|
|
45
65
|
);
|
|
46
|
-
|
|
66
|
+
if (!f)
|
|
67
|
+
return null;
|
|
68
|
+
const v = c !== void 0 ? c : S(d);
|
|
69
|
+
return /* @__PURE__ */ e(i.Provider, { value: y, children: /* @__PURE__ */ p(
|
|
47
70
|
"div",
|
|
48
71
|
{
|
|
49
|
-
ref:
|
|
72
|
+
ref: A,
|
|
50
73
|
"data-slot": "alert",
|
|
51
74
|
role: "alert",
|
|
52
|
-
className: s(
|
|
53
|
-
...
|
|
75
|
+
className: s(D({ variant: d }), r),
|
|
76
|
+
...w,
|
|
54
77
|
children: [
|
|
55
|
-
l && /* @__PURE__ */
|
|
56
|
-
|
|
78
|
+
l && /* @__PURE__ */ e(b, {}),
|
|
79
|
+
v && /* @__PURE__ */ e("span", { "data-slot": "alert-icon", className: j(), children: v }),
|
|
80
|
+
g
|
|
57
81
|
]
|
|
58
82
|
}
|
|
59
|
-
) })
|
|
83
|
+
) });
|
|
60
84
|
}
|
|
61
85
|
);
|
|
62
|
-
|
|
63
|
-
const
|
|
64
|
-
default: "text-
|
|
65
|
-
secondary: "text-
|
|
86
|
+
T.displayName = "Alert";
|
|
87
|
+
const B = {
|
|
88
|
+
default: "text-info-foreground",
|
|
89
|
+
secondary: "text-info-foreground",
|
|
66
90
|
warning: "text-warning-foreground",
|
|
67
91
|
error: "text-destructive-foreground"
|
|
68
|
-
},
|
|
69
|
-
({ className:
|
|
70
|
-
const { variant:
|
|
71
|
-
return /* @__PURE__ */
|
|
92
|
+
}, P = n(
|
|
93
|
+
({ className: r, ...t }, a) => {
|
|
94
|
+
const { variant: o } = u(i);
|
|
95
|
+
return /* @__PURE__ */ e(
|
|
72
96
|
"div",
|
|
73
97
|
{
|
|
74
|
-
ref:
|
|
98
|
+
ref: a,
|
|
75
99
|
"data-slot": "alert-title",
|
|
76
100
|
className: s(
|
|
77
|
-
"text-base font-medium leading-5 tracking-tightest",
|
|
78
|
-
|
|
79
|
-
|
|
101
|
+
"col-start-2 text-base font-medium leading-5 tracking-tightest",
|
|
102
|
+
B[o],
|
|
103
|
+
r
|
|
80
104
|
),
|
|
81
|
-
...
|
|
105
|
+
...t
|
|
82
106
|
}
|
|
83
107
|
);
|
|
84
108
|
}
|
|
85
109
|
);
|
|
86
|
-
|
|
87
|
-
const
|
|
88
|
-
default: "text-
|
|
110
|
+
P.displayName = "AlertTitle";
|
|
111
|
+
const H = {
|
|
112
|
+
default: "text-foreground",
|
|
89
113
|
secondary: "text-foreground",
|
|
90
|
-
warning: "text-
|
|
114
|
+
warning: "text-foreground",
|
|
91
115
|
error: "text-foreground"
|
|
92
|
-
},
|
|
93
|
-
({ className:
|
|
94
|
-
const { variant:
|
|
95
|
-
return /* @__PURE__ */
|
|
116
|
+
}, M = n(
|
|
117
|
+
({ className: r, ...t }, a) => {
|
|
118
|
+
const { variant: o } = u(i);
|
|
119
|
+
return /* @__PURE__ */ e(
|
|
96
120
|
"div",
|
|
97
121
|
{
|
|
98
|
-
ref:
|
|
122
|
+
ref: a,
|
|
99
123
|
"data-slot": "alert-description",
|
|
100
124
|
className: s(
|
|
101
125
|
"col-start-2 grid justify-items-start gap-1 text-sm font-normal leading-4.5 tracking-tight items-center",
|
|
102
|
-
|
|
103
|
-
|
|
126
|
+
H[o],
|
|
127
|
+
r
|
|
104
128
|
),
|
|
105
|
-
...
|
|
129
|
+
...t
|
|
106
130
|
}
|
|
107
131
|
);
|
|
108
132
|
}
|
|
109
133
|
);
|
|
110
|
-
|
|
111
|
-
const
|
|
112
|
-
({ className:
|
|
134
|
+
M.displayName = "AlertDescription";
|
|
135
|
+
const R = n(
|
|
136
|
+
({ className: r, ...t }, a) => /* @__PURE__ */ e(
|
|
113
137
|
"div",
|
|
114
138
|
{
|
|
115
|
-
ref:
|
|
139
|
+
ref: a,
|
|
116
140
|
"data-slot": "alert-actions",
|
|
117
141
|
className: s(
|
|
118
142
|
"col-start-2 flex flex-wrap items-start gap-2 pt-1",
|
|
119
|
-
|
|
143
|
+
r
|
|
120
144
|
),
|
|
121
|
-
...
|
|
145
|
+
...t
|
|
122
146
|
}
|
|
123
147
|
)
|
|
124
148
|
);
|
|
125
|
-
|
|
126
|
-
const
|
|
127
|
-
const { variant:
|
|
128
|
-
return /* @__PURE__ */
|
|
129
|
-
|
|
149
|
+
R.displayName = "AlertActions";
|
|
150
|
+
const X = n(({ className: r, ...t }, a) => {
|
|
151
|
+
const { variant: o } = u(i);
|
|
152
|
+
return /* @__PURE__ */ e(
|
|
153
|
+
x,
|
|
130
154
|
{
|
|
131
|
-
ref:
|
|
155
|
+
ref: a,
|
|
132
156
|
"data-slot": "alert-button",
|
|
133
157
|
variant: "ghost",
|
|
134
158
|
size: "sm",
|
|
135
159
|
className: s("text-foreground", {
|
|
136
|
-
default: "hover:bg-
|
|
137
|
-
secondary: "hover:bg-
|
|
138
|
-
warning: "hover:bg-warning-hover",
|
|
139
|
-
error: "hover:bg-destructive-hover"
|
|
140
|
-
}[
|
|
141
|
-
...
|
|
160
|
+
default: "hover:bg-neutral-background-hover",
|
|
161
|
+
secondary: "hover:bg-info-background-hover",
|
|
162
|
+
warning: "hover:bg-warning-background-hover",
|
|
163
|
+
error: "hover:bg-destructive-background-hover"
|
|
164
|
+
}[o], r),
|
|
165
|
+
...t
|
|
142
166
|
}
|
|
143
167
|
);
|
|
144
168
|
});
|
|
145
|
-
|
|
146
|
-
const
|
|
147
|
-
({ className:
|
|
148
|
-
const { setShow: l } =
|
|
149
|
-
l(!1),
|
|
169
|
+
X.displayName = "AlertButton";
|
|
170
|
+
const b = n(
|
|
171
|
+
({ className: r, onClick: t, ...a }, o) => {
|
|
172
|
+
const { setShow: l } = u(i), c = (g) => {
|
|
173
|
+
l(!1), t?.(g);
|
|
150
174
|
};
|
|
151
|
-
return /* @__PURE__ */
|
|
152
|
-
|
|
175
|
+
return /* @__PURE__ */ p(
|
|
176
|
+
x,
|
|
153
177
|
{
|
|
154
|
-
ref:
|
|
178
|
+
ref: o,
|
|
155
179
|
"data-slot": "alert-close",
|
|
156
180
|
variant: "ghost",
|
|
157
181
|
size: "icon-sm",
|
|
158
182
|
className: s(
|
|
159
183
|
"absolute top-3 right-4 h-3.5 w-3.5 p-0 opacity-70 hover:opacity-100 text-foreground",
|
|
160
|
-
|
|
184
|
+
r
|
|
161
185
|
),
|
|
162
186
|
onClick: c,
|
|
163
|
-
...
|
|
187
|
+
...a,
|
|
164
188
|
children: [
|
|
165
|
-
/* @__PURE__ */
|
|
166
|
-
/* @__PURE__ */
|
|
189
|
+
/* @__PURE__ */ e(C, { size: 14 }),
|
|
190
|
+
/* @__PURE__ */ e("span", { className: "sr-only", children: "Close" })
|
|
167
191
|
]
|
|
168
192
|
}
|
|
169
193
|
);
|
|
170
194
|
}
|
|
171
195
|
);
|
|
172
|
-
|
|
196
|
+
b.displayName = "AlertClose";
|
|
173
197
|
export {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
198
|
+
T as Alert,
|
|
199
|
+
R as AlertActions,
|
|
200
|
+
X as AlertButton,
|
|
201
|
+
b as AlertClose,
|
|
202
|
+
M as AlertDescription,
|
|
203
|
+
P as AlertTitle
|
|
180
204
|
};
|
|
@@ -2,7 +2,7 @@ const e = {
|
|
|
2
2
|
name: "Alert",
|
|
3
3
|
status: "in-progress-code-review",
|
|
4
4
|
description: "A dismissible alert component with multiple variants for displaying messages.",
|
|
5
|
-
llmUsage: "Use `<Alert>` with `<AlertTitle>` and `<AlertDescription
|
|
5
|
+
llmUsage: "Use `<Alert>` with optional `icon` prop (defaults to a variant-appropriate icon), plus `<AlertTitle>` and `<AlertDescription>`, for informational messages. Pass `icon={null}` to suppress the icon."
|
|
6
6
|
};
|
|
7
7
|
export {
|
|
8
8
|
e as AlertMetadata
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
1
|
+
import { jsx as o, jsxs as i, Fragment as v } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as t } from "react";
|
|
3
3
|
import { Avatar as n } from "@base-ui/react/avatar";
|
|
4
4
|
import { cva as g } from "class-variance-authority";
|
|
5
5
|
import { cn as d } from "../../../../lib/utils.js";
|
|
6
6
|
const u = g(
|
|
7
|
-
"group/avatar relative inline-flex text-base font-medium leading-5 shrink-0 overflow-hidden
|
|
7
|
+
"group/avatar relative inline-flex text-base font-medium leading-5 shrink-0 overflow-hidden flex-col justify-center items-center box-border",
|
|
8
8
|
{
|
|
9
9
|
variants: {
|
|
10
10
|
variant: {
|
|
11
|
-
default: "bg-decorative-background
|
|
12
|
-
nordic: "bg-decorative-background
|
|
13
|
-
aurora: "bg-decorative-background
|
|
14
|
-
fjord: "bg-decorative-background
|
|
15
|
-
dusk: "bg-decorative-background
|
|
16
|
-
orange: "bg-decorative-background
|
|
17
|
-
sky: "bg-decorative-background
|
|
18
|
-
overflow: "bg-secondary text-secondary-foreground hover:bg-secondary-hover"
|
|
11
|
+
default: "bg-decorative-mountain-background text-decorative-mountain-foreground hover:bg-decorative-mountain-background-hover",
|
|
12
|
+
nordic: "bg-decorative-nordic-background text-decorative-nordic-foreground hover:bg-background-hover",
|
|
13
|
+
aurora: "bg-decorative-aurora-background text-decorative-aurora-foreground hover:bg-decorative-aurora-background-hover",
|
|
14
|
+
fjord: "bg-decorative-fjord-background text-decorative-fjord-foreground hover:bg-decorative-fjord-background-hover",
|
|
15
|
+
dusk: "bg-decorative-dusk-background text-decorative-dusk-foreground hover:bg-decorative-dusk-background-hover",
|
|
16
|
+
orange: "bg-decorative-orange-background text-decorative-orange-foreground hover:bg-decorative-orange-background-hover",
|
|
17
|
+
sky: "bg-decorative-sky-background text-decorative-sky-foreground hover:bg-decorative-sky-background-hover",
|
|
18
|
+
overflow: "bg-secondary-background text-secondary-foreground hover:bg-secondary-background-hover"
|
|
19
19
|
},
|
|
20
20
|
sizes: {
|
|
21
|
-
default: "size-9 text-sm [&_svg]:w-5 [&_svg]:h-5",
|
|
22
|
-
xsm: "size-7 text-xs [&_svg]:w-4 [&_svg]:h-4",
|
|
23
|
-
xxsm: "size-5 text-2xs [&_svg]:w-3 [&_svg]:h-3"
|
|
21
|
+
default: "size-9 rounded-lg text-sm [&_svg]:w-5 [&_svg]:h-5",
|
|
22
|
+
xsm: "size-7 rounded-md text-xs [&_svg]:w-4 [&_svg]:h-4",
|
|
23
|
+
xxsm: "size-5 rounded-sm text-2xs [&_svg]:w-3 [&_svg]:h-3"
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
defaultVariants: {
|
|
@@ -28,23 +28,26 @@ const u = g(
|
|
|
28
28
|
sizes: "default"
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
), l = t(({ className: a, variant: e, sizes: r, ...s },
|
|
31
|
+
), l = t(({ className: a, variant: e, sizes: r, ...s }, c) => /* @__PURE__ */ o(
|
|
32
32
|
n.Root,
|
|
33
33
|
{
|
|
34
|
-
ref:
|
|
34
|
+
ref: c,
|
|
35
35
|
"data-slot": "avatar",
|
|
36
36
|
className: d(u({ variant: e, sizes: r }), a),
|
|
37
37
|
...s
|
|
38
38
|
}
|
|
39
39
|
));
|
|
40
40
|
l.displayName = "Avatar";
|
|
41
|
-
const b = t(({ className: a, ...e }, r) => /* @__PURE__ */
|
|
41
|
+
const b = t(({ className: a, ...e }, r) => /* @__PURE__ */ i(v, { children: [
|
|
42
42
|
/* @__PURE__ */ o(
|
|
43
43
|
n.Image,
|
|
44
44
|
{
|
|
45
45
|
ref: r,
|
|
46
46
|
"data-slot": "avatar-image",
|
|
47
|
-
className: d(
|
|
47
|
+
className: d(
|
|
48
|
+
"aspect-square size-full object-cover object-center",
|
|
49
|
+
a
|
|
50
|
+
),
|
|
48
51
|
...e
|
|
49
52
|
}
|
|
50
53
|
),
|
|
@@ -52,43 +55,37 @@ const b = t(({ className: a, ...e }, r) => /* @__PURE__ */ c(v, { children: [
|
|
|
52
55
|
"span",
|
|
53
56
|
{
|
|
54
57
|
"data-slot": "avatar-image-backdrop",
|
|
55
|
-
className: "absolute inset-0 bg-
|
|
58
|
+
className: "absolute inset-0 bg-overlay-background opacity-0 transition-opacity group-hover/avatar:opacity-100 pointer-events-none",
|
|
56
59
|
"aria-hidden": "true"
|
|
57
60
|
}
|
|
58
61
|
)
|
|
59
62
|
] }));
|
|
60
63
|
b.displayName = "AvatarImage";
|
|
61
|
-
const
|
|
64
|
+
const f = t(({ className: a, ...e }, r) => /* @__PURE__ */ o(
|
|
62
65
|
n.Fallback,
|
|
63
66
|
{
|
|
64
67
|
ref: r,
|
|
65
68
|
"data-slot": "avatar-fallback",
|
|
66
|
-
className: d(
|
|
67
|
-
" flex size-full items-center justify-center rounded-md",
|
|
68
|
-
a
|
|
69
|
-
),
|
|
69
|
+
className: d(" flex size-full items-center justify-center", a),
|
|
70
70
|
...e
|
|
71
71
|
}
|
|
72
72
|
));
|
|
73
|
-
|
|
74
|
-
const
|
|
73
|
+
f.displayName = "AvatarFallback";
|
|
74
|
+
const m = t(
|
|
75
75
|
({ className: a, ...e }, r) => /* @__PURE__ */ o(
|
|
76
76
|
"span",
|
|
77
77
|
{
|
|
78
78
|
ref: r,
|
|
79
79
|
"data-slot": "avatar-icon",
|
|
80
|
-
className: d(
|
|
81
|
-
"flex size-full items-center justify-center rounded-md",
|
|
82
|
-
a
|
|
83
|
-
),
|
|
80
|
+
className: d("flex size-full items-center justify-center", a),
|
|
84
81
|
...e
|
|
85
82
|
}
|
|
86
83
|
)
|
|
87
84
|
);
|
|
88
|
-
|
|
85
|
+
m.displayName = "AvatarIcon";
|
|
89
86
|
export {
|
|
90
87
|
l as Avatar,
|
|
91
|
-
|
|
92
|
-
|
|
88
|
+
f as AvatarFallback,
|
|
89
|
+
m as AvatarIcon,
|
|
93
90
|
b as AvatarImage
|
|
94
91
|
};
|
|
@@ -2,7 +2,7 @@ import { useRender } from '@base-ui/react/use-render';
|
|
|
2
2
|
import { VariantProps } from 'class-variance-authority';
|
|
3
3
|
declare const badgeVariants: (props?: ({
|
|
4
4
|
variant?: "default" | "secondary" | "gray" | "orange" | "nordic" | "aurora" | "fjord" | "dusk" | "sky" | "mountain" | "error" | "warning" | "success" | "inProgress" | "archived" | "closable" | null | undefined;
|
|
5
|
-
size?: "
|
|
5
|
+
size?: "icon" | "default" | null | undefined;
|
|
6
6
|
outline?: boolean | null | undefined;
|
|
7
7
|
background?: boolean | null | undefined;
|
|
8
8
|
dot?: boolean | null | undefined;
|