Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sk-web-gui/button

Package Overview
Dependencies
Maintainers
3
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sk-web-gui/button - npm Package Compare versions

Comparing version 0.1.5 to 0.1.6

4

dist/cjs/button-group.js

@@ -42,3 +42,3 @@ "use strict";

role: "group",
className: (0, _utils.cx)("btn-group", attached && "btn-group-attached", className)
className: (0, _utils.cx)('btn-group', attached && 'btn-group-attached', className)
}, rest), clones);

@@ -49,4 +49,4 @@ });

if (_utils.__DEV__) {
ButtonGroup.displayName = "ButtonGroup";
ButtonGroup.displayName = 'ButtonGroup';
}
//# sourceMappingURL=button-group.js.map

@@ -36,5 +36,5 @@ "use strict";

_props$variant = props.variant,
variant = _props$variant === void 0 ? "outline" : _props$variant,
variant = _props$variant === void 0 ? 'outline' : _props$variant,
_props$size = props.size,
size = _props$size === void 0 ? "md" : _props$size,
size = _props$size === void 0 ? 'md' : _props$size,
_props$rounded = props.rounded,

@@ -56,7 +56,7 @@ rounded = _props$rounded === void 0 ? false : _props$rounded,

"data-rounded": rounded ? rounded : undefined,
"data-active": active ? "true" : undefined,
"data-active": active ? 'true' : undefined,
"data-color": color ? color : undefined,
className: (0, _utils.cx)(classes, className)
}, rest), leftIcon && !loading ? leftIcon : null, loading && /*#__PURE__*/React.createElement(_spinner.Spinner, {
className: (0, _utils.cx)(loadingText ? "relative" : "absolute", loadingText ? "mr-2" : "mr-0"),
className: (0, _utils.cx)(loadingText ? 'relative' : 'absolute', loadingText ? "mr-2" : 'mr-0'),
size: "sm"

@@ -70,4 +70,4 @@ }), loading ? loadingText || /*#__PURE__*/React.createElement("span", {

if (_utils.__DEV__) {
Button.displayName = "Button";
Button.displayName = 'Button';
}
//# sourceMappingURL=button.js.map

@@ -25,7 +25,7 @@ "use strict";

children = props.children,
ariaLabel = props["aria-label"],
ariaLabel = props['aria-label'],
className = props.className,
rest = _objectWithoutPropertiesLoose(props, _excluded);
var classes = (0, _utils.cx)("btn-icon", className);
var classes = (0, _utils.cx)('btn-icon', className);
/**

@@ -48,4 +48,4 @@ * Passing the icon as prop or children should work

if (_utils.__DEV__) {
IconButton.displayName = "IconButton";
IconButton.displayName = 'IconButton';
}
//# sourceMappingURL=icon-button.js.map

@@ -12,16 +12,16 @@ "use strict";

var variantClasses = {
outline: "btn-outline",
solid: "btn-solid",
ghost: "btn-ghost",
light: "btn-light",
link: "btn-link"
outline: 'btn-outline',
solid: 'btn-solid',
ghost: 'btn-ghost',
light: 'btn-light',
link: 'btn-link'
};
var sizes = {
xs: "btn-xs",
sm: "btn-sm",
md: "btn-md",
lg: "btn-lg",
xl: "btn-xl"
xs: 'btn-xs',
sm: 'btn-sm',
md: 'btn-md',
lg: 'btn-lg',
xl: 'btn-xl'
};
var classes = (0, _utils.cx)("btn", sizes[props.size], variantClasses[props.variant], props.disabled && "btn-disabled");
var classes = (0, _utils.cx)('btn', sizes[props.size], variantClasses[props.variant], props.disabled && 'btn-disabled');
return classes;

@@ -28,0 +28,0 @@ });

@@ -7,4 +7,4 @@ var _excluded = ["size", "color", "variant", "attached", "disabled", "children", "className"];

import { cx, getValidChildren, __DEV__ } from "@sk-web-gui/utils";
import * as React from "react";
import { cx, getValidChildren, __DEV__ } from '@sk-web-gui/utils';
import * as React from 'react';
export var ButtonGroup = /*#__PURE__*/React.forwardRef((props, ref) => {

@@ -34,3 +34,3 @@ var {

role: "group",
className: cx("btn-group", attached && "btn-group-attached", className)
className: cx('btn-group', attached && 'btn-group-attached', className)
}, rest), clones);

@@ -40,4 +40,4 @@ });

if (__DEV__) {
ButtonGroup.displayName = "ButtonGroup";
ButtonGroup.displayName = 'ButtonGroup';
}
//# sourceMappingURL=button-group.js.map

@@ -7,6 +7,6 @@ var _excluded = ["disabled", "loading", "active", "loadingText", "type", "leftIcon", "rightIcon", "children", "className", "color", "variant", "size", "rounded"];

import { Spinner } from "@sk-web-gui/spinner";
import { cx, __DEV__ } from "@sk-web-gui/utils";
import * as React from "react";
import { useButtonClass } from "./styles";
import { Spinner } from '@sk-web-gui/spinner';
import { cx, __DEV__ } from '@sk-web-gui/utils';
import * as React from 'react';
import { useButtonClass } from './styles';
export var Button = /*#__PURE__*/React.forwardRef((props, ref) => {

@@ -24,4 +24,4 @@ var {

color,
variant = "outline",
size = "md",
variant = 'outline',
size = 'md',
rounded = false

@@ -43,7 +43,7 @@ } = props,

"data-rounded": rounded ? rounded : undefined,
"data-active": active ? "true" : undefined,
"data-active": active ? 'true' : undefined,
"data-color": color ? color : undefined,
className: cx(classes, className)
}, rest), leftIcon && !loading ? leftIcon : null, loading && /*#__PURE__*/React.createElement(Spinner, {
className: cx(loadingText ? "relative" : "absolute", loadingText ? "mr-2" : "mr-0"),
className: cx(loadingText ? 'relative' : 'absolute', loadingText ? "mr-2" : 'mr-0'),
size: "sm"

@@ -56,4 +56,4 @@ }), loading ? loadingText || /*#__PURE__*/React.createElement("span", {

if (__DEV__) {
Button.displayName = "Button";
Button.displayName = 'Button';
}
//# sourceMappingURL=button.js.map

@@ -7,5 +7,5 @@ var _excluded = ["icon", "children", "aria-label", "className"];

import { cx, __DEV__ } from "@sk-web-gui/utils";
import * as React from "react";
import { Button } from "./button";
import { cx, __DEV__ } from '@sk-web-gui/utils';
import * as React from 'react';
import { Button } from './button';
export var IconButton = /*#__PURE__*/React.forwardRef((props, ref) => {

@@ -15,3 +15,3 @@ var {

children,
"aria-label": ariaLabel,
'aria-label': ariaLabel,
className

@@ -21,3 +21,3 @@ } = props,

var classes = cx("btn-icon", className);
var classes = cx('btn-icon', className);
/**

@@ -39,4 +39,4 @@ * Passing the icon as prop or children should work

if (__DEV__) {
IconButton.displayName = "IconButton";
IconButton.displayName = 'IconButton';
}
//# sourceMappingURL=icon-button.js.map

@@ -1,4 +0,4 @@

import { Button as InternalButton } from "./button";
import { ButtonGroup } from "./button-group";
import { IconButton } from "./icon-button";
import { Button as InternalButton } from './button';
import { ButtonGroup } from './button-group';
import { IconButton } from './icon-button';
var Button = InternalButton;

@@ -5,0 +5,0 @@ Button.Group = ButtonGroup;

@@ -1,21 +0,21 @@

import { createMemoClass } from "@sk-web-gui/theme";
import { cx } from "@sk-web-gui/utils";
import { createMemoClass } from '@sk-web-gui/theme';
import { cx } from '@sk-web-gui/utils';
export var useButtonClass = createMemoClass(props => {
var variantClasses = {
outline: "btn-outline",
solid: "btn-solid",
ghost: "btn-ghost",
light: "btn-light",
link: "btn-link"
outline: 'btn-outline',
solid: 'btn-solid',
ghost: 'btn-ghost',
light: 'btn-light',
link: 'btn-link'
};
var sizes = {
xs: "btn-xs",
sm: "btn-sm",
md: "btn-md",
lg: "btn-lg",
xl: "btn-xl"
xs: 'btn-xs',
sm: 'btn-sm',
md: 'btn-md',
lg: 'btn-lg',
xl: 'btn-xl'
};
var classes = cx("btn", sizes[props.size], variantClasses[props.variant], props.disabled && "btn-disabled");
var classes = cx('btn', sizes[props.size], variantClasses[props.variant], props.disabled && 'btn-disabled');
return classes;
});
//# sourceMappingURL=styles.js.map

@@ -1,4 +0,4 @@

import { DefaultProps } from "@sk-web-gui/theme";
import * as React from "react";
import { ButtonProps } from "./button";
import { DefaultProps } from '@sk-web-gui/theme';
import * as React from 'react';
import { ButtonProps } from './button';
interface IButtonGroupProps extends DefaultProps {

@@ -11,6 +11,6 @@ /**

disabled?: boolean;
size?: ButtonProps["size"];
size?: ButtonProps['size'];
/** Controls all wrapped button appearance */
variant?: ButtonProps["variant"];
color?: ButtonProps["color"];
variant?: ButtonProps['variant'];
color?: ButtonProps['color'];
children?: React.ReactNode;

@@ -17,0 +17,0 @@ }

@@ -1,3 +0,3 @@

import { DefaultProps } from "@sk-web-gui/theme";
import * as React from "react";
import { DefaultProps } from '@sk-web-gui/theme';
import * as React from 'react';
interface IButtonProps extends DefaultProps {

@@ -8,9 +8,9 @@ loading?: boolean;

loadingText?: string;
type?: "button" | "reset" | "submit";
type?: 'button' | 'reset' | 'submit';
leftIcon?: React.ReactElement;
rightIcon?: React.ReactElement;
color?: string;
size?: "sm" | "md" | "lg";
size?: 'sm' | 'md' | 'lg';
/** Controls button appearance */
variant?: "link" | "solid" | "outline" | "light" | "ghost";
variant?: 'link' | 'solid' | 'outline' | 'light' | 'ghost';
children?: React.ReactNode;

@@ -17,0 +17,0 @@ rounded?: boolean;

@@ -1,4 +0,4 @@

import * as React from "react";
import { ButtonProps } from "./button";
declare type OmittedProps = "leftIcon" | "rightIcon" | "loadingText";
import * as React from 'react';
import { ButtonProps } from './button';
declare type OmittedProps = 'leftIcon' | 'rightIcon' | 'loadingText';
interface IIconButtonProps extends Omit<ButtonProps, OmittedProps> {

@@ -14,5 +14,5 @@ /**

*/
"aria-label"?: string;
'aria-label'?: string;
}
export declare const IconButton: React.ForwardRefExoticComponent<IconButtonProps & React.RefAttributes<HTMLButtonElement>>;
export {};

@@ -1,5 +0,5 @@

import * as React from "react";
import { ButtonProps } from "./button";
import { ButtonGroup, ButtonGroupProps } from "./button-group";
import { IconButton, IconButtonProps } from "./icon-button";
import * as React from 'react';
import { ButtonProps } from './button';
import { ButtonGroup, ButtonGroupProps } from './button-group';
import { IconButton, IconButtonProps } from './icon-button';
interface Button extends React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>> {

@@ -6,0 +6,0 @@ Group: typeof ButtonGroup;

{
"name": "@sk-web-gui/button",
"version": "0.1.5",
"version": "0.1.6",
"sideEffects": false,

@@ -40,5 +40,5 @@ "license": "MIT",

"dependencies": {
"@sk-web-gui/spinner": "0.1.4",
"@sk-web-gui/theme": "0.1.4",
"@sk-web-gui/utils": "0.1.3"
"@sk-web-gui/spinner": "0.1.5",
"@sk-web-gui/theme": "0.1.5",
"@sk-web-gui/utils": "0.1.4"
},

@@ -48,3 +48,3 @@ "peerDependencies": {

},
"gitHead": "78eba5727e9a003897cfdb297a3ae1dabac3272b"
"gitHead": "7f394c9a25f1bd8bcd43d4b259ad025c146b1527"
}

@@ -5,2 +5,2 @@ ## Installation

yarn add @sk-web-gui/button
```
```

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