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,100 +1,102 @@
|
|
|
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 {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
4
|
+
import { commonNs as r } from "../../../i18n/generated/common.js";
|
|
5
|
+
import { componentsNs as i } from "../../../i18n/generated/components.js";
|
|
6
|
+
import { Tooltip as a, TooltipContent as o, TooltipTrigger as s } from "../../overlay/Tooltip/Tooltip.js";
|
|
7
|
+
import c from "./calendar-heatmap.module.js";
|
|
8
|
+
import l, { useMemo as u } from "react";
|
|
9
|
+
import d from "classnames";
|
|
10
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
9
11
|
//#region src/components/data-display/CalendarHeatmap/CalendarHeatmap.tsx
|
|
10
|
-
var
|
|
11
|
-
let { t:
|
|
12
|
+
var m = l.forwardRef(({ data: l = [], year: m = (/* @__PURE__ */ new Date()).getFullYear(), getColorLevel: h = (e) => e === 0 ? 0 : e < 3 ? 1 : e < 6 ? 2 : e < 9 ? 3 : 4, className: g, tooltipFormatter: _, asChild: v = !1, children: y, ...b }, x) => {
|
|
13
|
+
let { t: S } = n([r, i]), C = v ? e : "div", w = u(() => {
|
|
12
14
|
let e = /* @__PURE__ */ new Map();
|
|
13
|
-
return
|
|
14
|
-
}, [
|
|
15
|
-
let e = [], t = new Date(
|
|
15
|
+
return l.forEach((t) => e.set(t.date, t.count)), e;
|
|
16
|
+
}, [l]), T = u(() => {
|
|
17
|
+
let e = [], t = new Date(m, 0, 1), n = new Date(t);
|
|
16
18
|
n.setDate(n.getDate() - n.getDay());
|
|
17
19
|
for (let t = 0; t < 53; t++) {
|
|
18
20
|
let t = [];
|
|
19
21
|
for (let e = 0; e < 7; e++) {
|
|
20
|
-
let e = n.toISOString().split("T")[0], r =
|
|
22
|
+
let e = n.toISOString().split("T")[0], r = w.get(e) || 0;
|
|
21
23
|
t.push({
|
|
22
24
|
date: e,
|
|
23
25
|
count: r,
|
|
24
|
-
level:
|
|
26
|
+
level: h(r)
|
|
25
27
|
}), n.setDate(n.getDate() + 1);
|
|
26
28
|
}
|
|
27
|
-
if (e.push(t), n.getFullYear() >
|
|
29
|
+
if (e.push(t), n.getFullYear() > m && n.getMonth() > 0) break;
|
|
28
30
|
}
|
|
29
31
|
return e;
|
|
30
32
|
}, [
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
]),
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
33
|
+
m,
|
|
34
|
+
w,
|
|
35
|
+
h
|
|
36
|
+
]), E = [
|
|
37
|
+
S("sun"),
|
|
38
|
+
S("mon"),
|
|
39
|
+
S("tue"),
|
|
40
|
+
S("wed"),
|
|
41
|
+
S("thu"),
|
|
42
|
+
S("fri"),
|
|
43
|
+
S("sat")
|
|
42
44
|
];
|
|
43
|
-
return /* @__PURE__ */
|
|
44
|
-
className:
|
|
45
|
-
ref:
|
|
46
|
-
...
|
|
45
|
+
return /* @__PURE__ */ p(C, {
|
|
46
|
+
className: d("wim-calendar-heatmap", c.root, g),
|
|
47
|
+
ref: x,
|
|
48
|
+
...b,
|
|
47
49
|
children: [
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
-
className:
|
|
51
|
-
children: /* @__PURE__ */
|
|
52
|
-
className:
|
|
50
|
+
/* @__PURE__ */ f(t, { children: y }),
|
|
51
|
+
/* @__PURE__ */ f("div", {
|
|
52
|
+
className: c.internalWrapper,
|
|
53
|
+
children: /* @__PURE__ */ p("div", {
|
|
54
|
+
className: c.grid,
|
|
53
55
|
role: "grid",
|
|
54
56
|
"aria-readonly": "true",
|
|
55
|
-
children: [/* @__PURE__ */
|
|
56
|
-
className:
|
|
57
|
-
children:
|
|
58
|
-
}),
|
|
59
|
-
className:
|
|
57
|
+
children: [/* @__PURE__ */ f("div", {
|
|
58
|
+
className: c.labels,
|
|
59
|
+
children: E.map((e, t) => /* @__PURE__ */ f("span", { children: e }, t))
|
|
60
|
+
}), T.map((e, t) => /* @__PURE__ */ f("div", {
|
|
61
|
+
className: c.week,
|
|
60
62
|
role: "row",
|
|
61
63
|
children: e.map((e) => {
|
|
62
|
-
let t =
|
|
63
|
-
return /* @__PURE__ */
|
|
64
|
+
let t = _ ? _(e.date, e.count) : `${e.date}: ${e.count} activities`;
|
|
65
|
+
return /* @__PURE__ */ p(a, { children: [/* @__PURE__ */ f(s, {
|
|
64
66
|
asChild: !0,
|
|
65
|
-
children: /* @__PURE__ */
|
|
66
|
-
className:
|
|
67
|
+
children: /* @__PURE__ */ f("div", {
|
|
68
|
+
className: d(c.cell, c[`level${e.level}`]),
|
|
67
69
|
"data-date": e.date,
|
|
68
70
|
"data-count": e.count,
|
|
69
71
|
role: "gridcell",
|
|
70
72
|
"aria-label": `${e.count} activities on ${e.date}`,
|
|
71
73
|
"aria-selected": !1
|
|
72
74
|
})
|
|
73
|
-
}), /* @__PURE__ */
|
|
75
|
+
}), /* @__PURE__ */ f(o, { children: t })] }, e.date);
|
|
74
76
|
})
|
|
75
77
|
}, t))]
|
|
76
78
|
})
|
|
77
79
|
}),
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
-
className:
|
|
80
|
+
/* @__PURE__ */ p("div", {
|
|
81
|
+
className: c.footer,
|
|
80
82
|
children: [
|
|
81
|
-
/* @__PURE__ */
|
|
82
|
-
/* @__PURE__ */
|
|
83
|
-
className:
|
|
83
|
+
/* @__PURE__ */ f("span", { children: S("calendar_heatmap.less") }),
|
|
84
|
+
/* @__PURE__ */ f("div", {
|
|
85
|
+
className: c.legend,
|
|
84
86
|
children: [
|
|
85
87
|
0,
|
|
86
88
|
1,
|
|
87
89
|
2,
|
|
88
90
|
3,
|
|
89
91
|
4
|
|
90
|
-
].map((e) => /* @__PURE__ */
|
|
92
|
+
].map((e) => /* @__PURE__ */ f("div", { className: d(c.cell, c[`level${e}`]) }, e))
|
|
91
93
|
}),
|
|
92
|
-
/* @__PURE__ */
|
|
94
|
+
/* @__PURE__ */ f("span", { children: S("calendar_heatmap.more") })
|
|
93
95
|
]
|
|
94
96
|
})
|
|
95
97
|
]
|
|
96
98
|
});
|
|
97
99
|
});
|
|
98
|
-
|
|
100
|
+
m.displayName = "CalendarHeatmap";
|
|
99
101
|
//#endregion
|
|
100
|
-
export {
|
|
102
|
+
export { m as CalendarHeatmap };
|
|
@@ -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/components.cjs"),i=require("../../../icon/chevron-left.cjs"),a=require("../../../icon/chevron-right.cjs"),o=require("../../media/Icon/Icon.cjs"),s=require("./carousel.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=(e,t)=>typeof e==`number`?e:e?t>=1280&&e.xl?e.xl:t>=1024&&e.lg?e.lg:t>=768&&e.md?e.md:t>=640&&e.sm?e.sm:e.base||1:1,f=(0,c.forwardRef)(({children:e,autoPlay:f=!1,interval:p=5e3,showIndicators:m=!0,showControls:h=!0,controlsPlacement:g=`overlay`,loop:_=!0,slidesToShow:v=1,aspectRatio:y,objectFit:b=`cover`,labels:x,className:S,asChild:C,...w},T)=>{let E=C?t.Root:`div`,{t:D}=n.useWimTranslation(r.componentsNs),O={slideLabel:e=>D(`carousel.slide`,{number:e}),prevSlide:D(`carousel.prev_slide`),nextSlide:D(`carousel.next_slide`),goToSlide:e=>D(`carousel.go_to_slide`,{number:e}),...x},k=(0,c.useMemo)(()=>c.default.Children.toArray(e),[e]),A=k.length,[j,M]=(0,c.useState)(typeof window<`u`?window.innerWidth:0),[N,P]=(0,c.useState)(_?A:0),[F,I]=(0,c.useState)(!1),[L,R]=(0,c.useState)(!1),z=d(v,j),B=(0,c.useRef)(null),V=(0,c.useRef)(null),H=(0,c.useRef)(null),U=(0,c.useRef)(null);(0,c.useEffect)(()=>{let e=()=>M(window.innerWidth);return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]);let W=(0,c.useMemo)(()=>!_||A===0?k:[...k,...k,...k],[k,_,A]),G=(0,c.useCallback)(()=>{if(!F){if(!_){P(e=>Math.min(e+1,A-z));return}I(!0),P(e=>e+1)}},[F,_,A,z]),K=(0,c.useCallback)(()=>{if(!F){if(!_){P(e=>Math.max(e-1,0));return}I(!0),P(e=>e-1)}},[F,_]),q=e=>{F||(_?(I(!0),P(e+A)):P(e))},J=()=>{_&&(I(!1),N>=A*2?P(N-A):N<A&&P(N+A))};(0,c.useEffect)(()=>(f&&!L&&A>z&&(B.current=window.setInterval(G,p)),()=>{B.current&&window.clearInterval(B.current)}),[f,p,G,A,z,L]);let Y=e=>{e.key===`ArrowLeft`?K():e.key===`ArrowRight`&&G()},X=e=>{H.current=e.targetTouches[0].clientX},Z=e=>{U.current=e.targetTouches[0].clientX},Q=()=>{if(!H.current||!U.current)return;let e=H.current-U.current;e>50?G():e<-50&&K(),H.current=null,U.current=null};if(A===0)return null;let $=100/z,ee=-N*$;return(0,u.jsxs)(E,{ref:T,className:(0,l.default)(`wim-carousel`,s.default.root,g===`outside`&&s.default.controlsOutside,S),onMouseEnter:()=>R(!0),onMouseLeave:()=>R(!1),onFocus:()=>R(!0),onBlur:()=>R(!1),onKeyDown:Y,tabIndex:0,role:`region`,"aria-roledescription":D(`carousel.roledescription`),...w,children:[(0,u.jsx)(`div`,{className:s.default.viewport,children:(0,u.jsx)(`div`,{ref:V,className:(0,l.default)(s.default.track,F&&s.default.transition),style:{transform:`translateX(${ee}%)`},onTransitionEnd:J,onTouchStart:X,onTouchMove:Z,onTouchEnd:Q,children:W.map((e,t)=>(0,u.jsx)(`div`,{className:(0,l.default)(s.default.item,y&&s.default.hasAspectRatio),style:{flex:`0 0 ${$}%`,width:`${$}%`,...y?{aspectRatio:y,"--wim-carousel-object-fit":b}:{}},role:`group`,"aria-roledescription":D(`carousel.slide_roledescription`),"aria-label":O.slideLabel(t%A+1),children:e},t))})}),h&&A>z&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`button`,{className:(0,l.default)(s.default.control,s.default.prev),onClick:K,"aria-label":O.prevSlide,disabled:!_&&N===0,tabIndex:-1,children:(0,u.jsx)(o.Icon,{component:i.default,size:`md`})}),(0,u.jsx)(`button`,{className:(0,l.default)(s.default.control,s.default.next),onClick:G,"aria-label":O.nextSlide,disabled:!_&&N>=A-z,tabIndex:-1,children:(0,u.jsx)(o.Icon,{component:a.default,size:`md`})})]}),m&&A>1&&(0,u.jsx)(`div`,{className:s.default.indicators,children:k.map((e,t)=>{let n=_?N%A===t:N===t;return(0,u.jsx)(`button`,{className:(0,l.default)(s.default.indicator,n&&s.default.active),onClick:()=>q(t),"aria-label":O.goToSlide(t+1),"aria-current":n?`true`:`false`},t)})})]})});f.displayName=`Carousel`,exports.Carousel=f;
|
|
@@ -1,22 +1,23 @@
|
|
|
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 r from "../../../icon/chevron-
|
|
4
|
+
import { componentsNs as n } from "../../../i18n/generated/components.js";
|
|
5
|
+
import r from "../../../icon/chevron-left.js";
|
|
6
|
+
import ee from "../../../icon/chevron-right.js";
|
|
6
7
|
import { Icon as i } from "../../media/Icon/Icon.js";
|
|
7
8
|
import a from "./carousel.module.js";
|
|
8
|
-
import
|
|
9
|
+
import te, { forwardRef as o, useCallback as s, useEffect as c, useMemo as l, useRef as u, useState as d } from "react";
|
|
9
10
|
import f from "classnames";
|
|
10
11
|
import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
11
12
|
//#region src/components/data-display/Carousel/Carousel.tsx
|
|
12
13
|
var g = (e, t) => typeof e == "number" ? e : e ? t >= 1280 && e.xl ? e.xl : t >= 1024 && e.lg ? e.lg : t >= 768 && e.md ? e.md : t >= 640 && e.sm ? e.sm : e.base || 1 : 1, _ = o(({ children: o, autoPlay: _ = !1, interval: v = 5e3, showIndicators: y = !0, showControls: b = !0, controlsPlacement: x = "overlay", loop: S = !0, slidesToShow: C = 1, aspectRatio: w, objectFit: T = "cover", labels: E, className: D, asChild: O, ...k }, A) => {
|
|
13
|
-
let j = O ? e : "div", { t: M } = t(
|
|
14
|
+
let j = O ? e : "div", { t: M } = t(n), N = {
|
|
14
15
|
slideLabel: (e) => M("carousel.slide", { number: e }),
|
|
15
16
|
prevSlide: M("carousel.prev_slide"),
|
|
16
17
|
nextSlide: M("carousel.next_slide"),
|
|
17
18
|
goToSlide: (e) => M("carousel.go_to_slide", { number: e }),
|
|
18
19
|
...E
|
|
19
|
-
}, P = l(() =>
|
|
20
|
+
}, P = l(() => te.Children.toArray(o), [o]), F = P.length, [I, L] = d(typeof window < "u" ? window.innerWidth : 0), [R, z] = d(S ? F : 0), [B, V] = d(!1), [H, U] = d(!1), W = g(C, I), G = u(null), K = u(null), q = u(null), J = u(null);
|
|
20
21
|
c(() => {
|
|
21
22
|
let e = () => L(window.innerWidth);
|
|
22
23
|
return window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
|
|
@@ -50,9 +51,9 @@ var g = (e, t) => typeof e == "number" ? e : e ? t >= 1280 && e.xl ? e.xl : t >=
|
|
|
50
51
|
}
|
|
51
52
|
V(!0), z((e) => e - 1);
|
|
52
53
|
}
|
|
53
|
-
}, [B, S]),
|
|
54
|
+
}, [B, S]), ne = (e) => {
|
|
54
55
|
B || (S ? (V(!0), z(e + F)) : z(e));
|
|
55
|
-
},
|
|
56
|
+
}, re = () => {
|
|
56
57
|
S && (V(!1), R >= F * 2 ? z(R - F) : R < F && z(R + F));
|
|
57
58
|
};
|
|
58
59
|
c(() => (_ && !H && F > W && (G.current = window.setInterval(X, v)), () => {
|
|
@@ -65,19 +66,19 @@ var g = (e, t) => typeof e == "number" ? e : e ? t >= 1280 && e.xl ? e.xl : t >=
|
|
|
65
66
|
W,
|
|
66
67
|
H
|
|
67
68
|
]);
|
|
68
|
-
let
|
|
69
|
+
let ie = (e) => {
|
|
69
70
|
e.key === "ArrowLeft" ? Z() : e.key === "ArrowRight" && X();
|
|
70
|
-
},
|
|
71
|
+
}, Q = (e) => {
|
|
71
72
|
q.current = e.targetTouches[0].clientX;
|
|
72
|
-
},
|
|
73
|
+
}, ae = (e) => {
|
|
73
74
|
J.current = e.targetTouches[0].clientX;
|
|
74
|
-
},
|
|
75
|
+
}, oe = () => {
|
|
75
76
|
if (!q.current || !J.current) return;
|
|
76
77
|
let e = q.current - J.current;
|
|
77
78
|
e > 50 ? X() : e < -50 && Z(), q.current = null, J.current = null;
|
|
78
79
|
};
|
|
79
80
|
if (F === 0) return null;
|
|
80
|
-
let $ = 100 / W,
|
|
81
|
+
let $ = 100 / W, se = -R * $;
|
|
81
82
|
return /* @__PURE__ */ h(j, {
|
|
82
83
|
ref: A,
|
|
83
84
|
className: f("wim-carousel", a.root, x === "outside" && a.controlsOutside, D),
|
|
@@ -85,10 +86,10 @@ var g = (e, t) => typeof e == "number" ? e : e ? t >= 1280 && e.xl ? e.xl : t >=
|
|
|
85
86
|
onMouseLeave: () => U(!1),
|
|
86
87
|
onFocus: () => U(!0),
|
|
87
88
|
onBlur: () => U(!1),
|
|
88
|
-
onKeyDown:
|
|
89
|
+
onKeyDown: ie,
|
|
89
90
|
tabIndex: 0,
|
|
90
91
|
role: "region",
|
|
91
|
-
"aria-roledescription": "carousel",
|
|
92
|
+
"aria-roledescription": M("carousel.roledescription"),
|
|
92
93
|
...k,
|
|
93
94
|
children: [
|
|
94
95
|
/* @__PURE__ */ m("div", {
|
|
@@ -96,11 +97,11 @@ var g = (e, t) => typeof e == "number" ? e : e ? t >= 1280 && e.xl ? e.xl : t >=
|
|
|
96
97
|
children: /* @__PURE__ */ m("div", {
|
|
97
98
|
ref: K,
|
|
98
99
|
className: f(a.track, B && a.transition),
|
|
99
|
-
style: { transform: `translateX(${
|
|
100
|
-
onTransitionEnd:
|
|
101
|
-
onTouchStart:
|
|
102
|
-
onTouchMove:
|
|
103
|
-
onTouchEnd:
|
|
100
|
+
style: { transform: `translateX(${se}%)` },
|
|
101
|
+
onTransitionEnd: re,
|
|
102
|
+
onTouchStart: Q,
|
|
103
|
+
onTouchMove: ae,
|
|
104
|
+
onTouchEnd: oe,
|
|
104
105
|
children: Y.map((e, t) => /* @__PURE__ */ m("div", {
|
|
105
106
|
className: f(a.item, w && a.hasAspectRatio),
|
|
106
107
|
style: {
|
|
@@ -112,7 +113,7 @@ var g = (e, t) => typeof e == "number" ? e : e ? t >= 1280 && e.xl ? e.xl : t >=
|
|
|
112
113
|
} : {}
|
|
113
114
|
},
|
|
114
115
|
role: "group",
|
|
115
|
-
"aria-roledescription": "
|
|
116
|
+
"aria-roledescription": M("carousel.slide_roledescription"),
|
|
116
117
|
"aria-label": N.slideLabel(t % F + 1),
|
|
117
118
|
children: e
|
|
118
119
|
}, t))
|
|
@@ -125,7 +126,7 @@ var g = (e, t) => typeof e == "number" ? e : e ? t >= 1280 && e.xl ? e.xl : t >=
|
|
|
125
126
|
disabled: !S && R === 0,
|
|
126
127
|
tabIndex: -1,
|
|
127
128
|
children: /* @__PURE__ */ m(i, {
|
|
128
|
-
component:
|
|
129
|
+
component: r,
|
|
129
130
|
size: "md"
|
|
130
131
|
})
|
|
131
132
|
}), /* @__PURE__ */ m("button", {
|
|
@@ -135,7 +136,7 @@ var g = (e, t) => typeof e == "number" ? e : e ? t >= 1280 && e.xl ? e.xl : t >=
|
|
|
135
136
|
disabled: !S && R >= F - W,
|
|
136
137
|
tabIndex: -1,
|
|
137
138
|
children: /* @__PURE__ */ m(i, {
|
|
138
|
-
component:
|
|
139
|
+
component: ee,
|
|
139
140
|
size: "md"
|
|
140
141
|
})
|
|
141
142
|
})] }),
|
|
@@ -145,7 +146,7 @@ var g = (e, t) => typeof e == "number" ? e : e ? t >= 1280 && e.xl ? e.xl : t >=
|
|
|
145
146
|
let n = S ? R % F === t : R === t;
|
|
146
147
|
return /* @__PURE__ */ m("button", {
|
|
147
148
|
className: f(a.indicator, n && a.active),
|
|
148
|
-
onClick: () =>
|
|
149
|
+
onClick: () => ne(t),
|
|
149
150
|
"aria-label": N.goToSlide(t + 1),
|
|
150
151
|
"aria-current": n ? "true" : "false"
|
|
151
152
|
}, t);
|
|
@@ -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/close.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/close.cjs"),a=require("../../media/Icon/Icon.cjs"),o=require("../../_internal/mergeRefs.cjs"),s=require("./chip.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=c.default.forwardRef(({asChild:e=!1,children:c,content:d,onClick:f,onDelete:p,avatar:m,icon:h,selected:g=!1,disabled:_=!1,intent:v=`neutral`,variant:y=`solid`,size:b=`md`,deleteAriaLabel:x,className:S,...C},w)=>{let{t:T}=n.useWimTranslation(r.commonNs),E=x??T(`a11y.delete`);if(e&&p)throw Error("[wimui] Chip: `asChild` cannot be combined with `onDelete`. Use a removable Chip without asChild, or put the delete control on the slotted child yourself.");let D=e?t.Root:f?`button`:`span`,O=d??c;return(0,u.jsxs)(D,{ref:o.mergeRefs(w),className:(0,l.default)(`wim-chip`,s.default.root,s.default[v],s.default[y],s.default[b],g&&s.default.selected,f&&!_&&s.default.clickable,_&&s.default.disabled,S),onClick:_?void 0:f,...!e&&f?{disabled:_}:{},type:e?void 0:f?`button`:void 0,...C,children:[m&&(0,u.jsx)(`span`,{className:s.default.avatar,children:m}),!m&&h&&(0,u.jsx)(`span`,{className:s.default.icon,children:h}),e?(0,u.jsx)(t.Slottable,{children:O}):(0,u.jsx)(`span`,{className:s.default.label,children:O}),p&&!_&&(0,u.jsx)(`button`,{type:`button`,className:s.default.delete,"data-chip-delete":!0,onClick:e=>{e.stopPropagation(),p(e)},"aria-label":E,children:(0,u.jsx)(a.Icon,{component:i.default,size:`sm`})})]})});d.displayName=`Chip`,exports.Chip=d;
|
|
@@ -1,54 +1,55 @@
|
|
|
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 {
|
|
7
|
-
import o from "
|
|
8
|
-
import s from "
|
|
9
|
-
import c from "
|
|
10
|
-
import
|
|
4
|
+
import { commonNs as r } from "../../../i18n/generated/common.js";
|
|
5
|
+
import i from "../../../icon/close.js";
|
|
6
|
+
import { Icon as a } from "../../media/Icon/Icon.js";
|
|
7
|
+
import { mergeRefs as o } from "../../_internal/mergeRefs.js";
|
|
8
|
+
import s from "./chip.module.js";
|
|
9
|
+
import c from "react";
|
|
10
|
+
import l from "classnames";
|
|
11
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
11
12
|
//#region src/components/data-display/Chip/Chip.tsx
|
|
12
|
-
var
|
|
13
|
-
let { t:
|
|
14
|
-
if (
|
|
15
|
-
let
|
|
16
|
-
return /* @__PURE__ */
|
|
17
|
-
ref:
|
|
18
|
-
className:
|
|
19
|
-
onClick:
|
|
20
|
-
...!
|
|
21
|
-
type:
|
|
22
|
-
...
|
|
13
|
+
var f = c.forwardRef(({ asChild: c = !1, children: f, content: p, onClick: m, onDelete: h, avatar: g, icon: _, selected: v = !1, disabled: y = !1, intent: b = "neutral", variant: x = "solid", size: S = "md", deleteAriaLabel: C, className: w, ...T }, E) => {
|
|
14
|
+
let { t: D } = n(r), O = C ?? D("a11y.delete");
|
|
15
|
+
if (c && h) throw Error("[wimui] Chip: `asChild` cannot be combined with `onDelete`. Use a removable Chip without asChild, or put the delete control on the slotted child yourself.");
|
|
16
|
+
let k = c ? e : m ? "button" : "span", A = p ?? f;
|
|
17
|
+
return /* @__PURE__ */ d(k, {
|
|
18
|
+
ref: o(E),
|
|
19
|
+
className: l("wim-chip", s.root, s[b], s[x], s[S], v && s.selected, m && !y && s.clickable, y && s.disabled, w),
|
|
20
|
+
onClick: y ? void 0 : m,
|
|
21
|
+
...!c && m ? { disabled: y } : {},
|
|
22
|
+
type: c ? void 0 : m ? "button" : void 0,
|
|
23
|
+
...T,
|
|
23
24
|
children: [
|
|
24
|
-
|
|
25
|
-
className:
|
|
26
|
-
children: h
|
|
27
|
-
}),
|
|
28
|
-
!h && g && /* @__PURE__ */ l("span", {
|
|
29
|
-
className: o.icon,
|
|
25
|
+
g && /* @__PURE__ */ u("span", {
|
|
26
|
+
className: s.avatar,
|
|
30
27
|
children: g
|
|
31
28
|
}),
|
|
32
|
-
|
|
33
|
-
className:
|
|
34
|
-
children:
|
|
29
|
+
!g && _ && /* @__PURE__ */ u("span", {
|
|
30
|
+
className: s.icon,
|
|
31
|
+
children: _
|
|
32
|
+
}),
|
|
33
|
+
c ? /* @__PURE__ */ u(t, { children: A }) : /* @__PURE__ */ u("span", {
|
|
34
|
+
className: s.label,
|
|
35
|
+
children: A
|
|
35
36
|
}),
|
|
36
|
-
|
|
37
|
+
h && !y && /* @__PURE__ */ u("button", {
|
|
37
38
|
type: "button",
|
|
38
|
-
className:
|
|
39
|
+
className: s.delete,
|
|
39
40
|
"data-chip-delete": !0,
|
|
40
41
|
onClick: (e) => {
|
|
41
|
-
e.stopPropagation(),
|
|
42
|
+
e.stopPropagation(), h(e);
|
|
42
43
|
},
|
|
43
|
-
"aria-label":
|
|
44
|
-
children: /* @__PURE__ */
|
|
45
|
-
component:
|
|
44
|
+
"aria-label": O,
|
|
45
|
+
children: /* @__PURE__ */ u(a, {
|
|
46
|
+
component: i,
|
|
46
47
|
size: "sm"
|
|
47
48
|
})
|
|
48
49
|
})
|
|
49
50
|
]
|
|
50
51
|
});
|
|
51
52
|
});
|
|
52
|
-
|
|
53
|
+
f.displayName = "Chip";
|
|
53
54
|
//#endregion
|
|
54
|
-
export {
|
|
55
|
+
export { f as Chip };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../../layout/VisuallyHidden/VisuallyHidden.cjs"),
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../../../i18n/generated/common.cjs"),r=require("../../layout/VisuallyHidden/VisuallyHidden.cjs"),i=require("../Avatar/Avatar.cjs"),a=require("./comment.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(({id:e,author:l,timestamp:u,children:d,replies:f,edited:p=!1,replyingTo:m,editingId:h,composer:g,editor:_,onReply:v,onEdit:y,onDelete:b,actions:x,className:S,...C},w)=>{let{t:T}=t.useWimTranslation(n.commonNs),E=`${e}-author`,D=h!==void 0&&h===e,O=m!==void 0&&m===e,k={reply:v,edit:y,delete:b},A=[`reply`,`edit`,`delete`].filter(e=>k[e]!==void 0);return(0,c.jsxs)(`article`,{ref:w,"aria-labelledby":E,className:(0,s.default)(`wim-comment`,a.default.root,S),...C,children:[(0,c.jsxs)(`div`,{className:a.default.head,children:[(0,c.jsx)(i.Avatar,{src:l.avatarSrc,initials:l.initials,size:`sm`,alt:``,"aria-hidden":`true`}),(0,c.jsxs)(`div`,{className:a.default.meta,children:[(0,c.jsx)(`span`,{id:E,className:a.default.author,children:l.name}),l.badge&&(0,c.jsx)(`span`,{className:a.default.badge,children:l.badge}),u&&(0,c.jsx)(`span`,{className:a.default.timestamp,children:u}),p&&(0,c.jsx)(`span`,{className:a.default.edited,children:T(`comment.edited`)})]})]}),(0,c.jsx)(`div`,{className:a.default.body,children:D?_:d}),(A.length>0||x)&&(0,c.jsxs)(`div`,{className:a.default.actions,children:[A.map(t=>(0,c.jsxs)(`button`,{type:`button`,className:a.default.action,onClick:()=>k[t]?.(e),children:[T(`comment.${t}`),(0,c.jsxs)(r.VisuallyHidden,{children:[` `,T(`comment.action_context`,{name:l.name})]})]},t)),x]}),O&&g&&(0,c.jsx)(`div`,{className:a.default.composer,children:g}),f&&(0,c.jsx)(`ul`,{className:a.default.replies,children:o.default.Children.map(f,(e,t)=>(0,c.jsx)(`li`,{className:a.default.reply,children:e},t))})]})});l.displayName=`Comment`,exports.Comment=l;
|
|
@@ -1,86 +1,87 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useWimTranslation as e } from "../../../i18n/useWimTranslation.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import r from "
|
|
6
|
-
import i from "
|
|
7
|
-
import a from "
|
|
8
|
-
import
|
|
3
|
+
import { commonNs as t } from "../../../i18n/generated/common.js";
|
|
4
|
+
import { VisuallyHidden as n } from "../../layout/VisuallyHidden/VisuallyHidden.js";
|
|
5
|
+
import { Avatar as r } from "../Avatar/Avatar.js";
|
|
6
|
+
import i from "./comment.module.js";
|
|
7
|
+
import a from "react";
|
|
8
|
+
import o from "classnames";
|
|
9
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
9
10
|
//#region src/components/data-display/Comment/Comment.tsx
|
|
10
|
-
var
|
|
11
|
-
let { t:
|
|
12
|
-
reply:
|
|
13
|
-
edit:
|
|
14
|
-
delete:
|
|
15
|
-
},
|
|
11
|
+
var l = a.forwardRef(({ id: l, author: u, timestamp: d, children: f, replies: p, edited: m = !1, replyingTo: h, editingId: g, composer: _, editor: v, onReply: y, onEdit: b, onDelete: x, actions: S, className: C, ...w }, T) => {
|
|
12
|
+
let { t: E } = e(t), D = `${l}-author`, O = g !== void 0 && g === l, k = h !== void 0 && h === l, A = {
|
|
13
|
+
reply: y,
|
|
14
|
+
edit: b,
|
|
15
|
+
delete: x
|
|
16
|
+
}, j = [
|
|
16
17
|
"reply",
|
|
17
18
|
"edit",
|
|
18
19
|
"delete"
|
|
19
|
-
].filter((e) =>
|
|
20
|
-
return /* @__PURE__ */
|
|
21
|
-
ref:
|
|
22
|
-
"aria-labelledby":
|
|
23
|
-
className:
|
|
24
|
-
...
|
|
20
|
+
].filter((e) => A[e] !== void 0);
|
|
21
|
+
return /* @__PURE__ */ c("article", {
|
|
22
|
+
ref: T,
|
|
23
|
+
"aria-labelledby": D,
|
|
24
|
+
className: o("wim-comment", i.root, C),
|
|
25
|
+
...w,
|
|
25
26
|
children: [
|
|
26
|
-
/* @__PURE__ */
|
|
27
|
-
className:
|
|
28
|
-
children: [/* @__PURE__ */
|
|
29
|
-
src:
|
|
30
|
-
initials:
|
|
27
|
+
/* @__PURE__ */ c("div", {
|
|
28
|
+
className: i.head,
|
|
29
|
+
children: [/* @__PURE__ */ s(r, {
|
|
30
|
+
src: u.avatarSrc,
|
|
31
|
+
initials: u.initials,
|
|
31
32
|
size: "sm",
|
|
32
33
|
alt: "",
|
|
33
34
|
"aria-hidden": "true"
|
|
34
|
-
}), /* @__PURE__ */
|
|
35
|
-
className:
|
|
35
|
+
}), /* @__PURE__ */ c("div", {
|
|
36
|
+
className: i.meta,
|
|
36
37
|
children: [
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
-
id:
|
|
39
|
-
className:
|
|
40
|
-
children:
|
|
38
|
+
/* @__PURE__ */ s("span", {
|
|
39
|
+
id: D,
|
|
40
|
+
className: i.author,
|
|
41
|
+
children: u.name
|
|
41
42
|
}),
|
|
42
|
-
|
|
43
|
-
className:
|
|
44
|
-
children:
|
|
43
|
+
u.badge && /* @__PURE__ */ s("span", {
|
|
44
|
+
className: i.badge,
|
|
45
|
+
children: u.badge
|
|
45
46
|
}),
|
|
46
|
-
|
|
47
|
-
className:
|
|
48
|
-
children:
|
|
47
|
+
d && /* @__PURE__ */ s("span", {
|
|
48
|
+
className: i.timestamp,
|
|
49
|
+
children: d
|
|
49
50
|
}),
|
|
50
|
-
|
|
51
|
-
className:
|
|
52
|
-
children:
|
|
51
|
+
m && /* @__PURE__ */ s("span", {
|
|
52
|
+
className: i.edited,
|
|
53
|
+
children: E("comment.edited")
|
|
53
54
|
})
|
|
54
55
|
]
|
|
55
56
|
})]
|
|
56
57
|
}),
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
-
className:
|
|
59
|
-
children:
|
|
58
|
+
/* @__PURE__ */ s("div", {
|
|
59
|
+
className: i.body,
|
|
60
|
+
children: O ? v : f
|
|
60
61
|
}),
|
|
61
|
-
(
|
|
62
|
-
className:
|
|
63
|
-
children: [
|
|
62
|
+
(j.length > 0 || S) && /* @__PURE__ */ c("div", {
|
|
63
|
+
className: i.actions,
|
|
64
|
+
children: [j.map((e) => /* @__PURE__ */ c("button", {
|
|
64
65
|
type: "button",
|
|
65
|
-
className:
|
|
66
|
-
onClick: () =>
|
|
67
|
-
children: [
|
|
68
|
-
}, e)),
|
|
66
|
+
className: i.action,
|
|
67
|
+
onClick: () => A[e]?.(l),
|
|
68
|
+
children: [E(`comment.${e}`), /* @__PURE__ */ c(n, { children: [" ", E("comment.action_context", { name: u.name })] })]
|
|
69
|
+
}, e)), S]
|
|
69
70
|
}),
|
|
70
|
-
|
|
71
|
-
className:
|
|
72
|
-
children:
|
|
71
|
+
k && _ && /* @__PURE__ */ s("div", {
|
|
72
|
+
className: i.composer,
|
|
73
|
+
children: _
|
|
73
74
|
}),
|
|
74
|
-
|
|
75
|
-
className:
|
|
76
|
-
children:
|
|
77
|
-
className:
|
|
75
|
+
p && /* @__PURE__ */ s("ul", {
|
|
76
|
+
className: i.replies,
|
|
77
|
+
children: a.Children.map(p, (e, t) => /* @__PURE__ */ s("li", {
|
|
78
|
+
className: i.reply,
|
|
78
79
|
children: e
|
|
79
80
|
}, t))
|
|
80
81
|
})
|
|
81
82
|
]
|
|
82
83
|
});
|
|
83
84
|
});
|
|
84
|
-
|
|
85
|
+
l.displayName = "Comment";
|
|
85
86
|
//#endregion
|
|
86
|
-
export {
|
|
87
|
+
export { l as Comment };
|
|
@@ -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("./countdown.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/data-display.cjs"),i=require("./countdown.module.cjs");let a=require("react");a=e.__toESM(a,1);let o=require("classnames");o=e.__toESM(o,1);let s=require("react/jsx-runtime");var c=e=>e instanceof Date?e.getTime():new Date(e).getTime(),l=e=>String(e).padStart(2,`0`),u=(e,t)=>{let n=Math.floor(e/86400),r=Math.floor(t?e/3600:e%86400/3600),i=Math.floor(e%3600/60),a=e%60,o=[];return!t&&n>0&&o.push({unit:`day`,value:n}),(o.length>0||r>0)&&o.push({unit:`hour`,value:r}),o.push({unit:`minute`,value:i}),o.push({unit:`second`,value:a}),o},d=a.default.forwardRef(({target:e,baseDate:d,variant:f=`digital`,size:p=`md`,locale:m,unitDisplay:h=`short`,paused:g=!1,onComplete:_,completedContent:v,fallback:y,asChild:b=!1,className:x,children:S,...C},w)=>{let{t:T,i18n:E}=n.useWimTranslation(r.dataDisplayNs),D=m??E?.language??`en`,O=b?t.Root:`time`,k=c(e),A=!Number.isNaN(k),j=d!==void 0,[M,N]=a.default.useState(()=>Date.now()),P=j?c(d):M,F=A?Math.max(0,k-P):0,I=A&&F<=0,L=!j&&!g&&A&&!I;a.default.useEffect(()=>{!g&&!j&&N(Date.now())},[g,j]),a.default.useEffect(()=>{if(!L)return;let e=(k-Date.now())%1e3||1e3,t=window.setTimeout(()=>N(Date.now()),e);return()=>window.clearTimeout(t)},[L,k,M]);let R=a.default.useRef(!1);a.default.useEffect(()=>{R.current=!1},[k]),a.default.useEffect(()=>{A&&!j&&I&&(R.current||(R.current=!0,_?.()))},[I,j,A,_]);let z=a.default.useMemo(()=>new Map,[D]),B=(e,t)=>{let n=`${e}-${t}`,r=z.get(n);if(!r){let i={style:`unit`,unit:e,unitDisplay:t};try{r=new Intl.NumberFormat(D,i)}catch{r=new Intl.NumberFormat(`en`,i)}z.set(n,r)}return r},V=e=>B(e.unit,h).formatToParts(e.value).filter(e=>e.type===`unit`).map(e=>e.value).join(``);if(!A)return(0,s.jsxs)(O,{ref:w,className:(0,o.default)(`wim-countdown`,i.default.root,x),...C,children:[(0,s.jsx)(t.Slottable,{children:S}),y]});let H=Math.floor(F/1e3),U=u(H,f===`digital`),W=I&&v!==void 0,G=u(H,!1).map(e=>B(e.unit,`long`).format(e.value)).join(` `);return(0,s.jsxs)(O,{ref:w,role:`timer`,"aria-label":W?void 0:T(`countdown.remaining`,{time:G}),className:(0,o.default)(`wim-countdown`,i.default.root,i.default[f],i.default[p],x),dateTime:new Date(k).toISOString(),...C,children:[(0,s.jsx)(t.Slottable,{children:S}),W?v:f===`digital`?U.map((e,t)=>(0,s.jsxs)(a.default.Fragment,{children:[t>0&&(0,s.jsx)(`span`,{className:i.default.separator,"aria-hidden":`true`,children:`:`}),(0,s.jsx)(`span`,{className:i.default.value,children:l(e.value)})]},e.unit)):U.map(e=>(0,s.jsxs)(`span`,{className:i.default.segment,children:[(0,s.jsx)(`span`,{className:i.default.value,children:e.unit===`day`?String(e.value):l(e.value)}),(0,s.jsx)(`span`,{className:i.default.label,children:V(e)})]},e.unit))]})});d.displayName=`Countdown`,exports.Countdown=d;
|