@synerise/ds-button 1.5.17 → 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 +4 -0
- package/dist/Button.d.ts +11 -13
- package/dist/Button.figma.js +39 -49
- 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 +8 -8
|
@@ -1,45 +1,49 @@
|
|
|
1
|
-
import styled from
|
|
2
|
-
import { CheckboxDeafultM, CheckboxM } from
|
|
3
|
-
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import { CheckboxDeafultM, CheckboxM } from "@synerise/ds-icon";
|
|
3
|
+
const IconWrapper = /* @__PURE__ */ styled.span.withConfig({
|
|
4
4
|
displayName: "Checkboxstyles__IconWrapper",
|
|
5
5
|
componentId: "sc-ssgaoj-0"
|
|
6
|
-
})(["&&&&{color:", ";svg{fill:", ";}}.ant-btn[disabled] & .ds-icon svg{fill:", " !important;}.ant-btn:hover & .ds-icon svg,.ant-btn:focus:hover & .ds-icon svg{fill:", ";}.ds-button.ant-btn &::before{content:'';display:'block';position:absolute;bottom:0;left:0;right:0;top:0;margin:5px;z-index:-1;}.ds-button.ant-btn &::before,.ds-button.ant-btn:hover &::before,.ds-button.ant-btn:focus:hover &::before{background:", ";}.ds-button.ant-btn[disabled] &::before,.ds-button.ant-btn[disabled]:hover &::before{background:", ";}"],
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
})(["&&&&{color:", ";svg{fill:", ";}}.ant-btn[disabled] & .ds-icon svg{fill:", " !important;}.ant-btn:hover & .ds-icon svg,.ant-btn:focus:hover & .ds-icon svg{fill:", ";}.ds-button.ant-btn &::before{content:'';display:'block';position:absolute;bottom:0;left:0;right:0;top:0;margin:5px;z-index:-1;}.ds-button.ant-btn &::before,.ds-button.ant-btn:hover &::before,.ds-button.ant-btn:focus:hover &::before{background:", ";}.ds-button.ant-btn[disabled] &::before,.ds-button.ant-btn[disabled]:hover &::before{background:", ";}"], ({
|
|
7
|
+
theme,
|
|
8
|
+
active,
|
|
9
|
+
error
|
|
10
|
+
}) => {
|
|
10
11
|
if (error) {
|
|
11
|
-
return theme.palette[
|
|
12
|
+
return theme.palette["red-600"];
|
|
12
13
|
}
|
|
13
|
-
return active ? theme.palette[
|
|
14
|
-
},
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
return active ? theme.palette["blue-600"] : theme.palette["grey-300"];
|
|
15
|
+
}, ({
|
|
16
|
+
theme,
|
|
17
|
+
active,
|
|
18
|
+
error
|
|
19
|
+
}) => {
|
|
18
20
|
if (error) {
|
|
19
|
-
return theme.palette[
|
|
21
|
+
return theme.palette["red-600"];
|
|
20
22
|
}
|
|
21
|
-
return active ? theme.palette[
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
var theme = _ref6.theme;
|
|
33
|
-
return theme.palette['grey-050'];
|
|
34
|
-
});
|
|
35
|
-
export var DefaultIcon = styled(CheckboxDeafultM).withConfig({
|
|
23
|
+
return active ? theme.palette["blue-600"] : theme.palette["grey-300"];
|
|
24
|
+
}, ({
|
|
25
|
+
theme
|
|
26
|
+
}) => theme.palette["grey-200"], ({
|
|
27
|
+
theme
|
|
28
|
+
}) => theme.palette["blue-600"], ({
|
|
29
|
+
theme
|
|
30
|
+
}) => theme.palette.white, ({
|
|
31
|
+
theme
|
|
32
|
+
}) => theme.palette["grey-050"]);
|
|
33
|
+
const DefaultIcon = /* @__PURE__ */ styled(CheckboxDeafultM).withConfig({
|
|
36
34
|
displayName: "Checkboxstyles__DefaultIcon",
|
|
37
35
|
componentId: "sc-ssgaoj-1"
|
|
38
36
|
})(["display:block;.ds-button.ant-btn:not([disabled]):hover &{display:none;}"]);
|
|
39
|
-
|
|
37
|
+
const HoverIcon = /* @__PURE__ */ styled(CheckboxM).withConfig({
|
|
40
38
|
displayName: "Checkboxstyles__HoverIcon",
|
|
41
39
|
componentId: "sc-ssgaoj-2"
|
|
42
40
|
})(["display:none;.ds-button.ant-btn:not([disabled]):hover &{display:block;}"]);
|
|
43
|
-
|
|
44
|
-
IconWrapper
|
|
45
|
-
};
|
|
41
|
+
const Checkbox_styles = {
|
|
42
|
+
IconWrapper
|
|
43
|
+
};
|
|
44
|
+
export {
|
|
45
|
+
DefaultIcon,
|
|
46
|
+
HoverIcon,
|
|
47
|
+
IconWrapper,
|
|
48
|
+
Checkbox_styles as default
|
|
49
|
+
};
|
|
@@ -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 CheckboxButtonProps = ButtonPropsOmitted & {
|
|
4
4
|
checked?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { CreatorProps } from './Creator.types';
|
|
3
3
|
declare const Creator: React.ForwardRefExoticComponent<Omit<CreatorProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
4
4
|
export default Creator;
|
package/dist/Creator/Creator.js
CHANGED
|
@@ -1,46 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var _useState = useState(false),
|
|
19
|
-
pressed = _useState[0],
|
|
20
|
-
setPressed = _useState[1];
|
|
21
|
-
var onPress = useCallback(function () {
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import classnames from "classnames";
|
|
3
|
+
import { forwardRef, useState, useCallback } from "react";
|
|
4
|
+
import Icon, { AddM } from "@synerise/ds-icon";
|
|
5
|
+
import { Creator as Creator$1, CreatorLabel } from "./Creator.styles.js";
|
|
6
|
+
const Creator = forwardRef(({
|
|
7
|
+
onClick,
|
|
8
|
+
disabled,
|
|
9
|
+
label,
|
|
10
|
+
block,
|
|
11
|
+
status,
|
|
12
|
+
className,
|
|
13
|
+
labelAlign = "center",
|
|
14
|
+
...htmlAttributes
|
|
15
|
+
}, ref) => {
|
|
16
|
+
const [pressed, setPressed] = useState(false);
|
|
17
|
+
const onPress = useCallback(() => {
|
|
22
18
|
setPressed(true);
|
|
23
19
|
}, []);
|
|
24
|
-
|
|
20
|
+
const onRelease = useCallback(() => {
|
|
25
21
|
setPressed(false);
|
|
26
22
|
}, []);
|
|
27
|
-
return
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
className: classnames([className, 'ds-button-creator']),
|
|
32
|
-
disabled: disabled,
|
|
33
|
-
onClick: onClick,
|
|
34
|
-
onMouseDown: onPress,
|
|
35
|
-
onMouseUp: onRelease,
|
|
36
|
-
onMouseLeave: onRelease,
|
|
37
|
-
withLabel: Boolean(label),
|
|
38
|
-
pressed: pressed,
|
|
39
|
-
status: status
|
|
40
|
-
}, htmlAttributes), /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Icon, {
|
|
41
|
-
component: /*#__PURE__*/React.createElement(AddM, null)
|
|
42
|
-
}), label && /*#__PURE__*/React.createElement(S.CreatorLabel, {
|
|
43
|
-
"data-testid": "ds-add-button-label"
|
|
44
|
-
}, label)));
|
|
23
|
+
return /* @__PURE__ */ jsx(Creator$1, { ref, block, labelAlign, className: classnames([className, "ds-button-creator"]), disabled, onClick, onMouseDown: onPress, onMouseUp: onRelease, onMouseLeave: onRelease, withLabel: Boolean(label), pressed, status, ...htmlAttributes, children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
24
|
+
/* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(AddM, {}) }),
|
|
25
|
+
label && /* @__PURE__ */ jsx(CreatorLabel, { "data-testid": "ds-add-button-label", children: label })
|
|
26
|
+
] }) });
|
|
45
27
|
});
|
|
46
|
-
export
|
|
28
|
+
export {
|
|
29
|
+
Creator as default
|
|
30
|
+
};
|
|
@@ -1,32 +1,10 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export declare const CreatorLabel: import(
|
|
1
|
+
import { default as React } from 'react';
|
|
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
6
|
status?: string;
|
|
7
7
|
labelAlign: 'left' | 'center';
|
|
8
8
|
};
|
|
9
|
-
export declare const Creator: import(
|
|
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>;
|
|
9
|
+
export declare const Creator: import('styled-components').StyledComponent<React.ForwardRefExoticComponent<any>, any, StyledCreatorProps, never>;
|
|
32
10
|
export {};
|
|
@@ -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>;
|