@loja-integrada/admin-components 0.18.32 → 0.18.34
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/Components/Button/Button.d.ts +1 -1
- package/dist/admin-components.cjs.development.js +221 -230
- 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 +221 -230
- package/dist/admin-components.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/Components/Button/Button.spec.tsx +1 -4
- package/src/Components/Button/Button.tsx +13 -22
- package/src/Components/Tabs/TabsItem.tsx +1 -0
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.34",
|
|
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.4",
|
|
138
138
|
"@tippyjs/react": "^4.2.5",
|
|
139
139
|
"@types/react-select": "^4.0.17",
|
|
140
140
|
"babel-jest": "^29.2.2",
|
|
@@ -57,14 +57,11 @@ describe(specTitle('Button tests'), () => {
|
|
|
57
57
|
|
|
58
58
|
it('Variants', () => {
|
|
59
59
|
mount(<Default variant="secondary" />)
|
|
60
|
-
cy.get('button').should('have.class', 'bg-
|
|
60
|
+
cy.get('button').should('have.class', 'bg-primary-light')
|
|
61
61
|
|
|
62
62
|
mount(<Default variant="tertiary" />)
|
|
63
63
|
cy.get('button').should('have.class', 'bg-inverted-2 text-on-primary')
|
|
64
64
|
|
|
65
|
-
mount(<Default variant="info" />)
|
|
66
|
-
cy.get('button').should('have.class', 'bg-secondary-dark text-base-1')
|
|
67
|
-
|
|
68
65
|
mount(<Default variant="warning" />)
|
|
69
66
|
cy.get('button').should('have.class', 'bg-warning text-on-base')
|
|
70
67
|
|
|
@@ -7,14 +7,13 @@ const listOfStylesHover = {
|
|
|
7
7
|
secondary: `hover:bg-secondary-dark`,
|
|
8
8
|
outlineSecondary: `hover:bg-primary-light`,
|
|
9
9
|
tertiary: `hover:bg-tertiary-dark`,
|
|
10
|
-
info: `hover:bg-secondary-bold`,
|
|
11
10
|
warning: `hover:bg-warning-dark`,
|
|
12
11
|
danger: `hover:bg-danger-dark`,
|
|
13
12
|
outline: `hover:bg-primary-light`,
|
|
14
13
|
onlyText: `hover:bg-base-2`,
|
|
15
14
|
}
|
|
16
15
|
const listOfStylesActive = {
|
|
17
|
-
primary: `active:bg-primary-
|
|
16
|
+
primary: `active:bg-primary-dark`,
|
|
18
17
|
secondary: `active:shadow-inner`,
|
|
19
18
|
outlineSecondary: `active:shadow-inner active:bg-base-1`,
|
|
20
19
|
tertiary: `active:bg-tertiary-bold`,
|
|
@@ -23,24 +22,18 @@ const listOfStylesActive = {
|
|
|
23
22
|
outline: `active:shadow-inner active:bg-base-1`,
|
|
24
23
|
onlyText: `active:bg-base-1`,
|
|
25
24
|
}
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
outlineSecondary: `focus:ring-2 focus:ring-focus focus:ring-offset-1`,
|
|
30
|
-
danger: `focus:ring-1 focus:ring-danger-dark`,
|
|
31
|
-
outline: `focus:ring-2 focus:ring-focus focus:ring-offset-1`,
|
|
32
|
-
onlyText: `focus:bg-base-1`,
|
|
33
|
-
}
|
|
25
|
+
const commonFocus =
|
|
26
|
+
'focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-1'
|
|
27
|
+
|
|
34
28
|
const listOfStyles = {
|
|
35
|
-
primary: `bg-primary text-base-1 ${listOfStylesHover['primary']} ${listOfStylesActive['primary']} ${
|
|
36
|
-
secondary: `bg-
|
|
37
|
-
outlineSecondary: `bg-transparent text-primary border border-primary ${listOfStylesHover['outlineSecondary']} ${listOfStylesActive['outlineSecondary']} ${
|
|
38
|
-
tertiary: `bg-inverted-2 text-on-primary ${listOfStylesHover['tertiary']} ${listOfStylesActive['tertiary']}`,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
onlyText: `bg-transparent border-transparent text-inverted-2 px-0 ${listOfStylesHover['onlyText']} ${listOfStylesActive['onlyText']} ${listOfStylesFocus['onlyText']}`,
|
|
29
|
+
primary: `bg-primary text-base-1 ${listOfStylesHover['primary']} ${listOfStylesActive['primary']} ${commonFocus}`,
|
|
30
|
+
secondary: `bg-primary-light text-primary-bold ${listOfStylesHover['secondary']} ${listOfStylesActive['secondary']} ${commonFocus}`,
|
|
31
|
+
outlineSecondary: `bg-transparent text-primary border border-primary ${listOfStylesHover['outlineSecondary']} ${listOfStylesActive['outlineSecondary']} ${commonFocus}`,
|
|
32
|
+
tertiary: `bg-inverted-2 text-on-primary ${listOfStylesHover['tertiary']} ${listOfStylesActive['tertiary']} ${commonFocus}`,
|
|
33
|
+
warning: `bg-warning text-on-base ${listOfStylesHover['warning']} ${listOfStylesActive['warning']} ${commonFocus}`,
|
|
34
|
+
danger: `bg-danger text-base-1 ${listOfStylesHover['danger']} ${listOfStylesActive['danger']} ${commonFocus}`,
|
|
35
|
+
outline: `bg-transparent text-inverted-2 border border-inverted-2 ${listOfStylesHover['outline']} ${listOfStylesActive['outline']} ${commonFocus}`,
|
|
36
|
+
onlyText: `bg-transparent border-transparent text-inverted-2 px-0 ${listOfStylesHover['onlyText']} ${listOfStylesActive['onlyText']} ${commonFocus}`,
|
|
44
37
|
}
|
|
45
38
|
|
|
46
39
|
const defaultDisabledStyle = `bg-base-3 cursor-default text-on-base-2 shadow-none ring-0 border-0 hover:bg-base-3 hover:text-on-base-2 `
|
|
@@ -49,7 +42,6 @@ const listOfStylesDisabled = {
|
|
|
49
42
|
secondary: `bg-base-2 cursor-default text-card-stroke shadow-none ring-0 border-0 `,
|
|
50
43
|
outlineSecondary: `bg-base-2 cursor-default text-card-stroke shadow-none ring-0 border-0 `,
|
|
51
44
|
tertiary: defaultDisabledStyle,
|
|
52
|
-
info: defaultDisabledStyle,
|
|
53
45
|
warning: defaultDisabledStyle,
|
|
54
46
|
danger: defaultDisabledStyle,
|
|
55
47
|
outline: defaultDisabledStyle,
|
|
@@ -105,7 +97,7 @@ const ButtonComponent = (
|
|
|
105
97
|
;(!disabled || !loading) && onClick && onClick(event)
|
|
106
98
|
}
|
|
107
99
|
|
|
108
|
-
let classes = `inline-flex leading-none font-semibold tracking-tight items-center justify-center px-5 text-center no-underline cursor-pointer transition rounded after:align-middle focus:outline-none `
|
|
100
|
+
let classes = `inline-flex leading-none font-semibold tracking-tight items-center justify-center px-5 text-center no-underline cursor-pointer transition rounded-md after:align-middle focus:outline-none `
|
|
109
101
|
|
|
110
102
|
if (loading) {
|
|
111
103
|
classes +=
|
|
@@ -173,7 +165,6 @@ export interface ButtonProps extends ButtonAnchorProps {
|
|
|
173
165
|
| 'secondary'
|
|
174
166
|
| 'outlineSecondary'
|
|
175
167
|
| 'tertiary'
|
|
176
|
-
| 'info'
|
|
177
168
|
| 'warning'
|
|
178
169
|
| 'danger'
|
|
179
170
|
| 'outline'
|