@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.
Files changed (43) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/Button.d.ts +11 -13
  3. package/dist/Button.figma.js +39 -49
  4. package/dist/Button.js +72 -96
  5. package/dist/Button.styles.d.ts +14 -14
  6. package/dist/Button.styles.js +56 -105
  7. package/dist/Button.types.d.ts +7 -7
  8. package/dist/Button.types.js +11 -10
  9. package/dist/ButtonToggle/ButtonToggle.d.ts +2 -2
  10. package/dist/ButtonToggle/ButtonToggle.js +21 -25
  11. package/dist/ButtonToggle/ButtonToggle.styles.d.ts +2 -2
  12. package/dist/ButtonToggle/ButtonToggle.styles.js +14 -14
  13. package/dist/ButtonToggle/ButtonToggle.types.d.ts +1 -1
  14. package/dist/ButtonToggle/ButtonToggle.types.js +1 -1
  15. package/dist/Checkbox/Checkbox.d.ts +2 -2
  16. package/dist/Checkbox/Checkbox.js +43 -55
  17. package/dist/Checkbox/Checkbox.styles.d.ts +4 -4
  18. package/dist/Checkbox/Checkbox.styles.js +37 -33
  19. package/dist/Checkbox/Checkbox.types.d.ts +1 -1
  20. package/dist/Checkbox/Checkbox.types.js +1 -1
  21. package/dist/Creator/Creator.d.ts +2 -2
  22. package/dist/Creator/Creator.js +25 -41
  23. package/dist/Creator/Creator.styles.d.ts +3 -25
  24. package/dist/Creator/Creator.styles.js +37 -81
  25. package/dist/Creator/Creator.types.d.ts +2 -2
  26. package/dist/Creator/Creator.types.js +9 -6
  27. package/dist/Expander/Expander.d.ts +2 -2
  28. package/dist/Expander/Expander.js +16 -22
  29. package/dist/Expander/Expander.styles.d.ts +4 -4
  30. package/dist/Expander/Expander.styles.js +19 -38
  31. package/dist/Expander/Expander.types.js +8 -5
  32. package/dist/Star/Star.d.ts +2 -2
  33. package/dist/Star/Star.js +17 -29
  34. package/dist/Star/Star.styles.d.ts +2 -2
  35. package/dist/Star/Star.styles.js +25 -24
  36. package/dist/Star/Star.types.d.ts +1 -1
  37. package/dist/Star/Star.types.js +1 -1
  38. package/dist/assets/style/index-tn0RQdqM.css +0 -0
  39. package/dist/index.d.ts +22 -22
  40. package/dist/index.js +34 -24
  41. package/dist/modules.d.js +1 -1
  42. package/dist/modules.d.ts +0 -0
  43. package/package.json +8 -8
@@ -1,45 +1,49 @@
1
- import styled from 'styled-components';
2
- import { CheckboxDeafultM, CheckboxM } from '@synerise/ds-icon';
3
- export var IconWrapper = styled.span.withConfig({
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:", ";}"], function (_ref) {
7
- var theme = _ref.theme,
8
- active = _ref.active,
9
- error = _ref.error;
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['red-600'];
12
+ return theme.palette["red-600"];
12
13
  }
13
- return active ? theme.palette['blue-600'] : theme.palette['grey-300'];
14
- }, function (_ref2) {
15
- var theme = _ref2.theme,
16
- active = _ref2.active,
17
- error = _ref2.error;
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['red-600'];
21
+ return theme.palette["red-600"];
20
22
  }
21
- return active ? theme.palette['blue-600'] : theme.palette['grey-300'];
22
- }, function (_ref3) {
23
- var theme = _ref3.theme;
24
- return theme.palette['grey-200'];
25
- }, function (_ref4) {
26
- var theme = _ref4.theme;
27
- return theme.palette['blue-600'];
28
- }, function (_ref5) {
29
- var theme = _ref5.theme;
30
- return theme.palette.white;
31
- }, function (_ref6) {
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
- export var HoverIcon = styled(CheckboxM).withConfig({
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
- export default {
44
- IconWrapper: 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 { type Props as ButtonProps } from '../Button.types';
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
- export {};
1
+
@@ -1,4 +1,4 @@
1
- import React from 'react';
2
- import { type CreatorProps } from './Creator.types';
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;
@@ -1,46 +1,30 @@
1
- var _excluded = ["onClick", "disabled", "label", "block", "status", "className", "labelAlign"];
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
- 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 classnames from 'classnames';
5
- import React, { forwardRef, useCallback, useState } from 'react';
6
- import Icon, { AddM } from '@synerise/ds-icon';
7
- import * as S from './Creator.styles';
8
- var Creator = /*#__PURE__*/forwardRef(function (_ref, ref) {
9
- var onClick = _ref.onClick,
10
- disabled = _ref.disabled,
11
- label = _ref.label,
12
- block = _ref.block,
13
- status = _ref.status,
14
- className = _ref.className,
15
- _ref$labelAlign = _ref.labelAlign,
16
- labelAlign = _ref$labelAlign === void 0 ? 'center' : _ref$labelAlign,
17
- htmlAttributes = _objectWithoutPropertiesLoose(_ref, _excluded);
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
- var onRelease = useCallback(function () {
20
+ const onRelease = useCallback(() => {
25
21
  setPressed(false);
26
22
  }, []);
27
- return /*#__PURE__*/React.createElement(S.Creator, _extends({
28
- ref: ref,
29
- block: block,
30
- labelAlign: labelAlign,
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 default Creator;
28
+ export {
29
+ Creator as default
30
+ };
@@ -1,32 +1,10 @@
1
- import React from 'react';
2
- export declare const CreatorLabel: import("styled-components").StyledComponent<"span", any, {}, never>;
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("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>;
9
+ export declare const Creator: import('styled-components').StyledComponent<React.ForwardRefExoticComponent<any>, any, StyledCreatorProps, never>;
32
10
  export {};
@@ -1,89 +1,45 @@
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); }
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, { forwardRef } from 'react';
5
- import styled, { css } from 'styled-components';
6
- import { IconContainer } from '@synerise/ds-icon';
7
- import { hexToRgba } from '@synerise/ds-utils';
8
- import Button from '../Button';
9
- import { ButtonFocus, RippleEffect } from '../Button.styles';
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:", ";}"], function (props) {
15
- return props.theme.palette['grey-500'];
16
- });
17
- var errorStyles = function errorStyles(_ref) {
18
- var theme = _ref.theme;
19
- return 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);
20
- };
21
- var uploadStyles = function uploadStyles(_ref2) {
22
- var theme = _ref2.theme;
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']);
24
- };
25
- export var Creator = styled(/*#__PURE__*/forwardRef(function (_ref3, ref) {
26
- var status = _ref3.status,
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:", ";}", " ", "}"], function (props) {
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 '48px';
29
+ return "48px";
39
30
  }
40
31
  if (props.block) {
41
- return '100%';
32
+ return "100%";
42
33
  }
43
- return 'auto';
44
- }, function (props) {
45
- return props.disabled ? "0.4" : '1';
46
- }, function (props) {
47
- return props.withLabel ? "0 12px 0 0" : '0';
48
- }, function (_ref4) {
49
- var theme = _ref4.theme;
50
- return theme.palette['grey-300'];
51
- }, function (props) {
52
- return props.withLabel && !props.block ? "flex-start" : 'center';
53
- }, function (props) {
54
- return props.labelAlign === 'center' ? 'center' : 'flex-start';
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 type { MouseEvent, ReactNode, RefObject } from 'react';
2
- import type { WithHTMLAttributes } from '@synerise/ds-utils';
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
- export var CreatorStatus = /*#__PURE__*/function (CreatorStatus) {
2
- CreatorStatus["Default"] = "default";
3
- CreatorStatus["Error"] = "error";
4
- CreatorStatus["Upload"] = "upload";
5
- return CreatorStatus;
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 { type ExpanderProps } from './Expander.types';
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 classnames from 'classnames';
2
- import React from 'react';
3
- import Icon, { AngleDownS } from '@synerise/ds-icon';
4
- import * as S from './Expander.styles';
5
- import { ExpanderSize } from './Expander.types';
6
- var Expander = function Expander(_ref) {
7
- var _ref$size = _ref.size,
8
- size = _ref$size === void 0 ? 'S' : _ref$size,
9
- expanded = _ref.expanded,
10
- disabled = _ref.disabled,
11
- onClick = _ref.onClick,
12
- className = _ref.className;
13
- return /*#__PURE__*/React.createElement(S.Expander, {
14
- onClick: onClick,
15
- size: ExpanderSize[size],
16
- className: classnames([className, 'ds-expander']),
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 { type Keyframes } from 'styled-components';
3
- import { type ThemeProps } from '@synerise/ds-core';
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("styled-components").StyledComponent<({ children, expanded, size, ...rest }: any) => React.JSX.Element, any, {}, never>;
11
+ export declare const Expander: import('styled-components').StyledComponent<({ children, expanded, size, ...rest }: any) => React.JSX.Element, any, {}, never>;
@@ -1,40 +1,21 @@
1
- var _excluded = ["children", "expanded", "size"];
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
- 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 from 'react';
5
- import styled, { css, keyframes } from 'styled-components';
6
- import { IconContainer } from '@synerise/ds-icon';
7
- import Button from '../Button';
8
- export var focusAnimation = function focusAnimation(_ref) {
9
- var theme = _ref.theme;
10
- return 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']);
11
- };
12
- var SIZE_DEFAULT = 24;
13
- export var Expander = styled(function (_ref2) {
14
- var children = _ref2.children,
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 ", ";}", "}"], function (props) {
25
- return props.size || SIZE_DEFAULT;
26
- }, function (props) {
27
- return props.size || SIZE_DEFAULT;
28
- }, function (props) {
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
- export var ExpanderSize = /*#__PURE__*/function (ExpanderSize) {
2
- ExpanderSize[ExpanderSize["S"] = 24] = "S";
3
- ExpanderSize[ExpanderSize["M"] = 32] = "M";
4
- return ExpanderSize;
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
+ };
@@ -1,4 +1,4 @@
1
- import React from 'react';
2
- import { type StarButtonProps } from './Star.types';
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
- var _excluded = ["hasError", "active", "type"];
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
- 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 from 'react';
5
- import Icon, { StarFillM, StarM } from '@synerise/ds-icon';
6
- import Button from '../Button';
7
- import * as S from './Star.styles';
8
- var StarButton = function StarButton(props) {
9
- var hasError = props.hasError,
10
- active = props.active,
11
- _props$type = props.type,
12
- type = _props$type === void 0 ? 'ghost' : _props$type,
13
- restProps = _objectWithoutPropertiesLoose(props, _excluded);
14
- return /*#__PURE__*/React.createElement(Button, _extends({
15
- "aria-pressed": !!active,
16
- mode: "single-icon",
17
- role: "button",
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("styled-components").StyledComponent<"span", any, {
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("styled-components").StyledComponent<"span", any, {
6
+ IconWrapper: import('styled-components').StyledComponent<"span", any, {
7
7
  active?: boolean;
8
8
  error?: boolean;
9
9
  }, never>;