@aristobyte-ui/radio 2.3.6 → 2.4.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/es/src/main/components/Radio/index.js +14 -0
- package/es/src/main/components/RadioGroup/index.js +48 -0
- package/es/src/main/components/index.js +2 -0
- package/es/src/main/index.js +1 -0
- package/lib/src/main/components/Radio/index.js +51 -0
- package/lib/src/main/components/RadioGroup/index.js +85 -0
- package/lib/src/main/components/index.js +18 -0
- package/lib/src/main/index.js +17 -0
- package/package.json +1 -1
- package/README.md +0 -98
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import './Radio.scss';
|
|
3
|
+
export var Radio = function (_a) {
|
|
4
|
+
var children = _a.children, value = _a.value, checked = _a.checked, name = _a.name, _b = _a.disabled, disabled = _b === void 0 ? false : _b, _c = _a.highlightLabel, highlightLabel = _c === void 0 ? false : _c, _d = _a.size, size = _d === void 0 ? 'md' : _d, _e = _a.variant, variant = _e === void 0 ? 'default' : _e, _f = _a.appearance, appearance = _f === void 0 ? 'default' : _f, _g = _a.alignLabel, alignLabel = _g === void 0 ? 'right' : _g, onChange = _a.onChange, _h = _a.className, className = _h === void 0 ? '' : _h, _j = _a.style, style = _j === void 0 ? {} : _j;
|
|
5
|
+
var handleChange = function () {
|
|
6
|
+
if (!disabled && onChange) {
|
|
7
|
+
onChange(value);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
return (React.createElement("label", { className: "radio ".concat("radio-align-label--".concat(alignLabel), " ").concat("radio-appearance--".concat(appearance), " ").concat("radio-variant--".concat(variant), " ").concat("radio-size--".concat(size), " ").concat(disabled ? 'radio--disabled' : '', " ").concat(className), style: style },
|
|
11
|
+
React.createElement("input", { type: "radio", name: name, value: value, checked: checked, disabled: disabled, onChange: handleChange, className: "radio__input" }),
|
|
12
|
+
React.createElement("span", { className: "radio__control" }),
|
|
13
|
+
children && (React.createElement("span", { className: "radio__label ".concat(highlightLabel ? 'radio__label--highlight-label' : '') }, children))));
|
|
14
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
14
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
15
|
+
if (!m) return o;
|
|
16
|
+
var i = m.call(o), r, ar = [], e;
|
|
17
|
+
try {
|
|
18
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
19
|
+
}
|
|
20
|
+
catch (error) { e = { error: error }; }
|
|
21
|
+
finally {
|
|
22
|
+
try {
|
|
23
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
24
|
+
}
|
|
25
|
+
finally { if (e) throw e.error; }
|
|
26
|
+
}
|
|
27
|
+
return ar;
|
|
28
|
+
};
|
|
29
|
+
import * as React from 'react';
|
|
30
|
+
import { Radio } from '../Radio';
|
|
31
|
+
import './RadioGroup.scss';
|
|
32
|
+
export var RadioGroup = function (_a) {
|
|
33
|
+
var name = _a.name, value = _a.value, onChange = _a.onChange, children = _a.children, _b = _a.disabled, disabled = _b === void 0 ? false : _b, _c = _a.highlightLabel, highlightLabel = _c === void 0 ? false : _c, _d = _a.size, size = _d === void 0 ? 'md' : _d, _e = _a.variant, variant = _e === void 0 ? 'default' : _e, _f = _a.appearance, appearance = _f === void 0 ? 'outline' : _f, _g = _a.align, align = _g === void 0 ? 'horizontal' : _g, _h = _a.alignLabel, alignLabel = _h === void 0 ? 'right' : _h, _j = _a.className, className = _j === void 0 ? '' : _j, _k = _a.style, style = _k === void 0 ? {} : _k;
|
|
34
|
+
var uniqueId = React.useId();
|
|
35
|
+
var _l = __read(React.useState(value), 2), currentValue = _l[0], setCurrentValue = _l[1];
|
|
36
|
+
var radios = React.Children.toArray(children).filter(function (child) { return React.isValidElement(child) && child.type === Radio; });
|
|
37
|
+
var handleChange = function (currentRadioValue) {
|
|
38
|
+
if (onChange) {
|
|
39
|
+
onChange(currentRadioValue);
|
|
40
|
+
}
|
|
41
|
+
setCurrentValue(currentRadioValue);
|
|
42
|
+
};
|
|
43
|
+
return (React.createElement("div", { key: uniqueId, className: "radio-group ".concat("radio-group--".concat(align), " ").concat(className), style: style }, radios.map(function (_a) {
|
|
44
|
+
var _b, _c, _d, _e, _f, _g;
|
|
45
|
+
var props = _a.props;
|
|
46
|
+
return (React.createElement(Radio, __assign({}, props, { key: "".concat(name, "-").concat(props.value, "-").concat(uniqueId), name: "".concat(name, "-").concat(props.value, "-").concat(uniqueId), checked: props.value === currentValue, onChange: function () { return handleChange(props.value); }, disabled: (_b = props.disabled) !== null && _b !== void 0 ? _b : disabled, size: (_c = props.size) !== null && _c !== void 0 ? _c : size, variant: (_d = props.variant) !== null && _d !== void 0 ? _d : variant, appearance: (_e = props.appearance) !== null && _e !== void 0 ? _e : appearance, highlightLabel: (_f = props.highlightLabel) !== null && _f !== void 0 ? _f : highlightLabel, alignLabel: (_g = props.alignLabel) !== null && _g !== void 0 ? _g : alignLabel })));
|
|
47
|
+
})));
|
|
48
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components';
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.Radio = void 0;
|
|
37
|
+
var React = __importStar(require("react"));
|
|
38
|
+
require("./Radio.scss");
|
|
39
|
+
var Radio = function (_a) {
|
|
40
|
+
var children = _a.children, value = _a.value, checked = _a.checked, name = _a.name, _b = _a.disabled, disabled = _b === void 0 ? false : _b, _c = _a.highlightLabel, highlightLabel = _c === void 0 ? false : _c, _d = _a.size, size = _d === void 0 ? 'md' : _d, _e = _a.variant, variant = _e === void 0 ? 'default' : _e, _f = _a.appearance, appearance = _f === void 0 ? 'default' : _f, _g = _a.alignLabel, alignLabel = _g === void 0 ? 'right' : _g, onChange = _a.onChange, _h = _a.className, className = _h === void 0 ? '' : _h, _j = _a.style, style = _j === void 0 ? {} : _j;
|
|
41
|
+
var handleChange = function () {
|
|
42
|
+
if (!disabled && onChange) {
|
|
43
|
+
onChange(value);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
return (React.createElement("label", { className: "radio ".concat("radio-align-label--".concat(alignLabel), " ").concat("radio-appearance--".concat(appearance), " ").concat("radio-variant--".concat(variant), " ").concat("radio-size--".concat(size), " ").concat(disabled ? 'radio--disabled' : '', " ").concat(className), style: style },
|
|
47
|
+
React.createElement("input", { type: "radio", name: name, value: value, checked: checked, disabled: disabled, onChange: handleChange, className: "radio__input" }),
|
|
48
|
+
React.createElement("span", { className: "radio__control" }),
|
|
49
|
+
children && (React.createElement("span", { className: "radio__label ".concat(highlightLabel ? 'radio__label--highlight-label' : '') }, children))));
|
|
50
|
+
};
|
|
51
|
+
exports.Radio = Radio;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
var __assign = (this && this.__assign) || function () {
|
|
4
|
+
__assign = Object.assign || function(t) {
|
|
5
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
6
|
+
s = arguments[i];
|
|
7
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
8
|
+
t[p] = s[p];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
return __assign.apply(this, arguments);
|
|
13
|
+
};
|
|
14
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
15
|
+
if (k2 === undefined) k2 = k;
|
|
16
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
17
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
18
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
19
|
+
}
|
|
20
|
+
Object.defineProperty(o, k2, desc);
|
|
21
|
+
}) : (function(o, m, k, k2) {
|
|
22
|
+
if (k2 === undefined) k2 = k;
|
|
23
|
+
o[k2] = m[k];
|
|
24
|
+
}));
|
|
25
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
26
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
27
|
+
}) : function(o, v) {
|
|
28
|
+
o["default"] = v;
|
|
29
|
+
});
|
|
30
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
31
|
+
var ownKeys = function(o) {
|
|
32
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
33
|
+
var ar = [];
|
|
34
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
35
|
+
return ar;
|
|
36
|
+
};
|
|
37
|
+
return ownKeys(o);
|
|
38
|
+
};
|
|
39
|
+
return function (mod) {
|
|
40
|
+
if (mod && mod.__esModule) return mod;
|
|
41
|
+
var result = {};
|
|
42
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
43
|
+
__setModuleDefault(result, mod);
|
|
44
|
+
return result;
|
|
45
|
+
};
|
|
46
|
+
})();
|
|
47
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
48
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
49
|
+
if (!m) return o;
|
|
50
|
+
var i = m.call(o), r, ar = [], e;
|
|
51
|
+
try {
|
|
52
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
53
|
+
}
|
|
54
|
+
catch (error) { e = { error: error }; }
|
|
55
|
+
finally {
|
|
56
|
+
try {
|
|
57
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
58
|
+
}
|
|
59
|
+
finally { if (e) throw e.error; }
|
|
60
|
+
}
|
|
61
|
+
return ar;
|
|
62
|
+
};
|
|
63
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
64
|
+
exports.RadioGroup = void 0;
|
|
65
|
+
var React = __importStar(require("react"));
|
|
66
|
+
var Radio_1 = require("../Radio");
|
|
67
|
+
require("./RadioGroup.scss");
|
|
68
|
+
var RadioGroup = function (_a) {
|
|
69
|
+
var name = _a.name, value = _a.value, onChange = _a.onChange, children = _a.children, _b = _a.disabled, disabled = _b === void 0 ? false : _b, _c = _a.highlightLabel, highlightLabel = _c === void 0 ? false : _c, _d = _a.size, size = _d === void 0 ? 'md' : _d, _e = _a.variant, variant = _e === void 0 ? 'default' : _e, _f = _a.appearance, appearance = _f === void 0 ? 'outline' : _f, _g = _a.align, align = _g === void 0 ? 'horizontal' : _g, _h = _a.alignLabel, alignLabel = _h === void 0 ? 'right' : _h, _j = _a.className, className = _j === void 0 ? '' : _j, _k = _a.style, style = _k === void 0 ? {} : _k;
|
|
70
|
+
var uniqueId = React.useId();
|
|
71
|
+
var _l = __read(React.useState(value), 2), currentValue = _l[0], setCurrentValue = _l[1];
|
|
72
|
+
var radios = React.Children.toArray(children).filter(function (child) { return React.isValidElement(child) && child.type === Radio_1.Radio; });
|
|
73
|
+
var handleChange = function (currentRadioValue) {
|
|
74
|
+
if (onChange) {
|
|
75
|
+
onChange(currentRadioValue);
|
|
76
|
+
}
|
|
77
|
+
setCurrentValue(currentRadioValue);
|
|
78
|
+
};
|
|
79
|
+
return (React.createElement("div", { key: uniqueId, className: "radio-group ".concat("radio-group--".concat(align), " ").concat(className), style: style }, radios.map(function (_a) {
|
|
80
|
+
var _b, _c, _d, _e, _f, _g;
|
|
81
|
+
var props = _a.props;
|
|
82
|
+
return (React.createElement(Radio_1.Radio, __assign({}, props, { key: "".concat(name, "-").concat(props.value, "-").concat(uniqueId), name: "".concat(name, "-").concat(props.value, "-").concat(uniqueId), checked: props.value === currentValue, onChange: function () { return handleChange(props.value); }, disabled: (_b = props.disabled) !== null && _b !== void 0 ? _b : disabled, size: (_c = props.size) !== null && _c !== void 0 ? _c : size, variant: (_d = props.variant) !== null && _d !== void 0 ? _d : variant, appearance: (_e = props.appearance) !== null && _e !== void 0 ? _e : appearance, highlightLabel: (_f = props.highlightLabel) !== null && _f !== void 0 ? _f : highlightLabel, alignLabel: (_g = props.alignLabel) !== null && _g !== void 0 ? _g : alignLabel })));
|
|
83
|
+
})));
|
|
84
|
+
};
|
|
85
|
+
exports.RadioGroup = RadioGroup;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./Radio"), exports);
|
|
18
|
+
__exportStar(require("./RadioGroup"), exports);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./components"), exports);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aristobyte-ui/radio",
|
|
3
3
|
"description": "Composable and fully-typed Radio and RadioGroup components for AristoByteUI. Supports multiple variants, sizes, appearances, alignments, and optional label highlights, optimized for performance and developer experience.",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.4.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"private": false,
|
|
7
7
|
"author": "AristoByte <info@aristobyte.com>",
|
package/README.md
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
# @aristobyte-ui/radio
|
|
2
|
-
|
|
3
|
-
<p align="center">
|
|
4
|
-
<img src="https://img.shields.io/badge/TypeScript-5.8-blue?style=for-the-badge&logo=typescript&logoColor=white" alt="TypeScript" />
|
|
5
|
-
<img src="https://img.shields.io/badge/Build-Turbo-green?style=for-the-badge&logo=turbo&logoColor=white" alt="TurboRepo" />
|
|
6
|
-
<img src="https://img.shields.io/badge/Lint-Strict-red?style=for-the-badge&logo=eslint&logoColor=white" alt="ESLint" />
|
|
7
|
-
<img src="https://img.shields.io/badge/License-MIT-black?style=for-the-badge&logo=open-source-initiative&logoColor=white" alt="License" />
|
|
8
|
-
<img src="https://img.shields.io/badge/AristoByte-UI-purple?style=for-the-badge&logo=react&logoColor=white" alt="AristoByte UI" />
|
|
9
|
-
<img src="https://img.shields.io/badge/Node-20.17.0+-339933?style=for-the-badge&logo=node.js&logoColor=white" alt="Node.js >=20.17.0" />
|
|
10
|
-
<img src="https://img.shields.io/badge/Yarn-1.22+-2C8EBB?style=for-the-badge&logo=yarn&logoColor=white" alt="Yarn >=1.22" />
|
|
11
|
-
<img src="https://img.shields.io/badge/NPM-10.8+-CB3837?style=for-the-badge&logo=npm&logoColor=white" alt="NPM >=10.8" />
|
|
12
|
-
</p>
|
|
13
|
-
|
|
14
|
-
Fully-typed, composable Radio and RadioGroup components for AristoByteUI, supporting multiple variants, sizes, appearances, alignments, and optional label highlights.
|
|
15
|
-
|
|
16
|
-
## 📦 Installation
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
# Install via Yarn
|
|
20
|
-
yarn add -D @aristobyte-ui/radio
|
|
21
|
-
|
|
22
|
-
# Or via npm
|
|
23
|
-
npm install -D @aristobyte-ui/radio
|
|
24
|
-
|
|
25
|
-
# Or via pnpm
|
|
26
|
-
pnpm add -D @aristobyte-ui/radio
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
## 🛠 Usage
|
|
30
|
-
|
|
31
|
-
```tsx
|
|
32
|
-
import { Radio, RadioGroup } from "@aristobyte-ui/radio";
|
|
33
|
-
|
|
34
|
-
<RadioGroup
|
|
35
|
-
name="options"
|
|
36
|
-
value="option1"
|
|
37
|
-
onChange={(val) => console.log(val)}
|
|
38
|
-
variant="primary"
|
|
39
|
-
size="md"
|
|
40
|
-
align="horizontal"
|
|
41
|
-
alignLabel="right"
|
|
42
|
-
>
|
|
43
|
-
<Radio value="option1">Option 1</Radio>
|
|
44
|
-
<Radio value="option2">Option 2</Radio>
|
|
45
|
-
</RadioGroup>;
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
##📂 Presets Available
|
|
49
|
-
|
|
50
|
-
- **variant**: `default` | `primary` | `secondary` | `success` | `error` | `warning`
|
|
51
|
-
- **appearance**: `default` | `solid` | `outline` | `outline-dashed` | `no-outline` | `glowing`
|
|
52
|
-
- **size**: `xsm` | `sm` | `md` | `lg` | `xlg`
|
|
53
|
-
- **align**: `horizontal` | `vertical`
|
|
54
|
-
- **alignLabel**: `top` | `right` | `bottom` | `left`
|
|
55
|
-
- **highlightLabel**: `boolean`
|
|
56
|
-
|
|
57
|
-
## 🔧 Example in a Package
|
|
58
|
-
|
|
59
|
-
```tsx
|
|
60
|
-
<Radio
|
|
61
|
-
value="radio1"
|
|
62
|
-
size="lg"
|
|
63
|
-
variant="success"
|
|
64
|
-
appearance="glowing"
|
|
65
|
-
alignLabel="top"
|
|
66
|
-
>
|
|
67
|
-
Radio Option
|
|
68
|
-
</Radio>
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
## 📊 Why This Matters
|
|
72
|
-
|
|
73
|
-
- **Performance-first:** Lightweight CSS ensures fast rendering and smooth transitions.
|
|
74
|
-
- **Fully typed:** TypeScript-first API ensures predictable usage and IDE autocomplete.
|
|
75
|
-
- **AristoByteUI ready:** Seamlessly integrates with design tokens and SCSS modules.
|
|
76
|
-
- **Flexible:** Supports multiple variants, sizes, appearances, alignments, and optional label highlights.
|
|
77
|
-
|
|
78
|
-
## 🏆 Philosophy
|
|
79
|
-
|
|
80
|
-
- **Modular architecture:** Radio and RadioGroup components are fully composable.
|
|
81
|
-
- **Declarative styling:** SCSS modules keep styles maintainable and scoped.
|
|
82
|
-
- **Strict typing & runtime flexibility:** Props fully typed while allowing runtime overrides.
|
|
83
|
-
- **Developer experience optimized:** Easy to use with predictable behavior and minimal boilerplate.
|
|
84
|
-
|
|
85
|
-
## 📜 License
|
|
86
|
-
|
|
87
|
-
[MIT](./LICENSE) © AristoByte
|
|
88
|
-
|
|
89
|
-
## 🛡 Shields Showcase
|
|
90
|
-
|
|
91
|
-
<p align="center">
|
|
92
|
-
<img src="https://img.shields.io/badge/Consistency-100%25-green?style=for-the-badge&logo=typescript" />
|
|
93
|
-
<img src="https://img.shields.io/badge/Maintained-Active-brightgreen?style=for-the-badge&logo=github" />
|
|
94
|
-
<img src="https://img.shields.io/badge/Strictness-High-critical?style=for-the-badge&logo=eslint" />
|
|
95
|
-
<img src="https://img.shields.io/badge/Declarations-Enabled-blue?style=for-the-badge&logo=typescript" />
|
|
96
|
-
<img src="https://img.shields.io/badge/Monorepo-Turbo-green?style=for-the-badge&logo=monorepo" />
|
|
97
|
-
<img src="https://img.shields.io/badge/Interop-ESM%2FCJS-orange?style=for-the-badge&logo=javascript" />
|
|
98
|
-
</p>
|