@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.
- package/dist/components/Control/control.css +5 -0
- package/dist/components/Control/control.css.map +1 -1
- package/dist/components/Date/month.css +5 -0
- package/dist/components/Date/month.css.map +1 -1
- package/dist/components/Input/input.css +5 -0
- package/dist/components/Input/input.css.map +1 -1
- package/dist/components/Select/select.css +6 -1
- package/dist/components/Select/select.css.map +1 -1
- package/dist/components/Slide/slide.css +34 -29
- package/dist/components/Slide/slide.css.map +1 -1
- package/dist/index.cjs +91 -43
- package/dist/index.d.cts +7 -2
- package/dist/index.d.ts +7 -2
- package/dist/index.js +134 -86
- package/dist/styles/index.css +55 -30
- package/dist/styles/index.css.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -828,10 +828,10 @@ var buttonVariant = createVariants({
|
|
|
828
828
|
});
|
|
829
829
|
|
|
830
830
|
// src/components/Button/Button.tsx
|
|
831
|
-
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
832
|
-
var Button = ({ children, color = "text", variant = "text", animated, disabled, gradientBorder = false, size = "auto", ui, style, propsComponent, ...props }) => {
|
|
831
|
+
import { jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
832
|
+
var Button = ({ icon, children, color = "text", variant = "text", animated, disabled, gradientBorder = false, size = "auto", ui, style, propsComponent, ...props }) => {
|
|
833
833
|
const buttonClassname = buttonVariant({ variant, color, animated, disabled, gradientBorder, size });
|
|
834
|
-
return /* @__PURE__ */
|
|
834
|
+
return /* @__PURE__ */ jsxs2(
|
|
835
835
|
"button",
|
|
836
836
|
{
|
|
837
837
|
className: buttonClassname,
|
|
@@ -839,7 +839,10 @@ var Button = ({ children, color = "text", variant = "text", animated, disabled,
|
|
|
839
839
|
"data-testid": "yr3Button",
|
|
840
840
|
...props,
|
|
841
841
|
style: composeStyles(ui, style),
|
|
842
|
-
children:
|
|
842
|
+
children: [
|
|
843
|
+
icon && /* @__PURE__ */ jsx6("span", { className: "yr3Button--icon", children: icon }),
|
|
844
|
+
/* @__PURE__ */ jsx6(Text, { variant: propsComponent?.text?.variant || "button", ...propsComponent?.text, children })
|
|
845
|
+
]
|
|
843
846
|
}
|
|
844
847
|
);
|
|
845
848
|
};
|
|
@@ -896,7 +899,7 @@ var calendarDayVariants = createVariants({
|
|
|
896
899
|
});
|
|
897
900
|
|
|
898
901
|
// src/components/Calendar/Calendar.tsx
|
|
899
|
-
import { jsx as jsx7, jsxs as
|
|
902
|
+
import { jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
900
903
|
dayjs2.extend(weekday);
|
|
901
904
|
var initalPropsComponent = {
|
|
902
905
|
displayButtons: true,
|
|
@@ -946,13 +949,13 @@ var Calendar = ({ onSelect, propsComponent = initalPropsComponent, mapCalendar,
|
|
|
946
949
|
onMonthChange && onMonthChange(currentMonth);
|
|
947
950
|
}
|
|
948
951
|
}, [currentMonth]);
|
|
949
|
-
return /* @__PURE__ */
|
|
950
|
-
propsComponent?.displayButtons && /* @__PURE__ */
|
|
952
|
+
return /* @__PURE__ */ jsxs3("div", { className: "yr3Calendar", "data-testid": "yr3Calendar", children: [
|
|
953
|
+
propsComponent?.displayButtons && /* @__PURE__ */ jsxs3("div", { className: "yr3Calendar--header", "data-testid": "yr3CalendarHeader", style: composeStyles(propsComponent?.header?.ui, propsComponent?.header?.style), children: [
|
|
951
954
|
/* @__PURE__ */ jsx7(Button, { disabled: propsComponent?.buttonBack?.disabled || false, color: propsComponent.header?.color || "primary", onClick: () => setCurrentMonth(currentMonth - 1), ui: { justifyContent: "flex-start" }, children: propsComponent?.buttonBack?.label }),
|
|
952
955
|
/* @__PURE__ */ jsx7(Text, { variant: "h6", color: propsComponent.header?.color || "primary", ui: { textTransform: "uppercase", textAlign: "center" }, children: program?.monthLabel }),
|
|
953
956
|
/* @__PURE__ */ jsx7(Button, { disabled: propsComponent?.buttonNext?.disabled, color: propsComponent?.header?.color || "primary", onClick: () => setCurrentMonth(currentMonth + 1), ui: { justifyContent: "flex-end" }, children: propsComponent?.buttonNext?.label })
|
|
954
957
|
] }),
|
|
955
|
-
propsComponent?.displayCalendar && /* @__PURE__ */
|
|
958
|
+
propsComponent?.displayCalendar && /* @__PURE__ */ jsxs3("div", { className: "yr3Calendar--container", children: [
|
|
956
959
|
program?.daysContainer.map((i) => /* @__PURE__ */ jsx7("div", { className: "yr3Calendar--month", style: composeStyles(propsComponent?.month?.ui, propsComponent?.month?.style), children: /* @__PURE__ */ jsx7(
|
|
957
960
|
Text,
|
|
958
961
|
{
|
|
@@ -962,7 +965,7 @@ var Calendar = ({ onSelect, propsComponent = initalPropsComponent, mapCalendar,
|
|
|
962
965
|
children: dayjs2().day(i + 1).format("dd")
|
|
963
966
|
}
|
|
964
967
|
) }, `month_day_${i}`)),
|
|
965
|
-
times(program.calendar.length, (i) => /* @__PURE__ */ jsx7(React3.Fragment, { children: times(program.calendar[i].length, (j) => /* @__PURE__ */
|
|
968
|
+
times(program.calendar.length, (i) => /* @__PURE__ */ jsx7(React3.Fragment, { children: times(program.calendar[i].length, (j) => /* @__PURE__ */ jsxs3(
|
|
966
969
|
"div",
|
|
967
970
|
{
|
|
968
971
|
className: calendarDayVariants({
|
|
@@ -1004,7 +1007,7 @@ var Calendar = ({ onSelect, propsComponent = initalPropsComponent, mapCalendar,
|
|
|
1004
1007
|
|
|
1005
1008
|
// src/components/Checkbox/Checkbox.tsx
|
|
1006
1009
|
import * as React4 from "react";
|
|
1007
|
-
import { jsx as jsx8, jsxs as
|
|
1010
|
+
import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1008
1011
|
var initialPropsComponent = {
|
|
1009
1012
|
checkbox: {
|
|
1010
1013
|
ui: {
|
|
@@ -1041,7 +1044,7 @@ var Checkbox = ({
|
|
|
1041
1044
|
const classes = bemClasse(void 0, { color: `color-${color}`, disabled, variant: `variant-${variant}`, type: `type-${type}` });
|
|
1042
1045
|
const boxClasses = bem("yr3Checkbox-box");
|
|
1043
1046
|
const classesBox = boxClasses(void 0, { checked: !!value });
|
|
1044
|
-
return /* @__PURE__ */
|
|
1047
|
+
return /* @__PURE__ */ jsxs4("label", { className: classes, style: uiStyle(properties?.checkbox?.ui), "data-testid": "yr3Checkbox", children: [
|
|
1045
1048
|
/* @__PURE__ */ jsx8(
|
|
1046
1049
|
"input",
|
|
1047
1050
|
{
|
|
@@ -1105,7 +1108,7 @@ var IconClose = (props) => {
|
|
|
1105
1108
|
};
|
|
1106
1109
|
|
|
1107
1110
|
// src/components/Chip/Chip.tsx
|
|
1108
|
-
import { jsx as jsx10, jsxs as
|
|
1111
|
+
import { jsx as jsx10, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1109
1112
|
var initialChipProps = {
|
|
1110
1113
|
label: {
|
|
1111
1114
|
ui: {},
|
|
@@ -1123,7 +1126,7 @@ var initialChipProps = {
|
|
|
1123
1126
|
var Chip = ({ label, variant, color, icon, deleted, onDelete, rounded, size = "medium", propsComponent, ...props }) => {
|
|
1124
1127
|
const properties = mergeDeep(initialChipProps, propsComponent);
|
|
1125
1128
|
const className = chip_variants_default({ variant, colors: color, rounded, size });
|
|
1126
|
-
return /* @__PURE__ */
|
|
1129
|
+
return /* @__PURE__ */ jsxs5(
|
|
1127
1130
|
"div",
|
|
1128
1131
|
{
|
|
1129
1132
|
className,
|
|
@@ -1257,7 +1260,7 @@ var Control = ({
|
|
|
1257
1260
|
error,
|
|
1258
1261
|
disabled
|
|
1259
1262
|
};
|
|
1260
|
-
const classes = controlVariants({ variant, color, label, size });
|
|
1263
|
+
const classes = controlVariants({ variant, color, label, size, disabled });
|
|
1261
1264
|
return /* @__PURE__ */ jsx13(ControlContext.Provider, { value, children: /* @__PURE__ */ jsx13(
|
|
1262
1265
|
"div",
|
|
1263
1266
|
{
|
|
@@ -1466,7 +1469,7 @@ var inputVariants = createVariants({
|
|
|
1466
1469
|
});
|
|
1467
1470
|
|
|
1468
1471
|
// src/components/Input/Input.tsx
|
|
1469
|
-
import { jsx as jsx18, jsxs as
|
|
1472
|
+
import { jsx as jsx18, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1470
1473
|
var initiaPropsComponent = {
|
|
1471
1474
|
label: {
|
|
1472
1475
|
display: true,
|
|
@@ -1490,6 +1493,7 @@ var Input = React9.forwardRef(
|
|
|
1490
1493
|
pattern = "text",
|
|
1491
1494
|
color = "primary",
|
|
1492
1495
|
size = "auto",
|
|
1496
|
+
disabled = false,
|
|
1493
1497
|
...props
|
|
1494
1498
|
}, ref) => {
|
|
1495
1499
|
const [focused, setFocused] = React9.useState(false);
|
|
@@ -1521,7 +1525,7 @@ var Input = React9.forwardRef(
|
|
|
1521
1525
|
onChange?.(e, newValue);
|
|
1522
1526
|
};
|
|
1523
1527
|
const classes = inputVariants({ color, label: propsComponent?.label?.display });
|
|
1524
|
-
return /* @__PURE__ */
|
|
1528
|
+
return /* @__PURE__ */ jsxs6(Control, { variant, color, label: propsComponent?.label?.display, disabled, ...propsComponent.control, children: [
|
|
1525
1529
|
propsComponent?.label?.display && /* @__PURE__ */ jsx18(
|
|
1526
1530
|
Label,
|
|
1527
1531
|
{
|
|
@@ -1539,6 +1543,7 @@ var Input = React9.forwardRef(
|
|
|
1539
1543
|
inputMode: pattern === "currency" ? "numeric" : pattern === "phone" ? "tel" : void 0,
|
|
1540
1544
|
autoComplete: "off",
|
|
1541
1545
|
type: "text",
|
|
1546
|
+
disabled,
|
|
1542
1547
|
onChange: handleChange,
|
|
1543
1548
|
onFocus: () => setFocused(true),
|
|
1544
1549
|
onBlur: () => setFocused(false),
|
|
@@ -1589,6 +1594,17 @@ var IconLeft = (props) => {
|
|
|
1589
1594
|
};
|
|
1590
1595
|
|
|
1591
1596
|
// src/components/Date/month.variants.ts
|
|
1597
|
+
var monthSelectorVariants = createVariants({
|
|
1598
|
+
base: "yr3MonthSelector",
|
|
1599
|
+
variants: {
|
|
1600
|
+
wrapper: {
|
|
1601
|
+
true: "yr3MonthSelector--wrapper"
|
|
1602
|
+
},
|
|
1603
|
+
disabled: {
|
|
1604
|
+
true: "yr3MonthSelector--disabled"
|
|
1605
|
+
}
|
|
1606
|
+
}
|
|
1607
|
+
});
|
|
1592
1608
|
var monthSelectorIconVariants = createVariants({
|
|
1593
1609
|
base: "yr3MonthSelector--icon",
|
|
1594
1610
|
variants: {
|
|
@@ -1646,7 +1662,7 @@ var IconRight = (props) => {
|
|
|
1646
1662
|
};
|
|
1647
1663
|
|
|
1648
1664
|
// src/components/Date/MonthSelector.tsx
|
|
1649
|
-
import { jsx as jsx24, jsxs as
|
|
1665
|
+
import { jsx as jsx24, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1650
1666
|
var initialPropsComponent3 = {
|
|
1651
1667
|
control: {
|
|
1652
1668
|
variant: "outlined",
|
|
@@ -1698,17 +1714,24 @@ var MonthSelector = ({ label, value, disabled, propsComponent, data, daysFormat,
|
|
|
1698
1714
|
const getData = React10.useMemo(() => {
|
|
1699
1715
|
return getMonthCalendarProps({ year: data.years[yearSelected], data, daysFormat, value: valueState });
|
|
1700
1716
|
}, [yearSelected, data, daysFormat, valueState]);
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
setValueState(
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1717
|
+
const handleYearChange = (newIndex) => {
|
|
1718
|
+
setYearSelected(newIndex);
|
|
1719
|
+
};
|
|
1720
|
+
const handleMonthChange = (month) => {
|
|
1721
|
+
const newValue = `${month}-${data.years[yearSelected]}`;
|
|
1722
|
+
setValueState(newValue);
|
|
1723
|
+
onChange(newValue);
|
|
1724
|
+
const nextData = getMonthCalendarProps({
|
|
1725
|
+
year: data.years[yearSelected],
|
|
1726
|
+
data,
|
|
1727
|
+
daysFormat,
|
|
1728
|
+
value: newValue
|
|
1729
|
+
});
|
|
1730
|
+
onNext?.(nextData.prev);
|
|
1731
|
+
onLast?.(nextData.last);
|
|
1732
|
+
};
|
|
1733
|
+
const classes = monthSelectorVariants({ wrapper: true, disabled });
|
|
1734
|
+
return /* @__PURE__ */ jsxs7("div", { className: classes, ref, children: [
|
|
1712
1735
|
/* @__PURE__ */ jsx24(
|
|
1713
1736
|
Input,
|
|
1714
1737
|
{
|
|
@@ -1727,7 +1750,7 @@ var MonthSelector = ({ label, value, disabled, propsComponent, data, daysFormat,
|
|
|
1727
1750
|
{
|
|
1728
1751
|
className: iconClasses,
|
|
1729
1752
|
style: properties?.icon?.style,
|
|
1730
|
-
onClick: () => !disabled && setOpen(
|
|
1753
|
+
onClick: () => !disabled && setOpen(true),
|
|
1731
1754
|
"data-testid": "yr3MonthSelector--icon",
|
|
1732
1755
|
children: properties?.icon?.component ? properties?.icon.component : /* @__PURE__ */ jsx24(
|
|
1733
1756
|
IconCalendar,
|
|
@@ -1746,8 +1769,8 @@ var MonthSelector = ({ label, value, disabled, propsComponent, data, daysFormat,
|
|
|
1746
1769
|
className: "yr3MonthSelector--wrapper",
|
|
1747
1770
|
style: composeStyles(properties?.wrapper?.ui, properties?.wrapper?.style),
|
|
1748
1771
|
"data-testid": "yr3MonthSelector--wrapper",
|
|
1749
|
-
children: /* @__PURE__ */
|
|
1750
|
-
/* @__PURE__ */
|
|
1772
|
+
children: /* @__PURE__ */ jsxs7("div", { className: "yr3MonthSelector--component", children: [
|
|
1773
|
+
/* @__PURE__ */ jsxs7(
|
|
1751
1774
|
"div",
|
|
1752
1775
|
{
|
|
1753
1776
|
className: containerClasses,
|
|
@@ -1759,11 +1782,11 @@ var MonthSelector = ({ label, value, disabled, propsComponent, data, daysFormat,
|
|
|
1759
1782
|
disabled: disabled || yearSelected === 0,
|
|
1760
1783
|
type: "button",
|
|
1761
1784
|
className: `yr3MonthSelector--year-button-back ${yearSelected === 0 ? "yr3MonthSelector--year-button-back--disabled" : ""} `,
|
|
1762
|
-
onClick: () =>
|
|
1785
|
+
onClick: () => handleYearChange(yearSelected - 1),
|
|
1763
1786
|
children: /* @__PURE__ */ jsx24(IconLeft, { width: 20, height: 20, stroke: "currentColor" })
|
|
1764
1787
|
}
|
|
1765
1788
|
),
|
|
1766
|
-
/* @__PURE__ */ jsx24("div", { className: `yr3MonthSelector--year-option`, children: /* @__PURE__ */
|
|
1789
|
+
/* @__PURE__ */ jsx24("div", { className: `yr3MonthSelector--year-option`, children: /* @__PURE__ */ jsxs7(Text, { variant: "body1", color: "primary", children: [
|
|
1767
1790
|
data.years[yearSelected],
|
|
1768
1791
|
" "
|
|
1769
1792
|
] }) }),
|
|
@@ -1773,7 +1796,7 @@ var MonthSelector = ({ label, value, disabled, propsComponent, data, daysFormat,
|
|
|
1773
1796
|
disabled: disabled || yearSelected === data.years.length - 1,
|
|
1774
1797
|
type: "button",
|
|
1775
1798
|
className: `yr3MonthSelector--year-button-next ${yearSelected === data.years.length - 1 ? "yr3MonthSelector--year-button-next--disabled" : ""}`,
|
|
1776
|
-
onClick: () =>
|
|
1799
|
+
onClick: () => handleYearChange(yearSelected + 1),
|
|
1777
1800
|
children: /* @__PURE__ */ jsx24(IconRight, { width: 20, height: 30, stroke: "currentColor" })
|
|
1778
1801
|
}
|
|
1779
1802
|
)
|
|
@@ -1788,8 +1811,7 @@ var MonthSelector = ({ label, value, disabled, propsComponent, data, daysFormat,
|
|
|
1788
1811
|
disabled: m.disabled,
|
|
1789
1812
|
className: `yr3MonthSelector--month ${m.disabled ? "yr3MonthSelector--month--disabled" : ""} ${m.selected ? "yr3MonthSelector--month--selected" : ""}`,
|
|
1790
1813
|
onClick: () => {
|
|
1791
|
-
|
|
1792
|
-
setOpen(false);
|
|
1814
|
+
handleMonthChange(m.value);
|
|
1793
1815
|
},
|
|
1794
1816
|
children: /* @__PURE__ */ jsx24(Text, { ...properties?.text, weight: m.disabled ? "thin" : "medium", children: m.label })
|
|
1795
1817
|
},
|
|
@@ -2100,7 +2122,7 @@ var Image = ({
|
|
|
2100
2122
|
|
|
2101
2123
|
// src/components/ImageDropzone/ImageDropzone.tsx
|
|
2102
2124
|
import * as React13 from "react";
|
|
2103
|
-
import { jsx as jsx30, jsxs as
|
|
2125
|
+
import { jsx as jsx30, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2104
2126
|
var initialPropsComponent4 = {
|
|
2105
2127
|
box: {},
|
|
2106
2128
|
text: {},
|
|
@@ -2124,7 +2146,7 @@ var ImageDropzone = ({ onChange, multiple, propsComponent, bordered, component,
|
|
|
2124
2146
|
};
|
|
2125
2147
|
const classes = bem("yr3Dropzone");
|
|
2126
2148
|
const classComponent = classes(void 0, { "dragging": !!dragging, "bordered": !!bordered, variant });
|
|
2127
|
-
return /* @__PURE__ */ jsx30(Box, { as: "div", position: "relative", content: "center", ...properties?.box, children: /* @__PURE__ */
|
|
2149
|
+
return /* @__PURE__ */ jsx30(Box, { as: "div", position: "relative", content: "center", ...properties?.box, children: /* @__PURE__ */ jsxs8(
|
|
2128
2150
|
"div",
|
|
2129
2151
|
{
|
|
2130
2152
|
className: classComponent,
|
|
@@ -2204,7 +2226,7 @@ var inputAreaVariants = createVariants({
|
|
|
2204
2226
|
});
|
|
2205
2227
|
|
|
2206
2228
|
// src/components/InputArea/InputArea.tsx
|
|
2207
|
-
import { jsx as jsx31, jsxs as
|
|
2229
|
+
import { jsx as jsx31, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2208
2230
|
var initiaPropsComponent2 = {
|
|
2209
2231
|
label: {
|
|
2210
2232
|
display: true,
|
|
@@ -2247,7 +2269,7 @@ var InputArea = ({
|
|
|
2247
2269
|
el.style.resize = resize;
|
|
2248
2270
|
}
|
|
2249
2271
|
const classes = inputAreaVariants({ variant, color, rounded });
|
|
2250
|
-
return /* @__PURE__ */
|
|
2272
|
+
return /* @__PURE__ */ jsxs9("div", { style: { position: "relative" }, children: [
|
|
2251
2273
|
propsComponent?.label?.display && /* @__PURE__ */ jsx31(
|
|
2252
2274
|
Label,
|
|
2253
2275
|
{
|
|
@@ -2303,7 +2325,7 @@ var loaderSpinnerVariants = createVariants({
|
|
|
2303
2325
|
|
|
2304
2326
|
// src/components/Loader/Loader.tsx
|
|
2305
2327
|
import * as React15 from "react";
|
|
2306
|
-
import { jsx as jsx32, jsxs as
|
|
2328
|
+
import { jsx as jsx32, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2307
2329
|
var initialComponents2 = {
|
|
2308
2330
|
loader: {
|
|
2309
2331
|
ui: {},
|
|
@@ -2331,7 +2353,7 @@ var Loader = ({ component, loading = false, propsComponent }) => {
|
|
|
2331
2353
|
size: properties?.spinner?.size
|
|
2332
2354
|
});
|
|
2333
2355
|
if (!loading) return null;
|
|
2334
|
-
return /* @__PURE__ */ jsx32("div", { className: "yr3Loader", style: composeStyles(properties?.loader?.ui, properties?.loader?.style), children: /* @__PURE__ */ jsx32(Flex, { ...properties?.container, children: component || /* @__PURE__ */ jsx32("div", { className: classSpinner, children: properties?.spinner?.type === "dots" && /* @__PURE__ */
|
|
2356
|
+
return /* @__PURE__ */ jsx32("div", { className: "yr3Loader", style: composeStyles(properties?.loader?.ui, properties?.loader?.style), children: /* @__PURE__ */ jsx32(Flex, { ...properties?.container, children: component || /* @__PURE__ */ jsx32("div", { className: classSpinner, children: properties?.spinner?.type === "dots" && /* @__PURE__ */ jsxs10(React15.Fragment, { children: [
|
|
2335
2357
|
/* @__PURE__ */ jsx32("span", {}),
|
|
2336
2358
|
/* @__PURE__ */ jsx32("span", {}),
|
|
2337
2359
|
/* @__PURE__ */ jsx32("span", {})
|
|
@@ -2350,7 +2372,7 @@ var ModalContainer = ({ children, size = "sm", ui, style }) => {
|
|
|
2350
2372
|
};
|
|
2351
2373
|
|
|
2352
2374
|
// src/components/Modal/Modal.tsx
|
|
2353
|
-
import { jsx as jsx34, jsxs as
|
|
2375
|
+
import { jsx as jsx34, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2354
2376
|
var Modal = ({ open, onClose, children, propsComponent }) => {
|
|
2355
2377
|
const { show, hide } = useBackdrop();
|
|
2356
2378
|
React16.useEffect(() => {
|
|
@@ -2362,7 +2384,7 @@ var Modal = ({ open, onClose, children, propsComponent }) => {
|
|
|
2362
2384
|
}, [open]);
|
|
2363
2385
|
const classes = bem("yr3Modal");
|
|
2364
2386
|
const classComponent = classes(void 0, { "open": !!open });
|
|
2365
|
-
return /* @__PURE__ */ jsx34("div", { className: classComponent, onClick: (e) => e.stopPropagation(), "data-testid": "yr3Modal", children: /* @__PURE__ */ jsx34(ModalContainer, { ...propsComponent?.container, children: /* @__PURE__ */
|
|
2387
|
+
return /* @__PURE__ */ jsx34("div", { className: classComponent, onClick: (e) => e.stopPropagation(), "data-testid": "yr3Modal", children: /* @__PURE__ */ jsx34(ModalContainer, { ...propsComponent?.container, children: /* @__PURE__ */ jsxs11(Flex, { variant: "column", container: true, center: true, gap: 1, children: [
|
|
2366
2388
|
children,
|
|
2367
2389
|
propsComponent?.close ? propsComponent.close : /* @__PURE__ */ jsx34(Button, { variant: "filled", color: "secondary", onClick: onClose, "data-testid": "yr3Modal-close", children: "Close" })
|
|
2368
2390
|
] }) }) });
|
|
@@ -2404,13 +2426,13 @@ var notistackVariants = createVariants({
|
|
|
2404
2426
|
});
|
|
2405
2427
|
|
|
2406
2428
|
// src/components/Notistack/Notistack.tsx
|
|
2407
|
-
import { jsx as jsx35, jsxs as
|
|
2429
|
+
import { jsx as jsx35, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2408
2430
|
var Notistack = ({ message, duration = 3e3, variant = "info", color, propsComponent, anchor, exiting = false }) => {
|
|
2409
2431
|
const classes = notistackVariants({ type: variant, color, exiting, direction: `${anchor?.vertical || "bottom"}-${anchor?.horizontal || "right"}` });
|
|
2410
2432
|
const containerStyle = composeStyles(propsComponent?.container?.ui, propsComponent?.container?.style);
|
|
2411
2433
|
const notistackStyle = composeStyles(propsComponent?.notistack?.ui, propsComponent?.notistack?.style);
|
|
2412
2434
|
const progressStyle = composeStyles(propsComponent?.progress?.ui, propsComponent?.progress?.style);
|
|
2413
|
-
return /* @__PURE__ */
|
|
2435
|
+
return /* @__PURE__ */ jsxs12("div", { className: classes, "data-testid": "yr3Notistack", style: notistackStyle, children: [
|
|
2414
2436
|
/* @__PURE__ */ jsx35("span", { style: containerStyle, children: message }),
|
|
2415
2437
|
/* @__PURE__ */ jsx35(
|
|
2416
2438
|
"div",
|
|
@@ -2531,7 +2553,7 @@ var PickerIconVariants = createVariants({
|
|
|
2531
2553
|
});
|
|
2532
2554
|
|
|
2533
2555
|
// src/components/Picker/Picker.tsx
|
|
2534
|
-
import { jsx as jsx37, jsxs as
|
|
2556
|
+
import { jsx as jsx37, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2535
2557
|
var initiaPropsComponent3 = {
|
|
2536
2558
|
control: {
|
|
2537
2559
|
variant: "outlined",
|
|
@@ -2581,7 +2603,7 @@ var Picker = ({ label, variant, color, children, name, value, onChange, propsCom
|
|
|
2581
2603
|
onChange({ event: {}, target: { name, value: valueState }, currentTarget: { name, value: valueState } }, valueState);
|
|
2582
2604
|
}
|
|
2583
2605
|
}, [valueState, onChange, name]);
|
|
2584
|
-
return /* @__PURE__ */
|
|
2606
|
+
return /* @__PURE__ */ jsxs13("div", { className: classes, ref, children: [
|
|
2585
2607
|
/* @__PURE__ */ jsx37(
|
|
2586
2608
|
Input,
|
|
2587
2609
|
{
|
|
@@ -2634,7 +2656,7 @@ import * as React19 from "react";
|
|
|
2634
2656
|
|
|
2635
2657
|
// src/components/Selector/Selector.tsx
|
|
2636
2658
|
import * as React18 from "react";
|
|
2637
|
-
import { jsx as jsx38, jsxs as
|
|
2659
|
+
import { jsx as jsx38, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2638
2660
|
var initalPropsComponent2 = {
|
|
2639
2661
|
text: {
|
|
2640
2662
|
variant: "caption",
|
|
@@ -2651,8 +2673,8 @@ var Selector = ({ ui, style, options, name, value, defaultValue, onChange, iconC
|
|
|
2651
2673
|
const [valueState, setValueState] = React18.useState(value || defaultValue || null);
|
|
2652
2674
|
const ref = React18.useRef(null);
|
|
2653
2675
|
useClickAway(ref, () => setOpen(false));
|
|
2654
|
-
return /* @__PURE__ */
|
|
2655
|
-
/* @__PURE__ */ jsx38("div", { className: `yr3Selector ${open ? "yr3Selector--open" : ""}`, style: composeStyles(ui, style), children: /* @__PURE__ */
|
|
2676
|
+
return /* @__PURE__ */ jsxs14("div", { className: "yr3Selector-wrapper", ref, children: [
|
|
2677
|
+
/* @__PURE__ */ jsx38("div", { className: `yr3Selector ${open ? "yr3Selector--open" : ""}`, style: composeStyles(ui, style), children: /* @__PURE__ */ jsxs14("div", { className: "yr3Selector--control", children: [
|
|
2656
2678
|
/* @__PURE__ */ jsx38("div", { className: "yr3Selector--icon", onClick: () => setOpen((prev) => !prev), children: icon ? icon : /* @__PURE__ */ jsx38(IconDown, { stroke: `var(--color-${iconColor || "disabled"})`, width: 24, height: 24 }) }),
|
|
2657
2679
|
valueState
|
|
2658
2680
|
] }) }),
|
|
@@ -2685,7 +2707,7 @@ var Selector = ({ ui, style, options, name, value, defaultValue, onChange, iconC
|
|
|
2685
2707
|
};
|
|
2686
2708
|
|
|
2687
2709
|
// src/components/Phone/Phone.tsx
|
|
2688
|
-
import { jsx as jsx39, jsxs as
|
|
2710
|
+
import { jsx as jsx39, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2689
2711
|
var Phone = ({
|
|
2690
2712
|
name,
|
|
2691
2713
|
value,
|
|
@@ -2722,9 +2744,9 @@ var Phone = ({
|
|
|
2722
2744
|
setPrefix(val);
|
|
2723
2745
|
onChange?.(null, `${val}${number}`);
|
|
2724
2746
|
};
|
|
2725
|
-
return /* @__PURE__ */
|
|
2747
|
+
return /* @__PURE__ */ jsxs15(Control, { variant: "outlined", ui: { height: 50, position: "relative" }, children: [
|
|
2726
2748
|
/* @__PURE__ */ jsx39(Label, { text: label, className: "yr3Input--active" }),
|
|
2727
|
-
/* @__PURE__ */
|
|
2749
|
+
/* @__PURE__ */ jsxs15(Flex, { variant: "row", container: true, center: true, children: [
|
|
2728
2750
|
/* @__PURE__ */ jsx39(
|
|
2729
2751
|
Selector,
|
|
2730
2752
|
{
|
|
@@ -2764,7 +2786,7 @@ var Phone = ({
|
|
|
2764
2786
|
// src/components/Places/PlacesAutocomplete.tsx
|
|
2765
2787
|
import * as React20 from "react";
|
|
2766
2788
|
import { useAutocompletePlaces } from "@yr3/autocomplete-places";
|
|
2767
|
-
import { jsx as jsx40, jsxs as
|
|
2789
|
+
import { jsx as jsx40, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2768
2790
|
var initPropsComponent = {
|
|
2769
2791
|
label: {
|
|
2770
2792
|
display: true,
|
|
@@ -2846,7 +2868,7 @@ var PlacesAutocomplete = ({
|
|
|
2846
2868
|
onChangeForm({ target: { value } });
|
|
2847
2869
|
}
|
|
2848
2870
|
}, [onChangeForm]);
|
|
2849
|
-
return /* @__PURE__ */
|
|
2871
|
+
return /* @__PURE__ */ jsxs16(Control, { ...propsComponent?.control, children: [
|
|
2850
2872
|
/* @__PURE__ */ jsx40(
|
|
2851
2873
|
Input,
|
|
2852
2874
|
{
|
|
@@ -2889,7 +2911,7 @@ var radioVariant = createVariants({
|
|
|
2889
2911
|
});
|
|
2890
2912
|
|
|
2891
2913
|
// src/components/Radio/Radio.tsx
|
|
2892
|
-
import { jsx as jsx41, jsxs as
|
|
2914
|
+
import { jsx as jsx41, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2893
2915
|
var Radio = ({
|
|
2894
2916
|
checked,
|
|
2895
2917
|
value,
|
|
@@ -2905,7 +2927,7 @@ var Radio = ({
|
|
|
2905
2927
|
const bemClass = bem("yr3Radio");
|
|
2906
2928
|
const classes = bemClass(void 0, { [color]: `color-${color}` });
|
|
2907
2929
|
const variantClass = radioVariant({ variant });
|
|
2908
|
-
return /* @__PURE__ */
|
|
2930
|
+
return /* @__PURE__ */ jsxs17("label", { className: classes, "data-testid": "yr3Radio", style: composeStyles(propsComponent?.radio?.ui, propsComponent?.radio?.style), children: [
|
|
2909
2931
|
/* @__PURE__ */ jsx41(
|
|
2910
2932
|
"input",
|
|
2911
2933
|
{
|
|
@@ -2947,6 +2969,9 @@ var selectVariants = createVariants({
|
|
|
2947
2969
|
base: "yr3Select--base",
|
|
2948
2970
|
lined: "yr3Select--lined"
|
|
2949
2971
|
},
|
|
2972
|
+
disabled: {
|
|
2973
|
+
true: "yr3Select--disabled"
|
|
2974
|
+
},
|
|
2950
2975
|
color: {
|
|
2951
2976
|
primary: "yr3Select--color-primary",
|
|
2952
2977
|
secondary: "yr3Select--color-secondary",
|
|
@@ -2992,7 +3017,7 @@ var selectIconVariants = createVariants({
|
|
|
2992
3017
|
});
|
|
2993
3018
|
|
|
2994
3019
|
// src/components/Select/Select.tsx
|
|
2995
|
-
import { jsx as jsx42, jsxs as
|
|
3020
|
+
import { jsx as jsx42, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2996
3021
|
var initiaPropsComponent4 = {
|
|
2997
3022
|
control: {
|
|
2998
3023
|
variant: "outlined",
|
|
@@ -3031,15 +3056,15 @@ var initiaPropsComponent4 = {
|
|
|
3031
3056
|
component: void 0
|
|
3032
3057
|
}
|
|
3033
3058
|
};
|
|
3034
|
-
var Select = ({ label, options, name, value, defaultValue, onChange, propsComponent }) => {
|
|
3059
|
+
var Select = ({ label, options, name, value, defaultValue, onChange, propsComponent, disabled }) => {
|
|
3035
3060
|
const [open, setOpen] = React21.useState(false);
|
|
3036
3061
|
const [valueState, setValueState] = React21.useState(value || defaultValue || null);
|
|
3037
3062
|
const ref = React21.useRef(null);
|
|
3038
3063
|
useClickAway(ref, () => setOpen(false));
|
|
3039
3064
|
const properties = mergeDeep(initiaPropsComponent4, propsComponent || {});
|
|
3040
3065
|
const classesIcon = selectIconVariants({ color: properties?.icon?.color, animated: open, open });
|
|
3041
|
-
const classes = selectVariants({ wrapper: true });
|
|
3042
|
-
return /* @__PURE__ */
|
|
3066
|
+
const classes = selectVariants({ wrapper: true, disabled });
|
|
3067
|
+
return /* @__PURE__ */ jsxs18("div", { className: classes, ref, children: [
|
|
3043
3068
|
/* @__PURE__ */ jsx42(
|
|
3044
3069
|
Input,
|
|
3045
3070
|
{
|
|
@@ -3058,7 +3083,7 @@ var Select = ({ label, options, name, value, defaultValue, onChange, propsCompon
|
|
|
3058
3083
|
{
|
|
3059
3084
|
className: classesIcon,
|
|
3060
3085
|
style: properties?.icon?.style,
|
|
3061
|
-
onClick: () => setOpen((prev) => !prev),
|
|
3086
|
+
onClick: () => !disabled && setOpen((prev) => !prev),
|
|
3062
3087
|
"data-testid": "yr3Select-icon",
|
|
3063
3088
|
children: properties?.icon?.component ? properties?.icon.component : /* @__PURE__ */ jsx42(
|
|
3064
3089
|
IconDown,
|
|
@@ -3110,13 +3135,40 @@ var Select = ({ label, options, name, value, defaultValue, onChange, propsCompon
|
|
|
3110
3135
|
|
|
3111
3136
|
// src/components/Slide/Slide.tsx
|
|
3112
3137
|
import * as React22 from "react";
|
|
3138
|
+
|
|
3139
|
+
// src/components/Slide/variants.slide.ts
|
|
3140
|
+
var variantsSlide = createVariants({
|
|
3141
|
+
base: "yr3Slide--content",
|
|
3142
|
+
variants: {
|
|
3143
|
+
direction: {
|
|
3144
|
+
left: "yr3Slide--content--left",
|
|
3145
|
+
right: "yr3Slide--content--right",
|
|
3146
|
+
top: "yr3Slide--content--top",
|
|
3147
|
+
bottom: "yr3Slide--content--bottom"
|
|
3148
|
+
},
|
|
3149
|
+
open: {
|
|
3150
|
+
true: "yr3Slide--in",
|
|
3151
|
+
false: "yr3Slide--out"
|
|
3152
|
+
}
|
|
3153
|
+
}
|
|
3154
|
+
});
|
|
3155
|
+
|
|
3156
|
+
// src/components/Slide/Slide.tsx
|
|
3113
3157
|
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
3114
3158
|
var initialPropsComponent5 = {
|
|
3115
3159
|
slide: {
|
|
3116
3160
|
ui: {},
|
|
3117
3161
|
style: {}
|
|
3118
3162
|
},
|
|
3119
|
-
|
|
3163
|
+
content: {
|
|
3164
|
+
ui: {},
|
|
3165
|
+
style: {}
|
|
3166
|
+
},
|
|
3167
|
+
box: {
|
|
3168
|
+
as: "div",
|
|
3169
|
+
ui: {},
|
|
3170
|
+
style: {}
|
|
3171
|
+
}
|
|
3120
3172
|
};
|
|
3121
3173
|
var Slide = ({
|
|
3122
3174
|
in: inProp,
|
|
@@ -3127,33 +3179,29 @@ var Slide = ({
|
|
|
3127
3179
|
propsComponent
|
|
3128
3180
|
}) => {
|
|
3129
3181
|
const properties = mergeDeep(initialPropsComponent5, propsComponent || {});
|
|
3130
|
-
const
|
|
3131
|
-
const classNameContent = bemContent(void 0, {
|
|
3132
|
-
[direction]: true,
|
|
3133
|
-
"in": !!inProp,
|
|
3134
|
-
"out": !inProp
|
|
3135
|
-
});
|
|
3182
|
+
const stateRef = React22.useRef(inProp ? "in" : "out");
|
|
3136
3183
|
React22.useEffect(() => {
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
}
|
|
3143
|
-
return () => clearTimeout(timeoutId);
|
|
3144
|
-
}, [inProp, duration, onTransitionEnd]);
|
|
3145
|
-
const uiStyleContent = uiStyle({ ...properties?.slide?.ui, transitionDuration: `${duration}ms` });
|
|
3184
|
+
stateRef.current = inProp ? "in" : "out";
|
|
3185
|
+
}, [inProp]);
|
|
3186
|
+
const classesContent = variantsSlide({ direction, open: !!inProp ? "true" : "false" });
|
|
3187
|
+
const uiStyleSlider = uiStyle({ ...properties?.slide?.ui, transitionDuration: `${duration}ms` });
|
|
3188
|
+
const uiStyleContent = uiStyle({ ...properties?.content?.ui, transitionDuration: `${duration}ms` });
|
|
3146
3189
|
return /* @__PURE__ */ jsx43(
|
|
3147
3190
|
"div",
|
|
3148
3191
|
{
|
|
3149
3192
|
className: "yr3Slide",
|
|
3150
|
-
style: composeStyles(),
|
|
3193
|
+
style: composeStyles(uiStyleSlider, properties?.slide?.style || {}),
|
|
3151
3194
|
"data-testid": "yr3Slide",
|
|
3152
3195
|
children: /* @__PURE__ */ jsx43(
|
|
3153
3196
|
"div",
|
|
3154
3197
|
{
|
|
3155
|
-
className:
|
|
3156
|
-
|
|
3198
|
+
className: classesContent,
|
|
3199
|
+
onTransitionEnd: (e) => {
|
|
3200
|
+
if (e.target === e.currentTarget && e.propertyName === "transform") {
|
|
3201
|
+
onTransitionEnd?.(stateRef?.current);
|
|
3202
|
+
}
|
|
3203
|
+
},
|
|
3204
|
+
style: composeStyles(uiStyleContent, properties?.content?.style || {}),
|
|
3157
3205
|
"data-testid": "yr3Slide-content",
|
|
3158
3206
|
children: /* @__PURE__ */ jsx43(Box, { ...properties?.box, "data-testid": "yr3Slide-box", children })
|
|
3159
3207
|
}
|
|
@@ -3200,7 +3248,7 @@ var switchVariants = createVariants({
|
|
|
3200
3248
|
});
|
|
3201
3249
|
|
|
3202
3250
|
// src/components/Switch/Switch.tsx
|
|
3203
|
-
import { jsx as jsx44, jsxs as
|
|
3251
|
+
import { jsx as jsx44, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3204
3252
|
var Switch = ({
|
|
3205
3253
|
checked,
|
|
3206
3254
|
defaultChecked,
|
|
@@ -3220,7 +3268,7 @@ var Switch = ({
|
|
|
3220
3268
|
if (!isControlled) setInternal(e.target.checked);
|
|
3221
3269
|
onChange?.(e, e.target.checked);
|
|
3222
3270
|
};
|
|
3223
|
-
return /* @__PURE__ */
|
|
3271
|
+
return /* @__PURE__ */ jsxs19(
|
|
3224
3272
|
"label",
|
|
3225
3273
|
{
|
|
3226
3274
|
className: classname,
|
|
@@ -3255,7 +3303,7 @@ import * as React25 from "react";
|
|
|
3255
3303
|
|
|
3256
3304
|
// src/theme/notistackContext.tsx
|
|
3257
3305
|
import * as React24 from "react";
|
|
3258
|
-
import { jsx as jsx45, jsxs as
|
|
3306
|
+
import { jsx as jsx45, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
3259
3307
|
var NotistackContext = React24.createContext(null);
|
|
3260
3308
|
var NotistackProvider = ({ children }) => {
|
|
3261
3309
|
const [snacks, setSnacks] = React24.useState([]);
|
|
@@ -3273,7 +3321,7 @@ var NotistackProvider = ({ children }) => {
|
|
|
3273
3321
|
setSnacks((prev) => prev.filter((s) => s.id !== id));
|
|
3274
3322
|
}, duration + exitDuration);
|
|
3275
3323
|
};
|
|
3276
|
-
return /* @__PURE__ */
|
|
3324
|
+
return /* @__PURE__ */ jsxs20(NotistackContext.Provider, { value: { notistack }, children: [
|
|
3277
3325
|
children,
|
|
3278
3326
|
/* @__PURE__ */ jsx45("div", { className: "yr3NotistackContainer", children: snacks.map((snack) => /* @__PURE__ */ jsx45(Notistack, { ...snack }, snack.id)) })
|
|
3279
3327
|
] });
|