sellmate-design-system-react 9.0.0-beta.33 → 9.0.0-beta.35

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
@@ -5,7 +5,7 @@ import { forwardRef, useState, useRef, useEffect, createContext, useContext, use
5
5
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
6
6
  import { createPortal } from 'react-dom';
7
7
  import * as RCheckbox from '@radix-ui/react-checkbox';
8
- import * as RPopover11 from '@radix-ui/react-popover';
8
+ import * as RPopover12 from '@radix-ui/react-popover';
9
9
  import { createRoot } from 'react-dom/client';
10
10
  import * as RTooltip from '@radix-ui/react-tooltip';
11
11
  import * as RDropdown2 from '@radix-ui/react-dropdown-menu';
@@ -5164,8 +5164,8 @@ function SGhostButton({
5164
5164
  }
5165
5165
  );
5166
5166
  if (!hasTooltip) return btn2;
5167
- return /* @__PURE__ */ jsxs(RPopover11.Root, { open, onOpenChange: setOpen, children: [
5168
- /* @__PURE__ */ jsx(RPopover11.Anchor, { asChild: true, children: /* @__PURE__ */ jsx(
5167
+ return /* @__PURE__ */ jsxs(RPopover12.Root, { open, onOpenChange: setOpen, children: [
5168
+ /* @__PURE__ */ jsx(RPopover12.Anchor, { asChild: true, children: /* @__PURE__ */ jsx(
5169
5169
  "span",
5170
5170
  {
5171
5171
  className: cn("inline-flex", anchorClassName),
@@ -5177,8 +5177,8 @@ function SGhostButton({
5177
5177
  children: btn2
5178
5178
  }
5179
5179
  ) }),
5180
- /* @__PURE__ */ jsx(RPopover11.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx(
5181
- RPopover11.Content,
5180
+ /* @__PURE__ */ jsx(RPopover12.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx(
5181
+ RPopover12.Content,
5182
5182
  {
5183
5183
  side: "top",
5184
5184
  sideOffset: 4,
@@ -5754,14 +5754,14 @@ var STooltipImpl = /* @__PURE__ */ forwardRef(function STooltip({
5754
5754
  ...style,
5755
5755
  ...contentPropsStyle
5756
5756
  };
5757
- return /* @__PURE__ */ jsxs(RPopover11.Root, { open, onOpenChange: setOpenState, children: [
5757
+ return /* @__PURE__ */ jsxs(RPopover12.Root, { open, onOpenChange: setOpenState, children: [
5758
5758
  isNone ? (
5759
5759
  // 트리거 없음: children 을 래퍼 없이 그대로 앵커로 쓴다 (소비자 레이아웃 보존).
5760
5760
  // mouse/focus 핸들러가 없으므로 useClose 없이도 자동 닫힘이 발생하지 않는다.
5761
- /* @__PURE__ */ jsx(RPopover11.Anchor, { asChild: true, children: triggerNode })
5761
+ /* @__PURE__ */ jsx(RPopover12.Anchor, { asChild: true, children: triggerNode })
5762
5762
  ) : isHover ? (
5763
5763
  // hover: Anchor(위치 기준) + 직접 mouse 핸들러 — 클릭으로 토글되지 않도록 Trigger 미사용
5764
- /* @__PURE__ */ jsx(RPopover11.Anchor, { asChild: true, children: /* @__PURE__ */ jsx(
5764
+ /* @__PURE__ */ jsx(RPopover12.Anchor, { asChild: true, children: /* @__PURE__ */ jsx(
5765
5765
  "span",
5766
5766
  {
5767
5767
  className: "inline-flex",
@@ -5772,9 +5772,9 @@ var STooltipImpl = /* @__PURE__ */ forwardRef(function STooltip({
5772
5772
  children: triggerNode
5773
5773
  }
5774
5774
  ) })
5775
- ) : /* @__PURE__ */ jsx(RPopover11.Trigger, { asChild: true, children: triggerNode }),
5776
- /* @__PURE__ */ jsx(RPopover11.Portal, { container: portalContainer, children: /* @__PURE__ */ jsxs(
5777
- RPopover11.Content,
5775
+ ) : /* @__PURE__ */ jsx(RPopover12.Trigger, { asChild: true, children: triggerNode }),
5776
+ /* @__PURE__ */ jsx(RPopover12.Portal, { container: portalContainer, children: /* @__PURE__ */ jsxs(
5777
+ RPopover12.Content,
5778
5778
  {
5779
5779
  side: placement,
5780
5780
  sideOffset,
@@ -5808,7 +5808,7 @@ var STooltipImpl = /* @__PURE__ */ forwardRef(function STooltip({
5808
5808
  }
5809
5809
  )
5810
5810
  ] }),
5811
- /* @__PURE__ */ jsx(RPopover11.Arrow, { width: 16, height: 12, style: { fill: bg } })
5811
+ /* @__PURE__ */ jsx(RPopover12.Arrow, { width: 16, height: 12, style: { fill: bg } })
5812
5812
  ]
5813
5813
  }
5814
5814
  ) })
@@ -6500,6 +6500,7 @@ var STextLink = /* @__PURE__ */ forwardRef(function STextLink2({
6500
6500
  iconRotate,
6501
6501
  labelClass,
6502
6502
  rightArrow = "none",
6503
+ rightArrowRotate,
6503
6504
  underline = false,
6504
6505
  disabled = false,
6505
6506
  size = "sm",
@@ -6554,7 +6555,8 @@ var STextLink = /* @__PURE__ */ forwardRef(function STextLink2({
6554
6555
  {
6555
6556
  name: rightArrow === "chevron" ? "chevronRight" : "caretRight",
6556
6557
  size: 12,
6557
- color: disabled ? "var(--cmp-textLink-icon-disabled)" : "var(--color-grey-65)"
6558
+ color: disabled ? "var(--cmp-textLink-icon-disabled)" : "var(--color-grey-65)",
6559
+ rotate: rightArrowRotate
6558
6560
  }
6559
6561
  ) })
6560
6562
  ]
@@ -6886,7 +6888,7 @@ function SPortal({
6886
6888
  const portalContainer = usePortalContainer();
6887
6889
  const { minWidth: styleMinWidth, maxWidth: styleMaxWidth, ...restStyle } = style ?? {};
6888
6890
  return /* @__PURE__ */ jsxs(
6889
- RPopover11.Root,
6891
+ RPopover12.Root,
6890
6892
  {
6891
6893
  open,
6892
6894
  onOpenChange: (next) => {
@@ -6894,9 +6896,9 @@ function SPortal({
6894
6896
  if (!next) onClose?.();
6895
6897
  },
6896
6898
  children: [
6897
- /* @__PURE__ */ jsx(RPopover11.Anchor, { virtualRef: anchorRef }),
6898
- /* @__PURE__ */ jsx(RPopover11.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx(
6899
- RPopover11.Content,
6899
+ /* @__PURE__ */ jsx(RPopover12.Anchor, { virtualRef: anchorRef }),
6900
+ /* @__PURE__ */ jsx(RPopover12.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx(
6901
+ RPopover12.Content,
6900
6902
  {
6901
6903
  side: placement,
6902
6904
  align,
@@ -7340,12 +7342,15 @@ var SYSTEM_ACTION_BUTTON_COLOR_CONFIG = {
7340
7342
  dark: {
7341
7343
  bg: item2("dark-bg-default"),
7342
7344
  bgHover: item2("dark-bg-hover"),
7345
+ // 프레임은 hover 에서도 행의 기본 표면색을 지킨다 — 표면만 한 단계 밝아지고 프레임은
7346
+ // 제자리에 남아, 밝아진 면에 뚫린 구멍처럼 읽힌다. `dark-icon-bg-hover`(흰색) 토큰은
7347
+ // 이 시안과 어긋나 쓰지 않는다.
7343
7348
  iconBg: item2("dark-icon-bg-default"),
7344
- iconBgHover: item2("dark-icon-bg-hover"),
7345
- // 어두운 면에는 글리프색 토큰이 없다. 기본은 프레임이 배경과 블렌딩되므로 라벨색(흰색),
7346
- // hover 는 프레임이 흰색이 되므로 그 위에 표면색을 그대로 얹는다.
7349
+ iconBgHover: item2("dark-icon-bg-default"),
7350
+ // 어두운 면에는 글리프색 토큰이 없다. 프레임이 배경과 블렌딩되므로 라벨색(흰색)을 쓰고,
7351
+ // 프레임이 hover 에서 그대로이므로 글리프도 그대로 둔다.
7347
7352
  iconGlyph: item2("dark-text"),
7348
- iconGlyphHover: item2("dark-bg-hover"),
7353
+ iconGlyphHover: item2("dark-text"),
7349
7354
  text: item2("dark-text"),
7350
7355
  actionText: {
7351
7356
  switch: action("switch-text-dark"),
@@ -7357,10 +7362,11 @@ var SYSTEM_ACTION_BUTTON_COLOR_CONFIG = {
7357
7362
  darker: {
7358
7363
  bg: item2("darker-bg-default"),
7359
7364
  bgHover: item2("darker-bg-hover"),
7365
+ // dark 와 같은 규칙 — 프레임은 hover 에서도 행의 기본 표면색을 지킨다.
7360
7366
  iconBg: item2("darker-icon-bg-default"),
7361
- iconBgHover: item2("darker-icon-bg-hover"),
7367
+ iconBgHover: item2("darker-icon-bg-default"),
7362
7368
  iconGlyph: item2("darker-text"),
7363
- iconGlyphHover: item2("darker-bg-hover"),
7369
+ iconGlyphHover: item2("darker-text"),
7364
7370
  text: item2("darker-text"),
7365
7371
  actionText: {
7366
7372
  switch: action("switch-text-dark"),
@@ -7405,7 +7411,13 @@ var SYSTEM_ACTION_BUTTON_LAYOUT = {
7405
7411
  /** 우측 여백 */
7406
7412
  paddingRight: action("paddingRight"),
7407
7413
  /** 액션 텍스트 ↔ 액션 아이콘 간격 */
7408
- actionGap: action("selectData-gap")
7414
+ actionGap: action("selectData-gap"),
7415
+ /**
7416
+ * 액션 아이콘 글리프 한 변. 프레임 한 변은 타입별 토큰(`actionButton.*-icon`)이 정하고
7417
+ * 그 안에 글리프가 이 크기로 놓인다 — 선행 아이콘의 프레임(24)/글리프(20) 과 같은 구조다.
7418
+ * 대응 토큰이 없어 디자인 값을 그대로 쓴다.
7419
+ */
7420
+ actionIconGlyph: "12px"
7409
7421
  };
7410
7422
  function TokenIcon2({ name, size }) {
7411
7423
  return /* @__PURE__ */ jsx(SIcon, { name, size: "100%", style: { width: size, height: size } });
@@ -7508,7 +7520,15 @@ var SSystemActionButton = /* @__PURE__ */ forwardRef(
7508
7520
  children: actionText
7509
7521
  }
7510
7522
  ),
7511
- spec.actionIcon && /* @__PURE__ */ jsx("span", { className: "inline-flex shrink-0 items-center text-(--sab-action-icon)", children: /* @__PURE__ */ jsx(TokenIcon2, { name: spec.actionIcon.name, size: spec.actionIcon.size }) })
7523
+ spec.actionIcon && // 토큰이 정하는 크기는 글리프가 아니라 프레임이다 — 그 안에 글리프를 가운데로 놓는다.
7524
+ /* @__PURE__ */ jsx(
7525
+ "span",
7526
+ {
7527
+ className: "inline-flex shrink-0 items-center justify-center text-(--sab-action-icon)",
7528
+ style: { width: spec.actionIcon.size, height: spec.actionIcon.size },
7529
+ children: /* @__PURE__ */ jsx(TokenIcon2, { name: spec.actionIcon.name, size: SYSTEM_ACTION_BUTTON_LAYOUT.actionIconGlyph })
7530
+ }
7531
+ )
7512
7532
  ] })
7513
7533
  ]
7514
7534
  }
@@ -7629,10 +7649,10 @@ function SPopover({
7629
7649
  const descColor = type === "default" ? "var(--cmp-popover-default-description)" : "var(--cmp-popover-light-description)";
7630
7650
  const leftLinkLabelClass = type === "default" ? "text-[color:var(--cmp-popover-default-subAction)]" : "text-[color:var(--cmp-popover-light-subAction)]";
7631
7651
  const triggerNode = trigger ?? /* @__PURE__ */ jsx("span", { className: "inline-flex cursor-pointer", "aria-label": ariaLabel, children: /* @__PURE__ */ jsx(SIcon, { name: icon, size: iconSize, color }) });
7632
- return /* @__PURE__ */ jsxs(RPopover11.Root, { open: actualOpen, onOpenChange: setOpen, children: [
7633
- /* @__PURE__ */ jsx(RPopover11.Trigger, { asChild: true, children: triggerNode }),
7634
- /* @__PURE__ */ jsx(RPopover11.Portal, { container: portalContainer, children: /* @__PURE__ */ jsxs(
7635
- RPopover11.Content,
7652
+ return /* @__PURE__ */ jsxs(RPopover12.Root, { open: actualOpen, onOpenChange: setOpen, children: [
7653
+ /* @__PURE__ */ jsx(RPopover12.Trigger, { asChild: true, children: triggerNode }),
7654
+ /* @__PURE__ */ jsx(RPopover12.Portal, { container: portalContainer, children: /* @__PURE__ */ jsxs(
7655
+ RPopover12.Content,
7636
7656
  {
7637
7657
  side: placement,
7638
7658
  sideOffset: 8,
@@ -7698,7 +7718,7 @@ function SPopover({
7698
7718
  ]
7699
7719
  }
7700
7720
  ),
7701
- /* @__PURE__ */ jsx(RPopover11.Arrow, { width: 16, height: 12, style: { fill: bg } })
7721
+ /* @__PURE__ */ jsx(RPopover12.Arrow, { width: 16, height: 12, style: { fill: bg } })
7702
7722
  ]
7703
7723
  }
7704
7724
  ) })
@@ -7809,10 +7829,10 @@ function SGuide({
7809
7829
  );
7810
7830
  if (isNotion)
7811
7831
  return /* @__PURE__ */ jsx("span", { className, style, children: trigger });
7812
- return /* @__PURE__ */ jsxs(RPopover11.Root, { open, onOpenChange: setOpen, children: [
7813
- /* @__PURE__ */ jsx(RPopover11.Trigger, { asChild: true, children: trigger }),
7814
- /* @__PURE__ */ jsx(RPopover11.Portal, { container: portalContainer, children: /* @__PURE__ */ jsxs(
7815
- RPopover11.Content,
7832
+ return /* @__PURE__ */ jsxs(RPopover12.Root, { open, onOpenChange: setOpen, children: [
7833
+ /* @__PURE__ */ jsx(RPopover12.Trigger, { asChild: true, children: trigger }),
7834
+ /* @__PURE__ */ jsx(RPopover12.Portal, { container: portalContainer, children: /* @__PURE__ */ jsxs(
7835
+ RPopover12.Content,
7816
7836
  {
7817
7837
  side: "bottom",
7818
7838
  align: "start",
@@ -9963,10 +9983,10 @@ var SGnb = /* @__PURE__ */ forwardRef(function SGnb2({
9963
9983
  }
9964
9984
  ),
9965
9985
  header === "fix" && menuResizeHandle,
9966
- /* @__PURE__ */ jsxs(RPopover11.Root, { open: labelTip !== null, onOpenChange: (open) => !open && setLabelTip(null), children: [
9967
- /* @__PURE__ */ jsx(RPopover11.Anchor, { virtualRef: labelTipAnchorRef }),
9968
- /* @__PURE__ */ jsx(RPopover11.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx(
9969
- RPopover11.Content,
9986
+ /* @__PURE__ */ jsxs(RPopover12.Root, { open: labelTip !== null, onOpenChange: (open) => !open && setLabelTip(null), children: [
9987
+ /* @__PURE__ */ jsx(RPopover12.Anchor, { virtualRef: labelTipAnchorRef }),
9988
+ /* @__PURE__ */ jsx(RPopover12.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx(
9989
+ RPopover12.Content,
9970
9990
  {
9971
9991
  side: "right",
9972
9992
  sideOffset: 4,
@@ -10150,8 +10170,10 @@ var SystemButton = /* @__PURE__ */ forwardRef(function SystemButton2({
10150
10170
  ]
10151
10171
  }
10152
10172
  ),
10153
- label && /* @__PURE__ */ jsx("span", { className: "typo-body-sm-semibold min-w-0 flex-1 truncate", children: label }),
10154
- count != null && count > 0 && /* @__PURE__ */ jsx("span", { className: "typo-body-md-bold shrink-0", style: { color: accentColor }, children: count.toLocaleString() })
10173
+ label && /* @__PURE__ */ jsx("span", { className: "typo-body-sm-semibold min-w-0 truncate", children: label }),
10174
+ count != null && count > 0 && // 개수 오른쪽은 버튼 여백(alertButton.paddingX)만으로는 좁다 — 시안이 4px 을 더 준다.
10175
+ // 대응 토큰이 없어 디자인 값을 그대로 쓴다.
10176
+ /* @__PURE__ */ jsx("span", { className: "typo-body-md-bold me-[4px] shrink-0", style: { color: accentColor }, children: count.toLocaleString() })
10155
10177
  ]
10156
10178
  }
10157
10179
  );
@@ -11522,6 +11544,636 @@ var SStepper = /* @__PURE__ */ forwardRef(function SStepper2({
11522
11544
  );
11523
11545
  });
11524
11546
 
11547
+ // src/lib/date.ts
11548
+ function todayStr() {
11549
+ const d = /* @__PURE__ */ new Date();
11550
+ return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, "0")}-${String(d.getDate()).padStart(2, "0")}`;
11551
+ }
11552
+ function formatDate(year, month, day) {
11553
+ return `${year}-${String(month).padStart(2, "0")}-${String(day).padStart(2, "0")}`;
11554
+ }
11555
+ function calcYearMonth(year, month, dir) {
11556
+ if (dir === "prev")
11557
+ return month === 1 ? { year: year - 1, month: 12 } : { year, month: month - 1 };
11558
+ return month === 12 ? { year: year + 1, month: 1 } : { year, month: month + 1 };
11559
+ }
11560
+ function monthCells(year, month) {
11561
+ const firstDayIndex = new Date(year, month - 1, 1).getDay();
11562
+ const daysInCurrent = new Date(year, month, 0).getDate();
11563
+ const prev = calcYearMonth(year, month, "prev");
11564
+ const daysInPrev = new Date(prev.year, prev.month, 0).getDate();
11565
+ const next = calcYearMonth(year, month, "next");
11566
+ const cells = [];
11567
+ for (let i = firstDayIndex - 1; i >= 0; i--) {
11568
+ const day = daysInPrev - i;
11569
+ cells.push({ date: formatDate(prev.year, prev.month, day), day, inCurrentMonth: false });
11570
+ }
11571
+ for (let day = 1; day <= daysInCurrent; day++) {
11572
+ cells.push({ date: formatDate(year, month, day), day, inCurrentMonth: true });
11573
+ }
11574
+ const remaining = (7 - cells.length % 7) % 7;
11575
+ for (let day = 1; day <= remaining; day++) {
11576
+ cells.push({ date: formatDate(next.year, next.month, day), day, inCurrentMonth: false });
11577
+ }
11578
+ return cells;
11579
+ }
11580
+ var WEEK_LABELS = ["\uC77C", "\uC6D4", "\uD654", "\uC218", "\uBAA9", "\uAE08", "\uD1A0"];
11581
+
11582
+ // src/components/SCalendarBoard/calendarBoard.config.ts
11583
+ var CALENDAR_BOARD_EVENT_COLORS = [
11584
+ "default",
11585
+ "blue",
11586
+ "oceanBlue",
11587
+ "lightBlue",
11588
+ "green",
11589
+ "yellow",
11590
+ "orange",
11591
+ "red",
11592
+ "white"
11593
+ ];
11594
+ var BG = (name) => `var(--cmp-calendarBoard-eventButton-bg-${name})`;
11595
+ var CALENDAR_BOARD_EVENT_PRESETS = {
11596
+ default: { bg: BG("default"), dot: "indigo" },
11597
+ blue: { bg: BG("blue"), dot: "blue" },
11598
+ oceanBlue: { bg: BG("oceanBlue"), dot: "darkblue" },
11599
+ lightBlue: { bg: BG("lightBlue"), dot: "lightblue" },
11600
+ green: { bg: BG("green"), dot: "green" },
11601
+ yellow: { bg: BG("yellow"), dot: "yellow" },
11602
+ orange: { bg: BG("orange"), dot: "orange" },
11603
+ red: { bg: BG("red"), dot: "red" },
11604
+ white: { bg: BG("white"), dot: "grey" }
11605
+ };
11606
+ var CALENDAR_BOARD_MAX_VISIBLE_EVENTS = 4;
11607
+ var CALENDAR_BOARD_DAY_COLORS = [
11608
+ "default",
11609
+ "danger",
11610
+ "accent",
11611
+ "complete",
11612
+ "dim"
11613
+ ];
11614
+ var CALENDAR_BOARD_DAY_BG = {
11615
+ default: "var(--cmp-calendarBoard-dayCard-bg)",
11616
+ danger: "var(--color-red-30)",
11617
+ accent: "var(--color-brilliantblue-40)",
11618
+ complete: "var(--color-green-45)",
11619
+ dim: "var(--color-grey-25)"
11620
+ };
11621
+ function CalendarEventButton({
11622
+ event,
11623
+ onSelect,
11624
+ className
11625
+ }) {
11626
+ const preset = CALENDAR_BOARD_EVENT_PRESETS[event.color ?? "default"];
11627
+ const dot = event.dotColor ?? preset.dot;
11628
+ const disabled = event.disabled === true;
11629
+ const hasDescription = event.description != null && event.description !== "";
11630
+ const hasValue = event.value != null && event.value !== "";
11631
+ const title = [event.label.replace(/<[^>]*>/g, ""), event.description, event.value].filter((v) => v != null && v !== "").join(" ") || void 0;
11632
+ return /* @__PURE__ */ jsxs(
11633
+ "button",
11634
+ {
11635
+ type: "button",
11636
+ disabled,
11637
+ title,
11638
+ className: cn(
11639
+ // hover 는 배경 위에 8% 오버레이를 얹는다 — 프리셋 배경이 9종이라 색마다 hover 색을 두지 않는다.
11640
+ "group relative flex w-full min-w-0 items-center overflow-hidden text-left",
11641
+ "h-(--cmp-calendarBoard-item-height) shrink-0 rounded-(--cmp-calendarBoard-item-radius)",
11642
+ "gap-(--cmp-calendarBoard-eventButton-inline-gap) px-(--cmp-calendarBoard-item-paddingX)",
11643
+ "bg-(--ceb-bg) text-(--cmp-calendarBoard-eventButton-text-color-default)",
11644
+ disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer",
11645
+ className
11646
+ ),
11647
+ style: { "--ceb-bg": preset.bg },
11648
+ onClick: (e) => {
11649
+ if (disabled) return;
11650
+ onSelect?.(event, e);
11651
+ },
11652
+ children: [
11653
+ !disabled && /* @__PURE__ */ jsx(
11654
+ "span",
11655
+ {
11656
+ "aria-hidden": true,
11657
+ className: "pointer-events-none absolute inset-0 rounded-(--cmp-calendarBoard-item-radius) bg-(--cmp-calendarBoard-eventButton-hover-overlay-color) opacity-0 transition-opacity group-hover:opacity-(--cmp-calendarBoard-eventButton-hover-overlay-opacity)"
11658
+ }
11659
+ ),
11660
+ /* @__PURE__ */ jsx(SBadge, { "aria-hidden": true, color: dot, className: "shrink-0" }),
11661
+ /* @__PURE__ */ jsxs("span", { className: "flex min-w-0 flex-1 items-center gap-(--cmp-calendarBoard-eventButton-label-gap)", children: [
11662
+ /* @__PURE__ */ jsxs("span", { className: "typo-body-sm-default min-w-0 flex-1 truncate", children: [
11663
+ /* @__PURE__ */ jsx(
11664
+ "span",
11665
+ {
11666
+ className: cn(
11667
+ "typo-body-sm-semibold",
11668
+ hasDescription && "me-(--cmp-calendarBoard-eventButton-label-gap)"
11669
+ ),
11670
+ dangerouslySetInnerHTML: { __html: sanitizeInlineHtml(event.label) }
11671
+ }
11672
+ ),
11673
+ hasDescription && event.description
11674
+ ] }),
11675
+ hasValue && /* @__PURE__ */ jsxs("span", { className: "flex shrink-0 items-center gap-(--cmp-calendarBoard-eventButton-label-gap)", children: [
11676
+ /* @__PURE__ */ jsx(
11677
+ "span",
11678
+ {
11679
+ "aria-hidden": true,
11680
+ className: "typo-body-sm-default text-(--cmp-calendarBoard-eventButton-text-color-separator)",
11681
+ children: "/"
11682
+ }
11683
+ ),
11684
+ /* @__PURE__ */ jsx("span", { className: "typo-body-sm-default whitespace-nowrap", children: event.value })
11685
+ ] })
11686
+ ] })
11687
+ ]
11688
+ }
11689
+ );
11690
+ }
11691
+ var CalendarMoreButton = /* @__PURE__ */ forwardRef(function CalendarMoreButton2({ count, label = "\uB354\uBCF4\uAE30", onClick, className }, ref) {
11692
+ return /* @__PURE__ */ jsxs(
11693
+ "button",
11694
+ {
11695
+ ref,
11696
+ type: "button",
11697
+ className: cn(
11698
+ "group relative flex w-full min-w-0 cursor-pointer items-center overflow-hidden text-left",
11699
+ "h-(--cmp-calendarBoard-item-height) shrink-0 rounded-(--cmp-calendarBoard-item-radius)",
11700
+ "gap-(--cmp-calendarBoard-moreButton-gap) px-(--cmp-calendarBoard-item-paddingX)",
11701
+ "bg-(--cmp-calendarBoard-moreButton-bg)",
11702
+ className
11703
+ ),
11704
+ onClick,
11705
+ children: [
11706
+ /* @__PURE__ */ jsx(
11707
+ "span",
11708
+ {
11709
+ "aria-hidden": true,
11710
+ className: "pointer-events-none absolute inset-0 rounded-(--cmp-calendarBoard-item-radius) bg-(--cmp-calendarBoard-moreButton-hover-overlay-color) opacity-0 transition-opacity group-hover:opacity-(--cmp-calendarBoard-moreButton-hover-overlay-opacity)"
11711
+ }
11712
+ ),
11713
+ /* @__PURE__ */ jsxs("span", { className: "typo-body-sm-semibold shrink-0 text-(--cmp-calendarBoard-moreButton-count-color)", children: [
11714
+ count,
11715
+ "\uAC1C"
11716
+ ] }),
11717
+ /* @__PURE__ */ jsx("span", { className: "typo-body-sm-default min-w-0 truncate text-(--cmp-calendarBoard-moreButton-label-color)", children: label })
11718
+ ]
11719
+ }
11720
+ );
11721
+ });
11722
+ var CalendarDayCard = /* @__PURE__ */ forwardRef(function CalendarDayCard2({
11723
+ date,
11724
+ day,
11725
+ inCurrentMonth,
11726
+ isToday,
11727
+ isSelected,
11728
+ selectable,
11729
+ color,
11730
+ events,
11731
+ body,
11732
+ hiddenCount,
11733
+ isOpen,
11734
+ moreLabel,
11735
+ onDaySelect,
11736
+ onEventClick,
11737
+ onOpenEvents,
11738
+ ...rest
11739
+ }, ref) {
11740
+ const hasEvents = events.length + hiddenCount > 0;
11741
+ const interactive = selectable || hasEvents;
11742
+ const activate = () => {
11743
+ if (hasEvents) onOpenEvents?.();
11744
+ if (selectable) onDaySelect?.(date);
11745
+ };
11746
+ return /* @__PURE__ */ jsxs(
11747
+ "div",
11748
+ {
11749
+ ...rest,
11750
+ ref,
11751
+ role: "gridcell",
11752
+ "data-date": date,
11753
+ "aria-selected": selectable ? isSelected : void 0,
11754
+ "aria-current": isToday ? "date" : void 0,
11755
+ "aria-haspopup": hasEvents ? "dialog" : void 0,
11756
+ "aria-expanded": hasEvents ? isOpen : void 0,
11757
+ tabIndex: interactive ? 0 : void 0,
11758
+ onClick: interactive ? activate : void 0,
11759
+ onKeyDown: interactive ? (e) => {
11760
+ if (e.key === "Enter" || e.key === " ") {
11761
+ e.preventDefault();
11762
+ activate();
11763
+ }
11764
+ } : void 0,
11765
+ className: cn(
11766
+ "relative flex min-h-(--cmp-calendarBoard-dayCard-minHeight) min-w-(--cmp-calendarBoard-dayCard-minWidth) flex-col bg-(--cdc-bg) px-(--cmp-calendarBoard-dayCard-paddingX) outline-none",
11767
+ interactive && "cursor-pointer"
11768
+ ),
11769
+ style: { ...rest.style, "--cdc-bg": CALENDAR_BOARD_DAY_BG[color] },
11770
+ children: [
11771
+ isSelected && /* @__PURE__ */ jsx(
11772
+ "span",
11773
+ {
11774
+ "aria-hidden": true,
11775
+ className: "pointer-events-none absolute inset-[1px] rounded-(--cmp-calendarBoard-dayCard-focus-border-radius) border-(length:--cmp-calendarBoard-dayCard-focus-border-width) border-solid border-(--cmp-calendarBoard-dayCard-focus-border-color)"
11776
+ }
11777
+ ),
11778
+ /* @__PURE__ */ jsx("div", { className: "flex shrink-0 pt-(--cmp-calendarBoard-dayCard-header-paddingTop) pb-(--cmp-calendarBoard-dayCard-header-paddingBottom)", children: /* @__PURE__ */ jsx(
11779
+ "span",
11780
+ {
11781
+ className: cn(
11782
+ "inline-flex size-(--cmp-calendarBoard-daySequence-size) items-center justify-center rounded-(--cmp-calendarBoard-daySequence-radius)",
11783
+ isToday ? "typo-body-md-bold bg-(--cmp-calendarBoard-daySequence-bg-today) text-(--cmp-calendarBoard-daySequence-text-today)" : cn(
11784
+ "typo-body-md-medium",
11785
+ inCurrentMonth ? "text-(--cmp-calendarBoard-daySequence-text-default)" : "text-(--cmp-calendarBoard-daySequence-text-otherMonth)"
11786
+ ),
11787
+ // 오늘이 아니면서 선택된 날은 테두리 원으로 표시한다 (오늘은 이미 채운 원이라 겹치지 않는다).
11788
+ // 굵기는 1px 로 고정한다 — 칸을 감싸는 focus 테두리(2px)와 달리 얇은 원이고, 대응 토큰이 없다.
11789
+ isSelected && !isToday && "border border-solid border-(--cmp-calendarBoard-daySequence-border-selected)"
11790
+ ),
11791
+ children: day
11792
+ }
11793
+ ) }),
11794
+ /* @__PURE__ */ jsxs(
11795
+ "div",
11796
+ {
11797
+ className: cn(
11798
+ "flex min-h-0 flex-col gap-(--cmp-calendarBoard-dayCard-grid-gap) pb-(--cmp-calendarBoard-dayCard-grid-paddingBottom)",
11799
+ // 슬롯은 남는 세로를 다 갖는다 — 안에서 h-full 로 칸을 채울 수 있어야 한다.
11800
+ body != null && "flex-1"
11801
+ ),
11802
+ children: [
11803
+ body,
11804
+ body == null && events.map((event, i) => /* @__PURE__ */ jsx(
11805
+ CalendarEventButton,
11806
+ {
11807
+ event,
11808
+ onSelect: (ev, e) => {
11809
+ e.stopPropagation();
11810
+ onEventClick?.(ev, e);
11811
+ }
11812
+ },
11813
+ event.id ?? `${event.date}-${i}`
11814
+ )),
11815
+ hiddenCount > 0 && /* @__PURE__ */ jsx(
11816
+ CalendarMoreButton,
11817
+ {
11818
+ count: hiddenCount,
11819
+ label: moreLabel,
11820
+ onClick: (e) => {
11821
+ e.stopPropagation();
11822
+ onOpenEvents?.();
11823
+ }
11824
+ }
11825
+ )
11826
+ ]
11827
+ }
11828
+ )
11829
+ ]
11830
+ }
11831
+ );
11832
+ });
11833
+ var MAX_HEIGHT = 480;
11834
+ var MAX_WIDTH = "calc(100vw - 16px)";
11835
+ function CalendarDayEventListBox({
11836
+ date,
11837
+ events,
11838
+ onEventClick,
11839
+ minWidth,
11840
+ minHeight,
11841
+ onClose,
11842
+ closeLabel = "\uB2EB\uAE30"
11843
+ }) {
11844
+ const [y, m, d] = date.split("-").map(Number);
11845
+ const weekday = WEEK_LABELS[new Date(y, m - 1, d).getDay()];
11846
+ return /* @__PURE__ */ jsxs(
11847
+ "div",
11848
+ {
11849
+ className: "flex w-max flex-col overflow-hidden rounded-(--cmp-calendarBoard-radius) bg-(--cmp-calendarBoard-bg) shadow-(--shadow-overlay)",
11850
+ style: { minWidth, maxWidth: MAX_WIDTH, minHeight, maxHeight: MAX_HEIGHT },
11851
+ children: [
11852
+ /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-(--cmp-calendarBoard-dayEvent-header-gap) px-(--cmp-calendarBoard-dayEvent-header-paddingX) py-(--cmp-calendarBoard-dayEvent-header-paddingY)", children: [
11853
+ /* @__PURE__ */ jsxs("span", { className: "typo-heading-md text-(--cmp-calendarBoard-header-content-color)", children: [
11854
+ d,
11855
+ "\uC77C"
11856
+ ] }),
11857
+ /* @__PURE__ */ jsxs("span", { className: "typo-body-lg-default flex-1 text-(--cmp-calendarBoard-header-content-color)", children: [
11858
+ "(",
11859
+ weekday,
11860
+ ")"
11861
+ ] }),
11862
+ /* @__PURE__ */ jsx(
11863
+ SGhostButton,
11864
+ {
11865
+ icon: "close",
11866
+ size: "xs",
11867
+ ariaLabel: closeLabel,
11868
+ className: "shrink-0",
11869
+ onClick: onClose
11870
+ }
11871
+ )
11872
+ ] }),
11873
+ /* @__PURE__ */ jsx(SScrollArea, { axis: "vertical", className: "min-h-0 flex-1", children: /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-(--cmp-calendarBoard-dayEvent-body-gap) px-(--cmp-calendarBoard-dayEvent-body-paddingX) pb-(--cmp-calendarBoard-dayEvent-body-paddingBottom)", children: events.map((event, i) => /* @__PURE__ */ jsx(
11874
+ CalendarEventButton,
11875
+ {
11876
+ event,
11877
+ onSelect: onEventClick
11878
+ },
11879
+ event.id ?? `${event.date}-${i}`
11880
+ )) }) })
11881
+ ]
11882
+ }
11883
+ );
11884
+ }
11885
+ var DAY_EVENT_OUTDENT = 16;
11886
+ var VIEWPORT_PADDING2 = 8;
11887
+ function shiftIntoView(desired, size, viewport) {
11888
+ const max = Math.max(viewport - size - VIEWPORT_PADDING2, VIEWPORT_PADDING2);
11889
+ return Math.min(Math.max(desired, VIEWPORT_PADDING2), max) - desired;
11890
+ }
11891
+ function measureRowCapacity(cell) {
11892
+ const cs = getComputedStyle(cell);
11893
+ const v = (name) => Number.parseFloat(cs.getPropertyValue(name)) || 0;
11894
+ const gap = v("--cmp-calendarBoard-dayCard-grid-gap");
11895
+ const row = v("--cmp-calendarBoard-item-height") + gap;
11896
+ if (row <= 0) return null;
11897
+ const header = v("--cmp-calendarBoard-dayCard-header-paddingTop") + v("--cmp-calendarBoard-daySequence-size") + v("--cmp-calendarBoard-dayCard-header-paddingBottom");
11898
+ const free = cell.getBoundingClientRect().height - header - v("--cmp-calendarBoard-dayCard-grid-paddingBottom") + gap;
11899
+ if (free <= 0) return null;
11900
+ return Math.max(1, Math.floor(free / row));
11901
+ }
11902
+ function SCalendarBoard({
11903
+ year,
11904
+ month,
11905
+ defaultYear,
11906
+ defaultMonth,
11907
+ onViewChange,
11908
+ selectable = false,
11909
+ value,
11910
+ onValueChange,
11911
+ events,
11912
+ dayColors,
11913
+ dayContent,
11914
+ onEventClick,
11915
+ onMoreClick,
11916
+ todayLabel = "\uC624\uB298",
11917
+ moreLabel,
11918
+ headerRight,
11919
+ className,
11920
+ style
11921
+ }) {
11922
+ const today = todayStr();
11923
+ const [ty, tm] = [Number(today.slice(0, 4)), Number(today.slice(5, 7))];
11924
+ const [innerView, setInnerView] = useState(() => ({
11925
+ year: defaultYear ?? ty,
11926
+ month: defaultMonth ?? tm
11927
+ }));
11928
+ const controlled = year != null && month != null;
11929
+ const view = controlled ? { year, month } : innerView;
11930
+ const [openDate, setOpenDate] = useState(null);
11931
+ const [placement, setPlacement] = useState({ cellWidth: 0, cellHeight: 0, side: 0, align: 0 });
11932
+ const [panelEl, setPanelEl] = useState(null);
11933
+ const portalContainer = usePortalContainer();
11934
+ const setView = useCallback(
11935
+ (next) => {
11936
+ setOpenDate(null);
11937
+ if (!controlled) setInnerView(next);
11938
+ onViewChange?.(next);
11939
+ },
11940
+ [controlled, onViewChange]
11941
+ );
11942
+ const cells = useMemo(() => monthCells(view.year, view.month), [view.year, view.month]);
11943
+ const rowCount = cells.length / 7;
11944
+ const gridRef = useRef(null);
11945
+ const [rowCapacity, setRowCapacity] = useState(CALENDAR_BOARD_MAX_VISIBLE_EVENTS);
11946
+ useEffect(() => {
11947
+ const grid = gridRef.current;
11948
+ if (grid == null || typeof ResizeObserver === "undefined") return;
11949
+ const cell = grid.querySelector('[role="gridcell"]');
11950
+ if (cell == null) return;
11951
+ const apply = () => {
11952
+ const next = measureRowCapacity(cell);
11953
+ if (next != null) setRowCapacity(next);
11954
+ };
11955
+ apply();
11956
+ const observer = new ResizeObserver(apply);
11957
+ observer.observe(cell);
11958
+ return () => observer.disconnect();
11959
+ }, [rowCount]);
11960
+ const eventMap = useMemo(() => {
11961
+ const map = /* @__PURE__ */ new Map();
11962
+ (events ?? []).forEach((event) => {
11963
+ const list = map.get(event.date);
11964
+ if (list) list.push(event);
11965
+ else map.set(event.date, [event]);
11966
+ });
11967
+ return map;
11968
+ }, [events]);
11969
+ const openEvents = openDate ? eventMap.get(openDate) ?? [] : [];
11970
+ useLayoutEffect(() => {
11971
+ if (openDate == null || panelEl == null) return;
11972
+ const cell = gridRef.current?.querySelector(`[data-date="${openDate}"]`);
11973
+ if (cell == null) return;
11974
+ const adjust = () => {
11975
+ const cellRect = cell.getBoundingClientRect();
11976
+ const panelRect = panelEl.getBoundingClientRect();
11977
+ const next = {
11978
+ cellWidth: cellRect.width,
11979
+ cellHeight: cellRect.height,
11980
+ side: -(cellRect.height + DAY_EVENT_OUTDENT) + shiftIntoView(cellRect.top - DAY_EVENT_OUTDENT, panelRect.height, window.innerHeight),
11981
+ align: -DAY_EVENT_OUTDENT + shiftIntoView(cellRect.left - DAY_EVENT_OUTDENT, panelRect.width, window.innerWidth)
11982
+ };
11983
+ setPlacement(
11984
+ (prev) => prev.cellWidth === next.cellWidth && prev.cellHeight === next.cellHeight && prev.side === next.side && prev.align === next.align ? prev : next
11985
+ );
11986
+ };
11987
+ adjust();
11988
+ const observer = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(adjust);
11989
+ observer?.observe(panelEl);
11990
+ window.addEventListener("scroll", adjust, true);
11991
+ window.addEventListener("resize", adjust);
11992
+ return () => {
11993
+ observer?.disconnect();
11994
+ window.removeEventListener("scroll", adjust, true);
11995
+ window.removeEventListener("resize", adjust);
11996
+ };
11997
+ }, [openDate, panelEl]);
11998
+ const columns = "repeat(7, minmax(var(--cmp-calendarBoard-dayCard-minWidth), 1fr))";
11999
+ const openEventList = (date, list) => {
12000
+ if (onMoreClick) {
12001
+ onMoreClick({ date, events: list });
12002
+ return;
12003
+ }
12004
+ setOpenDate((prev) => prev === date ? null : date);
12005
+ };
12006
+ return /* @__PURE__ */ jsxs(
12007
+ "div",
12008
+ {
12009
+ className: cn(
12010
+ // 판 높이는 부모가 정한다 — 행이 그 높이를 균등 분할하고, 칸 높이가 다시 "몇 줄 보일지" 를 정한다.
12011
+ "flex h-full w-full flex-col overflow-hidden rounded-(--cmp-calendarBoard-radius) border border-solid border-(--cmp-calendarBoard-border) bg-(--cmp-calendarBoard-bg)",
12012
+ className
12013
+ ),
12014
+ style,
12015
+ children: [
12016
+ /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-(--cmp-calendarBoard-header-gap) px-sd-16 py-sd-12", children: [
12017
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-(--cmp-calendarBoard-header-content-gap)", children: [
12018
+ /* @__PURE__ */ jsx(
12019
+ SGhostButton,
12020
+ {
12021
+ icon: "chevronLeft",
12022
+ size: "xxs",
12023
+ ariaLabel: "\uC774\uC804 \uD574",
12024
+ onClick: () => setView({ year: view.year - 1, month: view.month })
12025
+ }
12026
+ ),
12027
+ /* @__PURE__ */ jsx("span", { className: "typo-heading-lg inline-flex min-w-[48px] justify-center text-(--cmp-calendarBoard-header-content-color)", children: view.year }),
12028
+ /* @__PURE__ */ jsx(
12029
+ SGhostButton,
12030
+ {
12031
+ icon: "chevronRight",
12032
+ size: "xxs",
12033
+ ariaLabel: "\uB2E4\uC74C \uD574",
12034
+ onClick: () => setView({ year: view.year + 1, month: view.month })
12035
+ }
12036
+ )
12037
+ ] }),
12038
+ /* @__PURE__ */ jsx(SDivider, { vertical: true, height: "var(--cmp-calendarBoard-header-content-divider-height)" }),
12039
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-(--cmp-calendarBoard-header-content-gap)", children: [
12040
+ /* @__PURE__ */ jsx(
12041
+ SGhostButton,
12042
+ {
12043
+ icon: "chevronLeft",
12044
+ size: "xxs",
12045
+ ariaLabel: "\uC774\uC804 \uB2EC",
12046
+ onClick: () => setView(calcYearMonth(view.year, view.month, "prev"))
12047
+ }
12048
+ ),
12049
+ /* @__PURE__ */ jsxs("span", { className: "typo-heading-lg inline-flex min-w-[48px] justify-center text-(--cmp-calendarBoard-header-content-color)", children: [
12050
+ view.month,
12051
+ "\uC6D4"
12052
+ ] }),
12053
+ /* @__PURE__ */ jsx(
12054
+ SGhostButton,
12055
+ {
12056
+ icon: "chevronRight",
12057
+ size: "xxs",
12058
+ ariaLabel: "\uB2E4\uC74C \uB2EC",
12059
+ onClick: () => setView(calcYearMonth(view.year, view.month, "next"))
12060
+ }
12061
+ )
12062
+ ] }),
12063
+ todayLabel !== "" && /* @__PURE__ */ jsx(
12064
+ SButton,
12065
+ {
12066
+ color: "neutral",
12067
+ outline: true,
12068
+ size: "xs",
12069
+ label: todayLabel,
12070
+ onClick: () => setView({ year: ty, month: tm })
12071
+ }
12072
+ ),
12073
+ headerRight != null && /* @__PURE__ */ jsx("div", { className: "ml-auto flex items-center", children: headerRight })
12074
+ ] }),
12075
+ /* @__PURE__ */ jsx(SDivider, {}),
12076
+ /* @__PURE__ */ jsx(
12077
+ "div",
12078
+ {
12079
+ className: "grid shrink-0 bg-(--cmp-calendarBoard-grid-bg) pt-(--cmp-calendarBoard-grid-paddingTop) pb-(--cmp-calendarBoard-grid-gap)",
12080
+ style: { gridTemplateColumns: columns },
12081
+ children: WEEK_LABELS.map((label) => /* @__PURE__ */ jsx(
12082
+ "div",
12083
+ {
12084
+ className: "typo-body-md-default flex justify-center text-(--cmp-calendarBoard-grid-weekRow-color)",
12085
+ children: label
12086
+ },
12087
+ label
12088
+ ))
12089
+ }
12090
+ ),
12091
+ /* @__PURE__ */ jsxs(
12092
+ RPopover12.Root,
12093
+ {
12094
+ open: openDate !== null,
12095
+ onOpenChange: (open) => {
12096
+ if (!open) setOpenDate(null);
12097
+ },
12098
+ children: [
12099
+ /* @__PURE__ */ jsx(
12100
+ "div",
12101
+ {
12102
+ ref: gridRef,
12103
+ role: "grid",
12104
+ className: "grid min-h-0 flex-1 gap-px overflow-auto border-t border-solid border-(--cmp-calendarBoard-grid-month-border) bg-(--cmp-calendarBoard-grid-month-border)",
12105
+ style: {
12106
+ gridTemplateColumns: columns,
12107
+ // 행은 판 높이를 균등하게 나눠 갖는다 — 일정이 많은 주만 길어지면 격자가 깨진다.
12108
+ gridTemplateRows: `repeat(${rowCount}, minmax(var(--cmp-calendarBoard-dayCard-minHeight), 1fr))`
12109
+ },
12110
+ children: cells.map((cell) => {
12111
+ const content = dayContent?.[cell.date];
12112
+ const list = content == null ? eventMap.get(cell.date) ?? [] : [];
12113
+ const folded = list.length > rowCapacity;
12114
+ const visible = folded ? list.slice(0, rowCapacity - 1) : list;
12115
+ const card = /* @__PURE__ */ jsx(
12116
+ CalendarDayCard,
12117
+ {
12118
+ date: cell.date,
12119
+ day: cell.day,
12120
+ inCurrentMonth: cell.inCurrentMonth,
12121
+ isToday: cell.date === today,
12122
+ isSelected: value != null && value === cell.date,
12123
+ selectable,
12124
+ color: dayColors?.[cell.date] ?? "default",
12125
+ events: visible,
12126
+ body: content,
12127
+ hiddenCount: folded ? list.length - (rowCapacity - 1) : 0,
12128
+ isOpen: openDate === cell.date,
12129
+ moreLabel,
12130
+ onDaySelect: (date) => onValueChange?.(date, list),
12131
+ onEventClick,
12132
+ onOpenEvents: () => openEventList(cell.date, list)
12133
+ },
12134
+ cell.date
12135
+ );
12136
+ return cell.date === openDate ? /* @__PURE__ */ jsx(RPopover12.Anchor, { asChild: true, children: card }, cell.date) : card;
12137
+ })
12138
+ }
12139
+ ),
12140
+ /* @__PURE__ */ jsx(RPopover12.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx(
12141
+ RPopover12.Content,
12142
+ {
12143
+ onInteractOutside: (e) => {
12144
+ const target = e.detail.originalEvent.target;
12145
+ if (target instanceof Node && gridRef.current?.contains(target)) e.preventDefault();
12146
+ },
12147
+ side: "bottom",
12148
+ align: "start",
12149
+ ref: setPanelEl,
12150
+ sideOffset: placement.side,
12151
+ alignOffset: placement.align,
12152
+ avoidCollisions: false,
12153
+ className: cn("z-50 outline-none", FLOATING_SLIDE_ANIM),
12154
+ onOpenAutoFocus: (e) => e.preventDefault(),
12155
+ children: openDate != null && /* @__PURE__ */ jsx(
12156
+ CalendarDayEventListBox,
12157
+ {
12158
+ date: openDate,
12159
+ minWidth: placement.cellWidth > 0 ? placement.cellWidth + DAY_EVENT_OUTDENT * 2 : void 0,
12160
+ minHeight: placement.cellHeight > 0 ? placement.cellHeight + DAY_EVENT_OUTDENT * 2 : void 0,
12161
+ events: openEvents,
12162
+ onEventClick,
12163
+ onClose: () => setOpenDate(null)
12164
+ }
12165
+ )
12166
+ },
12167
+ openDate
12168
+ ) })
12169
+ ]
12170
+ }
12171
+ )
12172
+ ]
12173
+ }
12174
+ );
12175
+ }
12176
+
11525
12177
  // src/lib/floating-height.ts
11526
12178
  var POPOVER_AVAILABLE_HEIGHT = "var(--radix-popover-content-available-height)";
11527
12179
  function clampToAvailableHeight(value, availableHeight) {
@@ -13477,10 +14129,10 @@ function useTruncatedValueTooltip({
13477
14129
  valueRef: elRef,
13478
14130
  onMouseEnter: active ? onMouseEnter : cancelHide,
13479
14131
  onMouseLeave: active ? startHide : cancelHide,
13480
- tooltip: active ? /* @__PURE__ */ jsxs(RPopover11.Root, { open, onOpenChange: setOpen, children: [
13481
- /* @__PURE__ */ jsx(RPopover11.Anchor, { virtualRef: elRef }),
13482
- /* @__PURE__ */ jsx(RPopover11.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx(
13483
- RPopover11.Content,
14132
+ tooltip: active ? /* @__PURE__ */ jsxs(RPopover12.Root, { open, onOpenChange: setOpen, children: [
14133
+ /* @__PURE__ */ jsx(RPopover12.Anchor, { virtualRef: elRef }),
14134
+ /* @__PURE__ */ jsx(RPopover12.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx(
14135
+ RPopover12.Content,
13484
14136
  {
13485
14137
  side: "top",
13486
14138
  sideOffset: 4,
@@ -14236,41 +14888,6 @@ function SRadioGroup({
14236
14888
  }
14237
14889
  );
14238
14890
  }
14239
-
14240
- // src/lib/date.ts
14241
- function todayStr() {
14242
- const d = /* @__PURE__ */ new Date();
14243
- return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, "0")}-${String(d.getDate()).padStart(2, "0")}`;
14244
- }
14245
- function formatDate(year, month, day) {
14246
- return `${year}-${String(month).padStart(2, "0")}-${String(day).padStart(2, "0")}`;
14247
- }
14248
- function calcYearMonth(year, month, dir) {
14249
- if (dir === "prev")
14250
- return month === 1 ? { year: year - 1, month: 12 } : { year, month: month - 1 };
14251
- return month === 12 ? { year: year + 1, month: 1 } : { year, month: month + 1 };
14252
- }
14253
- function monthCells(year, month) {
14254
- const firstDayIndex = new Date(year, month - 1, 1).getDay();
14255
- const daysInCurrent = new Date(year, month, 0).getDate();
14256
- const prev = calcYearMonth(year, month, "prev");
14257
- const daysInPrev = new Date(prev.year, prev.month, 0).getDate();
14258
- const next = calcYearMonth(year, month, "next");
14259
- const cells = [];
14260
- for (let i = firstDayIndex - 1; i >= 0; i--) {
14261
- const day = daysInPrev - i;
14262
- cells.push({ date: formatDate(prev.year, prev.month, day), day, inCurrentMonth: false });
14263
- }
14264
- for (let day = 1; day <= daysInCurrent; day++) {
14265
- cells.push({ date: formatDate(year, month, day), day, inCurrentMonth: true });
14266
- }
14267
- const remaining = (7 - cells.length % 7) % 7;
14268
- for (let day = 1; day <= remaining; day++) {
14269
- cells.push({ date: formatDate(next.year, next.month, day), day, inCurrentMonth: false });
14270
- }
14271
- return cells;
14272
- }
14273
- var WEEK_LABELS = ["\uC77C", "\uC6D4", "\uD654", "\uC218", "\uBAA9", "\uAE08", "\uD1A0"];
14274
14891
  function SCalendar({
14275
14892
  value,
14276
14893
  onValueChange,
@@ -14849,8 +15466,8 @@ function SDatePicker({
14849
15466
  disabled,
14850
15467
  className,
14851
15468
  style,
14852
- children: /* @__PURE__ */ jsxs(RPopover11.Root, { open, onOpenChange: (o) => !disabled && setOpen(o), children: [
14853
- /* @__PURE__ */ jsx(RPopover11.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs(
15469
+ children: /* @__PURE__ */ jsxs(RPopover12.Root, { open, onOpenChange: (o) => !disabled && setOpen(o), children: [
15470
+ /* @__PURE__ */ jsx(RPopover12.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs(
14854
15471
  "div",
14855
15472
  {
14856
15473
  role: "button",
@@ -14909,8 +15526,8 @@ function SDatePicker({
14909
15526
  ]
14910
15527
  }
14911
15528
  ) }),
14912
- /* @__PURE__ */ jsx(RPopover11.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx(
14913
- RPopover11.Content,
15529
+ /* @__PURE__ */ jsx(RPopover12.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx(
15530
+ RPopover12.Content,
14914
15531
  {
14915
15532
  side: "bottom",
14916
15533
  align: mode === "date" ? "start" : "center",
@@ -15383,7 +16000,7 @@ function SDateRangePicker({
15383
16000
  className,
15384
16001
  style,
15385
16002
  children: /* @__PURE__ */ jsxs(
15386
- RPopover11.Root,
16003
+ RPopover12.Root,
15387
16004
  {
15388
16005
  open,
15389
16006
  onOpenChange: (o) => {
@@ -15392,7 +16009,7 @@ function SDateRangePicker({
15392
16009
  if (!o) setPendingStart(null);
15393
16010
  },
15394
16011
  children: [
15395
- /* @__PURE__ */ jsx(RPopover11.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs(
16012
+ /* @__PURE__ */ jsx(RPopover12.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs(
15396
16013
  "div",
15397
16014
  {
15398
16015
  role: "button",
@@ -15456,8 +16073,8 @@ function SDateRangePicker({
15456
16073
  ]
15457
16074
  }
15458
16075
  ) }),
15459
- /* @__PURE__ */ jsx(RPopover11.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx(
15460
- RPopover11.Content,
16076
+ /* @__PURE__ */ jsx(RPopover12.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx(
16077
+ RPopover12.Content,
15461
16078
  {
15462
16079
  side: "bottom",
15463
16080
  align: "start",
@@ -17954,10 +18571,10 @@ function EditorToolbarBar({
17954
18571
  },
17955
18572
  item4
17956
18573
  );
17957
- return /* @__PURE__ */ jsxs(RPopover11.Root, { open: linkOpen, onOpenChange: setLinkOpen, children: [
17958
- /* @__PURE__ */ jsx(RPopover11.Trigger, { asChild: true, disabled: off, children: /* @__PURE__ */ jsx(ToolbarButton, { label: "\uB9C1\uD06C", active: state2.link, disabled: off, children: /* @__PURE__ */ jsx(IconLink, { size: ICON_SIZE }) }) }),
17959
- /* @__PURE__ */ jsx(RPopover11.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx(
17960
- RPopover11.Content,
18574
+ return /* @__PURE__ */ jsxs(RPopover12.Root, { open: linkOpen, onOpenChange: setLinkOpen, children: [
18575
+ /* @__PURE__ */ jsx(RPopover12.Trigger, { asChild: true, disabled: off, children: /* @__PURE__ */ jsx(ToolbarButton, { label: "\uB9C1\uD06C", active: state2.link, disabled: off, children: /* @__PURE__ */ jsx(IconLink, { size: ICON_SIZE }) }) }),
18576
+ /* @__PURE__ */ jsx(RPopover12.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx(
18577
+ RPopover12.Content,
17961
18578
  {
17962
18579
  sideOffset: 4,
17963
18580
  align: "start",
@@ -19165,7 +19782,7 @@ var SChipFilter = /* @__PURE__ */ forwardRef(function SChipFilter2({
19165
19782
  "div",
19166
19783
  {
19167
19784
  className: cn(
19168
- "flex w-full items-start gap-[var(--chipfilter-bar-gap)] border-b border-solid bg-[var(--chipfilter-bar-bg)] px-[var(--chipfilter-bar-padding-x)] py-[var(--chipfilter-bar-padding-y)]",
19785
+ "flex w-full items-start gap-[var(--chipfilter-bar-gap)] bg-[var(--chipfilter-bar-bg)] px-[var(--chipfilter-bar-padding-x)] py-[var(--chipfilter-bar-padding-y)]",
19169
19786
  className
19170
19787
  ),
19171
19788
  style: { ...rootStyle, borderColor: "var(--chipfilter-bar-border)" },
@@ -19293,8 +19910,8 @@ var SChipFilter = /* @__PURE__ */ forwardRef(function SChipFilter2({
19293
19910
  })(),
19294
19911
  hasRightActions && /* @__PURE__ */ jsxs(Fragment, { children: [
19295
19912
  /* @__PURE__ */ jsx(Divider, { inset: true }),
19296
- hasAddButton && /* @__PURE__ */ jsxs(RPopover11.Root, { open: addOpen, onOpenChange: setAddOpen, children: [
19297
- /* @__PURE__ */ jsx(RPopover11.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs(
19913
+ hasAddButton && /* @__PURE__ */ jsxs(RPopover12.Root, { open: addOpen, onOpenChange: setAddOpen, children: [
19914
+ /* @__PURE__ */ jsx(RPopover12.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs(
19298
19915
  "button",
19299
19916
  {
19300
19917
  type: "button",
@@ -19319,8 +19936,8 @@ var SChipFilter = /* @__PURE__ */ forwardRef(function SChipFilter2({
19319
19936
  ]
19320
19937
  }
19321
19938
  ) }),
19322
- /* @__PURE__ */ jsx(RPopover11.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx(
19323
- RPopover11.Content,
19939
+ /* @__PURE__ */ jsx(RPopover12.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx(
19940
+ RPopover12.Content,
19324
19941
  {
19325
19942
  side: "bottom",
19326
19943
  align: "start",
@@ -19355,17 +19972,17 @@ var SChipFilter = /* @__PURE__ */ forwardRef(function SChipFilter2({
19355
19972
  )
19356
19973
  ] })
19357
19974
  ] }),
19358
- /* @__PURE__ */ jsxs(RPopover11.Root, { open: openKey != null, onOpenChange: (next) => !next && setOpenKey(null), children: [
19975
+ /* @__PURE__ */ jsxs(RPopover12.Root, { open: openKey != null, onOpenChange: (next) => !next && setOpenKey(null), children: [
19359
19976
  /* @__PURE__ */ jsx(
19360
- RPopover11.Anchor,
19977
+ RPopover12.Anchor,
19361
19978
  {
19362
19979
  virtualRef: {
19363
19980
  current: openKey ? triggerRefs.current.get(openKey) : null
19364
19981
  }
19365
19982
  }
19366
19983
  ),
19367
- /* @__PURE__ */ jsx(RPopover11.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx(
19368
- RPopover11.Content,
19984
+ /* @__PURE__ */ jsx(RPopover12.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx(
19985
+ RPopover12.Content,
19369
19986
  {
19370
19987
  side: "bottom",
19371
19988
  align: "start",
@@ -19957,8 +20574,8 @@ function InlineDatePresetFilter({
19957
20574
  applied && (rangeValue ? (
19958
20575
  // 뱃지 모양은 그대로 두고, 눌렀을 때 캘린더가 열려 기간을 직접 다시 고를 수 있게 한다.
19959
20576
  // 직접 고르면 프리셋 선택은 해제된다.
19960
- /* @__PURE__ */ jsxs(RPopover11.Root, { open: pickerOpen, onOpenChange: setPickerOpen, children: [
19961
- /* @__PURE__ */ jsx(RPopover11.Trigger, { asChild: true, children: /* @__PURE__ */ jsx(
20577
+ /* @__PURE__ */ jsxs(RPopover12.Root, { open: pickerOpen, onOpenChange: setPickerOpen, children: [
20578
+ /* @__PURE__ */ jsx(RPopover12.Trigger, { asChild: true, children: /* @__PURE__ */ jsx(
19962
20579
  "button",
19963
20580
  {
19964
20581
  type: "button",
@@ -19967,8 +20584,8 @@ function InlineDatePresetFilter({
19967
20584
  children: badge
19968
20585
  }
19969
20586
  ) }),
19970
- /* @__PURE__ */ jsx(RPopover11.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx(
19971
- RPopover11.Content,
20587
+ /* @__PURE__ */ jsx(RPopover12.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx(
20588
+ RPopover12.Content,
19972
20589
  {
19973
20590
  side: "bottom",
19974
20591
  align: "start",
@@ -21276,8 +21893,8 @@ function STimePicker({
21276
21893
  disabled,
21277
21894
  className,
21278
21895
  style,
21279
- children: /* @__PURE__ */ jsxs(RPopover11.Root, { open, onOpenChange: commitOpen, children: [
21280
- /* @__PURE__ */ jsx(RPopover11.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs(
21896
+ children: /* @__PURE__ */ jsxs(RPopover12.Root, { open, onOpenChange: commitOpen, children: [
21897
+ /* @__PURE__ */ jsx(RPopover12.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs(
21281
21898
  "div",
21282
21899
  {
21283
21900
  ref: triggerRef,
@@ -21337,8 +21954,8 @@ function STimePicker({
21337
21954
  ]
21338
21955
  }
21339
21956
  ) }),
21340
- /* @__PURE__ */ jsx(RPopover11.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx(
21341
- RPopover11.Content,
21957
+ /* @__PURE__ */ jsx(RPopover12.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx(
21958
+ RPopover12.Content,
21342
21959
  {
21343
21960
  side: "bottom",
21344
21961
  align: "start",
@@ -21743,8 +22360,8 @@ function STimeRangePicker({
21743
22360
  disabled,
21744
22361
  className,
21745
22362
  style,
21746
- children: /* @__PURE__ */ jsxs(RPopover11.Root, { open, onOpenChange: commitOpen, children: [
21747
- /* @__PURE__ */ jsx(RPopover11.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs(
22363
+ children: /* @__PURE__ */ jsxs(RPopover12.Root, { open, onOpenChange: commitOpen, children: [
22364
+ /* @__PURE__ */ jsx(RPopover12.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs(
21748
22365
  "div",
21749
22366
  {
21750
22367
  ref: triggerRef,
@@ -21804,8 +22421,8 @@ function STimeRangePicker({
21804
22421
  ]
21805
22422
  }
21806
22423
  ) }),
21807
- /* @__PURE__ */ jsx(RPopover11.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx(
21808
- RPopover11.Content,
22424
+ /* @__PURE__ */ jsx(RPopover12.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx(
22425
+ RPopover12.Content,
21809
22426
  {
21810
22427
  side: "bottom",
21811
22428
  align: "start",
@@ -21832,6 +22449,6 @@ function STimeRangePicker({
21832
22449
  );
21833
22450
  }
21834
22451
 
21835
- export { ACCOUNT_LIST_BOX_ICONS, ACCOUNT_LIST_BOX_ITEM_TONES, ACCOUNT_LIST_BOX_LABELS, ACCOUNT_LIST_BOX_LAYOUT, ACCOUNT_LIST_BOX_TONE_CONFIG, BADGE_COLORS, BUTTON_COLORS, BUTTON_SIZES, COLOR_KEYS, FIELD_WIDTH_GRADES, GNB_COLORS, GNB_COMMON, GNB_FOLD_MS, GNB_FULL_LOGO_WIDTH, GNB_HEADER, GNB_MENU, GNB_MENU_WIDTH, GNB_RAIL, GNB_RAIL_WIDTH, GNB_SYSTEM_COLORS, GNB_SYSTEM_COLOR_CONFIG, GNB_SYSTEM_LAYOUT, GNB_SYSTEM_PLACEMENTS, GNB_SYSTEM_TOP_COLOR_CONFIG, ICONS, IMAGE_FITS, PAGE_BACKGROUNDS, PAGE_CONTENT_HEIGHTS, RangeCalendar, SAccountListBox, SActionModal, SBadge, SBarcodeInput, SButton, SCROLL_AREA_AXES, SCalendar, SCallout, SCard, SCheckbox, SChip2 as SChip, SChipFilter, SChipInput, SCircleProgress, SConfirmModal, SDatePicker, SDatePickerMonthListbox, SDatePickerYearListbox, SDateRangePicker, SDivider, SDraggableGroup, SDraggableItem2 as SDraggableItem, SDraggableList, SDraggableProvider, SDrawer, SDropdownButton2 as SDropdownButton, SEDITOR_DEFAULT_FONT_SIZE, SEDITOR_HEADING_LABELS, SEDITOR_HEADING_LEVELS, SEditor, SExpansionItem, SExpansionList2 as SExpansionList, SField, SFilePicker, SForm, SGhostButton, SGnb, SGnbSystem, SGnbSystemContext, SGuide, SIcon, SImage, SInput, SKeyValueTable, SLAYOUT_MIN_WIDTH, SLayout, SLayoutContext, SLinearProgress, SList2 as SList, SListItem2 as SListItem, SLoadingContainer, SLoadingModal, SLoadingViewport, SModal, SModalOutlet, SNumberInput, SPage, SPagination, SPopover, SPopup, SPortal, SRadio, SRadioButton, SRadioCard, SRadioCardGroup, SRadioGroup, SSPLITTER_UNITS, SScrollArea, SSearchInput, SSectionHeaderCard2 as SSectionHeaderCard, SSelect2 as SSelect, SSplitter2 as SSplitter, SStepper, SSwitch, SSystemActionButton, STEPPER_SIZES, STable, STableBar, STabs, STag, STextLink, STextarea, STimePicker, STimeRangePicker, SToast, SToastContainer, SToggle, STooltip2 as STooltip, STree2 as STree, STreeItem2 as STreeItem, SYSTEM_ACTION_BUTTON_COLORS, SYSTEM_ACTION_BUTTON_COLOR_CONFIG, SYSTEM_ACTION_BUTTON_LAYOUT, SYSTEM_ACTION_BUTTON_TYPES, SYSTEM_ACTION_BUTTON_TYPE_CONFIG, TAG_COLORS, TAG_SHAPES, TAG_SIZES, TIMEPICKER_SIZES, TIMEPICKER_SIZE_CONFIG, buttonPreset, cn, fieldWidthValue, findGnbAncestors, findGnbRailValue, isColorKey, isFieldWidthGrade, loading, resolveColor, useSLayout };
22452
+ export { ACCOUNT_LIST_BOX_ICONS, ACCOUNT_LIST_BOX_ITEM_TONES, ACCOUNT_LIST_BOX_LABELS, ACCOUNT_LIST_BOX_LAYOUT, ACCOUNT_LIST_BOX_TONE_CONFIG, BADGE_COLORS, BUTTON_COLORS, BUTTON_SIZES, CALENDAR_BOARD_DAY_BG, CALENDAR_BOARD_DAY_COLORS, CALENDAR_BOARD_EVENT_COLORS, CALENDAR_BOARD_EVENT_PRESETS, CALENDAR_BOARD_MAX_VISIBLE_EVENTS, COLOR_KEYS, FIELD_WIDTH_GRADES, GNB_COLORS, GNB_COMMON, GNB_FOLD_MS, GNB_FULL_LOGO_WIDTH, GNB_HEADER, GNB_MENU, GNB_MENU_WIDTH, GNB_RAIL, GNB_RAIL_WIDTH, GNB_SYSTEM_COLORS, GNB_SYSTEM_COLOR_CONFIG, GNB_SYSTEM_LAYOUT, GNB_SYSTEM_PLACEMENTS, GNB_SYSTEM_TOP_COLOR_CONFIG, ICONS, IMAGE_FITS, PAGE_BACKGROUNDS, PAGE_CONTENT_HEIGHTS, RangeCalendar, SAccountListBox, SActionModal, SBadge, SBarcodeInput, SButton, SCROLL_AREA_AXES, SCalendar, SCalendarBoard, SCallout, SCard, SCheckbox, SChip2 as SChip, SChipFilter, SChipInput, SCircleProgress, SConfirmModal, SDatePicker, SDatePickerMonthListbox, SDatePickerYearListbox, SDateRangePicker, SDivider, SDraggableGroup, SDraggableItem2 as SDraggableItem, SDraggableList, SDraggableProvider, SDrawer, SDropdownButton2 as SDropdownButton, SEDITOR_DEFAULT_FONT_SIZE, SEDITOR_HEADING_LABELS, SEDITOR_HEADING_LEVELS, SEditor, SExpansionItem, SExpansionList2 as SExpansionList, SField, SFilePicker, SForm, SGhostButton, SGnb, SGnbSystem, SGnbSystemContext, SGuide, SIcon, SImage, SInput, SKeyValueTable, SLAYOUT_MIN_WIDTH, SLayout, SLayoutContext, SLinearProgress, SList2 as SList, SListItem2 as SListItem, SLoadingContainer, SLoadingModal, SLoadingViewport, SModal, SModalOutlet, SNumberInput, SPage, SPagination, SPopover, SPopup, SPortal, SRadio, SRadioButton, SRadioCard, SRadioCardGroup, SRadioGroup, SSPLITTER_UNITS, SScrollArea, SSearchInput, SSectionHeaderCard2 as SSectionHeaderCard, SSelect2 as SSelect, SSplitter2 as SSplitter, SStepper, SSwitch, SSystemActionButton, STEPPER_SIZES, STable, STableBar, STabs, STag, STextLink, STextarea, STimePicker, STimeRangePicker, SToast, SToastContainer, SToggle, STooltip2 as STooltip, STree2 as STree, STreeItem2 as STreeItem, SYSTEM_ACTION_BUTTON_COLORS, SYSTEM_ACTION_BUTTON_COLOR_CONFIG, SYSTEM_ACTION_BUTTON_LAYOUT, SYSTEM_ACTION_BUTTON_TYPES, SYSTEM_ACTION_BUTTON_TYPE_CONFIG, TAG_COLORS, TAG_SHAPES, TAG_SIZES, TIMEPICKER_SIZES, TIMEPICKER_SIZE_CONFIG, buttonPreset, cn, fieldWidthValue, findGnbAncestors, findGnbRailValue, isColorKey, isFieldWidthGrade, loading, resolveColor, useSLayout };
21836
22453
  //# sourceMappingURL=index.js.map
21837
22454
  //# sourceMappingURL=index.js.map