@proounce/shared-common 0.0.0-stage → 0.1.1

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 ADDED
@@ -0,0 +1,16 @@
1
+ GC360 Proprietary Software License
2
+
3
+ Copyright (c) 2026 Proounce. All rights reserved.
4
+
5
+ This software and its associated documentation are proprietary and
6
+ confidential. Use, reproduction, modification, distribution, publication, or
7
+ disclosure is permitted only with prior written authorization from Proounce and
8
+ only in accordance with the applicable agreement governing the authorized
9
+ user or organization.
10
+
11
+ Access to this package does not grant any ownership interest or any license
12
+ except the limited rights expressly provided by such an agreement.
13
+
14
+ THE SOFTWARE IS PROVIDED UNDER THE TERMS OF THE APPLICABLE AGREEMENT. EXCEPT
15
+ AS EXPRESSLY PROVIDED IN THAT AGREEMENT, NO WARRANTIES OR CONDITIONS, EXPRESS
16
+ OR IMPLIED, ARE GRANTED.
package/README.md CHANGED
@@ -1,3 +1,122 @@
1
- # Temporary Holding Version
1
+ # @proounce/shared-common
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Public npm distribution of the 185 selected, API-free exports from
4
+ `@gc360/shared-base-components`.
5
+
6
+ The package root is a source-faithful port from legacy commit `83e0238b`.
7
+ Component structure, underlying MUI/native controls, default properties,
8
+ styles, padding, dimensions, colors, states, icons and event behavior are
9
+ retained. The remaining 112 legacy exports are intentionally not published.
10
+
11
+ ## Requirements
12
+
13
+ - Node.js 20 or newer
14
+ - React and React DOM `^18.2.0`
15
+ - Material UI 5, MUI Icons 5, Emotion 11 and MUI X Date Pickers 5
16
+ - Day.js 1.11
17
+ - The peer dependencies used by the selected component being imported
18
+
19
+ Some faithful legacy components use `@gc360/shared-styleguide` or
20
+ `@gc360/shared-utilities`. They are optional npm peers so installation of this
21
+ public package does not fail when those packages are unavailable. Applications
22
+ using the affected components must provide the same GC360 packages at runtime.
23
+ FusionCharts, AG Grid and Lucide are likewise optional unless their components
24
+ or subpath entry points are used.
25
+
26
+ ## Installation
27
+
28
+ ```sh
29
+ npm install @proounce/shared-common
30
+ ```
31
+
32
+ This package is publicly downloadable but remains proprietary. Public
33
+ availability does not grant rights beyond [the license](LICENSE).
34
+
35
+ ## Usage
36
+
37
+ Existing imports can be migrated without changing component names:
38
+
39
+ ```tsx
40
+ import {
41
+ ActionIcon,
42
+ AdvancedDropDownList,
43
+ CommonTable,
44
+ LightTooltip,
45
+ StyledTableCell,
46
+ } from "@proounce/shared-common";
47
+ ```
48
+
49
+ The exact list and original source file for every supported name is recorded in
50
+ [the compatibility matrix](docs/COMPATIBILITY_MATRIX.md). Internal helper files
51
+ needed by those exports are bundled but are not added to the public API.
52
+
53
+ ## Optional entry points
54
+
55
+ ```tsx
56
+ import { Add, EditOutlined } from "@proounce/shared-common/icons/mui";
57
+ import { Search, X } from "@proounce/shared-common/icons/lucide";
58
+ import { FusionChart } from "@proounce/shared-common/charts/fusion";
59
+ import { CustomGridTable } from "@proounce/shared-common/grids/ag-grid";
60
+ ```
61
+
62
+ Only the curated icons required by the shared components and action registries
63
+ are exported; the package does not duplicate the complete MUI icon library.
64
+
65
+ ## Compatibility policy
66
+
67
+ A matching export name is not treated as proof of compatibility. The porting
68
+ source of truth is the original implementation at commit `83e0238b`. The
69
+ materializer preserves its dependency closure and rewrites only:
70
+
71
+ - self-package imports to their original concrete modules;
72
+ - extensionless FusionCharts file imports to the same `.js` files required by
73
+ Node ESM resolution;
74
+ - removal of the unreachable first `pagination` prop in `CustomGridTable`.
75
+ The later `pagination={enablePagination}` already overrode it in every legacy
76
+ render, so this removes a build warning without changing runtime behavior.
77
+
78
+ Accessibility behavior is the behavior present in the source baseline. A
79
+ consumer application must still perform WCAG testing for its theme, content,
80
+ responsive layout, focus order and complete user journeys.
81
+
82
+ ## Development and verification
83
+
84
+ ```sh
85
+ npm ci --legacy-peer-deps
86
+ npm run audit:legacy-closure
87
+ npm run port:legacy
88
+ npm run typecheck
89
+ npm run build
90
+ npm pack --dry-run
91
+ ```
92
+
93
+ | Command | Purpose |
94
+ | --- | --- |
95
+ | `npm run audit:legacy-closure` | Resolve private helpers and dependencies required by the 185 exports |
96
+ | `npm run port:legacy` | Materialize the faithful source tree from the pinned commit |
97
+ | `npm run audit:compatibility` | Reconcile package names with the legacy public barrel |
98
+ | `npm run typecheck` | Validate TypeScript and declaration inputs |
99
+ | `npm run build` | Generate ESM, CommonJS, declarations and source maps |
100
+ | `npm run check` | Run package validation and the production build |
101
+
102
+ Generated `dist/` files must not be edited manually.
103
+
104
+ ## Publishing
105
+
106
+ ```sh
107
+ npm login --auth-type=web
108
+ npm whoami
109
+ npm ci --legacy-peer-deps
110
+ npm run check
111
+ npm publish --access public
112
+ ```
113
+
114
+ The Jenkins pipeline installs, validates, requests approval and publishes
115
+ `@proounce/shared-common`. Configure its credentials for the authorized npm
116
+ publishing account and use trusted or staged publishing where available.
117
+
118
+ ## Audit documents
119
+
120
+ - [Compatibility matrix](docs/COMPATIBILITY_MATRIX.md)
121
+ - [Component audit](docs/COMPONENT_AUDIT.md)
122
+ - [Resolved legacy dependency closure](docs/LEGACY_CLOSURE.json)
@@ -0,0 +1,310 @@
1
+ 'use strict';
2
+
3
+ var FusionCharts = require('fusioncharts');
4
+ var charts = require('fusioncharts/fusioncharts.charts.js');
5
+ var ReactFusioncharts = require('react-fusioncharts');
6
+ var react = require('react');
7
+ var jsxRuntime = require('react/jsx-runtime');
8
+ var MenuItem = require('@mui/material/MenuItem');
9
+ var Stack = require('@mui/material/Stack');
10
+ var Typography = require('@mui/material/Typography');
11
+ var TextField = require('@mui/material/TextField');
12
+ require('@mui/material/FormControl');
13
+
14
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
15
+
16
+ var FusionCharts__default = /*#__PURE__*/_interopDefault(FusionCharts);
17
+ var charts__default = /*#__PURE__*/_interopDefault(charts);
18
+ var ReactFusioncharts__default = /*#__PURE__*/_interopDefault(ReactFusioncharts);
19
+ var MenuItem__default = /*#__PURE__*/_interopDefault(MenuItem);
20
+ var Stack__default = /*#__PURE__*/_interopDefault(Stack);
21
+ var Typography__default = /*#__PURE__*/_interopDefault(Typography);
22
+ var TextField__default = /*#__PURE__*/_interopDefault(TextField);
23
+
24
+ // src/charts/FusionChart.tsx
25
+ var fusionRegistered = false;
26
+ function FusionChart({
27
+ type,
28
+ dataSource,
29
+ width = "100%",
30
+ height = 400,
31
+ events,
32
+ licenseKey,
33
+ loadingFallback = null,
34
+ "aria-label": ariaLabel = "Chart"
35
+ }) {
36
+ const [registered, setRegistered] = react.useState(fusionRegistered);
37
+ const [licenseReady, setLicenseReady] = react.useState(!licenseKey);
38
+ react.useEffect(() => {
39
+ if (!fusionRegistered) {
40
+ ReactFusioncharts__default.default.fcRoot(FusionCharts__default.default, charts__default.default);
41
+ fusionRegistered = true;
42
+ }
43
+ setRegistered(true);
44
+ }, []);
45
+ react.useEffect(() => {
46
+ let active = true;
47
+ if (!licenseKey) {
48
+ setLicenseReady(true);
49
+ return void 0;
50
+ }
51
+ setLicenseReady(false);
52
+ void Promise.resolve(licenseKey).then((key) => {
53
+ const options = FusionCharts__default.default.options;
54
+ options.license({ key, creditLabel: false });
55
+ if (active) setLicenseReady(true);
56
+ });
57
+ return () => {
58
+ active = false;
59
+ };
60
+ }, [licenseKey]);
61
+ if (!registered || !licenseReady) return loadingFallback;
62
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { role: "img", "aria-label": ariaLabel, children: /* @__PURE__ */ jsxRuntime.jsx(
63
+ ReactFusioncharts__default.default,
64
+ {
65
+ type,
66
+ width,
67
+ height,
68
+ dataFormat: "json",
69
+ dataSource,
70
+ ...events ? { events } : {}
71
+ }
72
+ ) });
73
+ }
74
+ function FusionBarChart(props) {
75
+ return /* @__PURE__ */ jsxRuntime.jsx(FusionChart, { type: "bar2d", ...props });
76
+ }
77
+ function FusionColumnChart(props) {
78
+ return /* @__PURE__ */ jsxRuntime.jsx(FusionChart, { type: "column2d", ...props });
79
+ }
80
+ function FusionDoughnutChart(props) {
81
+ return /* @__PURE__ */ jsxRuntime.jsx(FusionChart, { type: "doughnut2d", ...props });
82
+ }
83
+ var GenericChart = FusionChart;
84
+ var FusionDefaultCharts = FusionChart;
85
+ var GenericChartCDMS = FusionChart;
86
+ var FusionDefaultChartsPF = FusionChart;
87
+ var FusionDefaultChartsPH = FusionChart;
88
+
89
+ // src/accessibility/controlNames.ts
90
+ function humanizeControlName(value) {
91
+ const normalized = value?.replace(/[_-]+/g, " ").replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/\s+/g, " ").trim();
92
+ return normalized ? normalized.charAt(0).toUpperCase() + normalized.slice(1) : void 0;
93
+ }
94
+ function resolveControlName({
95
+ label,
96
+ ariaLabel,
97
+ name,
98
+ id,
99
+ backupName
100
+ }) {
101
+ if (typeof label === "string" && label.trim()) return label.trim();
102
+ if (typeof ariaLabel === "string" && ariaLabel.trim()) return ariaLabel.trim();
103
+ return humanizeControlName(name) ?? humanizeControlName(id) ?? backupName;
104
+ }
105
+ function SharedTextField({
106
+ size = "small",
107
+ variant = "outlined",
108
+ InputLabelProps,
109
+ inputProps,
110
+ id,
111
+ name,
112
+ label,
113
+ backupName = "Text input",
114
+ ...props
115
+ }) {
116
+ const generatedId = react.useId().replace(/:/g, "");
117
+ const controlId = id ?? `shared-text-field-${generatedId}`;
118
+ const accessibleName = resolveControlName({
119
+ label,
120
+ ariaLabel: inputProps?.["aria-label"],
121
+ name,
122
+ id,
123
+ backupName
124
+ });
125
+ return /* @__PURE__ */ jsxRuntime.jsx(
126
+ TextField__default.default,
127
+ {
128
+ fullWidth: true,
129
+ size,
130
+ variant,
131
+ id: controlId,
132
+ name,
133
+ label,
134
+ InputLabelProps: { shrink: true, ...InputLabelProps },
135
+ inputProps: {
136
+ autoComplete: "off",
137
+ "data-gramm": "false",
138
+ ...!label && !inputProps?.["aria-labelledby"] ? { "aria-label": accessibleName } : {},
139
+ ...inputProps
140
+ },
141
+ ...props
142
+ }
143
+ );
144
+ }
145
+ var DEFAULT_CHART_TYPES = [
146
+ { value: "column2d", label: "Column" },
147
+ { value: "bar2d", label: "Bar" },
148
+ { value: "line", label: "Line" },
149
+ { value: "area2d", label: "Area" },
150
+ { value: "pie2d", label: "Pie" },
151
+ { value: "doughnut2d", label: "Doughnut" }
152
+ ];
153
+ function CommonChart({
154
+ type = "column2d",
155
+ title,
156
+ caption,
157
+ subCaption,
158
+ xAxisName,
159
+ yAxisName,
160
+ items,
161
+ chartOptions,
162
+ selectableTypes = DEFAULT_CHART_TYPES,
163
+ showTypeSelector = false,
164
+ selectorLabel = "Chart type",
165
+ description,
166
+ showDataTable = false,
167
+ dataTableLabel = "View chart data",
168
+ onTypeChange,
169
+ "aria-label": ariaLabel,
170
+ ...chartProps
171
+ }) {
172
+ const [selectedType, setSelectedType] = react.useState(null);
173
+ const activeType = selectedType ?? type;
174
+ const dataSource = react.useMemo(
175
+ () => ({
176
+ chart: {
177
+ caption: caption ?? (typeof title === "string" ? title : void 0),
178
+ subCaption,
179
+ xAxisName,
180
+ yAxisName,
181
+ baseFont: "Inter, sans-serif",
182
+ baseFontSize: "13",
183
+ showBorder: "0",
184
+ showCanvasBorder: "0",
185
+ usePlotGradientColor: "0",
186
+ showPlotBorder: "0",
187
+ showShadow: "0",
188
+ showLegend: "1",
189
+ legendPosition: "bottom",
190
+ labelDisplay: "rotate",
191
+ slantLabels: "1",
192
+ maxColWidth: "15",
193
+ maxBarHeight: "15",
194
+ animation: "1",
195
+ ...chartOptions
196
+ },
197
+ data: [...items]
198
+ }),
199
+ [caption, chartOptions, items, subCaption, title, xAxisName, yAxisName]
200
+ );
201
+ const accessibleName = ariaLabel ?? caption ?? (typeof title === "string" ? title : "Chart");
202
+ return /* @__PURE__ */ jsxRuntime.jsxs(Stack__default.default, { component: "section", spacing: 1.5, "aria-label": accessibleName, children: [
203
+ title || showTypeSelector ? /* @__PURE__ */ jsxRuntime.jsxs(
204
+ Stack__default.default,
205
+ {
206
+ direction: { xs: "column", sm: "row" },
207
+ alignItems: { xs: "stretch", sm: "center" },
208
+ justifyContent: "space-between",
209
+ gap: 1,
210
+ children: [
211
+ title ? /* @__PURE__ */ jsxRuntime.jsx(Typography__default.default, { component: "h2", variant: "h6", children: title }) : null,
212
+ showTypeSelector ? /* @__PURE__ */ jsxRuntime.jsx(
213
+ SharedTextField,
214
+ {
215
+ select: true,
216
+ size: "small",
217
+ label: selectorLabel,
218
+ value: activeType,
219
+ onChange: (event) => {
220
+ setSelectedType(event.target.value);
221
+ onTypeChange?.(event.target.value);
222
+ },
223
+ sx: { minWidth: 160 },
224
+ children: selectableTypes.map((option) => /* @__PURE__ */ jsxRuntime.jsx(MenuItem__default.default, { value: option.value, children: option.label }, option.value))
225
+ }
226
+ ) : null
227
+ ]
228
+ }
229
+ ) : null,
230
+ description ? /* @__PURE__ */ jsxRuntime.jsx(Typography__default.default, { color: "text.secondary", children: description }) : null,
231
+ /* @__PURE__ */ jsxRuntime.jsx(
232
+ FusionChart,
233
+ {
234
+ type: activeType,
235
+ dataSource,
236
+ "aria-label": accessibleName,
237
+ ...chartProps
238
+ }
239
+ ),
240
+ showDataTable ? /* @__PURE__ */ jsxRuntime.jsxs("details", { children: [
241
+ /* @__PURE__ */ jsxRuntime.jsx("summary", { children: dataTableLabel }),
242
+ /* @__PURE__ */ jsxRuntime.jsxs("table", { children: [
243
+ /* @__PURE__ */ jsxRuntime.jsx("caption", { children: accessibleName }),
244
+ /* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
245
+ /* @__PURE__ */ jsxRuntime.jsx("th", { scope: "col", children: "Label" }),
246
+ /* @__PURE__ */ jsxRuntime.jsx("th", { scope: "col", children: "Value" })
247
+ ] }) }),
248
+ /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: items.map((item) => /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
249
+ /* @__PURE__ */ jsxRuntime.jsx("th", { scope: "row", children: item.label }),
250
+ /* @__PURE__ */ jsxRuntime.jsx("td", { children: item.displayValue ?? item.value })
251
+ ] }, item.label)) })
252
+ ] })
253
+ ] }) : null
254
+ ] });
255
+ }
256
+ function CommonBarChart(props) {
257
+ return /* @__PURE__ */ jsxRuntime.jsx(CommonChart, { type: "bar2d", ...props });
258
+ }
259
+ function CommonColumnChart(props) {
260
+ return /* @__PURE__ */ jsxRuntime.jsx(CommonChart, { type: "column2d", ...props });
261
+ }
262
+ function LineChart(props) {
263
+ return /* @__PURE__ */ jsxRuntime.jsx(CommonChart, { type: "line", ...props });
264
+ }
265
+ function AreaChart(props) {
266
+ return /* @__PURE__ */ jsxRuntime.jsx(CommonChart, { type: "area2d", ...props });
267
+ }
268
+ function PieChart(props) {
269
+ return /* @__PURE__ */ jsxRuntime.jsx(CommonChart, { type: "pie2d", ...props });
270
+ }
271
+ function CommonDoughnutChart(props) {
272
+ return /* @__PURE__ */ jsxRuntime.jsx(CommonChart, { type: "doughnut2d", ...props });
273
+ }
274
+ function isRawPreset(props) {
275
+ return "dataSource" in props;
276
+ }
277
+ function BarChart(props) {
278
+ return isRawPreset(props) ? /* @__PURE__ */ jsxRuntime.jsx(FusionChart, { type: "bar2d", ...props }) : /* @__PURE__ */ jsxRuntime.jsx(CommonBarChart, { ...props });
279
+ }
280
+ function ColumnChart(props) {
281
+ return isRawPreset(props) ? /* @__PURE__ */ jsxRuntime.jsx(FusionChart, { type: "column2d", ...props }) : /* @__PURE__ */ jsxRuntime.jsx(CommonColumnChart, { ...props });
282
+ }
283
+ var ChartColumn2D = ColumnChart;
284
+ function DoughnutChart(props) {
285
+ return isRawPreset(props) ? /* @__PURE__ */ jsxRuntime.jsx(FusionChart, { type: "doughnut2d", ...props }) : /* @__PURE__ */ jsxRuntime.jsx(CommonDoughnutChart, { ...props });
286
+ }
287
+
288
+ exports.AreaChart = AreaChart;
289
+ exports.BarChart = BarChart;
290
+ exports.ChartColumn2D = ChartColumn2D;
291
+ exports.ColumnChart = ColumnChart;
292
+ exports.CommonBarChart = CommonBarChart;
293
+ exports.CommonChart = CommonChart;
294
+ exports.CommonColumnChart = CommonColumnChart;
295
+ exports.CommonDoughnutChart = CommonDoughnutChart;
296
+ exports.DEFAULT_CHART_TYPES = DEFAULT_CHART_TYPES;
297
+ exports.DoughnutChart = DoughnutChart;
298
+ exports.FusionBarChart = FusionBarChart;
299
+ exports.FusionChart = FusionChart;
300
+ exports.FusionColumnChart = FusionColumnChart;
301
+ exports.FusionDefaultCharts = FusionDefaultCharts;
302
+ exports.FusionDefaultChartsPF = FusionDefaultChartsPF;
303
+ exports.FusionDefaultChartsPH = FusionDefaultChartsPH;
304
+ exports.FusionDoughnutChart = FusionDoughnutChart;
305
+ exports.GenericChart = GenericChart;
306
+ exports.GenericChartCDMS = GenericChartCDMS;
307
+ exports.LineChart = LineChart;
308
+ exports.PieChart = PieChart;
309
+ //# sourceMappingURL=fusion.cjs.map
310
+ //# sourceMappingURL=fusion.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/charts/FusionChart.tsx","../../src/accessibility/controlNames.ts","../../src/inputs/SharedTextField.tsx","../../src/charts/CommonChart.tsx"],"names":["useState","useEffect","ReactFusioncharts","FusionCharts","charts","jsx","useId","TextField","useMemo","Stack","jsxs","Typography","MenuItem"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAKA,IAAI,gBAAA,GAAmB,KAAA;AAiBhB,SAAS,WAAA,CAAY;AAAA,EAC1B,IAAA;AAAA,EACA,UAAA;AAAA,EACA,KAAA,GAAQ,MAAA;AAAA,EACR,MAAA,GAAS,GAAA;AAAA,EACT,MAAA;AAAA,EACA,UAAA;AAAA,EACA,eAAA,GAAkB,IAAA;AAAA,EAClB,cAAc,SAAA,GAAY;AAC5B,CAAA,EAAqB;AACnB,EAAA,MAAM,CAAC,UAAA,EAAY,aAAa,CAAA,GAAIA,eAAS,gBAAgB,CAAA;AAC7D,EAAA,MAAM,CAAC,YAAA,EAAc,eAAe,CAAA,GAAIA,cAAA,C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EAAA,EAAY,IAAA,EAAK,OAAA,EAAS,GAAG,KAAA,EAAO,CAAA;AAC9C;AACO,SAAS,oBAAoB,KAAA,EAA+B;AACjE,EAAA,uBAAOA,cAAAA,CAAC,WAAA,EAAA,EAAY,IAAA,EAAK,YAAA,EAAc,GAAG,KAAA,EAAO,CAAA;AACnD;AAMA,SAAS,YACP,KAAA,EACiC;AACjC,EAAA,OAAO,YAAA,IAAgB,KAAA;AACzB;AAGO,SAAS,SAAS,KAAA,EAAmC;AAC1D,EAAA,OAAO,WAAA,CAAY,KAAK,CAAA,mBACtBA,eAAC,WAAA,EAAA,EAAY,IAAA,EAAK,OAAA,EAAS,GAAG,OAAO,CAAA,mBAErCA,cAAAA,CAAC,cAAA,EAAA,EAAgB,GAAG,KAAA,EAAO,CAAA;AAE/B;AAEO,SAAS,YAAY,KAAA,EAAmC;AAC7D,EAAA,OAAO,WAAA,CAAY,KAAK,CAAA,mBACtBA,eAAC,WAAA,EAAA,EAAY,IAAA,EAAK,UAAA,EAAY,GAAG,OAAO,CAAA,mBAExCA,cAAAA,CAAC,iBAAA,EAAA,EAAmB,GAAG,KAAA,EAAO,CAAA;AAElC;AAEO,IAAM,aAAA,GAAgB;AAEtB,SAAS,cAAc,KAAA,EAAmC;AAC/D,EAAA,OAAO,WAAA,CAAY,KAAK,CAAA,mBACtBA,eAAC,WAAA,EAAA,EAAY,IAAA,EAAK,YAAA,EAAc,GAAG,OAAO,CAAA,mBAE1CA,cAAAA,CAAC,mBAAA,EAAA,EAAqB,GAAG,KAAA,EAAO,CAAA;AAEpC","file":"fusion.cjs","sourcesContent":["import FusionCharts from \"fusioncharts\";\nimport charts from \"fusioncharts/fusioncharts.charts.js\";\nimport ReactFusioncharts from \"react-fusioncharts\";\nimport { useEffect, useState } from \"react\";\n\nlet fusionRegistered = false;\n\nexport interface FusionChartProps {\n type: string;\n dataSource: Record<string, unknown>;\n width?: string | number;\n height?: string | number;\n events?: Record<string, (...args: unknown[]) => void>;\n licenseKey?: string | Promise<string>;\n loadingFallback?: React.ReactNode;\n \"aria-label\"?: string;\n}\n\n/**\n * Generic FusionCharts renderer. Data and optional licensing are injected by the\n * consuming application, so this package never performs an API request.\n */\nexport function FusionChart({\n type,\n dataSource,\n width = \"100%\",\n height = 400,\n events,\n licenseKey,\n loadingFallback = null,\n \"aria-label\": ariaLabel = \"Chart\",\n}: FusionChartProps) {\n const [registered, setRegistered] = useState(fusionRegistered);\n const [licenseReady, setLicenseReady] = useState(!licenseKey);\n\n useEffect(() => {\n if (!fusionRegistered) {\n ReactFusioncharts.fcRoot(FusionCharts, charts);\n fusionRegistered = true;\n }\n setRegistered(true);\n }, []);\n\n useEffect(() => {\n let active = true;\n if (!licenseKey) {\n setLicenseReady(true);\n return undefined;\n }\n setLicenseReady(false);\n void Promise.resolve(licenseKey).then((key) => {\n const options = FusionCharts.options as typeof FusionCharts.options & {\n license: (settings: { key: string; creditLabel: boolean }) => void;\n };\n options.license({ key, creditLabel: false });\n if (active) setLicenseReady(true);\n });\n return () => {\n active = false;\n };\n }, [licenseKey]);\n\n if (!registered || !licenseReady) return loadingFallback;\n\n return (\n <div role=\"img\" aria-label={ariaLabel}>\n <ReactFusioncharts\n type={type}\n width={width}\n height={height}\n dataFormat=\"json\"\n dataSource={dataSource}\n {...(events ? { events } : {})}\n />\n </div>\n );\n}\n\nexport type FusionChartPresetProps = Omit<FusionChartProps, \"type\">;\n\nexport function FusionBarChart(props: FusionChartPresetProps) {\n return <FusionChart type=\"bar2d\" {...props} />;\n}\n\nexport function FusionColumnChart(props: FusionChartPresetProps) {\n return <FusionChart type=\"column2d\" {...props} />;\n}\n\nexport function FusionDoughnutChart(props: FusionChartPresetProps) {\n return <FusionChart type=\"doughnut2d\" {...props} />;\n}\n\nexport const GenericChart = FusionChart;\nexport const FusionDefaultCharts = FusionChart;\nexport const GenericChartCDMS = FusionChart;\nexport const FusionDefaultChartsPF = FusionChart;\nexport const FusionDefaultChartsPH = FusionChart;\n","export interface ControlNameOptions {\n label?: unknown;\n ariaLabel?: unknown;\n name?: string;\n id?: string;\n backupName: string;\n}\n\n/** Turns common field identifiers into a readable last-resort accessible name. */\nexport function humanizeControlName(value?: string) {\n const normalized = value\n ?.replace(/[_-]+/g, \" \")\n .replace(/([a-z0-9])([A-Z])/g, \"$1 $2\")\n .replace(/\\s+/g, \" \")\n .trim();\n return normalized ? normalized.charAt(0).toUpperCase() + normalized.slice(1) : undefined;\n}\n\n/**\n * A visible string label is associated by the component and therefore wins.\n * Otherwise prefer an explicit aria-label, then a readable name/id, then the\n * component's documented backup name.\n */\nexport function resolveControlName({\n label,\n ariaLabel,\n name,\n id,\n backupName,\n}: ControlNameOptions) {\n if (typeof label === \"string\" && label.trim()) return label.trim();\n if (typeof ariaLabel === \"string\" && ariaLabel.trim()) return ariaLabel.trim();\n return humanizeControlName(name) ?? humanizeControlName(id) ?? backupName;\n}\n","import TextField, { type TextFieldProps } from \"@mui/material/TextField\";\nimport FormControl from \"@mui/material/FormControl\";\nimport { useId } from \"react\";\nimport { resolveControlName } from \"../accessibility/controlNames\";\n\nexport type SharedTextFieldProps = TextFieldProps & {\n /** Accessible name used only when label, aria-label, name and id are absent. */\n backupName?: string;\n};\n\n/** A full-width text field with the legacy library's compact defaults. */\nexport function SharedTextField({\n size = \"small\",\n variant = \"outlined\",\n InputLabelProps,\n inputProps,\n id,\n name,\n label,\n backupName = \"Text input\",\n ...props\n}: SharedTextFieldProps) {\n const generatedId = useId().replace(/:/g, \"\");\n const controlId = id ?? `shared-text-field-${generatedId}`;\n const accessibleName = resolveControlName({\n label,\n ariaLabel: inputProps?.[\"aria-label\"],\n name,\n id,\n backupName,\n });\n return (\n <TextField\n fullWidth\n size={size}\n variant={variant}\n id={controlId}\n name={name}\n label={label}\n InputLabelProps={{ shrink: true, ...InputLabelProps }}\n inputProps={{\n autoComplete: \"off\",\n \"data-gramm\": \"false\",\n ...(!label && !inputProps?.[\"aria-labelledby\"] ? { \"aria-label\": accessibleName } : {}),\n ...inputProps,\n }}\n {...props}\n />\n );\n}\n\nexport default SharedTextField;\n\n/** Visual-compatible version of the legacy `TextField` export. */\nexport function LegacyTextField({\n InputProps,\n inputProps,\n label,\n name,\n id,\n backupName = \"Text input\",\n ...props\n}: SharedTextFieldProps) {\n const accessibleName = resolveControlName({\n label,\n ariaLabel: inputProps?.[\"aria-label\"] ?? InputProps?.inputProps?.[\"aria-label\"],\n name,\n id,\n backupName,\n });\n\n return (\n <TextField\n {...props}\n label={label}\n name={name}\n id={id}\n InputProps={{\n ...InputProps,\n inputProps: {\n ...InputProps?.inputProps,\n ...inputProps,\n style: {\n padding: \"10px 10px\",\n fontSize: \"14px\",\n ...InputProps?.inputProps?.style,\n ...inputProps?.style,\n },\n ...(!label && !inputProps?.[\"aria-labelledby\"] ? { \"aria-label\": accessibleName } : {}),\n },\n }}\n />\n );\n}\n\nexport type LegacyStyledTextFieldProps = SharedTextFieldProps & {\n errorMessage?: string | null;\n};\n\n/** Visual-compatible version of the legacy `StyledTextField` export. */\nexport function LegacyStyledTextField({\n errorMessage = null,\n variant = \"outlined\",\n size = \"small\",\n disabled = false,\n InputLabelProps,\n inputProps,\n sx,\n ...props\n}: LegacyStyledTextFieldProps) {\n return (\n <FormControl\n style={{ width: \"100%\", border: \"none\" }}\n error={Boolean(errorMessage && errorMessage.length > 0)}\n >\n <SharedTextField\n variant={variant}\n size={size}\n disabled={disabled}\n InputLabelProps={{\n shrink: true,\n sx: {\n color: \"#000\",\n fontSize: 18,\n background: \"#fff\",\n px: 0.5,\n zIndex: 1,\n letterSpacing: \"0.5px\",\n },\n ...InputLabelProps,\n }}\n sx={{\n \"& .MuiOutlinedInput-root\": { borderRadius: \"6px\" },\n \"& .MuiInputLabel-root\": {\n color: \"#000\",\n fontSize: 18,\n background: \"#fff\",\n px: 0.5,\n zIndex: 1,\n letterSpacing: \"0.5px\",\n },\n \"& .MuiInputLabel-shrink\": {\n transform: \"translate(11px, -9px) scale(0.75)\",\n background: \"#fff\",\n px: 0.5,\n zIndex: 1,\n },\n ...sx,\n }}\n inputProps={{\n autoComplete: \"off\",\n \"data-gramm\": \"false\",\n style: { fontSize: \"16px\", padding: \"14px 12px\", ...inputProps?.style },\n ...inputProps,\n }}\n {...props}\n />\n </FormControl>\n );\n}\n","import MenuItem from \"@mui/material/MenuItem\";\nimport Stack from \"@mui/material/Stack\";\nimport Typography from \"@mui/material/Typography\";\nimport { useMemo, useState, type ReactNode } from \"react\";\nimport { SharedTextField } from \"../inputs/SharedTextField\";\nimport {\n FusionChart,\n type FusionChartPresetProps,\n type FusionChartProps,\n} from \"./FusionChart\";\n\nexport interface CommonChartDatum extends Record<string, unknown> {\n label: string;\n value: string | number;\n displayValue?: string;\n color?: string;\n toolText?: string;\n link?: string;\n}\n\nexport interface CommonChartTypeOption {\n value: string;\n label: string;\n}\n\nexport const DEFAULT_CHART_TYPES: readonly CommonChartTypeOption[] = [\n { value: \"column2d\", label: \"Column\" },\n { value: \"bar2d\", label: \"Bar\" },\n { value: \"line\", label: \"Line\" },\n { value: \"area2d\", label: \"Area\" },\n { value: \"pie2d\", label: \"Pie\" },\n { value: \"doughnut2d\", label: \"Doughnut\" },\n];\n\nexport interface CommonChartProps\n extends Omit<FusionChartProps, \"type\" | \"dataSource\"> {\n type?: string;\n title?: ReactNode;\n caption?: string;\n subCaption?: string;\n xAxisName?: string;\n yAxisName?: string;\n items: readonly CommonChartDatum[];\n chartOptions?: Record<string, unknown>;\n selectableTypes?: readonly CommonChartTypeOption[];\n showTypeSelector?: boolean;\n selectorLabel?: string;\n description?: ReactNode;\n showDataTable?: boolean;\n dataTableLabel?: string;\n onTypeChange?: (type: string) => void;\n}\n\n/**\n * Common chart contract used by applications: data, labels and display options\n * are supplied through props and no API or license lookup is performed.\n */\nexport function CommonChart({\n type = \"column2d\",\n title,\n caption,\n subCaption,\n xAxisName,\n yAxisName,\n items,\n chartOptions,\n selectableTypes = DEFAULT_CHART_TYPES,\n showTypeSelector = false,\n selectorLabel = \"Chart type\",\n description,\n showDataTable = false,\n dataTableLabel = \"View chart data\",\n onTypeChange,\n \"aria-label\": ariaLabel,\n ...chartProps\n}: CommonChartProps) {\n const [selectedType, setSelectedType] = useState<string | null>(null);\n const activeType = selectedType ?? type;\n\n const dataSource = useMemo(\n () => ({\n chart: {\n caption: caption ?? (typeof title === \"string\" ? title : undefined),\n subCaption,\n xAxisName,\n yAxisName,\n baseFont: \"Inter, sans-serif\",\n baseFontSize: \"13\",\n showBorder: \"0\",\n showCanvasBorder: \"0\",\n usePlotGradientColor: \"0\",\n showPlotBorder: \"0\",\n showShadow: \"0\",\n showLegend: \"1\",\n legendPosition: \"bottom\",\n labelDisplay: \"rotate\",\n slantLabels: \"1\",\n maxColWidth: \"15\",\n maxBarHeight: \"15\",\n animation: \"1\",\n ...chartOptions,\n },\n data: [...items],\n }),\n [caption, chartOptions, items, subCaption, title, xAxisName, yAxisName],\n );\n\n const accessibleName =\n ariaLabel ?? caption ?? (typeof title === \"string\" ? title : \"Chart\");\n\n return (\n <Stack component=\"section\" spacing={1.5} aria-label={accessibleName}>\n {title || showTypeSelector ? (\n <Stack\n direction={{ xs: \"column\", sm: \"row\" }}\n alignItems={{ xs: \"stretch\", sm: \"center\" }}\n justifyContent=\"space-between\"\n gap={1}\n >\n {title ? <Typography component=\"h2\" variant=\"h6\">{title}</Typography> : null}\n {showTypeSelector ? (\n <SharedTextField\n select\n size=\"small\"\n label={selectorLabel}\n value={activeType}\n onChange={(event) => {\n setSelectedType(event.target.value);\n onTypeChange?.(event.target.value);\n }}\n sx={{ minWidth: 160 }}\n >\n {selectableTypes.map((option) => (\n <MenuItem key={option.value} value={option.value}>\n {option.label}\n </MenuItem>\n ))}\n </SharedTextField>\n ) : null}\n </Stack>\n ) : null}\n {description ? <Typography color=\"text.secondary\">{description}</Typography> : null}\n <FusionChart\n type={activeType}\n dataSource={dataSource}\n aria-label={accessibleName}\n {...chartProps}\n />\n {showDataTable ? (\n <details>\n <summary>{dataTableLabel}</summary>\n <table>\n <caption>{accessibleName}</caption>\n <thead><tr><th scope=\"col\">Label</th><th scope=\"col\">Value</th></tr></thead>\n <tbody>\n {items.map((item) => (\n <tr key={item.label}>\n <th scope=\"row\">{item.label}</th>\n <td>{item.displayValue ?? item.value}</td>\n </tr>\n ))}\n </tbody>\n </table>\n </details>\n ) : null}\n </Stack>\n );\n}\n\nexport type CommonChartPresetProps = Omit<CommonChartProps, \"type\">;\n\nexport function CommonBarChart(props: CommonChartPresetProps) {\n return <CommonChart type=\"bar2d\" {...props} />;\n}\nexport function CommonColumnChart(props: CommonChartPresetProps) {\n return <CommonChart type=\"column2d\" {...props} />;\n}\nexport function LineChart(props: CommonChartPresetProps) {\n return <CommonChart type=\"line\" {...props} />;\n}\nexport function AreaChart(props: CommonChartPresetProps) {\n return <CommonChart type=\"area2d\" {...props} />;\n}\nexport function PieChart(props: CommonChartPresetProps) {\n return <CommonChart type=\"pie2d\" {...props} />;\n}\nexport function CommonDoughnutChart(props: CommonChartPresetProps) {\n return <CommonChart type=\"doughnut2d\" {...props} />;\n}\n\nexport type CompatibleChartPresetProps =\n | CommonChartPresetProps\n | FusionChartPresetProps;\n\nfunction isRawPreset(\n props: CompatibleChartPresetProps,\n): props is FusionChartPresetProps {\n return \"dataSource\" in props;\n}\n\n/** Accepts both the legacy title/items contract and the raw dataSource contract. */\nexport function BarChart(props: CompatibleChartPresetProps) {\n return isRawPreset(props) ? (\n <FusionChart type=\"bar2d\" {...props} />\n ) : (\n <CommonBarChart {...props} />\n );\n}\n\nexport function ColumnChart(props: CompatibleChartPresetProps) {\n return isRawPreset(props) ? (\n <FusionChart type=\"column2d\" {...props} />\n ) : (\n <CommonColumnChart {...props} />\n );\n}\n\nexport const ChartColumn2D = ColumnChart;\n\nexport function DoughnutChart(props: CompatibleChartPresetProps) {\n return isRawPreset(props) ? (\n <FusionChart type=\"doughnut2d\" {...props} />\n ) : (\n <CommonDoughnutChart {...props} />\n );\n}\n"]}
@@ -0,0 +1,78 @@
1
+ import * as React$1 from 'react';
2
+ import { ReactNode } from 'react';
3
+
4
+ interface FusionChartProps {
5
+ type: string;
6
+ dataSource: Record<string, unknown>;
7
+ width?: string | number;
8
+ height?: string | number;
9
+ events?: Record<string, (...args: unknown[]) => void>;
10
+ licenseKey?: string | Promise<string>;
11
+ loadingFallback?: React.ReactNode;
12
+ "aria-label"?: string;
13
+ }
14
+ /**
15
+ * Generic FusionCharts renderer. Data and optional licensing are injected by the
16
+ * consuming application, so this package never performs an API request.
17
+ */
18
+ declare function FusionChart({ type, dataSource, width, height, events, licenseKey, loadingFallback, "aria-label": ariaLabel, }: FusionChartProps): string | number | boolean | Iterable<React$1.ReactNode> | React$1.JSX.Element | null;
19
+ type FusionChartPresetProps = Omit<FusionChartProps, "type">;
20
+ declare function FusionBarChart(props: FusionChartPresetProps): React$1.JSX.Element;
21
+ declare function FusionColumnChart(props: FusionChartPresetProps): React$1.JSX.Element;
22
+ declare function FusionDoughnutChart(props: FusionChartPresetProps): React$1.JSX.Element;
23
+ declare const GenericChart: typeof FusionChart;
24
+ declare const FusionDefaultCharts: typeof FusionChart;
25
+ declare const GenericChartCDMS: typeof FusionChart;
26
+ declare const FusionDefaultChartsPF: typeof FusionChart;
27
+ declare const FusionDefaultChartsPH: typeof FusionChart;
28
+
29
+ interface CommonChartDatum extends Record<string, unknown> {
30
+ label: string;
31
+ value: string | number;
32
+ displayValue?: string;
33
+ color?: string;
34
+ toolText?: string;
35
+ link?: string;
36
+ }
37
+ interface CommonChartTypeOption {
38
+ value: string;
39
+ label: string;
40
+ }
41
+ declare const DEFAULT_CHART_TYPES: readonly CommonChartTypeOption[];
42
+ interface CommonChartProps extends Omit<FusionChartProps, "type" | "dataSource"> {
43
+ type?: string;
44
+ title?: ReactNode;
45
+ caption?: string;
46
+ subCaption?: string;
47
+ xAxisName?: string;
48
+ yAxisName?: string;
49
+ items: readonly CommonChartDatum[];
50
+ chartOptions?: Record<string, unknown>;
51
+ selectableTypes?: readonly CommonChartTypeOption[];
52
+ showTypeSelector?: boolean;
53
+ selectorLabel?: string;
54
+ description?: ReactNode;
55
+ showDataTable?: boolean;
56
+ dataTableLabel?: string;
57
+ onTypeChange?: (type: string) => void;
58
+ }
59
+ /**
60
+ * Common chart contract used by applications: data, labels and display options
61
+ * are supplied through props and no API or license lookup is performed.
62
+ */
63
+ declare function CommonChart({ type, title, caption, subCaption, xAxisName, yAxisName, items, chartOptions, selectableTypes, showTypeSelector, selectorLabel, description, showDataTable, dataTableLabel, onTypeChange, "aria-label": ariaLabel, ...chartProps }: CommonChartProps): React$1.JSX.Element;
64
+ type CommonChartPresetProps = Omit<CommonChartProps, "type">;
65
+ declare function CommonBarChart(props: CommonChartPresetProps): React$1.JSX.Element;
66
+ declare function CommonColumnChart(props: CommonChartPresetProps): React$1.JSX.Element;
67
+ declare function LineChart(props: CommonChartPresetProps): React$1.JSX.Element;
68
+ declare function AreaChart(props: CommonChartPresetProps): React$1.JSX.Element;
69
+ declare function PieChart(props: CommonChartPresetProps): React$1.JSX.Element;
70
+ declare function CommonDoughnutChart(props: CommonChartPresetProps): React$1.JSX.Element;
71
+ type CompatibleChartPresetProps = CommonChartPresetProps | FusionChartPresetProps;
72
+ /** Accepts both the legacy title/items contract and the raw dataSource contract. */
73
+ declare function BarChart(props: CompatibleChartPresetProps): React$1.JSX.Element;
74
+ declare function ColumnChart(props: CompatibleChartPresetProps): React$1.JSX.Element;
75
+ declare const ChartColumn2D: typeof ColumnChart;
76
+ declare function DoughnutChart(props: CompatibleChartPresetProps): React$1.JSX.Element;
77
+
78
+ export { AreaChart, BarChart, ChartColumn2D, ColumnChart, CommonBarChart, CommonChart, type CommonChartDatum, type CommonChartPresetProps, type CommonChartProps, type CommonChartTypeOption, CommonColumnChart, CommonDoughnutChart, type CompatibleChartPresetProps, DEFAULT_CHART_TYPES, DoughnutChart, FusionBarChart, FusionChart, type FusionChartPresetProps, type FusionChartProps, FusionColumnChart, FusionDefaultCharts, FusionDefaultChartsPF, FusionDefaultChartsPH, FusionDoughnutChart, GenericChart, GenericChartCDMS, LineChart, PieChart };
@@ -0,0 +1,78 @@
1
+ import * as React$1 from 'react';
2
+ import { ReactNode } from 'react';
3
+
4
+ interface FusionChartProps {
5
+ type: string;
6
+ dataSource: Record<string, unknown>;
7
+ width?: string | number;
8
+ height?: string | number;
9
+ events?: Record<string, (...args: unknown[]) => void>;
10
+ licenseKey?: string | Promise<string>;
11
+ loadingFallback?: React.ReactNode;
12
+ "aria-label"?: string;
13
+ }
14
+ /**
15
+ * Generic FusionCharts renderer. Data and optional licensing are injected by the
16
+ * consuming application, so this package never performs an API request.
17
+ */
18
+ declare function FusionChart({ type, dataSource, width, height, events, licenseKey, loadingFallback, "aria-label": ariaLabel, }: FusionChartProps): string | number | boolean | Iterable<React$1.ReactNode> | React$1.JSX.Element | null;
19
+ type FusionChartPresetProps = Omit<FusionChartProps, "type">;
20
+ declare function FusionBarChart(props: FusionChartPresetProps): React$1.JSX.Element;
21
+ declare function FusionColumnChart(props: FusionChartPresetProps): React$1.JSX.Element;
22
+ declare function FusionDoughnutChart(props: FusionChartPresetProps): React$1.JSX.Element;
23
+ declare const GenericChart: typeof FusionChart;
24
+ declare const FusionDefaultCharts: typeof FusionChart;
25
+ declare const GenericChartCDMS: typeof FusionChart;
26
+ declare const FusionDefaultChartsPF: typeof FusionChart;
27
+ declare const FusionDefaultChartsPH: typeof FusionChart;
28
+
29
+ interface CommonChartDatum extends Record<string, unknown> {
30
+ label: string;
31
+ value: string | number;
32
+ displayValue?: string;
33
+ color?: string;
34
+ toolText?: string;
35
+ link?: string;
36
+ }
37
+ interface CommonChartTypeOption {
38
+ value: string;
39
+ label: string;
40
+ }
41
+ declare const DEFAULT_CHART_TYPES: readonly CommonChartTypeOption[];
42
+ interface CommonChartProps extends Omit<FusionChartProps, "type" | "dataSource"> {
43
+ type?: string;
44
+ title?: ReactNode;
45
+ caption?: string;
46
+ subCaption?: string;
47
+ xAxisName?: string;
48
+ yAxisName?: string;
49
+ items: readonly CommonChartDatum[];
50
+ chartOptions?: Record<string, unknown>;
51
+ selectableTypes?: readonly CommonChartTypeOption[];
52
+ showTypeSelector?: boolean;
53
+ selectorLabel?: string;
54
+ description?: ReactNode;
55
+ showDataTable?: boolean;
56
+ dataTableLabel?: string;
57
+ onTypeChange?: (type: string) => void;
58
+ }
59
+ /**
60
+ * Common chart contract used by applications: data, labels and display options
61
+ * are supplied through props and no API or license lookup is performed.
62
+ */
63
+ declare function CommonChart({ type, title, caption, subCaption, xAxisName, yAxisName, items, chartOptions, selectableTypes, showTypeSelector, selectorLabel, description, showDataTable, dataTableLabel, onTypeChange, "aria-label": ariaLabel, ...chartProps }: CommonChartProps): React$1.JSX.Element;
64
+ type CommonChartPresetProps = Omit<CommonChartProps, "type">;
65
+ declare function CommonBarChart(props: CommonChartPresetProps): React$1.JSX.Element;
66
+ declare function CommonColumnChart(props: CommonChartPresetProps): React$1.JSX.Element;
67
+ declare function LineChart(props: CommonChartPresetProps): React$1.JSX.Element;
68
+ declare function AreaChart(props: CommonChartPresetProps): React$1.JSX.Element;
69
+ declare function PieChart(props: CommonChartPresetProps): React$1.JSX.Element;
70
+ declare function CommonDoughnutChart(props: CommonChartPresetProps): React$1.JSX.Element;
71
+ type CompatibleChartPresetProps = CommonChartPresetProps | FusionChartPresetProps;
72
+ /** Accepts both the legacy title/items contract and the raw dataSource contract. */
73
+ declare function BarChart(props: CompatibleChartPresetProps): React$1.JSX.Element;
74
+ declare function ColumnChart(props: CompatibleChartPresetProps): React$1.JSX.Element;
75
+ declare const ChartColumn2D: typeof ColumnChart;
76
+ declare function DoughnutChart(props: CompatibleChartPresetProps): React$1.JSX.Element;
77
+
78
+ export { AreaChart, BarChart, ChartColumn2D, ColumnChart, CommonBarChart, CommonChart, type CommonChartDatum, type CommonChartPresetProps, type CommonChartProps, type CommonChartTypeOption, CommonColumnChart, CommonDoughnutChart, type CompatibleChartPresetProps, DEFAULT_CHART_TYPES, DoughnutChart, FusionBarChart, FusionChart, type FusionChartPresetProps, type FusionChartProps, FusionColumnChart, FusionDefaultCharts, FusionDefaultChartsPF, FusionDefaultChartsPH, FusionDoughnutChart, GenericChart, GenericChartCDMS, LineChart, PieChart };