@arcadeai/design-system 3.45.1 → 3.45.2

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.
@@ -1,7 +1,7 @@
1
1
  import { ControllerProps, FieldPath, FieldValues, FormProviderProps, FieldError } from 'react-hook-form';
2
2
  import { Label } from './label';
3
3
  import * as React from "react";
4
- declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>({ children, watch, getValues, getFieldState, setError, clearErrors, setValue, setValues, trigger, formState, resetField, reset, handleSubmit, unregister, control, register, setFocus, subscribe, }: FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
4
+ declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
5
5
  declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => React.JSX.Element;
6
6
  declare const useFormField: () => {
7
7
  invalid: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../../../lib/components/ui/atoms/form.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,KAAK,WAAW,EAIjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAGpD,QAAA,MAAM,IAAI,0YAAe,CAAC;AAa1B,QAAA,MAAM,SAAS,GACb,YAAY,SAAS,WAAW,GAAG,WAAW,EAC9C,KAAK,SAAS,SAAS,CAAC,YAAY,CAAC,GAAG,SAAS,CAAC,YAAY,CAAC,EAC/D,cAEC,eAAe,CAAC,YAAY,EAAE,KAAK,CAAC,sBAItC,CAAC;AAEF,QAAA,MAAM,YAAY;;;;;;;;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AsB,CAAC,EAAE,OAAO,CAAC;IACjC,mEAAmE;IACnE,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;CACzC,GAAG,KAAK,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;AAsDpC,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,IAAI,EAAE,EACb,OAAO,CAAC,EAAE;IACR,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,UAwBF;AAuBD,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,SAAS,EACT,sBAA8B,EAC9B,WAA0B,EAC1B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,kBAAkB,qBAkPpB"}
1
+ {"version":3,"file":"steps-progress.d.ts","sourceRoot":"","sources":["../../../../lib/components/ui/molecules/steps-progress.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAcpC,MAAM,MAAM,UAAU,GAAG,YAAY,GAAG,QAAQ,GAAG,UAAU,CAAC;AAE9D,MAAM,MAAM,IAAI,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,UAAU,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB;;;;;;;;;;;OAWG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,mEAAmE;IACnE,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;CACzC,GAAG,KAAK,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;AAsDpC,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,IAAI,EAAE,EACb,OAAO,CAAC,EAAE;IACR,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,UAwBF;AAMD,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,SAAS,EACT,sBAA8B,EAC9B,WAA0B,EAC1B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,kBAAkB,qBAqMpB"}
@@ -4,11 +4,11 @@ import { t as e } from "../../../utils-BphajtTJ.js";
4
4
  import { t } from "../../../button-B7gJ_sBM.js";
5
5
  import { SparkleBurst as n } from "../atoms/sparkle-burst.js";
6
6
  import { StepIndicator as r, stepIndicatorIconVariants as i, stepIndicatorLabelVariants as a } from "../atoms/step-indicator.js";
7
- import { useEffect as o, useLayoutEffect as s, useRef as c, useState as l } from "react";
8
- import { jsx as u, jsxs as d } from "react/jsx-runtime";
9
- import { Check as f, ChevronLeft as p, ChevronRight as m, X as h } from "lucide-react";
7
+ import { useEffect as o, useRef as s, useState as c } from "react";
8
+ import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
9
+ import { Check as f, X as p } from "lucide-react";
10
10
  //#region lib/components/ui/molecules/steps-progress.tsx
11
- function g({ step: t, stepNumber: n, isAttention: i }) {
11
+ function m({ step: t, stepNumber: n, isAttention: i }) {
12
12
  let a = /* @__PURE__ */ u(r, {
13
13
  className: "min-w-0",
14
14
  label: t.label,
@@ -25,65 +25,51 @@ function g({ step: t, stepNumber: n, isAttention: i }) {
25
25
  children: a
26
26
  });
27
27
  }
28
- function _(e) {
28
+ function h(e) {
29
29
  return e.length - 1;
30
30
  }
31
- function v(e) {
31
+ function g(e) {
32
32
  return e.findIndex((e) => e.status === "active");
33
33
  }
34
- function y(e, t) {
35
- return e.length === 0 ? t ? 0 : -1 : t ? e.length : _(e);
34
+ function _(e, t) {
35
+ return e.length === 0 ? t ? 0 : -1 : t ? e.length : h(e);
36
36
  }
37
- function b(e, t) {
38
- let { currentIndex: n, isDismissible: r = !1 } = t ?? {}, i = v(e);
37
+ function v(e, t) {
38
+ let { currentIndex: n, isDismissible: r = !1 } = t ?? {}, i = g(e);
39
39
  if (i >= 0) return i;
40
40
  if (e.length === 0) return r ? 0 : -1;
41
- let a = y(e, r);
42
- return n !== void 0 && n >= 0 && n <= a ? n : _(e);
41
+ let a = _(e, r);
42
+ return n !== void 0 && n >= 0 && n <= a ? n : h(e);
43
43
  }
44
- function x(e, t, n) {
45
- let r = y(e, n);
46
- return t >= 0 && t <= r ? t : b(e, {
47
- currentIndex: t,
48
- isDismissible: n
49
- });
50
- }
51
- function S(e) {
44
+ function y(e) {
52
45
  return `calc(${(e - 1) / e} * (100% - 4.25rem) + 0.75rem)`;
53
46
  }
54
- function C({ steps: r, onDismiss: _, animateStepTransitions: v = !1, orientation: y = "horizontal", className: C, ...w }) {
55
- let T = !!_, [E, D] = l(() => b(r, { isDismissible: T }));
56
- s(() => {
57
- D((e) => b(r, {
58
- currentIndex: e,
59
- isDismissible: T
60
- }));
61
- }, [T, r]);
62
- let [O, k] = l(void 0), A = c(null), j = c(null), M = c(0);
47
+ function b({ steps: r, onDismiss: h, animateStepTransitions: g = !1, orientation: _ = "horizontal", className: b, ...x }) {
48
+ let S = !!h, [C, w] = c(void 0), T = s(null), E = s(null), D = s(0);
63
49
  o(() => {
64
- let e = A.current, t = new Map(r.map((e) => [e.id, e.status]));
50
+ let e = T.current, t = new Map(r.map((e) => [e.id, e.status]));
65
51
  if (e === null) {
66
- A.current = t;
52
+ T.current = t;
67
53
  return;
68
54
  }
69
- if (v) {
55
+ if (g) {
70
56
  let t = r.find((t) => t.status === "complete" && e.get(t.id) !== "complete");
71
- t && (j.current !== null && window.clearTimeout(j.current), M.current += 1, k({
57
+ t && (E.current !== null && window.clearTimeout(E.current), D.current += 1, w({
72
58
  stepId: t.id,
73
- key: M.current
74
- }), j.current = window.setTimeout(() => {
75
- k(void 0), j.current = null;
59
+ key: D.current
60
+ }), E.current = window.setTimeout(() => {
61
+ w(void 0), E.current = null;
76
62
  }, 800));
77
63
  }
78
- A.current = t;
79
- }, [v, r]), o(() => () => {
80
- j.current !== null && window.clearTimeout(j.current);
64
+ T.current = t;
65
+ }, [g, r]), o(() => () => {
66
+ E.current !== null && window.clearTimeout(E.current);
81
67
  }, []);
82
- let N = x(r, E, T), P = r[N], F = r.length, I = N > 0, L = T ? N < F : N < r.length - 1, R = T && r.at(-1)?.status === "active";
83
- return y === "vertical" ? /* @__PURE__ */ u("section", {
68
+ let O = v(r), k = r[O], A = S && r.at(-1)?.status === "active";
69
+ return _ === "vertical" ? /* @__PURE__ */ u("section", {
84
70
  "aria-label": "Steps progress",
85
- className: e(C),
86
- ...w,
71
+ className: e(b),
72
+ ...x,
87
73
  children: /* @__PURE__ */ u("ol", {
88
74
  className: "flex flex-col",
89
75
  children: r.map((t, n) => {
@@ -112,36 +98,28 @@ function C({ steps: r, onDismiss: _, animateStepTransitions: v = !1, orientation
112
98
  })
113
99
  }) : /* @__PURE__ */ d("section", {
114
100
  "aria-label": "Steps progress",
115
- className: e("relative h-14 overflow-hidden border border-border bg-card text-foreground", C),
116
- ...w,
101
+ className: e("relative h-14 overflow-hidden border border-border bg-card text-foreground", b),
102
+ ...x,
117
103
  children: [
118
- R && /* @__PURE__ */ u("span", {
104
+ A && /* @__PURE__ */ u("span", {
119
105
  "aria-hidden": "true",
120
106
  className: "pointer-events-none absolute top-0 right-0 z-10 hidden h-0.5 bg-foreground sm:block",
121
- style: { left: S(r.length) }
107
+ style: { left: y(r.length) }
122
108
  }),
123
- P?.status === "active" && /* @__PURE__ */ u("span", {
109
+ k?.status === "active" && /* @__PURE__ */ u("span", {
124
110
  "aria-hidden": "true",
125
111
  className: "pointer-events-none absolute inset-x-0 top-0 z-20 h-0.5 bg-foreground sm:hidden"
126
112
  }),
127
113
  /* @__PURE__ */ d("div", {
128
114
  className: "relative z-10 flex h-full items-center sm:gap-3 sm:px-3",
129
115
  children: [
130
- /* @__PURE__ */ u("button", {
131
- "aria-label": "Go to previous step",
132
- className: e("flex h-full shrink-0 items-center px-2 text-muted-foreground sm:hidden", !I && "pointer-events-none invisible"),
133
- onClick: () => D(N - 1),
134
- tabIndex: I ? 0 : -1,
135
- type: "button",
136
- children: /* @__PURE__ */ u(p, { className: "h-4 w-4" })
137
- }),
138
- /* @__PURE__ */ d("ol", {
116
+ /* @__PURE__ */ u("ol", {
139
117
  className: "flex h-full min-w-0 flex-1 items-center gap-0",
140
- children: [r.map((t, r) => {
141
- let i = O?.stepId === t.id;
118
+ children: r.map((t, r) => {
119
+ let i = C?.stepId === t.id;
142
120
  return /* @__PURE__ */ d("li", {
143
121
  "aria-current": t.status === "active" ? "step" : void 0,
144
- className: e("relative isolate flex h-full min-w-0 flex-1 items-center justify-center px-2 py-4 sm:px-3", r !== N && "hidden sm:flex"),
122
+ className: e("relative isolate flex h-full min-w-0 flex-1 items-center justify-center px-2 py-4 sm:px-3", r !== O && "hidden sm:flex"),
145
123
  "data-attention": i ? "true" : void 0,
146
124
  "data-status": t.status,
147
125
  children: [
@@ -149,7 +127,7 @@ function C({ steps: r, onDismiss: _, animateStepTransitions: v = !1, orientation
149
127
  "aria-hidden": "true",
150
128
  className: "absolute left-0 hidden h-full w-px bg-border sm:block"
151
129
  }),
152
- /* @__PURE__ */ u(g, {
130
+ /* @__PURE__ */ u(m, {
153
131
  isAttention: i,
154
132
  step: t,
155
133
  stepNumber: r + 1
@@ -157,46 +135,44 @@ function C({ steps: r, onDismiss: _, animateStepTransitions: v = !1, orientation
157
135
  i ? /* @__PURE__ */ u("span", {
158
136
  "aria-hidden": !0,
159
137
  className: "pointer-events-none absolute inset-0 z-30 flex items-center justify-center",
160
- children: /* @__PURE__ */ u(n, {}, O.key)
138
+ children: /* @__PURE__ */ u(n, {}, C.key)
161
139
  }) : null
162
140
  ]
163
141
  }, t.id);
164
- }), _ && /* @__PURE__ */ u("li", {
165
- className: e("relative isolate flex h-full flex-1 items-center justify-center sm:hidden", N !== F && "hidden"),
166
- children: /* @__PURE__ */ d(t, {
167
- "aria-label": "Dismiss steps progress",
168
- className: "h-8 gap-1.5 border border-border px-3 text-muted-foreground hover:bg-muted hover:text-foreground",
169
- onClick: _,
170
- type: "button",
171
- variant: "ghost",
172
- children: [/* @__PURE__ */ u(h, { className: "h-4 w-4" }), /* @__PURE__ */ u("span", {
173
- className: "text-sm",
174
- children: "Dismiss"
175
- })]
176
- })
177
- })]
142
+ })
178
143
  }),
179
- /* @__PURE__ */ u("button", {
180
- "aria-label": "Go to next step",
181
- className: e("flex h-full shrink-0 items-center px-2 text-muted-foreground sm:hidden", !L && "pointer-events-none invisible"),
182
- onClick: () => D(N + 1),
183
- tabIndex: L ? 0 : -1,
184
- type: "button",
185
- children: /* @__PURE__ */ u(m, { className: "h-4 w-4" })
144
+ r.length > 0 && k && /* @__PURE__ */ d("span", {
145
+ "aria-hidden": "true",
146
+ className: "shrink-0 px-3 font-mono text-muted-foreground text-xs tabular-nums sm:hidden",
147
+ children: [
148
+ O + 1,
149
+ " / ",
150
+ r.length
151
+ ]
186
152
  }),
187
- _ && /* @__PURE__ */ u(t, {
153
+ h && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ d(t, {
154
+ "aria-label": "Dismiss",
155
+ className: "h-8 shrink-0 gap-1.5 border border-border px-3 text-muted-foreground hover:bg-muted hover:text-foreground sm:hidden",
156
+ onClick: h,
157
+ type: "button",
158
+ variant: "ghost",
159
+ children: [/* @__PURE__ */ u(p, { className: "h-4 w-4" }), /* @__PURE__ */ u("span", {
160
+ className: "text-sm",
161
+ children: "Dismiss"
162
+ })]
163
+ }), /* @__PURE__ */ u(t, {
188
164
  "aria-label": "Dismiss steps progress",
189
165
  className: "hidden h-8 w-8 shrink-0 border border-border text-muted-foreground hover:bg-muted hover:text-foreground sm:flex",
190
- onClick: _,
166
+ onClick: h,
191
167
  size: "icon",
192
168
  type: "button",
193
169
  variant: "ghost",
194
- children: /* @__PURE__ */ u(h, { className: "h-4 w-4" })
195
- })
170
+ children: /* @__PURE__ */ u(p, { className: "h-4 w-4" })
171
+ })] })
196
172
  ]
197
173
  })
198
174
  ]
199
175
  });
200
176
  }
201
177
  //#endregion
202
- export { C as StepsProgress, b as getMobileIndexForSteps };
178
+ export { b as StepsProgress, v as getMobileIndexForSteps };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@arcadeai/design-system",
3
3
  "private": false,
4
- "version": "3.45.1",
4
+ "version": "3.45.2",
5
5
  "type": "module",
6
6
  "main": "./dist/main.js",
7
7
  "types": "./dist/main.d.ts",
@@ -95,7 +95,7 @@
95
95
  "playwright": "1.60.0",
96
96
  "react": "19.2.7",
97
97
  "react-dom": "19.2.7",
98
- "react-hook-form": "7.77.0",
98
+ "react-hook-form": "7.74.0",
99
99
  "recharts": "3.8.1",
100
100
  "storybook": "10.3.5",
101
101
  "tailwindcss": "4.3.0",