material-inspired-component-library 2.0.1 → 3.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 +14 -0
- package/components/README.md +2 -0
- package/components/appbar/README.md +94 -0
- package/components/appbar/index.scss +216 -0
- package/components/button/index.scss +70 -65
- package/components/button/index.ts +1 -1
- package/components/card/index.scss +1 -1
- package/components/checkbox/README.md +9 -0
- package/components/checkbox/index.scss +4 -0
- package/components/divider/index.scss +10 -10
- package/components/iconbutton/index.scss +111 -111
- package/components/iconbutton/index.ts +1 -1
- package/components/list/README.md +4 -4
- package/components/list/index.scss +3 -3
- package/components/navigationrail/README.md +11 -11
- package/components/navigationrail/index.scss +20 -12
- package/components/radio/README.md +13 -4
- package/components/radio/index.scss +7 -5
- package/components/select/README.md +28 -6
- package/components/select/index.scss +56 -10
- package/components/textfield/index.scss +3 -9
- package/components/textfield/index.ts +29 -22
- package/dist/appbar.css +1 -0
- package/dist/appbar.js +1 -0
- 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/components/textfield/index.d.ts +1 -1
- package/dist/dialog.css +1 -1
- package/dist/divider.css +1 -1
- package/dist/iconbutton.css +1 -1
- package/dist/layout.css +1 -0
- package/dist/layout.js +1 -0
- 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/switch.css +1 -1
- package/dist/textfield.css +1 -1
- package/docs/accordion.html +298 -254
- package/docs/bottomsheet.html +174 -145
- package/docs/button.html +210 -182
- package/docs/card.html +107 -72
- package/docs/checkbox.html +92 -69
- 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 +296 -286
- 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 +36 -34
- package/docs/radio.html +93 -72
- package/docs/select.html +253 -173
- package/docs/sidesheet.html +104 -87
- 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 +259 -0
- package/micl.ts +1 -1
- package/package.json +4 -1
- package/styles/shapes.scss +0 -2
- package/styles/statelayer.scss +2 -0
- package/styles.scss +13 -0
- package/webpack.config.js +1 -1
- package/styles/layout.scss +0 -74
package/README.md
CHANGED
|
@@ -76,9 +76,15 @@ Copy the main `micl.js` file to your distribution folder and include it in your
|
|
|
76
76
|
```
|
|
77
77
|
This will initialize all MICL components, including those that will be added to the DOM later on.
|
|
78
78
|
|
|
79
|
+
## Foundations
|
|
80
|
+
A separate CSS file, based on the [Material Design Layout Foundation](https://m3.material.io/foundations/layout/understanding-layout/overview), provides styles for an adaptive layout. It includes styles for the **window frame**, **body region** and **panes** that adjust to the available screen space, ensuring your layout follows Material Design's responsive guidelines.
|
|
81
|
+
|
|
82
|
+
- [x] [Layout](layout/README.md)
|
|
83
|
+
|
|
79
84
|
## Available components ✅
|
|
80
85
|
The library currently consists of the following components:
|
|
81
86
|
- [x] [Accordion](components/accordion/README.md)
|
|
87
|
+
- [x] [App Bar](components/appbar/README.md)
|
|
82
88
|
- [x] [Badge](components/badge/README.md)
|
|
83
89
|
- [x] [Bottom sheet](components/bottomsheet/README.md)
|
|
84
90
|
- [x] [Button](components/button/README.md)
|
|
@@ -99,6 +105,14 @@ The library currently consists of the following components:
|
|
|
99
105
|
|
|
100
106
|
## Change Log
|
|
101
107
|
|
|
108
|
+
### 3.0.0 (24.09.2025)
|
|
109
|
+
**Features**
|
|
110
|
+
|
|
111
|
+
- **App Bar**: New component.
|
|
112
|
+
- **Layout**: Support for adaptive layout.
|
|
113
|
+
- Improved handling of target area for small buttons.
|
|
114
|
+
- **BREAKING:** Use `<nav>` instead of `<div>` for Navigation rail.
|
|
115
|
+
|
|
102
116
|
### 2.0.0 (04.09.2025)
|
|
103
117
|
**Features**
|
|
104
118
|
|
package/components/README.md
CHANGED
|
@@ -10,3 +10,5 @@ Each component is self-contained in a separate folder, making it easy to find wh
|
|
|
10
10
|
- A README.md file for detailed documentation.
|
|
11
11
|
|
|
12
12
|
Most components are standalone, but some are built on top of others. For example, the [Menu component](./menu/README.md) extends the [List component](./list/README.md), so it requires the styles and functionality of both. Always check the documentation for each component to see which dependencies you need to import. This ensures everything works as expected.
|
|
13
|
+
|
|
14
|
+
A [separate CSS file](../layout/README.md), based on the [Material Design Layout Foundation](https://m3.material.io/foundations/layout/understanding-layout/overview), provides styles for an adaptive layout. It includes styles for the **window frame**, **body region** and **panes** that adjust to the available screen space, ensuring your layout follows Material Design's responsive guidelines.
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# App Bar
|
|
2
|
+
This component implements the the [Material Design 3 Expressive App Bar](https://m3.material.io/components/app-bars/overview) design. The app bar serves as the top container for a page, displaying the page title, primary actions, and navigation options.
|
|
3
|
+
|
|
4
|
+
## Basic Usage
|
|
5
|
+
|
|
6
|
+
### HTML
|
|
7
|
+
To add a basic (small) app bar, use the `<header>` element with the `micl-appbar` class. The `<h1>` and `<p>` elements within the `.micl-appbar__headline` `<div>` define the main headline and an optional subtitle.
|
|
8
|
+
|
|
9
|
+
```HTML
|
|
10
|
+
<header class="micl-appbar">
|
|
11
|
+
<div class="micl-appbar__headline">
|
|
12
|
+
<h1>Headline</h1>
|
|
13
|
+
<p class="micl-appbar__subtitle">Subtitle</p>
|
|
14
|
+
</div>
|
|
15
|
+
</header>
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### CSS
|
|
19
|
+
Import the app bar styles into your project:
|
|
20
|
+
|
|
21
|
+
```CSS
|
|
22
|
+
@use "material-inspired-component-library/dist/appbar";
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### JavaScript
|
|
26
|
+
No custom JavaScript is required for the core functionality of this component.
|
|
27
|
+
|
|
28
|
+
### Demo
|
|
29
|
+
A live example of the [App Bar component](https://henkpb.github.io/micl/index.html) is available for you to interact with.
|
|
30
|
+
|
|
31
|
+
## Variants
|
|
32
|
+
The app bar component supports three sizes: **small**, **medium** (flexible), and **large** (flexible). Use a modifier class to specify a size other than the default small size.
|
|
33
|
+
|
|
34
|
+
- **Small** (default): `<header class="micl-appbar">`
|
|
35
|
+
- **Medium**: `<header class="micl-appbar micl-appbar--medium">`
|
|
36
|
+
- **Large**: `<header class="micl-appbar micl-appbar--large">`
|
|
37
|
+
|
|
38
|
+
To center the headline and subtitle, add the `micl-appbar__headline--center` class to the headline container.
|
|
39
|
+
|
|
40
|
+
**Example: A medium-sized app bar with centered text**
|
|
41
|
+
|
|
42
|
+
```HTML
|
|
43
|
+
<header class="micl-appbar micl-appbar--medium">
|
|
44
|
+
<div class="micl-appbar__headline micl-appbar__headline--center">
|
|
45
|
+
<h1>Headline</h1>
|
|
46
|
+
<p class="micl-appbar__subtitle">Subtitle</p>
|
|
47
|
+
</div>
|
|
48
|
+
</header>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Leading content
|
|
52
|
+
Use the `micl-appbar__leading` (or: `micl-appbar__leading-icon`) class for an element (or: icon) placed before the headline.
|
|
53
|
+
|
|
54
|
+
**Example: An app bar with a home link**
|
|
55
|
+
|
|
56
|
+
```HTML
|
|
57
|
+
<header class="micl-appbar">
|
|
58
|
+
<a href="index.html" class="micl-appbar__leading-icon micl-link micl-iconbutton-standard-m" aria-label="Home">
|
|
59
|
+
<span class="material-symbols-outlined" aria-hidden="true">home</span>
|
|
60
|
+
</a>
|
|
61
|
+
<div class="micl-appbar__headline">
|
|
62
|
+
<h1>Headline</h1>
|
|
63
|
+
</div>
|
|
64
|
+
</header>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Trailing content
|
|
68
|
+
Use the `micl-appbar__trailing` (or: `micl-appbar__trailing-icon`) class for elements (or: icons) placed after the headline.
|
|
69
|
+
|
|
70
|
+
**Example: An app bar with a settings-button**
|
|
71
|
+
|
|
72
|
+
```HTML
|
|
73
|
+
<header class="micl-appbar">
|
|
74
|
+
<div class="micl-appbar__headline">
|
|
75
|
+
<h1>Headline</h1>
|
|
76
|
+
</div>
|
|
77
|
+
<button type="button" class="micl-appbar__trailing micl-iconbutton-tonal-s micl-iconbutton--wide material-symbols-outlined">settings</button>
|
|
78
|
+
</header>
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Sticky app bar
|
|
82
|
+
The app bar is 'glued' to the top of the page when one of the following conditions is met:
|
|
83
|
+
|
|
84
|
+
- The [body region](../../layout/README.md) contains only one pane.
|
|
85
|
+
- The body region contains two or more panes and the page has a compact size.
|
|
86
|
+
- The body region contains two or more panes, has the `micl-body--stacked-to-expanded` class and the page has a compact or medium size.
|
|
87
|
+
- The body region contains two or more panes, has the `micl-body--stacked-to-large` class and the page has a compact, medium or expanded size.
|
|
88
|
+
- The body region contains two or more panes, has the `micl-body--stacked-to-extralarge` class and the page has a compact, medium, expanded or large size.
|
|
89
|
+
- The app bar has the `micl-appbar--sticky` class.
|
|
90
|
+
|
|
91
|
+
Adding the `micl-appbar--not-sticky` class to the app bar will prohibit gluing the app bar to the top of the page.
|
|
92
|
+
|
|
93
|
+
## Compatibility
|
|
94
|
+
This component uses the `animation-timeline` CSS property for the scroll-effect, which may not be supported in your browser. Please check [Browser compatibility](https://developer.mozilla.org/en-US/docs/Web/CSS/animation-timeline#browser_compatibility) for details.
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright © 2025 Hermana AS
|
|
3
|
+
//
|
|
4
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
// of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
// in the Software without restriction, including without limitation the rights
|
|
7
|
+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
// copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
// furnished to do so, subject to the following conditions:
|
|
10
|
+
//
|
|
11
|
+
// The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
// copies or substantial portions of the Software.
|
|
13
|
+
//
|
|
14
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
+
// SOFTWARE.
|
|
21
|
+
|
|
22
|
+
@use '../../layout';
|
|
23
|
+
@use '../../styles/elevation';
|
|
24
|
+
@use '../../styles/shapes';
|
|
25
|
+
@use '../../styles/statelayer';
|
|
26
|
+
@use '../../styles/typography';
|
|
27
|
+
|
|
28
|
+
@mixin appbar-sticky() {
|
|
29
|
+
position: sticky;
|
|
30
|
+
inset: unset;
|
|
31
|
+
inset-block-start: 0;
|
|
32
|
+
inset-inline-start: 0;
|
|
33
|
+
animation: 1ms linear alternate appbar-background;
|
|
34
|
+
animation-timeline: scroll(root);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.micl-appbar {
|
|
38
|
+
--md-sys-appbar-height: 64px;
|
|
39
|
+
--md-sys-appbar-padding-block-start: 0px;
|
|
40
|
+
--md-sys-appbar-padding-block-end: 0px;
|
|
41
|
+
--md-sys-appbar-padding-inline: 4px;
|
|
42
|
+
|
|
43
|
+
box-sizing: border-box;
|
|
44
|
+
display: grid;
|
|
45
|
+
grid-template-areas:
|
|
46
|
+
"appbar-leading appbar-middle appbar-trailing"
|
|
47
|
+
"appbar-bottom appbar-bottom appbar-bottom";
|
|
48
|
+
grid-template-columns: 0fr 1fr max-content;
|
|
49
|
+
column-gap: 4px;
|
|
50
|
+
align-items: center;
|
|
51
|
+
min-block-size: var(--md-sys-appbar-height);
|
|
52
|
+
padding-block: var(--md-sys-appbar-padding-block-start) var(--md-sys-appbar-padding-block-end);
|
|
53
|
+
padding-inline: var(--md-sys-appbar-padding-inline);
|
|
54
|
+
border-start-start-radius: inherit;
|
|
55
|
+
border-start-end-radius: inherit;
|
|
56
|
+
background-color: var(--md-sys-color-surface);
|
|
57
|
+
box-shadow: var(--md-sys-elevation-level0);
|
|
58
|
+
z-index: 8;
|
|
59
|
+
|
|
60
|
+
&.micl-appbar--sticky {
|
|
61
|
+
@include appbar-sticky;
|
|
62
|
+
}
|
|
63
|
+
.micl-appbar__leading {
|
|
64
|
+
grid-area: appbar-leading;
|
|
65
|
+
margin-inline-start: calc(var(--md-sys-layout-window-margin) - var(--md-sys-appbar-padding-inline));
|
|
66
|
+
}
|
|
67
|
+
.micl-appbar__leading-icon {
|
|
68
|
+
grid-area: appbar-leading;
|
|
69
|
+
margin-inline-start: calc(var(--md-sys-layout-window-margin) - (var(--micl-width, statelayer.$md-sys-target-size) / 2) + (24px / 2) - var(--md-sys-appbar-padding-inline));
|
|
70
|
+
color: var(--md-sys-color-on-surface);
|
|
71
|
+
}
|
|
72
|
+
.micl-appbar__headline {
|
|
73
|
+
display: flex;
|
|
74
|
+
grid-area: appbar-middle;
|
|
75
|
+
flex-direction: column;
|
|
76
|
+
align-items: flex-start;
|
|
77
|
+
margin: 8px 0;
|
|
78
|
+
border-radius: var(--md-sys-shape-corner-none);
|
|
79
|
+
color: var(--md-sys-color-on-surface);
|
|
80
|
+
|
|
81
|
+
&.micl-appbar__headline--center {
|
|
82
|
+
align-items: center;
|
|
83
|
+
text-align: center;
|
|
84
|
+
}
|
|
85
|
+
h1, h2, h3, h4, h5, h6, .micl-heading {
|
|
86
|
+
@include typography.title-large;
|
|
87
|
+
|
|
88
|
+
margin: 0;
|
|
89
|
+
}
|
|
90
|
+
.micl-appbar__subtitle {
|
|
91
|
+
margin: 0;
|
|
92
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
&:has(.micl-appbar__subtitle) {
|
|
96
|
+
.micl-appbar__subtitle {
|
|
97
|
+
@include typography.label-medium;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
.micl-appbar__trailing {
|
|
101
|
+
grid-area: appbar-trailing;
|
|
102
|
+
margin-inline-end: calc(var(--md-sys-layout-window-margin) - var(--md-sys-appbar-padding-inline));
|
|
103
|
+
}
|
|
104
|
+
.micl-appbar__trailing-icon {
|
|
105
|
+
grid-area: appbar-trailing;
|
|
106
|
+
margin-inline-end: calc(var(--md-sys-layout-window-margin) - (var(--micl-width, statelayer.$md-sys-target-size) / 2) + (24px / 2) - var(--md-sys-appbar-padding-inline));
|
|
107
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
108
|
+
}
|
|
109
|
+
&.micl-appbar--medium {
|
|
110
|
+
--md-sys-appbar-height: 112px;
|
|
111
|
+
--md-sys-appbar-padding-block-start: 4px;
|
|
112
|
+
--md-sys-appbar-padding-block-end: 12px;
|
|
113
|
+
|
|
114
|
+
padding-inline-start: 0;
|
|
115
|
+
|
|
116
|
+
.micl-appbar__headline {
|
|
117
|
+
grid-area: appbar-bottom;
|
|
118
|
+
margin: 0;
|
|
119
|
+
padding-inline-start: var(--md-sys-layout-window-margin);
|
|
120
|
+
|
|
121
|
+
h1, h2, h3, h4, h5, h6, .micl-heading {
|
|
122
|
+
@include typography.headline-medium;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
&:has(.micl-appbar__subtitle) {
|
|
126
|
+
--md-sys-appbar-height: 136px;
|
|
127
|
+
|
|
128
|
+
.micl-appbar__subtitle {
|
|
129
|
+
@include typography.title-small;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
&.micl-appbar--large {
|
|
134
|
+
--md-sys-appbar-height: 120px;
|
|
135
|
+
--md-sys-appbar-padding-block-start: 4px;
|
|
136
|
+
--md-sys-appbar-padding-block-end: 12px;
|
|
137
|
+
|
|
138
|
+
padding-inline-start: 0;
|
|
139
|
+
|
|
140
|
+
.micl-appbar__headline {
|
|
141
|
+
grid-area: appbar-bottom;
|
|
142
|
+
margin: 0;
|
|
143
|
+
padding-inline-start: var(--md-sys-layout-window-margin);
|
|
144
|
+
|
|
145
|
+
h1, h2, h3, h4, h5, h6, .micl-heading {
|
|
146
|
+
@include typography.display-small;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
&:has(.micl-appbar__subtitle) {
|
|
150
|
+
--md-sys-appbar-height: 152px;
|
|
151
|
+
|
|
152
|
+
.micl-appbar__subtitle {
|
|
153
|
+
@include typography.title-medium;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.micl-body:not(:has(> .micl-pane:nth-child(2))) {
|
|
160
|
+
.micl-appbar:not(.micl-appbar--not-sticky) {
|
|
161
|
+
@include appbar-sticky;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
.micl-body:has(> .micl-pane:nth-child(2)) {
|
|
165
|
+
@media (max-width: layout.$md-sys-window-medium-min) {
|
|
166
|
+
.micl-appbar:not(.micl-appbar--not-sticky) {
|
|
167
|
+
@include appbar-sticky;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
@media (min-width: layout.$md-sys-window-medium-min) and (max-width: layout.$md-sys-window-medium-max) {
|
|
171
|
+
&.micl-body--stacked-to-expanded,
|
|
172
|
+
&.micl-body--stacked-to-large,
|
|
173
|
+
&.micl-body--stacked-to-extralarge {
|
|
174
|
+
.micl-appbar:not(.micl-appbar--not-sticky) {
|
|
175
|
+
@include appbar-sticky;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
@media (min-width: layout.$md-sys-window-expanded-min) and (max-width: layout.$md-sys-window-expanded-max) {
|
|
180
|
+
&.micl-body--stacked-to-large,
|
|
181
|
+
&.micl-body--stacked-to-extralarge {
|
|
182
|
+
.micl-appbar:not(.micl-appbar--not-sticky) {
|
|
183
|
+
@include appbar-sticky;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
@media (min-width: layout.$md-sys-window-large-min) and (max-width: layout.$md-sys-window-large-max) {
|
|
188
|
+
&.micl-body--stacked-to-extralarge {
|
|
189
|
+
.micl-appbar:not(.micl-appbar--not-sticky) {
|
|
190
|
+
@include appbar-sticky;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
@keyframes appbar-background {
|
|
197
|
+
0% {
|
|
198
|
+
background-color: inherit;
|
|
199
|
+
border-start-start-radius: inherit;
|
|
200
|
+
border-start-end-radius: inherit;
|
|
201
|
+
}
|
|
202
|
+
10% {
|
|
203
|
+
background-color: var(--md-sys-color-surface-container);
|
|
204
|
+
box-shadow: var(--md-sys-elevation-level2);
|
|
205
|
+
}
|
|
206
|
+
50% {
|
|
207
|
+
border-start-start-radius: 0;
|
|
208
|
+
border-start-end-radius: 0;
|
|
209
|
+
}
|
|
210
|
+
100% {
|
|
211
|
+
background-color: var(--md-sys-color-surface-container);
|
|
212
|
+
box-shadow: var(--md-sys-elevation-level2);
|
|
213
|
+
border-start-start-radius: 0;
|
|
214
|
+
border-start-end-radius: 0;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
@@ -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;
|
|
@@ -56,5 +56,14 @@ You can customize the appearance of the Checkbox component by overriding its glo
|
|
|
56
56
|
</div>
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
+
To vertically align a checkbox with its label, wrap both in an element that has the `micl-flex--vcenter` class.
|
|
60
|
+
|
|
61
|
+
```HTML
|
|
62
|
+
<div class="micl-flex--vcenter">
|
|
63
|
+
<input type="checkbox" id="mycheckbox" class="micl-checkbox">
|
|
64
|
+
<label for="mycheckbox">Checkbox</label>
|
|
65
|
+
</div>
|
|
66
|
+
```
|
|
67
|
+
|
|
59
68
|
## Compatibility
|
|
60
69
|
This component utilizes relative RGB color values, which may not be fully supported in your browser. Please check [Browser compatibility](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#browser_compatibility) for details.
|
|
@@ -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 {
|