ekm-ui 0.3.74 → 0.3.78

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 (264) hide show
  1. package/.turbo/turbo-build.log +128 -128
  2. package/CHANGELOG.md +12 -0
  3. package/dist/accordion.d.ts +28 -21
  4. package/dist/accordion.mjs +1 -1
  5. package/dist/alert-banner.mjs +1 -1
  6. package/dist/avatar.mjs +1 -1
  7. package/dist/badge.mjs +1 -1
  8. package/dist/breadcrumb.mjs +1 -1
  9. package/dist/card-payment-block.css +1 -1
  10. package/dist/card-payment-block.css.map +1 -1
  11. package/dist/card-payment-block.mjs +46 -46
  12. package/dist/checkbox.mjs +1 -1
  13. package/dist/chunk-2OTVEVU7.mjs +11 -0
  14. package/dist/chunk-2OTVEVU7.mjs.map +1 -0
  15. package/dist/{chunk-47S6AX7M.mjs → chunk-2PW7KHXJ.mjs} +1 -1
  16. package/dist/chunk-2PW7KHXJ.mjs.map +1 -0
  17. package/dist/{chunk-CMA7TSQG.mjs → chunk-35VEFUPA.mjs} +4 -4
  18. package/dist/chunk-35VEFUPA.mjs.map +1 -0
  19. package/dist/{chunk-ZWJSMASL.mjs → chunk-3AGRJPPN.mjs} +3 -3
  20. package/dist/chunk-3AGRJPPN.mjs.map +1 -0
  21. package/dist/{chunk-MRJOYGDD.mjs → chunk-3TAXDPV6.mjs} +2 -2
  22. package/dist/{chunk-MRJOYGDD.mjs.map → chunk-3TAXDPV6.mjs.map} +1 -1
  23. package/dist/{chunk-5DQUZENZ.mjs → chunk-6F3XKP3G.mjs} +2 -2
  24. package/dist/chunk-6F3XKP3G.mjs.map +1 -0
  25. package/dist/{chunk-HEKVJKLH.mjs → chunk-6UK5Y6KZ.mjs} +2 -2
  26. package/dist/{chunk-HEKVJKLH.mjs.map → chunk-6UK5Y6KZ.mjs.map} +1 -1
  27. package/dist/{chunk-EWNPNF2B.mjs → chunk-76V2THLN.mjs} +3 -3
  28. package/dist/chunk-76V2THLN.mjs.map +1 -0
  29. package/dist/chunk-7GLTVVKS.mjs +12 -0
  30. package/dist/chunk-7GLTVVKS.mjs.map +1 -0
  31. package/dist/{chunk-UUWBHZKH.mjs → chunk-7MH2LXFV.mjs} +4 -4
  32. package/dist/{chunk-UUWBHZKH.mjs.map → chunk-7MH2LXFV.mjs.map} +1 -1
  33. package/dist/{chunk-7YKZ7D7U.mjs → chunk-ATNP3Z6G.mjs} +2 -2
  34. package/dist/{chunk-25FJ277C.mjs → chunk-AYH56CFA.mjs} +3 -3
  35. package/dist/chunk-AYH56CFA.mjs.map +1 -0
  36. package/dist/{chunk-NEJOZRKV.mjs → chunk-BK5RX7N5.mjs} +2 -2
  37. package/dist/chunk-BK5RX7N5.mjs.map +1 -0
  38. package/dist/{chunk-F6ZWBNIM.mjs → chunk-CIUW5YZ7.mjs} +2 -2
  39. package/dist/chunk-CIUW5YZ7.mjs.map +1 -0
  40. package/dist/{chunk-WMFTYTMD.mjs → chunk-CZC4EJOD.mjs} +3 -3
  41. package/dist/chunk-CZC4EJOD.mjs.map +1 -0
  42. package/dist/{chunk-CEK5K5TU.mjs → chunk-D3VRYN5H.mjs} +4 -4
  43. package/dist/chunk-D3VRYN5H.mjs.map +1 -0
  44. package/dist/{chunk-W3DRXKTC.mjs → chunk-DBTYTFGU.mjs} +2 -2
  45. package/dist/chunk-DBTYTFGU.mjs.map +1 -0
  46. package/dist/{chunk-JCWSMIVA.mjs → chunk-E6KQBM7F.mjs} +2 -2
  47. package/dist/chunk-E6KQBM7F.mjs.map +1 -0
  48. package/dist/{chunk-5FPVCRAI.mjs → chunk-ECOC3JRK.mjs} +1 -1
  49. package/dist/{chunk-5FPVCRAI.mjs.map → chunk-ECOC3JRK.mjs.map} +1 -1
  50. package/dist/{chunk-3LINEESX.mjs → chunk-EH3ZVEVT.mjs} +1 -1
  51. package/dist/chunk-EH3ZVEVT.mjs.map +1 -0
  52. package/dist/{chunk-YJKULMWM.mjs → chunk-EX5FMSQL.mjs} +2 -2
  53. package/dist/chunk-EX5FMSQL.mjs.map +1 -0
  54. package/dist/{chunk-ASCPOK5F.mjs → chunk-FVUORQJX.mjs} +4 -4
  55. package/dist/chunk-FVUORQJX.mjs.map +1 -0
  56. package/dist/{chunk-WFRV27QA.mjs → chunk-G5A3E5IG.mjs} +3 -3
  57. package/dist/chunk-G5A3E5IG.mjs.map +1 -0
  58. package/dist/{chunk-2IL2LP47.mjs → chunk-HOCKBMTF.mjs} +3 -3
  59. package/dist/chunk-HOCKBMTF.mjs.map +1 -0
  60. package/dist/{chunk-FRIXS4BL.mjs → chunk-JPF3K5TD.mjs} +1 -1
  61. package/dist/chunk-JPF3K5TD.mjs.map +1 -0
  62. package/dist/{chunk-AYXC2DCM.mjs → chunk-K2G6O2LX.mjs} +3 -3
  63. package/dist/chunk-K2G6O2LX.mjs.map +1 -0
  64. package/dist/chunk-LVJYP46A.mjs +9 -0
  65. package/dist/chunk-LVJYP46A.mjs.map +1 -0
  66. package/dist/{chunk-VQ3MZS4J.mjs → chunk-MPIWXVKP.mjs} +2 -2
  67. package/dist/chunk-MPIWXVKP.mjs.map +1 -0
  68. package/dist/{chunk-DZABAR36.mjs → chunk-NJC2WLYK.mjs} +2 -2
  69. package/dist/chunk-NJC2WLYK.mjs.map +1 -0
  70. package/dist/{chunk-5CGIKL2Y.mjs → chunk-OG6UBKMG.mjs} +2 -2
  71. package/dist/chunk-OG6UBKMG.mjs.map +1 -0
  72. package/dist/chunk-PEODF7PL.mjs +34 -0
  73. package/dist/chunk-PEODF7PL.mjs.map +1 -0
  74. package/dist/{chunk-FAFXVD4P.mjs → chunk-PJZVMYPN.mjs} +4 -4
  75. package/dist/chunk-PJZVMYPN.mjs.map +1 -0
  76. package/dist/{chunk-KEIDXVZB.mjs → chunk-PT4IH2KW.mjs} +2 -2
  77. package/dist/chunk-PT4IH2KW.mjs.map +1 -0
  78. package/dist/{chunk-MXH3TZWM.mjs → chunk-QFECX4D6.mjs} +1 -1
  79. package/dist/chunk-QFECX4D6.mjs.map +1 -0
  80. package/dist/{chunk-5VH26DHQ.mjs → chunk-QMFUWXJJ.mjs} +1 -1
  81. package/dist/chunk-QMFUWXJJ.mjs.map +1 -0
  82. package/dist/chunk-R4A5DO7E.mjs +12 -0
  83. package/dist/chunk-R4A5DO7E.mjs.map +1 -0
  84. package/dist/{chunk-LQQDRIZN.mjs → chunk-RGCO6BCU.mjs} +3 -3
  85. package/dist/chunk-RGCO6BCU.mjs.map +1 -0
  86. package/dist/{chunk-PPMW7YAZ.mjs → chunk-SFSA2WUE.mjs} +28 -28
  87. package/dist/chunk-SFSA2WUE.mjs.map +1 -0
  88. package/dist/{chunk-XUXHB434.mjs → chunk-SM4TG5VI.mjs} +1 -1
  89. package/dist/chunk-SM4TG5VI.mjs.map +1 -0
  90. package/dist/{chunk-D6H235SZ.mjs → chunk-UPAA75QA.mjs} +1 -1
  91. package/dist/chunk-UPAA75QA.mjs.map +1 -0
  92. package/dist/{chunk-256SAVHD.mjs → chunk-W3XYS7M3.mjs} +1 -1
  93. package/dist/{chunk-256SAVHD.mjs.map → chunk-W3XYS7M3.mjs.map} +1 -1
  94. package/dist/chunk-X2JENUDV.mjs +16 -0
  95. package/dist/chunk-X2JENUDV.mjs.map +1 -0
  96. package/dist/chunk-XBWUYKZW.mjs +10 -0
  97. package/dist/chunk-XBWUYKZW.mjs.map +1 -0
  98. package/dist/{chunk-Q365BFES.mjs → chunk-YJINOUZ7.mjs} +1 -1
  99. package/dist/chunk-YJINOUZ7.mjs.map +1 -0
  100. package/dist/{chunk-4IKXV4FQ.mjs → chunk-Z5YZVKS5.mjs} +2 -2
  101. package/dist/{chunk-ZHCGY4YB.mjs → chunk-ZO5NWKNY.mjs} +2 -2
  102. package/dist/{chunk-ZHCGY4YB.mjs.map → chunk-ZO5NWKNY.mjs.map} +1 -1
  103. package/dist/color-picker.mjs +1 -1
  104. package/dist/dashboard-notification.mjs +1 -1
  105. package/dist/date-range-picker.mjs +4 -4
  106. package/dist/drag-and-drop.css +1 -1
  107. package/dist/drag-and-drop.css.map +1 -1
  108. package/dist/drag-and-drop.mjs +46 -46
  109. package/dist/draggable-stacked-list-item.mjs +2 -2
  110. package/dist/drawer.mjs +1 -1
  111. package/dist/dropdown.mjs +1 -1
  112. package/dist/feature-cards/feature-card.mjs +2 -2
  113. package/dist/featurePageComponents/feature-page-group.mjs +1 -1
  114. package/dist/file-picker/file-listing.d.ts +1 -1
  115. package/dist/file-picker/file-listing.mjs +2 -2
  116. package/dist/file-picker/file-picker.css +1 -1
  117. package/dist/file-picker/file-picker.css.map +1 -1
  118. package/dist/file-picker/file-picker.d.ts +2 -2
  119. package/dist/file-picker/file-picker.mjs +46 -46
  120. package/dist/fixed-alert.mjs +1 -1
  121. package/dist/footer-heart-icon.mjs +1 -1
  122. package/dist/form-row.mjs +2 -2
  123. package/dist/index.css +1 -1
  124. package/dist/index.css.map +1 -1
  125. package/dist/index.mjs +46 -46
  126. package/dist/input-copy.mjs +2 -2
  127. package/dist/label.mjs +1 -1
  128. package/dist/layout/layout.css +1 -1
  129. package/dist/layout/layout.css.map +1 -1
  130. package/dist/layout/layout.mjs +46 -46
  131. package/dist/loading-button.mjs +1 -1
  132. package/dist/love-footer.mjs +2 -2
  133. package/dist/mini-feature-block.mjs +2 -2
  134. package/dist/modal.mjs +1 -1
  135. package/dist/navbar/navbar.mjs +1 -1
  136. package/dist/no-results-block.d.ts +1 -1
  137. package/dist/no-results-block.mjs +1 -1
  138. package/dist/page-header.mjs +2 -2
  139. package/dist/pagination/pagination.mjs +1 -1
  140. package/dist/product-picker/product-drawer.css +1 -1
  141. package/dist/product-picker/product-drawer.css.map +1 -1
  142. package/dist/product-picker/product-drawer.mjs +46 -46
  143. package/dist/product-picker/product-listing.d.ts +1 -1
  144. package/dist/product-picker/product-listing.mjs +2 -2
  145. package/dist/progress-bar.mjs +1 -1
  146. package/dist/radio.mjs +1 -1
  147. package/dist/rich-text-editor/index.mjs +1 -1
  148. package/dist/search/search.mjs +1 -1
  149. package/dist/select.mjs +1 -1
  150. package/dist/sort/sort.mjs +1 -1
  151. package/dist/spinner.mjs +1 -1
  152. package/dist/stacked-list-item.css +1 -1
  153. package/dist/stacked-list-item.css.map +1 -1
  154. package/dist/stacked-list-item.mjs +46 -46
  155. package/dist/table-header/table-header.mjs +3 -3
  156. package/dist/table-result-block.css +1 -1
  157. package/dist/table-result-block.css.map +1 -1
  158. package/dist/table-result-block.mjs +46 -46
  159. package/dist/text-row.mjs +1 -1
  160. package/dist/textarea.mjs +1 -1
  161. package/dist/textinput.mjs +1 -1
  162. package/dist/toast/index.mjs +1 -1
  163. package/dist/toggleswitch.mjs +1 -1
  164. package/dist/tooltip/tooltip.mjs +1 -1
  165. package/dist/video-dashboard-notification.mjs +1 -1
  166. package/dist/video-modal.mjs +1 -1
  167. package/package.json +4 -2
  168. package/src/accordion.tsx +120 -58
  169. package/src/alert-banner.tsx +78 -56
  170. package/src/avatar.tsx +71 -49
  171. package/src/badge.tsx +38 -30
  172. package/src/breadcrumb.tsx +28 -21
  173. package/src/checkbox.tsx +28 -20
  174. package/src/color-picker.tsx +2 -4
  175. package/src/dashboard-notification.tsx +1 -2
  176. package/src/date-range-picker.tsx +208 -139
  177. package/src/drag-and-drop.tsx +4 -4
  178. package/src/draggable-stacked-list-item.tsx +2 -2
  179. package/src/drawer.tsx +2 -2
  180. package/src/dropdown.tsx +91 -73
  181. package/src/featurePageComponents/feature-page-group.tsx +0 -1
  182. package/src/file-picker/file-listing.tsx +86 -38
  183. package/src/file-picker/file-picker.tsx +296 -212
  184. package/src/fixed-alert.tsx +2 -5
  185. package/src/footer-heart-icon.tsx +31 -7
  186. package/src/form-row.tsx +1 -1
  187. package/src/index.tsx +1 -1
  188. package/src/input-copy.tsx +1 -1
  189. package/src/label.tsx +12 -6
  190. package/src/layout/layout.tsx +2 -2
  191. package/src/loading-button.tsx +21 -21
  192. package/src/mini-feature-block.tsx +2 -6
  193. package/src/modal.tsx +46 -34
  194. package/src/navbar/navbar.tsx +1 -1
  195. package/src/no-results-block.tsx +7 -3
  196. package/src/page-header.tsx +13 -8
  197. package/src/pagination/pagination.tsx +1 -1
  198. package/src/product-picker/product-drawer.tsx +226 -144
  199. package/src/product-picker/product-listing.tsx +84 -45
  200. package/src/progress-bar.tsx +39 -25
  201. package/src/radio.tsx +11 -11
  202. package/src/rich-text-editor/headless-editor.ts +5 -5
  203. package/src/search/search.tsx +4 -4
  204. package/src/select.tsx +2 -3
  205. package/src/sort/sort.tsx +33 -31
  206. package/src/spinner.tsx +3 -3
  207. package/src/stacked-list-item.tsx +1 -1
  208. package/src/table-header/table-header.tsx +114 -90
  209. package/src/table-result-block.tsx +12 -10
  210. package/src/text-row.tsx +1 -1
  211. package/src/textarea.tsx +27 -24
  212. package/src/textinput.tsx +31 -28
  213. package/src/toast/index.tsx +4 -4
  214. package/src/toggleswitch.tsx +3 -1
  215. package/src/tooltip/tooltip.tsx +1 -1
  216. package/src/video-dashboard-notification.tsx +0 -2
  217. package/src/video-modal.tsx +2 -5
  218. package/dist/chunk-25FJ277C.mjs.map +0 -1
  219. package/dist/chunk-2IL2LP47.mjs.map +0 -1
  220. package/dist/chunk-3LINEESX.mjs.map +0 -1
  221. package/dist/chunk-47S6AX7M.mjs.map +0 -1
  222. package/dist/chunk-5CGIKL2Y.mjs.map +0 -1
  223. package/dist/chunk-5DQUZENZ.mjs.map +0 -1
  224. package/dist/chunk-5VH26DHQ.mjs.map +0 -1
  225. package/dist/chunk-ASCPOK5F.mjs.map +0 -1
  226. package/dist/chunk-AYXC2DCM.mjs.map +0 -1
  227. package/dist/chunk-CEK5K5TU.mjs.map +0 -1
  228. package/dist/chunk-CMA7TSQG.mjs.map +0 -1
  229. package/dist/chunk-CZNQ24DQ.mjs +0 -16
  230. package/dist/chunk-CZNQ24DQ.mjs.map +0 -1
  231. package/dist/chunk-D6H235SZ.mjs.map +0 -1
  232. package/dist/chunk-DZABAR36.mjs.map +0 -1
  233. package/dist/chunk-EWNPNF2B.mjs.map +0 -1
  234. package/dist/chunk-F6ZWBNIM.mjs.map +0 -1
  235. package/dist/chunk-FAFXVD4P.mjs.map +0 -1
  236. package/dist/chunk-FRIXS4BL.mjs.map +0 -1
  237. package/dist/chunk-HZTQAUGX.mjs +0 -34
  238. package/dist/chunk-HZTQAUGX.mjs.map +0 -1
  239. package/dist/chunk-JACXLYPD.mjs +0 -12
  240. package/dist/chunk-JACXLYPD.mjs.map +0 -1
  241. package/dist/chunk-JCWSMIVA.mjs.map +0 -1
  242. package/dist/chunk-KEIDXVZB.mjs.map +0 -1
  243. package/dist/chunk-LQQDRIZN.mjs.map +0 -1
  244. package/dist/chunk-MXH3TZWM.mjs.map +0 -1
  245. package/dist/chunk-NEJOZRKV.mjs.map +0 -1
  246. package/dist/chunk-PPMW7YAZ.mjs.map +0 -1
  247. package/dist/chunk-Q365BFES.mjs.map +0 -1
  248. package/dist/chunk-REFCK56T.mjs +0 -12
  249. package/dist/chunk-REFCK56T.mjs.map +0 -1
  250. package/dist/chunk-VPLCWU7T.mjs +0 -9
  251. package/dist/chunk-VPLCWU7T.mjs.map +0 -1
  252. package/dist/chunk-VQ3MZS4J.mjs.map +0 -1
  253. package/dist/chunk-W3DRXKTC.mjs.map +0 -1
  254. package/dist/chunk-WFRV27QA.mjs.map +0 -1
  255. package/dist/chunk-WLJEFSES.mjs +0 -10
  256. package/dist/chunk-WLJEFSES.mjs.map +0 -1
  257. package/dist/chunk-WMFTYTMD.mjs.map +0 -1
  258. package/dist/chunk-XUXHB434.mjs.map +0 -1
  259. package/dist/chunk-YJKULMWM.mjs.map +0 -1
  260. package/dist/chunk-ZJATBQ3X.mjs +0 -10
  261. package/dist/chunk-ZJATBQ3X.mjs.map +0 -1
  262. package/dist/chunk-ZWJSMASL.mjs.map +0 -1
  263. /package/dist/{chunk-7YKZ7D7U.mjs.map → chunk-ATNP3Z6G.mjs.map} +0 -0
  264. /package/dist/{chunk-4IKXV4FQ.mjs.map → chunk-Z5YZVKS5.mjs.map} +0 -0
@@ -1,138 +1,157 @@
1
1
  //@ts-nocheck
2
- import { useState, useEffect, useRef, useCallback } from 'react'
3
- import PropTypes from 'prop-types'
4
- import { Checkbox } from '../checkbox'
5
- import { ToolTip } from '../tooltip/tooltip'
6
- import _, { isEqual } from 'lodash'
7
- import { HiOutlineChevronUp, HiOutlineChevronDown, HiExclamationCircle } from 'react-icons/hi'
2
+ import { isEqual } from "lodash";
3
+ import PropTypes from "prop-types";
4
+ import { useCallback, useEffect, useRef, useState } from "react";
5
+ import {
6
+ HiExclamationCircle,
7
+ HiOutlineChevronDown,
8
+ HiOutlineChevronUp,
9
+ } from "react-icons/hi";
10
+ import { Checkbox } from "../checkbox";
11
+ import { ToolTip } from "../tooltip/tooltip";
8
12
 
9
13
  function useDebounceEffect(effect, delay, deps) {
10
- const renderRef = useRef(0)
11
- const handlerRef = useRef(null)
12
- const callback = useCallback(effect, deps)
14
+ const renderRef = useRef(0);
15
+ const handlerRef = useRef(null);
16
+ const callback = useCallback(effect, deps);
13
17
 
14
18
  useEffect(() => {
15
19
  if (renderRef.current !== 1) {
16
- renderRef.current += 1 // Ignore running on first render
20
+ renderRef.current += 1; // Ignore running on first render
17
21
  } else {
18
22
  handlerRef.current = setTimeout(() => {
19
- callback()
20
- }, delay)
23
+ callback();
24
+ }, delay);
21
25
  }
22
26
  return () => {
23
- clearTimeout(handlerRef.current)
24
- }
25
- }, [callback, delay])
27
+ clearTimeout(handlerRef.current);
28
+ };
29
+ }, [callback, delay]);
26
30
  }
27
31
  // This is used to perform deep object comparisson instead
28
32
  // of using the useEffect method.
29
33
  function useDeepEffect(effectFunc, deps) {
30
- const isFirst = useRef(true)
31
- const prevDeps = useRef(deps)
34
+ const isFirst = useRef(true);
35
+ const prevDeps = useRef(deps);
32
36
 
33
37
  useEffect(() => {
34
- const isSame = prevDeps.current.every((obj, index) => isEqual(obj, deps[index]))
35
- if (isFirst.current || !isSame) effectFunc()
36
- isFirst.current = false
37
- prevDeps.current = deps
38
- }, deps)
38
+ const isSame = prevDeps.current.every((obj, index) =>
39
+ isEqual(obj, deps[index])
40
+ );
41
+ if (isFirst.current || !isSame) effectFunc();
42
+ isFirst.current = false;
43
+ prevDeps.current = deps;
44
+ }, deps);
39
45
  }
40
46
 
41
47
  // This is used to represent a single header and should be
42
48
  // used only with the Table header.
43
49
  function TableHeaderItem({ ...props }) {
44
- const HeaderSortModes = { ASC: 'ASC', DSC: 'DSC', OFF: 'OFF' }
45
- const [sort, setSort] = useState(HeaderSortModes.OFF)
46
- const [hitCount, setHitCount] = useState(0) // required for debounce
50
+ const HeaderSortModes = { ASC: "ASC", DSC: "DSC", OFF: "OFF" };
51
+ const [sort, setSort] = useState(HeaderSortModes.OFF);
52
+ const [hitCount, setHitCount] = useState(0); // required for debounce
47
53
 
48
- const { title, layout, sortable, override, callback, tooltip } = props
54
+ const { title, layout, sortable, override, callback, tooltip } = props;
49
55
 
50
56
  const cycleSortMode = () => {
51
- if (!sortable) return
52
- let newSort = sort
57
+ if (!sortable) return;
58
+ let newSort = sort;
53
59
  switch (sort) {
54
60
  case HeaderSortModes.OFF:
55
- newSort = HeaderSortModes.DSC
56
- break
61
+ newSort = HeaderSortModes.DSC;
62
+ break;
57
63
  case HeaderSortModes.ASC:
58
- newSort = HeaderSortModes.OFF
59
- break
64
+ newSort = HeaderSortModes.OFF;
65
+ break;
60
66
  case HeaderSortModes.DSC:
61
- newSort = HeaderSortModes.ASC
62
- break
67
+ newSort = HeaderSortModes.ASC;
68
+ break;
63
69
  default:
64
- break
70
+ break;
65
71
  }
66
72
  // Only update if mode changes.
67
73
  if (newSort !== sort) {
68
- setSort(newSort)
69
- callback({ title, sort: newSort })
74
+ setSort(newSort);
75
+ callback({ title, sort: newSort });
70
76
  }
71
- }
77
+ };
72
78
 
73
79
  useDebounceEffect(
74
80
  () => {
75
81
  // Prevents triggering on first render
76
- if (hitCount > 0) cycleSortMode()
82
+ if (hitCount > 0) cycleSortMode();
77
83
  },
78
84
  500,
79
- [hitCount],
80
- )
85
+ [hitCount]
86
+ );
81
87
 
82
88
  // This is used to force a sort state on the header via props.
83
89
  useDeepEffect(() => {
84
- if (override == null) return
90
+ if (override == null) return;
85
91
 
86
92
  if (title !== override.title) {
87
93
  if (sort !== HeaderSortModes.OFF) {
88
- setSort(HeaderSortModes.OFF)
94
+ setSort(HeaderSortModes.OFF);
89
95
  }
90
- return
96
+ return;
91
97
  }
92
98
  if (title === override.title && sort !== override.sort) {
93
- if (Object.values(HeaderSortModes).indexOf(override.sort) === -1) return
94
- let newSort = override.sort
99
+ if (Object.values(HeaderSortModes).indexOf(override.sort) === -1) return;
100
+ let newSort = override.sort;
95
101
  switch (override.sort) {
96
102
  case HeaderSortModes.OFF:
97
- newSort = HeaderSortModes.OFF
98
- break
103
+ newSort = HeaderSortModes.OFF;
104
+ break;
99
105
  case HeaderSortModes.ASC:
100
- newSort = HeaderSortModes.ASC
101
- break
106
+ newSort = HeaderSortModes.ASC;
107
+ break;
102
108
  case HeaderSortModes.DSC:
103
- newSort = HeaderSortModes.DSC
104
- break
109
+ newSort = HeaderSortModes.DSC;
110
+ break;
105
111
  default:
106
- break
112
+ break;
107
113
  }
108
114
  // Only update if mode changes.
109
115
  if (newSort !== sort) {
110
- setSort(newSort)
116
+ setSort(newSort);
111
117
  }
112
118
  }
113
- }, [override])
119
+ }, [override]);
114
120
 
115
121
  const renderCheveron = () => {
116
122
  return sort === HeaderSortModes.ASC ? (
117
- <HiOutlineChevronUp className="mt-1 ml-2 " fontSize="20px" />
123
+ <HiOutlineChevronUp className="ml-2 mt-1 " fontSize="20px" />
118
124
  ) : (
119
- <HiOutlineChevronDown className="mt-1 ml-2 " fontSize="20px" />
120
- )
121
- }
125
+ <HiOutlineChevronDown className="ml-2 mt-1 " fontSize="20px" />
126
+ );
127
+ };
122
128
 
123
129
  return (
124
- <div className={`${layout} ${sortable ? 'cursor-pointer' : ''} ${tooltip != null ? ' d-flex align-items-center float-left' : ''} `}>
125
- <span className="float-left mr-2" onClick={() => setHitCount(hitCount + 1)}>{title?.toUpperCase()}</span>
130
+ <div
131
+ className={`${layout} ${sortable ? "cursor-pointer" : ""} ${
132
+ tooltip != null ? " d-flex align-items-center float-left" : ""
133
+ } `}
134
+ >
135
+ <span
136
+ className="float-left mr-2"
137
+ onClick={() => setHitCount(hitCount + 1)}
138
+ >
139
+ {title?.toUpperCase()}
140
+ </span>
126
141
  {sortable && sort !== HeaderSortModes.OFF && renderCheveron()}
127
142
  {tooltip != null && (
128
- <div className="mt-1 ml-2">
129
- <ToolTip key={`tooltipName-${title}`} placement="bottom" content={tooltip}>
143
+ <div className="ml-2 mt-1">
144
+ <ToolTip
145
+ key={`tooltipName-${title}`}
146
+ placement="bottom"
147
+ content={tooltip}
148
+ >
130
149
  <HiExclamationCircle fontSize="20px" color="#555555" />
131
150
  </ToolTip>
132
151
  </div>
133
152
  )}
134
153
  </div>
135
- )
154
+ );
136
155
  }
137
156
 
138
157
  TableHeaderItem.propTypes = {
@@ -145,56 +164,61 @@ TableHeaderItem.propTypes = {
145
164
  }),
146
165
  callback: PropTypes.func,
147
166
  tooltip: PropTypes.string,
148
- }
167
+ };
149
168
 
150
169
  TableHeaderItem.defaultProps = {
151
- layout: 'col-2 font-weight-bold',
170
+ layout: "col-2 font-weight-bold",
152
171
  sortable: false,
153
172
  override: null,
154
173
  tooltip: null,
155
- }
174
+ };
156
175
 
157
176
  export function TableHeader({
158
177
  config,
159
178
  callback,
160
179
  forceCheckedState = false,
161
180
  checkboxCallback,
162
- layout = 'form-row tableHeader--custom align-items-center d-none d-lg-flex',
181
+ layout = "form-row tableHeader--custom align-items-center d-none d-lg-flex",
163
182
  forceSort,
164
183
  }) {
165
- const HeaderSortModes = { ASC: 'ASC', DSC: 'DSC', OFF: 'OFF' }
166
- const [changeSortTo, setChangeSortTo] = useState(null)
167
- const [checked, setChecked] = useState(forceCheckedState)
184
+ const HeaderSortModes = { ASC: "ASC", DSC: "DSC", OFF: "OFF" };
185
+ const [changeSortTo, setChangeSortTo] = useState(null);
186
+ const [checked, setChecked] = useState(forceCheckedState);
168
187
 
169
188
  const handleHeaderSort = (sortBy) => {
170
- setChangeSortTo(sortBy)
171
- callback(sortBy)
172
- }
189
+ setChangeSortTo(sortBy);
190
+ callback(sortBy);
191
+ };
173
192
 
174
193
  const handleHeaderCheckbox = () => {
175
- let status = !checked
176
- setChecked(status)
177
- checkboxCallback(status)
178
- }
194
+ let status = !checked;
195
+ setChecked(status);
196
+ checkboxCallback(status);
197
+ };
179
198
 
180
199
  useDeepEffect(() => {
181
- if (forceSort == null) return
182
- if (forceSort.title == null || forceSort.sort == null) return
200
+ if (forceSort == null) return;
201
+ if (forceSort.title == null || forceSort.sort == null) return;
183
202
 
184
203
  if (Object.values(HeaderSortModes).indexOf(forceSort.sort) !== -1) {
185
- setChangeSortTo({ title: forceSort.title, sort: forceSort.sort })
204
+ setChangeSortTo({ title: forceSort.title, sort: forceSort.sort });
186
205
  }
187
- }, [forceSort])
206
+ }, [forceSort]);
188
207
 
189
208
  useEffect(() => {
190
- setChecked(forceCheckedState)
191
- }, [forceCheckedState])
209
+ setChecked(forceCheckedState);
210
+ }, [forceCheckedState]);
192
211
 
193
212
  return (
194
213
  <div className={layout}>
195
214
  {config.checkbox && (
196
215
  <div className={`col-1 font-weight-bold ${config.checkboxLayout}`}>
197
- <Checkbox id="checkAll" className="custom-control-input mt-1" checked={checked} onChange={handleHeaderCheckbox} />
216
+ <Checkbox
217
+ id="checkAll"
218
+ className="custom-control-input mt-1"
219
+ checked={checked}
220
+ onChange={handleHeaderCheckbox}
221
+ />
198
222
  </div>
199
223
  )}
200
224
 
@@ -209,10 +233,10 @@ export function TableHeader({
209
233
  callback={handleHeaderSort}
210
234
  tooltip={val.tooltip}
211
235
  />
212
- )
236
+ );
213
237
  })}
214
238
  </div>
215
- )
239
+ );
216
240
  }
217
241
 
218
242
  TableHeader.propTypes = {
@@ -225,7 +249,7 @@ TableHeader.propTypes = {
225
249
  layout: PropTypes.string,
226
250
  sortable: PropTypes.bool,
227
251
  tooltip: PropTypes.string,
228
- }),
252
+ })
229
253
  ).isRequired,
230
254
  }).isRequired,
231
255
  /** Optional setting the checkbox*/
@@ -245,6 +269,6 @@ TableHeader.propTypes = {
245
269
  callback: PropTypes.func.isRequired,
246
270
  /** Optional return call triggered when the optional header checkbox is clicked */
247
271
  checkboxCallback: PropTypes.func,
248
- }
272
+ };
249
273
 
250
- TableHeader.displayName = 'TableHeader'
274
+ TableHeader.displayName = "TableHeader";
@@ -1,15 +1,17 @@
1
1
  //@ts-nocheck
2
- import { Spinner, NoResultsBlock } from '.';
3
- import {PropTypes} from "prop-types";
4
-
5
-
2
+ import { PropTypes } from "prop-types";
3
+ import { NoResultsBlock, Spinner } from ".";
6
4
 
7
5
  export function TableResultBlock({ title, message, icon, children }) {
8
6
  return (
9
- <NoResultsBlock icon={icon ? icon :<Spinner /> } title={title} text={message}>
7
+ <NoResultsBlock
8
+ icon={icon ? icon : <Spinner />}
9
+ title={title}
10
+ text={message}
11
+ >
10
12
  {children}
11
- </NoResultsBlock>
12
- )
13
+ </NoResultsBlock>
14
+ );
13
15
  }
14
16
 
15
17
  TableResultBlock.propTypes = {
@@ -19,8 +21,8 @@ TableResultBlock.propTypes = {
19
21
  message: PropTypes.string,
20
22
  /** true and the spinner will be shown use spinner or search icon */
21
23
  useSpinner: PropTypes.bool,
22
- icon:PropTypes.node,
24
+ icon: PropTypes.node,
23
25
  children: PropTypes.node,
24
- }
26
+ };
25
27
 
26
- TableResultBlock.displayName = "TableResultBlock"
28
+ TableResultBlock.displayName = "TableResultBlock";
package/src/text-row.tsx CHANGED
@@ -23,4 +23,4 @@ export function TextRow({ children, title, text, border, className }: Props) {
23
23
  );
24
24
  }
25
25
 
26
- TextRow.displayName = "TextRow"
26
+ TextRow.displayName = "TextRow";
package/src/textarea.tsx CHANGED
@@ -1,27 +1,30 @@
1
1
  //@ts-nocheck
2
- import { forwardRef } from 'react'
3
- import { variantProps } from 'classname-variants/react'
4
- import PropTypes from 'prop-types'
2
+ import { variantProps } from "classname-variants/react";
3
+ import PropTypes from "prop-types";
4
+ import { forwardRef } from "react";
5
5
 
6
6
  const fieldProps = variantProps({
7
- base: 'block p-2.5 w-full text-sm rounded-lg border ',
7
+ base: "block p-2.5 w-full text-sm rounded-lg border ",
8
8
  variants: {
9
9
  color: {
10
10
  failure:
11
- 'text-red-700 bg-red-50 border-red-500 focus:ring-red-500 focus:border-red-500 dark:bg-red-700 dark:border-red-600 dark:placeholder-red-700 dark:text-red-900 dark:focus:ring-red-500 dark:focus:border-red-500',
12
- gray: 'text-gray-900 bg-gray-50 border-gray-300 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500',
11
+ "text-red-700 bg-red-50 border-red-500 focus:ring-red-500 focus:border-red-500 dark:bg-red-700 dark:border-red-600 dark:placeholder-red-700 dark:text-red-900 dark:focus:ring-red-500 dark:focus:border-red-500",
12
+ gray: "text-gray-900 bg-gray-50 border-gray-300 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",
13
13
  },
14
14
  },
15
15
  defaultVariants: {
16
- color: 'gray',
16
+ color: "gray",
17
17
  },
18
- })
18
+ });
19
19
 
20
20
  export const TextArea = forwardRef(function TextArea(props, ref) {
21
21
  return (
22
22
  <>
23
23
  {props.label && (
24
- <label htmlFor={props.id} className="block mb-2 text-sm font-medium text-gray-900 dark:text-white">
24
+ <label
25
+ htmlFor={props.id}
26
+ className="mb-2 block text-sm font-medium text-gray-900 dark:text-white"
27
+ >
25
28
  {props.label}
26
29
  </label>
27
30
  )}
@@ -30,24 +33,24 @@ export const TextArea = forwardRef(function TextArea(props, ref) {
30
33
  id={props.id}
31
34
  rows={props.rows || 3}
32
35
  {...fieldProps(props)}
33
- placeholder={props.placeholder || 'Enter your text here...'}
36
+ placeholder={props.placeholder || "Enter your text here..."}
34
37
  {...props}
35
38
  ></textarea>
36
39
  </>
37
- )
38
- })
40
+ );
41
+ });
39
42
 
40
43
  TextArea.propTypes = {
41
- /** Unique id for the TextArea Component */
42
- id: PropTypes.string.isRequired,
43
- /** Optional Label to acompany TextArea Component */
44
- label: PropTypes.string,
45
- /** Optional placeholder text for TextArea Component */
46
- placeholder: PropTypes.string,
47
- /** Optional number of rows for the TextArea, this defaults to 3 rows if none provided */
48
- rows: PropTypes.number,
49
- /** Optional color defaults to gray and shpuld be set to failure if it fails validation*/
50
- color: PropTypes.oneOf(['gray', 'failure']),
51
- }
44
+ /** Unique id for the TextArea Component */
45
+ id: PropTypes.string.isRequired,
46
+ /** Optional Label to acompany TextArea Component */
47
+ label: PropTypes.string,
48
+ /** Optional placeholder text for TextArea Component */
49
+ placeholder: PropTypes.string,
50
+ /** Optional number of rows for the TextArea, this defaults to 3 rows if none provided */
51
+ rows: PropTypes.number,
52
+ /** Optional color defaults to gray and shpuld be set to failure if it fails validation*/
53
+ color: PropTypes.oneOf(["gray", "failure"]),
54
+ };
52
55
 
53
- TextArea.displayName = "TextArea";
56
+ TextArea.displayName = "TextArea";
package/src/textinput.tsx CHANGED
@@ -1,7 +1,7 @@
1
1
  //@ts-nocheck
2
- import { forwardRef } from "react";
3
2
  import { variantProps } from "classname-variants/react";
4
3
  import PropTypes from "prop-types";
4
+ import { forwardRef } from "react";
5
5
 
6
6
  const textInputProps = variantProps({
7
7
  base: "block p-2.5 w-full text-sm border text-sm rounded-lg",
@@ -52,12 +52,13 @@ const addonProps = variantProps({
52
52
  },
53
53
  defaultVariants: {
54
54
  color: "gray",
55
- position: "left"
55
+ position: "left",
56
56
  },
57
57
  });
58
58
 
59
59
  export const TextInput = forwardRef(function TextInput(props, ref) {
60
- const { color, disabled, type, placeholder, id, icon, addon, position } = props;
60
+ const { color, disabled, type, placeholder, id, icon, addon, position } =
61
+ props;
61
62
  if (icon) {
62
63
  return (
63
64
  <div className={props.className && props.className}>
@@ -65,29 +66,31 @@ export const TextInput = forwardRef(function TextInput(props, ref) {
65
66
  <div className="pointer-events-none absolute inset-y-0 start-0 flex items-center ps-3.5">
66
67
  {icon}
67
68
  </div>
68
- <input
69
- {...iconProps({ color })}
70
- type={type ? type : "text"}
71
- id={id}
72
- ref={ref}
73
- placeholder={placeholder || "Enter your text here..."}
74
- name={props.name}
75
- disabled={disabled}
76
- onChange={props.onChange}
77
- value={props.value}
78
- />
69
+ <input
70
+ {...iconProps({ color })}
71
+ type={type ? type : "text"}
72
+ id={id}
73
+ ref={ref}
74
+ placeholder={placeholder || "Enter your text here..."}
75
+ name={props.name}
76
+ disabled={disabled}
77
+ onChange={props.onChange}
78
+ value={props.value}
79
+ />
79
80
  </div>
80
81
  </div>
81
82
  );
82
83
  } else if (addon) {
83
84
  return (
84
85
  <div className={props.className && props.className}>
85
- <div className={disabled ? "flex cursor-not-allowed opacity-50" : "flex"}>
86
- {position == "left" &&
87
- (<span className="rounded-e-0 inline-flex items-center rounded-l-lg border border-gray-300 bg-gray-200 px-3 text-sm text-gray-900 dark:border-gray-600 dark:bg-gray-600 dark:text-gray-400">
88
- {addon}
89
- </span>)
90
- }
86
+ <div
87
+ className={disabled ? "flex cursor-not-allowed opacity-50" : "flex"}
88
+ >
89
+ {position == "left" && (
90
+ <span className="rounded-e-0 inline-flex items-center rounded-l-lg border border-gray-300 bg-gray-200 px-3 text-sm text-gray-900 dark:border-gray-600 dark:bg-gray-600 dark:text-gray-400">
91
+ {addon}
92
+ </span>
93
+ )}
91
94
  <input
92
95
  {...addonProps({ color, position })}
93
96
  type={type ? type : "text"}
@@ -97,12 +100,12 @@ export const TextInput = forwardRef(function TextInput(props, ref) {
97
100
  name={props.name}
98
101
  onChange={props.onChange}
99
102
  value={props.value}
100
- />
101
- {position == "right" &&
102
- (<span className="rounded-e-0 inline-flex items-center rounded-r-lg border border-gray-300 bg-gray-200 px-3 text-sm text-gray-900 dark:border-gray-600 dark:bg-gray-600 dark:text-gray-400">
103
- {addon}
104
- </span>)
105
- }
103
+ />
104
+ {position == "right" && (
105
+ <span className="rounded-e-0 inline-flex items-center rounded-r-lg border border-gray-300 bg-gray-200 px-3 text-sm text-gray-900 dark:border-gray-600 dark:bg-gray-600 dark:text-gray-400">
106
+ {addon}
107
+ </span>
108
+ )}
106
109
  </div>
107
110
  </div>
108
111
  );
@@ -113,7 +116,7 @@ export const TextInput = forwardRef(function TextInput(props, ref) {
113
116
  className={
114
117
  disabled ? "relative cursor-not-allowed opacity-50" : "relative"
115
118
  }
116
- >
119
+ >
117
120
  <input
118
121
  type={type ? type : "text"}
119
122
  id={id}
@@ -123,7 +126,7 @@ export const TextInput = forwardRef(function TextInput(props, ref) {
123
126
  onChange={props.onChange}
124
127
  value={props.value}
125
128
  {...textInputProps({ color })}
126
- />
129
+ />
127
130
  </div>
128
131
  </div>
129
132
  );
@@ -1,3 +1,5 @@
1
+ import { Transition } from "@headlessui/react";
2
+ import clsx from "clsx";
1
3
  import {
2
4
  Fragment,
3
5
  createContext,
@@ -6,13 +8,11 @@ import {
6
8
  useEffect,
7
9
  useState,
8
10
  } from "react";
9
- import { Transition } from "@headlessui/react";
10
- import clsx from "clsx";
11
11
  import {
12
12
  HiCheck,
13
- HiXCircle,
14
- HiInformationCircle,
15
13
  HiExclamationTriangle,
14
+ HiInformationCircle,
15
+ HiXCircle,
16
16
  } from "react-icons/hi2";
17
17
 
18
18
  export const ToastContext = createContext<
@@ -1,6 +1,6 @@
1
1
  //@ts-nocheck
2
- import { forwardRef } from "react";
3
2
  import PropTypes from "prop-types";
3
+ import { forwardRef } from "react";
4
4
 
5
5
  export const ToggleSwitch = forwardRef(function ToggleSwitch(props, ref) {
6
6
  return (
@@ -17,6 +17,8 @@ export const ToggleSwitch = forwardRef(function ToggleSwitch(props, ref) {
17
17
  className={`peer sr-only`}
18
18
  onChange={props.onChange}
19
19
  name={props.name}
20
+ checked={props.checked}
21
+ disabled={props.disabled}
20
22
  />
21
23
  <div className="peer h-6 w-11 rounded-full bg-gray-200 after:absolute after:start-[2px] after:top-0.5 after:h-5 after:w-5 after:rounded-full after:border after:border-gray-300 after:bg-white after:transition-all after:content-[''] peer-checked:bg-blue-600 peer-checked:after:translate-x-full peer-checked:after:border-white rtl:peer-checked:after:-translate-x-full dark:border-gray-600 dark:bg-gray-700" />
22
24
  {props.label && (
@@ -1,6 +1,6 @@
1
1
  //@ts-nocheck
2
- import { useState, useEffect, useRef } from "react";
3
2
  import clsx from "clsx";
3
+ import { useEffect, useRef } from "react";
4
4
 
5
5
  export function ToolTip({ children, content, tooltopPos, width }) {
6
6
  const tooltipRef = useRef();
@@ -1,5 +1,3 @@
1
- import clsx from "clsx";
2
- import { Card } from "flowbite-react";
3
1
  import { HiPlayCircle, HiXMark } from "react-icons/hi2";
4
2
 
5
3
  type Props = {
@@ -1,9 +1,6 @@
1
- import { Fragment, useState } from "react";
2
1
  import { Dialog, Transition } from "@headlessui/react";
3
- import {
4
- ExclamationTriangleIcon,
5
- XMarkIcon,
6
- } from "@heroicons/react/24/outline";
2
+ import { XMarkIcon } from "@heroicons/react/24/outline";
3
+ import { Fragment } from "react";
7
4
 
8
5
  type Props = {
9
6
  onClose: () => void;
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/video-dashboard-notification.tsx"],"names":["HiPlayCircle","HiXMark","jsx","jsxs","VideoDashboardNotification","title","text","onClose","children","imgURL"],"mappings":"AAEA,OAAS,gBAAAA,EAAc,WAAAC,MAAe,kBAuB9B,cAAAC,EAEF,QAAAC,MAFE,oBAbD,SAASC,EAA2B,CACzC,MAAAC,EACA,KAAAC,EACA,QAAAC,EACA,SAAAC,EACA,OAAAC,CACF,EAAU,CACR,OACEN,EAAC,OAAI,UAAU,sJACb,UAAAD,EAAC,OACC,QAASK,EACT,UAAU,yGAEV,SAAAL,EAACD,EAAA,CAAQ,UAAU,2CAA2C,EAChE,EACAE,EAAC,OAAI,UAAU,yBACb,UAAAD,EAAC,OACC,IAAKO,EACL,IAAI,GACJ,UAAU,6FACZ,EACAP,EAACF,EAAA,CAAa,UAAU,6FAA6F,GACvH,EACAE,EAAC,OAAI,UAAU,+BACb,SAAAC,EAAC,OAAI,UAAU,MACb,UAAAD,EAAC,KAAE,UAAU,6CAA8C,SAAAG,EAAM,EACjEH,EAAC,KAAE,UAAU,wCAAyC,SAAAI,EAAK,EAC1DE,GACH,EACF,GACF,CAEJ","sourcesContent":["import clsx from \"clsx\";\nimport { Card } from \"flowbite-react\";\nimport { HiPlayCircle, HiXMark } from \"react-icons/hi2\";\n\ntype Props = {\n onClose: () => void;\n title: string;\n text: string;\n children: JSX.Element;\n imgURL: string;\n};\n\nexport function VideoDashboardNotification({\n title,\n text,\n onClose,\n children,\n imgURL,\n}: Props) {\n return (\n <div className=\"relative flex flex-col gap-4 overflow-hidden rounded-lg border border-gray-200 bg-white shadow-sm dark:border-gray-700 dark:bg-gray-800 sm:flex-row\">\n <div\n onClick={onClose}\n className=\"absolute right-2 top-2 cursor-pointer rounded p-1 transition hover:bg-gray-200 hover:dark:bg-gray-600 \"\n >\n <HiXMark className=\"h-6 w-6 text-gray-400 dark:text-gray-300\" />\n </div>\n <div className=\"relative flex-shrink-0\">\n <img\n src={imgURL}\n alt=\"\"\n className=\"h-60 w-full border border-gray-200 object-cover object-center transition sm:h-full sm:w-80\"\n />\n <HiPlayCircle className=\"absolute left-1/2 top-1/2 h-16 w-16 -translate-x-1/2 -translate-y-1/2 transform text-white\" />\n </div>\n <div className=\"flex flex-col justify-center\">\n <div className=\"p-4\">\n <p className=\"mb-1 text-lg font-semibold dark:text-white\">{title}</p>\n <p className=\"mb-4 text-gray-500 dark:text-gray-400\">{text}</p>\n {children}\n </div>\n </div>\n </div>\n );\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/textarea.tsx"],"names":["import_prop_types","forwardRef","variantProps","Fragment","jsx","jsxs","fieldProps","TextArea","props","ref","__spreadValues","__spreadProps","PropTypes"],"mappings":"2FAGA,IAAAA,EAAsB,OAFtB,OAAS,cAAAC,MAAkB,QAC3B,OAAS,gBAAAC,MAAoB,2BAmBzB,mBAAAC,EAEI,OAAAC,EAFJ,QAAAC,MAAA,oBAhBJ,IAAMC,EAAaJ,EAAa,CAC9B,KAAM,gDACN,SAAU,CACR,MAAO,CACL,QACE,iNACF,KAAM,wNACR,CACF,EACA,gBAAiB,CACf,MAAO,MACT,CACF,CAAC,EAEYK,EAAWN,EAAW,SAAkBO,EAAOC,EAAK,CAC/D,OACEJ,EAAAF,EAAA,CACG,UAAAK,EAAM,OACLJ,EAAC,SAAM,QAASI,EAAM,GAAI,UAAU,+DACjC,SAAAA,EAAM,MACT,EAEFJ,EAAC,WAAAM,EAAAC,EAAAD,EAAA,CACC,IAAKD,EACL,GAAID,EAAM,GACV,KAAMA,EAAM,MAAQ,GAChBF,EAAWE,CAAK,GAJrB,CAKC,YAAaA,EAAM,aAAe,4BAC9BA,EACL,GACH,CAEJ,CAAC,EAEDD,EAAS,UAAY,CAEjB,GAAI,EAAAK,QAAU,OAAO,WAErB,MAAO,EAAAA,QAAU,OAEjB,YAAa,EAAAA,QAAU,OAEvB,KAAM,EAAAA,QAAU,OAEhB,MAAO,EAAAA,QAAU,MAAM,CAAC,OAAQ,SAAS,CAAC,CAC9C,EAEAL,EAAS,YAAc","sourcesContent":["//@ts-nocheck\nimport { forwardRef } from 'react'\nimport { variantProps } from 'classname-variants/react'\nimport PropTypes from 'prop-types'\n\nconst fieldProps = variantProps({\n base: 'block p-2.5 w-full text-sm rounded-lg border ',\n variants: {\n color: {\n failure:\n 'text-red-700 bg-red-50 border-red-500 focus:ring-red-500 focus:border-red-500 dark:bg-red-700 dark:border-red-600 dark:placeholder-red-700 dark:text-red-900 dark:focus:ring-red-500 dark:focus:border-red-500',\n gray: 'text-gray-900 bg-gray-50 border-gray-300 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500',\n },\n },\n defaultVariants: {\n color: 'gray',\n },\n})\n\nexport const TextArea = forwardRef(function TextArea(props, ref) {\n return (\n <>\n {props.label && (\n <label htmlFor={props.id} className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-white\">\n {props.label}\n </label>\n )}\n <textarea\n ref={ref}\n id={props.id}\n rows={props.rows || 3}\n {...fieldProps(props)}\n placeholder={props.placeholder || 'Enter your text here...'}\n {...props}\n ></textarea>\n </>\n )\n})\n\nTextArea.propTypes = {\n /** Unique id for the TextArea Component */\n id: PropTypes.string.isRequired,\n /** Optional Label to acompany TextArea Component */\n label: PropTypes.string,\n /** Optional placeholder text for TextArea Component */\n placeholder: PropTypes.string,\n /** Optional number of rows for the TextArea, this defaults to 3 rows if none provided */\n rows: PropTypes.number,\n /** Optional color defaults to gray and shpuld be set to failure if it fails validation*/\n color: PropTypes.oneOf(['gray', 'failure']),\n}\n\nTextArea.displayName = \"TextArea\";"]}