@happeouikit/buttons
Advanced tools
Comparing version 2.0.3 to 2.0.4
# Changelog | ||
## 2.0.4 | ||
- [Fixed] styled-components child module | ||
## 2.0.2 | ||
@@ -4,0 +8,0 @@ |
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties"; | ||
import _defineProperty from "@babel/runtime/helpers/defineProperty"; | ||
var _excluded = ["icon", "text", "iconPosition", "size"], | ||
_excluded2 = ["icon", "className", "isActionIcon", "withMenu"]; | ||
_excluded2 = ["icon", "className", "isActionIcon", "withMenu"]; | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
import React from "react"; | ||
@@ -18,6 +15,4 @@ import PropTypes from "prop-types"; | ||
import { jsxs as _jsxs } from "react/jsx-runtime"; | ||
var IconGen = function IconGen(props) { | ||
var Icon = props.icon; | ||
if (Icon) { | ||
@@ -28,3 +23,2 @@ var iconDimensions = { | ||
}; | ||
if (props.iconPosition) { | ||
@@ -39,6 +33,4 @@ return /*#__PURE__*/_jsx(IconStyle, { | ||
} | ||
return null; | ||
}; | ||
var getTextComponent = function getTextComponent(size) { | ||
@@ -48,6 +40,4 @@ switch (size) { | ||
return BodyUI; | ||
case "large": | ||
return TextZeta; | ||
default: | ||
@@ -57,10 +47,8 @@ return BodyUI; | ||
}; | ||
var Button = function Button(_ref) { | ||
var icon = _ref.icon, | ||
text = _ref.text, | ||
iconPosition = _ref.iconPosition, | ||
size = _ref.size, | ||
props = _objectWithoutProperties(_ref, _excluded); | ||
text = _ref.text, | ||
iconPosition = _ref.iconPosition, | ||
size = _ref.size, | ||
props = _objectWithoutProperties(_ref, _excluded); | ||
var Text = getTextComponent(size); | ||
@@ -82,3 +70,2 @@ return /*#__PURE__*/_jsx("button", _objectSpread(_objectSpread({}, props), {}, { | ||
}; | ||
Button.propTypes = { | ||
@@ -130,13 +117,9 @@ text: PropTypes.node, | ||
var iconPosition = _ref2.iconPosition; | ||
switch (iconPosition) { | ||
case "right": | ||
return "0px 0px 0px 4px;"; | ||
case "top": | ||
return "4px 0px 0px 0px;"; | ||
case "bottom": | ||
return "0px 0px 4px 0px;"; | ||
case "left": | ||
@@ -159,13 +142,9 @@ default: | ||
var iconPosition = _ref4.iconPosition; | ||
switch (iconPosition) { | ||
case "right": | ||
return "row-reverse"; | ||
case "top": | ||
return "column"; | ||
case "bottom": | ||
return "column-reverse"; | ||
case "left": | ||
@@ -181,3 +160,3 @@ default: | ||
var _ref5$type = _ref5.type, | ||
type = _ref5$type === void 0 ? "default" : _ref5$type; | ||
type = _ref5$type === void 0 ? "default" : _ref5$type; | ||
if (type === "dark") return "\n background: ".concat(themeMap[type].enabled, ";\n color: ").concat(white, ";\n fill: ").concat(white, ";\n :hover {\n background: ").concat(themeMap[type].hover, ";\n }\n :active {\n background: ").concat(themeMap[type].active, ";\n box-shadow: none !important;\n }\n :focus {\n box-shadow: 0 0 0 1px ").concat(lighten(active, 0.3), ";\n border: 1px solid ").concat(white, ";\n }\n ");else return "\n background: ".concat(themeMap[type].enabled, ";\n color: ").concat(white, ";\n fill: ").concat(white, ";\n :hover {\n background: ").concat(themeMap[type].hover, ";\n }\n :active {\n background: ").concat(themeMap[type].active, ";\n box-shadow: none !important;\n }\n :focus {\n box-shadow: 0 0 0 1px ").concat(lighten(active, 0.3), ";\n border: 1px solid ").concat(white, ";\n }\n "); | ||
@@ -190,3 +169,3 @@ }); | ||
var _ref6$type = _ref6.type, | ||
type = _ref6$type === void 0 ? "default" : _ref6$type; | ||
type = _ref6$type === void 0 ? "default" : _ref6$type; | ||
return "\n color: ".concat(themeMap[type].enabled, ";\n fill: ").concat(themeMap[type].enabled, ";\n :hover {\n background: ").concat(lighten(themeMap[type].enabled, 0.9), ";\n color: ").concat(themeMap[type].enabled, ";\n fill: ").concat(themeMap[type].enabled, ";\n }\n :active {\n color: ").concat(themeMap[type].active, ";\n fill: ").concat(themeMap[type].active, ";\n background: ").concat(lighten(themeMap[type].enabled, 0.8), ";\n outline: none;\n border-color: transparent;\n box-shadow: none !important;\n }\n :disabled, :disabled:hover {\n color: ").concat(gray06, ";\n fill: ").concat(gray06, ";\n background: transparent;\n }\n :focus {\n box-shadow: 0 0 0 1px ").concat(lighten(active, 0.3), ";\n }\n "); | ||
@@ -200,7 +179,6 @@ }); | ||
var icon = _ref7.icon, | ||
className = _ref7.className, | ||
isActionIcon = _ref7.isActionIcon, | ||
withMenu = _ref7.withMenu, | ||
rest = _objectWithoutProperties(_ref7, _excluded2); | ||
className = _ref7.className, | ||
isActionIcon = _ref7.isActionIcon, | ||
withMenu = _ref7.withMenu, | ||
rest = _objectWithoutProperties(_ref7, _excluded2); | ||
var Icon = icon; | ||
@@ -226,5 +204,4 @@ var iconDimensions = { | ||
var _ref9$type = _ref9.type, | ||
type = _ref9$type === void 0 ? "default" : _ref9$type, | ||
isActionIcon = _ref9.isActionIcon; | ||
type = _ref9$type === void 0 ? "default" : _ref9$type, | ||
isActionIcon = _ref9.isActionIcon; | ||
if (type === "dark") { | ||
@@ -231,0 +208,0 @@ return css(["fill:", ";color:", ";background:", ";:hover{fill:", ";background:", ";}:active{fill:", ";color:", ";background:", ";}:focus{background:", ";box-shadow:", ";}:disabled,:disabled:hover{background:", ";fill:", ";color:", ";}"], gray08, gray08, themeMap[type].enabled, white, isActionIcon ? "transparent" : themeMap[type].hover, white, themeMap[type].active, isActionIcon ? "transparent" : themeMap[type].active, isActionIcon ? "transparent" : themeMap[type].enabled, isActionIcon ? "none" : "0 0 0 1px ".concat(lighten(active, 0.3)), themeMap[type].enabled, gray05, gray05); |
{ | ||
"name": "@happeouikit/buttons", | ||
"version": "2.0.3", | ||
"version": "2.0.4", | ||
"description": "", | ||
@@ -18,3 +18,3 @@ "main": "dist/index.js", | ||
"@happeouikit/colors": "^1.0.4", | ||
"@happeouikit/icons": "^1.0.33", | ||
"@happeouikit/icons": "^2.1.13", | ||
"@happeouikit/typography": "^1.0.7" | ||
@@ -21,0 +21,0 @@ }, |
13336
+ Added@happeouikit/icons@2.2.4(transitive)
+ Addedcaniuse-lite@1.0.30001638(transitive)
- Removed@emotion/is-prop-valid@0.8.8(transitive)
- Removed@emotion/memoize@0.7.4(transitive)
- Removed@happeouikit/icons@1.0.40(transitive)
- Removedcaniuse-lite@1.0.30001639(transitive)
- Removedcss-to-react-native@2.3.2(transitive)
- Removedis-what@3.14.1(transitive)
- Removedmemoize-one@5.2.1(transitive)
- Removedmerge-anything@2.4.4(transitive)
- Removedpostcss-value-parser@3.3.1(transitive)
- Removedreact@16.14.0(transitive)
- Removedstyled-components@4.4.1(transitive)
- Removedstylis@3.5.4(transitive)
- Removedstylis-rule-sheet@0.0.10(transitive)
Updated@happeouikit/icons@^2.1.13