@tsiky/components-r19 1.1.0 → 1.3.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.
Files changed (50) hide show
  1. package/package.json +1 -1
  2. package/src/components/AnnouncementPanel/FlexRowContainer.css +17 -17
  3. package/src/components/AnnouncementPanel/FlexRowContainer.stories.tsx +329 -329
  4. package/src/components/AnnouncementPanel/FlexRowContainer.tsx +24 -24
  5. package/src/components/AnnouncementPanel/ListBox/CounterListBox.css +56 -56
  6. package/src/components/AnnouncementPanel/ListBox/CounterListBox.stories.tsx +292 -292
  7. package/src/components/AnnouncementPanel/ListBox/CounterListBox.tsx +106 -106
  8. package/src/components/AnnouncementPanel/ListBox/SimpleListBox.css +57 -57
  9. package/src/components/AnnouncementPanel/ListBox/SimpleListBox.stories.tsx +189 -189
  10. package/src/components/AnnouncementPanel/ListBox/SimpleListBox.tsx +138 -138
  11. package/src/components/AnnouncementPanel/ListBox/TrendListBox.css +61 -61
  12. package/src/components/AnnouncementPanel/ListBox/TrendListBox.stories.tsx +257 -257
  13. package/src/components/AnnouncementPanel/ListBox/TrendListBox.tsx +90 -90
  14. package/src/components/AnnouncementPanel/ListBox/index.ts +3 -3
  15. package/src/components/AnnouncementPanel/ListContentContainer.css +23 -23
  16. package/src/components/AnnouncementPanel/ListContentContainer.stories.tsx +212 -212
  17. package/src/components/AnnouncementPanel/ListContentContainer.tsx +33 -33
  18. package/src/components/AnnouncementPanel/index.ts +3 -3
  19. package/src/components/Charts/area-chart-admission/AreaChartAdmission.tsx +7 -1
  20. package/src/components/Charts/bar-chart/BarChart.tsx +6 -2
  21. package/src/components/Charts/boxplot-chart/BoxPlotChart.tsx +114 -114
  22. package/src/components/Charts/mixed-chart/MixedChart.tsx +1 -1
  23. package/src/components/Charts/sankey-adaptation/sankey.tsx +70 -70
  24. package/src/components/DraggableSwitcher/DraggableSwitcherButton.tsx +58 -58
  25. package/src/components/DraggableSwitcher/context/useDraggableSwitcher.tsx +45 -45
  26. package/src/components/DraggableSwitcher/index.ts +2 -2
  27. package/src/components/DynamicInput/DynamicInput.module.css +125 -126
  28. package/src/components/DynamicInput/input/SelectInput.tsx +75 -75
  29. package/src/components/DynamicInput/input/assets/SelectInput.module.css +95 -95
  30. package/src/components/DynamicTable/AdvancedFilters.tsx +196 -196
  31. package/src/components/DynamicTable/ColumnSorter.tsx +185 -185
  32. package/src/components/DynamicTable/Pagination.tsx +115 -115
  33. package/src/components/DynamicTable/TableCell.tsx +38 -30
  34. package/src/components/DynamicTable/TableHeader.tsx +39 -34
  35. package/src/components/DynamicTable/TableauDynamique.module.css +77 -70
  36. package/src/components/DynamicTable/TableauDynamique.tsx +154 -154
  37. package/src/components/DynamicTable/filters/SelectFilter.tsx +69 -69
  38. package/src/components/DynamicTable/tools/tableTypes.ts +63 -63
  39. package/src/components/EntryControl/EntryControl.tsx +117 -117
  40. package/src/components/Grid/grid.css +285 -285
  41. package/src/components/MetricsPanel/MetricsPanel.tsx +37 -37
  42. package/src/components/MetricsPanel/renderers/CompactRenderer.tsx +1 -1
  43. package/src/components/NavItem/NavItem.tsx +58 -58
  44. package/src/components/PeriodRange/PeriodRange.module.css +158 -158
  45. package/src/components/PeriodRange/PeriodRange.tsx +130 -130
  46. package/src/components/PeriodSelect/PeriodSelect.module.css +64 -65
  47. package/src/components/PeriodSelect/PeriodSelect.tsx +48 -42
  48. package/src/components/SearchBar/SearchBar.css +40 -40
  49. package/src/components/TranslationKey/TranslationKey.css +272 -272
  50. package/src/components/TranslationKey/TranslationKey.tsx +8 -7
@@ -1,117 +1,117 @@
1
- 'use client';
2
- import React, { useEffect, useRef, useState } from 'react';
3
- import styles from './EntryControl.module.css';
4
-
5
- export interface EntryControlProps {
6
- onDateChange?: (isoString: string) => void;
7
- onSearch?: (query: string) => void;
8
- initialDate?: string;
9
- }
10
-
11
- export default function EntryControl({ onDateChange, onSearch, initialDate }: EntryControlProps) {
12
- const [showPicker, setShowPicker] = useState<boolean>(false);
13
- const [datetime, setDatetime] = useState<string>(initialDate ?? '');
14
- const containerRef = useRef<HTMLDivElement | null>(null);
15
-
16
- useEffect(() => {
17
- function handleClickOutside(e: MouseEvent) {
18
- const target = e.target as Node | null;
19
- if (containerRef.current && target && !containerRef.current.contains(target)) {
20
- setShowPicker(false);
21
- }
22
- }
23
-
24
- document.addEventListener('mousedown', handleClickOutside);
25
- return () => document.removeEventListener('mousedown', handleClickOutside);
26
- }, []);
27
-
28
- useEffect(() => {
29
- if (initialDate) setDatetime(initialDate);
30
- }, [initialDate]);
31
-
32
- const handleToggle = () => setShowPicker((v) => !v);
33
-
34
- const handleDateChange = (e: React.ChangeEvent<HTMLInputElement>) => {
35
- const v = e.target.value;
36
- setDatetime(v);
37
- onDateChange?.(v);
38
- };
39
-
40
- const handleSearch = (e: React.ChangeEvent<HTMLInputElement>) => {
41
- onSearch?.(e.target.value);
42
- };
43
-
44
- return (
45
- <div className={styles.wrapper} ref={containerRef}>
46
- <div className={styles.leftGroup}>
47
- <button
48
- type='button'
49
- className={`${styles.filterButton} ${showPicker ? styles.open : ''}`}
50
- onClick={handleToggle}
51
- aria-expanded={showPicker}
52
- aria-haspopup='dialog'
53
- aria-controls='entry-datetime'
54
- >
55
- <span>Entry time</span>
56
- <svg
57
- className={styles.filterIcon}
58
- xmlns='http://www.w3.org/2000/svg'
59
- viewBox='0 0 24 24'
60
- width='14'
61
- height='14'
62
- aria-hidden
63
- >
64
- <path fill='currentColor' d='M10 18h4v-2h-4v2zm-7-8v2h18V10H3zm3-6v2h12V4H6z' />
65
- </svg>
66
- </button>
67
-
68
- <div className={styles.infoText}>Confidence interval: step ± 15' / exit ± 30'</div>
69
-
70
- {/* pickerContainer est maintenant inline sur grands écrans, absolute sur petits */}
71
- {showPicker && (
72
- <div
73
- className={styles.pickerContainer}
74
- role='dialog'
75
- aria-label='Choisir la date et l’heure'
76
- >
77
- <label className={styles.pickerLabel} htmlFor='entry-datetime'>
78
- <span className={styles.srOnly}>Choisir la date et l’heure</span>
79
- </label>
80
- <input
81
- id='entry-datetime'
82
- className={styles.datetime}
83
- type='datetime-local'
84
- value={datetime}
85
- onChange={handleDateChange}
86
- aria-label='Date et heure d’entrée'
87
- />
88
- </div>
89
- )}
90
- </div>
91
-
92
- <div className={styles.rightGroup}>
93
- <div className={styles.searchInputWrap}>
94
- <input
95
- className={styles.searchInput}
96
- placeholder='Search...'
97
- onChange={handleSearch}
98
- aria-label='Search'
99
- />
100
- <svg
101
- className={styles.searchIcon}
102
- xmlns='http://www.w3.org/2000/svg'
103
- viewBox='0 0 24 24'
104
- width='16'
105
- height='16'
106
- aria-hidden
107
- >
108
- <path
109
- fill='currentColor'
110
- d='M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16a6.471 6.471 0 004.23-1.57l.27.28v.79L20 20.49 21.49 19l-5.99-5zM10 15.5A5.5 5.5 0 1115.5 10 5.5 5.5 0 0110 15.5z'
111
- />
112
- </svg>
113
- </div>
114
- </div>
115
- </div>
116
- );
117
- }
1
+ 'use client';
2
+ import React, { useEffect, useRef, useState } from 'react';
3
+ import styles from './EntryControl.module.css';
4
+
5
+ export interface EntryControlProps {
6
+ onDateChange?: (isoString: string) => void;
7
+ onSearch?: (query: string) => void;
8
+ initialDate?: string;
9
+ }
10
+
11
+ export default function EntryControl({ onDateChange, onSearch, initialDate }: EntryControlProps) {
12
+ const [showPicker, setShowPicker] = useState<boolean>(false);
13
+ const [datetime, setDatetime] = useState<string>(initialDate ?? '');
14
+ const containerRef = useRef<HTMLDivElement | null>(null);
15
+
16
+ useEffect(() => {
17
+ function handleClickOutside(e: MouseEvent) {
18
+ const target = e.target as Node | null;
19
+ if (containerRef.current && target && !containerRef.current.contains(target)) {
20
+ setShowPicker(false);
21
+ }
22
+ }
23
+
24
+ document.addEventListener('mousedown', handleClickOutside);
25
+ return () => document.removeEventListener('mousedown', handleClickOutside);
26
+ }, []);
27
+
28
+ useEffect(() => {
29
+ if (initialDate) setDatetime(initialDate);
30
+ }, [initialDate]);
31
+
32
+ const handleToggle = () => setShowPicker((v) => !v);
33
+
34
+ const handleDateChange = (e: React.ChangeEvent<HTMLInputElement>) => {
35
+ const v = e.target.value;
36
+ setDatetime(v);
37
+ onDateChange?.(v);
38
+ };
39
+
40
+ const handleSearch = (e: React.ChangeEvent<HTMLInputElement>) => {
41
+ onSearch?.(e.target.value);
42
+ };
43
+
44
+ return (
45
+ <div className={styles.wrapper} ref={containerRef}>
46
+ <div className={styles.leftGroup}>
47
+ <button
48
+ type='button'
49
+ className={`${styles.filterButton} ${showPicker ? styles.open : ''}`}
50
+ onClick={handleToggle}
51
+ aria-expanded={showPicker}
52
+ aria-haspopup='dialog'
53
+ aria-controls='entry-datetime'
54
+ >
55
+ <span>Entry time</span>
56
+ <svg
57
+ className={styles.filterIcon}
58
+ xmlns='http://www.w3.org/2000/svg'
59
+ viewBox='0 0 24 24'
60
+ width='14'
61
+ height='14'
62
+ aria-hidden
63
+ >
64
+ <path fill='currentColor' d='M10 18h4v-2h-4v2zm-7-8v2h18V10H3zm3-6v2h12V4H6z' />
65
+ </svg>
66
+ </button>
67
+
68
+ <div className={styles.infoText}>Confidence interval: step ± 15' / exit ± 30'</div>
69
+
70
+ {/* pickerContainer est maintenant inline sur grands écrans, absolute sur petits */}
71
+ {showPicker && (
72
+ <div
73
+ className={styles.pickerContainer}
74
+ role='dialog'
75
+ aria-label='Choisir la date et l’heure'
76
+ >
77
+ <label className={styles.pickerLabel} htmlFor='entry-datetime'>
78
+ <span className={styles.srOnly}>Choisir la date et l’heure</span>
79
+ </label>
80
+ <input
81
+ id='entry-datetime'
82
+ className={styles.datetime}
83
+ type='datetime-local'
84
+ value={datetime}
85
+ onChange={handleDateChange}
86
+ aria-label='Date et heure d’entrée'
87
+ />
88
+ </div>
89
+ )}
90
+ </div>
91
+
92
+ <div className={styles.rightGroup}>
93
+ <div className={styles.searchInputWrap}>
94
+ <input
95
+ className={styles.searchInput}
96
+ placeholder='Search...'
97
+ onChange={handleSearch}
98
+ aria-label='Search'
99
+ />
100
+ <svg
101
+ className={styles.searchIcon}
102
+ xmlns='http://www.w3.org/2000/svg'
103
+ viewBox='0 0 24 24'
104
+ width='16'
105
+ height='16'
106
+ aria-hidden
107
+ >
108
+ <path
109
+ fill='currentColor'
110
+ d='M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16a6.471 6.471 0 004.23-1.57l.27.28v.79L20 20.49 21.49 19l-5.99-5zM10 15.5A5.5 5.5 0 1115.5 10 5.5 5.5 0 0110 15.5z'
111
+ />
112
+ </svg>
113
+ </div>
114
+ </div>
115
+ </div>
116
+ );
117
+ }