@yr3/ui 1.0.16 → 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/components/Group/group.css +22 -8
- package/dist/components/Group/group.css.map +1 -1
- package/dist/index.cjs +536 -319
- package/dist/index.d.cts +100 -49
- package/dist/index.d.ts +100 -49
- package/dist/index.js +531 -319
- package/dist/styles/index.css +138 -8
- 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,24 +1895,25 @@ var groupVariants = createVariants({
|
|
|
1543
1895
|
});
|
|
1544
1896
|
|
|
1545
1897
|
// src/components/Group/Group.tsx
|
|
1546
|
-
import { jsx as
|
|
1547
|
-
var initialComponents = {
|
|
1898
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
1899
|
+
var initialComponents = (color) => ({
|
|
1548
1900
|
group: {
|
|
1549
1901
|
ui: {},
|
|
1550
1902
|
style: {}
|
|
1551
1903
|
},
|
|
1552
1904
|
item: {
|
|
1905
|
+
variant: "text",
|
|
1553
1906
|
ui: {},
|
|
1554
1907
|
style: {},
|
|
1555
1908
|
text: {
|
|
1556
1909
|
variant: "caption",
|
|
1557
|
-
color
|
|
1910
|
+
color,
|
|
1558
1911
|
as: "span",
|
|
1559
1912
|
ui: {},
|
|
1560
1913
|
style: {}
|
|
1561
1914
|
}
|
|
1562
1915
|
}
|
|
1563
|
-
};
|
|
1916
|
+
});
|
|
1564
1917
|
var Group = ({
|
|
1565
1918
|
options,
|
|
1566
1919
|
value,
|
|
@@ -1571,10 +1924,13 @@ var Group = ({
|
|
|
1571
1924
|
exclude = false,
|
|
1572
1925
|
propsComponent
|
|
1573
1926
|
}) => {
|
|
1574
|
-
const properties = mergeDeep(
|
|
1575
|
-
|
|
1927
|
+
const properties = mergeDeep(
|
|
1928
|
+
initialComponents(type === "rounded" ? "text" : color),
|
|
1929
|
+
propsComponent || {}
|
|
1930
|
+
);
|
|
1931
|
+
const [internalValue, setInternalValue] = React12.useState(null);
|
|
1576
1932
|
const isControlled = value !== void 0;
|
|
1577
|
-
|
|
1933
|
+
React12.useEffect(() => {
|
|
1578
1934
|
if (isControlled) {
|
|
1579
1935
|
setInternalValue(value);
|
|
1580
1936
|
}
|
|
@@ -1585,7 +1941,12 @@ var Group = ({
|
|
|
1585
1941
|
active: !exclude ? Array.isArray(value) ? value.includes(item?.value) : internalValue === item.value : false,
|
|
1586
1942
|
exclude: exclude && Array.isArray(value) ? !value.includes(item?.value) : ""
|
|
1587
1943
|
});
|
|
1588
|
-
const mappingStyle =
|
|
1944
|
+
const mappingStyle = React12.useMemo(() => {
|
|
1945
|
+
if (variant !== "filled") return options.map((opt, index) => ({
|
|
1946
|
+
...opt,
|
|
1947
|
+
index,
|
|
1948
|
+
ui: {}
|
|
1949
|
+
}));
|
|
1589
1950
|
if (!exclude) {
|
|
1590
1951
|
const checked = options.filter((opt) => Array.isArray(value) ? value.includes(opt.value) : internalValue === opt.value);
|
|
1591
1952
|
return checked.map((opt, index) => ({
|
|
@@ -1610,21 +1971,39 @@ var Group = ({
|
|
|
1610
1971
|
borderBottomRightRadius: index === diference.length - 1 ? "var(--group-border-radius, 0px)" : 0
|
|
1611
1972
|
}
|
|
1612
1973
|
}));
|
|
1613
|
-
}, [exclude, value, options]);
|
|
1614
|
-
return /* @__PURE__ */
|
|
1974
|
+
}, [exclude, value, options, type]);
|
|
1975
|
+
return /* @__PURE__ */ jsx28(
|
|
1615
1976
|
"div",
|
|
1616
1977
|
{
|
|
1617
1978
|
className: groupVariants({ variant, color, type }),
|
|
1618
1979
|
"data-testid": "yr3Group",
|
|
1619
1980
|
style: composeStyles(properties.group?.ui, properties.group?.style),
|
|
1620
|
-
children: options.map((opt, index) => /* @__PURE__ */
|
|
1981
|
+
children: options.map((opt, index) => /* @__PURE__ */ jsx28(
|
|
1621
1982
|
"div",
|
|
1622
1983
|
{
|
|
1623
1984
|
"data-testid": "yr3Group-item",
|
|
1624
1985
|
className: clasess(opt),
|
|
1625
1986
|
onClick: () => (!opt.disabled && !exclude || exclude && mappingStyle?.find((e) => e.value === opt.value)?.index === 0) && onChange?.(opt.value),
|
|
1626
|
-
style: composeStyles(
|
|
1627
|
-
|
|
1987
|
+
style: composeStyles(
|
|
1988
|
+
{
|
|
1989
|
+
...properties.item?.ui,
|
|
1990
|
+
...opt?.ui,
|
|
1991
|
+
...mappingStyle?.find((o) => o.value === opt.value)?.ui
|
|
1992
|
+
},
|
|
1993
|
+
{
|
|
1994
|
+
...properties.item?.style,
|
|
1995
|
+
...opt?.style,
|
|
1996
|
+
...mappingStyle?.find((o) => o.value === opt.value)?.style
|
|
1997
|
+
}
|
|
1998
|
+
),
|
|
1999
|
+
children: /* @__PURE__ */ jsx28(
|
|
2000
|
+
Text,
|
|
2001
|
+
{
|
|
2002
|
+
...properties.item?.text,
|
|
2003
|
+
color: opt.value === value ? opt?.active : properties.item?.text?.color || color,
|
|
2004
|
+
children: opt.label
|
|
2005
|
+
}
|
|
2006
|
+
)
|
|
1628
2007
|
},
|
|
1629
2008
|
opt.value
|
|
1630
2009
|
))
|
|
@@ -1633,14 +2012,14 @@ var Group = ({
|
|
|
1633
2012
|
};
|
|
1634
2013
|
|
|
1635
2014
|
// src/components/Image/Image.tsx
|
|
1636
|
-
import { jsx as
|
|
2015
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
1637
2016
|
var Image = ({
|
|
1638
2017
|
src,
|
|
1639
2018
|
alt = "",
|
|
1640
2019
|
ui,
|
|
1641
2020
|
style
|
|
1642
2021
|
}) => {
|
|
1643
|
-
return /* @__PURE__ */
|
|
2022
|
+
return /* @__PURE__ */ jsx29(
|
|
1644
2023
|
"img",
|
|
1645
2024
|
{
|
|
1646
2025
|
src,
|
|
@@ -1653,9 +2032,9 @@ var Image = ({
|
|
|
1653
2032
|
};
|
|
1654
2033
|
|
|
1655
2034
|
// src/components/ImageDropzone/ImageDropzone.tsx
|
|
1656
|
-
import * as
|
|
1657
|
-
import { jsx as
|
|
1658
|
-
var
|
|
2035
|
+
import * as React13 from "react";
|
|
2036
|
+
import { jsx as jsx30, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2037
|
+
var initialPropsComponent4 = {
|
|
1659
2038
|
box: {},
|
|
1660
2039
|
text: {},
|
|
1661
2040
|
container: {},
|
|
@@ -1663,10 +2042,10 @@ var initialPropsComponent3 = {
|
|
|
1663
2042
|
content: {}
|
|
1664
2043
|
};
|
|
1665
2044
|
var ImageDropzone = ({ onChange, multiple, propsComponent, bordered, component, defaultImage, variant = "outlined" }) => {
|
|
1666
|
-
const properties = mergeDeep(
|
|
1667
|
-
const [dragging, setDragging] =
|
|
1668
|
-
const [files, setFiles] =
|
|
1669
|
-
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);
|
|
1670
2049
|
const handleFiles = (fileList) => {
|
|
1671
2050
|
if (!fileList) return;
|
|
1672
2051
|
const newFiles = Array.from(fileList);
|
|
@@ -1678,7 +2057,7 @@ var ImageDropzone = ({ onChange, multiple, propsComponent, bordered, component,
|
|
|
1678
2057
|
};
|
|
1679
2058
|
const classes = bem("yr3Dropzone");
|
|
1680
2059
|
const classComponent = classes(void 0, { "dragging": !!dragging, "bordered": !!bordered, variant });
|
|
1681
|
-
return /* @__PURE__ */
|
|
2060
|
+
return /* @__PURE__ */ jsx30(Box, { as: "div", position: "relative", content: "center", ...properties?.box, children: /* @__PURE__ */ jsxs7(
|
|
1682
2061
|
"div",
|
|
1683
2062
|
{
|
|
1684
2063
|
className: classComponent,
|
|
@@ -1695,7 +2074,7 @@ var ImageDropzone = ({ onChange, multiple, propsComponent, bordered, component,
|
|
|
1695
2074
|
onClick: () => inputRef.current?.click(),
|
|
1696
2075
|
style: composeStyles(properties?.container?.ui, properties?.container?.style),
|
|
1697
2076
|
children: [
|
|
1698
|
-
/* @__PURE__ */
|
|
2077
|
+
/* @__PURE__ */ jsx30(
|
|
1699
2078
|
"input",
|
|
1700
2079
|
{
|
|
1701
2080
|
ref: inputRef,
|
|
@@ -1706,166 +2085,18 @@ var ImageDropzone = ({ onChange, multiple, propsComponent, bordered, component,
|
|
|
1706
2085
|
onChange: (e) => handleFiles(e.target.files)
|
|
1707
2086
|
}
|
|
1708
2087
|
),
|
|
1709
|
-
isEmpty(files) && /* @__PURE__ */
|
|
1710
|
-
multiple && /* @__PURE__ */
|
|
1711
|
-
!multiple && /* @__PURE__ */
|
|
1712
|
-
!!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 }) }),
|
|
1713
2092
|
component
|
|
1714
2093
|
]
|
|
1715
2094
|
}
|
|
1716
2095
|
) });
|
|
1717
2096
|
};
|
|
1718
2097
|
|
|
1719
|
-
// src/components/Input/Input.tsx
|
|
1720
|
-
import * as React12 from "react";
|
|
1721
|
-
|
|
1722
|
-
// src/components/Label/Label.tsx
|
|
1723
|
-
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
1724
|
-
var Label = ({ text: text2, children, className, color = "primary", ui, style }) => {
|
|
1725
|
-
const classes = bem("yr3Label");
|
|
1726
|
-
const classComponent = classes(void 0, { color: `color-${color}` });
|
|
1727
|
-
const classnames = bemMerge(classComponent, className);
|
|
1728
|
-
return /* @__PURE__ */ jsx23(
|
|
1729
|
-
"span",
|
|
1730
|
-
{
|
|
1731
|
-
className: classnames,
|
|
1732
|
-
"data-testid": "yr3Label",
|
|
1733
|
-
style: composeStyles(ui, style),
|
|
1734
|
-
children: text2 ? text2 : children
|
|
1735
|
-
}
|
|
1736
|
-
);
|
|
1737
|
-
};
|
|
1738
|
-
|
|
1739
|
-
// src/components/Input/input.variants.ts
|
|
1740
|
-
var inputVariants = createVariants({
|
|
1741
|
-
base: "yr3Input",
|
|
1742
|
-
variants: {
|
|
1743
|
-
variant: {
|
|
1744
|
-
filled: "yr3Input--filled",
|
|
1745
|
-
outlined: "yr3Input--outlined",
|
|
1746
|
-
base: "yr3Input--base",
|
|
1747
|
-
lined: "yr3Input--lined"
|
|
1748
|
-
},
|
|
1749
|
-
color: {
|
|
1750
|
-
primary: "yr3Input--color-primary",
|
|
1751
|
-
secondary: "yr3Input--color-secondary",
|
|
1752
|
-
success: "yr3Input--color-success",
|
|
1753
|
-
text: "yr3Input--color-text",
|
|
1754
|
-
disabled: "yr3Input--color-disabled",
|
|
1755
|
-
background: "yr3Input--color-background",
|
|
1756
|
-
error: "yr3Input--color-error",
|
|
1757
|
-
warning: "yr3Input--color-warning",
|
|
1758
|
-
info: "yr3Input--color-info",
|
|
1759
|
-
common: "yr3Input--color-common"
|
|
1760
|
-
},
|
|
1761
|
-
size: {
|
|
1762
|
-
auto: "yr3Input--size-auto",
|
|
1763
|
-
full: "yr3Input--size-full"
|
|
1764
|
-
},
|
|
1765
|
-
rounded: {
|
|
1766
|
-
true: "yr3Input--rounded"
|
|
1767
|
-
},
|
|
1768
|
-
disabled: {
|
|
1769
|
-
true: "yr3Input--disabled"
|
|
1770
|
-
},
|
|
1771
|
-
animated: {
|
|
1772
|
-
true: "yr3Input--animated"
|
|
1773
|
-
},
|
|
1774
|
-
label: {
|
|
1775
|
-
true: "yr3Input--label"
|
|
1776
|
-
}
|
|
1777
|
-
}
|
|
1778
|
-
});
|
|
1779
|
-
|
|
1780
|
-
// src/components/Input/Input.tsx
|
|
1781
|
-
import { jsx as jsx24, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1782
|
-
var initiaPropsComponent = {
|
|
1783
|
-
label: {
|
|
1784
|
-
display: true,
|
|
1785
|
-
ui: {},
|
|
1786
|
-
style: {}
|
|
1787
|
-
},
|
|
1788
|
-
control: {}
|
|
1789
|
-
};
|
|
1790
|
-
var Input = React12.forwardRef(
|
|
1791
|
-
({
|
|
1792
|
-
label,
|
|
1793
|
-
value,
|
|
1794
|
-
defaultValue,
|
|
1795
|
-
onChange,
|
|
1796
|
-
variant = "outlined",
|
|
1797
|
-
error = "ce un errore",
|
|
1798
|
-
separatorCurrency = ",",
|
|
1799
|
-
ui,
|
|
1800
|
-
style,
|
|
1801
|
-
propsComponent = initiaPropsComponent,
|
|
1802
|
-
pattern = "text",
|
|
1803
|
-
color = "primary",
|
|
1804
|
-
size = "auto",
|
|
1805
|
-
...props
|
|
1806
|
-
}, ref) => {
|
|
1807
|
-
const [focused, setFocused] = React12.useState(false);
|
|
1808
|
-
const [internalValue, setInternalValue] = React12.useState(defaultValue);
|
|
1809
|
-
const isControlled = value !== void 0;
|
|
1810
|
-
const currentValue = isControlled ? value : internalValue;
|
|
1811
|
-
const isActive = focused || !!currentValue;
|
|
1812
|
-
const checkPattern = (type, value2) => {
|
|
1813
|
-
switch (type) {
|
|
1814
|
-
case "email":
|
|
1815
|
-
return /^[\w.-]+@[\w.-]+\.\w{2,}$/.test(value2);
|
|
1816
|
-
case "phone":
|
|
1817
|
-
return /^\d{10}$/.test(value2);
|
|
1818
|
-
case "number":
|
|
1819
|
-
return /^\d+$/.test(value2);
|
|
1820
|
-
case "currency":
|
|
1821
|
-
if (separatorCurrency === ",") return /^\d+(\,\d{0,2})?$/.test(value2);
|
|
1822
|
-
if (separatorCurrency === ".") return /^\d+(\.\d{0,2})?$/.test(value2);
|
|
1823
|
-
default:
|
|
1824
|
-
return true;
|
|
1825
|
-
}
|
|
1826
|
-
};
|
|
1827
|
-
const handleChange = (e) => {
|
|
1828
|
-
const newValue = e.target.value;
|
|
1829
|
-
if (newValue && !checkPattern(pattern, newValue)) return;
|
|
1830
|
-
if (!isControlled) {
|
|
1831
|
-
setInternalValue(newValue);
|
|
1832
|
-
}
|
|
1833
|
-
onChange?.(e, newValue);
|
|
1834
|
-
};
|
|
1835
|
-
const classes = inputVariants({ color, label: propsComponent?.label?.display });
|
|
1836
|
-
return /* @__PURE__ */ jsxs6(Control, { variant, color, label: propsComponent?.label?.display, ...propsComponent.control, children: [
|
|
1837
|
-
propsComponent?.label?.display && /* @__PURE__ */ jsx24(
|
|
1838
|
-
Label,
|
|
1839
|
-
{
|
|
1840
|
-
text: label || "",
|
|
1841
|
-
className: !!isActive ? "yr3Input--active" : "",
|
|
1842
|
-
color,
|
|
1843
|
-
...propsComponent.label
|
|
1844
|
-
}
|
|
1845
|
-
),
|
|
1846
|
-
/* @__PURE__ */ jsx24(
|
|
1847
|
-
"input",
|
|
1848
|
-
{
|
|
1849
|
-
ref,
|
|
1850
|
-
value: currentValue,
|
|
1851
|
-
inputMode: pattern === "currency" ? "numeric" : pattern === "phone" ? "tel" : void 0,
|
|
1852
|
-
autoComplete: "off",
|
|
1853
|
-
type: "text",
|
|
1854
|
-
onChange: handleChange,
|
|
1855
|
-
onFocus: () => setFocused(true),
|
|
1856
|
-
onBlur: () => setFocused(false),
|
|
1857
|
-
className: classes,
|
|
1858
|
-
style: composeStyles(ui, style),
|
|
1859
|
-
...props,
|
|
1860
|
-
"data-testid": "yr3Input"
|
|
1861
|
-
}
|
|
1862
|
-
)
|
|
1863
|
-
] });
|
|
1864
|
-
}
|
|
1865
|
-
);
|
|
1866
|
-
|
|
1867
2098
|
// src/components/InputArea/InputArea.tsx
|
|
1868
|
-
import * as
|
|
2099
|
+
import * as React14 from "react";
|
|
1869
2100
|
|
|
1870
2101
|
// src/components/InputArea/inputAreaVariants.ts
|
|
1871
2102
|
var inputAreaVariants = createVariants({
|
|
@@ -1906,7 +2137,7 @@ var inputAreaVariants = createVariants({
|
|
|
1906
2137
|
});
|
|
1907
2138
|
|
|
1908
2139
|
// src/components/InputArea/InputArea.tsx
|
|
1909
|
-
import { jsx as
|
|
2140
|
+
import { jsx as jsx31, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1910
2141
|
var initiaPropsComponent2 = {
|
|
1911
2142
|
label: {
|
|
1912
2143
|
display: true,
|
|
@@ -1931,8 +2162,8 @@ var InputArea = ({
|
|
|
1931
2162
|
rounded = false,
|
|
1932
2163
|
propsComponent = initiaPropsComponent2
|
|
1933
2164
|
}) => {
|
|
1934
|
-
const ref =
|
|
1935
|
-
const [internalValue, setInternalValue] =
|
|
2165
|
+
const ref = React14.useRef(null);
|
|
2166
|
+
const [internalValue, setInternalValue] = React14.useState(defaultValue);
|
|
1936
2167
|
const isControlled = value !== void 0;
|
|
1937
2168
|
const currentValue = isControlled ? value : internalValue;
|
|
1938
2169
|
const handleChange = (e) => {
|
|
@@ -1949,8 +2180,8 @@ var InputArea = ({
|
|
|
1949
2180
|
el.style.resize = resize;
|
|
1950
2181
|
}
|
|
1951
2182
|
const classes = inputAreaVariants({ variant, color, rounded });
|
|
1952
|
-
return /* @__PURE__ */
|
|
1953
|
-
propsComponent?.label?.display && /* @__PURE__ */
|
|
2183
|
+
return /* @__PURE__ */ jsxs8("div", { style: { position: "relative" }, children: [
|
|
2184
|
+
propsComponent?.label?.display && /* @__PURE__ */ jsx31(
|
|
1954
2185
|
Label,
|
|
1955
2186
|
{
|
|
1956
2187
|
text: label || "",
|
|
@@ -1958,7 +2189,7 @@ var InputArea = ({
|
|
|
1958
2189
|
...propsComponent.label
|
|
1959
2190
|
}
|
|
1960
2191
|
),
|
|
1961
|
-
/* @__PURE__ */
|
|
2192
|
+
/* @__PURE__ */ jsx31(
|
|
1962
2193
|
"textarea",
|
|
1963
2194
|
{
|
|
1964
2195
|
className: classes,
|
|
@@ -1970,7 +2201,7 @@ var InputArea = ({
|
|
|
1970
2201
|
"data-testid": "yr3InputArea"
|
|
1971
2202
|
}
|
|
1972
2203
|
),
|
|
1973
|
-
/* @__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 : "" })
|
|
1974
2205
|
] });
|
|
1975
2206
|
};
|
|
1976
2207
|
|
|
@@ -2004,8 +2235,8 @@ var loaderSpinnerVariants = createVariants({
|
|
|
2004
2235
|
});
|
|
2005
2236
|
|
|
2006
2237
|
// src/components/Loader/Loader.tsx
|
|
2007
|
-
import * as
|
|
2008
|
-
import { jsx as
|
|
2238
|
+
import * as React15 from "react";
|
|
2239
|
+
import { jsx as jsx32, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2009
2240
|
var initialComponents2 = {
|
|
2010
2241
|
loader: {
|
|
2011
2242
|
ui: {},
|
|
@@ -2033,29 +2264,29 @@ var Loader = ({ component, loading = false, propsComponent }) => {
|
|
|
2033
2264
|
size: properties?.spinner?.size
|
|
2034
2265
|
});
|
|
2035
2266
|
if (!loading) return null;
|
|
2036
|
-
return /* @__PURE__ */
|
|
2037
|
-
/* @__PURE__ */
|
|
2038
|
-
/* @__PURE__ */
|
|
2039
|
-
/* @__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", {})
|
|
2040
2271
|
] }) }) }) });
|
|
2041
2272
|
};
|
|
2042
2273
|
|
|
2043
2274
|
// src/components/Modal/Modal.tsx
|
|
2044
|
-
import * as
|
|
2275
|
+
import * as React16 from "react";
|
|
2045
2276
|
|
|
2046
2277
|
// src/components/Modal/ModalContainer.tsx
|
|
2047
|
-
import { jsx as
|
|
2278
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
2048
2279
|
var ModalContainer = ({ children, size = "sm", ui, style }) => {
|
|
2049
2280
|
const classes = bem("yr3Modal-container");
|
|
2050
2281
|
const classComponent = classes(void 0, { [`${size}`]: !!size });
|
|
2051
|
-
return /* @__PURE__ */
|
|
2282
|
+
return /* @__PURE__ */ jsx33("div", { className: classComponent, style: composeStyles(ui, style), "data-testid": "yr3Modal-container", children });
|
|
2052
2283
|
};
|
|
2053
2284
|
|
|
2054
2285
|
// src/components/Modal/Modal.tsx
|
|
2055
|
-
import { jsx as
|
|
2286
|
+
import { jsx as jsx34, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2056
2287
|
var Modal = ({ open, onClose, children, propsComponent }) => {
|
|
2057
2288
|
const { show, hide } = useBackdrop();
|
|
2058
|
-
|
|
2289
|
+
React16.useEffect(() => {
|
|
2059
2290
|
if (open) {
|
|
2060
2291
|
show("modal");
|
|
2061
2292
|
} else {
|
|
@@ -2064,9 +2295,9 @@ var Modal = ({ open, onClose, children, propsComponent }) => {
|
|
|
2064
2295
|
}, [open]);
|
|
2065
2296
|
const classes = bem("yr3Modal");
|
|
2066
2297
|
const classComponent = classes(void 0, { "open": !!open });
|
|
2067
|
-
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: [
|
|
2068
2299
|
children,
|
|
2069
|
-
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" })
|
|
2070
2301
|
] }) }) });
|
|
2071
2302
|
};
|
|
2072
2303
|
|
|
@@ -2106,15 +2337,15 @@ var notistackVariants = createVariants({
|
|
|
2106
2337
|
});
|
|
2107
2338
|
|
|
2108
2339
|
// src/components/Notistack/Notistack.tsx
|
|
2109
|
-
import { jsx as
|
|
2340
|
+
import { jsx as jsx35, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2110
2341
|
var Notistack = ({ message, duration = 3e3, variant = "info", color, propsComponent, anchor, exiting = false }) => {
|
|
2111
2342
|
const classes = notistackVariants({ type: variant, color, exiting, direction: `${anchor?.vertical || "bottom"}-${anchor?.horizontal || "right"}` });
|
|
2112
2343
|
const containerStyle = composeStyles(propsComponent?.container?.ui, propsComponent?.container?.style);
|
|
2113
2344
|
const notistackStyle = composeStyles(propsComponent?.notistack?.ui, propsComponent?.notistack?.style);
|
|
2114
2345
|
const progressStyle = composeStyles(propsComponent?.progress?.ui, propsComponent?.progress?.style);
|
|
2115
|
-
return /* @__PURE__ */
|
|
2116
|
-
/* @__PURE__ */
|
|
2117
|
-
/* @__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(
|
|
2118
2349
|
"div",
|
|
2119
2350
|
{
|
|
2120
2351
|
className: "yr3Notistack--progress",
|
|
@@ -2149,7 +2380,7 @@ var pendingVariants = createVariants({
|
|
|
2149
2380
|
});
|
|
2150
2381
|
|
|
2151
2382
|
// src/components/Pending/Pending.tsx
|
|
2152
|
-
import { jsx as
|
|
2383
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
2153
2384
|
var Pending = ({
|
|
2154
2385
|
variant,
|
|
2155
2386
|
width,
|
|
@@ -2162,7 +2393,7 @@ var Pending = ({
|
|
|
2162
2393
|
const widthStyle = variant === "circle" ? size : width;
|
|
2163
2394
|
const heightStyle = variant === "circle" ? size : height;
|
|
2164
2395
|
const uiStylePending = uiStyle({ width: widthStyle, height: heightStyle, ...ui });
|
|
2165
|
-
return /* @__PURE__ */
|
|
2396
|
+
return /* @__PURE__ */ jsx36(
|
|
2166
2397
|
"div",
|
|
2167
2398
|
{
|
|
2168
2399
|
className: pendingVariants({ variant, color }),
|
|
@@ -2173,19 +2404,11 @@ var Pending = ({
|
|
|
2173
2404
|
};
|
|
2174
2405
|
|
|
2175
2406
|
// src/components/Phone/Phone.tsx
|
|
2176
|
-
import * as
|
|
2177
|
-
|
|
2178
|
-
// src/components/Selector/Selector.tsx
|
|
2179
|
-
import * as React16 from "react";
|
|
2180
|
-
|
|
2181
|
-
// src/Icons/IconDown.tsx
|
|
2182
|
-
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
2183
|
-
var IconDown = (props) => {
|
|
2184
|
-
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" }) });
|
|
2185
|
-
};
|
|
2407
|
+
import * as React18 from "react";
|
|
2186
2408
|
|
|
2187
2409
|
// src/components/Selector/Selector.tsx
|
|
2188
|
-
import
|
|
2410
|
+
import * as React17 from "react";
|
|
2411
|
+
import { jsx as jsx37, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2189
2412
|
var initalPropsComponent2 = {
|
|
2190
2413
|
text: {
|
|
2191
2414
|
variant: "caption",
|
|
@@ -2198,16 +2421,16 @@ var initalPropsComponent2 = {
|
|
|
2198
2421
|
}
|
|
2199
2422
|
};
|
|
2200
2423
|
var Selector = ({ ui, style, options, name, value, defaultValue, onChange, iconColor, icon, propsComponent = initalPropsComponent2 }) => {
|
|
2201
|
-
const [open, setOpen] =
|
|
2202
|
-
const [valueState, setValueState] =
|
|
2203
|
-
const ref =
|
|
2424
|
+
const [open, setOpen] = React17.useState(false);
|
|
2425
|
+
const [valueState, setValueState] = React17.useState(value || defaultValue || null);
|
|
2426
|
+
const ref = React17.useRef(null);
|
|
2204
2427
|
useClickAway(ref, () => setOpen(false));
|
|
2205
|
-
return /* @__PURE__ */
|
|
2206
|
-
/* @__PURE__ */
|
|
2207
|
-
/* @__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 }) }),
|
|
2208
2431
|
valueState
|
|
2209
2432
|
] }) }),
|
|
2210
|
-
open && /* @__PURE__ */
|
|
2433
|
+
open && /* @__PURE__ */ jsx37("div", { className: "yr3Selector--menu", style: composeStyles(propsComponent.menu?.ui, propsComponent.menu?.style), children: options.map((opt) => /* @__PURE__ */ jsx37(
|
|
2211
2434
|
"div",
|
|
2212
2435
|
{
|
|
2213
2436
|
className: "yr3Selector--option",
|
|
@@ -2228,16 +2451,15 @@ var Selector = ({ ui, style, options, name, value, defaultValue, onChange, iconC
|
|
|
2228
2451
|
};
|
|
2229
2452
|
onChange?.(event, opt.value);
|
|
2230
2453
|
},
|
|
2231
|
-
children: /* @__PURE__ */
|
|
2454
|
+
children: /* @__PURE__ */ jsx37(Text, { ...propsComponent?.text, children: propsComponent?.text?.children || opt.label })
|
|
2232
2455
|
},
|
|
2233
2456
|
opt.value
|
|
2234
2457
|
)) })
|
|
2235
2458
|
] });
|
|
2236
2459
|
};
|
|
2237
|
-
var Selector_default = Selector;
|
|
2238
2460
|
|
|
2239
2461
|
// src/components/Phone/Phone.tsx
|
|
2240
|
-
import { jsx as
|
|
2462
|
+
import { jsx as jsx38, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2241
2463
|
var Phone = ({
|
|
2242
2464
|
name,
|
|
2243
2465
|
value,
|
|
@@ -2249,13 +2471,13 @@ var Phone = ({
|
|
|
2249
2471
|
}) => {
|
|
2250
2472
|
const isControlled = value !== void 0;
|
|
2251
2473
|
const initial = value || defaultValue || "";
|
|
2252
|
-
const [prefix, setPrefix] =
|
|
2474
|
+
const [prefix, setPrefix] = React18.useState(
|
|
2253
2475
|
getDialPhone(initial, countries) || countries[0].dial
|
|
2254
2476
|
);
|
|
2255
|
-
const [number, setNumber] =
|
|
2477
|
+
const [number, setNumber] = React18.useState(
|
|
2256
2478
|
getNumberPhone(initial, prefix) || ""
|
|
2257
2479
|
);
|
|
2258
|
-
|
|
2480
|
+
React18.useEffect(() => {
|
|
2259
2481
|
if (isControlled && value) {
|
|
2260
2482
|
const dial = getDialPhone(value, countries);
|
|
2261
2483
|
const num = getNumberPhone(value, dial);
|
|
@@ -2274,11 +2496,11 @@ var Phone = ({
|
|
|
2274
2496
|
setPrefix(val);
|
|
2275
2497
|
onChange?.(null, `${val}${number}`);
|
|
2276
2498
|
};
|
|
2277
|
-
return /* @__PURE__ */
|
|
2278
|
-
/* @__PURE__ */
|
|
2279
|
-
/* @__PURE__ */
|
|
2280
|
-
/* @__PURE__ */
|
|
2281
|
-
|
|
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,
|
|
2282
2504
|
{
|
|
2283
2505
|
options: countries.map((c) => ({
|
|
2284
2506
|
value: c.dial,
|
|
@@ -2289,7 +2511,7 @@ var Phone = ({
|
|
|
2289
2511
|
...propsComponent?.selector
|
|
2290
2512
|
}
|
|
2291
2513
|
),
|
|
2292
|
-
/* @__PURE__ */
|
|
2514
|
+
/* @__PURE__ */ jsx38(
|
|
2293
2515
|
Divider,
|
|
2294
2516
|
{
|
|
2295
2517
|
orientation: "vertical",
|
|
@@ -2298,7 +2520,7 @@ var Phone = ({
|
|
|
2298
2520
|
...propsComponent?.divider
|
|
2299
2521
|
}
|
|
2300
2522
|
),
|
|
2301
|
-
/* @__PURE__ */
|
|
2523
|
+
/* @__PURE__ */ jsx38(
|
|
2302
2524
|
Input,
|
|
2303
2525
|
{
|
|
2304
2526
|
type: "number",
|
|
@@ -2314,9 +2536,9 @@ var Phone = ({
|
|
|
2314
2536
|
};
|
|
2315
2537
|
|
|
2316
2538
|
// src/components/Places/PlacesAutocomplete.tsx
|
|
2317
|
-
import * as
|
|
2539
|
+
import * as React19 from "react";
|
|
2318
2540
|
import { useAutocompletePlaces } from "@yr3/autocomplete-places";
|
|
2319
|
-
import { jsx as
|
|
2541
|
+
import { jsx as jsx39, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2320
2542
|
var initPropsComponent = {
|
|
2321
2543
|
label: {
|
|
2322
2544
|
display: true,
|
|
@@ -2356,9 +2578,9 @@ var PlacesAutocomplete = ({
|
|
|
2356
2578
|
keyApi,
|
|
2357
2579
|
propsComponent = initPropsComponent
|
|
2358
2580
|
}) => {
|
|
2359
|
-
const [value, setValue] =
|
|
2360
|
-
const inputRef =
|
|
2361
|
-
const [anchorEl, setAnchorEl] =
|
|
2581
|
+
const [value, setValue] = React19.useState(null);
|
|
2582
|
+
const inputRef = React19.useRef(null);
|
|
2583
|
+
const [anchorEl, setAnchorEl] = React19.useState(null);
|
|
2362
2584
|
const { suggestions, selectPlace } = useAutocompletePlaces({ input: value, apiKey: keyApi, language, provider });
|
|
2363
2585
|
const handleSelect = async (id) => {
|
|
2364
2586
|
const place = await selectPlace(id);
|
|
@@ -2378,12 +2600,12 @@ var PlacesAutocomplete = ({
|
|
|
2378
2600
|
setValue(place.address);
|
|
2379
2601
|
setAnchorEl(null);
|
|
2380
2602
|
};
|
|
2381
|
-
|
|
2603
|
+
React19.useEffect(() => {
|
|
2382
2604
|
if (defaultLocation) {
|
|
2383
2605
|
setValue(defaultLocation);
|
|
2384
2606
|
}
|
|
2385
2607
|
}, [defaultLocation]);
|
|
2386
|
-
|
|
2608
|
+
React19.useEffect(() => {
|
|
2387
2609
|
if (value === "") {
|
|
2388
2610
|
onSelect(null);
|
|
2389
2611
|
}
|
|
@@ -2393,13 +2615,13 @@ var PlacesAutocomplete = ({
|
|
|
2393
2615
|
setAnchorEl(e.target.value ? inputRef.current : null);
|
|
2394
2616
|
};
|
|
2395
2617
|
const open = suggestions.length > 0 && Boolean(anchorEl);
|
|
2396
|
-
|
|
2618
|
+
React19.useEffect(() => {
|
|
2397
2619
|
if (onChangeForm) {
|
|
2398
2620
|
onChangeForm({ target: { value } });
|
|
2399
2621
|
}
|
|
2400
2622
|
}, [onChangeForm]);
|
|
2401
|
-
return /* @__PURE__ */
|
|
2402
|
-
/* @__PURE__ */
|
|
2623
|
+
return /* @__PURE__ */ jsxs14(Control, { ...propsComponent?.control, children: [
|
|
2624
|
+
/* @__PURE__ */ jsx39(
|
|
2403
2625
|
Input,
|
|
2404
2626
|
{
|
|
2405
2627
|
ref: inputRef,
|
|
@@ -2413,7 +2635,7 @@ var PlacesAutocomplete = ({
|
|
|
2413
2635
|
},
|
|
2414
2636
|
"input-places"
|
|
2415
2637
|
),
|
|
2416
|
-
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)) }) })
|
|
2417
2639
|
] });
|
|
2418
2640
|
};
|
|
2419
2641
|
|
|
@@ -2441,7 +2663,7 @@ var radioVariant = createVariants({
|
|
|
2441
2663
|
});
|
|
2442
2664
|
|
|
2443
2665
|
// src/components/Radio/Radio.tsx
|
|
2444
|
-
import { jsx as
|
|
2666
|
+
import { jsx as jsx40, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2445
2667
|
var Radio = ({
|
|
2446
2668
|
checked,
|
|
2447
2669
|
value,
|
|
@@ -2457,8 +2679,8 @@ var Radio = ({
|
|
|
2457
2679
|
const bemClass = bem("yr3Radio");
|
|
2458
2680
|
const classes = bemClass(void 0, { [color]: `color-${color}` });
|
|
2459
2681
|
const variantClass = radioVariant({ variant });
|
|
2460
|
-
return /* @__PURE__ */
|
|
2461
|
-
/* @__PURE__ */
|
|
2682
|
+
return /* @__PURE__ */ jsxs15("label", { className: classes, "data-testid": "yr3Radio", style: composeStyles(propsComponent?.radio?.ui, propsComponent?.radio?.style), children: [
|
|
2683
|
+
/* @__PURE__ */ jsx40(
|
|
2462
2684
|
"input",
|
|
2463
2685
|
{
|
|
2464
2686
|
type: "radio",
|
|
@@ -2470,8 +2692,8 @@ var Radio = ({
|
|
|
2470
2692
|
}
|
|
2471
2693
|
),
|
|
2472
2694
|
iconChecked && checked ? iconChecked : !checked && iconUnchecked ? iconUnchecked : null,
|
|
2473
|
-
!iconChecked && !iconUnchecked && /* @__PURE__ */
|
|
2474
|
-
typeof label === "string" && /* @__PURE__ */
|
|
2695
|
+
!iconChecked && !iconUnchecked && /* @__PURE__ */ jsx40("span", { className: variantClass, "data-testid": "yr3Radio-dot" }),
|
|
2696
|
+
typeof label === "string" && /* @__PURE__ */ jsx40(
|
|
2475
2697
|
"span",
|
|
2476
2698
|
{
|
|
2477
2699
|
className: "yr3Radio--label",
|
|
@@ -2484,7 +2706,7 @@ var Radio = ({
|
|
|
2484
2706
|
};
|
|
2485
2707
|
|
|
2486
2708
|
// src/components/Select/Select.tsx
|
|
2487
|
-
import * as
|
|
2709
|
+
import * as React20 from "react";
|
|
2488
2710
|
|
|
2489
2711
|
// src/components/Select/select.variants.ts
|
|
2490
2712
|
var selectVariants = createVariants({
|
|
@@ -2544,7 +2766,7 @@ var selectIconVariants = createVariants({
|
|
|
2544
2766
|
});
|
|
2545
2767
|
|
|
2546
2768
|
// src/components/Select/Select.tsx
|
|
2547
|
-
import { jsx as
|
|
2769
|
+
import { jsx as jsx41, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2548
2770
|
var initiaPropsComponent3 = {
|
|
2549
2771
|
control: {
|
|
2550
2772
|
variant: "outlined",
|
|
@@ -2584,15 +2806,15 @@ var initiaPropsComponent3 = {
|
|
|
2584
2806
|
}
|
|
2585
2807
|
};
|
|
2586
2808
|
var Select = ({ label, options, name, value, defaultValue, onChange, propsComponent }) => {
|
|
2587
|
-
const [open, setOpen] =
|
|
2588
|
-
const [valueState, setValueState] =
|
|
2589
|
-
const ref =
|
|
2809
|
+
const [open, setOpen] = React20.useState(false);
|
|
2810
|
+
const [valueState, setValueState] = React20.useState(value || defaultValue || null);
|
|
2811
|
+
const ref = React20.useRef(null);
|
|
2590
2812
|
useClickAway(ref, () => setOpen(false));
|
|
2591
2813
|
const properties = mergeDeep(initiaPropsComponent3, propsComponent || {});
|
|
2592
2814
|
const classesIcon = selectIconVariants({ color: properties?.icon?.color, animated: open, open });
|
|
2593
2815
|
const classes = selectVariants({ wrapper: true });
|
|
2594
|
-
return /* @__PURE__ */
|
|
2595
|
-
/* @__PURE__ */
|
|
2816
|
+
return /* @__PURE__ */ jsxs16("div", { className: classes, ref, children: [
|
|
2817
|
+
/* @__PURE__ */ jsx41(
|
|
2596
2818
|
Input,
|
|
2597
2819
|
{
|
|
2598
2820
|
label,
|
|
@@ -2605,14 +2827,14 @@ var Select = ({ label, options, name, value, defaultValue, onChange, propsCompon
|
|
|
2605
2827
|
}
|
|
2606
2828
|
}
|
|
2607
2829
|
),
|
|
2608
|
-
/* @__PURE__ */
|
|
2830
|
+
/* @__PURE__ */ jsx41(
|
|
2609
2831
|
"div",
|
|
2610
2832
|
{
|
|
2611
2833
|
className: classesIcon,
|
|
2612
2834
|
style: properties?.icon?.style,
|
|
2613
2835
|
onClick: () => setOpen((prev) => !prev),
|
|
2614
2836
|
"data-testid": "yr3Select-icon",
|
|
2615
|
-
children: properties?.icon?.component ? properties?.icon.component : /* @__PURE__ */
|
|
2837
|
+
children: properties?.icon?.component ? properties?.icon.component : /* @__PURE__ */ jsx41(
|
|
2616
2838
|
IconDown,
|
|
2617
2839
|
{
|
|
2618
2840
|
width: properties?.icon?.style?.width,
|
|
@@ -2623,13 +2845,13 @@ var Select = ({ label, options, name, value, defaultValue, onChange, propsCompon
|
|
|
2623
2845
|
)
|
|
2624
2846
|
}
|
|
2625
2847
|
),
|
|
2626
|
-
open && /* @__PURE__ */
|
|
2848
|
+
open && /* @__PURE__ */ jsx41(
|
|
2627
2849
|
"div",
|
|
2628
2850
|
{
|
|
2629
2851
|
className: "yr3Select--menu",
|
|
2630
2852
|
style: composeStyles(properties?.menu?.ui, properties?.menu?.style),
|
|
2631
2853
|
"data-testid": "yr3Select-menu",
|
|
2632
|
-
children: options.map((opt) => /* @__PURE__ */
|
|
2854
|
+
children: options.map((opt) => /* @__PURE__ */ jsx41(
|
|
2633
2855
|
"div",
|
|
2634
2856
|
{
|
|
2635
2857
|
className: "yr3Select--option",
|
|
@@ -2651,7 +2873,7 @@ var Select = ({ label, options, name, value, defaultValue, onChange, propsCompon
|
|
|
2651
2873
|
onChange?.(event, opt.value);
|
|
2652
2874
|
},
|
|
2653
2875
|
style: composeStyles(properties?.menu?.options?.ui, properties?.menu?.options?.style),
|
|
2654
|
-
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 })
|
|
2655
2877
|
},
|
|
2656
2878
|
opt.value
|
|
2657
2879
|
))
|
|
@@ -2661,9 +2883,9 @@ var Select = ({ label, options, name, value, defaultValue, onChange, propsCompon
|
|
|
2661
2883
|
};
|
|
2662
2884
|
|
|
2663
2885
|
// src/components/Slide/Slide.tsx
|
|
2664
|
-
import * as
|
|
2665
|
-
import { jsx as
|
|
2666
|
-
var
|
|
2886
|
+
import * as React21 from "react";
|
|
2887
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
2888
|
+
var initialPropsComponent5 = {
|
|
2667
2889
|
slide: {
|
|
2668
2890
|
ui: {},
|
|
2669
2891
|
style: {}
|
|
@@ -2678,14 +2900,14 @@ var Slide = ({
|
|
|
2678
2900
|
onTransitionEnd,
|
|
2679
2901
|
propsComponent
|
|
2680
2902
|
}) => {
|
|
2681
|
-
const properties = mergeDeep(
|
|
2903
|
+
const properties = mergeDeep(initialPropsComponent5, propsComponent || {});
|
|
2682
2904
|
const bemContent = bem("yr3Slide--content");
|
|
2683
2905
|
const classNameContent = bemContent(void 0, {
|
|
2684
2906
|
[direction]: true,
|
|
2685
2907
|
"in": !!inProp,
|
|
2686
2908
|
"out": !inProp
|
|
2687
2909
|
});
|
|
2688
|
-
|
|
2910
|
+
React21.useEffect(() => {
|
|
2689
2911
|
let timeoutId;
|
|
2690
2912
|
if (inProp) {
|
|
2691
2913
|
timeoutId = setTimeout(() => {
|
|
@@ -2695,19 +2917,19 @@ var Slide = ({
|
|
|
2695
2917
|
return () => clearTimeout(timeoutId);
|
|
2696
2918
|
}, [inProp, duration, onTransitionEnd]);
|
|
2697
2919
|
const uiStyleContent = uiStyle({ ...properties?.slide?.ui, transitionDuration: `${duration}ms` });
|
|
2698
|
-
return /* @__PURE__ */
|
|
2920
|
+
return /* @__PURE__ */ jsx42(
|
|
2699
2921
|
"div",
|
|
2700
2922
|
{
|
|
2701
2923
|
className: "yr3Slide",
|
|
2702
2924
|
style: composeStyles(),
|
|
2703
2925
|
"data-testid": "yr3Slide",
|
|
2704
|
-
children: /* @__PURE__ */
|
|
2926
|
+
children: /* @__PURE__ */ jsx42(
|
|
2705
2927
|
"div",
|
|
2706
2928
|
{
|
|
2707
2929
|
className: classNameContent,
|
|
2708
2930
|
style: composeStyles(uiStyleContent, properties?.slide?.style || {}),
|
|
2709
2931
|
"data-testid": "yr3Slide-content",
|
|
2710
|
-
children: /* @__PURE__ */
|
|
2932
|
+
children: /* @__PURE__ */ jsx42(Box, { ...properties?.box, "data-testid": "yr3Slide-box", children })
|
|
2711
2933
|
}
|
|
2712
2934
|
)
|
|
2713
2935
|
}
|
|
@@ -2715,7 +2937,7 @@ var Slide = ({
|
|
|
2715
2937
|
};
|
|
2716
2938
|
|
|
2717
2939
|
// src/components/Switch/Switch.tsx
|
|
2718
|
-
import * as
|
|
2940
|
+
import * as React22 from "react";
|
|
2719
2941
|
|
|
2720
2942
|
// src/components/Switch/switch.variants.ts
|
|
2721
2943
|
var switchVariants = createVariants({
|
|
@@ -2752,7 +2974,7 @@ var switchVariants = createVariants({
|
|
|
2752
2974
|
});
|
|
2753
2975
|
|
|
2754
2976
|
// src/components/Switch/Switch.tsx
|
|
2755
|
-
import { jsx as
|
|
2977
|
+
import { jsx as jsx43, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2756
2978
|
var Switch = ({
|
|
2757
2979
|
checked,
|
|
2758
2980
|
defaultChecked,
|
|
@@ -2764,7 +2986,7 @@ var Switch = ({
|
|
|
2764
2986
|
placement = "end",
|
|
2765
2987
|
propsComponent
|
|
2766
2988
|
}) => {
|
|
2767
|
-
const [internal, setInternal] =
|
|
2989
|
+
const [internal, setInternal] = React22.useState(defaultChecked || false);
|
|
2768
2990
|
const classname = switchVariants({ colors: color, size, disabled: !!disabled, checked: checked ?? internal, placement });
|
|
2769
2991
|
const isControlled = checked !== void 0;
|
|
2770
2992
|
const value = isControlled ? checked : internal;
|
|
@@ -2772,13 +2994,13 @@ var Switch = ({
|
|
|
2772
2994
|
if (!isControlled) setInternal(e.target.checked);
|
|
2773
2995
|
onChange?.(e, e.target.checked);
|
|
2774
2996
|
};
|
|
2775
|
-
return /* @__PURE__ */
|
|
2997
|
+
return /* @__PURE__ */ jsxs17(
|
|
2776
2998
|
"label",
|
|
2777
2999
|
{
|
|
2778
3000
|
className: classname,
|
|
2779
3001
|
"data-testid": "yr3Switch",
|
|
2780
3002
|
children: [
|
|
2781
|
-
/* @__PURE__ */
|
|
3003
|
+
/* @__PURE__ */ jsx43(
|
|
2782
3004
|
"input",
|
|
2783
3005
|
{
|
|
2784
3006
|
type: "checkbox",
|
|
@@ -2787,8 +3009,8 @@ var Switch = ({
|
|
|
2787
3009
|
disabled
|
|
2788
3010
|
}
|
|
2789
3011
|
),
|
|
2790
|
-
/* @__PURE__ */
|
|
2791
|
-
/* @__PURE__ */
|
|
3012
|
+
/* @__PURE__ */ jsx43("span", { className: "yr3Switch--track", children: /* @__PURE__ */ jsx43("span", { className: "yr3Switch--thumb" }) }),
|
|
3013
|
+
/* @__PURE__ */ jsx43(
|
|
2792
3014
|
"span",
|
|
2793
3015
|
{
|
|
2794
3016
|
className: "yr3Switch--label",
|
|
@@ -2802,30 +3024,15 @@ var Switch = ({
|
|
|
2802
3024
|
);
|
|
2803
3025
|
};
|
|
2804
3026
|
|
|
2805
|
-
// src/Icons/IconSearch.tsx
|
|
2806
|
-
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
2807
|
-
var IconSearch = (props) => {
|
|
2808
|
-
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(
|
|
2809
|
-
"path",
|
|
2810
|
-
{
|
|
2811
|
-
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",
|
|
2812
|
-
stroke: props.stroke || "#fff",
|
|
2813
|
-
strokeWidth: props.strokeWidth || "1.5",
|
|
2814
|
-
strokeLinecap: "round",
|
|
2815
|
-
strokeLinejoin: "round"
|
|
2816
|
-
}
|
|
2817
|
-
) });
|
|
2818
|
-
};
|
|
2819
|
-
|
|
2820
3027
|
// src/theme/ThemeProvider.tsx
|
|
2821
|
-
import * as
|
|
3028
|
+
import * as React24 from "react";
|
|
2822
3029
|
|
|
2823
3030
|
// src/theme/notistackContext.tsx
|
|
2824
|
-
import * as
|
|
2825
|
-
import { jsx as
|
|
2826
|
-
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);
|
|
2827
3034
|
var NotistackProvider = ({ children }) => {
|
|
2828
|
-
const [snacks, setSnacks] =
|
|
3035
|
+
const [snacks, setSnacks] = React23.useState([]);
|
|
2829
3036
|
const notistack = (snack) => {
|
|
2830
3037
|
const id = Date.now();
|
|
2831
3038
|
setSnacks((prev) => [...prev, { ...snack, id, exiting: false }]);
|
|
@@ -2840,13 +3047,13 @@ var NotistackProvider = ({ children }) => {
|
|
|
2840
3047
|
setSnacks((prev) => prev.filter((s) => s.id !== id));
|
|
2841
3048
|
}, duration + exitDuration);
|
|
2842
3049
|
};
|
|
2843
|
-
return /* @__PURE__ */
|
|
3050
|
+
return /* @__PURE__ */ jsxs18(NotistackContext.Provider, { value: { notistack }, children: [
|
|
2844
3051
|
children,
|
|
2845
|
-
/* @__PURE__ */
|
|
3052
|
+
/* @__PURE__ */ jsx44("div", { className: "yr3NotistackContainer", children: snacks.map((snack) => /* @__PURE__ */ jsx44(Notistack, { ...snack }, snack.id)) })
|
|
2846
3053
|
] });
|
|
2847
3054
|
};
|
|
2848
3055
|
var useNotistack = () => {
|
|
2849
|
-
const ctx =
|
|
3056
|
+
const ctx = React23.useContext(NotistackContext);
|
|
2850
3057
|
if (!ctx) {
|
|
2851
3058
|
throw new Error("NotistackProvider missing");
|
|
2852
3059
|
}
|
|
@@ -2854,15 +3061,15 @@ var useNotistack = () => {
|
|
|
2854
3061
|
};
|
|
2855
3062
|
|
|
2856
3063
|
// src/theme/ThemeProvider.tsx
|
|
2857
|
-
import { jsx as
|
|
2858
|
-
var ThemeContext =
|
|
3064
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
3065
|
+
var ThemeContext = React24.createContext(null);
|
|
2859
3066
|
var ThemeProvider = ({ theme, children }) => {
|
|
2860
|
-
|
|
3067
|
+
React24.useEffect(() => {
|
|
2861
3068
|
applyTheme(theme);
|
|
2862
3069
|
}, [theme]);
|
|
2863
|
-
return /* @__PURE__ */
|
|
3070
|
+
return /* @__PURE__ */ jsx45(ThemeContext.Provider, { value: theme, children: /* @__PURE__ */ jsx45(BackdropProvider, { children: /* @__PURE__ */ jsx45(NotistackProvider, { children }) }) });
|
|
2864
3071
|
};
|
|
2865
|
-
var useTheme = () =>
|
|
3072
|
+
var useTheme = () => React24.useContext(ThemeContext);
|
|
2866
3073
|
|
|
2867
3074
|
// src/theme/tokens.ts
|
|
2868
3075
|
var baseTokens = {
|
|
@@ -2883,15 +3090,15 @@ var baseTokens = {
|
|
|
2883
3090
|
};
|
|
2884
3091
|
|
|
2885
3092
|
// src/theme/useMediaQuery.tsx
|
|
2886
|
-
import * as
|
|
3093
|
+
import * as React25 from "react";
|
|
2887
3094
|
function useMediaQuery(query) {
|
|
2888
3095
|
const theme = useTheme();
|
|
2889
3096
|
const computedQuery = typeof query === "function" ? query(theme) : query;
|
|
2890
|
-
const [matches, setMatches] =
|
|
3097
|
+
const [matches, setMatches] = React25.useState(() => {
|
|
2891
3098
|
if (typeof window === "undefined") return false;
|
|
2892
3099
|
return window.matchMedia(computedQuery).matches;
|
|
2893
3100
|
});
|
|
2894
|
-
|
|
3101
|
+
React25.useEffect(() => {
|
|
2895
3102
|
if (typeof window === "undefined") return;
|
|
2896
3103
|
const media = window.matchMedia(computedQuery);
|
|
2897
3104
|
const listener = () => setMatches(media.matches);
|
|
@@ -2925,7 +3132,7 @@ var usePlaces = ({ input, language, apiKey, provider }) => {
|
|
|
2925
3132
|
};
|
|
2926
3133
|
|
|
2927
3134
|
// src/hooks/useBreakpoint.ts
|
|
2928
|
-
import * as
|
|
3135
|
+
import * as React26 from "react";
|
|
2929
3136
|
var breakUp = (bp) => `(min-width: ${bp}px)`;
|
|
2930
3137
|
var breakDown = (bp) => `(max-width: ${bp}px)`;
|
|
2931
3138
|
function useBreakpoint(queryInput) {
|
|
@@ -2935,8 +3142,8 @@ function useBreakpoint(queryInput) {
|
|
|
2935
3142
|
if (typeof window === "undefined") return false;
|
|
2936
3143
|
return window.matchMedia(query).matches;
|
|
2937
3144
|
};
|
|
2938
|
-
const [matches, setMatches] =
|
|
2939
|
-
|
|
3145
|
+
const [matches, setMatches] = React26.useState(getMatch);
|
|
3146
|
+
React26.useEffect(() => {
|
|
2940
3147
|
if (typeof window === "undefined") return;
|
|
2941
3148
|
const media = window.matchMedia(query);
|
|
2942
3149
|
const listener = (e) => {
|
|
@@ -2981,8 +3188,10 @@ export {
|
|
|
2981
3188
|
Flex,
|
|
2982
3189
|
Grid,
|
|
2983
3190
|
Group,
|
|
3191
|
+
IconCalendar,
|
|
2984
3192
|
IconClose,
|
|
2985
3193
|
IconDown,
|
|
3194
|
+
IconLeft,
|
|
2986
3195
|
IconSearch,
|
|
2987
3196
|
Image,
|
|
2988
3197
|
ImageDropzone,
|
|
@@ -2992,6 +3201,7 @@ export {
|
|
|
2992
3201
|
Loader,
|
|
2993
3202
|
Modal,
|
|
2994
3203
|
ModalContainer,
|
|
3204
|
+
MonthSelector,
|
|
2995
3205
|
Notistack,
|
|
2996
3206
|
NotistackContext,
|
|
2997
3207
|
NotistackProvider,
|
|
@@ -3000,6 +3210,7 @@ export {
|
|
|
3000
3210
|
PlacesAutocomplete,
|
|
3001
3211
|
Radio,
|
|
3002
3212
|
Select,
|
|
3213
|
+
Selector,
|
|
3003
3214
|
Slide,
|
|
3004
3215
|
Switch,
|
|
3005
3216
|
Text,
|
|
@@ -3024,6 +3235,7 @@ export {
|
|
|
3024
3235
|
getCountryCodePhone,
|
|
3025
3236
|
getDialPhone,
|
|
3026
3237
|
getMonthCalendar,
|
|
3238
|
+
getMonthCalendarProps,
|
|
3027
3239
|
getNumberPhone,
|
|
3028
3240
|
hexToRgb,
|
|
3029
3241
|
initTheme,
|