rift-ds 1.0.1 → 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/LICENSE +1 -1
- package/README.md +8 -2
- package/components/AppLayout/AppLayout.css +13 -3
- package/components/AppLayout/AppLayout.d.ts +5 -1
- package/components/AppLayout/AppLayout.js +4 -0
- package/components/AppSidebar/AppSidebar.css +237 -0
- package/components/AppSidebar/AppSidebar.d.ts +32 -3
- package/components/AppSidebar/AppSidebar.js +187 -16
- package/components/BottomNav/BottomNav.css +417 -0
- package/components/BottomNav/BottomNav.d.ts +73 -0
- package/components/BottomNav/BottomNav.js +100 -0
- package/components/Chart/AreaChart.js +67 -56
- package/components/Chart/BarChart.js +67 -56
- package/components/Chart/ComboChart.js +93 -82
- package/components/Chart/LineChart.js +59 -48
- package/components/Chart/PieChart.js +56 -45
- package/components/Chart/RadarChart.js +60 -49
- package/components/Chart/RadialChart.js +70 -59
- package/components/Chart/ScatterChart.js +61 -50
- package/components/Chart/StackedBarChart.js +64 -53
- package/components/Chart/Treemap.js +34 -23
- package/components/Inspector/Inspector.css +511 -0
- package/components/Inspector/InspectorDropdown.d.ts +39 -0
- package/components/Inspector/InspectorDropdown.js +68 -0
- package/components/Inspector/InspectorInput.d.ts +32 -0
- package/components/Inspector/InspectorInput.js +52 -0
- package/components/Inspector/InspectorSection.d.ts +32 -0
- package/components/Inspector/InspectorSection.js +70 -0
- package/components/Inspector/InspectorSegmentedControl.d.ts +46 -0
- package/components/Inspector/InspectorSegmentedControl.js +62 -0
- package/components/Inspector/InspectorSlider.d.ts +41 -0
- package/components/Inspector/InspectorSlider.js +81 -0
- package/components/Inspector/InspectorToggleSwitch.d.ts +29 -0
- package/components/Inspector/InspectorToggleSwitch.js +51 -0
- package/components/Nav/Nav.d.ts +11 -3
- package/components/Nav/Nav.js +3 -2
- package/components/SegmentedControl/SegmentedControl.css +7 -5
- package/components/SidebarPanel/SidebarPanel.css +291 -0
- package/components/SidebarPanel/SidebarPanel.d.ts +45 -0
- package/components/SidebarPanel/SidebarPanel.js +166 -0
- package/components/Stepper/Stepper.d.ts +3 -1
- package/components/Stepper/Stepper.js +1 -1
- package/components/TopAppBar/TopAppBar.css +464 -0
- package/components/TopAppBar/TopAppBar.d.ts +80 -0
- package/components/TopAppBar/TopAppBar.js +138 -0
- package/components/registry.json +84 -1
- package/components/registry.json.d.ts +84 -1
- package/components/registry.json.js +2 -2
- package/index.d.ts +9 -0
- package/index.js +18 -0
- package/package.json +5 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback } from "react";
|
|
2
|
+
import { useId, useCallback } from "react";
|
|
3
3
|
import { ResponsiveContainer, BarChart, CartesianGrid, XAxis, YAxis, Tooltip, Bar } from "recharts";
|
|
4
4
|
import { getChartSeriesColors } from "./palette.js";
|
|
5
5
|
import "./Chart.css";
|
|
@@ -29,6 +29,8 @@ const StackedBarChart = ({
|
|
|
29
29
|
bare = false,
|
|
30
30
|
className = ""
|
|
31
31
|
}) => {
|
|
32
|
+
const titleId = useId();
|
|
33
|
+
const subtitleId = useId();
|
|
32
34
|
const baseClass = "ds-chart";
|
|
33
35
|
const classes = [baseClass, bare ? `${baseClass}--bare` : "", className].filter(Boolean).join(" ");
|
|
34
36
|
const textSecondary = getCSSVar("--color-text-secondary", "#303030");
|
|
@@ -40,58 +42,67 @@ const StackedBarChart = ({
|
|
|
40
42
|
(props) => /* @__PURE__ */ jsx(StackedTooltip, { ...props }),
|
|
41
43
|
[]
|
|
42
44
|
);
|
|
43
|
-
return /* @__PURE__ */ jsxs(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
/* @__PURE__ */
|
|
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
|
-
|
|
45
|
+
return /* @__PURE__ */ jsxs(
|
|
46
|
+
"div",
|
|
47
|
+
{
|
|
48
|
+
className: classes,
|
|
49
|
+
role: "figure",
|
|
50
|
+
"aria-labelledby": title ? titleId : void 0,
|
|
51
|
+
"aria-describedby": subtitle ? subtitleId : void 0,
|
|
52
|
+
children: [
|
|
53
|
+
(title || subtitle || summaryItems) && /* @__PURE__ */ jsxs("div", { className: `${baseClass}__header`, children: [
|
|
54
|
+
/* @__PURE__ */ jsxs("div", { className: `${baseClass}__header-text`, children: [
|
|
55
|
+
title && /* @__PURE__ */ jsx("h3", { id: titleId, className: `${baseClass}__title`, children: title }),
|
|
56
|
+
subtitle && /* @__PURE__ */ jsx("p", { id: subtitleId, className: `${baseClass}__subtitle`, children: subtitle })
|
|
57
|
+
] }),
|
|
58
|
+
summaryItems && summaryItems.length > 0 && /* @__PURE__ */ jsx("div", { className: `${baseClass}__summary`, children: summaryItems.map((item, i) => /* @__PURE__ */ jsxs("div", { className: `${baseClass}__summary-item`, children: [
|
|
59
|
+
/* @__PURE__ */ jsx("span", { className: `${baseClass}__summary-label`, children: item.label }),
|
|
60
|
+
/* @__PURE__ */ jsx("span", { className: `${baseClass}__summary-value`, children: typeof item.value === "number" ? item.value.toLocaleString() : item.value })
|
|
61
|
+
] }, i)) })
|
|
62
|
+
] }),
|
|
63
|
+
/* @__PURE__ */ jsx("div", { className: `${baseClass}__body`, children: /* @__PURE__ */ jsx(ResponsiveContainer, { width: "100%", height, children: /* @__PURE__ */ jsxs(BarChart, { data, margin: { top: 8, right: 4, bottom: 0, left: -12 }, children: [
|
|
64
|
+
/* @__PURE__ */ jsx(CartesianGrid, { vertical: false, stroke: gridColor }),
|
|
65
|
+
/* @__PURE__ */ jsx(
|
|
66
|
+
XAxis,
|
|
67
|
+
{
|
|
68
|
+
dataKey: xKey,
|
|
69
|
+
tick: { fill: textSecondary, fontSize: 12 },
|
|
70
|
+
tickLine: false,
|
|
71
|
+
axisLine: { stroke: gridColor }
|
|
72
|
+
}
|
|
73
|
+
),
|
|
74
|
+
/* @__PURE__ */ jsx(
|
|
75
|
+
YAxis,
|
|
76
|
+
{
|
|
77
|
+
tick: { fill: textSecondary, fontSize: 12 },
|
|
78
|
+
tickLine: false,
|
|
79
|
+
axisLine: false,
|
|
80
|
+
tickFormatter: yAxisFormatter
|
|
81
|
+
}
|
|
82
|
+
),
|
|
83
|
+
/* @__PURE__ */ jsx(
|
|
84
|
+
Tooltip,
|
|
85
|
+
{
|
|
86
|
+
content: renderTooltip,
|
|
87
|
+
cursor: { fill: cursorColor, opacity: 0.4 }
|
|
88
|
+
}
|
|
89
|
+
),
|
|
90
|
+
series.map((s, i) => /* @__PURE__ */ jsx(
|
|
91
|
+
Bar,
|
|
92
|
+
{
|
|
93
|
+
dataKey: s.dataKey,
|
|
94
|
+
name: s.label,
|
|
95
|
+
fill: s.color || defaultColors[i % defaultColors.length],
|
|
96
|
+
stackId: "stack",
|
|
97
|
+
radius: i === series.length - 1 ? [3, 3, 0, 0] : [0, 0, 0, 0],
|
|
98
|
+
maxBarSize: 32
|
|
99
|
+
},
|
|
100
|
+
s.dataKey
|
|
101
|
+
))
|
|
102
|
+
] }) }) })
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
);
|
|
95
106
|
};
|
|
96
107
|
export {
|
|
97
108
|
StackedBarChart
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback } from "react";
|
|
2
|
+
import { useId, useCallback } from "react";
|
|
3
3
|
import { ResponsiveContainer, Treemap as Treemap$1, Tooltip } from "recharts";
|
|
4
4
|
import { getChartSeriesColors } from "./palette.js";
|
|
5
5
|
import "./Chart.css";
|
|
@@ -60,6 +60,8 @@ const Treemap = ({
|
|
|
60
60
|
bare = false,
|
|
61
61
|
className = ""
|
|
62
62
|
}) => {
|
|
63
|
+
const titleId = useId();
|
|
64
|
+
const subtitleId = useId();
|
|
63
65
|
const baseClass = "ds-chart";
|
|
64
66
|
const classes = [baseClass, bare ? `${baseClass}--bare` : "", className].filter(Boolean).join(" ");
|
|
65
67
|
const renderTooltip = useCallback(
|
|
@@ -67,28 +69,37 @@ const Treemap = ({
|
|
|
67
69
|
(props) => /* @__PURE__ */ jsx(TreemapTooltip, { ...props }),
|
|
68
70
|
[]
|
|
69
71
|
);
|
|
70
|
-
return /* @__PURE__ */ jsxs(
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
children: /* @__PURE__ */ jsx(
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
72
|
+
return /* @__PURE__ */ jsxs(
|
|
73
|
+
"div",
|
|
74
|
+
{
|
|
75
|
+
className: classes,
|
|
76
|
+
role: "figure",
|
|
77
|
+
"aria-labelledby": title ? titleId : void 0,
|
|
78
|
+
"aria-describedby": subtitle ? subtitleId : void 0,
|
|
79
|
+
children: [
|
|
80
|
+
(title || subtitle || summaryItems) && /* @__PURE__ */ jsxs("div", { className: `${baseClass}__header`, children: [
|
|
81
|
+
/* @__PURE__ */ jsxs("div", { className: `${baseClass}__header-text`, children: [
|
|
82
|
+
title && /* @__PURE__ */ jsx("h3", { id: titleId, className: `${baseClass}__title`, children: title }),
|
|
83
|
+
subtitle && /* @__PURE__ */ jsx("p", { id: subtitleId, className: `${baseClass}__subtitle`, children: subtitle })
|
|
84
|
+
] }),
|
|
85
|
+
summaryItems && summaryItems.length > 0 && /* @__PURE__ */ jsx("div", { className: `${baseClass}__summary`, children: summaryItems.map((item, i) => /* @__PURE__ */ jsxs("div", { className: `${baseClass}__summary-item`, children: [
|
|
86
|
+
/* @__PURE__ */ jsx("span", { className: `${baseClass}__summary-label`, children: item.label }),
|
|
87
|
+
/* @__PURE__ */ jsx("span", { className: `${baseClass}__summary-value`, children: typeof item.value === "number" ? item.value.toLocaleString() : item.value })
|
|
88
|
+
] }, i)) })
|
|
89
|
+
] }),
|
|
90
|
+
/* @__PURE__ */ jsx("div", { className: `${baseClass}__body`, children: /* @__PURE__ */ jsx(ResponsiveContainer, { width: "100%", height, children: /* @__PURE__ */ jsx(
|
|
91
|
+
Treemap$1,
|
|
92
|
+
{
|
|
93
|
+
data,
|
|
94
|
+
dataKey,
|
|
95
|
+
aspectRatio: 4 / 3,
|
|
96
|
+
content: /* @__PURE__ */ jsx(TreemapContent, {}),
|
|
97
|
+
children: /* @__PURE__ */ jsx(Tooltip, { content: renderTooltip })
|
|
98
|
+
}
|
|
99
|
+
) }) })
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
);
|
|
92
103
|
};
|
|
93
104
|
export {
|
|
94
105
|
Treemap
|