New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@alfalab/core-components-icon-button

Package Overview
Dependencies
Maintainers
16
Versions
125
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@alfalab/core-components-icon-button - npm Package Compare versions

Comparing version

to
2.0.0

dist/cssm/default.module.css

16

CHANGELOG.md

@@ -6,2 +6,18 @@ # Change Log

# [2.0.0](https://github.com/alfa-laboratory/core-components/compare/@alfalab/core-components-icon-button@1.3.3...@alfalab/core-components-icon-button@2.0.0) (2021-05-25)
### Features
* **button:** add inverted ([#649](https://github.com/alfa-laboratory/core-components/issues/649)) ([be321b0](https://github.com/alfa-laboratory/core-components/commit/be321b07e99d20824138ad65141f3fbed1b6e315)), closes [#658](https://github.com/alfa-laboratory/core-components/issues/658) [#657](https://github.com/alfa-laboratory/core-components/issues/657)
### BREAKING CHANGES
* **button:** remove inverted themes
## [1.3.3](https://github.com/alfa-laboratory/core-components/compare/@alfalab/core-components-icon-button@1.3.2...@alfalab/core-components-icon-button@1.3.3) (2021-05-25)

@@ -8,0 +24,0 @@

@@ -27,2 +27,6 @@ /// <reference types="react" />

dataTestId?: string;
/**
* Набор цветов для компонента
*/
colors?: 'default' | 'inverted';
} & Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'size'>;

@@ -52,3 +56,7 @@ declare const IconButton: React.ForwardRefExoticComponent<{

dataTestId?: string | undefined;
/**
* Набор цветов для компонента
*/
colors?: "default" | "inverted" | undefined;
} & Pick<React.ButtonHTMLAttributes<HTMLButtonElement>, "className" | "form" | "slot" | "style" | "title" | "children" | "type" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "value"> & React.RefAttributes<HTMLButtonElement>>;
export { IconButtonProps, IconButton };

16

dist/Component.js

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

var styles = {"primary":"icon-button__primary_1oxuj","secondary":"icon-button__secondary_1oxuj","transparent":"icon-button__transparent_1oxuj","negative":"icon-button__negative_1oxuj","xxs":"icon-button__xxs_1oxuj","xs":"icon-button__xs_1oxuj","s":"icon-button__s_1oxuj","iconWrapper":"icon-button__iconWrapper_1oxuj","icon":"icon-button__icon_1oxuj"};
var styles = {"xxs":"icon-button__xxs_1tel0","xs":"icon-button__xs_1tel0","s":"icon-button__s_1tel0","iconWrapper":"icon-button__iconWrapper_1tel0","icon":"icon-button__icon_1tel0"};
require('./index.css')
var defaultColors = {"primary":"icon-button__primary_1g0xo","secondary":"icon-button__secondary_1g0xo","transparent":"icon-button__transparent_1g0xo","negative":"icon-button__negative_1g0xo"};
require('./default.css')
var invertedColors = {"primary":"icon-button__primary_715r4","secondary":"icon-button__secondary_715r4","transparent":"icon-button__transparent_715r4","negative":"icon-button__negative_715r4"};
require('./inverted.css')
var colorStyles = {
default: defaultColors,
inverted: invertedColors,
};
var IconButton = React.forwardRef(function (_a, ref) {
var className = _a.className, Icon = _a.icon, _b = _a.view, view = _b === void 0 ? 'primary' : _b, _c = _a.size, size = _c === void 0 ? 's' : _c, restProps = __rest(_a, ["className", "icon", "view", "size"]);
return (React__default['default'].createElement(coreComponentsButton.Button, __assign({}, restProps, { ref: ref, view: 'ghost', className: cn__default['default'](className, styles[view]), size: 's', leftAddons: React__default['default'].createElement("span", { className: cn__default['default'](styles.iconWrapper, styles[size]) },
var className = _a.className, Icon = _a.icon, _b = _a.view, view = _b === void 0 ? 'primary' : _b, _c = _a.size, size = _c === void 0 ? 's' : _c, _d = _a.colors, colors = _d === void 0 ? 'default' : _d, restProps = __rest(_a, ["className", "icon", "view", "size", "colors"]);
return (React__default['default'].createElement(coreComponentsButton.Button, __assign({}, restProps, { ref: ref, view: 'ghost', className: cn__default['default'](className, colorStyles[colors][view]), size: 's', leftAddons: React__default['default'].createElement("span", { className: cn__default['default'](styles.iconWrapper, styles[size]) },
React__default['default'].createElement(Icon, { className: styles.icon })) })));

@@ -61,0 +71,0 @@ });

@@ -27,2 +27,6 @@ /// <reference types="react" />

dataTestId?: string;
/**
* Набор цветов для компонента
*/
colors?: 'default' | 'inverted';
} & Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'size'>;

@@ -52,3 +56,7 @@ declare const IconButton: React.ForwardRefExoticComponent<{

dataTestId?: string | undefined;
/**
* Набор цветов для компонента
*/
colors?: "default" | "inverted" | undefined;
} & Pick<React.ButtonHTMLAttributes<HTMLButtonElement>, "className" | "form" | "slot" | "style" | "title" | "children" | "type" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "value"> & React.RefAttributes<HTMLButtonElement>>;
export { IconButtonProps, IconButton };

@@ -9,2 +9,4 @@ 'use strict';

var styles = require('./index.module.css');
var defaultColors = require('./default.module.css');
var invertedColors = require('./inverted.module.css');

@@ -16,2 +18,4 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var styles__default = /*#__PURE__*/_interopDefaultLegacy(styles);
var defaultColors__default = /*#__PURE__*/_interopDefaultLegacy(defaultColors);
var invertedColors__default = /*#__PURE__*/_interopDefaultLegacy(invertedColors);

@@ -57,5 +61,9 @@ /*! *****************************************************************************

var colorStyles = {
default: defaultColors__default['default'],
inverted: invertedColors__default['default'],
};
var IconButton = React.forwardRef(function (_a, ref) {
var className = _a.className, Icon = _a.icon, _b = _a.view, view = _b === void 0 ? 'primary' : _b, _c = _a.size, size = _c === void 0 ? 's' : _c, restProps = __rest(_a, ["className", "icon", "view", "size"]);
return (React__default['default'].createElement(coreComponentsButton.Button, __assign({}, restProps, { ref: ref, view: 'ghost', className: cn__default['default'](className, styles__default['default'][view]), size: 's', leftAddons: React__default['default'].createElement("span", { className: cn__default['default'](styles__default['default'].iconWrapper, styles__default['default'][size]) },
var className = _a.className, Icon = _a.icon, _b = _a.view, view = _b === void 0 ? 'primary' : _b, _c = _a.size, size = _c === void 0 ? 's' : _c, _d = _a.colors, colors = _d === void 0 ? 'default' : _d, restProps = __rest(_a, ["className", "icon", "view", "size", "colors"]);
return (React__default['default'].createElement(coreComponentsButton.Button, __assign({}, restProps, { ref: ref, view: 'ghost', className: cn__default['default'](className, colorStyles[colors][view]), size: 's', leftAddons: React__default['default'].createElement("span", { className: cn__default['default'](styles__default['default'].iconWrapper, styles__default['default'][size]) },
React__default['default'].createElement(Icon, { className: styles__default['default'].icon })) })));

@@ -62,0 +70,0 @@ });

@@ -10,2 +10,4 @@ 'use strict';

require('./index.module.css');
require('./default.module.css');
require('./inverted.module.css');

@@ -12,0 +14,0 @@

@@ -27,2 +27,6 @@ /// <reference types="react" />

dataTestId?: string;
/**
* Набор цветов для компонента
*/
colors?: 'default' | 'inverted';
} & Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'size'>;

@@ -52,3 +56,7 @@ declare const IconButton: React.ForwardRefExoticComponent<{

dataTestId?: string | undefined;
/**
* Набор цветов для компонента
*/
colors?: "default" | "inverted" | undefined;
} & Pick<React.ButtonHTMLAttributes<HTMLButtonElement>, "className" | "form" | "slot" | "style" | "title" | "children" | "type" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "value"> & React.RefAttributes<HTMLButtonElement>>;
export { IconButtonProps, IconButton };

@@ -44,8 +44,18 @@ import React, { forwardRef } from 'react';

var styles = {"primary":"icon-button__primary_1oxuj","secondary":"icon-button__secondary_1oxuj","transparent":"icon-button__transparent_1oxuj","negative":"icon-button__negative_1oxuj","xxs":"icon-button__xxs_1oxuj","xs":"icon-button__xs_1oxuj","s":"icon-button__s_1oxuj","iconWrapper":"icon-button__iconWrapper_1oxuj","icon":"icon-button__icon_1oxuj"};
var styles = {"xxs":"icon-button__xxs_1tel0","xs":"icon-button__xs_1tel0","s":"icon-button__s_1tel0","iconWrapper":"icon-button__iconWrapper_1tel0","icon":"icon-button__icon_1tel0"};
require('./index.css')
var defaultColors = {"primary":"icon-button__primary_1g0xo","secondary":"icon-button__secondary_1g0xo","transparent":"icon-button__transparent_1g0xo","negative":"icon-button__negative_1g0xo"};
require('./default.css')
var invertedColors = {"primary":"icon-button__primary_715r4","secondary":"icon-button__secondary_715r4","transparent":"icon-button__transparent_715r4","negative":"icon-button__negative_715r4"};
require('./inverted.css')
var colorStyles = {
default: defaultColors,
inverted: invertedColors,
};
var IconButton = forwardRef(function (_a, ref) {
var className = _a.className, Icon = _a.icon, _b = _a.view, view = _b === void 0 ? 'primary' : _b, _c = _a.size, size = _c === void 0 ? 's' : _c, restProps = __rest(_a, ["className", "icon", "view", "size"]);
return (React.createElement(Button, __assign({}, restProps, { ref: ref, view: 'ghost', className: cn(className, styles[view]), size: 's', leftAddons: React.createElement("span", { className: cn(styles.iconWrapper, styles[size]) },
var className = _a.className, Icon = _a.icon, _b = _a.view, view = _b === void 0 ? 'primary' : _b, _c = _a.size, size = _c === void 0 ? 's' : _c, _d = _a.colors, colors = _d === void 0 ? 'default' : _d, restProps = __rest(_a, ["className", "icon", "view", "size", "colors"]);
return (React.createElement(Button, __assign({}, restProps, { ref: ref, view: 'ghost', className: cn(className, colorStyles[colors][view]), size: 's', leftAddons: React.createElement("span", { className: cn(styles.iconWrapper, styles[size]) },
React.createElement(Icon, { className: styles.icon })) })));

@@ -52,0 +62,0 @@ });

@@ -27,2 +27,6 @@ /// <reference types="react" />

dataTestId?: string;
/**
* Набор цветов для компонента
*/
colors?: 'default' | 'inverted';
} & Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'size'>;

@@ -52,3 +56,7 @@ declare const IconButton: React.ForwardRefExoticComponent<{

dataTestId?: string | undefined;
/**
* Набор цветов для компонента
*/
colors?: "default" | "inverted" | undefined;
} & Pick<React.ButtonHTMLAttributes<HTMLButtonElement>, "className" | "form" | "slot" | "style" | "title" | "children" | "type" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "value"> & React.RefAttributes<HTMLButtonElement>>;
export { IconButtonProps, IconButton };

@@ -5,7 +5,17 @@ import React, { forwardRef } from 'react';

var styles = {"primary":"icon-button__primary_1oxuj","secondary":"icon-button__secondary_1oxuj","transparent":"icon-button__transparent_1oxuj","negative":"icon-button__negative_1oxuj","xxs":"icon-button__xxs_1oxuj","xs":"icon-button__xs_1oxuj","s":"icon-button__s_1oxuj","iconWrapper":"icon-button__iconWrapper_1oxuj","icon":"icon-button__icon_1oxuj"};
var styles = {"xxs":"icon-button__xxs_1tel0","xs":"icon-button__xs_1tel0","s":"icon-button__s_1tel0","iconWrapper":"icon-button__iconWrapper_1tel0","icon":"icon-button__icon_1tel0"};
require('./index.css')
const IconButton = forwardRef(({ className, icon: Icon, view = 'primary', size = 's', ...restProps }, ref) => {
return (React.createElement(Button, Object.assign({}, restProps, { ref: ref, view: 'ghost', className: cn(className, styles[view]), size: 's', leftAddons: React.createElement("span", { className: cn(styles.iconWrapper, styles[size]) },
var defaultColors = {"primary":"icon-button__primary_1g0xo","secondary":"icon-button__secondary_1g0xo","transparent":"icon-button__transparent_1g0xo","negative":"icon-button__negative_1g0xo"};
require('./default.css')
var invertedColors = {"primary":"icon-button__primary_715r4","secondary":"icon-button__secondary_715r4","transparent":"icon-button__transparent_715r4","negative":"icon-button__negative_715r4"};
require('./inverted.css')
const colorStyles = {
default: defaultColors,
inverted: invertedColors,
};
const IconButton = forwardRef(({ className, icon: Icon, view = 'primary', size = 's', colors = 'default', ...restProps }, ref) => {
return (React.createElement(Button, Object.assign({}, restProps, { ref: ref, view: 'ghost', className: cn(className, colorStyles[colors][view]), size: 's', leftAddons: React.createElement("span", { className: cn(styles.iconWrapper, styles[size]) },
React.createElement(Icon, { className: styles.icon })) })));

@@ -12,0 +22,0 @@ });

6

package.json
{
"name": "@alfalab/core-components-icon-button",
"version": "1.3.3",
"version": "2.0.0",
"description": "",

@@ -22,6 +22,6 @@ "keywords": [],

"dependencies": {
"@alfalab/core-components-button": "^2.3.2",
"@alfalab/core-components-button": "^3.0.0",
"classnames": "^2.2.6"
},
"gitHead": "7c480a2e0e8295956faa924a6ae3990c3c4f80de"
"gitHead": "f2cd904ff98ff96195a756d1f9175aef25706f05"
}

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