@s-ui/react-atom-action-button
Advanced tools
Comparing version 1.10.0 to 1.11.0
import _extends from "@babel/runtime/helpers/esm/extends"; | ||
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"; | ||
var _excluded = ["children", "href", "target", "disabled", "isSubmit", "isButton", "link", "linkFactory"], | ||
_excluded2 = ["children"]; | ||
var _excluded = ["children", "href", "target", "disabled", "isSubmit", "isButton", "link", "linkFactory"]; | ||
import PropTypes from 'prop-types'; | ||
import ActionButtonLink from './ActionButtonLink.js'; | ||
import { jsx as _jsx } from "react/jsx-runtime"; | ||
var ActionButtonWrapper = function ActionButtonWrapper(_ref) { | ||
var children = _ref.children, | ||
href = _ref.href, | ||
target = _ref.target, | ||
disabled = _ref.disabled, | ||
isSubmit = _ref.isSubmit, | ||
isButton = _ref.isButton, | ||
link = _ref.link, | ||
Link = _ref.linkFactory, | ||
attrs = _objectWithoutPropertiesLoose(_ref, _excluded); | ||
href = _ref.href, | ||
target = _ref.target, | ||
disabled = _ref.disabled, | ||
isSubmit = _ref.isSubmit, | ||
isButton = _ref.isButton, | ||
link = _ref.link, | ||
_ref$linkFactory = _ref.linkFactory, | ||
Link = _ref$linkFactory === void 0 ? ActionButtonLink : _ref$linkFactory, | ||
attrs = _objectWithoutPropertiesLoose(_ref, _excluded); | ||
if (isSubmit) attrs.type = 'submit'; | ||
@@ -31,15 +30,2 @@ if (isButton) attrs.type = 'button'; | ||
}; | ||
ActionButtonWrapper.defaultProps = { | ||
// eslint-disable-next-line react/prop-types | ||
linkFactory: function linkFactory(_temp) { | ||
var _ref2 = _temp === void 0 ? {} : _temp, | ||
children = _ref2.children, | ||
rest = _objectWithoutPropertiesLoose(_ref2, _excluded2); | ||
return /*#__PURE__*/_jsx("a", _extends({}, rest, { | ||
children: children | ||
})); | ||
} | ||
}; | ||
export default ActionButtonWrapper; |
import _extends from "@babel/runtime/helpers/esm/extends"; | ||
/** | ||
@@ -7,6 +6,6 @@ * Base class for the component | ||
export var BASE_CLASS = 'sui-AtomActionButton'; | ||
/** | ||
* Available colors for the Action Button | ||
*/ | ||
export var COLORS = { | ||
@@ -17,6 +16,6 @@ PRIMARY: 'primary', | ||
}; | ||
/** | ||
* Available modifiers for the Action Button | ||
*/ | ||
export var MODIFIERS = { | ||
@@ -27,6 +26,6 @@ ACTIVE_FOCUSED: 'active', | ||
}; | ||
/** | ||
* Available sizes for the Action Button | ||
*/ | ||
export var SIZES = { | ||
@@ -37,6 +36,6 @@ SMALL: 'small', | ||
}; | ||
/** | ||
* Available styles for the Action Button | ||
*/ | ||
export var STYLES = { | ||
@@ -52,6 +51,4 @@ FILLED_NEGATIVE: 'filledNegative', | ||
} | ||
return array.reduce(function (res, key) { | ||
var _extends2; | ||
return _extends({}, res, (_extends2 = {}, _extends2[key] = BASE_CLASS + "--" + key + sufix, _extends2)); | ||
@@ -58,0 +55,0 @@ }, {}); |
@@ -9,28 +9,24 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
import { BASE_CLASS, CLASSES, COLOR_CLASSES, COLORS, MODIFIERS, SIZES, STYLES } from './config.js'; | ||
import { jsx as _jsx } from "react/jsx-runtime"; | ||
import { jsxs as _jsxs } from "react/jsx-runtime"; | ||
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; | ||
var AtomActionButton = function AtomActionButton(_ref) { | ||
var children = _ref.children, | ||
className = _ref.className, | ||
_ref$color = _ref.color, | ||
color = _ref$color === void 0 ? COLORS.PRIMARY : _ref$color, | ||
disabled = _ref.disabled, | ||
focused = _ref.focused, | ||
href = _ref.href, | ||
icon = _ref.icon, | ||
isButton = _ref.isButton, | ||
isSubmit = _ref.isSubmit, | ||
link = _ref.link, | ||
linkFactory = _ref.linkFactory, | ||
_ref$size = _ref.size, | ||
size = _ref$size === void 0 ? SIZES.MEDIUM : _ref$size, | ||
_ref$style = _ref.style, | ||
style = _ref$style === void 0 ? STYLES.FILLED_NEGATIVE : _ref$style, | ||
target = _ref.target, | ||
title = _ref.title, | ||
restProps = _objectWithoutPropertiesLoose(_ref, _excluded); | ||
className = _ref.className, | ||
_ref$color = _ref.color, | ||
color = _ref$color === void 0 ? COLORS.PRIMARY : _ref$color, | ||
disabled = _ref.disabled, | ||
focused = _ref.focused, | ||
href = _ref.href, | ||
icon = _ref.icon, | ||
isButton = _ref.isButton, | ||
isSubmit = _ref.isSubmit, | ||
link = _ref.link, | ||
linkFactory = _ref.linkFactory, | ||
_ref$size = _ref.size, | ||
size = _ref$size === void 0 ? SIZES.MEDIUM : _ref$size, | ||
_ref$style = _ref.style, | ||
style = _ref$style === void 0 ? STYLES.FILLED_NEGATIVE : _ref$style, | ||
target = _ref.target, | ||
title = _ref.title, | ||
restProps = _objectWithoutPropertiesLoose(_ref, _excluded); | ||
var classNames = cx(BASE_CLASS, COLOR_CLASSES[color], CLASSES[style], CLASSES[size], focused && CLASSES[MODIFIERS.ACTIVE_FOCUSED], disabled && CLASSES[MODIFIERS.DISABLED], link && CLASSES[MODIFIERS.LINK], className); | ||
var buttonProps = _extends({ | ||
@@ -45,3 +41,2 @@ href: href, | ||
}, restProps); | ||
return /*#__PURE__*/_jsxs(ActionButtonWrapper, _extends({}, buttonProps, { | ||
@@ -62,3 +57,2 @@ className: classNames, | ||
}; | ||
AtomActionButton.displayName = 'AtomActionButton'; | ||
@@ -65,0 +59,0 @@ export default AtomActionButton; |
{ | ||
"name": "@s-ui/react-atom-action-button", | ||
"version": "1.10.0", | ||
"version": "1.11.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -5,5 +5,2 @@ # AtomActionButton | ||
![Atom Action Button Colors](./assets/action-button-colors.png) | ||
![Atom Action Button Sizes and States](./assets/action-button-sizes-states.png) | ||
## Installation | ||
@@ -10,0 +7,0 @@ |
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
13729
153
55