New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@uiw/react-radio

Package Overview
Dependencies
Maintainers
2
Versions
171
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@uiw/react-radio - npm Package Compare versions

Comparing version 5.0.0-bate-1 to 5.0.0-bate-10

11

cjs/index.js
"use strict";
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];
Object.defineProperty(exports, "__esModule", {

@@ -31,5 +30,3 @@ value: true

});
var _Radio = _interopRequireWildcard(require("./Radio"));
Object.keys(_Radio).forEach(function (key) {

@@ -46,5 +43,3 @@ if (key === "default" || key === "__esModule") return;

});
var _RadioGroup = _interopRequireWildcard(require("./RadioGroup"));
Object.keys(_RadioGroup).forEach(function (key) {

@@ -61,5 +56,3 @@ if (key === "default" || key === "__esModule") return;

});
var _RadioAbstract = require("./RadioAbstract");
Object.keys(_RadioAbstract).forEach(function (key) {

@@ -76,5 +69,3 @@ if (key === "default" || key === "__esModule") return;

});
var _RadioButton = _interopRequireWildcard(require("./RadioButton"));
Object.keys(_RadioButton).forEach(function (key) {

@@ -91,5 +82,3 @@ if (key === "default" || key === "__esModule") return;

});
var _style = require("./style");
Object.keys(_style).forEach(function (key) {

@@ -96,0 +85,0 @@ if (key === "default" || key === "__esModule") return;

"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
Object.defineProperty(exports, "__esModule", {

@@ -9,11 +8,6 @@ value: true

exports["default"] = exports.Radio = void 0;
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _react = _interopRequireDefault(require("react"));
var _RadioAbstract = require("./RadioAbstract");
var _jsxRuntime = require("react/jsx-runtime");
var Radio = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {

@@ -24,3 +18,2 @@ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_RadioAbstract.RadioAbstract, (0, _objectSpread2["default"])({

});
exports.Radio = Radio;

@@ -27,0 +20,0 @@ var _default = Radio;

59

cjs/RadioAbstract.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];
Object.defineProperty(exports, "__esModule", {

@@ -11,49 +9,37 @@ value: true

exports.RadioAbstract = void 0;
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
var _react = _interopRequireWildcard(require("react"));
var _style = require("./style");
var _jsxRuntime = require("react/jsx-runtime");
var _excluded = ["prefixCls", "type", "disabled", "value", "className", "style", "children", "size", "checked", "onChange"];
var RadioAbstract = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
var _props$prefixCls = props.prefixCls,
prefixCls = _props$prefixCls === void 0 ? 'w-radio' : _props$prefixCls,
_props$type = props.type,
type = _props$type === void 0 ? 'radio' : _props$type,
_props$disabled = props.disabled,
disabled = _props$disabled === void 0 ? false : _props$disabled,
_props$value = props.value,
value = _props$value === void 0 ? '' : _props$value,
className = props.className,
style = props.style,
children = props.children,
size = props.size,
_props$checked = props.checked,
prChecked = _props$checked === void 0 ? false : _props$checked,
onChange = props.onChange,
other = (0, _objectWithoutProperties2["default"])(props, _excluded);
prefixCls = _props$prefixCls === void 0 ? 'w-radio' : _props$prefixCls,
_props$type = props.type,
type = _props$type === void 0 ? 'radio' : _props$type,
_props$disabled = props.disabled,
disabled = _props$disabled === void 0 ? false : _props$disabled,
_props$value = props.value,
value = _props$value === void 0 ? '' : _props$value,
className = props.className,
style = props.style,
children = props.children,
size = props.size,
_props$checked = props.checked,
prChecked = _props$checked === void 0 ? false : _props$checked,
onChange = props.onChange,
other = (0, _objectWithoutProperties2["default"])(props, _excluded);
var _useState = (0, _react.useState)(prChecked),
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
checked = _useState2[0],
setChecked = _useState2[1];
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
checked = _useState2[0],
setChecked = _useState2[1];
var _useState3 = (0, _react.useState)(),
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
prevChecked = _useState4[0],
setPrevChecked = _useState4[1];
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
prevChecked = _useState4[0],
setPrevChecked = _useState4[1];
if (prChecked !== prevChecked) {
setPrevChecked(prChecked);
}
(0, _react.useMemo)(function () {

@@ -70,3 +56,2 @@ if (prChecked !== prevChecked) {

}, [props.checked]);
function handleChange(e) {

@@ -77,3 +62,2 @@ e.persist();

}
var label = children || value;

@@ -100,4 +84,3 @@ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_style.RadioBase, {

});
exports.RadioAbstract = RadioAbstract;
//# sourceMappingURL=RadioAbstract.js.map

@@ -13,4 +13,4 @@ import React from 'react';

}
export declare const RadioButton: React.ForwardRefExoticComponent<Pick<RadioButtonProps, "max" | "required" | "type" | "data" | "default" | "high" | "low" | "key" | "id" | "media" | "height" | "width" | "start" | "open" | "name" | "color" | "content" | "translate" | "value" | "hidden" | "cite" | "dir" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "acceptCharset" | "action" | "method" | "noValidate" | "target" | "accessKey" | "draggable" | "lang" | "className" | "prefix" | "children" | "contentEditable" | "inputMode" | "nonce" | "tabIndex" | "async" | "disabled" | "multiple" | "size" | "manifest" | "wrap" | "accept" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "crossOrigin" | "dateTime" | "defer" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "list" | "loop" | "marginHeight" | "marginWidth" | "maxLength" | "mediaGroup" | "min" | "minLength" | "muted" | "optimum" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "contextMenu" | "placeholder" | "spellCheck" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "sizes" | "src" | "srcDoc" | "srcLang" | "srcSet" | "step" | "useMap" | "wmode" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "prefixCls"> & React.RefAttributes<any>>;
export declare const RadioButton: React.ForwardRefExoticComponent<Pick<RadioButtonProps, "max" | "required" | "type" | "data" | "default" | "high" | "low" | "key" | "id" | "media" | "height" | "width" | "start" | "open" | "name" | "color" | "content" | "translate" | "value" | "hidden" | "cite" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "dir" | "pattern" | "acceptCharset" | "action" | "method" | "noValidate" | "target" | "accessKey" | "draggable" | "lang" | "className" | "prefix" | "children" | "contentEditable" | "inputMode" | "nonce" | "tabIndex" | "async" | "disabled" | "multiple" | "size" | "manifest" | "wrap" | "accept" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "crossOrigin" | "dateTime" | "defer" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "list" | "loop" | "marginHeight" | "marginWidth" | "maxLength" | "mediaGroup" | "min" | "minLength" | "muted" | "optimum" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "contextMenu" | "placeholder" | "spellCheck" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "sizes" | "src" | "srcDoc" | "srcLang" | "srcSet" | "step" | "useMap" | "wmode" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "prefixCls"> & React.RefAttributes<any>>;
export default RadioButton;
//# sourceMappingURL=RadioButton.d.ts.map
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];
Object.defineProperty(exports, "__esModule", {

@@ -11,50 +9,38 @@ value: true

exports["default"] = exports.RadioButton = void 0;
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
var _react = _interopRequireWildcard(require("react"));
var _reactButton = _interopRequireDefault(require("@uiw/react-button"));
var _jsxRuntime = require("react/jsx-runtime");
var _excluded = ["prefixCls", "type", "disabled", "value", "className", "style", "children", "size", "checked", "onChange"];
var RadioButton = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
var _props$prefixCls = props.prefixCls,
prefixCls = _props$prefixCls === void 0 ? 'w-radio' : _props$prefixCls,
_props$type = props.type,
type = _props$type === void 0 ? 'button' : _props$type,
_props$disabled = props.disabled,
disabled = _props$disabled === void 0 ? false : _props$disabled,
_props$value = props.value,
value = _props$value === void 0 ? '' : _props$value,
className = props.className,
style = props.style,
children = props.children,
_props$size = props.size,
size = _props$size === void 0 ? 'small' : _props$size,
_props$checked = props.checked,
prChecked = _props$checked === void 0 ? false : _props$checked,
onChange = props.onChange,
other = (0, _objectWithoutProperties2["default"])(props, _excluded);
prefixCls = _props$prefixCls === void 0 ? 'w-radio' : _props$prefixCls,
_props$type = props.type,
type = _props$type === void 0 ? 'button' : _props$type,
_props$disabled = props.disabled,
disabled = _props$disabled === void 0 ? false : _props$disabled,
_props$value = props.value,
value = _props$value === void 0 ? '' : _props$value,
className = props.className,
style = props.style,
children = props.children,
_props$size = props.size,
size = _props$size === void 0 ? 'small' : _props$size,
_props$checked = props.checked,
prChecked = _props$checked === void 0 ? false : _props$checked,
onChange = props.onChange,
other = (0, _objectWithoutProperties2["default"])(props, _excluded);
var _useState = (0, _react.useState)(prChecked),
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
checked = _useState2[0],
setChecked = _useState2[1];
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
checked = _useState2[0],
setChecked = _useState2[1];
var _useState3 = (0, _react.useState)(),
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
prevChecked = _useState4[0],
setPrevChecked = _useState4[1];
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
prevChecked = _useState4[0],
setPrevChecked = _useState4[1];
if (prChecked !== prevChecked) {
setPrevChecked(prChecked);
}
(0, _react.useMemo)(function () {

@@ -71,6 +57,4 @@ if (prChecked !== prevChecked) {

}, [props.checked]);
function handleChange(e) {
e.persist();
if (!checked) {

@@ -81,3 +65,2 @@ setChecked(!checked);

}
var label = children || value;

@@ -96,3 +79,2 @@ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactButton["default"], (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, other), {}, {

});
exports.RadioButton = RadioButton;

@@ -99,0 +81,0 @@ var _default = RadioButton;

"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
Object.defineProperty(exports, "__esModule", {

@@ -9,26 +8,18 @@ value: true

exports["default"] = exports.RadioGroup = void 0;
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
var _react = _interopRequireDefault(require("react"));
var _reactButtonGroup = _interopRequireDefault(require("@uiw/react-button-group"));
var _style = require("./style");
var _jsxRuntime = require("react/jsx-runtime");
var _excluded = ["prefixCls", "className", "name", "value", "onChange", "children"];
var RadioGroup = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
var _props$prefixCls = props.prefixCls,
prefixCls = _props$prefixCls === void 0 ? 'w-radio-group' : _props$prefixCls,
className = props.className,
name = props.name,
value = props.value,
onChange = props.onChange,
children = props.children,
other = (0, _objectWithoutProperties2["default"])(props, _excluded);
prefixCls = _props$prefixCls === void 0 ? 'w-radio-group' : _props$prefixCls,
className = props.className,
name = props.name,
value = props.value,
onChange = props.onChange,
children = props.children,
other = (0, _objectWithoutProperties2["default"])(props, _excluded);
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_style.RadioGroupBase, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, other), {}, {

@@ -50,3 +41,2 @@ ref: ref,

});
exports.RadioGroup = RadioGroup;

@@ -53,0 +43,0 @@ var _default = RadioGroup;

"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];
Object.defineProperty(exports, "__esModule", {

@@ -11,13 +9,7 @@ value: true

exports.RadioText = exports.RadioStyleTheme = exports.RadioInputStyleBase = exports.RadioGroupBase = exports.RadioBase = void 0;
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
var _styledComponents = _interopRequireWildcard(require("styled-components"));
var _utils = require("@uiw/utils");
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
var RadioStyleTheme = {

@@ -27,3 +19,3 @@ backgroundColorBase: '#fff',

colorRadioDefault: '#c7c7c7',
colorNotCheckedNotDisabledDefault: '#efefef',
colorNotCheckedNotDisabledDefault: '#cecece',
widthRadioDefault: '16px',

@@ -35,14 +27,9 @@ heightRadioDefault: '16px',

exports.RadioStyleTheme = RadioStyleTheme;
var RadioInputStyleBase = _styledComponents["default"].input(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])([""])));
exports.RadioInputStyleBase = RadioInputStyleBase;
var RadioText = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n vertical-align: middle;\n display: inline-block;\n margin-left: 4px;\n margin-right: 5px;\n font-size: 14px;\n"])));
exports.RadioText = RadioText;
var RadioBase = _styledComponents["default"].label(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n ", "\n"])), function (props) {
var disabled = props === null || props === void 0 ? void 0 : props.disabled;
return (0, _styledComponents.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n cursor: ", ";\n vertical-align: middle;\n display: inline-block;\n font-size: ", ";\n input[type='radio'] {\n outline: none;\n position: relative;\n width: ", ";\n height: ", ";\n background-clip: border-box;\n appearance: none;\n margin: -0.15px 0.6px 0 0;\n border-radius: 50%;\n background-color: ", ";\n border: ", ";\n transition: border 0.25s, box-shadow 0.25s;\n cursor: ", ";\n &:not(:checked):not(:disabled):not(.disabled) {\n background-color: ", ";\n &:hover,\n &:focus {\n box-shadow: 0 0 0 2px rgba(0, 142, 240, 0.25);\n }\n }\n &:checked {\n border: ", ";\n &:focus {\n box-shadow: 0 0 0 2px rgba(0, 142, 240, 0.25);\n }\n }\n }\n "])), disabled && (0, _utils.getThemeVariantValue)((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, props), {}, {
return (0, _styledComponents.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n cursor: ", ";\n vertical-align: middle;\n display: inline-block;\n font-size: ", ";\n input[type='radio'] {\n outline: none;\n position: relative;\n width: ", ";\n height: ", ";\n background-clip: border-box;\n appearance: none;\n margin-top: -1.5px;\n margin-right: 1px;\n border-radius: 50%;\n background-color: ", ";\n border: ", ";\n transition: border 0.25s, box-shadow 0.25s;\n vertical-align: middle;\n cursor: ", ";\n &:not(:checked):not(:disabled):not(.disabled) {\n background-color: ", ";\n &:hover,\n &:focus {\n box-shadow: 0 0 0 2px rgba(0, 142, 240, 0.25);\n }\n }\n &:checked {\n border: ", ";\n &:focus {\n box-shadow: 0 0 0 2px rgba(0, 142, 240, 0.25);\n }\n border-color: ", ";\n }\n }\n "])), disabled && (0, _utils.getThemeVariantValue)((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, props), {}, {
defaultTheme: RadioStyleTheme

@@ -61,15 +48,11 @@ }), 'colorRadioDefault'), disabled && 'not-allowed', (0, _utils.getThemeVariantValue)((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, props), {}, {

defaultTheme: RadioStyleTheme
}), 'colorNotCheckedNotDisabledDefault'), disabled && (0, _utils.getThemeVariantValue)((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, props), {}, {
}), 'colorNotCheckedNotDisabledDefault'), (0, _utils.getThemeVariantValue)((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, props), {}, {
defaultTheme: RadioStyleTheme
}), 'borderRadioCheckedDefault'));
}), 'borderRadioCheckedDefault'), disabled && (0, _utils.getThemeVariantValue)((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, props), {}, {
defaultTheme: RadioStyleTheme
}), 'colorNotCheckedNotDisabledDefault'));
});
exports.RadioBase = RadioBase;
var RadioGroupBase = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n font-size: 0;\n"]))); // RadioBase.defaultProps = {
// defaultTheme: RadioStyleTheme,
// };
var RadioGroupBase = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n font-size: 0;\n"])));
exports.RadioGroupBase = RadioGroupBase;
//# sourceMappingURL=index.js.map

@@ -6,2 +6,3 @@ import _extends from "@babel/runtime/helpers/extends";

import { RadioText, RadioBase, RadioInputStyleBase } from './style';
/**

@@ -11,3 +12,2 @@ * Constructs a type by picking all properties from `HTMLInputProps` and then removing `size`.

*/
import { jsx as _jsx } from "react/jsx-runtime";

@@ -17,22 +17,19 @@ import { jsxs as _jsxs } from "react/jsx-runtime";

var {
prefixCls = 'w-radio',
type = 'radio',
disabled = false,
value = '',
className,
style,
children,
size,
checked: prChecked = false,
onChange
} = props,
other = _objectWithoutPropertiesLoose(props, _excluded);
prefixCls = 'w-radio',
type = 'radio',
disabled = false,
value = '',
className,
style,
children,
size,
checked: prChecked = false,
onChange
} = props,
other = _objectWithoutPropertiesLoose(props, _excluded);
var [checked, setChecked] = useState(prChecked);
var [prevChecked, setPrevChecked] = useState();
if (prChecked !== prevChecked) {
setPrevChecked(prChecked);
}
useMemo(() => {

@@ -49,3 +46,2 @@ if (prChecked !== prevChecked) {

}, [props.checked]);
function handleChange(e) {

@@ -56,3 +52,2 @@ e.persist();

}
var label = children || value;

@@ -59,0 +54,0 @@ return /*#__PURE__*/_jsxs(RadioBase, {

@@ -13,4 +13,4 @@ import React from 'react';

}
export declare const RadioButton: React.ForwardRefExoticComponent<Pick<RadioButtonProps, "max" | "required" | "type" | "data" | "default" | "high" | "low" | "key" | "id" | "media" | "height" | "width" | "start" | "open" | "name" | "color" | "content" | "translate" | "value" | "hidden" | "cite" | "dir" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "acceptCharset" | "action" | "method" | "noValidate" | "target" | "accessKey" | "draggable" | "lang" | "className" | "prefix" | "children" | "contentEditable" | "inputMode" | "nonce" | "tabIndex" | "async" | "disabled" | "multiple" | "size" | "manifest" | "wrap" | "accept" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "crossOrigin" | "dateTime" | "defer" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "list" | "loop" | "marginHeight" | "marginWidth" | "maxLength" | "mediaGroup" | "min" | "minLength" | "muted" | "optimum" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "contextMenu" | "placeholder" | "spellCheck" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "sizes" | "src" | "srcDoc" | "srcLang" | "srcSet" | "step" | "useMap" | "wmode" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "prefixCls"> & React.RefAttributes<any>>;
export declare const RadioButton: React.ForwardRefExoticComponent<Pick<RadioButtonProps, "max" | "required" | "type" | "data" | "default" | "high" | "low" | "key" | "id" | "media" | "height" | "width" | "start" | "open" | "name" | "color" | "content" | "translate" | "value" | "hidden" | "cite" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "dir" | "pattern" | "acceptCharset" | "action" | "method" | "noValidate" | "target" | "accessKey" | "draggable" | "lang" | "className" | "prefix" | "children" | "contentEditable" | "inputMode" | "nonce" | "tabIndex" | "async" | "disabled" | "multiple" | "size" | "manifest" | "wrap" | "accept" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "crossOrigin" | "dateTime" | "defer" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "list" | "loop" | "marginHeight" | "marginWidth" | "maxLength" | "mediaGroup" | "min" | "minLength" | "muted" | "optimum" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "contextMenu" | "placeholder" | "spellCheck" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "sizes" | "src" | "srcDoc" | "srcLang" | "srcSet" | "step" | "useMap" | "wmode" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "prefixCls"> & React.RefAttributes<any>>;
export default RadioButton;
//# sourceMappingURL=RadioButton.d.ts.map

@@ -6,2 +6,3 @@ import _extends from "@babel/runtime/helpers/extends";

import Button from '@uiw/react-button';
/**

@@ -11,26 +12,22 @@ * Constructs a type by picking all properties from `HTMLInputProps` and then removing `size`.

*/
import { jsx as _jsx } from "react/jsx-runtime";
export var RadioButton = /*#__PURE__*/React.forwardRef((props, ref) => {
var {
prefixCls = 'w-radio',
type = 'button',
disabled = false,
value = '',
className,
style,
children,
size = 'small',
checked: prChecked = false,
onChange
} = props,
other = _objectWithoutPropertiesLoose(props, _excluded);
prefixCls = 'w-radio',
type = 'button',
disabled = false,
value = '',
className,
style,
children,
size = 'small',
checked: prChecked = false,
onChange
} = props,
other = _objectWithoutPropertiesLoose(props, _excluded);
var [checked, setChecked] = useState(prChecked);
var [prevChecked, setPrevChecked] = useState();
if (prChecked !== prevChecked) {
setPrevChecked(prChecked);
}
useMemo(() => {

@@ -47,6 +44,4 @@ if (prChecked !== prevChecked) {

}, [props.checked]);
function handleChange(e) {
e.persist();
if (!checked) {

@@ -57,3 +52,2 @@ setChecked(!checked);

}
var label = children || value;

@@ -60,0 +54,0 @@ return /*#__PURE__*/_jsx(Button, _extends({}, _extends({}, other, {

@@ -10,11 +10,10 @@ import _extends from "@babel/runtime/helpers/extends";

var {
prefixCls = 'w-radio-group',
className,
name,
value,
onChange,
children
} = props,
other = _objectWithoutPropertiesLoose(props, _excluded);
prefixCls = 'w-radio-group',
className,
name,
value,
onChange,
children
} = props,
other = _objectWithoutPropertiesLoose(props, _excluded);
return /*#__PURE__*/_jsx(RadioGroupBase, _extends({}, other, {

@@ -21,0 +20,0 @@ ref: ref,

import _extends from "@babel/runtime/helpers/extends";
import _taggedTemplateLiteralLoose from "@babel/runtime/helpers/taggedTemplateLiteralLoose";
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
import styled, { css } from 'styled-components';

@@ -12,3 +10,3 @@ import { getThemeVariantValue } from '@uiw/utils';

colorRadioDefault: '#c7c7c7',
colorNotCheckedNotDisabledDefault: '#efefef',
colorNotCheckedNotDisabledDefault: '#cecece',
widthRadioDefault: '16px',

@@ -23,3 +21,3 @@ heightRadioDefault: '16px',

var disabled = props == null ? void 0 : props.disabled;
return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteralLoose(["\n color: ", ";\n cursor: ", ";\n vertical-align: middle;\n display: inline-block;\n font-size: ", ";\n input[type='radio'] {\n outline: none;\n position: relative;\n width: ", ";\n height: ", ";\n background-clip: border-box;\n appearance: none;\n margin: -0.15px 0.6px 0 0;\n border-radius: 50%;\n background-color: ", ";\n border: ", ";\n transition: border 0.25s, box-shadow 0.25s;\n cursor: ", ";\n &:not(:checked):not(:disabled):not(.disabled) {\n background-color: ", ";\n &:hover,\n &:focus {\n box-shadow: 0 0 0 2px rgba(0, 142, 240, 0.25);\n }\n }\n &:checked {\n border: ", ";\n &:focus {\n box-shadow: 0 0 0 2px rgba(0, 142, 240, 0.25);\n }\n }\n }\n "])), disabled && getThemeVariantValue(_extends({}, props, {
return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteralLoose(["\n color: ", ";\n cursor: ", ";\n vertical-align: middle;\n display: inline-block;\n font-size: ", ";\n input[type='radio'] {\n outline: none;\n position: relative;\n width: ", ";\n height: ", ";\n background-clip: border-box;\n appearance: none;\n margin-top: -1.5px;\n margin-right: 1px;\n border-radius: 50%;\n background-color: ", ";\n border: ", ";\n transition: border 0.25s, box-shadow 0.25s;\n vertical-align: middle;\n cursor: ", ";\n &:not(:checked):not(:disabled):not(.disabled) {\n background-color: ", ";\n &:hover,\n &:focus {\n box-shadow: 0 0 0 2px rgba(0, 142, 240, 0.25);\n }\n }\n &:checked {\n border: ", ";\n &:focus {\n box-shadow: 0 0 0 2px rgba(0, 142, 240, 0.25);\n }\n border-color: ", ";\n }\n }\n "])), disabled && getThemeVariantValue(_extends({}, props, {
defaultTheme: RadioStyleTheme

@@ -38,11 +36,10 @@ }), 'colorRadioDefault'), disabled && 'not-allowed', getThemeVariantValue(_extends({}, props, {

defaultTheme: RadioStyleTheme
}), 'colorNotCheckedNotDisabledDefault'), disabled && getThemeVariantValue(_extends({}, props, {
}), 'colorNotCheckedNotDisabledDefault'), getThemeVariantValue(_extends({}, props, {
defaultTheme: RadioStyleTheme
}), 'borderRadioCheckedDefault'));
}), 'borderRadioCheckedDefault'), disabled && getThemeVariantValue(_extends({}, props, {
defaultTheme: RadioStyleTheme
}), 'colorNotCheckedNotDisabledDefault'));
});
var RadioGroupBase = styled.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteralLoose(["\n font-size: 0;\n"]))); // RadioBase.defaultProps = {
// defaultTheme: RadioStyleTheme,
// };
var RadioGroupBase = styled.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteralLoose(["\n font-size: 0;\n"])));
export { RadioText, RadioBase, RadioGroupBase };
//# sourceMappingURL=index.js.map
{
"name": "@uiw/react-radio",
"version": "5.0.0-bate-1",
"version": "5.0.0-bate-10",
"description": "Radio component",

@@ -48,6 +48,6 @@ "author": "Kenny Wong <wowohoo@qq.com>",

"dependencies": {
"@uiw/react-button": "^5.0.0-bate-1",
"@uiw/react-button-group": "^5.0.0-bate-1",
"@uiw/utils": "^5.0.0-bate-1"
"@uiw/react-button": "^5.0.0-bate-10",
"@uiw/react-button-group": "^5.0.0-bate-10",
"@uiw/utils": "^5.0.0-bate-10"
}
}

@@ -8,3 +8,3 @@ import styled, { css } from 'styled-components';

colorRadioDefault: '#c7c7c7',
colorNotCheckedNotDisabledDefault: '#efefef',
colorNotCheckedNotDisabledDefault: '#cecece',
widthRadioDefault: '16px',

@@ -49,3 +49,4 @@ heightRadioDefault: '16px',

appearance: none;
margin: -0.15px 0.6px 0 0;
margin-top: -1.5px;
margin-right: 1px;
border-radius: 50%;

@@ -55,2 +56,3 @@ background-color: ${getThemeVariantValue({ ...props, defaultTheme: RadioStyleTheme }, 'backgroundColorBase')};

transition: border 0.25s, box-shadow 0.25s;
vertical-align: middle;
cursor: ${disabled && 'not-allowed'};

@@ -66,7 +68,8 @@ &:not(:checked):not(:disabled):not(.disabled) {

&:checked {
border: ${disabled &&
getThemeVariantValue({ ...props, defaultTheme: RadioStyleTheme }, 'borderRadioCheckedDefault')};
border: ${getThemeVariantValue({ ...props, defaultTheme: RadioStyleTheme }, 'borderRadioCheckedDefault')};
&:focus {
box-shadow: 0 0 0 2px rgba(0, 142, 240, 0.25);
}
border-color: ${disabled &&
getThemeVariantValue({ ...props, defaultTheme: RadioStyleTheme }, 'colorNotCheckedNotDisabledDefault')};
}

@@ -81,6 +84,2 @@ }

// RadioBase.defaultProps = {
// defaultTheme: RadioStyleTheme,
// };
export { RadioText, RadioBase, RadioGroupBase };

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc