@konstructio/ui 0.1.2-alpha.47 → 0.1.2-alpha.49
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/assets/icons/index.js +7 -0
- package/dist/components/Badge/Badge.js +36 -35
- package/dist/components/Counter/Counter.js +23 -23
- package/dist/components/ImageUpload/ImageUpload.js +8 -8
- package/dist/components/Input/Input.js +185 -118
- package/dist/components/Input/Input.variants.js +16 -20
- package/dist/components/MultiSelectDropdown/MultiSelectDropdown.js +19 -19
- package/dist/components/MultiSelectDropdown/MultiSelectDropdown.variants.js +11 -15
- package/dist/components/MultiSelectDropdown/components/Item/Item.js +18 -26
- package/dist/components/MultiSelectDropdown/components/Item/Item.variants.js +8 -8
- package/dist/components/MultiSelectDropdown/components/List/List.js +12 -19
- package/dist/components/MultiSelectDropdown/components/List/List.variants.js +6 -4
- package/dist/components/MultiSelectDropdown/components/Wrapper/Wrapper.js +79 -65
- package/dist/components/PhoneNumberInput/components/Wrapper.js +43 -36
- package/dist/components/RadioGroup/RadioGroup.js +9 -9
- package/dist/components/Select/components/Wrapper.js +1 -1
- package/dist/components/TimePicker/components/Wrapper/Wrapper.js +1 -1
- package/dist/components/Typography/Typography.variants.js +6 -1
- package/dist/components/VirtualizedTable/VirtualizedTable.js +14 -14
- package/dist/components/VirtualizedTable/components/Actions/Actions.js +20 -16
- package/dist/components/VirtualizedTable/components/DotPaginate/DotPaginate.js +60 -60
- package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +8 -8
- package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +32 -21
- package/dist/components/VirtualizedTable/components/Header/Header.js +15 -15
- package/dist/components/VirtualizedTable/components/Pagination/Pagination.js +8 -8
- package/dist/index.d.ts +1875 -10
- package/dist/package.json +4 -4
- package/dist/styles.css +1 -1
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -35,30 +35,128 @@ declare type Action<TData> = {
|
|
|
35
35
|
className?: string;
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
+
/**
|
|
39
|
+
* An alert component for displaying feedback messages.
|
|
40
|
+
* Supports success, error, warning, and info variants with optional dismiss button.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```tsx
|
|
44
|
+
* // Success alert
|
|
45
|
+
* <Alert type="success" content="Changes saved successfully!" />
|
|
46
|
+
*
|
|
47
|
+
* // Error alert with close button
|
|
48
|
+
* <Alert
|
|
49
|
+
* type="error"
|
|
50
|
+
* content="Failed to save changes. Please try again."
|
|
51
|
+
* showCloseButton
|
|
52
|
+
* />
|
|
53
|
+
*
|
|
54
|
+
* // Warning alert with custom content
|
|
55
|
+
* <Alert
|
|
56
|
+
* type="warning"
|
|
57
|
+
* content={
|
|
58
|
+
* <div>
|
|
59
|
+
* <strong>Warning:</strong> This action cannot be undone.
|
|
60
|
+
* </div>
|
|
61
|
+
* }
|
|
62
|
+
* />
|
|
63
|
+
* ```
|
|
64
|
+
*
|
|
65
|
+
* @see {@link https://konstructio.github.io/konstruct-ui/?path=/docs/components-alert--docs Storybook}
|
|
66
|
+
*/
|
|
38
67
|
export declare const Alert: FC<AlertProps>;
|
|
39
68
|
|
|
69
|
+
/**
|
|
70
|
+
* A confirmation dialog component built on Radix UI AlertDialog.
|
|
71
|
+
* Includes a trigger button that opens a modal with title, description, and action buttons.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```tsx
|
|
75
|
+
* // Basic confirmation dialog
|
|
76
|
+
* <AlertDialog
|
|
77
|
+
* buttonTriggerText="Delete Item"
|
|
78
|
+
* title="Confirm Deletion"
|
|
79
|
+
* description="This action cannot be undone."
|
|
80
|
+
* onConfirm={() => deleteItem()}
|
|
81
|
+
* />
|
|
82
|
+
*
|
|
83
|
+
* // Danger variant with custom button text
|
|
84
|
+
* <AlertDialog
|
|
85
|
+
* buttonTriggerText="Remove"
|
|
86
|
+
* buttonTriggerVariant="danger"
|
|
87
|
+
* title="Remove User"
|
|
88
|
+
* description="Are you sure you want to remove this user?"
|
|
89
|
+
* buttonConfirm={{ text: "Yes, Remove" }}
|
|
90
|
+
* buttonCancel={{ text: "No, Keep" }}
|
|
91
|
+
* onConfirm={() => removeUser()}
|
|
92
|
+
* />
|
|
93
|
+
* ```
|
|
94
|
+
*
|
|
95
|
+
* @see {@link https://konstructio.github.io/konstruct-ui/?path=/docs/components-alertdialog--docs Storybook}
|
|
96
|
+
*/
|
|
40
97
|
export declare const AlertDialog: FC<AlertDialogProps>;
|
|
41
98
|
|
|
99
|
+
/**
|
|
100
|
+
* Props for the AlertDialog component.
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```tsx
|
|
104
|
+
* <AlertDialog
|
|
105
|
+
* buttonTriggerText="Delete"
|
|
106
|
+
* buttonTriggerVariant="danger"
|
|
107
|
+
* title="Confirm Deletion"
|
|
108
|
+
* description="Are you sure you want to delete this item?"
|
|
109
|
+
* onConfirm={() => handleDelete()}
|
|
110
|
+
* />
|
|
111
|
+
* ```
|
|
112
|
+
*/
|
|
42
113
|
declare interface AlertDialogProps extends PropsWithChildren, AlertDialogProps_2 {
|
|
114
|
+
/** Cancel button props (className, text, etc.) */
|
|
43
115
|
buttonCancel?: ButtonCancelProps;
|
|
116
|
+
/** Confirm button props (className, text, etc.) */
|
|
44
117
|
buttonConfirm?: ButtonConfirmProps;
|
|
118
|
+
/** Text for the trigger button */
|
|
45
119
|
buttonTriggerText?: string;
|
|
120
|
+
/** CSS classes for the trigger button */
|
|
46
121
|
buttonTriggerClassName?: string;
|
|
122
|
+
/** Variant for the trigger button */
|
|
47
123
|
buttonTriggerVariant?: ButtonProps['variant'];
|
|
124
|
+
/** Additional CSS classes */
|
|
48
125
|
className?: string;
|
|
126
|
+
/** Description text shown in the dialog */
|
|
49
127
|
description?: string | ReactNode;
|
|
128
|
+
/** Whether to show the cancel button (default: true) */
|
|
50
129
|
showCancelButton?: boolean;
|
|
130
|
+
/** Theme override for this component */
|
|
51
131
|
theme?: Theme;
|
|
132
|
+
/** Title text shown in the dialog */
|
|
52
133
|
title?: string | ReactNode;
|
|
134
|
+
/** CSS classes for the dialog wrapper */
|
|
53
135
|
wrapperClassName?: string;
|
|
136
|
+
/** Callback when confirm button is clicked */
|
|
54
137
|
onConfirm?: () => void;
|
|
55
138
|
}
|
|
56
139
|
|
|
140
|
+
/**
|
|
141
|
+
* Props for the Alert component.
|
|
142
|
+
*
|
|
143
|
+
* @example
|
|
144
|
+
* ```tsx
|
|
145
|
+
* <Alert type="success" content="Operation completed successfully!" />
|
|
146
|
+
* <Alert type="error" content="Something went wrong" showCloseButton />
|
|
147
|
+
* <Alert type="warning" content={<span>Warning: <strong>Action required</strong></span>} />
|
|
148
|
+
* ```
|
|
149
|
+
*/
|
|
57
150
|
declare interface AlertProps extends VariantProps<typeof alertVariants> {
|
|
151
|
+
/** Whether the alert can be dismissed (deprecated, use showCloseButton) */
|
|
58
152
|
dismissible?: boolean;
|
|
153
|
+
/** Alert message content (string or ReactNode) */
|
|
59
154
|
content: string | ReactNode;
|
|
155
|
+
/** Whether the alert is visible */
|
|
60
156
|
isVisible?: boolean;
|
|
157
|
+
/** Show close button to dismiss alert */
|
|
61
158
|
showCloseButton?: boolean;
|
|
159
|
+
/** Theme override for this component */
|
|
62
160
|
theme?: Theme;
|
|
63
161
|
}
|
|
64
162
|
|
|
@@ -67,24 +165,107 @@ declare const alertVariants: (props?: ({
|
|
|
67
165
|
isVisible?: boolean | null | undefined;
|
|
68
166
|
} & ClassProp) | undefined) => string;
|
|
69
167
|
|
|
168
|
+
/**
|
|
169
|
+
* An autocomplete/typeahead input component that suggests options as you type.
|
|
170
|
+
*
|
|
171
|
+
* @example
|
|
172
|
+
* ```tsx
|
|
173
|
+
* // Basic autocomplete
|
|
174
|
+
* <Autocomplete
|
|
175
|
+
* label="Programming Language"
|
|
176
|
+
* options={[
|
|
177
|
+
* { value: 'JavaScript' },
|
|
178
|
+
* { value: 'TypeScript' },
|
|
179
|
+
* { value: 'Python' },
|
|
180
|
+
* ]}
|
|
181
|
+
* placeholder="Type to search..."
|
|
182
|
+
* onChange={(value) => setLanguage(value)}
|
|
183
|
+
* />
|
|
184
|
+
*
|
|
185
|
+
* // With custom empty state
|
|
186
|
+
* <Autocomplete
|
|
187
|
+
* options={users}
|
|
188
|
+
* placeholder="Search users..."
|
|
189
|
+
* placeHolderEmptyValues="No users found"
|
|
190
|
+
* onChange={handleUserSelect}
|
|
191
|
+
* />
|
|
192
|
+
* ```
|
|
193
|
+
*
|
|
194
|
+
* @see {@link https://konstructio.github.io/konstruct-ui/?path=/docs/components-autocomplete--docs Storybook}
|
|
195
|
+
*/
|
|
70
196
|
export declare const Autocomplete: ForwardRefExoticComponent<AutocompleteProps & RefAttributes<HTMLInputElement>>;
|
|
71
197
|
|
|
198
|
+
/**
|
|
199
|
+
* Props for the Autocomplete component.
|
|
200
|
+
*
|
|
201
|
+
* @example
|
|
202
|
+
* ```tsx
|
|
203
|
+
* <Autocomplete
|
|
204
|
+
* label="Search"
|
|
205
|
+
* options={[{ value: 'React' }, { value: 'Vue' }, { value: 'Angular' }]}
|
|
206
|
+
* placeholder="Search frameworks..."
|
|
207
|
+
* onChange={(value) => console.log(value)}
|
|
208
|
+
* />
|
|
209
|
+
* ```
|
|
210
|
+
*/
|
|
72
211
|
declare interface AutocompleteProps extends VariantProps<typeof autocompleteVariants> {
|
|
212
|
+
/** Disable browser autocomplete (default: 'off') */
|
|
73
213
|
autoComplete?: 'off';
|
|
214
|
+
/** Additional CSS classes */
|
|
74
215
|
className?: string;
|
|
216
|
+
/** Label displayed above the input */
|
|
75
217
|
label?: string;
|
|
218
|
+
/** CSS classes for the label */
|
|
76
219
|
labelClassName?: string;
|
|
220
|
+
/** Form field name */
|
|
77
221
|
name?: string;
|
|
222
|
+
/** Array of options to suggest */
|
|
78
223
|
options: Option_3[];
|
|
224
|
+
/** Placeholder text */
|
|
79
225
|
placeholder?: string;
|
|
226
|
+
/** Text shown when no options match */
|
|
80
227
|
placeHolderEmptyValues?: string | ReactNode;
|
|
228
|
+
/** CSS classes for empty state text */
|
|
81
229
|
placeHolderEmptyValuesClassName?: string;
|
|
230
|
+
/** Theme override for this component */
|
|
82
231
|
theme?: Theme;
|
|
232
|
+
/** Callback when a value is selected */
|
|
83
233
|
onChange(value: string): void;
|
|
84
234
|
}
|
|
85
235
|
|
|
86
236
|
declare const autocompleteVariants: (props?: ClassProp | undefined) => string;
|
|
87
237
|
|
|
238
|
+
/**
|
|
239
|
+
* A badge/tag component for status indicators and labels.
|
|
240
|
+
* Supports multiple variants, icons, loading state, and dismissible mode.
|
|
241
|
+
*
|
|
242
|
+
* @example
|
|
243
|
+
* ```tsx
|
|
244
|
+
* // Basic badge
|
|
245
|
+
* <Badge label="Active" variant="success" />
|
|
246
|
+
*
|
|
247
|
+
* // Badge with icon
|
|
248
|
+
* <Badge label="Settings" leftIcon={<SettingsIcon />} />
|
|
249
|
+
*
|
|
250
|
+
* // Dismissible badge
|
|
251
|
+
* <Badge
|
|
252
|
+
* label="Tag"
|
|
253
|
+
* dismissible
|
|
254
|
+
* onDismiss={() => removeTag()}
|
|
255
|
+
* />
|
|
256
|
+
*
|
|
257
|
+
* // Clickable badge
|
|
258
|
+
* <Badge
|
|
259
|
+
* label="Filter"
|
|
260
|
+
* onClick={() => applyFilter()}
|
|
261
|
+
* />
|
|
262
|
+
*
|
|
263
|
+
* // Loading badge
|
|
264
|
+
* <Badge label="Processing" loading />
|
|
265
|
+
* ```
|
|
266
|
+
*
|
|
267
|
+
* @see {@link https://konstructio.github.io/konstruct-ui/?path=/docs/components-badge--docs Storybook}
|
|
268
|
+
*/
|
|
88
269
|
export declare const Badge: FC<BadgeProps>;
|
|
89
270
|
|
|
90
271
|
export declare const BadgeMultiSelect: FC<BadgeMultiSelectProps>;
|
|
@@ -96,14 +277,35 @@ declare type BadgeMultiSelectProps = {
|
|
|
96
277
|
onApply?: (selectedOptions: Option_5[]) => void;
|
|
97
278
|
};
|
|
98
279
|
|
|
280
|
+
/**
|
|
281
|
+
* Props for the Badge component.
|
|
282
|
+
*
|
|
283
|
+
* @example
|
|
284
|
+
* ```tsx
|
|
285
|
+
* <Badge label="New" variant="success" />
|
|
286
|
+
* <Badge label="Pending" variant="warning" />
|
|
287
|
+
* <Badge label="Error" variant="error" dismissible onDismiss={() => {}} />
|
|
288
|
+
* <Badge label="With Icon" leftIcon={<Icon />} />
|
|
289
|
+
* ```
|
|
290
|
+
*/
|
|
99
291
|
declare type BadgeProps = VariantProps<typeof badgeVariants> & {
|
|
292
|
+
/** Additional CSS classes */
|
|
100
293
|
className?: string;
|
|
294
|
+
/** Show dismiss button */
|
|
101
295
|
dismissible?: true;
|
|
296
|
+
/** Allow text selection (default: true) */
|
|
297
|
+
isSelectable?: boolean;
|
|
298
|
+
/** Badge text content */
|
|
102
299
|
label: string;
|
|
300
|
+
/** Icon displayed on the left */
|
|
103
301
|
leftIcon?: ReactNode;
|
|
302
|
+
/** Show loading spinner */
|
|
104
303
|
loading?: boolean;
|
|
105
|
-
|
|
304
|
+
/** Icon displayed on the right (when not dismissible) */
|
|
305
|
+
rightIcon?: ReactNode;
|
|
306
|
+
/** Click handler (makes badge interactive) */
|
|
106
307
|
onClick?: VoidFunction;
|
|
308
|
+
/** Callback when dismiss button clicked */
|
|
107
309
|
onDismiss?: VoidFunction;
|
|
108
310
|
};
|
|
109
311
|
|
|
@@ -112,21 +314,96 @@ declare const badgeVariants: (props?: ({
|
|
|
112
314
|
size?: "default" | null | undefined;
|
|
113
315
|
} & ClassProp) | undefined) => string;
|
|
114
316
|
|
|
317
|
+
/**
|
|
318
|
+
* Props for Table.Body component.
|
|
319
|
+
*/
|
|
115
320
|
declare interface BodyProps extends React.HTMLAttributes<HTMLTableSectionElement>, PropsWithChildren, VariantProps<typeof bodyVariants> {
|
|
116
321
|
}
|
|
117
322
|
|
|
118
323
|
declare const bodyVariants: (props?: ClassProp | undefined) => string;
|
|
119
324
|
|
|
325
|
+
/**
|
|
326
|
+
* A breadcrumb navigation component showing the current location in a hierarchy.
|
|
327
|
+
*
|
|
328
|
+
* @example
|
|
329
|
+
* ```tsx
|
|
330
|
+
* // Basic breadcrumb
|
|
331
|
+
* <Breadcrumb
|
|
332
|
+
* steps={[
|
|
333
|
+
* { label: 'Home', to: '/' },
|
|
334
|
+
* { label: 'Settings', to: '/settings' },
|
|
335
|
+
* { label: 'Profile', isActive: true },
|
|
336
|
+
* ]}
|
|
337
|
+
* />
|
|
338
|
+
*
|
|
339
|
+
* // With custom Link component (e.g., react-router)
|
|
340
|
+
* <Breadcrumb
|
|
341
|
+
* steps={[
|
|
342
|
+
* { label: 'Dashboard', to: '/dashboard', component: Link },
|
|
343
|
+
* { label: 'Users', to: '/users', component: Link },
|
|
344
|
+
* { label: 'Edit User', isActive: true },
|
|
345
|
+
* ]}
|
|
346
|
+
* />
|
|
347
|
+
* ```
|
|
348
|
+
*
|
|
349
|
+
* @see {@link https://konstructio.github.io/konstruct-ui/?path=/docs/components-breadcrumb--docs Storybook}
|
|
350
|
+
*/
|
|
120
351
|
export declare const Breadcrumb: FC<BreadcrumbProps>;
|
|
121
352
|
|
|
353
|
+
/**
|
|
354
|
+
* Props for the Breadcrumb component.
|
|
355
|
+
*
|
|
356
|
+
* @example
|
|
357
|
+
* ```tsx
|
|
358
|
+
* <Breadcrumb
|
|
359
|
+
* steps={[
|
|
360
|
+
* { label: 'Home', to: '/' },
|
|
361
|
+
* { label: 'Products', to: '/products' },
|
|
362
|
+
* { label: 'Current Page', isActive: true },
|
|
363
|
+
* ]}
|
|
364
|
+
* />
|
|
365
|
+
* ```
|
|
366
|
+
*/
|
|
122
367
|
declare interface BreadcrumbProps extends VariantProps<typeof breadcrumbVariants>, HTMLAttributes<HTMLOListElement> {
|
|
368
|
+
/** Array of breadcrumb steps */
|
|
123
369
|
steps: Step[];
|
|
370
|
+
/** CSS classes for the nav wrapper */
|
|
124
371
|
wrapperClassName?: string;
|
|
372
|
+
/** Theme override for this component */
|
|
125
373
|
theme?: Theme;
|
|
126
374
|
}
|
|
127
375
|
|
|
128
376
|
declare const breadcrumbVariants: (props?: ClassProp | undefined) => string;
|
|
129
377
|
|
|
378
|
+
/**
|
|
379
|
+
* A customizable button component with multiple variants and styles.
|
|
380
|
+
*
|
|
381
|
+
* @example
|
|
382
|
+
* ```tsx
|
|
383
|
+
* // Primary button (default)
|
|
384
|
+
* <Button>Click me</Button>
|
|
385
|
+
*
|
|
386
|
+
* // Secondary button
|
|
387
|
+
* <Button variant="secondary">Secondary</Button>
|
|
388
|
+
*
|
|
389
|
+
* // Danger button
|
|
390
|
+
* <Button variant="danger">Delete</Button>
|
|
391
|
+
*
|
|
392
|
+
* // Link style button
|
|
393
|
+
* <Button variant="link">Learn more</Button>
|
|
394
|
+
*
|
|
395
|
+
* // Circle icon button
|
|
396
|
+
* <Button shape="circle" size="large"><Icon /></Button>
|
|
397
|
+
*
|
|
398
|
+
* // Compact button
|
|
399
|
+
* <Button appearance="compact">Compact</Button>
|
|
400
|
+
*
|
|
401
|
+
* // As child (renders child element with button styles)
|
|
402
|
+
* <Button asChild><a href="/page">Link</a></Button>
|
|
403
|
+
* ```
|
|
404
|
+
*
|
|
405
|
+
* @see {@link https://konstructio.github.io/konstruct-ui/?path=/docs/components-button--docs Storybook}
|
|
406
|
+
*/
|
|
130
407
|
export declare const Button: FC<ButtonProps>;
|
|
131
408
|
|
|
132
409
|
declare type ButtonBaseProps = Partial<ButtonProps> & {
|
|
@@ -138,10 +415,24 @@ declare type ButtonCancelProps = ButtonBaseProps;
|
|
|
138
415
|
|
|
139
416
|
declare type ButtonConfirmProps = ButtonBaseProps;
|
|
140
417
|
|
|
418
|
+
/**
|
|
419
|
+
* Props for the Button component.
|
|
420
|
+
*
|
|
421
|
+
* @example
|
|
422
|
+
* ```tsx
|
|
423
|
+
* <Button variant="primary">Click me</Button>
|
|
424
|
+
* <Button variant="secondary" disabled>Disabled</Button>
|
|
425
|
+
* <Button variant="danger" shape="circle"><TrashIcon /></Button>
|
|
426
|
+
* ```
|
|
427
|
+
*/
|
|
141
428
|
declare interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'disabled'>, VariantProps<typeof buttonVariants> {
|
|
429
|
+
/** Ref to the underlying button element */
|
|
142
430
|
ref?: Ref<HTMLButtonElement>;
|
|
431
|
+
/** Merge props onto child element instead of rendering a button */
|
|
143
432
|
asChild?: boolean;
|
|
433
|
+
/** Whether the button is disabled */
|
|
144
434
|
disabled?: boolean;
|
|
435
|
+
/** Theme override for this component */
|
|
145
436
|
theme?: Theme;
|
|
146
437
|
}
|
|
147
438
|
|
|
@@ -154,12 +445,50 @@ declare const buttonVariants: (props?: ({
|
|
|
154
445
|
appearance?: "compact" | null | undefined;
|
|
155
446
|
} & ClassProp) | undefined) => string;
|
|
156
447
|
|
|
448
|
+
/**
|
|
449
|
+
* A container card component with optional hover and active states.
|
|
450
|
+
*
|
|
451
|
+
* @example
|
|
452
|
+
* ```tsx
|
|
453
|
+
* // Basic card
|
|
454
|
+
* <Card>
|
|
455
|
+
* <h3>Card Title</h3>
|
|
456
|
+
* <p>Card content goes here</p>
|
|
457
|
+
* </Card>
|
|
458
|
+
*
|
|
459
|
+
* // Hoverable card
|
|
460
|
+
* <Card canHover onClick={handleClick}>
|
|
461
|
+
* Hover to see effect
|
|
462
|
+
* </Card>
|
|
463
|
+
*
|
|
464
|
+
* // Active/selected card
|
|
465
|
+
* <Card isActive>
|
|
466
|
+
* This card is selected
|
|
467
|
+
* </Card>
|
|
468
|
+
* ```
|
|
469
|
+
*
|
|
470
|
+
* @see {@link https://konstructio.github.io/konstruct-ui/?path=/docs/components-card--docs Storybook}
|
|
471
|
+
*/
|
|
157
472
|
export declare const Card: FC<CardProps>;
|
|
158
473
|
|
|
474
|
+
/**
|
|
475
|
+
* Props for the Card component.
|
|
476
|
+
*
|
|
477
|
+
* @example
|
|
478
|
+
* ```tsx
|
|
479
|
+
* <Card>Basic card content</Card>
|
|
480
|
+
* <Card canHover>Hoverable card</Card>
|
|
481
|
+
* <Card isActive>Active/selected card</Card>
|
|
482
|
+
* ```
|
|
483
|
+
*/
|
|
159
484
|
declare interface CardProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof cardVariants>, PropsWithChildren {
|
|
485
|
+
/** Enable hover effect */
|
|
160
486
|
canHover?: boolean;
|
|
487
|
+
/** Show active/selected state */
|
|
161
488
|
isActive?: boolean;
|
|
489
|
+
/** Theme override for this component */
|
|
162
490
|
theme?: Theme;
|
|
491
|
+
/** CSS classes for the outer wrapper */
|
|
163
492
|
wrapperClassName?: string;
|
|
164
493
|
}
|
|
165
494
|
|
|
@@ -168,18 +497,60 @@ declare const cardVariants: (props?: ({
|
|
|
168
497
|
canHover?: boolean | null | undefined;
|
|
169
498
|
} & ClassProp) | undefined) => string;
|
|
170
499
|
|
|
500
|
+
/**
|
|
501
|
+
* A checkbox component built on Radix UI primitives.
|
|
502
|
+
* Supports controlled and uncontrolled modes with label support.
|
|
503
|
+
*
|
|
504
|
+
* @example
|
|
505
|
+
* ```tsx
|
|
506
|
+
* // Basic checkbox with label
|
|
507
|
+
* <Checkbox label="Accept terms and conditions" />
|
|
508
|
+
*
|
|
509
|
+
* // Controlled checkbox
|
|
510
|
+
* <Checkbox
|
|
511
|
+
* label="Subscribe to newsletter"
|
|
512
|
+
* defaultChecked={subscribed}
|
|
513
|
+
* onChange={(checked) => setSubscribed(checked)}
|
|
514
|
+
* />
|
|
515
|
+
*
|
|
516
|
+
* // Disabled checkbox
|
|
517
|
+
* <Checkbox label="Premium feature" disabled />
|
|
518
|
+
* ```
|
|
519
|
+
*
|
|
520
|
+
* @see {@link https://konstructio.github.io/konstruct-ui/?path=/docs/components-checkbox--docs Storybook}
|
|
521
|
+
*/
|
|
171
522
|
export declare const Checkbox: FC<CheckboxProps>;
|
|
172
523
|
|
|
524
|
+
/**
|
|
525
|
+
* Props for the Checkbox component.
|
|
526
|
+
*
|
|
527
|
+
* @example
|
|
528
|
+
* ```tsx
|
|
529
|
+
* <Checkbox label="Accept terms" onChange={(checked) => setAccepted(checked)} />
|
|
530
|
+
* <Checkbox label="Remember me" defaultChecked />
|
|
531
|
+
* <Checkbox label="Disabled option" disabled />
|
|
532
|
+
* ```
|
|
533
|
+
*/
|
|
173
534
|
declare interface CheckboxProps extends Omit<CheckboxProps_2, 'onChange'>, Omit<VariantProps<typeof checkboxVariants>, 'checked'> {
|
|
535
|
+
/** ID of element that labels the checkbox for accessibility */
|
|
174
536
|
ariaLabelledBy?: string;
|
|
537
|
+
/** Additional CSS classes */
|
|
175
538
|
className?: string;
|
|
539
|
+
/** Initial checked state */
|
|
176
540
|
defaultChecked?: boolean;
|
|
541
|
+
/** Whether the checkbox is disabled */
|
|
177
542
|
disabled?: boolean;
|
|
543
|
+
/** HTML id attribute */
|
|
178
544
|
id?: string;
|
|
545
|
+
/** Label text displayed next to checkbox */
|
|
179
546
|
label?: string;
|
|
547
|
+
/** CSS classes for the label */
|
|
180
548
|
labelClassName?: string;
|
|
549
|
+
/** Form field name */
|
|
181
550
|
name?: string;
|
|
551
|
+
/** Theme override for this component */
|
|
182
552
|
theme?: Theme;
|
|
553
|
+
/** Callback when checked state changes */
|
|
183
554
|
onChange?: (checked: boolean) => void;
|
|
184
555
|
}
|
|
185
556
|
|
|
@@ -194,24 +565,85 @@ export declare type ColumnDef<TData extends RowData> = ColumnDef_2<TData, string
|
|
|
194
565
|
|
|
195
566
|
export declare const Content: FC<TabsContentProps>;
|
|
196
567
|
|
|
568
|
+
/**
|
|
569
|
+
* A numeric input component with increment/decrement buttons.
|
|
570
|
+
* Also exported as `NumberInput` for convenience.
|
|
571
|
+
*
|
|
572
|
+
* @example
|
|
573
|
+
* ```tsx
|
|
574
|
+
* // Basic counter
|
|
575
|
+
* <Counter
|
|
576
|
+
* label="Quantity"
|
|
577
|
+
* value={count}
|
|
578
|
+
* onChange={({ target }) => setCount(target.value)}
|
|
579
|
+
* />
|
|
580
|
+
*
|
|
581
|
+
* // With min/max limits
|
|
582
|
+
* <Counter
|
|
583
|
+
* label="Number of nodes"
|
|
584
|
+
* value={nodes}
|
|
585
|
+
* min={1}
|
|
586
|
+
* max={10}
|
|
587
|
+
* onChange={({ target }) => setNodes(target.value)}
|
|
588
|
+
* />
|
|
589
|
+
*
|
|
590
|
+
* // Disabled increment/decrement
|
|
591
|
+
* <Counter
|
|
592
|
+
* value={5}
|
|
593
|
+
* canIncrement={value < max}
|
|
594
|
+
* canDecrement={value > min}
|
|
595
|
+
* onChange={handleChange}
|
|
596
|
+
* />
|
|
597
|
+
* ```
|
|
598
|
+
*
|
|
599
|
+
* @see {@link https://konstructio.github.io/konstruct-ui/?path=/docs/components-counter--docs Storybook}
|
|
600
|
+
*/
|
|
197
601
|
declare const Counter: FC<CounterProps>;
|
|
198
602
|
export { Counter }
|
|
199
603
|
export { Counter as NumberInput }
|
|
200
604
|
|
|
605
|
+
/**
|
|
606
|
+
* Props for the Counter (NumberInput) component.
|
|
607
|
+
*
|
|
608
|
+
* @example
|
|
609
|
+
* ```tsx
|
|
610
|
+
* <Counter
|
|
611
|
+
* label="Quantity"
|
|
612
|
+
* value={quantity}
|
|
613
|
+
* min={1}
|
|
614
|
+
* max={10}
|
|
615
|
+
* onChange={({ target }) => setQuantity(target.value)}
|
|
616
|
+
* />
|
|
617
|
+
* ```
|
|
618
|
+
*/
|
|
201
619
|
declare interface CounterProps extends VariantProps<typeof counterVariants> {
|
|
620
|
+
/** Allow decrement button to be clicked */
|
|
202
621
|
canDecrement?: boolean;
|
|
622
|
+
/** Allow increment button to be clicked */
|
|
203
623
|
canIncrement?: boolean;
|
|
624
|
+
/** Additional CSS classes */
|
|
204
625
|
className?: string;
|
|
626
|
+
/** CSS classes for decrement button */
|
|
205
627
|
decrementButtonClassName?: string;
|
|
628
|
+
/** CSS classes for increment button */
|
|
206
629
|
incrementButtonClassName?: string;
|
|
630
|
+
/** Initial value (deprecated, use value) */
|
|
207
631
|
init?: number;
|
|
632
|
+
/** Show required indicator */
|
|
208
633
|
isRequired?: boolean;
|
|
634
|
+
/** Label displayed above the counter */
|
|
209
635
|
label?: string;
|
|
636
|
+
/** Maximum allowed value */
|
|
210
637
|
max?: number;
|
|
638
|
+
/** Minimum allowed value */
|
|
211
639
|
min?: number;
|
|
640
|
+
/** Form field name */
|
|
212
641
|
name?: string;
|
|
642
|
+
/** Theme override for this component */
|
|
213
643
|
theme?: Theme;
|
|
644
|
+
/** Current numeric value */
|
|
214
645
|
value?: number;
|
|
646
|
+
/** Callback when value changes */
|
|
215
647
|
onChange?: ({ target: { value } }: {
|
|
216
648
|
target: {
|
|
217
649
|
value: number;
|
|
@@ -231,22 +663,113 @@ declare type DateFilterDropdownProps = {
|
|
|
231
663
|
onApply?: (date?: Date) => void;
|
|
232
664
|
};
|
|
233
665
|
|
|
666
|
+
/**
|
|
667
|
+
* A date picker component built on react-day-picker.
|
|
668
|
+
* Allows single date selection with calendar navigation.
|
|
669
|
+
*
|
|
670
|
+
* @example
|
|
671
|
+
* ```tsx
|
|
672
|
+
* // Basic date picker
|
|
673
|
+
* <DatePicker
|
|
674
|
+
* defaultSelected={new Date()}
|
|
675
|
+
* onSelect={(date) => console.log(date)}
|
|
676
|
+
* />
|
|
677
|
+
*
|
|
678
|
+
* // With custom styling
|
|
679
|
+
* <DatePicker
|
|
680
|
+
* defaultSelected={startDate}
|
|
681
|
+
* onSelect={setStartDate}
|
|
682
|
+
* monthsClassName="custom-months"
|
|
683
|
+
* />
|
|
684
|
+
* ```
|
|
685
|
+
*
|
|
686
|
+
* @see {@link https://konstructio.github.io/konstruct-ui/?path=/docs/components-datepicker--docs Storybook}
|
|
687
|
+
*/
|
|
234
688
|
export declare const DatePicker: FC<DatePickerProps>;
|
|
235
689
|
|
|
690
|
+
/**
|
|
691
|
+
* Props for the DatePicker component.
|
|
692
|
+
*
|
|
693
|
+
* @example
|
|
694
|
+
* ```tsx
|
|
695
|
+
* <DatePicker
|
|
696
|
+
* defaultSelected={new Date()}
|
|
697
|
+
* onSelect={(date) => setSelectedDate(date)}
|
|
698
|
+
* />
|
|
699
|
+
* ```
|
|
700
|
+
*/
|
|
236
701
|
declare type DatePickerProps = Omit<DayPickerProps, 'mode'> & VariantProps<typeof datePickerVariants> & {
|
|
702
|
+
/** CSS classes for the navigation arrows */
|
|
237
703
|
arrowClassName?: string;
|
|
704
|
+
/** CSS classes for the months container */
|
|
238
705
|
monthsClassName?: string;
|
|
706
|
+
/** Timezone for date display */
|
|
239
707
|
timeZone?: TimeZone;
|
|
708
|
+
/** Initial selected date */
|
|
240
709
|
defaultSelected?: Date;
|
|
710
|
+
/** Callback when a date is selected */
|
|
241
711
|
onSelect?: (date: Date) => void;
|
|
242
712
|
};
|
|
243
713
|
|
|
244
714
|
declare const datePickerVariants: (props?: ClassProp | undefined) => string;
|
|
245
715
|
|
|
716
|
+
/**
|
|
717
|
+
* A horizontal divider/separator line.
|
|
718
|
+
*
|
|
719
|
+
* @example
|
|
720
|
+
* ```tsx
|
|
721
|
+
* <div>
|
|
722
|
+
* <p>Section 1</p>
|
|
723
|
+
* <Divider />
|
|
724
|
+
* <p>Section 2</p>
|
|
725
|
+
* </div>
|
|
726
|
+
* ```
|
|
727
|
+
*
|
|
728
|
+
* @see {@link https://konstructio.github.io/konstruct-ui/?path=/docs/components-divider--docs Storybook}
|
|
729
|
+
*/
|
|
246
730
|
export declare const Divider: FC<HTMLAttributes<HTMLDivElement>>;
|
|
247
731
|
|
|
732
|
+
/**
|
|
733
|
+
* A button with an attached dropdown menu for selecting actions.
|
|
734
|
+
* Closes automatically on outside click, Escape key, or tab visibility change.
|
|
735
|
+
*
|
|
736
|
+
* @example
|
|
737
|
+
* ```tsx
|
|
738
|
+
* <DropdownButton
|
|
739
|
+
* options={[
|
|
740
|
+
* { label: 'Download PDF', onClick: handlePdf },
|
|
741
|
+
* { label: 'Download CSV', onClick: handleCsv },
|
|
742
|
+
* ]}
|
|
743
|
+
* buttonClassName="w-64"
|
|
744
|
+
* />
|
|
745
|
+
* ```
|
|
746
|
+
*
|
|
747
|
+
* @see {@link https://konstructio.github.io/konstruct-ui/?path=/docs/components-dropdownbutton--docs Storybook}
|
|
748
|
+
*/
|
|
248
749
|
export declare const DropdownButton: FC<Props>;
|
|
249
750
|
|
|
751
|
+
/**
|
|
752
|
+
* A compound component for building filter interfaces.
|
|
753
|
+
* Includes sub-components for badge multi-select, date filtering, and reset actions.
|
|
754
|
+
*
|
|
755
|
+
* @example
|
|
756
|
+
* ```tsx
|
|
757
|
+
* <Filter theme="civo">
|
|
758
|
+
* <Filter.BadgeMultiSelect
|
|
759
|
+
* label="Status"
|
|
760
|
+
* options={[
|
|
761
|
+
* { id: 'active', label: 'Active', variant: 'success' },
|
|
762
|
+
* { id: 'pending', label: 'Pending', variant: 'warning' },
|
|
763
|
+
* ]}
|
|
764
|
+
* selectedValues={selected}
|
|
765
|
+
* onChange={setSelected}
|
|
766
|
+
* />
|
|
767
|
+
* <Filter.ResetButton onClick={() => setSelected([])} />
|
|
768
|
+
* </Filter>
|
|
769
|
+
* ```
|
|
770
|
+
*
|
|
771
|
+
* @see {@link https://konstructio.github.io/konstruct-ui/?path=/docs/components-filter--docs Storybook}
|
|
772
|
+
*/
|
|
250
773
|
export declare const Filter: FilterComponentProps;
|
|
251
774
|
|
|
252
775
|
declare type FilterAction = {
|
|
@@ -255,18 +778,48 @@ declare type FilterAction = {
|
|
|
255
778
|
variant?: ButtonProps['variant'];
|
|
256
779
|
};
|
|
257
780
|
|
|
781
|
+
/**
|
|
782
|
+
* Filter compound component type with sub-components.
|
|
783
|
+
*/
|
|
258
784
|
declare type FilterComponentProps = FC<FilterProps> & {
|
|
259
785
|
BadgeMultiSelect: FC<BadgeMultiSelectProps>;
|
|
260
786
|
DateFilterDropdown: FC<DateFilterDropdownProps>;
|
|
261
787
|
ResetButton: FC<ResetButtonProps>;
|
|
262
788
|
};
|
|
263
789
|
|
|
790
|
+
/**
|
|
791
|
+
* Props for the Filter component.
|
|
792
|
+
* A compound component for building filter interfaces.
|
|
793
|
+
*
|
|
794
|
+
* @example
|
|
795
|
+
* ```tsx
|
|
796
|
+
* <Filter theme="civo">
|
|
797
|
+
* <Filter.BadgeMultiSelect
|
|
798
|
+
* label="Status"
|
|
799
|
+
* options={statusOptions}
|
|
800
|
+
* selectedValues={selectedStatuses}
|
|
801
|
+
* onChange={setSelectedStatuses}
|
|
802
|
+
* />
|
|
803
|
+
* <Filter.DateFilterDropdown
|
|
804
|
+
* label="Date"
|
|
805
|
+
* onDateChange={setDateRange}
|
|
806
|
+
* />
|
|
807
|
+
* <Filter.ResetButton onClick={resetFilters} />
|
|
808
|
+
* </Filter>
|
|
809
|
+
* ```
|
|
810
|
+
*/
|
|
264
811
|
declare type FilterProps = VariantProps<typeof filterVariants> & PropsWithChildren & {
|
|
812
|
+
/** Additional CSS classes for the filter wrapper */
|
|
265
813
|
className?: string;
|
|
814
|
+
/** Theme override for this component */
|
|
266
815
|
theme?: Theme;
|
|
267
816
|
};
|
|
268
817
|
|
|
818
|
+
/**
|
|
819
|
+
* Props for Table.Filter component.
|
|
820
|
+
*/
|
|
269
821
|
declare interface FilterProps_2 extends React.InputHTMLAttributes<HTMLInputElement>, PropsWithChildren {
|
|
822
|
+
/** Placeholder text for the filter input */
|
|
270
823
|
placeholder?: string;
|
|
271
824
|
}
|
|
272
825
|
|
|
@@ -280,8 +833,12 @@ declare interface FooterProps extends PropsWithChildren, VariantProps<typeof foo
|
|
|
280
833
|
|
|
281
834
|
declare const footerVariants: (props?: ClassProp | undefined) => string;
|
|
282
835
|
|
|
836
|
+
/** Valid HTML heading tags */
|
|
283
837
|
declare type HeadingTag = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
284
838
|
|
|
839
|
+
/**
|
|
840
|
+
* Props for Table.Head component.
|
|
841
|
+
*/
|
|
285
842
|
declare interface HeadProps extends React.HTMLAttributes<HTMLTableSectionElement>, PropsWithChildren, VariantProps<typeof headVariants> {
|
|
286
843
|
}
|
|
287
844
|
|
|
@@ -289,31 +846,87 @@ declare const headVariants: (props?: ClassProp | undefined) => string;
|
|
|
289
846
|
|
|
290
847
|
declare type HexColor = `#${string}`;
|
|
291
848
|
|
|
849
|
+
/**
|
|
850
|
+
* A file input component for uploading images with preview and validation.
|
|
851
|
+
* Supports drag states, file type validation, size limits, and upload progress.
|
|
852
|
+
*
|
|
853
|
+
* @example
|
|
854
|
+
* ```tsx
|
|
855
|
+
* <ImageUpload
|
|
856
|
+
* label="Profile Picture"
|
|
857
|
+
* name="avatar"
|
|
858
|
+
* accept="image/png,image/jpeg"
|
|
859
|
+
* maxSize={5 * 1024 * 1024}
|
|
860
|
+
* uploadButtonText="Choose image"
|
|
861
|
+
* onChange={(e) => console.log(e.target.files?.[0])}
|
|
862
|
+
* onRemove={() => setAvatar(null)}
|
|
863
|
+
* />
|
|
864
|
+
* ```
|
|
865
|
+
*
|
|
866
|
+
* @see {@link https://konstructio.github.io/konstruct-ui/?path=/docs/components-imageupload--docs Storybook}
|
|
867
|
+
*/
|
|
292
868
|
export declare const ImageUpload: {
|
|
293
869
|
({ className, error, fileName, fileSize, fileUrl, helperText, isRequired, label, labelClassName, name, onChange, onRemove, status, theme, uploadButtonText, accept, maxSize, }: ImageUploadProps): JSX.Element;
|
|
294
870
|
displayName: string;
|
|
295
871
|
};
|
|
296
872
|
|
|
873
|
+
/**
|
|
874
|
+
* Props for the ImageUpload component.
|
|
875
|
+
* A file input for uploading images with preview, validation, and status states.
|
|
876
|
+
*
|
|
877
|
+
* @example
|
|
878
|
+
* ```tsx
|
|
879
|
+
* <ImageUpload
|
|
880
|
+
* label="Logo"
|
|
881
|
+
* name="logo"
|
|
882
|
+
* accept="image/png,image/svg+xml"
|
|
883
|
+
* maxSize={2 * 1024 * 1024}
|
|
884
|
+
* onChange={(e) => handleUpload(e.target.files?.[0])}
|
|
885
|
+
* onRemove={() => setLogo(null)}
|
|
886
|
+
* isRequired
|
|
887
|
+
* />
|
|
888
|
+
* ```
|
|
889
|
+
*/
|
|
297
890
|
declare interface ImageUploadProps extends Omit<VariantProps<typeof imageUploadVariants>, 'status'> {
|
|
891
|
+
/** Additional CSS classes */
|
|
298
892
|
className?: string;
|
|
893
|
+
/** Error message to display */
|
|
299
894
|
error?: string;
|
|
895
|
+
/** Name of the uploaded file */
|
|
300
896
|
fileName?: string;
|
|
897
|
+
/** Formatted size of the uploaded file */
|
|
301
898
|
fileSize?: string;
|
|
899
|
+
/** URL or data URL of the uploaded file for preview */
|
|
302
900
|
fileUrl?: string;
|
|
901
|
+
/** Helper text displayed below the input */
|
|
303
902
|
helperText?: string;
|
|
903
|
+
/** Whether the field is required */
|
|
304
904
|
isRequired?: boolean;
|
|
905
|
+
/** Label displayed above the input */
|
|
305
906
|
label?: string | ReactNode;
|
|
907
|
+
/** Additional CSS classes for the label */
|
|
306
908
|
labelClassName?: string;
|
|
909
|
+
/** Form field name */
|
|
307
910
|
name?: string;
|
|
911
|
+
/** Callback fired when a file is selected */
|
|
308
912
|
onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
913
|
+
/** Callback fired when the uploaded file is removed */
|
|
309
914
|
onRemove?: () => void;
|
|
915
|
+
/** Current upload status */
|
|
310
916
|
status?: ImageUploadStatusType;
|
|
917
|
+
/** Theme override for this component */
|
|
311
918
|
theme?: Theme;
|
|
919
|
+
/** Text displayed on the upload button */
|
|
312
920
|
uploadButtonText?: string;
|
|
921
|
+
/** Accepted file MIME types (comma-separated) */
|
|
313
922
|
accept?: string;
|
|
923
|
+
/** Maximum file size in bytes */
|
|
314
924
|
maxSize?: number;
|
|
315
925
|
}
|
|
316
926
|
|
|
927
|
+
/**
|
|
928
|
+
* Upload status states for the ImageUpload component.
|
|
929
|
+
*/
|
|
317
930
|
declare enum ImageUploadStatus {
|
|
318
931
|
Default = "default",
|
|
319
932
|
Uploading = "uploading",
|
|
@@ -327,16 +940,66 @@ declare const imageUploadVariants: (props?: ({
|
|
|
327
940
|
status?: "error" | "default" | "uploading" | "complete" | null | undefined;
|
|
328
941
|
} & ClassProp) | undefined) => string;
|
|
329
942
|
|
|
943
|
+
/**
|
|
944
|
+
* A text input component with label, error handling, and helper text support.
|
|
945
|
+
* Includes built-in password visibility toggle and search icon variant.
|
|
946
|
+
*
|
|
947
|
+
* @example
|
|
948
|
+
* ```tsx
|
|
949
|
+
* // Basic input with label
|
|
950
|
+
* <Input label="Email" placeholder="Enter your email" />
|
|
951
|
+
*
|
|
952
|
+
* // Required input with helper text
|
|
953
|
+
* <Input
|
|
954
|
+
* label="Username"
|
|
955
|
+
* isRequired
|
|
956
|
+
* helperText="Choose a unique username"
|
|
957
|
+
* />
|
|
958
|
+
*
|
|
959
|
+
* // Input with error state
|
|
960
|
+
* <Input
|
|
961
|
+
* label="Email"
|
|
962
|
+
* value={email}
|
|
963
|
+
* error="Please enter a valid email address"
|
|
964
|
+
* />
|
|
965
|
+
*
|
|
966
|
+
* // Password input (auto show/hide toggle)
|
|
967
|
+
* <Input label="Password" type="password" />
|
|
968
|
+
*
|
|
969
|
+
* // Search input with icon
|
|
970
|
+
* <Input placeholder="Search..." isSearch />
|
|
971
|
+
* ```
|
|
972
|
+
*
|
|
973
|
+
* @see {@link https://konstructio.github.io/konstruct-ui/?path=/docs/components-input--docs Storybook}
|
|
974
|
+
*/
|
|
330
975
|
export declare const Input: ForwardRefExoticComponent<InputProps & RefAttributes<HTMLInputElement>>;
|
|
331
976
|
|
|
977
|
+
/**
|
|
978
|
+
* Props for the Input component.
|
|
979
|
+
*
|
|
980
|
+
* @example
|
|
981
|
+
* ```tsx
|
|
982
|
+
* <Input label="Email" placeholder="Enter email" />
|
|
983
|
+
* <Input label="Password" type="password" isRequired />
|
|
984
|
+
* <Input error="Invalid email" helperText="We'll never share your email" />
|
|
985
|
+
* ```
|
|
986
|
+
*/
|
|
332
987
|
declare interface InputProps extends InputHTMLAttributes<HTMLInputElement>, VariantProps<typeof inputVariants> {
|
|
988
|
+
/** Error message to display below the input */
|
|
333
989
|
error?: string;
|
|
990
|
+
/** Helper text displayed below the input when no error */
|
|
334
991
|
helperText?: string;
|
|
992
|
+
/** Additional CSS classes for the helper text */
|
|
335
993
|
helperTextClassName?: string;
|
|
994
|
+
/** Show required indicator (*) next to label */
|
|
336
995
|
isRequired?: boolean;
|
|
996
|
+
/** Show search icon inside the input */
|
|
337
997
|
isSearch?: boolean;
|
|
998
|
+
/** Label text or element displayed above the input */
|
|
338
999
|
label?: string | ReactNode;
|
|
1000
|
+
/** Additional CSS classes for the label */
|
|
339
1001
|
labelClassName?: string;
|
|
1002
|
+
/** Theme override for this component */
|
|
340
1003
|
theme?: Theme;
|
|
341
1004
|
}
|
|
342
1005
|
|
|
@@ -346,13 +1009,47 @@ declare const inputVariants: (props?: ({
|
|
|
346
1009
|
|
|
347
1010
|
export declare const List: FC<ListProps>;
|
|
348
1011
|
|
|
1012
|
+
/**
|
|
1013
|
+
* Props for Tabs.List component.
|
|
1014
|
+
*/
|
|
349
1015
|
declare interface ListProps extends React.HTMLAttributes<HTMLDivElement>, PropsWithChildren {
|
|
1016
|
+
/** Tab list orientation */
|
|
350
1017
|
orientation: 'horizontal' | 'vertical';
|
|
351
1018
|
}
|
|
352
1019
|
|
|
1020
|
+
/**
|
|
1021
|
+
* A spinning loading indicator.
|
|
1022
|
+
*
|
|
1023
|
+
* @example
|
|
1024
|
+
* ```tsx
|
|
1025
|
+
* // Default loading spinner
|
|
1026
|
+
* <Loading />
|
|
1027
|
+
*
|
|
1028
|
+
* // Custom size
|
|
1029
|
+
* <Loading className="w-8 h-8" />
|
|
1030
|
+
*
|
|
1031
|
+
* // In a button
|
|
1032
|
+
* <Button disabled>
|
|
1033
|
+
* <Loading className="w-4 h-4 mr-2" />
|
|
1034
|
+
* Loading...
|
|
1035
|
+
* </Button>
|
|
1036
|
+
* ```
|
|
1037
|
+
*
|
|
1038
|
+
* @see {@link https://konstructio.github.io/konstruct-ui/?path=/docs/components-loading--docs Storybook}
|
|
1039
|
+
*/
|
|
353
1040
|
export declare const Loading: FC<LoadingProps>;
|
|
354
1041
|
|
|
1042
|
+
/**
|
|
1043
|
+
* Props for the Loading component.
|
|
1044
|
+
*
|
|
1045
|
+
* @example
|
|
1046
|
+
* ```tsx
|
|
1047
|
+
* <Loading />
|
|
1048
|
+
* <Loading className="w-8 h-8" />
|
|
1049
|
+
* ```
|
|
1050
|
+
*/
|
|
355
1051
|
declare type LoadingProps = InputHTMLAttributes<SVGSVGElement> & VariantProps<typeof loadingVariants> & {
|
|
1052
|
+
/** Theme override for this component */
|
|
356
1053
|
theme?: Theme;
|
|
357
1054
|
};
|
|
358
1055
|
|
|
@@ -366,61 +1063,180 @@ declare interface LogoProps extends PropsWithChildren, VariantProps<typeof logoV
|
|
|
366
1063
|
|
|
367
1064
|
declare const logoVariants: (props?: ClassProp | undefined) => string;
|
|
368
1065
|
|
|
1066
|
+
/**
|
|
1067
|
+
* A modal dialog component with Header, Body, and Footer sub-components.
|
|
1068
|
+
* Supports keyboard navigation (Escape to close) and portals to document.body.
|
|
1069
|
+
*
|
|
1070
|
+
* @example
|
|
1071
|
+
* ```tsx
|
|
1072
|
+
* const [isOpen, setIsOpen] = useState(false);
|
|
1073
|
+
*
|
|
1074
|
+
* <Button onClick={() => setIsOpen(true)}>Open Modal</Button>
|
|
1075
|
+
*
|
|
1076
|
+
* <Modal isOpen={isOpen} onClose={() => setIsOpen(false)}>
|
|
1077
|
+
* <Modal.Header>Confirm Action</Modal.Header>
|
|
1078
|
+
* <Modal.Body>
|
|
1079
|
+
* Are you sure you want to proceed?
|
|
1080
|
+
* </Modal.Body>
|
|
1081
|
+
* <Modal.Footer>
|
|
1082
|
+
* <Button variant="secondary" onClick={() => setIsOpen(false)}>
|
|
1083
|
+
* Cancel
|
|
1084
|
+
* </Button>
|
|
1085
|
+
* <Button onClick={handleConfirm}>Confirm</Button>
|
|
1086
|
+
* </Modal.Footer>
|
|
1087
|
+
* </Modal>
|
|
1088
|
+
* ```
|
|
1089
|
+
*
|
|
1090
|
+
* @see {@link https://konstructio.github.io/konstruct-ui/?path=/docs/components-modal--docs Storybook}
|
|
1091
|
+
*/
|
|
369
1092
|
export declare const Modal: FC<ModalProps> & {
|
|
370
1093
|
Header: FC<ModalChildProps>;
|
|
371
1094
|
Body: FC<ModalChildProps>;
|
|
372
1095
|
Footer: FC<ModalChildProps>;
|
|
373
1096
|
};
|
|
374
1097
|
|
|
1098
|
+
/**
|
|
1099
|
+
* Props for Modal sub-components (Header, Body, Footer).
|
|
1100
|
+
*/
|
|
375
1101
|
declare type ModalChildProps = {
|
|
1102
|
+
/** Content of the modal section */
|
|
376
1103
|
children: ReactNode;
|
|
1104
|
+
/** Additional CSS classes */
|
|
377
1105
|
className?: string;
|
|
1106
|
+
/** Merge props onto child element */
|
|
378
1107
|
asChild?: boolean;
|
|
379
1108
|
};
|
|
380
1109
|
|
|
1110
|
+
/**
|
|
1111
|
+
* Props for the Modal component.
|
|
1112
|
+
*
|
|
1113
|
+
* @example
|
|
1114
|
+
* ```tsx
|
|
1115
|
+
* <Modal isOpen={isOpen} onClose={() => setIsOpen(false)}>
|
|
1116
|
+
* <Modal.Header>Title</Modal.Header>
|
|
1117
|
+
* <Modal.Body>Content</Modal.Body>
|
|
1118
|
+
* <Modal.Footer>
|
|
1119
|
+
* <Button onClick={() => setIsOpen(false)}>Close</Button>
|
|
1120
|
+
* </Modal.Footer>
|
|
1121
|
+
* </Modal>
|
|
1122
|
+
* ```
|
|
1123
|
+
*/
|
|
381
1124
|
declare interface ModalProps extends PropsWithChildren, VariantProps<typeof modalVariants> {
|
|
1125
|
+
/** CSS classes for the close button */
|
|
382
1126
|
buttonCloseClassName?: string;
|
|
1127
|
+
/** Additional CSS classes for the modal */
|
|
383
1128
|
className?: string;
|
|
1129
|
+
/** DOM element to portal the modal into (defaults to document.body) */
|
|
384
1130
|
container?: Element | DocumentFragment;
|
|
1131
|
+
/** Whether the modal is open */
|
|
385
1132
|
isOpen?: boolean;
|
|
1133
|
+
/** Show the X close button in the corner */
|
|
386
1134
|
showCloseButton?: boolean;
|
|
1135
|
+
/** Theme override for this component */
|
|
387
1136
|
theme?: Theme;
|
|
1137
|
+
/** Callback when modal is closed (Escape key or close button) */
|
|
388
1138
|
onClose?: () => void;
|
|
389
1139
|
}
|
|
390
1140
|
|
|
391
1141
|
declare const modalVariants: (props?: ClassProp | undefined) => string;
|
|
392
1142
|
|
|
1143
|
+
/**
|
|
1144
|
+
* A dropdown component for selecting one or multiple options with search functionality.
|
|
1145
|
+
* Displays selected items as badges and supports loading states.
|
|
1146
|
+
*
|
|
1147
|
+
* @example
|
|
1148
|
+
* ```tsx
|
|
1149
|
+
* const [selected, setSelected] = useState<MultiSelectDropdownOption[]>([]);
|
|
1150
|
+
*
|
|
1151
|
+
* <MultiSelectDropdown
|
|
1152
|
+
* label="Assign team members"
|
|
1153
|
+
* placeholder="Search members..."
|
|
1154
|
+
* options={teamMembers}
|
|
1155
|
+
* value={selected}
|
|
1156
|
+
* onChange={(e) => setSelected(e.target.value)}
|
|
1157
|
+
* multiselect
|
|
1158
|
+
* />
|
|
1159
|
+
* ```
|
|
1160
|
+
*
|
|
1161
|
+
* @see {@link https://konstructio.github.io/konstruct-ui/?path=/docs/components-multiselectdropdown--docs Storybook}
|
|
1162
|
+
*/
|
|
393
1163
|
export declare const MultiSelectDropdown: FC<MultiSelectDropdownProps>;
|
|
394
1164
|
|
|
1165
|
+
/**
|
|
1166
|
+
* Configuration for a multi-select dropdown option.
|
|
1167
|
+
*/
|
|
395
1168
|
declare type MultiSelectDropdownOption = {
|
|
1169
|
+
/** Unique identifier for the option */
|
|
396
1170
|
id: string | number;
|
|
1171
|
+
/** Display label for the option */
|
|
397
1172
|
label: string;
|
|
398
|
-
|
|
399
|
-
|
|
1173
|
+
/** Optional badge text displayed next to the label */
|
|
1174
|
+
badge?: string;
|
|
1175
|
+
/** Optional value (defaults to label if not provided) */
|
|
400
1176
|
value?: string;
|
|
401
1177
|
};
|
|
402
1178
|
|
|
1179
|
+
/**
|
|
1180
|
+
* Props for the MultiSelectDropdown component.
|
|
1181
|
+
* A dropdown that allows selecting one or multiple options with search.
|
|
1182
|
+
*
|
|
1183
|
+
* @example
|
|
1184
|
+
* ```tsx
|
|
1185
|
+
* <MultiSelectDropdown
|
|
1186
|
+
* label="Select users"
|
|
1187
|
+
* placeholder="Search users..."
|
|
1188
|
+
* options={[
|
|
1189
|
+
* { id: 1, label: 'John Doe', badge: 'Admin' },
|
|
1190
|
+
* { id: 2, label: 'Jane Smith', badge: 'User' },
|
|
1191
|
+
* ]}
|
|
1192
|
+
* value={selectedUsers}
|
|
1193
|
+
* onChange={(e) => setSelectedUsers(e.target.value)}
|
|
1194
|
+
* multiselect
|
|
1195
|
+
* />
|
|
1196
|
+
* ```
|
|
1197
|
+
*/
|
|
403
1198
|
declare interface MultiSelectDropdownProps extends VariantProps<typeof multiSelectDropdownVariants>, Omit<InputHTMLAttributes<HTMLInputElement>, 'value' | 'onChange' | 'onBlur'> {
|
|
1199
|
+
/** Whether the dropdown is in a loading state */
|
|
1200
|
+
isLoading?: boolean;
|
|
1201
|
+
/** Whether the field is required */
|
|
1202
|
+
isRequired?: boolean;
|
|
1203
|
+
/** Label displayed above the dropdown */
|
|
404
1204
|
label?: string;
|
|
405
|
-
|
|
406
|
-
name?: string;
|
|
407
|
-
placeholder?: string;
|
|
1205
|
+
/** Additional CSS classes for the label */
|
|
408
1206
|
labelClassName?: string;
|
|
409
|
-
|
|
1207
|
+
/** Whether multiple options can be selected */
|
|
410
1208
|
multiselect?: boolean;
|
|
1209
|
+
/** Form field name */
|
|
1210
|
+
name?: string;
|
|
1211
|
+
/** Text shown when no options match the search */
|
|
1212
|
+
noOptionsText?: string;
|
|
1213
|
+
/** Available options to select from */
|
|
1214
|
+
options: MultiSelectDropdownOption[];
|
|
1215
|
+
/** Placeholder text when no selection */
|
|
1216
|
+
placeholder?: string;
|
|
1217
|
+
/** Currently selected options */
|
|
411
1218
|
value?: MultiSelectDropdownOption[];
|
|
1219
|
+
/** Additional CSS classes for the wrapper */
|
|
1220
|
+
wrapperClassName?: string;
|
|
1221
|
+
/** Callback fired when selection changes */
|
|
412
1222
|
onChange?: OnChangeFn_2;
|
|
1223
|
+
/** Callback fired when the input loses focus */
|
|
413
1224
|
onBlur?: OnBlurFn;
|
|
414
|
-
isLoading?: boolean;
|
|
415
|
-
noOptionsText?: string;
|
|
416
1225
|
}
|
|
417
1226
|
|
|
418
1227
|
declare const multiSelectDropdownVariants: (props?: ClassProp | undefined) => string;
|
|
419
1228
|
|
|
1229
|
+
/**
|
|
1230
|
+
* Configuration for a multi-select filter in the table.
|
|
1231
|
+
*/
|
|
420
1232
|
declare type MultiSelectFilter = {
|
|
1233
|
+
/** Unique key for the filter */
|
|
421
1234
|
key: string;
|
|
1235
|
+
/** Display label for the filter */
|
|
422
1236
|
label: string;
|
|
1237
|
+
/** Position of the filter dropdown */
|
|
423
1238
|
position?: 'right' | 'left';
|
|
1239
|
+
/** Available filter options */
|
|
424
1240
|
options: Option_5[];
|
|
425
1241
|
};
|
|
426
1242
|
|
|
@@ -504,83 +1320,251 @@ declare type OnChangeFn_2 = (params: {
|
|
|
504
1320
|
};
|
|
505
1321
|
}) => void;
|
|
506
1322
|
|
|
1323
|
+
/**
|
|
1324
|
+
* Option type for Select dropdown items.
|
|
1325
|
+
*
|
|
1326
|
+
* @example
|
|
1327
|
+
* ```tsx
|
|
1328
|
+
* const options: Option[] = [
|
|
1329
|
+
* { value: 'us', label: 'United States', leftIcon: <FlagUS /> },
|
|
1330
|
+
* { value: 'uk', label: 'United Kingdom', subLabel: 'Europe' },
|
|
1331
|
+
* ];
|
|
1332
|
+
* ```
|
|
1333
|
+
*/
|
|
507
1334
|
declare type Option_2 = {
|
|
1335
|
+
/** Display text for the option */
|
|
508
1336
|
label: string;
|
|
1337
|
+
/** Secondary text displayed below the label */
|
|
509
1338
|
subLabel?: string | ReactNode;
|
|
1339
|
+
/** Icon displayed on the left side of the option */
|
|
510
1340
|
leftIcon?: ReactNode | string;
|
|
1341
|
+
/** CSS classes for the left icon */
|
|
511
1342
|
leftIconClassName?: string;
|
|
1343
|
+
/** Show right component when this option is selected */
|
|
512
1344
|
showRightComponentOnselectedValue?: boolean;
|
|
1345
|
+
/** Component displayed on the right side of the option */
|
|
513
1346
|
rightComponent?: ReactNode | string;
|
|
1347
|
+
/** CSS classes for the right component */
|
|
514
1348
|
rightComponentClassName?: string;
|
|
1349
|
+
/** CSS classes for wrapper when this option is selected */
|
|
515
1350
|
wrapperClassNameOnSelectedValue?: string;
|
|
1351
|
+
/** Unique value for the option */
|
|
516
1352
|
value: string;
|
|
517
1353
|
};
|
|
518
1354
|
|
|
1355
|
+
/**
|
|
1356
|
+
* Option type for Autocomplete suggestions.
|
|
1357
|
+
*/
|
|
519
1358
|
declare type Option_3 = {
|
|
1359
|
+
/** The value to display and select */
|
|
520
1360
|
value: string;
|
|
521
1361
|
};
|
|
522
1362
|
|
|
1363
|
+
/**
|
|
1364
|
+
* Configuration for a dropdown menu option.
|
|
1365
|
+
*/
|
|
523
1366
|
declare type Option_4 = {
|
|
1367
|
+
/** The text or element displayed for this option */
|
|
524
1368
|
label: string | ReactNode;
|
|
1369
|
+
/** Callback fired when this option is selected */
|
|
525
1370
|
onClick?: VoidFunction;
|
|
526
1371
|
};
|
|
527
1372
|
|
|
1373
|
+
/**
|
|
1374
|
+
* Configuration for a filter option.
|
|
1375
|
+
*/
|
|
528
1376
|
declare type Option_5 = {
|
|
1377
|
+
/** Unique identifier for the option */
|
|
529
1378
|
id: string;
|
|
1379
|
+
/** Display label for the option */
|
|
530
1380
|
label: string;
|
|
1381
|
+
/** Visual variant for the badge */
|
|
531
1382
|
variant?: BadgeProps['variant'];
|
|
532
1383
|
};
|
|
533
1384
|
|
|
1385
|
+
/**
|
|
1386
|
+
* A phone number input with country code selector and automatic formatting.
|
|
1387
|
+
* Uses google-libphonenumber for validation and formatting.
|
|
1388
|
+
*
|
|
1389
|
+
* @example
|
|
1390
|
+
* ```tsx
|
|
1391
|
+
* <PhoneNumberInput
|
|
1392
|
+
* label="Contact Number"
|
|
1393
|
+
* name="contactPhone"
|
|
1394
|
+
* defaultCountryCode="US"
|
|
1395
|
+
* showFlagOnSearch
|
|
1396
|
+
* showInputFilter
|
|
1397
|
+
* isRequired
|
|
1398
|
+
* />
|
|
1399
|
+
* ```
|
|
1400
|
+
*
|
|
1401
|
+
* @see {@link https://konstructio.github.io/konstruct-ui/?path=/docs/components-phonenumberinput--docs Storybook}
|
|
1402
|
+
*/
|
|
534
1403
|
export declare const PhoneNumberInput: FC<Props_2>;
|
|
535
1404
|
|
|
1405
|
+
/**
|
|
1406
|
+
* A doughnut/pie chart component for data visualization.
|
|
1407
|
+
* Built on Chart.js with support for center text labels.
|
|
1408
|
+
*
|
|
1409
|
+
* @example
|
|
1410
|
+
* ```tsx
|
|
1411
|
+
* <PieChart
|
|
1412
|
+
* values={[25, 75]}
|
|
1413
|
+
* colors={['#94a3b8', '#22c55e']}
|
|
1414
|
+
* title="75%"
|
|
1415
|
+
* subtitle="Progress"
|
|
1416
|
+
* cutoutPercentage={80}
|
|
1417
|
+
* />
|
|
1418
|
+
* ```
|
|
1419
|
+
*
|
|
1420
|
+
* @see {@link https://konstructio.github.io/konstruct-ui/?path=/docs/components-piechart--docs Storybook}
|
|
1421
|
+
*/
|
|
536
1422
|
export declare const PieChart: FC<Props_3>;
|
|
537
1423
|
|
|
1424
|
+
/**
|
|
1425
|
+
* A progress bar component showing completion percentage.
|
|
1426
|
+
*
|
|
1427
|
+
* @example
|
|
1428
|
+
* ```tsx
|
|
1429
|
+
* // Basic progress bar
|
|
1430
|
+
* <ProgressBar percent={50} />
|
|
1431
|
+
*
|
|
1432
|
+
* // With label
|
|
1433
|
+
* <ProgressBar percent={75} label="Upload Progress" />
|
|
1434
|
+
*
|
|
1435
|
+
* // Completed state
|
|
1436
|
+
* <ProgressBar percent={100} status="success" label="Complete" />
|
|
1437
|
+
* ```
|
|
1438
|
+
*
|
|
1439
|
+
* @see {@link https://konstructio.github.io/konstruct-ui/?path=/docs/components-progressbar--docs Storybook}
|
|
1440
|
+
*/
|
|
538
1441
|
export declare const ProgressBar: FC<ProgressBarProps>;
|
|
539
1442
|
|
|
1443
|
+
/**
|
|
1444
|
+
* Props for the ProgressBar component.
|
|
1445
|
+
*
|
|
1446
|
+
* @example
|
|
1447
|
+
* ```tsx
|
|
1448
|
+
* <ProgressBar percent={75} label="Progress" />
|
|
1449
|
+
* <ProgressBar percent={100} status="success" />
|
|
1450
|
+
* ```
|
|
1451
|
+
*/
|
|
540
1452
|
declare interface ProgressBarProps extends VariantProps<typeof progressBarVariants> {
|
|
1453
|
+
/** CSS classes for the background bar */
|
|
541
1454
|
backgroundBarClassName?: string;
|
|
1455
|
+
/** Additional CSS classes */
|
|
542
1456
|
className?: string;
|
|
1457
|
+
/** Label text displayed above the progress bar */
|
|
543
1458
|
label?: string;
|
|
1459
|
+
/** CSS classes for the label */
|
|
544
1460
|
labelClassName?: string;
|
|
1461
|
+
/** CSS classes for the label wrapper */
|
|
545
1462
|
labelWrapperClassName?: string;
|
|
1463
|
+
/** Progress percentage (0-100) */
|
|
546
1464
|
percent: number;
|
|
1465
|
+
/** CSS classes for the percent text */
|
|
547
1466
|
percentClassName?: string;
|
|
1467
|
+
/** CSS classes for the progress bar fill */
|
|
548
1468
|
progressBarClassName?: string;
|
|
1469
|
+
/** Visual status of the progress bar */
|
|
549
1470
|
status?: 'success' | 'progress';
|
|
1471
|
+
/** Theme override for this component */
|
|
550
1472
|
theme?: Theme;
|
|
1473
|
+
/** CSS classes for the outer wrapper */
|
|
551
1474
|
wrapperClassName?: string;
|
|
552
1475
|
}
|
|
553
1476
|
|
|
554
1477
|
declare const progressBarVariants: (props?: ClassProp | undefined) => string;
|
|
555
1478
|
|
|
1479
|
+
/**
|
|
1480
|
+
* Props for the DropdownButton component.
|
|
1481
|
+
*
|
|
1482
|
+
* @example
|
|
1483
|
+
* ```tsx
|
|
1484
|
+
* <DropdownButton
|
|
1485
|
+
* options={[
|
|
1486
|
+
* { label: 'PDF', onClick: () => downloadPdf() },
|
|
1487
|
+
* { label: 'CSV', onClick: () => downloadCsv() },
|
|
1488
|
+
* { label: 'Excel', onClick: () => downloadExcel() },
|
|
1489
|
+
* ]}
|
|
1490
|
+
* />
|
|
1491
|
+
* ```
|
|
1492
|
+
*/
|
|
556
1493
|
declare type Props = {
|
|
1494
|
+
/** Additional CSS classes for the trigger button */
|
|
557
1495
|
buttonClassName?: string;
|
|
1496
|
+
/** Additional CSS classes for the wrapper container */
|
|
558
1497
|
className?: string;
|
|
1498
|
+
/** Additional CSS classes for each dropdown item */
|
|
559
1499
|
itemClassName?: string;
|
|
1500
|
+
/** Additional CSS classes for the dropdown list */
|
|
560
1501
|
listClassName?: string;
|
|
1502
|
+
/** Array of options to display in the dropdown */
|
|
561
1503
|
options: Option_4[];
|
|
562
1504
|
};
|
|
563
1505
|
|
|
1506
|
+
/**
|
|
1507
|
+
* Props for the PhoneNumberInput component.
|
|
1508
|
+
* An input with country code selector and phone number formatting.
|
|
1509
|
+
*
|
|
1510
|
+
* @example
|
|
1511
|
+
* ```tsx
|
|
1512
|
+
* <PhoneNumberInput
|
|
1513
|
+
* label="Phone Number"
|
|
1514
|
+
* name="phone"
|
|
1515
|
+
* defaultCountryCode="US"
|
|
1516
|
+
* placeholder="Enter phone number"
|
|
1517
|
+
* showFlagOnSearch
|
|
1518
|
+
* />
|
|
1519
|
+
* ```
|
|
1520
|
+
*/
|
|
564
1521
|
declare type Props_2 = InputHTMLAttributes<HTMLInputElement> & {
|
|
1522
|
+
/** Default country code for the selector (e.g., 'US', 'GB') */
|
|
565
1523
|
defaultCountryCode?: RegionCode;
|
|
1524
|
+
/** Whether the input is disabled */
|
|
566
1525
|
disabled?: boolean;
|
|
1526
|
+
/** Error message to display */
|
|
567
1527
|
error?: string;
|
|
1528
|
+
/** Helper text displayed below the input */
|
|
568
1529
|
helperText?: string;
|
|
1530
|
+
/** Additional CSS classes for the helper text */
|
|
569
1531
|
helperTextClassName?: string;
|
|
1532
|
+
/** Whether the field is required */
|
|
570
1533
|
isRequired?: boolean;
|
|
1534
|
+
/** Label displayed above the input */
|
|
571
1535
|
label?: string;
|
|
1536
|
+
/** Additional CSS classes for the label */
|
|
572
1537
|
labelClassName?: string;
|
|
1538
|
+
/** Form field name */
|
|
573
1539
|
name?: string;
|
|
1540
|
+
/** Placeholder text for the input */
|
|
574
1541
|
placeholder?: string;
|
|
1542
|
+
/** Whether to show country flags in the search dropdown */
|
|
575
1543
|
showFlagOnSearch?: boolean;
|
|
1544
|
+
/** Whether to show the country filter input */
|
|
576
1545
|
showInputFilter?: boolean;
|
|
1546
|
+
/** Whether to show country names in the search dropdown */
|
|
577
1547
|
showNameOnSearch?: boolean;
|
|
1548
|
+
/** Whether to show the placeholder text */
|
|
578
1549
|
showPlaceHolder?: boolean;
|
|
1550
|
+
/** Additional CSS classes for the wrapper */
|
|
579
1551
|
wrapperClassName?: string;
|
|
580
1552
|
};
|
|
581
1553
|
|
|
582
1554
|
/**
|
|
583
|
-
* Props for the PieChart component
|
|
1555
|
+
* Props for the PieChart component.
|
|
1556
|
+
* A doughnut/pie chart built on Chart.js for data visualization.
|
|
1557
|
+
*
|
|
1558
|
+
* @example
|
|
1559
|
+
* ```tsx
|
|
1560
|
+
* <PieChart
|
|
1561
|
+
* values={[30, 70]}
|
|
1562
|
+
* colors={['#ef4444', '#22c55e']}
|
|
1563
|
+
* title="70%"
|
|
1564
|
+
* subtitle="Complete"
|
|
1565
|
+
* cutoutPercentage={75}
|
|
1566
|
+
* />
|
|
1567
|
+
* ```
|
|
584
1568
|
*/
|
|
585
1569
|
declare type Props_3 = {
|
|
586
1570
|
/**
|
|
@@ -659,6 +1643,28 @@ declare type Props_4<TData extends RowData> = CellContext<TData, string> & {
|
|
|
659
1643
|
value?: string;
|
|
660
1644
|
};
|
|
661
1645
|
|
|
1646
|
+
/**
|
|
1647
|
+
* Props for the VirtualizedTable component.
|
|
1648
|
+
* A feature-rich data table with filtering, pagination, and sorting.
|
|
1649
|
+
*
|
|
1650
|
+
* @example
|
|
1651
|
+
* ```tsx
|
|
1652
|
+
* <VirtualizedTable
|
|
1653
|
+
* id="users-table"
|
|
1654
|
+
* ariaLabel="Users list"
|
|
1655
|
+
* columns={[
|
|
1656
|
+
* { accessorKey: 'name', header: 'Name' },
|
|
1657
|
+
* { accessorKey: 'email', header: 'Email' },
|
|
1658
|
+
* ]}
|
|
1659
|
+
* data={users}
|
|
1660
|
+
* totalItems={totalUsers}
|
|
1661
|
+
* showPagination
|
|
1662
|
+
* showFilter
|
|
1663
|
+
* showFilterInput
|
|
1664
|
+
* filterSearchPlaceholder="Search users..."
|
|
1665
|
+
* />
|
|
1666
|
+
* ```
|
|
1667
|
+
*/
|
|
662
1668
|
declare type Props_5<TData extends RowData_2> = VariantProps<typeof virtualizeTableVariants> & {
|
|
663
1669
|
id: string | string[];
|
|
664
1670
|
ariaLabel?: string;
|
|
@@ -719,12 +1725,85 @@ declare type Props_6<TData extends RowData> = CellContext<TData, unknown> & {
|
|
|
719
1725
|
wrapperContentActionsClassName?: string;
|
|
720
1726
|
};
|
|
721
1727
|
|
|
1728
|
+
/**
|
|
1729
|
+
* A radio button component with label and optional description.
|
|
1730
|
+
* Use RadioGroup to manage a group of radio buttons.
|
|
1731
|
+
*
|
|
1732
|
+
* @example
|
|
1733
|
+
* ```tsx
|
|
1734
|
+
* <Radio
|
|
1735
|
+
* name="plan"
|
|
1736
|
+
* value="basic"
|
|
1737
|
+
* label="Basic Plan"
|
|
1738
|
+
* description="Free forever"
|
|
1739
|
+
* checked={plan === 'basic'}
|
|
1740
|
+
* onChange={(value) => setPlan(value)}
|
|
1741
|
+
* />
|
|
1742
|
+
* ```
|
|
1743
|
+
*
|
|
1744
|
+
* @see {@link https://konstructio.github.io/konstruct-ui/?path=/docs/components-radio--docs Storybook}
|
|
1745
|
+
*/
|
|
722
1746
|
export declare const Radio: FC<RadioProps>;
|
|
723
1747
|
|
|
1748
|
+
/**
|
|
1749
|
+
* A card-style radio button for visually prominent selection options.
|
|
1750
|
+
* Use RadioCardGroup to manage a group of radio cards.
|
|
1751
|
+
*
|
|
1752
|
+
* @example
|
|
1753
|
+
* ```tsx
|
|
1754
|
+
* <RadioCard
|
|
1755
|
+
* name="tier"
|
|
1756
|
+
* value="enterprise"
|
|
1757
|
+
* label="Enterprise"
|
|
1758
|
+
* description="Custom pricing"
|
|
1759
|
+
* checked={tier === 'enterprise'}
|
|
1760
|
+
* onChange={(value) => setTier(value)}
|
|
1761
|
+
* />
|
|
1762
|
+
* ```
|
|
1763
|
+
*
|
|
1764
|
+
* @see {@link https://konstructio.github.io/konstruct-ui/?path=/docs/components-radiocard--docs Storybook}
|
|
1765
|
+
*/
|
|
724
1766
|
export declare const RadioCard: FC<RadioCardProps>;
|
|
725
1767
|
|
|
1768
|
+
/**
|
|
1769
|
+
* A group of card-style radio buttons with shared state management.
|
|
1770
|
+
*
|
|
1771
|
+
* @example
|
|
1772
|
+
* ```tsx
|
|
1773
|
+
* <RadioCardGroup
|
|
1774
|
+
* name="plan"
|
|
1775
|
+
* direction="row"
|
|
1776
|
+
* options={[
|
|
1777
|
+
* { value: 'starter', label: 'Starter', description: 'For individuals' },
|
|
1778
|
+
* { value: 'team', label: 'Team', description: 'For small teams' },
|
|
1779
|
+
* { value: 'business', label: 'Business', description: 'For organizations' },
|
|
1780
|
+
* ]}
|
|
1781
|
+
* defaultChecked="team"
|
|
1782
|
+
* onValueChange={(value) => console.log(value)}
|
|
1783
|
+
* />
|
|
1784
|
+
* ```
|
|
1785
|
+
*
|
|
1786
|
+
* @see {@link https://konstructio.github.io/konstruct-ui/?path=/docs/components-radiocardgroup--docs Storybook}
|
|
1787
|
+
*/
|
|
726
1788
|
export declare const RadioCardGroup: FC<RadioCardGroupProps>;
|
|
727
1789
|
|
|
1790
|
+
/**
|
|
1791
|
+
* Props for the RadioCardGroup component.
|
|
1792
|
+
*
|
|
1793
|
+
* @example
|
|
1794
|
+
* ```tsx
|
|
1795
|
+
* <RadioCardGroup
|
|
1796
|
+
* name="pricing"
|
|
1797
|
+
* options={[
|
|
1798
|
+
* { value: 'basic', label: 'Basic', description: '$9/mo' },
|
|
1799
|
+
* { value: 'pro', label: 'Pro', description: '$29/mo' },
|
|
1800
|
+
* { value: 'enterprise', label: 'Enterprise', description: 'Custom' },
|
|
1801
|
+
* ]}
|
|
1802
|
+
* defaultChecked="pro"
|
|
1803
|
+
* onValueChange={(value) => setTier(value)}
|
|
1804
|
+
* />
|
|
1805
|
+
* ```
|
|
1806
|
+
*/
|
|
728
1807
|
declare type RadioCardGroupProps = {
|
|
729
1808
|
asChild?: boolean;
|
|
730
1809
|
className?: string;
|
|
@@ -737,38 +1816,138 @@ declare type RadioCardGroupProps = {
|
|
|
737
1816
|
onValueChange?: (value: string) => void;
|
|
738
1817
|
};
|
|
739
1818
|
|
|
1819
|
+
/**
|
|
1820
|
+
* Props for the RadioCard component.
|
|
1821
|
+
* Combines Card styling with Radio functionality.
|
|
1822
|
+
*
|
|
1823
|
+
* @example
|
|
1824
|
+
* ```tsx
|
|
1825
|
+
* <RadioCard
|
|
1826
|
+
* name="plan"
|
|
1827
|
+
* value="pro"
|
|
1828
|
+
* label="Pro Plan"
|
|
1829
|
+
* description="$29/month"
|
|
1830
|
+
* checked={selected === 'pro'}
|
|
1831
|
+
* onChange={(value) => setSelected(value)}
|
|
1832
|
+
* />
|
|
1833
|
+
* ```
|
|
1834
|
+
*/
|
|
740
1835
|
declare type RadioCardProps = Omit<CardProps, 'canHover' | 'isActive'> & Pick<RadioProps, 'name' | 'value' | 'checked' | 'onChange' | 'label' | 'disabled' | 'defaultChecked' | 'labelTextClassName' | 'description' | 'descriptionClassName'> & {
|
|
741
1836
|
labelWrapperClassName?: string;
|
|
742
1837
|
theme?: Theme;
|
|
743
1838
|
};
|
|
744
1839
|
|
|
1840
|
+
/**
|
|
1841
|
+
* A group of radio buttons with shared state management.
|
|
1842
|
+
*
|
|
1843
|
+
* @example
|
|
1844
|
+
* ```tsx
|
|
1845
|
+
* // Vertical layout (default)
|
|
1846
|
+
* <RadioGroup
|
|
1847
|
+
* name="subscription"
|
|
1848
|
+
* options={[
|
|
1849
|
+
* { value: 'monthly', label: 'Monthly', description: '$10/mo' },
|
|
1850
|
+
* { value: 'yearly', label: 'Yearly', description: '$100/yr' },
|
|
1851
|
+
* ]}
|
|
1852
|
+
* defaultChecked="monthly"
|
|
1853
|
+
* onValueChange={(value) => setSubscription(value)}
|
|
1854
|
+
* />
|
|
1855
|
+
*
|
|
1856
|
+
* // Horizontal layout
|
|
1857
|
+
* <RadioGroup
|
|
1858
|
+
* name="size"
|
|
1859
|
+
* direction="row"
|
|
1860
|
+
* options={[
|
|
1861
|
+
* { value: 'sm', label: 'Small' },
|
|
1862
|
+
* { value: 'md', label: 'Medium' },
|
|
1863
|
+
* { value: 'lg', label: 'Large' },
|
|
1864
|
+
* ]}
|
|
1865
|
+
* onValueChange={setSize}
|
|
1866
|
+
* />
|
|
1867
|
+
* ```
|
|
1868
|
+
*
|
|
1869
|
+
* @see {@link https://konstructio.github.io/konstruct-ui/?path=/docs/components-radiogroup--docs Storybook}
|
|
1870
|
+
*/
|
|
745
1871
|
export declare const RadioGroup: FC<RadioGroupProps>;
|
|
746
1872
|
|
|
1873
|
+
/**
|
|
1874
|
+
* Props for the RadioGroup component.
|
|
1875
|
+
*
|
|
1876
|
+
* @example
|
|
1877
|
+
* ```tsx
|
|
1878
|
+
* <RadioGroup
|
|
1879
|
+
* name="plan"
|
|
1880
|
+
* options={[
|
|
1881
|
+
* { value: 'basic', label: 'Basic' },
|
|
1882
|
+
* { value: 'pro', label: 'Pro' },
|
|
1883
|
+
* { value: 'enterprise', label: 'Enterprise' },
|
|
1884
|
+
* ]}
|
|
1885
|
+
* defaultChecked="basic"
|
|
1886
|
+
* onValueChange={(value) => setPlan(value)}
|
|
1887
|
+
* />
|
|
1888
|
+
* ```
|
|
1889
|
+
*/
|
|
747
1890
|
declare interface RadioGroupProps {
|
|
1891
|
+
/** Merge props onto child element */
|
|
748
1892
|
asChild?: boolean;
|
|
1893
|
+
/** CSS classes for each radio option */
|
|
749
1894
|
className?: RadioProps['className'];
|
|
1895
|
+
/** Initially selected value */
|
|
750
1896
|
defaultChecked?: string;
|
|
1897
|
+
/** Layout direction (row or col) */
|
|
751
1898
|
direction?: 'row' | 'col';
|
|
1899
|
+
/** Label for the group */
|
|
752
1900
|
label?: string | ReactNode;
|
|
1901
|
+
/** Form field name (shared by all radios) */
|
|
753
1902
|
name: string;
|
|
1903
|
+
/** Array of radio options */
|
|
754
1904
|
options: Omit<RadioProps, 'name' | 'checked' | 'defaultChecked'>[];
|
|
1905
|
+
/** Theme override for this component */
|
|
755
1906
|
theme?: Theme;
|
|
1907
|
+
/** CSS classes for the wrapper */
|
|
756
1908
|
wrapperClassName?: string;
|
|
1909
|
+
/** Callback when selection changes */
|
|
757
1910
|
onValueChange?: (value: string) => void;
|
|
758
1911
|
}
|
|
759
1912
|
|
|
1913
|
+
/**
|
|
1914
|
+
* Props for the Radio component.
|
|
1915
|
+
*
|
|
1916
|
+
* @example
|
|
1917
|
+
* ```tsx
|
|
1918
|
+
* <Radio
|
|
1919
|
+
* name="plan"
|
|
1920
|
+
* value="basic"
|
|
1921
|
+
* label="Basic Plan"
|
|
1922
|
+
* checked={selected === 'basic'}
|
|
1923
|
+
* onChange={(value) => setSelected(value)}
|
|
1924
|
+
* />
|
|
1925
|
+
* ```
|
|
1926
|
+
*/
|
|
760
1927
|
declare interface RadioProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'disabled'>, VariantProps<typeof radioVariants> {
|
|
1928
|
+
/** Whether the radio is checked */
|
|
761
1929
|
checked?: boolean;
|
|
1930
|
+
/** Initial checked state (uncontrolled) */
|
|
762
1931
|
defaultChecked?: boolean;
|
|
1932
|
+
/** Whether the radio is disabled */
|
|
763
1933
|
disabled?: boolean;
|
|
1934
|
+
/** Label text or element */
|
|
764
1935
|
label?: string | ReactNode;
|
|
1936
|
+
/** CSS classes for the label text */
|
|
765
1937
|
labelTextClassName?: string;
|
|
1938
|
+
/** Form field name (groups radios together) */
|
|
766
1939
|
name: string;
|
|
1940
|
+
/** Description text below the label */
|
|
767
1941
|
description?: string | ReactNode;
|
|
1942
|
+
/** CSS classes for the description */
|
|
768
1943
|
descriptionClassName?: string;
|
|
1944
|
+
/** Value submitted when selected */
|
|
769
1945
|
value: string;
|
|
1946
|
+
/** CSS classes for the wrapper */
|
|
770
1947
|
wrapperClassName?: string;
|
|
1948
|
+
/** Theme override for this component */
|
|
771
1949
|
theme?: Theme;
|
|
1950
|
+
/** Callback when selected */
|
|
772
1951
|
onChange?: (value: string) => void;
|
|
773
1952
|
}
|
|
774
1953
|
|
|
@@ -777,18 +1956,61 @@ declare const radioVariants: (props?: ({
|
|
|
777
1956
|
checked?: boolean | null | undefined;
|
|
778
1957
|
} & ClassProp) | undefined) => string;
|
|
779
1958
|
|
|
1959
|
+
/**
|
|
1960
|
+
* A dual-thumb slider component for selecting a value range.
|
|
1961
|
+
* Built on Radix UI Slider for accessibility.
|
|
1962
|
+
*
|
|
1963
|
+
* @example
|
|
1964
|
+
* ```tsx
|
|
1965
|
+
* <Range
|
|
1966
|
+
* label="Budget"
|
|
1967
|
+
* min={0}
|
|
1968
|
+
* max={10000}
|
|
1969
|
+
* defaultValue={[2000, 8000]}
|
|
1970
|
+
* showValue
|
|
1971
|
+
* name="budget"
|
|
1972
|
+
* />
|
|
1973
|
+
* ```
|
|
1974
|
+
*
|
|
1975
|
+
* @see {@link https://konstructio.github.io/konstruct-ui/?path=/docs/components-range--docs Storybook}
|
|
1976
|
+
*/
|
|
780
1977
|
declare const Range_2: FC<RangeProps>;
|
|
781
1978
|
export { Range_2 as Range }
|
|
782
1979
|
|
|
1980
|
+
/**
|
|
1981
|
+
* Props for the Range component.
|
|
1982
|
+
* A dual-thumb slider for selecting a value range.
|
|
1983
|
+
*
|
|
1984
|
+
* @example
|
|
1985
|
+
* ```tsx
|
|
1986
|
+
* <Range
|
|
1987
|
+
* label="Price Range"
|
|
1988
|
+
* min={0}
|
|
1989
|
+
* max={1000}
|
|
1990
|
+
* defaultValue={[100, 500]}
|
|
1991
|
+
* showValue
|
|
1992
|
+
* size="md"
|
|
1993
|
+
* />
|
|
1994
|
+
* ```
|
|
1995
|
+
*/
|
|
783
1996
|
declare interface RangeProps extends VariantProps<typeof rangeVariants> {
|
|
1997
|
+
/** Additional CSS classes */
|
|
784
1998
|
className?: string;
|
|
1999
|
+
/** Initial range values [min, max] */
|
|
785
2000
|
defaultValue?: SliderProps['defaultValue'];
|
|
2001
|
+
/** Label displayed above the range slider */
|
|
786
2002
|
label?: string;
|
|
2003
|
+
/** Maximum value for the range */
|
|
787
2004
|
max?: SliderProps['max'];
|
|
2005
|
+
/** Minimum value for the range */
|
|
788
2006
|
min?: SliderProps['min'];
|
|
2007
|
+
/** Form field name for the hidden input */
|
|
789
2008
|
name?: string;
|
|
2009
|
+
/** Whether to display the current range values */
|
|
790
2010
|
showValue?: boolean;
|
|
2011
|
+
/** Size of the slider track and thumbs */
|
|
791
2012
|
size?: 'sm' | 'md' | 'lg';
|
|
2013
|
+
/** Theme override for this component */
|
|
792
2014
|
theme?: Theme;
|
|
793
2015
|
}
|
|
794
2016
|
|
|
@@ -799,11 +2021,18 @@ declare type ResetButtonProps = ButtonProps & {
|
|
|
799
2021
|
onClick?: VoidFunction;
|
|
800
2022
|
};
|
|
801
2023
|
|
|
2024
|
+
/** Base row data type from TanStack Table */
|
|
802
2025
|
export declare type RowData = RowData_2;
|
|
803
2026
|
|
|
2027
|
+
/**
|
|
2028
|
+
* Props for Table.Row component.
|
|
2029
|
+
*/
|
|
804
2030
|
declare interface RowProps extends React.HTMLAttributes<HTMLTableRowElement>, PropsWithChildren, VariantProps<typeof rowVariants> {
|
|
2031
|
+
/** Width of the row */
|
|
805
2032
|
width?: string;
|
|
2033
|
+
/** Whether the row is selected */
|
|
806
2034
|
isSelected?: boolean;
|
|
2035
|
+
/** Callback when row is selected */
|
|
807
2036
|
onSelect?: () => void;
|
|
808
2037
|
}
|
|
809
2038
|
|
|
@@ -811,10 +2040,77 @@ declare const rowVariants: (props?: ({
|
|
|
811
2040
|
isSelected?: boolean | null | undefined;
|
|
812
2041
|
} & ClassProp) | undefined) => string;
|
|
813
2042
|
|
|
2043
|
+
/**
|
|
2044
|
+
* A dropdown select component with search, icons, and infinite scroll support.
|
|
2045
|
+
* Also exported as `Dropdown` for convenience.
|
|
2046
|
+
*
|
|
2047
|
+
* @example
|
|
2048
|
+
* ```tsx
|
|
2049
|
+
* // Basic usage
|
|
2050
|
+
* <Select
|
|
2051
|
+
* label="Country"
|
|
2052
|
+
* options={[
|
|
2053
|
+
* { value: 'us', label: 'United States' },
|
|
2054
|
+
* { value: 'uk', label: 'United Kingdom' },
|
|
2055
|
+
* ]}
|
|
2056
|
+
* value={selected}
|
|
2057
|
+
* onChange={(e) => setSelected(e.target.value)}
|
|
2058
|
+
* />
|
|
2059
|
+
*
|
|
2060
|
+
* // Searchable with custom icons
|
|
2061
|
+
* <Select
|
|
2062
|
+
* label="Select region"
|
|
2063
|
+
* options={regions.map(r => ({
|
|
2064
|
+
* value: r.id,
|
|
2065
|
+
* label: r.name,
|
|
2066
|
+
* leftIcon: <RegionIcon />,
|
|
2067
|
+
* subLabel: r.description,
|
|
2068
|
+
* }))}
|
|
2069
|
+
* searchable
|
|
2070
|
+
* highlightSearch
|
|
2071
|
+
* />
|
|
2072
|
+
* ```
|
|
2073
|
+
*
|
|
2074
|
+
* @see {@link https://konstructio.github.io/konstruct-ui/?path=/docs/components-select--docs Storybook}
|
|
2075
|
+
*/
|
|
814
2076
|
declare const Select: FC<SelectProps>;
|
|
815
2077
|
export { Select as Dropdown }
|
|
816
2078
|
export { Select }
|
|
817
2079
|
|
|
2080
|
+
/**
|
|
2081
|
+
* Props for the Select (Dropdown) component.
|
|
2082
|
+
*
|
|
2083
|
+
* @example
|
|
2084
|
+
* ```tsx
|
|
2085
|
+
* // Basic select
|
|
2086
|
+
* <Select
|
|
2087
|
+
* label="Country"
|
|
2088
|
+
* options={[
|
|
2089
|
+
* { value: 'us', label: 'United States' },
|
|
2090
|
+
* { value: 'uk', label: 'United Kingdom' },
|
|
2091
|
+
* ]}
|
|
2092
|
+
* value={country}
|
|
2093
|
+
* onChange={(e) => setCountry(e.target.value)}
|
|
2094
|
+
* />
|
|
2095
|
+
*
|
|
2096
|
+
* // Searchable select
|
|
2097
|
+
* <Select
|
|
2098
|
+
* label="Search countries"
|
|
2099
|
+
* options={countries}
|
|
2100
|
+
* searchable
|
|
2101
|
+
* highlightSearch
|
|
2102
|
+
* />
|
|
2103
|
+
*
|
|
2104
|
+
* // With infinite scroll
|
|
2105
|
+
* <Select
|
|
2106
|
+
* options={options}
|
|
2107
|
+
* isInfiniteScrollEnabled
|
|
2108
|
+
* onFetchMoreOptions={async ({ page }) => fetchMore(page)}
|
|
2109
|
+
* />
|
|
2110
|
+
* ```
|
|
2111
|
+
*
|
|
2112
|
+
* @see {@link https://konstructio.github.io/konstruct-ui/?path=/docs/components-select--docs Storybook}
|
|
2113
|
+
*/
|
|
818
2114
|
declare type SelectProps = VariantProps<typeof selectVariants> & Omit<InputHTMLAttributes<HTMLInputElement>, 'value' | 'onChange'> & {
|
|
819
2115
|
additionalOptions?: ReactNode[] | string[];
|
|
820
2116
|
className?: string;
|
|
@@ -864,8 +2160,34 @@ declare const selectVariants: (props?: ({
|
|
|
864
2160
|
disabled?: boolean | null | undefined;
|
|
865
2161
|
} & ClassProp) | undefined) => string;
|
|
866
2162
|
|
|
2163
|
+
/**
|
|
2164
|
+
* A compound component for building application sidebars.
|
|
2165
|
+
* Includes sub-components for logo, navigation, groups, options, and footer.
|
|
2166
|
+
*
|
|
2167
|
+
* @example
|
|
2168
|
+
* ```tsx
|
|
2169
|
+
* <Sidebar canResize minWith={200} maxWith={400} theme="dark">
|
|
2170
|
+
* <Sidebar.Logo>
|
|
2171
|
+
* <img src="/logo.svg" alt="Logo" />
|
|
2172
|
+
* </Sidebar.Logo>
|
|
2173
|
+
* <Sidebar.Navigation>
|
|
2174
|
+
* <Sidebar.NavigationGroup label="Menu">
|
|
2175
|
+
* <Sidebar.NavigationOption href="/" icon={<Home />}>
|
|
2176
|
+
* Home
|
|
2177
|
+
* </Sidebar.NavigationOption>
|
|
2178
|
+
* </Sidebar.NavigationGroup>
|
|
2179
|
+
* </Sidebar.Navigation>
|
|
2180
|
+
* <Sidebar.Footer>Version 1.0</Sidebar.Footer>
|
|
2181
|
+
* </Sidebar>
|
|
2182
|
+
* ```
|
|
2183
|
+
*
|
|
2184
|
+
* @see {@link https://konstructio.github.io/konstruct-ui/?path=/docs/components-sidebar--docs Storybook}
|
|
2185
|
+
*/
|
|
867
2186
|
export declare const Sidebar: FC<SidebarProps> & SidebarChildrenProps;
|
|
868
2187
|
|
|
2188
|
+
/**
|
|
2189
|
+
* Sidebar compound component type with sub-components.
|
|
2190
|
+
*/
|
|
869
2191
|
declare type SidebarChildrenProps = {
|
|
870
2192
|
Footer: FC<FooterProps>;
|
|
871
2193
|
Logo: FC<LogoProps>;
|
|
@@ -875,59 +2197,218 @@ declare type SidebarChildrenProps = {
|
|
|
875
2197
|
NavigationSeparator: FC<NavigationSeparatorProps>;
|
|
876
2198
|
};
|
|
877
2199
|
|
|
2200
|
+
/**
|
|
2201
|
+
* Props for the Sidebar component.
|
|
2202
|
+
* A compound component for building application sidebars with navigation.
|
|
2203
|
+
*
|
|
2204
|
+
* @example
|
|
2205
|
+
* ```tsx
|
|
2206
|
+
* <Sidebar canResize minWith={200} maxWith={400}>
|
|
2207
|
+
* <Sidebar.Logo>
|
|
2208
|
+
* <img src="/logo.svg" alt="Logo" />
|
|
2209
|
+
* </Sidebar.Logo>
|
|
2210
|
+
* <Sidebar.Navigation>
|
|
2211
|
+
* <Sidebar.NavigationGroup label="Main">
|
|
2212
|
+
* <Sidebar.NavigationOption href="/dashboard" icon={<Home />}>
|
|
2213
|
+
* Dashboard
|
|
2214
|
+
* </Sidebar.NavigationOption>
|
|
2215
|
+
* <Sidebar.NavigationOption href="/settings" icon={<Settings />}>
|
|
2216
|
+
* Settings
|
|
2217
|
+
* </Sidebar.NavigationOption>
|
|
2218
|
+
* </Sidebar.NavigationGroup>
|
|
2219
|
+
* </Sidebar.Navigation>
|
|
2220
|
+
* <Sidebar.Footer>v1.0.0</Sidebar.Footer>
|
|
2221
|
+
* </Sidebar>
|
|
2222
|
+
* ```
|
|
2223
|
+
*/
|
|
878
2224
|
declare interface SidebarProps extends VariantProps<typeof wrapperSiderbarVariants>, PropsWithChildren {
|
|
2225
|
+
/** Whether the sidebar can be resized by dragging */
|
|
879
2226
|
canResize?: boolean;
|
|
2227
|
+
/** Additional CSS classes for the divider */
|
|
880
2228
|
dividerClassName?: string;
|
|
2229
|
+
/** Maximum width when resizing (in pixels) */
|
|
881
2230
|
maxWith?: number;
|
|
2231
|
+
/** Minimum width when resizing (in pixels) */
|
|
882
2232
|
minWith?: number;
|
|
2233
|
+
/** Theme override for this component */
|
|
883
2234
|
theme?: Theme;
|
|
2235
|
+
/** Additional CSS classes for the wrapper */
|
|
884
2236
|
wrapperClassName?: string;
|
|
885
2237
|
}
|
|
886
2238
|
|
|
2239
|
+
/**
|
|
2240
|
+
* A single-thumb slider component for selecting a value.
|
|
2241
|
+
* Built on Radix UI Slider for accessibility.
|
|
2242
|
+
*
|
|
2243
|
+
* @example
|
|
2244
|
+
* ```tsx
|
|
2245
|
+
* <Slider
|
|
2246
|
+
* label="Brightness"
|
|
2247
|
+
* min={0}
|
|
2248
|
+
* max={100}
|
|
2249
|
+
* defaultValue={[75]}
|
|
2250
|
+
* showValue
|
|
2251
|
+
* name="brightness"
|
|
2252
|
+
* />
|
|
2253
|
+
* ```
|
|
2254
|
+
*
|
|
2255
|
+
* @see {@link https://konstructio.github.io/konstruct-ui/?path=/docs/components-slider--docs Storybook}
|
|
2256
|
+
*/
|
|
887
2257
|
export declare const Slider: FC<SliderProps_2>;
|
|
888
2258
|
|
|
2259
|
+
/**
|
|
2260
|
+
* Props for the Slider component.
|
|
2261
|
+
* A single-thumb slider for selecting a single value.
|
|
2262
|
+
*
|
|
2263
|
+
* @example
|
|
2264
|
+
* ```tsx
|
|
2265
|
+
* <Slider
|
|
2266
|
+
* label="Volume"
|
|
2267
|
+
* min={0}
|
|
2268
|
+
* max={100}
|
|
2269
|
+
* defaultValue={[50]}
|
|
2270
|
+
* showValue
|
|
2271
|
+
* size="md"
|
|
2272
|
+
* />
|
|
2273
|
+
* ```
|
|
2274
|
+
*/
|
|
889
2275
|
declare interface SliderProps_2 extends VariantProps<typeof sliderVariants> {
|
|
2276
|
+
/** Additional CSS classes */
|
|
890
2277
|
className?: string;
|
|
2278
|
+
/** Initial value as single-element array */
|
|
891
2279
|
defaultValue?: SliderProps['defaultValue'];
|
|
2280
|
+
/** Label displayed above the slider */
|
|
892
2281
|
label?: string;
|
|
2282
|
+
/** Maximum value for the slider */
|
|
893
2283
|
max?: SliderProps['max'];
|
|
2284
|
+
/** Minimum value for the slider */
|
|
894
2285
|
min?: SliderProps['min'];
|
|
2286
|
+
/** Form field name for the hidden input */
|
|
895
2287
|
name?: string;
|
|
2288
|
+
/** Whether to display the current value */
|
|
896
2289
|
showValue?: boolean;
|
|
2290
|
+
/** Size of the slider track and thumb */
|
|
897
2291
|
size?: 'sm' | 'md' | 'lg';
|
|
2292
|
+
/** Theme override for this component */
|
|
898
2293
|
theme?: Theme;
|
|
899
2294
|
}
|
|
900
2295
|
|
|
901
2296
|
declare const sliderVariants: (props?: ClassProp | undefined) => string;
|
|
902
2297
|
|
|
2298
|
+
/**
|
|
2299
|
+
* A single step in the breadcrumb navigation.
|
|
2300
|
+
*/
|
|
903
2301
|
declare type Step = {
|
|
2302
|
+
/** Display text for the breadcrumb item */
|
|
904
2303
|
label: string;
|
|
2304
|
+
/** URL to navigate to when clicked */
|
|
905
2305
|
to?: string;
|
|
2306
|
+
/** Link target (_self or _blank) */
|
|
906
2307
|
target?: '_self' | '_blank';
|
|
2308
|
+
/** Whether this step is the current/active page */
|
|
907
2309
|
isActive?: boolean;
|
|
2310
|
+
/** Custom component to render (e.g., Link from react-router) */
|
|
908
2311
|
component?: FC<any>;
|
|
909
2312
|
};
|
|
910
2313
|
|
|
2314
|
+
/**
|
|
2315
|
+
* A toggle switch component built on Radix UI primitives.
|
|
2316
|
+
* Supports horizontal and vertical layouts with label and helper text.
|
|
2317
|
+
*
|
|
2318
|
+
* @example
|
|
2319
|
+
* ```tsx
|
|
2320
|
+
* // Basic switch
|
|
2321
|
+
* <Switch label="Enable feature" />
|
|
2322
|
+
*
|
|
2323
|
+
* // Controlled switch
|
|
2324
|
+
* <Switch
|
|
2325
|
+
* label="Dark mode"
|
|
2326
|
+
* value={isDarkMode}
|
|
2327
|
+
* onChange={(enabled) => setIsDarkMode(enabled)}
|
|
2328
|
+
* />
|
|
2329
|
+
*
|
|
2330
|
+
* // Vertical layout with helper text
|
|
2331
|
+
* <Switch
|
|
2332
|
+
* label="Notifications"
|
|
2333
|
+
* helperText="Receive email notifications"
|
|
2334
|
+
* alignment="vertical"
|
|
2335
|
+
* />
|
|
2336
|
+
* ```
|
|
2337
|
+
*
|
|
2338
|
+
* @see {@link https://konstructio.github.io/konstruct-ui/?path=/docs/components-switch--docs Storybook}
|
|
2339
|
+
*/
|
|
911
2340
|
export declare const Switch: FC<SwitchProps>;
|
|
912
2341
|
|
|
2342
|
+
/**
|
|
2343
|
+
* Props for the Switch component.
|
|
2344
|
+
*
|
|
2345
|
+
* @example
|
|
2346
|
+
* ```tsx
|
|
2347
|
+
* <Switch label="Enable notifications" onChange={(enabled) => setEnabled(enabled)} />
|
|
2348
|
+
* <Switch label="Dark mode" value={isDark} onChange={setIsDark} />
|
|
2349
|
+
* <Switch label="Feature" helperText="Enable experimental features" alignment="vertical" />
|
|
2350
|
+
* ```
|
|
2351
|
+
*/
|
|
913
2352
|
declare interface SwitchProps extends VariantProps<typeof switchVariants> {
|
|
2353
|
+
/** Layout direction: horizontal (default) or vertical */
|
|
914
2354
|
alignment?: 'horizontal' | 'vertical';
|
|
2355
|
+
/** Additional CSS classes */
|
|
915
2356
|
className?: string;
|
|
2357
|
+
/** Initial checked state */
|
|
916
2358
|
defaultChecked?: boolean;
|
|
2359
|
+
/** Whether the switch is disabled */
|
|
917
2360
|
disabled?: boolean;
|
|
2361
|
+
/** Helper text displayed below the label */
|
|
918
2362
|
helperText?: string;
|
|
2363
|
+
/** CSS classes for helper text */
|
|
919
2364
|
helperTextClassName?: string;
|
|
2365
|
+
/** Label text displayed next to switch */
|
|
920
2366
|
label?: string;
|
|
2367
|
+
/** CSS classes for the label */
|
|
921
2368
|
labelClassName?: string;
|
|
2369
|
+
/** Form field name */
|
|
922
2370
|
name?: string;
|
|
2371
|
+
/** Theme override for this component */
|
|
923
2372
|
theme?: Theme;
|
|
2373
|
+
/** CSS classes for the thumb element */
|
|
924
2374
|
thumbClassName?: string;
|
|
2375
|
+
/** Controlled checked state */
|
|
925
2376
|
value?: boolean;
|
|
2377
|
+
/** Callback when checked state changes */
|
|
926
2378
|
onChange?: (e: boolean) => void;
|
|
927
2379
|
}
|
|
928
2380
|
|
|
929
2381
|
declare const switchVariants: (props?: ClassProp | undefined) => string;
|
|
930
2382
|
|
|
2383
|
+
/**
|
|
2384
|
+
* A composable table component with Head, Body, Row, and Filter sub-components.
|
|
2385
|
+
* For large datasets, consider using VirtualizedTable instead.
|
|
2386
|
+
*
|
|
2387
|
+
* @example
|
|
2388
|
+
* ```tsx
|
|
2389
|
+
* <Table>
|
|
2390
|
+
* <Table.Filter placeholder="Search..." />
|
|
2391
|
+
* <Table.Head>
|
|
2392
|
+
* <Table.Row>
|
|
2393
|
+
* <th>Name</th>
|
|
2394
|
+
* <th>Email</th>
|
|
2395
|
+
* <th>Role</th>
|
|
2396
|
+
* </Table.Row>
|
|
2397
|
+
* </Table.Head>
|
|
2398
|
+
* <Table.Body>
|
|
2399
|
+
* {users.map((user) => (
|
|
2400
|
+
* <Table.Row key={user.id}>
|
|
2401
|
+
* <td>{user.name}</td>
|
|
2402
|
+
* <td>{user.email}</td>
|
|
2403
|
+
* <td>{user.role}</td>
|
|
2404
|
+
* </Table.Row>
|
|
2405
|
+
* ))}
|
|
2406
|
+
* </Table.Body>
|
|
2407
|
+
* </Table>
|
|
2408
|
+
* ```
|
|
2409
|
+
*
|
|
2410
|
+
* @see {@link https://konstructio.github.io/konstruct-ui/?path=/docs/components-table--docs Storybook}
|
|
2411
|
+
*/
|
|
931
2412
|
export declare const Table: FC<TableProps> & {
|
|
932
2413
|
Head: FC<HeadProps>;
|
|
933
2414
|
Row: FC<RowProps>;
|
|
@@ -935,56 +2416,237 @@ export declare const Table: FC<TableProps> & {
|
|
|
935
2416
|
Body: FC<BodyProps>;
|
|
936
2417
|
};
|
|
937
2418
|
|
|
2419
|
+
/**
|
|
2420
|
+
* Props for the Table component.
|
|
2421
|
+
*
|
|
2422
|
+
* @example
|
|
2423
|
+
* ```tsx
|
|
2424
|
+
* <Table>
|
|
2425
|
+
* <Table.Head>
|
|
2426
|
+
* <Table.Row>
|
|
2427
|
+
* <th>Name</th>
|
|
2428
|
+
* <th>Email</th>
|
|
2429
|
+
* </Table.Row>
|
|
2430
|
+
* </Table.Head>
|
|
2431
|
+
* <Table.Body>
|
|
2432
|
+
* <Table.Row>
|
|
2433
|
+
* <td>John Doe</td>
|
|
2434
|
+
* <td>john@example.com</td>
|
|
2435
|
+
* </Table.Row>
|
|
2436
|
+
* </Table.Body>
|
|
2437
|
+
* </Table>
|
|
2438
|
+
* ```
|
|
2439
|
+
*/
|
|
938
2440
|
declare interface TableProps extends React.HTMLAttributes<HTMLTableElement>, PropsWithChildren, VariantProps<typeof tableVariants> {
|
|
2441
|
+
/** Theme override for this component */
|
|
939
2442
|
theme?: Theme;
|
|
940
2443
|
}
|
|
941
2444
|
|
|
942
2445
|
declare const tableVariants: (props?: ClassProp | undefined) => string;
|
|
943
2446
|
|
|
2447
|
+
/**
|
|
2448
|
+
* A tabs component built on Radix UI primitives.
|
|
2449
|
+
* Supports horizontal and vertical orientations with List, Trigger, and Content sub-components.
|
|
2450
|
+
*
|
|
2451
|
+
* @example
|
|
2452
|
+
* ```tsx
|
|
2453
|
+
* <Tabs defaultValue="overview">
|
|
2454
|
+
* <Tabs.List orientation="horizontal">
|
|
2455
|
+
* <Tabs.Trigger tab="overview" label="Overview" isActive />
|
|
2456
|
+
* <Tabs.Trigger tab="settings" label="Settings" isActive={false} />
|
|
2457
|
+
* <Tabs.Trigger tab="billing" label="Billing" isActive={false} />
|
|
2458
|
+
* </Tabs.List>
|
|
2459
|
+
*
|
|
2460
|
+
* <Tabs.Content value="overview">
|
|
2461
|
+
* Overview content here
|
|
2462
|
+
* </Tabs.Content>
|
|
2463
|
+
* <Tabs.Content value="settings">
|
|
2464
|
+
* Settings content here
|
|
2465
|
+
* </Tabs.Content>
|
|
2466
|
+
* <Tabs.Content value="billing">
|
|
2467
|
+
* Billing content here
|
|
2468
|
+
* </Tabs.Content>
|
|
2469
|
+
* </Tabs>
|
|
2470
|
+
* ```
|
|
2471
|
+
*
|
|
2472
|
+
* @see {@link https://konstructio.github.io/konstruct-ui/?path=/docs/components-tabs--docs Storybook}
|
|
2473
|
+
*/
|
|
944
2474
|
export declare const Tabs: FC<TabsProps> & {
|
|
945
2475
|
List: FC<ListProps>;
|
|
946
2476
|
Trigger: FC<TriggerProps>;
|
|
947
2477
|
Content: FC<ReactTabs.TabsContentProps>;
|
|
948
2478
|
};
|
|
949
2479
|
|
|
2480
|
+
/**
|
|
2481
|
+
* Props for the Tabs component.
|
|
2482
|
+
*
|
|
2483
|
+
* @example
|
|
2484
|
+
* ```tsx
|
|
2485
|
+
* <Tabs defaultValue="tab1">
|
|
2486
|
+
* <Tabs.List orientation="horizontal">
|
|
2487
|
+
* <Tabs.Trigger tab="tab1" label="Tab 1" isActive />
|
|
2488
|
+
* <Tabs.Trigger tab="tab2" label="Tab 2" isActive={false} />
|
|
2489
|
+
* </Tabs.List>
|
|
2490
|
+
* <Tabs.Content value="tab1">Content 1</Tabs.Content>
|
|
2491
|
+
* <Tabs.Content value="tab2">Content 2</Tabs.Content>
|
|
2492
|
+
* </Tabs>
|
|
2493
|
+
* ```
|
|
2494
|
+
*/
|
|
950
2495
|
declare interface TabsProps extends ReactTabs.TabsProps, PropsWithChildren {
|
|
2496
|
+
/** Theme override for this component */
|
|
951
2497
|
theme?: Theme;
|
|
952
2498
|
}
|
|
953
2499
|
|
|
2500
|
+
/**
|
|
2501
|
+
* A small label component for categorization, status display, or filtering.
|
|
2502
|
+
* Supports multiple color variants and optional icons.
|
|
2503
|
+
*
|
|
2504
|
+
* @example
|
|
2505
|
+
* ```tsx
|
|
2506
|
+
* <Tag id="1" label="New" color="green" />
|
|
2507
|
+
* <Tag id="2" label="Pending" color="gold" leftIcon={<Clock />} />
|
|
2508
|
+
* <Tag id="3" label="Error" color="pink" rightIcon={<X />} />
|
|
2509
|
+
* ```
|
|
2510
|
+
*
|
|
2511
|
+
* @see {@link https://konstructio.github.io/konstruct-ui/?path=/docs/components-tag--docs Storybook}
|
|
2512
|
+
*/
|
|
954
2513
|
export declare const Tag: FC<TagProps>;
|
|
955
2514
|
|
|
2515
|
+
/**
|
|
2516
|
+
* Props for the Tag component.
|
|
2517
|
+
* A small label component for categorization or status display.
|
|
2518
|
+
*
|
|
2519
|
+
* @example
|
|
2520
|
+
* ```tsx
|
|
2521
|
+
* <Tag
|
|
2522
|
+
* id="status-active"
|
|
2523
|
+
* label="Active"
|
|
2524
|
+
* color="green"
|
|
2525
|
+
* leftIcon={<CheckIcon />}
|
|
2526
|
+
* />
|
|
2527
|
+
* ```
|
|
2528
|
+
*/
|
|
956
2529
|
declare type TagProps = {
|
|
2530
|
+
/** Color variant for the tag */
|
|
957
2531
|
color?: 'gray' | 'gray-800' | 'cyan' | 'gold' | 'green' | 'light blue' | 'lime' | 'pink' | 'purple' | 'emerald' | 'fuscia' | 'indigo' | 'light-orange' | 'dark-sky-blue' | 'mistery';
|
|
2532
|
+
/** Unique identifier for the tag */
|
|
958
2533
|
id: string | number;
|
|
2534
|
+
/** Text displayed in the tag */
|
|
959
2535
|
label: string;
|
|
2536
|
+
/** Icon displayed after the label */
|
|
960
2537
|
rightIcon?: ReactNode;
|
|
2538
|
+
/** Icon displayed before the label */
|
|
961
2539
|
leftIcon?: ReactNode;
|
|
2540
|
+
/** Additional CSS classes */
|
|
962
2541
|
className?: string;
|
|
2542
|
+
/** Data attribute for the tag value */
|
|
963
2543
|
'data-value'?: string;
|
|
2544
|
+
/** Whether the tag is in a selected state */
|
|
964
2545
|
isSelected?: boolean;
|
|
965
2546
|
};
|
|
966
2547
|
|
|
2548
|
+
/**
|
|
2549
|
+
* An input component for selecting from a list of tag options.
|
|
2550
|
+
* Supports single and multi-selection modes.
|
|
2551
|
+
*
|
|
2552
|
+
* @example
|
|
2553
|
+
* ```tsx
|
|
2554
|
+
* <TagSelect
|
|
2555
|
+
* label="Skills"
|
|
2556
|
+
* placeholder="Select skills..."
|
|
2557
|
+
* options={[
|
|
2558
|
+
* { label: 'React', color: 'blue' },
|
|
2559
|
+
* { label: 'TypeScript', color: 'purple' },
|
|
2560
|
+
* { label: 'Node.js', color: 'green' },
|
|
2561
|
+
* ]}
|
|
2562
|
+
* multiselect
|
|
2563
|
+
* />
|
|
2564
|
+
* ```
|
|
2565
|
+
*
|
|
2566
|
+
* @see {@link https://konstructio.github.io/konstruct-ui/?path=/docs/components-tagselect--docs Storybook}
|
|
2567
|
+
*/
|
|
967
2568
|
export declare const TagSelect: FC<TagSelectProps>;
|
|
968
2569
|
|
|
2570
|
+
/**
|
|
2571
|
+
* Props for the TagSelect component.
|
|
2572
|
+
* An input that allows selecting from a list of tags.
|
|
2573
|
+
*
|
|
2574
|
+
* @example
|
|
2575
|
+
* ```tsx
|
|
2576
|
+
* <TagSelect
|
|
2577
|
+
* label="Categories"
|
|
2578
|
+
* placeholder="Select categories..."
|
|
2579
|
+
* options={[
|
|
2580
|
+
* { label: 'Frontend', color: 'blue' },
|
|
2581
|
+
* { label: 'Backend', color: 'green' },
|
|
2582
|
+
* { label: 'DevOps', color: 'purple' },
|
|
2583
|
+
* ]}
|
|
2584
|
+
* multiselect
|
|
2585
|
+
* />
|
|
2586
|
+
* ```
|
|
2587
|
+
*/
|
|
969
2588
|
declare interface TagSelectProps extends VariantProps<typeof tagSelectVariants> {
|
|
2589
|
+
/** Label displayed above the input */
|
|
970
2590
|
label?: string;
|
|
2591
|
+
/** Available tag options to select from */
|
|
971
2592
|
options: TagProps[];
|
|
2593
|
+
/** Form field name for the input */
|
|
972
2594
|
name?: string;
|
|
2595
|
+
/** Placeholder text when no selection */
|
|
973
2596
|
placeholder?: string;
|
|
2597
|
+
/** Additional CSS classes for the label */
|
|
974
2598
|
labelClassName?: string;
|
|
2599
|
+
/** Additional CSS classes for the wrapper */
|
|
975
2600
|
wrapperClassName?: string;
|
|
2601
|
+
/** Whether multiple tags can be selected */
|
|
976
2602
|
multiselect?: boolean;
|
|
977
2603
|
}
|
|
978
2604
|
|
|
979
2605
|
declare const tagSelectVariants: (props?: ClassProp | undefined) => string;
|
|
980
2606
|
|
|
2607
|
+
/**
|
|
2608
|
+
* A multiline text input component with optional label.
|
|
2609
|
+
*
|
|
2610
|
+
* @example
|
|
2611
|
+
* ```tsx
|
|
2612
|
+
* // Basic textarea
|
|
2613
|
+
* <TextArea label="Description" placeholder="Enter description..." />
|
|
2614
|
+
*
|
|
2615
|
+
* // Textarea with more rows
|
|
2616
|
+
* <TextArea label="Notes" rows={5} />
|
|
2617
|
+
*
|
|
2618
|
+
* // Controlled textarea
|
|
2619
|
+
* <TextArea
|
|
2620
|
+
* label="Comments"
|
|
2621
|
+
* value={comments}
|
|
2622
|
+
* onChange={(e) => setComments(e.target.value)}
|
|
2623
|
+
* />
|
|
2624
|
+
* ```
|
|
2625
|
+
*
|
|
2626
|
+
* @see {@link https://konstructio.github.io/konstruct-ui/?path=/docs/components-textarea--docs Storybook}
|
|
2627
|
+
*/
|
|
981
2628
|
export declare const TextArea: FC<TextAreaProps>;
|
|
982
2629
|
|
|
2630
|
+
/**
|
|
2631
|
+
* Props for the TextArea component.
|
|
2632
|
+
*
|
|
2633
|
+
* @example
|
|
2634
|
+
* ```tsx
|
|
2635
|
+
* <TextArea label="Description" placeholder="Enter description..." />
|
|
2636
|
+
* <TextArea label="Notes" rows={5} />
|
|
2637
|
+
* <TextArea name="bio" initialValue="Default text" />
|
|
2638
|
+
* ```
|
|
2639
|
+
*/
|
|
983
2640
|
declare interface TextAreaProps extends InputHTMLAttributes<HTMLTextAreaElement>, VariantProps<typeof textAreaVariants> {
|
|
2641
|
+
/** Number of visible text rows (default: 3) */
|
|
984
2642
|
rows?: number;
|
|
2643
|
+
/** Label displayed above the textarea */
|
|
985
2644
|
label?: string | ReactNode;
|
|
2645
|
+
/** Form field name */
|
|
986
2646
|
name?: string;
|
|
2647
|
+
/** Initial/default value */
|
|
987
2648
|
initialValue?: string;
|
|
2649
|
+
/** Theme override for this component */
|
|
988
2650
|
theme?: Theme;
|
|
989
2651
|
}
|
|
990
2652
|
|
|
@@ -994,7 +2656,11 @@ declare type Theme = 'kubefirst' | 'light' | 'kubefirst-dark' | 'dark' | undefin
|
|
|
994
2656
|
|
|
995
2657
|
export declare const ThemeContext: Context<ThemeContextType>;
|
|
996
2658
|
|
|
2659
|
+
/**
|
|
2660
|
+
* Props for the ThemeProvider component.
|
|
2661
|
+
*/
|
|
997
2662
|
export declare type ThemeContextProps = PropsWithChildren & {
|
|
2663
|
+
/** Initial theme to use */
|
|
998
2664
|
theme?: ThemeContextType['theme'];
|
|
999
2665
|
};
|
|
1000
2666
|
|
|
@@ -1008,20 +2674,90 @@ declare type ThemeProps = {
|
|
|
1008
2674
|
setTheme?: (theme: Theme) => void;
|
|
1009
2675
|
};
|
|
1010
2676
|
|
|
2677
|
+
/**
|
|
2678
|
+
* Theme provider component that wraps your app to enable theming.
|
|
2679
|
+
* Sets the `data-theme` attribute on the body element and persists theme choice in cookies.
|
|
2680
|
+
*
|
|
2681
|
+
* @example
|
|
2682
|
+
* ```tsx
|
|
2683
|
+
* // Wrap your app with ThemeProvider
|
|
2684
|
+
* import { ThemeProvider } from '@konstructio/ui';
|
|
2685
|
+
*
|
|
2686
|
+
* function App() {
|
|
2687
|
+
* return (
|
|
2688
|
+
* <ThemeProvider theme="kubefirst">
|
|
2689
|
+
* <YourApp />
|
|
2690
|
+
* </ThemeProvider>
|
|
2691
|
+
* );
|
|
2692
|
+
* }
|
|
2693
|
+
*
|
|
2694
|
+
* // Access theme in components
|
|
2695
|
+
* import { useTheme } from '@konstructio/ui';
|
|
2696
|
+
*
|
|
2697
|
+
* function MyComponent() {
|
|
2698
|
+
* const { theme, setTheme } = useTheme();
|
|
2699
|
+
* return <button onClick={() => setTheme('dark')}>Dark Mode</button>;
|
|
2700
|
+
* }
|
|
2701
|
+
* ```
|
|
2702
|
+
*
|
|
2703
|
+
* Available themes: 'kubefirst' | 'light' | 'kubefirst-dark' | 'dark'
|
|
2704
|
+
*/
|
|
1011
2705
|
export declare const ThemeProvider: FC<ThemeContextProps>;
|
|
1012
2706
|
|
|
2707
|
+
/**
|
|
2708
|
+
* A scrollable time picker component with 12 or 24 hour format support.
|
|
2709
|
+
* Features smooth scroll navigation through hours, minutes, and AM/PM options.
|
|
2710
|
+
*
|
|
2711
|
+
* @example
|
|
2712
|
+
* ```tsx
|
|
2713
|
+
* <TimePicker
|
|
2714
|
+
* label="Start Time"
|
|
2715
|
+
* name="startTime"
|
|
2716
|
+
* format="12"
|
|
2717
|
+
* time={selectedTime}
|
|
2718
|
+
* scrollBehavior="smooth"
|
|
2719
|
+
* />
|
|
2720
|
+
* ```
|
|
2721
|
+
*
|
|
2722
|
+
* @see {@link https://konstructio.github.io/konstruct-ui/?path=/docs/components-timepicker--docs Storybook}
|
|
2723
|
+
*/
|
|
1013
2724
|
export declare const TimePicker: FC<TimePickerProps>;
|
|
1014
2725
|
|
|
2726
|
+
/**
|
|
2727
|
+
* Props for the TimePicker component.
|
|
2728
|
+
* A scrollable time picker with support for 12 and 24 hour formats.
|
|
2729
|
+
*
|
|
2730
|
+
* @example
|
|
2731
|
+
* ```tsx
|
|
2732
|
+
* <TimePicker
|
|
2733
|
+
* label="Meeting Time"
|
|
2734
|
+
* name="meetingTime"
|
|
2735
|
+
* format="12"
|
|
2736
|
+
* time={new Date()}
|
|
2737
|
+
* isRequired
|
|
2738
|
+
* />
|
|
2739
|
+
* ```
|
|
2740
|
+
*/
|
|
1015
2741
|
declare type TimePickerProps = VariantProps<typeof timePickerVariants> & {
|
|
2742
|
+
/** Time format: '12' for AM/PM or '24' for military time */
|
|
1016
2743
|
format?: '12' | '24';
|
|
2744
|
+
/** Scroll behavior when navigating times */
|
|
1017
2745
|
scrollBehavior?: 'smooth' | 'auto';
|
|
2746
|
+
/** Currently selected time */
|
|
1018
2747
|
time?: Date;
|
|
2748
|
+
/** Form field name */
|
|
1019
2749
|
name?: string;
|
|
2750
|
+
/** Label displayed above the picker */
|
|
1020
2751
|
label?: string;
|
|
2752
|
+
/** Whether the field is required */
|
|
1021
2753
|
isRequired?: boolean;
|
|
2754
|
+
/** Additional CSS classes for the wrapper */
|
|
1022
2755
|
className?: string;
|
|
2756
|
+
/** Additional CSS classes for the scrollable list */
|
|
1023
2757
|
listClassName?: string;
|
|
2758
|
+
/** Additional CSS classes for list items */
|
|
1024
2759
|
listItemClassName?: string;
|
|
2760
|
+
/** Additional CSS classes for list item buttons */
|
|
1025
2761
|
listItemButtonClassName?: string;
|
|
1026
2762
|
};
|
|
1027
2763
|
|
|
@@ -1029,19 +2765,70 @@ declare const timePickerVariants: (props?: ClassProp | undefined) => string;
|
|
|
1029
2765
|
|
|
1030
2766
|
declare type TimeZone = keyof ReturnType<typeof getAllTimezones>;
|
|
1031
2767
|
|
|
2768
|
+
/**
|
|
2769
|
+
* A toast notification component built on Radix UI primitives.
|
|
2770
|
+
* Wraps a trigger element and shows a toast when clicked.
|
|
2771
|
+
*
|
|
2772
|
+
* @example
|
|
2773
|
+
* ```tsx
|
|
2774
|
+
* const [open, setOpen] = useState(false);
|
|
2775
|
+
*
|
|
2776
|
+
* <Toast
|
|
2777
|
+
* open={open}
|
|
2778
|
+
* setOpen={setOpen}
|
|
2779
|
+
* title="Saved"
|
|
2780
|
+
* description="Your changes have been saved successfully"
|
|
2781
|
+
* variant="success"
|
|
2782
|
+
* duration={3000}
|
|
2783
|
+
* >
|
|
2784
|
+
* <Button>Save Changes</Button>
|
|
2785
|
+
* </Toast>
|
|
2786
|
+
* ```
|
|
2787
|
+
*
|
|
2788
|
+
* @see {@link https://konstructio.github.io/konstruct-ui/?path=/docs/components-toast--docs Storybook}
|
|
2789
|
+
*/
|
|
1032
2790
|
export declare const Toast: FC<ToastProps>;
|
|
1033
2791
|
|
|
2792
|
+
/**
|
|
2793
|
+
* Props for the Toast component.
|
|
2794
|
+
*
|
|
2795
|
+
* @example
|
|
2796
|
+
* ```tsx
|
|
2797
|
+
* const [open, setOpen] = useState(false);
|
|
2798
|
+
*
|
|
2799
|
+
* <Toast
|
|
2800
|
+
* open={open}
|
|
2801
|
+
* setOpen={setOpen}
|
|
2802
|
+
* title="Success"
|
|
2803
|
+
* description="Your changes have been saved"
|
|
2804
|
+
* variant="success"
|
|
2805
|
+
* >
|
|
2806
|
+
* <Button onClick={() => setOpen(true)}>Show Toast</Button>
|
|
2807
|
+
* </Toast>
|
|
2808
|
+
* ```
|
|
2809
|
+
*/
|
|
1034
2810
|
declare interface ToastProps extends PropsWithChildren, VariantProps<typeof toastVariants> {
|
|
2811
|
+
/** Additional CSS classes for the toast */
|
|
1035
2812
|
className?: string;
|
|
2813
|
+
/** CSS classes for the close button */
|
|
1036
2814
|
closeButtonClassName?: string;
|
|
2815
|
+
/** Description text or element */
|
|
1037
2816
|
description: string | ReactNode;
|
|
2817
|
+
/** CSS classes for the description */
|
|
1038
2818
|
descriptionClassName?: string;
|
|
2819
|
+
/** Auto-dismiss duration in ms (default: 5000) */
|
|
1039
2820
|
duration?: number;
|
|
2821
|
+
/** Controlled open state */
|
|
1040
2822
|
open: boolean;
|
|
2823
|
+
/** Show close button (default: true) */
|
|
1041
2824
|
showCloseButton?: boolean;
|
|
2825
|
+
/** Theme override for this component */
|
|
1042
2826
|
theme?: Theme;
|
|
2827
|
+
/** Title text or element */
|
|
1043
2828
|
title: string | ReactNode;
|
|
2829
|
+
/** CSS classes for the title */
|
|
1044
2830
|
titleClassName?: string;
|
|
2831
|
+
/** Callback to update open state */
|
|
1045
2832
|
setOpen: (open: boolean) => void;
|
|
1046
2833
|
}
|
|
1047
2834
|
|
|
@@ -1049,12 +2836,54 @@ declare const toastVariants: (props?: ({
|
|
|
1049
2836
|
variant?: "warning" | "error" | "success" | null | undefined;
|
|
1050
2837
|
} & ClassProp) | undefined) => string;
|
|
1051
2838
|
|
|
2839
|
+
/**
|
|
2840
|
+
* A tooltip component that shows on hover.
|
|
2841
|
+
* Wraps any element and displays content on mouse enter.
|
|
2842
|
+
*
|
|
2843
|
+
* @example
|
|
2844
|
+
* ```tsx
|
|
2845
|
+
* // Basic tooltip
|
|
2846
|
+
* <Tooltip content="Click to save">
|
|
2847
|
+
* <Button>Save</Button>
|
|
2848
|
+
* </Tooltip>
|
|
2849
|
+
*
|
|
2850
|
+
* // Tooltip with position
|
|
2851
|
+
* <Tooltip content="More information" position="bottom">
|
|
2852
|
+
* <InfoIcon />
|
|
2853
|
+
* </Tooltip>
|
|
2854
|
+
*
|
|
2855
|
+
* // Tooltip on text
|
|
2856
|
+
* <Tooltip content="This is a helpful tip">
|
|
2857
|
+
* <span>Hover me</span>
|
|
2858
|
+
* </Tooltip>
|
|
2859
|
+
* ```
|
|
2860
|
+
*
|
|
2861
|
+
* @see {@link https://konstructio.github.io/konstruct-ui/?path=/docs/components-tooltip--docs Storybook}
|
|
2862
|
+
*/
|
|
1052
2863
|
export declare const Tooltip: FC<TooltipProps>;
|
|
1053
2864
|
|
|
2865
|
+
/**
|
|
2866
|
+
* Props for the Tooltip component.
|
|
2867
|
+
*
|
|
2868
|
+
* @example
|
|
2869
|
+
* ```tsx
|
|
2870
|
+
* <Tooltip content="Click to edit">
|
|
2871
|
+
* <Button>Edit</Button>
|
|
2872
|
+
* </Tooltip>
|
|
2873
|
+
*
|
|
2874
|
+
* <Tooltip content="More info here" position="bottom">
|
|
2875
|
+
* <InfoIcon />
|
|
2876
|
+
* </Tooltip>
|
|
2877
|
+
* ```
|
|
2878
|
+
*/
|
|
1054
2879
|
declare interface TooltipProps extends PropsWithChildren, VariantProps<typeof tooltipVariants> {
|
|
2880
|
+
/** Tooltip text or content */
|
|
1055
2881
|
content: ReactNode | string;
|
|
2882
|
+
/** CSS classes for the trigger element */
|
|
1056
2883
|
className?: string;
|
|
2884
|
+
/** CSS classes for the tooltip wrapper */
|
|
1057
2885
|
wrapperClassName?: string;
|
|
2886
|
+
/** Theme override for this component */
|
|
1058
2887
|
theme?: Theme;
|
|
1059
2888
|
}
|
|
1060
2889
|
|
|
@@ -1064,9 +2893,15 @@ declare const tooltipVariants: (props?: ({
|
|
|
1064
2893
|
|
|
1065
2894
|
export declare const Trigger: FC<TriggerProps>;
|
|
1066
2895
|
|
|
2896
|
+
/**
|
|
2897
|
+
* Props for Tabs.Trigger component.
|
|
2898
|
+
*/
|
|
1067
2899
|
declare interface TriggerProps extends VariantProps<typeof triggerVariants>, React.HTMLAttributes<HTMLDivElement> {
|
|
2900
|
+
/** Tab value identifier */
|
|
1068
2901
|
tab: string;
|
|
2902
|
+
/** Display label for the tab */
|
|
1069
2903
|
label: string;
|
|
2904
|
+
/** Whether this tab is active */
|
|
1070
2905
|
isActive: boolean;
|
|
1071
2906
|
}
|
|
1072
2907
|
|
|
@@ -1076,13 +2911,43 @@ declare const triggerVariants: (props?: ({
|
|
|
1076
2911
|
|
|
1077
2912
|
export declare const TruncateText: <TData>({ getValue, value }: Props_4<TData>) => JSX.Element;
|
|
1078
2913
|
|
|
2914
|
+
/**
|
|
2915
|
+
* A flexible typography component for consistent text styling.
|
|
2916
|
+
* Automatically selects semantic HTML elements based on variant.
|
|
2917
|
+
*
|
|
2918
|
+
* @example
|
|
2919
|
+
* ```tsx
|
|
2920
|
+
* <Typography variant="h1">Main Heading</Typography>
|
|
2921
|
+
* <Typography variant="body1">Paragraph text</Typography>
|
|
2922
|
+
* <Typography variant="subtitle1" component="span">Inline text</Typography>
|
|
2923
|
+
* <Typography variant="h3" component="label" htmlFor="input">Label</Typography>
|
|
2924
|
+
* ```
|
|
2925
|
+
*
|
|
2926
|
+
* @see {@link https://konstructio.github.io/konstruct-ui/?path=/docs/components-typography--docs Storybook}
|
|
2927
|
+
*/
|
|
1079
2928
|
export declare const Typography: ForwardRefExoticComponent<Omit<TypographyProps, 'ref'> & RefAttributes<HTMLParagraphElement & HTMLHeadingElement & HTMLLabelElement>>;
|
|
1080
2929
|
|
|
2930
|
+
/**
|
|
2931
|
+
* Props for the Typography component.
|
|
2932
|
+
* A flexible text component with semantic variants and theming.
|
|
2933
|
+
*
|
|
2934
|
+
* @example
|
|
2935
|
+
* ```tsx
|
|
2936
|
+
* <Typography variant="h1">Page Title</Typography>
|
|
2937
|
+
* <Typography variant="body1">Body text content</Typography>
|
|
2938
|
+
* <Typography variant="h2" component="p">Styled as h2 but renders as p</Typography>
|
|
2939
|
+
* ```
|
|
2940
|
+
*/
|
|
1081
2941
|
declare interface TypographyProps extends HTMLAttributes<ComponentRef<HeadingTag | 'p' | 'span'>>, VariantProps<typeof typographyVariants> {
|
|
2942
|
+
/** Ref to the underlying DOM element */
|
|
1082
2943
|
ref?: Ref<HTMLHeadingElement | HTMLParagraphElement | HTMLSpanElement>;
|
|
2944
|
+
/** Text content to display */
|
|
1083
2945
|
children: ReactNode;
|
|
2946
|
+
/** Override the rendered HTML element */
|
|
1084
2947
|
component?: HeadingTag | 'p' | 'span' | 'label';
|
|
2948
|
+
/** Theme override for this component */
|
|
1085
2949
|
theme?: Theme;
|
|
2950
|
+
/** For use with label component to associate with form input */
|
|
1086
2951
|
htmlFor?: string;
|
|
1087
2952
|
}
|
|
1088
2953
|
|