mithril-materialized 2.0.0-beta.1 → 2.0.0-beta.10

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.
Files changed (68) hide show
  1. package/README.md +286 -306
  2. package/dist/advanced.css +1888 -0
  3. package/dist/autocomplete.d.ts +3 -3
  4. package/dist/breadcrumb.d.ts +53 -0
  5. package/dist/button.d.ts +10 -10
  6. package/dist/carousel.d.ts +2 -2
  7. package/dist/chip.d.ts +2 -2
  8. package/dist/code-block.d.ts +2 -2
  9. package/dist/collapsible.d.ts +2 -2
  10. package/dist/collection.d.ts +2 -2
  11. package/dist/components.css +2310 -0
  12. package/dist/core.css +3402 -0
  13. package/dist/datepicker.d.ts +66 -0
  14. package/dist/dropdown.d.ts +2 -2
  15. package/dist/file-upload.d.ts +34 -0
  16. package/dist/floating-action-button.d.ts +2 -2
  17. package/dist/forms.css +2284 -0
  18. package/dist/index.css +1483 -167
  19. package/dist/index.d.ts +12 -1
  20. package/dist/index.esm.js +3694 -1717
  21. package/dist/index.js +3714 -1716
  22. package/dist/index.min.css +8 -0
  23. package/dist/index.umd.js +3714 -1716
  24. package/dist/input-options.d.ts +1 -1
  25. package/dist/input.d.ts +9 -9
  26. package/dist/label.d.ts +4 -2
  27. package/dist/material-box.d.ts +2 -2
  28. package/dist/modal.d.ts +2 -2
  29. package/dist/option.d.ts +4 -4
  30. package/dist/pagination.d.ts +2 -2
  31. package/dist/parallax.d.ts +2 -2
  32. package/dist/pickers.css +487 -0
  33. package/dist/pushpin.d.ts +32 -0
  34. package/dist/radio.d.ts +4 -4
  35. package/dist/search-select.d.ts +2 -2
  36. package/dist/select.d.ts +2 -2
  37. package/dist/sidenav.d.ts +76 -0
  38. package/dist/switch.d.ts +2 -2
  39. package/dist/tabs.d.ts +2 -4
  40. package/dist/theme-switcher.d.ts +49 -0
  41. package/dist/timepicker.d.ts +42 -0
  42. package/dist/toast.d.ts +45 -0
  43. package/dist/tooltip.d.ts +59 -0
  44. package/dist/utilities.css +3197 -0
  45. package/dist/wizard.d.ts +58 -0
  46. package/package.json +16 -8
  47. package/sass/components/_breadcrumb.scss +248 -0
  48. package/sass/components/_buttons.scss +3 -3
  49. package/sass/components/_chips.scss +8 -8
  50. package/sass/components/_collapsible.scss +8 -8
  51. package/sass/components/_datepicker.scss +45 -14
  52. package/sass/components/_dropdown.scss +5 -5
  53. package/sass/components/_file-upload.scss +228 -0
  54. package/sass/components/_global.scss +7 -5
  55. package/sass/components/_modal.scss +5 -2
  56. package/sass/components/_navbar.scss +13 -5
  57. package/sass/components/_sidenav.scss +164 -7
  58. package/sass/components/_tabs.scss +5 -4
  59. package/sass/components/_theme-switcher.scss +120 -0
  60. package/sass/components/_theme-variables.scss +205 -0
  61. package/sass/components/_timepicker.scss +179 -87
  62. package/sass/components/_wizard.scss +416 -0
  63. package/sass/components/forms/_input-fields.scss +34 -12
  64. package/sass/components/forms/_radio-buttons.scss +10 -10
  65. package/sass/components/forms/_select.scss +8 -8
  66. package/sass/components/forms/_switches.scss +6 -6
  67. package/sass/materialize.scss +7 -0
  68. package/dist/pickers.d.ts +0 -130
@@ -4,7 +4,7 @@ export interface Option<T extends string | number> {
4
4
  label?: string;
5
5
  disabled?: boolean;
6
6
  }
7
- export interface SearchSelectAttributes<T extends string | number> extends Attributes {
7
+ export interface SearchSelectAttrs<T extends string | number> extends Attributes {
8
8
  /** Options to display in the select */
9
9
  options?: Option<T>[];
10
10
  /** Initial value */
@@ -37,5 +37,5 @@ interface SearchSelectState<T extends string | number> {
37
37
  /**
38
38
  * Mithril Factory Component for Multi-Select Dropdown with search
39
39
  */
40
- export declare const SearchSelect: <T extends string | number>() => Component<SearchSelectAttributes<T>, SearchSelectState<T>>;
40
+ export declare const SearchSelect: <T extends string | number>() => Component<SearchSelectAttrs<T>, SearchSelectState<T>>;
41
41
  export {};
package/dist/select.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Attributes, Component } from 'mithril';
2
2
  import { InputOption } from './option';
3
- export interface SelectAttributes<T extends string | number> extends Attributes {
3
+ export interface SelectAttrs<T extends string | number> extends Attributes {
4
4
  /** Options to select from */
5
5
  options: InputOption<T>[];
6
6
  /** Called when the value is changed, either contains a single or all selected (checked) ids */
@@ -43,4 +43,4 @@ export interface SelectAttributes<T extends string | number> extends Attributes
43
43
  showClearButton?: boolean;
44
44
  }
45
45
  /** Select component */
46
- export declare const Select: <T extends string | number>() => Component<SelectAttributes<T>>;
46
+ export declare const Select: <T extends string | number>() => Component<SelectAttrs<T>>;
@@ -0,0 +1,76 @@
1
+ import { FactoryComponent, Attributes } from 'mithril';
2
+ export interface SidenavAttrs extends Attributes {
3
+ /** Unique ID for the sidenav */
4
+ id?: string;
5
+ /** Whether the sidenav is open */
6
+ isOpen?: boolean;
7
+ /** Callback when sidenav open state changes */
8
+ onToggle?: (isOpen: boolean) => void;
9
+ /** Position of the sidenav */
10
+ position?: 'left' | 'right';
11
+ /** Whether sidenav should overlay content or push it */
12
+ mode?: 'overlay' | 'push';
13
+ /** Width of the sidenav in pixels */
14
+ width?: number;
15
+ /** Custom class for the sidenav */
16
+ className?: string;
17
+ /** Whether to show backdrop overlay */
18
+ showBackdrop?: boolean;
19
+ /** Close sidenav when backdrop is clicked */
20
+ closeOnBackdropClick?: boolean;
21
+ /** Close sidenav when escape key is pressed */
22
+ closeOnEscape?: boolean;
23
+ /** Animation duration in milliseconds */
24
+ animationDuration?: number;
25
+ /** Fixed sidenav (always visible on larger screens) */
26
+ fixed?: boolean;
27
+ /** Breakpoint for responsive behavior (in pixels) */
28
+ breakpoint?: number;
29
+ }
30
+ export interface SidenavItemAttrs {
31
+ /** Text content of the item */
32
+ text?: string;
33
+ /** Icon name (material icons) */
34
+ icon?: string;
35
+ /** Whether this item is active */
36
+ active?: boolean;
37
+ /** Whether this item is disabled */
38
+ disabled?: boolean;
39
+ /** Click handler */
40
+ onclick?: (e: Event) => void;
41
+ /** Href for link items */
42
+ href?: string;
43
+ /** Custom class */
44
+ className?: string;
45
+ /** Whether this is a divider */
46
+ divider?: boolean;
47
+ /** Whether this is a subheader */
48
+ subheader?: boolean;
49
+ }
50
+ /**
51
+ * Sidenav Component
52
+ * A responsive navigation drawer that slides in from the side
53
+ */
54
+ export declare const Sidenav: FactoryComponent<SidenavAttrs>;
55
+ /**
56
+ * Sidenav Item Component
57
+ * Individual items for the sidenav menu
58
+ */
59
+ export declare const SidenavItem: FactoryComponent<SidenavItemAttrs>;
60
+ /**
61
+ * Sidenav utilities for programmatic control
62
+ */
63
+ export declare class SidenavManager {
64
+ /**
65
+ * Open a sidenav by ID
66
+ */
67
+ static open(id: string): void;
68
+ /**
69
+ * Close a sidenav by ID
70
+ */
71
+ static close(id: string): void;
72
+ /**
73
+ * Toggle a sidenav by ID
74
+ */
75
+ static toggle(id: string): void;
76
+ }
package/dist/switch.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { FactoryComponent } from 'mithril';
2
- import { InputAttributes } from './input-options';
3
- export interface SwitchOptions extends Partial<InputAttributes<boolean>> {
2
+ import { InputAttrs } from './input-options';
3
+ export interface SwitchOptions extends Partial<InputAttrs<boolean>> {
4
4
  /** Left text label */
5
5
  left?: string;
6
6
  /** Right text label */
package/dist/tabs.d.ts CHANGED
@@ -14,8 +14,6 @@ export interface TabItem {
14
14
  vnode?: Vnode<any, any>;
15
15
  /** ID of the tab element. Default the title in lowercase */
16
16
  id?: string;
17
- /** If the tab should be active */
18
- active?: boolean;
19
17
  /** If the tab should be disabled */
20
18
  disabled?: boolean;
21
19
  /** CSS class for the tab (li), default `.tab.col.s3` */
@@ -40,7 +38,7 @@ export interface TabsOptions {
40
38
  /** Enable swiping between tabs on mobile */
41
39
  swipeable?: boolean;
42
40
  }
43
- export interface TabsAttributes extends TabsOptions, Attributes {
41
+ export interface TabsAttrs extends TabsOptions, Attributes {
44
42
  /** Selected tab id, takes precedence over tab.active property */
45
43
  selectedTabId?: string;
46
44
  /**
@@ -54,4 +52,4 @@ export interface TabsAttributes extends TabsOptions, Attributes {
54
52
  onTabChange?: (tabId: string) => void;
55
53
  }
56
54
  /** CSS-only Tabs component - no MaterializeCSS dependencies */
57
- export declare const Tabs: FactoryComponent<TabsAttributes>;
55
+ export declare const Tabs: FactoryComponent<TabsAttrs>;
@@ -0,0 +1,49 @@
1
+ import { FactoryComponent } from 'mithril';
2
+ export type Theme = 'light' | 'dark' | 'auto';
3
+ export interface ThemeSwitcherAttrs {
4
+ /** Current theme selection */
5
+ theme?: Theme;
6
+ /** Callback when theme changes */
7
+ onThemeChange?: (theme: Theme) => void;
8
+ /** Show labels on the toggle buttons */
9
+ showLabels?: boolean;
10
+ /** Custom class for the container */
11
+ className?: string;
12
+ }
13
+ /**
14
+ * Theme switching utilities and component
15
+ */
16
+ export declare class ThemeManager {
17
+ private static currentTheme;
18
+ /**
19
+ * Set the theme for the entire application
20
+ */
21
+ static setTheme(theme: Theme): void;
22
+ /**
23
+ * Get the current theme
24
+ */
25
+ static getTheme(): Theme;
26
+ /**
27
+ * Get the effective theme (resolves 'auto' to actual theme)
28
+ */
29
+ static getEffectiveTheme(): 'light' | 'dark';
30
+ /**
31
+ * Initialize theme from localStorage or system preference
32
+ */
33
+ static initialize(): void;
34
+ /**
35
+ * Toggle between light and dark themes
36
+ */
37
+ static toggle(): void;
38
+ }
39
+ /**
40
+ * Theme Switcher Component
41
+ * Provides UI controls for changing themes
42
+ */
43
+ export declare const ThemeSwitcher: FactoryComponent<ThemeSwitcherAttrs>;
44
+ /**
45
+ * Simple theme toggle button (just switches between light/dark)
46
+ */
47
+ export declare const ThemeToggle: FactoryComponent<{
48
+ className?: string;
49
+ }>;
@@ -0,0 +1,42 @@
1
+ import { FactoryComponent } from 'mithril';
2
+ import { InputAttrs } from './input-options';
3
+ export interface TimepickerI18n {
4
+ cancel?: string;
5
+ clear?: string;
6
+ done?: string;
7
+ }
8
+ export interface TimepickerOptions {
9
+ dialRadius?: number;
10
+ outerRadius?: number;
11
+ innerRadius?: number;
12
+ tickRadius?: number;
13
+ duration?: number;
14
+ container?: string | null;
15
+ defaultTime?: string;
16
+ fromNow?: number;
17
+ showClearBtn?: boolean;
18
+ i18n?: TimepickerI18n;
19
+ autoClose?: boolean;
20
+ twelveHour?: boolean;
21
+ vibrate?: boolean;
22
+ onOpen?: () => void;
23
+ onOpenStart?: () => void;
24
+ onOpenEnd?: () => void;
25
+ onCloseStart?: () => void;
26
+ onCloseEnd?: () => void;
27
+ onSelect?: (hour: number, minute: number) => void;
28
+ }
29
+ export interface TimePickerAttrs extends InputAttrs<string>, TimepickerOptions {
30
+ /** Use inline mode (HTML5 time input) instead of modal, default true */
31
+ useModal?: boolean;
32
+ /** Allow format toggle between 12h/24h (for inline mode) */
33
+ allowFormatToggle?: boolean;
34
+ /** Clear button label */
35
+ clearLabel?: string;
36
+ /** Close button label */
37
+ closeLabel?: string;
38
+ }
39
+ /**
40
+ * TimePicker component based on original Materialize CSS timepicker
41
+ */
42
+ export declare const TimePicker: FactoryComponent<TimePickerAttrs>;
@@ -0,0 +1,45 @@
1
+ import { FactoryComponent } from 'mithril';
2
+ export interface ToastOptions {
3
+ /** HTML content for the toast */
4
+ html?: string;
5
+ /** Display length in milliseconds */
6
+ displayLength?: number;
7
+ /** Animation in duration in milliseconds */
8
+ inDuration?: number;
9
+ /** Animation out duration in milliseconds */
10
+ outDuration?: number;
11
+ /** Additional CSS classes */
12
+ classes?: string;
13
+ /** Callback function called when toast is dismissed */
14
+ completeCallback?: () => void;
15
+ /** Activation percentage for swipe dismissal */
16
+ activationPercent?: number;
17
+ }
18
+ export declare class Toast {
19
+ el: HTMLElement;
20
+ options: Required<ToastOptions>;
21
+ private state;
22
+ private static _toasts;
23
+ private static _container;
24
+ private static _draggedToast;
25
+ private static defaults;
26
+ constructor(options?: ToastOptions);
27
+ static getInstance(el: HTMLElement): Toast | undefined;
28
+ static _createContainer(): void;
29
+ static _removeContainer(): void;
30
+ static _onDragStart: (e: Event) => void;
31
+ static _onDragMove: (e: Event) => void;
32
+ static _onDragEnd: () => void;
33
+ static _xPos(e: Event): number;
34
+ static dismissAll(): void;
35
+ _createToast(): HTMLElement;
36
+ _animateIn(): void;
37
+ _setTimer(): void;
38
+ dismiss(): void;
39
+ }
40
+ export declare const toast: (options: ToastOptions) => Toast;
41
+ export interface ToastComponentAttrs extends ToastOptions {
42
+ /** Whether to show the toast */
43
+ show?: boolean;
44
+ }
45
+ export declare const ToastComponent: FactoryComponent<ToastComponentAttrs>;
@@ -0,0 +1,59 @@
1
+ import { FactoryComponent, Attributes } from 'mithril';
2
+ export interface TooltipOptions {
3
+ /** Delay before tooltip appears on hover */
4
+ enterDelay?: number;
5
+ /** Delay before tooltip disappears after hover ends */
6
+ exitDelay?: number;
7
+ /** HTML content for the tooltip */
8
+ html?: string | null;
9
+ /** Margin from element */
10
+ margin?: number;
11
+ /** Animation in duration */
12
+ inDuration?: number;
13
+ /** Animation out duration */
14
+ outDuration?: number;
15
+ /** Position of tooltip */
16
+ position?: 'top' | 'bottom' | 'left' | 'right';
17
+ /** Movement during transition */
18
+ transitionMovement?: number;
19
+ }
20
+ export declare class Tooltip {
21
+ el: HTMLElement;
22
+ tooltipEl: HTMLElement;
23
+ options: Required<TooltipOptions>;
24
+ private state;
25
+ private static defaults;
26
+ private _handleMouseEnterBound;
27
+ private _handleMouseLeaveBound;
28
+ private _handleFocusBound;
29
+ private _handleBlurBound;
30
+ constructor(el: HTMLElement, options?: TooltipOptions);
31
+ static getInstance(el: HTMLElement): Tooltip | undefined;
32
+ destroy(): void;
33
+ _appendTooltipEl(): void;
34
+ _updateTooltipContent(): void;
35
+ _setupEventHandlers(): void;
36
+ _removeEventHandlers(): void;
37
+ open(isManual?: boolean): void;
38
+ close(): void;
39
+ _setExitDelayTimeout(): void;
40
+ _setEnterDelayTimeout(isManual: boolean): void;
41
+ _positionTooltip(): void;
42
+ _repositionWithinScreen(x: number, y: number, width: number, height: number): {
43
+ x: number;
44
+ y: number;
45
+ };
46
+ _animateIn(): void;
47
+ _animateOut(): void;
48
+ _handleMouseEnter(): void;
49
+ _handleMouseLeave(): void;
50
+ _handleFocus(): void;
51
+ _handleBlur(): void;
52
+ _getAttributeOptions(): Partial<TooltipOptions>;
53
+ }
54
+ export interface TooltipComponentAttrs extends Attributes, TooltipOptions {
55
+ /** Element selector or reference to attach tooltip to */
56
+ targetSelector?: string;
57
+ }
58
+ export declare const TooltipComponent: FactoryComponent<TooltipComponentAttrs>;
59
+ export declare const initTooltips: (selector?: string, options?: TooltipOptions) => Tooltip[];