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