@megha-ui/react 1.2.475 → 1.2.476

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,14 @@
1
+ import React from "react";
2
+ type RadioInputProps = {
3
+ handleChange: (value: string) => void;
4
+ name?: string;
5
+ options: {
6
+ label: string;
7
+ value: string;
8
+ }[];
9
+ position?: "left" | "right";
10
+ selectedValue: string;
11
+ wrapperClass?: string;
12
+ };
13
+ declare const EpicRadioInput: React.FC<RadioInputProps>;
14
+ export default EpicRadioInput;
@@ -0,0 +1,18 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ const EpicRadioInput = ({ handleChange, name, options, position = "right", selectedValue, wrapperClass, }) => {
3
+ return (_jsx("div", { className: wrapperClass, children: options.map((option) => (_jsx("div", { children: _jsxs("label", { style: {
4
+ alignItems: "center",
5
+ display: "flex",
6
+ }, children: [_jsx("input", { checked: selectedValue === option.value, name: name, onChange: (event) => handleChange(event.target.value), type: "radio", value: option.value }), position === "left" && (_jsx("span", { style: {
7
+ alignItems: "center",
8
+ display: "flex",
9
+ justifyContent: "center",
10
+ marginRight: "0.5rem",
11
+ } })), option.label, position === "right" && (_jsx("span", { style: {
12
+ alignItems: "center",
13
+ display: "flex",
14
+ justifyContent: "center",
15
+ marginLeft: "0.5rem",
16
+ } }))] }, option.value) }, option.value))) }));
17
+ };
18
+ export default EpicRadioInput;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megha-ui/react",
3
- "version": "1.2.475",
3
+ "version": "1.2.476",
4
4
  "description": "A collection of reusable UI components for React applications, built with TypeScript.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",