@synerise/ds-button 0.18.8 → 0.18.10

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 CHANGED
@@ -3,6 +3,25 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [0.18.10](https://github.com/synerise/synerise-design/compare/@synerise/ds-button@0.18.9...@synerise/ds-button@0.18.10) (2024-01-15)
7
+
8
+ **Note:** Version bump only for package @synerise/ds-button
9
+
10
+
11
+
12
+
13
+
14
+ ## [0.18.9](https://github.com/synerise/synerise-design/compare/@synerise/ds-button@0.18.8...@synerise/ds-button@0.18.9) (2023-12-13)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * **button:** creator block styles fixed ([2ecef7c](https://github.com/synerise/synerise-design/commit/2ecef7ce5bd12b9b6d3c52b913b66852babfa15d))
20
+
21
+
22
+
23
+
24
+
6
25
  ## [0.18.8](https://github.com/synerise/synerise-design/compare/@synerise/ds-button@0.18.7...@synerise/ds-button@0.18.8) (2023-12-11)
7
26
 
8
27
  **Note:** Version bump only for package @synerise/ds-button
@@ -6,6 +6,7 @@ export interface CheckboxButtonProps extends ButtonPropsOmitted {
6
6
  hasError?: boolean;
7
7
  indeterminate?: boolean;
8
8
  onChange?: (checked: boolean) => void;
9
+ className?: string;
9
10
  }
10
11
  export interface ButtonCheckboxIconProps {
11
12
  checked?: boolean;
@@ -1,4 +1,3 @@
1
- import * as React from 'react';
2
1
  import { CreatorProps } from './Creator.types';
3
- declare const Creator: React.FC<CreatorProps>;
2
+ declare const Creator: ({ onClick, disabled, label, block, status, className }: CreatorProps) => JSX.Element;
4
3
  export default Creator;
@@ -1,4 +1,5 @@
1
- import * as React from 'react';
1
+ import React from 'react';
2
+ import classnames from 'classnames';
2
3
  import Icon, { AddM } from '@synerise/ds-icon';
3
4
  import * as S from './Creator.styles';
4
5
 
@@ -7,7 +8,8 @@ var Creator = function Creator(_ref) {
7
8
  disabled = _ref.disabled,
8
9
  label = _ref.label,
9
10
  block = _ref.block,
10
- status = _ref.status;
11
+ status = _ref.status,
12
+ className = _ref.className;
11
13
 
12
14
  var _React$useState = React.useState(false),
13
15
  pressed = _React$useState[0],
@@ -21,7 +23,7 @@ var Creator = function Creator(_ref) {
21
23
  }, []);
22
24
  return /*#__PURE__*/React.createElement(S.Creator, {
23
25
  block: block,
24
- className: "ds-button-creator",
26
+ className: classnames([className, 'ds-button-creator']),
25
27
  disabled: disabled,
26
28
  onClick: onClick,
27
29
  onMouseDown: onPress,
@@ -1,5 +1,5 @@
1
1
  export declare const CreatorLabel: import("styled-components").StyledComponent<"span", any, {}, never>;
2
- export declare const Creator: import("styled-components").StyledComponent<({ pressed, withLabel, ...rest }: any) => JSX.Element, any, {
2
+ export declare const Creator: import("styled-components").StyledComponent<({ status, pressed, withLabel, ...rest }: any) => JSX.Element, any, {
3
3
  withLabel: boolean;
4
4
  pressed: boolean;
5
5
  status: string;
@@ -1,4 +1,4 @@
1
- var _excluded = ["pressed", "withLabel"];
1
+ var _excluded = ["status", "pressed", "withLabel"];
2
2
 
3
3
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
4
4
 
@@ -27,7 +27,8 @@ var uploadStyles = function uploadStyles(_ref2) {
27
27
  };
28
28
 
29
29
  export var Creator = styled(function (_ref3) {
30
- var pressed = _ref3.pressed,
30
+ var status = _ref3.status,
31
+ pressed = _ref3.pressed,
31
32
  withLabel = _ref3.withLabel,
32
33
  rest = _objectWithoutPropertiesLoose(_ref3, _excluded);
33
34
 
@@ -35,19 +36,19 @@ export var Creator = styled(function (_ref3) {
35
36
  }).withConfig({
36
37
  displayName: "Creatorstyles__Creator",
37
38
  componentId: "sc-1w96u6h-1"
38
- })(["&&&{width:", ";opacity:", ";height:48px;", " padding:0;border-radius:3px;border:1px dashed ", ";background:transparent;transition:all 0.3s ease;justify-content:", ";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) {
39
+ })(["&&&{width:", ";opacity:", ";height:48px;padding:", ";border-radius:3px;border:1px dashed ", ";background:transparent;transition:all 0.3s ease;justify-content:", ";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) {
39
40
  if (!props.withLabel) return '48px';
40
41
  if (props.block) return '100%';
41
42
  return 'auto';
42
43
  }, function (props) {
43
44
  return props.disabled ? "0.4" : '1';
44
45
  }, function (props) {
45
- return props.withLabel && !props.block && "min-width: 200px;";
46
+ return props.withLabel ? "0 12px 0 0" : '0';
46
47
  }, function (_ref4) {
47
48
  var theme = _ref4.theme;
48
49
  return theme.palette['grey-400'];
49
50
  }, function (props) {
50
- return props.withLabel ? "flex-start" : 'center';
51
+ return props.withLabel && !props.block ? "flex-start" : 'center';
51
52
  }, IconContainer, function (props) {
52
53
  return props.theme.palette['grey-500'];
53
54
  }, function (props) {
@@ -10,4 +10,5 @@ export interface CreatorProps {
10
10
  label?: string | React.ReactNode;
11
11
  block?: boolean;
12
12
  status?: CreatorStatus;
13
+ className?: string;
13
14
  }
@@ -1,4 +1,3 @@
1
- import * as React from 'react';
2
1
  import { ExpanderProps } from './Expander.types';
3
- declare const Expander: React.FC<ExpanderProps>;
2
+ declare const Expander: ({ size, expanded, disabled, onClick, className }: ExpanderProps) => JSX.Element;
4
3
  export default Expander;
@@ -1,4 +1,5 @@
1
- import * as React from 'react';
1
+ import React from 'react';
2
+ import classnames from 'classnames';
2
3
  import Icon, { AngleDownS } from '@synerise/ds-icon';
3
4
  import * as S from './Expander.styles';
4
5
  import { ExpanderSize } from './Expander.types';
@@ -8,11 +9,12 @@ var Expander = function Expander(_ref) {
8
9
  size = _ref$size === void 0 ? 'S' : _ref$size,
9
10
  expanded = _ref.expanded,
10
11
  disabled = _ref.disabled,
11
- onClick = _ref.onClick;
12
+ onClick = _ref.onClick,
13
+ className = _ref.className;
12
14
  return /*#__PURE__*/React.createElement(S.Expander, {
13
15
  onClick: onClick,
14
16
  size: ExpanderSize[size],
15
- className: "ds-expander",
17
+ className: classnames([className, 'ds-expander']),
16
18
  expanded: expanded,
17
19
  disabled: disabled
18
20
  }, /*#__PURE__*/React.createElement(Icon, {
@@ -8,4 +8,5 @@ export interface ExpanderProps {
8
8
  size?: 'S' | 'M';
9
9
  disabled?: boolean;
10
10
  expanded?: boolean;
11
+ className?: string;
11
12
  }
@@ -3,5 +3,6 @@ type ButtonPropsOmitted = Omit<ButtonProps, 'type' | 'block' | 'color' | 'groupV
3
3
  export interface StarButtonProps extends ButtonPropsOmitted {
4
4
  active?: boolean;
5
5
  hasError?: boolean;
6
+ className?: string;
6
7
  }
7
8
  export {};
package/dist/index.d.ts CHANGED
@@ -7,8 +7,8 @@ import * as ExpanderStyles from './Expander/Expander.styles';
7
7
  import * as StarStyles from './Star/Star.styles';
8
8
  declare class Button extends React.Component<ButtonProps> {
9
9
  static readonly Checkbox: (props: import("./Checkbox/Checkbox.types").CheckboxButtonProps) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
10
- static readonly Creator: React.FC<import("./Creator/Creator.types").CreatorProps>;
11
- static readonly Expander: React.FC<import("./Expander/Expander.types").ExpanderProps>;
10
+ static readonly Creator: ({ onClick, disabled, label, block, status, className }: import("./Creator/Creator.types").CreatorProps) => JSX.Element;
11
+ static readonly Expander: ({ size, expanded, disabled, onClick, className }: import("./Expander/Expander.types").ExpanderProps) => JSX.Element;
12
12
  static readonly Star: (props: import("./Star/Star.types").StarButtonProps) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
13
13
  render(): JSX.Element;
14
14
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-button",
3
- "version": "0.18.8",
3
+ "version": "0.18.10",
4
4
  "description": "Button UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "synerise/synerise-design",
@@ -33,7 +33,8 @@
33
33
  ],
34
34
  "types": "dist/index.d.ts",
35
35
  "dependencies": {
36
- "@synerise/ds-icon": "^0.58.8"
36
+ "@synerise/ds-icon": "^0.59.0",
37
+ "classnames": "2.3.2"
37
38
  },
38
39
  "peerDependencies": {
39
40
  "@synerise/ds-core": "*",
@@ -42,9 +43,9 @@
42
43
  "styled-components": "5.0.1"
43
44
  },
44
45
  "devDependencies": {
45
- "@synerise/ds-utils": "^0.24.22",
46
+ "@synerise/ds-utils": "^0.24.23",
46
47
  "@testing-library/react": "10.0.1",
47
48
  "csstype": "2.6.9"
48
49
  },
49
- "gitHead": "5ab278e69cd049334216bc9867cca2ce6a5fc218"
50
+ "gitHead": "ba51e38beff83b8adba409f09311131f429ada01"
50
51
  }