@synerise/ds-button 1.5.16 → 1.5.18
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 +8 -0
- package/README.md +5 -2
- package/dist/Button.d.ts +11 -13
- package/dist/Button.figma.d.ts +1 -0
- package/dist/Button.figma.js +56 -0
- package/dist/Button.js +72 -96
- package/dist/Button.styles.d.ts +14 -14
- package/dist/Button.styles.js +56 -105
- package/dist/Button.types.d.ts +7 -7
- package/dist/Button.types.js +11 -10
- package/dist/ButtonToggle/ButtonToggle.d.ts +2 -2
- package/dist/ButtonToggle/ButtonToggle.js +21 -25
- package/dist/ButtonToggle/ButtonToggle.styles.d.ts +2 -2
- package/dist/ButtonToggle/ButtonToggle.styles.js +14 -14
- package/dist/ButtonToggle/ButtonToggle.types.d.ts +1 -1
- package/dist/ButtonToggle/ButtonToggle.types.js +1 -1
- package/dist/Checkbox/Checkbox.d.ts +2 -2
- package/dist/Checkbox/Checkbox.js +43 -55
- package/dist/Checkbox/Checkbox.styles.d.ts +4 -4
- package/dist/Checkbox/Checkbox.styles.js +37 -33
- package/dist/Checkbox/Checkbox.types.d.ts +1 -1
- package/dist/Checkbox/Checkbox.types.js +1 -1
- package/dist/Creator/Creator.d.ts +2 -2
- package/dist/Creator/Creator.js +25 -41
- package/dist/Creator/Creator.styles.d.ts +3 -25
- package/dist/Creator/Creator.styles.js +37 -81
- package/dist/Creator/Creator.types.d.ts +2 -2
- package/dist/Creator/Creator.types.js +9 -6
- package/dist/Expander/Expander.d.ts +2 -2
- package/dist/Expander/Expander.js +16 -22
- package/dist/Expander/Expander.styles.d.ts +4 -4
- package/dist/Expander/Expander.styles.js +19 -38
- package/dist/Expander/Expander.types.js +8 -5
- package/dist/Star/Star.d.ts +2 -2
- package/dist/Star/Star.js +17 -29
- package/dist/Star/Star.styles.d.ts +2 -2
- package/dist/Star/Star.styles.js +25 -24
- package/dist/Star/Star.types.d.ts +1 -1
- package/dist/Star/Star.types.js +1 -1
- package/dist/assets/style/index-tn0RQdqM.css +0 -0
- package/dist/index.d.ts +22 -22
- package/dist/index.js +34 -24
- package/dist/modules.d.js +1 -1
- package/dist/modules.d.ts +0 -0
- package/package.json +10 -10
|
@@ -1,89 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
import { CreatorStatus } from './Creator.types';
|
|
11
|
-
export var CreatorLabel = styled.span.withConfig({
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import styled, { css } from "styled-components";
|
|
4
|
+
import { IconContainer } from "@synerise/ds-icon";
|
|
5
|
+
import { hexToRgba } from "@synerise/ds-utils";
|
|
6
|
+
import Button from "../Button.js";
|
|
7
|
+
import { RippleEffect, ButtonFocus } from "../Button.styles.js";
|
|
8
|
+
import { CreatorStatus } from "./Creator.types.js";
|
|
9
|
+
const CreatorLabel = /* @__PURE__ */ styled.span.withConfig({
|
|
12
10
|
displayName: "Creatorstyles__CreatorLabel",
|
|
13
11
|
componentId: "sc-1w96u6h-0"
|
|
14
|
-
})(["&&{margin:0 12px 0 0;transition:all 0.3s ease;color:", ";}"],
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
pressed = _ref3.pressed,
|
|
28
|
-
withLabel = _ref3.withLabel,
|
|
29
|
-
rest = _objectWithoutPropertiesLoose(_ref3, _excluded);
|
|
30
|
-
return /*#__PURE__*/React.createElement(Button, _extends({
|
|
31
|
-
ref: ref
|
|
32
|
-
}, rest));
|
|
33
|
-
})).withConfig({
|
|
12
|
+
})(["&&{margin:0 12px 0 0;transition:all 0.3s ease;color:", ";}"], (props) => props.theme.palette["grey-500"]);
|
|
13
|
+
const errorStyles = ({
|
|
14
|
+
theme
|
|
15
|
+
}) => css(["border:1px dashed ", ";background:", ";&:focus{background:", ";}&:hover:not(:disabled):not(:focus){border:1px dashed ", ";background:", ";}"], theme.palette["red-600"], theme.palette["red-050"], theme.palette.white, theme.palette["grey-400"], theme.palette.white);
|
|
16
|
+
const uploadStyles = ({
|
|
17
|
+
theme
|
|
18
|
+
}) => 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"]);
|
|
19
|
+
const Creator = /* @__PURE__ */ styled(forwardRef(({
|
|
20
|
+
status,
|
|
21
|
+
pressed,
|
|
22
|
+
withLabel,
|
|
23
|
+
...rest
|
|
24
|
+
}, ref) => /* @__PURE__ */ jsx(Button, { ref, ...rest }))).withConfig({
|
|
34
25
|
displayName: "Creatorstyles__Creator",
|
|
35
26
|
componentId: "sc-1w96u6h-1"
|
|
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:", ";}", " ", "}"],
|
|
27
|
+
})(["&&&{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:", ";}", " ", "}"], (props) => {
|
|
37
28
|
if (!props.withLabel) {
|
|
38
|
-
return
|
|
29
|
+
return "48px";
|
|
39
30
|
}
|
|
40
31
|
if (props.block) {
|
|
41
|
-
return
|
|
32
|
+
return "100%";
|
|
42
33
|
}
|
|
43
|
-
return
|
|
44
|
-
},
|
|
45
|
-
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}, IconContainer, function (props) {
|
|
56
|
-
return props.theme.palette['grey-500'];
|
|
57
|
-
}, function (props) {
|
|
58
|
-
return props.theme.palette['grey-500'];
|
|
59
|
-
}, RippleEffect, function (props) {
|
|
60
|
-
return props.theme.palette['grey-050'];
|
|
61
|
-
}, ButtonFocus, IconContainer, function (props) {
|
|
62
|
-
return props.theme.palette['grey-600'];
|
|
63
|
-
}, function (props) {
|
|
64
|
-
return props.theme.palette['grey-600'];
|
|
65
|
-
}, CreatorLabel, function (props) {
|
|
66
|
-
return props.theme.palette['grey-600'];
|
|
67
|
-
}, function (_ref5) {
|
|
68
|
-
var theme = _ref5.theme;
|
|
69
|
-
return theme.palette['grey-400'];
|
|
70
|
-
}, function (_ref6) {
|
|
71
|
-
var theme = _ref6.theme;
|
|
72
|
-
return hexToRgba(theme.palette['grey-200'], 0.25);
|
|
73
|
-
}, function (props) {
|
|
74
|
-
return props.pressed && "&&{ background-color: " + hexToRgba(props.theme.palette['grey-200'], 0.4) + "; }";
|
|
75
|
-
}, function (props) {
|
|
76
|
-
return props.theme.palette['grey-400'];
|
|
77
|
-
}, function (props) {
|
|
78
|
-
return props.theme.palette['grey-050'];
|
|
79
|
-
}, function (props) {
|
|
80
|
-
return props.theme.palette['blue-600'];
|
|
81
|
-
}, function (props) {
|
|
82
|
-
return props.theme.palette['grey-300'];
|
|
83
|
-
}, function (props) {
|
|
84
|
-
return props.theme.palette['grey-050'];
|
|
85
|
-
}, function (props) {
|
|
86
|
-
return props.status === CreatorStatus.Error && errorStyles(props);
|
|
87
|
-
}, function (props) {
|
|
88
|
-
return props.status === CreatorStatus.Upload && uploadStyles(props);
|
|
89
|
-
});
|
|
34
|
+
return "auto";
|
|
35
|
+
}, (props) => props.disabled ? `0.4` : "1", (props) => props.withLabel ? `0 12px 0 0` : "0", ({
|
|
36
|
+
theme
|
|
37
|
+
}) => theme.palette["grey-300"], (props) => props.withLabel && !props.block ? `flex-start` : "center", (props) => props.labelAlign === "center" ? "center" : "flex-start", IconContainer, (props) => props.theme.palette["grey-500"], (props) => props.theme.palette["grey-500"], RippleEffect, (props) => props.theme.palette["grey-050"], ButtonFocus, IconContainer, (props) => props.theme.palette["grey-600"], (props) => props.theme.palette["grey-600"], CreatorLabel, (props) => props.theme.palette["grey-600"], ({
|
|
38
|
+
theme
|
|
39
|
+
}) => theme.palette["grey-400"], ({
|
|
40
|
+
theme
|
|
41
|
+
}) => hexToRgba(theme.palette["grey-200"], 0.25), (props) => props.pressed && `&&{ background-color: ${hexToRgba(props.theme.palette["grey-200"], 0.4)}; }`, (props) => props.theme.palette["grey-400"], (props) => props.theme.palette["grey-050"], (props) => props.theme.palette["blue-600"], (props) => props.theme.palette["grey-300"], (props) => props.theme.palette["grey-050"], (props) => props.status === CreatorStatus.Error && errorStyles(props), (props) => props.status === CreatorStatus.Upload && uploadStyles(props));
|
|
42
|
+
export {
|
|
43
|
+
Creator,
|
|
44
|
+
CreatorLabel
|
|
45
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { MouseEvent, ReactNode, RefObject } from 'react';
|
|
2
|
+
import { WithHTMLAttributes } from '@synerise/ds-utils';
|
|
3
3
|
export declare enum CreatorStatus {
|
|
4
4
|
Default = "default",
|
|
5
5
|
Error = "error",
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
return
|
|
6
|
-
}({});
|
|
1
|
+
var CreatorStatus = /* @__PURE__ */ ((CreatorStatus2) => {
|
|
2
|
+
CreatorStatus2["Default"] = "default";
|
|
3
|
+
CreatorStatus2["Error"] = "error";
|
|
4
|
+
CreatorStatus2["Upload"] = "upload";
|
|
5
|
+
return CreatorStatus2;
|
|
6
|
+
})(CreatorStatus || {});
|
|
7
|
+
export {
|
|
8
|
+
CreatorStatus
|
|
9
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ExpanderProps } from './Expander.types';
|
|
3
3
|
declare const Expander: ({ size, expanded, disabled, onClick, className, }: ExpanderProps) => React.JSX.Element;
|
|
4
4
|
export default Expander;
|
|
@@ -1,23 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import Icon, { AngleDownS } from
|
|
4
|
-
import
|
|
5
|
-
import { ExpanderSize } from
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
expanded: expanded,
|
|
18
|
-
disabled: disabled
|
|
19
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
20
|
-
component: /*#__PURE__*/React.createElement(AngleDownS, null)
|
|
21
|
-
}));
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import classnames from "classnames";
|
|
3
|
+
import Icon, { AngleDownS } from "@synerise/ds-icon";
|
|
4
|
+
import { Expander as Expander$1 } from "./Expander.styles.js";
|
|
5
|
+
import { ExpanderSize } from "./Expander.types.js";
|
|
6
|
+
const Expander = ({
|
|
7
|
+
size = "S",
|
|
8
|
+
expanded,
|
|
9
|
+
disabled,
|
|
10
|
+
onClick,
|
|
11
|
+
className
|
|
12
|
+
}) => {
|
|
13
|
+
return /* @__PURE__ */ jsx(Expander$1, { onClick, size: ExpanderSize[size], className: classnames([className, "ds-expander"]), expanded, disabled, children: /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(AngleDownS, {}) }) });
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
Expander as default
|
|
22
17
|
};
|
|
23
|
-
export default Expander;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { Keyframes } from 'styled-components';
|
|
3
|
+
import { ThemeProps } from '@synerise/ds-core';
|
|
4
4
|
export type ExpanderProps = {
|
|
5
5
|
onClick: () => void;
|
|
6
6
|
size: number;
|
|
@@ -8,4 +8,4 @@ export type ExpanderProps = {
|
|
|
8
8
|
expanded: boolean;
|
|
9
9
|
};
|
|
10
10
|
export declare const focusAnimation: ({ theme }: ThemeProps) => Keyframes;
|
|
11
|
-
export declare const Expander: import(
|
|
11
|
+
export declare const Expander: import('styled-components').StyledComponent<({ children, expanded, size, ...rest }: any) => React.JSX.Element, any, {}, never>;
|
|
@@ -1,40 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
expanded = _ref2.expanded,
|
|
16
|
-
size = _ref2.size,
|
|
17
|
-
rest = _objectWithoutPropertiesLoose(_ref2, _excluded);
|
|
18
|
-
return /*#__PURE__*/React.createElement(Button, _extends({
|
|
19
|
-
mode: "single-icon"
|
|
20
|
-
}, rest), children);
|
|
21
|
-
}).withConfig({
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import styled, { css, keyframes } from "styled-components";
|
|
3
|
+
import { IconContainer } from "@synerise/ds-icon";
|
|
4
|
+
import Button from "../Button.js";
|
|
5
|
+
const focusAnimation = ({
|
|
6
|
+
theme
|
|
7
|
+
}) => keyframes(["0%{box-shadow:inset 0 0 0 1px inherit;}50%{box-shadow:inset 0 0 0 1px ", ";}100%{box-shadow:inset 0 0 0 1px inherit;}"], theme.palette["blue-600"]);
|
|
8
|
+
const SIZE_DEFAULT = 24;
|
|
9
|
+
const Expander = /* @__PURE__ */ styled(({
|
|
10
|
+
children,
|
|
11
|
+
expanded,
|
|
12
|
+
size,
|
|
13
|
+
...rest
|
|
14
|
+
}) => /* @__PURE__ */ jsx(Button, { mode: "single-icon", ...rest, children })).withConfig({
|
|
22
15
|
displayName: "Expanderstyles__Expander",
|
|
23
16
|
componentId: "sc-1a3xe1e-0"
|
|
24
|
-
})(["&&&{width:", "px;height:", "px;border-radius:50%;background-color:", ";", "{svg{opacity:", ";fill:", " !important;transition:transform 0.1s linear;transform:rotate( ", " );}}.btn-focus{box-shadow:inset 0 0 0 1px ", ";}", "}"],
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
return props.theme.palette['grey-050'];
|
|
30
|
-
}, IconContainer, function (props) {
|
|
31
|
-
return props.disabled ? "0.4" : "1";
|
|
32
|
-
}, function (props) {
|
|
33
|
-
return props.theme.palette['grey-600'];
|
|
34
|
-
}, function (props) {
|
|
35
|
-
return props.expanded ? '180deg' : '0deg';
|
|
36
|
-
}, function (props) {
|
|
37
|
-
return props.disabled ? props.theme.palette['grey-200'] : props.theme.palette['grey-300'];
|
|
38
|
-
}, function (props) {
|
|
39
|
-
return !props.disabled && css(["&:hover{.btn-focus{box-shadow:inset 0 0 0 1px ", ";}background-color:", ";}&:focus:not(:active){.btn-focus{animation:", " 1s ease-in-out 0s 1;}}"], props.theme.palette['grey-400'], props.theme.palette['grey-050'], focusAnimation(props));
|
|
40
|
-
});
|
|
17
|
+
})(["&&&{width:", "px;height:", "px;border-radius:50%;background-color:", ";", "{svg{opacity:", ";fill:", " !important;transition:transform 0.1s linear;transform:rotate( ", " );}}.btn-focus{box-shadow:inset 0 0 0 1px ", ";}", "}"], (props) => props.size || SIZE_DEFAULT, (props) => props.size || SIZE_DEFAULT, (props) => props.theme.palette["grey-050"], IconContainer, (props) => props.disabled ? `0.4` : `1`, (props) => props.theme.palette["grey-600"], (props) => props.expanded ? "180deg" : "0deg", (props) => props.disabled ? props.theme.palette["grey-200"] : props.theme.palette["grey-300"], (props) => !props.disabled && css(["&:hover{.btn-focus{box-shadow:inset 0 0 0 1px ", ";}background-color:", ";}&:focus:not(:active){.btn-focus{animation:", " 1s ease-in-out 0s 1;}}"], props.theme.palette["grey-400"], props.theme.palette["grey-050"], focusAnimation(props)));
|
|
18
|
+
export {
|
|
19
|
+
Expander,
|
|
20
|
+
focusAnimation
|
|
21
|
+
};
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
return
|
|
5
|
-
}({});
|
|
1
|
+
var ExpanderSize = /* @__PURE__ */ ((ExpanderSize2) => {
|
|
2
|
+
ExpanderSize2[ExpanderSize2["S"] = 24] = "S";
|
|
3
|
+
ExpanderSize2[ExpanderSize2["M"] = 32] = "M";
|
|
4
|
+
return ExpanderSize2;
|
|
5
|
+
})(ExpanderSize || {});
|
|
6
|
+
export {
|
|
7
|
+
ExpanderSize
|
|
8
|
+
};
|
package/dist/Star/Star.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { StarButtonProps } from './Star.types';
|
|
3
3
|
declare const StarButton: (props: StarButtonProps) => React.ReactElement;
|
|
4
4
|
export default StarButton;
|
package/dist/Star/Star.js
CHANGED
|
@@ -1,30 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
style: {
|
|
19
|
-
transition: 'none'
|
|
20
|
-
},
|
|
21
|
-
tabIndex: 0,
|
|
22
|
-
type: type
|
|
23
|
-
}, restProps), /*#__PURE__*/React.createElement(S.IconWrapper, {
|
|
24
|
-
active: active,
|
|
25
|
-
error: hasError
|
|
26
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
27
|
-
component: active ? /*#__PURE__*/React.createElement(StarFillM, null) : /*#__PURE__*/React.createElement(StarM, null)
|
|
28
|
-
})));
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import Icon, { StarFillM, StarM } from "@synerise/ds-icon";
|
|
3
|
+
import Button from "../Button.js";
|
|
4
|
+
import { IconWrapper } from "./Star.styles.js";
|
|
5
|
+
const StarButton = (props) => {
|
|
6
|
+
const {
|
|
7
|
+
hasError,
|
|
8
|
+
active,
|
|
9
|
+
type = "ghost",
|
|
10
|
+
...restProps
|
|
11
|
+
} = props;
|
|
12
|
+
return /* @__PURE__ */ jsx(Button, { "aria-pressed": !!active, mode: "single-icon", role: "button", style: {
|
|
13
|
+
transition: "none"
|
|
14
|
+
}, tabIndex: 0, type, ...restProps, children: /* @__PURE__ */ jsx(IconWrapper, { active, error: hasError, children: /* @__PURE__ */ jsx(Icon, { component: active ? /* @__PURE__ */ jsx(StarFillM, {}) : /* @__PURE__ */ jsx(StarM, {}) }) }) });
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
StarButton as default
|
|
29
18
|
};
|
|
30
|
-
export default StarButton;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export declare const IconWrapper: import(
|
|
1
|
+
export declare const IconWrapper: import('styled-components').StyledComponent<"span", any, {
|
|
2
2
|
active?: boolean;
|
|
3
3
|
error?: boolean;
|
|
4
4
|
}, never>;
|
|
5
5
|
declare const _default: {
|
|
6
|
-
IconWrapper: import(
|
|
6
|
+
IconWrapper: import('styled-components').StyledComponent<"span", any, {
|
|
7
7
|
active?: boolean;
|
|
8
8
|
error?: boolean;
|
|
9
9
|
}, never>;
|
package/dist/Star/Star.styles.js
CHANGED
|
@@ -1,28 +1,29 @@
|
|
|
1
|
-
import styled from
|
|
2
|
-
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
const IconWrapper = /* @__PURE__ */ styled.span.withConfig({
|
|
3
3
|
displayName: "Starstyles__IconWrapper",
|
|
4
4
|
componentId: "sc-k1qcv4-0"
|
|
5
|
-
})(["&&&& svg{fill:", ";}.ant-btn-ghost[disabled] & .ds-icon svg{fill:", " !important;}.ant-btn-ghost:hover & .ds-icon svg,.ant-btn-ghost:focus:hover & .ds-icon svg{fill:", ";}.ant-btn-ghost &::before{clip-path:path( 'M 19.606 9.598 l -4.794 -0.686 l -2.141 -4.276 a 0.781 0.781 0 0 0 -1.342 0 L 9.187 8.912 l -4.793 0.686 a 0.75 0.75 0 0 0 -0.414 1.284 l 3.462 3.325 l -0.817 4.691 a 0.751 0.751 0 0 0 0.74 0.88 a 0.742 0.742 0 0 0 0.344 -0.085 L 12 17.472 l 4.29 2.221 a 0.75 0.75 0 0 0 1.084 -0.795 l -0.816 -4.691 l 3.462 -3.325 a 0.75 0.75 0 0 0 -0.414 -1.284 z z' );content:'';position:absolute;bottom:0;left:0;right:0;top:0;margin:0;z-index:-1;}.ant-btn-ghost[disabled] &:before{background:", ";}.ant-btn-ghost &::before,.ant-btn-ghost:hover &:before,.ant-btn-ghost:focus:hover &:before{background:", ";}"],
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
})(["&&&& svg{fill:", ";}.ant-btn-ghost[disabled] & .ds-icon svg{fill:", " !important;}.ant-btn-ghost:hover & .ds-icon svg,.ant-btn-ghost:focus:hover & .ds-icon svg{fill:", ";}.ant-btn-ghost &::before{clip-path:path( 'M 19.606 9.598 l -4.794 -0.686 l -2.141 -4.276 a 0.781 0.781 0 0 0 -1.342 0 L 9.187 8.912 l -4.793 0.686 a 0.75 0.75 0 0 0 -0.414 1.284 l 3.462 3.325 l -0.817 4.691 a 0.751 0.751 0 0 0 0.74 0.88 a 0.742 0.742 0 0 0 0.344 -0.085 L 12 17.472 l 4.29 2.221 a 0.75 0.75 0 0 0 1.084 -0.795 l -0.816 -4.691 l 3.462 -3.325 a 0.75 0.75 0 0 0 -0.414 -1.284 z z' );content:'';position:absolute;bottom:0;left:0;right:0;top:0;margin:0;z-index:-1;}.ant-btn-ghost[disabled] &:before{background:", ";}.ant-btn-ghost &::before,.ant-btn-ghost:hover &:before,.ant-btn-ghost:focus:hover &:before{background:", ";}"], ({
|
|
6
|
+
theme,
|
|
7
|
+
active,
|
|
8
|
+
error
|
|
9
|
+
}) => {
|
|
9
10
|
if (error) {
|
|
10
|
-
return theme.palette[
|
|
11
|
+
return theme.palette["red-600"];
|
|
11
12
|
}
|
|
12
|
-
return active ? theme.palette[
|
|
13
|
-
},
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
};
|
|
13
|
+
return active ? theme.palette["yellow-600"] : theme.palette["grey-300"];
|
|
14
|
+
}, ({
|
|
15
|
+
theme
|
|
16
|
+
}) => theme.palette["grey-200"], ({
|
|
17
|
+
theme
|
|
18
|
+
}) => theme.palette["blue-600"], ({
|
|
19
|
+
theme
|
|
20
|
+
}) => theme.palette["grey-050"], ({
|
|
21
|
+
theme
|
|
22
|
+
}) => theme.palette.white);
|
|
23
|
+
const Star_styles = {
|
|
24
|
+
IconWrapper
|
|
25
|
+
};
|
|
26
|
+
export {
|
|
27
|
+
IconWrapper,
|
|
28
|
+
Star_styles as default
|
|
29
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Props as ButtonProps } from '../Button.types';
|
|
2
2
|
type ButtonPropsOmitted = Omit<ButtonProps, 'type' | 'block' | 'color' | 'groupVariant' | 'icon' | 'iconColor' | 'mode' | 'size' | 'onChange'>;
|
|
3
3
|
export type StarButtonProps = ButtonPropsOmitted & {
|
|
4
4
|
active?: boolean;
|
package/dist/Star/Star.types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
File without changes
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { default as CheckboxButton } from './Checkbox/Checkbox';
|
|
2
|
+
import { default as Creator } from './Creator/Creator';
|
|
3
|
+
import { default as Expander } from './Expander/Expander';
|
|
4
|
+
import { default as StarButton } from './Star/Star';
|
|
1
5
|
import * as MainButtonStyles from './Button.styles';
|
|
2
|
-
import CheckboxButton from './Checkbox/Checkbox';
|
|
3
6
|
import * as CheckboxStyles from './Checkbox/Checkbox.styles';
|
|
4
|
-
import Creator from './Creator/Creator';
|
|
5
7
|
import * as CreatorStyles from './Creator/Creator.styles';
|
|
6
|
-
import Expander from './Expander/Expander';
|
|
7
8
|
import * as ExpanderStyles from './Expander/Expander.styles';
|
|
8
|
-
import StarButton from './Star/Star';
|
|
9
9
|
import * as StarStyles from './Star/Star.styles';
|
|
10
10
|
export { Expander, Creator, StarButton as Star, CheckboxButton as Checkbox };
|
|
11
11
|
export { default as ButtonToggle } from './ButtonToggle/ButtonToggle';
|
|
@@ -22,36 +22,36 @@ export declare const ButtonStyles: {
|
|
|
22
22
|
Expander: typeof ExpanderStyles;
|
|
23
23
|
Star: typeof StarStyles;
|
|
24
24
|
};
|
|
25
|
-
declare const _default: import(
|
|
25
|
+
declare const _default: import('react').ForwardRefExoticComponent<Omit<Partial<{
|
|
26
26
|
href: string;
|
|
27
27
|
target?: string;
|
|
28
28
|
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
29
|
-
} & import(
|
|
30
|
-
htmlType?: import(
|
|
29
|
+
} & import('antd/lib/button/button').BaseButtonProps & Omit<import('react').AnchorHTMLAttributes<any>, "type" | "onClick"> & {
|
|
30
|
+
htmlType?: import('antd/lib/button/button').ButtonHTMLType;
|
|
31
31
|
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
32
|
-
} & Omit<import(
|
|
33
|
-
type?: import(
|
|
34
|
-
mode?: import(
|
|
35
|
-
color?: import(
|
|
36
|
-
groupVariant?: import(
|
|
37
|
-
justifyContent?: import(
|
|
32
|
+
} & Omit<import('react').ButtonHTMLAttributes<any>, "type" | "onClick">>, "ghost" | "type"> & {
|
|
33
|
+
type?: import('@synerise/ds-utils').LiteralStringUnion<import('./Button.types').ButtonType>;
|
|
34
|
+
mode?: import('@synerise/ds-utils').LiteralStringUnion<"single-icon" | "split" | "two-icons" | "label-icon" | "icon-label">;
|
|
35
|
+
color?: import('@synerise/ds-utils').LiteralStringUnion<"blue" | "grey" | "red" | "green" | "yellow" | "pink" | "mars" | "orange" | "fern" | "cyan" | "purple" | "violet">;
|
|
36
|
+
groupVariant?: import('@synerise/ds-utils').LiteralStringUnion<"left-rounded" | "squared" | "right-rounded">;
|
|
37
|
+
justifyContent?: import('csstype').JustifyContentProperty;
|
|
38
38
|
loading?: boolean | {
|
|
39
39
|
delay?: number;
|
|
40
40
|
};
|
|
41
|
-
onClick?: (event: import(
|
|
42
|
-
iconColor?: import(
|
|
41
|
+
onClick?: (event: import('react').MouseEvent<HTMLElement>) => void;
|
|
42
|
+
iconColor?: import('@synerise/ds-utils').LiteralStringUnion<"blue" | "grey" | "red" | "green" | "yellow" | "pink" | "mars" | "orange" | "fern" | "cyan" | "purple" | "violet">;
|
|
43
43
|
error?: boolean;
|
|
44
44
|
readOnly?: boolean;
|
|
45
|
-
tagProps?: import(
|
|
46
|
-
tooltipProps?: import(
|
|
47
|
-
} & import(
|
|
45
|
+
tagProps?: import('@synerise/ds-tag').TagProps;
|
|
46
|
+
tooltipProps?: import('@synerise/ds-tooltip').TooltipProps;
|
|
47
|
+
} & import('react').RefAttributes<HTMLButtonElement>> & {
|
|
48
48
|
/** @deprecated - use named export `Creator` */
|
|
49
|
-
Creator: import(
|
|
49
|
+
Creator: import('react').ForwardRefExoticComponent<Omit<import('./Creator/Creator.types').CreatorProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
|
|
50
50
|
/** @deprecated - use named export `Expander` */
|
|
51
|
-
Expander: ({ size, expanded, disabled, onClick, className, }: import(
|
|
51
|
+
Expander: ({ size, expanded, disabled, onClick, className, }: import('./Expander/Expander.types').ExpanderProps) => import("react").JSX.Element;
|
|
52
52
|
/** @deprecated - use named export `Star` */
|
|
53
|
-
Star: (props: import(
|
|
53
|
+
Star: (props: import('./Star/Star.types').StarButtonProps) => React.ReactElement;
|
|
54
54
|
/** @deprecated - use named export `Checkbox` */
|
|
55
|
-
Checkbox: (props: import(
|
|
55
|
+
Checkbox: (props: import('./Checkbox/Checkbox.types').CheckboxButtonProps) => React.ReactElement;
|
|
56
56
|
};
|
|
57
57
|
export default _default;
|
package/dist/index.js
CHANGED
|
@@ -1,32 +1,42 @@
|
|
|
1
|
-
import Button from
|
|
2
|
-
import * as
|
|
3
|
-
import CheckboxButton from
|
|
4
|
-
import * as
|
|
5
|
-
import Creator from
|
|
6
|
-
import * as
|
|
7
|
-
import Expander from
|
|
8
|
-
import * as
|
|
9
|
-
import StarButton from
|
|
10
|
-
import * as
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
Star: StarStyles
|
|
1
|
+
import Button from "./Button.js";
|
|
2
|
+
import * as Button_styles from "./Button.styles.js";
|
|
3
|
+
import CheckboxButton from "./Checkbox/Checkbox.js";
|
|
4
|
+
import * as Checkbox_Checkbox_styles from "./Checkbox/Checkbox.styles.js";
|
|
5
|
+
import Creator from "./Creator/Creator.js";
|
|
6
|
+
import * as Creator_Creator_styles from "./Creator/Creator.styles.js";
|
|
7
|
+
import Expander from "./Expander/Expander.js";
|
|
8
|
+
import * as Expander_Expander_styles from "./Expander/Expander.styles.js";
|
|
9
|
+
import StarButton from "./Star/Star.js";
|
|
10
|
+
import * as Star_Star_styles from "./Star/Star.styles.js";
|
|
11
|
+
import { default as default2 } from "./ButtonToggle/ButtonToggle.js";
|
|
12
|
+
import { CreatorStatus } from "./Creator/Creator.types.js";
|
|
13
|
+
import { ExpanderSize } from "./Expander/Expander.types.js";
|
|
14
|
+
const ButtonStyles = {
|
|
15
|
+
Button: Button_styles,
|
|
16
|
+
Creator: Creator_Creator_styles,
|
|
17
|
+
Checkbox: Checkbox_Checkbox_styles,
|
|
18
|
+
Expander: Expander_Expander_styles,
|
|
19
|
+
Star: Star_Star_styles
|
|
21
20
|
};
|
|
22
|
-
|
|
21
|
+
const staticComponents = {
|
|
23
22
|
/** @deprecated - use named export `Creator` */
|
|
24
|
-
Creator
|
|
23
|
+
Creator,
|
|
25
24
|
/** @deprecated - use named export `Expander` */
|
|
26
|
-
Expander
|
|
25
|
+
Expander,
|
|
27
26
|
/** @deprecated - use named export `Star` */
|
|
28
27
|
Star: StarButton,
|
|
29
28
|
/** @deprecated - use named export `Checkbox` */
|
|
30
29
|
Checkbox: CheckboxButton
|
|
31
30
|
};
|
|
32
|
-
|
|
31
|
+
const index = Object.assign(Button, staticComponents);
|
|
32
|
+
export {
|
|
33
|
+
ButtonStyles,
|
|
34
|
+
default2 as ButtonToggle,
|
|
35
|
+
CheckboxButton as Checkbox,
|
|
36
|
+
Creator,
|
|
37
|
+
CreatorStatus,
|
|
38
|
+
Expander,
|
|
39
|
+
ExpanderSize,
|
|
40
|
+
StarButton as Star,
|
|
41
|
+
index as default
|
|
42
|
+
};
|
package/dist/modules.d.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "@testing-library/jest-dom";
|
|
File without changes
|