@x-plat/design-system 0.16.3 → 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,
@@ -6957,26 +6989,49 @@ var Table = (props) => {
6957
6989
  rowBorderUse = true,
6958
6990
  colBorderUse = true,
6959
6991
  headerSticky = false,
6960
- stickyShadow = true
6992
+ stickyShadow = true,
6993
+ minWidth
6961
6994
  } = props;
6962
- return /* @__PURE__ */ jsx344(
6963
- "div",
6964
- {
6965
- className: `lib-xplat-table-wrapper ${size}`,
6966
- "data-xplat-overlay-escape": "",
6967
- children: /* @__PURE__ */ jsx344(
6968
- TableContext_default.Provider,
6969
- {
6970
- value: {
6971
- rowBorderUse,
6972
- colBorderUse,
6973
- headerSticky,
6974
- stickyShadow
6975
- },
6976
- children: /* @__PURE__ */ jsx344("table", { className: "lib-xplat-table", children })
6977
- }
6978
- )
6979
- }
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
+ )
6980
7035
  );
6981
7036
  };
6982
7037
  Table.displayName = "Table";
@@ -6992,24 +7047,24 @@ TableBody.displayName = "TableBody";
6992
7047
  var TableBody_default = TableBody;
6993
7048
 
6994
7049
  // src/components/Table/TableCell.tsx
6995
- import React38 from "react";
7050
+ import React39 from "react";
6996
7051
 
6997
7052
  // src/components/Table/TableHeadContext.tsx
6998
- import React36 from "react";
6999
- var TableHeadContext = React36.createContext(
7053
+ import React37 from "react";
7054
+ var TableHeadContext = React37.createContext(
7000
7055
  null
7001
7056
  );
7002
7057
  var useTableHeadContext = () => {
7003
- const ctx = React36.useContext(TableHeadContext);
7058
+ const ctx = React37.useContext(TableHeadContext);
7004
7059
  return ctx;
7005
7060
  };
7006
7061
  var TableHeadContext_default = TableHeadContext;
7007
7062
 
7008
7063
  // src/components/Table/TableRowContext.tsx
7009
- import React37 from "react";
7010
- var TableRowContext = React37.createContext(null);
7064
+ import React38 from "react";
7065
+ var TableRowContext = React38.createContext(null);
7011
7066
  var useTableRowContext = () => {
7012
- const ctx = React37.useContext(TableRowContext);
7067
+ const ctx = React38.useContext(TableRowContext);
7013
7068
  if (!ctx) throw new Error("Table components must be used inside <Table>");
7014
7069
  return ctx;
7015
7070
  };
@@ -7017,7 +7072,7 @@ var TableRowContext_default = TableRowContext;
7017
7072
 
7018
7073
  // src/components/Table/TableCell.tsx
7019
7074
  import { jsx as jsx346 } from "react/jsx-runtime";
7020
- var TableCell = React38.memo((props) => {
7075
+ var TableCell = React39.memo((props) => {
7021
7076
  const {
7022
7077
  children,
7023
7078
  align = "center",
@@ -7031,9 +7086,9 @@ var TableCell = React38.memo((props) => {
7031
7086
  const { registerStickyCell, stickyCells } = useTableRowContext();
7032
7087
  const { stickyShadow } = useTableContext();
7033
7088
  const headContext = useTableHeadContext();
7034
- const [left, setLeft] = React38.useState(0);
7035
- const cellRef = React38.useRef(null);
7036
- const calculateLeft = React38.useCallback(() => {
7089
+ const [left, setLeft] = React39.useState(0);
7090
+ const cellRef = React39.useRef(null);
7091
+ const calculateLeft = React39.useCallback(() => {
7037
7092
  if (!cellRef.current) return 0;
7038
7093
  let totalLeft = 0;
7039
7094
  for (const ref of stickyCells) {
@@ -7042,7 +7097,7 @@ var TableCell = React38.memo((props) => {
7042
7097
  }
7043
7098
  return totalLeft;
7044
7099
  }, [stickyCells]);
7045
- React38.useEffect(() => {
7100
+ React39.useEffect(() => {
7046
7101
  if (!isSticky || !cellRef.current) return;
7047
7102
  registerStickyCell(cellRef);
7048
7103
  setLeft(calculateLeft());
@@ -7100,9 +7155,9 @@ TableHead.displayName = "TableHead";
7100
7155
  var TableHead_default = TableHead;
7101
7156
 
7102
7157
  // src/components/Table/TableRow.tsx
7103
- import React39 from "react";
7158
+ import React40 from "react";
7104
7159
  import { jsx as jsx348 } from "react/jsx-runtime";
7105
- var TableRow = React39.memo((props) => {
7160
+ var TableRow = React40.memo((props) => {
7106
7161
  const {
7107
7162
  children,
7108
7163
  type = "secondary",
@@ -7111,7 +7166,7 @@ var TableRow = React39.memo((props) => {
7111
7166
  onClick
7112
7167
  } = props;
7113
7168
  const { rowBorderUse } = useTableContext();
7114
- const [stickyCells, setStickyCells] = React39.useState([]);
7169
+ const [stickyCells, setStickyCells] = React40.useState([]);
7115
7170
  const registerStickyCell = (ref) => {
7116
7171
  setStickyCells((prev) => {
7117
7172
  if (prev.includes(ref)) return prev;
@@ -7142,7 +7197,7 @@ TableRow.displayName = "TableRow";
7142
7197
  var TableRow_default = TableRow;
7143
7198
 
7144
7199
  // src/components/Tag/Tag.tsx
7145
- import { jsx as jsx349, jsxs as jsxs221 } from "react/jsx-runtime";
7200
+ import { jsx as jsx349, jsxs as jsxs222 } from "react/jsx-runtime";
7146
7201
  var Tag = (props) => {
7147
7202
  const {
7148
7203
  children,
@@ -7154,7 +7209,7 @@ var Tag = (props) => {
7154
7209
  colorIndex
7155
7210
  } = props;
7156
7211
  const shape = variant ?? type ?? "neutral";
7157
- return /* @__PURE__ */ jsxs221(
7212
+ return /* @__PURE__ */ jsxs222(
7158
7213
  "span",
7159
7214
  {
7160
7215
  className: clsx_default(
@@ -7175,9 +7230,9 @@ Tag.displayName = "Tag";
7175
7230
  var Tag_default = Tag;
7176
7231
 
7177
7232
  // src/components/TextArea/TextArea.tsx
7178
- import React40 from "react";
7233
+ import React41 from "react";
7179
7234
  import { jsx as jsx350 } from "react/jsx-runtime";
7180
- var TextArea = React40.forwardRef(
7235
+ var TextArea = React41.forwardRef(
7181
7236
  (props, ref) => {
7182
7237
  const {
7183
7238
  className,
@@ -7190,7 +7245,7 @@ var TextArea = React40.forwardRef(
7190
7245
  disabled,
7191
7246
  ...textareaProps
7192
7247
  } = props;
7193
- const autoId = React40.useId();
7248
+ const autoId = React41.useId();
7194
7249
  const fieldId = props.id ?? autoId;
7195
7250
  const control = /* @__PURE__ */ jsx350("div", { className: clsx_default("lib-xplat-textarea-wrap", className), children: /* @__PURE__ */ jsx350(
7196
7251
  "textarea",
@@ -7212,8 +7267,8 @@ TextArea.displayName = "TextArea";
7212
7267
  var TextArea_default = TextArea;
7213
7268
 
7214
7269
  // src/components/TimePicker/TimePicker.tsx
7215
- import React41 from "react";
7216
- 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";
7217
7272
  var ANIMATION_DURATION_MS4 = 200;
7218
7273
  var toMinutes = (hhmm) => {
7219
7274
  if (!hhmm) return null;
@@ -7250,13 +7305,13 @@ var TimePicker = (props) => {
7250
7305
  required,
7251
7306
  validations
7252
7307
  } = props;
7253
- const fieldId = React41.useId();
7254
- const triggerRef = React41.useRef(null);
7255
- const contentRef = React41.useRef(null);
7256
- const [isOpen, setOpen] = React41.useState(false);
7257
- const [mounted, setMounted] = React41.useState(false);
7258
- const [visible, setVisible] = React41.useState(false);
7259
- 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(() => {
7260
7315
  const safeStep = step > 0 && step <= 720 ? step : 30;
7261
7316
  const lo = toMinutes(min) ?? 0;
7262
7317
  const hi = toMinutes(max) ?? 24 * 60 - 1;
@@ -7264,7 +7319,7 @@ var TimePicker = (props) => {
7264
7319
  for (let t = lo; t <= hi; t += safeStep) out.push(toHHmm(t));
7265
7320
  return out;
7266
7321
  }, [step, min, max]);
7267
- const close = React41.useCallback(() => setOpen(false), []);
7322
+ const close = React42.useCallback(() => setOpen(false), []);
7268
7323
  useClickOutside_default([triggerRef, contentRef], close, isOpen);
7269
7324
  useCloseWhenFocusHidden(isOpen, triggerRef, contentRef, close);
7270
7325
  useEscapeKey(isOpen, () => {
@@ -7273,10 +7328,10 @@ var TimePicker = (props) => {
7273
7328
  });
7274
7329
  const host = useOverlayHost_default(triggerRef, mounted);
7275
7330
  useAutoPosition_default(triggerRef, contentRef, mounted);
7276
- React41.useEffect(() => {
7331
+ React42.useEffect(() => {
7277
7332
  if (disabled && isOpen) setOpen(false);
7278
7333
  }, [disabled, isOpen]);
7279
- React41.useEffect(() => {
7334
+ React42.useEffect(() => {
7280
7335
  if (isOpen) {
7281
7336
  setMounted(true);
7282
7337
  const t2 = setTimeout(() => setVisible(true), 1);
@@ -7291,7 +7346,7 @@ var TimePicker = (props) => {
7291
7346
  close();
7292
7347
  triggerRef.current?.focus({ preventScroll: true });
7293
7348
  };
7294
- 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: [
7295
7350
  /* @__PURE__ */ jsx351(
7296
7351
  "div",
7297
7352
  {
@@ -7348,20 +7403,20 @@ TimePicker.displayName = "TimePicker";
7348
7403
  var TimePicker_default = TimePicker;
7349
7404
 
7350
7405
  // src/components/Toast/Toast.tsx
7351
- import React42 from "react";
7406
+ import React43 from "react";
7352
7407
  import { createPortal as createPortal3 } from "react-dom";
7353
- import { jsx as jsx352, jsxs as jsxs223 } from "react/jsx-runtime";
7354
- var ToastContext = React42.createContext(null);
7408
+ import { jsx as jsx352, jsxs as jsxs224 } from "react/jsx-runtime";
7409
+ var ToastContext = React43.createContext(null);
7355
7410
  var useToast = () => {
7356
- const ctx = React42.useContext(ToastContext);
7411
+ const ctx = React43.useContext(ToastContext);
7357
7412
  if (!ctx) throw new Error("useToast must be used within ToastProvider");
7358
7413
  return ctx;
7359
7414
  };
7360
7415
  var EXIT_DURATION = 300;
7361
7416
  var ToastItemComponent = ({ item, isExiting, onClose }) => {
7362
- const ref = React42.useRef(null);
7363
- const [height, setHeight] = React42.useState(void 0);
7364
- React42.useEffect(() => {
7417
+ const ref = React43.useRef(null);
7418
+ const [height, setHeight] = React43.useState(void 0);
7419
+ React43.useEffect(() => {
7365
7420
  if (ref.current && !isExiting) {
7366
7421
  setHeight(ref.current.offsetHeight);
7367
7422
  }
@@ -7374,7 +7429,7 @@ var ToastItemComponent = ({ item, isExiting, onClose }) => {
7374
7429
  maxHeight: isExiting ? 0 : height ?? "none",
7375
7430
  marginBottom: isExiting ? 0 : void 0
7376
7431
  },
7377
- children: /* @__PURE__ */ jsxs223(
7432
+ children: /* @__PURE__ */ jsxs224(
7378
7433
  "div",
7379
7434
  {
7380
7435
  ref,
@@ -7393,13 +7448,13 @@ var ToastProvider = ({
7393
7448
  children,
7394
7449
  position = "top-right"
7395
7450
  }) => {
7396
- const [toasts, setToasts] = React42.useState([]);
7397
- const [removing, setRemoving] = React42.useState(/* @__PURE__ */ new Set());
7398
- const [mounted, setMounted] = React42.useState(false);
7399
- 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(() => {
7400
7455
  setMounted(true);
7401
7456
  }, []);
7402
- const remove = React42.useCallback((id) => {
7457
+ const remove = React43.useCallback((id) => {
7403
7458
  setRemoving((prev) => new Set(prev).add(id));
7404
7459
  setTimeout(() => {
7405
7460
  setToasts((prev) => prev.filter((t) => t.id !== id));
@@ -7410,7 +7465,7 @@ var ToastProvider = ({
7410
7465
  });
7411
7466
  }, EXIT_DURATION);
7412
7467
  }, []);
7413
- const toast = React42.useCallback(
7468
+ const toast = React43.useCallback(
7414
7469
  (type, message, duration = 3e3) => {
7415
7470
  const id = `${Date.now()}-${Math.random()}`;
7416
7471
  setToasts((prev) => [...prev, { id, type, message }]);
@@ -7420,7 +7475,7 @@ var ToastProvider = ({
7420
7475
  },
7421
7476
  [remove]
7422
7477
  );
7423
- return /* @__PURE__ */ jsxs223(ToastContext.Provider, { value: { toast }, children: [
7478
+ return /* @__PURE__ */ jsxs224(ToastContext.Provider, { value: { toast }, children: [
7424
7479
  children,
7425
7480
  mounted && createPortal3(
7426
7481
  /* @__PURE__ */ jsx352("div", { className: clsx_default("lib-xplat-toast-container", position), children: toasts.map((t) => /* @__PURE__ */ jsx352(
@@ -7463,8 +7518,8 @@ ToggleChip.displayName = "ToggleChip";
7463
7518
  var ToggleChip_default = ToggleChip;
7464
7519
 
7465
7520
  // src/components/Tooltip/Tooltip.tsx
7466
- import React43 from "react";
7467
- 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";
7468
7523
  var OFFSET = 12;
7469
7524
  var GAP = 8;
7470
7525
  var SHOW_DELAY = 300;
@@ -7479,14 +7534,14 @@ var Tooltip = (props) => {
7479
7534
  disabled = false
7480
7535
  } = props;
7481
7536
  const shape = variant ?? type ?? "dark";
7482
- const triggerRef = React43.useRef(null);
7483
- const tooltipRef = React43.useRef(null);
7484
- const [visible, setVisible] = React43.useState(false);
7485
- const [pos, setPos] = React43.useState({ left: 0, top: 0 });
7486
- const delayTimer = React43.useRef(0);
7487
- const rafRef = React43.useRef(0);
7488
- const cursor = React43.useRef(null);
7489
- 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) => {
7490
7545
  const vw = window.innerWidth;
7491
7546
  const vh = window.innerHeight;
7492
7547
  return {
@@ -7494,7 +7549,7 @@ var Tooltip = (props) => {
7494
7549
  top: Math.min(Math.max(GAP, top), Math.max(GAP, vh - h - GAP))
7495
7550
  };
7496
7551
  }, []);
7497
- const placeAtCursor = React43.useCallback((x, y) => {
7552
+ const placeAtCursor = React44.useCallback((x, y) => {
7498
7553
  const el = tooltipRef.current;
7499
7554
  if (!el) return;
7500
7555
  const w = el.offsetWidth;
@@ -7505,7 +7560,7 @@ var Tooltip = (props) => {
7505
7560
  if (top < GAP) top = y + OFFSET;
7506
7561
  setPos(clamp2(left, top, w, h));
7507
7562
  }, [clamp2]);
7508
- const placeAtTrigger = React43.useCallback(() => {
7563
+ const placeAtTrigger = React44.useCallback(() => {
7509
7564
  const el = tooltipRef.current;
7510
7565
  const trigger = triggerRef.current;
7511
7566
  if (!el || !trigger) return;
@@ -7517,19 +7572,19 @@ var Tooltip = (props) => {
7517
7572
  const left = rect.left + rect.width / 2 - w / 2;
7518
7573
  setPos(clamp2(left, top, w, h));
7519
7574
  }, [clamp2]);
7520
- const reposition = React43.useCallback(() => {
7575
+ const reposition = React44.useCallback(() => {
7521
7576
  if (follow && cursor.current) {
7522
7577
  placeAtCursor(cursor.current.x, cursor.current.y);
7523
7578
  } else {
7524
7579
  placeAtTrigger();
7525
7580
  }
7526
7581
  }, [follow, placeAtCursor, placeAtTrigger]);
7527
- const handleMouseEnter = React43.useCallback((e) => {
7582
+ const handleMouseEnter = React44.useCallback((e) => {
7528
7583
  if (disabled) return;
7529
7584
  cursor.current = { x: e.clientX, y: e.clientY };
7530
7585
  delayTimer.current = window.setTimeout(() => setVisible(true), SHOW_DELAY);
7531
7586
  }, [disabled]);
7532
- const handleMouseMove = React43.useCallback((e) => {
7587
+ const handleMouseMove = React44.useCallback((e) => {
7533
7588
  cursor.current = { x: e.clientX, y: e.clientY };
7534
7589
  if (!visible || !follow) return;
7535
7590
  cancelAnimationFrame(rafRef.current);
@@ -7537,25 +7592,25 @@ var Tooltip = (props) => {
7537
7592
  if (cursor.current) placeAtCursor(cursor.current.x, cursor.current.y);
7538
7593
  });
7539
7594
  }, [visible, follow, placeAtCursor]);
7540
- const close = React43.useCallback(() => {
7595
+ const close = React44.useCallback(() => {
7541
7596
  window.clearTimeout(delayTimer.current);
7542
7597
  cancelAnimationFrame(rafRef.current);
7543
7598
  setVisible(false);
7544
7599
  }, []);
7545
- const handleMouseLeave = React43.useCallback(() => {
7600
+ const handleMouseLeave = React44.useCallback(() => {
7546
7601
  cursor.current = null;
7547
7602
  close();
7548
7603
  }, [close]);
7549
- const handleFocus = React43.useCallback(() => {
7604
+ const handleFocus = React44.useCallback(() => {
7550
7605
  if (disabled) return;
7551
7606
  cursor.current = null;
7552
7607
  setVisible(true);
7553
7608
  }, [disabled]);
7554
- React43.useLayoutEffect(() => {
7609
+ React44.useLayoutEffect(() => {
7555
7610
  if (!visible) return;
7556
7611
  reposition();
7557
7612
  }, [visible, reposition]);
7558
- React43.useEffect(() => {
7613
+ React44.useEffect(() => {
7559
7614
  if (!visible || follow) return;
7560
7615
  const onChange = () => placeAtTrigger();
7561
7616
  window.addEventListener("scroll", onChange, true);
@@ -7565,12 +7620,12 @@ var Tooltip = (props) => {
7565
7620
  window.removeEventListener("resize", onChange);
7566
7621
  };
7567
7622
  }, [visible, follow, placeAtTrigger]);
7568
- React43.useEffect(() => () => {
7623
+ React44.useEffect(() => () => {
7569
7624
  window.clearTimeout(delayTimer.current);
7570
7625
  cancelAnimationFrame(rafRef.current);
7571
7626
  }, []);
7572
7627
  if (!title && !description) return /* @__PURE__ */ jsx354(Fragment6, { children });
7573
- return /* @__PURE__ */ jsxs224(
7628
+ return /* @__PURE__ */ jsxs225(
7574
7629
  "div",
7575
7630
  {
7576
7631
  ref: triggerRef,
@@ -7583,7 +7638,7 @@ var Tooltip = (props) => {
7583
7638
  onBlur: close,
7584
7639
  children: [
7585
7640
  children,
7586
- visible && /* @__PURE__ */ jsx354(Portal_default, { children: /* @__PURE__ */ jsxs224(
7641
+ visible && /* @__PURE__ */ jsx354(Portal_default, { children: /* @__PURE__ */ jsxs225(
7587
7642
  "div",
7588
7643
  {
7589
7644
  ref: tooltipRef,
@@ -7604,10 +7659,10 @@ Tooltip.displayName = "Tooltip";
7604
7659
  var Tooltip_default = Tooltip;
7605
7660
 
7606
7661
  // src/components/Tour/Tour.tsx
7607
- import React45 from "react";
7662
+ import React46 from "react";
7608
7663
 
7609
7664
  // src/tokens/hooks/useScrollLock.ts
7610
- import React44 from "react";
7665
+ import React45 from "react";
7611
7666
  var SCROLL_KEYS = /* @__PURE__ */ new Set([
7612
7667
  " ",
7613
7668
  "PageUp",
@@ -7620,7 +7675,7 @@ var SCROLL_KEYS = /* @__PURE__ */ new Set([
7620
7675
  "ArrowRight"
7621
7676
  ]);
7622
7677
  var useScrollLock = (enabled, allowRef) => {
7623
- React44.useEffect(() => {
7678
+ React45.useEffect(() => {
7624
7679
  if (!enabled) return;
7625
7680
  const allowed = (target) => target instanceof Node && !!allowRef?.current?.contains(target);
7626
7681
  const block = (e) => {
@@ -7649,7 +7704,7 @@ var useScrollLock = (enabled, allowRef) => {
7649
7704
  var useScrollLock_default = useScrollLock;
7650
7705
 
7651
7706
  // src/components/Tour/Tour.tsx
7652
- import { jsx as jsx355, jsxs as jsxs225 } from "react/jsx-runtime";
7707
+ import { jsx as jsx355, jsxs as jsxs226 } from "react/jsx-runtime";
7653
7708
  var VIEWPORT_MARGIN = 16;
7654
7709
  var DEFAULT_PADDING = 8;
7655
7710
  var clamp = (v, min, max) => Math.max(min, Math.min(v, max));
@@ -7670,14 +7725,14 @@ var Tour = (props) => {
7670
7725
  skipLabel = "\uAC74\uB108\uB6F0\uAE30",
7671
7726
  doneLabel = "\uB2E4 \uBD24\uC5B4\uC694"
7672
7727
  } = props;
7673
- const [uncontrolled, setUncontrolled] = React45.useState(0);
7728
+ const [uncontrolled, setUncontrolled] = React46.useState(0);
7674
7729
  const index = current ?? uncontrolled;
7675
7730
  const step = steps[index];
7676
7731
  const isLast = index === steps.length - 1;
7677
- const spotRef = React45.useRef(null);
7678
- const cardRef = React45.useRef(null);
7679
- const [targetFound, setTargetFound] = React45.useState(true);
7680
- 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(
7681
7736
  (next) => {
7682
7737
  if (current === void 0) setUncontrolled(next);
7683
7738
  onStepChange?.(next);
@@ -7687,9 +7742,9 @@ var Tour = (props) => {
7687
7742
  useEscapeKey(open, () => onClose("skip"));
7688
7743
  useFocusTrap(cardRef, open, { trap: true });
7689
7744
  useScrollLock_default(open, cardRef);
7690
- const stepsRef = React45.useRef(steps);
7745
+ const stepsRef = React46.useRef(steps);
7691
7746
  stepsRef.current = steps;
7692
- React45.useEffect(() => {
7747
+ React46.useEffect(() => {
7693
7748
  if (!open) return;
7694
7749
  const target = stepsRef.current[index]?.target;
7695
7750
  if (!target) return;
@@ -7714,7 +7769,7 @@ var Tour = (props) => {
7714
7769
  stop = true;
7715
7770
  };
7716
7771
  }, [open, index]);
7717
- const place = React45.useCallback(() => {
7772
+ const place = React46.useCallback(() => {
7718
7773
  const spot = spotRef.current;
7719
7774
  const card = cardRef.current;
7720
7775
  if (!spot || !card || !step) return;
@@ -7761,7 +7816,7 @@ var Tour = (props) => {
7761
7816
  card.style.top = `${clamp(placed.top, VIEWPORT_MARGIN, window.innerHeight - VIEWPORT_MARGIN - cardH)}px`;
7762
7817
  card.style.left = `${clamp(placed.left, VIEWPORT_MARGIN, window.innerWidth - VIEWPORT_MARGIN - cardW)}px`;
7763
7818
  }, [step]);
7764
- React45.useLayoutEffect(() => {
7819
+ React46.useLayoutEffect(() => {
7765
7820
  if (!open) return;
7766
7821
  place();
7767
7822
  let raf = 0;
@@ -7778,7 +7833,7 @@ var Tour = (props) => {
7778
7833
  raf = requestAnimationFrame(follow);
7779
7834
  return () => cancelAnimationFrame(raf);
7780
7835
  }, [open, index, place]);
7781
- React45.useEffect(() => {
7836
+ React46.useEffect(() => {
7782
7837
  if (!open) return;
7783
7838
  const onMove = () => place();
7784
7839
  window.addEventListener("scroll", onMove, { passive: true, capture: true });
@@ -7789,10 +7844,10 @@ var Tour = (props) => {
7789
7844
  };
7790
7845
  }, [open, place]);
7791
7846
  if (!open || !step) return null;
7792
- 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: [
7793
7848
  !targetFound && /* @__PURE__ */ jsx355("div", { className: "lib-xplat-tour-dim" }),
7794
7849
  /* @__PURE__ */ jsx355("div", { ref: spotRef, className: "lib-xplat-tour-spotlight", "aria-hidden": true }),
7795
- /* @__PURE__ */ jsxs225(
7850
+ /* @__PURE__ */ jsxs226(
7796
7851
  "div",
7797
7852
  {
7798
7853
  ref: cardRef,
@@ -7802,8 +7857,8 @@ var Tour = (props) => {
7802
7857
  "aria-modal": "true",
7803
7858
  "aria-label": typeof step.title === "string" ? step.title : "\uD654\uBA74 \uC548\uB0B4",
7804
7859
  children: [
7805
- /* @__PURE__ */ jsxs225("div", { className: "tour-card-head", children: [
7806
- /* @__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: [
7807
7862
  index + 1,
7808
7863
  " / ",
7809
7864
  steps.length
@@ -7811,9 +7866,9 @@ var Tour = (props) => {
7811
7866
  step.title && /* @__PURE__ */ jsx355("div", { className: "tour-card-title", children: step.title })
7812
7867
  ] }),
7813
7868
  /* @__PURE__ */ jsx355("div", { className: "tour-card-body", children: step.description && /* @__PURE__ */ jsx355("div", { className: "tour-card-description", children: step.description }) }),
7814
- /* @__PURE__ */ jsxs225("div", { className: "tour-card-actions", children: [
7869
+ /* @__PURE__ */ jsxs226("div", { className: "tour-card-actions", children: [
7815
7870
  /* @__PURE__ */ jsx355("button", { type: "button", className: "tour-skip", onClick: () => onClose("skip"), children: skipLabel }),
7816
- /* @__PURE__ */ jsxs225("div", { className: "tour-card-nav", children: [
7871
+ /* @__PURE__ */ jsxs226("div", { className: "tour-card-nav", children: [
7817
7872
  index > 0 && /* @__PURE__ */ jsx355(
7818
7873
  "button",
7819
7874
  {
@@ -7843,9 +7898,9 @@ Tour.displayName = "Tour";
7843
7898
  var Tour_default = Tour;
7844
7899
 
7845
7900
  // src/components/Video/Video.tsx
7846
- import React46 from "react";
7847
- import { jsx as jsx356, jsxs as jsxs226 } from "react/jsx-runtime";
7848
- 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: [
7849
7904
  /* @__PURE__ */ jsx356("rect", { x: "3", y: "5", width: "18", height: "14", rx: "2" }),
7850
7905
  /* @__PURE__ */ jsx356("rect", { x: "12", y: "11", width: "7", height: "6", rx: "1", fill: "currentColor" })
7851
7906
  ] });
@@ -7855,7 +7910,7 @@ var formatTime = (sec) => {
7855
7910
  const s = Math.floor(sec % 60);
7856
7911
  return `${m}:${s.toString().padStart(2, "0")}`;
7857
7912
  };
7858
- var Video = React46.forwardRef((props, ref) => {
7913
+ var Video = React47.forwardRef((props, ref) => {
7859
7914
  const {
7860
7915
  src,
7861
7916
  poster,
@@ -7879,21 +7934,21 @@ var Video = React46.forwardRef((props, ref) => {
7879
7934
  children,
7880
7935
  ...rest
7881
7936
  } = props;
7882
- const containerRef = React46.useRef(null);
7883
- const videoRef = React46.useRef(null);
7884
- const [isPlaying, setIsPlaying] = React46.useState(Boolean(autoPlay));
7885
- const [isLoaded, setIsLoaded] = React46.useState(false);
7886
- const [currentTime, setCurrentTime] = React46.useState(0);
7887
- const [duration, setDuration] = React46.useState(0);
7888
- const [buffered, setBuffered] = React46.useState(0);
7889
- const [volume, setVolume] = React46.useState(1);
7890
- const [isMuted, setIsMuted] = React46.useState(Boolean(muted));
7891
- const [isFullscreen, setIsFullscreen] = React46.useState(false);
7892
- const [playbackRate, setPlaybackRate] = React46.useState(1);
7893
- const [rateMenuOpen, setRateMenuOpen] = React46.useState(false);
7894
- const [captionsOn, setCaptionsOn] = React46.useState(false);
7895
- const [isPip, setIsPip] = React46.useState(false);
7896
- 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(
7897
7952
  (el) => {
7898
7953
  videoRef.current = el;
7899
7954
  if (typeof ref === "function") ref(el);
@@ -7901,14 +7956,14 @@ var Video = React46.forwardRef((props, ref) => {
7901
7956
  },
7902
7957
  [ref]
7903
7958
  );
7904
- React46.useEffect(() => {
7959
+ React47.useEffect(() => {
7905
7960
  const onFsChange = () => {
7906
7961
  setIsFullscreen(document.fullscreenElement === containerRef.current);
7907
7962
  };
7908
7963
  document.addEventListener("fullscreenchange", onFsChange);
7909
7964
  return () => document.removeEventListener("fullscreenchange", onFsChange);
7910
7965
  }, []);
7911
- React46.useEffect(() => {
7966
+ React47.useEffect(() => {
7912
7967
  const v = videoRef.current;
7913
7968
  if (!v) return;
7914
7969
  const onEnter = () => setIsPip(true);
@@ -8022,7 +8077,7 @@ var Video = React46.forwardRef((props, ref) => {
8022
8077
  const volumePct = (isMuted ? 0 : volume) * 100;
8023
8078
  const VolumeGlyph = isMuted || volume === 0 ? VolumeXIcon_default : volume < 0.5 ? VolumeIcon_default : Volume2Icon_default;
8024
8079
  const pipSupported = typeof document !== "undefined" && "pictureInPictureEnabled" in document && document.pictureInPictureEnabled;
8025
- return /* @__PURE__ */ jsxs226(
8080
+ return /* @__PURE__ */ jsxs227(
8026
8081
  "div",
8027
8082
  {
8028
8083
  ref: containerRef,
@@ -8064,7 +8119,7 @@ var Video = React46.forwardRef((props, ref) => {
8064
8119
  children: /* @__PURE__ */ jsx356("span", { className: "center-play-icon", children: /* @__PURE__ */ jsx356(PlayCircleIcon_default, {}) })
8065
8120
  }
8066
8121
  ),
8067
- showControls && /* @__PURE__ */ jsxs226("div", { className: "controls", onClick: (e) => e.stopPropagation(), children: [
8122
+ showControls && /* @__PURE__ */ jsxs227("div", { className: "controls", onClick: (e) => e.stopPropagation(), children: [
8068
8123
  /* @__PURE__ */ jsx356(
8069
8124
  "input",
8070
8125
  {
@@ -8082,7 +8137,7 @@ var Video = React46.forwardRef((props, ref) => {
8082
8137
  }
8083
8138
  }
8084
8139
  ),
8085
- /* @__PURE__ */ jsxs226("div", { className: "controls-row", children: [
8140
+ /* @__PURE__ */ jsxs227("div", { className: "controls-row", children: [
8086
8141
  /* @__PURE__ */ jsx356(
8087
8142
  "button",
8088
8143
  {
@@ -8093,7 +8148,7 @@ var Video = React46.forwardRef((props, ref) => {
8093
8148
  children: isPlaying ? /* @__PURE__ */ jsx356(PauseIcon_default, {}) : /* @__PURE__ */ jsx356(PlayIcon_default, {})
8094
8149
  }
8095
8150
  ),
8096
- /* @__PURE__ */ jsxs226("div", { className: "volume-group", children: [
8151
+ /* @__PURE__ */ jsxs227("div", { className: "volume-group", children: [
8097
8152
  /* @__PURE__ */ jsx356(
8098
8153
  "button",
8099
8154
  {
@@ -8119,14 +8174,14 @@ var Video = React46.forwardRef((props, ref) => {
8119
8174
  }
8120
8175
  )
8121
8176
  ] }),
8122
- /* @__PURE__ */ jsxs226("span", { className: "time", children: [
8177
+ /* @__PURE__ */ jsxs227("span", { className: "time", children: [
8123
8178
  formatTime(currentTime),
8124
8179
  " / ",
8125
8180
  formatTime(duration)
8126
8181
  ] }),
8127
8182
  /* @__PURE__ */ jsx356("div", { className: "controls-spacer" }),
8128
- playbackRates && playbackRates.length > 0 && /* @__PURE__ */ jsxs226("div", { className: clsx_default("rate-group", rateMenuOpen && "is-open"), children: [
8129
- /* @__PURE__ */ jsxs226(
8183
+ playbackRates && playbackRates.length > 0 && /* @__PURE__ */ jsxs227("div", { className: clsx_default("rate-group", rateMenuOpen && "is-open"), children: [
8184
+ /* @__PURE__ */ jsxs227(
8130
8185
  "button",
8131
8186
  {
8132
8187
  type: "button",
@@ -8140,7 +8195,7 @@ var Video = React46.forwardRef((props, ref) => {
8140
8195
  ]
8141
8196
  }
8142
8197
  ),
8143
- 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(
8144
8199
  "button",
8145
8200
  {
8146
8201
  type: "button",