@majapisoftwares/ui 4.1.17 → 4.2.0

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 (160) hide show
  1. package/bootstrap/AppProps.d.ts +4 -5
  2. package/components/Accordion/Accordion.d.ts +1 -1
  3. package/components/Alert/Alert.d.ts +1 -1
  4. package/components/Alert/Alert.jsx +19 -19
  5. package/components/Autocomplete/Autocomplete.d.ts +1 -1
  6. package/components/Autocomplete/Autocomplete.jsx +3 -3
  7. package/components/Autocomplete/UnstyledAutocomplete.d.ts +2 -2
  8. package/components/Autocomplete/UnstyledAutocomplete.jsx +23 -24
  9. package/components/Badge/Badge.d.ts +1 -1
  10. package/components/Badge/Badge.jsx +9 -9
  11. package/components/Breadcrumbs/Breadcrumbs.d.ts +1 -1
  12. package/components/Button/Button.d.ts +2 -2
  13. package/components/Button/Button.jsx +5 -5
  14. package/components/Carousel/Carousel.d.ts +2 -2
  15. package/components/Carousel/Carousel.jsx +13 -13
  16. package/components/Checkbox/Checkbox.d.ts +1 -1
  17. package/components/Checkbox/Checkbox.jsx +12 -12
  18. package/components/Code/Code.d.ts +1 -1
  19. package/components/Code/Code.jsx +15 -15
  20. package/components/ConfirmationButton/ConfirmationButton.d.ts +3 -3
  21. package/components/ConfirmationButton/ConfirmationButton.jsx +10 -10
  22. package/components/ContextMenu/ContextMenu.d.ts +1 -1
  23. package/components/ContextMenu/ContextMenu.jsx +22 -22
  24. package/components/DateInput/DateInput.d.ts +1 -1
  25. package/components/DateInput/DateInput.jsx +1 -1
  26. package/components/DateInput/DateTimeInput.d.ts +1 -1
  27. package/components/DateInput/DateTimeInput.jsx +1 -1
  28. package/components/DateInput/useRefValue.d.ts +1 -1
  29. package/components/DatePicker/DatePicker.d.ts +3 -3
  30. package/components/DatePicker/DatePicker.jsx +8 -8
  31. package/components/DateRangePicker/DateRangePicker.d.ts +2 -2
  32. package/components/DateRangePicker/DateRangePicker.jsx +8 -8
  33. package/components/Dialog/Dialog.d.ts +2 -2
  34. package/components/Dialog/Dialog.jsx +23 -23
  35. package/components/Dialog/Dialogs.jsx +4 -4
  36. package/components/Dialog/dialogs.state.d.ts +2 -2
  37. package/components/Drawer/Drawer.d.ts +1 -1
  38. package/components/Drawer/Drawer.jsx +41 -41
  39. package/components/DropdownMenu/DropdownMenu.d.ts +1 -1
  40. package/components/DropdownMenu/DropdownMenu.jsx +23 -23
  41. package/components/ErrorBoundary/ErrorBoundary.d.ts +1 -1
  42. package/components/ErrorBoundary/ErrorBoundary.jsx +4 -4
  43. package/components/ErrorPage/ErrorPage.d.ts +1 -1
  44. package/components/ErrorPage/ErrorPage.jsx +16 -16
  45. package/components/FileInput/FileInput.d.ts +4 -4
  46. package/components/FileInput/FileInput.jsx +2 -2
  47. package/components/FileInput/PreviewFile.d.ts +2 -2
  48. package/components/FileSelect/FileSelect.d.ts +1 -1
  49. package/components/Footer/Footer.d.ts +1 -1
  50. package/components/Footer/Footer.jsx +22 -22
  51. package/components/GridPattern/GridPattern.d.ts +1 -1
  52. package/components/GridPattern/GridPattern.jsx +7 -7
  53. package/components/Header/Header.d.ts +1 -1
  54. package/components/Header/Header.jsx +2 -2
  55. package/components/ImageInput/ImageInput.d.ts +1 -1
  56. package/components/Input/Input.d.ts +1 -1
  57. package/components/Input/Input.jsx +7 -7
  58. package/components/Input/InputIcon.d.ts +1 -1
  59. package/components/Input/MultiSelectInput.d.ts +2 -2
  60. package/components/Input/MultiSelectInput.jsx +15 -15
  61. package/components/Input/NumericInput.d.ts +3 -3
  62. package/components/Input/NumericInput.jsx +1 -1
  63. package/components/Input/PatternInput.d.ts +3 -3
  64. package/components/Input/PatternInput.jsx +1 -1
  65. package/components/Input/UnstyledInput.d.ts +1 -1
  66. package/components/Input/UnstyledInput.jsx +12 -12
  67. package/components/Input2/InputWrapper.d.ts +1 -1
  68. package/components/Input2/InputWrapper.jsx +7 -7
  69. package/components/Link/Link.d.ts +1 -1
  70. package/components/Magnet/Magnet.d.ts +1 -1
  71. package/components/Markdown/Markdown.d.ts +1 -1
  72. package/components/Markdown/Markdown.jsx +1 -1
  73. package/components/Menu/Menu.d.ts +3 -3
  74. package/components/Menu/Menu.jsx +19 -19
  75. package/components/Modal/Modal.d.ts +1 -1
  76. package/components/Modal/Modal.jsx +26 -26
  77. package/components/ModeToggle/ModeToggle.d.ts +1 -1
  78. package/components/ModeToggle/ModeToggle.jsx +3 -3
  79. package/components/MultiSelect/MultiSelect.d.ts +2 -2
  80. package/components/MultiSelect/MultiSelect.jsx +2 -2
  81. package/components/MultiSelect/MultiSelectInput.d.ts +1 -1
  82. package/components/MultiText/MultiText.d.ts +1 -1
  83. package/components/MultiText/MultiText.jsx +0 -1
  84. package/components/NavigationDrawer/NavigationDrawer.d.ts +1 -1
  85. package/components/NavigationDrawer/NavigationDrawer.jsx +11 -11
  86. package/components/NavigationDrawer/NavigationItem.d.ts +1 -1
  87. package/components/NavigationDrawer/NavigationItem.jsx +2 -2
  88. package/components/NoSsr/NoSsr.d.ts +1 -1
  89. package/components/Notifications/Notifications.jsx +29 -29
  90. package/components/Notifications/notifications.state.d.ts +2 -2
  91. package/components/Notifications/notifications.state.js +1 -1
  92. package/components/Pagination/Pagination.jsx +15 -15
  93. package/components/Particles/Particles.jsx +55 -55
  94. package/components/PictureCropInput/PictureCropInput.d.ts +2 -2
  95. package/components/PictureCropInput/PictureCropInput.jsx +39 -39
  96. package/components/PictureCropInput/canvasPreview.d.ts +1 -1
  97. package/components/Popover/Popover.d.ts +1 -1
  98. package/components/Popover/Popover.jsx +6 -6
  99. package/components/Resizable/Resizable.d.ts +1 -1
  100. package/components/Resizable/Resizable.jsx +4 -4
  101. package/components/ScrollArea/ScrollArea.d.ts +1 -1
  102. package/components/ScrollArea/ScrollArea.jsx +11 -11
  103. package/components/Select/Select.d.ts +1 -1
  104. package/components/Select/Select.jsx +21 -21
  105. package/components/Skeleton/Skeleton.d.ts +1 -1
  106. package/components/StarBorder/StarBorder.d.ts +1 -2
  107. package/components/StarBorder/StarBorder.jsx +1 -1
  108. package/components/Switch/Switch.d.ts +2 -2
  109. package/components/Switch/Switch.jsx +9 -9
  110. package/components/Table/DataTable.d.ts +1 -1
  111. package/components/Table/DataTable.jsx +54 -54
  112. package/components/Table/Table.d.ts +1 -1
  113. package/components/Table/Table.jsx +7 -7
  114. package/components/Table/TableActionButton.d.ts +2 -2
  115. package/components/Table/TableActionButton.jsx +3 -3
  116. package/components/Table/TableBody.d.ts +1 -1
  117. package/components/Table/TableBody.jsx +4 -4
  118. package/components/Table/TableCell.d.ts +1 -1
  119. package/components/Table/TableCell.jsx +4 -4
  120. package/components/Table/TableFooter.d.ts +1 -1
  121. package/components/Table/TableFooter.jsx +2 -2
  122. package/components/Table/TableHead.d.ts +1 -1
  123. package/components/Table/TableHead.jsx +4 -4
  124. package/components/Table/TableHeader.d.ts +1 -1
  125. package/components/Table/TableHeader.jsx +10 -10
  126. package/components/Table/TableRow.d.ts +1 -1
  127. package/components/Table/TableRow.jsx +2 -2
  128. package/components/Tabs/Tabs.d.ts +2 -2
  129. package/components/Tabs/Tabs.jsx +6 -6
  130. package/components/TabsSwitcher/Tab.d.ts +1 -1
  131. package/components/TabsSwitcher/TabsSwitcher.d.ts +1 -1
  132. package/components/Text/Text.d.ts +1 -1
  133. package/components/Text/Text.jsx +1 -0
  134. package/components/Textarea/Textarea.d.ts +2 -2
  135. package/components/Textarea/Textarea.jsx +1 -1
  136. package/components/Tooltip/Tooltip.d.ts +1 -1
  137. package/components/Tooltip/Tooltip.jsx +12 -12
  138. package/components/VisibilityActivatedButton/VisibilityActivatedButton.d.ts +1 -1
  139. package/form.d.ts +4 -4
  140. package/form2.d.ts +1 -1
  141. package/form2.jsx +1 -0
  142. package/hooks/useDebounceEffect.d.ts +1 -1
  143. package/hooks/useDebouncedValue.d.ts +1 -1
  144. package/hooks/useDebouncedValue.js +1 -1
  145. package/hooks/useLagRadar.jsx +19 -19
  146. package/package.json +1 -2
  147. package/tsconfig.tsbuildinfo +1 -1
  148. package/types.d.ts +1 -1
  149. package/types.js +1 -1
  150. package/utils/UseState.d.ts +2 -3
  151. package/utils/csvBlobToJson.d.ts +1 -1
  152. package/utils/csvBlobToJson.js +0 -1
  153. package/utils/ms.d.ts +1 -1
  154. package/utils/ms.js +6 -6
  155. package/utils/recursiveChildrenMap.d.ts +1 -1
  156. package/utils/smoothScrollToHref.d.ts +1 -1
  157. package/utils/smoothScrollToHref.js +7 -3
  158. package/utils/stopPropagation.d.ts +1 -1
  159. package/utils/xlsxBlobToJson.d.ts +1 -1
  160. package/utils/xlsxBlobToJson.js +3 -0
package/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Dispatch, SetStateAction, useState } from "react";
1
+ import { type Dispatch, type SetStateAction, useState } from "react";
2
2
  export type NoUndefinedState<T> = T extends [
3
3
  infer S | undefined,
4
4
  Dispatch<SetStateAction<infer S | undefined>>
package/types.js CHANGED
@@ -1 +1 @@
1
- export {};
1
+ import { useState } from "react";
@@ -1,3 +1,2 @@
1
- import { Dispatch, SetStateAction } from "react";
2
- type UseState<S> = [S, Dispatch<SetStateAction<S>>];
3
- export default UseState;
1
+ import type { Dispatch, SetStateAction } from "react";
2
+ export type UseState<S> = [S, Dispatch<SetStateAction<S>>];
@@ -1,2 +1,2 @@
1
- import { ChangeEvent } from "react";
1
+ import type { ChangeEvent } from "react";
2
2
  export default function csvBlobToJson(event: ChangeEvent<HTMLInputElement>, encoding: "windows-1252" | "utf8"): Promise<Record<string, string>[] | null>;
@@ -7,7 +7,6 @@ export default async function csvBlobToJson(event, encoding) {
7
7
  message: "Nenhum arquivo foi selecionado",
8
8
  });
9
9
  }
10
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
11
10
  const csv = await blobToText(event.target.files[0], encoding);
12
11
  event.target.value = "";
13
12
  const rows = csv.trim().split("\r\n");
package/utils/ms.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { StringValue } from "ms";
1
+ import { type StringValue } from "ms";
2
2
  export declare function ms(value: number, options?: {
3
3
  long: boolean;
4
4
  locale?: string;
package/utils/ms.js CHANGED
@@ -1,4 +1,4 @@
1
- import vms from "ms";
1
+ import vms, {} from "ms";
2
2
  const locale = {
3
3
  ["en"]: {
4
4
  day: "day",
@@ -20,12 +20,12 @@ const locale = {
20
20
  },
21
21
  };
22
22
  export function ms(value, options) {
23
- if (typeof value === "number") {
23
+ if (typeof value === "number" && options?.locale) {
24
24
  return vms(value, options)
25
- .replace("day", locale[String(options?.locale)].day)
26
- .replace("hour", locale[String(options?.locale)].hour)
27
- .replace("minute", locale[String(options?.locale)].minute)
28
- .replace("second", locale[String(options?.locale)].second);
25
+ .replace("day", locale[String(options.locale)].day)
26
+ .replace("hour", locale[String(options.locale)].hour)
27
+ .replace("minute", locale[String(options.locale)].minute)
28
+ .replace("second", locale[String(options.locale)].second);
29
29
  }
30
30
  return vms(value);
31
31
  }
@@ -1,2 +1,2 @@
1
- import { ReactElement, ReactNode } from "react";
1
+ import { type ReactElement, type ReactNode } from "react";
2
2
  export default function recursiveChildrenMap<P>(children: ReactNode, fn: (child: ReactElement<P>) => ReactElement<P>): ReactNode;
@@ -1,2 +1,2 @@
1
- import { MouseEvent } from "react";
1
+ import type { MouseEvent } from "react";
2
2
  export default function smoothScrollToHref(event: MouseEvent): void;
@@ -2,9 +2,13 @@ export default function smoothScrollToHref(event) {
2
2
  event.preventDefault();
3
3
  const href = event.currentTarget.getAttribute("href");
4
4
  if (href) {
5
- const target = document.getElementById(href.split("#")[1]);
6
- if (target) {
7
- target.scrollIntoView({ behavior: "smooth" });
5
+ const targetId = href.split("#")[1];
6
+ if (!targetId)
7
+ return;
8
+ const target = document.getElementById(targetId);
9
+ if (!target) {
10
+ return;
8
11
  }
12
+ target.scrollIntoView({ behavior: "smooth" });
9
13
  }
10
14
  }
@@ -1,2 +1,2 @@
1
- import { MouseEvent, TouchEvent } from "react";
1
+ import type { MouseEvent, TouchEvent } from "react";
2
2
  export default function stopPropagation(event: MouseEvent | TouchEvent): void;
@@ -1,2 +1,2 @@
1
- import { ChangeEvent } from "react";
1
+ import type { ChangeEvent } from "react";
2
2
  export default function xlsxBlobToJson(event: ChangeEvent<HTMLInputElement>): Promise<Record<string, string>[] | null | undefined>;
@@ -14,6 +14,9 @@ export default async function xlsxBlobToJson(event) {
14
14
  await workbook.xlsx.load(data); // Load the workbook from the array buffer
15
15
  // Assuming the data is in the first sheet
16
16
  const worksheet = workbook.worksheets[0]; // Get the first worksheet
17
+ if (!worksheet) {
18
+ return null;
19
+ }
17
20
  const jsonData = [];
18
21
  // Convert the worksheet to JSON
19
22
  worksheet.eachRow((row) => {