@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/dist/admin-components.cjs.development.js +1 -0
- package/dist/admin-components.cjs.development.js.map +1 -1
- package/dist/admin-components.cjs.production.min.js +1 -1
- package/dist/admin-components.cjs.production.min.js.map +1 -1
- package/dist/admin-components.esm.js +1 -0
- package/dist/admin-components.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/Layout/ActionBar/ActionBar.stories.tsx +8 -7
- package/src/Layout/ActionBar/ActionBar.tsx +19 -16
package/package.json
CHANGED
|
@@ -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
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
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>
|