@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
@@ -1,203 +1,277 @@
1
1
  "use client";
2
- import { jsx as a, jsxs as y } from "react/jsx-runtime";
3
- import * as n from "react";
4
- import { createPortal as F } from "react-dom";
5
- import { MotionConfig as j, AnimatePresence as z, motion as h } from "motion/react";
6
- import { Close as P } from "../lib/icons.js";
7
- import { cva as T } from "class-variance-authority";
8
- import { cn as i } from "../lib/cn.js";
9
- import { backdropVariants as V, modalPanelVariants as H } from "../lib/motion.js";
10
- import { Ripple as L } from "./ripple.js";
11
- const q = T(
2
+ import { jsx as t, jsxs as y } from "react/jsx-runtime";
3
+ import * as r from "react";
4
+ import { MotionConfig as T, AnimatePresence as B, motion as g } from "motion/react";
5
+ import { Dialog as m } from "radix-ui";
6
+ import { cva as H } from "class-variance-authority";
7
+ import { Close as S } from "../lib/icons.js";
8
+ import { cn as n } from "../lib/cn.js";
9
+ import { backdropVariants as K, modalPanelVariants as q } from "../lib/motion.js";
10
+ const A = H(
12
11
  [
13
- "relative flex w-full flex-col",
14
- // Cap height to the viewport and clip, so a tall modal scrolls its body
15
- // (below) instead of pushing the footer's action off-screen.
16
- "max-h-[calc(100dvh-2rem)] overflow-hidden",
17
- "bg-elevated text-foreground",
18
- "rounded-xl shadow-elevation"
12
+ "pointer-events-auto relative flex w-full min-w-0 flex-col overflow-hidden",
13
+ "max-h-[calc(100dvh-2rem)] bg-elevated text-foreground outline-none",
14
+ "rounded-xl shadow-400",
15
+ "max-sm:max-h-[calc(100dvh-1rem)] max-sm:rounded-lg"
19
16
  ],
20
17
  {
21
18
  variants: {
22
19
  size: {
23
- sm: "max-w-sm",
24
- md: "max-w-md",
25
- lg: "max-w-lg",
26
- xl: "max-w-2xl"
20
+ /** Quick confirmations and short prompts. */
21
+ sm: "max-w-[23.75rem]",
22
+ /** Polaris-style default task dialog. */
23
+ md: "max-w-[38.75rem]",
24
+ /** Dense forms, settings, and previews. */
25
+ lg: "max-w-[48.75rem]",
26
+ /** Tables and content-heavy workflows. */
27
+ xl: "max-w-[61.25rem]",
28
+ /** Responsive canvas with a 16px viewport gutter. */
29
+ full: "h-[calc(100dvh-2rem)] max-w-none"
30
+ },
31
+ position: {
32
+ center: "",
33
+ top: ""
27
34
  }
28
35
  },
29
- defaultVariants: { size: "md" }
36
+ defaultVariants: {
37
+ size: "md",
38
+ position: "center"
39
+ }
30
40
  }
31
- );
32
- function Z({
41
+ ), x = r.createContext(null);
42
+ function M(o) {
43
+ return r.Children.toArray(o).some((e) => r.isValidElement(e) ? e.type === N ? !0 : M(
44
+ e.props.children
45
+ ) : !1);
46
+ }
47
+ function ee({
33
48
  open: o,
34
- onOpenChange: t,
35
- size: r,
36
- className: g,
37
- children: w,
38
- showCloseButton: M = !0,
39
- "aria-label": N,
40
- "aria-labelledby": k,
41
- "aria-describedby": R
49
+ onOpenChange: e,
50
+ size: a,
51
+ position: i,
52
+ className: l,
53
+ children: d,
54
+ showCloseButton: C = !0,
55
+ closeOnOverlayClick: D = !0,
56
+ closeOnEscape: z = !0,
57
+ container: I,
58
+ initialFocusRef: c,
59
+ onAfterClose: R,
60
+ onAfterOpen: u,
61
+ overlayClassName: j,
62
+ viewportClassName: V,
63
+ "aria-label": v,
64
+ "aria-labelledby": _,
65
+ "aria-describedby": k
42
66
  }) {
43
- const d = n.useRef(null), f = n.useRef(null), u = n.useRef(null);
44
- return n.useEffect(() => {
45
- if (!o) return;
46
- u.current = document.activeElement;
47
- const E = document.body.style.overflow;
48
- document.body.style.overflow = "hidden";
49
- const m = f.current, p = [];
50
- if (m)
51
- for (const e of Array.from(document.body.children))
52
- e !== m && e instanceof HTMLElement && !e.inert && (e.inert = !0, p.push(e));
53
- const A = () => {
54
- var e;
55
- return Array.from(
56
- ((e = d.current) == null ? void 0 : e.querySelectorAll(
57
- 'a[href],button:not([disabled]),textarea:not([disabled]),input:not([disabled]),select:not([disabled]),[tabindex]:not([tabindex="-1"])'
58
- )) ?? []
59
- );
60
- }, b = (e) => {
61
- if (e.key === "Escape") {
62
- e.stopPropagation(), t(!1);
63
- return;
64
- }
65
- if (e.key !== "Tab") return;
66
- const l = d.current;
67
- if (!l) return;
68
- const s = A();
69
- if (s.length === 0) {
70
- e.preventDefault(), l.focus();
71
- return;
72
- }
73
- const x = s[0], v = s[s.length - 1], c = document.activeElement;
74
- e.shiftKey ? (c === x || c === l) && (e.preventDefault(), v.focus()) : c === v && (e.preventDefault(), x.focus());
75
- };
76
- document.addEventListener("keydown", b);
77
- const D = requestAnimationFrame(() => {
78
- var e;
79
- (e = d.current) == null || e.focus();
80
- });
81
- return () => {
82
- var e, l;
83
- document.removeEventListener("keydown", b), document.body.style.overflow = E;
84
- for (const s of p) s.inert = !1;
85
- cancelAnimationFrame(D), (l = (e = u.current) == null ? void 0 : e.focus) == null || l.call(e);
86
- };
87
- }, [o, t]), F(
88
- /* @__PURE__ */ a(j, { reducedMotion: "user", children: /* @__PURE__ */ a(z, { children: o && /* @__PURE__ */ y("div", { ref: f, className: "fixed inset-0 z-50 flex items-center justify-center p-4", children: [
89
- /* @__PURE__ */ a(
90
- h.div,
91
- {
92
- variants: V,
93
- initial: "hidden",
94
- animate: "visible",
95
- exit: "hidden",
96
- className: "absolute inset-0 bg-overlay",
97
- onClick: () => t(!1),
98
- "aria-hidden": !0
99
- },
100
- "backdrop"
101
- ),
102
- /* @__PURE__ */ y(
103
- h.div,
104
- {
105
- ref: d,
106
- variants: H,
107
- initial: "hidden",
108
- animate: "visible",
109
- exit: "hidden",
110
- role: "dialog",
111
- "aria-modal": "true",
112
- "aria-label": N,
113
- "aria-labelledby": k,
114
- "aria-describedby": R,
115
- tabIndex: -1,
116
- className: i(q({ size: r }), "relative outline-none", g),
117
- children: [
118
- /* @__PURE__ */ a(L, { origin: "center" }),
119
- M ? /* @__PURE__ */ a(
120
- "button",
67
+ const b = r.useRef(null), f = r.useId(), p = r.useId(), P = r.useMemo(
68
+ () => M(d),
69
+ [d]
70
+ ), E = r.useMemo(
71
+ () => ({ titleId: f, descriptionId: p }),
72
+ [p, f]
73
+ );
74
+ return /* @__PURE__ */ t(m.Root, { open: o, onOpenChange: e, children: /* @__PURE__ */ t(x.Provider, { value: E, children: /* @__PURE__ */ t(T, { reducedMotion: "user", children: /* @__PURE__ */ t(B, { initial: !1, onExitComplete: R, children: o ? /* @__PURE__ */ y(m.Portal, { forceMount: !0, container: I ?? void 0, children: [
75
+ /* @__PURE__ */ t(m.Overlay, { forceMount: !0, asChild: !0, children: /* @__PURE__ */ t(
76
+ g.div,
77
+ {
78
+ "data-slot": "modal-overlay",
79
+ variants: K,
80
+ initial: "hidden",
81
+ animate: "visible",
82
+ exit: "hidden",
83
+ className: n(
84
+ "fixed inset-0 z-50 bg-overlay",
85
+ j
86
+ )
87
+ },
88
+ "modal-overlay"
89
+ ) }),
90
+ /* @__PURE__ */ t(
91
+ "div",
92
+ {
93
+ "data-slot": "modal-viewport",
94
+ className: n(
95
+ "pointer-events-none fixed inset-0 z-50 grid overflow-y-auto p-4",
96
+ i === "top" ? "place-items-start justify-items-center pt-[max(1rem,8dvh)]" : "place-items-center",
97
+ "max-sm:p-2",
98
+ V
99
+ ),
100
+ children: /* @__PURE__ */ t(
101
+ m.Content,
102
+ {
103
+ forceMount: !0,
104
+ asChild: !0,
105
+ "aria-label": v,
106
+ "aria-labelledby": _ ?? (v ? void 0 : f),
107
+ "aria-describedby": k ?? (P ? p : void 0),
108
+ onEscapeKeyDown: (s) => {
109
+ z || s.preventDefault();
110
+ },
111
+ onPointerDownOutside: (s) => {
112
+ D || s.preventDefault();
113
+ },
114
+ onOpenAutoFocus: (s) => {
115
+ var h;
116
+ s.preventDefault(), (h = (c == null ? void 0 : c.current) ?? b.current) == null || h.focus();
117
+ },
118
+ onFocusOutside: (s) => s.preventDefault(),
119
+ children: /* @__PURE__ */ y(
120
+ g.div,
121
121
  {
122
- type: "button",
123
- onClick: () => t(!1),
124
- "aria-label": "Close",
125
- className: i(
126
- "absolute right-4 top-4 inline-flex size-8 items-center justify-center",
127
- "rounded-sm text-muted-foreground",
128
- "transition-[background,color,transform] duration-150 ease-out motion-reduce:transition-none hover:bg-muted hover:text-foreground",
129
- "active:scale-[0.97] motion-reduce:active:scale-100",
130
- "outline-none focus-visible:ring-3 focus-visible:ring-ring",
131
- "[&_svg]:size-4 [&_svg]:shrink-0"
122
+ ref: b,
123
+ "data-slot": "modal",
124
+ tabIndex: -1,
125
+ variants: q,
126
+ initial: "hidden",
127
+ animate: "visible",
128
+ exit: "hidden",
129
+ onAnimationComplete: (s) => {
130
+ s === "visible" && (u == null || u());
131
+ },
132
+ className: n(
133
+ A({ size: a, position: i }),
134
+ l
132
135
  ),
133
- children: /* @__PURE__ */ a(P, { "aria-hidden": !0 })
134
- }
135
- ) : null,
136
- w
137
- ]
138
- },
139
- "panel"
140
- )
141
- ] }) }) }),
142
- document.body
143
- );
136
+ children: [
137
+ C ? /* @__PURE__ */ t(w, {}) : null,
138
+ d
139
+ ]
140
+ },
141
+ "modal-panel"
142
+ )
143
+ }
144
+ )
145
+ }
146
+ )
147
+ ] }) : null }) }) }) });
144
148
  }
145
- const B = n.forwardRef(({ className: o, ...t }, r) => /* @__PURE__ */ a(
146
- "div",
147
- {
148
- ref: r,
149
- className: i("flex shrink-0 flex-col gap-1 px-6 pt-6 pr-14", o),
150
- ...t
151
- }
152
- ));
153
- B.displayName = "ModalHeader";
154
- const C = n.forwardRef(({ className: o, ...t }, r) => /* @__PURE__ */ a(
155
- "h2",
149
+ const w = r.forwardRef(({ className: o, children: e, "aria-label": a = "Close", ...i }, l) => /* @__PURE__ */ t(m.Close, { asChild: !0, children: /* @__PURE__ */ t(
150
+ "button",
156
151
  {
157
- ref: r,
158
- className: i("text-lg font-medium text-foreground", o),
159
- ...t
152
+ ref: l,
153
+ type: "button",
154
+ "data-slot": "modal-close",
155
+ "aria-label": a,
156
+ className: n(
157
+ "absolute right-2 top-2 z-10 inline-flex size-7 items-center justify-center",
158
+ "rounded-sm text-secondary outline-none",
159
+ "transition-[background,color,transform] duration-150 ease-out motion-reduce:transition-none",
160
+ "hover:bg-muted hover:text-foreground active:scale-[0.97] motion-reduce:active:scale-100",
161
+ "focus-visible:ring-3 focus-visible:ring-ring",
162
+ "[&_svg]:size-4 [&_svg]:shrink-0",
163
+ o
164
+ ),
165
+ ...i,
166
+ children: e ?? /* @__PURE__ */ t(S, { "aria-hidden": !0 })
160
167
  }
161
- ));
162
- C.displayName = "ModalTitle";
163
- const K = n.forwardRef(({ className: o, ...t }, r) => /* @__PURE__ */ a(
164
- "p",
168
+ ) }));
169
+ w.displayName = "ModalClose";
170
+ const F = r.forwardRef(({ className: o, ...e }, a) => /* @__PURE__ */ t(
171
+ "div",
165
172
  {
166
- ref: r,
167
- className: i("text-xs text-muted-foreground", o),
168
- ...t
173
+ ref: a,
174
+ "data-slot": "modal-header",
175
+ className: n(
176
+ "flex min-h-11 shrink-0 flex-col justify-center gap-0.5 bg-surface px-3 py-3 pr-11",
177
+ o
178
+ ),
179
+ ...e
169
180
  }
170
181
  ));
171
- K.displayName = "ModalDescription";
172
- const _ = n.forwardRef(({ className: o, ...t }, r) => /* @__PURE__ */ a(
182
+ F.displayName = "ModalHeader";
183
+ const G = r.forwardRef(({ className: o, id: e, ...a }, i) => {
184
+ const l = r.useContext(x), d = n(
185
+ "text-[15px] font-semibold leading-5 text-foreground",
186
+ o
187
+ );
188
+ return l ? /* @__PURE__ */ t(
189
+ m.Title,
190
+ {
191
+ ref: i,
192
+ id: e ?? l.titleId,
193
+ "data-slot": "modal-title",
194
+ className: d,
195
+ ...a
196
+ }
197
+ ) : /* @__PURE__ */ t("h2", { ref: i, id: e, className: d, ...a });
198
+ });
199
+ G.displayName = "ModalTitle";
200
+ const N = r.forwardRef(({ className: o, id: e, ...a }, i) => {
201
+ const l = r.useContext(x), d = n(
202
+ "text-sm leading-5 text-muted-foreground",
203
+ o
204
+ );
205
+ return l ? /* @__PURE__ */ t(
206
+ m.Description,
207
+ {
208
+ ref: i,
209
+ id: e ?? l.descriptionId,
210
+ "data-slot": "modal-description",
211
+ className: d,
212
+ ...a
213
+ }
214
+ ) : /* @__PURE__ */ t(
215
+ "p",
216
+ {
217
+ ref: i,
218
+ id: e,
219
+ className: d,
220
+ ...a
221
+ }
222
+ );
223
+ });
224
+ N.displayName = "ModalDescription";
225
+ const J = r.forwardRef(
226
+ ({ className: o, padding: e = "default", ...a }, i) => /* @__PURE__ */ t(
227
+ "div",
228
+ {
229
+ ref: i,
230
+ "data-slot": "modal-body",
231
+ className: n(
232
+ "min-h-0 flex-1 overflow-y-auto overscroll-contain border-t-[1px] border-border-tertiary text-sm leading-5 text-foreground",
233
+ e === "default" && "px-4 py-4",
234
+ o
235
+ ),
236
+ ...a
237
+ }
238
+ )
239
+ );
240
+ J.displayName = "ModalBody";
241
+ const O = r.forwardRef(({ className: o, ...e }, a) => /* @__PURE__ */ t(
173
242
  "div",
174
243
  {
175
- ref: r,
176
- className: i(
177
- "min-h-0 flex-1 overflow-y-auto overscroll-contain px-6 py-4 text-xs text-foreground",
244
+ ref: a,
245
+ "data-slot": "modal-section",
246
+ className: n(
247
+ "px-4 py-4 [&+&]:border-t [&+&]:border-border-tertiary",
178
248
  o
179
249
  ),
180
- ...t
250
+ ...e
181
251
  }
182
252
  ));
183
- _.displayName = "ModalBody";
184
- const I = n.forwardRef(({ className: o, ...t }, r) => /* @__PURE__ */ a(
253
+ O.displayName = "ModalSection";
254
+ const Q = r.forwardRef(({ className: o, ...e }, a) => /* @__PURE__ */ t(
185
255
  "div",
186
256
  {
187
- ref: r,
188
- className: i(
189
- "flex shrink-0 items-center justify-end gap-2 px-6 pb-6 pt-2",
257
+ ref: a,
258
+ "data-slot": "modal-footer",
259
+ className: n(
260
+ "flex min-h-[3.75rem] shrink-0 flex-wrap items-center justify-end gap-2 border-t-[1px] border-border-tertiary px-4 py-4",
261
+ "[&_button]:h-7 [&_button]:rounded-sm [&_button]:px-2.5 [&_button]:text-xs",
190
262
  o
191
263
  ),
192
- ...t
264
+ ...e
193
265
  }
194
266
  ));
195
- I.displayName = "ModalFooter";
267
+ Q.displayName = "ModalFooter";
196
268
  export {
197
- Z as Modal,
198
- _ as ModalBody,
199
- K as ModalDescription,
200
- I as ModalFooter,
201
- B as ModalHeader,
202
- C as ModalTitle
269
+ ee as Modal,
270
+ J as ModalBody,
271
+ w as ModalClose,
272
+ N as ModalDescription,
273
+ Q as ModalFooter,
274
+ F as ModalHeader,
275
+ O as ModalSection,
276
+ G as ModalTitle
203
277
  };
@@ -1,92 +1,95 @@
1
1
  "use client";
2
- import { jsxs as k, jsx as s } from "react/jsx-runtime";
3
- import * as M from "react";
4
- import { Minus as _, Plus as j } from "../lib/icons.js";
5
- import { cn as a } from "../lib/cn.js";
6
- import { inputBaseClass as h } from "./field.js";
2
+ import { jsxs as k, jsx as o } from "react/jsx-runtime";
3
+ import * as h from "react";
4
+ import { Minus as M, Plus as _ } from "../lib/icons.js";
5
+ import { cn as d } from "../lib/cn.js";
6
+ import { inputBaseClass as j } from "./field.js";
7
7
  const D = {
8
8
  sm: {
9
- field: "h-8 rounded-sm text-xs",
9
+ field: "h-8 rounded-sm",
10
10
  btn: "size-8 rounded-sm [&_svg]:size-3.5"
11
11
  },
12
12
  md: {
13
- field: "h-10 rounded-md text-xs",
13
+ field: "h-10 rounded-md",
14
14
  btn: "size-10 rounded-md [&_svg]:size-4"
15
15
  },
16
16
  lg: {
17
- field: "h-11 rounded-md text-base",
17
+ field: "h-11 rounded-md",
18
18
  btn: "size-11 rounded-md [&_svg]:size-4"
19
19
  }
20
- }, F = M.forwardRef(
20
+ }, F = h.forwardRef(
21
21
  ({
22
22
  className: v,
23
23
  value: c,
24
24
  onChange: t,
25
- min: i,
26
- max: n,
25
+ min: r,
26
+ max: i,
27
27
  step: l = 1,
28
- size: x = "md",
29
- isInvalid: N,
30
- disabled: o,
31
- ...z
32
- }, w) => {
33
- const u = D[x], b = (r) => {
34
- let e = r;
35
- return i !== void 0 && (e = Math.max(i, e)), n !== void 0 && (e = Math.min(n, e)), e;
36
- }, d = c ?? 0, y = !o && (i === void 0 || d > i), g = !o && (n === void 0 || d < n), m = (r) => t == null ? void 0 : t(b(d + r * l)), p = a(
28
+ size: y = "md",
29
+ isInvalid: x,
30
+ disabled: a,
31
+ ...N
32
+ }, z) => {
33
+ const b = D[y], u = (n) => {
34
+ let e = n;
35
+ return r !== void 0 && (e = Math.max(r, e)), i !== void 0 && (e = Math.min(i, e)), e;
36
+ }, s = c ?? 0, g = !a && (r === void 0 || s > r), w = !a && (i === void 0 || s < i), m = (n) => t == null ? void 0 : t(u(s + n * l)), p = d(
37
37
  "inline-flex items-center justify-center rounded-md border border-input bg-elevated text-foreground",
38
- "transition-[background,box-shadow] duration-150 hover:bg-muted",
38
+ "transition-[background,border,color,box-shadow,transform] duration-150 ease-out",
39
+ "enabled:hover:border-action-primary enabled:hover:bg-action-primary-soft enabled:hover:text-action-primary-text",
40
+ "enabled:active:scale-[0.97] enabled:active:border-action-primary enabled:active:bg-action-primary-soft enabled:active:text-action-primary-text",
41
+ "motion-reduce:active:scale-100",
39
42
  "outline-none focus-visible:ring-3 focus-visible:ring-ring",
40
43
  "disabled:pointer-events-none disabled:opacity-50",
41
- u.btn
44
+ b.btn
42
45
  );
43
- return /* @__PURE__ */ k("div", { className: a("inline-flex items-center gap-1.5", v), children: [
44
- /* @__PURE__ */ s(
46
+ return /* @__PURE__ */ k("div", { className: d("inline-flex items-center gap-1.5", v), children: [
47
+ /* @__PURE__ */ o(
45
48
  "button",
46
49
  {
47
50
  type: "button",
48
51
  "aria-label": "Decrease",
49
- disabled: !y,
52
+ disabled: !g,
50
53
  onClick: () => m(-1),
51
54
  className: p,
52
- children: /* @__PURE__ */ s(_, {})
55
+ children: /* @__PURE__ */ o(M, {})
53
56
  }
54
57
  ),
55
- /* @__PURE__ */ s(
58
+ /* @__PURE__ */ o(
56
59
  "input",
57
60
  {
58
- ref: w,
61
+ ref: z,
59
62
  type: "number",
60
63
  inputMode: "numeric",
61
64
  value: c ?? "",
62
- min: i,
63
- max: n,
65
+ min: r,
66
+ max: i,
64
67
  step: l,
65
- disabled: o,
66
- "aria-invalid": N || void 0,
67
- onChange: (r) => {
68
- const e = r.target.value;
68
+ disabled: a,
69
+ "aria-invalid": x || void 0,
70
+ onChange: (n) => {
71
+ const e = n.target.value;
69
72
  if (e === "") return;
70
73
  const f = Number(e);
71
- Number.isNaN(f) || t == null || t(b(f));
74
+ Number.isNaN(f) || t == null || t(u(f));
72
75
  },
73
- className: a(
74
- h,
76
+ className: d(
77
+ j,
75
78
  "w-20 text-center [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",
76
- u.field
79
+ b.field
77
80
  ),
78
- ...z
81
+ ...N
79
82
  }
80
83
  ),
81
- /* @__PURE__ */ s(
84
+ /* @__PURE__ */ o(
82
85
  "button",
83
86
  {
84
87
  type: "button",
85
88
  "aria-label": "Increase",
86
- disabled: !g,
89
+ disabled: !w,
87
90
  onClick: () => m(1),
88
91
  className: p,
89
- children: /* @__PURE__ */ s(j, {})
92
+ children: /* @__PURE__ */ o(_, {})
90
93
  }
91
94
  )
92
95
  ] });
@@ -0,0 +1,12 @@
1
+ import * as React from "react";
2
+ export interface PageBodyProps extends React.HTMLAttributes<HTMLElement> {
3
+ /** Semantic element used by the page region. @default "main" */
4
+ as?: "main" | "div";
5
+ }
6
+ /**
7
+ * PageBody — the primary page region beside an application sidebar.
8
+ *
9
+ * It is intentionally borderless and uses a raised white surface while
10
+ * consuming all remaining width and height in the surrounding app shell.
11
+ */
12
+ export declare const PageBody: React.ForwardRefExoticComponent<PageBodyProps & React.RefAttributes<HTMLElement>>;
@@ -0,0 +1,18 @@
1
+ "use client";
2
+ import * as e from "react";
3
+ import { cn as r } from "../lib/cn.js";
4
+ const d = e.forwardRef(
5
+ ({ as: a = "main", className: o, ...l }, t) => e.createElement(a, {
6
+ ref: t,
7
+ "data-slot": "page-body",
8
+ className: r(
9
+ "relative flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-card shadow-elevation",
10
+ o
11
+ ),
12
+ ...l
13
+ })
14
+ );
15
+ d.displayName = "PageBody";
16
+ export {
17
+ d as PageBody
18
+ };