@synerise/ds-button 1.4.16 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/README.md +1 -1
- package/dist/Button.d.ts +24 -3
- package/dist/Button.js +5 -3
- package/dist/Button.styles.d.ts +33 -2
- package/dist/Button.styles.js +7 -6
- package/dist/Button.types.d.ts +2 -5
- package/dist/Button.types.js +1 -1
- package/dist/Checkbox/Checkbox.types.d.ts +1 -1
- package/dist/Creator/Creator.d.ts +1 -1
- package/dist/Creator/Creator.js +4 -3
- package/dist/Creator/Creator.styles.d.ts +28 -3
- package/dist/Creator/Creator.styles.js +7 -4
- package/dist/Creator/Creator.types.d.ts +2 -1
- package/dist/Star/Star.types.d.ts +1 -1
- package/dist/index.d.ts +38 -9
- package/dist/index.js +14 -21
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [1.5.0](https://github.com/synerise/synerise-design/compare/@synerise/ds-button@1.4.16...@synerise/ds-button@1.5.0) (2025-11-06)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **dropdown:** dropdownMenu component ([f0ec827](https://github.com/synerise/synerise-design/commit/f0ec82792cdcb021fa9a454912f6e7a892e53895))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [1.4.16](https://github.com/synerise/synerise-design/compare/@synerise/ds-button@1.4.15...@synerise/ds-button@1.4.16) (2025-10-22)
|
|
7
18
|
|
|
8
19
|
|
package/README.md
CHANGED
|
@@ -113,7 +113,7 @@ It behaves like checkbox input due to `role="checkbox"` and `aria-checked` attri
|
|
|
113
113
|
|
|
114
114
|
### Props
|
|
115
115
|
|
|
116
|
-
It inherits all `Button`'s props excluding `type`, `block`, `color`, `groupVariant`, `icon`, `iconColor`, `
|
|
116
|
+
It inherits all `Button`'s props excluding `type`, `block`, `color`, `groupVariant`, `icon`, `iconColor`, `mode`, `size`, `onChange`.
|
|
117
117
|
|
|
118
118
|
| Property | Description | Type | Default |
|
|
119
119
|
| -------------- | ---------------------------------------------------------- | ---------------------------- | ----------- |
|
package/dist/Button.d.ts
CHANGED
|
@@ -1,6 +1,27 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { type MouseEvent } from 'react';
|
|
2
2
|
import '@synerise/ds-core/dist/js/style';
|
|
3
|
-
import { type ButtonProps } from './Button.types';
|
|
4
3
|
import './style/index.less';
|
|
5
|
-
declare const Button:
|
|
4
|
+
declare const Button: React.ForwardRefExoticComponent<Omit<Partial<{
|
|
5
|
+
href: string;
|
|
6
|
+
target?: string;
|
|
7
|
+
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
8
|
+
} & import("antd/lib/button/button").BaseButtonProps & Omit<React.AnchorHTMLAttributes<any>, "type" | "onClick"> & {
|
|
9
|
+
htmlType?: import("antd/lib/button/button").ButtonHTMLType;
|
|
10
|
+
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
11
|
+
} & Omit<React.ButtonHTMLAttributes<any>, "type" | "onClick">>, "ghost" | "type"> & {
|
|
12
|
+
type?: import("@synerise/ds-utils").LiteralStringUnion<import("./Button.types").ButtonType>;
|
|
13
|
+
mode?: import("@synerise/ds-utils").LiteralStringUnion<"single-icon" | "split" | "two-icons" | "label-icon" | "icon-label">;
|
|
14
|
+
color?: import("@synerise/ds-utils").LiteralStringUnion<"blue" | "grey" | "red" | "green" | "yellow" | "pink" | "mars" | "orange" | "fern" | "cyan" | "purple" | "violet">;
|
|
15
|
+
groupVariant?: import("@synerise/ds-utils").LiteralStringUnion<"left-rounded" | "squared" | "right-rounded">;
|
|
16
|
+
justifyContent?: import("csstype").JustifyContentProperty;
|
|
17
|
+
loading?: boolean | {
|
|
18
|
+
delay?: number;
|
|
19
|
+
};
|
|
20
|
+
onClick?: (event: MouseEvent<HTMLElement>) => void;
|
|
21
|
+
iconColor?: import("@synerise/ds-utils").LiteralStringUnion<"blue" | "grey" | "red" | "green" | "yellow" | "pink" | "mars" | "orange" | "fern" | "cyan" | "purple" | "violet">;
|
|
22
|
+
error?: boolean;
|
|
23
|
+
readOnly?: boolean;
|
|
24
|
+
tagProps?: import("@synerise/ds-tag").TagProps;
|
|
25
|
+
tooltipProps?: import("@synerise/ds-tooltip").TooltipProps;
|
|
26
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
6
27
|
export default Button;
|
package/dist/Button.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var _excluded = ["type", "mode", "justifyContent", "groupVariant", "loading", "onClick", "className", "color", "error", "tagProps", "children", "tooltipProps"];
|
|
2
2
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
3
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
4
|
-
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
4
|
+
import React, { forwardRef, useEffect, useMemo, useRef, useState } from 'react';
|
|
5
5
|
import '@synerise/ds-core/dist/js/style';
|
|
6
6
|
import Icon, { SpinnerM } from '@synerise/ds-icon';
|
|
7
7
|
import { TagShape } from '@synerise/ds-tag';
|
|
@@ -10,7 +10,7 @@ import * as S from './Button.styles';
|
|
|
10
10
|
import { ButtonMode } from './Button.types';
|
|
11
11
|
import "./style/index.css";
|
|
12
12
|
var RIPPLE_ANIMATION_OFFSET = 50;
|
|
13
|
-
var Button = function
|
|
13
|
+
var Button = /*#__PURE__*/forwardRef(function (_ref, forwardedRef) {
|
|
14
14
|
var _ref$type = _ref.type,
|
|
15
15
|
type = _ref$type === void 0 ? 'secondary' : _ref$type,
|
|
16
16
|
mode = _ref.mode,
|
|
@@ -67,6 +67,7 @@ var Button = function Button(_ref) {
|
|
|
67
67
|
}, [mode, className, antdProps.readOnly]);
|
|
68
68
|
var buttonLabel = useMemo(function () {
|
|
69
69
|
var label = /*#__PURE__*/React.createElement(S.ButtonLabel, {
|
|
70
|
+
// ref={forwardedRef}
|
|
70
71
|
withTooltip: !!tooltipProps,
|
|
71
72
|
"data-testid": "ds-button-label",
|
|
72
73
|
className: "ds-button-label"
|
|
@@ -77,6 +78,7 @@ var Button = function Button(_ref) {
|
|
|
77
78
|
return tooltipProps ? /*#__PURE__*/React.createElement(Tooltip, tooltipProps, label) : label;
|
|
78
79
|
}, [children, tagProps, mode, tooltipProps]);
|
|
79
80
|
return /*#__PURE__*/React.createElement(S.AntdButton, _extends({
|
|
81
|
+
ref: forwardedRef,
|
|
80
82
|
justifyContent: justifyContent,
|
|
81
83
|
type: type || 'secondary',
|
|
82
84
|
mode: mode,
|
|
@@ -104,5 +106,5 @@ var Button = function Button(_ref) {
|
|
|
104
106
|
})), /*#__PURE__*/React.createElement(S.ButtonFocus, {
|
|
105
107
|
className: "btn-focus"
|
|
106
108
|
}));
|
|
107
|
-
};
|
|
109
|
+
});
|
|
108
110
|
export default Button;
|
package/dist/Button.styles.d.ts
CHANGED
|
@@ -1,10 +1,41 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { type ButtonProps } from './Button.types';
|
|
2
3
|
export declare const RIPPLE_ANIMATION_TIME = 500;
|
|
3
4
|
export declare const Spinner: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
5
|
export declare const RippleEffect: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
5
6
|
export declare const ButtonFocus: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
6
|
-
export declare const Tag: import("styled-components").StyledComponent<
|
|
7
|
+
export declare const Tag: import("styled-components").StyledComponent<React.ForwardRefExoticComponent<{
|
|
8
|
+
id?: string | number;
|
|
9
|
+
name?: string;
|
|
10
|
+
textColor?: string;
|
|
11
|
+
color?: string;
|
|
12
|
+
image?: string;
|
|
13
|
+
shape?: import("@synerise/ds-tag").TagShape;
|
|
14
|
+
removable?: boolean;
|
|
15
|
+
className?: string;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
onClick?: () => void;
|
|
18
|
+
onRemove?: (tag: string | number) => void;
|
|
19
|
+
prefixel?: React.ReactNode;
|
|
20
|
+
suffixel?: React.ReactNode;
|
|
21
|
+
texts?: import("@synerise/ds-tag").TagTexts;
|
|
22
|
+
asPill?: boolean;
|
|
23
|
+
dashed?: boolean;
|
|
24
|
+
tooltipProps?: import("@synerise/ds-tooltip").TooltipProps;
|
|
25
|
+
} & Omit<React.HTMLAttributes<HTMLDivElement>, "onClick" | "className" | "id" | "color" | "disabled" | "name" | "shape" | "textColor" | "image" | "removable" | "onRemove" | "prefixel" | "suffixel" | "texts" | "asPill" | "dashed" | "tooltipProps"> & import("@synerise/ds-utils").DataAttributes & React.RefAttributes<HTMLDivElement>>, any, {}, never>;
|
|
7
26
|
export declare const ButtonLabel: import("styled-components").StyledComponent<"div", any, {
|
|
8
27
|
withTooltip?: boolean;
|
|
9
28
|
}, never>;
|
|
10
|
-
export declare const AntdButton: import("styled-components").StyledComponent<
|
|
29
|
+
export declare const AntdButton: import("styled-components").StyledComponent<React.ForwardRefExoticComponent<Omit<Partial<{
|
|
30
|
+
href: string;
|
|
31
|
+
target?: string;
|
|
32
|
+
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
33
|
+
} & import("antd/lib/button/button").BaseButtonProps & Omit<React.AnchorHTMLAttributes<any>, "type" | "onClick"> & {
|
|
34
|
+
htmlType?: import("antd/lib/button/button").ButtonHTMLType;
|
|
35
|
+
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
36
|
+
} & Omit<React.ButtonHTMLAttributes<any>, "type" | "onClick">>, "type"> & Pick<ButtonProps, "mode" | "justifyContent" | "groupVariant" | "iconColor" | "error"> & {
|
|
37
|
+
pressed: boolean;
|
|
38
|
+
customColor: string;
|
|
39
|
+
readOnly?: boolean;
|
|
40
|
+
type: string;
|
|
41
|
+
} & React.RefAttributes<HTMLButtonElement>>, any, {}, never>;
|
package/dist/Button.styles.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var _excluded = ["mode", "type", "loading", "justifyContent", "groupVariant", "customColor", "
|
|
1
|
+
var _excluded = ["mode", "type", "loading", "justifyContent", "groupVariant", "customColor", "pressed", "size", "iconColor", "error"];
|
|
2
2
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
3
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
4
4
|
import Button from 'antd/lib/button';
|
|
5
|
-
import React from 'react';
|
|
5
|
+
import React, { forwardRef } from 'react';
|
|
6
6
|
import styled, { css, keyframes } from 'styled-components';
|
|
7
7
|
import { IconContainer } from '@synerise/ds-icon';
|
|
8
8
|
import DSTag from '@synerise/ds-tag';
|
|
@@ -39,25 +39,26 @@ export var ButtonLabel = styled.div.withConfig({
|
|
|
39
39
|
})(["display:flex;align-items:center;flex-grow:1;min-width:0;justify-content:center;", ""], function (props) {
|
|
40
40
|
return props.withTooltip && "\n && {\n pointer-events: all;\n }";
|
|
41
41
|
});
|
|
42
|
-
export var AntdButton = styled(function (_ref) {
|
|
42
|
+
export var AntdButton = styled(/*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
43
43
|
var mode = _ref.mode,
|
|
44
44
|
type = _ref.type,
|
|
45
45
|
loading = _ref.loading,
|
|
46
46
|
justifyContent = _ref.justifyContent,
|
|
47
47
|
groupVariant = _ref.groupVariant,
|
|
48
48
|
customColor = _ref.customColor,
|
|
49
|
-
rightIconSize = _ref.rightIconSize,
|
|
50
|
-
leftIconSize = _ref.leftIconSize,
|
|
51
49
|
pressed = _ref.pressed,
|
|
52
50
|
size = _ref.size,
|
|
53
51
|
iconColor = _ref.iconColor,
|
|
54
52
|
error = _ref.error,
|
|
55
53
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
56
54
|
return /*#__PURE__*/React.createElement(Button, _extends({
|
|
55
|
+
ref: ref
|
|
56
|
+
// @ts-expect-error type type mismatch
|
|
57
|
+
,
|
|
57
58
|
type: type === 'custom-color-ghost' ? 'ghost-primary' : type,
|
|
58
59
|
size: size
|
|
59
60
|
}, rest));
|
|
60
|
-
}).withConfig({
|
|
61
|
+
})).withConfig({
|
|
61
62
|
displayName: "Buttonstyles__AntdButton",
|
|
62
63
|
componentId: "sc-3lgta1-5"
|
|
63
64
|
})([" &&{-webkit-mask-image:-webkit-radial-gradient(white,black);display:inline-flex;align-items:center;padding:0 12px;position:relative;overflow:hidden;justify-content:", ";", ";&:not(:disabled):not(:focus){", " span{color:inherit;}}", " > *:not(.btn-focus){position:relative;}", " > .ds-icon,> .ds-icon{display:flex;align-items:center;justify-content:center;margin:0;width:24px;height:24px;svg{transition:all .3s cubic-bezier(.645,.045,.355,1);}}", " &&.ant-btn-default:not(.ds-expander):not(.ds-button-creator):not(.read-only):not([disabled]),&&.ant-btn-secondary:not(.ds-expander):not(.ds-button-creator):not(.read-only):not([disabled]){&:active{", "}&:focus:not(:active){color:", ";svg{fill:currentColor;}background:", ";}&:hover:not(:disabled):not(:focus){background-color:", ";&.ant-btn .btn-focus{box-shadow:inset 0 0 0 1px ", ";}", " > .ds-icon:before{background-color:", ";}}&:active{color:", ";svg{fill:", ";!important;}}}", " ", ";", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " &:hover:not(:disabled):not(:focus){", " span{color:", ";cursor:inherit;}}}"], function (props) {
|
package/dist/Button.types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ButtonProps as AntdButtonProps } from 'antd/lib/button';
|
|
2
2
|
import type { JustifyContentProperty } from 'csstype';
|
|
3
|
-
import type {
|
|
3
|
+
import type { MouseEvent } from 'react';
|
|
4
4
|
import type { TagProps } from '@synerise/ds-tag';
|
|
5
5
|
import type { TooltipProps } from '@synerise/ds-tooltip';
|
|
6
6
|
import type { LiteralStringUnion } from '@synerise/ds-utils';
|
|
@@ -57,9 +57,6 @@ export type ButtonProps = Omit<AntdButtonProps, 'type' | 'ghost'> & {
|
|
|
57
57
|
tagProps?: TagProps;
|
|
58
58
|
tooltipProps?: TooltipProps;
|
|
59
59
|
};
|
|
60
|
+
/** @deprecated - use ButtonProps instead */
|
|
60
61
|
export type Props = ButtonProps;
|
|
61
|
-
export type ButtonSubComponents = {
|
|
62
|
-
Expander: ElementType;
|
|
63
|
-
Creator: ElementType;
|
|
64
|
-
};
|
|
65
62
|
export {};
|
package/dist/Button.types.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Props as ButtonProps } from '../Button.types';
|
|
2
|
-
type ButtonPropsOmitted = Omit<ButtonProps, 'type' | 'block' | 'color' | 'groupVariant' | 'icon' | 'iconColor' | '
|
|
2
|
+
type ButtonPropsOmitted = Omit<ButtonProps, 'type' | 'block' | 'color' | 'groupVariant' | 'icon' | 'iconColor' | 'mode' | 'size' | 'onChange'>;
|
|
3
3
|
export type CheckboxButtonProps = ButtonPropsOmitted & {
|
|
4
4
|
checked?: boolean;
|
|
5
5
|
defaultChecked?: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type CreatorProps } from './Creator.types';
|
|
3
|
-
declare const Creator:
|
|
3
|
+
declare const Creator: React.ForwardRefExoticComponent<Omit<CreatorProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
4
4
|
export default Creator;
|
package/dist/Creator/Creator.js
CHANGED
|
@@ -2,10 +2,10 @@ var _excluded = ["onClick", "disabled", "label", "block", "status", "className",
|
|
|
2
2
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
3
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
4
4
|
import classnames from 'classnames';
|
|
5
|
-
import React, { useCallback, useState } from 'react';
|
|
5
|
+
import React, { forwardRef, useCallback, useState } from 'react';
|
|
6
6
|
import Icon, { AddM } from '@synerise/ds-icon';
|
|
7
7
|
import * as S from './Creator.styles';
|
|
8
|
-
var Creator = function
|
|
8
|
+
var Creator = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
9
9
|
var onClick = _ref.onClick,
|
|
10
10
|
disabled = _ref.disabled,
|
|
11
11
|
label = _ref.label,
|
|
@@ -25,6 +25,7 @@ var Creator = function Creator(_ref) {
|
|
|
25
25
|
setPressed(false);
|
|
26
26
|
}, []);
|
|
27
27
|
return /*#__PURE__*/React.createElement(S.Creator, _extends({
|
|
28
|
+
ref: ref,
|
|
28
29
|
block: block,
|
|
29
30
|
labelAlign: labelAlign,
|
|
30
31
|
className: classnames([className, 'ds-button-creator']),
|
|
@@ -41,5 +42,5 @@ var Creator = function Creator(_ref) {
|
|
|
41
42
|
}), label && /*#__PURE__*/React.createElement(S.CreatorLabel, {
|
|
42
43
|
"data-testid": "ds-add-button-label"
|
|
43
44
|
}, label)));
|
|
44
|
-
};
|
|
45
|
+
});
|
|
45
46
|
export default Creator;
|
|
@@ -1,7 +1,32 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export declare const CreatorLabel: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
3
|
-
|
|
3
|
+
type StyledCreatorProps = {
|
|
4
4
|
withLabel: boolean;
|
|
5
5
|
pressed: boolean;
|
|
6
|
-
status
|
|
7
|
-
|
|
6
|
+
status?: string;
|
|
7
|
+
labelAlign: 'left' | 'center';
|
|
8
|
+
};
|
|
9
|
+
export declare const Creator: import("styled-components").StyledComponent<React.ForwardRefExoticComponent<Omit<Partial<{
|
|
10
|
+
href: string;
|
|
11
|
+
target?: string;
|
|
12
|
+
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
13
|
+
} & import("antd/lib/button/button").BaseButtonProps & Omit<React.AnchorHTMLAttributes<any>, "type" | "onClick"> & {
|
|
14
|
+
htmlType?: import("antd/lib/button/button").ButtonHTMLType;
|
|
15
|
+
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
16
|
+
} & Omit<React.ButtonHTMLAttributes<any>, "type" | "onClick">>, "ghost" | "type"> & {
|
|
17
|
+
type?: import("@synerise/ds-utils").LiteralStringUnion<import("Button.types").ButtonType>;
|
|
18
|
+
mode?: import("@synerise/ds-utils").LiteralStringUnion<"single-icon" | "split" | "two-icons" | "label-icon" | "icon-label">;
|
|
19
|
+
color?: import("@synerise/ds-utils").LiteralStringUnion<"blue" | "grey" | "red" | "green" | "yellow" | "pink" | "mars" | "orange" | "fern" | "cyan" | "purple" | "violet">;
|
|
20
|
+
groupVariant?: import("@synerise/ds-utils").LiteralStringUnion<"left-rounded" | "squared" | "right-rounded">;
|
|
21
|
+
justifyContent?: import("csstype").JustifyContentProperty;
|
|
22
|
+
loading?: boolean | {
|
|
23
|
+
delay?: number;
|
|
24
|
+
};
|
|
25
|
+
onClick?: (event: React.MouseEvent<HTMLElement>) => void;
|
|
26
|
+
iconColor?: import("@synerise/ds-utils").LiteralStringUnion<"blue" | "grey" | "red" | "green" | "yellow" | "pink" | "mars" | "orange" | "fern" | "cyan" | "purple" | "violet">;
|
|
27
|
+
error?: boolean;
|
|
28
|
+
readOnly?: boolean;
|
|
29
|
+
tagProps?: import("@synerise/ds-tag").TagProps;
|
|
30
|
+
tooltipProps?: import("@synerise/ds-tooltip").TooltipProps;
|
|
31
|
+
} & StyledCreatorProps & React.RefAttributes<HTMLButtonElement>>, any, StyledCreatorProps, never>;
|
|
32
|
+
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
var _excluded = ["status", "pressed", "withLabel"];
|
|
2
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
3
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
3
|
-
import React from 'react';
|
|
4
|
+
import React, { forwardRef } from 'react';
|
|
4
5
|
import styled, { css } from 'styled-components';
|
|
5
6
|
import { IconContainer } from '@synerise/ds-icon';
|
|
6
7
|
import { hexToRgba } from '@synerise/ds-utils';
|
|
@@ -21,13 +22,15 @@ var uploadStyles = function uploadStyles(_ref2) {
|
|
|
21
22
|
var theme = _ref2.theme;
|
|
22
23
|
return css(["&{border:1px dashed ", ";background-color:", ";", "{svg{transition:all 0.3s ease;fill:", ";}}&:hover:not(:disabled){", "{svg{fill:", " !important;}}", "{color:", ";}}", "{color:", ";}&:hover:not(:disabled):not(:focus){border:1px dashed ", ";background-color:", ";}&:focus:active{border:1px dashed ", ";background-color:", ";box-shadow:none;}&:focus{border:1px dashed ", ";box-shadow:none;}&:disabled{", "{margin:12px;svg{transition:all 0.3s ease;color:", ";fill:", ";}}", "{color:", ";}}}"], theme.palette['blue-300'], theme.palette['blue-050'], IconContainer, theme.palette['blue-500'], IconContainer, theme.palette['blue-500'], CreatorLabel, theme.palette['blue-500'], CreatorLabel, theme.palette['blue-500'], theme.palette['blue-300'], theme.palette['blue-050'], theme.palette['blue-600'], theme.palette['blue-050'], theme.palette['blue-600'], IconContainer, theme.palette['grey-500'], theme.palette['grey-500'], CreatorLabel, theme.palette['grey-500']);
|
|
23
24
|
};
|
|
24
|
-
export var Creator = styled(function (_ref3) {
|
|
25
|
+
export var Creator = styled(/*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
25
26
|
var status = _ref3.status,
|
|
26
27
|
pressed = _ref3.pressed,
|
|
27
28
|
withLabel = _ref3.withLabel,
|
|
28
29
|
rest = _objectWithoutPropertiesLoose(_ref3, _excluded);
|
|
29
|
-
return /*#__PURE__*/React.createElement(Button,
|
|
30
|
-
|
|
30
|
+
return /*#__PURE__*/React.createElement(Button, _extends({
|
|
31
|
+
ref: ref
|
|
32
|
+
}, rest));
|
|
33
|
+
})).withConfig({
|
|
31
34
|
displayName: "Creatorstyles__Creator",
|
|
32
35
|
componentId: "sc-1w96u6h-1"
|
|
33
36
|
})(["&&&{width:", ";opacity:", ";height:48px;padding:", ";border-radius:3px;border:1px dashed ", ";background:transparent;transition:all 0.3s ease;justify-content:", ";align-items:center;&.ant-btn{& .ds-button-label{justify-content:", ";}}&.ant-btn > span{display:flex;align-items:center;}", "{margin:auto 12px;svg{transition:all 0.3s ease;color:", ";fill:", ";}}", "{background-color:", ";}", "{display:none;}&:hover:not(:disabled){", "{svg{color:", " !important;fill:", " !important;}}", "{color:", ";}}&:hover:not(:disabled):not(:focus){border:1px dashed ", ";background-color:", ";}", " &:focus:active{border:1px dashed ", " !important;box-shadow:none;background-color:", ";}&:focus{border:1px dashed ", ";box-shadow:none;}&:disabled{border-color:", ";background-color:", ";}", " ", "}"], function (props) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { MouseEvent, ReactNode } from 'react';
|
|
1
|
+
import type { MouseEvent, ReactNode, RefObject } from 'react';
|
|
2
2
|
import type { WithHTMLAttributes } from '@synerise/ds-utils';
|
|
3
3
|
export declare enum CreatorStatus {
|
|
4
4
|
Default = "default",
|
|
@@ -13,4 +13,5 @@ export type CreatorProps = WithHTMLAttributes<HTMLButtonElement, {
|
|
|
13
13
|
labelAlign?: 'left' | 'center';
|
|
14
14
|
status?: CreatorStatus;
|
|
15
15
|
className?: string;
|
|
16
|
+
ref?: RefObject<HTMLDivElement>;
|
|
16
17
|
}>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Props as ButtonProps } from '../Button.types';
|
|
2
|
-
type ButtonPropsOmitted = Omit<ButtonProps, 'type' | 'block' | 'color' | 'groupVariant' | 'icon' | 'iconColor' | '
|
|
2
|
+
type ButtonPropsOmitted = Omit<ButtonProps, 'type' | 'block' | 'color' | 'groupVariant' | 'icon' | 'iconColor' | 'mode' | 'size' | 'onChange'>;
|
|
3
3
|
export type StarButtonProps = ButtonPropsOmitted & {
|
|
4
4
|
active?: boolean;
|
|
5
5
|
hasError?: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,18 +1,14 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import * as MainButtonStyles from './Button.styles';
|
|
3
2
|
import { type Props } from './Button.types';
|
|
3
|
+
import CheckboxButton from './Checkbox/Checkbox';
|
|
4
4
|
import * as CheckboxStyles from './Checkbox/Checkbox.styles';
|
|
5
|
+
import Creator from './Creator/Creator';
|
|
5
6
|
import * as CreatorStyles from './Creator/Creator.styles';
|
|
7
|
+
import Expander from './Expander/Expander';
|
|
6
8
|
import * as ExpanderStyles from './Expander/Expander.styles';
|
|
9
|
+
import StarButton from './Star/Star';
|
|
7
10
|
import * as StarStyles from './Star/Star.styles';
|
|
8
|
-
|
|
9
|
-
static readonly Checkbox: (props: import("./Checkbox/Checkbox.types").CheckboxButtonProps) => React.ReactElement;
|
|
10
|
-
static readonly Creator: ({ onClick, disabled, label, block, status, className, labelAlign, ...htmlAttributes }: import("./Creator/Creator.types").CreatorProps) => React.JSX.Element;
|
|
11
|
-
static readonly Expander: ({ size, expanded, disabled, onClick, className, }: import("./Expander/Expander.types").ExpanderProps) => React.JSX.Element;
|
|
12
|
-
static readonly Star: (props: import("./Star/Star.types").StarButtonProps) => React.ReactElement;
|
|
13
|
-
render(): React.JSX.Element;
|
|
14
|
-
}
|
|
15
|
-
export default Button;
|
|
11
|
+
export { Expander, Creator, StarButton as Star, CheckboxButton as Checkbox };
|
|
16
12
|
export { default as ButtonToggle } from './ButtonToggle/ButtonToggle';
|
|
17
13
|
export type { ButtonToggleProps } from './ButtonToggle/ButtonToggle.types';
|
|
18
14
|
export { type CreatorProps, CreatorStatus } from './Creator/Creator.types';
|
|
@@ -27,3 +23,36 @@ export declare const ButtonStyles: {
|
|
|
27
23
|
Expander: typeof ExpanderStyles;
|
|
28
24
|
Star: typeof StarStyles;
|
|
29
25
|
};
|
|
26
|
+
declare const _default: import("react").ForwardRefExoticComponent<Omit<Partial<{
|
|
27
|
+
href: string;
|
|
28
|
+
target?: string;
|
|
29
|
+
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
30
|
+
} & import("antd/lib/button/button").BaseButtonProps & Omit<import("react").AnchorHTMLAttributes<any>, "type" | "onClick"> & {
|
|
31
|
+
htmlType?: import("antd/lib/button/button").ButtonHTMLType;
|
|
32
|
+
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
33
|
+
} & Omit<import("react").ButtonHTMLAttributes<any>, "type" | "onClick">>, "ghost" | "type"> & {
|
|
34
|
+
type?: import("@synerise/ds-utils").LiteralStringUnion<import("./Button.types").ButtonType>;
|
|
35
|
+
mode?: import("@synerise/ds-utils").LiteralStringUnion<"single-icon" | "split" | "two-icons" | "label-icon" | "icon-label">;
|
|
36
|
+
color?: import("@synerise/ds-utils").LiteralStringUnion<"blue" | "grey" | "red" | "green" | "yellow" | "pink" | "mars" | "orange" | "fern" | "cyan" | "purple" | "violet">;
|
|
37
|
+
groupVariant?: import("@synerise/ds-utils").LiteralStringUnion<"left-rounded" | "squared" | "right-rounded">;
|
|
38
|
+
justifyContent?: import("csstype").JustifyContentProperty;
|
|
39
|
+
loading?: boolean | {
|
|
40
|
+
delay?: number;
|
|
41
|
+
};
|
|
42
|
+
onClick?: (event: import("react").MouseEvent<HTMLElement>) => void;
|
|
43
|
+
iconColor?: import("@synerise/ds-utils").LiteralStringUnion<"blue" | "grey" | "red" | "green" | "yellow" | "pink" | "mars" | "orange" | "fern" | "cyan" | "purple" | "violet">;
|
|
44
|
+
error?: boolean;
|
|
45
|
+
readOnly?: boolean;
|
|
46
|
+
tagProps?: import("@synerise/ds-tag").TagProps;
|
|
47
|
+
tooltipProps?: import("@synerise/ds-tooltip").TooltipProps;
|
|
48
|
+
} & import("react").RefAttributes<HTMLButtonElement>> & {
|
|
49
|
+
/** @deprecated - use named export `Creator` */
|
|
50
|
+
Creator: import("react").ForwardRefExoticComponent<Omit<import("./Creator/Creator.types").CreatorProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
51
|
+
/** @deprecated - use named export `Expander` */
|
|
52
|
+
Expander: ({ size, expanded, disabled, onClick, className, }: import("./Expander/Expander.types").ExpanderProps) => import("react").JSX.Element;
|
|
53
|
+
/** @deprecated - use named export `Star` */
|
|
54
|
+
Star: (props: import("./Star/Star.types").StarButtonProps) => React.ReactElement;
|
|
55
|
+
/** @deprecated - use named export `Checkbox` */
|
|
56
|
+
Checkbox: (props: import("./Checkbox/Checkbox.types").CheckboxButtonProps) => React.ReactElement;
|
|
57
|
+
};
|
|
58
|
+
export default _default;
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import MainButton from './Button';
|
|
1
|
+
import Button from './Button';
|
|
5
2
|
import * as MainButtonStyles from './Button.styles';
|
|
6
3
|
import CheckboxButton from './Checkbox/Checkbox';
|
|
7
4
|
import * as CheckboxStyles from './Checkbox/Checkbox.styles';
|
|
@@ -11,22 +8,7 @@ import Expander from './Expander/Expander';
|
|
|
11
8
|
import * as ExpanderStyles from './Expander/Expander.styles';
|
|
12
9
|
import StarButton from './Star/Star';
|
|
13
10
|
import * as StarStyles from './Star/Star.styles';
|
|
14
|
-
|
|
15
|
-
function Button() {
|
|
16
|
-
return _React$Component.apply(this, arguments) || this;
|
|
17
|
-
}
|
|
18
|
-
_inheritsLoose(Button, _React$Component);
|
|
19
|
-
var _proto = Button.prototype;
|
|
20
|
-
_proto.render = function render() {
|
|
21
|
-
return /*#__PURE__*/React.createElement(MainButton, this.props);
|
|
22
|
-
};
|
|
23
|
-
return Button;
|
|
24
|
-
}(React.Component);
|
|
25
|
-
Button.Checkbox = CheckboxButton;
|
|
26
|
-
Button.Creator = Creator;
|
|
27
|
-
Button.Expander = Expander;
|
|
28
|
-
Button.Star = StarButton;
|
|
29
|
-
export default Button;
|
|
11
|
+
export { Expander, Creator, StarButton as Star, CheckboxButton as Checkbox };
|
|
30
12
|
export { default as ButtonToggle } from './ButtonToggle/ButtonToggle';
|
|
31
13
|
export { CreatorStatus } from './Creator/Creator.types';
|
|
32
14
|
export { ExpanderSize } from './Expander/Expander.types';
|
|
@@ -36,4 +18,15 @@ export var ButtonStyles = {
|
|
|
36
18
|
Checkbox: CheckboxStyles,
|
|
37
19
|
Expander: ExpanderStyles,
|
|
38
20
|
Star: StarStyles
|
|
39
|
-
};
|
|
21
|
+
};
|
|
22
|
+
var staticComponents = {
|
|
23
|
+
/** @deprecated - use named export `Creator` */
|
|
24
|
+
Creator: Creator,
|
|
25
|
+
/** @deprecated - use named export `Expander` */
|
|
26
|
+
Expander: Expander,
|
|
27
|
+
/** @deprecated - use named export `Star` */
|
|
28
|
+
Star: StarButton,
|
|
29
|
+
/** @deprecated - use named export `Checkbox` */
|
|
30
|
+
Checkbox: CheckboxButton
|
|
31
|
+
};
|
|
32
|
+
export default Object.assign(Button, staticComponents);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-button",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "Button UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "synerise/synerise-design",
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
],
|
|
36
36
|
"types": "dist/index.d.ts",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@synerise/ds-icon": "^1.
|
|
39
|
-
"@synerise/ds-tag": "^1.
|
|
40
|
-
"@synerise/ds-tooltip": "^1.
|
|
38
|
+
"@synerise/ds-icon": "^1.8.0",
|
|
39
|
+
"@synerise/ds-tag": "^1.4.0",
|
|
40
|
+
"@synerise/ds-tooltip": "^1.3.0",
|
|
41
41
|
"@synerise/ds-utils": "^1.5.0",
|
|
42
42
|
"classnames": "^2.5.1",
|
|
43
43
|
"csstype": "^2.6.9"
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"react": ">=16.9.0 <= 18.3.1",
|
|
49
49
|
"styled-components": "^5.3.3"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "cbbb7d9f155735bcc4035d8fd8a7813878d6e051"
|
|
52
52
|
}
|