@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.
Files changed (45) hide show
  1. package/claude-skill/material-design/references/motion-guide.md +7 -7
  2. package/dist/animation/TransitionPatterns.stories.svelte +2 -1
  3. package/dist/animation/containerTransform.js +3 -2
  4. package/dist/animation/presence.svelte.js +12 -1
  5. package/dist/animation/sharedAxisTransition.js +7 -5
  6. package/dist/animation/skeleton.d.ts +3 -2
  7. package/dist/animation/skeleton.js +27 -9
  8. package/dist/components/buttons/button-group/ButtonGroup.svelte +5 -3
  9. package/dist/components/buttons/connected/theme.d.ts +15 -15
  10. package/dist/components/buttons/connected/theme.js +20 -5
  11. package/dist/components/buttons/shapeMorph.js +12 -4
  12. package/dist/components/buttons/split-button/theme.d.ts +15 -15
  13. package/dist/components/buttons/split-button/theme.js +21 -15
  14. package/dist/components/buttons/theme.d.ts +40 -40
  15. package/dist/components/buttons/theme.js +29 -29
  16. package/dist/components/cards/theme.js +1 -1
  17. package/dist/components/chips/Chip.svelte +1 -1
  18. package/dist/components/chips/theme.js +1 -1
  19. package/dist/components/containers/bottom-sheet/theme.js +1 -1
  20. package/dist/components/containers/carousel/theme.js +1 -1
  21. package/dist/components/containers/context-menu/theme.js +2 -2
  22. package/dist/components/containers/dialogue/theme.js +1 -1
  23. package/dist/components/containers/list/theme.d.ts +3 -3
  24. package/dist/components/containers/list/theme.js +8 -8
  25. package/dist/components/containers/menu/theme.js +3 -3
  26. package/dist/components/date/theme.js +2 -2
  27. package/dist/components/forms/checkbox/theme.js +1 -1
  28. package/dist/components/forms/command/theme.js +1 -1
  29. package/dist/components/forms/search/theme.js +1 -1
  30. package/dist/components/forms/select/theme.js +2 -2
  31. package/dist/components/forms/slider/theme.js +7 -7
  32. package/dist/components/forms/textfield/theme.js +4 -4
  33. package/dist/components/forms/toggle-group/theme.js +2 -2
  34. package/dist/components/nav/appbar/theme.js +22 -6
  35. package/dist/components/nav/navbar/theme.js +1 -1
  36. package/dist/components/nav/tabs/theme.js +1 -1
  37. package/dist/components/snackbar/theme.js +1 -1
  38. package/dist/components/table/TableHeader.svelte +1 -1
  39. package/dist/components/toolbar/theme.js +2 -2
  40. package/dist/styles/components.css +7 -2
  41. package/dist/styles/icon.css +19 -0
  42. package/dist/styles/motion.css +17 -0
  43. package/dist/styles/rounding.css +4 -0
  44. package/dist/utils/icon/Icon.svelte +5 -5
  45. 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:0.25rem] [--trail:0.25rem]',
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:0.5rem] [--trail:0.5rem]'
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
- { align: 'start', noLeading: true, class: { textContainer: '[--lead:1rem]' } },
177
- { align: 'start', noTrailing: true, class: { textContainer: '[--trail:1rem]' } },
178
- { searchContainer: true, noLeading: true, class: { textContainer: '[--lead:0.75rem]' } },
179
- { searchContainer: true, noTrailing: true, class: { textContainer: '[--trail:0.75rem]' } }
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-[24px] size-spacing-300',
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-spacing-300 text-[24px]'
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-spacing-300 text-[24px] text-md-sys-color-inverse-on-surface mr-spacing-50 ml-spacing-150'
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-[18px] text-[18px]" />
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-spacing-250 text-[20px]'
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-spacing-250 text-[20px]'
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). Each property is named
3
- * after its token in the M3 token database, md.comp.<component>.<…> with dots as dashes, and
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 */
@@ -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.
@@ -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`.
@@ -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-spacing-200 text-[16px]', opsz: 20 },
28
- sm: { cls: 'size-spacing-250 text-[20px]', opsz: 20 },
29
- md: { cls: 'size-spacing-300 text-[24px]', opsz: 24 },
30
- lg: { cls: 'size-spacing-500 text-[40px]', opsz: 40 },
31
- xl: { cls: 'size-spacing-600 text-[48px]', opsz: 48 }
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 {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noxlovette/material",
3
- "version": "0.9.2",
3
+ "version": "0.9.4",
4
4
  "type": "module",
5
5
  "description": "A Material Design 3 component library for Svelte, built on Bits UI.",
6
6
  "keywords": [