Socket
Socket
Sign inDemoInstall

@highlight-ui/button

Package Overview
Dependencies
Maintainers
4
Versions
161
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@highlight-ui/button - npm Package Compare versions

Comparing version 9.0.8 to 10.0.0

dist/cjs/src/IconButton.d.ts

5

dist/cjs/index.d.ts
export { default as Button } from './src/Button';
export type { ButtonProps, ButtonRef, ButtonState } from './src/Button';
export type { ButtonProps, ButtonRef } from './src/Button';
export { default as IconButton } from './src/IconButton';
export type { IconButtonProps, IconButtonRef } from './src/IconButton';
export type { ButtonType, ButtonState } from './src/types';

38

dist/cjs/index.js

@@ -53,8 +53,8 @@ 'use strict';

var styles = {"button":"Button-module__3Rp1BYXs__v9-0-8","iconButton":"Button-module__3Y8WdccY__v9-0-8","buttonInner":"Button-module__3ZNLhdsJ__v9-0-8","hiddenButtonLabel":"Button-module__iIVwFpEb__v9-0-8","loadingIcon":"Button-module__PkJtfsRC__v9-0-8","block":"Button-module__1xc1DTHJ__v9-0-8","default":"Button-module__2Kmo3l-q__v9-0-8","focus":"Button-module__39s3axLP__v9-0-8","active":"Button-module__3WXlxxv-__v9-0-8","disabled":"Button-module__yB64MUUF__v9-0-8","primary":"Button-module__2nxVbZSO__v9-0-8","success":"Button-module__2WMN2Up2__v9-0-8","info":"Button-module__3Ll-h-cW__v9-0-8","warning":"Button-module__2Ma4TaUU__v9-0-8","warning-light":"Button-module__2HCrlzv6__v9-0-8","danger":"Button-module__3Eex2siA__v9-0-8","dark":"Button-module__MqwKA-Vc__v9-0-8","light":"Button-module__iJhDdOHm__v9-0-8","defaultOutline":"Button-module__2tKStPHe__v9-0-8","hover":"Button-module__YUN3Kf-p__v9-0-8","tertiary":"Button-module__2yGbvo4L__v9-0-8"};
var styles$1 = {"button":"Button-module__3Rp1BYXs__v10-0-0","buttonInner":"Button-module__3ZNLhdsJ__v10-0-0","hiddenButtonLabel":"Button-module__iIVwFpEb__v10-0-0","loadingIcon":"Button-module__PkJtfsRC__v10-0-0","block":"Button-module__1xc1DTHJ__v10-0-0","default":"Button-module__2Kmo3l-q__v10-0-0","focus":"Button-module__39s3axLP__v10-0-0","active":"Button-module__3WXlxxv-__v10-0-0","disabled":"Button-module__yB64MUUF__v10-0-0","primary":"Button-module__2nxVbZSO__v10-0-0","success":"Button-module__2WMN2Up2__v10-0-0","info":"Button-module__3Ll-h-cW__v10-0-0","warning":"Button-module__2Ma4TaUU__v10-0-0","warning-light":"Button-module__2HCrlzv6__v10-0-0","danger":"Button-module__3Eex2siA__v10-0-0","dark":"Button-module__MqwKA-Vc__v10-0-0","light":"Button-module__iJhDdOHm__v10-0-0","defaultOutline":"Button-module__2tKStPHe__v10-0-0","hover":"Button-module__YUN3Kf-p__v10-0-0","tertiary":"Button-module__2yGbvo4L__v10-0-0"};
function ButtonWithRef(_a, ref) {
var _b, _c, _d, _e, _f, _g, _h;
var block = _a.block, _j = _a.children, children = _j === void 0 ? null : _j, className = _a.className, _k = _a.buttonState, buttonState = _k === void 0 ? 'enabled' : _k, icon$1 = _a.icon, metadata = _a.metadata, _l = _a.onClick, onClick = _l === void 0 ? undefined : _l, outline = _a.outline, _m = _a.theme, theme = _m === void 0 ? 'default' : _m, _o = _a.type, type = _o === void 0 ? 'button' : _o, remainingProps = __rest(_a, ["block", "children", "className", "buttonState", "icon", "metadata", "onClick", "outline", "theme", "type"]);
var containerClass = classnames__default["default"](styles.button, (_b = {}, _b[styles[theme]] = !outline, _b), (_c = {}, _c[styles[theme + "Outline"]] = outline, _c), (_d = {}, _d[styles.block] = block, _d), (_e = {}, _e[styles.disabled] = buttonState === 'disabled', _e), (_f = {}, _f[styles.iconButton] = icon$1 !== undefined && children === null, _f), (_g = {}, _g[styles.tertiary] = theme === 'tertiary', _g), className);
var _b, _c, _d, _e, _f, _g;
var block = _a.block, _h = _a.children, children = _h === void 0 ? null : _h, className = _a.className, _j = _a.buttonState, buttonState = _j === void 0 ? 'enabled' : _j, metadata = _a.metadata, _k = _a.onClick, onClick = _k === void 0 ? undefined : _k, outline = _a.outline, _l = _a.theme, theme = _l === void 0 ? 'default' : _l, _m = _a.type, type = _m === void 0 ? 'button' : _m, remainingProps = __rest(_a, ["block", "children", "className", "buttonState", "metadata", "onClick", "outline", "theme", "type"]);
var containerClass = classnames__default["default"](styles$1.button, (_b = {}, _b[styles$1[theme]] = !outline, _b), (_c = {}, _c[styles$1[theme + "Outline"]] = outline, _c), (_d = {}, _d[styles$1.block] = block, _d), (_e = {}, _e[styles$1.disabled] = buttonState === 'disabled', _e), (_f = {}, _f[styles$1.tertiary] = theme === 'tertiary', _f), className);
var focusAwareOnClick = function (event) {

@@ -68,8 +68,6 @@ event.currentTarget.focus();

type: type, ref: ref }), React__default["default"].createElement(React__default["default"].Fragment, null,
React__default["default"].createElement("div", { className: classnames__default["default"](styles.buttonInner, (_h = {},
_h[styles.hiddenButtonLabel] = buttonState === 'loading',
_h)) },
icon$1 && React__default["default"].createElement(icon.Icon, { name: icon$1, size: 14, type: "solid" }),
children && React__default["default"].createElement("div", { className: styles.buttonContent }, children)),
buttonState === 'loading' && (React__default["default"].createElement(icon.Icon, { name: "spinner-third", size: 16, spin: true, className: styles.loadingIcon, type: "solid" }))));
React__default["default"].createElement("div", { className: classnames__default["default"](styles$1.buttonInner, (_g = {},
_g[styles$1.hiddenButtonLabel] = buttonState === 'loading',
_g)) }, children && React__default["default"].createElement("div", null, children)),
buttonState === 'loading' && (React__default["default"].createElement(icon.Icon, { name: "spinner-third", size: 16, spin: true, className: styles$1.loadingIcon, type: "solid", metadata: utilsCommons.suffixMetadata(metadata, 'loading-icon') }))));
}

@@ -79,3 +77,23 @@ ButtonWithRef.displayName = 'Button';

var styles = {"iconButton":"IconButton-module__19b6ut_d__v10-0-0","default":"IconButton-module__1Nsfcgxw__v10-0-0","focus":"IconButton-module__3MskydD-__v10-0-0","active":"IconButton-module__3lHJu0cg__v10-0-0","disabled":"IconButton-module__1exwesEF__v10-0-0","primary":"IconButton-module__2Nqq71UC__v10-0-0","success":"IconButton-module__1-Iz2wRI__v10-0-0","info":"IconButton-module__3VFas9O5__v10-0-0","warning":"IconButton-module__2sEE3X5w__v10-0-0","warning-light":"IconButton-module__1lHEYNpB__v10-0-0","danger":"IconButton-module__1zSIHcAp__v10-0-0","dark":"IconButton-module__2Mys7lB4__v10-0-0","light":"IconButton-module__31COXije__v10-0-0","defaultOutline":"IconButton-module__1xwQnEPQ__v10-0-0","hover":"IconButton-module__1DIHn9ya__v10-0-0","tertiary":"IconButton-module__ccA4N6Zy__v10-0-0"};
function IconButtonWithRef(_a, ref) {
var _b, _c, _d, _e;
var className = _a.className, _f = _a.buttonState, buttonState = _f === void 0 ? 'enabled' : _f, icon$1 = _a.icon, ariaLabel = _a.ariaLabel, metadata = _a.metadata, _g = _a.onClick, onClick = _g === void 0 ? undefined : _g, outline = _a.outline, _h = _a.theme, theme = _h === void 0 ? 'default' : _h, _j = _a.type, type = _j === void 0 ? 'button' : _j, remainingProps = __rest(_a, ["className", "buttonState", "icon", "ariaLabel", "metadata", "onClick", "outline", "theme", "type"]);
var containerClass = classnames__default["default"](styles.iconButton, (_b = {}, _b[styles[theme]] = !outline, _b), (_c = {}, _c[styles[theme + "Outline"]] = outline, _c), (_d = {}, _d[styles.disabled] = buttonState === 'disabled', _d), (_e = {}, _e[styles.tertiary] = theme === 'tertiary', _e), className);
var focusAwareOnClick = function (event) {
event.currentTarget.focus();
if (onClick)
onClick(event);
};
return React__default["default"].createElement('button', __assign(__assign(__assign({}, remainingProps), { className: containerClass, disabled: buttonState !== 'enabled', onClick: focusAwareOnClick,
/* eslint-disable react/button-has-type */
type: type, ref: ref, 'aria-label': ariaLabel }), utilsCommons.parseMetadata(metadata)), React__default["default"].createElement(React__default["default"].Fragment, null,
React__default["default"].createElement("div", null, buttonState === 'loading' ? (React__default["default"].createElement(icon.Icon, { name: "spinner-third", size: 16, spin: true, type: "solid", metadata: utilsCommons.suffixMetadata(metadata, 'loading-icon') })) : (React__default["default"].createElement(icon.Icon, { name: icon$1, size: 14, type: "solid", metadata: utilsCommons.suffixMetadata(metadata, 'icon') })))));
}
IconButtonWithRef.displayName = 'IconButton';
var IconButton = React__default["default"].forwardRef(IconButtonWithRef);
exports.Button = Button;
exports.IconButton = IconButton;
//# sourceMappingURL=index.js.map
import React from 'react';
import { PropsWithMetadata, Theme } from '@highlight-ui/utils-commons';
import { ButtonType, ButtonState } from './types';
export declare type ButtonRef = React.Ref<HTMLButtonElement>;
export declare type ButtonState = 'enabled' | 'disabled' | 'loading';
export declare type ButtonProps = React.PropsWithChildren<PropsWithMetadata<{

@@ -12,4 +12,2 @@ /** Makes the component behave as a block element (take up the whole available space) */

buttonState?: ButtonState;
/** Allows to provide an icon by icon's name */
icon?: string;
/** A callback that will be fired ones the button is clicked */

@@ -26,3 +24,3 @@ onClick?: React.MouseEventHandler;

/** Button Type HTML property */
type?: 'button' | 'submit' | 'reset';
type?: ButtonType;
}>> & Omit<React.ComponentPropsWithoutRef<'button'>, 'disabled'>;

@@ -36,4 +34,2 @@ declare const Button: React.ForwardRefExoticComponent<{

buttonState?: ButtonState | undefined;
/** Allows to provide an icon by icon's name */
icon?: string | undefined;
/** A callback that will be fired ones the button is clicked */

@@ -50,3 +46,3 @@ onClick?: React.MouseEventHandler<Element> | undefined;

/** Button Type HTML property */
type?: "button" | "submit" | "reset" | undefined;
type?: ButtonType | undefined;
} & {

@@ -53,0 +49,0 @@ metadata?: import("@highlight-ui/utils-commons").ComponentMetadata | undefined;

export { default as Button } from './src/Button';
export type { ButtonProps, ButtonRef, ButtonState } from './src/Button';
export type { ButtonProps, ButtonRef } from './src/Button';
export { default as IconButton } from './src/IconButton';
export type { IconButtonProps, IconButtonRef } from './src/IconButton';
export type { ButtonType, ButtonState } from './src/types';
import React from 'react';
import classnames from 'classnames';
import { parseMetadata } from '@highlight-ui/utils-commons';
import { parseMetadata, suffixMetadata } from '@highlight-ui/utils-commons';
import { Icon } from '@highlight-ui/icon';

@@ -44,8 +44,8 @@

var styles = {"button":"Button-module__3Rp1BYXs__v9-0-8","iconButton":"Button-module__3Y8WdccY__v9-0-8","buttonInner":"Button-module__3ZNLhdsJ__v9-0-8","hiddenButtonLabel":"Button-module__iIVwFpEb__v9-0-8","loadingIcon":"Button-module__PkJtfsRC__v9-0-8","block":"Button-module__1xc1DTHJ__v9-0-8","default":"Button-module__2Kmo3l-q__v9-0-8","focus":"Button-module__39s3axLP__v9-0-8","active":"Button-module__3WXlxxv-__v9-0-8","disabled":"Button-module__yB64MUUF__v9-0-8","primary":"Button-module__2nxVbZSO__v9-0-8","success":"Button-module__2WMN2Up2__v9-0-8","info":"Button-module__3Ll-h-cW__v9-0-8","warning":"Button-module__2Ma4TaUU__v9-0-8","warning-light":"Button-module__2HCrlzv6__v9-0-8","danger":"Button-module__3Eex2siA__v9-0-8","dark":"Button-module__MqwKA-Vc__v9-0-8","light":"Button-module__iJhDdOHm__v9-0-8","defaultOutline":"Button-module__2tKStPHe__v9-0-8","hover":"Button-module__YUN3Kf-p__v9-0-8","tertiary":"Button-module__2yGbvo4L__v9-0-8"};
var styles$1 = {"button":"Button-module__3Rp1BYXs__v10-0-0","buttonInner":"Button-module__3ZNLhdsJ__v10-0-0","hiddenButtonLabel":"Button-module__iIVwFpEb__v10-0-0","loadingIcon":"Button-module__PkJtfsRC__v10-0-0","block":"Button-module__1xc1DTHJ__v10-0-0","default":"Button-module__2Kmo3l-q__v10-0-0","focus":"Button-module__39s3axLP__v10-0-0","active":"Button-module__3WXlxxv-__v10-0-0","disabled":"Button-module__yB64MUUF__v10-0-0","primary":"Button-module__2nxVbZSO__v10-0-0","success":"Button-module__2WMN2Up2__v10-0-0","info":"Button-module__3Ll-h-cW__v10-0-0","warning":"Button-module__2Ma4TaUU__v10-0-0","warning-light":"Button-module__2HCrlzv6__v10-0-0","danger":"Button-module__3Eex2siA__v10-0-0","dark":"Button-module__MqwKA-Vc__v10-0-0","light":"Button-module__iJhDdOHm__v10-0-0","defaultOutline":"Button-module__2tKStPHe__v10-0-0","hover":"Button-module__YUN3Kf-p__v10-0-0","tertiary":"Button-module__2yGbvo4L__v10-0-0"};
function ButtonWithRef(_a, ref) {
var _b, _c, _d, _e, _f, _g, _h;
var block = _a.block, _j = _a.children, children = _j === void 0 ? null : _j, className = _a.className, _k = _a.buttonState, buttonState = _k === void 0 ? 'enabled' : _k, icon = _a.icon, metadata = _a.metadata, _l = _a.onClick, onClick = _l === void 0 ? undefined : _l, outline = _a.outline, _m = _a.theme, theme = _m === void 0 ? 'default' : _m, _o = _a.type, type = _o === void 0 ? 'button' : _o, remainingProps = __rest(_a, ["block", "children", "className", "buttonState", "icon", "metadata", "onClick", "outline", "theme", "type"]);
var containerClass = classnames(styles.button, (_b = {}, _b[styles[theme]] = !outline, _b), (_c = {}, _c[styles[theme + "Outline"]] = outline, _c), (_d = {}, _d[styles.block] = block, _d), (_e = {}, _e[styles.disabled] = buttonState === 'disabled', _e), (_f = {}, _f[styles.iconButton] = icon !== undefined && children === null, _f), (_g = {}, _g[styles.tertiary] = theme === 'tertiary', _g), className);
var _b, _c, _d, _e, _f, _g;
var block = _a.block, _h = _a.children, children = _h === void 0 ? null : _h, className = _a.className, _j = _a.buttonState, buttonState = _j === void 0 ? 'enabled' : _j, metadata = _a.metadata, _k = _a.onClick, onClick = _k === void 0 ? undefined : _k, outline = _a.outline, _l = _a.theme, theme = _l === void 0 ? 'default' : _l, _m = _a.type, type = _m === void 0 ? 'button' : _m, remainingProps = __rest(_a, ["block", "children", "className", "buttonState", "metadata", "onClick", "outline", "theme", "type"]);
var containerClass = classnames(styles$1.button, (_b = {}, _b[styles$1[theme]] = !outline, _b), (_c = {}, _c[styles$1[theme + "Outline"]] = outline, _c), (_d = {}, _d[styles$1.block] = block, _d), (_e = {}, _e[styles$1.disabled] = buttonState === 'disabled', _e), (_f = {}, _f[styles$1.tertiary] = theme === 'tertiary', _f), className);
var focusAwareOnClick = function (event) {

@@ -59,8 +59,6 @@ event.currentTarget.focus();

type: type, ref: ref }), React.createElement(React.Fragment, null,
React.createElement("div", { className: classnames(styles.buttonInner, (_h = {},
_h[styles.hiddenButtonLabel] = buttonState === 'loading',
_h)) },
icon && React.createElement(Icon, { name: icon, size: 14, type: "solid" }),
children && React.createElement("div", { className: styles.buttonContent }, children)),
buttonState === 'loading' && (React.createElement(Icon, { name: "spinner-third", size: 16, spin: true, className: styles.loadingIcon, type: "solid" }))));
React.createElement("div", { className: classnames(styles$1.buttonInner, (_g = {},
_g[styles$1.hiddenButtonLabel] = buttonState === 'loading',
_g)) }, children && React.createElement("div", null, children)),
buttonState === 'loading' && (React.createElement(Icon, { name: "spinner-third", size: 16, spin: true, className: styles$1.loadingIcon, type: "solid", metadata: suffixMetadata(metadata, 'loading-icon') }))));
}

@@ -70,3 +68,22 @@ ButtonWithRef.displayName = 'Button';

export { Button };
var styles = {"iconButton":"IconButton-module__19b6ut_d__v10-0-0","default":"IconButton-module__1Nsfcgxw__v10-0-0","focus":"IconButton-module__3MskydD-__v10-0-0","active":"IconButton-module__3lHJu0cg__v10-0-0","disabled":"IconButton-module__1exwesEF__v10-0-0","primary":"IconButton-module__2Nqq71UC__v10-0-0","success":"IconButton-module__1-Iz2wRI__v10-0-0","info":"IconButton-module__3VFas9O5__v10-0-0","warning":"IconButton-module__2sEE3X5w__v10-0-0","warning-light":"IconButton-module__1lHEYNpB__v10-0-0","danger":"IconButton-module__1zSIHcAp__v10-0-0","dark":"IconButton-module__2Mys7lB4__v10-0-0","light":"IconButton-module__31COXije__v10-0-0","defaultOutline":"IconButton-module__1xwQnEPQ__v10-0-0","hover":"IconButton-module__1DIHn9ya__v10-0-0","tertiary":"IconButton-module__ccA4N6Zy__v10-0-0"};
function IconButtonWithRef(_a, ref) {
var _b, _c, _d, _e;
var className = _a.className, _f = _a.buttonState, buttonState = _f === void 0 ? 'enabled' : _f, icon = _a.icon, ariaLabel = _a.ariaLabel, metadata = _a.metadata, _g = _a.onClick, onClick = _g === void 0 ? undefined : _g, outline = _a.outline, _h = _a.theme, theme = _h === void 0 ? 'default' : _h, _j = _a.type, type = _j === void 0 ? 'button' : _j, remainingProps = __rest(_a, ["className", "buttonState", "icon", "ariaLabel", "metadata", "onClick", "outline", "theme", "type"]);
var containerClass = classnames(styles.iconButton, (_b = {}, _b[styles[theme]] = !outline, _b), (_c = {}, _c[styles[theme + "Outline"]] = outline, _c), (_d = {}, _d[styles.disabled] = buttonState === 'disabled', _d), (_e = {}, _e[styles.tertiary] = theme === 'tertiary', _e), className);
var focusAwareOnClick = function (event) {
event.currentTarget.focus();
if (onClick)
onClick(event);
};
return React.createElement('button', __assign(__assign(__assign({}, remainingProps), { className: containerClass, disabled: buttonState !== 'enabled', onClick: focusAwareOnClick,
/* eslint-disable react/button-has-type */
type: type, ref: ref, 'aria-label': ariaLabel }), parseMetadata(metadata)), React.createElement(React.Fragment, null,
React.createElement("div", null, buttonState === 'loading' ? (React.createElement(Icon, { name: "spinner-third", size: 16, spin: true, type: "solid", metadata: suffixMetadata(metadata, 'loading-icon') })) : (React.createElement(Icon, { name: icon, size: 14, type: "solid", metadata: suffixMetadata(metadata, 'icon') })))));
}
IconButtonWithRef.displayName = 'IconButton';
var IconButton = React.forwardRef(IconButtonWithRef);
export { Button, IconButton };
//# sourceMappingURL=index.js.map
import React from 'react';
import { PropsWithMetadata, Theme } from '@highlight-ui/utils-commons';
import { ButtonType, ButtonState } from './types';
export declare type ButtonRef = React.Ref<HTMLButtonElement>;
export declare type ButtonState = 'enabled' | 'disabled' | 'loading';
export declare type ButtonProps = React.PropsWithChildren<PropsWithMetadata<{

@@ -12,4 +12,2 @@ /** Makes the component behave as a block element (take up the whole available space) */

buttonState?: ButtonState;
/** Allows to provide an icon by icon's name */
icon?: string;
/** A callback that will be fired ones the button is clicked */

@@ -26,3 +24,3 @@ onClick?: React.MouseEventHandler;

/** Button Type HTML property */
type?: 'button' | 'submit' | 'reset';
type?: ButtonType;
}>> & Omit<React.ComponentPropsWithoutRef<'button'>, 'disabled'>;

@@ -36,4 +34,2 @@ declare const Button: React.ForwardRefExoticComponent<{

buttonState?: ButtonState | undefined;
/** Allows to provide an icon by icon's name */
icon?: string | undefined;
/** A callback that will be fired ones the button is clicked */

@@ -50,3 +46,3 @@ onClick?: React.MouseEventHandler<Element> | undefined;

/** Button Type HTML property */
type?: "button" | "submit" | "reset" | undefined;
type?: ButtonType | undefined;
} & {

@@ -53,0 +49,0 @@ metadata?: import("@highlight-ui/utils-commons").ComponentMetadata | undefined;

{
"name": "@highlight-ui/button",
"version": "9.0.8",
"version": "10.0.0",
"description": "The button",

@@ -50,3 +50,3 @@ "author": "Personio GmbH",

},
"gitHead": "e699c113929408ac7f26cc8826ea9460ed169e54"
"gitHead": "cbb124ef0257b5a69ab8dfa25807cf23d6f99c94"
}

@@ -14,3 +14,12 @@ # `@highlight-ui/button`

```ts
import { Button } from '@highlight-ui/button';
import {
Button,
ButtonProps,
ButtonRef,
IconButton,
IconButtonProps,
IconButtonRef,
ButtonState,
ButtonType,
} from '@highlight-ui/button';
```

@@ -26,3 +35,3 @@

Please visit [personio.design](https://www.personio.design/40d648a47/v/0/p/49fde0-button)
Please visit
[personio.design](https://www.personio.design/40d648a47/v/0/p/49fde0-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

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