@tsiky/components-r19 1.0.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/.prettierignore +4 -0
- package/.prettierrc +9 -0
- package/.storybook/main.ts +17 -0
- package/.storybook/preview.ts +21 -0
- package/.storybook/vitest.setup.ts +7 -0
- package/README.md +69 -0
- package/chart.ts +1 -0
- package/eslint.config.js +40 -0
- package/index.html +13 -0
- package/index.ts +33 -0
- package/package.json +63 -0
- package/public/vite.svg +1 -0
- package/src/App.css +42 -0
- package/src/App.tsx +12 -0
- package/src/assets/accessibility.png +0 -0
- package/src/assets/accessibility.svg +1 -0
- package/src/assets/addon-library.png +0 -0
- package/src/assets/assets.png +0 -0
- package/src/assets/avif-test-image.avif +0 -0
- package/src/assets/context.png +0 -0
- package/src/assets/discord.svg +1 -0
- package/src/assets/docs.png +0 -0
- package/src/assets/figma-plugin.png +0 -0
- package/src/assets/github.svg +1 -0
- package/src/assets/react.svg +1 -0
- package/src/assets/share.png +0 -0
- package/src/assets/styling.png +0 -0
- package/src/assets/testing.png +0 -0
- package/src/assets/theming.png +0 -0
- package/src/assets/tutorials.svg +1 -0
- package/src/assets/youtube.svg +1 -0
- package/src/components/AddItemModal/AddItemModal.module.css +72 -0
- package/src/components/AddItemModal/AddItemModal.tsx +82 -0
- package/src/components/AddItemModal/index.ts +1 -0
- package/src/components/Alert/Alert.css +54 -0
- package/src/components/Alert/Alert.stories.tsx +82 -0
- package/src/components/Alert/Alert.tsx +85 -0
- package/src/components/Alert/AlertContext.tsx +200 -0
- package/src/components/Alert/AlertModels.ts +34 -0
- package/src/components/Alert/index.ts +3 -0
- package/src/components/AnnouncementPanel/FlexRowContainer.css +17 -0
- package/src/components/AnnouncementPanel/FlexRowContainer.stories.tsx +329 -0
- package/src/components/AnnouncementPanel/FlexRowContainer.tsx +24 -0
- package/src/components/AnnouncementPanel/ListBox/CounterListBox.css +56 -0
- package/src/components/AnnouncementPanel/ListBox/CounterListBox.stories.tsx +292 -0
- package/src/components/AnnouncementPanel/ListBox/CounterListBox.tsx +106 -0
- package/src/components/AnnouncementPanel/ListBox/SimpleListBox.css +57 -0
- package/src/components/AnnouncementPanel/ListBox/SimpleListBox.stories.tsx +189 -0
- package/src/components/AnnouncementPanel/ListBox/SimpleListBox.tsx +138 -0
- package/src/components/AnnouncementPanel/ListBox/TrendListBox.css +61 -0
- package/src/components/AnnouncementPanel/ListBox/TrendListBox.stories.tsx +257 -0
- package/src/components/AnnouncementPanel/ListBox/TrendListBox.tsx +90 -0
- package/src/components/AnnouncementPanel/ListBox/index.ts +3 -0
- package/src/components/AnnouncementPanel/ListContentContainer.css +23 -0
- package/src/components/AnnouncementPanel/ListContentContainer.stories.tsx +212 -0
- package/src/components/AnnouncementPanel/ListContentContainer.tsx +33 -0
- package/src/components/AnnouncementPanel/index.ts +3 -0
- package/src/components/BandChart/index.tsx +282 -0
- package/src/components/Button/Button.module.css +165 -0
- package/src/components/Button/Button.stories.ts +132 -0
- package/src/components/Button/Button.tsx +55 -0
- package/src/components/Button/button.css +29 -0
- package/src/components/Button/index.ts +2 -0
- package/src/components/ChartContainer/ChartContainer.css +116 -0
- package/src/components/ChartContainer/ChartContainer.stories.tsx +159 -0
- package/src/components/ChartContainer/ChartContainer.tsx +155 -0
- package/src/components/ChartContainer/index.ts +1 -0
- package/src/components/Charts/area-chart-admission/AreaChartAdmission.stories.tsx +65 -0
- package/src/components/Charts/area-chart-admission/AreaChartAdmission.tsx +89 -0
- package/src/components/Charts/area-chart-admission/content.json +48 -0
- package/src/components/Charts/area-chart-hospitalisation/AreaChartHospitalisation.stories.tsx +141 -0
- package/src/components/Charts/area-chart-hospitalisation/AreaChartHospitalisation.tsx +262 -0
- package/src/components/Charts/area-chart-hospitalisation/content.json +55 -0
- package/src/components/Charts/bar-chart/BarChart.stories.tsx +50 -0
- package/src/components/Charts/bar-chart/BarChart.tsx +132 -0
- package/src/components/Charts/bar-chart/content.json +15 -0
- package/src/components/Charts/boxplot-chart/BoxPlotChart.stories.tsx +63 -0
- package/src/components/Charts/boxplot-chart/BoxPlotChart.tsx +114 -0
- package/src/components/Charts/boxplot-chart/boxUtils.ts +22 -0
- package/src/components/Charts/boxplot-chart/content.json +11 -0
- package/src/components/Charts/mixed-chart/MixedChart.stories.tsx +83 -0
- package/src/components/Charts/mixed-chart/MixedChart.tsx +625 -0
- package/src/components/Charts/mixed-chart/content.json +34 -0
- package/src/components/Charts/sankey-adaptation/sankey.tsx +70 -0
- package/src/components/Charts/sankey-chart/SankeyChart.stories.tsx +69 -0
- package/src/components/Charts/sankey-chart/SankeyChart.tsx +155 -0
- package/src/components/Charts/sankey-chart/content.json +15 -0
- package/src/components/Charts/stacked-column/StackedColumn.stories.tsx +72 -0
- package/src/components/Charts/stacked-column/StackedColumn.tsx +406 -0
- package/src/components/Charts/stacked-column/content.json +37 -0
- package/src/components/Charts/stacked-column-one-hundred-percent/StackedColumnOneHundredPercent.stories.tsx +43 -0
- package/src/components/Charts/stacked-column-one-hundred-percent/StackedColumnOneHundredPercent.tsx +75 -0
- package/src/components/Charts/stacked-column-one-hundred-percent/content.json +6 -0
- package/src/components/CircularProgress/CircularProgress.css +79 -0
- package/src/components/CircularProgress/CircularProgress.stories.tsx +251 -0
- package/src/components/CircularProgress/CircularProgress.tsx +101 -0
- package/src/components/CircularProgress/index.ts +2 -0
- package/src/components/Configure.mdx +369 -0
- package/src/components/DayStatCard/DayStatCard.css +50 -0
- package/src/components/DayStatCard/DayStatCard.stories.tsx +273 -0
- package/src/components/DayStatCard/DayStatCard.tsx +69 -0
- package/src/components/DayStatCard/index.ts +2 -0
- package/src/components/DraggableSwitcher/DraggableSwitcherButton.tsx +58 -0
- package/src/components/DraggableSwitcher/context/useDraggableSwitcher.tsx +45 -0
- package/src/components/DraggableSwitcher/index.ts +2 -0
- package/src/components/DropdownMenu/DropdownMenu.css +100 -0
- package/src/components/DropdownMenu/DropdownMenu.stories.tsx +174 -0
- package/src/components/DropdownMenu/DropdownMenu.tsx +106 -0
- package/src/components/DropdownMenu/index.ts +1 -0
- package/src/components/DynamicForm/DynamicFom.stories.ts +773 -0
- package/src/components/DynamicForm/DynamicForm.module.css +468 -0
- package/src/components/DynamicForm/DynamicForm.tsx +224 -0
- package/src/components/DynamicForm/index.ts +3 -0
- package/src/components/DynamicForm/tools/form-metadata.ts +82 -0
- package/src/components/DynamicForm/tools/validation.ts +168 -0
- package/src/components/DynamicInput/DynamicInput.module.css +126 -0
- package/src/components/DynamicInput/DynamicInput.stories.ts +350 -0
- package/src/components/DynamicInput/DynamicInput.tsx +144 -0
- package/src/components/DynamicInput/index.ts +2 -0
- package/src/components/DynamicInput/input/CheckboxInput.tsx +41 -0
- package/src/components/DynamicInput/input/ColorInput.tsx +46 -0
- package/src/components/DynamicInput/input/DateInput.tsx +57 -0
- package/src/components/DynamicInput/input/FileInput.tsx +174 -0
- package/src/components/DynamicInput/input/InputWrapper.tsx +26 -0
- package/src/components/DynamicInput/input/RadioInput.tsx +46 -0
- package/src/components/DynamicInput/input/RangeInput.tsx +46 -0
- package/src/components/DynamicInput/input/SelectInput.tsx +75 -0
- package/src/components/DynamicInput/input/TextInput.tsx +101 -0
- package/src/components/DynamicInput/input/TextareaInput.tsx +47 -0
- package/src/components/DynamicInput/input/assets/ColorInput.module.css +48 -0
- package/src/components/DynamicInput/input/assets/DateInput.module.css +83 -0
- package/src/components/DynamicInput/input/assets/FileInput.module.css +133 -0
- package/src/components/DynamicInput/input/assets/RangeInput.module.css +169 -0
- package/src/components/DynamicInput/input/assets/SelectInput.module.css +95 -0
- package/src/components/DynamicInput/input/index.ts +10 -0
- package/src/components/DynamicTable/AdvancedFilters.tsx +196 -0
- package/src/components/DynamicTable/ColumnSorter.tsx +185 -0
- package/src/components/DynamicTable/Pagination.tsx +115 -0
- package/src/components/DynamicTable/TableBody.tsx +42 -0
- package/src/components/DynamicTable/TableCell.tsx +30 -0
- package/src/components/DynamicTable/TableHeader.tsx +34 -0
- package/src/components/DynamicTable/TableRow.tsx +56 -0
- package/src/components/DynamicTable/TableauDynamic.stories.ts +1014 -0
- package/src/components/DynamicTable/TableauDynamique.module.css +1287 -0
- package/src/components/DynamicTable/TableauDynamique.tsx +154 -0
- package/src/components/DynamicTable/filters/BooleanFilter.tsx +30 -0
- package/src/components/DynamicTable/filters/DateFilter.tsx +28 -0
- package/src/components/DynamicTable/filters/DateRangeFilter.tsx +51 -0
- package/src/components/DynamicTable/filters/FilterRenderer.tsx +117 -0
- package/src/components/DynamicTable/filters/MultiSelectFilter.tsx +59 -0
- package/src/components/DynamicTable/filters/NumberFilter.tsx +37 -0
- package/src/components/DynamicTable/filters/OperatorFilter.tsx +64 -0
- package/src/components/DynamicTable/filters/SelectFilter.tsx +69 -0
- package/src/components/DynamicTable/filters/TextFilter.tsx +39 -0
- package/src/components/DynamicTable/filters/index.ts +9 -0
- package/src/components/DynamicTable/hooks/index.ts +2 -0
- package/src/components/DynamicTable/hooks/useAsyncActions.ts +36 -0
- package/src/components/DynamicTable/hooks/useFilters.ts +142 -0
- package/src/components/DynamicTable/hooks/useTableData.ts +216 -0
- package/src/components/DynamicTable/index.ts +11 -0
- package/src/components/DynamicTable/tools/filterTypes.ts +118 -0
- package/src/components/DynamicTable/tools/index.ts +3 -0
- package/src/components/DynamicTable/tools/tableConfig.ts +96 -0
- package/src/components/DynamicTable/tools/tableTypes.ts +63 -0
- package/src/components/EntryControl/EntryControl.module.css +218 -0
- package/src/components/EntryControl/EntryControl.stories.tsx +71 -0
- package/src/components/EntryControl/EntryControl.tsx +117 -0
- package/src/components/EntryControl/index.ts +2 -0
- package/src/components/Grid/Grid.stories.tsx +94 -0
- package/src/components/Grid/Grid.tsx +214 -0
- package/src/components/Grid/grid.css +285 -0
- package/src/components/Grid/index.ts +2 -0
- package/src/components/Header/Header.stories.tsx +164 -0
- package/src/components/Header/Header.tsx +59 -0
- package/src/components/Header/header.css +31 -0
- package/src/components/Header/index.ts +1 -0
- package/src/components/IconText/IconText..stories.tsx +135 -0
- package/src/components/IconText/IconText.css +43 -0
- package/src/components/IconText/IconText.tsx +43 -0
- package/src/components/IconText/index.ts +1 -0
- package/src/components/LanguageSelector/LanguageSelector.css +31 -0
- package/src/components/LanguageSelector/LanguageSelector.stories.tsx +38 -0
- package/src/components/LanguageSelector/LanguageSelector.tsx +37 -0
- package/src/components/LanguageSelector/index.ts +1 -0
- package/src/components/Logo/Logo.css +89 -0
- package/src/components/Logo/Logo.stories.tsx +79 -0
- package/src/components/Logo/Logo.tsx +22 -0
- package/src/components/Logo/index.ts +2 -0
- package/src/components/MetricsPanel/MetricsItem.tsx +128 -0
- package/src/components/MetricsPanel/MetricsPanel.module.css +636 -0
- package/src/components/MetricsPanel/MetricsPanel.stories.tsx +692 -0
- package/src/components/MetricsPanel/MetricsPanel.tsx +282 -0
- package/src/components/MetricsPanel/PanelHeader.tsx +19 -0
- package/src/components/MetricsPanel/SummaryCard.tsx +61 -0
- package/src/components/MetricsPanel/index.ts +4 -0
- package/src/components/MetricsPanel/renderers/CompactRenderer.tsx +125 -0
- package/src/components/MetricsPanel/renderers/ImageCard.tsx +62 -0
- package/src/components/MetricsPanel/renderers/PertinenceCard.tsx +55 -0
- package/src/components/MetricsPanel/tools/MetricsPanelTypes.ts +62 -0
- package/src/components/MetricsPanel/tools/chooseDefaultRender.ts +50 -0
- package/src/components/MetricsPanel/tools/colorUtils.ts +39 -0
- package/src/components/MetricsPanel/tools/index.ts +2 -0
- package/src/components/ModuleHeader/ModuleHeader.css +37 -0
- package/src/components/ModuleHeader/ModuleHeader.stories.tsx +37 -0
- package/src/components/ModuleHeader/ModuleHeader.tsx +42 -0
- package/src/components/ModuleHeader/index.ts +1 -0
- package/src/components/ModuleSideBar/ModuleSideBar.css +227 -0
- package/src/components/ModuleSideBar/ModuleSideBar.stories.tsx +40 -0
- package/src/components/ModuleSideBar/ModuleSideBar.tsx +155 -0
- package/src/components/ModuleSideBar/index.ts +1 -0
- package/src/components/NavBar/NavBar.css +58 -0
- package/src/components/NavBar/NavBar.stories.tsx +169 -0
- package/src/components/NavBar/NavBar.tsx +100 -0
- package/src/components/NavBar/NavContext.tsx +30 -0
- package/src/components/NavBar/index.ts +2 -0
- package/src/components/NavItem/NavItem.css +29 -0
- package/src/components/NavItem/NavItem.tsx +58 -0
- package/src/components/NavItem/index.ts +1 -0
- package/src/components/Page/Dashboard.tsx +93 -0
- package/src/components/Page/Page.stories.ts +33 -0
- package/src/components/Page/Page.tsx +73 -0
- package/src/components/Page/page.css +81 -0
- package/src/components/PerformanceCard/PerformanceCard.module.css +232 -0
- package/src/components/PerformanceCard/PerformanceCard.stories.tsx +441 -0
- package/src/components/PerformanceCard/PerformanceCard.tsx +198 -0
- package/src/components/PerformanceCard/defaultHistogramRenderer.tsx +32 -0
- package/src/components/PerformanceCard/tools/types.ts +50 -0
- package/src/components/PerformanceCard/tools/usePerformanceCard.ts +93 -0
- package/src/components/PeriodRange/PeriodRange.module.css +158 -0
- package/src/components/PeriodRange/PeriodRange.stories.tsx +66 -0
- package/src/components/PeriodRange/PeriodRange.tsx +130 -0
- package/src/components/PeriodSelect/PeriodSelect.module.css +65 -0
- package/src/components/PeriodSelect/PeriodSelect.stories.tsx +40 -0
- package/src/components/PeriodSelect/PeriodSelect.tsx +42 -0
- package/src/components/PeriodSelect/index.ts +1 -0
- package/src/components/ScrollableHorizontale/ScrollableHorizontale.css +40 -0
- package/src/components/ScrollableHorizontale/ScrollableHorizontale.stories.tsx +133 -0
- package/src/components/ScrollableHorizontale/ScrollableHorizontale.tsx +29 -0
- package/src/components/ScrollableHorizontale/index.ts +1 -0
- package/src/components/SearchBar/SearchBar.css +40 -0
- package/src/components/SearchBar/SearchBar.stories.tsx +36 -0
- package/src/components/SearchBar/SearchBar.tsx +30 -0
- package/src/components/SearchBar/index.ts +1 -0
- package/src/components/SectionTitle/SectionTitle.css +21 -0
- package/src/components/SectionTitle/SectionTitle.stories.tsx +39 -0
- package/src/components/SectionTitle/SectionTitle.tsx +18 -0
- package/src/components/SideComponent/PatientEditor.tsx +64 -0
- package/src/components/SideComponent/SideComponent.css +179 -0
- package/src/components/SideComponent/SideComponent.stories.tsx +547 -0
- package/src/components/SideComponent/SideComponent.tsx +243 -0
- package/src/components/SideComponent/hooks/useBodyScrollLock.ts +15 -0
- package/src/components/SideComponent/index.ts +2 -0
- package/src/components/SideComponent/portal.ts +11 -0
- package/src/components/SubNavBar/SubNavBar.tsx +41 -0
- package/src/components/SubNavBar/index.ts +1 -0
- package/src/components/Switcher/Switcher.css +65 -0
- package/src/components/Switcher/Switcher.stories.tsx +153 -0
- package/src/components/Switcher/Switcher.tsx +83 -0
- package/src/components/Switcher/index.ts +1 -0
- package/src/components/Title/Title.stories.tsx +18 -0
- package/src/components/Title/Title.tsx +26 -0
- package/src/components/Title/index.ts +1 -0
- package/src/components/TranslationKey/TranslationKey.css +272 -0
- package/src/components/TranslationKey/TranslationKey.stories.tsx +50 -0
- package/src/components/TranslationKey/TranslationKey.tsx +245 -0
- package/src/components/TranslationKey/index.ts +1 -0
- package/src/components/TrendItem/TrendItem.css +36 -0
- package/src/components/TrendItem/TrendItem.stories.tsx +276 -0
- package/src/components/TrendItem/TrendItem.tsx +46 -0
- package/src/components/TrendItem/index.ts +1 -0
- package/src/components/TrendList/TrendList.css +16 -0
- package/src/components/TrendList/TrendList.stories.tsx +337 -0
- package/src/components/TrendList/TrendList.tsx +45 -0
- package/src/components/TrendList/index.ts +1 -0
- package/src/components/theme/ThemeSwitcherButton.tsx +64 -0
- package/src/components/theme/context/ThemeContext.tsx +61 -0
- package/src/components/theme/context/index.ts +2 -0
- package/src/components/theme/context/useThemeSwitcher.ts +18 -0
- package/src/components/theme/index.ts +1 -0
- package/src/index.css +68 -0
- package/src/main.tsx +10 -0
- package/src/vite-env.d.ts +1 -0
- package/tsconfig.app.json +27 -0
- package/tsconfig.json +4 -0
- package/tsconfig.node.json +25 -0
- package/vite.config.ts +43 -0
- package/vitest.shims.d.ts +1 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
.icon-text {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
gap: 0.5rem;
|
|
5
|
+
cursor: pointer;
|
|
6
|
+
user-select: none;
|
|
7
|
+
padding: 6px 12px;
|
|
8
|
+
transition:
|
|
9
|
+
color 0.25s ease,
|
|
10
|
+
transform 0.2s ease,
|
|
11
|
+
border-color 0.25s ease;
|
|
12
|
+
color: inherit;
|
|
13
|
+
border-bottom: 2px solid transparent;
|
|
14
|
+
text-decoration: none;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.icon-text span {
|
|
18
|
+
line-height: 1.4;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.icon-text svg {
|
|
22
|
+
flex-shrink: 0;
|
|
23
|
+
transition:
|
|
24
|
+
transform 0.2s ease,
|
|
25
|
+
color 0.25s ease;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.icon-text:hover {
|
|
29
|
+
color: var(--color-primary);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.icon-text:hover svg {
|
|
33
|
+
transform: scale(1.1);
|
|
34
|
+
color: inherit;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.icon-text:active {
|
|
38
|
+
transform: scale(0.96);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.icon-text-active {
|
|
42
|
+
border-bottom-color: currentColor;
|
|
43
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import * as Icons from 'lucide-react';
|
|
3
|
+
import type { LucideProps } from 'lucide-react';
|
|
4
|
+
import './IconText.css';
|
|
5
|
+
|
|
6
|
+
type IconTextProps = {
|
|
7
|
+
icon?: string;
|
|
8
|
+
text: string;
|
|
9
|
+
size?: number;
|
|
10
|
+
color?: string;
|
|
11
|
+
className?: string;
|
|
12
|
+
active?: boolean;
|
|
13
|
+
href?: string;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const IconText: React.FC<IconTextProps> = ({
|
|
17
|
+
icon,
|
|
18
|
+
text,
|
|
19
|
+
size = 16,
|
|
20
|
+
color = 'currentColor',
|
|
21
|
+
className = '',
|
|
22
|
+
active = false,
|
|
23
|
+
href,
|
|
24
|
+
}) => {
|
|
25
|
+
const LucideIcon = icon
|
|
26
|
+
? (Icons[icon as keyof typeof Icons] as React.ComponentType<LucideProps>)
|
|
27
|
+
: null;
|
|
28
|
+
|
|
29
|
+
const Tag = href ? 'a' : 'div';
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<Tag
|
|
33
|
+
className={`icon-text ${active ? 'icon-text-active' : ''} ${className}`}
|
|
34
|
+
style={{ color }}
|
|
35
|
+
role='text'
|
|
36
|
+
aria-label={text}
|
|
37
|
+
{...(href ? { href } : {})}
|
|
38
|
+
>
|
|
39
|
+
{LucideIcon && <LucideIcon size={size} aria-hidden='true' />}
|
|
40
|
+
<span>{text}</span>
|
|
41
|
+
</Tag>
|
|
42
|
+
);
|
|
43
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './IconText';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
.language-selector-container {
|
|
2
|
+
position: relative;
|
|
3
|
+
margin-bottom: 1rem; /* équivalent à mb-4 */
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.language-selector {
|
|
7
|
+
width: 100%;
|
|
8
|
+
padding: 0.75rem 2.5rem 0.75rem 1rem; /* px-4 py-3 pr-10 */
|
|
9
|
+
background-color: white;
|
|
10
|
+
border: 1px solid #e5e7eb; /* gray-200 */
|
|
11
|
+
border-radius: 0.5rem; /* rounded-lg */
|
|
12
|
+
outline: none;
|
|
13
|
+
appearance: none; /* supprime la flèche native */
|
|
14
|
+
transition: all 0.2s ease-in-out;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.language-selector:focus {
|
|
18
|
+
border-color: transparent;
|
|
19
|
+
box-shadow: 0 0 0 2px #10b981; /* emerald-500 ring */
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.language-selector-icon {
|
|
23
|
+
position: absolute;
|
|
24
|
+
right: 0.75rem; /* right-3 */
|
|
25
|
+
top: 50%;
|
|
26
|
+
transform: translateY(-50%);
|
|
27
|
+
width: 1rem; /* w-4 */
|
|
28
|
+
height: 1rem; /* h-4 */
|
|
29
|
+
color: #9ca3af; /* gray-400 */
|
|
30
|
+
pointer-events: none; /* pas cliquable */
|
|
31
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// LanguageSelector.stories.tsx
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
+
import { LanguageSelector } from './LanguageSelector';
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof LanguageSelector> = {
|
|
6
|
+
title: 'Components/LanguageSelector',
|
|
7
|
+
component: LanguageSelector,
|
|
8
|
+
tags: ['autodocs'], // permet à Storybook 7 de générer la doc automatiquement
|
|
9
|
+
args: {
|
|
10
|
+
languages: [
|
|
11
|
+
{ code: 'fr', name: 'Français' },
|
|
12
|
+
{ code: 'en', name: 'English' },
|
|
13
|
+
{ code: 'es', name: 'Español' },
|
|
14
|
+
],
|
|
15
|
+
placeholder: 'Sélectionnez une langue',
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
export default meta;
|
|
19
|
+
|
|
20
|
+
type Story = StoryObj<typeof LanguageSelector>;
|
|
21
|
+
|
|
22
|
+
export const Default: Story = {
|
|
23
|
+
args: {
|
|
24
|
+
selectedLanguage: '',
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const WithSelectedLanguage: Story = {
|
|
29
|
+
args: {
|
|
30
|
+
selectedLanguage: 'en',
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export const CustomPlaceholder: Story = {
|
|
35
|
+
args: {
|
|
36
|
+
placeholder: 'Choisissez votre langue',
|
|
37
|
+
},
|
|
38
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ChevronDown } from 'lucide-react';
|
|
3
|
+
import './LanguageSelector.css';
|
|
4
|
+
|
|
5
|
+
interface LanguageSelectorProps {
|
|
6
|
+
languages: { code: string; name: string }[];
|
|
7
|
+
selectedLanguage?: string;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
onChange?: (language: string) => void;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const LanguageSelector: React.FC<LanguageSelectorProps> = ({
|
|
13
|
+
languages,
|
|
14
|
+
selectedLanguage,
|
|
15
|
+
placeholder = 'Sélectionnez la langue',
|
|
16
|
+
onChange,
|
|
17
|
+
}) => {
|
|
18
|
+
return (
|
|
19
|
+
<div className='language-selector-container'>
|
|
20
|
+
<select
|
|
21
|
+
value={selectedLanguage || ''}
|
|
22
|
+
onChange={(e) => onChange?.(e.target.value)}
|
|
23
|
+
className='language-selector'
|
|
24
|
+
>
|
|
25
|
+
<option value='' disabled>
|
|
26
|
+
{placeholder}
|
|
27
|
+
</option>
|
|
28
|
+
{languages.map((lang) => (
|
|
29
|
+
<option key={lang.code} value={lang.code}>
|
|
30
|
+
{lang.name}
|
|
31
|
+
</option>
|
|
32
|
+
))}
|
|
33
|
+
</select>
|
|
34
|
+
<ChevronDown className='language-selector-icon' />
|
|
35
|
+
</div>
|
|
36
|
+
);
|
|
37
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './LanguageSelector';
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
.logo {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
margin-right: 6px;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.logo-image {
|
|
9
|
+
height: auto;
|
|
10
|
+
object-fit: contain;
|
|
11
|
+
display: block;
|
|
12
|
+
transition: max-width 0.3s ease;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.logo--small .logo-image {
|
|
16
|
+
max-width: 100px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.logo--medium .logo-image {
|
|
20
|
+
max-width: 140px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.logo--large .logo-image {
|
|
24
|
+
max-width: 180px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.logo--xlarge .logo-image {
|
|
28
|
+
max-width: 220px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.logo--auto .logo-image {
|
|
32
|
+
max-width: 100%;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.logo--responsive .logo-image {
|
|
36
|
+
max-width: 140px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@media (max-width: 1024px) {
|
|
40
|
+
.logo--responsive .logo-image {
|
|
41
|
+
max-width: 120px;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@media (max-width: 768px) {
|
|
46
|
+
.logo--responsive .logo-image {
|
|
47
|
+
max-width: 100px;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@media (max-width: 480px) {
|
|
52
|
+
.logo--responsive .logo-image {
|
|
53
|
+
max-width: 80px;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
@media (max-width: 320px) {
|
|
58
|
+
.logo--responsive .logo-image {
|
|
59
|
+
max-width: 70px;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
|
|
64
|
+
.logo-image {
|
|
65
|
+
transform: translateZ(0);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
@media (max-height: 480px) and (orientation: landscape) {
|
|
70
|
+
.logo--responsive .logo-image {
|
|
71
|
+
max-width: 70px;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.logo .tagline {
|
|
76
|
+
margin-left: 8px;
|
|
77
|
+
color: #666;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
@media print {
|
|
81
|
+
.logo {
|
|
82
|
+
margin-right: 4px;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.logo-image {
|
|
86
|
+
max-width: 100px;
|
|
87
|
+
filter: contrast(1.2);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Logo } from './Logo';
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'Components/Logo',
|
|
6
|
+
component: Logo,
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: 'centered',
|
|
9
|
+
},
|
|
10
|
+
tags: ['autodocs'],
|
|
11
|
+
argTypes: {
|
|
12
|
+
className: {
|
|
13
|
+
control: 'text',
|
|
14
|
+
description: 'Additional CSS classes',
|
|
15
|
+
table: {
|
|
16
|
+
category: 'Styling',
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
imagePath: {
|
|
20
|
+
control: 'text',
|
|
21
|
+
description: 'Path to the logo image',
|
|
22
|
+
table: {
|
|
23
|
+
category: 'Content',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
} satisfies Meta<typeof Logo>;
|
|
28
|
+
|
|
29
|
+
export default meta;
|
|
30
|
+
type Story = StoryObj<typeof meta>;
|
|
31
|
+
|
|
32
|
+
export const Default: Story = {
|
|
33
|
+
args: {
|
|
34
|
+
imagePath: '/logo-default.png',
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export const WithCustomClass: Story = {
|
|
39
|
+
args: {
|
|
40
|
+
imagePath: '/logo-default.png',
|
|
41
|
+
className: 'custom-logo',
|
|
42
|
+
},
|
|
43
|
+
parameters: {
|
|
44
|
+
docs: {
|
|
45
|
+
description: {
|
|
46
|
+
story: 'Logo with custom CSS class for additional styling',
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export const WithoutImage: Story = {
|
|
53
|
+
args: {
|
|
54
|
+
imagePath: undefined,
|
|
55
|
+
},
|
|
56
|
+
parameters: {
|
|
57
|
+
docs: {
|
|
58
|
+
description: {
|
|
59
|
+
story: 'Logo component without image source (fallback content)',
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export const Responsive: Story = {
|
|
66
|
+
args: {
|
|
67
|
+
imagePath: '/logo-default.png',
|
|
68
|
+
},
|
|
69
|
+
parameters: {
|
|
70
|
+
viewport: {
|
|
71
|
+
defaultViewport: 'mobile',
|
|
72
|
+
},
|
|
73
|
+
docs: {
|
|
74
|
+
description: {
|
|
75
|
+
story: 'Logo with responsive behavior on mobile viewport',
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './Logo.css';
|
|
3
|
+
|
|
4
|
+
export type LogoProps = {
|
|
5
|
+
className?: string;
|
|
6
|
+
imagePath?: string;
|
|
7
|
+
size?: 'small' | 'medium' | 'large' | 'xlarge' | 'auto';
|
|
8
|
+
responsive?: boolean;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const Logo: React.FC<LogoProps> = ({
|
|
12
|
+
className = '',
|
|
13
|
+
imagePath,
|
|
14
|
+
size = 'auto',
|
|
15
|
+
responsive = true,
|
|
16
|
+
}) => {
|
|
17
|
+
return (
|
|
18
|
+
<div className={`logo logo--${size} ${responsive ? 'logo--responsive' : ''} ${className}`}>
|
|
19
|
+
<img src={imagePath} alt='Saniia Smart Bed Management' className='logo-image' />
|
|
20
|
+
</div>
|
|
21
|
+
);
|
|
22
|
+
};
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import React, { useCallback } from 'react';
|
|
3
|
+
import styles from './MetricsPanel.module.css';
|
|
4
|
+
import { hexToRgba } from './tools/colorUtils';
|
|
5
|
+
import type { MetricsItem as MetricsItemType } from './tools/MetricsPanelTypes';
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
item: MetricsItemType;
|
|
9
|
+
shape?: 'rounded' | 'pill';
|
|
10
|
+
onItemClick?: (item: MetricsItemType) => void | null;
|
|
11
|
+
color?: string;
|
|
12
|
+
renderItem?: (item: MetricsItemType) => React.ReactNode;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const MetricsItem: React.FC<Props> = ({ item, shape, onItemClick, color, renderItem }) => {
|
|
16
|
+
const handleClick = useCallback(() => {
|
|
17
|
+
onItemClick?.(item);
|
|
18
|
+
}, [onItemClick, item]);
|
|
19
|
+
|
|
20
|
+
const baseClasses = [
|
|
21
|
+
styles.mpItem,
|
|
22
|
+
shape === 'pill' ? styles.mpPill : styles.mpRounded,
|
|
23
|
+
onItemClick ? styles.mpClickable : '',
|
|
24
|
+
]
|
|
25
|
+
.filter(Boolean)
|
|
26
|
+
.join(' ');
|
|
27
|
+
|
|
28
|
+
if (renderItem) {
|
|
29
|
+
return (
|
|
30
|
+
<div
|
|
31
|
+
className={baseClasses}
|
|
32
|
+
role={onItemClick ? 'button' : 'group'}
|
|
33
|
+
tabIndex={onItemClick ? 0 : -1}
|
|
34
|
+
onClick={handleClick}
|
|
35
|
+
onKeyDown={(e) => {
|
|
36
|
+
if (!onItemClick) return;
|
|
37
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
38
|
+
onItemClick(item);
|
|
39
|
+
e.preventDefault();
|
|
40
|
+
}
|
|
41
|
+
}}
|
|
42
|
+
aria-label={onItemClick ? `Voir les détails de ${item.label}` : undefined}
|
|
43
|
+
>
|
|
44
|
+
{renderItem(item)}
|
|
45
|
+
</div>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const Wrapper: any = onItemClick ? 'button' : 'div';
|
|
50
|
+
const wrapperProps: any = onItemClick
|
|
51
|
+
? {
|
|
52
|
+
onClick: handleClick,
|
|
53
|
+
className: baseClasses,
|
|
54
|
+
type: 'button',
|
|
55
|
+
'aria-label': `Voir les détails de ${item.label}`,
|
|
56
|
+
}
|
|
57
|
+
: {
|
|
58
|
+
className: baseClasses,
|
|
59
|
+
role: 'group',
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
// Icon support:
|
|
63
|
+
// - legacy: item.icon (ReactNode)
|
|
64
|
+
// - new: item.iconComponent (lucide component), item.iconSquareBg (string), item.iconColor (string)
|
|
65
|
+
const IconComponent = (item as any).iconComponent;
|
|
66
|
+
const iconSquareBg = (item as any).iconSquareBg;
|
|
67
|
+
const iconColor = (item as any).iconColor;
|
|
68
|
+
|
|
69
|
+
return (
|
|
70
|
+
<Wrapper {...wrapperProps}>
|
|
71
|
+
<div className={styles.mpLeft}>
|
|
72
|
+
{/* If iconComponent provided, render square filled; else fallback to old mpIcon */}
|
|
73
|
+
{IconComponent ? (
|
|
74
|
+
<div
|
|
75
|
+
className={styles.mpIconSquare}
|
|
76
|
+
style={{
|
|
77
|
+
background: iconSquareBg ?? hexToRgba(iconColor ?? color ?? '#7c3aed', 1),
|
|
78
|
+
border: `1px solid ${hexToRgba(iconColor ?? color ?? '#7c3aed', 0.18)}`,
|
|
79
|
+
color: iconColor ?? '#ffffff',
|
|
80
|
+
}}
|
|
81
|
+
>
|
|
82
|
+
{React.createElement(IconComponent as any, {
|
|
83
|
+
size: 20,
|
|
84
|
+
color: iconColor ?? '#fff',
|
|
85
|
+
strokeWidth: 1.8,
|
|
86
|
+
})}
|
|
87
|
+
</div>
|
|
88
|
+
) : item.icon ? (
|
|
89
|
+
<div className={styles.mpIcon}>{item.icon}</div>
|
|
90
|
+
) : null}
|
|
91
|
+
|
|
92
|
+
<div className={styles.mpMeta}>
|
|
93
|
+
<div className={styles.mpLabel}>{item.label}</div>
|
|
94
|
+
{item.subLabel && <div className={styles.mpDate}>{item.subLabel}</div>}
|
|
95
|
+
{item.date && <div className={styles.mpDate}>{item.date}</div>}
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
|
|
99
|
+
<div className={styles.mpRight}>
|
|
100
|
+
<div className={styles.mpValue} style={{ color: item.valueColor ?? color ?? undefined }}>
|
|
101
|
+
{item.value}
|
|
102
|
+
</div>
|
|
103
|
+
|
|
104
|
+
{item.badge ? (
|
|
105
|
+
<div
|
|
106
|
+
className={[styles.mpBadge, item.badge.small ? styles.mpBadgeSmall : ''].join(' ')}
|
|
107
|
+
style={{
|
|
108
|
+
backgroundColor:
|
|
109
|
+
item.badge.bg ?? hexToRgba(item.badge.color || color || '#7c3aed', 0.12),
|
|
110
|
+
borderColor: item.badge.bg
|
|
111
|
+
? 'transparent'
|
|
112
|
+
: hexToRgba(item.badge.color || color || '#7c3aed', 0.18),
|
|
113
|
+
color: item.badge.color ?? item.badge.textColor ?? '#0f172a',
|
|
114
|
+
fontWeight: 600,
|
|
115
|
+
}}
|
|
116
|
+
>
|
|
117
|
+
<div className={styles.mpBadgeTop}>{item.badge.text}</div>
|
|
118
|
+
{item.badge.subText && <div className={styles.mpBadgeSub}>{item.badge.subText}</div>}
|
|
119
|
+
</div>
|
|
120
|
+
) : item.hint ? (
|
|
121
|
+
<div className={styles.mpHint}>{item.hint}</div>
|
|
122
|
+
) : null}
|
|
123
|
+
</div>
|
|
124
|
+
</Wrapper>
|
|
125
|
+
);
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
export default React.memo(MetricsItem);
|