@arcadeai/design-system 3.37.0 → 3.38.1

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 (27) hide show
  1. package/dist/assets/index.css +1 -1
  2. package/dist/assets/tokens.css +1 -1
  3. package/dist/assets/variables.css +1 -1
  4. package/dist/components/index.js +287 -284
  5. package/dist/components/ui/atoms/index.d.ts +1 -0
  6. package/dist/components/ui/atoms/index.d.ts.map +1 -1
  7. package/dist/components/ui/atoms/index.js +184 -181
  8. package/dist/components/ui/atoms/sparkle-burst.d.ts +21 -0
  9. package/dist/components/ui/atoms/sparkle-burst.d.ts.map +1 -0
  10. package/dist/components/ui/atoms/sparkle-burst.js +29 -0
  11. package/dist/components/ui/index.js +287 -284
  12. package/dist/components/ui/molecules/command-bar.d.ts +8 -1
  13. package/dist/components/ui/molecules/command-bar.d.ts.map +1 -1
  14. package/dist/components/ui/molecules/command-bar.js +24 -17
  15. package/dist/components/ui/molecules/prompt-input.d.ts.map +1 -1
  16. package/dist/components/ui/molecules/prompt-input.js +57 -45
  17. package/dist/components/ui/molecules/steps-progress.d.ts +18 -1
  18. package/dist/components/ui/molecules/steps-progress.d.ts.map +1 -1
  19. package/dist/components/ui/molecules/steps-progress.js +201 -46
  20. package/dist/components/ui/molecules/suggestion-card.d.ts +2 -2
  21. package/dist/components/ui/molecules/suggestion-card.d.ts.map +1 -1
  22. package/dist/components/ui/molecules/suggestion-card.js +86 -49
  23. package/dist/components/ui/molecules/tool-authorization.js +5 -5
  24. package/dist/components/ui/templates/chat-template.d.ts.map +1 -1
  25. package/dist/components/ui/templates/chat-template.js +53 -50
  26. package/dist/main.js +230 -227
  27. package/package.json +1 -1
@@ -1,7 +1,14 @@
1
1
  type CommandBarProps = {
2
2
  command: string;
3
3
  className?: string;
4
+ /**
5
+ * Called when content is copied from the command area.
6
+ * `source` is `"copy_button"` for button clicks (via navigator.clipboard)
7
+ * and `"clipboard"` for keyboard/menu copies (DOM copy event).
8
+ * The two paths are mutually exclusive — no double-counting occurs.
9
+ */
10
+ onCopy?: (source: "copy_button" | "clipboard") => void;
4
11
  };
5
- export declare function CommandBar({ command, className }: CommandBarProps): import("react/jsx-runtime").JSX.Element;
12
+ export declare function CommandBar({ command, className, onCopy }: CommandBarProps): import("react/jsx-runtime").JSX.Element;
6
13
  export {};
7
14
  //# sourceMappingURL=command-bar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"command-bar.d.ts","sourceRoot":"","sources":["../../../../lib/components/ui/molecules/command-bar.tsx"],"names":[],"mappings":"AAKA,KAAK,eAAe,GAAG;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,wBAAgB,UAAU,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,eAAe,2CA2BjE"}
1
+ {"version":3,"file":"command-bar.d.ts","sourceRoot":"","sources":["../../../../lib/components/ui/molecules/command-bar.tsx"],"names":[],"mappings":"AAKA,KAAK,eAAe,GAAG;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,aAAa,GAAG,WAAW,KAAK,IAAI,CAAC;CACxD,CAAC;AAEF,wBAAgB,UAAU,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,eAAe,2CA8BzE"}
@@ -1,25 +1,32 @@
1
- import { jsxs as o, jsx as e } from "react/jsx-runtime";
2
- import { w as a } from "../../../web-BwFNdl01.js";
3
- import { CopyButton as l } from "../atoms/copy-button.js";
4
- import { SHIKI_THEMES as s } from "../../../lib/shiki-themes.js";
1
+ import { jsxs as a, jsx as e } from "react/jsx-runtime";
2
+ import { w as l } from "../../../web-BwFNdl01.js";
3
+ import { CopyButton as s } from "../atoms/copy-button.js";
4
+ import { SHIKI_THEMES as n } from "../../../lib/shiki-themes.js";
5
5
  import { cn as i } from "../../../lib/utils.js";
6
- function u({ command: t, className: r }) {
7
- return /* @__PURE__ */ o(
6
+ function c({ command: t, className: r, onCopy: o }) {
7
+ return /* @__PURE__ */ a(
8
8
  "div",
9
9
  {
10
10
  className: i("relative overflow-hidden rounded-md border", r),
11
11
  children: [
12
- /* @__PURE__ */ e("div", { className: "overflow-x-auto text-sm [&_.shiki]:py-3 [&_.shiki]:pr-14 [&_.shiki]:pl-10", children: /* @__PURE__ */ e(
13
- a,
12
+ /* @__PURE__ */ e(
13
+ "div",
14
14
  {
15
- addDefaultStyles: !1,
16
- defaultColor: !1,
17
- language: "shellscript",
18
- showLanguage: !1,
19
- theme: s,
20
- children: t
15
+ className: "overflow-x-auto text-sm [&_.shiki]:py-3 [&_.shiki]:pr-14 [&_.shiki]:pl-10",
16
+ onCopy: () => o?.("clipboard"),
17
+ children: /* @__PURE__ */ e(
18
+ l,
19
+ {
20
+ addDefaultStyles: !1,
21
+ defaultColor: !1,
22
+ language: "shellscript",
23
+ showLanguage: !1,
24
+ theme: n,
25
+ children: t
26
+ }
27
+ )
21
28
  }
22
- ) }),
29
+ ),
23
30
  /* @__PURE__ */ e(
24
31
  "span",
25
32
  {
@@ -28,11 +35,11 @@ function u({ command: t, className: r }) {
28
35
  children: "$"
29
36
  }
30
37
  ),
31
- /* @__PURE__ */ e("div", { className: "absolute top-1/2 right-3 -translate-y-1/2", children: /* @__PURE__ */ e(l, { content: t }) })
38
+ /* @__PURE__ */ e("div", { className: "absolute top-1/2 right-3 -translate-y-1/2", children: /* @__PURE__ */ e(s, { content: t, onCopy: () => o?.("copy_button") }) })
32
39
  ]
33
40
  }
34
41
  );
35
42
  }
36
43
  export {
37
- u as CommandBar
44
+ c as CommandBar
38
45
  };
@@ -1 +1 @@
1
- {"version":3,"file":"prompt-input.d.ts","sourceRoot":"","sources":["../../../../lib/components/ui/molecules/prompt-input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;AACf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MAAM,MAAM,wBAAwB,GAAG;IACrC,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,QAAQ,CAAC,CAAC;AAE1C,iBAAS,mBAAmB,CAAC,EAC3B,SAAS,EACT,SAAS,EACT,eAAuB,EACvB,GAAG,KAAK,EACT,EAAE,wBAAwB,2CAqE1B;AAED,MAAM,MAAM,uBAAuB,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;AAElE,iBAAS,kBAAkB,CAAC,EAC1B,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACT,EAAE,uBAAuB,2CAUzB;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,IAAI,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;CAC5C,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,OAAO,CAAC,CAAC;AAEzC,iBAAS,iBAAiB,CAAC,EACzB,OAAO,EACP,QAAQ,EACR,SAAS,EACT,IAAY,EACZ,GAAG,KAAK,EACT,EAAE,sBAAsB,2CAwBxB;AAED,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,GACpB,CAAC"}
@@ -1,7 +1,7 @@
1
- import { jsx as a, jsxs as w } from "react/jsx-runtime";
2
- import y, { createContext as _, useState as C, useRef as k, useLayoutEffect as P, useContext as H } from "react";
3
- import { Textarea as I } from "../atoms/textarea.js";
4
- import { TooltipProvider as R, Tooltip as T, TooltipTrigger as $, TooltipContent as D } from "../atoms/tooltip.js";
1
+ import { jsx as a, jsxs as y } from "react/jsx-runtime";
2
+ import w, { createContext as _, useState as C, useRef as P, useLayoutEffect as k, useContext as T } from "react";
3
+ import { Textarea as H } from "../atoms/textarea.js";
4
+ import { TooltipProvider as I, Tooltip as R, TooltipTrigger as $, TooltipContent as D } from "../atoms/tooltip.js";
5
5
  import { cn as x } from "../../../lib/utils.js";
6
6
  const b = _({
7
7
  isLoading: !1,
@@ -11,15 +11,15 @@ const b = _({
11
11
  maxHeight: 240,
12
12
  onSubmit: void 0,
13
13
  disabled: !1,
14
- textareaRef: y.createRef()
14
+ textareaRef: w.createRef()
15
15
  });
16
16
  function v() {
17
- return H(b);
17
+ return T(b);
18
18
  }
19
- function V({
20
- className: o,
19
+ function E({
20
+ className: n,
21
21
  isLoading: r = !1,
22
- maxHeight: n = 240,
22
+ maxHeight: o = 240,
23
23
  value: s,
24
24
  onValueChange: i,
25
25
  onSubmit: l,
@@ -28,30 +28,31 @@ function V({
28
28
  onClick: d,
29
29
  ...u
30
30
  }) {
31
- const [f, m] = C(s || ""), h = k(null), g = (p) => {
32
- m(p), i?.(p);
33
- }, t = (p) => {
34
- c || h.current?.focus(), d?.(p);
31
+ const [p, m] = C(s || ""), f = P(null), g = (h) => {
32
+ m(h), i?.(h);
33
+ }, t = (h) => {
34
+ c || f.current?.focus(), d?.(h);
35
35
  };
36
- return /* @__PURE__ */ a(R, { children: /* @__PURE__ */ a(
36
+ return /* @__PURE__ */ a(I, { children: /* @__PURE__ */ a(
37
37
  b.Provider,
38
38
  {
39
39
  value: {
40
40
  isLoading: r,
41
- value: s ?? f,
41
+ value: s ?? p,
42
42
  setValue: i ?? g,
43
- maxHeight: n,
43
+ maxHeight: o,
44
44
  onSubmit: l,
45
45
  disabled: c,
46
- textareaRef: h
46
+ textareaRef: f
47
47
  },
48
48
  children: /* @__PURE__ */ a(
49
49
  "div",
50
50
  {
51
51
  className: x(
52
52
  "cursor-text rounded-lg border border-input bg-background p-2 shadow-xs transition-[box-shadow,border-color] focus-within:border focus-within:border-muted-foreground focus-within:shadow-[0_0_4px_color-mix(in_oklch,var(--ring)_4%,transparent)] dark:focus-within:shadow-[0_0_4px_color-mix(in_oklch,var(--ring)_8%,transparent)]",
53
- o
53
+ n
54
54
  ),
55
+ "data-slot": "prompt-input",
55
56
  onClick: t,
56
57
  ...u,
57
58
  children: e
@@ -60,36 +61,37 @@ function V({
60
61
  }
61
62
  ) });
62
63
  }
63
- function E({
64
- className: o,
64
+ function L({
65
+ className: n,
65
66
  onKeyDown: r,
66
- disableAutosize: n = !1,
67
+ disableAutosize: o = !1,
67
68
  ...s
68
69
  }) {
69
- const { value: i, setValue: l, maxHeight: e, onSubmit: c, disabled: d, textareaRef: u } = v(), f = (t) => {
70
- !t || n || (t.style.height = "auto", typeof e == "number" ? t.style.height = `${Math.min(t.scrollHeight, e)}px` : t.style.height = `min(${t.scrollHeight}px, ${e})`);
70
+ const { value: i, setValue: l, maxHeight: e, onSubmit: c, disabled: d, textareaRef: u } = v(), p = (t) => {
71
+ !t || o || (t.style.height = "auto", typeof e == "number" ? t.style.height = `${Math.min(t.scrollHeight, e)}px` : t.style.height = `min(${t.scrollHeight}px, ${e})`);
71
72
  }, m = (t) => {
72
- u.current = t, f(t);
73
+ u.current = t, p(t);
73
74
  };
74
- P(() => {
75
- if (!u.current || n)
75
+ k(() => {
76
+ if (!u.current || o)
76
77
  return;
77
78
  const t = u.current;
78
79
  t.style.height = "auto", typeof e == "number" ? t.style.height = `${Math.min(t.scrollHeight, e)}px` : t.style.height = `min(${t.scrollHeight}px, ${e})`;
79
- }, [i, e, n]);
80
- const h = (t) => {
81
- f(t.target), l(t.target.value);
80
+ }, [i, e, o]);
81
+ const f = (t) => {
82
+ p(t.target), l(t.target.value);
82
83
  }, g = (t) => {
83
84
  t.key === "Enter" && !t.shiftKey && (t.preventDefault(), d || c?.()), r?.(t);
84
85
  };
85
86
  return /* @__PURE__ */ a(
86
- I,
87
+ H,
87
88
  {
88
89
  className: x(
89
- "min-h-[44px] w-full resize-none border-none bg-transparent text-foreground shadow-none outline-none focus-visible:ring-0 focus-visible:ring-offset-0 dark:bg-transparent",
90
- o
90
+ "min-h-[56px] w-full resize-none border-none bg-transparent text-foreground shadow-none outline-none focus-visible:ring-0 focus-visible:ring-offset-0 dark:bg-transparent",
91
+ n
91
92
  ),
92
- onChange: h,
93
+ "data-slot": "prompt-input-textarea",
94
+ onChange: f,
93
95
  onKeyDown: g,
94
96
  ref: m,
95
97
  rows: 1,
@@ -98,38 +100,48 @@ function E({
98
100
  }
99
101
  );
100
102
  }
101
- function L({
102
- children: o,
103
+ function M({
104
+ children: n,
103
105
  className: r,
104
- ...n
106
+ ...o
105
107
  }) {
106
- return /* @__PURE__ */ a("div", { className: x("flex items-center gap-2", r), ...n, children: o });
108
+ return /* @__PURE__ */ a(
109
+ "div",
110
+ {
111
+ className: x("flex items-center gap-2", r),
112
+ "data-slot": "prompt-input-actions",
113
+ ...o,
114
+ children: n
115
+ }
116
+ );
107
117
  }
108
118
  function q({
109
- tooltip: o,
119
+ tooltip: n,
110
120
  children: r,
111
- className: n,
121
+ className: o,
112
122
  side: s = "top",
113
123
  ...i
114
124
  }) {
115
125
  const { disabled: l } = v();
116
- return /* @__PURE__ */ w(T, { ...i, children: [
126
+ return /* @__PURE__ */ y(R, { ...i, children: [
117
127
  /* @__PURE__ */ a(
118
128
  $,
119
129
  {
120
130
  asChild: !0,
121
131
  disabled: l,
122
132
  onClick: (e) => e.stopPropagation(),
123
- onMouseDown: (e) => e.preventDefault(),
133
+ onPointerDown: (e) => {
134
+ e.pointerType !== "touch" && e.preventDefault();
135
+ },
124
136
  children: r
125
137
  }
126
138
  ),
127
- /* @__PURE__ */ a(D, { className: n, side: s, children: o })
139
+ /* @__PURE__ */ a(D, { className: o, side: s, children: n })
128
140
  ] });
129
141
  }
130
142
  export {
131
- V as PromptInput,
143
+ E as PromptInput,
132
144
  q as PromptInputAction,
133
- L as PromptInputActions,
134
- E as PromptInputTextarea
145
+ M as PromptInputActions,
146
+ L as PromptInputTextarea
135
147
  };
@@ -9,6 +9,23 @@ export type Step = {
9
9
  export type StepsProgressProps = {
10
10
  steps: Step[];
11
11
  onDismiss?: () => void;
12
+ /**
13
+ * When true, `StepsProgress` watches for any step whose status transitions
14
+ * into `complete` and renders a one-shot `SparkleBurst` overlay on that step
15
+ * to celebrate. The overlay is `aria-hidden` + `pointer-events-none`, so the
16
+ * underlying step (including its click handler) remains fully interactive.
17
+ *
18
+ * Nothing animates on initial mount — only on subsequent status changes —
19
+ * so already-complete steps won't sparkle on first render. The sparkle lasts
20
+ * for `DS_SPARKLE_DURATION_MS` (see `sparkle-burst.tsx`) and then clears.
21
+ *
22
+ * Respects `prefers-reduced-motion` via token CSS.
23
+ */
24
+ animateStepTransitions?: boolean;
12
25
  } & React.ComponentProps<"section">;
13
- export declare function StepsProgress({ steps, onDismiss, className, ...props }: StepsProgressProps): import("react/jsx-runtime").JSX.Element;
26
+ export declare function getMobileIndexForSteps(steps: Step[], options?: {
27
+ currentIndex?: number;
28
+ isDismissible?: boolean;
29
+ }): number;
30
+ export declare function StepsProgress({ steps, onDismiss, animateStepTransitions, className, ...props }: StepsProgressProps): import("react/jsx-runtime").JSX.Element;
14
31
  //# sourceMappingURL=steps-progress.d.ts.map
@@ -1 +1 @@
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;AAKpC,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;CACxB,GAAG,KAAK,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;AAmCpC,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,SAAS,EACT,SAAS,EACT,GAAG,KAAK,EACT,EAAE,kBAAkB,2CA6DpB"}
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;AAUpC,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;CAClC,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,SAAS,EACT,GAAG,KAAK,EACT,EAAE,kBAAkB,2CAuMpB"}
@@ -1,89 +1,244 @@
1
- import { jsxs as l, jsx as r } from "react/jsx-runtime";
2
- import { X as u } from "lucide-react";
3
- import { Button as m } from "../atoms/button.js";
4
- import { StepIndicator as d } from "../atoms/step-indicator.js";
5
- import { cn as f } from "../../../lib/utils.js";
6
- function h({ step: e, stepNumber: t }) {
7
- const n = /* @__PURE__ */ r(
8
- d,
1
+ import { jsxs as f, jsx as n } from "react/jsx-runtime";
2
+ import { ChevronLeft as B, X as S, ChevronRight as D } from "lucide-react";
3
+ import { useState as C, useLayoutEffect as E, useRef as x, useEffect as M } from "react";
4
+ import { Button as j } from "../atoms/button.js";
5
+ import { DS_SPARKLE_DURATION_MS as P, SparkleBurst as _ } from "../atoms/sparkle-burst.js";
6
+ import { StepIndicator as G } from "../atoms/step-indicator.js";
7
+ import { cn as u } from "../../../lib/utils.js";
8
+ function K({ step: e, stepNumber: t, isAttention: r }) {
9
+ const o = /* @__PURE__ */ n(
10
+ G,
9
11
  {
12
+ className: "min-w-0",
10
13
  label: e.label,
11
14
  status: e.status,
12
15
  stepNumber: t
13
16
  }
17
+ ), c = u(
18
+ "flex min-w-0 flex-1 items-center justify-center",
19
+ r && "step-attention-target"
14
20
  );
15
- return e.onClick ? /* @__PURE__ */ r(
21
+ return e.onClick ? /* @__PURE__ */ n(
16
22
  "button",
17
23
  {
18
- className: "flex min-w-0 flex-1 cursor-pointer items-center justify-center",
24
+ className: u(c, "cursor-pointer"),
19
25
  onClick: e.onClick,
20
26
  type: "button",
21
- children: n
27
+ children: o
22
28
  }
23
- ) : /* @__PURE__ */ r("span", { className: "flex min-w-0 flex-1 items-center justify-center", children: n });
29
+ ) : /* @__PURE__ */ n("span", { className: c, children: o });
24
30
  }
25
- function N({
31
+ function R(e) {
32
+ return e.length - 1;
33
+ }
34
+ function F(e) {
35
+ return e.findIndex((t) => t.status === "active");
36
+ }
37
+ function L(e, t) {
38
+ return e.length === 0 ? t ? 0 : -1 : t ? e.length : R(e);
39
+ }
40
+ function p(e, t) {
41
+ const { currentIndex: r, isDismissible: o = !1 } = t ?? {}, c = F(e);
42
+ if (c >= 0)
43
+ return c;
44
+ if (e.length === 0)
45
+ return o ? 0 : -1;
46
+ const a = L(e, o);
47
+ return r !== void 0 && r >= 0 && r <= a ? r : R(e);
48
+ }
49
+ function O(e, t, r) {
50
+ const o = L(e, r);
51
+ return t >= 0 && t <= o ? t : p(e, {
52
+ currentIndex: t,
53
+ isDismissible: r
54
+ });
55
+ }
56
+ function U(e) {
57
+ return `calc(${(e - 1) / e} * (100% - 4.25rem) + 0.75rem)`;
58
+ }
59
+ function W({
26
60
  steps: e,
27
61
  onDismiss: t,
28
- className: n,
29
- ...o
62
+ animateStepTransitions: r = !1,
63
+ className: o,
64
+ ...c
30
65
  }) {
31
- const s = !!t && e.at(-1)?.status === "active", c = `calc(${(e.length - 1) / e.length} * (100% - 4.25rem) + 0.75rem)`;
32
- return /* @__PURE__ */ l(
66
+ const a = !!t, [T, h] = C(
67
+ () => p(e, { isDismissible: a })
68
+ );
69
+ E(() => {
70
+ h(
71
+ (i) => p(e, {
72
+ currentIndex: i,
73
+ isDismissible: a
74
+ })
75
+ );
76
+ }, [a, e]);
77
+ const [g, v] = C(void 0), b = x(null), d = x(null), N = x(0);
78
+ M(() => {
79
+ const i = b.current, m = new Map(e.map((l) => [l.id, l.status]));
80
+ if (i === null) {
81
+ b.current = m;
82
+ return;
83
+ }
84
+ if (r) {
85
+ const l = e.find(
86
+ (y) => y.status === "complete" && i.get(y.id) !== "complete"
87
+ );
88
+ l && (d.current !== null && window.clearTimeout(d.current), N.current += 1, v({ stepId: l.id, key: N.current }), d.current = window.setTimeout(() => {
89
+ v(void 0), d.current = null;
90
+ }, P));
91
+ }
92
+ b.current = m;
93
+ }, [r, e]), M(
94
+ () => () => {
95
+ d.current !== null && window.clearTimeout(d.current);
96
+ },
97
+ []
98
+ );
99
+ const s = O(
100
+ e,
101
+ T,
102
+ a
103
+ ), z = e[s], k = e.length, w = s > 0, I = a ? s < k : s < e.length - 1, A = a && e.at(-1)?.status === "active";
104
+ return /* @__PURE__ */ f(
33
105
  "section",
34
106
  {
35
107
  "aria-label": "Steps progress",
36
- className: f(
108
+ className: u(
37
109
  "relative h-14 overflow-hidden border border-border bg-card text-foreground",
38
- n
110
+ o
39
111
  ),
40
- ...o,
112
+ ...c,
41
113
  children: [
42
- s && /* @__PURE__ */ r(
114
+ A && /* @__PURE__ */ n(
115
+ "span",
116
+ {
117
+ "aria-hidden": "true",
118
+ className: "pointer-events-none absolute top-0 right-0 z-10 hidden h-0.5 bg-foreground sm:block",
119
+ style: { left: U(e.length) }
120
+ }
121
+ ),
122
+ z?.status === "active" && /* @__PURE__ */ n(
43
123
  "span",
44
124
  {
45
125
  "aria-hidden": "true",
46
- className: "pointer-events-none absolute top-0 right-0 z-10 h-0.5 bg-foreground",
47
- style: { left: c }
126
+ className: "pointer-events-none absolute inset-x-0 top-0 z-20 h-0.5 bg-foreground sm:hidden"
48
127
  }
49
128
  ),
50
- /* @__PURE__ */ l("div", { className: "relative z-10 flex h-full items-center gap-3 px-3", children: [
51
- /* @__PURE__ */ r("ol", { className: "flex h-full min-w-0 flex-1 items-center gap-0", children: e.map((a, i) => /* @__PURE__ */ l(
52
- "li",
129
+ /* @__PURE__ */ f("div", { className: "relative z-10 flex h-full items-center sm:gap-3 sm:px-3", children: [
130
+ /* @__PURE__ */ n(
131
+ "button",
53
132
  {
54
- "aria-current": a.status === "active" ? "step" : void 0,
55
- className: "relative isolate flex h-full min-w-0 flex-1 items-center justify-center px-3 py-4",
56
- "data-status": a.status,
57
- children: [
58
- i > 0 && /* @__PURE__ */ r(
59
- "span",
133
+ "aria-label": "Go to previous step",
134
+ className: u(
135
+ "flex h-full shrink-0 items-center px-2 text-muted-foreground sm:hidden",
136
+ !w && "pointer-events-none invisible"
137
+ ),
138
+ onClick: () => h(s - 1),
139
+ tabIndex: w ? 0 : -1,
140
+ type: "button",
141
+ children: /* @__PURE__ */ n(B, { className: "h-4 w-4" })
142
+ }
143
+ ),
144
+ /* @__PURE__ */ f("ol", { className: "flex h-full min-w-0 flex-1 items-center gap-0", children: [
145
+ e.map((i, m) => {
146
+ const l = g?.stepId === i.id;
147
+ return /* @__PURE__ */ f(
148
+ "li",
149
+ {
150
+ "aria-current": i.status === "active" ? "step" : void 0,
151
+ className: u(
152
+ "relative isolate flex h-full min-w-0 flex-1 items-center justify-center px-2 py-4 sm:px-3",
153
+ m !== s && "hidden sm:flex"
154
+ ),
155
+ "data-attention": l ? "true" : void 0,
156
+ "data-status": i.status,
157
+ children: [
158
+ m > 0 && /* @__PURE__ */ n(
159
+ "span",
160
+ {
161
+ "aria-hidden": "true",
162
+ className: "absolute left-0 hidden h-full w-px bg-border sm:block"
163
+ }
164
+ ),
165
+ /* @__PURE__ */ n(
166
+ K,
167
+ {
168
+ isAttention: l,
169
+ step: i,
170
+ stepNumber: m + 1
171
+ }
172
+ ),
173
+ l ? /* @__PURE__ */ n(
174
+ "span",
175
+ {
176
+ "aria-hidden": !0,
177
+ className: "pointer-events-none absolute inset-0 z-30 flex items-center justify-center",
178
+ children: /* @__PURE__ */ n(_, {}, g.key)
179
+ }
180
+ ) : null
181
+ ]
182
+ },
183
+ i.id
184
+ );
185
+ }),
186
+ t && /* @__PURE__ */ n(
187
+ "li",
188
+ {
189
+ className: u(
190
+ "relative isolate flex h-full flex-1 items-center justify-center sm:hidden",
191
+ s !== k && "hidden"
192
+ ),
193
+ children: /* @__PURE__ */ f(
194
+ j,
60
195
  {
61
- "aria-hidden": "true",
62
- className: "absolute left-0 h-full w-px bg-border"
196
+ "aria-label": "Dismiss steps progress",
197
+ className: "h-8 gap-1.5 border border-border px-3 text-muted-foreground hover:bg-muted hover:text-foreground",
198
+ onClick: t,
199
+ type: "button",
200
+ variant: "ghost",
201
+ children: [
202
+ /* @__PURE__ */ n(S, { className: "h-4 w-4" }),
203
+ /* @__PURE__ */ n("span", { className: "text-sm", children: "Dismiss" })
204
+ ]
63
205
  }
64
- ),
65
- /* @__PURE__ */ r(h, { step: a, stepNumber: i + 1 })
66
- ]
67
- },
68
- a.id
69
- )) }),
70
- t ? /* @__PURE__ */ r(
71
- m,
206
+ )
207
+ }
208
+ )
209
+ ] }),
210
+ /* @__PURE__ */ n(
211
+ "button",
212
+ {
213
+ "aria-label": "Go to next step",
214
+ className: u(
215
+ "flex h-full shrink-0 items-center px-2 text-muted-foreground sm:hidden",
216
+ !I && "pointer-events-none invisible"
217
+ ),
218
+ onClick: () => h(s + 1),
219
+ tabIndex: I ? 0 : -1,
220
+ type: "button",
221
+ children: /* @__PURE__ */ n(D, { className: "h-4 w-4" })
222
+ }
223
+ ),
224
+ t && /* @__PURE__ */ n(
225
+ j,
72
226
  {
73
227
  "aria-label": "Dismiss steps progress",
74
- className: "h-8 w-8 shrink-0 border border-border text-muted-foreground hover:bg-muted hover:text-foreground",
228
+ className: "hidden h-8 w-8 shrink-0 border border-border text-muted-foreground hover:bg-muted hover:text-foreground sm:flex",
75
229
  onClick: t,
76
230
  size: "icon",
77
231
  type: "button",
78
232
  variant: "ghost",
79
- children: /* @__PURE__ */ r(u, { className: "h-4 w-4" })
233
+ children: /* @__PURE__ */ n(S, { className: "h-4 w-4" })
80
234
  }
81
- ) : null
235
+ )
82
236
  ] })
83
237
  ]
84
238
  }
85
239
  );
86
240
  }
87
241
  export {
88
- N as StepsProgress
242
+ W as StepsProgress,
243
+ p as getMobileIndexForSteps
89
244
  };
@@ -7,7 +7,7 @@ export type SuggestionCardProps = {
7
7
  /** Secondary descriptive text */
8
8
  subtitle: string;
9
9
  } & React.ComponentProps<"button">;
10
- export declare function SuggestionCard({ className, icon, title, subtitle, ...props }: SuggestionCardProps): import("react/jsx-runtime").JSX.Element;
10
+ export declare function SuggestionCard({ className, icon, title, subtitle, style, ...props }: SuggestionCardProps): import("react/jsx-runtime").JSX.Element;
11
11
  export type SuggestionCardSkeletonProps = React.ComponentProps<"div">;
12
- export declare function SuggestionCardSkeleton({ className, ...props }: SuggestionCardSkeletonProps): import("react/jsx-runtime").JSX.Element;
12
+ export declare function SuggestionCardSkeleton({ className, style, ...props }: SuggestionCardSkeletonProps): import("react/jsx-runtime").JSX.Element;
13
13
  //# sourceMappingURL=suggestion-card.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"suggestion-card.d.ts","sourceRoot":"","sources":["../../../../lib/components/ui/molecules/suggestion-card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAMpC,MAAM,MAAM,mBAAmB,GAAG;IAChC,mDAAmD;IACnD,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,yBAAyB;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,iCAAiC;IACjC,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;AAEnC,wBAAgB,cAAc,CAAC,EAC7B,SAAS,EACT,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,mBAAmB,2CAiCrB;AAID,MAAM,MAAM,2BAA2B,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;AAEtE,wBAAgB,sBAAsB,CAAC,EACrC,SAAS,EACT,GAAG,KAAK,EACT,EAAE,2BAA2B,2CAkB7B"}
1
+ {"version":3,"file":"suggestion-card.d.ts","sourceRoot":"","sources":["../../../../lib/components/ui/molecules/suggestion-card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAMpC,MAAM,MAAM,mBAAmB,GAAG;IAChC,mDAAmD;IACnD,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,yBAAyB;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,iCAAiC;IACjC,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;AAEnC,wBAAgB,cAAc,CAAC,EAC7B,SAAS,EACT,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,KAAK,EACL,GAAG,KAAK,EACT,EAAE,mBAAmB,2CA4CrB;AAID,MAAM,MAAM,2BAA2B,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;AAEtE,wBAAgB,sBAAsB,CAAC,EACrC,SAAS,EACT,KAAK,EACL,GAAG,KAAK,EACT,EAAE,2BAA2B,2CA+B7B"}