@stackshift-ui/radio 6.0.11 → 7.0.0-beta.1
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/dist/chunk-2YHUN46K.mjs +1 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/radio.js +1 -1
- package/dist/radio.mjs +1 -1
- package/package.json +4 -4
- package/src/radio.test.tsx +5 -2
- package/src/radio.tsx +2 -3
- package/dist/chunk-NCDQBK44.mjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{DefaultComponent as C,useStackShiftUIComponents as R}from"@stackshift-ui/system";import o from"classnames";import{jsx as N,jsxs as T}from"react/jsx-runtime";var s="Radio",f=({name:t,ariaLabel:i,variant:l="primary",item:a,labelClass:m,onChange:p,children:h,className:c,as:y="label",...e})=>{var r;let{[s]:d=C}=R(),n="",g=(r={primary:n}[l])!=null?r:n;return T(d,{htmlFor:a,as:y,className:o("flex items-center gap-2",m),...e,children:[N("input",{onChange:p,className:o(g,c),name:t,value:a,type:"radio","aria-label":i||t,id:a,...e}),a]})};f.displayName=s;export{f as a};
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";var h=Object.create;var o=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var S=Object.getPrototypeOf,x=Object.prototype.hasOwnProperty;var V=(a,t)=>{for(var e in t)o(a,e,{get:t[e],enumerable:!0})},y=(a,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of v(t))!x.call(a,r)&&r!==e&&o(a,r,{get:()=>t[r],enumerable:!(n=u(t,r))||n.enumerable});return a};var b=(a,t,e)=>(e=a!=null?h(S(a)):{},y(t||!a||!a.__esModule?o(e,"default",{value:a,enumerable:!0}):e,a)),L=a=>y(o({},"__esModule",{value:!0}),a);var P={};V(P,{Radio:()=>g});module.exports=L(P);var s=require("@stackshift-ui/system"),l=b(require("classnames")),i=require("react/jsx-runtime"),
|
|
2
|
+
"use strict";var h=Object.create;var o=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var S=Object.getPrototypeOf,x=Object.prototype.hasOwnProperty;var V=(a,t)=>{for(var e in t)o(a,e,{get:t[e],enumerable:!0})},y=(a,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of v(t))!x.call(a,r)&&r!==e&&o(a,r,{get:()=>t[r],enumerable:!(n=u(t,r))||n.enumerable});return a};var b=(a,t,e)=>(e=a!=null?h(S(a)):{},y(t||!a||!a.__esModule?o(e,"default",{value:a,enumerable:!0}):e,a)),L=a=>y(o({},"__esModule",{value:!0}),a);var P={};V(P,{Radio:()=>g});module.exports=L(P);var s=require("@stackshift-ui/system"),l=b(require("classnames")),i=require("react/jsx-runtime"),d="Radio",g=({name:a,ariaLabel:t,variant:e="primary",item:n,labelClass:r,onChange:C,children:E,className:f,as:R="label",...m})=>{var c;let{[d]:N=s.DefaultComponent}=(0,s.useStackShiftUIComponents)(),p="",T=(c={primary:p}[e])!=null?c:p;return(0,i.jsxs)(N,{htmlFor:n,as:R,className:(0,l.default)("flex items-center gap-2",r),...m,children:[(0,i.jsx)("input",{onChange:C,className:(0,l.default)(T,f),name:a,value:n,type:"radio","aria-label":t||a,id:n,...m}),n]})};g.displayName=d;0&&(module.exports={Radio});
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";import{a as e}from"./chunk-
|
|
2
|
+
"use strict";import{a as e}from"./chunk-2YHUN46K.mjs";export{e as Radio};
|
package/dist/radio.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var h=Object.create;var o=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var u=Object.getPrototypeOf,V=Object.prototype.hasOwnProperty;var b=(a,t)=>{for(var e in t)o(a,e,{get:t[e],enumerable:!0})},y=(a,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of S(t))!V.call(a,r)&&r!==e&&o(a,r,{get:()=>t[r],enumerable:!(n=v(t,r))||n.enumerable});return a};var x=(a,t,e)=>(e=a!=null?h(u(a)):{},y(t||!a||!a.__esModule?o(e,"default",{value:a,enumerable:!0}):e,a)),L=a=>y(o({},"__esModule",{value:!0}),a);var P={};b(P,{Radio:()=>g});module.exports=L(P);var s=require("@stackshift-ui/system"),l=x(require("classnames")),i=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";var h=Object.create;var o=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var u=Object.getPrototypeOf,V=Object.prototype.hasOwnProperty;var b=(a,t)=>{for(var e in t)o(a,e,{get:t[e],enumerable:!0})},y=(a,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of S(t))!V.call(a,r)&&r!==e&&o(a,r,{get:()=>t[r],enumerable:!(n=v(t,r))||n.enumerable});return a};var x=(a,t,e)=>(e=a!=null?h(u(a)):{},y(t||!a||!a.__esModule?o(e,"default",{value:a,enumerable:!0}):e,a)),L=a=>y(o({},"__esModule",{value:!0}),a);var P={};b(P,{Radio:()=>g});module.exports=L(P);var s=require("@stackshift-ui/system"),l=x(require("classnames")),i=require("react/jsx-runtime"),d="Radio",g=({name:a,ariaLabel:t,variant:e="primary",item:n,labelClass:r,onChange:C,children:E,className:R,as:f="label",...m})=>{var c;let{[d]:N=s.DefaultComponent}=(0,s.useStackShiftUIComponents)(),p="",T=(c={primary:p}[e])!=null?c:p;return(0,i.jsxs)(N,{htmlFor:n,as:f,className:(0,l.default)("flex items-center gap-2",r),...m,children:[(0,i.jsx)("input",{onChange:C,className:(0,l.default)(T,R),name:a,value:n,type:"radio","aria-label":t||a,id:n,...m}),n]})};g.displayName=d;0&&(module.exports={Radio});
|
package/dist/radio.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-2YHUN46K.mjs";export{a as Radio};
|
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.1",
|
|
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.1"
|
|
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.1"
|
|
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)}
|
package/dist/chunk-NCDQBK44.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{DefaultComponent as C,useStackShiftUIComponents as R}from"@stackshift-ui/system";import s from"classnames";import{jsx as N,jsxs as T}from"react/jsx-runtime";var t="Radio",f=({name:e,ariaLabel:i,variant:l="primary",item:a,labelClass:m,onChange:p,children:h,className:c,as:d="label",...n})=>{var o;let{[t]:y=C}=R(),r="",g=(o={primary:r}[l])!=null?o:r;return T(y,{htmlFor:a,as:d,className:s("flex items-center gap-2",m),...n,"data-testid":t,children:[N("input",{onChange:p,className:s(g,c),name:e,value:a,type:"radio","aria-label":i||e,id:a,...n}),a]})};f.displayName=t;export{f as a};
|