@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.
@@ -1,52 +1,59 @@
1
- import { jsx as e, jsxs as W } from "react/jsx-runtime";
2
- import { forwardRef as X, useState as l, useEffect as Z } from "react";
3
- import { useIsDesktop as _ } from "../../hooks/use-is-desktop.js";
4
- import { useIsMobile as $ } from "../../hooks/use-is-mobile.js";
5
- import { Popover as w, PopoverTrigger as T, PopoverContent as a } from "../Popover/Popover.js";
6
- import { getDateRange as s } from "./utils/getDateRange.js";
7
- import { Input as V } from "../Input/Input.js";
8
- import { formatDate as O } from "../Calendar/utils/formatDate.js";
9
- import { formatDateRange as h } from "../Calendar/utils/formatDateRange.js";
10
- import { Calendar as R } from "../Calendar/Calendar.js";
11
- import { cn as b } from "../../utils/cn.js";
12
- import { typographyVariants as C } from "../Typography/Typography.js";
13
- import { CalendarBold as N } from "@solar-icons/react-perf";
14
- const tt = X(
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: j,
16
+ alignCalendar: B,
17
17
  mode: v,
18
18
  allowedPresets: x,
19
- dateFormatter: z,
20
- value: n,
21
- defaultValue: p,
22
- open: d,
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: B,
26
+ error: H,
27
27
  disabled: S,
28
- hint: A,
29
- label: E,
30
- placeholder: P,
31
- avoidCollisions: Y = !0,
32
- side: g = "bottom",
28
+ hint: J,
29
+ label: K,
30
+ placeholder: L,
31
+ avoidCollisions: Q = !0,
32
+ side: U = "bottom",
33
33
  renderCustomTrigger: I,
34
- shouldResetToDefaultValue: c,
35
- required: q,
36
- disableRequiredAsterisk: G,
37
- ...M
38
- }, H) => {
39
- const F = _(), J = $(), [K, y] = l(!1), L = typeof d == "boolean" ? d : K, [u, k] = l(
40
- n ?? p
41
- ), [o, m] = l(n ?? p);
42
- Z(() => {
43
- k(n), m(n);
44
- }, [n]);
45
- const Q = x == null ? void 0 : x.map((i) => /* @__PURE__ */ e(
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: b(
49
- C({
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 U = s(i.type);
63
- m(U);
69
+ const T = rt(i.type);
70
+ m(T);
64
71
  },
65
72
  children: i.name
66
73
  },
67
74
  i.type
68
- )), D = z ?? (v === "single" ? O : h);
69
- return /* @__PURE__ */ W(
70
- w,
75
+ )), D = G ?? (v === "single" ? it : et);
76
+ return /* @__PURE__ */ V(
77
+ N,
71
78
  {
72
- open: L,
79
+ open: W,
73
80
  onOpenChange: (i) => {
74
- d === void 0 && y(i), r == null || r(i);
81
+ n === void 0 && y(i), r == null || r(i);
75
82
  },
76
83
  children: [
77
84
  /* @__PURE__ */ e(
78
- T,
85
+ h,
79
86
  {
80
- className: b(
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
- V,
93
+ ot,
87
94
  {
88
- ref: H,
89
- value: u ? D(u) : "",
90
- placeholder: P,
91
- error: B,
95
+ ref: _,
96
+ value: b ? D(b) : "",
97
+ placeholder: L,
98
+ error: H,
92
99
  disabled: S,
93
- label: E,
94
- hint: A,
100
+ label: K,
101
+ hint: J,
95
102
  tabIndex: -1,
96
- required: q,
97
- disableRequiredAsterisk: G,
98
- className: b(
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(N, { className: "size-icon-medium text-icon-dark-secondary-def" })
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
- a,
116
+ tt,
110
117
  {
111
- className: b("flex w-auto p-0", t == null ? void 0 : t.popoverContent),
112
- align: j,
113
- side: g,
114
- avoidCollisions: Y,
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
- R,
124
+ q,
118
125
  {
119
- ...M,
126
+ ...P,
120
127
  mode: "single",
121
128
  selected: o,
122
129
  onReset: () => m(
123
- c ? p : u
130
+ d ? c : b
124
131
  ),
125
132
  onSelect: m,
126
133
  onConfirm: () => {
127
- (o !== void 0 || c) && (k(o), f == null || f(o)), d === void 0 && y(!1), r == null || r(!1);
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
- R,
146
+ q,
134
147
  {
135
- ...M,
148
+ ...P,
136
149
  mode: "range",
137
150
  selected: o,
138
151
  onReset: () => m(
139
- c ? p : u
152
+ d ? c : b
140
153
  ),
141
154
  onSelect: m,
142
155
  onConfirm: () => {
143
- (o !== void 0 || c) && (k(o), f == null || f(o)), d === void 0 && y(!1), r == null || r(!1);
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
- leftPanelChildren: v === "range" && !J && Q,
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
- tt.displayName = "DatePicker";
176
+ pt.displayName = "DatePicker";
158
177
  export {
159
- tt as DatePicker
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,CAgJjC,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"}
1
+ {"version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