@asanchez-sa/abby 0.2.0 → 0.4.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 (65) hide show
  1. package/dist/components/alert/alert.d.ts +1 -1
  2. package/dist/components/alert/alert.js +2 -1
  3. package/dist/components/alert-dialog/alert-dialog.d.ts +10 -1
  4. package/dist/components/alert-dialog/alert-dialog.js +80 -3
  5. package/dist/components/badge/badge.d.ts +3 -2
  6. package/dist/components/badge/badge.js +27 -11
  7. package/dist/components/button/button.d.ts +1 -1
  8. package/dist/components/button/button.js +3 -2
  9. package/dist/components/calendar/calendar.d.ts +26 -5
  10. package/dist/components/calendar/calendar.js +387 -72
  11. package/dist/components/chart/chart.d.ts +76 -0
  12. package/dist/components/chart/chart.js +565 -0
  13. package/dist/components/chart/parts/axes.js +126 -0
  14. package/dist/components/chart/parts/frame.d.ts +31 -0
  15. package/dist/components/chart/parts/frame.js +278 -0
  16. package/dist/components/chart/parts/legend.d.ts +16 -0
  17. package/dist/components/chart/parts/legend.js +82 -0
  18. package/dist/components/chart/parts/points.d.ts +1 -0
  19. package/dist/components/chart/parts/points.js +139 -0
  20. package/dist/components/chart/parts/scale.js +139 -0
  21. package/dist/components/chart/parts/table.js +105 -0
  22. package/dist/components/chart/parts/types.d.ts +44 -0
  23. package/dist/components/chart/parts/types.js +8 -0
  24. package/dist/components/dialog/dialog.d.ts +9 -1
  25. package/dist/components/dialog/dialog.js +82 -3
  26. package/dist/components/field/field.d.ts +5 -1
  27. package/dist/components/field/field.js +25 -21
  28. package/dist/components/filter-chip/filter-chip.d.ts +36 -0
  29. package/dist/components/filter-chip/filter-chip.js +97 -0
  30. package/dist/components/graph/graph.d.ts +151 -0
  31. package/dist/components/graph/graph.js +959 -0
  32. package/dist/components/input/input.d.ts +8 -1
  33. package/dist/components/input/input.js +2 -2
  34. package/dist/components/meter/meter.d.ts +52 -3
  35. package/dist/components/meter/meter.js +535 -33
  36. package/dist/components/model-selector/model-selector.d.ts +38 -3
  37. package/dist/components/model-selector/model-selector.js +331 -73
  38. package/dist/components/note-editor/parts/suggestions.js +2 -2
  39. package/dist/components/number-input/number-input.d.ts +14 -3
  40. package/dist/components/number-input/number-input.js +193 -34
  41. package/dist/components/otp-input/otp-input.d.ts +6 -2
  42. package/dist/components/otp-input/otp-input.js +40 -20
  43. package/dist/components/sheet/sheet.js +1 -1
  44. package/dist/components/spinner/spinner.d.ts +7 -1
  45. package/dist/components/spinner/spinner.js +86 -26
  46. package/dist/components/switch/switch.d.ts +9 -2
  47. package/dist/components/switch/switch.js +23 -17
  48. package/dist/components/toast/toast.d.ts +19 -2
  49. package/dist/components/toast/toast.js +211 -49
  50. package/dist/components/toggle/toggle.d.ts +18 -4
  51. package/dist/components/toggle/toggle.js +167 -32
  52. package/dist/components/week-strip/week-strip.d.ts +27 -5
  53. package/dist/components/week-strip/week-strip.js +288 -134
  54. package/package.json +4 -1
  55. package/skills/agent-ready-ui/SKILL.md +1 -1
  56. package/skills/blocks/SKILL.md +1 -1
  57. package/skills/compose-screens/SKILL.md +97 -10
  58. package/skills/compose-screens/references/calendar-week.md +77 -0
  59. package/skills/compose-screens/references/charts-and-maps.md +183 -0
  60. package/skills/compose-screens/references/filter-chips.md +61 -0
  61. package/skills/compose-screens/references/number-units.md +52 -0
  62. package/skills/note-editor/SKILL.md +1 -1
  63. package/skills/note-status/SKILL.md +1 -1
  64. package/skills/setup/SKILL.md +1 -1
  65. package/skills/theming/SKILL.md +1 -1
@@ -1,8 +1,9 @@
1
1
  "use client";
2
- import { cnState } from "../../utilities/cn/index.js";
2
+ import { cn, cnState } from "../../utilities/cn/index.js";
3
3
  import { Icon } from "../icon/icon.js";
4
4
  import { inputClasses } from "../input/input.js";
5
5
  import { c } from "react/compiler-runtime";
6
+ import { createContext, use, useEffect, useId, useLayoutEffect, useRef, useState } from "react";
6
7
  import { jsx } from "react/jsx-runtime";
7
8
  import { MinusSignIcon, PlusSignIcon } from "@hugeicons/core-free-icons";
8
9
  import { NumberInput as NumberInput$1, NumberInputControl as NumberInputControl$1, NumberInputDecrement as NumberInputDecrement$1, NumberInputGroup as NumberInputGroup$1, NumberInputIncrement as NumberInputIncrement$1, NumberInputScrubArea as NumberInputScrubArea$1, NumberInputScrubAreaCursor as NumberInputScrubAreaCursor$1, createNumberInputController } from "@ui-sdk/react/number-input";
@@ -100,8 +101,9 @@ function NumberInputScrubAreaCursor(t0) {
100
101
  } else t2 = $[7];
101
102
  return t2;
102
103
  }
104
+ const UnitContext = createContext(null);
103
105
  function NumberInputGroup(t0) {
104
- const $ = c(8);
106
+ const $ = c(14);
105
107
  let className;
106
108
  let props;
107
109
  if ($[0] !== t0) {
@@ -113,23 +115,158 @@ function NumberInputGroup(t0) {
113
115
  className = $[1];
114
116
  props = $[2];
115
117
  }
118
+ const id = useId();
119
+ const [unitId, setUnitId] = useState(null);
120
+ const t1 = `${id}-unit`;
121
+ let t2;
122
+ if ($[3] !== t1 || $[4] !== unitId) {
123
+ t2 = {
124
+ id: t1,
125
+ unitId,
126
+ setUnitId
127
+ };
128
+ $[3] = t1;
129
+ $[4] = unitId;
130
+ $[5] = t2;
131
+ } else t2 = $[5];
132
+ let t3;
133
+ if ($[6] !== className) {
134
+ t3 = cnState("group/number-input relative flex w-full items-center rounded-full has-aria-invalid:ring-3 has-aria-invalid:ring-destructive/20", className);
135
+ $[6] = className;
136
+ $[7] = t3;
137
+ } else t3 = $[7];
138
+ let t4;
139
+ if ($[8] !== props || $[9] !== t3) {
140
+ t4 = /* @__PURE__ */ jsx(NumberInputGroup$1, {
141
+ className: t3,
142
+ ...props
143
+ });
144
+ $[8] = props;
145
+ $[9] = t3;
146
+ $[10] = t4;
147
+ } else t4 = $[10];
148
+ let t5;
149
+ if ($[11] !== t2 || $[12] !== t4) {
150
+ t5 = /* @__PURE__ */ jsx(UnitContext.Provider, {
151
+ value: t2,
152
+ children: t4
153
+ });
154
+ $[11] = t2;
155
+ $[12] = t4;
156
+ $[13] = t5;
157
+ } else t5 = $[13];
158
+ return t5;
159
+ }
160
+ function setRef(ref, value) {
161
+ if (typeof ref === "function") return ref(value);
162
+ if (ref) ref.current = value;
163
+ }
164
+ /**
165
+ * A unit at the end of the field, inside its edge and in gray: `USD` after an
166
+ * amount. It sits over the control's trailing padding, which grows to make room,
167
+ * so the number never runs under it. Put it after `NumberInputControl` and
168
+ * before `NumberInputIncrement`. It can't be edited or selected, and a click on
169
+ * it focuses the field. A screen reader hears it once, as the control's
170
+ * description, not as a part of its own.
171
+ */
172
+ function NumberInputUnit(t0) {
173
+ const $ = c(20);
174
+ let className;
175
+ let id;
176
+ let props;
177
+ let ref;
178
+ if ($[0] !== t0) {
179
+ ({className, id, ref, ...props} = t0);
180
+ $[0] = t0;
181
+ $[1] = className;
182
+ $[2] = id;
183
+ $[3] = props;
184
+ $[4] = ref;
185
+ } else {
186
+ className = $[1];
187
+ id = $[2];
188
+ props = $[3];
189
+ ref = $[4];
190
+ }
191
+ const scope = use(UnitContext);
192
+ const setUnitId = scope?.setUnitId;
193
+ const unitId = id ?? scope?.id;
116
194
  let t1;
117
- if ($[3] !== className) {
118
- t1 = cnState("group/number-input flex w-full items-center rounded-full has-aria-invalid:ring-3 has-aria-invalid:ring-destructive/20", className);
119
- $[3] = className;
120
- $[4] = t1;
121
- } else t1 = $[4];
122
195
  let t2;
123
- if ($[5] !== props || $[6] !== t1) {
124
- t2 = /* @__PURE__ */ jsx(NumberInputGroup$1, {
125
- className: t1,
196
+ if ($[5] !== setUnitId || $[6] !== unitId) {
197
+ t1 = () => {
198
+ setUnitId?.(unitId ?? null);
199
+ return () => setUnitId?.(null);
200
+ };
201
+ t2 = [setUnitId, unitId];
202
+ $[5] = setUnitId;
203
+ $[6] = unitId;
204
+ $[7] = t1;
205
+ $[8] = t2;
206
+ } else {
207
+ t1 = $[7];
208
+ t2 = $[8];
209
+ }
210
+ useEffect(t1, t2);
211
+ const own = useRef(null);
212
+ let t3;
213
+ let t4;
214
+ if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
215
+ t3 = () => {
216
+ const element = own.current;
217
+ const group = element?.parentElement;
218
+ if (!element || !group) return;
219
+ const measure = () => group.style.setProperty("--number-input-unit", `${element.offsetWidth}px`);
220
+ measure();
221
+ const observer = new ResizeObserver(measure);
222
+ observer.observe(element);
223
+ return () => observer.disconnect();
224
+ };
225
+ t4 = [];
226
+ $[9] = t3;
227
+ $[10] = t4;
228
+ } else {
229
+ t3 = $[9];
230
+ t4 = $[10];
231
+ }
232
+ useLayoutEffect(t3, t4);
233
+ let t5;
234
+ if ($[11] !== ref) {
235
+ t5 = (element_0) => {
236
+ own.current = element_0;
237
+ const cleanup = setRef(ref, element_0);
238
+ return () => {
239
+ own.current = null;
240
+ if (typeof cleanup === "function") cleanup();
241
+ else setRef(ref, null);
242
+ };
243
+ };
244
+ $[11] = ref;
245
+ $[12] = t5;
246
+ } else t5 = $[12];
247
+ let t6;
248
+ if ($[13] !== className) {
249
+ t6 = cn("pointer-events-none absolute inset-y-0 end-3.5 flex items-center text-supporting whitespace-nowrap text-subtle select-none has-[+[data-slot=number-input-increment]]:end-[calc(--spacing(10)+--spacing(3.5))] group-data-disabled/number-input:opacity-50", className);
250
+ $[13] = className;
251
+ $[14] = t6;
252
+ } else t6 = $[14];
253
+ let t7;
254
+ if ($[15] !== props || $[16] !== t5 || $[17] !== t6 || $[18] !== unitId) {
255
+ t7 = /* @__PURE__ */ jsx("span", {
256
+ "data-slot": "number-input-unit",
257
+ id: unitId,
258
+ "aria-hidden": "true",
259
+ ref: t5,
260
+ className: t6,
126
261
  ...props
127
262
  });
128
- $[5] = props;
129
- $[6] = t1;
130
- $[7] = t2;
131
- } else t2 = $[7];
132
- return t2;
263
+ $[15] = props;
264
+ $[16] = t5;
265
+ $[17] = t6;
266
+ $[18] = unitId;
267
+ $[19] = t7;
268
+ } else t7 = $[19];
269
+ return t7;
133
270
  }
134
271
  const stepClasses = "flex h-9 w-10 shrink-0 items-center justify-center border border-input text-foreground transition-colors hover:bg-accent focus-ring-inset data-disabled:pointer-events-none data-disabled:*:opacity-50 group-has-aria-invalid/number-input:border-destructive group-data-disabled/number-input:bg-input/50 group-data-disabled/number-input:opacity-50 group-data-disabled/number-input:*:opacity-100! dark:bg-input/30";
135
272
  /** Steps down. Name it with `aria-label`. Without children it draws a minus icon. */
@@ -176,35 +313,57 @@ function NumberInputDecrement(t0) {
176
313
  return t3;
177
314
  }
178
315
  function NumberInputControl(t0) {
179
- const $ = c(8);
316
+ const $ = c(15);
180
317
  let className;
318
+ let describedBy;
181
319
  let props;
182
320
  if ($[0] !== t0) {
183
- ({className, ...props} = t0);
321
+ ({className, "aria-describedby": describedBy, ...props} = t0);
184
322
  $[0] = t0;
185
323
  $[1] = className;
186
- $[2] = props;
324
+ $[2] = describedBy;
325
+ $[3] = props;
187
326
  } else {
188
327
  className = $[1];
189
- props = $[2];
328
+ describedBy = $[2];
329
+ props = $[3];
190
330
  }
331
+ const unitId = use(UnitContext)?.unitId;
332
+ const withUnit = unitId != null;
191
333
  let t1;
192
- if ($[3] !== className) {
193
- t1 = cnState([inputClasses, "flex-1 tabular-nums group-has-aria-invalid/number-input:ring-0! [[data-slot=number-input-decrement]+&]:rounded-s-none [[data-slot=number-input-decrement]+&]:-outline-offset-2 [&:has(+[data-slot=number-input-increment])]:rounded-e-none [&:has(+[data-slot=number-input-increment])]:-outline-offset-2"], className);
194
- $[3] = className;
195
- $[4] = t1;
196
- } else t1 = $[4];
197
- let t2;
198
- if ($[5] !== props || $[6] !== t1) {
199
- t2 = /* @__PURE__ */ jsx(NumberInputControl$1, {
200
- className: t1,
334
+ if ($[4] !== describedBy || $[5] !== unitId || $[6] !== withUnit) {
335
+ t1 = withUnit ? [describedBy, unitId].filter(Boolean).join(" ") : describedBy;
336
+ $[4] = describedBy;
337
+ $[5] = unitId;
338
+ $[6] = withUnit;
339
+ $[7] = t1;
340
+ } else t1 = $[7];
341
+ const t2 = withUnit ? "" : void 0;
342
+ let t3;
343
+ if ($[8] !== className) {
344
+ t3 = cnState([
345
+ inputClasses,
346
+ "data-unit:pe-[calc(--spacing(3.5)+var(--number-input-unit,0px)+--spacing(2))] data-unit:font-medium",
347
+ "flex-1 tabular-nums group-has-aria-invalid/number-input:ring-0! [[data-slot=number-input-decrement]+&]:rounded-s-none [[data-slot=number-input-decrement]+&]:-outline-offset-2 [&:has(~[data-slot=number-input-increment])]:rounded-e-none [&:has(~[data-slot=number-input-increment])]:-outline-offset-2"
348
+ ], className);
349
+ $[8] = className;
350
+ $[9] = t3;
351
+ } else t3 = $[9];
352
+ let t4;
353
+ if ($[10] !== props || $[11] !== t1 || $[12] !== t2 || $[13] !== t3) {
354
+ t4 = /* @__PURE__ */ jsx(NumberInputControl$1, {
355
+ "aria-describedby": t1,
356
+ "data-unit": t2,
357
+ className: t3,
201
358
  ...props
202
359
  });
203
- $[5] = props;
204
- $[6] = t1;
205
- $[7] = t2;
206
- } else t2 = $[7];
207
- return t2;
360
+ $[10] = props;
361
+ $[11] = t1;
362
+ $[12] = t2;
363
+ $[13] = t3;
364
+ $[14] = t4;
365
+ } else t4 = $[14];
366
+ return t4;
208
367
  }
209
368
  /** Steps up. Name it with `aria-label`. Without children it draws a plus icon. */
210
369
  function NumberInputIncrement(t0) {
@@ -249,4 +408,4 @@ function NumberInputIncrement(t0) {
249
408
  } else t3 = $[11];
250
409
  return t3;
251
410
  }
252
- export { NumberInput, NumberInputControl, NumberInputDecrement, NumberInputGroup, NumberInputIncrement, NumberInputScrubArea, NumberInputScrubAreaCursor, createNumberInputController };
411
+ export { NumberInput, NumberInputControl, NumberInputDecrement, NumberInputGroup, NumberInputIncrement, NumberInputScrubArea, NumberInputScrubAreaCursor, NumberInputUnit, createNumberInputController };
@@ -9,10 +9,14 @@ declare const otpInputSlotVariants: (props?: ({
9
9
  type OTPInputSlotProps = ComponentProps<typeof OTPInputSlot$1> & VariantProps<typeof otpInputSlotVariants>;
10
10
  /**
11
11
  * One cell, with the look of `Input`: a one-character field, so a circle. The one real input sits over all the
12
- * cells and takes focus, so the active cell draws the focus ring and the
12
+ * cells and takes focus, so the active cell draws a field's focus and the
13
13
  * caret itself. `size="lg"` is the 48px cell of a screen that asks only for
14
14
  * the code; the default stays at a field's 36px.
15
15
  */
16
16
  declare function OTPInputSlot({ className, size, ...props }: OTPInputSlotProps): import("react").JSX.Element;
17
- declare function OTPInputSeparator({ className, ...props }: ComponentProps<typeof OTPInputSeparator$1>): import("react").JSX.Element;
17
+ /**
18
+ * The mark between two groups. With no children it draws Alma's: a short
19
+ * 8px bar, 1.5px thick, in a faint gray. Children replace it whole.
20
+ */
21
+ declare function OTPInputSeparator({ className, children, ...props }: ComponentProps<typeof OTPInputSeparator$1>): import("react").JSX.Element;
18
22
  export { OTPInput, OTPInputGroup, OTPInputSeparator, OTPInputSlot, createOTPInputController };
@@ -66,7 +66,12 @@ function OTPInputGroup(t0) {
66
66
  } else t2 = $[7];
67
67
  return t2;
68
68
  }
69
- const otpInputSlotVariants = cva("relative flex items-center justify-center rounded-full border border-input bg-transparent transition-colors focus-outline group-has-aria-invalid/otp-input:border-destructive group-has-aria-invalid/otp-input:ring-3 group-has-aria-invalid/otp-input:ring-destructive/20 after:pointer-events-none after:absolute after:hidden after:w-px after:bg-foreground data-active:focus-mark data-disabled:bg-input/50 data-fake-caret:after:block data-fake-caret:after:caret-blink dark:bg-input/30", {
69
+ const otpInputSlotVariants = cva([
70
+ "relative flex items-center justify-center rounded-full border border-input bg-transparent transition-colors data-disabled:bg-input/50 dark:bg-input/30",
71
+ "outline-3 outline-offset-0 outline-transparent data-active:border-(--focus-ring,var(--ring)) data-active:outline-(--focus-halo)",
72
+ "group-has-aria-invalid/otp-input:border-destructive group-has-aria-invalid/otp-input:ring-3 group-has-aria-invalid/otp-input:ring-destructive/20 group-has-aria-invalid/otp-input:data-active:border-destructive group-has-aria-invalid/otp-input:data-active:outline-transparent",
73
+ "after:pointer-events-none after:absolute after:hidden after:w-px after:bg-foreground data-fake-caret:after:block data-fake-caret:after:caret-blink"
74
+ ], {
70
75
  variants: { size: {
71
76
  default: "size-9 text-base after:h-4 md:text-sm",
72
77
  lg: "size-12 text-xl leading-6 tabular-nums after:h-5"
@@ -75,7 +80,7 @@ const otpInputSlotVariants = cva("relative flex items-center justify-center roun
75
80
  });
76
81
  /**
77
82
  * One cell, with the look of `Input`: a one-character field, so a circle. The one real input sits over all the
78
- * cells and takes focus, so the active cell draws the focus ring and the
83
+ * cells and takes focus, so the active cell draws a field's focus and the
79
84
  * caret itself. `size="lg"` is the 48px cell of a screen that asks only for
80
85
  * the code; the default stays at a field's 36px.
81
86
  */
@@ -117,35 +122,50 @@ function OTPInputSlot(t0) {
117
122
  } else t3 = $[10];
118
123
  return t3;
119
124
  }
125
+ /**
126
+ * The mark between two groups. With no children it draws Alma's: a short
127
+ * 8px bar, 1.5px thick, in a faint gray. Children replace it whole.
128
+ */
120
129
  function OTPInputSeparator(t0) {
121
- const $ = c(8);
130
+ const $ = c(12);
131
+ let children;
122
132
  let className;
123
133
  let props;
124
134
  if ($[0] !== t0) {
125
- ({className, ...props} = t0);
135
+ ({className, children, ...props} = t0);
126
136
  $[0] = t0;
127
- $[1] = className;
128
- $[2] = props;
137
+ $[1] = children;
138
+ $[2] = className;
139
+ $[3] = props;
129
140
  } else {
130
- className = $[1];
131
- props = $[2];
141
+ children = $[1];
142
+ className = $[2];
143
+ props = $[3];
132
144
  }
133
145
  let t1;
134
- if ($[3] !== className) {
146
+ if ($[4] !== className) {
135
147
  t1 = cnState("flex items-center text-muted-foreground", className);
136
- $[3] = className;
137
- $[4] = t1;
138
- } else t1 = $[4];
148
+ $[4] = className;
149
+ $[5] = t1;
150
+ } else t1 = $[5];
139
151
  let t2;
140
- if ($[5] !== props || $[6] !== t1) {
141
- t2 = /* @__PURE__ */ jsx(OTPInputSeparator$1, {
142
- className: t1,
143
- ...props
144
- });
145
- $[5] = props;
146
- $[6] = t1;
152
+ if ($[6] !== children) {
153
+ t2 = children ?? /* @__PURE__ */ jsx("span", { className: "block h-[--spacing(0.375)] w-2 rounded-full bg-foreground/22" });
154
+ $[6] = children;
147
155
  $[7] = t2;
148
156
  } else t2 = $[7];
149
- return t2;
157
+ let t3;
158
+ if ($[8] !== props || $[9] !== t1 || $[10] !== t2) {
159
+ t3 = /* @__PURE__ */ jsx(OTPInputSeparator$1, {
160
+ className: t1,
161
+ ...props,
162
+ children: t2
163
+ });
164
+ $[8] = props;
165
+ $[9] = t1;
166
+ $[10] = t2;
167
+ $[11] = t3;
168
+ } else t3 = $[11];
169
+ return t3;
150
170
  }
151
171
  export { OTPInput, OTPInputGroup, OTPInputSeparator, OTPInputSlot, createOTPInputController };
@@ -4,8 +4,8 @@ import { Icon } from "../icon/icon.js";
4
4
  import { buttonLook } from "../button/button.js";
5
5
  import { c } from "react/compiler-runtime";
6
6
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
- import { Cancel01Icon } from "@hugeicons/core-free-icons";
8
7
  import { Dialog, DialogBackdrop, DialogClose, DialogContent, DialogDescription, DialogTitle, DialogTrigger, createDialogController } from "@ui-sdk/react/dialog";
8
+ import { Cancel01Icon } from "@hugeicons/core-free-icons";
9
9
  // src/components/sheet/sheet.tsx
10
10
  function Sheet(props) {
11
11
  const $ = c(2);
@@ -2,10 +2,16 @@ import { IconProps } from "../icon/icon.js";
2
2
  type SpinnerProps = Omit<IconProps, "icon" | "label"> & {
3
3
  /** What is loading, for screen readers. Set it in the page's language. */
4
4
  label?: string;
5
+ /**
6
+ * `"icon"` (the default) is the eight-spoke icon. `"arc"` is a quarter arc
7
+ * turning over a ring, in the text color, sized by `className` (11 to 16px
8
+ * sits in a badge or a timeline marker).
9
+ */
10
+ variant?: "icon" | "arc";
5
11
  };
6
12
  /**
7
13
  * A loading indicator: a status named by `label`. Next to text that already
8
14
  * says what loads, like a pending button's, pass `aria-hidden` instead.
9
15
  */
10
- declare function Spinner({ label, className, ...props }: SpinnerProps): import("react").JSX.Element;
16
+ declare function Spinner({ label, variant, className, ...props }: SpinnerProps): import("react").JSX.Element;
11
17
  export { Spinner, type SpinnerProps };
@@ -2,7 +2,7 @@
2
2
  import { cn } from "../../utilities/cn/index.js";
3
3
  import { Icon } from "../icon/icon.js";
4
4
  import { c } from "react/compiler-runtime";
5
- import { jsx } from "react/jsx-runtime";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
6
  import { Loading03Icon } from "@hugeicons/core-free-icons";
7
7
  // src/components/spinner/spinner.tsx
8
8
  /**
@@ -10,50 +10,110 @@ import { Loading03Icon } from "@hugeicons/core-free-icons";
10
10
  * says what loads, like a pending button's, pass `aria-hidden` instead.
11
11
  */
12
12
  function Spinner(t0) {
13
- const $ = c(12);
13
+ const $ = c(23);
14
14
  let className;
15
15
  let props;
16
16
  let t1;
17
+ let t2;
17
18
  if ($[0] !== t0) {
18
- ({label: t1, className, ...props} = t0);
19
+ ({label: t1, variant: t2, className, ...props} = t0);
19
20
  $[0] = t0;
20
21
  $[1] = className;
21
22
  $[2] = props;
22
23
  $[3] = t1;
24
+ $[4] = t2;
23
25
  } else {
24
26
  className = $[1];
25
27
  props = $[2];
26
28
  t1 = $[3];
29
+ t2 = $[4];
27
30
  }
28
31
  const label = t1 === void 0 ? "Loading" : t1;
32
+ const variant = t2 === void 0 ? "icon" : t2;
29
33
  const hidden = props["aria-hidden"] === true || props["aria-hidden"] === "true";
30
- const t2 = hidden ? void 0 : "status";
31
- const t3 = hidden ? void 0 : label;
32
- const t4 = hidden ? true : void 0;
33
- let t5;
34
- if ($[4] !== className) {
35
- t5 = cn("animate-spin motion-reduce:animate-pulse", className);
36
- $[4] = className;
37
- $[5] = t5;
38
- } else t5 = $[5];
34
+ if (variant === "arc") {
35
+ const t3 = hidden ? void 0 : "status";
36
+ const t4 = hidden ? void 0 : label;
37
+ const t5 = hidden ? true : void 0;
38
+ let t6;
39
+ if ($[5] !== className) {
40
+ t6 = cn("size-4 shrink-0 animate-spin motion-reduce:animate-pulse", className);
41
+ $[5] = className;
42
+ $[6] = t6;
43
+ } else t6 = $[6];
44
+ const t7 = props;
45
+ let t8;
46
+ let t9;
47
+ if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
48
+ t8 = /* @__PURE__ */ jsx("circle", {
49
+ cx: "8",
50
+ cy: "8",
51
+ r: "6",
52
+ className: "stroke-secondary",
53
+ strokeWidth: "2.2"
54
+ });
55
+ t9 = /* @__PURE__ */ jsx("path", {
56
+ d: "M8 2a6 6 0 0 1 6 6",
57
+ stroke: "currentColor",
58
+ strokeWidth: "2.2",
59
+ strokeLinecap: "round"
60
+ });
61
+ $[7] = t8;
62
+ $[8] = t9;
63
+ } else {
64
+ t8 = $[7];
65
+ t9 = $[8];
66
+ }
67
+ let t10;
68
+ if ($[9] !== t3 || $[10] !== t4 || $[11] !== t5 || $[12] !== t6 || $[13] !== t7) {
69
+ t10 = /* @__PURE__ */ jsxs("svg", {
70
+ viewBox: "0 0 16 16",
71
+ fill: "none",
72
+ "data-slot": "spinner",
73
+ "data-variant": "arc",
74
+ role: t3,
75
+ "aria-label": t4,
76
+ "aria-hidden": t5,
77
+ className: t6,
78
+ ...t7,
79
+ children: [t8, t9]
80
+ });
81
+ $[9] = t3;
82
+ $[10] = t4;
83
+ $[11] = t5;
84
+ $[12] = t6;
85
+ $[13] = t7;
86
+ $[14] = t10;
87
+ } else t10 = $[14];
88
+ return t10;
89
+ }
90
+ const t3 = hidden ? void 0 : "status";
91
+ const t4 = hidden ? void 0 : label;
92
+ const t5 = hidden ? true : void 0;
39
93
  let t6;
40
- if ($[6] !== props || $[7] !== t2 || $[8] !== t3 || $[9] !== t4 || $[10] !== t5) {
41
- t6 = /* @__PURE__ */ jsx(Icon, {
94
+ if ($[15] !== className) {
95
+ t6 = cn("animate-spin motion-reduce:animate-pulse", className);
96
+ $[15] = className;
97
+ $[16] = t6;
98
+ } else t6 = $[16];
99
+ let t7;
100
+ if ($[17] !== props || $[18] !== t3 || $[19] !== t4 || $[20] !== t5 || $[21] !== t6) {
101
+ t7 = /* @__PURE__ */ jsx(Icon, {
42
102
  icon: Loading03Icon,
43
103
  "data-slot": "spinner",
44
- role: t2,
45
- "aria-label": t3,
46
- "aria-hidden": t4,
47
- className: t5,
104
+ role: t3,
105
+ "aria-label": t4,
106
+ "aria-hidden": t5,
107
+ className: t6,
48
108
  ...props
49
109
  });
50
- $[6] = props;
51
- $[7] = t2;
52
- $[8] = t3;
53
- $[9] = t4;
54
- $[10] = t5;
55
- $[11] = t6;
56
- } else t6 = $[11];
57
- return t6;
110
+ $[17] = props;
111
+ $[18] = t3;
112
+ $[19] = t4;
113
+ $[20] = t5;
114
+ $[21] = t6;
115
+ $[22] = t7;
116
+ } else t7 = $[22];
117
+ return t7;
58
118
  }
59
119
  export { Spinner };
@@ -1,6 +1,13 @@
1
1
  import { ComponentProps } from "react";
2
2
  import { Switch as Switch$1, SwitchThumb as SwitchThumb$1, createSwitchController } from "@ui-sdk/react/switch";
3
- declare function Switch({ className, ...props }: ComponentProps<typeof Switch$1>): import("react").JSX.Element;
3
+ type SwitchProps = ComponentProps<typeof Switch$1> & {
4
+ /**
5
+ * `sm` is Alma's mini switch, 30×18 with a 14px thumb, for dense rows like
6
+ * a list of models. Its touch area still reaches 54×34.
7
+ */
8
+ size?: "default" | "sm";
9
+ };
10
+ declare function Switch({ className, size, ...props }: SwitchProps): import("react").JSX.Element;
4
11
  /** The thumb. It slides to the far end while the switch is on, mirrored under `dir="rtl"`. */
5
12
  declare function SwitchThumb({ className, ...props }: ComponentProps<typeof SwitchThumb$1>): import("react").JSX.Element;
6
- export { Switch, SwitchThumb, createSwitchController };
13
+ export { Switch, type SwitchProps, SwitchThumb, createSwitchController };
@@ -5,35 +5,41 @@ import { jsx } from "react/jsx-runtime";
5
5
  import { Switch as Switch$1, SwitchThumb as SwitchThumb$1, createSwitchController } from "@ui-sdk/react/switch";
6
6
  // src/components/switch/switch.tsx
7
7
  function Switch(t0) {
8
- const $ = c(8);
8
+ const $ = c(10);
9
9
  let className;
10
10
  let props;
11
+ let t1;
11
12
  if ($[0] !== t0) {
12
- ({className, ...props} = t0);
13
+ ({className, size: t1, ...props} = t0);
13
14
  $[0] = t0;
14
15
  $[1] = className;
15
16
  $[2] = props;
17
+ $[3] = t1;
16
18
  } else {
17
19
  className = $[1];
18
20
  props = $[2];
21
+ t1 = $[3];
19
22
  }
20
- let t1;
21
- if ($[3] !== className) {
22
- t1 = cnState("peer relative inline-flex h-5 w-8 shrink-0 items-center rounded-full border border-transparent transition-colors focus-ring after:absolute after:-inset-x-3 after:-inset-y-2 data-checked:bg-brand data-disabled:cursor-not-allowed data-disabled:opacity-50 data-invalid:border-destructive data-invalid:ring-3 data-invalid:ring-destructive/20 data-unchecked:bg-input", className);
23
- $[3] = className;
24
- $[4] = t1;
25
- } else t1 = $[4];
23
+ const size = t1 === void 0 ? "default" : t1;
26
24
  let t2;
27
- if ($[5] !== props || $[6] !== t1) {
28
- t2 = /* @__PURE__ */ jsx(Switch$1, {
29
- className: t1,
25
+ if ($[4] !== className) {
26
+ t2 = cnState("peer group/switch relative inline-flex h-5 w-8 shrink-0 items-center rounded-full border border-transparent transition-colors focus-ring after:absolute after:-inset-x-3 after:-inset-y-2 data-checked:bg-brand data-disabled:cursor-not-allowed data-disabled:opacity-50 data-invalid:border-destructive data-invalid:ring-3 data-invalid:ring-destructive/20 data-unchecked:bg-input data-[size=sm]:h-4.5 data-[size=sm]:w-7.5 data-[size=sm]:px-px", className);
27
+ $[4] = className;
28
+ $[5] = t2;
29
+ } else t2 = $[5];
30
+ let t3;
31
+ if ($[6] !== props || $[7] !== size || $[8] !== t2) {
32
+ t3 = /* @__PURE__ */ jsx(Switch$1, {
33
+ "data-size": size,
34
+ className: t2,
30
35
  ...props
31
36
  });
32
- $[5] = props;
33
- $[6] = t1;
34
- $[7] = t2;
35
- } else t2 = $[7];
36
- return t2;
37
+ $[6] = props;
38
+ $[7] = size;
39
+ $[8] = t2;
40
+ $[9] = t3;
41
+ } else t3 = $[9];
42
+ return t3;
37
43
  }
38
44
  /** The thumb. It slides to the far end while the switch is on, mirrored under `dir="rtl"`. */
39
45
  function SwitchThumb(t0) {
@@ -51,7 +57,7 @@ function SwitchThumb(t0) {
51
57
  }
52
58
  let t1;
53
59
  if ($[3] !== className) {
54
- t1 = cnState("pointer-events-none block size-4 rounded-full bg-background transition-transform ease-out data-checked:translate-x-[calc(100%-2px)] data-unchecked:translate-x-0 motion-reduce:transition-none rtl:data-checked:-translate-x-[calc(100%-2px)]", className);
60
+ t1 = cnState("pointer-events-none block size-4 rounded-full group-data-[size=sm]/switch:size-3.5 bg-background transition-transform ease-out data-checked:translate-x-[calc(100%-2px)] data-unchecked:translate-x-0 motion-reduce:transition-none rtl:data-checked:-translate-x-[calc(100%-2px)]", className);
55
61
  $[3] = className;
56
62
  $[4] = t1;
57
63
  } else t1 = $[4];