@commercetools-uikit/primary-button 19.9.0 → 19.10.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.
|
@@ -202,7 +202,7 @@ PrimaryButton.displayName = 'PrimaryButton';
|
|
|
202
202
|
var PrimaryButton$1 = PrimaryButton;
|
|
203
203
|
|
|
204
204
|
// NOTE: This string will be replaced on build time with the package version.
|
|
205
|
-
var version = "19.
|
|
205
|
+
var version = "19.10.0";
|
|
206
206
|
|
|
207
207
|
exports["default"] = PrimaryButton$1;
|
|
208
208
|
exports.version = version;
|
|
@@ -179,7 +179,7 @@ PrimaryButton.displayName = 'PrimaryButton';
|
|
|
179
179
|
var PrimaryButton$1 = PrimaryButton;
|
|
180
180
|
|
|
181
181
|
// NOTE: This string will be replaced on build time with the package version.
|
|
182
|
-
var version = "19.
|
|
182
|
+
var version = "19.10.0";
|
|
183
183
|
|
|
184
184
|
exports["default"] = PrimaryButton$1;
|
|
185
185
|
exports.version = version;
|
|
@@ -181,6 +181,6 @@ PrimaryButton.displayName = 'PrimaryButton';
|
|
|
181
181
|
var PrimaryButton$1 = PrimaryButton;
|
|
182
182
|
|
|
183
183
|
// NOTE: This string will be replaced on build time with the package version.
|
|
184
|
-
var version = "19.
|
|
184
|
+
var version = "19.10.0";
|
|
185
185
|
|
|
186
186
|
export { PrimaryButton$1 as default, version };
|
|
@@ -1,18 +1,65 @@
|
|
|
1
1
|
import { MouseEvent, KeyboardEvent, ElementType, ReactElement, 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 PrimaryButton.
|
|
8
|
+
*/
|
|
3
9
|
type TSizes = '10' | '20';
|
|
4
10
|
export type TPrimaryButtonProps<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 `<PrimaryButton>` 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
|
+
* <br />
|
|
45
|
+
* Required when `as` is `undefined`
|
|
46
|
+
*/
|
|
12
47
|
onClick?: (event: MouseEvent<HTMLButtonElement> | KeyboardEvent<HTMLButtonElement>) => void;
|
|
48
|
+
/**
|
|
49
|
+
* Sets the size of the button.
|
|
50
|
+
* <br />
|
|
51
|
+
* `small`, `medium`, and `big` are deprecated. Use `10`, `20`, instead.
|
|
52
|
+
*/
|
|
13
53
|
size?: TLegacySizes | TSizes;
|
|
54
|
+
/**
|
|
55
|
+
* Indicates the color scheme of the button.
|
|
56
|
+
*/
|
|
14
57
|
tone?: 'urgent' | 'primary' | 'critical';
|
|
15
|
-
} &
|
|
58
|
+
} & /**
|
|
59
|
+
* Include any props derived from the React component passed to the `as` prop.
|
|
60
|
+
* For example, given `as={Link}`, all props of the `<Link>` component are allowed to be
|
|
61
|
+
* passed to `<PrimaryButton>`: <PrimaryButton as={Link} to="/foo" label="Foo" />.
|
|
62
|
+
*/ ComponentPropsWithRef<TStringOrComponent>;
|
|
16
63
|
declare const PrimaryButton: {
|
|
17
64
|
<TStringOrComponent extends ElementType = "button">(props: TPrimaryButtonProps<TStringOrComponent>): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
18
65
|
defaultProps: Pick<TPrimaryButtonProps<"button">, "size" | "type" | "tone" | "isToggleButton">;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-uikit/primary-button",
|
|
3
3
|
"description": "Primary buttons are used for a primary action on a page. You must also pass a label for accessibility reasons.",
|
|
4
|
-
"version": "19.
|
|
4
|
+
"version": "19.10.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.10.0",
|
|
25
|
+
"@commercetools-uikit/design-system": "19.10.0",
|
|
26
|
+
"@commercetools-uikit/spacings-inline": "19.10.0",
|
|
27
|
+
"@commercetools-uikit/text": "19.10.0",
|
|
28
|
+
"@commercetools-uikit/utils": "19.10.0",
|
|
29
29
|
"@emotion/react": "^11.10.5",
|
|
30
30
|
"@emotion/styled": "^11.10.5",
|
|
31
31
|
"lodash": "4.17.21",
|