material-inspired-component-library 1.0.2 → 1.1.0

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 (97) hide show
  1. package/README.md +14 -8
  2. package/components/accordion/README.md +5 -2
  3. package/components/bottomsheet/README.md +5 -2
  4. package/components/button/README.md +5 -2
  5. package/components/card/README.md +4 -1
  6. package/components/checkbox/README.md +5 -2
  7. package/components/dialog/README.md +4 -1
  8. package/components/divider/README.md +4 -1
  9. package/components/iconbutton/README.md +5 -2
  10. package/components/list/README.md +5 -2
  11. package/components/menu/README.md +4 -4
  12. package/components/radio/README.md +4 -1
  13. package/components/select/README.md +5 -5
  14. package/components/sidesheet/README.md +4 -1
  15. package/components/slider/README.md +5 -2
  16. package/components/slider/{slider.scss → index.scss} +11 -8
  17. package/components/switch/README.md +4 -1
  18. package/components/textfield/README.md +53 -17
  19. package/components/textfield/{textfield.scss → index.scss} +98 -55
  20. package/components/textfield/index.ts +23 -16
  21. package/components.ts +2 -1
  22. package/dist/micl.css +1 -1
  23. package/dist/micl.js +1 -1
  24. package/dist/slider.css +1 -1
  25. package/dist/textfield.css +1 -1
  26. package/docs/accordion.html +3 -3
  27. package/docs/bottomsheet.html +11 -11
  28. package/docs/button.html +3 -3
  29. package/docs/card-awards.webp +0 -0
  30. package/docs/card-cabinet.webp +0 -0
  31. package/docs/card-city.webp +0 -0
  32. package/docs/card-fingerprint.webp +0 -0
  33. package/docs/card-holiday.webp +0 -0
  34. package/docs/card-names.webp +0 -0
  35. package/docs/card.html +6 -6
  36. package/docs/checkbox.html +3 -3
  37. package/docs/dialog.html +3 -3
  38. package/docs/divider.html +3 -3
  39. package/docs/docs.js +1 -1
  40. package/docs/iconbutton.html +3 -3
  41. package/docs/index.html +5 -5
  42. package/docs/list.html +3 -3
  43. package/docs/menu.html +3 -3
  44. package/docs/micl.css +1 -0
  45. package/docs/micl.js +1 -0
  46. package/docs/radio.html +3 -3
  47. package/docs/select.html +3 -3
  48. package/docs/sidesheet.html +3 -3
  49. package/docs/slider.html +4 -3
  50. package/docs/switch.html +3 -3
  51. package/docs/textfield.html +33 -20
  52. package/docs/themes/airblue/dark-hc.css +51 -0
  53. package/docs/themes/airblue/dark-mc.css +51 -0
  54. package/docs/themes/airblue/dark.css +51 -0
  55. package/docs/themes/airblue/light-hc.css +51 -0
  56. package/docs/themes/airblue/light-mc.css +51 -0
  57. package/docs/themes/airblue/light.css +51 -0
  58. package/docs/themes/airblue/theme.css +306 -0
  59. package/docs/themes/barnred/dark-hc.css +51 -0
  60. package/docs/themes/barnred/dark-mc.css +51 -0
  61. package/docs/themes/barnred/dark.css +51 -0
  62. package/docs/themes/barnred/light-hc.css +51 -0
  63. package/docs/themes/barnred/light-mc.css +51 -0
  64. package/docs/themes/barnred/light.css +51 -0
  65. package/docs/themes/barnred/theme.css +306 -0
  66. package/docs/themes/citrine/dark-hc.css +51 -0
  67. package/docs/themes/citrine/dark-mc.css +51 -0
  68. package/docs/themes/citrine/dark.css +51 -0
  69. package/docs/themes/citrine/light-hc.css +51 -0
  70. package/docs/themes/citrine/light-mc.css +51 -0
  71. package/docs/themes/citrine/light.css +51 -0
  72. package/docs/themes/citrine/theme.css +306 -0
  73. package/docs/themes/olivegreen/dark-hc.css +51 -0
  74. package/docs/themes/olivegreen/dark-mc.css +51 -0
  75. package/docs/themes/olivegreen/dark.css +51 -0
  76. package/docs/themes/olivegreen/light-hc.css +51 -0
  77. package/docs/themes/olivegreen/light-mc.css +51 -0
  78. package/docs/themes/olivegreen/light.css +51 -0
  79. package/docs/themes/olivegreen/theme.css +306 -0
  80. package/package.json +1 -1
  81. package/styles/README.md +5 -5
  82. package/styles.scss +15 -15
  83. package/themes/README.md +1 -1
  84. package/webpack.config.js +1 -1
  85. /package/components/bottomsheet/{bottomsheet.scss → index.scss} +0 -0
  86. /package/components/button/{button.scss → index.scss} +0 -0
  87. /package/components/card/{card.scss → index.scss} +0 -0
  88. /package/components/checkbox/{checkbox.scss → index.scss} +0 -0
  89. /package/components/dialog/{dialog.scss → index.scss} +0 -0
  90. /package/components/divider/{divider.scss → index.scss} +0 -0
  91. /package/components/iconbutton/{iconbutton.scss → index.scss} +0 -0
  92. /package/components/list/{list.scss → index.scss} +0 -0
  93. /package/components/menu/{menu.scss → index.scss} +0 -0
  94. /package/components/radio/{radio.scss → index.scss} +0 -0
  95. /package/components/select/{select.scss → index.scss} +0 -0
  96. /package/components/sidesheet/{sidesheet.scss → index.scss} +0 -0
  97. /package/components/switch/{switch.scss → index.scss} +0 -0
package/README.md CHANGED
@@ -14,7 +14,7 @@ The Material-Inspired Component Library (MICL) offers a free and open-source col
14
14
  ## Demo & Documentation 📖
15
15
  Explore the components in a live environment and see how they work.
16
16
 
17
- - **Live Demo:** [The MICL Showcase]()
17
+ - **Live Demo:** [The MICL Showcase](https://henkpb.github.io/micl/)
18
18
  - **Component Documentation:** [View all component documentation](components/README.md)
19
19
 
20
20
  ## Quick start 🚀
@@ -30,18 +30,18 @@ npm install material-inspired-component-library
30
30
 
31
31
  To import the styles for a single component:
32
32
  ```SCSS
33
- @use "micl/components/card";
33
+ @use "material-inspired-component-library/components/card";
34
34
  ```
35
35
  To import all component styles:
36
36
  ```SCSS
37
- @use "micl/styles";
37
+ @use "material-inspired-component-library/styles";
38
38
  ```
39
39
 
40
40
  **Plain CSS**
41
41
 
42
42
  Add the main CSS file to your project:
43
43
  ```HTML
44
- <link rel="stylesheet" href="node_modules/micl/dist/micl.css">
44
+ <link rel="stylesheet" href="node_modules/material-inspired-component-library/dist/micl.css">
45
45
  ```
46
46
 
47
47
  ### 3. Add the HTML & JavaScript
@@ -61,22 +61,22 @@ Some components, list the **List**, require a small amount of JavaScript to hand
61
61
 
62
62
  ```TypeScript
63
63
  // For components with interactive behaviour
64
- import list from "micl/components/lists";
64
+ import list from "material-inspired-component-library/components/lists";
65
65
 
66
66
  // To import TypeScript for all components
67
- import components from "micl/components";
67
+ import components from "material-inspired-component-library/components";
68
68
  ```
69
69
 
70
70
  To import all the TypeScript into your project:
71
71
  ```TypeScript
72
- import components from "micl/components";
72
+ import components from "material-inspired-component-library/components";
73
73
  ```
74
74
 
75
75
  **Plain JavaScript**
76
76
 
77
77
  Add the main JavaScript file to your project:
78
78
  ```HTML
79
- <script src="node_modules/micl/dist/micl.js"></script>
79
+ <script src="node_modules/material-inspired-component-library/dist/micl.js"></script>
80
80
  ```
81
81
 
82
82
  ## Available components ✅
@@ -97,3 +97,9 @@ The library currently consists of the following components:
97
97
  - [x] [Slider](components/slider/README.md)
98
98
  - [x] [Switch](components/switch/README.md)
99
99
  - [x] [Text field](components/textfield/README.md)
100
+
101
+ ## Change Log
102
+
103
+ #### 1.1.0 (12.08.2025)
104
+ **Features**
105
+ - **Text field**: Added support for multi-line text fields.
@@ -31,7 +31,7 @@ The Accordion component is an extension of the [**List** component](../list/READ
31
31
  Import the list styles into your project:
32
32
 
33
33
  ```CSS
34
- @use "micl/components/list";
34
+ @use "material-inspired-component-library/components/list";
35
35
  ```
36
36
 
37
37
  ### TypeScript
@@ -40,11 +40,14 @@ This component requires a TypeScript module to support keyboard navigation. You
40
40
  To manually initialize the component:
41
41
 
42
42
  ```TypeScript
43
- import miclAccordion from 'micl/components/list';
43
+ import miclAccordion from 'material-inspired-component-library/components/list';
44
44
 
45
45
  miclAccordion.initialize(document.querySelector('.micl-list'));
46
46
  ```
47
47
 
48
+ ### Demo
49
+ A live example of the [Accordion component](https://henkpb.github.io/micl/accordion.html) is available for you to interact with.
50
+
48
51
  ## Variants
49
52
  To ensure that only one accordion item within a group can be open at a time, add a matching `name` attribute to all the `<details>` elements you want to group together.
50
53
 
@@ -18,7 +18,7 @@ To create a standard bottom sheet, use the `<dialog>` element with the `popover`
18
18
  Import the bottom sheet styles into your project:
19
19
 
20
20
  ```CSS
21
- @use "micl/components/bottomsheet";
21
+ @use "material-inspired-component-library/components/bottomsheet";
22
22
  ```
23
23
 
24
24
  ### TypeScript
@@ -27,11 +27,14 @@ This component requires a TypeScript module to support **modal** and **resizable
27
27
  To manually initialize the component:
28
28
 
29
29
  ```TypeScript
30
- import miclBottomSheet from 'micl/components/bottomsheet';
30
+ import miclBottomSheet from 'material-inspired-component-library/components/bottomsheet';
31
31
 
32
32
  miclBottomSheet.initialize(document.querySelector('.micl-bottomsheet'));
33
33
  ```
34
34
 
35
+ ### Demo
36
+ A live example of the [Bottom sheet component](https://henkpb.github.io/micl/bottomsheet.html) is available for you to interact with.
37
+
35
38
  ## Variants
36
39
  A **modal** bottom sheet blocks access to the rest of the page and must be dismissed explicitly by the user. This is suitable for critical tasks or information that requires a user's full attention.
37
40
 
@@ -14,7 +14,7 @@ To create a basic button, use the `<button>` element with a class that specifies
14
14
  Import the button styles into your project:
15
15
 
16
16
  ```CSS
17
- @use "micl/components/button";
17
+ @use "material-inspired-component-library/components/button";
18
18
  ```
19
19
 
20
20
  ### TypeScript
@@ -23,11 +23,14 @@ This component requires a TypeScript module for interactive features like the **
23
23
  To manually initialize the component:
24
24
 
25
25
  ```TypeScript
26
- import miclButton from 'micl/components/button';
26
+ import miclButton from 'material-inspired-component-library/components/button';
27
27
 
28
28
  miclButton.initialize(document.querySelector('.micl-button-text-s'));
29
29
  ```
30
30
 
31
+ ### Demo
32
+ A live example of the [Button component](https://henkpb.github.io/micl/button.html) is available for you to interact with.
33
+
31
34
  ## Variants
32
35
  Buttons come in **five sizes**: extra small (`xs`), small (`s`), medium (`m`), large (`l`), and extra large (`xl`). To specify a size, append the appropriate postfix to the button's style class:
33
36
 
@@ -16,12 +16,15 @@ To add a basic card, use a `<div>` element with one of the primary card style cl
16
16
  Import the card styles into your project:
17
17
 
18
18
  ```CSS
19
- @use "micl/components/card";
19
+ @use "material-inspired-component-library/components/card";
20
20
  ```
21
21
 
22
22
  ### TypeScript
23
23
  No custom TypeScript is required for the core functionality of this component.
24
24
 
25
+ ### Demo
26
+ A live example of the [Card component](https://henkpb.github.io/micl/card.html) is available for you to interact with.
27
+
25
28
  ## Variants
26
29
  Cards come in **three distinct styles**:
27
30
 
@@ -15,7 +15,7 @@ To add a basic checkbox, use the `<input type="checkbox">` element with the `mic
15
15
  Import the checkbox styles into your project:
16
16
 
17
17
  ```CSS
18
- @use "micl/components/checkbox";
18
+ @use "material-inspired-component-library/components/checkbox";
19
19
  ```
20
20
 
21
21
  ### TypeScript
@@ -24,11 +24,14 @@ This component requires a TypeScript module to support checking and unchecking u
24
24
  To manually initialize the component:
25
25
 
26
26
  ```TypeScript
27
- import miclCheckbox from 'micl/components/checkbox';
27
+ import miclCheckbox from 'material-inspired-component-library/components/checkbox';
28
28
 
29
29
  miclCheckbox.initialize(document.querySelector('.micl-checkbox'));
30
30
  ```
31
31
 
32
+ ### Demo
33
+ A live example of the [Checkbox component](https://henkpb.github.io/micl/checkbox.html) is available for you to interact with.
34
+
32
35
  ## Variants
33
36
  Adding the `micl-checkbox--error` CSS class to the `<input>` element will create an error-checkbox as specified by the Material Design 3 specification.
34
37
 
@@ -25,12 +25,15 @@ To create a basic dialog, use the `<dialog>` element with the `micl-dialog` clas
25
25
  Import the dialog styles into your project:
26
26
 
27
27
  ```CSS
28
- @use "micl/components/dialog";
28
+ @use "material-inspired-component-library/components/dialog";
29
29
  ```
30
30
 
31
31
  ### TypeScript
32
32
  No custom TypeScript is required for the core functionality of this component, as the native popover attribute handles the open/close behavior.
33
33
 
34
+ ### Demo
35
+ A live example of the [Dialog component](https://henkpb.github.io/micl/dialog.html) is available for you to interact with.
36
+
34
37
  ## Variants
35
38
  When dialogs with the `popover` attribute are opened, they animate from the control element to the center of the screen. They can be easily dismissed by clicking outside or pressing <kbd>Esc</kbd>.
36
39
 
@@ -14,12 +14,15 @@ To add a basic divider, use the `<hr>` element with the `micl-divider` class:
14
14
  Import the divider styles into your project:
15
15
 
16
16
  ```CSS
17
- @use "micl/components/divider";
17
+ @use "material-inspired-component-library/components/divider";
18
18
  ```
19
19
 
20
20
  ### TypeScript
21
21
  No custom TypeScript is required for the core functionality of this component.
22
22
 
23
+ ### Demo
24
+ A live example of the [Divider component](https://henkpb.github.io/micl/divider.html) is available for you to interact with.
25
+
23
26
  ## Variants
24
27
  The Divider component offers five CSS classes for different divider styles:
25
28
 
@@ -16,7 +16,7 @@ To create a basic icon button, use the `<button>` element with a class that spec
16
16
  Import the icon button styles into your project:
17
17
 
18
18
  ```CSS
19
- @use "micl/components/iconbutton";
19
+ @use "material-inspired-component-library/components/iconbutton";
20
20
  ```
21
21
 
22
22
  ### TypeScript
@@ -25,11 +25,14 @@ This component requires a TypeScript module for interactive features like the **
25
25
  To manually initialize the component:
26
26
 
27
27
  ```TypeScript
28
- import miclIconButton from 'micl/components/button';
28
+ import miclIconButton from 'material-inspired-component-library/components/button';
29
29
 
30
30
  miclIconButton.initialize(document.querySelector('.micl-iconbutton-standard-s'));
31
31
  ```
32
32
 
33
+ ### Demo
34
+ A live example of the [Icon button component](https://henkpb.github.io/micl/iconbutton.html) is available for you to interact with.
35
+
33
36
  ## Variants
34
37
  Icon buttons come in **five sizes**: extra small (`xs`), small (`s`), medium (`m`), large (`l`), and extra large (`xl`). To specify a size, append the appropriate postfix to the button's style class:
35
38
 
@@ -24,7 +24,7 @@ To create a basic list, use the `<ul>` element with the `micl-list` class and in
24
24
  Import the list styles into your project:
25
25
 
26
26
  ```CSS
27
- @use "micl/components/list";
27
+ @use "material-inspired-component-library/components/list";
28
28
  ```
29
29
 
30
30
  ### TypeScript
@@ -33,11 +33,14 @@ This component requires a TypeScript module to support keyboard navigation. You
33
33
  To manually initialize the component:
34
34
 
35
35
  ```TypeScript
36
- import miclList from 'micl/components/list';
36
+ import miclList from 'material-inspired-component-library/components/list';
37
37
 
38
38
  miclList.initialize(document.querySelector('.micl-list'));
39
39
  ```
40
40
 
41
+ ### Demo
42
+ A live example of the [List component](https://henkpb.github.io/micl/list.html) is available for you to interact with.
43
+
41
44
  ## Variants
42
45
  The List component offers three CSS classes to control the height and content capacity of individual list items:
43
46
 
@@ -24,8 +24,8 @@ The Menu component is an extension of the [List component](../list/README.md). I
24
24
  Import the styles for both the menu and list components into your project:
25
25
 
26
26
  ```CSS
27
- @use "micl/components/list";
28
- @use "micl/components/menu";
27
+ @use "material-inspired-component-library/components/list";
28
+ @use "material-inspired-component-library/components/menu";
29
29
  ```
30
30
 
31
31
  ### TypeScript
@@ -34,13 +34,13 @@ This component requires the **Menu** TypeScript module for functionality. You ca
34
34
  To manually initialize the component:
35
35
 
36
36
  ```TypeScript
37
- import miclMenu from 'micl/components/menu';
37
+ import miclMenu from 'material-inspired-component-library/components/menu';
38
38
 
39
39
  miclMenu.initialize(document.querySelector('.micl-menu'));
40
40
  ```
41
41
 
42
42
  ### Demo
43
- A live example of the [Menu component]() is available for you to interact with.
43
+ A live example of the [Menu component](https://henkpb.github.io/micl/menu.html) is available for you to interact with.
44
44
 
45
45
  ## Variants
46
46
  Since the Menu component is based on the **List component**, all of its list item variants and content features can be used. You can incorporate icons, avatars, images, multiple lines of text, and more.
@@ -15,12 +15,15 @@ To add a basic radio button, use the `<input type="radio">` element with the `mi
15
15
  Import the radio button styles into your project:
16
16
 
17
17
  ```CSS
18
- @use "micl/components/radio";
18
+ @use "material-inspired-component-library/components/radio";
19
19
  ```
20
20
 
21
21
  ### TypeScript
22
22
  No custom TypeScript is required for the core functionality of this component. However, to enable the ripple effect on interaction, include the Ripple TypeScript in your project.
23
23
 
24
+ ### Demo
25
+ A live example of the [Radio button component](https://henkpb.github.io/micl/radio.html) is available for you to interact with.
26
+
24
27
  ## Variants
25
28
  A radio button can be disabled by adding the `disabled` attribute to the `<input>` element.
26
29
 
@@ -24,9 +24,9 @@ The Select component is an extension of the [Text field](../textfield/README.md)
24
24
  The Select component relies on styles from the text field and list components. Be sure to import all three styles into your project.
25
25
 
26
26
  ```CSS
27
- @use "micl/components/list";
28
- @use "micl/components/textfield";
29
- @use "micl/components/select";
27
+ @use "material-inspired-component-library/components/list";
28
+ @use "material-inspired-component-library/components/textfield";
29
+ @use "material-inspired-component-library/components/select";
30
30
  ```
31
31
 
32
32
  ### TypeScript
@@ -35,13 +35,13 @@ This component requires the **Text field** TypeScript module for functionality.
35
35
  To manually initialize the component:
36
36
 
37
37
  ```TypeScript
38
- import miclTextField from 'micl/components/textfield';
38
+ import miclTextField from 'material-inspired-component-library/components/textfield';
39
39
 
40
40
  miclTextField.initialize(document.querySelector('.micl-textfield-filled'));
41
41
  ```
42
42
 
43
43
  ### Demo
44
- A live example of the [Select componen]() is available for you to interact with.
44
+ A live example of the [Select component](https://henkpb.github.io/micl/select.html) is available for you to interact with.
45
45
 
46
46
  ## Variants
47
47
  To display extra information for an option, add the `aria-description` attribute to the `<option>` element. In a two-line list item (`micl-list-item-two`), this displays the attribute's content as supporting text. Do not add a separate text element to the `<option>`, as this will change the text of the selected option.
@@ -27,12 +27,15 @@ To create a standard side sheet, use the `<dialog>` element with the `popover` a
27
27
  Import the side sheet styles into your project:
28
28
 
29
29
  ```CSS
30
- @use "micl/components/sidesheet";
30
+ @use "material-inspired-component-library/components/sidesheet";
31
31
  ```
32
32
 
33
33
  ### TypeScript
34
34
  No custom TypeScript is required for the core functionality of the side sheet component.
35
35
 
36
+ ### Demo
37
+ A live example of the [Side sheet component](https://henkpb.github.io/micl/sidesheet.html) is available for you to interact with.
38
+
36
39
  ## Variants
37
40
  A **modal** side sheet blocks access to the rest of the page and must be dismissed explicitly by the user. This is suitable for critical tasks or information that requires a user's full attention.
38
41
 
@@ -14,7 +14,7 @@ To add a basic slider, use the `<input type="range">` element with one of the pr
14
14
  Import the slider styles into your project:
15
15
 
16
16
  ```CSS
17
- @use "micl/components/slider";
17
+ @use "material-inspired-component-library/components/slider";
18
18
  ```
19
19
 
20
20
  ### TypeScript
@@ -23,11 +23,14 @@ This component requires the **Slider** TypeScript module for functionality. You
23
23
  To manually initialize the component:
24
24
 
25
25
  ```TypeScript
26
- import miclSlider from 'micl/components/slider';
26
+ import miclSlider from 'material-inspired-component-library/components/slider';
27
27
 
28
28
  miclSlider.initialize(document.querySelector('.micl-slider-m'));
29
29
  ```
30
30
 
31
+ ### Demo
32
+ A live example of the [Slider component](https://henkpb.github.io/micl/slider.html) is available for you to interact with.
33
+
31
34
  ## Variants
32
35
  Sliders come in **five different sizes**: extra small (`xs`), small (`s`), medium (`m`), large (`l`), and extra large (`xl`). To set a specific size, append the appropriate postfix to the `micl-slider` CSS class name:
33
36
 
@@ -25,6 +25,7 @@
25
25
  @mixin slider-track() {
26
26
  block-size: var(--md-sys-slider-track-height);
27
27
  border-radius: var(--md-sys-slider-track-radius);
28
+ background-color: inherit;
28
29
  background-image: linear-gradient(
29
30
  var(--md-sys-slider-track-direction),
30
31
  var(--md-sys-color-primary) calc(100% * (var(--md-sys-slider-value) - var(--md-sys-slider-min)) / (var(--md-sys-slider-max) - var(--md-sys-slider-min))),
@@ -48,13 +49,12 @@
48
49
  appearance: none;
49
50
  box-sizing: content-box;
50
51
  position: relative;
51
- inline-size: 4px;
52
+ inline-size: 16px;
52
53
  block-size: var(--md-sys-slider-handle-height);
53
54
  inset: 0;
54
- inset-block-start: calc(-1 * (var(--md-sys-slider-handle-height) + 2 * var(--md-sys-slider-thumb-space) - var(--md-sys-slider-track-height)) / 2);
55
- border: var(--md-sys-slider-thumb-space) solid currentColor;
56
- border-radius: 8px;
57
- background-color: var(--md-sys-color-primary);
55
+ inset-block-start: calc(-1 * (var(--md-sys-slider-handle-height) - var(--md-sys-slider-track-height)) / 2);
56
+ background-color: inherit;
57
+ background-image: linear-gradient(to right,transparent 0px,transparent var(--md-sys-slider-thumb-space), var(--md-sys-color-primary) var(--md-sys-slider-thumb-space),var(--md-sys-color-primary) 10px,transparent 10px, transparent 16px);
58
58
  cursor: pointer;
59
59
  z-index: 2;
60
60
  }
@@ -105,7 +105,7 @@ input[type=range].micl-slider-xl {
105
105
  margin: 0;
106
106
  outline: none;
107
107
  color: var(--md-sys-color-surface-container-low);
108
- background-color: transparent;
108
+ background-color: inherit;
109
109
  accent-color: var(--md-sys-color-primary);
110
110
 
111
111
  &::before {
@@ -145,6 +145,9 @@ input[type=range].micl-slider-xl {
145
145
  z-index: 3;
146
146
  transition: opacity var(--md-sys-motion-duration-long2) motion.$md-sys-motion-easing-emphasized-decelerate;
147
147
  }
148
+ &::-webkit-slider-container {
149
+ background-color: inherit;
150
+ }
148
151
  &::-webkit-slider-runnable-track {
149
152
  @include slider-track;
150
153
  }
@@ -195,12 +198,12 @@ input[type=range].micl-slider-xl {
195
198
  }
196
199
  &:not(:disabled):active {
197
200
  &::-webkit-slider-thumb {
198
- inline-size: 2px;
201
+ background-image: linear-gradient(to right,transparent 0px, transparent calc(var(--md-sys-slider-thumb-space) + 1px), var(--md-sys-color-primary) calc(var(--md-sys-slider-thumb-space) + 1px), var(--md-sys-color-primary) calc(var(--md-sys-slider-thumb-space) + 3px), transparent calc(var(--md-sys-slider-thumb-space) + 3px), transparent calc(2 * var(--md-sys-slider-thumb-space) + 4px));
199
202
  outline: none;
200
203
  cursor: grabbing;
201
204
  }
202
205
  &::-moz-range-thumb {
203
- inline-size: 2px;
206
+ background-image: linear-gradient(to right,transparent 0px, transparent calc(var(--md-sys-slider-thumb-space) + 1px), var(--md-sys-color-primary) calc(var(--md-sys-slider-thumb-space) + 1px), var(--md-sys-color-primary) calc(var(--md-sys-slider-thumb-space) + 3px), transparent calc(var(--md-sys-slider-thumb-space) + 3px), transparent calc(2 * var(--md-sys-slider-thumb-space) + 4px));
204
207
  outline: none;
205
208
  cursor: grabbing;
206
209
  }
@@ -15,12 +15,15 @@ To add a basic switch, use the `<input type="checkbox">` element with the `micl-
15
15
  Import the switch styles into your project:
16
16
 
17
17
  ```CSS
18
- @use "micl/components/switch";
18
+ @use "material-inspired-component-library/components/switch";
19
19
  ```
20
20
 
21
21
  ### TypeScript
22
22
  No custom TypeScript is required for the core functionality of this component.
23
23
 
24
+ ### Demo
25
+ A live example of the [Switch component](https://henkpb.github.io/micl/switch.html) is available for you to interact with.
26
+
24
27
  ## Variants
25
28
  By default, the component displays an icon on the switch handle in both the selected and unselected state. To remove the icon in the unselected state, assign an empty string to the following CSS variable:
26
29
 
@@ -17,7 +17,7 @@ A basic text field can be either `filled` or `outlined`. To create one, use the
17
17
  Import the text field styles into your project:
18
18
 
19
19
  ```CSS
20
- @use "micl/components/textfield";
20
+ @use "material-inspired-component-library/components/textfield";
21
21
  ```
22
22
 
23
23
  ### TypeScript
@@ -26,47 +26,83 @@ This component requires a TypeScript module for interactive features like the **
26
26
  To manually initialize the component and attach an event listener for the `input` event:
27
27
 
28
28
  ```TypeScript
29
- import miclTextField from 'micl/components/textfield';
29
+ import miclTextField from 'material-inspired-component-library/components/textfield';
30
30
 
31
31
  miclTextField.initialize(document.querySelector('.micl-textfield-filled'));
32
32
 
33
33
  document.querySelector('.micl-textfield-outlined').addEventListener('input', miclTextField.input);
34
34
  ```
35
35
 
36
+ ### Demo
37
+ A live example of the [Text field component](https://henkpb.github.io/micl/textfield.html) is available for you to interact with.
38
+
36
39
  ## Variants
37
40
  The following example shows a text field with every available feature. You can include any combination of these elements. The order of elements inside the `<div>` does not change the layout.
38
41
 
39
42
  ```HTML
40
43
  <div class="micl-textfield-filled">
41
- <span class="micl-textfield__icon-leading material-symbols-outlined" aria-hidden="true">search</span>
44
+ <span class="micl-textfield__icon-leading material-symbols-outlined">search</span>
42
45
  <label for="mytextfield">Label text</label>
43
- <span class="micl-textfield__prefix">$</span>
44
- <input type="text" id="mytextfield" maxlength="20">
45
- <span class="micl-textfield__suffix">kg</span>
46
- <span class="micl-textfield__icon-trailing material-symbols-outlined" aria-hidden="true">cancel</span>
47
- <span class="micl-textfield__supporting-text">Supporting text</span>
46
+ <span class="micl-textfield__prefix" aria-label="US dollars">$</span>
47
+ <input type="text" id="mytextfield" maxlength="20" aria-describedby="mysupport">
48
+ <span class="micl-textfield__suffix" aria-label="kilograms">kg</span>
49
+ <span class="micl-textfield__icon-trailing material-symbols-outlined">cancel</span>
50
+ <span id="mysupport" class="micl-textfield__supporting-text">Supporting text</span>
48
51
  <span class="micl-textfield__character-counter"></span>
49
52
  </div>
50
53
  ```
51
54
 
52
55
  The `<input>` element can have the following types: `text`, `date`, `datetime-local`, `email`, `month`, `number`, `password`, `tel`, `time`, `url` and `week`.
53
56
 
54
- Two icons may be included in the layout: a **leading icon** (an element containing the `micl-textfield__icon-leading` class), and a **trailing icon** (an element containing the `micl-textfield__icon-trailing` class).
57
+ Adding the `disabled` boolean attribute to the `<input>` element causes the text field to be displayed in a disabled state.
58
+
59
+ Adding the `micl-textfield--error` class to the text field displays it in an error state.
55
60
 
56
- A **prefix** (e.g., "$") and a **suffix** (e.g., "kg") can be included to provide additional context. You can customize the spacing by overriding CSS variables:
61
+ ### Leading Content
62
+ The data-input element can be preceded by various elements:
57
63
 
58
- ```HTML
59
- <span class="micl-textfield__prefix" style="--md-sys-textfield-prefix-space:20px">USD</span>
60
- <span class="micl-textfield__suffix" style="--md-sys-textfield-suffix-space:10em">@gmail.com</span>
61
- ```
64
+ - **Icon**: Use `micl-textfield__icon-leading` with a (Material Symbols) icon.
62
65
 
63
- Use an element with the `micl-textfield__supporting-text` class to add extra information about the text field.
66
+ - **Prefix**: A prefix (e.g., "$", "NOK") can be included to provide additional context. You can customize the spacing by overriding CSS variables:
67
+ ```HTML
68
+ <span class="micl-textfield__prefix" style="--md-sys-textfield-prefix-space:20px">USD</span>
69
+ ```
70
+
71
+ ### Trailing Content
72
+ The data-input element may be followed by a trailing text or other element:
73
+
74
+ - **Icon**: Use `micl-textfield__icon-trailing` with a (Material Symbols) icon.
75
+
76
+ - **Suffix**: A suffix (e.g., "kg", "@gmail.com") can be included to provide additional context. You can customize the spacing by overriding CSS variables:
77
+ ```HTML
78
+ <span class="micl-textfield__suffix" style="--md-sys-textfield-suffix-space:10em">@gmail.com</span>
79
+ ```
80
+
81
+ ### Supporting Content
82
+ Use an element with the `micl-textfield__supporting-text` class to add extra information about the text field. If you want this element only to be visible when the text field is focused, add the `micl-textfield__supporting-text--focus` as well.
64
83
 
65
84
  If the `<input>` element includes the `maxlength` attribute, the **character counter** will display automatically in the element with the `micl-textfield__character-counter` class.
66
85
 
67
- Adding the `disabled` boolean attribute to the `<input>` element causes the text field to be displayed in a disabled state.
86
+ ### Multi-line Text Field
87
+ Replace the `<input>` element with the `<textarea>` element to create a multi-line text field:
68
88
 
69
- Adding the `micl-textfield--error` class to the text field displays it in an error state.
89
+ ```HTML
90
+ <div class="micl-textfield-outlined">
91
+ <label for="mytextfield">Label text</label>
92
+ <textarea id="mytextfield"></textarea>
93
+ </div>
94
+ ```
95
+
96
+ Add a value to the `rows` attribute of the `<textarea>` element to create a text field of fixed height:
97
+
98
+ ```HTML
99
+ <div class="micl-textfield-outlined">
100
+ <label for="mytextfield">Label text</label>
101
+ <textarea id="mytextfield" rows="4"></textarea>
102
+ </div>
103
+ ```
70
104
 
71
105
  ## Compatibility
72
106
  This component uses relative RGB colors, which might not be supported in your browser. Please check [Browser compatibility](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#browser_compatibility) for details.
107
+
108
+ The multi-line text field variant uses the `field-sizing` CSS property, which might not be supported in your browser. Please check [Browser compatibility](https://developer.mozilla.org/en-US/docs/Web/CSS/field-sizing#browser_compatibility) for details.