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

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 (73) hide show
  1. package/README.md +287 -308
  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 +66 -21
  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/datatable.d.ts +291 -0
  14. package/dist/datepicker.d.ts +66 -0
  15. package/dist/dropdown.d.ts +2 -2
  16. package/dist/file-upload.d.ts +34 -0
  17. package/dist/floating-action-button.d.ts +2 -2
  18. package/dist/forms.css +2284 -0
  19. package/dist/index.css +1825 -184
  20. package/dist/index.d.ts +14 -1
  21. package/dist/index.esm.js +4752 -2143
  22. package/dist/index.js +4776 -2142
  23. package/dist/index.min.css +8 -0
  24. package/dist/index.umd.js +4776 -2142
  25. package/dist/input-options.d.ts +1 -1
  26. package/dist/input.d.ts +9 -10
  27. package/dist/label.d.ts +4 -2
  28. package/dist/material-box.d.ts +2 -2
  29. package/dist/modal.d.ts +2 -2
  30. package/dist/option.d.ts +4 -4
  31. package/dist/pagination.d.ts +2 -2
  32. package/dist/parallax.d.ts +2 -2
  33. package/dist/pickers.css +487 -0
  34. package/dist/pushpin.d.ts +32 -0
  35. package/dist/radio.d.ts +4 -4
  36. package/dist/search-select.d.ts +2 -2
  37. package/dist/select.d.ts +2 -2
  38. package/dist/sidenav.d.ts +76 -0
  39. package/dist/switch.d.ts +2 -2
  40. package/dist/tabs.d.ts +2 -4
  41. package/dist/theme-switcher.d.ts +49 -0
  42. package/dist/timepicker.d.ts +42 -0
  43. package/dist/toast.d.ts +45 -0
  44. package/dist/tooltip.d.ts +59 -0
  45. package/dist/types.d.ts +226 -0
  46. package/dist/utilities.css +3204 -0
  47. package/dist/wizard.d.ts +58 -0
  48. package/package.json +20 -9
  49. package/sass/components/_breadcrumb.scss +248 -0
  50. package/sass/components/_buttons.scss +3 -3
  51. package/sass/components/_cards.scss +10 -3
  52. package/sass/components/_chips.scss +8 -8
  53. package/sass/components/_collapsible.scss +8 -8
  54. package/sass/components/_datatable.scss +417 -0
  55. package/sass/components/_datepicker.scss +45 -14
  56. package/sass/components/_dropdown.scss +5 -5
  57. package/sass/components/_file-upload.scss +228 -0
  58. package/sass/components/_global.scss +13 -11
  59. package/sass/components/_modal.scss +5 -2
  60. package/sass/components/_navbar.scss +13 -5
  61. package/sass/components/_sidenav.scss +164 -7
  62. package/sass/components/_tabs.scss +5 -4
  63. package/sass/components/_theme-switcher.scss +120 -0
  64. package/sass/components/_theme-variables.scss +205 -0
  65. package/sass/components/_timepicker.scss +179 -87
  66. package/sass/components/_wizard.scss +416 -0
  67. package/sass/components/forms/_input-fields.scss +34 -12
  68. package/sass/components/forms/_radio-buttons.scss +10 -10
  69. package/sass/components/forms/_range.scss +5 -5
  70. package/sass/components/forms/_select.scss +9 -9
  71. package/sass/components/forms/_switches.scss +6 -6
  72. package/sass/materialize.scss +8 -0
  73. package/dist/pickers.d.ts +0 -130
@@ -1,6 +1,6 @@
1
1
  import { FactoryComponent } from 'mithril';
2
- import { InputAttributes } from './input-options';
3
- export interface AutoCompleteAttributes extends InputAttributes<string> {
2
+ import { InputAttrs } from './input-options';
3
+ export interface AutoCompleteAttrs extends InputAttrs<string> {
4
4
  /** The data object defining the autocomplete options */
5
5
  data?: Record<string, string | null>;
6
6
  /** Limit of how many options are shown. Default: Infinity */
@@ -11,4 +11,4 @@ export interface AutoCompleteAttributes extends InputAttributes<string> {
11
11
  onAutocomplete?: (value: string) => void;
12
12
  }
13
13
  /** Component to auto complete your text input - Pure Mithril implementation */
14
- export declare const Autocomplete: FactoryComponent<AutoCompleteAttributes>;
14
+ export declare const Autocomplete: FactoryComponent<AutoCompleteAttrs>;
@@ -0,0 +1,53 @@
1
+ import { FactoryComponent, Attributes } from 'mithril';
2
+ export interface BreadcrumbItemAttrs {
3
+ /** Text content of the breadcrumb item */
4
+ text?: string;
5
+ /** URL for the breadcrumb item */
6
+ href?: string;
7
+ /** Whether this item is the current/active item */
8
+ active?: boolean;
9
+ /** Click handler for the breadcrumb item */
10
+ onclick?: (e: Event) => void;
11
+ /** Icon name (material icons) */
12
+ icon?: string;
13
+ /** Custom class for the item */
14
+ className?: string;
15
+ /** Whether this item is disabled */
16
+ disabled?: boolean;
17
+ }
18
+ export interface BreadcrumbAttrs extends Attributes {
19
+ /** Array of breadcrumb items */
20
+ items: BreadcrumbItemAttrs[];
21
+ /** Custom separator between items */
22
+ separator?: string;
23
+ /** Custom class for the breadcrumb container */
24
+ className?: string;
25
+ /** Whether to show icons */
26
+ showIcons?: boolean;
27
+ /** Maximum number of items to show before collapsing */
28
+ maxItems?: number;
29
+ /** Whether to show home icon for first item */
30
+ showHome?: boolean;
31
+ }
32
+ /**
33
+ * Breadcrumb Component
34
+ * Displays a navigation path showing the user's location within a site hierarchy
35
+ */
36
+ export declare const Breadcrumb: FactoryComponent<BreadcrumbAttrs>;
37
+ /**
38
+ * Simple Breadcrumb utility for common use cases
39
+ */
40
+ export declare const createBreadcrumb: (path: string, basePath?: string) => BreadcrumbItemAttrs[];
41
+ /**
42
+ * Breadcrumb utilities
43
+ */
44
+ export declare class BreadcrumbManager {
45
+ /**
46
+ * Create breadcrumb items from a route path
47
+ */
48
+ static fromRoute(route: string, routeConfig?: Record<string, string>): BreadcrumbItemAttrs[];
49
+ /**
50
+ * Create breadcrumb items from a hierarchical object
51
+ */
52
+ static fromHierarchy(hierarchy: any[], textKey?: string, pathKey?: string): BreadcrumbItemAttrs[];
53
+ }
package/dist/button.d.ts CHANGED
@@ -1,40 +1,85 @@
1
1
  import m, { FactoryComponent, Attributes } from 'mithril';
2
- export interface HtmlAttributes {
2
+ import { MaterialPosition, IconClass, ButtonVariant } from './types';
3
+ /**
4
+ * HTML attributes that can be passed to button elements
5
+ * @deprecated Use native HTML attributes directly instead
6
+ */
7
+ export interface HtmlAttrs {
3
8
  id?: string;
4
9
  for?: string;
5
10
  placeholder?: string;
6
11
  autofocus?: boolean;
7
12
  disabled?: boolean;
8
- type?: 'submit' | 'button' | 'text' | 'textarea' | 'number';
13
+ type?: 'submit' | 'button' | 'reset';
9
14
  }
10
- export interface ButtonAttributes extends Attributes {
11
- /** Optional (e.g. in case you only want to use an icon) button label */
15
+ /**
16
+ * Enhanced button attributes with improved TypeScript support
17
+ * @example
18
+ * ```typescript
19
+ * // Basic button
20
+ * m(Button, { label: 'Click me' })
21
+ *
22
+ * // Submit button with icon
23
+ * m(Button, {
24
+ * variant: { type: 'submit' },
25
+ * label: 'Save',
26
+ * iconName: 'save',
27
+ * iconClass: 'small left'
28
+ * })
29
+ *
30
+ * // Modal trigger button
31
+ * m(Button, {
32
+ * variant: { type: 'modal', modalId: 'my-modal' },
33
+ * label: 'Open Modal'
34
+ * })
35
+ * ```
36
+ */
37
+ export interface ButtonAttrs extends Attributes {
38
+ /** Button label text (optional for icon-only buttons) */
12
39
  label?: string;
13
- /** Optional icon material-icons name, @see https://materializecss.com/icons.html */
40
+ /** Material icon name - see https://materializecss.com/icons.html */
14
41
  iconName?: string;
15
- /** Optional icon class, e.g. tiny (1em), small (2em), medium (4em), large (6em), or 'tiny right' */
16
- iconClass?: string;
17
42
  /**
18
- * If the button is intended to open a modal, specify its modal id so we can trigger it,
19
- * @see https://materializecss.com/modals.html
43
+ * Icon size and position class
44
+ * @example 'small', 'medium left', 'large right'
45
+ */
46
+ iconClass?: IconClass;
47
+ /**
48
+ * Button behavior variant - determines button type and behavior
49
+ * @example
50
+ * { type: 'button' } - Standard button
51
+ * { type: 'submit' } - Form submit button
52
+ * { type: 'modal', modalId: 'my-modal' } - Modal trigger
53
+ * { type: 'reset' } - Form reset button
54
+ */
55
+ variant?: ButtonVariant;
56
+ /**
57
+ * @deprecated Use variant instead
58
+ * If the button is intended to open a modal, specify its modal id so we can trigger it
20
59
  */
21
60
  modalId?: string;
22
- /** Some additional HTML attributes that can be attached to the button */
23
- attr?: HtmlAttributes;
24
- /** Optional text-based tooltip, @see https://materializecss.com/tooltips.html */
61
+ /**
62
+ * @deprecated Use native HTML attributes directly instead
63
+ * Some additional HTML attributes that can be attached to the button
64
+ */
65
+ attr?: HtmlAttrs;
66
+ /** Tooltip text to display on hover */
25
67
  tooltip?: string;
26
- /** Optional location for the tooltip */
27
- tooltipPostion?: 'top' | 'bottom' | 'left' | 'right';
68
+ /**
69
+ * Tooltip position
70
+ * @fixed typo: tooltipPostion -> tooltipPosition
71
+ */
72
+ tooltipPosition?: MaterialPosition;
28
73
  }
29
74
  /**
30
75
  * A factory to create new buttons.
31
76
  *
32
77
  * @example FlatButton = ButtonFactory('a.waves-effect.waves-teal.btn-flat');
33
78
  */
34
- export declare const ButtonFactory: (element: string, defaultClassNames: string, type?: string) => FactoryComponent<ButtonAttributes>;
35
- export declare const Button: m.FactoryComponent<ButtonAttributes>;
36
- export declare const LargeButton: m.FactoryComponent<ButtonAttributes>;
37
- export declare const SmallButton: m.FactoryComponent<ButtonAttributes>;
38
- export declare const FlatButton: m.FactoryComponent<ButtonAttributes>;
39
- export declare const RoundIconButton: m.FactoryComponent<ButtonAttributes>;
40
- export declare const SubmitButton: m.FactoryComponent<ButtonAttributes>;
79
+ export declare const ButtonFactory: (element: string, defaultClassNames: string, type?: string) => FactoryComponent<ButtonAttrs>;
80
+ export declare const Button: m.FactoryComponent<ButtonAttrs>;
81
+ export declare const LargeButton: m.FactoryComponent<ButtonAttrs>;
82
+ export declare const SmallButton: m.FactoryComponent<ButtonAttrs>;
83
+ export declare const FlatButton: m.FactoryComponent<ButtonAttrs>;
84
+ export declare const RoundIconButton: m.FactoryComponent<ButtonAttrs>;
85
+ export declare const SubmitButton: m.FactoryComponent<ButtonAttrs>;
@@ -25,7 +25,7 @@ export interface CarouselOptions {
25
25
  /** Don't wrap around and cycle through items */
26
26
  noWrap?: boolean;
27
27
  }
28
- export interface CarouselAttributes extends CarouselOptions, Attributes {
28
+ export interface CarouselAttrs extends CarouselOptions, Attributes {
29
29
  /** The list of images */
30
30
  items: CarouselItem[];
31
31
  /** Called when carousel item changes */
@@ -35,4 +35,4 @@ export interface CarouselAttributes extends CarouselOptions, Attributes {
35
35
  * Materialize CSS Carousel component with dynamic positioning
36
36
  * Port of the original MaterializeCSS carousel logic
37
37
  */
38
- export declare const Carousel: FactoryComponent<CarouselAttributes>;
38
+ export declare const Carousel: FactoryComponent<CarouselAttrs>;
package/dist/chip.d.ts CHANGED
@@ -7,7 +7,7 @@ export interface ChipData {
7
7
  export interface AutocompleteOption extends ChipData {
8
8
  value?: string;
9
9
  }
10
- export interface ChipsAttributes {
10
+ export interface ChipsAttrs {
11
11
  id?: string;
12
12
  data?: ChipData[];
13
13
  placeholder?: string;
@@ -28,4 +28,4 @@ export interface ChipsAttributes {
28
28
  onChipDelete?: (chip: ChipData) => void;
29
29
  onChipSelect?: (chip: ChipData) => void;
30
30
  }
31
- export declare const Chips: m.FactoryComponent<ChipsAttributes>;
31
+ export declare const Chips: m.FactoryComponent<ChipsAttrs>;
@@ -1,8 +1,8 @@
1
1
  import { FactoryComponent, Attributes } from 'mithril';
2
- export interface CodeBlockAttributes extends Attributes {
2
+ export interface CodeBlockAttrs extends Attributes {
3
3
  language?: string;
4
4
  code: string | string[];
5
5
  newRow?: boolean;
6
6
  }
7
7
  /** A simple code block without syntax high-lighting */
8
- export declare const CodeBlock: FactoryComponent<CodeBlockAttributes>;
8
+ export declare const CodeBlock: FactoryComponent<CodeBlockAttrs>;
@@ -9,7 +9,7 @@ export interface CollapsibleItem extends Attributes {
9
9
  /** Add an material icon in front of the header. */
10
10
  iconName?: string;
11
11
  }
12
- export interface CollapsibleAttributes extends Attributes {
12
+ export interface CollapsibleAttrs extends Attributes {
13
13
  /** The list of accordeon/collabsible items */
14
14
  items: CollapsibleItem[];
15
15
  /** If true, only one item can be expanded at a time (accordion mode) */
@@ -23,4 +23,4 @@ export declare const CollapsibleItem: FactoryComponent<CollapsibleItem & {
23
23
  * Creates a collabsible or accordion component with pure CSS/Mithril implementation.
24
24
  * No MaterializeCSS JavaScript dependencies.
25
25
  */
26
- export declare const Collapsible: FactoryComponent<CollapsibleAttributes>;
26
+ export declare const Collapsible: FactoryComponent<CollapsibleAttrs>;
@@ -26,7 +26,7 @@ export interface CollectionItem {
26
26
  /** Any other virtual element properties, including attributes and event handlers. */
27
27
  [property: string]: any;
28
28
  }
29
- export interface CollectionAttributes extends Attributes {
29
+ export interface CollectionAttrs extends Attributes {
30
30
  /** Optional header */
31
31
  header?: string;
32
32
  /** The list of items */
@@ -46,4 +46,4 @@ export declare const AnchorItem: FactoryComponent<{
46
46
  * Creates a Collection of items, optionally containing links, headers, secondary content or avatars.
47
47
  * @see https://materializecss.com/collections.html
48
48
  */
49
- export declare const Collection: FactoryComponent<CollectionAttributes>;
49
+ export declare const Collection: FactoryComponent<CollectionAttrs>;