sellmate-design-system-react 9.0.0-beta.65 → 9.0.0-beta.66

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/index.js CHANGED
@@ -19609,8 +19609,51 @@ var ChartFrame = /* @__PURE__ */ forwardRef(function ChartFrame2({ title, unit,
19609
19609
  );
19610
19610
  });
19611
19611
  var DOT_SIZE = 6;
19612
- function ChartLegend({ items, align = "center", activeIndex, className }) {
19612
+ function ChartLegend({
19613
+ items,
19614
+ align = "center",
19615
+ activeIndex,
19616
+ className,
19617
+ variant = "simple"
19618
+ }) {
19613
19619
  if (items.length === 0) return null;
19620
+ const dot = (color) => /* @__PURE__ */ jsx(
19621
+ "span",
19622
+ {
19623
+ "aria-hidden": true,
19624
+ className: "shrink-0 rounded-full",
19625
+ style: { width: DOT_SIZE, height: DOT_SIZE, background: color }
19626
+ }
19627
+ );
19628
+ if (variant === "default") {
19629
+ return /* @__PURE__ */ jsx(
19630
+ "ul",
19631
+ {
19632
+ className: cn(
19633
+ "flex list-none flex-col gap-(--cmp-chart-doughnut-legend-data-default-gap) p-0",
19634
+ className
19635
+ ),
19636
+ children: items.map((item4, index) => /* @__PURE__ */ jsxs(
19637
+ "li",
19638
+ {
19639
+ className: cn(
19640
+ "flex items-center gap-(--cmp-chart-legendItem-gap)",
19641
+ "py-(--cmp-chart-legendItem-paddingY)",
19642
+ "typo-body-sm-medium text-(--cmp-chart-legendItem-color)",
19643
+ "transition-opacity duration-200 ease-out motion-reduce:transition-none",
19644
+ activeIndex != null && activeIndex !== index && "opacity-(--opacity-060)"
19645
+ ),
19646
+ children: [
19647
+ dot(item4.color),
19648
+ /* @__PURE__ */ jsx("span", { children: item4.name }),
19649
+ item4.value != null && /* @__PURE__ */ jsx("span", { className: "ml-auto typo-body-sm-bold", style: { color: item4.valueColor }, children: item4.value })
19650
+ ]
19651
+ },
19652
+ `${item4.name}-${index}`
19653
+ ))
19654
+ }
19655
+ );
19656
+ }
19614
19657
  return /* @__PURE__ */ jsx(
19615
19658
  "ul",
19616
19659
  {
@@ -19632,14 +19675,7 @@ function ChartLegend({ items, align = "center", activeIndex, className }) {
19632
19675
  activeIndex != null && activeIndex !== index && "opacity-(--opacity-060)"
19633
19676
  ),
19634
19677
  children: [
19635
- /* @__PURE__ */ jsx(
19636
- "span",
19637
- {
19638
- "aria-hidden": true,
19639
- className: "shrink-0 rounded-full",
19640
- style: { width: DOT_SIZE, height: DOT_SIZE, background: item4.color }
19641
- }
19642
- ),
19678
+ dot(item4.color),
19643
19679
  item4.name
19644
19680
  ]
19645
19681
  },
@@ -19652,6 +19688,7 @@ function ChartLegend({ items, align = "center", activeIndex, className }) {
19652
19688
  // src/lib/chart/palette.ts
19653
19689
  var V3 = (path) => `var(--cmp-chart-palette-${path})`;
19654
19690
  var DIMMED = (path) => `var(--cmp-chart-line-point-dimmed-palette-${path})`;
19691
+ var VALUE = (path) => `var(--cmp-chart-dataValue-palette-${path})`;
19655
19692
  var colorsOf = (v) => ({
19656
19693
  positivePrimary: v("variation-positivePrimary"),
19657
19694
  positiveSecondary: v("variation-positiveSecondary"),
@@ -19688,6 +19725,31 @@ var CHART_COLORS = colorsOf(V3);
19688
19725
  var CHART_PALETTES = palettesOf(V3);
19689
19726
  var DIMMED_COLORS = colorsOf(DIMMED);
19690
19727
  var DIMMED_PALETTES = palettesOf(DIMMED);
19728
+ var DATA_VALUE_COLORS = colorsOf(VALUE);
19729
+ var DATA_VALUE_PALETTES = {
19730
+ default: [DATA_VALUE_COLORS.positivePrimary],
19731
+ multi: [
19732
+ VALUE("multi-blue"),
19733
+ VALUE("multi-skyblue"),
19734
+ VALUE("multi-yellow"),
19735
+ VALUE("multi-olive"),
19736
+ VALUE("multi-lightRed"),
19737
+ VALUE("multi-warmBlue"),
19738
+ VALUE("multi-orange"),
19739
+ VALUE("multi-green"),
19740
+ VALUE("multi-navy"),
19741
+ VALUE("multi-grey"),
19742
+ VALUE("multi-red")
19743
+ ],
19744
+ gradation: [
19745
+ V3("gradation-1"),
19746
+ V3("gradation-2"),
19747
+ V3("gradation-3"),
19748
+ V3("gradation-4"),
19749
+ V3("gradation-5"),
19750
+ VALUE("gradation-6")
19751
+ ]
19752
+ };
19691
19753
  function pick(names, palettes, palette, index, colors) {
19692
19754
  if (palette === "custom") {
19693
19755
  if (!colors?.length) return palettes.default[0];
@@ -19702,6 +19764,9 @@ function paletteColor(palette, index, colors) {
19702
19764
  function linePointDimmedColor(palette, index, colors) {
19703
19765
  return pick(DIMMED_COLORS, DIMMED_PALETTES, palette, index, colors);
19704
19766
  }
19767
+ function dataValueColor(palette, index, colors) {
19768
+ return pick(DATA_VALUE_COLORS, DATA_VALUE_PALETTES, palette, index, colors);
19769
+ }
19705
19770
  function useElementSize() {
19706
19771
  const ref = useRef(null);
19707
19772
  const [size, setSize] = useState({ width: 0, height: 0 });
@@ -20403,6 +20468,7 @@ var SBarChart = /* @__PURE__ */ forwardRef(function SBarChart2({
20403
20468
  // src/components/SLineChart/lineChart.config.ts
20404
20469
  var LINE_WIDTH = "var(--cmp-chart-line-width)";
20405
20470
  var LINE_OPACITY = "var(--cmp-chart-line-opacity)";
20471
+ var LINE_DASH = "11 11";
20406
20472
  var POINT_RADIUS = 5;
20407
20473
  var POINT_HOVER_RADIUS = 6;
20408
20474
  var POINT_HALO_RADIUS = 12;
@@ -20495,6 +20561,7 @@ var SLineChart = /* @__PURE__ */ forwardRef(function SLineChart2({
20495
20561
  title,
20496
20562
  unit,
20497
20563
  curve = "linear",
20564
+ lineStyle = "solid",
20498
20565
  area = false,
20499
20566
  stacked = false,
20500
20567
  palette = "default",
@@ -20703,14 +20770,15 @@ var SLineChart = /* @__PURE__ */ forwardRef(function SLineChart2({
20703
20770
  style: {
20704
20771
  stroke: colorAt(seriesIndex),
20705
20772
  strokeWidth: LINE_WIDTH,
20706
- strokeOpacity: LINE_OPACITY
20773
+ strokeOpacity: LINE_OPACITY,
20774
+ strokeDasharray: lineStyle === "dashed" ? LINE_DASH : void 0
20707
20775
  }
20708
20776
  },
20709
20777
  `line-${seriesIndex}-${runIndex}`
20710
20778
  );
20711
20779
  })
20712
20780
  ),
20713
- [plotted, smooth, colorAt]
20781
+ [plotted, smooth, colorAt, lineStyle]
20714
20782
  );
20715
20783
  const { pointHalos, pointDots } = useMemo(() => {
20716
20784
  const halos = [];
@@ -20990,6 +21058,7 @@ var RadialChart = /* @__PURE__ */ forwardRef(function RadialChart2({
20990
21058
  showValueLabel = false,
20991
21059
  showLegend = true,
20992
21060
  legendPosition = "top",
21061
+ legendVariant = "simple",
20993
21062
  showTooltip = true,
20994
21063
  formatValue = defaultFormat3,
20995
21064
  onSliceClick,
@@ -21017,7 +21086,8 @@ var RadialChart = /* @__PURE__ */ forwardRef(function RadialChart2({
21017
21086
  ratio,
21018
21087
  start,
21019
21088
  end: angle,
21020
- color: paletteColor(effective, slice2.index, colors)
21089
+ color: paletteColor(effective, slice2.index, colors),
21090
+ valueColor: dataValueColor(effective, slice2.index, colors)
21021
21091
  };
21022
21092
  });
21023
21093
  return list;
@@ -21030,8 +21100,14 @@ var RadialChart = /* @__PURE__ */ forwardRef(function RadialChart2({
21030
21100
  const legend = showLegend ? /* @__PURE__ */ jsx(
21031
21101
  ChartLegend,
21032
21102
  {
21033
- items: arcs.map((arc2) => ({ name: arc2.name, color: arc2.color })),
21034
- activeIndex: hoveredArc ? arcs.indexOf(hoveredArc) : null
21103
+ items: arcs.map((arc2) => ({
21104
+ name: arc2.name,
21105
+ color: arc2.color,
21106
+ value: legendVariant === "default" ? formatValue(arc2.value) : void 0,
21107
+ valueColor: arc2.valueColor
21108
+ })),
21109
+ activeIndex: hoveredArc ? arcs.indexOf(hoveredArc) : null,
21110
+ variant: legendVariant
21035
21111
  }
21036
21112
  ) : null;
21037
21113
  const tooltipAnchor = useMemo(() => {
@@ -21190,6 +21266,7 @@ var SDonutChart = /* @__PURE__ */ forwardRef(function SDonutChart2({
21190
21266
  showValueLabel = false,
21191
21267
  showLegend = true,
21192
21268
  legendPosition = "top",
21269
+ legendVariant = "simple",
21193
21270
  showTooltip = true,
21194
21271
  ...props
21195
21272
  }, ref) {
@@ -21202,6 +21279,7 @@ var SDonutChart = /* @__PURE__ */ forwardRef(function SDonutChart2({
21202
21279
  showValueLabel,
21203
21280
  showLegend,
21204
21281
  legendPosition,
21282
+ legendVariant,
21205
21283
  showTooltip,
21206
21284
  innerRatio: DONUT_INNER_RATIO,
21207
21285
  kind: "\uB3C4\uB11B \uADF8\uB798\uD504"