@alfadocs/ui-kit 0.17.0 → 0.17.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.
Files changed (105) hide show
  1. package/dist/_chunks/{accordion-DOmxGEWU.js → accordion-CNcodXuO.js} +6 -6
  2. package/dist/_chunks/{ai-prompt-input-DEiQwIMn.js → ai-prompt-input-B-w5Rx3V.js} +184 -181
  3. package/dist/_chunks/{alert-pgdXrEO5.js → alert-DBnawbmf.js} +64 -59
  4. package/dist/_chunks/{audio-recorder-CRh4uyFL.js → audio-recorder-DNkQLW1G.js} +3 -3
  5. package/dist/_chunks/{autocomplete-mOg7WLOh.js → autocomplete-BxfabhZ8.js} +167 -164
  6. package/dist/_chunks/{balance-cell-renderer-DWWtX-VM.js → balance-cell-renderer-DJB6WDPe.js} +2 -2
  7. package/dist/_chunks/{carousel.agent-OTn-kMQg.js → carousel.agent-Xuw9LPZN.js} +14 -7
  8. package/dist/_chunks/{chat-input-UK-bXU7u.js → chat-input-B3XmFGDw.js} +123 -122
  9. package/dist/_chunks/checkbox-group-Bwmt1ovQ.js +213 -0
  10. package/dist/_chunks/{checkbox-D5EHnB14.js → checkbox-mwbrPZDY.js} +75 -70
  11. package/dist/_chunks/{collapsible-CuxUBoHJ.js → collapsible-hHiyZp0b.js} +61 -63
  12. package/dist/_chunks/{color-picker-BPfcByHH.js → color-picker-Bm-gzpsh.js} +2 -2
  13. package/dist/_chunks/{combobox-D5tWe0t_.js → combobox-Da9eq00i.js} +214 -211
  14. package/dist/_chunks/{copy-field-BCHAZ8QV.js → copy-field-BAF4mt9h.js} +95 -132
  15. package/dist/_chunks/{date-picker-BlhtBhPo.js → date-picker-BIoSLRly.js} +222 -219
  16. package/dist/_chunks/{date-range-picker-C2hRu_Ke.js → date-range-picker-9gANFNG9.js} +81 -78
  17. package/dist/_chunks/{date-time-picker-B67mPZmP.js → date-time-picker-DG7BiGdb.js} +98 -95
  18. package/dist/_chunks/{dialog-DRp6Dejy.js → dialog-DUomPCRS.js} +69 -71
  19. package/dist/_chunks/{dropdown-menu-dyV7gHh_.js → dropdown-menu-DZxwF23X.js} +108 -110
  20. package/dist/_chunks/{freemium-paywall-BTEiVkes.js → freemium-paywall-DXc7XlGE.js} +98 -97
  21. package/dist/_chunks/{leo-sidebar-D3TuyH5_.js → leo-sidebar-DIsiTju3.js} +2 -2
  22. package/dist/_chunks/{list-DcjV0m5B.js → list-BdvDctBz.js} +184 -180
  23. package/dist/_chunks/{message-tray-Fsend-du.js → message-tray-BNAS8al4.js} +111 -111
  24. package/dist/_chunks/{multi-select-DooDzQIp.js → multi-select-CyspR5ZF.js} +157 -154
  25. package/dist/_chunks/{navigation-menu-DdufF-_4.js → navigation-menu-CyS1fBJ7.js} +85 -87
  26. package/dist/_chunks/{notification-tray-C3dYdLAF.js → notification-tray-D_69dXFY.js} +114 -114
  27. package/dist/_chunks/{number-input-DH00o0DN.js → number-input-BZXu6bPY.js} +92 -89
  28. package/dist/_chunks/{otp-input-BBXYvLx5.js → otp-input-BDF_iNpa.js} +92 -93
  29. package/dist/_chunks/{pagination-F1ei4khE.js → pagination-BWaXF7W0.js} +194 -211
  30. package/dist/_chunks/{patient-shell-BE0CdPOJ.js → patient-shell-BOOaWZA9.js} +3 -3
  31. package/dist/_chunks/{payment-form-CI77oIx1.js → payment-form-BjkuQeqR.js} +2 -2
  32. package/dist/_chunks/{pdf-viewer-CnEJvmXC.js → pdf-viewer-BG_nsFT5.js} +2 -2
  33. package/dist/_chunks/{public-header.agent-sDi9N9su.js → public-header.agent-BIBQzkeV.js} +7 -12
  34. package/dist/_chunks/{radio-group-Cz1a4QCA.js → radio-group-BHZOxrIK.js} +4 -4
  35. package/dist/_chunks/{select-Ca6ibiDL.js → select-C92AT_OZ.js} +7 -7
  36. package/dist/_chunks/{sidebar-D8Lq065m.js → sidebar-BqzlRBvC.js} +271 -291
  37. package/dist/_chunks/{slider-CkR6CLun.js → slider-CfEzeseL.js} +4 -4
  38. package/dist/_chunks/{tabs-CRCyPpJo.js → tabs-aEQfQV3x.js} +8 -8
  39. package/dist/_chunks/{theme-toggle-B3meAb3y.js → theme-toggle-BswYl0Yp.js} +2 -2
  40. package/dist/_chunks/use-controllable-state-BiY4xTzM.js +23 -0
  41. package/dist/_chunks/use-copy-to-clipboard-Cyfc_dlv.js +43 -0
  42. package/dist/_chunks/use-persistent-state-i23OWy6G.js +24 -0
  43. package/dist/_chunks/{warning-stack-CeRihME9.js → warning-stack-CDH9TudY.js} +2 -2
  44. package/dist/_chunks/{workflow-map-D3MvrsZV.js → workflow-map-BeKe23uw.js} +3 -3
  45. package/dist/agent-catalog.json +1 -1
  46. package/dist/components/_shared/use-debounced-callback.d.ts +1 -5
  47. package/dist/components/_shared/use-direction.d.ts +1 -18
  48. package/dist/components/_shared/use-focus-trap.d.ts +1 -31
  49. package/dist/components/accordion/index.js +1 -1
  50. package/dist/components/ai-prompt-input/index.js +1 -1
  51. package/dist/components/alert/index.js +1 -1
  52. package/dist/components/audio-recorder/index.js +1 -1
  53. package/dist/components/autocomplete/index.js +1 -1
  54. package/dist/components/carousel/index.js +1 -1
  55. package/dist/components/chat-input/index.js +1 -1
  56. package/dist/components/checkbox/index.js +1 -1
  57. package/dist/components/checkbox-group/index.js +1 -1
  58. package/dist/components/collapsible/index.js +1 -1
  59. package/dist/components/color-picker/index.js +1 -1
  60. package/dist/components/combobox/index.js +1 -1
  61. package/dist/components/command-palette/command-palette.d.ts +1 -1
  62. package/dist/components/copy-field/index.js +1 -1
  63. package/dist/components/data-table/index.js +1 -1
  64. package/dist/components/date-picker/index.js +1 -1
  65. package/dist/components/date-range-picker/index.js +1 -1
  66. package/dist/components/date-time-picker/index.js +1 -1
  67. package/dist/components/dialog/index.js +1 -1
  68. package/dist/components/dropdown-menu/index.js +1 -1
  69. package/dist/components/freemium-paywall/index.js +1 -1
  70. package/dist/components/icon-button-group/icon-button-group.d.ts +14 -14
  71. package/dist/components/list/index.js +1 -1
  72. package/dist/components/message-tray/index.js +1 -1
  73. package/dist/components/multi-select/index.js +1 -1
  74. package/dist/components/navigation-menu/index.js +1 -1
  75. package/dist/components/notification-tray/index.js +1 -1
  76. package/dist/components/number-input/index.js +1 -1
  77. package/dist/components/otp-input/index.js +1 -1
  78. package/dist/components/pagination/index.js +1 -1
  79. package/dist/components/payment-form/index.js +1 -1
  80. package/dist/components/pdf-viewer/index.js +1 -1
  81. package/dist/components/public-header/index.js +1 -1
  82. package/dist/components/public-header/public-header.d.ts +1 -1
  83. package/dist/components/radio-group/index.js +1 -1
  84. package/dist/components/select/index.js +1 -1
  85. package/dist/components/sidebar/index.js +8 -7
  86. package/dist/components/sidebar/sidebar.d.ts +1 -1
  87. package/dist/components/slider/index.js +1 -1
  88. package/dist/components/tabs/index.js +1 -1
  89. package/dist/components/theme-toggle/index.js +1 -1
  90. package/dist/components/warning-stack/index.js +1 -1
  91. package/dist/components/workflow/index.js +1 -1
  92. package/dist/hooks/index.d.ts +8 -0
  93. package/dist/hooks/index.js +98 -15
  94. package/dist/hooks/use-debounced-callback.d.ts +19 -0
  95. package/dist/hooks/use-debounced-value.d.ts +16 -0
  96. package/dist/hooks/use-direction.d.ts +19 -0
  97. package/dist/hooks/use-focus-trap.d.ts +32 -0
  98. package/dist/hooks/use-isomorphic-layout-effect.d.ts +13 -0
  99. package/dist/hooks/use-persistent-state.d.ts +16 -0
  100. package/dist/index.js +493 -492
  101. package/dist/patterns/leo-assistant/index.js +1 -1
  102. package/dist/patterns/patient-shell/index.js +1 -1
  103. package/dist/tokens.css +1 -1
  104. package/package.json +4 -2
  105. package/dist/_chunks/checkbox-group-Qkm3Rg1S.js +0 -208
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfadocs/ui-kit",
3
- "version": "0.17.0",
3
+ "version": "0.17.2",
4
4
  "type": "module",
5
5
  "description": "AlfaDocs shared design system — tokens, components, patterns, and translations for platform, booking, and alfascribe.",
6
6
  "license": "BUSL-1.1",
@@ -661,6 +661,7 @@
661
661
  }
662
662
  },
663
663
  "dependencies": {
664
+ "@alfadocs/ui-kit": "^0.17.1",
664
665
  "@radix-ui/react-accordion": "^1.2.12",
665
666
  "@radix-ui/react-alert-dialog": "^1.1.15",
666
667
  "@radix-ui/react-aspect-ratio": "^1.1.8",
@@ -766,6 +767,7 @@
766
767
  "typescript-eslint": "^8.59.3",
767
768
  "vite": "^6.4.2",
768
769
  "vitest": "^4.1.4",
769
- "vitest-axe": "^0.1.0"
770
+ "vitest-axe": "^0.1.0",
771
+ "webpack-cli": "^7.0.2"
770
772
  }
771
773
  }
@@ -1,208 +0,0 @@
1
- import { jsx as s, jsxs as M } from "react/jsx-runtime";
2
- import { forwardRef as T, useId as W, useState as K, useMemo as S, useRef as X, Children as Y, isValidElement as Z } from "react";
3
- import { c as V } from "./index-D2ZczOXr.js";
4
- import { useTranslation as ee } from "react-i18next";
5
- import { C as _, a as se } from "./checkbox-D5EHnB14.js";
6
- import { u as te } from "./registry-C9nwlNyL.js";
7
- import { C as ce } from "./circle-alert-ChA9opNA.js";
8
- const re = {
9
- id: "checkbox-group",
10
- capabilities: ["select_multiple"],
11
- state: {
12
- selection: {
13
- type: "string[]",
14
- descriptionKey: "ui.agent.checkboxGroup.state.selection",
15
- description: "Values of currently-checked options.",
16
- read: (t) => t.getSelection()
17
- }
18
- },
19
- actions: {
20
- set_selection: {
21
- safety: "write",
22
- argsType: "{ ids: string[] }",
23
- descriptionKey: "ui.agent.checkboxGroup.actions.setSelection",
24
- description: "Replace the current selection with the given option values.",
25
- invoke: (t, l) => {
26
- t.setSelection(l.ids);
27
- }
28
- },
29
- clear_selection: {
30
- safety: "destructive",
31
- descriptionKey: "ui.agent.checkboxGroup.actions.clearSelection",
32
- description: "Uncheck every option in the group.",
33
- invoke: (t) => {
34
- t.clearSelection();
35
- }
36
- }
37
- },
38
- domHooks: {
39
- root: {
40
- attr: "data-component",
41
- value: "checkbox-group",
42
- description: "Marks the CheckboxGroup fieldset."
43
- },
44
- instanceId: {
45
- attr: "data-component-id",
46
- sourceProp: "id",
47
- description: "Sourced from the id prop."
48
- },
49
- item: {
50
- attr: "data-option-id",
51
- description: "Stable opaque value emitted on each rendered Checkbox child within the group."
52
- }
53
- }
54
- }, le = V("", {
55
- variants: {
56
- orientation: {
57
- vertical: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
58
- horizontal: "ds:flex ds:flex-wrap ds:gap-x-[var(--spacing-lg)] ds:gap-y-[var(--spacing-sm)]"
59
- }
60
- },
61
- defaultVariants: { orientation: "vertical" }
62
- });
63
- function ae(t) {
64
- const l = [];
65
- return Y.forEach(t, (a) => {
66
- if (!Z(a)) return;
67
- const f = a.props;
68
- typeof f.value == "string" && l.push(f.value);
69
- }), l;
70
- }
71
- const oe = T(
72
- ({
73
- label: t,
74
- value: l,
75
- onChange: a,
76
- name: f,
77
- id: v,
78
- orientation: $ = "vertical",
79
- disabled: N = !1,
80
- min: i,
81
- max: d,
82
- onConstraintViolation: c,
83
- withSelectAll: z = !1,
84
- options: u,
85
- error: m,
86
- helperText: g,
87
- className: E,
88
- children: b
89
- }, H) => {
90
- const { t: p } = ee(), x = W(), R = `${x}-helper`, w = `${x}-error`, I = `${x}-counter`, [P, q] = K([]), k = l !== void 0, r = k ? l : P, A = S(() => new Set(r), [r]), [C, o] = K(""), y = S(
91
- () => u ? u.map((e) => e.value) : ae(b),
92
- [u, b]
93
- ), n = (e) => {
94
- k || q(e), a == null || a(e);
95
- }, j = X(r);
96
- j.current = r;
97
- const U = S(
98
- () => ({
99
- getSelection: () => j.current.slice(),
100
- setSelection: (e) => n(e),
101
- clearSelection: () => n([])
102
- }),
103
- // eslint-disable-next-line react-hooks/exhaustive-deps
104
- [k, a]
105
- );
106
- te(re, U, v);
107
- const D = {
108
- name: f,
109
- value: A,
110
- toggle: (e) => {
111
- if (A.has(e)) {
112
- if (typeof i == "number" && r.length <= i) {
113
- o(p("inputs.checkboxGroup.minReached", { min: i })), c == null || c("min");
114
- return;
115
- }
116
- o(""), n(r.filter((Q) => Q !== e));
117
- return;
118
- }
119
- if (typeof d == "number" && r.length >= d) {
120
- o(p("inputs.checkboxGroup.maxReached", { max: d })), c == null || c("max");
121
- return;
122
- }
123
- o(""), n([...r, e]);
124
- },
125
- disabled: N
126
- }, h = y.length, G = r.length, B = h === 0 || G === 0 ? !1 : G >= h ? !0 : "indeterminate", F = () => {
127
- if (B === !0) {
128
- if (typeof i == "number" && i > 0) {
129
- o(p("inputs.checkboxGroup.minReached", { min: i })), c == null || c("min");
130
- return;
131
- }
132
- n([]), o("");
133
- return;
134
- }
135
- const e = typeof d == "number" ? y.slice(0, d) : y;
136
- n(e), o("");
137
- }, J = [
138
- g ? R : null,
139
- m ? w : null,
140
- h > 0 ? I : null
141
- ].filter(Boolean).join(" ") || void 0, L = b ?? (u ? u.map((e) => /* @__PURE__ */ s(
142
- _,
143
- {
144
- value: e.value,
145
- label: e.label,
146
- disabled: e.disabled
147
- },
148
- e.value
149
- )) : null), O = [
150
- "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:min-w-0 ds:border-0 ds:p-0 ds:m-0",
151
- E
152
- ].filter(Boolean).join(" ");
153
- return /* @__PURE__ */ M(
154
- "fieldset",
155
- {
156
- ref: H,
157
- id: v,
158
- className: O,
159
- "aria-describedby": J,
160
- "aria-invalid": !!m || void 0,
161
- "data-component": "checkbox-group",
162
- "data-component-id": v,
163
- children: [
164
- /* @__PURE__ */ s("legend", { className: "type-label ds:text-foreground ds:p-0 ds:mb-[var(--spacing-sm)]", children: t }),
165
- z ? /* @__PURE__ */ s(
166
- _,
167
- {
168
- label: p("inputs.checkboxGroup.selectAll"),
169
- checked: B,
170
- onCheckedChange: F,
171
- disabled: N
172
- }
173
- ) : null,
174
- /* @__PURE__ */ s(se.Provider, { value: D, children: /* @__PURE__ */ s("div", { className: le({ orientation: $ }), children: L }) }),
175
- g ? /* @__PURE__ */ s("p", { id: R, className: "type-body-sm ds:text-muted-foreground", children: g }) : null,
176
- m ? /* @__PURE__ */ M(
177
- "p",
178
- {
179
- id: w,
180
- role: "alert",
181
- className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)] type-body-sm ds:text-destructive",
182
- children: [
183
- /* @__PURE__ */ s(ce, { "aria-hidden": "true", className: "ds:size-4 ds:shrink-0" }),
184
- /* @__PURE__ */ s("span", { children: m })
185
- ]
186
- }
187
- ) : null,
188
- /* @__PURE__ */ s(
189
- "span",
190
- {
191
- id: I,
192
- role: "status",
193
- "aria-live": "polite",
194
- className: "ds:sr-only",
195
- children: h > 0 ? p("inputs.checkboxGroup.counter", { count: G, total: h }) : ""
196
- }
197
- ),
198
- /* @__PURE__ */ s("span", { role: "status", "aria-live": "polite", className: "ds:sr-only", children: C })
199
- ]
200
- }
201
- );
202
- }
203
- );
204
- oe.displayName = "CheckboxGroup";
205
- export {
206
- oe as C
207
- };
208
- //# sourceMappingURL=checkbox-group-Qkm3Rg1S.js.map