@gnwebsoft/ui 3.0.1 → 3.0.4

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 (66) hide show
  1. package/README.md +688 -0
  2. package/dist/chunk-4H3AFH7A.js +505 -0
  3. package/dist/chunk-DE62KYFK.js +122 -0
  4. package/dist/chunk-DEPJRTVT.js +1 -0
  5. package/dist/chunk-EBRUE2WR.cjs +493 -0
  6. package/dist/chunk-FD57PCAC.cjs +1 -0
  7. package/dist/chunk-H3GQLELL.js +2025 -0
  8. package/dist/chunk-MVPLBJRK.cjs +1 -0
  9. package/dist/chunk-OJF67RNM.js +1 -0
  10. package/dist/chunk-OT7COE7R.cjs +2025 -0
  11. package/dist/chunk-R2YK4LTT.cjs +122 -0
  12. package/dist/chunk-U6SDYCWF.js +493 -0
  13. package/dist/chunk-ZC7FGYL2.cjs +505 -0
  14. package/dist/components/index.cjs +25 -0
  15. package/dist/components/index.d.cts +752 -0
  16. package/dist/components/index.d.ts +664 -15
  17. package/dist/components/index.js +25 -24
  18. package/dist/enhanced-z-I7EHVS.d.cts +134 -0
  19. package/dist/enhanced-z-I7EHVS.d.ts +134 -0
  20. package/dist/hooks/index.cjs +12 -0
  21. package/dist/hooks/index.d.cts +95 -0
  22. package/dist/hooks/index.d.ts +82 -4
  23. package/dist/hooks/index.js +12 -7
  24. package/dist/index.cjs +127 -0
  25. package/dist/index.d.cts +14 -0
  26. package/dist/index.d.ts +4 -6
  27. package/dist/index.js +127 -54
  28. package/dist/types/index.cjs +2 -0
  29. package/dist/types/index.d.cts +241 -0
  30. package/dist/types/index.d.ts +205 -20
  31. package/dist/types/index.js +2 -1
  32. package/dist/utils/index.cjs +45 -0
  33. package/dist/utils/index.d.cts +366 -0
  34. package/dist/utils/index.d.ts +317 -9
  35. package/dist/utils/index.js +45 -22
  36. package/dist/wrappers/index.cjs +54 -0
  37. package/dist/wrappers/index.d.cts +1684 -0
  38. package/dist/wrappers/index.d.ts +1601 -118
  39. package/dist/wrappers/index.js +54 -8
  40. package/package.json +145 -88
  41. package/dist/AsyncSelectPayload-Cz4bgak0.d.mts +0 -10
  42. package/dist/AsyncSelectPayload-Cz4bgak0.d.ts +0 -10
  43. package/dist/chunk-2JFL7TS5.mjs +0 -0
  44. package/dist/chunk-6BGQA4BQ.js +0 -1
  45. package/dist/chunk-6JZ35VQJ.js +0 -19
  46. package/dist/chunk-7M2VOCYN.js +0 -1
  47. package/dist/chunk-BWQUYXUW.mjs +0 -1634
  48. package/dist/chunk-D3J7MWAU.js +0 -1634
  49. package/dist/chunk-EVPUCTZA.mjs +0 -0
  50. package/dist/chunk-FSU3H777.mjs +0 -473
  51. package/dist/chunk-GFSTK7KN.mjs +0 -19
  52. package/dist/chunk-I7EIUZKK.js +0 -332
  53. package/dist/chunk-JKUOV3MN.js +0 -473
  54. package/dist/chunk-RQS44YC7.mjs +0 -332
  55. package/dist/components/index.d.mts +0 -103
  56. package/dist/components/index.mjs +0 -24
  57. package/dist/hooks/index.d.mts +0 -17
  58. package/dist/hooks/index.mjs +0 -7
  59. package/dist/index.d.mts +0 -16
  60. package/dist/index.mjs +0 -54
  61. package/dist/types/index.d.mts +0 -56
  62. package/dist/types/index.mjs +0 -1
  63. package/dist/utils/index.d.mts +0 -58
  64. package/dist/utils/index.mjs +0 -22
  65. package/dist/wrappers/index.d.mts +0 -201
  66. package/dist/wrappers/index.mjs +0 -8
@@ -1,103 +1,752 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { SxProps, ButtonTypeMap } from '@mui/material';
3
- import { PropsWithChildren, ReactNode } from 'react';
4
- import { OverrideProps } from '@mui/material/OverridableComponent';
2
+ import { SxProps, ButtonProps } from '@mui/material';
3
+ import React$1, { PropsWithChildren, ReactNode } from 'react';
5
4
 
6
- type ClearButtonProps = {
5
+ /**
6
+ * Props for the ClearButton component.
7
+ *
8
+ * @public
9
+ */
10
+ interface ClearButtonProps {
11
+ /**
12
+ * Indicates if a form or operation is currently being submitted.
13
+ * When true, the button is disabled to prevent multiple clear actions.
14
+ */
7
15
  isSubmitting: boolean;
16
+ /**
17
+ * Callback function executed when the clear button is clicked.
18
+ * Should handle the clearing logic (e.g., form reset, data clearing).
19
+ */
8
20
  handleClear: () => void;
21
+ /**
22
+ * Optional MUI sx prop for custom styling.
23
+ * @example { mt: 2, color: 'warning.main' }
24
+ */
9
25
  sx?: SxProps;
26
+ /**
27
+ * Optional localStorage key to remove when clearing.
28
+ * If provided, the corresponding localStorage item will be removed on click.
29
+ * @example "user-preferences" or "form-data"
30
+ */
10
31
  storeKey?: string;
11
- };
32
+ }
33
+ /**
34
+ * Standardized clear button component with localStorage integration.
35
+ *
36
+ * This component provides a consistent clear button implementation that handles
37
+ * both callback execution and optional localStorage cleanup. It automatically
38
+ * disables during form submissions and can clear stored data when needed.
39
+ *
40
+ * @example
41
+ * Basic usage:
42
+ * ```tsx
43
+ * <ClearButton
44
+ * isSubmitting={isLoading}
45
+ * handleClear={() => form.reset()}
46
+ * />
47
+ * ```
48
+ *
49
+ * @example
50
+ * With localStorage cleanup:
51
+ * ```tsx
52
+ * <ClearButton
53
+ * isSubmitting={form.formState.isSubmitting}
54
+ * handleClear={() => setFilters({})}
55
+ * storeKey="user-filters"
56
+ * />
57
+ * ```
58
+ *
59
+ * @param props - Component props for clear button configuration
60
+ * @returns MUI Button component configured as a clear button
61
+ *
62
+ * @public
63
+ */
12
64
  declare const ClearButton: ({ isSubmitting, handleClear, sx, storeKey, }: ClearButtonProps) => react_jsx_runtime.JSX.Element;
13
65
 
14
- type FilterButtonProps = {
66
+ /**
67
+ * Props for the FilterButton component.
68
+ *
69
+ * @public
70
+ */
71
+ interface FilterButtonProps {
72
+ /**
73
+ * Indicates if a filter operation is currently being processed.
74
+ * When true, shows loading spinner and disables the button.
75
+ */
15
76
  isSubmitting: boolean;
77
+ /**
78
+ * Controls button visibility and enabled state.
79
+ * When false, the button is disabled.
80
+ * @defaultValue true
81
+ */
16
82
  show?: boolean;
83
+ /**
84
+ * Custom text to display on the button.
85
+ * @defaultValue "Filter"
86
+ * @example "Apply Filters" or "Search"
87
+ */
17
88
  title?: string;
89
+ /**
90
+ * Custom icon to display instead of the default filter icon.
91
+ * @example <SearchIcon />
92
+ */
18
93
  icon?: React.ReactNode;
94
+ /**
95
+ * Optional MUI sx prop for custom button styling.
96
+ * @example { mt: 2, minWidth: 120 }
97
+ */
19
98
  sx?: SxProps;
99
+ /**
100
+ * Optional MUI sx prop for custom icon styling.
101
+ * @example { color: 'primary.main', fontSize: 18 }
102
+ */
20
103
  iconSx?: SxProps;
21
- };
104
+ }
105
+ /**
106
+ * Filter button component with loading states and customizable appearance.
107
+ *
108
+ * This component provides a standardized filter/submit button with integrated loading
109
+ * states, icon support, and badge styling. It's designed for use in filter forms
110
+ * and search interfaces where users need to apply filtering criteria.
111
+ *
112
+ * @example
113
+ * Basic usage:
114
+ * ```tsx
115
+ * <FilterButton
116
+ * isSubmitting={isLoading}
117
+ * show={hasFilters}
118
+ * />
119
+ * ```
120
+ *
121
+ * @example
122
+ * Custom title and icon:
123
+ * ```tsx
124
+ * <FilterButton
125
+ * isSubmitting={form.formState.isSubmitting}
126
+ * title="Apply Search"
127
+ * icon={<SearchIcon />}
128
+ * show={true}
129
+ * />
130
+ * ```
131
+ *
132
+ * @example
133
+ * With custom styling:
134
+ * ```tsx
135
+ * <FilterButton
136
+ * isSubmitting={isProcessing}
137
+ * title="Filter Results"
138
+ * sx={{ minWidth: 150, mt: 2 }}
139
+ * iconSx={{ fontSize: 20 }}
140
+ * />
141
+ * ```
142
+ *
143
+ * @param props - Component props for filter button configuration
144
+ * @returns MUI LoadingButton component configured as a filter button
145
+ *
146
+ * @public
147
+ */
22
148
  declare const FilterButton: ({ isSubmitting, show, title, icon, sx, iconSx, }: FilterButtonProps) => react_jsx_runtime.JSX.Element;
23
149
 
150
+ /**
151
+ * Props for the FilterWrapper component.
152
+ *
153
+ * @public
154
+ */
24
155
  type FilterWrapperProps = PropsWithChildren<{
156
+ /**
157
+ * Title text displayed in the card header.
158
+ * @defaultValue "Filter"
159
+ * @example "Search Criteria" or "Advanced Filters"
160
+ */
25
161
  title?: string;
162
+ /**
163
+ * Number of active filters to display in the header.
164
+ * Only shown when showCount is true.
165
+ * @example 3 for "Filter (3)"
166
+ */
26
167
  filterCount?: number;
168
+ /**
169
+ * Optional MUI sx prop for custom card styling.
170
+ * @example { mt: 2, boxShadow: 2 }
171
+ */
27
172
  cardSx?: SxProps;
173
+ /**
174
+ * Optional MUI sx prop for custom title text styling.
175
+ * @example { fontSize: 18, fontWeight: 'bold' }
176
+ */
28
177
  textSx?: SxProps;
178
+ /**
179
+ * Custom icon to display instead of the default search icon.
180
+ * @example <FilterListIcon />
181
+ */
29
182
  icon?: ReactNode;
183
+ /**
184
+ * Optional MUI sx prop for custom icon styling.
185
+ * @example { color: 'secondary.main', fontSize: 24 }
186
+ */
30
187
  iconSx?: SxProps;
188
+ /**
189
+ * Whether to display the filter count in the header.
190
+ * @defaultValue false
191
+ */
31
192
  showCount?: boolean;
32
193
  }>;
194
+ /**
195
+ * Card-based wrapper component for organizing filter controls and form elements.
196
+ *
197
+ * This component provides a consistent layout for filter interfaces with a header,
198
+ * optional filter count display, and a grid-based content area. It's designed to
199
+ * contain form controls and filter elements in a visually organized manner.
200
+ *
201
+ * @example
202
+ * Basic usage:
203
+ * ```tsx
204
+ * <FilterWrapper>
205
+ * <Grid item xs={12} md={6}>
206
+ * <TextField label="Search" />
207
+ * </Grid>
208
+ * <Grid item xs={12} md={6}>
209
+ * <Select label="Category" />
210
+ * </Grid>
211
+ * </FilterWrapper>
212
+ * ```
213
+ *
214
+ * @example
215
+ * With custom title and count:
216
+ * ```tsx
217
+ * <FilterWrapper
218
+ * title="Advanced Search"
219
+ * filterCount={activeFilters.length}
220
+ * showCount={true}
221
+ * >
222
+ * {filterControls}
223
+ * </FilterWrapper>
224
+ * ```
225
+ *
226
+ * @example
227
+ * With custom styling:
228
+ * ```tsx
229
+ * <FilterWrapper
230
+ * title="Product Filters"
231
+ * icon={<FilterListIcon />}
232
+ * cardSx={{ mt: 3, borderRadius: 2 }}
233
+ * textSx={{ color: 'secondary.main' }}
234
+ * >
235
+ * {children}
236
+ * </FilterWrapper>
237
+ * ```
238
+ *
239
+ * @param props - Component props including children and styling options
240
+ * @returns MUI Card component with structured filter layout
241
+ *
242
+ * @public
243
+ */
33
244
  declare const FilterWrapper: ({ children, title, filterCount, cardSx, textSx, icon, iconSx, showCount, }: FilterWrapperProps) => react_jsx_runtime.JSX.Element;
34
245
 
246
+ /**
247
+ * Props for the FormWrapper component.
248
+ *
249
+ * @public
250
+ */
35
251
  type FormWrapper = PropsWithChildren<{
252
+ /**
253
+ * Title text displayed in the form header.
254
+ * @example "Create User" or "Edit Profile"
255
+ */
36
256
  title: string;
257
+ /**
258
+ * Indicates if the form is in edit mode (currently unused in implementation).
259
+ * @deprecated This prop is defined but not used in the component logic
260
+ */
37
261
  editMode?: boolean;
262
+ /**
263
+ * Custom icon to display in the header next to the title.
264
+ * @example <PersonIcon /> or <EditIcon />
265
+ */
38
266
  icon?: ReactNode;
267
+ /**
268
+ * Optional MUI sx prop for custom card styling.
269
+ * @example { mt: 2, maxWidth: 600 }
270
+ */
39
271
  cardSx?: SxProps;
272
+ /**
273
+ * Optional MUI sx prop for custom title text styling.
274
+ * @example { fontSize: 20, fontWeight: 'bold' }
275
+ */
40
276
  textSx?: SxProps;
277
+ /**
278
+ * Action button or element to display in the header (e.g., save, close).
279
+ * @example <Button>Save</Button> or <IconButton><CloseIcon /></IconButton>
280
+ */
41
281
  actionButton?: ReactNode;
42
282
  }>;
283
+ /**
284
+ * Card-based wrapper component for organizing form elements with header and actions.
285
+ *
286
+ * This component provides a structured layout for forms with a title header,
287
+ * optional icon, action buttons, and a grid-based content area. It creates
288
+ * a consistent visual structure for form interfaces throughout the application.
289
+ *
290
+ * @example
291
+ * Basic form wrapper:
292
+ * ```tsx
293
+ * <FormWrapper title="User Information">
294
+ * <Grid item xs={12} md={6}>
295
+ * <TextField label="First Name" />
296
+ * </Grid>
297
+ * <Grid item xs={12} md={6}>
298
+ * <TextField label="Last Name" />
299
+ * </Grid>
300
+ * </FormWrapper>
301
+ * ```
302
+ *
303
+ * @example
304
+ * With icon and action button:
305
+ * ```tsx
306
+ * <FormWrapper
307
+ * title="Edit Profile"
308
+ * icon={<PersonIcon />}
309
+ * actionButton={
310
+ * <Button variant="contained" type="submit">
311
+ * Save Changes
312
+ * </Button>
313
+ * }
314
+ * >
315
+ * {formFields}
316
+ * </FormWrapper>
317
+ * ```
318
+ *
319
+ * @param props - Component props including children and layout options
320
+ * @returns MUI Card component with structured form layout
321
+ *
322
+ * @public
323
+ */
43
324
  declare const FormWrapper: ({ children, title, editMode, cardSx, textSx, icon, actionButton, }: FormWrapper) => react_jsx_runtime.JSX.Element;
44
325
 
45
- type LabelTextProps = {
326
+ /**
327
+ * Props for the LabelText component.
328
+ *
329
+ * @public
330
+ */
331
+ interface LabelTextProps {
332
+ /**
333
+ * Label text to display on the left side.
334
+ * @example "Name" or "Email Address"
335
+ */
46
336
  label: string;
337
+ /**
338
+ * Value content to display on the right side.
339
+ * Can be text, numbers, or React elements.
340
+ * @example "John Doe" or <Link>View Details</Link>
341
+ */
47
342
  value: React.ReactNode;
343
+ /**
344
+ * Custom grid sizing for label and value sections.
345
+ * @defaultValue { labelSize: { xs: 6, sm: 6, md: 6 }, valueSize: { xs: 12, sm: 6, md: 6 } }
346
+ */
48
347
  gridSize?: {
348
+ /** Grid size configuration for the label section */
49
349
  labelSize: {
50
350
  xs: number;
51
351
  sm: number;
52
352
  md: number;
53
353
  };
354
+ /** Grid size configuration for the value section */
54
355
  valueSize: {
55
356
  xs: number;
56
357
  sm: number;
57
358
  md: number;
58
359
  };
59
360
  };
361
+ /**
362
+ * Grid size configuration for the entire container.
363
+ * @defaultValue { xs: 12, sm: 6, md: 6 }
364
+ */
60
365
  containerSize?: {
61
366
  xs: number;
62
367
  sm: number;
63
368
  md: number;
64
369
  };
370
+ /**
371
+ * Optional MUI sx prop for custom label styling.
372
+ * @example { fontWeight: 'bold', color: 'primary.main' }
373
+ */
65
374
  labelSx?: SxProps;
375
+ /**
376
+ * Optional MUI sx prop for custom value styling.
377
+ * @example { color: 'text.secondary', fontStyle: 'italic' }
378
+ */
66
379
  valueSx?: SxProps;
67
- };
380
+ }
381
+ /**
382
+ * Responsive label-value display component with hover effects and text truncation.
383
+ *
384
+ * This component creates a consistent label-value pair layout that adapts to different
385
+ * screen sizes. It includes hover effects, text truncation with tooltips, and
386
+ * customizable grid sizing for flexible layouts.
387
+ *
388
+ * @example
389
+ * Basic usage:
390
+ * ```tsx
391
+ * <LabelText
392
+ * label="Full Name"
393
+ * value="John Doe"
394
+ * />
395
+ * ```
396
+ *
397
+ * @example
398
+ * With React element value:
399
+ * ```tsx
400
+ * <LabelText
401
+ * label="Profile"
402
+ * value={<Link href="/profile">View Profile</Link>}
403
+ * />
404
+ * ```
405
+ *
406
+ * @example
407
+ * Custom grid sizing:
408
+ * ```tsx
409
+ * <LabelText
410
+ * label="Description"
411
+ * value={longDescription}
412
+ * gridSize={{
413
+ * labelSize: { xs: 12, sm: 3, md: 2 },
414
+ * valueSize: { xs: 12, sm: 9, md: 10 }
415
+ * }}
416
+ * containerSize={{ xs: 12, sm: 12, md: 12 }}
417
+ * />
418
+ * ```
419
+ *
420
+ * @param props - Component props for label-value configuration
421
+ * @returns Grid-based layout with label and value sections
422
+ *
423
+ * @public
424
+ */
68
425
  declare const LabelText: ({ label, value, gridSize, containerSize, labelSx, valueSx, }: LabelTextProps) => react_jsx_runtime.JSX.Element;
69
426
 
427
+ /**
428
+ * Props for the ListWrapper component.
429
+ *
430
+ * @public
431
+ */
70
432
  type ListWrapperProps = PropsWithChildren<{
433
+ /**
434
+ * Title text displayed in the card header.
435
+ * @defaultValue "List"
436
+ * @example "User List" or "Product Catalog"
437
+ */
71
438
  title?: string;
439
+ /**
440
+ * Number of items to display in the header count.
441
+ * Only shown when showCount is true.
442
+ * @example 25 for "List (25)"
443
+ */
72
444
  count?: number;
445
+ /**
446
+ * Controls whether the entire component is rendered.
447
+ * When false, returns an empty fragment.
448
+ * @defaultValue true
449
+ */
73
450
  show?: boolean;
451
+ /**
452
+ * Action button or element to display in the header (e.g., add, export).
453
+ * @example <Button>Add New</Button> or <IconButton><MoreVertIcon /></IconButton>
454
+ */
74
455
  actionButton?: ReactNode;
456
+ /**
457
+ * Optional MUI sx prop for custom card styling.
458
+ * @example { mt: 2, boxShadow: 3 }
459
+ */
75
460
  cardSx?: SxProps;
461
+ /**
462
+ * Optional MUI sx prop for custom title text styling.
463
+ * @example { fontSize: 18, color: 'secondary.main' }
464
+ */
76
465
  textSx?: SxProps;
466
+ /**
467
+ * Custom icon to display instead of the default search icon.
468
+ * @example <ListIcon /> or <TableRowsIcon />
469
+ */
77
470
  icon?: ReactNode;
471
+ /**
472
+ * Whether to display the count in the header.
473
+ * @defaultValue true
474
+ */
78
475
  showCount?: boolean;
476
+ /**
477
+ * Optional MUI sx prop for custom icon styling.
478
+ * @example { color: 'primary.main', fontSize: 28 }
479
+ */
79
480
  iconSx?: SxProps;
80
481
  }>;
482
+ /**
483
+ * Card-based wrapper component for organizing list content with header and actions.
484
+ *
485
+ * This component provides a structured layout for displaying lists of data with
486
+ * a title header, optional item count, action buttons, and a grid-based content area.
487
+ * It includes conditional rendering and consistent styling across list interfaces.
488
+ *
489
+ * @example
490
+ * Basic list wrapper:
491
+ * ```tsx
492
+ * <ListWrapper title="Users" count={users.length}>
493
+ * <Grid item xs={12}>
494
+ * <DataGrid rows={users} columns={columns} />
495
+ * </Grid>
496
+ * </ListWrapper>
497
+ * ```
498
+ *
499
+ * @example
500
+ * With action button and custom icon:
501
+ * ```tsx
502
+ * <ListWrapper
503
+ * title="Products"
504
+ * count={products.length}
505
+ * icon={<InventoryIcon />}
506
+ * actionButton={
507
+ * <Button variant="contained" onClick={addProduct}>
508
+ * Add Product
509
+ * </Button>
510
+ * }
511
+ * >
512
+ * {productList}
513
+ * </ListWrapper>
514
+ * ```
515
+ *
516
+ * @example
517
+ * Conditional rendering:
518
+ * ```tsx
519
+ * <ListWrapper
520
+ * title="Search Results"
521
+ * count={searchResults.length}
522
+ * show={hasSearched}
523
+ * showCount={searchResults.length > 0}
524
+ * >
525
+ * {searchResultItems}
526
+ * </ListWrapper>
527
+ * ```
528
+ *
529
+ * @param props - Component props including children and layout options
530
+ * @returns MUI Card component with structured list layout, or empty fragment if show is false
531
+ *
532
+ * @public
533
+ */
81
534
  declare const ListWrapper: ({ children, title, count, show, actionButton, cardSx, textSx, icon, iconSx, showCount, }: ListWrapperProps) => react_jsx_runtime.JSX.Element;
82
535
 
536
+ /**
537
+ * Pre-configured toolbar component for MUI DataGrid with essential tools.
538
+ *
539
+ * This component provides a ready-to-use toolbar for MUI DataGrid components
540
+ * that includes quick filtering, column management, advanced filtering, and
541
+ * data export capabilities. The quick filter input is styled with custom
542
+ * border radius and padding for a polished appearance.
543
+ *
544
+ * Features included:
545
+ * - Quick filter search input (left-aligned)
546
+ * - Column visibility toggle button
547
+ * - Advanced filter button
548
+ * - Data export button (CSV, Excel, etc.)
549
+ *
550
+ * @example
551
+ * Basic usage with DataGrid:
552
+ * ```tsx
553
+ * <DataGrid
554
+ * rows={data}
555
+ * columns={columns}
556
+ * slots={{
557
+ * toolbar: SimpleToolbar
558
+ * }}
559
+ * />
560
+ * ```
561
+ *
562
+ * @example
563
+ * In a custom grid setup:
564
+ * ```tsx
565
+ * <Box>
566
+ * <SimpleToolbar />
567
+ * <DataGrid
568
+ * rows={filteredData}
569
+ * columns={visibleColumns}
570
+ * hideFooter
571
+ * />
572
+ * </Box>
573
+ * ```
574
+ *
575
+ * @returns GridToolbarContainer with pre-configured toolbar elements
576
+ *
577
+ * @public
578
+ */
83
579
  declare const SimpleToolbar: () => react_jsx_runtime.JSX.Element;
84
580
 
85
- type SimpleButtonProps<RootComponent extends React.ElementType = ButtonTypeMap["defaultComponent"], AdditionalProps = {}> = OverrideProps<ButtonTypeMap<AdditionalProps, RootComponent>, RootComponent> & {
86
- component?: React.ElementType;
581
+ /**
582
+ * Props for the SimpleButton component.
583
+ *
584
+ * @public
585
+ */
586
+ interface SimpleButtonProps extends ButtonProps {
587
+ /**
588
+ * Controls button visibility. When false, the component returns null.
589
+ * @defaultValue true
590
+ */
87
591
  show?: boolean;
88
- };
89
- declare const SimpleButton: (props: SimpleButtonProps) => react_jsx_runtime.JSX.Element;
592
+ /**
593
+ * Loading state with spinner. When true, shows a loading spinner and disables the button.
594
+ * @defaultValue false
595
+ */
596
+ loading?: boolean;
597
+ /**
598
+ * Test identifier for testing frameworks.
599
+ * @example "submit-button"
600
+ */
601
+ 'data-testid'?: string;
602
+ /**
603
+ * Custom text to display when loading is true. If not provided, original children are shown.
604
+ * @example "Saving..."
605
+ */
606
+ loadingText?: string;
607
+ }
608
+ /**
609
+ * Enhanced MUI Button component with loading states and conditional rendering.
610
+ *
611
+ * This component extends the standard MUI Button with additional features:
612
+ * - Loading state with spinner
613
+ * - Conditional rendering based on show prop
614
+ * - Automatic disabling during loading
615
+ * - Custom loading text support
616
+ *
617
+ * @example
618
+ * Basic usage:
619
+ * ```tsx
620
+ * <SimpleButton variant="contained" color="primary">
621
+ * Click Me
622
+ * </SimpleButton>
623
+ * ```
624
+ *
625
+ * @example
626
+ * With loading state:
627
+ * ```tsx
628
+ * <SimpleButton
629
+ * loading={isSubmitting}
630
+ * loadingText="Saving..."
631
+ * variant="contained"
632
+ * >
633
+ * Save Changes
634
+ * </SimpleButton>
635
+ * ```
636
+ *
637
+ * @example
638
+ * Conditional rendering:
639
+ * ```tsx
640
+ * <SimpleButton
641
+ * show={hasPermission}
642
+ * variant="outlined"
643
+ * >
644
+ * Admin Action
645
+ * </SimpleButton>
646
+ * ```
647
+ *
648
+ * @param props - Component props extending MUI ButtonProps
649
+ * @param ref - Forwarded ref to the underlying button element
650
+ * @returns JSX element or null if show is false
651
+ *
652
+ * @public
653
+ */
654
+ declare const SimpleButton: React$1.NamedExoticComponent<Omit<SimpleButtonProps, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
90
655
 
656
+ /**
657
+ * Props for the AuthorizedView component.
658
+ *
659
+ * @public
660
+ */
91
661
  type AuthorizedViewProps = PropsWithChildren & {
662
+ /**
663
+ * Controls whether the children should be rendered. When false, nothing is rendered.
664
+ * @example true - Show content, false - Hide content
665
+ */
92
666
  show: boolean;
93
667
  };
668
+ /**
669
+ * Conditional rendering component that shows or hides content based on authorization state.
670
+ *
671
+ * This component provides a simple way to conditionally render child components
672
+ * based on a boolean flag, typically used for authorization or permission-based rendering.
673
+ *
674
+ * @example
675
+ * Basic usage:
676
+ * ```tsx
677
+ * <AuthorizedView show={hasPermission}>
678
+ * <AdminPanel />
679
+ * </AuthorizedView>
680
+ * ```
681
+ *
682
+ * @example
683
+ * With user roles:
684
+ * ```tsx
685
+ * <AuthorizedView show={user.role === 'admin'}>
686
+ * <DeleteButton />
687
+ * </AuthorizedView>
688
+ * ```
689
+ *
690
+ * @param props - Component props including children and show flag
691
+ * @returns JSX children if show is true, empty fragment if false
692
+ *
693
+ * @public
694
+ */
94
695
  declare const AuthorizedView: ({ children, show }: AuthorizedViewProps) => react_jsx_runtime.JSX.Element;
95
696
 
96
- type CancelButtonProps = {
697
+ /**
698
+ * Props for the CancelButton component.
699
+ *
700
+ * @public
701
+ */
702
+ interface CancelButtonProps {
703
+ /**
704
+ * Indicates if a form or operation is currently being submitted.
705
+ * When true, the button is disabled to prevent multiple cancel actions.
706
+ */
97
707
  isSubmitting: boolean;
708
+ /**
709
+ * Callback function executed when the cancel button is clicked.
710
+ * Should handle the cancellation logic (e.g., form reset, navigation, etc.).
711
+ */
98
712
  handleCancel: () => void;
713
+ /**
714
+ * Optional MUI sx prop for custom styling.
715
+ * @example { mt: 2, bgcolor: 'error.main' }
716
+ */
99
717
  sx?: SxProps;
100
- };
718
+ }
719
+ /**
720
+ * Standardized cancel button component with submission state handling.
721
+ *
722
+ * This component provides a consistent cancel button implementation that automatically
723
+ * handles disabled states during form submissions. It's designed to be used in forms
724
+ * and dialogs where users need to cancel operations.
725
+ *
726
+ * @example
727
+ * Basic usage in a form:
728
+ * ```tsx
729
+ * <CancelButton
730
+ * isSubmitting={isLoading}
731
+ * handleCancel={() => navigate('/previous-page')}
732
+ * />
733
+ * ```
734
+ *
735
+ * @example
736
+ * With custom styling:
737
+ * ```tsx
738
+ * <CancelButton
739
+ * isSubmitting={form.formState.isSubmitting}
740
+ * handleCancel={form.reset}
741
+ * sx={{ mt: 2, color: 'error.main' }}
742
+ * />
743
+ * ```
744
+ *
745
+ * @param props - Component props for cancel button configuration
746
+ * @returns MUI Button component configured as a cancel button
747
+ *
748
+ * @public
749
+ */
101
750
  declare const CancelButton: ({ isSubmitting, handleCancel, sx, }: CancelButtonProps) => react_jsx_runtime.JSX.Element;
102
751
 
103
752
  export { AuthorizedView, CancelButton, ClearButton, FilterButton, FilterWrapper, FormWrapper, LabelText, ListWrapper, SimpleButton, SimpleToolbar };