@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.
package/dist/index.js CHANGED
@@ -11041,6 +11041,9 @@ var Switch = (props) => {
11041
11041
  Switch.displayName = "Switch";
11042
11042
  var Switch_default = Switch;
11043
11043
 
11044
+ // src/components/Table/Table.tsx
11045
+ import React36 from "react";
11046
+
11044
11047
  // src/components/Table/TableContext.tsx
11045
11048
  import React35 from "react";
11046
11049
  var TableContext = React35.createContext(null);
@@ -11052,7 +11055,36 @@ var useTableContext = () => {
11052
11055
  var TableContext_default = TableContext;
11053
11056
 
11054
11057
  // src/components/Table/Table.tsx
11055
- import { jsx as jsx344 } from "react/jsx-runtime";
11058
+ import { jsx as jsx344, jsxs as jsxs221 } from "react/jsx-runtime";
11059
+ var useScrollExtent = (scrollerRef, thumbRef) => {
11060
+ const [scrollable, setScrollable] = React36.useState(false);
11061
+ React36.useEffect(() => {
11062
+ const el = scrollerRef.current;
11063
+ if (!el) return;
11064
+ const update = () => {
11065
+ const max = el.scrollWidth - el.clientWidth;
11066
+ const can = max > 1;
11067
+ setScrollable(can);
11068
+ const thumb = thumbRef.current;
11069
+ if (!thumb) return;
11070
+ const ratio = can ? el.clientWidth / el.scrollWidth : 1;
11071
+ const w = Math.max(ratio * 100, 8);
11072
+ thumb.style.width = `${w.toFixed(2)}%`;
11073
+ thumb.style.left = can ? `${(el.scrollLeft / max * (100 - w)).toFixed(2)}%` : "0%";
11074
+ };
11075
+ update();
11076
+ el.addEventListener("scroll", update, { passive: true });
11077
+ const ro = new ResizeObserver(update);
11078
+ ro.observe(el);
11079
+ const table = el.firstElementChild;
11080
+ if (table) ro.observe(table);
11081
+ return () => {
11082
+ el.removeEventListener("scroll", update);
11083
+ ro.disconnect();
11084
+ };
11085
+ }, [scrollerRef, thumbRef]);
11086
+ return scrollable;
11087
+ };
11056
11088
  var Table = (props) => {
11057
11089
  const {
11058
11090
  children,
@@ -11063,27 +11095,46 @@ var Table = (props) => {
11063
11095
  stickyShadow = true,
11064
11096
  minWidth
11065
11097
  } = props;
11066
- return /* @__PURE__ */ jsx344(
11067
- "div",
11068
- {
11069
- className: `lib-xplat-table-wrapper ${size}`,
11070
- "data-xplat-overlay-escape": "",
11071
- style: minWidth === void 0 ? void 0 : {
11072
- "--table-min-width": typeof minWidth === "number" ? `${minWidth}px` : minWidth
11073
- },
11074
- children: /* @__PURE__ */ jsx344(
11075
- TableContext_default.Provider,
11076
- {
11077
- value: {
11078
- rowBorderUse,
11079
- colBorderUse,
11080
- headerSticky,
11081
- stickyShadow
11082
- },
11083
- children: /* @__PURE__ */ jsx344("table", { className: "lib-xplat-table", children })
11084
- }
11085
- )
11086
- }
11098
+ const scrollerRef = React36.useRef(null);
11099
+ const thumbRef = React36.useRef(null);
11100
+ const scrollable = useScrollExtent(scrollerRef, thumbRef);
11101
+ return (
11102
+ /**
11103
+ * 바깥 이름(`lib-xplat-table-wrapper`)을 그대로 둔다 — 소비처가 이 클래스를
11104
+ * 자리 잡는 데 쓰고 있을 수 있어서다. 스크롤은 안쪽 `-scroller` 가 맡는다.
11105
+ */
11106
+ /* @__PURE__ */ jsxs221(
11107
+ "div",
11108
+ {
11109
+ className: `lib-xplat-table-wrapper ${size}`,
11110
+ style: minWidth === void 0 ? void 0 : {
11111
+ "--table-min-width": typeof minWidth === "number" ? `${minWidth}px` : minWidth
11112
+ },
11113
+ children: [
11114
+ /* @__PURE__ */ jsx344(
11115
+ "div",
11116
+ {
11117
+ ref: scrollerRef,
11118
+ className: "lib-xplat-table-scroller",
11119
+ "data-xplat-overlay-escape": "",
11120
+ children: /* @__PURE__ */ jsx344(
11121
+ TableContext_default.Provider,
11122
+ {
11123
+ value: {
11124
+ rowBorderUse,
11125
+ colBorderUse,
11126
+ headerSticky,
11127
+ stickyShadow
11128
+ },
11129
+ children: /* @__PURE__ */ jsx344("table", { className: "lib-xplat-table", children })
11130
+ }
11131
+ )
11132
+ }
11133
+ ),
11134
+ /* @__PURE__ */ jsx344("div", { className: `lib-xplat-table-scrollbar${scrollable ? " scrollable" : ""}`, "aria-hidden": true, children: /* @__PURE__ */ jsx344("div", { ref: thumbRef, className: "table-scrollbar-thumb" }) })
11135
+ ]
11136
+ }
11137
+ )
11087
11138
  );
11088
11139
  };
11089
11140
  Table.displayName = "Table";
@@ -11099,24 +11150,24 @@ TableBody.displayName = "TableBody";
11099
11150
  var TableBody_default = TableBody;
11100
11151
 
11101
11152
  // src/components/Table/TableCell.tsx
11102
- import React38 from "react";
11153
+ import React39 from "react";
11103
11154
 
11104
11155
  // src/components/Table/TableHeadContext.tsx
11105
- import React36 from "react";
11106
- var TableHeadContext = React36.createContext(
11156
+ import React37 from "react";
11157
+ var TableHeadContext = React37.createContext(
11107
11158
  null
11108
11159
  );
11109
11160
  var useTableHeadContext = () => {
11110
- const ctx = React36.useContext(TableHeadContext);
11161
+ const ctx = React37.useContext(TableHeadContext);
11111
11162
  return ctx;
11112
11163
  };
11113
11164
  var TableHeadContext_default = TableHeadContext;
11114
11165
 
11115
11166
  // src/components/Table/TableRowContext.tsx
11116
- import React37 from "react";
11117
- var TableRowContext = React37.createContext(null);
11167
+ import React38 from "react";
11168
+ var TableRowContext = React38.createContext(null);
11118
11169
  var useTableRowContext = () => {
11119
- const ctx = React37.useContext(TableRowContext);
11170
+ const ctx = React38.useContext(TableRowContext);
11120
11171
  if (!ctx) throw new Error("Table components must be used inside <Table>");
11121
11172
  return ctx;
11122
11173
  };
@@ -11124,7 +11175,7 @@ var TableRowContext_default = TableRowContext;
11124
11175
 
11125
11176
  // src/components/Table/TableCell.tsx
11126
11177
  import { jsx as jsx346 } from "react/jsx-runtime";
11127
- var TableCell = React38.memo((props) => {
11178
+ var TableCell = React39.memo((props) => {
11128
11179
  const {
11129
11180
  children,
11130
11181
  align = "center",
@@ -11138,9 +11189,9 @@ var TableCell = React38.memo((props) => {
11138
11189
  const { registerStickyCell, stickyCells } = useTableRowContext();
11139
11190
  const { stickyShadow } = useTableContext();
11140
11191
  const headContext = useTableHeadContext();
11141
- const [left, setLeft] = React38.useState(0);
11142
- const cellRef = React38.useRef(null);
11143
- const calculateLeft = React38.useCallback(() => {
11192
+ const [left, setLeft] = React39.useState(0);
11193
+ const cellRef = React39.useRef(null);
11194
+ const calculateLeft = React39.useCallback(() => {
11144
11195
  if (!cellRef.current) return 0;
11145
11196
  let totalLeft = 0;
11146
11197
  for (const ref of stickyCells) {
@@ -11149,7 +11200,7 @@ var TableCell = React38.memo((props) => {
11149
11200
  }
11150
11201
  return totalLeft;
11151
11202
  }, [stickyCells]);
11152
- React38.useEffect(() => {
11203
+ React39.useEffect(() => {
11153
11204
  if (!isSticky || !cellRef.current) return;
11154
11205
  registerStickyCell(cellRef);
11155
11206
  setLeft(calculateLeft());
@@ -11207,9 +11258,9 @@ TableHead.displayName = "TableHead";
11207
11258
  var TableHead_default = TableHead;
11208
11259
 
11209
11260
  // src/components/Table/TableRow.tsx
11210
- import React39 from "react";
11261
+ import React40 from "react";
11211
11262
  import { jsx as jsx348 } from "react/jsx-runtime";
11212
- var TableRow = React39.memo((props) => {
11263
+ var TableRow = React40.memo((props) => {
11213
11264
  const {
11214
11265
  children,
11215
11266
  type = "secondary",
@@ -11218,7 +11269,7 @@ var TableRow = React39.memo((props) => {
11218
11269
  onClick
11219
11270
  } = props;
11220
11271
  const { rowBorderUse } = useTableContext();
11221
- const [stickyCells, setStickyCells] = React39.useState([]);
11272
+ const [stickyCells, setStickyCells] = React40.useState([]);
11222
11273
  const registerStickyCell = (ref) => {
11223
11274
  setStickyCells((prev) => {
11224
11275
  if (prev.includes(ref)) return prev;
@@ -11249,7 +11300,7 @@ TableRow.displayName = "TableRow";
11249
11300
  var TableRow_default = TableRow;
11250
11301
 
11251
11302
  // src/components/Tag/Tag.tsx
11252
- import { jsx as jsx349, jsxs as jsxs221 } from "react/jsx-runtime";
11303
+ import { jsx as jsx349, jsxs as jsxs222 } from "react/jsx-runtime";
11253
11304
  var Tag = (props) => {
11254
11305
  const {
11255
11306
  children,
@@ -11261,7 +11312,7 @@ var Tag = (props) => {
11261
11312
  colorIndex
11262
11313
  } = props;
11263
11314
  const shape = variant ?? type ?? "neutral";
11264
- return /* @__PURE__ */ jsxs221(
11315
+ return /* @__PURE__ */ jsxs222(
11265
11316
  "span",
11266
11317
  {
11267
11318
  className: clsx_default(
@@ -11282,9 +11333,9 @@ Tag.displayName = "Tag";
11282
11333
  var Tag_default = Tag;
11283
11334
 
11284
11335
  // src/components/TextArea/TextArea.tsx
11285
- import React40 from "react";
11336
+ import React41 from "react";
11286
11337
  import { jsx as jsx350 } from "react/jsx-runtime";
11287
- var TextArea = React40.forwardRef(
11338
+ var TextArea = React41.forwardRef(
11288
11339
  (props, ref) => {
11289
11340
  const {
11290
11341
  className,
@@ -11297,7 +11348,7 @@ var TextArea = React40.forwardRef(
11297
11348
  disabled,
11298
11349
  ...textareaProps
11299
11350
  } = props;
11300
- const autoId = React40.useId();
11351
+ const autoId = React41.useId();
11301
11352
  const fieldId = props.id ?? autoId;
11302
11353
  const control = /* @__PURE__ */ jsx350("div", { className: clsx_default("lib-xplat-textarea-wrap", className), children: /* @__PURE__ */ jsx350(
11303
11354
  "textarea",
@@ -11319,8 +11370,8 @@ TextArea.displayName = "TextArea";
11319
11370
  var TextArea_default = TextArea;
11320
11371
 
11321
11372
  // src/components/TimePicker/TimePicker.tsx
11322
- import React41 from "react";
11323
- import { jsx as jsx351, jsxs as jsxs222 } from "react/jsx-runtime";
11373
+ import React42 from "react";
11374
+ import { jsx as jsx351, jsxs as jsxs223 } from "react/jsx-runtime";
11324
11375
  var ANIMATION_DURATION_MS4 = 200;
11325
11376
  var toMinutes = (hhmm) => {
11326
11377
  if (!hhmm) return null;
@@ -11357,13 +11408,13 @@ var TimePicker = (props) => {
11357
11408
  required,
11358
11409
  validations
11359
11410
  } = props;
11360
- const fieldId = React41.useId();
11361
- const triggerRef = React41.useRef(null);
11362
- const contentRef = React41.useRef(null);
11363
- const [isOpen, setOpen] = React41.useState(false);
11364
- const [mounted, setMounted] = React41.useState(false);
11365
- const [visible, setVisible] = React41.useState(false);
11366
- const options = React41.useMemo(() => {
11411
+ const fieldId = React42.useId();
11412
+ const triggerRef = React42.useRef(null);
11413
+ const contentRef = React42.useRef(null);
11414
+ const [isOpen, setOpen] = React42.useState(false);
11415
+ const [mounted, setMounted] = React42.useState(false);
11416
+ const [visible, setVisible] = React42.useState(false);
11417
+ const options = React42.useMemo(() => {
11367
11418
  const safeStep = step > 0 && step <= 720 ? step : 30;
11368
11419
  const lo = toMinutes(min) ?? 0;
11369
11420
  const hi = toMinutes(max) ?? 24 * 60 - 1;
@@ -11371,7 +11422,7 @@ var TimePicker = (props) => {
11371
11422
  for (let t = lo; t <= hi; t += safeStep) out.push(toHHmm(t));
11372
11423
  return out;
11373
11424
  }, [step, min, max]);
11374
- const close = React41.useCallback(() => setOpen(false), []);
11425
+ const close = React42.useCallback(() => setOpen(false), []);
11375
11426
  useClickOutside_default([triggerRef, contentRef], close, isOpen);
11376
11427
  useCloseWhenFocusHidden(isOpen, triggerRef, contentRef, close);
11377
11428
  useEscapeKey(isOpen, () => {
@@ -11380,10 +11431,10 @@ var TimePicker = (props) => {
11380
11431
  });
11381
11432
  const host = useOverlayHost_default(triggerRef, mounted);
11382
11433
  useAutoPosition_default(triggerRef, contentRef, mounted);
11383
- React41.useEffect(() => {
11434
+ React42.useEffect(() => {
11384
11435
  if (disabled && isOpen) setOpen(false);
11385
11436
  }, [disabled, isOpen]);
11386
- React41.useEffect(() => {
11437
+ React42.useEffect(() => {
11387
11438
  if (isOpen) {
11388
11439
  setMounted(true);
11389
11440
  const t2 = setTimeout(() => setVisible(true), 1);
@@ -11398,7 +11449,7 @@ var TimePicker = (props) => {
11398
11449
  close();
11399
11450
  triggerRef.current?.focus({ preventScroll: true });
11400
11451
  };
11401
- const control = /* @__PURE__ */ jsxs222("div", { className: clsx_default("lib-xplat-time-picker", size, disabled && "disabled"), children: [
11452
+ const control = /* @__PURE__ */ jsxs223("div", { className: clsx_default("lib-xplat-time-picker", size, disabled && "disabled"), children: [
11402
11453
  /* @__PURE__ */ jsx351(
11403
11454
  "div",
11404
11455
  {
@@ -11455,20 +11506,20 @@ TimePicker.displayName = "TimePicker";
11455
11506
  var TimePicker_default = TimePicker;
11456
11507
 
11457
11508
  // src/components/Toast/Toast.tsx
11458
- import React42 from "react";
11509
+ import React43 from "react";
11459
11510
  import { createPortal as createPortal3 } from "react-dom";
11460
- import { jsx as jsx352, jsxs as jsxs223 } from "react/jsx-runtime";
11461
- var ToastContext = React42.createContext(null);
11511
+ import { jsx as jsx352, jsxs as jsxs224 } from "react/jsx-runtime";
11512
+ var ToastContext = React43.createContext(null);
11462
11513
  var useToast = () => {
11463
- const ctx = React42.useContext(ToastContext);
11514
+ const ctx = React43.useContext(ToastContext);
11464
11515
  if (!ctx) throw new Error("useToast must be used within ToastProvider");
11465
11516
  return ctx;
11466
11517
  };
11467
11518
  var EXIT_DURATION = 300;
11468
11519
  var ToastItemComponent = ({ item, isExiting, onClose }) => {
11469
- const ref = React42.useRef(null);
11470
- const [height, setHeight] = React42.useState(void 0);
11471
- React42.useEffect(() => {
11520
+ const ref = React43.useRef(null);
11521
+ const [height, setHeight] = React43.useState(void 0);
11522
+ React43.useEffect(() => {
11472
11523
  if (ref.current && !isExiting) {
11473
11524
  setHeight(ref.current.offsetHeight);
11474
11525
  }
@@ -11481,7 +11532,7 @@ var ToastItemComponent = ({ item, isExiting, onClose }) => {
11481
11532
  maxHeight: isExiting ? 0 : height ?? "none",
11482
11533
  marginBottom: isExiting ? 0 : void 0
11483
11534
  },
11484
- children: /* @__PURE__ */ jsxs223(
11535
+ children: /* @__PURE__ */ jsxs224(
11485
11536
  "div",
11486
11537
  {
11487
11538
  ref,
@@ -11500,13 +11551,13 @@ var ToastProvider = ({
11500
11551
  children,
11501
11552
  position = "top-right"
11502
11553
  }) => {
11503
- const [toasts, setToasts] = React42.useState([]);
11504
- const [removing, setRemoving] = React42.useState(/* @__PURE__ */ new Set());
11505
- const [mounted, setMounted] = React42.useState(false);
11506
- React42.useEffect(() => {
11554
+ const [toasts, setToasts] = React43.useState([]);
11555
+ const [removing, setRemoving] = React43.useState(/* @__PURE__ */ new Set());
11556
+ const [mounted, setMounted] = React43.useState(false);
11557
+ React43.useEffect(() => {
11507
11558
  setMounted(true);
11508
11559
  }, []);
11509
- const remove = React42.useCallback((id) => {
11560
+ const remove = React43.useCallback((id) => {
11510
11561
  setRemoving((prev) => new Set(prev).add(id));
11511
11562
  setTimeout(() => {
11512
11563
  setToasts((prev) => prev.filter((t) => t.id !== id));
@@ -11517,7 +11568,7 @@ var ToastProvider = ({
11517
11568
  });
11518
11569
  }, EXIT_DURATION);
11519
11570
  }, []);
11520
- const toast = React42.useCallback(
11571
+ const toast = React43.useCallback(
11521
11572
  (type, message, duration = 3e3) => {
11522
11573
  const id = `${Date.now()}-${Math.random()}`;
11523
11574
  setToasts((prev) => [...prev, { id, type, message }]);
@@ -11527,7 +11578,7 @@ var ToastProvider = ({
11527
11578
  },
11528
11579
  [remove]
11529
11580
  );
11530
- return /* @__PURE__ */ jsxs223(ToastContext.Provider, { value: { toast }, children: [
11581
+ return /* @__PURE__ */ jsxs224(ToastContext.Provider, { value: { toast }, children: [
11531
11582
  children,
11532
11583
  mounted && createPortal3(
11533
11584
  /* @__PURE__ */ jsx352("div", { className: clsx_default("lib-xplat-toast-container", position), children: toasts.map((t) => /* @__PURE__ */ jsx352(
@@ -11570,8 +11621,8 @@ ToggleChip.displayName = "ToggleChip";
11570
11621
  var ToggleChip_default = ToggleChip;
11571
11622
 
11572
11623
  // src/components/Tooltip/Tooltip.tsx
11573
- import React43 from "react";
11574
- import { Fragment as Fragment6, jsx as jsx354, jsxs as jsxs224 } from "react/jsx-runtime";
11624
+ import React44 from "react";
11625
+ import { Fragment as Fragment6, jsx as jsx354, jsxs as jsxs225 } from "react/jsx-runtime";
11575
11626
  var OFFSET = 12;
11576
11627
  var GAP = 8;
11577
11628
  var SHOW_DELAY = 300;
@@ -11586,14 +11637,14 @@ var Tooltip = (props) => {
11586
11637
  disabled = false
11587
11638
  } = props;
11588
11639
  const shape = variant ?? type ?? "dark";
11589
- const triggerRef = React43.useRef(null);
11590
- const tooltipRef = React43.useRef(null);
11591
- const [visible, setVisible] = React43.useState(false);
11592
- const [pos, setPos] = React43.useState({ left: 0, top: 0 });
11593
- const delayTimer = React43.useRef(0);
11594
- const rafRef = React43.useRef(0);
11595
- const cursor = React43.useRef(null);
11596
- const clamp2 = React43.useCallback((left, top, w, h) => {
11640
+ const triggerRef = React44.useRef(null);
11641
+ const tooltipRef = React44.useRef(null);
11642
+ const [visible, setVisible] = React44.useState(false);
11643
+ const [pos, setPos] = React44.useState({ left: 0, top: 0 });
11644
+ const delayTimer = React44.useRef(0);
11645
+ const rafRef = React44.useRef(0);
11646
+ const cursor = React44.useRef(null);
11647
+ const clamp2 = React44.useCallback((left, top, w, h) => {
11597
11648
  const vw = window.innerWidth;
11598
11649
  const vh = window.innerHeight;
11599
11650
  return {
@@ -11601,7 +11652,7 @@ var Tooltip = (props) => {
11601
11652
  top: Math.min(Math.max(GAP, top), Math.max(GAP, vh - h - GAP))
11602
11653
  };
11603
11654
  }, []);
11604
- const placeAtCursor = React43.useCallback((x, y) => {
11655
+ const placeAtCursor = React44.useCallback((x, y) => {
11605
11656
  const el = tooltipRef.current;
11606
11657
  if (!el) return;
11607
11658
  const w = el.offsetWidth;
@@ -11612,7 +11663,7 @@ var Tooltip = (props) => {
11612
11663
  if (top < GAP) top = y + OFFSET;
11613
11664
  setPos(clamp2(left, top, w, h));
11614
11665
  }, [clamp2]);
11615
- const placeAtTrigger = React43.useCallback(() => {
11666
+ const placeAtTrigger = React44.useCallback(() => {
11616
11667
  const el = tooltipRef.current;
11617
11668
  const trigger = triggerRef.current;
11618
11669
  if (!el || !trigger) return;
@@ -11624,19 +11675,19 @@ var Tooltip = (props) => {
11624
11675
  const left = rect.left + rect.width / 2 - w / 2;
11625
11676
  setPos(clamp2(left, top, w, h));
11626
11677
  }, [clamp2]);
11627
- const reposition = React43.useCallback(() => {
11678
+ const reposition = React44.useCallback(() => {
11628
11679
  if (follow && cursor.current) {
11629
11680
  placeAtCursor(cursor.current.x, cursor.current.y);
11630
11681
  } else {
11631
11682
  placeAtTrigger();
11632
11683
  }
11633
11684
  }, [follow, placeAtCursor, placeAtTrigger]);
11634
- const handleMouseEnter = React43.useCallback((e) => {
11685
+ const handleMouseEnter = React44.useCallback((e) => {
11635
11686
  if (disabled) return;
11636
11687
  cursor.current = { x: e.clientX, y: e.clientY };
11637
11688
  delayTimer.current = window.setTimeout(() => setVisible(true), SHOW_DELAY);
11638
11689
  }, [disabled]);
11639
- const handleMouseMove = React43.useCallback((e) => {
11690
+ const handleMouseMove = React44.useCallback((e) => {
11640
11691
  cursor.current = { x: e.clientX, y: e.clientY };
11641
11692
  if (!visible || !follow) return;
11642
11693
  cancelAnimationFrame(rafRef.current);
@@ -11644,25 +11695,25 @@ var Tooltip = (props) => {
11644
11695
  if (cursor.current) placeAtCursor(cursor.current.x, cursor.current.y);
11645
11696
  });
11646
11697
  }, [visible, follow, placeAtCursor]);
11647
- const close = React43.useCallback(() => {
11698
+ const close = React44.useCallback(() => {
11648
11699
  window.clearTimeout(delayTimer.current);
11649
11700
  cancelAnimationFrame(rafRef.current);
11650
11701
  setVisible(false);
11651
11702
  }, []);
11652
- const handleMouseLeave = React43.useCallback(() => {
11703
+ const handleMouseLeave = React44.useCallback(() => {
11653
11704
  cursor.current = null;
11654
11705
  close();
11655
11706
  }, [close]);
11656
- const handleFocus = React43.useCallback(() => {
11707
+ const handleFocus = React44.useCallback(() => {
11657
11708
  if (disabled) return;
11658
11709
  cursor.current = null;
11659
11710
  setVisible(true);
11660
11711
  }, [disabled]);
11661
- React43.useLayoutEffect(() => {
11712
+ React44.useLayoutEffect(() => {
11662
11713
  if (!visible) return;
11663
11714
  reposition();
11664
11715
  }, [visible, reposition]);
11665
- React43.useEffect(() => {
11716
+ React44.useEffect(() => {
11666
11717
  if (!visible || follow) return;
11667
11718
  const onChange = () => placeAtTrigger();
11668
11719
  window.addEventListener("scroll", onChange, true);
@@ -11672,12 +11723,12 @@ var Tooltip = (props) => {
11672
11723
  window.removeEventListener("resize", onChange);
11673
11724
  };
11674
11725
  }, [visible, follow, placeAtTrigger]);
11675
- React43.useEffect(() => () => {
11726
+ React44.useEffect(() => () => {
11676
11727
  window.clearTimeout(delayTimer.current);
11677
11728
  cancelAnimationFrame(rafRef.current);
11678
11729
  }, []);
11679
11730
  if (!title && !description) return /* @__PURE__ */ jsx354(Fragment6, { children });
11680
- return /* @__PURE__ */ jsxs224(
11731
+ return /* @__PURE__ */ jsxs225(
11681
11732
  "div",
11682
11733
  {
11683
11734
  ref: triggerRef,
@@ -11690,7 +11741,7 @@ var Tooltip = (props) => {
11690
11741
  onBlur: close,
11691
11742
  children: [
11692
11743
  children,
11693
- visible && /* @__PURE__ */ jsx354(Portal_default, { children: /* @__PURE__ */ jsxs224(
11744
+ visible && /* @__PURE__ */ jsx354(Portal_default, { children: /* @__PURE__ */ jsxs225(
11694
11745
  "div",
11695
11746
  {
11696
11747
  ref: tooltipRef,
@@ -11711,10 +11762,10 @@ Tooltip.displayName = "Tooltip";
11711
11762
  var Tooltip_default = Tooltip;
11712
11763
 
11713
11764
  // src/components/Tour/Tour.tsx
11714
- import React45 from "react";
11765
+ import React46 from "react";
11715
11766
 
11716
11767
  // src/tokens/hooks/useScrollLock.ts
11717
- import React44 from "react";
11768
+ import React45 from "react";
11718
11769
  var SCROLL_KEYS = /* @__PURE__ */ new Set([
11719
11770
  " ",
11720
11771
  "PageUp",
@@ -11727,7 +11778,7 @@ var SCROLL_KEYS = /* @__PURE__ */ new Set([
11727
11778
  "ArrowRight"
11728
11779
  ]);
11729
11780
  var useScrollLock = (enabled, allowRef) => {
11730
- React44.useEffect(() => {
11781
+ React45.useEffect(() => {
11731
11782
  if (!enabled) return;
11732
11783
  const allowed = (target) => target instanceof Node && !!allowRef?.current?.contains(target);
11733
11784
  const block = (e) => {
@@ -11756,7 +11807,7 @@ var useScrollLock = (enabled, allowRef) => {
11756
11807
  var useScrollLock_default = useScrollLock;
11757
11808
 
11758
11809
  // src/components/Tour/Tour.tsx
11759
- import { jsx as jsx355, jsxs as jsxs225 } from "react/jsx-runtime";
11810
+ import { jsx as jsx355, jsxs as jsxs226 } from "react/jsx-runtime";
11760
11811
  var VIEWPORT_MARGIN = 16;
11761
11812
  var DEFAULT_PADDING = 8;
11762
11813
  var clamp = (v, min, max) => Math.max(min, Math.min(v, max));
@@ -11777,14 +11828,14 @@ var Tour = (props) => {
11777
11828
  skipLabel = "\uAC74\uB108\uB6F0\uAE30",
11778
11829
  doneLabel = "\uB2E4 \uBD24\uC5B4\uC694"
11779
11830
  } = props;
11780
- const [uncontrolled, setUncontrolled] = React45.useState(0);
11831
+ const [uncontrolled, setUncontrolled] = React46.useState(0);
11781
11832
  const index = current ?? uncontrolled;
11782
11833
  const step = steps[index];
11783
11834
  const isLast = index === steps.length - 1;
11784
- const spotRef = React45.useRef(null);
11785
- const cardRef = React45.useRef(null);
11786
- const [targetFound, setTargetFound] = React45.useState(true);
11787
- const goTo = React45.useCallback(
11835
+ const spotRef = React46.useRef(null);
11836
+ const cardRef = React46.useRef(null);
11837
+ const [targetFound, setTargetFound] = React46.useState(true);
11838
+ const goTo = React46.useCallback(
11788
11839
  (next) => {
11789
11840
  if (current === void 0) setUncontrolled(next);
11790
11841
  onStepChange?.(next);
@@ -11794,9 +11845,9 @@ var Tour = (props) => {
11794
11845
  useEscapeKey(open, () => onClose("skip"));
11795
11846
  useFocusTrap(cardRef, open, { trap: true });
11796
11847
  useScrollLock_default(open, cardRef);
11797
- const stepsRef = React45.useRef(steps);
11848
+ const stepsRef = React46.useRef(steps);
11798
11849
  stepsRef.current = steps;
11799
- React45.useEffect(() => {
11850
+ React46.useEffect(() => {
11800
11851
  if (!open) return;
11801
11852
  const target = stepsRef.current[index]?.target;
11802
11853
  if (!target) return;
@@ -11821,7 +11872,7 @@ var Tour = (props) => {
11821
11872
  stop = true;
11822
11873
  };
11823
11874
  }, [open, index]);
11824
- const place = React45.useCallback(() => {
11875
+ const place = React46.useCallback(() => {
11825
11876
  const spot = spotRef.current;
11826
11877
  const card = cardRef.current;
11827
11878
  if (!spot || !card || !step) return;
@@ -11868,7 +11919,7 @@ var Tour = (props) => {
11868
11919
  card.style.top = `${clamp(placed.top, VIEWPORT_MARGIN, window.innerHeight - VIEWPORT_MARGIN - cardH)}px`;
11869
11920
  card.style.left = `${clamp(placed.left, VIEWPORT_MARGIN, window.innerWidth - VIEWPORT_MARGIN - cardW)}px`;
11870
11921
  }, [step]);
11871
- React45.useLayoutEffect(() => {
11922
+ React46.useLayoutEffect(() => {
11872
11923
  if (!open) return;
11873
11924
  place();
11874
11925
  let raf = 0;
@@ -11885,7 +11936,7 @@ var Tour = (props) => {
11885
11936
  raf = requestAnimationFrame(follow);
11886
11937
  return () => cancelAnimationFrame(raf);
11887
11938
  }, [open, index, place]);
11888
- React45.useEffect(() => {
11939
+ React46.useEffect(() => {
11889
11940
  if (!open) return;
11890
11941
  const onMove = () => place();
11891
11942
  window.addEventListener("scroll", onMove, { passive: true, capture: true });
@@ -11896,10 +11947,10 @@ var Tour = (props) => {
11896
11947
  };
11897
11948
  }, [open, place]);
11898
11949
  if (!open || !step) return null;
11899
- return /* @__PURE__ */ jsx355(Portal_default, { children: /* @__PURE__ */ jsxs225("div", { className: "lib-xplat-tour", role: "presentation", children: [
11950
+ return /* @__PURE__ */ jsx355(Portal_default, { children: /* @__PURE__ */ jsxs226("div", { className: "lib-xplat-tour", role: "presentation", children: [
11900
11951
  !targetFound && /* @__PURE__ */ jsx355("div", { className: "lib-xplat-tour-dim" }),
11901
11952
  /* @__PURE__ */ jsx355("div", { ref: spotRef, className: "lib-xplat-tour-spotlight", "aria-hidden": true }),
11902
- /* @__PURE__ */ jsxs225(
11953
+ /* @__PURE__ */ jsxs226(
11903
11954
  "div",
11904
11955
  {
11905
11956
  ref: cardRef,
@@ -11909,8 +11960,8 @@ var Tour = (props) => {
11909
11960
  "aria-modal": "true",
11910
11961
  "aria-label": typeof step.title === "string" ? step.title : "\uD654\uBA74 \uC548\uB0B4",
11911
11962
  children: [
11912
- /* @__PURE__ */ jsxs225("div", { className: "tour-card-head", children: [
11913
- /* @__PURE__ */ jsxs225("div", { className: "tour-card-progress", "aria-hidden": true, children: [
11963
+ /* @__PURE__ */ jsxs226("div", { className: "tour-card-head", children: [
11964
+ /* @__PURE__ */ jsxs226("div", { className: "tour-card-progress", "aria-hidden": true, children: [
11914
11965
  index + 1,
11915
11966
  " / ",
11916
11967
  steps.length
@@ -11918,9 +11969,9 @@ var Tour = (props) => {
11918
11969
  step.title && /* @__PURE__ */ jsx355("div", { className: "tour-card-title", children: step.title })
11919
11970
  ] }),
11920
11971
  /* @__PURE__ */ jsx355("div", { className: "tour-card-body", children: step.description && /* @__PURE__ */ jsx355("div", { className: "tour-card-description", children: step.description }) }),
11921
- /* @__PURE__ */ jsxs225("div", { className: "tour-card-actions", children: [
11972
+ /* @__PURE__ */ jsxs226("div", { className: "tour-card-actions", children: [
11922
11973
  /* @__PURE__ */ jsx355("button", { type: "button", className: "tour-skip", onClick: () => onClose("skip"), children: skipLabel }),
11923
- /* @__PURE__ */ jsxs225("div", { className: "tour-card-nav", children: [
11974
+ /* @__PURE__ */ jsxs226("div", { className: "tour-card-nav", children: [
11924
11975
  index > 0 && /* @__PURE__ */ jsx355(
11925
11976
  "button",
11926
11977
  {
@@ -11950,9 +12001,9 @@ Tour.displayName = "Tour";
11950
12001
  var Tour_default = Tour;
11951
12002
 
11952
12003
  // src/components/Video/Video.tsx
11953
- import React46 from "react";
11954
- import { jsx as jsx356, jsxs as jsxs226 } from "react/jsx-runtime";
11955
- 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: [
12004
+ import React47 from "react";
12005
+ import { jsx as jsx356, jsxs as jsxs227 } from "react/jsx-runtime";
12006
+ 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: [
11956
12007
  /* @__PURE__ */ jsx356("rect", { x: "3", y: "5", width: "18", height: "14", rx: "2" }),
11957
12008
  /* @__PURE__ */ jsx356("rect", { x: "12", y: "11", width: "7", height: "6", rx: "1", fill: "currentColor" })
11958
12009
  ] });
@@ -11962,7 +12013,7 @@ var formatTime = (sec) => {
11962
12013
  const s = Math.floor(sec % 60);
11963
12014
  return `${m}:${s.toString().padStart(2, "0")}`;
11964
12015
  };
11965
- var Video = React46.forwardRef((props, ref) => {
12016
+ var Video = React47.forwardRef((props, ref) => {
11966
12017
  const {
11967
12018
  src,
11968
12019
  poster,
@@ -11986,21 +12037,21 @@ var Video = React46.forwardRef((props, ref) => {
11986
12037
  children,
11987
12038
  ...rest
11988
12039
  } = props;
11989
- const containerRef = React46.useRef(null);
11990
- const videoRef = React46.useRef(null);
11991
- const [isPlaying, setIsPlaying] = React46.useState(Boolean(autoPlay));
11992
- const [isLoaded, setIsLoaded] = React46.useState(false);
11993
- const [currentTime, setCurrentTime] = React46.useState(0);
11994
- const [duration, setDuration] = React46.useState(0);
11995
- const [buffered, setBuffered] = React46.useState(0);
11996
- const [volume, setVolume] = React46.useState(1);
11997
- const [isMuted, setIsMuted] = React46.useState(Boolean(muted));
11998
- const [isFullscreen, setIsFullscreen] = React46.useState(false);
11999
- const [playbackRate, setPlaybackRate] = React46.useState(1);
12000
- const [rateMenuOpen, setRateMenuOpen] = React46.useState(false);
12001
- const [captionsOn, setCaptionsOn] = React46.useState(false);
12002
- const [isPip, setIsPip] = React46.useState(false);
12003
- const setRefs = React46.useCallback(
12040
+ const containerRef = React47.useRef(null);
12041
+ const videoRef = React47.useRef(null);
12042
+ const [isPlaying, setIsPlaying] = React47.useState(Boolean(autoPlay));
12043
+ const [isLoaded, setIsLoaded] = React47.useState(false);
12044
+ const [currentTime, setCurrentTime] = React47.useState(0);
12045
+ const [duration, setDuration] = React47.useState(0);
12046
+ const [buffered, setBuffered] = React47.useState(0);
12047
+ const [volume, setVolume] = React47.useState(1);
12048
+ const [isMuted, setIsMuted] = React47.useState(Boolean(muted));
12049
+ const [isFullscreen, setIsFullscreen] = React47.useState(false);
12050
+ const [playbackRate, setPlaybackRate] = React47.useState(1);
12051
+ const [rateMenuOpen, setRateMenuOpen] = React47.useState(false);
12052
+ const [captionsOn, setCaptionsOn] = React47.useState(false);
12053
+ const [isPip, setIsPip] = React47.useState(false);
12054
+ const setRefs = React47.useCallback(
12004
12055
  (el) => {
12005
12056
  videoRef.current = el;
12006
12057
  if (typeof ref === "function") ref(el);
@@ -12008,14 +12059,14 @@ var Video = React46.forwardRef((props, ref) => {
12008
12059
  },
12009
12060
  [ref]
12010
12061
  );
12011
- React46.useEffect(() => {
12062
+ React47.useEffect(() => {
12012
12063
  const onFsChange = () => {
12013
12064
  setIsFullscreen(document.fullscreenElement === containerRef.current);
12014
12065
  };
12015
12066
  document.addEventListener("fullscreenchange", onFsChange);
12016
12067
  return () => document.removeEventListener("fullscreenchange", onFsChange);
12017
12068
  }, []);
12018
- React46.useEffect(() => {
12069
+ React47.useEffect(() => {
12019
12070
  const v = videoRef.current;
12020
12071
  if (!v) return;
12021
12072
  const onEnter = () => setIsPip(true);
@@ -12129,7 +12180,7 @@ var Video = React46.forwardRef((props, ref) => {
12129
12180
  const volumePct = (isMuted ? 0 : volume) * 100;
12130
12181
  const VolumeGlyph = isMuted || volume === 0 ? VolumeXIcon_default : volume < 0.5 ? VolumeIcon_default : Volume2Icon_default;
12131
12182
  const pipSupported = typeof document !== "undefined" && "pictureInPictureEnabled" in document && document.pictureInPictureEnabled;
12132
- return /* @__PURE__ */ jsxs226(
12183
+ return /* @__PURE__ */ jsxs227(
12133
12184
  "div",
12134
12185
  {
12135
12186
  ref: containerRef,
@@ -12171,7 +12222,7 @@ var Video = React46.forwardRef((props, ref) => {
12171
12222
  children: /* @__PURE__ */ jsx356("span", { className: "center-play-icon", children: /* @__PURE__ */ jsx356(PlayCircleIcon_default, {}) })
12172
12223
  }
12173
12224
  ),
12174
- showControls && /* @__PURE__ */ jsxs226("div", { className: "controls", onClick: (e) => e.stopPropagation(), children: [
12225
+ showControls && /* @__PURE__ */ jsxs227("div", { className: "controls", onClick: (e) => e.stopPropagation(), children: [
12175
12226
  /* @__PURE__ */ jsx356(
12176
12227
  "input",
12177
12228
  {
@@ -12189,7 +12240,7 @@ var Video = React46.forwardRef((props, ref) => {
12189
12240
  }
12190
12241
  }
12191
12242
  ),
12192
- /* @__PURE__ */ jsxs226("div", { className: "controls-row", children: [
12243
+ /* @__PURE__ */ jsxs227("div", { className: "controls-row", children: [
12193
12244
  /* @__PURE__ */ jsx356(
12194
12245
  "button",
12195
12246
  {
@@ -12200,7 +12251,7 @@ var Video = React46.forwardRef((props, ref) => {
12200
12251
  children: isPlaying ? /* @__PURE__ */ jsx356(PauseIcon_default, {}) : /* @__PURE__ */ jsx356(PlayIcon_default, {})
12201
12252
  }
12202
12253
  ),
12203
- /* @__PURE__ */ jsxs226("div", { className: "volume-group", children: [
12254
+ /* @__PURE__ */ jsxs227("div", { className: "volume-group", children: [
12204
12255
  /* @__PURE__ */ jsx356(
12205
12256
  "button",
12206
12257
  {
@@ -12226,14 +12277,14 @@ var Video = React46.forwardRef((props, ref) => {
12226
12277
  }
12227
12278
  )
12228
12279
  ] }),
12229
- /* @__PURE__ */ jsxs226("span", { className: "time", children: [
12280
+ /* @__PURE__ */ jsxs227("span", { className: "time", children: [
12230
12281
  formatTime(currentTime),
12231
12282
  " / ",
12232
12283
  formatTime(duration)
12233
12284
  ] }),
12234
12285
  /* @__PURE__ */ jsx356("div", { className: "controls-spacer" }),
12235
- playbackRates && playbackRates.length > 0 && /* @__PURE__ */ jsxs226("div", { className: clsx_default("rate-group", rateMenuOpen && "is-open"), children: [
12236
- /* @__PURE__ */ jsxs226(
12286
+ playbackRates && playbackRates.length > 0 && /* @__PURE__ */ jsxs227("div", { className: clsx_default("rate-group", rateMenuOpen && "is-open"), children: [
12287
+ /* @__PURE__ */ jsxs227(
12237
12288
  "button",
12238
12289
  {
12239
12290
  type: "button",
@@ -12247,7 +12298,7 @@ var Video = React46.forwardRef((props, ref) => {
12247
12298
  ]
12248
12299
  }
12249
12300
  ),
12250
- rateMenuOpen && /* @__PURE__ */ jsx356("ul", { className: "rate-menu", role: "menu", children: playbackRates.map((r2) => /* @__PURE__ */ jsx356("li", { children: /* @__PURE__ */ jsxs226(
12301
+ rateMenuOpen && /* @__PURE__ */ jsx356("ul", { className: "rate-menu", role: "menu", children: playbackRates.map((r2) => /* @__PURE__ */ jsx356("li", { children: /* @__PURE__ */ jsxs227(
12251
12302
  "button",
12252
12303
  {
12253
12304
  type: "button",
@@ -12373,14 +12424,14 @@ GridItem.displayName = "GridItem";
12373
12424
  var Item_default = GridItem;
12374
12425
 
12375
12426
  // src/layout/Header/Header.tsx
12376
- import { jsx as jsx360, jsxs as jsxs227 } from "react/jsx-runtime";
12427
+ import { jsx as jsx360, jsxs as jsxs228 } from "react/jsx-runtime";
12377
12428
  var Header = ({
12378
12429
  leftContent,
12379
12430
  logo,
12380
12431
  centerContent,
12381
12432
  rightContent
12382
12433
  }) => {
12383
- return /* @__PURE__ */ jsxs227("div", { className: "lib-xplat-layout-header", children: [
12434
+ return /* @__PURE__ */ jsxs228("div", { className: "lib-xplat-layout-header", children: [
12384
12435
  /* @__PURE__ */ jsx360("div", { children: leftContent ?? logo }),
12385
12436
  /* @__PURE__ */ jsx360("div", { children: centerContent }),
12386
12437
  /* @__PURE__ */ jsx360("div", { children: rightContent })
@@ -12390,12 +12441,12 @@ Header.displayName = "Header";
12390
12441
  var Header_default = Header;
12391
12442
 
12392
12443
  // src/layout/Layout/Layout.tsx
12393
- import { Fragment as Fragment7, jsx as jsx361, jsxs as jsxs228 } from "react/jsx-runtime";
12444
+ import { Fragment as Fragment7, jsx as jsx361, jsxs as jsxs229 } from "react/jsx-runtime";
12394
12445
  var Layout = (props) => {
12395
12446
  const { header, sideBar, children } = props;
12396
- return /* @__PURE__ */ jsx361("div", { className: "lib-xplat-layout", children: /* @__PURE__ */ jsxs228("div", { className: "lib-xplat-layout-content-wrapper", children: [
12447
+ return /* @__PURE__ */ jsx361("div", { className: "lib-xplat-layout", children: /* @__PURE__ */ jsxs229("div", { className: "lib-xplat-layout-content-wrapper", children: [
12397
12448
  sideBar && /* @__PURE__ */ jsx361(Fragment7, { children: sideBar }),
12398
- /* @__PURE__ */ jsxs228("div", { className: "lib-xplat-layout-content", children: [
12449
+ /* @__PURE__ */ jsxs229("div", { className: "lib-xplat-layout-content", children: [
12399
12450
  header && /* @__PURE__ */ jsx361("div", { className: "lib-xplat-layout-content-header", children: header }),
12400
12451
  children
12401
12452
  ] })
@@ -12405,13 +12456,13 @@ Layout.displayName = "Layout";
12405
12456
  var Layout_default = Layout;
12406
12457
 
12407
12458
  // src/layout/SideBar/SideBar.tsx
12408
- import React48 from "react";
12459
+ import React49 from "react";
12409
12460
 
12410
12461
  // src/layout/SideBar/SideBarContext.tsx
12411
- import React47 from "react";
12412
- var SideBarContext = React47.createContext(null);
12462
+ import React48 from "react";
12463
+ var SideBarContext = React48.createContext(null);
12413
12464
  var useSideBarContext = () => {
12414
- const ctx = React47.useContext(SideBarContext);
12465
+ const ctx = React48.useContext(SideBarContext);
12415
12466
  if (!ctx) throw new Error("Error");
12416
12467
  return ctx;
12417
12468
  };
@@ -12421,7 +12472,7 @@ var SideBarContext_default = SideBarContext;
12421
12472
  import { jsx as jsx362 } from "react/jsx-runtime";
12422
12473
  var SideBar = (props) => {
12423
12474
  const { children, className } = props;
12424
- const [isOpen, setIsOpen] = React48.useState(true);
12475
+ const [isOpen, setIsOpen] = React49.useState(true);
12425
12476
  const handleSwitchSideBar = () => {
12426
12477
  setIsOpen((prev) => !prev);
12427
12478
  };