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,178 +1,179 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useWimTranslation as e } from "../../../../i18n/useWimTranslation.js";
|
|
3
|
-
import t from "../../../../
|
|
4
|
-
import n from "../../../../icon/chevron-
|
|
5
|
-
import r from "../../../../icon/
|
|
6
|
-
import i from "../../../../icon/
|
|
7
|
-
import a from "../../../../icon/
|
|
8
|
-
import o from "../../../../icon/
|
|
9
|
-
import s from "../../../../icon/
|
|
10
|
-
import c from "../../../../icon/
|
|
11
|
-
import l from "../../../../icon/
|
|
12
|
-
import u from "../../../../icon/
|
|
13
|
-
import d from "../../../../icon/
|
|
14
|
-
import
|
|
3
|
+
import { commonNs as t } from "../../../../i18n/generated/common.js";
|
|
4
|
+
import n from "../../../../icon/chevron-left.js";
|
|
5
|
+
import r from "../../../../icon/chevron-right.js";
|
|
6
|
+
import i from "../../../../icon/document.js";
|
|
7
|
+
import a from "../../../../icon/maximize.js";
|
|
8
|
+
import o from "../../../../icon/minimize.js";
|
|
9
|
+
import s from "../../../../icon/monitor.js";
|
|
10
|
+
import c from "../../../../icon/mute.js";
|
|
11
|
+
import l from "../../../../icon/pause.js";
|
|
12
|
+
import u from "../../../../icon/play.js";
|
|
13
|
+
import d from "../../../../icon/settings.js";
|
|
14
|
+
import f from "../../../../icon/volume.js";
|
|
15
|
+
import { Icon as p } from "../../Icon/Icon.js";
|
|
15
16
|
import "react";
|
|
16
|
-
import
|
|
17
|
-
import { jsx as
|
|
17
|
+
import m from "classnames";
|
|
18
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
18
19
|
//#region src/components/media/Video/components/VideoControls.tsx
|
|
19
|
-
function
|
|
20
|
-
let { t:
|
|
21
|
-
return /* @__PURE__ */
|
|
22
|
-
className:
|
|
20
|
+
function _({ playlist: _, advancedControls: v, currentPlayIndex: y, setCurrentPlayIndex: b, skip: x, isPlaying: S, togglePlay: C, currentTime: w, duration: T, handleSeek: E, volume: D, isMuted: O, toggleMute: k, handleVolumeChange: A, activeMenu: j, setActiveMenu: M, togglePiP: N, isFullscreen: P, toggleFullscreen: F, formatTime: I, labels: L = {}, styles: R }) {
|
|
21
|
+
let { t: z } = e(t), { playlist: B = z("a11y.playlist"), skipBackward: V = z("a11y.skip_backward"), skipForward: H = z("a11y.skip_forward"), play: U = z("a11y.play"), pause: W = z("a11y.pause"), nextTrack: G = z("a11y.next_track"), seek: K = z("a11y.seek"), mute: q = z("a11y.mute"), unmute: J = z("a11y.unmute"), volume: Y = z("a11y.volume"), settings: X = z("a11y.settings"), pip: Z = z("a11y.picture_in_picture"), fullscreen: Q = z("a11y.fullscreen"), exitFullscreen: $ = z("a11y.exit_fullscreen") } = L;
|
|
22
|
+
return /* @__PURE__ */ g("div", {
|
|
23
|
+
className: m(R.controlsBottom),
|
|
23
24
|
children: [
|
|
24
|
-
|
|
25
|
+
_ && _.length > 0 && v && /* @__PURE__ */ h("button", {
|
|
25
26
|
type: "button",
|
|
26
|
-
className:
|
|
27
|
+
className: m(R.btn),
|
|
27
28
|
onClick: (e) => {
|
|
28
|
-
e.stopPropagation(), j
|
|
29
|
+
e.stopPropagation(), M(j === "playlist" ? null : "playlist");
|
|
29
30
|
},
|
|
30
|
-
"aria-label":
|
|
31
|
-
children: /* @__PURE__ */
|
|
32
|
-
component:
|
|
31
|
+
"aria-label": B,
|
|
32
|
+
children: /* @__PURE__ */ h(p, {
|
|
33
|
+
component: i,
|
|
33
34
|
size: "sm"
|
|
34
35
|
})
|
|
35
36
|
}),
|
|
36
|
-
|
|
37
|
+
v && /* @__PURE__ */ h("button", {
|
|
37
38
|
type: "button",
|
|
38
|
-
className:
|
|
39
|
+
className: m(R.btn),
|
|
39
40
|
onClick: (e) => {
|
|
40
|
-
e.stopPropagation(),
|
|
41
|
+
e.stopPropagation(), x(-10);
|
|
41
42
|
},
|
|
42
|
-
"aria-label":
|
|
43
|
-
children: /* @__PURE__ */
|
|
44
|
-
component:
|
|
43
|
+
"aria-label": V,
|
|
44
|
+
children: /* @__PURE__ */ h(p, {
|
|
45
|
+
component: n,
|
|
45
46
|
size: "sm"
|
|
46
47
|
})
|
|
47
48
|
}),
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
+
/* @__PURE__ */ h("button", {
|
|
49
50
|
type: "button",
|
|
50
|
-
className:
|
|
51
|
+
className: m(R.btn, R.btnPlay),
|
|
51
52
|
onClick: (e) => {
|
|
52
|
-
e.stopPropagation(),
|
|
53
|
+
e.stopPropagation(), C();
|
|
53
54
|
},
|
|
54
|
-
"aria-label":
|
|
55
|
-
children: /* @__PURE__ */
|
|
56
|
-
component:
|
|
55
|
+
"aria-label": S ? W : U,
|
|
56
|
+
children: /* @__PURE__ */ h(p, {
|
|
57
|
+
component: S ? l : u,
|
|
57
58
|
size: "sm"
|
|
58
59
|
})
|
|
59
60
|
}),
|
|
60
|
-
|
|
61
|
+
v && /* @__PURE__ */ h("button", {
|
|
61
62
|
type: "button",
|
|
62
|
-
className:
|
|
63
|
+
className: m(R.btn),
|
|
63
64
|
onClick: (e) => {
|
|
64
|
-
e.stopPropagation(),
|
|
65
|
+
e.stopPropagation(), x(10);
|
|
65
66
|
},
|
|
66
|
-
"aria-label":
|
|
67
|
-
children: /* @__PURE__ */
|
|
68
|
-
component:
|
|
67
|
+
"aria-label": H,
|
|
68
|
+
children: /* @__PURE__ */ h(p, {
|
|
69
|
+
component: r,
|
|
69
70
|
size: "sm"
|
|
70
71
|
})
|
|
71
72
|
}),
|
|
72
|
-
|
|
73
|
+
_ && _.length > 0 && v && /* @__PURE__ */ h("button", {
|
|
73
74
|
type: "button",
|
|
74
|
-
className:
|
|
75
|
+
className: m(R.btn),
|
|
75
76
|
onClick: (e) => {
|
|
76
|
-
e.stopPropagation(),
|
|
77
|
+
e.stopPropagation(), y < _.length - 1 && b((e) => e + 1);
|
|
77
78
|
},
|
|
78
|
-
disabled:
|
|
79
|
-
style: { opacity:
|
|
80
|
-
"aria-label":
|
|
81
|
-
children: /* @__PURE__ */
|
|
82
|
-
component:
|
|
79
|
+
disabled: y >= _.length - 1,
|
|
80
|
+
style: { opacity: y >= _.length - 1 ? .5 : 1 },
|
|
81
|
+
"aria-label": G,
|
|
82
|
+
children: /* @__PURE__ */ h(p, {
|
|
83
|
+
component: r,
|
|
83
84
|
size: "md"
|
|
84
85
|
})
|
|
85
86
|
}),
|
|
86
|
-
/* @__PURE__ */
|
|
87
|
-
className:
|
|
87
|
+
/* @__PURE__ */ g("div", {
|
|
88
|
+
className: m(R.timeContainer),
|
|
88
89
|
children: [
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
-
className:
|
|
91
|
-
children:
|
|
90
|
+
/* @__PURE__ */ h("span", {
|
|
91
|
+
className: R.timeCurrent,
|
|
92
|
+
children: I(w)
|
|
92
93
|
}),
|
|
93
|
-
/* @__PURE__ */
|
|
94
|
-
className:
|
|
95
|
-
children: [/* @__PURE__ */
|
|
94
|
+
/* @__PURE__ */ g("div", {
|
|
95
|
+
className: m(R.progressContainer),
|
|
96
|
+
children: [/* @__PURE__ */ h("input", {
|
|
96
97
|
type: "range",
|
|
97
98
|
min: "0",
|
|
98
|
-
max:
|
|
99
|
-
value:
|
|
100
|
-
onChange:
|
|
101
|
-
className:
|
|
102
|
-
"aria-label":
|
|
99
|
+
max: T || 0,
|
|
100
|
+
value: w,
|
|
101
|
+
onChange: E,
|
|
102
|
+
className: m(R.progress),
|
|
103
|
+
"aria-label": K,
|
|
103
104
|
onClick: (e) => e.stopPropagation()
|
|
104
|
-
}), /* @__PURE__ */
|
|
105
|
-
className:
|
|
106
|
-
style: { width: `${
|
|
105
|
+
}), /* @__PURE__ */ h("div", {
|
|
106
|
+
className: m(R.progressFill),
|
|
107
|
+
style: { width: `${w / (T || 1) * 100}%` }
|
|
107
108
|
})]
|
|
108
109
|
}),
|
|
109
|
-
/* @__PURE__ */
|
|
110
|
-
className:
|
|
111
|
-
children:
|
|
110
|
+
/* @__PURE__ */ h("span", {
|
|
111
|
+
className: R.timeTotal,
|
|
112
|
+
children: I(T)
|
|
112
113
|
})
|
|
113
114
|
]
|
|
114
115
|
}),
|
|
115
|
-
/* @__PURE__ */
|
|
116
|
-
className:
|
|
117
|
-
children: [/* @__PURE__ */
|
|
116
|
+
/* @__PURE__ */ g("div", {
|
|
117
|
+
className: m(R.volumeContainer),
|
|
118
|
+
children: [/* @__PURE__ */ h("button", {
|
|
118
119
|
type: "button",
|
|
119
|
-
className:
|
|
120
|
+
className: m(R.btn),
|
|
120
121
|
onClick: (e) => {
|
|
121
|
-
e.stopPropagation(),
|
|
122
|
+
e.stopPropagation(), k();
|
|
122
123
|
},
|
|
123
|
-
"aria-label":
|
|
124
|
-
children: /* @__PURE__ */
|
|
125
|
-
component:
|
|
124
|
+
"aria-label": O ? J : q,
|
|
125
|
+
children: /* @__PURE__ */ h(p, {
|
|
126
|
+
component: O || D === 0 ? c : f,
|
|
126
127
|
size: "sm"
|
|
127
128
|
})
|
|
128
|
-
}), /* @__PURE__ */
|
|
129
|
+
}), /* @__PURE__ */ h("input", {
|
|
129
130
|
type: "range",
|
|
130
131
|
min: "0",
|
|
131
132
|
max: "1",
|
|
132
133
|
step: "0.1",
|
|
133
|
-
value:
|
|
134
|
+
value: O ? 0 : D,
|
|
134
135
|
onChange: (e) => {
|
|
135
|
-
e.stopPropagation(),
|
|
136
|
+
e.stopPropagation(), A(e);
|
|
136
137
|
},
|
|
137
|
-
className:
|
|
138
|
-
"aria-label":
|
|
138
|
+
className: m(R.volume),
|
|
139
|
+
"aria-label": Y,
|
|
139
140
|
onClick: (e) => e.stopPropagation()
|
|
140
141
|
})]
|
|
141
142
|
}),
|
|
142
|
-
|
|
143
|
+
v && /* @__PURE__ */ h("button", {
|
|
143
144
|
type: "button",
|
|
144
|
-
className:
|
|
145
|
+
className: m(R.btn),
|
|
145
146
|
onClick: (e) => {
|
|
146
|
-
e.stopPropagation(), j
|
|
147
|
+
e.stopPropagation(), M(j === "main" ? null : "main");
|
|
147
148
|
},
|
|
148
|
-
"aria-label":
|
|
149
|
-
children: /* @__PURE__ */
|
|
150
|
-
component:
|
|
149
|
+
"aria-label": X,
|
|
150
|
+
children: /* @__PURE__ */ h(p, {
|
|
151
|
+
component: d,
|
|
151
152
|
size: "sm"
|
|
152
153
|
})
|
|
153
154
|
}),
|
|
154
|
-
|
|
155
|
+
v && /* @__PURE__ */ h("button", {
|
|
155
156
|
type: "button",
|
|
156
|
-
className:
|
|
157
|
+
className: m(R.btn),
|
|
157
158
|
onClick: (e) => {
|
|
158
|
-
e.stopPropagation(),
|
|
159
|
+
e.stopPropagation(), N();
|
|
159
160
|
},
|
|
160
|
-
"aria-label":
|
|
161
|
-
title:
|
|
162
|
-
children: /* @__PURE__ */
|
|
163
|
-
component:
|
|
161
|
+
"aria-label": Z,
|
|
162
|
+
title: Z,
|
|
163
|
+
children: /* @__PURE__ */ h(p, {
|
|
164
|
+
component: s,
|
|
164
165
|
size: "sm"
|
|
165
166
|
})
|
|
166
167
|
}),
|
|
167
|
-
/* @__PURE__ */
|
|
168
|
+
/* @__PURE__ */ h("button", {
|
|
168
169
|
type: "button",
|
|
169
|
-
className:
|
|
170
|
+
className: m(R.btn),
|
|
170
171
|
onClick: (e) => {
|
|
171
|
-
e.stopPropagation(),
|
|
172
|
+
e.stopPropagation(), F();
|
|
172
173
|
},
|
|
173
|
-
"aria-label":
|
|
174
|
-
children: /* @__PURE__ */
|
|
175
|
-
component:
|
|
174
|
+
"aria-label": P ? $ : Q,
|
|
175
|
+
children: /* @__PURE__ */ h(p, {
|
|
176
|
+
component: P ? o : a,
|
|
176
177
|
size: "sm"
|
|
177
178
|
})
|
|
178
179
|
})
|
|
@@ -180,4 +181,4 @@ function g({ playlist: g, advancedControls: _, currentPlayIndex: v, setCurrentPl
|
|
|
180
181
|
});
|
|
181
182
|
}
|
|
182
183
|
//#endregion
|
|
183
|
-
export {
|
|
184
|
+
export { _ as VideoControls };
|
|
@@ -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-up.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-up.cjs"),a=require("../../media/Icon/Icon.cjs"),o=require("./backtop.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(({target:e=()=>window,visibilityHeight:u=400,onClick:d,children:f,className:p,style:m,"aria-label":h,asChild:g=!1},_)=>{let{t:v}=n.useWimTranslation(r.commonNs),[y,b]=(0,s.useState)(!1),x=(0,s.useCallback)(e=>e===window||e instanceof Window?window.pageYOffset||document.documentElement.scrollTop:e instanceof Document?document.documentElement.scrollTop:e.scrollTop,[]),S=(0,s.useCallback)(()=>{let t=e();if(!t)return;let n=x(t);b(n>u)},[e,u,x]);(0,s.useEffect)(()=>{let t=e();if(t)return requestAnimationFrame(S),t.addEventListener(`scroll`,S),()=>{t.removeEventListener(`scroll`,S)}},[e,S]);let C=t=>{let n=e();n&&(n===window||n instanceof Window?window.scrollTo({top:0,behavior:`smooth`}):n instanceof Document?document.documentElement.scrollTo({top:0,behavior:`smooth`}):n.scrollTo({top:0,behavior:`smooth`}),d?.(t))},w=(0,l.jsx)(`div`,{className:o.default.content,children:(0,l.jsx)(a.Icon,{component:i.default,className:o.default.icon})});return(0,l.jsx)(g?t.Root:`div`,{ref:_,className:(0,c.default)(`wim-back-top`,o.default.root,!y&&o.default.hidden,p),style:m,onClick:C,role:`button`,tabIndex:0,"aria-label":h??v(`a11y.back_to_top`),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&e.currentTarget.click()},children:(0,l.jsx)(t.Slottable,{children:f||w})})});u.displayName=`BackTop`,exports.BackTop=u,exports.default=u;
|
|
@@ -1,32 +1,33 @@
|
|
|
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
|
|
6
|
-
import a from "
|
|
7
|
-
import o
|
|
8
|
-
import u from "
|
|
9
|
-
import
|
|
4
|
+
import { commonNs as r } from "../../../i18n/generated/common.js";
|
|
5
|
+
import i from "../../../icon/chevron-up.js";
|
|
6
|
+
import { Icon as a } from "../../media/Icon/Icon.js";
|
|
7
|
+
import o from "./backtop.module.js";
|
|
8
|
+
import s, { useCallback as c, useEffect as l, useState as u } from "react";
|
|
9
|
+
import d from "classnames";
|
|
10
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
10
11
|
//#region src/components/navigation/BackTop/BackTop.tsx
|
|
11
|
-
var
|
|
12
|
-
let { t:
|
|
13
|
-
let e =
|
|
12
|
+
var p = s.forwardRef(({ target: s = () => window, visibilityHeight: p = 400, onClick: m, children: h, className: g, style: _, "aria-label": v, asChild: y = !1 }, b) => {
|
|
13
|
+
let { t: x } = n(r), [S, C] = u(!1), w = c((e) => e === window || e instanceof Window ? window.pageYOffset || document.documentElement.scrollTop : e instanceof Document ? document.documentElement.scrollTop : e.scrollTop, []), T = c(() => {
|
|
14
|
+
let e = s();
|
|
14
15
|
if (!e) return;
|
|
15
|
-
let t =
|
|
16
|
-
|
|
16
|
+
let t = w(e);
|
|
17
|
+
C(t > p);
|
|
17
18
|
}, [
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
s,
|
|
20
|
+
p,
|
|
21
|
+
w
|
|
21
22
|
]);
|
|
22
|
-
|
|
23
|
-
let e =
|
|
24
|
-
if (e) return requestAnimationFrame(
|
|
25
|
-
e.removeEventListener("scroll",
|
|
23
|
+
l(() => {
|
|
24
|
+
let e = s();
|
|
25
|
+
if (e) return requestAnimationFrame(T), e.addEventListener("scroll", T), () => {
|
|
26
|
+
e.removeEventListener("scroll", T);
|
|
26
27
|
};
|
|
27
|
-
}, [
|
|
28
|
-
let
|
|
29
|
-
let t =
|
|
28
|
+
}, [s, T]);
|
|
29
|
+
let E = (e) => {
|
|
30
|
+
let t = s();
|
|
30
31
|
t && (t === window || t instanceof Window ? window.scrollTo({
|
|
31
32
|
top: 0,
|
|
32
33
|
behavior: "smooth"
|
|
@@ -36,28 +37,28 @@ var f = o.forwardRef(({ target: o = () => window, visibilityHeight: f = 400, onC
|
|
|
36
37
|
}) : t.scrollTo({
|
|
37
38
|
top: 0,
|
|
38
39
|
behavior: "smooth"
|
|
39
|
-
}),
|
|
40
|
-
},
|
|
41
|
-
className:
|
|
42
|
-
children: /* @__PURE__ */
|
|
43
|
-
component:
|
|
44
|
-
className:
|
|
40
|
+
}), m?.(e));
|
|
41
|
+
}, D = /* @__PURE__ */ f("div", {
|
|
42
|
+
className: o.content,
|
|
43
|
+
children: /* @__PURE__ */ f(a, {
|
|
44
|
+
component: i,
|
|
45
|
+
className: o.icon
|
|
45
46
|
})
|
|
46
47
|
});
|
|
47
|
-
return /* @__PURE__ */
|
|
48
|
-
ref:
|
|
49
|
-
className:
|
|
50
|
-
style:
|
|
51
|
-
onClick:
|
|
48
|
+
return /* @__PURE__ */ f(y ? e : "div", {
|
|
49
|
+
ref: b,
|
|
50
|
+
className: d("wim-back-top", o.root, !S && o.hidden, g),
|
|
51
|
+
style: _,
|
|
52
|
+
onClick: E,
|
|
52
53
|
role: "button",
|
|
53
54
|
tabIndex: 0,
|
|
54
|
-
"aria-label":
|
|
55
|
+
"aria-label": v ?? x("a11y.back_to_top"),
|
|
55
56
|
onKeyDown: (e) => {
|
|
56
57
|
(e.key === "Enter" || e.key === " ") && e.currentTarget.click();
|
|
57
58
|
},
|
|
58
|
-
children: /* @__PURE__ */
|
|
59
|
+
children: /* @__PURE__ */ f(t, { children: h || D })
|
|
59
60
|
});
|
|
60
61
|
});
|
|
61
|
-
|
|
62
|
+
p.displayName = "BackTop";
|
|
62
63
|
//#endregion
|
|
63
|
-
export {
|
|
64
|
+
export { p as BackTop, p as default };
|
|
@@ -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-right.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-right.cjs"),a=require("../../media/Icon/Icon.cjs"),o=require("./breadcrumb.module.cjs"),s=require("../Link/Link.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)(({items:e,separator:c,size:d=`md`,className:f,ariaLabel:p,asChild:m,...h},g)=>{let{t:_}=n.useWimTranslation(r.commonNs),v=p??_(`a11y.breadcrumb`),y=m?t.Root:`nav`,b=(0,u.jsx)(a.Icon,{component:i.default,size:d,className:o.default.separatorIcon});return(0,u.jsx)(y,{ref:g,"aria-label":v,className:(0,l.default)(`wim-breadcrumb`,o.default.root,o.default[d],f),onKeyDown:e=>{let t=e.currentTarget,n=Array.from(t.querySelectorAll(`.${o.default.link}, .${o.default.label}.${o.default.current}`)),r=n.indexOf(document.activeElement);r!==-1&&(e.key===`ArrowRight`?(e.preventDefault(),n[(r+1)%n.length].focus()):e.key===`ArrowLeft`&&(e.preventDefault(),n[(r-1+n.length)%n.length].focus()))},...h,children:(0,u.jsx)(`ol`,{className:o.default.list,children:e.map((t,n)=>{let r=n===e.length-1;return(0,u.jsxs)(`li`,{className:o.default.item,children:[(0,u.jsx)(`div`,{className:o.default.content,children:t.href&&!r?(0,u.jsx)(s.Link,{href:t.href,size:d,priority:`secondary`,iconName:t.iconName,className:o.default.link,styles:{label:o.default.linkLabel},children:t.label}):(0,u.jsxs)(`span`,{className:(0,l.default)(o.default.label,r&&o.default.current),"aria-current":r?`page`:void 0,tabIndex:r?0:void 0,role:r?`link`:void 0,children:[t.iconName&&(0,u.jsx)(a.Icon,{name:t.iconName,size:d,className:o.default.labelIcon}),t.label]})}),!r&&(0,u.jsx)(`span`,{className:o.default.separator,"aria-hidden":`true`,children:c||b})]},n)})})})});d.displayName=`Breadcrumb`,exports.Breadcrumb=d;
|
|
@@ -1,66 +1,67 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Root as e } from "../../../node_modules/@radix-ui/react-slot/dist/index.js";
|
|
3
3
|
import { useWimTranslation as t } from "../../../i18n/useWimTranslation.js";
|
|
4
|
-
import n from "../../../
|
|
5
|
-
import
|
|
6
|
-
import i from "
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import s from "
|
|
10
|
-
import
|
|
4
|
+
import { commonNs as n } from "../../../i18n/generated/common.js";
|
|
5
|
+
import r from "../../../icon/chevron-right.js";
|
|
6
|
+
import { Icon as i } from "../../media/Icon/Icon.js";
|
|
7
|
+
import a from "./breadcrumb.module.js";
|
|
8
|
+
import { Link as o } from "../Link/Link.js";
|
|
9
|
+
import { forwardRef as s } from "react";
|
|
10
|
+
import c from "classnames";
|
|
11
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
11
12
|
//#region src/components/navigation/Breadcrumb/Breadcrumb.tsx
|
|
12
|
-
var
|
|
13
|
-
let { t:
|
|
14
|
-
component:
|
|
15
|
-
size:
|
|
16
|
-
className:
|
|
13
|
+
var d = s(({ items: s, separator: d, size: f = "md", className: p, ariaLabel: m, asChild: h, ...g }, _) => {
|
|
14
|
+
let { t: v } = t(n), y = m ?? v("a11y.breadcrumb"), b = h ? e : "nav", x = /* @__PURE__ */ l(i, {
|
|
15
|
+
component: r,
|
|
16
|
+
size: f,
|
|
17
|
+
className: a.separatorIcon
|
|
17
18
|
});
|
|
18
|
-
return /* @__PURE__ */
|
|
19
|
-
ref:
|
|
20
|
-
"aria-label":
|
|
21
|
-
className:
|
|
19
|
+
return /* @__PURE__ */ l(b, {
|
|
20
|
+
ref: _,
|
|
21
|
+
"aria-label": y,
|
|
22
|
+
className: c("wim-breadcrumb", a.root, a[f], p),
|
|
22
23
|
onKeyDown: (e) => {
|
|
23
|
-
let t = e.currentTarget, n = Array.from(t.querySelectorAll(`.${
|
|
24
|
+
let t = e.currentTarget, n = Array.from(t.querySelectorAll(`.${a.link}, .${a.label}.${a.current}`)), r = n.indexOf(document.activeElement);
|
|
24
25
|
r !== -1 && (e.key === "ArrowRight" ? (e.preventDefault(), n[(r + 1) % n.length].focus()) : e.key === "ArrowLeft" && (e.preventDefault(), n[(r - 1 + n.length) % n.length].focus()));
|
|
25
26
|
},
|
|
26
|
-
...
|
|
27
|
-
children: /* @__PURE__ */
|
|
28
|
-
className:
|
|
29
|
-
children:
|
|
30
|
-
let n = t ===
|
|
31
|
-
return /* @__PURE__ */
|
|
32
|
-
className:
|
|
33
|
-
children: [/* @__PURE__ */
|
|
34
|
-
className:
|
|
35
|
-
children: e.href && !n ? /* @__PURE__ */
|
|
27
|
+
...g,
|
|
28
|
+
children: /* @__PURE__ */ l("ol", {
|
|
29
|
+
className: a.list,
|
|
30
|
+
children: s.map((e, t) => {
|
|
31
|
+
let n = t === s.length - 1;
|
|
32
|
+
return /* @__PURE__ */ u("li", {
|
|
33
|
+
className: a.item,
|
|
34
|
+
children: [/* @__PURE__ */ l("div", {
|
|
35
|
+
className: a.content,
|
|
36
|
+
children: e.href && !n ? /* @__PURE__ */ l(o, {
|
|
36
37
|
href: e.href,
|
|
37
|
-
size:
|
|
38
|
+
size: f,
|
|
38
39
|
priority: "secondary",
|
|
39
40
|
iconName: e.iconName,
|
|
40
|
-
className:
|
|
41
|
-
styles: { label:
|
|
41
|
+
className: a.link,
|
|
42
|
+
styles: { label: a.linkLabel },
|
|
42
43
|
children: e.label
|
|
43
|
-
}) : /* @__PURE__ */
|
|
44
|
-
className:
|
|
44
|
+
}) : /* @__PURE__ */ u("span", {
|
|
45
|
+
className: c(a.label, n && a.current),
|
|
45
46
|
"aria-current": n ? "page" : void 0,
|
|
46
47
|
tabIndex: n ? 0 : void 0,
|
|
47
48
|
role: n ? "link" : void 0,
|
|
48
|
-
children: [e.iconName && /* @__PURE__ */
|
|
49
|
+
children: [e.iconName && /* @__PURE__ */ l(i, {
|
|
49
50
|
name: e.iconName,
|
|
50
|
-
size:
|
|
51
|
-
className:
|
|
51
|
+
size: f,
|
|
52
|
+
className: a.labelIcon
|
|
52
53
|
}), e.label]
|
|
53
54
|
})
|
|
54
|
-
}), !n && /* @__PURE__ */
|
|
55
|
-
className:
|
|
55
|
+
}), !n && /* @__PURE__ */ l("span", {
|
|
56
|
+
className: a.separator,
|
|
56
57
|
"aria-hidden": "true",
|
|
57
|
-
children:
|
|
58
|
+
children: d || x
|
|
58
59
|
})]
|
|
59
60
|
}, t);
|
|
60
61
|
})
|
|
61
62
|
})
|
|
62
63
|
});
|
|
63
64
|
});
|
|
64
|
-
|
|
65
|
+
d.displayName = "Breadcrumb";
|
|
65
66
|
//#endregion
|
|
66
|
-
export {
|
|
67
|
+
export { d as Breadcrumb };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../../overlay/Portal/Portal.cjs"),r=require("../../layout/Transition/Transition.cjs"),i=require("../../overlay/FocusTrap/FocusTrap.cjs"),a=require("../../../icon/search.cjs"),
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../../overlay/Portal/Portal.cjs"),r=require("../../layout/Transition/Transition.cjs"),i=require("../../overlay/FocusTrap/FocusTrap.cjs"),a=require("../../../i18n/generated/components.cjs"),o=require("../../../icon/search.cjs"),s=require("../../media/Icon/Icon.cjs"),c=require("../../_internal/BaseListItem/BaseListItem.cjs"),l=require("./command-palette.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=(0,u.createContext)(void 0),m=()=>{let e=(0,u.useContext)(p);if(!e)throw Error(`CommandPalette sub-components must be used within a CommandPalette`);return e},h=({children:e,open:t,onOpenChange:n})=>{let[r,i]=(0,u.useState)(!1),[a,o]=(0,u.useState)(``),[s,c]=(0,u.useState)(0),[l,d]=(0,u.useState)(!1),m=(0,u.useRef)(0),h=t!==void 0,g=h?t:r,_=(0,u.useCallback)(e=>{h||i(e),n?.(e),e||(o(``),c(0))},[h,n]),v=(0,u.useCallback)(()=>{let e=m.current;return m.current+=1,e},[]),y=(0,u.useCallback)(()=>{--m.current},[]);m.current=0,(0,u.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key===`k`&&(e.preventDefault(),d(!0),_(!g)),e.key===`Escape`&&g&&_(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[g,_]);let b=u.default.useMemo(()=>({open:g,onOpenChange:_,search:a,setSearch:o,activeIndex:s,setActiveIndex:c,registerItem:v,unregisterItem:y,isKeyboardNavigating:l,setIsKeyboardNavigating:d}),[g,_,a,s,v,y,l]);return(0,f.jsx)(p.Provider,{value:b,children:e})},g=({children:e,asChild:t,className:n})=>{let{onOpenChange:r,setIsKeyboardNavigating:i}=m(),a=e=>{i(e.detail===0),r(!0)};return t&&u.default.isValidElement(e)?u.default.cloneElement(e,{onClick:t=>{e.props.onClick?.(t),a(t)},className:(0,d.default)(n,e.props.className)}):(0,f.jsx)(`button`,{className:(0,d.default)(l.default.trigger,n),onClick:a,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&i(!0)},children:e})},_=({children:e,className:o,"aria-label":s})=>{let{t:c}=t.useWimTranslation(a.componentsNs),{open:p,onOpenChange:h,activeIndex:g,setActiveIndex:_,isKeyboardNavigating:v,setIsKeyboardNavigating:y}=m(),b=(0,u.useRef)(null);return(0,f.jsx)(n.Portal,{children:(0,f.jsx)(r.Transition,{show:p,preset:`fade`,children:(0,f.jsx)(`div`,{role:`presentation`,className:l.default.overlay,onClick:e=>{e.target===e.currentTarget&&h(!1)},children:(0,f.jsx)(r.Transition,{show:p,preset:`scale`,children:(0,f.jsx)(i.FocusTrap,{active:p,children:(0,f.jsx)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":s??c(`command_palette.label`),className:(0,d.default)(`wim-command-palette`,l.default.content,o),onClick:e=>e.stopPropagation(),onMouseMove:e=>{if(!b.current){b.current={x:e.clientX,y:e.clientY};return}Math.sqrt((e.clientX-b.current.x)**2+(e.clientY-b.current.y)**2)>10&&y(!1),b.current={x:e.clientX,y:e.clientY}},"data-keyboard-nav":v,onKeyDown:e=>{y(!0);let t=e.currentTarget.querySelectorAll(`.${l.default.item}:not([aria-disabled="true"])`).length;t!==0&&(e.key===`ArrowDown`?(e.preventDefault(),_(e=>(e+1)%t)):e.key===`ArrowUp`?(e.preventDefault(),_(e=>(e-1+t)%t)):e.key===`Home`?(e.preventDefault(),_(0)):e.key===`End`?(e.preventDefault(),_(t-1)):e.key===`Enter`&&(e.preventDefault(),document.getElementById(`wim-command-palette-item-${g}`)?.click()))},children:e})})})})})})},v=({placeholder:e,value:t,onChange:n,rightSection:r})=>{let{search:i,setSearch:a,setActiveIndex:c,activeIndex:d}=m(),p=(0,u.useRef)(null);return(0,u.useEffect)(()=>{p.current?.focus()},[]),(0,f.jsxs)(`div`,{className:l.default.inputWrapper,children:[(0,f.jsx)(s.Icon,{component:o.default,size:`sm`}),(0,f.jsx)(`input`,{ref:p,className:l.default.input,placeholder:e,value:t??i,onChange:e=>{let t=e.target.value;a(t),c(0),n?.(t)},role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":!0,"aria-controls":`wim-command-palette-listbox`,"aria-activedescendant":`wim-command-palette-item-${d}`}),r&&(0,f.jsx)(`div`,{className:l.default.inputRight,children:r})]})},y=({children:e})=>(0,f.jsx)(`div`,{className:l.default.list,role:`listbox`,id:`wim-command-palette-listbox`,children:e}),b=({children:e,heading:t})=>{let n=u.default.useId();return(0,f.jsxs)(`div`,{className:l.default.group,role:`group`,"aria-labelledby":t?n:void 0,children:[t&&(0,f.jsx)(`div`,{id:n,className:l.default.groupHeading,"aria-hidden":`true`,children:t}),e]})},x=({children:e,onSelect:t,icon:n,shortcut:r,disabled:i})=>{let{activeIndex:a,setActiveIndex:o,registerItem:s,onOpenChange:d}=m(),[p]=(0,u.useState)(()=>s()),h=a===p;return(0,u.useEffect)(()=>{h&&!i&&document.getElementById(`wim-command-palette-item-${p}`)?.scrollIntoView({block:`nearest`})},[h,i,p]),(0,f.jsx)(c.BaseListItem,{role:`option`,id:`wim-command-palette-item-${p}`,"aria-selected":h,className:l.default.item,active:h,disabled:i,icon:n,rightSection:r&&(0,f.jsx)(`div`,{className:l.default.shortcut,children:r.map(e=>(0,f.jsx)(`kbd`,{className:l.default.kbd,children:e},e))}),onMouseEnter:()=>!i&&o(p),onClick:()=>{i||(t?.(),d(!1))},children:e})},S=({children:e})=>{let{t:n}=t.useWimTranslation(a.componentsNs),r=e??n(`command_palette.no_results`),{open:i,search:o}=m(),[s,c]=(0,u.useState)(!1);return(0,u.useEffect)(()=>{if(i){let e=setTimeout(()=>{let e=document.querySelectorAll(`.${l.default.item}`);c(e.length===0)},0);return()=>clearTimeout(e)}},[i,o]),!i||!s?null:(0,f.jsx)(`div`,{className:l.default.empty,children:r})},C=({children:e})=>(0,f.jsx)(`div`,{className:l.default.footer,children:e});exports.CommandPalette=h,exports.CommandPaletteContent=_,exports.CommandPaletteEmpty=S,exports.CommandPaletteFooter=C,exports.CommandPaletteGroup=b,exports.CommandPaletteInput=v,exports.CommandPaletteItem=x,exports.CommandPaletteList=y,exports.CommandPaletteTrigger=g;
|