@synerise/ds-button 0.20.1 → 0.21.1

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.21.1](https://github.com/synerise/synerise-design/compare/@synerise/ds-button@0.21.0...@synerise/ds-button@0.21.1) (2024-06-27)
7
+
8
+ **Note:** Version bump only for package @synerise/ds-button
9
+
10
+
11
+
12
+
13
+
14
+ # [0.21.0](https://github.com/synerise/synerise-design/compare/@synerise/ds-button@0.20.1...@synerise/ds-button@0.21.0) (2024-06-21)
15
+
16
+
17
+ ### Features
18
+
19
+ * **button:** disabled tooltip for button ([74fca04](https://github.com/synerise/synerise-design/commit/74fca04c9c02088c8bc59e055c7ffae0469e6355))
20
+
21
+
22
+
23
+
24
+
6
25
  ## [0.20.1](https://github.com/synerise/synerise-design/compare/@synerise/ds-button@0.20.0...@synerise/ds-button@0.20.1) (2024-05-29)
7
26
 
8
27
 
package/README.md CHANGED
@@ -54,19 +54,19 @@ import { AngleDownS } from '@synerise/ds-icon';
54
54
 
55
55
  ## Button
56
56
 
57
- | Property | Description | Type | Default |
58
- | -------------- | ---------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------- |
59
- | color | Defines color of `custom-color` button. | `green` / `grey` / `yellow` / `blue` / `pink`/ `mars`/ `orange`/ `fern`/ `cyan`/ `purple` / `violet` | `red` |
60
- | disabled | Defines if the button is disabled. | boolean | `false` |
61
- | groupVariant | Defines shape of the button | `left-rounded` / `squared` / `right-rounded` | - |
62
- | justifyContent | Defines justify of content in button. | JustifyContentProperty (React.CSSPRroperties) | - |
63
- | loading | Sets the loading status of button. | boolean / `{ delay?: number }` | `false` |
64
- | mode | Defines the mode of the button content. It affects content inside the button | `single-icon` / `split` / `two-icons` /`label-icon` / `icon-label` | - |
65
- | onClick | Callback executed after clicking the button | (event: React.MouseEvent) => void | - |
66
- | type | Defines the type of the button. | `primary` / `secondary`/ `tertiary`/ `tertiary-white` / `ghost-primary` / `ghost` / `ghost-white` / `custom-color` / `custom-color-ghost` | `secondary` |
67
- | iconColor | Defines color of `icon` in button. | `green` / `grey` / `yellow` / `blue` / `pink`/ `mars`/ `orange`/ `fern`/ `cyan`/ `purple` / `violet` | `grey` |
68
- | error | Defines if the button has error button styles . | boolean | `false` |
69
- | activated | Defines if the button has activated button styles . | boolean | `false` |
57
+ | Property | Description | Type | Default |
58
+ | -------------------- | ---------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------- |
59
+ | color | Defines color of `custom-color` button. | `green` / `grey` / `yellow` / `blue` / `pink`/ `mars`/ `orange`/ `fern`/ `cyan`/ `purple` / `violet` | `red` |
60
+ | disabled | Defines if the button is disabled. | boolean | `false` |
61
+ | groupVariant | Defines shape of the button | `left-rounded` / `squared` / `right-rounded` | - |
62
+ | justifyContent | Defines justify of content in button. | JustifyContentProperty (React.CSSPRroperties) | - |
63
+ | loading | Sets the loading status of button. | boolean / `{ delay?: number }` | `false` |
64
+ | mode | Defines the mode of the button content. It affects content inside the button | `single-icon` / `split` / `two-icons` /`label-icon` / `icon-label` | - |
65
+ | onClick | Callback executed after clicking the button | (event: React.MouseEvent) => void | - |
66
+ | type | Defines the type of the button. | `primary` / `secondary`/ `tertiary`/ `tertiary-white` / `ghost-primary` / `ghost` / `ghost-white` / `custom-color` / `custom-color-ghost` | `secondary` |
67
+ | iconColor | Defines color of `icon` in button. | `green` / `grey` / `yellow` / `blue` / `pink`/ `mars`/ `orange`/ `fern`/ `cyan`/ `purple` / `violet` | `grey` |
68
+ | error | Defines if the button has error button styles . | boolean | `false` |
69
+ | activated | Defines if the button has activated button styles . | boolean | `false` |
70
70
 
71
71
  ## Button.Creator
72
72
 
package/dist/Button.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import * as React from 'react';
1
+ import React from 'react';
2
2
  import '@synerise/ds-core/dist/js/style';
3
3
  import './style/index.less';
4
- import { Props } from './Button.types';
5
- declare const Button: React.FC<Props>;
4
+ import { ButtonProps } from './Button.types';
5
+ declare const Button: ({ type, mode, justifyContent, groupVariant, loading, onClick, className, color, error, activated, ...antdProps }: ButtonProps) => React.JSX.Element;
6
6
  export default Button;
package/dist/Button.js CHANGED
@@ -4,7 +4,7 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
4
4
 
5
5
  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; }
6
6
 
7
- import * as React from 'react';
7
+ import React, { useEffect, useState, useMemo, useRef } from 'react';
8
8
  import '@synerise/ds-core/dist/js/style';
9
9
  import "./style/index.css";
10
10
  import Icon, { SpinnerM } from '@synerise/ds-icon';
@@ -28,17 +28,17 @@ var Button = function Button(_ref) {
28
28
  activated = _ref.activated,
29
29
  antdProps = _objectWithoutPropertiesLoose(_ref, _excluded);
30
30
 
31
- var rippleRef = React.useRef(null);
31
+ var rippleRef = useRef(null);
32
32
 
33
- var _React$useState = React.useState(''),
34
- rippleClassName = _React$useState[0],
35
- setRippleClassName = _React$useState[1];
33
+ var _useState = useState(''),
34
+ rippleClassName = _useState[0],
35
+ setRippleClassName = _useState[1];
36
36
 
37
- var _React$useState2 = React.useState(false),
38
- pressed = _React$useState2[0],
39
- setPressed = _React$useState2[1];
37
+ var _useState2 = useState(false),
38
+ pressed = _useState2[0],
39
+ setPressed = _useState2[1];
40
40
 
41
- React.useEffect(function () {
41
+ useEffect(function () {
42
42
  if (rippleClassName !== '') {
43
43
  setTimeout(function () {
44
44
  setRippleClassName('');
@@ -63,7 +63,7 @@ var Button = function Button(_ref) {
63
63
  }
64
64
  };
65
65
 
66
- var classNameString = React.useMemo(function () {
66
+ var classNameString = useMemo(function () {
67
67
  var modeStringifed = mode || '';
68
68
  var readOnlyStringifed = antdProps.readOnly ? 'read-only' : '';
69
69
  var classNameStringifed = className || '';
@@ -1,7 +1,7 @@
1
- import * as React from 'react';
2
- import { ButtonProps } from 'antd/lib/button';
1
+ import { ElementType, MouseEvent } from 'react';
2
+ import { ButtonProps as AntdButtonProps } from 'antd/lib/button';
3
3
  import { JustifyContentProperty } from 'csstype';
4
- export type Props = Omit<ButtonProps, 'type'> & {
4
+ export type ButtonProps = Omit<AntdButtonProps, 'type'> & {
5
5
  /**
6
6
  * Defines the type of the button. It affects the button color
7
7
  *
@@ -38,13 +38,14 @@ export type Props = Omit<ButtonProps, 'type'> & {
38
38
  /**
39
39
  * Sets the handler to handle `click` event
40
40
  */
41
- onClick?: (event: React.MouseEvent<HTMLElement>) => void;
41
+ onClick?: (event: MouseEvent<HTMLElement>) => void;
42
42
  iconColor?: string | 'blue' | 'grey' | 'red' | 'green' | 'yellow' | 'pink' | 'mars' | 'orange' | 'fern' | 'cyan' | 'purple' | 'violet';
43
43
  error?: boolean;
44
44
  activated?: boolean;
45
45
  readOnly?: boolean;
46
46
  };
47
+ export type Props = ButtonProps;
47
48
  export type ButtonSubComponents = {
48
- Expander: React.ElementType;
49
- Creator: React.ElementType;
49
+ Expander: ElementType;
50
+ Creator: ElementType;
50
51
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-button",
3
- "version": "0.20.1",
3
+ "version": "0.21.1",
4
4
  "description": "Button UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "synerise/synerise-design",
@@ -33,19 +33,14 @@
33
33
  ],
34
34
  "types": "dist/index.d.ts",
35
35
  "dependencies": {
36
- "@synerise/ds-icon": "^0.62.0",
36
+ "@synerise/ds-icon": "^0.63.0",
37
37
  "classnames": "2.3.2"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "@synerise/ds-core": "*",
41
41
  "antd": "4.7.0",
42
- "react": ">=16.9.0 < 17.0.0",
42
+ "react": ">=16.9.0 <= 17.0.2",
43
43
  "styled-components": "5.0.1"
44
44
  },
45
- "devDependencies": {
46
- "@synerise/ds-utils": "^0.27.0",
47
- "@testing-library/react": "10.0.1",
48
- "csstype": "2.6.9"
49
- },
50
- "gitHead": "6bd94c78745df68ee3b853120a863ab24fc233ef"
45
+ "gitHead": "587eb113074985ae21e4f0c25ec33c3e3e2e072b"
51
46
  }