@addev-be/ui 2.5.20 → 2.7.0
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/forms/BillitIdentifier/index.d.ts +6 -0
- package/dist/components/forms/BillitIdentifier/index.js +71 -0
- package/dist/components/forms/BillitIdentifier/styles.d.ts +2 -0
- package/dist/components/forms/BillitIdentifier/styles.js +15 -0
- package/dist/components/forms/Form/FormGroup.d.ts +1 -0
- package/dist/components/forms/Form/FormGroup.js +2 -2
- package/dist/components/forms/Form/Row.js +1 -1
- package/dist/components/forms/Form/Select.d.ts +3 -1
- package/dist/components/forms/Form/Select.js +19 -10
- package/dist/components/forms/Form/index.d.ts +4 -1
- package/dist/components/forms/Form/styles.d.ts +5 -3
- package/dist/components/forms/Form/styles.js +19 -14
- package/dist/components/forms/styles.js +1 -1
- package/dist/components/ui/Card/index.d.ts +2 -1
- package/dist/components/ui/Card/styles.d.ts +2 -1
- package/dist/components/ui/Card/styles.js +2 -1
- package/dist/components/ui/TabsView/TabsList.d.ts +1 -0
- package/dist/components/ui/TabsView/TabsList.js +4 -2
- package/dist/components/ui/TabsView/TabsView.d.ts +3 -1
- package/dist/components/ui/TabsView/TabsView.js +2 -2
- package/dist/components/ui/TabsView/styles.js +4 -4
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/providers/ThemeProvider/defaultTheme.js +1 -0
- package/dist/providers/ThemeProvider/helpers.d.ts +1 -1
- package/dist/providers/ThemeProvider/index.js +1 -1
- package/dist/providers/ThemeProvider/types.d.ts +1 -1
- package/dist/services/sqlRequests.d.ts +1 -1
- package/package.json +2 -2
- package/src/components/forms/BillitIdentifier/index.tsx +78 -0
- package/src/components/forms/BillitIdentifier/styles.tsx +43 -0
- package/src/components/forms/Form/FormGroup.tsx +4 -2
- package/src/components/forms/Form/Row.tsx +2 -6
- package/src/components/forms/Form/Select.tsx +24 -7
- package/src/components/forms/Form/styles.ts +31 -67
- package/src/components/forms/styles.ts +1 -1
- package/src/components/ui/Card/index.tsx +3 -1
- package/src/components/ui/Card/styles.ts +7 -3
- package/src/components/ui/TabsView/TabsList.tsx +6 -1
- package/src/components/ui/TabsView/TabsView.tsx +6 -2
- package/src/components/ui/TabsView/styles.ts +11 -3
- package/src/index.ts +1 -0
- package/src/providers/ThemeProvider/defaultTheme.ts +1 -0
- package/src/providers/ThemeProvider/helpers.ts +1 -1
- package/src/providers/ThemeProvider/index.ts +8 -1
- package/src/providers/ThemeProvider/types.ts +1 -1
- package/src/services/sqlRequests.ts +6 -0
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { BillitIdentifierContainer, BillitIdentifierWrapper } from './styles';
|
|
2
|
+
import { InputHTMLAttributes, useEffect, useState } from 'react';
|
|
3
|
+
|
|
4
|
+
type BillitPrefix = 'VAT' | 'GLN' | '';
|
|
5
|
+
|
|
6
|
+
export interface BillitIdentifierProps
|
|
7
|
+
extends Omit<InputHTMLAttributes<HTMLInputElement>, 'value' | 'onChange'> {
|
|
8
|
+
value?: string;
|
|
9
|
+
onChange?: (value: string) => void;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const BillitIdentifier = ({
|
|
13
|
+
value = '',
|
|
14
|
+
onChange,
|
|
15
|
+
...inputProps
|
|
16
|
+
}: BillitIdentifierProps) => {
|
|
17
|
+
const parseValue = (fullValue: string): [BillitPrefix, string] => {
|
|
18
|
+
if (!fullValue) {
|
|
19
|
+
return ['', ''];
|
|
20
|
+
}
|
|
21
|
+
const match = fullValue.match(/^(VAT|GLN):(.*)$/);
|
|
22
|
+
if (match) {
|
|
23
|
+
return [match[1] as BillitPrefix, match[2]];
|
|
24
|
+
}
|
|
25
|
+
return ['', fullValue];
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const [prefix, textValue] = parseValue(value);
|
|
29
|
+
const [localPrefix, setLocalPrefix] = useState<BillitPrefix>(prefix);
|
|
30
|
+
const [localValue, setLocalValue] = useState<string>(textValue);
|
|
31
|
+
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
const [newPrefix, newValue] = parseValue(value);
|
|
34
|
+
setLocalPrefix(newPrefix);
|
|
35
|
+
setLocalValue(newValue);
|
|
36
|
+
}, [value]);
|
|
37
|
+
|
|
38
|
+
const handlePrefixChange = (newPrefix: BillitPrefix) => {
|
|
39
|
+
setLocalPrefix(newPrefix);
|
|
40
|
+
if (newPrefix === '') {
|
|
41
|
+
onChange?.('');
|
|
42
|
+
} else {
|
|
43
|
+
const fullValue = `${newPrefix}:${localValue}`;
|
|
44
|
+
onChange?.(fullValue);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const handleValueChange = (newValue: string) => {
|
|
49
|
+
setLocalValue(newValue);
|
|
50
|
+
if (localPrefix === '') {
|
|
51
|
+
onChange?.('');
|
|
52
|
+
} else {
|
|
53
|
+
const fullValue = `${localPrefix}:${newValue}`;
|
|
54
|
+
onChange?.(fullValue);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<BillitIdentifierContainer>
|
|
60
|
+
<BillitIdentifierWrapper>
|
|
61
|
+
<select
|
|
62
|
+
value={localPrefix}
|
|
63
|
+
onChange={(e) => handlePrefixChange(e.target.value as BillitPrefix)}
|
|
64
|
+
>
|
|
65
|
+
<option value="">(Aucun)</option>
|
|
66
|
+
<option value="VAT">VAT</option>
|
|
67
|
+
<option value="GLN">GLN</option>
|
|
68
|
+
</select>
|
|
69
|
+
<input
|
|
70
|
+
{...inputProps}
|
|
71
|
+
type="text"
|
|
72
|
+
value={localValue}
|
|
73
|
+
onChange={(e) => handleValueChange(e.target.value)}
|
|
74
|
+
/>
|
|
75
|
+
</BillitIdentifierWrapper>
|
|
76
|
+
</BillitIdentifierContainer>
|
|
77
|
+
);
|
|
78
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { inputStyle } from '../styles';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
export const BillitIdentifierContainer = styled.div`
|
|
5
|
+
display: flex;
|
|
6
|
+
width: 100%;
|
|
7
|
+
position: relative;
|
|
8
|
+
`;
|
|
9
|
+
|
|
10
|
+
export const BillitIdentifierWrapper = styled.div`
|
|
11
|
+
display: flex;
|
|
12
|
+
width: 100%;
|
|
13
|
+
|
|
14
|
+
& > select {
|
|
15
|
+
${inputStyle}
|
|
16
|
+
width: auto;
|
|
17
|
+
border-top-right-radius: 0;
|
|
18
|
+
border-bottom-right-radius: 0;
|
|
19
|
+
border-right: none;
|
|
20
|
+
flex-shrink: 0;
|
|
21
|
+
padding-right: var(--space-2);
|
|
22
|
+
background-color: var(--color-base-100);
|
|
23
|
+
|
|
24
|
+
&:focus {
|
|
25
|
+
outline: none;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
& > input {
|
|
30
|
+
${inputStyle}
|
|
31
|
+
border-top-left-radius: 0;
|
|
32
|
+
border-bottom-left-radius: 0;
|
|
33
|
+
flex: 1;
|
|
34
|
+
|
|
35
|
+
&:focus {
|
|
36
|
+
outline: none;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&:focus-within {
|
|
41
|
+
outline: 2px solid var(--color-primary-500);
|
|
42
|
+
}
|
|
43
|
+
`;
|
|
@@ -9,6 +9,7 @@ type FormGroupProps = PropsWithChildren<{
|
|
|
9
9
|
title?: string;
|
|
10
10
|
subTitle?: string;
|
|
11
11
|
icon?: IconFC;
|
|
12
|
+
columns?: number;
|
|
12
13
|
}>;
|
|
13
14
|
|
|
14
15
|
export const FormGroup: FC<FormGroupProps> = ({
|
|
@@ -17,10 +18,11 @@ export const FormGroup: FC<FormGroupProps> = ({
|
|
|
17
18
|
title,
|
|
18
19
|
subTitle,
|
|
19
20
|
icon: Icon,
|
|
21
|
+
columns,
|
|
20
22
|
}) => (
|
|
21
|
-
<FormGroupContainer color={color}>
|
|
23
|
+
<FormGroupContainer $color={color} $columns={columns}>
|
|
22
24
|
{(title || subTitle) && (
|
|
23
|
-
<FormGroupHeader>
|
|
25
|
+
<FormGroupHeader $columns={columns}>
|
|
24
26
|
{Icon && <Icon />}
|
|
25
27
|
{title && <h3>{title}</h3>}
|
|
26
28
|
{subTitle && <h4>{subTitle}</h4>}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { FC, PropsWithChildren } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
FormRowContainer,
|
|
4
|
-
FormRowInputContainer,
|
|
5
|
-
FormRowLabel,
|
|
6
|
-
} from './styles';
|
|
2
|
+
import { FormRowContainer, FormRowLabel } from './styles';
|
|
7
3
|
|
|
8
4
|
import { IconFC } from '../../../Icons';
|
|
9
5
|
|
|
@@ -27,6 +23,6 @@ export const FormRow: FC<FormRowProps> = ({
|
|
|
27
23
|
{label}
|
|
28
24
|
</FormRowLabel>
|
|
29
25
|
)}
|
|
30
|
-
|
|
26
|
+
{children}
|
|
31
27
|
</FormRowContainer>
|
|
32
28
|
);
|
|
@@ -17,6 +17,8 @@ type SelectProps<T> = {
|
|
|
17
17
|
readOnly?: boolean;
|
|
18
18
|
onChange?: (value: T | null) => void;
|
|
19
19
|
ref?: ForwardedRef<HTMLSelectElement>;
|
|
20
|
+
allowNull?: boolean;
|
|
21
|
+
nullText?: string;
|
|
20
22
|
};
|
|
21
23
|
|
|
22
24
|
export const Select = <T,>({
|
|
@@ -29,6 +31,8 @@ export const Select = <T,>({
|
|
|
29
31
|
onChange,
|
|
30
32
|
value,
|
|
31
33
|
ref,
|
|
34
|
+
allowNull = false,
|
|
35
|
+
nullText = 'Aucun(e)',
|
|
32
36
|
...props
|
|
33
37
|
}: FormRowProps &
|
|
34
38
|
Omit<SelectHTMLAttributes<HTMLSelectElement>, 'value' | 'onChange'> &
|
|
@@ -40,17 +44,25 @@ export const Select = <T,>({
|
|
|
40
44
|
(event: React.ChangeEvent<HTMLSelectElement>) => {
|
|
41
45
|
if (onChange) {
|
|
42
46
|
const selectedValue = event.target.value;
|
|
43
|
-
|
|
44
|
-
(
|
|
45
|
-
|
|
46
|
-
|
|
47
|
+
if (allowNull && selectedValue === null) {
|
|
48
|
+
onChange(null);
|
|
49
|
+
} else {
|
|
50
|
+
const selectedItem = items.find(
|
|
51
|
+
(item, index) => itemKey(item, index) == selectedValue
|
|
52
|
+
);
|
|
53
|
+
onChange(selectedItem || null);
|
|
54
|
+
}
|
|
47
55
|
selectRef.current?.blur();
|
|
48
56
|
}
|
|
49
57
|
},
|
|
50
|
-
[items, itemKey, onChange]
|
|
58
|
+
[items, itemKey, onChange, allowNull]
|
|
51
59
|
);
|
|
52
60
|
|
|
53
|
-
const selectedValue = value
|
|
61
|
+
const selectedValue = value
|
|
62
|
+
? itemKey(value, -1)
|
|
63
|
+
: allowNull
|
|
64
|
+
? null
|
|
65
|
+
: undefined;
|
|
54
66
|
|
|
55
67
|
return (
|
|
56
68
|
<FormRow label={label} icon={icon} readOnly={readOnly}>
|
|
@@ -62,10 +74,15 @@ export const Select = <T,>({
|
|
|
62
74
|
<select
|
|
63
75
|
{...props}
|
|
64
76
|
disabled={readOnly}
|
|
65
|
-
value={selectedValue}
|
|
77
|
+
value={selectedValue || ''}
|
|
66
78
|
onChange={onSelectChange}
|
|
67
79
|
ref={selectRef}
|
|
68
80
|
>
|
|
81
|
+
{allowNull && (
|
|
82
|
+
<option disabled={!allowNull} value="">
|
|
83
|
+
{nullText}
|
|
84
|
+
</option>
|
|
85
|
+
)}
|
|
69
86
|
{items.map((item, index) => {
|
|
70
87
|
const key = itemKey(item, index);
|
|
71
88
|
const label = itemLabel(item, index);
|
|
@@ -4,11 +4,13 @@ import { ThemeColorWithIntensity } from '../../../providers/ThemeProvider/types'
|
|
|
4
4
|
import { mediaQueries } from '../../../helpers/responsive';
|
|
5
5
|
|
|
6
6
|
export const FormGroupContainer = styled.fieldset<{
|
|
7
|
-
color?: ThemeColorWithIntensity;
|
|
7
|
+
$color?: ThemeColorWithIntensity;
|
|
8
|
+
$columns?: number;
|
|
8
9
|
}>`
|
|
9
|
-
display:
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
display: grid;
|
|
11
|
+
grid-template-columns: repeat(${({ $columns = 1 }) => $columns}, 1fr);
|
|
12
|
+
|
|
13
|
+
background: var(--color-base-50);
|
|
12
14
|
border-radius: var(--rounded-md);
|
|
13
15
|
box-shadow: var(--shadow-md);
|
|
14
16
|
|
|
@@ -24,15 +26,18 @@ export const FormGroupContainer = styled.fieldset<{
|
|
|
24
26
|
}
|
|
25
27
|
|
|
26
28
|
margin: 0;
|
|
27
|
-
border: 1px solid var(--color-base-
|
|
28
|
-
border-left: 8px solid ${({ color = 'base' }) => `var(--color-${color})`};
|
|
29
|
+
border: 1px solid var(--color-base-200);
|
|
30
|
+
border-left: 8px solid ${({ $color = 'base' }) => `var(--color-${$color})`};
|
|
29
31
|
`;
|
|
30
32
|
|
|
31
|
-
export const FormGroupHeader = styled.div
|
|
33
|
+
export const FormGroupHeader = styled.div<{
|
|
34
|
+
$columns?: number;
|
|
35
|
+
}>`
|
|
32
36
|
display: flex;
|
|
33
37
|
flex-direction: row;
|
|
34
38
|
align-items: center;
|
|
35
39
|
gap: var(--space-2);
|
|
40
|
+
grid-column: span ${({ $columns = 1 }) => $columns};
|
|
36
41
|
|
|
37
42
|
& > h3 {
|
|
38
43
|
margin: 0;
|
|
@@ -53,34 +58,30 @@ export const FormGroupHeader = styled.div`
|
|
|
53
58
|
`;
|
|
54
59
|
|
|
55
60
|
export const inputCss = css`
|
|
56
|
-
font-family:
|
|
61
|
+
font-family: var(--font-input);
|
|
57
62
|
font-size: var(--text-base);
|
|
63
|
+
font-weight: 500;
|
|
58
64
|
|
|
59
|
-
border:
|
|
65
|
+
border: 1px solid var(--color-base-300);
|
|
60
66
|
color: var(--color-text-800);
|
|
61
67
|
background: var(--color-base-0);
|
|
62
68
|
|
|
63
69
|
box-sizing: border-box;
|
|
64
70
|
width: 100%;
|
|
65
|
-
padding: var(--space-
|
|
66
|
-
|
|
67
|
-
text-align: right;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
&:focus {
|
|
71
|
-
outline: none;
|
|
72
|
-
}
|
|
71
|
+
padding: var(--space-2);
|
|
72
|
+
border-radius: var(--rounded-md);
|
|
73
73
|
`;
|
|
74
74
|
|
|
75
75
|
export const FormRowLabel = styled.span`
|
|
76
|
-
color: var(--color-
|
|
77
|
-
font-size: var(--text-
|
|
76
|
+
color: var(--color-base-600);
|
|
77
|
+
font-size: var(--text-sm);
|
|
78
|
+
text-transform: uppercase;
|
|
78
79
|
padding: var(--space-1) 0;
|
|
79
80
|
display: flex;
|
|
80
81
|
flex-direction: row;
|
|
81
82
|
gap: var(--space-2);
|
|
82
83
|
line-height: 1.25;
|
|
83
|
-
font-weight:
|
|
84
|
+
font-weight: normal;
|
|
84
85
|
align-self: flex-start;
|
|
85
86
|
|
|
86
87
|
& > svg {
|
|
@@ -91,63 +92,26 @@ export const FormRowLabel = styled.span`
|
|
|
91
92
|
}
|
|
92
93
|
`;
|
|
93
94
|
|
|
94
|
-
export const FormRowInputContainer = styled.div`
|
|
95
|
-
flex: 1;
|
|
96
|
-
text-align: right;
|
|
97
|
-
|
|
98
|
-
${mediaQueries.mdDown} {
|
|
99
|
-
width: 100%;
|
|
100
|
-
text-align: left;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
& > select,
|
|
104
|
-
& > input,
|
|
105
|
-
& > textarea {
|
|
106
|
-
${inputCss}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
& > select:focus > option {
|
|
110
|
-
text-align: left;
|
|
111
|
-
}
|
|
112
|
-
`;
|
|
113
|
-
|
|
114
95
|
export const FormRowContainer = styled.label<{
|
|
115
96
|
$readOnly?: boolean;
|
|
116
97
|
}>`
|
|
117
98
|
display: flex;
|
|
118
99
|
flex-direction: column;
|
|
119
|
-
align-items:
|
|
100
|
+
align-items: flex-start;
|
|
120
101
|
gap: 0;
|
|
121
102
|
padding: var(--space-2);
|
|
122
103
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
border: 1px solid var(--color-base-200);
|
|
130
|
-
background: var(--color-base-0);
|
|
131
|
-
&:focus-within {
|
|
132
|
-
outline: 2px solid var(--color-primary-500);
|
|
133
|
-
z-index: 1;
|
|
104
|
+
& > select,
|
|
105
|
+
& > input,
|
|
106
|
+
& > textarea {
|
|
107
|
+
${inputCss}
|
|
134
108
|
}
|
|
135
109
|
|
|
136
110
|
&.read-only {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
& + & {
|
|
144
|
-
border-top: 1px solid var(--color-base-300);
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
& > div > select,
|
|
148
|
-
& > div > select[disabled],
|
|
149
|
-
& > div > input,
|
|
150
|
-
& > div > textarea {
|
|
111
|
+
& > select,
|
|
112
|
+
& > select[disabled],
|
|
113
|
+
& > input,
|
|
114
|
+
& > textarea {
|
|
151
115
|
background: none;
|
|
152
116
|
color: var(--color-text-800);
|
|
153
117
|
}
|
|
@@ -160,8 +124,8 @@ export const StyledCheckbox = styled.input.attrs({ type: 'checkbox' })`
|
|
|
160
124
|
`;
|
|
161
125
|
|
|
162
126
|
export const ReadOnlyValue = styled.span`
|
|
163
|
-
font-size: var(--text-lg);
|
|
164
127
|
padding: var(--space-1) 0;
|
|
128
|
+
font-weight: 500;
|
|
165
129
|
`;
|
|
166
130
|
|
|
167
131
|
export const FormFields = styled.div<{ $readOnly?: boolean }>`
|
|
@@ -3,7 +3,7 @@ import styled, { css } from 'styled-components';
|
|
|
3
3
|
import { NumericFormat } from 'react-number-format';
|
|
4
4
|
|
|
5
5
|
export const inputStyle = css`
|
|
6
|
-
font-family: var(--font-
|
|
6
|
+
font-family: var(--font-input);
|
|
7
7
|
font-size: inherit;
|
|
8
8
|
color: var(--color-text-800);
|
|
9
9
|
background-color: var(--color-base-0);
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { CardContainer, CardFooter, CardHeader } from './styles';
|
|
2
2
|
import { FC, HTMLAttributes } from 'react';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
import { SpaceProps } from '../../../helpers/styled/space';
|
|
5
|
+
|
|
6
|
+
type CardFC = FC<HTMLAttributes<HTMLDivElement> & SpaceProps> & {
|
|
5
7
|
Header: typeof CardHeader;
|
|
6
8
|
Footer: typeof CardFooter;
|
|
7
9
|
};
|
|
@@ -1,15 +1,19 @@
|
|
|
1
|
+
import { SpaceProps, space } from '../../../helpers/styled/space';
|
|
2
|
+
|
|
1
3
|
import styled from 'styled-components';
|
|
2
4
|
|
|
3
5
|
export const CardContainer = styled.div.attrs({
|
|
4
6
|
className: 'CardContainer',
|
|
5
|
-
})
|
|
7
|
+
})<SpaceProps>`
|
|
6
8
|
display: flex;
|
|
7
9
|
flex-direction: column;
|
|
8
|
-
background-color: var(--color-base-
|
|
10
|
+
background-color: var(--color-base-50);
|
|
9
11
|
border-radius: var(--rounded-md);
|
|
10
12
|
box-shadow: var(--shadow-md);
|
|
11
13
|
padding: var(--space-4);
|
|
12
|
-
border: 1px solid var(--color-base-
|
|
14
|
+
border: 1px solid var(--color-base-200);
|
|
15
|
+
|
|
16
|
+
${space}
|
|
13
17
|
`;
|
|
14
18
|
|
|
15
19
|
export const CardHeader = styled.div.attrs({
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import { FC, useEffect, useState } from 'react';
|
|
2
2
|
import { TabContainer, TabsListContainer } from './styles';
|
|
3
3
|
|
|
4
|
+
import { Card } from '../Card';
|
|
4
5
|
import { SpaceProps } from '../../../helpers/styled/space';
|
|
5
6
|
import { Tab } from './types';
|
|
6
7
|
|
|
7
8
|
type TabsListProps = {
|
|
9
|
+
card?: boolean;
|
|
8
10
|
tabs: Tab[];
|
|
9
11
|
selectedIndex?: number;
|
|
10
12
|
onSelectedIndexChanged?: (index: number) => void;
|
|
11
13
|
} & SpaceProps;
|
|
12
14
|
|
|
13
15
|
export const TabsList: FC<TabsListProps> = ({
|
|
16
|
+
card,
|
|
14
17
|
tabs,
|
|
15
18
|
selectedIndex,
|
|
16
19
|
onSelectedIndexChanged,
|
|
@@ -26,7 +29,7 @@ export const TabsList: FC<TabsListProps> = ({
|
|
|
26
29
|
onSelectedIndexChanged?.(activeIndex);
|
|
27
30
|
}, [activeIndex, onSelectedIndexChanged]);
|
|
28
31
|
|
|
29
|
-
|
|
32
|
+
const tabsList = (
|
|
30
33
|
<TabsListContainer {...spaceProps}>
|
|
31
34
|
{tabs.map((tab, index) => (
|
|
32
35
|
<TabContainer
|
|
@@ -41,4 +44,6 @@ export const TabsList: FC<TabsListProps> = ({
|
|
|
41
44
|
))}
|
|
42
45
|
</TabsListContainer>
|
|
43
46
|
);
|
|
47
|
+
|
|
48
|
+
return card ? <Card p="2">{tabsList}</Card> : tabsList;
|
|
44
49
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { FC, useEffect, useState } from 'react';
|
|
2
2
|
import { TabContentContainer, TabsViewContainer } from './styles';
|
|
3
3
|
|
|
4
|
+
import { SpaceProps } from '../../../helpers/styled/space';
|
|
4
5
|
import { Tab } from './types';
|
|
5
6
|
import { TabsList } from './TabsList';
|
|
6
7
|
|
|
@@ -8,12 +9,14 @@ type TabsViewProps = {
|
|
|
8
9
|
tabs: Tab[];
|
|
9
10
|
overflow?: boolean;
|
|
10
11
|
onSelectedTabChanged?: (tab: Tab, index: number) => void;
|
|
11
|
-
|
|
12
|
+
card?: boolean;
|
|
13
|
+
} & SpaceProps;
|
|
12
14
|
|
|
13
15
|
export const TabsView: FC<TabsViewProps> = ({
|
|
14
16
|
tabs,
|
|
15
17
|
overflow = false,
|
|
16
18
|
onSelectedTabChanged,
|
|
19
|
+
card,
|
|
17
20
|
}) => {
|
|
18
21
|
const [activeIndex, setActiveIndex] = useState(0);
|
|
19
22
|
const activeTab = tabs[activeIndex];
|
|
@@ -25,10 +28,11 @@ export const TabsView: FC<TabsViewProps> = ({
|
|
|
25
28
|
return (
|
|
26
29
|
<TabsViewContainer>
|
|
27
30
|
<TabsList
|
|
31
|
+
card={card}
|
|
28
32
|
tabs={tabs}
|
|
29
33
|
selectedIndex={activeIndex}
|
|
30
34
|
onSelectedIndexChanged={setActiveIndex}
|
|
31
|
-
p=
|
|
35
|
+
p={card ? '0' : '2'}
|
|
32
36
|
/>
|
|
33
37
|
<TabContentContainer $isOverflow={overflow}>
|
|
34
38
|
{activeTab.content}
|
|
@@ -3,14 +3,17 @@ import {
|
|
|
3
3
|
ThemeColor,
|
|
4
4
|
ThemeColorWithIntensity,
|
|
5
5
|
} from '../../../providers/ThemeProvider/types';
|
|
6
|
+
import {
|
|
7
|
+
getColor,
|
|
8
|
+
getColorWithIntensity,
|
|
9
|
+
} from '../../../providers/ThemeProvider/helpers';
|
|
6
10
|
import styled, { css } from 'styled-components';
|
|
7
11
|
|
|
8
|
-
import { getColorWithIntensity } from '../../../providers/ThemeProvider/helpers';
|
|
9
|
-
|
|
10
12
|
export const TabsViewContainer = styled.div`
|
|
11
13
|
display: flex;
|
|
12
14
|
flex-direction: column;
|
|
13
15
|
height: 100%;
|
|
16
|
+
gap: var(--space-4);
|
|
14
17
|
`;
|
|
15
18
|
|
|
16
19
|
export const TabsListContainer = styled.div<SpaceProps>`
|
|
@@ -19,7 +22,7 @@ export const TabsListContainer = styled.div<SpaceProps>`
|
|
|
19
22
|
flex-shrink: 0;
|
|
20
23
|
overflow-x: scroll;
|
|
21
24
|
scrollbar-width: none;
|
|
22
|
-
font-size: var(--text-
|
|
25
|
+
font-size: var(--text-base);
|
|
23
26
|
white-space: nowrap;
|
|
24
27
|
|
|
25
28
|
${space}
|
|
@@ -55,6 +58,11 @@ export const TabContainer = styled.div<{
|
|
|
55
58
|
${({ $isActive, $color = 'primary' }) =>
|
|
56
59
|
$isActive &&
|
|
57
60
|
css`
|
|
61
|
+
background: radial-gradient(
|
|
62
|
+
ellipse at bottom center,
|
|
63
|
+
var(--color-${getColor($color)}-50) 0%,
|
|
64
|
+
transparent 80%
|
|
65
|
+
);
|
|
58
66
|
border-bottom: var(--space-0_5) solid;
|
|
59
67
|
color: var(--color-${getColorWithIntensity($color, 500)});
|
|
60
68
|
svg {
|
package/src/index.ts
CHANGED
|
@@ -17,6 +17,7 @@ export * from './components/data/VirtualScroller';
|
|
|
17
17
|
export * from './components/data/VirtualScroller/types';
|
|
18
18
|
|
|
19
19
|
export * from './components/forms/AutoTextArea';
|
|
20
|
+
export * from './components/forms/BillitIdentifier';
|
|
20
21
|
export * from './components/forms/Button';
|
|
21
22
|
export * from './components/forms/Select';
|
|
22
23
|
export * from './components/forms/IconButton';
|
|
@@ -377,6 +377,7 @@ export const defaultTheme: Theme = {
|
|
|
377
377
|
sans: "'Montserrat', Helvetica, Arial, Verdana, sans-serif",
|
|
378
378
|
serif: "Georgia, Cambria, 'Times New Roman', Times, serif",
|
|
379
379
|
mono: "Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace",
|
|
380
|
+
input: "'Montserrat', Helvetica, Arial, Verdana, sans-serif",
|
|
380
381
|
},
|
|
381
382
|
|
|
382
383
|
weights: {
|
|
@@ -20,7 +20,7 @@ export const extendDefaultDarkTheme = (override?: DeepPartial<Theme>): Theme =>
|
|
|
20
20
|
extendTheme(defaultDarkTheme, override);
|
|
21
21
|
|
|
22
22
|
export const getColor = (
|
|
23
|
-
colorWithIntensity: ThemeColorWithIntensity
|
|
23
|
+
colorWithIntensity: ThemeColor | ThemeColorWithIntensity
|
|
24
24
|
): ThemeColor => {
|
|
25
25
|
const [colorName] = colorWithIntensity.split('-');
|
|
26
26
|
return colorName as ThemeColor;
|
|
@@ -56,7 +56,14 @@ export const ThemeProvider = styled.div<ThemeProviderProps>`
|
|
|
56
56
|
].join('');
|
|
57
57
|
}}
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
font-family: var(--font-sans);
|
|
60
|
+
font-size: var(--text-base);
|
|
61
|
+
font-weight: var(--weight-normal);
|
|
62
|
+
color: var(--color-text-800);
|
|
63
|
+
background-color: var(--color-base-0);
|
|
64
|
+
|
|
65
|
+
a,
|
|
66
|
+
a:visited {
|
|
60
67
|
color: var(--color-primary-500);
|
|
61
68
|
}
|
|
62
69
|
a:active,
|
|
@@ -62,7 +62,7 @@ export type ThemeTextSize =
|
|
|
62
62
|
| '4xl'
|
|
63
63
|
| '5xl'
|
|
64
64
|
| '6xl';
|
|
65
|
-
export type ThemeFontFamily = 'sans' | 'serif' | 'mono';
|
|
65
|
+
export type ThemeFontFamily = 'sans' | 'serif' | 'mono' | 'input';
|
|
66
66
|
export type ThemeFontWeight = 'light' | 'normal' | 'bold';
|
|
67
67
|
export type ThemeSpace =
|
|
68
68
|
| '0'
|
|
@@ -26,11 +26,17 @@ export type FieldDTO<T extends string = string> = {
|
|
|
26
26
|
export type ConditionDTO = {
|
|
27
27
|
field: string;
|
|
28
28
|
operator:
|
|
29
|
+
| 'isLessThan'
|
|
30
|
+
| 'isLessThanOrEqual'
|
|
31
|
+
| 'isLessThanOrEquals'
|
|
29
32
|
| 'lessThan'
|
|
30
33
|
| 'lessThanOrEqual'
|
|
31
34
|
| 'lessThanOrEquals'
|
|
32
35
|
| 'equals'
|
|
33
36
|
| 'notEquals'
|
|
37
|
+
| 'isGreaterThanOrEqual'
|
|
38
|
+
| 'isGreaterThanOrEquals'
|
|
39
|
+
| 'isGreaterThan'
|
|
34
40
|
| 'greaterThanOrEqual'
|
|
35
41
|
| 'greaterThanOrEquals'
|
|
36
42
|
| 'greaterThan'
|