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
|
@@ -3,44 +3,45 @@ import { useWimTranslation as e } from "../../../i18n/useWimTranslation.js";
|
|
|
3
3
|
import { Portal as t } from "../../overlay/Portal/Portal.js";
|
|
4
4
|
import { Transition as n } from "../../layout/Transition/Transition.js";
|
|
5
5
|
import { FocusTrap as r } from "../../overlay/FocusTrap/FocusTrap.js";
|
|
6
|
-
import i from "../../../
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import s from "
|
|
10
|
-
import c
|
|
11
|
-
import h from "
|
|
12
|
-
import
|
|
6
|
+
import { componentsNs as i } from "../../../i18n/generated/components.js";
|
|
7
|
+
import a from "../../../icon/search.js";
|
|
8
|
+
import { Icon as o } from "../../media/Icon/Icon.js";
|
|
9
|
+
import { BaseListItem as s } from "../../_internal/BaseListItem/BaseListItem.js";
|
|
10
|
+
import c from "./command-palette.module.js";
|
|
11
|
+
import l, { createContext as u, useCallback as d, useContext as f, useEffect as p, useRef as m, useState as h } from "react";
|
|
12
|
+
import g from "classnames";
|
|
13
|
+
import { jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
13
14
|
//#region src/components/navigation/CommandPalette/CommandPalette.tsx
|
|
14
|
-
var
|
|
15
|
-
let e =
|
|
15
|
+
var y = u(void 0), b = () => {
|
|
16
|
+
let e = f(y);
|
|
16
17
|
if (!e) throw Error("CommandPalette sub-components must be used within a CommandPalette");
|
|
17
18
|
return e;
|
|
18
|
-
},
|
|
19
|
-
let [r, i] =
|
|
20
|
-
|
|
21
|
-
}, [
|
|
22
|
-
let e =
|
|
23
|
-
return
|
|
24
|
-
}, []), C =
|
|
25
|
-
--
|
|
19
|
+
}, x = ({ children: e, open: t, onOpenChange: n }) => {
|
|
20
|
+
let [r, i] = h(!1), [a, o] = h(""), [s, c] = h(0), [u, f] = h(!1), g = m(0), v = t !== void 0, b = v ? t : r, x = d((e) => {
|
|
21
|
+
v || i(e), n?.(e), e || (o(""), c(0));
|
|
22
|
+
}, [v, n]), S = d(() => {
|
|
23
|
+
let e = g.current;
|
|
24
|
+
return g.current += 1, e;
|
|
25
|
+
}, []), C = d(() => {
|
|
26
|
+
--g.current;
|
|
26
27
|
}, []);
|
|
27
|
-
|
|
28
|
+
g.current = 0, p(() => {
|
|
28
29
|
let e = (e) => {
|
|
29
|
-
(e.metaKey || e.ctrlKey) && e.key === "k" && (e.preventDefault(),
|
|
30
|
+
(e.metaKey || e.ctrlKey) && e.key === "k" && (e.preventDefault(), f(!0), x(!b)), e.key === "Escape" && b && x(!1);
|
|
30
31
|
};
|
|
31
32
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
32
33
|
}, [b, x]);
|
|
33
|
-
let w =
|
|
34
|
+
let w = l.useMemo(() => ({
|
|
34
35
|
open: b,
|
|
35
36
|
onOpenChange: x,
|
|
36
37
|
search: a,
|
|
37
38
|
setSearch: o,
|
|
38
39
|
activeIndex: s,
|
|
39
|
-
setActiveIndex:
|
|
40
|
+
setActiveIndex: c,
|
|
40
41
|
registerItem: S,
|
|
41
42
|
unregisterItem: C,
|
|
42
|
-
isKeyboardNavigating:
|
|
43
|
-
setIsKeyboardNavigating:
|
|
43
|
+
isKeyboardNavigating: u,
|
|
44
|
+
setIsKeyboardNavigating: f
|
|
44
45
|
}), [
|
|
45
46
|
b,
|
|
46
47
|
x,
|
|
@@ -48,95 +49,95 @@ var v = l(void 0), y = () => {
|
|
|
48
49
|
s,
|
|
49
50
|
S,
|
|
50
51
|
C,
|
|
51
|
-
|
|
52
|
+
u
|
|
52
53
|
]);
|
|
53
|
-
return /* @__PURE__ */
|
|
54
|
+
return /* @__PURE__ */ _(y.Provider, {
|
|
54
55
|
value: w,
|
|
55
56
|
children: e
|
|
56
57
|
});
|
|
57
|
-
},
|
|
58
|
-
let { onOpenChange: r, setIsKeyboardNavigating: i } =
|
|
58
|
+
}, S = ({ children: e, asChild: t, className: n }) => {
|
|
59
|
+
let { onOpenChange: r, setIsKeyboardNavigating: i } = b(), a = (e) => {
|
|
59
60
|
i(e.detail === 0), r(!0);
|
|
60
61
|
};
|
|
61
|
-
return t &&
|
|
62
|
+
return t && l.isValidElement(e) ? l.cloneElement(e, {
|
|
62
63
|
onClick: (t) => {
|
|
63
64
|
e.props.onClick?.(t), a(t);
|
|
64
65
|
},
|
|
65
|
-
className:
|
|
66
|
-
}) : /* @__PURE__ */
|
|
67
|
-
className:
|
|
66
|
+
className: g(n, e.props.className)
|
|
67
|
+
}) : /* @__PURE__ */ _("button", {
|
|
68
|
+
className: g(c.trigger, n),
|
|
68
69
|
onClick: a,
|
|
69
70
|
onKeyDown: (e) => {
|
|
70
71
|
(e.key === "Enter" || e.key === " ") && i(!0);
|
|
71
72
|
},
|
|
72
73
|
children: e
|
|
73
74
|
});
|
|
74
|
-
},
|
|
75
|
-
let { t:
|
|
76
|
-
return /* @__PURE__ */
|
|
77
|
-
show:
|
|
75
|
+
}, C = ({ children: a, className: o, "aria-label": s }) => {
|
|
76
|
+
let { t: l } = e(i), { open: u, onOpenChange: d, activeIndex: f, setActiveIndex: p, isKeyboardNavigating: h, setIsKeyboardNavigating: v } = b(), y = m(null);
|
|
77
|
+
return /* @__PURE__ */ _(t, { children: /* @__PURE__ */ _(n, {
|
|
78
|
+
show: u,
|
|
78
79
|
preset: "fade",
|
|
79
|
-
children: /* @__PURE__ */
|
|
80
|
+
children: /* @__PURE__ */ _("div", {
|
|
80
81
|
role: "presentation",
|
|
81
|
-
className:
|
|
82
|
+
className: c.overlay,
|
|
82
83
|
onClick: (e) => {
|
|
83
|
-
e.target === e.currentTarget &&
|
|
84
|
+
e.target === e.currentTarget && d(!1);
|
|
84
85
|
},
|
|
85
|
-
children: /* @__PURE__ */
|
|
86
|
-
show:
|
|
86
|
+
children: /* @__PURE__ */ _(n, {
|
|
87
|
+
show: u,
|
|
87
88
|
preset: "scale",
|
|
88
|
-
children: /* @__PURE__ */
|
|
89
|
-
active:
|
|
90
|
-
children: /* @__PURE__ */
|
|
89
|
+
children: /* @__PURE__ */ _(r, {
|
|
90
|
+
active: u,
|
|
91
|
+
children: /* @__PURE__ */ _("div", {
|
|
91
92
|
role: "dialog",
|
|
92
93
|
"aria-modal": "true",
|
|
93
|
-
"aria-label":
|
|
94
|
-
className:
|
|
94
|
+
"aria-label": s ?? l("command_palette.label"),
|
|
95
|
+
className: g("wim-command-palette", c.content, o),
|
|
95
96
|
onClick: (e) => e.stopPropagation(),
|
|
96
97
|
onMouseMove: (e) => {
|
|
97
|
-
if (!
|
|
98
|
-
|
|
98
|
+
if (!y.current) {
|
|
99
|
+
y.current = {
|
|
99
100
|
x: e.clientX,
|
|
100
101
|
y: e.clientY
|
|
101
102
|
};
|
|
102
103
|
return;
|
|
103
104
|
}
|
|
104
|
-
Math.sqrt((e.clientX -
|
|
105
|
+
Math.sqrt((e.clientX - y.current.x) ** 2 + (e.clientY - y.current.y) ** 2) > 10 && v(!1), y.current = {
|
|
105
106
|
x: e.clientX,
|
|
106
107
|
y: e.clientY
|
|
107
108
|
};
|
|
108
109
|
},
|
|
109
|
-
"data-keyboard-nav":
|
|
110
|
+
"data-keyboard-nav": h,
|
|
110
111
|
onKeyDown: (e) => {
|
|
111
|
-
|
|
112
|
-
let t = e.currentTarget.querySelectorAll(`.${
|
|
113
|
-
t !== 0 && (e.key === "ArrowDown" ? (e.preventDefault(),
|
|
112
|
+
v(!0);
|
|
113
|
+
let t = e.currentTarget.querySelectorAll(`.${c.item}:not([aria-disabled="true"])`).length;
|
|
114
|
+
t !== 0 && (e.key === "ArrowDown" ? (e.preventDefault(), p((e) => (e + 1) % t)) : e.key === "ArrowUp" ? (e.preventDefault(), p((e) => (e - 1 + t) % t)) : e.key === "Home" ? (e.preventDefault(), p(0)) : e.key === "End" ? (e.preventDefault(), p(t - 1)) : e.key === "Enter" && (e.preventDefault(), document.getElementById(`wim-command-palette-item-${f}`)?.click()));
|
|
114
115
|
},
|
|
115
|
-
children:
|
|
116
|
+
children: a
|
|
116
117
|
})
|
|
117
118
|
})
|
|
118
119
|
})
|
|
119
120
|
})
|
|
120
121
|
}) });
|
|
121
|
-
},
|
|
122
|
-
let { search:
|
|
123
|
-
return
|
|
122
|
+
}, w = ({ placeholder: e, value: t, onChange: n, rightSection: r }) => {
|
|
123
|
+
let { search: i, setSearch: s, setActiveIndex: l, activeIndex: u } = b(), d = m(null);
|
|
124
|
+
return p(() => {
|
|
124
125
|
d.current?.focus();
|
|
125
|
-
}, []), /* @__PURE__ */
|
|
126
|
-
className:
|
|
126
|
+
}, []), /* @__PURE__ */ v("div", {
|
|
127
|
+
className: c.inputWrapper,
|
|
127
128
|
children: [
|
|
128
|
-
/* @__PURE__ */
|
|
129
|
-
component:
|
|
129
|
+
/* @__PURE__ */ _(o, {
|
|
130
|
+
component: a,
|
|
130
131
|
size: "sm"
|
|
131
132
|
}),
|
|
132
|
-
/* @__PURE__ */
|
|
133
|
+
/* @__PURE__ */ _("input", {
|
|
133
134
|
ref: d,
|
|
134
|
-
className:
|
|
135
|
+
className: c.input,
|
|
135
136
|
placeholder: e,
|
|
136
|
-
value: t ??
|
|
137
|
+
value: t ?? i,
|
|
137
138
|
onChange: (e) => {
|
|
138
139
|
let t = e.target.value;
|
|
139
|
-
|
|
140
|
+
s(t), l(0), n?.(t);
|
|
140
141
|
},
|
|
141
142
|
role: "combobox",
|
|
142
143
|
"aria-autocomplete": "list",
|
|
@@ -144,76 +145,76 @@ var v = l(void 0), y = () => {
|
|
|
144
145
|
"aria-controls": "wim-command-palette-listbox",
|
|
145
146
|
"aria-activedescendant": `wim-command-palette-item-${u}`
|
|
146
147
|
}),
|
|
147
|
-
r && /* @__PURE__ */
|
|
148
|
-
className:
|
|
148
|
+
r && /* @__PURE__ */ _("div", {
|
|
149
|
+
className: c.inputRight,
|
|
149
150
|
children: r
|
|
150
151
|
})
|
|
151
152
|
]
|
|
152
153
|
});
|
|
153
|
-
},
|
|
154
|
-
className:
|
|
154
|
+
}, T = ({ children: e }) => /* @__PURE__ */ _("div", {
|
|
155
|
+
className: c.list,
|
|
155
156
|
role: "listbox",
|
|
156
157
|
id: "wim-command-palette-listbox",
|
|
157
158
|
children: e
|
|
158
|
-
}),
|
|
159
|
-
let n =
|
|
160
|
-
return /* @__PURE__ */
|
|
161
|
-
className:
|
|
159
|
+
}), E = ({ children: e, heading: t }) => {
|
|
160
|
+
let n = l.useId();
|
|
161
|
+
return /* @__PURE__ */ v("div", {
|
|
162
|
+
className: c.group,
|
|
162
163
|
role: "group",
|
|
163
164
|
"aria-labelledby": t ? n : void 0,
|
|
164
|
-
children: [t && /* @__PURE__ */
|
|
165
|
+
children: [t && /* @__PURE__ */ _("div", {
|
|
165
166
|
id: n,
|
|
166
|
-
className:
|
|
167
|
+
className: c.groupHeading,
|
|
167
168
|
"aria-hidden": "true",
|
|
168
169
|
children: t
|
|
169
170
|
}), e]
|
|
170
171
|
});
|
|
171
|
-
},
|
|
172
|
-
let { activeIndex: a, setActiveIndex:
|
|
173
|
-
return
|
|
174
|
-
|
|
172
|
+
}, D = ({ children: e, onSelect: t, icon: n, shortcut: r, disabled: i }) => {
|
|
173
|
+
let { activeIndex: a, setActiveIndex: o, registerItem: l, onOpenChange: u } = b(), [d] = h(() => l()), f = a === d;
|
|
174
|
+
return p(() => {
|
|
175
|
+
f && !i && document.getElementById(`wim-command-palette-item-${d}`)?.scrollIntoView({ block: "nearest" });
|
|
175
176
|
}, [
|
|
176
|
-
|
|
177
|
+
f,
|
|
177
178
|
i,
|
|
178
179
|
d
|
|
179
|
-
]), /* @__PURE__ */
|
|
180
|
+
]), /* @__PURE__ */ _(s, {
|
|
180
181
|
role: "option",
|
|
181
182
|
id: `wim-command-palette-item-${d}`,
|
|
182
|
-
"aria-selected":
|
|
183
|
-
className:
|
|
184
|
-
active:
|
|
183
|
+
"aria-selected": f,
|
|
184
|
+
className: c.item,
|
|
185
|
+
active: f,
|
|
185
186
|
disabled: i,
|
|
186
187
|
icon: n,
|
|
187
|
-
rightSection: r && /* @__PURE__ */
|
|
188
|
-
className:
|
|
189
|
-
children: r.map((e) => /* @__PURE__ */
|
|
190
|
-
className:
|
|
188
|
+
rightSection: r && /* @__PURE__ */ _("div", {
|
|
189
|
+
className: c.shortcut,
|
|
190
|
+
children: r.map((e) => /* @__PURE__ */ _("kbd", {
|
|
191
|
+
className: c.kbd,
|
|
191
192
|
children: e
|
|
192
193
|
}, e))
|
|
193
194
|
}),
|
|
194
|
-
onMouseEnter: () => !i &&
|
|
195
|
+
onMouseEnter: () => !i && o(d),
|
|
195
196
|
onClick: () => {
|
|
196
197
|
i || (t?.(), u(!1));
|
|
197
198
|
},
|
|
198
199
|
children: e
|
|
199
200
|
});
|
|
200
|
-
},
|
|
201
|
-
let { t: n } = e(
|
|
202
|
-
return
|
|
203
|
-
if (
|
|
201
|
+
}, O = ({ children: t }) => {
|
|
202
|
+
let { t: n } = e(i), r = t ?? n("command_palette.no_results"), { open: a, search: o } = b(), [s, l] = h(!1);
|
|
203
|
+
return p(() => {
|
|
204
|
+
if (a) {
|
|
204
205
|
let e = setTimeout(() => {
|
|
205
|
-
let e = document.querySelectorAll(`.${
|
|
206
|
-
|
|
206
|
+
let e = document.querySelectorAll(`.${c.item}`);
|
|
207
|
+
l(e.length === 0);
|
|
207
208
|
}, 0);
|
|
208
209
|
return () => clearTimeout(e);
|
|
209
210
|
}
|
|
210
|
-
}, [
|
|
211
|
-
className:
|
|
211
|
+
}, [a, o]), !a || !s ? null : /* @__PURE__ */ _("div", {
|
|
212
|
+
className: c.empty,
|
|
212
213
|
children: r
|
|
213
214
|
});
|
|
214
|
-
},
|
|
215
|
-
className:
|
|
215
|
+
}, k = ({ children: e }) => /* @__PURE__ */ _("div", {
|
|
216
|
+
className: c.footer,
|
|
216
217
|
children: e
|
|
217
218
|
});
|
|
218
219
|
//#endregion
|
|
219
|
-
export {
|
|
220
|
+
export { x as CommandPalette, C as CommandPaletteContent, O as CommandPaletteEmpty, k as CommandPaletteFooter, E as CommandPaletteGroup, w as CommandPaletteInput, D as CommandPaletteItem, T as CommandPaletteList, S as CommandPaletteTrigger };
|
|
@@ -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("./hamburger-menu.module.cjs");let
|
|
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("../../../hooks/useMergedRef.cjs"),a=require("./hamburger-menu.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=o.default.forwardRef(({asChild:e=!1,open:l=!1,onClick:u,onOpenChange:d,size:f=`md`,color:p,visibleBelow:m,className:h,style:g,children:_,"aria-label":v,...y},b)=>{let{t:x}=n.useWimTranslation(r.commonNs),S=e?t.Root:`button`,C=(0,o.useRef)(null),w=i.useMergedRef(b,C);return(0,o.useEffect)(()=>{if(!l||!d)return;let e=e=>{e.key!==`Escape`||e.defaultPrevented||(C.current?.focus({preventScroll:!0}),d(!1))};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[l,d]),(0,c.jsxs)(S,{ref:w,type:e?void 0:`button`,className:(0,s.default)(`wim-hamburger-menu`,a.default.root,a.default[f],l&&a.default.open,m&&a.default[`visibleBelow${m.charAt(0).toUpperCase()}${m.slice(1)}`],h),onClick:e=>{u?.(e),e.defaultPrevented||d?.(!l)},"aria-expanded":l,"aria-label":v??x(l?`a11y.close_menu`:`a11y.open_menu`),style:{...g,...p?{"--wim-hamburger-color":p}:{}},...y,children:[(0,c.jsx)(`div`,{className:a.default.box,children:(0,c.jsx)(`div`,{className:a.default.inner})}),e?(0,c.jsx)(t.Slottable,{children:_}):null]})});l.displayName=`HamburgerMenu`,exports.HamburgerMenu=l;
|
|
@@ -10,6 +10,12 @@ export interface HamburgerMenuProps extends React.ComponentPropsWithoutRef<"butt
|
|
|
10
10
|
open?: boolean;
|
|
11
11
|
/** Callback function when the menu is toggled */
|
|
12
12
|
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
13
|
+
/**
|
|
14
|
+
* Called with the next open state: the opposite of `open` when the button is pressed, and
|
|
15
|
+
* false when Escape is pressed while the menu is open. Escape also moves focus back to the
|
|
16
|
+
* button. Without this callback the button cannot close on Escape, because `open` is controlled.
|
|
17
|
+
*/
|
|
18
|
+
onOpenChange?: (open: boolean) => void;
|
|
13
19
|
/** Size of the hamburger menu */
|
|
14
20
|
size?: ComponentSizeBasic;
|
|
15
21
|
/** Color of the bars */
|
|
@@ -1,31 +1,41 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Root as e, Slottable as t } from "../../../node_modules/@radix-ui/react-slot/dist/index.js";
|
|
3
3
|
import { useWimTranslation as n } from "../../../i18n/useWimTranslation.js";
|
|
4
|
-
import r from "
|
|
5
|
-
import i from "
|
|
6
|
-
import a from "
|
|
7
|
-
import {
|
|
4
|
+
import { commonNs as r } from "../../../i18n/generated/common.js";
|
|
5
|
+
import { useMergedRef as i } from "../../../hooks/useMergedRef.js";
|
|
6
|
+
import a from "./hamburger-menu.module.js";
|
|
7
|
+
import o, { useEffect as s, useRef as c } from "react";
|
|
8
|
+
import l from "classnames";
|
|
9
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
8
10
|
//#region src/components/navigation/HamburgerMenu/HamburgerMenu.tsx
|
|
9
|
-
var
|
|
10
|
-
let { t:
|
|
11
|
-
return
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"
|
|
17
|
-
|
|
11
|
+
var f = o.forwardRef(({ asChild: o = !1, open: f = !1, onClick: p, onOpenChange: m, size: h = "md", color: g, visibleBelow: _, className: v, style: y, children: b, "aria-label": x, ...S }, C) => {
|
|
12
|
+
let { t: w } = n(r), T = o ? e : "button", E = c(null), D = i(C, E);
|
|
13
|
+
return s(() => {
|
|
14
|
+
if (!f || !m) return;
|
|
15
|
+
let e = (e) => {
|
|
16
|
+
e.key !== "Escape" || e.defaultPrevented || (E.current?.focus({ preventScroll: !0 }), m(!1));
|
|
17
|
+
};
|
|
18
|
+
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
19
|
+
}, [f, m]), /* @__PURE__ */ d(T, {
|
|
20
|
+
ref: D,
|
|
21
|
+
type: o ? void 0 : "button",
|
|
22
|
+
className: l("wim-hamburger-menu", a.root, a[h], f && a.open, _ && a[`visibleBelow${_.charAt(0).toUpperCase()}${_.slice(1)}`], v),
|
|
23
|
+
onClick: (e) => {
|
|
24
|
+
p?.(e), e.defaultPrevented || m?.(!f);
|
|
25
|
+
},
|
|
26
|
+
"aria-expanded": f,
|
|
27
|
+
"aria-label": x ?? w(f ? "a11y.close_menu" : "a11y.open_menu"),
|
|
18
28
|
style: {
|
|
19
|
-
...
|
|
20
|
-
...
|
|
29
|
+
...y,
|
|
30
|
+
...g ? { "--wim-hamburger-color": g } : {}
|
|
21
31
|
},
|
|
22
|
-
...
|
|
23
|
-
children: [/* @__PURE__ */
|
|
24
|
-
className:
|
|
25
|
-
children: /* @__PURE__ */
|
|
26
|
-
}),
|
|
32
|
+
...S,
|
|
33
|
+
children: [/* @__PURE__ */ u("div", {
|
|
34
|
+
className: a.box,
|
|
35
|
+
children: /* @__PURE__ */ u("div", { className: a.inner })
|
|
36
|
+
}), o ? /* @__PURE__ */ u(t, { children: b }) : null]
|
|
27
37
|
});
|
|
28
38
|
});
|
|
29
|
-
|
|
39
|
+
f.displayName = "HamburgerMenu";
|
|
30
40
|
//#endregion
|
|
31
|
-
export {
|
|
41
|
+
export { f as HamburgerMenu };
|
|
@@ -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("../../../icon/chevron-left.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/chevron-left.cjs"),a=require("../../../icon/chevron-right.cjs"),o=require("../../media/Icon/Icon.cjs"),s=require("../../form/Button/Button.cjs"),c=require("../../form/Input/Input.cjs"),l=require("../../form/Select/Select.cjs"),u=require("./pagination.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=d.default.forwardRef(({asChild:e=!1,className:n,children:r,page:i,isActive:a,...o},s)=>(0,p.jsx)(e?t.Root:`button`,{ref:s,type:e?void 0:`button`,className:(0,f.default)(u.default.button,n),"aria-current":a?`page`:void 0,...o,children:e?(0,p.jsx)(t.Slottable,{children:r}):r}));m.displayName=`PaginationPage`;var h=`...`,g=({total:e,pageSize:g=10,current:_=1,onChange:v,onPageSizeChange:y,siblingCount:b=1,className:x,asChild:S=!1,children:C,renderPage:w,hideOnSinglePage:T=!1,simple:E=!1,showSizeChanger:ee=!1,pageSizeOptions:D=[10,20,50,100],showTotal:O,showQuickJumper:k=!1,labels:A={}})=>{let{t:j}=n.useWimTranslation(r.commonNs),{prevPage:M=j(`a11y.go_to_prev_page`),nextPage:N=j(`a11y.go_to_next_page`),pageAriaLabel:P=e=>j(`a11y.go_to_page`,{page:String(e)}),itemsPerPage:F=j(`pagination.items_per_page`),goTo:I=j(`pagination.go_to`),go:L=j(`pagination.go`),pageSizeAriaLabel:R=j(`a11y.items_per_page`),jumpToPageAriaLabel:z=j(`a11y.jump_to_page`),navAriaLabel:B=j(`a11y.pagination_nav`)}=A,[V,H]=(0,d.useState)(g),[U,W]=(0,d.useState)(``),G=V,K=Math.ceil(e/G),q=(0,d.useMemo)(()=>{if(b+5>=K)return Array.from({length:K},(e,t)=>t+1);let e=Math.max(_-b,1),t=Math.min(_+b,K),n=e>2,r=t<K-2,i=K;if(!n&&r){let e=3+2*b;return[...Array.from({length:e},(e,t)=>t+1),h,K]}if(n&&!r){let e=3+2*b;return[1,h,...Array.from({length:e},(t,n)=>K-e+n+1)]}return n&&r?[1,h,...Array.from({length:t-e+1},(t,n)=>e+n),h,i]:[]},[K,b,_]);if(T&&K<=1)return null;let J=e=>{e<1||e>K||e===_||v?.(e,G)},Y=e=>{H(e),y?.(e),v?.(1,e)},X=()=>{let e=parseInt(U);!isNaN(e)&&e>=1&&e<=K&&(J(e),W(``))},Z=e=>{e.key===`Enter`&&X()},Q=(_-1)*G+1,te=Math.min(_*G,e),$=S?t.Root:`nav`,ne=e=>{let t={page:e,isActive:e===_,onClick:()=>J(e),"aria-label":P(e)};return w?w(e,t):(0,p.jsx)(m,{...t,children:e})};return E?(0,p.jsxs)($,{className:(0,f.default)(`wim-pagination`,u.default.root,u.default.simple,x),"aria-label":B,children:[(0,p.jsx)(t.Slottable,{children:C}),(0,p.jsxs)(`ul`,{className:u.default.root,children:[(0,p.jsx)(`li`,{className:(0,f.default)(u.default.item,_===1&&u.default.disabled),children:(0,p.jsx)(`button`,{className:u.default.button,onClick:()=>J(_-1),disabled:_===1,"aria-label":M,children:(0,p.jsx)(o.Icon,{component:i.default,size:`sm`})})}),(0,p.jsx)(`li`,{className:(0,f.default)(u.default.item,u.default.simplePager),children:(0,p.jsxs)(`span`,{children:[_,` / `,K]})}),(0,p.jsx)(`li`,{className:(0,f.default)(u.default.item,_===K&&u.default.disabled),children:(0,p.jsx)(`button`,{className:u.default.button,onClick:()=>J(_+1),disabled:_===K,"aria-label":N,children:(0,p.jsx)(o.Icon,{component:a.default,size:`sm`})})})]})]}):(0,p.jsx)(`div`,{className:(0,f.default)(`wim-pagination`,u.default.container,x),children:(0,p.jsxs)(`div`,{className:u.default.wrapper,children:[O&&(0,p.jsx)(`div`,{className:u.default.total,children:O(e,[Q,te])}),(0,p.jsxs)($,{className:u.default.root,"aria-label":B,children:[(0,p.jsx)(t.Slottable,{children:C}),(0,p.jsxs)(`ul`,{className:u.default.root,children:[(0,p.jsx)(`li`,{className:(0,f.default)(u.default.item,_===1&&u.default.disabled),children:(0,p.jsx)(`button`,{className:u.default.button,onClick:()=>J(_-1),disabled:_===1,"aria-label":M,children:(0,p.jsx)(o.Icon,{component:i.default,size:`sm`})})}),(0,p.jsx)(`li`,{className:(0,f.default)(u.default.item,u.default.mobileIndicator),children:(0,p.jsxs)(`span`,{children:[_,` / `,K]})}),q.map((e,t)=>e===h?(0,p.jsx)(`li`,{className:(0,f.default)(u.default.item,u.default.ellipsis),"aria-hidden":`true`,children:h},`ellipsis-${t}`):(0,p.jsx)(`li`,{className:(0,f.default)(u.default.item,u.default.number,e===_&&u.default.active),children:ne(e)},e)),(0,p.jsx)(`li`,{className:(0,f.default)(u.default.item,_===K&&u.default.disabled),children:(0,p.jsx)(`button`,{className:u.default.button,onClick:()=>J(_+1),disabled:_===K,"aria-label":N,children:(0,p.jsx)(o.Icon,{component:a.default,size:`sm`})})})]})]}),ee&&(0,p.jsx)(`div`,{className:u.default.sizeChanger,children:(0,p.jsx)(l.Select,{value:String(G),onChange:e=>Y(Number(e)),options:D.map(e=>({label:`${e} ${F}`,value:String(e)})),width:`auto`,"aria-label":R})}),k&&(0,p.jsxs)(`div`,{className:u.default.quickJumper,children:[(0,p.jsx)(`span`,{children:I}),(0,p.jsx)(c.Input,{type:`number`,min:1,max:K,value:U,onChange:e=>W(e.target.value),onKeyDown:Z,width:`60px`,"aria-label":z}),(0,p.jsx)(s.Button,{size:`sm`,variant:`outline`,onClick:X,disabled:!U,children:L})]})]})})};exports.Pagination=g,exports.default=g,exports.PaginationPage=m;
|