material-inspired-component-library 8.0.4 → 8.1.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/CLAUDE.md +53 -0
- package/README.md +4 -0
- package/components/alert/index.scss +2 -2
- package/components/appbar/index.scss +2 -2
- package/components/bottomsheet/index.scss +3 -3
- package/components/button/index.scss +5 -5
- package/components/card/index.scss +3 -3
- package/components/checkbox/index.scss +2 -2
- package/components/datepicker/index.scss +3 -3
- package/components/dialog/index.scss +3 -3
- package/components/iconbutton/index.scss +6 -6
- package/components/list/index.scss +6 -6
- package/components/menu/index.scss +3 -3
- package/components/navigationrail/index.scss +2 -2
- package/components/radio/index.scss +2 -2
- package/components/select/index.scss +2 -2
- package/components/shapes/README.md +94 -0
- package/components/{shape → shapes}/_paths.generated.scss +0 -6
- package/components/{shape → shapes}/index.scss +10 -10
- package/components/{shape → shapes}/master.scss +3 -3
- package/components/sidesheet/index.scss +3 -3
- package/components/slider/index.scss +5 -5
- package/components/snackbar/index.scss +2 -2
- package/components/switch/index.scss +2 -2
- package/components/textfield/index.scss +2 -2
- package/components/timepicker/index.scss +3 -3
- package/dist/card.css +1 -1
- package/dist/micl.css +1 -1
- package/dist/shapes.css +1 -0
- package/docs/index.html +104 -89
- package/docs/menu.html +1 -1
- package/docs/micl.css +1 -1
- package/docs/shapes.css +1 -0
- package/docs/shapes.html +49 -40
- package/foundations/layout/index.scss +2 -2
- package/package.json +2 -1
- package/styles/elevation.scss +10 -7
- package/styles/motion.scss +12 -19
- package/styles/{shapes.scss → shape.scss} +6 -4
- package/styles/statelayer.scss +32 -45
- package/styles/typography.scss +4 -5
- package/styles.scss +1 -4
- package/tools/shapes/check.mjs +1 -1
- package/tools/shapes/generate.mjs +2 -8
- package/webpack.config.js +2 -2
- package/components/shape/README.md +0 -103
- package/dist/shape.css +0 -1
- package/docs/shape.css +0 -1
- /package/dist/{shape.js → shapes.js} +0 -0
- /package/docs/{shape.js → shapes.js} +0 -0
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
|
@@ -114,6 +114,7 @@ The library currently consists of the following components:
|
|
|
114
114
|
- [x] [Navigation rail](components/navigationrail/README.md)
|
|
115
115
|
- [x] [Radio button](components/radio/README.md)
|
|
116
116
|
- [x] [Select](components/select/README.md)
|
|
117
|
+
- [x] [Shapes](components/shapes/README.md)
|
|
117
118
|
- [x] [Side sheet](components/sidesheet/README.md)
|
|
118
119
|
- [x] [Slider](components/slider/README.md)
|
|
119
120
|
- [x] [Snackbar](components/snackbar/README.md)
|
|
@@ -124,6 +125,9 @@ The library currently consists of the following components:
|
|
|
124
125
|
|
|
125
126
|
## Change Log ↪️
|
|
126
127
|
|
|
128
|
+
### 8.1.0 (24.06.2026)
|
|
129
|
+
- **Shapes**: The Material shape library supported as the 'Shapes' component.
|
|
130
|
+
|
|
127
131
|
### 8.0.0 (05.05.2026)
|
|
128
132
|
- **BREAKING**: Renamed many CSS custom properties from --md-sys- to --md-comp-.
|
|
129
133
|
- **List, Menu, Accordion, Select**: Aligned with latest MD3 spec.
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
// SOFTWARE.
|
|
21
21
|
|
|
22
22
|
@use '../../foundations';
|
|
23
|
-
@use '../../styles/
|
|
23
|
+
@use '../../styles/shape';
|
|
24
24
|
@use '../../styles/typography';
|
|
25
25
|
|
|
26
|
-
@include
|
|
26
|
+
@include shape.corner('small');
|
|
27
27
|
|
|
28
28
|
@include typography.scale('title-medium');
|
|
29
29
|
@include typography.scale('body-medium');
|
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
@use '../../foundations';
|
|
23
23
|
@use '../../foundations/layout';
|
|
24
24
|
@use '../../styles/elevation';
|
|
25
|
-
@use '../../styles/
|
|
25
|
+
@use '../../styles/shape';
|
|
26
26
|
@use '../../styles/statelayer';
|
|
27
27
|
@use '../../styles/typography';
|
|
28
28
|
|
|
29
29
|
@include elevation.level(0);
|
|
30
30
|
@include elevation.level(2);
|
|
31
31
|
|
|
32
|
-
@include
|
|
32
|
+
@include shape.corner('none');
|
|
33
33
|
|
|
34
34
|
@include typography.scale('display-small');
|
|
35
35
|
@include typography.scale('headline-medium');
|
|
@@ -22,13 +22,13 @@
|
|
|
22
22
|
@use '../../foundations';
|
|
23
23
|
@use '../../styles/elevation';
|
|
24
24
|
@use '../../styles/motion';
|
|
25
|
-
@use '../../styles/
|
|
25
|
+
@use '../../styles/shape';
|
|
26
26
|
@use '../../styles/statelayer';
|
|
27
27
|
|
|
28
28
|
@include elevation.level(1);
|
|
29
29
|
|
|
30
|
-
@include
|
|
31
|
-
@include
|
|
30
|
+
@include shape.corner('extra-large');
|
|
31
|
+
@include shape.corner('small');
|
|
32
32
|
|
|
33
33
|
@include statelayer.token('focus-indicator-thickness');
|
|
34
34
|
@include statelayer.token('focus-indicator-outer-offset');
|
|
@@ -22,17 +22,17 @@
|
|
|
22
22
|
@use '../../foundations';
|
|
23
23
|
@use '../../styles/elevation';
|
|
24
24
|
@use '../../styles/motion';
|
|
25
|
-
@use '../../styles/
|
|
25
|
+
@use '../../styles/shape';
|
|
26
26
|
@use '../../styles/statelayer';
|
|
27
27
|
@use '../../styles/typography';
|
|
28
28
|
|
|
29
29
|
@include elevation.level(0);
|
|
30
30
|
@include elevation.level(1);
|
|
31
31
|
|
|
32
|
-
@include
|
|
33
|
-
@include
|
|
34
|
-
@include
|
|
35
|
-
@include
|
|
32
|
+
@include shape.corner('small');
|
|
33
|
+
@include shape.corner('medium');
|
|
34
|
+
@include shape.corner('large');
|
|
35
|
+
@include shape.corner('extra-large');
|
|
36
36
|
|
|
37
37
|
@include statelayer.token('hover-state-layer-opacity');
|
|
38
38
|
@include statelayer.token('focus-state-layer-opacity');
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
@use '../../foundations';
|
|
24
24
|
@use '../../styles/elevation';
|
|
25
25
|
@use '../../styles/motion';
|
|
26
|
-
@use '../../styles/
|
|
26
|
+
@use '../../styles/shape';
|
|
27
27
|
@use '../../styles/statelayer';
|
|
28
28
|
@use '../../styles/typography';
|
|
29
29
|
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
@include elevation.level(3);
|
|
34
34
|
@include elevation.level(4);
|
|
35
35
|
|
|
36
|
-
@include
|
|
36
|
+
@include shape.corner('medium');
|
|
37
37
|
|
|
38
38
|
@include statelayer.token('hover-state-layer-opacity');
|
|
39
39
|
@include statelayer.token('focus-state-layer-opacity');
|
|
@@ -236,7 +236,7 @@
|
|
|
236
236
|
|
|
237
237
|
.micl-card__image {
|
|
238
238
|
grid-column: 1;
|
|
239
|
-
grid-row: 1 /
|
|
239
|
+
grid-row: 1 / span 4;
|
|
240
240
|
block-size: 100%;
|
|
241
241
|
background-size: cover;
|
|
242
242
|
}
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
|
|
22
22
|
@use '../../foundations';
|
|
23
23
|
@use '../../styles/motion';
|
|
24
|
-
@use '../../styles/
|
|
24
|
+
@use '../../styles/shape';
|
|
25
25
|
@use '../../styles/statelayer';
|
|
26
26
|
@use '../../styles/typography';
|
|
27
27
|
|
|
28
|
-
@include
|
|
28
|
+
@include shape.corner('full');
|
|
29
29
|
|
|
30
30
|
@include statelayer.token('layer-size');
|
|
31
31
|
@include statelayer.token('hover-state-layer-opacity');
|
|
@@ -21,12 +21,12 @@
|
|
|
21
21
|
|
|
22
22
|
@use '../../foundations';
|
|
23
23
|
@use '../../styles/motion';
|
|
24
|
-
@use '../../styles/
|
|
24
|
+
@use '../../styles/shape';
|
|
25
25
|
@use '../../styles/statelayer';
|
|
26
26
|
@use '../../styles/typography';
|
|
27
27
|
|
|
28
|
-
@include
|
|
29
|
-
@include
|
|
28
|
+
@include shape.corner('large');
|
|
29
|
+
@include shape.corner('full');
|
|
30
30
|
|
|
31
31
|
@include statelayer.token('hover-state-layer-opacity');
|
|
32
32
|
@include statelayer.token('focus-state-layer-opacity');
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
@use '../../foundations';
|
|
23
23
|
@use '../../styles/elevation';
|
|
24
24
|
@use '../../styles/motion';
|
|
25
|
-
@use '../../styles/
|
|
25
|
+
@use '../../styles/shape';
|
|
26
26
|
@use '../../styles/statelayer';
|
|
27
27
|
@use '../../styles/typography';
|
|
28
28
|
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
@include elevation.level(2);
|
|
31
31
|
@include elevation.level(3);
|
|
32
32
|
|
|
33
|
-
@include
|
|
34
|
-
@include
|
|
33
|
+
@include shape.corner('none');
|
|
34
|
+
@include shape.corner('extra-large');
|
|
35
35
|
|
|
36
36
|
@include statelayer.token('hover-state-layer-opacity');
|
|
37
37
|
@include statelayer.token('backdrop-opacity');
|
|
@@ -22,16 +22,16 @@
|
|
|
22
22
|
@use '../../foundations';
|
|
23
23
|
@use '../../styles/elevation';
|
|
24
24
|
@use '../../styles/motion';
|
|
25
|
-
@use '../../styles/
|
|
25
|
+
@use '../../styles/shape';
|
|
26
26
|
@use '../../styles/statelayer';
|
|
27
27
|
|
|
28
28
|
@include elevation.level(0);
|
|
29
29
|
|
|
30
|
-
@include
|
|
31
|
-
@include
|
|
32
|
-
@include
|
|
33
|
-
@include
|
|
34
|
-
@include
|
|
30
|
+
@include shape.corner('small');
|
|
31
|
+
@include shape.corner('medium');
|
|
32
|
+
@include shape.corner('large');
|
|
33
|
+
@include shape.corner('extra-large');
|
|
34
|
+
@include shape.corner('full');
|
|
35
35
|
|
|
36
36
|
@include statelayer.token('hover-state-layer-opacity');
|
|
37
37
|
@include statelayer.token('focus-state-layer-opacity');
|
|
@@ -22,17 +22,17 @@
|
|
|
22
22
|
@use '../../foundations';
|
|
23
23
|
@use '../../styles/elevation';
|
|
24
24
|
@use '../../styles/motion';
|
|
25
|
-
@use '../../styles/
|
|
25
|
+
@use '../../styles/shape';
|
|
26
26
|
@use '../../styles/statelayer';
|
|
27
27
|
@use '../../styles/typography';
|
|
28
28
|
|
|
29
29
|
@include elevation.level(4);
|
|
30
30
|
|
|
31
|
-
@include
|
|
32
|
-
@include
|
|
33
|
-
@include
|
|
34
|
-
@include
|
|
35
|
-
@include
|
|
31
|
+
@include shape.corner('extra-small');
|
|
32
|
+
@include shape.corner('small');
|
|
33
|
+
@include shape.corner('medium');
|
|
34
|
+
@include shape.corner('large');
|
|
35
|
+
@include shape.corner('full');
|
|
36
36
|
|
|
37
37
|
@include statelayer.token('hover-state-layer-opacity');
|
|
38
38
|
@include statelayer.token('focus-state-layer-opacity');
|
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
@use '../../foundations';
|
|
23
23
|
@use '../../styles/elevation';
|
|
24
24
|
@use '../../styles/motion';
|
|
25
|
-
@use '../../styles/
|
|
25
|
+
@use '../../styles/shape';
|
|
26
26
|
@use '../../styles/statelayer';
|
|
27
27
|
@use '../../styles/typography';
|
|
28
28
|
|
|
29
29
|
@include elevation.level(2);
|
|
30
30
|
|
|
31
|
-
@include
|
|
32
|
-
@include
|
|
31
|
+
@include shape.corner('small');
|
|
32
|
+
@include shape.corner('large');
|
|
33
33
|
|
|
34
34
|
@include statelayer.token('hover-state-layer-opacity');
|
|
35
35
|
@include statelayer.token('focus-state-layer-opacity');
|
|
@@ -23,14 +23,14 @@
|
|
|
23
23
|
@use '../../foundations/layout';
|
|
24
24
|
@use '../../styles/elevation';
|
|
25
25
|
@use '../../styles/motion';
|
|
26
|
-
@use '../../styles/
|
|
26
|
+
@use '../../styles/shape';
|
|
27
27
|
@use '../../styles/statelayer';
|
|
28
28
|
@use '../../styles/typography';
|
|
29
29
|
|
|
30
30
|
@include elevation.level(0);
|
|
31
31
|
@include elevation.level(2);
|
|
32
32
|
|
|
33
|
-
@include
|
|
33
|
+
@include shape.corner('large');
|
|
34
34
|
|
|
35
35
|
@include statelayer.token('hover-state-layer-opacity');
|
|
36
36
|
@include statelayer.token('focus-state-layer-opacity');
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
|
|
22
22
|
@use '../../foundations';
|
|
23
23
|
@use '../../styles/motion';
|
|
24
|
-
@use '../../styles/
|
|
24
|
+
@use '../../styles/shape';
|
|
25
25
|
@use '../../styles/statelayer';
|
|
26
26
|
|
|
27
|
-
@include
|
|
27
|
+
@include shape.corner('full');
|
|
28
28
|
|
|
29
29
|
@include statelayer.token('layer-size');
|
|
30
30
|
@include statelayer.token('hover-state-layer-opacity');
|
|
@@ -22,13 +22,13 @@
|
|
|
22
22
|
@use '../../foundations';
|
|
23
23
|
@use '../../styles/elevation';
|
|
24
24
|
@use '../../styles/motion';
|
|
25
|
-
@use '../../styles/
|
|
25
|
+
@use '../../styles/shape';
|
|
26
26
|
@use '../../styles/statelayer';
|
|
27
27
|
@use '../../styles/typography';
|
|
28
28
|
|
|
29
29
|
@include elevation.level(2);
|
|
30
30
|
|
|
31
|
-
@include
|
|
31
|
+
@include shape.corner('large');
|
|
32
32
|
|
|
33
33
|
@include statelayer.token('disabled-state-layer-opacity');
|
|
34
34
|
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# Shapes
|
|
2
|
+
The Shapes component renders [Material Design 3 Expressive Shapes](https://m3.material.io/styles/shape/overview-principles) as inline SVGs whose `d` attribute is supplied by CSS. Because the path data is set with `d:` rather than baked into the SVG markup, swapping a shape's class triggers a smooth `transition: d` morph between the old and new outline.
|
|
3
|
+
|
|
4
|
+
## Basic Usage
|
|
5
|
+
|
|
6
|
+
### HTML
|
|
7
|
+
A shape is an empty `<svg>` with the base class `micl-shapes` plus one of the shape modifier classes:
|
|
8
|
+
|
|
9
|
+
```HTML
|
|
10
|
+
<svg class="micl-shapes micl-shapes--diamond"><path /></svg>
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### CSS
|
|
14
|
+
|
|
15
|
+
The Shapes component is **opt-in** — it is not included in the master `micl.css` bundle, because most apps don't need 35 decorative shapes. Pick one of three integration paths:
|
|
16
|
+
|
|
17
|
+
**1. Import only the shapes you actually use:**
|
|
18
|
+
|
|
19
|
+
```SCSS
|
|
20
|
+
@use "material-inspired-component-library/components/shapes" as shapes;
|
|
21
|
+
|
|
22
|
+
@include shapes.base;
|
|
23
|
+
@include shapes.use("circle", "heart", "pill");
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
`shapes.base` emits the shared `.micl-shapes`, `.micl-shapes--outlined`, and `.micl-shapes--shadowed` rules. `shapes.use(<names>...)` emits one `.micl-shapes--<name> > path { d: … }` rule per name.
|
|
27
|
+
|
|
28
|
+
**2. Import the whole gallery via Sass:**
|
|
29
|
+
|
|
30
|
+
```SCSS
|
|
31
|
+
@use "material-inspired-component-library/components/shapes" with ($master: true);
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Equivalent to calling `shapes.base` plus `shapes.use(…)` with every shape.
|
|
35
|
+
|
|
36
|
+
**3. Drop in the prebuilt CSS:**
|
|
37
|
+
|
|
38
|
+
```HTML
|
|
39
|
+
<link rel="stylesheet" href="material-inspired-component-library/dist/shapes.css">
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
The prebuilt bundle contains all 35 shapes plus the base styles.
|
|
43
|
+
|
|
44
|
+
### JavaScript
|
|
45
|
+
No JavaScript is required. Morphing between shapes is a pure CSS animation: when you replace `micl-shapes--diamond` with `micl-shapes--pill` on the element, the browser interpolates the `d:` value automatically. The morph timing can be customised via two CSS custom properties on the element:
|
|
46
|
+
|
|
47
|
+
| Custom property | Default | Description |
|
|
48
|
+
| --------------- | ------- | ----------- |
|
|
49
|
+
| `--micl-shapes-morph-duration` | `0ms` | Length of the morph transition |
|
|
50
|
+
| `--micl-shapes-morph-easing` | `ease-in-out` | Easing curve of the transition |
|
|
51
|
+
|
|
52
|
+
### Live Demo
|
|
53
|
+
A live example of the [Shapes component](https://henkpb.github.io/micl/shapes.html) is available, with a button per shape that morphs the demo SVGs.
|
|
54
|
+
|
|
55
|
+
## Variants
|
|
56
|
+
The available shape names (use these as the `micl-shapes--<name>` class and as arguments to `shapes.use(...)`):
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
circle, square, slanted, arch, semicircle, oval, pill,
|
|
60
|
+
triangle, arrow, fan, diamond, clamshell, pentagon, gem,
|
|
61
|
+
very-sunny, sunny, cookie-4, cookie-6, cookie-7, cookie-9,
|
|
62
|
+
cookie-12, clover-4, clover-8, burst, soft-burst, boom,
|
|
63
|
+
soft-boom, flower, puffy, puffy-diamond, ghost-ish,
|
|
64
|
+
pixel-circle, pixel-triangle, bun, heart
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Optional modifier classes:
|
|
68
|
+
|
|
69
|
+
| Class | Effect |
|
|
70
|
+
| --- | --- |
|
|
71
|
+
| `micl-shapes--outlined` | Renders the shape as a stroked outline instead of a filled fill |
|
|
72
|
+
| `micl-shapes--shadowed` | Adds a soft drop-shadow filter |
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
## Customizations
|
|
76
|
+
The base styles size the SVG to 100 × 100 px, fill it with the application's primary color, and let it overflow its viewBox horizontally (so wide shapes like *pill* and *fan* are not clipped). Override these on the element or on a parent:
|
|
77
|
+
|
|
78
|
+
```HTML
|
|
79
|
+
<svg class="micl-shape micl-shape--diamond"
|
|
80
|
+
viewBox="0 0 100 100"
|
|
81
|
+
style="inline-size:64px;block-size:64px;fill:var(--md-sys-color-secondary)">
|
|
82
|
+
<path />
|
|
83
|
+
</svg>
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
For `micl-shape--outlined`, the stroke colour and width are controlled by the standard SVG `stroke` and `stroke-width` properties:
|
|
87
|
+
|
|
88
|
+
```HTML
|
|
89
|
+
<svg class="micl-shape micl-shape--outlined micl-shape--pill"
|
|
90
|
+
viewBox="0 0 100 100"
|
|
91
|
+
style="stroke:var(--md-sys-color-outline);stroke-width:3">
|
|
92
|
+
<path />
|
|
93
|
+
</svg>
|
|
94
|
+
```
|
|
@@ -19,12 +19,6 @@
|
|
|
19
19
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
20
|
// SOFTWARE.
|
|
21
21
|
|
|
22
|
-
//
|
|
23
|
-
// GENERATED by tools/shapes/generate.mjs — do not edit by hand.
|
|
24
|
-
// Regenerate with `npm run gen:shapes` after changing the generator
|
|
25
|
-
// or any shape parameter. CI fails (`npm run check:shapes`) if this
|
|
26
|
-
// file is out of date.
|
|
27
|
-
//
|
|
28
22
|
$paths: (
|
|
29
23
|
circle: 'M 50 0 L 52.4533837164 0.0602271897 L 54.9008570165 0.2407636664 L 57.3365237228 0.5411745018 L 59.7545161008 0.9607359798 L 62.1490089952 1.4984373403 L 64.5142338627 2.1529832134 L 66.8444926696 2.9227967408 L 69.1341716183 3.8060233744 L 71.3777546715 4.8005353438 L 73.5698368413 5.9039367826 L 75.7051372097 7.1135695 L 77.778511651 8.4265193849 L 79.7849652246 9.839623426 L 81.7196642082 11.3494773319 L 83.5779477424 12.9524437323 L 85.3553390593 14.6446609407 L 87.0475562677 16.4220522576 L 88.6505226681 18.2803357918 L 90.160376574 20.2150347754 L 91.5734806151 22.221488349 L 92.8864305 24.2948627903 L 94.0960632174 26.4301631587 L 95.1994646562 28.6222453285 L 96.1939766256 30.8658283817 L 97.0772032592 33.1555073304 L 97.8470167866 35.4857661373 L 98.5015626597 37.8509910048 L 99.0392640202 40.2454838992 L 99.4588254982 42.6634762772 L 99.7592363336 45.0991429835 L 99.9397728103 47.5466162836 L 100 50 L 99.9397728103 52.4533837164 L 99.7592363336 54.9008570165 L 99.4588254982 57.3365237228 L 99.0392640202 59.7545161008 L 98.5015626597 62.1490089952 L 97.8470167866 64.5142338627 L 97.0772032592 66.8444926696 L 96.1939766256 69.1341716183 L 95.1994646562 71.3777546715 L 94.0960632174 73.5698368413 L 92.8864305 75.7051372097 L 91.5734806151 77.778511651 L 90.160376574 79.7849652246 L 88.6505226681 81.7196642082 L 87.0475562677 83.5779477424 L 85.3553390593 85.3553390593 L 83.5779477424 87.0475562677 L 81.7196642082 88.6505226681 L 79.7849652246 90.160376574 L 77.778511651 91.5734806151 L 75.7051372097 92.8864305 L 73.5698368413 94.0960632174 L 71.3777546715 95.1994646562 L 69.1341716183 96.1939766256 L 66.8444926696 97.0772032592 L 64.5142338627 97.8470167866 L 62.1490089952 98.5015626597 L 59.7545161008 99.0392640202 L 57.3365237228 99.4588254982 L 54.9008570165 99.7592363336 L 52.4533837164 99.9397728103 L 50 100 L 47.5466162836 99.9397728103 L 45.0991429835 99.7592363336 L 42.6634762772 99.4588254982 L 40.2454838992 99.0392640202 L 37.8509910048 98.5015626597 L 35.4857661373 97.8470167866 L 33.1555073304 97.0772032592 L 30.8658283817 96.1939766256 L 28.6222453285 95.1994646562 L 26.4301631587 94.0960632174 L 24.2948627903 92.8864305 L 22.221488349 91.5734806151 L 20.2150347754 90.160376574 L 18.2803357918 88.6505226681 L 16.4220522576 87.0475562677 L 14.6446609407 85.3553390593 L 12.9524437323 83.5779477424 L 11.3494773319 81.7196642082 L 9.839623426 79.7849652246 L 8.4265193849 77.778511651 L 7.1135695 75.7051372097 L 5.9039367826 73.5698368413 L 4.8005353438 71.3777546715 L 3.8060233744 69.1341716183 L 2.9227967408 66.8444926696 L 2.1529832134 64.5142338627 L 1.4984373403 62.1490089952 L 0.9607359798 59.7545161008 L 0.5411745018 57.3365237228 L 0.2407636664 54.9008570165 L 0.0602271897 52.4533837164 L 0 50 L 0.0602271897 47.5466162836 L 0.2407636664 45.0991429835 L 0.5411745018 42.6634762772 L 0.9607359798 40.2454838992 L 1.4984373403 37.8509910048 L 2.1529832134 35.4857661373 L 2.9227967408 33.1555073304 L 3.8060233744 30.8658283817 L 4.8005353438 28.6222453285 L 5.9039367826 26.4301631587 L 7.1135695 24.2948627903 L 8.4265193849 22.221488349 L 9.839623426 20.2150347754 L 11.3494773319 18.2803357918 L 12.9524437323 16.4220522576 L 14.6446609407 14.6446609407 L 16.4220522576 12.9524437323 L 18.2803357918 11.3494773319 L 20.2150347754 9.839623426 L 22.221488349 8.4265193849 L 24.2948627903 7.1135695 L 26.4301631587 5.9039367826 L 28.6222453285 4.8005353438 L 30.8658283817 3.8060233744 L 33.1555073304 2.9227967408 L 35.4857661373 2.1529832134 L 37.8509910048 1.4984373403 L 40.2454838992 0.9607359798 L 42.6634762772 0.5411745018 L 45.0991429835 0.2407636664 L 47.5466162836 0.0602271897 Z',
|
|
30
24
|
square: 'M 49.0583508946 0 L 51.780972451 0 L 54.5035940073 0 L 57.2262155637 0 L 59.9488371201 0 L 62.6714586764 0 L 65.3940802328 0 L 68.1167017892 0 L 70.8392138549 0.0117402955 L 73.5535819094 0.2112092287 L 76.2387016876 0.6558591665 L 78.872472918 1.3420303525 L 81.4332179608 2.264075154 L 83.899860229 3.4144045466 L 86.2520976622 4.7835505755 L 88.4705698257 6.360244284 L 90.5370172595 8.1315084635 L 92.4344317655 10.0827644649 L 94.1471963956 12.19795219 L 95.6612139899 14.4596622764 L 96.9640232047 16.849279388 L 98.0449010781 19.3471354314 L 98.8949512865 21.9326714365 L 99.5071773671 24.5846067707 L 99.8765403035 27.2811142919 L 100 30 L 100 32.7226215564 L 100 35.4452431127 L 100 38.1678646691 L 100 40.8904862255 L 100 43.6131077819 L 100 46.3357293382 L 100 49.0583508946 L 100 51.780972451 L 100 54.5035940073 L 100 57.2262155637 L 100 59.9488371201 L 100 62.6714586764 L 100 65.3940802328 L 100 68.1167017892 L 99.9882597045 70.8392138549 L 99.7887907713 73.5535819094 L 99.3441408335 76.2387016876 L 98.6579696475 78.872472918 L 97.735924846 81.4332179608 L 96.5855954534 83.899860229 L 95.2164494245 86.2520976622 L 93.639755716 88.4705698257 L 91.8684915365 90.5370172595 L 89.9172355351 92.4344317655 L 87.80204781 94.1471963956 L 85.5403377236 95.6612139899 L 83.150720612 96.9640232047 L 80.6528645686 98.0449010781 L 78.0673285635 98.8949512865 L 75.4153932293 99.5071773671 L 72.7188857081 99.8765403035 L 70 100 L 67.2773784436 100 L 64.5547568873 100 L 61.8321353309 100 L 59.1095137745 100 L 56.3868922181 100 L 53.6642706618 100 L 50.9416491054 100 L 48.219027549 100 L 45.4964059927 100 L 42.7737844363 100 L 40.0511628799 100 L 37.3285413236 100 L 34.6059197672 100 L 31.8832982108 100 L 29.1607861451 99.9882597045 L 26.4464180906 99.7887907713 L 23.7612983124 99.3441408335 L 21.127527082 98.6579696475 L 18.5667820392 97.735924846 L 16.100139771 96.5855954534 L 13.7479023378 95.2164494245 L 11.5294301743 93.639755716 L 9.4629827405 91.8684915365 L 7.5655682345 89.9172355351 L 5.8528036044 87.80204781 L 4.3387860101 85.5403377236 L 3.0359767953 83.150720612 L 1.9550989219 80.6528645686 L 1.1050487135 78.0673285635 L 0.4928226329 75.4153932293 L 0.1234596965 72.7188857081 L 0 70 L 0 67.2773784436 L 0 64.5547568873 L 0 61.8321353309 L 0 59.1095137745 L 0 56.3868922181 L 0 53.6642706618 L 0 50.9416491054 L 0 48.219027549 L 0 45.4964059927 L 0 42.7737844363 L 0 40.0511628799 L 0 37.3285413236 L 0 34.6059197672 L 0 31.8832982108 L 0.0117402955 29.1607861451 L 0.2112092287 26.4464180906 L 0.6558591665 23.7612983124 L 1.3420303525 21.127527082 L 2.264075154 18.5667820392 L 3.4144045466 16.100139771 L 4.7835505755 13.7479023378 L 6.360244284 11.5294301743 L 8.1315084635 9.4629827405 L 10.0827644649 7.5655682345 L 12.19795219 5.8528036044 L 14.4596622764 4.3387860101 L 16.849279388 3.0359767953 L 19.3471354314 1.9550989219 L 21.9326714365 1.1050487135 L 24.5846067707 0.4928226329 L 27.2811142919 0.1234596965 L 30 0 L 32.7226215564 0 L 35.4452431127 0 L 38.1678646691 0 L 40.8904862255 0 L 43.6131077819 0 L 46.3357293382 0 Z',
|
|
@@ -24,28 +24,28 @@
|
|
|
24
24
|
|
|
25
25
|
//
|
|
26
26
|
// Set $master: true to install the base styles + every shape in one go. When false (default),
|
|
27
|
-
// consumers opt in via `@include
|
|
27
|
+
// consumers opt in via `@include shapes.base` and `@include shapes.use(<names>...)`.
|
|
28
28
|
//
|
|
29
29
|
$master: false !default;
|
|
30
30
|
|
|
31
31
|
@mixin base {
|
|
32
|
-
.micl-
|
|
33
|
-
--md-sys-
|
|
32
|
+
.micl-shapes {
|
|
33
|
+
--md-sys-shapes-aspect-ratio: 1;
|
|
34
34
|
inline-size: 100px;
|
|
35
35
|
block-size: 100px;
|
|
36
|
-
fill:
|
|
36
|
+
fill: var(--md-sys-color-primary);
|
|
37
37
|
overflow: visible;
|
|
38
38
|
}
|
|
39
|
-
.micl-
|
|
40
|
-
transition: d var(--morph-duration, 0ms) var(--morph-easing, ease-in-out);
|
|
39
|
+
.micl-shapes > path {
|
|
40
|
+
transition: d var(--micl-shapes-morph-duration, 0ms) var(--micl-shapes-morph-easing, ease-in-out);
|
|
41
41
|
}
|
|
42
|
-
.micl-
|
|
42
|
+
.micl-shapes--outlined {
|
|
43
43
|
fill: none;
|
|
44
|
-
stroke:
|
|
44
|
+
stroke: var(--md-sys-color-primary);
|
|
45
45
|
stroke-width: 2;
|
|
46
46
|
stroke-linejoin: round;
|
|
47
47
|
}
|
|
48
|
-
.micl-
|
|
48
|
+
.micl-shapes--shadowed {
|
|
49
49
|
filter: drop-shadow(0 2px 4px rgb(0 0 0 / 0.25));
|
|
50
50
|
}
|
|
51
51
|
}
|
|
@@ -56,7 +56,7 @@ $master: false !default;
|
|
|
56
56
|
@if $d == null {
|
|
57
57
|
@error "Unknown shape '#{$name}'. Available: #{map.keys(paths.$paths)}.";
|
|
58
58
|
}
|
|
59
|
-
.micl-
|
|
59
|
+
.micl-shapes--#{$name} > path { d: path('#{$d}'); }
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
// SOFTWARE.
|
|
21
21
|
|
|
22
22
|
//
|
|
23
|
-
// Webpack entry for the standalone dist/
|
|
24
|
-
// bundle ships every shape. Consumers who want a subset should @use components/
|
|
25
|
-
// call
|
|
23
|
+
// Webpack entry for the standalone dist/shapes.css bundle. Loads index.scss in master mode so the
|
|
24
|
+
// bundle ships every shape. Consumers who want a subset should @use components/shapes directly and
|
|
25
|
+
// call shapes.use(<names>...).
|
|
26
26
|
//
|
|
27
27
|
|
|
28
28
|
@use 'index' with ($master: true);
|
|
@@ -23,15 +23,15 @@
|
|
|
23
23
|
@use '../../foundations/layout';
|
|
24
24
|
@use '../../styles/elevation';
|
|
25
25
|
@use '../../styles/motion';
|
|
26
|
-
@use '../../styles/
|
|
26
|
+
@use '../../styles/shape';
|
|
27
27
|
@use '../../styles/statelayer';
|
|
28
28
|
@use '../../styles/typography';
|
|
29
29
|
|
|
30
30
|
@include elevation.level(0);
|
|
31
31
|
@include elevation.level(1);
|
|
32
32
|
|
|
33
|
-
@include
|
|
34
|
-
@include
|
|
33
|
+
@include shape.corner('none');
|
|
34
|
+
@include shape.corner('large');
|
|
35
35
|
|
|
36
36
|
@include statelayer.token('backdrop-opacity');
|
|
37
37
|
|
|
@@ -21,14 +21,14 @@
|
|
|
21
21
|
|
|
22
22
|
@use '../../foundations';
|
|
23
23
|
@use '../../styles/motion';
|
|
24
|
-
@use '../../styles/
|
|
24
|
+
@use '../../styles/shape';
|
|
25
25
|
@use '../../styles/statelayer';
|
|
26
26
|
@use '../../styles/typography';
|
|
27
27
|
|
|
28
|
-
@include
|
|
29
|
-
@include
|
|
30
|
-
@include
|
|
31
|
-
@include
|
|
28
|
+
@include shape.corner('small');
|
|
29
|
+
@include shape.corner('medium');
|
|
30
|
+
@include shape.corner('large');
|
|
31
|
+
@include shape.corner('extra-large');
|
|
32
32
|
|
|
33
33
|
@include statelayer.token('disabled-state-layer-opacity');
|
|
34
34
|
@include statelayer.token('focus-indicator-thickness');
|
|
@@ -23,13 +23,13 @@
|
|
|
23
23
|
@use '../../foundations/layout';
|
|
24
24
|
@use '../../styles/elevation';
|
|
25
25
|
@use '../../styles/motion';
|
|
26
|
-
@use '../../styles/
|
|
26
|
+
@use '../../styles/shape';
|
|
27
27
|
@use '../../styles/statelayer';
|
|
28
28
|
@use '../../styles/typography';
|
|
29
29
|
|
|
30
30
|
@include elevation.level(3);
|
|
31
31
|
|
|
32
|
-
@include
|
|
32
|
+
@include shape.corner('extra-small');
|
|
33
33
|
|
|
34
34
|
@include statelayer.token('hover-state-layer-opacity');
|
|
35
35
|
@include statelayer.token('focus-state-layer-opacity');
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
|
|
22
22
|
@use '../../foundations';
|
|
23
23
|
@use '../../styles/motion';
|
|
24
|
-
@use '../../styles/
|
|
24
|
+
@use '../../styles/shape';
|
|
25
25
|
@use '../../styles/statelayer';
|
|
26
26
|
@use '../../styles/typography';
|
|
27
27
|
|
|
28
|
-
@include
|
|
28
|
+
@include shape.corner('full');
|
|
29
29
|
|
|
30
30
|
@include statelayer.token('layer-size');
|
|
31
31
|
@include statelayer.token('hover-state-layer-opacity');
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
|
|
22
22
|
@use '../../foundations';
|
|
23
23
|
@use '../../styles/motion';
|
|
24
|
-
@use '../../styles/
|
|
24
|
+
@use '../../styles/shape';
|
|
25
25
|
@use '../../styles/statelayer';
|
|
26
26
|
@use '../../styles/typography';
|
|
27
27
|
|
|
28
|
-
@include
|
|
28
|
+
@include shape.corner('extra-small');
|
|
29
29
|
|
|
30
30
|
@include statelayer.token('hover-state-layer-opacity');
|
|
31
31
|
@include statelayer.token('disabled-state-layer-opacity');
|
|
@@ -21,12 +21,12 @@
|
|
|
21
21
|
|
|
22
22
|
@use '../../foundations';
|
|
23
23
|
@use '../../styles/motion';
|
|
24
|
-
@use '../../styles/
|
|
24
|
+
@use '../../styles/shape';
|
|
25
25
|
@use '../../styles/statelayer';
|
|
26
26
|
@use '../../styles/typography';
|
|
27
27
|
|
|
28
|
-
@include
|
|
29
|
-
@include
|
|
28
|
+
@include shape.corner('small');
|
|
29
|
+
@include shape.corner('full');
|
|
30
30
|
|
|
31
31
|
@include statelayer.token('hover-state-layer-opacity');
|
|
32
32
|
@include statelayer.token('focus-state-layer-opacity');
|