@noxlovette/material 0.9.2 → 0.9.4
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-skill/material-design/references/motion-guide.md +7 -7
- package/dist/animation/TransitionPatterns.stories.svelte +2 -1
- package/dist/animation/containerTransform.js +3 -2
- package/dist/animation/presence.svelte.js +12 -1
- package/dist/animation/sharedAxisTransition.js +7 -5
- package/dist/animation/skeleton.d.ts +3 -2
- package/dist/animation/skeleton.js +27 -9
- package/dist/components/buttons/button-group/ButtonGroup.svelte +5 -3
- package/dist/components/buttons/connected/theme.d.ts +15 -15
- package/dist/components/buttons/connected/theme.js +20 -5
- package/dist/components/buttons/shapeMorph.js +12 -4
- package/dist/components/buttons/split-button/theme.d.ts +15 -15
- package/dist/components/buttons/split-button/theme.js +21 -15
- package/dist/components/buttons/theme.d.ts +40 -40
- package/dist/components/buttons/theme.js +29 -29
- package/dist/components/cards/theme.js +1 -1
- package/dist/components/chips/Chip.svelte +1 -1
- package/dist/components/chips/theme.js +1 -1
- package/dist/components/containers/bottom-sheet/theme.js +1 -1
- package/dist/components/containers/carousel/theme.js +1 -1
- package/dist/components/containers/context-menu/theme.js +2 -2
- package/dist/components/containers/dialogue/theme.js +1 -1
- package/dist/components/containers/list/theme.d.ts +3 -3
- package/dist/components/containers/list/theme.js +8 -8
- package/dist/components/containers/menu/theme.js +3 -3
- package/dist/components/date/theme.js +2 -2
- package/dist/components/forms/checkbox/theme.js +1 -1
- package/dist/components/forms/command/theme.js +1 -1
- package/dist/components/forms/search/theme.js +1 -1
- package/dist/components/forms/select/theme.js +2 -2
- package/dist/components/forms/slider/theme.js +7 -7
- package/dist/components/forms/textfield/theme.js +4 -4
- package/dist/components/forms/toggle-group/theme.js +2 -2
- package/dist/components/nav/appbar/theme.js +22 -6
- package/dist/components/nav/navbar/theme.js +1 -1
- package/dist/components/nav/tabs/theme.js +1 -1
- package/dist/components/snackbar/theme.js +1 -1
- package/dist/components/table/TableHeader.svelte +1 -1
- package/dist/components/toolbar/theme.js +2 -2
- package/dist/styles/components.css +7 -2
- package/dist/styles/icon.css +19 -0
- package/dist/styles/motion.css +17 -0
- package/dist/styles/rounding.css +4 -0
- package/dist/utils/icon/Icon.svelte +5 -5
- package/package.json +1 -1
|
@@ -126,7 +126,7 @@ export const appbar = tv({
|
|
|
126
126
|
row: 'grid w-full items-center px-spacing-50',
|
|
127
127
|
childrenRow: 'w-full px-spacing-100 pb-spacing-100',
|
|
128
128
|
ghost: 'w-full shrink-0 pointer-events-none',
|
|
129
|
-
textContainer: 'flex min-w-spacing-0 flex-col gap-spacing-25 [--lead:
|
|
129
|
+
textContainer: 'flex min-w-spacing-0 flex-col gap-spacing-25 [--lead:var(--spacing-spacing-50)] [--trail:var(--spacing-spacing-50)]',
|
|
130
130
|
title: 'text-md-sys-color-on-surface',
|
|
131
131
|
subtitle: 'text-md-sys-color-on-surface-variant',
|
|
132
132
|
leading: 'text-md-sys-color-on-surface col-start-1 row-start-1 flex shrink-0 items-center justify-self-start',
|
|
@@ -163,7 +163,7 @@ export const appbar = tv({
|
|
|
163
163
|
searchContainer: {
|
|
164
164
|
true: {
|
|
165
165
|
row: 'grid-cols-[auto_1fr_auto]',
|
|
166
|
-
textContainer: '[--lead:
|
|
166
|
+
textContainer: '[--lead:var(--spacing-spacing-100)] [--trail:var(--spacing-spacing-100)]'
|
|
167
167
|
},
|
|
168
168
|
false: ''
|
|
169
169
|
},
|
|
@@ -173,10 +173,26 @@ export const appbar = tv({
|
|
|
173
173
|
},
|
|
174
174
|
compoundVariants: [
|
|
175
175
|
// A title with no button beside it sits at the 16dp inset.
|
|
176
|
-
{
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
176
|
+
{
|
|
177
|
+
align: 'start',
|
|
178
|
+
noLeading: true,
|
|
179
|
+
class: { textContainer: '[--lead:var(--spacing-spacing-200)]' }
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
align: 'start',
|
|
183
|
+
noTrailing: true,
|
|
184
|
+
class: { textContainer: '[--trail:var(--spacing-spacing-200)]' }
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
searchContainer: true,
|
|
188
|
+
noLeading: true,
|
|
189
|
+
class: { textContainer: '[--lead:var(--spacing-spacing-150)]' }
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
searchContainer: true,
|
|
193
|
+
noTrailing: true,
|
|
194
|
+
class: { textContainer: '[--trail:var(--spacing-spacing-150)]' }
|
|
195
|
+
}
|
|
180
196
|
],
|
|
181
197
|
defaultVariants: {
|
|
182
198
|
align: 'start',
|
|
@@ -12,7 +12,7 @@ export const navitem = tv({
|
|
|
12
12
|
base: 'group relative flex flex-1 flex-col items-center justify-center min-w-spacing-0 max-w-[168px] h-full transition-colors md-sys-motion-fast-effects',
|
|
13
13
|
content: 'flex flex-col items-center justify-center gap-spacing-50 w-full',
|
|
14
14
|
iconContainer: 'relative flex items-center justify-center h-spacing-400 w-spacing-800 rounded-full transition-colors md-sys-motion-effects',
|
|
15
|
-
icon: 'text-
|
|
15
|
+
icon: 'text-icon-24 size-(--text-icon-24)',
|
|
16
16
|
label: 'md-sys-typescale-label-medium truncate w-full text-center'
|
|
17
17
|
},
|
|
18
18
|
variants: {
|
|
@@ -19,7 +19,7 @@ export const tab = tv({
|
|
|
19
19
|
'data-[state=inactive]:text-md-sys-color-on-surface-variant'
|
|
20
20
|
].join(' '),
|
|
21
21
|
label: 'md-sys-typescale-title-small',
|
|
22
|
-
icon: 'size-
|
|
22
|
+
icon: 'size-(--text-icon-24) text-icon-24'
|
|
23
23
|
},
|
|
24
24
|
variants: {
|
|
25
25
|
variant: {
|
|
@@ -5,7 +5,7 @@ export const snackbar = tv({
|
|
|
5
5
|
label: 'text-md-sys-color-inverse-primary md-sys-typescale-label-large px-spacing-150 cursor-pointer ',
|
|
6
6
|
actionWrapper: 'flex items-center z-40',
|
|
7
7
|
supportingText: 'text-md-sys-color-inverse-on-surface md-sys-typescale-body-medium max-w-[60ch] ',
|
|
8
|
-
icon: 'size-
|
|
8
|
+
icon: 'size-(--text-icon-24) text-icon-24 text-md-sys-color-inverse-on-surface mr-spacing-50 ml-spacing-150'
|
|
9
9
|
},
|
|
10
10
|
variants: {
|
|
11
11
|
fixed: {
|
|
@@ -36,7 +36,7 @@ and `sortDirection` props. Defaults to `scope="col"`.
|
|
|
36
36
|
].join(' ')}
|
|
37
37
|
aria-hidden="true"
|
|
38
38
|
>
|
|
39
|
-
<Icon name="arrow_upward" class="size-
|
|
39
|
+
<Icon name="arrow_upward" class="text-icon-18 size-(--text-icon-18)" />
|
|
40
40
|
</span>
|
|
41
41
|
{/if}
|
|
42
42
|
</span>
|
|
@@ -52,7 +52,7 @@ export const toolbar = tv({
|
|
|
52
52
|
export const toolbarButton = tv({
|
|
53
53
|
slots: {
|
|
54
54
|
base: 'layer-container state-layer before:rounded-full relative inline-flex size-spacing-500 items-center justify-center rounded-full outline-none transition-colors md-sys-motion-fast-effects disabled:cursor-not-allowed disabled:opacity-38',
|
|
55
|
-
icon: 'size-
|
|
55
|
+
icon: 'size-(--text-icon-20) text-icon-20'
|
|
56
56
|
},
|
|
57
57
|
variants: {
|
|
58
58
|
color: {
|
|
@@ -65,7 +65,7 @@ export const toolbarButton = tv({
|
|
|
65
65
|
export const toolbarGroupItem = tv({
|
|
66
66
|
slots: {
|
|
67
67
|
base: 'layer-container state-layer before:rounded-full relative inline-flex size-spacing-500 items-center justify-center rounded-full outline-none transition-colors md-sys-motion-fast-effects disabled:cursor-not-allowed disabled:opacity-38',
|
|
68
|
-
icon: 'size-
|
|
68
|
+
icon: 'size-(--text-icon-20) text-icon-20'
|
|
69
69
|
},
|
|
70
70
|
variants: {
|
|
71
71
|
color: {
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* M3 component dimensions that aren't on the spacing scale (issue #30).
|
|
3
|
-
*
|
|
2
|
+
* M3 component dimensions that aren't on the spacing scale (issue #30). Database-backed properties
|
|
3
|
+
* are named after md.comp.<component>.<…> with dots as dashes; local component-specific dimensions
|
|
4
|
+
* are named for their use. Both are
|
|
4
5
|
* used as `w-(--md-comp-…)`. A dimension that lands on the spacing grid uses the spacing token
|
|
5
6
|
* instead (the rail's 4dp item gap is `gap-spacing-50`, not a property here).
|
|
6
7
|
*/
|
|
7
8
|
:root {
|
|
9
|
+
/* XL button pill: half its 136dp height, beyond the system shape scale. */
|
|
10
|
+
--md-comp-button-xl-round-corner: 4.25rem;
|
|
11
|
+
--md-comp-slider-inner-corner: 0.125rem; /* 2dp, smaller than system shape XS */
|
|
12
|
+
|
|
8
13
|
/* Navigation rail: https://m3.material.io/components/navigation-rail/specs */
|
|
9
14
|
--md-comp-nav-rail-collapsed-container-width: 6rem; /* 96dp */
|
|
10
15
|
--md-comp-nav-rail-collapsed-top-space: 2.75rem; /* 44dp */
|
package/dist/styles/icon.css
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
/* Icon sizes used by the M3 components and the Material Symbols font. The 18, 22, 26, 38 and
|
|
2
|
+
50dp steps are component-specific glyph dimensions (chips, split buttons), not M3 system sizes.
|
|
3
|
+
Each token controls both the glyph font size and its box, so they cannot drift apart. */
|
|
4
|
+
@theme {
|
|
5
|
+
--text-icon-16: 1rem;
|
|
6
|
+
--text-icon-18: 1.125rem;
|
|
7
|
+
--text-icon-20: 1.25rem;
|
|
8
|
+
--text-icon-22: 1.375rem;
|
|
9
|
+
--text-icon-24: 1.5rem;
|
|
10
|
+
--text-icon-26: 1.625rem;
|
|
11
|
+
--text-icon-28: 1.75rem;
|
|
12
|
+
--text-icon-32: 2rem;
|
|
13
|
+
--text-icon-36: 2.25rem;
|
|
14
|
+
--text-icon-38: 2.375rem;
|
|
15
|
+
--text-icon-40: 2.5rem;
|
|
16
|
+
--text-icon-48: 3rem;
|
|
17
|
+
--text-icon-50: 3.125rem;
|
|
18
|
+
}
|
|
19
|
+
|
|
1
20
|
/*
|
|
2
21
|
Default grade for Icon's `grad="auto"`. Light icons on a dark background look heavier than dark
|
|
3
22
|
ones on a light background (visual bleed), so M3 drops the grade to -25 on dark UI.
|
package/dist/styles/motion.css
CHANGED
|
@@ -284,6 +284,23 @@
|
|
|
284
284
|
/* @generated:springs:end */
|
|
285
285
|
}
|
|
286
286
|
|
|
287
|
+
/* Spatial CSS transitions settle immediately under the OS motion preference. Effects tokens
|
|
288
|
+
remain available for short opacity and color fades. Keep this outside the generated block. */
|
|
289
|
+
@media (prefers-reduced-motion: reduce) {
|
|
290
|
+
:root {
|
|
291
|
+
--md-sys-motion-duration-fast-spatial: 0ms;
|
|
292
|
+
--md-sys-motion-duration-spatial: 0ms;
|
|
293
|
+
--md-sys-motion-duration-slow-spatial: 0ms;
|
|
294
|
+
--md-sys-motion-timing-function-fast-spatial: var(
|
|
295
|
+
--md-sys-motion-timing-function-fast-effects-spring
|
|
296
|
+
);
|
|
297
|
+
--md-sys-motion-timing-function-spatial: var(--md-sys-motion-timing-function-effects-spring);
|
|
298
|
+
--md-sys-motion-timing-function-slow-spatial: var(
|
|
299
|
+
--md-sys-motion-timing-function-slow-effects-spring
|
|
300
|
+
);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
|
|
287
304
|
/*
|
|
288
305
|
One utility per Expressive spring, setting duration + timing function together. Pair with a
|
|
289
306
|
Tailwind transition-property utility: `transition-colors md-sys-motion-fast-effects`.
|
package/dist/styles/rounding.css
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
|
+
/* M3 shape scale: https://m3.material.io/styles/shape/corner-radius-scale */
|
|
1
2
|
@theme {
|
|
2
3
|
--radius-none: 0;
|
|
3
4
|
--radius-xs: 4px;
|
|
4
5
|
--radius-sm: 8px;
|
|
5
6
|
--radius-md: 12px;
|
|
6
7
|
--radius-lg: 16px;
|
|
8
|
+
--radius-lg-increased: 20px;
|
|
7
9
|
--radius-xl: 28px;
|
|
10
|
+
--radius-xl-increased: 32px;
|
|
11
|
+
--radius-xxl: 48px;
|
|
8
12
|
--radius-full: calc(infinity * 1px);
|
|
9
13
|
|
|
10
14
|
--md-util-optical-centering-coefficient: 0.11;
|
|
@@ -24,11 +24,11 @@ With `transition`, a change of `name` crossfades on a spring instead of swapping
|
|
|
24
24
|
*/
|
|
25
25
|
const sizeMap: Record<IconSize, { cls: string; opsz: number }> = {
|
|
26
26
|
inline: { cls: 'size-[1em] align-[-0.115em]', opsz: 20 },
|
|
27
|
-
xs: { cls: 'size-
|
|
28
|
-
sm: { cls: 'size-
|
|
29
|
-
md: { cls: 'size-
|
|
30
|
-
lg: { cls: 'size-
|
|
31
|
-
xl: { cls: 'size-
|
|
27
|
+
xs: { cls: 'size-(--text-icon-16) text-icon-16', opsz: 20 },
|
|
28
|
+
sm: { cls: 'size-(--text-icon-20) text-icon-20', opsz: 20 },
|
|
29
|
+
md: { cls: 'size-(--text-icon-24) text-icon-24', opsz: 24 },
|
|
30
|
+
lg: { cls: 'size-(--text-icon-40) text-icon-40', opsz: 40 },
|
|
31
|
+
xl: { cls: 'size-(--text-icon-48) text-icon-48', opsz: 48 }
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
const {
|