sellmate-design-system-react 9.0.0-beta.49 → 9.0.0-beta.50

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
@@ -939,6 +939,29 @@ var Icon_caretUp = (p) => {
939
939
  }
940
940
  );
941
941
  };
942
+ var Icon_chat = (p) => {
943
+ const { size = 24, ...rest } = p;
944
+ return /* @__PURE__ */ jsx(
945
+ "svg",
946
+ {
947
+ width: size,
948
+ height: size,
949
+ viewBox: "0 0 24 24",
950
+ fill: "none",
951
+ xmlns: "http://www.w3.org/2000/svg",
952
+ ...rest,
953
+ children: /* @__PURE__ */ jsx(
954
+ "path",
955
+ {
956
+ fillRule: "evenodd",
957
+ clipRule: "evenodd",
958
+ d: "M12.2961 2.25C15.6684 2.25008 18.4344 4.83725 18.7228 8.13477C21.4143 9.74397 22.7011 13.2749 21.1398 16.3975C20.6005 17.4762 20.4853 18.7183 20.8166 19.8779L21.048 20.6885C21.2975 21.5618 20.3398 22.2835 19.5695 21.8027L16.2853 19.75H12.0002C9.43974 19.75 7.24026 18.2099 6.27457 16.0059L4.16129 17.3037C3.38392 17.7807 2.42724 17.0507 2.6818 16.1748L2.92301 15.3428C3.27732 14.1243 3.1547 12.8165 2.57926 11.6855C0.381511 7.36716 3.51808 2.25032 8.36344 2.25H12.2961ZM8.36344 3.75C4.63792 3.75032 2.22559 7.6845 3.9152 11.0049C4.60038 12.3512 4.79173 13.8901 4.46598 15.3564L6.89567 13.8643L7.06656 13.7744C7.24277 13.6973 7.43434 13.6572 7.62809 13.6572H12.2961C15.0317 13.6571 17.2499 11.4397 17.2502 8.7041C17.2502 5.9683 15.0318 3.75008 12.2961 3.75H8.36344Z",
959
+ fill: "currentColor"
960
+ }
961
+ )
962
+ }
963
+ );
964
+ };
942
965
  var Icon_check = (p) => {
943
966
  const { size = 24, ...rest } = p;
944
967
  return /* @__PURE__ */ jsx(
@@ -1650,6 +1673,59 @@ var Icon_event = (p) => {
1650
1673
  }
1651
1674
  );
1652
1675
  };
1676
+ var Icon_focus = (p) => {
1677
+ const { size = 24, ...rest } = p;
1678
+ return /* @__PURE__ */ jsxs(
1679
+ "svg",
1680
+ {
1681
+ width: size,
1682
+ height: size,
1683
+ viewBox: "0 0 24 24",
1684
+ fill: "none",
1685
+ xmlns: "http://www.w3.org/2000/svg",
1686
+ ...rest,
1687
+ children: [
1688
+ /* @__PURE__ */ jsx(
1689
+ "path",
1690
+ {
1691
+ d: "M3 16.25C3.41421 16.25 3.75 16.5858 3.75 17V20C3.75 20.1381 3.86193 20.25 4 20.25H7C7.41421 20.25 7.75 20.5858 7.75 21C7.75 21.4142 7.41421 21.75 7 21.75H4C3.0335 21.75 2.25 20.9665 2.25 20V17C2.25 16.5858 2.58579 16.25 3 16.25Z",
1692
+ fill: "currentColor"
1693
+ }
1694
+ ),
1695
+ /* @__PURE__ */ jsx(
1696
+ "path",
1697
+ {
1698
+ d: "M21 16.25C21.4142 16.25 21.75 16.5858 21.75 17V20C21.75 20.9665 20.9665 21.75 20 21.75H17C16.5858 21.75 16.25 21.4142 16.25 21C16.25 20.5858 16.5858 20.25 17 20.25H20C20.1381 20.25 20.25 20.1381 20.25 20V17C20.25 16.5858 20.5858 16.25 21 16.25Z",
1699
+ fill: "currentColor"
1700
+ }
1701
+ ),
1702
+ /* @__PURE__ */ jsx(
1703
+ "path",
1704
+ {
1705
+ fillRule: "evenodd",
1706
+ clipRule: "evenodd",
1707
+ d: "M12 8.25C14.0711 8.25 15.75 9.92893 15.75 12C15.75 14.0711 14.0711 15.75 12 15.75C9.92893 15.75 8.25 14.0711 8.25 12C8.25 9.92893 9.92893 8.25 12 8.25ZM12 9.75C10.7574 9.75 9.75 10.7574 9.75 12C9.75 13.2426 10.7574 14.25 12 14.25C13.2426 14.25 14.25 13.2426 14.25 12C14.25 10.7574 13.2426 9.75 12 9.75Z",
1708
+ fill: "currentColor"
1709
+ }
1710
+ ),
1711
+ /* @__PURE__ */ jsx(
1712
+ "path",
1713
+ {
1714
+ d: "M7 2.25C7.41421 2.25 7.75 2.58579 7.75 3C7.75 3.41421 7.41421 3.75 7 3.75H4C3.86193 3.75 3.75 3.86193 3.75 4V7C3.75 7.41421 3.41421 7.75 3 7.75C2.58579 7.75 2.25 7.41421 2.25 7V4C2.25 3.0335 3.0335 2.25 4 2.25H7Z",
1715
+ fill: "currentColor"
1716
+ }
1717
+ ),
1718
+ /* @__PURE__ */ jsx(
1719
+ "path",
1720
+ {
1721
+ d: "M20 2.25C20.9665 2.25 21.75 3.0335 21.75 4V7C21.75 7.41421 21.4142 7.75 21 7.75C20.5858 7.75 20.25 7.41421 20.25 7V4C20.25 3.86193 20.1381 3.75 20 3.75H17C16.5858 3.75 16.25 3.41421 16.25 3C16.25 2.58579 16.5858 2.25 17 2.25H20Z",
1722
+ fill: "currentColor"
1723
+ }
1724
+ )
1725
+ ]
1726
+ }
1727
+ );
1728
+ };
1653
1729
  var Icon_global = (p) => {
1654
1730
  const { size = 24, ...rest } = p;
1655
1731
  return /* @__PURE__ */ jsx(
@@ -2010,6 +2086,43 @@ var Icon_line = (p) => {
2010
2086
  }
2011
2087
  );
2012
2088
  };
2089
+ var Icon_link = (p) => {
2090
+ const { size = 24, ...rest } = p;
2091
+ return /* @__PURE__ */ jsxs(
2092
+ "svg",
2093
+ {
2094
+ width: size,
2095
+ height: size,
2096
+ viewBox: "0 0 24 24",
2097
+ fill: "none",
2098
+ xmlns: "http://www.w3.org/2000/svg",
2099
+ ...rest,
2100
+ children: [
2101
+ /* @__PURE__ */ jsx(
2102
+ "path",
2103
+ {
2104
+ d: "M10 6.25C10.4142 6.25 10.75 6.58579 10.75 7C10.75 7.41421 10.4142 7.75 10 7.75H7C4.65279 7.75 2.75 9.65279 2.75 12C2.75 14.3472 4.65279 16.25 7 16.25H10C10.4142 16.25 10.75 16.5858 10.75 17C10.75 17.4142 10.4142 17.75 10 17.75H7C3.82436 17.75 1.25 15.1756 1.25 12C1.25 8.82436 3.82436 6.25 7 6.25H10Z",
2105
+ fill: "currentColor"
2106
+ }
2107
+ ),
2108
+ /* @__PURE__ */ jsx(
2109
+ "path",
2110
+ {
2111
+ d: "M17 6.25C20.1756 6.25 22.75 8.82436 22.75 12C22.75 15.1756 20.1756 17.75 17 17.75H14C13.5858 17.75 13.25 17.4142 13.25 17C13.25 16.5858 13.5858 16.25 14 16.25H17C19.3472 16.25 21.25 14.3472 21.25 12C21.25 9.65279 19.3472 7.75 17 7.75H14C13.5858 7.75 13.25 7.41421 13.25 7C13.25 6.58579 13.5858 6.25 14 6.25H17Z",
2112
+ fill: "currentColor"
2113
+ }
2114
+ ),
2115
+ /* @__PURE__ */ jsx(
2116
+ "path",
2117
+ {
2118
+ d: "M16 11.25C16.4142 11.25 16.75 11.5858 16.75 12C16.75 12.4142 16.4142 12.75 16 12.75H8C7.58579 12.75 7.25 12.4142 7.25 12C7.25 11.5858 7.58579 11.25 8 11.25H16Z",
2119
+ fill: "currentColor"
2120
+ }
2121
+ )
2122
+ ]
2123
+ }
2124
+ );
2125
+ };
2013
2126
  var Icon_location = (p) => {
2014
2127
  const { size = 24, ...rest } = p;
2015
2128
  return /* @__PURE__ */ jsx(
@@ -3221,6 +3334,7 @@ var ICONS = {
3221
3334
  caretLeft: Icon_caretLeft,
3222
3335
  caretRight: Icon_caretRight,
3223
3336
  caretUp: Icon_caretUp,
3337
+ chat: Icon_chat,
3224
3338
  check: Icon_check,
3225
3339
  checkFill: Icon_checkFill,
3226
3340
  checkOutline: Icon_checkOutline,
@@ -3247,6 +3361,7 @@ var ICONS = {
3247
3361
  edit: Icon_edit,
3248
3362
  etc: Icon_etc,
3249
3363
  event: Icon_event,
3364
+ focus: Icon_focus,
3250
3365
  global: Icon_global,
3251
3366
  helpFill: Icon_helpFill,
3252
3367
  helpOutline: Icon_helpOutline,
@@ -3257,6 +3372,7 @@ var ICONS = {
3257
3372
  launcher: Icon_launcher,
3258
3373
  leftRight: Icon_leftRight,
3259
3374
  line: Icon_line,
3375
+ link: Icon_link,
3260
3376
  location: Icon_location,
3261
3377
  logout: Icon_logout,
3262
3378
  minus: Icon_minus,
@@ -4996,6 +5112,11 @@ var SChatMessageImpl = /* @__PURE__ */ forwardRef(function SChatMessage({
4996
5112
  // items-start 라 이름이 있든 없든 아바타는 언제나 첫 줄에 붙는다.
4997
5113
  "flex items-start gap-(--cmp-chatMessage-avatarGap)",
4998
5114
  outgoing && "flex-row-reverse",
5115
+ // 반대편은 비워 둔다 — 받은 메시지는 오른쪽, 보낸 메시지는 왼쪽. 긴 메시지가 화면 폭을
5116
+ // 다 차지하면 어느 쪽이 말한 것인지가 자리로 읽히지 않으므로, 말풍선이 반대편 끝까지
5117
+ // 가지 못하게 막는다. 논리 속성(ps/pe)을 쓰지 않는 이유: flex-row-reverse 는 글 방향을
5118
+ // 뒤집지 않아 보낸 메시지에서 여백이 같은 쪽에 남는다.
5119
+ outgoing ? "pl-(--cmp-chatMessage-row-paddingInset)" : "pr-(--cmp-chatMessage-row-paddingInset)",
4999
5120
  className
5000
5121
  ),
5001
5122
  ...rest,
@@ -17692,6 +17813,7 @@ var cssLen2 = (v) => v == null ? void 0 : typeof v === "number" ? `${v}px` : v;
17692
17813
  function SKeyValueTable({
17693
17814
  fields = [],
17694
17815
  values = {},
17816
+ dense = false,
17695
17817
  search = false,
17696
17818
  radius = "default",
17697
17819
  bordered = true,
@@ -17706,8 +17828,8 @@ function SKeyValueTable({
17706
17828
  value,
17707
17829
  values: { ...values, [name]: value }
17708
17830
  });
17709
- const cellHeight = "var(--cmp-table-keyValue-height)";
17710
- const cellPadY = "var(--cmp-table-keyValue-body-paddingY)";
17831
+ const cellHeight = dense ? "var(--cmp-table-body-dense-height)" : "var(--cmp-table-keyValue-height)";
17832
+ const cellPadY = dense ? "var(--cmp-table-body-paddingY-dense)" : "var(--cmp-table-keyValue-body-paddingY)";
17711
17833
  const renderField = (f) => {
17712
17834
  if (f.render) return f.render;
17713
17835
  const opt = { ...f.options ?? {} };
@@ -18225,6 +18347,7 @@ var SBarChart = /* @__PURE__ */ forwardRef(function SBarChart2({
18225
18347
  categories,
18226
18348
  series,
18227
18349
  direction = "vertical",
18350
+ stacked = false,
18228
18351
  palette = "default",
18229
18352
  colors: customColors,
18230
18353
  max,
@@ -18244,6 +18367,7 @@ var SBarChart = /* @__PURE__ */ forwardRef(function SBarChart2({
18244
18367
  const { ref: plotRef, size } = useElementSize();
18245
18368
  const { ref: axisTextRef, size: axisText } = useElementSize();
18246
18369
  const { ref: axisSampleRef, size: axisSample } = useElementSize();
18370
+ const clipId = useId();
18247
18371
  const [hovered, setHovered] = useState(null);
18248
18372
  const hoveredCategory = hovered?.category ?? null;
18249
18373
  const perCategory = series.length === 1;
@@ -18251,23 +18375,37 @@ var SBarChart = /* @__PURE__ */ forwardRef(function SBarChart2({
18251
18375
  (seriesIndex, categoryIndex) => paletteColor(palette, perCategory ? categoryIndex : seriesIndex, customColors),
18252
18376
  [palette, customColors, perCategory]
18253
18377
  );
18378
+ const stackTotals = useMemo(
18379
+ () => categories.map(
18380
+ (_, categoryIndex) => series.reduce(
18381
+ (acc, s) => {
18382
+ const value = s.data[categoryIndex];
18383
+ if (value == null || !Number.isFinite(value)) return acc;
18384
+ return value < 0 ? { positive: acc.positive, negative: acc.negative + value } : { positive: acc.positive + value, negative: acc.negative };
18385
+ },
18386
+ { positive: 0, negative: 0 }
18387
+ )
18388
+ ),
18389
+ [categories, series]
18390
+ );
18254
18391
  const scale = useMemo(
18255
18392
  () => niceScale(
18256
- series.flatMap((s) => s.data),
18393
+ stacked ? stackTotals.flatMap((total) => [total.positive, total.negative]) : series.flatMap((s) => s.data),
18257
18394
  tickCount,
18258
18395
  max
18259
18396
  ),
18260
- [series, tickCount, max]
18397
+ [stacked, stackTotals, series, tickCount, max]
18261
18398
  );
18399
+ const barSlots = stacked ? 1 : series.length;
18262
18400
  const axisLength = vertical ? size.width : size.height;
18263
18401
  const layout = useMemo(
18264
- () => bandLayout(axisLength, categories.length, series.length, barSize),
18265
- [axisLength, categories.length, series.length, barSize]
18402
+ () => bandLayout(axisLength, categories.length, barSlots, barSize),
18403
+ [axisLength, categories.length, barSlots, barSize]
18266
18404
  );
18267
18405
  const zeroRatio = ratioOf(0, scale);
18268
- const minPlotWidth = vertical ? categories.length * minBand(series.length) : 0;
18406
+ const minPlotWidth = vertical ? categories.length * minBand(barSlots) : 0;
18269
18407
  const totalHeight = height ?? (vertical ? 320 : void 0);
18270
- const plotHeight = totalHeight == null ? Math.max(1, categories.length) * minBand(series.length) : typeof totalHeight === "number" ? Math.max(0, totalHeight - axisText.height) : `calc(${totalHeight} - ${axisText.height}px)`;
18408
+ const plotHeight = totalHeight == null ? Math.max(1, categories.length) * minBand(barSlots) : typeof totalHeight === "number" ? Math.max(0, totalHeight - axisText.height) : `calc(${totalHeight} - ${axisText.height}px)`;
18271
18409
  const legend = showLegend ? /* @__PURE__ */ jsx(ChartLegend, { items: series.map((s, i) => ({ name: s.name, color: colorAt(i, 0) })) }) : null;
18272
18410
  const handleMove = (event) => {
18273
18411
  if (!showTooltip || categories.length === 0 || series.length === 0) return;
@@ -18324,7 +18462,7 @@ var SBarChart = /* @__PURE__ */ forwardRef(function SBarChart2({
18324
18462
  }
18325
18463
  );
18326
18464
  const bars = useMemo(
18327
- () => size.width > 0 && size.height > 0 ? series.flatMap(
18465
+ () => !stacked && size.width > 0 && size.height > 0 ? series.flatMap(
18328
18466
  (s, seriesIndex) => categories.map((_, categoryIndex) => {
18329
18467
  const value = s.data[categoryIndex];
18330
18468
  if (value == null || !Number.isFinite(value)) return null;
@@ -18401,9 +18539,105 @@ var SBarChart = /* @__PURE__ */ forwardRef(function SBarChart2({
18401
18539
  formatValue,
18402
18540
  onBarClick,
18403
18541
  colorAt,
18404
- hoveredCategory
18542
+ hoveredCategory,
18543
+ stacked
18405
18544
  ]
18406
18545
  );
18546
+ const stackedBars = useMemo(() => {
18547
+ if (!stacked || size.width <= 0 || size.height <= 0) return [];
18548
+ const pxOf = (value) => vertical ? size.height - ratioOf(value, scale) * size.height : ratioOf(value, scale) * size.width;
18549
+ return categories.map((_, categoryIndex) => {
18550
+ const dimmed = hoveredCategory != null && hoveredCategory !== categoryIndex;
18551
+ const barStart = layout.offset + categoryIndex * layout.band + (layout.band - layout.bar) / 2;
18552
+ let positive = 0;
18553
+ let negative = 0;
18554
+ const segments = series.flatMap((s, seriesIndex) => {
18555
+ const value = s.data[categoryIndex];
18556
+ if (value == null || !Number.isFinite(value) || value === 0) return [];
18557
+ const from = value < 0 ? negative + value : positive;
18558
+ const to = value < 0 ? negative : positive + value;
18559
+ if (value < 0) negative += value;
18560
+ else positive += value;
18561
+ return [{ seriesIndex, name: s.name, value, from, to }];
18562
+ });
18563
+ if (segments.length === 0) return null;
18564
+ const boxOf = (from, to) => {
18565
+ const a = pxOf(from);
18566
+ const b = pxOf(to);
18567
+ return vertical ? { x: barStart, y: Math.min(a, b), width: layout.bar, height: Math.abs(a - b) } : { x: Math.min(a, b), y: barStart, width: Math.abs(a - b), height: layout.bar };
18568
+ };
18569
+ const outlineOf = (extent, negativeSide) => {
18570
+ const box3 = negativeSide ? boxOf(extent, 0) : boxOf(0, extent);
18571
+ return barPath(box3.x, box3.y, box3.width, box3.height, direction, negativeSide);
18572
+ };
18573
+ const positiveClip = `${clipId}-p-${categoryIndex}`;
18574
+ const negativeClip = `${clipId}-n-${categoryIndex}`;
18575
+ const total = positive + negative;
18576
+ const outer = pxOf(total >= 0 ? positive : negative);
18577
+ const labelX = vertical ? barStart + layout.bar / 2 : total >= 0 ? outer + VALUE_LABEL_GAP : outer - VALUE_LABEL_GAP;
18578
+ const labelY = vertical ? total >= 0 ? outer - VALUE_LABEL_GAP : outer + VALUE_LABEL_GAP + 10 : barStart + layout.bar / 2;
18579
+ return /* @__PURE__ */ jsxs("g", { children: [
18580
+ /* @__PURE__ */ jsxs("defs", { children: [
18581
+ positive > 0 && /* @__PURE__ */ jsx("clipPath", { id: positiveClip, children: /* @__PURE__ */ jsx("path", { d: outlineOf(positive, false) }) }),
18582
+ negative < 0 && /* @__PURE__ */ jsx("clipPath", { id: negativeClip, children: /* @__PURE__ */ jsx("path", { d: outlineOf(negative, true) }) })
18583
+ ] }),
18584
+ segments.map((segment) => {
18585
+ const box3 = boxOf(segment.from, segment.to);
18586
+ return /* @__PURE__ */ jsx(
18587
+ "rect",
18588
+ {
18589
+ x: box3.x,
18590
+ y: box3.y,
18591
+ width: box3.width,
18592
+ height: box3.height,
18593
+ clipPath: `url(#${segment.value < 0 ? negativeClip : positiveClip})`,
18594
+ style: {
18595
+ fill: colorAt(segment.seriesIndex, categoryIndex),
18596
+ // 흐림은 조각에만 건다 — 묶음에 걸면 합계 라벨까지 같이 흐려진다.
18597
+ opacity: dimmed ? BAR_OPACITY_DIMMED : BAR_OPACITY_DEFAULT,
18598
+ cursor: onBarClick ? "pointer" : void 0
18599
+ },
18600
+ onClick: onBarClick ? () => onBarClick({
18601
+ seriesIndex: segment.seriesIndex,
18602
+ categoryIndex,
18603
+ value: segment.value
18604
+ }) : void 0,
18605
+ children: /* @__PURE__ */ jsx("title", { children: `${categories[categoryIndex]} ${segment.name} ${formatValue(segment.value)}` })
18606
+ },
18607
+ segment.seriesIndex
18608
+ );
18609
+ }),
18610
+ showValueLabel && /* @__PURE__ */ jsx(
18611
+ "text",
18612
+ {
18613
+ x: labelX,
18614
+ y: labelY,
18615
+ className: "typo-body-sm-medium",
18616
+ style: { fill: BAR_VALUE_COLOR },
18617
+ textAnchor: vertical ? "middle" : total >= 0 ? "start" : "end",
18618
+ dominantBaseline: vertical ? "auto" : "central",
18619
+ children: formatValue(total)
18620
+ }
18621
+ )
18622
+ ] }, categoryIndex);
18623
+ });
18624
+ }, [
18625
+ stacked,
18626
+ size.width,
18627
+ size.height,
18628
+ series,
18629
+ categories,
18630
+ layout,
18631
+ scale,
18632
+ vertical,
18633
+ direction,
18634
+ showValueLabel,
18635
+ formatValue,
18636
+ onBarClick,
18637
+ colorAt,
18638
+ hoveredCategory,
18639
+ clipId
18640
+ ]);
18407
18641
  const axisLabels = /* @__PURE__ */ jsx(
18408
18642
  ChartAxisLabels,
18409
18643
  {
@@ -18437,7 +18671,7 @@ var SBarChart = /* @__PURE__ */ forwardRef(function SBarChart2({
18437
18671
  width: size.width,
18438
18672
  height: size.height,
18439
18673
  role: "img",
18440
- "aria-label": `${categories.length}\uAC1C \uD56D\uBAA9, ${series.length}\uAC1C \uACC4\uC5F4 \uB9C9\uB300 \uADF8\uB798\uD504`,
18674
+ "aria-label": `${categories.length}\uAC1C \uD56D\uBAA9, ${series.length}\uAC1C \uACC4\uC5F4 ${stacked ? "\uB204\uC801 " : ""}\uB9C9\uB300 \uADF8\uB798\uD504`,
18441
18675
  children: [
18442
18676
  /* @__PURE__ */ jsx(
18443
18677
  ChartGrid,
@@ -18462,7 +18696,7 @@ var SBarChart = /* @__PURE__ */ forwardRef(function SBarChart2({
18462
18696
  }
18463
18697
  }
18464
18698
  ),
18465
- bars
18699
+ stacked ? stackedBars : bars
18466
18700
  ]
18467
18701
  }
18468
18702
  ),