welcome-ui 10.0.0-alpha.10 → 10.0.0-alpha.12
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/Alert.css +1 -1
- package/dist/Alert.js +62 -62
- package/dist/Checkbox.js +12 -11
- package/dist/DatePicker.js +69 -68
- package/dist/DateTimePicker.js +10 -10
- package/dist/Field.css +1 -1
- package/dist/Field.js +48 -49
- package/dist/FileDrop.js +7 -1
- package/dist/Icon.js +212 -211
- package/dist/InputText.js +6 -6
- package/dist/Modal.js +65 -56
- package/dist/Search.js +1 -1
- package/dist/Select.js +350 -332
- package/dist/Slider.js +1 -1
- package/dist/Swiper.js +201 -191
- package/dist/Tabs.css +1 -1
- package/dist/Tabs.js +320 -319
- package/dist/Textarea.js +14 -13
- package/dist/TimePicker.js +46 -45
- package/dist/Toggle.js +11 -11
- package/dist/types/components/Icon/icons.d.ts +2 -2
- package/dist/types/components/Modal/Assets/AssetContent.d.ts +1 -1
- package/dist/types/components/Modal/Assets/index.d.ts +1 -1
- package/dist/types/components/Modal/components/Content.d.ts +1 -1
- package/dist/types/components/Modal/index.d.ts +2 -2
- package/dist/types/components/Modal/types.d.ts +1 -1
- package/dist/types/components/Select/types.d.ts +1 -0
- package/dist/types/components/Tabs/Tab.d.ts +2 -0
- package/dist/types/components/Tabs/{components/TabPanel/index.d.ts → TabPanel.d.ts} +1 -1
- package/dist/types/components/Tabs/index.d.ts +6 -5
- package/dist/types/components/Tabs/types.d.ts +6 -12
- package/dist/types/components/Tabs/utils.d.ts +4 -7
- package/package.json +1 -1
- package/dist/types/components/Tabs/components/ActiveBar/index.d.ts +0 -5
- package/dist/types/components/Tabs/components/TabList/index.d.ts +0 -3
- package/dist/use-viewport-CgrficYB.js +0 -17
- package/dist/useForkRef-D807AV7D.js +0 -22
package/dist/Alert.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer components{.
|
|
1
|
+
@layer components{._root_8fyu4_2{position:relative;display:flex;align-items:flex-start;width:100%;gap:var(--gap, var(--components-dimensions-alert-gap-content-md));border-radius:var(--components-dimensions-alert-border-radius);border-width:var(--border-width-sm);border-style:solid;padding:var(--padding);max-width:var(--maxWidth, max-content);background-color:var(--backgroundColor, var(--components-colors-alert-color-background-brand));border-color:var(--borderColor, var(--components-colors-alert-color-background-brand));color:var(--color, var(--components-colors-alert-color-text-brand-body))}._size-md_8fyu4_18{--padding: var(--components-dimensions-alert-padding-inline-md)}._size-md_8fyu4_18 ._content-actions_8fyu4_21{--gap: var(--components-dimensions-alert-gap-actions-md)}._size-md_8fyu4_18 ._without-title_8fyu4_24 ._icon-wrapper_8fyu4_24{margin-top:-2px}._size-lg_8fyu4_27{--padding: var(--components-dimensions-alert-padding-inline-lg);--gap: var(--components-dimensions-alert-gap-content-lg)}._size-lg_8fyu4_27 ._content-actions_8fyu4_21{--gap: var(--components-dimensions-alert-gap-actions-lg)}._variant-ai_8fyu4_34{--backgroundColor: var(--components-colors-alert-color-background-ai);--borderColor: transparent;background:linear-gradient(var(--components-colors-alert-color-background-ai) 0 0) padding-box,linear-gradient(90deg,var(--color-green-30) 0%,var(--color-teal-40) 20%,var(--color-blue-40) 40%,var(--color-violet-40) 60%,var(--color-pink-40) 80%,var(--color-red-orange-40) 100%) border-box}._variant-danger_8fyu4_39{--backgroundColor: var(--components-colors-alert-color-background-danger);--borderColor: var(--components-colors-alert-color-background-danger);--color: var(--color-icon-danger-primary)}._variant-info_8fyu4_44{--backgroundColor: var(--components-colors-alert-color-background-information);--borderColor: var(--components-colors-alert-color-background-information);--color: var(--color-icon-accent-blue-primary)}._variant-success_8fyu4_49{--backgroundColor: var(--components-colors-alert-color-background-success);--borderColor: var(--components-colors-alert-color-background-success);--color: var(--color-icon-accent-green-primary)}._variant-warning_8fyu4_54{--backgroundColor: var(--components-colors-alert-color-background-warning);--borderColor: var(--components-colors-alert-color-background-warning);--color: var(--color-icon-warning-primary)}._full-width_8fyu4_59{--maxWidth: 100%}._content_8fyu4_21{overflow:hidden;display:flex;flex-direction:column;justify-content:space-between;align-items:flex-start;gap:var(--gap, var(--components-dimensions-alert-gap-content-md))}._content-text_8fyu4_71{display:flex;flex-direction:column;gap:var(--gap, var(--components-dimensions-alert-gap-content-md))}._content-text_8fyu4_71._without-title_8fyu4_24{flex-direction:row}._content-text_8fyu4_71._without-title_8fyu4_24 ._icon-wrapper_8fyu4_24{align-self:flex-start}._content-actions_8fyu4_21{display:flex;align-items:center;gap:var(--gap)}._title-close-button_8fyu4_88{margin-right:var(--spacing-xl)}._title-with-icon_8fyu4_91{display:flex;align-items:center;gap:var(--spacing-sm)}._close-button_8fyu4_97{position:absolute;right:var(--spacing-sm);top:var(--spacing-sm)}._icon-wrapper_8fyu4_24{display:flex;flex-shrink:0;padding:var(--components-dimensions-alert-icon-padding-block);border-radius:var(--components-dimensions-alert-icon-border-radius);background-color:var(--iconWrapperBackgroundColor, var(--components-colors-alert-icon-color-background-brand));color:var(--iconWrapperColor, var(--components-colors-alert-icon-color-icon-brand))}._icon-wrapper-success_8fyu4_111{--iconWrapperBackgroundColor: var(--components-colors-alert-icon-color-background-success);--iconWrapperColor: var(--components-colors-alert-icon-color-icon-success)}._icon-wrapper-danger_8fyu4_115{--iconWrapperBackgroundColor: var(--components-colors-alert-icon-color-background-danger);--iconWrapperColor: var(--components-colors-alert-icon-color-icon-danger)}._icon-wrapper-info_8fyu4_119{--iconWrapperBackgroundColor: var( --components-colors-alert-icon-color-background-information );--iconWrapperColor: var(--components-colors-alert-icon-color-icon-information)}._icon-wrapper-warning_8fyu4_125{--iconWrapperBackgroundColor: var(--components-colors-alert-icon-color-background-warning);--iconWrapperColor: var(--components-colors-alert-icon-color-icon-warning)}._icon-wrapper-ai_8fyu4_129{background:conic-gradient(from 30deg at 50% 50%,var(--color-green-30) 0deg,var(--color-blue-40) 25.96deg,var(--color-violet-40) 51.92deg,var(--color-pink-40) 76.15deg,var(--color-red-orange-40) 110.77deg,var(--color-pink-40) 162.69deg,var(--color-violet-40) 209.42deg,var(--color-blue-40) 254.42deg,var(--color-teal-40) 306.35deg,var(--color-green-30) 360deg);--iconWrapperColor: var(--components-colors-alert-icon-color-icon-ai)}}
|
package/dist/Alert.js
CHANGED
|
@@ -1,105 +1,105 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import './Alert.css';
|
|
3
|
-
import { jsx as i, jsxs as
|
|
4
|
-
import p, { forwardRef as
|
|
3
|
+
import { jsx as i, jsxs as l } from "react/jsx-runtime";
|
|
4
|
+
import p, { forwardRef as y, Children as f, cloneElement as m } from "react";
|
|
5
5
|
import { CloseButton as E } from "./CloseButton.js";
|
|
6
6
|
import { Icon as V } from "./Icon.js";
|
|
7
|
-
import { Text as
|
|
8
|
-
import { c as
|
|
9
|
-
import { Button as
|
|
10
|
-
const I = "
|
|
7
|
+
import { Text as b } from "./Text.js";
|
|
8
|
+
import { c as x } from "./index-PAaZGbyz.js";
|
|
9
|
+
import { Button as h } from "./Button.js";
|
|
10
|
+
const I = "_root_8fyu4_2", O = "_content_8fyu4_21", B = {
|
|
11
11
|
root: I,
|
|
12
|
-
"size-md": "_size-
|
|
13
|
-
"content-actions": "_content-
|
|
14
|
-
"without-title": "_without-
|
|
15
|
-
"icon-wrapper": "_icon-
|
|
16
|
-
"size-lg": "_size-
|
|
17
|
-
"variant-ai": "_variant-
|
|
18
|
-
"variant-danger": "_variant-
|
|
19
|
-
"variant-info": "_variant-
|
|
20
|
-
"variant-success": "_variant-
|
|
21
|
-
"variant-warning": "_variant-
|
|
22
|
-
"full-width": "_full-
|
|
12
|
+
"size-md": "_size-md_8fyu4_18",
|
|
13
|
+
"content-actions": "_content-actions_8fyu4_21",
|
|
14
|
+
"without-title": "_without-title_8fyu4_24",
|
|
15
|
+
"icon-wrapper": "_icon-wrapper_8fyu4_24",
|
|
16
|
+
"size-lg": "_size-lg_8fyu4_27",
|
|
17
|
+
"variant-ai": "_variant-ai_8fyu4_34",
|
|
18
|
+
"variant-danger": "_variant-danger_8fyu4_39",
|
|
19
|
+
"variant-info": "_variant-info_8fyu4_44",
|
|
20
|
+
"variant-success": "_variant-success_8fyu4_49",
|
|
21
|
+
"variant-warning": "_variant-warning_8fyu4_54",
|
|
22
|
+
"full-width": "_full-width_8fyu4_59",
|
|
23
23
|
content: O,
|
|
24
|
-
"content-text": "_content-
|
|
25
|
-
"title-close-button": "_title-close-
|
|
26
|
-
"title-with-icon": "_title-with-
|
|
27
|
-
"close-button": "_close-
|
|
28
|
-
"icon-wrapper-success": "_icon-wrapper-
|
|
29
|
-
"icon-wrapper-danger": "_icon-wrapper-
|
|
30
|
-
"icon-wrapper-info": "_icon-wrapper-
|
|
31
|
-
"icon-wrapper-warning": "_icon-wrapper-
|
|
32
|
-
"icon-wrapper-ai": "_icon-wrapper-
|
|
33
|
-
},
|
|
34
|
-
({ variant: t = "primary", ...o }, n) => /* @__PURE__ */ i(
|
|
24
|
+
"content-text": "_content-text_8fyu4_71",
|
|
25
|
+
"title-close-button": "_title-close-button_8fyu4_88",
|
|
26
|
+
"title-with-icon": "_title-with-icon_8fyu4_91",
|
|
27
|
+
"close-button": "_close-button_8fyu4_97",
|
|
28
|
+
"icon-wrapper-success": "_icon-wrapper-success_8fyu4_111",
|
|
29
|
+
"icon-wrapper-danger": "_icon-wrapper-danger_8fyu4_115",
|
|
30
|
+
"icon-wrapper-info": "_icon-wrapper-info_8fyu4_119",
|
|
31
|
+
"icon-wrapper-warning": "_icon-wrapper-warning_8fyu4_125",
|
|
32
|
+
"icon-wrapper-ai": "_icon-wrapper-ai_8fyu4_129"
|
|
33
|
+
}, w = y(
|
|
34
|
+
({ variant: t = "primary", ...o }, n) => /* @__PURE__ */ i(h, { className: "shrink-0 w-fit", ref: n, variant: t, ...o })
|
|
35
35
|
);
|
|
36
|
-
|
|
37
|
-
const
|
|
38
|
-
({ variant: t = "secondary", ...o }, n) => /* @__PURE__ */ i(
|
|
36
|
+
w.displayName = "Alert.Button";
|
|
37
|
+
const d = y(
|
|
38
|
+
({ variant: t = "secondary", ...o }, n) => /* @__PURE__ */ i(h, { className: "shrink-0 w-fit", ref: n, variant: t, ...o })
|
|
39
39
|
);
|
|
40
|
-
|
|
41
|
-
const R =
|
|
42
|
-
|
|
43
|
-
const a =
|
|
40
|
+
d.displayName = "Alert.SecondaryButton";
|
|
41
|
+
const R = x(B), _ = ({ children: t, hasCloseButton: o, ...n }) => /* @__PURE__ */ i(b, { as: "span", className: R(o && "title-close-button"), ...n, children: t });
|
|
42
|
+
_.displayName = "Alert.Title";
|
|
43
|
+
const a = x(B), z = {
|
|
44
44
|
ai: "sparkles",
|
|
45
45
|
brand: "lightbulb-alt",
|
|
46
46
|
danger: "exclamation-octagon",
|
|
47
47
|
info: "info-circle",
|
|
48
48
|
success: "check-circle",
|
|
49
49
|
warning: "exclamation-triangle"
|
|
50
|
-
},
|
|
51
|
-
({ children: t, className: o, cta: n, handleClose:
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
hasCloseButton: !!
|
|
50
|
+
}, $ = y(
|
|
51
|
+
({ children: t, className: o, cta: n, handleClose: u, isFullWidth: k, size: c = "md", variant: s = "brand", ...T }, C) => {
|
|
52
|
+
const S = s === "ai", g = f.toArray(t).some((e) => p.isValidElement(e) ? e.type === _ : !1), v = /* @__PURE__ */ i("div", { className: a("icon-wrapper", `icon-wrapper-${s}`), children: /* @__PURE__ */ i(V, { name: z[s] }) }), j = f.toArray(t).map((e) => e.type === _ ? /* @__PURE__ */ l("div", { className: a("title-with-icon"), children: [
|
|
53
|
+
v,
|
|
54
|
+
m(e, {
|
|
55
|
+
hasCloseButton: !!u,
|
|
56
56
|
variant: `body-${c}-strong`
|
|
57
57
|
})
|
|
58
|
-
] }) : e),
|
|
58
|
+
] }) : e), N = (e) => f.toArray(e).flatMap((r) => p.isValidElement(r) && r.type === p.Fragment ? N(r.props.children) : r.type === w ? m(r, {
|
|
59
59
|
size: c,
|
|
60
|
-
variant:
|
|
61
|
-
}) : r.type ===
|
|
60
|
+
variant: S ? "primary-ai" : void 0
|
|
61
|
+
}) : r.type === d ? m(r, {
|
|
62
62
|
size: c
|
|
63
|
-
}) : r),
|
|
64
|
-
return /* @__PURE__ */
|
|
63
|
+
}) : r), A = !!n && N(n);
|
|
64
|
+
return /* @__PURE__ */ l(
|
|
65
65
|
"div",
|
|
66
66
|
{
|
|
67
67
|
className: a(
|
|
68
68
|
"root",
|
|
69
|
-
|
|
69
|
+
k && "full-width",
|
|
70
70
|
`size-${c}`,
|
|
71
71
|
s && `variant-${s}`,
|
|
72
72
|
o
|
|
73
73
|
),
|
|
74
|
-
ref:
|
|
75
|
-
...
|
|
74
|
+
ref: C,
|
|
75
|
+
...T,
|
|
76
76
|
children: [
|
|
77
|
-
!!
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
-
/* @__PURE__ */
|
|
80
|
-
|
|
77
|
+
!!u && /* @__PURE__ */ i(E, { className: a("close-button"), onClick: u }),
|
|
78
|
+
/* @__PURE__ */ l("div", { className: a("content"), children: [
|
|
79
|
+
/* @__PURE__ */ l(
|
|
80
|
+
b,
|
|
81
81
|
{
|
|
82
82
|
as: "div",
|
|
83
|
-
className: a("content-text", !
|
|
83
|
+
className: a("content-text", !g && "without-title"),
|
|
84
84
|
variant: `body-${c}`,
|
|
85
85
|
children: [
|
|
86
|
-
!
|
|
87
|
-
|
|
86
|
+
!g && v,
|
|
87
|
+
j
|
|
88
88
|
]
|
|
89
89
|
}
|
|
90
90
|
),
|
|
91
|
-
!!
|
|
91
|
+
!!A && /* @__PURE__ */ i("div", { className: a("content-actions"), children: A })
|
|
92
92
|
] })
|
|
93
93
|
]
|
|
94
94
|
}
|
|
95
95
|
);
|
|
96
96
|
}
|
|
97
97
|
);
|
|
98
|
-
|
|
99
|
-
const K = Object.assign(
|
|
100
|
-
Button:
|
|
101
|
-
SecondaryButton:
|
|
102
|
-
Title:
|
|
98
|
+
$.displayName = "Alert";
|
|
99
|
+
const K = Object.assign($, {
|
|
100
|
+
Button: w,
|
|
101
|
+
SecondaryButton: d,
|
|
102
|
+
Title: _
|
|
103
103
|
});
|
|
104
104
|
export {
|
|
105
105
|
K as Alert,
|
package/dist/Checkbox.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import './Checkbox.css';
|
|
3
|
-
import { jsxs as b, jsx as
|
|
3
|
+
import { jsxs as b, jsx as i } from "react/jsx-runtime";
|
|
4
4
|
import { a as x } from "./KPUWHTQJ-Dv3cAqjP.js";
|
|
5
5
|
import { forwardRef as C, useState as l } from "react";
|
|
6
6
|
import { useField as g } from "./Field.js";
|
|
@@ -14,9 +14,9 @@ const y = "_root_luk8p_2", F = "_indeterminate_luk8p_67", I = {
|
|
|
14
14
|
"variant-success": "_variant-success_luk8p_61",
|
|
15
15
|
indeterminate: F
|
|
16
16
|
}, N = w(I), j = C(
|
|
17
|
-
({ checked: m = !1, className: u, indeterminate:
|
|
18
|
-
const [e, _] = l(m), [k,
|
|
19
|
-
_(!e),
|
|
17
|
+
({ checked: m = !1, className: u, indeterminate: s = !1, onChange: a, variant: f, ...t }, p) => {
|
|
18
|
+
const [e, _] = l(m), [k, n] = l(!1), { getInputProps: o, variant: v } = g(), r = v || f, { disabled: c } = o(t), h = () => {
|
|
19
|
+
_(!e), a && a(!e);
|
|
20
20
|
};
|
|
21
21
|
return /* @__PURE__ */ b(
|
|
22
22
|
"div",
|
|
@@ -26,24 +26,25 @@ const y = "_root_luk8p_2", F = "_indeterminate_luk8p_67", I = {
|
|
|
26
26
|
className: N(
|
|
27
27
|
"root",
|
|
28
28
|
r && `variant-${r}`,
|
|
29
|
-
|
|
29
|
+
s && "indeterminate",
|
|
30
|
+
"field-input",
|
|
30
31
|
u
|
|
31
32
|
),
|
|
32
33
|
"data-focus-visible": k || void 0,
|
|
33
34
|
onClick: c ? void 0 : h,
|
|
34
35
|
children: [
|
|
35
|
-
/* @__PURE__ */
|
|
36
|
+
/* @__PURE__ */ i(V, { children: /* @__PURE__ */ i(
|
|
36
37
|
x,
|
|
37
38
|
{
|
|
38
|
-
...
|
|
39
|
+
...o(t),
|
|
39
40
|
checked: e,
|
|
40
|
-
onBlur: () =>
|
|
41
|
-
onFocusVisible: () =>
|
|
41
|
+
onBlur: () => n(!1),
|
|
42
|
+
onFocusVisible: () => n(!0),
|
|
42
43
|
ref: p
|
|
43
44
|
}
|
|
44
45
|
) }),
|
|
45
|
-
e ? /* @__PURE__ */
|
|
46
|
-
!e &&
|
|
46
|
+
e ? /* @__PURE__ */ i(d, { name: "check", size: "sm" }) : null,
|
|
47
|
+
!e && s ? /* @__PURE__ */ i(d, { name: "minus", size: "sm" }) : null
|
|
47
48
|
]
|
|
48
49
|
}
|
|
49
50
|
);
|
package/dist/DatePicker.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import './DatePicker.css';
|
|
3
|
-
import { jsxs as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { D as
|
|
6
|
-
import { Button as
|
|
7
|
-
import { Icon as
|
|
8
|
-
import { Select as
|
|
9
|
-
import { c as
|
|
10
|
-
import { g as
|
|
11
|
-
import { InputText as
|
|
12
|
-
const
|
|
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 = ({
|
|
13
13
|
changeMonth: x,
|
|
14
14
|
changeYear: N,
|
|
15
15
|
date: f,
|
|
@@ -22,49 +22,49 @@ const g = P(v), B = ({
|
|
|
22
22
|
locale: D,
|
|
23
23
|
startYear: a
|
|
24
24
|
}) => {
|
|
25
|
-
const [
|
|
26
|
-
return
|
|
27
|
-
const b = new Date(f),
|
|
28
|
-
R(
|
|
29
|
-
}, [f,
|
|
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
30
|
/* @__PURE__ */ l(
|
|
31
|
-
|
|
31
|
+
j,
|
|
32
32
|
{
|
|
33
|
-
disabled:
|
|
33
|
+
disabled: o,
|
|
34
34
|
onClick: t ? z : T,
|
|
35
35
|
size: "sm",
|
|
36
36
|
title: `Previous ${t ? "year" : "month"}`,
|
|
37
37
|
variant: "tertiary",
|
|
38
|
-
children: /* @__PURE__ */ l(
|
|
38
|
+
children: /* @__PURE__ */ l(F, { name: "angle-left-b", size: "xs" })
|
|
39
39
|
}
|
|
40
40
|
),
|
|
41
41
|
!t && /* @__PURE__ */ l(
|
|
42
|
-
|
|
42
|
+
M,
|
|
43
43
|
{
|
|
44
44
|
id: "month",
|
|
45
45
|
name: "month",
|
|
46
46
|
onChange: x,
|
|
47
|
-
options:
|
|
47
|
+
options: i,
|
|
48
48
|
size: "md",
|
|
49
|
-
value:
|
|
49
|
+
value: p
|
|
50
50
|
}
|
|
51
51
|
),
|
|
52
|
-
/* @__PURE__ */ l(
|
|
52
|
+
/* @__PURE__ */ l(M, { id: "year", name: "year", onChange: N, options: r, size: "md", value: m }),
|
|
53
53
|
/* @__PURE__ */ l(
|
|
54
|
-
|
|
54
|
+
j,
|
|
55
55
|
{
|
|
56
|
-
disabled:
|
|
56
|
+
disabled: E,
|
|
57
57
|
onClick: t ? y : I,
|
|
58
58
|
size: "sm",
|
|
59
59
|
title: `Next ${t ? "year" : "month"}`,
|
|
60
60
|
variant: "tertiary",
|
|
61
|
-
children: /* @__PURE__ */ l(
|
|
61
|
+
children: /* @__PURE__ */ l(F, { name: "angle-right-b", size: "xs" })
|
|
62
62
|
}
|
|
63
63
|
)
|
|
64
64
|
] });
|
|
65
65
|
};
|
|
66
|
-
|
|
67
|
-
const
|
|
66
|
+
L.displayName = "DateTimePicker.CustomHeader";
|
|
67
|
+
const P = v(B), h = J(
|
|
68
68
|
({
|
|
69
69
|
autoFocus: x,
|
|
70
70
|
className: N,
|
|
@@ -77,93 +77,94 @@ const h = P(v), C = G(
|
|
|
77
77
|
onChange: t,
|
|
78
78
|
placeholder: D,
|
|
79
79
|
preventVirtualKeyboard: a = !1,
|
|
80
|
-
showMonthYearPicker:
|
|
80
|
+
showMonthYearPicker: p,
|
|
81
81
|
size: R = "md",
|
|
82
|
-
startYear:
|
|
83
|
-
transparent:
|
|
84
|
-
useWeekdaysShort:
|
|
82
|
+
startYear: m = 1900,
|
|
83
|
+
transparent: w,
|
|
84
|
+
useWeekdaysShort: i = !0,
|
|
85
85
|
value: r = K,
|
|
86
|
-
...
|
|
87
|
-
},
|
|
88
|
-
const b =
|
|
89
|
-
|
|
90
|
-
t == null || t(
|
|
91
|
-
}, []),
|
|
92
|
-
var
|
|
93
|
-
const e =
|
|
94
|
-
((
|
|
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);
|
|
95
95
|
}, [r]);
|
|
96
|
-
const
|
|
96
|
+
const U = (e) => {
|
|
97
97
|
var s;
|
|
98
|
-
["Enter", "Escape"].includes(e.key) && ((s =
|
|
99
|
-
}, U = (e) => {
|
|
100
|
-
var s;
|
|
101
|
-
e.preventDefault(), (s = S.current) == null || s.blur(), n(null), t == null || t(null);
|
|
98
|
+
["Enter", "Escape"].includes(e.key) && ((s = k.current) == null || s.blur());
|
|
102
99
|
}, _ = (e) => {
|
|
100
|
+
var s;
|
|
101
|
+
e.preventDefault(), (s = k.current) == null || s.blur(), d(null), t == null || t(null);
|
|
102
|
+
}, q = (e) => {
|
|
103
103
|
if (!e) {
|
|
104
|
-
|
|
104
|
+
d(null), t == null || t(null);
|
|
105
105
|
return;
|
|
106
106
|
}
|
|
107
107
|
const s = Array.isArray(e) ? e[0] : e;
|
|
108
108
|
if (!s) {
|
|
109
|
-
|
|
109
|
+
d(null), t == null || t(null);
|
|
110
110
|
return;
|
|
111
111
|
}
|
|
112
|
-
const
|
|
113
|
-
s.setHours(
|
|
112
|
+
const n = u(s);
|
|
113
|
+
s.setHours(n.getHours(), n.getMinutes()), d(s), t == null || t(new Date(s));
|
|
114
114
|
};
|
|
115
115
|
return (
|
|
116
116
|
// type issue in react-datepicker (https://github.com/Hacker0x01/react-datepicker/issues/5391)
|
|
117
117
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
118
118
|
// @ts-expect-error
|
|
119
119
|
/* @__PURE__ */ l(
|
|
120
|
-
|
|
120
|
+
V,
|
|
121
121
|
{
|
|
122
122
|
autoComplete: "off",
|
|
123
123
|
calendarClassName: "date-picker-popper",
|
|
124
124
|
customInput: /* @__PURE__ */ l(
|
|
125
|
-
|
|
125
|
+
g,
|
|
126
126
|
{
|
|
127
127
|
autoFocus: x,
|
|
128
|
-
className:
|
|
129
|
-
"data-testid":
|
|
128
|
+
className: P("date-picker", N),
|
|
129
|
+
"data-testid": o["data-testid"],
|
|
130
130
|
disabled: T,
|
|
131
131
|
icon: c,
|
|
132
132
|
iconPlacement: I,
|
|
133
133
|
inputMode: a ? "none" : "text",
|
|
134
134
|
isClearable: !0,
|
|
135
|
-
onReset:
|
|
135
|
+
onReset: _,
|
|
136
136
|
placeholder: D,
|
|
137
|
-
ref:
|
|
137
|
+
ref: k,
|
|
138
138
|
size: R,
|
|
139
|
-
transparent:
|
|
139
|
+
transparent: w
|
|
140
140
|
}
|
|
141
141
|
),
|
|
142
142
|
dateFormat: f,
|
|
143
143
|
locale: y,
|
|
144
|
-
onChange:
|
|
145
|
-
onKeyDown:
|
|
146
|
-
popperContainer:
|
|
144
|
+
onChange: q,
|
|
145
|
+
onKeyDown: U,
|
|
146
|
+
popperContainer: W,
|
|
147
147
|
renderCustomHeader: (e) => /* @__PURE__ */ l(
|
|
148
|
-
|
|
148
|
+
L,
|
|
149
149
|
{
|
|
150
150
|
endYear: z,
|
|
151
|
-
isMonthYearPicker:
|
|
151
|
+
isMonthYearPicker: p,
|
|
152
152
|
locale: y,
|
|
153
|
-
startYear:
|
|
153
|
+
startYear: m,
|
|
154
154
|
...e
|
|
155
155
|
}
|
|
156
156
|
),
|
|
157
|
-
selected:
|
|
158
|
-
showMonthYearPicker:
|
|
159
|
-
useWeekdaysShort:
|
|
160
|
-
...
|
|
157
|
+
selected: H,
|
|
158
|
+
showMonthYearPicker: p,
|
|
159
|
+
useWeekdaysShort: i,
|
|
160
|
+
...o,
|
|
161
|
+
wrapperClassName: P(o.wrapperClassName, "date-picker-wrapper", "field-input")
|
|
161
162
|
}
|
|
162
163
|
)
|
|
163
164
|
);
|
|
164
165
|
}
|
|
165
166
|
);
|
|
166
|
-
|
|
167
|
+
h.displayName = "DatePicker";
|
|
167
168
|
export {
|
|
168
|
-
|
|
169
|
+
h as DatePicker
|
|
169
170
|
};
|
package/dist/DateTimePicker.js
CHANGED
|
@@ -10,11 +10,11 @@ const L = F(j), M = E(
|
|
|
10
10
|
locale: p,
|
|
11
11
|
onChange: s,
|
|
12
12
|
size: D = "md",
|
|
13
|
-
transparent:
|
|
14
|
-
value:
|
|
13
|
+
transparent: n,
|
|
14
|
+
value: i = b,
|
|
15
15
|
...l
|
|
16
|
-
},
|
|
17
|
-
const u = l == null ? void 0 : l.timeIntervals,
|
|
16
|
+
}, k) => {
|
|
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;
|
|
@@ -24,16 +24,16 @@ const L = F(j), M = E(
|
|
|
24
24
|
c(null), s == null || s(null);
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
|
-
const f =
|
|
27
|
+
const f = r(e);
|
|
28
28
|
e.setHours(f.getHours(), f.getMinutes()), c(e), s == null || s(new Date(e));
|
|
29
29
|
};
|
|
30
30
|
return a(() => {
|
|
31
|
-
m(i
|
|
31
|
+
m(r(i));
|
|
32
32
|
}, []), a(() => {
|
|
33
33
|
var e;
|
|
34
|
-
const t = i
|
|
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
38
|
inputRef: e === 0 ? R : null,
|
|
39
39
|
// give ref only to the DatePicker
|
|
@@ -42,7 +42,7 @@ const L = F(j), M = E(
|
|
|
42
42
|
onChange: m,
|
|
43
43
|
size: D,
|
|
44
44
|
timeIntervals: u,
|
|
45
|
-
transparent:
|
|
45
|
+
transparent: n,
|
|
46
46
|
value: T
|
|
47
47
|
})) });
|
|
48
48
|
}
|
package/dist/Field.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer components{.
|
|
1
|
+
@layer components{._root_wx4cj_2{display:grid;grid-template-areas:"label" "input";width:100%}._root_wx4cj_2:has(._label_wx4cj_7):has(._hint_wx4cj_7){grid-template-areas:"label" "input" "hint"}._root_wx4cj_2:not(:has(._label_wx4cj_7)):has(._hint_wx4cj_7){grid-template-areas:"input" "hint"}._root_wx4cj_2:not(._inline_wx4cj_13) ._hint_wx4cj_7{margin-top:var(--components-dimensions-field-gap-assistive)}._root_wx4cj_2:not(._inline_wx4cj_13) ._label_wx4cj_7{margin-bottom:var(--components-dimensions-field-gap-label)}._root_wx4cj_2 .field-input{align-self:center;grid-area:input}._root_wx4cj_2 .field-input.date-picker-wrapper{justify-self:start}._inline_wx4cj_13{grid-template-areas:"input label";grid-template-columns:min-content 1fr;height:fit-content;grid-row-gap:var(--components-dimensions-field-gap-assistive);grid-column-gap:var(--components-dimensions-field-gap-label)}._inline_wx4cj_13:has(._label_wx4cj_7):has(._hint_wx4cj_7){grid-template-areas:"input label" ". hint"}._inline_wx4cj_13:not(:has(._label_wx4cj_7)):has(._hint_wx4cj_7){grid-template-areas:"input ." ". hint"}._label_wx4cj_7{grid-area:label}._hint_wx4cj_7{grid-area:hint}._visuallyHidden_wx4cj_45{border:0!important;clip:rect(0 0 0 0)!important;height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;width:1px!important;white-space:nowrap!important}}
|