wimui 0.51.2 → 0.52.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +83 -82
- 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 +58 -57
- 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 +62 -61
- 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 +62 -61
- 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 +49 -48
- 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 +98 -97
- 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/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 +30 -29
- 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 +68 -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.js +127 -126
- 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 +90 -89
- package/dist/components/media/Audio/components/AudioCustomControls.cjs +1 -1
- package/dist/components/media/Audio/components/AudioCustomControls.js +115 -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 +72 -71
- 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 +56 -55
- package/dist/components/media/Video/components/VideoAdvancedMenu.cjs +1 -1
- package/dist/components/media/Video/components/VideoAdvancedMenu.js +136 -135
- 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/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 +7 -3
- package/dist/llms.txt +1 -1
- package/dist/styles.css +1 -1
- 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 -1283
|
@@ -1,47 +1,48 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useWimTranslation as e } from "../../../i18n/useWimTranslation.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import r from "
|
|
6
|
-
import
|
|
7
|
-
import a from "
|
|
8
|
-
import
|
|
3
|
+
import { componentsNs as t } from "../../../i18n/generated/components.js";
|
|
4
|
+
import { FieldTemplate as n } from "../FieldTemplate/FieldTemplate.js";
|
|
5
|
+
import { DatePicker as r } from "../DatePicker/DatePicker.js";
|
|
6
|
+
import i from "./date-range-picker.module.js";
|
|
7
|
+
import { useId as 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/form/DateRangePicker/DateRangePicker.tsx
|
|
10
|
-
var
|
|
11
|
-
let { t:
|
|
12
|
-
return /* @__PURE__ */
|
|
13
|
-
label:
|
|
14
|
-
error:
|
|
15
|
-
required:
|
|
16
|
-
layout:
|
|
17
|
-
labelId:
|
|
18
|
-
errorId:
|
|
19
|
-
className:
|
|
20
|
-
children: /* @__PURE__ */
|
|
21
|
-
className:
|
|
11
|
+
var l = ({ startProps: l, endProps: u, className: d, label: f, error: p, required: m, layout: h = "vertical" }) => {
|
|
12
|
+
let { t: g } = e(t), _ = `wim-daterangepicker-${a()}`, v = f ? `${_}-label` : void 0, y = p ? `${_}-error` : void 0, b = l?.label ? void 0 : g("daterangepicker.start"), x = u?.label ? void 0 : g("daterangepicker.end");
|
|
13
|
+
return /* @__PURE__ */ s(n, {
|
|
14
|
+
label: f,
|
|
15
|
+
error: p,
|
|
16
|
+
required: m,
|
|
17
|
+
layout: h,
|
|
18
|
+
labelId: v,
|
|
19
|
+
errorId: y,
|
|
20
|
+
className: o("wim-date-range-picker", i.container, d),
|
|
21
|
+
children: /* @__PURE__ */ c("div", {
|
|
22
|
+
className: i.root,
|
|
22
23
|
role: "group",
|
|
23
|
-
"aria-labelledby":
|
|
24
|
-
"aria-describedby":
|
|
24
|
+
"aria-labelledby": v,
|
|
25
|
+
"aria-describedby": y,
|
|
25
26
|
children: [
|
|
26
|
-
/* @__PURE__ */
|
|
27
|
-
className:
|
|
28
|
-
children: /* @__PURE__ */
|
|
29
|
-
"aria-label":
|
|
30
|
-
...
|
|
31
|
-
intent:
|
|
27
|
+
/* @__PURE__ */ s("div", {
|
|
28
|
+
className: i.pickerWrapper,
|
|
29
|
+
children: /* @__PURE__ */ s(r, {
|
|
30
|
+
"aria-label": b,
|
|
31
|
+
...l,
|
|
32
|
+
intent: p ? "danger" : l?.intent,
|
|
32
33
|
fullWidth: !0
|
|
33
34
|
})
|
|
34
35
|
}),
|
|
35
|
-
/* @__PURE__ */
|
|
36
|
-
className:
|
|
36
|
+
/* @__PURE__ */ s("span", {
|
|
37
|
+
className: i.separator,
|
|
37
38
|
children: "~"
|
|
38
39
|
}),
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
className:
|
|
41
|
-
children: /* @__PURE__ */
|
|
42
|
-
"aria-label":
|
|
43
|
-
...
|
|
44
|
-
intent:
|
|
40
|
+
/* @__PURE__ */ s("div", {
|
|
41
|
+
className: i.pickerWrapper,
|
|
42
|
+
children: /* @__PURE__ */ s(r, {
|
|
43
|
+
"aria-label": x,
|
|
44
|
+
...u,
|
|
45
|
+
intent: p ? "danger" : u?.intent,
|
|
45
46
|
fullWidth: !0
|
|
46
47
|
})
|
|
47
48
|
})
|
|
@@ -50,4 +51,4 @@ var c = ({ startProps: c, endProps: l, className: u, label: d, error: f, require
|
|
|
50
51
|
});
|
|
51
52
|
};
|
|
52
53
|
//#endregion
|
|
53
|
-
export {
|
|
54
|
+
export { l as DateRangePicker };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../layout/InteractiveArea/InteractiveArea.cjs"),n=require("../../../i18n/useWimTranslation.cjs"),r=require("../../media/Icon/Icon.cjs"),i=require("../FieldTemplate/FieldTemplate.cjs"),
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../layout/InteractiveArea/InteractiveArea.cjs"),n=require("../../../i18n/useWimTranslation.cjs"),r=require("../../media/Icon/Icon.cjs"),i=require("../../../i18n/generated/form.cjs"),a=require("../FieldTemplate/FieldTemplate.cjs"),o=require("./dropzone.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=({label:e,description:u,accept:d,multiple:f=!1,disabled:p=!1,value:m,onChange:h,className:g,iconName:_=`UploadIcon`,error:v,required:y,layout:b=`vertical`,size:x=`md`})=>{let{t:S}=n.useWimTranslation(i.formNs),C=u??S(`dropzone.description`),w=`wim-dropzone-${s.default.useId()}`,T=e?`${w}-label`:void 0,E=v?`${w}-error`:void 0,D=(0,s.useRef)(null),[O,k]=(0,s.useState)(!1),[A,j]=(0,s.useState)(null),M=()=>{p||D.current?.click()},N=e=>{e.preventDefault(),!p&&k(!0)},P=()=>{k(!1)},F=e=>{if(e.preventDefault(),k(!1),p)return;let t=e.dataTransfer.files;j(t),h&&h(t)},I=e=>{let t=e.target.files;j(t),h&&h(t)},L=m===void 0?A?Array.from(A).map(e=>e.name):[]:m;return(0,l.jsxs)(a.FieldTemplate,{label:e,error:v,required:y,layout:b,labelId:T,errorId:E,className:(0,c.default)(`wim-dropzone`,o.default.container,g),children:[(0,l.jsx)(`input`,{type:`file`,ref:D,accept:d,multiple:f,disabled:p,onChange:I,style:{display:`none`},"aria-hidden":`true`,tabIndex:-1}),(0,l.jsx)(t.InteractiveArea,{size:x,isDragging:O,disabled:p,isClickable:!p,onClick:M,onDragOver:N,onDragLeave:P,onDrop:F,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&M()},"aria-labelledby":T,"aria-describedby":E,"aria-required":y,"aria-invalid":!!v,icon:_&&(0,l.jsx)(r.Icon,{name:_,color:p?`disabled`:`primary`}),description:C,children:L.length>0?(0,l.jsx)(`div`,{className:o.default.fileList,children:L.map((e,t)=>(0,l.jsx)(`span`,{className:o.default.fileName,children:e},t))}):null})]})};exports.Dropzone=u;
|
|
@@ -2,70 +2,71 @@
|
|
|
2
2
|
import { InteractiveArea as e } from "../../layout/InteractiveArea/InteractiveArea.js";
|
|
3
3
|
import { useWimTranslation as t } from "../../../i18n/useWimTranslation.js";
|
|
4
4
|
import { Icon as n } from "../../media/Icon/Icon.js";
|
|
5
|
-
import {
|
|
6
|
-
import i from "
|
|
7
|
-
import a
|
|
8
|
-
import c from "
|
|
9
|
-
import
|
|
5
|
+
import { formNs as r } from "../../../i18n/generated/form.js";
|
|
6
|
+
import { FieldTemplate as i } from "../FieldTemplate/FieldTemplate.js";
|
|
7
|
+
import a from "./dropzone.module.js";
|
|
8
|
+
import o, { useRef as s, useState as c } from "react";
|
|
9
|
+
import l from "classnames";
|
|
10
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
10
11
|
//#region src/components/form/Dropzone/Dropzone.tsx
|
|
11
|
-
var
|
|
12
|
-
let { t:
|
|
13
|
-
|
|
14
|
-
},
|
|
15
|
-
e.preventDefault(), !
|
|
16
|
-
},
|
|
17
|
-
|
|
18
|
-
}, L = (e) => {
|
|
19
|
-
if (e.preventDefault(), j(!1), h) return;
|
|
20
|
-
let t = e.dataTransfer.files;
|
|
21
|
-
N(t), _ && _(t);
|
|
12
|
+
var f = ({ label: f, description: p, accept: m, multiple: h = !1, disabled: g = !1, value: _, onChange: v, className: y, iconName: b = "UploadIcon", error: x, required: S, layout: C = "vertical", size: w = "md" }) => {
|
|
13
|
+
let { t: T } = t(r), E = p ?? T("dropzone.description"), D = `wim-dropzone-${o.useId()}`, O = f ? `${D}-label` : void 0, k = x ? `${D}-error` : void 0, A = s(null), [j, M] = c(!1), [N, P] = c(null), F = () => {
|
|
14
|
+
g || A.current?.click();
|
|
15
|
+
}, I = (e) => {
|
|
16
|
+
e.preventDefault(), !g && M(!0);
|
|
17
|
+
}, L = () => {
|
|
18
|
+
M(!1);
|
|
22
19
|
}, R = (e) => {
|
|
20
|
+
if (e.preventDefault(), M(!1), g) return;
|
|
21
|
+
let t = e.dataTransfer.files;
|
|
22
|
+
P(t), v && v(t);
|
|
23
|
+
}, z = (e) => {
|
|
23
24
|
let t = e.target.files;
|
|
24
|
-
|
|
25
|
-
},
|
|
26
|
-
return /* @__PURE__ */
|
|
27
|
-
label:
|
|
28
|
-
error:
|
|
29
|
-
required:
|
|
30
|
-
layout:
|
|
31
|
-
labelId:
|
|
32
|
-
errorId:
|
|
33
|
-
className:
|
|
34
|
-
children: [/* @__PURE__ */
|
|
25
|
+
P(t), v && v(t);
|
|
26
|
+
}, B = _ === void 0 ? N ? Array.from(N).map((e) => e.name) : [] : _;
|
|
27
|
+
return /* @__PURE__ */ d(i, {
|
|
28
|
+
label: f,
|
|
29
|
+
error: x,
|
|
30
|
+
required: S,
|
|
31
|
+
layout: C,
|
|
32
|
+
labelId: O,
|
|
33
|
+
errorId: k,
|
|
34
|
+
className: l("wim-dropzone", a.container, y),
|
|
35
|
+
children: [/* @__PURE__ */ u("input", {
|
|
35
36
|
type: "file",
|
|
36
|
-
ref:
|
|
37
|
-
accept:
|
|
38
|
-
multiple:
|
|
39
|
-
disabled:
|
|
40
|
-
onChange:
|
|
37
|
+
ref: A,
|
|
38
|
+
accept: m,
|
|
39
|
+
multiple: h,
|
|
40
|
+
disabled: g,
|
|
41
|
+
onChange: z,
|
|
41
42
|
style: { display: "none" },
|
|
42
43
|
"aria-hidden": "true",
|
|
43
44
|
tabIndex: -1
|
|
44
|
-
}), /* @__PURE__ */
|
|
45
|
-
size:
|
|
46
|
-
isDragging:
|
|
47
|
-
disabled:
|
|
48
|
-
isClickable: !
|
|
49
|
-
onClick:
|
|
50
|
-
onDragOver:
|
|
51
|
-
onDragLeave:
|
|
52
|
-
onDrop:
|
|
45
|
+
}), /* @__PURE__ */ u(e, {
|
|
46
|
+
size: w,
|
|
47
|
+
isDragging: j,
|
|
48
|
+
disabled: g,
|
|
49
|
+
isClickable: !g,
|
|
50
|
+
onClick: F,
|
|
51
|
+
onDragOver: I,
|
|
52
|
+
onDragLeave: L,
|
|
53
|
+
onDrop: R,
|
|
53
54
|
onKeyDown: (e) => {
|
|
54
|
-
(e.key === "Enter" || e.key === " ") &&
|
|
55
|
+
(e.key === "Enter" || e.key === " ") && F();
|
|
55
56
|
},
|
|
56
|
-
"aria-labelledby":
|
|
57
|
-
"aria-describedby":
|
|
58
|
-
"aria-required":
|
|
59
|
-
"aria-invalid": !!
|
|
60
|
-
icon:
|
|
61
|
-
name:
|
|
62
|
-
color:
|
|
57
|
+
"aria-labelledby": O,
|
|
58
|
+
"aria-describedby": k,
|
|
59
|
+
"aria-required": S,
|
|
60
|
+
"aria-invalid": !!x,
|
|
61
|
+
icon: b && /* @__PURE__ */ u(n, {
|
|
62
|
+
name: b,
|
|
63
|
+
color: g ? "disabled" : "primary"
|
|
63
64
|
}),
|
|
64
|
-
description:
|
|
65
|
-
children:
|
|
66
|
-
className:
|
|
67
|
-
children:
|
|
68
|
-
className:
|
|
65
|
+
description: E,
|
|
66
|
+
children: B.length > 0 ? /* @__PURE__ */ u("div", {
|
|
67
|
+
className: a.fileList,
|
|
68
|
+
children: B.map((e, t) => /* @__PURE__ */ u("span", {
|
|
69
|
+
className: a.fileName,
|
|
69
70
|
children: e
|
|
70
71
|
}, t))
|
|
71
72
|
}) : null
|
|
@@ -73,4 +74,4 @@ var d = ({ label: d, description: f, accept: p, multiple: m = !1, disabled: h =
|
|
|
73
74
|
});
|
|
74
75
|
};
|
|
75
76
|
//#endregion
|
|
76
|
-
export {
|
|
77
|
+
export { f as Dropzone };
|
|
@@ -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"),r=require("../Button/Button.cjs"),i=require("../FieldTemplate/FieldTemplate.cjs"),
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../../layout/VisuallyHidden/VisuallyHidden.cjs"),r=require("../Button/Button.cjs"),i=require("../../../i18n/generated/form.cjs"),a=require("../FieldTemplate/FieldTemplate.cjs"),o=require("./file-upload.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=({label:e,buttonLabel:u,noFileLabel:d,accept:f,multiple:p=!1,disabled:m=!1,value:h,onChange:g,className:_,iconName:v,iconPosition:y,size:b=`md`,error:x,required:S,layout:C=`vertical`})=>{let{t:w}=t.useWimTranslation(i.formNs),T=`wim-fileupload-${s.default.useId()}`,E=e?`${T}-label`:void 0,D=x?`${T}-error`:void 0,O=S?`${T}-required`:void 0,k=[D,O].filter(Boolean).join(` `)||void 0,A=(0,s.useRef)(null),[j,M]=(0,s.useState)(null),N=()=>{A.current?.click()},P=e=>{let t=e.target.files;M(t),g&&g(t)},F=h===void 0?j?Array.from(j).map(e=>e.name):[]:h,I=F.length>0?F.join(`, `):d??w(`fileupload.no_file`);return(0,l.jsx)(a.FieldTemplate,{label:e,error:x,required:S,layout:C,labelId:E,errorId:D,className:(0,c.default)(`wim-file-upload`,o.default.root,o.default[b],_),children:(0,l.jsxs)(`div`,{className:o.default.controls,children:[(0,l.jsx)(`input`,{type:`file`,ref:A,accept:f,multiple:p,disabled:m,onChange:P,className:o.default.input,"aria-hidden":`true`,tabIndex:-1}),(0,l.jsx)(r.Button,{onClick:N,disabled:m,variant:`outline`,icon:v,iconPosition:y,size:b,"aria-labelledby":E,"aria-describedby":k,"aria-invalid":x?!0:void 0,children:u??w(`fileupload.button`)}),S&&(0,l.jsx)(n.VisuallyHidden,{id:O,children:w(`form.required`)}),(0,l.jsx)(`span`,{className:(0,c.default)(o.default.fileNames,o.default[b],m&&o.default.disabled),"aria-disabled":m||void 0,children:I})]})})};exports.FileUpload=u;
|
|
@@ -2,65 +2,66 @@
|
|
|
2
2
|
import { useWimTranslation as e } from "../../../i18n/useWimTranslation.js";
|
|
3
3
|
import { VisuallyHidden as t } from "../../layout/VisuallyHidden/VisuallyHidden.js";
|
|
4
4
|
import { Button as n } from "../Button/Button.js";
|
|
5
|
-
import {
|
|
6
|
-
import i from "
|
|
7
|
-
import a
|
|
8
|
-
import c from "
|
|
9
|
-
import
|
|
5
|
+
import { formNs as r } from "../../../i18n/generated/form.js";
|
|
6
|
+
import { FieldTemplate as i } from "../FieldTemplate/FieldTemplate.js";
|
|
7
|
+
import a from "./file-upload.module.js";
|
|
8
|
+
import o, { useRef as s, useState as c } from "react";
|
|
9
|
+
import l from "classnames";
|
|
10
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
10
11
|
//#region src/components/form/FileUpload/FileUpload.tsx
|
|
11
|
-
var
|
|
12
|
-
let { t:
|
|
13
|
-
|
|
14
|
-
},
|
|
12
|
+
var f = ({ label: f, buttonLabel: p, noFileLabel: m, accept: h, multiple: g = !1, disabled: _ = !1, value: v, onChange: y, className: b, iconName: x, iconPosition: S, size: C = "md", error: w, required: T, layout: E = "vertical" }) => {
|
|
13
|
+
let { t: D } = e(r), O = `wim-fileupload-${o.useId()}`, k = f ? `${O}-label` : void 0, A = w ? `${O}-error` : void 0, j = T ? `${O}-required` : void 0, M = [A, j].filter(Boolean).join(" ") || void 0, N = s(null), [P, F] = c(null), I = () => {
|
|
14
|
+
N.current?.click();
|
|
15
|
+
}, L = (e) => {
|
|
15
16
|
let t = e.target.files;
|
|
16
|
-
|
|
17
|
-
},
|
|
18
|
-
return /* @__PURE__ */
|
|
19
|
-
label:
|
|
20
|
-
error:
|
|
21
|
-
required:
|
|
22
|
-
layout:
|
|
23
|
-
labelId:
|
|
24
|
-
errorId:
|
|
25
|
-
className:
|
|
26
|
-
children: /* @__PURE__ */
|
|
27
|
-
className:
|
|
17
|
+
F(t), y && y(t);
|
|
18
|
+
}, R = v === void 0 ? P ? Array.from(P).map((e) => e.name) : [] : v, z = R.length > 0 ? R.join(", ") : m ?? D("fileupload.no_file");
|
|
19
|
+
return /* @__PURE__ */ u(i, {
|
|
20
|
+
label: f,
|
|
21
|
+
error: w,
|
|
22
|
+
required: T,
|
|
23
|
+
layout: E,
|
|
24
|
+
labelId: k,
|
|
25
|
+
errorId: A,
|
|
26
|
+
className: l("wim-file-upload", a.root, a[C], b),
|
|
27
|
+
children: /* @__PURE__ */ d("div", {
|
|
28
|
+
className: a.controls,
|
|
28
29
|
children: [
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
+
/* @__PURE__ */ u("input", {
|
|
30
31
|
type: "file",
|
|
31
|
-
ref:
|
|
32
|
-
accept:
|
|
33
|
-
multiple:
|
|
34
|
-
disabled:
|
|
35
|
-
onChange:
|
|
36
|
-
className:
|
|
32
|
+
ref: N,
|
|
33
|
+
accept: h,
|
|
34
|
+
multiple: g,
|
|
35
|
+
disabled: _,
|
|
36
|
+
onChange: L,
|
|
37
|
+
className: a.input,
|
|
37
38
|
"aria-hidden": "true",
|
|
38
39
|
tabIndex: -1
|
|
39
40
|
}),
|
|
40
|
-
/* @__PURE__ */
|
|
41
|
-
onClick:
|
|
42
|
-
disabled:
|
|
41
|
+
/* @__PURE__ */ u(n, {
|
|
42
|
+
onClick: I,
|
|
43
|
+
disabled: _,
|
|
43
44
|
variant: "outline",
|
|
44
|
-
icon:
|
|
45
|
-
iconPosition:
|
|
46
|
-
size:
|
|
47
|
-
"aria-labelledby":
|
|
48
|
-
"aria-describedby":
|
|
49
|
-
"aria-invalid":
|
|
50
|
-
children:
|
|
45
|
+
icon: x,
|
|
46
|
+
iconPosition: S,
|
|
47
|
+
size: C,
|
|
48
|
+
"aria-labelledby": k,
|
|
49
|
+
"aria-describedby": M,
|
|
50
|
+
"aria-invalid": w ? !0 : void 0,
|
|
51
|
+
children: p ?? D("fileupload.button")
|
|
51
52
|
}),
|
|
52
|
-
|
|
53
|
-
id:
|
|
54
|
-
children:
|
|
53
|
+
T && /* @__PURE__ */ u(t, {
|
|
54
|
+
id: j,
|
|
55
|
+
children: D("form.required")
|
|
55
56
|
}),
|
|
56
|
-
/* @__PURE__ */
|
|
57
|
-
className:
|
|
58
|
-
"aria-disabled":
|
|
59
|
-
children:
|
|
57
|
+
/* @__PURE__ */ u("span", {
|
|
58
|
+
className: l(a.fileNames, a[C], _ && a.disabled),
|
|
59
|
+
"aria-disabled": _ || void 0,
|
|
60
|
+
children: z
|
|
60
61
|
})
|
|
61
62
|
]
|
|
62
63
|
})
|
|
63
64
|
});
|
|
64
65
|
};
|
|
65
66
|
//#endregion
|
|
66
|
-
export {
|
|
67
|
+
export { f as FileUpload };
|
|
@@ -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("../../media/Icon/Icon.cjs"),r=require("./float-button.module.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("classnames");a=e.__toESM(a,1);let o=require("react/jsx-runtime");var s=i.default.forwardRef(({asChild:e=!1,iconName:s=`CircleIcon`,variant:c,intent:l=`default`,shape:u=`circle`,size:d=`md`,label:f,shrink:p=!1,position:m=`bottom-right`,description:h,badge:g,backTop:_=!1,visibilityHeight:v=400,className:y,style:b,onClick:x,"aria-label":S,children:C,...w},T)=>{let[E,D]=(0,i.useState)(()=>!_||typeof window<`u`&&(window.pageYOffset||document.documentElement.scrollTop)>v),O=(0,i.useCallback)(()=>{if(_){let e=window.pageYOffset||document.documentElement.scrollTop;D(e>v)}},[_,v]);(0,i.useEffect)(()=>{if(_)return window.addEventListener(`scroll`,O),()=>window.removeEventListener(`scroll`,O)},[_,O]);let k=e=>{_&&window.scrollTo({top:0,behavior:`smooth`}),x?.(e)}
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/@radix-ui/react-slot/dist/index.cjs"),n=require("../../media/Icon/Icon.cjs"),r=require("./float-button.module.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("classnames");a=e.__toESM(a,1);let o=require("react/jsx-runtime");var s=i.default.forwardRef(({asChild:e=!1,iconName:s=`CircleIcon`,variant:c,intent:l=`default`,shape:u=`circle`,size:d=`md`,label:f,shrink:p=!1,position:m=`bottom-right`,description:h,badge:g,backTop:_=!1,visibilityHeight:v=400,className:y,style:b,onClick:x,"aria-label":S,children:C,...w},T)=>{let[E,D]=(0,i.useState)(()=>!_||typeof window<`u`&&(window.pageYOffset||document.documentElement.scrollTop)>v),O=(0,i.useCallback)(()=>{if(_){let e=window.pageYOffset||document.documentElement.scrollTop;D(e>v)}},[_,v]);(0,i.useEffect)(()=>{if(_)return window.addEventListener(`scroll`,O),()=>window.removeEventListener(`scroll`,O)},[_,O]);let k=e=>{_&&window.scrollTo({top:0,behavior:`smooth`}),x?.(e)},A=S||(typeof f==`string`?f:void 0),j=!!A||!!f||!!C||!!w[`aria-labelledby`]||typeof h==`string`;if((0,i.useEffect)(()=>{},[j]),!E&&_)return null;let M=e?t.Root:`button`,N=m===`bottom-right`?r.default.bottomRight:m===`bottom-left`?r.default.bottomLeft:m===`bottom-center`?r.default.bottomCenter:m===`top-right`?r.default.topRight:m===`top-left`?r.default.topLeft:r.default.inline;return(0,o.jsxs)(M,{ref:T,type:e?void 0:`button`,className:(0,a.default)(`wim-float-button`,r.default.root,!c&&r.default[l],c===`outline`&&r.default.outline,c===`glass`&&r.default.glass,l===`danger`&&r.default.danger,l===`success`&&r.default.success,r.default[u],r.default[d],N,!!f&&r.default.extended,!!p&&r.default.shrink,y),style:b,onClick:k,title:typeof h==`string`?h:void 0,"aria-label":A,...w,children:[(0,o.jsx)(t.Slottable,{children:C}),(0,o.jsxs)(`span`,{className:r.default.inner,children:[(0,o.jsx)(n.Icon,{name:_?`ChevronUpIcon`:s,size:d,className:(0,a.default)(_&&r.default.iconBacktop)}),f&&(0,o.jsx)(`span`,{className:r.default.labelWrapper,children:(0,o.jsx)(`span`,{className:r.default.label,children:f})}),g&&(0,o.jsx)(`span`,{className:(0,a.default)(r.default.badge,g===!0&&r.default.dot),children:typeof g==`number`?g:``})]}),h&&(0,o.jsx)(`span`,{className:r.default.description,children:h})]})});s.displayName=`FloatButton`,exports.FloatButton=s,exports.default=s;
|
|
@@ -41,7 +41,10 @@ export interface FloatButtonProps extends React.ButtonHTMLAttributes<HTMLButtonE
|
|
|
41
41
|
className?: string;
|
|
42
42
|
/** Style attribute */
|
|
43
43
|
style?: React.CSSProperties;
|
|
44
|
-
/**
|
|
44
|
+
/**
|
|
45
|
+
* Accessible name. Required when there is no string `label`: an icon-only button has no
|
|
46
|
+
* text to take a name from, and the icon name is not used as one.
|
|
47
|
+
*/
|
|
45
48
|
"aria-label"?: string;
|
|
46
49
|
}
|
|
47
50
|
export declare const FloatButton: React.ForwardRefExoticComponent<FloatButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -21,17 +21,17 @@ var d = i.forwardRef(({ asChild: i = !1, iconName: d = "CircleIcon", variant: f,
|
|
|
21
21
|
top: 0,
|
|
22
22
|
behavior: "smooth"
|
|
23
23
|
}), T?.(e);
|
|
24
|
-
};
|
|
25
|
-
if (!A && x) return null;
|
|
26
|
-
let
|
|
27
|
-
return /* @__PURE__ */ u(
|
|
24
|
+
}, P = E || (typeof g == "string" ? g : void 0), F = !!P || !!g || !!D || !!O["aria-labelledby"] || typeof y == "string";
|
|
25
|
+
if (o(() => {}, [F]), !A && x) return null;
|
|
26
|
+
let I = i ? e : "button", L = v === "bottom-right" ? r.bottomRight : v === "bottom-left" ? r.bottomLeft : v === "bottom-center" ? r.bottomCenter : v === "top-right" ? r.topRight : v === "top-left" ? r.topLeft : r.inline;
|
|
27
|
+
return /* @__PURE__ */ u(I, {
|
|
28
28
|
ref: k,
|
|
29
29
|
type: i ? void 0 : "button",
|
|
30
|
-
className: c("wim-float-button", r.root, !f && r[p], f === "outline" && r.outline, f === "glass" && r.glass, p === "danger" && r.danger, p === "success" && r.success, r[m], r[h],
|
|
30
|
+
className: c("wim-float-button", r.root, !f && r[p], f === "outline" && r.outline, f === "glass" && r.glass, p === "danger" && r.danger, p === "success" && r.success, r[m], r[h], L, !!g && r.extended, !!_ && r.shrink, C),
|
|
31
31
|
style: w,
|
|
32
32
|
onClick: N,
|
|
33
33
|
title: typeof y == "string" ? y : void 0,
|
|
34
|
-
"aria-label":
|
|
34
|
+
"aria-label": P,
|
|
35
35
|
...O,
|
|
36
36
|
children: [
|
|
37
37
|
/* @__PURE__ */ l(t, { children: D }),
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../Button/Button.cjs"),
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../../../i18n/generated/common.cjs"),r=require("../Button/Button.cjs"),i=require("../../../i18n/generated/form.cjs"),a=require("../Slider/Slider.cjs"),o=require("../IconButton/IconButton.cjs"),s=require("../../overlay/Dialog/Dialog.cjs"),c=require("./image-cropper.module.cjs");let l=require("react");l=e.__toESM(l,1);let u=require("classnames");u=e.__toESM(u,1);let d=require("react/jsx-runtime");var f=l.default.forwardRef(({src:e,aspectRatio:f=1,circular:p=!1,onCrop:m,showRotation:h=!0,showZoom:g=!0,showApplyButton:_=!0,applyLabel:v,onApply:y,className:b,...x},S)=>{let{t:C}=t.useWimTranslation([i.formNs,n.commonNs]),[w,T]=(0,l.useState)(1),[E,D]=(0,l.useState)(0),[O,k]=(0,l.useState)({x:0,y:0}),[A,j]=(0,l.useState)(!1),[M,N]=(0,l.useState)({x:0,y:0}),[P,F]=(0,l.useState)(!1),I=(0,l.useRef)(null),L=(0,l.useRef)(null);(0,l.useEffect)(()=>{k({x:0,y:0}),T(1),D(0)},[e]);let R=e=>{j(!0),N({x:e.clientX-O.x,y:e.clientY-O.y})},z=(0,l.useCallback)(e=>{A&&k({x:e.clientX-M.x,y:e.clientY-M.y})},[A,M]),B=(0,l.useCallback)(()=>{j(!1)},[]);(0,l.useEffect)(()=>(A?(window.addEventListener(`mousemove`,z),window.addEventListener(`mouseup`,B)):(window.removeEventListener(`mousemove`,z),window.removeEventListener(`mouseup`,B)),()=>{window.removeEventListener(`mousemove`,z),window.removeEventListener(`mouseup`,B)}),[A,z,B]);let V=()=>{D(e=>(e+90)%360)},H=()=>{F(!0)},U=()=>{let t=e||``;m?.(t),y?.(t),F(!1)};return e?(0,d.jsxs)(`div`,{ref:S,className:(0,u.default)(`wim-image-cropper`,c.default.root,b),...x,children:[(0,d.jsxs)(`div`,{ref:L,className:c.default.viewer,onMouseDown:R,role:`presentation`,children:[(0,d.jsx)(`div`,{className:c.default.imageContainer,children:(0,d.jsx)(`img`,{ref:I,src:e,alt:C(`a11y.crop_target`),className:c.default.image,style:{transform:`translate(${O.x}px, ${O.y}px) rotate(${E}deg) scale(${w})`},draggable:!1})}),(0,d.jsx)(`div`,{className:c.default.overlay,children:(0,d.jsx)(`div`,{className:(0,u.default)(c.default.cropArea,{[c.default.circular]:p}),style:{aspectRatio:f}})})]}),(0,d.jsxs)(`div`,{className:c.default.controls,children:[g&&(0,d.jsx)(`div`,{className:c.default.zoomControl,children:(0,d.jsx)(a.Slider,{min:1,max:3,step:.1,value:w,onChange:e=>T(e),label:C(`image_cropper.zoom`),styles:{root:c.default.zoomSlider}})}),h&&(0,d.jsx)(`div`,{className:c.default.rotationControl,children:(0,d.jsx)(o.IconButton,{iconName:`RefreshIcon`,onClick:V,"aria-label":C(`image_cropper.rotate`),variant:`outline`,size:`sm`})}),_&&(0,d.jsx)(`div`,{className:c.default.applyControl,children:(0,d.jsx)(r.Button,{onClick:H,size:`sm`,variant:`solid`,children:v||C(`image_cropper.apply`)})})]}),(0,d.jsx)(s.Dialog,{open:P,onOpenChange:F,children:(0,d.jsxs)(s.DialogContent,{children:[(0,d.jsx)(s.DialogHeader,{children:(0,d.jsx)(s.DialogTitle,{children:C(`image_cropper.confirm_title`)})}),(0,d.jsx)(s.DialogDescription,{children:C(`image_cropper.confirm_message`)}),(0,d.jsxs)(s.DialogFooter,{children:[(0,d.jsx)(s.DialogClose,{asChild:!0,children:(0,d.jsx)(r.Button,{variant:`ghost`,children:C(`image_cropper.cancel`)})}),(0,d.jsx)(r.Button,{onClick:U,variant:`solid`,children:C(`image_cropper.confirm`)})]})]})})]}):(0,d.jsx)(`div`,{ref:S,className:(0,u.default)(`wim-image-cropper`,c.default.root,c.default.empty,b),...x,children:(0,d.jsx)(`div`,{className:c.default.emptyContent,children:C(`image_cropper.no_image`)})})});f.displayName=`ImageCropper`,exports.ImageCropper=f;
|