@yr3/ui 1.0.17 → 1.0.18
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/Date/month.css +117 -0
- package/dist/components/Date/month.css.map +1 -0
- package/dist/index.cjs +503 -313
- package/dist/index.d.cts +97 -49
- package/dist/index.d.ts +97 -49
- package/dist/index.js +498 -313
- package/dist/styles/index.css +116 -0
- package/dist/styles/index.css.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -102,6 +102,20 @@ function getMonthCalendar(year, month, startIndex, selected, props) {
|
|
|
102
102
|
currentDay: dayCurrent
|
|
103
103
|
};
|
|
104
104
|
}
|
|
105
|
+
function getMonthCalendarProps({ year, years, month, formatMonth, monthsDisabled }) {
|
|
106
|
+
const startIndex = dayjs().year(year).month().valueOf();
|
|
107
|
+
return {
|
|
108
|
+
month: dayjs().set("m", month).format(formatMonth || "MMM"),
|
|
109
|
+
year,
|
|
110
|
+
startIndex,
|
|
111
|
+
years,
|
|
112
|
+
months: Array.from({ length: 12 }, (_, i) => ({
|
|
113
|
+
label: dayjs().month(i).format(formatMonth || "MMM"),
|
|
114
|
+
value: dayjs().month(i).format("MM"),
|
|
115
|
+
disabled: dayjs().year(year).month(i).isAfter(dayjs(), "month") || monthsDisabled && monthsDisabled.includes(i)
|
|
116
|
+
}))
|
|
117
|
+
};
|
|
118
|
+
}
|
|
105
119
|
|
|
106
120
|
// src/utils/color.ts
|
|
107
121
|
var rgbToHex = (r, g, b) => {
|
|
@@ -1382,9 +1396,347 @@ var Drawer = ({ open, anchor = null, onClose, children, propsComponent }) => {
|
|
|
1382
1396
|
);
|
|
1383
1397
|
};
|
|
1384
1398
|
|
|
1385
|
-
// src/components/
|
|
1399
|
+
// src/components/Input/Input.tsx
|
|
1386
1400
|
import * as React9 from "react";
|
|
1401
|
+
|
|
1402
|
+
// src/components/Label/Label.tsx
|
|
1387
1403
|
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
1404
|
+
var Label = ({ text: text2, children, className, color = "primary", ui, style }) => {
|
|
1405
|
+
const classes = bem("yr3Label");
|
|
1406
|
+
const classComponent = classes(void 0, { color: `color-${color}` });
|
|
1407
|
+
const classnames = bemMerge(classComponent, className);
|
|
1408
|
+
return /* @__PURE__ */ jsx17(
|
|
1409
|
+
"span",
|
|
1410
|
+
{
|
|
1411
|
+
className: classnames,
|
|
1412
|
+
"data-testid": "yr3Label",
|
|
1413
|
+
style: composeStyles(ui, style),
|
|
1414
|
+
children: text2 ? text2 : children
|
|
1415
|
+
}
|
|
1416
|
+
);
|
|
1417
|
+
};
|
|
1418
|
+
|
|
1419
|
+
// src/components/Input/input.variants.ts
|
|
1420
|
+
var inputVariants = createVariants({
|
|
1421
|
+
base: "yr3Input",
|
|
1422
|
+
variants: {
|
|
1423
|
+
variant: {
|
|
1424
|
+
filled: "yr3Input--filled",
|
|
1425
|
+
outlined: "yr3Input--outlined",
|
|
1426
|
+
base: "yr3Input--base",
|
|
1427
|
+
lined: "yr3Input--lined"
|
|
1428
|
+
},
|
|
1429
|
+
color: {
|
|
1430
|
+
primary: "yr3Input--color-primary",
|
|
1431
|
+
secondary: "yr3Input--color-secondary",
|
|
1432
|
+
success: "yr3Input--color-success",
|
|
1433
|
+
text: "yr3Input--color-text",
|
|
1434
|
+
disabled: "yr3Input--color-disabled",
|
|
1435
|
+
background: "yr3Input--color-background",
|
|
1436
|
+
error: "yr3Input--color-error",
|
|
1437
|
+
warning: "yr3Input--color-warning",
|
|
1438
|
+
info: "yr3Input--color-info",
|
|
1439
|
+
common: "yr3Input--color-common"
|
|
1440
|
+
},
|
|
1441
|
+
size: {
|
|
1442
|
+
auto: "yr3Input--size-auto",
|
|
1443
|
+
full: "yr3Input--size-full"
|
|
1444
|
+
},
|
|
1445
|
+
rounded: {
|
|
1446
|
+
true: "yr3Input--rounded"
|
|
1447
|
+
},
|
|
1448
|
+
disabled: {
|
|
1449
|
+
true: "yr3Input--disabled"
|
|
1450
|
+
},
|
|
1451
|
+
animated: {
|
|
1452
|
+
true: "yr3Input--animated"
|
|
1453
|
+
},
|
|
1454
|
+
label: {
|
|
1455
|
+
true: "yr3Input--label"
|
|
1456
|
+
}
|
|
1457
|
+
}
|
|
1458
|
+
});
|
|
1459
|
+
|
|
1460
|
+
// src/components/Input/Input.tsx
|
|
1461
|
+
import { jsx as jsx18, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1462
|
+
var initiaPropsComponent = {
|
|
1463
|
+
label: {
|
|
1464
|
+
display: true,
|
|
1465
|
+
ui: {},
|
|
1466
|
+
style: {}
|
|
1467
|
+
},
|
|
1468
|
+
control: {}
|
|
1469
|
+
};
|
|
1470
|
+
var Input = React9.forwardRef(
|
|
1471
|
+
({
|
|
1472
|
+
label,
|
|
1473
|
+
value,
|
|
1474
|
+
defaultValue,
|
|
1475
|
+
onChange,
|
|
1476
|
+
variant = "outlined",
|
|
1477
|
+
error = "ce un errore",
|
|
1478
|
+
separatorCurrency = ",",
|
|
1479
|
+
ui,
|
|
1480
|
+
style,
|
|
1481
|
+
propsComponent = initiaPropsComponent,
|
|
1482
|
+
pattern = "text",
|
|
1483
|
+
color = "primary",
|
|
1484
|
+
size = "auto",
|
|
1485
|
+
...props
|
|
1486
|
+
}, ref) => {
|
|
1487
|
+
const [focused, setFocused] = React9.useState(false);
|
|
1488
|
+
const [internalValue, setInternalValue] = React9.useState(defaultValue);
|
|
1489
|
+
const isControlled = value !== void 0;
|
|
1490
|
+
const currentValue = isControlled ? value : internalValue;
|
|
1491
|
+
const isActive = focused || !!currentValue;
|
|
1492
|
+
const checkPattern = (type, value2) => {
|
|
1493
|
+
switch (type) {
|
|
1494
|
+
case "email":
|
|
1495
|
+
return /^[\w.-]+@[\w.-]+\.\w{2,}$/.test(value2);
|
|
1496
|
+
case "phone":
|
|
1497
|
+
return /^\d{10}$/.test(value2);
|
|
1498
|
+
case "number":
|
|
1499
|
+
return /^\d+$/.test(value2);
|
|
1500
|
+
case "currency":
|
|
1501
|
+
if (separatorCurrency === ",") return /^\d+(\,\d{0,2})?$/.test(value2);
|
|
1502
|
+
if (separatorCurrency === ".") return /^\d+(\.\d{0,2})?$/.test(value2);
|
|
1503
|
+
default:
|
|
1504
|
+
return true;
|
|
1505
|
+
}
|
|
1506
|
+
};
|
|
1507
|
+
const handleChange = (e) => {
|
|
1508
|
+
const newValue = e.target.value;
|
|
1509
|
+
if (newValue && !checkPattern(pattern, newValue)) return;
|
|
1510
|
+
if (!isControlled) {
|
|
1511
|
+
setInternalValue(newValue);
|
|
1512
|
+
}
|
|
1513
|
+
onChange?.(e, newValue);
|
|
1514
|
+
};
|
|
1515
|
+
const classes = inputVariants({ color, label: propsComponent?.label?.display });
|
|
1516
|
+
return /* @__PURE__ */ jsxs5(Control, { variant, color, label: propsComponent?.label?.display, ...propsComponent.control, children: [
|
|
1517
|
+
propsComponent?.label?.display && /* @__PURE__ */ jsx18(
|
|
1518
|
+
Label,
|
|
1519
|
+
{
|
|
1520
|
+
text: label || "",
|
|
1521
|
+
className: !!isActive ? "yr3Input--active" : "",
|
|
1522
|
+
color,
|
|
1523
|
+
...propsComponent.label
|
|
1524
|
+
}
|
|
1525
|
+
),
|
|
1526
|
+
/* @__PURE__ */ jsx18(
|
|
1527
|
+
"input",
|
|
1528
|
+
{
|
|
1529
|
+
ref,
|
|
1530
|
+
value: currentValue,
|
|
1531
|
+
inputMode: pattern === "currency" ? "numeric" : pattern === "phone" ? "tel" : void 0,
|
|
1532
|
+
autoComplete: "off",
|
|
1533
|
+
type: "text",
|
|
1534
|
+
onChange: handleChange,
|
|
1535
|
+
onFocus: () => setFocused(true),
|
|
1536
|
+
onBlur: () => setFocused(false),
|
|
1537
|
+
className: classes,
|
|
1538
|
+
style: composeStyles(ui, style),
|
|
1539
|
+
...props,
|
|
1540
|
+
"data-testid": "yr3Input"
|
|
1541
|
+
}
|
|
1542
|
+
)
|
|
1543
|
+
] });
|
|
1544
|
+
}
|
|
1545
|
+
);
|
|
1546
|
+
|
|
1547
|
+
// src/components/Date/MonthSelector.tsx
|
|
1548
|
+
import * as React10 from "react";
|
|
1549
|
+
|
|
1550
|
+
// src/Icons/IconSearch.tsx
|
|
1551
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
1552
|
+
var IconSearch = (props) => {
|
|
1553
|
+
return /* @__PURE__ */ jsx19("svg", { width: props.width || "64px", height: props.height || "64px", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx19(
|
|
1554
|
+
"path",
|
|
1555
|
+
{
|
|
1556
|
+
d: "M15.7955 15.8111L21 21M18 10.5C18 14.6421 14.6421 18 10.5 18C6.35786 18 3 14.6421 3 10.5C3 6.35786 6.35786 3 10.5 3C14.6421 3 18 6.35786 18 10.5Z",
|
|
1557
|
+
stroke: props.stroke || "#fff",
|
|
1558
|
+
strokeWidth: props.strokeWidth || "1.5",
|
|
1559
|
+
strokeLinecap: "round",
|
|
1560
|
+
strokeLinejoin: "round"
|
|
1561
|
+
}
|
|
1562
|
+
) });
|
|
1563
|
+
};
|
|
1564
|
+
|
|
1565
|
+
// src/Icons/IconDown.tsx
|
|
1566
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
1567
|
+
var IconDown = (props) => {
|
|
1568
|
+
return /* @__PURE__ */ jsx20("svg", { width: props.width || "64px", height: props.height || "64px", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", "data-testid": "yr3Icons", children: /* @__PURE__ */ jsx20("path", { d: "M7 10L12 15L17 10", stroke: props.stroke || "#fff", strokeWidth: props.strokeWidth || "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1569
|
+
};
|
|
1570
|
+
|
|
1571
|
+
// src/Icons/IconCalendar.tsx
|
|
1572
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
1573
|
+
var IconCalendar = (props) => {
|
|
1574
|
+
return /* @__PURE__ */ jsx21("svg", { width: props.width || "24px", height: props.height || "24px", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx21("path", { stroke: props.stroke, strokeLinecap: "round", strokeLinejoin: "round", d: "M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5" }) });
|
|
1575
|
+
};
|
|
1576
|
+
|
|
1577
|
+
// src/Icons/IconLeft.tsx
|
|
1578
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
1579
|
+
var IconLeft = (props) => {
|
|
1580
|
+
return /* @__PURE__ */ jsx22("svg", { width: props.width || "24px", height: props.height || "24px", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx22("path", { d: "M15 7L10 12L15 17", stroke: props.stroke || "currentColor", strokeWidth: props.strokeWidth || "2", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1581
|
+
};
|
|
1582
|
+
|
|
1583
|
+
// src/components/Date/month.variants.ts
|
|
1584
|
+
var monthSelectorIconVariants = createVariants({
|
|
1585
|
+
base: "yr3MonthSelector--icon",
|
|
1586
|
+
variants: {
|
|
1587
|
+
color: {
|
|
1588
|
+
primary: "yr3MonthSelector--icon-color-primary",
|
|
1589
|
+
secondary: "yr3MonthSelector--icon-color-secondary",
|
|
1590
|
+
success: "yr3MonthSelector--icon-color-success",
|
|
1591
|
+
text: "yr3MonthSelector--icon-color-text",
|
|
1592
|
+
disabled: "yr3MonthSelector--icon-color-disabled",
|
|
1593
|
+
background: "yr3MonthSelector--icon-color-background",
|
|
1594
|
+
error: "yr3MonthSelector--icon-color-error",
|
|
1595
|
+
warning: "yr3MonthSelector--icon-color-warning",
|
|
1596
|
+
info: "yr3MonthSelector--icon-color-info",
|
|
1597
|
+
common: "yr3MonthSelector--icon-color-common"
|
|
1598
|
+
},
|
|
1599
|
+
animated: {
|
|
1600
|
+
true: "yr3MonthSelector--icon-animated"
|
|
1601
|
+
},
|
|
1602
|
+
open: {
|
|
1603
|
+
true: "yr3MonthSelector--icon-open"
|
|
1604
|
+
}
|
|
1605
|
+
}
|
|
1606
|
+
});
|
|
1607
|
+
|
|
1608
|
+
// src/Icons/IconRight.tsx
|
|
1609
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
1610
|
+
var IconRight = (props) => {
|
|
1611
|
+
return /* @__PURE__ */ jsx23("svg", { width: props.width || "24px", height: props.height || "24px", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx23(
|
|
1612
|
+
"path",
|
|
1613
|
+
{
|
|
1614
|
+
d: "M9 7L14 12L9 17",
|
|
1615
|
+
stroke: props.stroke || "currentColor",
|
|
1616
|
+
strokeWidth: props.strokeWidth || "2",
|
|
1617
|
+
strokeLinecap: "round",
|
|
1618
|
+
strokeLinejoin: "round"
|
|
1619
|
+
}
|
|
1620
|
+
) });
|
|
1621
|
+
};
|
|
1622
|
+
|
|
1623
|
+
// src/components/Date/MonthSelector.tsx
|
|
1624
|
+
import { jsx as jsx24, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1625
|
+
var initialPropsComponent3 = {
|
|
1626
|
+
control: {
|
|
1627
|
+
variant: "outlined",
|
|
1628
|
+
color: "primary",
|
|
1629
|
+
ui: {},
|
|
1630
|
+
style: {}
|
|
1631
|
+
},
|
|
1632
|
+
label: {
|
|
1633
|
+
display: true,
|
|
1634
|
+
color: "primary",
|
|
1635
|
+
ui: {},
|
|
1636
|
+
style: {}
|
|
1637
|
+
},
|
|
1638
|
+
wrapper: {
|
|
1639
|
+
ui: {},
|
|
1640
|
+
style: {}
|
|
1641
|
+
},
|
|
1642
|
+
icon: {
|
|
1643
|
+
color: "primary",
|
|
1644
|
+
style: {},
|
|
1645
|
+
svg: {
|
|
1646
|
+
width: 20,
|
|
1647
|
+
height: 20
|
|
1648
|
+
},
|
|
1649
|
+
component: void 0
|
|
1650
|
+
}
|
|
1651
|
+
};
|
|
1652
|
+
var MonthSelector = ({ label, year, month, value, defaultValue, propsComponent, years, language, formatMonth = "MMM", monthsDisabled }) => {
|
|
1653
|
+
const [open, setOpen] = React10.useState(false);
|
|
1654
|
+
const [valueState, setValueState] = React10.useState(value || defaultValue || null);
|
|
1655
|
+
const [yearSelected, setYearSelected] = React10.useState(0);
|
|
1656
|
+
const ref = React10.useRef(null);
|
|
1657
|
+
useClickAway(ref, () => setOpen(false));
|
|
1658
|
+
const properties = mergeDeep(initialPropsComponent3, propsComponent || {});
|
|
1659
|
+
const iconClasses = monthSelectorIconVariants({ color: properties?.icon?.color });
|
|
1660
|
+
const data = React10.useMemo(() => getMonthCalendarProps({ year, month, years, language, formatMonth, monthsDisabled }), [year, month, years, language, formatMonth, monthsDisabled]);
|
|
1661
|
+
return /* @__PURE__ */ jsxs6("div", { className: "yr3MonthSelector", ref, children: [
|
|
1662
|
+
/* @__PURE__ */ jsx24(
|
|
1663
|
+
Input,
|
|
1664
|
+
{
|
|
1665
|
+
label,
|
|
1666
|
+
variant: "base",
|
|
1667
|
+
disabled: true,
|
|
1668
|
+
value: valueState || "",
|
|
1669
|
+
propsComponent: {
|
|
1670
|
+
control: properties?.control,
|
|
1671
|
+
label: properties?.label
|
|
1672
|
+
}
|
|
1673
|
+
}
|
|
1674
|
+
),
|
|
1675
|
+
/* @__PURE__ */ jsx24(
|
|
1676
|
+
"div",
|
|
1677
|
+
{
|
|
1678
|
+
className: iconClasses,
|
|
1679
|
+
style: properties?.icon?.style,
|
|
1680
|
+
onClick: () => setOpen((prev) => !prev),
|
|
1681
|
+
"data-testid": "yr3MonthSelector--icon",
|
|
1682
|
+
children: properties?.icon?.component ? properties?.icon.component : /* @__PURE__ */ jsx24(
|
|
1683
|
+
IconCalendar,
|
|
1684
|
+
{
|
|
1685
|
+
width: properties?.icon?.svg?.width,
|
|
1686
|
+
height: properties?.icon?.svg?.height,
|
|
1687
|
+
stroke: "currentColor",
|
|
1688
|
+
style: properties?.icon?.svg
|
|
1689
|
+
}
|
|
1690
|
+
)
|
|
1691
|
+
}
|
|
1692
|
+
),
|
|
1693
|
+
open && /* @__PURE__ */ jsx24(
|
|
1694
|
+
"div",
|
|
1695
|
+
{
|
|
1696
|
+
className: "yr3MonthSelector--wrapper",
|
|
1697
|
+
style: composeStyles(properties?.wrapper?.ui, properties?.wrapper?.style),
|
|
1698
|
+
"data-testid": "yr3MonthSelector--wrapper",
|
|
1699
|
+
children: /* @__PURE__ */ jsxs6("div", { className: "yr3MonthSelector--component", children: [
|
|
1700
|
+
/* @__PURE__ */ jsxs6("div", { className: "yr3MonthSelector--year-options", children: [
|
|
1701
|
+
/* @__PURE__ */ jsx24("button", { disabled: yearSelected === 0, type: "button", className: `yr3MonthSelector--year-button-back ${yearSelected === 0 ? "yr3MonthSelector--year-button-back--disabled" : ""} `, onClick: () => setYearSelected(yearSelected - 1), children: /* @__PURE__ */ jsx24(IconLeft, { width: 20, height: 20, stroke: "currentColor" }) }),
|
|
1702
|
+
/* @__PURE__ */ jsx24("div", { className: `yr3MonthSelector--year-option`, children: /* @__PURE__ */ jsxs6(Text, { variant: "body1", color: "primary", children: [
|
|
1703
|
+
years[yearSelected],
|
|
1704
|
+
" "
|
|
1705
|
+
] }) }),
|
|
1706
|
+
/* @__PURE__ */ jsx24(
|
|
1707
|
+
"button",
|
|
1708
|
+
{
|
|
1709
|
+
disabled: yearSelected === years.length - 1,
|
|
1710
|
+
type: "button",
|
|
1711
|
+
className: `yr3MonthSelector--year-button-next ${yearSelected === years.length - 1 ? "yr3MonthSelector--year-button-next--disabled" : ""}`,
|
|
1712
|
+
onClick: () => setYearSelected(yearSelected + 1),
|
|
1713
|
+
children: /* @__PURE__ */ jsx24(IconRight, { width: 20, height: 30, stroke: "currentColor" })
|
|
1714
|
+
}
|
|
1715
|
+
)
|
|
1716
|
+
] }),
|
|
1717
|
+
/* @__PURE__ */ jsx24("div", { className: "yr3MonthSelector--months", children: data.months.map((m) => /* @__PURE__ */ jsx24(
|
|
1718
|
+
"button",
|
|
1719
|
+
{
|
|
1720
|
+
type: "button",
|
|
1721
|
+
disabled: m.disabled,
|
|
1722
|
+
className: `yr3MonthSelector--month ${m.disabled ? "yr3MonthSelector--month-disabled" : ""}`,
|
|
1723
|
+
onClick: () => {
|
|
1724
|
+
setValueState(`${m.value}-${years[yearSelected]}`);
|
|
1725
|
+
setOpen(false);
|
|
1726
|
+
},
|
|
1727
|
+
children: m.label
|
|
1728
|
+
},
|
|
1729
|
+
"month-" + m.value
|
|
1730
|
+
)) })
|
|
1731
|
+
] })
|
|
1732
|
+
}
|
|
1733
|
+
)
|
|
1734
|
+
] });
|
|
1735
|
+
};
|
|
1736
|
+
|
|
1737
|
+
// src/components/Fade/Fade.tsx
|
|
1738
|
+
import * as React11 from "react";
|
|
1739
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
1388
1740
|
var Fade = ({
|
|
1389
1741
|
in: inProp,
|
|
1390
1742
|
children,
|
|
@@ -1392,7 +1744,7 @@ var Fade = ({
|
|
|
1392
1744
|
onTransitionEnd,
|
|
1393
1745
|
style
|
|
1394
1746
|
}) => {
|
|
1395
|
-
|
|
1747
|
+
React11.useEffect(() => {
|
|
1396
1748
|
let timeoutId;
|
|
1397
1749
|
if (inProp) {
|
|
1398
1750
|
timeoutId = setTimeout(() => {
|
|
@@ -1401,7 +1753,7 @@ var Fade = ({
|
|
|
1401
1753
|
}
|
|
1402
1754
|
return () => clearTimeout(timeoutId);
|
|
1403
1755
|
}, [inProp, duration, onTransitionEnd]);
|
|
1404
|
-
return /* @__PURE__ */
|
|
1756
|
+
return /* @__PURE__ */ jsx25(
|
|
1405
1757
|
"div",
|
|
1406
1758
|
{
|
|
1407
1759
|
className: `yr3Fade ${inProp ? "yr3Fade--in" : ""}`,
|
|
@@ -1438,7 +1790,7 @@ var flexVariants = createVariants({
|
|
|
1438
1790
|
var flex_variants_default = flexVariants;
|
|
1439
1791
|
|
|
1440
1792
|
// src/components/Flex/Flex.tsx
|
|
1441
|
-
import { jsx as
|
|
1793
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
1442
1794
|
var Flex = ({
|
|
1443
1795
|
container = false,
|
|
1444
1796
|
spacing: spacing2 = 1,
|
|
@@ -1453,7 +1805,7 @@ var Flex = ({
|
|
|
1453
1805
|
...props
|
|
1454
1806
|
}) => {
|
|
1455
1807
|
const classes = flex_variants_default({ variant, container, center, between, bordered, spacing: spacing2 });
|
|
1456
|
-
return /* @__PURE__ */
|
|
1808
|
+
return /* @__PURE__ */ jsx26(
|
|
1457
1809
|
"div",
|
|
1458
1810
|
{
|
|
1459
1811
|
className: classes,
|
|
@@ -1466,7 +1818,7 @@ var Flex = ({
|
|
|
1466
1818
|
};
|
|
1467
1819
|
|
|
1468
1820
|
// src/components/Grid/Grid.tsx
|
|
1469
|
-
import { jsx as
|
|
1821
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
1470
1822
|
var Grid = ({
|
|
1471
1823
|
container = false,
|
|
1472
1824
|
spacing: spacing2 = 0,
|
|
@@ -1499,7 +1851,7 @@ var Grid = ({
|
|
|
1499
1851
|
}
|
|
1500
1852
|
const classes = bem("yr3Grid");
|
|
1501
1853
|
const className = classes(void 0, { container, [`spacing-${spacing2}`]: center, span: item && `Col-${size}` });
|
|
1502
|
-
return /* @__PURE__ */
|
|
1854
|
+
return /* @__PURE__ */ jsx27(
|
|
1503
1855
|
"div",
|
|
1504
1856
|
{
|
|
1505
1857
|
className,
|
|
@@ -1512,7 +1864,7 @@ var Grid = ({
|
|
|
1512
1864
|
};
|
|
1513
1865
|
|
|
1514
1866
|
// src/components/Group/Group.tsx
|
|
1515
|
-
import * as
|
|
1867
|
+
import * as React12 from "react";
|
|
1516
1868
|
|
|
1517
1869
|
// src/components/Group/group.variants.ts
|
|
1518
1870
|
var groupVariants = createVariants({
|
|
@@ -1543,7 +1895,7 @@ var groupVariants = createVariants({
|
|
|
1543
1895
|
});
|
|
1544
1896
|
|
|
1545
1897
|
// src/components/Group/Group.tsx
|
|
1546
|
-
import { jsx as
|
|
1898
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
1547
1899
|
var initialComponents = (color) => ({
|
|
1548
1900
|
group: {
|
|
1549
1901
|
ui: {},
|
|
@@ -1576,9 +1928,9 @@ var Group = ({
|
|
|
1576
1928
|
initialComponents(type === "rounded" ? "text" : color),
|
|
1577
1929
|
propsComponent || {}
|
|
1578
1930
|
);
|
|
1579
|
-
const [internalValue, setInternalValue] =
|
|
1931
|
+
const [internalValue, setInternalValue] = React12.useState(null);
|
|
1580
1932
|
const isControlled = value !== void 0;
|
|
1581
|
-
|
|
1933
|
+
React12.useEffect(() => {
|
|
1582
1934
|
if (isControlled) {
|
|
1583
1935
|
setInternalValue(value);
|
|
1584
1936
|
}
|
|
@@ -1589,7 +1941,7 @@ var Group = ({
|
|
|
1589
1941
|
active: !exclude ? Array.isArray(value) ? value.includes(item?.value) : internalValue === item.value : false,
|
|
1590
1942
|
exclude: exclude && Array.isArray(value) ? !value.includes(item?.value) : ""
|
|
1591
1943
|
});
|
|
1592
|
-
const mappingStyle =
|
|
1944
|
+
const mappingStyle = React12.useMemo(() => {
|
|
1593
1945
|
if (variant !== "filled") return options.map((opt, index) => ({
|
|
1594
1946
|
...opt,
|
|
1595
1947
|
index,
|
|
@@ -1620,13 +1972,13 @@ var Group = ({
|
|
|
1620
1972
|
}
|
|
1621
1973
|
}));
|
|
1622
1974
|
}, [exclude, value, options, type]);
|
|
1623
|
-
return /* @__PURE__ */
|
|
1975
|
+
return /* @__PURE__ */ jsx28(
|
|
1624
1976
|
"div",
|
|
1625
1977
|
{
|
|
1626
1978
|
className: groupVariants({ variant, color, type }),
|
|
1627
1979
|
"data-testid": "yr3Group",
|
|
1628
1980
|
style: composeStyles(properties.group?.ui, properties.group?.style),
|
|
1629
|
-
children: options.map((opt, index) => /* @__PURE__ */
|
|
1981
|
+
children: options.map((opt, index) => /* @__PURE__ */ jsx28(
|
|
1630
1982
|
"div",
|
|
1631
1983
|
{
|
|
1632
1984
|
"data-testid": "yr3Group-item",
|
|
@@ -1644,7 +1996,7 @@ var Group = ({
|
|
|
1644
1996
|
...mappingStyle?.find((o) => o.value === opt.value)?.style
|
|
1645
1997
|
}
|
|
1646
1998
|
),
|
|
1647
|
-
children: /* @__PURE__ */
|
|
1999
|
+
children: /* @__PURE__ */ jsx28(
|
|
1648
2000
|
Text,
|
|
1649
2001
|
{
|
|
1650
2002
|
...properties.item?.text,
|
|
@@ -1660,14 +2012,14 @@ var Group = ({
|
|
|
1660
2012
|
};
|
|
1661
2013
|
|
|
1662
2014
|
// src/components/Image/Image.tsx
|
|
1663
|
-
import { jsx as
|
|
2015
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
1664
2016
|
var Image = ({
|
|
1665
2017
|
src,
|
|
1666
2018
|
alt = "",
|
|
1667
2019
|
ui,
|
|
1668
2020
|
style
|
|
1669
2021
|
}) => {
|
|
1670
|
-
return /* @__PURE__ */
|
|
2022
|
+
return /* @__PURE__ */ jsx29(
|
|
1671
2023
|
"img",
|
|
1672
2024
|
{
|
|
1673
2025
|
src,
|
|
@@ -1680,9 +2032,9 @@ var Image = ({
|
|
|
1680
2032
|
};
|
|
1681
2033
|
|
|
1682
2034
|
// src/components/ImageDropzone/ImageDropzone.tsx
|
|
1683
|
-
import * as
|
|
1684
|
-
import { jsx as
|
|
1685
|
-
var
|
|
2035
|
+
import * as React13 from "react";
|
|
2036
|
+
import { jsx as jsx30, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2037
|
+
var initialPropsComponent4 = {
|
|
1686
2038
|
box: {},
|
|
1687
2039
|
text: {},
|
|
1688
2040
|
container: {},
|
|
@@ -1690,10 +2042,10 @@ var initialPropsComponent3 = {
|
|
|
1690
2042
|
content: {}
|
|
1691
2043
|
};
|
|
1692
2044
|
var ImageDropzone = ({ onChange, multiple, propsComponent, bordered, component, defaultImage, variant = "outlined" }) => {
|
|
1693
|
-
const properties = mergeDeep(
|
|
1694
|
-
const [dragging, setDragging] =
|
|
1695
|
-
const [files, setFiles] =
|
|
1696
|
-
const inputRef =
|
|
2045
|
+
const properties = mergeDeep(initialPropsComponent4, propsComponent || {});
|
|
2046
|
+
const [dragging, setDragging] = React13.useState(false);
|
|
2047
|
+
const [files, setFiles] = React13.useState([]);
|
|
2048
|
+
const inputRef = React13.useRef(null);
|
|
1697
2049
|
const handleFiles = (fileList) => {
|
|
1698
2050
|
if (!fileList) return;
|
|
1699
2051
|
const newFiles = Array.from(fileList);
|
|
@@ -1705,7 +2057,7 @@ var ImageDropzone = ({ onChange, multiple, propsComponent, bordered, component,
|
|
|
1705
2057
|
};
|
|
1706
2058
|
const classes = bem("yr3Dropzone");
|
|
1707
2059
|
const classComponent = classes(void 0, { "dragging": !!dragging, "bordered": !!bordered, variant });
|
|
1708
|
-
return /* @__PURE__ */
|
|
2060
|
+
return /* @__PURE__ */ jsx30(Box, { as: "div", position: "relative", content: "center", ...properties?.box, children: /* @__PURE__ */ jsxs7(
|
|
1709
2061
|
"div",
|
|
1710
2062
|
{
|
|
1711
2063
|
className: classComponent,
|
|
@@ -1722,7 +2074,7 @@ var ImageDropzone = ({ onChange, multiple, propsComponent, bordered, component,
|
|
|
1722
2074
|
onClick: () => inputRef.current?.click(),
|
|
1723
2075
|
style: composeStyles(properties?.container?.ui, properties?.container?.style),
|
|
1724
2076
|
children: [
|
|
1725
|
-
/* @__PURE__ */
|
|
2077
|
+
/* @__PURE__ */ jsx30(
|
|
1726
2078
|
"input",
|
|
1727
2079
|
{
|
|
1728
2080
|
ref: inputRef,
|
|
@@ -1733,166 +2085,18 @@ var ImageDropzone = ({ onChange, multiple, propsComponent, bordered, component,
|
|
|
1733
2085
|
onChange: (e) => handleFiles(e.target.files)
|
|
1734
2086
|
}
|
|
1735
2087
|
),
|
|
1736
|
-
isEmpty(files) && /* @__PURE__ */
|
|
1737
|
-
multiple && /* @__PURE__ */
|
|
1738
|
-
!multiple && /* @__PURE__ */
|
|
1739
|
-
!!defaultImage && /* @__PURE__ */
|
|
2088
|
+
isEmpty(files) && /* @__PURE__ */ jsx30("div", { className: "yr3Dropzone--content", style: composeStyles(properties?.content?.ui, properties?.content?.style), children: /* @__PURE__ */ jsx30(Text, { variant: "helper", color: "disabled", ...propsComponent?.text, children: propsComponent?.text?.primary || "Drag and drop an image here, or click to select one" }) }),
|
|
2089
|
+
multiple && /* @__PURE__ */ jsx30("div", { className: "yr3Dropzone--previews", style: composeStyles(properties?.preview?.ui, properties?.preview?.style), children: files.map((file, i) => /* @__PURE__ */ jsx30("img", { src: URL.createObjectURL(file) }, i)) }),
|
|
2090
|
+
!multiple && /* @__PURE__ */ jsx30("div", { className: "yr3Dropzone--preview", style: composeStyles(properties?.preview?.ui, properties?.preview?.style), children: files.map((file, i) => /* @__PURE__ */ jsx30("img", { src: URL.createObjectURL(file) }, i)) }),
|
|
2091
|
+
!!defaultImage && /* @__PURE__ */ jsx30("div", { className: "yr3Dropzone--preview", style: composeStyles(properties?.preview?.ui, properties?.preview?.style), children: /* @__PURE__ */ jsx30("img", { src: defaultImage }) }),
|
|
1740
2092
|
component
|
|
1741
2093
|
]
|
|
1742
2094
|
}
|
|
1743
2095
|
) });
|
|
1744
2096
|
};
|
|
1745
2097
|
|
|
1746
|
-
// src/components/Input/Input.tsx
|
|
1747
|
-
import * as React12 from "react";
|
|
1748
|
-
|
|
1749
|
-
// src/components/Label/Label.tsx
|
|
1750
|
-
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
1751
|
-
var Label = ({ text: text2, children, className, color = "primary", ui, style }) => {
|
|
1752
|
-
const classes = bem("yr3Label");
|
|
1753
|
-
const classComponent = classes(void 0, { color: `color-${color}` });
|
|
1754
|
-
const classnames = bemMerge(classComponent, className);
|
|
1755
|
-
return /* @__PURE__ */ jsx23(
|
|
1756
|
-
"span",
|
|
1757
|
-
{
|
|
1758
|
-
className: classnames,
|
|
1759
|
-
"data-testid": "yr3Label",
|
|
1760
|
-
style: composeStyles(ui, style),
|
|
1761
|
-
children: text2 ? text2 : children
|
|
1762
|
-
}
|
|
1763
|
-
);
|
|
1764
|
-
};
|
|
1765
|
-
|
|
1766
|
-
// src/components/Input/input.variants.ts
|
|
1767
|
-
var inputVariants = createVariants({
|
|
1768
|
-
base: "yr3Input",
|
|
1769
|
-
variants: {
|
|
1770
|
-
variant: {
|
|
1771
|
-
filled: "yr3Input--filled",
|
|
1772
|
-
outlined: "yr3Input--outlined",
|
|
1773
|
-
base: "yr3Input--base",
|
|
1774
|
-
lined: "yr3Input--lined"
|
|
1775
|
-
},
|
|
1776
|
-
color: {
|
|
1777
|
-
primary: "yr3Input--color-primary",
|
|
1778
|
-
secondary: "yr3Input--color-secondary",
|
|
1779
|
-
success: "yr3Input--color-success",
|
|
1780
|
-
text: "yr3Input--color-text",
|
|
1781
|
-
disabled: "yr3Input--color-disabled",
|
|
1782
|
-
background: "yr3Input--color-background",
|
|
1783
|
-
error: "yr3Input--color-error",
|
|
1784
|
-
warning: "yr3Input--color-warning",
|
|
1785
|
-
info: "yr3Input--color-info",
|
|
1786
|
-
common: "yr3Input--color-common"
|
|
1787
|
-
},
|
|
1788
|
-
size: {
|
|
1789
|
-
auto: "yr3Input--size-auto",
|
|
1790
|
-
full: "yr3Input--size-full"
|
|
1791
|
-
},
|
|
1792
|
-
rounded: {
|
|
1793
|
-
true: "yr3Input--rounded"
|
|
1794
|
-
},
|
|
1795
|
-
disabled: {
|
|
1796
|
-
true: "yr3Input--disabled"
|
|
1797
|
-
},
|
|
1798
|
-
animated: {
|
|
1799
|
-
true: "yr3Input--animated"
|
|
1800
|
-
},
|
|
1801
|
-
label: {
|
|
1802
|
-
true: "yr3Input--label"
|
|
1803
|
-
}
|
|
1804
|
-
}
|
|
1805
|
-
});
|
|
1806
|
-
|
|
1807
|
-
// src/components/Input/Input.tsx
|
|
1808
|
-
import { jsx as jsx24, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1809
|
-
var initiaPropsComponent = {
|
|
1810
|
-
label: {
|
|
1811
|
-
display: true,
|
|
1812
|
-
ui: {},
|
|
1813
|
-
style: {}
|
|
1814
|
-
},
|
|
1815
|
-
control: {}
|
|
1816
|
-
};
|
|
1817
|
-
var Input = React12.forwardRef(
|
|
1818
|
-
({
|
|
1819
|
-
label,
|
|
1820
|
-
value,
|
|
1821
|
-
defaultValue,
|
|
1822
|
-
onChange,
|
|
1823
|
-
variant = "outlined",
|
|
1824
|
-
error = "ce un errore",
|
|
1825
|
-
separatorCurrency = ",",
|
|
1826
|
-
ui,
|
|
1827
|
-
style,
|
|
1828
|
-
propsComponent = initiaPropsComponent,
|
|
1829
|
-
pattern = "text",
|
|
1830
|
-
color = "primary",
|
|
1831
|
-
size = "auto",
|
|
1832
|
-
...props
|
|
1833
|
-
}, ref) => {
|
|
1834
|
-
const [focused, setFocused] = React12.useState(false);
|
|
1835
|
-
const [internalValue, setInternalValue] = React12.useState(defaultValue);
|
|
1836
|
-
const isControlled = value !== void 0;
|
|
1837
|
-
const currentValue = isControlled ? value : internalValue;
|
|
1838
|
-
const isActive = focused || !!currentValue;
|
|
1839
|
-
const checkPattern = (type, value2) => {
|
|
1840
|
-
switch (type) {
|
|
1841
|
-
case "email":
|
|
1842
|
-
return /^[\w.-]+@[\w.-]+\.\w{2,}$/.test(value2);
|
|
1843
|
-
case "phone":
|
|
1844
|
-
return /^\d{10}$/.test(value2);
|
|
1845
|
-
case "number":
|
|
1846
|
-
return /^\d+$/.test(value2);
|
|
1847
|
-
case "currency":
|
|
1848
|
-
if (separatorCurrency === ",") return /^\d+(\,\d{0,2})?$/.test(value2);
|
|
1849
|
-
if (separatorCurrency === ".") return /^\d+(\.\d{0,2})?$/.test(value2);
|
|
1850
|
-
default:
|
|
1851
|
-
return true;
|
|
1852
|
-
}
|
|
1853
|
-
};
|
|
1854
|
-
const handleChange = (e) => {
|
|
1855
|
-
const newValue = e.target.value;
|
|
1856
|
-
if (newValue && !checkPattern(pattern, newValue)) return;
|
|
1857
|
-
if (!isControlled) {
|
|
1858
|
-
setInternalValue(newValue);
|
|
1859
|
-
}
|
|
1860
|
-
onChange?.(e, newValue);
|
|
1861
|
-
};
|
|
1862
|
-
const classes = inputVariants({ color, label: propsComponent?.label?.display });
|
|
1863
|
-
return /* @__PURE__ */ jsxs6(Control, { variant, color, label: propsComponent?.label?.display, ...propsComponent.control, children: [
|
|
1864
|
-
propsComponent?.label?.display && /* @__PURE__ */ jsx24(
|
|
1865
|
-
Label,
|
|
1866
|
-
{
|
|
1867
|
-
text: label || "",
|
|
1868
|
-
className: !!isActive ? "yr3Input--active" : "",
|
|
1869
|
-
color,
|
|
1870
|
-
...propsComponent.label
|
|
1871
|
-
}
|
|
1872
|
-
),
|
|
1873
|
-
/* @__PURE__ */ jsx24(
|
|
1874
|
-
"input",
|
|
1875
|
-
{
|
|
1876
|
-
ref,
|
|
1877
|
-
value: currentValue,
|
|
1878
|
-
inputMode: pattern === "currency" ? "numeric" : pattern === "phone" ? "tel" : void 0,
|
|
1879
|
-
autoComplete: "off",
|
|
1880
|
-
type: "text",
|
|
1881
|
-
onChange: handleChange,
|
|
1882
|
-
onFocus: () => setFocused(true),
|
|
1883
|
-
onBlur: () => setFocused(false),
|
|
1884
|
-
className: classes,
|
|
1885
|
-
style: composeStyles(ui, style),
|
|
1886
|
-
...props,
|
|
1887
|
-
"data-testid": "yr3Input"
|
|
1888
|
-
}
|
|
1889
|
-
)
|
|
1890
|
-
] });
|
|
1891
|
-
}
|
|
1892
|
-
);
|
|
1893
|
-
|
|
1894
2098
|
// src/components/InputArea/InputArea.tsx
|
|
1895
|
-
import * as
|
|
2099
|
+
import * as React14 from "react";
|
|
1896
2100
|
|
|
1897
2101
|
// src/components/InputArea/inputAreaVariants.ts
|
|
1898
2102
|
var inputAreaVariants = createVariants({
|
|
@@ -1933,7 +2137,7 @@ var inputAreaVariants = createVariants({
|
|
|
1933
2137
|
});
|
|
1934
2138
|
|
|
1935
2139
|
// src/components/InputArea/InputArea.tsx
|
|
1936
|
-
import { jsx as
|
|
2140
|
+
import { jsx as jsx31, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1937
2141
|
var initiaPropsComponent2 = {
|
|
1938
2142
|
label: {
|
|
1939
2143
|
display: true,
|
|
@@ -1958,8 +2162,8 @@ var InputArea = ({
|
|
|
1958
2162
|
rounded = false,
|
|
1959
2163
|
propsComponent = initiaPropsComponent2
|
|
1960
2164
|
}) => {
|
|
1961
|
-
const ref =
|
|
1962
|
-
const [internalValue, setInternalValue] =
|
|
2165
|
+
const ref = React14.useRef(null);
|
|
2166
|
+
const [internalValue, setInternalValue] = React14.useState(defaultValue);
|
|
1963
2167
|
const isControlled = value !== void 0;
|
|
1964
2168
|
const currentValue = isControlled ? value : internalValue;
|
|
1965
2169
|
const handleChange = (e) => {
|
|
@@ -1976,8 +2180,8 @@ var InputArea = ({
|
|
|
1976
2180
|
el.style.resize = resize;
|
|
1977
2181
|
}
|
|
1978
2182
|
const classes = inputAreaVariants({ variant, color, rounded });
|
|
1979
|
-
return /* @__PURE__ */
|
|
1980
|
-
propsComponent?.label?.display && /* @__PURE__ */
|
|
2183
|
+
return /* @__PURE__ */ jsxs8("div", { style: { position: "relative" }, children: [
|
|
2184
|
+
propsComponent?.label?.display && /* @__PURE__ */ jsx31(
|
|
1981
2185
|
Label,
|
|
1982
2186
|
{
|
|
1983
2187
|
text: label || "",
|
|
@@ -1985,7 +2189,7 @@ var InputArea = ({
|
|
|
1985
2189
|
...propsComponent.label
|
|
1986
2190
|
}
|
|
1987
2191
|
),
|
|
1988
|
-
/* @__PURE__ */
|
|
2192
|
+
/* @__PURE__ */ jsx31(
|
|
1989
2193
|
"textarea",
|
|
1990
2194
|
{
|
|
1991
2195
|
className: classes,
|
|
@@ -1997,7 +2201,7 @@ var InputArea = ({
|
|
|
1997
2201
|
"data-testid": "yr3InputArea"
|
|
1998
2202
|
}
|
|
1999
2203
|
),
|
|
2000
|
-
/* @__PURE__ */
|
|
2204
|
+
/* @__PURE__ */ jsx31(Text, { variant: "helper", color: currentValue.length > maxLength ? "error" : "disabled", ui: { textAlign: "right" }, "data-testid": "yr3InputAreaError", children: validate && maxLength ? `${currentValue.length}/${maxLength}` || propsComponent.helperText : "" })
|
|
2001
2205
|
] });
|
|
2002
2206
|
};
|
|
2003
2207
|
|
|
@@ -2031,8 +2235,8 @@ var loaderSpinnerVariants = createVariants({
|
|
|
2031
2235
|
});
|
|
2032
2236
|
|
|
2033
2237
|
// src/components/Loader/Loader.tsx
|
|
2034
|
-
import * as
|
|
2035
|
-
import { jsx as
|
|
2238
|
+
import * as React15 from "react";
|
|
2239
|
+
import { jsx as jsx32, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2036
2240
|
var initialComponents2 = {
|
|
2037
2241
|
loader: {
|
|
2038
2242
|
ui: {},
|
|
@@ -2060,29 +2264,29 @@ var Loader = ({ component, loading = false, propsComponent }) => {
|
|
|
2060
2264
|
size: properties?.spinner?.size
|
|
2061
2265
|
});
|
|
2062
2266
|
if (!loading) return null;
|
|
2063
|
-
return /* @__PURE__ */
|
|
2064
|
-
/* @__PURE__ */
|
|
2065
|
-
/* @__PURE__ */
|
|
2066
|
-
/* @__PURE__ */
|
|
2267
|
+
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__ */ jsxs9(React15.Fragment, { children: [
|
|
2268
|
+
/* @__PURE__ */ jsx32("span", {}),
|
|
2269
|
+
/* @__PURE__ */ jsx32("span", {}),
|
|
2270
|
+
/* @__PURE__ */ jsx32("span", {})
|
|
2067
2271
|
] }) }) }) });
|
|
2068
2272
|
};
|
|
2069
2273
|
|
|
2070
2274
|
// src/components/Modal/Modal.tsx
|
|
2071
|
-
import * as
|
|
2275
|
+
import * as React16 from "react";
|
|
2072
2276
|
|
|
2073
2277
|
// src/components/Modal/ModalContainer.tsx
|
|
2074
|
-
import { jsx as
|
|
2278
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
2075
2279
|
var ModalContainer = ({ children, size = "sm", ui, style }) => {
|
|
2076
2280
|
const classes = bem("yr3Modal-container");
|
|
2077
2281
|
const classComponent = classes(void 0, { [`${size}`]: !!size });
|
|
2078
|
-
return /* @__PURE__ */
|
|
2282
|
+
return /* @__PURE__ */ jsx33("div", { className: classComponent, style: composeStyles(ui, style), "data-testid": "yr3Modal-container", children });
|
|
2079
2283
|
};
|
|
2080
2284
|
|
|
2081
2285
|
// src/components/Modal/Modal.tsx
|
|
2082
|
-
import { jsx as
|
|
2286
|
+
import { jsx as jsx34, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2083
2287
|
var Modal = ({ open, onClose, children, propsComponent }) => {
|
|
2084
2288
|
const { show, hide } = useBackdrop();
|
|
2085
|
-
|
|
2289
|
+
React16.useEffect(() => {
|
|
2086
2290
|
if (open) {
|
|
2087
2291
|
show("modal");
|
|
2088
2292
|
} else {
|
|
@@ -2091,9 +2295,9 @@ var Modal = ({ open, onClose, children, propsComponent }) => {
|
|
|
2091
2295
|
}, [open]);
|
|
2092
2296
|
const classes = bem("yr3Modal");
|
|
2093
2297
|
const classComponent = classes(void 0, { "open": !!open });
|
|
2094
|
-
return /* @__PURE__ */
|
|
2298
|
+
return /* @__PURE__ */ jsx34("div", { className: classComponent, onClick: (e) => e.stopPropagation(), "data-testid": "yr3Modal", children: /* @__PURE__ */ jsx34(ModalContainer, { ...propsComponent?.container, children: /* @__PURE__ */ jsxs10(Flex, { variant: "column", container: true, center: true, gap: 1, children: [
|
|
2095
2299
|
children,
|
|
2096
|
-
propsComponent?.close ? propsComponent.close : /* @__PURE__ */
|
|
2300
|
+
propsComponent?.close ? propsComponent.close : /* @__PURE__ */ jsx34(Button, { variant: "filled", color: "secondary", onClick: onClose, "data-testid": "yr3Modal-close", children: "Close" })
|
|
2097
2301
|
] }) }) });
|
|
2098
2302
|
};
|
|
2099
2303
|
|
|
@@ -2133,15 +2337,15 @@ var notistackVariants = createVariants({
|
|
|
2133
2337
|
});
|
|
2134
2338
|
|
|
2135
2339
|
// src/components/Notistack/Notistack.tsx
|
|
2136
|
-
import { jsx as
|
|
2340
|
+
import { jsx as jsx35, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2137
2341
|
var Notistack = ({ message, duration = 3e3, variant = "info", color, propsComponent, anchor, exiting = false }) => {
|
|
2138
2342
|
const classes = notistackVariants({ type: variant, color, exiting, direction: `${anchor?.vertical || "bottom"}-${anchor?.horizontal || "right"}` });
|
|
2139
2343
|
const containerStyle = composeStyles(propsComponent?.container?.ui, propsComponent?.container?.style);
|
|
2140
2344
|
const notistackStyle = composeStyles(propsComponent?.notistack?.ui, propsComponent?.notistack?.style);
|
|
2141
2345
|
const progressStyle = composeStyles(propsComponent?.progress?.ui, propsComponent?.progress?.style);
|
|
2142
|
-
return /* @__PURE__ */
|
|
2143
|
-
/* @__PURE__ */
|
|
2144
|
-
/* @__PURE__ */
|
|
2346
|
+
return /* @__PURE__ */ jsxs11("div", { className: classes, "data-testid": "yr3Notistack", style: notistackStyle, children: [
|
|
2347
|
+
/* @__PURE__ */ jsx35("span", { style: containerStyle, children: message }),
|
|
2348
|
+
/* @__PURE__ */ jsx35(
|
|
2145
2349
|
"div",
|
|
2146
2350
|
{
|
|
2147
2351
|
className: "yr3Notistack--progress",
|
|
@@ -2176,7 +2380,7 @@ var pendingVariants = createVariants({
|
|
|
2176
2380
|
});
|
|
2177
2381
|
|
|
2178
2382
|
// src/components/Pending/Pending.tsx
|
|
2179
|
-
import { jsx as
|
|
2383
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
2180
2384
|
var Pending = ({
|
|
2181
2385
|
variant,
|
|
2182
2386
|
width,
|
|
@@ -2189,7 +2393,7 @@ var Pending = ({
|
|
|
2189
2393
|
const widthStyle = variant === "circle" ? size : width;
|
|
2190
2394
|
const heightStyle = variant === "circle" ? size : height;
|
|
2191
2395
|
const uiStylePending = uiStyle({ width: widthStyle, height: heightStyle, ...ui });
|
|
2192
|
-
return /* @__PURE__ */
|
|
2396
|
+
return /* @__PURE__ */ jsx36(
|
|
2193
2397
|
"div",
|
|
2194
2398
|
{
|
|
2195
2399
|
className: pendingVariants({ variant, color }),
|
|
@@ -2200,19 +2404,11 @@ var Pending = ({
|
|
|
2200
2404
|
};
|
|
2201
2405
|
|
|
2202
2406
|
// src/components/Phone/Phone.tsx
|
|
2203
|
-
import * as
|
|
2204
|
-
|
|
2205
|
-
// src/components/Selector/Selector.tsx
|
|
2206
|
-
import * as React16 from "react";
|
|
2207
|
-
|
|
2208
|
-
// src/Icons/IconDown.tsx
|
|
2209
|
-
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
2210
|
-
var IconDown = (props) => {
|
|
2211
|
-
return /* @__PURE__ */ jsx31("svg", { width: props.width || "64px", height: props.height || "64px", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", "data-testid": "yr3Icons", children: /* @__PURE__ */ jsx31("path", { d: "M7 10L12 15L17 10", stroke: props.stroke || "#fff", strokeWidth: props.strokeWidth || "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
2212
|
-
};
|
|
2407
|
+
import * as React18 from "react";
|
|
2213
2408
|
|
|
2214
2409
|
// src/components/Selector/Selector.tsx
|
|
2215
|
-
import
|
|
2410
|
+
import * as React17 from "react";
|
|
2411
|
+
import { jsx as jsx37, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2216
2412
|
var initalPropsComponent2 = {
|
|
2217
2413
|
text: {
|
|
2218
2414
|
variant: "caption",
|
|
@@ -2225,16 +2421,16 @@ var initalPropsComponent2 = {
|
|
|
2225
2421
|
}
|
|
2226
2422
|
};
|
|
2227
2423
|
var Selector = ({ ui, style, options, name, value, defaultValue, onChange, iconColor, icon, propsComponent = initalPropsComponent2 }) => {
|
|
2228
|
-
const [open, setOpen] =
|
|
2229
|
-
const [valueState, setValueState] =
|
|
2230
|
-
const ref =
|
|
2424
|
+
const [open, setOpen] = React17.useState(false);
|
|
2425
|
+
const [valueState, setValueState] = React17.useState(value || defaultValue || null);
|
|
2426
|
+
const ref = React17.useRef(null);
|
|
2231
2427
|
useClickAway(ref, () => setOpen(false));
|
|
2232
|
-
return /* @__PURE__ */
|
|
2233
|
-
/* @__PURE__ */
|
|
2234
|
-
/* @__PURE__ */
|
|
2428
|
+
return /* @__PURE__ */ jsxs12("div", { className: "yr3Selector-wrapper", ref, children: [
|
|
2429
|
+
/* @__PURE__ */ jsx37("div", { className: `yr3Selector ${open ? "yr3Selector--open" : ""}`, style: composeStyles(ui, style), children: /* @__PURE__ */ jsxs12("div", { className: "yr3Selector--control", children: [
|
|
2430
|
+
/* @__PURE__ */ jsx37("div", { className: "yr3Selector--icon", onClick: () => setOpen((prev) => !prev), children: icon ? icon : /* @__PURE__ */ jsx37(IconDown, { stroke: `var(--color-${iconColor || "disabled"})`, width: 24, height: 24 }) }),
|
|
2235
2431
|
valueState
|
|
2236
2432
|
] }) }),
|
|
2237
|
-
open && /* @__PURE__ */
|
|
2433
|
+
open && /* @__PURE__ */ jsx37("div", { className: "yr3Selector--menu", style: composeStyles(propsComponent.menu?.ui, propsComponent.menu?.style), children: options.map((opt) => /* @__PURE__ */ jsx37(
|
|
2238
2434
|
"div",
|
|
2239
2435
|
{
|
|
2240
2436
|
className: "yr3Selector--option",
|
|
@@ -2255,16 +2451,15 @@ var Selector = ({ ui, style, options, name, value, defaultValue, onChange, iconC
|
|
|
2255
2451
|
};
|
|
2256
2452
|
onChange?.(event, opt.value);
|
|
2257
2453
|
},
|
|
2258
|
-
children: /* @__PURE__ */
|
|
2454
|
+
children: /* @__PURE__ */ jsx37(Text, { ...propsComponent?.text, children: propsComponent?.text?.children || opt.label })
|
|
2259
2455
|
},
|
|
2260
2456
|
opt.value
|
|
2261
2457
|
)) })
|
|
2262
2458
|
] });
|
|
2263
2459
|
};
|
|
2264
|
-
var Selector_default = Selector;
|
|
2265
2460
|
|
|
2266
2461
|
// src/components/Phone/Phone.tsx
|
|
2267
|
-
import { jsx as
|
|
2462
|
+
import { jsx as jsx38, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2268
2463
|
var Phone = ({
|
|
2269
2464
|
name,
|
|
2270
2465
|
value,
|
|
@@ -2276,13 +2471,13 @@ var Phone = ({
|
|
|
2276
2471
|
}) => {
|
|
2277
2472
|
const isControlled = value !== void 0;
|
|
2278
2473
|
const initial = value || defaultValue || "";
|
|
2279
|
-
const [prefix, setPrefix] =
|
|
2474
|
+
const [prefix, setPrefix] = React18.useState(
|
|
2280
2475
|
getDialPhone(initial, countries) || countries[0].dial
|
|
2281
2476
|
);
|
|
2282
|
-
const [number, setNumber] =
|
|
2477
|
+
const [number, setNumber] = React18.useState(
|
|
2283
2478
|
getNumberPhone(initial, prefix) || ""
|
|
2284
2479
|
);
|
|
2285
|
-
|
|
2480
|
+
React18.useEffect(() => {
|
|
2286
2481
|
if (isControlled && value) {
|
|
2287
2482
|
const dial = getDialPhone(value, countries);
|
|
2288
2483
|
const num = getNumberPhone(value, dial);
|
|
@@ -2301,11 +2496,11 @@ var Phone = ({
|
|
|
2301
2496
|
setPrefix(val);
|
|
2302
2497
|
onChange?.(null, `${val}${number}`);
|
|
2303
2498
|
};
|
|
2304
|
-
return /* @__PURE__ */
|
|
2305
|
-
/* @__PURE__ */
|
|
2306
|
-
/* @__PURE__ */
|
|
2307
|
-
/* @__PURE__ */
|
|
2308
|
-
|
|
2499
|
+
return /* @__PURE__ */ jsxs13(Control, { variant: "outlined", ui: { height: 50, position: "relative" }, children: [
|
|
2500
|
+
/* @__PURE__ */ jsx38(Label, { text: label, className: "yr3Input--active" }),
|
|
2501
|
+
/* @__PURE__ */ jsxs13(Flex, { variant: "row", container: true, center: true, children: [
|
|
2502
|
+
/* @__PURE__ */ jsx38(
|
|
2503
|
+
Selector,
|
|
2309
2504
|
{
|
|
2310
2505
|
options: countries.map((c) => ({
|
|
2311
2506
|
value: c.dial,
|
|
@@ -2316,7 +2511,7 @@ var Phone = ({
|
|
|
2316
2511
|
...propsComponent?.selector
|
|
2317
2512
|
}
|
|
2318
2513
|
),
|
|
2319
|
-
/* @__PURE__ */
|
|
2514
|
+
/* @__PURE__ */ jsx38(
|
|
2320
2515
|
Divider,
|
|
2321
2516
|
{
|
|
2322
2517
|
orientation: "vertical",
|
|
@@ -2325,7 +2520,7 @@ var Phone = ({
|
|
|
2325
2520
|
...propsComponent?.divider
|
|
2326
2521
|
}
|
|
2327
2522
|
),
|
|
2328
|
-
/* @__PURE__ */
|
|
2523
|
+
/* @__PURE__ */ jsx38(
|
|
2329
2524
|
Input,
|
|
2330
2525
|
{
|
|
2331
2526
|
type: "number",
|
|
@@ -2341,9 +2536,9 @@ var Phone = ({
|
|
|
2341
2536
|
};
|
|
2342
2537
|
|
|
2343
2538
|
// src/components/Places/PlacesAutocomplete.tsx
|
|
2344
|
-
import * as
|
|
2539
|
+
import * as React19 from "react";
|
|
2345
2540
|
import { useAutocompletePlaces } from "@yr3/autocomplete-places";
|
|
2346
|
-
import { jsx as
|
|
2541
|
+
import { jsx as jsx39, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2347
2542
|
var initPropsComponent = {
|
|
2348
2543
|
label: {
|
|
2349
2544
|
display: true,
|
|
@@ -2383,9 +2578,9 @@ var PlacesAutocomplete = ({
|
|
|
2383
2578
|
keyApi,
|
|
2384
2579
|
propsComponent = initPropsComponent
|
|
2385
2580
|
}) => {
|
|
2386
|
-
const [value, setValue] =
|
|
2387
|
-
const inputRef =
|
|
2388
|
-
const [anchorEl, setAnchorEl] =
|
|
2581
|
+
const [value, setValue] = React19.useState(null);
|
|
2582
|
+
const inputRef = React19.useRef(null);
|
|
2583
|
+
const [anchorEl, setAnchorEl] = React19.useState(null);
|
|
2389
2584
|
const { suggestions, selectPlace } = useAutocompletePlaces({ input: value, apiKey: keyApi, language, provider });
|
|
2390
2585
|
const handleSelect = async (id) => {
|
|
2391
2586
|
const place = await selectPlace(id);
|
|
@@ -2405,12 +2600,12 @@ var PlacesAutocomplete = ({
|
|
|
2405
2600
|
setValue(place.address);
|
|
2406
2601
|
setAnchorEl(null);
|
|
2407
2602
|
};
|
|
2408
|
-
|
|
2603
|
+
React19.useEffect(() => {
|
|
2409
2604
|
if (defaultLocation) {
|
|
2410
2605
|
setValue(defaultLocation);
|
|
2411
2606
|
}
|
|
2412
2607
|
}, [defaultLocation]);
|
|
2413
|
-
|
|
2608
|
+
React19.useEffect(() => {
|
|
2414
2609
|
if (value === "") {
|
|
2415
2610
|
onSelect(null);
|
|
2416
2611
|
}
|
|
@@ -2420,13 +2615,13 @@ var PlacesAutocomplete = ({
|
|
|
2420
2615
|
setAnchorEl(e.target.value ? inputRef.current : null);
|
|
2421
2616
|
};
|
|
2422
2617
|
const open = suggestions.length > 0 && Boolean(anchorEl);
|
|
2423
|
-
|
|
2618
|
+
React19.useEffect(() => {
|
|
2424
2619
|
if (onChangeForm) {
|
|
2425
2620
|
onChangeForm({ target: { value } });
|
|
2426
2621
|
}
|
|
2427
2622
|
}, [onChangeForm]);
|
|
2428
|
-
return /* @__PURE__ */
|
|
2429
|
-
/* @__PURE__ */
|
|
2623
|
+
return /* @__PURE__ */ jsxs14(Control, { ...propsComponent?.control, children: [
|
|
2624
|
+
/* @__PURE__ */ jsx39(
|
|
2430
2625
|
Input,
|
|
2431
2626
|
{
|
|
2432
2627
|
ref: inputRef,
|
|
@@ -2440,7 +2635,7 @@ var PlacesAutocomplete = ({
|
|
|
2440
2635
|
},
|
|
2441
2636
|
"input-places"
|
|
2442
2637
|
),
|
|
2443
|
-
open && /* @__PURE__ */
|
|
2638
|
+
open && /* @__PURE__ */ jsx39("div", { className: "yr3Places--menu", style: composeStyles(propsComponent.menu?.ui, propsComponent?.menu?.style), children: /* @__PURE__ */ jsx39(Flex, { container: true, ui: { p: 1 }, children: suggestions.map((s) => /* @__PURE__ */ jsx39(Flex, { onClick: () => handleSelect(s.id), ui: { padding: 8, cursor: "pointer", "&:hover": { backgroundColor: "rgba(0,0,0,0.1)" } }, children: /* @__PURE__ */ jsx39(Text, { ...propsComponent?.menu?.text, children: s.description }) }, s.id)) }) })
|
|
2444
2639
|
] });
|
|
2445
2640
|
};
|
|
2446
2641
|
|
|
@@ -2468,7 +2663,7 @@ var radioVariant = createVariants({
|
|
|
2468
2663
|
});
|
|
2469
2664
|
|
|
2470
2665
|
// src/components/Radio/Radio.tsx
|
|
2471
|
-
import { jsx as
|
|
2666
|
+
import { jsx as jsx40, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2472
2667
|
var Radio = ({
|
|
2473
2668
|
checked,
|
|
2474
2669
|
value,
|
|
@@ -2484,8 +2679,8 @@ var Radio = ({
|
|
|
2484
2679
|
const bemClass = bem("yr3Radio");
|
|
2485
2680
|
const classes = bemClass(void 0, { [color]: `color-${color}` });
|
|
2486
2681
|
const variantClass = radioVariant({ variant });
|
|
2487
|
-
return /* @__PURE__ */
|
|
2488
|
-
/* @__PURE__ */
|
|
2682
|
+
return /* @__PURE__ */ jsxs15("label", { className: classes, "data-testid": "yr3Radio", style: composeStyles(propsComponent?.radio?.ui, propsComponent?.radio?.style), children: [
|
|
2683
|
+
/* @__PURE__ */ jsx40(
|
|
2489
2684
|
"input",
|
|
2490
2685
|
{
|
|
2491
2686
|
type: "radio",
|
|
@@ -2497,8 +2692,8 @@ var Radio = ({
|
|
|
2497
2692
|
}
|
|
2498
2693
|
),
|
|
2499
2694
|
iconChecked && checked ? iconChecked : !checked && iconUnchecked ? iconUnchecked : null,
|
|
2500
|
-
!iconChecked && !iconUnchecked && /* @__PURE__ */
|
|
2501
|
-
typeof label === "string" && /* @__PURE__ */
|
|
2695
|
+
!iconChecked && !iconUnchecked && /* @__PURE__ */ jsx40("span", { className: variantClass, "data-testid": "yr3Radio-dot" }),
|
|
2696
|
+
typeof label === "string" && /* @__PURE__ */ jsx40(
|
|
2502
2697
|
"span",
|
|
2503
2698
|
{
|
|
2504
2699
|
className: "yr3Radio--label",
|
|
@@ -2511,7 +2706,7 @@ var Radio = ({
|
|
|
2511
2706
|
};
|
|
2512
2707
|
|
|
2513
2708
|
// src/components/Select/Select.tsx
|
|
2514
|
-
import * as
|
|
2709
|
+
import * as React20 from "react";
|
|
2515
2710
|
|
|
2516
2711
|
// src/components/Select/select.variants.ts
|
|
2517
2712
|
var selectVariants = createVariants({
|
|
@@ -2571,7 +2766,7 @@ var selectIconVariants = createVariants({
|
|
|
2571
2766
|
});
|
|
2572
2767
|
|
|
2573
2768
|
// src/components/Select/Select.tsx
|
|
2574
|
-
import { jsx as
|
|
2769
|
+
import { jsx as jsx41, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2575
2770
|
var initiaPropsComponent3 = {
|
|
2576
2771
|
control: {
|
|
2577
2772
|
variant: "outlined",
|
|
@@ -2611,15 +2806,15 @@ var initiaPropsComponent3 = {
|
|
|
2611
2806
|
}
|
|
2612
2807
|
};
|
|
2613
2808
|
var Select = ({ label, options, name, value, defaultValue, onChange, propsComponent }) => {
|
|
2614
|
-
const [open, setOpen] =
|
|
2615
|
-
const [valueState, setValueState] =
|
|
2616
|
-
const ref =
|
|
2809
|
+
const [open, setOpen] = React20.useState(false);
|
|
2810
|
+
const [valueState, setValueState] = React20.useState(value || defaultValue || null);
|
|
2811
|
+
const ref = React20.useRef(null);
|
|
2617
2812
|
useClickAway(ref, () => setOpen(false));
|
|
2618
2813
|
const properties = mergeDeep(initiaPropsComponent3, propsComponent || {});
|
|
2619
2814
|
const classesIcon = selectIconVariants({ color: properties?.icon?.color, animated: open, open });
|
|
2620
2815
|
const classes = selectVariants({ wrapper: true });
|
|
2621
|
-
return /* @__PURE__ */
|
|
2622
|
-
/* @__PURE__ */
|
|
2816
|
+
return /* @__PURE__ */ jsxs16("div", { className: classes, ref, children: [
|
|
2817
|
+
/* @__PURE__ */ jsx41(
|
|
2623
2818
|
Input,
|
|
2624
2819
|
{
|
|
2625
2820
|
label,
|
|
@@ -2632,14 +2827,14 @@ var Select = ({ label, options, name, value, defaultValue, onChange, propsCompon
|
|
|
2632
2827
|
}
|
|
2633
2828
|
}
|
|
2634
2829
|
),
|
|
2635
|
-
/* @__PURE__ */
|
|
2830
|
+
/* @__PURE__ */ jsx41(
|
|
2636
2831
|
"div",
|
|
2637
2832
|
{
|
|
2638
2833
|
className: classesIcon,
|
|
2639
2834
|
style: properties?.icon?.style,
|
|
2640
2835
|
onClick: () => setOpen((prev) => !prev),
|
|
2641
2836
|
"data-testid": "yr3Select-icon",
|
|
2642
|
-
children: properties?.icon?.component ? properties?.icon.component : /* @__PURE__ */
|
|
2837
|
+
children: properties?.icon?.component ? properties?.icon.component : /* @__PURE__ */ jsx41(
|
|
2643
2838
|
IconDown,
|
|
2644
2839
|
{
|
|
2645
2840
|
width: properties?.icon?.style?.width,
|
|
@@ -2650,13 +2845,13 @@ var Select = ({ label, options, name, value, defaultValue, onChange, propsCompon
|
|
|
2650
2845
|
)
|
|
2651
2846
|
}
|
|
2652
2847
|
),
|
|
2653
|
-
open && /* @__PURE__ */
|
|
2848
|
+
open && /* @__PURE__ */ jsx41(
|
|
2654
2849
|
"div",
|
|
2655
2850
|
{
|
|
2656
2851
|
className: "yr3Select--menu",
|
|
2657
2852
|
style: composeStyles(properties?.menu?.ui, properties?.menu?.style),
|
|
2658
2853
|
"data-testid": "yr3Select-menu",
|
|
2659
|
-
children: options.map((opt) => /* @__PURE__ */
|
|
2854
|
+
children: options.map((opt) => /* @__PURE__ */ jsx41(
|
|
2660
2855
|
"div",
|
|
2661
2856
|
{
|
|
2662
2857
|
className: "yr3Select--option",
|
|
@@ -2678,7 +2873,7 @@ var Select = ({ label, options, name, value, defaultValue, onChange, propsCompon
|
|
|
2678
2873
|
onChange?.(event, opt.value);
|
|
2679
2874
|
},
|
|
2680
2875
|
style: composeStyles(properties?.menu?.options?.ui, properties?.menu?.options?.style),
|
|
2681
|
-
children: /* @__PURE__ */
|
|
2876
|
+
children: /* @__PURE__ */ jsx41(Text, { as: "span", variant: "caption", color: properties?.menu?.options?.text?.color || "primary", ...properties?.menu?.options?.text, children: opt.label })
|
|
2682
2877
|
},
|
|
2683
2878
|
opt.value
|
|
2684
2879
|
))
|
|
@@ -2688,9 +2883,9 @@ var Select = ({ label, options, name, value, defaultValue, onChange, propsCompon
|
|
|
2688
2883
|
};
|
|
2689
2884
|
|
|
2690
2885
|
// src/components/Slide/Slide.tsx
|
|
2691
|
-
import * as
|
|
2692
|
-
import { jsx as
|
|
2693
|
-
var
|
|
2886
|
+
import * as React21 from "react";
|
|
2887
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
2888
|
+
var initialPropsComponent5 = {
|
|
2694
2889
|
slide: {
|
|
2695
2890
|
ui: {},
|
|
2696
2891
|
style: {}
|
|
@@ -2705,14 +2900,14 @@ var Slide = ({
|
|
|
2705
2900
|
onTransitionEnd,
|
|
2706
2901
|
propsComponent
|
|
2707
2902
|
}) => {
|
|
2708
|
-
const properties = mergeDeep(
|
|
2903
|
+
const properties = mergeDeep(initialPropsComponent5, propsComponent || {});
|
|
2709
2904
|
const bemContent = bem("yr3Slide--content");
|
|
2710
2905
|
const classNameContent = bemContent(void 0, {
|
|
2711
2906
|
[direction]: true,
|
|
2712
2907
|
"in": !!inProp,
|
|
2713
2908
|
"out": !inProp
|
|
2714
2909
|
});
|
|
2715
|
-
|
|
2910
|
+
React21.useEffect(() => {
|
|
2716
2911
|
let timeoutId;
|
|
2717
2912
|
if (inProp) {
|
|
2718
2913
|
timeoutId = setTimeout(() => {
|
|
@@ -2722,19 +2917,19 @@ var Slide = ({
|
|
|
2722
2917
|
return () => clearTimeout(timeoutId);
|
|
2723
2918
|
}, [inProp, duration, onTransitionEnd]);
|
|
2724
2919
|
const uiStyleContent = uiStyle({ ...properties?.slide?.ui, transitionDuration: `${duration}ms` });
|
|
2725
|
-
return /* @__PURE__ */
|
|
2920
|
+
return /* @__PURE__ */ jsx42(
|
|
2726
2921
|
"div",
|
|
2727
2922
|
{
|
|
2728
2923
|
className: "yr3Slide",
|
|
2729
2924
|
style: composeStyles(),
|
|
2730
2925
|
"data-testid": "yr3Slide",
|
|
2731
|
-
children: /* @__PURE__ */
|
|
2926
|
+
children: /* @__PURE__ */ jsx42(
|
|
2732
2927
|
"div",
|
|
2733
2928
|
{
|
|
2734
2929
|
className: classNameContent,
|
|
2735
2930
|
style: composeStyles(uiStyleContent, properties?.slide?.style || {}),
|
|
2736
2931
|
"data-testid": "yr3Slide-content",
|
|
2737
|
-
children: /* @__PURE__ */
|
|
2932
|
+
children: /* @__PURE__ */ jsx42(Box, { ...properties?.box, "data-testid": "yr3Slide-box", children })
|
|
2738
2933
|
}
|
|
2739
2934
|
)
|
|
2740
2935
|
}
|
|
@@ -2742,7 +2937,7 @@ var Slide = ({
|
|
|
2742
2937
|
};
|
|
2743
2938
|
|
|
2744
2939
|
// src/components/Switch/Switch.tsx
|
|
2745
|
-
import * as
|
|
2940
|
+
import * as React22 from "react";
|
|
2746
2941
|
|
|
2747
2942
|
// src/components/Switch/switch.variants.ts
|
|
2748
2943
|
var switchVariants = createVariants({
|
|
@@ -2779,7 +2974,7 @@ var switchVariants = createVariants({
|
|
|
2779
2974
|
});
|
|
2780
2975
|
|
|
2781
2976
|
// src/components/Switch/Switch.tsx
|
|
2782
|
-
import { jsx as
|
|
2977
|
+
import { jsx as jsx43, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2783
2978
|
var Switch = ({
|
|
2784
2979
|
checked,
|
|
2785
2980
|
defaultChecked,
|
|
@@ -2791,7 +2986,7 @@ var Switch = ({
|
|
|
2791
2986
|
placement = "end",
|
|
2792
2987
|
propsComponent
|
|
2793
2988
|
}) => {
|
|
2794
|
-
const [internal, setInternal] =
|
|
2989
|
+
const [internal, setInternal] = React22.useState(defaultChecked || false);
|
|
2795
2990
|
const classname = switchVariants({ colors: color, size, disabled: !!disabled, checked: checked ?? internal, placement });
|
|
2796
2991
|
const isControlled = checked !== void 0;
|
|
2797
2992
|
const value = isControlled ? checked : internal;
|
|
@@ -2799,13 +2994,13 @@ var Switch = ({
|
|
|
2799
2994
|
if (!isControlled) setInternal(e.target.checked);
|
|
2800
2995
|
onChange?.(e, e.target.checked);
|
|
2801
2996
|
};
|
|
2802
|
-
return /* @__PURE__ */
|
|
2997
|
+
return /* @__PURE__ */ jsxs17(
|
|
2803
2998
|
"label",
|
|
2804
2999
|
{
|
|
2805
3000
|
className: classname,
|
|
2806
3001
|
"data-testid": "yr3Switch",
|
|
2807
3002
|
children: [
|
|
2808
|
-
/* @__PURE__ */
|
|
3003
|
+
/* @__PURE__ */ jsx43(
|
|
2809
3004
|
"input",
|
|
2810
3005
|
{
|
|
2811
3006
|
type: "checkbox",
|
|
@@ -2814,8 +3009,8 @@ var Switch = ({
|
|
|
2814
3009
|
disabled
|
|
2815
3010
|
}
|
|
2816
3011
|
),
|
|
2817
|
-
/* @__PURE__ */
|
|
2818
|
-
/* @__PURE__ */
|
|
3012
|
+
/* @__PURE__ */ jsx43("span", { className: "yr3Switch--track", children: /* @__PURE__ */ jsx43("span", { className: "yr3Switch--thumb" }) }),
|
|
3013
|
+
/* @__PURE__ */ jsx43(
|
|
2819
3014
|
"span",
|
|
2820
3015
|
{
|
|
2821
3016
|
className: "yr3Switch--label",
|
|
@@ -2829,30 +3024,15 @@ var Switch = ({
|
|
|
2829
3024
|
);
|
|
2830
3025
|
};
|
|
2831
3026
|
|
|
2832
|
-
// src/Icons/IconSearch.tsx
|
|
2833
|
-
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
2834
|
-
var IconSearch = (props) => {
|
|
2835
|
-
return /* @__PURE__ */ jsx39("svg", { width: props.width || "64px", height: props.height || "64px", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx39(
|
|
2836
|
-
"path",
|
|
2837
|
-
{
|
|
2838
|
-
d: "M15.7955 15.8111L21 21M18 10.5C18 14.6421 14.6421 18 10.5 18C6.35786 18 3 14.6421 3 10.5C3 6.35786 6.35786 3 10.5 3C14.6421 3 18 6.35786 18 10.5Z",
|
|
2839
|
-
stroke: props.stroke || "#fff",
|
|
2840
|
-
strokeWidth: props.strokeWidth || "1.5",
|
|
2841
|
-
strokeLinecap: "round",
|
|
2842
|
-
strokeLinejoin: "round"
|
|
2843
|
-
}
|
|
2844
|
-
) });
|
|
2845
|
-
};
|
|
2846
|
-
|
|
2847
3027
|
// src/theme/ThemeProvider.tsx
|
|
2848
|
-
import * as
|
|
3028
|
+
import * as React24 from "react";
|
|
2849
3029
|
|
|
2850
3030
|
// src/theme/notistackContext.tsx
|
|
2851
|
-
import * as
|
|
2852
|
-
import { jsx as
|
|
2853
|
-
var NotistackContext =
|
|
3031
|
+
import * as React23 from "react";
|
|
3032
|
+
import { jsx as jsx44, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
3033
|
+
var NotistackContext = React23.createContext(null);
|
|
2854
3034
|
var NotistackProvider = ({ children }) => {
|
|
2855
|
-
const [snacks, setSnacks] =
|
|
3035
|
+
const [snacks, setSnacks] = React23.useState([]);
|
|
2856
3036
|
const notistack = (snack) => {
|
|
2857
3037
|
const id = Date.now();
|
|
2858
3038
|
setSnacks((prev) => [...prev, { ...snack, id, exiting: false }]);
|
|
@@ -2867,13 +3047,13 @@ var NotistackProvider = ({ children }) => {
|
|
|
2867
3047
|
setSnacks((prev) => prev.filter((s) => s.id !== id));
|
|
2868
3048
|
}, duration + exitDuration);
|
|
2869
3049
|
};
|
|
2870
|
-
return /* @__PURE__ */
|
|
3050
|
+
return /* @__PURE__ */ jsxs18(NotistackContext.Provider, { value: { notistack }, children: [
|
|
2871
3051
|
children,
|
|
2872
|
-
/* @__PURE__ */
|
|
3052
|
+
/* @__PURE__ */ jsx44("div", { className: "yr3NotistackContainer", children: snacks.map((snack) => /* @__PURE__ */ jsx44(Notistack, { ...snack }, snack.id)) })
|
|
2873
3053
|
] });
|
|
2874
3054
|
};
|
|
2875
3055
|
var useNotistack = () => {
|
|
2876
|
-
const ctx =
|
|
3056
|
+
const ctx = React23.useContext(NotistackContext);
|
|
2877
3057
|
if (!ctx) {
|
|
2878
3058
|
throw new Error("NotistackProvider missing");
|
|
2879
3059
|
}
|
|
@@ -2881,15 +3061,15 @@ var useNotistack = () => {
|
|
|
2881
3061
|
};
|
|
2882
3062
|
|
|
2883
3063
|
// src/theme/ThemeProvider.tsx
|
|
2884
|
-
import { jsx as
|
|
2885
|
-
var ThemeContext =
|
|
3064
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
3065
|
+
var ThemeContext = React24.createContext(null);
|
|
2886
3066
|
var ThemeProvider = ({ theme, children }) => {
|
|
2887
|
-
|
|
3067
|
+
React24.useEffect(() => {
|
|
2888
3068
|
applyTheme(theme);
|
|
2889
3069
|
}, [theme]);
|
|
2890
|
-
return /* @__PURE__ */
|
|
3070
|
+
return /* @__PURE__ */ jsx45(ThemeContext.Provider, { value: theme, children: /* @__PURE__ */ jsx45(BackdropProvider, { children: /* @__PURE__ */ jsx45(NotistackProvider, { children }) }) });
|
|
2891
3071
|
};
|
|
2892
|
-
var useTheme = () =>
|
|
3072
|
+
var useTheme = () => React24.useContext(ThemeContext);
|
|
2893
3073
|
|
|
2894
3074
|
// src/theme/tokens.ts
|
|
2895
3075
|
var baseTokens = {
|
|
@@ -2910,15 +3090,15 @@ var baseTokens = {
|
|
|
2910
3090
|
};
|
|
2911
3091
|
|
|
2912
3092
|
// src/theme/useMediaQuery.tsx
|
|
2913
|
-
import * as
|
|
3093
|
+
import * as React25 from "react";
|
|
2914
3094
|
function useMediaQuery(query) {
|
|
2915
3095
|
const theme = useTheme();
|
|
2916
3096
|
const computedQuery = typeof query === "function" ? query(theme) : query;
|
|
2917
|
-
const [matches, setMatches] =
|
|
3097
|
+
const [matches, setMatches] = React25.useState(() => {
|
|
2918
3098
|
if (typeof window === "undefined") return false;
|
|
2919
3099
|
return window.matchMedia(computedQuery).matches;
|
|
2920
3100
|
});
|
|
2921
|
-
|
|
3101
|
+
React25.useEffect(() => {
|
|
2922
3102
|
if (typeof window === "undefined") return;
|
|
2923
3103
|
const media = window.matchMedia(computedQuery);
|
|
2924
3104
|
const listener = () => setMatches(media.matches);
|
|
@@ -2952,7 +3132,7 @@ var usePlaces = ({ input, language, apiKey, provider }) => {
|
|
|
2952
3132
|
};
|
|
2953
3133
|
|
|
2954
3134
|
// src/hooks/useBreakpoint.ts
|
|
2955
|
-
import * as
|
|
3135
|
+
import * as React26 from "react";
|
|
2956
3136
|
var breakUp = (bp) => `(min-width: ${bp}px)`;
|
|
2957
3137
|
var breakDown = (bp) => `(max-width: ${bp}px)`;
|
|
2958
3138
|
function useBreakpoint(queryInput) {
|
|
@@ -2962,8 +3142,8 @@ function useBreakpoint(queryInput) {
|
|
|
2962
3142
|
if (typeof window === "undefined") return false;
|
|
2963
3143
|
return window.matchMedia(query).matches;
|
|
2964
3144
|
};
|
|
2965
|
-
const [matches, setMatches] =
|
|
2966
|
-
|
|
3145
|
+
const [matches, setMatches] = React26.useState(getMatch);
|
|
3146
|
+
React26.useEffect(() => {
|
|
2967
3147
|
if (typeof window === "undefined") return;
|
|
2968
3148
|
const media = window.matchMedia(query);
|
|
2969
3149
|
const listener = (e) => {
|
|
@@ -3008,8 +3188,10 @@ export {
|
|
|
3008
3188
|
Flex,
|
|
3009
3189
|
Grid,
|
|
3010
3190
|
Group,
|
|
3191
|
+
IconCalendar,
|
|
3011
3192
|
IconClose,
|
|
3012
3193
|
IconDown,
|
|
3194
|
+
IconLeft,
|
|
3013
3195
|
IconSearch,
|
|
3014
3196
|
Image,
|
|
3015
3197
|
ImageDropzone,
|
|
@@ -3019,6 +3201,7 @@ export {
|
|
|
3019
3201
|
Loader,
|
|
3020
3202
|
Modal,
|
|
3021
3203
|
ModalContainer,
|
|
3204
|
+
MonthSelector,
|
|
3022
3205
|
Notistack,
|
|
3023
3206
|
NotistackContext,
|
|
3024
3207
|
NotistackProvider,
|
|
@@ -3027,6 +3210,7 @@ export {
|
|
|
3027
3210
|
PlacesAutocomplete,
|
|
3028
3211
|
Radio,
|
|
3029
3212
|
Select,
|
|
3213
|
+
Selector,
|
|
3030
3214
|
Slide,
|
|
3031
3215
|
Switch,
|
|
3032
3216
|
Text,
|
|
@@ -3051,6 +3235,7 @@ export {
|
|
|
3051
3235
|
getCountryCodePhone,
|
|
3052
3236
|
getDialPhone,
|
|
3053
3237
|
getMonthCalendar,
|
|
3238
|
+
getMonthCalendarProps,
|
|
3054
3239
|
getNumberPhone,
|
|
3055
3240
|
hexToRgb,
|
|
3056
3241
|
initTheme,
|