@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/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, years, month, formatMonth, monthsDisabled }) {
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(formatMonth || "MMM"),
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") || monthsDisabled && monthsDisabled.includes(i)
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,29 @@ var initialPropsComponent3 = {
1801
1810
  style: {}
1802
1811
  }
1803
1812
  };
1804
- var MonthSelector = ({ label, year, month, value, defaultValue, propsComponent, years, language, formatMonth = "MMM", monthsDisabled }) => {
1813
+ var MonthSelector = ({ label, value, disabled, propsComponent, data, daysFormat, onNext, onLast, onChange }) => {
1805
1814
  const [open, setOpen] = React10.useState(false);
1806
- const [valueState, setValueState] = React10.useState(value || defaultValue || null);
1807
- const [yearSelected, setYearSelected] = React10.useState(years.findIndex((y) => y === year) || 0);
1815
+ const [valueState, setValueState] = React10.useState(value || null);
1816
+ const [yearSelected, setYearSelected] = React10.useState(data?.years.findIndex((y) => 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 data = React10.useMemo(() => getMonthCalendarProps({ year, month, years, language, formatMonth, monthsDisabled }), [year, month, years, language, formatMonth, monthsDisabled]);
1822
+ const getData = React10.useMemo(() => {
1823
+ if (!disabled) return {};
1824
+ return getMonthCalendarProps({ year: data.years[yearSelected], data, daysFormat, value: valueState });
1825
+ }, [yearSelected, data, daysFormat, valueState, disabled]);
1826
+ React10.useEffect(() => {
1827
+ if (onNext) onNext(getData.prev);
1828
+ if (onLast) onLast(getData.last);
1829
+ }, [getData]);
1830
+ React10.useEffect(() => {
1831
+ setValueState(value || null);
1832
+ }, [value]);
1833
+ React10.useEffect(() => {
1834
+ if (onChange && valueState && !disabled) onChange(valueState);
1835
+ }, [valueState, onChange, disabled]);
1814
1836
  return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "yr3MonthSelector", ref, children: [
1815
1837
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
1816
1838
  Input,
@@ -1830,7 +1852,7 @@ var MonthSelector = ({ label, year, month, value, defaultValue, propsComponent,
1830
1852
  {
1831
1853
  className: iconClasses,
1832
1854
  style: properties?.icon?.style,
1833
- onClick: () => setOpen((prev) => !prev),
1855
+ onClick: () => !disabled && setOpen((prev) => !prev),
1834
1856
  "data-testid": "yr3MonthSelector--icon",
1835
1857
  children: properties?.icon?.component ? properties?.icon.component : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
1836
1858
  IconCalendar,
@@ -1856,17 +1878,26 @@ var MonthSelector = ({ label, year, month, value, defaultValue, propsComponent,
1856
1878
  className: containerClasses,
1857
1879
  style: composeStyles(properties?.container?.ui, properties?.container?.style),
1858
1880
  children: [
1859
- /* @__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" }) }),
1881
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
1882
+ "button",
1883
+ {
1884
+ disabled: disabled || yearSelected === 0,
1885
+ type: "button",
1886
+ className: `yr3MonthSelector--year-button-back ${yearSelected === 0 ? "yr3MonthSelector--year-button-back--disabled" : ""} `,
1887
+ onClick: () => setYearSelected(yearSelected - 1),
1888
+ children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(IconLeft, { width: 20, height: 20, stroke: "currentColor" })
1889
+ }
1890
+ ),
1860
1891
  /* @__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],
1892
+ data.years[yearSelected],
1862
1893
  " "
1863
1894
  ] }) }),
1864
1895
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
1865
1896
  "button",
1866
1897
  {
1867
- disabled: yearSelected === years.length - 1,
1898
+ disabled: disabled || yearSelected === data.years.length - 1,
1868
1899
  type: "button",
1869
- className: `yr3MonthSelector--year-button-next ${yearSelected === years.length - 1 ? "yr3MonthSelector--year-button-next--disabled" : ""}`,
1900
+ className: `yr3MonthSelector--year-button-next ${yearSelected === data.years.length - 1 ? "yr3MonthSelector--year-button-next--disabled" : ""}`,
1870
1901
  onClick: () => setYearSelected(yearSelected + 1),
1871
1902
  children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(IconRight, { width: 20, height: 30, stroke: "currentColor" })
1872
1903
  }
@@ -1874,15 +1905,15 @@ var MonthSelector = ({ label, year, month, value, defaultValue, propsComponent,
1874
1905
  ]
1875
1906
  }
1876
1907
  ),
1877
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "yr3MonthSelector--months", children: data.months.map((m) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
1908
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "yr3MonthSelector--months", children: getData.months.map((m) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
1878
1909
  "button",
1879
1910
  {
1880
1911
  type: "button",
1881
1912
  style: properties?.text?.button,
1882
1913
  disabled: m.disabled,
1883
- className: `yr3MonthSelector--month ${m.disabled ? "yr3MonthSelector--month-disabled" : ""}`,
1914
+ className: `yr3MonthSelector--month ${m.disabled ? "yr3MonthSelector--month--disabled" : ""} ${m.selected ? "yr3MonthSelector--month--selected" : ""}`,
1884
1915
  onClick: () => {
1885
- setValueState(`${m.value}-${years[yearSelected]}`);
1916
+ setValueState(`${m.value}-${data.years[yearSelected]}`);
1886
1917
  setOpen(false);
1887
1918
  },
1888
1919
  children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { ...properties?.text, weight: m.disabled ? "thin" : "medium", children: m.label })
@@ -2564,12 +2595,171 @@ var Pending = ({
2564
2595
  );
2565
2596
  };
2566
2597
 
2598
+ // src/components/Picker/Picker.tsx
2599
+ var React17 = __toESM(require("react"), 1);
2600
+
2601
+ // src/components/Picker/picker.variants.ts
2602
+ var PickerVariants = createVariants({
2603
+ base: "yr3Picker",
2604
+ variants: {
2605
+ variant: {
2606
+ filled: "yr3Picker--filled",
2607
+ outlined: "yr3Picker--outlined",
2608
+ base: "yr3Picker--base",
2609
+ lined: "yr3Picker--lined"
2610
+ },
2611
+ color: {
2612
+ primary: "yr3Picker--color-primary",
2613
+ secondary: "yr3Picker--color-secondary",
2614
+ success: "yr3Picker--color-success",
2615
+ text: "yr3Picker--color-text",
2616
+ disabled: "yr3Picker--color-disabled",
2617
+ background: "yr3Picker--color-background",
2618
+ error: "yr3Picker--color-error",
2619
+ warning: "yr3Picker--color-warning",
2620
+ info: "yr3Picker--color-info",
2621
+ common: "yr3Picker--color-common"
2622
+ },
2623
+ animated: {
2624
+ true: "yr3Picker--animated"
2625
+ },
2626
+ icon: {
2627
+ true: "yr3Picker--icon"
2628
+ },
2629
+ wrapper: {
2630
+ true: "yr3Picker--wrapper"
2631
+ }
2632
+ }
2633
+ });
2634
+ var PickerIconVariants = createVariants({
2635
+ base: "yr3Picker--icon",
2636
+ variants: {
2637
+ color: {
2638
+ primary: "yr3Picker--icon-color-primary",
2639
+ secondary: "yr3Picker--icon-color-secondary",
2640
+ success: "yr3Picker--icon-color-success",
2641
+ text: "yr3Picker--icon-color-text",
2642
+ disabled: "yr3Picker--icon-color-disabled",
2643
+ background: "yr3Picker--icon-color-background",
2644
+ error: "yr3Picker--icon-color-error",
2645
+ warning: "yr3Picker--icon-color-warning",
2646
+ info: "yr3Picker--icon-color-info",
2647
+ common: "yr3Picker--icon-color-common"
2648
+ },
2649
+ animated: {
2650
+ true: "yr3Picker--icon-animated"
2651
+ },
2652
+ open: {
2653
+ true: "yr3Picker--icon-open"
2654
+ }
2655
+ }
2656
+ });
2657
+
2658
+ // src/components/Picker/Picker.tsx
2659
+ var import_jsx_runtime37 = require("react/jsx-runtime");
2660
+ var initiaPropsComponent3 = {
2661
+ control: {
2662
+ variant: "outlined",
2663
+ color: "primary",
2664
+ ui: {},
2665
+ style: {}
2666
+ },
2667
+ label: {
2668
+ display: true,
2669
+ color: "primary",
2670
+ ui: {},
2671
+ style: {}
2672
+ },
2673
+ wrapper: {
2674
+ ui: {},
2675
+ style: {}
2676
+ },
2677
+ icon: {
2678
+ style: {
2679
+ width: 24,
2680
+ height: 24
2681
+ },
2682
+ color: "primary",
2683
+ component: void 0
2684
+ }
2685
+ };
2686
+ var Picker = ({ label, variant, color, children, name, value, onChange, propsComponent, closeOnSelect }) => {
2687
+ const [open, setOpen] = React17.useState(false);
2688
+ const [valueState, setValueState] = React17.useState(value || null);
2689
+ const ref = React17.useRef(null);
2690
+ useClickAway(ref, () => setOpen(false));
2691
+ const properties = mergeDeep(initiaPropsComponent3, propsComponent || {});
2692
+ const classesIcon = PickerIconVariants({ color: properties?.icon?.color, animated: open, open });
2693
+ const classes = PickerVariants({ wrapper: true, variant, color });
2694
+ React17.useEffect(() => {
2695
+ if (value !== void 0) {
2696
+ setValueState(value);
2697
+ }
2698
+ }, [value]);
2699
+ React17.useEffect(() => {
2700
+ if (closeOnSelect && valueState) {
2701
+ setOpen(false);
2702
+ }
2703
+ }, [valueState, closeOnSelect]);
2704
+ React17.useEffect(() => {
2705
+ if (valueState !== null && onChange) {
2706
+ onChange({ event: {}, target: { name, value: valueState }, currentTarget: { name, value: valueState } }, valueState);
2707
+ }
2708
+ }, [valueState, onChange, name]);
2709
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: classes, ref, children: [
2710
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
2711
+ Input,
2712
+ {
2713
+ label,
2714
+ variant: "base",
2715
+ disabled: true,
2716
+ color,
2717
+ value: valueState || "",
2718
+ propsComponent: {
2719
+ control: {
2720
+ variant,
2721
+ color
2722
+ },
2723
+ label: properties?.label
2724
+ }
2725
+ }
2726
+ ),
2727
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
2728
+ "div",
2729
+ {
2730
+ className: classesIcon,
2731
+ style: properties?.icon?.style,
2732
+ onClick: () => setOpen((prev) => !prev),
2733
+ "data-testid": "yr3Picker--icon",
2734
+ children: properties?.icon?.component ? properties?.icon.component : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
2735
+ IconDown,
2736
+ {
2737
+ width: properties?.icon?.style?.width,
2738
+ height: properties?.icon?.style?.height,
2739
+ stroke: "currentColor",
2740
+ style: properties?.icon?.style
2741
+ }
2742
+ )
2743
+ }
2744
+ ),
2745
+ open && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
2746
+ "div",
2747
+ {
2748
+ className: "yr3Picker--container",
2749
+ style: composeStyles(properties?.wrapper?.ui, properties?.wrapper?.style),
2750
+ "data-testid": "yr3Picker-container",
2751
+ children
2752
+ }
2753
+ )
2754
+ ] });
2755
+ };
2756
+
2567
2757
  // src/components/Phone/Phone.tsx
2568
- var React18 = __toESM(require("react"), 1);
2758
+ var React19 = __toESM(require("react"), 1);
2569
2759
 
2570
2760
  // src/components/Selector/Selector.tsx
2571
- var React17 = __toESM(require("react"), 1);
2572
- var import_jsx_runtime37 = require("react/jsx-runtime");
2761
+ var React18 = __toESM(require("react"), 1);
2762
+ var import_jsx_runtime38 = require("react/jsx-runtime");
2573
2763
  var initalPropsComponent2 = {
2574
2764
  text: {
2575
2765
  variant: "caption",
@@ -2582,16 +2772,16 @@ var initalPropsComponent2 = {
2582
2772
  }
2583
2773
  };
2584
2774
  var Selector = ({ ui, style, options, name, value, defaultValue, onChange, iconColor, icon, propsComponent = initalPropsComponent2 }) => {
2585
- const [open, setOpen] = React17.useState(false);
2586
- const [valueState, setValueState] = React17.useState(value || defaultValue || null);
2587
- const ref = React17.useRef(null);
2775
+ const [open, setOpen] = React18.useState(false);
2776
+ const [valueState, setValueState] = React18.useState(value || defaultValue || null);
2777
+ const ref = React18.useRef(null);
2588
2778
  useClickAway(ref, () => setOpen(false));
2589
- return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "yr3Selector-wrapper", ref, children: [
2590
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: `yr3Selector ${open ? "yr3Selector--open" : ""}`, style: composeStyles(ui, style), children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "yr3Selector--control", children: [
2591
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "yr3Selector--icon", onClick: () => setOpen((prev) => !prev), children: icon ? icon : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(IconDown, { stroke: `var(--color-${iconColor || "disabled"})`, width: 24, height: 24 }) }),
2779
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "yr3Selector-wrapper", ref, children: [
2780
+ /* @__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: [
2781
+ /* @__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
2782
  valueState
2593
2783
  ] }) }),
2594
- open && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "yr3Selector--menu", style: composeStyles(propsComponent.menu?.ui, propsComponent.menu?.style), children: options.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
2784
+ 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
2785
  "div",
2596
2786
  {
2597
2787
  className: "yr3Selector--option",
@@ -2612,7 +2802,7 @@ var Selector = ({ ui, style, options, name, value, defaultValue, onChange, iconC
2612
2802
  };
2613
2803
  onChange?.(event, opt.value);
2614
2804
  },
2615
- children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Text, { ...propsComponent?.text, children: propsComponent?.text?.children || opt.label })
2805
+ children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text, { ...propsComponent?.text, children: propsComponent?.text?.children || opt.label })
2616
2806
  },
2617
2807
  opt.value
2618
2808
  )) })
@@ -2620,7 +2810,7 @@ var Selector = ({ ui, style, options, name, value, defaultValue, onChange, iconC
2620
2810
  };
2621
2811
 
2622
2812
  // src/components/Phone/Phone.tsx
2623
- var import_jsx_runtime38 = require("react/jsx-runtime");
2813
+ var import_jsx_runtime39 = require("react/jsx-runtime");
2624
2814
  var Phone = ({
2625
2815
  name,
2626
2816
  value,
@@ -2632,13 +2822,13 @@ var Phone = ({
2632
2822
  }) => {
2633
2823
  const isControlled = value !== void 0;
2634
2824
  const initial = value || defaultValue || "";
2635
- const [prefix, setPrefix] = React18.useState(
2825
+ const [prefix, setPrefix] = React19.useState(
2636
2826
  getDialPhone(initial, countries) || countries[0].dial
2637
2827
  );
2638
- const [number, setNumber] = React18.useState(
2828
+ const [number, setNumber] = React19.useState(
2639
2829
  getNumberPhone(initial, prefix) || ""
2640
2830
  );
2641
- React18.useEffect(() => {
2831
+ React19.useEffect(() => {
2642
2832
  if (isControlled && value) {
2643
2833
  const dial = getDialPhone(value, countries);
2644
2834
  const num = getNumberPhone(value, dial);
@@ -2657,10 +2847,10 @@ var Phone = ({
2657
2847
  setPrefix(val);
2658
2848
  onChange?.(null, `${val}${number}`);
2659
2849
  };
2660
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Control, { variant: "outlined", ui: { height: 50, position: "relative" }, children: [
2661
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Label, { text: label, className: "yr3Input--active" }),
2662
- /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Flex, { variant: "row", container: true, center: true, children: [
2663
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
2850
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Control, { variant: "outlined", ui: { height: 50, position: "relative" }, children: [
2851
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Label, { text: label, className: "yr3Input--active" }),
2852
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Flex, { variant: "row", container: true, center: true, children: [
2853
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
2664
2854
  Selector,
2665
2855
  {
2666
2856
  options: countries.map((c) => ({
@@ -2672,7 +2862,7 @@ var Phone = ({
2672
2862
  ...propsComponent?.selector
2673
2863
  }
2674
2864
  ),
2675
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
2865
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
2676
2866
  Divider,
2677
2867
  {
2678
2868
  orientation: "vertical",
@@ -2681,7 +2871,7 @@ var Phone = ({
2681
2871
  ...propsComponent?.divider
2682
2872
  }
2683
2873
  ),
2684
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
2874
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
2685
2875
  Input,
2686
2876
  {
2687
2877
  type: "number",
@@ -2697,9 +2887,9 @@ var Phone = ({
2697
2887
  };
2698
2888
 
2699
2889
  // src/components/Places/PlacesAutocomplete.tsx
2700
- var React19 = __toESM(require("react"), 1);
2890
+ var React20 = __toESM(require("react"), 1);
2701
2891
  var import_autocomplete_places = require("@yr3/autocomplete-places");
2702
- var import_jsx_runtime39 = require("react/jsx-runtime");
2892
+ var import_jsx_runtime40 = require("react/jsx-runtime");
2703
2893
  var initPropsComponent = {
2704
2894
  label: {
2705
2895
  display: true,
@@ -2739,9 +2929,9 @@ var PlacesAutocomplete = ({
2739
2929
  keyApi,
2740
2930
  propsComponent = initPropsComponent
2741
2931
  }) => {
2742
- const [value, setValue] = React19.useState(null);
2743
- const inputRef = React19.useRef(null);
2744
- const [anchorEl, setAnchorEl] = React19.useState(null);
2932
+ const [value, setValue] = React20.useState(null);
2933
+ const inputRef = React20.useRef(null);
2934
+ const [anchorEl, setAnchorEl] = React20.useState(null);
2745
2935
  const { suggestions, selectPlace } = (0, import_autocomplete_places.useAutocompletePlaces)({ input: value, apiKey: keyApi, language, provider });
2746
2936
  const handleSelect = async (id) => {
2747
2937
  const place = await selectPlace(id);
@@ -2761,12 +2951,12 @@ var PlacesAutocomplete = ({
2761
2951
  setValue(place.address);
2762
2952
  setAnchorEl(null);
2763
2953
  };
2764
- React19.useEffect(() => {
2954
+ React20.useEffect(() => {
2765
2955
  if (defaultLocation) {
2766
2956
  setValue(defaultLocation);
2767
2957
  }
2768
2958
  }, [defaultLocation]);
2769
- React19.useEffect(() => {
2959
+ React20.useEffect(() => {
2770
2960
  if (value === "") {
2771
2961
  onSelect(null);
2772
2962
  }
@@ -2776,13 +2966,13 @@ var PlacesAutocomplete = ({
2776
2966
  setAnchorEl(e.target.value ? inputRef.current : null);
2777
2967
  };
2778
2968
  const open = suggestions.length > 0 && Boolean(anchorEl);
2779
- React19.useEffect(() => {
2969
+ React20.useEffect(() => {
2780
2970
  if (onChangeForm) {
2781
2971
  onChangeForm({ target: { value } });
2782
2972
  }
2783
2973
  }, [onChangeForm]);
2784
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Control, { ...propsComponent?.control, children: [
2785
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
2974
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(Control, { ...propsComponent?.control, children: [
2975
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
2786
2976
  Input,
2787
2977
  {
2788
2978
  ref: inputRef,
@@ -2796,7 +2986,7 @@ var PlacesAutocomplete = ({
2796
2986
  },
2797
2987
  "input-places"
2798
2988
  ),
2799
- open && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "yr3Places--menu", style: composeStyles(propsComponent.menu?.ui, propsComponent?.menu?.style), children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Flex, { container: true, ui: { p: 1 }, children: suggestions.map((s) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Flex, { onClick: () => handleSelect(s.id), ui: { padding: 8, cursor: "pointer", "&:hover": { backgroundColor: "rgba(0,0,0,0.1)" } }, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { ...propsComponent?.menu?.text, children: s.description }) }, s.id)) }) })
2989
+ 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
2990
  ] });
2801
2991
  };
2802
2992
 
@@ -2824,7 +3014,7 @@ var radioVariant = createVariants({
2824
3014
  });
2825
3015
 
2826
3016
  // src/components/Radio/Radio.tsx
2827
- var import_jsx_runtime40 = require("react/jsx-runtime");
3017
+ var import_jsx_runtime41 = require("react/jsx-runtime");
2828
3018
  var Radio = ({
2829
3019
  checked,
2830
3020
  value,
@@ -2840,8 +3030,8 @@ var Radio = ({
2840
3030
  const bemClass = bem("yr3Radio");
2841
3031
  const classes = bemClass(void 0, { [color]: `color-${color}` });
2842
3032
  const variantClass = radioVariant({ variant });
2843
- return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("label", { className: classes, "data-testid": "yr3Radio", style: composeStyles(propsComponent?.radio?.ui, propsComponent?.radio?.style), children: [
2844
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
3033
+ return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("label", { className: classes, "data-testid": "yr3Radio", style: composeStyles(propsComponent?.radio?.ui, propsComponent?.radio?.style), children: [
3034
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
2845
3035
  "input",
2846
3036
  {
2847
3037
  type: "radio",
@@ -2853,8 +3043,8 @@ var Radio = ({
2853
3043
  }
2854
3044
  ),
2855
3045
  iconChecked && checked ? iconChecked : !checked && iconUnchecked ? iconUnchecked : null,
2856
- !iconChecked && !iconUnchecked && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: variantClass, "data-testid": "yr3Radio-dot" }),
2857
- typeof label === "string" && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
3046
+ !iconChecked && !iconUnchecked && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: variantClass, "data-testid": "yr3Radio-dot" }),
3047
+ typeof label === "string" && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
2858
3048
  "span",
2859
3049
  {
2860
3050
  className: "yr3Radio--label",
@@ -2867,7 +3057,7 @@ var Radio = ({
2867
3057
  };
2868
3058
 
2869
3059
  // src/components/Select/Select.tsx
2870
- var React20 = __toESM(require("react"), 1);
3060
+ var React21 = __toESM(require("react"), 1);
2871
3061
 
2872
3062
  // src/components/Select/select.variants.ts
2873
3063
  var selectVariants = createVariants({
@@ -2927,8 +3117,8 @@ var selectIconVariants = createVariants({
2927
3117
  });
2928
3118
 
2929
3119
  // src/components/Select/Select.tsx
2930
- var import_jsx_runtime41 = require("react/jsx-runtime");
2931
- var initiaPropsComponent3 = {
3120
+ var import_jsx_runtime42 = require("react/jsx-runtime");
3121
+ var initiaPropsComponent4 = {
2932
3122
  control: {
2933
3123
  variant: "outlined",
2934
3124
  color: "primary",
@@ -2967,15 +3157,15 @@ var initiaPropsComponent3 = {
2967
3157
  }
2968
3158
  };
2969
3159
  var Select = ({ label, options, name, value, defaultValue, onChange, propsComponent }) => {
2970
- const [open, setOpen] = React20.useState(false);
2971
- const [valueState, setValueState] = React20.useState(value || defaultValue || null);
2972
- const ref = React20.useRef(null);
3160
+ const [open, setOpen] = React21.useState(false);
3161
+ const [valueState, setValueState] = React21.useState(value || defaultValue || null);
3162
+ const ref = React21.useRef(null);
2973
3163
  useClickAway(ref, () => setOpen(false));
2974
- const properties = mergeDeep(initiaPropsComponent3, propsComponent || {});
3164
+ const properties = mergeDeep(initiaPropsComponent4, propsComponent || {});
2975
3165
  const classesIcon = selectIconVariants({ color: properties?.icon?.color, animated: open, open });
2976
3166
  const classes = selectVariants({ wrapper: true });
2977
- return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: classes, ref, children: [
2978
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
3167
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: classes, ref, children: [
3168
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
2979
3169
  Input,
2980
3170
  {
2981
3171
  label,
@@ -2988,14 +3178,14 @@ var Select = ({ label, options, name, value, defaultValue, onChange, propsCompon
2988
3178
  }
2989
3179
  }
2990
3180
  ),
2991
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
3181
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
2992
3182
  "div",
2993
3183
  {
2994
3184
  className: classesIcon,
2995
3185
  style: properties?.icon?.style,
2996
3186
  onClick: () => setOpen((prev) => !prev),
2997
3187
  "data-testid": "yr3Select-icon",
2998
- children: properties?.icon?.component ? properties?.icon.component : /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
3188
+ children: properties?.icon?.component ? properties?.icon.component : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
2999
3189
  IconDown,
3000
3190
  {
3001
3191
  width: properties?.icon?.style?.width,
@@ -3006,13 +3196,13 @@ var Select = ({ label, options, name, value, defaultValue, onChange, propsCompon
3006
3196
  )
3007
3197
  }
3008
3198
  ),
3009
- open && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
3199
+ open && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
3010
3200
  "div",
3011
3201
  {
3012
3202
  className: "yr3Select--menu",
3013
3203
  style: composeStyles(properties?.menu?.ui, properties?.menu?.style),
3014
3204
  "data-testid": "yr3Select-menu",
3015
- children: options.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
3205
+ children: options.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
3016
3206
  "div",
3017
3207
  {
3018
3208
  className: "yr3Select--option",
@@ -3034,7 +3224,7 @@ var Select = ({ label, options, name, value, defaultValue, onChange, propsCompon
3034
3224
  onChange?.(event, opt.value);
3035
3225
  },
3036
3226
  style: composeStyles(properties?.menu?.options?.ui, properties?.menu?.options?.style),
3037
- children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Text, { as: "span", variant: "caption", color: properties?.menu?.options?.text?.color || "primary", ...properties?.menu?.options?.text, children: opt.label })
3227
+ 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
3228
  },
3039
3229
  opt.value
3040
3230
  ))
@@ -3044,8 +3234,8 @@ var Select = ({ label, options, name, value, defaultValue, onChange, propsCompon
3044
3234
  };
3045
3235
 
3046
3236
  // src/components/Slide/Slide.tsx
3047
- var React21 = __toESM(require("react"), 1);
3048
- var import_jsx_runtime42 = require("react/jsx-runtime");
3237
+ var React22 = __toESM(require("react"), 1);
3238
+ var import_jsx_runtime43 = require("react/jsx-runtime");
3049
3239
  var initialPropsComponent5 = {
3050
3240
  slide: {
3051
3241
  ui: {},
@@ -3068,7 +3258,7 @@ var Slide = ({
3068
3258
  "in": !!inProp,
3069
3259
  "out": !inProp
3070
3260
  });
3071
- React21.useEffect(() => {
3261
+ React22.useEffect(() => {
3072
3262
  let timeoutId;
3073
3263
  if (inProp) {
3074
3264
  timeoutId = setTimeout(() => {
@@ -3078,19 +3268,19 @@ var Slide = ({
3078
3268
  return () => clearTimeout(timeoutId);
3079
3269
  }, [inProp, duration, onTransitionEnd]);
3080
3270
  const uiStyleContent = uiStyle({ ...properties?.slide?.ui, transitionDuration: `${duration}ms` });
3081
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
3271
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
3082
3272
  "div",
3083
3273
  {
3084
3274
  className: "yr3Slide",
3085
3275
  style: composeStyles(),
3086
3276
  "data-testid": "yr3Slide",
3087
- children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
3277
+ children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
3088
3278
  "div",
3089
3279
  {
3090
3280
  className: classNameContent,
3091
3281
  style: composeStyles(uiStyleContent, properties?.slide?.style || {}),
3092
3282
  "data-testid": "yr3Slide-content",
3093
- children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Box, { ...properties?.box, "data-testid": "yr3Slide-box", children })
3283
+ children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Box, { ...properties?.box, "data-testid": "yr3Slide-box", children })
3094
3284
  }
3095
3285
  )
3096
3286
  }
@@ -3098,7 +3288,7 @@ var Slide = ({
3098
3288
  };
3099
3289
 
3100
3290
  // src/components/Switch/Switch.tsx
3101
- var React22 = __toESM(require("react"), 1);
3291
+ var React23 = __toESM(require("react"), 1);
3102
3292
 
3103
3293
  // src/components/Switch/switch.variants.ts
3104
3294
  var switchVariants = createVariants({
@@ -3135,7 +3325,7 @@ var switchVariants = createVariants({
3135
3325
  });
3136
3326
 
3137
3327
  // src/components/Switch/Switch.tsx
3138
- var import_jsx_runtime43 = require("react/jsx-runtime");
3328
+ var import_jsx_runtime44 = require("react/jsx-runtime");
3139
3329
  var Switch = ({
3140
3330
  checked,
3141
3331
  defaultChecked,
@@ -3147,7 +3337,7 @@ var Switch = ({
3147
3337
  placement = "end",
3148
3338
  propsComponent
3149
3339
  }) => {
3150
- const [internal, setInternal] = React22.useState(defaultChecked || false);
3340
+ const [internal, setInternal] = React23.useState(defaultChecked || false);
3151
3341
  const classname = switchVariants({ colors: color, size, disabled: !!disabled, checked: checked ?? internal, placement });
3152
3342
  const isControlled = checked !== void 0;
3153
3343
  const value = isControlled ? checked : internal;
@@ -3155,13 +3345,13 @@ var Switch = ({
3155
3345
  if (!isControlled) setInternal(e.target.checked);
3156
3346
  onChange?.(e, e.target.checked);
3157
3347
  };
3158
- return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
3348
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
3159
3349
  "label",
3160
3350
  {
3161
3351
  className: classname,
3162
3352
  "data-testid": "yr3Switch",
3163
3353
  children: [
3164
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
3354
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
3165
3355
  "input",
3166
3356
  {
3167
3357
  type: "checkbox",
@@ -3170,8 +3360,8 @@ var Switch = ({
3170
3360
  disabled
3171
3361
  }
3172
3362
  ),
3173
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "yr3Switch--track", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "yr3Switch--thumb" }) }),
3174
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
3363
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "yr3Switch--track", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "yr3Switch--thumb" }) }),
3364
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
3175
3365
  "span",
3176
3366
  {
3177
3367
  className: "yr3Switch--label",
@@ -3186,14 +3376,14 @@ var Switch = ({
3186
3376
  };
3187
3377
 
3188
3378
  // src/theme/ThemeProvider.tsx
3189
- var React24 = __toESM(require("react"), 1);
3379
+ var React25 = __toESM(require("react"), 1);
3190
3380
 
3191
3381
  // src/theme/notistackContext.tsx
3192
- var React23 = __toESM(require("react"), 1);
3193
- var import_jsx_runtime44 = require("react/jsx-runtime");
3194
- var NotistackContext = React23.createContext(null);
3382
+ var React24 = __toESM(require("react"), 1);
3383
+ var import_jsx_runtime45 = require("react/jsx-runtime");
3384
+ var NotistackContext = React24.createContext(null);
3195
3385
  var NotistackProvider = ({ children }) => {
3196
- const [snacks, setSnacks] = React23.useState([]);
3386
+ const [snacks, setSnacks] = React24.useState([]);
3197
3387
  const notistack = (snack) => {
3198
3388
  const id = Date.now();
3199
3389
  setSnacks((prev) => [...prev, { ...snack, id, exiting: false }]);
@@ -3208,13 +3398,13 @@ var NotistackProvider = ({ children }) => {
3208
3398
  setSnacks((prev) => prev.filter((s) => s.id !== id));
3209
3399
  }, duration + exitDuration);
3210
3400
  };
3211
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(NotistackContext.Provider, { value: { notistack }, children: [
3401
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(NotistackContext.Provider, { value: { notistack }, children: [
3212
3402
  children,
3213
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "yr3NotistackContainer", children: snacks.map((snack) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Notistack, { ...snack }, snack.id)) })
3403
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "yr3NotistackContainer", children: snacks.map((snack) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Notistack, { ...snack }, snack.id)) })
3214
3404
  ] });
3215
3405
  };
3216
3406
  var useNotistack = () => {
3217
- const ctx = React23.useContext(NotistackContext);
3407
+ const ctx = React24.useContext(NotistackContext);
3218
3408
  if (!ctx) {
3219
3409
  throw new Error("NotistackProvider missing");
3220
3410
  }
@@ -3222,15 +3412,15 @@ var useNotistack = () => {
3222
3412
  };
3223
3413
 
3224
3414
  // src/theme/ThemeProvider.tsx
3225
- var import_jsx_runtime45 = require("react/jsx-runtime");
3226
- var ThemeContext = React24.createContext(null);
3415
+ var import_jsx_runtime46 = require("react/jsx-runtime");
3416
+ var ThemeContext = React25.createContext(null);
3227
3417
  var ThemeProvider = ({ theme, children }) => {
3228
- React24.useEffect(() => {
3418
+ React25.useEffect(() => {
3229
3419
  applyTheme(theme);
3230
3420
  }, [theme]);
3231
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(ThemeContext.Provider, { value: theme, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(BackdropProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(NotistackProvider, { children }) }) });
3421
+ 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
3422
  };
3233
- var useTheme = () => React24.useContext(ThemeContext);
3423
+ var useTheme = () => React25.useContext(ThemeContext);
3234
3424
 
3235
3425
  // src/theme/tokens.ts
3236
3426
  var baseTokens = {
@@ -3251,15 +3441,15 @@ var baseTokens = {
3251
3441
  };
3252
3442
 
3253
3443
  // src/theme/useMediaQuery.tsx
3254
- var React25 = __toESM(require("react"), 1);
3444
+ var React26 = __toESM(require("react"), 1);
3255
3445
  function useMediaQuery(query) {
3256
3446
  const theme = useTheme();
3257
3447
  const computedQuery = typeof query === "function" ? query(theme) : query;
3258
- const [matches, setMatches] = React25.useState(() => {
3448
+ const [matches, setMatches] = React26.useState(() => {
3259
3449
  if (typeof window === "undefined") return false;
3260
3450
  return window.matchMedia(computedQuery).matches;
3261
3451
  });
3262
- React25.useEffect(() => {
3452
+ React26.useEffect(() => {
3263
3453
  if (typeof window === "undefined") return;
3264
3454
  const media = window.matchMedia(computedQuery);
3265
3455
  const listener = () => setMatches(media.matches);
@@ -3293,7 +3483,7 @@ var usePlaces = ({ input, language, apiKey, provider }) => {
3293
3483
  };
3294
3484
 
3295
3485
  // src/hooks/useBreakpoint.ts
3296
- var React26 = __toESM(require("react"), 1);
3486
+ var React27 = __toESM(require("react"), 1);
3297
3487
  var breakUp = (bp) => `(min-width: ${bp}px)`;
3298
3488
  var breakDown = (bp) => `(max-width: ${bp}px)`;
3299
3489
  function useBreakpoint(queryInput) {
@@ -3303,8 +3493,8 @@ function useBreakpoint(queryInput) {
3303
3493
  if (typeof window === "undefined") return false;
3304
3494
  return window.matchMedia(query).matches;
3305
3495
  };
3306
- const [matches, setMatches] = React26.useState(getMatch);
3307
- React26.useEffect(() => {
3496
+ const [matches, setMatches] = React27.useState(getMatch);
3497
+ React27.useEffect(() => {
3308
3498
  if (typeof window === "undefined") return;
3309
3499
  const media = window.matchMedia(query);
3310
3500
  const listener = (e) => {
@@ -3369,6 +3559,7 @@ initTheme();
3369
3559
  NotistackProvider,
3370
3560
  Pending,
3371
3561
  Phone,
3562
+ Picker,
3372
3563
  PlacesAutocomplete,
3373
3564
  Radio,
3374
3565
  Select,