@yr3/ui 1.0.22 → 1.0.24

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.
@@ -109,4 +109,9 @@
109
109
  width: 100%;
110
110
  }
111
111
 
112
+ .yr3Control--disabled {
113
+ cursor: not-allowed;
114
+ opacity: 0.6;
115
+ }
116
+
112
117
  /*# sourceMappingURL=control.css.map */
@@ -1 +1 @@
1
- {"version":3,"sourceRoot":"","sources":["../../../src/components/Control/control.scss"],"names":[],"mappings":"AAAA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACE;EACA;;AAEF;EACE;EACA;;AAEF;EACE;EACA;;AAEF;EACE;EACA;EACA;EACA;;AAEF;EACE;EACA;EACA;EACA;EACA;;;AAIJ;EACE;EACA;EACA;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;EACA;EACA;;;AAIF;EACE;;;AAGF;EACE;;;AAEF;EACE","file":"control.css"}
1
+ {"version":3,"sourceRoot":"","sources":["../../../src/components/Control/control.scss"],"names":[],"mappings":"AAAA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACE;EACA;;AAEF;EACE;EACA;;AAEF;EACE;EACA;;AAEF;EACE;EACA;EACA;EACA;;AAEF;EACE;EACA;EACA;EACA;EACA;;;AAIJ;EACE;EACA;EACA;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;EACA;EACA;;;AAIF;EACE;;;AAGF;EACE;;;AAEF;EACE;;;AAGF;EACI;EACA","file":"control.css"}
@@ -128,4 +128,9 @@
128
128
  --border-selected: var(--color-white);
129
129
  }
130
130
 
131
+ .yr3MonthSelector--disabled {
132
+ cursor: not-allowed;
133
+ opacity: 0.6;
134
+ }
135
+
131
136
  /*# sourceMappingURL=month.css.map */
@@ -1 +1 @@
1
- {"version":3,"sourceRoot":"","sources":["../../../src/components/Date/month.scss"],"names":[],"mappings":"AAAA;EACI;EACA;EACA;EACA;EACA;EACA;;AACA;EACE;EACA;EACA;EACA;EACA;;AAEF;EACE;EACA;EACA;EACA;;;AAIN;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACI;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGJ;EACI;EACA;EACA;EACA;EACA;EACA;;AACA;EACI;EACA;EACA;EACA;EACA;;AACA;EACI;EACA;;AAEJ;EACI;EACA;;;AAMR;EACI;EACA;;;AAKJ;EACI;EACA;;;AAKR;EACI;EACA;;;AAEJ;EACI;EACA;;;AAEJ;EACI;EACA;;;AAEJ;EACI;EACA;;;AAEJ;EACI;EACA;;;AAEJ;EACI;EACA;;;AAEJ;EACI;EACA;;;AAEJ;EACI;EACA;;;AAEJ;EACI;EACA;;;AAEJ;EACI;EACA","file":"month.css"}
1
+ {"version":3,"sourceRoot":"","sources":["../../../src/components/Date/month.scss"],"names":[],"mappings":"AAAA;EACI;EACA;EACA;EACA;EACA;EACA;;AACA;EACE;EACA;EACA;EACA;EACA;;AAEF;EACE;EACA;EACA;EACA;;;AAIN;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACI;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGJ;EACI;EACA;EACA;EACA;EACA;EACA;;AACA;EACI;EACA;EACA;EACA;EACA;;AACA;EACI;EACA;;AAEJ;EACI;EACA;;;AAMR;EACI;EACA;;;AAKJ;EACI;EACA;;;AAKR;EACI;EACA;;;AAEJ;EACI;EACA;;;AAEJ;EACI;EACA;;;AAEJ;EACI;EACA;;;AAEJ;EACI;EACA;;;AAEJ;EACI;EACA;;;AAEJ;EACI;EACA;;;AAEJ;EACI;EACA;;;AAEJ;EACI;EACA;;;AAEJ;EACI;EACA;;;AAGJ;EACI;EACA","file":"month.css"}
@@ -100,4 +100,9 @@ input::placeholder {
100
100
  width: 150px;
101
101
  }
102
102
 
103
+ .yr3Input--disabled {
104
+ cursor: not-allowed;
105
+ opacity: 0.6;
106
+ }
107
+
103
108
  /*# sourceMappingURL=input.css.map */
@@ -1 +1 @@
1
- {"version":3,"sourceRoot":"","sources":["../../../src/components/Input/input.scss"],"names":[],"mappings":"AAEA;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAIJ;EACI;EACA;EACA;;;AAGJ;AAAA;EAEE;EACA;;;AAEF;EACI;EACA;EACA;EACA;;;AAGJ;EACE;EACA;EACA;EACA;EACA;EACA;;;AAIF;AACA;EACE;;;AAIF;EACE;;;AAEF;EACE;;;AAEF;EACE;;;AAEF;EACE;;;AAEF;EACE;;;AAEF;EACE;;;AAEF;EACE;;;AAEF;EACE;;;AAEF;EACE;;;AAEF;EACE;;;AAGF;EACE;EACA;;;AAGF;EACE;;;AAEF;EACE","file":"input.css"}
1
+ {"version":3,"sourceRoot":"","sources":["../../../src/components/Input/input.scss"],"names":[],"mappings":"AAEA;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAIJ;EACI;EACA;EACA;;;AAGJ;AAAA;EAEE;EACA;;;AAEF;EACI;EACA;EACA;EACA;;;AAGJ;EACE;EACA;EACA;EACA;EACA;EACA;;;AAIF;AACA;EACE;;;AAIF;EACE;;;AAEF;EACE;;;AAEF;EACE;;;AAEF;EACE;;;AAEF;EACE;;;AAEF;EACE;;;AAEF;EACE;;;AAEF;EACE;;;AAEF;EACE;;;AAEF;EACE;;;AAGF;EACE;EACA;;;AAGF;EACE;;;AAEF;EACE;;;AAGF;EACE;EACA","file":"input.css"}
@@ -17,7 +17,7 @@
17
17
  margin-top: 10px;
18
18
  position: absolute;
19
19
  right: 0;
20
- z-index: 3;
20
+ z-index: 1;
21
21
  }
22
22
  .yr3Select--icon--open {
23
23
  transform: rotate(180deg);
@@ -93,4 +93,9 @@
93
93
  transition: transform 0.3s ease;
94
94
  }
95
95
 
96
+ .yr3Select--disabled {
97
+ cursor: not-allowed;
98
+ opacity: 0.6;
99
+ }
100
+
96
101
  /*# sourceMappingURL=select.css.map */
@@ -1 +1 @@
1
- {"version":3,"sourceRoot":"","sources":["../../../src/components/Select/select.scss"],"names":[],"mappings":"AACE;EACE;EACA;EACA;EACA;EACA;EACA;;AACA;EACE;EACA;EACA;EACA;EACA;;AAEF;EACE;EACA;EACA;EACA;;AACA;EACI;;;AAMV;AACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGF;AACA;EACI;EACA;;;AAGJ;EACI;;;AAGJ;EACI;;;AAEJ;EACI;;;AAEJ;EACI;;;AAEJ;EACI;;;AAEJ;EACI;;;AAEJ;EACI;;;AAEJ;EACI;;;AAEJ;EACI;;;AAEJ;EACI;;;AAEJ;EACI;;;AAGJ;EACI","file":"select.css"}
1
+ {"version":3,"sourceRoot":"","sources":["../../../src/components/Select/select.scss"],"names":[],"mappings":"AACE;EACE;EACA;EACA;EACA;EACA;EACA;;AACA;EACE;EACA;EACA;EACA;EACA;;AAEF;EACE;EACA;EACA;EACA;;AACA;EACI;;;AAMV;AACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGF;AACA;EACI;EACA;;;AAGJ;EACI;;;AAGJ;EACI;;;AAEJ;EACI;;;AAEJ;EACI;;;AAEJ;EACI;;;AAEJ;EACI;;;AAEJ;EACI;;;AAEJ;EACI;;;AAEJ;EACI;;;AAEJ;EACI;;;AAEJ;EACI;;;AAGJ;EACI;;;AAGJ;EACI;EACA","file":"select.css"}
@@ -1,50 +1,55 @@
1
+ @charset "UTF-8";
1
2
  .yr3Slide {
2
- position: absolute;
3
+ z-index: 1200;
4
+ }
5
+
6
+ .yr3Slide--content {
7
+ position: absolute; /* 🔥 fondamentale */
3
8
  transition: transform 0.3s ease;
4
- will-change: transform;
5
- z-index: 2;
6
- overflow: hidden;
7
9
  }
8
10
 
9
- /* DIRECTIONS */
10
- .yr3Slide--content--left::before {
11
- content: "";
12
- overflow: hidden;
13
- height: 100%;
11
+ .yr3Slide--content--right {
12
+ top: 0;
13
+ left: 0;
14
14
  }
15
- .yr3Slide--content--left {
16
- transform: translateX(-110%);
15
+ .yr3Slide--content--right.yr3Slide--in {
16
+ transform: translate(0, 0);
17
+ }
18
+ .yr3Slide--content--right.yr3Slide--out {
19
+ transform: translateX(100%);
17
20
  }
18
21
 
19
- .yr3Slide--content--right::before {
20
- content: "";
21
- overflow: hidden;
22
- height: 100%;
22
+ .yr3Slide--content--left {
23
+ top: 0;
24
+ right: 0;
23
25
  }
24
- .yr3Slide--content--right {
25
- transform: translateX(110%);
26
+ .yr3Slide--content--left.yr3Slide--in {
27
+ transform: translate(0, 0);
28
+ }
29
+ .yr3Slide--content--left.yr3Slide--out {
30
+ transform: translateX(-100%);
26
31
  }
27
32
 
28
33
  .yr3Slide--content--top {
29
- transform: translateY(-100%);
34
+ top: 0;
35
+ left: 0;
30
36
  }
31
-
32
- .yr3Slide--content--bottom::before {
33
- content: "";
34
- overflow: hidden;
35
- height: 100%;
37
+ .yr3Slide--content--top.yr3Slide--in {
38
+ transform: translate(0, 0);
36
39
  }
37
- .yr3Slide--content--bottom {
40
+ .yr3Slide--content--top.yr3Slide--out {
38
41
  transform: translateY(-100%);
39
42
  }
40
43
 
41
- /* OPEN */
42
- .yr3Slide--content--in {
44
+ .yr3Slide--content--bottom {
45
+ bottom: 0;
46
+ left: 0;
47
+ }
48
+ .yr3Slide--content--bottom.yr3Slide--in {
43
49
  transform: translate(0, 0);
44
50
  }
45
-
46
- .yr3Slide--content--out {
47
- transition: all 0.3s ease;
51
+ .yr3Slide--content--bottom.yr3Slide--out {
52
+ transform: translateY(100%);
48
53
  }
49
54
 
50
55
  /*# sourceMappingURL=slide.css.map */
@@ -1 +1 @@
1
- {"version":3,"sourceRoot":"","sources":["../../../src/components/Slide/slide.scss"],"names":[],"mappings":"AAAA;EACI;EACA;EACA;EACA;EACA;;;AAGJ;AAGI;EACI;EACA;EACA;;AAJR;EAMG;;;AAIE;EACG;EACA;EACA;;AAJR;EAMG;;;AAGH;EACE;;;AAIE;EACI;EACA;EACA;;AAJR;EAMG;;;AAGH;AAEA;EACE;;;AAGF;EACE","file":"slide.css"}
1
+ {"version":3,"sourceRoot":"","sources":["../../../src/components/Slide/slide.scss"],"names":[],"mappings":";AAAA;EAGE;;;AAGF;EACE;EACA;;;AAGF;EACE;EACA;;AACA;EACA;;AAEA;EACC;;;AAIH;EACE;EACA;;AACA;EACA;;AAEA;EACC;;;AAIH;EACE;EACA;;AACA;EACA;;AAEA;EACC;;;AAIH;EACE;EACA;;AACA;EACA;;AAEA;EACC","file":"slide.css"}
package/dist/index.cjs CHANGED
@@ -953,9 +953,9 @@ var buttonVariant = createVariants({
953
953
 
954
954
  // src/components/Button/Button.tsx
955
955
  var import_jsx_runtime6 = require("react/jsx-runtime");
956
- var Button = ({ children, color = "text", variant = "text", animated, disabled, gradientBorder = false, size = "auto", ui, style, propsComponent, ...props }) => {
956
+ var Button = ({ icon, children, color = "text", variant = "text", animated, disabled, gradientBorder = false, size = "auto", ui, style, propsComponent, ...props }) => {
957
957
  const buttonClassname = buttonVariant({ variant, color, animated, disabled, gradientBorder, size });
958
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
958
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
959
959
  "button",
960
960
  {
961
961
  className: buttonClassname,
@@ -963,7 +963,10 @@ var Button = ({ children, color = "text", variant = "text", animated, disabled,
963
963
  "data-testid": "yr3Button",
964
964
  ...props,
965
965
  style: composeStyles(ui, style),
966
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { variant: propsComponent?.text?.variant || "button", ...propsComponent?.text, children })
966
+ children: [
967
+ icon && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "yr3Button--icon", children: icon }),
968
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { variant: propsComponent?.text?.variant || "button", ...propsComponent?.text, children })
969
+ ]
967
970
  }
968
971
  );
969
972
  };
@@ -1381,7 +1384,7 @@ var Control = ({
1381
1384
  error,
1382
1385
  disabled
1383
1386
  };
1384
- const classes = controlVariants({ variant, color, label, size });
1387
+ const classes = controlVariants({ variant, color, label, size, disabled });
1385
1388
  return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ControlContext.Provider, { value, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1386
1389
  "div",
1387
1390
  {
@@ -1614,6 +1617,7 @@ var Input = React9.forwardRef(
1614
1617
  pattern = "text",
1615
1618
  color = "primary",
1616
1619
  size = "auto",
1620
+ disabled = false,
1617
1621
  ...props
1618
1622
  }, ref) => {
1619
1623
  const [focused, setFocused] = React9.useState(false);
@@ -1645,7 +1649,7 @@ var Input = React9.forwardRef(
1645
1649
  onChange?.(e, newValue);
1646
1650
  };
1647
1651
  const classes = inputVariants({ color, label: propsComponent?.label?.display });
1648
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Control, { variant, color, label: propsComponent?.label?.display, ...propsComponent.control, children: [
1652
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Control, { variant, color, label: propsComponent?.label?.display, disabled, ...propsComponent.control, children: [
1649
1653
  propsComponent?.label?.display && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1650
1654
  Label,
1651
1655
  {
@@ -1663,6 +1667,7 @@ var Input = React9.forwardRef(
1663
1667
  inputMode: pattern === "currency" ? "numeric" : pattern === "phone" ? "tel" : void 0,
1664
1668
  autoComplete: "off",
1665
1669
  type: "text",
1670
+ disabled,
1666
1671
  onChange: handleChange,
1667
1672
  onFocus: () => setFocused(true),
1668
1673
  onBlur: () => setFocused(false),
@@ -1713,6 +1718,17 @@ var IconLeft = (props) => {
1713
1718
  };
1714
1719
 
1715
1720
  // src/components/Date/month.variants.ts
1721
+ var monthSelectorVariants = createVariants({
1722
+ base: "yr3MonthSelector",
1723
+ variants: {
1724
+ wrapper: {
1725
+ true: "yr3MonthSelector--wrapper"
1726
+ },
1727
+ disabled: {
1728
+ true: "yr3MonthSelector--disabled"
1729
+ }
1730
+ }
1731
+ });
1716
1732
  var monthSelectorIconVariants = createVariants({
1717
1733
  base: "yr3MonthSelector--icon",
1718
1734
  variants: {
@@ -1822,17 +1838,24 @@ var MonthSelector = ({ label, value, disabled, propsComponent, data, daysFormat,
1822
1838
  const getData = React10.useMemo(() => {
1823
1839
  return getMonthCalendarProps({ year: data.years[yearSelected], data, daysFormat, value: valueState });
1824
1840
  }, [yearSelected, data, daysFormat, valueState]);
1825
- React10.useEffect(() => {
1826
- if (onNext) onNext(getData.prev);
1827
- if (onLast) onLast(getData.last);
1828
- }, [getData]);
1829
- React10.useEffect(() => {
1830
- setValueState(value || null);
1831
- }, [value]);
1832
- React10.useEffect(() => {
1833
- if (onChange && valueState) onChange(valueState);
1834
- }, [valueState, onChange]);
1835
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "yr3MonthSelector", ref, children: [
1841
+ const handleYearChange = (newIndex) => {
1842
+ setYearSelected(newIndex);
1843
+ };
1844
+ const handleMonthChange = (month) => {
1845
+ const newValue = `${month}-${data.years[yearSelected]}`;
1846
+ setValueState(newValue);
1847
+ onChange(newValue);
1848
+ const nextData = getMonthCalendarProps({
1849
+ year: data.years[yearSelected],
1850
+ data,
1851
+ daysFormat,
1852
+ value: newValue
1853
+ });
1854
+ onNext?.(nextData.prev);
1855
+ onLast?.(nextData.last);
1856
+ };
1857
+ const classes = monthSelectorVariants({ wrapper: true, disabled });
1858
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: classes, ref, children: [
1836
1859
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
1837
1860
  Input,
1838
1861
  {
@@ -1851,7 +1874,7 @@ var MonthSelector = ({ label, value, disabled, propsComponent, data, daysFormat,
1851
1874
  {
1852
1875
  className: iconClasses,
1853
1876
  style: properties?.icon?.style,
1854
- onClick: () => !disabled && setOpen((prev) => !prev),
1877
+ onClick: () => !disabled && setOpen(true),
1855
1878
  "data-testid": "yr3MonthSelector--icon",
1856
1879
  children: properties?.icon?.component ? properties?.icon.component : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
1857
1880
  IconCalendar,
@@ -1883,7 +1906,7 @@ var MonthSelector = ({ label, value, disabled, propsComponent, data, daysFormat,
1883
1906
  disabled: disabled || yearSelected === 0,
1884
1907
  type: "button",
1885
1908
  className: `yr3MonthSelector--year-button-back ${yearSelected === 0 ? "yr3MonthSelector--year-button-back--disabled" : ""} `,
1886
- onClick: () => setYearSelected(yearSelected - 1),
1909
+ onClick: () => handleYearChange(yearSelected - 1),
1887
1910
  children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(IconLeft, { width: 20, height: 20, stroke: "currentColor" })
1888
1911
  }
1889
1912
  ),
@@ -1897,7 +1920,7 @@ var MonthSelector = ({ label, value, disabled, propsComponent, data, daysFormat,
1897
1920
  disabled: disabled || yearSelected === data.years.length - 1,
1898
1921
  type: "button",
1899
1922
  className: `yr3MonthSelector--year-button-next ${yearSelected === data.years.length - 1 ? "yr3MonthSelector--year-button-next--disabled" : ""}`,
1900
- onClick: () => setYearSelected(yearSelected + 1),
1923
+ onClick: () => handleYearChange(yearSelected + 1),
1901
1924
  children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(IconRight, { width: 20, height: 30, stroke: "currentColor" })
1902
1925
  }
1903
1926
  )
@@ -1912,8 +1935,7 @@ var MonthSelector = ({ label, value, disabled, propsComponent, data, daysFormat,
1912
1935
  disabled: m.disabled,
1913
1936
  className: `yr3MonthSelector--month ${m.disabled ? "yr3MonthSelector--month--disabled" : ""} ${m.selected ? "yr3MonthSelector--month--selected" : ""}`,
1914
1937
  onClick: () => {
1915
- setValueState(`${m.value}-${data.years[yearSelected]}`);
1916
- setOpen(false);
1938
+ handleMonthChange(m.value);
1917
1939
  },
1918
1940
  children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { ...properties?.text, weight: m.disabled ? "thin" : "medium", children: m.label })
1919
1941
  },
@@ -3071,6 +3093,9 @@ var selectVariants = createVariants({
3071
3093
  base: "yr3Select--base",
3072
3094
  lined: "yr3Select--lined"
3073
3095
  },
3096
+ disabled: {
3097
+ true: "yr3Select--disabled"
3098
+ },
3074
3099
  color: {
3075
3100
  primary: "yr3Select--color-primary",
3076
3101
  secondary: "yr3Select--color-secondary",
@@ -3155,14 +3180,14 @@ var initiaPropsComponent4 = {
3155
3180
  component: void 0
3156
3181
  }
3157
3182
  };
3158
- var Select = ({ label, options, name, value, defaultValue, onChange, propsComponent }) => {
3183
+ var Select = ({ label, options, name, value, defaultValue, onChange, propsComponent, disabled }) => {
3159
3184
  const [open, setOpen] = React21.useState(false);
3160
3185
  const [valueState, setValueState] = React21.useState(value || defaultValue || null);
3161
3186
  const ref = React21.useRef(null);
3162
3187
  useClickAway(ref, () => setOpen(false));
3163
3188
  const properties = mergeDeep(initiaPropsComponent4, propsComponent || {});
3164
3189
  const classesIcon = selectIconVariants({ color: properties?.icon?.color, animated: open, open });
3165
- const classes = selectVariants({ wrapper: true });
3190
+ const classes = selectVariants({ wrapper: true, disabled });
3166
3191
  return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: classes, ref, children: [
3167
3192
  /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
3168
3193
  Input,
@@ -3182,7 +3207,7 @@ var Select = ({ label, options, name, value, defaultValue, onChange, propsCompon
3182
3207
  {
3183
3208
  className: classesIcon,
3184
3209
  style: properties?.icon?.style,
3185
- onClick: () => setOpen((prev) => !prev),
3210
+ onClick: () => !disabled && setOpen((prev) => !prev),
3186
3211
  "data-testid": "yr3Select-icon",
3187
3212
  children: properties?.icon?.component ? properties?.icon.component : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
3188
3213
  IconDown,
@@ -3234,13 +3259,40 @@ var Select = ({ label, options, name, value, defaultValue, onChange, propsCompon
3234
3259
 
3235
3260
  // src/components/Slide/Slide.tsx
3236
3261
  var React22 = __toESM(require("react"), 1);
3262
+
3263
+ // src/components/Slide/variants.slide.ts
3264
+ var variantsSlide = createVariants({
3265
+ base: "yr3Slide--content",
3266
+ variants: {
3267
+ direction: {
3268
+ left: "yr3Slide--content--left",
3269
+ right: "yr3Slide--content--right",
3270
+ top: "yr3Slide--content--top",
3271
+ bottom: "yr3Slide--content--bottom"
3272
+ },
3273
+ open: {
3274
+ true: "yr3Slide--in",
3275
+ false: "yr3Slide--out"
3276
+ }
3277
+ }
3278
+ });
3279
+
3280
+ // src/components/Slide/Slide.tsx
3237
3281
  var import_jsx_runtime43 = require("react/jsx-runtime");
3238
3282
  var initialPropsComponent5 = {
3239
3283
  slide: {
3240
3284
  ui: {},
3241
3285
  style: {}
3242
3286
  },
3243
- box: {}
3287
+ content: {
3288
+ ui: {},
3289
+ style: {}
3290
+ },
3291
+ box: {
3292
+ as: "div",
3293
+ ui: {},
3294
+ style: {}
3295
+ }
3244
3296
  };
3245
3297
  var Slide = ({
3246
3298
  in: inProp,
@@ -3251,33 +3303,29 @@ var Slide = ({
3251
3303
  propsComponent
3252
3304
  }) => {
3253
3305
  const properties = mergeDeep(initialPropsComponent5, propsComponent || {});
3254
- const bemContent = bem("yr3Slide--content");
3255
- const classNameContent = bemContent(void 0, {
3256
- [direction]: true,
3257
- "in": !!inProp,
3258
- "out": !inProp
3259
- });
3306
+ const stateRef = React22.useRef(inProp ? "in" : "out");
3260
3307
  React22.useEffect(() => {
3261
- let timeoutId;
3262
- if (inProp) {
3263
- timeoutId = setTimeout(() => {
3264
- onTransitionEnd && onTransitionEnd();
3265
- }, duration);
3266
- }
3267
- return () => clearTimeout(timeoutId);
3268
- }, [inProp, duration, onTransitionEnd]);
3269
- const uiStyleContent = uiStyle({ ...properties?.slide?.ui, transitionDuration: `${duration}ms` });
3308
+ stateRef.current = inProp ? "in" : "out";
3309
+ }, [inProp]);
3310
+ const classesContent = variantsSlide({ direction, open: !!inProp ? "true" : "false" });
3311
+ const uiStyleSlider = uiStyle({ ...properties?.slide?.ui, transitionDuration: `${duration}ms` });
3312
+ const uiStyleContent = uiStyle({ ...properties?.content?.ui, transitionDuration: `${duration}ms` });
3270
3313
  return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
3271
3314
  "div",
3272
3315
  {
3273
3316
  className: "yr3Slide",
3274
- style: composeStyles(),
3317
+ style: composeStyles(uiStyleSlider, properties?.slide?.style || {}),
3275
3318
  "data-testid": "yr3Slide",
3276
3319
  children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
3277
3320
  "div",
3278
3321
  {
3279
- className: classNameContent,
3280
- style: composeStyles(uiStyleContent, properties?.slide?.style || {}),
3322
+ className: classesContent,
3323
+ onTransitionEnd: (e) => {
3324
+ if (e.target === e.currentTarget && e.propertyName === "transform") {
3325
+ onTransitionEnd?.(stateRef?.current);
3326
+ }
3327
+ },
3328
+ style: composeStyles(uiStyleContent, properties?.content?.style || {}),
3281
3329
  "data-testid": "yr3Slide-content",
3282
3330
  children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Box, { ...properties?.box, "data-testid": "yr3Slide-box", children })
3283
3331
  }
package/dist/index.d.cts CHANGED
@@ -1039,6 +1039,7 @@ type ButtonProps = React$1.ButtonHTMLAttributes<HTMLButtonElement> & {
1039
1039
  gradientBorder?: boolean;
1040
1040
  ui?: UIProps;
1041
1041
  size?: 'auto' | 'full';
1042
+ icon?: React$1.ReactNode;
1042
1043
  propsComponent?: {
1043
1044
  text?: Omit<TextProps, 'children'>;
1044
1045
  };
@@ -1437,7 +1438,7 @@ type MonthSelectorProps = {
1437
1438
  };
1438
1439
  onNext?: (value: string) => void;
1439
1440
  onLast?: (value: string) => void;
1440
- onChange?: (value: string) => void;
1441
+ onChange: (value: string) => void;
1441
1442
  propsComponent?: {
1442
1443
  control?: Omit<React$1.ComponentProps<typeof Input>, 'value' | 'onChange'>;
1443
1444
  wrapper?: {
@@ -1843,12 +1844,16 @@ type SlideProps = {
1843
1844
  children?: React$1.ReactNode;
1844
1845
  direction?: 'left' | 'right' | 'top' | 'bottom';
1845
1846
  duration?: number;
1846
- onTransitionEnd?: () => void;
1847
+ onTransitionEnd?: (state: 'in' | 'out') => void;
1847
1848
  propsComponent?: {
1848
1849
  slide?: {
1849
1850
  ui?: UIProps;
1850
1851
  style?: React$1.CSSProperties;
1851
1852
  };
1853
+ content?: {
1854
+ ui?: UIProps;
1855
+ style?: React$1.CSSProperties;
1856
+ };
1852
1857
  box?: Omit<BoxProps, 'children'>;
1853
1858
  };
1854
1859
  };
package/dist/index.d.ts CHANGED
@@ -1039,6 +1039,7 @@ type ButtonProps = React$1.ButtonHTMLAttributes<HTMLButtonElement> & {
1039
1039
  gradientBorder?: boolean;
1040
1040
  ui?: UIProps;
1041
1041
  size?: 'auto' | 'full';
1042
+ icon?: React$1.ReactNode;
1042
1043
  propsComponent?: {
1043
1044
  text?: Omit<TextProps, 'children'>;
1044
1045
  };
@@ -1437,7 +1438,7 @@ type MonthSelectorProps = {
1437
1438
  };
1438
1439
  onNext?: (value: string) => void;
1439
1440
  onLast?: (value: string) => void;
1440
- onChange?: (value: string) => void;
1441
+ onChange: (value: string) => void;
1441
1442
  propsComponent?: {
1442
1443
  control?: Omit<React$1.ComponentProps<typeof Input>, 'value' | 'onChange'>;
1443
1444
  wrapper?: {
@@ -1843,12 +1844,16 @@ type SlideProps = {
1843
1844
  children?: React$1.ReactNode;
1844
1845
  direction?: 'left' | 'right' | 'top' | 'bottom';
1845
1846
  duration?: number;
1846
- onTransitionEnd?: () => void;
1847
+ onTransitionEnd?: (state: 'in' | 'out') => void;
1847
1848
  propsComponent?: {
1848
1849
  slide?: {
1849
1850
  ui?: UIProps;
1850
1851
  style?: React$1.CSSProperties;
1851
1852
  };
1853
+ content?: {
1854
+ ui?: UIProps;
1855
+ style?: React$1.CSSProperties;
1856
+ };
1852
1857
  box?: Omit<BoxProps, 'children'>;
1853
1858
  };
1854
1859
  };