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