@licklist/design 0.78.5-dev.49 → 0.78.5-dev.50
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/index.js +11 -1
- package/dist/v2/components/ActionMenu/ActionMenu.d.ts +13 -0
- package/dist/v2/components/ActionMenu/ActionMenu.d.ts.map +1 -0
- package/dist/v2/components/ActionMenu/ActionMenu.js +100 -0
- package/dist/v2/components/ActionMenu/ActionMenu.scss.js +6 -0
- package/dist/v2/components/ActionMenu/index.d.ts +2 -0
- package/dist/v2/components/ActionMenu/index.d.ts.map +1 -0
- package/dist/v2/components/Alert/Alert.scss.js +1 -1
- package/dist/v2/components/Badge/Badge.d.ts +10 -0
- package/dist/v2/components/Badge/Badge.d.ts.map +1 -0
- package/dist/v2/components/Badge/Badge.js +19 -0
- package/dist/v2/components/Badge/Badge.scss.js +6 -0
- package/dist/v2/components/Badge/index.d.ts +2 -0
- package/dist/v2/components/Badge/index.d.ts.map +1 -0
- package/dist/v2/components/Checkbox/Checkbox.scss.js +1 -1
- package/dist/v2/components/Customer/CustomerCreate/CustomerCreate.d.ts +11 -0
- package/dist/v2/components/Customer/CustomerCreate/CustomerCreate.d.ts.map +1 -0
- package/dist/v2/components/Customer/CustomerCreate/CustomerCreate.js +32 -0
- package/dist/v2/components/Customer/CustomerCreate/index.d.ts +2 -0
- package/dist/v2/components/Customer/CustomerCreate/index.d.ts.map +1 -0
- package/dist/v2/components/Customer/CustomerDetail/CustomerDetail.d.ts +35 -0
- package/dist/v2/components/Customer/CustomerDetail/CustomerDetail.d.ts.map +1 -0
- package/dist/v2/components/Customer/CustomerDetail/CustomerDetail.js +235 -0
- package/dist/v2/components/Customer/CustomerDetail/CustomerDetail.scss.js +6 -0
- package/dist/v2/components/Customer/CustomerDetail/index.d.ts +2 -0
- package/dist/v2/components/Customer/CustomerDetail/index.d.ts.map +1 -0
- package/dist/v2/components/Customer/CustomerEdit/CustomerEdit.d.ts +11 -0
- package/dist/v2/components/Customer/CustomerEdit/CustomerEdit.d.ts.map +1 -0
- package/dist/v2/components/Customer/CustomerEdit/CustomerEdit.js +32 -0
- package/dist/v2/components/Customer/CustomerEdit/index.d.ts +2 -0
- package/dist/v2/components/Customer/CustomerEdit/index.d.ts.map +1 -0
- package/dist/v2/components/Customer/CustomerForm/CustomerForm.d.ts +22 -0
- package/dist/v2/components/Customer/CustomerForm/CustomerForm.d.ts.map +1 -0
- package/dist/v2/components/Customer/CustomerForm/CustomerForm.js +535 -0
- package/dist/v2/components/Customer/CustomerForm/index.d.ts +2 -0
- package/dist/v2/components/Customer/CustomerForm/index.d.ts.map +1 -0
- package/dist/v2/components/Customer/CustomersList.d.ts +37 -0
- package/dist/v2/components/Customer/CustomersList.d.ts.map +1 -0
- package/dist/v2/components/Customer/CustomersList.js +204 -0
- package/dist/v2/components/Customer/CustomersList.scss.js +6 -0
- package/dist/v2/components/Customer/index.d.ts +6 -0
- package/dist/v2/components/Customer/index.d.ts.map +1 -0
- package/dist/v2/components/FormField/FormField.scss.js +1 -1
- package/dist/v2/components/Modal/DeleteModal.d.ts +15 -0
- package/dist/v2/components/Modal/DeleteModal.d.ts.map +1 -0
- package/dist/v2/components/Modal/DeleteModal.js +147 -0
- package/dist/v2/components/Modal/DeleteModal.scss.js +6 -0
- package/dist/v2/components/Modal/index.d.ts +3 -0
- package/dist/v2/components/Modal/index.d.ts.map +1 -0
- package/dist/v2/components/NewInput/NewInput.d.ts +2 -0
- package/dist/v2/components/NewInput/NewInput.d.ts.map +1 -1
- package/dist/v2/components/NewInput/NewInput.js +29 -12
- package/dist/v2/components/NewPageHeader/NewPageHeader.d.ts +1 -0
- package/dist/v2/components/NewPageHeader/NewPageHeader.d.ts.map +1 -1
- package/dist/v2/components/NewPageHeader/NewPageHeader.js +15 -9
- package/dist/v2/components/NewPageHeader/NewPageHeader.scss.js +1 -1
- package/dist/v2/components/NewTable/NewTable.d.ts +20 -0
- package/dist/v2/components/NewTable/NewTable.d.ts.map +1 -0
- package/dist/v2/components/NewTable/NewTable.js +57 -0
- package/dist/v2/components/NewTable/NewTable.scss.js +6 -0
- package/dist/v2/components/NewTable/index.d.ts +2 -0
- package/dist/v2/components/NewTable/index.d.ts.map +1 -0
- package/dist/v2/components/Pagination/Pagination.d.ts +13 -0
- package/dist/v2/components/Pagination/Pagination.d.ts.map +1 -0
- package/dist/v2/components/Pagination/Pagination.js +79 -0
- package/dist/v2/components/Pagination/Pagination.scss.js +6 -0
- package/dist/v2/components/Pagination/index.d.ts +2 -0
- package/dist/v2/components/Pagination/index.d.ts.map +1 -0
- package/dist/v2/components/QuickFilter/QuickFilter.d.ts +14 -0
- package/dist/v2/components/QuickFilter/QuickFilter.d.ts.map +1 -0
- package/dist/v2/components/QuickFilter/QuickFilter.js +67 -0
- package/dist/v2/components/QuickFilter/QuickFilter.scss.js +6 -0
- package/dist/v2/components/QuickFilter/index.d.ts +2 -0
- package/dist/v2/components/QuickFilter/index.d.ts.map +1 -0
- package/dist/v2/components/Select/Select.d.ts +7 -4
- package/dist/v2/components/Select/Select.d.ts.map +1 -1
- package/dist/v2/components/Select/Select.js +53 -24
- package/dist/v2/components/Select/Select.scss.js +1 -1
- package/dist/v2/components/WYSIWYGEditor/WYSIWYGEditor.scss.js +1 -1
- package/dist/v2/components/index.d.ts +18 -0
- package/dist/v2/components/index.d.ts.map +1 -1
- package/dist/v2/icons/index.d.ts +21 -0
- package/dist/v2/icons/index.d.ts.map +1 -1
- package/dist/v2/icons/index.js +155 -4
- package/dist/v2/navigation/DashboardLayout/ProviderSidebar.d.ts.map +1 -1
- package/dist/v2/navigation/DashboardLayout/ProviderSidebar.js +4 -8
- package/dist/v2/styles/common.scss +7 -0
- package/dist/v2/styles/form/NewInput.scss +45 -21
- package/dist/v2/styles/form/NewInput.scss.js +1 -1
- package/dist/v2/styles/index.scss +1 -0
- package/package.json +3 -3
- package/src/v2/components/ActionMenu/ActionMenu.scss +78 -0
- package/src/v2/components/ActionMenu/ActionMenu.tsx +64 -0
- package/src/v2/components/ActionMenu/index.ts +1 -0
- package/src/v2/components/Badge/Badge.scss +69 -0
- package/src/v2/components/Badge/Badge.tsx +23 -0
- package/src/v2/components/Badge/index.ts +1 -0
- package/src/v2/components/Customer/CustomerCreate/CustomerCreate.tsx +36 -0
- package/src/v2/components/Customer/CustomerCreate/index.ts +1 -0
- package/src/v2/components/Customer/CustomerDetail/CustomerDetail.scss +315 -0
- package/src/v2/components/Customer/CustomerDetail/CustomerDetail.tsx +161 -0
- package/src/v2/components/Customer/CustomerDetail/index.ts +1 -0
- package/src/v2/components/Customer/CustomerEdit/CustomerEdit.tsx +37 -0
- package/src/v2/components/Customer/CustomerEdit/index.ts +1 -0
- package/src/v2/components/Customer/CustomerForm/CustomerForm.tsx +434 -0
- package/src/v2/components/Customer/CustomerForm/index.ts +1 -0
- package/src/v2/components/Customer/CustomersList.scss +586 -0
- package/src/v2/components/Customer/CustomersList.tsx +193 -0
- package/src/v2/components/Customer/index.ts +5 -0
- package/src/v2/components/Modal/DeleteModal.scss +254 -0
- package/src/v2/components/Modal/DeleteModal.tsx +100 -0
- package/src/v2/components/Modal/index.ts +3 -0
- package/src/v2/components/NewInput/NewInput.stories.tsx +3 -18
- package/src/v2/components/NewInput/NewInput.tsx +23 -12
- package/src/v2/components/NewPageHeader/NewPageHeader.scss +13 -7
- package/src/v2/components/NewPageHeader/NewPageHeader.tsx +14 -9
- package/src/v2/components/NewTable/NewTable.scss +110 -0
- package/src/v2/components/NewTable/NewTable.tsx +85 -0
- package/src/v2/components/NewTable/index.ts +1 -0
- package/src/v2/components/Pagination/Pagination.scss +142 -0
- package/src/v2/components/Pagination/Pagination.tsx +80 -0
- package/src/v2/components/Pagination/index.ts +1 -0
- package/src/v2/components/QuickFilter/QuickFilter.scss +84 -0
- package/src/v2/components/QuickFilter/QuickFilter.tsx +49 -0
- package/src/v2/components/QuickFilter/index.ts +1 -0
- package/src/v2/components/Select/Select.scss +61 -24
- package/src/v2/components/Select/Select.stories.tsx +77 -1
- package/src/v2/components/Select/Select.tsx +63 -34
- package/src/v2/components/index.ts +28 -0
- package/src/v2/icons/index.tsx +79 -2
- package/src/v2/navigation/DashboardLayout/ProviderSidebar.tsx +3 -1
- package/src/v2/navigation/config.tsx +1 -1
- package/src/v2/styles/common.scss +7 -0
- package/src/v2/styles/form/NewInput.scss +45 -21
- package/src/v2/styles/index.scss +1 -0
|
@@ -2,15 +2,13 @@
|
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
align-items: flex-start;
|
|
5
|
-
gap:
|
|
5
|
+
gap: 14px;
|
|
6
6
|
align-self: stretch;
|
|
7
|
-
padding
|
|
8
|
-
padding-right: 32px;
|
|
7
|
+
padding: 32px 32px 0 32px;
|
|
9
8
|
|
|
10
9
|
@media (max-width: 768px) {
|
|
11
|
-
padding
|
|
12
|
-
|
|
13
|
-
gap: 16px;
|
|
10
|
+
padding: 16px 16px 0 16px;
|
|
11
|
+
gap: 10px;
|
|
14
12
|
}
|
|
15
13
|
}
|
|
16
14
|
|
|
@@ -29,12 +27,20 @@
|
|
|
29
27
|
|
|
30
28
|
&__title {
|
|
31
29
|
color: var(--label-primary);
|
|
32
|
-
font-family: 'Geist', sans-serif;
|
|
30
|
+
font-family: var(--font-family-sans, 'Geist', sans-serif);
|
|
33
31
|
font-size: 24px;
|
|
34
32
|
font-style: normal;
|
|
35
33
|
font-weight: 600;
|
|
36
34
|
line-height: 28px;
|
|
37
35
|
margin: 0;
|
|
36
|
+
padding: 0;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&__actions {
|
|
40
|
+
display: flex;
|
|
41
|
+
align-items: center;
|
|
42
|
+
gap: 16px;
|
|
43
|
+
flex-shrink: 0;
|
|
38
44
|
}
|
|
39
45
|
}
|
|
40
46
|
|
|
@@ -6,6 +6,7 @@ export interface NewPageHeaderProps {
|
|
|
6
6
|
title: string;
|
|
7
7
|
cancelLabel?: string;
|
|
8
8
|
onCancel?: () => void;
|
|
9
|
+
renderRight?: () => React.ReactNode;
|
|
9
10
|
className?: string;
|
|
10
11
|
}
|
|
11
12
|
|
|
@@ -13,21 +14,25 @@ export const NewPageHeader: React.FC<NewPageHeaderProps> = ({
|
|
|
13
14
|
title,
|
|
14
15
|
cancelLabel = 'Cancel',
|
|
15
16
|
onCancel,
|
|
17
|
+
renderRight,
|
|
16
18
|
className = ''
|
|
17
19
|
}) => {
|
|
18
20
|
return (
|
|
19
21
|
<div className={`new-page-header-container ${className}`}>
|
|
20
22
|
<div className="new-page-header">
|
|
21
23
|
<h1 className="new-page-header__title">{title}</h1>
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
<div className="new-page-header__actions">
|
|
25
|
+
{renderRight && renderRight()}
|
|
26
|
+
{onCancel && (
|
|
27
|
+
<Button
|
|
28
|
+
type="button"
|
|
29
|
+
variant="destructive-soft"
|
|
30
|
+
onClick={onCancel}
|
|
31
|
+
>
|
|
32
|
+
<ButtonText color="danger">{cancelLabel}</ButtonText>
|
|
33
|
+
</Button>
|
|
34
|
+
)}
|
|
35
|
+
</div>
|
|
31
36
|
</div>
|
|
32
37
|
<hr className="new-page-header__divider" />
|
|
33
38
|
</div>
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
.new-table-wrapper {
|
|
2
|
+
width: 100%;
|
|
3
|
+
overflow-x: auto;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.new-table {
|
|
7
|
+
width: 100%;
|
|
8
|
+
border-collapse: collapse;
|
|
9
|
+
text-align: left;
|
|
10
|
+
|
|
11
|
+
&__head {
|
|
12
|
+
background-color: var(--surface-secondary, #F8F8FA);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
&__header-cell {
|
|
16
|
+
padding: 16px 24px;
|
|
17
|
+
font-size: var(--text-small-size, 13px);
|
|
18
|
+
font-weight: 500;
|
|
19
|
+
color: var(--label-secondary, #9399B3);
|
|
20
|
+
border-bottom: 1px solid var(--border-primary, #E8E9EF);
|
|
21
|
+
white-space: nowrap;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&__body {
|
|
25
|
+
background-color: var(--neutral-white, #FFFFFF);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&__row {
|
|
29
|
+
border-bottom: 1px solid var(--border-primary, #E8E9EF);
|
|
30
|
+
transition: background-color 0.2s ease;
|
|
31
|
+
|
|
32
|
+
&:last-child {
|
|
33
|
+
border-bottom: none;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&--clickable {
|
|
37
|
+
cursor: pointer;
|
|
38
|
+
&:hover {
|
|
39
|
+
background-color: var(--surface-primary-hover, #F8F8FA);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&__cell {
|
|
45
|
+
padding: 16px 24px;
|
|
46
|
+
font-size: var(--text-base-size, 14px);
|
|
47
|
+
color: var(--label-primary, #121E52);
|
|
48
|
+
vertical-align: middle;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&__no-data-cell {
|
|
52
|
+
padding: 64px 24px;
|
|
53
|
+
text-align: center;
|
|
54
|
+
font-size: 16px;
|
|
55
|
+
font-weight: 500;
|
|
56
|
+
color: #9399B3;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Mobile styles
|
|
61
|
+
@media (max-width: 768px) {
|
|
62
|
+
.new-table-wrapper {
|
|
63
|
+
overflow-x: auto;
|
|
64
|
+
-webkit-overflow-scrolling: touch;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.new-table {
|
|
68
|
+
min-width: 600px; // Ensure table doesn't collapse too much
|
|
69
|
+
|
|
70
|
+
&__header-cell {
|
|
71
|
+
padding: 12px 16px;
|
|
72
|
+
font-size: 12px;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&__cell {
|
|
76
|
+
padding: 12px 16px;
|
|
77
|
+
font-size: 13px;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&__no-data-cell {
|
|
81
|
+
padding: 48px 16px;
|
|
82
|
+
font-size: 14px;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
@media (max-width: 480px) {
|
|
88
|
+
.new-table {
|
|
89
|
+
min-width: 500px;
|
|
90
|
+
|
|
91
|
+
&__header-cell,
|
|
92
|
+
&__cell {
|
|
93
|
+
padding: 10px 12px;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
&__header-cell {
|
|
97
|
+
font-size: 11px;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
&__cell {
|
|
101
|
+
font-size: 12px;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
&__no-data-cell {
|
|
105
|
+
padding: 32px 12px;
|
|
106
|
+
font-size: 13px;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import './NewTable.scss'
|
|
3
|
+
|
|
4
|
+
export interface NewTableColumn<T> {
|
|
5
|
+
header: React.ReactNode
|
|
6
|
+
accessor: keyof T | ((row: T) => React.ReactNode)
|
|
7
|
+
className?: string
|
|
8
|
+
width?: string | number
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface NewTableProps<T> {
|
|
12
|
+
columns: NewTableColumn<T>[]
|
|
13
|
+
data: T[]
|
|
14
|
+
className?: string
|
|
15
|
+
rowClassName?: string | ((row: T) => string)
|
|
16
|
+
onRowClick?: (row: T) => void
|
|
17
|
+
noDataText?: string
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function NewTable<T extends { id?: string | number }>({
|
|
21
|
+
columns,
|
|
22
|
+
data,
|
|
23
|
+
className = '',
|
|
24
|
+
rowClassName = '',
|
|
25
|
+
onRowClick,
|
|
26
|
+
noDataText,
|
|
27
|
+
}: NewTableProps<T>) {
|
|
28
|
+
return (
|
|
29
|
+
<div className={`new-table-wrapper ${className}`}>
|
|
30
|
+
<table className="new-table">
|
|
31
|
+
<thead className="new-table__head">
|
|
32
|
+
<tr>
|
|
33
|
+
{columns.map((column, index) => (
|
|
34
|
+
<th
|
|
35
|
+
key={index}
|
|
36
|
+
className={`new-table__header-cell ${column.className || ''}`}
|
|
37
|
+
style={{ width: column.width }}
|
|
38
|
+
>
|
|
39
|
+
{column.header}
|
|
40
|
+
</th>
|
|
41
|
+
))}
|
|
42
|
+
</tr>
|
|
43
|
+
</thead>
|
|
44
|
+
<tbody className="new-table__body">
|
|
45
|
+
{data.length > 0 ? (
|
|
46
|
+
data.map((row, rowIndex) => {
|
|
47
|
+
const customRowClass = typeof rowClassName === 'function' ? rowClassName(row) : rowClassName
|
|
48
|
+
return (
|
|
49
|
+
<tr
|
|
50
|
+
key={row.id || rowIndex}
|
|
51
|
+
className={`new-table__row ${onRowClick ? 'new-table__row--clickable' : ''} ${customRowClass}`}
|
|
52
|
+
onClick={() => onRowClick?.(row)}
|
|
53
|
+
>
|
|
54
|
+
{columns.map((column, colIndex) => {
|
|
55
|
+
const content =
|
|
56
|
+
typeof column.accessor === 'function'
|
|
57
|
+
? column.accessor(row)
|
|
58
|
+
: (row[column.accessor] as React.ReactNode)
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<td
|
|
62
|
+
key={colIndex}
|
|
63
|
+
className={`new-table__cell ${column.className || ''}`}
|
|
64
|
+
>
|
|
65
|
+
{content}
|
|
66
|
+
</td>
|
|
67
|
+
)
|
|
68
|
+
})}
|
|
69
|
+
</tr>
|
|
70
|
+
)
|
|
71
|
+
})
|
|
72
|
+
) : (
|
|
73
|
+
noDataText && (
|
|
74
|
+
<tr className="new-table__no-data-row">
|
|
75
|
+
<td colSpan={columns.length} className="new-table__no-data-cell">
|
|
76
|
+
{noDataText}
|
|
77
|
+
</td>
|
|
78
|
+
</tr>
|
|
79
|
+
)
|
|
80
|
+
)}
|
|
81
|
+
</tbody>
|
|
82
|
+
</table>
|
|
83
|
+
</div>
|
|
84
|
+
)
|
|
85
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './NewTable'
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
.v2-pagination {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
gap: 24px;
|
|
5
|
+
font-family: var(--font-family-sans, 'Geist', sans-serif), serif;
|
|
6
|
+
|
|
7
|
+
&__controls {
|
|
8
|
+
display: flex;
|
|
9
|
+
gap: 12px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
&__button {
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
justify-content: center;
|
|
16
|
+
width: 64px;
|
|
17
|
+
height: 64px;
|
|
18
|
+
border-radius: 50%;
|
|
19
|
+
border: none;
|
|
20
|
+
cursor: pointer;
|
|
21
|
+
background-color: #efeffe; // Light purple background
|
|
22
|
+
color: #6200ee; // Primary purple color
|
|
23
|
+
transition: background-color 0.2s ease, color 0.2s ease;
|
|
24
|
+
flex-shrink: 0; // Prevent button from shrinking
|
|
25
|
+
|
|
26
|
+
&:hover:not(:disabled) {
|
|
27
|
+
background-color: #cdccfc;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&:active:not(:disabled) {
|
|
31
|
+
background-color: #b4b4fa;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&:focus-visible {
|
|
35
|
+
outline: 2px solid #6200ee;
|
|
36
|
+
outline-offset: 2px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&:disabled {
|
|
40
|
+
background-color: #e5e7eb; // Light gray
|
|
41
|
+
color: #9ca3af; // Gray arrow
|
|
42
|
+
cursor: not-allowed;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
svg {
|
|
46
|
+
width: 32px;
|
|
47
|
+
height: 32px;
|
|
48
|
+
flex-shrink: 0; // Prevent SVG from shrinking
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&__info {
|
|
53
|
+
display: flex;
|
|
54
|
+
flex-direction: column;
|
|
55
|
+
gap: 4px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&__page-number {
|
|
59
|
+
font-size: 24px;
|
|
60
|
+
font-weight: 600;
|
|
61
|
+
color: #14215a; // Main fill primary
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&__showing {
|
|
65
|
+
font-size: 18px;
|
|
66
|
+
font-weight: 500;
|
|
67
|
+
color: #626a90; // Secondary text color
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Mobile styles
|
|
72
|
+
@media (max-width: 768px) {
|
|
73
|
+
.v2-pagination {
|
|
74
|
+
gap: 16px;
|
|
75
|
+
|
|
76
|
+
&__controls {
|
|
77
|
+
gap: 8px;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&__button {
|
|
81
|
+
width: 48px;
|
|
82
|
+
height: 48px;
|
|
83
|
+
|
|
84
|
+
svg {
|
|
85
|
+
width: 24px;
|
|
86
|
+
height: 24px;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&__info {
|
|
91
|
+
gap: 2px;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&__page-number {
|
|
95
|
+
font-size: 18px;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
&__showing {
|
|
99
|
+
font-size: 14px;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
@media (max-width: 480px) {
|
|
105
|
+
.v2-pagination {
|
|
106
|
+
flex-direction: column;
|
|
107
|
+
gap: 12px;
|
|
108
|
+
align-items: flex-start;
|
|
109
|
+
|
|
110
|
+
&__controls {
|
|
111
|
+
order: 2;
|
|
112
|
+
width: 100%;
|
|
113
|
+
justify-content: center;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
&__button {
|
|
117
|
+
width: 44px;
|
|
118
|
+
height: 44px;
|
|
119
|
+
|
|
120
|
+
svg {
|
|
121
|
+
width: 20px;
|
|
122
|
+
height: 20px;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
&__info {
|
|
127
|
+
order: 1;
|
|
128
|
+
width: 100%;
|
|
129
|
+
text-align: center;
|
|
130
|
+
align-items: center;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
&__page-number {
|
|
134
|
+
font-size: 16px;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
&__showing {
|
|
138
|
+
font-size: 13px;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import './Pagination.scss'
|
|
3
|
+
import { ArrowLeftIcon, ArrowRightIcon } from '../../icons'
|
|
4
|
+
|
|
5
|
+
export interface PaginationProps {
|
|
6
|
+
currentPage: number
|
|
7
|
+
totalPages: number
|
|
8
|
+
totalItems: number
|
|
9
|
+
itemsPerPage: number
|
|
10
|
+
onPageChange: (page: number) => void
|
|
11
|
+
t: (key: string, options?: any) => string
|
|
12
|
+
entityName?: string
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const Pagination: React.FC<PaginationProps> = ({
|
|
16
|
+
currentPage,
|
|
17
|
+
totalPages,
|
|
18
|
+
totalItems,
|
|
19
|
+
itemsPerPage,
|
|
20
|
+
onPageChange,
|
|
21
|
+
t,
|
|
22
|
+
entityName = 'items'
|
|
23
|
+
}) => {
|
|
24
|
+
const startItem = (currentPage - 1) * itemsPerPage + 1
|
|
25
|
+
const endItem = Math.min(currentPage * itemsPerPage, totalItems)
|
|
26
|
+
const isFirstPage = currentPage <= 1
|
|
27
|
+
const isLastPage = currentPage >= totalPages
|
|
28
|
+
|
|
29
|
+
const handlePrev = (e: React.MouseEvent<HTMLButtonElement>) => {
|
|
30
|
+
e.preventDefault()
|
|
31
|
+
if (!isFirstPage) {
|
|
32
|
+
onPageChange(currentPage - 1)
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const handleNext = (e: React.MouseEvent<HTMLButtonElement>) => {
|
|
37
|
+
e.preventDefault()
|
|
38
|
+
if (!isLastPage) {
|
|
39
|
+
onPageChange(currentPage + 1)
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<div className="v2-pagination">
|
|
45
|
+
<div className="v2-pagination__controls">
|
|
46
|
+
<button
|
|
47
|
+
type="button"
|
|
48
|
+
className="v2-pagination__button"
|
|
49
|
+
onClick={handlePrev}
|
|
50
|
+
disabled={isFirstPage}
|
|
51
|
+
aria-label={t('App:previous', { defaultValue: 'Previous' })}
|
|
52
|
+
>
|
|
53
|
+
<ArrowLeftIcon />
|
|
54
|
+
</button>
|
|
55
|
+
<button
|
|
56
|
+
type="button"
|
|
57
|
+
className="v2-pagination__button"
|
|
58
|
+
onClick={handleNext}
|
|
59
|
+
disabled={isLastPage}
|
|
60
|
+
aria-label={t('App:next', { defaultValue: 'Next' })}
|
|
61
|
+
>
|
|
62
|
+
<ArrowRightIcon width={32} height={32} />
|
|
63
|
+
</button>
|
|
64
|
+
</div>
|
|
65
|
+
<div className="v2-pagination__info">
|
|
66
|
+
<div className="v2-pagination__page-number">
|
|
67
|
+
{t('App:page', { from: currentPage })}
|
|
68
|
+
</div>
|
|
69
|
+
<div className="v2-pagination__showing">
|
|
70
|
+
{t('App:paginationText', {
|
|
71
|
+
type: entityName,
|
|
72
|
+
from: startItem,
|
|
73
|
+
to: endItem,
|
|
74
|
+
total: totalItems
|
|
75
|
+
})}
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
)
|
|
80
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Pagination'
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
.quick-filter {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
gap: 12px;
|
|
5
|
+
|
|
6
|
+
&__label {
|
|
7
|
+
font-size: var(--text-small-size, 13px);
|
|
8
|
+
font-weight: 500;
|
|
9
|
+
color: var(--label-secondary, #9399B3);
|
|
10
|
+
white-space: nowrap;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
&__options {
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-wrap: wrap;
|
|
16
|
+
gap: 8px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&__option {
|
|
20
|
+
padding: 4px 16px;
|
|
21
|
+
border-radius: 100px;
|
|
22
|
+
border: 1px solid var(--border-primary, #E8E9EF);
|
|
23
|
+
background-color: var(--neutral-white, #FFFFFF);
|
|
24
|
+
font-size: var(--text-small-size, 13px);
|
|
25
|
+
font-weight: 500;
|
|
26
|
+
color: var(--label-primary, #121E52);
|
|
27
|
+
cursor: pointer;
|
|
28
|
+
transition: all 0.2s ease;
|
|
29
|
+
|
|
30
|
+
&:hover:not(&--active) {
|
|
31
|
+
background-color: var(--surface-primary-hover, #F8F8FA);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&--active {
|
|
35
|
+
background-color: var(--fill-primary);
|
|
36
|
+
border-color: var(--border-selected, #121E52);
|
|
37
|
+
color: var(--neutral-white, #FFFFFF);
|
|
38
|
+
font-weight: 600;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Mobile styles
|
|
44
|
+
@media (max-width: 768px) {
|
|
45
|
+
.quick-filter {
|
|
46
|
+
flex-direction: column;
|
|
47
|
+
align-items: flex-start;
|
|
48
|
+
gap: 8px;
|
|
49
|
+
|
|
50
|
+
&__label {
|
|
51
|
+
font-size: 12px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&__options {
|
|
55
|
+
width: 100%;
|
|
56
|
+
gap: 6px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&__option {
|
|
60
|
+
padding: 3px 12px;
|
|
61
|
+
font-size: 12px;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
@media (max-width: 480px) {
|
|
67
|
+
.quick-filter {
|
|
68
|
+
gap: 6px;
|
|
69
|
+
|
|
70
|
+
&__label {
|
|
71
|
+
font-size: 11px;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
&__options {
|
|
75
|
+
gap: 4px;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
&__option {
|
|
79
|
+
padding: 2px 10px;
|
|
80
|
+
font-size: 11px;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import './QuickFilter.scss'
|
|
3
|
+
|
|
4
|
+
export interface QuickFilterOption {
|
|
5
|
+
label: string
|
|
6
|
+
value: string
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface QuickFilterProps {
|
|
10
|
+
options: QuickFilterOption[]
|
|
11
|
+
selectedValues: string[]
|
|
12
|
+
onChange: (selectedValues: string[]) => void
|
|
13
|
+
label?: string
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const QuickFilter: React.FC<QuickFilterProps> = ({
|
|
17
|
+
options,
|
|
18
|
+
selectedValues = [],
|
|
19
|
+
onChange,
|
|
20
|
+
label,
|
|
21
|
+
}) => {
|
|
22
|
+
const toggleOption = (value: string) => {
|
|
23
|
+
if (selectedValues?.includes(value)) {
|
|
24
|
+
onChange(selectedValues.filter((v) => v !== value))
|
|
25
|
+
} else {
|
|
26
|
+
onChange([...selectedValues, value])
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<div className="quick-filter">
|
|
32
|
+
{label && <span className="quick-filter__label">{label}</span>}
|
|
33
|
+
<div className="quick-filter__options">
|
|
34
|
+
{options.map((option) => (
|
|
35
|
+
<button
|
|
36
|
+
key={option.value}
|
|
37
|
+
type="button"
|
|
38
|
+
className={`quick-filter__option ${
|
|
39
|
+
selectedValues?.includes(option.value) ? 'quick-filter__option--active' : ''
|
|
40
|
+
}`}
|
|
41
|
+
onClick={() => toggleOption(option.value)}
|
|
42
|
+
>
|
|
43
|
+
{option.label}
|
|
44
|
+
</button>
|
|
45
|
+
))}
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
)
|
|
49
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './QuickFilter'
|