@vkzstudio/muza-ui 1.0.22 → 1.0.23
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/Calendar/Calendar.d.ts +28 -3
- package/dist/components/Calendar/Calendar.d.ts.map +1 -1
- package/dist/components/Calendar/Calendar.js +209 -134
- package/dist/components/Calendar/CalendarBase.stories.d.ts +2 -0
- package/dist/components/Calendar/CalendarBase.stories.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts +5 -0
- package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePicker.js +96 -77
- package/dist/components/DatePicker/DatePicker.stories.d.ts +3 -0
- package/dist/components/DatePicker/DatePicker.stories.d.ts.map +1 -1
- package/dist/muza-ui.css +1 -1
- package/package.json +1 -1
|
@@ -1,52 +1,59 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { useIsDesktop as
|
|
4
|
-
import { useIsMobile as
|
|
5
|
-
import { Popover as
|
|
6
|
-
import { getDateRange as
|
|
7
|
-
import { Input as
|
|
8
|
-
import { formatDate as
|
|
9
|
-
import { formatDateRange as
|
|
10
|
-
import { Calendar as
|
|
11
|
-
import { cn as
|
|
12
|
-
import { typographyVariants as
|
|
13
|
-
import { CalendarBold as
|
|
14
|
-
const
|
|
1
|
+
import { jsx as e, jsxs as V } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as a, useState as l, useEffect as s } from "react";
|
|
3
|
+
import { useIsDesktop as O } from "../../hooks/use-is-desktop.js";
|
|
4
|
+
import { useIsMobile as C } from "../../hooks/use-is-mobile.js";
|
|
5
|
+
import { Popover as N, PopoverTrigger as h, PopoverContent as tt } from "../Popover/Popover.js";
|
|
6
|
+
import { getDateRange as rt } from "./utils/getDateRange.js";
|
|
7
|
+
import { Input as ot } from "../Input/Input.js";
|
|
8
|
+
import { formatDate as it } from "../Calendar/utils/formatDate.js";
|
|
9
|
+
import { formatDateRange as et } from "../Calendar/utils/formatDateRange.js";
|
|
10
|
+
import { Calendar as q } from "../Calendar/Calendar.js";
|
|
11
|
+
import { cn as u } from "../../utils/cn.js";
|
|
12
|
+
import { typographyVariants as ft } from "../Typography/Typography.js";
|
|
13
|
+
import { CalendarBold as mt } from "@solar-icons/react-perf";
|
|
14
|
+
const pt = a(
|
|
15
15
|
({
|
|
16
|
-
alignCalendar:
|
|
16
|
+
alignCalendar: B,
|
|
17
17
|
mode: v,
|
|
18
18
|
allowedPresets: x,
|
|
19
|
-
dateFormatter:
|
|
20
|
-
value:
|
|
21
|
-
defaultValue:
|
|
22
|
-
open:
|
|
19
|
+
dateFormatter: G,
|
|
20
|
+
value: p,
|
|
21
|
+
defaultValue: c,
|
|
22
|
+
open: n,
|
|
23
23
|
onOpenChange: r,
|
|
24
24
|
onChange: f,
|
|
25
25
|
classNames: t,
|
|
26
|
-
error:
|
|
26
|
+
error: H,
|
|
27
27
|
disabled: S,
|
|
28
|
-
hint:
|
|
29
|
-
label:
|
|
30
|
-
placeholder:
|
|
31
|
-
avoidCollisions:
|
|
32
|
-
side:
|
|
28
|
+
hint: J,
|
|
29
|
+
label: K,
|
|
30
|
+
placeholder: L,
|
|
31
|
+
avoidCollisions: Q = !0,
|
|
32
|
+
side: U = "bottom",
|
|
33
33
|
renderCustomTrigger: I,
|
|
34
|
-
shouldResetToDefaultValue:
|
|
35
|
-
required:
|
|
36
|
-
disableRequiredAsterisk:
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
34
|
+
shouldResetToDefaultValue: d,
|
|
35
|
+
required: X,
|
|
36
|
+
disableRequiredAsterisk: Z,
|
|
37
|
+
numberOfMonths: F,
|
|
38
|
+
hideNavigation: M,
|
|
39
|
+
hideCaption: j,
|
|
40
|
+
hideWeekdays: z,
|
|
41
|
+
showOutsideDays: R,
|
|
42
|
+
hideBottomText: A,
|
|
43
|
+
hideResetButton: E,
|
|
44
|
+
...P
|
|
45
|
+
}, _) => {
|
|
46
|
+
const Y = O(), $ = C(), [g, y] = l(!1), W = typeof n == "boolean" ? n : g, [b, k] = l(
|
|
47
|
+
p ?? c
|
|
48
|
+
), [o, m] = l(p ?? c);
|
|
49
|
+
s(() => {
|
|
50
|
+
k(p), m(p);
|
|
51
|
+
}, [p]);
|
|
52
|
+
const w = x == null ? void 0 : x.map((i) => /* @__PURE__ */ e(
|
|
46
53
|
"button",
|
|
47
54
|
{
|
|
48
|
-
className:
|
|
49
|
-
|
|
55
|
+
className: u(
|
|
56
|
+
ft({
|
|
50
57
|
variant: "cta",
|
|
51
58
|
weight: "medium",
|
|
52
59
|
size: "sm",
|
|
@@ -59,91 +66,103 @@ const tt = X(
|
|
|
59
66
|
t == null ? void 0 : t.leftPanelButton
|
|
60
67
|
),
|
|
61
68
|
onClick: () => {
|
|
62
|
-
const
|
|
63
|
-
m(
|
|
69
|
+
const T = rt(i.type);
|
|
70
|
+
m(T);
|
|
64
71
|
},
|
|
65
72
|
children: i.name
|
|
66
73
|
},
|
|
67
74
|
i.type
|
|
68
|
-
)), D =
|
|
69
|
-
return /* @__PURE__ */
|
|
70
|
-
|
|
75
|
+
)), D = G ?? (v === "single" ? it : et);
|
|
76
|
+
return /* @__PURE__ */ V(
|
|
77
|
+
N,
|
|
71
78
|
{
|
|
72
|
-
open:
|
|
79
|
+
open: W,
|
|
73
80
|
onOpenChange: (i) => {
|
|
74
|
-
|
|
81
|
+
n === void 0 && y(i), r == null || r(i);
|
|
75
82
|
},
|
|
76
83
|
children: [
|
|
77
84
|
/* @__PURE__ */ e(
|
|
78
|
-
|
|
85
|
+
h,
|
|
79
86
|
{
|
|
80
|
-
className:
|
|
87
|
+
className: u(
|
|
81
88
|
"group cursor-pointer rounded-full text-left outline-0",
|
|
82
89
|
t == null ? void 0 : t.popoverTrigger
|
|
83
90
|
),
|
|
84
91
|
disabled: S,
|
|
85
92
|
children: I ? I() : /* @__PURE__ */ e(
|
|
86
|
-
|
|
93
|
+
ot,
|
|
87
94
|
{
|
|
88
|
-
ref:
|
|
89
|
-
value:
|
|
90
|
-
placeholder:
|
|
91
|
-
error:
|
|
95
|
+
ref: _,
|
|
96
|
+
value: b ? D(b) : "",
|
|
97
|
+
placeholder: L,
|
|
98
|
+
error: H,
|
|
92
99
|
disabled: S,
|
|
93
|
-
label:
|
|
94
|
-
hint:
|
|
100
|
+
label: K,
|
|
101
|
+
hint: J,
|
|
95
102
|
tabIndex: -1,
|
|
96
|
-
required:
|
|
97
|
-
disableRequiredAsterisk:
|
|
98
|
-
className:
|
|
103
|
+
required: X,
|
|
104
|
+
disableRequiredAsterisk: Z,
|
|
105
|
+
className: u(
|
|
99
106
|
"pointer-events-none",
|
|
100
107
|
t == null ? void 0 : t.input,
|
|
101
108
|
"group-hover:border-comp-input-stroke-hover group-focus-visible:border-comp-input-stroke-focused"
|
|
102
109
|
),
|
|
103
|
-
suffix: /* @__PURE__ */ e(
|
|
110
|
+
suffix: /* @__PURE__ */ e(mt, { className: "size-icon-medium text-icon-dark-secondary-def" })
|
|
104
111
|
}
|
|
105
112
|
)
|
|
106
113
|
}
|
|
107
114
|
),
|
|
108
115
|
/* @__PURE__ */ e(
|
|
109
|
-
|
|
116
|
+
tt,
|
|
110
117
|
{
|
|
111
|
-
className:
|
|
112
|
-
align:
|
|
113
|
-
side:
|
|
114
|
-
avoidCollisions:
|
|
118
|
+
className: u("flex w-auto p-0", t == null ? void 0 : t.popoverContent),
|
|
119
|
+
align: B,
|
|
120
|
+
side: U,
|
|
121
|
+
avoidCollisions: Q,
|
|
115
122
|
onOpenAutoFocus: (i) => i.preventDefault(),
|
|
116
123
|
children: v === "single" ? /* @__PURE__ */ e(
|
|
117
|
-
|
|
124
|
+
q,
|
|
118
125
|
{
|
|
119
|
-
...
|
|
126
|
+
...P,
|
|
120
127
|
mode: "single",
|
|
121
128
|
selected: o,
|
|
122
129
|
onReset: () => m(
|
|
123
|
-
|
|
130
|
+
d ? c : b
|
|
124
131
|
),
|
|
125
132
|
onSelect: m,
|
|
126
133
|
onConfirm: () => {
|
|
127
|
-
(o !== void 0 ||
|
|
134
|
+
(o !== void 0 || d) && (k(o), f == null || f(o)), n === void 0 && y(!1), r == null || r(!1);
|
|
128
135
|
},
|
|
129
|
-
numberOfMonths: F ? 2 : 1,
|
|
136
|
+
numberOfMonths: F ?? (Y ? 2 : 1),
|
|
137
|
+
hideNavigation: M,
|
|
138
|
+
hideCaption: j,
|
|
139
|
+
hideWeekdays: z,
|
|
140
|
+
showOutsideDays: R,
|
|
141
|
+
hideBottomText: A,
|
|
142
|
+
hideResetButton: E,
|
|
130
143
|
dateFormatter: D
|
|
131
144
|
}
|
|
132
145
|
) : /* @__PURE__ */ e(
|
|
133
|
-
|
|
146
|
+
q,
|
|
134
147
|
{
|
|
135
|
-
...
|
|
148
|
+
...P,
|
|
136
149
|
mode: "range",
|
|
137
150
|
selected: o,
|
|
138
151
|
onReset: () => m(
|
|
139
|
-
|
|
152
|
+
d ? c : b
|
|
140
153
|
),
|
|
141
154
|
onSelect: m,
|
|
142
155
|
onConfirm: () => {
|
|
143
|
-
(o !== void 0 ||
|
|
156
|
+
(o !== void 0 || d) && (k(o), f == null || f(o)), n === void 0 && y(!1), r == null || r(!1);
|
|
144
157
|
},
|
|
145
|
-
numberOfMonths: F ? 2 : 1,
|
|
146
|
-
|
|
158
|
+
numberOfMonths: F ?? (Y ? 2 : 1),
|
|
159
|
+
hideNavigation: M,
|
|
160
|
+
hideCaption: j,
|
|
161
|
+
hideWeekdays: z,
|
|
162
|
+
showOutsideDays: R,
|
|
163
|
+
hideBottomText: A,
|
|
164
|
+
hideResetButton: E,
|
|
165
|
+
leftPanelChildren: v === "range" && !$ && w,
|
|
147
166
|
dateRangeFormatter: D
|
|
148
167
|
}
|
|
149
168
|
)
|
|
@@ -154,7 +173,7 @@ const tt = X(
|
|
|
154
173
|
);
|
|
155
174
|
}
|
|
156
175
|
);
|
|
157
|
-
|
|
176
|
+
pt.displayName = "DatePicker";
|
|
158
177
|
export {
|
|
159
|
-
|
|
178
|
+
pt as DatePicker
|
|
160
179
|
};
|
|
@@ -15,4 +15,7 @@ export declare const ControlledDatePickerWithCustomTrigger: Story;
|
|
|
15
15
|
export declare const ResetButtonResetsToUndefined: Story;
|
|
16
16
|
export declare const ResetButtonResetsToStoryDate: Story;
|
|
17
17
|
export declare const Required: Story;
|
|
18
|
+
export declare const SingleMonth: Story;
|
|
19
|
+
export declare const MonthlyView: Story;
|
|
20
|
+
export declare const YearlyView: Story;
|
|
18
21
|
//# sourceMappingURL=DatePicker.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker.stories.d.ts","sourceRoot":"","sources":["../../../src/components/DatePicker/DatePicker.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAI3D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAKzC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,UAAU,
|
|
1
|
+
{"version":3,"file":"DatePicker.stories.d.ts","sourceRoot":"","sources":["../../../src/components/DatePicker/DatePicker.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAI3D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAKzC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,UAAU,CA2LjC,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,UAAU,CAAC,CAAA;AAExC,eAAO,MAAM,iBAAiB,EAAE,KAoC/B,CAAA;AAED,eAAO,MAAM,gBAAgB,EAAE,KAsB9B,CAAA;AAED,eAAO,MAAM,0BAA0B,EAAE,KAuBxC,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,KA0B7B,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAwBtB,CAAA;AAED,eAAO,MAAM,KAAK,EAAE,KAwBnB,CAAA;AAED,eAAO,MAAM,0BAA0B,EAAE,KAyBxC,CAAA;AAED,eAAO,MAAM,2BAA2B,EAAE,KAmCzC,CAAA;AAED,eAAO,MAAM,qCAAqC,EAAE,KA8CnD,CAAA;AAED,eAAO,MAAM,4BAA4B,EAAE,KAyB1C,CAAA;AAED,eAAO,MAAM,4BAA4B,EAAE,KAyB1C,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KA0BtB,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,KAwBzB,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,KAqCzB,CAAA;AAED,eAAO,MAAM,UAAU,EAAE,KA8CxB,CAAA"}
|