@ktjs/mui 0.24.4 → 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 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,6 +71,25 @@ interface KTMuiButtonProps extends KTMuiProps {
71
71
  */
72
72
  declare function Button(props: KTMuiButtonProps): JSX.Element;
73
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
+
74
93
  type KTMuiDropdownButtonVariant = 'contained' | 'outlined' | 'text';
75
94
  type KTMuiDropdownButtonColor = 'primary' | 'secondary' | 'error' | 'warning' | 'info' | 'success';
76
95
  type KTMuiDropdownButtonSize = 'small' | 'medium' | 'large';
@@ -234,6 +253,107 @@ type KTMuiLinearProgress = JSX.Element & {
234
253
  };
235
254
  declare function LinearProgress(props: LinearProgressProps): KTMuiLinearProgress;
236
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
+
237
357
  type ChangeHandler<T = string> = (value: T, ...args: any[]) => void;
238
358
 
239
359
  type KTMuiTextFieldType = 'text' | 'password' | 'email' | 'number' | 'tel' | 'url';
@@ -396,47 +516,31 @@ type KTMuiBadge = JSX.Element & {};
396
516
  */
397
517
  declare function Badge(props: KTMuiBadgeProps): KTMuiBadge;
398
518
 
399
- type KTMuiPopoverVerticalOrigin = 'top' | 'center' | 'bottom';
400
- type KTMuiPopoverHorizontalOrigin = 'left' | 'center' | 'right';
401
- interface KTMuiPopoverOrigin {
402
- vertical: KTMuiPopoverVerticalOrigin;
403
- horizontal: KTMuiPopoverHorizontalOrigin;
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;
404
528
  }
405
- type KTMuiPopoverCloseReason = 'backdropClick' | 'escapeKeyDown';
406
- interface KTMuiPopoverProps extends KTMuiProps {
407
- /**
408
- * Indicates whether the popover is open.
409
- */
410
- open?: KTMaybeReactive$1<boolean>;
411
- /**
412
- * The DOM element used as the anchor of the popover. The popover will appear next to this element.
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;
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;
434
538
  }
435
- type KTMuiPopover = JSX.Element & {};
539
+ type KTMuiTabs = JSX.Element & {};
436
540
  /**
437
- * Popover component - mimics MUI Popover appearance and behavior
541
+ * Tabs component - mimics MUI Tabs appearance and behavior
438
542
  */
439
- declare function Popover(props: KTMuiPopoverProps): KTMuiPopover;
543
+ declare function Tabs(props: KTMuiTabsProps): KTMuiTabs;
440
544
 
441
- export { Alert, Badge, Button, Card, Checkbox, CheckboxGroup, Dialog, DropdownButton, FormLabel, LinearProgress, Pill, Popover, Radio, RadioGroup, Select, Switch, TextField };
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, KTMuiDropdownButton, KTMuiDropdownButtonColor, KTMuiDropdownButtonOption, KTMuiDropdownButtonProps, KTMuiDropdownButtonSize, KTMuiDropdownButtonVariant, KTMuiFormLabelComponent, KTMuiLinearProgress, KTMuiLinearProgressColor, KTMuiLinearProgressVariant, KTMuiPill, KTMuiPillColor, KTMuiPillProps, KTMuiPillSize, KTMuiPillVariant, KTMuiPopover, KTMuiPopoverCloseReason, KTMuiPopoverHorizontalOrigin, KTMuiPopoverOrigin, KTMuiPopoverProps, KTMuiPopoverVerticalOrigin, KTMuiRadio, KTMuiRadioColor, KTMuiRadioGroup, KTMuiRadioProps, KTMuiRadioSize, KTMuiSelect, KTMuiSelectOption, KTMuiSelectProps, KTMuiSelectSize, KTMuiSwitch, KTMuiSwitchColor, KTMuiSwitchProps, KTMuiSwitchSize, KTMuiTextField, KTMuiTextFieldProps, KTMuiTextFieldSize, KTMuiTextFieldType };
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 };