@actioneer/ads 0.5.6 → 0.5.8

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 (149) hide show
  1. package/bin/ads-init.mjs +6 -0
  2. package/components/accordion.js +50 -48
  3. package/components/agent-icon.d.ts +12 -0
  4. package/components/agent-icon.js +135 -121
  5. package/components/ai-elements/chain-of-thought-icon.d.ts +10 -12
  6. package/components/ai-elements/chain-of-thought-icon.js +341 -201
  7. package/components/ai-elements/chain-of-thought.d.ts +2 -2
  8. package/components/ai-elements/chain-of-thought.js +108 -108
  9. package/components/ai-elements/chart.js +16 -14
  10. package/components/ai-elements/inline-citation.js +41 -41
  11. package/components/ai-elements/message.js +4 -4
  12. package/components/ai-elements/queue.js +7 -7
  13. package/components/ai-elements/research-activity.js +114 -114
  14. package/components/ai-elements/shimmer.d.ts +2 -2
  15. package/components/ai-elements/speech-input.js +28 -28
  16. package/components/ai-elements/task-progress.js +26 -16
  17. package/components/ai-elements/task.js +17 -17
  18. package/components/ai-elements/tool.js +6 -6
  19. package/components/ai-elements/transcript.js +6 -5
  20. package/components/ai-elements/voice.js +1 -1
  21. package/components/alert.js +10 -10
  22. package/components/answer-sources.d.ts +42 -0
  23. package/components/answer-sources.js +111 -0
  24. package/components/answer.js +115 -114
  25. package/components/assistant-ui/action-bar.js +94 -48
  26. package/components/assistant-ui/attachment.js +131 -103
  27. package/components/assistant-ui/badge.d.ts +1 -1
  28. package/components/assistant-ui/badge.js +17 -17
  29. package/components/assistant-ui/chain-of-thought.d.ts +1 -1
  30. package/components/assistant-ui/composer-add-context.js +9 -9
  31. package/components/assistant-ui/composer-deep-research.js +5 -5
  32. package/components/assistant-ui/composer-harness.js +12 -9
  33. package/components/assistant-ui/composer-trigger-popover.js +45 -34
  34. package/components/assistant-ui/composer.js +59 -59
  35. package/components/assistant-ui/error.js +14 -14
  36. package/components/assistant-ui/file.d.ts +1 -1
  37. package/components/assistant-ui/image.d.ts +1 -1
  38. package/components/assistant-ui/image.js +113 -103
  39. package/components/assistant-ui/markdown-text.js +18 -18
  40. package/components/assistant-ui/message.js +46 -45
  41. package/components/assistant-ui/quote.js +1 -1
  42. package/components/assistant-ui/reasoning.d.ts +1 -1
  43. package/components/assistant-ui/reasoning.js +66 -77
  44. package/components/assistant-ui/suggestions.js +4 -4
  45. package/components/assistant-ui/thread-context.d.ts +2 -0
  46. package/components/assistant-ui/thread.js +41 -40
  47. package/components/assistant-ui/tool-fallback.js +60 -63
  48. package/components/assistant-ui/tool-group.d.ts +1 -1
  49. package/components/assistant-ui/tool-group.js +36 -42
  50. package/components/audio-waveform.js +25 -24
  51. package/components/autocomplete.d.ts +1 -0
  52. package/components/autocomplete.js +45 -43
  53. package/components/avatar.js +30 -30
  54. package/components/badge.d.ts +1 -1
  55. package/components/breadcrumbs.js +2 -2
  56. package/components/button.d.ts +2 -2
  57. package/components/button.js +22 -20
  58. package/components/card.js +8 -8
  59. package/components/carousel.js +105 -104
  60. package/components/chart.js +9 -7
  61. package/components/checkbox.js +74 -38
  62. package/components/chip.d.ts +1 -1
  63. package/components/code-block.js +3 -3
  64. package/components/collapsible.js +67 -23
  65. package/components/connector-card.js +6 -6
  66. package/components/drawer.d.ts +15 -10
  67. package/components/drawer.js +78 -77
  68. package/components/dropdown.d.ts +3 -1
  69. package/components/dropdown.js +88 -79
  70. package/components/empty-state.d.ts +4 -4
  71. package/components/empty-state.js +7 -7
  72. package/components/field.d.ts +4 -0
  73. package/components/field.js +45 -34
  74. package/components/file-dropzone.js +12 -12
  75. package/components/index.d.ts +4 -0
  76. package/components/index.js +584 -553
  77. package/components/infinite-canvas.js +1 -1
  78. package/components/input-field.js +51 -46
  79. package/components/input.js +20 -20
  80. package/components/link.js +9 -9
  81. package/components/modal.js +105 -73
  82. package/components/navbar.d.ts +1 -1
  83. package/components/navbar.js +1 -1
  84. package/components/number-field.js +38 -29
  85. package/components/page-header.js +12 -12
  86. package/components/pagination.js +19 -19
  87. package/components/panel.js +2 -2
  88. package/components/pixel-blast-svg.js +3 -3
  89. package/components/pixel-icon.d.ts +3 -1
  90. package/components/pixel-icon.js +294 -215
  91. package/components/popover.d.ts +1 -1
  92. package/components/popover.js +66 -64
  93. package/components/progress-circle.js +36 -32
  94. package/components/progress.js +28 -24
  95. package/components/radio.js +59 -49
  96. package/components/resizable-panel.js +1 -1
  97. package/components/reveal.d.ts +2 -2
  98. package/components/ripple.d.ts +3 -3
  99. package/components/scroll-area.js +17 -16
  100. package/components/segmented.d.ts +4 -1
  101. package/components/segmented.js +26 -25
  102. package/components/select.d.ts +2 -0
  103. package/components/select.js +61 -57
  104. package/components/setting-row.js +45 -42
  105. package/components/sidebar.d.ts +2 -2
  106. package/components/sidebar.js +131 -127
  107. package/components/skeleton.js +5 -5
  108. package/components/spinner.d.ts +13 -4
  109. package/components/spinner.js +42 -42
  110. package/components/stepper.js +21 -21
  111. package/components/switch.js +52 -32
  112. package/components/table.d.ts +24 -7
  113. package/components/table.js +457 -220
  114. package/components/tabs.js +149 -137
  115. package/components/textarea.js +1 -2
  116. package/components/toast.js +66 -66
  117. package/components/tooltip.js +2 -2
  118. package/components/tree.js +62 -51
  119. package/components/typography.d.ts +2 -1
  120. package/components/typography.js +33 -32
  121. package/components/ui/button.d.ts +2 -2
  122. package/components/ui/button.js +19 -19
  123. package/components/ui/collapsible.d.ts +1 -5
  124. package/components/ui/dialog.d.ts +3 -3
  125. package/components/ui/dialog.js +95 -58
  126. package/components/ui/tooltip.d.ts +2 -2
  127. package/components/ui/tooltip.js +67 -33
  128. package/components/viz-charts.js +95 -95
  129. package/demo/components/add-to-artifact.js +341 -0
  130. package/demo/lib/artifact-library.js +134 -0
  131. package/fonts/aribau-grotesk-medium.woff2 +0 -0
  132. package/fonts/aribau-grotesk-regular.woff2 +0 -0
  133. package/fonts.css +11 -11
  134. package/hooks/agents-ui/use-agent-audio-visualizer-aura.js +17 -16
  135. package/hooks/agents-ui/use-agent-audio-visualizer-wave.js +21 -20
  136. package/lib/icons.d.ts +12 -0
  137. package/lib/icons.js +107 -104
  138. package/lib/motion.d.ts +42 -39
  139. package/lib/motion.js +112 -52
  140. package/lib/spinner-mark.d.ts +9 -0
  141. package/lib/spinner-mark.js +98 -0
  142. package/llms.txt +69 -26
  143. package/manifest.json +344 -42
  144. package/package.json +1 -1
  145. package/styles.css +175 -161
  146. package/theme.css +104 -128
  147. package/components/ui/collapsible.js +0 -35
  148. package/fonts/aribau-grotesk-500.otf +0 -0
  149. package/fonts/aribau-grotesk-600.woff2 +0 -0
@@ -7,7 +7,7 @@ import "@xyflow/react/dist/style.css";
7
7
  import { cn as W } from "../lib/cn.js";
8
8
  import { Minus as q, Plus as J, Maximize as Q, Magnet as X } from "../lib/icons.js";
9
9
  import { Button as a } from "./button.js";
10
- const x = 16, Y = 1.2, $ = [x, x], ee = 1.4, w = 18, oe = 6, te = [8, 4], re = 11, I = 150, ae = 200, ne = 0.28, R = "var(--canvas-edge)";
10
+ const x = 16, Y = 1.2, $ = [x, x], ee = 1.4, w = 18, oe = 2, te = [8, 4], re = 11, I = 150, ae = 200, ne = 0.28, R = "var(--canvas-edge)";
11
11
  function v(o) {
12
12
  return typeof window > "u" || !window.matchMedia ? o : window.matchMedia("(prefers-reduced-motion: reduce)").matches ? 0 : o;
13
13
  }
@@ -1,91 +1,96 @@
1
1
  "use client";
2
- import { jsx as e, jsxs as j } from "react/jsx-runtime";
2
+ import { jsx as e, jsxs as _ } from "react/jsx-runtime";
3
3
  import * as a from "react";
4
- import { cn as k } from "../lib/cn.js";
5
- import { EyeOff as B, Eye as S } from "../lib/icons.js";
6
- import { inputBaseClass as _, Field as C } from "./field.js";
7
- const H = {
4
+ import { cn as $ } from "../lib/cn.js";
5
+ import { EyeOff as C, Eye as H } from "../lib/icons.js";
6
+ import { inputBaseClass as O, Field as A } from "./field.js";
7
+ const D = {
8
8
  sm: "h-8 text-xs",
9
9
  md: "h-10 text-xs",
10
10
  lg: "h-11 text-base"
11
- }, O = a.forwardRef(
11
+ }, G = a.forwardRef(
12
12
  ({
13
13
  // Field props
14
14
  label: l,
15
- description: d,
15
+ description: r,
16
16
  error: s,
17
17
  required: c,
18
- className: w,
18
+ className: N,
19
19
  // Input props
20
- id: y,
21
- inputClassName: b,
22
- size: N = "md",
23
- startContent: o,
24
- endContent: z,
20
+ id: I,
21
+ inputClassName: z,
22
+ size: B = "md",
23
+ startContent: t,
24
+ endContent: E,
25
25
  isInvalid: u,
26
26
  type: f,
27
- multiline: i = !1,
28
- rows: E,
27
+ multiline: n = !1,
28
+ rows: F,
29
+ "aria-describedby": j,
29
30
  ...p
30
31
  }, m) => {
31
- const F = a.useId(), r = y ?? F, [n, I] = a.useState(!1), x = !i && f === "password", t = z ?? (x ? /* @__PURE__ */ e(
32
+ const R = a.useId(), o = I ?? R, x = `${o}-error`, g = `${o}-description`, v = [j, s ? x : r ? g : null].filter(Boolean).join(" ") || void 0, [d, k] = a.useState(!1), h = !n && f === "password", i = E ?? (h ? /* @__PURE__ */ e(
32
33
  "button",
33
34
  {
34
35
  type: "button",
35
- "aria-label": n ? "Hide password" : "Show password",
36
- onClick: () => I((R) => !R),
36
+ "aria-label": d ? "Hide password" : "Show password",
37
+ onClick: () => k((S) => !S),
37
38
  className: "-mr-1 flex items-center rounded-xs p-1 outline-none transition-colors hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring",
38
- children: n ? /* @__PURE__ */ e(B, {}) : /* @__PURE__ */ e(S, {})
39
+ children: d ? /* @__PURE__ */ e(C, {}) : /* @__PURE__ */ e(H, {})
39
40
  }
40
- ) : void 0), g = k(
41
- _,
42
- i ? "min-h-20 resize-y py-2 text-xs" : H[N],
43
- o && "pl-9",
44
- t && "pr-9",
45
- b
46
- ), h = i ? /* @__PURE__ */ e(
41
+ ) : void 0), b = $(
42
+ O,
43
+ n ? "min-h-20 resize-y py-2 text-xs" : D[B],
44
+ t && "pl-9",
45
+ i && "pr-9",
46
+ z
47
+ ), y = n ? /* @__PURE__ */ e(
47
48
  "textarea",
48
49
  {
49
50
  ref: m,
50
- id: r,
51
- rows: E ?? 3,
51
+ id: o,
52
+ rows: F ?? 3,
52
53
  "aria-invalid": u || !!s || void 0,
53
- className: g,
54
+ "aria-describedby": v,
55
+ className: b,
54
56
  ...p
55
57
  }
56
58
  ) : /* @__PURE__ */ e(
57
59
  "input",
58
60
  {
59
61
  ref: m,
60
- id: r,
61
- type: x && n ? "text" : f,
62
+ id: o,
63
+ type: h && d ? "text" : f,
62
64
  "aria-invalid": u || !!s || void 0,
63
- className: g,
65
+ "aria-describedby": v,
66
+ className: b,
64
67
  ...p
65
68
  }
66
- ), v = o || t ? (
69
+ ), w = t || i ? (
67
70
  // group/field: adornment icons follow the field's interactive states.
68
- /* @__PURE__ */ j("div", { className: "group/field relative w-full", children: [
69
- o && /* @__PURE__ */ e("span", { className: "pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3 text-muted-foreground transition-colors duration-(--duration-fast) group-focus-within/field:text-foreground group-hover/field:text-foreground [&_svg]:size-4", children: o }),
70
- h,
71
- t && /* @__PURE__ */ e("span", { className: "absolute inset-y-0 right-0 flex items-center pr-3 text-muted-foreground transition-colors duration-(--duration-fast) group-focus-within/field:text-foreground group-hover/field:text-foreground [&_svg]:size-4", children: t })
71
+ /* @__PURE__ */ _("div", { className: "group/field relative w-full", children: [
72
+ t && /* @__PURE__ */ e("span", { className: "pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3 text-muted-foreground transition-colors duration-150 group-focus-within/field:text-foreground group-hover/field:text-foreground [&_svg]:size-4", children: t }),
73
+ y,
74
+ i && /* @__PURE__ */ e("span", { className: "absolute inset-y-0 right-0 flex items-center pr-3 text-muted-foreground transition-colors duration-150 group-focus-within/field:text-foreground group-hover/field:text-foreground [&_svg]:size-4", children: i })
72
75
  ] })
73
- ) : h;
74
- return !l && !d && !s && !c ? v : /* @__PURE__ */ e(
75
- C,
76
+ ) : y;
77
+ return !l && !r && !s && !c ? w : /* @__PURE__ */ e(
78
+ A,
76
79
  {
77
80
  label: l,
78
- description: d,
81
+ description: r,
79
82
  error: s,
80
83
  required: c,
81
- htmlFor: r,
82
- className: w,
83
- children: v
84
+ htmlFor: o,
85
+ errorId: x,
86
+ descriptionId: g,
87
+ className: N,
88
+ children: w
84
89
  }
85
90
  );
86
91
  }
87
92
  );
88
- O.displayName = "InputField";
93
+ G.displayName = "InputField";
89
94
  export {
90
- O as InputField
95
+ G as InputField
91
96
  };
@@ -1,56 +1,56 @@
1
1
  "use client";
2
2
  import { jsx as e, jsxs as g } from "react/jsx-runtime";
3
- import * as l from "react";
3
+ import * as d from "react";
4
4
  import { cn as v } from "../lib/cn.js";
5
5
  import { EyeOff as h, Eye as w } from "../lib/icons.js";
6
6
  import { inputBaseClass as b } from "./field.js";
7
7
  const y = {
8
- sm: "h-8 text-xs",
9
- md: "h-10 text-xs",
10
- lg: "h-11 text-base"
11
- }, N = l.forwardRef(
8
+ sm: "h-8 rounded-sm text-xs",
9
+ md: "h-10 rounded-md text-xs",
10
+ lg: "h-11 rounded-md text-base"
11
+ }, N = d.forwardRef(
12
12
  ({
13
- className: a,
14
- size: d = "md",
13
+ className: l,
14
+ size: a = "md",
15
15
  startContent: o,
16
16
  endContent: u,
17
17
  isInvalid: f,
18
18
  type: t,
19
19
  ...c
20
- }, p) => {
21
- const [r, m] = l.useState(!1), i = t === "password", s = u ?? (i ? /* @__PURE__ */ e(
20
+ }, m) => {
21
+ const [s, p] = d.useState(!1), i = t === "password", r = u ?? (i ? /* @__PURE__ */ e(
22
22
  "button",
23
23
  {
24
24
  type: "button",
25
- "aria-label": r ? "Hide password" : "Show password",
26
- onClick: () => m((x) => !x),
25
+ "aria-label": s ? "Hide password" : "Show password",
26
+ onClick: () => p((x) => !x),
27
27
  className: "-mr-1 flex items-center rounded-xs p-1 outline-none transition-colors hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring",
28
- children: r ? /* @__PURE__ */ e(h, {}) : /* @__PURE__ */ e(w, {})
28
+ children: s ? /* @__PURE__ */ e(h, {}) : /* @__PURE__ */ e(w, {})
29
29
  }
30
30
  ) : void 0), n = /* @__PURE__ */ e(
31
31
  "input",
32
32
  {
33
- ref: p,
34
- type: i && r ? "text" : t,
33
+ ref: m,
34
+ type: i && s ? "text" : t,
35
35
  "aria-invalid": f || void 0,
36
36
  className: v(
37
37
  b,
38
- y[d],
38
+ y[a],
39
39
  o && "pl-9",
40
- s && "pr-9",
41
- a
40
+ r && "pr-9",
41
+ l
42
42
  ),
43
43
  ...c
44
44
  }
45
45
  );
46
- return !o && !s ? n : (
46
+ return !o && !r ? n : (
47
47
  // group/field: adornment icons follow the field's interactive states —
48
48
  // muted at rest, full black while hovered/focused (same signal as the
49
49
  // border snapping to brand).
50
50
  /* @__PURE__ */ g("div", { className: "group/field relative w-full", children: [
51
- o && /* @__PURE__ */ e("span", { className: "pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3 text-muted-foreground transition-colors duration-(--duration-fast) group-focus-within/field:text-foreground group-hover/field:text-foreground [&_svg]:size-4", children: o }),
51
+ o && /* @__PURE__ */ e("span", { className: "pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3 text-muted-foreground transition-colors duration-150 group-focus-within/field:text-foreground group-hover/field:text-foreground [&_svg]:size-4", children: o }),
52
52
  n,
53
- s && /* @__PURE__ */ e("span", { className: "absolute inset-y-0 right-0 flex items-center pr-3 text-muted-foreground transition-colors duration-(--duration-fast) group-focus-within/field:text-foreground group-hover/field:text-foreground [&_svg]:size-4", children: s })
53
+ r && /* @__PURE__ */ e("span", { className: "absolute inset-y-0 right-0 flex items-center pr-3 text-muted-foreground transition-colors duration-150 group-focus-within/field:text-foreground group-hover/field:text-foreground [&_svg]:size-4", children: r })
54
54
  ] })
55
55
  );
56
56
  }
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { jsxs as e, jsx as o } from "react/jsx-runtime";
2
+ import { jsxs as r, jsx as o } from "react/jsx-runtime";
3
3
  import * as u from "react";
4
4
  import { ArrowUpRight as t } from "../lib/icons.js";
5
5
  import { cn as d } from "../lib/cn.js";
@@ -8,17 +8,17 @@ const c = {
8
8
  muted: "text-muted-foreground",
9
9
  primary: "text-brand"
10
10
  }, f = u.forwardRef(
11
- ({ className: n, color: a = "default", isExternal: r = !1, children: i, ...s }, l) => /* @__PURE__ */ e(
11
+ ({ className: n, color: a = "default", isExternal: e = !1, children: i, ...s }, l) => /* @__PURE__ */ r(
12
12
  "a",
13
13
  {
14
14
  ref: l,
15
- target: r ? "_blank" : void 0,
16
- rel: r ? "noopener noreferrer" : void 0,
15
+ target: e ? "_blank" : void 0,
16
+ rel: e ? "noopener noreferrer" : void 0,
17
17
  className: d(
18
18
  // Links read as links by WEIGHT at rest (bold against body copy);
19
19
  // the underline is a hover/focus affordance. Underline spec: dotted,
20
20
  // 12% thickness, 24% offset, skip-ink, auto (current) color.
21
- "group/link inline-flex items-center gap-1 rounded-xs font-semibold",
21
+ "group/link inline-flex items-center gap-1 rounded-xs font-medium",
22
22
  "hover:underline focus-visible:underline decoration-dotted decoration-[0.12em] underline-offset-[0.24em]",
23
23
  "outline-none focus-visible:ring-3 focus-visible:ring-ring",
24
24
  c[a],
@@ -27,7 +27,7 @@ const c = {
27
27
  ...s,
28
28
  children: [
29
29
  i,
30
- r && // Two arrows stacked in a clipped box, driven by a single group-hover
30
+ e && // Two arrows stacked in a clipped box, driven by a single group-hover
31
31
  // CSS var (`--arrow-out`). At rest, arrow A sits centered and arrow B
32
32
  // is parked bottom-left off the viewport (--arrow-out = 0). On hover,
33
33
  // --arrow-out = 1: A slides up-right out of the frame, B slides in to
@@ -35,7 +35,7 @@ const c = {
35
35
  // destination. Space is reserved so the label never shifts.
36
36
  // (Inline style — Tailwind's arbitrary translate utilities weren't
37
37
  // being generated by the JIT for these specific values.)
38
- /* @__PURE__ */ e(
38
+ /* @__PURE__ */ r(
39
39
  "span",
40
40
  {
41
41
  "aria-hidden": !0,
@@ -44,7 +44,7 @@ const c = {
44
44
  /* @__PURE__ */ o(
45
45
  t,
46
46
  {
47
- className: "absolute inset-0 size-full transition-transform duration-(--duration-fast) ease-out motion-reduce:transition-none",
47
+ className: "absolute inset-0 size-full transition-transform duration-150 ease-out motion-reduce:transition-none",
48
48
  style: {
49
49
  transform: "translate(calc(var(--arrow-out) * 100%), calc(var(--arrow-out) * -100%))"
50
50
  }
@@ -53,7 +53,7 @@ const c = {
53
53
  /* @__PURE__ */ o(
54
54
  t,
55
55
  {
56
- className: "absolute inset-0 size-full transition-transform duration-(--duration-fast) ease-out motion-reduce:transition-none",
56
+ className: "absolute inset-0 size-full transition-transform duration-150 ease-out motion-reduce:transition-none",
57
57
  style: {
58
58
  transform: "translate(calc((var(--arrow-out) - 1) * 100%), calc((1 - var(--arrow-out)) * 100%))"
59
59
  }
@@ -1,16 +1,19 @@
1
1
  "use client";
2
- import { jsx as r, jsxs as m } from "react/jsx-runtime";
2
+ import { jsx as n, jsxs as y } from "react/jsx-runtime";
3
3
  import * as i from "react";
4
- import { createPortal as y } from "react-dom";
5
- import { MotionConfig as g, AnimatePresence as b, motion as f } from "motion/react";
6
- import { Close as w } from "../lib/icons.js";
7
- import { cva as h } from "class-variance-authority";
8
- import { cn as n } from "../lib/cn.js";
9
- import { backdropVariants as N, modalPanelVariants as M } from "../lib/motion.js";
10
- import { Ripple as R } from "./ripple.js";
11
- const k = h(
4
+ import { createPortal as R } from "react-dom";
5
+ import { MotionConfig as E, AnimatePresence as A, motion as h } from "motion/react";
6
+ import { Close as D } from "../lib/icons.js";
7
+ import { cva as F } from "class-variance-authority";
8
+ import { cn as a } from "../lib/cn.js";
9
+ import { backdropVariants as j, modalPanelVariants as z } from "../lib/motion.js";
10
+ import { Ripple as P } from "./ripple.js";
11
+ const T = F(
12
12
  [
13
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",
14
17
  "bg-elevated text-foreground",
15
18
  "rounded-xl shadow-elevation"
16
19
  ],
@@ -26,72 +29,98 @@ const k = h(
26
29
  defaultVariants: { size: "md" }
27
30
  }
28
31
  );
29
- function _({ open: o, onOpenChange: e, size: t, className: u, children: p }) {
30
- const s = i.useRef(null), l = i.useRef(null);
32
+ function U({ open: o, onOpenChange: t, size: r, className: g, children: w }) {
33
+ const d = i.useRef(null), f = i.useRef(null), u = i.useRef(null);
31
34
  return i.useEffect(() => {
32
35
  if (!o) return;
33
- l.current = document.activeElement;
34
- const x = document.body.style.overflow;
36
+ u.current = document.activeElement;
37
+ const M = document.body.style.overflow;
35
38
  document.body.style.overflow = "hidden";
36
- const d = (a) => {
37
- a.key === "Escape" && (a.stopPropagation(), e(!1));
39
+ const m = f.current, p = [];
40
+ if (m)
41
+ for (const e of Array.from(document.body.children))
42
+ e !== m && e instanceof HTMLElement && !e.inert && (e.inert = !0, p.push(e));
43
+ const N = () => {
44
+ var e;
45
+ return Array.from(
46
+ ((e = d.current) == null ? void 0 : e.querySelectorAll(
47
+ 'a[href],button:not([disabled]),textarea:not([disabled]),input:not([disabled]),select:not([disabled]),[tabindex]:not([tabindex="-1"])'
48
+ )) ?? []
49
+ );
50
+ }, x = (e) => {
51
+ if (e.key === "Escape") {
52
+ e.stopPropagation(), t(!1);
53
+ return;
54
+ }
55
+ if (e.key !== "Tab") return;
56
+ const s = d.current;
57
+ if (!s) return;
58
+ const l = N();
59
+ if (l.length === 0) {
60
+ e.preventDefault(), s.focus();
61
+ return;
62
+ }
63
+ const v = l[0], b = l[l.length - 1], c = document.activeElement;
64
+ e.shiftKey ? (c === v || c === s) && (e.preventDefault(), b.focus()) : c === b && (e.preventDefault(), v.focus());
38
65
  };
39
- document.addEventListener("keydown", d);
40
- const v = requestAnimationFrame(() => {
41
- var a;
42
- (a = s.current) == null || a.focus();
66
+ document.addEventListener("keydown", x);
67
+ const k = requestAnimationFrame(() => {
68
+ var e;
69
+ (e = d.current) == null || e.focus();
43
70
  });
44
71
  return () => {
45
- var a, c;
46
- document.removeEventListener("keydown", d), document.body.style.overflow = x, cancelAnimationFrame(v), (c = (a = l.current) == null ? void 0 : a.focus) == null || c.call(a);
72
+ var e, s;
73
+ document.removeEventListener("keydown", x), document.body.style.overflow = M;
74
+ for (const l of p) l.inert = !1;
75
+ cancelAnimationFrame(k), (s = (e = u.current) == null ? void 0 : e.focus) == null || s.call(e);
47
76
  };
48
- }, [o, e]), y(
49
- /* @__PURE__ */ r(g, { reducedMotion: "user", children: /* @__PURE__ */ r(b, { children: o && /* @__PURE__ */ m("div", { className: "fixed inset-0 z-50 flex items-center justify-center p-4", children: [
50
- /* @__PURE__ */ r(
51
- f.div,
77
+ }, [o, t]), R(
78
+ /* @__PURE__ */ n(E, { reducedMotion: "user", children: /* @__PURE__ */ n(A, { children: o && /* @__PURE__ */ y("div", { ref: f, className: "fixed inset-0 z-50 flex items-center justify-center p-4", children: [
79
+ /* @__PURE__ */ n(
80
+ h.div,
52
81
  {
53
- variants: N,
82
+ variants: j,
54
83
  initial: "hidden",
55
84
  animate: "visible",
56
85
  exit: "hidden",
57
86
  className: "absolute inset-0 bg-overlay",
58
- onClick: () => e(!1),
87
+ onClick: () => t(!1),
59
88
  "aria-hidden": !0
60
89
  },
61
90
  "backdrop"
62
91
  ),
63
- /* @__PURE__ */ m(
64
- f.div,
92
+ /* @__PURE__ */ y(
93
+ h.div,
65
94
  {
66
- ref: s,
67
- variants: M,
95
+ ref: d,
96
+ variants: z,
68
97
  initial: "hidden",
69
98
  animate: "visible",
70
99
  exit: "hidden",
71
100
  role: "dialog",
72
101
  "aria-modal": "true",
73
102
  tabIndex: -1,
74
- className: n(k({ size: t }), "relative outline-none", u),
103
+ className: a(T({ size: r }), "relative outline-none", g),
75
104
  children: [
76
- /* @__PURE__ */ r(R, { origin: "center" }),
77
- /* @__PURE__ */ r(
105
+ /* @__PURE__ */ n(P, { origin: "center" }),
106
+ /* @__PURE__ */ n(
78
107
  "button",
79
108
  {
80
109
  type: "button",
81
- onClick: () => e(!1),
110
+ onClick: () => t(!1),
82
111
  "aria-label": "Close",
83
- className: n(
112
+ className: a(
84
113
  "absolute right-4 top-4 inline-flex size-8 items-center justify-center",
85
- "rounded-md text-muted-foreground",
86
- "transition-[background,color,transform] duration-(--duration-fast) ease-out hover:bg-muted hover:text-foreground",
87
- "active:scale-(--scale-press)",
114
+ "rounded-sm text-muted-foreground",
115
+ "transition-[background,color,transform] duration-150 ease-out motion-reduce:transition-none hover:bg-muted hover:text-foreground",
116
+ "active:scale-[0.97] motion-reduce:active:scale-100",
88
117
  "outline-none focus-visible:ring-3 focus-visible:ring-ring",
89
118
  "[&_svg]:size-4 [&_svg]:shrink-0"
90
119
  ),
91
- children: /* @__PURE__ */ r(w, { "aria-hidden": !0 })
120
+ children: /* @__PURE__ */ n(D, { "aria-hidden": !0 })
92
121
  }
93
122
  ),
94
- p
123
+ w
95
124
  ]
96
125
  },
97
126
  "panel"
@@ -100,59 +129,62 @@ function _({ open: o, onOpenChange: e, size: t, className: u, children: p }) {
100
129
  document.body
101
130
  );
102
131
  }
103
- const j = i.forwardRef(({ className: o, ...e }, t) => /* @__PURE__ */ r(
132
+ const V = i.forwardRef(({ className: o, ...t }, r) => /* @__PURE__ */ n(
104
133
  "div",
105
134
  {
106
- ref: t,
107
- className: n("flex flex-col gap-1 px-6 pt-6 pr-14", o),
108
- ...e
135
+ ref: r,
136
+ className: a("flex shrink-0 flex-col gap-1 px-6 pt-6 pr-14", o),
137
+ ...t
109
138
  }
110
139
  ));
111
- j.displayName = "ModalHeader";
112
- const z = i.forwardRef(({ className: o, ...e }, t) => /* @__PURE__ */ r(
140
+ V.displayName = "ModalHeader";
141
+ const H = i.forwardRef(({ className: o, ...t }, r) => /* @__PURE__ */ n(
113
142
  "h2",
114
143
  {
115
- ref: t,
116
- className: n("text-lg font-semibold text-foreground", o),
117
- ...e
144
+ ref: r,
145
+ className: a("text-lg font-medium text-foreground", o),
146
+ ...t
118
147
  }
119
148
  ));
120
- z.displayName = "ModalTitle";
121
- const E = i.forwardRef(({ className: o, ...e }, t) => /* @__PURE__ */ r(
149
+ H.displayName = "ModalTitle";
150
+ const L = i.forwardRef(({ className: o, ...t }, r) => /* @__PURE__ */ n(
122
151
  "p",
123
152
  {
124
- ref: t,
125
- className: n("text-xs text-muted-foreground", o),
126
- ...e
153
+ ref: r,
154
+ className: a("text-xs text-muted-foreground", o),
155
+ ...t
127
156
  }
128
157
  ));
129
- E.displayName = "ModalDescription";
130
- const F = i.forwardRef(({ className: o, ...e }, t) => /* @__PURE__ */ r(
158
+ L.displayName = "ModalDescription";
159
+ const q = i.forwardRef(({ className: o, ...t }, r) => /* @__PURE__ */ n(
131
160
  "div",
132
161
  {
133
- ref: t,
134
- className: n("px-6 py-4 text-xs text-foreground", o),
135
- ...e
162
+ ref: r,
163
+ className: a(
164
+ "min-h-0 flex-1 overflow-y-auto overscroll-contain px-6 py-4 text-xs text-foreground",
165
+ o
166
+ ),
167
+ ...t
136
168
  }
137
169
  ));
138
- F.displayName = "ModalBody";
139
- const P = i.forwardRef(({ className: o, ...e }, t) => /* @__PURE__ */ r(
170
+ q.displayName = "ModalBody";
171
+ const B = i.forwardRef(({ className: o, ...t }, r) => /* @__PURE__ */ n(
140
172
  "div",
141
173
  {
142
- ref: t,
143
- className: n(
144
- "flex items-center justify-end gap-2 px-6 pb-6 pt-2",
174
+ ref: r,
175
+ className: a(
176
+ "flex shrink-0 items-center justify-end gap-2 px-6 pb-6 pt-2",
145
177
  o
146
178
  ),
147
- ...e
179
+ ...t
148
180
  }
149
181
  ));
150
- P.displayName = "ModalFooter";
182
+ B.displayName = "ModalFooter";
151
183
  export {
152
- _ as Modal,
153
- F as ModalBody,
154
- E as ModalDescription,
155
- P as ModalFooter,
156
- j as ModalHeader,
157
- z as ModalTitle
184
+ U as Modal,
185
+ q as ModalBody,
186
+ L as ModalDescription,
187
+ B as ModalFooter,
188
+ V as ModalHeader,
189
+ H as ModalTitle
158
190
  };
@@ -3,7 +3,7 @@ import * as React from "react";
3
3
  export declare const Navbar: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & React.RefAttributes<HTMLElement>>;
4
4
  export declare const NavbarBrand: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
5
5
  declare const navbarContentVariants: (props?: ({
6
- justify?: "center" | "end" | "start" | null | undefined;
6
+ justify?: "end" | "center" | "start" | null | undefined;
7
7
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
8
8
  export interface NavbarContentProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof navbarContentVariants> {
9
9
  }
@@ -21,7 +21,7 @@ const d = o.forwardRef(({ className: r, ...a }, e) => /* @__PURE__ */ t(
21
21
  {
22
22
  ref: e,
23
23
  className: n(
24
- "flex items-center gap-2 font-semibold text-foreground",
24
+ "flex items-center gap-2 font-medium text-foreground",
25
25
  r
26
26
  ),
27
27
  ...a