@loja-integrada/admin-components 0.15.2 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loja-integrada/admin-components",
3
- "version": "0.15.2",
3
+ "version": "0.15.3",
4
4
  "author": "Loja Integrada Front-End Team",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -108,6 +108,7 @@ const TableListComponent = ({
108
108
  itemWrapper={itemWrapper}
109
109
  itemWrapperProps={item.itemWrapperProps}
110
110
  withIcon={item.withIcon}
111
+ append={item.append}
111
112
  withHover={withHover}
112
113
  isInsideContainer={isInsideContainer}
113
114
  />
@@ -21,6 +21,10 @@ export interface TableListItemProps {
21
21
  * Timestamp of the item, usually in dd/mm/yyyy
22
22
  */
23
23
  timestampDate?: string
24
+ /**
25
+ * Addittional content at item
26
+ */
27
+ append?: string | React.ReactNode
24
28
  /**
25
29
  * Icon to show at item
26
30
  */
@@ -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 .table-item-timestamp-time')
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 .table-item-timestamp-date')
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
- <div className="table-item-timestamp-time w-full">
51
- {timestampTime}
52
- </div>
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>
@@ -1 +1,4 @@
1
1
  export * from './TableList'
2
+ export * from './TableListItem'
3
+ export * from './TableListItem.interface'
4
+ export * from './TableListItemLoading'
@@ -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,