@konstructio/ui 0.1.2-alpha.5 → 0.1.2-alpha.50
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/{Combination-VYaRRJBZ.js → Combination-BtmnusWq.js} +141 -138
- package/dist/DatePicker.css +1 -1
- package/dist/Modal-CjC-CIJ8.js +99 -0
- package/dist/assets/icons/index.js +7 -0
- package/dist/chevron-down-DgT-uSF9.js +5 -0
- package/dist/chevron-right-DYvXLeql.js +7 -0
- package/dist/chevron-up-DEfvgPCw.js +54 -0
- package/dist/chevron-up-DrQr2Fwd.js +5 -0
- package/dist/components/Alert/Alert.js +2 -2
- package/dist/components/AlertDialog/AlertDialog.js +81 -53
- package/dist/components/AlertDialog/components/AlertDialogTrigger.js +3 -2
- package/dist/components/AlertDialog/components/index.js +1 -1
- package/dist/components/Badge/Badge.js +41 -44
- package/dist/components/Badge/Badge.variants.js +52 -13
- package/dist/components/Breadcrumb/Breadcrumb.js +1 -1
- package/dist/components/Breadcrumb/Breadcrumb.variants.js +3 -3
- package/dist/components/Breadcrumb/components/Item/Item.js +22 -22
- package/dist/components/Breadcrumb/components/Item/Item.variants.js +25 -14
- package/dist/components/Breadcrumb/hooks/useBreadcrumb.js +1 -1
- package/dist/components/Button/Button.js +1 -1
- package/dist/components/Button/Button.variants.js +108 -98
- package/dist/components/Card/Card.variants.js +7 -12
- package/dist/components/Checkbox/Checkbox.js +108 -105
- package/dist/components/Checkbox/Checkbox.variants.js +34 -7
- package/dist/components/Command/Command.js +2 -2
- package/dist/components/Command/components/Command.js +1 -1
- package/dist/components/Command/components/CommandEmpty.js +1 -1
- package/dist/components/Command/components/CommandGroup.js +1 -1
- package/dist/components/Command/components/CommandInput.js +2 -2
- package/dist/components/Command/components/CommandItem.js +1 -1
- package/dist/components/Command/components/CommandList.js +1 -1
- package/dist/components/Command/components/CommandSeparator.js +1 -1
- package/dist/components/Command/components/DialogContent.js +2 -2
- package/dist/components/Command/components/DialogOverlay.js +1 -1
- package/dist/components/Counter/Counter.js +210 -0
- package/dist/components/Counter/Counter.variants.js +70 -0
- package/dist/components/Datepicker/DatePicker.js +1587 -1353
- package/dist/components/Divider/Divider.variants.js +1 -1
- package/dist/components/DropdownButton/DropdownButton.js +1 -1
- package/dist/components/Filter/Filter.js +1 -1
- package/dist/components/Filter/Filter.variants.js +8 -7
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +71 -45
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.hook.js +2 -2
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.js +76 -43
- package/dist/components/Filter/components/ResetButton/ResetButton.js +15 -12
- package/dist/components/Filter/events/index.js +3 -3
- package/dist/components/ImageUpload/ImageUpload.js +221 -0
- package/dist/components/ImageUpload/ImageUpload.variants.js +109 -0
- package/dist/components/Input/Input.js +185 -118
- package/dist/components/Input/Input.variants.js +24 -19
- package/dist/components/Loading/Loading.js +1 -7
- package/dist/components/Modal/Modal.js +2 -2
- package/dist/components/Modal/components/Body/Body.js +1 -1
- package/dist/components/Modal/components/Footer/Footer.js +1 -1
- package/dist/components/Modal/components/Header/Header.js +1 -1
- package/dist/components/Modal/components/Wrapper/Wrapper.js +4 -4
- package/dist/components/Modal/components/index.js +1 -1
- package/dist/components/MultiSelectDropdown/MultiSelectDropdown.js +34 -0
- package/dist/components/MultiSelectDropdown/MultiSelectDropdown.variants.js +30 -0
- package/dist/components/MultiSelectDropdown/components/Item/Item.js +30 -0
- package/dist/components/MultiSelectDropdown/components/Item/Item.variants.js +38 -0
- package/dist/components/MultiSelectDropdown/components/List/List.js +30 -0
- package/dist/components/MultiSelectDropdown/components/List/List.variants.js +25 -0
- package/dist/components/MultiSelectDropdown/components/Wrapper/Wrapper.js +119 -0
- package/dist/components/MultiSelectDropdown/components/index.js +8 -0
- package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.context.js +21 -0
- package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.hook.js +13 -0
- package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.provider.js +138 -0
- package/dist/components/MultiSelectDropdown/contexts/index.js +6 -0
- package/dist/components/MultiSelectDropdown/hooks/useMultiSelectDropdown.js +32 -0
- package/dist/components/PhoneNumberInput/PhoneNumberInput.js +8 -0
- package/dist/components/PhoneNumberInput/PhoneNumberInput.variants.js +46 -0
- package/dist/components/PhoneNumberInput/components/FlagContent/FlagContent.js +36 -0
- package/dist/components/PhoneNumberInput/components/FlagSelectorList/FlagSelectorList.js +690 -0
- package/dist/components/PhoneNumberInput/components/FlagSelectorWrapper/FlagSelectorWrapper.js +60 -0
- package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +45 -0
- package/dist/components/PhoneNumberInput/components/Wrapper.js +651 -0
- package/dist/components/PhoneNumberInput/components/index.js +6 -0
- package/dist/components/PhoneNumberInput/contexts/index.js +8 -0
- package/dist/components/PhoneNumberInput/contexts/phone-number.context.js +28 -0
- package/dist/components/PhoneNumberInput/contexts/phone-number.hook.js +13 -0
- package/dist/components/PhoneNumberInput/contexts/phone-number.provider.js +6144 -0
- package/dist/components/PhoneNumberInput/utils/index.js +11 -0
- package/dist/components/PieChart/PieChart.js +463 -482
- package/dist/components/Radio/Radio.js +47 -44
- package/dist/components/Radio/Radio.variants.js +12 -8
- package/dist/components/RadioCard/RadioCard.variants.js +1 -6
- package/dist/components/RadioGroup/RadioGroup.js +10 -10
- package/dist/components/Range/Range.js +1 -1
- package/dist/components/Select/Select.js +48 -0
- package/dist/components/{Dropdown/Dropdown.variants.js → Select/Select.variants.js} +17 -11
- package/dist/components/Select/components/List/List.js +172 -0
- package/dist/components/{Dropdown → Select}/components/List/List.variants.js +11 -8
- package/dist/components/Select/components/ListItem/ListItem.js +117 -0
- package/dist/components/{Dropdown → Select}/components/ListItem/ListItem.variants.js +5 -4
- package/dist/components/Select/components/Wrapper.js +226 -0
- package/dist/components/Select/constants/index.js +4 -0
- package/dist/components/Select/constants/pagination.js +4 -0
- package/dist/components/Select/contexts/index.js +6 -0
- package/dist/components/Select/contexts/select.context.js +36 -0
- package/dist/components/Select/contexts/select.hook.js +11 -0
- package/dist/components/Select/contexts/select.provider.js +58 -0
- package/dist/components/Select/hooks/useNavigationList.js +50 -0
- package/dist/components/Select/hooks/useSelect.js +103 -0
- package/dist/components/Sidebar/Sidebar.variants.js +2 -2
- package/dist/components/Slider/Slider.js +1 -1
- package/dist/components/Switch/Switch.js +156 -129
- package/dist/components/Switch/Switch.variants.js +19 -10
- package/dist/components/Tabs/Tabs.js +1 -1
- package/dist/components/Tabs/Tabs.variants.js +4 -3
- package/dist/components/Tabs/components/Content.js +1 -1
- package/dist/components/Tabs/components/List.js +1 -1
- package/dist/components/Tabs/components/Trigger.js +1 -1
- package/dist/components/Tag/Tag.js +1 -1
- package/dist/components/Tag/Tag.variants.js +1 -0
- package/dist/components/TagSelect/components/Wrapper/Wrapper.js +49 -98
- package/dist/components/TimePicker/TimePicker.js +1 -1
- package/dist/components/TimePicker/TimePicker.variants.js +26 -14
- package/dist/components/TimePicker/components/MeridianList/MeridianList.js +30 -20
- package/dist/components/TimePicker/components/Wrapper/Wrapper.js +57 -35
- package/dist/components/TimePicker/components/WrapperList/WrapperList.js +53 -45
- package/dist/components/Toast/Toast.js +283 -256
- package/dist/components/Toast/Toast.variants.js +37 -24
- package/dist/components/Tooltip/Tooltip.js +15 -14
- package/dist/components/Tooltip/Tooltip.variants.js +5 -4
- package/dist/components/Typography/Typography.js +23 -25
- package/dist/components/Typography/Typography.variants.js +55 -52
- package/dist/components/VirtualizedTable/VirtualizedTable.js +97 -71
- package/dist/components/VirtualizedTable/components/Actions/Actions.js +95 -33
- package/dist/components/VirtualizedTable/components/Body/Body.js +73 -21
- package/dist/components/VirtualizedTable/components/DotPaginate/DotPaginate.js +94 -91
- package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +20 -20
- package/dist/components/VirtualizedTable/components/Filter/Filter.js +61 -44
- package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +33 -21
- package/dist/components/VirtualizedTable/components/Header/Header.js +61 -41
- package/dist/components/VirtualizedTable/components/Pagination/Pagination.js +43 -22
- package/dist/components/VirtualizedTable/components/Skeleton/Skeleton.js +106 -0
- package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.js +22 -1858
- package/dist/components/VirtualizedTable/components/WrapperBody/WrapperBody.js +27 -0
- package/dist/components/VirtualizedTable/components/index.js +8 -6
- package/dist/components/VirtualizedTable/contexts/table.context.js +1 -0
- package/dist/components/VirtualizedTable/contexts/table.provider.js +68 -761
- package/dist/components/index.js +94 -86
- package/dist/contexts/theme.provider.js +0 -1
- package/dist/{createLucideIcon-D2CN7Ma9.js → createLucideIcon-D4r5Phnh.js} +0 -24
- package/dist/ellipsis-vertical-BVPtjl5f.js +9 -0
- package/dist/{index-C1g_chDT.js → index-AV6ZtGhy.js} +2 -2
- package/dist/index-BG8O18ZY.js +93 -0
- package/dist/index-BKjcReYh.js +55 -0
- package/dist/{index-N2OStZoU.js → index-BOE_3f_Z.js} +4 -25
- package/dist/{index-Cd2vhaop.js → index-BlSRBdPy.js} +5 -6
- package/dist/index-BmVmDQGH.js +662 -0
- package/dist/index-BvoZGpli.js +60 -0
- package/dist/index-Byr10W8m.js +1873 -0
- package/dist/{index-Dx2grAuN.js → index-CSWGJT-v.js} +0 -20
- package/dist/index-CeZcoQDw.js +479 -0
- package/dist/index-D6KzX_ef.js +135 -0
- package/dist/{index-B7t8D14s.js → index-D9SSJ6om.js} +4 -4
- package/dist/index-DKfEnhKr.js +200 -0
- package/dist/index-DLcqcWxM.js +29 -0
- package/dist/{index-ti1b9kqV.js → index-DMb4KD0b.js} +4 -4
- package/dist/{index-BAEWsOG1.js → index-DtEcCIrM.js} +1 -1
- package/dist/{index-bwWKd82e.js → index-Dy59FQl5.js} +1 -1
- package/dist/{index-C84F4YyO.js → index-gSPwC-1I.js} +10 -11
- package/dist/{index-Bnb0ezr3.js → index-vcSp8YRZ.js} +11 -12
- package/dist/index.d.ts +2142 -99
- package/dist/index.js +116 -106
- package/dist/libphonenumber-FTwQ9nyV.js +11549 -0
- package/dist/loader-juvMSJ9L.js +5 -0
- package/dist/package.json +43 -33
- package/dist/styles.css +1 -1
- package/dist/ui/civo-theme.css +194 -168
- package/dist/ui/theme.css +27 -0
- package/dist/{useBreadcrumb-B8DnuqkR.js → useBreadcrumb-BAHbGQ_O.js} +0 -10
- package/dist/utils/index.js +534 -501
- package/dist/x-BXShoIAM.js +8 -0
- package/dist/{x-4F_5p77m.js → x-Eoa9FJjA.js} +1 -1
- package/package.json +43 -33
- package/dist/Modal-D-NOEWMX.js +0 -98
- package/dist/chevron-down-MZvQoT2F.js +0 -11
- package/dist/chevron-right-VYBOBhRt.js +0 -19
- package/dist/components/Dropdown/Dropdown.js +0 -42
- package/dist/components/Dropdown/components/List/List.js +0 -79
- package/dist/components/Dropdown/components/ListItem/ListItem.js +0 -67
- package/dist/components/Dropdown/components/Wrapper.js +0 -205
- package/dist/components/Dropdown/contexts/dropdown.context.js +0 -19
- package/dist/components/Dropdown/contexts/dropdown.hook.js +0 -13
- package/dist/components/Dropdown/contexts/dropdown.provider.js +0 -30
- package/dist/components/Dropdown/contexts/index.js +0 -6
- package/dist/components/Dropdown/hooks/useDropdown.js +0 -58
- package/dist/components/Dropdown/hooks/useNavigationList.js +0 -62
- package/dist/components/NumberInput/NumberInput.js +0 -179
- package/dist/components/NumberInput/NumberInput.variants.js +0 -50
- package/dist/components/TimePicker/components/WrapperList/WrapperList.variants.js +0 -16
- package/dist/index-BITvcJAz.js +0 -423
- package/dist/index-BfXxHr_2.js +0 -125
- package/dist/index-Cvx4lqTq.js +0 -47
- package/dist/index-DBbEcSUG.js +0 -31
- package/dist/index-DQH6odE9.js +0 -82
- package/dist/index-DzIBBMjs.js +0 -436
- package/dist/index-os7vysFS.js +0 -131
- /package/dist/components/{Dropdown → Select}/components/EmptyList.js +0 -0
- /package/dist/components/{Dropdown → Select}/components/index.js +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { AlertDialogProps as AlertDialogProps_2 } from '@radix-ui/react-alert-dialog';
|
|
2
2
|
import { ButtonHTMLAttributes } from 'react';
|
|
3
3
|
import { CellContext } from '@tanstack/react-table';
|
|
4
|
+
import { ChangeEvent } from 'react';
|
|
4
5
|
import { CheckboxProps as CheckboxProps_2 } from '@radix-ui/react-checkbox';
|
|
5
6
|
import { ClassProp } from 'class-variance-authority/types';
|
|
6
|
-
import {
|
|
7
|
+
import { ClassValue } from 'clsx';
|
|
8
|
+
import { ColumnDef as ColumnDef_2 } from '@tanstack/react-table';
|
|
7
9
|
import { ComponentRef } from 'react';
|
|
8
10
|
import { Context } from 'react';
|
|
9
11
|
import { DayPickerProps } from 'react-day-picker';
|
|
@@ -20,39 +22,141 @@ import { ReactNode } from 'react';
|
|
|
20
22
|
import * as ReactTabs from '@radix-ui/react-tabs';
|
|
21
23
|
import { Ref } from 'react';
|
|
22
24
|
import { RefAttributes } from 'react';
|
|
25
|
+
import { RegionCode } from 'google-libphonenumber';
|
|
23
26
|
import { RowData as RowData_2 } from '@tanstack/react-table';
|
|
24
27
|
import { SliderProps } from '@radix-ui/react-slider';
|
|
25
28
|
import { TabsContentProps } from '@radix-ui/react-tabs';
|
|
29
|
+
import { UseQueryOptions } from '@tanstack/react-query';
|
|
26
30
|
import { VariantProps } from 'class-variance-authority';
|
|
27
31
|
|
|
28
32
|
declare type Action<TData> = {
|
|
29
|
-
label: string;
|
|
33
|
+
label: string | React.ReactNode;
|
|
30
34
|
onClick: (rowData: TData) => void;
|
|
35
|
+
className?: string;
|
|
31
36
|
};
|
|
32
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
|
+
*/
|
|
33
67
|
export declare const Alert: FC<AlertProps>;
|
|
34
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
|
+
*/
|
|
35
97
|
export declare const AlertDialog: FC<AlertDialogProps>;
|
|
36
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
|
+
*/
|
|
37
113
|
declare interface AlertDialogProps extends PropsWithChildren, AlertDialogProps_2 {
|
|
114
|
+
/** Cancel button props (className, text, etc.) */
|
|
38
115
|
buttonCancel?: ButtonCancelProps;
|
|
116
|
+
/** Confirm button props (className, text, etc.) */
|
|
39
117
|
buttonConfirm?: ButtonConfirmProps;
|
|
118
|
+
/** Text for the trigger button */
|
|
40
119
|
buttonTriggerText?: string;
|
|
120
|
+
/** CSS classes for the trigger button */
|
|
41
121
|
buttonTriggerClassName?: string;
|
|
122
|
+
/** Variant for the trigger button */
|
|
123
|
+
buttonTriggerVariant?: ButtonProps['variant'];
|
|
124
|
+
/** Additional CSS classes */
|
|
42
125
|
className?: string;
|
|
126
|
+
/** Description text shown in the dialog */
|
|
43
127
|
description?: string | ReactNode;
|
|
128
|
+
/** Whether to show the cancel button (default: true) */
|
|
44
129
|
showCancelButton?: boolean;
|
|
130
|
+
/** Theme override for this component */
|
|
45
131
|
theme?: Theme;
|
|
132
|
+
/** Title text shown in the dialog */
|
|
46
133
|
title?: string | ReactNode;
|
|
134
|
+
/** CSS classes for the dialog wrapper */
|
|
47
135
|
wrapperClassName?: string;
|
|
136
|
+
/** Callback when confirm button is clicked */
|
|
48
137
|
onConfirm?: () => void;
|
|
49
138
|
}
|
|
50
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
|
+
*/
|
|
51
150
|
declare interface AlertProps extends VariantProps<typeof alertVariants> {
|
|
151
|
+
/** Whether the alert can be dismissed (deprecated, use showCloseButton) */
|
|
52
152
|
dismissible?: boolean;
|
|
153
|
+
/** Alert message content (string or ReactNode) */
|
|
53
154
|
content: string | ReactNode;
|
|
155
|
+
/** Whether the alert is visible */
|
|
54
156
|
isVisible?: boolean;
|
|
157
|
+
/** Show close button to dismiss alert */
|
|
55
158
|
showCloseButton?: boolean;
|
|
159
|
+
/** Theme override for this component */
|
|
56
160
|
theme?: Theme;
|
|
57
161
|
}
|
|
58
162
|
|
|
@@ -61,24 +165,107 @@ declare const alertVariants: (props?: ({
|
|
|
61
165
|
isVisible?: boolean | null | undefined;
|
|
62
166
|
} & ClassProp) | undefined) => string;
|
|
63
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
|
+
*/
|
|
64
196
|
export declare const Autocomplete: ForwardRefExoticComponent<AutocompleteProps & RefAttributes<HTMLInputElement>>;
|
|
65
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
|
+
*/
|
|
66
211
|
declare interface AutocompleteProps extends VariantProps<typeof autocompleteVariants> {
|
|
212
|
+
/** Disable browser autocomplete (default: 'off') */
|
|
67
213
|
autoComplete?: 'off';
|
|
214
|
+
/** Additional CSS classes */
|
|
68
215
|
className?: string;
|
|
216
|
+
/** Label displayed above the input */
|
|
69
217
|
label?: string;
|
|
218
|
+
/** CSS classes for the label */
|
|
70
219
|
labelClassName?: string;
|
|
220
|
+
/** Form field name */
|
|
71
221
|
name?: string;
|
|
72
|
-
options
|
|
222
|
+
/** Array of options to suggest */
|
|
223
|
+
options: Option_3[];
|
|
224
|
+
/** Placeholder text */
|
|
73
225
|
placeholder?: string;
|
|
226
|
+
/** Text shown when no options match */
|
|
74
227
|
placeHolderEmptyValues?: string | ReactNode;
|
|
228
|
+
/** CSS classes for empty state text */
|
|
75
229
|
placeHolderEmptyValuesClassName?: string;
|
|
230
|
+
/** Theme override for this component */
|
|
76
231
|
theme?: Theme;
|
|
232
|
+
/** Callback when a value is selected */
|
|
77
233
|
onChange(value: string): void;
|
|
78
234
|
}
|
|
79
235
|
|
|
80
236
|
declare const autocompleteVariants: (props?: ClassProp | undefined) => string;
|
|
81
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
|
+
*/
|
|
82
269
|
export declare const Badge: FC<BadgeProps>;
|
|
83
270
|
|
|
84
271
|
export declare const BadgeMultiSelect: FC<BadgeMultiSelectProps>;
|
|
@@ -90,35 +277,133 @@ declare type BadgeMultiSelectProps = {
|
|
|
90
277
|
onApply?: (selectedOptions: Option_5[]) => void;
|
|
91
278
|
};
|
|
92
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
|
+
*/
|
|
93
291
|
declare type BadgeProps = VariantProps<typeof badgeVariants> & {
|
|
94
|
-
|
|
292
|
+
/** Additional CSS classes */
|
|
95
293
|
className?: string;
|
|
96
|
-
|
|
294
|
+
/** Show dismiss button */
|
|
97
295
|
dismissible?: true;
|
|
296
|
+
/** Allow text selection (default: true) */
|
|
297
|
+
isSelectable?: boolean;
|
|
298
|
+
/** Badge text content */
|
|
299
|
+
label: string;
|
|
300
|
+
/** Icon displayed on the left */
|
|
301
|
+
leftIcon?: ReactNode;
|
|
302
|
+
/** Show loading spinner */
|
|
303
|
+
loading?: boolean;
|
|
304
|
+
/** Icon displayed on the right (when not dismissible) */
|
|
305
|
+
rightIcon?: ReactNode;
|
|
306
|
+
/** Click handler (makes badge interactive) */
|
|
98
307
|
onClick?: VoidFunction;
|
|
308
|
+
/** Callback when dismiss button clicked */
|
|
99
309
|
onDismiss?: VoidFunction;
|
|
100
310
|
};
|
|
101
311
|
|
|
102
312
|
declare const badgeVariants: (props?: ({
|
|
103
|
-
variant?: "info" | "warning" | "danger" | "default" | "success" | null | undefined;
|
|
313
|
+
variant?: "info" | "warning" | "danger" | "default" | "success" | "violet" | "orange" | null | undefined;
|
|
104
314
|
size?: "default" | null | undefined;
|
|
105
315
|
} & ClassProp) | undefined) => string;
|
|
106
316
|
|
|
317
|
+
/**
|
|
318
|
+
* Props for Table.Body component.
|
|
319
|
+
*/
|
|
107
320
|
declare interface BodyProps extends React.HTMLAttributes<HTMLTableSectionElement>, PropsWithChildren, VariantProps<typeof bodyVariants> {
|
|
108
321
|
}
|
|
109
322
|
|
|
110
323
|
declare const bodyVariants: (props?: ClassProp | undefined) => string;
|
|
111
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
|
+
*/
|
|
112
351
|
export declare const Breadcrumb: FC<BreadcrumbProps>;
|
|
113
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
|
+
*/
|
|
114
367
|
declare interface BreadcrumbProps extends VariantProps<typeof breadcrumbVariants>, HTMLAttributes<HTMLOListElement> {
|
|
368
|
+
/** Array of breadcrumb steps */
|
|
115
369
|
steps: Step[];
|
|
370
|
+
/** CSS classes for the nav wrapper */
|
|
116
371
|
wrapperClassName?: string;
|
|
372
|
+
/** Theme override for this component */
|
|
117
373
|
theme?: Theme;
|
|
118
374
|
}
|
|
119
375
|
|
|
120
376
|
declare const breadcrumbVariants: (props?: ClassProp | undefined) => string;
|
|
121
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
|
+
*/
|
|
122
407
|
export declare const Button: FC<ButtonProps>;
|
|
123
408
|
|
|
124
409
|
declare type ButtonBaseProps = Partial<ButtonProps> & {
|
|
@@ -130,15 +415,29 @@ declare type ButtonCancelProps = ButtonBaseProps;
|
|
|
130
415
|
|
|
131
416
|
declare type ButtonConfirmProps = ButtonBaseProps;
|
|
132
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
|
+
*/
|
|
133
428
|
declare interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'disabled'>, VariantProps<typeof buttonVariants> {
|
|
429
|
+
/** Ref to the underlying button element */
|
|
134
430
|
ref?: Ref<HTMLButtonElement>;
|
|
431
|
+
/** Merge props onto child element instead of rendering a button */
|
|
135
432
|
asChild?: boolean;
|
|
433
|
+
/** Whether the button is disabled */
|
|
136
434
|
disabled?: boolean;
|
|
435
|
+
/** Theme override for this component */
|
|
137
436
|
theme?: Theme;
|
|
138
437
|
}
|
|
139
438
|
|
|
140
439
|
declare const buttonVariants: (props?: ({
|
|
141
|
-
variant?: "danger" | "
|
|
440
|
+
variant?: "danger" | "link" | "primary" | "secondary" | "tertiary" | null | undefined;
|
|
142
441
|
shape?: "circle" | null | undefined;
|
|
143
442
|
version?: "default" | "alternate" | null | undefined;
|
|
144
443
|
disabled?: boolean | null | undefined;
|
|
@@ -146,12 +445,50 @@ declare const buttonVariants: (props?: ({
|
|
|
146
445
|
appearance?: "compact" | null | undefined;
|
|
147
446
|
} & ClassProp) | undefined) => string;
|
|
148
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
|
+
*/
|
|
149
472
|
export declare const Card: FC<CardProps>;
|
|
150
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
|
+
*/
|
|
151
484
|
declare interface CardProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof cardVariants>, PropsWithChildren {
|
|
485
|
+
/** Enable hover effect */
|
|
152
486
|
canHover?: boolean;
|
|
487
|
+
/** Show active/selected state */
|
|
153
488
|
isActive?: boolean;
|
|
489
|
+
/** Theme override for this component */
|
|
154
490
|
theme?: Theme;
|
|
491
|
+
/** CSS classes for the outer wrapper */
|
|
155
492
|
wrapperClassName?: string;
|
|
156
493
|
}
|
|
157
494
|
|
|
@@ -160,18 +497,60 @@ declare const cardVariants: (props?: ({
|
|
|
160
497
|
canHover?: boolean | null | undefined;
|
|
161
498
|
} & ClassProp) | undefined) => string;
|
|
162
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
|
+
*/
|
|
163
522
|
export declare const Checkbox: FC<CheckboxProps>;
|
|
164
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
|
+
*/
|
|
165
534
|
declare interface CheckboxProps extends Omit<CheckboxProps_2, 'onChange'>, Omit<VariantProps<typeof checkboxVariants>, 'checked'> {
|
|
535
|
+
/** ID of element that labels the checkbox for accessibility */
|
|
166
536
|
ariaLabelledBy?: string;
|
|
537
|
+
/** Additional CSS classes */
|
|
167
538
|
className?: string;
|
|
539
|
+
/** Initial checked state */
|
|
168
540
|
defaultChecked?: boolean;
|
|
541
|
+
/** Whether the checkbox is disabled */
|
|
169
542
|
disabled?: boolean;
|
|
543
|
+
/** HTML id attribute */
|
|
170
544
|
id?: string;
|
|
545
|
+
/** Label text displayed next to checkbox */
|
|
171
546
|
label?: string;
|
|
547
|
+
/** CSS classes for the label */
|
|
172
548
|
labelClassName?: string;
|
|
549
|
+
/** Form field name */
|
|
173
550
|
name?: string;
|
|
551
|
+
/** Theme override for this component */
|
|
174
552
|
theme?: Theme;
|
|
553
|
+
/** Callback when checked state changes */
|
|
175
554
|
onChange?: (checked: boolean) => void;
|
|
176
555
|
}
|
|
177
556
|
|
|
@@ -180,8 +559,102 @@ declare const checkboxVariants: (props?: ({
|
|
|
180
559
|
checked?: boolean | null | undefined;
|
|
181
560
|
} & ClassProp) | undefined) => string;
|
|
182
561
|
|
|
562
|
+
export declare const cn: (...inputs: ClassValue[]) => string;
|
|
563
|
+
|
|
564
|
+
export declare type ColumnDef<TData extends RowData> = ColumnDef_2<TData, string>;
|
|
565
|
+
|
|
183
566
|
export declare const Content: FC<TabsContentProps>;
|
|
184
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
|
+
*/
|
|
601
|
+
declare const Counter: FC<CounterProps>;
|
|
602
|
+
export { Counter }
|
|
603
|
+
export { Counter as NumberInput }
|
|
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
|
+
*/
|
|
619
|
+
declare interface CounterProps extends VariantProps<typeof counterVariants> {
|
|
620
|
+
/** Allow decrement button to be clicked */
|
|
621
|
+
canDecrement?: boolean;
|
|
622
|
+
/** Allow increment button to be clicked */
|
|
623
|
+
canIncrement?: boolean;
|
|
624
|
+
/** Additional CSS classes */
|
|
625
|
+
className?: string;
|
|
626
|
+
/** CSS classes for decrement button */
|
|
627
|
+
decrementButtonClassName?: string;
|
|
628
|
+
/** CSS classes for increment button */
|
|
629
|
+
incrementButtonClassName?: string;
|
|
630
|
+
/** Initial value (deprecated, use value) */
|
|
631
|
+
init?: number;
|
|
632
|
+
/** Show required indicator */
|
|
633
|
+
isRequired?: boolean;
|
|
634
|
+
/** Label displayed above the counter */
|
|
635
|
+
label?: string;
|
|
636
|
+
/** Maximum allowed value */
|
|
637
|
+
max?: number;
|
|
638
|
+
/** Minimum allowed value */
|
|
639
|
+
min?: number;
|
|
640
|
+
/** Form field name */
|
|
641
|
+
name?: string;
|
|
642
|
+
/** Theme override for this component */
|
|
643
|
+
theme?: Theme;
|
|
644
|
+
/** Current numeric value */
|
|
645
|
+
value?: number;
|
|
646
|
+
/** Callback when value changes */
|
|
647
|
+
onChange?: ({ target: { value } }: {
|
|
648
|
+
target: {
|
|
649
|
+
value: number;
|
|
650
|
+
};
|
|
651
|
+
}) => void;
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
declare const counterVariants: (props?: ClassProp | undefined) => string;
|
|
655
|
+
|
|
656
|
+
declare type CSSColor = `var(--${string})` | `rgb(${number}, ${number}, ${number})` | `rgba(${number}, ${number}, ${number}, ${number})` | `hsl(${number}, ${number}%, ${number}%)` | `hsla(${number}, ${number}%, ${number}%, ${number})`;
|
|
657
|
+
|
|
185
658
|
export declare const DateFilterDropdown: FC<DateFilterDropdownProps>;
|
|
186
659
|
|
|
187
660
|
declare type DateFilterDropdownProps = {
|
|
@@ -190,66 +663,163 @@ declare type DateFilterDropdownProps = {
|
|
|
190
663
|
onApply?: (date?: Date) => void;
|
|
191
664
|
};
|
|
192
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
|
+
*/
|
|
193
688
|
export declare const DatePicker: FC<DatePickerProps>;
|
|
194
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
|
+
*/
|
|
195
701
|
declare type DatePickerProps = Omit<DayPickerProps, 'mode'> & VariantProps<typeof datePickerVariants> & {
|
|
702
|
+
/** CSS classes for the navigation arrows */
|
|
196
703
|
arrowClassName?: string;
|
|
704
|
+
/** CSS classes for the months container */
|
|
197
705
|
monthsClassName?: string;
|
|
706
|
+
/** Timezone for date display */
|
|
198
707
|
timeZone?: TimeZone;
|
|
708
|
+
/** Initial selected date */
|
|
199
709
|
defaultSelected?: Date;
|
|
710
|
+
/** Callback when a date is selected */
|
|
200
711
|
onSelect?: (date: Date) => void;
|
|
201
712
|
};
|
|
202
713
|
|
|
203
714
|
declare const datePickerVariants: (props?: ClassProp | undefined) => string;
|
|
204
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
|
+
*/
|
|
205
730
|
export declare const Divider: FC<HTMLAttributes<HTMLDivElement>>;
|
|
206
731
|
|
|
207
|
-
|
|
208
|
-
|
|
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
|
+
*/
|
|
209
749
|
export declare const DropdownButton: FC<Props>;
|
|
210
750
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
};
|
|
234
|
-
|
|
235
|
-
declare const dropdownVariants: (props?: ({
|
|
236
|
-
hasError?: boolean | null | undefined;
|
|
237
|
-
} & ClassProp) | undefined) => string;
|
|
238
|
-
|
|
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
|
+
*/
|
|
239
773
|
export declare const Filter: FilterComponentProps;
|
|
240
774
|
|
|
775
|
+
declare type FilterAction = {
|
|
776
|
+
label: string;
|
|
777
|
+
onClick: () => void;
|
|
778
|
+
variant?: ButtonProps['variant'];
|
|
779
|
+
};
|
|
780
|
+
|
|
781
|
+
/**
|
|
782
|
+
* Filter compound component type with sub-components.
|
|
783
|
+
*/
|
|
241
784
|
declare type FilterComponentProps = FC<FilterProps> & {
|
|
242
785
|
BadgeMultiSelect: FC<BadgeMultiSelectProps>;
|
|
243
786
|
DateFilterDropdown: FC<DateFilterDropdownProps>;
|
|
244
787
|
ResetButton: FC<ResetButtonProps>;
|
|
245
788
|
};
|
|
246
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
|
+
*/
|
|
247
811
|
declare type FilterProps = VariantProps<typeof filterVariants> & PropsWithChildren & {
|
|
812
|
+
/** Additional CSS classes for the filter wrapper */
|
|
248
813
|
className?: string;
|
|
814
|
+
/** Theme override for this component */
|
|
249
815
|
theme?: Theme;
|
|
250
816
|
};
|
|
251
817
|
|
|
818
|
+
/**
|
|
819
|
+
* Props for Table.Filter component.
|
|
820
|
+
*/
|
|
252
821
|
declare interface FilterProps_2 extends React.InputHTMLAttributes<HTMLInputElement>, PropsWithChildren {
|
|
822
|
+
/** Placeholder text for the filter input */
|
|
253
823
|
placeholder?: string;
|
|
254
824
|
}
|
|
255
825
|
|
|
@@ -263,8 +833,12 @@ declare interface FooterProps extends PropsWithChildren, VariantProps<typeof foo
|
|
|
263
833
|
|
|
264
834
|
declare const footerVariants: (props?: ClassProp | undefined) => string;
|
|
265
835
|
|
|
836
|
+
/** Valid HTML heading tags */
|
|
266
837
|
declare type HeadingTag = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
267
838
|
|
|
839
|
+
/**
|
|
840
|
+
* Props for Table.Head component.
|
|
841
|
+
*/
|
|
268
842
|
declare interface HeadProps extends React.HTMLAttributes<HTMLTableSectionElement>, PropsWithChildren, VariantProps<typeof headVariants> {
|
|
269
843
|
}
|
|
270
844
|
|
|
@@ -272,17 +846,161 @@ declare const headVariants: (props?: ClassProp | undefined) => string;
|
|
|
272
846
|
|
|
273
847
|
declare type HexColor = `#${string}`;
|
|
274
848
|
|
|
275
|
-
|
|
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
|
+
*/
|
|
868
|
+
export declare const ImageUpload: {
|
|
869
|
+
({ className, error, fileName, fileSize, fileUrl, helperText, isRequired, label, labelClassName, name, onChange, onRemove, status, theme, uploadButtonText, accept, maxSize, }: ImageUploadProps): JSX.Element;
|
|
870
|
+
displayName: string;
|
|
871
|
+
};
|
|
276
872
|
|
|
277
|
-
|
|
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
|
+
*/
|
|
890
|
+
declare interface ImageUploadProps extends Omit<VariantProps<typeof imageUploadVariants>, 'status'> {
|
|
891
|
+
/** Additional CSS classes */
|
|
892
|
+
className?: string;
|
|
893
|
+
/** Error message to display */
|
|
278
894
|
error?: string;
|
|
895
|
+
/** Name of the uploaded file */
|
|
896
|
+
fileName?: string;
|
|
897
|
+
/** Formatted size of the uploaded file */
|
|
898
|
+
fileSize?: string;
|
|
899
|
+
/** URL or data URL of the uploaded file for preview */
|
|
900
|
+
fileUrl?: string;
|
|
901
|
+
/** Helper text displayed below the input */
|
|
902
|
+
helperText?: string;
|
|
903
|
+
/** Whether the field is required */
|
|
904
|
+
isRequired?: boolean;
|
|
905
|
+
/** Label displayed above the input */
|
|
279
906
|
label?: string | ReactNode;
|
|
907
|
+
/** Additional CSS classes for the label */
|
|
280
908
|
labelClassName?: string;
|
|
909
|
+
/** Form field name */
|
|
910
|
+
name?: string;
|
|
911
|
+
/** Callback fired when a file is selected */
|
|
912
|
+
onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
913
|
+
/** Callback fired when the uploaded file is removed */
|
|
914
|
+
onRemove?: () => void;
|
|
915
|
+
/** Current upload status */
|
|
916
|
+
status?: ImageUploadStatusType;
|
|
917
|
+
/** Theme override for this component */
|
|
281
918
|
theme?: Theme;
|
|
282
|
-
|
|
283
|
-
|
|
919
|
+
/** Text displayed on the upload button */
|
|
920
|
+
uploadButtonText?: string;
|
|
921
|
+
/** Accepted file MIME types (comma-separated) */
|
|
922
|
+
accept?: string;
|
|
923
|
+
/** Maximum file size in bytes */
|
|
924
|
+
maxSize?: number;
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
/**
|
|
928
|
+
* Upload status states for the ImageUpload component.
|
|
929
|
+
*/
|
|
930
|
+
declare enum ImageUploadStatus {
|
|
931
|
+
Default = "default",
|
|
932
|
+
Uploading = "uploading",
|
|
933
|
+
Complete = "complete",
|
|
934
|
+
Error = "error"
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
declare type ImageUploadStatusType = ImageUploadStatus;
|
|
938
|
+
|
|
939
|
+
declare const imageUploadVariants: (props?: ({
|
|
940
|
+
status?: "error" | "default" | "uploading" | "complete" | null | undefined;
|
|
941
|
+
} & ClassProp) | undefined) => string;
|
|
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
|
+
*/
|
|
975
|
+
export declare const Input: ForwardRefExoticComponent<InputProps & RefAttributes<HTMLInputElement>>;
|
|
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
|
+
*/
|
|
987
|
+
declare interface InputProps extends InputHTMLAttributes<HTMLInputElement>, VariantProps<typeof inputVariants> {
|
|
988
|
+
/** Error message to display below the input */
|
|
989
|
+
error?: string;
|
|
990
|
+
/** Helper text displayed below the input when no error */
|
|
284
991
|
helperText?: string;
|
|
992
|
+
/** Additional CSS classes for the helper text */
|
|
285
993
|
helperTextClassName?: string;
|
|
994
|
+
/** Show required indicator (*) next to label */
|
|
995
|
+
isRequired?: boolean;
|
|
996
|
+
/** Show search icon inside the input */
|
|
997
|
+
isSearch?: boolean;
|
|
998
|
+
/** Label text or element displayed above the input */
|
|
999
|
+
label?: string | ReactNode;
|
|
1000
|
+
/** Additional CSS classes for the label */
|
|
1001
|
+
labelClassName?: string;
|
|
1002
|
+
/** Theme override for this component */
|
|
1003
|
+
theme?: Theme;
|
|
286
1004
|
}
|
|
287
1005
|
|
|
288
1006
|
declare const inputVariants: (props?: ({
|
|
@@ -291,13 +1009,47 @@ declare const inputVariants: (props?: ({
|
|
|
291
1009
|
|
|
292
1010
|
export declare const List: FC<ListProps>;
|
|
293
1011
|
|
|
1012
|
+
/**
|
|
1013
|
+
* Props for Tabs.List component.
|
|
1014
|
+
*/
|
|
294
1015
|
declare interface ListProps extends React.HTMLAttributes<HTMLDivElement>, PropsWithChildren {
|
|
1016
|
+
/** Tab list orientation */
|
|
295
1017
|
orientation: 'horizontal' | 'vertical';
|
|
296
1018
|
}
|
|
297
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
|
+
*/
|
|
298
1040
|
export declare const Loading: FC<LoadingProps>;
|
|
299
1041
|
|
|
1042
|
+
/**
|
|
1043
|
+
* Props for the Loading component.
|
|
1044
|
+
*
|
|
1045
|
+
* @example
|
|
1046
|
+
* ```tsx
|
|
1047
|
+
* <Loading />
|
|
1048
|
+
* <Loading className="w-8 h-8" />
|
|
1049
|
+
* ```
|
|
1050
|
+
*/
|
|
300
1051
|
declare type LoadingProps = InputHTMLAttributes<SVGSVGElement> & VariantProps<typeof loadingVariants> & {
|
|
1052
|
+
/** Theme override for this component */
|
|
301
1053
|
theme?: Theme;
|
|
302
1054
|
};
|
|
303
1055
|
|
|
@@ -311,34 +1063,181 @@ declare interface LogoProps extends PropsWithChildren, VariantProps<typeof logoV
|
|
|
311
1063
|
|
|
312
1064
|
declare const logoVariants: (props?: ClassProp | undefined) => string;
|
|
313
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
|
+
*/
|
|
314
1092
|
export declare const Modal: FC<ModalProps> & {
|
|
315
1093
|
Header: FC<ModalChildProps>;
|
|
316
1094
|
Body: FC<ModalChildProps>;
|
|
317
1095
|
Footer: FC<ModalChildProps>;
|
|
318
1096
|
};
|
|
319
1097
|
|
|
1098
|
+
/**
|
|
1099
|
+
* Props for Modal sub-components (Header, Body, Footer).
|
|
1100
|
+
*/
|
|
320
1101
|
declare type ModalChildProps = {
|
|
1102
|
+
/** Content of the modal section */
|
|
321
1103
|
children: ReactNode;
|
|
1104
|
+
/** Additional CSS classes */
|
|
322
1105
|
className?: string;
|
|
1106
|
+
/** Merge props onto child element */
|
|
323
1107
|
asChild?: boolean;
|
|
324
1108
|
};
|
|
325
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
|
+
*/
|
|
326
1124
|
declare interface ModalProps extends PropsWithChildren, VariantProps<typeof modalVariants> {
|
|
1125
|
+
/** CSS classes for the close button */
|
|
327
1126
|
buttonCloseClassName?: string;
|
|
1127
|
+
/** Additional CSS classes for the modal */
|
|
328
1128
|
className?: string;
|
|
1129
|
+
/** DOM element to portal the modal into (defaults to document.body) */
|
|
329
1130
|
container?: Element | DocumentFragment;
|
|
1131
|
+
/** Whether the modal is open */
|
|
330
1132
|
isOpen?: boolean;
|
|
1133
|
+
/** Show the X close button in the corner */
|
|
1134
|
+
showCloseButton?: boolean;
|
|
1135
|
+
/** Theme override for this component */
|
|
331
1136
|
theme?: Theme;
|
|
1137
|
+
/** Callback when modal is closed (Escape key or close button) */
|
|
332
1138
|
onClose?: () => void;
|
|
333
1139
|
}
|
|
334
1140
|
|
|
335
1141
|
declare const modalVariants: (props?: ClassProp | undefined) => string;
|
|
336
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
|
+
*/
|
|
1163
|
+
export declare const MultiSelectDropdown: FC<MultiSelectDropdownProps>;
|
|
1164
|
+
|
|
1165
|
+
/**
|
|
1166
|
+
* Configuration for a multi-select dropdown option.
|
|
1167
|
+
*/
|
|
1168
|
+
declare type MultiSelectDropdownOption = {
|
|
1169
|
+
/** Unique identifier for the option */
|
|
1170
|
+
id: string | number;
|
|
1171
|
+
/** Display label for the option */
|
|
1172
|
+
label: string;
|
|
1173
|
+
/** Optional badge text displayed next to the label */
|
|
1174
|
+
badge?: string;
|
|
1175
|
+
/** Optional value (defaults to label if not provided) */
|
|
1176
|
+
value?: string;
|
|
1177
|
+
};
|
|
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
|
+
*/
|
|
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 */
|
|
1204
|
+
label?: string;
|
|
1205
|
+
/** Additional CSS classes for the label */
|
|
1206
|
+
labelClassName?: string;
|
|
1207
|
+
/** Whether multiple options can be selected */
|
|
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 */
|
|
1218
|
+
value?: MultiSelectDropdownOption[];
|
|
1219
|
+
/** Additional CSS classes for the wrapper */
|
|
1220
|
+
wrapperClassName?: string;
|
|
1221
|
+
/** Callback fired when selection changes */
|
|
1222
|
+
onChange?: OnChangeFn_2;
|
|
1223
|
+
/** Callback fired when the input loses focus */
|
|
1224
|
+
onBlur?: OnBlurFn;
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1227
|
+
declare const multiSelectDropdownVariants: (props?: ClassProp | undefined) => string;
|
|
1228
|
+
|
|
1229
|
+
/**
|
|
1230
|
+
* Configuration for a multi-select filter in the table.
|
|
1231
|
+
*/
|
|
337
1232
|
declare type MultiSelectFilter = {
|
|
1233
|
+
/** Unique key for the filter */
|
|
338
1234
|
key: string;
|
|
1235
|
+
/** Display label for the filter */
|
|
339
1236
|
label: string;
|
|
1237
|
+
/** Position of the filter dropdown */
|
|
340
1238
|
position?: 'right' | 'left';
|
|
341
|
-
options
|
|
1239
|
+
/** Available filter options */
|
|
1240
|
+
options: Option_5[];
|
|
342
1241
|
};
|
|
343
1242
|
|
|
344
1243
|
export declare const Navigation: FC<NavigationProps> & NavigationChildrenProps;
|
|
@@ -402,25 +1301,10 @@ declare const navigationTitleVariants: (props?: ClassProp | undefined) => string
|
|
|
402
1301
|
|
|
403
1302
|
declare const navigationVariants: (props?: ClassProp | undefined) => string;
|
|
404
1303
|
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
init?: number;
|
|
410
|
-
label?: string | ReactNode;
|
|
411
|
-
max?: number;
|
|
412
|
-
min?: number;
|
|
413
|
-
name?: string;
|
|
414
|
-
value?: number;
|
|
415
|
-
theme?: Theme;
|
|
416
|
-
onChange?: ({ target: { value } }: {
|
|
417
|
-
target: {
|
|
418
|
-
value: number;
|
|
419
|
-
};
|
|
420
|
-
}) => void;
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
declare const numberInputVariants: (props?: ClassProp | undefined) => string;
|
|
1304
|
+
declare type OnBlurFn = (event: {
|
|
1305
|
+
target: HTMLInputElement | null;
|
|
1306
|
+
type?: string;
|
|
1307
|
+
}) => void;
|
|
424
1308
|
|
|
425
1309
|
declare type OnChangeFn = (params: {
|
|
426
1310
|
target: {
|
|
@@ -429,70 +1313,265 @@ declare type OnChangeFn = (params: {
|
|
|
429
1313
|
};
|
|
430
1314
|
}) => void;
|
|
431
1315
|
|
|
1316
|
+
declare type OnChangeFn_2 = (params: {
|
|
1317
|
+
target: {
|
|
1318
|
+
value: MultiSelectDropdownOption[];
|
|
1319
|
+
name: string;
|
|
1320
|
+
};
|
|
1321
|
+
}) => void;
|
|
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
|
+
*/
|
|
432
1334
|
declare type Option_2 = {
|
|
1335
|
+
/** Display text for the option */
|
|
1336
|
+
label: string;
|
|
1337
|
+
/** Secondary text displayed below the label */
|
|
1338
|
+
subLabel?: string | ReactNode;
|
|
1339
|
+
/** Icon displayed on the left side of the option */
|
|
1340
|
+
leftIcon?: ReactNode | string;
|
|
1341
|
+
/** CSS classes for the left icon */
|
|
1342
|
+
leftIconClassName?: string;
|
|
1343
|
+
/** Show right component when this option is selected */
|
|
1344
|
+
showRightComponentOnselectedValue?: boolean;
|
|
1345
|
+
/** Component displayed on the right side of the option */
|
|
1346
|
+
rightComponent?: ReactNode | string;
|
|
1347
|
+
/** CSS classes for the right component */
|
|
1348
|
+
rightComponentClassName?: string;
|
|
1349
|
+
/** CSS classes for wrapper when this option is selected */
|
|
1350
|
+
wrapperClassNameOnSelectedValue?: string;
|
|
1351
|
+
/** Unique value for the option */
|
|
433
1352
|
value: string;
|
|
434
1353
|
};
|
|
435
1354
|
|
|
1355
|
+
/**
|
|
1356
|
+
* Option type for Autocomplete suggestions.
|
|
1357
|
+
*/
|
|
436
1358
|
declare type Option_3 = {
|
|
437
|
-
|
|
438
|
-
leftIcon?: ReactNode | string;
|
|
1359
|
+
/** The value to display and select */
|
|
439
1360
|
value: string;
|
|
440
1361
|
};
|
|
441
1362
|
|
|
1363
|
+
/**
|
|
1364
|
+
* Configuration for a dropdown menu option.
|
|
1365
|
+
*/
|
|
442
1366
|
declare type Option_4 = {
|
|
1367
|
+
/** The text or element displayed for this option */
|
|
443
1368
|
label: string | ReactNode;
|
|
1369
|
+
/** Callback fired when this option is selected */
|
|
444
1370
|
onClick?: VoidFunction;
|
|
445
1371
|
};
|
|
446
1372
|
|
|
1373
|
+
/**
|
|
1374
|
+
* Configuration for a filter option.
|
|
1375
|
+
*/
|
|
447
1376
|
declare type Option_5 = {
|
|
1377
|
+
/** Unique identifier for the option */
|
|
448
1378
|
id: string;
|
|
1379
|
+
/** Display label for the option */
|
|
449
1380
|
label: string;
|
|
1381
|
+
/** Visual variant for the badge */
|
|
450
1382
|
variant?: BadgeProps['variant'];
|
|
451
1383
|
};
|
|
452
1384
|
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
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
|
+
*/
|
|
1403
|
+
export declare const PhoneNumberInput: FC<Props_2>;
|
|
458
1404
|
|
|
459
|
-
|
|
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
|
+
*/
|
|
1422
|
+
export declare const PieChart: FC<Props_3>;
|
|
460
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
|
+
*/
|
|
461
1441
|
export declare const ProgressBar: FC<ProgressBarProps>;
|
|
462
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
|
+
*/
|
|
463
1452
|
declare interface ProgressBarProps extends VariantProps<typeof progressBarVariants> {
|
|
1453
|
+
/** CSS classes for the background bar */
|
|
464
1454
|
backgroundBarClassName?: string;
|
|
1455
|
+
/** Additional CSS classes */
|
|
465
1456
|
className?: string;
|
|
1457
|
+
/** Label text displayed above the progress bar */
|
|
466
1458
|
label?: string;
|
|
1459
|
+
/** CSS classes for the label */
|
|
467
1460
|
labelClassName?: string;
|
|
1461
|
+
/** CSS classes for the label wrapper */
|
|
468
1462
|
labelWrapperClassName?: string;
|
|
1463
|
+
/** Progress percentage (0-100) */
|
|
469
1464
|
percent: number;
|
|
1465
|
+
/** CSS classes for the percent text */
|
|
470
1466
|
percentClassName?: string;
|
|
1467
|
+
/** CSS classes for the progress bar fill */
|
|
471
1468
|
progressBarClassName?: string;
|
|
1469
|
+
/** Visual status of the progress bar */
|
|
472
1470
|
status?: 'success' | 'progress';
|
|
1471
|
+
/** Theme override for this component */
|
|
473
1472
|
theme?: Theme;
|
|
1473
|
+
/** CSS classes for the outer wrapper */
|
|
474
1474
|
wrapperClassName?: string;
|
|
475
1475
|
}
|
|
476
1476
|
|
|
477
1477
|
declare const progressBarVariants: (props?: ClassProp | undefined) => string;
|
|
478
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
|
+
*/
|
|
479
1493
|
declare type Props = {
|
|
1494
|
+
/** Additional CSS classes for the trigger button */
|
|
480
1495
|
buttonClassName?: string;
|
|
1496
|
+
/** Additional CSS classes for the wrapper container */
|
|
481
1497
|
className?: string;
|
|
1498
|
+
/** Additional CSS classes for each dropdown item */
|
|
482
1499
|
itemClassName?: string;
|
|
1500
|
+
/** Additional CSS classes for the dropdown list */
|
|
483
1501
|
listClassName?: string;
|
|
1502
|
+
/** Array of options to display in the dropdown */
|
|
484
1503
|
options: Option_4[];
|
|
485
1504
|
};
|
|
486
1505
|
|
|
487
1506
|
/**
|
|
488
|
-
* Props for the
|
|
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
|
+
*/
|
|
1521
|
+
declare type Props_2 = InputHTMLAttributes<HTMLInputElement> & {
|
|
1522
|
+
/** Default country code for the selector (e.g., 'US', 'GB') */
|
|
1523
|
+
defaultCountryCode?: RegionCode;
|
|
1524
|
+
/** Whether the input is disabled */
|
|
1525
|
+
disabled?: boolean;
|
|
1526
|
+
/** Error message to display */
|
|
1527
|
+
error?: string;
|
|
1528
|
+
/** Helper text displayed below the input */
|
|
1529
|
+
helperText?: string;
|
|
1530
|
+
/** Additional CSS classes for the helper text */
|
|
1531
|
+
helperTextClassName?: string;
|
|
1532
|
+
/** Whether the field is required */
|
|
1533
|
+
isRequired?: boolean;
|
|
1534
|
+
/** Label displayed above the input */
|
|
1535
|
+
label?: string;
|
|
1536
|
+
/** Additional CSS classes for the label */
|
|
1537
|
+
labelClassName?: string;
|
|
1538
|
+
/** Form field name */
|
|
1539
|
+
name?: string;
|
|
1540
|
+
/** Placeholder text for the input */
|
|
1541
|
+
placeholder?: string;
|
|
1542
|
+
/** Whether to show country flags in the search dropdown */
|
|
1543
|
+
showFlagOnSearch?: boolean;
|
|
1544
|
+
/** Whether to show the country filter input */
|
|
1545
|
+
showInputFilter?: boolean;
|
|
1546
|
+
/** Whether to show country names in the search dropdown */
|
|
1547
|
+
showNameOnSearch?: boolean;
|
|
1548
|
+
/** Whether to show the placeholder text */
|
|
1549
|
+
showPlaceHolder?: boolean;
|
|
1550
|
+
/** Additional CSS classes for the wrapper */
|
|
1551
|
+
wrapperClassName?: string;
|
|
1552
|
+
};
|
|
1553
|
+
|
|
1554
|
+
/**
|
|
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
|
+
* ```
|
|
489
1568
|
*/
|
|
490
|
-
declare type
|
|
1569
|
+
declare type Props_3 = {
|
|
491
1570
|
/**
|
|
492
1571
|
* Array of hexadecimal colors for the borders of the pie chart segments
|
|
493
1572
|
* @default ['#FFFFFF', '#FFFFFF']
|
|
494
1573
|
*/
|
|
495
|
-
borderColors?: HexColor[];
|
|
1574
|
+
borderColors?: HexColor[] | CSSColor[] | (HexColor | CSSColor)[];
|
|
496
1575
|
/**
|
|
497
1576
|
* Width of the border for pie chart segments in pixels
|
|
498
1577
|
* @default 0
|
|
@@ -502,7 +1581,7 @@ declare type Props_2 = {
|
|
|
502
1581
|
* Array of hexadecimal colors for filling the pie chart segments
|
|
503
1582
|
* @default ['#525252', '#00D492']
|
|
504
1583
|
*/
|
|
505
|
-
colors?: HexColor[];
|
|
1584
|
+
colors?: HexColor[] | CSSColor[] | (HexColor | CSSColor)[];
|
|
506
1585
|
/**
|
|
507
1586
|
* Percentage of the pie chart's center that should be cut out, creating a donut chart effect
|
|
508
1587
|
* @default 80
|
|
@@ -548,13 +1627,11 @@ declare type Props_2 = {
|
|
|
548
1627
|
* @required
|
|
549
1628
|
*/
|
|
550
1629
|
values: number[];
|
|
551
|
-
}
|
|
552
|
-
/**
|
|
1630
|
+
} /**
|
|
553
1631
|
* Union type that enforces either:
|
|
554
1632
|
* - No title and no subtitle
|
|
555
1633
|
* - Title with optional subtitle
|
|
556
|
-
*/
|
|
557
|
-
({
|
|
1634
|
+
*/ & ({
|
|
558
1635
|
title?: undefined;
|
|
559
1636
|
subtitle?: never;
|
|
560
1637
|
} | {
|
|
@@ -562,23 +1639,49 @@ declare type Props_2 = {
|
|
|
562
1639
|
subtitle?: string;
|
|
563
1640
|
});
|
|
564
1641
|
|
|
565
|
-
declare type
|
|
1642
|
+
declare type Props_4<TData extends RowData> = CellContext<TData, string> & {
|
|
566
1643
|
value?: string;
|
|
567
1644
|
};
|
|
568
1645
|
|
|
569
|
-
|
|
570
|
-
|
|
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
|
+
*/
|
|
1668
|
+
declare type Props_5<TData extends RowData_2> = VariantProps<typeof virtualizeTableVariants> & {
|
|
1669
|
+
id: string | string[];
|
|
571
1670
|
ariaLabel?: string;
|
|
572
|
-
columns:
|
|
1671
|
+
columns: ColumnDef_2<TData, string>[];
|
|
573
1672
|
data: TData[];
|
|
574
|
-
|
|
575
|
-
|
|
1673
|
+
className?: string;
|
|
1674
|
+
classNameHeaderActiveArrows?: string;
|
|
1675
|
+
classNameHeaderArrows?: string;
|
|
1676
|
+
classNameHeaderTable?: string;
|
|
1677
|
+
classNameTable?: string;
|
|
1678
|
+
classNameWrapperTable?: string;
|
|
1679
|
+
queryOptions?: Omit<UseQueryOptions<any, any, any, any>, 'queryKey' | 'queryFn'>;
|
|
1680
|
+
isLoading?: boolean;
|
|
1681
|
+
fetchData?: (params: Record<string, string | number | string[] | number[] | undefined>) => Promise<{
|
|
576
1682
|
data: TData[];
|
|
577
|
-
totalItemsCount
|
|
1683
|
+
totalItemsCount?: number;
|
|
578
1684
|
}>;
|
|
579
|
-
classNameHeaderTable?: string;
|
|
580
|
-
classNameHeaderArrows?: string;
|
|
581
|
-
classNameHeaderActiveArrows?: string;
|
|
582
1685
|
} & ({
|
|
583
1686
|
showPagination: true;
|
|
584
1687
|
showTotalItems?: boolean;
|
|
@@ -586,6 +1689,7 @@ declare type Props_4<TData extends RowData_2> = VariantProps<typeof virtualizeTa
|
|
|
586
1689
|
showDotPagination?: boolean;
|
|
587
1690
|
showFormPagination?: boolean;
|
|
588
1691
|
pageSizes?: number[] | string[];
|
|
1692
|
+
totalItems: number;
|
|
589
1693
|
} | {
|
|
590
1694
|
showPagination?: false | undefined;
|
|
591
1695
|
showTotalItems?: never;
|
|
@@ -593,28 +1697,113 @@ declare type Props_4<TData extends RowData_2> = VariantProps<typeof virtualizeTa
|
|
|
593
1697
|
showDotPagination?: never;
|
|
594
1698
|
showFormPagination?: never;
|
|
595
1699
|
pageSizes?: never;
|
|
1700
|
+
totalItems?: never;
|
|
596
1701
|
}) & ({
|
|
597
1702
|
filterSearchPlaceholder?: string;
|
|
598
1703
|
multiSelectFilter?: MultiSelectFilter[];
|
|
599
1704
|
showFilter: true;
|
|
600
1705
|
showFilterInput?: boolean;
|
|
1706
|
+
filterActions?: FilterAction[];
|
|
1707
|
+
showResetButton?: boolean;
|
|
1708
|
+
resetButtonClassName?: string;
|
|
601
1709
|
} | {
|
|
602
1710
|
filterSearchPlaceholder?: never;
|
|
603
1711
|
multiSelectFilter?: never;
|
|
604
1712
|
showFilter?: false | undefined;
|
|
605
1713
|
showFilterInput?: never;
|
|
1714
|
+
filterActions?: FilterAction[];
|
|
1715
|
+
showResetButton?: never;
|
|
1716
|
+
resetButtonClassName?: never;
|
|
606
1717
|
});
|
|
607
1718
|
|
|
608
|
-
declare type
|
|
1719
|
+
declare type Props_6<TData extends RowData> = CellContext<TData, unknown> & {
|
|
609
1720
|
actions: Action<TData>[];
|
|
1721
|
+
iconTriggerButtonClassName?: string;
|
|
1722
|
+
triggerButtonClassName?: string;
|
|
1723
|
+
wrapperActionsClassName?: string;
|
|
1724
|
+
wrapperClassName?: string;
|
|
1725
|
+
wrapperContentActionsClassName?: string;
|
|
610
1726
|
};
|
|
611
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
|
+
*/
|
|
612
1746
|
export declare const Radio: FC<RadioProps>;
|
|
613
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
|
+
*/
|
|
614
1766
|
export declare const RadioCard: FC<RadioCardProps>;
|
|
615
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
|
+
*/
|
|
616
1788
|
export declare const RadioCardGroup: FC<RadioCardGroupProps>;
|
|
617
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
|
+
*/
|
|
618
1807
|
declare type RadioCardGroupProps = {
|
|
619
1808
|
asChild?: boolean;
|
|
620
1809
|
className?: string;
|
|
@@ -627,38 +1816,138 @@ declare type RadioCardGroupProps = {
|
|
|
627
1816
|
onValueChange?: (value: string) => void;
|
|
628
1817
|
};
|
|
629
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
|
+
*/
|
|
630
1835
|
declare type RadioCardProps = Omit<CardProps, 'canHover' | 'isActive'> & Pick<RadioProps, 'name' | 'value' | 'checked' | 'onChange' | 'label' | 'disabled' | 'defaultChecked' | 'labelTextClassName' | 'description' | 'descriptionClassName'> & {
|
|
631
1836
|
labelWrapperClassName?: string;
|
|
632
1837
|
theme?: Theme;
|
|
633
1838
|
};
|
|
634
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
|
+
*/
|
|
635
1871
|
export declare const RadioGroup: FC<RadioGroupProps>;
|
|
636
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
|
+
*/
|
|
637
1890
|
declare interface RadioGroupProps {
|
|
1891
|
+
/** Merge props onto child element */
|
|
638
1892
|
asChild?: boolean;
|
|
1893
|
+
/** CSS classes for each radio option */
|
|
639
1894
|
className?: RadioProps['className'];
|
|
1895
|
+
/** Initially selected value */
|
|
640
1896
|
defaultChecked?: string;
|
|
1897
|
+
/** Layout direction (row or col) */
|
|
641
1898
|
direction?: 'row' | 'col';
|
|
1899
|
+
/** Label for the group */
|
|
642
1900
|
label?: string | ReactNode;
|
|
1901
|
+
/** Form field name (shared by all radios) */
|
|
643
1902
|
name: string;
|
|
1903
|
+
/** Array of radio options */
|
|
644
1904
|
options: Omit<RadioProps, 'name' | 'checked' | 'defaultChecked'>[];
|
|
1905
|
+
/** Theme override for this component */
|
|
645
1906
|
theme?: Theme;
|
|
1907
|
+
/** CSS classes for the wrapper */
|
|
646
1908
|
wrapperClassName?: string;
|
|
1909
|
+
/** Callback when selection changes */
|
|
647
1910
|
onValueChange?: (value: string) => void;
|
|
648
1911
|
}
|
|
649
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
|
+
*/
|
|
650
1927
|
declare interface RadioProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'disabled'>, VariantProps<typeof radioVariants> {
|
|
1928
|
+
/** Whether the radio is checked */
|
|
651
1929
|
checked?: boolean;
|
|
1930
|
+
/** Initial checked state (uncontrolled) */
|
|
652
1931
|
defaultChecked?: boolean;
|
|
1932
|
+
/** Whether the radio is disabled */
|
|
653
1933
|
disabled?: boolean;
|
|
1934
|
+
/** Label text or element */
|
|
654
1935
|
label?: string | ReactNode;
|
|
1936
|
+
/** CSS classes for the label text */
|
|
655
1937
|
labelTextClassName?: string;
|
|
1938
|
+
/** Form field name (groups radios together) */
|
|
656
1939
|
name: string;
|
|
1940
|
+
/** Description text below the label */
|
|
657
1941
|
description?: string | ReactNode;
|
|
1942
|
+
/** CSS classes for the description */
|
|
658
1943
|
descriptionClassName?: string;
|
|
1944
|
+
/** Value submitted when selected */
|
|
659
1945
|
value: string;
|
|
1946
|
+
/** CSS classes for the wrapper */
|
|
660
1947
|
wrapperClassName?: string;
|
|
1948
|
+
/** Theme override for this component */
|
|
661
1949
|
theme?: Theme;
|
|
1950
|
+
/** Callback when selected */
|
|
662
1951
|
onChange?: (value: string) => void;
|
|
663
1952
|
}
|
|
664
1953
|
|
|
@@ -667,18 +1956,61 @@ declare const radioVariants: (props?: ({
|
|
|
667
1956
|
checked?: boolean | null | undefined;
|
|
668
1957
|
} & ClassProp) | undefined) => string;
|
|
669
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
|
+
*/
|
|
670
1977
|
declare const Range_2: FC<RangeProps>;
|
|
671
1978
|
export { Range_2 as Range }
|
|
672
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
|
+
*/
|
|
673
1996
|
declare interface RangeProps extends VariantProps<typeof rangeVariants> {
|
|
1997
|
+
/** Additional CSS classes */
|
|
674
1998
|
className?: string;
|
|
1999
|
+
/** Initial range values [min, max] */
|
|
675
2000
|
defaultValue?: SliderProps['defaultValue'];
|
|
2001
|
+
/** Label displayed above the range slider */
|
|
676
2002
|
label?: string;
|
|
2003
|
+
/** Maximum value for the range */
|
|
677
2004
|
max?: SliderProps['max'];
|
|
2005
|
+
/** Minimum value for the range */
|
|
678
2006
|
min?: SliderProps['min'];
|
|
2007
|
+
/** Form field name for the hidden input */
|
|
679
2008
|
name?: string;
|
|
2009
|
+
/** Whether to display the current range values */
|
|
680
2010
|
showValue?: boolean;
|
|
2011
|
+
/** Size of the slider track and thumbs */
|
|
681
2012
|
size?: 'sm' | 'md' | 'lg';
|
|
2013
|
+
/** Theme override for this component */
|
|
682
2014
|
theme?: Theme;
|
|
683
2015
|
}
|
|
684
2016
|
|
|
@@ -689,11 +2021,18 @@ declare type ResetButtonProps = ButtonProps & {
|
|
|
689
2021
|
onClick?: VoidFunction;
|
|
690
2022
|
};
|
|
691
2023
|
|
|
692
|
-
|
|
2024
|
+
/** Base row data type from TanStack Table */
|
|
2025
|
+
export declare type RowData = RowData_2;
|
|
693
2026
|
|
|
2027
|
+
/**
|
|
2028
|
+
* Props for Table.Row component.
|
|
2029
|
+
*/
|
|
694
2030
|
declare interface RowProps extends React.HTMLAttributes<HTMLTableRowElement>, PropsWithChildren, VariantProps<typeof rowVariants> {
|
|
2031
|
+
/** Width of the row */
|
|
695
2032
|
width?: string;
|
|
2033
|
+
/** Whether the row is selected */
|
|
696
2034
|
isSelected?: boolean;
|
|
2035
|
+
/** Callback when row is selected */
|
|
697
2036
|
onSelect?: () => void;
|
|
698
2037
|
}
|
|
699
2038
|
|
|
@@ -701,8 +2040,154 @@ declare const rowVariants: (props?: ({
|
|
|
701
2040
|
isSelected?: boolean | null | undefined;
|
|
702
2041
|
} & ClassProp) | undefined) => string;
|
|
703
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
|
+
*/
|
|
2076
|
+
declare const Select: FC<SelectProps>;
|
|
2077
|
+
export { Select as Dropdown }
|
|
2078
|
+
export { Select }
|
|
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
|
+
*/
|
|
2114
|
+
declare type SelectProps = VariantProps<typeof selectVariants> & Omit<InputHTMLAttributes<HTMLInputElement>, 'value' | 'onChange'> & {
|
|
2115
|
+
additionalOptions?: ReactNode[] | string[];
|
|
2116
|
+
className?: string;
|
|
2117
|
+
disabled?: boolean;
|
|
2118
|
+
error?: string;
|
|
2119
|
+
errorClassName?: string;
|
|
2120
|
+
helperText?: string;
|
|
2121
|
+
helperTextClassName?: string;
|
|
2122
|
+
highlightSearch?: boolean;
|
|
2123
|
+
iconClassName?: string;
|
|
2124
|
+
inputClassName?: string;
|
|
2125
|
+
isLoading?: boolean;
|
|
2126
|
+
isRequired?: boolean;
|
|
2127
|
+
label?: string;
|
|
2128
|
+
labelClassName?: string;
|
|
2129
|
+
listClassName?: string;
|
|
2130
|
+
listItemClassName?: string;
|
|
2131
|
+
listItemSecondRowClassName?: string;
|
|
2132
|
+
mainWrapperClassName?: string;
|
|
2133
|
+
noOptionsText?: string;
|
|
2134
|
+
options: Option_2[];
|
|
2135
|
+
searchable?: boolean;
|
|
2136
|
+
showSearchIcon?: boolean;
|
|
2137
|
+
theme?: Theme;
|
|
2138
|
+
value?: string;
|
|
2139
|
+
wrapperClassName?: string;
|
|
2140
|
+
onBlur?: VoidFunction;
|
|
2141
|
+
onChange?: OnChangeFn;
|
|
2142
|
+
onSearchChange?: (searchTerm: string) => void;
|
|
2143
|
+
} & ({
|
|
2144
|
+
isInfiniteScrollEnabled: true;
|
|
2145
|
+
onFetchMoreOptions: (params: {
|
|
2146
|
+
page: number;
|
|
2147
|
+
pageSize: number;
|
|
2148
|
+
termOfSearch?: string;
|
|
2149
|
+
}) => Promise<{
|
|
2150
|
+
data: Option_2[];
|
|
2151
|
+
hasMore: boolean;
|
|
2152
|
+
}>;
|
|
2153
|
+
} | {
|
|
2154
|
+
isInfiniteScrollEnabled?: false | undefined;
|
|
2155
|
+
onFetchMoreOptions?: never;
|
|
2156
|
+
});
|
|
2157
|
+
|
|
2158
|
+
declare const selectVariants: (props?: ({
|
|
2159
|
+
hasError?: boolean | null | undefined;
|
|
2160
|
+
disabled?: boolean | null | undefined;
|
|
2161
|
+
} & ClassProp) | undefined) => string;
|
|
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
|
+
*/
|
|
704
2186
|
export declare const Sidebar: FC<SidebarProps> & SidebarChildrenProps;
|
|
705
2187
|
|
|
2188
|
+
/**
|
|
2189
|
+
* Sidebar compound component type with sub-components.
|
|
2190
|
+
*/
|
|
706
2191
|
declare type SidebarChildrenProps = {
|
|
707
2192
|
Footer: FC<FooterProps>;
|
|
708
2193
|
Logo: FC<LogoProps>;
|
|
@@ -712,56 +2197,218 @@ declare type SidebarChildrenProps = {
|
|
|
712
2197
|
NavigationSeparator: FC<NavigationSeparatorProps>;
|
|
713
2198
|
};
|
|
714
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
|
+
*/
|
|
715
2224
|
declare interface SidebarProps extends VariantProps<typeof wrapperSiderbarVariants>, PropsWithChildren {
|
|
2225
|
+
/** Whether the sidebar can be resized by dragging */
|
|
716
2226
|
canResize?: boolean;
|
|
2227
|
+
/** Additional CSS classes for the divider */
|
|
717
2228
|
dividerClassName?: string;
|
|
2229
|
+
/** Maximum width when resizing (in pixels) */
|
|
718
2230
|
maxWith?: number;
|
|
2231
|
+
/** Minimum width when resizing (in pixels) */
|
|
719
2232
|
minWith?: number;
|
|
2233
|
+
/** Theme override for this component */
|
|
720
2234
|
theme?: Theme;
|
|
2235
|
+
/** Additional CSS classes for the wrapper */
|
|
721
2236
|
wrapperClassName?: string;
|
|
722
2237
|
}
|
|
723
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
|
+
*/
|
|
724
2257
|
export declare const Slider: FC<SliderProps_2>;
|
|
725
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
|
+
*/
|
|
726
2275
|
declare interface SliderProps_2 extends VariantProps<typeof sliderVariants> {
|
|
2276
|
+
/** Additional CSS classes */
|
|
727
2277
|
className?: string;
|
|
2278
|
+
/** Initial value as single-element array */
|
|
728
2279
|
defaultValue?: SliderProps['defaultValue'];
|
|
2280
|
+
/** Label displayed above the slider */
|
|
729
2281
|
label?: string;
|
|
2282
|
+
/** Maximum value for the slider */
|
|
730
2283
|
max?: SliderProps['max'];
|
|
2284
|
+
/** Minimum value for the slider */
|
|
731
2285
|
min?: SliderProps['min'];
|
|
2286
|
+
/** Form field name for the hidden input */
|
|
732
2287
|
name?: string;
|
|
2288
|
+
/** Whether to display the current value */
|
|
733
2289
|
showValue?: boolean;
|
|
2290
|
+
/** Size of the slider track and thumb */
|
|
734
2291
|
size?: 'sm' | 'md' | 'lg';
|
|
2292
|
+
/** Theme override for this component */
|
|
735
2293
|
theme?: Theme;
|
|
736
2294
|
}
|
|
737
2295
|
|
|
738
2296
|
declare const sliderVariants: (props?: ClassProp | undefined) => string;
|
|
739
2297
|
|
|
2298
|
+
/**
|
|
2299
|
+
* A single step in the breadcrumb navigation.
|
|
2300
|
+
*/
|
|
740
2301
|
declare type Step = {
|
|
2302
|
+
/** Display text for the breadcrumb item */
|
|
741
2303
|
label: string;
|
|
2304
|
+
/** URL to navigate to when clicked */
|
|
742
2305
|
to?: string;
|
|
2306
|
+
/** Link target (_self or _blank) */
|
|
743
2307
|
target?: '_self' | '_blank';
|
|
2308
|
+
/** Whether this step is the current/active page */
|
|
744
2309
|
isActive?: boolean;
|
|
2310
|
+
/** Custom component to render (e.g., Link from react-router) */
|
|
745
2311
|
component?: FC<any>;
|
|
746
2312
|
};
|
|
747
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
|
+
*/
|
|
748
2340
|
export declare const Switch: FC<SwitchProps>;
|
|
749
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
|
+
*/
|
|
750
2352
|
declare interface SwitchProps extends VariantProps<typeof switchVariants> {
|
|
2353
|
+
/** Layout direction: horizontal (default) or vertical */
|
|
751
2354
|
alignment?: 'horizontal' | 'vertical';
|
|
2355
|
+
/** Additional CSS classes */
|
|
752
2356
|
className?: string;
|
|
2357
|
+
/** Initial checked state */
|
|
753
2358
|
defaultChecked?: boolean;
|
|
754
|
-
|
|
2359
|
+
/** Whether the switch is disabled */
|
|
2360
|
+
disabled?: boolean;
|
|
2361
|
+
/** Helper text displayed below the label */
|
|
755
2362
|
helperText?: string;
|
|
2363
|
+
/** CSS classes for helper text */
|
|
2364
|
+
helperTextClassName?: string;
|
|
2365
|
+
/** Label text displayed next to switch */
|
|
2366
|
+
label?: string;
|
|
2367
|
+
/** CSS classes for the label */
|
|
2368
|
+
labelClassName?: string;
|
|
2369
|
+
/** Form field name */
|
|
756
2370
|
name?: string;
|
|
2371
|
+
/** Theme override for this component */
|
|
757
2372
|
theme?: Theme;
|
|
2373
|
+
/** CSS classes for the thumb element */
|
|
758
2374
|
thumbClassName?: string;
|
|
2375
|
+
/** Controlled checked state */
|
|
759
2376
|
value?: boolean;
|
|
2377
|
+
/** Callback when checked state changes */
|
|
760
2378
|
onChange?: (e: boolean) => void;
|
|
761
2379
|
}
|
|
762
2380
|
|
|
763
2381
|
declare const switchVariants: (props?: ClassProp | undefined) => string;
|
|
764
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
|
+
*/
|
|
765
2412
|
export declare const Table: FC<TableProps> & {
|
|
766
2413
|
Head: FC<HeadProps>;
|
|
767
2414
|
Row: FC<RowProps>;
|
|
@@ -769,56 +2416,237 @@ export declare const Table: FC<TableProps> & {
|
|
|
769
2416
|
Body: FC<BodyProps>;
|
|
770
2417
|
};
|
|
771
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
|
+
*/
|
|
772
2440
|
declare interface TableProps extends React.HTMLAttributes<HTMLTableElement>, PropsWithChildren, VariantProps<typeof tableVariants> {
|
|
2441
|
+
/** Theme override for this component */
|
|
773
2442
|
theme?: Theme;
|
|
774
2443
|
}
|
|
775
2444
|
|
|
776
2445
|
declare const tableVariants: (props?: ClassProp | undefined) => string;
|
|
777
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
|
+
*/
|
|
778
2474
|
export declare const Tabs: FC<TabsProps> & {
|
|
779
2475
|
List: FC<ListProps>;
|
|
780
2476
|
Trigger: FC<TriggerProps>;
|
|
781
2477
|
Content: FC<ReactTabs.TabsContentProps>;
|
|
782
2478
|
};
|
|
783
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
|
+
*/
|
|
784
2495
|
declare interface TabsProps extends ReactTabs.TabsProps, PropsWithChildren {
|
|
2496
|
+
/** Theme override for this component */
|
|
785
2497
|
theme?: Theme;
|
|
786
2498
|
}
|
|
787
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
|
+
*/
|
|
788
2513
|
export declare const Tag: FC<TagProps>;
|
|
789
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
|
+
*/
|
|
790
2529
|
declare type TagProps = {
|
|
791
|
-
|
|
2530
|
+
/** Color variant for the tag */
|
|
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 */
|
|
792
2533
|
id: string | number;
|
|
2534
|
+
/** Text displayed in the tag */
|
|
793
2535
|
label: string;
|
|
2536
|
+
/** Icon displayed after the label */
|
|
794
2537
|
rightIcon?: ReactNode;
|
|
2538
|
+
/** Icon displayed before the label */
|
|
795
2539
|
leftIcon?: ReactNode;
|
|
2540
|
+
/** Additional CSS classes */
|
|
796
2541
|
className?: string;
|
|
2542
|
+
/** Data attribute for the tag value */
|
|
797
2543
|
'data-value'?: string;
|
|
2544
|
+
/** Whether the tag is in a selected state */
|
|
798
2545
|
isSelected?: boolean;
|
|
799
2546
|
};
|
|
800
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
|
+
*/
|
|
801
2568
|
export declare const TagSelect: FC<TagSelectProps>;
|
|
802
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
|
+
*/
|
|
803
2588
|
declare interface TagSelectProps extends VariantProps<typeof tagSelectVariants> {
|
|
2589
|
+
/** Label displayed above the input */
|
|
804
2590
|
label?: string;
|
|
2591
|
+
/** Available tag options to select from */
|
|
805
2592
|
options: TagProps[];
|
|
2593
|
+
/** Form field name for the input */
|
|
806
2594
|
name?: string;
|
|
2595
|
+
/** Placeholder text when no selection */
|
|
807
2596
|
placeholder?: string;
|
|
2597
|
+
/** Additional CSS classes for the label */
|
|
808
2598
|
labelClassName?: string;
|
|
2599
|
+
/** Additional CSS classes for the wrapper */
|
|
809
2600
|
wrapperClassName?: string;
|
|
2601
|
+
/** Whether multiple tags can be selected */
|
|
810
2602
|
multiselect?: boolean;
|
|
811
2603
|
}
|
|
812
2604
|
|
|
813
2605
|
declare const tagSelectVariants: (props?: ClassProp | undefined) => string;
|
|
814
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
|
+
*/
|
|
815
2628
|
export declare const TextArea: FC<TextAreaProps>;
|
|
816
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
|
+
*/
|
|
817
2640
|
declare interface TextAreaProps extends InputHTMLAttributes<HTMLTextAreaElement>, VariantProps<typeof textAreaVariants> {
|
|
2641
|
+
/** Number of visible text rows (default: 3) */
|
|
818
2642
|
rows?: number;
|
|
2643
|
+
/** Label displayed above the textarea */
|
|
819
2644
|
label?: string | ReactNode;
|
|
2645
|
+
/** Form field name */
|
|
820
2646
|
name?: string;
|
|
2647
|
+
/** Initial/default value */
|
|
821
2648
|
initialValue?: string;
|
|
2649
|
+
/** Theme override for this component */
|
|
822
2650
|
theme?: Theme;
|
|
823
2651
|
}
|
|
824
2652
|
|
|
@@ -828,7 +2656,11 @@ declare type Theme = 'kubefirst' | 'light' | 'kubefirst-dark' | 'dark' | undefin
|
|
|
828
2656
|
|
|
829
2657
|
export declare const ThemeContext: Context<ThemeContextType>;
|
|
830
2658
|
|
|
2659
|
+
/**
|
|
2660
|
+
* Props for the ThemeProvider component.
|
|
2661
|
+
*/
|
|
831
2662
|
export declare type ThemeContextProps = PropsWithChildren & {
|
|
2663
|
+
/** Initial theme to use */
|
|
832
2664
|
theme?: ThemeContextType['theme'];
|
|
833
2665
|
};
|
|
834
2666
|
|
|
@@ -842,20 +2674,90 @@ declare type ThemeProps = {
|
|
|
842
2674
|
setTheme?: (theme: Theme) => void;
|
|
843
2675
|
};
|
|
844
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
|
+
*/
|
|
845
2705
|
export declare const ThemeProvider: FC<ThemeContextProps>;
|
|
846
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
|
+
*/
|
|
847
2724
|
export declare const TimePicker: FC<TimePickerProps>;
|
|
848
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
|
+
*/
|
|
849
2741
|
declare type TimePickerProps = VariantProps<typeof timePickerVariants> & {
|
|
2742
|
+
/** Time format: '12' for AM/PM or '24' for military time */
|
|
850
2743
|
format?: '12' | '24';
|
|
2744
|
+
/** Scroll behavior when navigating times */
|
|
851
2745
|
scrollBehavior?: 'smooth' | 'auto';
|
|
2746
|
+
/** Currently selected time */
|
|
852
2747
|
time?: Date;
|
|
2748
|
+
/** Form field name */
|
|
853
2749
|
name?: string;
|
|
2750
|
+
/** Label displayed above the picker */
|
|
854
2751
|
label?: string;
|
|
855
|
-
required
|
|
2752
|
+
/** Whether the field is required */
|
|
2753
|
+
isRequired?: boolean;
|
|
2754
|
+
/** Additional CSS classes for the wrapper */
|
|
856
2755
|
className?: string;
|
|
2756
|
+
/** Additional CSS classes for the scrollable list */
|
|
857
2757
|
listClassName?: string;
|
|
2758
|
+
/** Additional CSS classes for list items */
|
|
858
2759
|
listItemClassName?: string;
|
|
2760
|
+
/** Additional CSS classes for list item buttons */
|
|
859
2761
|
listItemButtonClassName?: string;
|
|
860
2762
|
};
|
|
861
2763
|
|
|
@@ -863,42 +2765,143 @@ declare const timePickerVariants: (props?: ClassProp | undefined) => string;
|
|
|
863
2765
|
|
|
864
2766
|
declare type TimeZone = keyof ReturnType<typeof getAllTimezones>;
|
|
865
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
|
+
*/
|
|
866
2790
|
export declare const Toast: FC<ToastProps>;
|
|
867
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
|
+
*/
|
|
868
2810
|
declare interface ToastProps extends PropsWithChildren, VariantProps<typeof toastVariants> {
|
|
2811
|
+
/** Additional CSS classes for the toast */
|
|
869
2812
|
className?: string;
|
|
2813
|
+
/** CSS classes for the close button */
|
|
870
2814
|
closeButtonClassName?: string;
|
|
2815
|
+
/** Description text or element */
|
|
871
2816
|
description: string | ReactNode;
|
|
2817
|
+
/** CSS classes for the description */
|
|
872
2818
|
descriptionClassName?: string;
|
|
2819
|
+
/** Auto-dismiss duration in ms (default: 5000) */
|
|
873
2820
|
duration?: number;
|
|
2821
|
+
/** Controlled open state */
|
|
874
2822
|
open: boolean;
|
|
2823
|
+
/** Show close button (default: true) */
|
|
875
2824
|
showCloseButton?: boolean;
|
|
2825
|
+
/** Theme override for this component */
|
|
876
2826
|
theme?: Theme;
|
|
2827
|
+
/** Title text or element */
|
|
877
2828
|
title: string | ReactNode;
|
|
2829
|
+
/** CSS classes for the title */
|
|
878
2830
|
titleClassName?: string;
|
|
2831
|
+
/** Callback to update open state */
|
|
879
2832
|
setOpen: (open: boolean) => void;
|
|
880
2833
|
}
|
|
881
2834
|
|
|
882
|
-
declare const toastVariants: (props?:
|
|
2835
|
+
declare const toastVariants: (props?: ({
|
|
2836
|
+
variant?: "warning" | "error" | "success" | null | undefined;
|
|
2837
|
+
} & ClassProp) | undefined) => string;
|
|
883
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
|
+
*/
|
|
884
2863
|
export declare const Tooltip: FC<TooltipProps>;
|
|
885
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
|
+
*/
|
|
886
2879
|
declare interface TooltipProps extends PropsWithChildren, VariantProps<typeof tooltipVariants> {
|
|
2880
|
+
/** Tooltip text or content */
|
|
887
2881
|
content: ReactNode | string;
|
|
2882
|
+
/** CSS classes for the trigger element */
|
|
888
2883
|
className?: string;
|
|
2884
|
+
/** CSS classes for the tooltip wrapper */
|
|
889
2885
|
wrapperClassName?: string;
|
|
2886
|
+
/** Theme override for this component */
|
|
890
2887
|
theme?: Theme;
|
|
891
2888
|
}
|
|
892
2889
|
|
|
893
2890
|
declare const tooltipVariants: (props?: ({
|
|
894
|
-
position?: "left" | "right" | "
|
|
2891
|
+
position?: "left" | "right" | "top" | "bottom" | null | undefined;
|
|
895
2892
|
} & ClassProp) | undefined) => string;
|
|
896
2893
|
|
|
897
2894
|
export declare const Trigger: FC<TriggerProps>;
|
|
898
2895
|
|
|
2896
|
+
/**
|
|
2897
|
+
* Props for Tabs.Trigger component.
|
|
2898
|
+
*/
|
|
899
2899
|
declare interface TriggerProps extends VariantProps<typeof triggerVariants>, React.HTMLAttributes<HTMLDivElement> {
|
|
2900
|
+
/** Tab value identifier */
|
|
900
2901
|
tab: string;
|
|
2902
|
+
/** Display label for the tab */
|
|
901
2903
|
label: string;
|
|
2904
|
+
/** Whether this tab is active */
|
|
902
2905
|
isActive: boolean;
|
|
903
2906
|
}
|
|
904
2907
|
|
|
@@ -906,15 +2909,46 @@ declare const triggerVariants: (props?: ({
|
|
|
906
2909
|
variant?: "default" | "active" | "inactive" | null | undefined;
|
|
907
2910
|
} & ClassProp) | undefined) => string;
|
|
908
2911
|
|
|
909
|
-
export declare const TruncateText: <TData>({ getValue, value }:
|
|
2912
|
+
export declare const TruncateText: <TData>({ getValue, value }: Props_4<TData>) => JSX.Element;
|
|
910
2913
|
|
|
911
|
-
|
|
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
|
+
*/
|
|
2928
|
+
export declare const Typography: ForwardRefExoticComponent<Omit<TypographyProps, 'ref'> & RefAttributes<HTMLParagraphElement & HTMLHeadingElement & HTMLLabelElement>>;
|
|
912
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
|
+
*/
|
|
913
2941
|
declare interface TypographyProps extends HTMLAttributes<ComponentRef<HeadingTag | 'p' | 'span'>>, VariantProps<typeof typographyVariants> {
|
|
2942
|
+
/** Ref to the underlying DOM element */
|
|
914
2943
|
ref?: Ref<HTMLHeadingElement | HTMLParagraphElement | HTMLSpanElement>;
|
|
2944
|
+
/** Text content to display */
|
|
915
2945
|
children: ReactNode;
|
|
916
|
-
|
|
2946
|
+
/** Override the rendered HTML element */
|
|
2947
|
+
component?: HeadingTag | 'p' | 'span' | 'label';
|
|
2948
|
+
/** Theme override for this component */
|
|
917
2949
|
theme?: Theme;
|
|
2950
|
+
/** For use with label component to associate with form input */
|
|
2951
|
+
htmlFor?: string;
|
|
918
2952
|
}
|
|
919
2953
|
|
|
920
2954
|
declare const typographyVariants: (props?: ({
|
|
@@ -927,9 +2961,9 @@ export declare const useToggle: (initialState?: boolean) => [boolean, (value?: b
|
|
|
927
2961
|
|
|
928
2962
|
export declare const VirtualizedTable: VirtualizedTableCompound;
|
|
929
2963
|
|
|
930
|
-
declare type VirtualizedTableCompound = (<TData extends RowData>(props:
|
|
2964
|
+
declare type VirtualizedTableCompound = (<TData extends RowData>(props: Props_5<TData>) => JSX_2.Element) & {
|
|
931
2965
|
TruncateText: typeof TruncateText;
|
|
932
|
-
Actions: <TData extends RowData>(props:
|
|
2966
|
+
Actions: <TData extends RowData>(props: Props_6<TData>) => JSX_2.Element | null;
|
|
933
2967
|
displayName?: string;
|
|
934
2968
|
};
|
|
935
2969
|
|
|
@@ -938,3 +2972,12 @@ declare const virtualizeTableVariants: (props?: ClassProp | undefined) => string
|
|
|
938
2972
|
declare const wrapperSiderbarVariants: (props?: ClassProp | undefined) => string;
|
|
939
2973
|
|
|
940
2974
|
export { }
|
|
2975
|
+
|
|
2976
|
+
|
|
2977
|
+
declare module '@tanstack/react-table' {
|
|
2978
|
+
interface ColumnMeta<TData extends RowData, TValue> {
|
|
2979
|
+
className?: string | ((row: TData) => string);
|
|
2980
|
+
attributes?: Record<string, string | number | boolean>;
|
|
2981
|
+
headerClassName?: string;
|
|
2982
|
+
}
|
|
2983
|
+
}
|