@highlight-ui/radio-button
Advanced tools
Comparing version 2.0.16 to 2.0.17
@@ -57,3 +57,3 @@ 'use strict'; | ||
var styles$1 = {"radioButtonLabelText":"RadioButton-module__2OcGXpbx__v2-0-16","radioButton":"RadioButton-module__uLxiOWSK__v2-0-16","radioButtonLabel":"RadioButton-module__3hCIWlCi__v2-0-16","radioButtonSubLabel":"RadioButton-module__212_N4Fe__v2-0-16","radioButtonInput":"RadioButton-module__TQWFpBGn__v2-0-16"}; | ||
var styles$1 = {"radioButtonLabelText":"RadioButton-module__2OcGXpbx__v2-0-17","radioButton":"RadioButton-module__uLxiOWSK__v2-0-17","radioButtonLabel":"RadioButton-module__3hCIWlCi__v2-0-17","radioButtonSubLabel":"RadioButton-module__212_N4Fe__v2-0-17","radioButtonInput":"RadioButton-module__TQWFpBGn__v2-0-17"}; | ||
@@ -63,13 +63,13 @@ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types | ||
var label = _a.label, subLabel = _a.subLabel, className = _a.className, metadata = _a.metadata, id = _a.id, radioProps = __rest(_a, ["label", "subLabel", "className", "metadata", "id"]); | ||
var generatedId = React.useMemo(function () { return uniqueId__default['default']('radioButton-'); }, []); | ||
var generatedId = React.useMemo(function () { return uniqueId__default["default"]('radioButton-'); }, []); | ||
var inputId = id || generatedId; | ||
return (React__default['default'].createElement("span", __assign({ className: classnames__default['default'](className, styles$1.radioButton) }, utilsCommons.parseMetadata(metadata)), | ||
React__default['default'].createElement("input", __assign({ ref: ref, id: inputId, type: "radio", className: styles$1.radioButtonInput }, radioProps)), | ||
React__default['default'].createElement("label", { htmlFor: inputId, className: styles$1.radioButtonLabel }, label && (React__default['default'].createElement(typography.Typography, { title: label, variant: "body-1", component: "span", className: styles$1.radioButtonLabelText }, label))), | ||
label && subLabel && (React__default['default'].createElement(typography.Typography, { title: subLabel, variant: "body-1", component: "span", className: styles$1.radioButtonSubLabel }, subLabel)))); | ||
return (React__default["default"].createElement("span", __assign({ className: classnames__default["default"](className, styles$1.radioButton) }, utilsCommons.parseMetadata(metadata)), | ||
React__default["default"].createElement("input", __assign({ ref: ref, id: inputId, type: "radio", className: styles$1.radioButtonInput }, radioProps)), | ||
React__default["default"].createElement("label", { htmlFor: inputId, className: styles$1.radioButtonLabel }, label && (React__default["default"].createElement(typography.Typography, { title: label, variant: "body-1", component: "span", className: styles$1.radioButtonLabelText }, label))), | ||
label && subLabel && (React__default["default"].createElement(typography.Typography, { title: subLabel, variant: "body-1", component: "span", className: styles$1.radioButtonSubLabel }, subLabel)))); | ||
}; | ||
RadioButtonWithRef.displayName = 'RadioButton'; | ||
var RadioButton = React__default['default'].forwardRef(RadioButtonWithRef); | ||
var RadioButton = React__default["default"].forwardRef(RadioButtonWithRef); | ||
var styles = {"radioButtonGroup":"RadioButtonGroup-module__1psiotap__v2-0-16","radioButtonGroupOption":"RadioButtonGroup-module__3TiKscg___v2-0-16","radioButtonGroupHorizontal":"RadioButtonGroup-module__1Tb26irs__v2-0-16"}; | ||
var styles = {"radioButtonGroup":"RadioButtonGroup-module__1psiotap__v2-0-17","radioButtonGroupOption":"RadioButtonGroup-module__3TiKscg___v2-0-17","radioButtonGroupHorizontal":"RadioButtonGroup-module__1Tb26irs__v2-0-17"}; | ||
@@ -79,14 +79,14 @@ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types | ||
var _b; | ||
var className = _a.className, metadata = _a.metadata, name = _a.name, _c = _a.disabled, disabled = _c === void 0 ? false : _c, _d = _a.orientation, orientation = _d === void 0 ? 'vertical' : _d, options = _a.options, value = _a.value, _e = _a.onChange, onChange = _e === void 0 ? noop__default['default'] : _e; | ||
var generatedName = React.useMemo(function () { return uniqueId__default['default']('radioButtonGroupOption-'); }, []); | ||
var className = _a.className, metadata = _a.metadata, name = _a.name, _c = _a.disabled, disabled = _c === void 0 ? false : _c, _d = _a.orientation, orientation = _d === void 0 ? 'vertical' : _d, options = _a.options, value = _a.value, _e = _a.onChange, onChange = _e === void 0 ? noop__default["default"] : _e; | ||
var generatedName = React.useMemo(function () { return uniqueId__default["default"]('radioButtonGroupOption-'); }, []); | ||
var radioButtonGroupName = name || generatedName; | ||
return (React__default['default'].createElement("div", __assign({ ref: ref, className: classnames__default['default'](className, styles.radioButtonGroup, (_b = {}, | ||
return (React__default["default"].createElement("div", __assign({ ref: ref, className: classnames__default["default"](className, styles.radioButtonGroup, (_b = {}, | ||
_b[styles.radioButtonGroupHorizontal] = orientation === 'horizontal', | ||
_b)) }, utilsCommons.parseMetadata(metadata)), options.map(function (option) { return (React__default['default'].createElement(RadioButton, { key: option.value + "-" + radioButtonGroupName, metadata: option.metadata, className: classnames__default['default'](option.className, styles.radioButtonGroupOption), id: option.id, label: option.label, subLabel: option.subLabel, value: option.value, disabled: disabled || option.disabled, checked: value === option.value, name: radioButtonGroupName, onChange: function () { return onChange(option); } })); }))); | ||
_b)) }, utilsCommons.parseMetadata(metadata)), options.map(function (option) { return (React__default["default"].createElement(RadioButton, { key: option.value + "-" + radioButtonGroupName, metadata: option.metadata, className: classnames__default["default"](option.className, styles.radioButtonGroupOption), id: option.id, label: option.label, subLabel: option.subLabel, value: option.value, disabled: disabled || option.disabled, checked: value === option.value, name: radioButtonGroupName, onChange: function () { return onChange(option); } })); }))); | ||
}; | ||
RadioButtonGroupWithRef.displayName = 'RadioButtonGroup'; | ||
var RadioButtonGroup = React__default['default'].forwardRef(RadioButtonGroupWithRef); | ||
var RadioButtonGroup = React__default["default"].forwardRef(RadioButtonGroupWithRef); | ||
exports.RadioButtonGroup = RadioButtonGroup; | ||
exports['default'] = RadioButton; | ||
exports["default"] = RadioButton; | ||
//# sourceMappingURL=index.js.map |
@@ -46,3 +46,3 @@ import React, { useMemo } from 'react'; | ||
var styles$1 = {"radioButtonLabelText":"RadioButton-module__2OcGXpbx__v2-0-16","radioButton":"RadioButton-module__uLxiOWSK__v2-0-16","radioButtonLabel":"RadioButton-module__3hCIWlCi__v2-0-16","radioButtonSubLabel":"RadioButton-module__212_N4Fe__v2-0-16","radioButtonInput":"RadioButton-module__TQWFpBGn__v2-0-16"}; | ||
var styles$1 = {"radioButtonLabelText":"RadioButton-module__2OcGXpbx__v2-0-17","radioButton":"RadioButton-module__uLxiOWSK__v2-0-17","radioButtonLabel":"RadioButton-module__3hCIWlCi__v2-0-17","radioButtonSubLabel":"RadioButton-module__212_N4Fe__v2-0-17","radioButtonInput":"RadioButton-module__TQWFpBGn__v2-0-17"}; | ||
@@ -62,3 +62,3 @@ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types | ||
var styles = {"radioButtonGroup":"RadioButtonGroup-module__1psiotap__v2-0-16","radioButtonGroupOption":"RadioButtonGroup-module__3TiKscg___v2-0-16","radioButtonGroupHorizontal":"RadioButtonGroup-module__1Tb26irs__v2-0-16"}; | ||
var styles = {"radioButtonGroup":"RadioButtonGroup-module__1psiotap__v2-0-17","radioButtonGroupOption":"RadioButtonGroup-module__3TiKscg___v2-0-17","radioButtonGroupHorizontal":"RadioButtonGroup-module__1Tb26irs__v2-0-17"}; | ||
@@ -65,0 +65,0 @@ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types |
{ | ||
"name": "@highlight-ui/radio-button", | ||
"version": "2.0.16", | ||
"version": "2.0.17", | ||
"author": "PPU", | ||
@@ -26,11 +26,11 @@ "main": "dist/cjs/index.js", | ||
"devDependencies": { | ||
"@highlight-ui/configs-base-jest": "^2.0.1", | ||
"@highlight-ui/configs-base-tsconfig": "^1.1.1", | ||
"@highlight-ui/configs-scripts": "^1.0.1", | ||
"@highlight-ui/configs-base-jest": "^2.0.2", | ||
"@highlight-ui/configs-base-tsconfig": "^1.1.2", | ||
"@highlight-ui/configs-scripts": "^1.0.2", | ||
"@highlight-ui/theme": "^5.0.0", | ||
"@storybook/react": "^6.2.7", | ||
"@testing-library/react": "^12.0.0", | ||
"@storybook/react": "^6.3.8", | ||
"@testing-library/react": "^12.1.1", | ||
"@testing-library/user-event": "^13.2.1", | ||
"classnames": "^2.3.1", | ||
"jest": "^27.1.0", | ||
"jest": "^27.2.3", | ||
"lodash": "^4.17.21", | ||
@@ -41,4 +41,4 @@ "react": "^17.0.0", | ||
"dependencies": { | ||
"@highlight-ui/typography": "^3.0.15", | ||
"@highlight-ui/utils-commons": "^1.3.7" | ||
"@highlight-ui/typography": "^3.0.16", | ||
"@highlight-ui/utils-commons": "^1.3.8" | ||
}, | ||
@@ -50,3 +50,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "7984103404adf5407783e9d34c290c0c2d73da7d" | ||
"gitHead": "97d317b9e086586867271b45b051e38464007065" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package