@x-plat/design-system 0.17.0 → 0.19.0

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.
@@ -2728,9 +2728,9 @@ var ChartTooltip = ({ x, y, containerWidth, containerHeight, tooltipType, childr
2728
2728
  }
2729
2729
  );
2730
2730
  };
2731
- var ChartLegend = ({ data, labels, type }) => {
2731
+ var ChartLegend = ({ data, labels, shape }) => {
2732
2732
  const entries = Object.entries(data);
2733
- if (type === "pie" || type === "doughnut") {
2733
+ if (shape === "pie" || shape === "doughnut") {
2734
2734
  const values = entries.flatMap(([, v]) => v);
2735
2735
  const total = values.reduce((a, b) => a + b, 0) || 1;
2736
2736
  const firstKey = entries[0]?.[0] ?? "";
@@ -2767,8 +2767,9 @@ var ChartLegend = ({ data, labels, type }) => {
2767
2767
  }) });
2768
2768
  };
2769
2769
  var Chart = React6.memo((props) => {
2770
- const { variant, type, data, labels, tooltip: showTooltip = true, tooltipType = "light" } = props;
2770
+ const { variant, type, data, labels, legend, tooltip: showTooltip = true, tooltipType = "light" } = props;
2771
2771
  const shape = variant ?? type ?? "line";
2772
+ const showLegend = legend ?? (shape === "pie" || shape === "doughnut");
2772
2773
  const { tooltip, show, hide, move, containerRef } = useChartTooltip(showTooltip);
2773
2774
  const { width, height } = useChartSize(containerRef);
2774
2775
  const stableData = React6.useMemo(() => data, [JSON.stringify(data)]);
@@ -2782,7 +2783,7 @@ var Chart = React6.memo((props) => {
2782
2783
  ready && shape === "bar" && /* @__PURE__ */ jsx306(BarChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
2783
2784
  ready && shape === "pie" && /* @__PURE__ */ jsx306(PieDonutChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
2784
2785
  ready && shape === "doughnut" && /* @__PURE__ */ jsx306(PieDonutChart, { data: stableData, labels: stableLabels, width, height, animate, isDoughnut: true, onHover: show, onMove: move, onLeave: hide }),
2785
- ready && (type === "pie" || type === "doughnut") && /* @__PURE__ */ jsx306(ChartLegend, { data: stableData, labels: stableLabels, type }),
2786
+ ready && showLegend && /* @__PURE__ */ jsx306(ChartLegend, { data: stableData, labels: stableLabels, shape }),
2786
2787
  tooltip.visible && tooltip.content && /* @__PURE__ */ jsx306(ChartTooltip, { x: tooltip.x, y: tooltip.y, containerWidth: width, containerHeight: height, tooltipType, children: tooltip.content })
2787
2788
  ] });
2788
2789
  });
@@ -6938,6 +6939,9 @@ var Switch = (props) => {
6938
6939
  Switch.displayName = "Switch";
6939
6940
  var Switch_default = Switch;
6940
6941
 
6942
+ // src/components/Table/Table.tsx
6943
+ import React36 from "react";
6944
+
6941
6945
  // src/components/Table/TableContext.tsx
6942
6946
  import React35 from "react";
6943
6947
  var TableContext = React35.createContext(null);
@@ -6949,7 +6953,36 @@ var useTableContext = () => {
6949
6953
  var TableContext_default = TableContext;
6950
6954
 
6951
6955
  // src/components/Table/Table.tsx
6952
- import { jsx as jsx344 } from "react/jsx-runtime";
6956
+ import { jsx as jsx344, jsxs as jsxs221 } from "react/jsx-runtime";
6957
+ var useScrollExtent = (scrollerRef, thumbRef) => {
6958
+ const [scrollable, setScrollable] = React36.useState(false);
6959
+ React36.useEffect(() => {
6960
+ const el = scrollerRef.current;
6961
+ if (!el) return;
6962
+ const update = () => {
6963
+ const max = el.scrollWidth - el.clientWidth;
6964
+ const can = max > 1;
6965
+ setScrollable(can);
6966
+ const thumb = thumbRef.current;
6967
+ if (!thumb) return;
6968
+ const ratio = can ? el.clientWidth / el.scrollWidth : 1;
6969
+ const w = Math.max(ratio * 100, 8);
6970
+ thumb.style.width = `${w.toFixed(2)}%`;
6971
+ thumb.style.left = can ? `${(el.scrollLeft / max * (100 - w)).toFixed(2)}%` : "0%";
6972
+ };
6973
+ update();
6974
+ el.addEventListener("scroll", update, { passive: true });
6975
+ const ro = new ResizeObserver(update);
6976
+ ro.observe(el);
6977
+ const table = el.firstElementChild;
6978
+ if (table) ro.observe(table);
6979
+ return () => {
6980
+ el.removeEventListener("scroll", update);
6981
+ ro.disconnect();
6982
+ };
6983
+ }, [scrollerRef, thumbRef]);
6984
+ return scrollable;
6985
+ };
6953
6986
  var Table = (props) => {
6954
6987
  const {
6955
6988
  children,
@@ -6960,27 +6993,46 @@ var Table = (props) => {
6960
6993
  stickyShadow = true,
6961
6994
  minWidth
6962
6995
  } = props;
6963
- return /* @__PURE__ */ jsx344(
6964
- "div",
6965
- {
6966
- className: `lib-xplat-table-wrapper ${size}`,
6967
- "data-xplat-overlay-escape": "",
6968
- style: minWidth === void 0 ? void 0 : {
6969
- "--table-min-width": typeof minWidth === "number" ? `${minWidth}px` : minWidth
6970
- },
6971
- children: /* @__PURE__ */ jsx344(
6972
- TableContext_default.Provider,
6973
- {
6974
- value: {
6975
- rowBorderUse,
6976
- colBorderUse,
6977
- headerSticky,
6978
- stickyShadow
6979
- },
6980
- children: /* @__PURE__ */ jsx344("table", { className: "lib-xplat-table", children })
6981
- }
6982
- )
6983
- }
6996
+ const scrollerRef = React36.useRef(null);
6997
+ const thumbRef = React36.useRef(null);
6998
+ const scrollable = useScrollExtent(scrollerRef, thumbRef);
6999
+ return (
7000
+ /**
7001
+ * 바깥 이름(`lib-xplat-table-wrapper`)을 그대로 둔다 — 소비처가 이 클래스를
7002
+ * 자리 잡는 데 쓰고 있을 수 있어서다. 스크롤은 안쪽 `-scroller` 가 맡는다.
7003
+ */
7004
+ /* @__PURE__ */ jsxs221(
7005
+ "div",
7006
+ {
7007
+ className: `lib-xplat-table-wrapper ${size}`,
7008
+ style: minWidth === void 0 ? void 0 : {
7009
+ "--table-min-width": typeof minWidth === "number" ? `${minWidth}px` : minWidth
7010
+ },
7011
+ children: [
7012
+ /* @__PURE__ */ jsx344(
7013
+ "div",
7014
+ {
7015
+ ref: scrollerRef,
7016
+ className: "lib-xplat-table-scroller",
7017
+ "data-xplat-overlay-escape": "",
7018
+ children: /* @__PURE__ */ jsx344(
7019
+ TableContext_default.Provider,
7020
+ {
7021
+ value: {
7022
+ rowBorderUse,
7023
+ colBorderUse,
7024
+ headerSticky,
7025
+ stickyShadow
7026
+ },
7027
+ children: /* @__PURE__ */ jsx344("table", { className: "lib-xplat-table", children })
7028
+ }
7029
+ )
7030
+ }
7031
+ ),
7032
+ /* @__PURE__ */ jsx344("div", { className: `lib-xplat-table-scrollbar${scrollable ? " scrollable" : ""}`, "aria-hidden": true, children: /* @__PURE__ */ jsx344("div", { ref: thumbRef, className: "table-scrollbar-thumb" }) })
7033
+ ]
7034
+ }
7035
+ )
6984
7036
  );
6985
7037
  };
6986
7038
  Table.displayName = "Table";
@@ -6996,24 +7048,24 @@ TableBody.displayName = "TableBody";
6996
7048
  var TableBody_default = TableBody;
6997
7049
 
6998
7050
  // src/components/Table/TableCell.tsx
6999
- import React38 from "react";
7051
+ import React39 from "react";
7000
7052
 
7001
7053
  // src/components/Table/TableHeadContext.tsx
7002
- import React36 from "react";
7003
- var TableHeadContext = React36.createContext(
7054
+ import React37 from "react";
7055
+ var TableHeadContext = React37.createContext(
7004
7056
  null
7005
7057
  );
7006
7058
  var useTableHeadContext = () => {
7007
- const ctx = React36.useContext(TableHeadContext);
7059
+ const ctx = React37.useContext(TableHeadContext);
7008
7060
  return ctx;
7009
7061
  };
7010
7062
  var TableHeadContext_default = TableHeadContext;
7011
7063
 
7012
7064
  // src/components/Table/TableRowContext.tsx
7013
- import React37 from "react";
7014
- var TableRowContext = React37.createContext(null);
7065
+ import React38 from "react";
7066
+ var TableRowContext = React38.createContext(null);
7015
7067
  var useTableRowContext = () => {
7016
- const ctx = React37.useContext(TableRowContext);
7068
+ const ctx = React38.useContext(TableRowContext);
7017
7069
  if (!ctx) throw new Error("Table components must be used inside <Table>");
7018
7070
  return ctx;
7019
7071
  };
@@ -7021,7 +7073,7 @@ var TableRowContext_default = TableRowContext;
7021
7073
 
7022
7074
  // src/components/Table/TableCell.tsx
7023
7075
  import { jsx as jsx346 } from "react/jsx-runtime";
7024
- var TableCell = React38.memo((props) => {
7076
+ var TableCell = React39.memo((props) => {
7025
7077
  const {
7026
7078
  children,
7027
7079
  align = "center",
@@ -7035,9 +7087,9 @@ var TableCell = React38.memo((props) => {
7035
7087
  const { registerStickyCell, stickyCells } = useTableRowContext();
7036
7088
  const { stickyShadow } = useTableContext();
7037
7089
  const headContext = useTableHeadContext();
7038
- const [left, setLeft] = React38.useState(0);
7039
- const cellRef = React38.useRef(null);
7040
- const calculateLeft = React38.useCallback(() => {
7090
+ const [left, setLeft] = React39.useState(0);
7091
+ const cellRef = React39.useRef(null);
7092
+ const calculateLeft = React39.useCallback(() => {
7041
7093
  if (!cellRef.current) return 0;
7042
7094
  let totalLeft = 0;
7043
7095
  for (const ref of stickyCells) {
@@ -7046,7 +7098,7 @@ var TableCell = React38.memo((props) => {
7046
7098
  }
7047
7099
  return totalLeft;
7048
7100
  }, [stickyCells]);
7049
- React38.useEffect(() => {
7101
+ React39.useEffect(() => {
7050
7102
  if (!isSticky || !cellRef.current) return;
7051
7103
  registerStickyCell(cellRef);
7052
7104
  setLeft(calculateLeft());
@@ -7104,9 +7156,9 @@ TableHead.displayName = "TableHead";
7104
7156
  var TableHead_default = TableHead;
7105
7157
 
7106
7158
  // src/components/Table/TableRow.tsx
7107
- import React39 from "react";
7159
+ import React40 from "react";
7108
7160
  import { jsx as jsx348 } from "react/jsx-runtime";
7109
- var TableRow = React39.memo((props) => {
7161
+ var TableRow = React40.memo((props) => {
7110
7162
  const {
7111
7163
  children,
7112
7164
  type = "secondary",
@@ -7115,7 +7167,7 @@ var TableRow = React39.memo((props) => {
7115
7167
  onClick
7116
7168
  } = props;
7117
7169
  const { rowBorderUse } = useTableContext();
7118
- const [stickyCells, setStickyCells] = React39.useState([]);
7170
+ const [stickyCells, setStickyCells] = React40.useState([]);
7119
7171
  const registerStickyCell = (ref) => {
7120
7172
  setStickyCells((prev) => {
7121
7173
  if (prev.includes(ref)) return prev;
@@ -7146,7 +7198,7 @@ TableRow.displayName = "TableRow";
7146
7198
  var TableRow_default = TableRow;
7147
7199
 
7148
7200
  // src/components/Tag/Tag.tsx
7149
- import { jsx as jsx349, jsxs as jsxs221 } from "react/jsx-runtime";
7201
+ import { jsx as jsx349, jsxs as jsxs222 } from "react/jsx-runtime";
7150
7202
  var Tag = (props) => {
7151
7203
  const {
7152
7204
  children,
@@ -7158,7 +7210,7 @@ var Tag = (props) => {
7158
7210
  colorIndex
7159
7211
  } = props;
7160
7212
  const shape = variant ?? type ?? "neutral";
7161
- return /* @__PURE__ */ jsxs221(
7213
+ return /* @__PURE__ */ jsxs222(
7162
7214
  "span",
7163
7215
  {
7164
7216
  className: clsx_default(
@@ -7179,9 +7231,9 @@ Tag.displayName = "Tag";
7179
7231
  var Tag_default = Tag;
7180
7232
 
7181
7233
  // src/components/TextArea/TextArea.tsx
7182
- import React40 from "react";
7234
+ import React41 from "react";
7183
7235
  import { jsx as jsx350 } from "react/jsx-runtime";
7184
- var TextArea = React40.forwardRef(
7236
+ var TextArea = React41.forwardRef(
7185
7237
  (props, ref) => {
7186
7238
  const {
7187
7239
  className,
@@ -7194,7 +7246,7 @@ var TextArea = React40.forwardRef(
7194
7246
  disabled,
7195
7247
  ...textareaProps
7196
7248
  } = props;
7197
- const autoId = React40.useId();
7249
+ const autoId = React41.useId();
7198
7250
  const fieldId = props.id ?? autoId;
7199
7251
  const control = /* @__PURE__ */ jsx350("div", { className: clsx_default("lib-xplat-textarea-wrap", className), children: /* @__PURE__ */ jsx350(
7200
7252
  "textarea",
@@ -7216,8 +7268,8 @@ TextArea.displayName = "TextArea";
7216
7268
  var TextArea_default = TextArea;
7217
7269
 
7218
7270
  // src/components/TimePicker/TimePicker.tsx
7219
- import React41 from "react";
7220
- import { jsx as jsx351, jsxs as jsxs222 } from "react/jsx-runtime";
7271
+ import React42 from "react";
7272
+ import { jsx as jsx351, jsxs as jsxs223 } from "react/jsx-runtime";
7221
7273
  var ANIMATION_DURATION_MS4 = 200;
7222
7274
  var toMinutes = (hhmm) => {
7223
7275
  if (!hhmm) return null;
@@ -7254,13 +7306,13 @@ var TimePicker = (props) => {
7254
7306
  required,
7255
7307
  validations
7256
7308
  } = props;
7257
- const fieldId = React41.useId();
7258
- const triggerRef = React41.useRef(null);
7259
- const contentRef = React41.useRef(null);
7260
- const [isOpen, setOpen] = React41.useState(false);
7261
- const [mounted, setMounted] = React41.useState(false);
7262
- const [visible, setVisible] = React41.useState(false);
7263
- const options = React41.useMemo(() => {
7309
+ const fieldId = React42.useId();
7310
+ const triggerRef = React42.useRef(null);
7311
+ const contentRef = React42.useRef(null);
7312
+ const [isOpen, setOpen] = React42.useState(false);
7313
+ const [mounted, setMounted] = React42.useState(false);
7314
+ const [visible, setVisible] = React42.useState(false);
7315
+ const options = React42.useMemo(() => {
7264
7316
  const safeStep = step > 0 && step <= 720 ? step : 30;
7265
7317
  const lo = toMinutes(min) ?? 0;
7266
7318
  const hi = toMinutes(max) ?? 24 * 60 - 1;
@@ -7268,7 +7320,7 @@ var TimePicker = (props) => {
7268
7320
  for (let t = lo; t <= hi; t += safeStep) out.push(toHHmm(t));
7269
7321
  return out;
7270
7322
  }, [step, min, max]);
7271
- const close = React41.useCallback(() => setOpen(false), []);
7323
+ const close = React42.useCallback(() => setOpen(false), []);
7272
7324
  useClickOutside_default([triggerRef, contentRef], close, isOpen);
7273
7325
  useCloseWhenFocusHidden(isOpen, triggerRef, contentRef, close);
7274
7326
  useEscapeKey(isOpen, () => {
@@ -7277,10 +7329,10 @@ var TimePicker = (props) => {
7277
7329
  });
7278
7330
  const host = useOverlayHost_default(triggerRef, mounted);
7279
7331
  useAutoPosition_default(triggerRef, contentRef, mounted);
7280
- React41.useEffect(() => {
7332
+ React42.useEffect(() => {
7281
7333
  if (disabled && isOpen) setOpen(false);
7282
7334
  }, [disabled, isOpen]);
7283
- React41.useEffect(() => {
7335
+ React42.useEffect(() => {
7284
7336
  if (isOpen) {
7285
7337
  setMounted(true);
7286
7338
  const t2 = setTimeout(() => setVisible(true), 1);
@@ -7295,7 +7347,7 @@ var TimePicker = (props) => {
7295
7347
  close();
7296
7348
  triggerRef.current?.focus({ preventScroll: true });
7297
7349
  };
7298
- const control = /* @__PURE__ */ jsxs222("div", { className: clsx_default("lib-xplat-time-picker", size, disabled && "disabled"), children: [
7350
+ const control = /* @__PURE__ */ jsxs223("div", { className: clsx_default("lib-xplat-time-picker", size, disabled && "disabled"), children: [
7299
7351
  /* @__PURE__ */ jsx351(
7300
7352
  "div",
7301
7353
  {
@@ -7352,20 +7404,20 @@ TimePicker.displayName = "TimePicker";
7352
7404
  var TimePicker_default = TimePicker;
7353
7405
 
7354
7406
  // src/components/Toast/Toast.tsx
7355
- import React42 from "react";
7407
+ import React43 from "react";
7356
7408
  import { createPortal as createPortal3 } from "react-dom";
7357
- import { jsx as jsx352, jsxs as jsxs223 } from "react/jsx-runtime";
7358
- var ToastContext = React42.createContext(null);
7409
+ import { jsx as jsx352, jsxs as jsxs224 } from "react/jsx-runtime";
7410
+ var ToastContext = React43.createContext(null);
7359
7411
  var useToast = () => {
7360
- const ctx = React42.useContext(ToastContext);
7412
+ const ctx = React43.useContext(ToastContext);
7361
7413
  if (!ctx) throw new Error("useToast must be used within ToastProvider");
7362
7414
  return ctx;
7363
7415
  };
7364
7416
  var EXIT_DURATION = 300;
7365
7417
  var ToastItemComponent = ({ item, isExiting, onClose }) => {
7366
- const ref = React42.useRef(null);
7367
- const [height, setHeight] = React42.useState(void 0);
7368
- React42.useEffect(() => {
7418
+ const ref = React43.useRef(null);
7419
+ const [height, setHeight] = React43.useState(void 0);
7420
+ React43.useEffect(() => {
7369
7421
  if (ref.current && !isExiting) {
7370
7422
  setHeight(ref.current.offsetHeight);
7371
7423
  }
@@ -7378,7 +7430,7 @@ var ToastItemComponent = ({ item, isExiting, onClose }) => {
7378
7430
  maxHeight: isExiting ? 0 : height ?? "none",
7379
7431
  marginBottom: isExiting ? 0 : void 0
7380
7432
  },
7381
- children: /* @__PURE__ */ jsxs223(
7433
+ children: /* @__PURE__ */ jsxs224(
7382
7434
  "div",
7383
7435
  {
7384
7436
  ref,
@@ -7397,13 +7449,13 @@ var ToastProvider = ({
7397
7449
  children,
7398
7450
  position = "top-right"
7399
7451
  }) => {
7400
- const [toasts, setToasts] = React42.useState([]);
7401
- const [removing, setRemoving] = React42.useState(/* @__PURE__ */ new Set());
7402
- const [mounted, setMounted] = React42.useState(false);
7403
- React42.useEffect(() => {
7452
+ const [toasts, setToasts] = React43.useState([]);
7453
+ const [removing, setRemoving] = React43.useState(/* @__PURE__ */ new Set());
7454
+ const [mounted, setMounted] = React43.useState(false);
7455
+ React43.useEffect(() => {
7404
7456
  setMounted(true);
7405
7457
  }, []);
7406
- const remove = React42.useCallback((id) => {
7458
+ const remove = React43.useCallback((id) => {
7407
7459
  setRemoving((prev) => new Set(prev).add(id));
7408
7460
  setTimeout(() => {
7409
7461
  setToasts((prev) => prev.filter((t) => t.id !== id));
@@ -7414,7 +7466,7 @@ var ToastProvider = ({
7414
7466
  });
7415
7467
  }, EXIT_DURATION);
7416
7468
  }, []);
7417
- const toast = React42.useCallback(
7469
+ const toast = React43.useCallback(
7418
7470
  (type, message, duration = 3e3) => {
7419
7471
  const id = `${Date.now()}-${Math.random()}`;
7420
7472
  setToasts((prev) => [...prev, { id, type, message }]);
@@ -7424,7 +7476,7 @@ var ToastProvider = ({
7424
7476
  },
7425
7477
  [remove]
7426
7478
  );
7427
- return /* @__PURE__ */ jsxs223(ToastContext.Provider, { value: { toast }, children: [
7479
+ return /* @__PURE__ */ jsxs224(ToastContext.Provider, { value: { toast }, children: [
7428
7480
  children,
7429
7481
  mounted && createPortal3(
7430
7482
  /* @__PURE__ */ jsx352("div", { className: clsx_default("lib-xplat-toast-container", position), children: toasts.map((t) => /* @__PURE__ */ jsx352(
@@ -7467,8 +7519,8 @@ ToggleChip.displayName = "ToggleChip";
7467
7519
  var ToggleChip_default = ToggleChip;
7468
7520
 
7469
7521
  // src/components/Tooltip/Tooltip.tsx
7470
- import React43 from "react";
7471
- import { Fragment as Fragment6, jsx as jsx354, jsxs as jsxs224 } from "react/jsx-runtime";
7522
+ import React44 from "react";
7523
+ import { Fragment as Fragment6, jsx as jsx354, jsxs as jsxs225 } from "react/jsx-runtime";
7472
7524
  var OFFSET = 12;
7473
7525
  var GAP = 8;
7474
7526
  var SHOW_DELAY = 300;
@@ -7483,14 +7535,14 @@ var Tooltip = (props) => {
7483
7535
  disabled = false
7484
7536
  } = props;
7485
7537
  const shape = variant ?? type ?? "dark";
7486
- const triggerRef = React43.useRef(null);
7487
- const tooltipRef = React43.useRef(null);
7488
- const [visible, setVisible] = React43.useState(false);
7489
- const [pos, setPos] = React43.useState({ left: 0, top: 0 });
7490
- const delayTimer = React43.useRef(0);
7491
- const rafRef = React43.useRef(0);
7492
- const cursor = React43.useRef(null);
7493
- const clamp2 = React43.useCallback((left, top, w, h) => {
7538
+ const triggerRef = React44.useRef(null);
7539
+ const tooltipRef = React44.useRef(null);
7540
+ const [visible, setVisible] = React44.useState(false);
7541
+ const [pos, setPos] = React44.useState({ left: 0, top: 0 });
7542
+ const delayTimer = React44.useRef(0);
7543
+ const rafRef = React44.useRef(0);
7544
+ const cursor = React44.useRef(null);
7545
+ const clamp2 = React44.useCallback((left, top, w, h) => {
7494
7546
  const vw = window.innerWidth;
7495
7547
  const vh = window.innerHeight;
7496
7548
  return {
@@ -7498,7 +7550,7 @@ var Tooltip = (props) => {
7498
7550
  top: Math.min(Math.max(GAP, top), Math.max(GAP, vh - h - GAP))
7499
7551
  };
7500
7552
  }, []);
7501
- const placeAtCursor = React43.useCallback((x, y) => {
7553
+ const placeAtCursor = React44.useCallback((x, y) => {
7502
7554
  const el = tooltipRef.current;
7503
7555
  if (!el) return;
7504
7556
  const w = el.offsetWidth;
@@ -7509,7 +7561,7 @@ var Tooltip = (props) => {
7509
7561
  if (top < GAP) top = y + OFFSET;
7510
7562
  setPos(clamp2(left, top, w, h));
7511
7563
  }, [clamp2]);
7512
- const placeAtTrigger = React43.useCallback(() => {
7564
+ const placeAtTrigger = React44.useCallback(() => {
7513
7565
  const el = tooltipRef.current;
7514
7566
  const trigger = triggerRef.current;
7515
7567
  if (!el || !trigger) return;
@@ -7521,19 +7573,19 @@ var Tooltip = (props) => {
7521
7573
  const left = rect.left + rect.width / 2 - w / 2;
7522
7574
  setPos(clamp2(left, top, w, h));
7523
7575
  }, [clamp2]);
7524
- const reposition = React43.useCallback(() => {
7576
+ const reposition = React44.useCallback(() => {
7525
7577
  if (follow && cursor.current) {
7526
7578
  placeAtCursor(cursor.current.x, cursor.current.y);
7527
7579
  } else {
7528
7580
  placeAtTrigger();
7529
7581
  }
7530
7582
  }, [follow, placeAtCursor, placeAtTrigger]);
7531
- const handleMouseEnter = React43.useCallback((e) => {
7583
+ const handleMouseEnter = React44.useCallback((e) => {
7532
7584
  if (disabled) return;
7533
7585
  cursor.current = { x: e.clientX, y: e.clientY };
7534
7586
  delayTimer.current = window.setTimeout(() => setVisible(true), SHOW_DELAY);
7535
7587
  }, [disabled]);
7536
- const handleMouseMove = React43.useCallback((e) => {
7588
+ const handleMouseMove = React44.useCallback((e) => {
7537
7589
  cursor.current = { x: e.clientX, y: e.clientY };
7538
7590
  if (!visible || !follow) return;
7539
7591
  cancelAnimationFrame(rafRef.current);
@@ -7541,25 +7593,25 @@ var Tooltip = (props) => {
7541
7593
  if (cursor.current) placeAtCursor(cursor.current.x, cursor.current.y);
7542
7594
  });
7543
7595
  }, [visible, follow, placeAtCursor]);
7544
- const close = React43.useCallback(() => {
7596
+ const close = React44.useCallback(() => {
7545
7597
  window.clearTimeout(delayTimer.current);
7546
7598
  cancelAnimationFrame(rafRef.current);
7547
7599
  setVisible(false);
7548
7600
  }, []);
7549
- const handleMouseLeave = React43.useCallback(() => {
7601
+ const handleMouseLeave = React44.useCallback(() => {
7550
7602
  cursor.current = null;
7551
7603
  close();
7552
7604
  }, [close]);
7553
- const handleFocus = React43.useCallback(() => {
7605
+ const handleFocus = React44.useCallback(() => {
7554
7606
  if (disabled) return;
7555
7607
  cursor.current = null;
7556
7608
  setVisible(true);
7557
7609
  }, [disabled]);
7558
- React43.useLayoutEffect(() => {
7610
+ React44.useLayoutEffect(() => {
7559
7611
  if (!visible) return;
7560
7612
  reposition();
7561
7613
  }, [visible, reposition]);
7562
- React43.useEffect(() => {
7614
+ React44.useEffect(() => {
7563
7615
  if (!visible || follow) return;
7564
7616
  const onChange = () => placeAtTrigger();
7565
7617
  window.addEventListener("scroll", onChange, true);
@@ -7569,12 +7621,12 @@ var Tooltip = (props) => {
7569
7621
  window.removeEventListener("resize", onChange);
7570
7622
  };
7571
7623
  }, [visible, follow, placeAtTrigger]);
7572
- React43.useEffect(() => () => {
7624
+ React44.useEffect(() => () => {
7573
7625
  window.clearTimeout(delayTimer.current);
7574
7626
  cancelAnimationFrame(rafRef.current);
7575
7627
  }, []);
7576
7628
  if (!title && !description) return /* @__PURE__ */ jsx354(Fragment6, { children });
7577
- return /* @__PURE__ */ jsxs224(
7629
+ return /* @__PURE__ */ jsxs225(
7578
7630
  "div",
7579
7631
  {
7580
7632
  ref: triggerRef,
@@ -7587,7 +7639,7 @@ var Tooltip = (props) => {
7587
7639
  onBlur: close,
7588
7640
  children: [
7589
7641
  children,
7590
- visible && /* @__PURE__ */ jsx354(Portal_default, { children: /* @__PURE__ */ jsxs224(
7642
+ visible && /* @__PURE__ */ jsx354(Portal_default, { children: /* @__PURE__ */ jsxs225(
7591
7643
  "div",
7592
7644
  {
7593
7645
  ref: tooltipRef,
@@ -7608,10 +7660,10 @@ Tooltip.displayName = "Tooltip";
7608
7660
  var Tooltip_default = Tooltip;
7609
7661
 
7610
7662
  // src/components/Tour/Tour.tsx
7611
- import React45 from "react";
7663
+ import React46 from "react";
7612
7664
 
7613
7665
  // src/tokens/hooks/useScrollLock.ts
7614
- import React44 from "react";
7666
+ import React45 from "react";
7615
7667
  var SCROLL_KEYS = /* @__PURE__ */ new Set([
7616
7668
  " ",
7617
7669
  "PageUp",
@@ -7624,7 +7676,7 @@ var SCROLL_KEYS = /* @__PURE__ */ new Set([
7624
7676
  "ArrowRight"
7625
7677
  ]);
7626
7678
  var useScrollLock = (enabled, allowRef) => {
7627
- React44.useEffect(() => {
7679
+ React45.useEffect(() => {
7628
7680
  if (!enabled) return;
7629
7681
  const allowed = (target) => target instanceof Node && !!allowRef?.current?.contains(target);
7630
7682
  const block = (e) => {
@@ -7653,7 +7705,7 @@ var useScrollLock = (enabled, allowRef) => {
7653
7705
  var useScrollLock_default = useScrollLock;
7654
7706
 
7655
7707
  // src/components/Tour/Tour.tsx
7656
- import { jsx as jsx355, jsxs as jsxs225 } from "react/jsx-runtime";
7708
+ import { jsx as jsx355, jsxs as jsxs226 } from "react/jsx-runtime";
7657
7709
  var VIEWPORT_MARGIN = 16;
7658
7710
  var DEFAULT_PADDING = 8;
7659
7711
  var clamp = (v, min, max) => Math.max(min, Math.min(v, max));
@@ -7674,14 +7726,14 @@ var Tour = (props) => {
7674
7726
  skipLabel = "\uAC74\uB108\uB6F0\uAE30",
7675
7727
  doneLabel = "\uB2E4 \uBD24\uC5B4\uC694"
7676
7728
  } = props;
7677
- const [uncontrolled, setUncontrolled] = React45.useState(0);
7729
+ const [uncontrolled, setUncontrolled] = React46.useState(0);
7678
7730
  const index = current ?? uncontrolled;
7679
7731
  const step = steps[index];
7680
7732
  const isLast = index === steps.length - 1;
7681
- const spotRef = React45.useRef(null);
7682
- const cardRef = React45.useRef(null);
7683
- const [targetFound, setTargetFound] = React45.useState(true);
7684
- const goTo = React45.useCallback(
7733
+ const spotRef = React46.useRef(null);
7734
+ const cardRef = React46.useRef(null);
7735
+ const [targetFound, setTargetFound] = React46.useState(true);
7736
+ const goTo = React46.useCallback(
7685
7737
  (next) => {
7686
7738
  if (current === void 0) setUncontrolled(next);
7687
7739
  onStepChange?.(next);
@@ -7691,9 +7743,9 @@ var Tour = (props) => {
7691
7743
  useEscapeKey(open, () => onClose("skip"));
7692
7744
  useFocusTrap(cardRef, open, { trap: true });
7693
7745
  useScrollLock_default(open, cardRef);
7694
- const stepsRef = React45.useRef(steps);
7746
+ const stepsRef = React46.useRef(steps);
7695
7747
  stepsRef.current = steps;
7696
- React45.useEffect(() => {
7748
+ React46.useEffect(() => {
7697
7749
  if (!open) return;
7698
7750
  const target = stepsRef.current[index]?.target;
7699
7751
  if (!target) return;
@@ -7718,7 +7770,7 @@ var Tour = (props) => {
7718
7770
  stop = true;
7719
7771
  };
7720
7772
  }, [open, index]);
7721
- const place = React45.useCallback(() => {
7773
+ const place = React46.useCallback(() => {
7722
7774
  const spot = spotRef.current;
7723
7775
  const card = cardRef.current;
7724
7776
  if (!spot || !card || !step) return;
@@ -7765,7 +7817,7 @@ var Tour = (props) => {
7765
7817
  card.style.top = `${clamp(placed.top, VIEWPORT_MARGIN, window.innerHeight - VIEWPORT_MARGIN - cardH)}px`;
7766
7818
  card.style.left = `${clamp(placed.left, VIEWPORT_MARGIN, window.innerWidth - VIEWPORT_MARGIN - cardW)}px`;
7767
7819
  }, [step]);
7768
- React45.useLayoutEffect(() => {
7820
+ React46.useLayoutEffect(() => {
7769
7821
  if (!open) return;
7770
7822
  place();
7771
7823
  let raf = 0;
@@ -7782,7 +7834,7 @@ var Tour = (props) => {
7782
7834
  raf = requestAnimationFrame(follow);
7783
7835
  return () => cancelAnimationFrame(raf);
7784
7836
  }, [open, index, place]);
7785
- React45.useEffect(() => {
7837
+ React46.useEffect(() => {
7786
7838
  if (!open) return;
7787
7839
  const onMove = () => place();
7788
7840
  window.addEventListener("scroll", onMove, { passive: true, capture: true });
@@ -7793,10 +7845,10 @@ var Tour = (props) => {
7793
7845
  };
7794
7846
  }, [open, place]);
7795
7847
  if (!open || !step) return null;
7796
- return /* @__PURE__ */ jsx355(Portal_default, { children: /* @__PURE__ */ jsxs225("div", { className: "lib-xplat-tour", role: "presentation", children: [
7848
+ return /* @__PURE__ */ jsx355(Portal_default, { children: /* @__PURE__ */ jsxs226("div", { className: "lib-xplat-tour", role: "presentation", children: [
7797
7849
  !targetFound && /* @__PURE__ */ jsx355("div", { className: "lib-xplat-tour-dim" }),
7798
7850
  /* @__PURE__ */ jsx355("div", { ref: spotRef, className: "lib-xplat-tour-spotlight", "aria-hidden": true }),
7799
- /* @__PURE__ */ jsxs225(
7851
+ /* @__PURE__ */ jsxs226(
7800
7852
  "div",
7801
7853
  {
7802
7854
  ref: cardRef,
@@ -7806,8 +7858,8 @@ var Tour = (props) => {
7806
7858
  "aria-modal": "true",
7807
7859
  "aria-label": typeof step.title === "string" ? step.title : "\uD654\uBA74 \uC548\uB0B4",
7808
7860
  children: [
7809
- /* @__PURE__ */ jsxs225("div", { className: "tour-card-head", children: [
7810
- /* @__PURE__ */ jsxs225("div", { className: "tour-card-progress", "aria-hidden": true, children: [
7861
+ /* @__PURE__ */ jsxs226("div", { className: "tour-card-head", children: [
7862
+ /* @__PURE__ */ jsxs226("div", { className: "tour-card-progress", "aria-hidden": true, children: [
7811
7863
  index + 1,
7812
7864
  " / ",
7813
7865
  steps.length
@@ -7815,9 +7867,9 @@ var Tour = (props) => {
7815
7867
  step.title && /* @__PURE__ */ jsx355("div", { className: "tour-card-title", children: step.title })
7816
7868
  ] }),
7817
7869
  /* @__PURE__ */ jsx355("div", { className: "tour-card-body", children: step.description && /* @__PURE__ */ jsx355("div", { className: "tour-card-description", children: step.description }) }),
7818
- /* @__PURE__ */ jsxs225("div", { className: "tour-card-actions", children: [
7870
+ /* @__PURE__ */ jsxs226("div", { className: "tour-card-actions", children: [
7819
7871
  /* @__PURE__ */ jsx355("button", { type: "button", className: "tour-skip", onClick: () => onClose("skip"), children: skipLabel }),
7820
- /* @__PURE__ */ jsxs225("div", { className: "tour-card-nav", children: [
7872
+ /* @__PURE__ */ jsxs226("div", { className: "tour-card-nav", children: [
7821
7873
  index > 0 && /* @__PURE__ */ jsx355(
7822
7874
  "button",
7823
7875
  {
@@ -7847,9 +7899,9 @@ Tour.displayName = "Tour";
7847
7899
  var Tour_default = Tour;
7848
7900
 
7849
7901
  // src/components/Video/Video.tsx
7850
- import React46 from "react";
7851
- import { jsx as jsx356, jsxs as jsxs226 } from "react/jsx-runtime";
7852
- var PipIcon = () => /* @__PURE__ */ jsxs226("svg", { viewBox: "0 0 24 24", width: "1em", height: "1em", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
7902
+ import React47 from "react";
7903
+ import { jsx as jsx356, jsxs as jsxs227 } from "react/jsx-runtime";
7904
+ var PipIcon = () => /* @__PURE__ */ jsxs227("svg", { viewBox: "0 0 24 24", width: "1em", height: "1em", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
7853
7905
  /* @__PURE__ */ jsx356("rect", { x: "3", y: "5", width: "18", height: "14", rx: "2" }),
7854
7906
  /* @__PURE__ */ jsx356("rect", { x: "12", y: "11", width: "7", height: "6", rx: "1", fill: "currentColor" })
7855
7907
  ] });
@@ -7859,7 +7911,7 @@ var formatTime = (sec) => {
7859
7911
  const s = Math.floor(sec % 60);
7860
7912
  return `${m}:${s.toString().padStart(2, "0")}`;
7861
7913
  };
7862
- var Video = React46.forwardRef((props, ref) => {
7914
+ var Video = React47.forwardRef((props, ref) => {
7863
7915
  const {
7864
7916
  src,
7865
7917
  poster,
@@ -7883,21 +7935,21 @@ var Video = React46.forwardRef((props, ref) => {
7883
7935
  children,
7884
7936
  ...rest
7885
7937
  } = props;
7886
- const containerRef = React46.useRef(null);
7887
- const videoRef = React46.useRef(null);
7888
- const [isPlaying, setIsPlaying] = React46.useState(Boolean(autoPlay));
7889
- const [isLoaded, setIsLoaded] = React46.useState(false);
7890
- const [currentTime, setCurrentTime] = React46.useState(0);
7891
- const [duration, setDuration] = React46.useState(0);
7892
- const [buffered, setBuffered] = React46.useState(0);
7893
- const [volume, setVolume] = React46.useState(1);
7894
- const [isMuted, setIsMuted] = React46.useState(Boolean(muted));
7895
- const [isFullscreen, setIsFullscreen] = React46.useState(false);
7896
- const [playbackRate, setPlaybackRate] = React46.useState(1);
7897
- const [rateMenuOpen, setRateMenuOpen] = React46.useState(false);
7898
- const [captionsOn, setCaptionsOn] = React46.useState(false);
7899
- const [isPip, setIsPip] = React46.useState(false);
7900
- const setRefs = React46.useCallback(
7938
+ const containerRef = React47.useRef(null);
7939
+ const videoRef = React47.useRef(null);
7940
+ const [isPlaying, setIsPlaying] = React47.useState(Boolean(autoPlay));
7941
+ const [isLoaded, setIsLoaded] = React47.useState(false);
7942
+ const [currentTime, setCurrentTime] = React47.useState(0);
7943
+ const [duration, setDuration] = React47.useState(0);
7944
+ const [buffered, setBuffered] = React47.useState(0);
7945
+ const [volume, setVolume] = React47.useState(1);
7946
+ const [isMuted, setIsMuted] = React47.useState(Boolean(muted));
7947
+ const [isFullscreen, setIsFullscreen] = React47.useState(false);
7948
+ const [playbackRate, setPlaybackRate] = React47.useState(1);
7949
+ const [rateMenuOpen, setRateMenuOpen] = React47.useState(false);
7950
+ const [captionsOn, setCaptionsOn] = React47.useState(false);
7951
+ const [isPip, setIsPip] = React47.useState(false);
7952
+ const setRefs = React47.useCallback(
7901
7953
  (el) => {
7902
7954
  videoRef.current = el;
7903
7955
  if (typeof ref === "function") ref(el);
@@ -7905,14 +7957,14 @@ var Video = React46.forwardRef((props, ref) => {
7905
7957
  },
7906
7958
  [ref]
7907
7959
  );
7908
- React46.useEffect(() => {
7960
+ React47.useEffect(() => {
7909
7961
  const onFsChange = () => {
7910
7962
  setIsFullscreen(document.fullscreenElement === containerRef.current);
7911
7963
  };
7912
7964
  document.addEventListener("fullscreenchange", onFsChange);
7913
7965
  return () => document.removeEventListener("fullscreenchange", onFsChange);
7914
7966
  }, []);
7915
- React46.useEffect(() => {
7967
+ React47.useEffect(() => {
7916
7968
  const v = videoRef.current;
7917
7969
  if (!v) return;
7918
7970
  const onEnter = () => setIsPip(true);
@@ -8026,7 +8078,7 @@ var Video = React46.forwardRef((props, ref) => {
8026
8078
  const volumePct = (isMuted ? 0 : volume) * 100;
8027
8079
  const VolumeGlyph = isMuted || volume === 0 ? VolumeXIcon_default : volume < 0.5 ? VolumeIcon_default : Volume2Icon_default;
8028
8080
  const pipSupported = typeof document !== "undefined" && "pictureInPictureEnabled" in document && document.pictureInPictureEnabled;
8029
- return /* @__PURE__ */ jsxs226(
8081
+ return /* @__PURE__ */ jsxs227(
8030
8082
  "div",
8031
8083
  {
8032
8084
  ref: containerRef,
@@ -8068,7 +8120,7 @@ var Video = React46.forwardRef((props, ref) => {
8068
8120
  children: /* @__PURE__ */ jsx356("span", { className: "center-play-icon", children: /* @__PURE__ */ jsx356(PlayCircleIcon_default, {}) })
8069
8121
  }
8070
8122
  ),
8071
- showControls && /* @__PURE__ */ jsxs226("div", { className: "controls", onClick: (e) => e.stopPropagation(), children: [
8123
+ showControls && /* @__PURE__ */ jsxs227("div", { className: "controls", onClick: (e) => e.stopPropagation(), children: [
8072
8124
  /* @__PURE__ */ jsx356(
8073
8125
  "input",
8074
8126
  {
@@ -8086,7 +8138,7 @@ var Video = React46.forwardRef((props, ref) => {
8086
8138
  }
8087
8139
  }
8088
8140
  ),
8089
- /* @__PURE__ */ jsxs226("div", { className: "controls-row", children: [
8141
+ /* @__PURE__ */ jsxs227("div", { className: "controls-row", children: [
8090
8142
  /* @__PURE__ */ jsx356(
8091
8143
  "button",
8092
8144
  {
@@ -8097,7 +8149,7 @@ var Video = React46.forwardRef((props, ref) => {
8097
8149
  children: isPlaying ? /* @__PURE__ */ jsx356(PauseIcon_default, {}) : /* @__PURE__ */ jsx356(PlayIcon_default, {})
8098
8150
  }
8099
8151
  ),
8100
- /* @__PURE__ */ jsxs226("div", { className: "volume-group", children: [
8152
+ /* @__PURE__ */ jsxs227("div", { className: "volume-group", children: [
8101
8153
  /* @__PURE__ */ jsx356(
8102
8154
  "button",
8103
8155
  {
@@ -8123,14 +8175,14 @@ var Video = React46.forwardRef((props, ref) => {
8123
8175
  }
8124
8176
  )
8125
8177
  ] }),
8126
- /* @__PURE__ */ jsxs226("span", { className: "time", children: [
8178
+ /* @__PURE__ */ jsxs227("span", { className: "time", children: [
8127
8179
  formatTime(currentTime),
8128
8180
  " / ",
8129
8181
  formatTime(duration)
8130
8182
  ] }),
8131
8183
  /* @__PURE__ */ jsx356("div", { className: "controls-spacer" }),
8132
- playbackRates && playbackRates.length > 0 && /* @__PURE__ */ jsxs226("div", { className: clsx_default("rate-group", rateMenuOpen && "is-open"), children: [
8133
- /* @__PURE__ */ jsxs226(
8184
+ playbackRates && playbackRates.length > 0 && /* @__PURE__ */ jsxs227("div", { className: clsx_default("rate-group", rateMenuOpen && "is-open"), children: [
8185
+ /* @__PURE__ */ jsxs227(
8134
8186
  "button",
8135
8187
  {
8136
8188
  type: "button",
@@ -8144,7 +8196,7 @@ var Video = React46.forwardRef((props, ref) => {
8144
8196
  ]
8145
8197
  }
8146
8198
  ),
8147
- rateMenuOpen && /* @__PURE__ */ jsx356("ul", { className: "rate-menu", role: "menu", children: playbackRates.map((r2) => /* @__PURE__ */ jsx356("li", { children: /* @__PURE__ */ jsxs226(
8199
+ rateMenuOpen && /* @__PURE__ */ jsx356("ul", { className: "rate-menu", role: "menu", children: playbackRates.map((r2) => /* @__PURE__ */ jsx356("li", { children: /* @__PURE__ */ jsxs227(
8148
8200
  "button",
8149
8201
  {
8150
8202
  type: "button",