@yr3/ui 1.0.3 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1371,16 +1371,72 @@ var Image = ({
1371
1371
  );
1372
1372
  };
1373
1373
 
1374
- // src/components/Input/Input.tsx
1374
+ // src/components/ImageDropzone/ImageDropzone.tsx
1375
1375
  import * as React11 from "react";
1376
+ import { jsx as jsx22, jsxs as jsxs5 } from "react/jsx-runtime";
1377
+ var ImageDropzone = ({ onChange, multiple, ui, style, propsComponent, bordered, component, defaultImage, variant = "outlined" }) => {
1378
+ const [dragging, setDragging] = React11.useState(false);
1379
+ const [files, setFiles] = React11.useState([]);
1380
+ const inputRef = React11.useRef(null);
1381
+ const handleFiles = (fileList) => {
1382
+ if (!fileList) return;
1383
+ const newFiles = Array.from(fileList);
1384
+ setFiles((prev) => {
1385
+ const updated = multiple ? [...prev, ...newFiles] : newFiles;
1386
+ onChange?.(updated);
1387
+ return updated;
1388
+ });
1389
+ };
1390
+ const classes = bem("yr3Dropzone");
1391
+ const classComponent = classes(void 0, { "dragging": !!dragging, "bordered": !!bordered, variant });
1392
+ return /* @__PURE__ */ jsx22(Box, { as: "div", position: "relative", content: "center", ...propsComponent?.box, children: /* @__PURE__ */ jsxs5(
1393
+ "div",
1394
+ {
1395
+ className: classComponent,
1396
+ onDragOver: (e) => {
1397
+ e.preventDefault();
1398
+ setDragging(true);
1399
+ },
1400
+ onDragLeave: () => setDragging(false),
1401
+ onDrop: (e) => {
1402
+ e.preventDefault();
1403
+ setDragging(false);
1404
+ handleFiles(e.dataTransfer.files);
1405
+ },
1406
+ onClick: () => inputRef.current?.click(),
1407
+ style: composeStyles(ui, style),
1408
+ children: [
1409
+ /* @__PURE__ */ jsx22(
1410
+ "input",
1411
+ {
1412
+ ref: inputRef,
1413
+ type: "file",
1414
+ hidden: true,
1415
+ multiple,
1416
+ accept: "image/*",
1417
+ onChange: (e) => handleFiles(e.target.files)
1418
+ }
1419
+ ),
1420
+ isEmpty(files) && /* @__PURE__ */ jsx22("div", { className: "yr3Dropzone--content", children: /* @__PURE__ */ jsx22(Text, { variant: "helper", color: "disabled", ...propsComponent?.text, children: propsComponent?.text?.primary || "Drag and drop an image here, or click to select one" }) }),
1421
+ multiple && /* @__PURE__ */ jsx22("div", { className: "yr3Dropzone--previews", children: files.map((file, i) => /* @__PURE__ */ jsx22("img", { src: URL.createObjectURL(file) }, i)) }),
1422
+ !multiple && /* @__PURE__ */ jsx22("div", { className: "yr3Dropzone--preview", children: files.map((file, i) => /* @__PURE__ */ jsx22("img", { src: URL.createObjectURL(file) }, i)) }),
1423
+ !!defaultImage && /* @__PURE__ */ jsx22("div", { className: "yr3Dropzone--preview", children: /* @__PURE__ */ jsx22("img", { src: defaultImage }) }),
1424
+ component
1425
+ ]
1426
+ }
1427
+ ) });
1428
+ };
1429
+
1430
+ // src/components/Input/Input.tsx
1431
+ import * as React12 from "react";
1376
1432
 
1377
1433
  // src/components/Label/Label.tsx
1378
- import { jsx as jsx22 } from "react/jsx-runtime";
1434
+ import { jsx as jsx23 } from "react/jsx-runtime";
1379
1435
  var Label = ({ text: text2, children, className, color = "primary", ui, style }) => {
1380
1436
  const classes = bem("yr3Label");
1381
1437
  const classComponent = classes(void 0, { color: `color-${color}` });
1382
1438
  const classnames = bemMerge(classComponent, className);
1383
- return /* @__PURE__ */ jsx22(
1439
+ return /* @__PURE__ */ jsx23(
1384
1440
  "span",
1385
1441
  {
1386
1442
  className: classnames,
@@ -1432,7 +1488,7 @@ var inputVariants = createVariants({
1432
1488
  });
1433
1489
 
1434
1490
  // src/components/Input/Input.tsx
1435
- import { jsx as jsx23, jsxs as jsxs5 } from "react/jsx-runtime";
1491
+ import { jsx as jsx24, jsxs as jsxs6 } from "react/jsx-runtime";
1436
1492
  var initiaPropsComponent = {
1437
1493
  label: {
1438
1494
  display: true,
@@ -1440,7 +1496,7 @@ var initiaPropsComponent = {
1440
1496
  style: {}
1441
1497
  }
1442
1498
  };
1443
- var Input = React11.forwardRef(
1499
+ var Input = React12.forwardRef(
1444
1500
  ({
1445
1501
  label,
1446
1502
  value,
@@ -1455,9 +1511,9 @@ var Input = React11.forwardRef(
1455
1511
  color = "primary",
1456
1512
  ...props
1457
1513
  }, ref) => {
1458
- const [focused, setFocused] = React11.useState(false);
1459
- const [internalValue, setInternalValue] = React11.useState(defaultValue);
1460
- const [internalError, setInternalError] = React11.useState(null);
1514
+ const [focused, setFocused] = React12.useState(false);
1515
+ const [internalValue, setInternalValue] = React12.useState(defaultValue);
1516
+ const [internalError, setInternalError] = React12.useState(null);
1461
1517
  const isControlled = value !== void 0;
1462
1518
  const currentValue = isControlled ? value : internalValue;
1463
1519
  const isActive = focused || !!currentValue;
@@ -1487,8 +1543,8 @@ var Input = React11.forwardRef(
1487
1543
  onChange?.(e, newValue);
1488
1544
  };
1489
1545
  const classes = inputVariants({ color, label: propsComponent?.label?.display });
1490
- return /* @__PURE__ */ jsxs5(Control, { variant, color, label: propsComponent?.label?.display, children: [
1491
- propsComponent?.label?.display && /* @__PURE__ */ jsx23(
1546
+ return /* @__PURE__ */ jsxs6(Control, { variant, color, label: propsComponent?.label?.display, children: [
1547
+ propsComponent?.label?.display && /* @__PURE__ */ jsx24(
1492
1548
  Label,
1493
1549
  {
1494
1550
  text: label || "",
@@ -1497,7 +1553,7 @@ var Input = React11.forwardRef(
1497
1553
  ...propsComponent.label
1498
1554
  }
1499
1555
  ),
1500
- /* @__PURE__ */ jsx23(
1556
+ /* @__PURE__ */ jsx24(
1501
1557
  "input",
1502
1558
  {
1503
1559
  ref,
@@ -1513,36 +1569,36 @@ var Input = React11.forwardRef(
1513
1569
  "data-testid": "yr3Input"
1514
1570
  }
1515
1571
  ),
1516
- /* @__PURE__ */ jsx23(Text, { variant: "helper", "data-testid": "yr3Input-helper", children: error || internalError || "" })
1572
+ /* @__PURE__ */ jsx24(Text, { variant: "helper", "data-testid": "yr3Input-helper", children: error || internalError || "" })
1517
1573
  ] });
1518
1574
  }
1519
1575
  );
1520
1576
 
1521
1577
  // src/components/Input/InputPhone.tsx
1522
- import * as React14 from "react";
1578
+ import * as React15 from "react";
1523
1579
 
1524
1580
  // src/components/Select/Selector.tsx
1525
- import * as React12 from "react";
1581
+ import * as React13 from "react";
1526
1582
 
1527
1583
  // src/Icons/IconDown.tsx
1528
- import { jsx as jsx24 } from "react/jsx-runtime";
1584
+ import { jsx as jsx25 } from "react/jsx-runtime";
1529
1585
  var IconDown = (props) => {
1530
- return /* @__PURE__ */ jsx24("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__ */ jsx24("path", { d: "M7 10L12 15L17 10", stroke: props.stroke || "#fff", strokeWidth: props.strokeWidth || "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
1586
+ return /* @__PURE__ */ jsx25("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__ */ jsx25("path", { d: "M7 10L12 15L17 10", stroke: props.stroke || "#fff", strokeWidth: props.strokeWidth || "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
1531
1587
  };
1532
1588
 
1533
1589
  // src/components/Select/Selector.tsx
1534
- import { jsx as jsx25, jsxs as jsxs6 } from "react/jsx-runtime";
1590
+ import { jsx as jsx26, jsxs as jsxs7 } from "react/jsx-runtime";
1535
1591
  var Selector = ({ ui, style, options, name, value, defaultValue, onChange, iconColor, icon }) => {
1536
- const [open, setOpen] = React12.useState(false);
1537
- const [valueState, setValueState] = React12.useState(value || defaultValue || null);
1538
- const ref = React12.useRef(null);
1592
+ const [open, setOpen] = React13.useState(false);
1593
+ const [valueState, setValueState] = React13.useState(value || defaultValue || null);
1594
+ const ref = React13.useRef(null);
1539
1595
  useClickAway(ref, () => setOpen(false));
1540
- return /* @__PURE__ */ jsxs6("div", { className: "yr3Selector-wrapper", ref, children: [
1541
- /* @__PURE__ */ jsx25("div", { className: `yr3Selector ${open ? "yr3Selector--open" : ""}`, style: composeStyles(ui, style), children: /* @__PURE__ */ jsxs6("div", { className: "yr3Selector--control", children: [
1542
- /* @__PURE__ */ jsx25("div", { className: "yr3Selector--icon", onClick: () => setOpen((prev) => !prev), children: icon ? icon : /* @__PURE__ */ jsx25(IconDown, { stroke: `var(--color-${iconColor || "disabled"})`, width: 24, height: 24 }) }),
1596
+ return /* @__PURE__ */ jsxs7("div", { className: "yr3Selector-wrapper", ref, children: [
1597
+ /* @__PURE__ */ jsx26("div", { className: `yr3Selector ${open ? "yr3Selector--open" : ""}`, style: composeStyles(ui, style), children: /* @__PURE__ */ jsxs7("div", { className: "yr3Selector--control", children: [
1598
+ /* @__PURE__ */ jsx26("div", { className: "yr3Selector--icon", onClick: () => setOpen((prev) => !prev), children: icon ? icon : /* @__PURE__ */ jsx26(IconDown, { stroke: `var(--color-${iconColor || "disabled"})`, width: 24, height: 24 }) }),
1543
1599
  valueState
1544
1600
  ] }) }),
1545
- open && /* @__PURE__ */ jsx25("div", { className: "yr3Select--menu", children: options.map((opt) => /* @__PURE__ */ jsx25(
1601
+ open && /* @__PURE__ */ jsx26("div", { className: "yr3Select--menu", children: options.map((opt) => /* @__PURE__ */ jsx26(
1546
1602
  "div",
1547
1603
  {
1548
1604
  className: "yr3Select--option",
@@ -1572,19 +1628,19 @@ var Selector = ({ ui, style, options, name, value, defaultValue, onChange, iconC
1572
1628
  var Selector_default = Selector;
1573
1629
 
1574
1630
  // src/theme/ThemeProvider.tsx
1575
- import * as React13 from "react";
1576
- import { jsx as jsx26 } from "react/jsx-runtime";
1577
- var ThemeContext = React13.createContext(null);
1631
+ import * as React14 from "react";
1632
+ import { jsx as jsx27 } from "react/jsx-runtime";
1633
+ var ThemeContext = React14.createContext(null);
1578
1634
  var ThemeProvider = ({ theme, children }) => {
1579
- React13.useEffect(() => {
1635
+ React14.useEffect(() => {
1580
1636
  applyTheme(theme);
1581
1637
  }, [theme]);
1582
- return /* @__PURE__ */ jsx26(ThemeContext.Provider, { value: theme, children: /* @__PURE__ */ jsx26(BackdropProvider, { children }) });
1638
+ return /* @__PURE__ */ jsx27(ThemeContext.Provider, { value: theme, children: /* @__PURE__ */ jsx27(BackdropProvider, { children }) });
1583
1639
  };
1584
- var useTheme = () => React13.useContext(ThemeContext);
1640
+ var useTheme = () => React14.useContext(ThemeContext);
1585
1641
 
1586
1642
  // src/components/Input/InputPhone.tsx
1587
- import { jsx as jsx27, jsxs as jsxs7 } from "react/jsx-runtime";
1643
+ import { jsx as jsx28, jsxs as jsxs8 } from "react/jsx-runtime";
1588
1644
  var Phone = ({
1589
1645
  name,
1590
1646
  value,
@@ -1594,8 +1650,8 @@ var Phone = ({
1594
1650
  countries = [],
1595
1651
  propsComponent
1596
1652
  }) => {
1597
- const [prefixValue, setPrefixValue] = React14.useState(prefix);
1598
- const [number, setNumber] = React14.useState(Number(value) || null);
1653
+ const [prefixValue, setPrefixValue] = React15.useState(prefix);
1654
+ const [number, setNumber] = React15.useState(Number(value) || null);
1599
1655
  const theme = useTheme();
1600
1656
  const handleChange = (newPrefix, newNumber) => {
1601
1657
  const full = `${newPrefix}${newNumber.toString()}`;
@@ -1607,10 +1663,10 @@ var Phone = ({
1607
1663
  };
1608
1664
  onChange?.(event, full);
1609
1665
  };
1610
- return /* @__PURE__ */ jsxs7(Control, { variant: "outlined", children: [
1611
- /* @__PURE__ */ jsx27(Label, { text: label, className: "yr3Input--active" }),
1612
- /* @__PURE__ */ jsx27("div", { className: "yr3PhoneInput", "data-testid": "yr3Phone", children: /* @__PURE__ */ jsxs7(Flex, { variant: "row", container: true, center: true, children: [
1613
- /* @__PURE__ */ jsx27(
1666
+ return /* @__PURE__ */ jsxs8(Control, { variant: "outlined", children: [
1667
+ /* @__PURE__ */ jsx28(Label, { text: label, className: "yr3Input--active" }),
1668
+ /* @__PURE__ */ jsx28("div", { className: "yr3PhoneInput", "data-testid": "yr3Phone", children: /* @__PURE__ */ jsxs8(Flex, { variant: "row", container: true, center: true, children: [
1669
+ /* @__PURE__ */ jsx28(
1614
1670
  Selector_default,
1615
1671
  {
1616
1672
  options: countries.map((c) => ({
@@ -1630,8 +1686,8 @@ var Phone = ({
1630
1686
  style: propsComponent?.selector?.style
1631
1687
  }
1632
1688
  ),
1633
- /* @__PURE__ */ jsx27(Divider, { orientation: "vertical", ...propsComponent?.divider }),
1634
- /* @__PURE__ */ jsx27(
1689
+ /* @__PURE__ */ jsx28(Divider, { orientation: "vertical", ...propsComponent?.divider }),
1690
+ /* @__PURE__ */ jsx28(
1635
1691
  Input,
1636
1692
  {
1637
1693
  type: "phone",
@@ -1648,22 +1704,127 @@ var Phone = ({
1648
1704
  ] });
1649
1705
  };
1650
1706
 
1707
+ // src/components/InputArea/InputArea.tsx
1708
+ import * as React16 from "react";
1709
+
1710
+ // src/components/InputArea/inputAreaVariants.ts
1711
+ var inputAreaVariants = createVariants({
1712
+ base: "yr3InputArea",
1713
+ variants: {
1714
+ variant: {
1715
+ filled: "yr3InputArea--filled",
1716
+ outlined: "yr3InputArea--outlined",
1717
+ base: "yr3InputArea--base",
1718
+ lined: "yr3InputArea--lined"
1719
+ },
1720
+ color: {
1721
+ primary: "yr3InputArea--color-primary",
1722
+ secondary: "yr3InputArea--color-secondary",
1723
+ success: "yr3InputArea--color-success",
1724
+ text: "yr3InputArea--color-text",
1725
+ disabled: "yr3InputArea--color-disabled"
1726
+ },
1727
+ size: {
1728
+ auto: "yr3InputArea--size-auto",
1729
+ full: "yr3InputArea--size-full"
1730
+ },
1731
+ rounded: {
1732
+ true: "yr3InputArea--rounded"
1733
+ },
1734
+ disabled: {
1735
+ true: "yr3InputArea--disabled"
1736
+ },
1737
+ animated: {
1738
+ true: "yr3InputArea--animated"
1739
+ }
1740
+ }
1741
+ });
1742
+
1743
+ // src/components/InputArea/InputArea.tsx
1744
+ import { jsx as jsx29, jsxs as jsxs9 } from "react/jsx-runtime";
1745
+ var initiaPropsComponent2 = {
1746
+ label: {
1747
+ display: true,
1748
+ ui: {},
1749
+ style: {}
1750
+ },
1751
+ helperText: ""
1752
+ };
1753
+ var InputArea = ({
1754
+ value,
1755
+ defaultValue = "",
1756
+ onChange,
1757
+ rows = 1,
1758
+ ui,
1759
+ style,
1760
+ label,
1761
+ validate,
1762
+ color = "primary",
1763
+ maxLength = 0,
1764
+ resize = "vertical",
1765
+ variant = "outlined",
1766
+ rounded = false,
1767
+ propsComponent = initiaPropsComponent2
1768
+ }) => {
1769
+ const ref = React16.useRef(null);
1770
+ const [internalValue, setInternalValue] = React16.useState(defaultValue);
1771
+ const isControlled = value !== void 0;
1772
+ const currentValue = isControlled ? value : internalValue;
1773
+ const handleChange = (e) => {
1774
+ const newValue = e.target.value;
1775
+ if (!isControlled) {
1776
+ setInternalValue(newValue);
1777
+ }
1778
+ onChange?.(e, newValue);
1779
+ };
1780
+ const el = ref.current;
1781
+ if (el) {
1782
+ el.style.height = "auto";
1783
+ el.style.height = el.scrollHeight + "px";
1784
+ el.style.resize = resize;
1785
+ }
1786
+ const classes = inputAreaVariants({ variant, color, rounded });
1787
+ return /* @__PURE__ */ jsxs9("div", { style: { position: "relative" }, children: [
1788
+ propsComponent?.label?.display && /* @__PURE__ */ jsx29(
1789
+ Label,
1790
+ {
1791
+ text: label || "",
1792
+ className: "yr3Input--active",
1793
+ ...propsComponent.label
1794
+ }
1795
+ ),
1796
+ /* @__PURE__ */ jsx29(
1797
+ "textarea",
1798
+ {
1799
+ className: classes,
1800
+ ref,
1801
+ value: currentValue,
1802
+ rows,
1803
+ onChange: handleChange,
1804
+ style: composeStyles(ui, style),
1805
+ "data-testid": "yr3InputArea"
1806
+ }
1807
+ ),
1808
+ /* @__PURE__ */ jsx29(Text, { variant: "helper", color: currentValue.length > maxLength ? "error" : "disabled", ui: { textAlign: "right" }, "data-testid": "yr3InputAreaError", children: validate && maxLength ? `${currentValue.length}/${maxLength}` || propsComponent.helperText : "" })
1809
+ ] });
1810
+ };
1811
+
1651
1812
  // src/components/Modal/Modal.tsx
1652
- import * as React15 from "react";
1813
+ import * as React17 from "react";
1653
1814
 
1654
1815
  // src/components/Modal/ModalContainer.tsx
1655
- import { jsx as jsx28 } from "react/jsx-runtime";
1816
+ import { jsx as jsx30 } from "react/jsx-runtime";
1656
1817
  var ModalContainer = ({ children, size = "sm", ui, style }) => {
1657
1818
  const classes = bem("yr3Modal-container");
1658
1819
  const classComponent = classes(void 0, { [`${size}`]: !!size });
1659
- return /* @__PURE__ */ jsx28("div", { className: classComponent, style: composeStyles(ui, style), "data-testid": "yr3Modal-container", children });
1820
+ return /* @__PURE__ */ jsx30("div", { className: classComponent, style: composeStyles(ui, style), "data-testid": "yr3Modal-container", children });
1660
1821
  };
1661
1822
 
1662
1823
  // src/components/Modal/Modal.tsx
1663
- import { jsx as jsx29, jsxs as jsxs8 } from "react/jsx-runtime";
1824
+ import { jsx as jsx31, jsxs as jsxs10 } from "react/jsx-runtime";
1664
1825
  var Modal = ({ open, onClose, children, propsComponent }) => {
1665
1826
  const { show, hide } = useBackdrop();
1666
- React15.useEffect(() => {
1827
+ React17.useEffect(() => {
1667
1828
  if (open) {
1668
1829
  show();
1669
1830
  } else {
@@ -1672,9 +1833,9 @@ var Modal = ({ open, onClose, children, propsComponent }) => {
1672
1833
  }, [open, show]);
1673
1834
  const classes = bem("yr3Modal");
1674
1835
  const classComponent = classes(void 0, { "open": !!open });
1675
- return /* @__PURE__ */ jsx29("div", { className: classComponent, onClick: (e) => e.stopPropagation(), "data-testid": "yr3Modal", children: /* @__PURE__ */ jsx29(ModalContainer, { ...propsComponent?.container, children: /* @__PURE__ */ jsxs8(Flex, { variant: "column", container: true, center: true, gap: 1, children: [
1836
+ return /* @__PURE__ */ jsx31("div", { className: classComponent, onClick: (e) => e.stopPropagation(), "data-testid": "yr3Modal", children: /* @__PURE__ */ jsx31(ModalContainer, { ...propsComponent?.container, children: /* @__PURE__ */ jsxs10(Flex, { variant: "column", container: true, center: true, gap: 1, children: [
1676
1837
  children,
1677
- propsComponent?.close ? propsComponent.close : /* @__PURE__ */ jsx29(Button, { variant: "filled", color: "secondary", onClick: onClose, "data-testid": "yr3Modal-close", children: "Close" })
1838
+ propsComponent?.close ? propsComponent.close : /* @__PURE__ */ jsx31(Button, { variant: "filled", color: "secondary", onClick: onClose, "data-testid": "yr3Modal-close", children: "Close" })
1678
1839
  ] }) }) });
1679
1840
  };
1680
1841
 
@@ -1714,15 +1875,15 @@ var notistackVariants = createVariants({
1714
1875
  });
1715
1876
 
1716
1877
  // src/components/Notistack/Notistack.tsx
1717
- import { jsx as jsx30, jsxs as jsxs9 } from "react/jsx-runtime";
1878
+ import { jsx as jsx32, jsxs as jsxs11 } from "react/jsx-runtime";
1718
1879
  var Notistack = ({ message, duration = 3e3, variant = "info", color, propsComponent, anchor, exiting = false }) => {
1719
1880
  const classes = notistackVariants({ type: variant, color, exiting, direction: `${anchor?.vertical || "bottom"}-${anchor?.horizontal || "right"}` });
1720
1881
  const containerStyle = composeStyles(propsComponent?.container?.ui, propsComponent?.container?.style);
1721
1882
  const notistackStyle = composeStyles(propsComponent?.notistack?.ui, propsComponent?.notistack?.style);
1722
1883
  const progressStyle = composeStyles(propsComponent?.progress?.ui, propsComponent?.progress?.style);
1723
- return /* @__PURE__ */ jsxs9("div", { className: classes, "data-testid": "yr3Notistack", style: notistackStyle, children: [
1724
- /* @__PURE__ */ jsx30("span", { style: containerStyle, children: message }),
1725
- /* @__PURE__ */ jsx30(
1884
+ return /* @__PURE__ */ jsxs11("div", { className: classes, "data-testid": "yr3Notistack", style: notistackStyle, children: [
1885
+ /* @__PURE__ */ jsx32("span", { style: containerStyle, children: message }),
1886
+ /* @__PURE__ */ jsx32(
1726
1887
  "div",
1727
1888
  {
1728
1889
  className: "yr3Notistack--progress",
@@ -1756,7 +1917,7 @@ var pendingVariants = createVariants({
1756
1917
  });
1757
1918
 
1758
1919
  // src/components/Pending/Pending.tsx
1759
- import { jsx as jsx31 } from "react/jsx-runtime";
1920
+ import { jsx as jsx33 } from "react/jsx-runtime";
1760
1921
  var Pending = ({
1761
1922
  variant,
1762
1923
  width,
@@ -1769,7 +1930,7 @@ var Pending = ({
1769
1930
  const widthStyle = variant === "circle" ? size : width;
1770
1931
  const heightStyle = variant === "circle" ? size : height;
1771
1932
  const uiStylePending = uiStyle({ width: widthStyle, height: heightStyle, ...ui });
1772
- return /* @__PURE__ */ jsx31(
1933
+ return /* @__PURE__ */ jsx33(
1773
1934
  "div",
1774
1935
  {
1775
1936
  className: pendingVariants({ variant, color }),
@@ -1779,6 +1940,110 @@ var Pending = ({
1779
1940
  );
1780
1941
  };
1781
1942
 
1943
+ // src/components/Places/PlacesAutocomplete.tsx
1944
+ import * as React18 from "react";
1945
+ import { useAutocompletePlaces } from "@yr3/autocomplete-places";
1946
+ import { jsx as jsx34, jsxs as jsxs12 } from "react/jsx-runtime";
1947
+ var initPropsComponent = {
1948
+ label: {
1949
+ display: true,
1950
+ ui: {},
1951
+ style: {}
1952
+ },
1953
+ control: {
1954
+ variant: "outlined",
1955
+ color: "primary",
1956
+ label: true,
1957
+ ui: {},
1958
+ style: {}
1959
+ },
1960
+ input: {
1961
+ variant: "outlined",
1962
+ color: "primary",
1963
+ ui: { width: "90dvw" },
1964
+ style: {}
1965
+ },
1966
+ menu: {
1967
+ ui: {},
1968
+ style: {},
1969
+ text: {
1970
+ variant: "body2",
1971
+ color: "primary",
1972
+ ui: {},
1973
+ style: {}
1974
+ }
1975
+ }
1976
+ };
1977
+ var PlacesAutocomplete = ({
1978
+ onSelect,
1979
+ onChangeForm,
1980
+ language = "en",
1981
+ provider = "google",
1982
+ defaultLocation,
1983
+ keyApi,
1984
+ propsComponent = initPropsComponent
1985
+ }) => {
1986
+ const [value, setValue] = React18.useState(null);
1987
+ const inputRef = React18.useRef(null);
1988
+ const [anchorEl, setAnchorEl] = React18.useState(null);
1989
+ const { suggestions, selectPlace } = useAutocompletePlaces({ input: value, apiKey: keyApi, language, provider });
1990
+ const handleSelect = async (id) => {
1991
+ const place = await selectPlace(id);
1992
+ const locationData = {
1993
+ name: place.name || "",
1994
+ address: place.address,
1995
+ city: place.city || "",
1996
+ country: place.country || "",
1997
+ zip: place.zip || "",
1998
+ lat: place.lat,
1999
+ lng: place.lng,
2000
+ code: place.code || "",
2001
+ phone: place.phone || "",
2002
+ placeId: id
2003
+ };
2004
+ onSelect(locationData);
2005
+ setValue(place.address);
2006
+ setAnchorEl(null);
2007
+ };
2008
+ React18.useEffect(() => {
2009
+ if (defaultLocation) {
2010
+ setValue(defaultLocation);
2011
+ }
2012
+ }, [defaultLocation]);
2013
+ React18.useEffect(() => {
2014
+ if (value === "") {
2015
+ onSelect(null);
2016
+ }
2017
+ }, [value]);
2018
+ const handleChange = (e) => {
2019
+ setValue(e.target.value);
2020
+ setAnchorEl(e.target.value ? inputRef.current : null);
2021
+ };
2022
+ const open = suggestions.length > 0 && Boolean(anchorEl);
2023
+ React18.useEffect(() => {
2024
+ if (onChangeForm) {
2025
+ onChangeForm({ target: { value } });
2026
+ }
2027
+ }, [onChangeForm]);
2028
+ return /* @__PURE__ */ jsxs12(Control, { ...propsComponent?.control, children: [
2029
+ /* @__PURE__ */ jsx34(
2030
+ Input,
2031
+ {
2032
+ ref: inputRef,
2033
+ type: "text",
2034
+ value,
2035
+ onChange: handleChange,
2036
+ propsComponent: {
2037
+ label: propsComponent.label
2038
+ },
2039
+ ...propsComponent?.input
2040
+ },
2041
+ "input-places"
2042
+ ),
2043
+ open && /* @__PURE__ */ jsx34("div", { className: "yr3Places--menu", style: composeStyles(propsComponent.menu?.ui, propsComponent?.menu?.style), children: /* @__PURE__ */ jsx34(Flex, { container: true, ui: { p: 1 }, children: suggestions.map((s) => /* @__PURE__ */ jsx34(Flex, { onClick: () => handleSelect(s.id), ui: { padding: 8, cursor: "pointer", "&:hover": { backgroundColor: "rgba(0,0,0,0.1)" } }, children: /* @__PURE__ */ jsx34(Text, { ...propsComponent?.menu?.text, children: s.description }) }, s.id)) }) })
2044
+ ] });
2045
+ };
2046
+
1782
2047
  // src/components/Radio/radio.variants.ts
1783
2048
  var radioVariant = createVariants({
1784
2049
  base: "yr3Radio",
@@ -1798,7 +2063,7 @@ var radioVariant = createVariants({
1798
2063
  });
1799
2064
 
1800
2065
  // src/components/Radio/Radio.tsx
1801
- import { jsx as jsx32, jsxs as jsxs10 } from "react/jsx-runtime";
2066
+ import { jsx as jsx35, jsxs as jsxs13 } from "react/jsx-runtime";
1802
2067
  var Radio = ({
1803
2068
  checked,
1804
2069
  value,
@@ -1814,8 +2079,8 @@ var Radio = ({
1814
2079
  const bemClass = bem("yr3Radio");
1815
2080
  const classes = bemClass(void 0, { [color]: `color-${color}` });
1816
2081
  const variantClass = radioVariant({ variant });
1817
- return /* @__PURE__ */ jsxs10("label", { className: classes, "data-testid": "yr3Radio", style: composeStyles(propsComponent?.radio?.ui, propsComponent?.radio?.style), children: [
1818
- /* @__PURE__ */ jsx32(
2082
+ return /* @__PURE__ */ jsxs13("label", { className: classes, "data-testid": "yr3Radio", style: composeStyles(propsComponent?.radio?.ui, propsComponent?.radio?.style), children: [
2083
+ /* @__PURE__ */ jsx35(
1819
2084
  "input",
1820
2085
  {
1821
2086
  type: "radio",
@@ -1827,8 +2092,8 @@ var Radio = ({
1827
2092
  }
1828
2093
  ),
1829
2094
  iconChecked && checked ? iconChecked : !checked && iconUnchecked ? iconUnchecked : null,
1830
- !iconChecked && !iconUnchecked && /* @__PURE__ */ jsx32("span", { className: variantClass, "data-testid": "yr3Radio-dot" }),
1831
- typeof label === "string" && /* @__PURE__ */ jsx32(
2095
+ !iconChecked && !iconUnchecked && /* @__PURE__ */ jsx35("span", { className: variantClass, "data-testid": "yr3Radio-dot" }),
2096
+ typeof label === "string" && /* @__PURE__ */ jsx35(
1832
2097
  "span",
1833
2098
  {
1834
2099
  className: "yr3Radio--label",
@@ -1841,15 +2106,15 @@ var Radio = ({
1841
2106
  };
1842
2107
 
1843
2108
  // src/components/Select/Select.tsx
1844
- import * as React16 from "react";
1845
- import { jsx as jsx33, jsxs as jsxs11 } from "react/jsx-runtime";
2109
+ import * as React19 from "react";
2110
+ import { jsx as jsx36, jsxs as jsxs14 } from "react/jsx-runtime";
1846
2111
  var Select = ({ label, options, name, value, defaultValue, onChange, propsComponent }) => {
1847
- const [open, setOpen] = React16.useState(false);
1848
- const [valueState, setValueState] = React16.useState(value || defaultValue || null);
1849
- const ref = React16.useRef(null);
2112
+ const [open, setOpen] = React19.useState(false);
2113
+ const [valueState, setValueState] = React19.useState(value || defaultValue || null);
2114
+ const ref = React19.useRef(null);
1850
2115
  useClickAway(ref, () => setOpen(false));
1851
- return /* @__PURE__ */ jsxs11(Control, { ...propsComponent?.control, children: [
1852
- /* @__PURE__ */ jsx33(
2116
+ return /* @__PURE__ */ jsxs14(Control, { ...propsComponent?.control, children: [
2117
+ /* @__PURE__ */ jsx36(
1853
2118
  Label,
1854
2119
  {
1855
2120
  ...propsComponent?.label,
@@ -1857,10 +2122,10 @@ var Select = ({ label, options, name, value, defaultValue, onChange, propsCompon
1857
2122
  className: open || valueState ? "yr3Input--active" : ""
1858
2123
  }
1859
2124
  ),
1860
- /* @__PURE__ */ jsxs11("div", { className: "yr3Select-wrapper", ref, children: [
1861
- /* @__PURE__ */ jsxs11("div", { className: `yr3Select ${open ? "yr3Select--open" : ""}`, "data-testid": "yr3Select-wrapper", style: composeStyles(propsComponent?.wrapper?.ui, propsComponent?.wrapper?.style), children: [
1862
- /* @__PURE__ */ jsx33("div", { className: "yr3Select--control", children: valueState }),
1863
- /* @__PURE__ */ jsx33("div", { className: "yr3Select--icon", onClick: () => setOpen((prev) => !prev), "data-testid": "yr3Select-icon", children: propsComponent?.icon?.component ? propsComponent.icon.component : /* @__PURE__ */ jsx33(
2125
+ /* @__PURE__ */ jsxs14("div", { className: "yr3Select-wrapper", ref, children: [
2126
+ /* @__PURE__ */ jsxs14("div", { className: `yr3Select ${open ? "yr3Select--open" : ""}`, "data-testid": "yr3Select-wrapper", style: composeStyles(propsComponent?.wrapper?.ui, propsComponent?.wrapper?.style), children: [
2127
+ /* @__PURE__ */ jsx36("div", { className: "yr3Select--control", children: valueState }),
2128
+ /* @__PURE__ */ jsx36("div", { className: "yr3Select--icon", onClick: () => setOpen((prev) => !prev), "data-testid": "yr3Select-icon", children: propsComponent?.icon?.component ? propsComponent.icon.component : /* @__PURE__ */ jsx36(
1864
2129
  IconDown,
1865
2130
  {
1866
2131
  width: propsComponent?.icon?.style?.width || 26,
@@ -1870,13 +2135,13 @@ var Select = ({ label, options, name, value, defaultValue, onChange, propsCompon
1870
2135
  }
1871
2136
  ) })
1872
2137
  ] }),
1873
- open && /* @__PURE__ */ jsx33(
2138
+ open && /* @__PURE__ */ jsx36(
1874
2139
  "div",
1875
2140
  {
1876
2141
  className: "yr3Select--menu",
1877
2142
  style: composeStyles(propsComponent?.menu?.ui, propsComponent?.menu?.style),
1878
2143
  "data-testid": "yr3Select-menu",
1879
- children: options.map((opt) => /* @__PURE__ */ jsx33(
2144
+ children: options.map((opt) => /* @__PURE__ */ jsx36(
1880
2145
  "div",
1881
2146
  {
1882
2147
  className: "yr3Select--option",
@@ -1908,8 +2173,8 @@ var Select = ({ label, options, name, value, defaultValue, onChange, propsCompon
1908
2173
  };
1909
2174
 
1910
2175
  // src/components/Slide/Slide.tsx
1911
- import * as React17 from "react";
1912
- import { jsx as jsx34 } from "react/jsx-runtime";
2176
+ import * as React20 from "react";
2177
+ import { jsx as jsx37 } from "react/jsx-runtime";
1913
2178
  var Slide = ({
1914
2179
  in: inProp,
1915
2180
  children,
@@ -1923,7 +2188,7 @@ var Slide = ({
1923
2188
  [direction]: true,
1924
2189
  "in": !!inProp
1925
2190
  });
1926
- React17.useEffect(() => {
2191
+ React20.useEffect(() => {
1927
2192
  let timeoutId;
1928
2193
  if (inProp) {
1929
2194
  timeoutId = setTimeout(() => {
@@ -1933,19 +2198,19 @@ var Slide = ({
1933
2198
  return () => clearTimeout(timeoutId);
1934
2199
  }, [inProp, duration, onTransitionEnd]);
1935
2200
  const uiStyleContent = uiStyle({ ...propsComponent?.slide?.ui, transitionDuration: `${duration}ms` });
1936
- return /* @__PURE__ */ jsx34(
2201
+ return /* @__PURE__ */ jsx37(
1937
2202
  "div",
1938
2203
  {
1939
2204
  className: "yr3Slide",
1940
2205
  style: uiStyle({ position: "relative", zIndex: 4, overflow: "hidden" }),
1941
2206
  "data-testid": "yr3Slide",
1942
- children: /* @__PURE__ */ jsx34(
2207
+ children: /* @__PURE__ */ jsx37(
1943
2208
  "div",
1944
2209
  {
1945
2210
  className: classNameContent,
1946
2211
  style: composeStyles(uiStyleContent, propsComponent?.slide?.style || {}),
1947
2212
  "data-testid": "yr3Slide-content",
1948
- children: /* @__PURE__ */ jsx34(Box, { ...propsComponent?.box, "data-testid": "yr3Slide-box", children })
2213
+ children: /* @__PURE__ */ jsx37(Box, { ...propsComponent?.box, "data-testid": "yr3Slide-box", children })
1949
2214
  }
1950
2215
  )
1951
2216
  }
@@ -1953,7 +2218,7 @@ var Slide = ({
1953
2218
  };
1954
2219
 
1955
2220
  // src/components/Switch/Switch.tsx
1956
- import * as React18 from "react";
2221
+ import * as React21 from "react";
1957
2222
 
1958
2223
  // src/components/Switch/switch.variants.ts
1959
2224
  var switchVariants = createVariants({
@@ -1982,7 +2247,7 @@ var switchVariants = createVariants({
1982
2247
  });
1983
2248
 
1984
2249
  // src/components/Switch/Switch.tsx
1985
- import { jsx as jsx35, jsxs as jsxs12 } from "react/jsx-runtime";
2250
+ import { jsx as jsx38, jsxs as jsxs15 } from "react/jsx-runtime";
1986
2251
  var Switch = ({
1987
2252
  checked,
1988
2253
  defaultChecked,
@@ -1992,7 +2257,7 @@ var Switch = ({
1992
2257
  size = "sm",
1993
2258
  label
1994
2259
  }) => {
1995
- const [internal, setInternal] = React18.useState(defaultChecked || false);
2260
+ const [internal, setInternal] = React21.useState(defaultChecked || false);
1996
2261
  const classname = switchVariants({ colors: color, size, disabled: !!disabled, checked: checked ?? internal });
1997
2262
  const isControlled = checked !== void 0;
1998
2263
  const value = isControlled ? checked : internal;
@@ -2000,13 +2265,13 @@ var Switch = ({
2000
2265
  if (!isControlled) setInternal(e.target.checked);
2001
2266
  onChange?.(e, e.target.checked);
2002
2267
  };
2003
- return /* @__PURE__ */ jsxs12(
2268
+ return /* @__PURE__ */ jsxs15(
2004
2269
  "label",
2005
2270
  {
2006
2271
  className: classname,
2007
2272
  "data-testid": "yr3Switch",
2008
2273
  children: [
2009
- /* @__PURE__ */ jsx35(
2274
+ /* @__PURE__ */ jsx38(
2010
2275
  "input",
2011
2276
  {
2012
2277
  type: "checkbox",
@@ -2015,17 +2280,17 @@ var Switch = ({
2015
2280
  disabled
2016
2281
  }
2017
2282
  ),
2018
- /* @__PURE__ */ jsx35("span", { className: "yr3Switch--track", children: /* @__PURE__ */ jsx35("span", { className: "yr3Switch--thumb" }) }),
2019
- /* @__PURE__ */ jsx35("span", { className: "yr3Switch--label", "data-testid": "yr3Switch-label", children: label })
2283
+ /* @__PURE__ */ jsx38("span", { className: "yr3Switch--track", children: /* @__PURE__ */ jsx38("span", { className: "yr3Switch--thumb" }) }),
2284
+ /* @__PURE__ */ jsx38("span", { className: "yr3Switch--label", "data-testid": "yr3Switch-label", children: label })
2020
2285
  ]
2021
2286
  }
2022
2287
  );
2023
2288
  };
2024
2289
 
2025
2290
  // src/Icons/IconSearch.tsx
2026
- import { jsx as jsx36 } from "react/jsx-runtime";
2291
+ import { jsx as jsx39 } from "react/jsx-runtime";
2027
2292
  var IconSearch = (props) => {
2028
- return /* @__PURE__ */ jsx36("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__ */ jsx36(
2293
+ 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(
2029
2294
  "path",
2030
2295
  {
2031
2296
  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",
@@ -2056,11 +2321,11 @@ var baseTokens = {
2056
2321
  };
2057
2322
 
2058
2323
  // src/theme/notistackContext.tsx
2059
- import * as React19 from "react";
2060
- import { jsx as jsx37, jsxs as jsxs13 } from "react/jsx-runtime";
2061
- var NotistackContext = React19.createContext(null);
2324
+ import * as React22 from "react";
2325
+ import { jsx as jsx40, jsxs as jsxs16 } from "react/jsx-runtime";
2326
+ var NotistackContext = React22.createContext(null);
2062
2327
  var NotistackProvider = ({ children }) => {
2063
- const [snacks, setSnacks] = React19.useState([]);
2328
+ const [snacks, setSnacks] = React22.useState([]);
2064
2329
  const enqueueNotistack = (snack) => {
2065
2330
  const id = Date.now();
2066
2331
  setSnacks((prev) => [...prev, { ...snack, id, exiting: false }]);
@@ -2075,23 +2340,23 @@ var NotistackProvider = ({ children }) => {
2075
2340
  setSnacks((prev) => prev.filter((s) => s.id !== id));
2076
2341
  }, duration + exitDuration);
2077
2342
  };
2078
- return /* @__PURE__ */ jsxs13(NotistackContext.Provider, { value: { enqueueNotistack }, children: [
2343
+ return /* @__PURE__ */ jsxs16(NotistackContext.Provider, { value: { enqueueNotistack }, children: [
2079
2344
  children,
2080
- /* @__PURE__ */ jsx37("div", { className: "yr3NotistackContainer", children: snacks.map((snack) => /* @__PURE__ */ jsx37(Notistack, { ...snack }, snack.id)) })
2345
+ /* @__PURE__ */ jsx40("div", { className: "yr3NotistackContainer", children: snacks.map((snack) => /* @__PURE__ */ jsx40(Notistack, { ...snack }, snack.id)) })
2081
2346
  ] });
2082
2347
  };
2083
- var useNotistack = () => React19.useContext(NotistackContext);
2348
+ var useNotistack = () => React22.useContext(NotistackContext);
2084
2349
 
2085
2350
  // src/theme/useMediaQuery.tsx
2086
- import * as React20 from "react";
2351
+ import * as React23 from "react";
2087
2352
  function useMediaQuery(query) {
2088
2353
  const theme = useTheme();
2089
2354
  const computedQuery = typeof query === "function" ? query(theme) : query;
2090
- const [matches, setMatches] = React20.useState(() => {
2355
+ const [matches, setMatches] = React23.useState(() => {
2091
2356
  if (typeof window === "undefined") return false;
2092
2357
  return window.matchMedia(computedQuery).matches;
2093
2358
  });
2094
- React20.useEffect(() => {
2359
+ React23.useEffect(() => {
2095
2360
  if (typeof window === "undefined") return;
2096
2361
  const media = window.matchMedia(computedQuery);
2097
2362
  const listener = () => setMatches(media.matches);
@@ -2140,7 +2405,9 @@ export {
2140
2405
  IconDown,
2141
2406
  IconSearch,
2142
2407
  Image,
2408
+ ImageDropzone,
2143
2409
  Input,
2410
+ InputArea,
2144
2411
  Label,
2145
2412
  Modal,
2146
2413
  ModalContainer,
@@ -2148,6 +2415,7 @@ export {
2148
2415
  NotistackProvider,
2149
2416
  Pending,
2150
2417
  Phone,
2418
+ PlacesAutocomplete,
2151
2419
  Radio,
2152
2420
  Select,
2153
2421
  Slide,