thailife-react 0.0.3 → 0.0.4

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
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var React = require('react');
3
+ var require$$0 = require('react');
4
4
 
5
5
  function styleInject(css, ref) {
6
6
  if ( ref === void 0 ) ref = {};
@@ -115,7 +115,7 @@ var hasRequiredReactJsxRuntime_production_min;
115
115
  function requireReactJsxRuntime_production_min () {
116
116
  if (hasRequiredReactJsxRuntime_production_min) return reactJsxRuntime_production_min;
117
117
  hasRequiredReactJsxRuntime_production_min = 1;
118
- var f=React,k=Symbol.for("react.element"),l=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:true,ref:true,__self:true,__source:true};
118
+ var f=require$$0,k=Symbol.for("react.element"),l=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:true,ref:true,__self:true,__source:true};
119
119
  function q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=""+g);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a) void 0===d[b]&&(d[b]=a[b]);return {$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}reactJsxRuntime_production_min.Fragment=l;reactJsxRuntime_production_min.jsx=q;reactJsxRuntime_production_min.jsxs=q;
120
120
  return reactJsxRuntime_production_min;
121
121
  }
@@ -141,7 +141,7 @@ function requireReactJsxRuntime_development () {
141
141
  if (process.env.NODE_ENV !== "production") {
142
142
  (function() {
143
143
 
144
- var React$1 = React;
144
+ var React = require$$0;
145
145
 
146
146
  // ATTENTION
147
147
  // When adding new symbols to this file,
@@ -176,7 +176,7 @@ function requireReactJsxRuntime_development () {
176
176
  return null;
177
177
  }
178
178
 
179
- var ReactSharedInternals = React$1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
179
+ var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
180
180
 
181
181
  function error(format) {
182
182
  {
@@ -1464,8 +1464,8 @@ function cn() {
1464
1464
  return clsx(inputs);
1465
1465
  }
1466
1466
 
1467
- const _excluded$6 = ["className", "color", "variant", "size", "fullWidth", "loading", "disabled", "children"];
1468
- const Button = /*#__PURE__*/React.forwardRef((_ref, ref) => {
1467
+ const _excluded = ["className", "color", "variant", "size", "fullWidth", "loading", "disabled", "children"];
1468
+ const Button = /*#__PURE__*/require$$0.forwardRef((_ref, ref) => {
1469
1469
  let {
1470
1470
  className,
1471
1471
  color = "primary",
@@ -1476,7 +1476,7 @@ const Button = /*#__PURE__*/React.forwardRef((_ref, ref) => {
1476
1476
  disabled,
1477
1477
  children
1478
1478
  } = _ref,
1479
- props = _objectWithoutProperties(_ref, _excluded$6);
1479
+ props = _objectWithoutProperties(_ref, _excluded);
1480
1480
  const baseClasses = cn(className, "btn transition-all duration-300 flex items-center justify-center");
1481
1481
  const variants = {
1482
1482
  contained: {
@@ -1513,315 +1513,6 @@ const Button = /*#__PURE__*/React.forwardRef((_ref, ref) => {
1513
1513
  });
1514
1514
  Button.displayName = "Button";
1515
1515
 
1516
- const _excluded$5 = ["className", "type", "label", "error", "helperText", "size", "fullWidth", "id"];
1517
- const Input = /*#__PURE__*/React.forwardRef((_ref, ref) => {
1518
- let {
1519
- className,
1520
- type = "text",
1521
- label,
1522
- error,
1523
- helperText,
1524
- size = "md",
1525
- fullWidth = false,
1526
- id
1527
- } = _ref,
1528
- props = _objectWithoutProperties(_ref, _excluded$5);
1529
- const inputId = id || "input-".concat(Math.random().toString(36).substr(2, 9));
1530
- const sizes = {
1531
- sm: "px-3 py-1.5 text-sm",
1532
- md: "px-4 py-2 text-sm",
1533
- lg: "px-4 py-3 text-base"
1534
- };
1535
- const baseClasses = cn("border transition-colors focus:outline-none focus:border-transparent", error ? "border-red-500 focus:ring-red-500" : "border-secondary focus:border-primary", "disabled:opacity-50 disabled:cursor-not-allowed disabled:bg-secondary-50", sizes[size], fullWidth && "w-full", className);
1536
- return jsxRuntimeExports.jsxs("div", {
1537
- className: cn("flex flex-col", fullWidth && "w-full"),
1538
- children: [label && jsxRuntimeExports.jsx("label", {
1539
- htmlFor: inputId,
1540
- className: "mb-1 text-sm font-medium text-secondary-700",
1541
- children: label
1542
- }), jsxRuntimeExports.jsx("input", _objectSpread2({
1543
- type: type,
1544
- className: baseClasses,
1545
- ref: ref,
1546
- id: inputId
1547
- }, props)), (error || helperText) && jsxRuntimeExports.jsx("p", {
1548
- className: cn("mt-1 text-xs", error ? "text-red-600" : "text-secondary-500"),
1549
- children: error || helperText
1550
- })]
1551
- });
1552
- });
1553
- Input.displayName = "Input";
1554
-
1555
- const _excluded$4 = ["className", "label", "error", "helperText", "size", "fullWidth", "rows", "id"];
1556
- const Textarea = /*#__PURE__*/React.forwardRef((_ref, ref) => {
1557
- let {
1558
- className,
1559
- label,
1560
- error,
1561
- helperText,
1562
- size = "md",
1563
- fullWidth = false,
1564
- rows = 3,
1565
- id
1566
- } = _ref,
1567
- props = _objectWithoutProperties(_ref, _excluded$4);
1568
- const textareaId = id || "textarea-".concat(Math.random().toString(36).substr(2, 9));
1569
- const sizes = {
1570
- sm: "px-3 py-1.5 text-sm",
1571
- md: "px-4 py-2 text-sm",
1572
- lg: "px-4 py-3 text-base"
1573
- };
1574
- const baseClasses = cn("border transition-colors focus:outline-none focus:border-transparent resize-vertical", error ? "border-red-500 focus:ring-red-500" : "border-secondary focus:border-primary", "disabled:opacity-50 disabled:cursor-not-allowed disabled:bg-secondary-50", sizes[size], fullWidth && "w-full", className);
1575
- return jsxRuntimeExports.jsxs("div", {
1576
- className: cn("flex flex-col", fullWidth && "w-full"),
1577
- children: [label && jsxRuntimeExports.jsx("label", {
1578
- htmlFor: textareaId,
1579
- className: "mb-1 text-sm font-medium text-secondary-700",
1580
- children: label
1581
- }), jsxRuntimeExports.jsx("textarea", _objectSpread2({
1582
- className: baseClasses,
1583
- ref: ref,
1584
- id: textareaId,
1585
- rows: rows
1586
- }, props)), (error || helperText) && jsxRuntimeExports.jsx("p", {
1587
- className: cn("mt-1 text-xs", error ? "text-red-600" : "text-secondary-500"),
1588
- children: error || helperText
1589
- })]
1590
- });
1591
- });
1592
- Textarea.displayName = "Textarea";
1593
-
1594
- const _excluded$3 = ["className", "label", "error", "helperText", "size", "fullWidth", "accept", "multiple", "buttonText", "id"];
1595
- const InputFile = /*#__PURE__*/React.forwardRef((_ref, ref) => {
1596
- let {
1597
- className,
1598
- label,
1599
- error,
1600
- helperText,
1601
- size = "md",
1602
- fullWidth = false,
1603
- accept,
1604
- multiple = false,
1605
- buttonText = "Choose File",
1606
- id
1607
- } = _ref,
1608
- props = _objectWithoutProperties(_ref, _excluded$3);
1609
- const inputId = id || "file-input-".concat(Math.random().toString(36).substr(2, 9));
1610
- const sizes = {
1611
- sm: "px-3 py-1.5 text-sm",
1612
- md: "px-4 py-2 text-sm",
1613
- lg: "px-4 py-3 text-base"
1614
- };
1615
- const baseClasses = cn("border-2 border-dashed transition-colors focus:outline-none focus:border-transparent cursor-pointer", error ? "border-red-500 focus:ring-red-500 hover:border-red-400" : "border-secondary focus:border-primary hover:border-primary/60", "disabled:opacity-50 disabled:cursor-not-allowed disabled:bg-secondary-50", sizes[size], fullWidth && "w-full", className);
1616
- return jsxRuntimeExports.jsxs("div", {
1617
- className: cn("flex flex-col", fullWidth && "w-full"),
1618
- children: [label && jsxRuntimeExports.jsx("label", {
1619
- htmlFor: inputId,
1620
- className: "mb-1 text-sm font-medium text-secondary-700",
1621
- children: label
1622
- }), jsxRuntimeExports.jsxs("div", {
1623
- className: "relative",
1624
- children: [jsxRuntimeExports.jsx("input", _objectSpread2({
1625
- type: "file",
1626
- className: "absolute inset-0 w-full h-full opacity-0 cursor-pointer",
1627
- ref: ref,
1628
- id: inputId,
1629
- accept: accept,
1630
- multiple: multiple
1631
- }, props)), jsxRuntimeExports.jsxs("div", {
1632
- className: cn(baseClasses, "flex items-center justify-center"),
1633
- children: [jsxRuntimeExports.jsx("span", {
1634
- className: "text-secondary-600",
1635
- children: buttonText
1636
- }), multiple && jsxRuntimeExports.jsx("span", {
1637
- className: "ml-1 text-xs text-secondary-500",
1638
- children: "(Multiple)"
1639
- })]
1640
- })]
1641
- }), (error || helperText) && jsxRuntimeExports.jsx("p", {
1642
- className: cn("mt-1 text-xs", error ? "text-red-600" : "text-secondary-500"),
1643
- children: error || helperText
1644
- })]
1645
- });
1646
- });
1647
- InputFile.displayName = "InputFile";
1648
-
1649
- const _excluded$2 = ["className", "label", "error", "helperText", "size", "fullWidth", "indeterminate", "id"];
1650
- const Checkbox = /*#__PURE__*/React.forwardRef((_ref, ref) => {
1651
- let {
1652
- className,
1653
- label,
1654
- error,
1655
- helperText,
1656
- size = "md",
1657
- fullWidth = false,
1658
- indeterminate = false,
1659
- id
1660
- } = _ref,
1661
- props = _objectWithoutProperties(_ref, _excluded$2);
1662
- const checkboxId = id || "checkbox-".concat(Math.random().toString(36).substr(2, 9));
1663
- const sizes = {
1664
- sm: "w-4 h-4",
1665
- md: "w-5 h-5",
1666
- lg: "w-6 h-6"
1667
- };
1668
- const labelSizes = {
1669
- sm: "text-sm",
1670
- md: "text-sm",
1671
- lg: "text-base"
1672
- };
1673
- const baseClasses = cn("rounded border transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2", error ? "border-red-500 focus:ring-red-500" : "border-secondary focus:ring-primary", "disabled:opacity-50 disabled:cursor-not-allowed", sizes[size], className);
1674
- React.useEffect(() => {
1675
- if (ref && typeof ref === "object" && ref.current) {
1676
- ref.current.indeterminate = indeterminate;
1677
- }
1678
- }, [indeterminate, ref]);
1679
- return jsxRuntimeExports.jsxs("div", {
1680
- className: cn("flex items-start", fullWidth && "w-full"),
1681
- children: [jsxRuntimeExports.jsx("div", {
1682
- className: "flex items-center h-5",
1683
- children: jsxRuntimeExports.jsx("input", _objectSpread2({
1684
- type: "checkbox",
1685
- className: baseClasses,
1686
- ref: ref,
1687
- id: checkboxId
1688
- }, props))
1689
- }), jsxRuntimeExports.jsxs("div", {
1690
- className: "ml-3",
1691
- children: [label && jsxRuntimeExports.jsx("label", {
1692
- htmlFor: checkboxId,
1693
- className: cn("font-medium text-secondary-700 cursor-pointer", labelSizes[size]),
1694
- children: label
1695
- }), (error || helperText) && jsxRuntimeExports.jsx("p", {
1696
- className: cn("mt-1 text-xs", error ? "text-red-600" : "text-secondary-500"),
1697
- children: error || helperText
1698
- })]
1699
- })]
1700
- });
1701
- });
1702
- Checkbox.displayName = "Checkbox";
1703
-
1704
- const _excluded$1 = ["className", "label", "error", "helperText", "size", "fullWidth", "id"];
1705
- const Radio = /*#__PURE__*/React.forwardRef((_ref, ref) => {
1706
- let {
1707
- className,
1708
- label,
1709
- error,
1710
- helperText,
1711
- size = "md",
1712
- fullWidth = false,
1713
- id
1714
- } = _ref,
1715
- props = _objectWithoutProperties(_ref, _excluded$1);
1716
- const radioId = id || "radio-".concat(Math.random().toString(36).substr(2, 9));
1717
- const sizes = {
1718
- sm: "w-4 h-4",
1719
- md: "w-5 h-5",
1720
- lg: "w-6 h-6"
1721
- };
1722
- const labelSizes = {
1723
- sm: "text-sm",
1724
- md: "text-sm",
1725
- lg: "text-base"
1726
- };
1727
- const baseClasses = cn("border-2 transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2", error ? "border-red-500 focus:ring-red-500" : "border-secondary focus:ring-primary", "disabled:opacity-50 disabled:cursor-not-allowed", sizes[size], className);
1728
- return jsxRuntimeExports.jsxs("div", {
1729
- className: cn("flex items-start", fullWidth && "w-full"),
1730
- children: [jsxRuntimeExports.jsx("div", {
1731
- className: "flex items-center h-5",
1732
- children: jsxRuntimeExports.jsx("input", _objectSpread2({
1733
- type: "radio",
1734
- className: baseClasses,
1735
- ref: ref,
1736
- id: radioId
1737
- }, props))
1738
- }), jsxRuntimeExports.jsxs("div", {
1739
- className: "ml-3",
1740
- children: [label && jsxRuntimeExports.jsx("label", {
1741
- htmlFor: radioId,
1742
- className: cn("font-medium text-secondary-700 cursor-pointer", labelSizes[size]),
1743
- children: label
1744
- }), (error || helperText) && jsxRuntimeExports.jsx("p", {
1745
- className: cn("mt-1 text-xs", error ? "text-red-600" : "text-secondary-500"),
1746
- children: error || helperText
1747
- })]
1748
- })]
1749
- });
1750
- });
1751
- Radio.displayName = "Radio";
1752
-
1753
- const _excluded = ["className", "label", "error", "helperText", "size", "fullWidth", "options", "placeholder", "id"];
1754
- const Select = /*#__PURE__*/React.forwardRef((_ref, ref) => {
1755
- let {
1756
- className,
1757
- label,
1758
- error,
1759
- helperText,
1760
- size = "md",
1761
- fullWidth = false,
1762
- options,
1763
- placeholder,
1764
- id
1765
- } = _ref,
1766
- props = _objectWithoutProperties(_ref, _excluded);
1767
- const selectId = id || "select-".concat(Math.random().toString(36).substr(2, 9));
1768
- const sizes = {
1769
- sm: "px-3 py-1.5 text-sm",
1770
- md: "px-4 py-2 text-sm",
1771
- lg: "px-4 py-3 text-base"
1772
- };
1773
- const baseClasses = cn("border transition-colors focus:outline-none focus:border-transparent appearance-none bg-white", error ? "border-red-500 focus:ring-red-500" : "border-secondary focus:border-primary", "disabled:opacity-50 disabled:cursor-not-allowed disabled:bg-secondary-50", sizes[size], fullWidth && "w-full", className);
1774
- return jsxRuntimeExports.jsxs("div", {
1775
- className: cn("flex flex-col", fullWidth && "w-full"),
1776
- children: [label && jsxRuntimeExports.jsx("label", {
1777
- htmlFor: selectId,
1778
- className: "mb-1 text-sm font-medium text-secondary-700",
1779
- children: label
1780
- }), jsxRuntimeExports.jsxs("div", {
1781
- className: "relative",
1782
- children: [jsxRuntimeExports.jsxs("select", _objectSpread2(_objectSpread2({
1783
- className: baseClasses,
1784
- ref: ref,
1785
- id: selectId
1786
- }, props), {}, {
1787
- children: [placeholder && jsxRuntimeExports.jsx("option", {
1788
- value: "",
1789
- disabled: true,
1790
- children: placeholder
1791
- }), options.map(option => jsxRuntimeExports.jsx("option", {
1792
- value: option.value,
1793
- disabled: option.disabled,
1794
- children: option.label
1795
- }, option.value))]
1796
- })), jsxRuntimeExports.jsx("div", {
1797
- className: "absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",
1798
- children: jsxRuntimeExports.jsx("svg", {
1799
- className: "w-4 h-4 text-secondary-400",
1800
- fill: "none",
1801
- stroke: "currentColor",
1802
- viewBox: "0 0 24 24",
1803
- children: jsxRuntimeExports.jsx("path", {
1804
- strokeLinecap: "round",
1805
- strokeLinejoin: "round",
1806
- strokeWidth: 2,
1807
- d: "M19 9l-7 7-7-7"
1808
- })
1809
- })
1810
- })]
1811
- }), (error || helperText) && jsxRuntimeExports.jsx("p", {
1812
- className: cn("mt-1 text-xs", error ? "text-red-600" : "text-secondary-500"),
1813
- children: error || helperText
1814
- })]
1815
- });
1816
- });
1817
- Select.displayName = "Select";
1818
-
1819
1516
  exports.Button = Button;
1820
- exports.Checkbox = Checkbox;
1821
- exports.Input = Input;
1822
- exports.InputFile = InputFile;
1823
- exports.Radio = Radio;
1824
- exports.Select = Select;
1825
- exports.Textarea = Textarea;
1826
1517
  exports.cn = cn;
1827
1518
  //# sourceMappingURL=index.js.map