@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.
Files changed (123) hide show
  1. package/DESIGN.md +597 -0
  2. package/components/ai-elements/agent-trace.d.ts +2 -2
  3. package/components/ai-elements/agent-trace.js +164 -105
  4. package/components/ai-elements/chain-of-thought.d.ts +2 -2
  5. package/components/ai-elements/chain-of-thought.js +1 -1
  6. package/components/ai-elements/index.d.ts +0 -5
  7. package/components/ai-elements/inline-citation.js +1 -1
  8. package/components/alert.d.ts +6 -6
  9. package/components/alert.js +89 -53
  10. package/components/answer-sources.d.ts +2 -6
  11. package/components/answer-sources.js +58 -60
  12. package/components/answer.d.ts +5 -0
  13. package/components/answer.js +311 -271
  14. package/components/assistant-ui/action-bar.js +1 -1
  15. package/components/assistant-ui/attachment.js +11 -11
  16. package/components/assistant-ui/badge.js +18 -18
  17. package/components/assistant-ui/composer-harness.js +15 -20
  18. package/components/assistant-ui/composer-trigger-popover.js +9 -9
  19. package/components/assistant-ui/composer.d.ts +3 -1
  20. package/components/assistant-ui/composer.js +148 -144
  21. package/components/assistant-ui/image.js +61 -61
  22. package/components/assistant-ui/index.d.ts +0 -3
  23. package/components/assistant-ui/message-timing.js +1 -1
  24. package/components/assistant-ui/selection-toolbar.js +7 -7
  25. package/components/assistant-ui/thread-context.d.ts +3 -1
  26. package/components/assistant-ui/thread.js +50 -42
  27. package/components/avatar.js +42 -42
  28. package/components/badge.d.ts +5 -6
  29. package/components/badge.js +13 -76
  30. package/components/body-page-header.d.ts +15 -0
  31. package/components/body-page-header.js +24 -0
  32. package/components/brand-loader.d.ts +0 -3
  33. package/components/brand-loader.js +10 -32
  34. package/components/breadcrumbs.d.ts +0 -7
  35. package/components/breadcrumbs.js +54 -71
  36. package/components/button.d.ts +1 -1
  37. package/components/button.js +55 -49
  38. package/components/chart.js +298 -296
  39. package/components/chip.d.ts +13 -1
  40. package/components/chip.js +93 -80
  41. package/components/collection-header.d.ts +17 -0
  42. package/components/collection-header.js +31 -0
  43. package/components/connector-card.d.ts +6 -6
  44. package/components/connector-card.js +31 -32
  45. package/components/date-range-picker.d.ts +2 -1
  46. package/components/date-range-picker.js +158 -122
  47. package/components/divider.js +25 -25
  48. package/components/drawer.d.ts +6 -2
  49. package/components/drawer.js +61 -58
  50. package/components/dropdown.d.ts +1 -2
  51. package/components/dropdown.js +88 -89
  52. package/components/field.js +41 -36
  53. package/components/file-dropzone.js +1 -1
  54. package/components/index.d.ts +4 -4
  55. package/components/index.js +501 -549
  56. package/components/infinite-canvas.js +24 -24
  57. package/components/input-field.d.ts +18 -3
  58. package/components/input-field.js +88 -72
  59. package/components/input.js +32 -29
  60. package/components/modal.d.ts +31 -3
  61. package/components/modal.js +244 -170
  62. package/components/number-field.js +45 -42
  63. package/components/page-body.d.ts +12 -0
  64. package/components/page-body.js +18 -0
  65. package/components/pagination.js +36 -36
  66. package/components/pixel-blast-svg.js +71 -73
  67. package/components/select.d.ts +21 -0
  68. package/components/select.js +189 -148
  69. package/components/setting-row.d.ts +6 -5
  70. package/components/setting-row.js +33 -32
  71. package/components/sidebar.d.ts +2 -0
  72. package/components/sidebar.js +151 -141
  73. package/components/skeleton.js +8 -7
  74. package/components/slider.js +1 -1
  75. package/components/surface-loader.d.ts +11 -0
  76. package/components/surface-loader.js +35 -0
  77. package/components/table.d.ts +16 -10
  78. package/components/table.js +427 -412
  79. package/components/tabs.d.ts +2 -0
  80. package/components/tabs.js +160 -295
  81. package/components/textarea.js +9 -9
  82. package/components/toast.d.ts +1 -1
  83. package/components/toast.js +181 -118
  84. package/components/tree.d.ts +5 -1
  85. package/components/tree.js +54 -49
  86. package/components/typography.d.ts +4 -4
  87. package/components/typography.js +13 -13
  88. package/components/ui/button.d.ts +1 -1
  89. package/components/ui/button.js +4 -4
  90. package/components/ui/dialog.js +25 -25
  91. package/demo/components/add-to-artifact.js +6 -10
  92. package/lib/cn.js +11 -4
  93. package/lib/icons.d.ts +4 -0
  94. package/lib/icons.js +103 -102
  95. package/lib/interactive.d.ts +1 -1
  96. package/llms.txt +132 -188
  97. package/manifest.json +1719 -2831
  98. package/package.json +2 -2
  99. package/styles.css +362 -233
  100. package/theme.css +312 -177
  101. package/components/agent-icon.d.ts +0 -76
  102. package/components/agent-icon.js +0 -265
  103. package/components/ai-elements/queue.d.ts +0 -60
  104. package/components/ai-elements/queue.js +0 -193
  105. package/components/ai-elements/speech-input.d.ts +0 -16
  106. package/components/ai-elements/speech-input.js +0 -151
  107. package/components/ai-elements/task-progress.d.ts +0 -41
  108. package/components/ai-elements/task-progress.js +0 -224
  109. package/components/ai-elements/task.d.ts +0 -39
  110. package/components/ai-elements/task.js +0 -105
  111. package/components/ai-elements/voice.d.ts +0 -90
  112. package/components/ai-elements/voice.js +0 -496
  113. package/components/assistant-ui/follow-up-suggestions.d.ts +0 -11
  114. package/components/assistant-ui/follow-up-suggestions.js +0 -72
  115. package/components/assistant-ui/suggestions.d.ts +0 -7
  116. package/components/assistant-ui/suggestions.js +0 -19
  117. package/components/assistant-ui/voice.d.ts +0 -18
  118. package/components/link.d.ts +0 -14
  119. package/components/link.js +0 -72
  120. package/components/navbar.d.ts +0 -15
  121. package/components/navbar.js +0 -68
  122. package/components/pixel-icon.d.ts +0 -37
  123. 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 ke, Position as ye, ReactFlowProvider as De, addEdge as _e, getBezierPath as we, getSmoothStepPath as Ie, getStraightPath as Re, useEdgesState as Se, useNodesState as Ae, useReactFlow as Ce } from "@xyflow/react";
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-background)" },
23
+ labelBgStyle: { fill: "var(--color-card)" },
24
24
  labelBgPadding: te,
25
25
  labelBgBorderRadius: oe
26
26
  }, ie = [
27
- "relative size-full overflow-hidden bg-background",
28
- "[--xy-background-color-default:var(--color-background)]",
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-background)]",
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-background)]",
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((g) => g.transform[2]);
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: g,
127
+ onPaneClick: f,
128
128
  onInit: A,
129
- readOnly: f = !1,
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: k,
139
- toolbarEnd: y,
138
+ toolbarStart: y,
139
+ toolbarEnd: D,
140
140
  ...L
141
141
  }, O) {
142
- const [P, F] = n.useState(!1), p = E !== void 0, D = p ? E : P, G = n.useCallback(
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: g,
161
+ onPaneClick: f,
162
162
  onInit: A,
163
163
  fitView: !0,
164
164
  fitViewOptions: T,
165
- nodesDraggable: !f,
166
- nodesConnectable: !f,
167
- snapToGrid: D,
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
- k && /* @__PURE__ */ e(h, { position: "top-left", className: "m-3 flex items-center gap-2", children: k }),
184
- y && /* @__PURE__ */ e(h, { position: "top-right", className: "m-3 flex items-center gap-2", children: y }),
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 && !f,
190
- snapToGrid: D,
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
- ke as MarkerType,
206
- ye as Position,
207
- De as ReactFlowProvider,
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 a multi-line textarea instead of a single-line input. */
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 e, jsxs as _ } from "react/jsx-runtime";
3
- import * as a from "react";
4
- import { cn as $ } from "../lib/cn.js";
5
- import { EyeOff as C, Eye as H } from "../lib/icons.js";
6
- import { inputBaseClass as O, Field as A } from "./field.js";
7
- const D = {
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: l,
15
- description: r,
16
- error: s,
17
- required: c,
18
- className: N,
10
+ label: v,
11
+ description: d,
12
+ error: o,
13
+ required: m,
14
+ className: B,
19
15
  // Input props
20
- id: I,
21
- inputClassName: z,
22
- size: B = "md",
23
- startContent: t,
24
- endContent: E,
25
- isInvalid: u,
26
- type: f,
27
- multiline: n = !1,
28
- rows: F,
29
- "aria-describedby": j,
30
- ...p
31
- }, m) => {
32
- const R = a.useId(), o = I ?? R, x = `${o}-error`, g = `${o}-description`, v = [j, s ? x : r ? g : null].filter(Boolean).join(" ") || void 0, [d, k] = a.useState(!1), h = !n && f === "password", i = E ?? (h ? /* @__PURE__ */ e(
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": d ? "Hide password" : "Show password",
37
- onClick: () => k((S) => !S),
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: d ? /* @__PURE__ */ e(C, {}) : /* @__PURE__ */ e(H, {})
48
+ children: f ? /* @__PURE__ */ t(J, {}) : /* @__PURE__ */ t(L, {})
40
49
  }
41
- ) : void 0), b = $(
42
- O,
43
- n ? "min-h-20 resize-y py-2 text-xs" : D[B],
44
- t && "pl-9",
45
- i && "pr-9",
46
- z
47
- ), y = n ? /* @__PURE__ */ e(
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: m,
51
- id: o,
52
- rows: F ?? 3,
53
- "aria-invalid": u || !!s || void 0,
54
- "aria-describedby": v,
55
- className: b,
56
- ...p
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__ */ e(
71
+ ) : /* @__PURE__ */ t(
59
72
  "input",
60
73
  {
61
- ref: m,
62
- id: o,
63
- type: h && d ? "text" : f,
64
- "aria-invalid": u || !!s || void 0,
65
- "aria-describedby": v,
66
- className: b,
67
- ...p
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
- ), w = t || i ? (
85
+ ), z = r || n ? (
70
86
  // group/field: adornment icons follow the field's interactive states.
71
- /* @__PURE__ */ _("div", { className: "group/field relative w-full", children: [
72
- t && /* @__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-focus-within/field:text-foreground group-hover/field:text-foreground [&_svg]:size-4", children: t }),
73
- y,
74
- i && /* @__PURE__ */ e("span", { className: "absolute inset-y-0 right-0 flex items-center pr-3 text-muted-foreground transition-colors duration-150 group-focus-within/field:text-foreground group-hover/field:text-foreground [&_svg]:size-4", children: i })
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
- ) : y;
77
- return !l && !r && !s && !c ? w : /* @__PURE__ */ e(
78
- A,
92
+ ) : k;
93
+ return !v && !d && !o && !m ? z : /* @__PURE__ */ t(
94
+ Q,
79
95
  {
80
- label: l,
81
- description: r,
82
- error: s,
83
- required: c,
84
- htmlFor: o,
85
- errorId: x,
86
- descriptionId: g,
87
- className: N,
88
- children: w
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
- G.displayName = "InputField";
109
+ U.displayName = "InputField";
94
110
  export {
95
- G as InputField
111
+ U as InputField
96
112
  };
@@ -1,61 +1,64 @@
1
1
  "use client";
2
- import { jsx as e, jsxs as g } from "react/jsx-runtime";
3
- import * as d from "react";
4
- import { cn as v } from "../lib/cn.js";
5
- import { EyeOff as h, Eye as w } from "../lib/icons.js";
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 y = {
8
- sm: "h-8 rounded-sm text-xs",
9
- md: "h-10 rounded-md text-xs",
10
- lg: "h-11 rounded-md text-base"
11
- }, N = d.forwardRef(
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: l,
13
+ className: d,
14
14
  size: a = "md",
15
15
  startContent: o,
16
16
  endContent: u,
17
17
  isInvalid: f,
18
- type: t,
18
+ type: s,
19
19
  ...c
20
20
  }, m) => {
21
- const [s, p] = d.useState(!1), i = t === "password", r = u ?? (i ? /* @__PURE__ */ e(
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": s ? "Hide password" : "Show password",
26
- onClick: () => p((x) => !x),
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: s ? /* @__PURE__ */ e(h, {}) : /* @__PURE__ */ e(w, {})
28
+ children: i ? /* @__PURE__ */ e(x, {}) : /* @__PURE__ */ e(w, {})
29
29
  }
30
- ) : void 0), n = /* @__PURE__ */ e(
30
+ ) : void 0), t = /* @__PURE__ */ e(
31
31
  "input",
32
32
  {
33
33
  ref: m,
34
- type: i && s ? "text" : t,
34
+ type: n && i ? "text" : s,
35
35
  "aria-invalid": f || void 0,
36
- className: v(
36
+ className: h(
37
37
  b,
38
- y[a],
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
- l
44
+ d
42
45
  ),
43
46
  ...c
44
47
  }
45
48
  );
46
- return !o && !r ? n : (
49
+ return !o && !r ? t : (
47
50
  // group/field: adornment icons follow the field's interactive states —
48
- // muted at rest, full black while hovered/focused (same signal as the
49
- // border snapping to brand).
50
- /* @__PURE__ */ g("div", { className: "group/field relative w-full", children: [
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-focus-within/field:text-foreground group-hover/field:text-foreground [&_svg]:size-4", children: o }),
52
- n,
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-focus-within/field:text-foreground group-hover/field:text-foreground [&_svg]:size-4", children: r })
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
- N.displayName = "Input";
61
+ y.displayName = "Input";
59
62
  export {
60
- N as Input
63
+ y as Input
61
64
  };
@@ -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" | "xl" | null | undefined;
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
- export declare function Modal({ open, onOpenChange, size, className, children, showCloseButton, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, }: ModalProps): React.ReactPortal;
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 declare const ModalBody: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
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 {};