@aristobyte-ui/radio 2.5.1 → 2.6.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.
Files changed (30) hide show
  1. package/README.md +98 -0
  2. package/package.json +5 -5
  3. package/es/src/main/components/Radio/Radio.scss +0 -773
  4. package/es/src/main/components/Radio/index.d.ts +0 -19
  5. package/es/src/main/components/Radio/index.d.ts.map +0 -1
  6. package/es/src/main/components/Radio/index.js +0 -14
  7. package/es/src/main/components/RadioGroup/RadioGroup.scss +0 -15
  8. package/es/src/main/components/RadioGroup/index.d.ts +0 -20
  9. package/es/src/main/components/RadioGroup/index.d.ts.map +0 -1
  10. package/es/src/main/components/RadioGroup/index.js +0 -48
  11. package/es/src/main/components/index.d.ts +0 -3
  12. package/es/src/main/components/index.d.ts.map +0 -1
  13. package/es/src/main/components/index.js +0 -2
  14. package/es/src/main/index.d.ts +0 -2
  15. package/es/src/main/index.d.ts.map +0 -1
  16. package/es/src/main/index.js +0 -1
  17. package/lib/src/main/components/Radio/Radio.scss +0 -773
  18. package/lib/src/main/components/Radio/index.d.ts +0 -19
  19. package/lib/src/main/components/Radio/index.d.ts.map +0 -1
  20. package/lib/src/main/components/Radio/index.js +0 -51
  21. package/lib/src/main/components/RadioGroup/RadioGroup.scss +0 -15
  22. package/lib/src/main/components/RadioGroup/index.d.ts +0 -20
  23. package/lib/src/main/components/RadioGroup/index.d.ts.map +0 -1
  24. package/lib/src/main/components/RadioGroup/index.js +0 -85
  25. package/lib/src/main/components/index.d.ts +0 -3
  26. package/lib/src/main/components/index.d.ts.map +0 -1
  27. package/lib/src/main/components/index.js +0 -18
  28. package/lib/src/main/index.d.ts +0 -2
  29. package/lib/src/main/index.d.ts.map +0 -1
  30. package/lib/src/main/index.js +0 -17
@@ -1,19 +0,0 @@
1
- import * as React from 'react';
2
- import './Radio.scss';
3
- export interface IRadio {
4
- children: React.ReactNode;
5
- value: string;
6
- checked?: boolean;
7
- onChange?: (value: string) => void;
8
- name?: string;
9
- disabled?: boolean;
10
- className?: string;
11
- highlightLabel?: boolean;
12
- size?: 'xsm' | 'sm' | 'md' | 'lg' | 'xlg';
13
- variant?: 'default' | 'primary' | 'secondary' | 'success' | 'error' | 'warning';
14
- appearance?: 'default' | 'solid' | 'outline' | 'outline-dashed' | 'no-outline' | 'glowing';
15
- alignLabel?: 'top' | 'right' | 'bottom' | 'left';
16
- style?: React.CSSProperties;
17
- }
18
- export declare const Radio: React.FC<IRadio>;
19
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../packages/radio/src/main/components/Radio/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,cAAc,CAAC;AAEtB,MAAM,WAAW,MAAM;IACrB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,IAAI,CAAC,EAAE,KAAK,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;IAC1C,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;IAChF,UAAU,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,gBAAgB,GAAG,YAAY,GAAG,SAAS,CAAC;IAC3F,UAAU,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IACjD,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,MAAM,CAyClC,CAAC"}
@@ -1,14 +0,0 @@
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
- };
@@ -1,15 +0,0 @@
1
- @use '@aristobyte-ui/utils/styles' as *;
2
-
3
- .radio-group {
4
- display: flex;
5
- gap: 20px;
6
- min-width: max-content;
7
-
8
- &--horizontal {
9
- flex-direction: row;
10
- }
11
-
12
- &--vertical {
13
- flex-direction: column;
14
- }
15
- }
@@ -1,20 +0,0 @@
1
- import * as React from 'react';
2
- import { type IRadio } from '../Radio';
3
- import './RadioGroup.scss';
4
- export interface IRadioGroup {
5
- name: string;
6
- value: string;
7
- children: React.ReactElement<IRadio> | React.ReactElement<IRadio>[];
8
- onChange?: (newValue: string) => void;
9
- disabled?: boolean;
10
- size?: 'xsm' | 'sm' | 'md' | 'lg' | 'xlg';
11
- variant?: 'default' | 'primary' | 'secondary' | 'success' | 'error' | 'warning';
12
- appearance?: 'solid' | 'outline' | 'outline-dashed' | 'no-outline' | 'glowing';
13
- align?: 'horizontal' | 'vertical';
14
- alignLabel?: 'top' | 'right' | 'bottom' | 'left';
15
- highlightLabel?: boolean;
16
- className?: string;
17
- style?: React.CSSProperties;
18
- }
19
- export declare const RadioGroup: React.FC<IRadioGroup>;
20
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../packages/radio/src/main/components/RadioGroup/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAS,KAAK,MAAM,EAAE,MAAM,UAAU,CAAC;AAE9C,OAAO,mBAAmB,CAAC;AAE3B,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC;IACpE,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,KAAK,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;IAC1C,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;IAChF,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,gBAAgB,GAAG,YAAY,GAAG,SAAS,CAAC;IAC/E,KAAK,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IAClC,UAAU,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IACjD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAiD5C,CAAC"}
@@ -1,48 +0,0 @@
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
- };
@@ -1,3 +0,0 @@
1
- export * from "./Radio";
2
- export * from "./RadioGroup";
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/radio/src/main/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC"}
@@ -1,2 +0,0 @@
1
- export * from "./Radio";
2
- export * from "./RadioGroup";
@@ -1,2 +0,0 @@
1
- export * from './components';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/radio/src/main/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
@@ -1 +0,0 @@
1
- export * from './components';