@loja-integrada/admin-components 0.8.9 → 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.8.9",
3
+ "version": "0.9.3",
4
4
  "author": "Loja Integrada Front-End Team",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -4,7 +4,7 @@ import ReactModal from 'react-modal'
4
4
  import { Icon } from '../../Icons'
5
5
 
6
6
  const sizeClasses = {
7
- small: 'sm:max-w-xl',
7
+ small: 'sm:max-w-[600px]',
8
8
  default: 'sm:max-w-4xl',
9
9
  large: 'sm:max-w-6xl',
10
10
  }
@@ -0,0 +1,9 @@
1
+ import React from 'react'
2
+
3
+ export const Image = () => (
4
+ <path
5
+ fillRule="evenodd"
6
+ d="M10.5 5a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0Zm5.5 7.5H2a.5.5 0 0 1-.5-.5v-.937L5.176 8.39a2.247 2.247 0 0 1 2.647 0l2.188 1.59a3.759 3.759 0 0 0 4.027.246L16.5 8.857V12a.5.5 0 0 1-.5.5ZM2 1.5h14a.5.5 0 0 1 .5.5v5.261a.704.704 0 0 0-.364.084l-2.827 1.57a2.258 2.258 0 0 1-2.416-.147L8.706 7.177a3.743 3.743 0 0 0-4.412 0L1.5 9.209V2a.5.5 0 0 1 .5-.5ZM16 0H2a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2Z"
7
+ clipRule="evenodd"
8
+ />
9
+ )
@@ -0,0 +1,9 @@
1
+ import React from 'react'
2
+
3
+ export const Move = () => (
4
+ <path
5
+ fillRule="evenodd"
6
+ d="M9.5 14c0-.828-.672-1.5-1.5-1.5s-1.5.672-1.5 1.5.672 1.5 1.5 1.5 1.5-.672 1.5-1.5zm-6 0c0-.828-.671-1.5-1.5-1.5S.5 13.172.5 14s.671 1.5 1.5 1.5 1.5-.672 1.5-1.5zm6-12C9.5 1.172 8.828.5 8 .5S6.5 1.172 6.5 2 7.172 3.5 8 3.5 9.5 2.828 9.5 2zm-6 0C3.5 1.172 2.829.5 2 .5S.5 1.172.5 2 1.171 3.5 2 3.5 3.5 2.828 3.5 2zm6 6c0-.828-.672-1.5-1.5-1.5S6.5 7.172 6.5 8 7.172 9.5 8 9.5 9.5 8.828 9.5 8zM2 9.5C1.171 9.5.5 8.828.5 8S1.171 6.5 2 6.5s1.5.672 1.5 1.5S2.829 9.5 2 9.5z"
7
+ clipRule="evenodd"
8
+ />
9
+ )
@@ -0,0 +1,9 @@
1
+ import React from 'react'
2
+
3
+ export const Sync = () => (
4
+ <path
5
+ fillRule="evenodd"
6
+ d="M15.228 1.731 14.12 2.938C12.175.9 10.174 0 7.64 0 3.935 0 0 2.667 0 7.556h1.347c0-4 3.165-6.173 6.292-6.173 2.182 0 3.86.762 5.56 2.561l-1.405 1.534a.444.444 0 0 0 .327.745h3.435c.245 0 .444-.2.444-.445V2.031a.444.444 0 0 0-.772-.3Zm-.574 6.714H16C16 13.334 12.064 16 8.36 16c-2.534 0-4.535-.9-6.482-2.938L.772 14.268a.444.444 0 0 1-.772-.3v-3.745c0-.247.199-.445.445-.445h3.432c.386 0 .588.46.328.745L2.8 12.055c1.702 1.8 3.379 2.562 5.56 2.562 3.127 0 6.294-2.172 6.294-6.172Z"
7
+ clipRule="evenodd"
8
+ />
9
+ )
@@ -23,6 +23,8 @@ import { Eye } from './Eye'
23
23
  import { ExclamationTriangle } from './ExclamationTriangle'
24
24
  import { ExternalLink } from './ExternalLink'
25
25
  import { Home } from './Home'
26
+ import { Image } from './Image'
27
+ import { Move } from './Move'
26
28
  import { Order } from './Order'
27
29
  import { Pagali } from './Pagali'
28
30
  import { PaperList } from './PaperList'
@@ -40,6 +42,7 @@ import { Truck } from './Truck'
40
42
  import { UsdCircle } from './UsdCircle'
41
43
  import { QuestionCircle } from './QuestionCircle'
42
44
  import { Search } from './Search'
45
+ import { Sync } from './Sync'
43
46
  import { AngleDiagonal } from './AngleDiagonal'
44
47
  import { AngleHeight } from './AngleHeight'
45
48
  import { AngleWidth } from './AngleWidth'
@@ -73,6 +76,8 @@ export const icons = {
73
76
  exclamationTriangle: ExclamationTriangle,
74
77
  externalLink: ExternalLink,
75
78
  home: Home,
79
+ image: Image,
80
+ move: Move,
76
81
  order: Order,
77
82
  pagali: Pagali,
78
83
  paperList: PaperList,
@@ -91,4 +96,5 @@ export const icons = {
91
96
  truck: Truck,
92
97
  usdCircle: UsdCircle,
93
98
  questionCircle: QuestionCircle,
99
+ sync: Sync,
94
100
  }
@@ -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>