@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.
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,
@@ -11060,26 +11092,49 @@ var Table = (props) => {
11060
11092
  rowBorderUse = true,
11061
11093
  colBorderUse = true,
11062
11094
  headerSticky = false,
11063
- stickyShadow = true
11095
+ stickyShadow = true,
11096
+ minWidth
11064
11097
  } = props;
11065
- return /* @__PURE__ */ jsx344(
11066
- "div",
11067
- {
11068
- className: `lib-xplat-table-wrapper ${size}`,
11069
- "data-xplat-overlay-escape": "",
11070
- children: /* @__PURE__ */ jsx344(
11071
- TableContext_default.Provider,
11072
- {
11073
- value: {
11074
- rowBorderUse,
11075
- colBorderUse,
11076
- headerSticky,
11077
- stickyShadow
11078
- },
11079
- children: /* @__PURE__ */ jsx344("table", { className: "lib-xplat-table", children })
11080
- }
11081
- )
11082
- }
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
+ )
11083
11138
  );
11084
11139
  };
11085
11140
  Table.displayName = "Table";
@@ -11095,24 +11150,24 @@ TableBody.displayName = "TableBody";
11095
11150
  var TableBody_default = TableBody;
11096
11151
 
11097
11152
  // src/components/Table/TableCell.tsx
11098
- import React38 from "react";
11153
+ import React39 from "react";
11099
11154
 
11100
11155
  // src/components/Table/TableHeadContext.tsx
11101
- import React36 from "react";
11102
- var TableHeadContext = React36.createContext(
11156
+ import React37 from "react";
11157
+ var TableHeadContext = React37.createContext(
11103
11158
  null
11104
11159
  );
11105
11160
  var useTableHeadContext = () => {
11106
- const ctx = React36.useContext(TableHeadContext);
11161
+ const ctx = React37.useContext(TableHeadContext);
11107
11162
  return ctx;
11108
11163
  };
11109
11164
  var TableHeadContext_default = TableHeadContext;
11110
11165
 
11111
11166
  // src/components/Table/TableRowContext.tsx
11112
- import React37 from "react";
11113
- var TableRowContext = React37.createContext(null);
11167
+ import React38 from "react";
11168
+ var TableRowContext = React38.createContext(null);
11114
11169
  var useTableRowContext = () => {
11115
- const ctx = React37.useContext(TableRowContext);
11170
+ const ctx = React38.useContext(TableRowContext);
11116
11171
  if (!ctx) throw new Error("Table components must be used inside <Table>");
11117
11172
  return ctx;
11118
11173
  };
@@ -11120,7 +11175,7 @@ var TableRowContext_default = TableRowContext;
11120
11175
 
11121
11176
  // src/components/Table/TableCell.tsx
11122
11177
  import { jsx as jsx346 } from "react/jsx-runtime";
11123
- var TableCell = React38.memo((props) => {
11178
+ var TableCell = React39.memo((props) => {
11124
11179
  const {
11125
11180
  children,
11126
11181
  align = "center",
@@ -11134,9 +11189,9 @@ var TableCell = React38.memo((props) => {
11134
11189
  const { registerStickyCell, stickyCells } = useTableRowContext();
11135
11190
  const { stickyShadow } = useTableContext();
11136
11191
  const headContext = useTableHeadContext();
11137
- const [left, setLeft] = React38.useState(0);
11138
- const cellRef = React38.useRef(null);
11139
- const calculateLeft = React38.useCallback(() => {
11192
+ const [left, setLeft] = React39.useState(0);
11193
+ const cellRef = React39.useRef(null);
11194
+ const calculateLeft = React39.useCallback(() => {
11140
11195
  if (!cellRef.current) return 0;
11141
11196
  let totalLeft = 0;
11142
11197
  for (const ref of stickyCells) {
@@ -11145,7 +11200,7 @@ var TableCell = React38.memo((props) => {
11145
11200
  }
11146
11201
  return totalLeft;
11147
11202
  }, [stickyCells]);
11148
- React38.useEffect(() => {
11203
+ React39.useEffect(() => {
11149
11204
  if (!isSticky || !cellRef.current) return;
11150
11205
  registerStickyCell(cellRef);
11151
11206
  setLeft(calculateLeft());
@@ -11203,9 +11258,9 @@ TableHead.displayName = "TableHead";
11203
11258
  var TableHead_default = TableHead;
11204
11259
 
11205
11260
  // src/components/Table/TableRow.tsx
11206
- import React39 from "react";
11261
+ import React40 from "react";
11207
11262
  import { jsx as jsx348 } from "react/jsx-runtime";
11208
- var TableRow = React39.memo((props) => {
11263
+ var TableRow = React40.memo((props) => {
11209
11264
  const {
11210
11265
  children,
11211
11266
  type = "secondary",
@@ -11214,7 +11269,7 @@ var TableRow = React39.memo((props) => {
11214
11269
  onClick
11215
11270
  } = props;
11216
11271
  const { rowBorderUse } = useTableContext();
11217
- const [stickyCells, setStickyCells] = React39.useState([]);
11272
+ const [stickyCells, setStickyCells] = React40.useState([]);
11218
11273
  const registerStickyCell = (ref) => {
11219
11274
  setStickyCells((prev) => {
11220
11275
  if (prev.includes(ref)) return prev;
@@ -11245,7 +11300,7 @@ TableRow.displayName = "TableRow";
11245
11300
  var TableRow_default = TableRow;
11246
11301
 
11247
11302
  // src/components/Tag/Tag.tsx
11248
- import { jsx as jsx349, jsxs as jsxs221 } from "react/jsx-runtime";
11303
+ import { jsx as jsx349, jsxs as jsxs222 } from "react/jsx-runtime";
11249
11304
  var Tag = (props) => {
11250
11305
  const {
11251
11306
  children,
@@ -11257,7 +11312,7 @@ var Tag = (props) => {
11257
11312
  colorIndex
11258
11313
  } = props;
11259
11314
  const shape = variant ?? type ?? "neutral";
11260
- return /* @__PURE__ */ jsxs221(
11315
+ return /* @__PURE__ */ jsxs222(
11261
11316
  "span",
11262
11317
  {
11263
11318
  className: clsx_default(
@@ -11278,9 +11333,9 @@ Tag.displayName = "Tag";
11278
11333
  var Tag_default = Tag;
11279
11334
 
11280
11335
  // src/components/TextArea/TextArea.tsx
11281
- import React40 from "react";
11336
+ import React41 from "react";
11282
11337
  import { jsx as jsx350 } from "react/jsx-runtime";
11283
- var TextArea = React40.forwardRef(
11338
+ var TextArea = React41.forwardRef(
11284
11339
  (props, ref) => {
11285
11340
  const {
11286
11341
  className,
@@ -11293,7 +11348,7 @@ var TextArea = React40.forwardRef(
11293
11348
  disabled,
11294
11349
  ...textareaProps
11295
11350
  } = props;
11296
- const autoId = React40.useId();
11351
+ const autoId = React41.useId();
11297
11352
  const fieldId = props.id ?? autoId;
11298
11353
  const control = /* @__PURE__ */ jsx350("div", { className: clsx_default("lib-xplat-textarea-wrap", className), children: /* @__PURE__ */ jsx350(
11299
11354
  "textarea",
@@ -11315,8 +11370,8 @@ TextArea.displayName = "TextArea";
11315
11370
  var TextArea_default = TextArea;
11316
11371
 
11317
11372
  // src/components/TimePicker/TimePicker.tsx
11318
- import React41 from "react";
11319
- 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";
11320
11375
  var ANIMATION_DURATION_MS4 = 200;
11321
11376
  var toMinutes = (hhmm) => {
11322
11377
  if (!hhmm) return null;
@@ -11353,13 +11408,13 @@ var TimePicker = (props) => {
11353
11408
  required,
11354
11409
  validations
11355
11410
  } = props;
11356
- const fieldId = React41.useId();
11357
- const triggerRef = React41.useRef(null);
11358
- const contentRef = React41.useRef(null);
11359
- const [isOpen, setOpen] = React41.useState(false);
11360
- const [mounted, setMounted] = React41.useState(false);
11361
- const [visible, setVisible] = React41.useState(false);
11362
- 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(() => {
11363
11418
  const safeStep = step > 0 && step <= 720 ? step : 30;
11364
11419
  const lo = toMinutes(min) ?? 0;
11365
11420
  const hi = toMinutes(max) ?? 24 * 60 - 1;
@@ -11367,7 +11422,7 @@ var TimePicker = (props) => {
11367
11422
  for (let t = lo; t <= hi; t += safeStep) out.push(toHHmm(t));
11368
11423
  return out;
11369
11424
  }, [step, min, max]);
11370
- const close = React41.useCallback(() => setOpen(false), []);
11425
+ const close = React42.useCallback(() => setOpen(false), []);
11371
11426
  useClickOutside_default([triggerRef, contentRef], close, isOpen);
11372
11427
  useCloseWhenFocusHidden(isOpen, triggerRef, contentRef, close);
11373
11428
  useEscapeKey(isOpen, () => {
@@ -11376,10 +11431,10 @@ var TimePicker = (props) => {
11376
11431
  });
11377
11432
  const host = useOverlayHost_default(triggerRef, mounted);
11378
11433
  useAutoPosition_default(triggerRef, contentRef, mounted);
11379
- React41.useEffect(() => {
11434
+ React42.useEffect(() => {
11380
11435
  if (disabled && isOpen) setOpen(false);
11381
11436
  }, [disabled, isOpen]);
11382
- React41.useEffect(() => {
11437
+ React42.useEffect(() => {
11383
11438
  if (isOpen) {
11384
11439
  setMounted(true);
11385
11440
  const t2 = setTimeout(() => setVisible(true), 1);
@@ -11394,7 +11449,7 @@ var TimePicker = (props) => {
11394
11449
  close();
11395
11450
  triggerRef.current?.focus({ preventScroll: true });
11396
11451
  };
11397
- 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: [
11398
11453
  /* @__PURE__ */ jsx351(
11399
11454
  "div",
11400
11455
  {
@@ -11451,20 +11506,20 @@ TimePicker.displayName = "TimePicker";
11451
11506
  var TimePicker_default = TimePicker;
11452
11507
 
11453
11508
  // src/components/Toast/Toast.tsx
11454
- import React42 from "react";
11509
+ import React43 from "react";
11455
11510
  import { createPortal as createPortal3 } from "react-dom";
11456
- import { jsx as jsx352, jsxs as jsxs223 } from "react/jsx-runtime";
11457
- var ToastContext = React42.createContext(null);
11511
+ import { jsx as jsx352, jsxs as jsxs224 } from "react/jsx-runtime";
11512
+ var ToastContext = React43.createContext(null);
11458
11513
  var useToast = () => {
11459
- const ctx = React42.useContext(ToastContext);
11514
+ const ctx = React43.useContext(ToastContext);
11460
11515
  if (!ctx) throw new Error("useToast must be used within ToastProvider");
11461
11516
  return ctx;
11462
11517
  };
11463
11518
  var EXIT_DURATION = 300;
11464
11519
  var ToastItemComponent = ({ item, isExiting, onClose }) => {
11465
- const ref = React42.useRef(null);
11466
- const [height, setHeight] = React42.useState(void 0);
11467
- React42.useEffect(() => {
11520
+ const ref = React43.useRef(null);
11521
+ const [height, setHeight] = React43.useState(void 0);
11522
+ React43.useEffect(() => {
11468
11523
  if (ref.current && !isExiting) {
11469
11524
  setHeight(ref.current.offsetHeight);
11470
11525
  }
@@ -11477,7 +11532,7 @@ var ToastItemComponent = ({ item, isExiting, onClose }) => {
11477
11532
  maxHeight: isExiting ? 0 : height ?? "none",
11478
11533
  marginBottom: isExiting ? 0 : void 0
11479
11534
  },
11480
- children: /* @__PURE__ */ jsxs223(
11535
+ children: /* @__PURE__ */ jsxs224(
11481
11536
  "div",
11482
11537
  {
11483
11538
  ref,
@@ -11496,13 +11551,13 @@ var ToastProvider = ({
11496
11551
  children,
11497
11552
  position = "top-right"
11498
11553
  }) => {
11499
- const [toasts, setToasts] = React42.useState([]);
11500
- const [removing, setRemoving] = React42.useState(/* @__PURE__ */ new Set());
11501
- const [mounted, setMounted] = React42.useState(false);
11502
- 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(() => {
11503
11558
  setMounted(true);
11504
11559
  }, []);
11505
- const remove = React42.useCallback((id) => {
11560
+ const remove = React43.useCallback((id) => {
11506
11561
  setRemoving((prev) => new Set(prev).add(id));
11507
11562
  setTimeout(() => {
11508
11563
  setToasts((prev) => prev.filter((t) => t.id !== id));
@@ -11513,7 +11568,7 @@ var ToastProvider = ({
11513
11568
  });
11514
11569
  }, EXIT_DURATION);
11515
11570
  }, []);
11516
- const toast = React42.useCallback(
11571
+ const toast = React43.useCallback(
11517
11572
  (type, message, duration = 3e3) => {
11518
11573
  const id = `${Date.now()}-${Math.random()}`;
11519
11574
  setToasts((prev) => [...prev, { id, type, message }]);
@@ -11523,7 +11578,7 @@ var ToastProvider = ({
11523
11578
  },
11524
11579
  [remove]
11525
11580
  );
11526
- return /* @__PURE__ */ jsxs223(ToastContext.Provider, { value: { toast }, children: [
11581
+ return /* @__PURE__ */ jsxs224(ToastContext.Provider, { value: { toast }, children: [
11527
11582
  children,
11528
11583
  mounted && createPortal3(
11529
11584
  /* @__PURE__ */ jsx352("div", { className: clsx_default("lib-xplat-toast-container", position), children: toasts.map((t) => /* @__PURE__ */ jsx352(
@@ -11566,8 +11621,8 @@ ToggleChip.displayName = "ToggleChip";
11566
11621
  var ToggleChip_default = ToggleChip;
11567
11622
 
11568
11623
  // src/components/Tooltip/Tooltip.tsx
11569
- import React43 from "react";
11570
- 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";
11571
11626
  var OFFSET = 12;
11572
11627
  var GAP = 8;
11573
11628
  var SHOW_DELAY = 300;
@@ -11582,14 +11637,14 @@ var Tooltip = (props) => {
11582
11637
  disabled = false
11583
11638
  } = props;
11584
11639
  const shape = variant ?? type ?? "dark";
11585
- const triggerRef = React43.useRef(null);
11586
- const tooltipRef = React43.useRef(null);
11587
- const [visible, setVisible] = React43.useState(false);
11588
- const [pos, setPos] = React43.useState({ left: 0, top: 0 });
11589
- const delayTimer = React43.useRef(0);
11590
- const rafRef = React43.useRef(0);
11591
- const cursor = React43.useRef(null);
11592
- 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) => {
11593
11648
  const vw = window.innerWidth;
11594
11649
  const vh = window.innerHeight;
11595
11650
  return {
@@ -11597,7 +11652,7 @@ var Tooltip = (props) => {
11597
11652
  top: Math.min(Math.max(GAP, top), Math.max(GAP, vh - h - GAP))
11598
11653
  };
11599
11654
  }, []);
11600
- const placeAtCursor = React43.useCallback((x, y) => {
11655
+ const placeAtCursor = React44.useCallback((x, y) => {
11601
11656
  const el = tooltipRef.current;
11602
11657
  if (!el) return;
11603
11658
  const w = el.offsetWidth;
@@ -11608,7 +11663,7 @@ var Tooltip = (props) => {
11608
11663
  if (top < GAP) top = y + OFFSET;
11609
11664
  setPos(clamp2(left, top, w, h));
11610
11665
  }, [clamp2]);
11611
- const placeAtTrigger = React43.useCallback(() => {
11666
+ const placeAtTrigger = React44.useCallback(() => {
11612
11667
  const el = tooltipRef.current;
11613
11668
  const trigger = triggerRef.current;
11614
11669
  if (!el || !trigger) return;
@@ -11620,19 +11675,19 @@ var Tooltip = (props) => {
11620
11675
  const left = rect.left + rect.width / 2 - w / 2;
11621
11676
  setPos(clamp2(left, top, w, h));
11622
11677
  }, [clamp2]);
11623
- const reposition = React43.useCallback(() => {
11678
+ const reposition = React44.useCallback(() => {
11624
11679
  if (follow && cursor.current) {
11625
11680
  placeAtCursor(cursor.current.x, cursor.current.y);
11626
11681
  } else {
11627
11682
  placeAtTrigger();
11628
11683
  }
11629
11684
  }, [follow, placeAtCursor, placeAtTrigger]);
11630
- const handleMouseEnter = React43.useCallback((e) => {
11685
+ const handleMouseEnter = React44.useCallback((e) => {
11631
11686
  if (disabled) return;
11632
11687
  cursor.current = { x: e.clientX, y: e.clientY };
11633
11688
  delayTimer.current = window.setTimeout(() => setVisible(true), SHOW_DELAY);
11634
11689
  }, [disabled]);
11635
- const handleMouseMove = React43.useCallback((e) => {
11690
+ const handleMouseMove = React44.useCallback((e) => {
11636
11691
  cursor.current = { x: e.clientX, y: e.clientY };
11637
11692
  if (!visible || !follow) return;
11638
11693
  cancelAnimationFrame(rafRef.current);
@@ -11640,25 +11695,25 @@ var Tooltip = (props) => {
11640
11695
  if (cursor.current) placeAtCursor(cursor.current.x, cursor.current.y);
11641
11696
  });
11642
11697
  }, [visible, follow, placeAtCursor]);
11643
- const close = React43.useCallback(() => {
11698
+ const close = React44.useCallback(() => {
11644
11699
  window.clearTimeout(delayTimer.current);
11645
11700
  cancelAnimationFrame(rafRef.current);
11646
11701
  setVisible(false);
11647
11702
  }, []);
11648
- const handleMouseLeave = React43.useCallback(() => {
11703
+ const handleMouseLeave = React44.useCallback(() => {
11649
11704
  cursor.current = null;
11650
11705
  close();
11651
11706
  }, [close]);
11652
- const handleFocus = React43.useCallback(() => {
11707
+ const handleFocus = React44.useCallback(() => {
11653
11708
  if (disabled) return;
11654
11709
  cursor.current = null;
11655
11710
  setVisible(true);
11656
11711
  }, [disabled]);
11657
- React43.useLayoutEffect(() => {
11712
+ React44.useLayoutEffect(() => {
11658
11713
  if (!visible) return;
11659
11714
  reposition();
11660
11715
  }, [visible, reposition]);
11661
- React43.useEffect(() => {
11716
+ React44.useEffect(() => {
11662
11717
  if (!visible || follow) return;
11663
11718
  const onChange = () => placeAtTrigger();
11664
11719
  window.addEventListener("scroll", onChange, true);
@@ -11668,12 +11723,12 @@ var Tooltip = (props) => {
11668
11723
  window.removeEventListener("resize", onChange);
11669
11724
  };
11670
11725
  }, [visible, follow, placeAtTrigger]);
11671
- React43.useEffect(() => () => {
11726
+ React44.useEffect(() => () => {
11672
11727
  window.clearTimeout(delayTimer.current);
11673
11728
  cancelAnimationFrame(rafRef.current);
11674
11729
  }, []);
11675
11730
  if (!title && !description) return /* @__PURE__ */ jsx354(Fragment6, { children });
11676
- return /* @__PURE__ */ jsxs224(
11731
+ return /* @__PURE__ */ jsxs225(
11677
11732
  "div",
11678
11733
  {
11679
11734
  ref: triggerRef,
@@ -11686,7 +11741,7 @@ var Tooltip = (props) => {
11686
11741
  onBlur: close,
11687
11742
  children: [
11688
11743
  children,
11689
- visible && /* @__PURE__ */ jsx354(Portal_default, { children: /* @__PURE__ */ jsxs224(
11744
+ visible && /* @__PURE__ */ jsx354(Portal_default, { children: /* @__PURE__ */ jsxs225(
11690
11745
  "div",
11691
11746
  {
11692
11747
  ref: tooltipRef,
@@ -11707,10 +11762,10 @@ Tooltip.displayName = "Tooltip";
11707
11762
  var Tooltip_default = Tooltip;
11708
11763
 
11709
11764
  // src/components/Tour/Tour.tsx
11710
- import React45 from "react";
11765
+ import React46 from "react";
11711
11766
 
11712
11767
  // src/tokens/hooks/useScrollLock.ts
11713
- import React44 from "react";
11768
+ import React45 from "react";
11714
11769
  var SCROLL_KEYS = /* @__PURE__ */ new Set([
11715
11770
  " ",
11716
11771
  "PageUp",
@@ -11723,7 +11778,7 @@ var SCROLL_KEYS = /* @__PURE__ */ new Set([
11723
11778
  "ArrowRight"
11724
11779
  ]);
11725
11780
  var useScrollLock = (enabled, allowRef) => {
11726
- React44.useEffect(() => {
11781
+ React45.useEffect(() => {
11727
11782
  if (!enabled) return;
11728
11783
  const allowed = (target) => target instanceof Node && !!allowRef?.current?.contains(target);
11729
11784
  const block = (e) => {
@@ -11752,7 +11807,7 @@ var useScrollLock = (enabled, allowRef) => {
11752
11807
  var useScrollLock_default = useScrollLock;
11753
11808
 
11754
11809
  // src/components/Tour/Tour.tsx
11755
- import { jsx as jsx355, jsxs as jsxs225 } from "react/jsx-runtime";
11810
+ import { jsx as jsx355, jsxs as jsxs226 } from "react/jsx-runtime";
11756
11811
  var VIEWPORT_MARGIN = 16;
11757
11812
  var DEFAULT_PADDING = 8;
11758
11813
  var clamp = (v, min, max) => Math.max(min, Math.min(v, max));
@@ -11773,14 +11828,14 @@ var Tour = (props) => {
11773
11828
  skipLabel = "\uAC74\uB108\uB6F0\uAE30",
11774
11829
  doneLabel = "\uB2E4 \uBD24\uC5B4\uC694"
11775
11830
  } = props;
11776
- const [uncontrolled, setUncontrolled] = React45.useState(0);
11831
+ const [uncontrolled, setUncontrolled] = React46.useState(0);
11777
11832
  const index = current ?? uncontrolled;
11778
11833
  const step = steps[index];
11779
11834
  const isLast = index === steps.length - 1;
11780
- const spotRef = React45.useRef(null);
11781
- const cardRef = React45.useRef(null);
11782
- const [targetFound, setTargetFound] = React45.useState(true);
11783
- 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(
11784
11839
  (next) => {
11785
11840
  if (current === void 0) setUncontrolled(next);
11786
11841
  onStepChange?.(next);
@@ -11790,9 +11845,9 @@ var Tour = (props) => {
11790
11845
  useEscapeKey(open, () => onClose("skip"));
11791
11846
  useFocusTrap(cardRef, open, { trap: true });
11792
11847
  useScrollLock_default(open, cardRef);
11793
- const stepsRef = React45.useRef(steps);
11848
+ const stepsRef = React46.useRef(steps);
11794
11849
  stepsRef.current = steps;
11795
- React45.useEffect(() => {
11850
+ React46.useEffect(() => {
11796
11851
  if (!open) return;
11797
11852
  const target = stepsRef.current[index]?.target;
11798
11853
  if (!target) return;
@@ -11817,7 +11872,7 @@ var Tour = (props) => {
11817
11872
  stop = true;
11818
11873
  };
11819
11874
  }, [open, index]);
11820
- const place = React45.useCallback(() => {
11875
+ const place = React46.useCallback(() => {
11821
11876
  const spot = spotRef.current;
11822
11877
  const card = cardRef.current;
11823
11878
  if (!spot || !card || !step) return;
@@ -11864,7 +11919,7 @@ var Tour = (props) => {
11864
11919
  card.style.top = `${clamp(placed.top, VIEWPORT_MARGIN, window.innerHeight - VIEWPORT_MARGIN - cardH)}px`;
11865
11920
  card.style.left = `${clamp(placed.left, VIEWPORT_MARGIN, window.innerWidth - VIEWPORT_MARGIN - cardW)}px`;
11866
11921
  }, [step]);
11867
- React45.useLayoutEffect(() => {
11922
+ React46.useLayoutEffect(() => {
11868
11923
  if (!open) return;
11869
11924
  place();
11870
11925
  let raf = 0;
@@ -11881,7 +11936,7 @@ var Tour = (props) => {
11881
11936
  raf = requestAnimationFrame(follow);
11882
11937
  return () => cancelAnimationFrame(raf);
11883
11938
  }, [open, index, place]);
11884
- React45.useEffect(() => {
11939
+ React46.useEffect(() => {
11885
11940
  if (!open) return;
11886
11941
  const onMove = () => place();
11887
11942
  window.addEventListener("scroll", onMove, { passive: true, capture: true });
@@ -11892,10 +11947,10 @@ var Tour = (props) => {
11892
11947
  };
11893
11948
  }, [open, place]);
11894
11949
  if (!open || !step) return null;
11895
- 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: [
11896
11951
  !targetFound && /* @__PURE__ */ jsx355("div", { className: "lib-xplat-tour-dim" }),
11897
11952
  /* @__PURE__ */ jsx355("div", { ref: spotRef, className: "lib-xplat-tour-spotlight", "aria-hidden": true }),
11898
- /* @__PURE__ */ jsxs225(
11953
+ /* @__PURE__ */ jsxs226(
11899
11954
  "div",
11900
11955
  {
11901
11956
  ref: cardRef,
@@ -11905,8 +11960,8 @@ var Tour = (props) => {
11905
11960
  "aria-modal": "true",
11906
11961
  "aria-label": typeof step.title === "string" ? step.title : "\uD654\uBA74 \uC548\uB0B4",
11907
11962
  children: [
11908
- /* @__PURE__ */ jsxs225("div", { className: "tour-card-head", children: [
11909
- /* @__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: [
11910
11965
  index + 1,
11911
11966
  " / ",
11912
11967
  steps.length
@@ -11914,9 +11969,9 @@ var Tour = (props) => {
11914
11969
  step.title && /* @__PURE__ */ jsx355("div", { className: "tour-card-title", children: step.title })
11915
11970
  ] }),
11916
11971
  /* @__PURE__ */ jsx355("div", { className: "tour-card-body", children: step.description && /* @__PURE__ */ jsx355("div", { className: "tour-card-description", children: step.description }) }),
11917
- /* @__PURE__ */ jsxs225("div", { className: "tour-card-actions", children: [
11972
+ /* @__PURE__ */ jsxs226("div", { className: "tour-card-actions", children: [
11918
11973
  /* @__PURE__ */ jsx355("button", { type: "button", className: "tour-skip", onClick: () => onClose("skip"), children: skipLabel }),
11919
- /* @__PURE__ */ jsxs225("div", { className: "tour-card-nav", children: [
11974
+ /* @__PURE__ */ jsxs226("div", { className: "tour-card-nav", children: [
11920
11975
  index > 0 && /* @__PURE__ */ jsx355(
11921
11976
  "button",
11922
11977
  {
@@ -11946,9 +12001,9 @@ Tour.displayName = "Tour";
11946
12001
  var Tour_default = Tour;
11947
12002
 
11948
12003
  // src/components/Video/Video.tsx
11949
- import React46 from "react";
11950
- import { jsx as jsx356, jsxs as jsxs226 } from "react/jsx-runtime";
11951
- 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: [
11952
12007
  /* @__PURE__ */ jsx356("rect", { x: "3", y: "5", width: "18", height: "14", rx: "2" }),
11953
12008
  /* @__PURE__ */ jsx356("rect", { x: "12", y: "11", width: "7", height: "6", rx: "1", fill: "currentColor" })
11954
12009
  ] });
@@ -11958,7 +12013,7 @@ var formatTime = (sec) => {
11958
12013
  const s = Math.floor(sec % 60);
11959
12014
  return `${m}:${s.toString().padStart(2, "0")}`;
11960
12015
  };
11961
- var Video = React46.forwardRef((props, ref) => {
12016
+ var Video = React47.forwardRef((props, ref) => {
11962
12017
  const {
11963
12018
  src,
11964
12019
  poster,
@@ -11982,21 +12037,21 @@ var Video = React46.forwardRef((props, ref) => {
11982
12037
  children,
11983
12038
  ...rest
11984
12039
  } = props;
11985
- const containerRef = React46.useRef(null);
11986
- const videoRef = React46.useRef(null);
11987
- const [isPlaying, setIsPlaying] = React46.useState(Boolean(autoPlay));
11988
- const [isLoaded, setIsLoaded] = React46.useState(false);
11989
- const [currentTime, setCurrentTime] = React46.useState(0);
11990
- const [duration, setDuration] = React46.useState(0);
11991
- const [buffered, setBuffered] = React46.useState(0);
11992
- const [volume, setVolume] = React46.useState(1);
11993
- const [isMuted, setIsMuted] = React46.useState(Boolean(muted));
11994
- const [isFullscreen, setIsFullscreen] = React46.useState(false);
11995
- const [playbackRate, setPlaybackRate] = React46.useState(1);
11996
- const [rateMenuOpen, setRateMenuOpen] = React46.useState(false);
11997
- const [captionsOn, setCaptionsOn] = React46.useState(false);
11998
- const [isPip, setIsPip] = React46.useState(false);
11999
- 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(
12000
12055
  (el) => {
12001
12056
  videoRef.current = el;
12002
12057
  if (typeof ref === "function") ref(el);
@@ -12004,14 +12059,14 @@ var Video = React46.forwardRef((props, ref) => {
12004
12059
  },
12005
12060
  [ref]
12006
12061
  );
12007
- React46.useEffect(() => {
12062
+ React47.useEffect(() => {
12008
12063
  const onFsChange = () => {
12009
12064
  setIsFullscreen(document.fullscreenElement === containerRef.current);
12010
12065
  };
12011
12066
  document.addEventListener("fullscreenchange", onFsChange);
12012
12067
  return () => document.removeEventListener("fullscreenchange", onFsChange);
12013
12068
  }, []);
12014
- React46.useEffect(() => {
12069
+ React47.useEffect(() => {
12015
12070
  const v = videoRef.current;
12016
12071
  if (!v) return;
12017
12072
  const onEnter = () => setIsPip(true);
@@ -12125,7 +12180,7 @@ var Video = React46.forwardRef((props, ref) => {
12125
12180
  const volumePct = (isMuted ? 0 : volume) * 100;
12126
12181
  const VolumeGlyph = isMuted || volume === 0 ? VolumeXIcon_default : volume < 0.5 ? VolumeIcon_default : Volume2Icon_default;
12127
12182
  const pipSupported = typeof document !== "undefined" && "pictureInPictureEnabled" in document && document.pictureInPictureEnabled;
12128
- return /* @__PURE__ */ jsxs226(
12183
+ return /* @__PURE__ */ jsxs227(
12129
12184
  "div",
12130
12185
  {
12131
12186
  ref: containerRef,
@@ -12167,7 +12222,7 @@ var Video = React46.forwardRef((props, ref) => {
12167
12222
  children: /* @__PURE__ */ jsx356("span", { className: "center-play-icon", children: /* @__PURE__ */ jsx356(PlayCircleIcon_default, {}) })
12168
12223
  }
12169
12224
  ),
12170
- showControls && /* @__PURE__ */ jsxs226("div", { className: "controls", onClick: (e) => e.stopPropagation(), children: [
12225
+ showControls && /* @__PURE__ */ jsxs227("div", { className: "controls", onClick: (e) => e.stopPropagation(), children: [
12171
12226
  /* @__PURE__ */ jsx356(
12172
12227
  "input",
12173
12228
  {
@@ -12185,7 +12240,7 @@ var Video = React46.forwardRef((props, ref) => {
12185
12240
  }
12186
12241
  }
12187
12242
  ),
12188
- /* @__PURE__ */ jsxs226("div", { className: "controls-row", children: [
12243
+ /* @__PURE__ */ jsxs227("div", { className: "controls-row", children: [
12189
12244
  /* @__PURE__ */ jsx356(
12190
12245
  "button",
12191
12246
  {
@@ -12196,7 +12251,7 @@ var Video = React46.forwardRef((props, ref) => {
12196
12251
  children: isPlaying ? /* @__PURE__ */ jsx356(PauseIcon_default, {}) : /* @__PURE__ */ jsx356(PlayIcon_default, {})
12197
12252
  }
12198
12253
  ),
12199
- /* @__PURE__ */ jsxs226("div", { className: "volume-group", children: [
12254
+ /* @__PURE__ */ jsxs227("div", { className: "volume-group", children: [
12200
12255
  /* @__PURE__ */ jsx356(
12201
12256
  "button",
12202
12257
  {
@@ -12222,14 +12277,14 @@ var Video = React46.forwardRef((props, ref) => {
12222
12277
  }
12223
12278
  )
12224
12279
  ] }),
12225
- /* @__PURE__ */ jsxs226("span", { className: "time", children: [
12280
+ /* @__PURE__ */ jsxs227("span", { className: "time", children: [
12226
12281
  formatTime(currentTime),
12227
12282
  " / ",
12228
12283
  formatTime(duration)
12229
12284
  ] }),
12230
12285
  /* @__PURE__ */ jsx356("div", { className: "controls-spacer" }),
12231
- playbackRates && playbackRates.length > 0 && /* @__PURE__ */ jsxs226("div", { className: clsx_default("rate-group", rateMenuOpen && "is-open"), children: [
12232
- /* @__PURE__ */ jsxs226(
12286
+ playbackRates && playbackRates.length > 0 && /* @__PURE__ */ jsxs227("div", { className: clsx_default("rate-group", rateMenuOpen && "is-open"), children: [
12287
+ /* @__PURE__ */ jsxs227(
12233
12288
  "button",
12234
12289
  {
12235
12290
  type: "button",
@@ -12243,7 +12298,7 @@ var Video = React46.forwardRef((props, ref) => {
12243
12298
  ]
12244
12299
  }
12245
12300
  ),
12246
- 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(
12247
12302
  "button",
12248
12303
  {
12249
12304
  type: "button",
@@ -12369,14 +12424,14 @@ GridItem.displayName = "GridItem";
12369
12424
  var Item_default = GridItem;
12370
12425
 
12371
12426
  // src/layout/Header/Header.tsx
12372
- import { jsx as jsx360, jsxs as jsxs227 } from "react/jsx-runtime";
12427
+ import { jsx as jsx360, jsxs as jsxs228 } from "react/jsx-runtime";
12373
12428
  var Header = ({
12374
12429
  leftContent,
12375
12430
  logo,
12376
12431
  centerContent,
12377
12432
  rightContent
12378
12433
  }) => {
12379
- return /* @__PURE__ */ jsxs227("div", { className: "lib-xplat-layout-header", children: [
12434
+ return /* @__PURE__ */ jsxs228("div", { className: "lib-xplat-layout-header", children: [
12380
12435
  /* @__PURE__ */ jsx360("div", { children: leftContent ?? logo }),
12381
12436
  /* @__PURE__ */ jsx360("div", { children: centerContent }),
12382
12437
  /* @__PURE__ */ jsx360("div", { children: rightContent })
@@ -12386,12 +12441,12 @@ Header.displayName = "Header";
12386
12441
  var Header_default = Header;
12387
12442
 
12388
12443
  // src/layout/Layout/Layout.tsx
12389
- 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";
12390
12445
  var Layout = (props) => {
12391
12446
  const { header, sideBar, children } = props;
12392
- 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: [
12393
12448
  sideBar && /* @__PURE__ */ jsx361(Fragment7, { children: sideBar }),
12394
- /* @__PURE__ */ jsxs228("div", { className: "lib-xplat-layout-content", children: [
12449
+ /* @__PURE__ */ jsxs229("div", { className: "lib-xplat-layout-content", children: [
12395
12450
  header && /* @__PURE__ */ jsx361("div", { className: "lib-xplat-layout-content-header", children: header }),
12396
12451
  children
12397
12452
  ] })
@@ -12401,13 +12456,13 @@ Layout.displayName = "Layout";
12401
12456
  var Layout_default = Layout;
12402
12457
 
12403
12458
  // src/layout/SideBar/SideBar.tsx
12404
- import React48 from "react";
12459
+ import React49 from "react";
12405
12460
 
12406
12461
  // src/layout/SideBar/SideBarContext.tsx
12407
- import React47 from "react";
12408
- var SideBarContext = React47.createContext(null);
12462
+ import React48 from "react";
12463
+ var SideBarContext = React48.createContext(null);
12409
12464
  var useSideBarContext = () => {
12410
- const ctx = React47.useContext(SideBarContext);
12465
+ const ctx = React48.useContext(SideBarContext);
12411
12466
  if (!ctx) throw new Error("Error");
12412
12467
  return ctx;
12413
12468
  };
@@ -12417,7 +12472,7 @@ var SideBarContext_default = SideBarContext;
12417
12472
  import { jsx as jsx362 } from "react/jsx-runtime";
12418
12473
  var SideBar = (props) => {
12419
12474
  const { children, className } = props;
12420
- const [isOpen, setIsOpen] = React48.useState(true);
12475
+ const [isOpen, setIsOpen] = React49.useState(true);
12421
12476
  const handleSwitchSideBar = () => {
12422
12477
  setIsOpen((prev) => !prev);
12423
12478
  };