wimui 0.51.1 → 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.
- package/dist/components/_internal/FeedbackCloseButton.cjs +1 -1
- package/dist/components/_internal/FeedbackCloseButton.js +14 -13
- package/dist/components/_internal/FieldLabelContent.cjs +1 -1
- package/dist/components/_internal/FieldLabelContent.js +18 -17
- package/dist/components/ai/AIResponseFeedback/AIResponseFeedback.cjs +1 -1
- package/dist/components/ai/AIResponseFeedback/AIResponseFeedback.js +46 -45
- package/dist/components/ai/AgentStatus/AgentStatus.cjs +1 -1
- package/dist/components/ai/AgentStatus/AgentStatus.js +24 -23
- package/dist/components/ai/ArtifactsOverlay/ArtifactsOverlay.cjs +1 -1
- package/dist/components/ai/ArtifactsOverlay/ArtifactsOverlay.js +47 -45
- package/dist/components/ai/ChatUI/ChatUI.cjs +1 -1
- package/dist/components/ai/ChatUI/ChatUI.js +82 -81
- package/dist/components/ai/CodeBlock/CodeBlock.cjs +3 -3
- package/dist/components/ai/CodeBlock/CodeBlock.js +53 -52
- package/dist/components/ai/CodeDiffViewer/CodeDiffViewer.cjs +2 -2
- package/dist/components/ai/CodeDiffViewer/CodeDiffViewer.js +105 -104
- package/dist/components/ai/MarkdownRenderer/MarkdownRenderer.cjs +1 -1
- package/dist/components/ai/MarkdownRenderer/MarkdownRenderer.js +60 -59
- package/dist/components/ai/ModelSelector/ModelSelector.cjs +1 -1
- package/dist/components/ai/ModelSelector/ModelSelector.js +122 -120
- package/dist/components/ai/ModelSelector/model-selector.module.cjs +1 -1
- package/dist/components/ai/ModelSelector/model-selector.module.js +1 -1
- package/dist/components/ai/PromptInput/PromptInput.cjs +1 -1
- package/dist/components/ai/PromptInput/PromptInput.js +76 -75
- package/dist/components/ai/SourceCitation/SourceCitation.cjs +1 -1
- package/dist/components/ai/SourceCitation/SourceCitation.js +39 -38
- package/dist/components/ai/Terminal/Terminal.cjs +2 -2
- package/dist/components/ai/Terminal/Terminal.js +65 -64
- package/dist/components/ai/ThreadList/ThreadList.cjs +1 -1
- package/dist/components/ai/ThreadList/ThreadList.js +64 -62
- package/dist/components/data-display/Accordion/accordion.module.cjs +1 -1
- package/dist/components/data-display/Accordion/accordion.module.js +1 -1
- package/dist/components/data-display/Barcode/Barcode.cjs +1 -1
- package/dist/components/data-display/Barcode/Barcode.js +76 -75
- package/dist/components/data-display/Calendar/Calendar.cjs +1 -1
- package/dist/components/data-display/Calendar/Calendar.js +75 -74
- package/dist/components/data-display/CalendarHeatmap/CalendarHeatmap.cjs +1 -1
- package/dist/components/data-display/CalendarHeatmap/CalendarHeatmap.js +54 -52
- package/dist/components/data-display/Carousel/Carousel.cjs +1 -1
- package/dist/components/data-display/Carousel/Carousel.js +24 -23
- package/dist/components/data-display/Chip/Chip.cjs +1 -1
- package/dist/components/data-display/Chip/Chip.js +36 -35
- package/dist/components/data-display/Comment/Comment.cjs +1 -1
- package/dist/components/data-display/Comment/Comment.js +58 -57
- package/dist/components/data-display/Countdown/Countdown.cjs +1 -1
- package/dist/components/data-display/Countdown/Countdown.js +56 -55
- package/dist/components/data-display/DataGrid/DataGrid.cjs +1 -1
- package/dist/components/data-display/DataGrid/DataGrid.js +128 -127
- package/dist/components/data-display/JsonViewer/JsonViewer.cjs +1 -1
- package/dist/components/data-display/JsonViewer/JsonViewer.js +153 -152
- package/dist/components/data-display/Kanban/Kanban.cjs +1 -1
- package/dist/components/data-display/Kanban/Kanban.js +95 -94
- package/dist/components/data-display/NodeGraph/NodeGraph.cjs +1 -1
- package/dist/components/data-display/NodeGraph/NodeGraph.js +67 -66
- package/dist/components/data-display/PivotTable/PivotTable.cjs +1 -1
- package/dist/components/data-display/PivotTable/PivotTable.js +153 -152
- package/dist/components/data-display/Presence/Presence.cjs +1 -1
- package/dist/components/data-display/Presence/Presence.js +28 -27
- package/dist/components/data-display/PullToRefresh/PullToRefresh.cjs +1 -1
- package/dist/components/data-display/PullToRefresh/PullToRefresh.js +73 -72
- package/dist/components/data-display/Reaction/Reaction.cjs +1 -1
- package/dist/components/data-display/Reaction/Reaction.js +31 -30
- package/dist/components/data-display/ScheduleView/ScheduleView.cjs +1 -1
- package/dist/components/data-display/ScheduleView/ScheduleView.js +52 -50
- package/dist/components/data-display/SortableList/SortableList.cjs +1 -1
- package/dist/components/data-display/SortableList/SortableList.js +44 -43
- package/dist/components/data-display/Tag/Tag.cjs +1 -1
- package/dist/components/data-display/Tag/Tag.js +29 -28
- package/dist/components/data-display/TreeDiagram/TreeDiagram.cjs +1 -1
- package/dist/components/data-display/TreeDiagram/TreeDiagram.js +85 -84
- package/dist/components/data-display/TreeView/TreeView.cjs +1 -1
- package/dist/components/data-display/TreeView/TreeView.js +123 -122
- package/dist/components/feedback/Autosave/Autosave.cjs +1 -1
- package/dist/components/feedback/Autosave/Autosave.js +32 -31
- package/dist/components/feedback/ErrorBoundary/ErrorBoundary.cjs +1 -1
- package/dist/components/feedback/ErrorBoundary/ErrorBoundary.js +35 -34
- package/dist/components/feedback/ScrollProgress/ScrollProgress.cjs +1 -1
- package/dist/components/feedback/ScrollProgress/ScrollProgress.js +21 -20
- package/dist/components/feedback/Tour/Tour.cjs +1 -1
- package/dist/components/feedback/Tour/Tour.js +127 -101
- package/dist/components/form/Button/Button.cjs +1 -1
- package/dist/components/form/Button/Button.js +55 -54
- package/dist/components/form/ColorInput/ColorInput.cjs +1 -1
- package/dist/components/form/ColorInput/ColorInput.js +30 -29
- package/dist/components/form/ColorPicker/color-picker.module.cjs +1 -1
- package/dist/components/form/ColorPicker/color-picker.module.js +1 -1
- package/dist/components/form/CopyButton/CopyButton.cjs +1 -1
- package/dist/components/form/CopyButton/CopyButton.js +27 -26
- package/dist/components/form/DatePicker/DatePicker.cjs +1 -1
- package/dist/components/form/DatePicker/DatePicker.js +47 -46
- package/dist/components/form/DateRangePicker/DateRangePicker.cjs +1 -1
- package/dist/components/form/DateRangePicker/DateRangePicker.js +36 -35
- package/dist/components/form/Dropzone/Dropzone.cjs +1 -1
- package/dist/components/form/Dropzone/Dropzone.js +56 -55
- package/dist/components/form/FileUpload/FileUpload.cjs +1 -1
- package/dist/components/form/FileUpload/FileUpload.js +47 -46
- package/dist/components/form/FloatButton/FloatButton.cjs +1 -1
- package/dist/components/form/FloatButton/FloatButton.d.ts +4 -1
- package/dist/components/form/FloatButton/FloatButton.js +6 -6
- package/dist/components/form/ImageCropper/ImageCropper.cjs +1 -1
- package/dist/components/form/ImageCropper/ImageCropper.js +101 -99
- package/dist/components/form/InlineEdit/InlineEdit.cjs +1 -1
- package/dist/components/form/InlineEdit/InlineEdit.js +66 -65
- package/dist/components/form/Input/Input.cjs +1 -1
- package/dist/components/form/Input/Input.js +45 -44
- package/dist/components/form/InputBase/InputBase.cjs +1 -1
- package/dist/components/form/InputBase/InputBase.js +51 -50
- package/dist/components/form/InputBase/input-base.module.cjs +1 -1
- package/dist/components/form/InputBase/input-base.module.js +1 -1
- package/dist/components/form/MultiSelect/multiselect.module.cjs +1 -1
- package/dist/components/form/MultiSelect/multiselect.module.js +1 -1
- package/dist/components/form/OtpInput/otp-input.module.cjs +1 -1
- package/dist/components/form/OtpInput/otp-input.module.js +1 -1
- package/dist/components/form/PasswordStrength/PasswordStrength.cjs +1 -1
- package/dist/components/form/PasswordStrength/PasswordStrength.js +27 -26
- package/dist/components/form/PhoneInput/PhoneInput.cjs +1 -1
- package/dist/components/form/PhoneInput/PhoneInput.js +10 -10
- package/dist/components/form/QueryBuilder/QueryBuilder.cjs +1 -1
- package/dist/components/form/QueryBuilder/QueryBuilder.js +90 -89
- package/dist/components/form/RangeSlider/RangeSlider.cjs +1 -1
- package/dist/components/form/RangeSlider/RangeSlider.js +121 -119
- package/dist/components/form/RangeSlider/range-slider.module.cjs +1 -1
- package/dist/components/form/RangeSlider/range-slider.module.js +1 -1
- package/dist/components/form/RichTextEditor/RichTextEditor.cjs +1 -1
- package/dist/components/form/RichTextEditor/RichTextEditor.js +223 -222
- package/dist/components/form/SegmentedControl/SegmentedControl.cjs +1 -1
- package/dist/components/form/SegmentedControl/SegmentedControl.js +7 -7
- package/dist/components/form/Select/Select.cjs +1 -1
- package/dist/components/form/Select/Select.js +112 -111
- package/dist/components/form/SignaturePad/SignaturePad.cjs +1 -1
- package/dist/components/form/SignaturePad/SignaturePad.js +86 -79
- package/dist/components/form/SmartSearchInput/SmartSearchInput.cjs +1 -1
- package/dist/components/form/SmartSearchInput/SmartSearchInput.js +63 -62
- package/dist/components/form/TagInput/TagInput.cjs +1 -1
- package/dist/components/form/TagInput/TagInput.js +68 -67
- package/dist/components/form/ThemeToggle/ThemeToggle.cjs +1 -1
- package/dist/components/form/ThemeToggle/ThemeToggle.js +69 -67
- package/dist/components/form/ThemeToggle/theme-toggle.module.cjs +1 -1
- package/dist/components/form/ThemeToggle/theme-toggle.module.js +1 -1
- package/dist/components/form/ToggleGroup/ToggleGroup.cjs +1 -1
- package/dist/components/form/ToggleGroup/ToggleGroup.js +6 -6
- package/dist/components/form/Transfer/Transfer.cjs +1 -1
- package/dist/components/form/Transfer/Transfer.d.ts +1 -1
- package/dist/components/form/Transfer/Transfer.js +155 -154
- package/dist/components/form/Transfer/transfer.module.cjs +1 -1
- package/dist/components/form/Transfer/transfer.module.js +6 -6
- package/dist/components/form/TreeSelect/TreeSelect.cjs +1 -1
- package/dist/components/form/TreeSelect/TreeSelect.js +6 -6
- package/dist/components/layout/Dashboard/Dashboard.cjs +1 -1
- package/dist/components/layout/Dashboard/Dashboard.js +90 -89
- package/dist/components/layout/Navbar/Navbar.cjs +1 -1
- package/dist/components/layout/Navbar/Navbar.d.ts +1 -1
- package/dist/components/layout/Navbar/Navbar.js +1 -1
- package/dist/components/layout/Sidebar/Sidebar.d.ts +1 -1
- package/dist/components/layout/Splitter/Splitter.cjs +1 -1
- package/dist/components/layout/Splitter/Splitter.js +40 -39
- package/dist/components/layout/Toolbar/Toolbar.cjs +1 -1
- package/dist/components/layout/Toolbar/Toolbar.js +66 -39
- package/dist/components/media/Audio/Audio.cjs +1 -1
- package/dist/components/media/Audio/Audio.js +91 -90
- package/dist/components/media/Audio/components/AudioCustomControls.cjs +1 -1
- package/dist/components/media/Audio/components/AudioCustomControls.js +116 -114
- package/dist/components/media/Gallery/Gallery.cjs +1 -1
- package/dist/components/media/Gallery/Gallery.js +132 -131
- package/dist/components/media/ImageCompare/ImageCompare.cjs +1 -1
- package/dist/components/media/ImageCompare/ImageCompare.js +75 -73
- package/dist/components/media/Lightbox/Lightbox.cjs +1 -1
- package/dist/components/media/Lightbox/Lightbox.js +128 -127
- package/dist/components/media/Video/Video.cjs +1 -1
- package/dist/components/media/Video/Video.js +73 -71
- package/dist/components/media/Video/components/VideoAdvancedMenu.cjs +1 -1
- package/dist/components/media/Video/components/VideoAdvancedMenu.js +140 -138
- package/dist/components/media/Video/components/VideoControls.cjs +1 -1
- package/dist/components/media/Video/components/VideoControls.js +103 -102
- package/dist/components/navigation/BackTop/BackTop.cjs +1 -1
- package/dist/components/navigation/BackTop/BackTop.js +37 -36
- package/dist/components/navigation/Breadcrumb/Breadcrumb.cjs +1 -1
- package/dist/components/navigation/Breadcrumb/Breadcrumb.js +41 -40
- package/dist/components/navigation/CommandPalette/CommandPalette.cjs +1 -1
- package/dist/components/navigation/CommandPalette/CommandPalette.js +100 -99
- package/dist/components/navigation/HamburgerMenu/HamburgerMenu.cjs +1 -1
- package/dist/components/navigation/HamburgerMenu/HamburgerMenu.d.ts +6 -0
- package/dist/components/navigation/HamburgerMenu/HamburgerMenu.js +32 -22
- package/dist/components/navigation/Pagination/Pagination.cjs +1 -1
- package/dist/components/navigation/Pagination/Pagination.js +39 -38
- package/dist/components/navigation/SpeedDial/SpeedDial.cjs +1 -1
- package/dist/components/navigation/SpeedDial/SpeedDial.js +44 -43
- package/dist/components/navigation/Tabs/tabs.module.cjs +1 -1
- package/dist/components/navigation/Tabs/tabs.module.js +1 -1
- package/dist/components/overlay/ContextMenu/ContextMenu.cjs +1 -1
- package/dist/components/overlay/ContextMenu/ContextMenu.js +4 -4
- package/dist/components/overlay/Popover/Popover.cjs +1 -1
- package/dist/components/overlay/Popover/Popover.js +63 -62
- package/dist/components/typography/Spoiler/Spoiler.cjs +1 -1
- package/dist/components/typography/Spoiler/Spoiler.js +38 -37
- package/dist/i18n/generated/common.cjs +2 -0
- package/dist/i18n/generated/common.d.ts +3 -0
- package/dist/i18n/generated/common.js +570 -0
- package/dist/i18n/generated/components.cjs +2 -0
- package/dist/i18n/generated/components.d.ts +3 -0
- package/dist/i18n/generated/components.js +399 -0
- package/dist/i18n/generated/data-display.cjs +2 -0
- package/dist/i18n/generated/data-display.d.ts +3 -0
- package/dist/i18n/generated/data-display.js +12 -0
- package/dist/i18n/generated/form.cjs +2 -0
- package/dist/i18n/generated/form.d.ts +3 -0
- package/dist/i18n/generated/form.js +321 -0
- package/dist/i18n/generated/keys.d.ts +5 -1
- package/dist/i18n/generated/locales.cjs +2 -0
- package/dist/i18n/generated/locales.d.ts +1 -0
- package/dist/i18n/generated/locales.js +9 -0
- package/dist/i18n/instance.cjs +1 -1
- package/dist/i18n/instance.d.ts +18 -3
- package/dist/i18n/instance.js +24 -26
- package/dist/i18n/useWimTranslation.cjs +1 -1
- package/dist/i18n/useWimTranslation.d.ts +7 -8
- package/dist/i18n/useWimTranslation.js +6 -5
- package/dist/llms-full.txt +10 -6
- package/dist/llms.txt +1 -1
- package/dist/locales/en/common.json +53 -4
- package/dist/locales/en/components.json +3 -1
- package/dist/locales/ja/common.json +53 -4
- package/dist/locales/ja/components.json +3 -1
- package/dist/locales/pt/common.json +53 -4
- package/dist/locales/pt/components.json +3 -1
- package/dist/styles.css +2 -2
- package/dist/wimui.umd.css +1 -1
- package/dist/wimui.umd.js +5 -5
- package/package.json +10 -10
- package/dist/i18n/generated/resources.cjs +0 -2
- package/dist/i18n/generated/resources.d.ts +0 -4
- package/dist/i18n/generated/resources.js +0 -1103
|
@@ -1,126 +1,133 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useWimTranslation as e } from "../../../i18n/useWimTranslation.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import r from "
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import
|
|
3
|
+
import { commonNs as t } from "../../../i18n/generated/common.js";
|
|
4
|
+
import { componentsNs as n } from "../../../i18n/generated/components.js";
|
|
5
|
+
import { Button as r } from "../Button/Button.js";
|
|
6
|
+
import { formNs as i } from "../../../i18n/generated/form.js";
|
|
7
|
+
import { FieldTemplate as a } from "../FieldTemplate/FieldTemplate.js";
|
|
8
|
+
import o from "./signature-pad.module.js";
|
|
9
|
+
import { useCallback as s, useEffect as c, useId as l, useLayoutEffect as u, useRef as d, useState as f } from "react";
|
|
10
|
+
import p from "classnames";
|
|
11
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
9
12
|
//#region src/components/form/SignaturePad/SignaturePad.tsx
|
|
10
|
-
var
|
|
11
|
-
let { t:
|
|
13
|
+
var g = ({ width: g = 400, height: _ = 200, penColor: v = "var(--wim-color-text-primary)", penWidth: y = 2, onChange: b, clearLabel: x, disabled: S = !1, className: C, style: w, label: T, error: E, required: D, layout: O = "vertical", canvasAriaLabel: k }) => {
|
|
14
|
+
let { t: A } = e([
|
|
15
|
+
t,
|
|
16
|
+
n,
|
|
17
|
+
i
|
|
18
|
+
]), j = x ?? A("signature.clear", {
|
|
12
19
|
ns: "components",
|
|
13
|
-
defaultValue:
|
|
14
|
-
}),
|
|
15
|
-
if (e.startsWith("var(") &&
|
|
20
|
+
defaultValue: A("button.clear")
|
|
21
|
+
}), M = k ?? A("a11y.signature_canvas"), N = d(null), P = d(!1), [F, I] = f(!0), L = `wim-signature-pad-${l()}`, R = T ? `${L}-label` : void 0, z = E ? `${L}-error` : void 0, B = s((e) => {
|
|
22
|
+
if (e.startsWith("var(") && N.current) {
|
|
16
23
|
let t = e.match(/var\((--[^)]+)\)/)?.[1];
|
|
17
|
-
if (t) return getComputedStyle(
|
|
24
|
+
if (t) return getComputedStyle(N.current).getPropertyValue(t).trim() || "#000";
|
|
18
25
|
}
|
|
19
26
|
return e;
|
|
20
27
|
}, []);
|
|
21
|
-
|
|
22
|
-
if (!
|
|
23
|
-
let e =
|
|
28
|
+
u(() => {
|
|
29
|
+
if (!N.current) return;
|
|
30
|
+
let e = N.current, t = e.getContext("2d");
|
|
24
31
|
if (!t) return;
|
|
25
32
|
let n = window.devicePixelRatio || 1;
|
|
26
|
-
e.width =
|
|
27
|
-
}, [
|
|
28
|
-
let
|
|
29
|
-
if (!
|
|
30
|
-
let t =
|
|
33
|
+
e.width = g * n, e.height = _ * n, t.scale(n, n), t.lineCap = "round", t.lineJoin = "round";
|
|
34
|
+
}, [g, _]);
|
|
35
|
+
let V = s((e) => {
|
|
36
|
+
if (!N.current) return null;
|
|
37
|
+
let t = N.current.getBoundingClientRect(), n, r;
|
|
31
38
|
if ("touches" in e) {
|
|
32
39
|
if (e.touches.length === 0) return null;
|
|
33
40
|
n = e.touches[0].clientX, r = e.touches[0].clientY;
|
|
34
41
|
} else n = e.clientX, r = e.clientY;
|
|
35
|
-
let i = n - t.left, a = r - t.top, o =
|
|
42
|
+
let i = n - t.left, a = r - t.top, o = g / t.width, s = _ / t.height;
|
|
36
43
|
return {
|
|
37
44
|
x: i * o,
|
|
38
45
|
y: a * s
|
|
39
46
|
};
|
|
40
|
-
}, [
|
|
41
|
-
if (
|
|
42
|
-
let t =
|
|
43
|
-
if (!t || !
|
|
44
|
-
let n =
|
|
45
|
-
n && (
|
|
46
|
-
},
|
|
47
|
-
if (!
|
|
48
|
-
let t =
|
|
47
|
+
}, [g, _]), H = (e) => {
|
|
48
|
+
if (S) return;
|
|
49
|
+
let t = V(e);
|
|
50
|
+
if (!t || !N.current) return;
|
|
51
|
+
let n = N.current.getContext("2d");
|
|
52
|
+
n && (P.current = !0, n.beginPath(), n.moveTo(t.x, t.y), n.strokeStyle = B(v), n.lineWidth = y);
|
|
53
|
+
}, U = (e) => {
|
|
54
|
+
if (!P.current || S || !N.current) return;
|
|
55
|
+
let t = V(e);
|
|
49
56
|
if (!t) return;
|
|
50
|
-
let n =
|
|
51
|
-
n && (n.lineTo(t.x, t.y), n.stroke(),
|
|
52
|
-
},
|
|
53
|
-
if (
|
|
54
|
-
let e =
|
|
55
|
-
|
|
57
|
+
let n = N.current.getContext("2d");
|
|
58
|
+
n && (n.lineTo(t.x, t.y), n.stroke(), I(!1));
|
|
59
|
+
}, W = () => {
|
|
60
|
+
if (P.current && (P.current = !1, b && N.current)) {
|
|
61
|
+
let e = N.current, t = e.getContext("2d");
|
|
62
|
+
b(!t || t.getImageData(0, 0, e.width, e.height).data.every((e, t) => t % 4 != 3 || e === 0) ? null : e.toDataURL());
|
|
56
63
|
}
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}),
|
|
61
|
-
let e = () =>
|
|
64
|
+
}, G = d(W);
|
|
65
|
+
u(() => {
|
|
66
|
+
G.current = W;
|
|
67
|
+
}), c(() => {
|
|
68
|
+
let e = () => G.current();
|
|
62
69
|
return window.addEventListener("mouseup", e), () => window.removeEventListener("mouseup", e);
|
|
63
70
|
}, []);
|
|
64
|
-
let
|
|
65
|
-
return /* @__PURE__ */
|
|
66
|
-
label:
|
|
67
|
-
error:
|
|
68
|
-
required:
|
|
69
|
-
layout:
|
|
70
|
-
labelId:
|
|
71
|
-
errorId:
|
|
72
|
-
className:
|
|
73
|
-
children: /* @__PURE__ */
|
|
74
|
-
className:
|
|
75
|
-
style:
|
|
76
|
-
children: [/* @__PURE__ */
|
|
77
|
-
className:
|
|
71
|
+
let K = d(!1);
|
|
72
|
+
return /* @__PURE__ */ m(a, {
|
|
73
|
+
label: T,
|
|
74
|
+
error: E,
|
|
75
|
+
required: D,
|
|
76
|
+
layout: O,
|
|
77
|
+
labelId: R,
|
|
78
|
+
errorId: z,
|
|
79
|
+
className: C,
|
|
80
|
+
children: /* @__PURE__ */ h("div", {
|
|
81
|
+
className: p("wim-signature-pad", o.root, S && o.disabled, E && o.danger),
|
|
82
|
+
style: w,
|
|
83
|
+
children: [/* @__PURE__ */ m("div", {
|
|
84
|
+
className: o.canvasContainer,
|
|
78
85
|
style: {
|
|
79
|
-
width:
|
|
86
|
+
width: g,
|
|
80
87
|
maxWidth: "100%",
|
|
81
|
-
aspectRatio: `${
|
|
88
|
+
aspectRatio: `${g} / ${_}`,
|
|
82
89
|
height: "auto"
|
|
83
90
|
},
|
|
84
|
-
children: /* @__PURE__ */
|
|
85
|
-
ref:
|
|
91
|
+
children: /* @__PURE__ */ m("canvas", {
|
|
92
|
+
ref: N,
|
|
86
93
|
"data-testid": "signature-canvas",
|
|
87
|
-
className:
|
|
94
|
+
className: o.canvas,
|
|
88
95
|
style: {
|
|
89
96
|
width: "100%",
|
|
90
97
|
height: "100%",
|
|
91
98
|
display: "block"
|
|
92
99
|
},
|
|
93
|
-
onMouseDown:
|
|
94
|
-
onMouseMove:
|
|
95
|
-
onMouseUp:
|
|
96
|
-
onTouchStart:
|
|
97
|
-
onTouchMove:
|
|
98
|
-
onTouchEnd:
|
|
99
|
-
"aria-labelledby":
|
|
100
|
-
"aria-describedby":
|
|
100
|
+
onMouseDown: H,
|
|
101
|
+
onMouseMove: U,
|
|
102
|
+
onMouseUp: W,
|
|
103
|
+
onTouchStart: H,
|
|
104
|
+
onTouchMove: U,
|
|
105
|
+
onTouchEnd: W,
|
|
106
|
+
"aria-labelledby": T ? R : void 0,
|
|
107
|
+
"aria-describedby": z,
|
|
101
108
|
role: "img",
|
|
102
|
-
"aria-label":
|
|
109
|
+
"aria-label": T ? void 0 : M
|
|
103
110
|
})
|
|
104
|
-
}), /* @__PURE__ */
|
|
105
|
-
className:
|
|
106
|
-
children: /* @__PURE__ */
|
|
111
|
+
}), /* @__PURE__ */ m("div", {
|
|
112
|
+
className: o.footer,
|
|
113
|
+
children: /* @__PURE__ */ m(r, {
|
|
107
114
|
variant: "outline",
|
|
108
115
|
size: "sm",
|
|
109
116
|
"data-testid": "signature-clear",
|
|
110
117
|
onMouseDown: () => {
|
|
111
|
-
|
|
118
|
+
K.current = !0;
|
|
112
119
|
},
|
|
113
120
|
onClick: () => {
|
|
114
|
-
if (!
|
|
115
|
-
let e =
|
|
116
|
-
t && (t.clearRect(0, 0, e.width, e.height),
|
|
121
|
+
if (!K.current || (K.current = !1, S || !N.current)) return;
|
|
122
|
+
let e = N.current, t = e.getContext("2d");
|
|
123
|
+
t && (t.clearRect(0, 0, e.width, e.height), I(!0), b && b(null));
|
|
117
124
|
},
|
|
118
|
-
disabled:
|
|
119
|
-
children:
|
|
125
|
+
disabled: S || F,
|
|
126
|
+
children: j
|
|
120
127
|
})
|
|
121
128
|
})]
|
|
122
129
|
})
|
|
123
130
|
});
|
|
124
131
|
};
|
|
125
132
|
//#endregion
|
|
126
|
-
export {
|
|
133
|
+
export { g as SignaturePad };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../InputBase/InputBase.cjs"),r=require("../FieldTemplate/FieldTemplate.cjs"),
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../InputBase/InputBase.cjs"),r=require("../../../i18n/generated/form.cjs"),i=require("../FieldTemplate/FieldTemplate.cjs"),a=require("../../../hooks/useAutoResize.cjs"),o=require("../../_internal/FieldCharacterCount/FieldCharacterCount.cjs"),s=require("./smart-search-input.module.cjs");let c=require("react");c=e.__toESM(c,1);let l=require("classnames");l=e.__toESM(l,1);let u=require("react/jsx-runtime");var d=(0,c.forwardRef)(({intent:e=`default`,variant:d=`outline`,fullWidth:f=!1,width:p,label:m,error:h,required:g,layout:_,maxRows:v=8,allowClear:y=!0,onClear:b,onSubmit:x,onChange:S,value:C,defaultValue:w=``,placeholder:T,disabled:E,className:D,id:O,maxLength:k,"aria-label":A,...j},M)=>{let{t:N}=t.useWimTranslation(r.formNs),P=C!==void 0,[F,I]=c.default.useState(w),L=P?C:F,R=a.useAutoResize(L,v);c.default.useImperativeHandle(M,()=>R.current);let z=(0,c.useId)(),B=O||`smart-search-${z}`,V=h?`${B}-error`:void 0,H=m?`${B}-label`:void 0,U=(0,c.useCallback)(e=>{let t=e.target.value;P||I(t),S?.(t)},[P,S]),W=(0,c.useCallback)(()=>{L.trim()&&!E&&x?.(L.trim())},[L,E,x]),G=(0,c.useCallback)(e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),W())},[W]),K=()=>{P||I(``),S?.(``),b?.(),R.current?.focus()},q=h?`danger`:e;return(0,u.jsx)(i.FieldTemplate,{label:m,error:h,required:g,layout:_,htmlFor:B,labelId:H,errorId:V,className:(0,l.default)(`wim-smart-search-input`,D,f&&s.default.fullWidth),children:(0,u.jsxs)(`div`,{className:s.default.container,children:[(0,u.jsx)(n.InputBase,{intent:q,variant:d,fullWidth:f,width:p,disabled:E,leftIcon:`SearchIcon`,styles:{icon:s.default.icon,icons:s.default.icons},allowClear:y,hasValue:!!L,onClear:K,children:(0,u.jsx)(`textarea`,{id:B,ref:R,className:(0,l.default)(s.default.textarea,s.default[d]),value:L,onChange:U,onKeyDown:G,placeholder:T,rows:1,disabled:E,maxLength:k,"aria-label":A??(m?void 0:N(`smart_search.input_label`)),...j})}),(0,u.jsx)(o.FieldCharacterCount,{count:L.length,maxLength:k,className:s.default.charCount})]})})});d.displayName=`SmartSearchInput`,exports.SmartSearchInput=d;
|
|
@@ -1,78 +1,79 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useWimTranslation as e } from "../../../i18n/useWimTranslation.js";
|
|
3
3
|
import { InputBase as t } from "../InputBase/InputBase.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import a from "
|
|
8
|
-
import o
|
|
9
|
-
import u from "
|
|
10
|
-
import
|
|
4
|
+
import { formNs as n } from "../../../i18n/generated/form.js";
|
|
5
|
+
import { FieldTemplate as r } from "../FieldTemplate/FieldTemplate.js";
|
|
6
|
+
import { useAutoResize as i } from "../../../hooks/useAutoResize.js";
|
|
7
|
+
import { FieldCharacterCount as a } from "../../_internal/FieldCharacterCount/FieldCharacterCount.js";
|
|
8
|
+
import o from "./smart-search-input.module.js";
|
|
9
|
+
import s, { forwardRef as c, useCallback as l, useId as u } from "react";
|
|
10
|
+
import d from "classnames";
|
|
11
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
11
12
|
//#region src/components/form/SmartSearchInput/SmartSearchInput.tsx
|
|
12
|
-
var
|
|
13
|
-
let { t:
|
|
14
|
-
|
|
15
|
-
let
|
|
13
|
+
var m = c(({ intent: c = "default", variant: m = "outline", fullWidth: h = !1, width: g, label: _, error: v, required: y, layout: b, maxRows: x = 8, allowClear: S = !0, onClear: C, onSubmit: w, onChange: T, value: E, defaultValue: D = "", placeholder: O, disabled: k, className: A, id: j, maxLength: M, "aria-label": N, ...P }, F) => {
|
|
14
|
+
let { t: I } = e(n), L = E !== void 0, [R, z] = s.useState(D), B = L ? E : R, V = i(B, x);
|
|
15
|
+
s.useImperativeHandle(F, () => V.current);
|
|
16
|
+
let H = u(), U = j || `smart-search-${H}`, W = v ? `${U}-error` : void 0, G = _ ? `${U}-label` : void 0, K = l((e) => {
|
|
16
17
|
let t = e.target.value;
|
|
17
|
-
|
|
18
|
-
}, [
|
|
19
|
-
|
|
18
|
+
L || z(t), T?.(t);
|
|
19
|
+
}, [L, T]), q = l(() => {
|
|
20
|
+
B.trim() && !k && w?.(B.trim());
|
|
20
21
|
}, [
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
]),
|
|
25
|
-
e.key === "Enter" && !e.shiftKey && (e.preventDefault(),
|
|
26
|
-
}, [
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
return /* @__PURE__ */
|
|
30
|
-
label:
|
|
31
|
-
error:
|
|
32
|
-
required:
|
|
33
|
-
layout:
|
|
34
|
-
htmlFor:
|
|
35
|
-
labelId:
|
|
36
|
-
errorId:
|
|
37
|
-
className:
|
|
38
|
-
children: /* @__PURE__ */
|
|
39
|
-
className:
|
|
40
|
-
children: [/* @__PURE__ */
|
|
41
|
-
intent:
|
|
42
|
-
variant:
|
|
43
|
-
fullWidth:
|
|
44
|
-
width:
|
|
45
|
-
disabled:
|
|
22
|
+
B,
|
|
23
|
+
k,
|
|
24
|
+
w
|
|
25
|
+
]), J = l((e) => {
|
|
26
|
+
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), q());
|
|
27
|
+
}, [q]), Y = () => {
|
|
28
|
+
L || z(""), T?.(""), C?.(), V.current?.focus();
|
|
29
|
+
}, X = v ? "danger" : c;
|
|
30
|
+
return /* @__PURE__ */ f(r, {
|
|
31
|
+
label: _,
|
|
32
|
+
error: v,
|
|
33
|
+
required: y,
|
|
34
|
+
layout: b,
|
|
35
|
+
htmlFor: U,
|
|
36
|
+
labelId: G,
|
|
37
|
+
errorId: W,
|
|
38
|
+
className: d("wim-smart-search-input", A, h && o.fullWidth),
|
|
39
|
+
children: /* @__PURE__ */ p("div", {
|
|
40
|
+
className: o.container,
|
|
41
|
+
children: [/* @__PURE__ */ f(t, {
|
|
42
|
+
intent: X,
|
|
43
|
+
variant: m,
|
|
44
|
+
fullWidth: h,
|
|
45
|
+
width: g,
|
|
46
|
+
disabled: k,
|
|
46
47
|
leftIcon: "SearchIcon",
|
|
47
48
|
styles: {
|
|
48
|
-
icon:
|
|
49
|
-
icons:
|
|
49
|
+
icon: o.icon,
|
|
50
|
+
icons: o.icons
|
|
50
51
|
},
|
|
51
|
-
allowClear:
|
|
52
|
-
hasValue: !!
|
|
53
|
-
onClear:
|
|
54
|
-
children: /* @__PURE__ */
|
|
55
|
-
id:
|
|
56
|
-
ref:
|
|
57
|
-
className:
|
|
58
|
-
value:
|
|
59
|
-
onChange:
|
|
60
|
-
onKeyDown:
|
|
61
|
-
placeholder:
|
|
52
|
+
allowClear: S,
|
|
53
|
+
hasValue: !!B,
|
|
54
|
+
onClear: Y,
|
|
55
|
+
children: /* @__PURE__ */ f("textarea", {
|
|
56
|
+
id: U,
|
|
57
|
+
ref: V,
|
|
58
|
+
className: d(o.textarea, o[m]),
|
|
59
|
+
value: B,
|
|
60
|
+
onChange: K,
|
|
61
|
+
onKeyDown: J,
|
|
62
|
+
placeholder: O,
|
|
62
63
|
rows: 1,
|
|
63
|
-
disabled:
|
|
64
|
-
maxLength:
|
|
65
|
-
"aria-label":
|
|
66
|
-
...
|
|
64
|
+
disabled: k,
|
|
65
|
+
maxLength: M,
|
|
66
|
+
"aria-label": N ?? (_ ? void 0 : I("smart_search.input_label")),
|
|
67
|
+
...P
|
|
67
68
|
})
|
|
68
|
-
}), /* @__PURE__ */
|
|
69
|
-
count:
|
|
70
|
-
maxLength:
|
|
71
|
-
className:
|
|
69
|
+
}), /* @__PURE__ */ f(a, {
|
|
70
|
+
count: B.length,
|
|
71
|
+
maxLength: M,
|
|
72
|
+
className: o.charCount
|
|
72
73
|
})]
|
|
73
74
|
})
|
|
74
75
|
});
|
|
75
76
|
});
|
|
76
|
-
|
|
77
|
+
m.displayName = "SmartSearchInput";
|
|
77
78
|
//#endregion
|
|
78
|
-
export {
|
|
79
|
+
export { m as SmartSearchInput };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../InputBase/InputBase.cjs"),r=require("../FieldTemplate/FieldTemplate.cjs"),
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../InputBase/InputBase.cjs"),r=require("../../../i18n/generated/form.cjs"),i=require("../FieldTemplate/FieldTemplate.cjs"),a=require("../../data-display/Tag/Tag.cjs"),o=require("./tag-input.module.cjs");let s=require("react");s=e.__toESM(s,1);let c=require("classnames");c=e.__toESM(c,1);let l=require("react/jsx-runtime");var u=s.default.forwardRef(({value:e,defaultValue:u=[],onChange:d,placeholder:f,disabled:p=!1,intent:m=`default`,variant:h=`outline`,fullWidth:g=!1,width:_,label:v,error:y,required:b,layout:x,allowDelete:S=!0,maxTags:C,className:w,...T},E)=>{let[D,O]=(0,s.useState)(u),[k,A]=(0,s.useState)(``),j=(0,s.useRef)(null),M=e!==void 0,N=M?e:D,P=f,F=e=>{A(e.target.value)},I=e=>{let t=e.trim();if(!t)return;if(N.includes(t)){A(``);return}if(C&&N.length>=C)return;let n=[...N,t];M||O(n),d?.(n),A(``)},L=e=>{if(p||!S)return;let t=N.filter(t=>t!==e);M||O(t),d?.(t)},R=e=>{e.key===`Enter`||e.key===`,`?(e.preventDefault(),I(k)):e.key===`Backspace`&&k===``&&N.length>0&&L(N[N.length-1])},z=()=>{j.current?.focus()},{t:B}=t.useWimTranslation(r.formNs),V=(0,s.useId)(),H=T.id||`wim-tag-input-${V}`,U=y?`${H}-error`:void 0,W=v?`${H}-label`:void 0,G=y?`danger`:m;return(0,l.jsx)(i.FieldTemplate,{ref:E,label:v,error:y,required:b,layout:x,labelId:W,htmlFor:H,errorId:U,className:(0,c.default)(`wim-tag-input`,w),children:(0,l.jsx)(n.InputBase,{intent:G,variant:h,fullWidth:g,width:_,disabled:p,className:o.default.inputBase,styles:{inner:o.default.inputBaseInner},children:(0,l.jsx)(`div`,{className:(0,c.default)(o.default.container,{[o.default.disabled]:p}),onClick:z,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&z()},role:`presentation`,children:(0,l.jsxs)(`div`,{className:o.default.tagList,children:[N.map(e=>(0,l.jsx)(a.Tag,{variant:`solid`,intent:`neutral`,size:`sm`,disabled:p,onDelete:S&&!p?()=>L(e):void 0,className:o.default.tag,children:e},e)),(0,l.jsx)(`input`,{id:H,ref:j,type:`text`,value:k,onChange:F,onKeyDown:R,disabled:p,placeholder:N.length===0?P:``,className:o.default.input,"aria-invalid":G===`danger`,"aria-describedby":U,"aria-labelledby":v?W:void 0,"aria-label":v?void 0:B(`tag_input.input_label`),"aria-required":b})]})})})})});u.displayName=`TagInput`,exports.TagInput=u;
|
|
@@ -1,91 +1,92 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useWimTranslation as e } from "../../../i18n/useWimTranslation.js";
|
|
3
3
|
import { InputBase as t } from "../InputBase/InputBase.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import i from "
|
|
7
|
-
import a
|
|
8
|
-
import l from "
|
|
9
|
-
import
|
|
4
|
+
import { formNs as n } from "../../../i18n/generated/form.js";
|
|
5
|
+
import { FieldTemplate as r } from "../FieldTemplate/FieldTemplate.js";
|
|
6
|
+
import { Tag as i } from "../../data-display/Tag/Tag.js";
|
|
7
|
+
import a from "./tag-input.module.js";
|
|
8
|
+
import o, { useId as s, useRef as c, useState as l } from "react";
|
|
9
|
+
import u from "classnames";
|
|
10
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
10
11
|
//#region src/components/form/TagInput/TagInput.tsx
|
|
11
|
-
var
|
|
12
|
-
let [
|
|
13
|
-
|
|
14
|
-
},
|
|
12
|
+
var p = o.forwardRef(({ value: o, defaultValue: p = [], onChange: m, placeholder: h, disabled: g = !1, intent: _ = "default", variant: v = "outline", fullWidth: y = !1, width: b, label: x, error: S, required: C, layout: w, allowDelete: T = !0, maxTags: E, className: D, ...O }, k) => {
|
|
13
|
+
let [A, j] = l(p), [M, N] = l(""), P = c(null), F = o !== void 0, I = F ? o : A, L = h, R = (e) => {
|
|
14
|
+
N(e.target.value);
|
|
15
|
+
}, z = (e) => {
|
|
15
16
|
let t = e.trim();
|
|
16
17
|
if (!t) return;
|
|
17
|
-
if (
|
|
18
|
-
|
|
18
|
+
if (I.includes(t)) {
|
|
19
|
+
N("");
|
|
19
20
|
return;
|
|
20
21
|
}
|
|
21
|
-
if (
|
|
22
|
-
let n = [...
|
|
23
|
-
|
|
24
|
-
}, z = (e) => {
|
|
25
|
-
if (h || !w) return;
|
|
26
|
-
let t = F.filter((t) => t !== e);
|
|
27
|
-
P || A(t), p?.(t);
|
|
22
|
+
if (E && I.length >= E) return;
|
|
23
|
+
let n = [...I, t];
|
|
24
|
+
F || j(n), m?.(n), N("");
|
|
28
25
|
}, B = (e) => {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
26
|
+
if (g || !T) return;
|
|
27
|
+
let t = I.filter((t) => t !== e);
|
|
28
|
+
F || j(t), m?.(t);
|
|
29
|
+
}, V = (e) => {
|
|
30
|
+
e.key === "Enter" || e.key === "," ? (e.preventDefault(), z(M)) : e.key === "Backspace" && M === "" && I.length > 0 && B(I[I.length - 1]);
|
|
31
|
+
}, H = () => {
|
|
32
|
+
P.current?.focus();
|
|
33
|
+
}, { t: U } = e(n), W = s(), G = O.id || `wim-tag-input-${W}`, K = S ? `${G}-error` : void 0, q = x ? `${G}-label` : void 0, J = S ? "danger" : _;
|
|
34
|
+
return /* @__PURE__ */ d(r, {
|
|
35
|
+
ref: k,
|
|
36
|
+
label: x,
|
|
37
|
+
error: S,
|
|
38
|
+
required: C,
|
|
39
|
+
layout: w,
|
|
40
|
+
labelId: q,
|
|
41
|
+
htmlFor: G,
|
|
42
|
+
errorId: K,
|
|
43
|
+
className: u("wim-tag-input", D),
|
|
44
|
+
children: /* @__PURE__ */ d(t, {
|
|
45
|
+
intent: J,
|
|
46
|
+
variant: v,
|
|
47
|
+
fullWidth: y,
|
|
48
|
+
width: b,
|
|
49
|
+
disabled: g,
|
|
50
|
+
className: a.inputBase,
|
|
51
|
+
styles: { inner: a.inputBaseInner },
|
|
52
|
+
children: /* @__PURE__ */ d("div", {
|
|
53
|
+
className: u(a.container, { [a.disabled]: g }),
|
|
54
|
+
onClick: H,
|
|
54
55
|
onKeyDown: (e) => {
|
|
55
|
-
(e.key === "Enter" || e.key === " ") &&
|
|
56
|
+
(e.key === "Enter" || e.key === " ") && H();
|
|
56
57
|
},
|
|
57
58
|
role: "presentation",
|
|
58
|
-
children: /* @__PURE__ */
|
|
59
|
-
className:
|
|
60
|
-
children: [
|
|
59
|
+
children: /* @__PURE__ */ f("div", {
|
|
60
|
+
className: a.tagList,
|
|
61
|
+
children: [I.map((e) => /* @__PURE__ */ d(i, {
|
|
61
62
|
variant: "solid",
|
|
62
63
|
intent: "neutral",
|
|
63
64
|
size: "sm",
|
|
64
|
-
disabled:
|
|
65
|
-
onDelete:
|
|
66
|
-
className:
|
|
65
|
+
disabled: g,
|
|
66
|
+
onDelete: T && !g ? () => B(e) : void 0,
|
|
67
|
+
className: a.tag,
|
|
67
68
|
children: e
|
|
68
|
-
}, e)), /* @__PURE__ */
|
|
69
|
-
id:
|
|
70
|
-
ref:
|
|
69
|
+
}, e)), /* @__PURE__ */ d("input", {
|
|
70
|
+
id: G,
|
|
71
|
+
ref: P,
|
|
71
72
|
type: "text",
|
|
72
|
-
value:
|
|
73
|
-
onChange:
|
|
74
|
-
onKeyDown:
|
|
75
|
-
disabled:
|
|
76
|
-
placeholder:
|
|
77
|
-
className:
|
|
78
|
-
"aria-invalid":
|
|
79
|
-
"aria-describedby":
|
|
80
|
-
"aria-labelledby":
|
|
81
|
-
"aria-label":
|
|
82
|
-
"aria-required":
|
|
73
|
+
value: M,
|
|
74
|
+
onChange: R,
|
|
75
|
+
onKeyDown: V,
|
|
76
|
+
disabled: g,
|
|
77
|
+
placeholder: I.length === 0 ? L : "",
|
|
78
|
+
className: a.input,
|
|
79
|
+
"aria-invalid": J === "danger",
|
|
80
|
+
"aria-describedby": K,
|
|
81
|
+
"aria-labelledby": x ? q : void 0,
|
|
82
|
+
"aria-label": x ? void 0 : U("tag_input.input_label"),
|
|
83
|
+
"aria-required": C
|
|
83
84
|
})]
|
|
84
85
|
})
|
|
85
86
|
})
|
|
86
87
|
})
|
|
87
88
|
});
|
|
88
89
|
});
|
|
89
|
-
|
|
90
|
+
p.displayName = "TagInput";
|
|
90
91
|
//#endregion
|
|
91
|
-
export {
|
|
92
|
+
export { p as TagInput };
|
|
@@ -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("../../../icon/monitor.cjs"),
|
|
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("../../../i18n/generated/common.cjs"),i=require("../../../icon/monitor.cjs"),a=require("../../../icon/moon.cjs"),o=require("../../../icon/sun.cjs"),s=require("../../media/Icon/Icon.cjs"),c=require("../../../theme.cjs"),l=require("./theme-toggle.module.cjs");let u=require("react");u=e.__toESM(u,1);let d=require("classnames");d=e.__toESM(d,1);let f=require("react/jsx-runtime");var p={light:o.default,dark:a.default,system:i.default},m=`wim-theme`,h=e=>e===`light`||e===`dark`||e===`system`,g=u.default.forwardRef(({value:e,defaultValue:i=`system`,onChange:a,modes:o=[`light`,`dark`],variant:g=`icon`,size:_=`md`,storageKey:v=m,applyToDocument:y=!0,labels:b,className:x,asChild:S=!1,children:C,...w},T)=>{let{t:E}=n.useWimTranslation(r.commonNs),{light:D=E(`common.light`),dark:O=E(`common.dark`),system:k=E(`theme.system`),toggle:A=E(`theme.toggle`)}=b??{},j={light:D,dark:O,system:k},M=e!==void 0,[N,P]=(0,u.useState)(()=>{if(typeof window<`u`&&v){let e=window.localStorage.getItem(v);if(h(e)&&o.includes(e))return e}return o.includes(i)?i:o[0]}),F=M?e:N;(0,u.useEffect)(()=>{y&&c.setWimTheme(F)},[F,y]);let I=(0,u.useCallback)(e=>{M||P(e),typeof window<`u`&&v&&window.localStorage.setItem(v,e),a?.(e)},[M,v,a]),L=()=>{let e=o[(o.indexOf(F)+1)%o.length];I(e)},R=S?t.Root:`div`;return g===`segmented`?(0,f.jsxs)(R,{ref:T,role:`group`,"aria-label":A,className:(0,d.default)(`wim-theme-toggle`,l.default.segmented,l.default[_],x),...w,children:[o.map(e=>{let t=e===F;return(0,f.jsx)(`button`,{type:`button`,className:(0,d.default)(l.default.segment,t&&l.default.active),"aria-pressed":t,"aria-label":j[e],title:j[e],onClick:()=>I(e),children:(0,f.jsx)(s.Icon,{component:p[e],size:_})},e)}),(0,f.jsx)(t.Slottable,{children:C})]}):(0,f.jsxs)(R,{ref:T,className:(0,d.default)(`wim-theme-toggle`,l.default.root,x),...w,children:[(0,f.jsx)(`button`,{type:`button`,className:(0,d.default)(l.default.iconButton,l.default[_]),"aria-label":`${A} (${j[F]})`,title:j[F],onClick:L,children:(0,f.jsx)(s.Icon,{component:p[F],size:_})}),(0,f.jsx)(t.Slottable,{children:C})]})});g.displayName=`ThemeToggle`,exports.ThemeToggle=g;
|