material-inspired-component-library 5.0.0 → 5.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 (98) hide show
  1. package/README.md +10 -0
  2. package/components/alert/index.scss +4 -4
  3. package/components/appbar/index.scss +3 -2
  4. package/components/badge/index.scss +2 -2
  5. package/components/bottomsheet/index.scss +6 -5
  6. package/components/button/index.scss +20 -20
  7. package/components/card/index.scss +10 -9
  8. package/components/checkbox/index.scss +11 -11
  9. package/components/datepicker/index.scss +435 -0
  10. package/components/datepicker/index.ts +600 -0
  11. package/components/dialog/README.md +6 -6
  12. package/components/dialog/index.scss +23 -17
  13. package/components/divider/index.scss +2 -0
  14. package/components/iconbutton/index.scss +18 -17
  15. package/components/list/index.scss +10 -10
  16. package/components/menu/index.scss +2 -1
  17. package/components/navigationrail/index.scss +10 -9
  18. package/components/radio/README.md +0 -1
  19. package/components/radio/index.scss +11 -11
  20. package/components/select/index.scss +2 -1
  21. package/components/sidesheet/index.scss +3 -1
  22. package/components/slider/index.scss +7 -7
  23. package/components/stepper/index.scss +5 -4
  24. package/components/switch/README.md +0 -1
  25. package/components/switch/index.scss +21 -21
  26. package/components/textfield/index.scss +6 -5
  27. package/components/textfield/index.ts +7 -6
  28. package/components/timepicker/index.scss +9 -8
  29. package/components/timepicker/index.ts +12 -12
  30. package/dist/alert.css +1 -1
  31. package/dist/appbar.css +1 -1
  32. package/dist/badge.css +1 -1
  33. package/dist/bottomsheet.css +1 -1
  34. package/dist/button.css +1 -1
  35. package/dist/card.css +1 -1
  36. package/dist/checkbox.css +1 -1
  37. package/dist/components/datepicker/index.d.ts +6 -0
  38. package/dist/datepicker.css +1 -0
  39. package/dist/datepicker.js +1 -0
  40. package/dist/dialog.css +1 -1
  41. package/dist/divider.css +1 -1
  42. package/dist/foundations.css +1 -0
  43. package/dist/foundations.js +1 -0
  44. package/dist/iconbutton.css +1 -1
  45. package/dist/layout.css +1 -1
  46. package/dist/list.css +1 -1
  47. package/dist/menu.css +1 -1
  48. package/dist/micl.css +1 -1
  49. package/dist/micl.js +1 -1
  50. package/dist/navigationrail.css +1 -1
  51. package/dist/radio.css +1 -1
  52. package/dist/scrollbar.css +1 -0
  53. package/dist/scrollbar.js +1 -0
  54. package/dist/select.css +1 -1
  55. package/dist/sidesheet.css +1 -1
  56. package/dist/slider.css +1 -1
  57. package/dist/stepper.css +1 -1
  58. package/dist/switch.css +1 -1
  59. package/dist/textfield.css +1 -1
  60. package/dist/timepicker.css +1 -1
  61. package/docs/accordion.html +3 -1
  62. package/docs/alert.html +3 -1
  63. package/docs/bottomsheet.html +3 -1
  64. package/docs/button.html +3 -1
  65. package/docs/card.html +3 -1
  66. package/docs/checkbox.html +3 -1
  67. package/docs/datepicker.html +151 -0
  68. package/docs/dialog.html +23 -9
  69. package/docs/divider.html +3 -1
  70. package/docs/docs.js +43 -0
  71. package/docs/iconbutton.html +1 -1
  72. package/docs/index.html +3 -1
  73. package/docs/list.html +3 -1
  74. package/docs/menu.html +3 -1
  75. package/docs/micl.css +1 -1
  76. package/docs/micl.js +1 -1
  77. package/docs/navigationrail.html +3 -1
  78. package/docs/radio.html +3 -1
  79. package/docs/select.html +3 -1
  80. package/docs/sidesheet.html +3 -1
  81. package/docs/slider.html +1 -1
  82. package/docs/stepper.html +3 -1
  83. package/docs/switch.html +3 -1
  84. package/docs/textfield.html +3 -1
  85. package/docs/timepicker.html +4 -2
  86. package/foundations/index.scss +102 -0
  87. package/foundations/layout/index.scss +0 -52
  88. package/foundations/scrollbar/index.scss +46 -0
  89. package/intl.d.ts +9 -0
  90. package/micl.ts +18 -8
  91. package/package.json +2 -1
  92. package/styles/README.md +17 -8
  93. package/styles/motion.scss +3 -0
  94. package/styles/shapes.scss +23 -18
  95. package/styles/statelayer.scss +4 -0
  96. package/styles/typography.scss +2 -2
  97. package/styles.scss +3 -26
  98. package/tsconfig.json +2 -2
@@ -0,0 +1,435 @@
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';
23
+ @use '../../styles/motion';
24
+ @use '../../styles/shapes';
25
+ @use '../../styles/statelayer';
26
+ @use '../../styles/typography';
27
+
28
+ :root {
29
+ --md-comp-date-picker-docked-container-width: 360px;
30
+ --md-comp-date-picker-modal-container-width: 360px;
31
+ --md-comp-date-input-modal-container-width: 328px;
32
+ }
33
+
34
+ %view-transition-base {
35
+ block-size: fit-content;
36
+ opacity: 1;
37
+ transition-duration: var(--md-comp-date-picker-motion-spatial-duration);
38
+
39
+ &.micl-datepicker__view-hidden {
40
+ block-size: 0;
41
+ opacity: 0;
42
+ transition-property: none;
43
+ }
44
+
45
+ &:not(.micl-datepicker__view-hidden) {
46
+ transition-behavior: allow-discrete;
47
+ transition-property: opacity, display, block-size;
48
+ transition-timing-function: linear;
49
+ }
50
+ }
51
+
52
+ dialog.micl-dialog.micl-datepicker {
53
+ --md-comp-date-picker-motion-spatial: #{motion.$md-sys-motion-expressive-fast-effects};
54
+ --md-comp-date-picker-motion-spatial-duration: #{motion.$md-sys-motion-expressive-default-spatial-duration};
55
+ --md-comp-date-picker-motion-duration: #{motion.$md-sys-motion-expressive-default-effects-duration};
56
+ --md-comp-date-picker-motion-duration-reverse: #{motion.$md-sys-motion-expressive-fast-effects-duration};
57
+ --md-comp-date-picker-button-motion-duration: #{motion.$md-sys-motion-expressive-fast-spatial-duration};
58
+
59
+ inline-size: var(--md-comp-date-picker-modal-container-width, 360px);
60
+
61
+ &:has(.micl-datepicker__input:not(.micl-datepicker__view-hidden)) {
62
+ inline-size: var(--md-comp-date-input-modal-container-width, 328px);
63
+
64
+ .micl-divider {
65
+ margin-block: 9.5px;
66
+ }
67
+ .micl-dialog__content {
68
+ min-block-size: 85px;
69
+ }
70
+ }
71
+
72
+ form {
73
+ background-color: inherit;
74
+ }
75
+ .micl-dialog__headline {
76
+ display: grid;
77
+ gap: 0;
78
+ grid-template-columns: max-content 1fr var(--md-sys-target-size, 48px);
79
+ grid-template-areas:
80
+ "datepicker-supporting datepicker-supporting datepicker-supporting"
81
+ "datepicker-close datepicker-action datepicker-action"
82
+ "datepicker-close datepicker-headline datepicker-mode"
83
+ "datepicker-divider datepicker-divider datepicker-divider"
84
+ "datepicker-year-selector datepicker-year-selector datepicker-month-selector";
85
+ padding-inline-end: 12px;
86
+ padding-block: 16px 4px;
87
+
88
+ h1, h2, h3, h4, h5, h6, .micl-heading {
89
+ @include typography.headline-large;
90
+
91
+ grid-area: datepicker-headline;
92
+ margin-block-start: 36px;
93
+ color: var(--md-sys-color-on-surface-variant);
94
+ }
95
+ .micl-dialog__supporting-text {
96
+ @include typography.label-large;
97
+
98
+ grid-area: datepicker-supporting;
99
+ }
100
+ .micl-datepicker__inputmode {
101
+ grid-area: datepicker-mode;
102
+ align-self: flex-end;
103
+ justify-self: center;
104
+ }
105
+ .micl-divider {
106
+ grid-area: datepicker-divider;
107
+ inline-size: calc(100% + 36px);
108
+ margin-block-start: 11.5px;
109
+ margin-inline: -24px;
110
+ }
111
+ .micl-datepicker__month-selector,
112
+ .micl-datepicker__year-selector {
113
+ display: grid;
114
+ grid-template-rows: var(--md-sys-target-size, 48px);
115
+ align-items: center;
116
+
117
+ &.micl-datepicker__view-hidden {
118
+ display: none;
119
+ }
120
+ }
121
+ .micl-datepicker__month-selector {
122
+ grid-area: datepicker-month-selector;
123
+ grid-template-areas: "datepicker-month-previous datepicker-month-next";
124
+ grid-template-columns: var(--md-sys-target-size, 48px) var(--md-sys-target-size, 48px);
125
+ justify-items: flex-end;
126
+ justify-content: flex-end;
127
+
128
+ .micl-datepicker__previous {
129
+ grid-area: datepicker-month-previous;
130
+ }
131
+ .micl-datepicker__next {
132
+ grid-area: datepicker-month-next;
133
+ }
134
+ }
135
+ .micl-datepicker__year-selector {
136
+ grid-area: datepicker-year-selector;
137
+ grid-template-areas: "datepicker-year";
138
+ grid-template-columns: 1fr;
139
+ justify-items: flex-start;
140
+ margin-inline-start: -8px;
141
+
142
+ .micl-datepicker__previous {
143
+ display: none;
144
+ grid-area: datepicker-year-previous;
145
+ }
146
+ .micl-datepicker__next {
147
+ display: none;
148
+ grid-area: datepicker-year-next;
149
+ }
150
+ }
151
+ .micl-datepicker__month {
152
+ display: none;
153
+ grid-area: datepicker-month;
154
+ margin-inline: -12px auto;
155
+ }
156
+ .micl-datepicker__year {
157
+ grid-area: datepicker-year;
158
+ }
159
+ .micl-datepicker__month:not(:disabled),
160
+ .micl-datepicker__year:not(:disabled) {
161
+ color: var(--md-sys-color-on-surface-variant);
162
+ }
163
+ }
164
+
165
+ .micl-dialog__content {
166
+ display: grid;
167
+ grid-template-areas: "datepicker-view";
168
+ position: relative;
169
+ inline-size: 100%;
170
+ max-block-size: 336px;
171
+ min-block-size: 330px;
172
+ padding-inline: 0;
173
+ overflow: hidden auto;
174
+ transition: min-block-size var(--md-comp-date-picker-motion-spatial-duration) var(--md-comp-date-picker-motion-spatial);
175
+
176
+ .micl-datepicker__calendars {
177
+ display: flex;
178
+ grid-area: datepicker-view;
179
+ position: absolute;
180
+ inset-block-start: 0;
181
+ inset-inline-start: 0;
182
+ block-size: 100%;
183
+ inline-size: 200%;
184
+ opacity: 1;
185
+ overflow: hidden;
186
+ transform: translateX(0);
187
+ transition:
188
+ transform var(--md-comp-date-picker-motion-spatial-duration) var(--md-comp-date-picker-motion-spatial),
189
+ opacity var(--md-comp-date-picker-motion-duration-reverse) linear,
190
+ block-size var(--md-comp-date-picker-motion-duration-reverse) linear allow-discrete,
191
+ display var(--md-comp-date-picker-motion-duration-reverse) linear allow-discrete;
192
+
193
+ &.micl-datepicker__view-hidden {
194
+ block-size: 0%;
195
+ opacity: 0;
196
+ transition-property: none;
197
+ }
198
+ &.micl-startleft,
199
+ &.micl-moveright {
200
+ transform: translateX(0%);
201
+ }
202
+ &.micl-startright,
203
+ &.micl-moveleft {
204
+ transform: translateX(-50%);
205
+ }
206
+
207
+ .micl-datepicker__calendar {
208
+ flex-shrink: 0;
209
+ block-size: 100%;
210
+ inline-size: 50%;
211
+
212
+ .micl-datepicker__calendar-inner {
213
+ @include typography.body-large;
214
+
215
+ box-sizing: border-box;
216
+ display: grid;
217
+ grid-template-columns: repeat(7, var(--md-sys-target-size, 48px));
218
+ grid-template-rows: 40px repeat(6, var(--md-sys-target-size, 48px));
219
+ block-size: 100%;
220
+ inline-size: 100%;
221
+ padding-inline: 12px;
222
+
223
+ span, time {
224
+ box-sizing: border-box;
225
+ display: inline-flex;
226
+ justify-content: center;
227
+ border: none;
228
+ color: var(--md-sys-color-on-surface);
229
+ -webkit-tap-highlight-color: transparent;
230
+ }
231
+ time {
232
+ --statelayer-color: var(--md-sys-color-on-surface-variant);
233
+ --statelayer-opacity: 0%;
234
+
235
+ align-items: center;
236
+ border: 4px solid transparent;
237
+ border-radius: var(--md-sys-shape-corner-full);
238
+ background-image: linear-gradient(rgb(from var(--statelayer-color) r g b / var(--statelayer-opacity)));
239
+ background-repeat: no-repeat;
240
+ background-size: 100%;
241
+ background-clip: content-box;
242
+ transition: --statelayer-opacity var(--md-comp-date-picker-button-motion-duration) linear;
243
+
244
+ &.micl-datepicker__today {
245
+ outline: 1px solid var(--md-sys-color-primary);
246
+ outline-offset: -5px;
247
+ color: var(--md-sys-color-primary);
248
+
249
+ &:hover,
250
+ &:focus-visible,
251
+ &:active {
252
+ --statelayer-color: var(--md-sys-color-primary);
253
+ }
254
+ }
255
+ &.micl-datepicker__selected {
256
+ background-color: var(--md-sys-color-primary);
257
+ color: var(--md-sys-color-on-primary);
258
+
259
+ &:hover,
260
+ &:focus-visible,
261
+ &:active {
262
+ --statelayer-color: var(--md-sys-color-on-primary);
263
+ }
264
+ }
265
+ &.micl-datepicker__outside {
266
+ color: rgb(from var(--md-sys-color-on-surface) r g b / var(--md-sys-state-disabled-state-layer-opacity, 38%));
267
+ }
268
+ &:not(.micl-datepicker__outside) {
269
+ cursor: pointer;
270
+ }
271
+ &:hover {
272
+ --statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity, 8%);
273
+ }
274
+ &:focus-visible {
275
+ --statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity, 10%);
276
+ }
277
+ &:active {
278
+ --statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity, 10%);
279
+ }
280
+ }
281
+ }
282
+ }
283
+ }
284
+ .micl-datepicker__months,
285
+ .micl-datepicker__years,
286
+ .micl-datepicker__input {
287
+ grid-area: datepicker-view;
288
+ @extend %view-transition-base;
289
+ }
290
+ .micl-datepicker__months {
291
+ overflow-y: hidden;
292
+
293
+ .micl-datepicker__months-inner {
294
+ block-size: auto;
295
+ inline-size: 100%;
296
+ }
297
+ label {
298
+ @include typography.body-large;
299
+
300
+ display: flex;
301
+ align-items: center;
302
+ block-size: var(--md-sys-target-size, 48px);
303
+ gap: 8px;
304
+ padding-inline-start: 16px;
305
+ color: var(--md-sys-color-on-surface);
306
+ cursor: pointer;
307
+
308
+ input[type=radio] {
309
+ appearance: none;
310
+ margin: 0;
311
+ }
312
+ span {
313
+ visibility: hidden;
314
+ color: var(--md-sys-color-on-surface);
315
+ }
316
+ &:has(input:checked) {
317
+ background-color: var(--md-sys-color-surface-variant);
318
+
319
+ span {
320
+ visibility: visible;
321
+ }
322
+ }
323
+ }
324
+ }
325
+ .micl-datepicker__years {
326
+ overflow-y: hidden;
327
+
328
+ .micl-datepicker__years-inner {
329
+ display: flex;
330
+ flex-wrap: wrap;
331
+ justify-content: center;
332
+ block-size: auto;
333
+ inline-size: 100%;
334
+ }
335
+ label {
336
+ --statelayer-color: var(--md-sys-color-on-surface-variant);
337
+ --statelayer-opacity: 0%;
338
+
339
+ @include typography.body-large;
340
+
341
+ display: inline-flex;
342
+ align-items: center;
343
+ justify-content: center;
344
+ block-size: 36px;
345
+ inline-size: 72px;
346
+ margin: 8px;
347
+ border: calc((var(--md-sys-target-size, 48px) - 36px) / 2) solid transparent;
348
+ border-radius: calc(var(--md-sys-target-size, 48px) / 2);
349
+ background-image: linear-gradient(rgb(from var(--statelayer-color) r g b / var(--statelayer-opacity)));
350
+ background-repeat: no-repeat;
351
+ background-size: 100%;
352
+ background-clip: content-box;
353
+ color: var(--md-sys-color-on-surface-variant);
354
+ cursor: pointer;
355
+ transition: --statelayer-opacity var(--md-comp-date-picker-button-motion-duration) linear;
356
+
357
+ &:hover {
358
+ --statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity, 8%);
359
+ }
360
+ &:focus-visible {
361
+ --statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity, 10%);
362
+ }
363
+ &:active {
364
+ --statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity, 10%);
365
+ }
366
+ &:has(input:checked) {
367
+ color: var(--md-sys-color-on-primary);
368
+ background-color: var(--md-sys-color-primary);
369
+
370
+ &:hover,
371
+ &:focus-visible,
372
+ &:active {
373
+ --statelayer-color: var(--md-sys-color-on-primary);
374
+ }
375
+ }
376
+
377
+ input[type=radio] {
378
+ appearance: none;
379
+ margin: 0;
380
+ }
381
+ }
382
+ }
383
+ .micl-datepicker__input {
384
+ padding-inline: 16px;
385
+ margin-block-end: 16px;
386
+
387
+ &.micl-datepicker__view-hidden,
388
+ input[type=date]::-webkit-calendar-picker-indicator {
389
+ display: none;
390
+ }
391
+ }
392
+ }
393
+
394
+ .micl-dialog__actions {
395
+ padding: 8px 12px 12px 12px;
396
+ }
397
+
398
+ &.micl-dialog--docked {
399
+ inline-size: var(--md-comp-date-picker-docked-container-width, 360px);
400
+ border-radius: var(--md-sys-shape-corner-large);
401
+
402
+ .micl-dialog__headline {
403
+ grid-template-areas: "datepicker-month-selector datepicker-year-selector";
404
+ grid-template-columns: 1fr 1fr;
405
+ padding: 8px 12px 18px 12px;
406
+
407
+ h1, h2, h3, h4, h5, h6, .micl-heading,
408
+ .micl-dialog__supporting-text,
409
+ .micl-datepicker__inputmode {
410
+ display: none;
411
+ }
412
+ .micl-datepicker__month-selector {
413
+ grid-template-areas: "datepicker-month-previous datepicker-month datepicker-month-next";
414
+ grid-template-columns: var(--md-sys-target-size, 48px) 1fr var(--md-sys-target-size, 48px);
415
+
416
+ .micl-datepicker__month {
417
+ display: inline-flex;
418
+ margin-inline: 0;
419
+ }
420
+ }
421
+ .micl-datepicker__year-selector {
422
+ grid-template-areas: "datepicker-year-previous datepicker-year datepicker-year-next";
423
+ grid-template-columns: var(--md-sys-target-size, 48px) 1fr var(--md-sys-target-size, 48px);
424
+
425
+ .micl-datepicker__previous,
426
+ .micl-datepicker__next {
427
+ display: block;
428
+ }
429
+ }
430
+ }
431
+ .micl-dialog__actions > button {
432
+ margin-block: -2px;
433
+ }
434
+ }
435
+ }