@stackshift-ui/radio 6.0.11 → 7.0.0-beta.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.
- package/package.json +4 -4
- package/src/radio.test.tsx +5 -2
- package/src/radio.tsx +2 -3
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stackshift-ui/radio",
|
|
3
3
|
"description": "",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "7.0.0-beta.0",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -34,15 +34,15 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"classnames": "^2.5.1",
|
|
37
|
-
"@stackshift-ui/scripts": "6.0.
|
|
38
|
-
"@stackshift-ui/system": "6.0.
|
|
37
|
+
"@stackshift-ui/scripts": "6.1.0-beta.0",
|
|
38
|
+
"@stackshift-ui/system": "6.1.0-beta.0"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"@types/react": "16.8 - 19",
|
|
42
42
|
"next": "10 - 14",
|
|
43
43
|
"react": "16.8 - 19",
|
|
44
44
|
"react-dom": "16.8 - 19",
|
|
45
|
-
"@stackshift-ui/system": ">=6.0.
|
|
45
|
+
"@stackshift-ui/system": ">=6.1.0-beta.0"
|
|
46
46
|
},
|
|
47
47
|
"peerDependenciesMeta": {
|
|
48
48
|
"next": {
|
package/src/radio.test.tsx
CHANGED
|
@@ -7,14 +7,17 @@ describe.concurrent("radio", () => {
|
|
|
7
7
|
|
|
8
8
|
test("Common: Radio - test if renders without errors", ({ expect }) => {
|
|
9
9
|
const clx = "my-class";
|
|
10
|
-
render(
|
|
10
|
+
const { unmount } = render(
|
|
11
11
|
<Radio
|
|
12
12
|
className={clx}
|
|
13
13
|
name="stackshift-radio"
|
|
14
14
|
ariaLabel="stackshift radio input"
|
|
15
15
|
item="StackShift"
|
|
16
|
+
data-testid="radio-input"
|
|
16
17
|
/>,
|
|
17
18
|
);
|
|
18
|
-
|
|
19
|
+
|
|
20
|
+
expect(screen.getAllByTestId("radio-input").length).toBe(2); // label and input
|
|
21
|
+
unmount();
|
|
19
22
|
});
|
|
20
23
|
});
|
package/src/radio.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DefaultComponent, useStackShiftUIComponents } from "@stackshift-ui/system";
|
|
2
|
-
import type { ElementType, HTMLProps, ReactNode } from "react";
|
|
3
2
|
import cn from "classnames";
|
|
3
|
+
import type { ElementType, HTMLProps, ReactNode } from "react";
|
|
4
4
|
|
|
5
5
|
type StyleVariants<T extends string> = Record<T, string>;
|
|
6
6
|
type Variant = "primary";
|
|
@@ -47,8 +47,7 @@ export const Radio: React.FC<RadioProps> = ({
|
|
|
47
47
|
htmlFor={item}
|
|
48
48
|
as={as}
|
|
49
49
|
className={cn("flex items-center gap-2", labelClass)}
|
|
50
|
-
{...props}
|
|
51
|
-
data-testid={displayName}>
|
|
50
|
+
{...props}>
|
|
52
51
|
<input
|
|
53
52
|
onChange={onChange}
|
|
54
53
|
className={cn(variantClass, className)}
|