@yr3/ui 1.0.19 → 1.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Collapse/collapse.css +0 -1
- package/dist/components/Collapse/collapse.css.map +1 -1
- package/dist/components/Date/month.css +16 -2
- package/dist/components/Date/month.css.map +1 -1
- package/dist/components/Picker/picker.css +124 -0
- package/dist/components/Picker/picker.css.map +1 -0
- package/dist/index.cjs +292 -101
- package/dist/index.d.cts +72 -15
- package/dist/index.d.ts +72 -15
- package/dist/index.js +291 -101
- package/dist/styles/index.css +139 -3
- package/dist/styles/index.css.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -29,6 +29,8 @@ var bemMerge = (...args) => {
|
|
|
29
29
|
|
|
30
30
|
// src/utils/calendar.ts
|
|
31
31
|
import dayjs from "dayjs";
|
|
32
|
+
import updatelocale from "dayjs/plugin/updateLocale";
|
|
33
|
+
dayjs.extend(updatelocale);
|
|
32
34
|
function getMonthCalendar(year, month, startIndex, selected, props) {
|
|
33
35
|
const today = dayjs().startOf("day");
|
|
34
36
|
const startOfMonth = dayjs().year(year).month(month).startOf("month");
|
|
@@ -102,17 +104,23 @@ function getMonthCalendar(year, month, startIndex, selected, props) {
|
|
|
102
104
|
currentDay: dayCurrent
|
|
103
105
|
};
|
|
104
106
|
}
|
|
105
|
-
function getMonthCalendarProps({ year,
|
|
107
|
+
function getMonthCalendarProps({ year, data, value, daysFormat }) {
|
|
106
108
|
const startIndex = dayjs().year(year).month().valueOf();
|
|
109
|
+
dayjs.updateLocale("en", {
|
|
110
|
+
months: daysFormat?.months || ["jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"]
|
|
111
|
+
});
|
|
107
112
|
return {
|
|
108
|
-
month: dayjs().set("m", month).format(formatMonth || "MMM"),
|
|
109
113
|
year,
|
|
110
114
|
startIndex,
|
|
111
|
-
years,
|
|
115
|
+
years: data.years,
|
|
116
|
+
value,
|
|
117
|
+
last: !value ? "" : dayjs().year(Number(value?.split("-")[1])).month(Number(value?.split("-")[0]) - 2).format("MM-YYYY"),
|
|
118
|
+
prev: !value ? "" : dayjs().year(Number(value?.split("-")[1])).month(Number(value?.split("-")[0])).format("MM-YYYY"),
|
|
112
119
|
months: Array.from({ length: 12 }, (_, i) => ({
|
|
113
|
-
label: dayjs().month(i).format(
|
|
114
|
-
value: dayjs().month(i).format("MM"),
|
|
115
|
-
disabled: dayjs().year(year).month(i).isAfter(dayjs(), "month") ||
|
|
120
|
+
label: dayjs().month(i).format(daysFormat?.month || "MMM"),
|
|
121
|
+
value: dayjs().month(i).format(daysFormat?.value || "MM"),
|
|
122
|
+
disabled: dayjs().year(year).month(i).isAfter(dayjs(), "month") || data.exclude.find((e) => e.year === year)?.months.includes(i),
|
|
123
|
+
selected: !data.selected ? false : dayjs().year(year).month(Number(value?.split("-")[0]) - 1).format("MM") === dayjs().month(i).format(daysFormat?.value || "MM")
|
|
116
124
|
}))
|
|
117
125
|
};
|
|
118
126
|
}
|
|
@@ -1678,16 +1686,29 @@ var initialPropsComponent3 = {
|
|
|
1678
1686
|
style: {}
|
|
1679
1687
|
}
|
|
1680
1688
|
};
|
|
1681
|
-
var MonthSelector = ({ label,
|
|
1689
|
+
var MonthSelector = ({ label, value, disabled, propsComponent, data, daysFormat, onNext, onLast, onChange }) => {
|
|
1682
1690
|
const [open, setOpen] = React10.useState(false);
|
|
1683
|
-
const [valueState, setValueState] = React10.useState(value ||
|
|
1684
|
-
const [yearSelected, setYearSelected] = React10.useState(years.findIndex((y) => y === year) || 0);
|
|
1691
|
+
const [valueState, setValueState] = React10.useState(value || null);
|
|
1692
|
+
const [yearSelected, setYearSelected] = React10.useState(data?.years.findIndex((y) => y === data.year) || 0);
|
|
1685
1693
|
const ref = React10.useRef(null);
|
|
1686
1694
|
useClickAway(ref, () => setOpen(false));
|
|
1687
1695
|
const properties = mergeDeep(initialPropsComponent3, propsComponent || {});
|
|
1688
1696
|
const iconClasses = monthSelectorIconVariants({ color: properties?.icon?.color });
|
|
1689
1697
|
const containerClasses = monthSelectorContainerVariants({ color: properties?.container?.color });
|
|
1690
|
-
const
|
|
1698
|
+
const getData = React10.useMemo(() => {
|
|
1699
|
+
if (!disabled) return {};
|
|
1700
|
+
return getMonthCalendarProps({ year: data.years[yearSelected], data, daysFormat, value: valueState });
|
|
1701
|
+
}, [yearSelected, data, daysFormat, valueState, disabled]);
|
|
1702
|
+
React10.useEffect(() => {
|
|
1703
|
+
if (onNext) onNext(getData.prev);
|
|
1704
|
+
if (onLast) onLast(getData.last);
|
|
1705
|
+
}, [getData]);
|
|
1706
|
+
React10.useEffect(() => {
|
|
1707
|
+
setValueState(value || null);
|
|
1708
|
+
}, [value]);
|
|
1709
|
+
React10.useEffect(() => {
|
|
1710
|
+
if (onChange && valueState && !disabled) onChange(valueState);
|
|
1711
|
+
}, [valueState, onChange, disabled]);
|
|
1691
1712
|
return /* @__PURE__ */ jsxs6("div", { className: "yr3MonthSelector", ref, children: [
|
|
1692
1713
|
/* @__PURE__ */ jsx24(
|
|
1693
1714
|
Input,
|
|
@@ -1707,7 +1728,7 @@ var MonthSelector = ({ label, year, month, value, defaultValue, propsComponent,
|
|
|
1707
1728
|
{
|
|
1708
1729
|
className: iconClasses,
|
|
1709
1730
|
style: properties?.icon?.style,
|
|
1710
|
-
onClick: () => setOpen((prev) => !prev),
|
|
1731
|
+
onClick: () => !disabled && setOpen((prev) => !prev),
|
|
1711
1732
|
"data-testid": "yr3MonthSelector--icon",
|
|
1712
1733
|
children: properties?.icon?.component ? properties?.icon.component : /* @__PURE__ */ jsx24(
|
|
1713
1734
|
IconCalendar,
|
|
@@ -1733,17 +1754,26 @@ var MonthSelector = ({ label, year, month, value, defaultValue, propsComponent,
|
|
|
1733
1754
|
className: containerClasses,
|
|
1734
1755
|
style: composeStyles(properties?.container?.ui, properties?.container?.style),
|
|
1735
1756
|
children: [
|
|
1736
|
-
/* @__PURE__ */ jsx24(
|
|
1757
|
+
/* @__PURE__ */ jsx24(
|
|
1758
|
+
"button",
|
|
1759
|
+
{
|
|
1760
|
+
disabled: disabled || yearSelected === 0,
|
|
1761
|
+
type: "button",
|
|
1762
|
+
className: `yr3MonthSelector--year-button-back ${yearSelected === 0 ? "yr3MonthSelector--year-button-back--disabled" : ""} `,
|
|
1763
|
+
onClick: () => setYearSelected(yearSelected - 1),
|
|
1764
|
+
children: /* @__PURE__ */ jsx24(IconLeft, { width: 20, height: 20, stroke: "currentColor" })
|
|
1765
|
+
}
|
|
1766
|
+
),
|
|
1737
1767
|
/* @__PURE__ */ jsx24("div", { className: `yr3MonthSelector--year-option`, children: /* @__PURE__ */ jsxs6(Text, { variant: "body1", color: "primary", children: [
|
|
1738
|
-
years[yearSelected],
|
|
1768
|
+
data.years[yearSelected],
|
|
1739
1769
|
" "
|
|
1740
1770
|
] }) }),
|
|
1741
1771
|
/* @__PURE__ */ jsx24(
|
|
1742
1772
|
"button",
|
|
1743
1773
|
{
|
|
1744
|
-
disabled: yearSelected === years.length - 1,
|
|
1774
|
+
disabled: disabled || yearSelected === data.years.length - 1,
|
|
1745
1775
|
type: "button",
|
|
1746
|
-
className: `yr3MonthSelector--year-button-next ${yearSelected === years.length - 1 ? "yr3MonthSelector--year-button-next--disabled" : ""}`,
|
|
1776
|
+
className: `yr3MonthSelector--year-button-next ${yearSelected === data.years.length - 1 ? "yr3MonthSelector--year-button-next--disabled" : ""}`,
|
|
1747
1777
|
onClick: () => setYearSelected(yearSelected + 1),
|
|
1748
1778
|
children: /* @__PURE__ */ jsx24(IconRight, { width: 20, height: 30, stroke: "currentColor" })
|
|
1749
1779
|
}
|
|
@@ -1751,15 +1781,15 @@ var MonthSelector = ({ label, year, month, value, defaultValue, propsComponent,
|
|
|
1751
1781
|
]
|
|
1752
1782
|
}
|
|
1753
1783
|
),
|
|
1754
|
-
/* @__PURE__ */ jsx24("div", { className: "yr3MonthSelector--months", children:
|
|
1784
|
+
/* @__PURE__ */ jsx24("div", { className: "yr3MonthSelector--months", children: getData.months.map((m) => /* @__PURE__ */ jsx24(
|
|
1755
1785
|
"button",
|
|
1756
1786
|
{
|
|
1757
1787
|
type: "button",
|
|
1758
1788
|
style: properties?.text?.button,
|
|
1759
1789
|
disabled: m.disabled,
|
|
1760
|
-
className: `yr3MonthSelector--month ${m.disabled ? "yr3MonthSelector--month
|
|
1790
|
+
className: `yr3MonthSelector--month ${m.disabled ? "yr3MonthSelector--month--disabled" : ""} ${m.selected ? "yr3MonthSelector--month--selected" : ""}`,
|
|
1761
1791
|
onClick: () => {
|
|
1762
|
-
setValueState(`${m.value}-${years[yearSelected]}`);
|
|
1792
|
+
setValueState(`${m.value}-${data.years[yearSelected]}`);
|
|
1763
1793
|
setOpen(false);
|
|
1764
1794
|
},
|
|
1765
1795
|
children: /* @__PURE__ */ jsx24(Text, { ...properties?.text, weight: m.disabled ? "thin" : "medium", children: m.label })
|
|
@@ -2441,12 +2471,171 @@ var Pending = ({
|
|
|
2441
2471
|
);
|
|
2442
2472
|
};
|
|
2443
2473
|
|
|
2474
|
+
// src/components/Picker/Picker.tsx
|
|
2475
|
+
import * as React17 from "react";
|
|
2476
|
+
|
|
2477
|
+
// src/components/Picker/picker.variants.ts
|
|
2478
|
+
var PickerVariants = createVariants({
|
|
2479
|
+
base: "yr3Picker",
|
|
2480
|
+
variants: {
|
|
2481
|
+
variant: {
|
|
2482
|
+
filled: "yr3Picker--filled",
|
|
2483
|
+
outlined: "yr3Picker--outlined",
|
|
2484
|
+
base: "yr3Picker--base",
|
|
2485
|
+
lined: "yr3Picker--lined"
|
|
2486
|
+
},
|
|
2487
|
+
color: {
|
|
2488
|
+
primary: "yr3Picker--color-primary",
|
|
2489
|
+
secondary: "yr3Picker--color-secondary",
|
|
2490
|
+
success: "yr3Picker--color-success",
|
|
2491
|
+
text: "yr3Picker--color-text",
|
|
2492
|
+
disabled: "yr3Picker--color-disabled",
|
|
2493
|
+
background: "yr3Picker--color-background",
|
|
2494
|
+
error: "yr3Picker--color-error",
|
|
2495
|
+
warning: "yr3Picker--color-warning",
|
|
2496
|
+
info: "yr3Picker--color-info",
|
|
2497
|
+
common: "yr3Picker--color-common"
|
|
2498
|
+
},
|
|
2499
|
+
animated: {
|
|
2500
|
+
true: "yr3Picker--animated"
|
|
2501
|
+
},
|
|
2502
|
+
icon: {
|
|
2503
|
+
true: "yr3Picker--icon"
|
|
2504
|
+
},
|
|
2505
|
+
wrapper: {
|
|
2506
|
+
true: "yr3Picker--wrapper"
|
|
2507
|
+
}
|
|
2508
|
+
}
|
|
2509
|
+
});
|
|
2510
|
+
var PickerIconVariants = createVariants({
|
|
2511
|
+
base: "yr3Picker--icon",
|
|
2512
|
+
variants: {
|
|
2513
|
+
color: {
|
|
2514
|
+
primary: "yr3Picker--icon-color-primary",
|
|
2515
|
+
secondary: "yr3Picker--icon-color-secondary",
|
|
2516
|
+
success: "yr3Picker--icon-color-success",
|
|
2517
|
+
text: "yr3Picker--icon-color-text",
|
|
2518
|
+
disabled: "yr3Picker--icon-color-disabled",
|
|
2519
|
+
background: "yr3Picker--icon-color-background",
|
|
2520
|
+
error: "yr3Picker--icon-color-error",
|
|
2521
|
+
warning: "yr3Picker--icon-color-warning",
|
|
2522
|
+
info: "yr3Picker--icon-color-info",
|
|
2523
|
+
common: "yr3Picker--icon-color-common"
|
|
2524
|
+
},
|
|
2525
|
+
animated: {
|
|
2526
|
+
true: "yr3Picker--icon-animated"
|
|
2527
|
+
},
|
|
2528
|
+
open: {
|
|
2529
|
+
true: "yr3Picker--icon-open"
|
|
2530
|
+
}
|
|
2531
|
+
}
|
|
2532
|
+
});
|
|
2533
|
+
|
|
2534
|
+
// src/components/Picker/Picker.tsx
|
|
2535
|
+
import { jsx as jsx37, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2536
|
+
var initiaPropsComponent3 = {
|
|
2537
|
+
control: {
|
|
2538
|
+
variant: "outlined",
|
|
2539
|
+
color: "primary",
|
|
2540
|
+
ui: {},
|
|
2541
|
+
style: {}
|
|
2542
|
+
},
|
|
2543
|
+
label: {
|
|
2544
|
+
display: true,
|
|
2545
|
+
color: "primary",
|
|
2546
|
+
ui: {},
|
|
2547
|
+
style: {}
|
|
2548
|
+
},
|
|
2549
|
+
wrapper: {
|
|
2550
|
+
ui: {},
|
|
2551
|
+
style: {}
|
|
2552
|
+
},
|
|
2553
|
+
icon: {
|
|
2554
|
+
style: {
|
|
2555
|
+
width: 24,
|
|
2556
|
+
height: 24
|
|
2557
|
+
},
|
|
2558
|
+
color: "primary",
|
|
2559
|
+
component: void 0
|
|
2560
|
+
}
|
|
2561
|
+
};
|
|
2562
|
+
var Picker = ({ label, variant, color, children, name, value, onChange, propsComponent, closeOnSelect }) => {
|
|
2563
|
+
const [open, setOpen] = React17.useState(false);
|
|
2564
|
+
const [valueState, setValueState] = React17.useState(value || null);
|
|
2565
|
+
const ref = React17.useRef(null);
|
|
2566
|
+
useClickAway(ref, () => setOpen(false));
|
|
2567
|
+
const properties = mergeDeep(initiaPropsComponent3, propsComponent || {});
|
|
2568
|
+
const classesIcon = PickerIconVariants({ color: properties?.icon?.color, animated: open, open });
|
|
2569
|
+
const classes = PickerVariants({ wrapper: true, variant, color });
|
|
2570
|
+
React17.useEffect(() => {
|
|
2571
|
+
if (value !== void 0) {
|
|
2572
|
+
setValueState(value);
|
|
2573
|
+
}
|
|
2574
|
+
}, [value]);
|
|
2575
|
+
React17.useEffect(() => {
|
|
2576
|
+
if (closeOnSelect && valueState) {
|
|
2577
|
+
setOpen(false);
|
|
2578
|
+
}
|
|
2579
|
+
}, [valueState, closeOnSelect]);
|
|
2580
|
+
React17.useEffect(() => {
|
|
2581
|
+
if (valueState !== null && onChange) {
|
|
2582
|
+
onChange({ event: {}, target: { name, value: valueState }, currentTarget: { name, value: valueState } }, valueState);
|
|
2583
|
+
}
|
|
2584
|
+
}, [valueState, onChange, name]);
|
|
2585
|
+
return /* @__PURE__ */ jsxs12("div", { className: classes, ref, children: [
|
|
2586
|
+
/* @__PURE__ */ jsx37(
|
|
2587
|
+
Input,
|
|
2588
|
+
{
|
|
2589
|
+
label,
|
|
2590
|
+
variant: "base",
|
|
2591
|
+
disabled: true,
|
|
2592
|
+
color,
|
|
2593
|
+
value: valueState || "",
|
|
2594
|
+
propsComponent: {
|
|
2595
|
+
control: {
|
|
2596
|
+
variant,
|
|
2597
|
+
color
|
|
2598
|
+
},
|
|
2599
|
+
label: properties?.label
|
|
2600
|
+
}
|
|
2601
|
+
}
|
|
2602
|
+
),
|
|
2603
|
+
/* @__PURE__ */ jsx37(
|
|
2604
|
+
"div",
|
|
2605
|
+
{
|
|
2606
|
+
className: classesIcon,
|
|
2607
|
+
style: properties?.icon?.style,
|
|
2608
|
+
onClick: () => setOpen((prev) => !prev),
|
|
2609
|
+
"data-testid": "yr3Picker--icon",
|
|
2610
|
+
children: properties?.icon?.component ? properties?.icon.component : /* @__PURE__ */ jsx37(
|
|
2611
|
+
IconDown,
|
|
2612
|
+
{
|
|
2613
|
+
width: properties?.icon?.style?.width,
|
|
2614
|
+
height: properties?.icon?.style?.height,
|
|
2615
|
+
stroke: "currentColor",
|
|
2616
|
+
style: properties?.icon?.style
|
|
2617
|
+
}
|
|
2618
|
+
)
|
|
2619
|
+
}
|
|
2620
|
+
),
|
|
2621
|
+
open && /* @__PURE__ */ jsx37(
|
|
2622
|
+
"div",
|
|
2623
|
+
{
|
|
2624
|
+
className: "yr3Picker--container",
|
|
2625
|
+
style: composeStyles(properties?.wrapper?.ui, properties?.wrapper?.style),
|
|
2626
|
+
"data-testid": "yr3Picker-container",
|
|
2627
|
+
children
|
|
2628
|
+
}
|
|
2629
|
+
)
|
|
2630
|
+
] });
|
|
2631
|
+
};
|
|
2632
|
+
|
|
2444
2633
|
// src/components/Phone/Phone.tsx
|
|
2445
|
-
import * as
|
|
2634
|
+
import * as React19 from "react";
|
|
2446
2635
|
|
|
2447
2636
|
// src/components/Selector/Selector.tsx
|
|
2448
|
-
import * as
|
|
2449
|
-
import { jsx as
|
|
2637
|
+
import * as React18 from "react";
|
|
2638
|
+
import { jsx as jsx38, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2450
2639
|
var initalPropsComponent2 = {
|
|
2451
2640
|
text: {
|
|
2452
2641
|
variant: "caption",
|
|
@@ -2459,16 +2648,16 @@ var initalPropsComponent2 = {
|
|
|
2459
2648
|
}
|
|
2460
2649
|
};
|
|
2461
2650
|
var Selector = ({ ui, style, options, name, value, defaultValue, onChange, iconColor, icon, propsComponent = initalPropsComponent2 }) => {
|
|
2462
|
-
const [open, setOpen] =
|
|
2463
|
-
const [valueState, setValueState] =
|
|
2464
|
-
const ref =
|
|
2651
|
+
const [open, setOpen] = React18.useState(false);
|
|
2652
|
+
const [valueState, setValueState] = React18.useState(value || defaultValue || null);
|
|
2653
|
+
const ref = React18.useRef(null);
|
|
2465
2654
|
useClickAway(ref, () => setOpen(false));
|
|
2466
|
-
return /* @__PURE__ */
|
|
2467
|
-
/* @__PURE__ */
|
|
2468
|
-
/* @__PURE__ */
|
|
2655
|
+
return /* @__PURE__ */ jsxs13("div", { className: "yr3Selector-wrapper", ref, children: [
|
|
2656
|
+
/* @__PURE__ */ jsx38("div", { className: `yr3Selector ${open ? "yr3Selector--open" : ""}`, style: composeStyles(ui, style), children: /* @__PURE__ */ jsxs13("div", { className: "yr3Selector--control", children: [
|
|
2657
|
+
/* @__PURE__ */ jsx38("div", { className: "yr3Selector--icon", onClick: () => setOpen((prev) => !prev), children: icon ? icon : /* @__PURE__ */ jsx38(IconDown, { stroke: `var(--color-${iconColor || "disabled"})`, width: 24, height: 24 }) }),
|
|
2469
2658
|
valueState
|
|
2470
2659
|
] }) }),
|
|
2471
|
-
open && /* @__PURE__ */
|
|
2660
|
+
open && /* @__PURE__ */ jsx38("div", { className: "yr3Selector--menu", style: composeStyles(propsComponent.menu?.ui, propsComponent.menu?.style), children: options.map((opt) => /* @__PURE__ */ jsx38(
|
|
2472
2661
|
"div",
|
|
2473
2662
|
{
|
|
2474
2663
|
className: "yr3Selector--option",
|
|
@@ -2489,7 +2678,7 @@ var Selector = ({ ui, style, options, name, value, defaultValue, onChange, iconC
|
|
|
2489
2678
|
};
|
|
2490
2679
|
onChange?.(event, opt.value);
|
|
2491
2680
|
},
|
|
2492
|
-
children: /* @__PURE__ */
|
|
2681
|
+
children: /* @__PURE__ */ jsx38(Text, { ...propsComponent?.text, children: propsComponent?.text?.children || opt.label })
|
|
2493
2682
|
},
|
|
2494
2683
|
opt.value
|
|
2495
2684
|
)) })
|
|
@@ -2497,7 +2686,7 @@ var Selector = ({ ui, style, options, name, value, defaultValue, onChange, iconC
|
|
|
2497
2686
|
};
|
|
2498
2687
|
|
|
2499
2688
|
// src/components/Phone/Phone.tsx
|
|
2500
|
-
import { jsx as
|
|
2689
|
+
import { jsx as jsx39, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2501
2690
|
var Phone = ({
|
|
2502
2691
|
name,
|
|
2503
2692
|
value,
|
|
@@ -2509,13 +2698,13 @@ var Phone = ({
|
|
|
2509
2698
|
}) => {
|
|
2510
2699
|
const isControlled = value !== void 0;
|
|
2511
2700
|
const initial = value || defaultValue || "";
|
|
2512
|
-
const [prefix, setPrefix] =
|
|
2701
|
+
const [prefix, setPrefix] = React19.useState(
|
|
2513
2702
|
getDialPhone(initial, countries) || countries[0].dial
|
|
2514
2703
|
);
|
|
2515
|
-
const [number, setNumber] =
|
|
2704
|
+
const [number, setNumber] = React19.useState(
|
|
2516
2705
|
getNumberPhone(initial, prefix) || ""
|
|
2517
2706
|
);
|
|
2518
|
-
|
|
2707
|
+
React19.useEffect(() => {
|
|
2519
2708
|
if (isControlled && value) {
|
|
2520
2709
|
const dial = getDialPhone(value, countries);
|
|
2521
2710
|
const num = getNumberPhone(value, dial);
|
|
@@ -2534,10 +2723,10 @@ var Phone = ({
|
|
|
2534
2723
|
setPrefix(val);
|
|
2535
2724
|
onChange?.(null, `${val}${number}`);
|
|
2536
2725
|
};
|
|
2537
|
-
return /* @__PURE__ */
|
|
2538
|
-
/* @__PURE__ */
|
|
2539
|
-
/* @__PURE__ */
|
|
2540
|
-
/* @__PURE__ */
|
|
2726
|
+
return /* @__PURE__ */ jsxs14(Control, { variant: "outlined", ui: { height: 50, position: "relative" }, children: [
|
|
2727
|
+
/* @__PURE__ */ jsx39(Label, { text: label, className: "yr3Input--active" }),
|
|
2728
|
+
/* @__PURE__ */ jsxs14(Flex, { variant: "row", container: true, center: true, children: [
|
|
2729
|
+
/* @__PURE__ */ jsx39(
|
|
2541
2730
|
Selector,
|
|
2542
2731
|
{
|
|
2543
2732
|
options: countries.map((c) => ({
|
|
@@ -2549,7 +2738,7 @@ var Phone = ({
|
|
|
2549
2738
|
...propsComponent?.selector
|
|
2550
2739
|
}
|
|
2551
2740
|
),
|
|
2552
|
-
/* @__PURE__ */
|
|
2741
|
+
/* @__PURE__ */ jsx39(
|
|
2553
2742
|
Divider,
|
|
2554
2743
|
{
|
|
2555
2744
|
orientation: "vertical",
|
|
@@ -2558,7 +2747,7 @@ var Phone = ({
|
|
|
2558
2747
|
...propsComponent?.divider
|
|
2559
2748
|
}
|
|
2560
2749
|
),
|
|
2561
|
-
/* @__PURE__ */
|
|
2750
|
+
/* @__PURE__ */ jsx39(
|
|
2562
2751
|
Input,
|
|
2563
2752
|
{
|
|
2564
2753
|
type: "number",
|
|
@@ -2574,9 +2763,9 @@ var Phone = ({
|
|
|
2574
2763
|
};
|
|
2575
2764
|
|
|
2576
2765
|
// src/components/Places/PlacesAutocomplete.tsx
|
|
2577
|
-
import * as
|
|
2766
|
+
import * as React20 from "react";
|
|
2578
2767
|
import { useAutocompletePlaces } from "@yr3/autocomplete-places";
|
|
2579
|
-
import { jsx as
|
|
2768
|
+
import { jsx as jsx40, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2580
2769
|
var initPropsComponent = {
|
|
2581
2770
|
label: {
|
|
2582
2771
|
display: true,
|
|
@@ -2616,9 +2805,9 @@ var PlacesAutocomplete = ({
|
|
|
2616
2805
|
keyApi,
|
|
2617
2806
|
propsComponent = initPropsComponent
|
|
2618
2807
|
}) => {
|
|
2619
|
-
const [value, setValue] =
|
|
2620
|
-
const inputRef =
|
|
2621
|
-
const [anchorEl, setAnchorEl] =
|
|
2808
|
+
const [value, setValue] = React20.useState(null);
|
|
2809
|
+
const inputRef = React20.useRef(null);
|
|
2810
|
+
const [anchorEl, setAnchorEl] = React20.useState(null);
|
|
2622
2811
|
const { suggestions, selectPlace } = useAutocompletePlaces({ input: value, apiKey: keyApi, language, provider });
|
|
2623
2812
|
const handleSelect = async (id) => {
|
|
2624
2813
|
const place = await selectPlace(id);
|
|
@@ -2638,12 +2827,12 @@ var PlacesAutocomplete = ({
|
|
|
2638
2827
|
setValue(place.address);
|
|
2639
2828
|
setAnchorEl(null);
|
|
2640
2829
|
};
|
|
2641
|
-
|
|
2830
|
+
React20.useEffect(() => {
|
|
2642
2831
|
if (defaultLocation) {
|
|
2643
2832
|
setValue(defaultLocation);
|
|
2644
2833
|
}
|
|
2645
2834
|
}, [defaultLocation]);
|
|
2646
|
-
|
|
2835
|
+
React20.useEffect(() => {
|
|
2647
2836
|
if (value === "") {
|
|
2648
2837
|
onSelect(null);
|
|
2649
2838
|
}
|
|
@@ -2653,13 +2842,13 @@ var PlacesAutocomplete = ({
|
|
|
2653
2842
|
setAnchorEl(e.target.value ? inputRef.current : null);
|
|
2654
2843
|
};
|
|
2655
2844
|
const open = suggestions.length > 0 && Boolean(anchorEl);
|
|
2656
|
-
|
|
2845
|
+
React20.useEffect(() => {
|
|
2657
2846
|
if (onChangeForm) {
|
|
2658
2847
|
onChangeForm({ target: { value } });
|
|
2659
2848
|
}
|
|
2660
2849
|
}, [onChangeForm]);
|
|
2661
|
-
return /* @__PURE__ */
|
|
2662
|
-
/* @__PURE__ */
|
|
2850
|
+
return /* @__PURE__ */ jsxs15(Control, { ...propsComponent?.control, children: [
|
|
2851
|
+
/* @__PURE__ */ jsx40(
|
|
2663
2852
|
Input,
|
|
2664
2853
|
{
|
|
2665
2854
|
ref: inputRef,
|
|
@@ -2673,7 +2862,7 @@ var PlacesAutocomplete = ({
|
|
|
2673
2862
|
},
|
|
2674
2863
|
"input-places"
|
|
2675
2864
|
),
|
|
2676
|
-
open && /* @__PURE__ */
|
|
2865
|
+
open && /* @__PURE__ */ jsx40("div", { className: "yr3Places--menu", style: composeStyles(propsComponent.menu?.ui, propsComponent?.menu?.style), children: /* @__PURE__ */ jsx40(Flex, { container: true, ui: { p: 1 }, children: suggestions.map((s) => /* @__PURE__ */ jsx40(Flex, { onClick: () => handleSelect(s.id), ui: { padding: 8, cursor: "pointer", "&:hover": { backgroundColor: "rgba(0,0,0,0.1)" } }, children: /* @__PURE__ */ jsx40(Text, { ...propsComponent?.menu?.text, children: s.description }) }, s.id)) }) })
|
|
2677
2866
|
] });
|
|
2678
2867
|
};
|
|
2679
2868
|
|
|
@@ -2701,7 +2890,7 @@ var radioVariant = createVariants({
|
|
|
2701
2890
|
});
|
|
2702
2891
|
|
|
2703
2892
|
// src/components/Radio/Radio.tsx
|
|
2704
|
-
import { jsx as
|
|
2893
|
+
import { jsx as jsx41, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2705
2894
|
var Radio = ({
|
|
2706
2895
|
checked,
|
|
2707
2896
|
value,
|
|
@@ -2717,8 +2906,8 @@ var Radio = ({
|
|
|
2717
2906
|
const bemClass = bem("yr3Radio");
|
|
2718
2907
|
const classes = bemClass(void 0, { [color]: `color-${color}` });
|
|
2719
2908
|
const variantClass = radioVariant({ variant });
|
|
2720
|
-
return /* @__PURE__ */
|
|
2721
|
-
/* @__PURE__ */
|
|
2909
|
+
return /* @__PURE__ */ jsxs16("label", { className: classes, "data-testid": "yr3Radio", style: composeStyles(propsComponent?.radio?.ui, propsComponent?.radio?.style), children: [
|
|
2910
|
+
/* @__PURE__ */ jsx41(
|
|
2722
2911
|
"input",
|
|
2723
2912
|
{
|
|
2724
2913
|
type: "radio",
|
|
@@ -2730,8 +2919,8 @@ var Radio = ({
|
|
|
2730
2919
|
}
|
|
2731
2920
|
),
|
|
2732
2921
|
iconChecked && checked ? iconChecked : !checked && iconUnchecked ? iconUnchecked : null,
|
|
2733
|
-
!iconChecked && !iconUnchecked && /* @__PURE__ */
|
|
2734
|
-
typeof label === "string" && /* @__PURE__ */
|
|
2922
|
+
!iconChecked && !iconUnchecked && /* @__PURE__ */ jsx41("span", { className: variantClass, "data-testid": "yr3Radio-dot" }),
|
|
2923
|
+
typeof label === "string" && /* @__PURE__ */ jsx41(
|
|
2735
2924
|
"span",
|
|
2736
2925
|
{
|
|
2737
2926
|
className: "yr3Radio--label",
|
|
@@ -2744,7 +2933,7 @@ var Radio = ({
|
|
|
2744
2933
|
};
|
|
2745
2934
|
|
|
2746
2935
|
// src/components/Select/Select.tsx
|
|
2747
|
-
import * as
|
|
2936
|
+
import * as React21 from "react";
|
|
2748
2937
|
|
|
2749
2938
|
// src/components/Select/select.variants.ts
|
|
2750
2939
|
var selectVariants = createVariants({
|
|
@@ -2804,8 +2993,8 @@ var selectIconVariants = createVariants({
|
|
|
2804
2993
|
});
|
|
2805
2994
|
|
|
2806
2995
|
// src/components/Select/Select.tsx
|
|
2807
|
-
import { jsx as
|
|
2808
|
-
var
|
|
2996
|
+
import { jsx as jsx42, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2997
|
+
var initiaPropsComponent4 = {
|
|
2809
2998
|
control: {
|
|
2810
2999
|
variant: "outlined",
|
|
2811
3000
|
color: "primary",
|
|
@@ -2844,15 +3033,15 @@ var initiaPropsComponent3 = {
|
|
|
2844
3033
|
}
|
|
2845
3034
|
};
|
|
2846
3035
|
var Select = ({ label, options, name, value, defaultValue, onChange, propsComponent }) => {
|
|
2847
|
-
const [open, setOpen] =
|
|
2848
|
-
const [valueState, setValueState] =
|
|
2849
|
-
const ref =
|
|
3036
|
+
const [open, setOpen] = React21.useState(false);
|
|
3037
|
+
const [valueState, setValueState] = React21.useState(value || defaultValue || null);
|
|
3038
|
+
const ref = React21.useRef(null);
|
|
2850
3039
|
useClickAway(ref, () => setOpen(false));
|
|
2851
|
-
const properties = mergeDeep(
|
|
3040
|
+
const properties = mergeDeep(initiaPropsComponent4, propsComponent || {});
|
|
2852
3041
|
const classesIcon = selectIconVariants({ color: properties?.icon?.color, animated: open, open });
|
|
2853
3042
|
const classes = selectVariants({ wrapper: true });
|
|
2854
|
-
return /* @__PURE__ */
|
|
2855
|
-
/* @__PURE__ */
|
|
3043
|
+
return /* @__PURE__ */ jsxs17("div", { className: classes, ref, children: [
|
|
3044
|
+
/* @__PURE__ */ jsx42(
|
|
2856
3045
|
Input,
|
|
2857
3046
|
{
|
|
2858
3047
|
label,
|
|
@@ -2865,14 +3054,14 @@ var Select = ({ label, options, name, value, defaultValue, onChange, propsCompon
|
|
|
2865
3054
|
}
|
|
2866
3055
|
}
|
|
2867
3056
|
),
|
|
2868
|
-
/* @__PURE__ */
|
|
3057
|
+
/* @__PURE__ */ jsx42(
|
|
2869
3058
|
"div",
|
|
2870
3059
|
{
|
|
2871
3060
|
className: classesIcon,
|
|
2872
3061
|
style: properties?.icon?.style,
|
|
2873
3062
|
onClick: () => setOpen((prev) => !prev),
|
|
2874
3063
|
"data-testid": "yr3Select-icon",
|
|
2875
|
-
children: properties?.icon?.component ? properties?.icon.component : /* @__PURE__ */
|
|
3064
|
+
children: properties?.icon?.component ? properties?.icon.component : /* @__PURE__ */ jsx42(
|
|
2876
3065
|
IconDown,
|
|
2877
3066
|
{
|
|
2878
3067
|
width: properties?.icon?.style?.width,
|
|
@@ -2883,13 +3072,13 @@ var Select = ({ label, options, name, value, defaultValue, onChange, propsCompon
|
|
|
2883
3072
|
)
|
|
2884
3073
|
}
|
|
2885
3074
|
),
|
|
2886
|
-
open && /* @__PURE__ */
|
|
3075
|
+
open && /* @__PURE__ */ jsx42(
|
|
2887
3076
|
"div",
|
|
2888
3077
|
{
|
|
2889
3078
|
className: "yr3Select--menu",
|
|
2890
3079
|
style: composeStyles(properties?.menu?.ui, properties?.menu?.style),
|
|
2891
3080
|
"data-testid": "yr3Select-menu",
|
|
2892
|
-
children: options.map((opt) => /* @__PURE__ */
|
|
3081
|
+
children: options.map((opt) => /* @__PURE__ */ jsx42(
|
|
2893
3082
|
"div",
|
|
2894
3083
|
{
|
|
2895
3084
|
className: "yr3Select--option",
|
|
@@ -2911,7 +3100,7 @@ var Select = ({ label, options, name, value, defaultValue, onChange, propsCompon
|
|
|
2911
3100
|
onChange?.(event, opt.value);
|
|
2912
3101
|
},
|
|
2913
3102
|
style: composeStyles(properties?.menu?.options?.ui, properties?.menu?.options?.style),
|
|
2914
|
-
children: /* @__PURE__ */
|
|
3103
|
+
children: /* @__PURE__ */ jsx42(Text, { as: "span", variant: "caption", color: properties?.menu?.options?.text?.color || "primary", ...properties?.menu?.options?.text, children: opt.label })
|
|
2915
3104
|
},
|
|
2916
3105
|
opt.value
|
|
2917
3106
|
))
|
|
@@ -2921,8 +3110,8 @@ var Select = ({ label, options, name, value, defaultValue, onChange, propsCompon
|
|
|
2921
3110
|
};
|
|
2922
3111
|
|
|
2923
3112
|
// src/components/Slide/Slide.tsx
|
|
2924
|
-
import * as
|
|
2925
|
-
import { jsx as
|
|
3113
|
+
import * as React22 from "react";
|
|
3114
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
2926
3115
|
var initialPropsComponent5 = {
|
|
2927
3116
|
slide: {
|
|
2928
3117
|
ui: {},
|
|
@@ -2945,7 +3134,7 @@ var Slide = ({
|
|
|
2945
3134
|
"in": !!inProp,
|
|
2946
3135
|
"out": !inProp
|
|
2947
3136
|
});
|
|
2948
|
-
|
|
3137
|
+
React22.useEffect(() => {
|
|
2949
3138
|
let timeoutId;
|
|
2950
3139
|
if (inProp) {
|
|
2951
3140
|
timeoutId = setTimeout(() => {
|
|
@@ -2955,19 +3144,19 @@ var Slide = ({
|
|
|
2955
3144
|
return () => clearTimeout(timeoutId);
|
|
2956
3145
|
}, [inProp, duration, onTransitionEnd]);
|
|
2957
3146
|
const uiStyleContent = uiStyle({ ...properties?.slide?.ui, transitionDuration: `${duration}ms` });
|
|
2958
|
-
return /* @__PURE__ */
|
|
3147
|
+
return /* @__PURE__ */ jsx43(
|
|
2959
3148
|
"div",
|
|
2960
3149
|
{
|
|
2961
3150
|
className: "yr3Slide",
|
|
2962
3151
|
style: composeStyles(),
|
|
2963
3152
|
"data-testid": "yr3Slide",
|
|
2964
|
-
children: /* @__PURE__ */
|
|
3153
|
+
children: /* @__PURE__ */ jsx43(
|
|
2965
3154
|
"div",
|
|
2966
3155
|
{
|
|
2967
3156
|
className: classNameContent,
|
|
2968
3157
|
style: composeStyles(uiStyleContent, properties?.slide?.style || {}),
|
|
2969
3158
|
"data-testid": "yr3Slide-content",
|
|
2970
|
-
children: /* @__PURE__ */
|
|
3159
|
+
children: /* @__PURE__ */ jsx43(Box, { ...properties?.box, "data-testid": "yr3Slide-box", children })
|
|
2971
3160
|
}
|
|
2972
3161
|
)
|
|
2973
3162
|
}
|
|
@@ -2975,7 +3164,7 @@ var Slide = ({
|
|
|
2975
3164
|
};
|
|
2976
3165
|
|
|
2977
3166
|
// src/components/Switch/Switch.tsx
|
|
2978
|
-
import * as
|
|
3167
|
+
import * as React23 from "react";
|
|
2979
3168
|
|
|
2980
3169
|
// src/components/Switch/switch.variants.ts
|
|
2981
3170
|
var switchVariants = createVariants({
|
|
@@ -3012,7 +3201,7 @@ var switchVariants = createVariants({
|
|
|
3012
3201
|
});
|
|
3013
3202
|
|
|
3014
3203
|
// src/components/Switch/Switch.tsx
|
|
3015
|
-
import { jsx as
|
|
3204
|
+
import { jsx as jsx44, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
3016
3205
|
var Switch = ({
|
|
3017
3206
|
checked,
|
|
3018
3207
|
defaultChecked,
|
|
@@ -3024,7 +3213,7 @@ var Switch = ({
|
|
|
3024
3213
|
placement = "end",
|
|
3025
3214
|
propsComponent
|
|
3026
3215
|
}) => {
|
|
3027
|
-
const [internal, setInternal] =
|
|
3216
|
+
const [internal, setInternal] = React23.useState(defaultChecked || false);
|
|
3028
3217
|
const classname = switchVariants({ colors: color, size, disabled: !!disabled, checked: checked ?? internal, placement });
|
|
3029
3218
|
const isControlled = checked !== void 0;
|
|
3030
3219
|
const value = isControlled ? checked : internal;
|
|
@@ -3032,13 +3221,13 @@ var Switch = ({
|
|
|
3032
3221
|
if (!isControlled) setInternal(e.target.checked);
|
|
3033
3222
|
onChange?.(e, e.target.checked);
|
|
3034
3223
|
};
|
|
3035
|
-
return /* @__PURE__ */
|
|
3224
|
+
return /* @__PURE__ */ jsxs18(
|
|
3036
3225
|
"label",
|
|
3037
3226
|
{
|
|
3038
3227
|
className: classname,
|
|
3039
3228
|
"data-testid": "yr3Switch",
|
|
3040
3229
|
children: [
|
|
3041
|
-
/* @__PURE__ */
|
|
3230
|
+
/* @__PURE__ */ jsx44(
|
|
3042
3231
|
"input",
|
|
3043
3232
|
{
|
|
3044
3233
|
type: "checkbox",
|
|
@@ -3047,8 +3236,8 @@ var Switch = ({
|
|
|
3047
3236
|
disabled
|
|
3048
3237
|
}
|
|
3049
3238
|
),
|
|
3050
|
-
/* @__PURE__ */
|
|
3051
|
-
/* @__PURE__ */
|
|
3239
|
+
/* @__PURE__ */ jsx44("span", { className: "yr3Switch--track", children: /* @__PURE__ */ jsx44("span", { className: "yr3Switch--thumb" }) }),
|
|
3240
|
+
/* @__PURE__ */ jsx44(
|
|
3052
3241
|
"span",
|
|
3053
3242
|
{
|
|
3054
3243
|
className: "yr3Switch--label",
|
|
@@ -3063,14 +3252,14 @@ var Switch = ({
|
|
|
3063
3252
|
};
|
|
3064
3253
|
|
|
3065
3254
|
// src/theme/ThemeProvider.tsx
|
|
3066
|
-
import * as
|
|
3255
|
+
import * as React25 from "react";
|
|
3067
3256
|
|
|
3068
3257
|
// src/theme/notistackContext.tsx
|
|
3069
|
-
import * as
|
|
3070
|
-
import { jsx as
|
|
3071
|
-
var NotistackContext =
|
|
3258
|
+
import * as React24 from "react";
|
|
3259
|
+
import { jsx as jsx45, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3260
|
+
var NotistackContext = React24.createContext(null);
|
|
3072
3261
|
var NotistackProvider = ({ children }) => {
|
|
3073
|
-
const [snacks, setSnacks] =
|
|
3262
|
+
const [snacks, setSnacks] = React24.useState([]);
|
|
3074
3263
|
const notistack = (snack) => {
|
|
3075
3264
|
const id = Date.now();
|
|
3076
3265
|
setSnacks((prev) => [...prev, { ...snack, id, exiting: false }]);
|
|
@@ -3085,13 +3274,13 @@ var NotistackProvider = ({ children }) => {
|
|
|
3085
3274
|
setSnacks((prev) => prev.filter((s) => s.id !== id));
|
|
3086
3275
|
}, duration + exitDuration);
|
|
3087
3276
|
};
|
|
3088
|
-
return /* @__PURE__ */
|
|
3277
|
+
return /* @__PURE__ */ jsxs19(NotistackContext.Provider, { value: { notistack }, children: [
|
|
3089
3278
|
children,
|
|
3090
|
-
/* @__PURE__ */
|
|
3279
|
+
/* @__PURE__ */ jsx45("div", { className: "yr3NotistackContainer", children: snacks.map((snack) => /* @__PURE__ */ jsx45(Notistack, { ...snack }, snack.id)) })
|
|
3091
3280
|
] });
|
|
3092
3281
|
};
|
|
3093
3282
|
var useNotistack = () => {
|
|
3094
|
-
const ctx =
|
|
3283
|
+
const ctx = React24.useContext(NotistackContext);
|
|
3095
3284
|
if (!ctx) {
|
|
3096
3285
|
throw new Error("NotistackProvider missing");
|
|
3097
3286
|
}
|
|
@@ -3099,15 +3288,15 @@ var useNotistack = () => {
|
|
|
3099
3288
|
};
|
|
3100
3289
|
|
|
3101
3290
|
// src/theme/ThemeProvider.tsx
|
|
3102
|
-
import { jsx as
|
|
3103
|
-
var ThemeContext =
|
|
3291
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
3292
|
+
var ThemeContext = React25.createContext(null);
|
|
3104
3293
|
var ThemeProvider = ({ theme, children }) => {
|
|
3105
|
-
|
|
3294
|
+
React25.useEffect(() => {
|
|
3106
3295
|
applyTheme(theme);
|
|
3107
3296
|
}, [theme]);
|
|
3108
|
-
return /* @__PURE__ */
|
|
3297
|
+
return /* @__PURE__ */ jsx46(ThemeContext.Provider, { value: theme, children: /* @__PURE__ */ jsx46(BackdropProvider, { children: /* @__PURE__ */ jsx46(NotistackProvider, { children }) }) });
|
|
3109
3298
|
};
|
|
3110
|
-
var useTheme = () =>
|
|
3299
|
+
var useTheme = () => React25.useContext(ThemeContext);
|
|
3111
3300
|
|
|
3112
3301
|
// src/theme/tokens.ts
|
|
3113
3302
|
var baseTokens = {
|
|
@@ -3128,15 +3317,15 @@ var baseTokens = {
|
|
|
3128
3317
|
};
|
|
3129
3318
|
|
|
3130
3319
|
// src/theme/useMediaQuery.tsx
|
|
3131
|
-
import * as
|
|
3320
|
+
import * as React26 from "react";
|
|
3132
3321
|
function useMediaQuery(query) {
|
|
3133
3322
|
const theme = useTheme();
|
|
3134
3323
|
const computedQuery = typeof query === "function" ? query(theme) : query;
|
|
3135
|
-
const [matches, setMatches] =
|
|
3324
|
+
const [matches, setMatches] = React26.useState(() => {
|
|
3136
3325
|
if (typeof window === "undefined") return false;
|
|
3137
3326
|
return window.matchMedia(computedQuery).matches;
|
|
3138
3327
|
});
|
|
3139
|
-
|
|
3328
|
+
React26.useEffect(() => {
|
|
3140
3329
|
if (typeof window === "undefined") return;
|
|
3141
3330
|
const media = window.matchMedia(computedQuery);
|
|
3142
3331
|
const listener = () => setMatches(media.matches);
|
|
@@ -3170,7 +3359,7 @@ var usePlaces = ({ input, language, apiKey, provider }) => {
|
|
|
3170
3359
|
};
|
|
3171
3360
|
|
|
3172
3361
|
// src/hooks/useBreakpoint.ts
|
|
3173
|
-
import * as
|
|
3362
|
+
import * as React27 from "react";
|
|
3174
3363
|
var breakUp = (bp) => `(min-width: ${bp}px)`;
|
|
3175
3364
|
var breakDown = (bp) => `(max-width: ${bp}px)`;
|
|
3176
3365
|
function useBreakpoint(queryInput) {
|
|
@@ -3180,8 +3369,8 @@ function useBreakpoint(queryInput) {
|
|
|
3180
3369
|
if (typeof window === "undefined") return false;
|
|
3181
3370
|
return window.matchMedia(query).matches;
|
|
3182
3371
|
};
|
|
3183
|
-
const [matches, setMatches] =
|
|
3184
|
-
|
|
3372
|
+
const [matches, setMatches] = React27.useState(getMatch);
|
|
3373
|
+
React27.useEffect(() => {
|
|
3185
3374
|
if (typeof window === "undefined") return;
|
|
3186
3375
|
const media = window.matchMedia(query);
|
|
3187
3376
|
const listener = (e) => {
|
|
@@ -3245,6 +3434,7 @@ export {
|
|
|
3245
3434
|
NotistackProvider,
|
|
3246
3435
|
Pending,
|
|
3247
3436
|
Phone,
|
|
3437
|
+
Picker,
|
|
3248
3438
|
PlacesAutocomplete,
|
|
3249
3439
|
Radio,
|
|
3250
3440
|
Select,
|