@react-md/core 1.0.0-next.7 → 1.0.0-next.8
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/.turbo/turbo-build.log +6 -6
- package/CHANGELOG.md +6 -0
- package/coverage/clover.xml +264 -389
- package/coverage/coverage-final.json +2 -3
- package/coverage/lcov-report/MenuItemCheckbox.tsx.html +223 -0
- package/coverage/lcov-report/MenuItemInputToggle.tsx.html +178 -232
- package/coverage/lcov-report/MenuItemRadio.tsx.html +436 -0
- package/coverage/lcov-report/SrOnly.tsx.html +328 -0
- package/coverage/lcov-report/Typography.tsx.html +1027 -0
- package/coverage/lcov-report/index.html +15 -30
- package/coverage/lcov-report/menuItemInputToggleStyles.ts.html +319 -0
- package/coverage/lcov.info +304 -436
- package/dist/_core.scss +49 -43
- package/dist/badge/_badge.scss +23 -19
- package/dist/form/MenuItemInputToggle.d.ts +2 -15
- package/dist/form/MenuItemInputToggle.js +26 -37
- package/dist/form/MenuItemInputToggle.js.map +1 -1
- package/dist/form/_form.scss +39 -16
- package/dist/form/menuItemInputToggleStyles.d.ts +39 -0
- package/dist/form/menuItemInputToggleStyles.js +31 -0
- package/dist/form/menuItemInputToggleStyles.js.map +1 -0
- package/dist/icon/_icon.scss +7 -5
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/interaction/_interaction.scss +56 -44
- package/dist/list/types.d.ts +10 -1
- package/dist/list/types.js.map +1 -1
- package/dist/menu/_menu.scss +1 -0
- package/dist/theme/_theme.scss +192 -34
- package/dist/typography/SrOnly.d.ts +3 -3
- package/dist/typography/SrOnly.js +4 -4
- package/dist/typography/SrOnly.js.map +1 -1
- package/dist/typography/Typography.d.ts +19 -19
- package/dist/typography/Typography.js +19 -19
- package/dist/typography/Typography.js.map +1 -1
- package/dist/typography/_typography.scss +65 -25
- package/package.json +11 -11
- package/src/_core.scss +49 -43
- package/src/badge/_badge.scss +23 -19
- package/src/button/__tests__/__snapshots__/Button.tsx.snap +1 -1
- package/src/form/MenuItemInputToggle.tsx +46 -64
- package/src/form/__tests__/MenuItemCheckbox.tsx +53 -0
- package/src/form/__tests__/MenuItemRadio.tsx +53 -0
- package/src/form/__tests__/__snapshots__/FileInput.tsx.snap +23 -23
- package/src/form/__tests__/__snapshots__/MenuItemCheckbox.tsx.snap +96 -0
- package/src/form/__tests__/__snapshots__/MenuItemRadio.tsx.snap +96 -0
- package/src/form/_form.scss +39 -16
- package/src/form/menuItemInputToggleStyles.ts +78 -0
- package/src/icon/_icon.scss +7 -5
- package/src/index.ts +1 -0
- package/src/interaction/_interaction.scss +56 -44
- package/src/list/types.ts +12 -1
- package/src/menu/_menu.scss +1 -0
- package/src/theme/_theme.scss +192 -34
- package/src/typography/SrOnly.tsx +9 -9
- package/src/typography/Typography.tsx +19 -19
- package/src/typography/__tests__/__snapshots__/SrOnly.tsx.snap +5 -5
- package/src/typography/_typography.scss +65 -25
- package/.turbo/turbo-lint.log +0 -12
package/src/theme/_theme.scss
CHANGED
|
@@ -37,6 +37,25 @@ $disable-dark-elevation: $color-scheme == light !default;
|
|
|
37
37
|
$disable-default-system-theme: false !default;
|
|
38
38
|
$disable-default-root-theme: false !default;
|
|
39
39
|
|
|
40
|
+
// this should only be used if your application does not use menu, dialog,
|
|
41
|
+
// sheet, card, expansion-panel, select, app-bar (theme="surface")
|
|
42
|
+
$disable-surface-color: false !default;
|
|
43
|
+
$disable-primary-color: false !default;
|
|
44
|
+
$disable-on-primary-color: $disable-primary-color !default;
|
|
45
|
+
$disable-secondary-color: false !default;
|
|
46
|
+
$disable-on-secondary-color: $disable-secondary-color !default;
|
|
47
|
+
$disable-warning-color: false !default;
|
|
48
|
+
$disable-on-warning-color: $disable-warning-color !default;
|
|
49
|
+
$disable-error-color: false !default;
|
|
50
|
+
$disable-on-error-color: $disable-error-color !default;
|
|
51
|
+
$disable-success-color: false !default;
|
|
52
|
+
$disable-on-success-color: $disable-success-color !default;
|
|
53
|
+
$disable-outline-grey-color: false !default;
|
|
54
|
+
$disable-text-primary-color: false !default;
|
|
55
|
+
$disable-text-secondary-color: false !default;
|
|
56
|
+
$disable-text-hint-color: false !default;
|
|
57
|
+
$disable-text-disabled-color: false !default;
|
|
58
|
+
|
|
40
59
|
$primary-color: colors.$blue-500 !default;
|
|
41
60
|
$on-primary-color: a11y.contrast-color($primary-color) !default;
|
|
42
61
|
$secondary-color: colors.$orange-a-400 !default;
|
|
@@ -152,7 +171,79 @@ $theme-variables: (
|
|
|
152
171
|
outline-grey-color
|
|
153
172
|
);
|
|
154
173
|
|
|
174
|
+
@function _is-var-disabled($name) {
|
|
175
|
+
@if $name == surface-color {
|
|
176
|
+
@return $disable-surface-color;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
@if $name == primary-color {
|
|
180
|
+
@return $disable-primary-color;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
@if $name == on-primary-color {
|
|
184
|
+
@return $disable-on-primary-color;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
@if $name == secondary-color {
|
|
188
|
+
@return $disable-secondary-color;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
@if $name == on-secondary-color {
|
|
192
|
+
@return $disable-on-secondary-color;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
@if $name == warning-color {
|
|
196
|
+
@return $disable-warning-color;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
@if $name == on-warning-color {
|
|
200
|
+
@return $disable-on-warning-color;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
@if $name == error-color {
|
|
204
|
+
@return $disable-error-color;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
@if $name == on-error-color {
|
|
208
|
+
@return $disable-on-error-color;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
@if $name == success-color {
|
|
212
|
+
@return $disable-success-color;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
@if $name == on-success-color {
|
|
216
|
+
@return $disable-on-success-color;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
@if $name == text-primary-color {
|
|
220
|
+
@return $disable-text-primary-color;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
@if $name == text-secondary-color {
|
|
224
|
+
@return $disable-text-secondary-color;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
@if $name == text-hint-color {
|
|
228
|
+
@return $disable-text-hint-color;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
@if $name == text-disabled-color {
|
|
232
|
+
@return $disable-text-disabled-color;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
@if $name == outline-grey-color {
|
|
236
|
+
@return $disable-outline-grey-color;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
@return false;
|
|
240
|
+
}
|
|
241
|
+
|
|
155
242
|
@function theme-get-var($name, $fallback: null) {
|
|
243
|
+
@if _is-var-disabled($name) {
|
|
244
|
+
@return $fallback;
|
|
245
|
+
}
|
|
246
|
+
|
|
156
247
|
$var: utils.get-var-name($theme-variables, $name, "theme");
|
|
157
248
|
|
|
158
249
|
@if $fallback {
|
|
@@ -175,6 +266,10 @@ $theme-variables: (
|
|
|
175
266
|
}
|
|
176
267
|
|
|
177
268
|
@mixin theme-set-var($name, $value-or-theme-name) {
|
|
269
|
+
@if _is-var-disabled($name) {
|
|
270
|
+
@error '"#{$name}" is currently disabled and cannot be changed. Set "$disable-#{$name}-var" to `true` or remove it from the Sass module overrides.';
|
|
271
|
+
}
|
|
272
|
+
|
|
178
273
|
$var: utils.get-var-name($theme-variables, $name, "theme");
|
|
179
274
|
$value: $value-or-theme-name;
|
|
180
275
|
@if list.index($theme-variables, $value-or-theme-name) {
|
|
@@ -186,6 +281,10 @@ $theme-variables: (
|
|
|
186
281
|
}
|
|
187
282
|
|
|
188
283
|
@mixin theme-use-var($property, $name: $property, $fallback: null) {
|
|
284
|
+
@if _is-var-disabled($name) {
|
|
285
|
+
@error '"#{$name}" is currently disabled and cannot be changed. Set "$disable-#{$name}-var" to `true` or remove it from the Sass module overrides.';
|
|
286
|
+
}
|
|
287
|
+
|
|
189
288
|
#{$property}: theme-get-var($name, $fallback);
|
|
190
289
|
}
|
|
191
290
|
|
|
@@ -203,16 +302,27 @@ $theme-variables: (
|
|
|
203
302
|
|
|
204
303
|
@mixin use-light-theme-colors {
|
|
205
304
|
@include theme-set-var(background-color, $light-theme-background-color);
|
|
206
|
-
@if $disable-dark-elevation {
|
|
305
|
+
@if $disable-dark-elevation and not $disable-surface-color {
|
|
207
306
|
@include theme-set-var(surface-color, $light-theme-surface-color);
|
|
208
307
|
}
|
|
209
|
-
@
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
308
|
+
@if not $disable-text-primary-color {
|
|
309
|
+
@include theme-set-var(text-primary-color, $light-theme-text-primary-color);
|
|
310
|
+
}
|
|
311
|
+
@if not $disable-text-secondary-color {
|
|
312
|
+
@include theme-set-var(
|
|
313
|
+
text-secondary-color,
|
|
314
|
+
$light-theme-text-secondary-color
|
|
315
|
+
);
|
|
316
|
+
}
|
|
317
|
+
@if not $disable-text-hint-color {
|
|
318
|
+
@include theme-set-var(text-hint-color, $light-theme-text-hint-color);
|
|
319
|
+
}
|
|
320
|
+
@if not $disable-text-disabled-color {
|
|
321
|
+
@include theme-set-var(
|
|
322
|
+
text-disabled-color,
|
|
323
|
+
$light-theme-text-disabled-color
|
|
324
|
+
);
|
|
325
|
+
}
|
|
216
326
|
|
|
217
327
|
@if not $disable-dark-elevation and $color-scheme != light {
|
|
218
328
|
@include use-light-theme-elevation-colors;
|
|
@@ -221,16 +331,27 @@ $theme-variables: (
|
|
|
221
331
|
|
|
222
332
|
@mixin use-dark-theme-colors {
|
|
223
333
|
@include theme-set-var(background-color, $dark-theme-background-color);
|
|
224
|
-
@if $disable-dark-elevation {
|
|
334
|
+
@if $disable-dark-elevation and not $disable-surface-color {
|
|
225
335
|
@include theme-set-var(surface-color, $dark-theme-surface-color);
|
|
226
336
|
}
|
|
227
|
-
@
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
337
|
+
@if not $disable-text-primary-color {
|
|
338
|
+
@include theme-set-var(text-primary-color, $dark-theme-text-primary-color);
|
|
339
|
+
}
|
|
340
|
+
@if not $disable-text-secondary-color {
|
|
341
|
+
@include theme-set-var(
|
|
342
|
+
text-secondary-color,
|
|
343
|
+
$dark-theme-text-secondary-color
|
|
344
|
+
);
|
|
345
|
+
}
|
|
346
|
+
@if not $disable-text-hint-color {
|
|
347
|
+
@include theme-set-var(text-hint-color, $dark-theme-text-hint-color);
|
|
348
|
+
}
|
|
349
|
+
@if not $disable-text-disabled-color {
|
|
350
|
+
@include theme-set-var(
|
|
351
|
+
text-disabled-color,
|
|
352
|
+
$dark-theme-text-disabled-color
|
|
353
|
+
);
|
|
354
|
+
}
|
|
234
355
|
|
|
235
356
|
@if not $disable-dark-elevation {
|
|
236
357
|
@include use-dark-theme-elevation-colors;
|
|
@@ -239,24 +360,52 @@ $theme-variables: (
|
|
|
239
360
|
|
|
240
361
|
@mixin theme-variables {
|
|
241
362
|
@include theme-set-var(background-color, $background-color);
|
|
242
|
-
@if $disable-dark-elevation {
|
|
363
|
+
@if $disable-dark-elevation and not $disable-surface-color {
|
|
243
364
|
@include theme-set-var(surface-color, $surface-color);
|
|
244
365
|
}
|
|
245
366
|
|
|
246
|
-
@
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
@
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
@
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
@
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
@
|
|
259
|
-
|
|
367
|
+
@if not $disable-primary-color {
|
|
368
|
+
@include theme-set-var(primary-color, $primary-color);
|
|
369
|
+
}
|
|
370
|
+
@if not $disable-on-primary-color {
|
|
371
|
+
@include theme-set-var(on-primary-color, $on-primary-color);
|
|
372
|
+
}
|
|
373
|
+
@if not $disable-secondary-color {
|
|
374
|
+
@include theme-set-var(secondary-color, $secondary-color);
|
|
375
|
+
}
|
|
376
|
+
@if not $disable-on-secondary-color {
|
|
377
|
+
@include theme-set-var(on-secondary-color, $on-secondary-color);
|
|
378
|
+
}
|
|
379
|
+
@if not $disable-warning-color {
|
|
380
|
+
@include theme-set-var(warning-color, $warning-color);
|
|
381
|
+
}
|
|
382
|
+
@if not $disable-on-warning-color {
|
|
383
|
+
@include theme-set-var(on-warning-color, $on-warning-color);
|
|
384
|
+
}
|
|
385
|
+
@if not $disable-error-color {
|
|
386
|
+
@include theme-set-var(error-color, $error-color);
|
|
387
|
+
}
|
|
388
|
+
@if not $disable-on-error-color {
|
|
389
|
+
@include theme-set-var(on-error-color, $on-error-color);
|
|
390
|
+
}
|
|
391
|
+
@if not $disable-success-color {
|
|
392
|
+
@include theme-set-var(success-color, $success-color);
|
|
393
|
+
}
|
|
394
|
+
@if not $disable-on-success-color {
|
|
395
|
+
@include theme-set-var(on-success-color, $on-success-color);
|
|
396
|
+
}
|
|
397
|
+
@if not $disable-text-primary-color {
|
|
398
|
+
@include theme-set-var(text-primary-color, $text-primary-color);
|
|
399
|
+
}
|
|
400
|
+
@if not $disable-text-secondary-color {
|
|
401
|
+
@include theme-set-var(text-secondary-color, $text-secondary-color);
|
|
402
|
+
}
|
|
403
|
+
@if not $disable-text-hint-color {
|
|
404
|
+
@include theme-set-var(text-hint-color, $text-hint-color);
|
|
405
|
+
}
|
|
406
|
+
@if not $disable-text-disabled-color {
|
|
407
|
+
@include theme-set-var(text-disabled-color, $text-disabled-color);
|
|
408
|
+
}
|
|
260
409
|
|
|
261
410
|
@if not $disable-dark-elevation {
|
|
262
411
|
@if $color-scheme == dark {
|
|
@@ -268,7 +417,9 @@ $theme-variables: (
|
|
|
268
417
|
|
|
269
418
|
@include theme-set-var(outline-width, $outline-width);
|
|
270
419
|
@include theme-set-var(outline-color, $outline-color);
|
|
271
|
-
@
|
|
420
|
+
@if not $disable-outline-grey-color {
|
|
421
|
+
@include theme-set-var(outline-grey-color, $outline-grey-color);
|
|
422
|
+
}
|
|
272
423
|
}
|
|
273
424
|
|
|
274
425
|
@mixin create-surface($z-value, $disable-colors: $disable-dark-elevation) {
|
|
@@ -278,7 +429,9 @@ $theme-variables: (
|
|
|
278
429
|
@if not $disable-colors {
|
|
279
430
|
@include theme-set-var(background-color, theme-get-var(surface-color));
|
|
280
431
|
@include theme-use-var(background-color);
|
|
281
|
-
@
|
|
432
|
+
@if not $disable-text-primary-color {
|
|
433
|
+
@include theme-use-var(color, text-primary-color);
|
|
434
|
+
}
|
|
282
435
|
}
|
|
283
436
|
}
|
|
284
437
|
|
|
@@ -351,7 +504,12 @@ $theme-variables: (
|
|
|
351
504
|
}
|
|
352
505
|
|
|
353
506
|
@mixin default-system-theme {
|
|
354
|
-
@if not
|
|
507
|
+
@if not
|
|
508
|
+
$disable-default-system-theme and
|
|
509
|
+
$disable-default-root-theme and
|
|
510
|
+
$color-scheme ==
|
|
511
|
+
system
|
|
512
|
+
{
|
|
355
513
|
@media (prefers-color-scheme: dark) {
|
|
356
514
|
:root {
|
|
357
515
|
@content;
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import { forwardRef } from "react";
|
|
1
|
+
import { forwardRef, type ElementType, type HTMLAttributes } from "react";
|
|
2
|
+
import { cssUtils } from "../cssUtils.js";
|
|
2
3
|
import {
|
|
3
|
-
Typography,
|
|
4
4
|
type CustomTypographyComponent,
|
|
5
5
|
type TypographyHTMLElement,
|
|
6
|
-
type TypographyProps,
|
|
7
6
|
} from "./Typography.js";
|
|
8
|
-
import { cssUtils } from "../cssUtils.js";
|
|
9
7
|
|
|
10
|
-
export interface SrOnlyProps extends
|
|
8
|
+
export interface SrOnlyProps extends HTMLAttributes<TypographyHTMLElement> {
|
|
11
9
|
/** @defaultValue `"span"` */
|
|
12
10
|
as?: CustomTypographyComponent;
|
|
13
11
|
|
|
@@ -54,7 +52,7 @@ export interface SrOnlyProps extends TypographyProps {
|
|
|
54
52
|
export const SrOnly = forwardRef<TypographyHTMLElement, SrOnlyProps>(
|
|
55
53
|
function SrOnly(props, ref) {
|
|
56
54
|
const {
|
|
57
|
-
as = "span",
|
|
55
|
+
as: AsComponent = "span",
|
|
58
56
|
className,
|
|
59
57
|
phoneOnly,
|
|
60
58
|
focusable,
|
|
@@ -63,10 +61,12 @@ export const SrOnly = forwardRef<TypographyHTMLElement, SrOnlyProps>(
|
|
|
63
61
|
...remaining
|
|
64
62
|
} = props;
|
|
65
63
|
|
|
64
|
+
// do some type-casting so ref works
|
|
65
|
+
const Component = AsComponent as ElementType;
|
|
66
|
+
|
|
66
67
|
return (
|
|
67
|
-
<
|
|
68
|
+
<Component
|
|
68
69
|
{...remaining}
|
|
69
|
-
as={as}
|
|
70
70
|
ref={ref}
|
|
71
71
|
tabIndex={tabIndex ?? (focusable ? 0 : undefined)}
|
|
72
72
|
className={cssUtils({
|
|
@@ -75,7 +75,7 @@ export const SrOnly = forwardRef<TypographyHTMLElement, SrOnlyProps>(
|
|
|
75
75
|
})}
|
|
76
76
|
>
|
|
77
77
|
{children}
|
|
78
|
-
</
|
|
78
|
+
</Component>
|
|
79
79
|
);
|
|
80
80
|
}
|
|
81
81
|
);
|
|
@@ -62,24 +62,24 @@ export type NullableTypographyClassNameOptions = Omit<
|
|
|
62
62
|
* @example
|
|
63
63
|
* Simple Example
|
|
64
64
|
* ```ts
|
|
65
|
-
* import {
|
|
65
|
+
* import { typography } from "@react-md/core";
|
|
66
66
|
*
|
|
67
67
|
* function Example() {
|
|
68
68
|
* return (
|
|
69
69
|
* <>
|
|
70
|
-
* <h1 className={
|
|
71
|
-
* <h2 className={
|
|
72
|
-
* <h3 className={
|
|
73
|
-
* <h4 className={
|
|
74
|
-
* <h5 className={
|
|
75
|
-
* <h6 className={
|
|
76
|
-
* <h5 className={
|
|
77
|
-
* <h6 className={
|
|
78
|
-
* <p className={
|
|
79
|
-
* <p className={
|
|
80
|
-
* <p className={
|
|
81
|
-
* <caption className={
|
|
82
|
-
* <span className={
|
|
70
|
+
* <h1 className={typography({ type: "headline-1" })} />
|
|
71
|
+
* <h2 className={typography({ type: "headline-2" })} />
|
|
72
|
+
* <h3 className={typography({ type: "headline-3" })} />
|
|
73
|
+
* <h4 className={typography({ type: "headline-4" })} />
|
|
74
|
+
* <h5 className={typography({ type: "headline-5" })} />
|
|
75
|
+
* <h6 className={typography({ type: "headline-6" })} />
|
|
76
|
+
* <h5 className={typography({ type: "subtitle-1" })} />
|
|
77
|
+
* <h6 className={typography({ type: "subtitle-2" })} />
|
|
78
|
+
* <p className={typography()} />
|
|
79
|
+
* <p className={typography({ type "body-1" })} />
|
|
80
|
+
* <p className={typography({ type "body-1" })} />
|
|
81
|
+
* <caption className={typography({ type: "caption" })} />
|
|
82
|
+
* <span className={typography({ type: "overline" })} />
|
|
83
83
|
* </>
|
|
84
84
|
* );
|
|
85
85
|
* }
|
|
@@ -88,14 +88,14 @@ export type NullableTypographyClassNameOptions = Omit<
|
|
|
88
88
|
* @example
|
|
89
89
|
* Applying Additional Styles
|
|
90
90
|
* ```ts
|
|
91
|
-
* import {
|
|
91
|
+
* import { typography } from "@react-md/core";
|
|
92
92
|
*
|
|
93
93
|
* function Example() {
|
|
94
94
|
* return (
|
|
95
95
|
* <>
|
|
96
96
|
* <h1
|
|
97
97
|
* // only maintain the default margin-bottom
|
|
98
|
-
* className={
|
|
98
|
+
* className={typography({
|
|
99
99
|
* type: "headline-1",
|
|
100
100
|
* margin: "bottom",
|
|
101
101
|
* })}
|
|
@@ -103,7 +103,7 @@ export type NullableTypographyClassNameOptions = Omit<
|
|
|
103
103
|
*
|
|
104
104
|
* <h2
|
|
105
105
|
* // remove all default margin
|
|
106
|
-
* className={
|
|
106
|
+
* className={typography({
|
|
107
107
|
* type: "headline-2",
|
|
108
108
|
* margin: "none",
|
|
109
109
|
* })}
|
|
@@ -111,7 +111,7 @@ export type NullableTypographyClassNameOptions = Omit<
|
|
|
111
111
|
*
|
|
112
112
|
* <h3
|
|
113
113
|
* // only maintain the default margin-top
|
|
114
|
-
* className={
|
|
114
|
+
* className={typography({
|
|
115
115
|
* type: "headline-3",
|
|
116
116
|
* margin: "top",
|
|
117
117
|
* })}
|
|
@@ -119,7 +119,7 @@ export type NullableTypographyClassNameOptions = Omit<
|
|
|
119
119
|
*
|
|
120
120
|
* <p
|
|
121
121
|
* // center the text, set to bold, and only maintain default margin-bottom
|
|
122
|
-
* className={
|
|
122
|
+
* className={typography({
|
|
123
123
|
* type "subtitle-1",
|
|
124
124
|
* align: "center",
|
|
125
125
|
* margin: "bottom",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
exports[`SrOnly should apply the correct styling, HTML attributes, and allow a ref 1`] = `
|
|
4
4
|
<div>
|
|
5
5
|
<span
|
|
6
|
-
class="rmd-
|
|
6
|
+
class="rmd-sr-only"
|
|
7
7
|
>
|
|
8
8
|
Some content
|
|
9
9
|
</span>
|
|
@@ -13,7 +13,7 @@ exports[`SrOnly should apply the correct styling, HTML attributes, and allow a r
|
|
|
13
13
|
exports[`SrOnly should apply the correct styling, HTML attributes, and allow a ref 2`] = `
|
|
14
14
|
<div>
|
|
15
15
|
<span
|
|
16
|
-
class="rmd-
|
|
16
|
+
class="rmd-sr-only custom-class-name"
|
|
17
17
|
style="opacity: 0.3;"
|
|
18
18
|
>
|
|
19
19
|
Some content
|
|
@@ -24,7 +24,7 @@ exports[`SrOnly should apply the correct styling, HTML attributes, and allow a r
|
|
|
24
24
|
exports[`SrOnly should apply the correct styling, HTML attributes, and allow a ref 3`] = `
|
|
25
25
|
<div>
|
|
26
26
|
<span
|
|
27
|
-
class="rmd-
|
|
27
|
+
class="rmd-sr-only rmd-sr-only--focusable"
|
|
28
28
|
style=""
|
|
29
29
|
tabindex="0"
|
|
30
30
|
>
|
|
@@ -36,7 +36,7 @@ exports[`SrOnly should apply the correct styling, HTML attributes, and allow a r
|
|
|
36
36
|
exports[`SrOnly should apply the correct styling, HTML attributes, and allow a ref 4`] = `
|
|
37
37
|
<div>
|
|
38
38
|
<span
|
|
39
|
-
class="rmd-
|
|
39
|
+
class="rmd-sr-only rmd-sr-only--focusable"
|
|
40
40
|
style=""
|
|
41
41
|
tabindex="-1"
|
|
42
42
|
>
|
|
@@ -48,7 +48,7 @@ exports[`SrOnly should apply the correct styling, HTML attributes, and allow a r
|
|
|
48
48
|
exports[`SrOnly should apply the correct styling, HTML attributes, and allow a ref 5`] = `
|
|
49
49
|
<div>
|
|
50
50
|
<h4
|
|
51
|
-
class="rmd-
|
|
51
|
+
class="rmd-sr-only"
|
|
52
52
|
>
|
|
53
53
|
Some content
|
|
54
54
|
</h4>
|
|
@@ -4,6 +4,18 @@
|
|
|
4
4
|
@use "../utils";
|
|
5
5
|
|
|
6
6
|
$disable-text-container: false !default;
|
|
7
|
+
$disable-headline-1: false !default;
|
|
8
|
+
$disable-headline-2: false !default;
|
|
9
|
+
$disable-headline-3: false !default;
|
|
10
|
+
$disable-headline-4: false !default;
|
|
11
|
+
$disable-headline-5: false !default;
|
|
12
|
+
$disable-headline-6: false !default;
|
|
13
|
+
$disable-subtitle-1: false !default;
|
|
14
|
+
$disable-subtitle-2: false !default;
|
|
15
|
+
$disable-body-1: false !default;
|
|
16
|
+
$disable-body-2: false !default;
|
|
17
|
+
$disable-caption: false !default;
|
|
18
|
+
$disable-overline: false !default;
|
|
7
19
|
|
|
8
20
|
/// A small utility function to get the letter spacing based on tracking and
|
|
9
21
|
/// font-size
|
|
@@ -216,9 +228,13 @@ $button-recommended-styles: map.merge(
|
|
|
216
228
|
$base-font-styles,
|
|
217
229
|
(
|
|
218
230
|
font-size: 0.875rem,
|
|
219
|
-
line-height: 2.25rem,
|
|
220
231
|
font-weight: map.get($font-weights, medium),
|
|
221
232
|
letter-spacing: get-letter-spacing(1.25, 0.875),
|
|
233
|
+
line-height: 2.25rem,
|
|
234
|
+
// buttons with multiple lines of text look terrible because of the large
|
|
235
|
+
// line-height. You normally want to use a different component if the
|
|
236
|
+
// clickable area has so much content to line-wrap
|
|
237
|
+
line-wrap: nowrap,
|
|
222
238
|
)
|
|
223
239
|
);
|
|
224
240
|
$button-custom-styles: () !default;
|
|
@@ -276,52 +292,76 @@ $typography-variables: (line-length, text-container-padding);
|
|
|
276
292
|
.rmd-typography {
|
|
277
293
|
@include utils.map-to-styles($base-font-styles);
|
|
278
294
|
|
|
279
|
-
|
|
280
|
-
|
|
295
|
+
@if not $disable-headline-1 {
|
|
296
|
+
&--headline-1 {
|
|
297
|
+
@include utils.map-to-styles($headline-1-styles);
|
|
298
|
+
}
|
|
281
299
|
}
|
|
282
300
|
|
|
283
|
-
|
|
284
|
-
|
|
301
|
+
@if not $disable-headline-2 {
|
|
302
|
+
&--headline-2 {
|
|
303
|
+
@include utils.map-to-styles($headline-2-styles);
|
|
304
|
+
}
|
|
285
305
|
}
|
|
286
306
|
|
|
287
|
-
|
|
288
|
-
|
|
307
|
+
@if not $disable-headline-3 {
|
|
308
|
+
&--headline-3 {
|
|
309
|
+
@include utils.map-to-styles($headline-3-styles);
|
|
310
|
+
}
|
|
289
311
|
}
|
|
290
312
|
|
|
291
|
-
|
|
292
|
-
|
|
313
|
+
@if not $disable-headline-4 {
|
|
314
|
+
&--headline-4 {
|
|
315
|
+
@include utils.map-to-styles($headline-4-styles);
|
|
316
|
+
}
|
|
293
317
|
}
|
|
294
318
|
|
|
295
|
-
|
|
296
|
-
|
|
319
|
+
@if not $disable-headline-5 {
|
|
320
|
+
&--headline-5 {
|
|
321
|
+
@include utils.map-to-styles($headline-5-styles);
|
|
322
|
+
}
|
|
297
323
|
}
|
|
298
324
|
|
|
299
|
-
|
|
300
|
-
|
|
325
|
+
@if not $disable-headline-6 {
|
|
326
|
+
&--headline-6 {
|
|
327
|
+
@include utils.map-to-styles($headline-6-styles);
|
|
328
|
+
}
|
|
301
329
|
}
|
|
302
330
|
|
|
303
|
-
|
|
304
|
-
|
|
331
|
+
@if not $disable-subtitle-1 {
|
|
332
|
+
&--subtitle-1 {
|
|
333
|
+
@include utils.map-to-styles($subtitle-1-styles);
|
|
334
|
+
}
|
|
305
335
|
}
|
|
306
336
|
|
|
307
|
-
|
|
308
|
-
|
|
337
|
+
@if not $disable-subtitle-2 {
|
|
338
|
+
&--subtitle-2 {
|
|
339
|
+
@include utils.map-to-styles($subtitle-2-styles);
|
|
340
|
+
}
|
|
309
341
|
}
|
|
310
342
|
|
|
311
|
-
|
|
312
|
-
|
|
343
|
+
@if not $disable-body-1 {
|
|
344
|
+
&--body-1 {
|
|
345
|
+
@include utils.map-to-styles($body-1-styles);
|
|
346
|
+
}
|
|
313
347
|
}
|
|
314
348
|
|
|
315
|
-
|
|
316
|
-
|
|
349
|
+
@if not $disable-body-2 {
|
|
350
|
+
&--body-2 {
|
|
351
|
+
@include utils.map-to-styles($body-2-styles);
|
|
352
|
+
}
|
|
317
353
|
}
|
|
318
354
|
|
|
319
|
-
|
|
320
|
-
|
|
355
|
+
@if not $disable-caption {
|
|
356
|
+
&--caption {
|
|
357
|
+
@include utils.map-to-styles($caption-styles);
|
|
358
|
+
}
|
|
321
359
|
}
|
|
322
360
|
|
|
323
|
-
|
|
324
|
-
|
|
361
|
+
@if not $disable-overline {
|
|
362
|
+
&--overline {
|
|
363
|
+
@include utils.map-to-styles($overline-styles);
|
|
364
|
+
}
|
|
325
365
|
}
|
|
326
366
|
}
|
|
327
367
|
}
|
package/.turbo/turbo-lint.log
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
> @react-md/core@1.0.0-next.6 lint /home/mlaursen/code/react-md/packages/core
|
|
3
|
-
> npm-run-all lint-scripts lint-styles
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
> @react-md/core@1.0.0-next.6 lint-scripts /home/mlaursen/code/react-md/packages/core
|
|
7
|
-
> eslint "src/**/*.{ts,tsx,js,jsx,cjs,mjs}"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
> @react-md/core@1.0.0-next.6 lint-styles /home/mlaursen/code/react-md/packages/core
|
|
11
|
-
> stylelint "src/**/*.{css,scss}"
|
|
12
|
-
|