@loja-integrada/admin-components 0.18.12 → 0.18.13

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.18.12",
3
+ "version": "0.18.13",
4
4
  "author": "Loja Integrada Front-End Team",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -5,6 +5,7 @@ import * as stories from "./Badge.stories"
5
5
 
6
6
  const { Default, Small, Expanded } = composeStories(stories)
7
7
  const badgeClass = '.badge'
8
+ const badgeTextClass = '.badgeText'
8
9
 
9
10
  const specTitle = require('cypress-sonarqube-reporter/specTitle');
10
11
  describe(specTitle('Badge tests'), () => {
@@ -29,6 +30,10 @@ describe(specTitle('Badge tests'), () => {
29
30
  mount(<Default type="neutral" />)
30
31
  cy.get(badgeClass).should('have.class', 'bg-inverted-2')
31
32
 
33
+ mount(<Default type="neutralLight" />)
34
+ cy.get(badgeClass).should('have.class', 'bg-inverted-3')
35
+ cy.get(badgeTextClass).should('have.class', 'text-tertiary')
36
+
32
37
  mount(<Default type="primary" />)
33
38
  cy.get(badgeClass).should('have.class', 'bg-primary-dark')
34
39
 
@@ -40,5 +45,8 @@ describe(specTitle('Badge tests'), () => {
40
45
 
41
46
  mount(<Default type="danger" />)
42
47
  cy.get(badgeClass).should('have.class', 'bg-danger-dark')
48
+
49
+ mount(<Default type="focus" />)
50
+ cy.get(badgeClass).should('have.class', 'bg-focus')
43
51
  })
44
52
  })
@@ -2,10 +2,12 @@ import React from 'react'
2
2
 
3
3
  const badgeTypes = {
4
4
  neutral: 'bg-inverted-2',
5
+ neutralLight: 'bg-inverted-3',
5
6
  primary: 'bg-primary-dark',
6
7
  danger: 'bg-danger-dark',
7
8
  success: 'bg-success-dark',
8
9
  warning: 'bg-warning-dark',
10
+ focus: 'bg-focus',
9
11
  }
10
12
 
11
13
  const badgeSizes = {
@@ -25,7 +27,13 @@ const BadgeComponent = ({
25
27
  badgeTypes[type]
26
28
  } ${badgeSizes[size]} ${expanded ? 'flex w-full' : 'inline-flex'}`}
27
29
  >
28
- <span className={`tracking-4 font-semibold text-base-1`}>{text}</span>
30
+ <span
31
+ className={`badgeText tracking-4 font-semibold ${
32
+ type === 'neutralLight' ? 'text-tertiary' : 'text-base-1'
33
+ }`}
34
+ >
35
+ {text}
36
+ </span>
29
37
  </div>
30
38
  )
31
39
  }