@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
|
@@ -11,11 +11,11 @@ import { ListItem } from "../list/ListItem.js";
|
|
|
11
11
|
import {
|
|
12
12
|
type ListItemAddonPosition,
|
|
13
13
|
type ListItemAddonType,
|
|
14
|
+
type ListItemChildrenTextProps,
|
|
14
15
|
type ListItemHeight,
|
|
15
16
|
} from "../list/types.js";
|
|
16
17
|
import { type PropsWithRef } from "../types.js";
|
|
17
18
|
import { useEnsuredId } from "../useEnsuredId.js";
|
|
18
|
-
import { bem } from "../utils/bem.js";
|
|
19
19
|
import {
|
|
20
20
|
type IndeterminateCheckboxProps,
|
|
21
21
|
type InputToggleIconProps,
|
|
@@ -23,31 +23,16 @@ import {
|
|
|
23
23
|
import { InputToggleIcon } from "./InputToggleIcon.js";
|
|
24
24
|
import { SwitchTrack } from "./SwitchTrack.js";
|
|
25
25
|
import { type InputToggleSize } from "./inputToggleStyles.js";
|
|
26
|
+
import {
|
|
27
|
+
menuItemInputToggle,
|
|
28
|
+
menuItemInputToggleBall,
|
|
29
|
+
menuItemInputToggleIcon,
|
|
30
|
+
menuItemInputToggleTrack,
|
|
31
|
+
} from "./menuItemInputToggleStyles.js";
|
|
26
32
|
|
|
27
33
|
const noop = (): void => {
|
|
28
34
|
// do nothing
|
|
29
35
|
};
|
|
30
|
-
const styles = bem("rmd-menu-item-input-toggle");
|
|
31
|
-
|
|
32
|
-
/** @remarks \@since 6.0.0 */
|
|
33
|
-
export interface MenuItemInputToggleClassNameOptions {
|
|
34
|
-
className?: string;
|
|
35
|
-
type: "radio" | "checkbox" | "switch";
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* @remarks \@since 6.0.0
|
|
40
|
-
*/
|
|
41
|
-
export function menuItemInputToggle(
|
|
42
|
-
options: MenuItemInputToggleClassNameOptions
|
|
43
|
-
): string {
|
|
44
|
-
const { className, type } = options;
|
|
45
|
-
return cnb(
|
|
46
|
-
`rmd-${type}-menu-item`,
|
|
47
|
-
styles({ switch: type === "switch" }),
|
|
48
|
-
className
|
|
49
|
-
);
|
|
50
|
-
}
|
|
51
36
|
|
|
52
37
|
/**
|
|
53
38
|
* @remarks \@since 6.0.0
|
|
@@ -60,7 +45,8 @@ export type MenuItemInputToggleCheckedCallback = (
|
|
|
60
45
|
/** @remarks \@since 2.8.0 */
|
|
61
46
|
export interface BaseMenuItemInputToggleProps
|
|
62
47
|
extends HTMLAttributes<HTMLLIElement>,
|
|
63
|
-
InputToggleIconProps
|
|
48
|
+
InputToggleIconProps,
|
|
49
|
+
ListItemChildrenTextProps {
|
|
64
50
|
checked: boolean;
|
|
65
51
|
onCheckedChange: MenuItemInputToggleCheckedCallback;
|
|
66
52
|
|
|
@@ -95,12 +81,6 @@ export interface BaseMenuItemInputToggleProps
|
|
|
95
81
|
/** @defaultValue `"auto"` */
|
|
96
82
|
height?: ListItemHeight;
|
|
97
83
|
|
|
98
|
-
/** @defaultValue `false` */
|
|
99
|
-
multiline?: boolean;
|
|
100
|
-
|
|
101
|
-
/** @defaultValue `false` */
|
|
102
|
-
disableTextChildren?: boolean;
|
|
103
|
-
|
|
104
84
|
/** @defaultValue `false` */
|
|
105
85
|
iconAfter?: boolean;
|
|
106
86
|
|
|
@@ -199,41 +179,43 @@ export const MenuItemInputToggle = forwardRef<
|
|
|
199
179
|
const id = useEnsuredId(propId, "menu-item");
|
|
200
180
|
|
|
201
181
|
let icon = propIcon;
|
|
202
|
-
if (
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
182
|
+
if (type === "switch") {
|
|
183
|
+
icon = (
|
|
184
|
+
<SwitchTrack
|
|
185
|
+
style={trackStyle}
|
|
186
|
+
{...trackProps}
|
|
187
|
+
className={cnb(
|
|
188
|
+
menuItemInputToggleTrack(),
|
|
189
|
+
trackClassName,
|
|
190
|
+
trackProps?.className
|
|
191
|
+
)}
|
|
192
|
+
active={checked}
|
|
193
|
+
ballProps={ballProps}
|
|
194
|
+
ballStyle={ballStyle}
|
|
195
|
+
ballClassName={cnb(menuItemInputToggleBall(), ballClassName)}
|
|
196
|
+
/>
|
|
197
|
+
);
|
|
198
|
+
} else {
|
|
199
|
+
icon = (
|
|
200
|
+
<InputToggleIcon
|
|
201
|
+
style={iconStyle}
|
|
202
|
+
disableEm
|
|
203
|
+
{...iconProps}
|
|
204
|
+
className={cnb(
|
|
205
|
+
menuItemInputToggleIcon(),
|
|
206
|
+
iconClassName,
|
|
207
|
+
iconProps?.className
|
|
208
|
+
)}
|
|
209
|
+
size={size}
|
|
210
|
+
type={type}
|
|
211
|
+
checked={checked}
|
|
212
|
+
disabled={disabled}
|
|
213
|
+
icon={propIcon}
|
|
214
|
+
checkedIcon={checkedIcon}
|
|
215
|
+
indeterminate={indeterminate}
|
|
216
|
+
indeterminateIcon={indeterminateIcon}
|
|
217
|
+
/>
|
|
218
|
+
);
|
|
237
219
|
}
|
|
238
220
|
|
|
239
221
|
let leftAddon: ReactNode;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { describe, expect, it, jest } from "@jest/globals";
|
|
2
|
+
import { createRef } from "react";
|
|
3
|
+
import { rmdRender, screen } from "../../test-utils/index.js";
|
|
4
|
+
import { type MenuItemCheckboxProps } from "../MenuItemInputToggle.js";
|
|
5
|
+
import { MenuItemCheckbox } from "../MenuItemCheckbox.js";
|
|
6
|
+
|
|
7
|
+
describe("MenuItemCheckbox", () => {
|
|
8
|
+
it("should apply the correct styling, HTMLAttributes, and allow a ref", () => {
|
|
9
|
+
const ref = createRef<HTMLLIElement>();
|
|
10
|
+
const props = {
|
|
11
|
+
ref,
|
|
12
|
+
checked: false,
|
|
13
|
+
onCheckedChange: jest.fn(),
|
|
14
|
+
children: "Checkbox",
|
|
15
|
+
} as const;
|
|
16
|
+
|
|
17
|
+
const { rerender } = rmdRender(<MenuItemCheckbox {...props} />);
|
|
18
|
+
|
|
19
|
+
const element = screen.getByRole("menuitemcheckbox", { name: "Checkbox" });
|
|
20
|
+
expect(ref.current).toBeInstanceOf(HTMLLIElement);
|
|
21
|
+
expect(ref.current).toBe(element);
|
|
22
|
+
expect(element).toMatchSnapshot();
|
|
23
|
+
|
|
24
|
+
rerender(
|
|
25
|
+
<MenuItemCheckbox
|
|
26
|
+
{...props}
|
|
27
|
+
style={{ color: "white" }}
|
|
28
|
+
className="custom-class-name"
|
|
29
|
+
/>
|
|
30
|
+
);
|
|
31
|
+
expect(element).toMatchSnapshot();
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it("should allow for a custom unchecked and checked icon", async () => {
|
|
35
|
+
const props: MenuItemCheckboxProps = {
|
|
36
|
+
icon: null,
|
|
37
|
+
checkedIcon: <span data-testid="checked" />,
|
|
38
|
+
iconAfter: true,
|
|
39
|
+
children: "Checkbox",
|
|
40
|
+
checked: false,
|
|
41
|
+
onCheckedChange: jest.fn(),
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const { rerender } = rmdRender(<MenuItemCheckbox {...props} />);
|
|
45
|
+
|
|
46
|
+
const element = screen.getByRole("menuitemcheckbox", { name: "Checkbox" });
|
|
47
|
+
expect(element).toMatchSnapshot();
|
|
48
|
+
expect(element.querySelector(".rmd-icon")).toBeNull();
|
|
49
|
+
|
|
50
|
+
rerender(<MenuItemCheckbox {...props} checked />);
|
|
51
|
+
expect(element).toMatchSnapshot();
|
|
52
|
+
});
|
|
53
|
+
});
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { describe, expect, it, jest } from "@jest/globals";
|
|
2
|
+
import { createRef } from "react";
|
|
3
|
+
import { rmdRender, screen } from "../../test-utils/index.js";
|
|
4
|
+
import { type MenuItemRadioProps } from "../MenuItemInputToggle.js";
|
|
5
|
+
import { MenuItemRadio } from "../MenuItemRadio.js";
|
|
6
|
+
|
|
7
|
+
describe("MenuItemRadio", () => {
|
|
8
|
+
it("should apply the correct styling, HTMLAttributes, and allow a ref", () => {
|
|
9
|
+
const ref = createRef<HTMLLIElement>();
|
|
10
|
+
const props = {
|
|
11
|
+
ref,
|
|
12
|
+
checked: false,
|
|
13
|
+
onCheckedChange: jest.fn(),
|
|
14
|
+
children: "Radio",
|
|
15
|
+
} as const;
|
|
16
|
+
|
|
17
|
+
const { rerender } = rmdRender(<MenuItemRadio {...props} />);
|
|
18
|
+
|
|
19
|
+
const element = screen.getByRole("menuitemradio", { name: "Radio" });
|
|
20
|
+
expect(ref.current).toBeInstanceOf(HTMLLIElement);
|
|
21
|
+
expect(ref.current).toBe(element);
|
|
22
|
+
expect(element).toMatchSnapshot();
|
|
23
|
+
|
|
24
|
+
rerender(
|
|
25
|
+
<MenuItemRadio
|
|
26
|
+
{...props}
|
|
27
|
+
style={{ color: "white" }}
|
|
28
|
+
className="custom-class-name"
|
|
29
|
+
/>
|
|
30
|
+
);
|
|
31
|
+
expect(element).toMatchSnapshot();
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it("should allow for a custom unchecked and checked icon", async () => {
|
|
35
|
+
const props: MenuItemRadioProps = {
|
|
36
|
+
icon: null,
|
|
37
|
+
checkedIcon: <span data-testid="checked" />,
|
|
38
|
+
iconAfter: true,
|
|
39
|
+
children: "Radio",
|
|
40
|
+
checked: false,
|
|
41
|
+
onCheckedChange: jest.fn(),
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const { rerender } = rmdRender(<MenuItemRadio {...props} />);
|
|
45
|
+
|
|
46
|
+
const element = screen.getByRole("menuitemradio", { name: "Radio" });
|
|
47
|
+
expect(element).toMatchSnapshot();
|
|
48
|
+
expect(element.querySelector(".rmd-icon")).toBeNull();
|
|
49
|
+
|
|
50
|
+
rerender(<MenuItemRadio {...props} checked />);
|
|
51
|
+
expect(element).toMatchSnapshot();
|
|
52
|
+
});
|
|
53
|
+
});
|
|
@@ -12,7 +12,7 @@ exports[`FileInput should apply the correct styling, HTMLAttributes, and allow a
|
|
|
12
12
|
file_upload
|
|
13
13
|
</span>
|
|
14
14
|
<span
|
|
15
|
-
class="rmd-
|
|
15
|
+
class="rmd-sr-only"
|
|
16
16
|
>
|
|
17
17
|
Upload
|
|
18
18
|
</span>
|
|
@@ -37,7 +37,7 @@ exports[`FileInput should apply the correct styling, HTMLAttributes, and allow a
|
|
|
37
37
|
file_upload
|
|
38
38
|
</span>
|
|
39
39
|
<span
|
|
40
|
-
class="rmd-
|
|
40
|
+
class="rmd-sr-only"
|
|
41
41
|
>
|
|
42
42
|
Upload
|
|
43
43
|
</span>
|
|
@@ -63,7 +63,7 @@ exports[`FileInput should render as an icon button unless children are provided
|
|
|
63
63
|
file_upload
|
|
64
64
|
</span>
|
|
65
65
|
<span
|
|
66
|
-
class="rmd-
|
|
66
|
+
class="rmd-sr-only"
|
|
67
67
|
>
|
|
68
68
|
Upload
|
|
69
69
|
</span>
|
|
@@ -87,7 +87,7 @@ exports[`FileInput should render as an icon button unless children are provided
|
|
|
87
87
|
file_upload
|
|
88
88
|
</span>
|
|
89
89
|
<span
|
|
90
|
-
class="rmd-
|
|
90
|
+
class="rmd-sr-only"
|
|
91
91
|
>
|
|
92
92
|
Upload
|
|
93
93
|
</span>
|
|
@@ -165,7 +165,7 @@ exports[`FileInput should support all the button themes 1`] = `
|
|
|
165
165
|
file_upload
|
|
166
166
|
</span>
|
|
167
167
|
<span
|
|
168
|
-
class="rmd-
|
|
168
|
+
class="rmd-sr-only"
|
|
169
169
|
>
|
|
170
170
|
Upload
|
|
171
171
|
</span>
|
|
@@ -189,7 +189,7 @@ exports[`FileInput should support all the button themes 2`] = `
|
|
|
189
189
|
file_upload
|
|
190
190
|
</span>
|
|
191
191
|
<span
|
|
192
|
-
class="rmd-
|
|
192
|
+
class="rmd-sr-only"
|
|
193
193
|
>
|
|
194
194
|
Upload
|
|
195
195
|
</span>
|
|
@@ -213,7 +213,7 @@ exports[`FileInput should support all the button themes 3`] = `
|
|
|
213
213
|
file_upload
|
|
214
214
|
</span>
|
|
215
215
|
<span
|
|
216
|
-
class="rmd-
|
|
216
|
+
class="rmd-sr-only"
|
|
217
217
|
>
|
|
218
218
|
Upload
|
|
219
219
|
</span>
|
|
@@ -237,7 +237,7 @@ exports[`FileInput should support all the button themes 4`] = `
|
|
|
237
237
|
file_upload
|
|
238
238
|
</span>
|
|
239
239
|
<span
|
|
240
|
-
class="rmd-
|
|
240
|
+
class="rmd-sr-only"
|
|
241
241
|
>
|
|
242
242
|
Upload
|
|
243
243
|
</span>
|
|
@@ -261,7 +261,7 @@ exports[`FileInput should support all the button themes 5`] = `
|
|
|
261
261
|
file_upload
|
|
262
262
|
</span>
|
|
263
263
|
<span
|
|
264
|
-
class="rmd-
|
|
264
|
+
class="rmd-sr-only"
|
|
265
265
|
>
|
|
266
266
|
Upload
|
|
267
267
|
</span>
|
|
@@ -285,7 +285,7 @@ exports[`FileInput should support all the button themes 6`] = `
|
|
|
285
285
|
file_upload
|
|
286
286
|
</span>
|
|
287
287
|
<span
|
|
288
|
-
class="rmd-
|
|
288
|
+
class="rmd-sr-only"
|
|
289
289
|
>
|
|
290
290
|
Upload
|
|
291
291
|
</span>
|
|
@@ -309,7 +309,7 @@ exports[`FileInput should support all the button themes 7`] = `
|
|
|
309
309
|
file_upload
|
|
310
310
|
</span>
|
|
311
311
|
<span
|
|
312
|
-
class="rmd-
|
|
312
|
+
class="rmd-sr-only"
|
|
313
313
|
>
|
|
314
314
|
Upload
|
|
315
315
|
</span>
|
|
@@ -333,7 +333,7 @@ exports[`FileInput should support all the button themes 8`] = `
|
|
|
333
333
|
file_upload
|
|
334
334
|
</span>
|
|
335
335
|
<span
|
|
336
|
-
class="rmd-
|
|
336
|
+
class="rmd-sr-only"
|
|
337
337
|
>
|
|
338
338
|
Upload
|
|
339
339
|
</span>
|
|
@@ -357,7 +357,7 @@ exports[`FileInput should support all the button themes 9`] = `
|
|
|
357
357
|
file_upload
|
|
358
358
|
</span>
|
|
359
359
|
<span
|
|
360
|
-
class="rmd-
|
|
360
|
+
class="rmd-sr-only"
|
|
361
361
|
>
|
|
362
362
|
Upload
|
|
363
363
|
</span>
|
|
@@ -381,7 +381,7 @@ exports[`FileInput should support all the button themes 10`] = `
|
|
|
381
381
|
file_upload
|
|
382
382
|
</span>
|
|
383
383
|
<span
|
|
384
|
-
class="rmd-
|
|
384
|
+
class="rmd-sr-only"
|
|
385
385
|
>
|
|
386
386
|
Upload
|
|
387
387
|
</span>
|
|
@@ -405,7 +405,7 @@ exports[`FileInput should support all the button themes 11`] = `
|
|
|
405
405
|
file_upload
|
|
406
406
|
</span>
|
|
407
407
|
<span
|
|
408
|
-
class="rmd-
|
|
408
|
+
class="rmd-sr-only"
|
|
409
409
|
>
|
|
410
410
|
Upload
|
|
411
411
|
</span>
|
|
@@ -429,7 +429,7 @@ exports[`FileInput should support all the button themes 12`] = `
|
|
|
429
429
|
file_upload
|
|
430
430
|
</span>
|
|
431
431
|
<span
|
|
432
|
-
class="rmd-
|
|
432
|
+
class="rmd-sr-only"
|
|
433
433
|
>
|
|
434
434
|
Upload
|
|
435
435
|
</span>
|
|
@@ -453,7 +453,7 @@ exports[`FileInput should support all the button themes 13`] = `
|
|
|
453
453
|
file_upload
|
|
454
454
|
</span>
|
|
455
455
|
<span
|
|
456
|
-
class="rmd-
|
|
456
|
+
class="rmd-sr-only"
|
|
457
457
|
>
|
|
458
458
|
Upload
|
|
459
459
|
</span>
|
|
@@ -477,7 +477,7 @@ exports[`FileInput should support all the button themes 14`] = `
|
|
|
477
477
|
file_upload
|
|
478
478
|
</span>
|
|
479
479
|
<span
|
|
480
|
-
class="rmd-
|
|
480
|
+
class="rmd-sr-only"
|
|
481
481
|
>
|
|
482
482
|
Upload
|
|
483
483
|
</span>
|
|
@@ -501,7 +501,7 @@ exports[`FileInput should support all the button themes 15`] = `
|
|
|
501
501
|
file_upload
|
|
502
502
|
</span>
|
|
503
503
|
<span
|
|
504
|
-
class="rmd-
|
|
504
|
+
class="rmd-sr-only"
|
|
505
505
|
>
|
|
506
506
|
Upload
|
|
507
507
|
</span>
|
|
@@ -525,7 +525,7 @@ exports[`FileInput should support all the button themes 16`] = `
|
|
|
525
525
|
file_upload
|
|
526
526
|
</span>
|
|
527
527
|
<span
|
|
528
|
-
class="rmd-
|
|
528
|
+
class="rmd-sr-only"
|
|
529
529
|
>
|
|
530
530
|
Upload
|
|
531
531
|
</span>
|
|
@@ -549,7 +549,7 @@ exports[`FileInput should support all the button themes 17`] = `
|
|
|
549
549
|
file_upload
|
|
550
550
|
</span>
|
|
551
551
|
<span
|
|
552
|
-
class="rmd-
|
|
552
|
+
class="rmd-sr-only"
|
|
553
553
|
>
|
|
554
554
|
Upload
|
|
555
555
|
</span>
|
|
@@ -573,7 +573,7 @@ exports[`FileInput should support all the button themes 18`] = `
|
|
|
573
573
|
file_upload
|
|
574
574
|
</span>
|
|
575
575
|
<span
|
|
576
|
-
class="rmd-
|
|
576
|
+
class="rmd-sr-only"
|
|
577
577
|
>
|
|
578
578
|
Upload
|
|
579
579
|
</span>
|
|
@@ -598,7 +598,7 @@ exports[`FileInput should update the default SrOnly text to be phoneOnly when th
|
|
|
598
598
|
file_upload
|
|
599
599
|
</span>
|
|
600
600
|
<span
|
|
601
|
-
class="rmd-
|
|
601
|
+
class="rmd-phone-sr-only"
|
|
602
602
|
>
|
|
603
603
|
Upload
|
|
604
604
|
</span>
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`MenuItemCheckbox should allow for a custom unchecked and checked icon 1`] = `
|
|
4
|
+
<li
|
|
5
|
+
aria-checked="false"
|
|
6
|
+
class="rmd-list-item rmd-list-item--medium rmd-interaction-surface rmd-checkbox-menu-item rmd-menu-item-input-toggle"
|
|
7
|
+
id="menu-item-:r1:"
|
|
8
|
+
role="menuitemcheckbox"
|
|
9
|
+
tabindex="-1"
|
|
10
|
+
>
|
|
11
|
+
<span
|
|
12
|
+
class="rmd-list-item__text"
|
|
13
|
+
>
|
|
14
|
+
Checkbox
|
|
15
|
+
</span>
|
|
16
|
+
<span
|
|
17
|
+
class="rmd-checkbox rmd-input-toggle rmd-icon--after rmd-list-item__addon rmd-menu-item-input-toggle__icon"
|
|
18
|
+
/>
|
|
19
|
+
</li>
|
|
20
|
+
`;
|
|
21
|
+
|
|
22
|
+
exports[`MenuItemCheckbox should allow for a custom unchecked and checked icon 2`] = `
|
|
23
|
+
<li
|
|
24
|
+
aria-checked="true"
|
|
25
|
+
class="rmd-list-item rmd-list-item--medium rmd-interaction-surface rmd-checkbox-menu-item rmd-menu-item-input-toggle"
|
|
26
|
+
id="menu-item-:r1:"
|
|
27
|
+
role="menuitemcheckbox"
|
|
28
|
+
tabindex="-1"
|
|
29
|
+
>
|
|
30
|
+
<span
|
|
31
|
+
class="rmd-list-item__text"
|
|
32
|
+
>
|
|
33
|
+
Checkbox
|
|
34
|
+
</span>
|
|
35
|
+
<span
|
|
36
|
+
class="rmd-checkbox rmd-input-toggle rmd-input-toggle--active rmd-icon--after rmd-list-item__addon rmd-menu-item-input-toggle__icon"
|
|
37
|
+
>
|
|
38
|
+
<span
|
|
39
|
+
data-testid="checked"
|
|
40
|
+
/>
|
|
41
|
+
</span>
|
|
42
|
+
</li>
|
|
43
|
+
`;
|
|
44
|
+
|
|
45
|
+
exports[`MenuItemCheckbox should apply the correct styling, HTMLAttributes, and allow a ref 1`] = `
|
|
46
|
+
<li
|
|
47
|
+
aria-checked="false"
|
|
48
|
+
class="rmd-list-item rmd-list-item--medium rmd-interaction-surface rmd-checkbox-menu-item rmd-menu-item-input-toggle"
|
|
49
|
+
id="menu-item-:r0:"
|
|
50
|
+
role="menuitemcheckbox"
|
|
51
|
+
tabindex="-1"
|
|
52
|
+
>
|
|
53
|
+
<span
|
|
54
|
+
class="rmd-checkbox rmd-input-toggle rmd-icon--before rmd-list-item__addon rmd-list-item__addon--before rmd-menu-item-input-toggle__icon"
|
|
55
|
+
>
|
|
56
|
+
<span
|
|
57
|
+
aria-hidden="true"
|
|
58
|
+
class="rmd-icon rmd-icon--font material-icons"
|
|
59
|
+
>
|
|
60
|
+
check_box_outline_blank
|
|
61
|
+
</span>
|
|
62
|
+
</span>
|
|
63
|
+
<span
|
|
64
|
+
class="rmd-list-item__text"
|
|
65
|
+
>
|
|
66
|
+
Checkbox
|
|
67
|
+
</span>
|
|
68
|
+
</li>
|
|
69
|
+
`;
|
|
70
|
+
|
|
71
|
+
exports[`MenuItemCheckbox should apply the correct styling, HTMLAttributes, and allow a ref 2`] = `
|
|
72
|
+
<li
|
|
73
|
+
aria-checked="false"
|
|
74
|
+
class="rmd-list-item rmd-list-item--medium rmd-interaction-surface rmd-checkbox-menu-item rmd-menu-item-input-toggle custom-class-name"
|
|
75
|
+
id="menu-item-:r0:"
|
|
76
|
+
role="menuitemcheckbox"
|
|
77
|
+
style="color: white;"
|
|
78
|
+
tabindex="-1"
|
|
79
|
+
>
|
|
80
|
+
<span
|
|
81
|
+
class="rmd-checkbox rmd-input-toggle rmd-icon--before rmd-list-item__addon rmd-list-item__addon--before rmd-menu-item-input-toggle__icon"
|
|
82
|
+
>
|
|
83
|
+
<span
|
|
84
|
+
aria-hidden="true"
|
|
85
|
+
class="rmd-icon rmd-icon--font material-icons"
|
|
86
|
+
>
|
|
87
|
+
check_box_outline_blank
|
|
88
|
+
</span>
|
|
89
|
+
</span>
|
|
90
|
+
<span
|
|
91
|
+
class="rmd-list-item__text"
|
|
92
|
+
>
|
|
93
|
+
Checkbox
|
|
94
|
+
</span>
|
|
95
|
+
</li>
|
|
96
|
+
`;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`MenuItemRadio should allow for a custom unchecked and checked icon 1`] = `
|
|
4
|
+
<li
|
|
5
|
+
aria-checked="false"
|
|
6
|
+
class="rmd-list-item rmd-list-item--medium rmd-interaction-surface rmd-radio-menu-item rmd-menu-item-input-toggle"
|
|
7
|
+
id="menu-item-:r1:"
|
|
8
|
+
role="menuitemradio"
|
|
9
|
+
tabindex="-1"
|
|
10
|
+
>
|
|
11
|
+
<span
|
|
12
|
+
class="rmd-list-item__text"
|
|
13
|
+
>
|
|
14
|
+
Radio
|
|
15
|
+
</span>
|
|
16
|
+
<span
|
|
17
|
+
class="rmd-radio rmd-input-toggle rmd-icon--after rmd-list-item__addon rmd-menu-item-input-toggle__icon"
|
|
18
|
+
/>
|
|
19
|
+
</li>
|
|
20
|
+
`;
|
|
21
|
+
|
|
22
|
+
exports[`MenuItemRadio should allow for a custom unchecked and checked icon 2`] = `
|
|
23
|
+
<li
|
|
24
|
+
aria-checked="true"
|
|
25
|
+
class="rmd-list-item rmd-list-item--medium rmd-interaction-surface rmd-radio-menu-item rmd-menu-item-input-toggle"
|
|
26
|
+
id="menu-item-:r1:"
|
|
27
|
+
role="menuitemradio"
|
|
28
|
+
tabindex="-1"
|
|
29
|
+
>
|
|
30
|
+
<span
|
|
31
|
+
class="rmd-list-item__text"
|
|
32
|
+
>
|
|
33
|
+
Radio
|
|
34
|
+
</span>
|
|
35
|
+
<span
|
|
36
|
+
class="rmd-radio rmd-input-toggle rmd-input-toggle--active rmd-icon--after rmd-list-item__addon rmd-menu-item-input-toggle__icon"
|
|
37
|
+
>
|
|
38
|
+
<span
|
|
39
|
+
data-testid="checked"
|
|
40
|
+
/>
|
|
41
|
+
</span>
|
|
42
|
+
</li>
|
|
43
|
+
`;
|
|
44
|
+
|
|
45
|
+
exports[`MenuItemRadio should apply the correct styling, HTMLAttributes, and allow a ref 1`] = `
|
|
46
|
+
<li
|
|
47
|
+
aria-checked="false"
|
|
48
|
+
class="rmd-list-item rmd-list-item--medium rmd-interaction-surface rmd-radio-menu-item rmd-menu-item-input-toggle"
|
|
49
|
+
id="menu-item-:r0:"
|
|
50
|
+
role="menuitemradio"
|
|
51
|
+
tabindex="-1"
|
|
52
|
+
>
|
|
53
|
+
<span
|
|
54
|
+
class="rmd-radio rmd-input-toggle rmd-icon--before rmd-list-item__addon rmd-list-item__addon--before rmd-menu-item-input-toggle__icon"
|
|
55
|
+
>
|
|
56
|
+
<span
|
|
57
|
+
aria-hidden="true"
|
|
58
|
+
class="rmd-icon rmd-icon--font material-icons"
|
|
59
|
+
>
|
|
60
|
+
radio_button_unchecked
|
|
61
|
+
</span>
|
|
62
|
+
</span>
|
|
63
|
+
<span
|
|
64
|
+
class="rmd-list-item__text"
|
|
65
|
+
>
|
|
66
|
+
Radio
|
|
67
|
+
</span>
|
|
68
|
+
</li>
|
|
69
|
+
`;
|
|
70
|
+
|
|
71
|
+
exports[`MenuItemRadio should apply the correct styling, HTMLAttributes, and allow a ref 2`] = `
|
|
72
|
+
<li
|
|
73
|
+
aria-checked="false"
|
|
74
|
+
class="rmd-list-item rmd-list-item--medium rmd-interaction-surface rmd-radio-menu-item rmd-menu-item-input-toggle custom-class-name"
|
|
75
|
+
id="menu-item-:r0:"
|
|
76
|
+
role="menuitemradio"
|
|
77
|
+
style="color: white;"
|
|
78
|
+
tabindex="-1"
|
|
79
|
+
>
|
|
80
|
+
<span
|
|
81
|
+
class="rmd-radio rmd-input-toggle rmd-icon--before rmd-list-item__addon rmd-list-item__addon--before rmd-menu-item-input-toggle__icon"
|
|
82
|
+
>
|
|
83
|
+
<span
|
|
84
|
+
aria-hidden="true"
|
|
85
|
+
class="rmd-icon rmd-icon--font material-icons"
|
|
86
|
+
>
|
|
87
|
+
radio_button_unchecked
|
|
88
|
+
</span>
|
|
89
|
+
</span>
|
|
90
|
+
<span
|
|
91
|
+
class="rmd-list-item__text"
|
|
92
|
+
>
|
|
93
|
+
Radio
|
|
94
|
+
</span>
|
|
95
|
+
</li>
|
|
96
|
+
`;
|