@stackshift-ui/radio 7.0.0-beta.0 → 7.0.0-beta.3
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/chunk-WMK7EHW7.mjs +56 -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/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};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// src/radio.tsx
|
|
2
|
+
import { DefaultComponent, useStackShiftUIComponents } from "@stackshift-ui/system";
|
|
3
|
+
import cn from "classnames";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
var displayName = "Radio";
|
|
6
|
+
var Radio = ({
|
|
7
|
+
name,
|
|
8
|
+
ariaLabel,
|
|
9
|
+
variant = "primary",
|
|
10
|
+
item,
|
|
11
|
+
labelClass,
|
|
12
|
+
onChange,
|
|
13
|
+
children,
|
|
14
|
+
className,
|
|
15
|
+
as = "label",
|
|
16
|
+
...props
|
|
17
|
+
}) => {
|
|
18
|
+
var _a;
|
|
19
|
+
const { [displayName]: Component = DefaultComponent } = useStackShiftUIComponents();
|
|
20
|
+
const commonStyle = "";
|
|
21
|
+
const primary = `${commonStyle}`;
|
|
22
|
+
const variants = {
|
|
23
|
+
primary
|
|
24
|
+
};
|
|
25
|
+
const variantClass = (_a = variants[variant]) != null ? _a : primary;
|
|
26
|
+
return /* @__PURE__ */ jsxs(
|
|
27
|
+
Component,
|
|
28
|
+
{
|
|
29
|
+
htmlFor: item,
|
|
30
|
+
as,
|
|
31
|
+
className: cn("flex items-center gap-2", labelClass),
|
|
32
|
+
...props,
|
|
33
|
+
children: [
|
|
34
|
+
/* @__PURE__ */ jsx(
|
|
35
|
+
"input",
|
|
36
|
+
{
|
|
37
|
+
onChange,
|
|
38
|
+
className: cn(variantClass, className),
|
|
39
|
+
name,
|
|
40
|
+
value: item,
|
|
41
|
+
type: "radio",
|
|
42
|
+
"aria-label": ariaLabel || name,
|
|
43
|
+
id: item,
|
|
44
|
+
...props
|
|
45
|
+
}
|
|
46
|
+
),
|
|
47
|
+
item
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
Radio.displayName = displayName;
|
|
53
|
+
|
|
54
|
+
export {
|
|
55
|
+
Radio
|
|
56
|
+
};
|
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": "7.0.0-beta.
|
|
4
|
+
"version": "7.0.0-beta.3",
|
|
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.1.0-beta.
|
|
38
|
-
"@stackshift-ui/system": "6.1.0-beta.
|
|
37
|
+
"@stackshift-ui/scripts": "6.1.0-beta.2",
|
|
38
|
+
"@stackshift-ui/system": "6.1.0-beta.3"
|
|
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.1.0-beta.
|
|
45
|
+
"@stackshift-ui/system": ">=6.1.0-beta.3"
|
|
46
46
|
},
|
|
47
47
|
"peerDependenciesMeta": {
|
|
48
48
|
"next": {
|
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};
|