@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
@@ -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,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
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>)}
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>)}
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;
@@ -1,20 +1,20 @@
1
1
  import { Switch as RSwitch } from "radix-ui";
2
2
  import clsx from "../../utils/clsx";
3
- import Input from "../Input";
3
+ import Input, {} from "../Input";
4
4
  export default function Switch({ srLabel, checked, onChange, className, rightLabel, readOnly, switchClassName, pointerClassName, disabled, }) {
5
- return (<div className={clsx(className, "flex items-center")}>
5
+ return (<div className={clsx(className, "flex items-center")}>
6
6
  <RSwitch.Root checked={checked} onCheckedChange={onChange} className={clsx({
7
7
  "bg-primary-600": checked,
8
8
  "bg-zinc-300 dark:bg-zinc-600": !checked,
9
9
  "cursor-pointer": !readOnly && !disabled,
10
10
  "cursor-not-allowed": disabled,
11
- }, "focus:ring-primary-500 relative inline-flex h-6 w-11 shrink-0 rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:ring-2 focus:ring-offset-2 focus:outline-hidden dark:ring-offset-zinc-900", switchClassName)} disabled={readOnly || disabled}>
12
- {srLabel && <span className="sr-only">{srLabel}</span>}
13
- <RSwitch.Thumb aria-hidden="true" className={clsx("pointer-events-none inline-block h-5 w-5 translate-x-0 transform rounded-full bg-white shadow-sm ring-0 transition duration-200 ease-in-out data-[state=checked]:translate-x-5", pointerClassName)}/>
14
- </RSwitch.Root>
15
- {rightLabel && (<span className="ml-3 text-sm text-zinc-500 dark:text-zinc-300">
16
- {rightLabel}
17
- </span>)}
11
+ }, "focus:ring-primary-500 relative inline-flex h-6 w-11 shrink-0 rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:ring-2 focus:ring-offset-2 focus:outline-hidden dark:ring-offset-zinc-900", switchClassName)} disabled={readOnly || disabled}>
12
+ {srLabel && <span className="sr-only">{srLabel}</span>}
13
+ <RSwitch.Thumb aria-hidden="true" className={clsx("pointer-events-none inline-block h-5 w-5 translate-x-0 transform rounded-full bg-white shadow-sm ring-0 transition duration-200 ease-in-out data-[state=checked]:translate-x-5", pointerClassName)}/>
14
+ </RSwitch.Root>
15
+ {rightLabel && (<span className="ml-3 text-sm text-zinc-500 dark:text-zinc-300">
16
+ {rightLabel}
17
+ </span>)}
18
18
  </div>);
19
19
  }
20
20
  export function SwitchInput({ inputClassName, checked, ...props }) {
@@ -1,4 +1,4 @@
1
- import { ComponentType, ReactElement, ReactNode } from "react";
1
+ import { type ComponentType, type ReactElement, type ReactNode } from "react";
2
2
  export type DataTableProps<RowData> = {
3
3
  title?: ReactNode;
4
4
  subtitle?: ReactNode;