eai-frontend-components 2.0.14 → 2.0.16

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 (298) hide show
  1. package/dist/components/ui/accordion.d.ts +8 -0
  2. package/dist/components/ui/accordion.d.ts.map +1 -0
  3. package/dist/components/ui/accordion.js +13 -0
  4. package/dist/components/ui/alert-dialog.d.ts +25 -0
  5. package/dist/components/ui/alert-dialog.d.ts.map +1 -0
  6. package/dist/components/ui/alert-dialog.js +27 -0
  7. package/dist/components/ui/alert.d.ts +9 -0
  8. package/dist/components/ui/alert.d.ts.map +1 -0
  9. package/dist/components/ui/alert.js +22 -0
  10. package/dist/components/ui/avatar.d.ts +7 -0
  11. package/dist/components/ui/avatar.d.ts.map +1 -0
  12. package/dist/components/ui/avatar.js +11 -0
  13. package/dist/components/ui/badge.d.ts +10 -0
  14. package/dist/components/ui/badge.d.ts.map +1 -0
  15. package/dist/components/ui/badge.js +26 -0
  16. package/dist/components/ui/breadcrumb.d.ts +20 -0
  17. package/dist/components/ui/breadcrumb.d.ts.map +1 -0
  18. package/dist/components/ui/breadcrumb.js +23 -0
  19. package/dist/components/ui/button.d.ts +12 -0
  20. package/dist/components/ui/button.d.ts.map +1 -0
  21. package/dist/components/ui/button.js +33 -0
  22. package/dist/components/ui/calendar.d.ts +9 -0
  23. package/dist/components/ui/calendar.d.ts.map +1 -0
  24. package/dist/components/ui/calendar.js +70 -0
  25. package/dist/components/ui/card.d.ts +9 -0
  26. package/dist/components/ui/card.d.ts.map +1 -0
  27. package/dist/components/ui/card.js +16 -0
  28. package/dist/components/ui/carousel.d.ts +19 -0
  29. package/dist/components/ui/carousel.d.ts.map +1 -0
  30. package/dist/components/ui/carousel.js +98 -0
  31. package/dist/components/ui/chart.d.ts +63 -0
  32. package/dist/components/ui/chart.d.ts.map +1 -0
  33. package/dist/components/ui/chart.js +132 -0
  34. package/dist/components/ui/checkbox.d.ts +5 -0
  35. package/dist/components/ui/checkbox.d.ts.map +1 -0
  36. package/dist/components/ui/checkbox.js +8 -0
  37. package/dist/components/ui/collapsible.d.ts +6 -0
  38. package/dist/components/ui/collapsible.d.ts.map +1 -0
  39. package/dist/components/ui/collapsible.js +5 -0
  40. package/dist/components/ui/command.d.ts +81 -0
  41. package/dist/components/ui/command.d.ts.map +1 -0
  42. package/dist/components/ui/command.js +28 -0
  43. package/dist/components/ui/context-menu.d.ts +28 -0
  44. package/dist/components/ui/context-menu.d.ts.map +1 -0
  45. package/dist/components/ui/context-menu.js +33 -0
  46. package/dist/components/ui/custom/date-picker.d.ts +12 -0
  47. package/dist/components/ui/custom/date-picker.d.ts.map +1 -0
  48. package/dist/components/ui/custom/date-picker.js +35 -0
  49. package/dist/components/ui/custom/form/checkbox.d.ts +13 -0
  50. package/dist/components/ui/custom/form/checkbox.d.ts.map +1 -0
  51. package/dist/components/ui/custom/form/checkbox.js +15 -0
  52. package/dist/components/ui/custom/form/color.d.ts +15 -0
  53. package/dist/components/ui/custom/form/color.d.ts.map +1 -0
  54. package/dist/components/ui/custom/form/color.js +40 -0
  55. package/dist/components/ui/custom/form/combobox.d.ts +37 -0
  56. package/dist/components/ui/custom/form/combobox.d.ts.map +1 -0
  57. package/dist/components/ui/custom/form/combobox.js +82 -0
  58. package/dist/components/ui/custom/form/cpf-cnpj.d.ts +16 -0
  59. package/dist/components/ui/custom/form/cpf-cnpj.d.ts.map +1 -0
  60. package/dist/components/ui/custom/form/cpf-cnpj.js +32 -0
  61. package/dist/components/ui/custom/form/currency.d.ts +14 -0
  62. package/dist/components/ui/custom/form/currency.d.ts.map +1 -0
  63. package/dist/components/ui/custom/form/currency.js +15 -0
  64. package/dist/components/ui/custom/form/date-range.d.ts +16 -0
  65. package/dist/components/ui/custom/form/date-range.d.ts.map +1 -0
  66. package/dist/components/ui/custom/form/date-range.js +24 -0
  67. package/dist/components/ui/custom/form/date.d.ts +16 -0
  68. package/dist/components/ui/custom/form/date.d.ts.map +1 -0
  69. package/dist/components/ui/custom/form/date.js +35 -0
  70. package/dist/components/ui/custom/form/decimal.d.ts +14 -0
  71. package/dist/components/ui/custom/form/decimal.d.ts.map +1 -0
  72. package/dist/components/ui/custom/form/decimal.js +15 -0
  73. package/dist/components/ui/custom/form/file.d.ts +15 -0
  74. package/dist/components/ui/custom/form/file.d.ts.map +1 -0
  75. package/dist/components/ui/custom/form/file.js +18 -0
  76. package/dist/components/ui/custom/form/form-help-text.d.ts +3 -0
  77. package/dist/components/ui/custom/form/form-help-text.d.ts.map +1 -0
  78. package/dist/components/ui/custom/form/form-help-text.js +7 -0
  79. package/dist/components/ui/custom/form/form-label.d.ts +7 -0
  80. package/dist/components/ui/custom/form/form-label.d.ts.map +1 -0
  81. package/dist/components/ui/custom/form/form-label.js +9 -0
  82. package/dist/components/ui/custom/form/form-message.d.ts +5 -0
  83. package/dist/components/ui/custom/form/form-message.d.ts.map +1 -0
  84. package/dist/components/ui/custom/form/form-message.js +5 -0
  85. package/dist/components/ui/custom/form/ghost.d.ts +8 -0
  86. package/dist/components/ui/custom/form/ghost.d.ts.map +1 -0
  87. package/dist/components/ui/custom/form/ghost.js +8 -0
  88. package/dist/components/ui/custom/form/input.d.ts +18 -0
  89. package/dist/components/ui/custom/form/input.d.ts.map +1 -0
  90. package/dist/components/ui/custom/form/input.js +14 -0
  91. package/dist/components/ui/custom/form/mask.d.ts +19 -0
  92. package/dist/components/ui/custom/form/mask.d.ts.map +1 -0
  93. package/dist/components/ui/custom/form/mask.js +19 -0
  94. package/dist/components/ui/custom/form/multi-select.d.ts +26 -0
  95. package/dist/components/ui/custom/form/multi-select.d.ts.map +1 -0
  96. package/dist/components/ui/custom/form/multi-select.js +66 -0
  97. package/dist/components/ui/custom/form/password.d.ts +16 -0
  98. package/dist/components/ui/custom/form/password.d.ts.map +1 -0
  99. package/dist/components/ui/custom/form/password.js +14 -0
  100. package/dist/components/ui/custom/form/percent.d.ts +14 -0
  101. package/dist/components/ui/custom/form/percent.d.ts.map +1 -0
  102. package/dist/components/ui/custom/form/percent.js +15 -0
  103. package/dist/components/ui/custom/form/phone.d.ts +16 -0
  104. package/dist/components/ui/custom/form/phone.d.ts.map +1 -0
  105. package/dist/components/ui/custom/form/phone.js +23 -0
  106. package/dist/components/ui/custom/form/radio-group.d.ts +23 -0
  107. package/dist/components/ui/custom/form/radio-group.d.ts.map +1 -0
  108. package/dist/components/ui/custom/form/radio-group.js +15 -0
  109. package/dist/components/ui/custom/form/select.d.ts +20 -0
  110. package/dist/components/ui/custom/form/select.d.ts.map +1 -0
  111. package/dist/components/ui/custom/form/select.js +12 -0
  112. package/dist/components/ui/custom/form/step-new-form.d.ts +10 -0
  113. package/dist/components/ui/custom/form/step-new-form.d.ts.map +1 -0
  114. package/dist/components/ui/custom/form/step-new-form.js +13 -0
  115. package/dist/components/ui/custom/form/switch.d.ts +13 -0
  116. package/dist/components/ui/custom/form/switch.d.ts.map +1 -0
  117. package/dist/components/ui/custom/form/switch.js +16 -0
  118. package/dist/components/ui/custom/form/text.d.ts +18 -0
  119. package/dist/components/ui/custom/form/text.d.ts.map +1 -0
  120. package/dist/components/ui/custom/form/text.js +14 -0
  121. package/dist/components/ui/custom/form/textarea.d.ts +16 -0
  122. package/dist/components/ui/custom/form/textarea.d.ts.map +1 -0
  123. package/dist/components/ui/custom/form/textarea.js +19 -0
  124. package/dist/components/ui/custom/form/utils.d.ts +18 -0
  125. package/dist/components/ui/custom/form/utils.d.ts.map +1 -0
  126. package/dist/components/ui/custom/form/utils.js +88 -0
  127. package/dist/components/ui/custom/header.d.ts +11 -0
  128. package/dist/components/ui/custom/header.d.ts.map +1 -0
  129. package/dist/components/ui/custom/header.js +74 -0
  130. package/dist/components/ui/custom/label.d.ts +13 -0
  131. package/dist/components/ui/custom/label.d.ts.map +1 -0
  132. package/dist/components/ui/custom/label.js +20 -0
  133. package/dist/components/ui/custom/not-found.d.ts +3 -0
  134. package/dist/components/ui/custom/not-found.d.ts.map +1 -0
  135. package/dist/components/ui/custom/not-found.js +9 -0
  136. package/dist/components/ui/custom/sidebar/module-switcher.d.ts +9 -0
  137. package/dist/components/ui/custom/sidebar/module-switcher.d.ts.map +1 -0
  138. package/dist/components/ui/custom/sidebar/module-switcher.js +20 -0
  139. package/dist/components/ui/custom/sidebar/nav-footer.d.ts +7 -0
  140. package/dist/components/ui/custom/sidebar/nav-footer.d.ts.map +1 -0
  141. package/dist/components/ui/custom/sidebar/nav-footer.js +13 -0
  142. package/dist/components/ui/custom/sidebar/nav-main.d.ts +7 -0
  143. package/dist/components/ui/custom/sidebar/nav-main.d.ts.map +1 -0
  144. package/dist/components/ui/custom/sidebar/nav-main.js +27 -0
  145. package/dist/components/ui/custom/sidebar/nav-submenu-collapsible.d.ts +9 -0
  146. package/dist/components/ui/custom/sidebar/nav-submenu-collapsible.d.ts.map +1 -0
  147. package/dist/components/ui/custom/sidebar/nav-submenu-collapsible.js +18 -0
  148. package/dist/components/ui/custom/sidebar/nav-submenu-dropdown.d.ts +10 -0
  149. package/dist/components/ui/custom/sidebar/nav-submenu-dropdown.d.ts.map +1 -0
  150. package/dist/components/ui/custom/sidebar/nav-submenu-dropdown.js +10 -0
  151. package/dist/components/ui/custom/sidebar/nav-user.d.ts +9 -0
  152. package/dist/components/ui/custom/sidebar/nav-user.d.ts.map +1 -0
  153. package/dist/components/ui/custom/sidebar/nav-user.js +24 -0
  154. package/dist/components/ui/custom/sidebar/sidebar-button.d.ts +9 -0
  155. package/dist/components/ui/custom/sidebar/sidebar-button.d.ts.map +1 -0
  156. package/dist/components/ui/custom/sidebar/sidebar-button.js +7 -0
  157. package/dist/components/ui/custom/sidebar/sidebar-item-two-lines.d.ts +12 -0
  158. package/dist/components/ui/custom/sidebar/sidebar-item-two-lines.d.ts.map +1 -0
  159. package/dist/components/ui/custom/sidebar/sidebar-item-two-lines.js +5 -0
  160. package/dist/components/ui/custom/sidebar/sidebar-item.d.ts +9 -0
  161. package/dist/components/ui/custom/sidebar/sidebar-item.d.ts.map +1 -0
  162. package/dist/components/ui/custom/sidebar/sidebar-item.js +7 -0
  163. package/dist/components/ui/custom/sidebar/types/sidebar.d.ts +29 -0
  164. package/dist/components/ui/custom/sidebar/types/sidebar.d.ts.map +1 -0
  165. package/dist/components/ui/custom/sidebar/types/sidebar.js +5 -0
  166. package/dist/components/ui/custom/table/data-table-export.d.ts +8 -0
  167. package/dist/components/ui/custom/table/data-table-export.d.ts.map +1 -0
  168. package/dist/components/ui/custom/table/data-table-export.js +65 -0
  169. package/dist/components/ui/custom/table/data-table-footer.d.ts +25 -0
  170. package/dist/components/ui/custom/table/data-table-footer.d.ts.map +1 -0
  171. package/dist/components/ui/custom/table/data-table-footer.js +39 -0
  172. package/dist/components/ui/custom/table/data-table-header.d.ts +9 -0
  173. package/dist/components/ui/custom/table/data-table-header.d.ts.map +1 -0
  174. package/dist/components/ui/custom/table/data-table-header.js +11 -0
  175. package/dist/components/ui/custom/table/data-table-rows.d.ts +13 -0
  176. package/dist/components/ui/custom/table/data-table-rows.d.ts.map +1 -0
  177. package/dist/components/ui/custom/table/data-table-rows.js +25 -0
  178. package/dist/components/ui/custom/table/data-table.d.ts +35 -0
  179. package/dist/components/ui/custom/table/data-table.d.ts.map +1 -0
  180. package/dist/components/ui/custom/table/data-table.js +99 -0
  181. package/dist/components/ui/custom/table/types/data-table.d.ts +29 -0
  182. package/dist/components/ui/custom/table/types/data-table.d.ts.map +1 -0
  183. package/dist/components/ui/custom/table/types/data-table.js +1 -0
  184. package/dist/components/ui/custom/theme-provider.d.ts +24 -0
  185. package/dist/components/ui/custom/theme-provider.d.ts.map +1 -0
  186. package/dist/components/ui/custom/theme-provider.js +79 -0
  187. package/dist/components/ui/dateRangePicker.d.ts +3 -0
  188. package/dist/components/ui/dateRangePicker.d.ts.map +1 -0
  189. package/dist/components/ui/dateRangePicker.js +15 -0
  190. package/dist/components/ui/dialog.d.ts +23 -0
  191. package/dist/components/ui/dialog.d.ts.map +1 -0
  192. package/dist/components/ui/dialog.js +23 -0
  193. package/dist/components/ui/drawer.d.ts +23 -0
  194. package/dist/components/ui/drawer.d.ts.map +1 -0
  195. package/dist/components/ui/drawer.js +22 -0
  196. package/dist/components/ui/dropdown-menu.d.ts +28 -0
  197. package/dist/components/ui/dropdown-menu.d.ts.map +1 -0
  198. package/dist/components/ui/dropdown-menu.js +32 -0
  199. package/dist/components/ui/form.d.ts +24 -0
  200. package/dist/components/ui/form.d.ts.map +1 -0
  201. package/dist/components/ui/form.js +60 -0
  202. package/dist/components/ui/hover-card.d.ts +7 -0
  203. package/dist/components/ui/hover-card.d.ts.map +1 -0
  204. package/dist/components/ui/hover-card.js +9 -0
  205. package/dist/components/ui/input.d.ts +24 -0
  206. package/dist/components/ui/input.d.ts.map +1 -0
  207. package/dist/components/ui/input.js +71 -0
  208. package/dist/components/ui/label.d.ts +6 -0
  209. package/dist/components/ui/label.d.ts.map +1 -0
  210. package/dist/components/ui/label.js +9 -0
  211. package/dist/components/ui/masks.d.ts +17 -0
  212. package/dist/components/ui/masks.d.ts.map +1 -0
  213. package/dist/components/ui/masks.js +25 -0
  214. package/dist/components/ui/pagination.d.ts +30 -0
  215. package/dist/components/ui/pagination.d.ts.map +1 -0
  216. package/dist/components/ui/pagination.js +23 -0
  217. package/dist/components/ui/popover.d.ts +7 -0
  218. package/dist/components/ui/popover.d.ts.map +1 -0
  219. package/dist/components/ui/popover.js +11 -0
  220. package/dist/components/ui/progress.d.ts +5 -0
  221. package/dist/components/ui/progress.d.ts.map +1 -0
  222. package/dist/components/ui/progress.js +7 -0
  223. package/dist/components/ui/radio-group.d.ts +6 -0
  224. package/dist/components/ui/radio-group.d.ts.map +1 -0
  225. package/dist/components/ui/radio-group.js +14 -0
  226. package/dist/components/ui/scroll-area.d.ts +6 -0
  227. package/dist/components/ui/scroll-area.d.ts.map +1 -0
  228. package/dist/components/ui/scroll-area.js +11 -0
  229. package/dist/components/ui/select.d.ts +14 -0
  230. package/dist/components/ui/select.d.ts.map +1 -0
  231. package/dist/components/ui/select.js +24 -0
  232. package/dist/components/ui/separator.d.ts +5 -0
  233. package/dist/components/ui/separator.d.ts.map +1 -0
  234. package/dist/components/ui/separator.js +7 -0
  235. package/dist/components/ui/sheet.d.ts +26 -0
  236. package/dist/components/ui/sheet.d.ts.map +1 -0
  237. package/dist/components/ui/sheet.js +37 -0
  238. package/dist/components/ui/sidebar.d.ts +67 -0
  239. package/dist/components/ui/sidebar.d.ts.map +1 -0
  240. package/dist/components/ui/sidebar.js +221 -0
  241. package/dist/components/ui/skeleton.d.ts +3 -0
  242. package/dist/components/ui/skeleton.d.ts.map +1 -0
  243. package/dist/components/ui/skeleton.js +6 -0
  244. package/dist/components/ui/slider.d.ts +5 -0
  245. package/dist/components/ui/slider.d.ts.map +1 -0
  246. package/dist/components/ui/slider.js +7 -0
  247. package/dist/components/ui/switch.d.ts +5 -0
  248. package/dist/components/ui/switch.d.ts.map +1 -0
  249. package/dist/components/ui/switch.js +7 -0
  250. package/dist/components/ui/table.d.ts +11 -0
  251. package/dist/components/ui/table.d.ts.map +1 -0
  252. package/dist/components/ui/table.js +20 -0
  253. package/dist/components/ui/tabs.d.ts +8 -0
  254. package/dist/components/ui/tabs.d.ts.map +1 -0
  255. package/dist/components/ui/tabs.js +12 -0
  256. package/dist/components/ui/textarea.d.ts +4 -0
  257. package/dist/components/ui/textarea.d.ts.map +1 -0
  258. package/dist/components/ui/textarea.js +14 -0
  259. package/dist/components/ui/toast.d.ts +16 -0
  260. package/dist/components/ui/toast.d.ts.map +1 -0
  261. package/dist/components/ui/toast.js +34 -0
  262. package/dist/components/ui/toaster.d.ts +2 -0
  263. package/dist/components/ui/toaster.d.ts.map +1 -0
  264. package/dist/components/ui/toaster.js +21 -0
  265. package/dist/components/ui/tooltip.d.ts +8 -0
  266. package/dist/components/ui/tooltip.d.ts.map +1 -0
  267. package/dist/components/ui/tooltip.js +10 -0
  268. package/dist/components/ui/use-calendar.d.ts +7 -0
  269. package/dist/components/ui/use-calendar.d.ts.map +1 -0
  270. package/dist/components/ui/use-calendar.js +23 -0
  271. package/dist/components/ui/use-toast.d.ts +46 -0
  272. package/dist/components/ui/use-toast.d.ts.map +1 -0
  273. package/dist/components/ui/use-toast.js +125 -0
  274. package/dist/hooks/use-mobile.d.ts +2 -0
  275. package/dist/hooks/use-mobile.d.ts.map +1 -0
  276. package/dist/hooks/use-mobile.js +15 -0
  277. package/dist/index.d.ts +13 -13
  278. package/dist/index.d.ts.map +1 -0
  279. package/dist/index.esm.js +10 -6
  280. package/dist/index.esm.js.map +1 -1
  281. package/dist/index.js +10 -6
  282. package/dist/index.js.map +1 -1
  283. package/dist/lib/help/date-utils.d.ts +7 -0
  284. package/dist/lib/help/date-utils.d.ts.map +1 -0
  285. package/dist/lib/help/date-utils.js +34 -0
  286. package/dist/lib/help/format.d.ts +22 -0
  287. package/dist/lib/help/format.d.ts.map +1 -0
  288. package/dist/lib/help/format.js +140 -0
  289. package/dist/lib/help/theme.d.ts +291 -0
  290. package/dist/lib/help/theme.d.ts.map +1 -0
  291. package/dist/lib/help/theme.js +340 -0
  292. package/dist/lib/help/uuid.d.ts +2 -0
  293. package/dist/lib/help/uuid.d.ts.map +1 -0
  294. package/dist/lib/help/uuid.js +4 -0
  295. package/dist/lib/utils.d.ts +3 -0
  296. package/dist/lib/utils.d.ts.map +1 -0
  297. package/dist/lib/utils.js +5 -0
  298. package/package.json +1 -1
@@ -0,0 +1,7 @@
1
+ export declare const getFirstDayOfCurrentMonth: () => Date;
2
+ export declare const getFirstDayOf90DaysAgo: () => Date;
3
+ export declare const stringToDate: (dateString: string, separator?: string) => Date | undefined;
4
+ export declare const aYearAgo: () => Date;
5
+ export declare const invertDate: (date: string, separator?: string) => string;
6
+ export declare const addDaysToToday: (days: number) => Date;
7
+ //# sourceMappingURL=date-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date-utils.d.ts","sourceRoot":"","sources":["../../../src/lib/help/date-utils.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,yBAAyB,QAAO,IAG5C,CAAC;AAEF,eAAO,MAAM,sBAAsB,QAAO,IAGzC,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,YAAY,MAAM,EAAE,YAAW,MAAY,KAAG,IAAI,GAAG,SAWjF,CAAC;AAEF,eAAO,MAAM,QAAQ,QAAO,IAK3B,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,MAAM,MAAM,EAAE,YAAW,MAAY,KAAG,MAIlE,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,MAAM,MAAM,KAAG,IAI7C,CAAC"}
@@ -0,0 +1,34 @@
1
+ export const getFirstDayOfCurrentMonth = () => {
2
+ const now = new Date();
3
+ return new Date(now.getFullYear(), now.getMonth(), 1);
4
+ };
5
+ export const getFirstDayOf90DaysAgo = () => {
6
+ const now = new Date();
7
+ return new Date(now.getFullYear(), now.getMonth() - 3, 1);
8
+ };
9
+ export const stringToDate = (dateString, separator = '/') => {
10
+ if (!dateString)
11
+ return undefined;
12
+ const dateParts = dateString.split(separator);
13
+ if (dateParts.length !== 3)
14
+ return undefined;
15
+ const day = parseInt(dateParts[0], 10);
16
+ const month = parseInt(dateParts[1], 10) - 1; // Months are zero-based in JavaScript
17
+ const year = parseInt(dateParts[2], 10);
18
+ return new Date(year, month, day);
19
+ };
20
+ export const aYearAgo = () => {
21
+ const aYearAgo = new Date();
22
+ aYearAgo.setFullYear(aYearAgo.getFullYear() - 1);
23
+ return aYearAgo;
24
+ };
25
+ export const invertDate = (date, separator = '/') => {
26
+ if (!date)
27
+ return '';
28
+ return date.split(separator).reverse().join('-');
29
+ };
30
+ export const addDaysToToday = (days) => {
31
+ const date = new Date();
32
+ date.setDate(date.getDate() + days);
33
+ return date;
34
+ };
@@ -0,0 +1,22 @@
1
+ export declare function formatPhone(telefone: string, removerCountryCode?: boolean): string;
2
+ export declare function formatCpfCnpj(cpfCnpj?: string): string;
3
+ export declare const formatDate: (date: string | Date | undefined, separator?: string) => string;
4
+ export declare const formatDateTime: (date: Date | undefined, returnSeconds?: boolean) => string;
5
+ export declare function formatDateCalendar(date: Date | undefined): string;
6
+ export declare function stringDateToDate(date: string | undefined, separator?: string): Date | undefined;
7
+ export declare const roundNumber: (value: number, fractionDigits?: number) => number;
8
+ export declare const stringToNumber: (value: string | undefined) => number;
9
+ export declare const convertMbToGb: (value: number) => number;
10
+ export declare const convertGbToMb: (value: number) => number;
11
+ export declare const convertSecondsToMinutes: (value: number) => number;
12
+ export declare const convertBytesToMB: (bytes: number) => number;
13
+ export declare const convertMonthToDays: (months: number) => number;
14
+ export declare const convertDaysToMonth: (days: number) => number;
15
+ export declare const formatNumber: (value: number) => string;
16
+ export declare const formatDecimal: (value: number, decimalPlaces?: number) => string;
17
+ export declare const formatPercent: (value: number, decimalPlaces?: number) => string;
18
+ export declare const formatCurrency: (value: number, decimalPlaces?: number) => string;
19
+ export declare const isInvalidCurrencyValue: (rawValue: string | undefined) => boolean;
20
+ export declare function formatMsisdn(value?: string): string;
21
+ export declare function formatCEP(cep?: string): string;
22
+ //# sourceMappingURL=format.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../src/lib/help/format.ts"],"names":[],"mappings":"AAIA,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,kBAAkB,UAAO,UAWtE;AAGD,wBAAgB,aAAa,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAMtD;AAeD,eAAO,MAAM,UAAU,GAAI,MAAM,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,YAAW,MAAY,WAMlF,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,MAAM,IAAI,GAAG,SAAS,EAAE,gBAAe,OAAe,KAAG,MAQvF,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,GAAG,SAAS,GAAG,MAAM,CAQjE;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,SAAS,GAAE,MAAY,GAAG,IAAI,GAAG,SAAS,CAOpG;AAGD,eAAO,MAAM,WAAW,GAAI,OAAO,MAAM,EAAE,iBAAgB,MAAU,KAAG,MAEvE,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,OAAO,MAAM,GAAG,SAAS,KAAG,MAQ1D,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,OAAO,MAAM,WAE1C,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,OAAO,MAAM,WAE1C,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,OAAO,MAAM,KAAG,MAEvD,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,OAAO,MAAM,KAAG,MAGhD,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,QAAQ,MAAM,KAAG,MAEnD,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,MAAM,MAAM,KAAG,MAEjD,CAAC;AAGF,eAAO,MAAM,YAAY,GAAI,OAAO,MAAM,WAMzC,CAAC;AAGF,eAAO,MAAM,aAAa,GAAI,OAAO,MAAM,EAAE,gBAAe,MAAU,WAMrE,CAAC;AAGF,eAAO,MAAM,aAAa,GAAI,OAAO,MAAM,EAAE,gBAAe,MAAU,WAErE,CAAC;AAGF,eAAO,MAAM,cAAc,GAAI,OAAO,MAAM,EAAE,gBAAe,MAAU,WAOtE,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,UAAU,MAAM,GAAG,SAAS,KAAG,OAMrE,CAAC;AAGF,wBAAgB,YAAY,CAAC,KAAK,GAAE,MAAW,GAAG,MAAM,CAGvD;AAED,wBAAgB,SAAS,CAAC,GAAG,CAAC,EAAE,MAAM,UAOrC"}
@@ -0,0 +1,140 @@
1
+ import { maskCpfCnpj, maskPhone } from "@/components/ui/masks";
2
+ import { format } from '@react-input/mask';
3
+ // PHONE
4
+ export function formatPhone(telefone, removerCountryCode = true) {
5
+ if (!telefone)
6
+ return '';
7
+ let numberPhone = telefone.replace(/\D/g, '');
8
+ // Remover código do país apenas se ele começar com '55'
9
+ if (removerCountryCode && numberPhone.startsWith('55')) {
10
+ numberPhone = numberPhone.substring(2);
11
+ }
12
+ return format(numberPhone, maskPhone(numberPhone));
13
+ }
14
+ // CPF/CNPJ
15
+ export function formatCpfCnpj(cpfCnpj) {
16
+ if (!cpfCnpj)
17
+ return '';
18
+ const numberCpfCnpj = cpfCnpj.replace(/\D/g, '');
19
+ return format(numberCpfCnpj, maskCpfCnpj(numberCpfCnpj));
20
+ }
21
+ // DATE
22
+ function getDay(date) {
23
+ return date.getDate().toString().padStart(2, '0');
24
+ }
25
+ function getMonth(date) {
26
+ return (date.getMonth() + 1).toString().padStart(2, '0');
27
+ }
28
+ function getYear(date) {
29
+ return date.getFullYear().toString();
30
+ }
31
+ export const formatDate = (date, separator = '/') => {
32
+ if (!date)
33
+ return '';
34
+ const d = new Date(date);
35
+ return d.toLocaleDateString('pt-BR');
36
+ };
37
+ export const formatDateTime = (date, returnSeconds = false) => {
38
+ if (!date)
39
+ return '';
40
+ const hours = date.getHours().toString().padStart(2, '0');
41
+ const minutes = date.getMinutes().toString().padStart(2, '0');
42
+ const seconds = returnSeconds ? `:${date.getSeconds().toString().padStart(2, '0')}` : '';
43
+ return `${formatDate(date)} ${hours}:${minutes}${seconds}`;
44
+ };
45
+ export function formatDateCalendar(date) {
46
+ if (!date)
47
+ return '';
48
+ const day = getDay(date);
49
+ const month = getMonth(date);
50
+ const year = getYear(date);
51
+ return `${year}-${month}-${day}`;
52
+ }
53
+ export function stringDateToDate(date, separator = '/') {
54
+ if (!date)
55
+ return undefined;
56
+ const [day, month, year] = date.split(separator).map(Number);
57
+ // new Date(ano, mês-1, dia) interpreta a data no fuso horário local
58
+ return new Date(year, month - 1, day);
59
+ }
60
+ // NUMBER
61
+ export const roundNumber = (value, fractionDigits = 2) => {
62
+ return Number(value.toFixed(fractionDigits));
63
+ };
64
+ export const stringToNumber = (value) => {
65
+ if (!value)
66
+ return 0;
67
+ const numericValue = value
68
+ .replace(/[^\d,-]/g, '')
69
+ .replace(/\./g, '')
70
+ .replace(',', '.');
71
+ return Number.parseFloat(numericValue);
72
+ };
73
+ export const convertMbToGb = (value) => {
74
+ return value > 0 ? roundNumber(value / 1024) : 0;
75
+ };
76
+ export const convertGbToMb = (value) => {
77
+ return value > 0 ? roundNumber(value * 1024) : 0;
78
+ };
79
+ export const convertSecondsToMinutes = (value) => {
80
+ return value > 0 ? roundNumber(value / 60) : 0;
81
+ };
82
+ export const convertBytesToMB = (bytes) => {
83
+ if (!bytes || Number.isNaN(bytes))
84
+ return 0;
85
+ return roundNumber(bytes / (1024 * 1024));
86
+ };
87
+ export const convertMonthToDays = (months) => {
88
+ return months > 0 ? months * 30 : 0;
89
+ };
90
+ export const convertDaysToMonth = (days) => {
91
+ return days > 0 ? roundNumber(days / 30) : 0;
92
+ };
93
+ // NUMBER
94
+ export const formatNumber = (value) => {
95
+ return value.toLocaleString('pt-BR', {
96
+ style: 'decimal',
97
+ minimumFractionDigits: 0,
98
+ maximumFractionDigits: 0,
99
+ });
100
+ };
101
+ // DECIMAL
102
+ export const formatDecimal = (value, decimalPlaces = 2) => {
103
+ return value.toLocaleString('pt-BR', {
104
+ style: 'decimal',
105
+ minimumFractionDigits: decimalPlaces,
106
+ maximumFractionDigits: decimalPlaces,
107
+ });
108
+ };
109
+ // PERCENT
110
+ export const formatPercent = (value, decimalPlaces = 2) => {
111
+ return `% ${formatDecimal(value, decimalPlaces)}`;
112
+ };
113
+ // CURRENCY
114
+ export const formatCurrency = (value, decimalPlaces = 2) => {
115
+ return value.toLocaleString('pt-BR', {
116
+ style: 'currency',
117
+ currency: 'BRL',
118
+ minimumFractionDigits: decimalPlaces,
119
+ maximumFractionDigits: decimalPlaces,
120
+ });
121
+ };
122
+ export const isInvalidCurrencyValue = (rawValue) => {
123
+ if (!rawValue || rawValue.trim() === '')
124
+ return true;
125
+ const numericValue = stringToNumber(rawValue);
126
+ return Number.isNaN(numericValue) || numericValue <= 0;
127
+ };
128
+ // OTHERS
129
+ export function formatMsisdn(value = '') {
130
+ const msisdn = value.replace(/\D/g, '');
131
+ return `(${msisdn.slice(2, 4)}) ${msisdn.slice(4, 9)}-${msisdn.slice(9)}`;
132
+ }
133
+ export function formatCEP(cep) {
134
+ if (!cep)
135
+ return '';
136
+ return cep
137
+ .replace(/\D/g, '')
138
+ .replace(/(\d{5})(\d)/, '$1-$2')
139
+ .replace(/(-\d{3})\d+?$/, '$1');
140
+ }
@@ -0,0 +1,291 @@
1
+ export declare function getTailwindColorShades(): {
2
+ slate: {
3
+ 50: string;
4
+ 100: string;
5
+ 200: string;
6
+ 300: string;
7
+ 400: string;
8
+ 500: string;
9
+ 600: string;
10
+ 700: string;
11
+ 800: string;
12
+ 900: string;
13
+ 950: string;
14
+ };
15
+ gray: {
16
+ 50: string;
17
+ 100: string;
18
+ 200: string;
19
+ 300: string;
20
+ 400: string;
21
+ 500: string;
22
+ 600: string;
23
+ 700: string;
24
+ 800: string;
25
+ 900: string;
26
+ 950: string;
27
+ };
28
+ zinc: {
29
+ 50: string;
30
+ 100: string;
31
+ 200: string;
32
+ 300: string;
33
+ 400: string;
34
+ 500: string;
35
+ 600: string;
36
+ 700: string;
37
+ 800: string;
38
+ 900: string;
39
+ 950: string;
40
+ };
41
+ neutral: {
42
+ 50: string;
43
+ 100: string;
44
+ 200: string;
45
+ 300: string;
46
+ 400: string;
47
+ 500: string;
48
+ 600: string;
49
+ 700: string;
50
+ 800: string;
51
+ 900: string;
52
+ 950: string;
53
+ };
54
+ stone: {
55
+ 50: string;
56
+ 100: string;
57
+ 200: string;
58
+ 300: string;
59
+ 400: string;
60
+ 500: string;
61
+ 600: string;
62
+ 700: string;
63
+ 800: string;
64
+ 900: string;
65
+ 950: string;
66
+ };
67
+ red: {
68
+ 50: string;
69
+ 100: string;
70
+ 200: string;
71
+ 300: string;
72
+ 400: string;
73
+ 500: string;
74
+ 600: string;
75
+ 700: string;
76
+ 800: string;
77
+ 900: string;
78
+ 950: string;
79
+ };
80
+ orange: {
81
+ 50: string;
82
+ 100: string;
83
+ 200: string;
84
+ 300: string;
85
+ 400: string;
86
+ 500: string;
87
+ 600: string;
88
+ 700: string;
89
+ 800: string;
90
+ 900: string;
91
+ 950: string;
92
+ };
93
+ amber: {
94
+ 50: string;
95
+ 100: string;
96
+ 200: string;
97
+ 300: string;
98
+ 400: string;
99
+ 500: string;
100
+ 600: string;
101
+ 700: string;
102
+ 800: string;
103
+ 900: string;
104
+ 950: string;
105
+ };
106
+ yellow: {
107
+ 50: string;
108
+ 100: string;
109
+ 200: string;
110
+ 300: string;
111
+ 400: string;
112
+ 500: string;
113
+ 600: string;
114
+ 700: string;
115
+ 800: string;
116
+ 900: string;
117
+ 950: string;
118
+ };
119
+ lime: {
120
+ 50: string;
121
+ 100: string;
122
+ 200: string;
123
+ 300: string;
124
+ 400: string;
125
+ 500: string;
126
+ 600: string;
127
+ 700: string;
128
+ 800: string;
129
+ 900: string;
130
+ 950: string;
131
+ };
132
+ green: {
133
+ 50: string;
134
+ 100: string;
135
+ 200: string;
136
+ 300: string;
137
+ 400: string;
138
+ 500: string;
139
+ 600: string;
140
+ 700: string;
141
+ 800: string;
142
+ 900: string;
143
+ 950: string;
144
+ };
145
+ emerald: {
146
+ 50: string;
147
+ 100: string;
148
+ 200: string;
149
+ 300: string;
150
+ 400: string;
151
+ 500: string;
152
+ 600: string;
153
+ 700: string;
154
+ 800: string;
155
+ 900: string;
156
+ 950: string;
157
+ };
158
+ teal: {
159
+ 50: string;
160
+ 100: string;
161
+ 200: string;
162
+ 300: string;
163
+ 400: string;
164
+ 500: string;
165
+ 600: string;
166
+ 700: string;
167
+ 800: string;
168
+ 900: string;
169
+ 950: string;
170
+ };
171
+ cyan: {
172
+ 50: string;
173
+ 100: string;
174
+ 200: string;
175
+ 300: string;
176
+ 400: string;
177
+ 500: string;
178
+ 600: string;
179
+ 700: string;
180
+ 800: string;
181
+ 900: string;
182
+ 950: string;
183
+ };
184
+ sky: {
185
+ 50: string;
186
+ 100: string;
187
+ 200: string;
188
+ 300: string;
189
+ 400: string;
190
+ 500: string;
191
+ 600: string;
192
+ 700: string;
193
+ 800: string;
194
+ 900: string;
195
+ 950: string;
196
+ };
197
+ blue: {
198
+ 50: string;
199
+ 100: string;
200
+ 200: string;
201
+ 300: string;
202
+ 400: string;
203
+ 500: string;
204
+ 600: string;
205
+ 700: string;
206
+ 800: string;
207
+ 900: string;
208
+ 950: string;
209
+ };
210
+ indigo: {
211
+ 50: string;
212
+ 100: string;
213
+ 200: string;
214
+ 300: string;
215
+ 400: string;
216
+ 500: string;
217
+ 600: string;
218
+ 700: string;
219
+ 800: string;
220
+ 900: string;
221
+ 950: string;
222
+ };
223
+ violet: {
224
+ 50: string;
225
+ 100: string;
226
+ 200: string;
227
+ 300: string;
228
+ 400: string;
229
+ 500: string;
230
+ 600: string;
231
+ 700: string;
232
+ 800: string;
233
+ 900: string;
234
+ 950: string;
235
+ };
236
+ purple: {
237
+ 50: string;
238
+ 100: string;
239
+ 200: string;
240
+ 300: string;
241
+ 400: string;
242
+ 500: string;
243
+ 600: string;
244
+ 700: string;
245
+ 800: string;
246
+ 900: string;
247
+ 950: string;
248
+ };
249
+ fuchsia: {
250
+ 50: string;
251
+ 100: string;
252
+ 200: string;
253
+ 300: string;
254
+ 400: string;
255
+ 500: string;
256
+ 600: string;
257
+ 700: string;
258
+ 800: string;
259
+ 900: string;
260
+ 950: string;
261
+ };
262
+ pink: {
263
+ 50: string;
264
+ 100: string;
265
+ 200: string;
266
+ 300: string;
267
+ 400: string;
268
+ 500: string;
269
+ 600: string;
270
+ 700: string;
271
+ 800: string;
272
+ 900: string;
273
+ 950: string;
274
+ };
275
+ rose: {
276
+ 50: string;
277
+ 100: string;
278
+ 200: string;
279
+ 300: string;
280
+ 400: string;
281
+ 500: string;
282
+ 600: string;
283
+ 700: string;
284
+ 800: string;
285
+ 900: string;
286
+ 950: string;
287
+ };
288
+ };
289
+ export type TailwindColorName = keyof ReturnType<typeof getTailwindColorShades>;
290
+ export declare const replaceThemeTailwindColors: (theme: string, tailwindColor: string) => HTMLStyleElement;
291
+ //# sourceMappingURL=theme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../src/lib/help/theme.ts"],"names":[],"mappings":"AACA,wBAAgB,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmSrC;AAED,MAAM,MAAM,iBAAiB,GAAG,MAAM,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEhF,eAAO,MAAM,0BAA0B,GAAI,OAAO,MAAM,EAAE,eAAe,MAAM,KAAG,gBAiDjF,CAAC"}