@majapisoftwares/ui 4.1.17 → 4.3.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 (165) 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 +10 -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 +5 -4
  60. package/components/Input/MultiSelectInput.jsx +41 -21
  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/SelectInput.d.ts +12 -0
  66. package/components/Input/SelectInput.jsx +25 -0
  67. package/components/Input/UnstyledInput.d.ts +1 -1
  68. package/components/Input/UnstyledInput.jsx +12 -12
  69. package/components/Input/useInputRefValue.d.ts +11 -0
  70. package/components/Input/useInputRefValue.jsx +51 -0
  71. package/components/Input2/InputWrapper.d.ts +1 -1
  72. package/components/Input2/InputWrapper.jsx +7 -7
  73. package/components/Link/Link.d.ts +1 -1
  74. package/components/Magnet/Magnet.d.ts +1 -1
  75. package/components/Markdown/Markdown.d.ts +1 -1
  76. package/components/Markdown/Markdown.jsx +1 -1
  77. package/components/Menu/Menu.d.ts +3 -3
  78. package/components/Menu/Menu.jsx +19 -19
  79. package/components/Modal/Modal.d.ts +1 -1
  80. package/components/Modal/Modal.jsx +26 -26
  81. package/components/ModeToggle/ModeToggle.d.ts +1 -1
  82. package/components/ModeToggle/ModeToggle.jsx +3 -3
  83. package/components/MultiSelect/MultiSelect.d.ts +2 -2
  84. package/components/MultiSelect/MultiSelect.jsx +2 -2
  85. package/components/MultiSelect/MultiSelectInput.d.ts +1 -1
  86. package/components/MultiText/MultiText.d.ts +1 -1
  87. package/components/MultiText/MultiText.jsx +0 -1
  88. package/components/NavigationDrawer/NavigationDrawer.d.ts +1 -1
  89. package/components/NavigationDrawer/NavigationDrawer.jsx +11 -11
  90. package/components/NavigationDrawer/NavigationItem.d.ts +1 -1
  91. package/components/NavigationDrawer/NavigationItem.jsx +2 -2
  92. package/components/NoSsr/NoSsr.d.ts +1 -1
  93. package/components/Notifications/Notifications.jsx +29 -29
  94. package/components/Notifications/notifications.state.d.ts +2 -2
  95. package/components/Notifications/notifications.state.js +1 -1
  96. package/components/Pagination/Pagination.jsx +15 -15
  97. package/components/Particles/Particles.jsx +55 -55
  98. package/components/PictureCropInput/PictureCropInput.d.ts +2 -2
  99. package/components/PictureCropInput/PictureCropInput.jsx +39 -39
  100. package/components/PictureCropInput/canvasPreview.d.ts +1 -1
  101. package/components/Popover/Popover.d.ts +1 -1
  102. package/components/Popover/Popover.jsx +6 -6
  103. package/components/Resizable/Resizable.d.ts +1 -1
  104. package/components/Resizable/Resizable.jsx +4 -4
  105. package/components/ScrollArea/ScrollArea.d.ts +1 -1
  106. package/components/ScrollArea/ScrollArea.jsx +11 -11
  107. package/components/Select/Select.d.ts +3 -2
  108. package/components/Select/Select.jsx +22 -22
  109. package/components/Skeleton/Skeleton.d.ts +1 -1
  110. package/components/StarBorder/StarBorder.d.ts +1 -2
  111. package/components/StarBorder/StarBorder.jsx +1 -1
  112. package/components/Switch/Switch.d.ts +2 -2
  113. package/components/Switch/Switch.jsx +9 -9
  114. package/components/Table/DataTable.d.ts +1 -1
  115. package/components/Table/DataTable.jsx +54 -54
  116. package/components/Table/Table.d.ts +1 -1
  117. package/components/Table/Table.jsx +7 -7
  118. package/components/Table/TableActionButton.d.ts +2 -2
  119. package/components/Table/TableActionButton.jsx +3 -3
  120. package/components/Table/TableBody.d.ts +1 -1
  121. package/components/Table/TableBody.jsx +4 -4
  122. package/components/Table/TableCell.d.ts +1 -1
  123. package/components/Table/TableCell.jsx +4 -4
  124. package/components/Table/TableFooter.d.ts +1 -1
  125. package/components/Table/TableFooter.jsx +2 -2
  126. package/components/Table/TableHead.d.ts +1 -1
  127. package/components/Table/TableHead.jsx +4 -4
  128. package/components/Table/TableHeader.d.ts +1 -1
  129. package/components/Table/TableHeader.jsx +10 -10
  130. package/components/Table/TableRow.d.ts +1 -1
  131. package/components/Table/TableRow.jsx +2 -2
  132. package/components/Tabs/Tabs.d.ts +2 -2
  133. package/components/Tabs/Tabs.jsx +6 -6
  134. package/components/TabsSwitcher/Tab.d.ts +1 -1
  135. package/components/TabsSwitcher/TabsSwitcher.d.ts +1 -1
  136. package/components/Text/Text.d.ts +1 -1
  137. package/components/Text/Text.jsx +1 -0
  138. package/components/Textarea/Textarea.d.ts +2 -2
  139. package/components/Textarea/Textarea.jsx +1 -1
  140. package/components/Tooltip/Tooltip.d.ts +1 -1
  141. package/components/Tooltip/Tooltip.jsx +12 -12
  142. package/components/VisibilityActivatedButton/VisibilityActivatedButton.d.ts +1 -1
  143. package/form.d.ts +4 -4
  144. package/form2.d.ts +1 -1
  145. package/form2.jsx +1 -0
  146. package/hooks/useDebounceEffect.d.ts +1 -1
  147. package/hooks/useDebouncedValue.d.ts +1 -1
  148. package/hooks/useDebouncedValue.js +1 -1
  149. package/hooks/useLagRadar.jsx +19 -19
  150. package/package.json +1 -2
  151. package/tsconfig.tsbuildinfo +1 -1
  152. package/types.d.ts +1 -1
  153. package/types.js +1 -1
  154. package/utils/UseState.d.ts +2 -3
  155. package/utils/csvBlobToJson.d.ts +1 -1
  156. package/utils/csvBlobToJson.js +0 -1
  157. package/utils/ms.d.ts +1 -1
  158. package/utils/ms.js +6 -6
  159. package/utils/preventDefault.d.ts +2 -1
  160. package/utils/recursiveChildrenMap.d.ts +1 -1
  161. package/utils/smoothScrollToHref.d.ts +1 -1
  162. package/utils/smoothScrollToHref.js +7 -3
  163. package/utils/stopPropagation.d.ts +2 -2
  164. package/utils/xlsxBlobToJson.d.ts +1 -1
  165. package/utils/xlsxBlobToJson.js +3 -0
@@ -18,7 +18,7 @@ export default function NavigationItem({ icon, children, href, exact, alternativ
18
18
  return (<Button variant={active ? "light" : "text"} color={active ? "primary" : "default"} className={clsx("w-full justify-start border-transparent", className)} leading={icon &&
19
19
  cloneElement(icon, {
20
20
  className: clsx(icon.props?.className, "w-5! mr-3"),
21
- })} href={href} onClick={isMobile ? navigationDrawerState.close : undefined} disabled={disabled}>
22
- {children}
21
+ })} href={href} onClick={isMobile ? navigationDrawerState.close : undefined} disabled={disabled}>
22
+ {children}
23
23
  </Button>);
24
24
  }
@@ -1,4 +1,4 @@
1
- import React, { ReactNode } from "react";
1
+ import React, { type ReactNode } from "react";
2
2
  export default function NoSsr({ children }: {
3
3
  children: ReactNode;
4
4
  }): React.JSX.Element | null;
@@ -4,7 +4,7 @@ import notificationsState from "./notifications.state";
4
4
  import { CheckCircleIcon, ExclamationCircleIcon, } from "@heroicons/react/24/outline";
5
5
  import { XMarkIcon } from "@heroicons/react/20/solid";
6
6
  import Button from "../Button";
7
- import { cloneElement, useEffect } from "react";
7
+ import { cloneElement, useEffect, } from "react";
8
8
  import clsx from "../../utils/clsx";
9
9
  export default function Notifications({ notificationClassName, }) {
10
10
  const { notifications, remove, setRendered } = useSnapshot(notificationsState);
@@ -14,8 +14,8 @@ export default function Notifications({ notificationClassName, }) {
14
14
  setRendered(false);
15
15
  };
16
16
  }, [setRendered]);
17
- return (<ul id="ui-notifications" className="pointer-events-none fixed inset-0 z-30 flex flex-col items-center justify-end gap-3 px-4 py-6 sm:items-end sm:justify-start sm:p-6">
18
- <AnimatePresence initial={false}>
17
+ return (<ul id="ui-notifications" className="pointer-events-none fixed inset-0 z-30 flex flex-col items-center justify-end gap-3 px-4 py-6 sm:items-end sm:justify-start sm:p-6">
18
+ <AnimatePresence initial={false}>
19
19
  {notifications.map(({ _id, dismissable, title, message, icon, actions, style, className, }) => {
20
20
  const iconChild = (typeof icon === "string"
21
21
  ? {
@@ -24,37 +24,37 @@ export default function Notifications({ notificationClassName, }) {
24
24
  }[icon]
25
25
  : icon);
26
26
  // noinspection SuspiciousTypeOfGuard
27
- return (<motion.li key={_id} layout initial={{ opacity: 0, y: 50, scale: 0.3 }} animate={{ opacity: 1, y: 0, scale: 1 }} exit={{ opacity: 0, scale: 0.5, transition: { duration: 0.2 } }} className={clsx("pointer-events-auto w-full max-w-sm overflow-hidden rounded-lg bg-white shadow-lg ring-1 ring-black/5 dark:bg-zinc-800 dark:ring-white/10", notificationClassName, className)} style={style}>
28
- <div className="p-4">
29
- <div className="flex items-start">
30
- {iconChild && (<div className="mr-2 shrink-0">
27
+ return (<motion.li key={_id} layout initial={{ opacity: 0, y: 50, scale: 0.3 }} animate={{ opacity: 1, y: 0, scale: 1 }} exit={{ opacity: 0, scale: 0.5, transition: { duration: 0.2 } }} className={clsx("pointer-events-auto w-full max-w-sm overflow-hidden rounded-lg bg-white shadow-lg ring-1 ring-black/5 dark:bg-zinc-800 dark:ring-white/10", notificationClassName, className)} style={style}>
28
+ <div className="p-4">
29
+ <div className="flex items-start">
30
+ {iconChild && (<div className="mr-2 shrink-0">
31
31
  {cloneElement(iconChild, {
32
32
  className: clsx("h-6 w-6 text-zinc-400 dark:text-zinc-600", iconChild.props?.className),
33
33
  "aria-hidden": "true",
34
- })}
35
- </div>)}
36
- <div className="ml-1 w-0 flex-1 pt-0.5">
37
- <p className="text-sm font-medium text-zinc-900 dark:text-zinc-100">
38
- {title || message}
39
- </p>
40
- {title && message && (<p className="mt-1 text-sm text-zinc-500 dark:text-zinc-400">
41
- {message}
42
- </p>)}
43
- {actions && (<div className="-m-3 mt-0 flex">
44
- {actions}
45
- </div>)}
46
- </div>
47
- {dismissable && (<div className="ml-4 flex shrink-0">
34
+ })}
35
+ </div>)}
36
+ <div className="ml-1 w-0 flex-1 pt-0.5">
37
+ <p className="text-sm font-medium text-zinc-900 dark:text-zinc-100">
38
+ {title || message}
39
+ </p>
40
+ {title && message && (<p className="mt-1 text-sm text-zinc-500 dark:text-zinc-400">
41
+ {message}
42
+ </p>)}
43
+ {actions && (<div className="-m-3 mt-0 flex">
44
+ {actions}
45
+ </div>)}
46
+ </div>
47
+ {dismissable && (<div className="ml-4 flex shrink-0">
48
48
  <Button icon onClick={() => {
49
49
  remove(_id);
50
- }} className="h-5 w-5 p-0!" variant="text">
51
- <XMarkIcon className="h-5 w-5 text-zinc-400" aria-label="Close"/>
52
- </Button>
53
- </div>)}
54
- </div>
55
- </div>
50
+ }} className="h-5 w-5 p-0!" variant="text">
51
+ <XMarkIcon className="h-5 w-5 text-zinc-400" aria-label="Close"/>
52
+ </Button>
53
+ </div>)}
54
+ </div>
55
+ </div>
56
56
  </motion.li>);
57
- })}
58
- </AnimatePresence>
57
+ })}
58
+ </AnimatePresence>
59
59
  </ul>);
60
60
  }
@@ -1,5 +1,5 @@
1
- import { StringValue } from "ms";
2
- import { CSSProperties, ReactElement, ReactNode } from "react";
1
+ import { type StringValue } from "ms";
2
+ import type { CSSProperties, ReactElement, ReactNode } from "react";
3
3
  type Notification = {
4
4
  _id: string;
5
5
  message: string | ReactElement;
@@ -1,6 +1,6 @@
1
1
  import { proxy, ref } from "valtio";
2
2
  import isomorphicObjectId from "@majapisoftwares/next/utils/isomorphicObjectId";
3
- import ms from "ms";
3
+ import ms, {} from "ms";
4
4
  const notificationsState = proxy({
5
5
  rendered: false,
6
6
  setRendered(rendered) {
@@ -1,5 +1,5 @@
1
1
  import { ChevronLeftIcon, ChevronRightIcon } from "@heroicons/react/20/solid";
2
- import { useCallback, useEffect, useMemo, useState } from "react";
2
+ import { useCallback, useEffect, useMemo, useState, } from "react";
3
3
  import clsx from "../../utils/clsx";
4
4
  import { range } from "lodash-es";
5
5
  import UnstyledButton from "../Button/UnstyledButton";
@@ -46,19 +46,19 @@ export default function Pagination({ totalItems, itemsPerPage, currentPage, onCh
46
46
  e.preventDefault();
47
47
  setPage(page);
48
48
  }, []);
49
- return (<nav className={clsx("ui-pagination", className)} aria-label={paginationText}>
50
- <UnstyledButton disabled={page === 1} onClick={handlePageClick(page - 1)} href={page !== 1 && pageHref ? pageHref(page - 1) : undefined}>
51
- <span className="sr-only">{previousText}</span>
52
- <ChevronLeftIcon className="h-5 w-5" aria-hidden="true"/>
53
- </UnstyledButton>
54
- {pages.map((p) => typeof p === "number" ? (<UnstyledButton key={p} onClick={handlePageClick(p)} data-active={page === p ? "" : undefined} href={pageHref ? pageHref(p) : undefined}>
55
- {p}
56
- </UnstyledButton>) : (<button key={p} disabled>
57
- ...
58
- </button>))}
59
- <UnstyledButton disabled={page === pageCount} onClick={handlePageClick(page + 1)} href={page !== pageCount && pageHref ? pageHref(page + 1) : undefined}>
60
- <span className="sr-only">{nextText}</span>
61
- <ChevronRightIcon className="h-5 w-5" aria-hidden="true"/>
62
- </UnstyledButton>
49
+ return (<nav className={clsx("ui-pagination", className)} aria-label={paginationText}>
50
+ <UnstyledButton disabled={page === 1} onClick={handlePageClick(page - 1)} href={page !== 1 && pageHref ? pageHref(page - 1) : undefined}>
51
+ <span className="sr-only">{previousText}</span>
52
+ <ChevronLeftIcon className="h-5 w-5" aria-hidden="true"/>
53
+ </UnstyledButton>
54
+ {pages.map((p) => typeof p === "number" ? (<UnstyledButton key={p} onClick={handlePageClick(p)} data-active={page === p ? "" : undefined} href={pageHref ? pageHref(p) : undefined}>
55
+ {p}
56
+ </UnstyledButton>) : (<button key={p} disabled>
57
+ ...
58
+ </button>))}
59
+ <UnstyledButton disabled={page === pageCount} onClick={handlePageClick(page + 1)} href={page !== pageCount && pageHref ? pageHref(page + 1) : undefined}>
60
+ <span className="sr-only">{nextText}</span>
61
+ <ChevronRightIcon className="h-5 w-5" aria-hidden="true"/>
62
+ </UnstyledButton>
63
63
  </nav>);
64
64
  }
@@ -15,62 +15,62 @@ const hexToRgb = (hex) => {
15
15
  const b = (int & 255) / 255;
16
16
  return [r, g, b];
17
17
  };
18
- const vertex = /* glsl */ `
19
- attribute vec3 position;
20
- attribute vec4 random;
21
- attribute vec3 color;
22
-
23
- uniform mat4 modelMatrix;
24
- uniform mat4 viewMatrix;
25
- uniform mat4 projectionMatrix;
26
- uniform float uTime;
27
- uniform float uSpread;
28
- uniform float uBaseSize;
29
- uniform float uSizeRandomness;
30
-
31
- varying vec4 vRandom;
32
- varying vec3 vColor;
33
-
34
- void main() {
35
- vRandom = random;
36
- vColor = color;
37
-
38
- vec3 pos = position * uSpread;
39
- pos.z *= 10.0;
40
-
41
- vec4 mPos = modelMatrix * vec4(pos, 1.0);
42
- float t = uTime;
43
- mPos.x += sin(t * random.z + 6.28 * random.w) * mix(0.1, 1.5, random.x);
44
- mPos.y += sin(t * random.y + 6.28 * random.x) * mix(0.1, 1.5, random.w);
45
- mPos.z += sin(t * random.w + 6.28 * random.y) * mix(0.1, 1.5, random.z);
46
-
47
- vec4 mvPos = viewMatrix * mPos;
48
- gl_PointSize = (uBaseSize * (1.0 + uSizeRandomness * (random.x - 0.5))) / length(mvPos.xyz);
49
- gl_Position = projectionMatrix * mvPos;
50
- }
18
+ const vertex = /* glsl */ `
19
+ attribute vec3 position;
20
+ attribute vec4 random;
21
+ attribute vec3 color;
22
+
23
+ uniform mat4 modelMatrix;
24
+ uniform mat4 viewMatrix;
25
+ uniform mat4 projectionMatrix;
26
+ uniform float uTime;
27
+ uniform float uSpread;
28
+ uniform float uBaseSize;
29
+ uniform float uSizeRandomness;
30
+
31
+ varying vec4 vRandom;
32
+ varying vec3 vColor;
33
+
34
+ void main() {
35
+ vRandom = random;
36
+ vColor = color;
37
+
38
+ vec3 pos = position * uSpread;
39
+ pos.z *= 10.0;
40
+
41
+ vec4 mPos = modelMatrix * vec4(pos, 1.0);
42
+ float t = uTime;
43
+ mPos.x += sin(t * random.z + 6.28 * random.w) * mix(0.1, 1.5, random.x);
44
+ mPos.y += sin(t * random.y + 6.28 * random.x) * mix(0.1, 1.5, random.w);
45
+ mPos.z += sin(t * random.w + 6.28 * random.y) * mix(0.1, 1.5, random.z);
46
+
47
+ vec4 mvPos = viewMatrix * mPos;
48
+ gl_PointSize = (uBaseSize * (1.0 + uSizeRandomness * (random.x - 0.5))) / length(mvPos.xyz);
49
+ gl_Position = projectionMatrix * mvPos;
50
+ }
51
51
  `;
52
- const fragment = /* glsl */ `
53
- precision highp float;
54
-
55
- uniform float uTime;
56
- uniform float uAlphaParticles;
57
- varying vec4 vRandom;
58
- varying vec3 vColor;
59
-
60
- void main() {
61
- vec2 uv = gl_PointCoord.xy;
62
- float d = length(uv - vec2(0.5));
63
-
64
- if(uAlphaParticles < 0.5) {
65
- if(d > 0.5) {
66
- discard;
67
- }
68
- gl_FragColor = vec4(vColor + 0.2 * sin(uv.yxx + uTime + vRandom.y * 6.28), 1.0);
69
- } else {
70
- float circle = smoothstep(0.5, 0.4, d) * 0.8;
71
- gl_FragColor = vec4(vColor + 0.2 * sin(uv.yxx + uTime + vRandom.y * 6.28), circle);
72
- }
73
- }
52
+ const fragment = /* glsl */ `
53
+ precision highp float;
54
+
55
+ uniform float uTime;
56
+ uniform float uAlphaParticles;
57
+ varying vec4 vRandom;
58
+ varying vec3 vColor;
59
+
60
+ void main() {
61
+ vec2 uv = gl_PointCoord.xy;
62
+ float d = length(uv - vec2(0.5));
63
+
64
+ if(uAlphaParticles < 0.5) {
65
+ if(d > 0.5) {
66
+ discard;
67
+ }
68
+ gl_FragColor = vec4(vColor + 0.2 * sin(uv.yxx + uTime + vRandom.y * 6.28), 1.0);
69
+ } else {
70
+ float circle = smoothstep(0.5, 0.4, d) * 0.8;
71
+ gl_FragColor = vec4(vColor + 0.2 * sin(uv.yxx + uTime + vRandom.y * 6.28), circle);
72
+ }
73
+ }
74
74
  `;
75
75
  const Particles = ({ particleCount = 200, particleSpread = 10, speed = 0.1, particleColors, moveParticlesOnHover = false, particleHoverFactor = 1, alphaParticles = false, particleBaseSize = 100, sizeRandomness = 1, cameraDistance = 20, disableRotation = false, className, useWindowMouseMove = false, }) => {
76
76
  const containerRef = useRef(null);
@@ -1,5 +1,5 @@
1
- import { RefObject } from "react";
2
- import { PixelCrop } from "react-image-crop";
1
+ import { type RefObject } from "react";
2
+ import { type PixelCrop } from "react-image-crop";
3
3
  export type PictureCropInputRef = {
4
4
  handleCrop: () => Promise<void>;
5
5
  completedCrop: PixelCrop | undefined;
@@ -1,5 +1,5 @@
1
1
  import { useCallback, useEffect, useId, useRef, useState, } from "react";
2
- import ReactCrop from "react-image-crop";
2
+ import ReactCrop, {} from "react-image-crop";
3
3
  import useDebounceEffect from "../../hooks/useDebounceEffect";
4
4
  import { canvasPreview } from "./canvasPreview";
5
5
  import Skeleton from "../Skeleton";
@@ -103,51 +103,51 @@ export default function PictureCropInput({ value, onChange, loading, className,
103
103
  setCrop(undefined);
104
104
  setSrc(undefined);
105
105
  }, []);
106
- return (<div ref={parentRef} className={clsx("flex gap-2", className)}>
107
- {loading && <Skeleton className={previewSizeClassNames}/>}
108
- {src && (<>
109
- <ReactCrop crop={crop} onChange={(c) => setCrop(c)} onComplete={(c) => setCompletedCrop(c)} aspect={aspect} minWidth={50 * aspect} minHeight={50 * aspect} className="max-h-96 max-w-96" keepSelection>
110
- {/* eslint-disable-next-line @next/next/no-img-element */}
106
+ return (<div ref={parentRef} className={clsx("flex gap-2", className)}>
107
+ {loading && <Skeleton className={previewSizeClassNames}/>}
108
+ {src && (<>
109
+ <ReactCrop crop={crop} onChange={(c) => setCrop(c)} onComplete={(c) => setCompletedCrop(c)} aspect={aspect} minWidth={50 * aspect} minHeight={50 * aspect} className="max-h-96 max-w-96" keepSelection>
110
+ {/* eslint-disable-next-line @next/next/no-img-element */}
111
111
  <img alt="Picture" src={src}
112
112
  // className="h-96 w-96 object-contain"
113
- ref={imgRef}/>
114
- </ReactCrop>
115
- {completedCrop && (<div className={clsx("flex flex-col gap-2", previewContainerClassName)}>
113
+ ref={imgRef}/>
114
+ </ReactCrop>
115
+ {completedCrop && (<div className={clsx("flex flex-col gap-2", previewContainerClassName)}>
116
116
  <canvas ref={previewCanvasRef} className={previewSizeClassNames} style={{
117
117
  objectFit: "cover",
118
- }}/>
119
- <div className="flex gap-2">
120
- <Button onClick={handleCrop} className={clsx("w-full", cropButtonClassName)} leading={<CheckIcon />}>
121
- Crop
122
- </Button>
123
- <Tooltip content="Clear">
124
- <Button onClick={handleClear} variant="text" icon>
125
- <TrashIcon />
126
- </Button>
127
- </Tooltip>
128
- </div>
129
- </div>)}
130
- </>)}
131
- {!src && (<>
118
+ }}/>
119
+ <div className="flex gap-2">
120
+ <Button onClick={handleCrop} className={clsx("w-full", cropButtonClassName)} leading={<CheckIcon />}>
121
+ Crop
122
+ </Button>
123
+ <Tooltip content="Clear">
124
+ <Button onClick={handleClear} variant="text" icon>
125
+ <TrashIcon />
126
+ </Button>
127
+ </Tooltip>
128
+ </div>
129
+ </div>)}
130
+ </>)}
131
+ {!src && (<>
132
132
  {value && (<div className={clsx("flex shrink-0 rounded-sm", previewSizeClassNames)} style={{
133
133
  background: value
134
134
  ? `center / cover url(${value})`
135
135
  : undefined,
136
- }}/>)}
137
- <input type="file" id={id} className="hidden" onChange={onFileSelect} accept=".jpg,.jpeg,.png"/>
138
- <Button variant="outlined" className="mb-auto flex items-center gap-3 p-2" onClick={() => document.getElementById(id)?.click()}>
139
- <div className="flex h-12 w-12 items-center justify-center rounded-sm border border-zinc-800 p-3">
140
- <PhotoIcon />
141
- </div>
142
- <div className="flex flex-col items-start gap-1.5">
143
- <div className="text-gray-10 text-sm font-medium">
144
- {value ? "Change" : "Select"} picture
145
- </div>
146
- <div className="text-xs text-zinc-500">
147
- JPG, PNG - Max size 10MB
148
- </div>
149
- </div>
150
- </Button>
151
- </>)}
136
+ }}/>)}
137
+ <input type="file" id={id} className="hidden" onChange={onFileSelect} accept=".jpg,.jpeg,.png"/>
138
+ <Button variant="outlined" className="mb-auto flex items-center gap-3 p-2" onClick={() => document.getElementById(id)?.click()}>
139
+ <div className="flex h-12 w-12 items-center justify-center rounded-sm border border-zinc-800 p-3">
140
+ <PhotoIcon />
141
+ </div>
142
+ <div className="flex flex-col items-start gap-1.5">
143
+ <div className="text-gray-10 text-sm font-medium">
144
+ {value ? "Change" : "Select"} picture
145
+ </div>
146
+ <div className="text-xs text-zinc-500">
147
+ JPG, PNG - Max size 10MB
148
+ </div>
149
+ </div>
150
+ </Button>
151
+ </>)}
152
152
  </div>);
153
153
  }
@@ -1,2 +1,2 @@
1
- import { PixelCrop } from "react-image-crop";
1
+ import type { PixelCrop } from "react-image-crop";
2
2
  export declare function canvasPreview(image: HTMLImageElement, canvas: HTMLCanvasElement, crop: PixelCrop, scale?: number, rotate?: number): Promise<void>;
@@ -1,5 +1,5 @@
1
1
  import * as RPopover from "@radix-ui/react-popover";
2
- import React, { ComponentProps } from "react";
2
+ import React, { type ComponentProps } from "react";
3
3
  declare function PopoverContent({ className, sideOffset, collisionPadding, children, noArrow, ...props }: ComponentProps<typeof RPopover.Content> & {
4
4
  noArrow?: boolean;
5
5
  }): React.JSX.Element;
@@ -1,13 +1,13 @@
1
1
  import * as RPopover from "@radix-ui/react-popover";
2
- import React from "react";
2
+ import React, {} from "react";
3
3
  import clsx from "../../utils/clsx";
4
4
  import { modalArrowClassName, modalContentClassName, } from "../../styles/Modal.classNames";
5
5
  function PopoverContent({ className, sideOffset = 4, collisionPadding = 8, children, noArrow, ...props }) {
6
- return (<RPopover.Portal>
7
- <RPopover.Content {...props} className={clsx(modalContentClassName, "ui-popover-content", className)} sideOffset={sideOffset} collisionPadding={collisionPadding}>
8
- {children}
9
- {!noArrow && <PopoverArrow />}
10
- </RPopover.Content>
6
+ return (<RPopover.Portal>
7
+ <RPopover.Content {...props} className={clsx(modalContentClassName, "ui-popover-content", className)} sideOffset={sideOffset} collisionPadding={collisionPadding}>
8
+ {children}
9
+ {!noArrow && <PopoverArrow />}
10
+ </RPopover.Content>
11
11
  </RPopover.Portal>);
12
12
  }
13
13
  function PopoverArrow({ className, ...props }) {
@@ -1,4 +1,4 @@
1
- import React, { CSSProperties, ReactElement, ReactNode } from "react";
1
+ import React, { type CSSProperties, type ReactElement, type ReactNode } from "react";
2
2
  export default function Resizable({ children, minWidth, maxWidth, width, onResize, }: {
3
3
  children: ReactElement;
4
4
  minWidth?: number;
@@ -44,11 +44,11 @@ export default function Resizable({ children, minWidth, maxWidth, width, onResiz
44
44
  return cloneElement(child, {
45
45
  className: clsx("relative", child.props.className),
46
46
  style: { width: internalWidth },
47
- children: (<>
48
- <div className={clsx("absolute bottom-0 left-0 top-0 z-10 w-1 cursor-e-resize select-none transition-colors hover:bg-zinc-700", {
47
+ children: (<>
48
+ <div className={clsx("absolute top-0 bottom-0 left-0 z-10 w-1 cursor-e-resize transition-colors select-none hover:bg-zinc-700", {
49
49
  "bg-zinc-700": isResizing,
50
- })} onMouseDown={onMouseDown}/>
51
- {child.props.children}
50
+ })} onMouseDown={onMouseDown}/>
51
+ {child.props.children}
52
52
  </>),
53
53
  });
54
54
  }
@@ -1,4 +1,4 @@
1
- import { ReactNode, Ref } from "react";
1
+ import type { ReactNode, Ref } from "react";
2
2
  export default function ScrollArea({ className, children, viewportClassName, ref, viewportRef, type, }: {
3
3
  children: ReactNode;
4
4
  className?: string;
@@ -1,16 +1,16 @@
1
1
  import { ScrollArea as RScrollArea } from "radix-ui";
2
2
  import clsx from "../../utils/clsx";
3
3
  export default function ScrollArea({ className, children, viewportClassName, ref, viewportRef, type, }) {
4
- return (<RScrollArea.Root className={clsx("overflow-hidden", className)} ref={ref} type={type}>
5
- <RScrollArea.Viewport className={clsx("h-full w-full", viewportClassName)} ref={viewportRef}>
6
- {children}
7
- </RScrollArea.Viewport>
8
- <RScrollArea.Scrollbar className="flex touch-none select-none bg-zinc-700 p-0.5 transition-colors duration-[160ms] ease-out hover:bg-zinc-600 data-[orientation=horizontal]:h-2.5 data-[orientation=vertical]:w-2.5 data-[orientation=horizontal]:flex-col" orientation="vertical">
9
- <RScrollArea.Thumb className="relative flex-1 rounded-[10px] bg-zinc-500 before:absolute before:left-1/2 before:top-1/2 before:size-full before:min-h-11 before:min-w-11 before:-translate-x-1/2 before:-translate-y-1/2 hover:bg-zinc-400"/>
10
- </RScrollArea.Scrollbar>
11
- <RScrollArea.Scrollbar className="flex touch-none select-none bg-zinc-700 p-0.5 transition-colors duration-[160ms] ease-out hover:bg-zinc-600 data-[orientation=horizontal]:h-2.5 data-[orientation=vertical]:w-2.5 data-[orientation=horizontal]:flex-col" orientation="horizontal">
12
- <RScrollArea.Thumb className="relative flex-1 rounded-[10px] bg-zinc-500 before:absolute before:left-1/2 before:top-1/2 before:size-full before:min-h-[44px] before:min-w-[44px] before:-translate-x-1/2 before:-translate-y-1/2"/>
13
- </RScrollArea.Scrollbar>
14
- <RScrollArea.Corner className="bg-zinc-600"/>
4
+ return (<RScrollArea.Root className={clsx("overflow-hidden", className)} ref={ref} type={type}>
5
+ <RScrollArea.Viewport className={clsx("h-full w-full", viewportClassName)} ref={viewportRef}>
6
+ {children}
7
+ </RScrollArea.Viewport>
8
+ <RScrollArea.Scrollbar className="flex touch-none bg-zinc-700 p-0.5 transition-colors duration-[160ms] ease-out select-none hover:bg-zinc-600 data-[orientation=horizontal]:h-2.5 data-[orientation=horizontal]:flex-col data-[orientation=vertical]:w-2.5" orientation="vertical">
9
+ <RScrollArea.Thumb className="relative flex-1 rounded-[10px] bg-zinc-500 before:absolute before:top-1/2 before:left-1/2 before:size-full before:min-h-11 before:min-w-11 before:-translate-x-1/2 before:-translate-y-1/2 hover:bg-zinc-400"/>
10
+ </RScrollArea.Scrollbar>
11
+ <RScrollArea.Scrollbar className="flex touch-none bg-zinc-700 p-0.5 transition-colors duration-[160ms] ease-out select-none hover:bg-zinc-600 data-[orientation=horizontal]:h-2.5 data-[orientation=horizontal]:flex-col data-[orientation=vertical]:w-2.5" orientation="horizontal">
12
+ <RScrollArea.Thumb className="relative flex-1 rounded-[10px] bg-zinc-500 before:absolute before:top-1/2 before:left-1/2 before:size-full before:min-h-[44px] before:min-w-[44px] before:-translate-x-1/2 before:-translate-y-1/2"/>
13
+ </RScrollArea.Scrollbar>
14
+ <RScrollArea.Corner className="bg-zinc-600"/>
15
15
  </RScrollArea.Root>);
16
16
  }
@@ -1,4 +1,4 @@
1
- import { ComponentProps } from "react";
1
+ import type { ComponentProps } from "react";
2
2
  import * as RSelect from "@radix-ui/react-select";
3
3
  import Button from "../Button";
4
4
  declare function SelectContent({ className, children, ...props }: ComponentProps<typeof RSelect.Content>): import("react").JSX.Element;
@@ -6,8 +6,9 @@ declare function SelectSeparator({ className, ...props }: ComponentProps<typeof
6
6
  declare function SelectItem({ children, className, indicatorClassName, ...props }: ComponentProps<typeof RSelect.Item> & {
7
7
  indicatorClassName?: string;
8
8
  }): import("react").JSX.Element;
9
- declare function SelectTrigger({ className, placeholder, children, readOnly, ref, ...props }: ComponentProps<typeof RSelect.Trigger> & ComponentProps<typeof Button> & {
9
+ declare function SelectTrigger({ className, placeholder, children, readOnly, ref, buttonClassName, ...props }: ComponentProps<typeof RSelect.Trigger> & ComponentProps<typeof Button> & {
10
10
  placeholder?: string;
11
+ buttonClassName?: string;
11
12
  }): import("react").JSX.Element;
12
13
  declare function SelectLabel({ className, ...props }: ComponentProps<typeof RSelect.Label>): import("react").JSX.Element;
13
14
  declare const Select: {
@@ -6,36 +6,36 @@ import { dropdownItemClassName, dropdownItemIndicatorClassName, dropdownLabelCla
6
6
  import { modalContentClassName } from "../../styles/Modal.classNames";
7
7
  const selectScrollButtonClassName = clsx("ui-select-scroll-button", "flex h-6 cursor-default items-center justify-center", "bg-white", "dark:bg-zinc-900", "[&>svg]:w-4 [&>svg]:h-4");
8
8
  function SelectContent({ className, children, ...props }) {
9
- return (<RSelect.Portal>
10
- <RSelect.Content {...props} className={clsx(modalContentClassName, "ui-select-content -ml-[6px]", className)}>
11
- <RSelect.ScrollUpButton className={selectScrollButtonClassName}>
12
- <ChevronUpIcon />
13
- </RSelect.ScrollUpButton>
14
- <RSelect.Viewport>{children}</RSelect.Viewport>
15
- <RSelect.ScrollDownButton className={selectScrollButtonClassName}>
16
- <ChevronDownIcon />
17
- </RSelect.ScrollDownButton>
18
- </RSelect.Content>
9
+ return (<RSelect.Portal>
10
+ <RSelect.Content {...props} className={clsx(modalContentClassName, "ui-select-content -ml-[6px]", className)}>
11
+ <RSelect.ScrollUpButton className={selectScrollButtonClassName}>
12
+ <ChevronUpIcon />
13
+ </RSelect.ScrollUpButton>
14
+ <RSelect.Viewport>{children}</RSelect.Viewport>
15
+ <RSelect.ScrollDownButton className={selectScrollButtonClassName}>
16
+ <ChevronDownIcon />
17
+ </RSelect.ScrollDownButton>
18
+ </RSelect.Content>
19
19
  </RSelect.Portal>);
20
20
  }
21
21
  function SelectSeparator({ className, ...props }) {
22
22
  return (<RSelect.Separator {...props} className={clsx(dropdownSeparatorClassName, "ui-select-separator", className)}/>);
23
23
  }
24
24
  function SelectItem({ children, className, indicatorClassName, ...props }) {
25
- return (<RSelect.Item className={clsx(dropdownItemClassName, "ui-select-item", className)} {...props}>
26
- <RSelect.ItemIndicator className={clsx(dropdownItemIndicatorClassName, "ui-select-item-indicator", indicatorClassName)}>
27
- <CheckIcon />
28
- </RSelect.ItemIndicator>
29
- <RSelect.ItemText>{children}</RSelect.ItemText>
25
+ return (<RSelect.Item className={clsx(dropdownItemClassName, "ui-select-item", className)} {...props}>
26
+ <RSelect.ItemIndicator className={clsx(dropdownItemIndicatorClassName, "ui-select-item-indicator", indicatorClassName)}>
27
+ <CheckIcon />
28
+ </RSelect.ItemIndicator>
29
+ <RSelect.ItemText>{children}</RSelect.ItemText>
30
30
  </RSelect.Item>);
31
31
  }
32
- function SelectTrigger({ className, placeholder, children, readOnly, ref, ...props }) {
33
- return (<RSelect.Trigger asChild {...props} className={className} ref={children ? ref : undefined}>
34
- {children || (<Button trailing={!readOnly ? (<RSelect.Icon>
35
- <ChevronDownIcon />
36
- </RSelect.Icon>) : undefined} ref={ref} disabled={readOnly} className="opacity-100">
37
- <RSelect.Value placeholder={placeholder}/>
38
- </Button>)}
32
+ function SelectTrigger({ className, placeholder, children, readOnly, ref, buttonClassName, ...props }) {
33
+ return (<RSelect.Trigger asChild {...props} className={clsx("data-[placeholder]:text-zinc-500", className)} ref={children ? ref : undefined}>
34
+ {children || (<Button trailing={!readOnly ? (<RSelect.Icon>
35
+ <ChevronDownIcon />
36
+ </RSelect.Icon>) : undefined} ref={ref} disabled={readOnly} className={clsx("rounded-md opacity-100", buttonClassName)}>
37
+ <RSelect.Value placeholder={placeholder}/>
38
+ </Button>)}
39
39
  </RSelect.Trigger>);
40
40
  }
41
41
  function SelectLabel({ className, ...props }) {
@@ -1,2 +1,2 @@
1
- import { DetailedHTMLProps, HTMLAttributes } from "react";
1
+ import type { DetailedHTMLProps, HTMLAttributes } from "react";
2
2
  export default function Skeleton({ className, ...props }: DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>): import("react").JSX.Element;
@@ -1,4 +1,3 @@
1
- import React from "react";
2
1
  export type StarBorderProps<T extends React.ElementType> = React.ComponentPropsWithoutRef<T> & {
3
2
  as?: T;
4
3
  className?: string;
@@ -7,5 +6,5 @@ export type StarBorderProps<T extends React.ElementType> = React.ComponentPropsW
7
6
  speed?: React.CSSProperties["animationDuration"];
8
7
  innerClassName?: string;
9
8
  };
10
- declare const StarBorder: <T extends React.ElementType = "button">({ as, className, color, speed, children, innerClassName, ...rest }: StarBorderProps<T>) => React.JSX.Element;
9
+ declare const StarBorder: <T extends React.ElementType = "button">({ as, className, color, speed, children, innerClassName, ...rest }: StarBorderProps<T>) => import("react").JSX.Element;
11
10
  export default StarBorder;
@@ -1,4 +1,4 @@
1
- import React from "react";
1
+ import {} from "react";
2
2
  import clsx from "../../utils/clsx";
3
3
  const StarBorder = ({ as, className = "", color = "white", speed = "6s", children, innerClassName, ...rest }) => {
4
4
  const Component = (as || "button");
@@ -1,5 +1,5 @@
1
- import { ReactNode } from "react";
2
- import { UnstyledInputCommonProps } from "../Input";
1
+ import type { ReactNode } from "react";
2
+ import { type UnstyledInputCommonProps } from "../Input";
3
3
  export interface SwitchProps {
4
4
  srLabel?: string;
5
5
  checked?: boolean;