@yr3/ui 1.0.19 → 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 +274 -98
- package/dist/index.d.cts +70 -13
- package/dist/index.d.ts +70 -13
- package/dist/index.js +273 -98
- package/dist/styles/index.css +139 -3
- package/dist/styles/index.css.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -68,6 +68,7 @@ __export(index_exports, {
|
|
|
68
68
|
NotistackProvider: () => NotistackProvider,
|
|
69
69
|
Pending: () => Pending,
|
|
70
70
|
Phone: () => Phone,
|
|
71
|
+
Picker: () => Picker,
|
|
71
72
|
PlacesAutocomplete: () => PlacesAutocomplete,
|
|
72
73
|
Radio: () => Radio,
|
|
73
74
|
Select: () => Select,
|
|
@@ -152,6 +153,8 @@ var bemMerge = (...args) => {
|
|
|
152
153
|
|
|
153
154
|
// src/utils/calendar.ts
|
|
154
155
|
var import_dayjs = __toESM(require("dayjs"), 1);
|
|
156
|
+
var import_updateLocale = __toESM(require("dayjs/plugin/updateLocale"), 1);
|
|
157
|
+
import_dayjs.default.extend(import_updateLocale.default);
|
|
155
158
|
function getMonthCalendar(year, month, startIndex, selected, props) {
|
|
156
159
|
const today = (0, import_dayjs.default)().startOf("day");
|
|
157
160
|
const startOfMonth = (0, import_dayjs.default)().year(year).month(month).startOf("month");
|
|
@@ -225,17 +228,23 @@ function getMonthCalendar(year, month, startIndex, selected, props) {
|
|
|
225
228
|
currentDay: dayCurrent
|
|
226
229
|
};
|
|
227
230
|
}
|
|
228
|
-
function getMonthCalendarProps({ year,
|
|
231
|
+
function getMonthCalendarProps({ year, data, value, daysFormat }) {
|
|
229
232
|
const startIndex = (0, import_dayjs.default)().year(year).month().valueOf();
|
|
233
|
+
import_dayjs.default.updateLocale("en", {
|
|
234
|
+
months: daysFormat?.months || ["jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"]
|
|
235
|
+
});
|
|
230
236
|
return {
|
|
231
|
-
month: (0, import_dayjs.default)().set("m", month).format(formatMonth || "MMM"),
|
|
232
237
|
year,
|
|
233
238
|
startIndex,
|
|
234
|
-
years,
|
|
239
|
+
years: data.years,
|
|
240
|
+
value,
|
|
241
|
+
last: !value ? "" : (0, import_dayjs.default)().year(Number(value?.split("-")[1])).month(Number(value?.split("-")[0]) - 2).format("MM-YYYY"),
|
|
242
|
+
prev: !value ? "" : (0, import_dayjs.default)().year(Number(value?.split("-")[1])).month(Number(value?.split("-")[0])).format("MM-YYYY"),
|
|
235
243
|
months: Array.from({ length: 12 }, (_, i) => ({
|
|
236
|
-
label: (0, import_dayjs.default)().month(i).format(
|
|
237
|
-
value: (0, import_dayjs.default)().month(i).format("MM"),
|
|
238
|
-
disabled: (0, import_dayjs.default)().year(year).month(i).isAfter((0, import_dayjs.default)(), "month") ||
|
|
244
|
+
label: (0, import_dayjs.default)().month(i).format(daysFormat?.month || "MMM"),
|
|
245
|
+
value: (0, import_dayjs.default)().month(i).format(daysFormat?.value || "MM"),
|
|
246
|
+
disabled: (0, import_dayjs.default)().year(year).month(i).isAfter((0, import_dayjs.default)(), "month") || data.exclude.find((e) => e.year === year)?.months.includes(i),
|
|
247
|
+
selected: !data.selected ? false : (0, import_dayjs.default)().year(year).month(Number(value?.split("-")[0]) - 1).format("MM") === (0, import_dayjs.default)().month(i).format(daysFormat?.value || "MM")
|
|
239
248
|
}))
|
|
240
249
|
};
|
|
241
250
|
}
|
|
@@ -1801,16 +1810,23 @@ var initialPropsComponent3 = {
|
|
|
1801
1810
|
style: {}
|
|
1802
1811
|
}
|
|
1803
1812
|
};
|
|
1804
|
-
var MonthSelector = ({ label,
|
|
1813
|
+
var MonthSelector = ({ label, value, defaultValue, propsComponent, data, daysFormat, onNext, onLast }) => {
|
|
1805
1814
|
const [open, setOpen] = React10.useState(false);
|
|
1806
1815
|
const [valueState, setValueState] = React10.useState(value || defaultValue || null);
|
|
1807
|
-
const [yearSelected, setYearSelected] = React10.useState(years.findIndex((y) =>
|
|
1816
|
+
const [yearSelected, setYearSelected] = React10.useState(data?.years.findIndex((y) => data.year) || 0);
|
|
1808
1817
|
const ref = React10.useRef(null);
|
|
1809
1818
|
useClickAway(ref, () => setOpen(false));
|
|
1810
1819
|
const properties = mergeDeep(initialPropsComponent3, propsComponent || {});
|
|
1811
1820
|
const iconClasses = monthSelectorIconVariants({ color: properties?.icon?.color });
|
|
1812
1821
|
const containerClasses = monthSelectorContainerVariants({ color: properties?.container?.color });
|
|
1813
|
-
const
|
|
1822
|
+
const getData = React10.useMemo(() => getMonthCalendarProps({ year: data.years[yearSelected], data, daysFormat, value: valueState }), [yearSelected, data, daysFormat, valueState]);
|
|
1823
|
+
React10.useEffect(() => {
|
|
1824
|
+
if (onNext) onNext(getData.prev);
|
|
1825
|
+
if (onLast) onLast(getData.last);
|
|
1826
|
+
}, [getData]);
|
|
1827
|
+
React10.useEffect(() => {
|
|
1828
|
+
setValueState(value || defaultValue || null);
|
|
1829
|
+
}, [value, defaultValue]);
|
|
1814
1830
|
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "yr3MonthSelector", ref, children: [
|
|
1815
1831
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1816
1832
|
Input,
|
|
@@ -1858,15 +1874,15 @@ var MonthSelector = ({ label, year, month, value, defaultValue, propsComponent,
|
|
|
1858
1874
|
children: [
|
|
1859
1875
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("button", { disabled: yearSelected === 0, type: "button", className: `yr3MonthSelector--year-button-back ${yearSelected === 0 ? "yr3MonthSelector--year-button-back--disabled" : ""} `, onClick: () => setYearSelected(yearSelected - 1), children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(IconLeft, { width: 20, height: 20, stroke: "currentColor" }) }),
|
|
1860
1876
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: `yr3MonthSelector--year-option`, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Text, { variant: "body1", color: "primary", children: [
|
|
1861
|
-
years[yearSelected],
|
|
1877
|
+
data.years[yearSelected],
|
|
1862
1878
|
" "
|
|
1863
1879
|
] }) }),
|
|
1864
1880
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1865
1881
|
"button",
|
|
1866
1882
|
{
|
|
1867
|
-
disabled: yearSelected === years.length - 1,
|
|
1883
|
+
disabled: yearSelected === data.years.length - 1,
|
|
1868
1884
|
type: "button",
|
|
1869
|
-
className: `yr3MonthSelector--year-button-next ${yearSelected === years.length - 1 ? "yr3MonthSelector--year-button-next--disabled" : ""}`,
|
|
1885
|
+
className: `yr3MonthSelector--year-button-next ${yearSelected === data.years.length - 1 ? "yr3MonthSelector--year-button-next--disabled" : ""}`,
|
|
1870
1886
|
onClick: () => setYearSelected(yearSelected + 1),
|
|
1871
1887
|
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(IconRight, { width: 20, height: 30, stroke: "currentColor" })
|
|
1872
1888
|
}
|
|
@@ -1874,15 +1890,15 @@ var MonthSelector = ({ label, year, month, value, defaultValue, propsComponent,
|
|
|
1874
1890
|
]
|
|
1875
1891
|
}
|
|
1876
1892
|
),
|
|
1877
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "yr3MonthSelector--months", children:
|
|
1893
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "yr3MonthSelector--months", children: getData.months.map((m) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1878
1894
|
"button",
|
|
1879
1895
|
{
|
|
1880
1896
|
type: "button",
|
|
1881
1897
|
style: properties?.text?.button,
|
|
1882
1898
|
disabled: m.disabled,
|
|
1883
|
-
className: `yr3MonthSelector--month ${m.disabled ? "yr3MonthSelector--month
|
|
1899
|
+
className: `yr3MonthSelector--month ${m.disabled ? "yr3MonthSelector--month--disabled" : ""} ${m.selected ? "yr3MonthSelector--month--selected" : ""}`,
|
|
1884
1900
|
onClick: () => {
|
|
1885
|
-
setValueState(`${m.value}-${years[yearSelected]}`);
|
|
1901
|
+
setValueState(`${m.value}-${data.years[yearSelected]}`);
|
|
1886
1902
|
setOpen(false);
|
|
1887
1903
|
},
|
|
1888
1904
|
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { ...properties?.text, weight: m.disabled ? "thin" : "medium", children: m.label })
|
|
@@ -2564,12 +2580,171 @@ var Pending = ({
|
|
|
2564
2580
|
);
|
|
2565
2581
|
};
|
|
2566
2582
|
|
|
2583
|
+
// src/components/Picker/Picker.tsx
|
|
2584
|
+
var React17 = __toESM(require("react"), 1);
|
|
2585
|
+
|
|
2586
|
+
// src/components/Picker/picker.variants.ts
|
|
2587
|
+
var PickerVariants = createVariants({
|
|
2588
|
+
base: "yr3Picker",
|
|
2589
|
+
variants: {
|
|
2590
|
+
variant: {
|
|
2591
|
+
filled: "yr3Picker--filled",
|
|
2592
|
+
outlined: "yr3Picker--outlined",
|
|
2593
|
+
base: "yr3Picker--base",
|
|
2594
|
+
lined: "yr3Picker--lined"
|
|
2595
|
+
},
|
|
2596
|
+
color: {
|
|
2597
|
+
primary: "yr3Picker--color-primary",
|
|
2598
|
+
secondary: "yr3Picker--color-secondary",
|
|
2599
|
+
success: "yr3Picker--color-success",
|
|
2600
|
+
text: "yr3Picker--color-text",
|
|
2601
|
+
disabled: "yr3Picker--color-disabled",
|
|
2602
|
+
background: "yr3Picker--color-background",
|
|
2603
|
+
error: "yr3Picker--color-error",
|
|
2604
|
+
warning: "yr3Picker--color-warning",
|
|
2605
|
+
info: "yr3Picker--color-info",
|
|
2606
|
+
common: "yr3Picker--color-common"
|
|
2607
|
+
},
|
|
2608
|
+
animated: {
|
|
2609
|
+
true: "yr3Picker--animated"
|
|
2610
|
+
},
|
|
2611
|
+
icon: {
|
|
2612
|
+
true: "yr3Picker--icon"
|
|
2613
|
+
},
|
|
2614
|
+
wrapper: {
|
|
2615
|
+
true: "yr3Picker--wrapper"
|
|
2616
|
+
}
|
|
2617
|
+
}
|
|
2618
|
+
});
|
|
2619
|
+
var PickerIconVariants = createVariants({
|
|
2620
|
+
base: "yr3Picker--icon",
|
|
2621
|
+
variants: {
|
|
2622
|
+
color: {
|
|
2623
|
+
primary: "yr3Picker--icon-color-primary",
|
|
2624
|
+
secondary: "yr3Picker--icon-color-secondary",
|
|
2625
|
+
success: "yr3Picker--icon-color-success",
|
|
2626
|
+
text: "yr3Picker--icon-color-text",
|
|
2627
|
+
disabled: "yr3Picker--icon-color-disabled",
|
|
2628
|
+
background: "yr3Picker--icon-color-background",
|
|
2629
|
+
error: "yr3Picker--icon-color-error",
|
|
2630
|
+
warning: "yr3Picker--icon-color-warning",
|
|
2631
|
+
info: "yr3Picker--icon-color-info",
|
|
2632
|
+
common: "yr3Picker--icon-color-common"
|
|
2633
|
+
},
|
|
2634
|
+
animated: {
|
|
2635
|
+
true: "yr3Picker--icon-animated"
|
|
2636
|
+
},
|
|
2637
|
+
open: {
|
|
2638
|
+
true: "yr3Picker--icon-open"
|
|
2639
|
+
}
|
|
2640
|
+
}
|
|
2641
|
+
});
|
|
2642
|
+
|
|
2643
|
+
// src/components/Picker/Picker.tsx
|
|
2644
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
2645
|
+
var initiaPropsComponent3 = {
|
|
2646
|
+
control: {
|
|
2647
|
+
variant: "outlined",
|
|
2648
|
+
color: "primary",
|
|
2649
|
+
ui: {},
|
|
2650
|
+
style: {}
|
|
2651
|
+
},
|
|
2652
|
+
label: {
|
|
2653
|
+
display: true,
|
|
2654
|
+
color: "primary",
|
|
2655
|
+
ui: {},
|
|
2656
|
+
style: {}
|
|
2657
|
+
},
|
|
2658
|
+
wrapper: {
|
|
2659
|
+
ui: {},
|
|
2660
|
+
style: {}
|
|
2661
|
+
},
|
|
2662
|
+
icon: {
|
|
2663
|
+
style: {
|
|
2664
|
+
width: 24,
|
|
2665
|
+
height: 24
|
|
2666
|
+
},
|
|
2667
|
+
color: "primary",
|
|
2668
|
+
component: void 0
|
|
2669
|
+
}
|
|
2670
|
+
};
|
|
2671
|
+
var Picker = ({ label, variant, color, children, name, value, onChange, propsComponent, closeOnSelect }) => {
|
|
2672
|
+
const [open, setOpen] = React17.useState(false);
|
|
2673
|
+
const [valueState, setValueState] = React17.useState(value || null);
|
|
2674
|
+
const ref = React17.useRef(null);
|
|
2675
|
+
useClickAway(ref, () => setOpen(false));
|
|
2676
|
+
const properties = mergeDeep(initiaPropsComponent3, propsComponent || {});
|
|
2677
|
+
const classesIcon = PickerIconVariants({ color: properties?.icon?.color, animated: open, open });
|
|
2678
|
+
const classes = PickerVariants({ wrapper: true, variant, color });
|
|
2679
|
+
React17.useEffect(() => {
|
|
2680
|
+
if (value !== void 0) {
|
|
2681
|
+
setValueState(value);
|
|
2682
|
+
}
|
|
2683
|
+
}, [value]);
|
|
2684
|
+
React17.useEffect(() => {
|
|
2685
|
+
if (closeOnSelect && valueState) {
|
|
2686
|
+
setOpen(false);
|
|
2687
|
+
}
|
|
2688
|
+
}, [valueState, closeOnSelect]);
|
|
2689
|
+
React17.useEffect(() => {
|
|
2690
|
+
if (valueState !== null && onChange) {
|
|
2691
|
+
onChange({ event: {}, target: { name, value: valueState }, currentTarget: { name, value: valueState } }, valueState);
|
|
2692
|
+
}
|
|
2693
|
+
}, [valueState, onChange, name]);
|
|
2694
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: classes, ref, children: [
|
|
2695
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
2696
|
+
Input,
|
|
2697
|
+
{
|
|
2698
|
+
label,
|
|
2699
|
+
variant: "base",
|
|
2700
|
+
disabled: true,
|
|
2701
|
+
color,
|
|
2702
|
+
value: valueState || "",
|
|
2703
|
+
propsComponent: {
|
|
2704
|
+
control: {
|
|
2705
|
+
variant,
|
|
2706
|
+
color
|
|
2707
|
+
},
|
|
2708
|
+
label: properties?.label
|
|
2709
|
+
}
|
|
2710
|
+
}
|
|
2711
|
+
),
|
|
2712
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
2713
|
+
"div",
|
|
2714
|
+
{
|
|
2715
|
+
className: classesIcon,
|
|
2716
|
+
style: properties?.icon?.style,
|
|
2717
|
+
onClick: () => setOpen((prev) => !prev),
|
|
2718
|
+
"data-testid": "yr3Picker--icon",
|
|
2719
|
+
children: properties?.icon?.component ? properties?.icon.component : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
2720
|
+
IconDown,
|
|
2721
|
+
{
|
|
2722
|
+
width: properties?.icon?.style?.width,
|
|
2723
|
+
height: properties?.icon?.style?.height,
|
|
2724
|
+
stroke: "currentColor",
|
|
2725
|
+
style: properties?.icon?.style
|
|
2726
|
+
}
|
|
2727
|
+
)
|
|
2728
|
+
}
|
|
2729
|
+
),
|
|
2730
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
2731
|
+
"div",
|
|
2732
|
+
{
|
|
2733
|
+
className: "yr3Picker--container",
|
|
2734
|
+
style: composeStyles(properties?.wrapper?.ui, properties?.wrapper?.style),
|
|
2735
|
+
"data-testid": "yr3Picker-container",
|
|
2736
|
+
children
|
|
2737
|
+
}
|
|
2738
|
+
)
|
|
2739
|
+
] });
|
|
2740
|
+
};
|
|
2741
|
+
|
|
2567
2742
|
// src/components/Phone/Phone.tsx
|
|
2568
|
-
var
|
|
2743
|
+
var React19 = __toESM(require("react"), 1);
|
|
2569
2744
|
|
|
2570
2745
|
// src/components/Selector/Selector.tsx
|
|
2571
|
-
var
|
|
2572
|
-
var
|
|
2746
|
+
var React18 = __toESM(require("react"), 1);
|
|
2747
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
2573
2748
|
var initalPropsComponent2 = {
|
|
2574
2749
|
text: {
|
|
2575
2750
|
variant: "caption",
|
|
@@ -2582,16 +2757,16 @@ var initalPropsComponent2 = {
|
|
|
2582
2757
|
}
|
|
2583
2758
|
};
|
|
2584
2759
|
var Selector = ({ ui, style, options, name, value, defaultValue, onChange, iconColor, icon, propsComponent = initalPropsComponent2 }) => {
|
|
2585
|
-
const [open, setOpen] =
|
|
2586
|
-
const [valueState, setValueState] =
|
|
2587
|
-
const ref =
|
|
2760
|
+
const [open, setOpen] = React18.useState(false);
|
|
2761
|
+
const [valueState, setValueState] = React18.useState(value || defaultValue || null);
|
|
2762
|
+
const ref = React18.useRef(null);
|
|
2588
2763
|
useClickAway(ref, () => setOpen(false));
|
|
2589
|
-
return /* @__PURE__ */ (0,
|
|
2590
|
-
/* @__PURE__ */ (0,
|
|
2591
|
-
/* @__PURE__ */ (0,
|
|
2764
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "yr3Selector-wrapper", ref, children: [
|
|
2765
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: `yr3Selector ${open ? "yr3Selector--open" : ""}`, style: composeStyles(ui, style), children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "yr3Selector--control", children: [
|
|
2766
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "yr3Selector--icon", onClick: () => setOpen((prev) => !prev), children: icon ? icon : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(IconDown, { stroke: `var(--color-${iconColor || "disabled"})`, width: 24, height: 24 }) }),
|
|
2592
2767
|
valueState
|
|
2593
2768
|
] }) }),
|
|
2594
|
-
open && /* @__PURE__ */ (0,
|
|
2769
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "yr3Selector--menu", style: composeStyles(propsComponent.menu?.ui, propsComponent.menu?.style), children: options.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2595
2770
|
"div",
|
|
2596
2771
|
{
|
|
2597
2772
|
className: "yr3Selector--option",
|
|
@@ -2612,7 +2787,7 @@ var Selector = ({ ui, style, options, name, value, defaultValue, onChange, iconC
|
|
|
2612
2787
|
};
|
|
2613
2788
|
onChange?.(event, opt.value);
|
|
2614
2789
|
},
|
|
2615
|
-
children: /* @__PURE__ */ (0,
|
|
2790
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text, { ...propsComponent?.text, children: propsComponent?.text?.children || opt.label })
|
|
2616
2791
|
},
|
|
2617
2792
|
opt.value
|
|
2618
2793
|
)) })
|
|
@@ -2620,7 +2795,7 @@ var Selector = ({ ui, style, options, name, value, defaultValue, onChange, iconC
|
|
|
2620
2795
|
};
|
|
2621
2796
|
|
|
2622
2797
|
// src/components/Phone/Phone.tsx
|
|
2623
|
-
var
|
|
2798
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
2624
2799
|
var Phone = ({
|
|
2625
2800
|
name,
|
|
2626
2801
|
value,
|
|
@@ -2632,13 +2807,13 @@ var Phone = ({
|
|
|
2632
2807
|
}) => {
|
|
2633
2808
|
const isControlled = value !== void 0;
|
|
2634
2809
|
const initial = value || defaultValue || "";
|
|
2635
|
-
const [prefix, setPrefix] =
|
|
2810
|
+
const [prefix, setPrefix] = React19.useState(
|
|
2636
2811
|
getDialPhone(initial, countries) || countries[0].dial
|
|
2637
2812
|
);
|
|
2638
|
-
const [number, setNumber] =
|
|
2813
|
+
const [number, setNumber] = React19.useState(
|
|
2639
2814
|
getNumberPhone(initial, prefix) || ""
|
|
2640
2815
|
);
|
|
2641
|
-
|
|
2816
|
+
React19.useEffect(() => {
|
|
2642
2817
|
if (isControlled && value) {
|
|
2643
2818
|
const dial = getDialPhone(value, countries);
|
|
2644
2819
|
const num = getNumberPhone(value, dial);
|
|
@@ -2657,10 +2832,10 @@ var Phone = ({
|
|
|
2657
2832
|
setPrefix(val);
|
|
2658
2833
|
onChange?.(null, `${val}${number}`);
|
|
2659
2834
|
};
|
|
2660
|
-
return /* @__PURE__ */ (0,
|
|
2661
|
-
/* @__PURE__ */ (0,
|
|
2662
|
-
/* @__PURE__ */ (0,
|
|
2663
|
-
/* @__PURE__ */ (0,
|
|
2835
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Control, { variant: "outlined", ui: { height: 50, position: "relative" }, children: [
|
|
2836
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Label, { text: label, className: "yr3Input--active" }),
|
|
2837
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Flex, { variant: "row", container: true, center: true, children: [
|
|
2838
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
2664
2839
|
Selector,
|
|
2665
2840
|
{
|
|
2666
2841
|
options: countries.map((c) => ({
|
|
@@ -2672,7 +2847,7 @@ var Phone = ({
|
|
|
2672
2847
|
...propsComponent?.selector
|
|
2673
2848
|
}
|
|
2674
2849
|
),
|
|
2675
|
-
/* @__PURE__ */ (0,
|
|
2850
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
2676
2851
|
Divider,
|
|
2677
2852
|
{
|
|
2678
2853
|
orientation: "vertical",
|
|
@@ -2681,7 +2856,7 @@ var Phone = ({
|
|
|
2681
2856
|
...propsComponent?.divider
|
|
2682
2857
|
}
|
|
2683
2858
|
),
|
|
2684
|
-
/* @__PURE__ */ (0,
|
|
2859
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
2685
2860
|
Input,
|
|
2686
2861
|
{
|
|
2687
2862
|
type: "number",
|
|
@@ -2697,9 +2872,9 @@ var Phone = ({
|
|
|
2697
2872
|
};
|
|
2698
2873
|
|
|
2699
2874
|
// src/components/Places/PlacesAutocomplete.tsx
|
|
2700
|
-
var
|
|
2875
|
+
var React20 = __toESM(require("react"), 1);
|
|
2701
2876
|
var import_autocomplete_places = require("@yr3/autocomplete-places");
|
|
2702
|
-
var
|
|
2877
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
2703
2878
|
var initPropsComponent = {
|
|
2704
2879
|
label: {
|
|
2705
2880
|
display: true,
|
|
@@ -2739,9 +2914,9 @@ var PlacesAutocomplete = ({
|
|
|
2739
2914
|
keyApi,
|
|
2740
2915
|
propsComponent = initPropsComponent
|
|
2741
2916
|
}) => {
|
|
2742
|
-
const [value, setValue] =
|
|
2743
|
-
const inputRef =
|
|
2744
|
-
const [anchorEl, setAnchorEl] =
|
|
2917
|
+
const [value, setValue] = React20.useState(null);
|
|
2918
|
+
const inputRef = React20.useRef(null);
|
|
2919
|
+
const [anchorEl, setAnchorEl] = React20.useState(null);
|
|
2745
2920
|
const { suggestions, selectPlace } = (0, import_autocomplete_places.useAutocompletePlaces)({ input: value, apiKey: keyApi, language, provider });
|
|
2746
2921
|
const handleSelect = async (id) => {
|
|
2747
2922
|
const place = await selectPlace(id);
|
|
@@ -2761,12 +2936,12 @@ var PlacesAutocomplete = ({
|
|
|
2761
2936
|
setValue(place.address);
|
|
2762
2937
|
setAnchorEl(null);
|
|
2763
2938
|
};
|
|
2764
|
-
|
|
2939
|
+
React20.useEffect(() => {
|
|
2765
2940
|
if (defaultLocation) {
|
|
2766
2941
|
setValue(defaultLocation);
|
|
2767
2942
|
}
|
|
2768
2943
|
}, [defaultLocation]);
|
|
2769
|
-
|
|
2944
|
+
React20.useEffect(() => {
|
|
2770
2945
|
if (value === "") {
|
|
2771
2946
|
onSelect(null);
|
|
2772
2947
|
}
|
|
@@ -2776,13 +2951,13 @@ var PlacesAutocomplete = ({
|
|
|
2776
2951
|
setAnchorEl(e.target.value ? inputRef.current : null);
|
|
2777
2952
|
};
|
|
2778
2953
|
const open = suggestions.length > 0 && Boolean(anchorEl);
|
|
2779
|
-
|
|
2954
|
+
React20.useEffect(() => {
|
|
2780
2955
|
if (onChangeForm) {
|
|
2781
2956
|
onChangeForm({ target: { value } });
|
|
2782
2957
|
}
|
|
2783
2958
|
}, [onChangeForm]);
|
|
2784
|
-
return /* @__PURE__ */ (0,
|
|
2785
|
-
/* @__PURE__ */ (0,
|
|
2959
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(Control, { ...propsComponent?.control, children: [
|
|
2960
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
2786
2961
|
Input,
|
|
2787
2962
|
{
|
|
2788
2963
|
ref: inputRef,
|
|
@@ -2796,7 +2971,7 @@ var PlacesAutocomplete = ({
|
|
|
2796
2971
|
},
|
|
2797
2972
|
"input-places"
|
|
2798
2973
|
),
|
|
2799
|
-
open && /* @__PURE__ */ (0,
|
|
2974
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "yr3Places--menu", style: composeStyles(propsComponent.menu?.ui, propsComponent?.menu?.style), children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Flex, { container: true, ui: { p: 1 }, children: suggestions.map((s) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Flex, { onClick: () => handleSelect(s.id), ui: { padding: 8, cursor: "pointer", "&:hover": { backgroundColor: "rgba(0,0,0,0.1)" } }, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Text, { ...propsComponent?.menu?.text, children: s.description }) }, s.id)) }) })
|
|
2800
2975
|
] });
|
|
2801
2976
|
};
|
|
2802
2977
|
|
|
@@ -2824,7 +2999,7 @@ var radioVariant = createVariants({
|
|
|
2824
2999
|
});
|
|
2825
3000
|
|
|
2826
3001
|
// src/components/Radio/Radio.tsx
|
|
2827
|
-
var
|
|
3002
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
2828
3003
|
var Radio = ({
|
|
2829
3004
|
checked,
|
|
2830
3005
|
value,
|
|
@@ -2840,8 +3015,8 @@ var Radio = ({
|
|
|
2840
3015
|
const bemClass = bem("yr3Radio");
|
|
2841
3016
|
const classes = bemClass(void 0, { [color]: `color-${color}` });
|
|
2842
3017
|
const variantClass = radioVariant({ variant });
|
|
2843
|
-
return /* @__PURE__ */ (0,
|
|
2844
|
-
/* @__PURE__ */ (0,
|
|
3018
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("label", { className: classes, "data-testid": "yr3Radio", style: composeStyles(propsComponent?.radio?.ui, propsComponent?.radio?.style), children: [
|
|
3019
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
2845
3020
|
"input",
|
|
2846
3021
|
{
|
|
2847
3022
|
type: "radio",
|
|
@@ -2853,8 +3028,8 @@ var Radio = ({
|
|
|
2853
3028
|
}
|
|
2854
3029
|
),
|
|
2855
3030
|
iconChecked && checked ? iconChecked : !checked && iconUnchecked ? iconUnchecked : null,
|
|
2856
|
-
!iconChecked && !iconUnchecked && /* @__PURE__ */ (0,
|
|
2857
|
-
typeof label === "string" && /* @__PURE__ */ (0,
|
|
3031
|
+
!iconChecked && !iconUnchecked && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: variantClass, "data-testid": "yr3Radio-dot" }),
|
|
3032
|
+
typeof label === "string" && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
2858
3033
|
"span",
|
|
2859
3034
|
{
|
|
2860
3035
|
className: "yr3Radio--label",
|
|
@@ -2867,7 +3042,7 @@ var Radio = ({
|
|
|
2867
3042
|
};
|
|
2868
3043
|
|
|
2869
3044
|
// src/components/Select/Select.tsx
|
|
2870
|
-
var
|
|
3045
|
+
var React21 = __toESM(require("react"), 1);
|
|
2871
3046
|
|
|
2872
3047
|
// src/components/Select/select.variants.ts
|
|
2873
3048
|
var selectVariants = createVariants({
|
|
@@ -2927,8 +3102,8 @@ var selectIconVariants = createVariants({
|
|
|
2927
3102
|
});
|
|
2928
3103
|
|
|
2929
3104
|
// src/components/Select/Select.tsx
|
|
2930
|
-
var
|
|
2931
|
-
var
|
|
3105
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
3106
|
+
var initiaPropsComponent4 = {
|
|
2932
3107
|
control: {
|
|
2933
3108
|
variant: "outlined",
|
|
2934
3109
|
color: "primary",
|
|
@@ -2967,15 +3142,15 @@ var initiaPropsComponent3 = {
|
|
|
2967
3142
|
}
|
|
2968
3143
|
};
|
|
2969
3144
|
var Select = ({ label, options, name, value, defaultValue, onChange, propsComponent }) => {
|
|
2970
|
-
const [open, setOpen] =
|
|
2971
|
-
const [valueState, setValueState] =
|
|
2972
|
-
const ref =
|
|
3145
|
+
const [open, setOpen] = React21.useState(false);
|
|
3146
|
+
const [valueState, setValueState] = React21.useState(value || defaultValue || null);
|
|
3147
|
+
const ref = React21.useRef(null);
|
|
2973
3148
|
useClickAway(ref, () => setOpen(false));
|
|
2974
|
-
const properties = mergeDeep(
|
|
3149
|
+
const properties = mergeDeep(initiaPropsComponent4, propsComponent || {});
|
|
2975
3150
|
const classesIcon = selectIconVariants({ color: properties?.icon?.color, animated: open, open });
|
|
2976
3151
|
const classes = selectVariants({ wrapper: true });
|
|
2977
|
-
return /* @__PURE__ */ (0,
|
|
2978
|
-
/* @__PURE__ */ (0,
|
|
3152
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: classes, ref, children: [
|
|
3153
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
2979
3154
|
Input,
|
|
2980
3155
|
{
|
|
2981
3156
|
label,
|
|
@@ -2988,14 +3163,14 @@ var Select = ({ label, options, name, value, defaultValue, onChange, propsCompon
|
|
|
2988
3163
|
}
|
|
2989
3164
|
}
|
|
2990
3165
|
),
|
|
2991
|
-
/* @__PURE__ */ (0,
|
|
3166
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
2992
3167
|
"div",
|
|
2993
3168
|
{
|
|
2994
3169
|
className: classesIcon,
|
|
2995
3170
|
style: properties?.icon?.style,
|
|
2996
3171
|
onClick: () => setOpen((prev) => !prev),
|
|
2997
3172
|
"data-testid": "yr3Select-icon",
|
|
2998
|
-
children: properties?.icon?.component ? properties?.icon.component : /* @__PURE__ */ (0,
|
|
3173
|
+
children: properties?.icon?.component ? properties?.icon.component : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
2999
3174
|
IconDown,
|
|
3000
3175
|
{
|
|
3001
3176
|
width: properties?.icon?.style?.width,
|
|
@@ -3006,13 +3181,13 @@ var Select = ({ label, options, name, value, defaultValue, onChange, propsCompon
|
|
|
3006
3181
|
)
|
|
3007
3182
|
}
|
|
3008
3183
|
),
|
|
3009
|
-
open && /* @__PURE__ */ (0,
|
|
3184
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
3010
3185
|
"div",
|
|
3011
3186
|
{
|
|
3012
3187
|
className: "yr3Select--menu",
|
|
3013
3188
|
style: composeStyles(properties?.menu?.ui, properties?.menu?.style),
|
|
3014
3189
|
"data-testid": "yr3Select-menu",
|
|
3015
|
-
children: options.map((opt) => /* @__PURE__ */ (0,
|
|
3190
|
+
children: options.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
3016
3191
|
"div",
|
|
3017
3192
|
{
|
|
3018
3193
|
className: "yr3Select--option",
|
|
@@ -3034,7 +3209,7 @@ var Select = ({ label, options, name, value, defaultValue, onChange, propsCompon
|
|
|
3034
3209
|
onChange?.(event, opt.value);
|
|
3035
3210
|
},
|
|
3036
3211
|
style: composeStyles(properties?.menu?.options?.ui, properties?.menu?.options?.style),
|
|
3037
|
-
children: /* @__PURE__ */ (0,
|
|
3212
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Text, { as: "span", variant: "caption", color: properties?.menu?.options?.text?.color || "primary", ...properties?.menu?.options?.text, children: opt.label })
|
|
3038
3213
|
},
|
|
3039
3214
|
opt.value
|
|
3040
3215
|
))
|
|
@@ -3044,8 +3219,8 @@ var Select = ({ label, options, name, value, defaultValue, onChange, propsCompon
|
|
|
3044
3219
|
};
|
|
3045
3220
|
|
|
3046
3221
|
// src/components/Slide/Slide.tsx
|
|
3047
|
-
var
|
|
3048
|
-
var
|
|
3222
|
+
var React22 = __toESM(require("react"), 1);
|
|
3223
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
3049
3224
|
var initialPropsComponent5 = {
|
|
3050
3225
|
slide: {
|
|
3051
3226
|
ui: {},
|
|
@@ -3068,7 +3243,7 @@ var Slide = ({
|
|
|
3068
3243
|
"in": !!inProp,
|
|
3069
3244
|
"out": !inProp
|
|
3070
3245
|
});
|
|
3071
|
-
|
|
3246
|
+
React22.useEffect(() => {
|
|
3072
3247
|
let timeoutId;
|
|
3073
3248
|
if (inProp) {
|
|
3074
3249
|
timeoutId = setTimeout(() => {
|
|
@@ -3078,19 +3253,19 @@ var Slide = ({
|
|
|
3078
3253
|
return () => clearTimeout(timeoutId);
|
|
3079
3254
|
}, [inProp, duration, onTransitionEnd]);
|
|
3080
3255
|
const uiStyleContent = uiStyle({ ...properties?.slide?.ui, transitionDuration: `${duration}ms` });
|
|
3081
|
-
return /* @__PURE__ */ (0,
|
|
3256
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
3082
3257
|
"div",
|
|
3083
3258
|
{
|
|
3084
3259
|
className: "yr3Slide",
|
|
3085
3260
|
style: composeStyles(),
|
|
3086
3261
|
"data-testid": "yr3Slide",
|
|
3087
|
-
children: /* @__PURE__ */ (0,
|
|
3262
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
3088
3263
|
"div",
|
|
3089
3264
|
{
|
|
3090
3265
|
className: classNameContent,
|
|
3091
3266
|
style: composeStyles(uiStyleContent, properties?.slide?.style || {}),
|
|
3092
3267
|
"data-testid": "yr3Slide-content",
|
|
3093
|
-
children: /* @__PURE__ */ (0,
|
|
3268
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Box, { ...properties?.box, "data-testid": "yr3Slide-box", children })
|
|
3094
3269
|
}
|
|
3095
3270
|
)
|
|
3096
3271
|
}
|
|
@@ -3098,7 +3273,7 @@ var Slide = ({
|
|
|
3098
3273
|
};
|
|
3099
3274
|
|
|
3100
3275
|
// src/components/Switch/Switch.tsx
|
|
3101
|
-
var
|
|
3276
|
+
var React23 = __toESM(require("react"), 1);
|
|
3102
3277
|
|
|
3103
3278
|
// src/components/Switch/switch.variants.ts
|
|
3104
3279
|
var switchVariants = createVariants({
|
|
@@ -3135,7 +3310,7 @@ var switchVariants = createVariants({
|
|
|
3135
3310
|
});
|
|
3136
3311
|
|
|
3137
3312
|
// src/components/Switch/Switch.tsx
|
|
3138
|
-
var
|
|
3313
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
3139
3314
|
var Switch = ({
|
|
3140
3315
|
checked,
|
|
3141
3316
|
defaultChecked,
|
|
@@ -3147,7 +3322,7 @@ var Switch = ({
|
|
|
3147
3322
|
placement = "end",
|
|
3148
3323
|
propsComponent
|
|
3149
3324
|
}) => {
|
|
3150
|
-
const [internal, setInternal] =
|
|
3325
|
+
const [internal, setInternal] = React23.useState(defaultChecked || false);
|
|
3151
3326
|
const classname = switchVariants({ colors: color, size, disabled: !!disabled, checked: checked ?? internal, placement });
|
|
3152
3327
|
const isControlled = checked !== void 0;
|
|
3153
3328
|
const value = isControlled ? checked : internal;
|
|
@@ -3155,13 +3330,13 @@ var Switch = ({
|
|
|
3155
3330
|
if (!isControlled) setInternal(e.target.checked);
|
|
3156
3331
|
onChange?.(e, e.target.checked);
|
|
3157
3332
|
};
|
|
3158
|
-
return /* @__PURE__ */ (0,
|
|
3333
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
3159
3334
|
"label",
|
|
3160
3335
|
{
|
|
3161
3336
|
className: classname,
|
|
3162
3337
|
"data-testid": "yr3Switch",
|
|
3163
3338
|
children: [
|
|
3164
|
-
/* @__PURE__ */ (0,
|
|
3339
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
3165
3340
|
"input",
|
|
3166
3341
|
{
|
|
3167
3342
|
type: "checkbox",
|
|
@@ -3170,8 +3345,8 @@ var Switch = ({
|
|
|
3170
3345
|
disabled
|
|
3171
3346
|
}
|
|
3172
3347
|
),
|
|
3173
|
-
/* @__PURE__ */ (0,
|
|
3174
|
-
/* @__PURE__ */ (0,
|
|
3348
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "yr3Switch--track", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "yr3Switch--thumb" }) }),
|
|
3349
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
3175
3350
|
"span",
|
|
3176
3351
|
{
|
|
3177
3352
|
className: "yr3Switch--label",
|
|
@@ -3186,14 +3361,14 @@ var Switch = ({
|
|
|
3186
3361
|
};
|
|
3187
3362
|
|
|
3188
3363
|
// src/theme/ThemeProvider.tsx
|
|
3189
|
-
var
|
|
3364
|
+
var React25 = __toESM(require("react"), 1);
|
|
3190
3365
|
|
|
3191
3366
|
// src/theme/notistackContext.tsx
|
|
3192
|
-
var
|
|
3193
|
-
var
|
|
3194
|
-
var NotistackContext =
|
|
3367
|
+
var React24 = __toESM(require("react"), 1);
|
|
3368
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
3369
|
+
var NotistackContext = React24.createContext(null);
|
|
3195
3370
|
var NotistackProvider = ({ children }) => {
|
|
3196
|
-
const [snacks, setSnacks] =
|
|
3371
|
+
const [snacks, setSnacks] = React24.useState([]);
|
|
3197
3372
|
const notistack = (snack) => {
|
|
3198
3373
|
const id = Date.now();
|
|
3199
3374
|
setSnacks((prev) => [...prev, { ...snack, id, exiting: false }]);
|
|
@@ -3208,13 +3383,13 @@ var NotistackProvider = ({ children }) => {
|
|
|
3208
3383
|
setSnacks((prev) => prev.filter((s) => s.id !== id));
|
|
3209
3384
|
}, duration + exitDuration);
|
|
3210
3385
|
};
|
|
3211
|
-
return /* @__PURE__ */ (0,
|
|
3386
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(NotistackContext.Provider, { value: { notistack }, children: [
|
|
3212
3387
|
children,
|
|
3213
|
-
/* @__PURE__ */ (0,
|
|
3388
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "yr3NotistackContainer", children: snacks.map((snack) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Notistack, { ...snack }, snack.id)) })
|
|
3214
3389
|
] });
|
|
3215
3390
|
};
|
|
3216
3391
|
var useNotistack = () => {
|
|
3217
|
-
const ctx =
|
|
3392
|
+
const ctx = React24.useContext(NotistackContext);
|
|
3218
3393
|
if (!ctx) {
|
|
3219
3394
|
throw new Error("NotistackProvider missing");
|
|
3220
3395
|
}
|
|
@@ -3222,15 +3397,15 @@ var useNotistack = () => {
|
|
|
3222
3397
|
};
|
|
3223
3398
|
|
|
3224
3399
|
// src/theme/ThemeProvider.tsx
|
|
3225
|
-
var
|
|
3226
|
-
var ThemeContext =
|
|
3400
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
3401
|
+
var ThemeContext = React25.createContext(null);
|
|
3227
3402
|
var ThemeProvider = ({ theme, children }) => {
|
|
3228
|
-
|
|
3403
|
+
React25.useEffect(() => {
|
|
3229
3404
|
applyTheme(theme);
|
|
3230
3405
|
}, [theme]);
|
|
3231
|
-
return /* @__PURE__ */ (0,
|
|
3406
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(ThemeContext.Provider, { value: theme, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(BackdropProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(NotistackProvider, { children }) }) });
|
|
3232
3407
|
};
|
|
3233
|
-
var useTheme = () =>
|
|
3408
|
+
var useTheme = () => React25.useContext(ThemeContext);
|
|
3234
3409
|
|
|
3235
3410
|
// src/theme/tokens.ts
|
|
3236
3411
|
var baseTokens = {
|
|
@@ -3251,15 +3426,15 @@ var baseTokens = {
|
|
|
3251
3426
|
};
|
|
3252
3427
|
|
|
3253
3428
|
// src/theme/useMediaQuery.tsx
|
|
3254
|
-
var
|
|
3429
|
+
var React26 = __toESM(require("react"), 1);
|
|
3255
3430
|
function useMediaQuery(query) {
|
|
3256
3431
|
const theme = useTheme();
|
|
3257
3432
|
const computedQuery = typeof query === "function" ? query(theme) : query;
|
|
3258
|
-
const [matches, setMatches] =
|
|
3433
|
+
const [matches, setMatches] = React26.useState(() => {
|
|
3259
3434
|
if (typeof window === "undefined") return false;
|
|
3260
3435
|
return window.matchMedia(computedQuery).matches;
|
|
3261
3436
|
});
|
|
3262
|
-
|
|
3437
|
+
React26.useEffect(() => {
|
|
3263
3438
|
if (typeof window === "undefined") return;
|
|
3264
3439
|
const media = window.matchMedia(computedQuery);
|
|
3265
3440
|
const listener = () => setMatches(media.matches);
|
|
@@ -3293,7 +3468,7 @@ var usePlaces = ({ input, language, apiKey, provider }) => {
|
|
|
3293
3468
|
};
|
|
3294
3469
|
|
|
3295
3470
|
// src/hooks/useBreakpoint.ts
|
|
3296
|
-
var
|
|
3471
|
+
var React27 = __toESM(require("react"), 1);
|
|
3297
3472
|
var breakUp = (bp) => `(min-width: ${bp}px)`;
|
|
3298
3473
|
var breakDown = (bp) => `(max-width: ${bp}px)`;
|
|
3299
3474
|
function useBreakpoint(queryInput) {
|
|
@@ -3303,8 +3478,8 @@ function useBreakpoint(queryInput) {
|
|
|
3303
3478
|
if (typeof window === "undefined") return false;
|
|
3304
3479
|
return window.matchMedia(query).matches;
|
|
3305
3480
|
};
|
|
3306
|
-
const [matches, setMatches] =
|
|
3307
|
-
|
|
3481
|
+
const [matches, setMatches] = React27.useState(getMatch);
|
|
3482
|
+
React27.useEffect(() => {
|
|
3308
3483
|
if (typeof window === "undefined") return;
|
|
3309
3484
|
const media = window.matchMedia(query);
|
|
3310
3485
|
const listener = (e) => {
|
|
@@ -3369,6 +3544,7 @@ initTheme();
|
|
|
3369
3544
|
NotistackProvider,
|
|
3370
3545
|
Pending,
|
|
3371
3546
|
Phone,
|
|
3547
|
+
Picker,
|
|
3372
3548
|
PlacesAutocomplete,
|
|
3373
3549
|
Radio,
|
|
3374
3550
|
Select,
|