@loja-integrada/admin-components 0.18.34 → 0.18.35
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/Indicators/InformationBox/InformationBox.d.ts +1 -1
- package/dist/admin-components.cjs.development.js +17 -17
- 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 +17 -17
- package/dist/admin-components.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/Indicators/InformationBox/InformationBox.spec.tsx +11 -12
- package/src/Indicators/InformationBox/InformationBox.tsx +13 -13
- package/src/Indicators/InformationBox/InformationBoxt.stories.tsx +7 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loja-integrada/admin-components",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.35",
|
|
4
4
|
"author": "Loja Integrada Front-End Team",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -134,7 +134,7 @@
|
|
|
134
134
|
"tailwindcss": ">=3.1.0"
|
|
135
135
|
},
|
|
136
136
|
"dependencies": {
|
|
137
|
-
"@loja-integrada/tailwindcss-config": "^1.7.
|
|
137
|
+
"@loja-integrada/tailwindcss-config": "^1.7.6",
|
|
138
138
|
"@tippyjs/react": "^4.2.5",
|
|
139
139
|
"@types/react-select": "^4.0.17",
|
|
140
140
|
"babel-jest": "^29.2.2",
|
|
@@ -5,28 +5,27 @@ import * as stories from './InformationBoxt.stories'
|
|
|
5
5
|
|
|
6
6
|
const { Default } = composeStories(stories)
|
|
7
7
|
|
|
8
|
-
const specTitle = require('cypress-sonarqube-reporter/specTitle')
|
|
8
|
+
const specTitle = require('cypress-sonarqube-reporter/specTitle')
|
|
9
9
|
describe(specTitle('InformationBox tests'), () => {
|
|
10
10
|
it('Default', () => {
|
|
11
11
|
mount(<Default />)
|
|
12
|
-
cy.get('.InformationBox-title').last().contains('
|
|
12
|
+
cy.get('.InformationBox-title').last().contains('Informação')
|
|
13
13
|
})
|
|
14
14
|
|
|
15
15
|
it('Variants', () => {
|
|
16
|
-
mount(<Default type="tip" />)
|
|
17
|
-
cy.get('.InformationBox-icon').should('have.class', 'icon-lightbulb')
|
|
18
|
-
cy.get('.InformationBox').should('have.class', 'bg-success-light')
|
|
19
|
-
|
|
20
16
|
mount(<Default type="warning" />)
|
|
21
|
-
cy.get('.InformationBox-icon').should('have.class', 'icon-
|
|
17
|
+
cy.get('.InformationBox-icon').should('have.class', 'icon-infoCircle')
|
|
22
18
|
cy.get('.InformationBox').should('have.class', 'bg-warning-light')
|
|
23
19
|
|
|
24
20
|
mount(<Default type="danger" />)
|
|
25
|
-
cy.get('.InformationBox-icon').should(
|
|
21
|
+
cy.get('.InformationBox-icon').should(
|
|
22
|
+
'have.class',
|
|
23
|
+
'icon-exclamationTriangle'
|
|
24
|
+
)
|
|
26
25
|
cy.get('.InformationBox').should('have.class', 'bg-danger-light')
|
|
27
|
-
|
|
28
|
-
mount(<Default type="
|
|
29
|
-
cy.get('.InformationBox-icon').should('have.class', 'icon-
|
|
30
|
-
cy.get('.InformationBox').should('have.class', 'bg-
|
|
26
|
+
|
|
27
|
+
mount(<Default type="success" />)
|
|
28
|
+
cy.get('.InformationBox-icon').should('have.class', 'icon-check')
|
|
29
|
+
cy.get('.InformationBox').should('have.class', 'bg-success-light')
|
|
31
30
|
})
|
|
32
31
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { Icon, IconProps } from '../../Icons'
|
|
3
3
|
|
|
4
|
-
type InformationBoxTypesOptions = '
|
|
4
|
+
type InformationBoxTypesOptions = 'success' | 'warning' | 'danger' | 'info'
|
|
5
5
|
|
|
6
6
|
const InformationBoxTypes: Record<
|
|
7
7
|
InformationBoxTypesOptions,
|
|
@@ -12,34 +12,34 @@ const InformationBoxTypes: Record<
|
|
|
12
12
|
iconClass: string
|
|
13
13
|
}
|
|
14
14
|
> = {
|
|
15
|
-
|
|
16
|
-
title: '
|
|
17
|
-
class: 'bg-success-light border-success',
|
|
18
|
-
icon: '
|
|
19
|
-
iconClass: 'text-success',
|
|
15
|
+
success: {
|
|
16
|
+
title: 'Sucesso!',
|
|
17
|
+
class: 'bg-success-light dark:bg-success border-success',
|
|
18
|
+
icon: 'check',
|
|
19
|
+
iconClass: 'text-success-dark',
|
|
20
20
|
},
|
|
21
21
|
warning: {
|
|
22
22
|
title: 'Atenção!',
|
|
23
23
|
class: 'bg-warning-light border-warning',
|
|
24
|
-
icon: '
|
|
25
|
-
iconClass: 'text-warning',
|
|
24
|
+
icon: 'infoCircle',
|
|
25
|
+
iconClass: 'text-warning-dark',
|
|
26
26
|
},
|
|
27
27
|
danger: {
|
|
28
28
|
title: 'Cuidado!',
|
|
29
29
|
class: 'bg-danger-light border-danger',
|
|
30
|
-
icon: '
|
|
31
|
-
iconClass: 'text-danger',
|
|
30
|
+
icon: 'exclamationTriangle',
|
|
31
|
+
iconClass: 'text-danger-dark',
|
|
32
32
|
},
|
|
33
33
|
info: {
|
|
34
|
-
title: 'Informação
|
|
34
|
+
title: 'Informação',
|
|
35
35
|
class: 'bg-focus-light border-focus-dark',
|
|
36
|
-
icon: '
|
|
36
|
+
icon: 'lightbulb',
|
|
37
37
|
iconClass: 'text-focus-dark',
|
|
38
38
|
},
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
const InformationBoxComponent = ({
|
|
42
|
-
type = '
|
|
42
|
+
type = 'info',
|
|
43
43
|
subtitle,
|
|
44
44
|
title,
|
|
45
45
|
}: InformationBoxProps) => {
|
|
@@ -15,10 +15,15 @@ export default {
|
|
|
15
15
|
},
|
|
16
16
|
args: {
|
|
17
17
|
title: '',
|
|
18
|
-
subtitle:
|
|
18
|
+
subtitle:
|
|
19
|
+
'Como criar um cadastro de produto incrível? No mundo virtual, o consumidor não pode pegar, sentir ou experimentar o produto. Por isso, a imagem que você utiliza faz toda a diferença na hora da venda.',
|
|
19
20
|
},
|
|
20
21
|
} as Meta
|
|
21
22
|
|
|
22
|
-
const Template: Story<InformationBoxProps> = args =>
|
|
23
|
+
const Template: Story<InformationBoxProps> = (args) => (
|
|
24
|
+
<div className="max-w-4xl mx-auto">
|
|
25
|
+
<InformationBox {...args} />
|
|
26
|
+
</div>
|
|
27
|
+
)
|
|
23
28
|
|
|
24
29
|
export const Default = Template.bind({})
|