thailife-react 0.0.11 → 0.0.13
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/Button/Button.d.ts.map +1 -1
- package/dist/components/Button/Button.stories.d.ts +8 -1
- package/dist/components/Button/Button.stories.d.ts.map +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/Input/Input.d.ts.map +1 -1
- package/dist/components/Input/Input.stories.d.ts +8 -1
- package/dist/components/Input/Input.stories.d.ts.map +1 -1
- package/dist/components/InputFile/InputFile.d.ts.map +1 -1
- package/dist/components/Radio/Radio.d.ts.map +1 -1
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Textarea/Textarea.d.ts.map +1 -1
- package/dist/components/Textarea/Textarea.stories.d.ts +5 -0
- package/dist/components/Textarea/Textarea.stories.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +851 -210
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +852 -210
- package/dist/index.js.map +1 -1
- package/dist/styles/ThemeProvider.d.ts +7 -0
- package/dist/styles/ThemeProvider.d.ts.map +1 -0
- package/dist/styles/index.d.ts +4 -0
- package/dist/styles/index.d.ts.map +1 -0
- package/dist/styles/theme.d.ts +87 -0
- package/dist/styles/theme.d.ts.map +1 -0
- package/package.json +7 -7
- package/dist/utils/cn.d.ts +0 -7
- package/dist/utils/cn.d.ts.map +0 -1
package/dist/index.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
|
+
var styled = require('styled-components');
|
|
6
7
|
|
|
7
8
|
function _interopNamespaceDefault(e) {
|
|
8
9
|
var n = Object.create(null);
|
|
@@ -23,36 +24,6 @@ function _interopNamespaceDefault(e) {
|
|
|
23
24
|
|
|
24
25
|
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
25
26
|
|
|
26
|
-
function styleInject(css, ref) {
|
|
27
|
-
if ( ref === void 0 ) ref = {};
|
|
28
|
-
var insertAt = ref.insertAt;
|
|
29
|
-
|
|
30
|
-
if (typeof document === 'undefined') { return; }
|
|
31
|
-
|
|
32
|
-
var head = document.head || document.getElementsByTagName('head')[0];
|
|
33
|
-
var style = document.createElement('style');
|
|
34
|
-
style.type = 'text/css';
|
|
35
|
-
|
|
36
|
-
if (insertAt === 'top') {
|
|
37
|
-
if (head.firstChild) {
|
|
38
|
-
head.insertBefore(style, head.firstChild);
|
|
39
|
-
} else {
|
|
40
|
-
head.appendChild(style);
|
|
41
|
-
}
|
|
42
|
-
} else {
|
|
43
|
-
head.appendChild(style);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
if (style.styleSheet) {
|
|
47
|
-
style.styleSheet.cssText = css;
|
|
48
|
-
} else {
|
|
49
|
-
style.appendChild(document.createTextNode(css));
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
var css_248z = "*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:\"\"}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:Inter,system-ui,sans-serif;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.pointer-events-none{pointer-events:none}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.inset-y-0{bottom:0;top:0}.right-0{right:0}.mb-1{margin-bottom:.25rem}.ml-1{margin-left:.25rem}.ml-3{margin-left:.75rem}.mt-1{margin-top:.25rem}.flex{display:flex}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-full{height:100%}.w-4{width:1rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-full{width:100%}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-center{justify-content:center}.rounded{border-radius:.25rem}.border{border-width:1px}.border-2{border-width:2px}.border-dashed{border-style:dashed}.border-dark{--tw-border-opacity:1;border-color:rgb(51 51 51/var(--tw-border-opacity,1))}.border-error{--tw-border-opacity:1;border-color:rgb(255 17 0/var(--tw-border-opacity,1))}.border-light{--tw-border-opacity:1;border-color:rgb(102 102 102/var(--tw-border-opacity,1))}.border-primary{--tw-border-opacity:1;border-color:rgb(0 122 194/var(--tw-border-opacity,1))}.border-red-500{--tw-border-opacity:1;border-color:rgb(239 68 68/var(--tw-border-opacity,1))}.bg-dark{--tw-bg-opacity:1;background-color:rgb(51 51 51/var(--tw-bg-opacity,1))}.bg-error{--tw-bg-opacity:1;background-color:rgb(255 17 0/var(--tw-bg-opacity,1))}.bg-light{--tw-bg-opacity:1;background-color:rgb(102 102 102/var(--tw-bg-opacity,1))}.bg-primary{--tw-bg-opacity:1;background-color:rgb(0 122 194/var(--tw-bg-opacity,1))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.py-3{padding-bottom:.75rem;padding-top:.75rem}.pr-3{padding-right:.75rem}.text-base{font-size:1rem;line-height:1.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-medium{font-weight:500}.text-dark{--tw-text-opacity:1;color:rgb(51 51 51/var(--tw-text-opacity,1))}.text-error{--tw-text-opacity:1;color:rgb(255 17 0/var(--tw-text-opacity,1))}.text-light{--tw-text-opacity:1;color:rgb(102 102 102/var(--tw-text-opacity,1))}.text-primary{--tw-text-opacity:1;color:rgb(0 122 194/var(--tw-text-opacity,1))}.text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity,1))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.underline{text-decoration-line:underline}.opacity-0{opacity:0}.opacity-50{opacity:.5}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-300{transition-duration:.3s}.hover\\:border-primary\\/60:hover{border-color:rgba(0,122,194,.6)}.hover\\:border-red-400:hover{--tw-border-opacity:1;border-color:rgb(248 113 113/var(--tw-border-opacity,1))}.hover\\:bg-dark\\/10:hover{background-color:rgba(51,51,51,.1)}.hover\\:bg-dark\\/80:hover{background-color:rgba(51,51,51,.8)}.hover\\:bg-error\\/10:hover{background-color:rgba(255,17,0,.1)}.hover\\:bg-error\\/80:hover{background-color:rgba(255,17,0,.8)}.hover\\:bg-light\\/10:hover{background-color:hsla(0,0%,40%,.1)}.hover\\:bg-light\\/80:hover{background-color:hsla(0,0%,40%,.8)}.hover\\:bg-primary\\/10:hover{background-color:rgba(0,122,194,.1)}.hover\\:bg-primary\\/80:hover{background-color:rgba(0,122,194,.8)}.focus\\:border-primary:focus{--tw-border-opacity:1;border-color:rgb(0 122 194/var(--tw-border-opacity,1))}.focus\\:border-transparent:focus{border-color:transparent}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus\\:ring-primary:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(0 122 194/var(--tw-ring-opacity,1))}.focus\\:ring-red-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(239 68 68/var(--tw-ring-opacity,1))}.focus\\:ring-offset-2:focus{--tw-ring-offset-width:2px}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-50:disabled{opacity:.5}";
|
|
54
|
-
styleInject(css_248z,{"insertAt":"top"});
|
|
55
|
-
|
|
56
27
|
function _defineProperty(e, r, t) {
|
|
57
28
|
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
58
29
|
value: t,
|
|
@@ -102,6 +73,13 @@ function _objectWithoutPropertiesLoose(r, e) {
|
|
|
102
73
|
}
|
|
103
74
|
return t;
|
|
104
75
|
}
|
|
76
|
+
function _taggedTemplateLiteral(e, t) {
|
|
77
|
+
return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, {
|
|
78
|
+
raw: {
|
|
79
|
+
value: Object.freeze(t)
|
|
80
|
+
}
|
|
81
|
+
}));
|
|
82
|
+
}
|
|
105
83
|
function _toPrimitive(t, r) {
|
|
106
84
|
if ("object" != typeof t || !t) return t;
|
|
107
85
|
var e = t[Symbol.toPrimitive];
|
|
@@ -1478,21 +1456,66 @@ if (process.env.NODE_ENV === 'production') {
|
|
|
1478
1456
|
|
|
1479
1457
|
var jsxRuntimeExports = jsxRuntime.exports;
|
|
1480
1458
|
|
|
1481
|
-
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
|
|
1482
|
-
|
|
1483
|
-
/**
|
|
1484
|
-
* Utility function to merge Tailwind CSS classes
|
|
1485
|
-
* Uses clsx for conditional classes and basic merging
|
|
1486
|
-
*/
|
|
1487
|
-
function cn() {
|
|
1488
|
-
for (var _len = arguments.length, inputs = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1489
|
-
inputs[_key] = arguments[_key];
|
|
1490
|
-
}
|
|
1491
|
-
return clsx(inputs);
|
|
1492
|
-
}
|
|
1493
|
-
|
|
1494
1459
|
const _excluded$6 = ["className", "color", "variant", "size", "fullWidth", "loading", "disabled", "children"];
|
|
1495
|
-
|
|
1460
|
+
var _templateObject$6, _templateObject2$6, _templateObject3$6, _templateObject4$6, _templateObject5$6, _templateObject6$6, _templateObject7$6, _templateObject8$6, _templateObject9$6, _templateObject0$6;
|
|
1461
|
+
const StyledButton = styled.button(_templateObject$6 || (_templateObject$6 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n justify-content: center;\n border: none;\n border-radius: ", ";\n font-family: ", ";\n font-weight: 500;\n cursor: pointer;\n transition: all ", ";\n outline: none;\n\n &:focus-visible {\n outline: 2px solid ", ";\n outline-offset: 2px;\n }\n\n &:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n ", "\n\n ", "\n\n ", "\n"])), _ref => {
|
|
1462
|
+
let {
|
|
1463
|
+
theme
|
|
1464
|
+
} = _ref;
|
|
1465
|
+
return theme.borderRadius.md;
|
|
1466
|
+
}, _ref2 => {
|
|
1467
|
+
let {
|
|
1468
|
+
theme
|
|
1469
|
+
} = _ref2;
|
|
1470
|
+
return theme.fontFamily.sans.join(", ");
|
|
1471
|
+
}, _ref3 => {
|
|
1472
|
+
let {
|
|
1473
|
+
theme
|
|
1474
|
+
} = _ref3;
|
|
1475
|
+
return theme.transitions.base;
|
|
1476
|
+
}, _ref4 => {
|
|
1477
|
+
let {
|
|
1478
|
+
theme
|
|
1479
|
+
} = _ref4;
|
|
1480
|
+
return theme.colors.primary;
|
|
1481
|
+
}, _ref5 => {
|
|
1482
|
+
let {
|
|
1483
|
+
variant,
|
|
1484
|
+
color,
|
|
1485
|
+
theme
|
|
1486
|
+
} = _ref5;
|
|
1487
|
+
if (variant === "contained") {
|
|
1488
|
+
return styled.css(_templateObject2$6 || (_templateObject2$6 = _taggedTemplateLiteral(["\n background-color: ", ";\n color: ", ";\n &:hover:not(:disabled) {\n background-color: ", "cc;\n }\n "])), theme.colors[color || "primary"], theme.colors.white, theme.colors[color || "primary"]);
|
|
1489
|
+
}
|
|
1490
|
+
if (variant === "outlined") {
|
|
1491
|
+
return styled.css(_templateObject3$6 || (_templateObject3$6 = _taggedTemplateLiteral(["\n background-color: transparent;\n border: 1px solid ", ";\n color: ", ";\n &:hover:not(:disabled) {\n background-color: ", "1a;\n }\n "])), theme.colors[color || "primary"], theme.colors[color || "primary"], theme.colors[color || "primary"]);
|
|
1492
|
+
}
|
|
1493
|
+
if (variant === "link") {
|
|
1494
|
+
return styled.css(_templateObject4$6 || (_templateObject4$6 = _taggedTemplateLiteral(["\n background-color: transparent;\n color: ", ";\n text-decoration: underline;\n &:hover:not(:disabled) {\n text-decoration: none;\n }\n "])), theme.colors[color || "primary"]);
|
|
1495
|
+
}
|
|
1496
|
+
return styled.css(_templateObject5$6 || (_templateObject5$6 = _taggedTemplateLiteral([""])));
|
|
1497
|
+
}, _ref6 => {
|
|
1498
|
+
let {
|
|
1499
|
+
size,
|
|
1500
|
+
theme
|
|
1501
|
+
} = _ref6;
|
|
1502
|
+
if (size === "sm") {
|
|
1503
|
+
return styled.css(_templateObject6$6 || (_templateObject6$6 = _taggedTemplateLiteral(["\n padding: ", " ", ";\n font-size: ", ";\n "])), theme.spacing[3], theme.spacing[3], theme.fontSize.sm);
|
|
1504
|
+
}
|
|
1505
|
+
if (size === "md") {
|
|
1506
|
+
return styled.css(_templateObject7$6 || (_templateObject7$6 = _taggedTemplateLiteral(["\n padding: ", " ", ";\n font-size: ", ";\n "])), theme.spacing[2], theme.spacing[4], theme.fontSize.sm);
|
|
1507
|
+
}
|
|
1508
|
+
if (size === "lg") {
|
|
1509
|
+
return styled.css(_templateObject8$6 || (_templateObject8$6 = _taggedTemplateLiteral(["\n padding: ", " ", ";\n font-size: ", ";\n "])), theme.spacing[3], theme.spacing[6], theme.fontSize.base);
|
|
1510
|
+
}
|
|
1511
|
+
return styled.css(_templateObject9$6 || (_templateObject9$6 = _taggedTemplateLiteral([""])));
|
|
1512
|
+
}, _ref7 => {
|
|
1513
|
+
let {
|
|
1514
|
+
fullWidth
|
|
1515
|
+
} = _ref7;
|
|
1516
|
+
return fullWidth && styled.css(_templateObject0$6 || (_templateObject0$6 = _taggedTemplateLiteral(["\n width: 100%;\n "])));
|
|
1517
|
+
});
|
|
1518
|
+
const Button = /*#__PURE__*/React.forwardRef((_ref8, ref) => {
|
|
1496
1519
|
let {
|
|
1497
1520
|
className,
|
|
1498
1521
|
color = "primary",
|
|
@@ -1502,38 +1525,17 @@ const Button = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
1502
1525
|
loading = false,
|
|
1503
1526
|
disabled,
|
|
1504
1527
|
children
|
|
1505
|
-
} =
|
|
1506
|
-
props = _objectWithoutProperties(
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
primary: "border border-primary text-primary hover:bg-primary/10",
|
|
1517
|
-
error: "border border-error text-error hover:bg-error/10",
|
|
1518
|
-
dark: "border border-dark text-dark hover:bg-dark/10",
|
|
1519
|
-
light: "border border-light text-light hover:bg-light/10"
|
|
1520
|
-
},
|
|
1521
|
-
link: {
|
|
1522
|
-
primary: "text-primary underline",
|
|
1523
|
-
error: "text-error underline",
|
|
1524
|
-
dark: "text-dark underline",
|
|
1525
|
-
light: "text-light underline"
|
|
1526
|
-
}
|
|
1527
|
-
};
|
|
1528
|
-
const sizes = {
|
|
1529
|
-
sm: "px-3 py-1.5 text-sm",
|
|
1530
|
-
md: "px-4 py-2 text-sm",
|
|
1531
|
-
lg: "px-6 py-3 text-base"
|
|
1532
|
-
};
|
|
1533
|
-
return jsxRuntimeExports.jsx("button", _objectSpread2(_objectSpread2({
|
|
1534
|
-
className: cn(baseClasses, variants[variant][color], sizes[size], fullWidth && "w-full", (disabled || loading) && "opacity-50 cursor-not-allowed", className),
|
|
1535
|
-
ref: ref,
|
|
1536
|
-
disabled: disabled || loading
|
|
1528
|
+
} = _ref8,
|
|
1529
|
+
props = _objectWithoutProperties(_ref8, _excluded$6);
|
|
1530
|
+
return jsxRuntimeExports.jsx(StyledButton, _objectSpread2(_objectSpread2({
|
|
1531
|
+
className: className,
|
|
1532
|
+
color: color,
|
|
1533
|
+
variant: variant,
|
|
1534
|
+
size: size,
|
|
1535
|
+
fullWidth: fullWidth,
|
|
1536
|
+
loading: loading,
|
|
1537
|
+
disabled: disabled || loading,
|
|
1538
|
+
ref: ref
|
|
1537
1539
|
}, props), {}, {
|
|
1538
1540
|
children: children
|
|
1539
1541
|
}));
|
|
@@ -1541,7 +1543,100 @@ const Button = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
1541
1543
|
Button.displayName = "Button";
|
|
1542
1544
|
|
|
1543
1545
|
const _excluded$5 = ["className", "type", "label", "error", "helperText", "size", "fullWidth", "id"];
|
|
1544
|
-
|
|
1546
|
+
var _templateObject$5, _templateObject2$5, _templateObject3$5, _templateObject4$5, _templateObject5$5, _templateObject6$5, _templateObject7$5, _templateObject8$5, _templateObject9$5, _templateObject0$5;
|
|
1547
|
+
const InputContainer = styled.div(_templateObject$5 || (_templateObject$5 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n ", "\n"])), _ref => {
|
|
1548
|
+
let {
|
|
1549
|
+
fullWidth
|
|
1550
|
+
} = _ref;
|
|
1551
|
+
return fullWidth && styled.css(_templateObject2$5 || (_templateObject2$5 = _taggedTemplateLiteral(["\n width: 100%;\n "])));
|
|
1552
|
+
});
|
|
1553
|
+
const InputLabel = styled.label(_templateObject3$5 || (_templateObject3$5 = _taggedTemplateLiteral(["\n margin-bottom: ", ";\n font-size: ", ";\n font-weight: 500;\n color: ", ";\n"])), _ref2 => {
|
|
1554
|
+
let {
|
|
1555
|
+
theme
|
|
1556
|
+
} = _ref2;
|
|
1557
|
+
return theme.spacing[1];
|
|
1558
|
+
}, _ref3 => {
|
|
1559
|
+
let {
|
|
1560
|
+
theme
|
|
1561
|
+
} = _ref3;
|
|
1562
|
+
return theme.fontSize.sm;
|
|
1563
|
+
}, _ref4 => {
|
|
1564
|
+
let {
|
|
1565
|
+
theme
|
|
1566
|
+
} = _ref4;
|
|
1567
|
+
return theme.colors.gray[700];
|
|
1568
|
+
});
|
|
1569
|
+
const StyledInput = styled.input(_templateObject4$5 || (_templateObject4$5 = _taggedTemplateLiteral(["\n border: 1px solid ", ";\n border-radius: ", ";\n transition: border-color ", ";\n outline: none;\n font-family: ", ";\n\n &:focus {\n border-color: ", ";\n }\n\n &:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n background-color: ", ";\n }\n\n ", "\n\n ", "\n"])), _ref5 => {
|
|
1570
|
+
let {
|
|
1571
|
+
theme,
|
|
1572
|
+
hasError
|
|
1573
|
+
} = _ref5;
|
|
1574
|
+
return hasError ? theme.colors.error : theme.colors.gray[300];
|
|
1575
|
+
}, _ref6 => {
|
|
1576
|
+
let {
|
|
1577
|
+
theme
|
|
1578
|
+
} = _ref6;
|
|
1579
|
+
return theme.borderRadius.md;
|
|
1580
|
+
}, _ref7 => {
|
|
1581
|
+
let {
|
|
1582
|
+
theme
|
|
1583
|
+
} = _ref7;
|
|
1584
|
+
return theme.transitions.base;
|
|
1585
|
+
}, _ref8 => {
|
|
1586
|
+
let {
|
|
1587
|
+
theme
|
|
1588
|
+
} = _ref8;
|
|
1589
|
+
return theme.fontFamily.sans.join(", ");
|
|
1590
|
+
}, _ref9 => {
|
|
1591
|
+
let {
|
|
1592
|
+
theme,
|
|
1593
|
+
hasError
|
|
1594
|
+
} = _ref9;
|
|
1595
|
+
return hasError ? theme.colors.error : theme.colors.primary;
|
|
1596
|
+
}, _ref0 => {
|
|
1597
|
+
let {
|
|
1598
|
+
theme
|
|
1599
|
+
} = _ref0;
|
|
1600
|
+
return theme.colors.gray[50];
|
|
1601
|
+
}, _ref1 => {
|
|
1602
|
+
let {
|
|
1603
|
+
size,
|
|
1604
|
+
theme
|
|
1605
|
+
} = _ref1;
|
|
1606
|
+
if (size === "sm") {
|
|
1607
|
+
return styled.css(_templateObject5$5 || (_templateObject5$5 = _taggedTemplateLiteral(["\n padding: ", " ", ";\n font-size: ", ";\n "])), theme.spacing[3], theme.spacing[3], theme.fontSize.sm);
|
|
1608
|
+
}
|
|
1609
|
+
if (size === "md") {
|
|
1610
|
+
return styled.css(_templateObject6$5 || (_templateObject6$5 = _taggedTemplateLiteral(["\n padding: ", " ", ";\n font-size: ", ";\n "])), theme.spacing[2], theme.spacing[4], theme.fontSize.sm);
|
|
1611
|
+
}
|
|
1612
|
+
if (size === "lg") {
|
|
1613
|
+
return styled.css(_templateObject7$5 || (_templateObject7$5 = _taggedTemplateLiteral(["\n padding: ", " ", ";\n font-size: ", ";\n "])), theme.spacing[3], theme.spacing[4], theme.fontSize.base);
|
|
1614
|
+
}
|
|
1615
|
+
return styled.css(_templateObject8$5 || (_templateObject8$5 = _taggedTemplateLiteral([""])));
|
|
1616
|
+
}, _ref10 => {
|
|
1617
|
+
let {
|
|
1618
|
+
fullWidth
|
|
1619
|
+
} = _ref10;
|
|
1620
|
+
return fullWidth && styled.css(_templateObject9$5 || (_templateObject9$5 = _taggedTemplateLiteral(["\n width: 100%;\n "])));
|
|
1621
|
+
});
|
|
1622
|
+
const HelperText$5 = styled.p(_templateObject0$5 || (_templateObject0$5 = _taggedTemplateLiteral(["\n margin-top: ", ";\n font-size: ", ";\n color: ", ";\n"])), _ref11 => {
|
|
1623
|
+
let {
|
|
1624
|
+
theme
|
|
1625
|
+
} = _ref11;
|
|
1626
|
+
return theme.spacing[1];
|
|
1627
|
+
}, _ref12 => {
|
|
1628
|
+
let {
|
|
1629
|
+
theme
|
|
1630
|
+
} = _ref12;
|
|
1631
|
+
return theme.fontSize.xs;
|
|
1632
|
+
}, _ref13 => {
|
|
1633
|
+
let {
|
|
1634
|
+
theme,
|
|
1635
|
+
hasError
|
|
1636
|
+
} = _ref13;
|
|
1637
|
+
return hasError ? theme.colors.error : theme.colors.gray[500];
|
|
1638
|
+
});
|
|
1639
|
+
const Input = /*#__PURE__*/React.forwardRef((_ref14, ref) => {
|
|
1545
1640
|
let {
|
|
1546
1641
|
className,
|
|
1547
1642
|
type = "text",
|
|
@@ -1551,28 +1646,24 @@ const Input = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
1551
1646
|
size = "md",
|
|
1552
1647
|
fullWidth = false,
|
|
1553
1648
|
id
|
|
1554
|
-
} =
|
|
1555
|
-
props = _objectWithoutProperties(
|
|
1649
|
+
} = _ref14,
|
|
1650
|
+
props = _objectWithoutProperties(_ref14, _excluded$5);
|
|
1556
1651
|
const inputId = id || "input-".concat(Math.random().toString(36).substr(2, 9));
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
lg: "px-4 py-3 text-base"
|
|
1561
|
-
};
|
|
1562
|
-
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);
|
|
1563
|
-
return jsxRuntimeExports.jsxs("div", {
|
|
1564
|
-
className: cn("flex flex-col", fullWidth && "w-full"),
|
|
1565
|
-
children: [label && jsxRuntimeExports.jsx("label", {
|
|
1652
|
+
return jsxRuntimeExports.jsxs(InputContainer, {
|
|
1653
|
+
fullWidth: fullWidth,
|
|
1654
|
+
children: [label && jsxRuntimeExports.jsx(InputLabel, {
|
|
1566
1655
|
htmlFor: inputId,
|
|
1567
|
-
className: "mb-1 text-sm font-medium text-secondary-700",
|
|
1568
1656
|
children: label
|
|
1569
|
-
}), jsxRuntimeExports.jsx(
|
|
1657
|
+
}), jsxRuntimeExports.jsx(StyledInput, _objectSpread2({
|
|
1570
1658
|
type: type,
|
|
1571
|
-
|
|
1659
|
+
size: size,
|
|
1660
|
+
fullWidth: fullWidth,
|
|
1661
|
+
hasError: !!error,
|
|
1662
|
+
className: className,
|
|
1572
1663
|
ref: ref,
|
|
1573
1664
|
id: inputId
|
|
1574
|
-
}, props)), (error || helperText) && jsxRuntimeExports.jsx(
|
|
1575
|
-
|
|
1665
|
+
}, props)), (error || helperText) && jsxRuntimeExports.jsx(HelperText$5, {
|
|
1666
|
+
hasError: !!error,
|
|
1576
1667
|
children: error || helperText
|
|
1577
1668
|
})]
|
|
1578
1669
|
});
|
|
@@ -1580,7 +1671,100 @@ const Input = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
1580
1671
|
Input.displayName = "Input";
|
|
1581
1672
|
|
|
1582
1673
|
const _excluded$4 = ["className", "label", "error", "helperText", "size", "fullWidth", "rows", "id"];
|
|
1583
|
-
|
|
1674
|
+
var _templateObject$4, _templateObject2$4, _templateObject3$4, _templateObject4$4, _templateObject5$4, _templateObject6$4, _templateObject7$4, _templateObject8$4, _templateObject9$4, _templateObject0$4;
|
|
1675
|
+
const TextareaContainer = styled.div(_templateObject$4 || (_templateObject$4 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n ", "\n"])), _ref => {
|
|
1676
|
+
let {
|
|
1677
|
+
fullWidth
|
|
1678
|
+
} = _ref;
|
|
1679
|
+
return fullWidth && styled.css(_templateObject2$4 || (_templateObject2$4 = _taggedTemplateLiteral(["\n width: 100%;\n "])));
|
|
1680
|
+
});
|
|
1681
|
+
const TextareaLabel = styled.label(_templateObject3$4 || (_templateObject3$4 = _taggedTemplateLiteral(["\n margin-bottom: ", ";\n font-size: ", ";\n font-weight: 500;\n color: ", ";\n"])), _ref2 => {
|
|
1682
|
+
let {
|
|
1683
|
+
theme
|
|
1684
|
+
} = _ref2;
|
|
1685
|
+
return theme.spacing[1];
|
|
1686
|
+
}, _ref3 => {
|
|
1687
|
+
let {
|
|
1688
|
+
theme
|
|
1689
|
+
} = _ref3;
|
|
1690
|
+
return theme.fontSize.sm;
|
|
1691
|
+
}, _ref4 => {
|
|
1692
|
+
let {
|
|
1693
|
+
theme
|
|
1694
|
+
} = _ref4;
|
|
1695
|
+
return theme.colors.gray[700];
|
|
1696
|
+
});
|
|
1697
|
+
const StyledTextarea = styled.textarea(_templateObject4$4 || (_templateObject4$4 = _taggedTemplateLiteral(["\n border: 1px solid ", ";\n border-radius: ", ";\n transition: border-color ", ";\n outline: none;\n resize: vertical;\n font-family: ", ";\n\n &:focus {\n border-color: ", ";\n }\n\n &:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n background-color: ", ";\n }\n\n ", "\n\n ", "\n"])), _ref5 => {
|
|
1698
|
+
let {
|
|
1699
|
+
theme,
|
|
1700
|
+
hasError
|
|
1701
|
+
} = _ref5;
|
|
1702
|
+
return hasError ? theme.colors.error : theme.colors.gray[300];
|
|
1703
|
+
}, _ref6 => {
|
|
1704
|
+
let {
|
|
1705
|
+
theme
|
|
1706
|
+
} = _ref6;
|
|
1707
|
+
return theme.borderRadius.md;
|
|
1708
|
+
}, _ref7 => {
|
|
1709
|
+
let {
|
|
1710
|
+
theme
|
|
1711
|
+
} = _ref7;
|
|
1712
|
+
return theme.transitions.base;
|
|
1713
|
+
}, _ref8 => {
|
|
1714
|
+
let {
|
|
1715
|
+
theme
|
|
1716
|
+
} = _ref8;
|
|
1717
|
+
return theme.fontFamily.sans.join(", ");
|
|
1718
|
+
}, _ref9 => {
|
|
1719
|
+
let {
|
|
1720
|
+
theme,
|
|
1721
|
+
hasError
|
|
1722
|
+
} = _ref9;
|
|
1723
|
+
return hasError ? theme.colors.error : theme.colors.primary;
|
|
1724
|
+
}, _ref0 => {
|
|
1725
|
+
let {
|
|
1726
|
+
theme
|
|
1727
|
+
} = _ref0;
|
|
1728
|
+
return theme.colors.gray[50];
|
|
1729
|
+
}, _ref1 => {
|
|
1730
|
+
let {
|
|
1731
|
+
size,
|
|
1732
|
+
theme
|
|
1733
|
+
} = _ref1;
|
|
1734
|
+
if (size === "sm") {
|
|
1735
|
+
return styled.css(_templateObject5$4 || (_templateObject5$4 = _taggedTemplateLiteral(["\n padding: ", " ", ";\n font-size: ", ";\n "])), theme.spacing[3], theme.spacing[3], theme.fontSize.sm);
|
|
1736
|
+
}
|
|
1737
|
+
if (size === "md") {
|
|
1738
|
+
return styled.css(_templateObject6$4 || (_templateObject6$4 = _taggedTemplateLiteral(["\n padding: ", " ", ";\n font-size: ", ";\n "])), theme.spacing[2], theme.spacing[4], theme.fontSize.sm);
|
|
1739
|
+
}
|
|
1740
|
+
if (size === "lg") {
|
|
1741
|
+
return styled.css(_templateObject7$4 || (_templateObject7$4 = _taggedTemplateLiteral(["\n padding: ", " ", ";\n font-size: ", ";\n "])), theme.spacing[3], theme.spacing[4], theme.fontSize.base);
|
|
1742
|
+
}
|
|
1743
|
+
return styled.css(_templateObject8$4 || (_templateObject8$4 = _taggedTemplateLiteral([""])));
|
|
1744
|
+
}, _ref10 => {
|
|
1745
|
+
let {
|
|
1746
|
+
fullWidth
|
|
1747
|
+
} = _ref10;
|
|
1748
|
+
return fullWidth && styled.css(_templateObject9$4 || (_templateObject9$4 = _taggedTemplateLiteral(["\n width: 100%;\n "])));
|
|
1749
|
+
});
|
|
1750
|
+
const HelperText$4 = styled.p(_templateObject0$4 || (_templateObject0$4 = _taggedTemplateLiteral(["\n margin-top: ", ";\n font-size: ", ";\n color: ", ";\n"])), _ref11 => {
|
|
1751
|
+
let {
|
|
1752
|
+
theme
|
|
1753
|
+
} = _ref11;
|
|
1754
|
+
return theme.spacing[1];
|
|
1755
|
+
}, _ref12 => {
|
|
1756
|
+
let {
|
|
1757
|
+
theme
|
|
1758
|
+
} = _ref12;
|
|
1759
|
+
return theme.fontSize.xs;
|
|
1760
|
+
}, _ref13 => {
|
|
1761
|
+
let {
|
|
1762
|
+
theme,
|
|
1763
|
+
hasError
|
|
1764
|
+
} = _ref13;
|
|
1765
|
+
return hasError ? theme.colors.error : theme.colors.gray[500];
|
|
1766
|
+
});
|
|
1767
|
+
const Textarea = /*#__PURE__*/React.forwardRef((_ref14, ref) => {
|
|
1584
1768
|
let {
|
|
1585
1769
|
className,
|
|
1586
1770
|
label,
|
|
@@ -1590,28 +1774,24 @@ const Textarea = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
1590
1774
|
fullWidth = false,
|
|
1591
1775
|
rows = 3,
|
|
1592
1776
|
id
|
|
1593
|
-
} =
|
|
1594
|
-
props = _objectWithoutProperties(
|
|
1777
|
+
} = _ref14,
|
|
1778
|
+
props = _objectWithoutProperties(_ref14, _excluded$4);
|
|
1595
1779
|
const textareaId = id || "textarea-".concat(Math.random().toString(36).substr(2, 9));
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
lg: "px-4 py-3 text-base"
|
|
1600
|
-
};
|
|
1601
|
-
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);
|
|
1602
|
-
return jsxRuntimeExports.jsxs("div", {
|
|
1603
|
-
className: cn("flex flex-col", fullWidth && "w-full"),
|
|
1604
|
-
children: [label && jsxRuntimeExports.jsx("label", {
|
|
1780
|
+
return jsxRuntimeExports.jsxs(TextareaContainer, {
|
|
1781
|
+
fullWidth: fullWidth,
|
|
1782
|
+
children: [label && jsxRuntimeExports.jsx(TextareaLabel, {
|
|
1605
1783
|
htmlFor: textareaId,
|
|
1606
|
-
className: "mb-1 text-sm font-medium text-secondary-700",
|
|
1607
1784
|
children: label
|
|
1608
|
-
}), jsxRuntimeExports.jsx(
|
|
1609
|
-
|
|
1785
|
+
}), jsxRuntimeExports.jsx(StyledTextarea, _objectSpread2({
|
|
1786
|
+
size: size,
|
|
1787
|
+
fullWidth: fullWidth,
|
|
1788
|
+
hasError: !!error,
|
|
1789
|
+
className: className,
|
|
1610
1790
|
ref: ref,
|
|
1611
1791
|
id: textareaId,
|
|
1612
1792
|
rows: rows
|
|
1613
|
-
}, props)), (error || helperText) && jsxRuntimeExports.jsx(
|
|
1614
|
-
|
|
1793
|
+
}, props)), (error || helperText) && jsxRuntimeExports.jsx(HelperText$4, {
|
|
1794
|
+
hasError: !!error,
|
|
1615
1795
|
children: error || helperText
|
|
1616
1796
|
})]
|
|
1617
1797
|
});
|
|
@@ -1619,7 +1799,115 @@ const Textarea = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
1619
1799
|
Textarea.displayName = "Textarea";
|
|
1620
1800
|
|
|
1621
1801
|
const _excluded$3 = ["className", "label", "error", "helperText", "size", "fullWidth", "accept", "multiple", "buttonText", "id"];
|
|
1622
|
-
|
|
1802
|
+
var _templateObject$3, _templateObject2$3, _templateObject3$3, _templateObject4$3, _templateObject5$3, _templateObject6$3, _templateObject7$3, _templateObject8$3, _templateObject9$3, _templateObject0$3, _templateObject1$3, _templateObject10$3, _templateObject11$2, _templateObject12$2;
|
|
1803
|
+
const InputFileContainer = styled.div(_templateObject$3 || (_templateObject$3 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n ", "\n"])), _ref => {
|
|
1804
|
+
let {
|
|
1805
|
+
fullWidth
|
|
1806
|
+
} = _ref;
|
|
1807
|
+
return fullWidth && styled.css(_templateObject2$3 || (_templateObject2$3 = _taggedTemplateLiteral(["\n width: 100%;\n "])));
|
|
1808
|
+
});
|
|
1809
|
+
const InputFileLabel = styled.label(_templateObject3$3 || (_templateObject3$3 = _taggedTemplateLiteral(["\n margin-bottom: ", ";\n font-size: ", ";\n font-weight: 500;\n color: ", ";\n"])), _ref2 => {
|
|
1810
|
+
let {
|
|
1811
|
+
theme
|
|
1812
|
+
} = _ref2;
|
|
1813
|
+
return theme.spacing[1];
|
|
1814
|
+
}, _ref3 => {
|
|
1815
|
+
let {
|
|
1816
|
+
theme
|
|
1817
|
+
} = _ref3;
|
|
1818
|
+
return theme.fontSize.sm;
|
|
1819
|
+
}, _ref4 => {
|
|
1820
|
+
let {
|
|
1821
|
+
theme
|
|
1822
|
+
} = _ref4;
|
|
1823
|
+
return theme.colors.gray[700];
|
|
1824
|
+
});
|
|
1825
|
+
const InputFileWrapper = styled.div(_templateObject4$3 || (_templateObject4$3 = _taggedTemplateLiteral(["\n position: relative;\n"])));
|
|
1826
|
+
const HiddenInput = styled.input(_templateObject5$3 || (_templateObject5$3 = _taggedTemplateLiteral(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n opacity: 0;\n cursor: pointer;\n"])));
|
|
1827
|
+
const FileUploadArea = styled.div(_templateObject6$3 || (_templateObject6$3 = _taggedTemplateLiteral(["\n border: 2px dashed ", ";\n transition: all ", ";\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n\n &:hover {\n border-color: ", ";\n }\n\n &:focus-within {\n border-color: ", ";\n }\n\n ", "\n\n ", "\n"])), _ref5 => {
|
|
1828
|
+
let {
|
|
1829
|
+
theme,
|
|
1830
|
+
hasError
|
|
1831
|
+
} = _ref5;
|
|
1832
|
+
return hasError ? theme.colors.error : theme.colors.gray[300];
|
|
1833
|
+
}, _ref6 => {
|
|
1834
|
+
let {
|
|
1835
|
+
theme
|
|
1836
|
+
} = _ref6;
|
|
1837
|
+
return theme.transitions.base;
|
|
1838
|
+
}, _ref7 => {
|
|
1839
|
+
let {
|
|
1840
|
+
theme,
|
|
1841
|
+
hasError
|
|
1842
|
+
} = _ref7;
|
|
1843
|
+
return hasError ? theme.colors.error : theme.colors.primary;
|
|
1844
|
+
}, _ref8 => {
|
|
1845
|
+
let {
|
|
1846
|
+
theme,
|
|
1847
|
+
hasError
|
|
1848
|
+
} = _ref8;
|
|
1849
|
+
return hasError ? theme.colors.error : theme.colors.primary;
|
|
1850
|
+
}, _ref9 => {
|
|
1851
|
+
let {
|
|
1852
|
+
size,
|
|
1853
|
+
theme
|
|
1854
|
+
} = _ref9;
|
|
1855
|
+
if (size === "sm") {
|
|
1856
|
+
return styled.css(_templateObject7$3 || (_templateObject7$3 = _taggedTemplateLiteral(["\n padding: ", " ", ";\n font-size: ", ";\n "])), theme.spacing[3], theme.spacing[3], theme.fontSize.sm);
|
|
1857
|
+
}
|
|
1858
|
+
if (size === "md") {
|
|
1859
|
+
return styled.css(_templateObject8$3 || (_templateObject8$3 = _taggedTemplateLiteral(["\n padding: ", " ", ";\n font-size: ", ";\n "])), theme.spacing[2], theme.spacing[4], theme.fontSize.base);
|
|
1860
|
+
}
|
|
1861
|
+
if (size === "lg") {
|
|
1862
|
+
return styled.css(_templateObject9$3 || (_templateObject9$3 = _taggedTemplateLiteral(["\n padding: ", " ", ";\n font-size: ", ";\n "])), theme.spacing[3], theme.spacing[4], theme.fontSize.base);
|
|
1863
|
+
}
|
|
1864
|
+
return styled.css(_templateObject0$3 || (_templateObject0$3 = _taggedTemplateLiteral([""])));
|
|
1865
|
+
}, _ref0 => {
|
|
1866
|
+
let {
|
|
1867
|
+
fullWidth
|
|
1868
|
+
} = _ref0;
|
|
1869
|
+
return fullWidth && styled.css(_templateObject1$3 || (_templateObject1$3 = _taggedTemplateLiteral(["\n width: 100%;\n "])));
|
|
1870
|
+
});
|
|
1871
|
+
const ButtonText = styled.span(_templateObject10$3 || (_templateObject10$3 = _taggedTemplateLiteral(["\n color: ", ";\n"])), _ref1 => {
|
|
1872
|
+
let {
|
|
1873
|
+
theme
|
|
1874
|
+
} = _ref1;
|
|
1875
|
+
return theme.colors.gray[600];
|
|
1876
|
+
});
|
|
1877
|
+
const MultipleText = styled.span(_templateObject11$2 || (_templateObject11$2 = _taggedTemplateLiteral(["\n margin-left: ", ";\n font-size: ", ";\n color: ", ";\n"])), _ref10 => {
|
|
1878
|
+
let {
|
|
1879
|
+
theme
|
|
1880
|
+
} = _ref10;
|
|
1881
|
+
return theme.spacing[1];
|
|
1882
|
+
}, _ref11 => {
|
|
1883
|
+
let {
|
|
1884
|
+
theme
|
|
1885
|
+
} = _ref11;
|
|
1886
|
+
return theme.fontSize.xs;
|
|
1887
|
+
}, _ref12 => {
|
|
1888
|
+
let {
|
|
1889
|
+
theme
|
|
1890
|
+
} = _ref12;
|
|
1891
|
+
return theme.colors.gray[500];
|
|
1892
|
+
});
|
|
1893
|
+
const HelperText$3 = styled.p(_templateObject12$2 || (_templateObject12$2 = _taggedTemplateLiteral(["\n margin-top: ", ";\n font-size: ", ";\n color: ", ";\n"])), _ref13 => {
|
|
1894
|
+
let {
|
|
1895
|
+
theme
|
|
1896
|
+
} = _ref13;
|
|
1897
|
+
return theme.spacing[1];
|
|
1898
|
+
}, _ref14 => {
|
|
1899
|
+
let {
|
|
1900
|
+
theme
|
|
1901
|
+
} = _ref14;
|
|
1902
|
+
return theme.fontSize.xs;
|
|
1903
|
+
}, _ref15 => {
|
|
1904
|
+
let {
|
|
1905
|
+
theme,
|
|
1906
|
+
hasError
|
|
1907
|
+
} = _ref15;
|
|
1908
|
+
return hasError ? theme.colors.error : theme.colors.gray[500];
|
|
1909
|
+
});
|
|
1910
|
+
const InputFile = /*#__PURE__*/React.forwardRef((_ref16, ref) => {
|
|
1623
1911
|
let {
|
|
1624
1912
|
className,
|
|
1625
1913
|
label,
|
|
@@ -1631,42 +1919,34 @@ const InputFile = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
1631
1919
|
multiple = false,
|
|
1632
1920
|
buttonText = "Choose File",
|
|
1633
1921
|
id
|
|
1634
|
-
} =
|
|
1635
|
-
props = _objectWithoutProperties(
|
|
1922
|
+
} = _ref16,
|
|
1923
|
+
props = _objectWithoutProperties(_ref16, _excluded$3);
|
|
1636
1924
|
const inputId = id || "file-input-".concat(Math.random().toString(36).substr(2, 9));
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
lg: "px-4 py-3 text-base"
|
|
1641
|
-
};
|
|
1642
|
-
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);
|
|
1643
|
-
return jsxRuntimeExports.jsxs("div", {
|
|
1644
|
-
className: cn("flex flex-col", fullWidth && "w-full"),
|
|
1645
|
-
children: [label && jsxRuntimeExports.jsx("label", {
|
|
1925
|
+
return jsxRuntimeExports.jsxs(InputFileContainer, {
|
|
1926
|
+
fullWidth: fullWidth,
|
|
1927
|
+
children: [label && jsxRuntimeExports.jsx(InputFileLabel, {
|
|
1646
1928
|
htmlFor: inputId,
|
|
1647
|
-
className: "mb-1 text-sm font-medium text-secondary-700",
|
|
1648
1929
|
children: label
|
|
1649
|
-
}), jsxRuntimeExports.jsxs(
|
|
1650
|
-
|
|
1651
|
-
children: [jsxRuntimeExports.jsx("input", _objectSpread2({
|
|
1930
|
+
}), jsxRuntimeExports.jsxs(InputFileWrapper, {
|
|
1931
|
+
children: [jsxRuntimeExports.jsx(HiddenInput, _objectSpread2({
|
|
1652
1932
|
type: "file",
|
|
1653
|
-
className: "absolute inset-0 w-full h-full opacity-0 cursor-pointer",
|
|
1654
1933
|
ref: ref,
|
|
1655
1934
|
id: inputId,
|
|
1656
1935
|
accept: accept,
|
|
1657
1936
|
multiple: multiple
|
|
1658
|
-
}, props)), jsxRuntimeExports.jsxs(
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1937
|
+
}, props)), jsxRuntimeExports.jsxs(FileUploadArea, {
|
|
1938
|
+
size: size,
|
|
1939
|
+
fullWidth: fullWidth,
|
|
1940
|
+
hasError: !!error,
|
|
1941
|
+
className: className,
|
|
1942
|
+
children: [jsxRuntimeExports.jsx(ButtonText, {
|
|
1662
1943
|
children: buttonText
|
|
1663
|
-
}), multiple && jsxRuntimeExports.jsx(
|
|
1664
|
-
className: "ml-1 text-xs text-secondary-500",
|
|
1944
|
+
}), multiple && jsxRuntimeExports.jsx(MultipleText, {
|
|
1665
1945
|
children: "(Multiple)"
|
|
1666
1946
|
})]
|
|
1667
1947
|
})]
|
|
1668
|
-
}), (error || helperText) && jsxRuntimeExports.jsx(
|
|
1669
|
-
|
|
1948
|
+
}), (error || helperText) && jsxRuntimeExports.jsx(HelperText$3, {
|
|
1949
|
+
hasError: !!error,
|
|
1670
1950
|
children: error || helperText
|
|
1671
1951
|
})]
|
|
1672
1952
|
});
|
|
@@ -1674,7 +1954,102 @@ const InputFile = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
1674
1954
|
InputFile.displayName = "InputFile";
|
|
1675
1955
|
|
|
1676
1956
|
const _excluded$2 = ["className", "label", "error", "helperText", "size", "fullWidth", "indeterminate", "id"];
|
|
1677
|
-
|
|
1957
|
+
var _templateObject$2, _templateObject2$2, _templateObject3$2, _templateObject4$2, _templateObject5$2, _templateObject6$2, _templateObject7$2, _templateObject8$2, _templateObject9$2, _templateObject0$2, _templateObject1$2, _templateObject10$2, _templateObject11$1, _templateObject12$1, _templateObject13$1;
|
|
1958
|
+
const CheckboxContainer = styled.div(_templateObject$2 || (_templateObject$2 = _taggedTemplateLiteral(["\n display: flex;\n align-items: flex-start;\n ", "\n"])), _ref => {
|
|
1959
|
+
let {
|
|
1960
|
+
fullWidth
|
|
1961
|
+
} = _ref;
|
|
1962
|
+
return fullWidth && styled.css(_templateObject2$2 || (_templateObject2$2 = _taggedTemplateLiteral(["\n width: 100%;\n "])));
|
|
1963
|
+
});
|
|
1964
|
+
const CheckboxWrapper = styled.div(_templateObject3$2 || (_templateObject3$2 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n height: ", ";\n"])), _ref2 => {
|
|
1965
|
+
let {
|
|
1966
|
+
theme
|
|
1967
|
+
} = _ref2;
|
|
1968
|
+
return theme.spacing[5];
|
|
1969
|
+
});
|
|
1970
|
+
const StyledCheckbox = styled.input(_templateObject4$2 || (_templateObject4$2 = _taggedTemplateLiteral(["\n border-radius: ", ";\n border: 1px solid ", ";\n transition: all ", ";\n outline: none;\n\n &:focus {\n outline: none;\n box-shadow: 0 0 0 2px ", ";\n }\n\n &:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n ", "\n"])), _ref3 => {
|
|
1971
|
+
let {
|
|
1972
|
+
theme
|
|
1973
|
+
} = _ref3;
|
|
1974
|
+
return theme.borderRadius.md;
|
|
1975
|
+
}, _ref4 => {
|
|
1976
|
+
let {
|
|
1977
|
+
theme,
|
|
1978
|
+
hasError
|
|
1979
|
+
} = _ref4;
|
|
1980
|
+
return hasError ? theme.colors.error : theme.colors.gray[300];
|
|
1981
|
+
}, _ref5 => {
|
|
1982
|
+
let {
|
|
1983
|
+
theme
|
|
1984
|
+
} = _ref5;
|
|
1985
|
+
return theme.transitions.base;
|
|
1986
|
+
}, _ref6 => {
|
|
1987
|
+
let {
|
|
1988
|
+
theme,
|
|
1989
|
+
hasError
|
|
1990
|
+
} = _ref6;
|
|
1991
|
+
return hasError ? theme.colors.error : theme.colors.primary;
|
|
1992
|
+
}, _ref7 => {
|
|
1993
|
+
let {
|
|
1994
|
+
size,
|
|
1995
|
+
theme
|
|
1996
|
+
} = _ref7;
|
|
1997
|
+
if (size === "sm") {
|
|
1998
|
+
return styled.css(_templateObject5$2 || (_templateObject5$2 = _taggedTemplateLiteral(["\n width: ", ";\n height: ", ";\n "])), theme.spacing[4], theme.spacing[4]);
|
|
1999
|
+
}
|
|
2000
|
+
if (size === "md") {
|
|
2001
|
+
return styled.css(_templateObject6$2 || (_templateObject6$2 = _taggedTemplateLiteral(["\n width: ", ";\n height: ", ";\n "])), theme.spacing[5], theme.spacing[5]);
|
|
2002
|
+
}
|
|
2003
|
+
if (size === "lg") {
|
|
2004
|
+
return styled.css(_templateObject7$2 || (_templateObject7$2 = _taggedTemplateLiteral(["\n width: ", ";\n height: ", ";\n "])), theme.spacing[6], theme.spacing[6]);
|
|
2005
|
+
}
|
|
2006
|
+
return styled.css(_templateObject8$2 || (_templateObject8$2 = _taggedTemplateLiteral([""])));
|
|
2007
|
+
});
|
|
2008
|
+
const LabelContainer$1 = styled.div(_templateObject9$2 || (_templateObject9$2 = _taggedTemplateLiteral(["\n margin-left: ", ";\n"])), _ref8 => {
|
|
2009
|
+
let {
|
|
2010
|
+
theme
|
|
2011
|
+
} = _ref8;
|
|
2012
|
+
return theme.spacing[3];
|
|
2013
|
+
});
|
|
2014
|
+
const CheckboxLabel = styled.label(_templateObject0$2 || (_templateObject0$2 = _taggedTemplateLiteral(["\n font-weight: 500;\n color: ", ";\n cursor: pointer;\n\n ", "\n"])), _ref9 => {
|
|
2015
|
+
let {
|
|
2016
|
+
theme
|
|
2017
|
+
} = _ref9;
|
|
2018
|
+
return theme.colors.gray[700];
|
|
2019
|
+
}, _ref0 => {
|
|
2020
|
+
let {
|
|
2021
|
+
size,
|
|
2022
|
+
theme
|
|
2023
|
+
} = _ref0;
|
|
2024
|
+
if (size === "sm") {
|
|
2025
|
+
return styled.css(_templateObject1$2 || (_templateObject1$2 = _taggedTemplateLiteral(["\n font-size: ", ";\n "])), theme.fontSize.sm);
|
|
2026
|
+
}
|
|
2027
|
+
if (size === "md") {
|
|
2028
|
+
return styled.css(_templateObject10$2 || (_templateObject10$2 = _taggedTemplateLiteral(["\n font-size: ", ";\n "])), theme.fontSize.sm);
|
|
2029
|
+
}
|
|
2030
|
+
if (size === "lg") {
|
|
2031
|
+
return styled.css(_templateObject11$1 || (_templateObject11$1 = _taggedTemplateLiteral(["\n font-size: ", ";\n "])), theme.fontSize.base);
|
|
2032
|
+
}
|
|
2033
|
+
return styled.css(_templateObject12$1 || (_templateObject12$1 = _taggedTemplateLiteral([""])));
|
|
2034
|
+
});
|
|
2035
|
+
const HelperText$2 = styled.p(_templateObject13$1 || (_templateObject13$1 = _taggedTemplateLiteral(["\n margin-top: ", ";\n font-size: ", ";\n color: ", ";\n"])), _ref1 => {
|
|
2036
|
+
let {
|
|
2037
|
+
theme
|
|
2038
|
+
} = _ref1;
|
|
2039
|
+
return theme.spacing[1];
|
|
2040
|
+
}, _ref10 => {
|
|
2041
|
+
let {
|
|
2042
|
+
theme
|
|
2043
|
+
} = _ref10;
|
|
2044
|
+
return theme.fontSize.xs;
|
|
2045
|
+
}, _ref11 => {
|
|
2046
|
+
let {
|
|
2047
|
+
theme,
|
|
2048
|
+
hasError
|
|
2049
|
+
} = _ref11;
|
|
2050
|
+
return hasError ? theme.colors.error : theme.colors.gray[500];
|
|
2051
|
+
});
|
|
2052
|
+
const Checkbox = /*#__PURE__*/React.forwardRef((_ref12, ref) => {
|
|
1678
2053
|
let {
|
|
1679
2054
|
className,
|
|
1680
2055
|
label,
|
|
@@ -1684,43 +2059,32 @@ const Checkbox = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
1684
2059
|
fullWidth = false,
|
|
1685
2060
|
indeterminate = false,
|
|
1686
2061
|
id
|
|
1687
|
-
} =
|
|
1688
|
-
props = _objectWithoutProperties(
|
|
2062
|
+
} = _ref12,
|
|
2063
|
+
props = _objectWithoutProperties(_ref12, _excluded$2);
|
|
1689
2064
|
const checkboxId = id || "checkbox-".concat(Math.random().toString(36).substr(2, 9));
|
|
1690
|
-
const sizes = {
|
|
1691
|
-
sm: "w-4 h-4",
|
|
1692
|
-
md: "w-5 h-5",
|
|
1693
|
-
lg: "w-6 h-6"
|
|
1694
|
-
};
|
|
1695
|
-
const labelSizes = {
|
|
1696
|
-
sm: "text-sm",
|
|
1697
|
-
md: "text-sm",
|
|
1698
|
-
lg: "text-base"
|
|
1699
|
-
};
|
|
1700
|
-
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);
|
|
1701
2065
|
React.useEffect(() => {
|
|
1702
2066
|
if (ref && typeof ref === "object" && ref.current) {
|
|
1703
2067
|
ref.current.indeterminate = indeterminate;
|
|
1704
2068
|
}
|
|
1705
2069
|
}, [indeterminate, ref]);
|
|
1706
|
-
return jsxRuntimeExports.jsxs(
|
|
1707
|
-
|
|
1708
|
-
children: [jsxRuntimeExports.jsx(
|
|
1709
|
-
|
|
1710
|
-
children: jsxRuntimeExports.jsx("input", _objectSpread2({
|
|
2070
|
+
return jsxRuntimeExports.jsxs(CheckboxContainer, {
|
|
2071
|
+
fullWidth: fullWidth,
|
|
2072
|
+
children: [jsxRuntimeExports.jsx(CheckboxWrapper, {
|
|
2073
|
+
children: jsxRuntimeExports.jsx(StyledCheckbox, _objectSpread2({
|
|
1711
2074
|
type: "checkbox",
|
|
1712
|
-
|
|
2075
|
+
size: size,
|
|
2076
|
+
hasError: !!error,
|
|
2077
|
+
className: className,
|
|
1713
2078
|
ref: ref,
|
|
1714
2079
|
id: checkboxId
|
|
1715
2080
|
}, props))
|
|
1716
|
-
}), jsxRuntimeExports.jsxs(
|
|
1717
|
-
|
|
1718
|
-
children: [label && jsxRuntimeExports.jsx("label", {
|
|
2081
|
+
}), jsxRuntimeExports.jsxs(LabelContainer$1, {
|
|
2082
|
+
children: [label && jsxRuntimeExports.jsx(CheckboxLabel, {
|
|
1719
2083
|
htmlFor: checkboxId,
|
|
1720
|
-
|
|
2084
|
+
size: size,
|
|
1721
2085
|
children: label
|
|
1722
|
-
}), (error || helperText) && jsxRuntimeExports.jsx(
|
|
1723
|
-
|
|
2086
|
+
}), (error || helperText) && jsxRuntimeExports.jsx(HelperText$2, {
|
|
2087
|
+
hasError: !!error,
|
|
1724
2088
|
children: error || helperText
|
|
1725
2089
|
})]
|
|
1726
2090
|
})]
|
|
@@ -1729,7 +2093,97 @@ const Checkbox = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
1729
2093
|
Checkbox.displayName = "Checkbox";
|
|
1730
2094
|
|
|
1731
2095
|
const _excluded$1 = ["className", "label", "error", "helperText", "size", "fullWidth", "id"];
|
|
1732
|
-
|
|
2096
|
+
var _templateObject$1, _templateObject2$1, _templateObject3$1, _templateObject4$1, _templateObject5$1, _templateObject6$1, _templateObject7$1, _templateObject8$1, _templateObject9$1, _templateObject0$1, _templateObject1$1, _templateObject10$1, _templateObject11, _templateObject12, _templateObject13;
|
|
2097
|
+
const RadioContainer = styled.div(_templateObject$1 || (_templateObject$1 = _taggedTemplateLiteral(["\n display: flex;\n align-items: flex-start;\n ", "\n"])), _ref => {
|
|
2098
|
+
let {
|
|
2099
|
+
fullWidth
|
|
2100
|
+
} = _ref;
|
|
2101
|
+
return fullWidth && styled.css(_templateObject2$1 || (_templateObject2$1 = _taggedTemplateLiteral(["\n width: 100%;\n "])));
|
|
2102
|
+
});
|
|
2103
|
+
const RadioWrapper = styled.div(_templateObject3$1 || (_templateObject3$1 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n height: ", ";\n"])), _ref2 => {
|
|
2104
|
+
let {
|
|
2105
|
+
theme
|
|
2106
|
+
} = _ref2;
|
|
2107
|
+
return theme.spacing[5];
|
|
2108
|
+
});
|
|
2109
|
+
const StyledRadio = styled.input(_templateObject4$1 || (_templateObject4$1 = _taggedTemplateLiteral(["\n border: 2px solid ", ";\n transition: all ", ";\n outline: none;\n\n &:focus {\n outline: none;\n box-shadow: 0 0 0 2px ", ";\n }\n\n &:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n ", "\n"])), _ref3 => {
|
|
2110
|
+
let {
|
|
2111
|
+
theme,
|
|
2112
|
+
hasError
|
|
2113
|
+
} = _ref3;
|
|
2114
|
+
return hasError ? theme.colors.error : theme.colors.gray[300];
|
|
2115
|
+
}, _ref4 => {
|
|
2116
|
+
let {
|
|
2117
|
+
theme
|
|
2118
|
+
} = _ref4;
|
|
2119
|
+
return theme.transitions.base;
|
|
2120
|
+
}, _ref5 => {
|
|
2121
|
+
let {
|
|
2122
|
+
theme,
|
|
2123
|
+
hasError
|
|
2124
|
+
} = _ref5;
|
|
2125
|
+
return hasError ? theme.colors.error : theme.colors.primary;
|
|
2126
|
+
}, _ref6 => {
|
|
2127
|
+
let {
|
|
2128
|
+
size,
|
|
2129
|
+
theme
|
|
2130
|
+
} = _ref6;
|
|
2131
|
+
if (size === "sm") {
|
|
2132
|
+
return styled.css(_templateObject5$1 || (_templateObject5$1 = _taggedTemplateLiteral(["\n width: ", ";\n height: ", ";\n "])), theme.spacing[4], theme.spacing[4]);
|
|
2133
|
+
}
|
|
2134
|
+
if (size === "md") {
|
|
2135
|
+
return styled.css(_templateObject6$1 || (_templateObject6$1 = _taggedTemplateLiteral(["\n width: ", ";\n height: ", ";\n "])), theme.spacing[5], theme.spacing[5]);
|
|
2136
|
+
}
|
|
2137
|
+
if (size === "lg") {
|
|
2138
|
+
return styled.css(_templateObject7$1 || (_templateObject7$1 = _taggedTemplateLiteral(["\n width: ", ";\n height: ", ";\n "])), theme.spacing[6], theme.spacing[6]);
|
|
2139
|
+
}
|
|
2140
|
+
return styled.css(_templateObject8$1 || (_templateObject8$1 = _taggedTemplateLiteral([""])));
|
|
2141
|
+
});
|
|
2142
|
+
const LabelContainer = styled.div(_templateObject9$1 || (_templateObject9$1 = _taggedTemplateLiteral(["\n margin-left: ", ";\n"])), _ref7 => {
|
|
2143
|
+
let {
|
|
2144
|
+
theme
|
|
2145
|
+
} = _ref7;
|
|
2146
|
+
return theme.spacing[3];
|
|
2147
|
+
});
|
|
2148
|
+
const RadioLabel = styled.label(_templateObject0$1 || (_templateObject0$1 = _taggedTemplateLiteral(["\n font-weight: 500;\n color: ", ";\n cursor: pointer;\n\n ", "\n"])), _ref8 => {
|
|
2149
|
+
let {
|
|
2150
|
+
theme
|
|
2151
|
+
} = _ref8;
|
|
2152
|
+
return theme.colors.gray[700];
|
|
2153
|
+
}, _ref9 => {
|
|
2154
|
+
let {
|
|
2155
|
+
size,
|
|
2156
|
+
theme
|
|
2157
|
+
} = _ref9;
|
|
2158
|
+
if (size === "sm") {
|
|
2159
|
+
return styled.css(_templateObject1$1 || (_templateObject1$1 = _taggedTemplateLiteral(["\n font-size: ", ";\n "])), theme.fontSize.sm);
|
|
2160
|
+
}
|
|
2161
|
+
if (size === "md") {
|
|
2162
|
+
return styled.css(_templateObject10$1 || (_templateObject10$1 = _taggedTemplateLiteral(["\n font-size: ", ";\n "])), theme.fontSize.sm);
|
|
2163
|
+
}
|
|
2164
|
+
if (size === "lg") {
|
|
2165
|
+
return styled.css(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n font-size: ", ";\n "])), theme.fontSize.base);
|
|
2166
|
+
}
|
|
2167
|
+
return styled.css(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral([""])));
|
|
2168
|
+
});
|
|
2169
|
+
const HelperText$1 = styled.p(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n margin-top: ", ";\n font-size: ", ";\n color: ", ";\n"])), _ref0 => {
|
|
2170
|
+
let {
|
|
2171
|
+
theme
|
|
2172
|
+
} = _ref0;
|
|
2173
|
+
return theme.spacing[1];
|
|
2174
|
+
}, _ref1 => {
|
|
2175
|
+
let {
|
|
2176
|
+
theme
|
|
2177
|
+
} = _ref1;
|
|
2178
|
+
return theme.fontSize.xs;
|
|
2179
|
+
}, _ref10 => {
|
|
2180
|
+
let {
|
|
2181
|
+
theme,
|
|
2182
|
+
hasError
|
|
2183
|
+
} = _ref10;
|
|
2184
|
+
return hasError ? theme.colors.error : theme.colors.gray[500];
|
|
2185
|
+
});
|
|
2186
|
+
const Radio = /*#__PURE__*/React.forwardRef((_ref11, ref) => {
|
|
1733
2187
|
let {
|
|
1734
2188
|
className,
|
|
1735
2189
|
label,
|
|
@@ -1738,38 +2192,27 @@ const Radio = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
1738
2192
|
size = "md",
|
|
1739
2193
|
fullWidth = false,
|
|
1740
2194
|
id
|
|
1741
|
-
} =
|
|
1742
|
-
props = _objectWithoutProperties(
|
|
2195
|
+
} = _ref11,
|
|
2196
|
+
props = _objectWithoutProperties(_ref11, _excluded$1);
|
|
1743
2197
|
const radioId = id || "radio-".concat(Math.random().toString(36).substr(2, 9));
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
};
|
|
1749
|
-
const labelSizes = {
|
|
1750
|
-
sm: "text-sm",
|
|
1751
|
-
md: "text-sm",
|
|
1752
|
-
lg: "text-base"
|
|
1753
|
-
};
|
|
1754
|
-
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);
|
|
1755
|
-
return jsxRuntimeExports.jsxs("div", {
|
|
1756
|
-
className: cn("flex items-start", fullWidth && "w-full"),
|
|
1757
|
-
children: [jsxRuntimeExports.jsx("div", {
|
|
1758
|
-
className: "flex items-center h-5",
|
|
1759
|
-
children: jsxRuntimeExports.jsx("input", _objectSpread2({
|
|
2198
|
+
return jsxRuntimeExports.jsxs(RadioContainer, {
|
|
2199
|
+
fullWidth: fullWidth,
|
|
2200
|
+
children: [jsxRuntimeExports.jsx(RadioWrapper, {
|
|
2201
|
+
children: jsxRuntimeExports.jsx(StyledRadio, _objectSpread2({
|
|
1760
2202
|
type: "radio",
|
|
1761
|
-
|
|
2203
|
+
size: size,
|
|
2204
|
+
hasError: !!error,
|
|
2205
|
+
className: className,
|
|
1762
2206
|
ref: ref,
|
|
1763
2207
|
id: radioId
|
|
1764
2208
|
}, props))
|
|
1765
|
-
}), jsxRuntimeExports.jsxs(
|
|
1766
|
-
|
|
1767
|
-
children: [label && jsxRuntimeExports.jsx("label", {
|
|
2209
|
+
}), jsxRuntimeExports.jsxs(LabelContainer, {
|
|
2210
|
+
children: [label && jsxRuntimeExports.jsx(RadioLabel, {
|
|
1768
2211
|
htmlFor: radioId,
|
|
1769
|
-
|
|
2212
|
+
size: size,
|
|
1770
2213
|
children: label
|
|
1771
|
-
}), (error || helperText) && jsxRuntimeExports.jsx(
|
|
1772
|
-
|
|
2214
|
+
}), (error || helperText) && jsxRuntimeExports.jsx(HelperText$1, {
|
|
2215
|
+
hasError: !!error,
|
|
1773
2216
|
children: error || helperText
|
|
1774
2217
|
})]
|
|
1775
2218
|
})]
|
|
@@ -1778,7 +2221,112 @@ const Radio = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
1778
2221
|
Radio.displayName = "Radio";
|
|
1779
2222
|
|
|
1780
2223
|
const _excluded = ["className", "label", "error", "helperText", "size", "fullWidth", "options", "placeholder", "id"];
|
|
1781
|
-
|
|
2224
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject0, _templateObject1, _templateObject10;
|
|
2225
|
+
const SelectContainer = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n ", "\n"])), _ref => {
|
|
2226
|
+
let {
|
|
2227
|
+
fullWidth
|
|
2228
|
+
} = _ref;
|
|
2229
|
+
return fullWidth && styled.css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: 100%;\n "])));
|
|
2230
|
+
});
|
|
2231
|
+
const SelectLabel = styled.label(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n margin-bottom: ", ";\n font-size: ", ";\n font-weight: 500;\n color: ", ";\n"])), _ref2 => {
|
|
2232
|
+
let {
|
|
2233
|
+
theme
|
|
2234
|
+
} = _ref2;
|
|
2235
|
+
return theme.spacing[1];
|
|
2236
|
+
}, _ref3 => {
|
|
2237
|
+
let {
|
|
2238
|
+
theme
|
|
2239
|
+
} = _ref3;
|
|
2240
|
+
return theme.fontSize.sm;
|
|
2241
|
+
}, _ref4 => {
|
|
2242
|
+
let {
|
|
2243
|
+
theme
|
|
2244
|
+
} = _ref4;
|
|
2245
|
+
return theme.colors.gray[700];
|
|
2246
|
+
});
|
|
2247
|
+
const SelectWrapper = styled.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: relative;\n"])));
|
|
2248
|
+
const StyledSelect = styled.select(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n border: 1px solid ", ";\n border-radius: ", ";\n transition: border-color ", ";\n outline: none;\n appearance: none;\n background-color: ", ";\n font-family: ", ";\n\n &:focus {\n border-color: ", ";\n }\n\n &:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n background-color: ", ";\n }\n\n ", "\n\n ", "\n"])), _ref5 => {
|
|
2249
|
+
let {
|
|
2250
|
+
theme,
|
|
2251
|
+
hasError
|
|
2252
|
+
} = _ref5;
|
|
2253
|
+
return hasError ? theme.colors.error : theme.colors.gray[300];
|
|
2254
|
+
}, _ref6 => {
|
|
2255
|
+
let {
|
|
2256
|
+
theme
|
|
2257
|
+
} = _ref6;
|
|
2258
|
+
return theme.borderRadius.md;
|
|
2259
|
+
}, _ref7 => {
|
|
2260
|
+
let {
|
|
2261
|
+
theme
|
|
2262
|
+
} = _ref7;
|
|
2263
|
+
return theme.transitions.base;
|
|
2264
|
+
}, _ref8 => {
|
|
2265
|
+
let {
|
|
2266
|
+
theme
|
|
2267
|
+
} = _ref8;
|
|
2268
|
+
return theme.colors.white;
|
|
2269
|
+
}, _ref9 => {
|
|
2270
|
+
let {
|
|
2271
|
+
theme
|
|
2272
|
+
} = _ref9;
|
|
2273
|
+
return theme.fontFamily.sans.join(", ");
|
|
2274
|
+
}, _ref0 => {
|
|
2275
|
+
let {
|
|
2276
|
+
theme,
|
|
2277
|
+
hasError
|
|
2278
|
+
} = _ref0;
|
|
2279
|
+
return hasError ? theme.colors.error : theme.colors.primary;
|
|
2280
|
+
}, _ref1 => {
|
|
2281
|
+
let {
|
|
2282
|
+
theme
|
|
2283
|
+
} = _ref1;
|
|
2284
|
+
return theme.colors.gray[50];
|
|
2285
|
+
}, _ref10 => {
|
|
2286
|
+
let {
|
|
2287
|
+
size,
|
|
2288
|
+
theme
|
|
2289
|
+
} = _ref10;
|
|
2290
|
+
if (size === "sm") {
|
|
2291
|
+
return styled.css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n padding: ", " ", ";\n font-size: ", ";\n "])), theme.spacing[3], theme.spacing[3], theme.fontSize.sm);
|
|
2292
|
+
}
|
|
2293
|
+
if (size === "md") {
|
|
2294
|
+
return styled.css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n padding: ", " ", ";\n font-size: ", ";\n "])), theme.spacing[2], theme.spacing[4], theme.fontSize.sm);
|
|
2295
|
+
}
|
|
2296
|
+
if (size === "lg") {
|
|
2297
|
+
return styled.css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n padding: ", " ", ";\n font-size: ", ";\n "])), theme.spacing[3], theme.spacing[4], theme.fontSize.base);
|
|
2298
|
+
}
|
|
2299
|
+
return styled.css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral([""])));
|
|
2300
|
+
}, _ref11 => {
|
|
2301
|
+
let {
|
|
2302
|
+
fullWidth
|
|
2303
|
+
} = _ref11;
|
|
2304
|
+
return fullWidth && styled.css(_templateObject0 || (_templateObject0 = _taggedTemplateLiteral(["\n width: 100%;\n "])));
|
|
2305
|
+
});
|
|
2306
|
+
const SelectIcon = styled.div(_templateObject1 || (_templateObject1 = _taggedTemplateLiteral(["\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n padding-right: ", ";\n pointer-events: none;\n"])), _ref12 => {
|
|
2307
|
+
let {
|
|
2308
|
+
theme
|
|
2309
|
+
} = _ref12;
|
|
2310
|
+
return theme.spacing[3];
|
|
2311
|
+
});
|
|
2312
|
+
const HelperText = styled.p(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n margin-top: ", ";\n font-size: ", ";\n color: ", ";\n"])), _ref13 => {
|
|
2313
|
+
let {
|
|
2314
|
+
theme
|
|
2315
|
+
} = _ref13;
|
|
2316
|
+
return theme.spacing[1];
|
|
2317
|
+
}, _ref14 => {
|
|
2318
|
+
let {
|
|
2319
|
+
theme
|
|
2320
|
+
} = _ref14;
|
|
2321
|
+
return theme.fontSize.xs;
|
|
2322
|
+
}, _ref15 => {
|
|
2323
|
+
let {
|
|
2324
|
+
theme,
|
|
2325
|
+
hasError
|
|
2326
|
+
} = _ref15;
|
|
2327
|
+
return hasError ? theme.colors.error : theme.colors.gray[500];
|
|
2328
|
+
});
|
|
2329
|
+
const Select = /*#__PURE__*/React.forwardRef((_ref16, ref) => {
|
|
1782
2330
|
let {
|
|
1783
2331
|
className,
|
|
1784
2332
|
label,
|
|
@@ -1789,25 +2337,20 @@ const Select = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
1789
2337
|
options,
|
|
1790
2338
|
placeholder,
|
|
1791
2339
|
id
|
|
1792
|
-
} =
|
|
1793
|
-
props = _objectWithoutProperties(
|
|
2340
|
+
} = _ref16,
|
|
2341
|
+
props = _objectWithoutProperties(_ref16, _excluded);
|
|
1794
2342
|
const selectId = id || "select-".concat(Math.random().toString(36).substr(2, 9));
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
lg: "px-4 py-3 text-base"
|
|
1799
|
-
};
|
|
1800
|
-
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);
|
|
1801
|
-
return jsxRuntimeExports.jsxs("div", {
|
|
1802
|
-
className: cn("flex flex-col", fullWidth && "w-full"),
|
|
1803
|
-
children: [label && jsxRuntimeExports.jsx("label", {
|
|
2343
|
+
return jsxRuntimeExports.jsxs(SelectContainer, {
|
|
2344
|
+
fullWidth: fullWidth,
|
|
2345
|
+
children: [label && jsxRuntimeExports.jsx(SelectLabel, {
|
|
1804
2346
|
htmlFor: selectId,
|
|
1805
|
-
className: "mb-1 text-sm font-medium text-secondary-700",
|
|
1806
2347
|
children: label
|
|
1807
|
-
}), jsxRuntimeExports.jsxs(
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
2348
|
+
}), jsxRuntimeExports.jsxs(SelectWrapper, {
|
|
2349
|
+
children: [jsxRuntimeExports.jsxs(StyledSelect, _objectSpread2(_objectSpread2({
|
|
2350
|
+
size: size,
|
|
2351
|
+
fullWidth: fullWidth,
|
|
2352
|
+
hasError: !!error,
|
|
2353
|
+
className: className,
|
|
1811
2354
|
ref: ref,
|
|
1812
2355
|
id: selectId
|
|
1813
2356
|
}, props), {}, {
|
|
@@ -1820,13 +2363,16 @@ const Select = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
1820
2363
|
disabled: option.disabled,
|
|
1821
2364
|
children: option.label
|
|
1822
2365
|
}, option.value))]
|
|
1823
|
-
})), jsxRuntimeExports.jsx(
|
|
1824
|
-
className: "absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",
|
|
2366
|
+
})), jsxRuntimeExports.jsx(SelectIcon, {
|
|
1825
2367
|
children: jsxRuntimeExports.jsx("svg", {
|
|
1826
|
-
|
|
2368
|
+
width: "16",
|
|
2369
|
+
height: "16",
|
|
1827
2370
|
fill: "none",
|
|
1828
2371
|
stroke: "currentColor",
|
|
1829
2372
|
viewBox: "0 0 24 24",
|
|
2373
|
+
style: {
|
|
2374
|
+
color: "#9ca3af"
|
|
2375
|
+
},
|
|
1830
2376
|
children: jsxRuntimeExports.jsx("path", {
|
|
1831
2377
|
strokeLinecap: "round",
|
|
1832
2378
|
strokeLinejoin: "round",
|
|
@@ -1835,14 +2381,109 @@ const Select = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
1835
2381
|
})
|
|
1836
2382
|
})
|
|
1837
2383
|
})]
|
|
1838
|
-
}), (error || helperText) && jsxRuntimeExports.jsx(
|
|
1839
|
-
|
|
2384
|
+
}), (error || helperText) && jsxRuntimeExports.jsx(HelperText, {
|
|
2385
|
+
hasError: !!error,
|
|
1840
2386
|
children: error || helperText
|
|
1841
2387
|
})]
|
|
1842
2388
|
});
|
|
1843
2389
|
});
|
|
1844
2390
|
Select.displayName = "Select";
|
|
1845
2391
|
|
|
2392
|
+
const theme = {
|
|
2393
|
+
colors: {
|
|
2394
|
+
primary: "#007AC2",
|
|
2395
|
+
error: "#ff1100",
|
|
2396
|
+
dark: "#333333",
|
|
2397
|
+
light: "#666666",
|
|
2398
|
+
white: "#ffffff",
|
|
2399
|
+
black: "#000000",
|
|
2400
|
+
gray: {
|
|
2401
|
+
50: "#f9fafb",
|
|
2402
|
+
100: "#f3f4f6",
|
|
2403
|
+
200: "#e5e7eb",
|
|
2404
|
+
300: "#d1d5db",
|
|
2405
|
+
400: "#9ca3af",
|
|
2406
|
+
500: "#6b7280",
|
|
2407
|
+
600: "#4b5563",
|
|
2408
|
+
700: "#374151",
|
|
2409
|
+
800: "#1f2937",
|
|
2410
|
+
900: "#111827"
|
|
2411
|
+
}
|
|
2412
|
+
},
|
|
2413
|
+
spacing: {
|
|
2414
|
+
0: "0",
|
|
2415
|
+
1: "0.25rem",
|
|
2416
|
+
2: "0.5rem",
|
|
2417
|
+
3: "0.75rem",
|
|
2418
|
+
4: "1rem",
|
|
2419
|
+
5: "1.25rem",
|
|
2420
|
+
6: "1.5rem",
|
|
2421
|
+
8: "2rem",
|
|
2422
|
+
10: "2.5rem",
|
|
2423
|
+
12: "3rem",
|
|
2424
|
+
16: "4rem",
|
|
2425
|
+
18: "4.5rem",
|
|
2426
|
+
20: "5rem",
|
|
2427
|
+
24: "6rem",
|
|
2428
|
+
32: "8rem",
|
|
2429
|
+
40: "10rem",
|
|
2430
|
+
48: "12rem",
|
|
2431
|
+
56: "14rem",
|
|
2432
|
+
64: "16rem",
|
|
2433
|
+
88: "22rem"
|
|
2434
|
+
},
|
|
2435
|
+
fontSize: {
|
|
2436
|
+
xs: "0.75rem",
|
|
2437
|
+
sm: "0.875rem",
|
|
2438
|
+
base: "1rem",
|
|
2439
|
+
lg: "1.125rem",
|
|
2440
|
+
xl: "1.25rem",
|
|
2441
|
+
"2xl": "1.5rem",
|
|
2442
|
+
"3xl": "1.875rem",
|
|
2443
|
+
"4xl": "2.25rem",
|
|
2444
|
+
"5xl": "3rem",
|
|
2445
|
+
"6xl": "3.75rem"
|
|
2446
|
+
},
|
|
2447
|
+
fontFamily: {
|
|
2448
|
+
sans: ["Inter", "system-ui", "sans-serif"],
|
|
2449
|
+
serif: ["Georgia", "Cambria", "Times New Roman", "Times", "serif"],
|
|
2450
|
+
mono: ["Menlo", "Monaco", "Consolas", "Liberation Mono", "Courier New", "monospace"]
|
|
2451
|
+
},
|
|
2452
|
+
borderRadius: {
|
|
2453
|
+
none: "0",
|
|
2454
|
+
sm: "0.125rem",
|
|
2455
|
+
base: "0.25rem",
|
|
2456
|
+
md: "0.375rem",
|
|
2457
|
+
lg: "0.5rem",
|
|
2458
|
+
xl: "0.75rem",
|
|
2459
|
+
"2xl": "1rem",
|
|
2460
|
+
"3xl": "1.5rem",
|
|
2461
|
+
full: "9999px"
|
|
2462
|
+
},
|
|
2463
|
+
shadows: {
|
|
2464
|
+
sm: "0 1px 2px 0 rgba(0, 0, 0, 0.05)",
|
|
2465
|
+
base: "0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",
|
|
2466
|
+
md: "0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",
|
|
2467
|
+
lg: "0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",
|
|
2468
|
+
xl: "0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)"
|
|
2469
|
+
},
|
|
2470
|
+
transitions: {
|
|
2471
|
+
fast: "150ms ease-in-out",
|
|
2472
|
+
base: "300ms ease-in-out",
|
|
2473
|
+
slow: "500ms ease-in-out"
|
|
2474
|
+
}
|
|
2475
|
+
};
|
|
2476
|
+
|
|
2477
|
+
const ThemeProvider = _ref => {
|
|
2478
|
+
let {
|
|
2479
|
+
children
|
|
2480
|
+
} = _ref;
|
|
2481
|
+
return jsxRuntimeExports.jsx(styled.ThemeProvider, {
|
|
2482
|
+
theme: theme,
|
|
2483
|
+
children: children
|
|
2484
|
+
});
|
|
2485
|
+
};
|
|
2486
|
+
|
|
1846
2487
|
// Ensure React is available before importing components
|
|
1847
2488
|
|
|
1848
2489
|
exports.React = React;
|
|
@@ -1854,5 +2495,6 @@ exports.InputFile = InputFile;
|
|
|
1854
2495
|
exports.Radio = Radio;
|
|
1855
2496
|
exports.Select = Select;
|
|
1856
2497
|
exports.Textarea = Textarea;
|
|
1857
|
-
exports.
|
|
2498
|
+
exports.ThemeProvider = ThemeProvider;
|
|
2499
|
+
exports.theme = theme;
|
|
1858
2500
|
//# sourceMappingURL=index.js.map
|