@bug-on/m3-expressive 1.0.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.
Files changed (98) hide show
  1. package/CHANGELOG.md +110 -0
  2. package/README.md +110 -0
  3. package/dist/assets/fonts/GoogleSansFlex-VariableFont.woff2 +0 -0
  4. package/dist/assets/fonts/MaterialSymbolsOutlined-VariableFont_FILL,GRAD,opsz,wght.ttf +0 -0
  5. package/dist/assets/fonts/MaterialSymbolsRounded-VariableFont_FILL,GRAD,opsz,wght.ttf +0 -0
  6. package/dist/assets/fonts/MaterialSymbolsSharp-VariableFont_FILL,GRAD,opsz,wght.ttf +0 -0
  7. package/dist/assets/loading-indicator.svg +19 -0
  8. package/dist/assets/material-symbols-cdn.css +65 -0
  9. package/dist/assets/material-symbols-self-hosted.css +94 -0
  10. package/dist/buttons.d.mts +180 -0
  11. package/dist/buttons.d.ts +180 -0
  12. package/dist/buttons.js +4282 -0
  13. package/dist/buttons.js.map +1 -0
  14. package/dist/buttons.mjs +4227 -0
  15. package/dist/buttons.mjs.map +1 -0
  16. package/dist/core.d.mts +422 -0
  17. package/dist/core.d.ts +422 -0
  18. package/dist/core.js +2581 -0
  19. package/dist/core.js.map +1 -0
  20. package/dist/core.mjs +2547 -0
  21. package/dist/core.mjs.map +1 -0
  22. package/dist/feedback.d.mts +600 -0
  23. package/dist/feedback.d.ts +600 -0
  24. package/dist/feedback.js +2357 -0
  25. package/dist/feedback.js.map +1 -0
  26. package/dist/feedback.mjs +2321 -0
  27. package/dist/feedback.mjs.map +1 -0
  28. package/dist/forms.d.mts +40 -0
  29. package/dist/forms.d.ts +40 -0
  30. package/dist/forms.js +4263 -0
  31. package/dist/forms.js.map +1 -0
  32. package/dist/forms.mjs +4228 -0
  33. package/dist/forms.mjs.map +1 -0
  34. package/dist/icon-button-D-gs0gfj.d.mts +136 -0
  35. package/dist/icon-button-D-gs0gfj.d.ts +136 -0
  36. package/dist/index.css +309 -0
  37. package/dist/index.css.d.ts +2 -0
  38. package/dist/index.d.mts +24 -0
  39. package/dist/index.d.ts +24 -0
  40. package/dist/index.js +23972 -0
  41. package/dist/index.js.map +1 -0
  42. package/dist/index.mjs +23668 -0
  43. package/dist/index.mjs.map +1 -0
  44. package/dist/layout.d.mts +610 -0
  45. package/dist/layout.d.ts +610 -0
  46. package/dist/layout.js +5091 -0
  47. package/dist/layout.js.map +1 -0
  48. package/dist/layout.mjs +5042 -0
  49. package/dist/layout.mjs.map +1 -0
  50. package/dist/material-symbols-cdn.css +65 -0
  51. package/dist/material-symbols-cdn.css.d.ts +2 -0
  52. package/dist/material-symbols-self-hosted.css +94 -0
  53. package/dist/material-symbols-self-hosted.css.d.ts +2 -0
  54. package/dist/md3-DFhj-NZj.d.mts +17 -0
  55. package/dist/md3-DFhj-NZj.d.ts +17 -0
  56. package/dist/navigation.d.mts +2766 -0
  57. package/dist/navigation.d.ts +2766 -0
  58. package/dist/navigation.js +6684 -0
  59. package/dist/navigation.js.map +1 -0
  60. package/dist/navigation.mjs +6573 -0
  61. package/dist/navigation.mjs.map +1 -0
  62. package/dist/overlays.d.mts +161 -0
  63. package/dist/overlays.d.ts +161 -0
  64. package/dist/overlays.js +3298 -0
  65. package/dist/overlays.js.map +1 -0
  66. package/dist/overlays.mjs +3244 -0
  67. package/dist/overlays.mjs.map +1 -0
  68. package/dist/pickers.d.mts +1074 -0
  69. package/dist/pickers.d.ts +1074 -0
  70. package/dist/pickers.js +4240 -0
  71. package/dist/pickers.js.map +1 -0
  72. package/dist/pickers.mjs +4200 -0
  73. package/dist/pickers.mjs.map +1 -0
  74. package/dist/plugin.d.mts +1 -0
  75. package/dist/plugin.d.ts +1 -0
  76. package/dist/plugin.js +13 -0
  77. package/dist/plugin.js.map +1 -0
  78. package/dist/plugin.mjs +3 -0
  79. package/dist/plugin.mjs.map +1 -0
  80. package/dist/scroll-area-CVS6HyLl.d.mts +33 -0
  81. package/dist/scroll-area-CVS6HyLl.d.ts +33 -0
  82. package/dist/shapes.d.mts +1119 -0
  83. package/dist/shapes.d.ts +1119 -0
  84. package/dist/shapes.js +2941 -0
  85. package/dist/shapes.js.map +1 -0
  86. package/dist/shapes.mjs +2889 -0
  87. package/dist/shapes.mjs.map +1 -0
  88. package/dist/side-sheet-modal-BY6VCC8p.d.mts +553 -0
  89. package/dist/side-sheet-modal-CglP6KYA.d.ts +553 -0
  90. package/dist/split-button-trailing-uncheckable-C5CLCIKP.d.ts +731 -0
  91. package/dist/split-button-trailing-uncheckable-MXj_kyNt.d.mts +731 -0
  92. package/dist/text-field-eAIpz9z1.d.mts +1038 -0
  93. package/dist/text-field-eAIpz9z1.d.ts +1038 -0
  94. package/dist/typography-339RV6v7.d.mts +486 -0
  95. package/dist/typography-339RV6v7.d.ts +486 -0
  96. package/dist/typography.css +22 -0
  97. package/dist/typography.css.d.ts +2 -0
  98. package/package.json +207 -0
@@ -0,0 +1,486 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+ import { ReactNode } from 'react';
4
+
5
+ /**
6
+ * TypographyKeyTokens - MD3 Expressive Typography Key Tokens Enum
7
+ *
8
+ * Port of androidx.compose.material3.tokens.TypographyKeyTokens (Kotlin enum class).
9
+ * Used to reference a specific TextStyle via Typography.fromToken().
10
+ *
11
+ * Contains 30 keys: 15 baseline + 15 emphasized (MD3 Expressive).
12
+ */
13
+ declare enum TypographyKeyTokens {
14
+ BodyLarge = "BodyLarge",
15
+ BodyMedium = "BodyMedium",
16
+ BodySmall = "BodySmall",
17
+ DisplayLarge = "DisplayLarge",
18
+ DisplayMedium = "DisplayMedium",
19
+ DisplaySmall = "DisplaySmall",
20
+ HeadlineLarge = "HeadlineLarge",
21
+ HeadlineMedium = "HeadlineMedium",
22
+ HeadlineSmall = "HeadlineSmall",
23
+ LabelLarge = "LabelLarge",
24
+ LabelMedium = "LabelMedium",
25
+ LabelSmall = "LabelSmall",
26
+ TitleLarge = "TitleLarge",
27
+ TitleMedium = "TitleMedium",
28
+ TitleSmall = "TitleSmall",
29
+ BodyLargeEmphasized = "BodyLargeEmphasized",
30
+ BodyMediumEmphasized = "BodyMediumEmphasized",
31
+ BodySmallEmphasized = "BodySmallEmphasized",
32
+ DisplayLargeEmphasized = "DisplayLargeEmphasized",
33
+ DisplayMediumEmphasized = "DisplayMediumEmphasized",
34
+ DisplaySmallEmphasized = "DisplaySmallEmphasized",
35
+ HeadlineLargeEmphasized = "HeadlineLargeEmphasized",
36
+ HeadlineMediumEmphasized = "HeadlineMediumEmphasized",
37
+ HeadlineSmallEmphasized = "HeadlineSmallEmphasized",
38
+ LabelLargeEmphasized = "LabelLargeEmphasized",
39
+ LabelMediumEmphasized = "LabelMediumEmphasized",
40
+ LabelSmallEmphasized = "LabelSmallEmphasized",
41
+ TitleLargeEmphasized = "TitleLargeEmphasized",
42
+ TitleMediumEmphasized = "TitleMediumEmphasized",
43
+ TitleSmallEmphasized = "TitleSmallEmphasized"
44
+ }
45
+
46
+ /**
47
+ * @file typography-tokens.ts
48
+ * @description MD3 Expressive Typography Token Definitions.
49
+ *
50
+ * Port of `androidx.compose.material3.tokens.TypographyTokens` (Kotlin class).
51
+ *
52
+ * ### Memory Optimization
53
+ * All 30 `TextStyle` properties are implemented as **lazy getters** — they are
54
+ * computed on first access and cached, rather than being computed eagerly at
55
+ * construction time. This reduces the instantiation cost of `TypographyTokens`.
56
+ *
57
+ * ### Variable Font Axes
58
+ * Supports customizable CSS `font-variation-settings` via {@link FontVariationAxes}.
59
+ * - Default `ROND` value is `100` (maximum roundness of Google Sans Flex).
60
+ * - Other axes remain at font defaults unless explicitly overridden.
61
+ *
62
+ * @example Basic usage (default tokens)
63
+ * ```ts
64
+ * const tokens = new TypographyTokens();
65
+ * const style = tokens.BodyLarge; // { fontSize, fontWeight, ... }
66
+ * ```
67
+ *
68
+ * @example Custom font family
69
+ * ```ts
70
+ * const tokens = new TypographyTokens({ fontFamily: "'Inter', sans-serif" });
71
+ * ```
72
+ *
73
+ * @example Custom ROND axis (partial roundness)
74
+ * ```ts
75
+ * const tokens = new TypographyTokens({ fontVariationAxes: { ROND: 50 } });
76
+ * ```
77
+ */
78
+ /**
79
+ * Configurable axes for CSS `font-variation-settings`.
80
+ *
81
+ * Each key maps to a named variable font axis. Any axis not specified falls
82
+ * back to the font's own default value.
83
+ *
84
+ * @see https://developer.mozilla.org/en-US/docs/Web/CSS/font-variation-settings
85
+ *
86
+ * @example
87
+ * ```ts
88
+ * const axes: FontVariationAxes = { ROND: 100, wght: 600 };
89
+ * ```
90
+ */
91
+ interface FontVariationAxes {
92
+ /**
93
+ * Roundness axis of Google Sans Flex Variable Font.
94
+ * Range: `0` (sharp corners) – `100` (fully rounded).
95
+ * @default 100
96
+ */
97
+ ROND?: number;
98
+ /**
99
+ * Weight axis. Overrides `font-weight` via variation settings.
100
+ * @default font default
101
+ */
102
+ wght?: number;
103
+ /**
104
+ * Width axis. Controls glyph condensation/expansion.
105
+ * @default font default
106
+ */
107
+ wdth?: number;
108
+ /** Any additional named variation axis supported by the font. */
109
+ [axis: string]: number | undefined;
110
+ }
111
+ /**
112
+ * Default font variation axes for MD3 Expressive.
113
+ * Sets `ROND` to `100` for maximum roundness; all other axes use font defaults.
114
+ */
115
+ declare const DEFAULT_FONT_VARIATION_AXES: Readonly<FontVariationAxes>;
116
+ /**
117
+ * Serializes a {@link FontVariationAxes} map into a CSS `font-variation-settings` string.
118
+ *
119
+ * @example
120
+ * ```ts
121
+ * serializeFontVariationAxes({ ROND: 100, wght: 700 });
122
+ * // → '"ROND" 100, "wght" 700'
123
+ * ```
124
+ */
125
+ declare function serializeFontVariationAxes(axes: FontVariationAxes): string;
126
+ /**
127
+ * Pre-computed default `font-variation-settings` string.
128
+ * Equivalent to `'"ROND" 100'`.
129
+ */
130
+ declare const MD3_EXPRESSIVE_FONT_VARIATION: string;
131
+ /**
132
+ * Web equivalent of Compose's `TextStyle`.
133
+ *
134
+ * All properties are readonly and map directly to CSS font properties.
135
+ * The `fontVariationSettings` field carries the serialized variable-font axes.
136
+ */
137
+ interface TextStyle {
138
+ /** CSS `font-family` value. */
139
+ readonly fontFamily: string;
140
+ /** CSS `font-weight` numeric value (e.g. `400`, `700`). */
141
+ readonly fontWeight: number;
142
+ /** CSS `font-size` in `rem` units. */
143
+ readonly fontSize: string;
144
+ /** CSS `line-height` in `rem` units. */
145
+ readonly lineHeight: string;
146
+ /** CSS `letter-spacing` in `px` units. */
147
+ readonly letterSpacing: string;
148
+ /**
149
+ * CSS `font-variation-settings` string.
150
+ * @example '"ROND" 100'
151
+ * @example '"ROND" 50, "wght" 600'
152
+ */
153
+ readonly fontVariationSettings: string;
154
+ }
155
+ /**
156
+ * Constructor options for {@link TypographyTokens}.
157
+ */
158
+ interface TypographyTokensOptions {
159
+ /**
160
+ * Custom CSS `font-family` string. When provided, overrides the default
161
+ * Google Sans Flex font for all token styles.
162
+ *
163
+ * @example "'Roboto', sans-serif"
164
+ */
165
+ fontFamily?: string;
166
+ /**
167
+ * Variable font axes to apply via `font-variation-settings`.
168
+ * Merged on top of {@link DEFAULT_FONT_VARIATION_AXES}.
169
+ * Provide only the axes you want to override.
170
+ *
171
+ * @example { ROND: 0 } // sharp corners
172
+ */
173
+ fontVariationAxes?: FontVariationAxes;
174
+ }
175
+ /**
176
+ * MD3 Expressive Typography Token class.
177
+ *
178
+ * Port of `internal class TypographyTokens(val fontFamily: FontFamily? = null)`
179
+ * from `androidx.compose.material3.tokens.TypographyTokens`.
180
+ *
181
+ * Provides 30 pre-defined {@link TextStyle} properties (15 baseline + 15 emphasized),
182
+ * each implemented as a **lazy getter** — computed once on first access, then cached.
183
+ *
184
+ * ### Customization
185
+ * Pass {@link TypographyTokensOptions} to the constructor to override:
186
+ * - `fontFamily` — swap the typeface
187
+ * - `fontVariationAxes` — control variable font axes (e.g., `ROND`)
188
+ *
189
+ * @example Default
190
+ * ```ts
191
+ * const tokens = new TypographyTokens();
192
+ * ```
193
+ *
194
+ * @example Custom font + half-rounded
195
+ * ```ts
196
+ * const tokens = new TypographyTokens({
197
+ * fontFamily: "'Inter', sans-serif",
198
+ * fontVariationAxes: { ROND: 50 },
199
+ * });
200
+ * ```
201
+ */
202
+ declare class TypographyTokens {
203
+ #private;
204
+ constructor(options?: TypographyTokensOptions | string);
205
+ /** Display Large – `57px`, weight 400 */
206
+ get DisplayLarge(): TextStyle;
207
+ /** Display Medium – `45px`, weight 400 */
208
+ get DisplayMedium(): TextStyle;
209
+ /** Display Small – `36px`, weight 400 */
210
+ get DisplaySmall(): TextStyle;
211
+ /** Headline Large – `32px`, weight 400 */
212
+ get HeadlineLarge(): TextStyle;
213
+ /** Headline Medium – `28px`, weight 400 */
214
+ get HeadlineMedium(): TextStyle;
215
+ /** Headline Small – `24px`, weight 400 */
216
+ get HeadlineSmall(): TextStyle;
217
+ /** Title Large – `22px`, weight 400 */
218
+ get TitleLarge(): TextStyle;
219
+ /** Title Medium – `16px`, weight 500 */
220
+ get TitleMedium(): TextStyle;
221
+ /** Title Small – `14px`, weight 500 */
222
+ get TitleSmall(): TextStyle;
223
+ /** Body Large – `16px`, weight 400 */
224
+ get BodyLarge(): TextStyle;
225
+ /** Body Medium – `14px`, weight 400 */
226
+ get BodyMedium(): TextStyle;
227
+ /** Body Small – `12px`, weight 400 */
228
+ get BodySmall(): TextStyle;
229
+ /** Label Large – `14px`, weight 500 */
230
+ get LabelLarge(): TextStyle;
231
+ /** Label Medium – `12px`, weight 500 */
232
+ get LabelMedium(): TextStyle;
233
+ /** Label Small – `11px`, weight 500 */
234
+ get LabelSmall(): TextStyle;
235
+ /** Display Large Emphasized – `57px`, weight 800 */
236
+ get DisplayLargeEmphasized(): TextStyle;
237
+ /** Display Medium Emphasized – `45px`, weight 800 */
238
+ get DisplayMediumEmphasized(): TextStyle;
239
+ /** Display Small Emphasized – `36px`, weight 800 */
240
+ get DisplaySmallEmphasized(): TextStyle;
241
+ /** Headline Large Emphasized – `32px`, weight 800 */
242
+ get HeadlineLargeEmphasized(): TextStyle;
243
+ /** Headline Medium Emphasized – `28px`, weight 800 */
244
+ get HeadlineMediumEmphasized(): TextStyle;
245
+ /** Headline Small Emphasized – `24px`, weight 800 */
246
+ get HeadlineSmallEmphasized(): TextStyle;
247
+ /** Title Large Emphasized – `22px`, weight 700 */
248
+ get TitleLargeEmphasized(): TextStyle;
249
+ /** Title Medium Emphasized – `16px`, weight 700 */
250
+ get TitleMediumEmphasized(): TextStyle;
251
+ /** Title Small Emphasized – `14px`, weight 700 */
252
+ get TitleSmallEmphasized(): TextStyle;
253
+ /** Body Large Emphasized – `16px`, weight 700 */
254
+ get BodyLargeEmphasized(): TextStyle;
255
+ /** Body Medium Emphasized – `14px`, weight 700 */
256
+ get BodyMediumEmphasized(): TextStyle;
257
+ /** Body Small Emphasized – `12px`, weight 700 */
258
+ get BodySmallEmphasized(): TextStyle;
259
+ /** Label Large Emphasized – `14px`, weight 800 */
260
+ get LabelLargeEmphasized(): TextStyle;
261
+ /** Label Medium Emphasized – `12px`, weight 800 */
262
+ get LabelMediumEmphasized(): TextStyle;
263
+ /** Label Small Emphasized – `11px`, weight 800 */
264
+ get LabelSmallEmphasized(): TextStyle;
265
+ }
266
+
267
+ /**
268
+ * MD3 Expressive Typography — port of Compose's `@Immutable class Typography(...)`.
269
+ *
270
+ * All 30 style properties are **readonly** and lazily resolved from the
271
+ * underlying {@link TypographyTokens} instance. Use {@link Typography.copy}
272
+ * to create a customized variant without mutating the original.
273
+ *
274
+ * @example Default
275
+ * ```ts
276
+ * const typography = new Typography();
277
+ * const style = typography.displayLarge; // lazy — computed on first access
278
+ * ```
279
+ *
280
+ * @example Custom tokens
281
+ * ```ts
282
+ * const typography = new Typography(
283
+ * new TypographyTokens({ fontFamily: "'Inter', sans-serif", fontVariationAxes: { ROND: 0 } })
284
+ * );
285
+ * ```
286
+ */
287
+ declare class Typography {
288
+ #private;
289
+ constructor(tokens?: TypographyTokens);
290
+ /** Display Large text style (`57px`, weight `400`). */
291
+ get displayLarge(): TextStyle;
292
+ /** Display Medium text style (`45px`, weight `400`). */
293
+ get displayMedium(): TextStyle;
294
+ /** Display Small text style (`36px`, weight `400`). */
295
+ get displaySmall(): TextStyle;
296
+ /** Headline Large text style (`32px`, weight `400`). */
297
+ get headlineLarge(): TextStyle;
298
+ /** Headline Medium text style (`28px`, weight `400`). */
299
+ get headlineMedium(): TextStyle;
300
+ /** Headline Small text style (`24px`, weight `400`). */
301
+ get headlineSmall(): TextStyle;
302
+ /** Title Large text style (`22px`, weight `400`). */
303
+ get titleLarge(): TextStyle;
304
+ /** Title Medium text style (`16px`, weight `500`). */
305
+ get titleMedium(): TextStyle;
306
+ /** Title Small text style (`14px`, weight `500`). */
307
+ get titleSmall(): TextStyle;
308
+ /** Body Large text style (`16px`, weight `400`). */
309
+ get bodyLarge(): TextStyle;
310
+ /** Body Medium text style (`14px`, weight `400`). */
311
+ get bodyMedium(): TextStyle;
312
+ /** Body Small text style (`12px`, weight `400`). */
313
+ get bodySmall(): TextStyle;
314
+ /** Label Large text style (`14px`, weight `500`). */
315
+ get labelLarge(): TextStyle;
316
+ /** Label Medium text style (`12px`, weight `500`). */
317
+ get labelMedium(): TextStyle;
318
+ /** Label Small text style (`11px`, weight `500`). */
319
+ get labelSmall(): TextStyle;
320
+ /** Display Large Emphasized text style (`57px`, weight `800`). */
321
+ get displayLargeEmphasized(): TextStyle;
322
+ /** Display Medium Emphasized text style (`45px`, weight `800`). */
323
+ get displayMediumEmphasized(): TextStyle;
324
+ /** Display Small Emphasized text style (`36px`, weight `800`). */
325
+ get displaySmallEmphasized(): TextStyle;
326
+ /** Headline Large Emphasized text style (`32px`, weight `800`). */
327
+ get headlineLargeEmphasized(): TextStyle;
328
+ /** Headline Medium Emphasized text style (`28px`, weight `800`). */
329
+ get headlineMediumEmphasized(): TextStyle;
330
+ /** Headline Small Emphasized text style (`24px`, weight `800`). */
331
+ get headlineSmallEmphasized(): TextStyle;
332
+ /** Title Large Emphasized text style (`22px`, weight `700`). */
333
+ get titleLargeEmphasized(): TextStyle;
334
+ /** Title Medium Emphasized text style (`16px`, weight `700`). */
335
+ get titleMediumEmphasized(): TextStyle;
336
+ /** Title Small Emphasized text style (`14px`, weight `700`). */
337
+ get titleSmallEmphasized(): TextStyle;
338
+ /** Body Large Emphasized text style (`16px`, weight `700`). */
339
+ get bodyLargeEmphasized(): TextStyle;
340
+ /** Body Medium Emphasized text style (`14px`, weight `700`). */
341
+ get bodyMediumEmphasized(): TextStyle;
342
+ /** Body Small Emphasized text style (`12px`, weight `700`). */
343
+ get bodySmallEmphasized(): TextStyle;
344
+ /** Label Large Emphasized text style (`14px`, weight `800`). */
345
+ get labelLargeEmphasized(): TextStyle;
346
+ /** Label Medium Emphasized text style (`12px`, weight `800`). */
347
+ get labelMediumEmphasized(): TextStyle;
348
+ /** Label Small Emphasized text style (`11px`, weight `800`). */
349
+ get labelSmallEmphasized(): TextStyle;
350
+ /**
351
+ * Returns the `TextStyle` corresponding to the given {@link TypographyKeyTokens}.
352
+ *
353
+ * Port of `internal fun Typography.fromToken(value: TypographyKeyTokens): TextStyle`.
354
+ *
355
+ * @example
356
+ * ```ts
357
+ * const style = typography.fromToken(TypographyKeyTokens.BodyLarge);
358
+ * ```
359
+ */
360
+ fromToken(value: TypographyKeyTokens): TextStyle;
361
+ /**
362
+ * Creates a new `Typography` instance with the specified property overrides
363
+ * merged on top of the current instance's styles.
364
+ *
365
+ * Port of Compose's `fun Typography.copy(...)`.
366
+ *
367
+ * Unlike a shallow `Object.assign`, this method preserves the lazy-getter
368
+ * architecture — overridden styles are stored separately and looked up first
369
+ * on each property access, while non-overridden styles continue to be
370
+ * resolved from the underlying {@link TypographyTokens}.
371
+ *
372
+ * @param overrides - Map of camelCase property names to partial `TextStyle` overrides.
373
+ * @returns A new `Typography` instance. The original is never mutated.
374
+ *
375
+ * @example
376
+ * ```ts
377
+ * const custom = typography.copy({ bodyLarge: { fontSize: "2rem" } });
378
+ * custom.bodyLarge.fontSize; // "2rem"
379
+ * custom.bodySmall.fontSize; // original token value — untouched
380
+ * ```
381
+ */
382
+ copy(overrides: Partial<Record<TypographyStyleKey, Partial<TextStyle>>>): Typography;
383
+ }
384
+ /**
385
+ * Union of all camelCase property names on {@link Typography} that return a
386
+ * {@link TextStyle}. Used as the key type for `copy()` overrides and the
387
+ * `OverriddenTypography` resolver.
388
+ */
389
+ type TypographyStyleKey = {
390
+ [K in keyof Typography]: Typography[K] extends TextStyle ? K : never;
391
+ }[keyof Typography];
392
+ /**
393
+ * React context that holds the current {@link Typography} instance.
394
+ *
395
+ * Port of `internal val LocalTypography = staticCompositionLocalOf { Typography() }`.
396
+ *
397
+ * @internal — Prefer {@link useTypography} and {@link TypographyProvider}.
398
+ */
399
+ declare const TypographyContext: React.Context<Typography>;
400
+ /**
401
+ * React hook to access the current {@link Typography} from the nearest
402
+ * {@link TypographyProvider} in the tree. Falls back to the default
403
+ * googleapis Typography when no provider is present.
404
+ *
405
+ * @returns The current `Typography` instance.
406
+ *
407
+ * @example
408
+ * ```tsx
409
+ * const typography = useTypography();
410
+ * <p style={typography.bodyLarge}>Hello</p>
411
+ * ```
412
+ */
413
+ declare function useTypography(): Typography;
414
+ /**
415
+ * Props for {@link TypographyProvider}.
416
+ */
417
+ interface TypographyProviderProps {
418
+ /** The child tree that will have access to the provided typography. */
419
+ children: ReactNode;
420
+ /**
421
+ * A fully custom {@link Typography} instance.
422
+ * When provided, `fontFamily` and `fontVariationAxes` are ignored.
423
+ */
424
+ typography?: Typography;
425
+ /**
426
+ * Shorthand to override the CSS `font-family` for all typography styles.
427
+ * Ignored when `typography` is provided.
428
+ *
429
+ * @example "'Roboto', sans-serif"
430
+ */
431
+ fontFamily?: string;
432
+ /**
433
+ * Variable font axes to apply globally via `font-variation-settings`.
434
+ * Merged on top of the defaults (`ROND: 100`). Only the axes you specify
435
+ * will be overridden; unspecified axes retain font defaults.
436
+ * Ignored when `typography` is provided.
437
+ *
438
+ * @example { ROND: 50 } // half-rounded
439
+ * @example { ROND: 0 } // sharp corners
440
+ */
441
+ fontVariationAxes?: FontVariationAxes;
442
+ }
443
+ /**
444
+ * Typography Provider component.
445
+ *
446
+ * Port of `CompositionLocalProvider(LocalTypography provides typography)`.
447
+ * Wrap your application (or a subtree) to provide MD3 Expressive typography
448
+ * to all descendant components that call {@link useTypography}.
449
+ *
450
+ * The context value is **memoized** — it is only re-computed when `typography`,
451
+ * `fontFamily`, or `fontVariationAxes` change, preventing unnecessary re-renders.
452
+ *
453
+ * @example Default (Google Sans Flex, ROND = 100)
454
+ * ```tsx
455
+ * <TypographyProvider>
456
+ * <App />
457
+ * </TypographyProvider>
458
+ * ```
459
+ *
460
+ * @example Custom font
461
+ * ```tsx
462
+ * <TypographyProvider fontFamily="'Inter', sans-serif">
463
+ * <App />
464
+ * </TypographyProvider>
465
+ * ```
466
+ *
467
+ * @example Partially rounded corners (ROND = 50)
468
+ * ```tsx
469
+ * <TypographyProvider fontVariationAxes={{ ROND: 50 }}>
470
+ * <App />
471
+ * </TypographyProvider>
472
+ * ```
473
+ *
474
+ * @example Fully sharp (ROND = 0) with a custom font
475
+ * ```tsx
476
+ * <TypographyProvider
477
+ * fontFamily="'Outfit', sans-serif"
478
+ * fontVariationAxes={{ ROND: 0 }}
479
+ * >
480
+ * <App />
481
+ * </TypographyProvider>
482
+ * ```
483
+ */
484
+ declare function TypographyProvider({ children, typography, fontFamily, fontVariationAxes, }: TypographyProviderProps): react_jsx_runtime.JSX.Element;
485
+
486
+ export { DEFAULT_FONT_VARIATION_AXES as D, type FontVariationAxes as F, MD3_EXPRESSIVE_FONT_VARIATION as M, type TextStyle as T, Typography as a, TypographyContext as b, TypographyKeyTokens as c, TypographyProvider as d, type TypographyProviderProps as e, TypographyTokens as f, type TypographyTokensOptions as g, serializeFontVariationAxes as s, useTypography as u };