@gnwebsoft/ui 4.0.0 → 4.0.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/chunk-246MYJX6.js +479 -0
- package/dist/chunk-CE4CSA36.cjs +2262 -0
- package/dist/chunk-DJSMLHFO.js +140 -0
- package/dist/chunk-GHW77WIM.cjs +72 -0
- package/dist/chunk-L3QQX3BK.js +1596 -0
- package/dist/chunk-MULSVYFT.js +72 -0
- package/dist/chunk-MVPLBJRK.cjs +1 -1
- package/dist/chunk-NC3JINIM.cjs +1596 -0
- package/dist/chunk-R45OPW5A.js +2262 -0
- package/dist/chunk-UEBN47RB.cjs +140 -0
- package/dist/chunk-YUVXLOSA.cjs +479 -0
- package/dist/core/index.cjs +121 -0
- package/dist/core/index.js +121 -0
- package/dist/hooks/index.cjs +3 -3
- package/dist/hooks/index.js +1 -1
- package/dist/index.cjs +81 -7
- package/dist/index.js +126 -52
- package/dist/types/index.cjs +3 -3
- package/dist/types/index.js +1 -1
- package/dist/utils/index.cjs +3 -25
- package/dist/utils/index.js +3 -25
- package/dist/wrappers/index.cjs +4 -4
- package/dist/wrappers/index.js +16 -16
- package/package.json +22 -17
- package/dist/AsyncSelectPayload-B9-6l33R.d.cts +0 -10
- package/dist/AsyncSelectPayload-B9-6l33R.d.ts +0 -10
- package/dist/chunk-3OPVOWQK.js +0 -140
- package/dist/chunk-AEOF2TUF.cjs +0 -2273
- package/dist/chunk-ALHC7RLK.js +0 -575
- package/dist/chunk-BRRLB22L.js +0 -72
- package/dist/chunk-CHZU4PZB.js +0 -2273
- package/dist/chunk-EBRUE2WR.cjs +0 -493
- package/dist/chunk-HEHPKM4B.cjs +0 -140
- package/dist/chunk-K2EJ4YKO.cjs +0 -72
- package/dist/chunk-U6SDYCWF.js +0 -493
- package/dist/chunk-XY4U6A77.cjs +0 -575
- package/dist/components/index.cjs +0 -25
- package/dist/components/index.d.cts +0 -752
- package/dist/components/index.d.ts +0 -752
- package/dist/components/index.js +0 -25
- package/dist/enhanced-CDTkKUlj.d.ts +0 -134
- package/dist/enhanced-ZQoS03Cd.d.cts +0 -134
- package/dist/events-BcHVCLBz.d.cts +0 -77
- package/dist/events-BcHVCLBz.d.ts +0 -77
- package/dist/hooks/index.d.cts +0 -96
- package/dist/hooks/index.d.ts +0 -96
- package/dist/index.d.cts +0 -16
- package/dist/index.d.ts +0 -16
- package/dist/types/index.d.cts +0 -820
- package/dist/types/index.d.ts +0 -820
- package/dist/utils/index.d.cts +0 -683
- package/dist/utils/index.d.ts +0 -683
- package/dist/wrappers/index.d.cts +0 -1753
- package/dist/wrappers/index.d.ts +0 -1753
|
@@ -1,752 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { SxProps, ButtonProps } from '@mui/material';
|
|
3
|
-
import React__default, { PropsWithChildren, ReactNode } from 'react';
|
|
4
|
-
|
|
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
|
-
*/
|
|
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
|
-
*/
|
|
20
|
-
handleClear: () => void;
|
|
21
|
-
/**
|
|
22
|
-
* Optional MUI sx prop for custom styling.
|
|
23
|
-
* @example { mt: 2, color: 'warning.main' }
|
|
24
|
-
*/
|
|
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
|
-
*/
|
|
31
|
-
storeKey?: string;
|
|
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
|
-
*/
|
|
64
|
-
declare const ClearButton: ({ isSubmitting, handleClear, sx, storeKey, }: ClearButtonProps) => react_jsx_runtime.JSX.Element;
|
|
65
|
-
|
|
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
|
-
*/
|
|
76
|
-
isSubmitting: boolean;
|
|
77
|
-
/**
|
|
78
|
-
* Controls button visibility and enabled state.
|
|
79
|
-
* When false, the button is disabled.
|
|
80
|
-
* @defaultValue true
|
|
81
|
-
*/
|
|
82
|
-
show?: boolean;
|
|
83
|
-
/**
|
|
84
|
-
* Custom text to display on the button.
|
|
85
|
-
* @defaultValue "Filter"
|
|
86
|
-
* @example "Apply Filters" or "Search"
|
|
87
|
-
*/
|
|
88
|
-
title?: string;
|
|
89
|
-
/**
|
|
90
|
-
* Custom icon to display instead of the default filter icon.
|
|
91
|
-
* @example <SearchIcon />
|
|
92
|
-
*/
|
|
93
|
-
icon?: React.ReactNode;
|
|
94
|
-
/**
|
|
95
|
-
* Optional MUI sx prop for custom button styling.
|
|
96
|
-
* @example { mt: 2, minWidth: 120 }
|
|
97
|
-
*/
|
|
98
|
-
sx?: SxProps;
|
|
99
|
-
/**
|
|
100
|
-
* Optional MUI sx prop for custom icon styling.
|
|
101
|
-
* @example { color: 'primary.main', fontSize: 18 }
|
|
102
|
-
*/
|
|
103
|
-
iconSx?: SxProps;
|
|
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
|
-
*/
|
|
148
|
-
declare const FilterButton: ({ isSubmitting, show, title, icon, sx, iconSx, }: FilterButtonProps) => react_jsx_runtime.JSX.Element;
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
* Props for the FilterWrapper component.
|
|
152
|
-
*
|
|
153
|
-
* @public
|
|
154
|
-
*/
|
|
155
|
-
type FilterWrapperProps = PropsWithChildren<{
|
|
156
|
-
/**
|
|
157
|
-
* Title text displayed in the card header.
|
|
158
|
-
* @defaultValue "Filter"
|
|
159
|
-
* @example "Search Criteria" or "Advanced Filters"
|
|
160
|
-
*/
|
|
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
|
-
*/
|
|
167
|
-
filterCount?: number;
|
|
168
|
-
/**
|
|
169
|
-
* Optional MUI sx prop for custom card styling.
|
|
170
|
-
* @example { mt: 2, boxShadow: 2 }
|
|
171
|
-
*/
|
|
172
|
-
cardSx?: SxProps;
|
|
173
|
-
/**
|
|
174
|
-
* Optional MUI sx prop for custom title text styling.
|
|
175
|
-
* @example { fontSize: 18, fontWeight: 'bold' }
|
|
176
|
-
*/
|
|
177
|
-
textSx?: SxProps;
|
|
178
|
-
/**
|
|
179
|
-
* Custom icon to display instead of the default search icon.
|
|
180
|
-
* @example <FilterListIcon />
|
|
181
|
-
*/
|
|
182
|
-
icon?: ReactNode;
|
|
183
|
-
/**
|
|
184
|
-
* Optional MUI sx prop for custom icon styling.
|
|
185
|
-
* @example { color: 'secondary.main', fontSize: 24 }
|
|
186
|
-
*/
|
|
187
|
-
iconSx?: SxProps;
|
|
188
|
-
/**
|
|
189
|
-
* Whether to display the filter count in the header.
|
|
190
|
-
* @defaultValue false
|
|
191
|
-
*/
|
|
192
|
-
showCount?: boolean;
|
|
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
|
-
*/
|
|
244
|
-
declare const FilterWrapper: ({ children, title, filterCount, cardSx, textSx, icon, iconSx, showCount, }: FilterWrapperProps) => react_jsx_runtime.JSX.Element;
|
|
245
|
-
|
|
246
|
-
/**
|
|
247
|
-
* Props for the FormWrapper component.
|
|
248
|
-
*
|
|
249
|
-
* @public
|
|
250
|
-
*/
|
|
251
|
-
type FormWrapper = PropsWithChildren<{
|
|
252
|
-
/**
|
|
253
|
-
* Title text displayed in the form header.
|
|
254
|
-
* @example "Create User" or "Edit Profile"
|
|
255
|
-
*/
|
|
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
|
-
*/
|
|
261
|
-
editMode?: boolean;
|
|
262
|
-
/**
|
|
263
|
-
* Custom icon to display in the header next to the title.
|
|
264
|
-
* @example <PersonIcon /> or <EditIcon />
|
|
265
|
-
*/
|
|
266
|
-
icon?: ReactNode;
|
|
267
|
-
/**
|
|
268
|
-
* Optional MUI sx prop for custom card styling.
|
|
269
|
-
* @example { mt: 2, maxWidth: 600 }
|
|
270
|
-
*/
|
|
271
|
-
cardSx?: SxProps;
|
|
272
|
-
/**
|
|
273
|
-
* Optional MUI sx prop for custom title text styling.
|
|
274
|
-
* @example { fontSize: 20, fontWeight: 'bold' }
|
|
275
|
-
*/
|
|
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
|
-
*/
|
|
281
|
-
actionButton?: ReactNode;
|
|
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
|
-
*/
|
|
324
|
-
declare const FormWrapper: ({ children, title, editMode, cardSx, textSx, icon, actionButton, }: FormWrapper) => react_jsx_runtime.JSX.Element;
|
|
325
|
-
|
|
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
|
-
*/
|
|
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
|
-
*/
|
|
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
|
-
*/
|
|
347
|
-
gridSize?: {
|
|
348
|
-
/** Grid size configuration for the label section */
|
|
349
|
-
labelSize: {
|
|
350
|
-
xs: number;
|
|
351
|
-
sm: number;
|
|
352
|
-
md: number;
|
|
353
|
-
};
|
|
354
|
-
/** Grid size configuration for the value section */
|
|
355
|
-
valueSize: {
|
|
356
|
-
xs: number;
|
|
357
|
-
sm: number;
|
|
358
|
-
md: number;
|
|
359
|
-
};
|
|
360
|
-
};
|
|
361
|
-
/**
|
|
362
|
-
* Grid size configuration for the entire container.
|
|
363
|
-
* @defaultValue { xs: 12, sm: 6, md: 6 }
|
|
364
|
-
*/
|
|
365
|
-
containerSize?: {
|
|
366
|
-
xs: number;
|
|
367
|
-
sm: number;
|
|
368
|
-
md: number;
|
|
369
|
-
};
|
|
370
|
-
/**
|
|
371
|
-
* Optional MUI sx prop for custom label styling.
|
|
372
|
-
* @example { fontWeight: 'bold', color: 'primary.main' }
|
|
373
|
-
*/
|
|
374
|
-
labelSx?: SxProps;
|
|
375
|
-
/**
|
|
376
|
-
* Optional MUI sx prop for custom value styling.
|
|
377
|
-
* @example { color: 'text.secondary', fontStyle: 'italic' }
|
|
378
|
-
*/
|
|
379
|
-
valueSx?: SxProps;
|
|
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
|
-
*/
|
|
425
|
-
declare const LabelText: ({ label, value, gridSize, containerSize, labelSx, valueSx, }: LabelTextProps) => react_jsx_runtime.JSX.Element;
|
|
426
|
-
|
|
427
|
-
/**
|
|
428
|
-
* Props for the ListWrapper component.
|
|
429
|
-
*
|
|
430
|
-
* @public
|
|
431
|
-
*/
|
|
432
|
-
type ListWrapperProps = PropsWithChildren<{
|
|
433
|
-
/**
|
|
434
|
-
* Title text displayed in the card header.
|
|
435
|
-
* @defaultValue "List"
|
|
436
|
-
* @example "User List" or "Product Catalog"
|
|
437
|
-
*/
|
|
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
|
-
*/
|
|
444
|
-
count?: number;
|
|
445
|
-
/**
|
|
446
|
-
* Controls whether the entire component is rendered.
|
|
447
|
-
* When false, returns an empty fragment.
|
|
448
|
-
* @defaultValue true
|
|
449
|
-
*/
|
|
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
|
-
*/
|
|
455
|
-
actionButton?: ReactNode;
|
|
456
|
-
/**
|
|
457
|
-
* Optional MUI sx prop for custom card styling.
|
|
458
|
-
* @example { mt: 2, boxShadow: 3 }
|
|
459
|
-
*/
|
|
460
|
-
cardSx?: SxProps;
|
|
461
|
-
/**
|
|
462
|
-
* Optional MUI sx prop for custom title text styling.
|
|
463
|
-
* @example { fontSize: 18, color: 'secondary.main' }
|
|
464
|
-
*/
|
|
465
|
-
textSx?: SxProps;
|
|
466
|
-
/**
|
|
467
|
-
* Custom icon to display instead of the default search icon.
|
|
468
|
-
* @example <ListIcon /> or <TableRowsIcon />
|
|
469
|
-
*/
|
|
470
|
-
icon?: ReactNode;
|
|
471
|
-
/**
|
|
472
|
-
* Whether to display the count in the header.
|
|
473
|
-
* @defaultValue true
|
|
474
|
-
*/
|
|
475
|
-
showCount?: boolean;
|
|
476
|
-
/**
|
|
477
|
-
* Optional MUI sx prop for custom icon styling.
|
|
478
|
-
* @example { color: 'primary.main', fontSize: 28 }
|
|
479
|
-
*/
|
|
480
|
-
iconSx?: SxProps;
|
|
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
|
-
*/
|
|
534
|
-
declare const ListWrapper: ({ children, title, count, show, actionButton, cardSx, textSx, icon, iconSx, showCount, }: ListWrapperProps) => react_jsx_runtime.JSX.Element;
|
|
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
|
-
*/
|
|
579
|
-
declare const SimpleToolbar: () => react_jsx_runtime.JSX.Element;
|
|
580
|
-
|
|
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
|
-
*/
|
|
591
|
-
show?: boolean;
|
|
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__default.NamedExoticComponent<Omit<SimpleButtonProps, "ref"> & React__default.RefAttributes<HTMLButtonElement>>;
|
|
655
|
-
|
|
656
|
-
/**
|
|
657
|
-
* Props for the AuthorizedView component.
|
|
658
|
-
*
|
|
659
|
-
* @public
|
|
660
|
-
*/
|
|
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
|
-
*/
|
|
666
|
-
show: boolean;
|
|
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
|
-
*/
|
|
695
|
-
declare const AuthorizedView: ({ children, show }: AuthorizedViewProps) => react_jsx_runtime.JSX.Element;
|
|
696
|
-
|
|
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
|
-
*/
|
|
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
|
-
*/
|
|
712
|
-
handleCancel: () => void;
|
|
713
|
-
/**
|
|
714
|
-
* Optional MUI sx prop for custom styling.
|
|
715
|
-
* @example { mt: 2, bgcolor: 'error.main' }
|
|
716
|
-
*/
|
|
717
|
-
sx?: SxProps;
|
|
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
|
-
*/
|
|
750
|
-
declare const CancelButton: ({ isSubmitting, handleCancel, sx, }: CancelButtonProps) => react_jsx_runtime.JSX.Element;
|
|
751
|
-
|
|
752
|
-
export { AuthorizedView, CancelButton, ClearButton, FilterButton, FilterWrapper, FormWrapper, LabelText, ListWrapper, SimpleButton, SimpleToolbar };
|