wimui 0.51.2 → 0.52.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 (215) hide show
  1. package/dist/components/_internal/FeedbackCloseButton.cjs +1 -1
  2. package/dist/components/_internal/FeedbackCloseButton.js +14 -13
  3. package/dist/components/_internal/FieldLabelContent.cjs +1 -1
  4. package/dist/components/_internal/FieldLabelContent.js +18 -17
  5. package/dist/components/ai/AIResponseFeedback/AIResponseFeedback.cjs +1 -1
  6. package/dist/components/ai/AIResponseFeedback/AIResponseFeedback.js +46 -45
  7. package/dist/components/ai/AgentStatus/AgentStatus.cjs +1 -1
  8. package/dist/components/ai/AgentStatus/AgentStatus.js +24 -23
  9. package/dist/components/ai/ArtifactsOverlay/ArtifactsOverlay.cjs +1 -1
  10. package/dist/components/ai/ArtifactsOverlay/ArtifactsOverlay.js +47 -45
  11. package/dist/components/ai/ChatUI/ChatUI.cjs +1 -1
  12. package/dist/components/ai/ChatUI/ChatUI.js +82 -81
  13. package/dist/components/ai/CodeBlock/CodeBlock.cjs +3 -3
  14. package/dist/components/ai/CodeBlock/CodeBlock.js +53 -52
  15. package/dist/components/ai/CodeDiffViewer/CodeDiffViewer.cjs +2 -2
  16. package/dist/components/ai/CodeDiffViewer/CodeDiffViewer.js +105 -104
  17. package/dist/components/ai/MarkdownRenderer/MarkdownRenderer.cjs +1 -1
  18. package/dist/components/ai/MarkdownRenderer/MarkdownRenderer.js +60 -59
  19. package/dist/components/ai/ModelSelector/ModelSelector.cjs +1 -1
  20. package/dist/components/ai/ModelSelector/ModelSelector.js +83 -82
  21. package/dist/components/ai/ModelSelector/model-selector.module.cjs +1 -1
  22. package/dist/components/ai/ModelSelector/model-selector.module.js +1 -1
  23. package/dist/components/ai/PromptInput/PromptInput.cjs +1 -1
  24. package/dist/components/ai/PromptInput/PromptInput.js +76 -75
  25. package/dist/components/ai/SourceCitation/SourceCitation.cjs +1 -1
  26. package/dist/components/ai/SourceCitation/SourceCitation.js +39 -38
  27. package/dist/components/ai/Terminal/Terminal.cjs +2 -2
  28. package/dist/components/ai/Terminal/Terminal.js +65 -64
  29. package/dist/components/ai/ThreadList/ThreadList.cjs +1 -1
  30. package/dist/components/ai/ThreadList/ThreadList.js +58 -57
  31. package/dist/components/data-display/Barcode/Barcode.cjs +1 -1
  32. package/dist/components/data-display/Barcode/Barcode.js +76 -75
  33. package/dist/components/data-display/Calendar/Calendar.cjs +1 -1
  34. package/dist/components/data-display/Calendar/Calendar.js +75 -74
  35. package/dist/components/data-display/CalendarHeatmap/CalendarHeatmap.cjs +1 -1
  36. package/dist/components/data-display/CalendarHeatmap/CalendarHeatmap.js +54 -52
  37. package/dist/components/data-display/Carousel/Carousel.cjs +1 -1
  38. package/dist/components/data-display/Carousel/Carousel.js +62 -61
  39. package/dist/components/data-display/Chip/Chip.cjs +1 -1
  40. package/dist/components/data-display/Chip/Chip.js +36 -35
  41. package/dist/components/data-display/Comment/Comment.cjs +1 -1
  42. package/dist/components/data-display/Comment/Comment.js +58 -57
  43. package/dist/components/data-display/Countdown/Countdown.cjs +1 -1
  44. package/dist/components/data-display/Countdown/Countdown.js +56 -55
  45. package/dist/components/data-display/DataGrid/DataGrid.cjs +1 -1
  46. package/dist/components/data-display/DataGrid/DataGrid.js +128 -127
  47. package/dist/components/data-display/JsonViewer/JsonViewer.cjs +1 -1
  48. package/dist/components/data-display/JsonViewer/JsonViewer.js +153 -152
  49. package/dist/components/data-display/Kanban/Kanban.cjs +1 -1
  50. package/dist/components/data-display/Kanban/Kanban.js +95 -94
  51. package/dist/components/data-display/NodeGraph/NodeGraph.cjs +1 -1
  52. package/dist/components/data-display/NodeGraph/NodeGraph.js +62 -61
  53. package/dist/components/data-display/PivotTable/PivotTable.cjs +1 -1
  54. package/dist/components/data-display/PivotTable/PivotTable.js +153 -152
  55. package/dist/components/data-display/Presence/Presence.cjs +1 -1
  56. package/dist/components/data-display/Presence/Presence.js +28 -27
  57. package/dist/components/data-display/PullToRefresh/PullToRefresh.cjs +1 -1
  58. package/dist/components/data-display/PullToRefresh/PullToRefresh.js +73 -72
  59. package/dist/components/data-display/Reaction/Reaction.cjs +1 -1
  60. package/dist/components/data-display/Reaction/Reaction.js +31 -30
  61. package/dist/components/data-display/ScheduleView/ScheduleView.cjs +1 -1
  62. package/dist/components/data-display/ScheduleView/ScheduleView.js +49 -48
  63. package/dist/components/data-display/SortableList/SortableList.cjs +1 -1
  64. package/dist/components/data-display/SortableList/SortableList.js +44 -43
  65. package/dist/components/data-display/Tag/Tag.cjs +1 -1
  66. package/dist/components/data-display/Tag/Tag.js +29 -28
  67. package/dist/components/data-display/TreeDiagram/TreeDiagram.cjs +1 -1
  68. package/dist/components/data-display/TreeDiagram/TreeDiagram.js +85 -84
  69. package/dist/components/data-display/TreeView/TreeView.cjs +1 -1
  70. package/dist/components/data-display/TreeView/TreeView.js +123 -122
  71. package/dist/components/feedback/Autosave/Autosave.cjs +1 -1
  72. package/dist/components/feedback/Autosave/Autosave.js +32 -31
  73. package/dist/components/feedback/ErrorBoundary/ErrorBoundary.cjs +1 -1
  74. package/dist/components/feedback/ErrorBoundary/ErrorBoundary.js +35 -34
  75. package/dist/components/feedback/ScrollProgress/ScrollProgress.cjs +1 -1
  76. package/dist/components/feedback/ScrollProgress/ScrollProgress.js +21 -20
  77. package/dist/components/feedback/Tour/Tour.cjs +1 -1
  78. package/dist/components/feedback/Tour/Tour.js +98 -97
  79. package/dist/components/form/Button/Button.cjs +1 -1
  80. package/dist/components/form/Button/Button.js +55 -54
  81. package/dist/components/form/ColorInput/ColorInput.cjs +1 -1
  82. package/dist/components/form/ColorInput/ColorInput.js +30 -29
  83. package/dist/components/form/ColorPicker/color-picker.module.cjs +1 -1
  84. package/dist/components/form/ColorPicker/color-picker.module.js +1 -1
  85. package/dist/components/form/CopyButton/CopyButton.cjs +1 -1
  86. package/dist/components/form/CopyButton/CopyButton.js +27 -26
  87. package/dist/components/form/DatePicker/DatePicker.cjs +1 -1
  88. package/dist/components/form/DatePicker/DatePicker.js +47 -46
  89. package/dist/components/form/DateRangePicker/DateRangePicker.cjs +1 -1
  90. package/dist/components/form/DateRangePicker/DateRangePicker.js +36 -35
  91. package/dist/components/form/Dropzone/Dropzone.cjs +1 -1
  92. package/dist/components/form/Dropzone/Dropzone.js +56 -55
  93. package/dist/components/form/FileUpload/FileUpload.cjs +1 -1
  94. package/dist/components/form/FileUpload/FileUpload.js +47 -46
  95. package/dist/components/form/FloatButton/FloatButton.cjs +1 -1
  96. package/dist/components/form/FloatButton/FloatButton.d.ts +4 -1
  97. package/dist/components/form/FloatButton/FloatButton.js +6 -6
  98. package/dist/components/form/ImageCropper/ImageCropper.cjs +1 -1
  99. package/dist/components/form/ImageCropper/ImageCropper.js +101 -99
  100. package/dist/components/form/InlineEdit/InlineEdit.cjs +1 -1
  101. package/dist/components/form/InlineEdit/InlineEdit.js +66 -65
  102. package/dist/components/form/Input/Input.cjs +1 -1
  103. package/dist/components/form/Input/Input.js +45 -44
  104. package/dist/components/form/InputBase/InputBase.cjs +1 -1
  105. package/dist/components/form/InputBase/InputBase.js +51 -50
  106. package/dist/components/form/InputBase/input-base.module.cjs +1 -1
  107. package/dist/components/form/InputBase/input-base.module.js +1 -1
  108. package/dist/components/form/MultiSelect/multiselect.module.cjs +1 -1
  109. package/dist/components/form/MultiSelect/multiselect.module.js +1 -1
  110. package/dist/components/form/PasswordStrength/PasswordStrength.cjs +1 -1
  111. package/dist/components/form/PasswordStrength/PasswordStrength.js +27 -26
  112. package/dist/components/form/PhoneInput/PhoneInput.cjs +1 -1
  113. package/dist/components/form/PhoneInput/PhoneInput.js +10 -10
  114. package/dist/components/form/QueryBuilder/QueryBuilder.cjs +1 -1
  115. package/dist/components/form/QueryBuilder/QueryBuilder.js +90 -89
  116. package/dist/components/form/RangeSlider/RangeSlider.cjs +1 -1
  117. package/dist/components/form/RangeSlider/RangeSlider.js +30 -29
  118. package/dist/components/form/RichTextEditor/RichTextEditor.cjs +1 -1
  119. package/dist/components/form/RichTextEditor/RichTextEditor.js +223 -222
  120. package/dist/components/form/SegmentedControl/SegmentedControl.cjs +1 -1
  121. package/dist/components/form/SegmentedControl/SegmentedControl.js +7 -7
  122. package/dist/components/form/Select/Select.cjs +1 -1
  123. package/dist/components/form/Select/Select.js +112 -111
  124. package/dist/components/form/SignaturePad/SignaturePad.cjs +1 -1
  125. package/dist/components/form/SignaturePad/SignaturePad.js +86 -79
  126. package/dist/components/form/SmartSearchInput/SmartSearchInput.cjs +1 -1
  127. package/dist/components/form/SmartSearchInput/SmartSearchInput.js +63 -62
  128. package/dist/components/form/TagInput/TagInput.cjs +1 -1
  129. package/dist/components/form/TagInput/TagInput.js +68 -67
  130. package/dist/components/form/ThemeToggle/ThemeToggle.cjs +1 -1
  131. package/dist/components/form/ThemeToggle/ThemeToggle.js +68 -67
  132. package/dist/components/form/ThemeToggle/theme-toggle.module.cjs +1 -1
  133. package/dist/components/form/ThemeToggle/theme-toggle.module.js +1 -1
  134. package/dist/components/form/ToggleGroup/ToggleGroup.cjs +1 -1
  135. package/dist/components/form/ToggleGroup/ToggleGroup.js +6 -6
  136. package/dist/components/form/Transfer/Transfer.cjs +1 -1
  137. package/dist/components/form/Transfer/Transfer.js +127 -126
  138. package/dist/components/form/TreeSelect/TreeSelect.cjs +1 -1
  139. package/dist/components/form/TreeSelect/TreeSelect.js +6 -6
  140. package/dist/components/layout/Dashboard/Dashboard.cjs +1 -1
  141. package/dist/components/layout/Dashboard/Dashboard.js +90 -89
  142. package/dist/components/layout/Navbar/Navbar.cjs +1 -1
  143. package/dist/components/layout/Navbar/Navbar.d.ts +1 -1
  144. package/dist/components/layout/Navbar/Navbar.js +1 -1
  145. package/dist/components/layout/Sidebar/Sidebar.d.ts +1 -1
  146. package/dist/components/layout/Splitter/Splitter.cjs +1 -1
  147. package/dist/components/layout/Splitter/Splitter.js +40 -39
  148. package/dist/components/layout/Toolbar/Toolbar.cjs +1 -1
  149. package/dist/components/layout/Toolbar/Toolbar.js +66 -39
  150. package/dist/components/media/Audio/Audio.cjs +1 -1
  151. package/dist/components/media/Audio/Audio.js +90 -89
  152. package/dist/components/media/Audio/components/AudioCustomControls.cjs +1 -1
  153. package/dist/components/media/Audio/components/AudioCustomControls.js +115 -114
  154. package/dist/components/media/Gallery/Gallery.cjs +1 -1
  155. package/dist/components/media/Gallery/Gallery.js +132 -131
  156. package/dist/components/media/ImageCompare/ImageCompare.cjs +1 -1
  157. package/dist/components/media/ImageCompare/ImageCompare.js +72 -71
  158. package/dist/components/media/Lightbox/Lightbox.cjs +1 -1
  159. package/dist/components/media/Lightbox/Lightbox.js +128 -127
  160. package/dist/components/media/Video/Video.cjs +1 -1
  161. package/dist/components/media/Video/Video.js +56 -55
  162. package/dist/components/media/Video/components/VideoAdvancedMenu.cjs +1 -1
  163. package/dist/components/media/Video/components/VideoAdvancedMenu.js +136 -135
  164. package/dist/components/media/Video/components/VideoControls.cjs +1 -1
  165. package/dist/components/media/Video/components/VideoControls.js +103 -102
  166. package/dist/components/navigation/BackTop/BackTop.cjs +1 -1
  167. package/dist/components/navigation/BackTop/BackTop.js +37 -36
  168. package/dist/components/navigation/Breadcrumb/Breadcrumb.cjs +1 -1
  169. package/dist/components/navigation/Breadcrumb/Breadcrumb.js +41 -40
  170. package/dist/components/navigation/CommandPalette/CommandPalette.cjs +1 -1
  171. package/dist/components/navigation/CommandPalette/CommandPalette.js +100 -99
  172. package/dist/components/navigation/HamburgerMenu/HamburgerMenu.cjs +1 -1
  173. package/dist/components/navigation/HamburgerMenu/HamburgerMenu.d.ts +6 -0
  174. package/dist/components/navigation/HamburgerMenu/HamburgerMenu.js +32 -22
  175. package/dist/components/navigation/Pagination/Pagination.cjs +1 -1
  176. package/dist/components/navigation/Pagination/Pagination.js +39 -38
  177. package/dist/components/navigation/SpeedDial/SpeedDial.cjs +1 -1
  178. package/dist/components/navigation/SpeedDial/SpeedDial.js +44 -43
  179. package/dist/components/overlay/ContextMenu/ContextMenu.cjs +1 -1
  180. package/dist/components/overlay/ContextMenu/ContextMenu.js +4 -4
  181. package/dist/components/overlay/Popover/Popover.cjs +1 -1
  182. package/dist/components/overlay/Popover/Popover.js +63 -62
  183. package/dist/components/typography/Spoiler/Spoiler.cjs +1 -1
  184. package/dist/components/typography/Spoiler/Spoiler.js +38 -37
  185. package/dist/i18n/generated/common.cjs +2 -0
  186. package/dist/i18n/generated/common.d.ts +3 -0
  187. package/dist/i18n/generated/common.js +570 -0
  188. package/dist/i18n/generated/components.cjs +2 -0
  189. package/dist/i18n/generated/components.d.ts +3 -0
  190. package/dist/i18n/generated/components.js +399 -0
  191. package/dist/i18n/generated/data-display.cjs +2 -0
  192. package/dist/i18n/generated/data-display.d.ts +3 -0
  193. package/dist/i18n/generated/data-display.js +12 -0
  194. package/dist/i18n/generated/form.cjs +2 -0
  195. package/dist/i18n/generated/form.d.ts +3 -0
  196. package/dist/i18n/generated/form.js +321 -0
  197. package/dist/i18n/generated/keys.d.ts +5 -1
  198. package/dist/i18n/generated/locales.cjs +2 -0
  199. package/dist/i18n/generated/locales.d.ts +1 -0
  200. package/dist/i18n/generated/locales.js +9 -0
  201. package/dist/i18n/instance.cjs +1 -1
  202. package/dist/i18n/instance.d.ts +18 -3
  203. package/dist/i18n/instance.js +24 -26
  204. package/dist/i18n/useWimTranslation.cjs +1 -1
  205. package/dist/i18n/useWimTranslation.d.ts +7 -8
  206. package/dist/i18n/useWimTranslation.js +6 -5
  207. package/dist/llms-full.txt +7 -3
  208. package/dist/llms.txt +1 -1
  209. package/dist/styles.css +1 -1
  210. package/dist/wimui.umd.css +1 -1
  211. package/dist/wimui.umd.js +5 -5
  212. package/package.json +10 -10
  213. package/dist/i18n/generated/resources.cjs +0 -2
  214. package/dist/i18n/generated/resources.d.ts +0 -4
  215. package/dist/i18n/generated/resources.js +0 -1283
@@ -2,83 +2,84 @@
2
2
  import { Root as e, Slottable as t } from "../../../node_modules/@radix-ui/react-slot/dist/index.js";
3
3
  import { getColorValue as n } from "../../../utilities/style-utils.js";
4
4
  import { useWimTranslation as r } from "../../../i18n/useWimTranslation.js";
5
- import i from "../../../icon/loading.js";
6
- import { Icon as a } from "../../media/Icon/Icon.js";
7
- import o from "./button.module.js";
8
- import { useMergedRef as s } from "../../../hooks/useMergedRef.js";
9
- import c from "react";
10
- import l from "classnames";
11
- import { jsx as u, jsxs as d } from "react/jsx-runtime";
5
+ import { commonNs as i } from "../../../i18n/generated/common.js";
6
+ import { useMergedRef as a } from "../../../hooks/useMergedRef.js";
7
+ import o from "../../../icon/loading.js";
8
+ import { Icon as s } from "../../media/Icon/Icon.js";
9
+ import c from "./button.module.js";
10
+ import l from "react";
11
+ import u from "classnames";
12
+ import { jsx as d, jsxs as f } from "react/jsx-runtime";
12
13
  //#region src/components/form/Button/Button.tsx
13
- var f = c.forwardRef(({ asChild: f = !1, size: p = "md", variant: m = "outline", intent: h = "default", icon: g, iconPosition: _ = "left", loading: v = !1, backgroundColor: y, justify: b = "center", animateWidth: x = !1, fullWidth: S = !1, styles: C, "aria-label": w, className: T, disabled: E, children: D, ...O }, k) => {
14
- let A = c.useRef(null), j = s(A, k), [M, N] = c.useState("auto"), P = c.useRef(!0);
15
- c.useLayoutEffect(() => {
16
- if (!x || !A.current) return;
17
- if (P.current) {
18
- P.current = !1;
14
+ var p = l.forwardRef(({ asChild: p = !1, size: m = "md", variant: h = "outline", intent: g = "default", icon: _, iconPosition: v = "left", loading: y = !1, backgroundColor: b, justify: x = "center", animateWidth: S = !1, fullWidth: C = !1, styles: w, "aria-label": T, className: E, disabled: D, children: O, ...k }, A) => {
15
+ let j = l.useRef(null), M = a(j, A), [N, P] = l.useState("auto"), F = l.useRef(!0);
16
+ l.useLayoutEffect(() => {
17
+ if (!S || !j.current) return;
18
+ if (F.current) {
19
+ F.current = !1;
19
20
  return;
20
21
  }
21
- let e = A.current, t = e.getBoundingClientRect().width;
22
- N(t);
22
+ let e = j.current, t = e.getBoundingClientRect().width;
23
+ P(t);
23
24
  let n = e.style.width, r = e.style.minWidth;
24
25
  e.style.width = "auto", e.style.minWidth = "0";
25
26
  let i = Math.ceil(e.getBoundingClientRect().width) + 2;
26
27
  e.style.width = n, e.style.minWidth = r;
27
28
  let a = requestAnimationFrame(() => {
28
- N(i);
29
+ P(i);
29
30
  });
30
31
  return () => cancelAnimationFrame(a);
31
- }, [D, x]);
32
- let { t: F } = r("common"), I = E, L;
33
- typeof w == "string" ? L = w : w !== !1 && (!D && typeof g == "string" ? L = g : v && (L = F("a11y.loading")));
34
- let R = b === "start" ? "flex-start" : b === "end" ? "flex-end" : b === "between" ? "space-between" : b, z = v ? /* @__PURE__ */ u("span", {
35
- className: l(o.loader, C?.loader),
36
- children: /* @__PURE__ */ u(a, {
37
- component: i,
32
+ }, [O, S]);
33
+ let { t: I } = r(i), L = D, R;
34
+ typeof T == "string" ? R = T : T !== !1 && (!O && typeof _ == "string" ? R = _ : y && (R = I("a11y.loading")));
35
+ let z = x === "start" ? "flex-start" : x === "end" ? "flex-end" : x === "between" ? "space-between" : x, B = y ? /* @__PURE__ */ d("span", {
36
+ className: u(c.loader, w?.loader),
37
+ children: /* @__PURE__ */ d(s, {
38
+ component: o,
38
39
  spin: !0,
39
- size: p
40
+ size: m
40
41
  })
41
- }) : g ? typeof g == "string" ? /* @__PURE__ */ u(a, {
42
- name: g,
43
- size: p,
44
- className: C?.icon
45
- }) : g : null;
46
- return /* @__PURE__ */ d(f ? e : "button", {
47
- ref: j,
48
- type: f ? void 0 : "button",
42
+ }) : _ ? typeof _ == "string" ? /* @__PURE__ */ d(s, {
43
+ name: _,
44
+ size: m,
45
+ className: w?.icon
46
+ }) : _ : null;
47
+ return /* @__PURE__ */ f(p ? e : "button", {
48
+ ref: M,
49
+ type: p ? void 0 : "button",
49
50
  style: {
50
- ...O.style,
51
- justifyContent: R,
52
- ...y ? { backgroundColor: n(y) } : {},
53
- ...x && M !== "auto" ? {
54
- width: `${M}px`,
55
- transitionProperty: O.style?.transitionProperty || "width, background-color, border-color, box-shadow, transform",
56
- transitionDuration: O.style?.transitionDuration || "var(--wim-duration-base)",
57
- transitionTimingFunction: O.style?.transitionTimingFunction || "var(--wim-easing-standard)",
51
+ ...k.style,
52
+ justifyContent: z,
53
+ ...b ? { backgroundColor: n(b) } : {},
54
+ ...S && N !== "auto" ? {
55
+ width: `${N}px`,
56
+ transitionProperty: k.style?.transitionProperty || "width, background-color, border-color, box-shadow, transform",
57
+ transitionDuration: k.style?.transitionDuration || "var(--wim-duration-base)",
58
+ transitionTimingFunction: k.style?.transitionTimingFunction || "var(--wim-easing-standard)",
58
59
  overflow: "hidden",
59
60
  whiteSpace: "nowrap",
60
61
  textOverflow: "clip"
61
62
  } : {}
62
63
  },
63
- className: l("wim-button", o.root, o[p], o[m], o[h], v && o.loading, x && o.animatedWidth, S && o.fullWidth, !D && !!g && o.iconOnly, T, C?.root),
64
- disabled: (I || v) && !f ? !0 : void 0,
65
- "aria-label": L,
66
- "aria-busy": v || void 0,
67
- ...f ? O : { ...O },
64
+ className: u("wim-button", c.root, c[m], c[h], c[g], y && c.loading, S && c.animatedWidth, C && c.fullWidth, !O && !!_ && c.iconOnly, E, w?.root),
65
+ disabled: (L || y) && !p ? !0 : void 0,
66
+ "aria-label": R,
67
+ "aria-busy": y || void 0,
68
+ ...p ? k : { ...k },
68
69
  children: [
69
- f && z && _ === "left" ? z : null,
70
- f ? /* @__PURE__ */ u(t, { children: D }) : /* @__PURE__ */ d("span", {
71
- className: o.content,
70
+ p && B && v === "left" ? B : null,
71
+ p ? /* @__PURE__ */ d(t, { children: O }) : /* @__PURE__ */ f("span", {
72
+ className: c.content,
72
73
  children: [
73
- z && _ === "left" && z,
74
- D,
75
- z && _ === "right" && z
74
+ B && v === "left" && B,
75
+ O,
76
+ B && v === "right" && B
76
77
  ]
77
78
  }),
78
- f && z && _ === "right" ? z : null
79
+ p && B && v === "right" ? B : null
79
80
  ]
80
81
  });
81
82
  });
82
- f.displayName = "Button";
83
+ p.displayName = "Button";
83
84
  //#endregion
84
- export { f as Button };
85
+ export { p as Button };
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../Input/Input.cjs"),r=require("./color-input.module.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("classnames");a=e.__toESM(a,1);let o=require("react/jsx-runtime");var s=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i,c=e=>e.length===4?`#${e.slice(1).split(``).map(e=>e+e).join(``)}`:e,l=({className:e,value:l,defaultValue:u,onChange:d,style:f,...p})=>{let{t:m}=t.useWimTranslation(`components`),[h,g]=(0,i.useState)(()=>u??`#000000`),_=l!==void 0,v=_?l:h,[y,b]=(0,i.useState)(v),[x,S]=(0,i.useState)(v);v!==x&&(S(v),b(v));let C=(0,i.useCallback)((e,t)=>{_||g(e),d?.(t)},[_,d]),w=(0,i.useCallback)(e=>{let t=e.target.value;b(t),s.test(t.trim())&&C(t.trim(),e)},[C]),T=(0,i.useCallback)(e=>{b(e.target.value),C(e.target.value,e)},[C]),E=s.test(v)?c(v).toLowerCase():`#000000`;return(0,o.jsx)(n.Input,{type:`text`,className:(0,a.default)(`wim-color-input`,r.default.root,e),value:y,onChange:w,style:f,spellCheck:!1,autoCapitalize:`none`,autoCorrect:`off`,inputClassName:r.default.input,suffix:(0,o.jsx)(`input`,{type:`color`,className:r.default.swatch,value:E,onChange:T,disabled:p.disabled,"aria-label":m(`colorinput.swatch`),tabIndex:-1}),...p})};exports.ColorInput=l;
2
+ const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../../../i18n/generated/components.cjs"),r=require("../Input/Input.cjs"),i=require("./color-input.module.cjs");let a=require("react");a=e.__toESM(a,1);let o=require("classnames");o=e.__toESM(o,1);let s=require("react/jsx-runtime");var c=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i,l=e=>e.length===4?`#${e.slice(1).split(``).map(e=>e+e).join(``)}`:e,u=({className:e,value:u,defaultValue:d,onChange:f,style:p,...m})=>{let{t:h}=t.useWimTranslation(n.componentsNs),[g,_]=(0,a.useState)(()=>d??`#000000`),v=u!==void 0,y=v?u:g,[b,x]=(0,a.useState)(y),[S,C]=(0,a.useState)(y);y!==S&&(C(y),x(y));let w=(0,a.useCallback)((e,t)=>{v||_(e),f?.(t)},[v,f]),T=(0,a.useCallback)(e=>{let t=e.target.value;x(t),c.test(t.trim())&&w(t.trim(),e)},[w]),E=(0,a.useCallback)(e=>{x(e.target.value),w(e.target.value,e)},[w]),D=c.test(y)?l(y).toLowerCase():`#000000`;return(0,s.jsx)(r.Input,{type:`text`,className:(0,o.default)(`wim-color-input`,i.default.root,e),value:b,onChange:T,style:p,spellCheck:!1,autoCapitalize:`none`,autoCorrect:`off`,inputClassName:i.default.input,suffix:(0,s.jsx)(`input`,{type:`color`,className:i.default.swatch,value:D,onChange:E,disabled:m.disabled,"aria-label":h(`colorinput.swatch`),tabIndex:-1}),...m})};exports.ColorInput=u;
@@ -1,43 +1,44 @@
1
1
  "use client";
2
2
  import { useWimTranslation as e } from "../../../i18n/useWimTranslation.js";
3
- import { Input as t } from "../Input/Input.js";
4
- import n from "./color-input.module.js";
5
- import { useCallback as r, useState as i } from "react";
6
- import a from "classnames";
7
- import { jsx as o } from "react/jsx-runtime";
3
+ import { componentsNs as t } from "../../../i18n/generated/components.js";
4
+ import { Input as n } from "../Input/Input.js";
5
+ import r from "./color-input.module.js";
6
+ import { useCallback as i, useState as a } from "react";
7
+ import o from "classnames";
8
+ import { jsx as s } from "react/jsx-runtime";
8
9
  //#region src/components/form/ColorInput/ColorInput.tsx
9
- var s = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i, c = (e) => e.length === 4 ? `#${e.slice(1).split("").map((e) => e + e).join("")}` : e, l = ({ className: l, value: u, defaultValue: d, onChange: f, style: p, ...m }) => {
10
- let { t: h } = e("components"), [g, _] = i(() => d ?? "#000000"), v = u !== void 0, y = v ? u : g, [b, x] = i(y), [S, C] = i(y);
11
- y !== S && (C(y), x(y));
12
- let w = r((e, t) => {
13
- v || _(e), f?.(t);
14
- }, [v, f]), T = r((e) => {
10
+ var c = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i, l = (e) => e.length === 4 ? `#${e.slice(1).split("").map((e) => e + e).join("")}` : e, u = ({ className: u, value: d, defaultValue: f, onChange: p, style: m, ...h }) => {
11
+ let { t: g } = e(t), [_, v] = a(() => f ?? "#000000"), y = d !== void 0, b = y ? d : _, [x, S] = a(b), [C, w] = a(b);
12
+ b !== C && (w(b), S(b));
13
+ let T = i((e, t) => {
14
+ y || v(e), p?.(t);
15
+ }, [y, p]), E = i((e) => {
15
16
  let t = e.target.value;
16
- x(t), s.test(t.trim()) && w(t.trim(), e);
17
- }, [w]), E = r((e) => {
18
- x(e.target.value), w(e.target.value, e);
19
- }, [w]), D = s.test(y) ? c(y).toLowerCase() : "#000000";
20
- return /* @__PURE__ */ o(t, {
17
+ S(t), c.test(t.trim()) && T(t.trim(), e);
18
+ }, [T]), D = i((e) => {
19
+ S(e.target.value), T(e.target.value, e);
20
+ }, [T]), O = c.test(b) ? l(b).toLowerCase() : "#000000";
21
+ return /* @__PURE__ */ s(n, {
21
22
  type: "text",
22
- className: a("wim-color-input", n.root, l),
23
- value: b,
24
- onChange: T,
25
- style: p,
23
+ className: o("wim-color-input", r.root, u),
24
+ value: x,
25
+ onChange: E,
26
+ style: m,
26
27
  spellCheck: !1,
27
28
  autoCapitalize: "none",
28
29
  autoCorrect: "off",
29
- inputClassName: n.input,
30
- suffix: /* @__PURE__ */ o("input", {
30
+ inputClassName: r.input,
31
+ suffix: /* @__PURE__ */ s("input", {
31
32
  type: "color",
32
- className: n.swatch,
33
- value: D,
34
- onChange: E,
35
- disabled: m.disabled,
36
- "aria-label": h("colorinput.swatch"),
33
+ className: r.swatch,
34
+ value: O,
35
+ onChange: D,
36
+ disabled: h.disabled,
37
+ "aria-label": g("colorinput.swatch"),
37
38
  tabIndex: -1
38
39
  }),
39
- ...m
40
+ ...h
40
41
  });
41
42
  };
42
43
  //#endregion
43
- export { l as ColorInput };
44
+ export { u as ColorInput };
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- var e=`_input_141wr_2`,t={input:e};exports.default=t,exports.input=e;
2
+ var e=`_input_l9j6d_3`,t={input:e};exports.default=t,exports.input=e;
@@ -1,5 +1,5 @@
1
1
  "use client";
2
2
  //#region src/components/form/ColorPicker/color-picker.module.scss
3
- var e = "_input_141wr_2", t = { input: e };
3
+ var e = "_input_l9j6d_3", t = { input: e };
4
4
  //#endregion
5
5
  export { t as default, e as input };
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../Button/Button.cjs"),r=require("../../overlay/Tooltip/Tooltip.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("classnames");a=e.__toESM(a,1);let o=require("react/jsx-runtime");var s=({value:e,size:s=`md`,className:c,"aria-label":l,copyLabel:u,copiedLabel:d,asChild:f=!1,children:p})=>{let{t:m}=t.useWimTranslation(`common`),[h,g]=(0,i.useState)(!1);(0,i.useEffect)(()=>{if(h){let e=setTimeout(()=>{g(!1)},2e3);return()=>clearTimeout(e)}},[h]);let _=async()=>{try{await navigator.clipboard.writeText(e),g(!0)}catch{}},v=h?d??m(`copied`):u??m(`copy.to_clipboard`);return(0,o.jsxs)(r.Tooltip,{children:[(0,o.jsx)(r.TooltipTrigger,{asChild:!0,children:(0,o.jsx)(n.Button,{asChild:f,variant:`ghost`,size:s,icon:f?void 0:h?`CheckIcon`:`CopyIcon`,intent:h?`success`:`default`,onClick:_,className:(0,a.default)(`wim-copy-button`,c),"aria-label":l||v,children:f?p:void 0})}),(0,o.jsx)(r.TooltipContent,{children:v})]})};exports.CopyButton=s;
2
+ const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../../../i18n/generated/common.cjs"),r=require("../Button/Button.cjs"),i=require("../../overlay/Tooltip/Tooltip.cjs");let a=require("react");a=e.__toESM(a,1);let o=require("classnames");o=e.__toESM(o,1);let s=require("react/jsx-runtime");var c=({value:e,size:c=`md`,className:l,"aria-label":u,copyLabel:d,copiedLabel:f,asChild:p=!1,children:m})=>{let{t:h}=t.useWimTranslation(n.commonNs),[g,_]=(0,a.useState)(!1);(0,a.useEffect)(()=>{if(g){let e=setTimeout(()=>{_(!1)},2e3);return()=>clearTimeout(e)}},[g]);let v=async()=>{try{await navigator.clipboard.writeText(e),_(!0)}catch{}},y=g?f??h(`copied`):d??h(`copy.to_clipboard`);return(0,s.jsxs)(i.Tooltip,{children:[(0,s.jsx)(i.TooltipTrigger,{asChild:!0,children:(0,s.jsx)(r.Button,{asChild:p,variant:`ghost`,size:c,icon:p?void 0:g?`CheckIcon`:`CopyIcon`,intent:g?`success`:`default`,onClick:v,className:(0,o.default)(`wim-copy-button`,l),"aria-label":u||y,children:p?m:void 0})}),(0,s.jsx)(i.TooltipContent,{children:y})]})};exports.CopyButton=c;
@@ -1,40 +1,41 @@
1
1
  "use client";
2
2
  import { useWimTranslation as e } from "../../../i18n/useWimTranslation.js";
3
- import { Button as t } from "../Button/Button.js";
4
- import { Tooltip as n, TooltipContent as r, TooltipTrigger as i } from "../../overlay/Tooltip/Tooltip.js";
5
- import { useEffect as a, useState as o } from "react";
6
- import s from "classnames";
7
- import { jsx as c, jsxs as l } from "react/jsx-runtime";
3
+ import { commonNs as t } from "../../../i18n/generated/common.js";
4
+ import { Button as n } from "../Button/Button.js";
5
+ import { Tooltip as r, TooltipContent as i, TooltipTrigger as a } from "../../overlay/Tooltip/Tooltip.js";
6
+ import { useEffect as o, useState as s } from "react";
7
+ import c from "classnames";
8
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
8
9
  //#region src/components/form/CopyButton/CopyButton.tsx
9
- var u = ({ value: u, size: d = "md", className: f, "aria-label": p, copyLabel: m, copiedLabel: h, asChild: g = !1, children: _ }) => {
10
- let { t: v } = e("common"), [y, b] = o(!1);
11
- a(() => {
12
- if (y) {
10
+ var d = ({ value: d, size: f = "md", className: p, "aria-label": m, copyLabel: h, copiedLabel: g, asChild: _ = !1, children: v }) => {
11
+ let { t: y } = e(t), [b, x] = s(!1);
12
+ o(() => {
13
+ if (b) {
13
14
  let e = setTimeout(() => {
14
- b(!1);
15
+ x(!1);
15
16
  }, 2e3);
16
17
  return () => clearTimeout(e);
17
18
  }
18
- }, [y]);
19
- let x = async () => {
19
+ }, [b]);
20
+ let S = async () => {
20
21
  try {
21
- await navigator.clipboard.writeText(u), b(!0);
22
+ await navigator.clipboard.writeText(d), x(!0);
22
23
  } catch {}
23
- }, S = y ? h ?? v("copied") : m ?? v("copy.to_clipboard");
24
- return /* @__PURE__ */ l(n, { children: [/* @__PURE__ */ c(i, {
24
+ }, C = b ? g ?? y("copied") : h ?? y("copy.to_clipboard");
25
+ return /* @__PURE__ */ u(r, { children: [/* @__PURE__ */ l(a, {
25
26
  asChild: !0,
26
- children: /* @__PURE__ */ c(t, {
27
- asChild: g,
27
+ children: /* @__PURE__ */ l(n, {
28
+ asChild: _,
28
29
  variant: "ghost",
29
- size: d,
30
- icon: g ? void 0 : y ? "CheckIcon" : "CopyIcon",
31
- intent: y ? "success" : "default",
32
- onClick: x,
33
- className: s("wim-copy-button", f),
34
- "aria-label": p || S,
35
- children: g ? _ : void 0
30
+ size: f,
31
+ icon: _ ? void 0 : b ? "CheckIcon" : "CopyIcon",
32
+ intent: b ? "success" : "default",
33
+ onClick: S,
34
+ className: c("wim-copy-button", p),
35
+ "aria-label": m || C,
36
+ children: _ ? v : void 0
36
37
  })
37
- }), /* @__PURE__ */ c(r, { children: S })] });
38
+ }), /* @__PURE__ */ l(i, { children: C })] });
38
39
  };
39
40
  //#endregion
40
- export { u as CopyButton };
41
+ export { d as CopyButton };
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/@radix-ui/react-slot/dist/index.cjs"),n=require("../../../i18n/useWimTranslation.cjs"),r=require("../../layout/Transition/Transition.cjs"),i=require("../../overlay/FocusTrap/FocusTrap.cjs"),a=require("../InputBase/InputBase.cjs"),o=require("../FieldTemplate/FieldTemplate.cjs"),s=require("../Input/input.module.cjs"),c=require("../../data-display/Calendar/Calendar.cjs"),l=require("../../_internal/mergeRefs.cjs"),u=require("./date-picker.module.cjs");let d=require("react");d=e.__toESM(d,1);let f=require("classnames");f=e.__toESM(f,1);let p=require("react/jsx-runtime");var m=(0,d.forwardRef)(({intent:e=`default`,variant:m=`outline`,fullWidth:h=!1,className:g,disabled:_,value:v,defaultValue:y,onChange:b,format:x=`YYYY-MM-DD`,clearable:S=!0,placeholder:C,minDate:ee,maxDate:te,disabledDates:ne,label:w,error:T,required:E,layout:D,id:re,labels:O,width:k,asChild:A=!1,children:j,...M},N)=>{let[P,F]=(0,d.useState)(!1),[I,L]=(0,d.useState)(y||null),R=(0,d.useRef)(null),z=(0,d.useRef)(null),B=l.mergeRefs(R,N),{t:V}=n.useWimTranslation(`components`),H=(0,d.useId)(),U=re||`wim-datepicker-${H}`,W=`${U}-dropdown`,G=w?`${U}-label`:void 0,K=T?`${U}-error`:void 0,q=v!==void 0,J=q?v:I,Y=C??O?.placeholder,X=_,Z=T?`danger`:e;(0,d.useEffect)(()=>{let e=e=>{R.current&&!R.current.contains(e.target)&&F(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[]),(0,d.useEffect)(()=>{let e=e=>{e.key===`Escape`&&P&&(F(!1),z.current?.focus())};return P&&document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[P]);let Q=e=>{if(!e)return``;let t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,`0`),r=String(e.getDate()).padStart(2,`0`);return x.replace(`YYYY`,String(t)).replace(`MM`,n).replace(`DD`,r)},ie=e=>{q||L(e),b?.(e),F(!1),z.current?.focus()},ae=e=>{e?.stopPropagation(),X||(q||L(null),b?.(null))},$=()=>{X||F(!P)};return(0,d.useEffect)(()=>{if(P){let e=setTimeout(()=>{let e=R.current?.querySelector(`[data-calendar-day][tabindex="0"]:not(:disabled), [data-calendar-day][data-selected]:not(:disabled), [data-calendar-day]:focus`);e?e.focus():R.current?.querySelector(`[data-calendar-day]:not([data-other-month]):not(:disabled)`)?.focus()},50);return()=>clearTimeout(e)}},[P]),(0,p.jsx)(o.FieldTemplate,{label:w,error:T,required:E,layout:D,labelId:G,htmlFor:U,errorId:K,className:g,children:(0,p.jsxs)(A?t.Root:`div`,{ref:B,className:(0,f.default)(`wim-date-picker`,u.default.root,h&&u.default.fullWidth),children:[(0,p.jsxs)(t.Slottable,{children:[(0,p.jsx)(a.InputBase,{intent:Z,variant:m,width:k,fullWidth:h,disabled:X,allowClear:S,hasValue:!!J,onClear:ae,rightIcons:[{name:`ChevronDownIcon`,rotated:P,onClick:$,decorative:!0}],children:(0,p.jsx)(`input`,{id:U,ref:z,type:`text`,readOnly:!0,role:`combobox`,className:(0,f.default)(s.default.root,u.default.input),value:Q(J),placeholder:Y,disabled:X,onClick:$,onKeyDown:e=>{X||(e.key===`Escape`?(F(!1),z.current?.focus()):(e.key===`Enter`||e.key===` `||e.key===`ArrowDown`&&(e.altKey||!P))&&(e.preventDefault(),F(!P)))},"aria-haspopup":`dialog`,"aria-expanded":P,"aria-controls":P?W:void 0,"aria-invalid":Z===`danger`,"aria-describedby":K,"aria-labelledby":G,"aria-required":E,...M})}),(0,p.jsx)(r.Transition,{show:P&&!_,preset:`fade`,id:W,className:u.default.dropdown,children:(0,p.jsx)(i.FocusTrap,{active:P,initialFocus:!1,children:(0,p.jsx)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-labelledby":G,"aria-label":G?void 0:M[`aria-label`]??V(`datepicker.dialog`),children:(0,p.jsx)(c.Calendar,{value:J??void 0,onChange:ie})})})})]}),j]})})});m.displayName=`DatePicker`,exports.DatePicker=m,exports.default=m;
2
+ const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/@radix-ui/react-slot/dist/index.cjs"),n=require("../../../i18n/useWimTranslation.cjs"),r=require("../../layout/Transition/Transition.cjs"),i=require("../../overlay/FocusTrap/FocusTrap.cjs"),a=require("../../../i18n/generated/components.cjs"),o=require("../InputBase/InputBase.cjs"),s=require("../FieldTemplate/FieldTemplate.cjs"),c=require("../Input/input.module.cjs"),l=require("../../data-display/Calendar/Calendar.cjs"),u=require("../../_internal/mergeRefs.cjs"),d=require("./date-picker.module.cjs");let f=require("react");f=e.__toESM(f,1);let p=require("classnames");p=e.__toESM(p,1);let m=require("react/jsx-runtime");var h=(0,f.forwardRef)(({intent:e=`default`,variant:h=`outline`,fullWidth:g=!1,className:_,disabled:v,value:y,defaultValue:b,onChange:x,format:ee=`YYYY-MM-DD`,clearable:S=!0,placeholder:C,minDate:te,maxDate:ne,disabledDates:re,label:w,error:T,required:E,layout:D,id:O,labels:k,width:A,asChild:j=!1,children:M,...N},P)=>{let[F,I]=(0,f.useState)(!1),[L,R]=(0,f.useState)(b||null),z=(0,f.useRef)(null),B=(0,f.useRef)(null),V=u.mergeRefs(z,P),{t:H}=n.useWimTranslation(a.componentsNs),U=(0,f.useId)(),W=O||`wim-datepicker-${U}`,G=`${W}-dropdown`,K=w?`${W}-label`:void 0,q=T?`${W}-error`:void 0,J=y!==void 0,Y=J?y:L,X=C??k?.placeholder,Z=v,Q=T?`danger`:e;(0,f.useEffect)(()=>{let e=e=>{z.current&&!z.current.contains(e.target)&&I(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[]),(0,f.useEffect)(()=>{let e=e=>{e.key===`Escape`&&F&&(I(!1),B.current?.focus())};return F&&document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[F]);let ie=e=>{if(!e)return``;let t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,`0`),r=String(e.getDate()).padStart(2,`0`);return ee.replace(`YYYY`,String(t)).replace(`MM`,n).replace(`DD`,r)},ae=e=>{J||R(e),x?.(e),I(!1),B.current?.focus()},oe=e=>{e?.stopPropagation(),Z||(J||R(null),x?.(null))},$=()=>{Z||I(!F)};return(0,f.useEffect)(()=>{if(F){let e=setTimeout(()=>{let e=z.current?.querySelector(`[data-calendar-day][tabindex="0"]:not(:disabled), [data-calendar-day][data-selected]:not(:disabled), [data-calendar-day]:focus`);e?e.focus():z.current?.querySelector(`[data-calendar-day]:not([data-other-month]):not(:disabled)`)?.focus()},50);return()=>clearTimeout(e)}},[F]),(0,m.jsx)(s.FieldTemplate,{label:w,error:T,required:E,layout:D,labelId:K,htmlFor:W,errorId:q,className:_,children:(0,m.jsxs)(j?t.Root:`div`,{ref:V,className:(0,p.default)(`wim-date-picker`,d.default.root,g&&d.default.fullWidth),children:[(0,m.jsxs)(t.Slottable,{children:[(0,m.jsx)(o.InputBase,{intent:Q,variant:h,width:A,fullWidth:g,disabled:Z,allowClear:S,hasValue:!!Y,onClear:oe,rightIcons:[{name:`ChevronDownIcon`,rotated:F,onClick:$,decorative:!0}],children:(0,m.jsx)(`input`,{id:W,ref:B,type:`text`,readOnly:!0,role:`combobox`,className:(0,p.default)(c.default.root,d.default.input),value:ie(Y),placeholder:X,disabled:Z,onClick:$,onKeyDown:e=>{Z||(e.key===`Escape`?(I(!1),B.current?.focus()):(e.key===`Enter`||e.key===` `||e.key===`ArrowDown`&&(e.altKey||!F))&&(e.preventDefault(),I(!F)))},"aria-haspopup":`dialog`,"aria-expanded":F,"aria-controls":F?G:void 0,"aria-invalid":Q===`danger`,"aria-describedby":q,"aria-labelledby":K,"aria-required":E,...N})}),(0,m.jsx)(r.Transition,{show:F&&!v,preset:`fade`,id:G,className:d.default.dropdown,children:(0,m.jsx)(i.FocusTrap,{active:F,initialFocus:!1,children:(0,m.jsx)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-labelledby":K,"aria-label":K?void 0:N[`aria-label`]??H(`datepicker.dialog`),children:(0,m.jsx)(l.Calendar,{value:Y??void 0,onChange:ae})})})})]}),M]})})});h.displayName=`DatePicker`,exports.DatePicker=h,exports.default=h;
@@ -3,41 +3,42 @@ import { Root as e, Slottable as t } from "../../../node_modules/@radix-ui/react
3
3
  import { useWimTranslation as n } from "../../../i18n/useWimTranslation.js";
4
4
  import { Transition as r } from "../../layout/Transition/Transition.js";
5
5
  import { FocusTrap as ee } from "../../overlay/FocusTrap/FocusTrap.js";
6
- import { InputBase as te } from "../InputBase/InputBase.js";
7
- import { FieldTemplate as ne } from "../FieldTemplate/FieldTemplate.js";
8
- import i from "../Input/input.module.js";
9
- import { Calendar as a } from "../../data-display/Calendar/Calendar.js";
10
- import { mergeRefs as o } from "../../_internal/mergeRefs.js";
11
- import s from "./date-picker.module.js";
12
- import { forwardRef as c, useEffect as l, useId as u, useRef as d, useState as f } from "react";
13
- import p from "classnames";
14
- import { jsx as m, jsxs as h } from "react/jsx-runtime";
6
+ import { componentsNs as i } from "../../../i18n/generated/components.js";
7
+ import { InputBase as a } from "../InputBase/InputBase.js";
8
+ import { FieldTemplate as o } from "../FieldTemplate/FieldTemplate.js";
9
+ import s from "../Input/input.module.js";
10
+ import { Calendar as te } from "../../data-display/Calendar/Calendar.js";
11
+ import { mergeRefs as ne } from "../../_internal/mergeRefs.js";
12
+ import c from "./date-picker.module.js";
13
+ import { forwardRef as l, useEffect as u, useId as d, useRef as f, useState as p } from "react";
14
+ import m from "classnames";
15
+ import { jsx as h, jsxs as g } from "react/jsx-runtime";
15
16
  //#region src/components/form/DatePicker/DatePicker.tsx
16
- var g = c(({ intent: c = "default", variant: g = "outline", fullWidth: _ = !1, className: v, disabled: y, value: b, defaultValue: x, onChange: S, format: C = "YYYY-MM-DD", clearable: w = !0, placeholder: T, minDate: re, maxDate: ie, disabledDates: ae, label: E, error: D, required: O, layout: oe, id: k, labels: A, width: j, asChild: M = !1, children: N, ...P }, F) => {
17
- let [I, L] = f(!1), [R, z] = f(x || null), B = d(null), V = d(null), H = o(B, F), { t: U } = n("components"), W = u(), G = k || `wim-datepicker-${W}`, K = `${G}-dropdown`, q = E ? `${G}-label` : void 0, J = D ? `${G}-error` : void 0, Y = b !== void 0, X = Y ? b : R, se = T ?? A?.placeholder, Z = y, Q = D ? "danger" : c;
18
- l(() => {
17
+ var _ = l(({ intent: l = "default", variant: _ = "outline", fullWidth: v = !1, className: y, disabled: b, value: x, defaultValue: S, onChange: C, format: w = "YYYY-MM-DD", clearable: re = !0, placeholder: ie, minDate: ae, maxDate: oe, disabledDates: se, label: T, error: E, required: D, layout: O, id: k, labels: A, width: j, asChild: M = !1, children: N, ...P }, F) => {
18
+ let [I, L] = p(!1), [R, z] = p(S || null), B = f(null), V = f(null), H = ne(B, F), { t: U } = n(i), W = d(), G = k || `wim-datepicker-${W}`, K = `${G}-dropdown`, q = T ? `${G}-label` : void 0, J = E ? `${G}-error` : void 0, Y = x !== void 0, X = Y ? x : R, ce = ie ?? A?.placeholder, Z = b, Q = E ? "danger" : l;
19
+ u(() => {
19
20
  let e = (e) => {
20
21
  B.current && !B.current.contains(e.target) && L(!1);
21
22
  };
22
23
  return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
23
- }, []), l(() => {
24
+ }, []), u(() => {
24
25
  let e = (e) => {
25
26
  e.key === "Escape" && I && (L(!1), V.current?.focus());
26
27
  };
27
28
  return I && document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
28
29
  }, [I]);
29
- let ce = (e) => {
30
+ let le = (e) => {
30
31
  if (!e) return "";
31
32
  let t = e.getFullYear(), n = String(e.getMonth() + 1).padStart(2, "0"), r = String(e.getDate()).padStart(2, "0");
32
- return C.replace("YYYY", String(t)).replace("MM", n).replace("DD", r);
33
- }, le = (e) => {
34
- Y || z(e), S?.(e), L(!1), V.current?.focus();
33
+ return w.replace("YYYY", String(t)).replace("MM", n).replace("DD", r);
35
34
  }, ue = (e) => {
36
- e?.stopPropagation(), Z || (Y || z(null), S?.(null));
35
+ Y || z(e), C?.(e), L(!1), V.current?.focus();
36
+ }, de = (e) => {
37
+ e?.stopPropagation(), Z || (Y || z(null), C?.(null));
37
38
  }, $ = () => {
38
39
  Z || L(!I);
39
40
  };
40
- return l(() => {
41
+ return u(() => {
41
42
  if (I) {
42
43
  let e = setTimeout(() => {
43
44
  let e = B.current?.querySelector("[data-calendar-day][tabindex=\"0\"]:not(:disabled), [data-calendar-day][data-selected]:not(:disabled), [data-calendar-day]:focus");
@@ -45,42 +46,42 @@ var g = c(({ intent: c = "default", variant: g = "outline", fullWidth: _ = !1, c
45
46
  }, 50);
46
47
  return () => clearTimeout(e);
47
48
  }
48
- }, [I]), /* @__PURE__ */ m(ne, {
49
- label: E,
50
- error: D,
51
- required: O,
52
- layout: oe,
49
+ }, [I]), /* @__PURE__ */ h(o, {
50
+ label: T,
51
+ error: E,
52
+ required: D,
53
+ layout: O,
53
54
  labelId: q,
54
55
  htmlFor: G,
55
56
  errorId: J,
56
- className: v,
57
- children: /* @__PURE__ */ h(M ? e : "div", {
57
+ className: y,
58
+ children: /* @__PURE__ */ g(M ? e : "div", {
58
59
  ref: H,
59
- className: p("wim-date-picker", s.root, _ && s.fullWidth),
60
- children: [/* @__PURE__ */ h(t, { children: [/* @__PURE__ */ m(te, {
60
+ className: m("wim-date-picker", c.root, v && c.fullWidth),
61
+ children: [/* @__PURE__ */ g(t, { children: [/* @__PURE__ */ h(a, {
61
62
  intent: Q,
62
- variant: g,
63
+ variant: _,
63
64
  width: j,
64
- fullWidth: _,
65
+ fullWidth: v,
65
66
  disabled: Z,
66
- allowClear: w,
67
+ allowClear: re,
67
68
  hasValue: !!X,
68
- onClear: ue,
69
+ onClear: de,
69
70
  rightIcons: [{
70
71
  name: "ChevronDownIcon",
71
72
  rotated: I,
72
73
  onClick: $,
73
74
  decorative: !0
74
75
  }],
75
- children: /* @__PURE__ */ m("input", {
76
+ children: /* @__PURE__ */ h("input", {
76
77
  id: G,
77
78
  ref: V,
78
79
  type: "text",
79
80
  readOnly: !0,
80
81
  role: "combobox",
81
- className: p(i.root, s.input),
82
- value: ce(X),
83
- placeholder: se,
82
+ className: m(s.root, c.input),
83
+ value: le(X),
84
+ placeholder: ce,
84
85
  disabled: Z,
85
86
  onClick: $,
86
87
  onKeyDown: (e) => {
@@ -92,25 +93,25 @@ var g = c(({ intent: c = "default", variant: g = "outline", fullWidth: _ = !1, c
92
93
  "aria-invalid": Q === "danger",
93
94
  "aria-describedby": J,
94
95
  "aria-labelledby": q,
95
- "aria-required": O,
96
+ "aria-required": D,
96
97
  ...P
97
98
  })
98
- }), /* @__PURE__ */ m(r, {
99
- show: I && !y,
99
+ }), /* @__PURE__ */ h(r, {
100
+ show: I && !b,
100
101
  preset: "fade",
101
102
  id: K,
102
- className: s.dropdown,
103
- children: /* @__PURE__ */ m(ee, {
103
+ className: c.dropdown,
104
+ children: /* @__PURE__ */ h(ee, {
104
105
  active: I,
105
106
  initialFocus: !1,
106
- children: /* @__PURE__ */ m("div", {
107
+ children: /* @__PURE__ */ h("div", {
107
108
  role: "dialog",
108
109
  "aria-modal": "true",
109
110
  "aria-labelledby": q,
110
111
  "aria-label": q ? void 0 : P["aria-label"] ?? U("datepicker.dialog"),
111
- children: /* @__PURE__ */ m(a, {
112
+ children: /* @__PURE__ */ h(te, {
112
113
  value: X ?? void 0,
113
- onChange: le
114
+ onChange: ue
114
115
  })
115
116
  })
116
117
  })
@@ -118,6 +119,6 @@ var g = c(({ intent: c = "default", variant: g = "outline", fullWidth: _ = !1, c
118
119
  })
119
120
  });
120
121
  });
121
- g.displayName = "DatePicker";
122
+ _.displayName = "DatePicker";
122
123
  //#endregion
123
- export { g as DatePicker, g as default };
124
+ export { _ as DatePicker, _ as default };
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../FieldTemplate/FieldTemplate.cjs"),r=require("../DatePicker/DatePicker.cjs"),i=require("./date-range-picker.module.cjs");let a=require("react");a=e.__toESM(a,1);let o=require("classnames");o=e.__toESM(o,1);let s=require("react/jsx-runtime");var c=({startProps:e,endProps:c,className:l,label:u,error:d,required:f,layout:p=`vertical`})=>{let{t:m}=t.useWimTranslation(`components`),h=`wim-daterangepicker-${(0,a.useId)()}`,g=u?`${h}-label`:void 0,_=d?`${h}-error`:void 0,v=e?.label?void 0:m(`daterangepicker.start`),y=c?.label?void 0:m(`daterangepicker.end`);return(0,s.jsx)(n.FieldTemplate,{label:u,error:d,required:f,layout:p,labelId:g,errorId:_,className:(0,o.default)(`wim-date-range-picker`,i.default.container,l),children:(0,s.jsxs)(`div`,{className:i.default.root,role:`group`,"aria-labelledby":g,"aria-describedby":_,children:[(0,s.jsx)(`div`,{className:i.default.pickerWrapper,children:(0,s.jsx)(r.DatePicker,{"aria-label":v,...e,intent:d?`danger`:e?.intent,fullWidth:!0})}),(0,s.jsx)(`span`,{className:i.default.separator,children:`~`}),(0,s.jsx)(`div`,{className:i.default.pickerWrapper,children:(0,s.jsx)(r.DatePicker,{"aria-label":y,...c,intent:d?`danger`:c?.intent,fullWidth:!0})})]})})};exports.DateRangePicker=c;
2
+ const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../../../i18n/generated/components.cjs"),r=require("../FieldTemplate/FieldTemplate.cjs"),i=require("../DatePicker/DatePicker.cjs"),a=require("./date-range-picker.module.cjs");let o=require("react");o=e.__toESM(o,1);let s=require("classnames");s=e.__toESM(s,1);let c=require("react/jsx-runtime");var l=({startProps:e,endProps:l,className:u,label:d,error:f,required:p,layout:m=`vertical`})=>{let{t:h}=t.useWimTranslation(n.componentsNs),g=`wim-daterangepicker-${(0,o.useId)()}`,_=d?`${g}-label`:void 0,v=f?`${g}-error`:void 0,y=e?.label?void 0:h(`daterangepicker.start`),b=l?.label?void 0:h(`daterangepicker.end`);return(0,c.jsx)(r.FieldTemplate,{label:d,error:f,required:p,layout:m,labelId:_,errorId:v,className:(0,s.default)(`wim-date-range-picker`,a.default.container,u),children:(0,c.jsxs)(`div`,{className:a.default.root,role:`group`,"aria-labelledby":_,"aria-describedby":v,children:[(0,c.jsx)(`div`,{className:a.default.pickerWrapper,children:(0,c.jsx)(i.DatePicker,{"aria-label":y,...e,intent:f?`danger`:e?.intent,fullWidth:!0})}),(0,c.jsx)(`span`,{className:a.default.separator,children:`~`}),(0,c.jsx)(`div`,{className:a.default.pickerWrapper,children:(0,c.jsx)(i.DatePicker,{"aria-label":b,...l,intent:f?`danger`:l?.intent,fullWidth:!0})})]})})};exports.DateRangePicker=l;