@loja-integrada/admin-components 0.9.2 → 0.9.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loja-integrada/admin-components",
3
- "version": "0.9.2",
3
+ "version": "0.9.3",
4
4
  "author": "Loja Integrada Front-End Team",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -6,10 +6,10 @@ import { Button } from '../../Components/Button'
6
6
 
7
7
  export default {
8
8
  component: ActionBar,
9
- title: 'Layout/ActionBar'
9
+ title: 'Layout/ActionBar',
10
10
  } as Meta
11
11
 
12
- const Template: Story<ActionBarProps> = args => <ActionBar {...args} />
12
+ const Template: Story<ActionBarProps> = (args) => <ActionBar {...args} />
13
13
 
14
14
  export const Default = Template.bind({})
15
15
  Default.args = {
@@ -20,8 +20,8 @@ Default.args = {
20
20
  <Button variant="primary" icon="checkCircle" onClick={() => {}}>
21
21
  <span className="hidden lg:block">Criar novo registro</span>
22
22
  <span className="block lg:hidden">Criar</span>
23
- </Button>
24
- ]
23
+ </Button>,
24
+ ],
25
25
  }
26
26
 
27
27
  export const OnlyMobile = Template.bind({})
@@ -34,8 +34,9 @@ OnlyMobile.args = {
34
34
  <Button icon="checkCircle" onClick={() => {}}>
35
35
  Ativar
36
36
  </Button>,
37
+ <></>,
37
38
  <Button icon="ban" onClick={() => {}}>
38
39
  Inativar
39
- </Button>
40
- ]
41
- }
40
+ </Button>,
41
+ ],
42
+ }
@@ -50,22 +50,25 @@ const ActionBarComponent = ({ onlyMobile, children }: ActionBarProps) => {
50
50
  </div>
51
51
  )}
52
52
  <div className="lg:hidden">
53
- {React.Children.map(children, ({ props }) => (
54
- <button
55
- className={
56
- 'px-4 py-1 text-base-1' +
57
- (props?.loading ? ' pointer-events-none' : '')
58
- }
59
- onClick={props?.onClick}
60
- >
61
- {props?.loading ? (
62
- <Icon icon="loading" className="p-px" />
63
- ) : (
64
- props?.icon && <Icon icon={props?.icon} className="p-px" />
65
- )}
66
- <span className="block text-f8">{props.children}</span>
67
- </button>
68
- ))}
53
+ {React.Children.map(children, ({ props }) => {
54
+ if (!props.children) return
55
+ return (
56
+ <button
57
+ className={
58
+ 'px-4 py-1 text-base-1' +
59
+ (props?.loading ? ' pointer-events-none' : '')
60
+ }
61
+ onClick={props?.onClick}
62
+ >
63
+ {props?.loading ? (
64
+ <Icon icon="loading" className="p-px" />
65
+ ) : (
66
+ props?.icon && <Icon icon={props?.icon} className="p-px" />
67
+ )}
68
+ <span className="block text-f8">{props.children}</span>
69
+ </button>
70
+ )
71
+ })}
69
72
  </div>
70
73
  </div>
71
74
  </div>