@bug-on/m3-expressive 1.2.1 → 1.2.3
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/CHANGELOG.md +12 -0
- package/dist/buttons.d.mts +26 -5
- package/dist/buttons.d.ts +26 -5
- package/dist/buttons.js +581 -345
- package/dist/buttons.js.map +1 -1
- package/dist/buttons.mjs +573 -345
- package/dist/buttons.mjs.map +1 -1
- package/dist/core.js +52 -13
- package/dist/core.js.map +1 -1
- package/dist/core.mjs +52 -13
- package/dist/core.mjs.map +1 -1
- package/dist/feedback.js +52 -13
- package/dist/feedback.js.map +1 -1
- package/dist/feedback.mjs +52 -13
- package/dist/feedback.mjs.map +1 -1
- package/dist/forms.js +4 -1
- package/dist/forms.js.map +1 -1
- package/dist/forms.mjs +4 -1
- package/dist/forms.mjs.map +1 -1
- package/dist/{icon-button-sSt6PPLg.d.mts → icon-button-CSsDmuQC.d.mts} +13 -0
- package/dist/{icon-button-sSt6PPLg.d.ts → icon-button-CSsDmuQC.d.ts} +13 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1483 -1027
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1342 -887
- package/dist/index.mjs.map +1 -1
- package/dist/layout.js +15 -7
- package/dist/layout.js.map +1 -1
- package/dist/layout.mjs +15 -7
- package/dist/layout.mjs.map +1 -1
- package/dist/navigation.d.mts +7 -1
- package/dist/navigation.d.ts +7 -1
- package/dist/navigation.js +281 -38
- package/dist/navigation.js.map +1 -1
- package/dist/navigation.mjs +281 -38
- package/dist/navigation.mjs.map +1 -1
- package/dist/overlays.js +52 -13
- package/dist/overlays.js.map +1 -1
- package/dist/overlays.mjs +52 -13
- package/dist/overlays.mjs.map +1 -1
- package/dist/pickers.js +177 -111
- package/dist/pickers.js.map +1 -1
- package/dist/pickers.mjs +177 -111
- package/dist/pickers.mjs.map +1 -1
- package/dist/{split-button-trailing-uncheckable-BcPD_7uK.d.ts → split-button-trailing-uncheckable-C-qQlyZx.d.ts} +74 -19
- package/dist/{split-button-trailing-uncheckable-DtFJkTFr.d.mts → split-button-trailing-uncheckable-DHJqNeq_.d.mts} +74 -19
- package/package.json +3 -3
package/dist/pickers.js
CHANGED
|
@@ -67,6 +67,97 @@ function cn(...inputs) {
|
|
|
67
67
|
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
+
// src/ui/shared/motion-tokens.ts
|
|
71
|
+
var FAST_SPATIAL_SPRING = {
|
|
72
|
+
type: "spring",
|
|
73
|
+
stiffness: 800,
|
|
74
|
+
damping: 33.94
|
|
75
|
+
};
|
|
76
|
+
var DEFAULT_SPATIAL_SPRING = {
|
|
77
|
+
type: "spring",
|
|
78
|
+
stiffness: 380,
|
|
79
|
+
damping: 31.19
|
|
80
|
+
};
|
|
81
|
+
var FAST_EFFECTS_SPRING = {
|
|
82
|
+
type: "spring",
|
|
83
|
+
stiffness: 3800,
|
|
84
|
+
damping: 123.29
|
|
85
|
+
};
|
|
86
|
+
var DEFAULT_EFFECTS_SPRING = {
|
|
87
|
+
type: "spring",
|
|
88
|
+
stiffness: 1600,
|
|
89
|
+
damping: 80
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
// src/ui/date-time-pickers/shared/animation-tokens.ts
|
|
93
|
+
var PICKER_OVERLAY_ANIM = {
|
|
94
|
+
initial: { opacity: 0 },
|
|
95
|
+
animate: {
|
|
96
|
+
opacity: 1,
|
|
97
|
+
transition: { duration: 0.2, ease: [0, 0, 0, 1] }
|
|
98
|
+
},
|
|
99
|
+
exit: {
|
|
100
|
+
opacity: 0,
|
|
101
|
+
transition: { duration: 0.15, ease: [0.3, 0, 1, 1] }
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
var PICKER_CONTENT_ANIM = {
|
|
105
|
+
initial: { opacity: 0, scale: 0.85, y: 16 },
|
|
106
|
+
animate: {
|
|
107
|
+
opacity: 1,
|
|
108
|
+
scale: 1,
|
|
109
|
+
y: 0,
|
|
110
|
+
transition: DEFAULT_SPATIAL_SPRING
|
|
111
|
+
},
|
|
112
|
+
exit: {
|
|
113
|
+
opacity: 0,
|
|
114
|
+
scale: 0.95,
|
|
115
|
+
y: 8,
|
|
116
|
+
transition: { duration: 0.15, ease: [0.3, 0, 1, 1] }
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
var CALENDAR_SLIDE_VARIANTS = {
|
|
120
|
+
enterFromRight: {
|
|
121
|
+
x: "100%",
|
|
122
|
+
opacity: 0
|
|
123
|
+
},
|
|
124
|
+
enterFromLeft: {
|
|
125
|
+
x: "-100%",
|
|
126
|
+
opacity: 0
|
|
127
|
+
},
|
|
128
|
+
center: {
|
|
129
|
+
x: 0,
|
|
130
|
+
opacity: 1,
|
|
131
|
+
transition: FAST_SPATIAL_SPRING
|
|
132
|
+
},
|
|
133
|
+
exitToLeft: {
|
|
134
|
+
x: "-100%",
|
|
135
|
+
opacity: 0,
|
|
136
|
+
transition: { duration: 0.15, ease: [0.3, 0, 1, 1] }
|
|
137
|
+
},
|
|
138
|
+
exitToRight: {
|
|
139
|
+
x: "100%",
|
|
140
|
+
opacity: 0,
|
|
141
|
+
transition: { duration: 0.15, ease: [0.3, 0, 1, 1] }
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
var PICKER_SELECTOR_ANIM = {
|
|
145
|
+
initial: { opacity: 0, scale: 0.95, y: -6 },
|
|
146
|
+
animate: {
|
|
147
|
+
opacity: 1,
|
|
148
|
+
scale: 1,
|
|
149
|
+
y: 0,
|
|
150
|
+
transition: DEFAULT_SPATIAL_SPRING
|
|
151
|
+
},
|
|
152
|
+
exit: {
|
|
153
|
+
opacity: 0,
|
|
154
|
+
scale: 0.95,
|
|
155
|
+
y: 6,
|
|
156
|
+
transition: { duration: 0.1, ease: "easeIn" }
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
var DAY_CELL_STATE_TRANSITION = FAST_EFFECTS_SPRING;
|
|
160
|
+
|
|
70
161
|
// src/ui/date-time-pickers/shared/calendar-model.ts
|
|
71
162
|
var startOfDayUTC = (ms) => {
|
|
72
163
|
const d = new Date(ms);
|
|
@@ -258,82 +349,6 @@ var DatePickerInput = ({
|
|
|
258
349
|
] }) }) });
|
|
259
350
|
};
|
|
260
351
|
DatePickerInput.displayName = "DatePickerInput";
|
|
261
|
-
|
|
262
|
-
// src/ui/shared/motion-tokens.ts
|
|
263
|
-
var FAST_SPATIAL_SPRING = {
|
|
264
|
-
type: "spring",
|
|
265
|
-
stiffness: 800,
|
|
266
|
-
damping: 33.94
|
|
267
|
-
};
|
|
268
|
-
var DEFAULT_SPATIAL_SPRING = {
|
|
269
|
-
type: "spring",
|
|
270
|
-
stiffness: 380,
|
|
271
|
-
damping: 31.19
|
|
272
|
-
};
|
|
273
|
-
var FAST_EFFECTS_SPRING = {
|
|
274
|
-
type: "spring",
|
|
275
|
-
stiffness: 3800,
|
|
276
|
-
damping: 123.29
|
|
277
|
-
};
|
|
278
|
-
var DEFAULT_EFFECTS_SPRING = {
|
|
279
|
-
type: "spring",
|
|
280
|
-
stiffness: 1600,
|
|
281
|
-
damping: 80
|
|
282
|
-
};
|
|
283
|
-
|
|
284
|
-
// src/ui/date-time-pickers/shared/animation-tokens.ts
|
|
285
|
-
var PICKER_OVERLAY_ANIM = {
|
|
286
|
-
initial: { opacity: 0 },
|
|
287
|
-
animate: {
|
|
288
|
-
opacity: 1,
|
|
289
|
-
transition: { duration: 0.2, ease: [0, 0, 0, 1] }
|
|
290
|
-
},
|
|
291
|
-
exit: {
|
|
292
|
-
opacity: 0,
|
|
293
|
-
transition: { duration: 0.15, ease: [0.3, 0, 1, 1] }
|
|
294
|
-
}
|
|
295
|
-
};
|
|
296
|
-
var PICKER_CONTENT_ANIM = {
|
|
297
|
-
initial: { opacity: 0, scale: 0.85, y: 16 },
|
|
298
|
-
animate: {
|
|
299
|
-
opacity: 1,
|
|
300
|
-
scale: 1,
|
|
301
|
-
y: 0,
|
|
302
|
-
transition: DEFAULT_SPATIAL_SPRING
|
|
303
|
-
},
|
|
304
|
-
exit: {
|
|
305
|
-
opacity: 0,
|
|
306
|
-
scale: 0.95,
|
|
307
|
-
y: 8,
|
|
308
|
-
transition: { duration: 0.15, ease: [0.3, 0, 1, 1] }
|
|
309
|
-
}
|
|
310
|
-
};
|
|
311
|
-
var CALENDAR_SLIDE_VARIANTS = {
|
|
312
|
-
enterFromRight: {
|
|
313
|
-
x: "100%",
|
|
314
|
-
opacity: 0
|
|
315
|
-
},
|
|
316
|
-
enterFromLeft: {
|
|
317
|
-
x: "-100%",
|
|
318
|
-
opacity: 0
|
|
319
|
-
},
|
|
320
|
-
center: {
|
|
321
|
-
x: 0,
|
|
322
|
-
opacity: 1,
|
|
323
|
-
transition: FAST_SPATIAL_SPRING
|
|
324
|
-
},
|
|
325
|
-
exitToLeft: {
|
|
326
|
-
x: "-100%",
|
|
327
|
-
opacity: 0,
|
|
328
|
-
transition: { duration: 0.15, ease: [0.3, 0, 1, 1] }
|
|
329
|
-
},
|
|
330
|
-
exitToRight: {
|
|
331
|
-
x: "100%",
|
|
332
|
-
opacity: 0,
|
|
333
|
-
transition: { duration: 0.15, ease: [0.3, 0, 1, 1] }
|
|
334
|
-
}
|
|
335
|
-
};
|
|
336
|
-
var DAY_CELL_STATE_TRANSITION = FAST_EFFECTS_SPRING;
|
|
337
352
|
var DayCell = ({
|
|
338
353
|
day,
|
|
339
354
|
selectedMs,
|
|
@@ -1489,7 +1504,10 @@ function useRippleState(options = {}) {
|
|
|
1489
1504
|
const rect = e.currentTarget.getBoundingClientRect();
|
|
1490
1505
|
const x = e.clientX - rect.left;
|
|
1491
1506
|
const y = e.clientY - rect.top;
|
|
1492
|
-
const rippleSize = Math.
|
|
1507
|
+
const rippleSize = Math.max(
|
|
1508
|
+
Math.hypot(rect.width, rect.height) * 2.5,
|
|
1509
|
+
320
|
|
1510
|
+
);
|
|
1493
1511
|
setRipples((prev) => [
|
|
1494
1512
|
...prev,
|
|
1495
1513
|
{ id: Date.now(), x, y, size: rippleSize }
|
|
@@ -1520,12 +1538,39 @@ function TouchTarget() {
|
|
|
1520
1538
|
}
|
|
1521
1539
|
);
|
|
1522
1540
|
}
|
|
1523
|
-
var
|
|
1524
|
-
xs: "h-8
|
|
1525
|
-
sm: "h-10
|
|
1526
|
-
md: "h-14
|
|
1527
|
-
lg: "h-24
|
|
1528
|
-
xl: "h-[8.5rem]
|
|
1541
|
+
var SIZE_HEIGHT_STYLES = {
|
|
1542
|
+
xs: "h-8",
|
|
1543
|
+
sm: "h-10",
|
|
1544
|
+
md: "h-14",
|
|
1545
|
+
lg: "h-24",
|
|
1546
|
+
xl: "h-[8.5rem]"
|
|
1547
|
+
};
|
|
1548
|
+
var WIDTH_SIZE_STYLES = {
|
|
1549
|
+
xs: {
|
|
1550
|
+
default: "w-8",
|
|
1551
|
+
narrow: "w-8",
|
|
1552
|
+
wide: "w-12"
|
|
1553
|
+
},
|
|
1554
|
+
sm: {
|
|
1555
|
+
default: "w-10",
|
|
1556
|
+
narrow: "w-12",
|
|
1557
|
+
wide: "w-[3.25rem]"
|
|
1558
|
+
},
|
|
1559
|
+
md: {
|
|
1560
|
+
default: "w-14",
|
|
1561
|
+
narrow: "w-12",
|
|
1562
|
+
wide: "w-[4.5rem]"
|
|
1563
|
+
},
|
|
1564
|
+
lg: {
|
|
1565
|
+
default: "w-24",
|
|
1566
|
+
narrow: "w-16",
|
|
1567
|
+
wide: "w-32"
|
|
1568
|
+
},
|
|
1569
|
+
xl: {
|
|
1570
|
+
default: "w-[8.5rem]",
|
|
1571
|
+
narrow: "w-[6.5rem]",
|
|
1572
|
+
wide: "w-[11.5rem]"
|
|
1573
|
+
}
|
|
1529
1574
|
};
|
|
1530
1575
|
var SIZE_ICON = {
|
|
1531
1576
|
xs: { cls: "size-5", px: 20 },
|
|
@@ -1626,8 +1671,10 @@ var IconButtonComponent = React13__namespace.forwardRef(
|
|
|
1626
1671
|
variant = "default",
|
|
1627
1672
|
colorStyle = "standard",
|
|
1628
1673
|
size = "sm",
|
|
1674
|
+
widthVariant = "default",
|
|
1629
1675
|
shape = "round",
|
|
1630
1676
|
selected,
|
|
1677
|
+
selectedIcon,
|
|
1631
1678
|
loading = false,
|
|
1632
1679
|
loadingVariant = "loading-indicator",
|
|
1633
1680
|
iconSize,
|
|
@@ -1642,8 +1689,10 @@ var IconButtonComponent = React13__namespace.forwardRef(
|
|
|
1642
1689
|
"variant",
|
|
1643
1690
|
"colorStyle",
|
|
1644
1691
|
"size",
|
|
1692
|
+
"widthVariant",
|
|
1645
1693
|
"shape",
|
|
1646
1694
|
"selected",
|
|
1695
|
+
"selectedIcon",
|
|
1647
1696
|
"loading",
|
|
1648
1697
|
"loadingVariant",
|
|
1649
1698
|
"iconSize",
|
|
@@ -1653,7 +1702,7 @@ var IconButtonComponent = React13__namespace.forwardRef(
|
|
|
1653
1702
|
"onKeyDown",
|
|
1654
1703
|
"aria-label"
|
|
1655
1704
|
]);
|
|
1656
|
-
var _a2, _b2;
|
|
1705
|
+
var _a2, _b2, _c, _d, _e;
|
|
1657
1706
|
const isToggle = variant === "toggle";
|
|
1658
1707
|
const isSelected = isToggle && !!selected;
|
|
1659
1708
|
const resolvedColorClass = React13__namespace.useMemo(
|
|
@@ -1684,6 +1733,8 @@ var IconButtonComponent = React13__namespace.forwardRef(
|
|
|
1684
1733
|
const defaultIconPx = sizeIcon.px;
|
|
1685
1734
|
const iconPx = iconSize != null ? iconSize : defaultIconPx;
|
|
1686
1735
|
const isCustomSize = iconSize != null && iconSize !== "inherit";
|
|
1736
|
+
const heightClass = (_c = SIZE_HEIGHT_STYLES[size]) != null ? _c : SIZE_HEIGHT_STYLES.sm;
|
|
1737
|
+
const widthClass = (_e = ((_d = WIDTH_SIZE_STYLES[size]) != null ? _d : WIDTH_SIZE_STYLES.sm)[widthVariant]) != null ? _e : WIDTH_SIZE_STYLES.sm.default;
|
|
1687
1738
|
const needsTouchTarget = size === "xs" || size === "sm";
|
|
1688
1739
|
const { ripples, onPointerDown, removeRipple } = useRippleState({
|
|
1689
1740
|
disabled: loading
|
|
@@ -1746,7 +1797,7 @@ var IconButtonComponent = React13__namespace.forwardRef(
|
|
|
1746
1797
|
transition: SPRING_TRANSITION,
|
|
1747
1798
|
"aria-hidden": "true",
|
|
1748
1799
|
className: cn(
|
|
1749
|
-
"flex items-center justify-center shrink-0 [&_svg]:w-full [&_svg]:h-full [&_.md-icon]:text-[length:inherit]
|
|
1800
|
+
"flex items-center justify-center shrink-0 [&_svg]:w-full [&_svg]:h-full [&_.md-icon]:text-[length:inherit]",
|
|
1750
1801
|
iconSize != null ? void 0 : iconClass
|
|
1751
1802
|
),
|
|
1752
1803
|
style: {
|
|
@@ -1754,9 +1805,9 @@ var IconButtonComponent = React13__namespace.forwardRef(
|
|
|
1754
1805
|
width: isCustomSize ? `${iconSize}px` : void 0,
|
|
1755
1806
|
height: isCustomSize ? `${iconSize}px` : void 0
|
|
1756
1807
|
},
|
|
1757
|
-
children: asChild ? React13__namespace.Children.only(children).props.children : children
|
|
1808
|
+
children: isSelected && selectedIcon ? selectedIcon : asChild ? React13__namespace.Children.only(children).props.children : children
|
|
1758
1809
|
}),
|
|
1759
|
-
"content"
|
|
1810
|
+
isSelected && selectedIcon ? "selected-content" : "content"
|
|
1760
1811
|
) })
|
|
1761
1812
|
] });
|
|
1762
1813
|
const containerClassName = cn(
|
|
@@ -1765,7 +1816,8 @@ var IconButtonComponent = React13__namespace.forwardRef(
|
|
|
1765
1816
|
outlineWidthClass,
|
|
1766
1817
|
disabledBgClass,
|
|
1767
1818
|
"overflow-hidden",
|
|
1768
|
-
|
|
1819
|
+
heightClass,
|
|
1820
|
+
widthClass,
|
|
1769
1821
|
loading && "pointer-events-none opacity-75 cursor-not-allowed",
|
|
1770
1822
|
className
|
|
1771
1823
|
);
|
|
@@ -1782,7 +1834,9 @@ var IconButtonComponent = React13__namespace.forwardRef(
|
|
|
1782
1834
|
onClick: handleClick,
|
|
1783
1835
|
onPointerDown,
|
|
1784
1836
|
onKeyDown: handleKeyDown,
|
|
1785
|
-
style: __spreadProps(__spreadValues({}, style), {
|
|
1837
|
+
style: __spreadProps(__spreadValues({}, style), {
|
|
1838
|
+
borderRadius: `${animateRadius}px`
|
|
1839
|
+
}),
|
|
1786
1840
|
className: containerClassName
|
|
1787
1841
|
}, restProps), {
|
|
1788
1842
|
children: React13__namespace.cloneElement(child, { children: innerContent })
|
|
@@ -1913,16 +1967,16 @@ var CalendarHeader = ({
|
|
|
1913
1967
|
}).format(date);
|
|
1914
1968
|
const yearLabel = String(date.getUTCFullYear());
|
|
1915
1969
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1 px-6 pb-4 pt-5", children: [
|
|
1916
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-
|
|
1917
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-2 leading-tight text-
|
|
1918
|
-
displayMode === "picker" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "
|
|
1970
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-(length:--md-typescale-label-large-size,14px) font-(--md-typescale-label-large-weight,500) text-m3-on-surface-variant", children: title }),
|
|
1971
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-2 leading-tight text-(length:--md-typescale-headline-large-size,32px) font-(--md-typescale-headline-large-weight,400) text-m3-on-surface-variant", children: headline }),
|
|
1972
|
+
displayMode === "picker" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-h-10 items-center gap-0.5", children: [
|
|
1919
1973
|
activeSelector === null && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1920
1974
|
IconButton,
|
|
1921
1975
|
{
|
|
1922
1976
|
onClick: onPrev,
|
|
1923
1977
|
"aria-label": "Previous month",
|
|
1924
1978
|
disabled: !canNavigatePrev,
|
|
1925
|
-
size: "
|
|
1979
|
+
size: "xs",
|
|
1926
1980
|
children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "chevron_left" })
|
|
1927
1981
|
}
|
|
1928
1982
|
),
|
|
@@ -1944,7 +1998,7 @@ var CalendarHeader = ({
|
|
|
1944
1998
|
{
|
|
1945
1999
|
name: "arrow_drop_down",
|
|
1946
2000
|
className: cn(
|
|
1947
|
-
"text-[20px]",
|
|
2001
|
+
"text-[20px] transition-transform duration-200",
|
|
1948
2002
|
activeSelector === "month" && "rotate-180"
|
|
1949
2003
|
)
|
|
1950
2004
|
}
|
|
@@ -1958,7 +2012,7 @@ var CalendarHeader = ({
|
|
|
1958
2012
|
onClick: onNext,
|
|
1959
2013
|
"aria-label": "Next month",
|
|
1960
2014
|
disabled: !canNavigateNext,
|
|
1961
|
-
size: "
|
|
2015
|
+
size: "xs",
|
|
1962
2016
|
children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "chevron_right" })
|
|
1963
2017
|
}
|
|
1964
2018
|
),
|
|
@@ -1969,7 +2023,7 @@ var CalendarHeader = ({
|
|
|
1969
2023
|
onClick: onPreviousYear,
|
|
1970
2024
|
"aria-label": "Previous year",
|
|
1971
2025
|
disabled: !canNavigatePreviousYear,
|
|
1972
|
-
size: "
|
|
2026
|
+
size: "xs",
|
|
1973
2027
|
children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "chevron_left" })
|
|
1974
2028
|
}
|
|
1975
2029
|
),
|
|
@@ -1991,7 +2045,7 @@ var CalendarHeader = ({
|
|
|
1991
2045
|
{
|
|
1992
2046
|
name: "arrow_drop_down",
|
|
1993
2047
|
className: cn(
|
|
1994
|
-
"text-[20px]",
|
|
2048
|
+
"text-[20px] transition-transform duration-200",
|
|
1995
2049
|
activeSelector === "year" && "rotate-180"
|
|
1996
2050
|
)
|
|
1997
2051
|
}
|
|
@@ -2005,7 +2059,7 @@ var CalendarHeader = ({
|
|
|
2005
2059
|
onClick: onNextYear,
|
|
2006
2060
|
"aria-label": "Next year",
|
|
2007
2061
|
disabled: !canNavigateNextYear,
|
|
2008
|
-
size: "
|
|
2062
|
+
size: "xs",
|
|
2009
2063
|
children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "chevron_right" })
|
|
2010
2064
|
}
|
|
2011
2065
|
),
|
|
@@ -2014,7 +2068,7 @@ var CalendarHeader = ({
|
|
|
2014
2068
|
{
|
|
2015
2069
|
onClick: onToggleMode,
|
|
2016
2070
|
"aria-label": "Switch to text input",
|
|
2017
|
-
size: "
|
|
2071
|
+
size: "xs",
|
|
2018
2072
|
children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "keyboard" })
|
|
2019
2073
|
}
|
|
2020
2074
|
)
|
|
@@ -2025,7 +2079,7 @@ var CalendarHeader = ({
|
|
|
2025
2079
|
{
|
|
2026
2080
|
onClick: onToggleMode,
|
|
2027
2081
|
"aria-label": "Switch to calendar",
|
|
2028
|
-
size: "
|
|
2082
|
+
size: "xs",
|
|
2029
2083
|
className: "self-end",
|
|
2030
2084
|
children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "calendar_month" })
|
|
2031
2085
|
}
|
|
@@ -2288,9 +2342,12 @@ var DatePicker = ({
|
|
|
2288
2342
|
"input-mode"
|
|
2289
2343
|
)
|
|
2290
2344
|
) : activeSelector === "month" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2291
|
-
|
|
2345
|
+
react.m.div,
|
|
2292
2346
|
{
|
|
2293
2347
|
id: "date-picker-selection",
|
|
2348
|
+
initial: PICKER_SELECTOR_ANIM.initial,
|
|
2349
|
+
animate: PICKER_SELECTOR_ANIM.animate,
|
|
2350
|
+
exit: PICKER_SELECTOR_ANIM.exit,
|
|
2294
2351
|
className: "absolute inset-0",
|
|
2295
2352
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2296
2353
|
MonthPickerList,
|
|
@@ -2303,9 +2360,12 @@ var DatePicker = ({
|
|
|
2303
2360
|
},
|
|
2304
2361
|
"month-list"
|
|
2305
2362
|
) : activeSelector === "year" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2306
|
-
|
|
2363
|
+
react.m.div,
|
|
2307
2364
|
{
|
|
2308
2365
|
id: "date-picker-selection",
|
|
2366
|
+
initial: PICKER_SELECTOR_ANIM.initial,
|
|
2367
|
+
animate: PICKER_SELECTOR_ANIM.animate,
|
|
2368
|
+
exit: PICKER_SELECTOR_ANIM.exit,
|
|
2309
2369
|
className: "absolute inset-0",
|
|
2310
2370
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2311
2371
|
YearPickerList,
|
|
@@ -2938,9 +2998,12 @@ var DateRangePicker = ({
|
|
|
2938
2998
|
className: "relative flex-1 overflow-hidden",
|
|
2939
2999
|
style: { minHeight: "296px" },
|
|
2940
3000
|
children: /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { mode: "wait", children: activeSelector === "month" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2941
|
-
|
|
3001
|
+
react.m.div,
|
|
2942
3002
|
{
|
|
2943
3003
|
id: "date-picker-selection",
|
|
3004
|
+
initial: PICKER_SELECTOR_ANIM.initial,
|
|
3005
|
+
animate: PICKER_SELECTOR_ANIM.animate,
|
|
3006
|
+
exit: PICKER_SELECTOR_ANIM.exit,
|
|
2944
3007
|
className: "absolute inset-0",
|
|
2945
3008
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2946
3009
|
MonthPickerList,
|
|
@@ -2953,9 +3016,12 @@ var DateRangePicker = ({
|
|
|
2953
3016
|
},
|
|
2954
3017
|
"month-list"
|
|
2955
3018
|
) : activeSelector === "year" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2956
|
-
|
|
3019
|
+
react.m.div,
|
|
2957
3020
|
{
|
|
2958
3021
|
id: "date-picker-selection",
|
|
3022
|
+
initial: PICKER_SELECTOR_ANIM.initial,
|
|
3023
|
+
animate: PICKER_SELECTOR_ANIM.animate,
|
|
3024
|
+
exit: PICKER_SELECTOR_ANIM.exit,
|
|
2959
3025
|
className: "absolute inset-0",
|
|
2960
3026
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2961
3027
|
YearPickerList,
|
|
@@ -4124,7 +4190,7 @@ var TimePickerDialog = ({
|
|
|
4124
4190
|
TimePickerDialog.displayName = "TimePickerDialog";
|
|
4125
4191
|
var clamp = (value, min, max) => Math.max(min, Math.min(max, value));
|
|
4126
4192
|
var isValidHourInput = (h, is24hour) => is24hour ? h >= 0 && h <= 23 : h >= 1 && h <= 12;
|
|
4127
|
-
var isValidMinuteInput = (
|
|
4193
|
+
var isValidMinuteInput = (m13) => m13 >= 0 && m13 <= 59;
|
|
4128
4194
|
var to24Hour = (hour12, isPm) => {
|
|
4129
4195
|
if (isPm) {
|
|
4130
4196
|
return hour12 === 12 ? 12 : hour12 + 12;
|
|
@@ -4160,8 +4226,8 @@ var useTimePickerState = (options) => {
|
|
|
4160
4226
|
},
|
|
4161
4227
|
[is24hour]
|
|
4162
4228
|
);
|
|
4163
|
-
const setMinute = React13.useCallback((
|
|
4164
|
-
const clamped = clamp(
|
|
4229
|
+
const setMinute = React13.useCallback((m13) => {
|
|
4230
|
+
const clamped = clamp(m13, 0, 59);
|
|
4165
4231
|
setMinuteState(clamped);
|
|
4166
4232
|
setMinuteInputState(clamped);
|
|
4167
4233
|
}, []);
|
|
@@ -4175,10 +4241,10 @@ var useTimePickerState = (options) => {
|
|
|
4175
4241
|
},
|
|
4176
4242
|
[is24hour, isPm]
|
|
4177
4243
|
);
|
|
4178
|
-
const setMinuteInput = React13.useCallback((
|
|
4179
|
-
setMinuteInputState(
|
|
4180
|
-
if (isValidMinuteInput(
|
|
4181
|
-
setMinuteState(
|
|
4244
|
+
const setMinuteInput = React13.useCallback((m13) => {
|
|
4245
|
+
setMinuteInputState(m13);
|
|
4246
|
+
if (isValidMinuteInput(m13)) {
|
|
4247
|
+
setMinuteState(m13);
|
|
4182
4248
|
}
|
|
4183
4249
|
}, []);
|
|
4184
4250
|
const setSelection = React13.useCallback((mode) => {
|