@tsiky/components-r19 1.0.0 → 1.1.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/index.ts +35 -33
- package/package.json +1 -1
- package/src/components/Charts/area-chart-admission/AreaChartAdmission.tsx +123 -89
- package/src/components/Charts/bar-chart/BarChart.tsx +167 -132
- package/src/components/Charts/mixed-chart/MixedChart.tsx +65 -9
- package/src/components/Charts/sankey-chart/SankeyChart.tsx +183 -155
- package/src/components/Confirmationpopup/ConfirmationPopup.module.css +88 -0
- package/src/components/Confirmationpopup/ConfirmationPopup.stories.tsx +94 -0
- package/src/components/Confirmationpopup/ConfirmationPopup.tsx +47 -0
- package/src/components/Confirmationpopup/index.ts +6 -0
- package/src/components/Confirmationpopup/useConfirmationPopup.ts +48 -0
- package/src/components/DayStatCard/DayStatCard.tsx +96 -69
- package/src/components/DynamicTable/AdvancedFilters.tsx +196 -196
- package/src/components/DynamicTable/ColumnSorter.tsx +185 -185
- package/src/components/DynamicTable/Pagination.tsx +115 -115
- package/src/components/DynamicTable/TableauDynamique.module.css +1287 -1287
- package/src/components/DynamicTable/filters/SelectFilter.tsx +69 -69
- package/src/components/EntryControl/EntryControl.tsx +117 -117
- package/src/components/Grid/Grid.tsx +5 -0
- package/src/components/Header/Header.tsx +4 -2
- package/src/components/Header/header.css +61 -31
- package/src/components/MetricsPanel/MetricsPanel.module.css +688 -636
- package/src/components/MetricsPanel/MetricsPanel.tsx +220 -282
- package/src/components/MetricsPanel/renderers/CompactRenderer.tsx +148 -125
- package/src/components/NavBar/NavBar.tsx +1 -1
- package/src/components/SelectFilter/SelectFilter.module.css +249 -0
- package/src/components/SelectFilter/SelectFilter.stories.tsx +321 -0
- package/src/components/SelectFilter/SelectFilter.tsx +219 -0
- package/src/components/SelectFilter/index.ts +2 -0
- package/src/components/SelectFilter/types.ts +19 -0
- package/src/components/TranslationKey/TranslationKey.tsx +265 -245
- package/src/components/TrendList/TrendList.tsx +72 -45
|
@@ -1,125 +1,148 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
>
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
>
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
>
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
: hexToRgba('#7c3aed', 0.
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { hexToRgba as utilHexToRgba } from '../tools/colorUtils';
|
|
4
|
+
import type { MetricsItem as ItemType } from '../tools/MetricsPanelTypes';
|
|
5
|
+
|
|
6
|
+
const hexToRgba = (c: string | undefined | null, a = 1) => {
|
|
7
|
+
try {
|
|
8
|
+
return utilHexToRgba(c as any, a);
|
|
9
|
+
} catch {
|
|
10
|
+
return `rgba(124, 58, 237, ${a})`;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const CompactRenderer = (item: ItemType) => (
|
|
15
|
+
<div
|
|
16
|
+
style={{
|
|
17
|
+
display: 'grid',
|
|
18
|
+
gridTemplateRows: 'auto 1fr',
|
|
19
|
+
width: '100%',
|
|
20
|
+
gap: 8,
|
|
21
|
+
alignItems: 'center',
|
|
22
|
+
boxSizing: 'border-box',
|
|
23
|
+
minWidth: 0,
|
|
24
|
+
}}
|
|
25
|
+
>
|
|
26
|
+
<div
|
|
27
|
+
style={{
|
|
28
|
+
display: 'flex',
|
|
29
|
+
justifyContent: 'space-between-left',
|
|
30
|
+
alignItems: 'baseline',
|
|
31
|
+
gap: 10,
|
|
32
|
+
width: '100%',
|
|
33
|
+
}}
|
|
34
|
+
>
|
|
35
|
+
<div
|
|
36
|
+
style={{
|
|
37
|
+
fontWeight: 700,
|
|
38
|
+
fontSize: 'clamp(14px, 1.2vw, 16px)',
|
|
39
|
+
overflow: 'hidden',
|
|
40
|
+
textOverflow: 'ellipsis',
|
|
41
|
+
whiteSpace: 'nowrap',
|
|
42
|
+
minWidth: 0,
|
|
43
|
+
}}
|
|
44
|
+
>
|
|
45
|
+
{item.label}
|
|
46
|
+
</div>
|
|
47
|
+
{item.subLabel ? (
|
|
48
|
+
<div
|
|
49
|
+
style={{
|
|
50
|
+
fontSize: 'clamp(13px, 1.1vw, 15px)',
|
|
51
|
+
fontWeight: 600,
|
|
52
|
+
whiteSpace: 'nowrap',
|
|
53
|
+
}}
|
|
54
|
+
>
|
|
55
|
+
{item.subLabel}
|
|
56
|
+
</div>
|
|
57
|
+
) : null}
|
|
58
|
+
</div>
|
|
59
|
+
|
|
60
|
+
<div
|
|
61
|
+
style={{
|
|
62
|
+
display: 'flex',
|
|
63
|
+
justifyContent: 'space-between',
|
|
64
|
+
alignItems: 'center',
|
|
65
|
+
gap: 15,
|
|
66
|
+
width: '100%',
|
|
67
|
+
}}
|
|
68
|
+
>
|
|
69
|
+
<div
|
|
70
|
+
style={{
|
|
71
|
+
fontWeight: 900,
|
|
72
|
+
fontSize: 'clamp(22px, 2.5vw, 26px)',
|
|
73
|
+
color: (item as any).valueColor,
|
|
74
|
+
lineHeight: 1,
|
|
75
|
+
minWidth: 0,
|
|
76
|
+
overflow: 'hidden',
|
|
77
|
+
textOverflow: 'ellipsis',
|
|
78
|
+
whiteSpace: 'nowrap',
|
|
79
|
+
}}
|
|
80
|
+
>
|
|
81
|
+
{item.value}
|
|
82
|
+
</div>
|
|
83
|
+
|
|
84
|
+
{item.badge ? (
|
|
85
|
+
<div
|
|
86
|
+
style={{
|
|
87
|
+
display: 'flex',
|
|
88
|
+
flexDirection: 'column',
|
|
89
|
+
alignItems: 'center',
|
|
90
|
+
justifyContent: 'center',
|
|
91
|
+
padding: '8px 12px',
|
|
92
|
+
borderRadius: 10,
|
|
93
|
+
backgroundColor: (item as any).badge.bg
|
|
94
|
+
? (item as any).badge.bg
|
|
95
|
+
: hexToRgba('#7c3aed', 0.08),
|
|
96
|
+
border: `1px solid ${
|
|
97
|
+
(item as any).badge.bg ? (item as any).badge.bg : hexToRgba('#7c3aed', 0.12)
|
|
98
|
+
}`,
|
|
99
|
+
color: (item as any).badge.textColor || '#0f172a',
|
|
100
|
+
fontWeight: 700,
|
|
101
|
+
fontSize: 'clamp(12px, 1.2vw, 14px)',
|
|
102
|
+
width: '120px',
|
|
103
|
+
height: '52px',
|
|
104
|
+
textAlign: 'center',
|
|
105
|
+
boxSizing: 'border-box',
|
|
106
|
+
overflow: 'hidden',
|
|
107
|
+
boxShadow: '0 2px 4px rgba(0,0,0,0.1)',
|
|
108
|
+
lineHeight: 1.2,
|
|
109
|
+
flexShrink: 0,
|
|
110
|
+
}}
|
|
111
|
+
>
|
|
112
|
+
<div
|
|
113
|
+
style={{
|
|
114
|
+
fontSize: 14,
|
|
115
|
+
fontWeight: 800,
|
|
116
|
+
lineHeight: 1.2,
|
|
117
|
+
letterSpacing: '0.02em',
|
|
118
|
+
width: '100%',
|
|
119
|
+
overflow: 'hidden',
|
|
120
|
+
textOverflow: 'ellipsis',
|
|
121
|
+
whiteSpace: 'nowrap',
|
|
122
|
+
}}
|
|
123
|
+
>
|
|
124
|
+
{(item as any).badge.text}
|
|
125
|
+
</div>
|
|
126
|
+
{(item as any).badge.subText ? (
|
|
127
|
+
<div
|
|
128
|
+
style={{
|
|
129
|
+
fontSize: 13,
|
|
130
|
+
marginTop: 4,
|
|
131
|
+
fontWeight: 700,
|
|
132
|
+
letterSpacing: '0.01em',
|
|
133
|
+
width: '100%',
|
|
134
|
+
overflow: 'hidden',
|
|
135
|
+
textOverflow: 'ellipsis',
|
|
136
|
+
whiteSpace: 'nowrap',
|
|
137
|
+
}}
|
|
138
|
+
>
|
|
139
|
+
{(item as any).badge.subText}
|
|
140
|
+
</div>
|
|
141
|
+
) : null}
|
|
142
|
+
</div>
|
|
143
|
+
) : null}
|
|
144
|
+
</div>
|
|
145
|
+
</div>
|
|
146
|
+
);
|
|
147
|
+
|
|
148
|
+
export default CompactRenderer;
|
|
@@ -26,7 +26,7 @@ export const NavBar: React.FC<NavBarProps> = ({
|
|
|
26
26
|
const checkNavSize = () => {
|
|
27
27
|
if (navRef.current && navRef.current.parentElement) {
|
|
28
28
|
const parentWidth = navRef.current.parentNode?.parentElement?.offsetWidth || 0;
|
|
29
|
-
setIsMobile(parentWidth * 0.
|
|
29
|
+
setIsMobile(parentWidth * 0.2 < navRef.current.offsetWidth);
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
32
|
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
.container {
|
|
2
|
+
position: relative;
|
|
3
|
+
width: 100%;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.selectButton {
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
justify-content: space-between;
|
|
10
|
+
width: 100%;
|
|
11
|
+
text-align: left;
|
|
12
|
+
border-radius: 0.5rem;
|
|
13
|
+
border: 1px solid #d1d5db;
|
|
14
|
+
background-color: white;
|
|
15
|
+
box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
|
|
16
|
+
transition: all 0.2s ease-in-out;
|
|
17
|
+
cursor: pointer;
|
|
18
|
+
outline: none;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.selectButton:focus {
|
|
22
|
+
border-color: #3b82f6;
|
|
23
|
+
box-shadow: 0 0 0 2px rgb(59 130 246 / 0.5);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.selectButton:hover:not(.disabled) {
|
|
27
|
+
border-color: #9ca3af;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.disabled {
|
|
31
|
+
opacity: 0.5;
|
|
32
|
+
background-color: #f9fafb;
|
|
33
|
+
cursor: not-allowed;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.error {
|
|
37
|
+
border-color: #ef4444;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.error:focus {
|
|
41
|
+
border-color: #ef4444;
|
|
42
|
+
box-shadow: 0 0 0 2px rgb(239 68 68 / 0.5);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.default {
|
|
46
|
+
border-color: #d1d5db;
|
|
47
|
+
background-color: white;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.outline {
|
|
51
|
+
border-width: 2px;
|
|
52
|
+
border-color: #9ca3af;
|
|
53
|
+
background-color: transparent;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.outline:focus {
|
|
57
|
+
border-color: #2563eb;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.filled {
|
|
61
|
+
border: none;
|
|
62
|
+
background-color: #f3f4f6;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.filled:focus {
|
|
66
|
+
background-color: white;
|
|
67
|
+
box-shadow: 0 0 0 2px rgb(59 130 246 / 0.5);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.sm {
|
|
71
|
+
padding: 0.25rem 0.5rem;
|
|
72
|
+
font-size: 0.875rem;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.md {
|
|
76
|
+
padding: 0.5rem 0.75rem;
|
|
77
|
+
font-size: 1rem;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.lg {
|
|
81
|
+
padding: 0.75rem 1rem;
|
|
82
|
+
font-size: 1.125rem;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.buttonContent {
|
|
86
|
+
display: flex;
|
|
87
|
+
align-items: center;
|
|
88
|
+
justify-content: space-between;
|
|
89
|
+
width: 100%;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.label {
|
|
93
|
+
overflow: hidden;
|
|
94
|
+
text-overflow: ellipsis;
|
|
95
|
+
white-space: nowrap;
|
|
96
|
+
display: block;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.placeholder {
|
|
100
|
+
color: #6b7280;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.iconsContainer {
|
|
104
|
+
display: flex;
|
|
105
|
+
align-items: center;
|
|
106
|
+
gap: 0.5rem;
|
|
107
|
+
flex-shrink: 0;
|
|
108
|
+
margin-left: 0.5rem;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.loadingSpinner {
|
|
112
|
+
width: 1rem;
|
|
113
|
+
height: 1rem;
|
|
114
|
+
border: 2px solid #3b82f6;
|
|
115
|
+
border-top: 2px solid transparent;
|
|
116
|
+
border-radius: 50%;
|
|
117
|
+
animation: spin 1s linear infinite;
|
|
118
|
+
flex-shrink: 0;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
@keyframes spin {
|
|
122
|
+
from {
|
|
123
|
+
transform: rotate(0deg);
|
|
124
|
+
}
|
|
125
|
+
to {
|
|
126
|
+
transform: rotate(360deg);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.arrowIcon {
|
|
131
|
+
width: 1rem;
|
|
132
|
+
height: 1rem;
|
|
133
|
+
color: #6b7280;
|
|
134
|
+
transition: transform 0.2s ease-in-out;
|
|
135
|
+
flex-shrink: 0;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.arrowIconOpen {
|
|
139
|
+
transform: rotate(180deg);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.dropdown {
|
|
143
|
+
position: absolute;
|
|
144
|
+
z-index: 50;
|
|
145
|
+
width: 100%;
|
|
146
|
+
margin-top: 0.25rem;
|
|
147
|
+
background-color: white;
|
|
148
|
+
border: 1px solid #d1d5db;
|
|
149
|
+
border-radius: 0.5rem;
|
|
150
|
+
box-shadow:
|
|
151
|
+
0 10px 15px -3px rgb(0 0 0 / 0.1),
|
|
152
|
+
0 4px 6px -4px rgb(0 0 0 / 0.1);
|
|
153
|
+
max-height: 15rem;
|
|
154
|
+
overflow: hidden;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.searchContainer {
|
|
158
|
+
padding: 0.5rem;
|
|
159
|
+
border-bottom: 1px solid #e5e7eb;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.searchInput {
|
|
163
|
+
width: 90%;
|
|
164
|
+
padding: 0.5rem 0.75rem;
|
|
165
|
+
font-size: 0.875rem;
|
|
166
|
+
border: 1px solid #d1d5db;
|
|
167
|
+
border-radius: 0.375rem;
|
|
168
|
+
outline: none;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.searchInput:focus {
|
|
172
|
+
border-color: transparent;
|
|
173
|
+
box-shadow: 0 0 0 2px rgb(59 130 246 / 0.5);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.optionsList {
|
|
177
|
+
overflow-y: auto;
|
|
178
|
+
max-height: 12rem;
|
|
179
|
+
padding: 0.25rem 0;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.noResults {
|
|
183
|
+
padding: 0.75rem 1rem;
|
|
184
|
+
font-size: 0.875rem;
|
|
185
|
+
color: #6b7280;
|
|
186
|
+
text-align: center;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.option {
|
|
190
|
+
padding: 0.5rem 1rem;
|
|
191
|
+
cursor: pointer;
|
|
192
|
+
transition:
|
|
193
|
+
background-color 0.15s ease-in-out,
|
|
194
|
+
color 0.15s ease-in-out;
|
|
195
|
+
display: flex;
|
|
196
|
+
align-items: center;
|
|
197
|
+
justify-content: space-between;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.option:hover {
|
|
201
|
+
background-color: #f9fafb;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.optionHighlighted {
|
|
205
|
+
background-color: #eff6ff;
|
|
206
|
+
color: #1d4ed8;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.optionSelected {
|
|
210
|
+
background-color: #dbeafe;
|
|
211
|
+
color: #1e40af;
|
|
212
|
+
font-weight: 500;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.optionDisabled {
|
|
216
|
+
opacity: 0.5;
|
|
217
|
+
cursor: not-allowed;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.optionLabel {
|
|
221
|
+
overflow: hidden;
|
|
222
|
+
text-overflow: ellipsis;
|
|
223
|
+
white-space: nowrap;
|
|
224
|
+
display: block;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.checkIcon {
|
|
228
|
+
width: 1rem;
|
|
229
|
+
height: 1rem;
|
|
230
|
+
color: #2563eb;
|
|
231
|
+
flex-shrink: 0;
|
|
232
|
+
margin-left: 0.5rem;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.widthFull {
|
|
236
|
+
width: 100%;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.width64 {
|
|
240
|
+
width: 16rem;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.width80 {
|
|
244
|
+
width: 20rem;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.width96 {
|
|
248
|
+
width: 24rem;
|
|
249
|
+
}
|