@alextheman/components 6.2.0 → 6.2.1
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.
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +92 -49
- package/dist/index.d.ts +92 -49
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +16 -9
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
2
|
import { CollapseProps } from "@mui/material/Collapse";
|
|
3
3
|
import { PaletteMode, SxProps, Theme } from "@mui/material/styles";
|
|
4
4
|
import * as react0 from "react";
|
|
@@ -41,10 +41,10 @@ declare function CollapsableItem({
|
|
|
41
41
|
openIcon,
|
|
42
42
|
closedIcon,
|
|
43
43
|
useDefaultStyling
|
|
44
|
-
}: CollapsableItemProps):
|
|
44
|
+
}: CollapsableItemProps): react_jsx_runtime0.JSX.Element;
|
|
45
45
|
//#endregion
|
|
46
46
|
//#region src/components/DarkModeToggle.d.ts
|
|
47
|
-
declare function DarkModeToggle():
|
|
47
|
+
declare function DarkModeToggle(): react_jsx_runtime0.JSX.Element;
|
|
48
48
|
//#endregion
|
|
49
49
|
//#region src/components/DropdownMenu.d.ts
|
|
50
50
|
interface DropdownMenuProps {
|
|
@@ -57,7 +57,18 @@ interface DropdownMenuProps {
|
|
|
57
57
|
onOpen?: () => void;
|
|
58
58
|
onClose?: () => void;
|
|
59
59
|
}
|
|
60
|
-
/**
|
|
60
|
+
/**
|
|
61
|
+
* @param root0
|
|
62
|
+
* @param root0.children
|
|
63
|
+
* @param root0.button
|
|
64
|
+
* @param root0.buttonChildren
|
|
65
|
+
* @param root0.buttonProps
|
|
66
|
+
* @param root0.isOpenIcon
|
|
67
|
+
* @param root0.isClosedIcon
|
|
68
|
+
* @param root0.onOpen
|
|
69
|
+
* @param root0.onClose
|
|
70
|
+
* @deprecated This component does not support the new context-based pattern and individual DropdownMenuItem components. Please use DropdownMenu2 instead.
|
|
71
|
+
*/
|
|
61
72
|
declare function DropdownMenu({
|
|
62
73
|
children,
|
|
63
74
|
button: Button,
|
|
@@ -67,7 +78,7 @@ declare function DropdownMenu({
|
|
|
67
78
|
isClosedIcon,
|
|
68
79
|
onOpen,
|
|
69
80
|
onClose
|
|
70
|
-
}: DropdownMenuProps):
|
|
81
|
+
}: DropdownMenuProps): react_jsx_runtime0.JSX.Element;
|
|
71
82
|
//#endregion
|
|
72
83
|
//#region src/components/ExternalLink.d.ts
|
|
73
84
|
interface ExternalLinkProps extends Omit<LinkProps, "to" | "target" | "rel"> {
|
|
@@ -81,7 +92,7 @@ declare function ExternalLink({
|
|
|
81
92
|
children,
|
|
82
93
|
ref,
|
|
83
94
|
...linkProps
|
|
84
|
-
}: ExternalLinkProps):
|
|
95
|
+
}: ExternalLinkProps): react_jsx_runtime0.JSX.Element;
|
|
85
96
|
//#endregion
|
|
86
97
|
//#region src/components/FileInput.d.ts
|
|
87
98
|
declare const FileType: {
|
|
@@ -110,7 +121,7 @@ declare function FileInput({
|
|
|
110
121
|
accept,
|
|
111
122
|
useDropzone,
|
|
112
123
|
...buttonProps
|
|
113
|
-
}: FileInputProps):
|
|
124
|
+
}: FileInputProps): react_jsx_runtime0.JSX.Element;
|
|
114
125
|
//#endregion
|
|
115
126
|
//#region src/components/FileInputList.d.ts
|
|
116
127
|
interface FileInputListProps extends Omit<FileInputProps, "onFileInput"> {
|
|
@@ -121,7 +132,7 @@ declare function FileInputList({
|
|
|
121
132
|
files,
|
|
122
133
|
setFiles,
|
|
123
134
|
...fileInputProps
|
|
124
|
-
}: FileInputListProps):
|
|
135
|
+
}: FileInputListProps): react_jsx_runtime0.JSX.Element;
|
|
125
136
|
//#endregion
|
|
126
137
|
//#region src/components/IconWithPopover.d.ts
|
|
127
138
|
interface IconWithPopoverProps {
|
|
@@ -139,7 +150,7 @@ declare function IconWithPopover({
|
|
|
139
150
|
onClose,
|
|
140
151
|
iconProps,
|
|
141
152
|
children
|
|
142
|
-
}: IconWithPopoverProps):
|
|
153
|
+
}: IconWithPopoverProps): react_jsx_runtime0.JSX.Element;
|
|
143
154
|
//#endregion
|
|
144
155
|
//#region src/components/InternalLink.d.ts
|
|
145
156
|
interface InternalLinkProps extends Omit<LinkProps, "href"> {
|
|
@@ -153,7 +164,7 @@ declare function InternalLink({
|
|
|
153
164
|
children,
|
|
154
165
|
ref,
|
|
155
166
|
...linkProps
|
|
156
|
-
}: InternalLinkProps):
|
|
167
|
+
}: InternalLinkProps): react_jsx_runtime0.JSX.Element;
|
|
157
168
|
//#endregion
|
|
158
169
|
//#region src/components/ListItemInternalLink.d.ts
|
|
159
170
|
interface ListItemInternalLinkProps extends Omit<ListItemButtonProps, "href"> {
|
|
@@ -163,7 +174,7 @@ interface ListItemInternalLinkProps extends Omit<ListItemButtonProps, "href"> {
|
|
|
163
174
|
declare function ListItemInternalLink({
|
|
164
175
|
children,
|
|
165
176
|
...listItemButtonProps
|
|
166
|
-
}: ListItemInternalLinkProps):
|
|
177
|
+
}: ListItemInternalLinkProps): react_jsx_runtime0.JSX.Element;
|
|
167
178
|
//#endregion
|
|
168
179
|
//#region src/types/ContextHookOptions.d.ts
|
|
169
180
|
interface ContextHookOptions<S extends boolean = true> {
|
|
@@ -193,7 +204,7 @@ declare function DropdownMenu2({
|
|
|
193
204
|
buttonProps,
|
|
194
205
|
openIcon,
|
|
195
206
|
closedIcon
|
|
196
|
-
}: DropdownMenu2Props):
|
|
207
|
+
}: DropdownMenu2Props): react_jsx_runtime0.JSX.Element;
|
|
197
208
|
//#endregion
|
|
198
209
|
//#region src/providers/DropdownMenu2/DropdownMenuExternalLink.d.ts
|
|
199
210
|
interface DropdownMenuExternalLinkProps extends MenuItemOwnProps {
|
|
@@ -208,7 +219,7 @@ declare function DropdownMenuExternalLink({
|
|
|
208
219
|
children,
|
|
209
220
|
onClick,
|
|
210
221
|
...menuItemProps
|
|
211
|
-
}: DropdownMenuExternalLinkProps):
|
|
222
|
+
}: DropdownMenuExternalLinkProps): react_jsx_runtime0.JSX.Element;
|
|
212
223
|
//#endregion
|
|
213
224
|
//#region src/providers/DropdownMenu2/DropdownMenuInternalLink.d.ts
|
|
214
225
|
interface DropdownMenuInternalLinkProps extends MenuItemOwnProps {
|
|
@@ -223,7 +234,7 @@ declare function DropdownMenuInternalLink({
|
|
|
223
234
|
children,
|
|
224
235
|
onClick,
|
|
225
236
|
...menuItemProps
|
|
226
|
-
}: DropdownMenuInternalLinkProps):
|
|
237
|
+
}: DropdownMenuInternalLinkProps): react_jsx_runtime0.JSX.Element;
|
|
227
238
|
//#endregion
|
|
228
239
|
//#region src/providers/DropdownMenu2/DropdownMenuItem.d.ts
|
|
229
240
|
type DropdownMenuItemProps<RootComponent extends ElementType = typeof Button$1> = {
|
|
@@ -238,25 +249,25 @@ declare function DropdownMenuItem<RootComponent extends ElementType>({
|
|
|
238
249
|
ref,
|
|
239
250
|
onClick,
|
|
240
251
|
...menuItemProps
|
|
241
|
-
}: DropdownMenuItemProps<RootComponent>):
|
|
252
|
+
}: DropdownMenuItemProps<RootComponent>): react_jsx_runtime0.JSX.Element;
|
|
242
253
|
//#endregion
|
|
243
254
|
//#region src/providers/LoaderProvider/LoaderProvider.d.ts
|
|
244
|
-
interface LoaderProviderBaseProps<
|
|
255
|
+
interface LoaderProviderBaseProps<DataType> {
|
|
245
256
|
/** The current loading status (true if loading, false if not) */
|
|
246
257
|
isLoading: boolean;
|
|
247
258
|
/** The data being loaded. */
|
|
248
|
-
data?:
|
|
259
|
+
data?: DataType;
|
|
249
260
|
/** A parser for the data. */
|
|
250
|
-
dataParser?: (data: unknown) => NonNullable<
|
|
261
|
+
dataParser?: (data: unknown) => NonNullable<DataType>;
|
|
251
262
|
/** The component to show when the data is being fetched. */
|
|
252
263
|
loadingComponent?: ReactNode;
|
|
253
264
|
}
|
|
254
|
-
interface LoaderProviderPropsWithNoError<
|
|
265
|
+
interface LoaderProviderPropsWithNoError<DataType> extends LoaderProviderBaseProps<DataType> {
|
|
255
266
|
error?: never;
|
|
256
267
|
errorComponent?: never;
|
|
257
268
|
logError?: never;
|
|
258
269
|
}
|
|
259
|
-
interface LoaderProviderPropsWithError<
|
|
270
|
+
interface LoaderProviderPropsWithError<DataType> extends LoaderProviderBaseProps<DataType> {
|
|
260
271
|
/** The error given if the request gave an error. */
|
|
261
272
|
error: unknown;
|
|
262
273
|
/** The component to show if an error has been thrown. Note that this may not be provided unless the error prop has also been provided. */
|
|
@@ -268,18 +279,28 @@ type LoaderContextValue<T> = LoaderProviderPropsWithNoError<T> | LoaderProviderP
|
|
|
268
279
|
type LoaderProviderProps<T> = LoaderContextValue<T> & {
|
|
269
280
|
children: ReactNode;
|
|
270
281
|
};
|
|
271
|
-
/**
|
|
282
|
+
/**
|
|
283
|
+
* A provider for a context that deals with state management when fetching data from an API.
|
|
272
284
|
* This may be used over Loader if you require more control over the placement of the error message and data display.
|
|
285
|
+
* @template DataType - The type of data being loaded.
|
|
286
|
+
* @param root0 - Props to pass to LoaderProvider.
|
|
287
|
+
* @param root0.children - The components that may receive access to the LoaderContext value.
|
|
288
|
+
* @param root0.loadingComponent - The component to show when the data is being fetched.
|
|
289
|
+
* @param root0.isLoading - The current loading status (true if loading, false if not)
|
|
290
|
+
* @param root0.error - The error given if the request gave an error.
|
|
291
|
+
* @param root0.errorComponent - The component to show if an error has been thrown. Note that this may not be provided unless the error prop has also been provided.
|
|
292
|
+
* @param root0.logError - An option to log the error to the console. Note that this may not be provided unless the error prop has also been provided.
|
|
273
293
|
*/
|
|
274
|
-
declare function LoaderProvider<
|
|
294
|
+
declare function LoaderProvider<DataType>({
|
|
275
295
|
children,
|
|
276
296
|
loadingComponent,
|
|
277
297
|
...contextProps
|
|
278
|
-
}: LoaderProviderProps<
|
|
298
|
+
}: LoaderProviderProps<DataType>): react_jsx_runtime0.JSX.Element;
|
|
279
299
|
//#endregion
|
|
280
300
|
//#region src/providers/LoaderProvider/LoaderData.d.ts
|
|
281
301
|
interface LoaderDataProps<T> {
|
|
282
|
-
/**
|
|
302
|
+
/**
|
|
303
|
+
* The elements to show after data has been loaded.
|
|
283
304
|
* This is best provided as a function with a data argument that guarantees the data will not be undefined by the time you receive it here.
|
|
284
305
|
*/
|
|
285
306
|
children: ReactNode | ((data: NonNullable<T>) => ReactNode);
|
|
@@ -288,23 +309,26 @@ interface LoaderDataProps<T> {
|
|
|
288
309
|
/** The component to show when the data is being fetched. */
|
|
289
310
|
loadingComponent?: ReactNode;
|
|
290
311
|
}
|
|
291
|
-
/**
|
|
292
|
-
|
|
312
|
+
/**
|
|
313
|
+
* The component responsible for showing the data provided by LoaderProvider.
|
|
314
|
+
* @template DataType - The type of data being loaded.
|
|
315
|
+
* @param root0 - Props to pass to LoaderData.
|
|
316
|
+
* @param root0.children - The elements to show after data has been loaded.
|
|
317
|
+
* This is best provided as a function with a data argument that guarantees the data will not be undefined by the time you receive it here.
|
|
318
|
+
* @param root0.dataParser - A parser for the data.
|
|
319
|
+
* @param root0.loadingComponent - The component to show when the data is being fetched.
|
|
320
|
+
*/
|
|
321
|
+
declare function LoaderData<DataType>({
|
|
293
322
|
children,
|
|
294
323
|
dataParser: loaderDataParser,
|
|
295
324
|
loadingComponent
|
|
296
|
-
}: LoaderDataProps<
|
|
325
|
+
}: LoaderDataProps<DataType>): react_jsx_runtime0.JSX.Element;
|
|
297
326
|
//#endregion
|
|
298
327
|
//#region src/providers/LoaderProvider/LoaderError.d.ts
|
|
299
328
|
interface LoaderErrorBaseProps {
|
|
300
|
-
/**
|
|
301
|
-
* The component to show if an error has been thrown.
|
|
302
|
-
* @deprecated Please pass in the content to show on error as children instead.
|
|
303
|
-
*/
|
|
304
|
-
errorComponent?: ReactNode | ((error: unknown) => ReactNode);
|
|
305
329
|
/** The component to show if an error has been thrown. */
|
|
306
330
|
children?: ReactNode | ((error: unknown) => ReactNode);
|
|
307
|
-
/**
|
|
331
|
+
/** An option to log the error to the console. */
|
|
308
332
|
logError?: boolean;
|
|
309
333
|
}
|
|
310
334
|
interface LoaderErrorPropsWithUndefinedOrNull extends LoaderErrorBaseProps {
|
|
@@ -321,14 +345,22 @@ interface LoaderErrorPropsWithNullable extends LoaderErrorBaseProps {
|
|
|
321
345
|
nullableComponent?: ReactNode;
|
|
322
346
|
}
|
|
323
347
|
type LoaderErrorProps = LoaderErrorPropsWithUndefinedOrNull | LoaderErrorPropsWithNullable;
|
|
324
|
-
/**
|
|
348
|
+
/**
|
|
349
|
+
* The component responsible for showing any errors provided by LoaderProvider.
|
|
350
|
+
* @param root0 - The props to be passed to LoaderError.
|
|
351
|
+
* @param root0.children - The component to show if an error has been thrown.
|
|
352
|
+
* @param root0.undefinedComponent - The component to show if no error was thrown but the data is undefined.
|
|
353
|
+
* @param root0.nullComponent - The component to show if no error was thrown but the data is null.
|
|
354
|
+
* @param root0.nullableComponent - The component to show if no error was thrown but the data is nullable (undefined or null).
|
|
355
|
+
* @param root0.logError - An option to log the error to the console.
|
|
356
|
+
*/
|
|
325
357
|
declare function LoaderError({
|
|
326
358
|
children,
|
|
327
359
|
undefinedComponent,
|
|
328
360
|
nullComponent,
|
|
329
361
|
nullableComponent,
|
|
330
362
|
logError: propsLogError
|
|
331
|
-
}: LoaderErrorProps): string | number | bigint | boolean |
|
|
363
|
+
}: LoaderErrorProps): string | number | bigint | boolean | react_jsx_runtime0.JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | react0.ReactPortal | react0.ReactElement<unknown, string | react0.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | null | undefined;
|
|
332
364
|
//#endregion
|
|
333
365
|
//#region src/providers/ModeProvider.d.ts
|
|
334
366
|
interface ModeContextValue {
|
|
@@ -345,7 +377,7 @@ interface ModeProviderProps {
|
|
|
345
377
|
declare function ModeProvider({
|
|
346
378
|
children,
|
|
347
379
|
mode: modeProp
|
|
348
|
-
}: ModeProviderProps):
|
|
380
|
+
}: ModeProviderProps): react_jsx_runtime0.JSX.Element;
|
|
349
381
|
//#endregion
|
|
350
382
|
//#region src/providers/ScreenSizeProvider.d.ts
|
|
351
383
|
interface ScreenSizeProps {
|
|
@@ -365,7 +397,7 @@ declare function ScreenSizeProvider({
|
|
|
365
397
|
children,
|
|
366
398
|
largeScreenWidth,
|
|
367
399
|
largeScreenHeight
|
|
368
|
-
}: ScreenSizeProps):
|
|
400
|
+
}: ScreenSizeProps): react_jsx_runtime0.JSX.Element;
|
|
369
401
|
//#endregion
|
|
370
402
|
//#region src/providers/SnackbarProvider.d.ts
|
|
371
403
|
interface SnackbarProviderProps {
|
|
@@ -381,22 +413,33 @@ declare function useSnackbar<Strict extends boolean = true>({
|
|
|
381
413
|
declare function SnackbarProvider({
|
|
382
414
|
children,
|
|
383
415
|
autoHideDuration
|
|
384
|
-
}: SnackbarProviderProps):
|
|
416
|
+
}: SnackbarProviderProps): react_jsx_runtime0.JSX.Element;
|
|
385
417
|
//#endregion
|
|
386
418
|
//#region src/components/Loader.d.ts
|
|
387
|
-
type LoaderProps<
|
|
388
|
-
/**
|
|
419
|
+
type LoaderProps<DataType> = Omit<LoaderProviderProps<DataType>, "children" | "logError"> & Omit<LoaderErrorProps, "errorComponent" | "children"> & Omit<LoaderDataProps<DataType>, "showOnError" | "onUndefined" | "onNull" | "onNullable">;
|
|
420
|
+
/**
|
|
421
|
+
* An in-line component that deals with state management when fetching data from an API.
|
|
389
422
|
* This may be used over LoaderProvider if you don't require as much control over the placement of the error message and data display.
|
|
423
|
+
* @template DataType - The type of data being loaded.
|
|
424
|
+
* @param root0 - Props to pass to Loader.
|
|
425
|
+
* @param root0.children - The elements to show after data has been loaded.
|
|
426
|
+
* @param root0.errorComponent - The component to show if an error has been thrown. Note that this may not be provided unless the error prop has also been provided.
|
|
427
|
+
* @param root0.undefinedComponent - The component to show if no error was thrown but the data is undefined.
|
|
428
|
+
* @param root0.nullComponent - The component to show if no error was thrown but the data is null.
|
|
429
|
+
* @param root0.nullableComponent - The component to show if no error was thrown but the data is nullable (undefined or null).
|
|
430
|
+
* @param root0.loadingComponent - The component to show when the data is being fetched.
|
|
431
|
+
* @param root0.logError - An option to log the error to the console.
|
|
390
432
|
*/
|
|
391
|
-
declare function Loader<
|
|
433
|
+
declare function Loader<DataType>({
|
|
392
434
|
children,
|
|
393
435
|
errorComponent,
|
|
394
436
|
undefinedComponent,
|
|
395
437
|
nullComponent,
|
|
396
438
|
nullableComponent,
|
|
439
|
+
logError,
|
|
397
440
|
loadingComponent,
|
|
398
441
|
...loaderProviderProps
|
|
399
|
-
}: LoaderProps<
|
|
442
|
+
}: LoaderProps<DataType>): react_jsx_runtime0.JSX.Element;
|
|
400
443
|
//#endregion
|
|
401
444
|
//#region src/components/NavigationBottom.d.ts
|
|
402
445
|
interface NavItemBottom {
|
|
@@ -412,7 +455,7 @@ interface NavigationBottomProps {
|
|
|
412
455
|
declare function NavigationBottom({
|
|
413
456
|
children,
|
|
414
457
|
navItems
|
|
415
|
-
}: NavigationBottomProps):
|
|
458
|
+
}: NavigationBottomProps): react_jsx_runtime0.JSX.Element;
|
|
416
459
|
//#endregion
|
|
417
460
|
//#region src/components/NavigationDrawer.d.ts
|
|
418
461
|
interface NavMenuItem {
|
|
@@ -434,7 +477,7 @@ declare function NavigationDrawer({
|
|
|
434
477
|
navItems,
|
|
435
478
|
children,
|
|
436
479
|
headerElements
|
|
437
|
-
}: NavigationDrawerProps):
|
|
480
|
+
}: NavigationDrawerProps): react_jsx_runtime0.JSX.Element;
|
|
438
481
|
//#endregion
|
|
439
482
|
//#region src/components/PopoverText.d.ts
|
|
440
483
|
interface PopoverTextProps extends TypographyProps {
|
|
@@ -444,7 +487,7 @@ declare function PopoverText({
|
|
|
444
487
|
text,
|
|
445
488
|
sx,
|
|
446
489
|
...typographyProps
|
|
447
|
-
}: PopoverTextProps):
|
|
490
|
+
}: PopoverTextProps): react_jsx_runtime0.JSX.Element;
|
|
448
491
|
//#endregion
|
|
449
492
|
//#region src/components/ReactPlayground.d.ts
|
|
450
493
|
interface ReactPlaygroundProps extends ComponentProps<typeof LiveProvider> {
|
|
@@ -454,7 +497,7 @@ declare function ReactPlayground({
|
|
|
454
497
|
code,
|
|
455
498
|
previewStyles,
|
|
456
499
|
...liveProviderProps
|
|
457
|
-
}: ReactPlaygroundProps):
|
|
500
|
+
}: ReactPlaygroundProps): react_jsx_runtime0.JSX.Element;
|
|
458
501
|
//#endregion
|
|
459
502
|
//#region src/components/SkeletonRow.d.ts
|
|
460
503
|
interface SkeletonRowProps {
|
|
@@ -462,7 +505,7 @@ interface SkeletonRowProps {
|
|
|
462
505
|
}
|
|
463
506
|
declare function SkeletonRow({
|
|
464
507
|
columns
|
|
465
|
-
}: SkeletonRowProps):
|
|
508
|
+
}: SkeletonRowProps): react_jsx_runtime0.JSX.Element;
|
|
466
509
|
//#endregion
|
|
467
510
|
//#region src/components/SubmitButton.d.ts
|
|
468
511
|
interface SubmitButtonProps extends Omit<ButtonProps, "type"> {
|
|
@@ -473,7 +516,7 @@ declare function SubmitButton({
|
|
|
473
516
|
disableClean,
|
|
474
517
|
label,
|
|
475
518
|
...buttonProps
|
|
476
|
-
}: SubmitButtonProps):
|
|
519
|
+
}: SubmitButtonProps): react_jsx_runtime0.JSX.Element;
|
|
477
520
|
//#endregion
|
|
478
521
|
//#region src/components/SwitchWithIcons.d.ts
|
|
479
522
|
interface SwitchWithIconsProps extends Omit<SwitchProps, "icon" | "checkedIcon"> {
|
|
@@ -492,7 +535,7 @@ declare function SwitchWithIcons({
|
|
|
492
535
|
uncheckedIcon: UncheckedIcon,
|
|
493
536
|
uncheckedIconStyles,
|
|
494
537
|
...switchProps
|
|
495
|
-
}: SwitchWithIconsProps):
|
|
538
|
+
}: SwitchWithIconsProps): react_jsx_runtime0.JSX.Element;
|
|
496
539
|
//#endregion
|
|
497
540
|
//#region src/hooks/useHash.d.ts
|
|
498
541
|
declare function useHash<S extends string>(initialHash: S | undefined): [S, Dispatch<SetStateAction<S>>];
|