@platformatic/ui-components 0.1.80 → 0.1.82

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.
@@ -1,6 +1,27 @@
1
1
  'use strict'
2
2
  import ButtonFullRounded from '../components/ButtonFullRounded'
3
- import { COLORS_ICON, SIZES } from '../components/constants'
3
+ import { COLORS_ICON, SIZES, SMALL, MEDIUM, LARGE } from '../components/constants'
4
+ import Icons from '../components/icons'
5
+
6
+ const divStyle = {
7
+ width: '100%'
8
+ }
9
+
10
+ const row = {
11
+ display: 'flex',
12
+ width: '100%',
13
+ columnGap: '1rem',
14
+ alignItems: 'center'
15
+ }
16
+
17
+ const col = {
18
+ flex: 1
19
+ }
20
+
21
+ const paragraph = {
22
+ color: 'white',
23
+ fontSize: '12px'
24
+ }
4
25
 
5
26
  export default {
6
27
  title: 'Platformatic/ButtonFullRounded',
@@ -13,49 +34,62 @@ export default {
13
34
  bold: {
14
35
  type: 'boolean'
15
36
  },
16
- color: {
37
+ iconColor: {
17
38
  type: 'string',
18
39
  control: {
19
40
  type: 'radio',
20
41
  options: COLORS_ICON
21
42
  }
22
43
  },
23
- size: {
44
+ iconSize: {
24
45
  type: 'string',
25
46
  control: {
26
47
  type: 'radio',
27
48
  options: SIZES
28
49
  }
50
+ },
51
+ selected: {
52
+ type: 'boolean'
29
53
  }
30
54
  }
31
55
  }
32
56
 
33
57
  const Template = (args) => <ButtonFullRounded {...args} />
34
58
 
35
- export const WhiteLarge = Template.bind({})
36
- WhiteLarge.args = {
37
- iconName: 'PlayIcon',
38
- iconSize: 'large'
59
+ export const SingleButton = Template.bind({})
60
+ SingleButton.args = {
61
+ iconName: 'PlayIcon'
39
62
  }
40
63
 
41
- export const GreenSmall = Template.bind({})
42
- GreenSmall.args = {
43
- iconName: 'StopIcon',
44
- iconColor: 'main-green',
45
- iconSize: 'small'
46
- }
64
+ const AllCircleButtonsTemplate = (args) => {
65
+ const icons = Object.values(Icons).filter(icon => icon.name.indexOf('Circle') > -1)
47
66
 
48
- export const Disabled = Template.bind({})
49
-
50
- Disabled.args = {
51
- iconName: 'BellIcon',
52
- disabled: true
67
+ return (
68
+ <>
69
+ <div style={divStyle}>
70
+ <p style={paragraph}>All Buttons with Circle Icons: {icons.length} </p>
71
+ {icons.map((IconComponent, index) => (
72
+ <div style={row} key={index}>
73
+ <div style={col}>
74
+ <p style={paragraph}>#{index + 1}: {IconComponent.name}</p>
75
+ </div>
76
+ <div style={col}>
77
+ <ButtonFullRounded key={IconComponent.name} iconName={IconComponent.name} iconSize={SMALL} {...args} />
78
+ </div>
79
+ <div style={col}>
80
+ <ButtonFullRounded key={IconComponent.name} iconName={IconComponent.name} iconSize={MEDIUM} {...args} />
81
+ </div>
82
+ <div style={col}>
83
+ <ButtonFullRounded key={IconComponent.name} iconName={IconComponent.name} iconSize={LARGE} {...args} />
84
+ </div>
85
+ </div>
86
+ ))}
87
+ </div>
88
+ </>
89
+ )
53
90
  }
54
-
55
- export const DisabledRed = Template.bind({})
56
-
57
- DisabledRed.args = {
58
- iconName: 'StopIcon',
59
- iconColor: 'error-red',
60
- disabled: true
91
+ export const AllButtonFullRounded = AllCircleButtonsTemplate.bind({})
92
+ AllButtonFullRounded.args = {
93
+ iconColor: 'white',
94
+ onClick: null
61
95
  }
@@ -1,7 +1,7 @@
1
1
  import React from 'react'
2
2
  import PlatformaticIcon from '../components/PlatformaticIcon'
3
3
  import Icons from '../components/icons'
4
- import { COLORS_ICON } from '../components/constants'
4
+ import { COLORS_ICON, EXTRA_LARGE, EXTRA_SMALL, LARGE, MEDIUM, SMALL } from '../components/constants'
5
5
 
6
6
  const divStyle = {
7
7
  width: '100%'
@@ -64,16 +64,19 @@ const AllIconsTemplate = (args) => {
64
64
  <p style={paragraph}>#{index + 1}: {IconComponent.name}</p>
65
65
  </div>
66
66
  <div style={col}>
67
- <PlatformaticIcon key={IconComponent.name} iconName={IconComponent.name} size='small' {...args} />
67
+ <PlatformaticIcon key={IconComponent.name} iconName={IconComponent.name} size={EXTRA_SMALL} {...args} />
68
68
  </div>
69
69
  <div style={col}>
70
- <PlatformaticIcon key={IconComponent.name} iconName={IconComponent.name} size='medium' {...args} />
70
+ <PlatformaticIcon key={IconComponent.name} iconName={IconComponent.name} size={SMALL} {...args} />
71
71
  </div>
72
72
  <div style={col}>
73
- <PlatformaticIcon key={IconComponent.name} iconName={IconComponent.name} size='large' {...args} />
73
+ <PlatformaticIcon key={IconComponent.name} iconName={IconComponent.name} size={MEDIUM} {...args} />
74
74
  </div>
75
75
  <div style={col}>
76
- <PlatformaticIcon key={IconComponent.name} iconName={IconComponent.name} size='extra-large' {...args} />
76
+ <PlatformaticIcon key={IconComponent.name} iconName={IconComponent.name} size={LARGE} {...args} />
77
+ </div>
78
+ <div style={col}>
79
+ <PlatformaticIcon key={IconComponent.name} iconName={IconComponent.name} size={EXTRA_LARGE} {...args} />
77
80
  </div>
78
81
  </div>
79
82
  ))}
@@ -0,0 +1,28 @@
1
+ 'use strict'
2
+ import TabbedWindow from '../components/TabbedWindow'
3
+ import TextWithLabel from '../components/TextWithLabel'
4
+ export default {
5
+ title: 'Platformatic/TabbedWindow',
6
+ component: TabbedWindow
7
+ }
8
+ const Template = (args) => {
9
+ return (
10
+ <>
11
+ <TabbedWindow {...args} />
12
+ </>
13
+
14
+ )
15
+ }
16
+ export const Default = Template.bind({})
17
+ Default.args = {
18
+ tabs: [{
19
+ label: 'First',
20
+ component: () => <TextWithLabel label='First component' text='Lorem ipsum dolor sit amet, consectetur adipiscing elit.' />
21
+ }, {
22
+ label: 'Second',
23
+ component: () => <TextWithLabel label='Second component' text='Sed et dui facilisis, molestie urna sed, volutpat nibh' />
24
+ }, {
25
+ label: 'Third',
26
+ component: () => <TextWithLabel label='Third component' text='ivamus est nisl, maximus aliquet urna eu, consequat semper nisi' />
27
+ }]
28
+ }