@x-plat/design-system 0.4.3 → 0.4.5
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/Card/index.css +1 -2
- package/dist/components/DatePicker/index.cjs +30 -5
- package/dist/components/DatePicker/index.css +43 -0
- package/dist/components/DatePicker/index.js +30 -5
- package/dist/components/PopOver/index.css +4 -0
- package/dist/components/index.cjs +166 -141
- package/dist/components/index.css +48 -2
- package/dist/components/index.js +166 -141
- package/dist/index.cjs +171 -146
- package/dist/index.css +74 -2
- package/dist/index.js +171 -146
- package/dist/layout/Header/index.css +11 -0
- package/dist/layout/Layout/index.css +15 -0
- package/dist/layout/index.css +26 -0
- package/package.json +1 -1
package/dist/components/index.js
CHANGED
|
@@ -16867,7 +16867,7 @@ InputDatePicker.displayName = "InputDatePicker";
|
|
|
16867
16867
|
var InputDatePicker_default = InputDatePicker;
|
|
16868
16868
|
|
|
16869
16869
|
// src/components/DatePicker/PopupPicker/index.tsx
|
|
16870
|
-
import
|
|
16870
|
+
import React13 from "react";
|
|
16871
16871
|
|
|
16872
16872
|
// src/components/Modal/Modal.tsx
|
|
16873
16873
|
import React11 from "react";
|
|
@@ -16916,6 +16916,7 @@ Modal.displayName = "Modal";
|
|
|
16916
16916
|
var Modal_default = Modal;
|
|
16917
16917
|
|
|
16918
16918
|
// src/components/DatePicker/RangePicker/index.tsx
|
|
16919
|
+
import React12 from "react";
|
|
16919
16920
|
import { jsx as jsx315, jsxs as jsxs201 } from "react/jsx-runtime";
|
|
16920
16921
|
var RangePicker = (props) => {
|
|
16921
16922
|
const {
|
|
@@ -16927,6 +16928,7 @@ var RangePicker = (props) => {
|
|
|
16927
16928
|
maxDate,
|
|
16928
16929
|
locale = "ko"
|
|
16929
16930
|
} = props;
|
|
16931
|
+
const [activeTab, setActiveTab] = React12.useState("start");
|
|
16930
16932
|
const startCal = useCalendar(startDate.getFullYear(), startDate.getMonth());
|
|
16931
16933
|
const endCal = useCalendar(endDate.getFullYear(), endDate.getMonth());
|
|
16932
16934
|
const isDisabled = (date, type) => {
|
|
@@ -17033,8 +17035,31 @@ var RangePicker = (props) => {
|
|
|
17033
17035
|
"--datepicker-active-color": `var(--${color2})`
|
|
17034
17036
|
},
|
|
17035
17037
|
children: [
|
|
17036
|
-
|
|
17037
|
-
|
|
17038
|
+
/* @__PURE__ */ jsxs201("div", { className: "datepicker-range-tabs", children: [
|
|
17039
|
+
/* @__PURE__ */ jsx315(
|
|
17040
|
+
"button",
|
|
17041
|
+
{
|
|
17042
|
+
type: "button",
|
|
17043
|
+
className: clsx_default("datepicker-range-tab", activeTab === "start" && "active"),
|
|
17044
|
+
onClick: () => setActiveTab("start"),
|
|
17045
|
+
children: locale === "ko" ? "\uC2DC\uC791\uC77C" : "Start"
|
|
17046
|
+
}
|
|
17047
|
+
),
|
|
17048
|
+
/* @__PURE__ */ jsx315(
|
|
17049
|
+
"button",
|
|
17050
|
+
{
|
|
17051
|
+
type: "button",
|
|
17052
|
+
className: clsx_default("datepicker-range-tab", activeTab === "end" && "active"),
|
|
17053
|
+
onClick: () => setActiveTab("end"),
|
|
17054
|
+
children: locale === "ko" ? "\uC885\uB8CC\uC77C" : "End"
|
|
17055
|
+
}
|
|
17056
|
+
)
|
|
17057
|
+
] }),
|
|
17058
|
+
/* @__PURE__ */ jsxs201("div", { className: "datepicker-range-panels", children: [
|
|
17059
|
+
renderCalendar(startCal, "start"),
|
|
17060
|
+
renderCalendar(endCal, "end")
|
|
17061
|
+
] }),
|
|
17062
|
+
/* @__PURE__ */ jsx315("div", { className: "datepicker-range-mobile", children: activeTab === "start" ? renderCalendar(startCal, "start") : renderCalendar(endCal, "end") })
|
|
17038
17063
|
]
|
|
17039
17064
|
}
|
|
17040
17065
|
);
|
|
@@ -17046,7 +17071,7 @@ var RangePicker_default = RangePicker;
|
|
|
17046
17071
|
import { jsx as jsx316, jsxs as jsxs202 } from "react/jsx-runtime";
|
|
17047
17072
|
var PopupPicker = (props) => {
|
|
17048
17073
|
const { component, type, locale } = props;
|
|
17049
|
-
const [isOpen, setIsOpen] =
|
|
17074
|
+
const [isOpen, setIsOpen] = React13.useState(false);
|
|
17050
17075
|
const handleClick = () => setIsOpen(true);
|
|
17051
17076
|
const handleClose = () => setIsOpen(false);
|
|
17052
17077
|
const handleSingleChange = (date) => {
|
|
@@ -17055,7 +17080,7 @@ var PopupPicker = (props) => {
|
|
|
17055
17080
|
handleClose();
|
|
17056
17081
|
};
|
|
17057
17082
|
return /* @__PURE__ */ jsxs202("div", { className: "lib-xplat-popup-datepicker", children: [
|
|
17058
|
-
|
|
17083
|
+
React13.cloneElement(component, { onClick: handleClick }),
|
|
17059
17084
|
/* @__PURE__ */ jsx316(Modal_default, { isOpen, onClose: handleClose, children: /* @__PURE__ */ jsxs202("div", { className: clsx_default("lib-xplat-popup-datepicker-card", type === "range" && "range-mode"), children: [
|
|
17060
17085
|
/* @__PURE__ */ jsxs202("div", { className: "popup-datepicker-content", children: [
|
|
17061
17086
|
type === "single" && /* @__PURE__ */ jsx316(
|
|
@@ -17115,15 +17140,15 @@ Divider.displayName = "Divider";
|
|
|
17115
17140
|
var Divider_default = Divider;
|
|
17116
17141
|
|
|
17117
17142
|
// src/components/Drawer/Drawer.tsx
|
|
17118
|
-
import
|
|
17143
|
+
import React14 from "react";
|
|
17119
17144
|
import { createPortal as createPortal2 } from "react-dom";
|
|
17120
17145
|
import { jsx as jsx318, jsxs as jsxs203 } from "react/jsx-runtime";
|
|
17121
17146
|
var ANIMATION_DURATION_MS2 = 250;
|
|
17122
17147
|
var Drawer = (props) => {
|
|
17123
17148
|
const { isOpen, onClose, placement = "right", width = 320, title, children } = props;
|
|
17124
|
-
const [mounted, setMounted] =
|
|
17125
|
-
const [visible, setVisible] =
|
|
17126
|
-
|
|
17149
|
+
const [mounted, setMounted] = React14.useState(false);
|
|
17150
|
+
const [visible, setVisible] = React14.useState(false);
|
|
17151
|
+
React14.useEffect(() => {
|
|
17127
17152
|
if (isOpen) {
|
|
17128
17153
|
setMounted(true);
|
|
17129
17154
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -17169,16 +17194,16 @@ Drawer.displayName = "Drawer";
|
|
|
17169
17194
|
var Drawer_default = Drawer;
|
|
17170
17195
|
|
|
17171
17196
|
// src/components/Dropdown/Dropdown.tsx
|
|
17172
|
-
import
|
|
17197
|
+
import React16 from "react";
|
|
17173
17198
|
|
|
17174
17199
|
// src/tokens/hooks/useAutoPosition.ts
|
|
17175
|
-
import
|
|
17200
|
+
import React15 from "react";
|
|
17176
17201
|
var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
17177
|
-
const [position, setPosition] =
|
|
17202
|
+
const [position, setPosition] = React15.useState({
|
|
17178
17203
|
position: {},
|
|
17179
17204
|
direction: "bottom"
|
|
17180
17205
|
});
|
|
17181
|
-
const calculatePosition =
|
|
17206
|
+
const calculatePosition = React15.useCallback(() => {
|
|
17182
17207
|
if (!triggerRef.current || !popRef.current) return;
|
|
17183
17208
|
const triggerRect = triggerRef.current.getBoundingClientRect();
|
|
17184
17209
|
const popRect = popRef.current.getBoundingClientRect();
|
|
@@ -17200,7 +17225,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
17200
17225
|
direction
|
|
17201
17226
|
});
|
|
17202
17227
|
}, [triggerRef, popRef]);
|
|
17203
|
-
|
|
17228
|
+
React15.useEffect(() => {
|
|
17204
17229
|
calculatePosition();
|
|
17205
17230
|
window.addEventListener("resize", calculatePosition);
|
|
17206
17231
|
return () => window.removeEventListener("resize", calculatePosition);
|
|
@@ -17213,14 +17238,14 @@ var useAutoPosition_default = useAutoPosition;
|
|
|
17213
17238
|
import { jsx as jsx319, jsxs as jsxs204 } from "react/jsx-runtime";
|
|
17214
17239
|
var Dropdown = (props) => {
|
|
17215
17240
|
const { items, children, className } = props;
|
|
17216
|
-
const [isOpen, setIsOpen] =
|
|
17217
|
-
const [mounted, setMounted] =
|
|
17218
|
-
const [visible, setVisible] =
|
|
17219
|
-
const triggerRef =
|
|
17220
|
-
const menuRef =
|
|
17241
|
+
const [isOpen, setIsOpen] = React16.useState(false);
|
|
17242
|
+
const [mounted, setMounted] = React16.useState(false);
|
|
17243
|
+
const [visible, setVisible] = React16.useState(false);
|
|
17244
|
+
const triggerRef = React16.useRef(null);
|
|
17245
|
+
const menuRef = React16.useRef(null);
|
|
17221
17246
|
const { position, direction } = useAutoPosition_default(triggerRef, menuRef, isOpen);
|
|
17222
17247
|
useClickOutside_default([triggerRef, menuRef], () => setIsOpen(false));
|
|
17223
|
-
|
|
17248
|
+
React16.useEffect(() => {
|
|
17224
17249
|
if (isOpen) {
|
|
17225
17250
|
setMounted(true);
|
|
17226
17251
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -17289,7 +17314,7 @@ EmptyState.displayName = "EmptyState";
|
|
|
17289
17314
|
var EmptyState_default = EmptyState;
|
|
17290
17315
|
|
|
17291
17316
|
// src/components/FileUpload/FileUpload.tsx
|
|
17292
|
-
import
|
|
17317
|
+
import React17 from "react";
|
|
17293
17318
|
import { jsx as jsx321, jsxs as jsxs206 } from "react/jsx-runtime";
|
|
17294
17319
|
var FileUpload = (props) => {
|
|
17295
17320
|
const {
|
|
@@ -17301,8 +17326,8 @@ var FileUpload = (props) => {
|
|
|
17301
17326
|
description,
|
|
17302
17327
|
className
|
|
17303
17328
|
} = props;
|
|
17304
|
-
const [isDragOver, setIsDragOver] =
|
|
17305
|
-
const inputRef =
|
|
17329
|
+
const [isDragOver, setIsDragOver] = React17.useState(false);
|
|
17330
|
+
const inputRef = React17.useRef(null);
|
|
17306
17331
|
const handleFiles = (fileList) => {
|
|
17307
17332
|
let files = Array.from(fileList);
|
|
17308
17333
|
if (maxSize) {
|
|
@@ -17362,19 +17387,19 @@ FileUpload.displayName = "FileUpload";
|
|
|
17362
17387
|
var FileUpload_default = FileUpload;
|
|
17363
17388
|
|
|
17364
17389
|
// src/components/Select/Select.tsx
|
|
17365
|
-
import
|
|
17390
|
+
import React20 from "react";
|
|
17366
17391
|
|
|
17367
17392
|
// src/components/Select/context.ts
|
|
17368
|
-
import
|
|
17369
|
-
var SelectContext =
|
|
17393
|
+
import React18 from "react";
|
|
17394
|
+
var SelectContext = React18.createContext(null);
|
|
17370
17395
|
var context_default = SelectContext;
|
|
17371
17396
|
|
|
17372
17397
|
// src/components/Select/SelectItem.tsx
|
|
17373
|
-
import
|
|
17398
|
+
import React19 from "react";
|
|
17374
17399
|
import { jsx as jsx322 } from "react/jsx-runtime";
|
|
17375
17400
|
var SelectItem = (props) => {
|
|
17376
17401
|
const { children, value, onClick, disabled = false, className } = props;
|
|
17377
|
-
const ctx =
|
|
17402
|
+
const ctx = React19.useContext(context_default);
|
|
17378
17403
|
const handleClick = (e) => {
|
|
17379
17404
|
e.preventDefault();
|
|
17380
17405
|
e.stopPropagation();
|
|
@@ -17416,26 +17441,26 @@ var SelectRoot = (props) => {
|
|
|
17416
17441
|
error = false,
|
|
17417
17442
|
size = "md"
|
|
17418
17443
|
} = props;
|
|
17419
|
-
const itemChildren =
|
|
17420
|
-
(child) =>
|
|
17444
|
+
const itemChildren = React20.Children.toArray(children).filter(
|
|
17445
|
+
(child) => React20.isValidElement(child) && child.type === SelectItem_default
|
|
17421
17446
|
);
|
|
17422
17447
|
const isControlled = valueProp !== void 0;
|
|
17423
|
-
const [isOpen, setOpen] =
|
|
17424
|
-
const [uncontrolledLabel, setUncontrolledLabel] =
|
|
17425
|
-
const controlledLabel =
|
|
17448
|
+
const [isOpen, setOpen] = React20.useState(false);
|
|
17449
|
+
const [uncontrolledLabel, setUncontrolledLabel] = React20.useState(null);
|
|
17450
|
+
const controlledLabel = React20.useMemo(() => {
|
|
17426
17451
|
if (!isControlled) return null;
|
|
17427
17452
|
const match = itemChildren.find((child) => child.props.value === valueProp);
|
|
17428
17453
|
return match ? match.props.children : null;
|
|
17429
17454
|
}, [isControlled, valueProp, itemChildren]);
|
|
17430
17455
|
const selectedLabel = isControlled ? controlledLabel : uncontrolledLabel;
|
|
17431
|
-
const triggerRef =
|
|
17432
|
-
const contentRef =
|
|
17433
|
-
const [mounted, setMounted] =
|
|
17434
|
-
const [visible, setVisible] =
|
|
17435
|
-
|
|
17456
|
+
const triggerRef = React20.useRef(null);
|
|
17457
|
+
const contentRef = React20.useRef(null);
|
|
17458
|
+
const [mounted, setMounted] = React20.useState(false);
|
|
17459
|
+
const [visible, setVisible] = React20.useState(false);
|
|
17460
|
+
React20.useEffect(() => {
|
|
17436
17461
|
if (disabled && isOpen) setOpen(false);
|
|
17437
17462
|
}, [disabled, isOpen]);
|
|
17438
|
-
|
|
17463
|
+
React20.useEffect(() => {
|
|
17439
17464
|
if (isOpen) {
|
|
17440
17465
|
setMounted(true);
|
|
17441
17466
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -17445,12 +17470,12 @@ var SelectRoot = (props) => {
|
|
|
17445
17470
|
const t = setTimeout(() => setMounted(false), ANIMATION_DURATION_MS3);
|
|
17446
17471
|
return () => clearTimeout(t);
|
|
17447
17472
|
}, [isOpen]);
|
|
17448
|
-
const open =
|
|
17449
|
-
const close =
|
|
17450
|
-
const toggle =
|
|
17473
|
+
const open = React20.useCallback(() => setOpen(true), []);
|
|
17474
|
+
const close = React20.useCallback(() => setOpen(false), []);
|
|
17475
|
+
const toggle = React20.useCallback(() => setOpen((prev) => !prev), []);
|
|
17451
17476
|
useClickOutside_default([contentRef, triggerRef], close, isOpen);
|
|
17452
17477
|
const position = useAutoPosition_default(triggerRef, contentRef, mounted);
|
|
17453
|
-
const setSelected =
|
|
17478
|
+
const setSelected = React20.useCallback(
|
|
17454
17479
|
(label, itemValue) => {
|
|
17455
17480
|
if (!isControlled) {
|
|
17456
17481
|
setUncontrolledLabel(label);
|
|
@@ -17459,7 +17484,7 @@ var SelectRoot = (props) => {
|
|
|
17459
17484
|
},
|
|
17460
17485
|
[isControlled, onChange]
|
|
17461
17486
|
);
|
|
17462
|
-
const ctxValue =
|
|
17487
|
+
const ctxValue = React20.useMemo(
|
|
17463
17488
|
() => ({
|
|
17464
17489
|
isOpen,
|
|
17465
17490
|
mounted,
|
|
@@ -17557,10 +17582,10 @@ var Select = Object.assign(SelectRoot, {
|
|
|
17557
17582
|
var Select_default = Select;
|
|
17558
17583
|
|
|
17559
17584
|
// src/components/HtmlTypeWriter/HtmlTypeWriter.tsx
|
|
17560
|
-
import
|
|
17585
|
+
import React22 from "react";
|
|
17561
17586
|
|
|
17562
17587
|
// src/components/HtmlTypeWriter/utils.ts
|
|
17563
|
-
import
|
|
17588
|
+
import React21 from "react";
|
|
17564
17589
|
var voidTags = /* @__PURE__ */ new Set([
|
|
17565
17590
|
"br",
|
|
17566
17591
|
"img",
|
|
@@ -17628,15 +17653,15 @@ function convertNodeToReactWithRange(node, typedLen, rangeMap) {
|
|
|
17628
17653
|
props[attr.name] = attr.value;
|
|
17629
17654
|
});
|
|
17630
17655
|
if (voidTags.has(tag)) {
|
|
17631
|
-
return
|
|
17656
|
+
return React21.createElement(tag, props);
|
|
17632
17657
|
}
|
|
17633
17658
|
const children = Array.from(element.childNodes).map((child) => convertNodeToReactWithRange(child, typedLen, rangeMap)).filter((n) => n != null);
|
|
17634
|
-
return
|
|
17659
|
+
return React21.createElement(tag, props, ...children);
|
|
17635
17660
|
}
|
|
17636
17661
|
function htmlToReactProgressive(root, typedLen, rangeMap) {
|
|
17637
17662
|
const nodes = Array.from(root.childNodes).map((child, idx) => {
|
|
17638
17663
|
const node = convertNodeToReactWithRange(child, typedLen, rangeMap);
|
|
17639
|
-
return node == null ? null :
|
|
17664
|
+
return node == null ? null : React21.createElement(React21.Fragment, { key: idx }, node);
|
|
17640
17665
|
}).filter(Boolean);
|
|
17641
17666
|
return nodes.length === 0 ? null : nodes;
|
|
17642
17667
|
}
|
|
@@ -17649,20 +17674,20 @@ var HtmlTypeWriter = ({
|
|
|
17649
17674
|
onDone,
|
|
17650
17675
|
onChange
|
|
17651
17676
|
}) => {
|
|
17652
|
-
const [typedLen, setTypedLen] =
|
|
17653
|
-
const doneCalledRef =
|
|
17654
|
-
const { doc, rangeMap, totalLength } =
|
|
17677
|
+
const [typedLen, setTypedLen] = React22.useState(0);
|
|
17678
|
+
const doneCalledRef = React22.useRef(false);
|
|
17679
|
+
const { doc, rangeMap, totalLength } = React22.useMemo(() => {
|
|
17655
17680
|
if (typeof window === "undefined") return { doc: null, rangeMap: /* @__PURE__ */ new Map(), totalLength: 0 };
|
|
17656
17681
|
const decoded = decodeHtmlEntities(html);
|
|
17657
17682
|
const doc2 = new DOMParser().parseFromString(decoded, "text/html");
|
|
17658
17683
|
const { rangeMap: rangeMap2, totalLength: totalLength2 } = buildRangeMap(doc2.body);
|
|
17659
17684
|
return { doc: doc2, rangeMap: rangeMap2, totalLength: totalLength2 };
|
|
17660
17685
|
}, [html]);
|
|
17661
|
-
|
|
17686
|
+
React22.useEffect(() => {
|
|
17662
17687
|
setTypedLen(0);
|
|
17663
17688
|
doneCalledRef.current = false;
|
|
17664
17689
|
}, [html]);
|
|
17665
|
-
|
|
17690
|
+
React22.useEffect(() => {
|
|
17666
17691
|
if (!totalLength) return;
|
|
17667
17692
|
if (typedLen >= totalLength) return;
|
|
17668
17693
|
const timer = window.setInterval(() => {
|
|
@@ -17670,18 +17695,18 @@ var HtmlTypeWriter = ({
|
|
|
17670
17695
|
}, duration);
|
|
17671
17696
|
return () => window.clearInterval(timer);
|
|
17672
17697
|
}, [typedLen, totalLength, duration]);
|
|
17673
|
-
|
|
17698
|
+
React22.useEffect(() => {
|
|
17674
17699
|
if (typedLen > 0 && typedLen < totalLength) {
|
|
17675
17700
|
onChange?.();
|
|
17676
17701
|
}
|
|
17677
17702
|
}, [typedLen, totalLength, onChange]);
|
|
17678
|
-
|
|
17703
|
+
React22.useEffect(() => {
|
|
17679
17704
|
if (typedLen === totalLength && totalLength > 0 && !doneCalledRef.current) {
|
|
17680
17705
|
doneCalledRef.current = true;
|
|
17681
17706
|
onDone?.();
|
|
17682
17707
|
}
|
|
17683
17708
|
}, [typedLen, totalLength, onDone]);
|
|
17684
|
-
const parsed =
|
|
17709
|
+
const parsed = React22.useMemo(
|
|
17685
17710
|
() => doc ? htmlToReactProgressive(doc.body, typedLen, rangeMap) : null,
|
|
17686
17711
|
[doc, typedLen, rangeMap]
|
|
17687
17712
|
);
|
|
@@ -17691,12 +17716,12 @@ HtmlTypeWriter.displayName = "HtmlTypeWriter";
|
|
|
17691
17716
|
var HtmlTypeWriter_default = HtmlTypeWriter;
|
|
17692
17717
|
|
|
17693
17718
|
// src/components/ImageSelector/ImageSelector.tsx
|
|
17694
|
-
import
|
|
17719
|
+
import React23 from "react";
|
|
17695
17720
|
import { jsx as jsx325, jsxs as jsxs208 } from "react/jsx-runtime";
|
|
17696
17721
|
var ImageSelector = (props) => {
|
|
17697
17722
|
const { value, label, onChange } = props;
|
|
17698
|
-
const [previewUrl, setPreviewUrl] =
|
|
17699
|
-
|
|
17723
|
+
const [previewUrl, setPreviewUrl] = React23.useState();
|
|
17724
|
+
React23.useEffect(() => {
|
|
17700
17725
|
if (!value) {
|
|
17701
17726
|
setPreviewUrl(void 0);
|
|
17702
17727
|
return;
|
|
@@ -17705,7 +17730,7 @@ var ImageSelector = (props) => {
|
|
|
17705
17730
|
setPreviewUrl(url);
|
|
17706
17731
|
return () => URL.revokeObjectURL(url);
|
|
17707
17732
|
}, [value]);
|
|
17708
|
-
const inputRef =
|
|
17733
|
+
const inputRef = React23.useRef(null);
|
|
17709
17734
|
const handleFileChange = (e) => {
|
|
17710
17735
|
const selectedFile = e.target.files?.[0];
|
|
17711
17736
|
if (selectedFile) {
|
|
@@ -17827,17 +17852,17 @@ Pagination.displayName = "Pagination";
|
|
|
17827
17852
|
var Pagination_default = Pagination;
|
|
17828
17853
|
|
|
17829
17854
|
// src/components/PopOver/PopOver.tsx
|
|
17830
|
-
import
|
|
17855
|
+
import React24 from "react";
|
|
17831
17856
|
import { jsx as jsx327, jsxs as jsxs210 } from "react/jsx-runtime";
|
|
17832
17857
|
var PopOver = (props) => {
|
|
17833
17858
|
const { children, isOpen, onClose, PopOverEl } = props;
|
|
17834
|
-
const popRef =
|
|
17835
|
-
const triggerRef =
|
|
17836
|
-
const [localOpen, setLocalOpen] =
|
|
17837
|
-
const [eventTrigger, setEventTrigger] =
|
|
17859
|
+
const popRef = React24.useRef(null);
|
|
17860
|
+
const triggerRef = React24.useRef(null);
|
|
17861
|
+
const [localOpen, setLocalOpen] = React24.useState(false);
|
|
17862
|
+
const [eventTrigger, setEventTrigger] = React24.useState(false);
|
|
17838
17863
|
useClickOutside_default([popRef, triggerRef], onClose, isOpen);
|
|
17839
17864
|
const position = useAutoPosition_default(triggerRef, popRef, localOpen);
|
|
17840
|
-
|
|
17865
|
+
React24.useEffect(() => {
|
|
17841
17866
|
if (isOpen) {
|
|
17842
17867
|
setLocalOpen(isOpen);
|
|
17843
17868
|
setTimeout(() => {
|
|
@@ -17923,12 +17948,12 @@ Progress.displayName = "Progress";
|
|
|
17923
17948
|
var Progress_default = Progress;
|
|
17924
17949
|
|
|
17925
17950
|
// src/components/Radio/RadioGroupContext.tsx
|
|
17926
|
-
import
|
|
17927
|
-
var RadioGroupContext =
|
|
17951
|
+
import React25 from "react";
|
|
17952
|
+
var RadioGroupContext = React25.createContext(
|
|
17928
17953
|
null
|
|
17929
17954
|
);
|
|
17930
17955
|
var useRadioGroupContext = () => {
|
|
17931
|
-
return
|
|
17956
|
+
return React25.useContext(RadioGroupContext);
|
|
17932
17957
|
};
|
|
17933
17958
|
var RadioGroupContext_default = RadioGroupContext;
|
|
17934
17959
|
|
|
@@ -18084,7 +18109,7 @@ Steps.displayName = "Steps";
|
|
|
18084
18109
|
var Steps_default = Steps;
|
|
18085
18110
|
|
|
18086
18111
|
// src/components/Swiper/Swiper.tsx
|
|
18087
|
-
import
|
|
18112
|
+
import React26 from "react";
|
|
18088
18113
|
import { jsx as jsx334, jsxs as jsxs215 } from "react/jsx-runtime";
|
|
18089
18114
|
var Swiper = (props) => {
|
|
18090
18115
|
const {
|
|
@@ -18109,23 +18134,23 @@ var Swiper = (props) => {
|
|
|
18109
18134
|
const maxIndex = Math.max(0, totalSlides - viewItemCount);
|
|
18110
18135
|
const useLoop = loop && canSlide;
|
|
18111
18136
|
const cloneCount = useLoop ? totalSlides : 0;
|
|
18112
|
-
const extendedItems =
|
|
18137
|
+
const extendedItems = React26.useMemo(() => {
|
|
18113
18138
|
if (!useLoop) return items;
|
|
18114
18139
|
return [...items, ...items, ...items];
|
|
18115
18140
|
}, [items, useLoop]);
|
|
18116
18141
|
const initialIdx = Math.max(0, Math.min(indexProp ?? 0, maxIndex));
|
|
18117
|
-
const [innerIndex, setInnerIndex] =
|
|
18142
|
+
const [innerIndex, setInnerIndex] = React26.useState(
|
|
18118
18143
|
useLoop ? cloneCount + initialIdx : initialIdx
|
|
18119
18144
|
);
|
|
18120
|
-
const [isDragging, setIsDragging] =
|
|
18121
|
-
const [dragOffset, setDragOffset] =
|
|
18122
|
-
const [animated, setAnimated] =
|
|
18123
|
-
const [containerWidth, setContainerWidth] =
|
|
18124
|
-
const containerRef =
|
|
18125
|
-
const startXRef =
|
|
18126
|
-
const startTimeRef =
|
|
18127
|
-
const autoplayTimerRef =
|
|
18128
|
-
|
|
18145
|
+
const [isDragging, setIsDragging] = React26.useState(false);
|
|
18146
|
+
const [dragOffset, setDragOffset] = React26.useState(0);
|
|
18147
|
+
const [animated, setAnimated] = React26.useState(true);
|
|
18148
|
+
const [containerWidth, setContainerWidth] = React26.useState(0);
|
|
18149
|
+
const containerRef = React26.useRef(null);
|
|
18150
|
+
const startXRef = React26.useRef(0);
|
|
18151
|
+
const startTimeRef = React26.useRef(0);
|
|
18152
|
+
const autoplayTimerRef = React26.useRef(null);
|
|
18153
|
+
React26.useEffect(() => {
|
|
18129
18154
|
const el = containerRef.current;
|
|
18130
18155
|
if (!el) return;
|
|
18131
18156
|
const ro = new ResizeObserver((entries) => {
|
|
@@ -18144,7 +18169,7 @@ var Swiper = (props) => {
|
|
|
18144
18169
|
return ((inner - cloneCount) % totalSlides + totalSlides) % totalSlides;
|
|
18145
18170
|
};
|
|
18146
18171
|
const realIndex = getRealIndex(innerIndex);
|
|
18147
|
-
const moveToInner =
|
|
18172
|
+
const moveToInner = React26.useCallback(
|
|
18148
18173
|
(idx, withAnim = true) => {
|
|
18149
18174
|
if (!useLoop) {
|
|
18150
18175
|
setAnimated(withAnim);
|
|
@@ -18172,7 +18197,7 @@ var Swiper = (props) => {
|
|
|
18172
18197
|
},
|
|
18173
18198
|
[useLoop, cloneCount, totalSlides]
|
|
18174
18199
|
);
|
|
18175
|
-
const handleTransitionEnd =
|
|
18200
|
+
const handleTransitionEnd = React26.useCallback(() => {
|
|
18176
18201
|
if (!useLoop) return;
|
|
18177
18202
|
const real = getRealIndex(innerIndex);
|
|
18178
18203
|
const canonical = cloneCount + real;
|
|
@@ -18182,7 +18207,7 @@ var Swiper = (props) => {
|
|
|
18182
18207
|
}
|
|
18183
18208
|
onChange?.(Math.min(real, maxIndex));
|
|
18184
18209
|
}, [useLoop, innerIndex, cloneCount, totalSlides, maxIndex, onChange]);
|
|
18185
|
-
const slideTo =
|
|
18210
|
+
const slideTo = React26.useCallback(
|
|
18186
18211
|
(logicalIndex) => {
|
|
18187
18212
|
if (!canSlide) return;
|
|
18188
18213
|
const clamped = useLoop ? logicalIndex : Math.max(0, Math.min(logicalIndex, maxIndex));
|
|
@@ -18192,7 +18217,7 @@ var Swiper = (props) => {
|
|
|
18192
18217
|
},
|
|
18193
18218
|
[canSlide, useLoop, cloneCount, maxIndex, onChange, moveToInner]
|
|
18194
18219
|
);
|
|
18195
|
-
const slideNext =
|
|
18220
|
+
const slideNext = React26.useCallback(() => {
|
|
18196
18221
|
if (!canSlide) return;
|
|
18197
18222
|
const nextInner = innerIndex + slideBy;
|
|
18198
18223
|
if (useLoop) {
|
|
@@ -18201,7 +18226,7 @@ var Swiper = (props) => {
|
|
|
18201
18226
|
moveToInner(Math.min(nextInner, maxIndex), true);
|
|
18202
18227
|
}
|
|
18203
18228
|
}, [canSlide, useLoop, innerIndex, slideBy, maxIndex, moveToInner]);
|
|
18204
|
-
const slidePrev =
|
|
18229
|
+
const slidePrev = React26.useCallback(() => {
|
|
18205
18230
|
if (!canSlide) return;
|
|
18206
18231
|
const prevInner = innerIndex - slideBy;
|
|
18207
18232
|
if (useLoop) {
|
|
@@ -18210,7 +18235,7 @@ var Swiper = (props) => {
|
|
|
18210
18235
|
moveToInner(Math.max(prevInner, 0), true);
|
|
18211
18236
|
}
|
|
18212
18237
|
}, [canSlide, useLoop, innerIndex, slideBy, moveToInner]);
|
|
18213
|
-
|
|
18238
|
+
React26.useEffect(() => {
|
|
18214
18239
|
if (indexProp === void 0) return;
|
|
18215
18240
|
const clamped = Math.max(0, Math.min(indexProp, maxIndex));
|
|
18216
18241
|
const target = useLoop ? cloneCount + clamped : clamped;
|
|
@@ -18218,12 +18243,12 @@ var Swiper = (props) => {
|
|
|
18218
18243
|
moveToInner(target, true);
|
|
18219
18244
|
}
|
|
18220
18245
|
}, [indexProp]);
|
|
18221
|
-
|
|
18246
|
+
React26.useImperativeHandle(swiperRef, () => ({
|
|
18222
18247
|
slidePrev,
|
|
18223
18248
|
slideNext,
|
|
18224
18249
|
slideTo
|
|
18225
18250
|
}));
|
|
18226
|
-
|
|
18251
|
+
React26.useEffect(() => {
|
|
18227
18252
|
if (!auto || !canSlide) return;
|
|
18228
18253
|
autoplayTimerRef.current = setInterval(slideNext, autoplayDelay);
|
|
18229
18254
|
return () => {
|
|
@@ -18246,7 +18271,7 @@ var Swiper = (props) => {
|
|
|
18246
18271
|
startXRef.current = getClientX(e);
|
|
18247
18272
|
startTimeRef.current = Date.now();
|
|
18248
18273
|
};
|
|
18249
|
-
|
|
18274
|
+
React26.useEffect(() => {
|
|
18250
18275
|
if (!isDragging) return;
|
|
18251
18276
|
const handleMove = (e) => {
|
|
18252
18277
|
setDragOffset(getClientX(e) - startXRef.current);
|
|
@@ -18353,7 +18378,7 @@ Swiper.displayName = "Swiper";
|
|
|
18353
18378
|
var Swiper_default = Swiper;
|
|
18354
18379
|
|
|
18355
18380
|
// src/components/Switch/Switch.tsx
|
|
18356
|
-
import
|
|
18381
|
+
import React27 from "react";
|
|
18357
18382
|
import { jsx as jsx335 } from "react/jsx-runtime";
|
|
18358
18383
|
var KNOB_TRANSITION_MS = 250;
|
|
18359
18384
|
var Switch = (props) => {
|
|
@@ -18365,9 +18390,9 @@ var Switch = (props) => {
|
|
|
18365
18390
|
color: color2 = "xplat-blue-500",
|
|
18366
18391
|
className
|
|
18367
18392
|
} = props;
|
|
18368
|
-
const [isAnimating, setIsAnimating] =
|
|
18369
|
-
const timeoutRef =
|
|
18370
|
-
|
|
18393
|
+
const [isAnimating, setIsAnimating] = React27.useState(false);
|
|
18394
|
+
const timeoutRef = React27.useRef(null);
|
|
18395
|
+
React27.useEffect(() => {
|
|
18371
18396
|
return () => {
|
|
18372
18397
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
18373
18398
|
};
|
|
@@ -18405,12 +18430,12 @@ Switch.displayName = "Switch";
|
|
|
18405
18430
|
var Switch_default = Switch;
|
|
18406
18431
|
|
|
18407
18432
|
// src/components/Tab/Tab.tsx
|
|
18408
|
-
import
|
|
18433
|
+
import React29 from "react";
|
|
18409
18434
|
|
|
18410
18435
|
// src/components/Tab/TabItem.tsx
|
|
18411
|
-
import
|
|
18436
|
+
import React28 from "react";
|
|
18412
18437
|
import { jsx as jsx336 } from "react/jsx-runtime";
|
|
18413
|
-
var TabItem =
|
|
18438
|
+
var TabItem = React28.forwardRef((props, ref) => {
|
|
18414
18439
|
const { isActive, title, onClick } = props;
|
|
18415
18440
|
return /* @__PURE__ */ jsx336(
|
|
18416
18441
|
"div",
|
|
@@ -18429,15 +18454,15 @@ var TabItem_default = TabItem;
|
|
|
18429
18454
|
import { jsx as jsx337, jsxs as jsxs216 } from "react/jsx-runtime";
|
|
18430
18455
|
var Tab = (props) => {
|
|
18431
18456
|
const { activeIndex, onChange, tabs, type, size = "md" } = props;
|
|
18432
|
-
const [underlineStyle, setUnderlineStyle] =
|
|
18457
|
+
const [underlineStyle, setUnderlineStyle] = React29.useState({
|
|
18433
18458
|
left: 0,
|
|
18434
18459
|
width: 0
|
|
18435
18460
|
});
|
|
18436
|
-
const itemRefs =
|
|
18461
|
+
const itemRefs = React29.useRef([]);
|
|
18437
18462
|
const handleChangeActiveTab = (tabItem, tabIdx) => {
|
|
18438
18463
|
onChange(tabItem, tabIdx);
|
|
18439
18464
|
};
|
|
18440
|
-
|
|
18465
|
+
React29.useEffect(() => {
|
|
18441
18466
|
const el = itemRefs.current[activeIndex];
|
|
18442
18467
|
if (el) {
|
|
18443
18468
|
setUnderlineStyle({ left: el.offsetLeft, width: el.offsetWidth });
|
|
@@ -18472,10 +18497,10 @@ Tab.displayName = "Tab";
|
|
|
18472
18497
|
var Tab_default = Tab;
|
|
18473
18498
|
|
|
18474
18499
|
// src/components/Table/TableContext.tsx
|
|
18475
|
-
import
|
|
18476
|
-
var TableContext =
|
|
18500
|
+
import React30 from "react";
|
|
18501
|
+
var TableContext = React30.createContext(null);
|
|
18477
18502
|
var useTableContext = () => {
|
|
18478
|
-
const ctx =
|
|
18503
|
+
const ctx = React30.useContext(TableContext);
|
|
18479
18504
|
if (!ctx) throw new Error("Table components must be used inside <Table>");
|
|
18480
18505
|
return ctx;
|
|
18481
18506
|
};
|
|
@@ -18518,24 +18543,24 @@ TableBody.displayName = "TableBody";
|
|
|
18518
18543
|
var TableBody_default = TableBody;
|
|
18519
18544
|
|
|
18520
18545
|
// src/components/Table/TableCell.tsx
|
|
18521
|
-
import
|
|
18546
|
+
import React33 from "react";
|
|
18522
18547
|
|
|
18523
18548
|
// src/components/Table/TableHeadContext.tsx
|
|
18524
|
-
import
|
|
18525
|
-
var TableHeadContext =
|
|
18549
|
+
import React31 from "react";
|
|
18550
|
+
var TableHeadContext = React31.createContext(
|
|
18526
18551
|
null
|
|
18527
18552
|
);
|
|
18528
18553
|
var useTableHeadContext = () => {
|
|
18529
|
-
const ctx =
|
|
18554
|
+
const ctx = React31.useContext(TableHeadContext);
|
|
18530
18555
|
return ctx;
|
|
18531
18556
|
};
|
|
18532
18557
|
var TableHeadContext_default = TableHeadContext;
|
|
18533
18558
|
|
|
18534
18559
|
// src/components/Table/TableRowContext.tsx
|
|
18535
|
-
import
|
|
18536
|
-
var TableRowContext =
|
|
18560
|
+
import React32 from "react";
|
|
18561
|
+
var TableRowContext = React32.createContext(null);
|
|
18537
18562
|
var useTableRowContext = () => {
|
|
18538
|
-
const ctx =
|
|
18563
|
+
const ctx = React32.useContext(TableRowContext);
|
|
18539
18564
|
if (!ctx) throw new Error("Table components must be used inside <Table>");
|
|
18540
18565
|
return ctx;
|
|
18541
18566
|
};
|
|
@@ -18554,9 +18579,9 @@ var TableCell = (props) => {
|
|
|
18554
18579
|
const { registerStickyCell, stickyCells } = useTableRowContext();
|
|
18555
18580
|
const { stickyShadow } = useTableContext();
|
|
18556
18581
|
const headContext = useTableHeadContext();
|
|
18557
|
-
const [left, setLeft] =
|
|
18558
|
-
const cellRef =
|
|
18559
|
-
const calculateLeft =
|
|
18582
|
+
const [left, setLeft] = React33.useState(0);
|
|
18583
|
+
const cellRef = React33.useRef(null);
|
|
18584
|
+
const calculateLeft = React33.useCallback(() => {
|
|
18560
18585
|
if (!cellRef.current) return 0;
|
|
18561
18586
|
let totalLeft = 0;
|
|
18562
18587
|
for (const ref of stickyCells) {
|
|
@@ -18565,7 +18590,7 @@ var TableCell = (props) => {
|
|
|
18565
18590
|
}
|
|
18566
18591
|
return totalLeft;
|
|
18567
18592
|
}, [stickyCells]);
|
|
18568
|
-
|
|
18593
|
+
React33.useEffect(() => {
|
|
18569
18594
|
if (!isSticky || !cellRef.current) return;
|
|
18570
18595
|
registerStickyCell(cellRef);
|
|
18571
18596
|
setLeft(calculateLeft());
|
|
@@ -18618,7 +18643,7 @@ TableHead.displayName = "TableHead";
|
|
|
18618
18643
|
var TableHead_default = TableHead;
|
|
18619
18644
|
|
|
18620
18645
|
// src/components/Table/TableRow.tsx
|
|
18621
|
-
import
|
|
18646
|
+
import React34 from "react";
|
|
18622
18647
|
import { jsx as jsx342 } from "react/jsx-runtime";
|
|
18623
18648
|
var TableRow = (props) => {
|
|
18624
18649
|
const {
|
|
@@ -18630,7 +18655,7 @@ var TableRow = (props) => {
|
|
|
18630
18655
|
onClick
|
|
18631
18656
|
} = props;
|
|
18632
18657
|
const { rowBorderUse } = useTableContext();
|
|
18633
|
-
const [stickyCells, setStickyCells] =
|
|
18658
|
+
const [stickyCells, setStickyCells] = React34.useState([]);
|
|
18634
18659
|
const registerStickyCell = (ref) => {
|
|
18635
18660
|
setStickyCells((prev) => {
|
|
18636
18661
|
if (prev.includes(ref)) return prev;
|
|
@@ -18677,12 +18702,12 @@ Tag.displayName = "Tag";
|
|
|
18677
18702
|
var Tag_default = Tag;
|
|
18678
18703
|
|
|
18679
18704
|
// src/components/TextArea/TextArea.tsx
|
|
18680
|
-
import
|
|
18705
|
+
import React35 from "react";
|
|
18681
18706
|
import { jsx as jsx344 } from "react/jsx-runtime";
|
|
18682
|
-
var TextArea =
|
|
18707
|
+
var TextArea = React35.forwardRef(
|
|
18683
18708
|
(props, ref) => {
|
|
18684
18709
|
const { value, onChange, className, disabled, ...textareaProps } = props;
|
|
18685
|
-
const localRef =
|
|
18710
|
+
const localRef = React35.useRef(null);
|
|
18686
18711
|
const setRefs = (el) => {
|
|
18687
18712
|
localRef.current = el;
|
|
18688
18713
|
if (!ref) return;
|
|
@@ -18702,7 +18727,7 @@ var TextArea = React34.forwardRef(
|
|
|
18702
18727
|
onChange(event);
|
|
18703
18728
|
}
|
|
18704
18729
|
};
|
|
18705
|
-
|
|
18730
|
+
React35.useEffect(() => {
|
|
18706
18731
|
const el = localRef.current;
|
|
18707
18732
|
if (!el) return;
|
|
18708
18733
|
el.style.height = "0px";
|
|
@@ -18734,20 +18759,20 @@ TextArea.displayName = "TextArea";
|
|
|
18734
18759
|
var TextArea_default = TextArea;
|
|
18735
18760
|
|
|
18736
18761
|
// src/components/Toast/Toast.tsx
|
|
18737
|
-
import
|
|
18762
|
+
import React36 from "react";
|
|
18738
18763
|
import { createPortal as createPortal3 } from "react-dom";
|
|
18739
18764
|
import { jsx as jsx345, jsxs as jsxs218 } from "react/jsx-runtime";
|
|
18740
|
-
var ToastContext =
|
|
18765
|
+
var ToastContext = React36.createContext(null);
|
|
18741
18766
|
var useToast = () => {
|
|
18742
|
-
const ctx =
|
|
18767
|
+
const ctx = React36.useContext(ToastContext);
|
|
18743
18768
|
if (!ctx) throw new Error("useToast must be used within ToastProvider");
|
|
18744
18769
|
return ctx;
|
|
18745
18770
|
};
|
|
18746
18771
|
var EXIT_DURATION = 300;
|
|
18747
18772
|
var ToastItemComponent = ({ item, isExiting, onClose }) => {
|
|
18748
|
-
const ref =
|
|
18749
|
-
const [height, setHeight] =
|
|
18750
|
-
|
|
18773
|
+
const ref = React36.useRef(null);
|
|
18774
|
+
const [height, setHeight] = React36.useState(void 0);
|
|
18775
|
+
React36.useEffect(() => {
|
|
18751
18776
|
if (ref.current && !isExiting) {
|
|
18752
18777
|
setHeight(ref.current.offsetHeight);
|
|
18753
18778
|
}
|
|
@@ -18779,13 +18804,13 @@ var ToastProvider = ({
|
|
|
18779
18804
|
children,
|
|
18780
18805
|
position = "top-right"
|
|
18781
18806
|
}) => {
|
|
18782
|
-
const [toasts, setToasts] =
|
|
18783
|
-
const [removing, setRemoving] =
|
|
18784
|
-
const [mounted, setMounted] =
|
|
18785
|
-
|
|
18807
|
+
const [toasts, setToasts] = React36.useState([]);
|
|
18808
|
+
const [removing, setRemoving] = React36.useState(/* @__PURE__ */ new Set());
|
|
18809
|
+
const [mounted, setMounted] = React36.useState(false);
|
|
18810
|
+
React36.useEffect(() => {
|
|
18786
18811
|
setMounted(true);
|
|
18787
18812
|
}, []);
|
|
18788
|
-
const remove =
|
|
18813
|
+
const remove = React36.useCallback((id) => {
|
|
18789
18814
|
setRemoving((prev) => new Set(prev).add(id));
|
|
18790
18815
|
setTimeout(() => {
|
|
18791
18816
|
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
@@ -18796,7 +18821,7 @@ var ToastProvider = ({
|
|
|
18796
18821
|
});
|
|
18797
18822
|
}, EXIT_DURATION);
|
|
18798
18823
|
}, []);
|
|
18799
|
-
const toast =
|
|
18824
|
+
const toast = React36.useCallback(
|
|
18800
18825
|
(type, message, duration = 3e3) => {
|
|
18801
18826
|
const id = `${Date.now()}-${Math.random()}`;
|
|
18802
18827
|
setToasts((prev) => [...prev, { id, type, message }]);
|
|
@@ -18825,7 +18850,7 @@ var ToastProvider = ({
|
|
|
18825
18850
|
ToastProvider.displayName = "ToastProvider";
|
|
18826
18851
|
|
|
18827
18852
|
// src/components/Tooltip/Tooltip.tsx
|
|
18828
|
-
import
|
|
18853
|
+
import React37 from "react";
|
|
18829
18854
|
import { jsx as jsx346, jsxs as jsxs219 } from "react/jsx-runtime";
|
|
18830
18855
|
var Tooltip2 = (props) => {
|
|
18831
18856
|
const {
|
|
@@ -18834,7 +18859,7 @@ var Tooltip2 = (props) => {
|
|
|
18834
18859
|
description,
|
|
18835
18860
|
children
|
|
18836
18861
|
} = props;
|
|
18837
|
-
const iconRef =
|
|
18862
|
+
const iconRef = React37.useRef(null);
|
|
18838
18863
|
const colorClass = color2;
|
|
18839
18864
|
return /* @__PURE__ */ jsxs219("div", { className: "lib-xplat-tooltip", children: [
|
|
18840
18865
|
/* @__PURE__ */ jsx346("div", { className: "tooltip-content", ref: iconRef, children: children || "Tooltip" }),
|
|
@@ -18845,9 +18870,9 @@ Tooltip2.displayName = "Tooltip";
|
|
|
18845
18870
|
var Tooltip_default = Tooltip2;
|
|
18846
18871
|
|
|
18847
18872
|
// src/components/Video/Video.tsx
|
|
18848
|
-
import
|
|
18873
|
+
import React38 from "react";
|
|
18849
18874
|
import { jsx as jsx347, jsxs as jsxs220 } from "react/jsx-runtime";
|
|
18850
|
-
var Video =
|
|
18875
|
+
var Video = React38.forwardRef((props, ref) => {
|
|
18851
18876
|
const {
|
|
18852
18877
|
src,
|
|
18853
18878
|
poster,
|
|
@@ -18861,10 +18886,10 @@ var Video = React37.forwardRef((props, ref) => {
|
|
|
18861
18886
|
onPause,
|
|
18862
18887
|
...rest
|
|
18863
18888
|
} = props;
|
|
18864
|
-
const videoRef =
|
|
18865
|
-
const [isPlaying, setIsPlaying] =
|
|
18866
|
-
const [isLoaded, setIsLoaded] =
|
|
18867
|
-
const setRefs =
|
|
18889
|
+
const videoRef = React38.useRef(null);
|
|
18890
|
+
const [isPlaying, setIsPlaying] = React38.useState(Boolean(autoPlay));
|
|
18891
|
+
const [isLoaded, setIsLoaded] = React38.useState(false);
|
|
18892
|
+
const setRefs = React38.useCallback(
|
|
18868
18893
|
(el) => {
|
|
18869
18894
|
videoRef.current = el;
|
|
18870
18895
|
if (typeof ref === "function") ref(el);
|