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.
- package/README.md +106 -18
- package/components/README.md +1 -1
- package/components/accordion/README.md +6 -6
- package/components/alert/README.md +10 -10
- package/components/alert/index.scss +27 -52
- package/components/appbar/README.md +19 -6
- package/components/appbar/index.scss +40 -44
- package/components/badge/README.md +12 -10
- package/components/badge/index.scss +21 -25
- package/components/bottomsheet/README.md +26 -1
- package/components/bottomsheet/index.scss +58 -44
- package/components/button/README.md +70 -10
- package/components/button/_shared.scss +210 -0
- package/components/button/index.scss +75 -389
- package/components/card/README.md +97 -85
- package/components/card/index.scss +46 -65
- package/components/checkbox/README.md +25 -14
- package/{tools/shapes/check.mjs → components/checkbox/_label.scss} +37 -42
- package/components/checkbox/index.scss +66 -66
- package/components/chip/README.md +186 -0
- package/components/chip/index.scss +285 -0
- package/components/datepicker/README.md +79 -0
- package/components/datepicker/index.scss +346 -315
- package/components/dialog/README.md +20 -10
- package/components/dialog/index.scss +55 -66
- package/components/divider/README.md +16 -15
- package/components/divider/index.scss +9 -25
- package/components/iconbutton/README.md +63 -12
- package/components/iconbutton/index.scss +142 -303
- package/components/list/README.md +89 -156
- package/components/list/index.scss +34 -36
- package/components/menu/README.md +81 -155
- package/components/menu/index.scss +52 -58
- package/components/navigationbar/README.md +108 -0
- package/components/navigationbar/index.scss +185 -0
- package/components/navigationrail/README.md +62 -37
- package/components/navigationrail/_navitem.scss +96 -0
- package/components/navigationrail/index.scss +78 -132
- package/components/progressindicator/README.md +83 -47
- package/components/progressindicator/index.scss +622 -172
- package/components/radio/README.md +11 -9
- package/components/radio/index.scss +36 -33
- package/components/select/README.md +12 -7
- package/components/select/index.scss +26 -34
- package/components/shapes/README.md +3 -3
- package/components/shapes/index.scss +0 -1
- package/components/sidesheet/README.md +21 -9
- package/components/sidesheet/index.scss +38 -46
- package/components/slider/README.md +21 -0
- package/components/slider/index.scss +108 -139
- package/components/snackbar/README.md +32 -35
- package/components/snackbar/index.scss +10 -22
- package/components/stepper/README.md +14 -7
- package/components/stepper/index.scss +58 -39
- package/components/switch/README.md +22 -15
- package/components/switch/index.scss +68 -60
- package/components/textfield/README.md +48 -5
- package/components/textfield/index.scss +192 -248
- package/components/timepicker/README.md +53 -23
- package/components/timepicker/index.scss +110 -128
- package/dist/alert.css +1 -1
- package/dist/alert.js +1 -1
- package/dist/appbar.css +1 -1
- package/dist/appbar.js +1 -1
- package/dist/badge.css +1 -1
- package/dist/badge.js +1 -1
- package/dist/base.css +1 -0
- package/dist/base.js +1 -0
- package/dist/bottomsheet.css +1 -1
- package/dist/bottomsheet.js +1 -1
- package/dist/button.css +1 -1
- package/dist/button.js +1 -1
- package/dist/card.css +1 -1
- package/dist/card.js +1 -1
- package/dist/checkbox.css +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/chip.css +1 -0
- package/dist/chip.js +1 -0
- package/dist/components/button/index.d.ts +1 -1
- package/dist/components/iconbutton/index.d.ts +2 -7
- package/dist/components/slider/index.d.ts +1 -1
- package/dist/components/textfield/index.d.ts +2 -2
- package/dist/datepicker.css +1 -1
- package/dist/datepicker.js +1 -1
- package/dist/dialog.css +1 -1
- package/dist/dialog.js +1 -1
- package/dist/divider.css +1 -1
- package/dist/divider.js +1 -1
- package/dist/field.css +1 -0
- package/dist/field.js +1 -0
- package/dist/foundations/form/index.js +1 -1
- package/dist/foundations/runtime.d.ts +15 -0
- package/dist/foundations/runtime.js +1 -0
- package/dist/iconbutton.css +1 -1
- package/dist/iconbutton.js +1 -1
- package/dist/layout.css +1 -1
- package/dist/layout.js +1 -1
- package/dist/list.css +1 -1
- package/dist/list.js +1 -1
- package/dist/menu.css +1 -1
- package/dist/menu.js +1 -1
- package/dist/micl.css +1 -1
- package/dist/micl.d.ts +14 -5
- package/dist/micl.js +1 -1
- package/dist/navigationbar.css +1 -0
- package/dist/navigationbar.js +1 -0
- package/dist/navigationrail.css +1 -1
- package/dist/navigationrail.js +1 -1
- package/dist/progressindicator.css +1 -1
- package/dist/progressindicator.js +1 -1
- package/dist/radio.css +1 -1
- package/dist/radio.js +1 -1
- package/dist/scrollbar.js +1 -1
- package/dist/select.css +1 -1
- package/dist/select.js +1 -1
- package/dist/shapes.css +1 -1
- package/dist/shapes.js +1 -1
- package/dist/sidesheet.css +1 -1
- package/dist/sidesheet.js +1 -1
- package/dist/slider.css +1 -1
- package/dist/slider.js +1 -1
- package/dist/snackbar.css +1 -1
- package/dist/snackbar.js +1 -1
- package/dist/stepper.css +1 -1
- package/dist/stepper.js +1 -1
- package/dist/switch.css +1 -1
- package/dist/switch.js +1 -1
- package/dist/textfield.css +1 -1
- package/dist/textfield.js +1 -1
- package/dist/timepicker.css +1 -1
- package/dist/timepicker.js +1 -1
- package/foundations/_index.scss +35 -0
- package/foundations/{index.scss → base/index.scss} +21 -56
- package/foundations/field/index.scss +37 -0
- package/foundations/layout/index.scss +64 -65
- package/package.json +23 -9
- package/styles/statelayer.scss +20 -5
- package/styles.scss +5 -2
- package/.claude/settings.local.json +0 -14
- package/.editorconfig +0 -12
- package/.gitattributes +0 -9
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -35
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
- package/CLAUDE.md +0 -53
- package/CODE_OF_CONDUCT.md +0 -128
- package/components/bottomsheet/index.ts +0 -153
- package/components/button/index.ts +0 -79
- package/components/checkbox/index.ts +0 -148
- package/components/datepicker/index.ts +0 -693
- package/components/iconbutton/index.ts +0 -77
- package/components/list/index.ts +0 -138
- package/components/menu/index.ts +0 -145
- package/components/navigationrail/index.ts +0 -87
- package/components/progressindicator/index.ts +0 -77
- package/components/slider/index.ts +0 -149
- package/components/snackbar/index.ts +0 -118
- package/components/stepper/index.ts +0 -248
- package/components/textfield/index.ts +0 -188
- package/components/timepicker/index.ts +0 -413
- package/dist/components/progressindicator/index.d.ts +0 -6
- package/dist/foundations.css +0 -1
- package/dist/foundations.js +0 -1
- package/docs/accordion.html +0 -344
- package/docs/alert.html +0 -177
- package/docs/bottomsheet.html +0 -240
- package/docs/button.html +0 -290
- package/docs/card-awards.webp +0 -0
- package/docs/card-cabinet.webp +0 -0
- package/docs/card-city.webp +0 -0
- package/docs/card-fingerprint.webp +0 -0
- package/docs/card-holiday.webp +0 -0
- package/docs/card-names.webp +0 -0
- package/docs/card.html +0 -159
- package/docs/checkbox.html +0 -147
- package/docs/datepicker.html +0 -274
- package/docs/dialog.html +0 -195
- package/docs/divider.html +0 -139
- package/docs/docs.css +0 -26
- package/docs/docs.js +0 -139
- package/docs/iconbutton.html +0 -329
- package/docs/index.html +0 -431
- package/docs/list.html +0 -310
- package/docs/menu.html +0 -574
- package/docs/micl.css +0 -1
- package/docs/micl.js +0 -1
- package/docs/navigationrail.html +0 -138
- package/docs/progressindicator.html +0 -288
- package/docs/radio.html +0 -123
- package/docs/select.html +0 -337
- package/docs/shapes.css +0 -1
- package/docs/shapes.html +0 -159
- package/docs/shapes.js +0 -1
- package/docs/sidesheet.html +0 -149
- package/docs/slider.html +0 -141
- package/docs/snackbar.html +0 -102
- package/docs/stepper.html +0 -319
- package/docs/switch.html +0 -196
- package/docs/textfield.html +0 -208
- package/docs/themes/airblue/dark-hc.css +0 -51
- package/docs/themes/airblue/dark-mc.css +0 -51
- package/docs/themes/airblue/dark.css +0 -51
- package/docs/themes/airblue/light-hc.css +0 -51
- package/docs/themes/airblue/light-mc.css +0 -51
- package/docs/themes/airblue/light.css +0 -51
- package/docs/themes/airblue/theme.css +0 -306
- package/docs/themes/barnred/dark-hc.css +0 -51
- package/docs/themes/barnred/dark-mc.css +0 -51
- package/docs/themes/barnred/dark.css +0 -51
- package/docs/themes/barnred/light-hc.css +0 -51
- package/docs/themes/barnred/light-mc.css +0 -51
- package/docs/themes/barnred/light.css +0 -51
- package/docs/themes/barnred/theme.css +0 -306
- package/docs/themes/citrine/dark-hc.css +0 -51
- package/docs/themes/citrine/dark-mc.css +0 -51
- package/docs/themes/citrine/dark.css +0 -51
- package/docs/themes/citrine/light-hc.css +0 -51
- package/docs/themes/citrine/light-mc.css +0 -51
- package/docs/themes/citrine/light.css +0 -51
- package/docs/themes/citrine/theme.css +0 -306
- package/docs/themes/gray/dark-hc.css +0 -51
- package/docs/themes/gray/dark-mc.css +0 -51
- package/docs/themes/gray/dark.css +0 -51
- package/docs/themes/gray/light-hc.css +0 -51
- package/docs/themes/gray/light-mc.css +0 -51
- package/docs/themes/gray/light.css +0 -51
- package/docs/themes/gray/theme.css +0 -306
- package/docs/themes/greenery/dark-hc.css +0 -51
- package/docs/themes/greenery/dark-mc.css +0 -51
- package/docs/themes/greenery/dark.css +0 -51
- package/docs/themes/greenery/light-hc.css +0 -51
- package/docs/themes/greenery/light-mc.css +0 -51
- package/docs/themes/greenery/light.css +0 -51
- package/docs/themes/greenery/theme.css +0 -306
- package/docs/themes/hermana/dark-hc.css +0 -51
- package/docs/themes/hermana/dark-mc.css +0 -51
- package/docs/themes/hermana/dark.css +0 -51
- package/docs/themes/hermana/light-hc.css +0 -51
- package/docs/themes/hermana/light-mc.css +0 -51
- package/docs/themes/hermana/light.css +0 -51
- package/docs/themes/hermana/theme.css +0 -306
- package/docs/themes/illuminating/dark-hc.css +0 -51
- package/docs/themes/illuminating/dark-mc.css +0 -51
- package/docs/themes/illuminating/dark.css +0 -51
- package/docs/themes/illuminating/light-hc.css +0 -51
- package/docs/themes/illuminating/light-mc.css +0 -51
- package/docs/themes/illuminating/light.css +0 -51
- package/docs/themes/illuminating/theme.css +0 -306
- package/docs/themes/magenta/dark-hc.css +0 -51
- package/docs/themes/magenta/dark-mc.css +0 -51
- package/docs/themes/magenta/dark.css +0 -51
- package/docs/themes/magenta/light-hc.css +0 -51
- package/docs/themes/magenta/light-mc.css +0 -51
- package/docs/themes/magenta/light.css +0 -51
- package/docs/themes/magenta/theme.css +0 -306
- package/docs/themes/mocha/dark-hc.css +0 -51
- package/docs/themes/mocha/dark-mc.css +0 -51
- package/docs/themes/mocha/dark.css +0 -51
- package/docs/themes/mocha/light-hc.css +0 -51
- package/docs/themes/mocha/light-mc.css +0 -51
- package/docs/themes/mocha/light.css +0 -51
- package/docs/themes/mocha/theme.css +0 -306
- package/docs/themes/olivegreen/dark-hc.css +0 -51
- package/docs/themes/olivegreen/dark-mc.css +0 -51
- package/docs/themes/olivegreen/dark.css +0 -51
- package/docs/themes/olivegreen/light-hc.css +0 -51
- package/docs/themes/olivegreen/light-mc.css +0 -51
- package/docs/themes/olivegreen/light.css +0 -51
- package/docs/themes/olivegreen/theme.css +0 -306
- package/docs/themes/peri/dark-hc.css +0 -51
- package/docs/themes/peri/dark-mc.css +0 -51
- package/docs/themes/peri/dark.css +0 -51
- package/docs/themes/peri/light-hc.css +0 -51
- package/docs/themes/peri/light-mc.css +0 -51
- package/docs/themes/peri/light.css +0 -51
- package/docs/themes/peri/theme.css +0 -306
- package/docs/timepicker.html +0 -160
- package/foundations/form/index.ts +0 -174
- package/foundations/layout/README.md +0 -127
- package/intl.d.ts +0 -9
- package/micl.ts +0 -221
- package/styles/README.md +0 -196
- package/tools/shapes/generate.mjs +0 -828
- package/tsconfig.json +0 -116
- package/webpack.config.js +0 -104
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright © 2026 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/motion';
|
|
23
|
+
@use '../../styles/shape';
|
|
24
|
+
@use '../../styles/typography';
|
|
25
|
+
@use '../button/shared' as button;
|
|
26
|
+
|
|
27
|
+
@include shape.corner('small');
|
|
28
|
+
@include shape.corner('full');
|
|
29
|
+
|
|
30
|
+
@include typography.scale('title-medium');
|
|
31
|
+
|
|
32
|
+
.micl-chips {
|
|
33
|
+
display: flex;
|
|
34
|
+
align-items: flex-start;
|
|
35
|
+
flex-wrap: wrap;
|
|
36
|
+
gap: 8px;
|
|
37
|
+
margin: 0;
|
|
38
|
+
padding: 0;
|
|
39
|
+
border: none;
|
|
40
|
+
|
|
41
|
+
.micl-chips__headline {
|
|
42
|
+
padding-block-end: 4px;
|
|
43
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
44
|
+
}
|
|
45
|
+
.micl-chip-assist {
|
|
46
|
+
--micl-chip-statelayer: var(--md-sys-color-on-surface);
|
|
47
|
+
--micl-chip-label: var(--md-comp-assist-chip-label-text-color, var(--md-sys-color-on-surface));
|
|
48
|
+
--micl-chip-icon: var(--md-comp-assist-chip-leading-icon-color);
|
|
49
|
+
--micl-chip-outline: var(--md-comp-assist-chip-outline-color);
|
|
50
|
+
--micl-chip-disabled-label: var(--md-comp-assist-chip-disabled-label-text-color);
|
|
51
|
+
--micl-chip-disabled-outline: var(--md-comp-assist-chip-disabled-outline-color);
|
|
52
|
+
--micl-chip-elevated-container: var(--md-comp-assist-chip-elevated-container-color);
|
|
53
|
+
}
|
|
54
|
+
.micl-chip-filter {
|
|
55
|
+
--micl-chip-label: var(--md-comp-filter-chip-label-text-color);
|
|
56
|
+
--micl-chip-icon: var(--md-comp-filter-chip-leading-icon-color);
|
|
57
|
+
--micl-chip-outline: var(--md-comp-filter-chip-outline-color);
|
|
58
|
+
--micl-chip-disabled-label: var(--md-comp-filter-chip-disabled-label-text-color);
|
|
59
|
+
--micl-chip-disabled-outline: var(--md-comp-filter-chip-disabled-outline-color);
|
|
60
|
+
--micl-chip-elevated-container: var(--md-comp-filter-chip-elevated-container-color);
|
|
61
|
+
}
|
|
62
|
+
.micl-chip-suggestion {
|
|
63
|
+
--micl-chip-label: var(--md-comp-suggestion-chip-label-text-color);
|
|
64
|
+
--micl-chip-icon: var(--md-comp-suggestion-chip-leading-icon-color);
|
|
65
|
+
--micl-chip-outline: var(--md-comp-suggestion-chip-outline-color);
|
|
66
|
+
--micl-chip-disabled-label: var(--md-comp-suggestion-chip-disabled-label-text-color);
|
|
67
|
+
--micl-chip-disabled-outline: var(--md-comp-suggestion-chip-disabled-outline-color);
|
|
68
|
+
--micl-chip-elevated-container: var(--md-comp-suggestion-chip-elevated-container-color);
|
|
69
|
+
}
|
|
70
|
+
.micl-chip-assist, .micl-chip-filter, .micl-chip-input, .micl-chip-suggestion {
|
|
71
|
+
@extend %micl-button-base;
|
|
72
|
+
@extend %micl-button-xs;
|
|
73
|
+
|
|
74
|
+
--md-comp-elevated-button-label-text-color: var(--micl-chip-label, var(--md-sys-color-on-surface-variant));
|
|
75
|
+
--md-comp-outlined-button-label-text-color: var(--micl-chip-label, var(--md-sys-color-on-surface-variant));
|
|
76
|
+
--md-comp-elevated-button-disabled-container-opacity: 12%;
|
|
77
|
+
--md-comp-elevated-button-disabled-label-text-color: var(--micl-chip-disabled-label, rgb(from var(--md-sys-color-on-surface) r g b / 38%));
|
|
78
|
+
--md-comp-outlined-button-disabled-label-text-color: var(--micl-chip-disabled-label, rgb(from var(--md-sys-color-on-surface) r g b / 38%));
|
|
79
|
+
|
|
80
|
+
border-radius: var(--md-sys-shape-corner-small);
|
|
81
|
+
padding-inline: 16px;
|
|
82
|
+
column-gap: 8px;
|
|
83
|
+
|
|
84
|
+
&:has(> .micl-button__icon:first-child) {
|
|
85
|
+
padding-inline-start: 8px;
|
|
86
|
+
}
|
|
87
|
+
&:has(> .micl-button__icon:last-child) {
|
|
88
|
+
padding-inline-end: 8px;
|
|
89
|
+
}
|
|
90
|
+
.micl-button__icon {
|
|
91
|
+
font-size: 18px;
|
|
92
|
+
inline-size: 18px;
|
|
93
|
+
overflow: hidden;
|
|
94
|
+
transition: inline-size #{motion.$md-sys-motion-expressive-fast-effects-duration} #{motion.$md-sys-motion-expressive-fast-effects};
|
|
95
|
+
}
|
|
96
|
+
&#{button.$enabled} .micl-button__icon {
|
|
97
|
+
color: var(--micl-chip-icon, var(--md-sys-color-primary));
|
|
98
|
+
}
|
|
99
|
+
&:not(.micl-chip--elevated) {
|
|
100
|
+
@extend %micl-button-outlined;
|
|
101
|
+
|
|
102
|
+
--statelayer-color: var(--micl-chip-statelayer, var(--md-sys-color-on-surface-variant));
|
|
103
|
+
--md-comp-outlined-button-outline-color: var(--micl-chip-outline, var(--md-sys-color-outline-variant));
|
|
104
|
+
|
|
105
|
+
&#{button.$disabled} {
|
|
106
|
+
border-color: var(--micl-chip-disabled-outline, rgb(from var(--md-sys-color-on-surface) r g b / 12%));
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
.micl-chip-input {
|
|
111
|
+
--micl-chip-label: var(--md-comp-input-chip-label-text-color);
|
|
112
|
+
--micl-chip-icon: var(--md-comp-input-chip-leading-icon-color, currentColor);
|
|
113
|
+
--micl-chip-outline: var(--md-comp-input-chip-outline-color);
|
|
114
|
+
--micl-chip-disabled-label: var(--md-comp-input-chip-disabled-label-text-color);
|
|
115
|
+
--micl-chip-disabled-outline: var(--md-comp-input-chip-disabled-outline-color);
|
|
116
|
+
|
|
117
|
+
padding-inline: 0;
|
|
118
|
+
column-gap: 0;
|
|
119
|
+
cursor: default;
|
|
120
|
+
|
|
121
|
+
&:has(> .micl-chip__primary:focus-visible) {
|
|
122
|
+
--statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity, 10%);
|
|
123
|
+
|
|
124
|
+
outline: var(--md-sys-state-focus-indicator-thickness, 3px) solid var(--md-sys-color-secondary);
|
|
125
|
+
outline-offset: 2px;
|
|
126
|
+
}
|
|
127
|
+
&#{button.$enabled}:has(> .micl-chip__remove:is(:hover, :active)) {
|
|
128
|
+
--statelayer-opacity: 0%;
|
|
129
|
+
}
|
|
130
|
+
&:has(> :disabled) .micl-chip__avatar {
|
|
131
|
+
opacity: var(--md-comp-input-chip-disabled-avatar-opacity, 38%);
|
|
132
|
+
}
|
|
133
|
+
&:has(.micl-chip__avatar) {
|
|
134
|
+
border-radius: calc(var(--micl-height) / 2);
|
|
135
|
+
|
|
136
|
+
.micl-chip__primary {
|
|
137
|
+
border-start-start-radius: calc(var(--micl-height) / 2 - 1px);
|
|
138
|
+
border-end-start-radius: calc(var(--micl-height) / 2 - 1px);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
.micl-chip__primary,
|
|
142
|
+
.micl-chip__remove {
|
|
143
|
+
@extend %micl-button-base;
|
|
144
|
+
|
|
145
|
+
--statelayer-color: var(--micl-chip-statelayer, var(--md-sys-color-on-surface-variant));
|
|
146
|
+
|
|
147
|
+
color: inherit;
|
|
148
|
+
background-color: transparent;
|
|
149
|
+
}
|
|
150
|
+
.micl-chip__primary {
|
|
151
|
+
background-image:
|
|
152
|
+
radial-gradient(
|
|
153
|
+
circle at var(--micl-x, center) var(--micl-y, center),
|
|
154
|
+
transparent 0%,
|
|
155
|
+
rgb(from var(--statelayer-color) r g b / calc(var(--statelayer-opacity) * var(--md-sys-state-ripple-opacity-factor))) 10%,
|
|
156
|
+
transparent 10%
|
|
157
|
+
);
|
|
158
|
+
block-size: 100%;
|
|
159
|
+
column-gap: 8px;
|
|
160
|
+
padding-inline: 12px 5px;
|
|
161
|
+
border-start-start-radius: calc(var(--md-sys-shape-corner-small) - 1px);
|
|
162
|
+
border-end-start-radius: calc(var(--md-sys-shape-corner-small) - 1px);
|
|
163
|
+
border-start-end-radius: 0;
|
|
164
|
+
border-end-end-radius: 0;
|
|
165
|
+
font: inherit;
|
|
166
|
+
|
|
167
|
+
&:has(> .micl-button__icon:first-child) {
|
|
168
|
+
padding-inline-start: 8px;
|
|
169
|
+
}
|
|
170
|
+
&:has(> .micl-chip__avatar:first-child) {
|
|
171
|
+
padding-inline-start: 4px;
|
|
172
|
+
}
|
|
173
|
+
&#{button.$enabled}#{button.$focused} {
|
|
174
|
+
outline: none;
|
|
175
|
+
}
|
|
176
|
+
&::before {
|
|
177
|
+
content: "";
|
|
178
|
+
position: absolute;
|
|
179
|
+
inset-block-start: calc((100% - var(--md-sys-target-size, 48px)) / 2);
|
|
180
|
+
inset-inline-start: 0;
|
|
181
|
+
block-size: var(--md-sys-target-size, 48px);
|
|
182
|
+
inline-size: 100%;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
.micl-chip__remove {
|
|
186
|
+
inline-size: 24px;
|
|
187
|
+
block-size: 24px;
|
|
188
|
+
margin-inline: 0 5px;
|
|
189
|
+
border-radius: 50%;
|
|
190
|
+
font-size: 18px;
|
|
191
|
+
|
|
192
|
+
&#{button.$enabled} {
|
|
193
|
+
color: var(--md-comp-input-chip-trailing-icon-color, var(--md-comp-input-chip-leading-icon-color, currentColor));
|
|
194
|
+
}
|
|
195
|
+
&::before {
|
|
196
|
+
content: "";
|
|
197
|
+
position: absolute;
|
|
198
|
+
inset-block-start: calc((100% - var(--md-sys-target-size, 48px)) / 2);
|
|
199
|
+
inset-inline-start: calc((100% - var(--md-sys-target-size, 48px)) / 2);
|
|
200
|
+
block-size: var(--md-sys-target-size, 48px);
|
|
201
|
+
inline-size: var(--md-sys-target-size, 48px);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
.micl-chip__avatar {
|
|
205
|
+
@include typography.title-medium;
|
|
206
|
+
|
|
207
|
+
display: flex;
|
|
208
|
+
align-items: center;
|
|
209
|
+
justify-content: center;
|
|
210
|
+
block-size: var(--md-comp-input-chip-avatar-size, 24px);
|
|
211
|
+
inline-size: var(--md-comp-input-chip-avatar-size, 24px);
|
|
212
|
+
border-radius: var(--md-comp-input-chip-avatar-shape, var(--md-sys-shape-corner-full, 50%));
|
|
213
|
+
color: var(--md-comp-input-chip-avatar-label-color, var(--md-sys-color-on-primary-container));
|
|
214
|
+
background-color: var(--md-comp-input-chip-avatar-color, var(--md-sys-color-primary-container));
|
|
215
|
+
object-fit: cover;
|
|
216
|
+
object-position: center;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
.micl-chip-filter {
|
|
220
|
+
input {
|
|
221
|
+
position: absolute;
|
|
222
|
+
inset: 0;
|
|
223
|
+
margin: 0;
|
|
224
|
+
opacity: 0;
|
|
225
|
+
cursor: inherit;
|
|
226
|
+
}
|
|
227
|
+
.micl-button__icon + .micl-button__icon {
|
|
228
|
+
margin-inline-start: -8px;
|
|
229
|
+
}
|
|
230
|
+
// If icons have direction:ltr (like Material Symbols), the collapsing margin above always
|
|
231
|
+
// lands on their physical left; in a RTL context it must sit on the right to keep
|
|
232
|
+
// cancelling the gap between the two icons.
|
|
233
|
+
.micl-button__icon + .micl-button__icon:dir(rtl) {
|
|
234
|
+
margin-inline: 0 -8px;
|
|
235
|
+
}
|
|
236
|
+
&:has(input:not(:checked)) {
|
|
237
|
+
.micl-button__icon:has(+ input) {
|
|
238
|
+
inline-size: 0px;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
&:has(input:checked) {
|
|
242
|
+
.micl-button__icon:not(:has(+ input)) {
|
|
243
|
+
inline-size: 0px;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
&:has(input:checked) {
|
|
247
|
+
--micl-chip-statelayer: var(--md-sys-color-on-secondary-container);
|
|
248
|
+
--micl-chip-label: var(--md-comp-filter-chip-selected-label-text-color, var(--md-sys-color-on-secondary-container));
|
|
249
|
+
--micl-chip-icon: var(--md-comp-filter-chip-selected-leading-icon-color, var(--md-sys-color-on-secondary-container));
|
|
250
|
+
--micl-chip-outline: var(--md-comp-filter-chip-selected-container-color, var(--md-sys-color-secondary-container));
|
|
251
|
+
|
|
252
|
+
border-color: transparent;
|
|
253
|
+
background-color: var(--md-comp-filter-chip-selected-container-color, var(--md-sys-color-secondary-container));
|
|
254
|
+
|
|
255
|
+
&:not(.micl-chip--elevated)#{button.$enabled}:hover:not(:active) {
|
|
256
|
+
box-shadow: var(--md-sys-elevation-level1);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
&:not(.micl-chip--elevated):has(input:disabled:checked) {
|
|
260
|
+
background-color: var(--md-comp-filter-chip-disabled-selected-container-color, rgb(from var(--md-sys-color-on-surface) r g b / var(--md-comp-filter-chip-disabled-selected-container-opacity, 12%)));
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
.micl-chip--elevated {
|
|
264
|
+
@extend %micl-button-elevated;
|
|
265
|
+
|
|
266
|
+
--statelayer-color: var(--micl-chip-statelayer, var(--md-sys-color-on-surface-variant));
|
|
267
|
+
--md-comp-elevated-button-container-color: var(--micl-chip-elevated-container, var(--md-sys-color-surface-container-low));
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
.micl-chips--input {
|
|
271
|
+
min-inline-size: 0;
|
|
272
|
+
flex-wrap: nowrap;
|
|
273
|
+
min-inline-size: 0;
|
|
274
|
+
padding: 10px 16px 13px;
|
|
275
|
+
border: 1px solid var(--md-comp-outlined-button-outline-color, var(--md-sys-color-outline-variant));
|
|
276
|
+
border-radius: var(--md-sys-shape-corner-small);
|
|
277
|
+
overflow-x: auto;
|
|
278
|
+
scrollbar-width: thin;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
// If the remove button is direction:ltr (like Material Symbols), its margin-inline resolves
|
|
282
|
+
// against LTR and does not flip with the page direction — mirror the outer margin explicitly.
|
|
283
|
+
.micl-chips .micl-chip__remove:dir(rtl) {
|
|
284
|
+
margin-inline: 5px 0;
|
|
285
|
+
}
|
|
@@ -53,6 +53,10 @@ Import both the date picker and the dialog styles into your project:
|
|
|
53
53
|
|
|
54
54
|
```CSS
|
|
55
55
|
@use "material-inspired-component-library/dist/dialog";
|
|
56
|
+
@use "material-inspired-component-library/dist/textfield";
|
|
57
|
+
@use "material-inspired-component-library/dist/button";
|
|
58
|
+
@use "material-inspired-component-library/dist/iconbutton";
|
|
59
|
+
@use "material-inspired-component-library/dist/divider";
|
|
56
60
|
@use "material-inspired-component-library/dist/datepicker";
|
|
57
61
|
```
|
|
58
62
|
|
|
@@ -67,6 +71,7 @@ This component requires JavaScript to function:
|
|
|
67
71
|
```JavaScript
|
|
68
72
|
import micl from "material-inspired-component-library/dist/micl";
|
|
69
73
|
```
|
|
74
|
+
When loading individual JavaScript files, also load `dist/textfield` — it wires the input field that opens the picker.
|
|
70
75
|
|
|
71
76
|
This will initialize any Date picker component, including those that will be added to the DOM later on.
|
|
72
77
|
|
|
@@ -145,3 +150,77 @@ You can trigger the picker from a button using the standard `popovertarget` attr
|
|
|
145
150
|
|
|
146
151
|
- **Behavior**: The Date picker reads from and writes to the button's value attribute.
|
|
147
152
|
- **Formatting**: The component automatically updates the button's text content with the selected date, formatted according to the user's locale.
|
|
153
|
+
|
|
154
|
+
## Date Range Selection
|
|
155
|
+
Add the `micl-datepicker--range` class to the dialog to let users select a range of dates instead of a single date:
|
|
156
|
+
|
|
157
|
+
```HTML
|
|
158
|
+
<dialog id="myrangepicker" class="micl-dialog micl-datepicker micl-datepicker--range" closedby="closerequest">
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
The first selected date becomes the start of the range and the second one its end. Selecting a date before the start moves the start, and any selection after a completed range starts a new one. Confirming before an end date has been chosen commits a single-day range.
|
|
162
|
+
|
|
163
|
+
### Connecting a Pair of Input Fields
|
|
164
|
+
Connect two date input fields — both referring to the picker in their `data-datepicker` attribute — and identify the field holding the end date in the `data-miclrangeto` attribute of the start field:
|
|
165
|
+
|
|
166
|
+
```HTML
|
|
167
|
+
<input type="date" id="from" data-datepicker="myrangepicker" data-miclrangeto="to">
|
|
168
|
+
<input type="date" id="to" data-datepicker="myrangepicker">
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
- **Behavior**: Clicking either field opens the picker with the range loaded from both fields; reversed values are swapped. Confirming writes both fields and fires their change-events.
|
|
172
|
+
- **Limits**: The earliest allowed date is taken from the `min` attribute of the start field, the latest from the `max` attribute of the end field.
|
|
173
|
+
|
|
174
|
+
### Connecting to a Button
|
|
175
|
+
A single button invoker holds the range in its value attribute as an ISO 8601 time interval. The component updates the button's text content with the localized range:
|
|
176
|
+
|
|
177
|
+
```HTML
|
|
178
|
+
<button type="button" class="micl-button-text-m" popovertarget="myrangepicker" value="2026-01-23/2026-02-06">23.01.2026 – 06.02.2026</button>
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### Text Input Mode
|
|
182
|
+
In range mode, the manual input area holds two [Text field components](../textfield/README.md) instead of being one itself:
|
|
183
|
+
|
|
184
|
+
```HTML
|
|
185
|
+
<div class="micl-datepicker__input">
|
|
186
|
+
<div class="micl-textfield-outlined">
|
|
187
|
+
<label for="rangestart">From</label>
|
|
188
|
+
<input type="text" id="rangestart">
|
|
189
|
+
</div>
|
|
190
|
+
<div class="micl-textfield-outlined">
|
|
191
|
+
<label for="rangeend">To</label>
|
|
192
|
+
<input type="text" id="rangeend">
|
|
193
|
+
</div>
|
|
194
|
+
</div>
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
Entering a start date that lies after the end date swaps the two. The fields cannot be emptied: to discard the end of a range, return to the calendar view and start a new range by selecting any date.
|
|
198
|
+
|
|
199
|
+
## Theming
|
|
200
|
+
Each date picker can be themed with CSS custom properties that follow the Material Design 3 component-token naming convention. The container color, shape and elevation are inherited from the [Dialog component](../dialog/README.md).
|
|
201
|
+
|
|
202
|
+
| Custom property | Meaning | Default |
|
|
203
|
+
|---|---|---|
|
|
204
|
+
| `--md-comp-date-picker-modal-container-width` | The width of the modal date picker | `360px` |
|
|
205
|
+
| `--md-comp-date-input-modal-container-width` | The width of the modal date picker in text input mode | `328px` |
|
|
206
|
+
| `--md-comp-date-picker-docked-container-width` | The width of the docked date picker | `360px` |
|
|
207
|
+
| `--md-comp-date-picker-header-headline-color` | The text color of the headline showing the selected date | `--md-sys-color-on-surface-variant` |
|
|
208
|
+
| `--md-comp-date-picker-weekdays-label-text-color` | The text color of the weekday labels | `--md-sys-color-on-surface` |
|
|
209
|
+
| `--md-comp-date-picker-date-unselected-label-text-color` | The text color of the selectable dates | `--md-sys-color-on-surface` |
|
|
210
|
+
| `--md-comp-date-picker-date-selected-container-color` | The background color of the selected date | `--md-sys-color-primary` |
|
|
211
|
+
| `--md-comp-date-picker-date-selected-label-text-color` | The text color of the selected date | `--md-sys-color-on-primary` |
|
|
212
|
+
| `--md-comp-date-picker-date-today-container-outline-color` | The outline color of today's date | `--md-sys-color-primary` |
|
|
213
|
+
| `--md-comp-date-picker-date-today-label-text-color` | The text color of today's date | `--md-sys-color-primary` |
|
|
214
|
+
| `--md-comp-date-picker-selection-year-unselected-label-text-color` | The text color of the selectable years | `--md-sys-color-on-surface-variant` |
|
|
215
|
+
| `--md-comp-date-picker-selection-year-selected-container-color` | The background color of the selected year | `--md-sys-color-primary` |
|
|
216
|
+
| `--md-comp-date-picker-selection-year-selected-label-text-color` | The text color of the selected year | `--md-sys-color-on-primary` |
|
|
217
|
+
| `--md-comp-date-picker-range-selection-active-indicator-container-color` | The background color of the band connecting the endpoints of a range | `--md-sys-color-secondary-container` |
|
|
218
|
+
| `--md-comp-date-picker-selection-date-in-range-label-text-color` | The text color of the dates inside a range | `--md-sys-color-on-secondary-container` |
|
|
219
|
+
|
|
220
|
+
**Example: Changing the width of the modal date picker**
|
|
221
|
+
|
|
222
|
+
```CSS
|
|
223
|
+
#mydatepicker {
|
|
224
|
+
--md-comp-date-picker-modal-container-width: 400px;
|
|
225
|
+
}
|
|
226
|
+
```
|