@commercetools-uikit/icon-button 0.0.0-FCT-1500-adjust-legacy-css-reset-20250527090339

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2019 commercetools GmbH
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,76 @@
1
+ <!-- THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -->
2
+ <!-- This file is created by the `yarn generate-readme` script. -->
3
+
4
+ # IconButton
5
+
6
+ ## Description
7
+
8
+ Icon buttons are icon-only buttons. They trigger an action when clicked (\`onClick\` prop). You must also pass a label for accessibility reasons.
9
+
10
+ ## Installation
11
+
12
+ ```
13
+ yarn add @commercetools-uikit/icon-button
14
+ ```
15
+
16
+ ```
17
+ npm --save install @commercetools-uikit/icon-button
18
+ ```
19
+
20
+ Additionally install the peer dependencies (if not present)
21
+
22
+ ```
23
+ yarn add react
24
+ ```
25
+
26
+ ```
27
+ npm --save install react
28
+ ```
29
+
30
+ ## Usage
31
+
32
+ ```jsx
33
+ import IconButton from '@commercetools-uikit/icon-button';
34
+ import { InformationIcon } from '@commercetools-uikit/icons';
35
+
36
+ const Example = () => (
37
+ <IconButton
38
+ icon={<InformationIcon />}
39
+ label="A label text"
40
+ onClick={() => alert('Button clicked')}
41
+ />
42
+ );
43
+
44
+ export default Example;
45
+ ```
46
+
47
+ ## Properties
48
+
49
+ | Props | Type | Required | Default | Description |
50
+ | ---------------- | ----------------------------------------------------------------- | :------: | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
51
+ | `as` | `TStringOrComponent` | | | You may pass in a string like "a" to have the button element render an anchor tag, or&#xA;you could pass in a React Component, like a `Link`.&#xA;<br />&#xA;The `<IconButton>` additionally accepts any props or attributes specific to the given element or component. |
52
+ | `type` | `union`<br/>Possible values:<br/>`'button' , 'reset' , 'submit'` | | `'button'` | Used as the HTML type attribute. |
53
+ | `label` | `string` | ✅ | | Should describe what the button does, for accessibility purposes (screen-reader users) |
54
+ | `icon` | `ReactElement` | | | an <Icon /> component |
55
+ | `isToggleButton` | `boolean` | | `false` | 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. |
56
+ | `isToggled` | `boolean` | | | Tells when the button should present a toggled state. It does not have any effect when `isToggleButton` is `false`. |
57
+ | `isDisabled` | `boolean` | | | Tells when the button should present a disabled state. |
58
+ | `onClick` | `Function`<br/>[See signature.](#signature-onclick) | | | Handler when the button is clicked |
59
+ | `shape` | `union`<br/>Possible values:<br/>`'round' , 'square'` | | `'round'` | @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 |
60
+ | `theme` | `union`<br/>Possible values:<br/>`'default' , 'primary' , 'info'` | | `'default'` | The component may have a theme only if `isToggleButton` is `true` |
61
+ | `size` | `union`<br/>Possible values:<br/>`TLegacySizes , TSizes` | | `'40'` | Indicates the size of the icon. Available sizes are '10', '20', '30', '40'. |
62
+
63
+ ## Signatures
64
+
65
+ ### Signature `onClick`
66
+
67
+ ```ts
68
+ (
69
+ event: MouseEvent<HTMLButtonElement> | KeyboardEvent<HTMLButtonElement>
70
+ ) => void
71
+ ```
72
+
73
+ ### Examples in the Merchant Center
74
+
75
+ - Secondary action example: Delete product
76
+ - Minimize effect example: Reordering table
@@ -0,0 +1,3 @@
1
+ export * from "./declarations/src/index.js";
2
+ export { default } from "./declarations/src/index.js";
3
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tbWVyY2V0b29scy11aWtpdC1pY29uLWJ1dHRvbi5janMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4vZGVjbGFyYXRpb25zL3NyYy9pbmRleC5kLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBIn0=