meticulous-ui 3.5.4 → 3.6.1

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, Escape/overlay-click dismissal, and mobile bottom-sheet mode |
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
 
@@ -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
+ };
package/index.d.ts CHANGED
@@ -275,6 +275,36 @@ export interface DropdownProps extends Omit<React.HTMLAttributes<HTMLDivElement>
275
275
 
276
276
  export declare const Dropdown: React.FC<DropdownProps>;
277
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
+
278
308
  // ---------------------------------------------------------------------------
279
309
  // Selectbox
280
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.4",
3
+ "version": "3.6.1",
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",