@react-md/core 1.0.0-next.6 → 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 +12 -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 +109 -87
- 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 +109 -87
- 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
|
@@ -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
|
}
|