@sybilion/uilib 1.3.23 → 1.3.25

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 (39) hide show
  1. package/dist/esm/components/widgets/PerformanceChart/HorizonsSelector/HorizonsSelector.js +34 -0
  2. package/dist/esm/components/widgets/PerformanceChart/HorizonsSelector/HorizonsSelector.styl.js +7 -0
  3. package/dist/esm/components/widgets/PerformanceChart/PerformanceChart.constants.js +17 -0
  4. package/dist/esm/components/widgets/PerformanceChart/PerformanceChart.js +807 -0
  5. package/dist/esm/components/widgets/PerformanceChart/PerformanceChart.styl.js +7 -0
  6. package/dist/esm/components/widgets/PerformanceChart/PerformanceTable.js +130 -0
  7. package/dist/esm/components/widgets/PerformanceChart/PerformanceUnderChartLegend/PerformanceUnderChartLegend.js +20 -0
  8. package/dist/esm/components/widgets/PerformanceChart/PerformanceUnderChartLegend/PerformanceUnderChartLegend.styl.js +7 -0
  9. package/dist/esm/components/widgets/PerformanceChart/performanceChart.helpers.js +591 -0
  10. package/dist/esm/components/widgets/PerformanceChart/performanceChartUserSeries.js +109 -0
  11. package/dist/esm/index.js +4 -0
  12. package/dist/esm/types/src/components/widgets/PerformanceChart/HorizonsSelector/HorizonsSelector.d.ts +7 -0
  13. package/dist/esm/types/src/components/widgets/PerformanceChart/PerformanceChart.constants.d.ts +3 -0
  14. package/dist/esm/types/src/components/widgets/PerformanceChart/PerformanceChart.d.ts +54 -0
  15. package/dist/esm/types/src/components/widgets/PerformanceChart/PerformanceTable.d.ts +31 -0
  16. package/dist/esm/types/src/components/widgets/PerformanceChart/PerformanceUnderChartLegend/PerformanceUnderChartLegend.d.ts +20 -0
  17. package/dist/esm/types/src/components/widgets/PerformanceChart/index.d.ts +4 -0
  18. package/dist/esm/types/src/components/widgets/PerformanceChart/performanceChart.helpers.d.ts +212 -0
  19. package/dist/esm/types/src/components/widgets/PerformanceChart/performanceChartUserSeries.d.ts +20 -0
  20. package/dist/esm/types/src/docs/pages/PerformanceChartPage.d.ts +1 -0
  21. package/dist/esm/types/src/index.d.ts +1 -0
  22. package/package.json +1 -1
  23. package/src/components/widgets/PerformanceChart/HorizonsSelector/HorizonsSelector.styl +25 -0
  24. package/src/components/widgets/PerformanceChart/HorizonsSelector/HorizonsSelector.styl.d.ts +11 -0
  25. package/src/components/widgets/PerformanceChart/HorizonsSelector/HorizonsSelector.tsx +67 -0
  26. package/src/components/widgets/PerformanceChart/PerformanceChart.constants.ts +17 -0
  27. package/src/components/widgets/PerformanceChart/PerformanceChart.styl +194 -0
  28. package/src/components/widgets/PerformanceChart/PerformanceChart.styl.d.ts +30 -0
  29. package/src/components/widgets/PerformanceChart/PerformanceChart.tsx +1251 -0
  30. package/src/components/widgets/PerformanceChart/PerformanceTable.tsx +381 -0
  31. package/src/components/widgets/PerformanceChart/PerformanceUnderChartLegend/PerformanceUnderChartLegend.styl +49 -0
  32. package/src/components/widgets/PerformanceChart/PerformanceUnderChartLegend/PerformanceUnderChartLegend.styl.d.ts +12 -0
  33. package/src/components/widgets/PerformanceChart/PerformanceUnderChartLegend/PerformanceUnderChartLegend.tsx +83 -0
  34. package/src/components/widgets/PerformanceChart/index.ts +28 -0
  35. package/src/components/widgets/PerformanceChart/performanceChart.helpers.ts +790 -0
  36. package/src/components/widgets/PerformanceChart/performanceChartUserSeries.ts +149 -0
  37. package/src/docs/pages/PerformanceChartPage.tsx +211 -0
  38. package/src/docs/registry.ts +6 -0
  39. package/src/index.ts +1 -0
@@ -0,0 +1,34 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { useMemo } from 'react';
3
+ import { Tabs, TabsList, TabsTrigger } from '../../../ui/Tabs/Tabs.js';
4
+ import { useThrottledCallback } from '../../../../hooks/useThrottledCallback.js';
5
+ import S from './HorizonsSelector.styl.js';
6
+
7
+ function HorizonsSelector({ selectedHorizon, onHorizonChange, availableHorizons, }) {
8
+ const horizons = useMemo(() => {
9
+ return availableHorizons
10
+ .sort((a, b) => {
11
+ // Sort by horizon number: horizon_1, horizon_2, etc.
12
+ const numA = parseInt(a.replace('horizon_', ''), 10);
13
+ const numB = parseInt(b.replace('horizon_', ''), 10);
14
+ return numA - numB;
15
+ })
16
+ .map(horizon => {
17
+ const num = horizon.replace('horizon_', '');
18
+ return {
19
+ value: horizon,
20
+ label: num,
21
+ };
22
+ });
23
+ }, [availableHorizons]);
24
+ const onChangeThrottled = useThrottledCallback(onHorizonChange, 300);
25
+ if (horizons.length === 0) {
26
+ return null;
27
+ }
28
+ return (jsxs("div", { className: S.root, children: [jsx("span", { className: S.horizonsLabel, children: "Planning horizon in months:" }), jsx(Tabs, { value: selectedHorizon, onValueChange: onHorizonChange, variant: "button", children: jsx(TabsList, { children: horizons.map(horizon => (jsx(TabsTrigger, { value: horizon.value, onPointerMove: () => {
29
+ if (selectedHorizon !== horizon.value)
30
+ onChangeThrottled(horizon.value);
31
+ }, children: horizon.label }, horizon.value))) }) })] }));
32
+ }
33
+
34
+ export { HorizonsSelector };
@@ -0,0 +1,7 @@
1
+ import styleInject from 'style-inject';
2
+
3
+ var css_248z = "@media (max-width:768px){:root{--page-x-padding:var(--p-6);--page-y-padding:var(--p-6)}}.HorizonsSelector_root__r5vAR{align-items:center;display:flex;flex-grow:1;gap:var(--p-4);justify-content:flex-end}.HorizonsSelector_horizonsLabel__-OzSL{color:var(--foreground);font-size:14px;font-weight:500}.HorizonsSelector_horizonsButtons__Z0aVg{display:flex;gap:var(--p-2)}.HorizonsSelector_horizonButton__YYpIJ{min-width:40px}.HorizonsSelector_infoIcon__7p03J{font-size:12px;margin-left:4px;opacity:.6}";
4
+ var S = {"root":"HorizonsSelector_root__r5vAR","horizonsLabel":"HorizonsSelector_horizonsLabel__-OzSL","horizonsButtons":"HorizonsSelector_horizonsButtons__Z0aVg","horizonButton":"HorizonsSelector_horizonButton__YYpIJ","infoIcon":"HorizonsSelector_infoIcon__7p03J"};
5
+ styleInject(css_248z);
6
+
7
+ export { S as default };
@@ -0,0 +1,17 @@
1
+ const MONTHS_24 = 24;
2
+ const MONTH_NAMES = [
3
+ 'Jan',
4
+ 'Feb',
5
+ 'Mar',
6
+ 'Apr',
7
+ 'May',
8
+ 'Jun',
9
+ 'Jul',
10
+ 'Aug',
11
+ 'Sep',
12
+ 'Oct',
13
+ 'Nov',
14
+ 'Dec',
15
+ ];
16
+
17
+ export { MONTHS_24, MONTH_NAMES };