@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.
@@ -1,5 +1,5 @@
1
- @layer optiaxiom._1wx78hd;
2
- @layer optiaxiom._1wx78hd {
1
+ @layer optiaxiom.tmkl1w;
2
+ @layer optiaxiom.tmkl1w {
3
3
  .ProteusChart__jmlqij1 {
4
4
  border-radius: 16px;
5
5
  }
@@ -1,5 +1,5 @@
1
- @layer optiaxiom._1wx78hd;
2
- @layer optiaxiom._1wx78hd {
1
+ @layer optiaxiom.tmkl1w;
2
+ @layer optiaxiom.tmkl1w {
3
3
  .ProteusChartTooltipContent__1gsvq810 {
4
4
  min-width: 128px;
5
5
  }
@@ -1,5 +1,5 @@
1
- @layer optiaxiom._1wx78hd;
2
- @layer optiaxiom._1wx78hd {
1
+ @layer optiaxiom.tmkl1w;
2
+ @layer optiaxiom.tmkl1w {
3
3
  .ProteusImageCarousel__1t6qej70 {
4
4
  outline: none;
5
5
  user-select: none;
@@ -1,5 +1,5 @@
1
- @layer optiaxiom._1wx78hd;
2
- @layer optiaxiom._1wx78hd {
1
+ @layer optiaxiom.tmkl1w;
2
+ @layer optiaxiom.tmkl1w {
3
3
  .ProteusQuestion__8f590p0 {
4
4
  outline: none;
5
5
  }
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-Qxw4rwpH.css';
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, XAxis, YAxis, Tooltip, Bar, Line } from 'recharts';
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
- return /* @__PURE__ */ jsx(Box, { asChild: true, ...chart(), children: /* @__PURE__ */ jsx(ResponsiveContainer, { aspect: 16 / 9, width: "100%", children: /* @__PURE__ */ jsxs(ChartComponent, { data, children: [
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
- XAxis,
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
- YAxis,
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
- width: "auto"
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-CXOspnN_.css';
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 "CancelAction":
70
- return /* @__PURE__ */ jsx(ProteusCancelAction, { ...resolve(element) });
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-CJORx2JF.css';
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-DVD_u2w0.css';
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'}}}});