@x-plat/design-system 0.16.2 → 0.17.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/components/Table/index.cjs +5 -1
- package/dist/components/Table/index.css +1 -1
- package/dist/components/Table/index.d.cts +10 -0
- package/dist/components/Table/index.d.ts +10 -0
- package/dist/components/Table/index.js +5 -1
- package/dist/components/Tour/index.cjs +66 -19
- package/dist/components/Tour/index.css +28 -5
- package/dist/components/Tour/index.d.cts +6 -0
- package/dist/components/Tour/index.d.ts +6 -0
- package/dist/components/Tour/index.js +66 -19
- package/dist/components/index.cjs +91 -38
- package/dist/components/index.css +29 -6
- package/dist/components/index.js +91 -38
- package/dist/index.cjs +96 -43
- package/dist/index.css +29 -6
- package/dist/index.js +96 -43
- package/guidelines/components/table.md +1 -0
- package/guidelines/components/tour.md +20 -3
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -11472,13 +11472,17 @@ var Table = (props) => {
|
|
|
11472
11472
|
rowBorderUse = true,
|
|
11473
11473
|
colBorderUse = true,
|
|
11474
11474
|
headerSticky = false,
|
|
11475
|
-
stickyShadow = true
|
|
11475
|
+
stickyShadow = true,
|
|
11476
|
+
minWidth
|
|
11476
11477
|
} = props;
|
|
11477
11478
|
return /* @__PURE__ */ (0, import_jsx_runtime344.jsx)(
|
|
11478
11479
|
"div",
|
|
11479
11480
|
{
|
|
11480
11481
|
className: `lib-xplat-table-wrapper ${size}`,
|
|
11481
11482
|
"data-xplat-overlay-escape": "",
|
|
11483
|
+
style: minWidth === void 0 ? void 0 : {
|
|
11484
|
+
"--table-min-width": typeof minWidth === "number" ? `${minWidth}px` : minWidth
|
|
11485
|
+
},
|
|
11482
11486
|
children: /* @__PURE__ */ (0, import_jsx_runtime344.jsx)(
|
|
11483
11487
|
TableContext_default.Provider,
|
|
11484
11488
|
{
|
|
@@ -12119,7 +12123,51 @@ Tooltip.displayName = "Tooltip";
|
|
|
12119
12123
|
var Tooltip_default = Tooltip;
|
|
12120
12124
|
|
|
12121
12125
|
// src/components/Tour/Tour.tsx
|
|
12126
|
+
var import_react45 = __toESM(require("react"), 1);
|
|
12127
|
+
|
|
12128
|
+
// src/tokens/hooks/useScrollLock.ts
|
|
12122
12129
|
var import_react44 = __toESM(require("react"), 1);
|
|
12130
|
+
var SCROLL_KEYS = /* @__PURE__ */ new Set([
|
|
12131
|
+
" ",
|
|
12132
|
+
"PageUp",
|
|
12133
|
+
"PageDown",
|
|
12134
|
+
"Home",
|
|
12135
|
+
"End",
|
|
12136
|
+
"ArrowUp",
|
|
12137
|
+
"ArrowDown",
|
|
12138
|
+
"ArrowLeft",
|
|
12139
|
+
"ArrowRight"
|
|
12140
|
+
]);
|
|
12141
|
+
var useScrollLock = (enabled, allowRef) => {
|
|
12142
|
+
import_react44.default.useEffect(() => {
|
|
12143
|
+
if (!enabled) return;
|
|
12144
|
+
const allowed = (target) => target instanceof Node && !!allowRef?.current?.contains(target);
|
|
12145
|
+
const block = (e) => {
|
|
12146
|
+
if (allowed(e.target)) return;
|
|
12147
|
+
e.preventDefault();
|
|
12148
|
+
};
|
|
12149
|
+
const onKey = (e) => {
|
|
12150
|
+
if (!SCROLL_KEYS.has(e.key)) return;
|
|
12151
|
+
if (allowed(e.target)) return;
|
|
12152
|
+
const el = e.target;
|
|
12153
|
+
const tag = el?.tagName;
|
|
12154
|
+
if (tag === "INPUT" || tag === "TEXTAREA" || el?.isContentEditable) return;
|
|
12155
|
+
e.preventDefault();
|
|
12156
|
+
};
|
|
12157
|
+
const opts = { passive: false, capture: true };
|
|
12158
|
+
window.addEventListener("wheel", block, opts);
|
|
12159
|
+
window.addEventListener("touchmove", block, opts);
|
|
12160
|
+
window.addEventListener("keydown", onKey, opts);
|
|
12161
|
+
return () => {
|
|
12162
|
+
window.removeEventListener("wheel", block, true);
|
|
12163
|
+
window.removeEventListener("touchmove", block, true);
|
|
12164
|
+
window.removeEventListener("keydown", onKey, true);
|
|
12165
|
+
};
|
|
12166
|
+
}, [enabled, allowRef]);
|
|
12167
|
+
};
|
|
12168
|
+
var useScrollLock_default = useScrollLock;
|
|
12169
|
+
|
|
12170
|
+
// src/components/Tour/Tour.tsx
|
|
12123
12171
|
var import_jsx_runtime355 = require("react/jsx-runtime");
|
|
12124
12172
|
var VIEWPORT_MARGIN = 16;
|
|
12125
12173
|
var DEFAULT_PADDING = 8;
|
|
@@ -12135,19 +12183,20 @@ var Tour = (props) => {
|
|
|
12135
12183
|
onClose,
|
|
12136
12184
|
current,
|
|
12137
12185
|
onStepChange,
|
|
12186
|
+
width = 380,
|
|
12138
12187
|
nextLabel = "\uB2E4\uC74C",
|
|
12139
12188
|
prevLabel = "\uC774\uC804",
|
|
12140
12189
|
skipLabel = "\uAC74\uB108\uB6F0\uAE30",
|
|
12141
12190
|
doneLabel = "\uB2E4 \uBD24\uC5B4\uC694"
|
|
12142
12191
|
} = props;
|
|
12143
|
-
const [uncontrolled, setUncontrolled] =
|
|
12192
|
+
const [uncontrolled, setUncontrolled] = import_react45.default.useState(0);
|
|
12144
12193
|
const index = current ?? uncontrolled;
|
|
12145
12194
|
const step = steps[index];
|
|
12146
12195
|
const isLast = index === steps.length - 1;
|
|
12147
|
-
const spotRef =
|
|
12148
|
-
const cardRef =
|
|
12149
|
-
const [targetFound, setTargetFound] =
|
|
12150
|
-
const goTo =
|
|
12196
|
+
const spotRef = import_react45.default.useRef(null);
|
|
12197
|
+
const cardRef = import_react45.default.useRef(null);
|
|
12198
|
+
const [targetFound, setTargetFound] = import_react45.default.useState(true);
|
|
12199
|
+
const goTo = import_react45.default.useCallback(
|
|
12151
12200
|
(next) => {
|
|
12152
12201
|
if (current === void 0) setUncontrolled(next);
|
|
12153
12202
|
onStepChange?.(next);
|
|
@@ -12156,9 +12205,10 @@ var Tour = (props) => {
|
|
|
12156
12205
|
);
|
|
12157
12206
|
useEscapeKey(open, () => onClose("skip"));
|
|
12158
12207
|
useFocusTrap(cardRef, open, { trap: true });
|
|
12159
|
-
|
|
12208
|
+
useScrollLock_default(open, cardRef);
|
|
12209
|
+
const stepsRef = import_react45.default.useRef(steps);
|
|
12160
12210
|
stepsRef.current = steps;
|
|
12161
|
-
|
|
12211
|
+
import_react45.default.useEffect(() => {
|
|
12162
12212
|
if (!open) return;
|
|
12163
12213
|
const target = stepsRef.current[index]?.target;
|
|
12164
12214
|
if (!target) return;
|
|
@@ -12183,7 +12233,7 @@ var Tour = (props) => {
|
|
|
12183
12233
|
stop = true;
|
|
12184
12234
|
};
|
|
12185
12235
|
}, [open, index]);
|
|
12186
|
-
const place =
|
|
12236
|
+
const place = import_react45.default.useCallback(() => {
|
|
12187
12237
|
const spot = spotRef.current;
|
|
12188
12238
|
const card = cardRef.current;
|
|
12189
12239
|
if (!spot || !card || !step) return;
|
|
@@ -12224,13 +12274,13 @@ var Tour = (props) => {
|
|
|
12224
12274
|
}
|
|
12225
12275
|
);
|
|
12226
12276
|
const limit = window.innerHeight - VIEWPORT_MARGIN * 2;
|
|
12227
|
-
const cardH = Math.min(
|
|
12277
|
+
const cardH = Math.min(card.scrollHeight, limit);
|
|
12228
12278
|
const cardW = card.offsetWidth;
|
|
12229
|
-
card.style.maxHeight = `${
|
|
12279
|
+
card.style.maxHeight = `${limit}px`;
|
|
12230
12280
|
card.style.top = `${clamp(placed.top, VIEWPORT_MARGIN, window.innerHeight - VIEWPORT_MARGIN - cardH)}px`;
|
|
12231
12281
|
card.style.left = `${clamp(placed.left, VIEWPORT_MARGIN, window.innerWidth - VIEWPORT_MARGIN - cardW)}px`;
|
|
12232
12282
|
}, [step]);
|
|
12233
|
-
|
|
12283
|
+
import_react45.default.useLayoutEffect(() => {
|
|
12234
12284
|
if (!open) return;
|
|
12235
12285
|
place();
|
|
12236
12286
|
let raf = 0;
|
|
@@ -12247,7 +12297,7 @@ var Tour = (props) => {
|
|
|
12247
12297
|
raf = requestAnimationFrame(follow);
|
|
12248
12298
|
return () => cancelAnimationFrame(raf);
|
|
12249
12299
|
}, [open, index, place]);
|
|
12250
|
-
|
|
12300
|
+
import_react45.default.useEffect(() => {
|
|
12251
12301
|
if (!open) return;
|
|
12252
12302
|
const onMove = () => place();
|
|
12253
12303
|
window.addEventListener("scroll", onMove, { passive: true, capture: true });
|
|
@@ -12266,17 +12316,20 @@ var Tour = (props) => {
|
|
|
12266
12316
|
{
|
|
12267
12317
|
ref: cardRef,
|
|
12268
12318
|
className: "lib-xplat-tour-card",
|
|
12319
|
+
style: { "--tour-card-width": typeof width === "number" ? `${width}px` : width },
|
|
12269
12320
|
role: "dialog",
|
|
12270
12321
|
"aria-modal": "true",
|
|
12271
12322
|
"aria-label": typeof step.title === "string" ? step.title : "\uD654\uBA74 \uC548\uB0B4",
|
|
12272
12323
|
children: [
|
|
12273
|
-
/* @__PURE__ */ (0, import_jsx_runtime355.jsxs)("div", { className: "tour-card-
|
|
12274
|
-
|
|
12275
|
-
|
|
12276
|
-
|
|
12324
|
+
/* @__PURE__ */ (0, import_jsx_runtime355.jsxs)("div", { className: "tour-card-head", children: [
|
|
12325
|
+
/* @__PURE__ */ (0, import_jsx_runtime355.jsxs)("div", { className: "tour-card-progress", "aria-hidden": true, children: [
|
|
12326
|
+
index + 1,
|
|
12327
|
+
" / ",
|
|
12328
|
+
steps.length
|
|
12329
|
+
] }),
|
|
12330
|
+
step.title && /* @__PURE__ */ (0, import_jsx_runtime355.jsx)("div", { className: "tour-card-title", children: step.title })
|
|
12277
12331
|
] }),
|
|
12278
|
-
step.
|
|
12279
|
-
step.description && /* @__PURE__ */ (0, import_jsx_runtime355.jsx)("div", { className: "tour-card-description", children: step.description }),
|
|
12332
|
+
/* @__PURE__ */ (0, import_jsx_runtime355.jsx)("div", { className: "tour-card-body", children: step.description && /* @__PURE__ */ (0, import_jsx_runtime355.jsx)("div", { className: "tour-card-description", children: step.description }) }),
|
|
12280
12333
|
/* @__PURE__ */ (0, import_jsx_runtime355.jsxs)("div", { className: "tour-card-actions", children: [
|
|
12281
12334
|
/* @__PURE__ */ (0, import_jsx_runtime355.jsx)("button", { type: "button", className: "tour-skip", onClick: () => onClose("skip"), children: skipLabel }),
|
|
12282
12335
|
/* @__PURE__ */ (0, import_jsx_runtime355.jsxs)("div", { className: "tour-card-nav", children: [
|
|
@@ -12309,7 +12362,7 @@ Tour.displayName = "Tour";
|
|
|
12309
12362
|
var Tour_default = Tour;
|
|
12310
12363
|
|
|
12311
12364
|
// src/components/Video/Video.tsx
|
|
12312
|
-
var
|
|
12365
|
+
var import_react46 = __toESM(require("react"), 1);
|
|
12313
12366
|
var import_jsx_runtime356 = require("react/jsx-runtime");
|
|
12314
12367
|
var PipIcon = () => /* @__PURE__ */ (0, import_jsx_runtime356.jsxs)("svg", { viewBox: "0 0 24 24", width: "1em", height: "1em", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
12315
12368
|
/* @__PURE__ */ (0, import_jsx_runtime356.jsx)("rect", { x: "3", y: "5", width: "18", height: "14", rx: "2" }),
|
|
@@ -12321,7 +12374,7 @@ var formatTime = (sec) => {
|
|
|
12321
12374
|
const s = Math.floor(sec % 60);
|
|
12322
12375
|
return `${m}:${s.toString().padStart(2, "0")}`;
|
|
12323
12376
|
};
|
|
12324
|
-
var Video =
|
|
12377
|
+
var Video = import_react46.default.forwardRef((props, ref) => {
|
|
12325
12378
|
const {
|
|
12326
12379
|
src,
|
|
12327
12380
|
poster,
|
|
@@ -12345,21 +12398,21 @@ var Video = import_react45.default.forwardRef((props, ref) => {
|
|
|
12345
12398
|
children,
|
|
12346
12399
|
...rest
|
|
12347
12400
|
} = props;
|
|
12348
|
-
const containerRef =
|
|
12349
|
-
const videoRef =
|
|
12350
|
-
const [isPlaying, setIsPlaying] =
|
|
12351
|
-
const [isLoaded, setIsLoaded] =
|
|
12352
|
-
const [currentTime, setCurrentTime] =
|
|
12353
|
-
const [duration, setDuration] =
|
|
12354
|
-
const [buffered, setBuffered] =
|
|
12355
|
-
const [volume, setVolume] =
|
|
12356
|
-
const [isMuted, setIsMuted] =
|
|
12357
|
-
const [isFullscreen, setIsFullscreen] =
|
|
12358
|
-
const [playbackRate, setPlaybackRate] =
|
|
12359
|
-
const [rateMenuOpen, setRateMenuOpen] =
|
|
12360
|
-
const [captionsOn, setCaptionsOn] =
|
|
12361
|
-
const [isPip, setIsPip] =
|
|
12362
|
-
const setRefs =
|
|
12401
|
+
const containerRef = import_react46.default.useRef(null);
|
|
12402
|
+
const videoRef = import_react46.default.useRef(null);
|
|
12403
|
+
const [isPlaying, setIsPlaying] = import_react46.default.useState(Boolean(autoPlay));
|
|
12404
|
+
const [isLoaded, setIsLoaded] = import_react46.default.useState(false);
|
|
12405
|
+
const [currentTime, setCurrentTime] = import_react46.default.useState(0);
|
|
12406
|
+
const [duration, setDuration] = import_react46.default.useState(0);
|
|
12407
|
+
const [buffered, setBuffered] = import_react46.default.useState(0);
|
|
12408
|
+
const [volume, setVolume] = import_react46.default.useState(1);
|
|
12409
|
+
const [isMuted, setIsMuted] = import_react46.default.useState(Boolean(muted));
|
|
12410
|
+
const [isFullscreen, setIsFullscreen] = import_react46.default.useState(false);
|
|
12411
|
+
const [playbackRate, setPlaybackRate] = import_react46.default.useState(1);
|
|
12412
|
+
const [rateMenuOpen, setRateMenuOpen] = import_react46.default.useState(false);
|
|
12413
|
+
const [captionsOn, setCaptionsOn] = import_react46.default.useState(false);
|
|
12414
|
+
const [isPip, setIsPip] = import_react46.default.useState(false);
|
|
12415
|
+
const setRefs = import_react46.default.useCallback(
|
|
12363
12416
|
(el) => {
|
|
12364
12417
|
videoRef.current = el;
|
|
12365
12418
|
if (typeof ref === "function") ref(el);
|
|
@@ -12367,14 +12420,14 @@ var Video = import_react45.default.forwardRef((props, ref) => {
|
|
|
12367
12420
|
},
|
|
12368
12421
|
[ref]
|
|
12369
12422
|
);
|
|
12370
|
-
|
|
12423
|
+
import_react46.default.useEffect(() => {
|
|
12371
12424
|
const onFsChange = () => {
|
|
12372
12425
|
setIsFullscreen(document.fullscreenElement === containerRef.current);
|
|
12373
12426
|
};
|
|
12374
12427
|
document.addEventListener("fullscreenchange", onFsChange);
|
|
12375
12428
|
return () => document.removeEventListener("fullscreenchange", onFsChange);
|
|
12376
12429
|
}, []);
|
|
12377
|
-
|
|
12430
|
+
import_react46.default.useEffect(() => {
|
|
12378
12431
|
const v = videoRef.current;
|
|
12379
12432
|
if (!v) return;
|
|
12380
12433
|
const onEnter = () => setIsPip(true);
|
|
@@ -12764,13 +12817,13 @@ Layout.displayName = "Layout";
|
|
|
12764
12817
|
var Layout_default = Layout;
|
|
12765
12818
|
|
|
12766
12819
|
// src/layout/SideBar/SideBar.tsx
|
|
12767
|
-
var
|
|
12820
|
+
var import_react48 = __toESM(require("react"), 1);
|
|
12768
12821
|
|
|
12769
12822
|
// src/layout/SideBar/SideBarContext.tsx
|
|
12770
|
-
var
|
|
12771
|
-
var SideBarContext =
|
|
12823
|
+
var import_react47 = __toESM(require("react"), 1);
|
|
12824
|
+
var SideBarContext = import_react47.default.createContext(null);
|
|
12772
12825
|
var useSideBarContext = () => {
|
|
12773
|
-
const ctx =
|
|
12826
|
+
const ctx = import_react47.default.useContext(SideBarContext);
|
|
12774
12827
|
if (!ctx) throw new Error("Error");
|
|
12775
12828
|
return ctx;
|
|
12776
12829
|
};
|
|
@@ -12780,7 +12833,7 @@ var SideBarContext_default = SideBarContext;
|
|
|
12780
12833
|
var import_jsx_runtime362 = require("react/jsx-runtime");
|
|
12781
12834
|
var SideBar = (props) => {
|
|
12782
12835
|
const { children, className } = props;
|
|
12783
|
-
const [isOpen, setIsOpen] =
|
|
12836
|
+
const [isOpen, setIsOpen] = import_react48.default.useState(true);
|
|
12784
12837
|
const handleSwitchSideBar = () => {
|
|
12785
12838
|
setIsOpen((prev) => !prev);
|
|
12786
12839
|
};
|
package/dist/index.css
CHANGED
|
@@ -5169,7 +5169,7 @@
|
|
|
5169
5169
|
}
|
|
5170
5170
|
.lib-xplat-table-wrapper > .lib-xplat-table {
|
|
5171
5171
|
width: 100%;
|
|
5172
|
-
min-width: 600px;
|
|
5172
|
+
min-width: var(--table-min-width, 600px);
|
|
5173
5173
|
}
|
|
5174
5174
|
.lib-xplat-table-wrapper > .lib-xplat-table > thead.table-sticky {
|
|
5175
5175
|
position: sticky;
|
|
@@ -5899,14 +5899,39 @@
|
|
|
5899
5899
|
position: fixed;
|
|
5900
5900
|
pointer-events: auto;
|
|
5901
5901
|
box-sizing: border-box;
|
|
5902
|
-
width:
|
|
5902
|
+
width: var(--tour-card-width, 380px);
|
|
5903
5903
|
max-width: calc(100vw - var(--spacing-space-8));
|
|
5904
|
-
|
|
5905
|
-
|
|
5904
|
+
display: flex;
|
|
5905
|
+
flex-direction: column;
|
|
5906
|
+
overflow: hidden;
|
|
5906
5907
|
border-radius: var(--spacing-radius-md);
|
|
5907
5908
|
background-color: var(--semantic-surface-neutral-primary);
|
|
5908
5909
|
box-shadow: var(--semantic-shadow-lg);
|
|
5909
5910
|
}
|
|
5911
|
+
.lib-xplat-tour-card > .tour-card-head,
|
|
5912
|
+
.lib-xplat-tour-card > .tour-card-body,
|
|
5913
|
+
.lib-xplat-tour-card > .tour-card-actions {
|
|
5914
|
+
padding-left: var(--spacing-space-4);
|
|
5915
|
+
padding-right: var(--spacing-space-4);
|
|
5916
|
+
}
|
|
5917
|
+
.lib-xplat-tour-card > .tour-card-head {
|
|
5918
|
+
padding-top: var(--spacing-space-4);
|
|
5919
|
+
flex: 0 0 auto;
|
|
5920
|
+
}
|
|
5921
|
+
.lib-xplat-tour-card {
|
|
5922
|
+
}
|
|
5923
|
+
.lib-xplat-tour-card > .tour-card-body {
|
|
5924
|
+
flex: 1 1 auto;
|
|
5925
|
+
min-height: 0;
|
|
5926
|
+
overflow-y: auto;
|
|
5927
|
+
padding-top: var(--spacing-space-2);
|
|
5928
|
+
padding-bottom: var(--spacing-space-2);
|
|
5929
|
+
}
|
|
5930
|
+
.lib-xplat-tour-card > .tour-card-actions {
|
|
5931
|
+
flex: 0 0 auto;
|
|
5932
|
+
padding-bottom: var(--spacing-space-4);
|
|
5933
|
+
padding-top: var(--spacing-space-2);
|
|
5934
|
+
}
|
|
5910
5935
|
.lib-xplat-tour-card .tour-card-progress {
|
|
5911
5936
|
font-family: var(--semantic-typo-caption-2-r-font);
|
|
5912
5937
|
font-size: var(--semantic-typo-caption-2-r-size);
|
|
@@ -5923,7 +5948,6 @@
|
|
|
5923
5948
|
font-weight: var(--semantic-typo-label-1-sb-weight);
|
|
5924
5949
|
letter-spacing: var(--semantic-typo-label-1-sb-ls);
|
|
5925
5950
|
color: var(--semantic-text-primary);
|
|
5926
|
-
margin-bottom: var(--spacing-space-2);
|
|
5927
5951
|
}
|
|
5928
5952
|
.lib-xplat-tour-card .tour-card-description {
|
|
5929
5953
|
font-family: var(--semantic-typo-caption-1-r-font);
|
|
@@ -5939,7 +5963,6 @@
|
|
|
5939
5963
|
align-items: center;
|
|
5940
5964
|
justify-content: space-between;
|
|
5941
5965
|
gap: var(--spacing-space-2);
|
|
5942
|
-
margin-top: var(--spacing-space-4);
|
|
5943
5966
|
}
|
|
5944
5967
|
.lib-xplat-tour-card .tour-card-nav {
|
|
5945
5968
|
display: flex;
|
package/dist/index.js
CHANGED
|
@@ -11060,13 +11060,17 @@ var Table = (props) => {
|
|
|
11060
11060
|
rowBorderUse = true,
|
|
11061
11061
|
colBorderUse = true,
|
|
11062
11062
|
headerSticky = false,
|
|
11063
|
-
stickyShadow = true
|
|
11063
|
+
stickyShadow = true,
|
|
11064
|
+
minWidth
|
|
11064
11065
|
} = props;
|
|
11065
11066
|
return /* @__PURE__ */ jsx344(
|
|
11066
11067
|
"div",
|
|
11067
11068
|
{
|
|
11068
11069
|
className: `lib-xplat-table-wrapper ${size}`,
|
|
11069
11070
|
"data-xplat-overlay-escape": "",
|
|
11071
|
+
style: minWidth === void 0 ? void 0 : {
|
|
11072
|
+
"--table-min-width": typeof minWidth === "number" ? `${minWidth}px` : minWidth
|
|
11073
|
+
},
|
|
11070
11074
|
children: /* @__PURE__ */ jsx344(
|
|
11071
11075
|
TableContext_default.Provider,
|
|
11072
11076
|
{
|
|
@@ -11707,7 +11711,51 @@ Tooltip.displayName = "Tooltip";
|
|
|
11707
11711
|
var Tooltip_default = Tooltip;
|
|
11708
11712
|
|
|
11709
11713
|
// src/components/Tour/Tour.tsx
|
|
11714
|
+
import React45 from "react";
|
|
11715
|
+
|
|
11716
|
+
// src/tokens/hooks/useScrollLock.ts
|
|
11710
11717
|
import React44 from "react";
|
|
11718
|
+
var SCROLL_KEYS = /* @__PURE__ */ new Set([
|
|
11719
|
+
" ",
|
|
11720
|
+
"PageUp",
|
|
11721
|
+
"PageDown",
|
|
11722
|
+
"Home",
|
|
11723
|
+
"End",
|
|
11724
|
+
"ArrowUp",
|
|
11725
|
+
"ArrowDown",
|
|
11726
|
+
"ArrowLeft",
|
|
11727
|
+
"ArrowRight"
|
|
11728
|
+
]);
|
|
11729
|
+
var useScrollLock = (enabled, allowRef) => {
|
|
11730
|
+
React44.useEffect(() => {
|
|
11731
|
+
if (!enabled) return;
|
|
11732
|
+
const allowed = (target) => target instanceof Node && !!allowRef?.current?.contains(target);
|
|
11733
|
+
const block = (e) => {
|
|
11734
|
+
if (allowed(e.target)) return;
|
|
11735
|
+
e.preventDefault();
|
|
11736
|
+
};
|
|
11737
|
+
const onKey = (e) => {
|
|
11738
|
+
if (!SCROLL_KEYS.has(e.key)) return;
|
|
11739
|
+
if (allowed(e.target)) return;
|
|
11740
|
+
const el = e.target;
|
|
11741
|
+
const tag = el?.tagName;
|
|
11742
|
+
if (tag === "INPUT" || tag === "TEXTAREA" || el?.isContentEditable) return;
|
|
11743
|
+
e.preventDefault();
|
|
11744
|
+
};
|
|
11745
|
+
const opts = { passive: false, capture: true };
|
|
11746
|
+
window.addEventListener("wheel", block, opts);
|
|
11747
|
+
window.addEventListener("touchmove", block, opts);
|
|
11748
|
+
window.addEventListener("keydown", onKey, opts);
|
|
11749
|
+
return () => {
|
|
11750
|
+
window.removeEventListener("wheel", block, true);
|
|
11751
|
+
window.removeEventListener("touchmove", block, true);
|
|
11752
|
+
window.removeEventListener("keydown", onKey, true);
|
|
11753
|
+
};
|
|
11754
|
+
}, [enabled, allowRef]);
|
|
11755
|
+
};
|
|
11756
|
+
var useScrollLock_default = useScrollLock;
|
|
11757
|
+
|
|
11758
|
+
// src/components/Tour/Tour.tsx
|
|
11711
11759
|
import { jsx as jsx355, jsxs as jsxs225 } from "react/jsx-runtime";
|
|
11712
11760
|
var VIEWPORT_MARGIN = 16;
|
|
11713
11761
|
var DEFAULT_PADDING = 8;
|
|
@@ -11723,19 +11771,20 @@ var Tour = (props) => {
|
|
|
11723
11771
|
onClose,
|
|
11724
11772
|
current,
|
|
11725
11773
|
onStepChange,
|
|
11774
|
+
width = 380,
|
|
11726
11775
|
nextLabel = "\uB2E4\uC74C",
|
|
11727
11776
|
prevLabel = "\uC774\uC804",
|
|
11728
11777
|
skipLabel = "\uAC74\uB108\uB6F0\uAE30",
|
|
11729
11778
|
doneLabel = "\uB2E4 \uBD24\uC5B4\uC694"
|
|
11730
11779
|
} = props;
|
|
11731
|
-
const [uncontrolled, setUncontrolled] =
|
|
11780
|
+
const [uncontrolled, setUncontrolled] = React45.useState(0);
|
|
11732
11781
|
const index = current ?? uncontrolled;
|
|
11733
11782
|
const step = steps[index];
|
|
11734
11783
|
const isLast = index === steps.length - 1;
|
|
11735
|
-
const spotRef =
|
|
11736
|
-
const cardRef =
|
|
11737
|
-
const [targetFound, setTargetFound] =
|
|
11738
|
-
const goTo =
|
|
11784
|
+
const spotRef = React45.useRef(null);
|
|
11785
|
+
const cardRef = React45.useRef(null);
|
|
11786
|
+
const [targetFound, setTargetFound] = React45.useState(true);
|
|
11787
|
+
const goTo = React45.useCallback(
|
|
11739
11788
|
(next) => {
|
|
11740
11789
|
if (current === void 0) setUncontrolled(next);
|
|
11741
11790
|
onStepChange?.(next);
|
|
@@ -11744,9 +11793,10 @@ var Tour = (props) => {
|
|
|
11744
11793
|
);
|
|
11745
11794
|
useEscapeKey(open, () => onClose("skip"));
|
|
11746
11795
|
useFocusTrap(cardRef, open, { trap: true });
|
|
11747
|
-
|
|
11796
|
+
useScrollLock_default(open, cardRef);
|
|
11797
|
+
const stepsRef = React45.useRef(steps);
|
|
11748
11798
|
stepsRef.current = steps;
|
|
11749
|
-
|
|
11799
|
+
React45.useEffect(() => {
|
|
11750
11800
|
if (!open) return;
|
|
11751
11801
|
const target = stepsRef.current[index]?.target;
|
|
11752
11802
|
if (!target) return;
|
|
@@ -11771,7 +11821,7 @@ var Tour = (props) => {
|
|
|
11771
11821
|
stop = true;
|
|
11772
11822
|
};
|
|
11773
11823
|
}, [open, index]);
|
|
11774
|
-
const place =
|
|
11824
|
+
const place = React45.useCallback(() => {
|
|
11775
11825
|
const spot = spotRef.current;
|
|
11776
11826
|
const card = cardRef.current;
|
|
11777
11827
|
if (!spot || !card || !step) return;
|
|
@@ -11812,13 +11862,13 @@ var Tour = (props) => {
|
|
|
11812
11862
|
}
|
|
11813
11863
|
);
|
|
11814
11864
|
const limit = window.innerHeight - VIEWPORT_MARGIN * 2;
|
|
11815
|
-
const cardH = Math.min(
|
|
11865
|
+
const cardH = Math.min(card.scrollHeight, limit);
|
|
11816
11866
|
const cardW = card.offsetWidth;
|
|
11817
|
-
card.style.maxHeight = `${
|
|
11867
|
+
card.style.maxHeight = `${limit}px`;
|
|
11818
11868
|
card.style.top = `${clamp(placed.top, VIEWPORT_MARGIN, window.innerHeight - VIEWPORT_MARGIN - cardH)}px`;
|
|
11819
11869
|
card.style.left = `${clamp(placed.left, VIEWPORT_MARGIN, window.innerWidth - VIEWPORT_MARGIN - cardW)}px`;
|
|
11820
11870
|
}, [step]);
|
|
11821
|
-
|
|
11871
|
+
React45.useLayoutEffect(() => {
|
|
11822
11872
|
if (!open) return;
|
|
11823
11873
|
place();
|
|
11824
11874
|
let raf = 0;
|
|
@@ -11835,7 +11885,7 @@ var Tour = (props) => {
|
|
|
11835
11885
|
raf = requestAnimationFrame(follow);
|
|
11836
11886
|
return () => cancelAnimationFrame(raf);
|
|
11837
11887
|
}, [open, index, place]);
|
|
11838
|
-
|
|
11888
|
+
React45.useEffect(() => {
|
|
11839
11889
|
if (!open) return;
|
|
11840
11890
|
const onMove = () => place();
|
|
11841
11891
|
window.addEventListener("scroll", onMove, { passive: true, capture: true });
|
|
@@ -11854,17 +11904,20 @@ var Tour = (props) => {
|
|
|
11854
11904
|
{
|
|
11855
11905
|
ref: cardRef,
|
|
11856
11906
|
className: "lib-xplat-tour-card",
|
|
11907
|
+
style: { "--tour-card-width": typeof width === "number" ? `${width}px` : width },
|
|
11857
11908
|
role: "dialog",
|
|
11858
11909
|
"aria-modal": "true",
|
|
11859
11910
|
"aria-label": typeof step.title === "string" ? step.title : "\uD654\uBA74 \uC548\uB0B4",
|
|
11860
11911
|
children: [
|
|
11861
|
-
/* @__PURE__ */ jsxs225("div", { className: "tour-card-
|
|
11862
|
-
|
|
11863
|
-
|
|
11864
|
-
|
|
11912
|
+
/* @__PURE__ */ jsxs225("div", { className: "tour-card-head", children: [
|
|
11913
|
+
/* @__PURE__ */ jsxs225("div", { className: "tour-card-progress", "aria-hidden": true, children: [
|
|
11914
|
+
index + 1,
|
|
11915
|
+
" / ",
|
|
11916
|
+
steps.length
|
|
11917
|
+
] }),
|
|
11918
|
+
step.title && /* @__PURE__ */ jsx355("div", { className: "tour-card-title", children: step.title })
|
|
11865
11919
|
] }),
|
|
11866
|
-
step.
|
|
11867
|
-
step.description && /* @__PURE__ */ jsx355("div", { className: "tour-card-description", children: step.description }),
|
|
11920
|
+
/* @__PURE__ */ jsx355("div", { className: "tour-card-body", children: step.description && /* @__PURE__ */ jsx355("div", { className: "tour-card-description", children: step.description }) }),
|
|
11868
11921
|
/* @__PURE__ */ jsxs225("div", { className: "tour-card-actions", children: [
|
|
11869
11922
|
/* @__PURE__ */ jsx355("button", { type: "button", className: "tour-skip", onClick: () => onClose("skip"), children: skipLabel }),
|
|
11870
11923
|
/* @__PURE__ */ jsxs225("div", { className: "tour-card-nav", children: [
|
|
@@ -11897,7 +11950,7 @@ Tour.displayName = "Tour";
|
|
|
11897
11950
|
var Tour_default = Tour;
|
|
11898
11951
|
|
|
11899
11952
|
// src/components/Video/Video.tsx
|
|
11900
|
-
import
|
|
11953
|
+
import React46 from "react";
|
|
11901
11954
|
import { jsx as jsx356, jsxs as jsxs226 } from "react/jsx-runtime";
|
|
11902
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: [
|
|
11903
11956
|
/* @__PURE__ */ jsx356("rect", { x: "3", y: "5", width: "18", height: "14", rx: "2" }),
|
|
@@ -11909,7 +11962,7 @@ var formatTime = (sec) => {
|
|
|
11909
11962
|
const s = Math.floor(sec % 60);
|
|
11910
11963
|
return `${m}:${s.toString().padStart(2, "0")}`;
|
|
11911
11964
|
};
|
|
11912
|
-
var Video =
|
|
11965
|
+
var Video = React46.forwardRef((props, ref) => {
|
|
11913
11966
|
const {
|
|
11914
11967
|
src,
|
|
11915
11968
|
poster,
|
|
@@ -11933,21 +11986,21 @@ var Video = React45.forwardRef((props, ref) => {
|
|
|
11933
11986
|
children,
|
|
11934
11987
|
...rest
|
|
11935
11988
|
} = props;
|
|
11936
|
-
const containerRef =
|
|
11937
|
-
const videoRef =
|
|
11938
|
-
const [isPlaying, setIsPlaying] =
|
|
11939
|
-
const [isLoaded, setIsLoaded] =
|
|
11940
|
-
const [currentTime, setCurrentTime] =
|
|
11941
|
-
const [duration, setDuration] =
|
|
11942
|
-
const [buffered, setBuffered] =
|
|
11943
|
-
const [volume, setVolume] =
|
|
11944
|
-
const [isMuted, setIsMuted] =
|
|
11945
|
-
const [isFullscreen, setIsFullscreen] =
|
|
11946
|
-
const [playbackRate, setPlaybackRate] =
|
|
11947
|
-
const [rateMenuOpen, setRateMenuOpen] =
|
|
11948
|
-
const [captionsOn, setCaptionsOn] =
|
|
11949
|
-
const [isPip, setIsPip] =
|
|
11950
|
-
const setRefs =
|
|
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(
|
|
11951
12004
|
(el) => {
|
|
11952
12005
|
videoRef.current = el;
|
|
11953
12006
|
if (typeof ref === "function") ref(el);
|
|
@@ -11955,14 +12008,14 @@ var Video = React45.forwardRef((props, ref) => {
|
|
|
11955
12008
|
},
|
|
11956
12009
|
[ref]
|
|
11957
12010
|
);
|
|
11958
|
-
|
|
12011
|
+
React46.useEffect(() => {
|
|
11959
12012
|
const onFsChange = () => {
|
|
11960
12013
|
setIsFullscreen(document.fullscreenElement === containerRef.current);
|
|
11961
12014
|
};
|
|
11962
12015
|
document.addEventListener("fullscreenchange", onFsChange);
|
|
11963
12016
|
return () => document.removeEventListener("fullscreenchange", onFsChange);
|
|
11964
12017
|
}, []);
|
|
11965
|
-
|
|
12018
|
+
React46.useEffect(() => {
|
|
11966
12019
|
const v = videoRef.current;
|
|
11967
12020
|
if (!v) return;
|
|
11968
12021
|
const onEnter = () => setIsPip(true);
|
|
@@ -12352,13 +12405,13 @@ Layout.displayName = "Layout";
|
|
|
12352
12405
|
var Layout_default = Layout;
|
|
12353
12406
|
|
|
12354
12407
|
// src/layout/SideBar/SideBar.tsx
|
|
12355
|
-
import
|
|
12408
|
+
import React48 from "react";
|
|
12356
12409
|
|
|
12357
12410
|
// src/layout/SideBar/SideBarContext.tsx
|
|
12358
|
-
import
|
|
12359
|
-
var SideBarContext =
|
|
12411
|
+
import React47 from "react";
|
|
12412
|
+
var SideBarContext = React47.createContext(null);
|
|
12360
12413
|
var useSideBarContext = () => {
|
|
12361
|
-
const ctx =
|
|
12414
|
+
const ctx = React47.useContext(SideBarContext);
|
|
12362
12415
|
if (!ctx) throw new Error("Error");
|
|
12363
12416
|
return ctx;
|
|
12364
12417
|
};
|
|
@@ -12368,7 +12421,7 @@ var SideBarContext_default = SideBarContext;
|
|
|
12368
12421
|
import { jsx as jsx362 } from "react/jsx-runtime";
|
|
12369
12422
|
var SideBar = (props) => {
|
|
12370
12423
|
const { children, className } = props;
|
|
12371
|
-
const [isOpen, setIsOpen] =
|
|
12424
|
+
const [isOpen, setIsOpen] = React48.useState(true);
|
|
12372
12425
|
const handleSwitchSideBar = () => {
|
|
12373
12426
|
setIsOpen((prev) => !prev);
|
|
12374
12427
|
};
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
| colBorderUse | `boolean` | `true` | |
|
|
33
33
|
| headerSticky | `boolean` | `false` | |
|
|
34
34
|
| stickyShadow | `boolean` | `true` | |
|
|
35
|
+
| minWidth | `number \| string` | - | 표가 줄어들 수 있는 **최소 너비**. 숫자면 px. 기본 `600`. 그보다 좁은 자리에 넣으면 표가 쪼그라드는 대신 **가로로 밀린다.** 칸 하나가 최소 80px 이라 600px 은 "칸 일고여덟은 들어가야 표답다" 는 뜻이다. 그런데 칸이 서넛뿐인 표에는 과하다 — 반쪽 카드에 넣으면 밀려서 오른쪽이 안 보인다. 칸 수에 맞춰 낮추면 된다 (칸 3개면 `240` 쯤). |
|
|
35
36
|
|
|
36
37
|
`*` = 필수
|
|
37
38
|
<!-- /props:Table -->
|
|
@@ -34,6 +34,7 @@ const [guide, setGuide] = useState(true);
|
|
|
34
34
|
| prevLabel | `string` | `"이전"` | |
|
|
35
35
|
| skipLabel | `string` | `"건너뛰기"` | |
|
|
36
36
|
| doneLabel | `string` | `"다 봤어요"` | |
|
|
37
|
+
| width | `number \| string` | `380` | 말풍선 너비. 숫자면 px. 화면이 좁으면 그만큼 줄어든다 |
|
|
37
38
|
|
|
38
39
|
### TourStep
|
|
39
40
|
|
|
@@ -77,10 +78,26 @@ const [guide, setGuide] = useState(true);
|
|
|
77
78
|
(건너뜀) 인지만 알려 주고, 저장할지·어디에 할지는 쓰는 쪽이 정한다 —
|
|
78
79
|
화면마다 다르고 저장 자리(로컬·서버)도 제각각이다.
|
|
79
80
|
|
|
80
|
-
##
|
|
81
|
+
## 말풍선
|
|
81
82
|
|
|
82
|
-
|
|
83
|
-
|
|
83
|
+
설명이 길면 **설명 칸만 구른다.** 머리말(차례·제목)과 버튼은 제자리에 있다.
|
|
84
|
+
|
|
85
|
+
크기는 **내용만큼** 잡고 화면보다 길 때만 화면에 맞춘다. 대상 둘레에 자리가
|
|
86
|
+
모자라도 말풍선을 줄이지 않는다 — 자리를 옮겨서 피한다. 줄이면 읽을 수가 없다.
|
|
87
|
+
|
|
88
|
+
너비는 `width` 로 바꾼다.
|
|
89
|
+
|
|
90
|
+
## 눌림과 스크롤
|
|
91
|
+
|
|
92
|
+
안내 중에는 **아무것도 안 눌리고 굴러가지도 않는다** — 구멍 안쪽까지 포함해서.
|
|
93
|
+
가리키는 것만 보여 주고, 실제로 만지는 것은 안내가 끝난 뒤다.
|
|
94
|
+
|
|
95
|
+
막는 것은 **사용자가 직접 구르는 것**(휠·손가락·키)뿐이다. `body` 에
|
|
96
|
+
`overflow: hidden` 을 거는 흔한 방법은 페이지만 막아서, DS `Layout` 처럼 본문만
|
|
97
|
+
구르는 화면에서는 아무것도 안 막힌다. 입력을 막으면 어느 상자가 구르든 걸린다.
|
|
98
|
+
|
|
99
|
+
투어가 대상을 데려오는 스크롤은 **그대로 돈다** — 입력만 막기 때문이다.
|
|
100
|
+
말풍선 안 설명도 구를 수 있다.
|
|
84
101
|
|
|
85
102
|
## 키보드
|
|
86
103
|
|