material-inspired-component-library 8.1.0 → 9.0.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 (284) hide show
  1. package/README.md +106 -18
  2. package/components/README.md +1 -1
  3. package/components/accordion/README.md +6 -6
  4. package/components/alert/README.md +10 -10
  5. package/components/alert/index.scss +27 -52
  6. package/components/appbar/README.md +19 -6
  7. package/components/appbar/index.scss +40 -44
  8. package/components/badge/README.md +12 -10
  9. package/components/badge/index.scss +21 -25
  10. package/components/bottomsheet/README.md +26 -1
  11. package/components/bottomsheet/index.scss +58 -44
  12. package/components/button/README.md +70 -10
  13. package/components/button/_shared.scss +210 -0
  14. package/components/button/index.scss +75 -389
  15. package/components/card/README.md +97 -85
  16. package/components/card/index.scss +46 -65
  17. package/components/checkbox/README.md +25 -14
  18. package/{tools/shapes/check.mjs → components/checkbox/_label.scss} +37 -42
  19. package/components/checkbox/index.scss +66 -66
  20. package/components/chip/README.md +186 -0
  21. package/components/chip/index.scss +285 -0
  22. package/components/datepicker/README.md +79 -0
  23. package/components/datepicker/index.scss +346 -315
  24. package/components/dialog/README.md +20 -10
  25. package/components/dialog/index.scss +55 -66
  26. package/components/divider/README.md +16 -15
  27. package/components/divider/index.scss +9 -25
  28. package/components/iconbutton/README.md +63 -12
  29. package/components/iconbutton/index.scss +142 -303
  30. package/components/list/README.md +89 -156
  31. package/components/list/index.scss +34 -36
  32. package/components/menu/README.md +81 -155
  33. package/components/menu/index.scss +52 -58
  34. package/components/navigationbar/README.md +108 -0
  35. package/components/navigationbar/index.scss +185 -0
  36. package/components/navigationrail/README.md +62 -37
  37. package/components/navigationrail/_navitem.scss +96 -0
  38. package/components/navigationrail/index.scss +78 -132
  39. package/components/progressindicator/README.md +83 -47
  40. package/components/progressindicator/index.scss +622 -172
  41. package/components/radio/README.md +11 -9
  42. package/components/radio/index.scss +36 -33
  43. package/components/select/README.md +12 -7
  44. package/components/select/index.scss +26 -34
  45. package/components/shapes/README.md +3 -3
  46. package/components/shapes/index.scss +0 -1
  47. package/components/sidesheet/README.md +21 -9
  48. package/components/sidesheet/index.scss +38 -46
  49. package/components/slider/README.md +21 -0
  50. package/components/slider/index.scss +108 -139
  51. package/components/snackbar/README.md +32 -35
  52. package/components/snackbar/index.scss +10 -22
  53. package/components/stepper/README.md +14 -7
  54. package/components/stepper/index.scss +58 -39
  55. package/components/switch/README.md +22 -15
  56. package/components/switch/index.scss +68 -60
  57. package/components/textfield/README.md +48 -5
  58. package/components/textfield/index.scss +192 -248
  59. package/components/timepicker/README.md +53 -23
  60. package/components/timepicker/index.scss +110 -128
  61. package/dist/alert.css +1 -1
  62. package/dist/alert.js +1 -1
  63. package/dist/appbar.css +1 -1
  64. package/dist/appbar.js +1 -1
  65. package/dist/badge.css +1 -1
  66. package/dist/badge.js +1 -1
  67. package/dist/base.css +1 -0
  68. package/dist/base.js +1 -0
  69. package/dist/bottomsheet.css +1 -1
  70. package/dist/bottomsheet.js +1 -1
  71. package/dist/button.css +1 -1
  72. package/dist/button.js +1 -1
  73. package/dist/card.css +1 -1
  74. package/dist/card.js +1 -1
  75. package/dist/checkbox.css +1 -1
  76. package/dist/checkbox.js +1 -1
  77. package/dist/chip.css +1 -0
  78. package/dist/chip.js +1 -0
  79. package/dist/components/button/index.d.ts +1 -1
  80. package/dist/components/iconbutton/index.d.ts +2 -7
  81. package/dist/components/slider/index.d.ts +1 -1
  82. package/dist/components/textfield/index.d.ts +2 -2
  83. package/dist/datepicker.css +1 -1
  84. package/dist/datepicker.js +1 -1
  85. package/dist/dialog.css +1 -1
  86. package/dist/dialog.js +1 -1
  87. package/dist/divider.css +1 -1
  88. package/dist/divider.js +1 -1
  89. package/dist/field.css +1 -0
  90. package/dist/field.js +1 -0
  91. package/dist/foundations/form/index.js +1 -1
  92. package/dist/foundations/runtime.d.ts +15 -0
  93. package/dist/foundations/runtime.js +1 -0
  94. package/dist/iconbutton.css +1 -1
  95. package/dist/iconbutton.js +1 -1
  96. package/dist/layout.css +1 -1
  97. package/dist/layout.js +1 -1
  98. package/dist/list.css +1 -1
  99. package/dist/list.js +1 -1
  100. package/dist/menu.css +1 -1
  101. package/dist/menu.js +1 -1
  102. package/dist/micl.css +1 -1
  103. package/dist/micl.d.ts +14 -5
  104. package/dist/micl.js +1 -1
  105. package/dist/navigationbar.css +1 -0
  106. package/dist/navigationbar.js +1 -0
  107. package/dist/navigationrail.css +1 -1
  108. package/dist/navigationrail.js +1 -1
  109. package/dist/progressindicator.css +1 -1
  110. package/dist/progressindicator.js +1 -1
  111. package/dist/radio.css +1 -1
  112. package/dist/radio.js +1 -1
  113. package/dist/scrollbar.js +1 -1
  114. package/dist/select.css +1 -1
  115. package/dist/select.js +1 -1
  116. package/dist/shapes.css +1 -1
  117. package/dist/shapes.js +1 -1
  118. package/dist/sidesheet.css +1 -1
  119. package/dist/sidesheet.js +1 -1
  120. package/dist/slider.css +1 -1
  121. package/dist/slider.js +1 -1
  122. package/dist/snackbar.css +1 -1
  123. package/dist/snackbar.js +1 -1
  124. package/dist/stepper.css +1 -1
  125. package/dist/stepper.js +1 -1
  126. package/dist/switch.css +1 -1
  127. package/dist/switch.js +1 -1
  128. package/dist/textfield.css +1 -1
  129. package/dist/textfield.js +1 -1
  130. package/dist/timepicker.css +1 -1
  131. package/dist/timepicker.js +1 -1
  132. package/foundations/_index.scss +35 -0
  133. package/foundations/{index.scss → base/index.scss} +21 -56
  134. package/foundations/field/index.scss +37 -0
  135. package/foundations/layout/index.scss +64 -65
  136. package/package.json +23 -9
  137. package/styles/statelayer.scss +20 -5
  138. package/styles.scss +5 -2
  139. package/.claude/settings.local.json +0 -14
  140. package/.editorconfig +0 -12
  141. package/.gitattributes +0 -9
  142. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -35
  143. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
  144. package/CLAUDE.md +0 -53
  145. package/CODE_OF_CONDUCT.md +0 -128
  146. package/components/bottomsheet/index.ts +0 -153
  147. package/components/button/index.ts +0 -79
  148. package/components/checkbox/index.ts +0 -148
  149. package/components/datepicker/index.ts +0 -693
  150. package/components/iconbutton/index.ts +0 -77
  151. package/components/list/index.ts +0 -138
  152. package/components/menu/index.ts +0 -145
  153. package/components/navigationrail/index.ts +0 -87
  154. package/components/progressindicator/index.ts +0 -77
  155. package/components/slider/index.ts +0 -149
  156. package/components/snackbar/index.ts +0 -118
  157. package/components/stepper/index.ts +0 -248
  158. package/components/textfield/index.ts +0 -188
  159. package/components/timepicker/index.ts +0 -413
  160. package/dist/components/progressindicator/index.d.ts +0 -6
  161. package/dist/foundations.css +0 -1
  162. package/dist/foundations.js +0 -1
  163. package/docs/accordion.html +0 -344
  164. package/docs/alert.html +0 -177
  165. package/docs/bottomsheet.html +0 -240
  166. package/docs/button.html +0 -290
  167. package/docs/card-awards.webp +0 -0
  168. package/docs/card-cabinet.webp +0 -0
  169. package/docs/card-city.webp +0 -0
  170. package/docs/card-fingerprint.webp +0 -0
  171. package/docs/card-holiday.webp +0 -0
  172. package/docs/card-names.webp +0 -0
  173. package/docs/card.html +0 -159
  174. package/docs/checkbox.html +0 -147
  175. package/docs/datepicker.html +0 -274
  176. package/docs/dialog.html +0 -195
  177. package/docs/divider.html +0 -139
  178. package/docs/docs.css +0 -26
  179. package/docs/docs.js +0 -139
  180. package/docs/iconbutton.html +0 -329
  181. package/docs/index.html +0 -431
  182. package/docs/list.html +0 -310
  183. package/docs/menu.html +0 -574
  184. package/docs/micl.css +0 -1
  185. package/docs/micl.js +0 -1
  186. package/docs/navigationrail.html +0 -138
  187. package/docs/progressindicator.html +0 -288
  188. package/docs/radio.html +0 -123
  189. package/docs/select.html +0 -337
  190. package/docs/shapes.css +0 -1
  191. package/docs/shapes.html +0 -159
  192. package/docs/shapes.js +0 -1
  193. package/docs/sidesheet.html +0 -149
  194. package/docs/slider.html +0 -141
  195. package/docs/snackbar.html +0 -102
  196. package/docs/stepper.html +0 -319
  197. package/docs/switch.html +0 -196
  198. package/docs/textfield.html +0 -208
  199. package/docs/themes/airblue/dark-hc.css +0 -51
  200. package/docs/themes/airblue/dark-mc.css +0 -51
  201. package/docs/themes/airblue/dark.css +0 -51
  202. package/docs/themes/airblue/light-hc.css +0 -51
  203. package/docs/themes/airblue/light-mc.css +0 -51
  204. package/docs/themes/airblue/light.css +0 -51
  205. package/docs/themes/airblue/theme.css +0 -306
  206. package/docs/themes/barnred/dark-hc.css +0 -51
  207. package/docs/themes/barnred/dark-mc.css +0 -51
  208. package/docs/themes/barnred/dark.css +0 -51
  209. package/docs/themes/barnred/light-hc.css +0 -51
  210. package/docs/themes/barnred/light-mc.css +0 -51
  211. package/docs/themes/barnred/light.css +0 -51
  212. package/docs/themes/barnred/theme.css +0 -306
  213. package/docs/themes/citrine/dark-hc.css +0 -51
  214. package/docs/themes/citrine/dark-mc.css +0 -51
  215. package/docs/themes/citrine/dark.css +0 -51
  216. package/docs/themes/citrine/light-hc.css +0 -51
  217. package/docs/themes/citrine/light-mc.css +0 -51
  218. package/docs/themes/citrine/light.css +0 -51
  219. package/docs/themes/citrine/theme.css +0 -306
  220. package/docs/themes/gray/dark-hc.css +0 -51
  221. package/docs/themes/gray/dark-mc.css +0 -51
  222. package/docs/themes/gray/dark.css +0 -51
  223. package/docs/themes/gray/light-hc.css +0 -51
  224. package/docs/themes/gray/light-mc.css +0 -51
  225. package/docs/themes/gray/light.css +0 -51
  226. package/docs/themes/gray/theme.css +0 -306
  227. package/docs/themes/greenery/dark-hc.css +0 -51
  228. package/docs/themes/greenery/dark-mc.css +0 -51
  229. package/docs/themes/greenery/dark.css +0 -51
  230. package/docs/themes/greenery/light-hc.css +0 -51
  231. package/docs/themes/greenery/light-mc.css +0 -51
  232. package/docs/themes/greenery/light.css +0 -51
  233. package/docs/themes/greenery/theme.css +0 -306
  234. package/docs/themes/hermana/dark-hc.css +0 -51
  235. package/docs/themes/hermana/dark-mc.css +0 -51
  236. package/docs/themes/hermana/dark.css +0 -51
  237. package/docs/themes/hermana/light-hc.css +0 -51
  238. package/docs/themes/hermana/light-mc.css +0 -51
  239. package/docs/themes/hermana/light.css +0 -51
  240. package/docs/themes/hermana/theme.css +0 -306
  241. package/docs/themes/illuminating/dark-hc.css +0 -51
  242. package/docs/themes/illuminating/dark-mc.css +0 -51
  243. package/docs/themes/illuminating/dark.css +0 -51
  244. package/docs/themes/illuminating/light-hc.css +0 -51
  245. package/docs/themes/illuminating/light-mc.css +0 -51
  246. package/docs/themes/illuminating/light.css +0 -51
  247. package/docs/themes/illuminating/theme.css +0 -306
  248. package/docs/themes/magenta/dark-hc.css +0 -51
  249. package/docs/themes/magenta/dark-mc.css +0 -51
  250. package/docs/themes/magenta/dark.css +0 -51
  251. package/docs/themes/magenta/light-hc.css +0 -51
  252. package/docs/themes/magenta/light-mc.css +0 -51
  253. package/docs/themes/magenta/light.css +0 -51
  254. package/docs/themes/magenta/theme.css +0 -306
  255. package/docs/themes/mocha/dark-hc.css +0 -51
  256. package/docs/themes/mocha/dark-mc.css +0 -51
  257. package/docs/themes/mocha/dark.css +0 -51
  258. package/docs/themes/mocha/light-hc.css +0 -51
  259. package/docs/themes/mocha/light-mc.css +0 -51
  260. package/docs/themes/mocha/light.css +0 -51
  261. package/docs/themes/mocha/theme.css +0 -306
  262. package/docs/themes/olivegreen/dark-hc.css +0 -51
  263. package/docs/themes/olivegreen/dark-mc.css +0 -51
  264. package/docs/themes/olivegreen/dark.css +0 -51
  265. package/docs/themes/olivegreen/light-hc.css +0 -51
  266. package/docs/themes/olivegreen/light-mc.css +0 -51
  267. package/docs/themes/olivegreen/light.css +0 -51
  268. package/docs/themes/olivegreen/theme.css +0 -306
  269. package/docs/themes/peri/dark-hc.css +0 -51
  270. package/docs/themes/peri/dark-mc.css +0 -51
  271. package/docs/themes/peri/dark.css +0 -51
  272. package/docs/themes/peri/light-hc.css +0 -51
  273. package/docs/themes/peri/light-mc.css +0 -51
  274. package/docs/themes/peri/light.css +0 -51
  275. package/docs/themes/peri/theme.css +0 -306
  276. package/docs/timepicker.html +0 -160
  277. package/foundations/form/index.ts +0 -174
  278. package/foundations/layout/README.md +0 -127
  279. package/intl.d.ts +0 -9
  280. package/micl.ts +0 -221
  281. package/styles/README.md +0 -196
  282. package/tools/shapes/generate.mjs +0 -828
  283. package/tsconfig.json +0 -116
  284. package/webpack.config.js +0 -104
@@ -0,0 +1,185 @@
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 '../../foundations/layout';
23
+ @use '../../styles/elevation';
24
+ @use '../../styles/statelayer';
25
+ @use '../navigationrail/navitem';
26
+
27
+ @include elevation.level(0);
28
+ @include elevation.level(2);
29
+
30
+ @include statelayer.token('hover-state-layer-opacity');
31
+ @include statelayer.token('focus-state-layer-opacity');
32
+ @include statelayer.token('pressed-state-layer-opacity');
33
+ @include statelayer.token('ripple-opacity-factor');
34
+ @include statelayer.token('ripple-duration');
35
+ @include statelayer.property;
36
+ @include statelayer.keyframes;
37
+
38
+ nav.micl-navigationbar {
39
+ box-sizing: border-box;
40
+ position: fixed;
41
+ inset-block: auto 0;
42
+ inset-inline: 0;
43
+ padding-block-end: env(safe-area-inset-bottom);
44
+ background-color: var(--md-comp-nav-bar-container-color, var(--md-sys-color-surface-container));
45
+ box-shadow: var(--md-comp-nav-bar-container-elevation, var(--md-sys-elevation-level2));
46
+ border-radius: var(--md-comp-nav-bar-container-shape, 0px);
47
+ z-index: 9;
48
+
49
+ &> .micl-navigationbar__content {
50
+ box-sizing: border-box;
51
+ display: flex;
52
+ align-items: flex-start;
53
+ justify-content: space-evenly;
54
+ block-size: var(--md-comp-nav-bar-container-height, 64px);
55
+ padding-block-start: 6px;
56
+
57
+ &> a.micl-navigationbar__item {
58
+ @extend %micl-navitem;
59
+
60
+ flex-direction: column;
61
+ inline-size: var(--md-comp-nav-bar-item-vertical-active-indicator-width, 56px);
62
+ block-size: var(--md-comp-nav-bar-item-vertical-active-indicator-height, 32px);
63
+ border-radius: var(--md-comp-nav-bar-item-active-indicator-shape, calc(var(--md-comp-nav-bar-item-vertical-active-indicator-height, 32px) / 2));
64
+
65
+ .micl-navigationbar__icon {
66
+ @extend %micl-navitem-icon;
67
+ font-size: var(--md-comp-nav-bar-item-icon-size, var(--md-sys-icon-size));
68
+ inline-size: var(--md-comp-nav-bar-item-icon-size, var(--md-sys-icon-size));
69
+ padding-inline: 16px;
70
+ }
71
+ .micl-navigationbar__text {
72
+ @extend %micl-navitem-text;
73
+ margin-block-start: var(--md-comp-nav-bar-item-active-indicator-icon-label-space, 4px);
74
+ white-space: nowrap;
75
+ text-overflow: ellipsis;
76
+ }
77
+ }
78
+
79
+ &> a.micl-navigationbar__item[aria-current="page"] {
80
+ @extend %micl-navitem-current;
81
+
82
+ .micl-navigationbar__icon {
83
+ @extend %micl-navitem-current-icon;
84
+ }
85
+ .micl-navigationbar__text {
86
+ @extend %micl-navitem-current-text;
87
+ }
88
+ }
89
+ }
90
+
91
+ // Tall bar (80px): the item stack is vertically centered
92
+ &.micl-navigationbar--tall > .micl-navigationbar__content {
93
+ block-size: var(--md-comp-nav-bar-tall-container-height, 80px);
94
+ padding-block-start: 14px;
95
+ }
96
+
97
+ // Horizontal items: icon and label side by side in a 40px pill
98
+ &.micl-navigationbar--horizontal > .micl-navigationbar__content {
99
+ align-items: center;
100
+ padding-block-start: 0;
101
+
102
+ &> a.micl-navigationbar__item {
103
+ flex-direction: row;
104
+ inline-size: fit-content;
105
+ max-inline-size: 100%;
106
+ block-size: var(--md-comp-nav-bar-item-horizontal-active-indicator-height, 40px);
107
+ border-radius: var(--md-comp-nav-bar-item-active-indicator-shape, calc(var(--md-comp-nav-bar-item-horizontal-active-indicator-height, 40px) / 2));
108
+
109
+ .micl-navigationbar__icon {
110
+ padding-inline:
111
+ var(--md-comp-nav-bar-item-horizontal-active-indicator-leading-space, 16px)
112
+ var(--md-comp-nav-bar-item-active-indicator-icon-label-space, 4px);
113
+ }
114
+ .micl-navigationbar__text {
115
+ margin-block-start: 0;
116
+ padding-inline-end: var(--md-comp-nav-bar-item-horizontal-active-indicator-trailing-space, 16px);
117
+ }
118
+ }
119
+ }
120
+ }
121
+
122
+ // Reserve space at the bottom of the page for the fixed navigation bar
123
+ // (higher specificity than the padding shorthand of body.micl-window)
124
+ body:has(nav.micl-navigationbar) {
125
+ padding-block-end: calc(var(--md-comp-nav-bar-container-height, 64px) + env(safe-area-inset-bottom));
126
+ }
127
+ body:has(nav.micl-navigationbar--tall) {
128
+ padding-block-end: calc(var(--md-comp-nav-bar-tall-container-height, 80px) + env(safe-area-inset-bottom));
129
+ }
130
+
131
+ // Adaptive navigation: a navigation bar below the named breakpoint and a
132
+ // collapsed navigation rail (using the nav-rail tokens) at the breakpoint
133
+ // and above. The item anatomy is shared, so only the container changes.
134
+ $_breakpoints: (
135
+ medium: layout.$md-sys-breakpoint-medium-min,
136
+ expanded: layout.$md-sys-breakpoint-expanded-min,
137
+ );
138
+
139
+ @each $name, $min in $_breakpoints {
140
+ @media (min-width: $min) {
141
+ nav.micl-navigationbar--bar-to-#{$name} {
142
+ display: flex;
143
+ flex-direction: column;
144
+ position: sticky;
145
+ float: inline-start;
146
+ inset: unset;
147
+ inset-block-start: 0;
148
+ inline-size: var(--md-comp-nav-rail-collapsed-container-width, 96px);
149
+ block-size: 100vh;
150
+ min-block-size: 100%;
151
+ margin-inline: calc(-1 * var(--md-sys-layout-window-margin, 0px)) auto;
152
+ padding-block: var(--md-comp-nav-rail-collapsed-top-space, 44px) 0;
153
+ background-color: var(--md-comp-nav-rail-collapsed-container-color, var(--md-sys-color-surface));
154
+ box-shadow: var(--md-comp-nav-rail-collapsed-container-elevation, var(--md-sys-elevation-level0));
155
+ border-radius: var(--md-comp-nav-rail-collapsed-container-shape, 0px);
156
+ border-inline-end: var(--md-comp-nav-rail-divider-thickness, 0px) solid var(--md-comp-nav-rail-divider-color, var(--md-comp-divider-color));
157
+ overflow: hidden;
158
+
159
+ &> .micl-navigationbar__content {
160
+ flex: 1 1 auto;
161
+ flex-direction: column;
162
+ justify-content: flex-start;
163
+ inline-size: 100%;
164
+ block-size: auto;
165
+ row-gap: var(--md-comp-nav-rail-item-container-vertical-space, 6px);
166
+ padding-block: var(--md-comp-nav-rail-item-header-space-minimum, 40px) 16px;
167
+ padding-inline: 20px;
168
+ overflow: hidden auto;
169
+
170
+ &> a.micl-navigationbar__item {
171
+ margin-block-end: 40px;
172
+ row-gap: var(--md-comp-nav-rail-collapsed-item-vertical-space, 4px);
173
+ }
174
+ }
175
+ }
176
+
177
+ // in rail mode the bottom of the page no longer needs to be reserved
178
+ body.micl-window:has(nav.micl-navigationbar--bar-to-#{$name}) {
179
+ padding-block-end: var(--md-sys-layout-window-margin, 0px);
180
+ }
181
+ body:not(.micl-window):has(nav.micl-navigationbar--bar-to-#{$name}) {
182
+ padding-block-end: 0;
183
+ }
184
+ }
185
+ }
@@ -25,6 +25,7 @@ To create a simple navigation rail, use a `<nav>` element with the `micl-navigat
25
25
  Import the navigation rail styles into your project:
26
26
 
27
27
  ```CSS
28
+ @use "material-inspired-component-library/dist/iconbutton";
28
29
  @use "material-inspired-component-library/dist/navigationrail";
29
30
  ```
30
31
 
@@ -53,6 +54,7 @@ The basic example creates a **collapsed** navigation rail. Add a menu button to
53
54
  type="button"
54
55
  id="mybutton"
55
56
  class="micl-iconbutton-standard-s micl-button--toggle material-symbols-outlined"
57
+ aria-pressed="false"
56
58
  command="--micl-toggle"
57
59
  commandfor="mybutton"
58
60
  data-miclicon="menu"
@@ -66,7 +68,7 @@ The basic example creates a **collapsed** navigation rail. Add a menu button to
66
68
  </nav>
67
69
  ```
68
70
 
69
- When the user clicks the menu button, the navigation rail is expanded and the toggle button is given the `micl-button--selected` class and the `micl-button--toggled` class that indicates that the toggle button has been clicked at least once.
71
+ When the user clicks the menu button, the navigation rail is expanded and the toggle button is given `aria-pressed="true"` and the `micl-button--toggled` class that indicates that the toggle button has been clicked at least once.
70
72
 
71
73
  ### Modal navigation rail
72
74
 
@@ -100,47 +102,70 @@ A **modal** navigation rail is hidden until the user clicks a menu button. When
100
102
 
101
103
  The button inside the navigation rail is used to hide the navigation rail, while the button outside is responsible for opening it.
102
104
 
103
- ## Customizations
104
- You can customize the appearance of the Navigation rail component by overriding its global CSS variables. These variables are declared on the `:root` pseudo-class and can be changed on any appropriate parent element to affect its child navigation rails.
105
+ ### Adaptive navigation rail
105
106
 
106
- | Variable name | Default Value | Description |
107
- | ------------- | ------------- | ----------- |
108
- | --md-comp-nav-rail-divider-thickness | 0px | The width of the vertical divider at the end of the rail |
109
- | --md-comp-nav-rail-divider-color | | The color of the vertical divider |
107
+ An **adaptive** navigation rail is permanently visible as a standard (expanded) navigation rail on wide screens, and acts as a modal navigation rail on narrow screens. Add one of the following modifier classes to a modal navigation rail:
110
108
 
111
- The Navigation rail component supports the following CSS variables, as defined in the [Material Design 3 Expressive Navigation rail Specification](https://m3.material.io/components/navigation-rail/specs):
109
+ | Class | Modal below | Standard from |
110
+ | ----- | ----------- | ------------- |
111
+ | `micl-navigationrail--modal-to-medium` | `600px` | `600px` |
112
+ | `micl-navigationrail--modal-to-expanded` | `840px` | `840px` |
113
+ | `micl-navigationrail--modal-to-large` | `1200px` | `1200px` |
114
+ | `micl-navigationrail--modal-to-extralarge` | `1600px` | `1600px` |
115
+
116
+ ```HTML
117
+ <dialog id="mynavigationrail" class="micl-navigationrail micl-navigationrail--modal-to-expanded" closedby="closerequest">
118
+ ...
119
+ </dialog>
120
+ ```
121
+
122
+ Place the `<dialog>` element where a standard `<nav>` navigation rail would go, so that it occupies its usual position when the wide-screen layout applies. The open and close buttons only serve the modal behaviour, so hide them on wide screens, for example:
112
123
 
113
124
  ```CSS
114
- --md-comp-nav-rail-item-icon-size
115
- --md-comp-nav-rail-item-active-indicator-leading-space
116
- --md-comp-nav-rail-item-active-indicator-icon-label-space
117
- --md-comp-nav-rail-item-active-indicator-trailing-space
118
- --md-comp-nav-rail-item-container-height
119
- --md-comp-nav-rail-item-short-container-height
120
- --md-comp-nav-rail-item-container-shape
121
- --md-comp-nav-rail-item-container-vertical-space
122
- --md-comp-nav-rail-item-header-space-minimum
123
- --md-comp-nav-rail-collapsed-container-width
124
- --md-comp-nav-rail-collapsed-narrow-container-width
125
- --md-comp-nav-rail-collapsed-container-elevation
126
- --md-comp-nav-rail-collapsed-container-shape
127
- --md-comp-nav-rail-collapsed-container-color
128
- --md-comp-nav-rail-collapsed-item-vertical-space
129
- --md-comp-nav-rail-collapsed-top-space
130
- --md-comp-nav-rail-expanded-container-width-minimum
131
- --md-comp-nav-rail-expanded-container-width-maximum
132
- --md-comp-nav-rail-expanded-top-space
133
- --md-comp-nav-rail-expanded-container-elevation
134
- --md-comp-nav-rail-expanded-modal-container-elevation
135
- --md-comp-nav-rail-expanded-container-color
136
- --md-comp-nav-rail-expanded-modal-container-color
137
- --md-comp-nav-rail-expanded-container-shape
138
- --md-comp-nav-rail-expanded-modal-container-shape
139
- --md-comp-nav-rail-item-vertical-active-indicator-height
140
- --md-comp-nav-rail-item-vertical-active-indicator-width
141
- --md-comp-nav-rail-item-horizontal-full-width-leading-space
125
+ @media (min-width: 840px) {
126
+ [commandfor="mynavigationrail"] {
127
+ display: none;
128
+ }
129
+ }
142
130
  ```
143
131
 
132
+ > [!NOTE]
133
+ > If the modal navigation rail is open while the window is resized across the breakpoint, it remains modal until dismissed, after which it becomes the permanently visible standard rail.
134
+
135
+ ## Theming
136
+ Each navigation rail can be themed with CSS custom properties that follow the Material Design 3 component-token naming convention.
137
+
138
+ | Custom property | Meaning | Default |
139
+ |---|---|---|
140
+ | `--md-comp-nav-rail-divider-thickness` | The width of the vertical divider at the end of the rail | `0px` |
141
+ | `--md-comp-nav-rail-divider-color` | The color of the vertical divider | `--md-comp-divider-color` |
142
+ | `--md-comp-nav-rail-collapsed-container-width` | The width of the collapsed navigation rail | `96px` |
143
+ | `--md-comp-nav-rail-collapsed-container-color` | The background color of the collapsed navigation rail | `--md-sys-color-surface` |
144
+ | `--md-comp-nav-rail-collapsed-container-elevation` | The shadow (elevation) of the collapsed navigation rail | `--md-sys-elevation-level0` |
145
+ | `--md-comp-nav-rail-collapsed-container-shape` | The corner rounding of the collapsed navigation rail | `0px` |
146
+ | `--md-comp-nav-rail-collapsed-top-space` | The space between the top edge and the header of the collapsed navigation rail | `44px` |
147
+ | `--md-comp-nav-rail-collapsed-item-vertical-space` | The space between the icon and the label of a collapsed item | `4px` |
148
+ | `--md-comp-nav-rail-expanded-container-width-minimum` | The smallest allowed width of the expanded navigation rail | `220px` |
149
+ | `--md-comp-nav-rail-expanded-container-width-maximum` | The largest allowed width of the expanded navigation rail | `360px` |
150
+ | `--md-comp-nav-rail-expanded-container-color` | The background color of the expanded navigation rail | `--md-sys-color-surface` |
151
+ | `--md-comp-nav-rail-expanded-container-elevation` | The shadow (elevation) of the expanded navigation rail | `--md-sys-elevation-level0` |
152
+ | `--md-comp-nav-rail-expanded-container-shape` | The corner rounding of the expanded navigation rail | `0px` |
153
+ | `--md-comp-nav-rail-expanded-top-space` | The space between the top edge and the header of the expanded navigation rail | `44px` |
154
+ | `--md-comp-nav-rail-expanded-modal-container-color` | The background color of the modal navigation rail | `--md-sys-color-surface-container` |
155
+ | `--md-comp-nav-rail-expanded-modal-container-elevation` | The shadow (elevation) of the modal navigation rail | `--md-sys-elevation-level2` |
156
+ | `--md-comp-nav-rail-expanded-modal-container-shape` | The corner rounding of the modal navigation rail, applied to the two corners facing the content | `--md-sys-shape-corner-large` |
157
+ | `--md-comp-nav-rail-item-icon-size` | The size of the item icons | `--md-sys-icon-size` |
158
+ | `--md-comp-nav-rail-item-container-shape` | The corner rounding of an item's active indicator | half the item height |
159
+ | `--md-comp-nav-rail-item-container-vertical-space` | The vertical space between items | `6px` |
160
+ | `--md-comp-nav-rail-item-header-space-minimum` | The minimum space between the header and the first item | `40px` |
161
+ | `--md-comp-nav-rail-item-short-container-height` | The height of items in an expanded navigation rail, and of items without a label | `56px` |
162
+ | `--md-comp-nav-rail-item-vertical-active-indicator-width` | The width of an item's active indicator in a collapsed navigation rail | `56px` |
163
+ | `--md-comp-nav-rail-item-vertical-active-indicator-height` | The height of an item's active indicator in a collapsed navigation rail | `32px` |
164
+ | `--md-comp-nav-rail-item-active-indicator-leading-space` | The space between the start edge of the active indicator and the icon | `16px` |
165
+ | `--md-comp-nav-rail-item-active-indicator-trailing-space` | The space between the icon and the end edge of the active indicator | `16px` |
166
+ | `--md-comp-nav-rail-item-active-indicator-icon-label-space` | The space between the icon and the label of an expanded item | `8px` |
167
+ | `--md-comp-nav-rail-item-horizontal-full-width-trailing-space` | The space between the end of an expanded item's click target and the container edge | `16px` |
168
+
144
169
  **Example: Changing the width of the collapsed navigation rail**
145
170
 
146
171
  ```HTML
@@ -151,7 +176,7 @@ The Navigation rail component supports the following CSS variables, as defined i
151
176
  </div>
152
177
  ```
153
178
 
154
- To add a vertical divider of the to the navigation rail, set the following CSS variable:
179
+ To add a vertical divider to the navigation rail, set the following CSS variable:
155
180
 
156
181
  ```CSS
157
182
  #mynavigationrail {
@@ -0,0 +1,96 @@
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
+ // Shared navigation item anatomy, used by the Navigation rail and the
23
+ // Navigation bar components (placeholders only — emits no CSS on its own).
24
+ // The two components share the MD3 item colors, state layers and ripple;
25
+ // geometry and component tokens stay with each component.
26
+
27
+ @use '../../styles/motion';
28
+ @use '../../styles/typography';
29
+
30
+ @include typography.scale('label-medium');
31
+
32
+ %micl-navitem {
33
+ --micl-ripple: 1;
34
+ --statelayer-color: var(--md-sys-color-on-secondary-container);
35
+
36
+ box-sizing: border-box;
37
+ display: flex;
38
+ position: relative;
39
+ align-items: center;
40
+ outline: none;
41
+ text-decoration: none;
42
+ cursor: pointer;
43
+
44
+ overflow: visible;
45
+ background-color: transparent;
46
+ background-image:
47
+ radial-gradient(
48
+ circle at var(--micl-x, center) var(--micl-y, center),
49
+ transparent 0%,
50
+ rgb(from var(--statelayer-color) r g b / calc(var(--statelayer-opacity) * var(--md-sys-state-ripple-opacity-factor))) 10%,
51
+ transparent 10%
52
+ ),
53
+ linear-gradient(rgb(from var(--statelayer-color) r g b / var(--statelayer-opacity)));
54
+ background-repeat: no-repeat;
55
+ background-position: var(--micl-x, center) var(--micl-y, center), 0 0;
56
+ background-size: 0%, 100%;
57
+
58
+ &:focus-visible {
59
+ --statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity, 10%);
60
+ }
61
+ &:hover {
62
+ --statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity, 8%);
63
+ }
64
+ &:active {
65
+ --statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity, 10%);
66
+ }
67
+ &.micl-rippling {
68
+ animation: micl-ripple calc(var(--md-sys-state-ripple-duration) * 1.333);
69
+ }
70
+ }
71
+
72
+ %micl-navitem-icon {
73
+ margin: 0;
74
+ padding-block: 4px;
75
+ color: var(--md-sys-color-on-surface-variant);
76
+ font-variation-settings: 'FILL' 0;
77
+ }
78
+
79
+ %micl-navitem-text {
80
+ @include typography.label-medium;
81
+ min-block-size: var(--md-sys-typescale-label-medium-line-height);
82
+ margin: 4px 0px 0px 0px;
83
+ color: var(--md-sys-color-on-surface-variant);
84
+ overflow: hidden;
85
+ }
86
+
87
+ %micl-navitem-current {
88
+ background-color: var(--md-sys-color-secondary-container);
89
+ }
90
+ %micl-navitem-current-icon {
91
+ color: var(--md-sys-color-on-secondary-container);
92
+ font-variation-settings: 'FILL' 1;
93
+ }
94
+ %micl-navitem-current-text {
95
+ color: var(--md-sys-color-secondary);
96
+ }