@actioneer/ads 0.6.0 → 0.8.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/DESIGN.md +597 -0
- package/components/ai-elements/agent-trace.d.ts +2 -2
- package/components/ai-elements/agent-trace.js +164 -105
- package/components/ai-elements/chain-of-thought.d.ts +2 -2
- package/components/ai-elements/chain-of-thought.js +1 -1
- package/components/ai-elements/index.d.ts +0 -5
- package/components/ai-elements/inline-citation.js +1 -1
- package/components/alert.d.ts +6 -6
- package/components/alert.js +89 -53
- package/components/answer-sources.d.ts +2 -6
- package/components/answer-sources.js +58 -60
- package/components/answer.d.ts +5 -0
- package/components/answer.js +311 -271
- package/components/assistant-ui/action-bar.js +1 -1
- package/components/assistant-ui/attachment.js +11 -11
- package/components/assistant-ui/badge.js +18 -18
- package/components/assistant-ui/composer-harness.js +15 -20
- package/components/assistant-ui/composer-trigger-popover.js +9 -9
- package/components/assistant-ui/composer.d.ts +3 -1
- package/components/assistant-ui/composer.js +148 -144
- package/components/assistant-ui/image.js +61 -61
- package/components/assistant-ui/index.d.ts +0 -3
- package/components/assistant-ui/message-timing.js +1 -1
- package/components/assistant-ui/selection-toolbar.js +7 -7
- package/components/assistant-ui/thread-context.d.ts +3 -1
- package/components/assistant-ui/thread.js +50 -42
- package/components/avatar.js +42 -42
- package/components/badge.d.ts +5 -6
- package/components/badge.js +13 -76
- package/components/body-page-header.d.ts +15 -0
- package/components/body-page-header.js +24 -0
- package/components/brand-loader.d.ts +0 -3
- package/components/brand-loader.js +10 -32
- package/components/breadcrumbs.d.ts +0 -7
- package/components/breadcrumbs.js +54 -71
- package/components/button.d.ts +1 -1
- package/components/button.js +55 -49
- package/components/chart.js +298 -296
- package/components/chip.d.ts +13 -1
- package/components/chip.js +93 -80
- package/components/collection-header.d.ts +17 -0
- package/components/collection-header.js +31 -0
- package/components/connector-card.d.ts +6 -6
- package/components/connector-card.js +31 -32
- package/components/date-range-picker.d.ts +2 -1
- package/components/date-range-picker.js +158 -122
- package/components/divider.js +25 -25
- package/components/drawer.d.ts +6 -2
- package/components/drawer.js +61 -58
- package/components/dropdown.d.ts +1 -2
- package/components/dropdown.js +88 -89
- package/components/field.js +41 -36
- package/components/file-dropzone.js +1 -1
- package/components/index.d.ts +4 -4
- package/components/index.js +501 -549
- package/components/infinite-canvas.js +24 -24
- package/components/input-field.d.ts +18 -3
- package/components/input-field.js +88 -72
- package/components/input.js +32 -29
- package/components/modal.d.ts +31 -3
- package/components/modal.js +244 -170
- package/components/number-field.js +45 -42
- package/components/page-body.d.ts +12 -0
- package/components/page-body.js +18 -0
- package/components/pagination.js +36 -36
- package/components/pixel-blast-svg.js +71 -73
- package/components/select.d.ts +21 -0
- package/components/select.js +189 -148
- package/components/setting-row.d.ts +6 -5
- package/components/setting-row.js +33 -32
- package/components/sidebar.d.ts +2 -0
- package/components/sidebar.js +151 -141
- package/components/skeleton.js +8 -7
- package/components/slider.js +1 -1
- package/components/surface-loader.d.ts +11 -0
- package/components/surface-loader.js +35 -0
- package/components/table.d.ts +16 -10
- package/components/table.js +427 -412
- package/components/tabs.d.ts +2 -0
- package/components/tabs.js +160 -295
- package/components/textarea.js +9 -9
- package/components/toast.d.ts +1 -1
- package/components/toast.js +181 -118
- package/components/tree.d.ts +5 -1
- package/components/tree.js +54 -49
- package/components/typography.d.ts +4 -4
- package/components/typography.js +13 -13
- package/components/ui/button.d.ts +1 -1
- package/components/ui/button.js +4 -4
- package/components/ui/dialog.js +25 -25
- package/demo/components/add-to-artifact.js +6 -10
- package/lib/cn.js +11 -4
- package/lib/icons.d.ts +4 -0
- package/lib/icons.js +103 -102
- package/lib/interactive.d.ts +1 -1
- package/llms.txt +132 -188
- package/manifest.json +1719 -2831
- package/package.json +2 -2
- package/styles.css +362 -233
- package/theme.css +312 -177
- package/components/agent-icon.d.ts +0 -76
- package/components/agent-icon.js +0 -265
- package/components/ai-elements/queue.d.ts +0 -60
- package/components/ai-elements/queue.js +0 -193
- package/components/ai-elements/speech-input.d.ts +0 -16
- package/components/ai-elements/speech-input.js +0 -151
- package/components/ai-elements/task-progress.d.ts +0 -41
- package/components/ai-elements/task-progress.js +0 -224
- package/components/ai-elements/task.d.ts +0 -39
- package/components/ai-elements/task.js +0 -105
- package/components/ai-elements/voice.d.ts +0 -90
- package/components/ai-elements/voice.js +0 -496
- package/components/assistant-ui/follow-up-suggestions.d.ts +0 -11
- package/components/assistant-ui/follow-up-suggestions.js +0 -72
- package/components/assistant-ui/suggestions.d.ts +0 -7
- package/components/assistant-ui/suggestions.js +0 -19
- package/components/assistant-ui/voice.d.ts +0 -18
- package/components/link.d.ts +0 -14
- package/components/link.js +0 -72
- package/components/navbar.d.ts +0 -15
- package/components/navbar.js +0 -68
- package/components/pixel-icon.d.ts +0 -37
- package/components/pixel-icon.js +0 -859
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx as e, jsxs as b } from "react/jsx-runtime";
|
|
3
3
|
import * as n from "react";
|
|
4
4
|
import { MarkerType as U, ReactFlow as Z, Background as j, BackgroundVariant as H, Panel as h, useReactFlow as K, useStore as V } from "@xyflow/react";
|
|
5
|
-
import { BaseEdge as he, EdgeLabelRenderer as xe, Handle as Ee, MarkerType as
|
|
5
|
+
import { BaseEdge as he, EdgeLabelRenderer as xe, Handle as Ee, MarkerType as ye, Position as De, ReactFlowProvider as ke, addEdge as _e, getBezierPath as we, getSmoothStepPath as Ie, getStraightPath as Re, useEdgesState as Se, useNodesState as Ae, useReactFlow as Ce } from "@xyflow/react";
|
|
6
6
|
import "@xyflow/react/dist/style.css";
|
|
7
7
|
import { cn as W } from "../lib/cn.js";
|
|
8
8
|
import { Minus as q, Plus as J, Maximize as Q, Magnet as X } from "../lib/icons.js";
|
|
@@ -20,18 +20,18 @@ const le = {
|
|
|
20
20
|
},
|
|
21
21
|
style: { stroke: R, strokeWidth: ee },
|
|
22
22
|
labelStyle: { fill: "var(--color-foreground)", fontSize: re },
|
|
23
|
-
labelBgStyle: { fill: "var(--color-
|
|
23
|
+
labelBgStyle: { fill: "var(--color-card)" },
|
|
24
24
|
labelBgPadding: te,
|
|
25
25
|
labelBgBorderRadius: oe
|
|
26
26
|
}, ie = [
|
|
27
|
-
"relative size-full overflow-hidden bg-
|
|
28
|
-
"[--xy-background-color-default:var(--color-
|
|
27
|
+
"relative size-full overflow-hidden bg-card",
|
|
28
|
+
"[--xy-background-color-default:var(--color-card)]",
|
|
29
29
|
"[--xy-edge-stroke-default:var(--canvas-edge)]",
|
|
30
30
|
"[--xy-edge-stroke-selected-default:var(--color-foreground)]",
|
|
31
|
-
"[--xy-edge-label-background-color-default:var(--color-
|
|
31
|
+
"[--xy-edge-label-background-color-default:var(--color-card)]",
|
|
32
32
|
"[--xy-edge-label-color-default:var(--color-foreground)]",
|
|
33
33
|
"[--xy-connectionline-stroke-default:var(--canvas-edge)]",
|
|
34
|
-
"[--xy-handle-background-color-default:var(--color-
|
|
34
|
+
"[--xy-handle-background-color-default:var(--color-card)]",
|
|
35
35
|
"[--xy-handle-border-color-default:var(--color-border-strong)]",
|
|
36
36
|
"[--xy-selection-background-color-default:var(--color-muted)]",
|
|
37
37
|
"[--xy-node-color-default:var(--color-foreground)]",
|
|
@@ -44,12 +44,12 @@ function S({
|
|
|
44
44
|
snapToGrid: t,
|
|
45
45
|
onSnapToGridChange: i
|
|
46
46
|
}) {
|
|
47
|
-
const { zoomIn: s, zoomOut: c, fitView: d } = K(), u = V((
|
|
47
|
+
const { zoomIn: s, zoomOut: c, fitView: d } = K(), u = V((f) => f.transform[2]);
|
|
48
48
|
return /* @__PURE__ */ b(
|
|
49
49
|
h,
|
|
50
50
|
{
|
|
51
51
|
position: "bottom-right",
|
|
52
|
-
className: "m-3 flex items-center gap-0.5 rounded-lg bg-elevated p-1 shadow-elevation",
|
|
52
|
+
className: "m-3 flex items-center gap-0.5 rounded-lg border border-border bg-elevated p-1 shadow-elevation",
|
|
53
53
|
children: [
|
|
54
54
|
/* @__PURE__ */ e(
|
|
55
55
|
a,
|
|
@@ -124,9 +124,9 @@ function se({
|
|
|
124
124
|
onNodesChange: c,
|
|
125
125
|
onEdgesChange: d,
|
|
126
126
|
onNodeClick: u,
|
|
127
|
-
onPaneClick:
|
|
127
|
+
onPaneClick: f,
|
|
128
128
|
onInit: A,
|
|
129
|
-
readOnly:
|
|
129
|
+
readOnly: g = !1,
|
|
130
130
|
minZoom: C = 0.25,
|
|
131
131
|
maxZoom: N = 1.6,
|
|
132
132
|
fitViewPadding: m = ne,
|
|
@@ -135,11 +135,11 @@ function se({
|
|
|
135
135
|
snapGrid: z = $,
|
|
136
136
|
showControls: B = !0,
|
|
137
137
|
showSnapToGrid: M = !1,
|
|
138
|
-
toolbarStart:
|
|
139
|
-
toolbarEnd:
|
|
138
|
+
toolbarStart: y,
|
|
139
|
+
toolbarEnd: D,
|
|
140
140
|
...L
|
|
141
141
|
}, O) {
|
|
142
|
-
const [P, F] = n.useState(!1), p = E !== void 0,
|
|
142
|
+
const [P, F] = n.useState(!1), p = E !== void 0, k = p ? E : P, G = n.useCallback(
|
|
143
143
|
(_) => {
|
|
144
144
|
p || F(_), r == null || r(_);
|
|
145
145
|
},
|
|
@@ -158,13 +158,13 @@ function se({
|
|
|
158
158
|
onNodesChange: c,
|
|
159
159
|
onEdgesChange: d,
|
|
160
160
|
onNodeClick: u,
|
|
161
|
-
onPaneClick:
|
|
161
|
+
onPaneClick: f,
|
|
162
162
|
onInit: A,
|
|
163
163
|
fitView: !0,
|
|
164
164
|
fitViewOptions: T,
|
|
165
|
-
nodesDraggable: !
|
|
166
|
-
nodesConnectable: !
|
|
167
|
-
snapToGrid:
|
|
165
|
+
nodesDraggable: !g,
|
|
166
|
+
nodesConnectable: !g,
|
|
167
|
+
snapToGrid: k,
|
|
168
168
|
snapGrid: z,
|
|
169
169
|
minZoom: C,
|
|
170
170
|
maxZoom: N,
|
|
@@ -180,14 +180,14 @@ function se({
|
|
|
180
180
|
color: "var(--color-border-strong)"
|
|
181
181
|
}
|
|
182
182
|
),
|
|
183
|
-
|
|
184
|
-
|
|
183
|
+
y && /* @__PURE__ */ e(h, { position: "top-left", className: "m-3 flex items-center gap-2", children: y }),
|
|
184
|
+
D && /* @__PURE__ */ e(h, { position: "top-right", className: "m-3 flex items-center gap-2", children: D }),
|
|
185
185
|
B && /* @__PURE__ */ e(
|
|
186
186
|
S,
|
|
187
187
|
{
|
|
188
188
|
fitViewPadding: m,
|
|
189
|
-
showSnapToGrid: M && !
|
|
190
|
-
snapToGrid:
|
|
189
|
+
showSnapToGrid: M && !g,
|
|
190
|
+
snapToGrid: k,
|
|
191
191
|
onSnapToGridChange: G
|
|
192
192
|
}
|
|
193
193
|
)
|
|
@@ -202,9 +202,9 @@ export {
|
|
|
202
202
|
xe as EdgeLabelRenderer,
|
|
203
203
|
Ee as Handle,
|
|
204
204
|
ce as InfiniteCanvas,
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
205
|
+
ye as MarkerType,
|
|
206
|
+
De as Position,
|
|
207
|
+
ke as ReactFlowProvider,
|
|
208
208
|
_e as addEdge,
|
|
209
209
|
we as getBezierPath,
|
|
210
210
|
Ie as getSmoothStepPath,
|
|
@@ -1,11 +1,26 @@
|
|
|
1
1
|
import { FieldProps } from './field';
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
type InputElement = HTMLInputElement | HTMLTextAreaElement;
|
|
4
|
+
/**
|
|
5
|
+
* InputField — the canonical text control in ADS. A single
|
|
6
|
+
* component that owns the labeled form-field frame (label · control ·
|
|
7
|
+
* description|error) AND the input itself, because that pair is one thing to
|
|
8
|
+
* anyone using it. The composable primitives (`Field`, `Label`,
|
|
9
|
+
* `FieldDescription`, `FieldError`) remain exported for advanced compositions
|
|
10
|
+
* and for wrapping non-input controls (Select, NumberField, Textarea).
|
|
11
|
+
* Its height contract has only two values: 32px for single-line input and
|
|
12
|
+
* 120px for multiline input.
|
|
13
|
+
*
|
|
14
|
+
* Auto-behaviors:
|
|
15
|
+
* • `type="password"` auto-renders an Eye/EyeOff reveal toggle in the end
|
|
16
|
+
* slot (a password input without one is broken UX). A consumer-supplied
|
|
17
|
+
* `endContent` wins the slot.
|
|
18
|
+
* • A generated id is used to wire the label ↔ input pair when the caller
|
|
19
|
+
* doesn't pass one, so a `label` always labels the input for a11y.
|
|
20
|
+
*/
|
|
4
21
|
type FieldOnlyProps = Pick<FieldProps, "label" | "description" | "error" | "required" | "className">;
|
|
5
22
|
type SharedNativeProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "className" | "type">;
|
|
6
23
|
export interface InputFieldProps extends SharedNativeProps, FieldOnlyProps {
|
|
7
|
-
/** Control size — sm / md / lg (defaults to md). */
|
|
8
|
-
size?: "sm" | "md" | "lg";
|
|
9
24
|
startContent?: React.ReactNode;
|
|
10
25
|
endContent?: React.ReactNode;
|
|
11
26
|
isInvalid?: boolean;
|
|
@@ -13,7 +28,7 @@ export interface InputFieldProps extends SharedNativeProps, FieldOnlyProps {
|
|
|
13
28
|
inputClassName?: string;
|
|
14
29
|
/** Native input type when single-line; ignored when `multiline`. */
|
|
15
30
|
type?: React.HTMLInputTypeAttribute;
|
|
16
|
-
/** Render
|
|
31
|
+
/** Render the 120px multi-line textarea instead of the 32px input. */
|
|
17
32
|
multiline?: boolean;
|
|
18
33
|
/** Only used when `multiline` — passes through to `<textarea rows>`. */
|
|
19
34
|
rows?: number;
|
|
@@ -1,96 +1,112 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import * as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { EyeOff as
|
|
6
|
-
import { inputBaseClass as
|
|
7
|
-
const
|
|
8
|
-
sm: "h-8 text-xs",
|
|
9
|
-
md: "h-10 text-xs",
|
|
10
|
-
lg: "h-11 text-base"
|
|
11
|
-
}, G = a.forwardRef(
|
|
2
|
+
import { jsx as t, jsxs as C } from "react/jsx-runtime";
|
|
3
|
+
import * as i from "react";
|
|
4
|
+
import { cn as G } from "../lib/cn.js";
|
|
5
|
+
import { EyeOff as J, Eye as L } from "../lib/icons.js";
|
|
6
|
+
import { inputBaseClass as M, Field as Q } from "./field.js";
|
|
7
|
+
const U = i.forwardRef(
|
|
12
8
|
({
|
|
13
9
|
// Field props
|
|
14
|
-
label:
|
|
15
|
-
description:
|
|
16
|
-
error:
|
|
17
|
-
required:
|
|
18
|
-
className:
|
|
10
|
+
label: v,
|
|
11
|
+
description: d,
|
|
12
|
+
error: o,
|
|
13
|
+
required: m,
|
|
14
|
+
className: B,
|
|
19
15
|
// Input props
|
|
20
|
-
id:
|
|
21
|
-
inputClassName:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
16
|
+
id: R,
|
|
17
|
+
inputClassName: T,
|
|
18
|
+
startContent: r,
|
|
19
|
+
endContent: _,
|
|
20
|
+
isInvalid: g,
|
|
21
|
+
type: h,
|
|
22
|
+
multiline: l = !1,
|
|
23
|
+
rows: $,
|
|
24
|
+
"aria-describedby": H,
|
|
25
|
+
onBlur: c,
|
|
26
|
+
onKeyDown: u,
|
|
27
|
+
...s
|
|
28
|
+
}, p) => {
|
|
29
|
+
const O = i.useId(), a = R ?? O, x = (e) => e != null && String(e).length > 0, [b, y] = i.useState(
|
|
30
|
+
() => x(s.value ?? s.defaultValue)
|
|
31
|
+
);
|
|
32
|
+
i.useEffect(() => {
|
|
33
|
+
s.value !== void 0 && y(x(s.value));
|
|
34
|
+
}, [s.value]);
|
|
35
|
+
const w = (e) => {
|
|
36
|
+
y(e.value.length > 0);
|
|
37
|
+
}, I = (e) => {
|
|
38
|
+
w(e.currentTarget), c == null || c(e);
|
|
39
|
+
}, N = (e) => {
|
|
40
|
+
!l && e.key === "Enter" && w(e.currentTarget), u == null || u(e);
|
|
41
|
+
}, E = `${a}-error`, S = `${a}-description`, V = [H, o ? E : d ? S : null].filter(Boolean).join(" ") || void 0, [f, A] = i.useState(!1), F = !l && h === "password", n = _ ?? (F ? /* @__PURE__ */ t(
|
|
33
42
|
"button",
|
|
34
43
|
{
|
|
35
44
|
type: "button",
|
|
36
|
-
"aria-label":
|
|
37
|
-
onClick: () =>
|
|
45
|
+
"aria-label": f ? "Hide password" : "Show password",
|
|
46
|
+
onClick: () => A((e) => !e),
|
|
38
47
|
className: "-mr-1 flex items-center rounded-xs p-1 outline-none transition-colors hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring",
|
|
39
|
-
children:
|
|
48
|
+
children: f ? /* @__PURE__ */ t(J, {}) : /* @__PURE__ */ t(L, {})
|
|
40
49
|
}
|
|
41
|
-
) : void 0),
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
50
|
+
) : void 0), j = G(
|
|
51
|
+
M,
|
|
52
|
+
l ? "h-30 resize-none py-2" : "h-8",
|
|
53
|
+
"data-[value-set]:text-on-white-primary!",
|
|
54
|
+
r && "pl-9",
|
|
55
|
+
n && "pr-9",
|
|
56
|
+
T
|
|
57
|
+
), k = l ? /* @__PURE__ */ t(
|
|
48
58
|
"textarea",
|
|
49
59
|
{
|
|
50
|
-
ref:
|
|
51
|
-
id:
|
|
52
|
-
rows:
|
|
53
|
-
"aria-invalid":
|
|
54
|
-
"aria-describedby":
|
|
55
|
-
|
|
56
|
-
|
|
60
|
+
ref: p,
|
|
61
|
+
id: a,
|
|
62
|
+
rows: $ ?? 3,
|
|
63
|
+
"aria-invalid": g || !!o || void 0,
|
|
64
|
+
"aria-describedby": V,
|
|
65
|
+
"data-value-set": b || void 0,
|
|
66
|
+
className: j,
|
|
67
|
+
onBlur: I,
|
|
68
|
+
onKeyDown: N,
|
|
69
|
+
...s
|
|
57
70
|
}
|
|
58
|
-
) : /* @__PURE__ */
|
|
71
|
+
) : /* @__PURE__ */ t(
|
|
59
72
|
"input",
|
|
60
73
|
{
|
|
61
|
-
ref:
|
|
62
|
-
id:
|
|
63
|
-
type:
|
|
64
|
-
"aria-invalid":
|
|
65
|
-
"aria-describedby":
|
|
66
|
-
|
|
67
|
-
|
|
74
|
+
ref: p,
|
|
75
|
+
id: a,
|
|
76
|
+
type: F && f ? "text" : h,
|
|
77
|
+
"aria-invalid": g || !!o || void 0,
|
|
78
|
+
"aria-describedby": V,
|
|
79
|
+
"data-value-set": b || void 0,
|
|
80
|
+
className: j,
|
|
81
|
+
onBlur: I,
|
|
82
|
+
onKeyDown: N,
|
|
83
|
+
...s
|
|
68
84
|
}
|
|
69
|
-
),
|
|
85
|
+
), z = r || n ? (
|
|
70
86
|
// group/field: adornment icons follow the field's interactive states.
|
|
71
|
-
/* @__PURE__ */
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
87
|
+
/* @__PURE__ */ C("div", { className: "group/field relative w-full", children: [
|
|
88
|
+
r && /* @__PURE__ */ t("span", { className: "pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3 text-muted-foreground transition-colors duration-150 group-hover/field:text-foreground group-focus-within/field:text-g12! [&_svg]:size-4", children: r }),
|
|
89
|
+
k,
|
|
90
|
+
n && /* @__PURE__ */ t("span", { className: "absolute inset-y-0 right-0 flex items-center pr-3 text-muted-foreground transition-colors duration-150 group-hover/field:text-foreground group-focus-within/field:text-g12! [&_svg]:size-4", children: n })
|
|
75
91
|
] })
|
|
76
|
-
) :
|
|
77
|
-
return !
|
|
78
|
-
|
|
92
|
+
) : k;
|
|
93
|
+
return !v && !d && !o && !m ? z : /* @__PURE__ */ t(
|
|
94
|
+
Q,
|
|
79
95
|
{
|
|
80
|
-
label:
|
|
81
|
-
description:
|
|
82
|
-
error:
|
|
83
|
-
required:
|
|
84
|
-
htmlFor:
|
|
85
|
-
errorId:
|
|
86
|
-
descriptionId:
|
|
87
|
-
className:
|
|
88
|
-
children:
|
|
96
|
+
label: v,
|
|
97
|
+
description: d,
|
|
98
|
+
error: o,
|
|
99
|
+
required: m,
|
|
100
|
+
htmlFor: a,
|
|
101
|
+
errorId: E,
|
|
102
|
+
descriptionId: S,
|
|
103
|
+
className: B,
|
|
104
|
+
children: z
|
|
89
105
|
}
|
|
90
106
|
);
|
|
91
107
|
}
|
|
92
108
|
);
|
|
93
|
-
|
|
109
|
+
U.displayName = "InputField";
|
|
94
110
|
export {
|
|
95
|
-
|
|
111
|
+
U as InputField
|
|
96
112
|
};
|
package/components/input.js
CHANGED
|
@@ -1,61 +1,64 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as e, jsxs as
|
|
3
|
-
import * as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { EyeOff as
|
|
2
|
+
import { jsx as e, jsxs as v } from "react/jsx-runtime";
|
|
3
|
+
import * as l from "react";
|
|
4
|
+
import { cn as h } from "../lib/cn.js";
|
|
5
|
+
import { EyeOff as x, Eye as w } from "../lib/icons.js";
|
|
6
6
|
import { inputBaseClass as b } from "./field.js";
|
|
7
|
-
const
|
|
8
|
-
sm: "h-8 rounded-sm
|
|
9
|
-
md: "h-
|
|
10
|
-
lg: "h-11 rounded-md
|
|
11
|
-
},
|
|
7
|
+
const N = {
|
|
8
|
+
sm: "h-8 rounded-sm",
|
|
9
|
+
md: "h-8 rounded-md",
|
|
10
|
+
lg: "h-11 rounded-md"
|
|
11
|
+
}, y = l.forwardRef(
|
|
12
12
|
({
|
|
13
|
-
className:
|
|
13
|
+
className: d,
|
|
14
14
|
size: a = "md",
|
|
15
15
|
startContent: o,
|
|
16
16
|
endContent: u,
|
|
17
17
|
isInvalid: f,
|
|
18
|
-
type:
|
|
18
|
+
type: s,
|
|
19
19
|
...c
|
|
20
20
|
}, m) => {
|
|
21
|
-
const [
|
|
21
|
+
const [i, p] = l.useState(!1), n = s === "password", r = u ?? (n ? /* @__PURE__ */ e(
|
|
22
22
|
"button",
|
|
23
23
|
{
|
|
24
24
|
type: "button",
|
|
25
|
-
"aria-label":
|
|
26
|
-
onClick: () => p((
|
|
25
|
+
"aria-label": i ? "Hide password" : "Show password",
|
|
26
|
+
onClick: () => p((g) => !g),
|
|
27
27
|
className: "-mr-1 flex items-center rounded-xs p-1 outline-none transition-colors hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring",
|
|
28
|
-
children:
|
|
28
|
+
children: i ? /* @__PURE__ */ e(x, {}) : /* @__PURE__ */ e(w, {})
|
|
29
29
|
}
|
|
30
|
-
) : void 0),
|
|
30
|
+
) : void 0), t = /* @__PURE__ */ e(
|
|
31
31
|
"input",
|
|
32
32
|
{
|
|
33
33
|
ref: m,
|
|
34
|
-
type:
|
|
34
|
+
type: n && i ? "text" : s,
|
|
35
35
|
"aria-invalid": f || void 0,
|
|
36
|
-
className:
|
|
36
|
+
className: h(
|
|
37
37
|
b,
|
|
38
|
-
|
|
38
|
+
// Search controls are flat, stroke-only surfaces with regular copy.
|
|
39
|
+
s === "search" && "font-normal [--glow-inset:none]",
|
|
40
|
+
"leading-none",
|
|
41
|
+
N[a],
|
|
39
42
|
o && "pl-9",
|
|
40
43
|
r && "pr-9",
|
|
41
|
-
|
|
44
|
+
d
|
|
42
45
|
),
|
|
43
46
|
...c
|
|
44
47
|
}
|
|
45
48
|
);
|
|
46
|
-
return !o && !r ?
|
|
49
|
+
return !o && !r ? t : (
|
|
47
50
|
// group/field: adornment icons follow the field's interactive states —
|
|
48
|
-
// muted at rest,
|
|
49
|
-
//
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
-
o && /* @__PURE__ */ e("span", { className: "pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3 text-muted-foreground transition-colors duration-150 group-
|
|
52
|
-
|
|
53
|
-
r && /* @__PURE__ */ e("span", { className: "absolute inset-y-0 right-0 flex items-center pr-3 text-muted-foreground transition-colors duration-150 group-
|
|
51
|
+
// muted at rest, readable on hover, and G12 green while the
|
|
52
|
+
// control is focused. Important keeps focus green while still hovered.
|
|
53
|
+
/* @__PURE__ */ v("div", { className: "group/field relative w-full", children: [
|
|
54
|
+
o && /* @__PURE__ */ e("span", { className: "pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3 text-muted-foreground transition-colors duration-150 group-hover/field:text-foreground group-focus-within/field:text-g12! [&_svg]:size-4", children: o }),
|
|
55
|
+
t,
|
|
56
|
+
r && /* @__PURE__ */ e("span", { className: "absolute inset-y-0 right-0 flex items-center pr-3 text-muted-foreground transition-colors duration-150 group-hover/field:text-foreground group-focus-within/field:text-g12! [&_svg]:size-4", children: r })
|
|
54
57
|
] })
|
|
55
58
|
);
|
|
56
59
|
}
|
|
57
60
|
);
|
|
58
|
-
|
|
61
|
+
y.displayName = "Input";
|
|
59
62
|
export {
|
|
60
|
-
|
|
63
|
+
y as Input
|
|
61
64
|
};
|
package/components/modal.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
declare const panelVariants: (props?: ({
|
|
4
|
-
size?: "sm" | "md" | "lg" | "
|
|
4
|
+
size?: "xl" | "sm" | "md" | "lg" | "full" | null | undefined;
|
|
5
|
+
position?: "top" | "center" | null | undefined;
|
|
5
6
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
7
|
export interface ModalProps extends VariantProps<typeof panelVariants> {
|
|
7
8
|
open: boolean;
|
|
@@ -9,14 +10,41 @@ export interface ModalProps extends VariantProps<typeof panelVariants> {
|
|
|
9
10
|
className?: string;
|
|
10
11
|
children: React.ReactNode;
|
|
11
12
|
showCloseButton?: boolean;
|
|
13
|
+
/** Close when the scrim is pressed. */
|
|
14
|
+
closeOnOverlayClick?: boolean;
|
|
15
|
+
/** Close when Escape is pressed. */
|
|
16
|
+
closeOnEscape?: boolean;
|
|
17
|
+
/** Portal into a custom host instead of document.body. */
|
|
18
|
+
container?: HTMLElement | null;
|
|
19
|
+
/** Focus this element when the modal opens. */
|
|
20
|
+
initialFocusRef?: React.RefObject<HTMLElement | null>;
|
|
21
|
+
/** Runs after the exit animation has completed. */
|
|
22
|
+
onAfterClose?: () => void;
|
|
23
|
+
/** Runs after focus has moved into the opened modal. */
|
|
24
|
+
onAfterOpen?: () => void;
|
|
25
|
+
overlayClassName?: string;
|
|
26
|
+
viewportClassName?: string;
|
|
12
27
|
"aria-label"?: string;
|
|
13
28
|
"aria-labelledby"?: string;
|
|
14
29
|
"aria-describedby"?: string;
|
|
15
30
|
}
|
|
16
|
-
|
|
31
|
+
/**
|
|
32
|
+
* ADS modal, modelled on the public Polaris dialog pattern while remaining an
|
|
33
|
+
* ADS-owned primitive. Radix owns focus trapping, page inerting, Escape,
|
|
34
|
+
* outside interaction, scroll locking, and focus restoration. ADS owns the
|
|
35
|
+
* geometry, tokens, motion, and composable header/body/footer anatomy.
|
|
36
|
+
*/
|
|
37
|
+
export declare function Modal({ open, onOpenChange, size, position, className, children, showCloseButton, closeOnOverlayClick, closeOnEscape, container, initialFocusRef, onAfterClose, onAfterOpen, overlayClassName, viewportClassName, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, }: ModalProps): React.JSX.Element;
|
|
38
|
+
export declare const ModalClose: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement>>;
|
|
17
39
|
export declare const ModalHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
18
40
|
export declare const ModalTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLHeadingElement>>;
|
|
19
41
|
export declare const ModalDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
20
|
-
export
|
|
42
|
+
export interface ModalBodyProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
43
|
+
/** Remove the default 20px inset for media, tables, or custom sections. */
|
|
44
|
+
padding?: "default" | "none";
|
|
45
|
+
}
|
|
46
|
+
export declare const ModalBody: React.ForwardRefExoticComponent<ModalBodyProps & React.RefAttributes<HTMLDivElement>>;
|
|
47
|
+
/** A padded, divider-aware section for an edge-to-edge ModalBody. */
|
|
48
|
+
export declare const ModalSection: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
21
49
|
export declare const ModalFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
22
50
|
export {};
|