@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.
Files changed (45) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +5 -2
  3. package/dist/Button.d.ts +11 -13
  4. package/dist/Button.figma.d.ts +1 -0
  5. package/dist/Button.figma.js +56 -0
  6. package/dist/Button.js +72 -96
  7. package/dist/Button.styles.d.ts +14 -14
  8. package/dist/Button.styles.js +56 -105
  9. package/dist/Button.types.d.ts +7 -7
  10. package/dist/Button.types.js +11 -10
  11. package/dist/ButtonToggle/ButtonToggle.d.ts +2 -2
  12. package/dist/ButtonToggle/ButtonToggle.js +21 -25
  13. package/dist/ButtonToggle/ButtonToggle.styles.d.ts +2 -2
  14. package/dist/ButtonToggle/ButtonToggle.styles.js +14 -14
  15. package/dist/ButtonToggle/ButtonToggle.types.d.ts +1 -1
  16. package/dist/ButtonToggle/ButtonToggle.types.js +1 -1
  17. package/dist/Checkbox/Checkbox.d.ts +2 -2
  18. package/dist/Checkbox/Checkbox.js +43 -55
  19. package/dist/Checkbox/Checkbox.styles.d.ts +4 -4
  20. package/dist/Checkbox/Checkbox.styles.js +37 -33
  21. package/dist/Checkbox/Checkbox.types.d.ts +1 -1
  22. package/dist/Checkbox/Checkbox.types.js +1 -1
  23. package/dist/Creator/Creator.d.ts +2 -2
  24. package/dist/Creator/Creator.js +25 -41
  25. package/dist/Creator/Creator.styles.d.ts +3 -25
  26. package/dist/Creator/Creator.styles.js +37 -81
  27. package/dist/Creator/Creator.types.d.ts +2 -2
  28. package/dist/Creator/Creator.types.js +9 -6
  29. package/dist/Expander/Expander.d.ts +2 -2
  30. package/dist/Expander/Expander.js +16 -22
  31. package/dist/Expander/Expander.styles.d.ts +4 -4
  32. package/dist/Expander/Expander.styles.js +19 -38
  33. package/dist/Expander/Expander.types.js +8 -5
  34. package/dist/Star/Star.d.ts +2 -2
  35. package/dist/Star/Star.js +17 -29
  36. package/dist/Star/Star.styles.d.ts +2 -2
  37. package/dist/Star/Star.styles.js +25 -24
  38. package/dist/Star/Star.types.d.ts +1 -1
  39. package/dist/Star/Star.types.js +1 -1
  40. package/dist/assets/style/index-tn0RQdqM.css +0 -0
  41. package/dist/index.d.ts +22 -22
  42. package/dist/index.js +34 -24
  43. package/dist/modules.d.js +1 -1
  44. package/dist/modules.d.ts +0 -0
  45. package/package.json +10 -10
@@ -1,10 +1,10 @@
1
- import type { ButtonProps as AntdButtonProps } from 'antd/lib/button';
2
- import type { JustifyContentProperty } from 'csstype';
3
- import type { ForwardRefExoticComponent, MouseEvent, RefAttributes } from 'react';
4
- import { type StyledComponent } from 'styled-components';
5
- import type { TagProps } from '@synerise/ds-tag';
6
- import type { TooltipProps } from '@synerise/ds-tooltip';
7
- import type { LiteralStringUnion } from '@synerise/ds-utils';
1
+ import { ButtonProps as AntdButtonProps } from 'antd/lib/button';
2
+ import { JustifyContentProperty } from 'csstype';
3
+ import { ForwardRefExoticComponent, MouseEvent, RefAttributes } from 'react';
4
+ import { StyledComponent } from 'styled-components';
5
+ import { TagProps } from '@synerise/ds-tag';
6
+ import { TooltipProps } from '@synerise/ds-tooltip';
7
+ import { LiteralStringUnion } from '@synerise/ds-utils';
8
8
  export declare enum ButtonMode {
9
9
  SINGLE_ICON = "single-icon",
10
10
  SPLIT = "split",
@@ -1,10 +1,11 @@
1
- export var ButtonMode = /*#__PURE__*/function (ButtonMode) {
2
- ButtonMode["SINGLE_ICON"] = "single-icon";
3
- ButtonMode["SPLIT"] = "split";
4
- ButtonMode["TWO_ICONS"] = "two-icons";
5
- ButtonMode["LABEL_ICON"] = "label-icon";
6
- ButtonMode["ICON_LABEL"] = "icon-label";
7
- return ButtonMode;
8
- }({});
9
-
10
- /** @deprecated - use ButtonProps instead */
1
+ var ButtonMode = /* @__PURE__ */ ((ButtonMode2) => {
2
+ ButtonMode2["SINGLE_ICON"] = "single-icon";
3
+ ButtonMode2["SPLIT"] = "split";
4
+ ButtonMode2["TWO_ICONS"] = "two-icons";
5
+ ButtonMode2["LABEL_ICON"] = "label-icon";
6
+ ButtonMode2["ICON_LABEL"] = "icon-label";
7
+ return ButtonMode2;
8
+ })(ButtonMode || {});
9
+ export {
10
+ ButtonMode
11
+ };
@@ -1,4 +1,4 @@
1
- import React from 'react';
2
- import type { ButtonToggleProps } from './ButtonToggle.types';
1
+ import { default as React } from 'react';
2
+ import { ButtonToggleProps } from './ButtonToggle.types';
3
3
  declare const ButtonToggle: ({ activated, type, ...buttonProps }: ButtonToggleProps) => React.JSX.Element;
4
4
  export default ButtonToggle;
@@ -1,33 +1,29 @@
1
- var _excluded = ["activated", "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, { useMemo } from 'react';
5
- import * as S from './ButtonToggle.styles';
6
- var ButtonToggle = function ButtonToggle(_ref) {
7
- var activated = _ref.activated,
8
- type = _ref.type,
9
- buttonProps = _objectWithoutPropertiesLoose(_ref, _excluded);
10
- var mappedButtonType = useMemo(function () {
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useMemo } from "react";
3
+ import { ButtonToggle as ButtonToggle$1 } from "./ButtonToggle.styles.js";
4
+ const ButtonToggle = ({
5
+ activated,
6
+ type,
7
+ ...buttonProps
8
+ }) => {
9
+ const mappedButtonType = useMemo(() => {
11
10
  switch (type) {
12
- case 'ghost':
13
- return activated ? 'ghost' : 'ghost';
14
- case 'solid':
11
+ case "ghost":
12
+ return activated ? "ghost" : "ghost";
13
+ case "solid":
15
14
  default:
16
- return activated ? 'primary' : 'secondary';
15
+ return activated ? "primary" : "secondary";
17
16
  }
18
17
  }, [activated, type]);
19
- var handlePointerUp = function handlePointerUp(event) {
20
- var button = event.currentTarget;
21
- buttonProps.onPointerUp == null || buttonProps.onPointerUp(event);
22
- setTimeout(function () {
18
+ const handlePointerUp = (event) => {
19
+ const button = event.currentTarget;
20
+ buttonProps.onPointerUp?.(event);
21
+ setTimeout(() => {
23
22
  button && button.blur();
24
23
  }, 200);
25
24
  };
26
- return /*#__PURE__*/React.createElement(S.ButtonToggle, _extends({}, buttonProps, {
27
- toggleType: type,
28
- activated: activated,
29
- onPointerUp: handlePointerUp,
30
- type: mappedButtonType
31
- }));
25
+ return /* @__PURE__ */ jsx(ButtonToggle$1, { ...buttonProps, toggleType: type, activated, onPointerUp: handlePointerUp, type: mappedButtonType });
26
+ };
27
+ export {
28
+ ButtonToggle as default
32
29
  };
33
- export default ButtonToggle;
@@ -1,2 +1,2 @@
1
- import React from 'react';
2
- export declare const ButtonToggle: import("styled-components").StyledComponent<({ toggleType, activated, ...rest }: any) => React.JSX.Element, any, {}, never>;
1
+ import { default as React } from 'react';
2
+ export declare const ButtonToggle: import('styled-components').StyledComponent<({ toggleType, activated, ...rest }: any) => React.JSX.Element, any, {}, never>;
@@ -1,17 +1,17 @@
1
- var _excluded = ["toggleType", "activated"];
2
- function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
3
- import React from 'react';
4
- import styled, { css } from 'styled-components';
5
- import Button from '../Button';
6
- import { ButtonFocus } from '../Button.styles';
7
- export var ButtonToggle = styled(function (_ref) {
8
- var toggleType = _ref.toggleType,
9
- activated = _ref.activated,
10
- rest = _objectWithoutPropertiesLoose(_ref, _excluded);
11
- return /*#__PURE__*/React.createElement(Button, rest);
1
+ import { jsx } from "react/jsx-runtime";
2
+ import styled, { css } from "styled-components";
3
+ import Button from "../Button.js";
4
+ import { ButtonFocus } from "../Button.styles.js";
5
+ const ButtonToggle = /* @__PURE__ */ styled(({
6
+ toggleType,
7
+ activated,
8
+ ...rest
9
+ }) => {
10
+ return /* @__PURE__ */ jsx(Button, { ...rest });
12
11
  }).withConfig({
13
12
  displayName: "ButtonTogglestyles__ButtonToggle",
14
13
  componentId: "sc-1m60zt6-0"
15
- })(["", ""], function (props) {
16
- return props.toggleType === 'ghost' && css(["&:hover:not(:disabled):not(:focus){color:", ";}", ""], props.theme.palette['grey-600'], !props.activated ? css(["&:hover:not(:disabled):not(:focus){color:", ";svg{fill:currentColor;}}"], props.theme.palette['grey-600']) : css(["", ""], !props.disabled && css(["&&{background:", ";color:", ";svg{fill:currentColor;}", "{box-shadow:none;}}}"], props.theme.palette['blue-050'], props.theme.palette['blue-600'], ButtonFocus)));
17
- });
14
+ })(["", ""], (props) => props.toggleType === "ghost" && css(["&:hover:not(:disabled):not(:focus){color:", ";}", ""], props.theme.palette["grey-600"], !props.activated ? css(["&:hover:not(:disabled):not(:focus){color:", ";svg{fill:currentColor;}}"], props.theme.palette["grey-600"]) : css(["", ""], !props.disabled && css(["&&{background:", ";color:", ";svg{fill:currentColor;}", "{box-shadow:none;}}}"], props.theme.palette["blue-050"], props.theme.palette["blue-600"], ButtonFocus))));
15
+ export {
16
+ ButtonToggle
17
+ };
@@ -1,4 +1,4 @@
1
- import type { ButtonProps } from '../Button.types';
1
+ import { ButtonProps } from '../Button.types';
2
2
  export type ButtonToggleProps = Omit<ButtonProps, 'type' | 'danger' | 'ghost' | 'color'> & {
3
3
  type?: 'solid' | 'ghost';
4
4
  activated?: boolean;
@@ -1 +1 @@
1
- export {};
1
+
@@ -1,4 +1,4 @@
1
- import React from 'react';
2
- import { type CheckboxButtonProps } from './Checkbox.types';
1
+ import { default as React } from 'react';
2
+ import { CheckboxButtonProps } from './Checkbox.types';
3
3
  declare const CheckboxButton: (props: CheckboxButtonProps) => React.ReactElement;
4
4
  export default CheckboxButton;
@@ -1,75 +1,63 @@
1
- var _excluded = ["checked", "defaultChecked", "hasError", "indeterminate", "onChange", "onClick"];
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, { CheckboxIndeterminateM, CheckboxSelectedFillM } from '@synerise/ds-icon';
6
- import Button from '../Button';
7
- import * as S from './Checkbox.styles';
8
- var CheckboxButtonIcon = function CheckboxButtonIcon(_ref) {
9
- var checked = _ref.checked,
10
- indeterminate = _ref.indeterminate;
1
+ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
+ import React from "react";
3
+ import Icon, { CheckboxIndeterminateM, CheckboxSelectedFillM } from "@synerise/ds-icon";
4
+ import Button from "../Button.js";
5
+ import { IconWrapper, DefaultIcon, HoverIcon } from "./Checkbox.styles.js";
6
+ const CheckboxButtonIcon = ({
7
+ checked,
8
+ indeterminate
9
+ }) => {
11
10
  if (indeterminate) {
12
- return /*#__PURE__*/React.createElement(CheckboxIndeterminateM, null);
11
+ return /* @__PURE__ */ jsx(CheckboxIndeterminateM, {});
13
12
  }
14
13
  if (checked) {
15
- return /*#__PURE__*/React.createElement(CheckboxSelectedFillM, null);
14
+ return /* @__PURE__ */ jsx(CheckboxSelectedFillM, {});
16
15
  }
17
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(S.DefaultIcon, null), /*#__PURE__*/React.createElement(S.HoverIcon, null));
16
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
17
+ /* @__PURE__ */ jsx(DefaultIcon, {}),
18
+ /* @__PURE__ */ jsx(HoverIcon, {})
19
+ ] });
18
20
  };
19
- var getNextCheckedState = function getNextCheckedState(prevState, _ref2) {
20
- var checked = _ref2.checked,
21
- indeterminate = _ref2.indeterminate;
21
+ const getNextCheckedState = (prevState, {
22
+ checked,
23
+ indeterminate
24
+ }) => {
22
25
  if (indeterminate === true) {
23
26
  return true;
24
27
  }
25
- if (checked === undefined) {
28
+ if (checked === void 0) {
26
29
  return !prevState;
27
30
  }
28
31
  return !checked;
29
32
  };
30
- var CheckboxButton = function CheckboxButton(props) {
31
- var checked = props.checked,
32
- _props$defaultChecked = props.defaultChecked,
33
- defaultChecked = _props$defaultChecked === void 0 ? false : _props$defaultChecked,
34
- hasError = props.hasError,
35
- indeterminate = props.indeterminate,
36
- onChange = props.onChange,
37
- onClick = props.onClick,
38
- restProps = _objectWithoutPropertiesLoose(props, _excluded);
39
- var _React$useState = React.useState(defaultChecked),
40
- isCheckedState = _React$useState[0],
41
- setIsCheckedState = _React$useState[1];
42
- var handleButtonClick = function handleButtonClick(e) {
43
- if (typeof onClick === 'function') {
33
+ const CheckboxButton = (props) => {
34
+ const {
35
+ checked,
36
+ defaultChecked = false,
37
+ hasError,
38
+ indeterminate,
39
+ onChange,
40
+ onClick,
41
+ ...restProps
42
+ } = props;
43
+ const [isCheckedState, setIsCheckedState] = React.useState(defaultChecked);
44
+ const handleButtonClick = (e) => {
45
+ if (typeof onClick === "function") {
44
46
  onClick(e);
45
47
  }
46
- setIsCheckedState(function (prevState) {
47
- var nextState = getNextCheckedState(prevState, props);
48
- if (typeof onChange === 'function') {
48
+ setIsCheckedState((prevState) => {
49
+ const nextState = getNextCheckedState(prevState, props);
50
+ if (typeof onChange === "function") {
49
51
  onChange(nextState);
50
52
  }
51
53
  return nextState;
52
54
  });
53
55
  };
54
- var isChecked = checked !== undefined ? checked : isCheckedState;
55
- return /*#__PURE__*/React.createElement(Button, _extends({
56
- "aria-checked": indeterminate ? 'mixed' : isChecked,
57
- mode: "single-icon",
58
- role: "checkbox",
59
- style: {
60
- transition: 'none'
61
- },
62
- tabIndex: 0,
63
- type: "ghost-primary",
64
- onClick: handleButtonClick
65
- }, restProps), /*#__PURE__*/React.createElement(S.IconWrapper, {
66
- active: indeterminate || isChecked,
67
- error: hasError
68
- }, /*#__PURE__*/React.createElement(Icon, {
69
- component: /*#__PURE__*/React.createElement(CheckboxButtonIcon, {
70
- checked: isChecked,
71
- indeterminate: indeterminate
72
- })
73
- })));
56
+ const isChecked = checked !== void 0 ? checked : isCheckedState;
57
+ return /* @__PURE__ */ jsx(Button, { "aria-checked": indeterminate ? "mixed" : isChecked, mode: "single-icon", role: "checkbox", style: {
58
+ transition: "none"
59
+ }, tabIndex: 0, type: "ghost-primary", onClick: handleButtonClick, ...restProps, children: /* @__PURE__ */ jsx(IconWrapper, { active: indeterminate || isChecked, error: hasError, children: /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(CheckboxButtonIcon, { checked: isChecked, indeterminate }) }) }) });
60
+ };
61
+ export {
62
+ CheckboxButton as default
74
63
  };
75
- export default CheckboxButton;
@@ -1,11 +1,11 @@
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
- export declare const DefaultIcon: import("styled-components").StyledComponent<(props: React.SVGProps<SVGSVGElement>) => JSX.Element, any, {}, never>;
6
- export declare const HoverIcon: import("styled-components").StyledComponent<(props: React.SVGProps<SVGSVGElement>) => JSX.Element, any, {}, never>;
5
+ export declare const DefaultIcon: import('styled-components').StyledComponent<(props: React.SVGProps<SVGSVGElement>) => JSX.Element, any, {}, never>;
6
+ export declare const HoverIcon: import('styled-components').StyledComponent<(props: React.SVGProps<SVGSVGElement>) => JSX.Element, any, {}, never>;
7
7
  declare const _default: {
8
- IconWrapper: import("styled-components").StyledComponent<"span", any, {
8
+ IconWrapper: import('styled-components').StyledComponent<"span", any, {
9
9
  active?: boolean;
10
10
  error?: boolean;
11
11
  }, never>;
@@ -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 {};