material-inspired-component-library 3.1.0 → 4.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.
- package/README.md +12 -5
- package/components/README.md +1 -1
- package/components/accordion/README.md +29 -5
- package/components/alert/README.md +76 -0
- package/components/alert/index.scss +1 -0
- package/components/appbar/README.md +9 -4
- package/components/appbar/index.scss +1 -1
- package/components/badge/README.md +8 -3
- package/components/badge/index.scss +1 -0
- package/components/bottomsheet/README.md +8 -3
- package/components/button/README.md +8 -3
- package/components/button/index.scss +7 -0
- package/components/card/README.md +10 -4
- package/components/card/index.scss +1 -1
- package/components/checkbox/README.md +8 -3
- package/components/checkbox/index.scss +2 -0
- package/components/dialog/README.md +8 -3
- package/components/dialog/index.scss +1 -0
- package/components/divider/README.md +8 -3
- package/components/divider/index.scss +2 -2
- package/components/iconbutton/README.md +8 -3
- package/components/iconbutton/index.scss +3 -1
- package/components/list/README.md +26 -19
- package/components/list/index.scss +95 -68
- package/components/menu/README.md +9 -3
- package/components/menu/index.scss +6 -18
- package/components/navigationrail/README.md +8 -3
- package/components/navigationrail/index.scss +1 -0
- package/components/radio/README.md +8 -3
- package/components/radio/index.scss +2 -0
- package/components/select/README.md +10 -5
- package/components/select/index.scss +2 -3
- package/components/sidesheet/README.md +21 -22
- package/components/sidesheet/index.scss +15 -16
- package/components/slider/README.md +8 -3
- package/components/slider/index.scss +1 -0
- package/components/stepper/README.md +190 -0
- package/components/stepper/index.scss +93 -14
- package/components/stepper/index.ts +138 -120
- package/components/switch/README.md +8 -3
- package/components/switch/index.scss +2 -0
- package/components/textfield/README.md +8 -3
- package/components/textfield/index.ts +8 -40
- package/dist/alert.css +1 -1
- package/dist/badge.css +1 -1
- package/dist/button.css +1 -1
- package/dist/card.css +1 -1
- package/dist/checkbox.css +1 -1
- package/dist/components/textfield/index.d.ts +0 -1
- package/dist/dialog.css +1 -1
- package/dist/divider.css +1 -1
- package/dist/foundations/form/index.d.ts +5 -0
- package/dist/iconbutton.css +1 -1
- package/dist/list.css +1 -1
- package/dist/menu.css +1 -1
- package/dist/micl.css +1 -1
- package/dist/micl.js +1 -1
- package/dist/navigationrail.css +1 -1
- package/dist/radio.css +1 -1
- package/dist/select.css +1 -1
- package/dist/sidesheet.css +1 -1
- package/dist/slider.css +1 -1
- package/dist/stepper.css +1 -1
- package/dist/switch.css +1 -1
- package/docs/accordion.html +31 -17
- package/docs/alert.html +3 -8
- package/docs/bottomsheet.html +2 -2
- package/docs/button.html +2 -2
- package/docs/card.html +7 -7
- package/docs/checkbox.html +2 -2
- package/docs/dialog.html +2 -2
- package/docs/divider.html +8 -8
- package/docs/iconbutton.html +2 -2
- package/docs/index.html +53 -39
- package/docs/list.html +54 -46
- package/docs/menu.html +4 -3
- package/docs/micl.css +1 -1
- package/docs/micl.js +1 -1
- package/docs/radio.html +2 -2
- package/docs/select.html +2 -2
- package/docs/sidesheet.html +5 -4
- package/docs/slider.html +2 -2
- package/docs/stepper.html +318 -0
- package/docs/switch.html +8 -4
- package/docs/textfield.html +2 -2
- package/foundations/form/index.ts +174 -0
- package/{layout → foundations/layout}/README.md +5 -0
- package/{layout → foundations/layout}/index.scss +1 -1
- package/micl.ts +1 -3
- package/package.json +4 -4
- package/styles.scss +1 -1
- package/webpack.config.js +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# List
|
|
2
|
-
This component implements the
|
|
2
|
+
This component implements the [Material Design 3 Expressive List](https://m3.material.io/components/lists/overview) design. Lists are continuous, vertical groups of text or images, representing a set of data.
|
|
3
3
|
|
|
4
4
|
## Basic Usage
|
|
5
5
|
|
|
@@ -7,7 +7,7 @@ This component implements the the [Material Design 3 Expressive List](https://m3
|
|
|
7
7
|
To create a basic list, use the `<ul>` element with the `micl-list` class and individual `<li>` elements for each list item. For a basic single-line item, use the `micl-list-item-one` class:
|
|
8
8
|
|
|
9
9
|
```HTML
|
|
10
|
-
<ul class="micl-list"
|
|
10
|
+
<ul class="micl-list">
|
|
11
11
|
<li class="micl-list-item-one" tabindex="0">
|
|
12
12
|
<span class="micl-list-item__text">
|
|
13
13
|
<span class="micl-list-item__headline">A single-line item</span>
|
|
@@ -16,8 +16,6 @@ To create a basic list, use the `<ul>` element with the `micl-list` class and in
|
|
|
16
16
|
</ul>
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
- The `role="listbox"` is used for accessibility, indicating a selectable list.
|
|
20
|
-
|
|
21
19
|
- `tabindex="0"` on the `<li>` makes the list item focusable and allows keyboard navigation.
|
|
22
20
|
|
|
23
21
|
### CSS
|
|
@@ -27,6 +25,11 @@ Import the list styles into your project:
|
|
|
27
25
|
@use "material-inspired-component-library/dist/list";
|
|
28
26
|
```
|
|
29
27
|
|
|
28
|
+
Or import all MICL styles:
|
|
29
|
+
```CSS
|
|
30
|
+
@use "material-inspired-component-library/styles";
|
|
31
|
+
```
|
|
32
|
+
|
|
30
33
|
### JavaScript
|
|
31
34
|
This component requires JavaScript to support keyboard navigation:
|
|
32
35
|
|
|
@@ -36,8 +39,8 @@ import micl from "material-inspired-component-library/dist/micl";
|
|
|
36
39
|
|
|
37
40
|
This will initialize any List component, including those that will be added to the DOM later on.
|
|
38
41
|
|
|
39
|
-
### Demo
|
|
40
|
-
A live example of the [List component](https://henkpb.github.io/micl/list.html) is available
|
|
42
|
+
### Live Demo
|
|
43
|
+
A live example of the [List component](https://henkpb.github.io/micl/list.html) is available to interact with.
|
|
41
44
|
|
|
42
45
|
## Variants
|
|
43
46
|
The List component offers three CSS classes to control the height and content capacity of individual list items:
|
|
@@ -49,8 +52,8 @@ The List component offers three CSS classes to control the height and content ca
|
|
|
49
52
|
| micl-list-item-three | For three-line items, accommodating up to three lines of text. |
|
|
50
53
|
|
|
51
54
|
```HTML
|
|
52
|
-
<ul class="micl-list"
|
|
53
|
-
<li class="micl-list-item-three"
|
|
55
|
+
<ul class="micl-list">
|
|
56
|
+
<li class="micl-list-item-three">
|
|
54
57
|
<span class="micl-list-item__text">
|
|
55
58
|
<span class="micl-list-item__headline">A three-line item</span>
|
|
56
59
|
<span class="micl-list-item__supporting-text">Supporting text that is long enough to fill up multiple lines of text with words and sentences.</span>
|
|
@@ -62,7 +65,7 @@ The List component offers three CSS classes to control the height and content ca
|
|
|
62
65
|
Use the anchor element to convert a list item into a hyperlink:
|
|
63
66
|
|
|
64
67
|
```HTML
|
|
65
|
-
<ul class="micl-list"
|
|
68
|
+
<ul class="micl-list">
|
|
66
69
|
<li class="micl-list-item-one" tabindex="0">
|
|
67
70
|
<a href="https://www.thetimes.com" tabindex="-1">
|
|
68
71
|
<span class="micl-list-item__text">
|
|
@@ -75,14 +78,14 @@ Use the anchor element to convert a list item into a hyperlink:
|
|
|
75
78
|
|
|
76
79
|
Adding the `micl-list-item--disabled` class to the `<li>` element causes the list item to be displayed in a disabled state.
|
|
77
80
|
|
|
78
|
-
|
|
81
|
+
Use a [Divider component](../divider/README.md) to separate neighbouring list items by a divider.
|
|
79
82
|
|
|
80
83
|
### Leading Content
|
|
81
84
|
The text content of a list item can be preceded by various media elements:
|
|
82
85
|
|
|
83
86
|
- **Icon**: Use `micl-list-item__icon` with a (Material Symbols) icon.
|
|
84
87
|
```HTML
|
|
85
|
-
<li class="micl-list-item-two"
|
|
88
|
+
<li class="micl-list-item-two">
|
|
86
89
|
<span class="material-symbols-outlined micl-list-item__icon" aria-hidden="true">person</span>
|
|
87
90
|
<span class="micl-list-item__text">
|
|
88
91
|
<span class="micl-list-item__headline">Bill Jones</span>
|
|
@@ -93,7 +96,7 @@ The text content of a list item can be preceded by various media elements:
|
|
|
93
96
|
|
|
94
97
|
- **Avatar**: Use `micl-list-item__avatar` with a text.
|
|
95
98
|
```HTML
|
|
96
|
-
<li class="micl-list-item-two"
|
|
99
|
+
<li class="micl-list-item-two">
|
|
97
100
|
<span class="micl-list-item__avatar">BJ</span>
|
|
98
101
|
<span class="micl-list-item__text">
|
|
99
102
|
<span class="micl-list-item__headline">Bill Jones</span>
|
|
@@ -104,7 +107,7 @@ The text content of a list item can be preceded by various media elements:
|
|
|
104
107
|
|
|
105
108
|
- **Image**: Use `micl-list-item__image` with a background image.
|
|
106
109
|
```HTML
|
|
107
|
-
<li class="micl-list-item-two"
|
|
110
|
+
<li class="micl-list-item-two">
|
|
108
111
|
<span class="micl-list-item__image" style="background-image:url(https://...jpg)"></span>
|
|
109
112
|
<span class="micl-list-item__text">
|
|
110
113
|
<span class="micl-list-item__headline">Bill Jones</span>
|
|
@@ -115,7 +118,7 @@ The text content of a list item can be preceded by various media elements:
|
|
|
115
118
|
|
|
116
119
|
- **Thumbnail (Video)**: Use `micl-list-item__thumbnail` for video previews with a background-image.
|
|
117
120
|
```HTML
|
|
118
|
-
<li class="micl-list-item-two"
|
|
121
|
+
<li class="micl-list-item-two">
|
|
119
122
|
<span class="micl-list-item__thumbnail" style="background-image:url(https://...mp4)"></span>
|
|
120
123
|
<span class="micl-list-item__text">
|
|
121
124
|
<span class="micl-list-item__headline">Bill Jones</span>
|
|
@@ -140,7 +143,7 @@ The text of a list item may be followed by a trailing text, imagery or other ele
|
|
|
140
143
|
|
|
141
144
|
- **Text**: Use `micl-list-item__trailing-text` with a short text.
|
|
142
145
|
```HTML
|
|
143
|
-
<li class="micl-list-item-one"
|
|
146
|
+
<li class="micl-list-item-one">
|
|
144
147
|
<span class="micl-list-item__text">
|
|
145
148
|
<span class="micl-list-item__headline">To-do items</span>
|
|
146
149
|
</span>
|
|
@@ -149,10 +152,10 @@ The text of a list item may be followed by a trailing text, imagery or other ele
|
|
|
149
152
|
````
|
|
150
153
|
|
|
151
154
|
### Selecting List Items
|
|
152
|
-
To enable selection of list items, integrate a
|
|
155
|
+
To enable selection of list items, integrate a Checkbox or Switch component within the `<li>` element.
|
|
153
156
|
|
|
154
157
|
```HTML
|
|
155
|
-
<ul class="micl-list
|
|
158
|
+
<ul class="micl-list" role="listbox">
|
|
156
159
|
<li class="micl-list-item-two" tabindex="0">
|
|
157
160
|
<label>
|
|
158
161
|
<span class="micl-list-item__text">
|
|
@@ -162,7 +165,8 @@ To enable selection of list items, integrate a checkbox or switch component with
|
|
|
162
165
|
<input type="checkbox" id="mycheckbox" class="micl-checkbox" value="cb1" tabindex="-1" aria-labelledby="hd1">
|
|
163
166
|
</span>
|
|
164
167
|
</li>
|
|
165
|
-
<li
|
|
168
|
+
<li role="separator" class="micl-divider"></li>
|
|
169
|
+
<li class="micl-list-item-two">
|
|
166
170
|
<label>
|
|
167
171
|
<span class="micl-list-item__text">
|
|
168
172
|
<span id="hd2" class="micl-list-item__headline">Red car</span>
|
|
@@ -176,11 +180,14 @@ To enable selection of list items, integrate a checkbox or switch component with
|
|
|
176
180
|
|
|
177
181
|
- `tabindex="-1"` on the `input` is important here, as the `<li>` should handle the focus for accessibility.
|
|
178
182
|
|
|
183
|
+
- The `role="listbox"` is used for accessibility, indicating a selectable list.
|
|
184
|
+
|
|
179
185
|
## Customizations
|
|
180
186
|
You can customize the appearance of the List 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 lists.
|
|
181
187
|
|
|
182
188
|
| Variable name | Default Value | Description |
|
|
183
189
|
| ------------- | ------------- | ----------- |
|
|
190
|
+
| --md-sys-list-padding | 8px | The vertical padding of a list. |
|
|
184
191
|
| --md-sys-list-item-one-height | 56px | The height for a single-line list item. |
|
|
185
192
|
| --md-sys-list-item-two-height | 72px | The height for a two-line list item. |
|
|
186
193
|
| --md-sys-list-item-three-height | 88px | The height for a three-line list item. |
|
|
@@ -194,7 +201,7 @@ You can customize the appearance of the List component by overriding its global
|
|
|
194
201
|
```HTML
|
|
195
202
|
<div style="--md-sys-list-item-one-height:60px">
|
|
196
203
|
<ul class="micl-list">
|
|
197
|
-
<li class="micl-list-item-one"
|
|
204
|
+
<li class="micl-list-item-one">
|
|
198
205
|
<span class="micl-list-item__text">
|
|
199
206
|
<span class="micl-list-item__headline">A single-line item</span>
|
|
200
207
|
</span>
|
|
@@ -19,6 +19,7 @@
|
|
|
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 '../../foundations/layout';
|
|
22
23
|
@use '../../styles/motion';
|
|
23
24
|
@use '../../styles/shapes';
|
|
24
25
|
@use '../../styles/statelayer';
|
|
@@ -41,28 +42,34 @@
|
|
|
41
42
|
--md-sys-list-motion-duration: #{motion.$md-sys-motion-expressive-default-effects-duration};
|
|
42
43
|
--md-sys-accordion-motion-spatial: #{motion.$md-sys-motion-expressive-default-spatial};
|
|
43
44
|
--md-sys-accordion-motion-duration: #{motion.$md-sys-motion-expressive-default-spatial-duration};
|
|
45
|
+
--md-sys-divider-space: 8px;
|
|
44
46
|
|
|
45
47
|
margin: 0;
|
|
46
|
-
padding: var(--md-sys-list-padding) 0;
|
|
48
|
+
padding: var(--md-sys-list-padding, 8px) 0;
|
|
47
49
|
interpolate-size: allow-keywords;
|
|
48
50
|
list-style-type: none;
|
|
51
|
+
overflow-x: hidden;
|
|
49
52
|
|
|
50
53
|
&> details {
|
|
51
54
|
&::details-content {
|
|
52
|
-
|
|
55
|
+
block-size: 0;
|
|
53
56
|
overflow: hidden;
|
|
54
57
|
transition:
|
|
55
|
-
|
|
58
|
+
block-size var( --md-sys-accordion-motion-duration) var(--md-sys-accordion-motion-spatial),
|
|
56
59
|
content-visibility var(--md-sys-accordion-motion-duration) linear allow-discrete;
|
|
57
60
|
}
|
|
58
61
|
&[open]::details-content {
|
|
59
|
-
|
|
62
|
+
block-size: auto;
|
|
63
|
+
}
|
|
64
|
+
&[open] .micl-list-item__icon--expander {
|
|
65
|
+
transform: rotate(180deg);
|
|
60
66
|
}
|
|
61
67
|
|
|
62
68
|
&> summary.micl-list-item-one,
|
|
63
69
|
&> summary.micl-list-item-two,
|
|
64
70
|
&> summary.micl-list-item-three {
|
|
65
71
|
position: relative;
|
|
72
|
+
-webkit-tap-highlight-color: transparent;
|
|
66
73
|
|
|
67
74
|
&::-webkit-details-marker {
|
|
68
75
|
display: none;
|
|
@@ -76,18 +83,51 @@
|
|
|
76
83
|
}
|
|
77
84
|
.micl-list-item__content {
|
|
78
85
|
box-sizing: border-box;
|
|
79
|
-
padding-inline: var(--md-sys-list-item-padding-inline);
|
|
86
|
+
padding-inline: var(--md-sys-list-item-padding-inline, 16px);
|
|
80
87
|
background-color: var(--md-sys-list-item-container-color);
|
|
81
88
|
overflow: hidden;
|
|
82
89
|
}
|
|
83
90
|
}
|
|
84
91
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
92
|
+
li.micl-divider {
|
|
93
|
+
box-shadow: 0 -4px 0 3px var(--md-sys-list-item-container-color),
|
|
94
|
+
0 4px 0 4px var(--md-sys-list-item-container-color);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.micl-list:has(.micl-list-item-one[tabindex], .micl-list-item-two[tabindex], .micl-list-item-three[tabindex]),
|
|
99
|
+
select {
|
|
100
|
+
.micl-list-item-one:not(:disabled):not(.micl-list-item--disabled),
|
|
101
|
+
.micl-list-item-two:not(:disabled):not(.micl-list-item--disabled),
|
|
102
|
+
.micl-list-item-three:not(:disabled):not(.micl-list-item--disabled) {
|
|
103
|
+
cursor: pointer;
|
|
104
|
+
|
|
105
|
+
&:hover {
|
|
106
|
+
--statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity);
|
|
107
|
+
|
|
108
|
+
.micl-list-item__icon {
|
|
109
|
+
font-variation-settings: 'FILL' 1;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
&:focus-visible {
|
|
113
|
+
--statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity);
|
|
114
|
+
|
|
115
|
+
outline: var(--md-sys-state-focus-indicator-thickness) solid var(--md-sys-color-secondary);
|
|
116
|
+
outline-offset: var(--md-sys-state-focus-indicator-inner-offset);
|
|
117
|
+
|
|
118
|
+
.micl-list-item__icon {
|
|
119
|
+
font-variation-settings: 'FILL' 1;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
&:active {
|
|
123
|
+
--statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity);
|
|
124
|
+
|
|
125
|
+
background-size: 0%, 100%;
|
|
126
|
+
transition: background-size 0ms;
|
|
127
|
+
|
|
128
|
+
.micl-list-item__icon {
|
|
129
|
+
font-variation-settings: 'FILL' 1;
|
|
130
|
+
}
|
|
91
131
|
}
|
|
92
132
|
}
|
|
93
133
|
}
|
|
@@ -101,10 +141,11 @@
|
|
|
101
141
|
box-sizing: border-box;
|
|
102
142
|
display: flex;
|
|
103
143
|
align-items: center;
|
|
104
|
-
column-gap: var(--md-sys-list-item-space);
|
|
105
|
-
padding-inline: var(--md-sys-list-item-space);
|
|
144
|
+
column-gap: var(--md-sys-list-item-space, 16px);
|
|
145
|
+
padding-inline: var(--md-sys-list-item-space, 16px);
|
|
106
146
|
border: none;
|
|
107
147
|
border-radius: var(--md-sys-shape-corner-none, 0px);
|
|
148
|
+
outline: none;
|
|
108
149
|
background-color: var(--md-sys-list-item-container-color);
|
|
109
150
|
background-image:
|
|
110
151
|
radial-gradient(circle at var(--micl-x, center) var(--micl-y, center), transparent 0%, rgb(from var(--statelayer-color) r g b / var(--statelayer-opacity)) 10%, transparent 10%),
|
|
@@ -126,9 +167,9 @@
|
|
|
126
167
|
display: inherit;
|
|
127
168
|
align-items: inherit;
|
|
128
169
|
column-gap: inherit;
|
|
129
|
-
min-
|
|
170
|
+
min-block-size: inherit;
|
|
130
171
|
inline-size: 100%;
|
|
131
|
-
padding-inline: var(--md-sys-list-item-space);
|
|
172
|
+
padding-inline: var(--md-sys-list-item-space, 16px);
|
|
132
173
|
border: none;
|
|
133
174
|
border-radius: inherit;
|
|
134
175
|
background-color: transparent;
|
|
@@ -141,9 +182,9 @@
|
|
|
141
182
|
&:disabled,
|
|
142
183
|
&.micl-list-item--disabled {
|
|
143
184
|
.micl-list-item__icon,
|
|
185
|
+
.micl-list-item__headline,
|
|
186
|
+
.micl-list-item__supporting-text,
|
|
144
187
|
.micl-list-item__text,
|
|
145
|
-
.micl-list-item__text .micl-list-item__headline,
|
|
146
|
-
.micl-list-item__text .micl-list-item__supporting-text,
|
|
147
188
|
.micl-list-item__text::after,
|
|
148
189
|
.micl-list-item__trailing-text {
|
|
149
190
|
color: rgb(from var(--md-sys-color-on-surface) r g b / 38%);
|
|
@@ -158,36 +199,6 @@
|
|
|
158
199
|
}
|
|
159
200
|
}
|
|
160
201
|
&:not(:disabled):not(.micl-list-item--disabled) {
|
|
161
|
-
&:hover {
|
|
162
|
-
--statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity);
|
|
163
|
-
|
|
164
|
-
&:has(input[type=checkbox]) {
|
|
165
|
-
cursor: pointer;
|
|
166
|
-
}
|
|
167
|
-
.micl-list-item__icon {
|
|
168
|
-
font-variation-settings: 'FILL' 1;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
&:focus-visible {
|
|
172
|
-
--statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity);
|
|
173
|
-
|
|
174
|
-
outline: var(--md-sys-state-focus-indicator-thickness) solid var(--md-sys-color-secondary);
|
|
175
|
-
outline-offset: var(--md-sys-state-focus-indicator-inner-offset);
|
|
176
|
-
|
|
177
|
-
.micl-list-item__icon {
|
|
178
|
-
font-variation-settings: 'FILL' 1;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
&:active {
|
|
182
|
-
--statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity);
|
|
183
|
-
|
|
184
|
-
background-size: 0%, 100%;
|
|
185
|
-
transition: background-size 0ms;
|
|
186
|
-
|
|
187
|
-
.micl-list-item__icon {
|
|
188
|
-
font-variation-settings: 'FILL' 1;
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
202
|
&:has(input[type=checkbox]:checked) {
|
|
192
203
|
background-color: var(--md-sys-color-secondary-container);
|
|
193
204
|
|
|
@@ -202,14 +213,17 @@
|
|
|
202
213
|
}
|
|
203
214
|
input[type=checkbox]:not(:disabled):hover,
|
|
204
215
|
input[type=checkbox]:not(:disabled):active {
|
|
205
|
-
--
|
|
206
|
-
|
|
216
|
+
--statelayer-opacity: 0%;
|
|
217
|
+
|
|
218
|
+
&.micl-switch::after {
|
|
219
|
+
border-color: transparent;
|
|
220
|
+
}
|
|
207
221
|
}
|
|
208
222
|
}
|
|
209
223
|
}
|
|
210
224
|
|
|
211
225
|
.micl-list-item-one {
|
|
212
|
-
min-
|
|
226
|
+
min-block-size: var(--md-sys-list-item-one-height);
|
|
213
227
|
|
|
214
228
|
&:not(:has(> a,> button,> label)) {
|
|
215
229
|
padding-block-start: var(--md-sys-list-item-one-padding);
|
|
@@ -235,7 +249,7 @@
|
|
|
235
249
|
}
|
|
236
250
|
}
|
|
237
251
|
.micl-list-item-two {
|
|
238
|
-
min-
|
|
252
|
+
min-block-size: var(--md-sys-list-item-two-height);
|
|
239
253
|
|
|
240
254
|
&:not(:has(> a,> button,> label)) {
|
|
241
255
|
padding-block-start: var(--md-sys-list-item-two-padding);
|
|
@@ -264,9 +278,16 @@
|
|
|
264
278
|
overflow: hidden;
|
|
265
279
|
text-overflow: ellipsis;
|
|
266
280
|
}
|
|
281
|
+
input[type=checkbox].micl-checkbox {
|
|
282
|
+
block-size: 24px;
|
|
283
|
+
min-block-size: 24px;
|
|
284
|
+
inline-size: 24px;
|
|
285
|
+
min-inline-size: 24px;
|
|
286
|
+
}
|
|
267
287
|
}
|
|
268
288
|
.micl-list-item-three {
|
|
269
|
-
min-
|
|
289
|
+
min-block-size: var(--md-sys-list-item-three-height);
|
|
290
|
+
align-items: flex-start;
|
|
270
291
|
|
|
271
292
|
&:not(:has(> a,> button,> label)) {
|
|
272
293
|
padding-block-start: var(--md-sys-list-item-three-padding);
|
|
@@ -290,29 +311,31 @@
|
|
|
290
311
|
padding-inline-start: 0px;
|
|
291
312
|
}
|
|
292
313
|
}
|
|
293
|
-
.micl-list-item__icon,
|
|
294
|
-
.micl-list-item__avatar,
|
|
295
|
-
.micl-list-item__image {
|
|
296
|
-
align-self: flex-start;
|
|
297
|
-
}
|
|
298
314
|
.micl-list-item__supporting-text {
|
|
299
315
|
display: -webkit-box;
|
|
300
316
|
overflow: hidden;
|
|
301
317
|
-webkit-box-orient: vertical;
|
|
302
318
|
-webkit-line-clamp: 2;
|
|
303
319
|
}
|
|
304
|
-
input[type=checkbox] {
|
|
305
|
-
|
|
306
|
-
|
|
320
|
+
input[type=checkbox].micl-checkbox {
|
|
321
|
+
block-size: 24px;
|
|
322
|
+
min-block-size: 24px;
|
|
323
|
+
inline-size: 24px;
|
|
324
|
+
min-inline-size: 24px;
|
|
307
325
|
}
|
|
308
326
|
}
|
|
309
327
|
|
|
310
328
|
.micl-list-item__icon {
|
|
311
|
-
min-
|
|
329
|
+
min-inline-size: var(--md-sys-layout-icon-size, 24px);
|
|
312
330
|
font-size: var(--md-sys-layout-icon-size, 24px);
|
|
313
331
|
font-variation-settings: 'FILL' 0;
|
|
314
332
|
color: var(--md-sys-color-on-surface-variant);
|
|
315
333
|
transition: font-variation-settings var(--md-sys-list-motion-duration) linear;
|
|
334
|
+
|
|
335
|
+
&.micl-list-item__icon--expander {
|
|
336
|
+
transform: rotate(0deg);
|
|
337
|
+
transition: transform var(--md-sys-list-motion-duration) linear;
|
|
338
|
+
}
|
|
316
339
|
}
|
|
317
340
|
.micl-list-item__avatar {
|
|
318
341
|
@include typography.title-medium;
|
|
@@ -322,14 +345,14 @@
|
|
|
322
345
|
justify-content: center;
|
|
323
346
|
block-size: 40px;
|
|
324
347
|
min-inline-size: 40px;
|
|
325
|
-
border-radius: var(--md-sys-shape-corner-full);
|
|
348
|
+
border-radius: var(--md-sys-shape-corner-full, 50%);
|
|
326
349
|
color: var(--md-sys-color-on-primary-container);
|
|
327
350
|
background-color: var(--md-sys-color-primary-container);
|
|
328
351
|
}
|
|
329
352
|
.micl-list-item__image {
|
|
330
353
|
display: inline-block;
|
|
331
|
-
|
|
332
|
-
min-
|
|
354
|
+
block-size: 56px;
|
|
355
|
+
min-inline-size: 56px;
|
|
333
356
|
border-radius: var(--md-sys-shape-corner-none, 0px);
|
|
334
357
|
background-position: center;
|
|
335
358
|
background-repeat: no-repeat;
|
|
@@ -337,19 +360,19 @@
|
|
|
337
360
|
}
|
|
338
361
|
.micl-list-item__thumbnail {
|
|
339
362
|
display: inline-block;
|
|
340
|
-
|
|
341
|
-
min-
|
|
363
|
+
block-size: 64px;
|
|
364
|
+
min-inline-size: calc(64px * var(--md-sys-list-item-thumbnail-aspect-ratio));
|
|
342
365
|
border-radius: var(--md-sys-shape-corner-none, 0px);
|
|
343
366
|
background-position: center;
|
|
344
367
|
background-repeat: no-repeat;
|
|
345
|
-
background-size:
|
|
368
|
+
background-size: cover;
|
|
346
369
|
}
|
|
347
370
|
|
|
348
371
|
.micl-list-item__text {
|
|
349
372
|
display: flex;
|
|
350
373
|
flex-direction: column;
|
|
351
374
|
flex-basis: 100%;
|
|
352
|
-
min-
|
|
375
|
+
min-inline-size: 0;
|
|
353
376
|
text-align: start;
|
|
354
377
|
|
|
355
378
|
.micl-list-item__headline {
|
|
@@ -369,3 +392,7 @@
|
|
|
369
392
|
|
|
370
393
|
color: var(--md-sys-color-on-surface-variant);
|
|
371
394
|
}
|
|
395
|
+
|
|
396
|
+
[dir=rtl] .micl-list details[open] .micl-list-item__icon--expander {
|
|
397
|
+
transform: rotate(-180deg);
|
|
398
|
+
}
|
|
@@ -28,6 +28,11 @@ Import the styles for both the menu and list components into your project:
|
|
|
28
28
|
@use "material-inspired-component-library/dist/menu";
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
+
Or import all MICL styles:
|
|
32
|
+
```CSS
|
|
33
|
+
@use "material-inspired-component-library/styles";
|
|
34
|
+
```
|
|
35
|
+
|
|
31
36
|
### JavaScript
|
|
32
37
|
This component requires JavaScript for functionality:
|
|
33
38
|
|
|
@@ -37,8 +42,8 @@ import micl from "material-inspired-component-library/dist/micl";
|
|
|
37
42
|
|
|
38
43
|
This will initialize any Menu component, including those that will be added to the DOM later on.
|
|
39
44
|
|
|
40
|
-
### Demo
|
|
41
|
-
A live example of the [Menu component](https://henkpb.github.io/micl/menu.html) is available
|
|
45
|
+
### Live Demo
|
|
46
|
+
A live example of the [Menu component](https://henkpb.github.io/micl/menu.html) is available to interact with.
|
|
42
47
|
|
|
43
48
|
## Variants
|
|
44
49
|
Since the Menu component is based on the **List component**, all of its list item variants and content features can be used. You can incorporate icons, avatars, images, multiple lines of text, and more.
|
|
@@ -108,6 +113,7 @@ A menu item may trigger opening a submenu when invoked by a button. Wrap the men
|
|
|
108
113
|
<span class="micl-list-item__headline">Item 1-1</span>
|
|
109
114
|
</span>
|
|
110
115
|
</li>
|
|
116
|
+
<li role="separator" class="micl-divider"></li>
|
|
111
117
|
<li class="micl-list-item-one" tabindex="0">
|
|
112
118
|
<span class="micl-list-item__text">
|
|
113
119
|
<span class="micl-list-item__headline">Item 1-2</span>
|
|
@@ -127,7 +133,7 @@ A menu item may trigger opening a submenu when invoked by a button. Wrap the men
|
|
|
127
133
|
|
|
128
134
|
Adding the `micl-list-item--disabled` class to a menu item causes the item to be displayed in a disabled state.
|
|
129
135
|
|
|
130
|
-
|
|
136
|
+
Use a [Divider component](../divider/README.md) to separate neighbouring menu items by a divider.
|
|
131
137
|
|
|
132
138
|
## Customizations
|
|
133
139
|
You can customize the appearance of the Menu 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 menus.
|
|
@@ -37,11 +37,12 @@
|
|
|
37
37
|
inset-block-start: anchor(end);
|
|
38
38
|
inset-inline-start: anchor(start);
|
|
39
39
|
position-try: most-block-size flip-block, flip-inline;
|
|
40
|
-
min-
|
|
41
|
-
max-
|
|
40
|
+
min-inline-size: var(--md-sys-menu-width-min, 112px);
|
|
41
|
+
max-inline-size: var(--md-sys-menu-width-max, 280px);
|
|
42
42
|
padding: 0;
|
|
43
43
|
border: none;
|
|
44
44
|
border-radius: var(--md-sys-shape-corner-extra-small);
|
|
45
|
+
outline: none;
|
|
45
46
|
background-color: var(--md-sys-color-surface-container);
|
|
46
47
|
box-shadow: var(--md-sys-elevation-level2);
|
|
47
48
|
opacity: 0;
|
|
@@ -84,7 +85,6 @@
|
|
|
84
85
|
}
|
|
85
86
|
|
|
86
87
|
&> .micl-list {
|
|
87
|
-
--md-sys-list-padding: 4px;
|
|
88
88
|
--md-sys-list-item-one-height: 48px;
|
|
89
89
|
--md-sys-list-item-one-padding: 0;
|
|
90
90
|
--md-sys-list-item-two-padding: 0;
|
|
@@ -94,21 +94,6 @@
|
|
|
94
94
|
.micl-list-item-one,
|
|
95
95
|
.micl-list-item-two,
|
|
96
96
|
.micl-list-item-three {
|
|
97
|
-
&.micl-list-item__divider {
|
|
98
|
-
position: relative;
|
|
99
|
-
margin-block-start: 16px;
|
|
100
|
-
overflow: clip;
|
|
101
|
-
overflow-clip-margin: 8px;
|
|
102
|
-
|
|
103
|
-
&::after {
|
|
104
|
-
content: "";
|
|
105
|
-
position: absolute;
|
|
106
|
-
inset-block-start: -8px;
|
|
107
|
-
inset-inline-start: 0;
|
|
108
|
-
width: 100%;
|
|
109
|
-
border-top: var(--md-sys-divider-thickness) solid var(--md-sys-divider-color);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
97
|
&> .micl-menu[popover] {
|
|
113
98
|
transform: scaleX(0);
|
|
114
99
|
|
|
@@ -129,3 +114,6 @@
|
|
|
129
114
|
}
|
|
130
115
|
}
|
|
131
116
|
|
|
117
|
+
[dir=rtl] .micl-menu[popover] > .micl-list button[popovertarget] .micl-list-item__icon {
|
|
118
|
+
transform: rotate(180deg);
|
|
119
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Navigation rail
|
|
2
|
-
This component implements the
|
|
2
|
+
This component implements the [Material Design 3 Expressive Navigation rail](https://m3.material.io/components/navigation-rail/overview) design.
|
|
3
3
|
|
|
4
4
|
## Basic Usage
|
|
5
5
|
|
|
@@ -30,6 +30,11 @@ Import the navigation rail styles into your project:
|
|
|
30
30
|
@use "material-inspired-component-library/dist/navigationrail";
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
+
Or import all MICL styles:
|
|
34
|
+
```CSS
|
|
35
|
+
@use "material-inspired-component-library/styles";
|
|
36
|
+
```
|
|
37
|
+
|
|
33
38
|
### JavaScript
|
|
34
39
|
This component requires JavaScript to support keyboard navigation. The library will automatically initialize new components as they're added to the DOM.
|
|
35
40
|
|
|
@@ -37,8 +42,8 @@ This component requires JavaScript to support keyboard navigation. The library w
|
|
|
37
42
|
import micl from "material-inspired-component-library/dist/micl";
|
|
38
43
|
```
|
|
39
44
|
|
|
40
|
-
### Demo
|
|
41
|
-
A live example of the [Navigation rail component](https://henkpb.github.io/micl/navigationrail.html) is available
|
|
45
|
+
### Live Demo
|
|
46
|
+
A live example of the [Navigation rail component](https://henkpb.github.io/micl/navigationrail.html) is available to interact with.
|
|
42
47
|
|
|
43
48
|
## Variants
|
|
44
49
|
The basic example creates a **collapsed** navigation rail. Add a menu button to allow the user to toggle between a **collapsed** and an **expanded** view.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Radio button
|
|
2
|
-
This component implements the
|
|
2
|
+
This component implements the [Material Design 3 Expressive Radio button](https://m3.material.io/components/radio-button/overview) design. A radio button allows a user to select only one option from a group of mutually exclusive choices.
|
|
3
3
|
|
|
4
4
|
## Basic Usage
|
|
5
5
|
|
|
@@ -18,11 +18,16 @@ Import the radio button styles into your project:
|
|
|
18
18
|
@use "material-inspired-component-library/dist/radio";
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
+
Or import all MICL styles:
|
|
22
|
+
```CSS
|
|
23
|
+
@use "material-inspired-component-library/styles";
|
|
24
|
+
```
|
|
25
|
+
|
|
21
26
|
### JavaScript
|
|
22
27
|
No custom JavaScript is required for the core functionality of this component.
|
|
23
28
|
|
|
24
|
-
### Demo
|
|
25
|
-
A live example of the [Radio button component](https://henkpb.github.io/micl/radio.html) is available
|
|
29
|
+
### Live Demo
|
|
30
|
+
A live example of the [Radio button component](https://henkpb.github.io/micl/radio.html) is available to interact with.
|
|
26
31
|
|
|
27
32
|
## Variants
|
|
28
33
|
A radio button can be disabled by adding the `disabled` attribute to the `<input>` element.
|
|
@@ -45,6 +45,7 @@ input[type=radio].micl-radio {
|
|
|
45
45
|
border: calc((var(--md-sys-target-size) - var(--md-sys-radio-state-layer-size)) / 2) solid transparent;
|
|
46
46
|
background-clip: content-box;
|
|
47
47
|
background-color: transparent;
|
|
48
|
+
-webkit-tap-highlight-color: transparent;
|
|
48
49
|
border-radius: var(--md-sys-shape-corner-full);
|
|
49
50
|
outline-offset: -7px;
|
|
50
51
|
|
|
@@ -129,6 +130,7 @@ input[type=radio].micl-radio {
|
|
|
129
130
|
|
|
130
131
|
input[type=radio].micl-radio:not(:disabled) + label,
|
|
131
132
|
label:has(+ input[type=radio].micl-radio:not(:disabled)) {
|
|
133
|
+
-webkit-tap-highlight-color: transparent;
|
|
132
134
|
cursor: pointer;
|
|
133
135
|
}
|
|
134
136
|
input[type=radio].micl-radio + label,
|