sellmate-design-system-react 9.0.0-beta.56 → 9.0.0-beta.59

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.cjs CHANGED
@@ -10,7 +10,7 @@ var reactDom = require('react-dom');
10
10
  var RCheckbox = require('@radix-ui/react-checkbox');
11
11
  var client = require('react-dom/client');
12
12
  var RTooltip = require('@radix-ui/react-tooltip');
13
- var RDropdown2 = require('@radix-ui/react-dropdown-menu');
13
+ var RDropdown3 = require('@radix-ui/react-dropdown-menu');
14
14
  var RSwitch = require('@radix-ui/react-switch');
15
15
  var RDialog = require('@radix-ui/react-dialog');
16
16
  var Ariakit = require('@ariakit/react');
@@ -36,7 +36,7 @@ function _interopNamespace(e) {
36
36
  var RPopover12__namespace = /*#__PURE__*/_interopNamespace(RPopover12);
37
37
  var RCheckbox__namespace = /*#__PURE__*/_interopNamespace(RCheckbox);
38
38
  var RTooltip__namespace = /*#__PURE__*/_interopNamespace(RTooltip);
39
- var RDropdown2__namespace = /*#__PURE__*/_interopNamespace(RDropdown2);
39
+ var RDropdown3__namespace = /*#__PURE__*/_interopNamespace(RDropdown3);
40
40
  var RSwitch__namespace = /*#__PURE__*/_interopNamespace(RSwitch);
41
41
  var RDialog__namespace = /*#__PURE__*/_interopNamespace(RDialog);
42
42
  var Ariakit__namespace = /*#__PURE__*/_interopNamespace(Ariakit);
@@ -4254,7 +4254,8 @@ var TAG_COLORS = [
4254
4254
  "green",
4255
4255
  "blue",
4256
4256
  "darkblue",
4257
- "indigo"
4257
+ "indigo",
4258
+ "purple"
4258
4259
  ];
4259
4260
  var TAG_SIZE_CONFIG = {
4260
4261
  xs: {
@@ -8495,8 +8496,8 @@ var SDropdownButtonImpl = /* @__PURE__ */ react.forwardRef(
8495
8496
  "border-[color:var(--dd-border)] bg-[var(--dd-bg)] text-[color:var(--dd-text)]",
8496
8497
  disabled ? "cursor-not-allowed" : "cursor-pointer hover:bg-[var(--dd-bg-hover)]"
8497
8498
  );
8498
- const menu = /* @__PURE__ */ jsxRuntime.jsx(RDropdown2__namespace.Portal, { container: portalContainer, children: /* @__PURE__ */ jsxRuntime.jsx(
8499
- RDropdown2__namespace.Content,
8499
+ const menu = /* @__PURE__ */ jsxRuntime.jsx(RDropdown3__namespace.Portal, { container: portalContainer, children: /* @__PURE__ */ jsxRuntime.jsx(
8500
+ RDropdown3__namespace.Content,
8500
8501
  {
8501
8502
  sideOffset: 4,
8502
8503
  align: "start",
@@ -8512,7 +8513,7 @@ var SDropdownButtonImpl = /* @__PURE__ */ react.forwardRef(
8512
8513
  ),
8513
8514
  style: split ? { minWidth: clampToAvailableWidth(splitWidth, DROPDOWN_AVAILABLE_WIDTH) } : void 0,
8514
8515
  children: items.map((it) => /* @__PURE__ */ jsxRuntime.jsxs(
8515
- RDropdown2__namespace.Item,
8516
+ RDropdown3__namespace.Item,
8516
8517
  {
8517
8518
  disabled: it.disabled,
8518
8519
  onSelect: () => onItemClick?.(it.value),
@@ -8533,7 +8534,7 @@ var SDropdownButtonImpl = /* @__PURE__ */ react.forwardRef(
8533
8534
  }
8534
8535
  ) });
8535
8536
  return /* @__PURE__ */ jsxRuntime.jsxs(
8536
- RDropdown2__namespace.Root,
8537
+ RDropdown3__namespace.Root,
8537
8538
  {
8538
8539
  modal: !insideModal,
8539
8540
  open,
@@ -8565,7 +8566,7 @@ var SDropdownButtonImpl = /* @__PURE__ */ react.forwardRef(
8565
8566
  children: label
8566
8567
  }
8567
8568
  ),
8568
- /* @__PURE__ */ jsxRuntime.jsx(RDropdown2__namespace.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
8569
+ /* @__PURE__ */ jsxRuntime.jsx(RDropdown3__namespace.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
8569
8570
  "button",
8570
8571
  {
8571
8572
  ref: splitToggleRef,
@@ -8584,7 +8585,7 @@ var SDropdownButtonImpl = /* @__PURE__ */ react.forwardRef(
8584
8585
  ) })
8585
8586
  ]
8586
8587
  }
8587
- ) : /* @__PURE__ */ jsxRuntime.jsx(RDropdown2__namespace.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
8588
+ ) : /* @__PURE__ */ jsxRuntime.jsx(RDropdown3__namespace.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
8588
8589
  "button",
8589
8590
  {
8590
8591
  type: "button",
@@ -13585,10 +13586,9 @@ function todayStr() {
13585
13586
  function formatDate(year, month, day) {
13586
13587
  return `${year}-${String(month).padStart(2, "0")}-${String(day).padStart(2, "0")}`;
13587
13588
  }
13588
- function calcYearMonth(year, month, dir) {
13589
- if (dir === "prev")
13590
- return month === 1 ? { year: year - 1, month: 12 } : { year, month: month - 1 };
13591
- return month === 12 ? { year: year + 1, month: 1 } : { year, month: month + 1 };
13589
+ function calcYearMonth(year, month, dir, step = 1) {
13590
+ const index = year * 12 + (month - 1) + (dir === "prev" ? -step : step);
13591
+ return { year: Math.floor(index / 12), month: index % 12 + 1 };
13592
13592
  }
13593
13593
  function monthCells(year, month) {
13594
13594
  const firstDayIndex = new Date(year, month - 1, 1).getDay();
@@ -15429,6 +15429,22 @@ var cellValue = (col, row) => {
15429
15429
  return col.format ? col.format(raw, row) : raw;
15430
15430
  };
15431
15431
  var DEFAULT_COLUMN_WIDTH = 120;
15432
+ var LOCKED_BG = "var(--cmp-table-body-disabled-bg)";
15433
+ var LOCKED_CONTENT = "var(--cmp-table-body-disabled-content)";
15434
+ var DRAG_BG = "var(--cmp-table-dragSelectable-bg-color)";
15435
+ var DRAG_EDGE_W = "var(--cmp-table-dragSelectable-border-width)";
15436
+ var DRAG_EDGE_NEG_W = `calc(-1 * ${DRAG_EDGE_W})`;
15437
+ var DRAG_EDGE_C = "var(--cmp-table-dragSelectable-border-color)";
15438
+ var CONTEXT_MENU_VIEWPORT_PADDING = 12;
15439
+ var CONTEXT_MENU_CURSOR_GAP = 2;
15440
+ var CONTEXT_MENU_ARM_FALLBACK_MS = 500;
15441
+ var CONTEXT_MENU_ITEM_CLASS = cn(
15442
+ "flex min-h-[28px] cursor-pointer select-none items-center gap-[8px] rounded-[2px] px-[12px] py-[4px] text-[12px] leading-[20px] outline-none",
15443
+ "text-[color:var(--sys-color-fg-secondary)]",
15444
+ "data-[disabled]:cursor-not-allowed data-[disabled]:text-[color:var(--cmp-button-text-disabled)]",
15445
+ "data-[highlighted]:bg-[var(--sys-color-bg-accent)] data-[highlighted]:text-[color:var(--sys-color-fg-inverse)]"
15446
+ );
15447
+ var ROW_INTERACTIVE_SELECTOR = 'button, a, input, select, textarea, label, [role="button"], [role="checkbox"], [contenteditable="true"]';
15432
15448
  var colWidthFromDef = (c) => {
15433
15449
  if (c.autoWidth) return 0;
15434
15450
  if (c.width == null) return DEFAULT_COLUMN_WIDTH;
@@ -15441,6 +15457,9 @@ var STable = /* @__PURE__ */ react.forwardRef(function STable2({
15441
15457
  rows = [],
15442
15458
  rowKey = "id",
15443
15459
  selectable = false,
15460
+ dragSelectable = false,
15461
+ contextMenuItems,
15462
+ onContextMenuItemClick,
15444
15463
  isRowSelectable,
15445
15464
  selected = [],
15446
15465
  onSelectedChange,
@@ -15545,7 +15564,7 @@ var STable = /* @__PURE__ */ react.forwardRef(function STable2({
15545
15564
  react.useEffect(() => {
15546
15565
  setColumnWidths(visibleCols.map(colWidthFromDef));
15547
15566
  }, [colSignature]);
15548
- const selectedKeys = react.useMemo(() => new Set(selected.map((r) => r[rowKey])), [selected, rowKey]);
15567
+ const selectedKeys = react.useMemo(() => new Set(selected.map((r2) => r2[rowKey])), [selected, rowKey]);
15549
15568
  const rangeAnchorRef = react.useRef(null);
15550
15569
  const shiftPressedRef = react.useRef(false);
15551
15570
  const isRowSelected = react.useCallback(
@@ -15556,12 +15575,16 @@ var STable = /* @__PURE__ */ react.forwardRef(function STable2({
15556
15575
  (row) => isRowSelectable ? isRowSelectable(row) : true,
15557
15576
  [isRowSelectable]
15558
15577
  );
15578
+ const dragSelectOn = dragSelectable && !selectable;
15579
+ const portalContainer = usePortalContainer();
15580
+ const [dragPreviewKeys, setDragPreviewKeys] = react.useState(null);
15581
+ const dragRef = react.useRef(null);
15559
15582
  const getIsAllChecked = react.useCallback(
15560
15583
  (rws) => {
15561
15584
  const targets = rws.filter(canSelectRow);
15562
15585
  const total = targets.length;
15563
15586
  if (total === 0) return false;
15564
- const cnt = targets.filter((r) => selectedKeys.has(r[rowKey])).length;
15587
+ const cnt = targets.filter((r2) => selectedKeys.has(r2[rowKey])).length;
15565
15588
  if (cnt === 0) return false;
15566
15589
  if (cnt === total) return true;
15567
15590
  return null;
@@ -15765,16 +15788,16 @@ var STable = /* @__PURE__ */ react.forwardRef(function STable2({
15765
15788
  updateRowSelect: (row) => {
15766
15789
  if (!canSelectRow(row)) return;
15767
15790
  if (selectedKeys.has(row[rowKey]))
15768
- onSelectedChange?.(selected.filter((r) => r[rowKey] !== row[rowKey]));
15791
+ onSelectedChange?.(selected.filter((r2) => r2[rowKey] !== row[rowKey]));
15769
15792
  else onSelectedChange?.([...selected, row]);
15770
15793
  },
15771
15794
  toggleSelectAll: (checked, rws) => {
15772
15795
  if (checked) {
15773
- const add = rws.filter((r) => canSelectRow(r) && !selectedKeys.has(r[rowKey]));
15796
+ const add = rws.filter((r2) => canSelectRow(r2) && !selectedKeys.has(r2[rowKey]));
15774
15797
  onSelectedChange?.([...selected, ...add]);
15775
15798
  } else {
15776
- const keys = new Set(rws.map((r) => r[rowKey]));
15777
- onSelectedChange?.(selected.filter((r) => !keys.has(r[rowKey])));
15799
+ const keys = new Set(rws.map((r2) => r2[rowKey]));
15800
+ onSelectedChange?.(selected.filter((r2) => !keys.has(r2[rowKey])));
15778
15801
  }
15779
15802
  }
15780
15803
  }),
@@ -15868,10 +15891,10 @@ var STable = /* @__PURE__ */ react.forwardRef(function STable2({
15868
15891
  const toggleAll = () => {
15869
15892
  rangeAnchorRef.current = null;
15870
15893
  if (headerCheck === true) {
15871
- const targetKeys = new Set(selectAllRows.map((r) => r[rowKey]));
15872
- onSelectedChange?.(selected.filter((r) => !targetKeys.has(r[rowKey])));
15894
+ const targetKeys = new Set(selectAllRows.map((r2) => r2[rowKey]));
15895
+ onSelectedChange?.(selected.filter((r2) => !targetKeys.has(r2[rowKey])));
15873
15896
  } else {
15874
- const add = selectAllRows.filter((r) => canSelectRow(r) && !selectedKeys.has(r[rowKey]));
15897
+ const add = selectAllRows.filter((r2) => canSelectRow(r2) && !selectedKeys.has(r2[rowKey]));
15875
15898
  onSelectedChange?.([...selected, ...add]);
15876
15899
  }
15877
15900
  };
@@ -15884,19 +15907,89 @@ var STable = /* @__PURE__ */ react.forwardRef(function STable2({
15884
15907
  const shouldSelect = selectedKeys.has(anchor.key);
15885
15908
  const range = rows.slice(from, to + 1).filter(canSelectRow);
15886
15909
  if (shouldSelect) {
15887
- const add = range.filter((r) => !selectedKeys.has(r[rowKey]));
15910
+ const add = range.filter((r2) => !selectedKeys.has(r2[rowKey]));
15888
15911
  onSelectedChange?.([...selected, ...add]);
15889
15912
  } else {
15890
- const keys = new Set(range.map((r) => r[rowKey]));
15891
- onSelectedChange?.(selected.filter((r) => !keys.has(r[rowKey])));
15913
+ const keys = new Set(range.map((r2) => r2[rowKey]));
15914
+ onSelectedChange?.(selected.filter((r2) => !keys.has(r2[rowKey])));
15892
15915
  }
15893
15916
  return;
15894
15917
  }
15895
15918
  rangeAnchorRef.current = { index, key: row[rowKey] };
15896
15919
  if (selectedKeys.has(row[rowKey]))
15897
- onSelectedChange?.(selected.filter((r) => r[rowKey] !== row[rowKey]));
15920
+ onSelectedChange?.(selected.filter((r2) => r2[rowKey] !== row[rowKey]));
15898
15921
  else onSelectedChange?.([...selected, row]);
15899
15922
  };
15923
+ const isViewSelected = (row) => row != null && (dragPreviewKeys ?? selectedKeys).has(row[rowKey]);
15924
+ const dragRangeRows = (from, to) => {
15925
+ const [a, b] = from <= to ? [from, to] : [to, from];
15926
+ return rows.slice(a, b + 1).filter(canSelectRow);
15927
+ };
15928
+ const dragPreviewOf = (base, anchor, to) => /* @__PURE__ */ new Set([...base, ...dragRangeRows(anchor, to).map((r2) => r2[rowKey])]);
15929
+ const startDragSelect = (index, event) => {
15930
+ if (event.button !== 0) return;
15931
+ const target = event.target;
15932
+ if (target?.closest?.(ROW_INTERACTIVE_SELECTOR)) return;
15933
+ event.preventDefault();
15934
+ const baseRows = event.ctrlKey || event.metaKey ? selected : [];
15935
+ const baseKeys = new Set(baseRows.map((r2) => r2[rowKey]));
15936
+ dragRef.current = { anchor: index, last: index, baseKeys, baseRows };
15937
+ setDragPreviewKeys(dragPreviewOf(baseKeys, index, index));
15938
+ };
15939
+ const extendDragSelect = (index) => {
15940
+ const d = dragRef.current;
15941
+ if (!d || d.last === index) return;
15942
+ d.last = index;
15943
+ setDragPreviewKeys(dragPreviewOf(d.baseKeys, d.anchor, index));
15944
+ };
15945
+ const finishDragSelectRef = react.useRef(() => {
15946
+ });
15947
+ finishDragSelectRef.current = () => {
15948
+ const d = dragRef.current;
15949
+ if (!d) return;
15950
+ dragRef.current = null;
15951
+ setDragPreviewKeys(null);
15952
+ const add = dragRangeRows(d.anchor, d.last).filter((r2) => !d.baseKeys.has(r2[rowKey]));
15953
+ onSelectedChange?.([...d.baseRows, ...add]);
15954
+ };
15955
+ react.useEffect(() => {
15956
+ if (!dragSelectOn) return;
15957
+ const onUp = () => finishDragSelectRef.current();
15958
+ window.addEventListener("mouseup", onUp);
15959
+ return () => {
15960
+ window.removeEventListener("mouseup", onUp);
15961
+ dragRef.current = null;
15962
+ };
15963
+ }, [dragSelectOn]);
15964
+ const contextMenuOn = dragSelectOn && (contextMenuItems?.length ?? 0) > 0;
15965
+ const [contextMenu, setContextMenu] = react.useState(null);
15966
+ const contextMenuOpen = contextMenu?.open === true;
15967
+ const [contextMenuArmed, setContextMenuArmed] = react.useState(false);
15968
+ react.useEffect(() => {
15969
+ if (!contextMenuOpen || contextMenuArmed) return;
15970
+ const arm = () => setContextMenuArmed(true);
15971
+ window.addEventListener("pointerup", arm, { once: true, capture: true });
15972
+ const timer = window.setTimeout(arm, CONTEXT_MENU_ARM_FALLBACK_MS);
15973
+ return () => {
15974
+ window.removeEventListener("pointerup", arm, { capture: true });
15975
+ window.clearTimeout(timer);
15976
+ };
15977
+ }, [contextMenuOpen, contextMenuArmed]);
15978
+ react.useEffect(() => {
15979
+ if (!contextMenuOpen) return;
15980
+ const close = () => setContextMenu((m) => m == null ? null : { ...m, open: false });
15981
+ window.addEventListener("scroll", close, { capture: true, passive: true });
15982
+ return () => window.removeEventListener("scroll", close, { capture: true });
15983
+ }, [contextMenuOpen]);
15984
+ const openContextMenu = (row, event) => {
15985
+ if (!canSelectRow(row)) return;
15986
+ event.preventDefault();
15987
+ const alreadySelected = selectedKeys.has(row[rowKey]);
15988
+ const rows2 = alreadySelected ? selected : [row];
15989
+ if (!alreadySelected) onSelectedChange?.(rows2);
15990
+ setContextMenuArmed(false);
15991
+ setContextMenu({ x: event.clientX, y: event.clientY, rows: rows2, open: true });
15992
+ };
15900
15993
  const radiusClass = radius === "full" ? "rounded-none" : radius === "useTop" ? "rounded-b-[var(--cmp-table-radius)] rounded-t-none" : "rounded-[var(--cmp-table-radius)]";
15901
15994
  const cellPadY = innerDense ? "var(--cmp-table-body-paddingY-dense)" : "var(--cmp-table-body-paddingY-default)";
15902
15995
  const cellPadXOf = (col) => col.contentType === "control" ? "var(--cmp-table-body-paddingX-default)" : "var(--cmp-table-body-paddingX-wide)";
@@ -15919,14 +16012,13 @@ var STable = /* @__PURE__ */ react.forwardRef(function STable2({
15919
16012
  zIndex: 6
15920
16013
  };
15921
16014
  };
15922
- const stickyShadowClass = (i) => {
16015
+ const stickyShadowValue = (i) => {
15923
16016
  const { isLeft, isRight } = stickyInfo(i);
15924
16017
  const isLeftEdge = isLeft && i === stickyLeft - 1;
15925
16018
  const isRightEdge = isRight && i === visibleCols.length - stickyRight;
15926
- return cn(
15927
- isLeftEdge && scrolledLeft && "shadow-[5px_0_8px_0_rgba(34,34,34,0.1)]",
15928
- isRightEdge && scrolledRight && "shadow-[-5px_0_8px_0_rgba(34,34,34,0.1)]"
15929
- );
16019
+ if (isLeftEdge && scrolledLeft) return "5px 0 8px 0 rgba(34,34,34,0.1)";
16020
+ if (isRightEdge && scrolledRight) return "-5px 0 8px 0 rgba(34,34,34,0.1)";
16021
+ return null;
15930
16022
  };
15931
16023
  const headerResizeHitArea = (i, key) => {
15932
16024
  const col = visibleCols[i];
@@ -16120,10 +16212,14 @@ var STable = /* @__PURE__ */ react.forwardRef(function STable2({
16120
16212
  headerGroupInfo && i === visibleCols.length - 1 && "border-r-0",
16121
16213
  "relative bg-[var(--cmp-table-header-bg)] px-[16px] text-[12px] font-medium leading-[0] text-[color:var(--sys-color-fg-primary)]",
16122
16214
  stickyInfo(i).isSticky && "z-[6]",
16123
- stickyShadowClass(i),
16124
16215
  col.thClass
16125
16216
  ),
16126
- style: { textAlign: col.align ?? "left", ...cellStyle(i), ...col.thStyle },
16217
+ style: {
16218
+ textAlign: col.align ?? "left",
16219
+ boxShadow: stickyShadowValue(i) ?? void 0,
16220
+ ...cellStyle(i),
16221
+ ...col.thStyle
16222
+ },
16127
16223
  "aria-sort": isSortable ? sortDir === "asc" ? "ascending" : sortDir === "desc" ? "descending" : "none" : void 0,
16128
16224
  children: [
16129
16225
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -16235,17 +16331,27 @@ var STable = /* @__PURE__ */ react.forwardRef(function STable2({
16235
16331
  /* @__PURE__ */ jsxRuntime.jsxs("tbody", { children: [
16236
16332
  virtualScroll && topSpacer > 0 && /* @__PURE__ */ jsxRuntime.jsx("tr", { "aria-hidden": true, style: { height: topSpacer }, children: /* @__PURE__ */ jsxRuntime.jsx("td", { colSpan: totalColSpan, className: "p-0" }) }),
16237
16333
  rowCount === 0 ? null : bodyRows.map((row, ri) => {
16238
- const isSel = selectedKeys.has(row[rowKey]);
16334
+ const rowIndex = rowOffset + ri;
16335
+ const isSel = isViewSelected(row);
16336
+ const dragSel = dragSelectOn && isSel;
16337
+ const dragTop = dragSel && !isViewSelected(rows[rowIndex - 1]);
16338
+ const dragBottom = dragSel && !isViewSelected(rows[rowIndex + 1]);
16339
+ const rowLocked = (selectable || dragSelectable) && !canSelectRow(row);
16239
16340
  const rowBg = "bg-white";
16341
+ const rowHover = hoverable && !rowLocked;
16240
16342
  return /* @__PURE__ */ jsxRuntime.jsxs(
16241
16343
  "tr",
16242
16344
  {
16243
- "data-row-index": rowOffset + ri,
16345
+ "data-row-index": rowIndex,
16244
16346
  onClick: () => onRowClick?.(row),
16347
+ onMouseDown: dragSelectOn ? (event) => startDragSelect(rowIndex, event) : void 0,
16348
+ onMouseEnter: dragSelectOn ? () => extendDragSelect(rowIndex) : void 0,
16349
+ onContextMenu: contextMenuOn ? (event) => openContextMenu(row, event) : void 0,
16245
16350
  className: cn(
16246
16351
  "group/table-row",
16247
- hoverable && "hover:bg-[var(--color-grey-05)]",
16248
- onRowClick && "cursor-pointer"
16352
+ rowHover && "hover:bg-[var(--color-grey-05)]",
16353
+ onRowClick && "cursor-pointer",
16354
+ dragSelectOn && "select-none"
16249
16355
  ),
16250
16356
  style: { height: virtualScroll ? effectiveRowHeight : rowH },
16251
16357
  children: [
@@ -16256,13 +16362,15 @@ var STable = /* @__PURE__ */ react.forwardRef(function STable2({
16256
16362
  // 원본 .td--selected: 48px 고정폭, 항상 left sticky, 체크박스 중앙정렬
16257
16363
  "sticky left-0 z-[2] border-b border-solid border-[color:var(--cmp-table-border-color)] align-middle",
16258
16364
  rowBg,
16259
- hoverable && "group-hover/table-row:bg-[var(--color-grey-05)]",
16365
+ rowHover && "group-hover/table-row:bg-[var(--color-grey-05)]",
16260
16366
  stickyLeft === 0 && scrolledLeft && "shadow-[5px_0_8px_0_rgba(34,34,34,0.1)]"
16261
16367
  ),
16262
16368
  style: {
16263
16369
  width: SELECTABLE_COLUMN_WIDTH,
16264
16370
  minWidth: SELECTABLE_COLUMN_WIDTH,
16265
- maxWidth: SELECTABLE_COLUMN_WIDTH
16371
+ maxWidth: SELECTABLE_COLUMN_WIDTH,
16372
+ // 선택 열도 행의 일부다 — 여기만 희지 않으면 회색 줄이 끊긴다
16373
+ background: rowLocked ? LOCKED_BG : void 0
16266
16374
  },
16267
16375
  onClick: (e) => e.stopPropagation(),
16268
16376
  onClickCapture: (e) => {
@@ -16285,17 +16393,29 @@ var STable = /* @__PURE__ */ react.forwardRef(function STable2({
16285
16393
  // 셀 배경은 흰색으로 채워 뒤 배경이 비치지 않게 하고, hover 시 행 배경(grey_05)을 따른다.
16286
16394
  "overflow-hidden text-ellipsis whitespace-nowrap border-b border-solid border-[color:var(--cmp-table-border-color)] text-[12px] leading-[20px] text-[color:var(--sys-color-fg-primary)]",
16287
16395
  rowBg,
16288
- hoverable && "group-hover/table-row:bg-[var(--color-grey-05)]",
16289
- stickyShadowClass(i),
16396
+ rowHover && "group-hover/table-row:bg-[var(--color-grey-05)]",
16290
16397
  typeof col.tdClass === "function" ? col.tdClass(row) : col.tdClass
16291
16398
  );
16292
16399
  const tdPadX = cellPadXOf(col);
16400
+ const dragEdges = dragSel ? [
16401
+ dragTop && `inset 0 ${DRAG_EDGE_W} 0 0 ${DRAG_EDGE_C}`,
16402
+ dragBottom && `inset 0 ${DRAG_EDGE_NEG_W} 0 0 ${DRAG_EDGE_C}`,
16403
+ i === 0 && `inset ${DRAG_EDGE_W} 0 0 0 ${DRAG_EDGE_C}`,
16404
+ i === visibleCols.length - 1 && `inset ${DRAG_EDGE_NEG_W} 0 0 0 ${DRAG_EDGE_C}`
16405
+ ].filter(Boolean) : [];
16406
+ const shadows = [...dragEdges, stickyShadowValue(i)].filter(Boolean);
16293
16407
  const tdStyle = {
16294
16408
  paddingLeft: tdPadX,
16295
16409
  paddingRight: tdPadX,
16296
16410
  paddingTop: cellPadY,
16297
16411
  paddingBottom: cellPadY,
16298
16412
  textAlign: col.align ?? "left",
16413
+ // 인라인이라 hover 배경보다 세다 — 고른 행은 hover 로 흐려지지 않는다.
16414
+ background: dragSel ? DRAG_BG : rowLocked ? LOCKED_BG : void 0,
16415
+ // 클래스의 기본 글자색을 덮는다. 셀이 자기 색을 정한 내용(SIcon 의
16416
+ // color, STag 등)까지는 닿지 않는다 — 그건 소비 앱 몫이다.
16417
+ color: rowLocked ? LOCKED_CONTENT : void 0,
16418
+ boxShadow: shadows.length > 0 ? shadows.join(", ") : void 0,
16299
16419
  ...cellStyle(i)
16300
16420
  };
16301
16421
  if (col.renderCell) {
@@ -16383,6 +16503,59 @@ var STable = /* @__PURE__ */ react.forwardRef(function STable2({
16383
16503
  ] })
16384
16504
  ]
16385
16505
  }
16506
+ ),
16507
+ contextMenuOn && typeof document !== "undefined" && reactDom.createPortal(
16508
+ /* @__PURE__ */ jsxRuntime.jsxs(
16509
+ RDropdown3__namespace.Root,
16510
+ {
16511
+ modal: false,
16512
+ open: contextMenuOpen,
16513
+ onOpenChange: (open) => {
16514
+ if (!open) setContextMenu((m) => m == null ? null : { ...m, open: false });
16515
+ },
16516
+ children: [
16517
+ /* @__PURE__ */ jsxRuntime.jsx(RDropdown3__namespace.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
16518
+ "span",
16519
+ {
16520
+ "aria-hidden": true,
16521
+ className: "pointer-events-none fixed block h-0 w-0",
16522
+ style: { left: contextMenu?.x ?? 0, top: contextMenu?.y ?? 0 }
16523
+ }
16524
+ ) }),
16525
+ /* @__PURE__ */ jsxRuntime.jsx(
16526
+ RDropdown3__namespace.Content,
16527
+ {
16528
+ align: "start",
16529
+ side: "bottom",
16530
+ sideOffset: CONTEXT_MENU_CURSOR_GAP,
16531
+ alignOffset: CONTEXT_MENU_CURSOR_GAP,
16532
+ collisionPadding: CONTEXT_MENU_VIEWPORT_PADDING,
16533
+ style: contextMenuArmed ? void 0 : { pointerEvents: "none" },
16534
+ className: cn(
16535
+ "z-50 overflow-hidden rounded-[var(--cmp-listBox-radius)] bg-[var(--cmp-listBox-bg)] shadow-normal-sm",
16536
+ "max-w-[var(--radix-dropdown-menu-content-available-width)]",
16537
+ FLOATING_SLIDE_ANIM
16538
+ ),
16539
+ children: contextMenuItems?.map((item4) => /* @__PURE__ */ jsxRuntime.jsxs(
16540
+ RDropdown3__namespace.Item,
16541
+ {
16542
+ disabled: item4.disabled,
16543
+ onSelect: () => onContextMenuItemClick?.(item4.value, contextMenu?.rows ?? []),
16544
+ className: CONTEXT_MENU_ITEM_CLASS,
16545
+ children: [
16546
+ item4.icon && /* @__PURE__ */ jsxRuntime.jsx(SIcon, { name: item4.icon, size: 12 }),
16547
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 break-words", children: item4.label })
16548
+ ]
16549
+ },
16550
+ item4.value
16551
+ ))
16552
+ }
16553
+ )
16554
+ ]
16555
+ },
16556
+ contextMenu == null ? "closed" : `${contextMenu.x},${contextMenu.y}`
16557
+ ),
16558
+ portalContainer ?? document.body
16386
16559
  )
16387
16560
  ]
16388
16561
  }
@@ -17901,11 +18074,11 @@ function RangeCalendar({
17901
18074
  const goPrevYear = () => setBase(y - 1, m);
17902
18075
  const goNextYear = () => setBase(y + 1, m);
17903
18076
  const goPrevMonth = () => {
17904
- const n = calcYearMonth(y, m, "prev");
18077
+ const n = calcYearMonth(y, m, "prev", 2);
17905
18078
  setBase(n.year, n.month);
17906
18079
  };
17907
18080
  const goNextMonth = () => {
17908
- const n = calcYearMonth(y, m, "next");
18081
+ const n = calcYearMonth(y, m, "next", 2);
17909
18082
  setBase(n.year, n.month);
17910
18083
  };
17911
18084
  const goToday = () => {
@@ -18188,6 +18361,7 @@ function SDateRangePicker({
18188
18361
  disabled = false,
18189
18362
  clearable = false,
18190
18363
  width,
18364
+ maxWidth,
18191
18365
  name,
18192
18366
  rules,
18193
18367
  status,
@@ -18248,10 +18422,10 @@ function SDateRangePicker({
18248
18422
  lineHeight: 20,
18249
18423
  radius: 4
18250
18424
  };
18251
- const select = (r) => {
18425
+ const select = (r2) => {
18252
18426
  setPendingStart(null);
18253
- onValueChange?.(r);
18254
- if (rules && rules.length > 0) setRuleError(runRules(r, rules));
18427
+ onValueChange?.(r2);
18428
+ if (rules && rules.length > 0) setRuleError(runRules(r2, rules));
18255
18429
  if (!showTimePicker) setOpen(false);
18256
18430
  };
18257
18431
  const clear = () => {
@@ -18279,7 +18453,7 @@ function SDateRangePicker({
18279
18453
  errorMessage: ruleError !== "" ? ruleError : errorMessage,
18280
18454
  width,
18281
18455
  minWidth: dims.fieldMinW,
18282
- maxWidth: dims.fieldMaxW,
18456
+ maxWidth: maxWidth ?? dims.fieldMaxW,
18283
18457
  disabled,
18284
18458
  className,
18285
18459
  style,
@@ -18769,6 +18943,7 @@ function SKeyValueTable({
18769
18943
  search = false,
18770
18944
  radius = "default",
18771
18945
  bordered = true,
18946
+ fieldWidth = "auto",
18772
18947
  onChange,
18773
18948
  onSearch,
18774
18949
  className,
@@ -18782,6 +18957,7 @@ function SKeyValueTable({
18782
18957
  });
18783
18958
  const cellHeight = dense ? "var(--cmp-table-body-dense-height)" : "var(--cmp-table-keyValue-height)";
18784
18959
  const cellPadY = dense ? "var(--cmp-table-body-paddingY-dense)" : "var(--cmp-table-keyValue-body-paddingY)";
18960
+ const fillMaxWidth = fieldWidth === "fill" ? { maxWidth: "100%" } : void 0;
18785
18961
  const renderField = (f) => {
18786
18962
  if (f.render) return f.render;
18787
18963
  const opt = { ...f.options ?? {} };
@@ -18803,9 +18979,9 @@ function SKeyValueTable({
18803
18979
  case "switch":
18804
18980
  return /* @__PURE__ */ jsxRuntime.jsx(SSwitch, { ...opt, onValueChange: up });
18805
18981
  case "date-picker":
18806
- return /* @__PURE__ */ jsxRuntime.jsx(SDatePicker, { width: "100%", ...opt, onValueChange: up });
18982
+ return /* @__PURE__ */ jsxRuntime.jsx(SDatePicker, { width: "100%", ...fillMaxWidth, ...opt, onValueChange: up });
18807
18983
  case "date-range-picker":
18808
- return /* @__PURE__ */ jsxRuntime.jsx(SDateRangePicker, { width: "100%", ...opt, onValueChange: up });
18984
+ return /* @__PURE__ */ jsxRuntime.jsx(SDateRangePicker, { width: "100%", ...fillMaxWidth, ...opt, onValueChange: up });
18809
18985
  case "file-picker":
18810
18986
  return /* @__PURE__ */ jsxRuntime.jsx(SFilePicker, { width: "100%", ...opt, onValueChange: up });
18811
18987
  case "text":
@@ -18813,25 +18989,54 @@ function SKeyValueTable({
18813
18989
  return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[12px] text-[color:var(--sys-color-fg-primary)]", children: opt.value ?? "" });
18814
18990
  }
18815
18991
  };
18816
- const skip = fields.map((row) => row.map(() => false));
18817
- fields.forEach(
18818
- (row, r) => row.forEach((f, c) => {
18819
- const span = f.thRowSpan && f.thRowSpan > 1 ? f.thRowSpan : 1;
18820
- for (let dr = 1; dr < span; dr++) {
18821
- const tr = skip[r + dr];
18822
- if (tr && c < tr.length) tr[c] = true;
18823
- }
18824
- })
18825
- );
18992
+ const grid = fields.map(() => []);
18993
+ const showThAt = fields.map((row) => row.map(() => true));
18994
+ const isLabelCol = [];
18995
+ const labelColWidth = [];
18826
18996
  let maxCols = 0;
18827
- fields.forEach((row, r) => {
18828
- let cols = 0;
18829
- row.forEach((f, c) => {
18830
- const thCols = f.hideTh ? 0 : skip[r]?.[c] ? 1 : f.thColSpan && f.thColSpan > 1 ? f.thColSpan : 1;
18831
- const tdCols = f.tdColSpan && f.tdColSpan > 1 ? f.tdColSpan : 1;
18832
- cols += thCols + tdCols;
18997
+ fields.forEach((row, r2) => {
18998
+ const occupied = grid[r2];
18999
+ let col = 0;
19000
+ const skipOccupied = () => {
19001
+ let sawThSupply = false;
19002
+ while (occupied[col] != null) {
19003
+ if (occupied[col] === "th-supply") sawThSupply = true;
19004
+ col++;
19005
+ }
19006
+ return sawThSupply;
19007
+ };
19008
+ row.forEach((f, i) => {
19009
+ const thRowSpan = f.thRowSpan && f.thRowSpan > 1 ? f.thRowSpan : 1;
19010
+ const thColSpan = f.thColSpan && f.thColSpan > 1 ? f.thColSpan : 1;
19011
+ const tdRowSpan = f.tdRowSpan && f.tdRowSpan > 1 ? f.tdRowSpan : 1;
19012
+ const tdColSpan = f.tdColSpan && f.tdColSpan > 1 ? f.tdColSpan : 1;
19013
+ const thSuppliedAbove = skipOccupied();
19014
+ const showTh = !f.hideTh && !thSuppliedAbove;
19015
+ showThAt[r2][i] = showTh;
19016
+ if (showTh) {
19017
+ isLabelCol[col] = true;
19018
+ if (thColSpan === 1 && f.thWidth != null && labelColWidth[col] == null)
19019
+ labelColWidth[col] = f.thWidth;
19020
+ for (let dr = 1; dr < thRowSpan; dr++) {
19021
+ const kind = dr >= tdRowSpan ? "th-supply" : "blocked";
19022
+ for (let dc = 0; dc < thColSpan; dc++) {
19023
+ const target = grid[r2 + dr];
19024
+ if (target) target[col + dc] = kind;
19025
+ }
19026
+ }
19027
+ col += thColSpan;
19028
+ }
19029
+ skipOccupied();
19030
+ for (let dr = 1; dr < tdRowSpan; dr++) {
19031
+ for (let dc = 0; dc < tdColSpan; dc++) {
19032
+ const target = grid[r2 + dr];
19033
+ if (target) target[col + dc] = "blocked";
19034
+ }
19035
+ }
19036
+ col += tdColSpan;
18833
19037
  });
18834
- if (cols > maxCols) maxCols = cols;
19038
+ skipOccupied();
19039
+ maxCols = Math.max(maxCols, col, occupied.length);
18835
19040
  });
18836
19041
  const radiusClass = radius === "full" ? "rounded-none" : radius === "useTop" ? "rounded-b-[8px] rounded-t-none" : "rounded-[8px]";
18837
19042
  const frameClass = cn(
@@ -18845,19 +19050,14 @@ function SKeyValueTable({
18845
19050
  className: "w-full border-separate border-spacing-0",
18846
19051
  style: { tableLayout: "fixed", ...style },
18847
19052
  children: [
18848
- /* @__PURE__ */ jsxRuntime.jsx("colgroup", { children: Array.from({ length: maxCols }, (_, i) => {
18849
- if (i % 2 !== 0) return /* @__PURE__ */ jsxRuntime.jsx("col", {}, `col-${i}`);
18850
- const fieldIdx = i / 2;
18851
- const fieldThWidth = fields.reduce((found, row) => {
18852
- if (found != null) return found;
18853
- return row[fieldIdx]?.thWidth;
18854
- }, void 0);
18855
- return /* @__PURE__ */ jsxRuntime.jsx("col", { style: { width: cssLen2(fieldThWidth) ?? "120px" } }, `col-${i}`);
18856
- }) }),
18857
- /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: fields.map((row, r) => {
18858
- const cellBorder = r === 0 ? "" : "border-t border-solid border-[color:var(--cmp-table-border-color)]";
19053
+ /* @__PURE__ */ jsxRuntime.jsx("colgroup", { children: Array.from(
19054
+ { length: maxCols },
19055
+ (_, i) => isLabelCol[i] ? /* @__PURE__ */ jsxRuntime.jsx("col", { style: { width: cssLen2(labelColWidth[i]) ?? "120px" } }, `col-${i}`) : /* @__PURE__ */ jsxRuntime.jsx("col", {}, `col-${i}`)
19056
+ ) }),
19057
+ /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: fields.map((row, r2) => {
19058
+ const cellBorder = r2 === 0 ? "" : "border-t border-solid border-[color:var(--cmp-table-border-color)]";
18859
19059
  return /* @__PURE__ */ jsxRuntime.jsx("tr", { children: row.map((f, c) => {
18860
- const showTh = !f.hideTh && !skip[r][c];
19060
+ const showTh = showThAt[r2][c];
18861
19061
  const isReadOnlyCell = f.render == null && (f.type == null || f.type === "text");
18862
19062
  return /* @__PURE__ */ jsxRuntime.jsxs(react.Fragment, { children: [
18863
19063
  showTh && /* @__PURE__ */ jsxRuntime.jsx(
@@ -18893,7 +19093,7 @@ function SKeyValueTable({
18893
19093
  )
18894
19094
  ] })
18895
19095
  },
18896
- `th-${r}-${c}`
19096
+ `th-${r2}-${c}`
18897
19097
  ),
18898
19098
  /* @__PURE__ */ jsxRuntime.jsx(
18899
19099
  "td",
@@ -18910,10 +19110,10 @@ function SKeyValueTable({
18910
19110
  style: { height: cellHeight, paddingTop: cellPadY, paddingBottom: cellPadY },
18911
19111
  children: renderField(f)
18912
19112
  },
18913
- `td-${r}-${c}`
19113
+ `td-${r2}-${c}`
18914
19114
  )
18915
- ] }, `${r}-${c}`);
18916
- }) }, r);
19115
+ ] }, `${r2}-${c}`);
19116
+ }) }, r2);
18917
19117
  }) })
18918
19118
  ]
18919
19119
  }
@@ -18972,6 +19172,7 @@ function ratioOf(value, scale) {
18972
19172
  return (value - scale.min) / span;
18973
19173
  }
18974
19174
  var AXIS_LABEL_GAP = 8;
19175
+ var AXIS_EDGE_PADDING = 24;
18975
19176
  function ChartGrid({ scale, direction, width, height }) {
18976
19177
  const vertical = direction === "vertical";
18977
19178
  return /* @__PURE__ */ jsxRuntime.jsx("g", { "aria-hidden": true, children: scale.ticks.map((tick) => {
@@ -19250,20 +19451,24 @@ function ChartTooltip({
19250
19451
  },
19251
19452
  children: [
19252
19453
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "typo-body-md-bold text-(--cmp-chart-chartTooltip-title-color)", children: title }),
19253
- items.map((item4, index) => (
19254
- // TODO: 토큰 생성되면 gap 을 `--cmp-chart-chartTooltipItem-gap` 으로 교체
19255
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-sd-8", children: [
19256
- /* @__PURE__ */ jsxRuntime.jsx(
19257
- "span",
19258
- {
19259
- "aria-hidden": true,
19260
- className: "shrink-0 rounded-full",
19261
- style: { width: DOT_SIZE2, height: DOT_SIZE2, background: item4.color }
19262
- }
19263
- ),
19264
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "typo-body-sm-default text-(--sys-color-fg-primary)", children: item4.label }),
19265
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "typo-body-sm-bold ml-auto text-(--sys-color-fg-primary)", children: item4.value })
19266
- ] }, `${item4.label}-${index}`)
19454
+ items.map((item4, index) => /* @__PURE__ */ jsxRuntime.jsxs(
19455
+ "span",
19456
+ {
19457
+ className: "flex items-center gap-(--cmp-chart-chartTooltipItem-gap)",
19458
+ children: [
19459
+ /* @__PURE__ */ jsxRuntime.jsx(
19460
+ "span",
19461
+ {
19462
+ "aria-hidden": true,
19463
+ className: "shrink-0 rounded-full",
19464
+ style: { width: DOT_SIZE2, height: DOT_SIZE2, background: item4.color }
19465
+ }
19466
+ ),
19467
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "typo-body-sm-default text-(--cmp-chart-chartTooltipItem-label-color)", children: item4.label }),
19468
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "typo-body-sm-bold ml-auto text-(--cmp-chart-chartTooltipItem-dataValue-color)", children: item4.value })
19469
+ ]
19470
+ },
19471
+ `${item4.label}-${index}`
19267
19472
  ))
19268
19473
  ]
19269
19474
  }
@@ -19276,7 +19481,6 @@ var BAR_SIZE_MAX = 80;
19276
19481
  var BAR_GAP = 6;
19277
19482
  var GROUP_PADDING_MIN = 8;
19278
19483
  var GROUP_PADDING_MAX = 24;
19279
- var AXIS_EDGE_PADDING = 24;
19280
19484
  var VALUE_LABEL_GAP = 6;
19281
19485
  var BAR_RADIUS = 8;
19282
19486
  var BAR_OPACITY_DEFAULT = "var(--cmp-chart-bar-opacity-default)";
@@ -19320,23 +19524,23 @@ function barOpacity(hoveredCategory, categoryIndex) {
19320
19524
  return hoveredCategory === categoryIndex ? BAR_OPACITY_HOVER : BAR_OPACITY_DIMMED;
19321
19525
  }
19322
19526
  function barPath(x, y, width, height, direction, negative) {
19323
- const r = Math.max(0, Math.min(BAR_RADIUS, width / 2, height / 2));
19324
- if (r === 0) return `M${x} ${y}h${width}v${height}h${-width}Z`;
19527
+ const r2 = Math.max(0, Math.min(BAR_RADIUS, width / 2, height / 2));
19528
+ if (r2 === 0) return `M${x} ${y}h${width}v${height}h${-width}Z`;
19325
19529
  if (direction === "vertical") {
19326
19530
  return negative ? (
19327
19531
  // 아래로 자란다 — 아래쪽 두 모서리가 둥글다
19328
- `M${x} ${y}h${width}v${height - r}a${r} ${r} 0 0 1 ${-r} ${r}h${-(width - 2 * r)}a${r} ${r} 0 0 1 ${-r} ${-r}Z`
19532
+ `M${x} ${y}h${width}v${height - r2}a${r2} ${r2} 0 0 1 ${-r2} ${r2}h${-(width - 2 * r2)}a${r2} ${r2} 0 0 1 ${-r2} ${-r2}Z`
19329
19533
  ) : (
19330
19534
  // 위로 자란다 — 위쪽 두 모서리가 둥글다
19331
- `M${x} ${y + height}v${-(height - r)}a${r} ${r} 0 0 1 ${r} ${-r}h${width - 2 * r}a${r} ${r} 0 0 1 ${r} ${r}v${height - r}Z`
19535
+ `M${x} ${y + height}v${-(height - r2)}a${r2} ${r2} 0 0 1 ${r2} ${-r2}h${width - 2 * r2}a${r2} ${r2} 0 0 1 ${r2} ${r2}v${height - r2}Z`
19332
19536
  );
19333
19537
  }
19334
19538
  return negative ? (
19335
19539
  // 왼쪽으로 자란다
19336
- `M${x + width} ${y}h${-(width - r)}a${r} ${r} 0 0 0 ${-r} ${r}v${height - 2 * r}a${r} ${r} 0 0 0 ${r} ${r}h${width - r}Z`
19540
+ `M${x + width} ${y}h${-(width - r2)}a${r2} ${r2} 0 0 0 ${-r2} ${r2}v${height - 2 * r2}a${r2} ${r2} 0 0 0 ${r2} ${r2}h${width - r2}Z`
19337
19541
  ) : (
19338
19542
  // 오른쪽으로 자란다
19339
- `M${x} ${y}h${width - r}a${r} ${r} 0 0 1 ${r} ${r}v${height - 2 * r}a${r} ${r} 0 0 1 ${-r} ${r}h${-(width - r)}Z`
19543
+ `M${x} ${y}h${width - r2}a${r2} ${r2} 0 0 1 ${r2} ${r2}v${height - 2 * r2}a${r2} ${r2} 0 0 1 ${-r2} ${r2}h${-(width - r2)}Z`
19340
19544
  );
19341
19545
  }
19342
19546
  var SBarChart = /* @__PURE__ */ react.forwardRef(function SBarChart2({
@@ -19835,6 +20039,444 @@ var SBarChart = /* @__PURE__ */ react.forwardRef(function SBarChart2({
19835
20039
  }
19836
20040
  );
19837
20041
  });
20042
+
20043
+ // src/components/SLineChart/lineChart.config.ts
20044
+ var LINE_WIDTH = 2;
20045
+ var POINT_RADIUS = 4;
20046
+ var POINT_HOVER_RADIUS = 9.5;
20047
+ var POINT_HOVER_BORDER_WIDTH = 1;
20048
+ var POINT_HOVER_INNER_RADIUS = 5;
20049
+ var POINT_HOVER_BG = "var(--cmp-chart-bg)";
20050
+ var POINT_HOVER_EXTENT = POINT_HOVER_RADIUS + POINT_HOVER_BORDER_WIDTH / 2;
20051
+ var BAND_MIN = 40;
20052
+ var VALUE_LABEL_GAP2 = 6;
20053
+ var AREA_OPACITY = "var(--opacity-040)";
20054
+ var LINE_DATA_LABEL_COLOR = "var(--cmp-chart-bar-dataLabel-color-default)";
20055
+ var LINE_DATA_LABEL_TYPO = "typo-body-sm-medium";
20056
+ var LINE_DATA_LABEL_TYPO_HOVER = "typo-body-md-bold";
20057
+ var r = (value) => Math.round(value * 100) / 100;
20058
+ function tangents(points) {
20059
+ const n = points.length;
20060
+ const slopes = [];
20061
+ for (let i = 0; i < n - 1; i += 1) {
20062
+ const dx = points[i + 1].x - points[i].x;
20063
+ slopes.push(dx === 0 ? 0 : (points[i + 1].y - points[i].y) / dx);
20064
+ }
20065
+ const m = new Array(n).fill(0);
20066
+ m[0] = slopes[0] ?? 0;
20067
+ m[n - 1] = slopes[n - 2] ?? 0;
20068
+ for (let i = 1; i < n - 1; i += 1) {
20069
+ const prev = slopes[i - 1];
20070
+ const next = slopes[i];
20071
+ m[i] = prev * next <= 0 ? 0 : (prev + next) / 2;
20072
+ }
20073
+ for (let i = 0; i < n - 1; i += 1) {
20074
+ const slope = slopes[i];
20075
+ if (slope === 0) {
20076
+ m[i] = 0;
20077
+ m[i + 1] = 0;
20078
+ continue;
20079
+ }
20080
+ const a = m[i] / slope;
20081
+ const b = m[i + 1] / slope;
20082
+ const scale = Math.hypot(a, b);
20083
+ if (scale > 3) {
20084
+ m[i] = 3 * a / scale * slope;
20085
+ m[i + 1] = 3 * b / scale * slope;
20086
+ }
20087
+ }
20088
+ return m;
20089
+ }
20090
+ function commands(points, smooth) {
20091
+ if (points.length < 2) return "";
20092
+ if (!smooth) {
20093
+ return points.slice(1).map((p) => `L${r(p.x)} ${r(p.y)}`).join("");
20094
+ }
20095
+ const m = tangents(points);
20096
+ let path = "";
20097
+ for (let i = 0; i < points.length - 1; i += 1) {
20098
+ const from = points[i];
20099
+ const to = points[i + 1];
20100
+ const dx = (to.x - from.x) / 3;
20101
+ path += `C${r(from.x + dx)} ${r(from.y + m[i] * dx)} ${r(to.x - dx)} ${r(to.y - m[i + 1] * dx)} ${r(to.x)} ${r(to.y)}`;
20102
+ }
20103
+ return path;
20104
+ }
20105
+ function linePath(points, smooth) {
20106
+ const first = points[0];
20107
+ if (!first || points.length < 2) return "";
20108
+ return `M${r(first.x)} ${r(first.y)}${commands(points, smooth)}`;
20109
+ }
20110
+ function areaPath(top, bottom, smooth) {
20111
+ const first = top[0];
20112
+ if (!first || top.length < 2 || bottom.length !== top.length) return "";
20113
+ const back = [...bottom].reverse();
20114
+ return `M${r(first.x)} ${r(first.y)}${commands(top, smooth)}L${r(back[0].x)} ${r(back[0].y)}${commands(back, smooth)}Z`;
20115
+ }
20116
+ var defaultFormat2 = (value) => value.toLocaleString();
20117
+ function runsOf(row) {
20118
+ const runs = [];
20119
+ let current = [];
20120
+ for (const point of row) {
20121
+ if (point == null) {
20122
+ if (current.length > 0) runs.push(current);
20123
+ current = [];
20124
+ continue;
20125
+ }
20126
+ current.push(point);
20127
+ }
20128
+ if (current.length > 0) runs.push(current);
20129
+ return runs;
20130
+ }
20131
+ var SLineChart = /* @__PURE__ */ react.forwardRef(function SLineChart2({
20132
+ categories,
20133
+ series,
20134
+ curve = "linear",
20135
+ area = false,
20136
+ stacked = false,
20137
+ palette = "default",
20138
+ colors: customColors,
20139
+ max,
20140
+ tickCount = 8,
20141
+ showPoint = true,
20142
+ showValueLabel = false,
20143
+ showLegend = true,
20144
+ legendPosition = "top",
20145
+ showTooltip = true,
20146
+ formatValue = defaultFormat2,
20147
+ height,
20148
+ onPointClick,
20149
+ className,
20150
+ style
20151
+ }, ref) {
20152
+ const smooth = curve === "smooth";
20153
+ const { ref: plotRef, size } = useElementSize();
20154
+ const { ref: axisTextRef, size: axisText } = useElementSize();
20155
+ const { ref: axisSampleRef, size: axisSample } = useElementSize();
20156
+ const [hoveredCategory, setHoveredCategory] = react.useState(null);
20157
+ const colorAt = react.useCallback(
20158
+ (seriesIndex) => paletteColor(palette, seriesIndex, customColors),
20159
+ [palette, customColors]
20160
+ );
20161
+ const rows = react.useMemo(() => {
20162
+ const running = categories.map(() => 0);
20163
+ return series.map(
20164
+ (s) => categories.map((_, categoryIndex) => {
20165
+ const raw = s.data[categoryIndex];
20166
+ if (raw == null || !Number.isFinite(raw)) return null;
20167
+ if (!stacked) return { value: raw, base: 0, own: raw };
20168
+ const base = running[categoryIndex];
20169
+ running[categoryIndex] = base + raw;
20170
+ return { value: base + raw, base, own: raw };
20171
+ })
20172
+ );
20173
+ }, [series, categories, stacked]);
20174
+ const scale = react.useMemo(
20175
+ () => niceScale(
20176
+ // 누적은 쌓아 올린 값까지 축에 들어와야 맨 위 선이 눈금 밖으로 나가지 않는다.
20177
+ rows.flatMap((row) => row.flatMap((point) => point == null ? [] : [point.value, point.base])),
20178
+ tickCount,
20179
+ max
20180
+ ),
20181
+ [rows, tickCount, max]
20182
+ );
20183
+ const band = categories.length > 0 ? Math.max(0, size.width - AXIS_EDGE_PADDING * 2) / categories.length : 0;
20184
+ const minPlotWidth = categories.length * BAND_MIN + AXIS_EDGE_PADDING * 2;
20185
+ const totalHeight = height ?? 320;
20186
+ const plotHeight = typeof totalHeight === "number" ? Math.max(0, totalHeight - axisText.height) : `calc(${totalHeight} - ${axisText.height}px)`;
20187
+ const plotted = react.useMemo(() => {
20188
+ if (size.width <= 0 || size.height <= 0) return [];
20189
+ const xOf = (index) => AXIS_EDGE_PADDING + (index + 0.5) * band;
20190
+ const yOf = (value) => size.height - ratioOf(value, scale) * size.height;
20191
+ return rows.map(
20192
+ (row) => row.map(
20193
+ (point, categoryIndex) => point == null ? null : { x: xOf(categoryIndex), y: yOf(point.value), baseY: yOf(point.base), own: point.own }
20194
+ )
20195
+ );
20196
+ }, [rows, size.width, size.height, band, scale]);
20197
+ const legend = showLegend ? /* @__PURE__ */ jsxRuntime.jsx(ChartLegend, { items: series.map((s, i) => ({ name: s.name, color: colorAt(i) })) }) : null;
20198
+ const handleMove = (event) => {
20199
+ if (!showTooltip || band <= 0 || series.length === 0) return;
20200
+ const rect = event.currentTarget.getBoundingClientRect();
20201
+ const along = event.clientX - rect.left - AXIS_EDGE_PADDING;
20202
+ const category = Math.floor(along / band);
20203
+ setHoveredCategory(category >= 0 && category < categories.length ? category : null);
20204
+ };
20205
+ const tooltipItems = hoveredCategory == null ? [] : rows.flatMap((row, seriesIndex) => {
20206
+ const point = row[hoveredCategory];
20207
+ if (point == null) return [];
20208
+ return [
20209
+ {
20210
+ color: colorAt(seriesIndex),
20211
+ label: series[seriesIndex]?.name ?? "",
20212
+ value: formatValue(point.own)
20213
+ }
20214
+ ];
20215
+ });
20216
+ const anchorTop = react.useMemo(() => {
20217
+ if (hoveredCategory == null || plotted.length === 0) return null;
20218
+ let top = Number.POSITIVE_INFINITY;
20219
+ for (const row of plotted) {
20220
+ const point = row[hoveredCategory];
20221
+ if (point != null) top = Math.min(top, point.y);
20222
+ }
20223
+ return Number.isFinite(top) ? top : null;
20224
+ }, [hoveredCategory, plotted]);
20225
+ const { ref: valueLabelRef, metrics: valueLabel } = useSvgTextMetrics();
20226
+ const tooltipAnchor = react.useMemo(() => {
20227
+ if (hoveredCategory == null || anchorTop == null) return null;
20228
+ const left = AXIS_EDGE_PADDING + hoveredCategory * band;
20229
+ const top = showValueLabel ? anchorTop - POINT_RADIUS - VALUE_LABEL_GAP2 + valueLabel.top : anchorTop - POINT_HOVER_EXTENT;
20230
+ return { left, right: left + band, top };
20231
+ }, [hoveredCategory, anchorTop, band, showValueLabel, valueLabel.top]);
20232
+ const categoryLabels = /* @__PURE__ */ jsxRuntime.jsxs(
20233
+ "div",
20234
+ {
20235
+ "aria-hidden": true,
20236
+ className: "relative w-full typo-body-sm-medium text-(--cmp-chart-axis-color)",
20237
+ style: { minWidth: minPlotWidth || void 0 },
20238
+ children: [
20239
+ categories.map((label, index) => /* @__PURE__ */ jsxRuntime.jsx(
20240
+ "span",
20241
+ {
20242
+ className: "absolute top-0 -translate-x-1/2 whitespace-nowrap",
20243
+ style: { left: AXIS_EDGE_PADDING + (index + 0.5) * band },
20244
+ children: label
20245
+ },
20246
+ `${label}-${index}`
20247
+ )),
20248
+ /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, className: "invisible block whitespace-nowrap", children: "0" })
20249
+ ]
20250
+ }
20251
+ );
20252
+ const areas = react.useMemo(() => {
20253
+ if (!area) return [];
20254
+ return plotted.flatMap(
20255
+ (row, seriesIndex) => runsOf(row).map((run, runIndex) => {
20256
+ const d = areaPath(
20257
+ run,
20258
+ run.map((p) => ({ x: p.x, y: p.baseY })),
20259
+ smooth
20260
+ );
20261
+ if (!d) return null;
20262
+ return /* @__PURE__ */ jsxRuntime.jsx(
20263
+ "path",
20264
+ {
20265
+ "aria-hidden": true,
20266
+ d,
20267
+ style: { fill: colorAt(seriesIndex), fillOpacity: AREA_OPACITY }
20268
+ },
20269
+ `area-${seriesIndex}-${runIndex}`
20270
+ );
20271
+ })
20272
+ );
20273
+ }, [area, plotted, smooth, colorAt]);
20274
+ const lines = react.useMemo(
20275
+ () => plotted.flatMap(
20276
+ (row, seriesIndex) => runsOf(row).map((run, runIndex) => {
20277
+ const d = linePath(run, smooth);
20278
+ if (!d) return null;
20279
+ return /* @__PURE__ */ jsxRuntime.jsx(
20280
+ "path",
20281
+ {
20282
+ "aria-hidden": true,
20283
+ d,
20284
+ fill: "none",
20285
+ strokeWidth: LINE_WIDTH,
20286
+ strokeLinecap: "round",
20287
+ strokeLinejoin: "round",
20288
+ style: { stroke: colorAt(seriesIndex) }
20289
+ },
20290
+ `line-${seriesIndex}-${runIndex}`
20291
+ );
20292
+ })
20293
+ ),
20294
+ [plotted, smooth, colorAt]
20295
+ );
20296
+ const { pointHalos, pointDots } = react.useMemo(() => {
20297
+ const halos = [];
20298
+ const dots = [];
20299
+ plotted.forEach((row, seriesIndex) => {
20300
+ row.forEach((point, categoryIndex) => {
20301
+ if (point == null) return;
20302
+ const hovered = hoveredCategory === categoryIndex;
20303
+ if (!showPoint && !hovered) return;
20304
+ const color = colorAt(seriesIndex);
20305
+ const key = `${seriesIndex}-${categoryIndex}`;
20306
+ if (hovered) {
20307
+ halos.push(
20308
+ /* @__PURE__ */ jsxRuntime.jsx(
20309
+ "circle",
20310
+ {
20311
+ "aria-hidden": true,
20312
+ cx: point.x,
20313
+ cy: point.y,
20314
+ r: POINT_HOVER_RADIUS,
20315
+ style: {
20316
+ fill: POINT_HOVER_BG,
20317
+ stroke: color,
20318
+ strokeWidth: POINT_HOVER_BORDER_WIDTH
20319
+ }
20320
+ },
20321
+ `halo-${key}`
20322
+ )
20323
+ );
20324
+ }
20325
+ dots.push(
20326
+ /* @__PURE__ */ jsxRuntime.jsx(
20327
+ "circle",
20328
+ {
20329
+ cx: point.x,
20330
+ cy: point.y,
20331
+ r: hovered ? POINT_HOVER_INNER_RADIUS : POINT_RADIUS,
20332
+ style: { fill: color, cursor: onPointClick ? "pointer" : void 0 },
20333
+ onClick: onPointClick ? () => onPointClick({ seriesIndex, categoryIndex, value: point.own }) : void 0,
20334
+ children: /* @__PURE__ */ jsxRuntime.jsx("title", { children: `${categories[categoryIndex]} ${series[seriesIndex]?.name ?? ""} ${formatValue(point.own)}` })
20335
+ },
20336
+ `dot-${key}`
20337
+ )
20338
+ );
20339
+ });
20340
+ });
20341
+ return { pointHalos: halos, pointDots: dots };
20342
+ }, [plotted, showPoint, hoveredCategory, colorAt, onPointClick, categories, series, formatValue]);
20343
+ const valueLabels = react.useMemo(
20344
+ () => showValueLabel ? plotted.flatMap(
20345
+ (row, seriesIndex) => row.map(
20346
+ (point, categoryIndex) => point == null ? null : /* @__PURE__ */ jsxRuntime.jsx(
20347
+ "text",
20348
+ {
20349
+ x: point.x,
20350
+ y: point.y - POINT_RADIUS - VALUE_LABEL_GAP2,
20351
+ className: hoveredCategory === categoryIndex ? LINE_DATA_LABEL_TYPO_HOVER : LINE_DATA_LABEL_TYPO,
20352
+ style: { fill: LINE_DATA_LABEL_COLOR },
20353
+ textAnchor: "middle",
20354
+ dominantBaseline: "auto",
20355
+ children: formatValue(point.own)
20356
+ },
20357
+ `label-${seriesIndex}-${categoryIndex}`
20358
+ )
20359
+ )
20360
+ ) : [],
20361
+ [showValueLabel, plotted, hoveredCategory, formatValue]
20362
+ );
20363
+ const inset = { paddingTop: axisSample.height / 2, paddingBottom: axisSample.height / 2 };
20364
+ return /* @__PURE__ */ jsxRuntime.jsx(
20365
+ ChartFrame,
20366
+ {
20367
+ ref,
20368
+ legend,
20369
+ legendPosition,
20370
+ className,
20371
+ style,
20372
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
20373
+ "div",
20374
+ {
20375
+ className: "grid",
20376
+ style: {
20377
+ columnGap: AXIS_LABEL_GAP,
20378
+ // 눈금은 왼쪽 한 줄뿐이다 — 오른쪽에도 적으면 서로 다른 단위처럼 읽힌다.
20379
+ gridTemplateColumns: "max-content 1fr"
20380
+ },
20381
+ children: [
20382
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: { height: plotHeight, ...inset }, children: /* @__PURE__ */ jsxRuntime.jsx(
20383
+ ChartAxisLabels,
20384
+ {
20385
+ scale,
20386
+ direction: "vertical",
20387
+ format: formatValue,
20388
+ sampleRef: axisSampleRef
20389
+ }
20390
+ ) }),
20391
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 overflow-x-auto", children: [
20392
+ /* @__PURE__ */ jsxRuntime.jsx(
20393
+ "div",
20394
+ {
20395
+ className: "relative min-w-0",
20396
+ style: { height: plotHeight, minWidth: minPlotWidth || void 0, ...inset },
20397
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
20398
+ "div",
20399
+ {
20400
+ ref: plotRef,
20401
+ className: "relative h-full w-full",
20402
+ onMouseMove: handleMove,
20403
+ onMouseLeave: () => setHoveredCategory(null),
20404
+ children: [
20405
+ size.width > 0 && size.height > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
20406
+ "svg",
20407
+ {
20408
+ width: size.width,
20409
+ height: size.height,
20410
+ role: "img",
20411
+ "aria-label": `${categories.length}\uAC1C \uD56D\uBAA9, ${series.length}\uAC1C \uACC4\uC5F4 ${stacked ? "\uB204\uC801 " : ""}\uAEBE\uC740\uC120 \uADF8\uB798\uD504`,
20412
+ children: [
20413
+ /* @__PURE__ */ jsxRuntime.jsx(
20414
+ "text",
20415
+ {
20416
+ ref: valueLabelRef,
20417
+ "aria-hidden": true,
20418
+ x: 0,
20419
+ y: 0,
20420
+ className: LINE_DATA_LABEL_TYPO_HOVER,
20421
+ dominantBaseline: "auto",
20422
+ style: { visibility: "hidden" },
20423
+ children: "0"
20424
+ }
20425
+ ),
20426
+ /* @__PURE__ */ jsxRuntime.jsx(
20427
+ ChartGrid,
20428
+ {
20429
+ scale,
20430
+ direction: "vertical",
20431
+ width: size.width,
20432
+ height: size.height
20433
+ }
20434
+ ),
20435
+ hoveredCategory != null && /* @__PURE__ */ jsxRuntime.jsx(
20436
+ "rect",
20437
+ {
20438
+ "aria-hidden": true,
20439
+ x: AXIS_EDGE_PADDING + hoveredCategory * band,
20440
+ y: 0,
20441
+ width: band,
20442
+ height: size.height,
20443
+ style: {
20444
+ fill: "var(--cmp-chart-barContainer-hover-bg)",
20445
+ fillOpacity: "var(--cmp-chart-barContainer-hover-opacity)"
20446
+ }
20447
+ }
20448
+ ),
20449
+ areas,
20450
+ lines,
20451
+ pointHalos,
20452
+ pointDots,
20453
+ valueLabels
20454
+ ]
20455
+ }
20456
+ ),
20457
+ showTooltip && hoveredCategory != null && tooltipAnchor != null && tooltipItems.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
20458
+ ChartTooltip,
20459
+ {
20460
+ title: categories[hoveredCategory] ?? "",
20461
+ items: tooltipItems,
20462
+ anchor: tooltipAnchor,
20463
+ bounds: size,
20464
+ gapX: { after: -4, before: -4 }
20465
+ }
20466
+ )
20467
+ ]
20468
+ }
20469
+ )
20470
+ }
20471
+ ),
20472
+ /* @__PURE__ */ jsxRuntime.jsx("div", { ref: axisTextRef, children: categoryLabels })
20473
+ ] })
20474
+ ]
20475
+ }
20476
+ )
20477
+ }
20478
+ );
20479
+ });
19838
20480
  var BUTTON_STYLE = {
19839
20481
  default: { color: "secondary" },
19840
20482
  danger: { color: "danger", outline: true },
@@ -21117,7 +21759,7 @@ var PaletteItem = ({
21117
21759
  className,
21118
21760
  onSelect,
21119
21761
  children
21120
- }) => asMenu ? /* @__PURE__ */ jsxRuntime.jsx(RDropdown2__namespace.Item, { title: label, "aria-label": label, className, onSelect, children }) : /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", title: label, "aria-label": label, className, onClick: onSelect, children });
21762
+ }) => asMenu ? /* @__PURE__ */ jsxRuntime.jsx(RDropdown3__namespace.Item, { title: label, "aria-label": label, className, onSelect, children }) : /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", title: label, "aria-label": label, className, onClick: onSelect, children });
21121
21763
  var ColorPalette = ({
21122
21764
  colors,
21123
21765
  columns,
@@ -21203,14 +21845,14 @@ var TableSizePicker = ({
21203
21845
  onPick(size.rows, size.cols);
21204
21846
  }
21205
21847
  },
21206
- children: Array.from({ length: TABLE_PICKER_ROWS }, (_, r) => /* @__PURE__ */ jsxRuntime.jsx("div", { role: "row", className: "flex", style: { gap: TABLE_PICKER_GAP }, children: Array.from({ length: TABLE_PICKER_COLS }, (_2, c) => {
21207
- const on = r < size.rows && c < size.cols;
21848
+ children: Array.from({ length: TABLE_PICKER_ROWS }, (_, r2) => /* @__PURE__ */ jsxRuntime.jsx("div", { role: "row", className: "flex", style: { gap: TABLE_PICKER_GAP }, children: Array.from({ length: TABLE_PICKER_COLS }, (_2, c) => {
21849
+ const on = r2 < size.rows && c < size.cols;
21208
21850
  return /* @__PURE__ */ jsxRuntime.jsx(
21209
21851
  "button",
21210
21852
  {
21211
21853
  type: "button",
21212
21854
  role: "gridcell",
21213
- "aria-label": `${r + 1}\uD589 ${c + 1}\uC5F4`,
21855
+ "aria-label": `${r2 + 1}\uD589 ${c + 1}\uC5F4`,
21214
21856
  "aria-selected": on,
21215
21857
  tabIndex: -1,
21216
21858
  className: "box-border cursor-pointer rounded-[3px] border border-solid p-0 outline-none",
@@ -21220,13 +21862,13 @@ var TableSizePicker = ({
21220
21862
  borderColor: on ? "var(--sys-color-bg-accent)" : "var(--sys-color-border-default)",
21221
21863
  background: on ? "var(--color-bg-accentFaint)" : "transparent"
21222
21864
  },
21223
- onMouseEnter: () => setSize({ rows: r + 1, cols: c + 1 }),
21224
- onFocus: () => setSize({ rows: r + 1, cols: c + 1 }),
21225
- onClick: () => onPick(r + 1, c + 1)
21865
+ onMouseEnter: () => setSize({ rows: r2 + 1, cols: c + 1 }),
21866
+ onFocus: () => setSize({ rows: r2 + 1, cols: c + 1 }),
21867
+ onClick: () => onPick(r2 + 1, c + 1)
21226
21868
  },
21227
21869
  c
21228
21870
  );
21229
- }) }, r))
21871
+ }) }, r2))
21230
21872
  }
21231
21873
  ),
21232
21874
  /* @__PURE__ */ jsxRuntime.jsxs(
@@ -21249,7 +21891,7 @@ var TableMenuItem = ({
21249
21891
  disabled,
21250
21892
  onSelect
21251
21893
  }) => /* @__PURE__ */ jsxRuntime.jsx(
21252
- RDropdown2__namespace.Item,
21894
+ RDropdown3__namespace.Item,
21253
21895
  {
21254
21896
  className: cn(menuItemClass, menuItemDisabledClass),
21255
21897
  disabled,
@@ -21416,8 +22058,8 @@ function EditorToolbarBar({
21416
22058
  const node = (item4) => {
21417
22059
  switch (item4) {
21418
22060
  case "heading":
21419
- return /* @__PURE__ */ jsxRuntime.jsxs(RDropdown2__namespace.Root, { modal: !insideModal, children: [
21420
- /* @__PURE__ */ jsxRuntime.jsx(RDropdown2__namespace.Trigger, { asChild: true, disabled: off, children: /* @__PURE__ */ jsxRuntime.jsxs(
22061
+ return /* @__PURE__ */ jsxRuntime.jsxs(RDropdown3__namespace.Root, { modal: !insideModal, children: [
22062
+ /* @__PURE__ */ jsxRuntime.jsx(RDropdown3__namespace.Trigger, { asChild: true, disabled: off, children: /* @__PURE__ */ jsxRuntime.jsxs(
21421
22063
  ToolbarButton,
21422
22064
  {
21423
22065
  label: "\uC81C\uBAA9 \uB2E8\uACC4",
@@ -21430,9 +22072,9 @@ function EditorToolbarBar({
21430
22072
  ]
21431
22073
  }
21432
22074
  ) }),
21433
- /* @__PURE__ */ jsxRuntime.jsx(RDropdown2__namespace.Portal, { container: portalContainer, children: /* @__PURE__ */ jsxRuntime.jsxs(RDropdown2__namespace.Content, { sideOffset: 4, align: "start", className: menuClass, children: [
22075
+ /* @__PURE__ */ jsxRuntime.jsx(RDropdown3__namespace.Portal, { container: portalContainer, children: /* @__PURE__ */ jsxRuntime.jsxs(RDropdown3__namespace.Content, { sideOffset: 4, align: "start", className: menuClass, children: [
21434
22076
  /* @__PURE__ */ jsxRuntime.jsx(
21435
- RDropdown2__namespace.Item,
22077
+ RDropdown3__namespace.Item,
21436
22078
  {
21437
22079
  className: menuItemClass,
21438
22080
  onSelect: () => chain()?.setParagraph().run(),
@@ -21440,7 +22082,7 @@ function EditorToolbarBar({
21440
22082
  }
21441
22083
  ),
21442
22084
  SEDITOR_HEADING_LEVELS.map((level) => /* @__PURE__ */ jsxRuntime.jsx(
21443
- RDropdown2__namespace.Item,
22085
+ RDropdown3__namespace.Item,
21444
22086
  {
21445
22087
  className: menuItemClass,
21446
22088
  onSelect: () => chain()?.setHeading({ level }).run(),
@@ -21451,13 +22093,13 @@ function EditorToolbarBar({
21451
22093
  ] }) })
21452
22094
  ] }, item4);
21453
22095
  case "fontSize":
21454
- return /* @__PURE__ */ jsxRuntime.jsxs(RDropdown2__namespace.Root, { modal: !insideModal, children: [
21455
- /* @__PURE__ */ jsxRuntime.jsx(RDropdown2__namespace.Trigger, { asChild: true, disabled: off, children: /* @__PURE__ */ jsxRuntime.jsxs(ToolbarButton, { label: "\uAE00\uC790 \uD06C\uAE30", disabled: off, className: "px-[6px]", children: [
22096
+ return /* @__PURE__ */ jsxRuntime.jsxs(RDropdown3__namespace.Root, { modal: !insideModal, children: [
22097
+ /* @__PURE__ */ jsxRuntime.jsx(RDropdown3__namespace.Trigger, { asChild: true, disabled: off, children: /* @__PURE__ */ jsxRuntime.jsxs(ToolbarButton, { label: "\uAE00\uC790 \uD06C\uAE30", disabled: off, className: "px-[6px]", children: [
21456
22098
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[12px] leading-[20px]", children: activeFontSize ?? FONT_SIZE_DEFAULT_LABEL }),
21457
22099
  /* @__PURE__ */ jsxRuntime.jsx(SIcon, { name: "caretDown", size: 12 })
21458
22100
  ] }) }),
21459
- /* @__PURE__ */ jsxRuntime.jsx(RDropdown2__namespace.Portal, { container: portalContainer, children: /* @__PURE__ */ jsxRuntime.jsxs(
21460
- RDropdown2__namespace.Content,
22101
+ /* @__PURE__ */ jsxRuntime.jsx(RDropdown3__namespace.Portal, { container: portalContainer, children: /* @__PURE__ */ jsxRuntime.jsxs(
22102
+ RDropdown3__namespace.Content,
21461
22103
  {
21462
22104
  sideOffset: 4,
21463
22105
  align: "start",
@@ -21465,7 +22107,7 @@ function EditorToolbarBar({
21465
22107
  style: { maxHeight: FONT_SIZE_MENU_MAX_HEIGHT },
21466
22108
  children: [
21467
22109
  /* @__PURE__ */ jsxRuntime.jsx(
21468
- RDropdown2__namespace.Item,
22110
+ RDropdown3__namespace.Item,
21469
22111
  {
21470
22112
  className: cn(menuItemClass, activeFontSize === null && menuItemSelectedClass),
21471
22113
  title: `${FONT_SIZE_DEFAULT_LABEL} (\uBCF8\uBB38 ${SEDITOR_DEFAULT_FONT_SIZE}px)`,
@@ -21474,7 +22116,7 @@ function EditorToolbarBar({
21474
22116
  }
21475
22117
  ),
21476
22118
  SEDITOR_FONT_SIZES.map((size) => /* @__PURE__ */ jsxRuntime.jsx(
21477
- RDropdown2__namespace.Item,
22119
+ RDropdown3__namespace.Item,
21478
22120
  {
21479
22121
  ref: activeFontSize === size ? (el) => {
21480
22122
  el?.scrollIntoView({ block: "nearest" });
@@ -21566,9 +22208,9 @@ function EditorToolbarBar({
21566
22208
  },
21567
22209
  item4
21568
22210
  );
21569
- return /* @__PURE__ */ jsxRuntime.jsxs(RDropdown2__namespace.Root, { modal: !insideModal, children: [
21570
- /* @__PURE__ */ jsxRuntime.jsx(RDropdown2__namespace.Trigger, { asChild: true, disabled: off, children: /* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { label: "\uAE00\uC790\uC0C9", disabled: off, children: /* @__PURE__ */ jsxRuntime.jsx(ColorIndicator, { color: off ? "currentColor" : activeColor, children: /* @__PURE__ */ jsxRuntime.jsx(IconTextColor, { size: ICON_SIZE }) }) }) }),
21571
- /* @__PURE__ */ jsxRuntime.jsx(RDropdown2__namespace.Portal, { container: portalContainer, children: /* @__PURE__ */ jsxRuntime.jsx(RDropdown2__namespace.Content, { sideOffset: 4, align: "start", className: menuClass, children: /* @__PURE__ */ jsxRuntime.jsx(
22211
+ return /* @__PURE__ */ jsxRuntime.jsxs(RDropdown3__namespace.Root, { modal: !insideModal, children: [
22212
+ /* @__PURE__ */ jsxRuntime.jsx(RDropdown3__namespace.Trigger, { asChild: true, disabled: off, children: /* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { label: "\uAE00\uC790\uC0C9", disabled: off, children: /* @__PURE__ */ jsxRuntime.jsx(ColorIndicator, { color: off ? "currentColor" : activeColor, children: /* @__PURE__ */ jsxRuntime.jsx(IconTextColor, { size: ICON_SIZE }) }) }) }),
22213
+ /* @__PURE__ */ jsxRuntime.jsx(RDropdown3__namespace.Portal, { container: portalContainer, children: /* @__PURE__ */ jsxRuntime.jsx(RDropdown3__namespace.Content, { sideOffset: 4, align: "start", className: menuClass, children: /* @__PURE__ */ jsxRuntime.jsx(
21572
22214
  ColorPalette,
21573
22215
  {
21574
22216
  asMenu: true,
@@ -21674,14 +22316,14 @@ function EditorToolbarBar({
21674
22316
  case "list": {
21675
22317
  const ListIcon = state2.orderedList ? IconOrderedList : state2.taskList ? IconTaskList : IconBulletList;
21676
22318
  const listActive = state2.bulletList || state2.orderedList || state2.taskList;
21677
- return /* @__PURE__ */ jsxRuntime.jsxs(RDropdown2__namespace.Root, { modal: !insideModal, children: [
21678
- /* @__PURE__ */ jsxRuntime.jsx(RDropdown2__namespace.Trigger, { asChild: true, disabled: off, children: /* @__PURE__ */ jsxRuntime.jsxs(ToolbarButton, { label: "\uBAA9\uB85D", active: listActive, disabled: off, className: "px-[4px]", children: [
22319
+ return /* @__PURE__ */ jsxRuntime.jsxs(RDropdown3__namespace.Root, { modal: !insideModal, children: [
22320
+ /* @__PURE__ */ jsxRuntime.jsx(RDropdown3__namespace.Trigger, { asChild: true, disabled: off, children: /* @__PURE__ */ jsxRuntime.jsxs(ToolbarButton, { label: "\uBAA9\uB85D", active: listActive, disabled: off, className: "px-[4px]", children: [
21679
22321
  /* @__PURE__ */ jsxRuntime.jsx(ListIcon, { size: ICON_SIZE }),
21680
22322
  /* @__PURE__ */ jsxRuntime.jsx(SIcon, { name: "caretDown", size: CARET_SIZE })
21681
22323
  ] }) }),
21682
- /* @__PURE__ */ jsxRuntime.jsx(RDropdown2__namespace.Portal, { container: portalContainer, children: /* @__PURE__ */ jsxRuntime.jsxs(RDropdown2__namespace.Content, { sideOffset: 4, align: "start", className: menuClass, children: [
22324
+ /* @__PURE__ */ jsxRuntime.jsx(RDropdown3__namespace.Portal, { container: portalContainer, children: /* @__PURE__ */ jsxRuntime.jsxs(RDropdown3__namespace.Content, { sideOffset: 4, align: "start", className: menuClass, children: [
21683
22325
  /* @__PURE__ */ jsxRuntime.jsxs(
21684
- RDropdown2__namespace.Item,
22326
+ RDropdown3__namespace.Item,
21685
22327
  {
21686
22328
  className: menuItemClass,
21687
22329
  onSelect: () => chain()?.toggleBulletList().run(),
@@ -21692,7 +22334,7 @@ function EditorToolbarBar({
21692
22334
  }
21693
22335
  ),
21694
22336
  /* @__PURE__ */ jsxRuntime.jsxs(
21695
- RDropdown2__namespace.Item,
22337
+ RDropdown3__namespace.Item,
21696
22338
  {
21697
22339
  className: menuItemClass,
21698
22340
  onSelect: () => chain()?.toggleOrderedList().run(),
@@ -21703,7 +22345,7 @@ function EditorToolbarBar({
21703
22345
  }
21704
22346
  ),
21705
22347
  /* @__PURE__ */ jsxRuntime.jsxs(
21706
- RDropdown2__namespace.Item,
22348
+ RDropdown3__namespace.Item,
21707
22349
  {
21708
22350
  className: menuItemClass,
21709
22351
  onSelect: () => chain()?.toggleTaskList().run(),
@@ -21807,17 +22449,17 @@ function EditorToolbarBar({
21807
22449
  );
21808
22450
  case "table":
21809
22451
  return /* @__PURE__ */ jsxRuntime.jsxs(
21810
- RDropdown2__namespace.Root,
22452
+ RDropdown3__namespace.Root,
21811
22453
  {
21812
22454
  open: tableOpen,
21813
22455
  onOpenChange: setTableOpen,
21814
22456
  modal: !insideModal,
21815
22457
  children: [
21816
- /* @__PURE__ */ jsxRuntime.jsx(RDropdown2__namespace.Trigger, { asChild: true, disabled: off, children: /* @__PURE__ */ jsxRuntime.jsxs(ToolbarButton, { label: "\uD45C", active: state2.inTable, disabled: off, className: "px-[6px]", children: [
22458
+ /* @__PURE__ */ jsxRuntime.jsx(RDropdown3__namespace.Trigger, { asChild: true, disabled: off, children: /* @__PURE__ */ jsxRuntime.jsxs(ToolbarButton, { label: "\uD45C", active: state2.inTable, disabled: off, className: "px-[6px]", children: [
21817
22459
  /* @__PURE__ */ jsxRuntime.jsx(IconTable, { size: ICON_SIZE }),
21818
22460
  /* @__PURE__ */ jsxRuntime.jsx(SIcon, { name: "caretDown", size: CARET_SIZE })
21819
22461
  ] }) }),
21820
- /* @__PURE__ */ jsxRuntime.jsx(RDropdown2__namespace.Portal, { container: portalContainer, children: /* @__PURE__ */ jsxRuntime.jsxs(RDropdown2__namespace.Content, { sideOffset: 4, align: "start", className: menuClass, children: [
22462
+ /* @__PURE__ */ jsxRuntime.jsx(RDropdown3__namespace.Portal, { container: portalContainer, children: /* @__PURE__ */ jsxRuntime.jsxs(RDropdown3__namespace.Content, { sideOffset: 4, align: "start", className: menuClass, children: [
21821
22463
  !state2.inTable && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
21822
22464
  /* @__PURE__ */ jsxRuntime.jsx(
21823
22465
  TableSizePicker,
@@ -21829,7 +22471,7 @@ function EditorToolbarBar({
21829
22471
  }
21830
22472
  }
21831
22473
  ),
21832
- /* @__PURE__ */ jsxRuntime.jsx(RDropdown2__namespace.Separator, { className: menuSeparatorClass })
22474
+ /* @__PURE__ */ jsxRuntime.jsx(RDropdown3__namespace.Separator, { className: menuSeparatorClass })
21833
22475
  ] }),
21834
22476
  /* @__PURE__ */ jsxRuntime.jsx(
21835
22477
  TableMenuItem,
@@ -21863,7 +22505,7 @@ function EditorToolbarBar({
21863
22505
  onSelect: () => chain()?.addColumnAfter().run()
21864
22506
  }
21865
22507
  ),
21866
- /* @__PURE__ */ jsxRuntime.jsx(RDropdown2__namespace.Separator, { className: menuSeparatorClass }),
22508
+ /* @__PURE__ */ jsxRuntime.jsx(RDropdown3__namespace.Separator, { className: menuSeparatorClass }),
21867
22509
  /* @__PURE__ */ jsxRuntime.jsx(
21868
22510
  TableMenuItem,
21869
22511
  {
@@ -21896,7 +22538,7 @@ function EditorToolbarBar({
21896
22538
  onSelect: () => chain()?.toggleHeaderColumn().run()
21897
22539
  }
21898
22540
  ),
21899
- /* @__PURE__ */ jsxRuntime.jsx(RDropdown2__namespace.Separator, { className: menuSeparatorClass }),
22541
+ /* @__PURE__ */ jsxRuntime.jsx(RDropdown3__namespace.Separator, { className: menuSeparatorClass }),
21900
22542
  /* @__PURE__ */ jsxRuntime.jsx(
21901
22543
  TableMenuItem,
21902
22544
  {
@@ -25214,6 +25856,7 @@ function STimePicker({
25214
25856
  showMeridiem,
25215
25857
  minuteStep = 1,
25216
25858
  width,
25859
+ maxWidth,
25217
25860
  name,
25218
25861
  rules,
25219
25862
  status,
@@ -25287,7 +25930,7 @@ function STimePicker({
25287
25930
  errorMessage: ruleError !== "" ? ruleError : errorMessage,
25288
25931
  width,
25289
25932
  minWidth: dims.fieldMinWidth,
25290
- maxWidth: dims.fieldMaxWidth,
25933
+ maxWidth: maxWidth ?? dims.fieldMaxWidth,
25291
25934
  disabled,
25292
25935
  className,
25293
25936
  style,
@@ -25679,6 +26322,7 @@ function STimeRangePicker({
25679
26322
  minuteStep = 1,
25680
26323
  rangeOrder = "strict",
25681
26324
  width,
26325
+ maxWidth,
25682
26326
  name,
25683
26327
  rules,
25684
26328
  status,
@@ -25754,7 +26398,7 @@ function STimeRangePicker({
25754
26398
  errorMessage: ruleError !== "" ? ruleError : errorMessage,
25755
26399
  width,
25756
26400
  minWidth: effectiveShowMeridiem ? MIDDAY_FIELD_MIN_WIDTH[size] : dims.fieldMinWidth,
25757
- maxWidth: effectiveShowMeridiem ? MIDDAY_FIELD_MAX_WIDTH[size] : dims.fieldMaxWidth,
26401
+ maxWidth: maxWidth ?? (effectiveShowMeridiem ? MIDDAY_FIELD_MAX_WIDTH[size] : dims.fieldMaxWidth),
25758
26402
  disabled,
25759
26403
  className,
25760
26404
  style,
@@ -25955,6 +26599,7 @@ exports.SLAYOUT_MIN_WIDTH = SLAYOUT_MIN_WIDTH;
25955
26599
  exports.SLauncherListBox = SLauncherListBox;
25956
26600
  exports.SLayout = SLayout;
25957
26601
  exports.SLayoutContext = SLayoutContext;
26602
+ exports.SLineChart = SLineChart;
25958
26603
  exports.SLinearProgress = SLinearProgress;
25959
26604
  exports.SList = SList2;
25960
26605
  exports.SListItem = SListItem2;