@revolist/ui 4.0.4-rc → 4.0.6-rc

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 (240) hide show
  1. package/MIGRATION.md +36 -0
  2. package/OWNERSHIP.md +10 -10
  3. package/README.md +22 -4
  4. package/_chunks/arrow-up-Cw8hW9vp.js +4 -0
  5. package/_chunks/badge.view-D30pMUfi.js +14 -0
  6. package/_chunks/calculator-CDWOuAcp.js +4 -0
  7. package/_chunks/{calendar-xpZ0v3xf.js → calendar-QWDyYzdo.js} +19 -19
  8. package/_chunks/chart-frame-hcOlnQ1K.js +145 -0
  9. package/_chunks/check-BwI7iCAm.js +4 -0
  10. package/_chunks/choice-chips-A6WR-WJe.js +126 -0
  11. package/_chunks/{color-palette-D8vyPfld.js → color-palette-DMJUChWC.js} +20 -22
  12. package/_chunks/color-picker-BK4W1nd6.js +143 -0
  13. package/_chunks/{component-C_T2VN5u.js → component-CMkF17YZ.js} +281 -265
  14. package/_chunks/{component-metadata-BMOOmqx5.js → component-metadata-BKd7U8OW.js} +0 -8
  15. package/_chunks/configurator-actions-By8WSL2m.js +155 -0
  16. package/_chunks/configurator-field-icon-CmcM_sPs.js +53 -0
  17. package/_chunks/{control-AHKXD5Eu.js → control-mlH7l0Uq.js} +42 -17
  18. package/_chunks/{controls-DsNi8V8I.js → controls-FUU-MUKC.js} +171 -186
  19. package/_chunks/{date-control-DrVFX13g.js → date-control-Dup_P3w5.js} +1 -1
  20. package/_chunks/{date-time-qIhp5vaX.js → date-time-9z6pAG5T.js} +317 -278
  21. package/_chunks/dialog.parts-Bi7YbXqS.js +131 -0
  22. package/_chunks/{duration-CL68Em0o.js → duration-D7oRjsmP.js} +5 -5
  23. package/_chunks/editor-popup-ByU7qiub.js +82 -0
  24. package/_chunks/field-configurator-BCINdXpU.js +223 -0
  25. package/_chunks/{framework-mount--RTLIqE-.js → framework-mount-Bk4O_T7T.js} +1 -1
  26. package/_chunks/icon-toolbar-DSjOdwM7.js +134 -0
  27. package/_chunks/magnifying-glass-CvrTDSkB.js +4 -0
  28. package/_chunks/minus-BOAR3A1C.js +4 -0
  29. package/_chunks/mount-Cw2zk58T.js +266 -0
  30. package/_chunks/{native.view-ByyZ1CT5.js → native-Blr3byjO.js} +1 -1
  31. package/_chunks/native-control-pFMuHf3G.js +644 -0
  32. package/_chunks/{number-input-BKwA5FnM.js → number-input-DqXV6vgP.js} +7 -7
  33. package/_chunks/{picker-h1P5RUgp.js → picker-gEGTu1Ki.js} +2 -2
  34. package/_chunks/plus-CbGRkIGl.js +4 -0
  35. package/_chunks/popover-controller-D-AvKQ7B.js +102 -0
  36. package/_chunks/{popup-CT2uD3go.js → popup-C35Isk7p.js} +115 -104
  37. package/_chunks/{rating-choice-DZgmaic0.js → rating-choice-DbxdUJr-.js} +1 -1
  38. package/_chunks/{reorder-list-CSlqAGHw.js → reorder-list-B0_13Sja.js} +1 -1
  39. package/_chunks/request-trail-CCSK6TJA.js +753 -0
  40. package/_chunks/rich-text-5rnc8lpI.js +842 -0
  41. package/_chunks/rotate-left-BF6G883o.js +4 -0
  42. package/_chunks/title-tooltip-Cw6LOZhb.js +11 -0
  43. package/_chunks/tooltip-D4xkio5G.js +54 -0
  44. package/_chunks/tooltip-owner-DjdvqKzz.js +19 -0
  45. package/_chunks/tooltip-session-B6X6x8G_.js +110 -0
  46. package/_chunks/tooltip-text-BXsUEmBH.js +12 -0
  47. package/_chunks/top-layer-popup-CNSDdfJV.js +59 -0
  48. package/_variables.scss +33 -32
  49. package/ai/_chat.scss +28 -3
  50. package/ai/_style.scss +55 -2
  51. package/ai/chat.d.ts +3 -1
  52. package/ai/components.d.ts +13 -2
  53. package/ai/index.d.ts +1 -0
  54. package/ai/index.js +3 -3
  55. package/ai/mount.d.ts +17 -1
  56. package/ai/results/_style.scss +83 -0
  57. package/ai/results/index.d.ts +11 -0
  58. package/ai/results/metrics.d.ts +5 -0
  59. package/ai/results/table.d.ts +5 -0
  60. package/ai/results/text.d.ts +5 -0
  61. package/ai/results/types.d.ts +29 -0
  62. package/ai/transcript.d.ts +2 -0
  63. package/ai/translations.d.ts +1 -1
  64. package/assignee/assignee.scss +5 -1
  65. package/assignee/index.js +2 -2
  66. package/avatar/index.d.ts +25 -2
  67. package/avatar/index.js +33 -32
  68. package/badge.view.d.ts +8 -0
  69. package/brush-range/component.d.ts +1 -3
  70. package/brush-range/component.js +27 -27
  71. package/buttons/remove-button.d.ts +1 -1
  72. package/buttons/remove-button.style.scss +1 -1
  73. package/buttons/svg-button.d.ts +1 -1
  74. package/buttons/svg-button.js +16 -16
  75. package/calendar/_calendar.scss +2 -2
  76. package/calendar/calendar.js +1 -1
  77. package/calendar/index.js +2 -2
  78. package/checkbox/checkbox.scss +1 -22
  79. package/choice-chips/index.d.ts +3 -1
  80. package/choice-chips/index.js +1 -1
  81. package/color-palette/color-palette.js +1 -1
  82. package/color-palette/color-palette.style.scss +1 -1
  83. package/color-palette/color-picker.js +2 -2
  84. package/color-palette/common-palettes.d.ts +1 -1
  85. package/color-palette/common-palettes.js +1 -1
  86. package/color-palette/native.d.ts +15 -2
  87. package/component-catalog.d.ts +9 -7
  88. package/configurator-actions.d.ts +67 -0
  89. package/configurator-actions.js +1 -0
  90. package/configurator-aggregation-list.d.ts +14 -0
  91. package/configurator-aggregation-list.js +61 -0
  92. package/configurator-drop-zone.d.ts +38 -0
  93. package/configurator-drop-zone.js +64 -0
  94. package/configurator-field-icon.d.ts +10 -0
  95. package/configurator-field-icon.js +1 -0
  96. package/configurator-focus.d.ts +4 -0
  97. package/configurator-focus.js +39 -0
  98. package/configurator-sections.d.ts +42 -0
  99. package/configurator-sections.js +71 -0
  100. package/control-presentation.d.ts +8 -2
  101. package/control-presentation.js +25 -20
  102. package/controls.d.ts +1 -2
  103. package/controls.js +4 -3
  104. package/core/editor-popup-position.d.ts +6 -2
  105. package/core/editor-popup.d.ts +4 -0
  106. package/core/editor-popup.js +1 -1
  107. package/core/popover-controller.d.ts +35 -0
  108. package/core/popup-ownership.d.ts +2 -0
  109. package/core/title-tooltip.d.ts +2 -0
  110. package/core/tooltip-session.d.ts +29 -0
  111. package/core/tooltip-surface.d.ts +13 -0
  112. package/core/tooltip-text.d.ts +6 -0
  113. package/core/tooltip.d.ts +35 -0
  114. package/core/top-layer-popup.d.ts +4 -0
  115. package/core/top-layer-popup.js +1 -23
  116. package/date-time/attach.d.ts +1 -1
  117. package/date-time/field.d.ts +3 -2
  118. package/date-time/index.js +1 -1
  119. package/date-time/style.scss +64 -7
  120. package/date-time/time-selection.d.ts +3 -1
  121. package/date-time/types.d.ts +5 -1
  122. package/dialog/dialog-action-footer.d.ts +17 -2
  123. package/dialog/dialog.dom.d.ts +15 -2
  124. package/dialog/dialog.dom.js +9 -9
  125. package/dialog/dialog.parts.d.ts +1 -1
  126. package/dialog/dialog.parts.js +1 -1
  127. package/distribution-chart/_distribution-chart.scss +12 -54
  128. package/distribution-chart/area-chart.js +1 -1
  129. package/distribution-chart/bar-chart.js +1 -1
  130. package/distribution-chart/index.d.ts +1 -1
  131. package/distribution-chart/line-chart.js +1 -1
  132. package/dropdown/content.js +1 -1
  133. package/dropdown/control.js +1 -1
  134. package/dropdown/editor-dropdown.style.scss +5 -0
  135. package/dropdown/index.js +2 -2
  136. package/dropdown/lookup-field.d.ts +5 -0
  137. package/dropdown/lookup-field.js +2 -1
  138. package/dropdown/popup.d.ts +2 -2
  139. package/dropdown/popup.js +1 -1
  140. package/duration/index.js +1 -1
  141. package/editor-actions.js +1 -1
  142. package/field-configurator.d.ts +27 -0
  143. package/field-configurator.js +4 -170
  144. package/field-expansion.d.ts +9 -0
  145. package/filter/filters/slider/_slider.scss +8 -25
  146. package/filter/filters/slider/control.js +2 -0
  147. package/filter/filters/slider/runtime.js +49 -22
  148. package/filter/filters/slider/single.js +1 -1
  149. package/filter-badge.js +1 -1
  150. package/filter-controls.d.ts +0 -1
  151. package/filter-controls.js +5 -6
  152. package/form-controls/index.d.ts +10 -2
  153. package/form-controls/index.js +7 -7
  154. package/form-controls/presentation.js +12 -12
  155. package/formatting/index.d.ts +1 -1
  156. package/formatting/index.js +22 -21
  157. package/formatting/styles.scss +2 -47
  158. package/framework.js +226 -222
  159. package/history-controls.js +27 -1
  160. package/icon-toolbar.d.ts +62 -0
  161. package/icon-toolbar.js +1 -0
  162. package/masked-input/index.js +1 -1
  163. package/native-control.d.ts +1 -2
  164. package/native-control.js +1 -1
  165. package/native-controls.d.ts +54 -2
  166. package/native-styles.css +1 -1
  167. package/native.js +46 -43
  168. package/number-input/index.js +1 -1
  169. package/package.json +36 -1
  170. package/pagination.js +11 -11
  171. package/pdf-viewer/index.js +1 -1
  172. package/pickers.d.ts +5 -1
  173. package/preact-mount.js +1 -1
  174. package/preact.d.ts +8 -6
  175. package/preact.js +71 -64
  176. package/rating-choice.js +1 -1
  177. package/react-control.d.ts +2 -0
  178. package/react-control.js +2 -2
  179. package/react.d.ts +5 -6
  180. package/react.js +68 -66
  181. package/reorder-list.js +1 -1
  182. package/resource-picker/resource-picker-popup.js +1 -1
  183. package/resource-picker/resource-picker.js +4 -4
  184. package/rich-text/engine.d.ts +1 -0
  185. package/rich-text/format-html.d.ts +2 -0
  186. package/rich-text/index.d.ts +4 -0
  187. package/rich-text/index.js +1 -1
  188. package/rich-text/model.d.ts +2 -0
  189. package/rich-text/style.scss +165 -70
  190. package/rich-text/syntax.d.ts +5 -0
  191. package/rich-text/translations.d.ts +2 -0
  192. package/search-input/index.js +1 -1
  193. package/search-input/native.d.ts +21 -2
  194. package/select.d.ts +3 -1
  195. package/select.js +1 -1
  196. package/status-feedback/exit-snapshot.js +4 -4
  197. package/status-feedback/popover.js +4 -4
  198. package/styles/_alert.scss +18 -4
  199. package/styles/_compositions.scss +3 -3
  200. package/styles/_editor-slider.scss +0 -2
  201. package/styles/_field-configurator.scss +147 -0
  202. package/styles/_fields-grid.scss +37 -0
  203. package/styles/_palette.scss +0 -24
  204. package/styles/_primitives.scss +28 -19
  205. package/styles/configurator-actions.scss +141 -0
  206. package/styles/{legacy-pagination.css → pagination.css} +19 -2
  207. package/styles.css +1 -1
  208. package/styles.scss +2 -2
  209. package/surfaces.d.ts +36 -2
  210. package/surfaces.js +35 -132
  211. package/svelte.js +3 -3
  212. package/switch/index.js +15 -14
  213. package/time-grid.d.ts +0 -1
  214. package/time-grid.js +38 -37
  215. package/timeline-track/index.js +2 -2
  216. package/ui.css +1 -1
  217. package/vue.d.ts +26 -30
  218. package/vue.js +117 -121
  219. package/_chunks/chart-frame-Cmc7xU1i.js +0 -130
  220. package/_chunks/choice-chips-CHQTUdLs.js +0 -110
  221. package/_chunks/color-picker-CudqPYZo.js +0 -138
  222. package/_chunks/control-tooltip-uscKfAnV.js +0 -100
  223. package/_chunks/dialog.parts-CKGkC5zP.js +0 -134
  224. package/_chunks/editor-popup-WDdtVDNA.js +0 -81
  225. package/_chunks/history-controls-B3u3INEK.js +0 -27
  226. package/_chunks/mount-DQ1cpppK.js +0 -257
  227. package/_chunks/native-control-C_yok8_-.js +0 -605
  228. package/_chunks/request-trail-DSlFix6i.js +0 -618
  229. package/_chunks/rich-text-CH7gIqOS.js +0 -636
  230. package/avatar/index.view.d.ts +0 -25
  231. package/color-palette/native.view.d.ts +0 -15
  232. package/control-presentation.view.d.ts +0 -8
  233. package/dialog/dialog-action-footer.view.d.ts +0 -20
  234. package/dialog/dialog.dom.view.d.ts +0 -15
  235. package/form-controls/index.view.d.ts +0 -10
  236. package/formatting/control-tooltip.d.ts +0 -27
  237. package/native-controls.view.d.ts +0 -54
  238. package/search-input/native.view.d.ts +0 -21
  239. package/surfaces.view.d.ts +0 -63
  240. /package/styles/{legacy-rating.css → rating.css} +0 -0
@@ -1,18 +1,19 @@
1
1
  import { i as e } from "./preact.module-BBM36DnO.js";
2
- import { c as t, i as n, n as r, r as i, t as a } from "./hooks.module-CG3gN83z.js";
2
+ import { a as t, i as n, n as r, r as i, t as a } from "./hooks.module-CG3gN83z.js";
3
3
  import { t as o } from "./jsxRuntime.module-F6UFnpT-.js";
4
- import { SvgIcon as s } from "../icons/icon.js";
5
- import { n as c } from "./native-control-C_yok8_-.js";
6
- import { createPreactElement as l, releasePreactElement as u } from "../preact-mount.js";
7
- import { R as d, n as f } from "./controls-DsNi8V8I.js";
8
- import { createControlId as p } from "../core/control-id.js";
4
+ import { createPreactElement as s, releasePreactElement as c } from "../preact-mount.js";
5
+ import { createControlId as l } from "../core/control-id.js";
6
+ import { SvgIcon as u } from "../icons/icon.js";
7
+ import { n as d } from "./native-control-pFMuHf3G.js";
8
+ import "./chevron-down-GbplLa6s.js";
9
+ import { L as f, t as p } from "./controls-FUU-MUKC.js";
9
10
  import { EditorList as m, EditorListItem as h } from "../editor-layout/index.js";
10
11
  import { t as g } from "./clock-BOhPNlW3.js";
11
12
  import { i as _, s as v } from "./iso-B0YHBK7m.js";
12
13
  import { f as y, h as b, m as x, p as S } from "./model-mPO2tG2f.js";
13
- import { n as C, t as w } from "./date-control-DrVFX13g.js";
14
- import { t as T } from "./picker-h1P5RUgp.js";
15
- import { t as E } from "./editor-popup-WDdtVDNA.js";
14
+ import { n as C, t as w } from "./date-control-Dup_P3w5.js";
15
+ import { t as T } from "./picker-gEGTu1Ki.js";
16
+ import { t as E } from "./editor-popup-ByU7qiub.js";
16
17
  import { n as D } from "./editor-commit-Bq3wSgvr.js";
17
18
  import { EditorActions as O } from "../editor-actions.js";
18
19
  //#region ../dates/src/date-controls.ts
@@ -82,20 +83,20 @@ function B(e, t, n) {
82
83
  function V(e, t, n) {
83
84
  return n === "datetime" ? `${R(e)}T${t}` : t;
84
85
  }
85
- function H(e, t) {
86
+ function ee(e, t) {
86
87
  return e === "date" ? v(t) : e === "datetime" ? !!L(t.replace(/(\d{2}:\d{2}:\d{2})\.\d{1,3}$/, "$1")) : !!N(e, t);
87
88
  }
88
- function U(e) {
89
+ function H(e) {
89
90
  let t = N("time", e);
90
91
  return t ? t.getHours() * 3600 + t.getMinutes() * 60 + t.getSeconds() : void 0;
91
92
  }
92
- function W(e, t) {
93
- let n = U(e);
93
+ function U(e, t) {
94
+ let n = H(e);
94
95
  if (n === void 0) return !1;
95
- let r = t.min ? U(t.min) : void 0, i = t.max ? U(t.max) : void 0;
96
+ let r = t.min ? H(t.min) : void 0, i = t.max ? H(t.max) : void 0;
96
97
  return (r === void 0 || n >= r) && (i === void 0 || n <= i) && (t.step === void 0 || t.step > 0 && (n - (r ?? 0)) % t.step === 0);
97
98
  }
98
- function G(e, t, n = "minute", r) {
99
+ function W(e, t, n = "minute", r) {
99
100
  let i = N("time", e);
100
101
  return i ? new Intl.DateTimeFormat(r ?? (t === "12h" ? "en-US" : "en-GB"), {
101
102
  hour: "2-digit",
@@ -104,7 +105,7 @@ function G(e, t, n = "minute", r) {
104
105
  hourCycle: t === "12h" ? "h12" : "h23"
105
106
  }).format(i) : e;
106
107
  }
107
- function K(e, t = "minute", n) {
108
+ function G(e, t = "minute", n) {
108
109
  if (e = e.replace(/[\u200e\u200f\u061c]/g, "").trim(), n) {
109
110
  let t = new Intl.NumberFormat(n, { useGrouping: !1 });
110
111
  for (let n = 0; n < 10; n++) e = e.split(t.format(n)).join(String(n));
@@ -136,18 +137,18 @@ function K(e, t = "minute", n) {
136
137
  }
137
138
  //#endregion
138
139
  //#region ../dates/src/time-selection.ts
139
- function q(e) {
140
- let t = e.min ? U(e.min) : void 0, n = e.max ? U(e.max) : void 0, r = e.step ?? (e.precision === "second" ? 1 : 60);
140
+ function K(e) {
141
+ let t = e.min ? H(e.min) : void 0, n = e.max ? H(e.max) : void 0, r = e.step ?? (e.precision === "second" ? 1 : 60);
141
142
  if (!Number.isFinite(r) || r <= 0) return [];
142
143
  let i = e.precision === "second" ? 1 : 60, a = [];
143
144
  for (let e = 0; e < 86400; e += i) (t === void 0 || e >= t) && (n === void 0 || e <= n) && (e - (t ?? 0)) % r === 0 && a.push(e);
144
145
  return a;
145
146
  }
146
- function J(e, t = "minute") {
147
+ function q(e, t = "minute") {
147
148
  let n = (e) => String(e).padStart(2, "0");
148
149
  return `${n(Math.floor(e / 3600))}:${n(Math.floor(e / 60) % 60)}${t === "second" ? `:${n(e % 60)}` : ""}`;
149
150
  }
150
- function ee(e, t) {
151
+ function J(e, t) {
151
152
  return e === "12h" || e === "locale" && !!new Intl.DateTimeFormat(t, { hour: "numeric" }).resolvedOptions().hour12;
152
153
  }
153
154
  function te(e, t) {
@@ -157,7 +158,7 @@ function te(e, t) {
157
158
  }).formatToParts(new Date(2e3, 0, 1, e ? 13 : 1)).find((e) => e.type === "dayPeriod")?.value ?? (e ? "PM" : "AM");
158
159
  }
159
160
  function ne(e, t, n) {
160
- let r = U(t), i = r ?? e[0] ?? 0, a = Math.floor(i / 3600), o = Math.floor(i / 60) % 60, s = i % 60, c = {
161
+ let r = H(t), i = r ?? e[0] ?? 0, a = Math.floor(i / 3600), o = Math.floor(i / 60) % 60, s = i % 60, c = {
161
162
  hour: /* @__PURE__ */ new Map(),
162
163
  minute: /* @__PURE__ */ new Map(),
163
164
  second: /* @__PURE__ */ new Map(),
@@ -207,15 +208,15 @@ var Y = {
207
208
  chooseTime: "Choose time"
208
209
  };
209
210
  function X(e, t) {
210
- return (e === "time" ? t?.chooseTime ?? t?.chooseDate : t?.chooseDate) ?? (e === "time" ? Y.chooseTime : Y.chooseDate);
211
+ return (e === "time" ? t?.chooseTime : t?.chooseDate) ?? (e === "time" ? Y.chooseTime : Y.chooseDate);
211
212
  }
212
213
  //#endregion
213
214
  //#region src/date-time/validation.ts
214
- function Z(e, t, n = "") {
215
+ function re(e, t, n = "") {
215
216
  let { kind: r = "date", selection: i = "single", value: a, calendar: o = {} } = e, s = {
216
217
  ...Y,
217
218
  ...e.text
218
- }, c = a && !Array.isArray(a) && typeof a == "object" ? a : void 0, l = typeof a == "string" ? a : "", u = c?.from ?? "", d = c?.to ?? "", f = e.required ?? o.required ?? !1, p = c ? [u, d] : Array.isArray(a) ? a : l ? [l] : [], m = (e) => v(e) && (!o.minDate || e >= o.minDate) && (!o.maxDate || e <= o.maxDate) && !o.isDateDisabled?.(e) && !o.isMonthDisabled?.(y(e, o.calendarSystem)), h = (t) => H(r, t) && (r === "time" || m(R(t))) && (r === "date" || W(z(t), {
219
+ }, c = a && !Array.isArray(a) && typeof a == "object" ? a : void 0, l = typeof a == "string" ? a : "", u = c?.from ?? "", d = c?.to ?? "", f = e.required ?? o.required ?? !1, p = c ? [u, d] : Array.isArray(a) ? a : l ? [l] : [], m = (e) => v(e) && (!o.minDate || e >= o.minDate) && (!o.maxDate || e <= o.maxDate) && !o.isDateDisabled?.(e) && !o.isMonthDisabled?.(y(e, o.calendarSystem)), h = (t) => ee(r, t) && (r === "time" || m(R(t))) && (r === "date" || U(z(t), {
219
220
  min: e.minTime,
220
221
  max: e.maxTime,
221
222
  step: e.timeStep
@@ -249,26 +250,26 @@ function Z(e, t, n = "") {
249
250
  }
250
251
  //#endregion
251
252
  //#region src/date-time/time-control.tsx
252
- function re({ value: e, label: t, format: r = "locale", precision: i = "minute", locale: a, min: s, max: l, step: u, onChange: d }) {
253
+ function ie({ value: e, label: t, format: r = "locale", precision: i = "minute", locale: a, min: s, max: c, step: l, onChange: u }) {
253
254
  let [f, p] = n(!1), [m, h] = n("");
254
- if (r === "locale") return /* @__PURE__ */ o(c, {
255
+ if (r === "locale") return /* @__PURE__ */ o(d, {
255
256
  type: "time",
256
257
  "aria-label": t,
257
258
  value: e,
258
259
  min: s,
259
- max: l,
260
- step: u ?? (i === "second" ? 1 : 60),
261
- onInput: (e) => d(e.currentTarget.value)
260
+ max: c,
261
+ step: l ?? (i === "second" ? 1 : 60),
262
+ onInput: (e) => u(e.currentTarget.value)
262
263
  });
263
- let g = G(e, r, i, a);
264
- return /* @__PURE__ */ o(c, {
264
+ let g = W(e, r, i, a);
265
+ return /* @__PURE__ */ o(d, {
265
266
  type: "text",
266
267
  "aria-label": t,
267
268
  value: f ? m : g,
268
- "aria-invalid": !!e && !W(e, {
269
+ "aria-invalid": !!e && !U(e, {
269
270
  min: s,
270
- max: l,
271
- step: u
271
+ max: c,
272
+ step: l
272
273
  }),
273
274
  placeholder: r === "12h" ? "09:00 AM" : "09:00",
274
275
  onFocus: () => {
@@ -277,13 +278,13 @@ function re({ value: e, label: t, format: r = "locale", precision: i = "minute",
277
278
  onBlur: () => p(!1),
278
279
  onInput: (e) => {
279
280
  let t = e.currentTarget.value;
280
- h(t), d(t ? K(t, i, a) ?? t : "");
281
+ h(t), u(t ? G(t, i, a) ?? t : "");
281
282
  }
282
283
  });
283
284
  }
284
285
  //#endregion
285
286
  //#region src/date-time/time-selection.tsx
286
- function ie({ label: e, accessibleLabel: t, values: n, selected: r, choices: s, display: c, onSelect: l }) {
287
+ function ae({ label: e, accessibleLabel: t, values: n, selected: r, choices: s, display: c, onSelect: l }) {
287
288
  let u = a(null), d = r !== void 0 && s.has(r), f = d ? r : n.find((e) => s.has(e));
288
289
  i(() => {
289
290
  let e = u.current;
@@ -302,7 +303,7 @@ function ie({ label: e, accessibleLabel: t, values: n, selected: r, choices: s,
302
303
  };
303
304
  return /* @__PURE__ */ o("div", {
304
305
  class: "rv-time-selection__column",
305
- children: [/* @__PURE__ */ o("span", {
306
+ children: [e && /* @__PURE__ */ o("span", {
306
307
  class: "rv-time-selection__label",
307
308
  children: e
308
309
  }), /* @__PURE__ */ o(m, {
@@ -322,286 +323,301 @@ function ie({ label: e, accessibleLabel: t, values: n, selected: r, choices: s,
322
323
  })]
323
324
  });
324
325
  }
325
- function Q({ value: e, label: t, text: n, onChange: i, format: a = "locale", precision: s = "minute", locale: c, min: l, max: u, step: d }) {
326
- let f = ee(a, c), p = r(() => q({
327
- min: l,
328
- max: u,
329
- step: d,
330
- precision: s
326
+ function Z({ value: e, label: i, text: a, onChange: s, format: c = "locale", precision: l = "minute", locale: d, min: f, max: m, step: h, collapsible: g = !1 }) {
327
+ let [_, v] = n(!1), y = t(), b = J(c, d), x = r(() => K({
328
+ min: f,
329
+ max: m,
330
+ step: h,
331
+ precision: l
331
332
  }), [
332
- l,
333
- u,
334
- d,
335
- s
336
- ]), m = r(() => ne(p, e, f), [
337
- p,
333
+ f,
334
+ m,
335
+ h,
336
+ l
337
+ ]), S = r(() => ne(x, e, b), [
338
+ x,
338
339
  e,
339
- f
340
- ]), h = r(() => new Intl.NumberFormat(c, {
340
+ b
341
+ ]), C = r(() => new Intl.NumberFormat(d, {
341
342
  minimumIntegerDigits: 2,
342
343
  useGrouping: !1
343
- }), [c]), g = (e) => i(J(e, s)), _ = (e, n, r, i = (e) => h.format(e)) => /* @__PURE__ */ o(ie, {
344
- label: n,
345
- accessibleLabel: `${t}: ${n}`,
346
- values: r,
347
- selected: m.hasValue ? m[e] : void 0,
348
- choices: m.columns[e],
349
- display: i,
350
- onSelect: g
351
- }), v = (e, t = 0) => Array.from({ length: e }, (e, n) => t + n);
344
+ }), [d]), w = (e) => s(q(e, l)), T = (e, t, n, r = (e) => C.format(e)) => /* @__PURE__ */ o(ae, {
345
+ label: e === "period" ? void 0 : t,
346
+ accessibleLabel: `${i}: ${t}`,
347
+ values: n,
348
+ selected: S.hasValue ? S[e] : void 0,
349
+ choices: S.columns[e],
350
+ display: r,
351
+ onSelect: w
352
+ }), E = (e, t = 0) => Array.from({ length: e }, (e, n) => t + n);
352
353
  return /* @__PURE__ */ o("section", {
353
354
  class: "rv-time-selection",
354
- children: [
355
- /* @__PURE__ */ o("label", {
355
+ children: [/* @__PURE__ */ o("div", {
356
+ class: "rv-time-selection__entry-row",
357
+ children: [/* @__PURE__ */ o("label", {
356
358
  class: "rv-time-selection__entry",
357
- children: [/* @__PURE__ */ o("span", { children: t }), /* @__PURE__ */ o(re, {
359
+ children: [/* @__PURE__ */ o("span", { children: i }), /* @__PURE__ */ o(ie, {
358
360
  value: e,
359
- label: t,
360
- format: a,
361
- precision: s,
362
- locale: c,
363
- min: l,
364
- max: u,
365
- step: d,
366
- onChange: i
361
+ label: i,
362
+ format: c,
363
+ precision: l,
364
+ locale: d,
365
+ min: f,
366
+ max: m,
367
+ step: h,
368
+ onChange: s
367
369
  })]
368
- }),
369
- /* @__PURE__ */ o("div", {
370
- class: `rv-time-selection__columns${s === "second" ? " rv-time-selection__columns--seconds" : ""}`,
371
- children: [
372
- _("hour", n.hours, v(f ? 12 : 24, f ? m.period * 12 : 0), (e) => h.format(f ? e % 12 || 12 : e)),
373
- _("minute", n.minutes, v(60)),
374
- s === "second" && _("second", n.seconds, v(60))
375
- ]
376
- }),
377
- f && /* @__PURE__ */ o("div", {
378
- class: "rv-time-selection__period",
379
- children: _("period", n.dayPeriod, [0, 1], (e) => te(e, c))
380
- }),
381
- !p.length && /* @__PURE__ */ o("p", {
382
- class: "rv-time-selection__empty",
383
- role: "status",
384
- children: n.noTimes
385
- })
386
- ]
370
+ }), g && /* @__PURE__ */ o(p, {
371
+ variant: "ghost",
372
+ className: "rv-time-selection__toggle",
373
+ "aria-label": a.chooseTime ?? a.time,
374
+ "aria-expanded": _,
375
+ "aria-controls": _ ? y : void 0,
376
+ onClick: () => v(!_),
377
+ children: /* @__PURE__ */ o(u, { svg: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 512\"><!--! Font Awesome Free 7.3.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2026 Fonticons, Inc. --><path fill=\"currentColor\" d=\"M201.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 338.7 54.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z\"/></svg>" })
378
+ })]
379
+ }), (!g || _) && /* @__PURE__ */ o("div", {
380
+ id: y,
381
+ class: "rv-time-selection__clock",
382
+ children: [
383
+ /* @__PURE__ */ o("div", {
384
+ class: `rv-time-selection__columns${l === "second" ? " rv-time-selection__columns--seconds" : ""}`,
385
+ children: [
386
+ T("hour", a.hours, E(b ? 12 : 24, b ? S.period * 12 : 0), (e) => C.format(b ? e % 12 || 12 : e)),
387
+ T("minute", a.minutes, E(60)),
388
+ l === "second" && T("second", a.seconds, E(60))
389
+ ]
390
+ }),
391
+ b && /* @__PURE__ */ o("div", {
392
+ class: "rv-time-selection__period",
393
+ children: T("period", a.dayPeriod, [0, 1], (e) => te(e, d))
394
+ }),
395
+ !x.length && /* @__PURE__ */ o("p", {
396
+ class: "rv-time-selection__empty",
397
+ role: "status",
398
+ children: a.noTimes
399
+ })
400
+ ]
401
+ })]
387
402
  });
388
403
  }
389
404
  //#endregion
390
405
  //#region src/date-time/picker.tsx
391
- function ae(r) {
392
- let { kind: i = "date", selection: a = "single", value: s, onChange: c, calendar: l = {} } = r, u = {
406
+ function oe(t) {
407
+ let { kind: r = "date", selection: a = "single", value: s, onChange: c, calendar: u = {} } = t, d = (u.numberOfMonths ?? 1) >= 2, m = {
393
408
  ...Y,
394
- ...r.text
395
- }, [m] = n(() => p("rv-date-error")), h = (e) => i === "date" ? e : R(e), g = {
396
- locale: l.locale,
397
- ...typeof r.dateInput == "object" ? r.dateInput : {}
398
- }, [_, x] = n(r.endpoint === "to" ? "to" : void 0), [S, C] = n(""), E = s && !Array.isArray(s) && typeof s == "object" ? s : void 0, D = typeof s == "string" ? s : "", O = Array.isArray(s) ? s : [], k = E?.from ?? "", A = E?.to ?? "", j = R(i === "time" ? b() : r.endpoint === "to" ? A : k || D || O[0] || ""), [M, N] = n(() => l.defaultMonth ?? y(v(j) ? j : b(), l.calendarSystem)), P = r.required ?? l.required ?? !1, { valid: F, errorMessage: I, validDate: L } = Z(r, M, S);
399
- t(() => r.onValidityChange?.(!!F), [F]);
400
- let H = (e) => {
401
- C(""), c(e);
402
- }, U = (e) => {
403
- H(e), i === "date" && a !== "multiple" && Z({
404
- ...r,
409
+ ...t.text
410
+ }, [h] = n(() => l("rv-date-error")), g = (e) => r === "date" ? e : R(e), _ = {
411
+ locale: u.locale,
412
+ ...typeof t.dateInput == "object" ? t.dateInput : {}
413
+ }, [x, S] = n(t.endpoint === "to" ? "to" : void 0), [C, E] = n(""), D = s && !Array.isArray(s) && typeof s == "object" ? s : void 0, O = typeof s == "string" ? s : "", k = Array.isArray(s) ? s : [], A = D?.from ?? "", j = D?.to ?? "", M = R(r === "time" ? b() : t.endpoint === "to" ? j : A || O || k[0] || ""), [N, P] = n(() => u.defaultMonth ?? y(v(M) ? M : b(), u.calendarSystem)), F = t.required ?? u.required ?? !1, { valid: I, errorMessage: L, validDate: ee } = re(t, N, C);
414
+ i(() => t.onValidityChange?.(!!I), [I]);
415
+ let H = (e, n = !1) => {
416
+ E(""), c(e), (t.onValidChange || n) && re({
417
+ ...t,
405
418
  value: e
406
- }, M).valid && r.onSelectionComplete?.(e);
419
+ }, N).valid && (t.onValidChange?.(e), n && t.onSelectionComplete?.(e));
420
+ }, U = (e) => {
421
+ H(e, r === "date" && a !== "multiple");
407
422
  }, W = (e) => {
408
- if (!L(e)) return;
409
- let t = y(e, l.calendarSystem);
410
- t !== (l.month ?? M) && (N(t), l.onMonthChange?.(t));
423
+ if (!ee(e)) return;
424
+ let t = y(e, u.calendarSystem);
425
+ t !== (u.month ?? N) && (P(t), u.onMonthChange?.(t));
411
426
  }, G = (e, t) => {
412
427
  if (typeof t != "string") return;
413
428
  W(t);
414
429
  let n = {
415
- from: k,
416
- to: A,
417
- [e]: t ? B(t, e === "from" ? k : A, i) : ""
430
+ from: A,
431
+ to: j,
432
+ [e]: t ? B(t, e === "from" ? A : j, r) : ""
418
433
  };
419
434
  H(!n.from && !n.to ? null : n);
420
- }, K = (e, t, n, i = !0) => /* @__PURE__ */ o("label", {
435
+ }, K = (e, n, r, i = !0) => /* @__PURE__ */ o("label", {
421
436
  class: `rv-temporal-picker__time${i ? "" : " rv-temporal-picker__time--single"}`,
422
- children: [i && /* @__PURE__ */ o("span", { children: t }), /* @__PURE__ */ o(re, {
423
- label: t,
437
+ children: [i && /* @__PURE__ */ o("span", { children: n }), /* @__PURE__ */ o(ie, {
438
+ label: n,
424
439
  value: e ? z(e) : "",
425
- min: r.minTime,
426
- max: r.maxTime,
427
- step: r.timeStep,
428
- precision: r.precision,
429
- format: r.timeFormat,
430
- locale: l.locale,
431
- onChange: n
440
+ min: t.minTime,
441
+ max: t.maxTime,
442
+ step: t.timeStep,
443
+ precision: t.precision,
444
+ format: t.timeFormat,
445
+ locale: u.locale,
446
+ onChange: r
432
447
  })]
433
448
  }), q = {
434
- ...l,
435
- month: l.month ?? M,
449
+ ...u,
450
+ month: u.month ?? N,
436
451
  onMonthChange: (e) => {
437
- N(e), l.onMonthChange?.(e);
452
+ P(e), u.onMonthChange?.(e);
438
453
  },
439
- required: P,
454
+ required: F,
440
455
  onInvalidSelection: (e, t) => {
441
- C(e || u.invalid), l.onInvalidSelection?.(e, t);
456
+ E(e || m.invalid), u.onInvalidSelection?.(e, t);
442
457
  }
443
458
  }, J;
444
459
  if (a === "multiple") J = {
445
460
  ...q,
446
461
  mode: "multiple",
447
- selected: O.filter(v),
462
+ selected: k.filter(v),
448
463
  onSelectionChange: (e) => U([...e])
449
464
  };
450
- else if (a === "range" && !_) J = {
465
+ else if (a === "range" && !x) J = {
451
466
  ...q,
452
467
  mode: "range",
453
- selected: k && v(R(k)) ? {
454
- from: R(k),
455
- ...A && v(R(A)) ? { to: R(A) } : {}
468
+ selected: A && v(R(A)) ? {
469
+ from: R(A),
470
+ ...j && v(R(j)) ? { to: R(j) } : {}
456
471
  } : void 0,
457
472
  onSelectionChange: (e) => U(e ? {
458
- from: B(e.from, k, i),
459
- ...e.to ? { to: B(e.to, A, i) } : {}
473
+ from: B(e.from, A, r),
474
+ ...e.to ? { to: B(e.to, j, r) } : {}
460
475
  } : null)
461
476
  };
462
477
  else {
463
- let e = a === "range" ? _ === "to" ? A : k : D;
478
+ let e = a === "range" ? x === "to" ? j : A : O;
464
479
  J = {
465
480
  ...q,
466
481
  mode: "single",
467
482
  selected: e && v(R(e)) ? R(e) : void 0,
468
483
  onSelectionChange: (t) => {
469
484
  U(a === "range" ? t ? {
470
- from: k,
471
- to: A,
472
- [_ ?? "from"]: B(t, e, i)
473
- } : null : t ? B(t, D, i) : null);
485
+ from: A,
486
+ to: j,
487
+ [x ?? "from"]: B(t, e, r)
488
+ } : null : t ? B(t, O, r) : null);
474
489
  }
475
490
  };
476
491
  }
477
492
  return /* @__PURE__ */ o("div", {
478
- class: `rv-temporal-picker rv-temporal-picker--${i}`,
493
+ class: `rv-temporal-picker rv-temporal-picker--${r}${d ? " rv-temporal-picker--multi-month" : ""}`,
479
494
  children: [
480
- r.dateInput === !1 && a === "range" && i !== "time" && /* @__PURE__ */ o("div", {
481
- class: `rv-temporal-picker__endpoints ${r.classNames?.endpoints ?? ""}`,
482
- children: [/* @__PURE__ */ o(f, {
483
- "aria-label": `${u.startDate}: ${k}`,
484
- "aria-pressed": _ !== "to",
495
+ t.dateInput === !1 && a === "range" && r !== "time" && /* @__PURE__ */ o("div", {
496
+ class: `rv-temporal-picker__endpoints ${t.classNames?.endpoints ?? ""}`,
497
+ children: [/* @__PURE__ */ o(p, {
498
+ "aria-label": `${m.startDate}: ${A}`,
499
+ "aria-pressed": x !== "to",
485
500
  onClick: () => {
486
- x(void 0), k && N(y(R(k), l.calendarSystem)), C("");
501
+ S(void 0), A && P(y(R(A), u.calendarSystem)), E("");
487
502
  },
488
- children: k ? R(k) : "—"
489
- }), /* @__PURE__ */ o(f, {
490
- "aria-label": `${u.endDate}: ${A}`,
491
- "aria-pressed": _ === "to",
503
+ children: A ? R(A) : "—"
504
+ }), /* @__PURE__ */ o(p, {
505
+ "aria-label": `${m.endDate}: ${j}`,
506
+ "aria-pressed": x === "to",
492
507
  onClick: () => {
493
- x("to"), A && N(y(R(A), l.calendarSystem)), C("");
508
+ S("to"), j && P(y(R(j), u.calendarSystem)), E("");
494
509
  },
495
- children: A ? R(A) : "—"
510
+ children: j ? R(j) : "—"
496
511
  })]
497
512
  }),
498
513
  /* @__PURE__ */ o("div", {
499
514
  class: "rv-temporal-picker__header",
500
- children: i !== "time" && r.dateInput !== !1 && /* @__PURE__ */ o("div", {
501
- class: `rv-temporal-picker__dates ${a === "range" ? `rv-temporal-picker__endpoints ${r.classNames?.endpoints ?? ""}` : ""}`,
515
+ children: r !== "time" && t.dateInput !== !1 && /* @__PURE__ */ o("div", {
516
+ class: `rv-temporal-picker__dates ${a === "range" ? `rv-temporal-picker__endpoints ${t.classNames?.endpoints ?? ""}` : ""}`,
502
517
  children: a === "range" ? /* @__PURE__ */ o(e, { children: [/* @__PURE__ */ o("div", {
503
518
  class: "rv-temporal-picker__endpoint",
504
519
  role: "group",
505
- "aria-label": u.startDate,
520
+ "aria-label": m.startDate,
506
521
  children: [/* @__PURE__ */ o(w, {
507
- label: u.startDate,
508
- value: h(k),
509
- options: g,
510
- invalid: !F,
511
- errorId: m,
512
- onFocus: () => x(void 0),
522
+ label: m.startDate,
523
+ value: g(A),
524
+ options: _,
525
+ invalid: !I,
526
+ errorId: h,
527
+ onFocus: () => S(void 0),
513
528
  onChange: (e) => G("from", e)
514
- }), i === "datetime" && K(k, u.startTime, (e) => H({
515
- from: V(k, e, i),
516
- ...A ? { to: A } : {}
529
+ }), r === "datetime" && K(A, m.startTime, (e) => H({
530
+ from: V(A, e, r),
531
+ ...j ? { to: j } : {}
517
532
  }), !1)]
518
533
  }), /* @__PURE__ */ o("div", {
519
534
  class: "rv-temporal-picker__endpoint",
520
535
  role: "group",
521
- "aria-label": u.endDate,
536
+ "aria-label": m.endDate,
522
537
  children: [/* @__PURE__ */ o(w, {
523
- label: u.endDate,
524
- value: h(A),
525
- options: g,
526
- invalid: !F,
527
- errorId: m,
528
- onFocus: () => x("to"),
538
+ label: m.endDate,
539
+ value: g(j),
540
+ options: _,
541
+ invalid: !I,
542
+ errorId: h,
543
+ onFocus: () => S("to"),
529
544
  onChange: (e) => G("to", e)
530
- }), i === "datetime" && K(A, u.endTime, (e) => H({
531
- from: k,
532
- to: V(A, e, i)
545
+ }), r === "datetime" && K(j, m.endTime, (e) => H({
546
+ from: A,
547
+ to: V(j, e, r)
533
548
  }), !1)]
534
549
  })] }) : /* @__PURE__ */ o(w, {
535
- label: a === "multiple" ? u.dates : u.date,
536
- value: a === "multiple" ? O : h(D),
550
+ label: a === "multiple" ? m.dates : m.date,
551
+ value: a === "multiple" ? k : g(O),
537
552
  multiple: a === "multiple",
538
- options: g,
539
- invalid: !F,
540
- errorId: m,
553
+ options: _,
554
+ invalid: !I,
555
+ errorId: h,
541
556
  onChange: (e) => {
542
- typeof e == "string" && W(e), H(Array.isArray(e) ? e : e ? B(e, D, i) : null);
557
+ typeof e == "string" && W(e), H(Array.isArray(e) ? e : e ? B(e, O, r) : null);
543
558
  }
544
559
  })
545
560
  })
546
561
  }),
547
562
  /* @__PURE__ */ o("div", {
548
563
  class: "rv-temporal-picker__body",
549
- children: [i !== "time" && /* @__PURE__ */ o(T, { ...J }), i !== "date" && a !== "range" && /* @__PURE__ */ o(Q, {
550
- value: z(D),
551
- label: u.time,
552
- text: u,
553
- format: r.timeFormat,
554
- precision: r.precision,
555
- locale: l.locale,
556
- min: r.minTime,
557
- max: r.maxTime,
558
- step: r.timeStep,
559
- onChange: (e) => H(V(D, e, i))
564
+ children: [r !== "time" && /* @__PURE__ */ o(T, { ...J }), r !== "date" && a !== "range" && /* @__PURE__ */ o(Z, {
565
+ collapsible: r === "datetime" && d,
566
+ value: z(O),
567
+ label: m.time,
568
+ text: m,
569
+ format: t.timeFormat,
570
+ precision: t.precision,
571
+ locale: u.locale,
572
+ min: t.minTime,
573
+ max: t.maxTime,
574
+ step: t.timeStep,
575
+ onChange: (e) => H(V(O, e, r))
560
576
  })]
561
577
  }),
562
- i !== "date" && a === "range" && (i === "time" || r.dateInput === !1) && /* @__PURE__ */ o("div", {
578
+ r !== "date" && a === "range" && (r === "time" || t.dateInput === !1) && /* @__PURE__ */ o("div", {
563
579
  class: "rv-temporal-picker__times",
564
- children: [i === "time" ? /* @__PURE__ */ o(Q, {
565
- value: z(k),
566
- label: u.startTime,
567
- text: u,
568
- format: r.timeFormat,
569
- precision: r.precision,
570
- locale: l.locale,
571
- min: r.minTime,
572
- max: r.maxTime,
573
- step: r.timeStep,
580
+ children: [r === "time" ? /* @__PURE__ */ o(Z, {
581
+ value: z(A),
582
+ label: m.startTime,
583
+ text: m,
584
+ format: t.timeFormat,
585
+ precision: t.precision,
586
+ locale: u.locale,
587
+ min: t.minTime,
588
+ max: t.maxTime,
589
+ step: t.timeStep,
574
590
  onChange: (e) => H({
575
591
  from: e,
576
- ...A ? { to: A } : {}
592
+ ...j ? { to: j } : {}
577
593
  })
578
- }) : K(k, u.startTime, (e) => H({
579
- from: V(k, e, i),
580
- ...A ? { to: A } : {}
581
- })), i === "time" ? /* @__PURE__ */ o(Q, {
582
- value: z(A),
583
- label: u.endTime,
584
- text: u,
585
- format: r.timeFormat,
586
- precision: r.precision,
587
- locale: l.locale,
588
- min: r.minTime,
589
- max: r.maxTime,
590
- step: r.timeStep,
594
+ }) : K(A, m.startTime, (e) => H({
595
+ from: V(A, e, r),
596
+ ...j ? { to: j } : {}
597
+ })), r === "time" ? /* @__PURE__ */ o(Z, {
598
+ value: z(j),
599
+ label: m.endTime,
600
+ text: m,
601
+ format: t.timeFormat,
602
+ precision: t.precision,
603
+ locale: u.locale,
604
+ min: t.minTime,
605
+ max: t.maxTime,
606
+ step: t.timeStep,
591
607
  onChange: (e) => H({
592
- from: k,
608
+ from: A,
593
609
  to: e
594
610
  })
595
- }) : K(A, u.endTime, (e) => H({
596
- from: k,
597
- to: V(A, e, i)
611
+ }) : K(j, m.endTime, (e) => H({
612
+ from: A,
613
+ to: V(j, e, r)
598
614
  }))]
599
615
  }),
600
- !F && /* @__PURE__ */ o(d, {
616
+ !I && /* @__PURE__ */ o(f, {
601
617
  tone: "danger",
602
618
  children: /* @__PURE__ */ o("span", {
603
- id: m,
604
- children: I
619
+ id: h,
620
+ children: L
605
621
  })
606
622
  })
607
623
  ]
@@ -609,111 +625,130 @@ function ae(r) {
609
625
  }
610
626
  //#endregion
611
627
  //#region src/date-time/field.tsx
612
- function $({ value: e, options: t, apply: r, cancel: i, clearable: a = !0 }) {
613
- let [s, c] = n(e), [l, u] = n(!1), [f, p] = n(""), m = (e) => {
614
- c(e), p("");
615
- }, h = t.autoApply !== !1, g = JSON.stringify(s) !== JSON.stringify(e), _ = (e) => {
628
+ function Q({ value: e, options: t, apply: r, cancel: i, onValidChange: a, clearable: s = !0 }) {
629
+ let [c, l] = n(e), [u, d] = n(!1), [p, m] = n(""), h = (e) => {
630
+ l(e), m("");
631
+ }, g = t.autoApply !== !1, _ = JSON.stringify(c) !== JSON.stringify(e), v = (e) => {
616
632
  let t = r(e) || "";
617
- return p(t), !t;
618
- }, v = () => l ? _(s) : !1;
619
- return D(() => !g || v(), h), /* @__PURE__ */ o("div", {
633
+ return m(t), !t;
634
+ }, y = () => u ? v(c) : !1;
635
+ return D(() => !_ || y(), g), /* @__PURE__ */ o("div", {
620
636
  class: `rv-temporal-draft${t.kind === "time" ? " rv-temporal-draft--time" : ""}`,
621
637
  onKeyDown: (e) => {
622
- e.key === "Enter" && !e.isComposing && (e.ctrlKey || e.metaKey || h && e.target instanceof HTMLInputElement) && (e.preventDefault(), v());
638
+ e.key === "Enter" && !e.isComposing && (e.ctrlKey || e.metaKey || g && e.target instanceof HTMLInputElement) && (e.preventDefault(), y());
623
639
  },
624
640
  children: [
625
- /* @__PURE__ */ o(ae, {
641
+ /* @__PURE__ */ o(oe, {
626
642
  ...t,
627
- value: s,
628
- onChange: m,
629
- onValidityChange: u,
630
- onSelectionComplete: h ? _ : void 0
643
+ value: c,
644
+ onChange: h,
645
+ onValidChange: a,
646
+ onValidityChange: d,
647
+ onSelectionComplete: g ? v : void 0
631
648
  }),
632
- f && /* @__PURE__ */ o(d, {
649
+ p && /* @__PURE__ */ o(f, {
633
650
  tone: "danger",
634
- children: f
651
+ children: p
635
652
  }),
636
653
  /* @__PURE__ */ o(O, {
637
654
  text: t.actions,
638
- showConfirm: t.showActions ?? !h,
639
- disabled: !l,
640
- apply: v,
655
+ showConfirm: t.showActions ?? !g,
656
+ disabled: !u,
657
+ apply: y,
641
658
  cancel: i,
642
- clear: !a || (t.required ?? t.calendar?.required) ? void 0 : () => {
659
+ clear: !s || (t.required ?? t.calendar?.required) ? void 0 : () => {
643
660
  let e = t.selection === "multiple" ? [] : null;
644
- m(e), h && _(e);
661
+ h(e), g && v(e);
645
662
  }
646
663
  })
647
664
  ]
648
665
  });
649
666
  }
650
- function oe({ value: e, kind: t = "date", picker: n, onValueChange: r, onInput: l, formatValue: u, parseValue: d, ...p }) {
651
- let m = a(null), h = a(), _ = a({
667
+ function se({ value: e, kind: t = "date", picker: n, livePickerUpdates: r, onValueChange: s, onInput: c, formatValue: l, parseValue: f, ...m }) {
668
+ let h = a(null), _ = a(), v = a({
652
669
  value: e,
653
670
  kind: t,
654
671
  picker: n,
655
- onValueChange: r,
656
- input: p
672
+ onValueChange: s,
673
+ input: m
657
674
  });
658
- return _.current = {
675
+ return v.current = {
659
676
  value: e,
660
677
  kind: t,
661
678
  picker: n,
662
- onValueChange: r,
663
- input: p
664
- }, i(() => () => h.current?.close(), []), i(() => {
665
- (p.disabled || p.readOnly) && h.current?.close();
666
- }, [p.disabled, p.readOnly]), /* @__PURE__ */ o("span", {
679
+ onValueChange: s,
680
+ input: m
681
+ }, i(() => () => _.current?.close(), []), i(() => {
682
+ (m.disabled || m.readOnly) && _.current?.close();
683
+ }, [m.disabled, m.readOnly]), /* @__PURE__ */ o("span", {
667
684
  class: "rv-date-time-field",
668
- children: [/* @__PURE__ */ o(c, {
669
- ...p,
685
+ children: [/* @__PURE__ */ o(d, {
686
+ ...m,
670
687
  type: "text",
671
- value: u?.(e) ?? e,
672
- placeholder: p.placeholder ?? (t === "date" ? "YYYY-MM-DD" : t === "time" ? "HH:mm" : "YYYY-MM-DDTHH:mm"),
688
+ value: l?.(e) ?? e,
689
+ placeholder: m.placeholder ?? (t === "date" ? "YYYY-MM-DD" : t === "time" ? "HH:mm" : "YYYY-MM-DDTHH:mm"),
673
690
  onInput: (e) => {
674
- l?.(e);
675
- let t = d ? d(e.currentTarget.value) : e.currentTarget.value;
676
- t !== void 0 && r?.(t);
691
+ c?.(e);
692
+ let t = f ? f(e.currentTarget.value) : e.currentTarget.value;
693
+ t !== void 0 && s?.(t);
677
694
  }
678
- }), /* @__PURE__ */ o(f, {
679
- ref: m,
695
+ }), /* @__PURE__ */ o(p, {
696
+ ref: h,
680
697
  variant: "ghost",
681
698
  "aria-label": X(t, n?.text),
682
- disabled: p.disabled || p.readOnly,
699
+ disabled: m.disabled || m.readOnly,
683
700
  onClick: () => {
684
- m.current && !h.current && (h.current = E(m.current, (r) => /* @__PURE__ */ o($, {
701
+ if (!h.current) return;
702
+ if (_.current) {
703
+ _.current.close();
704
+ return;
705
+ }
706
+ let i, a = (e) => {
707
+ let t = typeof e == "string" ? e : "";
708
+ t === i || v.current.input.disabled || v.current.input.readOnly || (i = t, v.current.onValueChange?.(t));
709
+ };
710
+ _.current = E(h.current, (i) => /* @__PURE__ */ o(Q, {
685
711
  value: e || null,
686
712
  options: {
687
713
  ...n,
688
- required: n?.required ?? p.required,
714
+ calendar: {
715
+ fixedWeeks: !0,
716
+ ...n?.calendar
717
+ },
718
+ required: n?.required ?? m.required,
689
719
  kind: t,
690
720
  selection: "single"
691
721
  },
692
- cancel: r,
722
+ cancel: i,
723
+ onValidChange: r && n?.autoApply !== !1 ? a : void 0,
693
724
  apply: (e) => {
694
- !_.current.input.disabled && !_.current.input.readOnly && _.current.onValueChange?.(typeof e == "string" ? e : ""), r();
725
+ a(e), i();
695
726
  }
696
727
  }), {
697
728
  label: X(t, n?.text),
729
+ fitViewport: t === "datetime",
698
730
  className: t === "time" ? "rv-editor-popup--time" : t === "datetime" ? "rv-editor-popup--datetime" : void 0,
699
731
  onClose: () => {
700
- h.current = void 0;
732
+ _.current = void 0;
701
733
  }
702
- }));
734
+ });
703
735
  },
704
- children: /* @__PURE__ */ o(s, { svg: t === "time" ? g : C })
736
+ children: /* @__PURE__ */ o(u, { svg: t === "time" ? g : C })
705
737
  })]
706
738
  });
707
739
  }
708
740
  //#endregion
709
741
  //#region src/date-time/attach.tsx
710
- function se(e, t, n) {
711
- let r, i = l(e.ownerDocument, /* @__PURE__ */ o(f, {
742
+ var $ = /* @__PURE__ */ new WeakMap();
743
+ function ce(e, t, n) {
744
+ $.get(e)?.();
745
+ let r, i = s(e.ownerDocument, /* @__PURE__ */ o(p, {
746
+ className: "rv-temporal-picker-trigger",
712
747
  variant: "ghost",
713
748
  disabled: e.disabled || e.readOnly,
714
749
  "aria-label": X(t.kind ?? "date", t.text),
715
750
  onClick: () => {
716
- e.disabled || e.readOnly || r || (r = E(e, (r) => /* @__PURE__ */ o($, {
751
+ e.disabled || e.readOnly || (r ? r.close() : r = E(e, (r) => /* @__PURE__ */ o(Q, {
717
752
  value: e.value || null,
718
753
  options: {
719
754
  ...t,
@@ -725,29 +760,33 @@ function se(e, t, n) {
725
760
  !e.disabled && !e.readOnly && n(typeof t == "string" ? t : ""), r();
726
761
  }
727
762
  }), {
763
+ fitViewport: t.kind === "datetime",
728
764
  className: t.kind === "time" ? "rv-editor-popup--time" : t.kind === "datetime" ? "rv-editor-popup--datetime" : void 0,
729
765
  label: X(t.kind ?? "date", t.text),
766
+ trigger: i,
730
767
  onClose: () => {
731
768
  r = void 0;
732
769
  }
733
770
  }));
734
771
  },
735
- children: /* @__PURE__ */ o(s, { svg: t.kind === "time" ? g : C })
772
+ children: /* @__PURE__ */ o(u, { svg: t.kind === "time" ? g : C })
736
773
  }));
737
774
  e.after(i);
738
- let a = e.ownerDocument.defaultView?.MutationObserver, c = a ? new a(() => {
775
+ let a = e.ownerDocument.defaultView?.MutationObserver, l = a ? new a(() => {
739
776
  i.disabled = e.disabled || e.readOnly, i.disabled && r?.close();
740
777
  }) : void 0;
741
- return c?.observe(e, {
778
+ l?.observe(e, {
742
779
  attributes: !0,
743
780
  attributeFilter: ["disabled", "readonly"]
744
- }), () => {
745
- c?.disconnect(), r?.close(), u(i), i.remove();
781
+ });
782
+ let d = () => {
783
+ $.get(e) === d && ($.delete(e), l?.disconnect(), r?.close(), c(i), i.remove());
746
784
  };
785
+ return $.set(e, d), d;
747
786
  }
748
787
  //#endregion
749
788
  //#region src/date-time/value.tsx
750
- function ce(e, t) {
789
+ function le(e, t) {
751
790
  let n = Number.isFinite(t.maxVisibleDates) ? Math.max(1, Math.floor(t.maxVisibleDates)) : 2, r = t.multiple ? t.values.slice(0, n) : t.values, i = t.values.length - r.length;
752
791
  return e("span", {
753
792
  class: "rv-temporal-value",
@@ -765,4 +804,4 @@ function ce(e, t) {
765
804
  }, `+${i}`) : null]);
766
805
  }
767
806
  //#endregion
768
- export { ae as a, $ as i, se as n, Y as o, oe as r, X as s, ce as t };
807
+ export { oe as a, Q as i, ce as n, Y as o, se as r, X as s, le as t };