@loja-integrada/admin-components 0.15.0 → 0.15.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/dist/Components/TableList/TableListItem.interface.d.ts +4 -0
- package/dist/Components/TableList/index.d.ts +3 -0
- package/dist/Icons/icons-path/Blog.d.ts +2 -0
- package/dist/Icons/icons-path/index.d.ts +1 -0
- package/dist/Navigation/Breadcrumb/index.d.ts +2 -2
- package/dist/admin-components.cjs.development.js +25 -10
- 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 +24 -11
- package/dist/admin-components.esm.js.map +1 -1
- package/package.json +24 -21
- package/src/Components/TableList/TableList.tsx +1 -0
- package/src/Components/TableList/TableListItem.interface.ts +4 -0
- package/src/Components/TableList/TableListItem.spec.tsx +13 -2
- package/src/Components/TableList/TableListItem.stories.tsx +1 -0
- package/src/Components/TableList/TableListItem.tsx +9 -5
- package/src/Components/TableList/index.tsx +3 -0
- package/src/Components/Timeline/TimelineItem.tsx +1 -1
- package/src/Icons/icons-path/Blog.tsx +9 -0
- package/src/Icons/icons-path/index.ts +2 -0
- package/src/Indicators/Badge/Badge.spec.tsx +1 -1
- package/src/Indicators/Badge/Badge.tsx +3 -5
- package/src/Navigation/Breadcrumb/index.tsx +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loja-integrada/admin-components",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.3",
|
|
4
4
|
"author": "Loja Integrada Front-End Team",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -65,19 +65,20 @@
|
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@babel/core": "^7.13.10",
|
|
67
67
|
"@babel/preset-typescript": "^7.13.0",
|
|
68
|
-
"@cypress/react": "^5.
|
|
69
|
-
"@cypress/webpack-dev-server": "^1.
|
|
68
|
+
"@cypress/react": "^5.12.4",
|
|
69
|
+
"@cypress/webpack-dev-server": "^1.8.4",
|
|
70
70
|
"@fullhuman/postcss-purgecss": "^4.0.3",
|
|
71
|
-
"@size-limit/preset-small-lib": "^
|
|
72
|
-
"@storybook/addon-a11y": "^6.4.
|
|
73
|
-
"@storybook/addon-essentials": "^6.4.
|
|
74
|
-
"@storybook/addon-
|
|
75
|
-
"@storybook/addon-links": "^6.4.19",
|
|
71
|
+
"@size-limit/preset-small-lib": "^7.0.8",
|
|
72
|
+
"@storybook/addon-a11y": "^6.4.22",
|
|
73
|
+
"@storybook/addon-essentials": "^6.4.22",
|
|
74
|
+
"@storybook/addon-links": "^6.4.22",
|
|
76
75
|
"@storybook/addon-postcss": "^2.0.0",
|
|
77
|
-
"@storybook/addons": "^6.4.
|
|
78
|
-
"@storybook/
|
|
79
|
-
"@storybook/
|
|
80
|
-
"@storybook/
|
|
76
|
+
"@storybook/addons": "^6.4.22",
|
|
77
|
+
"@storybook/client-api": "^6.4.22",
|
|
78
|
+
"@storybook/preview-web": "^6.4.22",
|
|
79
|
+
"@storybook/react": "^6.4.22",
|
|
80
|
+
"@storybook/storybook-deployer": "^2.8.11",
|
|
81
|
+
"@storybook/testing-react": "^1.2.4",
|
|
81
82
|
"@testing-library/react": "^11.2.7",
|
|
82
83
|
"@types/node": "^15.12.0",
|
|
83
84
|
"@types/react": "^17.0.3",
|
|
@@ -89,23 +90,25 @@
|
|
|
89
90
|
"autoprefixer": "^10.4.4",
|
|
90
91
|
"babel-loader": "^8.2.2",
|
|
91
92
|
"babel-plugin-module-name-mapper": "^1.2.0",
|
|
92
|
-
"chromatic": "^5.
|
|
93
|
-
"cypress": "^
|
|
93
|
+
"chromatic": "^6.5.4",
|
|
94
|
+
"cypress": "^9.6.0",
|
|
94
95
|
"eslint-plugin-prettier": "^3.4.0",
|
|
96
|
+
"html-webpack-plugin": "^5.5.0",
|
|
95
97
|
"husky": "^5.1.3",
|
|
96
98
|
"identity-obj-proxy": "^3.0.0",
|
|
97
|
-
"list-selectors": "^2.0.0",
|
|
98
99
|
"postcss": "^8.4.12",
|
|
99
100
|
"postcss-loader": "^4.2.0",
|
|
100
|
-
"
|
|
101
|
-
"
|
|
102
|
-
"
|
|
101
|
+
"prettier": "^2.6.2",
|
|
102
|
+
"react-is": "^18.1.0",
|
|
103
|
+
"rollup-plugin-postcss": "^4.0.2",
|
|
104
|
+
"size-limit": "^7.0.8",
|
|
103
105
|
"storybook-addon-designs": "^6.2.1",
|
|
104
106
|
"tailwindcss": "^3.0.23",
|
|
105
107
|
"tsdx": "^0.14.1",
|
|
106
|
-
"tslib": "^2.
|
|
107
|
-
"typescript": "^4.
|
|
108
|
-
"webpack
|
|
108
|
+
"tslib": "^2.4.0",
|
|
109
|
+
"typescript": "^4.6.4",
|
|
110
|
+
"webpack": "^5.72.0",
|
|
111
|
+
"webpack-dev-server": "^4.9.0"
|
|
109
112
|
},
|
|
110
113
|
"peerDependency": {
|
|
111
114
|
"@loja-integrada/tailwindcss-config": ">=1.5.0",
|
|
@@ -29,10 +29,10 @@ describe('TableListItem tests', () => {
|
|
|
29
29
|
.find('.table-item-description')
|
|
30
30
|
.should('exist')
|
|
31
31
|
.contains('Cartão')
|
|
32
|
-
cy.get('.table-item .table-item-timestamp
|
|
32
|
+
cy.get('.table-item .table-item-timestamp-time')
|
|
33
33
|
.should('exist')
|
|
34
34
|
.contains('19:45')
|
|
35
|
-
cy.get('.table-item .table-item-timestamp
|
|
35
|
+
cy.get('.table-item .table-item-timestamp-date')
|
|
36
36
|
.should('exist')
|
|
37
37
|
.contains('dezembro')
|
|
38
38
|
})
|
|
@@ -43,6 +43,13 @@ describe('TableListItem tests', () => {
|
|
|
43
43
|
.should('have.class', 'lg:first:border-t')
|
|
44
44
|
})
|
|
45
45
|
|
|
46
|
+
it('Append', () => {
|
|
47
|
+
mount(<Item append={'External'} />)
|
|
48
|
+
cy.get('.table-item .table-item-append')
|
|
49
|
+
.should('exist')
|
|
50
|
+
.contains('External')
|
|
51
|
+
})
|
|
52
|
+
|
|
46
53
|
it('Without', () => {
|
|
47
54
|
mount(<Item withIcon={undefined} />)
|
|
48
55
|
cy.get('.table-item .table-item-icon')
|
|
@@ -59,6 +66,10 @@ describe('TableListItem tests', () => {
|
|
|
59
66
|
mount(<Item timestampTime={undefined} />)
|
|
60
67
|
cy.get('.table-item .table-item-timestamp-time')
|
|
61
68
|
.should('not.exist')
|
|
69
|
+
|
|
70
|
+
mount(<Item append={undefined} />)
|
|
71
|
+
cy.get('.table-item .table-item-append')
|
|
72
|
+
.should('not.exist')
|
|
62
73
|
})
|
|
63
74
|
|
|
64
75
|
})
|
|
@@ -24,6 +24,7 @@ export default {
|
|
|
24
24
|
description: '#29102 - Daniela Cabral via Cartão de crédito',
|
|
25
25
|
timestampTime: '19:45',
|
|
26
26
|
timestampDate: '10 de dezembro',
|
|
27
|
+
append: <span className="cursor hover:underline text-primary font-semibold">Ver mais</span>,
|
|
27
28
|
itemWrapperProps: {
|
|
28
29
|
href: '#a'
|
|
29
30
|
},
|
|
@@ -15,6 +15,7 @@ export const TableListItem: React.FunctionComponent<TableListItemProps> = ({
|
|
|
15
15
|
withHover = false,
|
|
16
16
|
isInsideContainer = false,
|
|
17
17
|
withIcon,
|
|
18
|
+
append,
|
|
18
19
|
}) => {
|
|
19
20
|
return (
|
|
20
21
|
<div
|
|
@@ -45,16 +46,19 @@ export const TableListItem: React.FunctionComponent<TableListItemProps> = ({
|
|
|
45
46
|
<div className="table-item-description">{description}</div>
|
|
46
47
|
)}
|
|
47
48
|
</div>
|
|
48
|
-
{timestampTime && (
|
|
49
|
-
<div className="table-item-timestamp flex flex-col justify-center items-end shrink-0 gap-1.5 ml-4 min-w-0 max-w-[50%] text-right">
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
{(timestampTime || timestampDate || append) && (
|
|
50
|
+
<div className="table-item-timestamp-append flex flex-col justify-center items-end shrink-0 gap-1.5 ml-4 min-w-0 max-w-[50%] text-right">
|
|
51
|
+
{timestampTime && (
|
|
52
|
+
<div className="table-item-timestamp-time w-full">
|
|
53
|
+
{timestampTime}
|
|
54
|
+
</div>
|
|
55
|
+
)}
|
|
53
56
|
{timestampDate && (
|
|
54
57
|
<div className="table-item-timestamp-date w-full hidden lg:block">
|
|
55
58
|
{timestampDate}
|
|
56
59
|
</div>
|
|
57
60
|
)}
|
|
61
|
+
{append && <div className="table-item-append w-full">{append}</div>}
|
|
58
62
|
</div>
|
|
59
63
|
)}
|
|
60
64
|
</TableListItemWrapper>
|
|
@@ -47,7 +47,7 @@ export const TimelineItem = ({ item }: TimelineItemProps) => {
|
|
|
47
47
|
)}
|
|
48
48
|
{item.description && (
|
|
49
49
|
<div
|
|
50
|
-
className={`timeline-description overflow-hidden text-sm tracking-4 text-inverted-1 break-words transition-max-height ${
|
|
50
|
+
className={`timeline-description mt-1 overflow-hidden text-sm tracking-4 text-inverted-1 break-words transition-max-height ${
|
|
51
51
|
isOpen ? 'max-h-96' : 'max-h-0'
|
|
52
52
|
}`}
|
|
53
53
|
>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
export const Blog = () => (
|
|
4
|
+
<path
|
|
5
|
+
fillRule="evenodd"
|
|
6
|
+
d="M4 13v1h3.57c-.041-.159-.07-.323-.07-.495V13H4Zm10.5 2c0 .827-.673 1.5-1.5 1.5H3c-.827 0-1.5-.673-1.5-1.5V3c0-.827.673-1.5 1.5-1.5h10c.827 0 1.5.673 1.5 1.5v.872c.387-.238.831-.372 1.296-.372.069 0 .137.008.204.014V3c0-1.657-1.343-3-3-3H3C1.343 0 0 1.343 0 3v12c0 1.657 1.343 3 3 3h10c1.657 0 3-1.343 3-3v-3.265l-1.5 1.5V15Zm-6.416-4.819L8.265 10H4v1h3.599c.094-.305.253-.588.485-.819ZM4 5h8V4H4v1Zm7.265 2H4v1h6.265l1-1Zm6.445.904-5.951 5.95c-.093.094-.219.146-.35.146H9.495C9.222 14 9 13.778 9 13.505v-1.914c0-.131.052-.257.145-.35l5.951-5.951c.193-.193.447-.29.7-.29.254 0 .507.097.701.29l1.213 1.213c.387.387.387 1.015 0 1.401Z"
|
|
7
|
+
clipRule="evenodd"
|
|
8
|
+
/>
|
|
9
|
+
)
|
|
@@ -8,6 +8,7 @@ import { Back } from './Back'
|
|
|
8
8
|
import { Ban } from './Ban'
|
|
9
9
|
import { BarcodeRead } from './BarcodeRead'
|
|
10
10
|
import { Bell } from './Bell'
|
|
11
|
+
import { Blog } from './Blog'
|
|
11
12
|
import { Bullhorn } from './Bullhorn'
|
|
12
13
|
import { CalendarAlt } from './CalendarAlt'
|
|
13
14
|
import { Cog } from './Cog'
|
|
@@ -68,6 +69,7 @@ export const icons = {
|
|
|
68
69
|
ban: Ban,
|
|
69
70
|
barcodeRead: BarcodeRead,
|
|
70
71
|
bell: Bell,
|
|
72
|
+
blog: Blog,
|
|
71
73
|
bullhorn: Bullhorn,
|
|
72
74
|
calendarAlt: CalendarAlt,
|
|
73
75
|
check: Check,
|
|
@@ -9,8 +9,8 @@ const badgeTypes = {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
const badgeSizes = {
|
|
12
|
-
default: 'px-2 py-0.5',
|
|
13
|
-
small: 'px-1',
|
|
12
|
+
default: 'px-2 py-0.5 text-xs',
|
|
13
|
+
small: 'px-1.5 text-[0.70rem]',
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
const BadgeComponent = ({
|
|
@@ -25,9 +25,7 @@ const BadgeComponent = ({
|
|
|
25
25
|
badgeTypes[type]
|
|
26
26
|
} ${badgeSizes[size]} ${expanded ? 'flex w-full' : 'inline-flex'}`}
|
|
27
27
|
>
|
|
28
|
-
<span className={`
|
|
29
|
-
{text}
|
|
30
|
-
</span>
|
|
28
|
+
<span className={`tracking-4 font-semibold text-base-1`}>{text}</span>
|
|
31
29
|
</div>
|
|
32
30
|
)
|
|
33
31
|
}
|
|
@@ -62,7 +62,7 @@ export const Breadcrumb: React.FC<BreadcrumbProps> = React.memo(
|
|
|
62
62
|
className={`header-navigation-breadcrumb max-w-full truncate w-full`}
|
|
63
63
|
>
|
|
64
64
|
<div className="w-full inline-flex self-center items-center font-semibold tracking-5 text-f5 sm:text-f4 lg:text-f3">
|
|
65
|
-
{(previousTitle || previousHref) && (
|
|
65
|
+
{(previousTitle || previousHref || Link) && (
|
|
66
66
|
<span className="header-navigation-previous inline-flex items-center text-on-base-2 text-xl -mr-px truncate">
|
|
67
67
|
{renderPrevLink()}
|
|
68
68
|
{previousTitle && (
|
|
@@ -131,11 +131,11 @@ export interface BreadcrumbProps {
|
|
|
131
131
|
/**
|
|
132
132
|
* Current page title
|
|
133
133
|
* */
|
|
134
|
-
currentTitle: string
|
|
134
|
+
currentTitle: string | React.ReactNode
|
|
135
135
|
/**
|
|
136
136
|
* Previous page title
|
|
137
137
|
* */
|
|
138
|
-
previousTitle?: string
|
|
138
|
+
previousTitle?: string | React.ReactNode
|
|
139
139
|
/**
|
|
140
140
|
* Previous page href
|
|
141
141
|
* */
|