@commercetools-uikit/secondary-button 19.9.0 → 19.11.0
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.
|
@@ -171,7 +171,7 @@ SecondaryButton.defaultProps = defaultProps;
|
|
|
171
171
|
var SecondaryButton$1 = SecondaryButton;
|
|
172
172
|
|
|
173
173
|
// NOTE: This string will be replaced on build time with the package version.
|
|
174
|
-
var version = "19.
|
|
174
|
+
var version = "19.11.0";
|
|
175
175
|
|
|
176
176
|
exports["default"] = SecondaryButton$1;
|
|
177
177
|
exports.version = version;
|
|
@@ -156,7 +156,7 @@ SecondaryButton.defaultProps = defaultProps;
|
|
|
156
156
|
var SecondaryButton$1 = SecondaryButton;
|
|
157
157
|
|
|
158
158
|
// NOTE: This string will be replaced on build time with the package version.
|
|
159
|
-
var version = "19.
|
|
159
|
+
var version = "19.11.0";
|
|
160
160
|
|
|
161
161
|
exports["default"] = SecondaryButton$1;
|
|
162
162
|
exports.version = version;
|
|
@@ -151,6 +151,6 @@ SecondaryButton.defaultProps = defaultProps;
|
|
|
151
151
|
var SecondaryButton$1 = SecondaryButton;
|
|
152
152
|
|
|
153
153
|
// NOTE: This string will be replaced on build time with the package version.
|
|
154
|
-
var version = "19.
|
|
154
|
+
var version = "19.11.0";
|
|
155
155
|
|
|
156
156
|
export { SecondaryButton$1 as default, version };
|
|
@@ -1,25 +1,74 @@
|
|
|
1
1
|
import { ReactElement, KeyboardEvent, MouseEvent, ElementType, ComponentPropsWithRef } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated Use sizes from `TSizes` instead.
|
|
4
|
+
*/
|
|
2
5
|
type TLegacySizes = 'small' | 'medium' | 'big';
|
|
6
|
+
/**
|
|
7
|
+
* Available sizes for the SecondaryButton.
|
|
8
|
+
*/
|
|
3
9
|
type TSizes = '10' | '20';
|
|
4
10
|
export type TSecondaryButtonProps<TStringOrComponent extends ElementType = 'button'> = {
|
|
11
|
+
/**
|
|
12
|
+
* You may pass in a string like "a" to have the button element render an anchor tag, or
|
|
13
|
+
* you could pass in a React Component, like a `Link`.
|
|
14
|
+
* <br />
|
|
15
|
+
* The `<SecondaryButton>` additionally accepts any props or attributes specific to the given element or component.
|
|
16
|
+
*/
|
|
5
17
|
as?: TStringOrComponent;
|
|
18
|
+
/**
|
|
19
|
+
* Used as the HTML type attribute.
|
|
20
|
+
*/
|
|
6
21
|
type?: 'button' | 'reset' | 'submit';
|
|
22
|
+
/**
|
|
23
|
+
* Should describe what the button does, for accessibility purposes (screen-reader users)
|
|
24
|
+
*/
|
|
7
25
|
label: string;
|
|
26
|
+
/**
|
|
27
|
+
* The left icon displayed within the button.
|
|
28
|
+
*/
|
|
8
29
|
iconLeft?: ReactElement;
|
|
30
|
+
/**
|
|
31
|
+
* If this is active, it means the button will persist in an "active" state when toggled (see `isToggled`), and back to normal state when untoggled
|
|
32
|
+
*/
|
|
9
33
|
isToggleButton?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Tells when the button should present a toggled state. It does not have any effect when `isToggleButton` is `false`.
|
|
36
|
+
*/
|
|
10
37
|
isToggled?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Tells when the button should present a disabled state.
|
|
40
|
+
*/
|
|
11
41
|
isDisabled?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Handler when the button is clicked.
|
|
44
|
+
*/
|
|
12
45
|
onClick?: (event: MouseEvent<HTMLButtonElement> | KeyboardEvent<HTMLButtonElement>) => void;
|
|
46
|
+
/**
|
|
47
|
+
* Sets the size of the button.
|
|
48
|
+
* <br />
|
|
49
|
+
* `small`, `medium`, and `big` are deprecated. Use `10` or `20`, instead.
|
|
50
|
+
*/
|
|
13
51
|
size?: TLegacySizes | TSizes;
|
|
52
|
+
/**
|
|
53
|
+
* Indicates the color scheme of the button.
|
|
54
|
+
* @deprecated Use `tone` instead.
|
|
55
|
+
*/
|
|
14
56
|
theme?: 'default' | 'info';
|
|
57
|
+
/**
|
|
58
|
+
* Indicates the tone of the button.
|
|
59
|
+
*/
|
|
15
60
|
tone?: 'secondary' | 'info';
|
|
16
|
-
} &
|
|
61
|
+
} & /**
|
|
62
|
+
* Include any props derived from the React component passed to the `as` prop.
|
|
63
|
+
* For example, given `as={Link}`, all props of the `<Link>` component are allowed to be
|
|
64
|
+
* passed to `<SecondaryButton>`: <SecondaryButton as={Link} to="/foo" label="Foo" />.
|
|
65
|
+
*/ ComponentPropsWithRef<TStringOrComponent>;
|
|
17
66
|
export declare const getIconColor: (props: Pick<TSecondaryButtonProps, "isToggleButton" | "isToggled" | "theme" | "isDisabled" | "iconLeft"> & {
|
|
18
67
|
isActive?: boolean;
|
|
19
68
|
}) => any;
|
|
20
69
|
export declare const SecondaryButton: {
|
|
21
70
|
<TStringOrComponent extends ElementType = "button">(props: TSecondaryButtonProps<TStringOrComponent>): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
22
71
|
displayName: string;
|
|
23
|
-
defaultProps: Pick<TSecondaryButtonProps<"button">, "
|
|
72
|
+
defaultProps: Pick<TSecondaryButtonProps<"button">, "type" | "theme" | "size" | "tone" | "isToggleButton">;
|
|
24
73
|
};
|
|
25
74
|
export default SecondaryButton;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-uikit/secondary-button",
|
|
3
3
|
"description": "Secondary buttons are used in combination with a PrimaryButton and represent the secondary action.",
|
|
4
|
-
"version": "19.
|
|
4
|
+
"version": "19.11.0",
|
|
5
5
|
"bugs": "https://github.com/commercetools/ui-kit/issues",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@babel/runtime": "^7.20.13",
|
|
23
23
|
"@babel/runtime-corejs3": "^7.20.13",
|
|
24
|
-
"@commercetools-uikit/accessible-button": "19.
|
|
25
|
-
"@commercetools-uikit/design-system": "19.
|
|
26
|
-
"@commercetools-uikit/spacings-inline": "19.
|
|
27
|
-
"@commercetools-uikit/text": "19.
|
|
28
|
-
"@commercetools-uikit/utils": "19.
|
|
24
|
+
"@commercetools-uikit/accessible-button": "19.11.0",
|
|
25
|
+
"@commercetools-uikit/design-system": "19.11.0",
|
|
26
|
+
"@commercetools-uikit/spacings-inline": "19.11.0",
|
|
27
|
+
"@commercetools-uikit/text": "19.11.0",
|
|
28
|
+
"@commercetools-uikit/utils": "19.11.0",
|
|
29
29
|
"@emotion/react": "^11.10.5",
|
|
30
30
|
"@emotion/styled": "^11.10.5",
|
|
31
31
|
"lodash": "4.17.21",
|