@cognite/aura 0.1.0
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/dist/components/index.d.ts +53 -0
- package/dist/components/ui/core/alert/alert.d.ts +19 -0
- package/dist/components/ui/core/alert/alert.js +180 -0
- package/dist/components/ui/core/alert/alert.metadata.d.ts +2 -0
- package/dist/components/ui/core/alert/alert.metadata.js +9 -0
- package/dist/components/ui/core/avatar/avatar.d.ts +10 -0
- package/dist/components/ui/core/avatar/avatar.js +94 -0
- package/dist/components/ui/core/avatar/avatar.metadata.d.ts +8 -0
- package/dist/components/ui/core/avatar/avatar.metadata.js +9 -0
- package/dist/components/ui/core/badge/badge.d.ts +14 -0
- package/dist/components/ui/core/badge/badge.js +116 -0
- package/dist/components/ui/core/badge/badge.metadata.d.ts +2 -0
- package/dist/components/ui/core/badge/badge.metadata.js +8 -0
- package/dist/components/ui/core/button/button.d.ts +9 -0
- package/dist/components/ui/core/button/button.js +50 -0
- package/dist/components/ui/core/button/button.metadata.d.ts +2 -0
- package/dist/components/ui/core/button/button.metadata.js +9 -0
- package/dist/components/ui/core/button-group/button-group.d.ts +11 -0
- package/dist/components/ui/core/button-group/button-group.js +83 -0
- package/dist/components/ui/core/button-group/button-group.metadata.d.ts +2 -0
- package/dist/components/ui/core/button-group/button-group.metadata.js +8 -0
- package/dist/components/ui/core/code-block/code-block.d.ts +21 -0
- package/dist/components/ui/core/code-block/code-block.js +146 -0
- package/dist/components/ui/core/code-block/code-block.metadata.d.ts +2 -0
- package/dist/components/ui/core/code-block/code-block.metadata.js +8 -0
- package/dist/components/ui/core/collapsible/collapsible.d.ts +4 -0
- package/dist/components/ui/core/collapsible/collapsible.js +44 -0
- package/dist/components/ui/core/collapsible/collapsible.metadata.d.ts +2 -0
- package/dist/components/ui/core/collapsible/collapsible.metadata.js +9 -0
- package/dist/components/ui/core/command/command.d.ts +86 -0
- package/dist/components/ui/core/command/command.js +150 -0
- package/dist/components/ui/core/command/command.metadata.d.ts +2 -0
- package/dist/components/ui/core/command/command.metadata.js +9 -0
- package/dist/components/ui/core/dialog/dialog.d.ts +18 -0
- package/dist/components/ui/core/dialog/dialog.js +155 -0
- package/dist/components/ui/core/dialog/dialog.metadata.d.ts +2 -0
- package/dist/components/ui/core/dialog/dialog.metadata.js +9 -0
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.d.ts +53 -0
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.js +250 -0
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.metadata.d.ts +2 -0
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.metadata.js +9 -0
- package/dist/components/ui/core/helper-text/helper-text.d.ts +12 -0
- package/dist/components/ui/core/helper-text/helper-text.js +65 -0
- package/dist/components/ui/core/helper-text/helper-text.metadata.d.ts +2 -0
- package/dist/components/ui/core/helper-text/helper-text.metadata.js +9 -0
- package/dist/components/ui/core/hover-card/hover-card.d.ts +12 -0
- package/dist/components/ui/core/hover-card/hover-card.js +76 -0
- package/dist/components/ui/core/hover-card/hover-card.metadata.d.ts +2 -0
- package/dist/components/ui/core/hover-card/hover-card.metadata.js +8 -0
- package/dist/components/ui/core/inline-citation/inline-citation.d.ts +33 -0
- package/dist/components/ui/core/inline-citation/inline-citation.js +170 -0
- package/dist/components/ui/core/inline-citation/inline-citation.metadata.d.ts +2 -0
- package/dist/components/ui/core/inline-citation/inline-citation.metadata.js +8 -0
- package/dist/components/ui/core/input/input.d.ts +6 -0
- package/dist/components/ui/core/input/input.js +34 -0
- package/dist/components/ui/core/input/input.metadata.d.ts +2 -0
- package/dist/components/ui/core/input/input.metadata.js +9 -0
- package/dist/components/ui/core/input-group/input-group.d.ts +15 -0
- package/dist/components/ui/core/input-group/input-group.js +144 -0
- package/dist/components/ui/core/input-group/input-group.metadata.d.ts +2 -0
- package/dist/components/ui/core/input-group/input-group.metadata.js +9 -0
- package/dist/components/ui/core/label/label.d.ts +2 -0
- package/dist/components/ui/core/label/label.js +20 -0
- package/dist/components/ui/core/label/label.metadata.d.ts +2 -0
- package/dist/components/ui/core/label/label.metadata.js +9 -0
- package/dist/components/ui/core/loader/loader.d.ts +7 -0
- package/dist/components/ui/core/loader/loader.js +119 -0
- package/dist/components/ui/core/loader/loader.metadata.d.ts +2 -0
- package/dist/components/ui/core/loader/loader.metadata.js +9 -0
- package/dist/components/ui/core/message/message.d.ts +55 -0
- package/dist/components/ui/core/message/message.js +169 -0
- package/dist/components/ui/core/message/message.metadata.d.ts +2 -0
- package/dist/components/ui/core/popover/popover.d.ts +8 -0
- package/dist/components/ui/core/popover/popover.metadata.d.ts +2 -0
- package/dist/components/ui/core/prompt-input/prompt-input.d.ts +161 -0
- package/dist/components/ui/core/prompt-input/prompt-input.js +402 -0
- package/dist/components/ui/core/prompt-input/prompt-input.metadata.d.ts +2 -0
- package/dist/components/ui/core/prompt-input/prompt-input.metadata.js +9 -0
- package/dist/components/ui/core/reasoning/reasoning.d.ts +9 -0
- package/dist/components/ui/core/reasoning/reasoning.js +85 -0
- package/dist/components/ui/core/reasoning/reasoning.metadata.d.ts +2 -0
- package/dist/components/ui/core/reasoning/reasoning.metadata.js +8 -0
- package/dist/components/ui/core/select/select.d.ts +44 -0
- package/dist/components/ui/core/select/select.js +279 -0
- package/dist/components/ui/core/select/select.metadata.d.ts +2 -0
- package/dist/components/ui/core/select/select.metadata.js +9 -0
- package/dist/components/ui/core/separator/separator.d.ts +6 -0
- package/dist/components/ui/core/separator/separator.js +25 -0
- package/dist/components/ui/core/separator/separator.metadata.d.ts +2 -0
- package/dist/components/ui/core/separator/separator.metadata.js +8 -0
- package/dist/components/ui/core/shimmer/shimmer.d.ts +14 -0
- package/dist/components/ui/core/shimmer/shimmer.js +69 -0
- package/dist/components/ui/core/shimmer/shimmer.metadata.d.ts +2 -0
- package/dist/components/ui/core/shimmer/shimmer.metadata.js +9 -0
- package/dist/components/ui/core/skeleton/skeleton.d.ts +2 -0
- package/dist/components/ui/core/skeleton/skeleton.js +18 -0
- package/dist/components/ui/core/skeleton/skeleton.metadata.d.ts +2 -0
- package/dist/components/ui/core/skeleton/skeleton.metadata.js +9 -0
- package/dist/components/ui/core/sources/sources.d.ts +16 -0
- package/dist/components/ui/core/sources/sources.metadata.d.ts +2 -0
- package/dist/components/ui/core/textarea/textarea.d.ts +9 -0
- package/dist/components/ui/core/textarea/textarea.js +49 -0
- package/dist/components/ui/core/textarea/textarea.metadata.d.ts +2 -0
- package/dist/components/ui/core/textarea/textarea.metadata.js +9 -0
- package/dist/components/ui/core/tool/tool.d.ts +21 -0
- package/dist/components/ui/core/tool/tool.js +151 -0
- package/dist/components/ui/core/tool/tool.metadata.d.ts +2 -0
- package/dist/components/ui/core/tool/tool.metadata.js +8 -0
- package/dist/components/ui/core/tooltip/tooltip.d.ts +10 -0
- package/dist/components/ui/core/tooltip/tooltip.js +82 -0
- package/dist/components/ui/core/tooltip/tooltip.metadata.d.ts +8 -0
- package/dist/components/ui/core/tooltip/tooltip.metadata.js +9 -0
- package/dist/components/ui/lab/breadcrumb/breadcrumb.d.ts +134 -0
- package/dist/components/ui/lab/breadcrumb/breadcrumb.metadata.d.ts +2 -0
- package/dist/components/ui/lab/topbar/topbar.d.ts +10 -0
- package/dist/components/ui/lab/topbar/topbar.metadata.d.ts +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +229 -0
- package/dist/lib/ai/types.d.ts +53 -0
- package/dist/lib/component-status-config.d.ts +12 -0
- package/dist/lib/style-scope.d.ts +5 -0
- package/dist/lib/style-scope.js +7 -0
- package/dist/lib/types.d.ts +50 -0
- package/dist/lib/use-controllable-state.d.ts +11 -0
- package/dist/lib/use-controllable-state.js +32 -0
- package/dist/lib/utils.d.ts +45 -0
- package/dist/lib/utils.js +92 -0
- package/package.json +51 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ComponentProps, ComponentType } from 'react';
|
|
2
|
+
import { Badge } from '../badge/badge';
|
|
3
|
+
import { HoverCard } from '../hover-card/hover-card';
|
|
4
|
+
declare const InlineCitation: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & import('react').RefAttributes<HTMLSpanElement>>;
|
|
5
|
+
declare const InlineCitationGroup: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
6
|
+
declare const InlineCitationText: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & import('react').RefAttributes<HTMLSpanElement>>;
|
|
7
|
+
type InlineCitationCardProps = ComponentProps<typeof HoverCard>;
|
|
8
|
+
declare const InlineCitationCard: (props: InlineCitationCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
type InlineCitationCardTriggerProps = ComponentProps<typeof Badge> & {
|
|
10
|
+
sources: string[];
|
|
11
|
+
icon?: ComponentType<{
|
|
12
|
+
className?: string;
|
|
13
|
+
}>;
|
|
14
|
+
};
|
|
15
|
+
declare const InlineCitationCardTrigger: ({ sources, icon: Icon, className, ...props }: InlineCitationCardTriggerProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
type InlineCitationCardBodyProps = ComponentProps<'div'>;
|
|
17
|
+
declare const InlineCitationCardBody: ({ className, ...props }: InlineCitationCardBodyProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
type InlineCitationSourceProps = ComponentProps<'div'> & {
|
|
19
|
+
title?: string;
|
|
20
|
+
url?: string;
|
|
21
|
+
description?: string;
|
|
22
|
+
};
|
|
23
|
+
declare const InlineCitationSource: import('react').ForwardRefExoticComponent<Omit<InlineCitationSourceProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
24
|
+
declare const InlineCitationQuote: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').BlockquoteHTMLAttributes<HTMLQuoteElement>, HTMLQuoteElement>, "ref"> & import('react').RefAttributes<HTMLQuoteElement>>;
|
|
25
|
+
type InlineCitationLinkProps = Omit<ComponentProps<'a'>, 'target'> & {
|
|
26
|
+
target?: '_blank' | '_self';
|
|
27
|
+
icon?: ComponentType<{
|
|
28
|
+
className?: string;
|
|
29
|
+
}>;
|
|
30
|
+
variant?: 'mountain' | 'nordic' | 'fjord';
|
|
31
|
+
};
|
|
32
|
+
declare const InlineCitationLink: import('react').ForwardRefExoticComponent<Omit<InlineCitationLinkProps, "ref"> & import('react').RefAttributes<HTMLAnchorElement>>;
|
|
33
|
+
export { InlineCitation, InlineCitationGroup, InlineCitationText, InlineCitationCard, InlineCitationCardTrigger, InlineCitationCardBody, InlineCitationSource, InlineCitationQuote, InlineCitationLink, };
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { jsx as i, jsxs as d, Fragment as v } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as r } from "react";
|
|
3
|
+
import { cn as o, getHostname as m } from "../../../../lib/utils.js";
|
|
4
|
+
import { Badge as g } from "../badge/badge.js";
|
|
5
|
+
import { HoverCard as f, HoverCardTrigger as x, HoverCardContent as b } from "../hover-card/hover-card.js";
|
|
6
|
+
const h = r(
|
|
7
|
+
({ className: e, ...n }, t) => /* @__PURE__ */ i(
|
|
8
|
+
"span",
|
|
9
|
+
{
|
|
10
|
+
ref: t,
|
|
11
|
+
"data-slot": "inline-citation",
|
|
12
|
+
className: o("group inline-flex items-center gap-1", e),
|
|
13
|
+
...n
|
|
14
|
+
}
|
|
15
|
+
)
|
|
16
|
+
);
|
|
17
|
+
h.displayName = "InlineCitation";
|
|
18
|
+
const C = r(({ className: e, ...n }, t) => /* @__PURE__ */ i(
|
|
19
|
+
"div",
|
|
20
|
+
{
|
|
21
|
+
ref: t,
|
|
22
|
+
"data-slot": "inline-citation-group",
|
|
23
|
+
className: o("flex flex-wrap gap-2", e),
|
|
24
|
+
...n
|
|
25
|
+
}
|
|
26
|
+
));
|
|
27
|
+
C.displayName = "InlineCitationGroup";
|
|
28
|
+
const N = r(({ className: e, ...n }, t) => /* @__PURE__ */ i(
|
|
29
|
+
"span",
|
|
30
|
+
{
|
|
31
|
+
ref: t,
|
|
32
|
+
"data-slot": "inline-citation-text",
|
|
33
|
+
className: o("transition-colors group-hover:bg-accent", e),
|
|
34
|
+
...n
|
|
35
|
+
}
|
|
36
|
+
));
|
|
37
|
+
N.displayName = "InlineCitationText";
|
|
38
|
+
const q = (e) => /* @__PURE__ */ i(
|
|
39
|
+
f,
|
|
40
|
+
{
|
|
41
|
+
"data-slot": "inline-citation-card",
|
|
42
|
+
closeDelay: 0,
|
|
43
|
+
openDelay: 0,
|
|
44
|
+
...e
|
|
45
|
+
}
|
|
46
|
+
), B = ({
|
|
47
|
+
sources: e,
|
|
48
|
+
icon: n,
|
|
49
|
+
className: t,
|
|
50
|
+
...a
|
|
51
|
+
}) => /* @__PURE__ */ i(
|
|
52
|
+
x,
|
|
53
|
+
{
|
|
54
|
+
render: /* @__PURE__ */ d(
|
|
55
|
+
g,
|
|
56
|
+
{
|
|
57
|
+
"data-slot": "inline-citation-card-trigger",
|
|
58
|
+
className: o(
|
|
59
|
+
"ml-1 inline-flex items-center justify-center rounded-md border border-transparent bg-decorative-background-fjord px-1 text-sm leading-4.5 font-medium text-decorative-foreground-fjord whitespace-nowrap gap-1 transition-[color,box-shadow]",
|
|
60
|
+
"[&>svg]:size-3 [&>svg]:pointer-events-none",
|
|
61
|
+
t
|
|
62
|
+
),
|
|
63
|
+
...a,
|
|
64
|
+
children: [
|
|
65
|
+
n && /* @__PURE__ */ i(n, { className: "size-3" }),
|
|
66
|
+
e[0] ? /* @__PURE__ */ d(v, { children: [
|
|
67
|
+
m(e[0]),
|
|
68
|
+
" ",
|
|
69
|
+
e.length > 1 && `+${e.length - 1}`
|
|
70
|
+
] }) : "unknown"
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
)
|
|
74
|
+
}
|
|
75
|
+
), D = ({
|
|
76
|
+
className: e,
|
|
77
|
+
...n
|
|
78
|
+
}) => /* @__PURE__ */ i(
|
|
79
|
+
b,
|
|
80
|
+
{
|
|
81
|
+
"data-slot": "inline-citation-card-body",
|
|
82
|
+
className: o("relative w-80 p-0", e),
|
|
83
|
+
...n
|
|
84
|
+
}
|
|
85
|
+
), y = r(({ title: e, url: n, description: t, className: a, children: l, ...s }, c) => /* @__PURE__ */ d(
|
|
86
|
+
"div",
|
|
87
|
+
{
|
|
88
|
+
ref: c,
|
|
89
|
+
"data-slot": "inline-citation-source",
|
|
90
|
+
className: o("space-y-1", a),
|
|
91
|
+
...s,
|
|
92
|
+
children: [
|
|
93
|
+
e && /* @__PURE__ */ i("h4", { className: "truncate font-medium text-sm leading-tight", children: e }),
|
|
94
|
+
n && /* @__PURE__ */ i("p", { className: "truncate break-all text-muted-foreground text-xs", children: n }),
|
|
95
|
+
t && /* @__PURE__ */ i("p", { className: "line-clamp-3 text-muted-foreground text-sm leading-relaxed", children: t }),
|
|
96
|
+
l
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
));
|
|
100
|
+
y.displayName = "InlineCitationSource";
|
|
101
|
+
const k = r(({ children: e, className: n, ...t }, a) => /* @__PURE__ */ i(
|
|
102
|
+
"blockquote",
|
|
103
|
+
{
|
|
104
|
+
ref: a,
|
|
105
|
+
"data-slot": "inline-citation-quote",
|
|
106
|
+
className: o(
|
|
107
|
+
"border-muted border-l-2 pl-3 text-muted-foreground text-sm italic",
|
|
108
|
+
n
|
|
109
|
+
),
|
|
110
|
+
...t,
|
|
111
|
+
children: e
|
|
112
|
+
}
|
|
113
|
+
));
|
|
114
|
+
k.displayName = "InlineCitationQuote";
|
|
115
|
+
const I = r(
|
|
116
|
+
({
|
|
117
|
+
href: e,
|
|
118
|
+
target: n = "_self",
|
|
119
|
+
icon: t,
|
|
120
|
+
variant: a = "mountain",
|
|
121
|
+
className: l,
|
|
122
|
+
children: s,
|
|
123
|
+
...c
|
|
124
|
+
}, u) => {
|
|
125
|
+
const p = m(e);
|
|
126
|
+
return /* @__PURE__ */ i(
|
|
127
|
+
"a",
|
|
128
|
+
{
|
|
129
|
+
ref: u,
|
|
130
|
+
href: e,
|
|
131
|
+
target: n,
|
|
132
|
+
rel: n === "_blank" ? "noopener noreferrer" : void 0,
|
|
133
|
+
className: "inline-flex items-stretch",
|
|
134
|
+
...c,
|
|
135
|
+
children: /* @__PURE__ */ d(
|
|
136
|
+
g,
|
|
137
|
+
{
|
|
138
|
+
"data-slot": "inline-citation-link",
|
|
139
|
+
className: o(
|
|
140
|
+
"inline-flex items-center justify-center rounded-md border border-transparent px-1 text-sm leading-4.5 font-medium whitespace-nowrap gap-1 transition-colors",
|
|
141
|
+
"[&>svg]:size-3 [&>svg]:pointer-events-none",
|
|
142
|
+
{
|
|
143
|
+
mountain: "bg-decorative-background-mountain hover:bg-decorative-background-hover-mountain text-decorative-foreground-mountain",
|
|
144
|
+
nordic: "bg-decorative-background-nordic hover:bg-decorative-background-hover-nordic text-decorative-foreground-nordic",
|
|
145
|
+
fjord: "bg-decorative-background-fjord hover:bg-decorative-background-hover-fjord text-decorative-foreground-fjord"
|
|
146
|
+
}[a],
|
|
147
|
+
l
|
|
148
|
+
),
|
|
149
|
+
children: [
|
|
150
|
+
t && /* @__PURE__ */ i(t, { className: "size-3" }),
|
|
151
|
+
s ?? p
|
|
152
|
+
]
|
|
153
|
+
}
|
|
154
|
+
)
|
|
155
|
+
}
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
);
|
|
159
|
+
I.displayName = "InlineCitationLink";
|
|
160
|
+
export {
|
|
161
|
+
h as InlineCitation,
|
|
162
|
+
q as InlineCitationCard,
|
|
163
|
+
D as InlineCitationCardBody,
|
|
164
|
+
B as InlineCitationCardTrigger,
|
|
165
|
+
C as InlineCitationGroup,
|
|
166
|
+
I as InlineCitationLink,
|
|
167
|
+
k as InlineCitationQuote,
|
|
168
|
+
y as InlineCitationSource,
|
|
169
|
+
N as InlineCitationText
|
|
170
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ComponentProps, ReactNode } from 'react';
|
|
2
|
+
interface InputProps extends ComponentProps<'input'> {
|
|
3
|
+
errorMessage?: ReactNode;
|
|
4
|
+
}
|
|
5
|
+
declare const Input: import('react').ForwardRefExoticComponent<Omit<InputProps, "ref"> & import('react').RefAttributes<HTMLInputElement>>;
|
|
6
|
+
export { Input };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsxs as n, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as o } from "react";
|
|
3
|
+
import { cn as s, readOnlyState as m, disabledState as u, invalidState as d, focusState as p, filledState as f, hoverState as c, formElementBase as S } from "../../../../lib/utils.js";
|
|
4
|
+
import { HelperText as v } from "../helper-text/helper-text.js";
|
|
5
|
+
const x = ({ errorMessage: t }) => t ? /* @__PURE__ */ r(v, { className: "pt-1", isError: !0, children: t }) : null, N = o(
|
|
6
|
+
({ className: t, type: a, errorMessage: e, ...l }, i) => /* @__PURE__ */ n("div", { className: "w-full", children: [
|
|
7
|
+
/* @__PURE__ */ r(
|
|
8
|
+
"input",
|
|
9
|
+
{
|
|
10
|
+
ref: i,
|
|
11
|
+
type: a,
|
|
12
|
+
"data-slot": "input",
|
|
13
|
+
"aria-invalid": e ? !0 : void 0,
|
|
14
|
+
className: s(
|
|
15
|
+
"w-full",
|
|
16
|
+
S,
|
|
17
|
+
c,
|
|
18
|
+
f,
|
|
19
|
+
p,
|
|
20
|
+
d,
|
|
21
|
+
u,
|
|
22
|
+
m,
|
|
23
|
+
t
|
|
24
|
+
),
|
|
25
|
+
...l
|
|
26
|
+
}
|
|
27
|
+
),
|
|
28
|
+
/* @__PURE__ */ r(x, { errorMessage: e })
|
|
29
|
+
] })
|
|
30
|
+
);
|
|
31
|
+
N.displayName = "Input";
|
|
32
|
+
export {
|
|
33
|
+
N as Input
|
|
34
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
declare const InputGroup: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
3
|
+
declare const InputGroupAddon: import('react').ForwardRefExoticComponent<Omit<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & VariantProps<(props?: ({
|
|
4
|
+
align?: "block-end" | "block-start" | "inline-end" | "inline-start" | null | undefined;
|
|
5
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
6
|
+
declare const InputGroupButton: import('react').ForwardRefExoticComponent<Omit<Omit<Omit<import('@base-ui/react').ButtonProps & VariantProps<(props?: ({
|
|
7
|
+
variant?: "default" | "destructive" | "secondary" | "outline" | "ghost" | "link" | null | undefined;
|
|
8
|
+
size?: "default" | "sm" | "lg" | "icon" | "icon-sm" | "icon-lg" | null | undefined;
|
|
9
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string>, "ref"> & import('react').RefAttributes<HTMLElement>, "size"> & VariantProps<(props?: ({
|
|
10
|
+
size?: "sm" | "icon-sm" | "xs" | "icon-xs" | null | undefined;
|
|
11
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string>, "ref"> & import('react').RefAttributes<HTMLElement>>;
|
|
12
|
+
declare const InputGroupText: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & import('react').RefAttributes<HTMLSpanElement>>;
|
|
13
|
+
declare const InputGroupInput: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & import('react').RefAttributes<HTMLInputElement>>;
|
|
14
|
+
declare const InputGroupTextarea: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref"> & import('react').RefAttributes<HTMLTextAreaElement>>;
|
|
15
|
+
export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupText, InputGroupInput, InputGroupTextarea, };
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as o } from "react";
|
|
3
|
+
import { cva as u } from "class-variance-authority";
|
|
4
|
+
import { cn as e } from "../../../../lib/utils.js";
|
|
5
|
+
import { Button as d } from "../button/button.js";
|
|
6
|
+
import { Input as l } from "../input/input.js";
|
|
7
|
+
import { Textarea as c } from "../textarea/textarea.js";
|
|
8
|
+
const g = o(
|
|
9
|
+
({ className: a, ...t }, n) => /* @__PURE__ */ r(
|
|
10
|
+
"div",
|
|
11
|
+
{
|
|
12
|
+
ref: n,
|
|
13
|
+
"data-slot": "input-group",
|
|
14
|
+
role: "group",
|
|
15
|
+
className: e(
|
|
16
|
+
"group/input-group bg-background border-input dark:bg-input/30 relative flex w-full items-center rounded-md border shadow-sm transition-colors transition-shadow outline-none",
|
|
17
|
+
"h-9 min-w-0 has-[>textarea]:h-auto",
|
|
18
|
+
"has-[>[data-align=inline-start]]:[&>input]:pl-2 has-[>[data-align=inline-start]]:[&>input]:rounded-l-none has-[>[data-align=inline-start]]:[&>textarea]:rounded-l-none",
|
|
19
|
+
"has-[>[data-align=inline-end]]:[&>input]:pr-2 has-[>[data-align=inline-end]]:[&>input]:rounded-r-none has-[>[data-align=inline-end]]:[&>textarea]:rounded-r-none",
|
|
20
|
+
"has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3",
|
|
21
|
+
"has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3",
|
|
22
|
+
"has-[[data-slot=input-group-control]:focus-visible]:shadow-focus-ring has-[[data-slot=input-group-control]:focus-visible]:border-transparent",
|
|
23
|
+
"has-[[data-slot=input-group-control][aria-invalid=true]]:shadow-focus-ring-destructive has-[[data-slot=input-group-control][aria-invalid=true]]:border-transparent",
|
|
24
|
+
"has-[[data-slot=input-group-control]:read-only]:border-transparent has-[[data-slot=input-group-control]:read-only]:shadow-none",
|
|
25
|
+
"hover:has-[[data-slot=input-group-control]:read-only]:border-transparent hover:has-[[data-slot=input-group-control]:read-only]:bg-accent hover:has-[[data-slot=input-group-control]:read-only]:text-accent-foreground",
|
|
26
|
+
a
|
|
27
|
+
),
|
|
28
|
+
...t
|
|
29
|
+
}
|
|
30
|
+
)
|
|
31
|
+
);
|
|
32
|
+
g.displayName = "InputGroup";
|
|
33
|
+
const h = u(
|
|
34
|
+
"text-muted-foreground flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium select-none [&>svg:not([class*='size-'])]:size-4 [&>kbd]:rounded-sm group-data-[disabled=true]/input-group:opacity-50",
|
|
35
|
+
{
|
|
36
|
+
variants: {
|
|
37
|
+
align: {
|
|
38
|
+
"inline-start": "order-first pl-3 has-[>button]:-ml-2 has-[>kbd]:-ml-1.5",
|
|
39
|
+
"inline-end": "order-last pr-3 has-[>button]:-mr-2 has-[>kbd]:-mr-1.5",
|
|
40
|
+
"block-start": "order-first w-full justify-start px-3 pt-3 [.border-b]:pb-3 group-has-[>input]/input-group:pt-2.5",
|
|
41
|
+
"block-end": "order-last w-full justify-start px-3 pb-3 [.border-t]:pt-3 group-has-[>input]/input-group:pb-2.5"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
defaultVariants: {
|
|
45
|
+
align: "inline-start"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
), b = o(({ className: a, align: t = "inline-start", ...n }, i) => /* @__PURE__ */ r(
|
|
49
|
+
"div",
|
|
50
|
+
{
|
|
51
|
+
ref: i,
|
|
52
|
+
role: "group",
|
|
53
|
+
"data-slot": "input-group-addon",
|
|
54
|
+
"data-align": t,
|
|
55
|
+
className: e(h({ align: t }), a),
|
|
56
|
+
onClick: (s) => {
|
|
57
|
+
s.target instanceof HTMLElement && s.target.closest("button") || s.currentTarget.parentElement?.querySelector('[data-slot="input-group-control"]')?.focus();
|
|
58
|
+
},
|
|
59
|
+
...n
|
|
60
|
+
}
|
|
61
|
+
));
|
|
62
|
+
b.displayName = "InputGroupAddon";
|
|
63
|
+
const m = u(
|
|
64
|
+
"text-sm shadow-none flex gap-2 items-center",
|
|
65
|
+
{
|
|
66
|
+
variants: {
|
|
67
|
+
size: {
|
|
68
|
+
xs: "h-6 gap-1 px-2 rounded-sm [&>svg:not([class*='size-'])]:size-3.5 has-[>svg]:px-2",
|
|
69
|
+
sm: "h-7 px-2.5 gap-1.5 rounded-md has-[>svg]:px-2.5",
|
|
70
|
+
"icon-xs": "size-6 rounded-xs p-0 has-[>svg]:p-0",
|
|
71
|
+
"icon-sm": "size-7 p-0 has-[>svg]:p-0"
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
defaultVariants: {
|
|
75
|
+
size: "xs"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
), f = o(
|
|
79
|
+
({ className: a, type: t = "button", variant: n = "ghost", size: i = "xs", ...s }, p) => /* @__PURE__ */ r(
|
|
80
|
+
d,
|
|
81
|
+
{
|
|
82
|
+
ref: p,
|
|
83
|
+
type: t,
|
|
84
|
+
"data-size": i,
|
|
85
|
+
variant: n,
|
|
86
|
+
className: e(m({ size: i }), a),
|
|
87
|
+
...s
|
|
88
|
+
}
|
|
89
|
+
)
|
|
90
|
+
);
|
|
91
|
+
f.displayName = "InputGroupButton";
|
|
92
|
+
const v = o(
|
|
93
|
+
({ className: a, ...t }, n) => /* @__PURE__ */ r(
|
|
94
|
+
"span",
|
|
95
|
+
{
|
|
96
|
+
ref: n,
|
|
97
|
+
"data-slot": "input-group-text",
|
|
98
|
+
className: e(
|
|
99
|
+
"text-muted-foreground flex items-center gap-2 text-sm [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
|
|
100
|
+
a
|
|
101
|
+
),
|
|
102
|
+
...t
|
|
103
|
+
}
|
|
104
|
+
)
|
|
105
|
+
);
|
|
106
|
+
v.displayName = "InputGroupText";
|
|
107
|
+
const x = o(
|
|
108
|
+
({ className: a, ...t }, n) => /* @__PURE__ */ r(
|
|
109
|
+
l,
|
|
110
|
+
{
|
|
111
|
+
ref: n,
|
|
112
|
+
"data-slot": "input-group-control",
|
|
113
|
+
className: e(
|
|
114
|
+
"flex-1 rounded-md border-0 bg-transparent shadow-none hover:bg-transparent hover:text-current dark:bg-transparent",
|
|
115
|
+
"focus-visible:shadow-none focus-visible:border-transparent",
|
|
116
|
+
"aria-invalid:focus-visible:shadow-none aria-invalid:focus-visible:border-transparent",
|
|
117
|
+
a
|
|
118
|
+
),
|
|
119
|
+
...t
|
|
120
|
+
}
|
|
121
|
+
)
|
|
122
|
+
);
|
|
123
|
+
x.displayName = "InputGroupInput";
|
|
124
|
+
const y = o(({ className: a, ...t }, n) => /* @__PURE__ */ r(
|
|
125
|
+
c,
|
|
126
|
+
{
|
|
127
|
+
ref: n,
|
|
128
|
+
"data-slot": "input-group-control",
|
|
129
|
+
className: e(
|
|
130
|
+
"flex-1 resize-none rounded-md border-0 bg-transparent py-3 shadow-none focus-visible:shadow-none focus-visible:border-transparent aria-invalid:focus-visible:shadow-none aria-invalid:focus-visible:border-transparent dark:bg-transparent hover:bg-transparent hover:text-current",
|
|
131
|
+
a
|
|
132
|
+
),
|
|
133
|
+
...t
|
|
134
|
+
}
|
|
135
|
+
));
|
|
136
|
+
y.displayName = "InputGroupTextarea";
|
|
137
|
+
export {
|
|
138
|
+
g as InputGroup,
|
|
139
|
+
b as InputGroupAddon,
|
|
140
|
+
f as InputGroupButton,
|
|
141
|
+
x as InputGroupInput,
|
|
142
|
+
v as InputGroupText,
|
|
143
|
+
y as InputGroupTextarea
|
|
144
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const t = {
|
|
2
|
+
name: "InputGroup",
|
|
3
|
+
status: "in-progress-code-review",
|
|
4
|
+
description: "A container that combines an input or textarea with inline addons such as icons, labels, or action buttons.",
|
|
5
|
+
llmUsage: "Use `<InputGroup>` with `<InputGroupInput>` and `<InputGroupAddon>` to build inputs with prefix/suffix decorations. Use `<InputGroupTextarea>` instead of `<InputGroupInput>` for multi-line inputs."
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
t as InputGroupMetadata
|
|
9
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as d } from "react";
|
|
3
|
+
import { cn as l } from "../../../../lib/utils.js";
|
|
4
|
+
const n = d(({ className: e, children: t, ...r }, a) => /* @__PURE__ */ o(
|
|
5
|
+
"label",
|
|
6
|
+
{
|
|
7
|
+
ref: a,
|
|
8
|
+
"data-slot": "label",
|
|
9
|
+
className: l(
|
|
10
|
+
"flex items-center text-muted-foreground dark:text-muted-foreground text-sm font-medium leading-4.5 pb-1 select-none group-data-[disabled=true]:disabled-foreground group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:cursor-not-allowed group-data-[disabled=true]:opacity-50",
|
|
11
|
+
e
|
|
12
|
+
),
|
|
13
|
+
...r,
|
|
14
|
+
children: t
|
|
15
|
+
}
|
|
16
|
+
));
|
|
17
|
+
n.displayName = "Label";
|
|
18
|
+
export {
|
|
19
|
+
n as Label
|
|
20
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const e = {
|
|
2
|
+
name: "Label",
|
|
3
|
+
status: "in-progress-code-review",
|
|
4
|
+
description: "An accessible text label for form controls, built on top of Base UI Label. Supports association via `htmlFor` and integrates with disabled states.",
|
|
5
|
+
llmUsage: 'Use `<Label htmlFor="field-id">Text</Label>` together with an input that has `id="field-id"` so clicking the label focuses the field. For required fields, include a visual indicator such as the asterisk icon from `/asterisk.svg`.'
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
e as LabelMetadata
|
|
9
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
interface LoaderProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
size?: number;
|
|
4
|
+
}
|
|
5
|
+
declare const Loader: import('react').ForwardRefExoticComponent<LoaderProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
6
|
+
export { Loader };
|
|
7
|
+
export type { LoaderProps };
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { jsx as t, jsxs as o } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as d } from "react";
|
|
3
|
+
import { cn as a } from "../../../../lib/utils.js";
|
|
4
|
+
const h = ({ size: r = 16 }) => /* @__PURE__ */ o(
|
|
5
|
+
"svg",
|
|
6
|
+
{
|
|
7
|
+
height: r,
|
|
8
|
+
strokeLinejoin: "round",
|
|
9
|
+
style: { color: "currentcolor" },
|
|
10
|
+
viewBox: "0 0 16 16",
|
|
11
|
+
width: r,
|
|
12
|
+
children: [
|
|
13
|
+
/* @__PURE__ */ t("title", { children: "Loading" }),
|
|
14
|
+
/* @__PURE__ */ o("g", { clipPath: "url(#clip0_2393_1490)", children: [
|
|
15
|
+
/* @__PURE__ */ t("path", { d: "M8 0V4", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
16
|
+
/* @__PURE__ */ t(
|
|
17
|
+
"path",
|
|
18
|
+
{
|
|
19
|
+
d: "M8 16V12",
|
|
20
|
+
opacity: "0.5",
|
|
21
|
+
stroke: "currentColor",
|
|
22
|
+
strokeWidth: "1.5"
|
|
23
|
+
}
|
|
24
|
+
),
|
|
25
|
+
/* @__PURE__ */ t(
|
|
26
|
+
"path",
|
|
27
|
+
{
|
|
28
|
+
d: "M3.29773 1.52783L5.64887 4.7639",
|
|
29
|
+
opacity: "0.9",
|
|
30
|
+
stroke: "currentColor",
|
|
31
|
+
strokeWidth: "1.5"
|
|
32
|
+
}
|
|
33
|
+
),
|
|
34
|
+
/* @__PURE__ */ t(
|
|
35
|
+
"path",
|
|
36
|
+
{
|
|
37
|
+
d: "M12.7023 1.52783L10.3511 4.7639",
|
|
38
|
+
opacity: "0.1",
|
|
39
|
+
stroke: "currentColor",
|
|
40
|
+
strokeWidth: "1.5"
|
|
41
|
+
}
|
|
42
|
+
),
|
|
43
|
+
/* @__PURE__ */ t(
|
|
44
|
+
"path",
|
|
45
|
+
{
|
|
46
|
+
d: "M12.7023 14.472L10.3511 11.236",
|
|
47
|
+
opacity: "0.4",
|
|
48
|
+
stroke: "currentColor",
|
|
49
|
+
strokeWidth: "1.5"
|
|
50
|
+
}
|
|
51
|
+
),
|
|
52
|
+
/* @__PURE__ */ t(
|
|
53
|
+
"path",
|
|
54
|
+
{
|
|
55
|
+
d: "M3.29773 14.472L5.64887 11.236",
|
|
56
|
+
opacity: "0.6",
|
|
57
|
+
stroke: "currentColor",
|
|
58
|
+
strokeWidth: "1.5"
|
|
59
|
+
}
|
|
60
|
+
),
|
|
61
|
+
/* @__PURE__ */ t(
|
|
62
|
+
"path",
|
|
63
|
+
{
|
|
64
|
+
d: "M15.6085 5.52783L11.8043 6.7639",
|
|
65
|
+
opacity: "0.2",
|
|
66
|
+
stroke: "currentColor",
|
|
67
|
+
strokeWidth: "1.5"
|
|
68
|
+
}
|
|
69
|
+
),
|
|
70
|
+
/* @__PURE__ */ t(
|
|
71
|
+
"path",
|
|
72
|
+
{
|
|
73
|
+
d: "M0.391602 10.472L4.19583 9.23598",
|
|
74
|
+
opacity: "0.7",
|
|
75
|
+
stroke: "currentColor",
|
|
76
|
+
strokeWidth: "1.5"
|
|
77
|
+
}
|
|
78
|
+
),
|
|
79
|
+
/* @__PURE__ */ t(
|
|
80
|
+
"path",
|
|
81
|
+
{
|
|
82
|
+
d: "M15.6085 10.4722L11.8043 9.2361",
|
|
83
|
+
opacity: "0.3",
|
|
84
|
+
stroke: "currentColor",
|
|
85
|
+
strokeWidth: "1.5"
|
|
86
|
+
}
|
|
87
|
+
),
|
|
88
|
+
/* @__PURE__ */ t(
|
|
89
|
+
"path",
|
|
90
|
+
{
|
|
91
|
+
d: "M0.391602 5.52783L4.19583 6.7639",
|
|
92
|
+
opacity: "0.8",
|
|
93
|
+
stroke: "currentColor",
|
|
94
|
+
strokeWidth: "1.5"
|
|
95
|
+
}
|
|
96
|
+
)
|
|
97
|
+
] }),
|
|
98
|
+
/* @__PURE__ */ t("defs", { children: /* @__PURE__ */ t("clipPath", { id: "clip0_2393_1490", children: /* @__PURE__ */ t("rect", { fill: "white", height: "16", width: "16" }) }) })
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
), s = d(
|
|
102
|
+
({ className: r, size: e = 16, ...i }, c) => /* @__PURE__ */ t(
|
|
103
|
+
"div",
|
|
104
|
+
{
|
|
105
|
+
ref: c,
|
|
106
|
+
"data-slot": "loader",
|
|
107
|
+
className: a(
|
|
108
|
+
"inline-flex animate-spin items-center justify-center",
|
|
109
|
+
r
|
|
110
|
+
),
|
|
111
|
+
...i,
|
|
112
|
+
children: /* @__PURE__ */ t(h, { size: e })
|
|
113
|
+
}
|
|
114
|
+
)
|
|
115
|
+
);
|
|
116
|
+
s.displayName = "Loader";
|
|
117
|
+
export {
|
|
118
|
+
s as Loader
|
|
119
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const e = {
|
|
2
|
+
name: "Loader",
|
|
3
|
+
status: "in-progress-code-review",
|
|
4
|
+
description: "A spinning loader indicator for loading states.",
|
|
5
|
+
llmUsage: "Use `<Loader>` to indicate loading. Adjust `size` prop for different contexts. Inherits text color from parent."
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
e as LoaderMetadata
|
|
9
|
+
};
|