mithril-materialized 2.0.0-beta.9 → 2.0.0-rc.2

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 (43) hide show
  1. package/README.md +353 -10
  2. package/dist/advanced.css +6 -6
  3. package/dist/button.d.ts +56 -11
  4. package/dist/components.css +1674 -6
  5. package/dist/core.css +13 -13
  6. package/dist/datatable.d.ts +291 -0
  7. package/dist/datepicker.d.ts +12 -2
  8. package/dist/file-upload.d.ts +23 -0
  9. package/dist/floating-action-button.d.ts +1 -1
  10. package/dist/forms.css +344 -13
  11. package/dist/icon.d.ts +2 -2
  12. package/dist/image-list.d.ts +70 -0
  13. package/dist/index.css +1940 -20
  14. package/dist/index.d.ts +8 -0
  15. package/dist/index.esm.js +2736 -659
  16. package/dist/index.js +2746 -658
  17. package/dist/index.min.css +2 -2
  18. package/dist/index.umd.js +2746 -658
  19. package/dist/input-options.d.ts +18 -4
  20. package/dist/input.d.ts +0 -1
  21. package/dist/masonry.d.ts +17 -0
  22. package/dist/material-icon.d.ts +3 -0
  23. package/dist/pickers.css +45 -0
  24. package/dist/range-slider.d.ts +42 -0
  25. package/dist/theme-switcher.d.ts +23 -0
  26. package/dist/timeline.d.ts +43 -0
  27. package/dist/treeview.d.ts +39 -0
  28. package/dist/types.d.ts +226 -0
  29. package/dist/utilities.css +16 -9
  30. package/package.json +12 -9
  31. package/sass/components/_cards.scss +10 -3
  32. package/sass/components/_datatable.scss +417 -0
  33. package/sass/components/_datepicker.scss +57 -0
  34. package/sass/components/_global.scss +6 -6
  35. package/sass/components/_image-list.scss +421 -0
  36. package/sass/components/_masonry.scss +241 -0
  37. package/sass/components/_timeline.scss +452 -0
  38. package/sass/components/_treeview.scss +353 -0
  39. package/sass/components/forms/_forms.scss +1 -1
  40. package/sass/components/forms/_range-enhanced.scss +406 -0
  41. package/sass/components/forms/_range.scss +5 -5
  42. package/sass/components/forms/_select.scss +1 -1
  43. package/sass/materialize.scss +6 -0
package/README.md CHANGED
@@ -20,7 +20,7 @@ This is a **major breaking release** that removes all external JavaScript depend
20
20
 
21
21
  - **Removed dependencies**: No longer requires `materialize-css` or `material-icons` packages
22
22
  - **Component updates**: DatePicker and TimePicker now have custom implementations
23
- - **Icon changes**: Uses custom SVG icons instead of Material Icons font
23
+ - **Icon changes**: Library uses custom SVG icons. Material Icons font is supported too, but not required.
24
24
  - **Installation**: Simpler installation process with fewer dependencies
25
25
 
26
26
  ### 📈 Migration from v1.x
@@ -54,10 +54,10 @@ Your CSS imports can remain the same, but you no longer need the materialize-css
54
54
  - EmailInput
55
55
  - NumberInput
56
56
  - ColorInput
57
- - RangeInput
57
+ - RangeInput (with vertical, double-thumb support, and smart tooltip display)
58
58
  - Chips
59
59
  - [Pickers](https://erikvullings.github.io/mithril-materialized/#!/pickers)
60
- - DatePicker
60
+ - DatePicker (with optional week numbers and date range selection)
61
61
  - TimePicker
62
62
  - [Selections](https://erikvullings.github.io/mithril-materialized/#!/selections)
63
63
  - Select
@@ -68,12 +68,28 @@ Your CSS imports can remain the same, but you no longer need the materialize-css
68
68
  - [Collections](https://erikvullings.github.io/mithril-materialized/#!/collections)
69
69
  - Basic, Link and Avatar Collections
70
70
  - Collapsible or accordion
71
+ - [Theme & Upload](https://erikvullings.github.io/mithril-materialized/#!/theme)
72
+ - ThemeSwitcher (light/dark/auto theme switching)
73
+ - ThemeToggle (simple light/dark toggle)
74
+ - FileUpload (drag-and-drop with validation and preview)
75
+ - [Navigation](https://erikvullings.github.io/mithril-materialized/#!/navigation)
76
+ - Sidenav (responsive navigation drawer)
77
+ - Breadcrumb (navigation path indicator)
78
+ - Wizard/Stepper (multi-step process guidance)
71
79
  - [Others](https://erikvullings.github.io/mithril-materialized/#!/modals)
72
80
  - ModalPanel
73
81
  - MaterialBox
74
82
  - Carousel
75
83
  - Pagination
84
+ - PaginationControls
76
85
  - Parallax
86
+ - [Layout & Display](https://erikvullings.github.io/mithril-materialized/#!/layout)
87
+ - Masonry (Pinterest-style responsive grid layout)
88
+ - ImageList (responsive image galleries with various layouts)
89
+ - Timeline (vertical timeline with events and milestones)
90
+ - Data & Tables
91
+ - DataTable (sorting, filtering, pagination, selection)
92
+ - TreeView (hierarchical data with expand/collapse, selection, and customizable icons)
77
93
  - Additional
78
94
  - Label
79
95
  - HelperText
@@ -102,21 +118,171 @@ Your CSS imports can remain the same, but you no longer need the materialize-css
102
118
 
103
119
  ```typescript
104
120
  import m from 'mithril';
105
- import { TextInput, Button, DatePicker } from 'mithril-materialized';
121
+ import {
122
+ TextInput,
123
+ Button,
124
+ RangeInput,
125
+ DatePicker,
126
+ DataTable,
127
+ TreeView,
128
+ ThemeToggle,
129
+ FileUpload,
130
+ Sidenav,
131
+ Breadcrumb,
132
+ Wizard,
133
+ Masonry,
134
+ Timeline,
135
+ ImageList
136
+ } from 'mithril-materialized';
106
137
 
107
138
  const MyComponent = () => ({
108
139
  view: () => m('.container', [
140
+ // Theme toggle in header
141
+ m('nav', [
142
+ m('.nav-wrapper', [
143
+ m('.right', m(ThemeToggle))
144
+ ])
145
+ ]),
146
+
147
+ // Breadcrumb navigation
148
+ m(Breadcrumb, {
149
+ items: [
150
+ { text: 'Home', href: '/' },
151
+ { text: 'Products', href: '/products' },
152
+ { text: 'Details', active: true }
153
+ ]
154
+ }),
155
+
156
+ // Form inputs
109
157
  m(TextInput, {
110
158
  label: 'Your name',
111
159
  onchange: (value) => console.log(value)
112
160
  }),
161
+
162
+ // Enhanced range sliders with smart tooltips
163
+ m(RangeInput, {
164
+ label: 'Volume',
165
+ min: 0,
166
+ max: 100,
167
+ valueDisplay: 'auto', // Show tooltip on drag
168
+ onchange: (value) => console.log('Volume:', value)
169
+ }),
170
+
171
+ m(RangeInput, {
172
+ label: 'Price Range',
173
+ min: 0,
174
+ max: 1000,
175
+ minmax: true,
176
+ minValue: 100,
177
+ maxValue: 500,
178
+ valueDisplay: 'always', // Always show values
179
+ onchange: (min, max) => console.log('Range:', min, '-', max)
180
+ }),
181
+
182
+ m(RangeInput, {
183
+ label: 'Vertical Slider',
184
+ min: 0,
185
+ max: 100,
186
+ vertical: true,
187
+ height: '200px',
188
+ valueDisplay: 'auto',
189
+ tooltipPos: 'right',
190
+ onchange: (value) => console.log('Vertical:', value)
191
+ }),
192
+
193
+ // Enhanced DatePicker with range selection
194
+ m(DatePicker, {
195
+ label: 'Event Date',
196
+ helperText: 'Select a single date',
197
+ format: 'mmmm d, yyyy',
198
+ onchange: (value) => console.log('Date:', value)
199
+ }),
200
+
201
+ m(DatePicker, {
202
+ dateRange: true,
203
+ label: 'Project Timeline',
204
+ helperText: 'Select start and end dates',
205
+ format: 'mmmm d, yyyy',
206
+ minDateRange: 1,
207
+ maxDateRange: 30,
208
+ onchange: (value) => console.log('Date range:', value)
209
+ }),
210
+
113
211
  m(Button, {
114
212
  label: 'Submit',
115
213
  onclick: () => alert('Hello!')
116
214
  }),
117
- m(DatePicker, {
118
- label: 'Select date',
119
- onchange: (date) => console.log(date)
215
+
216
+ // File upload
217
+ m(FileUpload, {
218
+ accept: 'image/*',
219
+ multiple: true,
220
+ onFilesSelected: (files) => console.log(files)
221
+ }),
222
+
223
+ // TreeView for hierarchical data
224
+ m(TreeView, {
225
+ data: [
226
+ {
227
+ id: 'root',
228
+ label: 'Project Root',
229
+ expanded: true,
230
+ children: [
231
+ { id: 'src', label: 'src/' },
232
+ { id: 'docs', label: 'docs/' },
233
+ ]
234
+ }
235
+ ],
236
+ selectionMode: 'multiple',
237
+ iconType: 'caret',
238
+ showConnectors: true,
239
+ onselection: (selectedIds) => console.log('Selected:', selectedIds)
240
+ }),
241
+
242
+ // Layout components
243
+ m(Masonry, {
244
+ items: [
245
+ { id: 1, title: 'Card 1', content: 'Short content' },
246
+ { id: 2, title: 'Card 2', content: 'Much longer content...' },
247
+ { id: 3, title: 'Card 3', content: 'Medium content' }
248
+ ],
249
+ columnWidth: 250,
250
+ gap: 16,
251
+ renderItem: (item) => m('.card', [
252
+ m('.card-content', [
253
+ m('span.card-title', item.title),
254
+ m('p', item.content)
255
+ ])
256
+ ])
257
+ }),
258
+
259
+ m(Timeline, {
260
+ events: [
261
+ {
262
+ id: 1,
263
+ title: 'Project Started',
264
+ date: '2024-01-15',
265
+ description: 'Initial project kickoff',
266
+ type: 'milestone'
267
+ },
268
+ {
269
+ id: 2,
270
+ title: 'First Release',
271
+ date: '2024-03-20',
272
+ description: 'Released version 1.0',
273
+ type: 'release'
274
+ }
275
+ ]
276
+ }),
277
+
278
+ m(ImageList, {
279
+ images: [
280
+ { src: '/image1.jpg', alt: 'Image 1' },
281
+ { src: '/image2.jpg', alt: 'Image 2' },
282
+ { src: '/image3.jpg', alt: 'Image 3' }
283
+ ],
284
+ layout: 'masonry', // 'grid' | 'masonry' | 'quilted'
285
+ cols: 3
120
286
  })
121
287
  ])
122
288
  });
@@ -132,6 +298,113 @@ Your CSS imports can remain the same, but you no longer need the materialize-css
132
298
 
133
299
  See the [live documentation](https://erikvullings.github.io/mithril-materialized/index.html) for examples and component APIs.
134
300
 
301
+ > **Note**: The date range picker is now fully implemented with comprehensive validation and formatting support.
302
+
303
+ ## 🗺️ Roadmap & Planned Improvements
304
+
305
+ ### 🚀 Phase 1: Core Optimizations & New Components (In Progress)
306
+
307
+ **✅ Completed:**
308
+
309
+ - ✅ Modular CSS architecture with tree-shaking support
310
+ - ✅ Dark theme system with CSS custom properties
311
+ - ✅ File upload component with drag-and-drop
312
+ - ✅ Theme switching components (ThemeSwitcher, ThemeToggle)
313
+ - ✅ Sidenav component with responsive behavior
314
+ - ✅ Breadcrumb navigation component
315
+ - ✅ Wizard/Stepper component for multi-step forms
316
+
317
+ **✅ Recently Completed:**
318
+
319
+ - ✅ DataTable component with sorting, filtering, and pagination
320
+ - ✅ TreeView component for hierarchical data with expand/collapse, selection, and VSCode-style connectors
321
+ - ✅ Enhanced TypeScript definitions with better JSDoc comments
322
+ - ✅ Performance optimizations and bundle size improvements
323
+ - ✅ Enhanced RangeInput with vertical orientation, double-thumb range selection, and smart tooltip display
324
+ - ✅ Advanced DatePicker with date range selection, constraints, and format support
325
+ - ✅ Layout components: Masonry (Pinterest-style grid), Timeline (vertical event display), ImageList (responsive galleries)
326
+ - ✅ Improved RangeInput components converted to proper Mithril components with better lifecycle management
327
+ - ✅ Enhanced accessibility with individual thumb slider elements and PageUp/PageDown keyboard support
328
+
329
+ ### 🎯 Phase 2: Advanced Components & Features
330
+
331
+ **Data Display:**
332
+
333
+ - Card layouts with enhanced Material Design 3.0 styling
334
+ - Advanced tree operations (drag & drop, context menus)
335
+
336
+ **Input & Forms:**
337
+
338
+ - ✅ Advanced date range picker with validation and constraints
339
+ - Autocomplete with async data loading
340
+
341
+ **Navigation & Layout:**
342
+
343
+ - AppBar/Toolbar component with responsive behavior
344
+ - Bottom navigation component for mobile apps
345
+ - Drawer/Sidebar component with overlay and push modes
346
+ - Grid system enhancements with CSS Grid support
347
+
348
+ ### 🔮 Phase 3: Modern Features & Integration
349
+
350
+ **Developer Experience:**
351
+
352
+ - Storybook integration for component documentation
353
+ - Figma design system integration
354
+ - CLI tools for component generation
355
+ - Better accessibility (ARIA) support throughout
356
+
357
+ **Performance & Optimization:**
358
+
359
+ - Virtual scrolling for large lists
360
+ - Lazy loading component utilities
361
+ - Bundle analyzer and optimization tools
362
+ - CSS-in-JS runtime support option
363
+
364
+ ### 📊 Bundle Size Targets
365
+
366
+ **Current Status (v2.0.0-beta.15):**
367
+
368
+ - Total: 70KB gzipped (44KB JS + 26KB CSS)
369
+ - Modular CSS can reduce bundle by 30-50%
370
+
371
+ **Phase 1 Targets:**
372
+
373
+ - Core bundle: <40KB gzipped
374
+ - Modular approach: <25KB for typical apps
375
+ - Tree-shaking effectiveness: 60%+
376
+
377
+ **Long-term Goals:**
378
+
379
+ - Individual components: <2KB each
380
+ - Micro-bundle support for single components
381
+ - Zero-runtime CSS option for static sites
382
+
383
+ ### 🤝 Contributing
384
+
385
+ We welcome contributions! Priority areas for community involvement:
386
+
387
+ 1. **Usage**: Accessibility improvements, performance optimizations
388
+ 2. **Documentation**: Examples, guides, API documentation
389
+ 3. **Testing**: Unit tests, visual regression tests, browser compatibility
390
+
391
+ See our [contributing guide](CONTRIBUTING.md) for detailed information.
392
+
393
+ ### 📈 Performance Benchmarks
394
+
395
+ **Bundle Size Comparison:**
396
+
397
+ - mithril-materialized v2.0: 64KB gzipped
398
+ - Material-UI: ~350KB gzipped
399
+ - Materialize CSS + jQuery: ~180KB gzipped
400
+ - Vuetify: ~250KB gzipped
401
+
402
+ **Runtime Performance:**
403
+
404
+ - Component initialization: <5ms average
405
+ - Theme switching: <10ms for full page
406
+ - File upload processing: Real-time without blocking
407
+
135
408
  ## Build instructions
136
409
 
137
410
  This repository consists of two packages, combined using `lerna`: the `lib` package that is published to `npm`, as well as an `example` project which uses this library to display the Mithril components that it contains.
@@ -155,11 +428,81 @@ import 'mithril-materialized/index.css';
155
428
  - ✅ Custom optimizations for better performance
156
429
  - ✅ No external font dependencies
157
430
 
431
+ ### 🔥 NEW: Modular CSS Architecture
432
+
433
+ **Tree-shakable CSS modules** for optimal bundle sizes! Import only the CSS you need:
434
+
435
+ ```typescript
436
+ // Option 1: Import everything (64KB total)
437
+ import 'mithril-materialized/index.css';
438
+
439
+ // Option 2: Import only what you need (modular approach)
440
+ import 'mithril-materialized/core.css'; // Essential styles (18KB)
441
+ import 'mithril-materialized/forms.css'; // Form components only
442
+ import 'mithril-materialized/components.css'; // Interactive components
443
+
444
+ // Option 3: Advanced components only when needed
445
+ import 'mithril-materialized/pickers.css'; // Date/Time pickers
446
+ import 'mithril-materialized/advanced.css'; // Carousel, sidenav, etc.
447
+ import 'mithril-materialized/utilities.css'; // Badges, icons, cards
448
+ ```
449
+
450
+ **CSS Modules Available:**
451
+
452
+ - `core.css` (18KB) - Essential foundation (normalize, grid, typography, variables)
453
+ - `components.css` - Interactive components (buttons, dropdowns, modals, tabs)
454
+ - `forms.css` - All form components (inputs, selects, switches, file upload)
455
+ - `pickers.css` - Date and time picker components
456
+ - `advanced.css` - Specialized components (carousel, sidenav, navbar, preloader)
457
+ - `utilities.css` - Visual utilities (badges, cards, icons, toast, chips)
458
+
459
+ **Bundle Size Optimization:**
460
+
461
+ - Full bundle: 64KB gzipped (44KB JS + 20KB CSS)
462
+ - Modular approach can reduce CSS by 30-50%
463
+ - Use only `core.css` + specific modules for your use case
464
+
465
+ ### 🌓 Dark Theme Support
466
+
467
+ Built-in dark theme support with CSS custom properties:
468
+
469
+ ```typescript
470
+ import { ThemeManager, ThemeSwitcher } from 'mithril-materialized';
471
+
472
+ // Programmatic theme control
473
+ ThemeManager.setTheme('dark'); // 'light' | 'dark' | 'auto'
474
+ ThemeManager.toggle(); // Toggle between light/dark
475
+ ThemeManager.getTheme(); // Get current theme
476
+
477
+ // UI Components
478
+ m(ThemeSwitcher, {
479
+ onThemeChange: (theme) => console.log('Theme:', theme)
480
+ });
481
+
482
+ m(ThemeToggle); // Simple toggle button
483
+ ```
484
+
485
+ **CSS Custom Properties**: All colors use CSS variables for runtime theme switching:
486
+
487
+ ```css
488
+ :root {
489
+ --mm-primary-color: #26a69a;
490
+ --mm-background-color: #ffffff;
491
+ --mm-text-primary: rgba(0, 0, 0, 0.87);
492
+ }
493
+
494
+ [data-theme="dark"] {
495
+ --mm-primary-color: #80cbc4;
496
+ --mm-background-color: #121212;
497
+ --mm-text-primary: rgba(255, 255, 255, 0.87);
498
+ }
499
+ ```
500
+
158
501
  ### SASS Usage
159
502
 
160
503
  For advanced customization, you can use the SASS source files directly:
161
504
 
162
- ```scss
505
+ ```css
163
506
  // Import all SASS components
164
507
  @import 'mithril-materialized/sass/materialize.scss';
165
508
 
@@ -171,7 +514,7 @@ For advanced customization, you can use the SASS source files directly:
171
514
 
172
515
  **SASS Variables**: You can customize colors, spacing, and other design tokens by overriding SASS variables before importing:
173
516
 
174
- ```scss
517
+ ```css
175
518
  // Customize Material Design variables
176
519
  $primary-color: #2196F3;
177
520
  $secondary-color: #FF9800;
@@ -190,7 +533,7 @@ The library includes these additional styles for enhanced functionality:
190
533
  .clear-10,
191
534
  .clear-15 {
192
535
  clear: both;
193
- /* overflow: hidden; Précaution pour IE 7 */
536
+ /* overflow: hidden; Precaution pour IE 7 */
194
537
  }
195
538
  .clear-10 {
196
539
  margin-bottom: 10px;
package/dist/advanced.css CHANGED
@@ -205,21 +205,21 @@ video.responsive-video {
205
205
  height: 30px;
206
206
  }
207
207
  .pagination li a {
208
- color: #444;
208
+ color: var(--mm-text-primary, #444);
209
209
  display: inline-block;
210
210
  font-size: 1.2rem;
211
211
  padding: 0 10px;
212
212
  line-height: 30px;
213
213
  }
214
214
  .pagination li.active a {
215
- color: #fff;
215
+ color: var(--mm-text-on-primary, #fff);
216
216
  }
217
217
  .pagination li.active {
218
218
  background-color: #ee6e73;
219
219
  }
220
220
  .pagination li.disabled a {
221
221
  cursor: default;
222
- color: #999;
222
+ color: var(--mm-text-disabled, #999);
223
223
  }
224
224
  .pagination li i {
225
225
  font-size: 2rem;
@@ -550,8 +550,8 @@ td, th {
550
550
  .collection .collection-item.avatar i.circle {
551
551
  font-size: 18px;
552
552
  line-height: 42px;
553
- color: #fff;
554
- background-color: #999;
553
+ color: var(--mm-text-on-primary, #fff);
554
+ background-color: var(--mm-text-disabled, #999);
555
555
  text-align: center;
556
556
  }
557
557
  .collection .collection-item.avatar .title {
@@ -573,7 +573,7 @@ td, th {
573
573
  color: rgb(234.25, 250.25, 248.75);
574
574
  }
575
575
  .collection .collection-item.active .secondary-content {
576
- color: #fff;
576
+ color: var(--mm-text-on-primary, #fff);
577
577
  }
578
578
  .collection a.collection-item {
579
579
  display: block;
package/dist/button.d.ts CHANGED
@@ -1,30 +1,75 @@
1
1
  import m, { FactoryComponent, Attributes } from 'mithril';
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
+ */
2
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
  }
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
+ */
10
37
  export interface ButtonAttrs extends Attributes {
11
- /** Optional (e.g. in case you only want to use an icon) button label */
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 */
61
+ /**
62
+ * @deprecated Use native HTML attributes directly instead
63
+ * Some additional HTML attributes that can be attached to the button
64
+ */
23
65
  attr?: HtmlAttrs;
24
- /** Optional text-based tooltip, @see https://materializecss.com/tooltips.html */
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.