@commercetools-uikit/icon-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.
@@ -193,7 +193,7 @@ IconButton.displayName = 'IconButton';
193
193
  var IconButton$1 = IconButton;
194
194
 
195
195
  // NOTE: This string will be replaced on build time with the package version.
196
- var version = "19.9.0";
196
+ var version = "19.11.0";
197
197
 
198
198
  exports["default"] = IconButton$1;
199
199
  exports.version = version;
@@ -172,7 +172,7 @@ IconButton.displayName = 'IconButton';
172
172
  var IconButton$1 = IconButton;
173
173
 
174
174
  // NOTE: This string will be replaced on build time with the package version.
175
- var version = "19.9.0";
175
+ var version = "19.11.0";
176
176
 
177
177
  exports["default"] = IconButton$1;
178
178
  exports.version = version;
@@ -174,6 +174,6 @@ IconButton.displayName = 'IconButton';
174
174
  var IconButton$1 = IconButton;
175
175
 
176
176
  // NOTE: This string will be replaced on build time with the package version.
177
- var version = "19.9.0";
177
+ var version = "19.11.0";
178
178
 
179
179
  export { IconButton$1 as default, version };
@@ -1,22 +1,68 @@
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 IconButton.
8
+ */
3
9
  type TSizes = '10' | '20' | '30' | '40';
4
10
  export type TIconButtonProps<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 `<IconButton>` 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
+ * an <Icon /> component
28
+ */
8
29
  icon?: 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
+ * @deprecated This prop is only used in the old theme. For the new theme this prop will not be taken into account and `square` is used by default
48
+ */
13
49
  shape?: 'round' | 'square';
50
+ /**
51
+ * The component may have a theme only if `isToggleButton` is `true`
52
+ */
14
53
  theme?: 'default' | 'primary' | 'info';
54
+ /**
55
+ * Indicates the size of the icon. Available sizes are '10', '20', '30', '40'.
56
+ */
15
57
  size?: TLegacySizes | TSizes;
16
- } & ComponentPropsWithRef<TStringOrComponent>;
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 `<IconButton>`: <IconButton as={Link} to="/foo" label="Foo" />.
62
+ */ ComponentPropsWithRef<TStringOrComponent>;
17
63
  declare const IconButton: {
18
64
  <TStringOrComponent extends ElementType = "button">(props: TIconButtonProps<TStringOrComponent>): import("@emotion/react/jsx-runtime").JSX.Element;
19
- defaultProps: Pick<TIconButtonProps<"button">, "size" | "type" | "theme" | "shape" | "isToggleButton">;
65
+ defaultProps: Pick<TIconButtonProps<"button">, "type" | "theme" | "size" | "shape" | "isToggleButton">;
20
66
  displayName: string;
21
67
  };
22
68
  export default IconButton;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@commercetools-uikit/icon-button",
3
3
  "description": "Icon buttons are icon-only buttons. They trigger an action when clicked (`onClick` prop). You must also pass a label for accessibility reasons.",
4
- "version": "19.9.0",
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.9.0",
25
- "@commercetools-uikit/design-system": "19.9.0",
26
- "@commercetools-uikit/spacings": "19.9.0",
27
- "@commercetools-uikit/text": "19.9.0",
28
- "@commercetools-uikit/utils": "19.9.0",
24
+ "@commercetools-uikit/accessible-button": "19.11.0",
25
+ "@commercetools-uikit/design-system": "19.11.0",
26
+ "@commercetools-uikit/spacings": "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",