@rovula/ui 0.0.7 → 0.0.9

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.
Files changed (37) hide show
  1. package/dist/cjs/bundle.css +136 -33
  2. package/dist/cjs/bundle.js +1 -1
  3. package/dist/cjs/bundle.js.map +1 -1
  4. package/dist/cjs/types/components/Dropdown/Dropdown.d.ts +26 -0
  5. package/dist/cjs/types/components/Dropdown/Dropdown.stories.d.ts +367 -0
  6. package/dist/cjs/types/components/Dropdown/Dropdown.styles.d.ts +11 -0
  7. package/dist/cjs/types/components/TextInput/TextInput.d.ts +3 -2
  8. package/dist/cjs/types/components/TextInput/TextInput.stories.d.ts +2 -16
  9. package/dist/cjs/types/components/TextInput/TextInput.styles.d.ts +0 -1
  10. package/dist/cjs/types/index.d.ts +1 -0
  11. package/dist/components/Dropdown/Dropdown.js +58 -0
  12. package/dist/components/Dropdown/Dropdown.stories.js +43 -0
  13. package/dist/components/Dropdown/Dropdown.styles.js +47 -0
  14. package/dist/components/TextInput/TextInput.js +3 -5
  15. package/dist/components/TextInput/TextInput.stories.js +1 -1
  16. package/dist/components/TextInput/TextInput.styles.js +13 -21
  17. package/dist/esm/bundle.css +136 -33
  18. package/dist/esm/bundle.js +1 -1
  19. package/dist/esm/bundle.js.map +1 -1
  20. package/dist/esm/types/components/Dropdown/Dropdown.d.ts +26 -0
  21. package/dist/esm/types/components/Dropdown/Dropdown.stories.d.ts +367 -0
  22. package/dist/esm/types/components/Dropdown/Dropdown.styles.d.ts +11 -0
  23. package/dist/esm/types/components/TextInput/TextInput.d.ts +3 -2
  24. package/dist/esm/types/components/TextInput/TextInput.stories.d.ts +2 -16
  25. package/dist/esm/types/components/TextInput/TextInput.styles.d.ts +0 -1
  26. package/dist/esm/types/index.d.ts +1 -0
  27. package/dist/index.d.ts +29 -2
  28. package/dist/index.js +1 -0
  29. package/dist/src/theme/global.css +170 -38
  30. package/package.json +1 -1
  31. package/src/components/Dropdown/Dropdown.stories.tsx +49 -0
  32. package/src/components/Dropdown/Dropdown.styles.ts +54 -0
  33. package/src/components/Dropdown/Dropdown.tsx +151 -0
  34. package/src/components/TextInput/TextInput.stories.tsx +3 -3
  35. package/src/components/TextInput/TextInput.styles.ts +13 -21
  36. package/src/components/TextInput/TextInput.tsx +14 -5
  37. package/src/index.ts +1 -0
@@ -21,13 +21,12 @@ var __rest = (this && this.__rest) || function (s, e) {
21
21
  return t;
22
22
  };
23
23
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
24
- import { forwardRef, useImperativeHandle, useRef } from "react";
24
+ import { forwardRef, useImperativeHandle, useRef, } from "react";
25
25
  import { helperTextVariant, iconVariant, iconWrapperVariant, inputVariant, labelVariant, } from "./TextInput.styles";
26
26
  import { twMerge } from "tailwind-merge";
27
27
  import { XCircleIcon, ExclamationCircleIcon } from "@heroicons/react/16/solid";
28
28
  var TextInput = forwardRef(function (_a, ref) {
29
- var _b;
30
- var id = _a.id, label = _a.label, _c = _a.size, size = _c === void 0 ? "md" : _c, _d = _a.rounded, rounded = _d === void 0 ? "normal" : _d, _e = _a.variant, variant = _e === void 0 ? "outline" : _e, _f = _a.type, type = _f === void 0 ? "text" : _f, helperText = _a.helperText, errorMessage = _a.errorMessage, _g = _a.fullwidth, fullwidth = _g === void 0 ? false : _g, _h = _a.disabled, disabled = _h === void 0 ? false : _h, _j = _a.error, error = _j === void 0 ? false : _j, _k = _a.required, required = _k === void 0 ? true : _k, _l = _a.hasClearIcon, hasClearIcon = _l === void 0 ? true : _l, props = __rest(_a, ["id", "label", "size", "rounded", "variant", "type", "helperText", "errorMessage", "fullwidth", "disabled", "error", "required", "hasClearIcon"]);
29
+ var id = _a.id, label = _a.label, _b = _a.size, size = _b === void 0 ? "md" : _b, _c = _a.rounded, rounded = _c === void 0 ? "normal" : _c, _d = _a.variant, variant = _d === void 0 ? "outline" : _d, _e = _a.type, type = _e === void 0 ? "text" : _e, helperText = _a.helperText, errorMessage = _a.errorMessage, _f = _a.fullwidth, fullwidth = _f === void 0 ? true : _f, _g = _a.disabled, disabled = _g === void 0 ? false : _g, _h = _a.error, error = _h === void 0 ? false : _h, _j = _a.required, required = _j === void 0 ? true : _j, _k = _a.hasClearIcon, hasClearIcon = _k === void 0 ? true : _k, endIcon = _a.endIcon, props = __rest(_a, ["id", "label", "size", "rounded", "variant", "type", "helperText", "errorMessage", "fullwidth", "disabled", "error", "required", "hasClearIcon", "endIcon"]);
31
30
  var inputRef = useRef(null);
32
31
  var _id = id || "".concat(type, "-").concat(label, "-input");
33
32
  var inputClassname = inputVariant({
@@ -43,7 +42,6 @@ var TextInput = forwardRef(function (_a, ref) {
43
42
  size: size,
44
43
  disabled: disabled,
45
44
  error: error,
46
- isFloating: (_b = !!props.value) !== null && _b !== void 0 ? _b : false,
47
45
  });
48
46
  var helperTextClassname = helperTextVariant({ size: size, error: error, disabled: disabled });
49
47
  var iconWrapperClassname = iconWrapperVariant({ size: size });
@@ -56,6 +54,6 @@ var TextInput = forwardRef(function (_a, ref) {
56
54
  inputRef.current.value = "";
57
55
  }
58
56
  };
59
- return (_jsxs("div", { className: "flex flex-col ".concat(fullwidth ? "w-full" : ""), children: [_jsxs("div", { className: "relative", children: [_jsx("input", __assign({}, props, { ref: inputRef, type: type, id: _id, disabled: disabled, className: twMerge(inputClassname, props.className) })), hasClearIcon && (_jsx("div", { className: iconWrapperClassname, children: _jsx(XCircleIcon, { type: "button", className: iconClassname, onMouseDown: handleClearInput }) })), _jsxs("label", { htmlFor: _id, className: labelClassname, children: [label, " ", required && _jsx("span", { className: "text-error", children: "*" })] })] }), (errorMessage || helperText) && (_jsxs("span", { className: helperTextClassname, children: [_jsx(ExclamationCircleIcon, { width: 16, height: 16, className: error ? "fill-error" : "" }), " ", errorMessage || helperText] }))] }));
57
+ return (_jsxs("div", { className: "inline-flex flex-col ".concat(fullwidth ? "w-full" : ""), children: [_jsxs("div", { className: "relative", children: [_jsx("input", __assign({}, props, { placeholder: " ", ref: inputRef, type: type, id: _id, disabled: disabled, className: twMerge(inputClassname, props.className) })), hasClearIcon && (_jsx("div", { className: iconWrapperClassname, children: _jsx(XCircleIcon, { type: "button", className: iconClassname, onMouseDown: handleClearInput }) })), endIcon, _jsxs("label", { htmlFor: _id, className: labelClassname, children: [label, " ", required && _jsx("span", { className: "text-error", children: "*" })] })] }), (errorMessage || helperText) && (_jsxs("span", { className: helperTextClassname, children: [_jsx(ExclamationCircleIcon, { width: 16, height: 16, className: error ? "fill-error" : "" }), " ", errorMessage || helperText] }))] }));
60
58
  });
61
59
  export default TextInput;
@@ -34,6 +34,6 @@ export var Default = {
34
34
  render: function (args) {
35
35
  console.log("args ", args);
36
36
  var props = __assign({}, args);
37
- return (_jsxs("div", { className: "flex flex-row gap-4 w-full", children: [_jsx(TextInput, __assign({ id: "1", placeholder: "placeholder", size: "lg" }, args)), _jsx(TextInput, __assign({ id: "2", placeholder: "placeholder", size: "md" }, args)), _jsx(TextInput, __assign({ id: "3", placeholder: "placeholder", size: "sm" }, args))] }));
37
+ return (_jsxs("div", { className: "flex flex-row gap-4 w-full", children: [_jsx(TextInput, __assign({ id: "1", size: "lg" }, args)), _jsx(TextInput, __assign({ id: "2", size: "md" }, args)), _jsx(TextInput, __assign({ id: "3", size: "sm" }, args))] }));
38
38
  },
39
39
  };
@@ -1,7 +1,7 @@
1
1
  import { cva } from "class-variance-authority";
2
2
  export var inputVariant = cva([
3
3
  "border-0 outline-none",
4
- "p-1 flex",
4
+ "p-1 flex w-auto box-border",
5
5
  "peer text-black placeholder:text-transparent",
6
6
  ], {
7
7
  variants: {
@@ -17,7 +17,7 @@ export var inputVariant = cva([
17
17
  },
18
18
  variant: {
19
19
  flat: "",
20
- outline: "ring-1 ring-inset ring-input-stroke hover:ring-input-active focus:ring-2 focus:ring-inset focus:ring-input-active",
20
+ outline: "ring-1 ring-inset ring-input-stroke hover:ring-input-active focus:ring-1 focus:ring-inset focus:ring-input-stroke-active",
21
21
  underline: "border-b-2 border-input-stroke transition-colors hover:border-input-stroke-active focus:border-input-stroke",
22
22
  },
23
23
  fullwidth: {
@@ -27,7 +27,7 @@ export var inputVariant = cva([
27
27
  true: "text-input-text-disabled ring-input-stroke-disabled placeholder:text-input-text-disabled",
28
28
  },
29
29
  error: {
30
- true: "ring-error",
30
+ true: "ring-error focus:ring-error",
31
31
  },
32
32
  hasClearIcon: {
33
33
  true: "",
@@ -65,21 +65,24 @@ export var inputVariant = cva([
65
65
  },
66
66
  });
67
67
  export var labelVariant = cva([
68
- "absolute block transition-all px-[2px] text-input-text peer-focus:text-input-text-active peer-focus:bg-input-label-background",
68
+ "absolute block duration-450 transition-all px-[2px] text-input-text peer-focus:text-input-text-active peer-focus:bg-input-label-background",
69
69
  ], {
70
70
  variants: {
71
71
  size: {
72
72
  sm: [
73
- "left-3 top-2 typography-small1 peer-focus:-top-1.5 peer-focus:typography-label2",
74
- "bg-input-label-background peer-[:not(:placeholder-shown)]:-top-1.5 peer-[:not(:placeholder-shown)]:typography-label2",
73
+ "left-3 -top-1.5 typography-label2 bg-input-label-background",
74
+ "peer-placeholder-shown:top-2 peer-placeholder-shown:typography-small1 peer-placeholder-shown:bg-transparent",
75
+ "peer-focus:-top-1.5 peer-focus:typography-label2",
75
76
  ],
76
77
  md: [
77
- "left-3 top-2 typography-subtitile4 peer-focus:-top-1.5 peer-focus:typography-label1",
78
- "bg-input-label-background peer-[:not(:placeholder-shown)]:-top-1.5 peer-[:not(:placeholder-shown)]:typography-label1",
78
+ "left-3 -top-1.5 typography-label1 bg-input-label-background",
79
+ "peer-placeholder-shown:top-2 peer-placeholder-shown:typography-subtitile4 peer-placeholder-shown:bg-transparent",
80
+ "peer-focus:-top-1.5 peer-focus:typography-label1",
79
81
  ],
80
82
  lg: [
81
- "left-4 top-4 typography-subtitile1 peer-focus:-top-1.5 peer-focus:typography-label1",
82
- "bg-input-label-background peer-[:not(:placeholder-shown)]:-top-1.5 peer-[:not(:placeholder-shown)]:typography-label1",
83
+ "left-4 -top-1.5 typography-label1 bg-input-label-background",
84
+ "peer-placeholder-shown:top-4 peer-placeholder-shown:typography-subtitile1 peer-placeholder-shown:bg-transparent",
85
+ "peer-focus:-top-1.5 peer-focus:typography-label1",
83
86
  ],
84
87
  },
85
88
  disabled: {
@@ -88,22 +91,11 @@ export var labelVariant = cva([
88
91
  error: {
89
92
  true: "ring-error",
90
93
  },
91
- isFloating: {
92
- true: "-top-1.5 typography-label1 bg-input-label-background",
93
- },
94
94
  },
95
- compoundVariants: [
96
- {
97
- size: "sm",
98
- isFloating: true,
99
- class: "-top-1.5 typography-label2 bg-input-label-background",
100
- },
101
- ],
102
95
  defaultVariants: {
103
96
  size: "md",
104
97
  disabled: false,
105
98
  error: false,
106
- isFloating: false,
107
99
  },
108
100
  });
109
101
  export var helperTextVariant = cva(["text-small1 flex flex-row items-center gap-1"], {
@@ -671,11 +671,8 @@ video {
671
671
  .right-0 {
672
672
  right: 0px;
673
673
  }
674
- .top-2 {
675
- top: 0.5rem;
676
- }
677
- .top-4 {
678
- top: 1rem;
674
+ .z-10 {
675
+ z-index: 10;
679
676
  }
680
677
  .z-50 {
681
678
  z-index: 50;
@@ -703,6 +700,9 @@ video {
703
700
  .mt-\[6px\] {
704
701
  margin-top: 6px;
705
702
  }
703
+ .box-border {
704
+ box-sizing: border-box;
705
+ }
706
706
  .block {
707
707
  display: block;
708
708
  }
@@ -733,18 +733,36 @@ video {
733
733
  width: 1.25rem;
734
734
  height: 1.25rem;
735
735
  }
736
+ .size-6 {
737
+ width: 1.5rem;
738
+ height: 1.5rem;
739
+ }
740
+ .size-\[14px\] {
741
+ width: 14px;
742
+ height: 14px;
743
+ }
744
+ .max-h-60 {
745
+ max-height: 15rem;
746
+ }
736
747
  .w-\[200px\] {
737
748
  width: 200px;
738
749
  }
739
750
  .w-\[400px\] {
740
751
  width: 400px;
741
752
  }
753
+ .w-auto {
754
+ width: auto;
755
+ }
742
756
  .w-full {
743
757
  width: 100%;
744
758
  }
745
759
  .max-w-3xl {
746
760
  max-width: 48rem;
747
761
  }
762
+ .rotate-180 {
763
+ --tw-rotate: 180deg;
764
+ transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
765
+ }
748
766
  .cursor-pointer {
749
767
  cursor: pointer;
750
768
  }
@@ -795,6 +813,9 @@ video {
795
813
  .overflow-x-auto {
796
814
  overflow-x: auto;
797
815
  }
816
+ .overflow-y-auto {
817
+ overflow-y: auto;
818
+ }
798
819
  .whitespace-nowrap {
799
820
  white-space: nowrap;
800
821
  }
@@ -816,6 +837,9 @@ video {
816
837
  .rounded-lg {
817
838
  border-radius: 0.5rem;
818
839
  }
840
+ .rounded-md {
841
+ border-radius: 0.375rem;
842
+ }
819
843
  .rounded-none {
820
844
  border-radius: 0px;
821
845
  }
@@ -838,6 +862,10 @@ video {
838
862
  --tw-border-opacity: 1;
839
863
  border-color: rgb(var(--error-100) / var(--tw-border-opacity));
840
864
  }
865
+ .border-gray-300 {
866
+ --tw-border-opacity: 1;
867
+ border-color: rgb(209 213 219 / var(--tw-border-opacity));
868
+ }
841
869
  .border-info {
842
870
  --tw-border-opacity: 1;
843
871
  border-color: rgb(var(--info-default) / var(--tw-border-opacity));
@@ -873,6 +901,10 @@ video {
873
901
  --tw-bg-opacity: 1;
874
902
  background-color: rgb(var(--error-100) / var(--tw-bg-opacity));
875
903
  }
904
+ .bg-gray-200 {
905
+ --tw-bg-opacity: 1;
906
+ background-color: rgb(229 231 235 / var(--tw-bg-opacity));
907
+ }
876
908
  .bg-info {
877
909
  --tw-bg-opacity: 1;
878
910
  background-color: rgb(var(--info-default) / var(--tw-bg-opacity));
@@ -908,12 +940,25 @@ video {
908
940
  --tw-bg-opacity: 1;
909
941
  background-color: rgb(var(--warning-default) / var(--tw-bg-opacity));
910
942
  }
943
+ .bg-white {
944
+ --tw-bg-opacity: 1;
945
+ background-color: rgb(255 255 255 / var(--tw-bg-opacity));
946
+ }
911
947
  .fill-error {
912
948
  fill: rgb(var(--error-100) / 1);
913
949
  }
914
950
  .fill-input-stroke-active {
915
951
  fill: rgb(var(--input-active-stroke-color) / 1);
916
952
  }
953
+ .fill-input-text {
954
+ fill: rgb(var(--input-default-text-color) / 1);
955
+ }
956
+ .fill-input-text-active {
957
+ fill: rgb(var(--input-active-text-color) / 1);
958
+ }
959
+ .fill-input-text-disabled {
960
+ fill: rgb(var(--input-disabled-text-color) / 1);
961
+ }
917
962
  .p-1 {
918
963
  padding: 0.25rem;
919
964
  }
@@ -946,6 +991,10 @@ video {
946
991
  padding-top: 0.25rem;
947
992
  padding-bottom: 0.25rem;
948
993
  }
994
+ .py-14 {
995
+ padding-top: 3.5rem;
996
+ padding-bottom: 3.5rem;
997
+ }
949
998
  .py-2 {
950
999
  padding-top: 0.5rem;
951
1000
  padding-bottom: 0.5rem;
@@ -954,6 +1003,18 @@ video {
954
1003
  padding-top: 1rem;
955
1004
  padding-bottom: 1rem;
956
1005
  }
1006
+ .pe-\[30px\] {
1007
+ padding-inline-end: 30px;
1008
+ }
1009
+ .pe-\[40px\] {
1010
+ padding-inline-end: 40px;
1011
+ }
1012
+ .pe-\[48px\] {
1013
+ padding-inline-end: 48px;
1014
+ }
1015
+ .text-center {
1016
+ text-align: center;
1017
+ }
957
1018
  .align-middle {
958
1019
  vertical-align: middle;
959
1020
  }
@@ -1170,6 +1231,11 @@ video {
1170
1231
  .underline-offset-4 {
1171
1232
  text-underline-offset: 4px;
1172
1233
  }
1234
+ .shadow-md {
1235
+ --tw-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
1236
+ --tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);
1237
+ box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
1238
+ }
1173
1239
  .outline-none {
1174
1240
  outline: 2px solid transparent;
1175
1241
  outline-offset: 2px;
@@ -1197,6 +1263,9 @@ video {
1197
1263
  --tw-ring-opacity: 1;
1198
1264
  --tw-ring-color: rgb(var(--input-disabled-stroke-color) / var(--tw-ring-opacity));
1199
1265
  }
1266
+ .filter {
1267
+ filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
1268
+ }
1200
1269
  .transition-all {
1201
1270
  transition-property: all;
1202
1271
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
@@ -1348,6 +1417,10 @@ video {
1348
1417
  --tw-bg-opacity: 1;
1349
1418
  background-color: rgb(var(--error-120) / var(--tw-bg-opacity));
1350
1419
  }
1420
+ .hover\:bg-gray-100:hover {
1421
+ --tw-bg-opacity: 1;
1422
+ background-color: rgb(243 244 246 / var(--tw-bg-opacity));
1423
+ }
1351
1424
  .hover\:bg-info-100:hover {
1352
1425
  --tw-bg-opacity: 1;
1353
1426
  background-color: rgb(var(--info-100)) / var(--tw-bg-opacity));
@@ -1400,19 +1473,75 @@ video {
1400
1473
  .focus\:pe-8:focus {
1401
1474
  padding-inline-end: 2rem;
1402
1475
  }
1403
- .focus\:ring-2:focus {
1476
+ .focus\:ring-1:focus {
1404
1477
  --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
1405
- --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
1478
+ --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);
1406
1479
  box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
1407
1480
  }
1408
1481
  .focus\:ring-inset:focus {
1409
1482
  --tw-ring-inset: inset;
1410
1483
  }
1484
+ .focus\:ring-error:focus {
1485
+ --tw-ring-opacity: 1;
1486
+ --tw-ring-color: rgb(var(--error-100) / var(--tw-ring-opacity));
1487
+ }
1488
+ .focus\:ring-input-stroke-active:focus {
1489
+ --tw-ring-opacity: 1;
1490
+ --tw-ring-color: rgb(var(--input-active-stroke-color) / var(--tw-ring-opacity));
1491
+ }
1411
1492
  .active\:scale-\[98\%\]:active {
1412
1493
  --tw-scale-x: 98%;
1413
1494
  --tw-scale-y: 98%;
1414
1495
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
1415
1496
  }
1497
+ .peer:-moz-placeholder-shown ~ .peer-placeholder-shown\:top-2 {
1498
+ top: 0.5rem;
1499
+ }
1500
+ .peer:placeholder-shown ~ .peer-placeholder-shown\:top-2 {
1501
+ top: 0.5rem;
1502
+ }
1503
+ .peer:-moz-placeholder-shown ~ .peer-placeholder-shown\:top-4 {
1504
+ top: 1rem;
1505
+ }
1506
+ .peer:placeholder-shown ~ .peer-placeholder-shown\:top-4 {
1507
+ top: 1rem;
1508
+ }
1509
+ .peer:-moz-placeholder-shown ~ .peer-placeholder-shown\:bg-transparent {
1510
+ background-color: transparent;
1511
+ }
1512
+ .peer:placeholder-shown ~ .peer-placeholder-shown\:bg-transparent {
1513
+ background-color: transparent;
1514
+ }
1515
+ .peer:-moz-placeholder-shown ~ .peer-placeholder-shown\:typography-subtitile1 {
1516
+ font-size: 16px;
1517
+ line-height: 24px;
1518
+ font-weight: 400;
1519
+ }
1520
+ .peer:placeholder-shown ~ .peer-placeholder-shown\:typography-subtitile1 {
1521
+ font-size: 16px;
1522
+ line-height: 24px;
1523
+ font-weight: 400;
1524
+ }
1525
+ .peer:-moz-placeholder-shown ~ .peer-placeholder-shown\:typography-subtitile4 {
1526
+ font-size: 14px;
1527
+ line-height: 22px;
1528
+ font-weight: 400;
1529
+ }
1530
+ .peer:placeholder-shown ~ .peer-placeholder-shown\:typography-subtitile4 {
1531
+ font-size: 14px;
1532
+ line-height: 22px;
1533
+ font-weight: 400;
1534
+ }
1535
+ .peer:-moz-placeholder-shown ~ .peer-placeholder-shown\:typography-small1 {
1536
+ font-size: 12px;
1537
+ line-height: 14px;
1538
+ font-weight: 400;
1539
+ }
1540
+ .peer:placeholder-shown ~ .peer-placeholder-shown\:typography-small1 {
1541
+ font-size: 12px;
1542
+ line-height: 14px;
1543
+ font-weight: 400;
1544
+ }
1416
1545
  .peer:focus ~ .peer-focus\:-top-1 {
1417
1546
  top: -0.25rem;
1418
1547
  }
@@ -1440,32 +1569,6 @@ video {
1440
1569
  line-height: 10px;
1441
1570
  font-weight: 400;
1442
1571
  }
1443
- .peer:not(:-moz-placeholder-shown) ~ .peer-\[\:not\(\:-moz-placeholder-shown\)\]\:-top-1\.5 {
1444
- top: -0.375rem;
1445
- }
1446
- .peer:not(:placeholder-shown) ~ .peer-\[\:not\(\:placeholder-shown\)\]\:-top-1\.5 {
1447
- top: -0.375rem;
1448
- }
1449
- .peer:not(:-moz-placeholder-shown) ~ .peer-\[\:not\(\:-moz-placeholder-shown\)\]\:typography-label1 {
1450
- font-size: 12px;
1451
- line-height: 12px;
1452
- font-weight: 400;
1453
- }
1454
- .peer:not(:placeholder-shown) ~ .peer-\[\:not\(\:placeholder-shown\)\]\:typography-label1 {
1455
- font-size: 12px;
1456
- line-height: 12px;
1457
- font-weight: 400;
1458
- }
1459
- .peer:not(:-moz-placeholder-shown) ~ .peer-\[\:not\(\:-moz-placeholder-shown\)\]\:typography-label2 {
1460
- font-size: 10px;
1461
- line-height: 10px;
1462
- font-weight: 400;
1463
- }
1464
- .peer:not(:placeholder-shown) ~ .peer-\[\:not\(\:placeholder-shown\)\]\:typography-label2 {
1465
- font-size: 10px;
1466
- line-height: 10px;
1467
- font-weight: 400;
1468
- }
1469
1572
  .aria-disabled\:pointer-events-none[aria-disabled="true"] {
1470
1573
  pointer-events: none;
1471
1574
  }
@@ -1,2 +1,2 @@
1
- import{jsx as e,jsxs as r,Fragment as t}from"react/jsx-runtime";import{twMerge as a}from"tailwind-merge";import{cva as o}from"class-variance-authority";import*as n from"react";import{forwardRef as i,useRef as l,useImperativeHandle as s,useState as d}from"react";var c=function(){return c=Object.assign||function(e){for(var r,t=1,a=arguments.length;t<a;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e},c.apply(this,arguments)};function u(e,r){var t={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&r.indexOf(a)<0&&(t[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(a=Object.getOwnPropertySymbols(e);o<a.length;o++)r.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(t[a[o]]=e[a[o]])}return t}"function"==typeof SuppressedError&&SuppressedError;var p=o(["gap-2 font-bold text-white hover:bg-opacity-90 active:scale-[98%]"],{variants:{color:{primary:"bg-primary border-primary text-primary hover:bg-primary-80",secondary:"border-secondary bg-secondary-100 text-secondary-foreground hover:bg-secondary-120",tertiary:"border-tertiary-120 bg-tertiary-120 text-tertiary-120 hover:bg-tertiary-100",success:"border-success bg-success text-success hover:bg-success-120",info:"border-info bg-info text-info hover:bg-info-100",warning:"border-warning bg-warning text-warning hover:bg-warning-100 hover:border-warning-100",error:"border-error bg-error text-error hover:bg-error-120 hover:border-error-120"},size:{sm:"px-3 py-1 text-sm rounded-[--btn-rounded-sm]",md:"px-4 py-2 text-sm rounded-[--btn-rounded-md]",lg:"px-6 py-4 text-base rounded-[--btn-rounded-lg]"},variant:{solid:"border",outline:"border bg-transparent hover:bg-opacity-20",flat:"bg-transparent hover:bg-opacity-20",link:"bg-transparent underline underline-offset-4 hover:bg-transparent hover:text-opacity-80"},disabled:{true:"pointer-events-none border-transparent bg-secondary-110 text-secondary-130"},fullwidth:{true:"w-full"}},compoundVariants:[{variant:["flat","link"],disabled:!0,class:"border-transparent bg-transparent"},{variant:"solid",color:"primary",class:"text-primary-foreground"},{variant:"solid",color:"secondary",class:"text-secondary-foreground"},{variant:"solid",disabled:!0,color:"secondary",class:"text-white"},{variant:"solid",color:"tertiary",class:"text-tertiary-foreground"},{variant:"solid",color:"success",class:"text-success-foreground"},{variant:"solid",color:"info",class:"text-info-foreground"},{variant:"solid",color:"warning",class:"text-warning-foreground"},{variant:"solid",color:"error",class:"text-error-foreground"}],defaultVariants:{size:"md",color:"primary",variant:"solid",fullwidth:!0}}),b=function(o){var n=o.size,i=void 0===n?"md":n,l=o.color,s=void 0===l?"primary":l,d=o.variant,b=void 0===d?"solid":d,f=o.title,g=o.children,h=o.startIcon,v=o.endIcon,m=o.disabled,y=void 0!==m&&m,x=o.fullwidth,w=void 0!==x&&x,z=o.isLoading,N=void 0!==z&&z,k=o.className,I=u(o,["size","color","variant","title","children","startIcon","endIcon","disabled","fullwidth","isLoading","className"]),O=y||N;return e("button",c({type:"button"},I,{"aria-disabled":O||void 0,tabIndex:O?-1:0,className:a(p({size:i,color:s,variant:b,disabled:y,fullwidth:w}),k),disabled:O,children:r(t,{children:[h,g||f,v]})}))},f=function(t){var a=t.columns,o=t.data;return r("table",{className:"table",children:[e("thead",{children:e("tr",{children:a.map((function(r,t){return e("th",{children:r.header},t)}))})}),e("tbody",{children:o.map((function(r,t){return e("tr",{children:a.map((function(t,a){return e("td",{children:r[t.accessor]},a)}))},t)}))})]})},g=o(["border-0 outline-none","p-1 flex","peer text-black placeholder:text-transparent"],{variants:{size:{sm:"p-2 px-3 typography-small1",md:"py-2 px-3 typography-subtitile4",lg:"p-4 typography-subtitile1"},rounded:{none:"rounded-none",normal:"rounded-xl",full:"rounded-full"},variant:{flat:"",outline:"ring-1 ring-inset ring-input-stroke hover:ring-input-active focus:ring-2 focus:ring-inset focus:ring-input-active",underline:"border-b-2 border-input-stroke transition-colors hover:border-input-stroke-active focus:border-input-stroke"},fullwidth:{true:"w-full"},disabled:{true:"text-input-text-disabled ring-input-stroke-disabled placeholder:text-input-text-disabled"},error:{true:"ring-error"},hasClearIcon:{true:""}},compoundVariants:[{variant:"underline",className:"rounded-none"},{hasClearIcon:!0,size:"sm",class:"focus:pe-6"},{hasClearIcon:!0,size:"md",class:"focus:pe-8"},{hasClearIcon:!0,size:"lg",class:"focus:pe-10"}],defaultVariants:{size:"md",variant:"outline",rounded:"normal",fullwidth:!1,disabled:!1,error:!1,hasClearIcon:!1}}),h=o(["absolute block transition-all px-[2px] text-input-text peer-focus:text-input-text-active peer-focus:bg-input-label-background"],{variants:{size:{sm:["left-3 top-2 typography-small1 peer-focus:-top-1.5 peer-focus:typography-label2","bg-input-label-background peer-[:not(:placeholder-shown)]:-top-1.5 peer-[:not(:placeholder-shown)]:typography-label2"],md:["left-3 top-2 typography-subtitile4 peer-focus:-top-1.5 peer-focus:typography-label1","bg-input-label-background peer-[:not(:placeholder-shown)]:-top-1.5 peer-[:not(:placeholder-shown)]:typography-label1"],lg:["left-4 top-4 typography-subtitile1 peer-focus:-top-1.5 peer-focus:typography-label1","bg-input-label-background peer-[:not(:placeholder-shown)]:-top-1.5 peer-[:not(:placeholder-shown)]:typography-label1"]},disabled:{true:"text-input-text-disabled ring-input-stroke-disabled placeholder:text-input-text-disabled"},error:{true:"ring-error"},isFloating:{true:"-top-1.5 typography-label1 bg-input-label-background"}},compoundVariants:[{size:"sm",isFloating:!0,class:"-top-1.5 typography-label2 bg-input-label-background"}],defaultVariants:{size:"md",disabled:!1,error:!1,isFloating:!1}}),v=o(["text-small1 flex flex-row items-center gap-1"],{variants:{size:{sm:"mt-1",md:"mt-[6px]",lg:"mt-[6px]"},disabled:{true:"text-input-text-disabled"},error:{true:"text-error",false:"text-input-text"}},defaultVariants:{size:"md",disabled:!1,error:!1}}),m=o(["absolute inset-y-0 right-0 items-center justify-center hidden peer-focus:flex"],{variants:{size:{sm:"mr-2",md:"mr-3",lg:"mr-4"}},defaultVariants:{size:"md"}}),y=o(["cursor-pointer z-50 fill-input-stroke-active hover:fill-input-text"],{variants:{size:{sm:"size-3",md:"size-4",lg:"size-5"}},defaultVariants:{size:"md"}});const x=n.forwardRef((function({title:e,titleId:r,...t},a){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":r},t),e?n.createElement("title",{id:r},e):null,n.createElement("path",{fillRule:"evenodd",d:"M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14ZM8 4a.75.75 0 0 1 .75.75v3a.75.75 0 0 1-1.5 0v-3A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",clipRule:"evenodd"}))}));const w=n.forwardRef((function({title:e,titleId:r,...t},a){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":r},t),e?n.createElement("title",{id:r},e):null,n.createElement("path",{fillRule:"evenodd",d:"M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14Zm2.78-4.22a.75.75 0 0 1-1.06 0L8 9.06l-1.72 1.72a.75.75 0 1 1-1.06-1.06L6.94 8 5.22 6.28a.75.75 0 0 1 1.06-1.06L8 6.94l1.72-1.72a.75.75 0 1 1 1.06 1.06L9.06 8l1.72 1.72a.75.75 0 0 1 0 1.06Z",clipRule:"evenodd"}))}));var z=i((function(t,o){var n,i=t.id,d=t.label,p=t.size,b=void 0===p?"md":p,f=t.rounded,z=void 0===f?"normal":f,N=t.variant,k=void 0===N?"outline":N,I=t.type,O=void 0===I?"text":I,C=t.helperText,j=t.errorMessage,E=t.fullwidth,V=void 0!==E&&E,M=t.disabled,D=void 0!==M&&M,F=t.error,L=void 0!==F&&F,R=t.required,S=void 0===R||R,T=t.hasClearIcon,Z=void 0===T||T,P=u(t,["id","label","size","rounded","variant","type","helperText","errorMessage","fullwidth","disabled","error","required","hasClearIcon"]),A=l(null),H=i||"".concat(O,"-").concat(d,"-input"),q=g({size:b,rounded:z,variant:k,fullwidth:V,disabled:D,error:L,hasClearIcon:Z}),B=h({size:b,disabled:D,error:L,isFloating:null!==(n=!!P.value)&&void 0!==n&&n}),U=v({size:b,error:L,disabled:D}),Y=m({size:b}),G=y({size:b});s(o,(function(){return{clearInput:J}}));var J=function(){A.current&&(A.current.value="")};return r("div",{className:"flex flex-col ".concat(V?"w-full":""),children:[r("div",{className:"relative",children:[e("input",c({},P,{ref:A,type:O,id:H,disabled:D,className:a(q,P.className)})),Z&&e("div",{className:Y,children:e(w,{type:"button",className:G,onMouseDown:J})}),r("label",{htmlFor:H,className:B,children:[d," ",S&&e("span",{className:"text-error",children:"*"})]})]}),(j||C)&&r("span",{className:U,children:[e(x,{width:16,height:16,className:L?"fill-error":""})," ",j||C]})]})})),N=function(r){var t=r.variant,a=void 0===t?"body1":t,o=r.tag,n=void 0===o?"p":o,i=r.children,l=r.className,s=r.color,d=r.style;return e(n,{className:"typography-".concat(a," text-").concat(s," ").concat(l),style:d,children:i})},k=function(t){var a=t.tabs,o=t.initialTab,n=d(void 0===o?0:o),i=n[0],l=n[1];return r("div",{className:"tabs",children:[e("div",{className:"tab-buttons",children:a.map((function(r,t){return e("button",{className:t===i?"active":"",onClick:function(){return l(t)},children:r.label},t)}))}),e("div",{className:"tab-content",children:a[i].content})]})},I=function(e){return String(e).length>10?e/1e3:e},O=function(e){var r=new Date(e);return r.setHours(0,0,0,0),r},C=function(e){var r=new Date(e);return r.setHours(23,59,59,999),r},j=function(){var e=O(new Date);return{startTime:e,endTime:C(e)}},E=function(e){var r=Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds());return I(r)};export{b as Button,f as Table,k as Tabs,N as Text,z as TextInput,C as getEndDateOfDay,O as getStartDateOfDay,j as getStartEndTimestampOfDay,E as getTimestampUTC,I as resloveTimestamp};
1
+ import{jsx as e,jsxs as r,Fragment as t}from"react/jsx-runtime";import{twMerge as a}from"tailwind-merge";import{cva as n}from"class-variance-authority";import*as o from"react";import{forwardRef as i,useRef as l,useImperativeHandle as s,useState as d,useEffect as c,useCallback as u,useMemo as p}from"react";var b=function(){return b=Object.assign||function(e){for(var r,t=1,a=arguments.length;t<a;t++)for(var n in r=arguments[t])Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n]);return e},b.apply(this,arguments)};function f(e,r){var t={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&r.indexOf(a)<0&&(t[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(a=Object.getOwnPropertySymbols(e);n<a.length;n++)r.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(e,a[n])&&(t[a[n]]=e[a[n]])}return t}"function"==typeof SuppressedError&&SuppressedError;var v=n(["gap-2 font-bold text-white hover:bg-opacity-90 active:scale-[98%]"],{variants:{color:{primary:"bg-primary border-primary text-primary hover:bg-primary-80",secondary:"border-secondary bg-secondary-100 text-secondary-foreground hover:bg-secondary-120",tertiary:"border-tertiary-120 bg-tertiary-120 text-tertiary-120 hover:bg-tertiary-100",success:"border-success bg-success text-success hover:bg-success-120",info:"border-info bg-info text-info hover:bg-info-100",warning:"border-warning bg-warning text-warning hover:bg-warning-100 hover:border-warning-100",error:"border-error bg-error text-error hover:bg-error-120 hover:border-error-120"},size:{sm:"px-3 py-1 text-sm rounded-[--btn-rounded-sm]",md:"px-4 py-2 text-sm rounded-[--btn-rounded-md]",lg:"px-6 py-4 text-base rounded-[--btn-rounded-lg]"},variant:{solid:"border",outline:"border bg-transparent hover:bg-opacity-20",flat:"bg-transparent hover:bg-opacity-20",link:"bg-transparent underline underline-offset-4 hover:bg-transparent hover:text-opacity-80"},disabled:{true:"pointer-events-none border-transparent bg-secondary-110 text-secondary-130"},fullwidth:{true:"w-full"}},compoundVariants:[{variant:["flat","link"],disabled:!0,class:"border-transparent bg-transparent"},{variant:"solid",color:"primary",class:"text-primary-foreground"},{variant:"solid",color:"secondary",class:"text-secondary-foreground"},{variant:"solid",disabled:!0,color:"secondary",class:"text-white"},{variant:"solid",color:"tertiary",class:"text-tertiary-foreground"},{variant:"solid",color:"success",class:"text-success-foreground"},{variant:"solid",color:"info",class:"text-info-foreground"},{variant:"solid",color:"warning",class:"text-warning-foreground"},{variant:"solid",color:"error",class:"text-error-foreground"}],defaultVariants:{size:"md",color:"primary",variant:"solid",fullwidth:!0}}),h=function(n){var o=n.size,i=void 0===o?"md":o,l=n.color,s=void 0===l?"primary":l,d=n.variant,c=void 0===d?"solid":d,u=n.title,p=n.children,h=n.startIcon,g=n.endIcon,m=n.disabled,y=void 0!==m&&m,x=n.fullwidth,w=void 0!==x&&x,z=n.isLoading,N=void 0!==z&&z,I=n.className,C=f(n,["size","color","variant","title","children","startIcon","endIcon","disabled","fullwidth","isLoading","className"]),k=y||N;return e("button",b({type:"button"},C,{"aria-disabled":k||void 0,tabIndex:k?-1:0,className:a(v({size:i,color:s,variant:c,disabled:y,fullwidth:w}),I),disabled:k,children:r(t,{children:[h,p||u,g]})}))},g=function(t){var a=t.columns,n=t.data;return r("table",{className:"table",children:[e("thead",{children:e("tr",{children:a.map((function(r,t){return e("th",{children:r.header},t)}))})}),e("tbody",{children:n.map((function(r,t){return e("tr",{children:a.map((function(t,a){return e("td",{children:r[t.accessor]},a)}))},t)}))})]})},m=n(["border-0 outline-none","p-1 flex w-auto box-border","peer text-black placeholder:text-transparent"],{variants:{size:{sm:"p-2 px-3 typography-small1",md:"py-2 px-3 typography-subtitile4",lg:"p-4 typography-subtitile1"},rounded:{none:"rounded-none",normal:"rounded-xl",full:"rounded-full"},variant:{flat:"",outline:"ring-1 ring-inset ring-input-stroke hover:ring-input-active focus:ring-1 focus:ring-inset focus:ring-input-stroke-active",underline:"border-b-2 border-input-stroke transition-colors hover:border-input-stroke-active focus:border-input-stroke"},fullwidth:{true:"w-full"},disabled:{true:"text-input-text-disabled ring-input-stroke-disabled placeholder:text-input-text-disabled"},error:{true:"ring-error focus:ring-error"},hasClearIcon:{true:""}},compoundVariants:[{variant:"underline",className:"rounded-none"},{hasClearIcon:!0,size:"sm",class:"focus:pe-6"},{hasClearIcon:!0,size:"md",class:"focus:pe-8"},{hasClearIcon:!0,size:"lg",class:"focus:pe-10"}],defaultVariants:{size:"md",variant:"outline",rounded:"normal",fullwidth:!1,disabled:!1,error:!1,hasClearIcon:!1}}),y=n(["absolute block duration-450 transition-all px-[2px] text-input-text peer-focus:text-input-text-active peer-focus:bg-input-label-background"],{variants:{size:{sm:["left-3 -top-1.5 typography-label2 bg-input-label-background","peer-placeholder-shown:top-2 peer-placeholder-shown:typography-small1 peer-placeholder-shown:bg-transparent","peer-focus:-top-1.5 peer-focus:typography-label2"],md:["left-3 -top-1.5 typography-label1 bg-input-label-background","peer-placeholder-shown:top-2 peer-placeholder-shown:typography-subtitile4 peer-placeholder-shown:bg-transparent","peer-focus:-top-1.5 peer-focus:typography-label1"],lg:["left-4 -top-1.5 typography-label1 bg-input-label-background","peer-placeholder-shown:top-4 peer-placeholder-shown:typography-subtitile1 peer-placeholder-shown:bg-transparent","peer-focus:-top-1.5 peer-focus:typography-label1"]},disabled:{true:"text-input-text-disabled ring-input-stroke-disabled placeholder:text-input-text-disabled"},error:{true:"ring-error"}},defaultVariants:{size:"md",disabled:!1,error:!1}}),x=n(["text-small1 flex flex-row items-center gap-1"],{variants:{size:{sm:"mt-1",md:"mt-[6px]",lg:"mt-[6px]"},disabled:{true:"text-input-text-disabled"},error:{true:"text-error",false:"text-input-text"}},defaultVariants:{size:"md",disabled:!1,error:!1}}),w=n(["absolute inset-y-0 right-0 items-center justify-center hidden peer-focus:flex"],{variants:{size:{sm:"mr-2",md:"mr-3",lg:"mr-4"}},defaultVariants:{size:"md"}}),z=n(["cursor-pointer z-50 fill-input-stroke-active hover:fill-input-text"],{variants:{size:{sm:"size-3",md:"size-4",lg:"size-5"}},defaultVariants:{size:"md"}});const N=o.forwardRef((function({title:e,titleId:r,...t},a){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":r},t),e?o.createElement("title",{id:r},e):null,o.createElement("path",{fillRule:"evenodd",d:"M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))}));const I=o.forwardRef((function({title:e,titleId:r,...t},a){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":r},t),e?o.createElement("title",{id:r},e):null,o.createElement("path",{fillRule:"evenodd",d:"M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14ZM8 4a.75.75 0 0 1 .75.75v3a.75.75 0 0 1-1.5 0v-3A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",clipRule:"evenodd"}))}));const C=o.forwardRef((function({title:e,titleId:r,...t},a){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":r},t),e?o.createElement("title",{id:r},e):null,o.createElement("path",{fillRule:"evenodd",d:"M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14Zm2.78-4.22a.75.75 0 0 1-1.06 0L8 9.06l-1.72 1.72a.75.75 0 1 1-1.06-1.06L6.94 8 5.22 6.28a.75.75 0 0 1 1.06-1.06L8 6.94l1.72-1.72a.75.75 0 1 1 1.06 1.06L9.06 8l1.72 1.72a.75.75 0 0 1 0 1.06Z",clipRule:"evenodd"}))}));var k=i((function(t,n){var o=t.id,i=t.label,d=t.size,c=void 0===d?"md":d,u=t.rounded,p=void 0===u?"normal":u,v=t.variant,h=void 0===v?"outline":v,g=t.type,N=void 0===g?"text":g,k=t.helperText,O=t.errorMessage,M=t.fullwidth,j=void 0===M||M,E=t.disabled,T=void 0!==E&&E,V=t.error,L=void 0!==V&&V,R=t.required,S=void 0===R||R,D=t.hasClearIcon,F=void 0===D||D,Z=t.endIcon,q=f(t,["id","label","size","rounded","variant","type","helperText","errorMessage","fullwidth","disabled","error","required","hasClearIcon","endIcon"]),B=l(null),P=o||"".concat(N,"-").concat(i,"-input"),A=m({size:c,rounded:p,variant:h,fullwidth:j,disabled:T,error:L,hasClearIcon:F}),H=y({size:c,disabled:T,error:L}),U=x({size:c,error:L,disabled:T}),Y=w({size:c}),G=z({size:c});s(n,(function(){return{clearInput:J}}));var J=function(){B.current&&(B.current.value="")};return r("div",{className:"inline-flex flex-col ".concat(j?"w-full":""),children:[r("div",{className:"relative",children:[e("input",b({},q,{placeholder:" ",ref:B,type:N,id:P,disabled:T,className:a(A,q.className)})),F&&e("div",{className:Y,children:e(C,{type:"button",className:G,onMouseDown:J})}),Z,r("label",{htmlFor:P,className:H,children:[i," ",S&&e("span",{className:"text-error",children:"*"})]})]}),(O||k)&&r("span",{className:U,children:[e(I,{width:16,height:16,className:L?"fill-error":""})," ",O||k]})]})})),O=function(r){var t=r.variant,a=void 0===t?"body1":t,n=r.tag,o=void 0===n?"p":n,i=r.children,l=r.className,s=r.color,d=r.style;return e(o,{className:"typography-".concat(a," text-").concat(s," ").concat(l),style:d,children:i})},M=function(t){var a=t.tabs,n=t.initialTab,o=d(void 0===n?0:n),i=o[0],l=o[1];return r("div",{className:"tabs",children:[e("div",{className:"tab-buttons",children:a.map((function(r,t){return e("button",{className:t===i?"active":"",onClick:function(){return l(t)},children:r.label},t)}))}),e("div",{className:"tab-content",children:a[i].content})]})},j=n(["absolute inset-y-0 right-0 flex items-center justify-center"],{variants:{size:{sm:"mr-2",md:"mr-3",lg:"mr-4"}},defaultVariants:{size:"md"}}),E=n(["transition-all"],{variants:{size:{sm:"size-[14px]",md:"size-5",lg:"size-6"},disabled:{true:"fill-input-text-disabled",false:"fill-input-text"},isFocus:{true:"fill-input-text-active rotate-180",false:""}},defaultVariants:{size:"md",disabled:!1,isFocus:!1}}),T=n([],{variants:{size:{sm:"pe-[30px]",md:"pe-[40px]",lg:"pe-[48px]"}},defaultVariants:{size:"md"}}),V=function(t){var a=t.id,n=t.options,o=t.value,i=t.label,l=t.size,s=void 0===l?"md":l,v=t.rounded,h=void 0===v?"normal":v,g=t.variant,m=void 0===g?"outline":g,y=t.helperText,x=t.errorMessage,w=t.fullwidth,z=void 0===w||w,I=t.disabled,C=void 0!==I&&I,O=t.error,M=void 0!==O&&O,V=t.filterMode,L=void 0!==V&&V,R=t.required,S=void 0===R||R,D=t.onChangeText,F=t.onSelect,Z=f(t,["id","options","value","label","size","rounded","variant","helperText","errorMessage","fullwidth","disabled","error","filterMode","required","onChangeText","onSelect"]),q=a||"".concat(i,"-select"),B=d(!1),P=B[0],A=B[1],H=d(null),U=H[0],Y=H[1],G=d(""),J=G[0],K=G[1];c((function(){o&&!U&&Y(o)}),[o,U]);var Q=u((function(e){null==D||D(e),K(e.target.value)}),[D]),W=u((function(e){Y(e),K(e.label),null==F||F(e)}),[F]),X=p((function(){return n.filter((function(e){var r;return!L||(null===(r=e.label)||void 0===r?void 0:r.toLowerCase().includes(null==J?void 0:J.toLowerCase()))}))}),[n,L,J]);return r("div",{className:"relative ".concat(z?"w-full":""),children:[e(k,b({},Z,{readOnly:!L,value:J,onChange:Q,label:i,placeholder:" ",type:"text",rounded:h,variant:m,helperText:y,errorMessage:x,fullwidth:z,error:M,required:S,id:q,disabled:C,hasClearIcon:!1,size:s,className:T({size:s}),onFocus:function(){return A(!0)},onBlur:function(){return A(!1)},endIcon:e("div",{className:j({size:s}),children:e(N,{className:E({size:s,isFocus:P})})})})),P&&r("ul",{className:"absolute mt-1 w-full bg-white border border-gray-300 rounded-md shadow-md z-10 max-h-60 overflow-y-auto",children:[X.map((function(r){return e("li",{onMouseDown:function(){return W(r)},className:"px-4 py-2 hover:bg-gray-100 cursor-pointer ".concat((null==U?void 0:U.value)===r.value?" bg-gray-200":""),children:r.label},r.value)})),0===X.length&&e("li",{className:"px-4 py-14 text-center text-input-text",children:"Not found"})]})]})},L=function(e){return String(e).length>10?e/1e3:e},R=function(e){var r=new Date(e);return r.setHours(0,0,0,0),r},S=function(e){var r=new Date(e);return r.setHours(23,59,59,999),r},D=function(){var e=R(new Date);return{startTime:e,endTime:S(e)}},F=function(e){var r=Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds());return L(r)};export{h as Button,V as Dropdown,g as Table,M as Tabs,O as Text,k as TextInput,S as getEndDateOfDay,R as getStartDateOfDay,D as getStartEndTimestampOfDay,F as getTimestampUTC,L as resloveTimestamp};
2
2
  //# sourceMappingURL=bundle.js.map