@ktjs/mui 0.24.4 → 0.24.6
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 +142 -77
- package/dist/index.mjs +482 -123
- 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
|
@@ -71,51 +71,24 @@ interface KTMuiButtonProps extends KTMuiProps {
|
|
|
71
71
|
*/
|
|
72
72
|
declare function Button(props: KTMuiButtonProps): JSX.Element;
|
|
73
73
|
|
|
74
|
-
|
|
75
|
-
type KTMuiDropdownButtonColor = 'primary' | 'secondary' | 'error' | 'warning' | 'info' | 'success';
|
|
76
|
-
type KTMuiDropdownButtonSize = 'small' | 'medium' | 'large';
|
|
77
|
-
interface KTMuiDropdownButtonOption {
|
|
74
|
+
interface KTMuiBottomNavigationAction {
|
|
78
75
|
value: string;
|
|
79
76
|
label: string | JSX.Element;
|
|
77
|
+
icon?: JSX.Element | HTMLElement;
|
|
80
78
|
disabled?: boolean;
|
|
79
|
+
showLabel?: boolean;
|
|
81
80
|
}
|
|
82
|
-
interface
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* The options for the dropdown menu - array of objects with `value`, `label` and optional `disabled`
|
|
89
|
-
*/
|
|
90
|
-
options: KTMaybeReactive<KTMuiDropdownButtonOption[]>;
|
|
91
|
-
/**
|
|
92
|
-
* The variant to use - 'contained', 'outlined' or 'text'
|
|
93
|
-
*/
|
|
94
|
-
variant?: KTMaybeReactive<KTMuiDropdownButtonVariant>;
|
|
95
|
-
/**
|
|
96
|
-
* The color to use - 'primary', 'secondary', 'error', 'warning', 'info' or 'success'
|
|
97
|
-
*/
|
|
98
|
-
color?: KTMaybeReactive<KTMuiDropdownButtonColor>;
|
|
99
|
-
/**
|
|
100
|
-
* The size of the button - 'small', 'medium' or 'large'
|
|
101
|
-
*/
|
|
102
|
-
size?: KTMaybeReactive<KTMuiDropdownButtonSize>;
|
|
103
|
-
/**
|
|
104
|
-
* Whether the button is disabled
|
|
105
|
-
*/
|
|
106
|
-
disabled?: KTMaybeReactive<boolean>;
|
|
107
|
-
/**
|
|
108
|
-
* Whether the button should take the full width of its container
|
|
109
|
-
*/
|
|
110
|
-
fullWidth?: KTMaybeReactive<boolean>;
|
|
111
|
-
'on:click'?: (event: MouseEvent) => void;
|
|
112
|
-
'on:select'?: (value: string, option: KTMuiDropdownButtonOption) => void;
|
|
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;
|
|
113
86
|
}
|
|
114
|
-
type
|
|
87
|
+
type KTMuiBottomNavigation = JSX.Element & {};
|
|
115
88
|
/**
|
|
116
|
-
*
|
|
89
|
+
* BottomNavigation component - mimics MUI BottomNavigation appearance and behavior
|
|
117
90
|
*/
|
|
118
|
-
declare function
|
|
91
|
+
declare function BottomNavigation(props: KTMuiBottomNavigationProps): KTMuiBottomNavigation;
|
|
119
92
|
|
|
120
93
|
type KTMuiCheckboxSize = 'small' | 'medium';
|
|
121
94
|
type KTMuiCheckboxColor = 'primary' | 'secondary' | 'default' | 'success' | 'error' | 'warning';
|
|
@@ -166,6 +139,13 @@ interface KTMuiDialogProps extends Omit<KTMuiProps, 'children'> {
|
|
|
166
139
|
actions?: KTMaybeReactive$1<HTMLElement | HTMLElement[]>;
|
|
167
140
|
size?: KTMaybeReactive$1<KTMuiDialogSize>;
|
|
168
141
|
fullWidth?: KTMaybeReactive$1<boolean>;
|
|
142
|
+
/**
|
|
143
|
+
* Dialog rendering mode: 'dialog' (native) or 'div' (fallback)
|
|
144
|
+
* - 'dialog' uses <dialog> element if supported
|
|
145
|
+
* - 'div' always uses <div>
|
|
146
|
+
* - Default: 'dialog'
|
|
147
|
+
*/
|
|
148
|
+
mode?: KTMaybeReactive$1<'dialog' | 'div'>;
|
|
169
149
|
'on:close'?: () => void;
|
|
170
150
|
}
|
|
171
151
|
type KTMuiDialog = JSX.Element;
|
|
@@ -234,6 +214,107 @@ type KTMuiLinearProgress = JSX.Element & {
|
|
|
234
214
|
};
|
|
235
215
|
declare function LinearProgress(props: LinearProgressProps): KTMuiLinearProgress;
|
|
236
216
|
|
|
217
|
+
type KTMuiPopoverVerticalOrigin = 'top' | 'center' | 'bottom';
|
|
218
|
+
type KTMuiPopoverHorizontalOrigin = 'left' | 'center' | 'right';
|
|
219
|
+
interface KTMuiPopoverOrigin {
|
|
220
|
+
vertical: KTMuiPopoverVerticalOrigin;
|
|
221
|
+
horizontal: KTMuiPopoverHorizontalOrigin;
|
|
222
|
+
}
|
|
223
|
+
type KTMuiPopoverCloseReason = 'backdropClick' | 'escapeKeyDown';
|
|
224
|
+
interface KTMuiPopoverProps extends KTMuiProps {
|
|
225
|
+
/**
|
|
226
|
+
* Indicates whether the popover is open.
|
|
227
|
+
*/
|
|
228
|
+
open?: KTMaybeReactive$1<boolean>;
|
|
229
|
+
/**
|
|
230
|
+
* The DOM element used as the anchor of the popover. The popover will appear next to this element.
|
|
231
|
+
*/
|
|
232
|
+
anchorEl?: HTMLElement | null | KTReactive<HTMLElement | null>;
|
|
233
|
+
/**
|
|
234
|
+
* Defines which part of the anchor element to align the popover with.
|
|
235
|
+
*/
|
|
236
|
+
anchorOrigin?: KTMaybeReactive$1<KTMuiPopoverOrigin>;
|
|
237
|
+
/**
|
|
238
|
+
* Defines which part of the popover to align with the anchor element.
|
|
239
|
+
*/
|
|
240
|
+
transformOrigin?: KTMaybeReactive$1<KTMuiPopoverOrigin>;
|
|
241
|
+
/**
|
|
242
|
+
* The margin between the popover and the edge of the screen.
|
|
243
|
+
* 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.
|
|
244
|
+
*/
|
|
245
|
+
marginThreshold?: KTMaybeReactive$1<number>;
|
|
246
|
+
/**
|
|
247
|
+
* The elevation of the popover, which affects the shadow depth.
|
|
248
|
+
* It can be a value between 0 and 24.
|
|
249
|
+
*/
|
|
250
|
+
elevation?: KTMaybeReactive$1<number>;
|
|
251
|
+
'on:close'?: (reason: KTMuiPopoverCloseReason) => void;
|
|
252
|
+
}
|
|
253
|
+
type KTMuiPopover = JSX.Element & {};
|
|
254
|
+
/**
|
|
255
|
+
* Popover component - mimics MUI Popover appearance and behavior
|
|
256
|
+
*/
|
|
257
|
+
declare function Popover(props: KTMuiPopoverProps): KTMuiPopover;
|
|
258
|
+
|
|
259
|
+
type KTMuiMenuCloseReason = KTMuiPopoverCloseReason | 'itemClick';
|
|
260
|
+
interface KTMuiMenuOption {
|
|
261
|
+
value: string;
|
|
262
|
+
label: string | JSX.Element;
|
|
263
|
+
disabled?: boolean;
|
|
264
|
+
selected?: boolean;
|
|
265
|
+
}
|
|
266
|
+
type KTMuiMenuContent = KTMuiMenuOption | JSX.Element | HTMLElement | string;
|
|
267
|
+
interface KTMuiMenuProps extends KTMuiProps {
|
|
268
|
+
open?: KTMaybeReactive<boolean>;
|
|
269
|
+
anchorEl?: HTMLElement | null | KTReactive<HTMLElement | null>;
|
|
270
|
+
options?: KTMaybeReactive<KTMuiMenuContent[]>;
|
|
271
|
+
anchorOrigin?: KTMaybeReactive<KTMuiPopoverOrigin>;
|
|
272
|
+
transformOrigin?: KTMaybeReactive<KTMuiPopoverOrigin>;
|
|
273
|
+
marginThreshold?: KTMaybeReactive<number>;
|
|
274
|
+
elevation?: KTMaybeReactive<number>;
|
|
275
|
+
autoClose?: KTMaybeReactive<boolean>;
|
|
276
|
+
disableAutoFocusItem?: KTMaybeReactive<boolean>;
|
|
277
|
+
'on:close'?: (reason: KTMuiMenuCloseReason) => void;
|
|
278
|
+
'on:select'?: (value: string, option: KTMuiMenuOption) => void;
|
|
279
|
+
}
|
|
280
|
+
type KTMuiMenu = JSX.Element & {};
|
|
281
|
+
type KTMuiMenuVerticalOrigin = KTMuiPopoverVerticalOrigin;
|
|
282
|
+
type KTMuiMenuHorizontalOrigin = KTMuiPopoverHorizontalOrigin;
|
|
283
|
+
/**
|
|
284
|
+
* Menu component - mimics MUI Menu appearance and behavior
|
|
285
|
+
*/
|
|
286
|
+
declare function Menu(props: KTMuiMenuProps): KTMuiMenu;
|
|
287
|
+
|
|
288
|
+
type KTMuiModalContent = string | JSX.Element | HTMLElement;
|
|
289
|
+
interface KTMuiModalCommonOptions extends Pick<KTMuiProps, 'class' | 'style'> {
|
|
290
|
+
title?: string;
|
|
291
|
+
size?: KTMuiDialogSize;
|
|
292
|
+
fullWidth?: boolean;
|
|
293
|
+
confirmText?: string;
|
|
294
|
+
cancelText?: string;
|
|
295
|
+
}
|
|
296
|
+
interface KTMuiAlertOptions extends KTMuiModalCommonOptions {
|
|
297
|
+
}
|
|
298
|
+
interface KTMuiConfirmOptions extends KTMuiModalCommonOptions {
|
|
299
|
+
}
|
|
300
|
+
interface KTMuiPromptOptions extends KTMuiModalCommonOptions {
|
|
301
|
+
defaultValue?: string;
|
|
302
|
+
placeholder?: string;
|
|
303
|
+
inputType?: 'text' | 'password' | 'email' | 'number' | 'tel' | 'url';
|
|
304
|
+
validator?: (value: string) => boolean | string;
|
|
305
|
+
}
|
|
306
|
+
declare function modalAlert(content: KTMuiModalContent, options?: KTMuiAlertOptions): Promise<void>;
|
|
307
|
+
declare function modalConfirm(content: KTMuiModalContent, options?: KTMuiConfirmOptions): Promise<boolean>;
|
|
308
|
+
declare function modalPrompt(content: KTMuiModalContent, options?: KTMuiPromptOptions): Promise<string | null>;
|
|
309
|
+
declare const Modal: {
|
|
310
|
+
alert: typeof modalAlert;
|
|
311
|
+
confirm: typeof modalConfirm;
|
|
312
|
+
prompt: typeof modalPrompt;
|
|
313
|
+
};
|
|
314
|
+
declare const alert: typeof modalAlert;
|
|
315
|
+
declare const confirm: typeof modalConfirm;
|
|
316
|
+
declare const prompt: typeof modalPrompt;
|
|
317
|
+
|
|
237
318
|
type ChangeHandler<T = string> = (value: T, ...args: any[]) => void;
|
|
238
319
|
|
|
239
320
|
type KTMuiTextFieldType = 'text' | 'password' | 'email' | 'number' | 'tel' | 'url';
|
|
@@ -396,47 +477,31 @@ type KTMuiBadge = JSX.Element & {};
|
|
|
396
477
|
*/
|
|
397
478
|
declare function Badge(props: KTMuiBadgeProps): KTMuiBadge;
|
|
398
479
|
|
|
399
|
-
type
|
|
400
|
-
type
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
480
|
+
type KTMuiTabsVariant = 'standard' | 'scrollable' | 'fullWidth';
|
|
481
|
+
type KTMuiTabsTextColor = 'primary' | 'secondary' | 'inherit';
|
|
482
|
+
type KTMuiTabsIndicatorColor = 'primary' | 'secondary';
|
|
483
|
+
type KTMuiTabsOrientation = 'horizontal' | 'vertical';
|
|
484
|
+
interface KTMuiTabOption {
|
|
485
|
+
value: string;
|
|
486
|
+
label: string | JSX.Element;
|
|
487
|
+
icon?: JSX.Element | HTMLElement;
|
|
488
|
+
disabled?: boolean;
|
|
404
489
|
}
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
anchorEl?: HTMLElement | null | KTReactive<HTMLElement | null>;
|
|
415
|
-
/**
|
|
416
|
-
* Defines which part of the anchor element to align the popover with.
|
|
417
|
-
*/
|
|
418
|
-
anchorOrigin?: KTMaybeReactive$1<KTMuiPopoverOrigin>;
|
|
419
|
-
/**
|
|
420
|
-
* Defines which part of the popover to align with the anchor element.
|
|
421
|
-
*/
|
|
422
|
-
transformOrigin?: KTMaybeReactive$1<KTMuiPopoverOrigin>;
|
|
423
|
-
/**
|
|
424
|
-
* The margin between the popover and the edge of the screen.
|
|
425
|
-
* 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.
|
|
426
|
-
*/
|
|
427
|
-
marginThreshold?: KTMaybeReactive$1<number>;
|
|
428
|
-
/**
|
|
429
|
-
* The elevation of the popover, which affects the shadow depth.
|
|
430
|
-
* It can be a value between 0 and 24.
|
|
431
|
-
*/
|
|
432
|
-
elevation?: KTMaybeReactive$1<number>;
|
|
433
|
-
'on:close'?: (reason: KTMuiPopoverCloseReason) => void;
|
|
490
|
+
interface KTMuiTabsProps extends KTMuiProps {
|
|
491
|
+
value?: KTMaybeReactive<string>;
|
|
492
|
+
options: KTMaybeReactive<KTMuiTabOption[]>;
|
|
493
|
+
variant?: KTMaybeReactive<KTMuiTabsVariant>;
|
|
494
|
+
textColor?: KTMaybeReactive<KTMuiTabsTextColor>;
|
|
495
|
+
indicatorColor?: KTMaybeReactive<KTMuiTabsIndicatorColor>;
|
|
496
|
+
orientation?: KTMaybeReactive<KTMuiTabsOrientation>;
|
|
497
|
+
centered?: KTMaybeReactive<boolean>;
|
|
498
|
+
'on:change'?: (value: string, oldValue: string, index: number, option?: KTMuiTabOption) => void;
|
|
434
499
|
}
|
|
435
|
-
type
|
|
500
|
+
type KTMuiTabs = JSX.Element & {};
|
|
436
501
|
/**
|
|
437
|
-
*
|
|
502
|
+
* Tabs component - mimics MUI Tabs appearance and behavior
|
|
438
503
|
*/
|
|
439
|
-
declare function
|
|
504
|
+
declare function Tabs(props: KTMuiTabsProps): KTMuiTabs;
|
|
440
505
|
|
|
441
|
-
export { Alert, Badge, Button, Card, Checkbox, CheckboxGroup, Dialog,
|
|
442
|
-
export type { KTMuiAlertSeverity, KTMuiAlertVariant, KTMuiBadge, KTMuiBadgeAnchorOrigin, KTMuiBadgeColor, KTMuiBadgeContent, KTMuiBadgeHorizontalOrigin, KTMuiBadgeOverlap, KTMuiBadgeProps, KTMuiBadgeVariant, KTMuiBadgeVerticalOrigin, KTMuiButtonColor, KTMuiButtonSize, KTMuiButtonType, KTMuiButtonVariant, KTMuiCard, KTMuiCardProps, KTMuiCardVariant, KTMuiCheckbox, KTMuiCheckboxColor, KTMuiCheckboxGroup, KTMuiCheckboxGroupProps, KTMuiCheckboxProps, KTMuiCheckboxSize, KTMuiDialog, KTMuiDialogSize,
|
|
506
|
+
export { Alert, Badge, BottomNavigation, Button, Card, Checkbox, CheckboxGroup, Dialog, FormLabel, LinearProgress, Menu, Modal, Pill, Popover, Radio, RadioGroup, Select, Switch, Tabs, TextField, alert, confirm, modalAlert, modalConfirm, modalPrompt, prompt };
|
|
507
|
+
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, 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 };
|