@ktjs/mui 0.24.3 → 0.24.5
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/README.md +4 -0
- package/dist/index.d.ts +211 -84
- package/dist/index.mjs +526 -57
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -37,13 +37,17 @@ Styles are injected automatically through Emotion when components are imported.
|
|
|
37
37
|
- **Button** - Material-style buttons with variants and colors
|
|
38
38
|
- **Pill** - Chip-like pill labels with variants and colors
|
|
39
39
|
- **Badge** - Numeric and dot badges for status/count overlays
|
|
40
|
+
- **BottomNavigation** - Mobile-first bottom navigation bar
|
|
40
41
|
- **Dialog** - Modal dialogs
|
|
42
|
+
- **Menu** - Context and dropdown menus
|
|
43
|
+
- **Modal Helpers** - Async `alert/confirm/prompt` replacements
|
|
41
44
|
- **Popover** - Anchor-based floating layers
|
|
42
45
|
- **FormLabel** - Form labels for inputs
|
|
43
46
|
- **Input** - Text input fields
|
|
44
47
|
- **LinearProgress** - Progress bars
|
|
45
48
|
- **Radio** - Radio buttons
|
|
46
49
|
- **Select** - Dropdown select components
|
|
50
|
+
- **Tabs** - Tabbed navigation
|
|
47
51
|
- **Icons** - Various SVG icons
|
|
48
52
|
|
|
49
53
|
## Development
|
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,8 @@ interface KTMuiProps {
|
|
|
8
8
|
|
|
9
9
|
type KTMaybeReactive<T> = T | KTReactive<T>;
|
|
10
10
|
|
|
11
|
+
type KTMuiAlertSeverity = 'error' | 'warning' | 'info' | 'success';
|
|
12
|
+
type KTMuiAlertVariant = 'standard' | 'filled' | 'outlined';
|
|
11
13
|
interface KTMuiAlertProps extends KTMuiProps {
|
|
12
14
|
children: NonNullable<KTMuiProps['children']>;
|
|
13
15
|
/**
|
|
@@ -18,7 +20,7 @@ interface KTMuiAlertProps extends KTMuiProps {
|
|
|
18
20
|
* - 'success': Green color, success icon.
|
|
19
21
|
* @default 'info'
|
|
20
22
|
*/
|
|
21
|
-
severity?: KTMaybeReactive$1<
|
|
23
|
+
severity?: KTMaybeReactive$1<KTMuiAlertSeverity>;
|
|
22
24
|
/**
|
|
23
25
|
* The variant to use. It defines the style of the alert.
|
|
24
26
|
* - 'standard': The default style of the alert.
|
|
@@ -26,7 +28,7 @@ interface KTMuiAlertProps extends KTMuiProps {
|
|
|
26
28
|
* - 'outlined': An outlined version of the alert with a border.
|
|
27
29
|
* @default 'standard'
|
|
28
30
|
*/
|
|
29
|
-
variant?: KTMaybeReactive$1<
|
|
31
|
+
variant?: KTMaybeReactive$1<KTMuiAlertVariant>;
|
|
30
32
|
/**
|
|
31
33
|
* The icon to display in the alert. It can be a custom icon or a boolean value.
|
|
32
34
|
* - If `true`, the default icon based on the severity will be displayed.
|
|
@@ -47,16 +49,20 @@ interface KTMuiAlertProps extends KTMuiProps {
|
|
|
47
49
|
}
|
|
48
50
|
declare function Alert(props: KTMuiAlertProps): JSX.Element;
|
|
49
51
|
|
|
52
|
+
type KTMuiButtonVariant = 'contained' | 'outlined' | 'text';
|
|
53
|
+
type KTMuiButtonColor = 'primary' | 'secondary' | 'error' | 'warning' | 'info' | 'success';
|
|
54
|
+
type KTMuiButtonSize = 'small' | 'medium' | 'large';
|
|
55
|
+
type KTMuiButtonType = 'button' | 'submit' | 'reset';
|
|
50
56
|
interface KTMuiButtonProps extends KTMuiProps {
|
|
51
|
-
variant?: KTMaybeReactive<
|
|
52
|
-
color?: KTMaybeReactive<
|
|
53
|
-
size?: KTMaybeReactive<
|
|
57
|
+
variant?: KTMaybeReactive<KTMuiButtonVariant>;
|
|
58
|
+
color?: KTMaybeReactive<KTMuiButtonColor>;
|
|
59
|
+
size?: KTMaybeReactive<KTMuiButtonSize>;
|
|
54
60
|
disabled?: KTMaybeReactive<boolean>;
|
|
55
61
|
fullWidth?: KTMaybeReactive<boolean>;
|
|
56
62
|
iconOnly?: KTMaybeReactive<boolean>;
|
|
57
63
|
startIcon?: KTMaybeReactive<JSX.Element>;
|
|
58
64
|
endIcon?: KTMaybeReactive<JSX.Element>;
|
|
59
|
-
type?: KTMaybeReactive<
|
|
65
|
+
type?: KTMaybeReactive<KTMuiButtonType>;
|
|
60
66
|
'on:click'?: (e: MouseEvent) => void;
|
|
61
67
|
'on:dblclick'?: (e: MouseEvent) => void;
|
|
62
68
|
}
|
|
@@ -65,6 +71,28 @@ interface KTMuiButtonProps extends KTMuiProps {
|
|
|
65
71
|
*/
|
|
66
72
|
declare function Button(props: KTMuiButtonProps): JSX.Element;
|
|
67
73
|
|
|
74
|
+
interface KTMuiBottomNavigationAction {
|
|
75
|
+
value: string;
|
|
76
|
+
label: string | JSX.Element;
|
|
77
|
+
icon?: JSX.Element | HTMLElement;
|
|
78
|
+
disabled?: boolean;
|
|
79
|
+
showLabel?: boolean;
|
|
80
|
+
}
|
|
81
|
+
interface KTMuiBottomNavigationProps extends KTMuiProps {
|
|
82
|
+
value?: KTMaybeReactive<string>;
|
|
83
|
+
options: KTMaybeReactive<KTMuiBottomNavigationAction[]>;
|
|
84
|
+
showLabels?: KTMaybeReactive<boolean>;
|
|
85
|
+
'on:change'?: (value: string, oldValue: string, index: number, option?: KTMuiBottomNavigationAction) => void;
|
|
86
|
+
}
|
|
87
|
+
type KTMuiBottomNavigation = JSX.Element & {};
|
|
88
|
+
/**
|
|
89
|
+
* BottomNavigation component - mimics MUI BottomNavigation appearance and behavior
|
|
90
|
+
*/
|
|
91
|
+
declare function BottomNavigation(props: KTMuiBottomNavigationProps): KTMuiBottomNavigation;
|
|
92
|
+
|
|
93
|
+
type KTMuiDropdownButtonVariant = 'contained' | 'outlined' | 'text';
|
|
94
|
+
type KTMuiDropdownButtonColor = 'primary' | 'secondary' | 'error' | 'warning' | 'info' | 'success';
|
|
95
|
+
type KTMuiDropdownButtonSize = 'small' | 'medium' | 'large';
|
|
68
96
|
interface KTMuiDropdownButtonOption {
|
|
69
97
|
value: string;
|
|
70
98
|
label: string | JSX.Element;
|
|
@@ -82,15 +110,15 @@ interface KTMuiDropdownButtonProps extends KTMuiProps {
|
|
|
82
110
|
/**
|
|
83
111
|
* The variant to use - 'contained', 'outlined' or 'text'
|
|
84
112
|
*/
|
|
85
|
-
variant?: KTMaybeReactive<
|
|
113
|
+
variant?: KTMaybeReactive<KTMuiDropdownButtonVariant>;
|
|
86
114
|
/**
|
|
87
115
|
* The color to use - 'primary', 'secondary', 'error', 'warning', 'info' or 'success'
|
|
88
116
|
*/
|
|
89
|
-
color?: KTMaybeReactive<
|
|
117
|
+
color?: KTMaybeReactive<KTMuiDropdownButtonColor>;
|
|
90
118
|
/**
|
|
91
119
|
* The size of the button - 'small', 'medium' or 'large'
|
|
92
120
|
*/
|
|
93
|
-
size?: KTMaybeReactive<
|
|
121
|
+
size?: KTMaybeReactive<KTMuiDropdownButtonSize>;
|
|
94
122
|
/**
|
|
95
123
|
* Whether the button is disabled
|
|
96
124
|
*/
|
|
@@ -108,12 +136,14 @@ type KTMuiDropdownButton = JSX.Element & {};
|
|
|
108
136
|
*/
|
|
109
137
|
declare function DropdownButton(props: KTMuiDropdownButtonProps): KTMuiDropdownButton;
|
|
110
138
|
|
|
139
|
+
type KTMuiCheckboxSize = 'small' | 'medium';
|
|
140
|
+
type KTMuiCheckboxColor = 'primary' | 'secondary' | 'default' | 'success' | 'error' | 'warning';
|
|
111
141
|
interface KTMuiCheckboxProps extends Omit<KTMuiProps, 'children'> {
|
|
112
142
|
value?: KTMaybeReactive$1<string>;
|
|
113
143
|
label?: KTMaybeReactive$1<string | JSX.Element | HTMLElement>;
|
|
114
|
-
size?: KTMaybeReactive$1<
|
|
144
|
+
size?: KTMaybeReactive$1<KTMuiCheckboxSize>;
|
|
115
145
|
disabled?: KTMaybeReactive$1<boolean>;
|
|
116
|
-
color?: KTMaybeReactive$1<
|
|
146
|
+
color?: KTMaybeReactive$1<KTMuiCheckboxColor>;
|
|
117
147
|
indeterminate?: KTMaybeReactive$1<boolean>;
|
|
118
148
|
'on:change'?: (checked: boolean, value: string) => void;
|
|
119
149
|
}
|
|
@@ -130,7 +160,7 @@ type KTMuiCheckbox = JSX.Element & {
|
|
|
130
160
|
declare function Checkbox(props: KTMuiCheckboxProps, onChangeForGroup?: (checked: boolean, value: string) => void): KTMuiCheckbox;
|
|
131
161
|
|
|
132
162
|
interface KTMuiCheckboxGroupProps extends Omit<KTMuiProps, 'children'> {
|
|
133
|
-
size?: KTMaybeReactive$1<
|
|
163
|
+
size?: KTMaybeReactive$1<KTMuiCheckboxSize>;
|
|
134
164
|
options: KTMaybeReactive$1<Array<Omit<KTMuiCheckboxProps, 'value'> & {
|
|
135
165
|
value: string;
|
|
136
166
|
}>>;
|
|
@@ -143,17 +173,17 @@ type KTMuiCheckboxGroup = JSX.Element & {};
|
|
|
143
173
|
*/
|
|
144
174
|
declare function CheckboxGroup(props: KTMuiCheckboxGroupProps): KTMuiCheckboxGroup;
|
|
145
175
|
|
|
146
|
-
type
|
|
176
|
+
type KTMuiDialogSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | false;
|
|
147
177
|
interface KTMuiDialogProps extends Omit<KTMuiProps, 'children'> {
|
|
148
178
|
/**
|
|
149
179
|
* Controls whether the dialog is open or closed
|
|
150
180
|
* - Provide a `KTReactive` to make it reactive
|
|
151
181
|
*/
|
|
152
182
|
open?: KTMaybeReactive$1<boolean>;
|
|
153
|
-
title?: string
|
|
183
|
+
title?: KTMaybeReactive$1<string>;
|
|
154
184
|
children?: JSX.Element | JSX.Element[] | string | KTMaybeReactive$1<string> | KTMaybeReactive$1<JSX.Element> | KTMaybeReactive$1<JSX.Element[]>;
|
|
155
185
|
actions?: KTMaybeReactive$1<HTMLElement | HTMLElement[]>;
|
|
156
|
-
size?: KTMaybeReactive$1<
|
|
186
|
+
size?: KTMaybeReactive$1<KTMuiDialogSize>;
|
|
157
187
|
fullWidth?: KTMaybeReactive$1<boolean>;
|
|
158
188
|
'on:close'?: () => void;
|
|
159
189
|
}
|
|
@@ -164,6 +194,7 @@ type KTMuiDialog = JSX.Element;
|
|
|
164
194
|
*/
|
|
165
195
|
declare function Dialog(props: KTMuiDialogProps): KTMuiDialog;
|
|
166
196
|
|
|
197
|
+
type KTMuiFormLabelComponent = 'label' | 'legend';
|
|
167
198
|
interface KTMuiFormLabelProps extends Omit<KTMuiProps, 'children'> {
|
|
168
199
|
children: string | HTMLElement | JSX.Element;
|
|
169
200
|
/**
|
|
@@ -190,7 +221,7 @@ interface KTMuiFormLabelProps extends Omit<KTMuiProps, 'children'> {
|
|
|
190
221
|
* The component used for the root node. Either 'label' or 'legend'.
|
|
191
222
|
* - Not reactive
|
|
192
223
|
*/
|
|
193
|
-
component?:
|
|
224
|
+
component?: KTMuiFormLabelComponent;
|
|
194
225
|
htmlFor?: KTMaybeReactive$1<string>;
|
|
195
226
|
}
|
|
196
227
|
/**
|
|
@@ -198,6 +229,8 @@ interface KTMuiFormLabelProps extends Omit<KTMuiProps, 'children'> {
|
|
|
198
229
|
*/
|
|
199
230
|
declare function FormLabel(props: KTMuiFormLabelProps): JSX.Element;
|
|
200
231
|
|
|
232
|
+
type KTMuiLinearProgressVariant = 'determinate' | 'indeterminate';
|
|
233
|
+
type KTMuiLinearProgressColor = 'primary' | 'secondary' | 'error' | 'warning' | 'info' | 'success';
|
|
201
234
|
interface LinearProgressProps extends KTMuiProps {
|
|
202
235
|
/**
|
|
203
236
|
* The variant to use.
|
|
@@ -205,7 +238,7 @@ interface LinearProgressProps extends KTMuiProps {
|
|
|
205
238
|
* - `indeterminate` - Use when the progress is unknown.
|
|
206
239
|
* Default is `indeterminate`.
|
|
207
240
|
*/
|
|
208
|
-
variant?: KTMaybeReactive$1<
|
|
241
|
+
variant?: KTMaybeReactive$1<KTMuiLinearProgressVariant>;
|
|
209
242
|
/**
|
|
210
243
|
* The value of the progress indicator for the determinate variant. Value between 0 and 100.
|
|
211
244
|
*/
|
|
@@ -213,17 +246,119 @@ interface LinearProgressProps extends KTMuiProps {
|
|
|
213
246
|
/**
|
|
214
247
|
* The color of the component. It supports those theme colors that make sense for this component.
|
|
215
248
|
*/
|
|
216
|
-
color?: KTMaybeReactive$1<
|
|
249
|
+
color?: KTMaybeReactive$1<KTMuiLinearProgressColor>;
|
|
217
250
|
}
|
|
218
251
|
type KTMuiLinearProgress = JSX.Element & {
|
|
219
252
|
value: number;
|
|
220
253
|
};
|
|
221
254
|
declare function LinearProgress(props: LinearProgressProps): KTMuiLinearProgress;
|
|
222
255
|
|
|
256
|
+
type KTMuiPopoverVerticalOrigin = 'top' | 'center' | 'bottom';
|
|
257
|
+
type KTMuiPopoverHorizontalOrigin = 'left' | 'center' | 'right';
|
|
258
|
+
interface KTMuiPopoverOrigin {
|
|
259
|
+
vertical: KTMuiPopoverVerticalOrigin;
|
|
260
|
+
horizontal: KTMuiPopoverHorizontalOrigin;
|
|
261
|
+
}
|
|
262
|
+
type KTMuiPopoverCloseReason = 'backdropClick' | 'escapeKeyDown';
|
|
263
|
+
interface KTMuiPopoverProps extends KTMuiProps {
|
|
264
|
+
/**
|
|
265
|
+
* Indicates whether the popover is open.
|
|
266
|
+
*/
|
|
267
|
+
open?: KTMaybeReactive$1<boolean>;
|
|
268
|
+
/**
|
|
269
|
+
* The DOM element used as the anchor of the popover. The popover will appear next to this element.
|
|
270
|
+
*/
|
|
271
|
+
anchorEl?: HTMLElement | null | KTReactive<HTMLElement | null>;
|
|
272
|
+
/**
|
|
273
|
+
* Defines which part of the anchor element to align the popover with.
|
|
274
|
+
*/
|
|
275
|
+
anchorOrigin?: KTMaybeReactive$1<KTMuiPopoverOrigin>;
|
|
276
|
+
/**
|
|
277
|
+
* Defines which part of the popover to align with the anchor element.
|
|
278
|
+
*/
|
|
279
|
+
transformOrigin?: KTMaybeReactive$1<KTMuiPopoverOrigin>;
|
|
280
|
+
/**
|
|
281
|
+
* The margin between the popover and the edge of the screen.
|
|
282
|
+
* This is used to prevent the popover from being positioned in a way that it would be inaccessible to users, such as being off-screen.
|
|
283
|
+
*/
|
|
284
|
+
marginThreshold?: KTMaybeReactive$1<number>;
|
|
285
|
+
/**
|
|
286
|
+
* The elevation of the popover, which affects the shadow depth.
|
|
287
|
+
* It can be a value between 0 and 24.
|
|
288
|
+
*/
|
|
289
|
+
elevation?: KTMaybeReactive$1<number>;
|
|
290
|
+
'on:close'?: (reason: KTMuiPopoverCloseReason) => void;
|
|
291
|
+
}
|
|
292
|
+
type KTMuiPopover = JSX.Element & {};
|
|
293
|
+
/**
|
|
294
|
+
* Popover component - mimics MUI Popover appearance and behavior
|
|
295
|
+
*/
|
|
296
|
+
declare function Popover(props: KTMuiPopoverProps): KTMuiPopover;
|
|
297
|
+
|
|
298
|
+
type KTMuiMenuCloseReason = KTMuiPopoverCloseReason | 'itemClick';
|
|
299
|
+
interface KTMuiMenuOption {
|
|
300
|
+
value: string;
|
|
301
|
+
label: string | JSX.Element;
|
|
302
|
+
disabled?: boolean;
|
|
303
|
+
selected?: boolean;
|
|
304
|
+
}
|
|
305
|
+
type KTMuiMenuContent = KTMuiMenuOption | JSX.Element | HTMLElement | string;
|
|
306
|
+
interface KTMuiMenuProps extends KTMuiProps {
|
|
307
|
+
open?: KTMaybeReactive<boolean>;
|
|
308
|
+
anchorEl?: HTMLElement | null | KTReactive<HTMLElement | null>;
|
|
309
|
+
options?: KTMaybeReactive<KTMuiMenuContent[]>;
|
|
310
|
+
anchorOrigin?: KTMaybeReactive<KTMuiPopoverOrigin>;
|
|
311
|
+
transformOrigin?: KTMaybeReactive<KTMuiPopoverOrigin>;
|
|
312
|
+
marginThreshold?: KTMaybeReactive<number>;
|
|
313
|
+
elevation?: KTMaybeReactive<number>;
|
|
314
|
+
autoClose?: KTMaybeReactive<boolean>;
|
|
315
|
+
disableAutoFocusItem?: KTMaybeReactive<boolean>;
|
|
316
|
+
'on:close'?: (reason: KTMuiMenuCloseReason) => void;
|
|
317
|
+
'on:select'?: (value: string, option: KTMuiMenuOption) => void;
|
|
318
|
+
}
|
|
319
|
+
type KTMuiMenu = JSX.Element & {};
|
|
320
|
+
type KTMuiMenuVerticalOrigin = KTMuiPopoverVerticalOrigin;
|
|
321
|
+
type KTMuiMenuHorizontalOrigin = KTMuiPopoverHorizontalOrigin;
|
|
322
|
+
/**
|
|
323
|
+
* Menu component - mimics MUI Menu appearance and behavior
|
|
324
|
+
*/
|
|
325
|
+
declare function Menu(props: KTMuiMenuProps): KTMuiMenu;
|
|
326
|
+
|
|
327
|
+
type KTMuiModalContent = string | JSX.Element | HTMLElement;
|
|
328
|
+
interface KTMuiModalCommonOptions extends Pick<KTMuiProps, 'class' | 'style'> {
|
|
329
|
+
title?: string;
|
|
330
|
+
size?: KTMuiDialogSize;
|
|
331
|
+
fullWidth?: boolean;
|
|
332
|
+
confirmText?: string;
|
|
333
|
+
cancelText?: string;
|
|
334
|
+
}
|
|
335
|
+
interface KTMuiAlertOptions extends KTMuiModalCommonOptions {
|
|
336
|
+
}
|
|
337
|
+
interface KTMuiConfirmOptions extends KTMuiModalCommonOptions {
|
|
338
|
+
}
|
|
339
|
+
interface KTMuiPromptOptions extends KTMuiModalCommonOptions {
|
|
340
|
+
defaultValue?: string;
|
|
341
|
+
placeholder?: string;
|
|
342
|
+
inputType?: 'text' | 'password' | 'email' | 'number' | 'tel' | 'url';
|
|
343
|
+
validator?: (value: string) => boolean | string;
|
|
344
|
+
}
|
|
345
|
+
declare function modalAlert(content: KTMuiModalContent, options?: KTMuiAlertOptions): Promise<void>;
|
|
346
|
+
declare function modalConfirm(content: KTMuiModalContent, options?: KTMuiConfirmOptions): Promise<boolean>;
|
|
347
|
+
declare function modalPrompt(content: KTMuiModalContent, options?: KTMuiPromptOptions): Promise<string | null>;
|
|
348
|
+
declare const Modal: {
|
|
349
|
+
alert: typeof modalAlert;
|
|
350
|
+
confirm: typeof modalConfirm;
|
|
351
|
+
prompt: typeof modalPrompt;
|
|
352
|
+
};
|
|
353
|
+
declare const alert: typeof modalAlert;
|
|
354
|
+
declare const confirm: typeof modalConfirm;
|
|
355
|
+
declare const prompt: typeof modalPrompt;
|
|
356
|
+
|
|
223
357
|
type ChangeHandler<T = string> = (value: T, ...args: any[]) => void;
|
|
224
358
|
|
|
225
|
-
type
|
|
226
|
-
|
|
359
|
+
type KTMuiTextFieldType = 'text' | 'password' | 'email' | 'number' | 'tel' | 'url';
|
|
360
|
+
type KTMuiTextFieldSize = 'small' | 'medium';
|
|
361
|
+
interface KTMuiTextFieldProps<T extends KTMuiTextFieldType = 'text'> extends KTMuiProps {
|
|
227
362
|
'k-model'?: T extends 'number' ? KTReactive<number> : KTReactive<string>;
|
|
228
363
|
label?: KTMaybeReactive<string>;
|
|
229
364
|
placeholder?: KTMaybeReactive<string>;
|
|
@@ -237,28 +372,30 @@ interface KTMuiTextFieldProps<T extends InputTypes = 'text'> extends KTMuiProps
|
|
|
237
372
|
fullWidth?: KTMaybeReactive<boolean>;
|
|
238
373
|
multiline?: boolean;
|
|
239
374
|
rows?: KTMaybeReactive<number>;
|
|
240
|
-
size?:
|
|
375
|
+
size?: KTMuiTextFieldSize | KTReactive<KTMuiTextFieldSize>;
|
|
241
376
|
'on:input'?: ChangeHandler<T extends 'number' ? number : T extends 'date' ? Date : string>;
|
|
242
377
|
'on:change'?: ChangeHandler<T extends 'number' ? number : T extends 'date' ? Date : string>;
|
|
243
378
|
'on:blur'?: () => void;
|
|
244
379
|
'on:focus'?: () => void;
|
|
245
380
|
}
|
|
246
381
|
type KTMuiTextField = JSX.Element;
|
|
247
|
-
declare function TextField<T extends
|
|
382
|
+
declare function TextField<T extends KTMuiTextFieldType = 'text'>(props: KTMuiTextFieldProps<T>): KTMuiTextField;
|
|
248
383
|
|
|
384
|
+
type KTMuiRadioSize = 'small' | 'medium';
|
|
385
|
+
type KTMuiRadioColor = 'primary' | 'secondary' | 'default';
|
|
249
386
|
interface KTMuiRadioProps extends KTMuiProps {
|
|
250
387
|
value: string;
|
|
251
388
|
label: string | JSX.Element | HTMLElement | KTReactive<string | JSX.Element | HTMLElement>;
|
|
252
389
|
checked?: boolean;
|
|
253
|
-
size?:
|
|
390
|
+
size?: KTMuiRadioSize;
|
|
254
391
|
'on:change'?: (checked: boolean, value: string) => void;
|
|
255
392
|
disabled?: boolean;
|
|
256
|
-
color?:
|
|
393
|
+
color?: KTMuiRadioColor;
|
|
257
394
|
}
|
|
258
395
|
interface KTMuiRadioGroupProps extends KTMuiProps {
|
|
259
396
|
value?: string;
|
|
260
397
|
name?: string;
|
|
261
|
-
size?:
|
|
398
|
+
size?: KTMuiRadioSize;
|
|
262
399
|
options: KTMuiRadioProps[];
|
|
263
400
|
'on:change'?: (value: string) => void;
|
|
264
401
|
'on:click'?: (checked: boolean) => void;
|
|
@@ -284,8 +421,9 @@ interface KTMuiSelectOption {
|
|
|
284
421
|
value: string;
|
|
285
422
|
label: string | JSX.Element;
|
|
286
423
|
}
|
|
424
|
+
type KTMuiSelectSize = 'small' | 'medium';
|
|
287
425
|
interface KTMuiSelectProps extends KTMuiProps {
|
|
288
|
-
size?: KTMaybeReactive$1<
|
|
426
|
+
size?: KTMaybeReactive$1<KTMuiSelectSize>;
|
|
289
427
|
value?: KTMaybeReactive$1<string>;
|
|
290
428
|
options: KTMaybeReactive$1<KTMuiSelectOption[]>;
|
|
291
429
|
label?: KTMaybeReactive$1<string>;
|
|
@@ -300,8 +438,9 @@ type KTMuiSelect = JSX.Element & {};
|
|
|
300
438
|
*/
|
|
301
439
|
declare function Select(props: KTMuiSelectProps): KTMuiSelect;
|
|
302
440
|
|
|
441
|
+
type KTMuiCardVariant = 'elevation' | 'outlined' | 'contained';
|
|
303
442
|
interface KTMuiCardProps extends KTMuiProps {
|
|
304
|
-
variant?:
|
|
443
|
+
variant?: KTMuiCardVariant;
|
|
305
444
|
elevation?: number | KTReactive<number>;
|
|
306
445
|
square?: boolean | KTReactive<boolean>;
|
|
307
446
|
raised?: boolean | KTReactive<boolean>;
|
|
@@ -313,12 +452,14 @@ type KTMuiCard = JSX.Element & {};
|
|
|
313
452
|
*/
|
|
314
453
|
declare function Card(props: KTMuiCardProps): KTMuiCard;
|
|
315
454
|
|
|
455
|
+
type KTMuiSwitchColor = 'primary' | 'secondary' | 'error' | 'warning' | 'info' | 'success';
|
|
456
|
+
type KTMuiSwitchSize = 'small' | 'medium' | 'large';
|
|
316
457
|
interface KTMuiSwitchProps extends KTMuiProps {
|
|
317
458
|
value?: KTMaybeReactive$1<string>;
|
|
318
459
|
label?: KTMaybeReactive$1<string>;
|
|
319
460
|
disabled?: KTMaybeReactive$1<boolean>;
|
|
320
|
-
color?: KTMaybeReactive$1<
|
|
321
|
-
size?: KTMaybeReactive$1<
|
|
461
|
+
color?: KTMaybeReactive$1<KTMuiSwitchColor>;
|
|
462
|
+
size?: KTMaybeReactive$1<KTMuiSwitchSize>;
|
|
322
463
|
'on:change'?: (checked: boolean, value?: string) => void;
|
|
323
464
|
}
|
|
324
465
|
type KTMuiSwitch = JSX.Element & {};
|
|
@@ -327,16 +468,16 @@ type KTMuiSwitch = JSX.Element & {};
|
|
|
327
468
|
*/
|
|
328
469
|
declare function Switch(props: KTMuiSwitchProps): KTMuiSwitch;
|
|
329
470
|
|
|
330
|
-
type
|
|
331
|
-
type
|
|
332
|
-
type
|
|
471
|
+
type KTMuiPillColor = 'default' | 'primary' | 'secondary' | 'error' | 'warning' | 'info' | 'success';
|
|
472
|
+
type KTMuiPillVariant = 'filled' | 'outlined';
|
|
473
|
+
type KTMuiPillSize = 'small' | 'medium';
|
|
333
474
|
interface KTMuiPillProps extends KTMuiProps {
|
|
334
475
|
label?: KTMaybeReactive$1<string>;
|
|
335
476
|
icon?: KTMaybeReactive$1<HTMLElement | JSX.Element>;
|
|
336
477
|
deleteIcon?: KTMaybeReactive$1<HTMLElement | JSX.Element>;
|
|
337
|
-
color?: KTMaybeReactive$1<
|
|
338
|
-
variant?: KTMaybeReactive$1<
|
|
339
|
-
size?: KTMaybeReactive$1<
|
|
478
|
+
color?: KTMaybeReactive$1<KTMuiPillColor>;
|
|
479
|
+
variant?: KTMaybeReactive$1<KTMuiPillVariant>;
|
|
480
|
+
size?: KTMaybeReactive$1<KTMuiPillSize>;
|
|
340
481
|
clickable?: KTMaybeReactive$1<boolean>;
|
|
341
482
|
disabled?: KTMaybeReactive$1<boolean>;
|
|
342
483
|
autoRemoveOnDelete?: KTMaybeReactive$1<boolean>;
|
|
@@ -349,22 +490,24 @@ type KTMuiPill = JSX.Element & {};
|
|
|
349
490
|
*/
|
|
350
491
|
declare function Pill(props: KTMuiPillProps): KTMuiPill;
|
|
351
492
|
|
|
352
|
-
type
|
|
353
|
-
type
|
|
354
|
-
type
|
|
355
|
-
type
|
|
493
|
+
type KTMuiBadgeColor = 'default' | 'primary' | 'secondary' | 'error' | 'warning' | 'info' | 'success';
|
|
494
|
+
type KTMuiBadgeVariant = 'standard' | 'dot';
|
|
495
|
+
type KTMuiBadgeOverlap = 'rectangular' | 'circular';
|
|
496
|
+
type KTMuiBadgeVerticalOrigin = 'top' | 'bottom';
|
|
497
|
+
type KTMuiBadgeHorizontalOrigin = 'left' | 'right';
|
|
498
|
+
type KTMuiBadgeContent = string | number;
|
|
356
499
|
interface KTMuiBadgeAnchorOrigin {
|
|
357
|
-
vertical:
|
|
358
|
-
horizontal:
|
|
500
|
+
vertical: KTMuiBadgeVerticalOrigin;
|
|
501
|
+
horizontal: KTMuiBadgeHorizontalOrigin;
|
|
359
502
|
}
|
|
360
503
|
interface KTMuiBadgeProps extends KTMuiProps {
|
|
361
|
-
badgeContent?:
|
|
504
|
+
badgeContent?: KTMuiBadgeContent | KTReactive<number> | KTReactive<string>;
|
|
362
505
|
max?: KTMaybeReactive$1<number>;
|
|
363
506
|
showZero?: KTMaybeReactive$1<boolean>;
|
|
364
507
|
invisible?: KTMaybeReactive$1<boolean>;
|
|
365
|
-
color?: KTMaybeReactive$1<
|
|
366
|
-
variant?: KTMaybeReactive$1<
|
|
367
|
-
overlap?: KTMaybeReactive$1<
|
|
508
|
+
color?: KTMaybeReactive$1<KTMuiBadgeColor>;
|
|
509
|
+
variant?: KTMaybeReactive$1<KTMuiBadgeVariant>;
|
|
510
|
+
overlap?: KTMaybeReactive$1<KTMuiBadgeOverlap>;
|
|
368
511
|
anchorOrigin?: KTMaybeReactive$1<KTMuiBadgeAnchorOrigin>;
|
|
369
512
|
}
|
|
370
513
|
type KTMuiBadge = JSX.Element & {};
|
|
@@ -373,47 +516,31 @@ type KTMuiBadge = JSX.Element & {};
|
|
|
373
516
|
*/
|
|
374
517
|
declare function Badge(props: KTMuiBadgeProps): KTMuiBadge;
|
|
375
518
|
|
|
376
|
-
type
|
|
377
|
-
type
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
519
|
+
type KTMuiTabsVariant = 'standard' | 'scrollable' | 'fullWidth';
|
|
520
|
+
type KTMuiTabsTextColor = 'primary' | 'secondary' | 'inherit';
|
|
521
|
+
type KTMuiTabsIndicatorColor = 'primary' | 'secondary';
|
|
522
|
+
type KTMuiTabsOrientation = 'horizontal' | 'vertical';
|
|
523
|
+
interface KTMuiTabOption {
|
|
524
|
+
value: string;
|
|
525
|
+
label: string | JSX.Element;
|
|
526
|
+
icon?: JSX.Element | HTMLElement;
|
|
527
|
+
disabled?: boolean;
|
|
381
528
|
}
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
anchorEl?: HTMLElement | null | KTReactive<HTMLElement | null>;
|
|
392
|
-
/**
|
|
393
|
-
* Defines which part of the anchor element to align the popover with.
|
|
394
|
-
*/
|
|
395
|
-
anchorOrigin?: KTMaybeReactive$1<KTMuiPopoverOrigin>;
|
|
396
|
-
/**
|
|
397
|
-
* Defines which part of the popover to align with the anchor element.
|
|
398
|
-
*/
|
|
399
|
-
transformOrigin?: KTMaybeReactive$1<KTMuiPopoverOrigin>;
|
|
400
|
-
/**
|
|
401
|
-
* The margin between the popover and the edge of the screen.
|
|
402
|
-
* This is used to prevent the popover from being positioned in a way that it would be inaccessible to users, such as being off-screen.
|
|
403
|
-
*/
|
|
404
|
-
marginThreshold?: KTMaybeReactive$1<number>;
|
|
405
|
-
/**
|
|
406
|
-
* The elevation of the popover, which affects the shadow depth.
|
|
407
|
-
* It can be a value between 0 and 24.
|
|
408
|
-
*/
|
|
409
|
-
elevation?: KTMaybeReactive$1<number>;
|
|
410
|
-
'on:close'?: (reason: KTMuiPopoverCloseReason) => void;
|
|
529
|
+
interface KTMuiTabsProps extends KTMuiProps {
|
|
530
|
+
value?: KTMaybeReactive<string>;
|
|
531
|
+
options: KTMaybeReactive<KTMuiTabOption[]>;
|
|
532
|
+
variant?: KTMaybeReactive<KTMuiTabsVariant>;
|
|
533
|
+
textColor?: KTMaybeReactive<KTMuiTabsTextColor>;
|
|
534
|
+
indicatorColor?: KTMaybeReactive<KTMuiTabsIndicatorColor>;
|
|
535
|
+
orientation?: KTMaybeReactive<KTMuiTabsOrientation>;
|
|
536
|
+
centered?: KTMaybeReactive<boolean>;
|
|
537
|
+
'on:change'?: (value: string, oldValue: string, index: number, option?: KTMuiTabOption) => void;
|
|
411
538
|
}
|
|
412
|
-
type
|
|
539
|
+
type KTMuiTabs = JSX.Element & {};
|
|
413
540
|
/**
|
|
414
|
-
*
|
|
541
|
+
* Tabs component - mimics MUI Tabs appearance and behavior
|
|
415
542
|
*/
|
|
416
|
-
declare function
|
|
543
|
+
declare function Tabs(props: KTMuiTabsProps): KTMuiTabs;
|
|
417
544
|
|
|
418
|
-
export { Alert, Badge, Button, Card, Checkbox, CheckboxGroup, Dialog, DropdownButton, FormLabel, LinearProgress, Pill, Popover, Radio, RadioGroup, Select, Switch, TextField };
|
|
419
|
-
export type { KTMuiBadge, KTMuiBadgeAnchorOrigin, KTMuiBadgeProps, KTMuiCard, KTMuiCardProps, KTMuiCheckbox, KTMuiCheckboxGroup, KTMuiCheckboxGroupProps, KTMuiCheckboxProps, KTMuiDialog, KTMuiDropdownButton, KTMuiDropdownButtonOption, KTMuiDropdownButtonProps, KTMuiLinearProgress, KTMuiPill, KTMuiPillProps, KTMuiPopover, KTMuiPopoverCloseReason, KTMuiPopoverOrigin, KTMuiPopoverProps, KTMuiRadio, KTMuiRadioGroup, KTMuiRadioProps, KTMuiSelect, KTMuiSelectOption, KTMuiSelectProps, KTMuiSwitch, KTMuiSwitchProps, KTMuiTextField, KTMuiTextFieldProps };
|
|
545
|
+
export { Alert, Badge, BottomNavigation, Button, Card, Checkbox, CheckboxGroup, Dialog, DropdownButton, FormLabel, LinearProgress, Menu, Modal, Pill, Popover, Radio, RadioGroup, Select, Switch, Tabs, TextField, alert, confirm, modalAlert, modalConfirm, modalPrompt, prompt };
|
|
546
|
+
export type { KTMuiAlertOptions, KTMuiAlertSeverity, KTMuiAlertVariant, KTMuiBadge, KTMuiBadgeAnchorOrigin, KTMuiBadgeColor, KTMuiBadgeContent, KTMuiBadgeHorizontalOrigin, KTMuiBadgeOverlap, KTMuiBadgeProps, KTMuiBadgeVariant, KTMuiBadgeVerticalOrigin, KTMuiBottomNavigation, KTMuiBottomNavigationAction, KTMuiBottomNavigationProps, KTMuiButtonColor, KTMuiButtonSize, KTMuiButtonType, KTMuiButtonVariant, KTMuiCard, KTMuiCardProps, KTMuiCardVariant, KTMuiCheckbox, KTMuiCheckboxColor, KTMuiCheckboxGroup, KTMuiCheckboxGroupProps, KTMuiCheckboxProps, KTMuiCheckboxSize, KTMuiConfirmOptions, KTMuiDialog, KTMuiDialogSize, KTMuiDropdownButton, KTMuiDropdownButtonColor, KTMuiDropdownButtonOption, KTMuiDropdownButtonProps, KTMuiDropdownButtonSize, KTMuiDropdownButtonVariant, KTMuiFormLabelComponent, KTMuiLinearProgress, KTMuiLinearProgressColor, KTMuiLinearProgressVariant, KTMuiMenu, KTMuiMenuCloseReason, KTMuiMenuContent, KTMuiMenuHorizontalOrigin, KTMuiMenuOption, KTMuiMenuProps, KTMuiMenuVerticalOrigin, KTMuiModalContent, KTMuiPill, KTMuiPillColor, KTMuiPillProps, KTMuiPillSize, KTMuiPillVariant, KTMuiPopover, KTMuiPopoverCloseReason, KTMuiPopoverHorizontalOrigin, KTMuiPopoverOrigin, KTMuiPopoverProps, KTMuiPopoverVerticalOrigin, KTMuiPromptOptions, KTMuiRadio, KTMuiRadioColor, KTMuiRadioGroup, KTMuiRadioProps, KTMuiRadioSize, KTMuiSelect, KTMuiSelectOption, KTMuiSelectProps, KTMuiSelectSize, KTMuiSwitch, KTMuiSwitchColor, KTMuiSwitchProps, KTMuiSwitchSize, KTMuiTabOption, KTMuiTabs, KTMuiTabsIndicatorColor, KTMuiTabsOrientation, KTMuiTabsProps, KTMuiTabsTextColor, KTMuiTabsVariant, KTMuiTextField, KTMuiTextFieldProps, KTMuiTextFieldSize, KTMuiTextFieldType };
|