welcome-ui 10.0.0-alpha.1 → 10.0.0-alpha.11
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/README.md +1 -1
- package/dist/2W3RN7C5-DMC82gDP.js +61 -0
- package/dist/4I4MLMKD-BO6Lcy7s.js +150 -0
- package/dist/Accordion.js +20 -18
- package/dist/Alert.css +1 -1
- package/dist/Alert.js +93 -87
- package/dist/AspectRatio.js +2 -1
- package/dist/Avatar.js +14 -12
- package/dist/{B7UTNDHN-BlIblHCu.js → B7UTNDHN-BghjolIs.js} +30 -30
- package/dist/Badge.js +2 -1
- package/dist/Breadcrumb.css +1 -1
- package/dist/Breadcrumb.js +175 -154
- package/dist/Button.css +1 -1
- package/dist/Button.js +43 -41
- package/dist/ButtonGroup.js +7 -5
- package/dist/Card.css +1 -1
- package/dist/Card.js +68 -15
- package/dist/Checkbox.js +32 -30
- package/dist/CloseButton.css +1 -1
- package/dist/CloseButton.js +15 -13
- package/dist/{CustomPopper-vwbOQq72.js → CustomPopper-C1wIDHbM.js} +5 -4
- package/dist/{DSAASPLT-BaaCUKsb.js → DSAASPLT-Fx1kuAsk.js} +3 -3
- package/dist/DatePicker.js +96 -91
- package/dist/DateTimePicker.js +21 -20
- package/dist/Drawer.js +141 -96
- package/dist/DropdownMenu.css +1 -1
- package/dist/DropdownMenu.js +902 -462
- package/dist/Field.css +1 -1
- package/dist/Field.js +50 -50
- package/dist/FieldGroup.js +9 -7
- package/dist/FileDrop.css +1 -1
- package/dist/FileDrop.js +433 -398
- package/dist/FileUpload.js +44 -41
- package/dist/GVVKDT6A-CF9ejW_c.js +619 -0
- package/dist/Hint.js +10 -8
- package/dist/Icon.css +1 -1
- package/dist/Icon.js +36 -22
- package/dist/InputText.css +1 -1
- package/dist/InputText.js +59 -57
- package/dist/{KPUWHTQJ-D2TPji47.js → KPUWHTQJ-Dv3cAqjP.js} +33 -31
- package/dist/Label.js +9 -7
- package/dist/Link.css +1 -1
- package/dist/Link.js +54 -49
- package/dist/Loader.js +13 -11
- package/dist/Logo.js +21 -13
- package/dist/Modal.js +153 -113
- package/dist/{NI3IVY7K-Ztb3-XAv.js → NI3IVY7K-Dy240mkD.js} +53 -53
- package/dist/{NMGNQVTG-C6TqBngP.js → NMGNQVTG-DRO2uXZT.js} +8 -8
- package/dist/{OE2EFRVA-C3721cM3.js → OE2EFRVA-Dg1R6gaC.js} +186 -170
- package/dist/{OLVWQA7U-DysaSaZj.js → OLVWQA7U-Dia3UUnG.js} +51 -51
- package/dist/Pagination.css +1 -1
- package/dist/Pagination.js +157 -76
- package/dist/PasswordInput.js +20 -17
- package/dist/Popover.js +89 -72
- package/dist/{RTNCFSKZ-qpPg689E.js → RTNCFSKZ-BywELldk.js} +47 -47
- package/dist/Radio.css +1 -1
- package/dist/Radio.js +39 -40
- package/dist/RadioGroup.js +29 -27
- package/dist/RadioTab.js +3 -2
- package/dist/{SBSPVDDI-DJKkC1eb.js → SBSPVDDI-CmtnvvUX.js} +42 -42
- package/dist/SQZLCNLX-Dg4KKdNJ.js +83 -0
- package/dist/Search.css +1 -1
- package/dist/Search.js +136 -129
- package/dist/Select.css +1 -1
- package/dist/Select.js +259 -257
- package/dist/Slider.js +67 -62
- package/dist/Stepper.js +34 -27
- package/dist/StickyNote.css +1 -0
- package/dist/StickyNote.js +49 -0
- package/dist/Swiper.js +53 -51
- package/dist/{T22PY7TE-C1N0q8Kn.js → T22PY7TE-gLuJpoOm.js} +46 -46
- package/dist/Table.js +34 -21
- package/dist/Tabs.js +165 -156
- package/dist/Tag.css +1 -1
- package/dist/Tag.js +67 -62
- package/dist/Text.js +5 -3
- package/dist/Textarea.css +1 -1
- package/dist/Textarea.js +26 -17
- package/dist/TimePicker.js +53 -51
- package/dist/Toast.css +1 -1
- package/dist/Toast.js +275 -165
- package/dist/Toggle.js +17 -15
- package/dist/Tooltip.css +1 -1
- package/dist/Tooltip.js +120 -129
- package/dist/VariantIcon.js +8 -6
- package/dist/VisuallyHidden.js +9 -7
- package/dist/WelcomeLoader.js +4 -3
- package/dist/XCKGTAUF-CJwwVibW.js +25 -0
- package/dist/{Y67KZUMI-DFEgrUv2.js → Y67KZUMI-BwLWwpNF.js} +5 -5
- package/dist/{ZTXFEM5L-CkrIQCN1.js → ZTXFEM5L-WGHY_jqg.js} +3 -3
- package/dist/{downshift.esm-D_6pHXkq.js → downshift.esm-xtYanIDi.js} +1 -1
- package/dist/scss/breakpoints.scss +9 -0
- package/dist/scss/text-ellipsis.scss +5 -0
- package/dist/scss/texts.scss +108 -0
- package/dist/theme.css +1 -1
- package/dist/theme.js +1 -0
- package/dist/{tslib.es6-DpB4Y59c.js → tslib.es6-C80jYMbM.js} +1 -1
- package/dist/types/components/Alert/components/Buttons.d.ts +3 -0
- package/dist/types/components/Alert/components/Title.d.ts +5 -0
- package/dist/types/components/Alert/index.d.ts +7 -3
- package/dist/types/components/Alert/types.d.ts +3 -9
- package/dist/types/components/Breadcrumb/Item.d.ts +2 -2
- package/dist/types/components/Breadcrumb/index.d.ts +1 -1
- package/dist/types/components/Breadcrumb/types.d.ts +6 -3
- package/dist/types/components/Card/Body.d.ts +2 -3
- package/dist/types/components/Card/Footer.d.ts +6 -0
- package/dist/types/components/Card/Header.d.ts +5 -0
- package/dist/types/components/Card/index.d.ts +7 -8
- package/dist/types/components/Card/types.d.ts +16 -3
- package/dist/types/components/Checkbox/index.d.ts +1 -2
- package/dist/types/components/Checkbox/types.d.ts +3 -1
- package/dist/types/components/DateTimePickerCommon/CustomHeader.d.ts +4 -1
- package/dist/types/components/DateTimePickerCommon/CustomPopper.d.ts +6 -3
- package/dist/types/components/Drawer/AssetDrawer/Header.d.ts +4 -1
- package/dist/types/components/Drawer/AssetDrawer/IconBlock.d.ts +4 -1
- package/dist/types/components/Drawer/AssetDrawer/types.d.ts +3 -0
- package/dist/types/components/Drawer/components/Backdrop.d.ts +1 -1
- package/dist/types/components/Drawer/components/Close.d.ts +4 -1
- package/dist/types/components/Drawer/components/Title.d.ts +4 -1
- package/dist/types/components/Drawer/index.d.ts +13 -4
- package/dist/types/components/DropdownMenu/Action.d.ts +2 -0
- package/dist/types/components/DropdownMenu/Group.d.ts +4 -0
- package/dist/types/components/DropdownMenu/Item.d.ts +7 -0
- package/dist/types/components/DropdownMenu/Search.d.ts +2 -0
- package/dist/types/components/DropdownMenu/Submenu.d.ts +4 -0
- package/dist/types/components/DropdownMenu/index.d.ts +11 -0
- package/dist/types/components/DropdownMenu/types.d.ts +26 -5
- package/dist/types/components/FileDrop/components/FilePreview.d.ts +4 -1
- package/dist/types/components/FileDrop/components/Message.d.ts +4 -1
- package/dist/types/components/FileDrop/types.d.ts +2 -0
- package/dist/types/components/Icon/icons.d.ts +6 -6
- package/dist/types/components/Icon/types.d.ts +2 -0
- package/dist/types/components/Loader/index.d.ts +4 -1
- package/dist/types/components/Modal/Assets/AssetContent.d.ts +4 -1
- package/dist/types/components/Modal/Assets/AssetTitle.d.ts +4 -1
- package/dist/types/components/Modal/Assets/CloseButton.d.ts +4 -1
- package/dist/types/components/Modal/Assets/Dialog.d.ts +4 -1
- package/dist/types/components/Modal/Assets/Iframe.d.ts +4 -1
- package/dist/types/components/Modal/Assets/index.d.ts +16 -4
- package/dist/types/components/Modal/components/Close.d.ts +4 -1
- package/dist/types/components/Modal/components/Content.d.ts +1 -1
- package/dist/types/components/Modal/index.d.ts +17 -5
- package/dist/types/components/Modal/types.d.ts +1 -1
- package/dist/types/components/Pagination/types.d.ts +11 -0
- package/dist/types/components/PasswordInput/ToggleButton.d.ts +4 -1
- package/dist/types/components/Popover/Arrow.d.ts +4 -1
- package/dist/types/components/Popover/ContentWrapper.d.ts +4 -1
- package/dist/types/components/Radio/types.d.ts +1 -1
- package/dist/types/components/RadioGroup/index.d.ts +4 -1
- package/dist/types/components/Stepper/index.d.ts +8 -2
- package/dist/types/components/StickyNote/components/Button.d.ts +5 -0
- package/dist/types/components/StickyNote/components/Title.d.ts +5 -0
- package/dist/types/components/StickyNote/index.d.ts +11 -0
- package/dist/types/components/StickyNote/index.test.d.ts +1 -0
- package/dist/types/components/StickyNote/types.d.ts +15 -0
- package/dist/types/components/Swiper/index.d.ts +4 -1
- package/dist/types/components/Table/index.d.ts +20 -5
- package/dist/types/components/Tabs/components/ActiveBar/index.d.ts +4 -1
- package/dist/types/components/Tag/types.d.ts +4 -2
- package/dist/types/components/Textarea/types.d.ts +1 -0
- package/dist/types/components/Toast/components/Growl.d.ts +2 -0
- package/dist/types/components/Toast/index.d.ts +8 -2
- package/dist/types/components/Toast/types.d.ts +8 -9
- package/dist/types/components/Tooltip/types.d.ts +1 -1
- package/dist/types/theme/types.d.ts +255 -218
- package/dist/types/utils/index.d.ts +0 -1
- package/dist/{utils-DileZjMm.js → utils-BD597oo6.js} +1 -1
- package/dist/utils.js +3 -2
- package/package.json +3 -2
- package/dist/2W3RN7C5-bkX-rIa3.js +0 -61
- package/dist/4I4MLMKD-BLxAidnq.js +0 -43
- package/dist/GVVKDT6A-bET6V7Py.js +0 -724
- package/dist/SQZLCNLX-CHDXnZ16.js +0 -82
- package/dist/XCKGTAUF-DkxWCbaW.js +0 -25
- package/dist/index.css +0 -0
- package/dist/types/components/Icon/Icon.d.ts +0 -2
- package/dist/types/utils/theme/index.d.ts +0 -0
- /package/dist/{index-CdiHdiVB.js → index-PAaZGbyz.js} +0 -0
- /package/dist/types/components/Icon/{Icon.test.d.ts → index.test.d.ts} +0 -0
package/dist/DatePicker.js
CHANGED
|
@@ -1,102 +1,105 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
2
|
+
import './DatePicker.css';
|
|
3
|
+
import { jsxs as G, jsx as l } from "react/jsx-runtime";
|
|
4
|
+
import { useState as A, useMemo as $, useEffect as S, forwardRef as J, useRef as Q } from "react";
|
|
5
|
+
import { D as V, C as W } from "./CustomPopper-C1wIDHbM.js";
|
|
6
|
+
import { Button as j } from "./Button.js";
|
|
7
|
+
import { Icon as F } from "./Icon.js";
|
|
8
|
+
import { Select as M } from "./Select.js";
|
|
9
|
+
import { c as v } from "./index-PAaZGbyz.js";
|
|
10
|
+
import { g as X, a as Z, s as B, b as Y, D as K } from "./utils-BD597oo6.js";
|
|
11
|
+
import { InputText as g } from "./InputText.js";
|
|
12
|
+
const C = v(B), L = ({
|
|
12
13
|
changeMonth: x,
|
|
13
|
-
changeYear:
|
|
14
|
+
changeYear: N,
|
|
14
15
|
date: f,
|
|
15
|
-
decreaseMonth:
|
|
16
|
-
decreaseYear:
|
|
17
|
-
endYear:
|
|
18
|
-
increaseMonth:
|
|
16
|
+
decreaseMonth: T,
|
|
17
|
+
decreaseYear: z,
|
|
18
|
+
endYear: c,
|
|
19
|
+
increaseMonth: I,
|
|
19
20
|
increaseYear: y,
|
|
20
21
|
isMonthYearPicker: t,
|
|
21
22
|
locale: D,
|
|
22
|
-
startYear:
|
|
23
|
+
startYear: a
|
|
23
24
|
}) => {
|
|
24
|
-
const [
|
|
25
|
-
return
|
|
26
|
-
const b = new Date(f),
|
|
27
|
-
|
|
28
|
-
}, [f,
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
|
|
25
|
+
const [p, R] = A(null), [m, w] = A(null), i = $(() => X(D), [D]), r = $(() => Z(a, c), [a, c]), o = (t || p === i[0].label) && m === a, E = (t || p === i[i.length - 1].label) && m === c;
|
|
26
|
+
return S(() => {
|
|
27
|
+
const b = new Date(f), u = i[b.getMonth()].label, H = b.getFullYear();
|
|
28
|
+
R(u), w(H);
|
|
29
|
+
}, [f, i]), /* @__PURE__ */ G("div", { className: C("custom-header"), children: [
|
|
30
|
+
/* @__PURE__ */ l(
|
|
31
|
+
j,
|
|
31
32
|
{
|
|
32
|
-
disabled:
|
|
33
|
-
onClick: t ?
|
|
33
|
+
disabled: o,
|
|
34
|
+
onClick: t ? z : T,
|
|
34
35
|
size: "sm",
|
|
35
36
|
title: `Previous ${t ? "year" : "month"}`,
|
|
36
37
|
variant: "tertiary",
|
|
37
|
-
children: /* @__PURE__ */
|
|
38
|
+
children: /* @__PURE__ */ l(F, { name: "angle-left-b", size: "xs" })
|
|
38
39
|
}
|
|
39
40
|
),
|
|
40
|
-
!t && /* @__PURE__ */
|
|
41
|
-
|
|
41
|
+
!t && /* @__PURE__ */ l(
|
|
42
|
+
M,
|
|
42
43
|
{
|
|
43
44
|
id: "month",
|
|
44
45
|
name: "month",
|
|
45
46
|
onChange: x,
|
|
46
|
-
options:
|
|
47
|
+
options: i,
|
|
47
48
|
size: "md",
|
|
48
|
-
value:
|
|
49
|
+
value: p
|
|
49
50
|
}
|
|
50
51
|
),
|
|
51
|
-
/* @__PURE__ */
|
|
52
|
-
/* @__PURE__ */
|
|
53
|
-
|
|
52
|
+
/* @__PURE__ */ l(M, { id: "year", name: "year", onChange: N, options: r, size: "md", value: m }),
|
|
53
|
+
/* @__PURE__ */ l(
|
|
54
|
+
j,
|
|
54
55
|
{
|
|
55
|
-
disabled:
|
|
56
|
-
onClick: t ? y :
|
|
56
|
+
disabled: E,
|
|
57
|
+
onClick: t ? y : I,
|
|
57
58
|
size: "sm",
|
|
58
59
|
title: `Next ${t ? "year" : "month"}`,
|
|
59
60
|
variant: "tertiary",
|
|
60
|
-
children: /* @__PURE__ */
|
|
61
|
+
children: /* @__PURE__ */ l(F, { name: "angle-right-b", size: "xs" })
|
|
61
62
|
}
|
|
62
63
|
)
|
|
63
64
|
] });
|
|
64
|
-
}
|
|
65
|
+
};
|
|
66
|
+
L.displayName = "DateTimePicker.CustomHeader";
|
|
67
|
+
const P = v(B), h = J(
|
|
65
68
|
({
|
|
66
69
|
autoFocus: x,
|
|
67
|
-
className:
|
|
70
|
+
className: N,
|
|
68
71
|
dateFormat: f = "dd/MM/yyyy",
|
|
69
|
-
disabled:
|
|
70
|
-
endYear:
|
|
71
|
-
icon:
|
|
72
|
-
iconPlacement:
|
|
72
|
+
disabled: T,
|
|
73
|
+
endYear: z = K.getFullYear(),
|
|
74
|
+
icon: c,
|
|
75
|
+
iconPlacement: I = "left",
|
|
73
76
|
locale: y,
|
|
74
77
|
onChange: t,
|
|
75
78
|
placeholder: D,
|
|
76
|
-
preventVirtualKeyboard:
|
|
77
|
-
showMonthYearPicker:
|
|
78
|
-
size:
|
|
79
|
-
startYear:
|
|
80
|
-
transparent:
|
|
81
|
-
useWeekdaysShort:
|
|
82
|
-
value: r =
|
|
83
|
-
...
|
|
84
|
-
},
|
|
85
|
-
const b =
|
|
86
|
-
|
|
87
|
-
t == null || t(
|
|
88
|
-
}, []),
|
|
89
|
-
var
|
|
90
|
-
const e =
|
|
91
|
-
((
|
|
79
|
+
preventVirtualKeyboard: a = !1,
|
|
80
|
+
showMonthYearPicker: p,
|
|
81
|
+
size: R = "md",
|
|
82
|
+
startYear: m = 1900,
|
|
83
|
+
transparent: w,
|
|
84
|
+
useWeekdaysShort: i = !0,
|
|
85
|
+
value: r = K,
|
|
86
|
+
...o
|
|
87
|
+
}, E) => {
|
|
88
|
+
const b = o == null ? void 0 : o.timeIntervals, u = (e) => Y(e, b), [H, d] = A(u(r)), O = Q(), k = E || O;
|
|
89
|
+
S(() => {
|
|
90
|
+
t == null || t(u(r));
|
|
91
|
+
}, []), S(() => {
|
|
92
|
+
var n;
|
|
93
|
+
const e = u(r), s = typeof r == "object" ? r == null ? void 0 : r.toISOString() : r;
|
|
94
|
+
((n = new Date(Date.parse(s))) == null ? void 0 : n.getTime()) - (e == null ? void 0 : e.getTime()) !== 0 && (t == null || t(e)), d(e);
|
|
92
95
|
}, [r]);
|
|
93
|
-
const
|
|
96
|
+
const U = (e) => {
|
|
94
97
|
var s;
|
|
95
|
-
["Enter", "Escape"].includes(e.key) && ((s =
|
|
96
|
-
}, U = (e) => {
|
|
97
|
-
var s;
|
|
98
|
-
e.preventDefault(), (s = S.current) == null || s.blur(), d(null), t == null || t(null);
|
|
98
|
+
["Enter", "Escape"].includes(e.key) && ((s = k.current) == null || s.blur());
|
|
99
99
|
}, _ = (e) => {
|
|
100
|
+
var s;
|
|
101
|
+
e.preventDefault(), (s = k.current) == null || s.blur(), d(null), t == null || t(null);
|
|
102
|
+
}, q = (e) => {
|
|
100
103
|
if (!e) {
|
|
101
104
|
d(null), t == null || t(null);
|
|
102
105
|
return;
|
|
@@ -106,60 +109,62 @@ const Y = v(B), g = ({
|
|
|
106
109
|
d(null), t == null || t(null);
|
|
107
110
|
return;
|
|
108
111
|
}
|
|
109
|
-
const
|
|
110
|
-
s.setHours(
|
|
112
|
+
const n = u(s);
|
|
113
|
+
s.setHours(n.getHours(), n.getMinutes()), d(s), t == null || t(new Date(s));
|
|
111
114
|
};
|
|
112
115
|
return (
|
|
113
116
|
// type issue in react-datepicker (https://github.com/Hacker0x01/react-datepicker/issues/5391)
|
|
114
117
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
115
118
|
// @ts-expect-error
|
|
116
|
-
/* @__PURE__ */
|
|
117
|
-
|
|
119
|
+
/* @__PURE__ */ l(
|
|
120
|
+
V,
|
|
118
121
|
{
|
|
119
122
|
autoComplete: "off",
|
|
120
123
|
calendarClassName: "date-picker-popper",
|
|
121
|
-
customInput: /* @__PURE__ */
|
|
122
|
-
|
|
124
|
+
customInput: /* @__PURE__ */ l(
|
|
125
|
+
g,
|
|
123
126
|
{
|
|
124
127
|
autoFocus: x,
|
|
125
|
-
className:
|
|
126
|
-
"data-testid":
|
|
127
|
-
disabled:
|
|
128
|
-
icon:
|
|
129
|
-
iconPlacement:
|
|
130
|
-
inputMode:
|
|
128
|
+
className: P("date-picker", N),
|
|
129
|
+
"data-testid": o["data-testid"],
|
|
130
|
+
disabled: T,
|
|
131
|
+
icon: c,
|
|
132
|
+
iconPlacement: I,
|
|
133
|
+
inputMode: a ? "none" : "text",
|
|
131
134
|
isClearable: !0,
|
|
132
|
-
onReset:
|
|
135
|
+
onReset: _,
|
|
133
136
|
placeholder: D,
|
|
134
|
-
ref:
|
|
135
|
-
size:
|
|
136
|
-
transparent:
|
|
137
|
+
ref: k,
|
|
138
|
+
size: R,
|
|
139
|
+
transparent: w
|
|
137
140
|
}
|
|
138
141
|
),
|
|
139
142
|
dateFormat: f,
|
|
140
143
|
locale: y,
|
|
141
|
-
onChange:
|
|
142
|
-
onKeyDown:
|
|
143
|
-
popperContainer:
|
|
144
|
-
renderCustomHeader: (e) => /* @__PURE__ */
|
|
145
|
-
|
|
144
|
+
onChange: q,
|
|
145
|
+
onKeyDown: U,
|
|
146
|
+
popperContainer: W,
|
|
147
|
+
renderCustomHeader: (e) => /* @__PURE__ */ l(
|
|
148
|
+
L,
|
|
146
149
|
{
|
|
147
|
-
endYear:
|
|
148
|
-
isMonthYearPicker:
|
|
150
|
+
endYear: z,
|
|
151
|
+
isMonthYearPicker: p,
|
|
149
152
|
locale: y,
|
|
150
|
-
startYear:
|
|
153
|
+
startYear: m,
|
|
151
154
|
...e
|
|
152
155
|
}
|
|
153
156
|
),
|
|
154
157
|
selected: H,
|
|
155
|
-
showMonthYearPicker:
|
|
156
|
-
useWeekdaysShort:
|
|
157
|
-
...
|
|
158
|
+
showMonthYearPicker: p,
|
|
159
|
+
useWeekdaysShort: i,
|
|
160
|
+
...o,
|
|
161
|
+
wrapperClassName: P(o.wrapperClassName, "date-picker-wrapper", "field-input")
|
|
158
162
|
}
|
|
159
163
|
)
|
|
160
164
|
);
|
|
161
165
|
}
|
|
162
166
|
);
|
|
167
|
+
h.displayName = "DatePicker";
|
|
163
168
|
export {
|
|
164
|
-
|
|
169
|
+
h as DatePicker
|
|
165
170
|
};
|
package/dist/DateTimePicker.js
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as A } from "react/jsx-runtime";
|
|
3
|
-
import { forwardRef as E, useState as
|
|
4
|
-
import { b as
|
|
5
|
-
import { c as F } from "./index-
|
|
6
|
-
const L = F(j),
|
|
3
|
+
import { forwardRef as E, useState as P, useRef as x, useEffect as a, Children as N, cloneElement as H } from "react";
|
|
4
|
+
import { b as I, D as b, s as j } from "./utils-BD597oo6.js";
|
|
5
|
+
import { c as F } from "./index-PAaZGbyz.js";
|
|
6
|
+
const L = F(j), M = E(
|
|
7
7
|
({
|
|
8
|
-
children:
|
|
8
|
+
children: o,
|
|
9
9
|
disabled: d,
|
|
10
10
|
locale: p,
|
|
11
11
|
onChange: s,
|
|
12
12
|
size: D = "md",
|
|
13
13
|
transparent: n,
|
|
14
|
-
value:
|
|
14
|
+
value: i = b,
|
|
15
15
|
...l
|
|
16
16
|
}, k) => {
|
|
17
|
-
const u = l == null ? void 0 : l.timeIntervals,
|
|
17
|
+
const u = l == null ? void 0 : l.timeIntervals, r = (t) => I(t, u), [T, c] = P(r(i)), y = x(), R = k || y, m = (t) => {
|
|
18
18
|
if (!t) {
|
|
19
|
-
|
|
19
|
+
c(null), s == null || s(null);
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
22
|
const e = Array.isArray(t) ? t[0] : t;
|
|
23
23
|
if (!e) {
|
|
24
|
-
|
|
24
|
+
c(null), s == null || s(null);
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
|
-
const f =
|
|
28
|
-
e.setHours(f.getHours(), f.getMinutes()),
|
|
27
|
+
const f = r(e);
|
|
28
|
+
e.setHours(f.getHours(), f.getMinutes()), c(e), s == null || s(new Date(e));
|
|
29
29
|
};
|
|
30
|
-
return
|
|
31
|
-
m(
|
|
32
|
-
}, []),
|
|
30
|
+
return a(() => {
|
|
31
|
+
m(r(i));
|
|
32
|
+
}, []), a(() => {
|
|
33
33
|
var e;
|
|
34
|
-
const t =
|
|
35
|
-
((e = new Date(
|
|
36
|
-
}, [
|
|
34
|
+
const t = r(i);
|
|
35
|
+
((e = new Date(i)) == null ? void 0 : e.getTime()) - (t == null ? void 0 : t.getTime()) !== 0 && m(t), c(t);
|
|
36
|
+
}, [i]), /* @__PURE__ */ A("div", { className: L("date-time-picker", "field-input"), children: N.map(o, (t, e) => H(t, {
|
|
37
37
|
disabled: d,
|
|
38
|
-
inputRef: e === 0 ?
|
|
38
|
+
inputRef: e === 0 ? R : null,
|
|
39
39
|
// give ref only to the DatePicker
|
|
40
40
|
key: e,
|
|
41
41
|
locale: p,
|
|
@@ -43,10 +43,11 @@ const L = F(j), q = E(
|
|
|
43
43
|
size: D,
|
|
44
44
|
timeIntervals: u,
|
|
45
45
|
transparent: n,
|
|
46
|
-
value:
|
|
46
|
+
value: T
|
|
47
47
|
})) });
|
|
48
48
|
}
|
|
49
49
|
);
|
|
50
|
+
M.displayName = "DateTimePicker";
|
|
50
51
|
export {
|
|
51
|
-
|
|
52
|
+
M as DateTimePicker
|
|
52
53
|
};
|
package/dist/Drawer.js
CHANGED
|
@@ -1,92 +1,101 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
2
|
+
import './Drawer.css';
|
|
3
|
+
import { jsx as e, jsxs as h, Fragment as P } from "react/jsx-runtime";
|
|
4
|
+
import { D as S } from "./NI3IVY7K-Dy240mkD.js";
|
|
5
|
+
import { u as Ne } from "./NI3IVY7K-Dy240mkD.js";
|
|
6
|
+
import { useCallback as f, forwardRef as u } from "react";
|
|
7
|
+
import { c as o } from "./index-PAaZGbyz.js";
|
|
8
|
+
import { f as z } from "./forwardRefWithAs-8eP3ZN15.js";
|
|
9
|
+
import { Button as q } from "./Button.js";
|
|
10
|
+
import { Icon as A } from "./Icon.js";
|
|
11
|
+
import { Text as C } from "./Text.js";
|
|
12
|
+
import { D as H } from "./DSAASPLT-Fx1kuAsk.js";
|
|
13
|
+
import { CloseButton as M } from "./CloseButton.js";
|
|
14
|
+
import { D as R } from "./ZTXFEM5L-WGHY_jqg.js";
|
|
15
|
+
const J = "_content_1mhgf_13", K = "_title_1mhgf_67", b = {
|
|
15
16
|
"asset-drawer": "_asset-drawer_1mhgf_3",
|
|
16
17
|
"content-wrapper": "_content-wrapper_1mhgf_13",
|
|
17
18
|
"content-max-width": "_content-max-width_1mhgf_24",
|
|
18
|
-
content:
|
|
19
|
+
content: J,
|
|
19
20
|
"asset-drawer-header": "_asset-drawer-header_1mhgf_39",
|
|
20
21
|
"back-button": "_back-button_1mhgf_57",
|
|
21
|
-
title:
|
|
22
|
+
title: K,
|
|
22
23
|
"icon-block": "_icon-block_1mhgf_72",
|
|
23
24
|
"size-md": "_size-md_1mhgf_84",
|
|
24
25
|
"size-sm": "_size-sm_1mhgf_87"
|
|
25
|
-
},
|
|
26
|
+
}, _ = o(b), T = z(
|
|
26
27
|
({
|
|
27
28
|
children: t,
|
|
28
29
|
className: s,
|
|
29
30
|
getPersistentElements: r,
|
|
30
|
-
|
|
31
|
+
hideOnInteractOutside: a = !0,
|
|
32
|
+
maxWidth: n,
|
|
31
33
|
store: c,
|
|
32
|
-
...
|
|
33
|
-
},
|
|
34
|
-
const l =
|
|
34
|
+
...k
|
|
35
|
+
}, d) => {
|
|
36
|
+
const l = f(
|
|
35
37
|
() => Array.from(
|
|
36
38
|
r ? r() : document.querySelectorAll("[data-wui-persistent]")
|
|
37
39
|
),
|
|
38
40
|
[r]
|
|
39
|
-
),
|
|
40
|
-
(
|
|
41
|
-
|
|
41
|
+
), g = f(
|
|
42
|
+
(m) => {
|
|
43
|
+
if (!a) return !1;
|
|
44
|
+
const N = m.target;
|
|
42
45
|
return !l().some(
|
|
43
|
-
(
|
|
46
|
+
(D) => D.contains(N)
|
|
44
47
|
);
|
|
45
48
|
},
|
|
46
|
-
[l]
|
|
47
|
-
),
|
|
49
|
+
[l, a]
|
|
50
|
+
), w = typeof n == "number" ? `${n}px` : n;
|
|
48
51
|
return /* @__PURE__ */ e(
|
|
49
|
-
|
|
52
|
+
ae,
|
|
50
53
|
{
|
|
51
54
|
autoFocusOnShow: !1,
|
|
52
|
-
className:
|
|
55
|
+
className: _("asset-drawer", s),
|
|
53
56
|
getPersistentElements: l,
|
|
54
|
-
hideOnInteractOutside:
|
|
57
|
+
hideOnInteractOutside: g,
|
|
55
58
|
placement: "bottom",
|
|
56
|
-
ref:
|
|
59
|
+
ref: d,
|
|
57
60
|
store: c,
|
|
58
61
|
withBackdrop: !0,
|
|
59
|
-
...
|
|
60
|
-
children: /* @__PURE__ */ e("div", { className:
|
|
62
|
+
...k,
|
|
63
|
+
children: /* @__PURE__ */ e("div", { className: _("content-wrapper"), children: /* @__PURE__ */ e(
|
|
61
64
|
"div",
|
|
62
65
|
{
|
|
63
|
-
className:
|
|
64
|
-
style: { "--assetDrawerContentMaxWidth":
|
|
65
|
-
children: /* @__PURE__ */ e("div", { className:
|
|
66
|
+
className: _("content-max-width"),
|
|
67
|
+
style: { "--assetDrawerContentMaxWidth": w },
|
|
68
|
+
children: /* @__PURE__ */ e("div", { className: _("content"), children: t })
|
|
66
69
|
}
|
|
67
70
|
) })
|
|
68
71
|
}
|
|
69
72
|
);
|
|
70
73
|
}
|
|
71
|
-
)
|
|
74
|
+
);
|
|
75
|
+
T.displayName = "AssetDrawer";
|
|
76
|
+
const L = o(b), F = ({ iconName: t, size: s = "md" }) => /* @__PURE__ */ e("div", { className: L("icon-block", `size-${s}`), children: /* @__PURE__ */ e(A, { className: "text-neutral-90", name: t, size: s }) });
|
|
77
|
+
F.displayName = "AssetDrawer.IconBlock";
|
|
78
|
+
const p = o(b), O = ({
|
|
72
79
|
action: t,
|
|
73
80
|
className: s,
|
|
74
81
|
iconName: r,
|
|
75
|
-
onBackButtonClick:
|
|
76
|
-
subtitle:
|
|
77
|
-
title:
|
|
78
|
-
}) => /* @__PURE__ */ h("div", { className:
|
|
79
|
-
/* @__PURE__ */ h("div", { className:
|
|
80
|
-
!!
|
|
81
|
-
!!r && /* @__PURE__ */ e(
|
|
82
|
-
/* @__PURE__ */ h("div", { className:
|
|
83
|
-
/* @__PURE__ */ e(
|
|
84
|
-
|
|
82
|
+
onBackButtonClick: a,
|
|
83
|
+
subtitle: n,
|
|
84
|
+
title: c
|
|
85
|
+
}) => /* @__PURE__ */ h("div", { className: p("asset-drawer-header", s), children: [
|
|
86
|
+
/* @__PURE__ */ h("div", { className: p("back-button"), children: [
|
|
87
|
+
!!a && /* @__PURE__ */ e(q, { onClick: a, variant: "tertiary", children: /* @__PURE__ */ e(A, { name: "arrow-left" }) }),
|
|
88
|
+
!!r && /* @__PURE__ */ e(F, { iconName: r }),
|
|
89
|
+
/* @__PURE__ */ h("div", { className: p("title"), children: [
|
|
90
|
+
/* @__PURE__ */ e(C, { as: "h3", className: "pr-xl", variant: "heading-lg", children: c }),
|
|
91
|
+
n
|
|
85
92
|
] })
|
|
86
93
|
] }),
|
|
87
|
-
t ? /* @__PURE__ */ e("div", { className:
|
|
88
|
-
] })
|
|
89
|
-
|
|
94
|
+
t ? /* @__PURE__ */ e("div", { className: p("actions"), children: t }) : null
|
|
95
|
+
] });
|
|
96
|
+
O.displayName = "AssetDrawer.Header";
|
|
97
|
+
const Q = "_root_iksk1_3", U = "_backdrop_iksk1_68", V = "_content_iksk1_85", X = "_footer_iksk1_94", Y = "_title_iksk1_108", i = {
|
|
98
|
+
root: Q,
|
|
90
99
|
"placement-bottom": "_placement-bottom_iksk1_30",
|
|
91
100
|
"placement-left": "_placement-left_iksk1_34",
|
|
92
101
|
"placement-right": "_placement-right_iksk1_38",
|
|
@@ -94,62 +103,98 @@ const I = "_content_1mhgf_13", W = "_title_1mhgf_67", u = {
|
|
|
94
103
|
"size-sm": "_size-sm_iksk1_46",
|
|
95
104
|
"size-md": "_size-md_iksk1_49",
|
|
96
105
|
"size-lg": "_size-lg_iksk1_52",
|
|
97
|
-
backdrop:
|
|
106
|
+
backdrop: U,
|
|
98
107
|
"drawer-hide-on-interact-outside": "_drawer-hide-on-interact-outside_iksk1_79",
|
|
99
|
-
content:
|
|
100
|
-
footer:
|
|
101
|
-
title:
|
|
108
|
+
content: V,
|
|
109
|
+
footer: X,
|
|
110
|
+
title: Y,
|
|
102
111
|
"drawer-close": "_drawer-close_iksk1_120"
|
|
103
|
-
},
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
112
|
+
}, Z = o(i), x = u(
|
|
113
|
+
({ hideOnInteractOutside: t = !0, ...s }, r) => /* @__PURE__ */ e(
|
|
114
|
+
"div",
|
|
115
|
+
{
|
|
116
|
+
className: Z("backdrop", t && "drawer-hide-on-interact-outside"),
|
|
117
|
+
ref: r,
|
|
118
|
+
...s
|
|
119
|
+
}
|
|
120
|
+
)
|
|
121
|
+
);
|
|
122
|
+
x.displayName = "Drawer.Backdrop";
|
|
123
|
+
const G = o(i), y = ({ className: t }) => /* @__PURE__ */ e(
|
|
124
|
+
H,
|
|
111
125
|
{
|
|
112
|
-
render: (s) => /* @__PURE__ */ e(
|
|
126
|
+
render: (s) => /* @__PURE__ */ e(M, { className: G("drawer-close", t), ...s })
|
|
113
127
|
}
|
|
114
|
-
)
|
|
115
|
-
|
|
116
|
-
),
|
|
128
|
+
);
|
|
129
|
+
y.displayName = "Drawer.Close";
|
|
130
|
+
const ee = o(i), W = u(({ className: t, ...s }, r) => /* @__PURE__ */ e("div", { className: ee("content", t), ref: r, ...s }));
|
|
131
|
+
W.displayName = "Drawer.Content";
|
|
132
|
+
const te = o(i), j = u(({ className: t, ...s }, r) => /* @__PURE__ */ e("div", { className: te("footer", t), ref: r, ...s }));
|
|
133
|
+
j.displayName = "Drawer.Footer";
|
|
134
|
+
const se = o(i), B = ({ children: t, className: s, ...r }) => /* @__PURE__ */ e("div", { className: se("title", s), ...r, children: /* @__PURE__ */ e(C, { as: "h3", className: "w-full", variant: "heading-lg", children: t }) });
|
|
135
|
+
B.displayName = "Drawer.Title";
|
|
136
|
+
const v = z(
|
|
137
|
+
({ as: t, store: s, ...r }, a) => /* @__PURE__ */ e(R, { ref: a, render: t ? /* @__PURE__ */ e(t, {}) : void 0, store: s, ...r })
|
|
138
|
+
);
|
|
139
|
+
v.displayName = "Drawer.Trigger";
|
|
140
|
+
const re = o(i), E = u(
|
|
117
141
|
({
|
|
118
142
|
children: t,
|
|
119
143
|
className: s,
|
|
120
|
-
|
|
121
|
-
|
|
144
|
+
getPersistentElements: r,
|
|
145
|
+
hideOnInteractOutside: a = !0,
|
|
146
|
+
placement: n = "right",
|
|
122
147
|
size: c = "lg",
|
|
123
|
-
store:
|
|
124
|
-
withBackdrop:
|
|
148
|
+
store: k,
|
|
149
|
+
withBackdrop: d = !1,
|
|
125
150
|
withCloseButton: l = !0,
|
|
126
|
-
...
|
|
127
|
-
},
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
+
...g
|
|
152
|
+
}, w) => {
|
|
153
|
+
const m = f(
|
|
154
|
+
() => Array.from(
|
|
155
|
+
r ? r() : document.querySelectorAll("[data-wui-persistent]")
|
|
156
|
+
),
|
|
157
|
+
[r]
|
|
158
|
+
), N = f(
|
|
159
|
+
($) => {
|
|
160
|
+
if (!a) return !1;
|
|
161
|
+
const D = $.target;
|
|
162
|
+
return !m().some(
|
|
163
|
+
(I) => I.contains(D)
|
|
164
|
+
);
|
|
165
|
+
},
|
|
166
|
+
[m, a]
|
|
167
|
+
);
|
|
168
|
+
return /* @__PURE__ */ e(
|
|
169
|
+
S,
|
|
170
|
+
{
|
|
171
|
+
backdrop: d ? /* @__PURE__ */ e(x, { hideOnInteractOutside: a }) : !1,
|
|
172
|
+
getPersistentElements: m,
|
|
173
|
+
hideOnInteractOutside: N,
|
|
174
|
+
modal: d,
|
|
175
|
+
ref: w,
|
|
176
|
+
render: /* @__PURE__ */ e("div", { className: re("root", `placement-${n}`, `size-${c}`, s) }),
|
|
177
|
+
store: k,
|
|
178
|
+
...g,
|
|
179
|
+
children: /* @__PURE__ */ h(P, { children: [
|
|
180
|
+
l ? /* @__PURE__ */ e(y, {}) : null,
|
|
181
|
+
t
|
|
182
|
+
] })
|
|
183
|
+
}
|
|
184
|
+
);
|
|
185
|
+
}
|
|
186
|
+
);
|
|
187
|
+
E.displayName = "Drawer";
|
|
188
|
+
const ae = Object.assign(E, {
|
|
189
|
+
Backdrop: x,
|
|
190
|
+
Close: y,
|
|
191
|
+
Content: W,
|
|
192
|
+
Footer: j,
|
|
193
|
+
Title: B,
|
|
194
|
+
Trigger: v
|
|
195
|
+
}), ke = Object.assign(T, { Header: O, Trigger: v });
|
|
151
196
|
export {
|
|
152
197
|
ke as AssetDrawer,
|
|
153
|
-
|
|
154
|
-
|
|
198
|
+
ae as Drawer,
|
|
199
|
+
Ne as useDrawer
|
|
155
200
|
};
|