@optiaxiom/proteus 0.1.22-next.1 → 0.1.23
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/dist/esm/assets/src/proteus-chart/{ProteusChart.css.ts.vanilla-Qxw4rwpH.css → ProteusChart.css.ts.vanilla-BCN2MOqI.css} +2 -2
- package/dist/esm/assets/src/proteus-chart/{ProteusChartTooltipContent.css.ts.vanilla-CXOspnN_.css → ProteusChartTooltipContent.css.ts.vanilla-DmqHa3bY.css} +2 -2
- package/dist/esm/assets/src/proteus-image-carousel/{ProteusImageCarousel.css.ts.vanilla-CJORx2JF.css → ProteusImageCarousel.css.ts.vanilla-Bbo2TbLv.css} +2 -2
- package/dist/esm/assets/src/proteus-question/{ProteusQuestion.css.ts.vanilla-DVD_u2w0.css → ProteusQuestion.css.ts.vanilla-DRvLrb5J.css} +2 -2
- package/dist/esm/index.js +0 -1
- package/dist/esm/proteus-chart/ProteusChart-css.js +1 -1
- package/dist/esm/proteus-chart/ProteusChart.js +13 -7
- package/dist/esm/proteus-chart/ProteusChartTooltipContent-css.js +1 -1
- package/dist/esm/proteus-element/ProteusElement.js +2 -3
- package/dist/esm/proteus-image-carousel/ProteusImageCarousel-css.js +1 -1
- package/dist/esm/proteus-question/ProteusQuestion-css.js +1 -1
- package/dist/esm/schema/public-schema.json.js +165 -113
- package/dist/esm/schema/runtime-schema.json.js +165 -113
- package/dist/index.d.ts +6 -14
- package/dist/spec.d.ts +2395 -2360
- package/package.json +3 -3
- package/dist/esm/proteus-action/ProteusCancelAction.js +0 -41
package/dist/esm/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { ProteusAction } from './proteus-action/ProteusAction.js';
|
|
2
|
-
export { ProteusCancelAction } from './proteus-action/ProteusCancelAction.js';
|
|
3
2
|
export { ProteusChart } from './proteus-chart/ProteusChart.js';
|
|
4
3
|
export { ProteusDataTable } from './proteus-data-table/ProteusDataTable.js';
|
|
5
4
|
export { ProteusDocumentRenderer } from './proteus-document/ProteusDocumentRenderer.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import './../assets/src/proteus-chart/ProteusChart.css.ts.vanilla-
|
|
1
|
+
import './../assets/src/proteus-chart/ProteusChart.css.ts.vanilla-BCN2MOqI.css';
|
|
2
2
|
import { recipe } from '@optiaxiom/react/css-runtime';
|
|
3
3
|
|
|
4
4
|
var chart = recipe({base:[{border:'1',borderColor:'border.tertiary',fontSize:'sm',p:'16'},'ProteusChart__jmlqij1','ProteusChart__jmlqij0']});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
3
|
import { Box, theme } from '@optiaxiom/react';
|
|
4
4
|
import { get } from 'jsonpointer';
|
|
5
|
-
import { ResponsiveContainer, BarChart, LineChart, CartesianGrid,
|
|
5
|
+
import { ResponsiveContainer, BarChart, LineChart, CartesianGrid, YAxis, XAxis, Tooltip, Bar, Line } from 'recharts';
|
|
6
6
|
import { chart } from './ProteusChart-css.js';
|
|
7
7
|
import { ProteusChartTooltipContent } from './ProteusChartTooltipContent.js';
|
|
8
8
|
|
|
@@ -10,13 +10,17 @@ const DEFAULT_COLORS = ["#096DD9", "#E59700", "#38C56C", "#D1D8DE"];
|
|
|
10
10
|
const getColor = (index) => DEFAULT_COLORS[index % DEFAULT_COLORS.length];
|
|
11
11
|
const ProteusChart = ({
|
|
12
12
|
data,
|
|
13
|
+
layout = "horizontal",
|
|
13
14
|
series,
|
|
14
15
|
type,
|
|
15
16
|
xAxisKey
|
|
16
17
|
}) => {
|
|
18
|
+
const isVertical = layout === "vertical";
|
|
17
19
|
const ChartComponent = type === "bar" ? BarChart : LineChart;
|
|
18
20
|
const Chart = type === "bar" ? Bar : Line;
|
|
19
|
-
|
|
21
|
+
const CategoryAxis = isVertical ? YAxis : XAxis;
|
|
22
|
+
const ValueAxis = isVertical ? XAxis : YAxis;
|
|
23
|
+
return /* @__PURE__ */ jsx(Box, { asChild: true, ...chart(), children: /* @__PURE__ */ jsx(ResponsiveContainer, { aspect: 16 / 9, width: "100%", children: /* @__PURE__ */ jsxs(ChartComponent, { data, layout, children: [
|
|
20
24
|
/* @__PURE__ */ jsx(
|
|
21
25
|
CartesianGrid,
|
|
22
26
|
{
|
|
@@ -26,19 +30,20 @@ const ProteusChart = ({
|
|
|
26
30
|
}
|
|
27
31
|
),
|
|
28
32
|
/* @__PURE__ */ jsx(
|
|
29
|
-
|
|
33
|
+
CategoryAxis,
|
|
30
34
|
{
|
|
31
35
|
axisLine: false,
|
|
32
36
|
dataKey: (row) => get(row, "/" + xAxisKey),
|
|
33
|
-
minTickGap: 32,
|
|
34
37
|
padding: { left: 16, right: 16 },
|
|
35
38
|
tick: { fill: theme.colors["fg.secondary"] },
|
|
36
39
|
tickLine: false,
|
|
37
|
-
tickMargin: 8
|
|
40
|
+
tickMargin: 8,
|
|
41
|
+
type: "category",
|
|
42
|
+
width: isVertical ? "auto" : void 0
|
|
38
43
|
}
|
|
39
44
|
),
|
|
40
45
|
/* @__PURE__ */ jsx(
|
|
41
|
-
|
|
46
|
+
ValueAxis,
|
|
42
47
|
{
|
|
43
48
|
axisLine: { stroke: "#CBD5E1" },
|
|
44
49
|
minTickGap: 32,
|
|
@@ -48,7 +53,8 @@ const ProteusChart = ({
|
|
|
48
53
|
notation: "compact"
|
|
49
54
|
}).format(value),
|
|
50
55
|
tickMargin: 8,
|
|
51
|
-
|
|
56
|
+
type: "number",
|
|
57
|
+
width: isVertical ? void 0 : "auto"
|
|
52
58
|
}
|
|
53
59
|
),
|
|
54
60
|
/* @__PURE__ */ jsx(Tooltip, { content: ProteusChartTooltipContent, cursor: false }),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import './../assets/src/proteus-chart/ProteusChartTooltipContent.css.ts.vanilla-
|
|
1
|
+
import './../assets/src/proteus-chart/ProteusChartTooltipContent.css.ts.vanilla-DmqHa3bY.css';
|
|
2
2
|
import { recipe } from '@optiaxiom/react/css-runtime';
|
|
3
3
|
|
|
4
4
|
var tooltip = recipe({base:[{bg:'bg.default',border:'1',borderColor:'border.secondary',display:'grid',fontSize:'sm',gap:'6',px:'8',py:'10',rounded:'lg',shadow:'lg'},'ProteusChartTooltipContent__1gsvq810']});
|
|
@@ -5,7 +5,6 @@ import { Time, Range } from '@optiaxiom/react/unstable';
|
|
|
5
5
|
import { lazy, Suspense } from 'react';
|
|
6
6
|
import { IconCalendar } from '../icons/IconCalendar.js';
|
|
7
7
|
import { ProteusAction } from '../proteus-action/ProteusAction.js';
|
|
8
|
-
import { ProteusCancelAction } from '../proteus-action/ProteusCancelAction.js';
|
|
9
8
|
import { ProteusDataTable } from '../proteus-data-table/ProteusDataTable.js';
|
|
10
9
|
import { useProteusDocumentContext } from '../proteus-document/ProteusDocumentContext.js';
|
|
11
10
|
import { useProteusDocumentPathContext } from '../proteus-document/ProteusDocumentPathContext.js';
|
|
@@ -66,8 +65,8 @@ const ProteusElement = ({
|
|
|
66
65
|
return /* @__PURE__ */ jsx(Avatar, { ...resolve(element) });
|
|
67
66
|
case "Badge":
|
|
68
67
|
return /* @__PURE__ */ jsx(Badge, { ...resolve(element) });
|
|
69
|
-
case "
|
|
70
|
-
return /* @__PURE__ */ jsx(
|
|
68
|
+
case "Button":
|
|
69
|
+
return /* @__PURE__ */ jsx(ProteusAction, { ...resolve(element) });
|
|
71
70
|
case "Card":
|
|
72
71
|
return /* @__PURE__ */ jsx(Card, { ...resolve(element) });
|
|
73
72
|
case "CardHeader":
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import './../assets/src/proteus-image-carousel/ProteusImageCarousel.css.ts.vanilla-
|
|
1
|
+
import './../assets/src/proteus-image-carousel/ProteusImageCarousel.css.ts.vanilla-Bbo2TbLv.css';
|
|
2
2
|
import { recipe } from '@optiaxiom/react/css-runtime';
|
|
3
3
|
|
|
4
4
|
var carousel = recipe({base:[{flexDirection:'column',gap:'12'},'ProteusImageCarousel__1t6qej70']});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import './../assets/src/proteus-question/ProteusQuestion.css.ts.vanilla-
|
|
1
|
+
import './../assets/src/proteus-question/ProteusQuestion.css.ts.vanilla-DRvLrb5J.css';
|
|
2
2
|
import { recipe } from '@optiaxiom/react/css-runtime';
|
|
3
3
|
|
|
4
4
|
var addon = recipe({base:[{display:'grid',fontWeight:'500',placeItems:'center',rounded:'lg',size:'md',transition:'colors'},'ProteusQuestion__8f590p3'],variants:{cursor:{pointer:{cursor:'pointer'}}}});
|