meticulous-ui 3.5.3 → 3.6.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/README.md CHANGED
@@ -58,29 +58,33 @@ import blue from 'meticulous-ui/colors/blue';
58
58
 
59
59
  ## 📦 Components
60
60
 
61
- | Component | Description |
62
- | --------------- | -------------------------------------------------------------------------------------- |
63
- | `Pagination` | Fully responsive pagination component |
64
- | `Toast` | Push 4 types of notifications on screen |
65
- | `Timer` | Renders analog / digital clock with alarm |
66
- | `OtpInput` | Gives inputs to enter and edit OTP |
67
- | `VideoPlayer` | Renders video with keyboard shortcuts |
68
- | `Image` | Renders image with shimmer, lower resolution |
69
- | `Input` | Renders input box to let user enter input |
70
- | `Checkbox` | Renders checkbox to let user give boolean value |
71
- | `RadioGroup` | Renders radio options in a group to let user select |
72
- | `FileUploader` | Renders a button type input from where user can upload |
73
- | `Textarea` | Renders textarea box to let user enter description |
74
- | `Dropdown` | Renders dropdown to select from options |
75
- | `SelectBox` | Renders selectbox to select multiple values from options |
76
- | `Spinner` | Renders a spinner to show the loading state |
77
- | `Loader` | Renders a loader with dots to show the loading state |
78
- | `PageLoader` | Renders a loader with line at the top of page |
79
- | `Button` | Renders a button to click & take an action |
80
- | `Shimmer` | Animated skeleton loading placeholder |
81
- | `Carousel` | Carousel providing slider between components displaying slides |
82
- | `Modal` | Accessible dialog overlay with title, body, footer, and Escape/overlay-click dismissal |
83
- | `RootComponent` | This is the required wrapper for any app that uses meticulous-ui |
61
+ | Component | Description |
62
+ | --------------- | ---------------------------------------------------------------------------------------------------------------- |
63
+ | `Pagination` | Fully responsive pagination component |
64
+ | `Toast` | Push 4 types of notifications on screen |
65
+ | `Timer` | Renders analog / digital clock with alarm |
66
+ | `OtpInput` | Gives inputs to enter and edit OTP |
67
+ | `VideoPlayer` | Renders video with keyboard shortcuts |
68
+ | `Image` | Renders image with shimmer, lower resolution |
69
+ | `Input` | Renders input box to let user enter input |
70
+ | `Checkbox` | Renders checkbox to let user give boolean value |
71
+ | `RadioGroup` | Renders radio options in a group to let user select |
72
+ | `FileUploader` | Renders a button type input from where user can upload |
73
+ | `Textarea` | Renders textarea box to let user enter description |
74
+ | `Dropdown` | Renders dropdown to select from options |
75
+ | `Selectbox` | Renders selectbox to select multiple values from options |
76
+ | `Spinner` | Renders a spinner to show the loading state |
77
+ | `Loader` | Renders a loader with dots to show the loading state |
78
+ | `PageLoader` | Renders a loader with line at the top of page |
79
+ | `Button` | Renders a button to click & take an action |
80
+ | `Shimmer` | Animated skeleton loading placeholder |
81
+ | `Carousel` | Carousel providing slider between components displaying slides |
82
+ | `Modal` | Accessible dialog overlay with title, body, footer, Escape/overlay-click dismissal, and mobile bottom-sheet mode |
83
+ | `DatePicker` | Calendar-based date picker with month/year navigation |
84
+ | `Headings` | Semantic heading components: `H1`–`H6` |
85
+ | `P` | Styled paragraph component |
86
+ | `ToastContainer`| Renders the container that displays active Toast notifications |
87
+ | `RootComponent` | This is the required wrapper for any app that uses meticulous-ui |
84
88
 
85
89
  ## 📦 Icon Components
86
90
 
@@ -1,12 +1,12 @@
1
1
  import { jsxs as I, jsx as r } from "react/jsx-runtime";
2
2
  import { useState as a, useRef as T, useEffect as C } from "react";
3
- import { Wrapper as ue, SlideArea as de, NavButton as K, SlideViewport as he, SlideTrack as fe, PauseButton as me, ProgressBar as pe, DotsWrapper as ve, Dot as ge } from "./styles.js";
4
- import we from "../Icons/ChevronLeft/ChevronLeft.js";
5
- import $e from "../Icons/ChevronRight/ChevronRight.js";
6
- const E = 50, O = 2e3, Me = () => /* @__PURE__ */ I("svg", { width: 12, height: 12, viewBox: "0 0 12 12", fill: "currentColor", "aria-hidden": "true", children: [
3
+ import { Wrapper as de, SlideArea as he, NavButton as K, SlideViewport as fe, SlideTrack as me, PauseButton as pe, ProgressBar as ve, DotsWrapper as ge, Dot as we } from "./styles.js";
4
+ import $e from "../Icons/ChevronLeft/ChevronLeft.js";
5
+ import Me from "../Icons/ChevronRight/ChevronRight.js";
6
+ const E = 50, O = 2e3, be = () => /* @__PURE__ */ I("svg", { width: 12, height: 12, viewBox: "0 0 12 12", fill: "currentColor", "aria-hidden": "true", children: [
7
7
  /* @__PURE__ */ r("rect", { x: "2", y: "1", width: "3", height: "10", rx: "1" }),
8
8
  /* @__PURE__ */ r("rect", { x: "7", y: "1", width: "3", height: "10", rx: "1" })
9
- ] }), be = () => /* @__PURE__ */ r("svg", { width: 12, height: 12, viewBox: "0 0 12 12", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ r("path", { d: "M2 1.5l9 4.5-9 4.5V1.5z" }) }), Xe = ({
9
+ ] }), xe = () => /* @__PURE__ */ r("svg", { width: 12, height: 12, viewBox: "0 0 12 12", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ r("path", { d: "M2 1.5l9 4.5-9 4.5V1.5z" }) }), ke = ({
10
10
  data: R,
11
11
  renderCarousel: N,
12
12
  visibleSlides: X = 1,
@@ -22,13 +22,14 @@ const E = 50, O = 2e3, Me = () => /* @__PURE__ */ I("svg", { width: 12, height:
22
22
  liveDragMobile: L = !0,
23
23
  showProgress: A = !1,
24
24
  defaultIndex: Y = 0,
25
- onSlideChange: G
25
+ onSlideChange: G,
26
+ ...J
26
27
  }) => {
27
- const [n, M] = a(Y), [B, d] = a(!0), [V, W] = a(!1), [h, f] = a(!1), [J, m] = a(0), [F, p] = a(!1), [y, _] = a(!1), c = T(null), o = T(null), l = T(null), z = T(null);
28
+ const [n, M] = a(Y), [B, d] = a(!0), [V, W] = a(!1), [h, f] = a(!1), [Q, m] = a(0), [F, p] = a(!1), [y, _] = a(!1), c = T(null), o = T(null), l = T(null), z = T(null);
28
29
  C(() => {
29
30
  const e = window.matchMedia("(max-width: 1024px)");
30
31
  _(e.matches);
31
- const t = (le) => _(le.matches);
32
+ const t = (ue) => _(ue.matches);
32
33
  return e.addEventListener("change", t), () => e.removeEventListener("change", t);
33
34
  }, []);
34
35
  const s = R.length - X, b = () => M((e) => u && e === 0 ? s : Math.max(e - 1, 0)), x = () => M((e) => u && e >= s ? 0 : Math.min(e + 1, s));
@@ -37,9 +38,9 @@ const E = 50, O = 2e3, Me = () => /* @__PURE__ */ I("svg", { width: 12, height:
37
38
  }, [n]);
38
39
  const H = () => {
39
40
  i && (clearTimeout(l.current), d(!0), l.current = setTimeout(() => d(!1), O));
40
- }, Q = () => {
41
- f(!0), i && (clearTimeout(l.current), d(!0));
42
41
  }, Z = () => {
42
+ f(!0), i && (clearTimeout(l.current), d(!0));
43
+ }, ee = () => {
43
44
  f(!1), i && (l.current = setTimeout(() => d(!1), O));
44
45
  };
45
46
  C(() => {
@@ -52,44 +53,45 @@ const E = 50, O = 2e3, Me = () => /* @__PURE__ */ I("svg", { width: 12, height:
52
53
  }, k * 1e3);
53
54
  return () => clearInterval(e);
54
55
  }, [g, k, h, s]);
55
- const S = (e) => u ? e : n === 0 && e > 0 || n === s && e < 0 ? e * 0.3 : e, ee = (e) => {
56
+ const S = (e) => u ? e : n === 0 && e > 0 || n === s && e < 0 ? e * 0.3 : e, te = (e) => {
56
57
  c.current = e.touches[0].clientX, L && y && p(!0), H();
57
- }, te = (e) => {
58
- !L || !y || c.current === null || m(S(e.touches[0].clientX - c.current));
59
58
  }, re = (e) => {
59
+ !L || !y || c.current === null || m(S(e.touches[0].clientX - c.current));
60
+ }, ne = (e) => {
60
61
  if (L && y && (p(!1), m(0)), c.current === null) return;
61
62
  const t = c.current - e.changedTouches[0].clientX;
62
63
  t > E ? x() : t < -E && b(), c.current = null;
63
- }, ne = (e) => {
64
- w && (o.current = e.clientX, $ && p(!0));
65
64
  }, se = (e) => {
66
- !w || !$ || o.current === null || m(S(e.clientX - o.current));
65
+ w && (o.current = e.clientX, $ && p(!0));
67
66
  }, ie = (e) => {
67
+ !w || !$ || o.current === null || m(S(e.clientX - o.current));
68
+ }, oe = (e) => {
68
69
  if (!w || o.current === null) return;
69
70
  $ && (p(!1), m(0));
70
71
  const t = o.current - e.clientX;
71
72
  t > E ? x() : t < -E && b(), o.current = null;
72
- }, oe = (e) => {
73
+ }, ae = (e) => {
73
74
  e.key === "ArrowLeft" ? (e.preventDefault(), b()) : e.key === "ArrowRight" && (e.preventDefault(), x());
74
- }, U = z.current?.clientWidth ?? 0, ae = U > 0 ? J / U * 100 : 0, ce = -(n * (100 / X)) + ae, j = v !== void 0 ? typeof v == "number" ? `${v}px` : v : void 0, D = s + 1;
75
+ }, U = z.current?.clientWidth ?? 0, ce = U > 0 ? Q / U * 100 : 0, le = -(n * (100 / X)) + ce, j = v !== void 0 ? typeof v == "number" ? `${v}px` : v : void 0, D = s + 1;
75
76
  return /* @__PURE__ */ I(
76
- ue,
77
+ de,
77
78
  {
78
79
  onClick: H,
79
- onMouseEnter: Q,
80
- onMouseLeave: Z,
81
- onMouseMove: se,
82
- onMouseUp: ie,
83
- onKeyDown: oe,
80
+ onMouseEnter: Z,
81
+ onMouseLeave: ee,
82
+ onMouseMove: ie,
83
+ onMouseUp: oe,
84
+ onKeyDown: ae,
84
85
  role: "region",
85
86
  "aria-label": "Carousel",
87
+ ...J,
86
88
  children: [
87
89
  /* @__PURE__ */ I(
88
- de,
90
+ he,
89
91
  {
90
- onTouchStart: ee,
91
- onTouchMove: te,
92
- onTouchEnd: re,
92
+ onTouchStart: te,
93
+ onTouchMove: re,
94
+ onTouchEnd: ne,
93
95
  children: [
94
96
  P && /* @__PURE__ */ r(
95
97
  K,
@@ -102,11 +104,11 @@ const E = 50, O = 2e3, Me = () => /* @__PURE__ */ I("svg", { width: 12, height:
102
104
  $visible: B,
103
105
  $arrowTop: j,
104
106
  $viewportFocused: V,
105
- children: /* @__PURE__ */ r(we, { size: 20, "aria-hidden": "true" })
107
+ children: /* @__PURE__ */ r($e, { size: 20, "aria-hidden": "true" })
106
108
  }
107
109
  ),
108
110
  /* @__PURE__ */ r(
109
- he,
111
+ fe,
110
112
  {
111
113
  ref: z,
112
114
  tabIndex: 0,
@@ -118,11 +120,11 @@ const E = 50, O = 2e3, Me = () => /* @__PURE__ */ I("svg", { width: 12, height:
118
120
  onBlur: () => {
119
121
  W(!1), f(!1);
120
122
  },
121
- onMouseDown: ne,
123
+ onMouseDown: se,
122
124
  onMouseLeave: (e) => {
123
125
  e.buttons !== 1 && ($ && F && (p(!1), m(0)), o.current = null);
124
126
  },
125
- children: /* @__PURE__ */ r(fe, { $translateX: ce, $visibleSlides: X, $dragging: F, children: R.map(N) })
127
+ children: /* @__PURE__ */ r(me, { $translateX: le, $visibleSlides: X, $dragging: F, children: R.map(N) })
126
128
  }
127
129
  ),
128
130
  P && /* @__PURE__ */ r(
@@ -136,15 +138,15 @@ const E = 50, O = 2e3, Me = () => /* @__PURE__ */ I("svg", { width: 12, height:
136
138
  $visible: B,
137
139
  $arrowTop: j,
138
140
  $viewportFocused: V,
139
- children: /* @__PURE__ */ r($e, { size: 20, "aria-hidden": "true" })
141
+ children: /* @__PURE__ */ r(Me, { size: 20, "aria-hidden": "true" })
140
142
  }
141
143
  ),
142
144
  g && /* @__PURE__ */ r(
143
- me,
145
+ pe,
144
146
  {
145
147
  onClick: () => f((e) => !e),
146
148
  "aria-label": h ? "Play slideshow" : "Pause slideshow",
147
- children: h ? /* @__PURE__ */ r(be, {}) : /* @__PURE__ */ r(Me, {})
149
+ children: h ? /* @__PURE__ */ r(xe, {}) : /* @__PURE__ */ r(be, {})
148
150
  }
149
151
  )
150
152
  ]
@@ -171,9 +173,9 @@ const E = 50, O = 2e3, Me = () => /* @__PURE__ */ I("svg", { width: 12, height:
171
173
  ]
172
174
  }
173
175
  ),
174
- g && A && /* @__PURE__ */ r(pe, { $duration: k, $paused: h }, n),
175
- !q && /* @__PURE__ */ r(ve, { children: Array.from({ length: D }).map((e, t) => /* @__PURE__ */ r(
176
- ge,
176
+ g && A && /* @__PURE__ */ r(ve, { $duration: k, $paused: h }, n),
177
+ !q && /* @__PURE__ */ r(ge, { children: Array.from({ length: D }).map((e, t) => /* @__PURE__ */ r(
178
+ we,
177
179
  {
178
180
  $active: t === n,
179
181
  onClick: () => M(t),
@@ -187,5 +189,5 @@ const E = 50, O = 2e3, Me = () => /* @__PURE__ */ I("svg", { width: 12, height:
187
189
  );
188
190
  };
189
191
  export {
190
- Xe as default
192
+ ke as default
191
193
  };
@@ -0,0 +1,223 @@
1
+ import { jsxs as c, jsx as n, Fragment as ve } from "react/jsx-runtime";
2
+ import { useMemo as Ce, useState as a, useCallback as Le } from "react";
3
+ import ye from "../../colors/colorMap.js";
4
+ import { blue as De } from "../../colors/blue.js";
5
+ import { MODE as l, MONTHS as Q, DAYS_SHORT as Ge } from "./constants.js";
6
+ import { buildCalendarGrid as Me, formatDate as H, isToday as $e, isSameDay as U, isRangeStart as Ye, isRangeEnd as be, isInRange as we } from "./utils.js";
7
+ import { Wrapper as Ie, SelectedDisplay as Pe, DateChip as x, RangeArrow as Te, ModeToggle as _e, ModeBtn as X, Nav as He, NavBtn as Z, MonthLabel as ee, Footer as xe, ActionBtn as ne, Grid as Oe, DayHeader as Be, DayCell as je, DayBtn as Fe, PickerGrid as We, PickerItem as re, YearScroll as Ve } from "./styles.js";
8
+ const qe = () => /* @__PURE__ */ n(
9
+ "svg",
10
+ {
11
+ width: "16",
12
+ height: "16",
13
+ viewBox: "0 0 24 24",
14
+ fill: "none",
15
+ stroke: "currentColor",
16
+ strokeWidth: "2.5",
17
+ strokeLinecap: "round",
18
+ strokeLinejoin: "round",
19
+ children: /* @__PURE__ */ n("polyline", { points: "15 18 9 12 15 6" })
20
+ }
21
+ ), ze = () => /* @__PURE__ */ n(
22
+ "svg",
23
+ {
24
+ width: "16",
25
+ height: "16",
26
+ viewBox: "0 0 24 24",
27
+ fill: "none",
28
+ stroke: "currentColor",
29
+ strokeWidth: "2.5",
30
+ strokeLinecap: "round",
31
+ strokeLinejoin: "round",
32
+ children: /* @__PURE__ */ n("polyline", { points: "9 18 15 12 9 6" })
33
+ }
34
+ ), i = { CALENDAR: "calendar", MONTH: "month", YEAR: "year" }, Je = /* @__PURE__ */ new Date(), le = 1924, Ke = Je.getFullYear() + 20, Qe = Array.from(
35
+ { length: Ke - le + 1 },
36
+ (L, y) => le + y
37
+ ), tn = ({
38
+ theme: L = "blue",
39
+ mode: y = l.SINGLE,
40
+ value: te,
41
+ rangeValue: O,
42
+ onChange: E,
43
+ minDate: D,
44
+ maxDate: G,
45
+ showModeToggle: ie = !0,
46
+ showFooter: M = !0
47
+ }) => {
48
+ const $ = Ce(() => ye[L] ?? De, [L]), o = $.m500, Y = $.m700, f = $.m100, b = { $primary: o, $primaryDark: Y, $primaryLight: f }, B = /* @__PURE__ */ new Date(), [t, oe] = a(y), [w, I] = a(B.getFullYear()), [A, R] = a(B.getMonth()), [u, m] = a(i.CALENDAR), [N, P] = a(te ?? null), [r, T] = a(O?.[0] ?? null), [d, g] = a(O?.[1] ?? null), [S, k] = a(null), [v, C] = a(!1), ce = Me(w, A), j = Le(
49
+ (e) => !!(!e || D && e < D || G && e > G),
50
+ [D, G]
51
+ ), se = () => {
52
+ A === 0 ? (R(11), I((e) => e - 1)) : R((e) => e - 1);
53
+ }, ae = () => {
54
+ A === 11 ? (R(0), I((e) => e + 1)) : R((e) => e + 1);
55
+ }, de = (e) => {
56
+ if (!(!e || j(e))) {
57
+ if (t === l.SINGLE) {
58
+ P(e), M || E?.(e);
59
+ return;
60
+ }
61
+ !v || !r ? (T(e), g(null), C(!0)) : (g(e), C(!1), M || E?.([
62
+ e <= r ? e : r,
63
+ e <= r ? r : e
64
+ ]));
65
+ }
66
+ }, F = (e) => {
67
+ oe(e), P(null), T(null), g(null), C(!1), k(null);
68
+ }, he = () => {
69
+ if (t === l.SINGLE)
70
+ E?.(N);
71
+ else if (r && d) {
72
+ const [e, p] = r <= d ? [r, d] : [d, r];
73
+ E?.([e, p]);
74
+ }
75
+ }, ue = () => {
76
+ P(null), T(null), g(null), C(!1), k(null), E?.(t === l.SINGLE ? null : [null, null]);
77
+ }, h = v && S ? S : d, W = (e) => t === l.RANGE && Ye(e, r, h), V = (e) => t === l.RANGE && be(e, r, h), pe = (e) => t === l.RANGE && we(e, r, h), Ee = (e) => t === l.SINGLE ? U(e, N) : W(e) || V(e), q = t === l.SINGLE ? H(N) : H(
78
+ r ? r <= (h ?? r) ? r : h : null
79
+ ), Ae = t === l.RANGE ? H(h ? h >= r ? h : r : null) : null, Re = t === l.SINGLE ? !N : !r || !d, Ne = () => /* @__PURE__ */ n(We, { children: Q.map((e, p) => /* @__PURE__ */ n(
80
+ re,
81
+ {
82
+ $active: p === A,
83
+ ...b,
84
+ onClick: () => {
85
+ R(p), m(i.CALENDAR);
86
+ },
87
+ children: e.slice(0, 3)
88
+ },
89
+ e
90
+ )) }), fe = () => /* @__PURE__ */ n(Ve, { children: Qe.map((e) => /* @__PURE__ */ n(
91
+ re,
92
+ {
93
+ $active: e === w,
94
+ ...b,
95
+ onClick: () => {
96
+ I(e), m(i.CALENDAR);
97
+ },
98
+ children: e
99
+ },
100
+ e
101
+ )) }), me = () => /* @__PURE__ */ c(Oe, { children: [
102
+ Ge.map((e) => /* @__PURE__ */ n(Be, { children: e }, e)),
103
+ ce.map((e, p) => {
104
+ const s = !e, z = j(e), _ = !s && Ee(e), ge = !s && $e(e), J = !s && W(e), K = !s && V(e), Se = !s && pe(e), ke = !s && S && U(e, S);
105
+ return /* @__PURE__ */ n(
106
+ je,
107
+ {
108
+ $inRange: Se || J || K,
109
+ $rangeStart: J,
110
+ $rangeEnd: K,
111
+ $primaryLight: f,
112
+ children: /* @__PURE__ */ n(
113
+ Fe,
114
+ {
115
+ $empty: s,
116
+ $selected: _,
117
+ $today: ge,
118
+ $hovered: ke && !_,
119
+ disabled: z,
120
+ ...b,
121
+ onClick: () => de(e),
122
+ onMouseEnter: () => !s && k(e),
123
+ onMouseLeave: () => k(null),
124
+ "aria-label": e ? e.toDateString() : void 0,
125
+ "aria-pressed": _,
126
+ tabIndex: s || z ? -1 : 0,
127
+ children: e?.getDate()
128
+ }
129
+ )
130
+ },
131
+ p
132
+ );
133
+ })
134
+ ] });
135
+ return /* @__PURE__ */ c(Ie, { children: [
136
+ /* @__PURE__ */ n(Pe, { children: t === l.RANGE ? /* @__PURE__ */ c(ve, { children: [
137
+ /* @__PURE__ */ c(x, { $active: v || !r && !d, $primary: o, children: [
138
+ /* @__PURE__ */ n("span", { children: "From" }),
139
+ q
140
+ ] }),
141
+ /* @__PURE__ */ n(Te, { children: "→" }),
142
+ /* @__PURE__ */ c(x, { $active: !v && !!d, $primary: o, children: [
143
+ /* @__PURE__ */ n("span", { children: "To" }),
144
+ Ae
145
+ ] })
146
+ ] }) : /* @__PURE__ */ c(x, { $active: !!N, $primary: o, style: { flex: "none", width: "100%" }, children: [
147
+ /* @__PURE__ */ n("span", { children: "Selected" }),
148
+ q
149
+ ] }) }),
150
+ ie && /* @__PURE__ */ c(_e, { children: [
151
+ /* @__PURE__ */ n(
152
+ X,
153
+ {
154
+ $active: t === l.SINGLE,
155
+ $primary: o,
156
+ onClick: () => F(l.SINGLE),
157
+ children: "Single"
158
+ }
159
+ ),
160
+ /* @__PURE__ */ n(
161
+ X,
162
+ {
163
+ $active: t === l.RANGE,
164
+ $primary: o,
165
+ onClick: () => F(l.RANGE),
166
+ children: "Range"
167
+ }
168
+ )
169
+ ] }),
170
+ /* @__PURE__ */ c(He, { children: [
171
+ /* @__PURE__ */ n(Z, { $primary: o, onClick: se, "aria-label": "Previous month", children: /* @__PURE__ */ n(qe, {}) }),
172
+ /* @__PURE__ */ c("div", { style: { display: "flex", gap: 4 }, children: [
173
+ /* @__PURE__ */ n(
174
+ ee,
175
+ {
176
+ $primary: o,
177
+ onClick: () => m(u === i.MONTH ? i.CALENDAR : i.MONTH),
178
+ children: Q[A]
179
+ }
180
+ ),
181
+ /* @__PURE__ */ n(
182
+ ee,
183
+ {
184
+ $primary: o,
185
+ onClick: () => m(u === i.YEAR ? i.CALENDAR : i.YEAR),
186
+ children: w
187
+ }
188
+ )
189
+ ] }),
190
+ /* @__PURE__ */ n(Z, { $primary: o, onClick: ae, "aria-label": "Next month", children: /* @__PURE__ */ n(ze, {}) })
191
+ ] }),
192
+ u === i.CALENDAR && me(),
193
+ u === i.MONTH && Ne(),
194
+ u === i.YEAR && fe(),
195
+ M && u === i.CALENDAR && /* @__PURE__ */ c(xe, { children: [
196
+ /* @__PURE__ */ n(
197
+ ne,
198
+ {
199
+ $primary: o,
200
+ $primaryDark: Y,
201
+ $primaryLight: f,
202
+ onClick: ue,
203
+ children: "Clear"
204
+ }
205
+ ),
206
+ /* @__PURE__ */ n(
207
+ ne,
208
+ {
209
+ $isPrimary: !0,
210
+ $primary: o,
211
+ $primaryDark: Y,
212
+ $primaryLight: f,
213
+ disabled: Re,
214
+ onClick: he,
215
+ children: "Apply"
216
+ }
217
+ )
218
+ ] })
219
+ ] });
220
+ };
221
+ export {
222
+ tn as default
223
+ };
@@ -0,0 +1,22 @@
1
+ const e = [
2
+ "January",
3
+ "February",
4
+ "March",
5
+ "April",
6
+ "May",
7
+ "June",
8
+ "July",
9
+ "August",
10
+ "September",
11
+ "October",
12
+ "November",
13
+ "December"
14
+ ], r = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], u = {
15
+ SINGLE: "single",
16
+ RANGE: "range"
17
+ };
18
+ export {
19
+ r as DAYS_SHORT,
20
+ u as MODE,
21
+ e as MONTHS
22
+ };
@@ -0,0 +1,4 @@
1
+ import r from "./DatePicker.js";
2
+ export {
3
+ r as default
4
+ };
@@ -0,0 +1,264 @@
1
+ import n, { keyframes as i, css as s } from "styled-components";
2
+ const a = i`
3
+ from { opacity: 0; transform: translateY(6px); }
4
+ to { opacity: 1; transform: translateY(0); }
5
+ `, d = n.div`
6
+ display: inline-flex;
7
+ flex-direction: column;
8
+ background: #ffffff;
9
+ border-radius: 20px;
10
+ box-shadow:
11
+ 0 8px 40px rgba(0, 0, 0, 0.12),
12
+ 0 2px 8px rgba(0, 0, 0, 0.06);
13
+ padding: 20px;
14
+ width: 320px;
15
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
16
+ animation: ${a} 0.22s ease;
17
+ user-select: none;
18
+ `, c = n.div`
19
+ display: flex;
20
+ align-items: center;
21
+ gap: 8px;
22
+ margin-bottom: 16px;
23
+ `, f = n.div`
24
+ flex: 1;
25
+ background: ${({ $active: o, $primary: t }) => o ? t : "#f1f3f4"};
26
+ color: ${({ $active: o }) => o ? "#fff" : "#5f6368"};
27
+ border-radius: 12px;
28
+ padding: 10px 14px;
29
+ font-size: 13px;
30
+ font-weight: 500;
31
+ transition:
32
+ background 0.18s,
33
+ color 0.18s;
34
+
35
+ span {
36
+ display: block;
37
+ font-size: 10px;
38
+ font-weight: 600;
39
+ text-transform: uppercase;
40
+ letter-spacing: 0.6px;
41
+ opacity: 0.7;
42
+ margin-bottom: 2px;
43
+ }
44
+ `, l = n.div`
45
+ color: #bdc1c6;
46
+ font-size: 16px;
47
+ flex-shrink: 0;
48
+ `, x = n.div`
49
+ display: flex;
50
+ background: #f1f3f4;
51
+ border-radius: 10px;
52
+ padding: 3px;
53
+ margin-bottom: 16px;
54
+ `, u = n.button`
55
+ flex: 1;
56
+ border: none;
57
+ background: ${({ $active: o }) => o ? "#fff" : "transparent"};
58
+ color: ${({ $active: o, $primary: t }) => o ? t : "#5f6368"};
59
+ border-radius: 8px;
60
+ padding: 6px 0;
61
+ font-size: 12px;
62
+ font-weight: 600;
63
+ cursor: pointer;
64
+ transition:
65
+ background 0.15s,
66
+ color 0.15s;
67
+ box-shadow: ${({ $active: o }) => o ? "0 1px 4px rgba(0,0,0,0.1)" : "none"};
68
+
69
+ &:focus-visible {
70
+ outline: 2px solid ${({ $primary: o }) => o};
71
+ outline-offset: 2px;
72
+ }
73
+ `, g = n.div`
74
+ display: flex;
75
+ align-items: center;
76
+ justify-content: space-between;
77
+ margin-bottom: 12px;
78
+ `, b = n.button`
79
+ background: none;
80
+ border: none;
81
+ cursor: pointer;
82
+ width: 32px;
83
+ height: 32px;
84
+ border-radius: 50%;
85
+ display: flex;
86
+ align-items: center;
87
+ justify-content: center;
88
+ color: #5f6368;
89
+ transition:
90
+ background 0.15s,
91
+ color 0.15s;
92
+
93
+ &:hover {
94
+ background: #f1f3f4;
95
+ color: ${({ $primary: o }) => o};
96
+ }
97
+
98
+ &:focus-visible {
99
+ outline: 2px solid ${({ $primary: o }) => o};
100
+ }
101
+ `, m = n.button`
102
+ background: none;
103
+ border: none;
104
+ cursor: pointer;
105
+ font-size: 14px;
106
+ font-weight: 600;
107
+ color: #202124;
108
+ padding: 4px 8px;
109
+ border-radius: 8px;
110
+ transition: background 0.15s;
111
+
112
+ &:hover {
113
+ background: #f1f3f4;
114
+ }
115
+
116
+ &:focus-visible {
117
+ outline: 2px solid ${({ $primary: o }) => o};
118
+ }
119
+ `, y = n.div`
120
+ display: grid;
121
+ grid-template-columns: repeat(7, 1fr);
122
+ gap: 0;
123
+ `, h = n.div`
124
+ text-align: center;
125
+ font-size: 11px;
126
+ font-weight: 600;
127
+ color: #9aa0a6;
128
+ padding: 4px 0 8px;
129
+ text-transform: uppercase;
130
+ letter-spacing: 0.4px;
131
+ `, v = n.div`
132
+ position: relative;
133
+ display: flex;
134
+ align-items: center;
135
+ justify-content: center;
136
+ height: 36px;
137
+
138
+ &::before {
139
+ content: '';
140
+ position: absolute;
141
+ inset: 4px 0;
142
+ background: ${({ $inRange: o, $primaryLight: t }) => o ? t : "transparent"};
143
+ border-radius: ${({ $rangeStart: o, $rangeEnd: t }) => o ? "50% 0 0 50%" : t ? "0 50% 50% 0" : "0"};
144
+ pointer-events: none;
145
+ }
146
+ `, $ = n.button`
147
+ position: relative;
148
+ z-index: 1;
149
+ width: 32px;
150
+ height: 32px;
151
+ border: none;
152
+ border-radius: 50%;
153
+ display: flex;
154
+ align-items: center;
155
+ justify-content: center;
156
+ font-size: 13px;
157
+ font-weight: 500;
158
+ cursor: ${({ $empty: o, disabled: t }) => o || t ? "default" : "pointer"};
159
+ background: ${({ $selected: o, $hovered: t, $primary: e, $primaryLight: r }) => o ? e : t ? r : "transparent"};
160
+ color: ${({ $selected: o, $today: t, disabled: e, $primary: r }) => o ? "#fff" : e ? "#dadce0" : t ? r : "#202124"};
161
+ outline: ${({ $today: o, $selected: t, $primary: e }) => o && !t ? `2px solid ${e}` : "none"};
162
+ outline-offset: -2px;
163
+ transition:
164
+ background 0.12s,
165
+ color 0.12s;
166
+ pointer-events: ${({ $empty: o, disabled: t }) => o || t ? "none" : "auto"};
167
+
168
+ ${({ $empty: o }) => o && s`
169
+ visibility: hidden;
170
+ `}
171
+
172
+ &:hover {
173
+ background: ${({ $selected: o, $primary: t, $primaryDark: e, $primaryLight: r }) => o ? e : r};
174
+ }
175
+
176
+ &:focus-visible {
177
+ outline: 2px solid ${({ $primary: o }) => o};
178
+ }
179
+ `, k = n.div`
180
+ display: grid;
181
+ grid-template-columns: repeat(3, 1fr);
182
+ gap: 6px;
183
+ padding: 4px 0;
184
+ `, w = n.button`
185
+ border: none;
186
+ background: ${({ $active: o, $primary: t }) => o ? t : "transparent"};
187
+ color: ${({ $active: o }) => o ? "#fff" : "#202124"};
188
+ border-radius: 10px;
189
+ padding: 8px 4px;
190
+ font-size: 13px;
191
+ font-weight: 500;
192
+ cursor: pointer;
193
+ transition:
194
+ background 0.13s,
195
+ color 0.13s;
196
+
197
+ &:hover {
198
+ background: ${({ $active: o, $primaryDark: t }) => o ? t : "#f1f3f4"};
199
+ }
200
+
201
+ &:focus-visible {
202
+ outline: 2px solid ${({ $primary: o }) => o};
203
+ }
204
+ `, z = n.div`
205
+ display: grid;
206
+ grid-template-columns: repeat(3, 1fr);
207
+ gap: 6px;
208
+ max-height: 210px;
209
+ overflow-y: auto;
210
+ padding: 4px 0;
211
+ scrollbar-width: thin;
212
+ `, j = n.div`
213
+ display: flex;
214
+ justify-content: flex-end;
215
+ gap: 8px;
216
+ margin-top: 16px;
217
+ padding-top: 12px;
218
+ border-top: 1px solid #f1f3f4;
219
+ `, B = n.button`
220
+ border: none;
221
+ background: ${({ $isPrimary: o, $primary: t }) => o ? t : "transparent"};
222
+ color: ${({ $isPrimary: o, $primary: t }) => o ? "#fff" : t};
223
+ border-radius: 8px;
224
+ padding: 7px 16px;
225
+ font-size: 13px;
226
+ font-weight: 600;
227
+ cursor: pointer;
228
+ transition:
229
+ background 0.14s,
230
+ opacity 0.14s;
231
+
232
+ &:hover {
233
+ background: ${({ $isPrimary: o, $primaryDark: t, $primaryLight: e }) => o ? t : e};
234
+ }
235
+
236
+ &:disabled {
237
+ opacity: 0.4;
238
+ cursor: default;
239
+ }
240
+
241
+ &:focus-visible {
242
+ outline: 2px solid ${({ $primary: o }) => o};
243
+ }
244
+ `;
245
+ export {
246
+ B as ActionBtn,
247
+ f as DateChip,
248
+ $ as DayBtn,
249
+ v as DayCell,
250
+ h as DayHeader,
251
+ j as Footer,
252
+ y as Grid,
253
+ u as ModeBtn,
254
+ x as ModeToggle,
255
+ m as MonthLabel,
256
+ g as Nav,
257
+ b as NavBtn,
258
+ k as PickerGrid,
259
+ w as PickerItem,
260
+ l as RangeArrow,
261
+ c as SelectedDisplay,
262
+ d as Wrapper,
263
+ z as YearScroll
264
+ };
@@ -0,0 +1,21 @@
1
+ const i = (e, t) => new Date(e, t + 1, 0).getDate(), u = (e, t) => new Date(e, t, 1).getDay(), a = (e, t) => e && t && e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate(), c = (e) => a(e, /* @__PURE__ */ new Date()), g = (e, t, n) => {
2
+ if (!t || !n) return !1;
3
+ const [s, r] = t <= n ? [t, n] : [n, t];
4
+ return e > s && e < r;
5
+ }, l = (e, t, n) => !t || !n ? !1 : a(e, t <= n ? t : n), D = (e, t, n) => !t || !n ? !1 : a(e, t <= n ? n : t), f = (e) => e ? e.toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" }) : "—", y = (e, t) => {
6
+ const n = i(e, t), s = u(e, t), r = [];
7
+ for (let o = 0; o < s; o++) r.push(null);
8
+ for (let o = 1; o <= n; o++) r.push(new Date(e, t, o));
9
+ return r;
10
+ };
11
+ export {
12
+ y as buildCalendarGrid,
13
+ f as formatDate,
14
+ i as getDaysInMonth,
15
+ u as getFirstDayOfMonth,
16
+ g as isInRange,
17
+ D as isRangeEnd,
18
+ l as isRangeStart,
19
+ a as isSameDay,
20
+ c as isToday
21
+ };
@@ -1,8 +1,8 @@
1
- import { jsx as e, jsxs as d } from "react/jsx-runtime";
2
- import { useCallback as m, useEffect as h } from "react";
3
- import { createPortal as f } from "react-dom";
4
- import { Overlay as k, ModalContainer as v, ModalHeader as w, ModalTitle as x, CloseButton as b, ModalBody as g, ModalFooter as p } from "./styles.js";
5
- const C = () => /* @__PURE__ */ d(
1
+ import { jsx as t, jsxs as m } from "react/jsx-runtime";
2
+ import { useState as w, useRef as s, useId as j, useEffect as f, useCallback as T, isValidElement as A } from "react";
3
+ import { createPortal as B } from "react-dom";
4
+ import { Overlay as D, ModalContainer as K, ModalHeader as q, ModalTitle as F, CloseButton as H, ModalBody as P, ModalFooter as U } from "./styles.js";
5
+ const M = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])', V = () => /* @__PURE__ */ m(
6
6
  "svg",
7
7
  {
8
8
  width: "18",
@@ -13,49 +13,79 @@ const C = () => /* @__PURE__ */ d(
13
13
  strokeWidth: "2.5",
14
14
  strokeLinecap: "round",
15
15
  strokeLinejoin: "round",
16
+ "aria-hidden": "true",
16
17
  children: [
17
- /* @__PURE__ */ e("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
18
- /* @__PURE__ */ e("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
18
+ /* @__PURE__ */ t("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
19
+ /* @__PURE__ */ t("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
19
20
  ]
20
21
  }
21
- ), T = ({
22
- isOpen: n,
23
- onClose: o,
24
- title: l,
25
- children: c,
26
- footer: a,
27
- footerAlign: u = "right",
28
- width: y,
29
- closeOnOverlayClick: s = !0,
30
- showCloseButton: i = !0
22
+ ), Q = ({
23
+ isOpen: r,
24
+ onClose: l,
25
+ title: n,
26
+ children: R,
27
+ footer: h,
28
+ footerAlign: p = "right",
29
+ width: I,
30
+ closeOnOverlayClick: L = !0,
31
+ showCloseButton: y = !0,
32
+ isFullOnMobile: b = !1,
33
+ ...S
31
34
  }) => {
32
- const t = m(
33
- (r) => {
34
- r.key === "Escape" && o?.();
35
+ const [v, g] = w(r), [$, i] = w(!1), c = s(null), o = s(null), k = s(null), a = j();
36
+ f(() => (r ? (clearTimeout(c.current), k.current = document.activeElement, g(!0), i(!1)) : (i(!0), c.current = setTimeout(() => {
37
+ i(!1), g(!1), k.current?.focus();
38
+ }, 220)), () => clearTimeout(c.current)), [r]), f(() => {
39
+ if (!r || !o.current) return;
40
+ (o.current.querySelectorAll(M)[0] ?? o.current).focus();
41
+ }, [r, v]);
42
+ const x = T((e) => {
43
+ if (e.key !== "Tab" || !o.current) return;
44
+ const d = [...o.current.querySelectorAll(M)];
45
+ if (!d.length) return;
46
+ const C = d[0], E = d[d.length - 1];
47
+ e.shiftKey ? document.activeElement === C && (e.preventDefault(), E.focus()) : document.activeElement === E && (e.preventDefault(), C.focus());
48
+ }, []), u = T(
49
+ (e) => {
50
+ e.key === "Escape" && l?.(), x(e);
35
51
  },
36
- [o]
52
+ [l, x]
37
53
  );
38
- return h(() => {
39
- if (!n) return;
40
- document.addEventListener("keydown", t);
41
- const r = document.body.style.overflow;
54
+ return f(() => {
55
+ if (!r) return;
56
+ document.addEventListener("keydown", u);
57
+ const e = document.body.style.overflow;
42
58
  return document.body.style.overflow = "hidden", () => {
43
- document.removeEventListener("keydown", t), document.body.style.overflow = r;
59
+ document.removeEventListener("keydown", u), document.body.style.overflow = e;
44
60
  };
45
- }, [n, t]), n ? f(
46
- /* @__PURE__ */ e(k, { role: "dialog", "aria-modal": "true", "aria-label": l, onClick: (r) => {
47
- s && r.target === r.currentTarget && o?.();
48
- }, children: /* @__PURE__ */ d(v, { $width: y, children: [
49
- (l || i) && /* @__PURE__ */ d(w, { children: [
50
- l && /* @__PURE__ */ e(x, { children: l }),
51
- i && /* @__PURE__ */ e(b, { onClick: o, "aria-label": "Close modal", children: /* @__PURE__ */ e(C, {}) })
52
- ] }),
53
- /* @__PURE__ */ e(g, { children: c }),
54
- a && /* @__PURE__ */ e(p, { $align: u, children: a })
55
- ] }) }),
61
+ }, [r, u]), v ? B(
62
+ /* @__PURE__ */ t(D, { onClick: (e) => {
63
+ L && e.target === e.currentTarget && l?.();
64
+ }, $fullOnMobile: b, children: /* @__PURE__ */ m(
65
+ K,
66
+ {
67
+ ref: o,
68
+ role: "dialog",
69
+ "aria-modal": "true",
70
+ "aria-labelledby": n ? a : void 0,
71
+ tabIndex: -1,
72
+ $width: I,
73
+ $fullOnMobile: b,
74
+ $isClosing: $,
75
+ ...S,
76
+ children: [
77
+ (n || y) && /* @__PURE__ */ m(q, { children: [
78
+ n && (A(n) ? /* @__PURE__ */ t("div", { id: a, children: n }) : /* @__PURE__ */ t(F, { id: a, children: n })),
79
+ y && /* @__PURE__ */ t(H, { onClick: l, "aria-label": "Close modal", children: /* @__PURE__ */ t(V, {}) })
80
+ ] }),
81
+ /* @__PURE__ */ t(P, { children: R }),
82
+ h && /* @__PURE__ */ t(U, { $align: p, children: h })
83
+ ]
84
+ }
85
+ ) }),
56
86
  document.body
57
87
  ) : null;
58
88
  };
59
89
  export {
60
- T as default
90
+ Q as default
61
91
  };
@@ -1,13 +1,22 @@
1
- import o, { css as r, keyframes as n } from "styled-components";
2
- import e from "../../colors/grey.js";
3
- import i from "../../colors/white.js";
4
- const s = n`
1
+ import e, { css as n, keyframes as r } from "styled-components";
2
+ import t from "../../colors/grey.js";
3
+ import a from "../../colors/white.js";
4
+ const s = r`
5
5
  from { opacity: 0; }
6
6
  to { opacity: 1; }
7
- `, a = n`
8
- from { opacity: 0; transform: translateY(1.5rem); }
9
- to { opacity: 1; transform: translateY(0); }
10
- `, m = o.div`
7
+ `, d = r`
8
+ from { opacity: 0; transform: scale(0.95); }
9
+ to { opacity: 1; transform: scale(1); }
10
+ `, m = r`
11
+ from { opacity: 1; transform: scale(1); }
12
+ to { opacity: 0; transform: scale(0.95); }
13
+ `, l = r`
14
+ from { transform: translateY(100%); }
15
+ to { transform: translateY(0); }
16
+ `, c = r`
17
+ from { transform: translateY(0); }
18
+ to { transform: translateY(100%); }
19
+ `, g = e.div`
11
20
  position: fixed;
12
21
  inset: 0;
13
22
  background-color: rgba(0, 0, 0, 0.5);
@@ -17,30 +26,49 @@ const s = n`
17
26
  z-index: 1000;
18
27
  animation: ${s} 0.2s ease;
19
28
  padding: 1rem;
20
- `, f = o.div`
21
- background-color: ${i};
29
+
30
+ ${({ $fullOnMobile: o }) => o && n`
31
+ @media (max-width: 640px) {
32
+ align-items: flex-end;
33
+ padding: 0;
34
+ }
35
+ `}
36
+ `, h = e.div`
37
+ background-color: ${a};
22
38
  border-radius: 1rem;
23
39
  box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.2);
24
40
  display: flex;
25
41
  flex-direction: column;
26
42
  max-height: 90vh;
27
- width: ${({ $width: t }) => t || "32rem"};
43
+ width: ${({ $width: o }) => o || "32rem"};
28
44
  max-width: 100%;
29
- animation: ${a} 0.25s ease;
30
- `, p = o.div`
45
+ animation: ${({ $isClosing: o }) => o ? m : d} 0.3s ease forwards;
46
+
47
+ ${({ $fullOnMobile: o, $isClosing: i }) => o && n`
48
+ @media (max-width: 640px) {
49
+ width: 100%;
50
+ max-width: 100%;
51
+ max-height: 95dvh;
52
+ border-bottom-left-radius: 0;
53
+ border-bottom-right-radius: 0;
54
+ animation: ${i ? c : l} 0.22s
55
+ cubic-bezier(0.32, 0.72, 0, 1) ${i ? "forwards" : ""};
56
+ }
57
+ `}
58
+ `, u = e.div`
31
59
  display: flex;
32
60
  align-items: center;
33
61
  justify-content: space-between;
34
62
  padding: 1.25rem 1.5rem;
35
- border-bottom: 1px solid ${e.m200};
63
+ border-bottom: 1px solid ${t.m200};
36
64
  flex-shrink: 0;
37
- `, g = o.h2`
65
+ `, b = e.h2`
38
66
  margin: 0;
39
67
  font-size: 2.4rem;
40
68
  font-weight: 600;
41
- color: ${e.m900};
69
+ color: ${t.m900};
42
70
  line-height: 1.4;
43
- `, x = o.button`
71
+ `, y = e.button`
44
72
  background: none;
45
73
  border: none;
46
74
  cursor: pointer;
@@ -48,7 +76,7 @@ const s = n`
48
76
  display: flex;
49
77
  align-items: center;
50
78
  justify-content: center;
51
- color: ${e.m500};
79
+ color: ${t.m500};
52
80
  border-radius: 0.5rem;
53
81
  transition:
54
82
  background-color 0.15s,
@@ -56,44 +84,44 @@ const s = n`
56
84
  flex-shrink: 0;
57
85
 
58
86
  &:hover {
59
- background-color: ${e.m100};
60
- color: ${e.m800};
87
+ background-color: ${t.m100};
88
+ color: ${t.m800};
61
89
  }
62
90
 
63
91
  &:focus-visible {
64
- outline: 2px solid ${e.m400};
92
+ outline: 2px solid ${t.m400};
65
93
  outline-offset: 2px;
66
94
  }
67
- `, u = o.div`
95
+ `, $ = e.div`
68
96
  padding: 1.5rem;
69
97
  overflow-y: auto;
70
98
  flex: 1;
71
- color: ${e.m700};
99
+ color: ${t.m700};
72
100
  font-size: 0.95rem;
73
101
  line-height: 1.6;
74
- `, y = o.div`
102
+ `, w = e.div`
75
103
  display: flex;
76
104
  align-items: center;
77
105
  justify-content: flex-end;
78
106
  gap: 0.75rem;
79
107
  padding: 1rem 1.5rem;
80
- border-top: 1px solid ${e.m200};
108
+ border-top: 1px solid ${t.m200};
81
109
  flex-shrink: 0;
82
110
 
83
- ${({ $align: t }) => t === "left" && r`
111
+ ${({ $align: o }) => o === "left" && n`
84
112
  justify-content: flex-start;
85
113
  `}
86
114
 
87
- ${({ $align: t }) => t === "center" && r`
115
+ ${({ $align: o }) => o === "center" && n`
88
116
  justify-content: center;
89
117
  `}
90
118
  `;
91
119
  export {
92
- x as CloseButton,
93
- u as ModalBody,
94
- f as ModalContainer,
95
- y as ModalFooter,
96
- p as ModalHeader,
97
- g as ModalTitle,
98
- m as Overlay
120
+ y as CloseButton,
121
+ $ as ModalBody,
122
+ h as ModalContainer,
123
+ w as ModalFooter,
124
+ u as ModalHeader,
125
+ b as ModalTitle,
126
+ g as Overlay
99
127
  };
package/index.d.ts CHANGED
@@ -119,13 +119,16 @@ export declare const ToastContainer: React.FC<ToastContainerProps>;
119
119
  export interface ModalProps {
120
120
  isOpen: boolean;
121
121
  onClose: () => void;
122
- title?: string;
122
+ /** String or any React element (e.g. heading + badge). Strings are wrapped in the default ModalTitle style; elements are rendered as-is. */
123
+ title?: React.ReactNode;
123
124
  children?: React.ReactNode;
124
125
  footer?: React.ReactNode;
125
126
  footerAlign?: 'left' | 'center' | 'right';
126
127
  width?: string | number;
127
128
  closeOnOverlayClick?: boolean;
128
129
  showCloseButton?: boolean;
130
+ /** On viewports ≤ 640 px the modal fills the screen width and slides up from the bottom. On desktop it behaves as a normal centered modal. */
131
+ isFullOnMobile?: boolean;
129
132
  }
130
133
 
131
134
  export declare const Modal: React.FC<ModalProps>;
@@ -272,6 +275,36 @@ export interface DropdownProps extends Omit<React.HTMLAttributes<HTMLDivElement>
272
275
 
273
276
  export declare const Dropdown: React.FC<DropdownProps>;
274
277
 
278
+ // ---------------------------------------------------------------------------
279
+ // DatePicker
280
+ // ---------------------------------------------------------------------------
281
+
282
+ export type DatePickerMode = 'single' | 'range';
283
+
284
+ export interface DatePickerSingleProps {
285
+ mode?: 'single';
286
+ value?: Date | null;
287
+ rangeValue?: never;
288
+ onChange?: (value: Date | null) => void;
289
+ }
290
+
291
+ export interface DatePickerRangeProps {
292
+ mode: 'range';
293
+ value?: never;
294
+ rangeValue?: [Date | null, Date | null];
295
+ onChange?: (value: [Date, Date] | [null, null]) => void;
296
+ }
297
+
298
+ export type DatePickerProps = (DatePickerSingleProps | DatePickerRangeProps) & {
299
+ theme?: ThemeColor;
300
+ minDate?: Date;
301
+ maxDate?: Date;
302
+ showModeToggle?: boolean;
303
+ showFooter?: boolean;
304
+ };
305
+
306
+ export declare const DatePicker: React.FC<DatePickerProps>;
307
+
275
308
  // ---------------------------------------------------------------------------
276
309
  // Selectbox
277
310
  // ---------------------------------------------------------------------------
package/index.js CHANGED
@@ -4,46 +4,48 @@ import { default as p } from "./components/Spinner/Spinner.js";
4
4
  import { default as m } from "./components/Loader/Loader.js";
5
5
  import { default as s } from "./components/PageLoader/PageLoader.js";
6
6
  import { default as n } from "./components/OtpInput/OtpInput.js";
7
- import { default as g } from "./components/Dropdown/Dropdown.js";
8
- import { default as P } from "./components/RootComponent/RootComponent.js";
9
- import { default as I } from "./components/Selectbox/Selectbox.js";
10
- import { default as b } from "./components/Button/Button.js";
7
+ import { default as P } from "./components/Dropdown/Dropdown.js";
8
+ import { default as C } from "./components/RootComponent/RootComponent.js";
9
+ import { default as c } from "./components/Selectbox/Selectbox.js";
10
+ import { default as S } from "./components/Button/Button.js";
11
11
  import { default as h } from "./components/Modal/Modal.js";
12
- import { default as R } from "./components/Timer/Timer.js";
13
- import { default as w } from "./components/Shimmer/Shimmer.js";
14
- import { default as B } from "./components/VideoPlayer/VideoPlayer.js";
12
+ import { default as D } from "./components/Timer/Timer.js";
13
+ import { default as R } from "./components/Shimmer/Shimmer.js";
14
+ import { default as y } from "./components/VideoPlayer/VideoPlayer.js";
15
15
  import { default as F } from "./components/Image/Image.js";
16
16
  import { default as H } from "./components/Carousel/Carousel.js";
17
17
  import { default as O } from "./components/Typography/Headings/index.js";
18
18
  import { default as V } from "./components/Typography/P/P.js";
19
- import { default as q } from "./components/Input/Input/Input.js";
20
- import { default as z } from "./components/Input/Textarea/Textarea.js";
21
- import { default as E } from "./components/Input/Checkbox/Checkbox.js";
22
- import { default as K } from "./components/Input/RadioGroup/RadioGroup.js";
23
- import { default as Q } from "./components/Input/FileUploader/FileUploader.js";
19
+ import { default as q } from "./components/DatePicker/DatePicker.js";
20
+ import { default as z } from "./components/Input/Input/Input.js";
21
+ import { default as E } from "./components/Input/Textarea/Textarea.js";
22
+ import { default as K } from "./components/Input/Checkbox/Checkbox.js";
23
+ import { default as Q } from "./components/Input/RadioGroup/RadioGroup.js";
24
+ import { default as X } from "./components/Input/FileUploader/FileUploader.js";
24
25
  export {
25
- b as Button,
26
+ S as Button,
26
27
  H as Carousel,
27
- E as Checkbox,
28
- g as Dropdown,
29
- Q as FileUploader,
28
+ K as Checkbox,
29
+ q as DatePicker,
30
+ P as Dropdown,
31
+ X as FileUploader,
30
32
  O as Headings,
31
33
  F as Image,
32
- q as Input,
34
+ z as Input,
33
35
  m as Loader,
34
36
  h as Modal,
35
37
  n as OtpInput,
36
38
  V as P,
37
39
  s as PageLoader,
38
40
  a as Pagination,
39
- K as RadioGroup,
40
- P as RootComponent,
41
- I as Selectbox,
42
- w as Shimmer,
41
+ Q as RadioGroup,
42
+ C as RootComponent,
43
+ c as Selectbox,
44
+ R as Shimmer,
43
45
  p as Spinner,
44
- z as Textarea,
45
- R as Timer,
46
+ E as Textarea,
47
+ D as Timer,
46
48
  r as Toast,
47
49
  f as ToastContainer,
48
- B as VideoPlayer
50
+ y as VideoPlayer
49
51
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "meticulous-ui",
3
- "version": "3.5.3",
3
+ "version": "3.6.0",
4
4
  "license": "ISC",
5
5
  "description": "A comprehensive React UI component library with a wide range of customizable components, icons, colors, and utilities for building modern web applications.",
6
6
  "types": "./index.d.ts",