@loja-integrada/admin-components 0.18.13 → 0.18.15

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.
Files changed (42) hide show
  1. package/dist/Icons/{Icon.d.ts → Icon/Icon.d.ts} +1 -1
  2. package/dist/Icons/{Icon.stories.d.ts → Icon/Icon.stories.d.ts} +0 -1
  3. package/dist/Icons/Icon/index.d.ts +1 -0
  4. package/dist/Icons/IconCircular/IconCircular.d.ts +19 -0
  5. package/dist/Icons/IconCircular/IconCircular.spec.d.ts +1 -0
  6. package/dist/Icons/IconCircular/IconCircular.stories.d.ts +6 -0
  7. package/dist/Icons/IconCircular/index.d.ts +1 -0
  8. package/dist/Icons/IconList.d.ts +3 -0
  9. package/dist/Icons/icons-path/Exclamation.d.ts +2 -0
  10. package/dist/Icons/icons-path/Filter.d.ts +2 -0
  11. package/dist/Icons/icons-path/IconSolidLI.d.ts +2 -0
  12. package/dist/Icons/icons-path/ThinAngleRight.d.ts +2 -0
  13. package/dist/Icons/icons-path/WhatsApp.d.ts +2 -0
  14. package/dist/Icons/icons-path/index.d.ts +5 -0
  15. package/dist/Icons/index.d.ts +1 -0
  16. package/dist/admin-components.cjs.development.js +944 -35
  17. package/dist/admin-components.cjs.development.js.map +1 -1
  18. package/dist/admin-components.cjs.production.min.js +1 -1
  19. package/dist/admin-components.cjs.production.min.js.map +1 -1
  20. package/dist/admin-components.esm.js +944 -36
  21. package/dist/admin-components.esm.js.map +1 -1
  22. package/package.json +5 -1
  23. package/src/Components/SidebarFixed/SidebarFixed.tsx +1 -1
  24. package/src/Forms/ToggleButton/ToggleButton.stories.tsx +5 -5
  25. package/src/Icons/Icon/Icon.stories.tsx +12 -0
  26. package/src/Icons/{Icon.tsx → Icon/Icon.tsx} +2 -2
  27. package/src/Icons/Icon/index.ts +1 -0
  28. package/src/Icons/IconCircular/IconCircular.spec.tsx +24 -0
  29. package/src/Icons/IconCircular/IconCircular.stories.tsx +24 -0
  30. package/src/Icons/IconCircular/IconCircular.tsx +67 -0
  31. package/src/Icons/IconCircular/index.ts +1 -0
  32. package/src/Icons/{Icon.stories.tsx → IconList.tsx} +8 -13
  33. package/src/Icons/icons-path/Exclamation.tsx +17 -0
  34. package/src/Icons/icons-path/Filter.tsx +9 -0
  35. package/src/Icons/icons-path/IconSolidLI.tsx +12 -0
  36. package/src/Icons/icons-path/ThinAngleRight.tsx +12 -0
  37. package/src/Icons/icons-path/WhatsApp.tsx +9 -0
  38. package/src/Icons/icons-path/index.ts +10 -0
  39. package/src/Icons/index.ts +1 -0
  40. package/src/Indicators/Tooltip/style.scss +1 -1
  41. /package/dist/Icons/{Icon.spec.d.ts → Icon/Icon.spec.d.ts} +0 -0
  42. /package/src/Icons/{Icon.spec.tsx → Icon/Icon.spec.tsx} +0 -0
package/package.json CHANGED
@@ -1,8 +1,12 @@
1
1
  {
2
2
  "name": "@loja-integrada/admin-components",
3
- "version": "0.18.13",
3
+ "version": "0.18.15",
4
4
  "author": "Loja Integrada Front-End Team",
5
5
  "license": "MIT",
6
+ "repository": {
7
+ "url": "lojaintegrada/admin-components",
8
+ "directory": "styleguide"
9
+ },
6
10
  "main": "dist/index.js",
7
11
  "typings": "dist/index.d.ts",
8
12
  "files": [
@@ -6,7 +6,7 @@ const backgroundShadowEffect = [
6
6
  '[background-size:100%_15px,100%_15px,100%_5px,100%_5px]',
7
7
  '[background-attachment:local,local,scroll,scroll]',
8
8
  '[background-repeat:no-repeat]',
9
- '[background-color:theme(colors.base-1/100]',
9
+ '[background-color:theme(colors.base-1/100)]',
10
10
  '[&_.form-group_.bg-base-1]:bg-transparent',
11
11
  ]
12
12
 
@@ -11,7 +11,7 @@ export default {
11
11
  const Template: Story<ToggleButtonProps> = (args) => <ToggleButton {...args} />
12
12
 
13
13
  export const WithIcon = Template.bind({})
14
- WithIcon.args = {
14
+ WithIcon.args = {
15
15
  disabled: false,
16
16
  children: [
17
17
  <Icon icon='desktop' key={1} />,
@@ -20,9 +20,9 @@ WithIcon.args = {
20
20
  }
21
21
 
22
22
  export const WithText = Template.bind({})
23
- WithText.args = {
23
+ WithText.args = {
24
24
  disabled: false,
25
- children: [
25
+ children: [
26
26
  <span key={1}>With Text</span>,
27
27
  <span key={2}>With Text</span>,
28
28
  <span key={3}>With Text</span>,
@@ -30,9 +30,9 @@ WithText.args = {
30
30
  }
31
31
 
32
32
  export const Disabled = Template.bind({})
33
- Disabled.args = {
33
+ Disabled.args = {
34
34
  disabled: true,
35
- children: [
35
+ children: [
36
36
  <span key={1}>Disabled</span>,
37
37
  <span key={2}>Disabled</span>,
38
38
  ]
@@ -0,0 +1,12 @@
1
+ import React from 'react'
2
+ import { Meta } from '@storybook/react'
3
+ import { Icon as IconComponent } from './Icon'
4
+
5
+ export default {
6
+ title: 'Icons/Icon',
7
+ component: IconComponent,
8
+ tags: ['autodocs'],
9
+ } as Meta
10
+
11
+ export const Example = (args: any) => <IconComponent {...args} />
12
+ Example.args = { icon: 'cog' }
@@ -1,5 +1,5 @@
1
1
  import React, { FunctionComponent } from 'react'
2
- import { icons } from './icons-path'
2
+ import { icons } from '../icons-path'
3
3
 
4
4
  const iconSizes = {
5
5
  1: 'h-1 w-1',
@@ -22,7 +22,7 @@ export const Icon: FunctionComponent<IconProps> = React.memo(
22
22
  if (className) classes += className
23
23
 
24
24
  const Path = icons[icon] || icons['minus']
25
- const viewBox = '0 0 18 18'
25
+ const viewBox = icon === 'exclamation' ? '0 0 6 30' : '0 0 18 18'
26
26
 
27
27
  return (
28
28
  <svg
@@ -0,0 +1 @@
1
+ export * from './Icon'
@@ -0,0 +1,24 @@
1
+ import * as React from "react"
2
+ import { composeStories } from "@storybook/testing-react"
3
+ import { mount } from "@cypress/react"
4
+ import * as stories from "./IconCircular.stories"
5
+
6
+ const { Default } = composeStories(stories)
7
+
8
+ const specTitle = require('cypress-sonarqube-reporter/specTitle');
9
+ describe(specTitle('IconCircular tests'), () => {
10
+
11
+ it('Default', () => {
12
+ mount(<Default variant="success" />)
13
+ cy.get('.icon-circular').should('have.class', 'bg-primary')
14
+ cy.get('svg path')
15
+ cy.get('svg').should('have.class', 'icon-check')
16
+ })
17
+
18
+ it('CustomIconAndBackground', () => {
19
+ mount(<Default icon="camera" bgClass="bg-[#d380ec]" />)
20
+ cy.get('.icon-circular').should('have.class', 'bg-[#d380ec]')
21
+ cy.get('svg path')
22
+ cy.get('svg').should('have.class', 'icon-camera')
23
+ })
24
+ })
@@ -0,0 +1,24 @@
1
+ import React from 'react'
2
+ import { Story, Meta } from '@storybook/react'
3
+ import { IconCircular as IconCircularComponent, IconCircularProps } from './IconCircular'
4
+
5
+ export default {
6
+ title: 'Icons/IconCircular',
7
+ component: IconCircularComponent,
8
+ } as Meta
9
+
10
+ const Template: Story<IconCircularProps> = args => <IconCircularComponent {...args} />
11
+
12
+ export const Default = Template.bind({})
13
+
14
+ export const CustomIcon = Template.bind({})
15
+ CustomIcon.args = {
16
+ icon: 'camera',
17
+ variant: 'danger'
18
+ }
19
+
20
+ export const CustomIconAndBackground = Template.bind({})
21
+ CustomIconAndBackground.args = {
22
+ icon: 'camera',
23
+ bgClass: 'bg-[#d380ec]',
24
+ }
@@ -0,0 +1,67 @@
1
+ import React, { FunctionComponent } from 'react'
2
+ import { Icon, IconProps } from '../Icon/Icon'
3
+
4
+ type variantType = 'success' | 'warning' | 'danger'
5
+ const variantsStyles: {
6
+ [key in variantType]: {
7
+ bgClass: string
8
+ icon: IconProps['icon']
9
+ }
10
+ } = {
11
+ success: {
12
+ bgClass: 'bg-primary',
13
+ icon: 'check',
14
+ },
15
+ warning: {
16
+ bgClass: 'bg-warning',
17
+ icon: 'exclamation',
18
+ },
19
+ danger: {
20
+ bgClass: 'bg-danger',
21
+ icon: 'times',
22
+ },
23
+ }
24
+
25
+ export const IconCircular: FunctionComponent<IconCircularProps> = React.memo(
26
+ ({
27
+ variant = 'success',
28
+ icon: customIcon,
29
+ bgClass: customBgClass,
30
+ }: IconCircularProps) => {
31
+ const icon = customIcon
32
+ ? customIcon
33
+ : variantsStyles[variant].icon || 'check'
34
+ const bgClass = customBgClass
35
+ ? customBgClass
36
+ : variantsStyles[variant].bgClass || 'bg-primary'
37
+
38
+ return (
39
+ <>
40
+ <div
41
+ className={`icon-circular flex w-20 h-20 mx-auto rounded-full items-center justify-center bg-opacity-20 ${bgClass}`}
42
+ >
43
+ <div
44
+ className={`flex w-14 h-14 rounded-full items-center justify-center ${bgClass}`}
45
+ >
46
+ <Icon icon={icon} className="text-base-1" size={7} block />
47
+ </div>
48
+ </div>
49
+ </>
50
+ )
51
+ }
52
+ )
53
+
54
+ export interface IconCircularProps {
55
+ /** Icon circular variant
56
+ * @default success
57
+ * */
58
+ variant?: variantType
59
+ /**
60
+ * Icon variation
61
+ */
62
+ icon?: IconProps['icon']
63
+ /**
64
+ * Custom class for background
65
+ */
66
+ bgClass?: string
67
+ }
@@ -0,0 +1 @@
1
+ export * from './IconCircular'
@@ -1,32 +1,27 @@
1
1
  import React from 'react'
2
- import { Meta } from '@storybook/react'
3
2
  import { Icon as IconComponent } from './Icon'
4
3
  import { icons } from './icons-path'
5
4
 
6
- export default {
7
- title: 'Icons',
8
- component: IconComponent,
9
- } as Meta
10
-
11
- export const Example = (args: any) => <IconComponent {...args} />
12
- Example.args = { icon: 'cog' }
13
-
14
- export const IconsList = () => {
5
+ const IconsList = () => {
15
6
  return (
16
7
  <>
17
- <div className="text-center mb-6">
8
+ <div className="text-f6 mb-10">
18
9
  There are {Object.keys(icons).length} icons
19
10
  </div>
20
11
  <ul className="grid grid-cols-6 gap-4 list-none">
21
- {(Object.keys(icons) as Array<keyof typeof icons>).map(key => (
12
+ {(Object.keys(icons) as Array<keyof typeof icons>).map((key) => (
22
13
  <li key={key} className="flex items-center min-w-0 group">
23
14
  <div className="shrink-0 border border-transparent group-hover:border-card-stroke rounded flex">
24
15
  <IconComponent icon={key} />
25
16
  </div>
26
- <div className="ml-4 overflow-hidden text-ellipsis min-w-0 text-f6">{key}</div>
17
+ <div className="ml-4 overflow-hidden text-ellipsis min-w-0 text-f6">
18
+ {key}
19
+ </div>
27
20
  </li>
28
21
  ))}
29
22
  </ul>
30
23
  </>
31
24
  )
32
25
  }
26
+
27
+ export default IconsList
@@ -0,0 +1,17 @@
1
+ import React from 'react'
2
+
3
+ export const Exclamation = () => (
4
+ <>
5
+ <path
6
+ fillRule="evenodd"
7
+ d="M3 0a3 3 0 0 1 3 3v14a3 3 0 1 1-6 0V3a3 3 0 0 1 3-3Z"
8
+ clipRule="evenodd"
9
+ />
10
+ <path d="M6 27a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z" />
11
+ <path
12
+ fillRule="evenodd"
13
+ d="M3 29a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm0 1a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"
14
+ clipRule="evenodd"
15
+ />
16
+ </>
17
+ )
@@ -0,0 +1,9 @@
1
+ import React from 'react'
2
+
3
+ export const Filter = () => (
4
+ <path
5
+ fillRule="evenodd"
6
+ clipRule="evenodd"
7
+ d="M15.5698 0H2.43384C0.145842 0 -0.844158 2.897 0.964842 4.298L5.70784 7.969C6.19784 8.348 6.48384 8.933 6.48384 9.552L6.47884 14.895C6.47884 15.653 6.90584 16.346 7.58484 16.685L9.92784 17.857C10.0898 17.937 10.2568 17.975 10.4198 17.975C10.9968 17.975 11.5198 17.511 11.5208 16.874L11.5248 9.55C11.5258 8.932 11.8118 8.349 12.2998 7.97L17.0398 4.297C18.8478 2.896 17.8568 0 15.5698 0ZM15.5698 1.5C16.1508 1.5 16.3588 1.926 16.4218 2.109C16.4838 2.292 16.5798 2.756 16.1208 3.111L11.3818 6.784C10.5198 7.452 10.0258 8.459 10.0248 9.549L10.0208 16.226L8.25584 15.343C8.08484 15.258 7.97884 15.086 7.97884 14.896L7.98384 9.553C7.98484 8.477 7.47684 7.441 6.62584 6.783L1.88284 3.112C1.42384 2.756 1.51984 2.292 1.58184 2.109C1.64484 1.926 1.85284 1.5 2.43384 1.5H15.5698Z"
8
+ />
9
+ )
@@ -0,0 +1,12 @@
1
+ import React from 'react'
2
+
3
+ export const IconSolidLI = () => (
4
+ <>
5
+ <path d="M14.637 6.84a2.67 2.67 0 1 0 0-5.34 2.67 2.67 0 0 0 0 5.34Z" />
6
+ <path
7
+ d="M5.97 9.987a3.134 3.134 0 0 0 6.124-.94v-.102a.73.73 0 0 1 .73-.73h3.625a.73.73 0 0 1 .73.73v.09a8.213 8.213 0 0 1-8.047 8.213C4.514 17.34.75 13.542.75 8.921V5.44a2.538 2.538 0 1 1 5.076 0v3.608c0 .319.049.636.144.94Z"
8
+ fillRule="evenodd"
9
+ clipRule="evenodd"
10
+ />
11
+ </>
12
+ )
@@ -0,0 +1,12 @@
1
+ import React from 'react'
2
+
3
+ export const ThinAngleRight = () => (
4
+ <path
5
+ d="M6.75 4.5L11.25 9L6.75 13.5"
6
+ fill="none"
7
+ stroke="currentColor"
8
+ strokeWidth="1.4"
9
+ strokeLinecap="round"
10
+ strokeLinejoin="round"
11
+ />
12
+ )
@@ -0,0 +1,9 @@
1
+ import React from 'react'
2
+
3
+ export const WhatsApp = () => (
4
+ <path
5
+ fillRule="evenodd"
6
+ clipRule="evenodd"
7
+ d="M1.68502 9.00599C1.68402 10.288 2.01902 11.539 2.65602 12.642L1.62402 16.412L5.48002 15.401C6.54202 15.98 7.73802 16.286 8.95602 16.286H8.95902C12.968 16.286 16.232 13.022 16.233 9.01199C16.234 7.06899 15.477 5.23999 14.105 3.86499C12.731 2.48999 10.904 1.73199 8.95902 1.73199C4.94902 1.73199 1.68602 4.99499 1.68502 9.00599ZM3.98102 12.452L3.83702 12.224C3.23202 11.262 2.91202 10.148 2.91202 9.00599C2.91402 5.67299 5.62702 2.96099 8.96102 2.96099C10.576 2.96099 12.093 3.59099 13.235 4.73299C14.377 5.87699 15.006 7.39499 15.005 9.01099C15.004 12.344 12.291 15.058 8.95902 15.058H8.95702C7.87102 15.057 6.80802 14.765 5.88002 14.215L5.65802 14.083L3.37002 14.684L3.98102 12.452ZM5.89902 5.87399C5.73202 6.05599 5.26202 6.49599 5.26202 7.39099C5.26202 8.28499 5.91402 9.14899 6.00502 9.27099C6.09602 9.39099 7.28602 11.227 9.11002 12.015C9.54402 12.202 9.88202 12.315 10.147 12.398C10.581 12.536 10.977 12.516 11.291 12.469C11.64 12.418 12.366 12.03 12.517 11.605C12.669 11.181 12.669 10.817 12.624 10.742C12.578 10.666 12.457 10.62 12.275 10.529C12.093 10.438 11.201 9.99799 11.033 9.93799C10.867 9.87699 10.745 9.84699 10.624 10.029C10.503 10.21 10.156 10.62 10.049 10.742C9.94302 10.862 9.83702 10.878 9.65502 10.787C9.47302 10.697 8.88702 10.504 8.19402 9.88499C7.65402 9.40199 7.28802 8.80699 7.18202 8.62599C7.07602 8.44399 7.17102 8.34599 7.26202 8.25499C7.34402 8.17299 7.44402 8.04199 7.53502 7.93599C7.62602 7.82999 7.65502 7.75299 7.71702 7.63299C7.77702 7.51099 7.74602 7.40499 7.70102 7.31399C7.65502 7.22299 7.29302 6.32899 7.14102 5.96499C7.01002 5.65199 6.87802 5.65299 6.77302 5.65399C6.75802 5.65399 6.74502 5.65399 6.73202 5.65299C6.62602 5.64799 6.50502 5.64699 6.38402 5.64699C6.26202 5.64699 6.06502 5.69299 5.89902 5.87399Z"
8
+ />
9
+ )
@@ -27,9 +27,11 @@ import { Product } from './Product'
27
27
  import { Edit } from './Edit'
28
28
  import { Exchange } from './Exchange'
29
29
  import { Eye } from './Eye'
30
+ import { Exclamation } from './Exclamation'
30
31
  import { ExclamationCircle } from './ExclamationCircle'
31
32
  import { ExclamationTriangle } from './ExclamationTriangle'
32
33
  import { ExternalLink } from './ExternalLink'
34
+ import { Filter } from './Filter'
33
35
  import { HalfBack } from './HalfBack'
34
36
  import { Home } from './Home'
35
37
  import { Image } from './Image'
@@ -65,6 +67,9 @@ import { Lightbulb } from './Lightbulb'
65
67
  import { Camera } from './Camera'
66
68
  import { Nav } from './Nav'
67
69
  import { ShoppingCart } from './ShoppingCart'
70
+ import { WhatsApp } from './WhatsApp'
71
+ import { IconSolidLI } from './IconSolidLI'
72
+ import { ThinAngleRight } from './ThinAngleRight'
68
73
 
69
74
  export const icons = {
70
75
  adjust: Adjust,
@@ -100,9 +105,11 @@ export const icons = {
100
105
  edit: Edit,
101
106
  exchange: Exchange,
102
107
  eye: Eye,
108
+ exclamation: Exclamation,
103
109
  exclamationCircle: ExclamationCircle,
104
110
  exclamationTriangle: ExclamationTriangle,
105
111
  externalLink: ExternalLink,
112
+ filter: Filter,
106
113
  halfBack: HalfBack,
107
114
  home: Home,
108
115
  image: Image,
@@ -135,4 +142,7 @@ export const icons = {
135
142
  questionCircle: QuestionCircle,
136
143
  sync: Sync,
137
144
  user: User,
145
+ whatsapp: WhatsApp,
146
+ iconSolidLI: IconSolidLI,
147
+ thinAngleRight: ThinAngleRight,
138
148
  }
@@ -1 +1,2 @@
1
1
  export * from './Icon'
2
+ export * from './IconCircular'
@@ -58,7 +58,7 @@
58
58
  }
59
59
 
60
60
  .tippy-arrow {
61
- @apply text-inverted-1 w-4 h-4 text-inverted-1;
61
+ @apply text-inverted-1 w-4 h-4;
62
62
  }
63
63
 
64
64
  .tippy-arrow:before {
File without changes