material-inspired-component-library 7.0.2 → 8.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/.claude/settings.local.json +14 -0
- package/CLAUDE.md +53 -0
- package/README.md +6 -0
- package/components/accordion/README.md +6 -3
- package/components/alert/index.scss +5 -0
- package/components/appbar/index.scss +12 -0
- package/components/badge/index.scss +2 -0
- package/components/bottomsheet/index.scss +9 -0
- package/components/button/index.scss +33 -6
- package/components/card/README.md +4 -0
- package/components/card/index.scss +182 -150
- package/components/checkbox/index.scss +28 -6
- package/components/datepicker/index.scss +13 -0
- package/components/datepicker/index.ts +9 -9
- package/components/dialog/index.scss +21 -6
- package/components/iconbutton/index.scss +28 -6
- package/components/list/README.md +191 -32
- package/components/list/index.scss +281 -190
- package/components/list/index.ts +100 -100
- package/components/menu/README.md +199 -10
- package/components/menu/index.scss +242 -47
- package/components/menu/index.ts +74 -37
- package/components/navigationrail/index.scss +91 -68
- package/components/progressindicator/README.md +88 -0
- package/components/progressindicator/index.scss +225 -0
- package/components/progressindicator/index.ts +77 -0
- package/components/radio/index.scss +24 -6
- package/components/select/README.md +42 -5
- package/components/select/index.scss +45 -79
- package/components/shape/README.md +103 -0
- package/components/shape/_paths.generated.scss +64 -0
- package/components/shape/index.scss +66 -0
- package/components/shape/master.scss +28 -0
- package/components/sidesheet/index.scss +11 -0
- package/components/slider/index.scss +13 -0
- package/components/snackbar/index.scss +12 -0
- package/components/stepper/index.scss +3 -5
- package/components/switch/index.scss +9 -0
- package/components/textfield/index.scss +10 -1
- package/components/textfield/index.ts +2 -2
- package/components/timepicker/index.scss +16 -0
- package/dist/alert.css +1 -1
- package/dist/appbar.css +1 -1
- 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/components/list/index.d.ts +2 -2
- package/dist/components/progressindicator/index.d.ts +6 -0
- package/dist/datepicker.css +1 -1
- package/dist/dialog.css +1 -1
- package/dist/divider.css +1 -1
- package/dist/foundations/form/index.js +1 -0
- package/dist/foundations.css +1 -1
- package/dist/iconbutton.css +1 -1
- package/dist/layout.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/progressindicator.css +1 -0
- package/dist/progressindicator.js +1 -0
- package/dist/radio.css +1 -1
- package/dist/select.css +1 -1
- package/dist/shape.css +1 -0
- package/dist/shape.js +1 -0
- package/dist/sidesheet.css +1 -1
- package/dist/slider.css +1 -1
- package/dist/snackbar.css +1 -1
- package/dist/stepper.css +1 -1
- package/dist/switch.css +1 -1
- package/dist/textfield.css +1 -1
- package/dist/timepicker.css +1 -1
- package/docs/accordion.html +24 -24
- package/docs/bottomsheet.html +1 -4
- package/docs/datepicker.html +21 -21
- package/docs/dialog.html +1 -1
- package/docs/index.html +5 -4
- package/docs/list.html +38 -22
- package/docs/menu.html +246 -41
- package/docs/micl.css +1 -1
- package/docs/micl.js +1 -1
- package/docs/progressindicator.html +288 -0
- package/docs/select.html +68 -19
- package/docs/shape.css +1 -0
- package/docs/shape.js +1 -0
- package/docs/shapes.html +150 -0
- package/foundations/index.scss +0 -1
- package/foundations/layout/README.md +1 -1
- package/foundations/layout/index.scss +3 -0
- package/micl.ts +8 -1
- package/package.json +6 -4
- package/styles/README.md +90 -12
- package/styles/elevation.scss +46 -13
- package/styles/motion.scss +51 -47
- package/styles/shapes.scss +41 -26
- package/styles/statelayer.scss +93 -36
- package/styles/typography.scss +120 -322
- package/styles.scss +10 -6
- package/tools/shapes/check.mjs +42 -0
- package/tools/shapes/generate.mjs +834 -0
- package/webpack.config.js +16 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"permissions": {
|
|
3
|
+
"allow": [
|
|
4
|
+
"Bash(node *)",
|
|
5
|
+
"WebSearch",
|
|
6
|
+
"Bash(npm run *)",
|
|
7
|
+
"WebFetch(domain:raw.githubusercontent.com)",
|
|
8
|
+
"WebFetch(domain:android.googlesource.com)",
|
|
9
|
+
"WebFetch(domain:m3.material.io)",
|
|
10
|
+
"WebFetch(domain:github.com)",
|
|
11
|
+
"Bash(xargs grep -l \"body\\\\|html\")"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
}
|
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
+
|
|
5
|
+
## Project Overview
|
|
6
|
+
|
|
7
|
+
MICL is a Material Design 3 (M3 Expressive) UI component library written in Sass and TypeScript.
|
|
8
|
+
|
|
9
|
+
## Commands
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm run build # Compiles TypeScript + Sass via webpack, outputs to /dist/ and /docs/
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
There is no test suite, linter script, or dev server configured.
|
|
16
|
+
|
|
17
|
+
## Architecture
|
|
18
|
+
|
|
19
|
+
### Entry Points
|
|
20
|
+
|
|
21
|
+
- **`micl.ts`** — Main orchestrator. Initializes components lazily via a `MutationObserver` that watches for DOM insertions/removals. Handles event delegation for `input`, `change`, and `keydown` events, applies the ripple effect, and sets scrollbar CSS custom properties.
|
|
22
|
+
- **`styles.scss`** — Master stylesheet that imports all component and foundation Sass partials.
|
|
23
|
+
|
|
24
|
+
### Component Structure
|
|
25
|
+
|
|
26
|
+
Each component lives in `components/<name>/` and exports:
|
|
27
|
+
- A CSS selector string (e.g., `buttonSelector = 'button.micl-button--toggle'`)
|
|
28
|
+
- A handler object with `initialize(element)` / `cleanup(element)` methods and optional event handlers (`input`, `change`, `keydown`, `command`)
|
|
29
|
+
|
|
30
|
+
`micl.ts` imports every component handler, maps selectors to handlers, and drives the lifecycle using the MutationObserver + event delegation pattern.
|
|
31
|
+
|
|
32
|
+
### Styling System
|
|
33
|
+
|
|
34
|
+
- Sass uses `@use` (not `@import`); partials are namespaced.
|
|
35
|
+
- Theming is done entirely via CSS custom properties with `--md-comp-*` prefixes.
|
|
36
|
+
- `themes/` contains 11 colour themes, each with light, dark, and high-contrast variants.
|
|
37
|
+
- `styles/` contains Material Design tokens: typography, shapes, elevation, motion, state layers.
|
|
38
|
+
- `foundations/` contains the responsive layout system (breakpoints: compact ≤599 px, medium 600–839 px, expanded 840–1199 px, large 1200–1599 px, extra-large ≥1600 px).
|
|
39
|
+
|
|
40
|
+
### Coding
|
|
41
|
+
|
|
42
|
+
- The amount of TypeScript code should be minimized. Necessary functionality should be solved using SCSS only.
|
|
43
|
+
– The SCSS code can be verbose, but the compiled CSS code must be as small as possible.
|
|
44
|
+
|
|
45
|
+
### Documentation
|
|
46
|
+
|
|
47
|
+
- Component documentation is stored with the SCSS and JavaScript files. Always check if the documentation is up to date with regards to the implementation.
|
|
48
|
+
|
|
49
|
+
### Build
|
|
50
|
+
|
|
51
|
+
`webpack.config.js` produces two identical outputs: one to `/dist/` (npm distribution) and one to `/docs/` (live demo). TypeScript target is ES2022 with strict mode and declaration-file generation enabled.
|
|
52
|
+
|
|
53
|
+
The library compiles to a UMD bundle (`dist/micl.js`) and a CSS file (`dist/micl.css`) with zero runtime dependencies. In addition, a CSS and JavaScript pair of compiled files is created, so that a consumer may load only a subset of components.
|
package/README.md
CHANGED
|
@@ -124,6 +124,12 @@ The library currently consists of the following components:
|
|
|
124
124
|
|
|
125
125
|
## Change Log ↪️
|
|
126
126
|
|
|
127
|
+
### 8.0.0 (05.05.2026)
|
|
128
|
+
- **BREAKING**: Renamed many CSS custom properties from --md-sys- to --md-comp-.
|
|
129
|
+
- **List, Menu, Accordion, Select**: Aligned with latest MD3 spec.
|
|
130
|
+
- **Ripple**: Now starts on pointer-down.
|
|
131
|
+
- **Text field**: Outlined version uses CSS variable instead of inherited background.
|
|
132
|
+
|
|
127
133
|
### 7.0.0 (08.03.2026)
|
|
128
134
|
- **BREAKING**: Use `<a>` instead of `<label>` inside Navigation rail.
|
|
129
135
|
- **BREAKING**: Use `inert` for disabled cards instead of `micl-card--disabled`.
|
|
@@ -68,9 +68,9 @@ To ensure that only one accordion item within a group can be open at a time, add
|
|
|
68
68
|
</div>
|
|
69
69
|
</div>
|
|
70
70
|
</details>
|
|
71
|
-
<hr class="micl-divider">
|
|
71
|
+
<hr class="micl-divider-inset">
|
|
72
72
|
<details name="mygroup">
|
|
73
|
-
<summary class="micl-list-item-two"
|
|
73
|
+
<summary class="micl-list-item-two">
|
|
74
74
|
<span class="micl-list-item__text">
|
|
75
75
|
<span class="micl-list-item__headline">Country</span>
|
|
76
76
|
<span class="micl-list-item__supporting-text">The country of residence.</span>
|
|
@@ -110,6 +110,9 @@ Use a [Divider component](../divider/README.md) to separate neighbouring accordi
|
|
|
110
110
|
|
|
111
111
|
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.
|
|
112
112
|
|
|
113
|
+
## Keyboard
|
|
114
|
+
Each `<summary>` is a tab stop in document order — `Tab` and `Shift+Tab` move focus through the accordion headers. While focus is on a header, `Enter` or `Space` toggles the panel open or closed. As an optional enhancement, `ArrowDown` and `ArrowUp` move focus to the next or previous header in the same group; focus wraps around at the ends.
|
|
115
|
+
|
|
113
116
|
## Customizations
|
|
114
117
|
You can customize the appearance of the Accordion component by overriding its own global CSS variables and those from the List component. These variables are declared on the `:root` pseudo-class and can be changed on any appropriate parent element to affect its child accordions.
|
|
115
118
|
|
|
@@ -131,4 +134,4 @@ You can customize the appearance of the Accordion component by overriding its ow
|
|
|
131
134
|
```
|
|
132
135
|
|
|
133
136
|
## Compatibility
|
|
134
|
-
The
|
|
137
|
+
The Accordion component uses the `interpolate-size` CSS property to smoothly open and close the detail area of a Details disclosure element, which might not be supported in your browser. Please check [Browser compatibility](https://developer.mozilla.org/en-US/docs/Web/CSS/interpolate-size#browser_compatibility) for details.
|
|
@@ -23,6 +23,11 @@
|
|
|
23
23
|
@use '../../styles/shapes';
|
|
24
24
|
@use '../../styles/typography';
|
|
25
25
|
|
|
26
|
+
@include shapes.corner('small');
|
|
27
|
+
|
|
28
|
+
@include typography.scale('title-medium');
|
|
29
|
+
@include typography.scale('body-medium');
|
|
30
|
+
|
|
26
31
|
:root {
|
|
27
32
|
--md-sys-alert-padding: 16px;
|
|
28
33
|
--md-sys-alert-space: 16px;
|
|
@@ -26,6 +26,18 @@
|
|
|
26
26
|
@use '../../styles/statelayer';
|
|
27
27
|
@use '../../styles/typography';
|
|
28
28
|
|
|
29
|
+
@include elevation.level(0);
|
|
30
|
+
@include elevation.level(2);
|
|
31
|
+
|
|
32
|
+
@include shapes.corner('none');
|
|
33
|
+
|
|
34
|
+
@include typography.scale('display-small');
|
|
35
|
+
@include typography.scale('headline-medium');
|
|
36
|
+
@include typography.scale('title-large');
|
|
37
|
+
@include typography.scale('title-medium');
|
|
38
|
+
@include typography.scale('title-small');
|
|
39
|
+
@include typography.scale('label-medium');
|
|
40
|
+
|
|
29
41
|
@mixin appbar-sticky() {
|
|
30
42
|
position: sticky;
|
|
31
43
|
inset: unset;
|
|
@@ -25,6 +25,15 @@
|
|
|
25
25
|
@use '../../styles/shapes';
|
|
26
26
|
@use '../../styles/statelayer';
|
|
27
27
|
|
|
28
|
+
@include elevation.level(1);
|
|
29
|
+
|
|
30
|
+
@include shapes.corner('extra-large');
|
|
31
|
+
@include shapes.corner('small');
|
|
32
|
+
|
|
33
|
+
@include statelayer.token('focus-indicator-thickness');
|
|
34
|
+
@include statelayer.token('focus-indicator-outer-offset');
|
|
35
|
+
@include statelayer.token('backdrop-opacity');
|
|
36
|
+
|
|
28
37
|
dialog.micl-bottomsheet {
|
|
29
38
|
--md-sys-bottomsheet-height: max-content;
|
|
30
39
|
--md-sys-bottomsheet-margin: 56px;
|
|
@@ -26,6 +26,29 @@
|
|
|
26
26
|
@use '../../styles/statelayer';
|
|
27
27
|
@use '../../styles/typography';
|
|
28
28
|
|
|
29
|
+
@include elevation.level(0);
|
|
30
|
+
@include elevation.level(1);
|
|
31
|
+
|
|
32
|
+
@include shapes.corner('small');
|
|
33
|
+
@include shapes.corner('medium');
|
|
34
|
+
@include shapes.corner('large');
|
|
35
|
+
@include shapes.corner('extra-large');
|
|
36
|
+
|
|
37
|
+
@include statelayer.token('hover-state-layer-opacity');
|
|
38
|
+
@include statelayer.token('focus-state-layer-opacity');
|
|
39
|
+
@include statelayer.token('pressed-state-layer-opacity');
|
|
40
|
+
@include statelayer.token('disabled-state-layer-opacity');
|
|
41
|
+
@include statelayer.token('focus-indicator-thickness');
|
|
42
|
+
@include statelayer.token('ripple-opacity-factor');
|
|
43
|
+
@include statelayer.token('ripple-duration');
|
|
44
|
+
@include statelayer.property;
|
|
45
|
+
@include statelayer.keyframes;
|
|
46
|
+
|
|
47
|
+
@include typography.scale('headline-large');
|
|
48
|
+
@include typography.scale('headline-small');
|
|
49
|
+
@include typography.scale('title-medium');
|
|
50
|
+
@include typography.scale('label-large');
|
|
51
|
+
|
|
29
52
|
button.micl-button-text-xs,
|
|
30
53
|
a.micl-button-text-xs,
|
|
31
54
|
button.micl-button-text-s,
|
|
@@ -69,15 +92,20 @@ button.micl-button-outlined-xl {
|
|
|
69
92
|
border: none;
|
|
70
93
|
border-radius: calc(var(--micl-height) / 2);
|
|
71
94
|
background-image:
|
|
72
|
-
radial-gradient(
|
|
95
|
+
radial-gradient(
|
|
96
|
+
circle at var(--micl-x, center) var(--micl-y, center),
|
|
97
|
+
transparent 0%,
|
|
98
|
+
rgb(from var(--statelayer-color) r g b / calc(var(--statelayer-opacity) * var(--md-sys-state-ripple-opacity-factor))) 10%,
|
|
99
|
+
transparent 10%
|
|
100
|
+
),
|
|
73
101
|
linear-gradient(rgb(from var(--statelayer-color) r g b / var(--statelayer-opacity)));
|
|
74
102
|
background-repeat: no-repeat;
|
|
75
|
-
background-size:
|
|
103
|
+
background-size: 0%, 100%;
|
|
76
104
|
-webkit-tap-highlight-color: transparent;
|
|
77
105
|
cursor: pointer;
|
|
78
106
|
transition:
|
|
79
107
|
border-radius var(--md-sys-button-motion-duration) var(--md-sys-button-motion-effects),
|
|
80
|
-
background-size
|
|
108
|
+
background-size 0ms,
|
|
81
109
|
--statelayer-opacity var(--md-sys-button-motion-duration) linear;
|
|
82
110
|
|
|
83
111
|
&:disabled {
|
|
@@ -91,9 +119,8 @@ button.micl-button-outlined-xl {
|
|
|
91
119
|
outline: var(--md-sys-state-focus-indicator-thickness, 3px) solid var(--md-sys-color-secondary);
|
|
92
120
|
outline-offset: 3px;
|
|
93
121
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
transition: background-size 0ms;
|
|
122
|
+
&.micl-rippling {
|
|
123
|
+
animation: micl-ripple var(--md-sys-state-ripple-duration) motion.$md-sys-motion-easing-standard;
|
|
97
124
|
}
|
|
98
125
|
}
|
|
99
126
|
.micl-button__icon {
|
|
@@ -126,6 +126,7 @@ The Card component supports the following CSS variables, as defined in the [Mate
|
|
|
126
126
|
--md-comp-elevated-card-container-shape
|
|
127
127
|
--md-comp-elevated-card-disabled-container-elevation
|
|
128
128
|
--md-comp-elevated-card-disabled-container-color
|
|
129
|
+
--md-comp-elevated-card-disabled-container-opacity
|
|
129
130
|
--md-comp-elevated-card-hover-container-elevation
|
|
130
131
|
--md-comp-elevated-card-hover-state-layer-color
|
|
131
132
|
--md-comp-elevated-card-hover-state-layer-opacity
|
|
@@ -146,6 +147,7 @@ The Card component supports the following CSS variables, as defined in the [Mate
|
|
|
146
147
|
--md-comp-filled-card-container-shape
|
|
147
148
|
--md-comp-filled-card-disabled-container-elevation
|
|
148
149
|
--md-comp-filled-card-disabled-container-color
|
|
150
|
+
--md-comp-filled-card-disabled-container-opacity
|
|
149
151
|
--md-comp-filled-card-hover-container-elevation
|
|
150
152
|
--md-comp-filled-card-hover-state-layer-color
|
|
151
153
|
--md-comp-filled-card-hover-state-layer-opacity
|
|
@@ -166,7 +168,9 @@ The Card component supports the following CSS variables, as defined in the [Mate
|
|
|
166
168
|
--md-comp-outlined-card-container-shape
|
|
167
169
|
--md-comp-outlined-card-outline-width
|
|
168
170
|
--md-comp-outlined-card-outline-color
|
|
171
|
+
--md-comp-outlined-card-disabled-container-color
|
|
169
172
|
--md-comp-outlined-card-disabled-container-elevation
|
|
173
|
+
--md-comp-outlined-card-disabled-container-opacity
|
|
170
174
|
--md-comp-outlined-card-disabled-outline-color
|
|
171
175
|
--md-comp-outlined-card-disabled-outline-opacity
|
|
172
176
|
--md-comp-outlined-card-hover-container-elevation
|