@alfadocs/ui-kit 1.31.0 → 1.33.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 (192) hide show
  1. package/dist/_chunks/{agenda-card-pdN49pMu.js → agenda-card-DVz3jwTf.js} +2 -2
  2. package/dist/_chunks/{agenda-tray-BweO8pDo.js → agenda-tray-1oDWCJdB.js} +2 -2
  3. package/dist/_chunks/{ai-prompt-input-CrHr-5H8.js → ai-prompt-input-Dt7tpCBh.js} +2 -2
  4. package/dist/_chunks/{alia-sidebar-BWcWZivN.js → alia-sidebar-D18kp3p9.js} +3 -3
  5. package/dist/_chunks/{anamnesis-summary-rows-DMO3MWSt.js → anamnesis-summary-rows-BYgyp_i2.js} +6 -6
  6. package/dist/_chunks/{appointment-card-CvUFFEdS.js → appointment-card-D-oj_ugh.js} +2 -2
  7. package/dist/_chunks/{appointment-timeline-DsMZY7U9.js → appointment-timeline-CymGHyIP.js} +2 -2
  8. package/dist/_chunks/{appointment-tray-Z2GaOIYQ.js → appointment-tray-DCk8gHod.js} +2 -2
  9. package/dist/_chunks/{audio-recorder-DXG6LTtO.js → audio-recorder-11wClczr.js} +2 -2
  10. package/dist/_chunks/{avatar-BNQNhoyL.js → avatar-CkDeQOSI.js} +37 -37
  11. package/dist/_chunks/{balance-badge-cell-CX6b0ML4.js → balance-badge-cell-DhBtFRoW.js} +4 -4
  12. package/dist/_chunks/{bishop-score-CJUVBfAu.js → bishop-score-CAl7C5hm.js} +2 -2
  13. package/dist/_chunks/{bmi-calculator-CcH6upht.js → bmi-calculator-Dwkih9a4.js} +3 -3
  14. package/dist/_chunks/{booking-jGzRUETo.js → booking-BqkEtsKx.js} +777 -747
  15. package/dist/_chunks/{calculator-dialog-12d3Sxaz.js → calculator-dialog-C0ixc3SU.js} +2 -2
  16. package/dist/_chunks/{calendar-BNQKpxhE.js → calendar-Dgvl5L4T.js} +2 -2
  17. package/dist/_chunks/{calendar-workspace-Dy1jHBvG.js → calendar-workspace-BX-zDyVR.js} +14 -14
  18. package/dist/_chunks/{care-plan-card-CQVboTn1.js → care-plan-card-CZW476Kg.js} +2 -2
  19. package/dist/_chunks/{care-plan-entry-card-jxHkzez5.js → care-plan-entry-card-BMUYagEw.js} +2 -2
  20. package/dist/_chunks/{chat-message-DBQu10rs.js → chat-message-C-8UU2av.js} +2 -2
  21. package/dist/_chunks/{clinical-note-card-yCTR9DB6.js → clinical-note-card-D2WTV2CO.js} +2 -2
  22. package/dist/_chunks/{data-table-DB5BiVQ0.js → data-table-DC96JJIq.js} +2 -2
  23. package/dist/_chunks/{dependent-selector-cJlJFAKD.js → dependent-selector-yTKKsuc9.js} +2 -2
  24. package/dist/_chunks/{dialog-UbKJCi1X.js → dialog-BJiLqhx6.js} +54 -46
  25. package/dist/_chunks/{document-preview-CDb-n_W7.js → document-preview-BrhMHNh8.js} +2 -2
  26. package/dist/_chunks/{due-date-calculator-BtgWeFqp.js → due-date-calculator-CxgK8vzt.js} +3 -3
  27. package/dist/_chunks/{entity-summary-B_vO5Ur4.js → entity-summary-5o768XLU.js} +2 -2
  28. package/dist/_chunks/{file-manager-Cd8V9IcZ.js → file-manager-CI2Qn8qW.js} +3 -3
  29. package/dist/_chunks/{gestational-age-calculator-KdMg9z9H.js → gestational-age-calculator-CZHVrERT.js} +4 -4
  30. package/dist/_chunks/{link-cell-renderer-tWEOv3Sc.js → link-cell-renderer-BEpMNtAa.js} +3 -3
  31. package/dist/_chunks/{marketplace-app-shell-C4AjQmvz.js → marketplace-app-shell-CK_ND8Tr.js} +2 -2
  32. package/dist/_chunks/{message-card-D8GB4FdF.js → message-card-BUMv16un.js} +2 -2
  33. package/dist/_chunks/{message-tray-CGIRQjx5.js → message-tray-0zsv27xX.js} +2 -2
  34. package/dist/_chunks/{muscle-scheme-BSJsI4-I.js → muscle-scheme-UVz_x4iE.js} +2 -2
  35. package/dist/_chunks/{notes-panel-am6e-Lwh.js → notes-panel-C4G-mhZ9.js} +3 -3
  36. package/dist/_chunks/{operator-hero-BnFv-Uef.js → operator-hero-D7-iiFQ9.js} +2 -2
  37. package/dist/_chunks/{optical-prescription-BvwuqTpl.js → optical-prescription-DUJOhKz_.js} +2 -2
  38. package/dist/_chunks/{patient-details-CdfursHt.js → patient-details-BGiawUHd.js} +3 -3
  39. package/dist/_chunks/{patient-summary-card-C9WBwct-.js → patient-summary-card--CT_gbaQ.js} +2 -2
  40. package/dist/_chunks/{periodontal-diagnosis-HrFsVi-C.js → periodontal-diagnosis-lEwA8wqX.js} +3 -3
  41. package/dist/_chunks/{practice-profile-hero-YQ7h2K4o.js → practice-profile-hero-DQyDvpJL.js} +2 -2
  42. package/dist/_chunks/{practice-results-CxIsU2YO.js → practice-results-DjEzPgAK.js} +2 -2
  43. package/dist/_chunks/{pregnancy-dating-m-c05DOI.js → pregnancy-dating-n5j5dAKy.js} +4 -4
  44. package/dist/_chunks/{pregnancy-weight-gain-CJwbs9W-.js → pregnancy-weight-gain-D5A8vPjj.js} +3 -3
  45. package/dist/_chunks/qr-code-DOJs4suh.js +750 -0
  46. package/dist/_chunks/radio-DNRe6H_8.js +193 -0
  47. package/dist/_chunks/radio-group-DyVBgnA3.js +297 -0
  48. package/dist/_chunks/{radiograph-panel.agent-ByM9M3qm.js → radiograph-panel.agent-o4jwEJPC.js} +2 -2
  49. package/dist/_chunks/{rich-text-editor-VJATL1Tk.js → rich-text-editor-CQ7yZdG3.js} +2 -2
  50. package/dist/_chunks/select-CLSUnKjF.js +520 -0
  51. package/dist/_chunks/signature-request-vihDT8On.js +2232 -0
  52. package/dist/_chunks/{tabs-DqKtTIjZ.js → tabs-BnRaLT0y.js} +2 -2
  53. package/dist/_chunks/{tasks-panel-DPCNaRko.js → tasks-panel-DQuaVvl5.js} +2 -2
  54. package/dist/_chunks/{timeline-u-2t9t_M.js → timeline-Bs9Erxlo.js} +2 -2
  55. package/dist/_chunks/{tooth-scheme-C9jssOmy.js → tooth-scheme-Qe7LO5Di.js} +2 -2
  56. package/dist/_chunks/{unit-converter-C6jMjqL9.js → unit-converter-BTgU50gk.js} +2 -2
  57. package/dist/_chunks/{widget-picker-em4xGgv0.js → widget-picker-DvUkBemi.js} +2 -2
  58. package/dist/agent-catalog.json +316 -20
  59. package/dist/agent-i18n/en.json +18 -8
  60. package/dist/components/agenda-card/index.js +1 -1
  61. package/dist/components/agenda-tray/index.js +1 -1
  62. package/dist/components/ai-prompt-input/index.js +1 -1
  63. package/dist/components/appointment-card/index.js +2 -2
  64. package/dist/components/appointment-timeline/index.js +1 -1
  65. package/dist/components/audio-recorder/index.js +1 -1
  66. package/dist/components/avatar/avatar.d.ts +2 -0
  67. package/dist/components/avatar/index.js +1 -1
  68. package/dist/components/bishop-score/index.js +1 -1
  69. package/dist/components/bmi-calculator/index.js +1 -1
  70. package/dist/components/booking/index.js +1 -1
  71. package/dist/components/calculator-dialog/index.js +1 -1
  72. package/dist/components/calendar/index.js +1 -1
  73. package/dist/components/care-plan-card/index.js +1 -1
  74. package/dist/components/care-plan-entry-card/index.js +1 -1
  75. package/dist/components/chat-message/index.js +1 -1
  76. package/dist/components/clinical-note-card/index.js +1 -1
  77. package/dist/components/data-table/index.js +2 -2
  78. package/dist/components/dependent-selector/index.js +1 -1
  79. package/dist/components/dialog/dialog.d.ts +9 -0
  80. package/dist/components/dialog/index.js +1 -1
  81. package/dist/components/document-preview/index.js +1 -1
  82. package/dist/components/due-date-calculator/index.js +1 -1
  83. package/dist/components/entity-summary/index.js +1 -1
  84. package/dist/components/file-manager/index.js +1 -1
  85. package/dist/components/gestational-age-calculator/index.js +1 -1
  86. package/dist/components/message-card/index.js +1 -1
  87. package/dist/components/message-tray/index.js +1 -1
  88. package/dist/components/muscle-scheme/index.js +1 -1
  89. package/dist/components/notes-panel/index.js +1 -1
  90. package/dist/components/operator-hero/index.js +1 -1
  91. package/dist/components/optical-prescription/index.js +1 -1
  92. package/dist/components/patient-details/index.js +1 -1
  93. package/dist/components/patient-summary-card/index.js +1 -1
  94. package/dist/components/patient-table/index.js +1 -1
  95. package/dist/components/periodontal-diagnosis/index.js +1 -1
  96. package/dist/components/practice-profile-hero/index.js +1 -1
  97. package/dist/components/practice-results/index.js +1 -1
  98. package/dist/components/pregnancy-dating/index.js +1 -1
  99. package/dist/components/pregnancy-weight-gain/index.js +1 -1
  100. package/dist/components/qr-code/index.js +1 -1
  101. package/dist/components/qr-code/qr-encode.d.ts +14 -16
  102. package/dist/components/radio/index.js +1 -1
  103. package/dist/components/radio-group/index.js +2 -2
  104. package/dist/components/radio-group/radio-group-context.d.ts +4 -1
  105. package/dist/components/radio-group/radio-group.d.ts +13 -1
  106. package/dist/components/radio-group/radio.d.ts +24 -1
  107. package/dist/components/radiograph-panel/index.js +1 -1
  108. package/dist/components/rich-text-editor/index.js +1 -1
  109. package/dist/components/select/index.js +1 -1
  110. package/dist/components/select/select.d.ts +33 -0
  111. package/dist/components/skeleton-scheme/index.js +1 -1
  112. package/dist/components/tabs/index.js +1 -1
  113. package/dist/components/tasks-panel/index.js +1 -1
  114. package/dist/components/timeline/index.js +1 -1
  115. package/dist/components/tooth-scheme/index.js +1 -1
  116. package/dist/components/unit-converter/index.js +1 -1
  117. package/dist/components/widget-picker/index.js +1 -1
  118. package/dist/i18n/locales/ar.d.ts +68 -0
  119. package/dist/i18n/locales/ar.js +69 -1
  120. package/dist/i18n/locales/de.d.ts +68 -0
  121. package/dist/i18n/locales/de.js +71 -1
  122. package/dist/i18n/locales/el.d.ts +68 -0
  123. package/dist/i18n/locales/el.js +69 -1
  124. package/dist/i18n/locales/en.d.ts +68 -0
  125. package/dist/i18n/locales/en.js +69 -1
  126. package/dist/i18n/locales/es.d.ts +68 -0
  127. package/dist/i18n/locales/es.js +69 -1
  128. package/dist/i18n/locales/fr.d.ts +68 -0
  129. package/dist/i18n/locales/fr.js +69 -1
  130. package/dist/i18n/locales/hi.d.ts +68 -0
  131. package/dist/i18n/locales/hi.js +69 -1
  132. package/dist/i18n/locales/it.d.ts +68 -0
  133. package/dist/i18n/locales/it.js +69 -1
  134. package/dist/i18n/locales/ja.d.ts +68 -0
  135. package/dist/i18n/locales/ja.js +69 -1
  136. package/dist/i18n/locales/nl.d.ts +68 -0
  137. package/dist/i18n/locales/nl.js +69 -1
  138. package/dist/i18n/locales/pl.d.ts +68 -0
  139. package/dist/i18n/locales/pl.js +69 -1
  140. package/dist/i18n/locales/pt.d.ts +68 -0
  141. package/dist/i18n/locales/pt.js +69 -1
  142. package/dist/i18n/locales/ro.d.ts +68 -0
  143. package/dist/i18n/locales/ro.js +69 -1
  144. package/dist/i18n/locales/ru.d.ts +68 -0
  145. package/dist/i18n/locales/ru.js +69 -1
  146. package/dist/i18n/locales/sq.d.ts +68 -0
  147. package/dist/i18n/locales/sq.js +69 -1
  148. package/dist/i18n/locales/sv.d.ts +68 -0
  149. package/dist/i18n/locales/sv.js +69 -1
  150. package/dist/i18n/locales/tr.d.ts +68 -0
  151. package/dist/i18n/locales/tr.js +69 -1
  152. package/dist/i18n/locales/zh.d.ts +68 -0
  153. package/dist/i18n/locales/zh.js +69 -1
  154. package/dist/index.js +57 -57
  155. package/dist/locales/ar.json +69 -1
  156. package/dist/locales/de.json +69 -1
  157. package/dist/locales/el.json +69 -1
  158. package/dist/locales/en.json +69 -1
  159. package/dist/locales/es.json +69 -1
  160. package/dist/locales/fr.json +69 -1
  161. package/dist/locales/hi.json +69 -1
  162. package/dist/locales/it.json +69 -1
  163. package/dist/locales/ja.json +69 -1
  164. package/dist/locales/nl.json +69 -1
  165. package/dist/locales/pl.json +69 -1
  166. package/dist/locales/pt.json +69 -1
  167. package/dist/locales/ro.json +69 -1
  168. package/dist/locales/ru.json +69 -1
  169. package/dist/locales/sq.json +69 -1
  170. package/dist/locales/sv.json +69 -1
  171. package/dist/locales/tr.json +69 -1
  172. package/dist/locales/zh.json +69 -1
  173. package/dist/patterns/alia-assistant/index.js +1 -1
  174. package/dist/patterns/anamnesis/index.js +1 -1
  175. package/dist/patterns/calendar/index.js +1 -1
  176. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  177. package/dist/patterns/signature-request/channel-meta.d.ts +27 -0
  178. package/dist/patterns/signature-request/index.d.ts +1 -1
  179. package/dist/patterns/signature-request/index.js +1 -1
  180. package/dist/patterns/signature-request/load-status.d.ts +13 -0
  181. package/dist/patterns/signature-request/person-grid.d.ts +32 -0
  182. package/dist/patterns/signature-request/required-documents.d.ts +127 -0
  183. package/dist/patterns/signature-request/signature-history.d.ts +57 -0
  184. package/dist/patterns/signature-request/signature-outcome.d.ts +29 -0
  185. package/dist/patterns/signature-request/signature-request.d.ts +390 -26
  186. package/dist/tokens.css +1 -1
  187. package/package.json +3 -1
  188. package/dist/_chunks/qr-code-CPkEs5mG.js +0 -574
  189. package/dist/_chunks/radio-TWf9Q-mp.js +0 -108
  190. package/dist/_chunks/radio-group-rXDJADzW.js +0 -175
  191. package/dist/_chunks/select-Bi8zril7.js +0 -471
  192. package/dist/_chunks/signature-request-C-IsbkPf.js +0 -417
@@ -1,175 +0,0 @@
1
- import { jsx as e, jsxs as r, Fragment as O } from "react/jsx-runtime";
2
- import { forwardRef as Q, useId as U, useMemo as j, useRef as A, useState as W } from "react";
3
- import * as X from "@radix-ui/react-radio-group";
4
- import { c as Y } from "./index-D2ZczOXr.js";
5
- import { a as C } from "./radio-TWf9Q-mp.js";
6
- import { c as Z } from "./compose-refs-C0k0tdqF.js";
7
- import { u as E } from "./registry-DvAUVLHh.js";
8
- import { u as ee } from "./use-direction-Dp8h70PP.js";
9
- import { C as se } from "./circle-alert-rGDZ73Wh.js";
10
- const te = {
11
- id: "radio-group",
12
- capabilities: ["select_single"],
13
- state: {
14
- value: {
15
- type: "string",
16
- descriptionKey: "ui.agent.radioGroup.state.value",
17
- description: "Currently selected radio value, or empty string when none.",
18
- read: (t) => t.getValue()
19
- }
20
- },
21
- actions: {
22
- set_value: {
23
- safety: "write",
24
- argsType: "{ value: string }",
25
- descriptionKey: "ui.agent.radioGroup.actions.setValue",
26
- description: "Select the radio with the given value.",
27
- invoke: (t, s) => {
28
- t.setValue(s.value);
29
- }
30
- }
31
- },
32
- domHooks: {
33
- root: {
34
- attr: "data-component",
35
- value: "radio-group",
36
- description: "Marks the RadioGroup root."
37
- },
38
- instanceId: {
39
- attr: "data-component-id",
40
- sourceProp: "id",
41
- description: "Sourced from the id prop."
42
- },
43
- item: {
44
- attr: "data-option-id",
45
- description: "Stable opaque value emitted on each rendered Radio child."
46
- }
47
- }
48
- }, oe = Y("ds:flex", {
49
- variants: {
50
- variant: {
51
- vertical: "ds:flex-col ds:gap-[var(--spacing-sm)]",
52
- horizontal: "ds:flex-row ds:flex-wrap ds:gap-[var(--spacing-md)]",
53
- card: "ds:flex-col ds:gap-[var(--spacing-md)]"
54
- }
55
- },
56
- defaultVariants: {
57
- variant: "vertical"
58
- }
59
- }), re = Q(
60
- ({
61
- children: t,
62
- variant: s = "vertical",
63
- label: c,
64
- labelStart: a,
65
- labelEnd: i,
66
- description: p,
67
- error: d,
68
- required: u,
69
- disabled: P,
70
- className: H,
71
- id: m,
72
- value: f,
73
- defaultValue: g,
74
- onValueChange: n,
75
- ...K
76
- }, M) => {
77
- const v = U(), h = `${v}-legend`, x = `${v}-description`, y = `${v}-error`, S = [p ? x : null, d ? y : null].filter(Boolean).join(" ") || void 0, T = c ? h : void 0, _ = s === "horizontal" ? "horizontal" : "vertical", R = j(
78
- () => ({ variant: s }),
79
- [s]
80
- ), N = p ? /* @__PURE__ */ e("p", { id: x, className: "type-body-sm ds:text-muted-foreground", children: p }) : null, G = d ? /* @__PURE__ */ r(
81
- "p",
82
- {
83
- id: y,
84
- role: "alert",
85
- className: "ds:inline-flex ds:items-start ds:gap-[var(--spacing-xs)] type-body-sm ds:text-destructive",
86
- children: [
87
- /* @__PURE__ */ e(se, { "aria-hidden": "true", className: "ds:size-4 ds:shrink-0" }),
88
- /* @__PURE__ */ e("span", { children: d })
89
- ]
90
- }
91
- ) : null, V = A(null), D = Z(M, V), F = ee(V), o = f !== void 0, [L, q] = W(
92
- g ?? ""
93
- ), w = o ? f ?? "" : L, I = A(w);
94
- I.current = w;
95
- const b = (l) => {
96
- o || q(l), n == null || n(l);
97
- }, J = j(
98
- () => ({
99
- getValue: () => I.current,
100
- setValue: (l) => b(l)
101
- }),
102
- // eslint-disable-next-line react-hooks/exhaustive-deps
103
- [o, n]
104
- );
105
- E(te, J, m);
106
- const k = /* @__PURE__ */ e(
107
- X.Root,
108
- {
109
- ref: D,
110
- id: m,
111
- orientation: _,
112
- dir: F,
113
- disabled: P,
114
- required: u,
115
- value: o ? f : void 0,
116
- defaultValue: o ? void 0 : g,
117
- onValueChange: b,
118
- "aria-labelledby": T,
119
- "aria-describedby": S,
120
- "aria-invalid": !!d || void 0,
121
- "aria-required": u || void 0,
122
- className: oe({ variant: s, className: H }),
123
- "data-component": "radio-group",
124
- "data-component-id": m,
125
- ...K,
126
- children: t
127
- }
128
- ), B = "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)] ds:min-w-0", z = !!(a || i), $ = /* @__PURE__ */ r(O, { children: [
129
- c,
130
- u ? /* @__PURE__ */ e(
131
- "span",
132
- {
133
- "aria-hidden": "true",
134
- className: "ds:text-destructive ds:ms-[var(--spacing-xs)]",
135
- children: "*"
136
- }
137
- ) : null
138
- ] });
139
- return c ? /* @__PURE__ */ e(C.Provider, { value: R, children: /* @__PURE__ */ r(
140
- "fieldset",
141
- {
142
- role: "presentation",
143
- className: `${B} ds:border-0 ds:p-0 ds:m-0`,
144
- children: [
145
- /* @__PURE__ */ e(
146
- "legend",
147
- {
148
- id: h,
149
- className: z ? "type-label ds:text-foreground ds:p-0 ds:w-full" : "type-label ds:text-foreground ds:p-0",
150
- children: z ? /* @__PURE__ */ r("span", { className: "ds:flex ds:items-start ds:gap-[var(--spacing-xs)]", children: [
151
- a ? /* @__PURE__ */ e("span", { className: "ds:inline-flex ds:shrink-0 ds:items-center", children: a }) : null,
152
- a ? " " : null,
153
- /* @__PURE__ */ e("span", { children: $ }),
154
- i ? " " : null,
155
- i ? /* @__PURE__ */ e("span", { className: "ds:ms-auto ds:inline-flex ds:shrink-0 ds:items-center", children: i }) : null
156
- ] }) : $
157
- }
158
- ),
159
- N,
160
- k,
161
- G
162
- ]
163
- }
164
- ) }) : /* @__PURE__ */ e(C.Provider, { value: R, children: /* @__PURE__ */ r("div", { className: B, children: [
165
- N,
166
- k,
167
- G
168
- ] }) });
169
- }
170
- );
171
- re.displayName = "RadioGroup";
172
- export {
173
- re as R
174
- };
175
- //# sourceMappingURL=radio-group-rXDJADzW.js.map
@@ -1,471 +0,0 @@
1
- import { jsx as t, jsxs as f } from "react/jsx-runtime";
2
- import { forwardRef as i, useContext as fe, useState as q, useRef as L, useMemo as ge } from "react";
3
- import { u as he } from "./registry-DvAUVLHh.js";
4
- import * as o from "@radix-ui/react-select";
5
- import { c as j } from "./index-D2ZczOXr.js";
6
- import { useTranslation as ve } from "react-i18next";
7
- import { u as be, F as ye } from "./form-field-context-B3APVHKx.js";
8
- import { g as Se } from "./group-options-BvKhQ3xb.js";
9
- import { C as xe } from "./chevron-up-umRGgtJA.js";
10
- import { C as $ } from "./chevron-down-DWE7GSq9.js";
11
- import { C as Ne } from "./check-DrFSN__t.js";
12
- import { u as we } from "./use-direction-Dp8h70PP.js";
13
- import { X as Ce } from "./x-B5YnXwCz.js";
14
- const ze = {
15
- id: "select",
16
- // Persisted single choice (value state + set_value) → select_single + set_value,
17
- // plus open/close of the option list.
18
- capabilities: ["select_single", "set_value", "open", "close"],
19
- state: {
20
- value: {
21
- type: "string",
22
- descriptionKey: "ui.agent.select.state.value",
23
- description: "Currently selected option value, or empty string when none.",
24
- read: (e) => e.getValue()
25
- },
26
- isOpen: {
27
- type: "boolean",
28
- descriptionKey: "ui.agent.select.state.isOpen",
29
- description: "Whether the option list is open.",
30
- read: (e) => e.isOpen()
31
- }
32
- },
33
- actions: {
34
- set_value: {
35
- // Persists the chosen option — reversible by selecting another value.
36
- safety: "write",
37
- argsType: "{ value: string }",
38
- argsSchema: {
39
- type: "object",
40
- properties: {
41
- value: { type: "string", description: "Option value to select." }
42
- },
43
- required: ["value"]
44
- },
45
- idempotent: !0,
46
- descriptionKey: "ui.agent.select.actions.setValue",
47
- description: "Select the option with the given value.",
48
- examples: [{ args: { value: "it" }, note: 'Select the "it" option.' }],
49
- invoke: (e, s) => {
50
- e.setValue(s.value);
51
- }
52
- },
53
- clear: {
54
- // Discards the persisted choice — destructive (loses the selection).
55
- safety: "destructive",
56
- idempotent: !0,
57
- descriptionKey: "ui.agent.select.actions.clear",
58
- description: "Clear the current selection.",
59
- invoke: (e) => {
60
- e.clear();
61
- }
62
- },
63
- open: {
64
- safety: "read",
65
- idempotent: !0,
66
- descriptionKey: "ui.agent.select.actions.open",
67
- description: "Open the option list.",
68
- invoke: (e) => {
69
- e.open();
70
- }
71
- },
72
- close: {
73
- safety: "read",
74
- idempotent: !0,
75
- descriptionKey: "ui.agent.select.actions.close",
76
- description: "Close the option list.",
77
- invoke: (e) => {
78
- e.close();
79
- }
80
- }
81
- },
82
- domHooks: {
83
- root: {
84
- attr: "data-component",
85
- value: "select",
86
- description: "Marks the Select trigger."
87
- },
88
- instanceId: {
89
- attr: "data-component-id",
90
- sourceProp: "id",
91
- description: "Sourced from the id prop."
92
- },
93
- item: {
94
- attr: "data-option-id",
95
- description: "Stable opaque option value emitted on each rendered option."
96
- }
97
- }
98
- }, A = j(
99
- [
100
- "ds:group ds:inline-flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)] ds:w-full",
101
- "ds:rounded-[var(--radius-sm)] ds:border ds:border-border ds:bg-input",
102
- "ds:shadow-[var(--shadow-input)]",
103
- "ds:text-foreground ds:placeholder:text-muted-foreground",
104
- "ds:data-[placeholder]:text-muted-foreground",
105
- "ds:transition-[colors,box-shadow] ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
106
- "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
107
- "ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
108
- "ds:forced-colors:focus-visible:outline-[CanvasText]",
109
- "ds:disabled:cursor-not-allowed ds:disabled:opacity-50"
110
- ].join(" "),
111
- {
112
- variants: {
113
- size: {
114
- sm: "ds:h-8 ds:ps-3 ds:pe-3 ds:text-[length:var(--font-size-sm)]",
115
- md: "ds:h-[var(--min-target-size)] ds:ps-3 ds:pe-3 ds:text-[length:var(--font-size-base)]",
116
- lg: "ds:h-12 ds:ps-4 ds:pe-4 ds:text-[length:var(--font-size-lg)]"
117
- },
118
- tone: {
119
- default: "",
120
- error: "ds:border-destructive ds:focus-visible:outline-destructive"
121
- }
122
- },
123
- defaultVariants: {
124
- size: "md",
125
- tone: "default"
126
- }
127
- }
128
- ), Ie = j(
129
- [
130
- "ds:z-[var(--z-dropdown)] ds:overflow-hidden",
131
- "ds:rounded-[var(--radius-md)] ds:border ds:border-border ds:bg-background ds:text-foreground",
132
- "ds:shadow-[var(--shadow-lg)]",
133
- "ds:animate-in ds:fade-in ds:zoom-in-95",
134
- "ds:data-[state=closed]:animate-out ds:data-[state=closed]:fade-out",
135
- "ds:data-[state=closed]:zoom-out-95",
136
- "ds:data-[side=bottom]:slide-in-from-top-2",
137
- "ds:data-[side=top]:slide-in-from-bottom-2",
138
- "ds:motion-reduce:animate-none"
139
- ].join(" ")
140
- ), je = j(
141
- [
142
- "ds:relative ds:flex ds:cursor-pointer ds:items-center",
143
- "ds:rounded-[var(--radius-sm)]",
144
- "ds:text-foreground ds:outline-none ds:select-none",
145
- "ds:data-[highlighted]:bg-muted ds:data-[highlighted]:text-foreground",
146
- "ds:data-[disabled]:pointer-events-none ds:data-[disabled]:opacity-50"
147
- ].join(" "),
148
- {
149
- variants: {
150
- size: {
151
- sm: "ds:min-h-8 ds:ps-8 ds:pe-3 ds:text-[length:var(--font-size-sm)]",
152
- md: "ds:min-h-[var(--min-target-size)] ds:ps-8 ds:pe-3 ds:text-[length:var(--font-size-base)]",
153
- lg: "ds:min-h-12 ds:ps-10 ds:pe-4 ds:text-[length:var(--font-size-lg)]"
154
- }
155
- },
156
- defaultVariants: {
157
- size: "md"
158
- }
159
- }
160
- ), ke = [
161
- "ds:ps-8 ds:pe-3 ds:py-1.5",
162
- "type-eyebrow ds:text-muted-foreground",
163
- "ds:sticky ds:top-0 ds:bg-background"
164
- ].join(" "), Ve = {
165
- sm: "ds:size-3.5",
166
- md: "ds:size-4",
167
- lg: "ds:size-5"
168
- }, Te = {
169
- sm: "ds:start-2",
170
- md: "ds:start-2",
171
- lg: "ds:start-3"
172
- };
173
- function Re(...e) {
174
- return (s) => {
175
- for (const n of e)
176
- n && (typeof n == "function" ? n(s) : n.current = s);
177
- };
178
- }
179
- const _ = (e) => /* @__PURE__ */ t(o.Root, { ...e });
180
- _.displayName = "Select.Root";
181
- const H = i(
182
- ({ size: e, tone: s, className: n, children: r, ...l }, c) => /* @__PURE__ */ t(
183
- o.Trigger,
184
- {
185
- ref: c,
186
- className: A({ size: e, tone: s, className: n }),
187
- ...l,
188
- children: r
189
- }
190
- )
191
- );
192
- H.displayName = "Select.Trigger";
193
- const M = i((e, s) => /* @__PURE__ */ t(o.Value, { ref: s, ...e }));
194
- M.displayName = "Select.Value";
195
- const k = i(
196
- ({
197
- className: e,
198
- children: s,
199
- position: n = "popper",
200
- sideOffset: r = 4,
201
- container: l,
202
- ...c
203
- }, h) => /* @__PURE__ */ t(o.Portal, { container: l ?? void 0, children: /* @__PURE__ */ f(
204
- o.Content,
205
- {
206
- ref: h,
207
- position: n,
208
- sideOffset: r,
209
- "data-component": "select-content",
210
- className: Ie({ className: e }),
211
- ...c,
212
- children: [
213
- /* @__PURE__ */ t(o.ScrollUpButton, { className: "ds:flex ds:items-center ds:justify-center ds:h-6 ds:bg-background ds:cursor-default", children: /* @__PURE__ */ t(xe, { "aria-hidden": "true", className: "ds:size-4" }) }),
214
- s,
215
- /* @__PURE__ */ t(o.ScrollDownButton, { className: "ds:flex ds:items-center ds:justify-center ds:h-6 ds:bg-background ds:cursor-default", children: /* @__PURE__ */ t($, { "aria-hidden": "true", className: "ds:size-4" }) })
216
- ]
217
- }
218
- ) })
219
- );
220
- k.displayName = "Select.Content";
221
- const V = i(({ className: e, ...s }, n) => /* @__PURE__ */ t(
222
- o.Viewport,
223
- {
224
- ref: n,
225
- className: ["ds:p-1", e].filter(Boolean).join(" "),
226
- ...s
227
- }
228
- ));
229
- V.displayName = "Select.Viewport";
230
- const T = i(
231
- ({ size: e = "md", className: s, children: n, startAdornment: r, endContent: l, ...c }, h) => {
232
- const S = Te[e ?? "md"], x = Ve[e ?? "md"];
233
- return /* @__PURE__ */ f(
234
- o.Item,
235
- {
236
- ref: h,
237
- className: je({ size: e, className: s }),
238
- ...c,
239
- children: [
240
- /* @__PURE__ */ t(
241
- "span",
242
- {
243
- className: `ds:absolute ${S} ds:inline-flex ds:items-center ds:justify-center`,
244
- "aria-hidden": "true",
245
- children: /* @__PURE__ */ t(o.ItemIndicator, { children: /* @__PURE__ */ t(Ne, { className: x }) })
246
- }
247
- ),
248
- r ? (
249
- // Decorative by contract — accessible name comes from the item text.
250
- /* @__PURE__ */ t(
251
- "span",
252
- {
253
- "aria-hidden": "true",
254
- className: "ds:inline-flex ds:items-center ds:shrink-0 ds:me-[var(--spacing-xs)]",
255
- children: r
256
- }
257
- )
258
- ) : null,
259
- l ? (
260
- // Radix points the item's `aria-labelledby` at `ItemText`, so
261
- // anything rendered outside it is dropped from the accessible
262
- // name — a price there would be visible but never announced.
263
- // It therefore goes INSIDE `ItemText`, wrapped in a flex row so
264
- // `ms-auto` still pins it to the inline-end (and flips in RTL).
265
- //
266
- // The trade-off is deliberate: Radix mirrors `ItemText` into the
267
- // closed trigger, so the selected item's trailing content shows
268
- // there too. For the case this exists for — a price — that reads
269
- // as a feature, not a leak. The wrapper is rendered ONLY when
270
- // `endContent` is supplied, so every existing item keeps its
271
- // previous DOM exactly.
272
- //
273
- // `asChild` is required, not stylistic. `SelectItemText`
274
- // destructures `className` and `style` off its props and never
275
- // applies them, so styling it directly is silently discarded.
276
- // It must also GROW: as a plain flex item of the row it sizes to
277
- // its content, leaving `ms-auto` no free space to absorb, and the
278
- // chip would sit against the label instead of the row's end —
279
- // the ragged column this change exists to remove. `asChild` makes
280
- // our own span become the ItemText element, so `flex-1` lands.
281
- /* @__PURE__ */ t(o.ItemText, { asChild: !0, children: /* @__PURE__ */ f("span", { className: "ds:flex ds:flex-1 ds:min-w-0 ds:items-center ds:gap-[var(--spacing-sm)]", children: [
282
- /* @__PURE__ */ t("span", { className: "ds:min-w-0 ds:truncate", children: n }),
283
- /* @__PURE__ */ t("span", { className: "ds:inline-flex ds:items-center ds:ms-auto ds:shrink-0", children: l })
284
- ] }) })
285
- ) : /* @__PURE__ */ t(o.ItemText, { children: n })
286
- ]
287
- }
288
- );
289
- }
290
- );
291
- T.displayName = "Select.Item";
292
- const U = i((e, s) => /* @__PURE__ */ t(o.ItemText, { ref: s, ...e }));
293
- U.displayName = "Select.ItemText";
294
- const W = i((e, s) => /* @__PURE__ */ t(o.Group, { ref: s, ...e }));
295
- W.displayName = "Select.Group";
296
- const R = i(({ className: e, ...s }, n) => /* @__PURE__ */ t(
297
- o.Label,
298
- {
299
- ref: n,
300
- className: [ke, e].filter(Boolean).join(" "),
301
- ...s
302
- }
303
- ));
304
- R.displayName = "Select.Label";
305
- const E = i(({ className: e, ...s }, n) => /* @__PURE__ */ t(
306
- o.Separator,
307
- {
308
- ref: n,
309
- className: ["ds:my-1 ds:h-px ds:bg-border", e].filter(Boolean).join(" "),
310
- ...s
311
- }
312
- ));
313
- E.displayName = "Select.Separator";
314
- const X = i(function({
315
- options: s,
316
- value: n,
317
- defaultValue: r,
318
- onValueChange: l,
319
- placeholder: c,
320
- clearable: h = !1,
321
- disabled: S,
322
- required: x,
323
- name: J,
324
- id: N,
325
- size: B = "md",
326
- tone: Q = "default",
327
- className: Y,
328
- container: Z,
329
- "aria-label": O
330
- }, ee) {
331
- const { t: w } = ve(), u = be(), p = fe(ye) !== null, [te, b] = q(
332
- n ?? r ?? ""
333
- ), g = n !== void 0, v = g ? n : te, [C, z] = q(!1), D = L(v);
334
- D.current = v;
335
- const se = N ?? (p ? u.id : void 0), F = (p ? u.disabled : !1) || !!S, oe = (p ? u.required : !1) || !!x, K = p ? u.invalid : !1, ne = K ? "error" : Q, de = p && u.describedBy ? u.describedBy : void 0, I = L(null), ae = Re(ee, I), ie = we(I), a = l, re = (d) => {
336
- g || b(d), a == null || a(d);
337
- }, le = (d) => {
338
- var y;
339
- d.preventDefault(), d.stopPropagation(), g || b(""), a == null || a(""), (y = I.current) == null || y.focus();
340
- }, P = c ?? w("inputs.select.placeholder", "Select…"), ce = h && !!v && !F, ue = Se(s), pe = ge(
341
- () => ({
342
- getValue: () => D.current,
343
- setValue: (d) => {
344
- g || b(d), a == null || a(d);
345
- },
346
- clear: () => {
347
- g || b(""), a == null || a("");
348
- },
349
- open: () => z(!0),
350
- close: () => z(!1),
351
- isOpen: () => C
352
- }),
353
- [a, g, C]
354
- );
355
- return he(ze, pe, N), /* @__PURE__ */ f(
356
- o.Root,
357
- {
358
- value: v === "" ? void 0 : v,
359
- onValueChange: re,
360
- open: C,
361
- onOpenChange: z,
362
- disabled: F,
363
- required: oe,
364
- name: J,
365
- dir: ie,
366
- children: [
367
- /* @__PURE__ */ f(
368
- o.Trigger,
369
- {
370
- ref: ae,
371
- id: se,
372
- "aria-label": O ?? (p ? void 0 : P),
373
- "aria-labelledby": !O && p ? `${u.id}-label` : void 0,
374
- "aria-describedby": de,
375
- "aria-invalid": K || void 0,
376
- "data-component": "select",
377
- "data-component-id": N,
378
- className: A({
379
- size: B,
380
- tone: ne,
381
- className: Y
382
- }),
383
- children: [
384
- /* @__PURE__ */ t("span", { className: "ds:min-w-0 ds:truncate ds:text-start", children: /* @__PURE__ */ t(o.Value, { placeholder: P }) }),
385
- /* @__PURE__ */ f("span", { className: "ds:ms-auto ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]", children: [
386
- ce ? /* @__PURE__ */ t(
387
- "button",
388
- {
389
- type: "button",
390
- "aria-label": w("inputs.select.clear", "Clear selection"),
391
- onClick: le,
392
- onPointerDown: (d) => d.stopPropagation(),
393
- onKeyDown: (d) => {
394
- (d.key === "Enter" || d.key === " ") && d.stopPropagation();
395
- },
396
- className: [
397
- "ds:inline-flex ds:items-center ds:justify-center ds:rounded-[var(--radius-sm)]",
398
- "ds:text-muted-foreground ds:hover:text-foreground",
399
- "ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
400
- "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
401
- "ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
402
- "ds:size-4"
403
- ].join(" "),
404
- children: /* @__PURE__ */ t(Ce, { "aria-hidden": "true", className: "ds:size-3.5" })
405
- }
406
- ) : null,
407
- /* @__PURE__ */ t(o.Icon, { asChild: !0, children: /* @__PURE__ */ t(
408
- $,
409
- {
410
- "aria-hidden": "true",
411
- className: [
412
- "ds:size-4 ds:shrink-0 ds:text-muted-foreground",
413
- "ds:transition-transform ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
414
- "ds:group-data-[state=open]:rotate-180"
415
- ].join(" ")
416
- }
417
- ) })
418
- ] })
419
- ]
420
- }
421
- ),
422
- /* @__PURE__ */ t(k, { container: Z, children: /* @__PURE__ */ t(V, { children: s.length === 0 ? /* @__PURE__ */ t("div", { className: "ds:ps-8 ds:pe-3 ds:py-2 type-body-sm ds:text-muted-foreground", children: w("inputs.select.noOptions", "No options") }) : ue.map(({ group: d, items: y }, me) => {
423
- const G = y.map((m) => /* @__PURE__ */ t(
424
- T,
425
- {
426
- value: m.value,
427
- disabled: m.disabled,
428
- size: B,
429
- "data-option-id": m.value,
430
- startAdornment: m.startAdornment,
431
- endContent: m.endContent,
432
- children: m.label
433
- },
434
- m.value
435
- ));
436
- return d ? /* @__PURE__ */ f(o.Group, { children: [
437
- /* @__PURE__ */ t(R, { children: d }),
438
- G
439
- ] }, `group-${d}`) : /* @__PURE__ */ t(o.Group, { children: G }, `group-${me}`);
440
- }) }) })
441
- ]
442
- }
443
- );
444
- });
445
- X.displayName = "Select";
446
- const Be = Object.assign(X, {
447
- Root: _,
448
- Trigger: H,
449
- Value: M,
450
- Content: k,
451
- Viewport: V,
452
- Item: T,
453
- ItemText: U,
454
- Group: W,
455
- Label: R,
456
- Separator: E
457
- }), Me = Be;
458
- export {
459
- Me as S,
460
- k as a,
461
- W as b,
462
- T as c,
463
- U as d,
464
- R as e,
465
- _ as f,
466
- E as g,
467
- H as h,
468
- M as i,
469
- V as j
470
- };
471
- //# sourceMappingURL=select-Bi8zril7.js.map