@platformatic/ui-components 0.1.149 → 0.1.152

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.
@@ -0,0 +1,75 @@
1
+ 'use strict'
2
+ import React from 'react'
3
+ import ButtonOnlyIcon from '../components/ButtonOnlyIcon'
4
+ import { COLORS_BUTTON, HOVER_EFFECTS_BUTTONS, SIZES, WHITE, RICH_BLACK, BACKGROUND_COLOR_OPAQUE, SMALL } from '../components/constants'
5
+
6
+ const divStyle = {
7
+ width: '100%',
8
+ height: 'auto',
9
+ padding: '2px',
10
+ backgroundColor: 'white'
11
+ }
12
+
13
+ export default {
14
+ title: 'Platformatic/ButtonOnlyIcon',
15
+ component: ButtonOnlyIcon,
16
+ decorators: [
17
+ (Story) => (
18
+ <div style={divStyle}>
19
+ <Story />
20
+ </div>
21
+ )
22
+ ],
23
+ argTypes: {
24
+ altLabel: {
25
+ type: 'string',
26
+ control: 'text'
27
+ },
28
+ bold: {
29
+ type: 'boolean'
30
+ },
31
+ backgroundColor: {
32
+ type: 'radio',
33
+ options: COLORS_BUTTON
34
+ },
35
+ color: {
36
+ type: 'radio',
37
+ options: COLORS_BUTTON
38
+ },
39
+ disabled: {
40
+ type: 'boolean'
41
+ },
42
+ size: {
43
+ type: 'string',
44
+ control: {
45
+ type: 'radio',
46
+ options: SIZES
47
+ }
48
+ },
49
+ hoverEffect: {
50
+ type: 'radio',
51
+ options: HOVER_EFFECTS_BUTTONS
52
+ },
53
+ bordered: {
54
+ type: 'boolean'
55
+ },
56
+ fullWidth: {
57
+ type: 'boolean'
58
+ },
59
+ selected: {
60
+ type: 'boolean'
61
+ }
62
+ }
63
+ }
64
+
65
+ const OnlyIconTemplate = (args) => (<ButtonOnlyIcon {...args} />)
66
+
67
+ export const OnlyIcon = OnlyIconTemplate.bind({})
68
+
69
+ OnlyIcon.args = {
70
+ color: WHITE,
71
+ backgroundColor: RICH_BLACK,
72
+ onClick: () => { alert('hit!') },
73
+ hoverEffect: BACKGROUND_COLOR_OPAQUE,
74
+ platformaticIcon: { size: SMALL, iconName: 'RunningIcon', color: WHITE }
75
+ }