@addev-be/ui 0.10.0 → 0.10.4
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/assets/icons/angle-left.svg +1 -0
- package/assets/icons/angle-right.svg +1 -0
- package/assets/icons/chevron-left.svg +1 -0
- package/assets/icons/chevron-right.svg +1 -0
- package/assets/icons/xmark-large.svg +1 -0
- package/assets/icons/xmark.svg +1 -0
- package/package.json +1 -1
- package/src/Icons.tsx +15 -3
- package/src/components/data/DataGrid/DataGridHeaderCell.tsx +5 -5
- package/src/components/data/SqlRequestGrid/filters/FiltersSidebar.tsx +14 -10
- package/src/components/data/SqlRequestGrid/filters/styles.ts +5 -0
- package/src/components/forms/Button.tsx +16 -6
- package/src/components/forms/IconButton.tsx +8 -7
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--! Font Awesome Pro 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M47 239c-9.4 9.4-9.4 24.6 0 33.9L207 433c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L97.9 256 241 113c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0L47 239z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--! Font Awesome Pro 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M273 239c9.4 9.4 9.4 24.6 0 33.9L113 433c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l143-143L79 113c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0L273 239z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--! Font Awesome Pro 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M15 239c-9.4 9.4-9.4 24.6 0 33.9L207 465c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L65.9 256 241 81c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0L15 239z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--! Font Awesome Pro 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M305 239c9.4 9.4 9.4 24.6 0 33.9L113 465c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l175-175L79 81c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0L305 239z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Pro 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M41 39C31.6 29.7 16.4 29.7 7 39S-2.3 63.6 7 73l183 183L7 439c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l183-183L407 473c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-183-183L441 73c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-183 183L41 39z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><!--! Font Awesome Pro 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M345 137c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-119 119L73 103c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l119 119L39 375c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l119-119L311 409c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-119-119L345 137z"/></svg>
|
package/package.json
CHANGED
package/src/Icons.tsx
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { FC, SVGProps, useEffect, useState } from 'react';
|
|
2
2
|
|
|
3
|
+
import AngleLeftIcon from '../assets/icons/angle-left.svg?react';
|
|
4
|
+
import AngleRightIcon from '../assets/icons/angle-right.svg?react';
|
|
3
5
|
import ArrowDown19Icon from '../assets/icons/arrow-down-1-9.svg?react';
|
|
4
6
|
import ArrowDownAZIcon from '../assets/icons/arrow-down-a-z.svg?react';
|
|
5
7
|
import ArrowDownBigSmallIcon from '../assets/icons/arrow-down-big-small.svg?react';
|
|
@@ -10,6 +12,8 @@ import ArrowsRotateIcon from '../assets/icons/arrows-rotate.svg?react';
|
|
|
10
12
|
import ArrowsUpDownIcon from '../assets/icons/arrows-up-down.svg?react';
|
|
11
13
|
import CheckIcon from '../assets/icons/check.svg?react';
|
|
12
14
|
import ChevronDownIcon from '../assets/icons/chevron-down.svg?react';
|
|
15
|
+
import ChevronLeftIcon from '../assets/icons/chevron-left.svg?react';
|
|
16
|
+
import ChevronRightIcon from '../assets/icons/chevron-right.svg?react';
|
|
13
17
|
import CircleCheckIcon from '../assets/icons/circle-check.svg?react';
|
|
14
18
|
import CircleInfoIcon from '../assets/icons/circle-info.svg?react';
|
|
15
19
|
import CircleXMarkIcon from '../assets/icons/circle-xmark.svg?react';
|
|
@@ -39,6 +43,8 @@ import TriangleExclamationIcon from '../assets/icons/triangle-exclamation.svg?re
|
|
|
39
43
|
import UpIcon from '../assets/icons/up.svg?react';
|
|
40
44
|
import UserTieIcon from '../assets/icons/user-tie.svg?react';
|
|
41
45
|
import XBarIcon from '../assets/icons/x-bar.svg?react';
|
|
46
|
+
import XMarkIcon from '../assets/icons/xmark.svg?react';
|
|
47
|
+
import XMarkLargeIcon from '../assets/icons/xmark-large.svg?react';
|
|
42
48
|
|
|
43
49
|
type IconFCProps = SVGProps<SVGSVGElement>;
|
|
44
50
|
export type IconFC = FC<IconFCProps>;
|
|
@@ -74,6 +80,8 @@ export const LoadingIcon: FC<IconFCProps> = ({ className, ...props }) => (
|
|
|
74
80
|
);
|
|
75
81
|
|
|
76
82
|
export {
|
|
83
|
+
AngleLeftIcon,
|
|
84
|
+
AngleRightIcon,
|
|
77
85
|
ArrowDown19Icon,
|
|
78
86
|
ArrowDownAZIcon,
|
|
79
87
|
ArrowDownBigSmallIcon,
|
|
@@ -84,6 +92,10 @@ export {
|
|
|
84
92
|
ArrowUpZAIcon,
|
|
85
93
|
CheckIcon,
|
|
86
94
|
ChevronDownIcon,
|
|
95
|
+
ChevronLeftIcon,
|
|
96
|
+
ChevronRightIcon,
|
|
97
|
+
CircleCheckIcon,
|
|
98
|
+
CircleInfoIcon,
|
|
87
99
|
CircleXMarkIcon,
|
|
88
100
|
CopyIcon,
|
|
89
101
|
DownIcon,
|
|
@@ -107,10 +119,10 @@ export {
|
|
|
107
119
|
TableFooterSlashIcon,
|
|
108
120
|
TableIcon,
|
|
109
121
|
TallyIcon,
|
|
122
|
+
TriangleExclamationIcon,
|
|
110
123
|
UpIcon,
|
|
111
124
|
UserTieIcon,
|
|
112
125
|
XBarIcon,
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
TriangleExclamationIcon,
|
|
126
|
+
XMarkIcon,
|
|
127
|
+
XMarkLargeIcon,
|
|
116
128
|
};
|
|
@@ -6,12 +6,12 @@ import * as styles from './styles';
|
|
|
6
6
|
import { MouseEvent, useCallback, useMemo, useRef, useState } from 'react';
|
|
7
7
|
|
|
8
8
|
import { ChevronDownIcon } from '../../../Icons';
|
|
9
|
-
import {
|
|
10
|
-
import { DataGridHeaderCellProps } from './types';
|
|
11
|
-
import { Dropdown } from '../../layout';
|
|
9
|
+
import { useUi } from '../../../providers';
|
|
12
10
|
import { IconButton } from '../../forms/IconButton';
|
|
11
|
+
import { Dropdown } from '../../layout';
|
|
12
|
+
import { DataGridFilterMenu } from './DataGridFilterMenu';
|
|
13
13
|
import { useDataGridContext } from './hooks';
|
|
14
|
-
import {
|
|
14
|
+
import { DataGridHeaderCellProps } from './types';
|
|
15
15
|
|
|
16
16
|
export const DataGridHeaderCell = <R,>({
|
|
17
17
|
columnKey,
|
|
@@ -108,7 +108,7 @@ export const DataGridHeaderCell = <R,>({
|
|
|
108
108
|
className={hasFilters ? 'danger' : ''}
|
|
109
109
|
ref={filterButtonRef}
|
|
110
110
|
icon={ChevronDownIcon}
|
|
111
|
-
|
|
111
|
+
color={hasFilters ? 'danger' : headerColor}
|
|
112
112
|
onClick={onFilterButtonClicked}
|
|
113
113
|
/>
|
|
114
114
|
)}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as styles from './styles';
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
|
-
|
|
4
|
+
AngleLeftIcon,
|
|
5
|
+
AngleRightIcon,
|
|
5
6
|
FilterSlashIcon,
|
|
6
|
-
|
|
7
|
-
RightIcon,
|
|
7
|
+
XMarkIcon,
|
|
8
8
|
} from '../../../../Icons';
|
|
9
9
|
import { MouseEvent, useCallback, useState } from 'react';
|
|
10
10
|
|
|
@@ -48,15 +48,17 @@ export const FiltersSidebar = <R, P extends object = {}>({
|
|
|
48
48
|
<styles.FiltersSidebarHeader>
|
|
49
49
|
<IconButton
|
|
50
50
|
rounded
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
bordered={false}
|
|
52
|
+
icon={AngleLeftIcon}
|
|
53
|
+
color="neutral"
|
|
53
54
|
onClick={() => onFilterClick(null)}
|
|
54
55
|
/>
|
|
55
56
|
<h3>{column.name}</h3>
|
|
56
57
|
<IconButton
|
|
57
58
|
rounded
|
|
58
|
-
|
|
59
|
-
|
|
59
|
+
bordered={false}
|
|
60
|
+
icon={XMarkIcon}
|
|
61
|
+
color="neutral"
|
|
60
62
|
onClick={onClose}
|
|
61
63
|
/>
|
|
62
64
|
</styles.FiltersSidebarHeader>
|
|
@@ -74,14 +76,16 @@ export const FiltersSidebar = <R, P extends object = {}>({
|
|
|
74
76
|
<h3>Filtres</h3>
|
|
75
77
|
<IconButton
|
|
76
78
|
rounded
|
|
79
|
+
bordered={false}
|
|
77
80
|
icon={FilterSlashIcon}
|
|
78
81
|
color="danger"
|
|
79
82
|
onClick={onClearFilters}
|
|
80
83
|
/>
|
|
81
84
|
<IconButton
|
|
82
85
|
rounded
|
|
83
|
-
|
|
84
|
-
|
|
86
|
+
bordered={false}
|
|
87
|
+
icon={XMarkIcon}
|
|
88
|
+
color="neutral"
|
|
85
89
|
onClick={onClose}
|
|
86
90
|
/>
|
|
87
91
|
</styles.FiltersSidebarHeader>
|
|
@@ -91,7 +95,7 @@ export const FiltersSidebar = <R, P extends object = {}>({
|
|
|
91
95
|
onClick={() => onFilterClick(key)}
|
|
92
96
|
>
|
|
93
97
|
{field.name}
|
|
94
|
-
<
|
|
98
|
+
<AngleRightIcon />
|
|
95
99
|
</styles.FiltersSidebarFilter>
|
|
96
100
|
))}
|
|
97
101
|
</>
|
|
@@ -40,6 +40,11 @@ export const FiltersSidebarContainer = styled.div`
|
|
|
40
40
|
`;
|
|
41
41
|
|
|
42
42
|
export const FiltersSidebarHeader = styled.div`
|
|
43
|
+
position: sticky;
|
|
44
|
+
top: 0;
|
|
45
|
+
z-index: 1;
|
|
46
|
+
background-color: var(--color-neutral-50);
|
|
47
|
+
|
|
43
48
|
display: flex;
|
|
44
49
|
justify-content: space-between;
|
|
45
50
|
align-items: center;
|
|
@@ -7,6 +7,7 @@ import { ThemeColor } from '../../providers/ThemeProvider/types';
|
|
|
7
7
|
type StyledButtonProps = {
|
|
8
8
|
$color?: ThemeColor;
|
|
9
9
|
$rounded?: boolean;
|
|
10
|
+
$bordered?: boolean;
|
|
10
11
|
};
|
|
11
12
|
|
|
12
13
|
export const StyledButton = styled.button.withConfig({
|
|
@@ -22,14 +23,18 @@ export const StyledButton = styled.button.withConfig({
|
|
|
22
23
|
font-family: var(--font-sans);
|
|
23
24
|
cursor: pointer;
|
|
24
25
|
|
|
25
|
-
${({ $color }) =>
|
|
26
|
+
${({ $color, $bordered = true }) =>
|
|
26
27
|
$color
|
|
27
28
|
? css`
|
|
28
29
|
background-color: var(--color-${$color}-400);
|
|
29
|
-
border:
|
|
30
|
+
border: ${$bordered
|
|
31
|
+
? `1px solid var(--color-${$color}-500)`
|
|
32
|
+
: 'none'};
|
|
30
33
|
&:hover {
|
|
31
34
|
background-color: var(--color-${$color}-300);
|
|
32
|
-
border:
|
|
35
|
+
border: ${$bordered
|
|
36
|
+
? `1px solid var(--color-${$color}-400)`
|
|
37
|
+
: 'none'};
|
|
33
38
|
}
|
|
34
39
|
color: var(--color-${$color}-950);
|
|
35
40
|
svg {
|
|
@@ -38,10 +43,12 @@ export const StyledButton = styled.button.withConfig({
|
|
|
38
43
|
`
|
|
39
44
|
: css`
|
|
40
45
|
background-color: var(--color-neutral-100);
|
|
41
|
-
border: 1px solid var(--color-neutral-300);
|
|
46
|
+
border: ${$bordered ? `1px solid var(--color-neutral-300)` : 'none'};
|
|
42
47
|
&:hover {
|
|
43
48
|
background-color: var(--color-neutral-200);
|
|
44
|
-
border:
|
|
49
|
+
border: ${$bordered
|
|
50
|
+
? `1px solid var(--color-neutral-400)`
|
|
51
|
+
: 'none'};
|
|
45
52
|
}
|
|
46
53
|
color: var(--color-neutral-900);
|
|
47
54
|
svg {
|
|
@@ -91,6 +98,7 @@ export type ButtonProps = {
|
|
|
91
98
|
size?: 'small' | 'medium' | 'large';
|
|
92
99
|
icon?: IconFC;
|
|
93
100
|
rounded?: boolean;
|
|
101
|
+
bordered?: boolean;
|
|
94
102
|
};
|
|
95
103
|
|
|
96
104
|
export const Button = forwardRef<
|
|
@@ -104,7 +112,8 @@ export const Button = forwardRef<
|
|
|
104
112
|
icon: Icon,
|
|
105
113
|
className,
|
|
106
114
|
rounded = false,
|
|
107
|
-
color = '
|
|
115
|
+
color = 'neutral',
|
|
116
|
+
bordered = true,
|
|
108
117
|
...props
|
|
109
118
|
},
|
|
110
119
|
ref
|
|
@@ -114,6 +123,7 @@ export const Button = forwardRef<
|
|
|
114
123
|
className={`${size} ${className}`}
|
|
115
124
|
$color={color}
|
|
116
125
|
$rounded={rounded}
|
|
126
|
+
$bordered={bordered}
|
|
117
127
|
{...props}
|
|
118
128
|
>
|
|
119
129
|
{Icon && <Icon />}
|
|
@@ -2,11 +2,12 @@ import { Button, ButtonProps } from './Button';
|
|
|
2
2
|
import { ButtonHTMLAttributes, forwardRef } from 'react';
|
|
3
3
|
|
|
4
4
|
import { IconFC } from '../../Icons';
|
|
5
|
+
import { ThemeSize } from '../../providers';
|
|
5
6
|
import styled from 'styled-components';
|
|
6
7
|
|
|
7
8
|
type IconButtonProps = ButtonProps & {
|
|
8
9
|
icon: IconFC;
|
|
9
|
-
$iconSize?:
|
|
10
|
+
$iconSize?: ThemeSize;
|
|
10
11
|
};
|
|
11
12
|
|
|
12
13
|
const styles = {
|
|
@@ -19,8 +20,8 @@ const styles = {
|
|
|
19
20
|
width: var(--space-6);
|
|
20
21
|
svg {
|
|
21
22
|
margin-right: 0;
|
|
22
|
-
width: ${({ $iconSize = '
|
|
23
|
-
height: ${({ $iconSize = '
|
|
23
|
+
width: ${({ $iconSize = '5' }) => `var(--space-${$iconSize})`};
|
|
24
|
+
height: ${({ $iconSize = '5' }) => `var(--space-${$iconSize})`};
|
|
24
25
|
}
|
|
25
26
|
}
|
|
26
27
|
&.medium {
|
|
@@ -29,8 +30,8 @@ const styles = {
|
|
|
29
30
|
width: var(--space-8);
|
|
30
31
|
svg {
|
|
31
32
|
margin-right: 0;
|
|
32
|
-
width: ${({ $iconSize = '
|
|
33
|
-
height: ${({ $iconSize = '
|
|
33
|
+
width: ${({ $iconSize = '6' }) => `var(--space-${$iconSize})`};
|
|
34
|
+
height: ${({ $iconSize = '6' }) => `var(--space-${$iconSize})`};
|
|
34
35
|
}
|
|
35
36
|
}
|
|
36
37
|
&.large {
|
|
@@ -39,8 +40,8 @@ const styles = {
|
|
|
39
40
|
width: var(--space-10);
|
|
40
41
|
svg {
|
|
41
42
|
margin-right: 0;
|
|
42
|
-
width: ${({ $iconSize = '
|
|
43
|
-
height: ${({ $iconSize = '
|
|
43
|
+
width: ${({ $iconSize = '8' }) => `var(--space-${$iconSize})`};
|
|
44
|
+
height: ${({ $iconSize = '8' }) => `var(--space-${$iconSize})`};
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
47
|
`,
|