@tsiky/components-r19 1.0.0 → 1.2.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/AnnouncementPanel/FlexRowContainer.css +17 -17
- package/src/components/AnnouncementPanel/FlexRowContainer.stories.tsx +329 -329
- package/src/components/AnnouncementPanel/FlexRowContainer.tsx +24 -24
- package/src/components/AnnouncementPanel/ListBox/CounterListBox.css +56 -56
- package/src/components/AnnouncementPanel/ListBox/CounterListBox.stories.tsx +292 -292
- package/src/components/AnnouncementPanel/ListBox/CounterListBox.tsx +106 -106
- package/src/components/AnnouncementPanel/ListBox/SimpleListBox.css +57 -57
- package/src/components/AnnouncementPanel/ListBox/SimpleListBox.stories.tsx +189 -189
- package/src/components/AnnouncementPanel/ListBox/SimpleListBox.tsx +138 -138
- package/src/components/AnnouncementPanel/ListBox/TrendListBox.css +61 -61
- package/src/components/AnnouncementPanel/ListBox/TrendListBox.stories.tsx +257 -257
- package/src/components/AnnouncementPanel/ListBox/TrendListBox.tsx +90 -90
- package/src/components/AnnouncementPanel/ListBox/index.ts +3 -3
- package/src/components/AnnouncementPanel/ListContentContainer.css +23 -23
- package/src/components/AnnouncementPanel/ListContentContainer.stories.tsx +212 -212
- package/src/components/AnnouncementPanel/ListContentContainer.tsx +33 -33
- package/src/components/AnnouncementPanel/index.ts +3 -3
- package/src/components/Charts/area-chart-admission/AreaChartAdmission.tsx +129 -89
- package/src/components/Charts/bar-chart/BarChart.tsx +171 -132
- package/src/components/Charts/boxplot-chart/BoxPlotChart.tsx +114 -114
- package/src/components/Charts/mixed-chart/MixedChart.tsx +65 -9
- package/src/components/Charts/sankey-adaptation/sankey.tsx +70 -70
- 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/DraggableSwitcher/DraggableSwitcherButton.tsx +58 -58
- package/src/components/DraggableSwitcher/context/useDraggableSwitcher.tsx +45 -45
- package/src/components/DraggableSwitcher/index.ts +2 -2
- package/src/components/DynamicInput/input/SelectInput.tsx +75 -75
- package/src/components/DynamicInput/input/assets/SelectInput.module.css +95 -95
- package/src/components/DynamicTable/TableCell.tsx +38 -30
- package/src/components/DynamicTable/TableHeader.tsx +39 -34
- package/src/components/DynamicTable/TableauDynamique.module.css +1333 -1287
- package/src/components/DynamicTable/TableauDynamique.tsx +154 -154
- package/src/components/DynamicTable/tools/tableTypes.ts +63 -63
- package/src/components/Grid/Grid.tsx +5 -0
- package/src/components/Grid/grid.css +285 -285
- 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/NavItem/NavItem.tsx +58 -58
- package/src/components/PeriodRange/PeriodRange.module.css +158 -158
- package/src/components/PeriodRange/PeriodRange.tsx +130 -130
- package/src/components/SearchBar/SearchBar.css +40 -40
- 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.css +272 -272
- package/src/components/TranslationKey/TranslationKey.tsx +266 -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(16px, 1.6vw, 20px)',
|
|
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
|
|
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import './NavItem.css';
|
|
3
|
-
import { useNavigation } from '../NavBar';
|
|
4
|
-
|
|
5
|
-
export type NavItemType = {
|
|
6
|
-
id: string;
|
|
7
|
-
label: string;
|
|
8
|
-
isActive?: boolean;
|
|
9
|
-
onClick?: (id: string) => void;
|
|
10
|
-
href?: string;
|
|
11
|
-
highlightColor?: string;
|
|
12
|
-
moduleKey?: string;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export const NavItem: React.FC<NavItemType> = ({
|
|
16
|
-
id,
|
|
17
|
-
label,
|
|
18
|
-
isActive = false,
|
|
19
|
-
onClick,
|
|
20
|
-
href,
|
|
21
|
-
highlightColor = '#008CBA',
|
|
22
|
-
moduleKey = '',
|
|
23
|
-
...props
|
|
24
|
-
}) => {
|
|
25
|
-
// Determine which element to render
|
|
26
|
-
const { setActiveNav } = useNavigation();
|
|
27
|
-
const handleClick = () => {
|
|
28
|
-
setActiveNav(id); // ✅ met à jour la nav active
|
|
29
|
-
onClick?.(id); // ✅ appelle le callback externe si défini
|
|
30
|
-
};
|
|
31
|
-
if (href) {
|
|
32
|
-
// Render as anchor tag if href is provided and no onClick handler
|
|
33
|
-
return (
|
|
34
|
-
<a
|
|
35
|
-
href={href}
|
|
36
|
-
className={`nav-item ${isActive ? 'active' : ''}`}
|
|
37
|
-
style={isActive ? { backgroundColor: highlightColor, color: '#fff' } : {}}
|
|
38
|
-
onClick={handleClick}
|
|
39
|
-
{...props}
|
|
40
|
-
>
|
|
41
|
-
{label}
|
|
42
|
-
</a>
|
|
43
|
-
);
|
|
44
|
-
} else {
|
|
45
|
-
return (
|
|
46
|
-
<div
|
|
47
|
-
className={`nav-item ${isActive ? 'active' : ''}`}
|
|
48
|
-
style={isActive ? { backgroundColor: highlightColor, color: '#fff' } : {}}
|
|
49
|
-
onClick={handleClick}
|
|
50
|
-
role={onClick ? 'button' : 'presentation'}
|
|
51
|
-
tabIndex={onClick ? 0 : -1}
|
|
52
|
-
{...props}
|
|
53
|
-
>
|
|
54
|
-
{label}
|
|
55
|
-
</div>
|
|
56
|
-
);
|
|
57
|
-
}
|
|
58
|
-
};
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './NavItem.css';
|
|
3
|
+
import { useNavigation } from '../NavBar';
|
|
4
|
+
|
|
5
|
+
export type NavItemType = {
|
|
6
|
+
id: string;
|
|
7
|
+
label: string;
|
|
8
|
+
isActive?: boolean;
|
|
9
|
+
onClick?: (id: string) => void;
|
|
10
|
+
href?: string;
|
|
11
|
+
highlightColor?: string;
|
|
12
|
+
moduleKey?: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const NavItem: React.FC<NavItemType> = ({
|
|
16
|
+
id,
|
|
17
|
+
label,
|
|
18
|
+
isActive = false,
|
|
19
|
+
onClick,
|
|
20
|
+
href,
|
|
21
|
+
highlightColor = '#008CBA',
|
|
22
|
+
moduleKey = '',
|
|
23
|
+
...props
|
|
24
|
+
}) => {
|
|
25
|
+
// Determine which element to render
|
|
26
|
+
const { setActiveNav } = useNavigation();
|
|
27
|
+
const handleClick = () => {
|
|
28
|
+
setActiveNav(id); // ✅ met à jour la nav active
|
|
29
|
+
onClick?.(id); // ✅ appelle le callback externe si défini
|
|
30
|
+
};
|
|
31
|
+
if (href) {
|
|
32
|
+
// Render as anchor tag if href is provided and no onClick handler
|
|
33
|
+
return (
|
|
34
|
+
<a
|
|
35
|
+
href={href}
|
|
36
|
+
className={`nav-item ${isActive ? 'active' : ''}`}
|
|
37
|
+
style={isActive ? { backgroundColor: highlightColor, color: '#fff' } : {}}
|
|
38
|
+
onClick={handleClick}
|
|
39
|
+
{...props}
|
|
40
|
+
>
|
|
41
|
+
{label}
|
|
42
|
+
</a>
|
|
43
|
+
);
|
|
44
|
+
} else {
|
|
45
|
+
return (
|
|
46
|
+
<div
|
|
47
|
+
className={`nav-item ${isActive ? 'active' : ''}`}
|
|
48
|
+
style={isActive ? { backgroundColor: highlightColor, color: '#fff' } : {}}
|
|
49
|
+
onClick={handleClick}
|
|
50
|
+
role={onClick ? 'button' : 'presentation'}
|
|
51
|
+
tabIndex={onClick ? 0 : -1}
|
|
52
|
+
{...props}
|
|
53
|
+
>
|
|
54
|
+
{label}
|
|
55
|
+
</div>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
};
|