@yr3/ui 1.0.18 → 1.0.20
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 +327 -113
- package/dist/index.d.cts +78 -13
- package/dist/index.d.ts +78 -13
- package/dist/index.js +326 -113
- 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
|
}
|
|
@@ -1604,6 +1612,23 @@ var monthSelectorIconVariants = createVariants({
|
|
|
1604
1612
|
}
|
|
1605
1613
|
}
|
|
1606
1614
|
});
|
|
1615
|
+
var monthSelectorContainerVariants = createVariants({
|
|
1616
|
+
base: "yr3MonthSelector--year-options",
|
|
1617
|
+
variants: {
|
|
1618
|
+
color: {
|
|
1619
|
+
primary: "yr3MonthSelector--icon-color-primary",
|
|
1620
|
+
secondary: "yr3MonthSelector--icon-color-secondary",
|
|
1621
|
+
success: "yr3MonthSelector--icon-color-success",
|
|
1622
|
+
text: "yr3MonthSelector--icon-color-text",
|
|
1623
|
+
disabled: "yr3MonthSelector--icon-color-disabled",
|
|
1624
|
+
background: "yr3MonthSelector--icon-color-background",
|
|
1625
|
+
error: "yr3MonthSelector--icon-color-error",
|
|
1626
|
+
warning: "yr3MonthSelector--icon-color-warning",
|
|
1627
|
+
info: "yr3MonthSelector--icon-color-info",
|
|
1628
|
+
common: "yr3MonthSelector--icon-color-common"
|
|
1629
|
+
}
|
|
1630
|
+
}
|
|
1631
|
+
});
|
|
1607
1632
|
|
|
1608
1633
|
// src/Icons/IconRight.tsx
|
|
1609
1634
|
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
@@ -1647,17 +1672,37 @@ var initialPropsComponent3 = {
|
|
|
1647
1672
|
height: 20
|
|
1648
1673
|
},
|
|
1649
1674
|
component: void 0
|
|
1675
|
+
},
|
|
1676
|
+
text: {
|
|
1677
|
+
variant: "caption",
|
|
1678
|
+
color: "primary",
|
|
1679
|
+
ui: {},
|
|
1680
|
+
style: {},
|
|
1681
|
+
button: {}
|
|
1682
|
+
},
|
|
1683
|
+
container: {
|
|
1684
|
+
color: "primary",
|
|
1685
|
+
ui: {},
|
|
1686
|
+
style: {}
|
|
1650
1687
|
}
|
|
1651
1688
|
};
|
|
1652
|
-
var MonthSelector = ({ label,
|
|
1689
|
+
var MonthSelector = ({ label, value, defaultValue, propsComponent, data, daysFormat, onNext, onLast }) => {
|
|
1653
1690
|
const [open, setOpen] = React10.useState(false);
|
|
1654
1691
|
const [valueState, setValueState] = React10.useState(value || defaultValue || null);
|
|
1655
|
-
const [yearSelected, setYearSelected] = React10.useState(0);
|
|
1692
|
+
const [yearSelected, setYearSelected] = React10.useState(data?.years.findIndex((y) => data.year) || 0);
|
|
1656
1693
|
const ref = React10.useRef(null);
|
|
1657
1694
|
useClickAway(ref, () => setOpen(false));
|
|
1658
1695
|
const properties = mergeDeep(initialPropsComponent3, propsComponent || {});
|
|
1659
1696
|
const iconClasses = monthSelectorIconVariants({ color: properties?.icon?.color });
|
|
1660
|
-
const
|
|
1697
|
+
const containerClasses = monthSelectorContainerVariants({ color: properties?.container?.color });
|
|
1698
|
+
const getData = React10.useMemo(() => getMonthCalendarProps({ year: data.years[yearSelected], data, daysFormat, value: valueState }), [yearSelected, data, daysFormat, valueState]);
|
|
1699
|
+
React10.useEffect(() => {
|
|
1700
|
+
if (onNext) onNext(getData.prev);
|
|
1701
|
+
if (onLast) onLast(getData.last);
|
|
1702
|
+
}, [getData]);
|
|
1703
|
+
React10.useEffect(() => {
|
|
1704
|
+
setValueState(value || defaultValue || null);
|
|
1705
|
+
}, [value, defaultValue]);
|
|
1661
1706
|
return /* @__PURE__ */ jsxs6("div", { className: "yr3MonthSelector", ref, children: [
|
|
1662
1707
|
/* @__PURE__ */ jsx24(
|
|
1663
1708
|
Input,
|
|
@@ -1697,34 +1742,42 @@ var MonthSelector = ({ label, year, month, value, defaultValue, propsComponent,
|
|
|
1697
1742
|
style: composeStyles(properties?.wrapper?.ui, properties?.wrapper?.style),
|
|
1698
1743
|
"data-testid": "yr3MonthSelector--wrapper",
|
|
1699
1744
|
children: /* @__PURE__ */ jsxs6("div", { className: "yr3MonthSelector--component", children: [
|
|
1700
|
-
/* @__PURE__ */ jsxs6(
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1745
|
+
/* @__PURE__ */ jsxs6(
|
|
1746
|
+
"div",
|
|
1747
|
+
{
|
|
1748
|
+
className: containerClasses,
|
|
1749
|
+
style: composeStyles(properties?.container?.ui, properties?.container?.style),
|
|
1750
|
+
children: [
|
|
1751
|
+
/* @__PURE__ */ jsx24("button", { disabled: yearSelected === 0, type: "button", className: `yr3MonthSelector--year-button-back ${yearSelected === 0 ? "yr3MonthSelector--year-button-back--disabled" : ""} `, onClick: () => setYearSelected(yearSelected - 1), children: /* @__PURE__ */ jsx24(IconLeft, { width: 20, height: 20, stroke: "currentColor" }) }),
|
|
1752
|
+
/* @__PURE__ */ jsx24("div", { className: `yr3MonthSelector--year-option`, children: /* @__PURE__ */ jsxs6(Text, { variant: "body1", color: "primary", children: [
|
|
1753
|
+
data.years[yearSelected],
|
|
1754
|
+
" "
|
|
1755
|
+
] }) }),
|
|
1756
|
+
/* @__PURE__ */ jsx24(
|
|
1757
|
+
"button",
|
|
1758
|
+
{
|
|
1759
|
+
disabled: yearSelected === data.years.length - 1,
|
|
1760
|
+
type: "button",
|
|
1761
|
+
className: `yr3MonthSelector--year-button-next ${yearSelected === data.years.length - 1 ? "yr3MonthSelector--year-button-next--disabled" : ""}`,
|
|
1762
|
+
onClick: () => setYearSelected(yearSelected + 1),
|
|
1763
|
+
children: /* @__PURE__ */ jsx24(IconRight, { width: 20, height: 30, stroke: "currentColor" })
|
|
1764
|
+
}
|
|
1765
|
+
)
|
|
1766
|
+
]
|
|
1767
|
+
}
|
|
1768
|
+
),
|
|
1769
|
+
/* @__PURE__ */ jsx24("div", { className: "yr3MonthSelector--months", children: getData.months.map((m) => /* @__PURE__ */ jsx24(
|
|
1718
1770
|
"button",
|
|
1719
1771
|
{
|
|
1720
1772
|
type: "button",
|
|
1773
|
+
style: properties?.text?.button,
|
|
1721
1774
|
disabled: m.disabled,
|
|
1722
|
-
className: `yr3MonthSelector--month ${m.disabled ? "yr3MonthSelector--month
|
|
1775
|
+
className: `yr3MonthSelector--month ${m.disabled ? "yr3MonthSelector--month--disabled" : ""} ${m.selected ? "yr3MonthSelector--month--selected" : ""}`,
|
|
1723
1776
|
onClick: () => {
|
|
1724
|
-
setValueState(`${m.value}-${years[yearSelected]}`);
|
|
1777
|
+
setValueState(`${m.value}-${data.years[yearSelected]}`);
|
|
1725
1778
|
setOpen(false);
|
|
1726
1779
|
},
|
|
1727
|
-
children: m.label
|
|
1780
|
+
children: /* @__PURE__ */ jsx24(Text, { ...properties?.text, weight: m.disabled ? "thin" : "medium", children: m.label })
|
|
1728
1781
|
},
|
|
1729
1782
|
"month-" + m.value
|
|
1730
1783
|
)) })
|
|
@@ -2403,12 +2456,171 @@ var Pending = ({
|
|
|
2403
2456
|
);
|
|
2404
2457
|
};
|
|
2405
2458
|
|
|
2459
|
+
// src/components/Picker/Picker.tsx
|
|
2460
|
+
import * as React17 from "react";
|
|
2461
|
+
|
|
2462
|
+
// src/components/Picker/picker.variants.ts
|
|
2463
|
+
var PickerVariants = createVariants({
|
|
2464
|
+
base: "yr3Picker",
|
|
2465
|
+
variants: {
|
|
2466
|
+
variant: {
|
|
2467
|
+
filled: "yr3Picker--filled",
|
|
2468
|
+
outlined: "yr3Picker--outlined",
|
|
2469
|
+
base: "yr3Picker--base",
|
|
2470
|
+
lined: "yr3Picker--lined"
|
|
2471
|
+
},
|
|
2472
|
+
color: {
|
|
2473
|
+
primary: "yr3Picker--color-primary",
|
|
2474
|
+
secondary: "yr3Picker--color-secondary",
|
|
2475
|
+
success: "yr3Picker--color-success",
|
|
2476
|
+
text: "yr3Picker--color-text",
|
|
2477
|
+
disabled: "yr3Picker--color-disabled",
|
|
2478
|
+
background: "yr3Picker--color-background",
|
|
2479
|
+
error: "yr3Picker--color-error",
|
|
2480
|
+
warning: "yr3Picker--color-warning",
|
|
2481
|
+
info: "yr3Picker--color-info",
|
|
2482
|
+
common: "yr3Picker--color-common"
|
|
2483
|
+
},
|
|
2484
|
+
animated: {
|
|
2485
|
+
true: "yr3Picker--animated"
|
|
2486
|
+
},
|
|
2487
|
+
icon: {
|
|
2488
|
+
true: "yr3Picker--icon"
|
|
2489
|
+
},
|
|
2490
|
+
wrapper: {
|
|
2491
|
+
true: "yr3Picker--wrapper"
|
|
2492
|
+
}
|
|
2493
|
+
}
|
|
2494
|
+
});
|
|
2495
|
+
var PickerIconVariants = createVariants({
|
|
2496
|
+
base: "yr3Picker--icon",
|
|
2497
|
+
variants: {
|
|
2498
|
+
color: {
|
|
2499
|
+
primary: "yr3Picker--icon-color-primary",
|
|
2500
|
+
secondary: "yr3Picker--icon-color-secondary",
|
|
2501
|
+
success: "yr3Picker--icon-color-success",
|
|
2502
|
+
text: "yr3Picker--icon-color-text",
|
|
2503
|
+
disabled: "yr3Picker--icon-color-disabled",
|
|
2504
|
+
background: "yr3Picker--icon-color-background",
|
|
2505
|
+
error: "yr3Picker--icon-color-error",
|
|
2506
|
+
warning: "yr3Picker--icon-color-warning",
|
|
2507
|
+
info: "yr3Picker--icon-color-info",
|
|
2508
|
+
common: "yr3Picker--icon-color-common"
|
|
2509
|
+
},
|
|
2510
|
+
animated: {
|
|
2511
|
+
true: "yr3Picker--icon-animated"
|
|
2512
|
+
},
|
|
2513
|
+
open: {
|
|
2514
|
+
true: "yr3Picker--icon-open"
|
|
2515
|
+
}
|
|
2516
|
+
}
|
|
2517
|
+
});
|
|
2518
|
+
|
|
2519
|
+
// src/components/Picker/Picker.tsx
|
|
2520
|
+
import { jsx as jsx37, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2521
|
+
var initiaPropsComponent3 = {
|
|
2522
|
+
control: {
|
|
2523
|
+
variant: "outlined",
|
|
2524
|
+
color: "primary",
|
|
2525
|
+
ui: {},
|
|
2526
|
+
style: {}
|
|
2527
|
+
},
|
|
2528
|
+
label: {
|
|
2529
|
+
display: true,
|
|
2530
|
+
color: "primary",
|
|
2531
|
+
ui: {},
|
|
2532
|
+
style: {}
|
|
2533
|
+
},
|
|
2534
|
+
wrapper: {
|
|
2535
|
+
ui: {},
|
|
2536
|
+
style: {}
|
|
2537
|
+
},
|
|
2538
|
+
icon: {
|
|
2539
|
+
style: {
|
|
2540
|
+
width: 24,
|
|
2541
|
+
height: 24
|
|
2542
|
+
},
|
|
2543
|
+
color: "primary",
|
|
2544
|
+
component: void 0
|
|
2545
|
+
}
|
|
2546
|
+
};
|
|
2547
|
+
var Picker = ({ label, variant, color, children, name, value, onChange, propsComponent, closeOnSelect }) => {
|
|
2548
|
+
const [open, setOpen] = React17.useState(false);
|
|
2549
|
+
const [valueState, setValueState] = React17.useState(value || null);
|
|
2550
|
+
const ref = React17.useRef(null);
|
|
2551
|
+
useClickAway(ref, () => setOpen(false));
|
|
2552
|
+
const properties = mergeDeep(initiaPropsComponent3, propsComponent || {});
|
|
2553
|
+
const classesIcon = PickerIconVariants({ color: properties?.icon?.color, animated: open, open });
|
|
2554
|
+
const classes = PickerVariants({ wrapper: true, variant, color });
|
|
2555
|
+
React17.useEffect(() => {
|
|
2556
|
+
if (value !== void 0) {
|
|
2557
|
+
setValueState(value);
|
|
2558
|
+
}
|
|
2559
|
+
}, [value]);
|
|
2560
|
+
React17.useEffect(() => {
|
|
2561
|
+
if (closeOnSelect && valueState) {
|
|
2562
|
+
setOpen(false);
|
|
2563
|
+
}
|
|
2564
|
+
}, [valueState, closeOnSelect]);
|
|
2565
|
+
React17.useEffect(() => {
|
|
2566
|
+
if (valueState !== null && onChange) {
|
|
2567
|
+
onChange({ event: {}, target: { name, value: valueState }, currentTarget: { name, value: valueState } }, valueState);
|
|
2568
|
+
}
|
|
2569
|
+
}, [valueState, onChange, name]);
|
|
2570
|
+
return /* @__PURE__ */ jsxs12("div", { className: classes, ref, children: [
|
|
2571
|
+
/* @__PURE__ */ jsx37(
|
|
2572
|
+
Input,
|
|
2573
|
+
{
|
|
2574
|
+
label,
|
|
2575
|
+
variant: "base",
|
|
2576
|
+
disabled: true,
|
|
2577
|
+
color,
|
|
2578
|
+
value: valueState || "",
|
|
2579
|
+
propsComponent: {
|
|
2580
|
+
control: {
|
|
2581
|
+
variant,
|
|
2582
|
+
color
|
|
2583
|
+
},
|
|
2584
|
+
label: properties?.label
|
|
2585
|
+
}
|
|
2586
|
+
}
|
|
2587
|
+
),
|
|
2588
|
+
/* @__PURE__ */ jsx37(
|
|
2589
|
+
"div",
|
|
2590
|
+
{
|
|
2591
|
+
className: classesIcon,
|
|
2592
|
+
style: properties?.icon?.style,
|
|
2593
|
+
onClick: () => setOpen((prev) => !prev),
|
|
2594
|
+
"data-testid": "yr3Picker--icon",
|
|
2595
|
+
children: properties?.icon?.component ? properties?.icon.component : /* @__PURE__ */ jsx37(
|
|
2596
|
+
IconDown,
|
|
2597
|
+
{
|
|
2598
|
+
width: properties?.icon?.style?.width,
|
|
2599
|
+
height: properties?.icon?.style?.height,
|
|
2600
|
+
stroke: "currentColor",
|
|
2601
|
+
style: properties?.icon?.style
|
|
2602
|
+
}
|
|
2603
|
+
)
|
|
2604
|
+
}
|
|
2605
|
+
),
|
|
2606
|
+
open && /* @__PURE__ */ jsx37(
|
|
2607
|
+
"div",
|
|
2608
|
+
{
|
|
2609
|
+
className: "yr3Picker--container",
|
|
2610
|
+
style: composeStyles(properties?.wrapper?.ui, properties?.wrapper?.style),
|
|
2611
|
+
"data-testid": "yr3Picker-container",
|
|
2612
|
+
children
|
|
2613
|
+
}
|
|
2614
|
+
)
|
|
2615
|
+
] });
|
|
2616
|
+
};
|
|
2617
|
+
|
|
2406
2618
|
// src/components/Phone/Phone.tsx
|
|
2407
|
-
import * as
|
|
2619
|
+
import * as React19 from "react";
|
|
2408
2620
|
|
|
2409
2621
|
// src/components/Selector/Selector.tsx
|
|
2410
|
-
import * as
|
|
2411
|
-
import { jsx as
|
|
2622
|
+
import * as React18 from "react";
|
|
2623
|
+
import { jsx as jsx38, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2412
2624
|
var initalPropsComponent2 = {
|
|
2413
2625
|
text: {
|
|
2414
2626
|
variant: "caption",
|
|
@@ -2421,16 +2633,16 @@ var initalPropsComponent2 = {
|
|
|
2421
2633
|
}
|
|
2422
2634
|
};
|
|
2423
2635
|
var Selector = ({ ui, style, options, name, value, defaultValue, onChange, iconColor, icon, propsComponent = initalPropsComponent2 }) => {
|
|
2424
|
-
const [open, setOpen] =
|
|
2425
|
-
const [valueState, setValueState] =
|
|
2426
|
-
const ref =
|
|
2636
|
+
const [open, setOpen] = React18.useState(false);
|
|
2637
|
+
const [valueState, setValueState] = React18.useState(value || defaultValue || null);
|
|
2638
|
+
const ref = React18.useRef(null);
|
|
2427
2639
|
useClickAway(ref, () => setOpen(false));
|
|
2428
|
-
return /* @__PURE__ */
|
|
2429
|
-
/* @__PURE__ */
|
|
2430
|
-
/* @__PURE__ */
|
|
2640
|
+
return /* @__PURE__ */ jsxs13("div", { className: "yr3Selector-wrapper", ref, children: [
|
|
2641
|
+
/* @__PURE__ */ jsx38("div", { className: `yr3Selector ${open ? "yr3Selector--open" : ""}`, style: composeStyles(ui, style), children: /* @__PURE__ */ jsxs13("div", { className: "yr3Selector--control", children: [
|
|
2642
|
+
/* @__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 }) }),
|
|
2431
2643
|
valueState
|
|
2432
2644
|
] }) }),
|
|
2433
|
-
open && /* @__PURE__ */
|
|
2645
|
+
open && /* @__PURE__ */ jsx38("div", { className: "yr3Selector--menu", style: composeStyles(propsComponent.menu?.ui, propsComponent.menu?.style), children: options.map((opt) => /* @__PURE__ */ jsx38(
|
|
2434
2646
|
"div",
|
|
2435
2647
|
{
|
|
2436
2648
|
className: "yr3Selector--option",
|
|
@@ -2451,7 +2663,7 @@ var Selector = ({ ui, style, options, name, value, defaultValue, onChange, iconC
|
|
|
2451
2663
|
};
|
|
2452
2664
|
onChange?.(event, opt.value);
|
|
2453
2665
|
},
|
|
2454
|
-
children: /* @__PURE__ */
|
|
2666
|
+
children: /* @__PURE__ */ jsx38(Text, { ...propsComponent?.text, children: propsComponent?.text?.children || opt.label })
|
|
2455
2667
|
},
|
|
2456
2668
|
opt.value
|
|
2457
2669
|
)) })
|
|
@@ -2459,7 +2671,7 @@ var Selector = ({ ui, style, options, name, value, defaultValue, onChange, iconC
|
|
|
2459
2671
|
};
|
|
2460
2672
|
|
|
2461
2673
|
// src/components/Phone/Phone.tsx
|
|
2462
|
-
import { jsx as
|
|
2674
|
+
import { jsx as jsx39, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2463
2675
|
var Phone = ({
|
|
2464
2676
|
name,
|
|
2465
2677
|
value,
|
|
@@ -2471,13 +2683,13 @@ var Phone = ({
|
|
|
2471
2683
|
}) => {
|
|
2472
2684
|
const isControlled = value !== void 0;
|
|
2473
2685
|
const initial = value || defaultValue || "";
|
|
2474
|
-
const [prefix, setPrefix] =
|
|
2686
|
+
const [prefix, setPrefix] = React19.useState(
|
|
2475
2687
|
getDialPhone(initial, countries) || countries[0].dial
|
|
2476
2688
|
);
|
|
2477
|
-
const [number, setNumber] =
|
|
2689
|
+
const [number, setNumber] = React19.useState(
|
|
2478
2690
|
getNumberPhone(initial, prefix) || ""
|
|
2479
2691
|
);
|
|
2480
|
-
|
|
2692
|
+
React19.useEffect(() => {
|
|
2481
2693
|
if (isControlled && value) {
|
|
2482
2694
|
const dial = getDialPhone(value, countries);
|
|
2483
2695
|
const num = getNumberPhone(value, dial);
|
|
@@ -2496,10 +2708,10 @@ var Phone = ({
|
|
|
2496
2708
|
setPrefix(val);
|
|
2497
2709
|
onChange?.(null, `${val}${number}`);
|
|
2498
2710
|
};
|
|
2499
|
-
return /* @__PURE__ */
|
|
2500
|
-
/* @__PURE__ */
|
|
2501
|
-
/* @__PURE__ */
|
|
2502
|
-
/* @__PURE__ */
|
|
2711
|
+
return /* @__PURE__ */ jsxs14(Control, { variant: "outlined", ui: { height: 50, position: "relative" }, children: [
|
|
2712
|
+
/* @__PURE__ */ jsx39(Label, { text: label, className: "yr3Input--active" }),
|
|
2713
|
+
/* @__PURE__ */ jsxs14(Flex, { variant: "row", container: true, center: true, children: [
|
|
2714
|
+
/* @__PURE__ */ jsx39(
|
|
2503
2715
|
Selector,
|
|
2504
2716
|
{
|
|
2505
2717
|
options: countries.map((c) => ({
|
|
@@ -2511,7 +2723,7 @@ var Phone = ({
|
|
|
2511
2723
|
...propsComponent?.selector
|
|
2512
2724
|
}
|
|
2513
2725
|
),
|
|
2514
|
-
/* @__PURE__ */
|
|
2726
|
+
/* @__PURE__ */ jsx39(
|
|
2515
2727
|
Divider,
|
|
2516
2728
|
{
|
|
2517
2729
|
orientation: "vertical",
|
|
@@ -2520,7 +2732,7 @@ var Phone = ({
|
|
|
2520
2732
|
...propsComponent?.divider
|
|
2521
2733
|
}
|
|
2522
2734
|
),
|
|
2523
|
-
/* @__PURE__ */
|
|
2735
|
+
/* @__PURE__ */ jsx39(
|
|
2524
2736
|
Input,
|
|
2525
2737
|
{
|
|
2526
2738
|
type: "number",
|
|
@@ -2536,9 +2748,9 @@ var Phone = ({
|
|
|
2536
2748
|
};
|
|
2537
2749
|
|
|
2538
2750
|
// src/components/Places/PlacesAutocomplete.tsx
|
|
2539
|
-
import * as
|
|
2751
|
+
import * as React20 from "react";
|
|
2540
2752
|
import { useAutocompletePlaces } from "@yr3/autocomplete-places";
|
|
2541
|
-
import { jsx as
|
|
2753
|
+
import { jsx as jsx40, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2542
2754
|
var initPropsComponent = {
|
|
2543
2755
|
label: {
|
|
2544
2756
|
display: true,
|
|
@@ -2578,9 +2790,9 @@ var PlacesAutocomplete = ({
|
|
|
2578
2790
|
keyApi,
|
|
2579
2791
|
propsComponent = initPropsComponent
|
|
2580
2792
|
}) => {
|
|
2581
|
-
const [value, setValue] =
|
|
2582
|
-
const inputRef =
|
|
2583
|
-
const [anchorEl, setAnchorEl] =
|
|
2793
|
+
const [value, setValue] = React20.useState(null);
|
|
2794
|
+
const inputRef = React20.useRef(null);
|
|
2795
|
+
const [anchorEl, setAnchorEl] = React20.useState(null);
|
|
2584
2796
|
const { suggestions, selectPlace } = useAutocompletePlaces({ input: value, apiKey: keyApi, language, provider });
|
|
2585
2797
|
const handleSelect = async (id) => {
|
|
2586
2798
|
const place = await selectPlace(id);
|
|
@@ -2600,12 +2812,12 @@ var PlacesAutocomplete = ({
|
|
|
2600
2812
|
setValue(place.address);
|
|
2601
2813
|
setAnchorEl(null);
|
|
2602
2814
|
};
|
|
2603
|
-
|
|
2815
|
+
React20.useEffect(() => {
|
|
2604
2816
|
if (defaultLocation) {
|
|
2605
2817
|
setValue(defaultLocation);
|
|
2606
2818
|
}
|
|
2607
2819
|
}, [defaultLocation]);
|
|
2608
|
-
|
|
2820
|
+
React20.useEffect(() => {
|
|
2609
2821
|
if (value === "") {
|
|
2610
2822
|
onSelect(null);
|
|
2611
2823
|
}
|
|
@@ -2615,13 +2827,13 @@ var PlacesAutocomplete = ({
|
|
|
2615
2827
|
setAnchorEl(e.target.value ? inputRef.current : null);
|
|
2616
2828
|
};
|
|
2617
2829
|
const open = suggestions.length > 0 && Boolean(anchorEl);
|
|
2618
|
-
|
|
2830
|
+
React20.useEffect(() => {
|
|
2619
2831
|
if (onChangeForm) {
|
|
2620
2832
|
onChangeForm({ target: { value } });
|
|
2621
2833
|
}
|
|
2622
2834
|
}, [onChangeForm]);
|
|
2623
|
-
return /* @__PURE__ */
|
|
2624
|
-
/* @__PURE__ */
|
|
2835
|
+
return /* @__PURE__ */ jsxs15(Control, { ...propsComponent?.control, children: [
|
|
2836
|
+
/* @__PURE__ */ jsx40(
|
|
2625
2837
|
Input,
|
|
2626
2838
|
{
|
|
2627
2839
|
ref: inputRef,
|
|
@@ -2635,7 +2847,7 @@ var PlacesAutocomplete = ({
|
|
|
2635
2847
|
},
|
|
2636
2848
|
"input-places"
|
|
2637
2849
|
),
|
|
2638
|
-
open && /* @__PURE__ */
|
|
2850
|
+
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)) }) })
|
|
2639
2851
|
] });
|
|
2640
2852
|
};
|
|
2641
2853
|
|
|
@@ -2663,7 +2875,7 @@ var radioVariant = createVariants({
|
|
|
2663
2875
|
});
|
|
2664
2876
|
|
|
2665
2877
|
// src/components/Radio/Radio.tsx
|
|
2666
|
-
import { jsx as
|
|
2878
|
+
import { jsx as jsx41, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2667
2879
|
var Radio = ({
|
|
2668
2880
|
checked,
|
|
2669
2881
|
value,
|
|
@@ -2679,8 +2891,8 @@ var Radio = ({
|
|
|
2679
2891
|
const bemClass = bem("yr3Radio");
|
|
2680
2892
|
const classes = bemClass(void 0, { [color]: `color-${color}` });
|
|
2681
2893
|
const variantClass = radioVariant({ variant });
|
|
2682
|
-
return /* @__PURE__ */
|
|
2683
|
-
/* @__PURE__ */
|
|
2894
|
+
return /* @__PURE__ */ jsxs16("label", { className: classes, "data-testid": "yr3Radio", style: composeStyles(propsComponent?.radio?.ui, propsComponent?.radio?.style), children: [
|
|
2895
|
+
/* @__PURE__ */ jsx41(
|
|
2684
2896
|
"input",
|
|
2685
2897
|
{
|
|
2686
2898
|
type: "radio",
|
|
@@ -2692,8 +2904,8 @@ var Radio = ({
|
|
|
2692
2904
|
}
|
|
2693
2905
|
),
|
|
2694
2906
|
iconChecked && checked ? iconChecked : !checked && iconUnchecked ? iconUnchecked : null,
|
|
2695
|
-
!iconChecked && !iconUnchecked && /* @__PURE__ */
|
|
2696
|
-
typeof label === "string" && /* @__PURE__ */
|
|
2907
|
+
!iconChecked && !iconUnchecked && /* @__PURE__ */ jsx41("span", { className: variantClass, "data-testid": "yr3Radio-dot" }),
|
|
2908
|
+
typeof label === "string" && /* @__PURE__ */ jsx41(
|
|
2697
2909
|
"span",
|
|
2698
2910
|
{
|
|
2699
2911
|
className: "yr3Radio--label",
|
|
@@ -2706,7 +2918,7 @@ var Radio = ({
|
|
|
2706
2918
|
};
|
|
2707
2919
|
|
|
2708
2920
|
// src/components/Select/Select.tsx
|
|
2709
|
-
import * as
|
|
2921
|
+
import * as React21 from "react";
|
|
2710
2922
|
|
|
2711
2923
|
// src/components/Select/select.variants.ts
|
|
2712
2924
|
var selectVariants = createVariants({
|
|
@@ -2766,8 +2978,8 @@ var selectIconVariants = createVariants({
|
|
|
2766
2978
|
});
|
|
2767
2979
|
|
|
2768
2980
|
// src/components/Select/Select.tsx
|
|
2769
|
-
import { jsx as
|
|
2770
|
-
var
|
|
2981
|
+
import { jsx as jsx42, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2982
|
+
var initiaPropsComponent4 = {
|
|
2771
2983
|
control: {
|
|
2772
2984
|
variant: "outlined",
|
|
2773
2985
|
color: "primary",
|
|
@@ -2806,15 +3018,15 @@ var initiaPropsComponent3 = {
|
|
|
2806
3018
|
}
|
|
2807
3019
|
};
|
|
2808
3020
|
var Select = ({ label, options, name, value, defaultValue, onChange, propsComponent }) => {
|
|
2809
|
-
const [open, setOpen] =
|
|
2810
|
-
const [valueState, setValueState] =
|
|
2811
|
-
const ref =
|
|
3021
|
+
const [open, setOpen] = React21.useState(false);
|
|
3022
|
+
const [valueState, setValueState] = React21.useState(value || defaultValue || null);
|
|
3023
|
+
const ref = React21.useRef(null);
|
|
2812
3024
|
useClickAway(ref, () => setOpen(false));
|
|
2813
|
-
const properties = mergeDeep(
|
|
3025
|
+
const properties = mergeDeep(initiaPropsComponent4, propsComponent || {});
|
|
2814
3026
|
const classesIcon = selectIconVariants({ color: properties?.icon?.color, animated: open, open });
|
|
2815
3027
|
const classes = selectVariants({ wrapper: true });
|
|
2816
|
-
return /* @__PURE__ */
|
|
2817
|
-
/* @__PURE__ */
|
|
3028
|
+
return /* @__PURE__ */ jsxs17("div", { className: classes, ref, children: [
|
|
3029
|
+
/* @__PURE__ */ jsx42(
|
|
2818
3030
|
Input,
|
|
2819
3031
|
{
|
|
2820
3032
|
label,
|
|
@@ -2827,14 +3039,14 @@ var Select = ({ label, options, name, value, defaultValue, onChange, propsCompon
|
|
|
2827
3039
|
}
|
|
2828
3040
|
}
|
|
2829
3041
|
),
|
|
2830
|
-
/* @__PURE__ */
|
|
3042
|
+
/* @__PURE__ */ jsx42(
|
|
2831
3043
|
"div",
|
|
2832
3044
|
{
|
|
2833
3045
|
className: classesIcon,
|
|
2834
3046
|
style: properties?.icon?.style,
|
|
2835
3047
|
onClick: () => setOpen((prev) => !prev),
|
|
2836
3048
|
"data-testid": "yr3Select-icon",
|
|
2837
|
-
children: properties?.icon?.component ? properties?.icon.component : /* @__PURE__ */
|
|
3049
|
+
children: properties?.icon?.component ? properties?.icon.component : /* @__PURE__ */ jsx42(
|
|
2838
3050
|
IconDown,
|
|
2839
3051
|
{
|
|
2840
3052
|
width: properties?.icon?.style?.width,
|
|
@@ -2845,13 +3057,13 @@ var Select = ({ label, options, name, value, defaultValue, onChange, propsCompon
|
|
|
2845
3057
|
)
|
|
2846
3058
|
}
|
|
2847
3059
|
),
|
|
2848
|
-
open && /* @__PURE__ */
|
|
3060
|
+
open && /* @__PURE__ */ jsx42(
|
|
2849
3061
|
"div",
|
|
2850
3062
|
{
|
|
2851
3063
|
className: "yr3Select--menu",
|
|
2852
3064
|
style: composeStyles(properties?.menu?.ui, properties?.menu?.style),
|
|
2853
3065
|
"data-testid": "yr3Select-menu",
|
|
2854
|
-
children: options.map((opt) => /* @__PURE__ */
|
|
3066
|
+
children: options.map((opt) => /* @__PURE__ */ jsx42(
|
|
2855
3067
|
"div",
|
|
2856
3068
|
{
|
|
2857
3069
|
className: "yr3Select--option",
|
|
@@ -2873,7 +3085,7 @@ var Select = ({ label, options, name, value, defaultValue, onChange, propsCompon
|
|
|
2873
3085
|
onChange?.(event, opt.value);
|
|
2874
3086
|
},
|
|
2875
3087
|
style: composeStyles(properties?.menu?.options?.ui, properties?.menu?.options?.style),
|
|
2876
|
-
children: /* @__PURE__ */
|
|
3088
|
+
children: /* @__PURE__ */ jsx42(Text, { as: "span", variant: "caption", color: properties?.menu?.options?.text?.color || "primary", ...properties?.menu?.options?.text, children: opt.label })
|
|
2877
3089
|
},
|
|
2878
3090
|
opt.value
|
|
2879
3091
|
))
|
|
@@ -2883,8 +3095,8 @@ var Select = ({ label, options, name, value, defaultValue, onChange, propsCompon
|
|
|
2883
3095
|
};
|
|
2884
3096
|
|
|
2885
3097
|
// src/components/Slide/Slide.tsx
|
|
2886
|
-
import * as
|
|
2887
|
-
import { jsx as
|
|
3098
|
+
import * as React22 from "react";
|
|
3099
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
2888
3100
|
var initialPropsComponent5 = {
|
|
2889
3101
|
slide: {
|
|
2890
3102
|
ui: {},
|
|
@@ -2907,7 +3119,7 @@ var Slide = ({
|
|
|
2907
3119
|
"in": !!inProp,
|
|
2908
3120
|
"out": !inProp
|
|
2909
3121
|
});
|
|
2910
|
-
|
|
3122
|
+
React22.useEffect(() => {
|
|
2911
3123
|
let timeoutId;
|
|
2912
3124
|
if (inProp) {
|
|
2913
3125
|
timeoutId = setTimeout(() => {
|
|
@@ -2917,19 +3129,19 @@ var Slide = ({
|
|
|
2917
3129
|
return () => clearTimeout(timeoutId);
|
|
2918
3130
|
}, [inProp, duration, onTransitionEnd]);
|
|
2919
3131
|
const uiStyleContent = uiStyle({ ...properties?.slide?.ui, transitionDuration: `${duration}ms` });
|
|
2920
|
-
return /* @__PURE__ */
|
|
3132
|
+
return /* @__PURE__ */ jsx43(
|
|
2921
3133
|
"div",
|
|
2922
3134
|
{
|
|
2923
3135
|
className: "yr3Slide",
|
|
2924
3136
|
style: composeStyles(),
|
|
2925
3137
|
"data-testid": "yr3Slide",
|
|
2926
|
-
children: /* @__PURE__ */
|
|
3138
|
+
children: /* @__PURE__ */ jsx43(
|
|
2927
3139
|
"div",
|
|
2928
3140
|
{
|
|
2929
3141
|
className: classNameContent,
|
|
2930
3142
|
style: composeStyles(uiStyleContent, properties?.slide?.style || {}),
|
|
2931
3143
|
"data-testid": "yr3Slide-content",
|
|
2932
|
-
children: /* @__PURE__ */
|
|
3144
|
+
children: /* @__PURE__ */ jsx43(Box, { ...properties?.box, "data-testid": "yr3Slide-box", children })
|
|
2933
3145
|
}
|
|
2934
3146
|
)
|
|
2935
3147
|
}
|
|
@@ -2937,7 +3149,7 @@ var Slide = ({
|
|
|
2937
3149
|
};
|
|
2938
3150
|
|
|
2939
3151
|
// src/components/Switch/Switch.tsx
|
|
2940
|
-
import * as
|
|
3152
|
+
import * as React23 from "react";
|
|
2941
3153
|
|
|
2942
3154
|
// src/components/Switch/switch.variants.ts
|
|
2943
3155
|
var switchVariants = createVariants({
|
|
@@ -2974,7 +3186,7 @@ var switchVariants = createVariants({
|
|
|
2974
3186
|
});
|
|
2975
3187
|
|
|
2976
3188
|
// src/components/Switch/Switch.tsx
|
|
2977
|
-
import { jsx as
|
|
3189
|
+
import { jsx as jsx44, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2978
3190
|
var Switch = ({
|
|
2979
3191
|
checked,
|
|
2980
3192
|
defaultChecked,
|
|
@@ -2986,7 +3198,7 @@ var Switch = ({
|
|
|
2986
3198
|
placement = "end",
|
|
2987
3199
|
propsComponent
|
|
2988
3200
|
}) => {
|
|
2989
|
-
const [internal, setInternal] =
|
|
3201
|
+
const [internal, setInternal] = React23.useState(defaultChecked || false);
|
|
2990
3202
|
const classname = switchVariants({ colors: color, size, disabled: !!disabled, checked: checked ?? internal, placement });
|
|
2991
3203
|
const isControlled = checked !== void 0;
|
|
2992
3204
|
const value = isControlled ? checked : internal;
|
|
@@ -2994,13 +3206,13 @@ var Switch = ({
|
|
|
2994
3206
|
if (!isControlled) setInternal(e.target.checked);
|
|
2995
3207
|
onChange?.(e, e.target.checked);
|
|
2996
3208
|
};
|
|
2997
|
-
return /* @__PURE__ */
|
|
3209
|
+
return /* @__PURE__ */ jsxs18(
|
|
2998
3210
|
"label",
|
|
2999
3211
|
{
|
|
3000
3212
|
className: classname,
|
|
3001
3213
|
"data-testid": "yr3Switch",
|
|
3002
3214
|
children: [
|
|
3003
|
-
/* @__PURE__ */
|
|
3215
|
+
/* @__PURE__ */ jsx44(
|
|
3004
3216
|
"input",
|
|
3005
3217
|
{
|
|
3006
3218
|
type: "checkbox",
|
|
@@ -3009,8 +3221,8 @@ var Switch = ({
|
|
|
3009
3221
|
disabled
|
|
3010
3222
|
}
|
|
3011
3223
|
),
|
|
3012
|
-
/* @__PURE__ */
|
|
3013
|
-
/* @__PURE__ */
|
|
3224
|
+
/* @__PURE__ */ jsx44("span", { className: "yr3Switch--track", children: /* @__PURE__ */ jsx44("span", { className: "yr3Switch--thumb" }) }),
|
|
3225
|
+
/* @__PURE__ */ jsx44(
|
|
3014
3226
|
"span",
|
|
3015
3227
|
{
|
|
3016
3228
|
className: "yr3Switch--label",
|
|
@@ -3025,14 +3237,14 @@ var Switch = ({
|
|
|
3025
3237
|
};
|
|
3026
3238
|
|
|
3027
3239
|
// src/theme/ThemeProvider.tsx
|
|
3028
|
-
import * as
|
|
3240
|
+
import * as React25 from "react";
|
|
3029
3241
|
|
|
3030
3242
|
// src/theme/notistackContext.tsx
|
|
3031
|
-
import * as
|
|
3032
|
-
import { jsx as
|
|
3033
|
-
var NotistackContext =
|
|
3243
|
+
import * as React24 from "react";
|
|
3244
|
+
import { jsx as jsx45, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3245
|
+
var NotistackContext = React24.createContext(null);
|
|
3034
3246
|
var NotistackProvider = ({ children }) => {
|
|
3035
|
-
const [snacks, setSnacks] =
|
|
3247
|
+
const [snacks, setSnacks] = React24.useState([]);
|
|
3036
3248
|
const notistack = (snack) => {
|
|
3037
3249
|
const id = Date.now();
|
|
3038
3250
|
setSnacks((prev) => [...prev, { ...snack, id, exiting: false }]);
|
|
@@ -3047,13 +3259,13 @@ var NotistackProvider = ({ children }) => {
|
|
|
3047
3259
|
setSnacks((prev) => prev.filter((s) => s.id !== id));
|
|
3048
3260
|
}, duration + exitDuration);
|
|
3049
3261
|
};
|
|
3050
|
-
return /* @__PURE__ */
|
|
3262
|
+
return /* @__PURE__ */ jsxs19(NotistackContext.Provider, { value: { notistack }, children: [
|
|
3051
3263
|
children,
|
|
3052
|
-
/* @__PURE__ */
|
|
3264
|
+
/* @__PURE__ */ jsx45("div", { className: "yr3NotistackContainer", children: snacks.map((snack) => /* @__PURE__ */ jsx45(Notistack, { ...snack }, snack.id)) })
|
|
3053
3265
|
] });
|
|
3054
3266
|
};
|
|
3055
3267
|
var useNotistack = () => {
|
|
3056
|
-
const ctx =
|
|
3268
|
+
const ctx = React24.useContext(NotistackContext);
|
|
3057
3269
|
if (!ctx) {
|
|
3058
3270
|
throw new Error("NotistackProvider missing");
|
|
3059
3271
|
}
|
|
@@ -3061,15 +3273,15 @@ var useNotistack = () => {
|
|
|
3061
3273
|
};
|
|
3062
3274
|
|
|
3063
3275
|
// src/theme/ThemeProvider.tsx
|
|
3064
|
-
import { jsx as
|
|
3065
|
-
var ThemeContext =
|
|
3276
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
3277
|
+
var ThemeContext = React25.createContext(null);
|
|
3066
3278
|
var ThemeProvider = ({ theme, children }) => {
|
|
3067
|
-
|
|
3279
|
+
React25.useEffect(() => {
|
|
3068
3280
|
applyTheme(theme);
|
|
3069
3281
|
}, [theme]);
|
|
3070
|
-
return /* @__PURE__ */
|
|
3282
|
+
return /* @__PURE__ */ jsx46(ThemeContext.Provider, { value: theme, children: /* @__PURE__ */ jsx46(BackdropProvider, { children: /* @__PURE__ */ jsx46(NotistackProvider, { children }) }) });
|
|
3071
3283
|
};
|
|
3072
|
-
var useTheme = () =>
|
|
3284
|
+
var useTheme = () => React25.useContext(ThemeContext);
|
|
3073
3285
|
|
|
3074
3286
|
// src/theme/tokens.ts
|
|
3075
3287
|
var baseTokens = {
|
|
@@ -3090,15 +3302,15 @@ var baseTokens = {
|
|
|
3090
3302
|
};
|
|
3091
3303
|
|
|
3092
3304
|
// src/theme/useMediaQuery.tsx
|
|
3093
|
-
import * as
|
|
3305
|
+
import * as React26 from "react";
|
|
3094
3306
|
function useMediaQuery(query) {
|
|
3095
3307
|
const theme = useTheme();
|
|
3096
3308
|
const computedQuery = typeof query === "function" ? query(theme) : query;
|
|
3097
|
-
const [matches, setMatches] =
|
|
3309
|
+
const [matches, setMatches] = React26.useState(() => {
|
|
3098
3310
|
if (typeof window === "undefined") return false;
|
|
3099
3311
|
return window.matchMedia(computedQuery).matches;
|
|
3100
3312
|
});
|
|
3101
|
-
|
|
3313
|
+
React26.useEffect(() => {
|
|
3102
3314
|
if (typeof window === "undefined") return;
|
|
3103
3315
|
const media = window.matchMedia(computedQuery);
|
|
3104
3316
|
const listener = () => setMatches(media.matches);
|
|
@@ -3132,7 +3344,7 @@ var usePlaces = ({ input, language, apiKey, provider }) => {
|
|
|
3132
3344
|
};
|
|
3133
3345
|
|
|
3134
3346
|
// src/hooks/useBreakpoint.ts
|
|
3135
|
-
import * as
|
|
3347
|
+
import * as React27 from "react";
|
|
3136
3348
|
var breakUp = (bp) => `(min-width: ${bp}px)`;
|
|
3137
3349
|
var breakDown = (bp) => `(max-width: ${bp}px)`;
|
|
3138
3350
|
function useBreakpoint(queryInput) {
|
|
@@ -3142,8 +3354,8 @@ function useBreakpoint(queryInput) {
|
|
|
3142
3354
|
if (typeof window === "undefined") return false;
|
|
3143
3355
|
return window.matchMedia(query).matches;
|
|
3144
3356
|
};
|
|
3145
|
-
const [matches, setMatches] =
|
|
3146
|
-
|
|
3357
|
+
const [matches, setMatches] = React27.useState(getMatch);
|
|
3358
|
+
React27.useEffect(() => {
|
|
3147
3359
|
if (typeof window === "undefined") return;
|
|
3148
3360
|
const media = window.matchMedia(query);
|
|
3149
3361
|
const listener = (e) => {
|
|
@@ -3207,6 +3419,7 @@ export {
|
|
|
3207
3419
|
NotistackProvider,
|
|
3208
3420
|
Pending,
|
|
3209
3421
|
Phone,
|
|
3422
|
+
Picker,
|
|
3210
3423
|
PlacesAutocomplete,
|
|
3211
3424
|
Radio,
|
|
3212
3425
|
Select,
|