material-inspired-component-library 2.0.0 → 3.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/CODE_OF_CONDUCT.md +128 -0
- package/README.md +14 -0
- package/components/README.md +2 -0
- package/components/appbar/README.md +94 -0
- package/components/appbar/index.scss +216 -0
- package/components/badge/README.md +5 -5
- package/components/badge/index.scss +20 -27
- package/components/bottomsheet/README.md +29 -17
- package/components/bottomsheet/index.scss +23 -23
- package/components/bottomsheet/index.ts +25 -24
- package/components/button/README.md +1 -1
- package/components/button/index.scss +70 -65
- package/components/button/index.ts +1 -1
- package/components/card/index.scss +1 -1
- package/components/checkbox/index.scss +4 -0
- package/components/dialog/README.md +9 -9
- package/components/iconbutton/index.scss +111 -111
- package/components/iconbutton/index.ts +1 -1
- package/components/navigationrail/README.md +16 -16
- package/components/navigationrail/index.scss +20 -12
- package/components/radio/index.scss +1 -1
- package/components/sidesheet/README.md +32 -17
- package/components/sidesheet/index.scss +43 -47
- package/components/slider/README.md +5 -5
- package/dist/appbar.css +1 -0
- package/dist/appbar.js +1 -0
- package/dist/badge.css +1 -1
- package/dist/bottomsheet.css +1 -1
- package/dist/button.css +1 -1
- package/dist/card.css +1 -1
- package/dist/checkbox.css +1 -1
- package/dist/dialog.css +1 -1
- package/dist/iconbutton.css +1 -1
- package/dist/list.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/switch.css +1 -1
- package/dist/textfield.css +1 -1
- package/docs/accordion.html +298 -254
- package/docs/bottomsheet.html +194 -114
- package/docs/button.html +210 -182
- package/docs/card.html +107 -72
- package/docs/checkbox.html +92 -65
- package/docs/dialog.html +154 -123
- package/docs/divider.html +96 -67
- package/docs/docs.css +14 -24
- package/docs/docs.js +4 -2
- package/docs/iconbutton.html +196 -171
- package/docs/index.html +298 -288
- package/docs/list.html +260 -216
- package/docs/menu.html +260 -220
- package/docs/micl.css +1 -1
- package/docs/micl.js +1 -1
- package/docs/navigationrail.html +38 -36
- package/docs/radio.html +93 -68
- package/docs/select.html +213 -173
- package/docs/sidesheet.html +105 -73
- package/docs/slider.html +105 -72
- package/docs/switch.html +126 -101
- package/docs/textfield.html +181 -138
- package/layout/README.md +122 -0
- package/layout/index.scss +258 -0
- package/package.json +1 -1
- package/styles/statelayer.scss +2 -0
- package/styles.scss +13 -0
- package/styles/layout.scss +0 -74
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
dialog.micl-bottomsheet {
|
|
28
28
|
--md-sys-bottomsheet-height: max-content;
|
|
29
29
|
--md-sys-bottomsheet-margin: 56px;
|
|
30
|
+
--md-sys-bottomsheet-margin-top: 72px;
|
|
30
31
|
--md-sys-bottomsheet-padding: 24px;
|
|
31
32
|
--md-sys-bottomsheet-handle-width: 32px;
|
|
32
33
|
--md-sys-bottomsheet-handle-height: 4px;
|
|
@@ -36,13 +37,12 @@ dialog.micl-bottomsheet {
|
|
|
36
37
|
|
|
37
38
|
box-sizing: border-box;
|
|
38
39
|
position: fixed;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
margin: 72px 0 0 0 ;
|
|
40
|
+
inset-block: auto 0;
|
|
41
|
+
block-size: 0;
|
|
42
|
+
max-block-size: 50vh;
|
|
43
|
+
inline-size: 100%;
|
|
44
|
+
min-inline-size: 100%;
|
|
45
|
+
margin: var(--md-sys-bottomsheet-margin-top) 0 0 0 ;
|
|
46
46
|
padding: 0;
|
|
47
47
|
border: none;
|
|
48
48
|
border-radius: var(--md-sys-shape-corner-extra-large) var(--md-sys-shape-corner-extra-large) 0 0;
|
|
@@ -55,26 +55,23 @@ dialog.micl-bottomsheet {
|
|
|
55
55
|
&:not(.micl-bottomsheet--resizing) {
|
|
56
56
|
transition:
|
|
57
57
|
opacity var(--md-sys-bottomsheet-motion-duration-reverse) motion.$md-sys-motion-easing-emphasized-accelerate,
|
|
58
|
-
|
|
58
|
+
block-size var(--md-sys-bottomsheet-motion-duration-reverse) var(--md-sys-bottomsheet-motion-spatial),
|
|
59
59
|
overlay var(--md-sys-bottomsheet-motion-duration-reverse) linear allow-discrete,
|
|
60
60
|
display var(--md-sys-bottomsheet-motion-duration-reverse) linear allow-discrete;
|
|
61
61
|
}
|
|
62
|
-
&.micl-bottomsheet--resizing .micl-bottomsheet__headline {
|
|
63
|
-
cursor: grabbing;
|
|
64
|
-
}
|
|
65
62
|
.micl-bottomsheet__headline {
|
|
66
63
|
box-sizing: border-box;
|
|
67
64
|
display: flex;
|
|
68
65
|
align-items: center;
|
|
69
|
-
|
|
70
|
-
|
|
66
|
+
inline-size: 100%;
|
|
67
|
+
block-size: var(--md-sys-target-size);
|
|
71
68
|
justify-content: center;
|
|
72
69
|
cursor: grab;
|
|
73
70
|
|
|
74
71
|
.micl-bottomsheet__draghandle {
|
|
75
72
|
box-sizing: content-box;
|
|
76
|
-
|
|
77
|
-
|
|
73
|
+
inline-size: var(--md-sys-bottomsheet-handle-width);
|
|
74
|
+
block-size: var(--md-sys-bottomsheet-handle-height);
|
|
78
75
|
padding: 16px calc((var(--md-sys-target-size) - var(--md-sys-bottomsheet-handle-width)) / 2);
|
|
79
76
|
border: none;
|
|
80
77
|
border-radius: var(--md-sys-shape-corner-small);
|
|
@@ -88,6 +85,9 @@ dialog.micl-bottomsheet {
|
|
|
88
85
|
}
|
|
89
86
|
}
|
|
90
87
|
}
|
|
88
|
+
&.micl-bottomsheet--resizing .micl-bottomsheet__headline {
|
|
89
|
+
cursor: grabbing;
|
|
90
|
+
}
|
|
91
91
|
|
|
92
92
|
.micl-bottomsheet__content {
|
|
93
93
|
padding: 0 var(--md-sys-bottomsheet-padding) var(--md-sys-bottomsheet-padding) var(--md-sys-bottomsheet-padding);
|
|
@@ -102,19 +102,19 @@ dialog.micl-bottomsheet {
|
|
|
102
102
|
}
|
|
103
103
|
&:popover-open,
|
|
104
104
|
&[open] {
|
|
105
|
-
|
|
106
|
-
opacity:
|
|
105
|
+
block-size: var(--md-sys-bottomsheet-height);
|
|
106
|
+
opacity: 100%;
|
|
107
107
|
// overflow-y: auto;
|
|
108
108
|
|
|
109
109
|
&:not(.micl-bottomsheet--resizing) {
|
|
110
110
|
transition:
|
|
111
111
|
opacity var(--md-sys-bottomsheet-motion-duration) motion.$md-sys-motion-easing-emphasized-decelerate,
|
|
112
|
-
|
|
112
|
+
block-size var(--md-sys-bottomsheet-motion-duration) var(--md-sys-bottomsheet-motion-spatial),
|
|
113
113
|
overlay var(--md-sys-bottomsheet-motion-duration) linear allow-discrete,
|
|
114
114
|
display var(--md-sys-bottomsheet-motion-duration) linear allow-discrete;
|
|
115
115
|
}
|
|
116
116
|
@starting-style {
|
|
117
|
-
|
|
117
|
+
block-size: 0;
|
|
118
118
|
opacity: 0;
|
|
119
119
|
}
|
|
120
120
|
}
|
|
@@ -129,11 +129,11 @@ dialog.micl-bottomsheet {
|
|
|
129
129
|
|
|
130
130
|
@media (min-width: 641px) {
|
|
131
131
|
dialog.micl-bottomsheet {
|
|
132
|
-
|
|
133
|
-
max-
|
|
134
|
-
min-
|
|
132
|
+
inline-size: min(100vw - (2 * var(--md-sys-bottomsheet-margin)), 640px);
|
|
133
|
+
max-inline-size: 640px;
|
|
134
|
+
min-inline-size: min(100vw - (2 * var(--md-sys-bottomsheet-margin)), 640px);
|
|
135
135
|
inset-inline-start: calc(((100vw - min(100vw - (2 * var(--md-sys-bottomsheet-margin)), 640px)) / 2) - var(--md-sys-bottomsheet-margin));
|
|
136
136
|
margin: var(--md-sys-bottomsheet-margin);
|
|
137
|
-
margin-
|
|
137
|
+
margin-block-end: 0;
|
|
138
138
|
}
|
|
139
139
|
}
|
|
@@ -23,19 +23,19 @@ export const bottomsheetSelector = 'dialog.micl-bottomsheet';
|
|
|
23
23
|
|
|
24
24
|
export default (() =>
|
|
25
25
|
{
|
|
26
|
-
var fitHeight = 0;
|
|
27
|
-
|
|
28
26
|
const getSnapHeights = (dialog: HTMLDialogElement): number[] =>
|
|
29
27
|
{
|
|
30
|
-
let
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
let fitHeight = parseInt(dialog.dataset.miclfitheight || '0', 10),
|
|
29
|
+
maxHeight = parseInt(window.getComputedStyle(dialog).getPropertyValue('max-block-size'), 10),
|
|
30
|
+
snapHeights = (dialog.dataset.miclsnapheights || '').split(',').map(Number).filter(
|
|
31
|
+
n => !isNaN(n) && (n >= 0) && (n <= maxHeight)
|
|
33
32
|
);
|
|
34
33
|
|
|
35
|
-
if (
|
|
36
|
-
fitHeight = dialog.getBoundingClientRect().height;
|
|
34
|
+
if (fitHeight < 1) {
|
|
35
|
+
fitHeight = Math.min(dialog.getBoundingClientRect().height, maxHeight);
|
|
36
|
+
dialog.dataset.miclfitheight = `${fitHeight}`;
|
|
37
37
|
}
|
|
38
|
-
return [...new Set(snapHeights.concat([fitHeight
|
|
38
|
+
return [...new Set(snapHeights.concat([fitHeight]).sort())];
|
|
39
39
|
};
|
|
40
40
|
|
|
41
41
|
const getNextSnapHeight = (dialog: HTMLDialogElement, isResizing: boolean): number =>
|
|
@@ -58,14 +58,21 @@ export default (() =>
|
|
|
58
58
|
|
|
59
59
|
const setHeight = (dialog: HTMLDialogElement, value: number): void =>
|
|
60
60
|
{
|
|
61
|
-
|
|
61
|
+
if (value < 1) {
|
|
62
|
+
delete dialog.dataset.miclfitheight;
|
|
63
|
+
dialog.style.removeProperty('--md-sys-bottomsheet-height');
|
|
64
|
+
dialog[!dialog.popover ? 'close' : 'hidePopover']();
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
dialog.style.setProperty('--md-sys-bottomsheet-height', `${value}px`);
|
|
68
|
+
}
|
|
62
69
|
}
|
|
63
70
|
|
|
64
71
|
return {
|
|
65
72
|
initialize: (element: HTMLDialogElement) =>
|
|
66
73
|
{
|
|
67
74
|
if (
|
|
68
|
-
!element.matches(
|
|
75
|
+
!element.matches(bottomsheetSelector)
|
|
69
76
|
|| element.dataset.miclinitialized
|
|
70
77
|
) {
|
|
71
78
|
return;
|
|
@@ -80,10 +87,7 @@ export default (() =>
|
|
|
80
87
|
|
|
81
88
|
draghandle?.addEventListener('click', () =>
|
|
82
89
|
{
|
|
83
|
-
|
|
84
|
-
if (nextSnapHeight > 4) {
|
|
85
|
-
setHeight(element, nextSnapHeight);
|
|
86
|
-
}
|
|
90
|
+
setHeight(element, getNextSnapHeight(element, false));
|
|
87
91
|
});
|
|
88
92
|
|
|
89
93
|
let isPreparing = false,
|
|
@@ -126,16 +130,11 @@ export default (() =>
|
|
|
126
130
|
if (currentMouseY < initialMouseY) {
|
|
127
131
|
setHeight(element, getNextSnapHeight(element, true));
|
|
128
132
|
}
|
|
133
|
+
else if (element.getBoundingClientRect().height < 48) {
|
|
134
|
+
setHeight(element, 0);
|
|
135
|
+
}
|
|
129
136
|
else {
|
|
130
|
-
|
|
131
|
-
if (!!element.popover) {
|
|
132
|
-
element.hidePopover();
|
|
133
|
-
}
|
|
134
|
-
setHeight(element, initialHeight);
|
|
135
|
-
}
|
|
136
|
-
else {
|
|
137
|
-
setHeight(element, getPreviousSnapHeight(element));
|
|
138
|
-
}
|
|
137
|
+
setHeight(element, getPreviousSnapHeight(element));
|
|
139
138
|
}
|
|
140
139
|
document.removeEventListener('mousemove', onMouseMove);
|
|
141
140
|
document.removeEventListener('mouseup', onMouseUp);
|
|
@@ -144,8 +143,10 @@ export default (() =>
|
|
|
144
143
|
},
|
|
145
144
|
cleanup: (element: HTMLDialogElement) =>
|
|
146
145
|
{
|
|
147
|
-
if (element.matches(
|
|
146
|
+
if (element.matches(bottomsheetSelector)) {
|
|
147
|
+
element.classList.remove('micl-bottomsheet--resizing');
|
|
148
148
|
delete element.dataset.miclinitialized;
|
|
149
|
+
delete element.dataset.miclfitheight;
|
|
149
150
|
}
|
|
150
151
|
}
|
|
151
152
|
};
|
|
@@ -66,7 +66,7 @@ To add a leading icon to a button, include an element with the `micl-button__ico
|
|
|
66
66
|
|
|
67
67
|
```HTML
|
|
68
68
|
<button type="button" class="micl-button-filled-m">
|
|
69
|
-
<span class="micl-button__icon material-symbols-outlined">save</span>
|
|
69
|
+
<span class="micl-button__icon material-symbols-outlined" aria-hidden="true">save</span>
|
|
70
70
|
Save
|
|
71
71
|
</button>
|
|
72
72
|
```
|
|
@@ -26,8 +26,12 @@
|
|
|
26
26
|
@use '../../styles/typography';
|
|
27
27
|
|
|
28
28
|
button.micl-button-text-xs,
|
|
29
|
+
a.micl-button-text-xs,
|
|
29
30
|
button.micl-button-text-s,
|
|
31
|
+
a.micl-button-text-s,
|
|
30
32
|
button.micl-button-text-m,
|
|
33
|
+
a.micl-button-text-m,
|
|
34
|
+
button.micl-button-text-l,
|
|
31
35
|
button.micl-button-text-l,
|
|
32
36
|
button.micl-button-text-xl,
|
|
33
37
|
button.micl-button-elevated-xs,
|
|
@@ -60,6 +64,7 @@ button.micl-button-outlined-xl {
|
|
|
60
64
|
align-items: center;
|
|
61
65
|
padding: 0;
|
|
62
66
|
border: none;
|
|
67
|
+
border-radius: calc(var(--micl-height) / 2);
|
|
63
68
|
background-image:
|
|
64
69
|
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%),
|
|
65
70
|
linear-gradient(rgb(from var(--statelayer-color) r g b / var(--statelayer-opacity)));
|
|
@@ -94,45 +99,43 @@ button.micl-button-outlined-xl {
|
|
|
94
99
|
}
|
|
95
100
|
|
|
96
101
|
button.micl-button-text-xs,
|
|
102
|
+
a.micl-button-text-xs,
|
|
97
103
|
button.micl-button-elevated-xs,
|
|
98
104
|
button.micl-button-filled-xs,
|
|
99
105
|
button.micl-button-tonal-xs,
|
|
100
106
|
button.micl-button-outlined-xs {
|
|
101
107
|
@include typography.label-large;
|
|
102
108
|
|
|
109
|
+
--micl-width: 32px;
|
|
110
|
+
--micl-height: 32px;
|
|
111
|
+
|
|
112
|
+
position: relative;
|
|
113
|
+
min-inline-size: var(--micl-width);
|
|
114
|
+
block-size: var(--micl-height);
|
|
103
115
|
column-gap: 8px;
|
|
104
|
-
min-width: var(--md-sys-target-size);
|
|
105
|
-
height: var(--md-sys-target-size);
|
|
106
116
|
padding-inline: 12px;
|
|
107
|
-
border: 8px solid transparent;
|
|
108
|
-
border-radius: calc(var(--md-sys-target-size) / 2);
|
|
109
|
-
background-clip: padding-box;
|
|
110
117
|
|
|
118
|
+
&::before {
|
|
119
|
+
content: "";
|
|
120
|
+
position: absolute;
|
|
121
|
+
block-size: var(--md-sys-target-size);
|
|
122
|
+
inline-size: var(--md-sys-target-size);
|
|
123
|
+
inset: calc((var(--micl-height) - var(--md-sys-target-size)) / 2) 0 0 calc((var(--micl-width) - var(--md-sys-target-size)) / 2);
|
|
124
|
+
background-color: transparent;
|
|
125
|
+
}
|
|
111
126
|
&.micl-button--toggle.micl-button--selected {
|
|
112
127
|
border-radius: var(--md-sys-shape-corner-medium);
|
|
113
128
|
}
|
|
114
129
|
&.micl-button--square {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
}
|
|
118
|
-
&:not(.micl-button-elevated-xs) {
|
|
119
|
-
border-radius: calc(var(--md-sys-shape-corner-medium) + 8px);
|
|
120
|
-
}
|
|
130
|
+
border-radius: var(--md-sys-shape-corner-medium);
|
|
131
|
+
|
|
121
132
|
&.micl-button--toggle.micl-button--selected {
|
|
122
|
-
border-radius:
|
|
133
|
+
border-radius: var(--md-sys-shape-corner-full);
|
|
123
134
|
}
|
|
124
135
|
}
|
|
125
136
|
&:not(:disabled) {
|
|
126
137
|
&:active {
|
|
127
|
-
|
|
128
|
-
border-radius: var(--md-sys-shape-corner-small);
|
|
129
|
-
}
|
|
130
|
-
&:not(.micl-button-elevated-xs) {
|
|
131
|
-
border-radius: calc(var(--md-sys-shape-corner-small) + 8px);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
&:not(.micl-button-elevated-xs):focus-visible {
|
|
135
|
-
outline-offset: -6px;
|
|
138
|
+
border-radius: var(--md-sys-shape-corner-small);
|
|
136
139
|
}
|
|
137
140
|
}
|
|
138
141
|
.micl-button__icon {
|
|
@@ -142,45 +145,42 @@ button.micl-button-outlined-xs {
|
|
|
142
145
|
}
|
|
143
146
|
|
|
144
147
|
button.micl-button-text-s,
|
|
148
|
+
a.micl-button-text-s,
|
|
145
149
|
button.micl-button-elevated-s,
|
|
146
150
|
button.micl-button-filled-s,
|
|
147
151
|
button.micl-button-tonal-s,
|
|
148
152
|
button.micl-button-outlined-s {
|
|
149
153
|
@include typography.label-large;
|
|
150
154
|
|
|
155
|
+
--micl-width: 40px;
|
|
156
|
+
--micl-height: 40px;
|
|
157
|
+
|
|
158
|
+
min-inline-size: var(--micl-width);
|
|
159
|
+
block-size: var(--micl-height);
|
|
151
160
|
column-gap: 8px;
|
|
152
|
-
min-width: var(--md-sys-target-size);
|
|
153
|
-
height: var(--md-sys-target-size);
|
|
154
161
|
padding-inline: 16px;
|
|
155
|
-
border: 4px solid transparent;
|
|
156
|
-
border-radius: calc(var(--md-sys-target-size) / 2);
|
|
157
|
-
background-clip: padding-box;
|
|
158
162
|
|
|
163
|
+
&::before {
|
|
164
|
+
content: "";
|
|
165
|
+
position: absolute;
|
|
166
|
+
block-size: var(--md-sys-target-size);
|
|
167
|
+
inline-size: var(--md-sys-target-size);
|
|
168
|
+
inset: calc((var(--micl-height) - var(--md-sys-target-size)) / 2) 0 0 calc((var(--micl-width) - var(--md-sys-target-size)) / 2);
|
|
169
|
+
background-color: transparent;
|
|
170
|
+
}
|
|
159
171
|
&.micl-button--toggle.micl-button--selected {
|
|
160
172
|
border-radius: var(--md-sys-shape-corner-medium);
|
|
161
173
|
}
|
|
162
174
|
&.micl-button--square {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
}
|
|
166
|
-
&:not(.micl-button-elevated-s) {
|
|
167
|
-
border-radius: calc(var(--md-sys-shape-corner-medium) + 4px);
|
|
168
|
-
}
|
|
175
|
+
border-radius: var(--md-sys-shape-corner-medium);
|
|
176
|
+
|
|
169
177
|
&.micl-button--toggle.micl-button--selected {
|
|
170
|
-
border-radius:
|
|
178
|
+
border-radius: var(--md-sys-shape-corner-full);
|
|
171
179
|
}
|
|
172
180
|
}
|
|
173
181
|
&:not(:disabled) {
|
|
174
|
-
&:active
|
|
175
|
-
|
|
176
|
-
border-radius: var(--md-sys-shape-corner-small);
|
|
177
|
-
}
|
|
178
|
-
&:not(.micl-button-elevated-s) {
|
|
179
|
-
border-radius: calc(var(--md-sys-shape-corner-small) + 4px);
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
&:not(.micl-button-elevated-s):focus-visible {
|
|
183
|
-
outline-offset: -2px;
|
|
182
|
+
&:active {
|
|
183
|
+
border-radius: var(--md-sys-shape-corner-small);
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
186
|
.micl-button__icon {
|
|
@@ -190,17 +190,20 @@ button.micl-button-outlined-s {
|
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
button.micl-button-text-m,
|
|
193
|
+
a.micl-button-text-m,
|
|
193
194
|
button.micl-button-elevated-m,
|
|
194
195
|
button.micl-button-filled-m,
|
|
195
196
|
button.micl-button-tonal-m,
|
|
196
197
|
button.micl-button-outlined-m {
|
|
197
198
|
@include typography.title-medium;
|
|
198
199
|
|
|
200
|
+
--micl-width: 56px;
|
|
201
|
+
--micl-height: 56px;
|
|
202
|
+
|
|
203
|
+
min-inline-size: var(--micl-width);
|
|
204
|
+
block-size: var(--micl-height);
|
|
199
205
|
column-gap: 8px;
|
|
200
|
-
min-width: 56px;
|
|
201
|
-
height: 56px;
|
|
202
206
|
padding-inline: 24px;
|
|
203
|
-
border-radius: 28px;
|
|
204
207
|
|
|
205
208
|
&.micl-button--toggle.micl-button--selected {
|
|
206
209
|
border-radius: var(--md-sys-shape-corner-large);
|
|
@@ -209,12 +212,12 @@ button.micl-button-outlined-m {
|
|
|
209
212
|
border-radius: var(--md-sys-shape-corner-large);
|
|
210
213
|
|
|
211
214
|
&.micl-button--toggle.micl-button--selected {
|
|
212
|
-
border-radius:
|
|
215
|
+
border-radius: var(--md-sys-shape-corner-full);
|
|
213
216
|
}
|
|
214
217
|
}
|
|
215
218
|
&:not(:disabled) {
|
|
216
|
-
&:active
|
|
217
|
-
border-radius: var(--md-sys-shape-corner-
|
|
219
|
+
&:active {
|
|
220
|
+
border-radius: var(--md-sys-shape-corner-small);
|
|
218
221
|
}
|
|
219
222
|
}
|
|
220
223
|
.micl-button__icon {
|
|
@@ -230,11 +233,13 @@ button.micl-button-tonal-l,
|
|
|
230
233
|
button.micl-button-outlined-l {
|
|
231
234
|
@include typography.headline-small;
|
|
232
235
|
|
|
236
|
+
--micl-width: 96px;
|
|
237
|
+
--micl-height: 96px;
|
|
238
|
+
|
|
239
|
+
min-inline-size: var(--micl-width);
|
|
240
|
+
block-size: var(--micl-height);
|
|
233
241
|
column-gap: 12px;
|
|
234
|
-
min-width: 96px;
|
|
235
|
-
height: 96px;
|
|
236
242
|
padding-inline: 48px;
|
|
237
|
-
border-radius: 48px;
|
|
238
243
|
|
|
239
244
|
&.micl-button--toggle.micl-button--selected {
|
|
240
245
|
border-radius: var(--md-sys-shape-corner-extra-large);
|
|
@@ -243,11 +248,11 @@ button.micl-button-outlined-l {
|
|
|
243
248
|
border-radius: var(--md-sys-shape-corner-extra-large);
|
|
244
249
|
|
|
245
250
|
&.micl-button--toggle.micl-button--selected {
|
|
246
|
-
border-radius:
|
|
251
|
+
border-radius: var(--md-sys-shape-corner-full);
|
|
247
252
|
}
|
|
248
253
|
}
|
|
249
254
|
&:not(:disabled) {
|
|
250
|
-
&:active
|
|
255
|
+
&:active {
|
|
251
256
|
border-radius: var(--md-sys-shape-corner-large);
|
|
252
257
|
}
|
|
253
258
|
}
|
|
@@ -264,11 +269,13 @@ button.micl-button-tonal-xl,
|
|
|
264
269
|
button.micl-button-outlined-xl {
|
|
265
270
|
@include typography.headline-large;
|
|
266
271
|
|
|
272
|
+
--micl-width: 136px;
|
|
273
|
+
--micl-height: 136px;
|
|
274
|
+
|
|
275
|
+
min-inline-size: var(--micl-width);
|
|
276
|
+
block-size: var(--micl-height);
|
|
267
277
|
column-gap: 16px;
|
|
268
|
-
min-width: 136px;
|
|
269
|
-
height: 136px;
|
|
270
278
|
padding-inline: 64px;
|
|
271
|
-
border-radius: 68px;
|
|
272
279
|
|
|
273
280
|
&.micl-button--toggle.micl-button--selected {
|
|
274
281
|
border-radius: var(--md-sys-shape-corner-extra-large);
|
|
@@ -277,11 +284,11 @@ button.micl-button-outlined-xl {
|
|
|
277
284
|
border-radius: var(--md-sys-shape-corner-extra-large);
|
|
278
285
|
|
|
279
286
|
&.micl-button--toggle.micl-button--selected {
|
|
280
|
-
border-radius:
|
|
287
|
+
border-radius: var(--md-sys-shape-corner-full);
|
|
281
288
|
}
|
|
282
289
|
}
|
|
283
290
|
&:not(:disabled) {
|
|
284
|
-
&:active
|
|
291
|
+
&:active {
|
|
285
292
|
border-radius: var(--md-sys-shape-corner-large);
|
|
286
293
|
}
|
|
287
294
|
}
|
|
@@ -292,8 +299,11 @@ button.micl-button-outlined-xl {
|
|
|
292
299
|
}
|
|
293
300
|
|
|
294
301
|
button.micl-button-text-xs,
|
|
302
|
+
a.micl-button-text-xs,
|
|
295
303
|
button.micl-button-text-s,
|
|
304
|
+
a.micl-button-text-s,
|
|
296
305
|
button.micl-button-text-m,
|
|
306
|
+
a.micl-button-text-m,
|
|
297
307
|
button.micl-button-text-l,
|
|
298
308
|
button.micl-button-text-xl {
|
|
299
309
|
--statelayer-color: var(--md-sys-color-primary);
|
|
@@ -476,12 +486,7 @@ button.micl-button-outlined-xl {
|
|
|
476
486
|
}
|
|
477
487
|
}
|
|
478
488
|
button.micl-button-outlined-xs,
|
|
479
|
-
button.micl-button-outlined-s
|
|
480
|
-
box-shadow: inset 1px 0px var(--md-sys-color-outline-variant),
|
|
481
|
-
inset -1px 0px var(--md-sys-color-outline-variant),
|
|
482
|
-
inset 0px -1px var(--md-sys-color-outline-variant),
|
|
483
|
-
inset 0px 1px var(--md-sys-color-outline-variant);
|
|
484
|
-
}
|
|
489
|
+
button.micl-button-outlined-s,
|
|
485
490
|
button.micl-button-outlined-m {
|
|
486
491
|
border: 1px solid var(--md-sys-color-outline-variant);
|
|
487
492
|
}
|
|
@@ -40,7 +40,7 @@ export default (() =>
|
|
|
40
40
|
event.target.classList.add('micl-button--toggled');
|
|
41
41
|
event.target.classList.toggle('micl-button--selected');
|
|
42
42
|
if (!!event.target.dataset.miclalt) {
|
|
43
|
-
[event.target.textContent, event.target.dataset.miclalt] =
|
|
43
|
+
[event.target.textContent, event.target.dataset.miclalt] =
|
|
44
44
|
[event.target.dataset.miclalt, event.target.textContent];
|
|
45
45
|
}
|
|
46
46
|
}
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
--md-sys-card-motion-duration: #{motion.$md-sys-motion-expressive-default-spatial-duration};
|
|
38
38
|
|
|
39
39
|
height: fit-content;
|
|
40
|
-
margin:
|
|
40
|
+
margin: 0;
|
|
41
41
|
border-radius: var(--md-sys-shape-corner-medium);
|
|
42
42
|
overflow: hidden;
|
|
43
43
|
interpolate-size: allow-keywords;
|
|
@@ -260,6 +260,10 @@ input[type=checkbox].micl-checkbox:not(:disabled) + label,
|
|
|
260
260
|
label:has(+ input[type=checkbox].micl-checkbox:not(:disabled)) {
|
|
261
261
|
cursor: pointer;
|
|
262
262
|
}
|
|
263
|
+
input[type=checkbox].micl-checkbox + label,
|
|
264
|
+
label:has(+ input[type=checkbox].micl-checkbox) {
|
|
265
|
+
color: var(--md-sys-color-on-surface);
|
|
266
|
+
}
|
|
263
267
|
|
|
264
268
|
[dir=rtl] input[type=checkbox].micl-checkbox {
|
|
265
269
|
&::after {
|
|
@@ -7,10 +7,10 @@ This component implements the the [Material Design 3 Expressive Dialog](https://
|
|
|
7
7
|
To create a basic dialog, use the `<dialog>` element with the `micl-dialog` class. You can open and close the dialog using JavaScript, or you can use a control element, such as a button, to open and close the dialog.
|
|
8
8
|
|
|
9
9
|
```HTML
|
|
10
|
-
<dialog id="mydialog" class="micl-dialog" closedby="any" popover>
|
|
10
|
+
<dialog id="mydialog" class="micl-dialog" closedby="any" popover aria-labelledby="mytitle" aria-describedby="mydesc">
|
|
11
11
|
<div class="micl-dialog__headline">
|
|
12
|
-
<h2>Basic dialog</h2>
|
|
13
|
-
<span class="micl-dialog__supporting-text">An example of a basic dialog</span>
|
|
12
|
+
<h2 id="mytitle">Basic dialog</h2>
|
|
13
|
+
<span id="mydesc" class="micl-dialog__supporting-text">An example of a basic dialog</span>
|
|
14
14
|
</div>
|
|
15
15
|
</dialog>
|
|
16
16
|
|
|
@@ -40,11 +40,11 @@ When dialogs with the `popover` attribute are opened, they animate from the cont
|
|
|
40
40
|
Removing the `popover` attribute creates a more intrusive **modal** dialog. This type of dialog requires the user to interact with its buttons or press the <kbd>Esc</kbd> key to close it.
|
|
41
41
|
|
|
42
42
|
```HTML
|
|
43
|
-
<dialog id="mydialog" class="micl-dialog" closedby="closerequest">
|
|
43
|
+
<dialog id="mydialog" class="micl-dialog" closedby="closerequest" aria-labelledby="mytitle" aria-describedby="mydesc">
|
|
44
44
|
<div class="micl-dialog__headline">
|
|
45
45
|
<span class="micl-dialog__icon material-symbols-outlined" aria-hidden="true">info</span>
|
|
46
|
-
<h2>Modal dialog</h2>
|
|
47
|
-
<span class="micl-dialog__supporting-text">An example of a modal dialog</span>
|
|
46
|
+
<h2 id="mytitle">Modal dialog</h2>
|
|
47
|
+
<span id="mydesc" class="micl-dialog__supporting-text">An example of a modal dialog</span>
|
|
48
48
|
</div>
|
|
49
49
|
<div class="micl-dialog__actions">
|
|
50
50
|
<form method="dialog">
|
|
@@ -90,15 +90,15 @@ A dialog typically consists of three main sections to organize its content:
|
|
|
90
90
|
A full-screen dialog covers the entire viewport, primarily on smaller screens. On screens wider than 560 pixels, a full-screen dialog behaves like a basic dialog. Use the `micl-dialog-fullscreen` class for this variant:
|
|
91
91
|
|
|
92
92
|
```HTML
|
|
93
|
-
<dialog id="mydialog" class="micl-dialog-fullscreen" closedby="none" popover>
|
|
93
|
+
<dialog id="mydialog" class="micl-dialog-fullscreen" closedby="none" popover aria-labelledby="mytitle" aria-describedby="mydesc">
|
|
94
94
|
<form method="dialog" class="micl-dialog__headline">
|
|
95
95
|
<button type="button" class="micl-iconbutton-s material-symbols-outlined" popovertarget="mydialog" aria-label="Close">close</button>
|
|
96
96
|
<span class="micl-dialog__icon material-symbols-outlined" aria-hidden="true">person</span>
|
|
97
|
-
<h2>Full-screen dialog</h2>
|
|
97
|
+
<h2 id="mytitle">Full-screen dialog</h2>
|
|
98
98
|
<button class="micl-button" value="dosave">Save</button>
|
|
99
99
|
</form>
|
|
100
100
|
<div class="micl-dialog__content">
|
|
101
|
-
<span class="micl-dialog__supporting-text">This dialog covers the whole screen.</span>
|
|
101
|
+
<span id="mydesc" class="micl-dialog__supporting-text">This dialog covers the whole screen.</span>
|
|
102
102
|
</div>
|
|
103
103
|
<form method="dialog" class="micl-dialog__actions">
|
|
104
104
|
<button type="button" class="micl-button" popovertarget="mydialog">Cancel</button>
|