material-inspired-component-library 2.0.1 → 3.0.1

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 (76) hide show
  1. package/README.md +14 -0
  2. package/components/README.md +2 -0
  3. package/components/appbar/README.md +94 -0
  4. package/components/appbar/index.scss +216 -0
  5. package/components/button/index.scss +70 -65
  6. package/components/button/index.ts +1 -1
  7. package/components/card/index.scss +1 -1
  8. package/components/checkbox/README.md +9 -0
  9. package/components/checkbox/index.scss +4 -0
  10. package/components/divider/index.scss +10 -10
  11. package/components/iconbutton/index.scss +111 -111
  12. package/components/iconbutton/index.ts +1 -1
  13. package/components/list/README.md +4 -4
  14. package/components/list/index.scss +3 -3
  15. package/components/navigationrail/README.md +11 -11
  16. package/components/navigationrail/index.scss +20 -12
  17. package/components/radio/README.md +13 -4
  18. package/components/radio/index.scss +7 -5
  19. package/components/select/README.md +28 -6
  20. package/components/select/index.scss +56 -10
  21. package/components/textfield/index.scss +3 -9
  22. package/components/textfield/index.ts +29 -22
  23. package/dist/appbar.css +1 -0
  24. package/dist/appbar.js +1 -0
  25. package/dist/bottomsheet.css +1 -1
  26. package/dist/button.css +1 -1
  27. package/dist/card.css +1 -1
  28. package/dist/checkbox.css +1 -1
  29. package/dist/components/textfield/index.d.ts +1 -1
  30. package/dist/dialog.css +1 -1
  31. package/dist/divider.css +1 -1
  32. package/dist/iconbutton.css +1 -1
  33. package/dist/layout.css +1 -0
  34. package/dist/layout.js +1 -0
  35. package/dist/list.css +1 -1
  36. package/dist/menu.css +1 -1
  37. package/dist/micl.css +1 -1
  38. package/dist/micl.js +1 -1
  39. package/dist/navigationrail.css +1 -1
  40. package/dist/radio.css +1 -1
  41. package/dist/select.css +1 -1
  42. package/dist/sidesheet.css +1 -1
  43. package/dist/slider.css +1 -1
  44. package/dist/switch.css +1 -1
  45. package/dist/textfield.css +1 -1
  46. package/docs/accordion.html +298 -254
  47. package/docs/bottomsheet.html +174 -145
  48. package/docs/button.html +210 -182
  49. package/docs/card.html +107 -72
  50. package/docs/checkbox.html +92 -69
  51. package/docs/dialog.html +154 -123
  52. package/docs/divider.html +96 -67
  53. package/docs/docs.css +14 -24
  54. package/docs/docs.js +4 -2
  55. package/docs/iconbutton.html +196 -171
  56. package/docs/index.html +296 -286
  57. package/docs/list.html +260 -216
  58. package/docs/menu.html +260 -220
  59. package/docs/micl.css +1 -1
  60. package/docs/micl.js +1 -1
  61. package/docs/navigationrail.html +36 -34
  62. package/docs/radio.html +93 -72
  63. package/docs/select.html +253 -173
  64. package/docs/sidesheet.html +104 -87
  65. package/docs/slider.html +105 -72
  66. package/docs/switch.html +126 -101
  67. package/docs/textfield.html +181 -138
  68. package/layout/README.md +122 -0
  69. package/layout/index.scss +259 -0
  70. package/micl.ts +1 -1
  71. package/package.json +4 -1
  72. package/styles/shapes.scss +0 -2
  73. package/styles/statelayer.scss +2 -0
  74. package/styles.scss +13 -0
  75. package/webpack.config.js +1 -1
  76. package/styles/layout.scss +0 -74
@@ -0,0 +1,259 @@
1
+ //
2
+ // Copyright © 2025 Hermana AS
3
+ //
4
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ // of this software and associated documentation files (the "Software"), to deal
6
+ // in the Software without restriction, including without limitation the rights
7
+ // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ // copies of the Software, and to permit persons to whom the Software is
9
+ // furnished to do so, subject to the following conditions:
10
+ //
11
+ // The above copyright notice and this permission notice shall be included in all
12
+ // copies or substantial portions of the Software.
13
+ //
14
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ // SOFTWARE.
21
+
22
+ @use '../styles/shapes';
23
+
24
+ $md-sys-window-compact-max: 599px;
25
+ $md-sys-window-medium-min: 600px;
26
+ $md-sys-window-medium-max: 839px;
27
+ $md-sys-window-expanded-min: 840px;
28
+ $md-sys-window-expanded-max: 1199px;
29
+ $md-sys-window-large-min: 1200px;
30
+ $md-sys-window-large-max: 1599px;
31
+ $md-sys-window-extralarge-min: 1600px;
32
+
33
+ $md-sys-window-margin-compact: 16px;
34
+ $md-sys-window-margin-medium: 24px;
35
+ $md-sys-window-margin-expanded: 24px;
36
+ $md-sys-window-margin-large: 24px;
37
+ $md-sys-window-margin-extralarge: 24px;
38
+
39
+ $md-sys-pane-spacer: 24px;
40
+
41
+ $md-sys-padding-xxs: 4px;
42
+ $md-sys-padding-xs: 8px;
43
+ $md-sys-padding-s: 12px;
44
+ $md-sys-padding-m: 16px;
45
+ $md-sys-padding-l: 20px;
46
+ $md-sys-padding-xl: 24px;
47
+ $md-sys-padding-xxl: 28px;
48
+
49
+ :root {
50
+ --md-sys-layout-pane-spacer: #{$md-sys-pane-spacer};
51
+
52
+ --md-sys-layout-padding-xxs: #{$md-sys-padding-xxs};
53
+ --md-sys-layout-padding-xs: #{$md-sys-padding-xs};
54
+ --md-sys-layout-padding-s: #{$md-sys-padding-s};
55
+ --md-sys-layout-padding-m: #{$md-sys-padding-m};
56
+ --md-sys-layout-padding-l: #{$md-sys-padding-l};
57
+ --md-sys-layout-padding-xl: #{$md-sys-padding-xl};
58
+ --md-sys-layout-padding-xxl: #{$md-sys-padding-xxl};
59
+
60
+ @media (max-width: $md-sys-window-compact-max) {
61
+ --md-sys-layout-window-margin: #{$md-sys-window-margin-compact};
62
+ }
63
+ @media (min-width: $md-sys-window-medium-min) and (max-width: $md-sys-window-medium-max) {
64
+ --md-sys-layout-window-margin: #{$md-sys-window-margin-medium};
65
+ }
66
+ @media (min-width: $md-sys-window-expanded-min) and (max-width: $md-sys-window-expanded-max) {
67
+ --md-sys-layout-window-margin: #{$md-sys-window-margin-expanded};
68
+ }
69
+ @media (min-width: $md-sys-window-large-min) and (max-width: $md-sys-window-large-max) {
70
+ --md-sys-layout-window-margin: #{$md-sys-window-margin-large};
71
+ }
72
+ @media (min-width: $md-sys-window-extralarge-min) {
73
+ --md-sys-layout-window-margin: #{$md-sys-window-margin-extralarge};
74
+ }
75
+ }
76
+
77
+ .micl-window {
78
+ padding: 0 var(--md-sys-layout-window-margin) var(--md-sys-layout-window-margin);
79
+ margin: 0;
80
+ background-color: var(--md-sys-color-surface);
81
+
82
+ .micl-body .micl-appbar {
83
+ margin-inline: calc(-1 * var(--md-sys-layout-window-margin));
84
+ }
85
+ &:not(.micl-window--spatial):has(nav.micl-navigationrail) .micl-body .micl-appbar {
86
+ margin-inline-start: 0;
87
+ }
88
+ &.micl-window--spatial {
89
+ --md-sys-layout-spatial-radius: calc(var(--md-sys-shape-corner-medium) + var(--md-sys-layout-window-margin));
90
+
91
+ display: flex;
92
+ padding-block: calc(2 * var(--md-sys-layout-window-margin));
93
+ gap: var(--md-sys-layout-window-margin);
94
+
95
+ .micl-navigationrail {
96
+ display: flex;
97
+ align-self: flex-start;
98
+ block-size: inherit;
99
+ min-block-size: inherit;
100
+ margin: 0;
101
+ padding-block-end: var(--md-sys-navigationrail-top-space, 0px);
102
+ border-radius: var(--md-sys-layout-spatial-radius);
103
+ }
104
+ .micl-body {
105
+ background: transparent;
106
+ }
107
+ .micl-pane {
108
+ padding: 0 var(--md-sys-layout-window-margin) var(--md-sys-layout-window-margin);
109
+ border-radius: var(--md-sys-layout-spatial-radius);
110
+ background-color: var(--md-sys-color-surface);
111
+ }
112
+ }
113
+ }
114
+ .micl-body {
115
+ display: flex;
116
+ flex-direction: row;
117
+ gap: var(--md-sys-card-margin, 0px) var(--md-sys-layout-pane-spacer);
118
+ background-color: inherit;
119
+
120
+ &.micl-body--split:has(> .micl-pane:nth-child(2)) {
121
+ .micl-pane {
122
+ flex-basis: 50%;
123
+ }
124
+ }
125
+ &.micl-body--evenly .micl-pane {
126
+ flex: 1 1 0;
127
+ }
128
+ }
129
+ .micl-pane {
130
+ display: flex;
131
+ flex-direction: column;
132
+ flex: 1 1 auto;
133
+ min-inline-size: 0;
134
+ background-color: inherit;
135
+
136
+ &.micl-pane--fixed {
137
+ flex: 0 0 auto;
138
+ }
139
+ &:has(> .micl-card-elevated, > .micl-card-filled, > .micl-card-outlined),
140
+ &> *:has(> .micl-card-elevated, > .micl-card-filled, > .micl-card-outlined) {
141
+ gap: var(--md-sys-card-margin, 0px);
142
+ }
143
+ &> .micl-pane__columns {
144
+ display: flex;
145
+
146
+ &:has(> .micl-pane__column > .micl-card-elevated, > .micl-pane__column > .micl-card-filled, > .micl-pane__column > .micl-card-outlined) {
147
+ gap: var(--md-sys-card-margin, 0px);
148
+ }
149
+ &> .micl-pane__column {
150
+ display: flex;
151
+ flex-direction: column;
152
+ flex: 1 1 auto;
153
+ min-inline-size: 0;
154
+ background-color: inherit;
155
+
156
+ &:has(> .micl-card-elevated, > .micl-card-filled, > .micl-card-outlined) {
157
+ row-gap: var(--md-sys-card-margin, 0px);
158
+ }
159
+ &.micl-pane__column--fixed {
160
+ flex: 0 0 auto;
161
+ }
162
+ }
163
+ &.micl-pane__columns--evenly > .micl-pane__column {
164
+ flex: 1 1 0;
165
+ }
166
+ }
167
+ }
168
+
169
+ @media (max-width: $md-sys-window-compact-max) {
170
+ .micl-body.micl-body--stacked-to-medium,
171
+ .micl-body.micl-body--stacked-to-expanded,
172
+ .micl-body.micl-body--stacked-to-large,
173
+ .micl-body.micl-body--stacked-to-extralarge {
174
+ flex-direction: column;
175
+ }
176
+ .micl-pane.micl-pane--hidden-to-medium,
177
+ .micl-pane.micl-pane--hidden-to-expanded,
178
+ .micl-pane.micl-pane--hidden-to-large,
179
+ .micl-pane.micl-pane--hidden-to-extralarge {
180
+ display: none;
181
+ }
182
+ .micl-pane__columns.micl-pane__columns--stacked-to-medium,
183
+ .micl-pane__columns.micl-pane__columns--stacked-to-expanded,
184
+ .micl-pane__columns.micl-pane__columns--stacked-to-large,
185
+ .micl-pane__columns.micl-pane__columns--stacked-to-extralarge {
186
+ flex-direction: column;
187
+ }
188
+ }
189
+ @media (min-width: $md-sys-window-medium-min) and (max-width: $md-sys-window-medium-max) {
190
+ .micl-body.micl-body--stacked-to-expanded,
191
+ .micl-body.micl-body--stacked-to-large,
192
+ .micl-body.micl-body--stacked-to-extralarge {
193
+ flex-direction: column;
194
+ }
195
+ .micl-pane.micl-pane--hidden-to-expanded,
196
+ .micl-pane.micl-pane--hidden-to-large,
197
+ .micl-pane.micl-pane--hidden-to-extralarge {
198
+ display: none;
199
+ }
200
+ .micl-pane__columns.micl-pane__columns--stacked-to-expanded,
201
+ .micl-pane__columns.micl-pane__columns--stacked-to-large,
202
+ .micl-pane__columns.micl-pane__columns--stacked-to-extralarge {
203
+ flex-direction: column;
204
+ }
205
+ }
206
+ @media (min-width: $md-sys-window-expanded-min) and (max-width: $md-sys-window-expanded-max) {
207
+ .micl-body.micl-body--stacked-to-large,
208
+ .micl-body.micl-body--stacked-to-extralarge {
209
+ flex-direction: column;
210
+ }
211
+ .micl-pane.micl-pane--hidden-to-large,
212
+ .micl-pane.micl-pane--hidden-to-extralarge {
213
+ display: none;
214
+ }
215
+ .micl-pane__columns.micl-pane__columns--stacked-to-large,
216
+ .micl-pane__columns.micl-pane__columns--stacked-to-extralarge {
217
+ flex-direction: column;
218
+ }
219
+ }
220
+ @media (min-width: $md-sys-window-large-min) and (max-width: $md-sys-window-large-max) {
221
+ .micl-body.micl-body--stacked-to-extralarge {
222
+ flex-direction: column;
223
+ }
224
+ .micl-pane.micl-pane--hidden-to-extralarge {
225
+ display: none;
226
+ }
227
+ .micl-pane__columns.micl-pane__columns--stacked-to-extralarge {
228
+ flex-direction: column;
229
+ }
230
+ }
231
+
232
+ .micl-flex--vcenter {
233
+ display: flex;
234
+ flex-direction: row;
235
+ align-items: center;
236
+ }
237
+
238
+ .micl-grid-iconfield {
239
+ box-sizing: border-box;
240
+ display: grid;
241
+ grid-template-columns: 48px 1fr;
242
+ margin-block: 24px;
243
+ row-gap: 24px;
244
+ background-color: inherit;
245
+ }
246
+ .micl-grid-iconfield__icon {
247
+ grid-column: 1;
248
+ margin-block-start: 0.6rem;
249
+ }
250
+ .micl-grid-iconfield__field {
251
+ grid-column: 2;
252
+ }
253
+
254
+ .micl-link {
255
+ display: flex;
256
+ align-items: center;
257
+ justify-content: center;
258
+ text-decoration: none;
259
+ }
package/micl.ts CHANGED
@@ -25,7 +25,7 @@ import _list, { listSelector } from './components/list';
25
25
  import _menu, { menuSelector } from './components/menu';
26
26
  import _navigationrail, { navigationrailSelector } from './components/navigationrail';
27
27
  import _slider, { sliderSelector } from './components/slider';
28
- import _textfield, { textfieldSelector, selectSelector, textareaSelector } from './components/textfield';
28
+ import _textfield, { textfieldSelector, textareaSelector, selectSelector } from './components/textfield';
29
29
 
30
30
  interface ComponentEntry<T extends HTMLElement> {
31
31
  component: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "material-inspired-component-library",
3
- "version": "2.0.1",
3
+ "version": "3.0.1",
4
4
  "description": "The Material-Inspired Component Library (MICL) offers a collection of beautifully crafted components leveraging native HTML markup, designed to align with the Material Design 3 guidelines.",
5
5
  "author": "MICL Hermana <micl.hermana@proton.me> (https://github.com/henkpb/micl)",
6
6
  "license": "MIT",
@@ -13,6 +13,7 @@
13
13
  "UX",
14
14
  "CSS",
15
15
  "accordion",
16
+ "app bar",
16
17
  "badge",
17
18
  "bottomsheet",
18
19
  "button",
@@ -21,10 +22,12 @@
21
22
  "dialog",
22
23
  "divider",
23
24
  "iconbutton",
25
+ "layout",
24
26
  "list",
25
27
  "menu",
26
28
  "navigation rail",
27
29
  "radio button",
30
+ "select",
28
31
  "sidesheet",
29
32
  "slider",
30
33
  "switch",
@@ -31,8 +31,6 @@ $md-sys-shape-corner-extra-extra-large: 48px;
31
31
  $md-sys-shape-corner-full: 50%;
32
32
 
33
33
  :root {
34
- --md-sys-target-size: 48px;
35
-
36
34
  --md-sys-shape-corner-none: #{$md-sys-shape-corner-none};
37
35
  --md-sys-shape-corner-extra-small: #{$md-sys-shape-corner-extra-small};
38
36
  --md-sys-shape-corner-small: #{$md-sys-shape-corner-small};
@@ -20,6 +20,7 @@
20
20
  // SOFTWARE.
21
21
 
22
22
  $md-sys-state-layer-size: 40px;
23
+ $md-sys-target-size: 48px;
23
24
 
24
25
  $md-sys-state-hover-state-layer-opacity: 8%;
25
26
  $md-sys-state-focus-state-layer-opacity: 10%;
@@ -32,6 +33,7 @@ $md-sys-state-focus-indicator-thickness: 3px;
32
33
 
33
34
  :root {
34
35
  --md-sys-state-layer-size: #{$md-sys-state-layer-size};
36
+ --md-sys-target-size: #{$md-sys-target-size};
35
37
 
36
38
  --md-sys-state-hover-state-layer-opacity: #{$md-sys-state-hover-state-layer-opacity};
37
39
  --md-sys-state-focus-state-layer-opacity: #{$md-sys-state-focus-state-layer-opacity};
package/styles.scss CHANGED
@@ -19,6 +19,8 @@
19
19
  // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
20
  // SOFTWARE.
21
21
 
22
+ @use 'layout';
23
+
22
24
  @use 'styles/typography';
23
25
  @use 'styles/shapes';
24
26
  @use 'styles/elevation';
@@ -39,6 +41,7 @@
39
41
  @use 'components/card';
40
42
  @use 'components/dialog';
41
43
  @use 'components/badge';
44
+ @use 'components/appbar';
42
45
  @use 'components/sidesheet';
43
46
  @use 'components/bottomsheet';
44
47
  @use 'components/navigationrail';
@@ -58,3 +61,13 @@
58
61
  inherits: false;
59
62
  initial-value: -100000px;
60
63
  }
64
+ @property --micl-width {
65
+ syntax: '<length>';
66
+ inherits: true;
67
+ initial-value: 0px;
68
+ }
69
+ @property --micl-height {
70
+ syntax: '<length>';
71
+ inherits: true;
72
+ initial-value: 0px;
73
+ }
package/webpack.config.js CHANGED
@@ -5,7 +5,7 @@ const miniCss = require('mini-css-extract-plugin');
5
5
  const distDir = path.resolve(__dirname, 'dist');
6
6
  const docsDir = path.resolve(__dirname, 'docs');
7
7
 
8
- const scssFiles = glob.sync('./components/**/*.scss');
8
+ const scssFiles = glob.sync('{./layout/*.scss,./components/**/*.scss}');
9
9
  const scssEntries = scssFiles.reduce((entries, filePath) => {
10
10
  const componentName = path.dirname(filePath).split('\\').pop();
11
11
  entries[componentName] = './' + filePath;
@@ -1,74 +0,0 @@
1
- //
2
- // Copyright © 2025 Hermana AS
3
- //
4
- // Permission is hereby granted, free of charge, to any person obtaining a copy
5
- // of this software and associated documentation files (the "Software"), to deal
6
- // in the Software without restriction, including without limitation the rights
7
- // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- // copies of the Software, and to permit persons to whom the Software is
9
- // furnished to do so, subject to the following conditions:
10
- //
11
- // The above copyright notice and this permission notice shall be included in all
12
- // copies or substantial portions of the Software.
13
- //
14
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
- // SOFTWARE.
21
-
22
- $md-sys-margin-compact: 0px;
23
- $md-sys-margin-medium: 0px;
24
- $md-sys-margin-expanded: 0px;
25
- $md-sys-margin-large: 0px;
26
- $md-sys-margin-extra-large: 0px;
27
-
28
- $md-sys-spacer: 24px;
29
-
30
- $md-sys-padding-xxs: 4px;
31
- $md-sys-padding-xs: 8px;
32
- $md-sys-padding-s: 12px;
33
- $md-sys-padding-m: 16px;
34
- $md-sys-padding-l: 20px;
35
- $md-sys-padding-xl: 24px;
36
- $md-sys-padding-xxl: 28px;
37
-
38
- $md-sys-target-size: 48px;
39
-
40
- :root {
41
- --md-sys-margin-compact: $md-sys-margin-compact;
42
- --md-sys-margin-medium: $md-sys-margin-medium;
43
- --md-sys-margin-expanded: $md-sys-margin-expanded;
44
- --md-sys-margin-large: $md-sys-margin-large;
45
- --md-sys-margin-extra-large: $md-sys-margin-extra-large;
46
-
47
- --md-sys-spacer: $md-sys-spacer;
48
-
49
- --md-sys-padding-xxs: $md-sys-padding-xxs;
50
- --md-sys-padding-xs: $md-sys-padding-xs;
51
- --md-sys-padding-s: $md-sys-padding-s;
52
- --md-sys-padding-m: $md-sys-padding-m;
53
- --md-sys-padding-l: $md-sys-padding-l;
54
- --md-sys-padding-xl: $md-sys-padding-xl;
55
- --md-sys-padding-xxl: $md-sys-padding-xxl;
56
-
57
- --md-sys-target-size: $md-sys-target-size;
58
- }
59
-
60
- .micl-pane-fixed {
61
- display: flex;
62
- flex: 0 0 auto;
63
- flex-direction: row;
64
- }
65
-
66
- .micl-pane-flexible {
67
- display: flex;
68
- flex: 1 1 auto;
69
- flex-direction: row;
70
- }
71
-
72
- .micl-pane__column {
73
- display: flex;
74
- }