@stackshift-ui/radio 7.0.0-beta.1 → 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.
@@ -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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stackshift-ui/radio",
3
3
  "description": "",
4
- "version": "7.0.0-beta.1",
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.0",
38
- "@stackshift-ui/system": "6.1.0-beta.1"
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.1"
45
+ "@stackshift-ui/system": ">=6.1.0-beta.3"
46
46
  },
47
47
  "peerDependenciesMeta": {
48
48
  "next": {