Socket
Socket
Sign inDemoInstall

@happeouikit/buttons

Package Overview
Dependencies
91
Maintainers
12
Versions
19
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.3 to 2.0.4

4

CHANGELOG.md
# Changelog
## 2.0.4
- [Fixed] styled-components child module
## 2.0.2

@@ -4,0 +8,0 @@

49

dist/Buttons.js
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 @@ },

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc