@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
|
@@ -4,30 +4,30 @@ import { useRender as v } from "@base-ui/react/use-render";
|
|
|
4
4
|
import { cva as m } from "class-variance-authority";
|
|
5
5
|
import { cn as x } from "../../../../lib/utils.js";
|
|
6
6
|
const k = m(
|
|
7
|
-
"inline-flex items-center align-middle justify-center rounded-md border text-
|
|
7
|
+
"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-shadow 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
8
|
{
|
|
9
9
|
variants: {
|
|
10
10
|
variant: {
|
|
11
|
-
default: "border-transparent bg-
|
|
12
|
-
fjord: "border-transparent bg-decorative-background
|
|
13
|
-
nordic: "border-transparent bg-decorative-background
|
|
14
|
-
aurora: "border-transparent bg-decorative-background
|
|
15
|
-
sky: "border-transparent bg-decorative-background
|
|
16
|
-
dusk: "border-transparent bg-decorative-background
|
|
17
|
-
orange: "border-transparent bg-decorative-background
|
|
18
|
-
gray: "border-transparent bg-decorative-background
|
|
19
|
-
mountain: "border-transparent bg-decorative-background
|
|
20
|
-
secondary: "border-transparent bg-secondary text-secondary-foreground
|
|
21
|
-
error: "border-transparent bg-destructive text-destructive-foreground-
|
|
22
|
-
warning: "border-transparent bg-warning text-warning-foreground-
|
|
23
|
-
success: "border-transparent bg-success text-success-foreground-
|
|
24
|
-
inProgress: "border-transparent bg-
|
|
25
|
-
archived: "border-transparent bg-
|
|
26
|
-
closable: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary-hover cursor-pointer"
|
|
11
|
+
default: "border-transparent bg-neutral-background text-foreground-on-neutral",
|
|
12
|
+
fjord: "border-transparent bg-decorative-fjord-background text-decorative-fjord-foreground",
|
|
13
|
+
nordic: "border-transparent bg-decorative-nordic-background text-decorative-nordic-foreground",
|
|
14
|
+
aurora: "border-transparent bg-decorative-aurora-background text-decorative-aurora-foreground",
|
|
15
|
+
sky: "border-transparent bg-decorative-sky-background text-decorative-sky-foreground",
|
|
16
|
+
dusk: "border-transparent bg-decorative-dusk-background text-decorative-dusk-foreground",
|
|
17
|
+
orange: "border-transparent bg-decorative-orange-background text-decorative-orange-foreground",
|
|
18
|
+
gray: "border-transparent bg-decorative-mountain-background text-decorative-mountain-foreground",
|
|
19
|
+
mountain: "border-transparent bg-decorative-mountain-background text-decorative-mountain-foreground",
|
|
20
|
+
secondary: "border-transparent bg-secondary-background text-secondary-foreground",
|
|
21
|
+
error: "border-transparent bg-destructive-background text-destructive-foreground-on-critical",
|
|
22
|
+
warning: "border-transparent bg-warning-background text-warning-foreground-on-warning",
|
|
23
|
+
success: "border-transparent bg-success-background text-success-foreground-on-success",
|
|
24
|
+
inProgress: "border-transparent bg-info-background text-info-foreground-on-info",
|
|
25
|
+
archived: "border-transparent bg-neutral-background text-neutral-foreground-on-neutral",
|
|
26
|
+
closable: "border-transparent bg-secondary-background text-secondary-foreground hover:bg-secondary-background-hover cursor-pointer"
|
|
27
27
|
},
|
|
28
28
|
size: {
|
|
29
|
-
default: "
|
|
30
|
-
icon: "
|
|
29
|
+
default: "",
|
|
30
|
+
icon: "w-5 px-0 py-0"
|
|
31
31
|
},
|
|
32
32
|
outline: {
|
|
33
33
|
true: "border-border"
|
|
@@ -36,16 +36,9 @@ const k = m(
|
|
|
36
36
|
false: "bg-transparent"
|
|
37
37
|
},
|
|
38
38
|
dot: {
|
|
39
|
-
true: "rounded-
|
|
39
|
+
true: "min-w-5 rounded-md border border-background px-1 gap-0"
|
|
40
40
|
}
|
|
41
41
|
},
|
|
42
|
-
compoundVariants: [
|
|
43
|
-
{
|
|
44
|
-
outline: !0,
|
|
45
|
-
size: "default",
|
|
46
|
-
className: "px-1.5"
|
|
47
|
-
}
|
|
48
|
-
],
|
|
49
42
|
defaultVariants: {
|
|
50
43
|
variant: "default",
|
|
51
44
|
size: "default",
|
|
@@ -54,54 +47,53 @@ const k = m(
|
|
|
54
47
|
dot: !1
|
|
55
48
|
}
|
|
56
49
|
}
|
|
57
|
-
),
|
|
50
|
+
), w = l(
|
|
58
51
|
({
|
|
59
|
-
className:
|
|
52
|
+
className: t,
|
|
60
53
|
variant: r,
|
|
61
|
-
size:
|
|
62
|
-
outline:
|
|
54
|
+
size: a,
|
|
55
|
+
outline: d,
|
|
63
56
|
dot: o,
|
|
64
|
-
background:
|
|
65
|
-
urgent:
|
|
66
|
-
children:
|
|
67
|
-
render:
|
|
68
|
-
...
|
|
69
|
-
},
|
|
70
|
-
const
|
|
57
|
+
background: i,
|
|
58
|
+
urgent: s = !1,
|
|
59
|
+
children: n,
|
|
60
|
+
render: u,
|
|
61
|
+
...g
|
|
62
|
+
}, c) => {
|
|
63
|
+
const b = !n, f = r && !(/* @__PURE__ */ new Set([
|
|
71
64
|
"mountain",
|
|
72
65
|
"fjord",
|
|
73
66
|
"nordic",
|
|
74
67
|
"aurora",
|
|
75
68
|
"dusk",
|
|
76
69
|
"orange"
|
|
77
|
-
])).has(r), e =
|
|
70
|
+
])).has(r), e = d === !0 && f;
|
|
78
71
|
return v({
|
|
79
72
|
defaultTagName: "span",
|
|
80
|
-
ref:
|
|
73
|
+
ref: c,
|
|
81
74
|
props: p(
|
|
82
75
|
{
|
|
83
76
|
className: x(
|
|
84
77
|
k({
|
|
85
78
|
variant: r,
|
|
86
|
-
size:
|
|
79
|
+
size: a,
|
|
87
80
|
outline: e,
|
|
88
|
-
background: e ? !1 :
|
|
81
|
+
background: e ? !1 : i,
|
|
89
82
|
dot: o
|
|
90
83
|
}),
|
|
91
84
|
e && r === "error" && "text-destructive-foreground",
|
|
92
85
|
e && r === "warning" && "text-warning-foreground",
|
|
93
86
|
e && r === "success" && "text-success-foreground",
|
|
94
|
-
e && r === "inProgress" && "text-
|
|
95
|
-
e && r === "archived" && "text-
|
|
96
|
-
o &&
|
|
97
|
-
o &&
|
|
98
|
-
|
|
99
|
-
d
|
|
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
|
|
100
92
|
)
|
|
101
93
|
},
|
|
102
|
-
{ ...
|
|
94
|
+
{ ...g, children: n }
|
|
103
95
|
),
|
|
104
|
-
render:
|
|
96
|
+
render: u,
|
|
105
97
|
state: {
|
|
106
98
|
slot: "badge",
|
|
107
99
|
variant: r
|
|
@@ -109,8 +101,8 @@ const k = m(
|
|
|
109
101
|
});
|
|
110
102
|
}
|
|
111
103
|
);
|
|
112
|
-
|
|
104
|
+
w.displayName = "Badge";
|
|
113
105
|
export {
|
|
114
|
-
|
|
106
|
+
w as Badge,
|
|
115
107
|
k as badgeVariants
|
|
116
108
|
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ComponentProps, ComponentType, HTMLAttributes } from 'react';
|
|
2
|
+
import { IconProps } from '@tabler/icons-react';
|
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
|
4
|
+
import { Button } from '../button/button';
|
|
5
|
+
declare const Banner: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & VariantProps<(props?: ({
|
|
6
|
+
variant?: "default" | "destructive" | "warning" | "info" | null | undefined;
|
|
7
|
+
inset?: boolean | null | undefined;
|
|
8
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string> & {
|
|
9
|
+
visible?: boolean;
|
|
10
|
+
defaultVisible?: boolean;
|
|
11
|
+
onClose?: () => void;
|
|
12
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
13
|
+
type TablerIconComponent = ComponentType<IconProps>;
|
|
14
|
+
declare const BannerIcon: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
15
|
+
icon: TablerIconComponent;
|
|
16
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
17
|
+
type BannerTitleProps = HTMLAttributes<HTMLParagraphElement>;
|
|
18
|
+
declare const BannerTitle: import('react').ForwardRefExoticComponent<BannerTitleProps & import('react').RefAttributes<HTMLParagraphElement>>;
|
|
19
|
+
declare const BannerStatus: import('react').ForwardRefExoticComponent<Omit<Omit<Omit<import('react').DetailedHTMLProps<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
20
|
+
ref?: ((instance: HTMLSpanElement | null) => void | import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import('react').RefObject<HTMLSpanElement> | null | undefined;
|
|
21
|
+
} & {
|
|
22
|
+
render?: import('react').ReactElement<any, string | import('react').JSXElementConstructor<any>> | import('@base-ui/react').ComponentRenderFn<import('@base-ui/react').HTMLProps, {}> | undefined;
|
|
23
|
+
} & VariantProps<(props?: ({
|
|
24
|
+
variant?: "default" | "secondary" | "gray" | "orange" | "nordic" | "aurora" | "fjord" | "dusk" | "sky" | "mountain" | "error" | "warning" | "success" | "inProgress" | "archived" | "closable" | null | undefined;
|
|
25
|
+
size?: "icon" | "default" | null | undefined;
|
|
26
|
+
outline?: boolean | null | undefined;
|
|
27
|
+
background?: boolean | null | undefined;
|
|
28
|
+
dot?: boolean | null | undefined;
|
|
29
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string> & {
|
|
30
|
+
urgent?: boolean;
|
|
31
|
+
}, "ref"> & import('react').RefAttributes<HTMLSpanElement>, "ref"> & import('react').RefAttributes<HTMLSpanElement>>;
|
|
32
|
+
type BannerActionsProps = HTMLAttributes<HTMLDivElement>;
|
|
33
|
+
declare const BannerActions: import('react').ForwardRefExoticComponent<BannerActionsProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
34
|
+
declare const BannerAction: import('react').ForwardRefExoticComponent<Omit<Omit<import('@base-ui/react').ButtonProps & VariantProps<(props?: ({
|
|
35
|
+
variant?: "default" | "secondary" | "outline" | "ghost" | "destructive" | null | undefined;
|
|
36
|
+
size?: "icon" | "default" | "sm" | "lg" | "icon-sm" | "icon-lg" | null | undefined;
|
|
37
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string>, "ref"> & import('react').RefAttributes<HTMLElement>, "ref"> & import('react').RefAttributes<HTMLElement>>;
|
|
38
|
+
type BannerCloseProps = Omit<ComponentProps<typeof Button>, 'size'>;
|
|
39
|
+
declare const BannerClose: import('react').ForwardRefExoticComponent<Omit<BannerCloseProps, "ref"> & import('react').RefAttributes<HTMLElement>>;
|
|
40
|
+
export { Banner, BannerIcon, BannerTitle, BannerStatus, BannerActions, BannerAction, BannerClose, };
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as k, forwardRef as l, useMemo as w, useContext as b, useState as B, useRef as N, useEffect as y, useCallback as C } from "react";
|
|
3
|
+
import { cva as V } from "class-variance-authority";
|
|
4
|
+
import { cn as u } from "../../../../lib/utils.js";
|
|
5
|
+
import { Badge as S } from "../badge/badge.js";
|
|
6
|
+
import { Button as A } from "../button/button.js";
|
|
7
|
+
const R = (e) => {
|
|
8
|
+
}, m = k({
|
|
9
|
+
show: !0,
|
|
10
|
+
setShow: R,
|
|
11
|
+
variant: "default"
|
|
12
|
+
});
|
|
13
|
+
function p(e) {
|
|
14
|
+
return typeof e == "function";
|
|
15
|
+
}
|
|
16
|
+
function j({
|
|
17
|
+
visible: e,
|
|
18
|
+
defaultVisible: t,
|
|
19
|
+
onClose: n
|
|
20
|
+
}) {
|
|
21
|
+
const [r, a] = B(t), i = e !== void 0, g = i ? e : r, d = N(n);
|
|
22
|
+
y(() => {
|
|
23
|
+
d.current = n;
|
|
24
|
+
}, [n]);
|
|
25
|
+
const x = C(
|
|
26
|
+
(o) => {
|
|
27
|
+
if (i) {
|
|
28
|
+
(p(o) ? o(e) : o) || d.current?.();
|
|
29
|
+
return;
|
|
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];
|
|
39
|
+
}
|
|
40
|
+
const I = V(
|
|
41
|
+
"flex w-full h-11 flex-col items-start justify-center px-3 py-0",
|
|
42
|
+
{
|
|
43
|
+
variants: {
|
|
44
|
+
variant: {
|
|
45
|
+
default: "bg-neutral-background text-foreground-fixed-dark",
|
|
46
|
+
info: "bg-info-background text-foreground-fixed-dark",
|
|
47
|
+
warning: "bg-warning-background text-foreground-fixed-dark",
|
|
48
|
+
destructive: "bg-destructive-background text-foreground-fixed-dark"
|
|
49
|
+
},
|
|
50
|
+
inset: {
|
|
51
|
+
true: "rounded-lg",
|
|
52
|
+
false: ""
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
defaultVariants: {
|
|
56
|
+
variant: "default",
|
|
57
|
+
inset: !1
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
), M = l(
|
|
61
|
+
({
|
|
62
|
+
children: e,
|
|
63
|
+
visible: t,
|
|
64
|
+
defaultVisible: n = !0,
|
|
65
|
+
onClose: r,
|
|
66
|
+
className: a,
|
|
67
|
+
inset: i = !1,
|
|
68
|
+
variant: g = "default",
|
|
69
|
+
...d
|
|
70
|
+
}, x) => {
|
|
71
|
+
const o = g ?? "default", [c, f] = j({
|
|
72
|
+
defaultVisible: n,
|
|
73
|
+
visible: t,
|
|
74
|
+
onClose: r
|
|
75
|
+
}), h = w(
|
|
76
|
+
() => ({ show: c ?? !0, setShow: f, variant: o }),
|
|
77
|
+
[c, f, o]
|
|
78
|
+
);
|
|
79
|
+
return c ? /* @__PURE__ */ s(m.Provider, { value: h, children: /* @__PURE__ */ s(
|
|
80
|
+
"div",
|
|
81
|
+
{
|
|
82
|
+
ref: x,
|
|
83
|
+
"data-slot": "banner",
|
|
84
|
+
className: u(
|
|
85
|
+
I({ variant: o, inset: i }),
|
|
86
|
+
a
|
|
87
|
+
),
|
|
88
|
+
...d,
|
|
89
|
+
children: /* @__PURE__ */ s(
|
|
90
|
+
"div",
|
|
91
|
+
{
|
|
92
|
+
"data-slot": "banner-content",
|
|
93
|
+
className: "flex h-7 w-full items-center self-stretch gap-2",
|
|
94
|
+
children: e
|
|
95
|
+
}
|
|
96
|
+
)
|
|
97
|
+
}
|
|
98
|
+
) }) : null;
|
|
99
|
+
}
|
|
100
|
+
);
|
|
101
|
+
M.displayName = "Banner";
|
|
102
|
+
const O = {
|
|
103
|
+
default: "text-neutral-foreground-on-neutral",
|
|
104
|
+
info: "text-info-foreground-on-info",
|
|
105
|
+
warning: "text-warning-foreground-on-warning",
|
|
106
|
+
destructive: "text-destructive-foreground-on-critical"
|
|
107
|
+
}, _ = l(
|
|
108
|
+
({ icon: e, className: t, ...n }, r) => {
|
|
109
|
+
const { variant: a } = b(m);
|
|
110
|
+
return /* @__PURE__ */ s(
|
|
111
|
+
"div",
|
|
112
|
+
{
|
|
113
|
+
ref: r,
|
|
114
|
+
"data-slot": "banner-icon",
|
|
115
|
+
className: u(
|
|
116
|
+
"flex h-4 w-4 shrink-0 items-center justify-center",
|
|
117
|
+
O[a],
|
|
118
|
+
t
|
|
119
|
+
),
|
|
120
|
+
...n,
|
|
121
|
+
children: /* @__PURE__ */ s(e, { size: 16 })
|
|
122
|
+
}
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
);
|
|
126
|
+
_.displayName = "BannerIcon";
|
|
127
|
+
const E = l(
|
|
128
|
+
({ className: e, ...t }, n) => /* @__PURE__ */ s(
|
|
129
|
+
"p",
|
|
130
|
+
{
|
|
131
|
+
ref: n,
|
|
132
|
+
"data-slot": "banner-title",
|
|
133
|
+
className: u(
|
|
134
|
+
"flex min-w-0 flex-1 items-center text-base font-medium leading-5 tracking-tighter text-foreground-fixed-dark",
|
|
135
|
+
e
|
|
136
|
+
),
|
|
137
|
+
...t
|
|
138
|
+
}
|
|
139
|
+
)
|
|
140
|
+
);
|
|
141
|
+
E.displayName = "BannerTitle";
|
|
142
|
+
const L = l(
|
|
143
|
+
({ outline: e = !0, variant: t, className: n, ...r }, a) => {
|
|
144
|
+
const { variant: i } = b(m), d = t ?? {
|
|
145
|
+
default: "default",
|
|
146
|
+
info: "inProgress",
|
|
147
|
+
destructive: "error",
|
|
148
|
+
warning: "warning"
|
|
149
|
+
}[i];
|
|
150
|
+
return /* @__PURE__ */ s(
|
|
151
|
+
S,
|
|
152
|
+
{
|
|
153
|
+
ref: a,
|
|
154
|
+
"data-slot": "banner-status",
|
|
155
|
+
outline: e,
|
|
156
|
+
variant: d,
|
|
157
|
+
className: u("shrink-0", n),
|
|
158
|
+
...r
|
|
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
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const n = {
|
|
2
|
+
name: "Banner",
|
|
3
|
+
status: "in-progress-code-review",
|
|
4
|
+
description: "A configurable banner for important inline messages with variant styling, optional status badge, and action controls.",
|
|
5
|
+
llmUsage: "Use `<Banner>` with `<BannerIcon>`, `<BannerTitle>`, optional `<BannerStatus>`, and `<BannerActions>` containing `<BannerAction>` or `<BannerClose>`."
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
n as BannerMetadata
|
|
9
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Button as ButtonPrimitive } from '@base-ui/react/button';
|
|
2
2
|
import { VariantProps } from 'class-variance-authority';
|
|
3
3
|
declare const buttonVariants: (props?: ({
|
|
4
|
-
variant?: "
|
|
5
|
-
size?: "
|
|
4
|
+
variant?: "default" | "secondary" | "outline" | "ghost" | "destructive" | null | undefined;
|
|
5
|
+
size?: "icon" | "default" | "sm" | "lg" | "icon-sm" | "icon-lg" | null | undefined;
|
|
6
6
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
7
|
type ButtonProps = ButtonPrimitive.Props & VariantProps<typeof buttonVariants>;
|
|
8
8
|
declare const Button: import('react').ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & import('react').RefAttributes<HTMLElement>>;
|
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
import { jsx as d } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { Button as
|
|
4
|
-
import { cva as
|
|
5
|
-
import { focusRing as
|
|
6
|
-
const p =
|
|
7
|
-
`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-
|
|
2
|
+
import { forwardRef as c } from "react";
|
|
3
|
+
import { Button as u } from "@base-ui/react/button";
|
|
4
|
+
import { cva as g } from "class-variance-authority";
|
|
5
|
+
import { focusRing as b, focusRingDestructive as v, cn as l } from "../../../../lib/utils.js";
|
|
6
|
+
const p = g(
|
|
7
|
+
`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-lg text-sm leading-4.5 tracking-normal font-medium transition-all cursor-pointer disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 ${b} aria-invalid:focus-visible:shadow-focus-ring-destructive`,
|
|
8
8
|
{
|
|
9
9
|
variants: {
|
|
10
10
|
variant: {
|
|
11
|
-
default: "bg-primary text-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
link: "text-foreground-link underline-offset-4 hover:underline"
|
|
11
|
+
default: "bg-primary-background text-foreground-on-primary hover:bg-primary-background-hover",
|
|
12
|
+
secondary: "bg-secondary-background text-secondary-foreground hover:bg-secondary-background-hover",
|
|
13
|
+
outline: "border border-border-emphasized bg-background text-foreground hover:bg-accent-background disabled:border-transparent disabled:bg-disabled-background",
|
|
14
|
+
ghost: "hover:bg-accent-background",
|
|
15
|
+
destructive: `bg-destructive-background text-destructive-foreground-on-critical hover:bg-destructive-background-hover ${v}`
|
|
17
16
|
},
|
|
18
17
|
size: {
|
|
19
|
-
default: "h-9 px-3
|
|
20
|
-
sm: "h-7 rounded-
|
|
18
|
+
default: "h-9 px-3 has-[>svg]:px-3",
|
|
19
|
+
sm: "h-7 rounded-md gap-1.5 px-2 has-[>svg]:px-2",
|
|
21
20
|
lg: "h-10 px-4 has-[>svg]:px-4",
|
|
22
21
|
icon: "size-9",
|
|
23
22
|
"icon-sm": "size-7",
|
|
@@ -29,17 +28,17 @@ const p = u(
|
|
|
29
28
|
size: "default"
|
|
30
29
|
}
|
|
31
30
|
}
|
|
32
|
-
), f =
|
|
33
|
-
({ className: r, variant:
|
|
34
|
-
|
|
31
|
+
), f = c(
|
|
32
|
+
({ className: r, variant: o, size: t, children: a, render: e, nativeButton: n, ...s }, i) => /* @__PURE__ */ d(
|
|
33
|
+
u,
|
|
35
34
|
{
|
|
36
35
|
ref: i,
|
|
37
36
|
"data-slot": "button",
|
|
38
37
|
render: e,
|
|
39
|
-
nativeButton:
|
|
40
|
-
className:
|
|
38
|
+
nativeButton: n ?? (e ? !1 : void 0),
|
|
39
|
+
className: l(p({ variant: o, size: t, className: r })),
|
|
41
40
|
...s,
|
|
42
|
-
children:
|
|
41
|
+
children: a
|
|
43
42
|
}
|
|
44
43
|
)
|
|
45
44
|
);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { mergeProps as
|
|
3
|
-
import { useRender as
|
|
2
|
+
import { mergeProps as s } from "@base-ui/react/merge-props";
|
|
3
|
+
import { useRender as i } from "@base-ui/react/use-render";
|
|
4
4
|
import { cva as l } from "class-variance-authority";
|
|
5
5
|
import { cn as e } from "../../../../lib/utils.js";
|
|
6
6
|
import { Separator as d } from "../separator/separator.js";
|
|
@@ -18,7 +18,7 @@ const u = l(
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
);
|
|
21
|
-
function
|
|
21
|
+
function b({
|
|
22
22
|
className: o,
|
|
23
23
|
orientation: t,
|
|
24
24
|
...r
|
|
@@ -34,18 +34,18 @@ function v({
|
|
|
34
34
|
}
|
|
35
35
|
);
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function v({
|
|
38
38
|
className: o,
|
|
39
39
|
render: t,
|
|
40
40
|
children: r,
|
|
41
41
|
...n
|
|
42
42
|
}) {
|
|
43
|
-
return
|
|
43
|
+
return i({
|
|
44
44
|
defaultTagName: "div",
|
|
45
|
-
props:
|
|
45
|
+
props: s(
|
|
46
46
|
{
|
|
47
47
|
className: e(
|
|
48
|
-
"bg-muted flex items-center gap-2 rounded-md border px-4 text-sm font-medium shadow-xs [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
|
|
48
|
+
"bg-muted-background flex items-center gap-2 rounded-md border px-4 text-sm font-medium shadow-xs [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
|
|
49
49
|
o
|
|
50
50
|
)
|
|
51
51
|
},
|
|
@@ -68,7 +68,7 @@ function x({
|
|
|
68
68
|
"data-slot": "button-group-separator",
|
|
69
69
|
orientation: t,
|
|
70
70
|
className: e(
|
|
71
|
-
"bg-
|
|
71
|
+
"bg-muted-background relative m-0 self-stretch data-[orientation=vertical]:h-auto",
|
|
72
72
|
o
|
|
73
73
|
),
|
|
74
74
|
...r
|
|
@@ -76,8 +76,8 @@ function x({
|
|
|
76
76
|
);
|
|
77
77
|
}
|
|
78
78
|
export {
|
|
79
|
-
|
|
79
|
+
b as ButtonGroup,
|
|
80
80
|
x as ButtonGroupSeparator,
|
|
81
|
-
|
|
81
|
+
v as ButtonGroupText,
|
|
82
82
|
u as buttonGroupVariants
|
|
83
83
|
};
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { ComponentProps, HTMLAttributes } from 'react';
|
|
2
2
|
import { BundledLanguage } from 'shiki';
|
|
3
3
|
import { Button } from '../button/button';
|
|
4
|
+
export declare function getCollapsedPreviewDisplay(code: string): string;
|
|
5
|
+
export declare function isContentLargerThanPreview(code: string): boolean;
|
|
6
|
+
export declare function shouldUsePlainTextInsteadOfShiki(code: string, lineCount: number): boolean;
|
|
7
|
+
export declare function plainPreMarkup(code: string): string;
|
|
4
8
|
declare const CodeBlock: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
5
9
|
code: string;
|
|
6
10
|
copyText?: string;
|
|
@@ -15,7 +19,14 @@ type CodeBlockCopyButtonProps = ComponentProps<typeof Button> & {
|
|
|
15
19
|
};
|
|
16
20
|
declare const CodeBlockCopyButton: import('react').ForwardRefExoticComponent<Omit<CodeBlockCopyButtonProps, "ref"> & import('react').RefAttributes<HTMLElement>>;
|
|
17
21
|
declare const CodeBlockCollapseButton: import('react').ForwardRefExoticComponent<Omit<Omit<import('@base-ui/react').ButtonProps & import('class-variance-authority').VariantProps<(props?: ({
|
|
18
|
-
variant?: "
|
|
19
|
-
size?: "
|
|
22
|
+
variant?: "default" | "secondary" | "outline" | "ghost" | "destructive" | null | undefined;
|
|
23
|
+
size?: "icon" | "default" | "sm" | "lg" | "icon-sm" | "icon-lg" | null | undefined;
|
|
20
24
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string>, "ref"> & import('react').RefAttributes<HTMLElement>, "ref"> & import('react').RefAttributes<HTMLElement>>;
|
|
21
|
-
|
|
25
|
+
type CodeBlockDownloadButtonProps = ComponentProps<typeof Button> & {
|
|
26
|
+
fileName?: string;
|
|
27
|
+
mimeType?: string;
|
|
28
|
+
onDownload?: () => void;
|
|
29
|
+
onError?: (error: Error) => void;
|
|
30
|
+
};
|
|
31
|
+
declare const CodeBlockDownloadButton: import('react').ForwardRefExoticComponent<Omit<CodeBlockDownloadButtonProps, "ref"> & import('react').RefAttributes<HTMLElement>>;
|
|
32
|
+
export { CodeBlock, CodeBlockCollapseButton, CodeBlockCopyButton, CodeBlockDownloadButton, };
|