@x-plat/design-system 0.5.64 → 0.5.65
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/AutoResizeTextArea/index.cjs +118 -0
- package/dist/components/AutoResizeTextArea/index.css +46 -0
- package/dist/components/AutoResizeTextArea/index.d.cts +10 -0
- package/dist/components/AutoResizeTextArea/index.d.ts +10 -0
- package/dist/components/AutoResizeTextArea/index.js +81 -0
- package/dist/components/ChatInput/index.cjs +72 -30
- package/dist/components/ChatInput/index.css +47 -0
- package/dist/components/ChatInput/index.js +71 -29
- package/dist/components/TextArea/index.cjs +16 -44
- package/dist/components/TextArea/index.css +26 -28
- package/dist/components/TextArea/index.d.cts +8 -1
- package/dist/components/TextArea/index.d.ts +8 -1
- package/dist/components/TextArea/index.js +16 -44
- package/dist/components/index.cjs +561 -545
- package/dist/components/index.css +73 -28
- package/dist/components/index.d.cts +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +508 -493
- package/dist/index.cjs +585 -569
- package/dist/index.css +73 -28
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +530 -515
- package/package.json +1 -1
package/dist/components/index.js
CHANGED
|
@@ -2692,11 +2692,72 @@ var Chart = React5.memo((props) => {
|
|
|
2692
2692
|
Chart.displayName = "Chart";
|
|
2693
2693
|
var Chart_default = Chart;
|
|
2694
2694
|
|
|
2695
|
-
// src/components/
|
|
2695
|
+
// src/components/AutoResizeTextArea/AutoResizeTextArea.tsx
|
|
2696
2696
|
import React6 from "react";
|
|
2697
|
+
import { jsx as jsx306 } from "react/jsx-runtime";
|
|
2698
|
+
var MAX_HEIGHT = 400;
|
|
2699
|
+
var AutoResizeTextArea = React6.forwardRef(
|
|
2700
|
+
(props, ref) => {
|
|
2701
|
+
const { value, className, onChange, disabled, bare = false, ...textareaProps } = props;
|
|
2702
|
+
const localRef = React6.useRef(null);
|
|
2703
|
+
const setRefs = (el) => {
|
|
2704
|
+
localRef.current = el;
|
|
2705
|
+
if (!ref) return;
|
|
2706
|
+
if (typeof ref === "function") ref(el);
|
|
2707
|
+
else if (ref && "current" in ref)
|
|
2708
|
+
ref.current = el;
|
|
2709
|
+
};
|
|
2710
|
+
const updateHeight = () => {
|
|
2711
|
+
const el = localRef.current;
|
|
2712
|
+
if (!el) return;
|
|
2713
|
+
el.style.height = "0px";
|
|
2714
|
+
el.style.height = `${Math.min(el.scrollHeight, MAX_HEIGHT)}px`;
|
|
2715
|
+
};
|
|
2716
|
+
const handleChange = (e) => {
|
|
2717
|
+
if (onChange) {
|
|
2718
|
+
const event = {
|
|
2719
|
+
...e,
|
|
2720
|
+
target: { value: e.target.value }
|
|
2721
|
+
};
|
|
2722
|
+
onChange(event);
|
|
2723
|
+
}
|
|
2724
|
+
};
|
|
2725
|
+
React6.useEffect(() => {
|
|
2726
|
+
updateHeight();
|
|
2727
|
+
}, [value]);
|
|
2728
|
+
if (bare) {
|
|
2729
|
+
return /* @__PURE__ */ jsx306(
|
|
2730
|
+
"textarea",
|
|
2731
|
+
{
|
|
2732
|
+
...textareaProps,
|
|
2733
|
+
ref: setRefs,
|
|
2734
|
+
className,
|
|
2735
|
+
disabled,
|
|
2736
|
+
value,
|
|
2737
|
+
onChange: handleChange
|
|
2738
|
+
}
|
|
2739
|
+
);
|
|
2740
|
+
}
|
|
2741
|
+
return /* @__PURE__ */ jsx306("div", { className: clsx_default("lib-xplat-auto-resize-textarea-wrapper", className), children: /* @__PURE__ */ jsx306("div", { className: clsx_default("lib-xplat-auto-resize-textarea", disabled && "disabled"), children: /* @__PURE__ */ jsx306(
|
|
2742
|
+
"textarea",
|
|
2743
|
+
{
|
|
2744
|
+
...textareaProps,
|
|
2745
|
+
ref: setRefs,
|
|
2746
|
+
disabled,
|
|
2747
|
+
value,
|
|
2748
|
+
onChange: handleChange
|
|
2749
|
+
}
|
|
2750
|
+
) }) });
|
|
2751
|
+
}
|
|
2752
|
+
);
|
|
2753
|
+
AutoResizeTextArea.displayName = "AutoResizeTextArea";
|
|
2754
|
+
var AutoResizeTextArea_default = AutoResizeTextArea;
|
|
2755
|
+
|
|
2756
|
+
// src/components/ChatInput/ChatInput.tsx
|
|
2757
|
+
import React7 from "react";
|
|
2697
2758
|
|
|
2698
2759
|
// src/components/IconButton/IconButton.tsx
|
|
2699
|
-
import { jsx as
|
|
2760
|
+
import { jsx as jsx307 } from "react/jsx-runtime";
|
|
2700
2761
|
var IconButton = (props) => {
|
|
2701
2762
|
const {
|
|
2702
2763
|
icon,
|
|
@@ -2706,7 +2767,7 @@ var IconButton = (props) => {
|
|
|
2706
2767
|
disabled,
|
|
2707
2768
|
...rest
|
|
2708
2769
|
} = props;
|
|
2709
|
-
return /* @__PURE__ */
|
|
2770
|
+
return /* @__PURE__ */ jsx307(
|
|
2710
2771
|
"button",
|
|
2711
2772
|
{
|
|
2712
2773
|
className: clsx_default("lib-xplat-icon-button", type, size, className),
|
|
@@ -2720,9 +2781,8 @@ IconButton.displayName = "IconButton";
|
|
|
2720
2781
|
var IconButton_default = IconButton;
|
|
2721
2782
|
|
|
2722
2783
|
// src/components/ChatInput/ChatInput.tsx
|
|
2723
|
-
import { jsx as
|
|
2724
|
-
var
|
|
2725
|
-
var ChatInput = React6.forwardRef(
|
|
2784
|
+
import { jsx as jsx308, jsxs as jsxs197 } from "react/jsx-runtime";
|
|
2785
|
+
var ChatInput = React7.forwardRef(
|
|
2726
2786
|
(props, ref) => {
|
|
2727
2787
|
const {
|
|
2728
2788
|
placeholder,
|
|
@@ -2733,24 +2793,9 @@ var ChatInput = React6.forwardRef(
|
|
|
2733
2793
|
onChange
|
|
2734
2794
|
} = props;
|
|
2735
2795
|
const isControlled = valueProp !== void 0;
|
|
2736
|
-
const [internalValue, setInternalValue] =
|
|
2796
|
+
const [internalValue, setInternalValue] = React7.useState("");
|
|
2737
2797
|
const value = isControlled ? valueProp : internalValue;
|
|
2738
2798
|
const hasText = value.trim().length > 0;
|
|
2739
|
-
const textareaRef = React6.useRef(null);
|
|
2740
|
-
const setRefs = React6.useCallback(
|
|
2741
|
-
(el) => {
|
|
2742
|
-
textareaRef.current = el;
|
|
2743
|
-
if (typeof ref === "function") ref(el);
|
|
2744
|
-
else if (ref) ref.current = el;
|
|
2745
|
-
},
|
|
2746
|
-
[ref]
|
|
2747
|
-
);
|
|
2748
|
-
const updateHeight = React6.useCallback(() => {
|
|
2749
|
-
const el = textareaRef.current;
|
|
2750
|
-
if (!el) return;
|
|
2751
|
-
el.style.height = "0px";
|
|
2752
|
-
el.style.height = `${Math.min(el.scrollHeight, MAX_HEIGHT)}px`;
|
|
2753
|
-
}, []);
|
|
2754
2799
|
const handleChange = (e) => {
|
|
2755
2800
|
const val = e.target.value;
|
|
2756
2801
|
if (!isControlled) setInternalValue(val);
|
|
@@ -2760,7 +2805,6 @@ var ChatInput = React6.forwardRef(
|
|
|
2760
2805
|
if (!hasText || disabled) return;
|
|
2761
2806
|
onSubmit?.(value);
|
|
2762
2807
|
if (!isControlled) setInternalValue("");
|
|
2763
|
-
requestAnimationFrame(updateHeight);
|
|
2764
2808
|
};
|
|
2765
2809
|
const handleKeyDown = (e) => {
|
|
2766
2810
|
if (e.key === "Enter" && !e.shiftKey) {
|
|
@@ -2768,14 +2812,12 @@ var ChatInput = React6.forwardRef(
|
|
|
2768
2812
|
handleSubmit();
|
|
2769
2813
|
}
|
|
2770
2814
|
};
|
|
2771
|
-
React6.useEffect(() => {
|
|
2772
|
-
updateHeight();
|
|
2773
|
-
}, [value, updateHeight]);
|
|
2774
2815
|
return /* @__PURE__ */ jsxs197("div", { className: clsx_default("lib-xplat-chat-input", disabled && "disabled"), children: [
|
|
2775
|
-
/* @__PURE__ */
|
|
2776
|
-
|
|
2816
|
+
/* @__PURE__ */ jsx308(
|
|
2817
|
+
AutoResizeTextArea_default,
|
|
2777
2818
|
{
|
|
2778
|
-
ref
|
|
2819
|
+
ref,
|
|
2820
|
+
bare: true,
|
|
2779
2821
|
className: "chat-input-textarea",
|
|
2780
2822
|
placeholder,
|
|
2781
2823
|
value,
|
|
@@ -2785,10 +2827,10 @@ var ChatInput = React6.forwardRef(
|
|
|
2785
2827
|
onKeyDown: handleKeyDown
|
|
2786
2828
|
}
|
|
2787
2829
|
),
|
|
2788
|
-
/* @__PURE__ */
|
|
2830
|
+
/* @__PURE__ */ jsx308(
|
|
2789
2831
|
IconButton_default,
|
|
2790
2832
|
{
|
|
2791
|
-
icon: /* @__PURE__ */
|
|
2833
|
+
icon: /* @__PURE__ */ jsx308(MessageSquareIcon_default, {}),
|
|
2792
2834
|
type: buttonType,
|
|
2793
2835
|
size: "sm",
|
|
2794
2836
|
disabled: !hasText || disabled,
|
|
@@ -2809,7 +2851,7 @@ import { primitive, semantic } from "@x-plat/tokens-core";
|
|
|
2809
2851
|
import { cssVar } from "@x-plat/tokens-core";
|
|
2810
2852
|
|
|
2811
2853
|
// src/components/CheckBox/CheckBox.tsx
|
|
2812
|
-
import { jsx as
|
|
2854
|
+
import { jsx as jsx309, jsxs as jsxs198 } from "react/jsx-runtime";
|
|
2813
2855
|
var CheckBox = (props) => {
|
|
2814
2856
|
const {
|
|
2815
2857
|
checked,
|
|
@@ -2829,7 +2871,7 @@ var CheckBox = (props) => {
|
|
|
2829
2871
|
const disabledClasses = "disabled";
|
|
2830
2872
|
const boxClasses = disabled ? disabledClasses : checked ? checkedClasses : uncheckedClasses;
|
|
2831
2873
|
return /* @__PURE__ */ jsxs198("label", { className: clsx_default("lib-xplat-checkbox", size, type, className), children: [
|
|
2832
|
-
/* @__PURE__ */
|
|
2874
|
+
/* @__PURE__ */ jsx309(
|
|
2833
2875
|
"input",
|
|
2834
2876
|
{
|
|
2835
2877
|
type: "checkbox",
|
|
@@ -2839,44 +2881,44 @@ var CheckBox = (props) => {
|
|
|
2839
2881
|
...rest
|
|
2840
2882
|
}
|
|
2841
2883
|
),
|
|
2842
|
-
/* @__PURE__ */
|
|
2843
|
-
label && /* @__PURE__ */
|
|
2884
|
+
/* @__PURE__ */ jsx309("span", { className: clsx_default("checkbox", boxClasses), children: /* @__PURE__ */ jsx309("span", { className: clsx_default("check-icon", { visible: checked }), children: /* @__PURE__ */ jsx309(CheckIcon_default, {}) }) }),
|
|
2885
|
+
label && /* @__PURE__ */ jsx309("span", { className: "label", children: label })
|
|
2844
2886
|
] });
|
|
2845
2887
|
};
|
|
2846
2888
|
CheckBox.displayName = "CheckBox";
|
|
2847
2889
|
var CheckBox_default = CheckBox;
|
|
2848
2890
|
|
|
2849
2891
|
// src/components/Chip/Chip.tsx
|
|
2850
|
-
import { jsx as
|
|
2892
|
+
import { jsx as jsx310 } from "react/jsx-runtime";
|
|
2851
2893
|
var Chip = (props) => {
|
|
2852
2894
|
const {
|
|
2853
2895
|
children,
|
|
2854
2896
|
type = "primary",
|
|
2855
2897
|
size = "md"
|
|
2856
2898
|
} = props;
|
|
2857
|
-
return /* @__PURE__ */
|
|
2899
|
+
return /* @__PURE__ */ jsx310("div", { className: clsx_default("lib-xplat-chip", type, size), children });
|
|
2858
2900
|
};
|
|
2859
2901
|
Chip.displayName = "Chip";
|
|
2860
2902
|
var Chip_default = Chip;
|
|
2861
2903
|
|
|
2862
2904
|
// src/components/DatePicker/InputDatePicker/index.tsx
|
|
2863
|
-
import
|
|
2905
|
+
import React13 from "react";
|
|
2864
2906
|
|
|
2865
2907
|
// src/components/Input/Input.tsx
|
|
2866
|
-
import
|
|
2908
|
+
import React8 from "react";
|
|
2867
2909
|
|
|
2868
2910
|
// src/components/Input/InputValidations.tsx
|
|
2869
|
-
import { jsx as
|
|
2911
|
+
import { jsx as jsx311, jsxs as jsxs199 } from "react/jsx-runtime";
|
|
2870
2912
|
var InputValidations = (props) => {
|
|
2871
2913
|
const { message, status = "default" } = props;
|
|
2872
2914
|
return /* @__PURE__ */ jsxs199("div", { className: clsx_default("lib-xplat-input-validation", status), children: [
|
|
2873
2915
|
/* @__PURE__ */ jsxs199("div", { className: "icon", children: [
|
|
2874
|
-
status === "default" && /* @__PURE__ */
|
|
2875
|
-
status === "success" && /* @__PURE__ */
|
|
2876
|
-
status === "warning" && /* @__PURE__ */
|
|
2877
|
-
status === "error" && /* @__PURE__ */
|
|
2916
|
+
status === "default" && /* @__PURE__ */ jsx311(InfoIcon_default, {}),
|
|
2917
|
+
status === "success" && /* @__PURE__ */ jsx311(SuccessIcon_default, {}),
|
|
2918
|
+
status === "warning" && /* @__PURE__ */ jsx311(InfoIcon_default, {}),
|
|
2919
|
+
status === "error" && /* @__PURE__ */ jsx311(ErrorIcon_default, {})
|
|
2878
2920
|
] }),
|
|
2879
|
-
/* @__PURE__ */
|
|
2921
|
+
/* @__PURE__ */ jsx311("div", { className: "message", children: message })
|
|
2880
2922
|
] });
|
|
2881
2923
|
};
|
|
2882
2924
|
InputValidations.displayName = "InputValidations";
|
|
@@ -2917,7 +2959,7 @@ var handleTelBackspace = (prevValue, currValue) => {
|
|
|
2917
2959
|
};
|
|
2918
2960
|
|
|
2919
2961
|
// src/components/Input/Input.tsx
|
|
2920
|
-
import { jsx as
|
|
2962
|
+
import { jsx as jsx312, jsxs as jsxs200 } from "react/jsx-runtime";
|
|
2921
2963
|
import { createElement } from "react";
|
|
2922
2964
|
var formatValue = (type, value) => {
|
|
2923
2965
|
if (value === null || value === void 0) return "";
|
|
@@ -2966,7 +3008,7 @@ var parseValue = (type, value) => {
|
|
|
2966
3008
|
return value;
|
|
2967
3009
|
}
|
|
2968
3010
|
};
|
|
2969
|
-
var Input =
|
|
3011
|
+
var Input = React8.forwardRef((props, ref) => {
|
|
2970
3012
|
const {
|
|
2971
3013
|
value,
|
|
2972
3014
|
className,
|
|
@@ -2999,7 +3041,7 @@ var Input = React7.forwardRef((props, ref) => {
|
|
|
2999
3041
|
{
|
|
3000
3042
|
className: clsx_default("lib-xplat-input", size, disabled ? "disabled" : void 0),
|
|
3001
3043
|
children: [
|
|
3002
|
-
/* @__PURE__ */
|
|
3044
|
+
/* @__PURE__ */ jsx312(
|
|
3003
3045
|
"input",
|
|
3004
3046
|
{
|
|
3005
3047
|
...inputProps,
|
|
@@ -3010,11 +3052,11 @@ var Input = React7.forwardRef((props, ref) => {
|
|
|
3010
3052
|
onChange: handleChange
|
|
3011
3053
|
}
|
|
3012
3054
|
),
|
|
3013
|
-
suffix && /* @__PURE__ */
|
|
3055
|
+
suffix && /* @__PURE__ */ jsx312("div", { className: "suffix", children: suffix })
|
|
3014
3056
|
]
|
|
3015
3057
|
}
|
|
3016
3058
|
),
|
|
3017
|
-
validations && /* @__PURE__ */
|
|
3059
|
+
validations && /* @__PURE__ */ jsx312("div", { className: "lib-xplat-input-validation-wrap", children: validations?.map((validation, idx) => /* @__PURE__ */ createElement(
|
|
3018
3060
|
InputValidations_default,
|
|
3019
3061
|
{
|
|
3020
3062
|
...validation,
|
|
@@ -3027,20 +3069,20 @@ Input.displayName = "Input";
|
|
|
3027
3069
|
var Input_default = Input;
|
|
3028
3070
|
|
|
3029
3071
|
// src/components/Input/PasswordInput/PasswordInput.tsx
|
|
3030
|
-
import
|
|
3031
|
-
import { jsx as
|
|
3032
|
-
var PasswordInput =
|
|
3072
|
+
import React9 from "react";
|
|
3073
|
+
import { jsx as jsx313 } from "react/jsx-runtime";
|
|
3074
|
+
var PasswordInput = React9.forwardRef(
|
|
3033
3075
|
(props, ref) => {
|
|
3034
3076
|
const { reg: _reg, ...inputProps } = props;
|
|
3035
|
-
const [isView, setIsView] =
|
|
3077
|
+
const [isView, setIsView] = React9.useState(false);
|
|
3036
3078
|
const handleChangeView = () => {
|
|
3037
3079
|
setIsView((prev) => !prev);
|
|
3038
3080
|
};
|
|
3039
|
-
return /* @__PURE__ */
|
|
3081
|
+
return /* @__PURE__ */ jsx313(
|
|
3040
3082
|
Input_default,
|
|
3041
3083
|
{
|
|
3042
3084
|
...inputProps,
|
|
3043
|
-
suffix: /* @__PURE__ */
|
|
3085
|
+
suffix: /* @__PURE__ */ jsx313("div", { className: "wrapper pointer", onClick: handleChangeView, children: isView ? /* @__PURE__ */ jsx313(OpenEyeIcon_default, {}) : /* @__PURE__ */ jsx313(CloseEyeIcon_default, {}) }),
|
|
3044
3086
|
type: isView ? "text" : "password",
|
|
3045
3087
|
ref
|
|
3046
3088
|
}
|
|
@@ -3051,17 +3093,17 @@ PasswordInput.displayName = "PasswordInput";
|
|
|
3051
3093
|
var PasswordInput_default = PasswordInput;
|
|
3052
3094
|
|
|
3053
3095
|
// src/components/Modal/Modal.tsx
|
|
3054
|
-
import
|
|
3096
|
+
import React11 from "react";
|
|
3055
3097
|
import { createPortal } from "react-dom";
|
|
3056
3098
|
|
|
3057
3099
|
// src/tokens/hooks/Portal.tsx
|
|
3058
|
-
import
|
|
3100
|
+
import React10 from "react";
|
|
3059
3101
|
import ReactDOM from "react-dom";
|
|
3060
|
-
import { jsx as
|
|
3061
|
-
var PortalContainerContext =
|
|
3062
|
-
var PortalProvider = ({ container, children }) => /* @__PURE__ */
|
|
3102
|
+
import { jsx as jsx314 } from "react/jsx-runtime";
|
|
3103
|
+
var PortalContainerContext = React10.createContext(null);
|
|
3104
|
+
var PortalProvider = ({ container, children }) => /* @__PURE__ */ jsx314(PortalContainerContext.Provider, { value: container, children });
|
|
3063
3105
|
var Portal = ({ children }) => {
|
|
3064
|
-
const contextContainer =
|
|
3106
|
+
const contextContainer = React10.useContext(PortalContainerContext);
|
|
3065
3107
|
if (typeof document === "undefined") return null;
|
|
3066
3108
|
const container = contextContainer ?? document.body;
|
|
3067
3109
|
return ReactDOM.createPortal(children, container);
|
|
@@ -3070,14 +3112,14 @@ Portal.displayName = "Portal";
|
|
|
3070
3112
|
var Portal_default = Portal;
|
|
3071
3113
|
|
|
3072
3114
|
// src/components/Modal/Modal.tsx
|
|
3073
|
-
import { jsx as
|
|
3115
|
+
import { jsx as jsx315 } from "react/jsx-runtime";
|
|
3074
3116
|
var ANIMATION_DURATION_MS = 200;
|
|
3075
3117
|
var Modal = (props) => {
|
|
3076
3118
|
const { isOpen, onClose, children } = props;
|
|
3077
|
-
const [mounted, setMounted] =
|
|
3078
|
-
const [visible, setVisible] =
|
|
3079
|
-
const boxRef =
|
|
3080
|
-
|
|
3119
|
+
const [mounted, setMounted] = React11.useState(false);
|
|
3120
|
+
const [visible, setVisible] = React11.useState(false);
|
|
3121
|
+
const boxRef = React11.useRef(null);
|
|
3122
|
+
React11.useEffect(() => {
|
|
3081
3123
|
if (isOpen) {
|
|
3082
3124
|
setMounted(true);
|
|
3083
3125
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -3091,12 +3133,12 @@ var Modal = (props) => {
|
|
|
3091
3133
|
if (!mounted) return null;
|
|
3092
3134
|
const stateClass = visible ? "enter" : "exit";
|
|
3093
3135
|
return createPortal(
|
|
3094
|
-
/* @__PURE__ */
|
|
3136
|
+
/* @__PURE__ */ jsx315(
|
|
3095
3137
|
"div",
|
|
3096
3138
|
{
|
|
3097
3139
|
className: clsx_default("lib-xplat-modal", "dim", stateClass),
|
|
3098
3140
|
onClick: onClose,
|
|
3099
|
-
children: /* @__PURE__ */
|
|
3141
|
+
children: /* @__PURE__ */ jsx315(
|
|
3100
3142
|
"div",
|
|
3101
3143
|
{
|
|
3102
3144
|
ref: boxRef,
|
|
@@ -3104,7 +3146,7 @@ var Modal = (props) => {
|
|
|
3104
3146
|
role: "dialog",
|
|
3105
3147
|
"aria-modal": "true",
|
|
3106
3148
|
onClick: (e) => e.stopPropagation(),
|
|
3107
|
-
children: /* @__PURE__ */
|
|
3149
|
+
children: /* @__PURE__ */ jsx315(PortalProvider, { container: boxRef.current, children })
|
|
3108
3150
|
}
|
|
3109
3151
|
)
|
|
3110
3152
|
}
|
|
@@ -3116,9 +3158,9 @@ Modal.displayName = "Modal";
|
|
|
3116
3158
|
var Modal_default = Modal;
|
|
3117
3159
|
|
|
3118
3160
|
// src/components/DatePicker/SingleDatePicker/index.tsx
|
|
3119
|
-
import
|
|
3120
|
-
import { Fragment as Fragment3, jsx as
|
|
3121
|
-
var DayCell2 =
|
|
3161
|
+
import React12 from "react";
|
|
3162
|
+
import { Fragment as Fragment3, jsx as jsx316, jsxs as jsxs201 } from "react/jsx-runtime";
|
|
3163
|
+
var DayCell2 = React12.memo(
|
|
3122
3164
|
({
|
|
3123
3165
|
day,
|
|
3124
3166
|
disabled,
|
|
@@ -3128,7 +3170,7 @@ var DayCell2 = React11.memo(
|
|
|
3128
3170
|
isEnd,
|
|
3129
3171
|
inRange,
|
|
3130
3172
|
onSelect
|
|
3131
|
-
}) => /* @__PURE__ */
|
|
3173
|
+
}) => /* @__PURE__ */ jsx316(
|
|
3132
3174
|
"button",
|
|
3133
3175
|
{
|
|
3134
3176
|
type: "button",
|
|
@@ -3170,26 +3212,26 @@ var SingleDatePicker = (props) => {
|
|
|
3170
3212
|
initialYear,
|
|
3171
3213
|
initialMonth
|
|
3172
3214
|
);
|
|
3173
|
-
const [pickerMode, setPickerMode] =
|
|
3174
|
-
const [yearRangeStart, setYearRangeStart] =
|
|
3215
|
+
const [pickerMode, setPickerMode] = React12.useState("days");
|
|
3216
|
+
const [yearRangeStart, setYearRangeStart] = React12.useState(
|
|
3175
3217
|
Math.floor((initialYear ?? (/* @__PURE__ */ new Date()).getFullYear()) / 12) * 12
|
|
3176
3218
|
);
|
|
3177
|
-
const minTime =
|
|
3219
|
+
const minTime = React12.useMemo(
|
|
3178
3220
|
() => minDate ? new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate()).getTime() : -Infinity,
|
|
3179
3221
|
[minDate]
|
|
3180
3222
|
);
|
|
3181
|
-
const maxTime =
|
|
3223
|
+
const maxTime = React12.useMemo(
|
|
3182
3224
|
() => maxDate ? new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate()).getTime() : Infinity,
|
|
3183
3225
|
[maxDate]
|
|
3184
3226
|
);
|
|
3185
|
-
const highlightSet =
|
|
3227
|
+
const highlightSet = React12.useMemo(() => {
|
|
3186
3228
|
const set = /* @__PURE__ */ new Set();
|
|
3187
3229
|
for (const h of highlightDates) {
|
|
3188
3230
|
set.add(`${h.getFullYear()}-${h.getMonth()}-${h.getDate()}`);
|
|
3189
3231
|
}
|
|
3190
3232
|
return set;
|
|
3191
3233
|
}, [highlightDates]);
|
|
3192
|
-
const handleSelect =
|
|
3234
|
+
const handleSelect = React12.useCallback(
|
|
3193
3235
|
(date) => {
|
|
3194
3236
|
onChange?.(date);
|
|
3195
3237
|
},
|
|
@@ -3232,14 +3274,14 @@ var SingleDatePicker = (props) => {
|
|
|
3232
3274
|
className: clsx_default("lib-xplat-datepicker", "single"),
|
|
3233
3275
|
children: [
|
|
3234
3276
|
/* @__PURE__ */ jsxs201("div", { className: "datepicker-header", children: [
|
|
3235
|
-
/* @__PURE__ */
|
|
3236
|
-
/* @__PURE__ */
|
|
3237
|
-
/* @__PURE__ */
|
|
3277
|
+
/* @__PURE__ */ jsx316("button", { className: "datepicker-nav", onClick: handlePrev, type: "button", children: /* @__PURE__ */ jsx316(ChevronLeftIcon_default, {}) }),
|
|
3278
|
+
/* @__PURE__ */ jsx316("button", { className: "datepicker-title", onClick: handleTitleClick, type: "button", children: titleText }),
|
|
3279
|
+
/* @__PURE__ */ jsx316("button", { className: "datepicker-nav", onClick: handleNext, type: "button", children: /* @__PURE__ */ jsx316(ChevronRightIcon_default, {}) })
|
|
3238
3280
|
] }),
|
|
3239
3281
|
/* @__PURE__ */ jsxs201("div", { className: "datepicker-body", children: [
|
|
3240
|
-
pickerMode === "years" && /* @__PURE__ */
|
|
3282
|
+
pickerMode === "years" && /* @__PURE__ */ jsx316("div", { className: "datepicker-picker-grid", children: Array.from({ length: 12 }, (_, i) => {
|
|
3241
3283
|
const y = yearRangeStart + i;
|
|
3242
|
-
return /* @__PURE__ */
|
|
3284
|
+
return /* @__PURE__ */ jsx316(
|
|
3243
3285
|
"button",
|
|
3244
3286
|
{
|
|
3245
3287
|
type: "button",
|
|
@@ -3250,7 +3292,7 @@ var SingleDatePicker = (props) => {
|
|
|
3250
3292
|
y
|
|
3251
3293
|
);
|
|
3252
3294
|
}) }),
|
|
3253
|
-
pickerMode === "months" && /* @__PURE__ */
|
|
3295
|
+
pickerMode === "months" && /* @__PURE__ */ jsx316("div", { className: "datepicker-picker-grid", children: monthLabels.map((label, i) => /* @__PURE__ */ jsx316(
|
|
3254
3296
|
"button",
|
|
3255
3297
|
{
|
|
3256
3298
|
type: "button",
|
|
@@ -3261,7 +3303,7 @@ var SingleDatePicker = (props) => {
|
|
|
3261
3303
|
i
|
|
3262
3304
|
)) }),
|
|
3263
3305
|
pickerMode === "days" && /* @__PURE__ */ jsxs201(Fragment3, { children: [
|
|
3264
|
-
/* @__PURE__ */
|
|
3306
|
+
/* @__PURE__ */ jsx316("div", { className: "datepicker-weekdays", children: weekdays.map((label, i) => /* @__PURE__ */ jsx316(
|
|
3265
3307
|
"div",
|
|
3266
3308
|
{
|
|
3267
3309
|
className: clsx_default(
|
|
@@ -3273,7 +3315,7 @@ var SingleDatePicker = (props) => {
|
|
|
3273
3315
|
},
|
|
3274
3316
|
label
|
|
3275
3317
|
)) }),
|
|
3276
|
-
/* @__PURE__ */
|
|
3318
|
+
/* @__PURE__ */ jsx316("div", { className: "datepicker-grid", children: days.map((day, idx) => {
|
|
3277
3319
|
const t = day.date.getTime();
|
|
3278
3320
|
const disabled = t < minTime || t > maxTime;
|
|
3279
3321
|
const selected = value ? isSameDay(day.date, value) : false;
|
|
@@ -3283,7 +3325,7 @@ var SingleDatePicker = (props) => {
|
|
|
3283
3325
|
const isStart = hasRange ? isSameDay(day.date, rangeStart) : false;
|
|
3284
3326
|
const isEnd = hasRange ? isSameDay(day.date, rangeEnd) : false;
|
|
3285
3327
|
const inRangeVal = hasRange ? isInRange(day.date, rangeStart, rangeEnd) : false;
|
|
3286
|
-
return /* @__PURE__ */
|
|
3328
|
+
return /* @__PURE__ */ jsx316(
|
|
3287
3329
|
DayCell2,
|
|
3288
3330
|
{
|
|
3289
3331
|
day,
|
|
@@ -3308,7 +3350,7 @@ SingleDatePicker.displayName = "SingleDatePicker";
|
|
|
3308
3350
|
var SingleDatePicker_default = SingleDatePicker;
|
|
3309
3351
|
|
|
3310
3352
|
// src/components/DatePicker/InputDatePicker/index.tsx
|
|
3311
|
-
import { jsx as
|
|
3353
|
+
import { jsx as jsx317, jsxs as jsxs202 } from "react/jsx-runtime";
|
|
3312
3354
|
var formatDate = (date) => {
|
|
3313
3355
|
if (!date || !(date instanceof Date) || isNaN(date.getTime())) return "";
|
|
3314
3356
|
const y = date.getFullYear();
|
|
@@ -3318,8 +3360,8 @@ var formatDate = (date) => {
|
|
|
3318
3360
|
};
|
|
3319
3361
|
var InputDatePicker = (props) => {
|
|
3320
3362
|
const { value, onChange, minDate, maxDate, disabled, locale = "ko", placeholder } = props;
|
|
3321
|
-
const [isOpen, setIsOpen] =
|
|
3322
|
-
const [tempDate, setTempDate] =
|
|
3363
|
+
const [isOpen, setIsOpen] = React13.useState(false);
|
|
3364
|
+
const [tempDate, setTempDate] = React13.useState(value ?? /* @__PURE__ */ new Date());
|
|
3323
3365
|
const handleOpen = () => {
|
|
3324
3366
|
if (disabled) return;
|
|
3325
3367
|
setTempDate(value ?? /* @__PURE__ */ new Date());
|
|
@@ -3336,18 +3378,18 @@ var InputDatePicker = (props) => {
|
|
|
3336
3378
|
setIsOpen(false);
|
|
3337
3379
|
};
|
|
3338
3380
|
return /* @__PURE__ */ jsxs202("div", { className: clsx_default("lib-xplat-datepicker input-datepicker", disabled && "disabled"), children: [
|
|
3339
|
-
/* @__PURE__ */
|
|
3381
|
+
/* @__PURE__ */ jsx317("div", { className: "input-datepicker-trigger", onClick: handleOpen, children: /* @__PURE__ */ jsx317(
|
|
3340
3382
|
Input_default,
|
|
3341
3383
|
{
|
|
3342
3384
|
value: formatDate(value),
|
|
3343
3385
|
placeholder,
|
|
3344
|
-
suffix: /* @__PURE__ */
|
|
3386
|
+
suffix: /* @__PURE__ */ jsx317(CalenderIcon_default, {}),
|
|
3345
3387
|
disabled,
|
|
3346
3388
|
readOnly: true
|
|
3347
3389
|
}
|
|
3348
3390
|
) }),
|
|
3349
|
-
/* @__PURE__ */
|
|
3350
|
-
/* @__PURE__ */
|
|
3391
|
+
/* @__PURE__ */ jsx317(Modal_default, { isOpen, onClose: handleClose, children: /* @__PURE__ */ jsxs202("div", { className: "lib-xplat-popup-datepicker-card", children: [
|
|
3392
|
+
/* @__PURE__ */ jsx317("div", { className: "popup-datepicker-content", children: /* @__PURE__ */ jsx317(
|
|
3351
3393
|
SingleDatePicker_default,
|
|
3352
3394
|
{
|
|
3353
3395
|
value: tempDate,
|
|
@@ -3358,8 +3400,8 @@ var InputDatePicker = (props) => {
|
|
|
3358
3400
|
}
|
|
3359
3401
|
) }),
|
|
3360
3402
|
/* @__PURE__ */ jsxs202("div", { className: "popup-datepicker-footer", children: [
|
|
3361
|
-
/* @__PURE__ */
|
|
3362
|
-
/* @__PURE__ */
|
|
3403
|
+
/* @__PURE__ */ jsx317(Button_default, { type: "secondary", onClick: handleClose, children: locale === "ko" ? "\uCDE8\uC18C" : "Cancel" }),
|
|
3404
|
+
/* @__PURE__ */ jsx317(Button_default, { type: "primary", onClick: handleApply, children: locale === "ko" ? "\uC801\uC6A9" : "Apply" })
|
|
3363
3405
|
] })
|
|
3364
3406
|
] }) })
|
|
3365
3407
|
] });
|
|
@@ -3368,20 +3410,20 @@ InputDatePicker.displayName = "InputDatePicker";
|
|
|
3368
3410
|
var InputDatePicker_default = InputDatePicker;
|
|
3369
3411
|
|
|
3370
3412
|
// src/components/DatePicker/PopupPicker/index.tsx
|
|
3371
|
-
import
|
|
3413
|
+
import React17 from "react";
|
|
3372
3414
|
|
|
3373
3415
|
// src/components/DatePicker/RangePicker/index.tsx
|
|
3374
|
-
import
|
|
3416
|
+
import React16 from "react";
|
|
3375
3417
|
|
|
3376
3418
|
// src/components/Tab/Tab.tsx
|
|
3377
|
-
import
|
|
3419
|
+
import React15 from "react";
|
|
3378
3420
|
|
|
3379
3421
|
// src/components/Tab/TabItem.tsx
|
|
3380
|
-
import
|
|
3381
|
-
import { jsx as
|
|
3382
|
-
var TabItem =
|
|
3422
|
+
import React14 from "react";
|
|
3423
|
+
import { jsx as jsx318 } from "react/jsx-runtime";
|
|
3424
|
+
var TabItem = React14.forwardRef((props, ref) => {
|
|
3383
3425
|
const { isActive: isActive2, title, onClick } = props;
|
|
3384
|
-
return /* @__PURE__ */
|
|
3426
|
+
return /* @__PURE__ */ jsx318(
|
|
3385
3427
|
"div",
|
|
3386
3428
|
{
|
|
3387
3429
|
ref,
|
|
@@ -3395,25 +3437,25 @@ TabItem.displayName = "TabItem";
|
|
|
3395
3437
|
var TabItem_default = TabItem;
|
|
3396
3438
|
|
|
3397
3439
|
// src/components/Tab/Tab.tsx
|
|
3398
|
-
import { jsx as
|
|
3440
|
+
import { jsx as jsx319, jsxs as jsxs203 } from "react/jsx-runtime";
|
|
3399
3441
|
var Tab = (props) => {
|
|
3400
3442
|
const { activeIndex, onChange, tabs, type, size = "md" } = props;
|
|
3401
|
-
const [underlineStyle, setUnderlineStyle] =
|
|
3443
|
+
const [underlineStyle, setUnderlineStyle] = React15.useState({
|
|
3402
3444
|
left: 0,
|
|
3403
3445
|
width: 0
|
|
3404
3446
|
});
|
|
3405
|
-
const itemRefs =
|
|
3447
|
+
const itemRefs = React15.useRef([]);
|
|
3406
3448
|
const handleChangeActiveTab = (tabItem, tabIdx) => {
|
|
3407
3449
|
onChange(tabItem, tabIdx);
|
|
3408
3450
|
};
|
|
3409
|
-
|
|
3451
|
+
React15.useEffect(() => {
|
|
3410
3452
|
const el = itemRefs.current[activeIndex];
|
|
3411
3453
|
if (el) {
|
|
3412
3454
|
setUnderlineStyle({ left: el.offsetLeft, width: el.offsetWidth });
|
|
3413
3455
|
}
|
|
3414
3456
|
}, [activeIndex, tabs.length]);
|
|
3415
3457
|
return /* @__PURE__ */ jsxs203("div", { className: clsx_default("lib-xplat-tab", `type-${type}`, size), children: [
|
|
3416
|
-
tabs.map((tab, idx) => /* @__PURE__ */
|
|
3458
|
+
tabs.map((tab, idx) => /* @__PURE__ */ jsx319(
|
|
3417
3459
|
TabItem_default,
|
|
3418
3460
|
{
|
|
3419
3461
|
onClick: () => handleChangeActiveTab(tab, idx),
|
|
@@ -3425,7 +3467,7 @@ var Tab = (props) => {
|
|
|
3425
3467
|
},
|
|
3426
3468
|
`${tab.value}_${idx}`
|
|
3427
3469
|
)),
|
|
3428
|
-
type === "toggle" && /* @__PURE__ */
|
|
3470
|
+
type === "toggle" && /* @__PURE__ */ jsx319(
|
|
3429
3471
|
"div",
|
|
3430
3472
|
{
|
|
3431
3473
|
className: "tab-toggle-underline",
|
|
@@ -3441,7 +3483,7 @@ Tab.displayName = "Tab";
|
|
|
3441
3483
|
var Tab_default = Tab;
|
|
3442
3484
|
|
|
3443
3485
|
// src/components/DatePicker/RangePicker/index.tsx
|
|
3444
|
-
import { jsx as
|
|
3486
|
+
import { jsx as jsx320, jsxs as jsxs204 } from "react/jsx-runtime";
|
|
3445
3487
|
var RangePicker = (props) => {
|
|
3446
3488
|
const {
|
|
3447
3489
|
startDate,
|
|
@@ -3451,7 +3493,7 @@ var RangePicker = (props) => {
|
|
|
3451
3493
|
maxDate,
|
|
3452
3494
|
locale = "ko"
|
|
3453
3495
|
} = props;
|
|
3454
|
-
const [activeTab, setActiveTab] =
|
|
3496
|
+
const [activeTab, setActiveTab] = React16.useState("start");
|
|
3455
3497
|
const handleStartChange = (date) => {
|
|
3456
3498
|
if (!date) return;
|
|
3457
3499
|
const newStart = date > endDate ? endDate : date;
|
|
@@ -3465,7 +3507,7 @@ var RangePicker = (props) => {
|
|
|
3465
3507
|
const startMaxDate = maxDate && endDate < maxDate ? endDate : endDate;
|
|
3466
3508
|
const endMinDate = minDate && startDate > minDate ? startDate : startDate;
|
|
3467
3509
|
return /* @__PURE__ */ jsxs204("div", { className: clsx_default("lib-xplat-datepicker", "range"), children: [
|
|
3468
|
-
/* @__PURE__ */
|
|
3510
|
+
/* @__PURE__ */ jsx320("div", { className: "datepicker-range-tabs", children: /* @__PURE__ */ jsx320(
|
|
3469
3511
|
Tab_default,
|
|
3470
3512
|
{
|
|
3471
3513
|
activeIndex: activeTab === "start" ? 0 : 1,
|
|
@@ -3479,7 +3521,7 @@ var RangePicker = (props) => {
|
|
|
3479
3521
|
}
|
|
3480
3522
|
) }),
|
|
3481
3523
|
/* @__PURE__ */ jsxs204("div", { className: "datepicker-range-panels", children: [
|
|
3482
|
-
/* @__PURE__ */
|
|
3524
|
+
/* @__PURE__ */ jsx320(
|
|
3483
3525
|
SingleDatePicker_default,
|
|
3484
3526
|
{
|
|
3485
3527
|
value: startDate,
|
|
@@ -3491,7 +3533,7 @@ var RangePicker = (props) => {
|
|
|
3491
3533
|
locale
|
|
3492
3534
|
}
|
|
3493
3535
|
),
|
|
3494
|
-
/* @__PURE__ */
|
|
3536
|
+
/* @__PURE__ */ jsx320(
|
|
3495
3537
|
SingleDatePicker_default,
|
|
3496
3538
|
{
|
|
3497
3539
|
value: endDate,
|
|
@@ -3504,7 +3546,7 @@ var RangePicker = (props) => {
|
|
|
3504
3546
|
}
|
|
3505
3547
|
)
|
|
3506
3548
|
] }),
|
|
3507
|
-
/* @__PURE__ */
|
|
3549
|
+
/* @__PURE__ */ jsx320("div", { className: "datepicker-range-mobile", children: activeTab === "start" ? /* @__PURE__ */ jsx320(
|
|
3508
3550
|
SingleDatePicker_default,
|
|
3509
3551
|
{
|
|
3510
3552
|
value: startDate,
|
|
@@ -3515,7 +3557,7 @@ var RangePicker = (props) => {
|
|
|
3515
3557
|
rangeEnd: endDate,
|
|
3516
3558
|
locale
|
|
3517
3559
|
}
|
|
3518
|
-
) : /* @__PURE__ */
|
|
3560
|
+
) : /* @__PURE__ */ jsx320(
|
|
3519
3561
|
SingleDatePicker_default,
|
|
3520
3562
|
{
|
|
3521
3563
|
value: endDate,
|
|
@@ -3533,10 +3575,10 @@ RangePicker.displayName = "RangePicker";
|
|
|
3533
3575
|
var RangePicker_default = RangePicker;
|
|
3534
3576
|
|
|
3535
3577
|
// src/components/DatePicker/PopupPicker/index.tsx
|
|
3536
|
-
import { jsx as
|
|
3578
|
+
import { jsx as jsx321, jsxs as jsxs205 } from "react/jsx-runtime";
|
|
3537
3579
|
var PopupPicker = (props) => {
|
|
3538
3580
|
const { component, type, locale } = props;
|
|
3539
|
-
const [isOpen, setIsOpen] =
|
|
3581
|
+
const [isOpen, setIsOpen] = React17.useState(false);
|
|
3540
3582
|
const handleClick = () => setIsOpen(true);
|
|
3541
3583
|
const handleClose = () => setIsOpen(false);
|
|
3542
3584
|
const handleSingleChange = (date) => {
|
|
@@ -3545,10 +3587,10 @@ var PopupPicker = (props) => {
|
|
|
3545
3587
|
handleClose();
|
|
3546
3588
|
};
|
|
3547
3589
|
return /* @__PURE__ */ jsxs205("div", { className: "lib-xplat-popup-datepicker", children: [
|
|
3548
|
-
|
|
3549
|
-
/* @__PURE__ */
|
|
3590
|
+
React17.cloneElement(component, { onClick: handleClick }),
|
|
3591
|
+
/* @__PURE__ */ jsx321(Modal_default, { isOpen, onClose: handleClose, children: /* @__PURE__ */ jsxs205("div", { className: clsx_default("lib-xplat-popup-datepicker-card", type === "range" && "range-mode"), children: [
|
|
3550
3592
|
/* @__PURE__ */ jsxs205("div", { className: "popup-datepicker-content", children: [
|
|
3551
|
-
type === "single" && /* @__PURE__ */
|
|
3593
|
+
type === "single" && /* @__PURE__ */ jsx321(
|
|
3552
3594
|
SingleDatePicker_default,
|
|
3553
3595
|
{
|
|
3554
3596
|
value: props.value,
|
|
@@ -3558,7 +3600,7 @@ var PopupPicker = (props) => {
|
|
|
3558
3600
|
locale
|
|
3559
3601
|
}
|
|
3560
3602
|
),
|
|
3561
|
-
type === "range" && /* @__PURE__ */
|
|
3603
|
+
type === "range" && /* @__PURE__ */ jsx321(
|
|
3562
3604
|
RangePicker_default,
|
|
3563
3605
|
{
|
|
3564
3606
|
startDate: props.startDate,
|
|
@@ -3571,7 +3613,7 @@ var PopupPicker = (props) => {
|
|
|
3571
3613
|
)
|
|
3572
3614
|
] }),
|
|
3573
3615
|
/* @__PURE__ */ jsxs205("div", { className: "popup-datepicker-footer", children: [
|
|
3574
|
-
/* @__PURE__ */
|
|
3616
|
+
/* @__PURE__ */ jsx321(
|
|
3575
3617
|
Button_default,
|
|
3576
3618
|
{
|
|
3577
3619
|
type: "secondary",
|
|
@@ -3579,7 +3621,7 @@ var PopupPicker = (props) => {
|
|
|
3579
3621
|
children: locale === "ko" ? "\uCDE8\uC18C" : "Cancel"
|
|
3580
3622
|
}
|
|
3581
3623
|
),
|
|
3582
|
-
/* @__PURE__ */
|
|
3624
|
+
/* @__PURE__ */ jsx321(Button_default, { type: "primary", onClick: handleClose, children: locale === "ko" ? "\uC801\uC6A9" : "Apply" })
|
|
3583
3625
|
] })
|
|
3584
3626
|
] }) })
|
|
3585
3627
|
] });
|
|
@@ -3588,10 +3630,10 @@ PopupPicker.displayName = "PopupPicker";
|
|
|
3588
3630
|
var PopupPicker_default = PopupPicker;
|
|
3589
3631
|
|
|
3590
3632
|
// src/components/Divider/Divider.tsx
|
|
3591
|
-
import { jsx as
|
|
3633
|
+
import { jsx as jsx322 } from "react/jsx-runtime";
|
|
3592
3634
|
var Divider = (props) => {
|
|
3593
3635
|
const { orientation = "horizontal" } = props;
|
|
3594
|
-
return /* @__PURE__ */
|
|
3636
|
+
return /* @__PURE__ */ jsx322(
|
|
3595
3637
|
"div",
|
|
3596
3638
|
{
|
|
3597
3639
|
className: clsx_default("lib-xplat-divider", orientation),
|
|
@@ -3604,15 +3646,15 @@ Divider.displayName = "Divider";
|
|
|
3604
3646
|
var Divider_default = Divider;
|
|
3605
3647
|
|
|
3606
3648
|
// src/components/Drawer/Drawer.tsx
|
|
3607
|
-
import
|
|
3649
|
+
import React18 from "react";
|
|
3608
3650
|
import { createPortal as createPortal2 } from "react-dom";
|
|
3609
|
-
import { jsx as
|
|
3651
|
+
import { jsx as jsx323, jsxs as jsxs206 } from "react/jsx-runtime";
|
|
3610
3652
|
var ANIMATION_DURATION_MS2 = 250;
|
|
3611
3653
|
var Drawer = (props) => {
|
|
3612
3654
|
const { isOpen, onClose, placement = "right", size = "md", title, children } = props;
|
|
3613
|
-
const [mounted, setMounted] =
|
|
3614
|
-
const [visible, setVisible] =
|
|
3615
|
-
|
|
3655
|
+
const [mounted, setMounted] = React18.useState(false);
|
|
3656
|
+
const [visible, setVisible] = React18.useState(false);
|
|
3657
|
+
React18.useEffect(() => {
|
|
3616
3658
|
if (isOpen) {
|
|
3617
3659
|
setMounted(true);
|
|
3618
3660
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -3626,7 +3668,7 @@ var Drawer = (props) => {
|
|
|
3626
3668
|
if (!mounted) return null;
|
|
3627
3669
|
const stateClass = visible ? "enter" : "exit";
|
|
3628
3670
|
return createPortal2(
|
|
3629
|
-
/* @__PURE__ */
|
|
3671
|
+
/* @__PURE__ */ jsx323(
|
|
3630
3672
|
"div",
|
|
3631
3673
|
{
|
|
3632
3674
|
className: clsx_default("lib-xplat-drawer-overlay", stateClass),
|
|
@@ -3640,10 +3682,10 @@ var Drawer = (props) => {
|
|
|
3640
3682
|
onClick: (e) => e.stopPropagation(),
|
|
3641
3683
|
children: [
|
|
3642
3684
|
title && /* @__PURE__ */ jsxs206("div", { className: "drawer-header", children: [
|
|
3643
|
-
/* @__PURE__ */
|
|
3644
|
-
/* @__PURE__ */
|
|
3685
|
+
/* @__PURE__ */ jsx323("span", { className: "drawer-title", children: title }),
|
|
3686
|
+
/* @__PURE__ */ jsx323("button", { className: "close-btn", onClick: onClose, "aria-label": "\uB2EB\uAE30", children: "\xD7" })
|
|
3645
3687
|
] }),
|
|
3646
|
-
/* @__PURE__ */
|
|
3688
|
+
/* @__PURE__ */ jsx323("div", { className: "drawer-body", children })
|
|
3647
3689
|
]
|
|
3648
3690
|
}
|
|
3649
3691
|
)
|
|
@@ -3656,16 +3698,16 @@ Drawer.displayName = "Drawer";
|
|
|
3656
3698
|
var Drawer_default = Drawer;
|
|
3657
3699
|
|
|
3658
3700
|
// src/components/Dropdown/Dropdown.tsx
|
|
3659
|
-
import
|
|
3701
|
+
import React21 from "react";
|
|
3660
3702
|
|
|
3661
3703
|
// src/tokens/hooks/useAutoPosition.ts
|
|
3662
|
-
import
|
|
3704
|
+
import React19 from "react";
|
|
3663
3705
|
var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
3664
|
-
const [position, setPosition] =
|
|
3706
|
+
const [position, setPosition] = React19.useState({
|
|
3665
3707
|
position: {},
|
|
3666
3708
|
direction: "bottom"
|
|
3667
3709
|
});
|
|
3668
|
-
const calculatePosition =
|
|
3710
|
+
const calculatePosition = React19.useCallback(() => {
|
|
3669
3711
|
if (!triggerRef.current || !popRef.current) return;
|
|
3670
3712
|
const triggerRect = triggerRef.current.getBoundingClientRect();
|
|
3671
3713
|
const popW = popRef.current.offsetWidth;
|
|
@@ -3692,13 +3734,13 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
3692
3734
|
direction
|
|
3693
3735
|
});
|
|
3694
3736
|
}, [triggerRef, popRef]);
|
|
3695
|
-
|
|
3737
|
+
React19.useLayoutEffect(() => {
|
|
3696
3738
|
if (!enabled) return;
|
|
3697
3739
|
calculatePosition();
|
|
3698
3740
|
const raf = requestAnimationFrame(calculatePosition);
|
|
3699
3741
|
return () => cancelAnimationFrame(raf);
|
|
3700
3742
|
}, [calculatePosition, enabled]);
|
|
3701
|
-
|
|
3743
|
+
React19.useEffect(() => {
|
|
3702
3744
|
if (!enabled || !popRef.current) return;
|
|
3703
3745
|
const observer = new ResizeObserver(() => {
|
|
3704
3746
|
calculatePosition();
|
|
@@ -3706,7 +3748,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
3706
3748
|
observer.observe(popRef.current);
|
|
3707
3749
|
return () => observer.disconnect();
|
|
3708
3750
|
}, [calculatePosition, enabled, popRef]);
|
|
3709
|
-
|
|
3751
|
+
React19.useEffect(() => {
|
|
3710
3752
|
if (!enabled) return;
|
|
3711
3753
|
window.addEventListener("resize", calculatePosition);
|
|
3712
3754
|
window.addEventListener("scroll", calculatePosition, true);
|
|
@@ -3720,9 +3762,9 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
3720
3762
|
var useAutoPosition_default = useAutoPosition;
|
|
3721
3763
|
|
|
3722
3764
|
// src/tokens/hooks/useClickOutside.ts
|
|
3723
|
-
import
|
|
3765
|
+
import React20 from "react";
|
|
3724
3766
|
var useClickOutside = (refs, handler, enabled = true) => {
|
|
3725
|
-
|
|
3767
|
+
React20.useEffect(() => {
|
|
3726
3768
|
if (!enabled) return;
|
|
3727
3769
|
const refArray = Array.isArray(refs) ? refs : [refs];
|
|
3728
3770
|
const listener = (event) => {
|
|
@@ -3745,17 +3787,17 @@ var useClickOutside = (refs, handler, enabled = true) => {
|
|
|
3745
3787
|
var useClickOutside_default = useClickOutside;
|
|
3746
3788
|
|
|
3747
3789
|
// src/components/Dropdown/Dropdown.tsx
|
|
3748
|
-
import { jsx as
|
|
3790
|
+
import { jsx as jsx324, jsxs as jsxs207 } from "react/jsx-runtime";
|
|
3749
3791
|
var Dropdown = (props) => {
|
|
3750
3792
|
const { items, children } = props;
|
|
3751
|
-
const [isOpen, setIsOpen] =
|
|
3752
|
-
const [mounted, setMounted] =
|
|
3753
|
-
const [visible, setVisible] =
|
|
3754
|
-
const triggerRef =
|
|
3755
|
-
const menuRef =
|
|
3793
|
+
const [isOpen, setIsOpen] = React21.useState(false);
|
|
3794
|
+
const [mounted, setMounted] = React21.useState(false);
|
|
3795
|
+
const [visible, setVisible] = React21.useState(false);
|
|
3796
|
+
const triggerRef = React21.useRef(null);
|
|
3797
|
+
const menuRef = React21.useRef(null);
|
|
3756
3798
|
const { position, direction } = useAutoPosition_default(triggerRef, menuRef, mounted);
|
|
3757
3799
|
useClickOutside_default([triggerRef, menuRef], () => setIsOpen(false), isOpen);
|
|
3758
|
-
|
|
3800
|
+
React21.useEffect(() => {
|
|
3759
3801
|
if (isOpen) {
|
|
3760
3802
|
setMounted(true);
|
|
3761
3803
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -3771,7 +3813,7 @@ var Dropdown = (props) => {
|
|
|
3771
3813
|
setIsOpen(false);
|
|
3772
3814
|
};
|
|
3773
3815
|
return /* @__PURE__ */ jsxs207("div", { className: "lib-xplat-dropdown", children: [
|
|
3774
|
-
/* @__PURE__ */
|
|
3816
|
+
/* @__PURE__ */ jsx324(
|
|
3775
3817
|
"div",
|
|
3776
3818
|
{
|
|
3777
3819
|
ref: triggerRef,
|
|
@@ -3780,14 +3822,14 @@ var Dropdown = (props) => {
|
|
|
3780
3822
|
children
|
|
3781
3823
|
}
|
|
3782
3824
|
),
|
|
3783
|
-
mounted && /* @__PURE__ */
|
|
3825
|
+
mounted && /* @__PURE__ */ jsx324(Portal_default, { children: /* @__PURE__ */ jsx324(
|
|
3784
3826
|
"div",
|
|
3785
3827
|
{
|
|
3786
3828
|
ref: menuRef,
|
|
3787
3829
|
className: clsx_default("lib-xplat-dropdown-menu", direction, { visible }),
|
|
3788
3830
|
style: { top: position.top, left: position.left },
|
|
3789
3831
|
role: "menu",
|
|
3790
|
-
children: items.map((item) => /* @__PURE__ */
|
|
3832
|
+
children: items.map((item) => /* @__PURE__ */ jsx324(
|
|
3791
3833
|
"button",
|
|
3792
3834
|
{
|
|
3793
3835
|
className: clsx_default("dropdown-item", {
|
|
@@ -3809,8 +3851,8 @@ Dropdown.displayName = "Dropdown";
|
|
|
3809
3851
|
var Dropdown_default = Dropdown;
|
|
3810
3852
|
|
|
3811
3853
|
// src/components/Editor/Editor.tsx
|
|
3812
|
-
import
|
|
3813
|
-
import { jsx as
|
|
3854
|
+
import React22 from "react";
|
|
3855
|
+
import { jsx as jsx325, jsxs as jsxs208 } from "react/jsx-runtime";
|
|
3814
3856
|
var DEFAULT_TOOLBAR = [
|
|
3815
3857
|
"bold",
|
|
3816
3858
|
"italic",
|
|
@@ -3917,21 +3959,21 @@ var Editor = (props) => {
|
|
|
3917
3959
|
onImageUpload,
|
|
3918
3960
|
minHeight = 200
|
|
3919
3961
|
} = props;
|
|
3920
|
-
const editorRef =
|
|
3921
|
-
const lastRangeRef =
|
|
3922
|
-
const composingRef =
|
|
3923
|
-
const [isFocused, setIsFocused] =
|
|
3924
|
-
const [isEmpty, setIsEmpty] =
|
|
3925
|
-
const [activeFormats, setActiveFormats] =
|
|
3926
|
-
const [slashOpen, setSlashOpen] =
|
|
3927
|
-
const [slashFilter, setSlashFilter] =
|
|
3928
|
-
const [slashIdx, setSlashIdx] =
|
|
3929
|
-
const [slashPos, setSlashPos] =
|
|
3930
|
-
const slashStartRangeRef =
|
|
3931
|
-
const [linkOpen, setLinkOpen] =
|
|
3932
|
-
const [linkValue, setLinkValue] =
|
|
3933
|
-
const [linkPos, setLinkPos] =
|
|
3934
|
-
|
|
3962
|
+
const editorRef = React22.useRef(null);
|
|
3963
|
+
const lastRangeRef = React22.useRef(null);
|
|
3964
|
+
const composingRef = React22.useRef(false);
|
|
3965
|
+
const [isFocused, setIsFocused] = React22.useState(false);
|
|
3966
|
+
const [isEmpty, setIsEmpty] = React22.useState(!value);
|
|
3967
|
+
const [activeFormats, setActiveFormats] = React22.useState(/* @__PURE__ */ new Set());
|
|
3968
|
+
const [slashOpen, setSlashOpen] = React22.useState(false);
|
|
3969
|
+
const [slashFilter, setSlashFilter] = React22.useState("");
|
|
3970
|
+
const [slashIdx, setSlashIdx] = React22.useState(0);
|
|
3971
|
+
const [slashPos, setSlashPos] = React22.useState({ top: 0, left: 0 });
|
|
3972
|
+
const slashStartRangeRef = React22.useRef(null);
|
|
3973
|
+
const [linkOpen, setLinkOpen] = React22.useState(false);
|
|
3974
|
+
const [linkValue, setLinkValue] = React22.useState("");
|
|
3975
|
+
const [linkPos, setLinkPos] = React22.useState({ top: 0, left: 0 });
|
|
3976
|
+
React22.useEffect(() => {
|
|
3935
3977
|
if (!editorRef.current) return;
|
|
3936
3978
|
if (editorRef.current.innerHTML !== value) {
|
|
3937
3979
|
editorRef.current.innerHTML = sanitizeHtml(value || "");
|
|
@@ -4045,7 +4087,7 @@ var Editor = (props) => {
|
|
|
4045
4087
|
setSlashIdx(0);
|
|
4046
4088
|
slashStartRangeRef.current = null;
|
|
4047
4089
|
};
|
|
4048
|
-
const filteredSlashItems =
|
|
4090
|
+
const filteredSlashItems = React22.useMemo(() => {
|
|
4049
4091
|
if (!slashFilter) return SLASH_ITEMS;
|
|
4050
4092
|
const f = slashFilter.toLowerCase();
|
|
4051
4093
|
return SLASH_ITEMS.filter((it) => it.label.toLowerCase().includes(f) || it.key.includes(f));
|
|
@@ -4331,7 +4373,7 @@ var Editor = (props) => {
|
|
|
4331
4373
|
}
|
|
4332
4374
|
};
|
|
4333
4375
|
return /* @__PURE__ */ jsxs208("div", { className: clsx_default("lib-xplat-editor", isFocused && "focused", readOnly && "readonly"), children: [
|
|
4334
|
-
!readOnly && /* @__PURE__ */
|
|
4376
|
+
!readOnly && /* @__PURE__ */ jsx325(
|
|
4335
4377
|
EditorToolbar,
|
|
4336
4378
|
{
|
|
4337
4379
|
items: toolbar,
|
|
@@ -4340,8 +4382,8 @@ var Editor = (props) => {
|
|
|
4340
4382
|
}
|
|
4341
4383
|
),
|
|
4342
4384
|
/* @__PURE__ */ jsxs208("div", { className: "lib-xplat-editor__content", style: { minHeight }, children: [
|
|
4343
|
-
isEmpty && !isFocused && /* @__PURE__ */
|
|
4344
|
-
/* @__PURE__ */
|
|
4385
|
+
isEmpty && !isFocused && /* @__PURE__ */ jsx325("div", { className: "lib-xplat-editor__placeholder", children: placeholder }),
|
|
4386
|
+
/* @__PURE__ */ jsx325(
|
|
4345
4387
|
"div",
|
|
4346
4388
|
{
|
|
4347
4389
|
ref: editorRef,
|
|
@@ -4360,7 +4402,7 @@ var Editor = (props) => {
|
|
|
4360
4402
|
spellCheck: true
|
|
4361
4403
|
}
|
|
4362
4404
|
),
|
|
4363
|
-
slashOpen && filteredSlashItems.length > 0 && /* @__PURE__ */
|
|
4405
|
+
slashOpen && filteredSlashItems.length > 0 && /* @__PURE__ */ jsx325(
|
|
4364
4406
|
SlashMenu,
|
|
4365
4407
|
{
|
|
4366
4408
|
position: slashPos,
|
|
@@ -4370,7 +4412,7 @@ var Editor = (props) => {
|
|
|
4370
4412
|
onClose: closeSlashMenu
|
|
4371
4413
|
}
|
|
4372
4414
|
),
|
|
4373
|
-
linkOpen && /* @__PURE__ */
|
|
4415
|
+
linkOpen && /* @__PURE__ */ jsx325(
|
|
4374
4416
|
LinkPopover,
|
|
4375
4417
|
{
|
|
4376
4418
|
position: linkPos,
|
|
@@ -4422,7 +4464,7 @@ var isActive = (item, active) => {
|
|
|
4422
4464
|
return active.has(item);
|
|
4423
4465
|
};
|
|
4424
4466
|
var EditorToolbar = ({ items, active, onAction }) => {
|
|
4425
|
-
return /* @__PURE__ */
|
|
4467
|
+
return /* @__PURE__ */ jsx325("div", { className: "lib-xplat-editor__toolbar", children: items.map((item) => /* @__PURE__ */ jsx325(
|
|
4426
4468
|
"button",
|
|
4427
4469
|
{
|
|
4428
4470
|
type: "button",
|
|
@@ -4438,7 +4480,7 @@ var EditorToolbar = ({ items, active, onAction }) => {
|
|
|
4438
4480
|
)) });
|
|
4439
4481
|
};
|
|
4440
4482
|
var SlashMenu = ({ position, items, activeIndex, onSelect, onClose }) => {
|
|
4441
|
-
|
|
4483
|
+
React22.useEffect(() => {
|
|
4442
4484
|
const handleClickOutside = (e) => {
|
|
4443
4485
|
const target = e.target;
|
|
4444
4486
|
const menu = document.querySelector(".lib-xplat-editor__slash-menu");
|
|
@@ -4447,7 +4489,7 @@ var SlashMenu = ({ position, items, activeIndex, onSelect, onClose }) => {
|
|
|
4447
4489
|
window.addEventListener("mousedown", handleClickOutside);
|
|
4448
4490
|
return () => window.removeEventListener("mousedown", handleClickOutside);
|
|
4449
4491
|
}, [onClose]);
|
|
4450
|
-
return /* @__PURE__ */
|
|
4492
|
+
return /* @__PURE__ */ jsx325(
|
|
4451
4493
|
"div",
|
|
4452
4494
|
{
|
|
4453
4495
|
className: "lib-xplat-editor__slash-menu",
|
|
@@ -4462,8 +4504,8 @@ var SlashMenu = ({ position, items, activeIndex, onSelect, onClose }) => {
|
|
|
4462
4504
|
onSelect(item);
|
|
4463
4505
|
},
|
|
4464
4506
|
children: [
|
|
4465
|
-
/* @__PURE__ */
|
|
4466
|
-
item.hint && /* @__PURE__ */
|
|
4507
|
+
/* @__PURE__ */ jsx325("span", { className: "label", children: item.label }),
|
|
4508
|
+
item.hint && /* @__PURE__ */ jsx325("span", { className: "hint", children: item.hint })
|
|
4467
4509
|
]
|
|
4468
4510
|
},
|
|
4469
4511
|
item.key
|
|
@@ -4472,8 +4514,8 @@ var SlashMenu = ({ position, items, activeIndex, onSelect, onClose }) => {
|
|
|
4472
4514
|
);
|
|
4473
4515
|
};
|
|
4474
4516
|
var LinkPopover = ({ position, value, onChange, onConfirm, onClose }) => {
|
|
4475
|
-
const inputRef =
|
|
4476
|
-
|
|
4517
|
+
const inputRef = React22.useRef(null);
|
|
4518
|
+
React22.useEffect(() => {
|
|
4477
4519
|
inputRef.current?.focus();
|
|
4478
4520
|
}, []);
|
|
4479
4521
|
return /* @__PURE__ */ jsxs208(
|
|
@@ -4482,7 +4524,7 @@ var LinkPopover = ({ position, value, onChange, onConfirm, onClose }) => {
|
|
|
4482
4524
|
className: "lib-xplat-editor__link-popover",
|
|
4483
4525
|
style: { top: position.top, left: position.left },
|
|
4484
4526
|
children: [
|
|
4485
|
-
/* @__PURE__ */
|
|
4527
|
+
/* @__PURE__ */ jsx325(
|
|
4486
4528
|
"input",
|
|
4487
4529
|
{
|
|
4488
4530
|
ref: inputRef,
|
|
@@ -4502,11 +4544,11 @@ var LinkPopover = ({ position, value, onChange, onConfirm, onClose }) => {
|
|
|
4502
4544
|
}
|
|
4503
4545
|
}
|
|
4504
4546
|
),
|
|
4505
|
-
/* @__PURE__ */
|
|
4547
|
+
/* @__PURE__ */ jsx325("button", { type: "button", onMouseDown: (e) => {
|
|
4506
4548
|
e.preventDefault();
|
|
4507
4549
|
onConfirm();
|
|
4508
4550
|
}, children: "\uC801\uC6A9" }),
|
|
4509
|
-
/* @__PURE__ */
|
|
4551
|
+
/* @__PURE__ */ jsx325("button", { type: "button", onMouseDown: (e) => {
|
|
4510
4552
|
e.preventDefault();
|
|
4511
4553
|
onClose();
|
|
4512
4554
|
}, children: "\uCDE8\uC18C" })
|
|
@@ -4516,23 +4558,23 @@ var LinkPopover = ({ position, value, onChange, onConfirm, onClose }) => {
|
|
|
4516
4558
|
};
|
|
4517
4559
|
|
|
4518
4560
|
// src/components/EmptyState/EmptyState.tsx
|
|
4519
|
-
import { jsx as
|
|
4561
|
+
import { jsx as jsx326, jsxs as jsxs209 } from "react/jsx-runtime";
|
|
4520
4562
|
var EmptyState = (props) => {
|
|
4521
4563
|
const { icon, title = "\uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4", description, action } = props;
|
|
4522
4564
|
return /* @__PURE__ */ jsxs209("div", { className: "lib-xplat-empty-state", children: [
|
|
4523
|
-
icon && /* @__PURE__ */
|
|
4524
|
-
!icon && /* @__PURE__ */
|
|
4525
|
-
/* @__PURE__ */
|
|
4526
|
-
description && /* @__PURE__ */
|
|
4527
|
-
action && /* @__PURE__ */
|
|
4565
|
+
icon && /* @__PURE__ */ jsx326("div", { className: "empty-icon", children: icon }),
|
|
4566
|
+
!icon && /* @__PURE__ */ jsx326("div", { className: "empty-icon", children: /* @__PURE__ */ jsx326("svg", { viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsx326("path", { d: "M20 6h-8l-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V8h16v10z" }) }) }),
|
|
4567
|
+
/* @__PURE__ */ jsx326("p", { className: "empty-title", children: title }),
|
|
4568
|
+
description && /* @__PURE__ */ jsx326("p", { className: "empty-description", children: description }),
|
|
4569
|
+
action && /* @__PURE__ */ jsx326("div", { className: "empty-action", children: action })
|
|
4528
4570
|
] });
|
|
4529
4571
|
};
|
|
4530
4572
|
EmptyState.displayName = "EmptyState";
|
|
4531
4573
|
var EmptyState_default = EmptyState;
|
|
4532
4574
|
|
|
4533
4575
|
// src/components/FileUpload/FileUpload.tsx
|
|
4534
|
-
import
|
|
4535
|
-
import { jsx as
|
|
4576
|
+
import React23 from "react";
|
|
4577
|
+
import { jsx as jsx327, jsxs as jsxs210 } from "react/jsx-runtime";
|
|
4536
4578
|
var FileUpload = (props) => {
|
|
4537
4579
|
const {
|
|
4538
4580
|
accept,
|
|
@@ -4542,8 +4584,8 @@ var FileUpload = (props) => {
|
|
|
4542
4584
|
label = "\uD30C\uC77C\uC744 \uB4DC\uB798\uADF8\uD558\uAC70\uB098 \uD074\uB9AD\uD558\uC5EC \uC5C5\uB85C\uB4DC",
|
|
4543
4585
|
description
|
|
4544
4586
|
} = props;
|
|
4545
|
-
const [isDragOver, setIsDragOver] =
|
|
4546
|
-
const inputRef =
|
|
4587
|
+
const [isDragOver, setIsDragOver] = React23.useState(false);
|
|
4588
|
+
const inputRef = React23.useRef(null);
|
|
4547
4589
|
const handleFiles = (fileList) => {
|
|
4548
4590
|
let files = Array.from(fileList);
|
|
4549
4591
|
if (maxSize) {
|
|
@@ -4582,7 +4624,7 @@ var FileUpload = (props) => {
|
|
|
4582
4624
|
onDragLeave: handleDragLeave,
|
|
4583
4625
|
onClick: () => inputRef.current?.click(),
|
|
4584
4626
|
children: [
|
|
4585
|
-
/* @__PURE__ */
|
|
4627
|
+
/* @__PURE__ */ jsx327(
|
|
4586
4628
|
"input",
|
|
4587
4629
|
{
|
|
4588
4630
|
ref: inputRef,
|
|
@@ -4592,9 +4634,9 @@ var FileUpload = (props) => {
|
|
|
4592
4634
|
onChange: handleChange
|
|
4593
4635
|
}
|
|
4594
4636
|
),
|
|
4595
|
-
/* @__PURE__ */
|
|
4596
|
-
/* @__PURE__ */
|
|
4597
|
-
description && /* @__PURE__ */
|
|
4637
|
+
/* @__PURE__ */ jsx327("div", { className: "upload-icon", children: /* @__PURE__ */ jsx327(UploadIcon_default, {}) }),
|
|
4638
|
+
/* @__PURE__ */ jsx327("p", { className: "upload-label", children: label }),
|
|
4639
|
+
description && /* @__PURE__ */ jsx327("p", { className: "upload-description", children: description })
|
|
4598
4640
|
]
|
|
4599
4641
|
}
|
|
4600
4642
|
);
|
|
@@ -4603,10 +4645,10 @@ FileUpload.displayName = "FileUpload";
|
|
|
4603
4645
|
var FileUpload_default = FileUpload;
|
|
4604
4646
|
|
|
4605
4647
|
// src/components/HtmlTypeWriter/HtmlTypeWriter.tsx
|
|
4606
|
-
import
|
|
4648
|
+
import React25 from "react";
|
|
4607
4649
|
|
|
4608
4650
|
// src/components/HtmlTypeWriter/utils.ts
|
|
4609
|
-
import
|
|
4651
|
+
import React24 from "react";
|
|
4610
4652
|
var voidTags = /* @__PURE__ */ new Set([
|
|
4611
4653
|
"br",
|
|
4612
4654
|
"img",
|
|
@@ -4674,41 +4716,41 @@ var convertNodeToReactWithRange = (node, typedLen, rangeMap) => {
|
|
|
4674
4716
|
props[attr.name] = attr.value;
|
|
4675
4717
|
});
|
|
4676
4718
|
if (voidTags.has(tag)) {
|
|
4677
|
-
return
|
|
4719
|
+
return React24.createElement(tag, props);
|
|
4678
4720
|
}
|
|
4679
4721
|
const children = Array.from(element.childNodes).map((child) => convertNodeToReactWithRange(child, typedLen, rangeMap)).filter((n) => n != null);
|
|
4680
|
-
return
|
|
4722
|
+
return React24.createElement(tag, props, ...children);
|
|
4681
4723
|
};
|
|
4682
4724
|
var htmlToReactProgressive = (root, typedLen, rangeMap) => {
|
|
4683
4725
|
const nodes = Array.from(root.childNodes).map((child, idx) => {
|
|
4684
4726
|
const node = convertNodeToReactWithRange(child, typedLen, rangeMap);
|
|
4685
|
-
return node == null ? null :
|
|
4727
|
+
return node == null ? null : React24.createElement(React24.Fragment, { key: idx }, node);
|
|
4686
4728
|
}).filter(Boolean);
|
|
4687
4729
|
return nodes.length === 0 ? null : nodes;
|
|
4688
4730
|
};
|
|
4689
4731
|
|
|
4690
4732
|
// src/components/HtmlTypeWriter/HtmlTypeWriter.tsx
|
|
4691
|
-
import { jsx as
|
|
4733
|
+
import { jsx as jsx328 } from "react/jsx-runtime";
|
|
4692
4734
|
var HtmlTypeWriter = ({
|
|
4693
4735
|
html,
|
|
4694
4736
|
duration = 20,
|
|
4695
4737
|
onDone,
|
|
4696
4738
|
onChange
|
|
4697
4739
|
}) => {
|
|
4698
|
-
const [typedLen, setTypedLen] =
|
|
4699
|
-
const doneCalledRef =
|
|
4700
|
-
const { doc, rangeMap, totalLength } =
|
|
4740
|
+
const [typedLen, setTypedLen] = React25.useState(0);
|
|
4741
|
+
const doneCalledRef = React25.useRef(false);
|
|
4742
|
+
const { doc, rangeMap, totalLength } = React25.useMemo(() => {
|
|
4701
4743
|
if (typeof window === "undefined") return { doc: null, rangeMap: /* @__PURE__ */ new Map(), totalLength: 0 };
|
|
4702
4744
|
const decoded = decodeHtmlEntities(html);
|
|
4703
4745
|
const doc2 = new DOMParser().parseFromString(decoded, "text/html");
|
|
4704
4746
|
const { rangeMap: rangeMap2, totalLength: totalLength2 } = buildRangeMap(doc2.body);
|
|
4705
4747
|
return { doc: doc2, rangeMap: rangeMap2, totalLength: totalLength2 };
|
|
4706
4748
|
}, [html]);
|
|
4707
|
-
|
|
4749
|
+
React25.useEffect(() => {
|
|
4708
4750
|
setTypedLen(0);
|
|
4709
4751
|
doneCalledRef.current = false;
|
|
4710
4752
|
}, [html]);
|
|
4711
|
-
|
|
4753
|
+
React25.useEffect(() => {
|
|
4712
4754
|
if (!totalLength) return;
|
|
4713
4755
|
if (typedLen >= totalLength) return;
|
|
4714
4756
|
const timer = window.setInterval(() => {
|
|
@@ -4716,33 +4758,33 @@ var HtmlTypeWriter = ({
|
|
|
4716
4758
|
}, duration);
|
|
4717
4759
|
return () => window.clearInterval(timer);
|
|
4718
4760
|
}, [typedLen, totalLength, duration]);
|
|
4719
|
-
|
|
4761
|
+
React25.useEffect(() => {
|
|
4720
4762
|
if (typedLen > 0 && typedLen < totalLength) {
|
|
4721
4763
|
onChange?.();
|
|
4722
4764
|
}
|
|
4723
4765
|
}, [typedLen, totalLength, onChange]);
|
|
4724
|
-
|
|
4766
|
+
React25.useEffect(() => {
|
|
4725
4767
|
if (typedLen === totalLength && totalLength > 0 && !doneCalledRef.current) {
|
|
4726
4768
|
doneCalledRef.current = true;
|
|
4727
4769
|
onDone?.();
|
|
4728
4770
|
}
|
|
4729
4771
|
}, [typedLen, totalLength, onDone]);
|
|
4730
|
-
const parsed =
|
|
4772
|
+
const parsed = React25.useMemo(
|
|
4731
4773
|
() => doc ? htmlToReactProgressive(doc.body, typedLen, rangeMap) : null,
|
|
4732
4774
|
[doc, typedLen, rangeMap]
|
|
4733
4775
|
);
|
|
4734
|
-
return /* @__PURE__ */
|
|
4776
|
+
return /* @__PURE__ */ jsx328("div", { className: "lib-xplat-htmlTypewriter", children: parsed });
|
|
4735
4777
|
};
|
|
4736
4778
|
HtmlTypeWriter.displayName = "HtmlTypeWriter";
|
|
4737
4779
|
var HtmlTypeWriter_default = HtmlTypeWriter;
|
|
4738
4780
|
|
|
4739
4781
|
// src/components/ImageSelector/ImageSelector.tsx
|
|
4740
|
-
import
|
|
4741
|
-
import { jsx as
|
|
4782
|
+
import React26 from "react";
|
|
4783
|
+
import { jsx as jsx329, jsxs as jsxs211 } from "react/jsx-runtime";
|
|
4742
4784
|
var ImageSelector = (props) => {
|
|
4743
4785
|
const { value, label, onChange } = props;
|
|
4744
|
-
const [previewUrl, setPreviewUrl] =
|
|
4745
|
-
|
|
4786
|
+
const [previewUrl, setPreviewUrl] = React26.useState();
|
|
4787
|
+
React26.useEffect(() => {
|
|
4746
4788
|
if (!value) {
|
|
4747
4789
|
setPreviewUrl(void 0);
|
|
4748
4790
|
return;
|
|
@@ -4751,7 +4793,7 @@ var ImageSelector = (props) => {
|
|
|
4751
4793
|
setPreviewUrl(url);
|
|
4752
4794
|
return () => URL.revokeObjectURL(url);
|
|
4753
4795
|
}, [value]);
|
|
4754
|
-
const inputRef =
|
|
4796
|
+
const inputRef = React26.useRef(null);
|
|
4755
4797
|
const handleFileChange = (e) => {
|
|
4756
4798
|
const selectedFile = e.target.files?.[0];
|
|
4757
4799
|
if (selectedFile) {
|
|
@@ -4765,7 +4807,7 @@ var ImageSelector = (props) => {
|
|
|
4765
4807
|
inputRef.current?.click();
|
|
4766
4808
|
};
|
|
4767
4809
|
return /* @__PURE__ */ jsxs211("div", { className: `lib-xplat-imageselector${value ? "" : " none-value"}`, children: [
|
|
4768
|
-
/* @__PURE__ */
|
|
4810
|
+
/* @__PURE__ */ jsx329(
|
|
4769
4811
|
"input",
|
|
4770
4812
|
{
|
|
4771
4813
|
type: "file",
|
|
@@ -4776,12 +4818,12 @@ var ImageSelector = (props) => {
|
|
|
4776
4818
|
}
|
|
4777
4819
|
),
|
|
4778
4820
|
value && /* @__PURE__ */ jsxs211("div", { className: "action-bar", children: [
|
|
4779
|
-
/* @__PURE__ */
|
|
4780
|
-
/* @__PURE__ */
|
|
4821
|
+
/* @__PURE__ */ jsx329("div", { className: "icon-wrapper", onClick: handleOpenFileDialog, children: /* @__PURE__ */ jsx329(UploadIcon_default, {}) }),
|
|
4822
|
+
/* @__PURE__ */ jsx329("div", { className: "icon-wrapper", onClick: handleDeleteFile, children: /* @__PURE__ */ jsx329(DeleteIcon_default, {}) })
|
|
4781
4823
|
] }),
|
|
4782
|
-
/* @__PURE__ */
|
|
4783
|
-
/* @__PURE__ */
|
|
4784
|
-
/* @__PURE__ */
|
|
4824
|
+
/* @__PURE__ */ jsx329("div", { className: "content", children: previewUrl ? /* @__PURE__ */ jsx329("img", { src: previewUrl, alt: "preview" }) : /* @__PURE__ */ jsxs211("div", { className: "skeleton", onClick: handleOpenFileDialog, children: [
|
|
4825
|
+
/* @__PURE__ */ jsx329("div", { className: "icon-wrapper", children: /* @__PURE__ */ jsx329(ImageIcon_default, {}) }),
|
|
4826
|
+
/* @__PURE__ */ jsx329("div", { className: "label", children: label || "\uC774\uBBF8\uC9C0 \uCD94\uAC00\uD558\uAE30" })
|
|
4785
4827
|
] }) })
|
|
4786
4828
|
] });
|
|
4787
4829
|
};
|
|
@@ -4789,7 +4831,7 @@ ImageSelector.displayName = "ImageSelector";
|
|
|
4789
4831
|
var ImageSelector_default = ImageSelector;
|
|
4790
4832
|
|
|
4791
4833
|
// src/components/Pagination/Pagination.tsx
|
|
4792
|
-
import { jsx as
|
|
4834
|
+
import { jsx as jsx330, jsxs as jsxs212 } from "react/jsx-runtime";
|
|
4793
4835
|
var getPageRange = (current, totalPages, siblingCount) => {
|
|
4794
4836
|
const totalNumbers = siblingCount * 2 + 5;
|
|
4795
4837
|
if (totalPages <= totalNumbers) {
|
|
@@ -4833,18 +4875,18 @@ var Pagination = (props) => {
|
|
|
4833
4875
|
}
|
|
4834
4876
|
};
|
|
4835
4877
|
return /* @__PURE__ */ jsxs212("nav", { className: clsx_default("lib-xplat-pagination", size, type), "aria-label": "\uD398\uC774\uC9C0 \uB124\uBE44\uAC8C\uC774\uC158", children: [
|
|
4836
|
-
/* @__PURE__ */
|
|
4878
|
+
/* @__PURE__ */ jsx330(
|
|
4837
4879
|
"button",
|
|
4838
4880
|
{
|
|
4839
4881
|
className: "page-btn prev",
|
|
4840
4882
|
disabled: current <= 1,
|
|
4841
4883
|
onClick: () => handleClick(current - 1),
|
|
4842
4884
|
"aria-label": "\uC774\uC804 \uD398\uC774\uC9C0",
|
|
4843
|
-
children: /* @__PURE__ */
|
|
4885
|
+
children: /* @__PURE__ */ jsx330(ChevronLeftIcon_default, {})
|
|
4844
4886
|
}
|
|
4845
4887
|
),
|
|
4846
4888
|
pages.map(
|
|
4847
|
-
(page, i) => page === "..." ? /* @__PURE__ */
|
|
4889
|
+
(page, i) => page === "..." ? /* @__PURE__ */ jsx330("span", { className: "dots", children: "..." }, `dots-${i}`) : /* @__PURE__ */ jsx330(
|
|
4848
4890
|
"button",
|
|
4849
4891
|
{
|
|
4850
4892
|
className: clsx_default("page-btn", { active: page === current }),
|
|
@@ -4855,14 +4897,14 @@ var Pagination = (props) => {
|
|
|
4855
4897
|
page
|
|
4856
4898
|
)
|
|
4857
4899
|
),
|
|
4858
|
-
/* @__PURE__ */
|
|
4900
|
+
/* @__PURE__ */ jsx330(
|
|
4859
4901
|
"button",
|
|
4860
4902
|
{
|
|
4861
4903
|
className: "page-btn next",
|
|
4862
4904
|
disabled: current >= totalPages,
|
|
4863
4905
|
onClick: () => handleClick(current + 1),
|
|
4864
4906
|
"aria-label": "\uB2E4\uC74C \uD398\uC774\uC9C0",
|
|
4865
|
-
children: /* @__PURE__ */
|
|
4907
|
+
children: /* @__PURE__ */ jsx330(ChevronRightIcon_default, {})
|
|
4866
4908
|
}
|
|
4867
4909
|
)
|
|
4868
4910
|
] });
|
|
@@ -4871,17 +4913,17 @@ Pagination.displayName = "Pagination";
|
|
|
4871
4913
|
var Pagination_default = Pagination;
|
|
4872
4914
|
|
|
4873
4915
|
// src/components/PopOver/PopOver.tsx
|
|
4874
|
-
import
|
|
4875
|
-
import { jsx as
|
|
4916
|
+
import React27 from "react";
|
|
4917
|
+
import { jsx as jsx331, jsxs as jsxs213 } from "react/jsx-runtime";
|
|
4876
4918
|
var PopOver = (props) => {
|
|
4877
4919
|
const { children, isOpen, onClose, PopOverEl } = props;
|
|
4878
|
-
const popRef =
|
|
4879
|
-
const triggerRef =
|
|
4880
|
-
const [localOpen, setLocalOpen] =
|
|
4881
|
-
const [eventTrigger, setEventTrigger] =
|
|
4920
|
+
const popRef = React27.useRef(null);
|
|
4921
|
+
const triggerRef = React27.useRef(null);
|
|
4922
|
+
const [localOpen, setLocalOpen] = React27.useState(false);
|
|
4923
|
+
const [eventTrigger, setEventTrigger] = React27.useState(false);
|
|
4882
4924
|
useClickOutside_default([popRef, triggerRef], onClose, isOpen);
|
|
4883
4925
|
const position = useAutoPosition_default(triggerRef, popRef, localOpen);
|
|
4884
|
-
|
|
4926
|
+
React27.useEffect(() => {
|
|
4885
4927
|
if (isOpen) {
|
|
4886
4928
|
setLocalOpen(isOpen);
|
|
4887
4929
|
setTimeout(() => {
|
|
@@ -4904,7 +4946,7 @@ var PopOver = (props) => {
|
|
|
4904
4946
|
},
|
|
4905
4947
|
children: [
|
|
4906
4948
|
children,
|
|
4907
|
-
localOpen && /* @__PURE__ */
|
|
4949
|
+
localOpen && /* @__PURE__ */ jsx331(Portal_default, { children: /* @__PURE__ */ jsx331(
|
|
4908
4950
|
"div",
|
|
4909
4951
|
{
|
|
4910
4952
|
className: clsx_default(
|
|
@@ -4927,7 +4969,7 @@ PopOver.displayName = "PopOver";
|
|
|
4927
4969
|
var PopOver_default = PopOver;
|
|
4928
4970
|
|
|
4929
4971
|
// src/components/Progress/Progress.tsx
|
|
4930
|
-
import { jsx as
|
|
4972
|
+
import { jsx as jsx332, jsxs as jsxs214 } from "react/jsx-runtime";
|
|
4931
4973
|
var Progress = (props) => {
|
|
4932
4974
|
const {
|
|
4933
4975
|
value,
|
|
@@ -4938,7 +4980,7 @@ var Progress = (props) => {
|
|
|
4938
4980
|
} = props;
|
|
4939
4981
|
const percentage = Math.min(100, Math.max(0, value / max * 100));
|
|
4940
4982
|
return /* @__PURE__ */ jsxs214("div", { className: clsx_default("lib-xplat-progress", size, type), children: [
|
|
4941
|
-
/* @__PURE__ */
|
|
4983
|
+
/* @__PURE__ */ jsx332(
|
|
4942
4984
|
"div",
|
|
4943
4985
|
{
|
|
4944
4986
|
className: "track",
|
|
@@ -4946,7 +4988,7 @@ var Progress = (props) => {
|
|
|
4946
4988
|
"aria-valuenow": value,
|
|
4947
4989
|
"aria-valuemin": 0,
|
|
4948
4990
|
"aria-valuemax": max,
|
|
4949
|
-
children: /* @__PURE__ */
|
|
4991
|
+
children: /* @__PURE__ */ jsx332(
|
|
4950
4992
|
"div",
|
|
4951
4993
|
{
|
|
4952
4994
|
className: "bar",
|
|
@@ -4965,17 +5007,17 @@ Progress.displayName = "Progress";
|
|
|
4965
5007
|
var Progress_default = Progress;
|
|
4966
5008
|
|
|
4967
5009
|
// src/components/Radio/RadioGroupContext.tsx
|
|
4968
|
-
import
|
|
4969
|
-
var RadioGroupContext =
|
|
5010
|
+
import React28 from "react";
|
|
5011
|
+
var RadioGroupContext = React28.createContext(
|
|
4970
5012
|
null
|
|
4971
5013
|
);
|
|
4972
5014
|
var useRadioGroupContext = () => {
|
|
4973
|
-
return
|
|
5015
|
+
return React28.useContext(RadioGroupContext);
|
|
4974
5016
|
};
|
|
4975
5017
|
var RadioGroupContext_default = RadioGroupContext;
|
|
4976
5018
|
|
|
4977
5019
|
// src/components/Radio/Radio.tsx
|
|
4978
|
-
import { jsx as
|
|
5020
|
+
import { jsx as jsx333, jsxs as jsxs215 } from "react/jsx-runtime";
|
|
4979
5021
|
var Radio = (props) => {
|
|
4980
5022
|
const {
|
|
4981
5023
|
label,
|
|
@@ -5005,18 +5047,18 @@ var Radio = (props) => {
|
|
|
5005
5047
|
className
|
|
5006
5048
|
),
|
|
5007
5049
|
children: [
|
|
5008
|
-
/* @__PURE__ */
|
|
5009
|
-
/* @__PURE__ */
|
|
5050
|
+
/* @__PURE__ */ jsx333("input", { ...rest, ...inputProps, checked: localChecked, type: "radio" }),
|
|
5051
|
+
/* @__PURE__ */ jsx333(
|
|
5010
5052
|
"div",
|
|
5011
5053
|
{
|
|
5012
5054
|
className: clsx_default(
|
|
5013
5055
|
"circle",
|
|
5014
5056
|
localChecked ? "checked" : void 0
|
|
5015
5057
|
),
|
|
5016
|
-
children: localChecked && /* @__PURE__ */
|
|
5058
|
+
children: localChecked && /* @__PURE__ */ jsx333("div", { className: "inner-circle" })
|
|
5017
5059
|
}
|
|
5018
5060
|
),
|
|
5019
|
-
label && /* @__PURE__ */
|
|
5061
|
+
label && /* @__PURE__ */ jsx333("span", { children: label })
|
|
5020
5062
|
]
|
|
5021
5063
|
}
|
|
5022
5064
|
);
|
|
@@ -5025,28 +5067,28 @@ Radio.displayName = "Radio";
|
|
|
5025
5067
|
var Radio_default = Radio;
|
|
5026
5068
|
|
|
5027
5069
|
// src/components/Radio/RadioGroup.tsx
|
|
5028
|
-
import { Fragment as Fragment4, jsx as
|
|
5070
|
+
import { Fragment as Fragment4, jsx as jsx334 } from "react/jsx-runtime";
|
|
5029
5071
|
var RadioGroup = (props) => {
|
|
5030
5072
|
const { children, ...rest } = props;
|
|
5031
|
-
return /* @__PURE__ */
|
|
5073
|
+
return /* @__PURE__ */ jsx334(Fragment4, { children: /* @__PURE__ */ jsx334(RadioGroupContext_default.Provider, { value: rest, children }) });
|
|
5032
5074
|
};
|
|
5033
5075
|
RadioGroup.displayName = "RadioGroup";
|
|
5034
5076
|
var RadioGroup_default = RadioGroup;
|
|
5035
5077
|
|
|
5036
5078
|
// src/components/Select/Select.tsx
|
|
5037
|
-
import
|
|
5079
|
+
import React31 from "react";
|
|
5038
5080
|
|
|
5039
5081
|
// src/components/Select/context.ts
|
|
5040
|
-
import
|
|
5041
|
-
var SelectContext =
|
|
5082
|
+
import React29 from "react";
|
|
5083
|
+
var SelectContext = React29.createContext(null);
|
|
5042
5084
|
var context_default = SelectContext;
|
|
5043
5085
|
|
|
5044
5086
|
// src/components/Select/SelectItem.tsx
|
|
5045
|
-
import
|
|
5046
|
-
import { jsx as
|
|
5087
|
+
import React30 from "react";
|
|
5088
|
+
import { jsx as jsx335 } from "react/jsx-runtime";
|
|
5047
5089
|
var SelectItem = (props) => {
|
|
5048
5090
|
const { children, value, onClick, disabled = false } = props;
|
|
5049
|
-
const ctx =
|
|
5091
|
+
const ctx = React30.useContext(context_default);
|
|
5050
5092
|
const handleClick = (e) => {
|
|
5051
5093
|
e.preventDefault();
|
|
5052
5094
|
e.stopPropagation();
|
|
@@ -5056,7 +5098,7 @@ var SelectItem = (props) => {
|
|
|
5056
5098
|
onClick?.();
|
|
5057
5099
|
};
|
|
5058
5100
|
const isSelected = value !== void 0 ? ctx?.selectedValue === value : ctx?.selectedLabel === children;
|
|
5059
|
-
return /* @__PURE__ */
|
|
5101
|
+
return /* @__PURE__ */ jsx335(
|
|
5060
5102
|
"div",
|
|
5061
5103
|
{
|
|
5062
5104
|
className: clsx_default("select-item", disabled && "disabled", isSelected && "is-selected"),
|
|
@@ -5077,7 +5119,7 @@ SelectItem.displayName = "Select.Item";
|
|
|
5077
5119
|
var SelectItem_default = SelectItem;
|
|
5078
5120
|
|
|
5079
5121
|
// src/components/Select/Select.tsx
|
|
5080
|
-
import { jsx as
|
|
5122
|
+
import { jsx as jsx336, jsxs as jsxs216 } from "react/jsx-runtime";
|
|
5081
5123
|
var ANIMATION_DURATION_MS3 = 200;
|
|
5082
5124
|
var SelectRoot = (props) => {
|
|
5083
5125
|
const {
|
|
@@ -5089,28 +5131,28 @@ var SelectRoot = (props) => {
|
|
|
5089
5131
|
error = false,
|
|
5090
5132
|
size = "md"
|
|
5091
5133
|
} = props;
|
|
5092
|
-
const itemChildren =
|
|
5093
|
-
(child) =>
|
|
5134
|
+
const itemChildren = React31.Children.toArray(children).filter(
|
|
5135
|
+
(child) => React31.isValidElement(child) && child.type === SelectItem_default
|
|
5094
5136
|
);
|
|
5095
5137
|
const isControlled = valueProp !== void 0;
|
|
5096
|
-
const [isOpen, setOpen] =
|
|
5097
|
-
const [uncontrolledLabel, setUncontrolledLabel] =
|
|
5098
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
5099
|
-
const controlledLabel =
|
|
5138
|
+
const [isOpen, setOpen] = React31.useState(false);
|
|
5139
|
+
const [uncontrolledLabel, setUncontrolledLabel] = React31.useState(null);
|
|
5140
|
+
const [uncontrolledValue, setUncontrolledValue] = React31.useState(void 0);
|
|
5141
|
+
const controlledLabel = React31.useMemo(() => {
|
|
5100
5142
|
if (!isControlled) return null;
|
|
5101
5143
|
const match = itemChildren.find((child) => child.props.value === valueProp);
|
|
5102
5144
|
return match ? match.props.children : null;
|
|
5103
5145
|
}, [isControlled, valueProp, itemChildren]);
|
|
5104
5146
|
const selectedLabel = isControlled ? controlledLabel : uncontrolledLabel;
|
|
5105
5147
|
const selectedValue = isControlled ? valueProp : uncontrolledValue;
|
|
5106
|
-
const triggerRef =
|
|
5107
|
-
const contentRef =
|
|
5108
|
-
const [mounted, setMounted] =
|
|
5109
|
-
const [visible, setVisible] =
|
|
5110
|
-
|
|
5148
|
+
const triggerRef = React31.useRef(null);
|
|
5149
|
+
const contentRef = React31.useRef(null);
|
|
5150
|
+
const [mounted, setMounted] = React31.useState(false);
|
|
5151
|
+
const [visible, setVisible] = React31.useState(false);
|
|
5152
|
+
React31.useEffect(() => {
|
|
5111
5153
|
if (disabled && isOpen) setOpen(false);
|
|
5112
5154
|
}, [disabled, isOpen]);
|
|
5113
|
-
|
|
5155
|
+
React31.useEffect(() => {
|
|
5114
5156
|
if (isOpen) {
|
|
5115
5157
|
setMounted(true);
|
|
5116
5158
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -5120,12 +5162,12 @@ var SelectRoot = (props) => {
|
|
|
5120
5162
|
const t = setTimeout(() => setMounted(false), ANIMATION_DURATION_MS3);
|
|
5121
5163
|
return () => clearTimeout(t);
|
|
5122
5164
|
}, [isOpen]);
|
|
5123
|
-
const open =
|
|
5124
|
-
const close =
|
|
5125
|
-
const toggle =
|
|
5165
|
+
const open = React31.useCallback(() => setOpen(true), []);
|
|
5166
|
+
const close = React31.useCallback(() => setOpen(false), []);
|
|
5167
|
+
const toggle = React31.useCallback(() => setOpen((prev) => !prev), []);
|
|
5126
5168
|
useClickOutside_default([contentRef, triggerRef], close, isOpen);
|
|
5127
5169
|
const position = useAutoPosition_default(triggerRef, contentRef, mounted);
|
|
5128
|
-
const setSelected =
|
|
5170
|
+
const setSelected = React31.useCallback(
|
|
5129
5171
|
(label, itemValue) => {
|
|
5130
5172
|
if (!isControlled) {
|
|
5131
5173
|
setUncontrolledLabel(label);
|
|
@@ -5135,7 +5177,7 @@ var SelectRoot = (props) => {
|
|
|
5135
5177
|
},
|
|
5136
5178
|
[isControlled, onChange]
|
|
5137
5179
|
);
|
|
5138
|
-
const ctxValue =
|
|
5180
|
+
const ctxValue = React31.useMemo(
|
|
5139
5181
|
() => ({
|
|
5140
5182
|
isOpen,
|
|
5141
5183
|
mounted,
|
|
@@ -5157,7 +5199,7 @@ var SelectRoot = (props) => {
|
|
|
5157
5199
|
if (disabled) return;
|
|
5158
5200
|
toggle();
|
|
5159
5201
|
};
|
|
5160
|
-
return /* @__PURE__ */
|
|
5202
|
+
return /* @__PURE__ */ jsx336(context_default.Provider, { value: ctxValue, children: /* @__PURE__ */ jsxs216(
|
|
5161
5203
|
"div",
|
|
5162
5204
|
{
|
|
5163
5205
|
className: clsx_default(
|
|
@@ -5192,7 +5234,7 @@ var SelectRoot = (props) => {
|
|
|
5192
5234
|
}
|
|
5193
5235
|
},
|
|
5194
5236
|
children: [
|
|
5195
|
-
/* @__PURE__ */
|
|
5237
|
+
/* @__PURE__ */ jsx336(
|
|
5196
5238
|
"span",
|
|
5197
5239
|
{
|
|
5198
5240
|
className: clsx_default(
|
|
@@ -5202,25 +5244,25 @@ var SelectRoot = (props) => {
|
|
|
5202
5244
|
children: selectedLabel ?? placeholder
|
|
5203
5245
|
}
|
|
5204
5246
|
),
|
|
5205
|
-
/* @__PURE__ */
|
|
5247
|
+
/* @__PURE__ */ jsx336(
|
|
5206
5248
|
"span",
|
|
5207
5249
|
{
|
|
5208
5250
|
className: clsx_default("select-trigger-icon", isOpen && "open"),
|
|
5209
5251
|
"aria-hidden": true,
|
|
5210
|
-
children: /* @__PURE__ */
|
|
5252
|
+
children: /* @__PURE__ */ jsx336(ChevronDownIcon_default, {})
|
|
5211
5253
|
}
|
|
5212
5254
|
)
|
|
5213
5255
|
]
|
|
5214
5256
|
}
|
|
5215
5257
|
),
|
|
5216
|
-
mounted && /* @__PURE__ */
|
|
5258
|
+
mounted && /* @__PURE__ */ jsx336(Portal_default, { children: /* @__PURE__ */ jsx336(
|
|
5217
5259
|
"div",
|
|
5218
5260
|
{
|
|
5219
5261
|
className: clsx_default("lib-xplat-select-content", size, position.direction, stateClass),
|
|
5220
5262
|
ref: contentRef,
|
|
5221
5263
|
style: { ...position.position, width: triggerRef.current?.offsetWidth },
|
|
5222
5264
|
role: "listbox",
|
|
5223
|
-
children: /* @__PURE__ */
|
|
5265
|
+
children: /* @__PURE__ */ jsx336(context_default.Provider, { value: ctxValue, children: itemChildren })
|
|
5224
5266
|
}
|
|
5225
5267
|
) })
|
|
5226
5268
|
]
|
|
@@ -5234,7 +5276,7 @@ var Select = Object.assign(SelectRoot, {
|
|
|
5234
5276
|
var Select_default = Select;
|
|
5235
5277
|
|
|
5236
5278
|
// src/components/Skeleton/Skeleton.tsx
|
|
5237
|
-
import { jsx as
|
|
5279
|
+
import { jsx as jsx337 } from "react/jsx-runtime";
|
|
5238
5280
|
var SIZE_MAP = {
|
|
5239
5281
|
xs: "var(--spacing-size-1)",
|
|
5240
5282
|
sm: "var(--spacing-size-2)",
|
|
@@ -5250,7 +5292,7 @@ var Skeleton = (props) => {
|
|
|
5250
5292
|
...width != null && { width: SIZE_MAP[width] },
|
|
5251
5293
|
...height != null && { height: SIZE_MAP[height] }
|
|
5252
5294
|
};
|
|
5253
|
-
return /* @__PURE__ */
|
|
5295
|
+
return /* @__PURE__ */ jsx337(
|
|
5254
5296
|
"div",
|
|
5255
5297
|
{
|
|
5256
5298
|
className: clsx_default("lib-xplat-skeleton", variant),
|
|
@@ -5263,20 +5305,20 @@ Skeleton.displayName = "Skeleton";
|
|
|
5263
5305
|
var Skeleton_default = Skeleton;
|
|
5264
5306
|
|
|
5265
5307
|
// src/components/Spinner/Spinner.tsx
|
|
5266
|
-
import { jsx as
|
|
5308
|
+
import { jsx as jsx338, jsxs as jsxs217 } from "react/jsx-runtime";
|
|
5267
5309
|
var Spinner = (props) => {
|
|
5268
5310
|
const {
|
|
5269
5311
|
size = "md",
|
|
5270
5312
|
type = "brand"
|
|
5271
5313
|
} = props;
|
|
5272
|
-
return /* @__PURE__ */
|
|
5314
|
+
return /* @__PURE__ */ jsx338(
|
|
5273
5315
|
"div",
|
|
5274
5316
|
{
|
|
5275
5317
|
className: clsx_default("lib-xplat-spinner", size, type),
|
|
5276
5318
|
role: "status",
|
|
5277
5319
|
"aria-label": "\uB85C\uB529 \uC911",
|
|
5278
5320
|
children: /* @__PURE__ */ jsxs217("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
5279
|
-
/* @__PURE__ */
|
|
5321
|
+
/* @__PURE__ */ jsx338(
|
|
5280
5322
|
"circle",
|
|
5281
5323
|
{
|
|
5282
5324
|
className: "track",
|
|
@@ -5286,7 +5328,7 @@ var Spinner = (props) => {
|
|
|
5286
5328
|
strokeWidth: "3"
|
|
5287
5329
|
}
|
|
5288
5330
|
),
|
|
5289
|
-
/* @__PURE__ */
|
|
5331
|
+
/* @__PURE__ */ jsx338(
|
|
5290
5332
|
"circle",
|
|
5291
5333
|
{
|
|
5292
5334
|
className: "indicator",
|
|
@@ -5305,20 +5347,20 @@ Spinner.displayName = "Spinner";
|
|
|
5305
5347
|
var Spinner_default = Spinner;
|
|
5306
5348
|
|
|
5307
5349
|
// src/components/Steps/Steps.tsx
|
|
5308
|
-
import { jsx as
|
|
5350
|
+
import { jsx as jsx339, jsxs as jsxs218 } from "react/jsx-runtime";
|
|
5309
5351
|
var Steps = (props) => {
|
|
5310
5352
|
const {
|
|
5311
5353
|
items,
|
|
5312
5354
|
current,
|
|
5313
5355
|
type = "brand"
|
|
5314
5356
|
} = props;
|
|
5315
|
-
return /* @__PURE__ */
|
|
5357
|
+
return /* @__PURE__ */ jsx339("div", { className: clsx_default("lib-xplat-steps", type), children: items.map((item, index) => {
|
|
5316
5358
|
const status = index < current ? "completed" : index === current ? "active" : "pending";
|
|
5317
5359
|
return /* @__PURE__ */ jsxs218("div", { className: clsx_default("step-item", status), children: [
|
|
5318
|
-
/* @__PURE__ */
|
|
5360
|
+
/* @__PURE__ */ jsx339("div", { className: "step-circle", children: status === "completed" ? /* @__PURE__ */ jsx339(CheckIcon_default, {}) : /* @__PURE__ */ jsx339("span", { children: index + 1 }) }),
|
|
5319
5361
|
/* @__PURE__ */ jsxs218("div", { className: "step-content", children: [
|
|
5320
|
-
/* @__PURE__ */
|
|
5321
|
-
item.description && /* @__PURE__ */
|
|
5362
|
+
/* @__PURE__ */ jsx339("span", { className: "step-title", children: item.title }),
|
|
5363
|
+
item.description && /* @__PURE__ */ jsx339("span", { className: "step-description", children: item.description })
|
|
5322
5364
|
] })
|
|
5323
5365
|
] }, index);
|
|
5324
5366
|
}) });
|
|
@@ -5327,8 +5369,8 @@ Steps.displayName = "Steps";
|
|
|
5327
5369
|
var Steps_default = Steps;
|
|
5328
5370
|
|
|
5329
5371
|
// src/components/Swiper/Swiper.tsx
|
|
5330
|
-
import
|
|
5331
|
-
import { jsx as
|
|
5372
|
+
import React32 from "react";
|
|
5373
|
+
import { jsx as jsx340, jsxs as jsxs219 } from "react/jsx-runtime";
|
|
5332
5374
|
var Swiper = (props) => {
|
|
5333
5375
|
const {
|
|
5334
5376
|
auto = false,
|
|
@@ -5352,26 +5394,26 @@ var Swiper = (props) => {
|
|
|
5352
5394
|
const maxIndex = Math.max(0, totalSlides - viewItemCount);
|
|
5353
5395
|
const useLoop = loop && canSlide;
|
|
5354
5396
|
const cloneCount = useLoop ? totalSlides : 0;
|
|
5355
|
-
const extendedItems =
|
|
5397
|
+
const extendedItems = React32.useMemo(() => {
|
|
5356
5398
|
if (!useLoop) return items;
|
|
5357
5399
|
return [...items, ...items, ...items];
|
|
5358
5400
|
}, [items, useLoop]);
|
|
5359
5401
|
const initialIdx = Math.max(0, Math.min(indexProp ?? 0, maxIndex));
|
|
5360
|
-
const [innerIndex, setInnerIndex] =
|
|
5402
|
+
const [innerIndex, setInnerIndex] = React32.useState(
|
|
5361
5403
|
useLoop ? cloneCount + initialIdx : initialIdx
|
|
5362
5404
|
);
|
|
5363
|
-
const [isDragging, setIsDragging] =
|
|
5364
|
-
const [dragOffset, setDragOffset] =
|
|
5365
|
-
const [animated, setAnimated] =
|
|
5366
|
-
const [containerWidth, setContainerWidth] =
|
|
5367
|
-
const containerRef =
|
|
5368
|
-
const startXRef =
|
|
5369
|
-
const startTimeRef =
|
|
5370
|
-
const autoplayTimerRef =
|
|
5371
|
-
const resumeTimeoutRef =
|
|
5372
|
-
const [paused, setPaused] =
|
|
5373
|
-
const initializedRef =
|
|
5374
|
-
|
|
5405
|
+
const [isDragging, setIsDragging] = React32.useState(false);
|
|
5406
|
+
const [dragOffset, setDragOffset] = React32.useState(0);
|
|
5407
|
+
const [animated, setAnimated] = React32.useState(false);
|
|
5408
|
+
const [containerWidth, setContainerWidth] = React32.useState(0);
|
|
5409
|
+
const containerRef = React32.useRef(null);
|
|
5410
|
+
const startXRef = React32.useRef(0);
|
|
5411
|
+
const startTimeRef = React32.useRef(0);
|
|
5412
|
+
const autoplayTimerRef = React32.useRef(null);
|
|
5413
|
+
const resumeTimeoutRef = React32.useRef(null);
|
|
5414
|
+
const [paused, setPaused] = React32.useState(false);
|
|
5415
|
+
const initializedRef = React32.useRef(false);
|
|
5416
|
+
React32.useEffect(() => {
|
|
5375
5417
|
const el = containerRef.current;
|
|
5376
5418
|
if (!el) return;
|
|
5377
5419
|
const ro = new ResizeObserver((entries) => {
|
|
@@ -5394,7 +5436,7 @@ var Swiper = (props) => {
|
|
|
5394
5436
|
return ((inner - cloneCount) % totalSlides + totalSlides) % totalSlides;
|
|
5395
5437
|
};
|
|
5396
5438
|
const realIndex = getRealIndex(innerIndex);
|
|
5397
|
-
const moveToInner =
|
|
5439
|
+
const moveToInner = React32.useCallback(
|
|
5398
5440
|
(idx, withAnim = true) => {
|
|
5399
5441
|
if (!useLoop) {
|
|
5400
5442
|
setAnimated(withAnim);
|
|
@@ -5422,7 +5464,7 @@ var Swiper = (props) => {
|
|
|
5422
5464
|
},
|
|
5423
5465
|
[useLoop, cloneCount, totalSlides]
|
|
5424
5466
|
);
|
|
5425
|
-
const handleTransitionEnd =
|
|
5467
|
+
const handleTransitionEnd = React32.useCallback(() => {
|
|
5426
5468
|
if (!useLoop) return;
|
|
5427
5469
|
const real = getRealIndex(innerIndex);
|
|
5428
5470
|
const canonical = cloneCount + real;
|
|
@@ -5432,7 +5474,7 @@ var Swiper = (props) => {
|
|
|
5432
5474
|
}
|
|
5433
5475
|
onChange?.(Math.min(real, maxIndex));
|
|
5434
5476
|
}, [useLoop, innerIndex, cloneCount, totalSlides, maxIndex, onChange]);
|
|
5435
|
-
const slideTo =
|
|
5477
|
+
const slideTo = React32.useCallback(
|
|
5436
5478
|
(logicalIndex) => {
|
|
5437
5479
|
if (!canSlide) return;
|
|
5438
5480
|
const clamped = useLoop ? logicalIndex : Math.max(0, Math.min(logicalIndex, maxIndex));
|
|
@@ -5442,7 +5484,7 @@ var Swiper = (props) => {
|
|
|
5442
5484
|
},
|
|
5443
5485
|
[canSlide, useLoop, cloneCount, maxIndex, onChange, moveToInner]
|
|
5444
5486
|
);
|
|
5445
|
-
const slideNext =
|
|
5487
|
+
const slideNext = React32.useCallback(() => {
|
|
5446
5488
|
if (!canSlide) return;
|
|
5447
5489
|
const nextInner = innerIndex + slideBy;
|
|
5448
5490
|
if (useLoop) {
|
|
@@ -5451,7 +5493,7 @@ var Swiper = (props) => {
|
|
|
5451
5493
|
moveToInner(Math.min(nextInner, maxIndex), true);
|
|
5452
5494
|
}
|
|
5453
5495
|
}, [canSlide, useLoop, innerIndex, slideBy, maxIndex, moveToInner]);
|
|
5454
|
-
const slidePrev =
|
|
5496
|
+
const slidePrev = React32.useCallback(() => {
|
|
5455
5497
|
if (!canSlide) return;
|
|
5456
5498
|
const prevInner = innerIndex - slideBy;
|
|
5457
5499
|
if (useLoop) {
|
|
@@ -5460,7 +5502,7 @@ var Swiper = (props) => {
|
|
|
5460
5502
|
moveToInner(Math.max(prevInner, 0), true);
|
|
5461
5503
|
}
|
|
5462
5504
|
}, [canSlide, useLoop, innerIndex, slideBy, moveToInner]);
|
|
5463
|
-
|
|
5505
|
+
React32.useEffect(() => {
|
|
5464
5506
|
if (indexProp === void 0) return;
|
|
5465
5507
|
const clamped = Math.max(0, Math.min(indexProp, maxIndex));
|
|
5466
5508
|
const target = useLoop ? cloneCount + clamped : clamped;
|
|
@@ -5468,12 +5510,12 @@ var Swiper = (props) => {
|
|
|
5468
5510
|
moveToInner(target, true);
|
|
5469
5511
|
}
|
|
5470
5512
|
}, [indexProp]);
|
|
5471
|
-
|
|
5513
|
+
React32.useImperativeHandle(swiperRef, () => ({
|
|
5472
5514
|
slidePrev,
|
|
5473
5515
|
slideNext,
|
|
5474
5516
|
slideTo
|
|
5475
5517
|
}));
|
|
5476
|
-
|
|
5518
|
+
React32.useEffect(() => {
|
|
5477
5519
|
if (!auto || !canSlide || paused) return;
|
|
5478
5520
|
autoplayTimerRef.current = setInterval(slideNext, autoplayDelay);
|
|
5479
5521
|
return () => {
|
|
@@ -5499,7 +5541,7 @@ var Swiper = (props) => {
|
|
|
5499
5541
|
resumeTimeoutRef.current = null;
|
|
5500
5542
|
}, pauseOnInteraction);
|
|
5501
5543
|
};
|
|
5502
|
-
|
|
5544
|
+
React32.useEffect(() => {
|
|
5503
5545
|
return () => {
|
|
5504
5546
|
if (resumeTimeoutRef.current) clearTimeout(resumeTimeoutRef.current);
|
|
5505
5547
|
};
|
|
@@ -5517,7 +5559,7 @@ var Swiper = (props) => {
|
|
|
5517
5559
|
startXRef.current = getClientX(e);
|
|
5518
5560
|
startTimeRef.current = Date.now();
|
|
5519
5561
|
};
|
|
5520
|
-
|
|
5562
|
+
React32.useEffect(() => {
|
|
5521
5563
|
if (!isDragging) return;
|
|
5522
5564
|
const handleMove = (e) => {
|
|
5523
5565
|
setDragOffset(getClientX(e) - startXRef.current);
|
|
@@ -5556,8 +5598,8 @@ var Swiper = (props) => {
|
|
|
5556
5598
|
}, [isDragging, dragOffset, innerIndex, useLoop, maxIndex, slideStep, moveToInner]);
|
|
5557
5599
|
const slideWidthPercent = 100 / viewItemCount;
|
|
5558
5600
|
const gapAdjust = spaceBetween * (viewItemCount - 1) / viewItemCount;
|
|
5559
|
-
const slideElements =
|
|
5560
|
-
() => extendedItems.map((item, idx) => /* @__PURE__ */
|
|
5601
|
+
const slideElements = React32.useMemo(
|
|
5602
|
+
() => extendedItems.map((item, idx) => /* @__PURE__ */ jsx340(
|
|
5561
5603
|
"div",
|
|
5562
5604
|
{
|
|
5563
5605
|
className: "lib-xplat-swiper__slide",
|
|
@@ -5577,14 +5619,14 @@ var Swiper = (props) => {
|
|
|
5577
5619
|
totalSteps - 1
|
|
5578
5620
|
);
|
|
5579
5621
|
return /* @__PURE__ */ jsxs219("div", { className: "lib-xplat-swiper", ref: containerRef, children: [
|
|
5580
|
-
/* @__PURE__ */
|
|
5622
|
+
/* @__PURE__ */ jsx340(
|
|
5581
5623
|
"div",
|
|
5582
5624
|
{
|
|
5583
5625
|
className: "lib-xplat-swiper__viewport",
|
|
5584
5626
|
onMouseDown: handleDragStart,
|
|
5585
5627
|
onTouchStart: handleDragStart,
|
|
5586
5628
|
onDragStart: (e) => e.preventDefault(),
|
|
5587
|
-
children: /* @__PURE__ */
|
|
5629
|
+
children: /* @__PURE__ */ jsx340(
|
|
5588
5630
|
"div",
|
|
5589
5631
|
{
|
|
5590
5632
|
className: clsx_default(
|
|
@@ -5602,7 +5644,7 @@ var Swiper = (props) => {
|
|
|
5602
5644
|
)
|
|
5603
5645
|
}
|
|
5604
5646
|
),
|
|
5605
|
-
showProgress && canSlide && /* @__PURE__ */
|
|
5647
|
+
showProgress && canSlide && /* @__PURE__ */ jsx340("div", { className: "lib-xplat-swiper__progress", children: /* @__PURE__ */ jsx340("div", { className: "lib-xplat-swiper__progress-track", children: /* @__PURE__ */ jsx340(
|
|
5606
5648
|
"span",
|
|
5607
5649
|
{
|
|
5608
5650
|
className: "lib-xplat-swiper__progress-fill",
|
|
@@ -5612,7 +5654,7 @@ var Swiper = (props) => {
|
|
|
5612
5654
|
}
|
|
5613
5655
|
}
|
|
5614
5656
|
) }) }),
|
|
5615
|
-
canSlide && /* @__PURE__ */
|
|
5657
|
+
canSlide && /* @__PURE__ */ jsx340("div", { className: "lib-xplat-swiper__dots", children: Array.from({ length: totalSteps }, (_, i) => /* @__PURE__ */ jsx340(
|
|
5616
5658
|
"button",
|
|
5617
5659
|
{
|
|
5618
5660
|
className: clsx_default(
|
|
@@ -5630,8 +5672,8 @@ Swiper.displayName = "Swiper";
|
|
|
5630
5672
|
var Swiper_default = Swiper;
|
|
5631
5673
|
|
|
5632
5674
|
// src/components/Switch/Switch.tsx
|
|
5633
|
-
import
|
|
5634
|
-
import { jsx as
|
|
5675
|
+
import React33 from "react";
|
|
5676
|
+
import { jsx as jsx341 } from "react/jsx-runtime";
|
|
5635
5677
|
var KNOB_TRANSITION_MS = 250;
|
|
5636
5678
|
var Switch = (props) => {
|
|
5637
5679
|
const {
|
|
@@ -5641,9 +5683,9 @@ var Switch = (props) => {
|
|
|
5641
5683
|
disabled,
|
|
5642
5684
|
onChange
|
|
5643
5685
|
} = props;
|
|
5644
|
-
const [isAnimating, setIsAnimating] =
|
|
5645
|
-
const timeoutRef =
|
|
5646
|
-
|
|
5686
|
+
const [isAnimating, setIsAnimating] = React33.useState(false);
|
|
5687
|
+
const timeoutRef = React33.useRef(null);
|
|
5688
|
+
React33.useEffect(() => {
|
|
5647
5689
|
return () => {
|
|
5648
5690
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
5649
5691
|
};
|
|
@@ -5658,7 +5700,7 @@ var Switch = (props) => {
|
|
|
5658
5700
|
timeoutRef.current = null;
|
|
5659
5701
|
}, KNOB_TRANSITION_MS);
|
|
5660
5702
|
};
|
|
5661
|
-
return /* @__PURE__ */
|
|
5703
|
+
return /* @__PURE__ */ jsx341(
|
|
5662
5704
|
"div",
|
|
5663
5705
|
{
|
|
5664
5706
|
className: clsx_default(
|
|
@@ -5671,7 +5713,7 @@ var Switch = (props) => {
|
|
|
5671
5713
|
),
|
|
5672
5714
|
onClick: handleClick,
|
|
5673
5715
|
"aria-disabled": disabled || isAnimating,
|
|
5674
|
-
children: /* @__PURE__ */
|
|
5716
|
+
children: /* @__PURE__ */ jsx341("div", { className: clsx_default("knob", value ? "checked" : void 0) })
|
|
5675
5717
|
}
|
|
5676
5718
|
);
|
|
5677
5719
|
};
|
|
@@ -5679,17 +5721,17 @@ Switch.displayName = "Switch";
|
|
|
5679
5721
|
var Switch_default = Switch;
|
|
5680
5722
|
|
|
5681
5723
|
// src/components/Table/TableContext.tsx
|
|
5682
|
-
import
|
|
5683
|
-
var TableContext =
|
|
5724
|
+
import React34 from "react";
|
|
5725
|
+
var TableContext = React34.createContext(null);
|
|
5684
5726
|
var useTableContext = () => {
|
|
5685
|
-
const ctx =
|
|
5727
|
+
const ctx = React34.useContext(TableContext);
|
|
5686
5728
|
if (!ctx) throw new Error("Table components must be used inside <Table>");
|
|
5687
5729
|
return ctx;
|
|
5688
5730
|
};
|
|
5689
5731
|
var TableContext_default = TableContext;
|
|
5690
5732
|
|
|
5691
5733
|
// src/components/Table/Table.tsx
|
|
5692
|
-
import { jsx as
|
|
5734
|
+
import { jsx as jsx342 } from "react/jsx-runtime";
|
|
5693
5735
|
var Table = (props) => {
|
|
5694
5736
|
const {
|
|
5695
5737
|
children,
|
|
@@ -5699,7 +5741,7 @@ var Table = (props) => {
|
|
|
5699
5741
|
headerSticky = false,
|
|
5700
5742
|
stickyShadow = true
|
|
5701
5743
|
} = props;
|
|
5702
|
-
return /* @__PURE__ */
|
|
5744
|
+
return /* @__PURE__ */ jsx342("div", { className: `lib-xplat-table-wrapper ${size}`, children: /* @__PURE__ */ jsx342(
|
|
5703
5745
|
TableContext_default.Provider,
|
|
5704
5746
|
{
|
|
5705
5747
|
value: {
|
|
@@ -5708,7 +5750,7 @@ var Table = (props) => {
|
|
|
5708
5750
|
headerSticky,
|
|
5709
5751
|
stickyShadow
|
|
5710
5752
|
},
|
|
5711
|
-
children: /* @__PURE__ */
|
|
5753
|
+
children: /* @__PURE__ */ jsx342("table", { className: "lib-xplat-table", children })
|
|
5712
5754
|
}
|
|
5713
5755
|
) });
|
|
5714
5756
|
};
|
|
@@ -5716,41 +5758,41 @@ Table.displayName = "Table";
|
|
|
5716
5758
|
var Table_default = Table;
|
|
5717
5759
|
|
|
5718
5760
|
// src/components/Table/TableBody.tsx
|
|
5719
|
-
import { jsx as
|
|
5761
|
+
import { jsx as jsx343 } from "react/jsx-runtime";
|
|
5720
5762
|
var TableBody = (props) => {
|
|
5721
5763
|
const { children } = props;
|
|
5722
|
-
return /* @__PURE__ */
|
|
5764
|
+
return /* @__PURE__ */ jsx343("tbody", { children });
|
|
5723
5765
|
};
|
|
5724
5766
|
TableBody.displayName = "TableBody";
|
|
5725
5767
|
var TableBody_default = TableBody;
|
|
5726
5768
|
|
|
5727
5769
|
// src/components/Table/TableCell.tsx
|
|
5728
|
-
import
|
|
5770
|
+
import React37 from "react";
|
|
5729
5771
|
|
|
5730
5772
|
// src/components/Table/TableHeadContext.tsx
|
|
5731
|
-
import
|
|
5732
|
-
var TableHeadContext =
|
|
5773
|
+
import React35 from "react";
|
|
5774
|
+
var TableHeadContext = React35.createContext(
|
|
5733
5775
|
null
|
|
5734
5776
|
);
|
|
5735
5777
|
var useTableHeadContext = () => {
|
|
5736
|
-
const ctx =
|
|
5778
|
+
const ctx = React35.useContext(TableHeadContext);
|
|
5737
5779
|
return ctx;
|
|
5738
5780
|
};
|
|
5739
5781
|
var TableHeadContext_default = TableHeadContext;
|
|
5740
5782
|
|
|
5741
5783
|
// src/components/Table/TableRowContext.tsx
|
|
5742
|
-
import
|
|
5743
|
-
var TableRowContext =
|
|
5784
|
+
import React36 from "react";
|
|
5785
|
+
var TableRowContext = React36.createContext(null);
|
|
5744
5786
|
var useTableRowContext = () => {
|
|
5745
|
-
const ctx =
|
|
5787
|
+
const ctx = React36.useContext(TableRowContext);
|
|
5746
5788
|
if (!ctx) throw new Error("Table components must be used inside <Table>");
|
|
5747
5789
|
return ctx;
|
|
5748
5790
|
};
|
|
5749
5791
|
var TableRowContext_default = TableRowContext;
|
|
5750
5792
|
|
|
5751
5793
|
// src/components/Table/TableCell.tsx
|
|
5752
|
-
import { jsx as
|
|
5753
|
-
var TableCell =
|
|
5794
|
+
import { jsx as jsx344 } from "react/jsx-runtime";
|
|
5795
|
+
var TableCell = React37.memo((props) => {
|
|
5754
5796
|
const {
|
|
5755
5797
|
children,
|
|
5756
5798
|
align = "center",
|
|
@@ -5762,9 +5804,9 @@ var TableCell = React36.memo((props) => {
|
|
|
5762
5804
|
const { registerStickyCell, stickyCells } = useTableRowContext();
|
|
5763
5805
|
const { stickyShadow } = useTableContext();
|
|
5764
5806
|
const headContext = useTableHeadContext();
|
|
5765
|
-
const [left, setLeft] =
|
|
5766
|
-
const cellRef =
|
|
5767
|
-
const calculateLeft =
|
|
5807
|
+
const [left, setLeft] = React37.useState(0);
|
|
5808
|
+
const cellRef = React37.useRef(null);
|
|
5809
|
+
const calculateLeft = React37.useCallback(() => {
|
|
5768
5810
|
if (!cellRef.current) return 0;
|
|
5769
5811
|
let totalLeft = 0;
|
|
5770
5812
|
for (const ref of stickyCells) {
|
|
@@ -5773,7 +5815,7 @@ var TableCell = React36.memo((props) => {
|
|
|
5773
5815
|
}
|
|
5774
5816
|
return totalLeft;
|
|
5775
5817
|
}, [stickyCells]);
|
|
5776
|
-
|
|
5818
|
+
React37.useEffect(() => {
|
|
5777
5819
|
if (!isSticky || !cellRef.current) return;
|
|
5778
5820
|
registerStickyCell(cellRef);
|
|
5779
5821
|
setLeft(calculateLeft());
|
|
@@ -5791,7 +5833,7 @@ var TableCell = React36.memo((props) => {
|
|
|
5791
5833
|
const CellTag = cellRef.current?.tagName === "TH" ? "th" : "td";
|
|
5792
5834
|
const isLastSticky = isSticky && stickyCells[stickyCells.length - 1] === cellRef;
|
|
5793
5835
|
const enableHover = headContext && headContext.cellHover;
|
|
5794
|
-
return /* @__PURE__ */
|
|
5836
|
+
return /* @__PURE__ */ jsx344(
|
|
5795
5837
|
CellTag,
|
|
5796
5838
|
{
|
|
5797
5839
|
ref: cellRef,
|
|
@@ -5816,21 +5858,21 @@ TableCell.displayName = "TableCell";
|
|
|
5816
5858
|
var TableCell_default = TableCell;
|
|
5817
5859
|
|
|
5818
5860
|
// src/components/Table/TableHead.tsx
|
|
5819
|
-
import { jsx as
|
|
5861
|
+
import { jsx as jsx345 } from "react/jsx-runtime";
|
|
5820
5862
|
var TableHead = ({
|
|
5821
5863
|
children,
|
|
5822
5864
|
cellHover = false
|
|
5823
5865
|
}) => {
|
|
5824
5866
|
const { headerSticky } = useTableContext();
|
|
5825
|
-
return /* @__PURE__ */
|
|
5867
|
+
return /* @__PURE__ */ jsx345(TableHeadContext_default.Provider, { value: { cellHover }, children: /* @__PURE__ */ jsx345("thead", { className: clsx_default(headerSticky ? "table-sticky" : null), children }) });
|
|
5826
5868
|
};
|
|
5827
5869
|
TableHead.displayName = "TableHead";
|
|
5828
5870
|
var TableHead_default = TableHead;
|
|
5829
5871
|
|
|
5830
5872
|
// src/components/Table/TableRow.tsx
|
|
5831
|
-
import
|
|
5832
|
-
import { jsx as
|
|
5833
|
-
var TableRow =
|
|
5873
|
+
import React38 from "react";
|
|
5874
|
+
import { jsx as jsx346 } from "react/jsx-runtime";
|
|
5875
|
+
var TableRow = React38.memo((props) => {
|
|
5834
5876
|
const {
|
|
5835
5877
|
children,
|
|
5836
5878
|
type = "secondary",
|
|
@@ -5839,14 +5881,14 @@ var TableRow = React37.memo((props) => {
|
|
|
5839
5881
|
onClick
|
|
5840
5882
|
} = props;
|
|
5841
5883
|
const { rowBorderUse } = useTableContext();
|
|
5842
|
-
const [stickyCells, setStickyCells] =
|
|
5884
|
+
const [stickyCells, setStickyCells] = React38.useState([]);
|
|
5843
5885
|
const registerStickyCell = (ref) => {
|
|
5844
5886
|
setStickyCells((prev) => {
|
|
5845
5887
|
if (prev.includes(ref)) return prev;
|
|
5846
5888
|
return [...prev, ref];
|
|
5847
5889
|
});
|
|
5848
5890
|
};
|
|
5849
|
-
return /* @__PURE__ */
|
|
5891
|
+
return /* @__PURE__ */ jsx346(TableRowContext_default.Provider, { value: { stickyCells, registerStickyCell }, children: /* @__PURE__ */ jsx346(
|
|
5850
5892
|
"tr",
|
|
5851
5893
|
{
|
|
5852
5894
|
className: clsx_default(
|
|
@@ -5870,7 +5912,7 @@ TableRow.displayName = "TableRow";
|
|
|
5870
5912
|
var TableRow_default = TableRow;
|
|
5871
5913
|
|
|
5872
5914
|
// src/components/Tag/Tag.tsx
|
|
5873
|
-
import { jsx as
|
|
5915
|
+
import { jsx as jsx347, jsxs as jsxs220 } from "react/jsx-runtime";
|
|
5874
5916
|
var Tag = (props) => {
|
|
5875
5917
|
const {
|
|
5876
5918
|
children,
|
|
@@ -5891,8 +5933,8 @@ var Tag = (props) => {
|
|
|
5891
5933
|
disabled && "disabled"
|
|
5892
5934
|
),
|
|
5893
5935
|
children: [
|
|
5894
|
-
/* @__PURE__ */
|
|
5895
|
-
onClose && /* @__PURE__ */
|
|
5936
|
+
/* @__PURE__ */ jsx347("span", { className: "tag-label", children }),
|
|
5937
|
+
onClose && /* @__PURE__ */ jsx347("button", { className: "tag-close", onClick: onClose, "aria-label": "\uC0AD\uC81C", disabled, children: /* @__PURE__ */ jsx347(XIcon_default, {}) })
|
|
5896
5938
|
]
|
|
5897
5939
|
}
|
|
5898
5940
|
);
|
|
@@ -5901,55 +5943,27 @@ Tag.displayName = "Tag";
|
|
|
5901
5943
|
var Tag_default = Tag;
|
|
5902
5944
|
|
|
5903
5945
|
// src/components/TextArea/TextArea.tsx
|
|
5904
|
-
import
|
|
5905
|
-
import { jsx as
|
|
5906
|
-
var TextArea =
|
|
5946
|
+
import React39 from "react";
|
|
5947
|
+
import { jsx as jsx348 } from "react/jsx-runtime";
|
|
5948
|
+
var TextArea = React39.forwardRef(
|
|
5907
5949
|
(props, ref) => {
|
|
5908
|
-
const {
|
|
5909
|
-
|
|
5910
|
-
|
|
5911
|
-
|
|
5912
|
-
|
|
5913
|
-
|
|
5914
|
-
|
|
5915
|
-
|
|
5916
|
-
|
|
5917
|
-
|
|
5918
|
-
};
|
|
5919
|
-
const handleOnChange = (e) => {
|
|
5920
|
-
const val = e.target.value;
|
|
5921
|
-
if (onChange) {
|
|
5922
|
-
const event = {
|
|
5923
|
-
...e,
|
|
5924
|
-
target: { value: val }
|
|
5925
|
-
};
|
|
5926
|
-
onChange(event);
|
|
5927
|
-
}
|
|
5928
|
-
};
|
|
5929
|
-
React38.useEffect(() => {
|
|
5930
|
-
const el = localRef.current;
|
|
5931
|
-
if (!el) return;
|
|
5932
|
-
el.style.height = "0px";
|
|
5933
|
-
const nextHeight = Math.min(el.scrollHeight, 400);
|
|
5934
|
-
el.style.height = `${nextHeight}px`;
|
|
5935
|
-
}, [value]);
|
|
5936
|
-
return /* @__PURE__ */ jsx347("div", { className: clsx_default("lib-xplat-textarea-wrapper", className), children: /* @__PURE__ */ jsx347(
|
|
5937
|
-
"div",
|
|
5950
|
+
const {
|
|
5951
|
+
className,
|
|
5952
|
+
size = "md",
|
|
5953
|
+
resize = "vertical",
|
|
5954
|
+
rows = 3,
|
|
5955
|
+
disabled,
|
|
5956
|
+
...textareaProps
|
|
5957
|
+
} = props;
|
|
5958
|
+
return /* @__PURE__ */ jsx348("div", { className: clsx_default("lib-xplat-textarea-wrap", className), children: /* @__PURE__ */ jsx348(
|
|
5959
|
+
"textarea",
|
|
5938
5960
|
{
|
|
5939
|
-
|
|
5940
|
-
|
|
5941
|
-
|
|
5942
|
-
|
|
5943
|
-
|
|
5944
|
-
|
|
5945
|
-
{
|
|
5946
|
-
...textareaProps,
|
|
5947
|
-
ref: setRefs,
|
|
5948
|
-
disabled,
|
|
5949
|
-
value,
|
|
5950
|
-
onChange: handleOnChange
|
|
5951
|
-
}
|
|
5952
|
-
)
|
|
5961
|
+
...textareaProps,
|
|
5962
|
+
ref,
|
|
5963
|
+
rows,
|
|
5964
|
+
disabled,
|
|
5965
|
+
className: clsx_default("lib-xplat-textarea", size, disabled && "disabled"),
|
|
5966
|
+
style: { resize }
|
|
5953
5967
|
}
|
|
5954
5968
|
) });
|
|
5955
5969
|
}
|
|
@@ -5958,25 +5972,25 @@ TextArea.displayName = "TextArea";
|
|
|
5958
5972
|
var TextArea_default = TextArea;
|
|
5959
5973
|
|
|
5960
5974
|
// src/components/Toast/Toast.tsx
|
|
5961
|
-
import
|
|
5975
|
+
import React40 from "react";
|
|
5962
5976
|
import { createPortal as createPortal3 } from "react-dom";
|
|
5963
|
-
import { jsx as
|
|
5964
|
-
var ToastContext =
|
|
5977
|
+
import { jsx as jsx349, jsxs as jsxs221 } from "react/jsx-runtime";
|
|
5978
|
+
var ToastContext = React40.createContext(null);
|
|
5965
5979
|
var useToast = () => {
|
|
5966
|
-
const ctx =
|
|
5980
|
+
const ctx = React40.useContext(ToastContext);
|
|
5967
5981
|
if (!ctx) throw new Error("useToast must be used within ToastProvider");
|
|
5968
5982
|
return ctx;
|
|
5969
5983
|
};
|
|
5970
5984
|
var EXIT_DURATION = 300;
|
|
5971
5985
|
var ToastItemComponent = ({ item, isExiting, onClose }) => {
|
|
5972
|
-
const ref =
|
|
5973
|
-
const [height, setHeight] =
|
|
5974
|
-
|
|
5986
|
+
const ref = React40.useRef(null);
|
|
5987
|
+
const [height, setHeight] = React40.useState(void 0);
|
|
5988
|
+
React40.useEffect(() => {
|
|
5975
5989
|
if (ref.current && !isExiting) {
|
|
5976
5990
|
setHeight(ref.current.offsetHeight);
|
|
5977
5991
|
}
|
|
5978
5992
|
}, [isExiting]);
|
|
5979
|
-
return /* @__PURE__ */
|
|
5993
|
+
return /* @__PURE__ */ jsx349(
|
|
5980
5994
|
"div",
|
|
5981
5995
|
{
|
|
5982
5996
|
className: clsx_default("lib-xplat-toast-wrapper", { exit: isExiting }),
|
|
@@ -5991,8 +6005,8 @@ var ToastItemComponent = ({ item, isExiting, onClose }) => {
|
|
|
5991
6005
|
className: clsx_default("lib-xplat-toast", item.type, { exit: isExiting }),
|
|
5992
6006
|
role: "alert",
|
|
5993
6007
|
children: [
|
|
5994
|
-
/* @__PURE__ */
|
|
5995
|
-
/* @__PURE__ */
|
|
6008
|
+
/* @__PURE__ */ jsx349("span", { className: "message", children: item.message }),
|
|
6009
|
+
/* @__PURE__ */ jsx349("button", { className: "close-btn", onClick: onClose, "aria-label": "\uB2EB\uAE30", children: "\xD7" })
|
|
5996
6010
|
]
|
|
5997
6011
|
}
|
|
5998
6012
|
)
|
|
@@ -6003,13 +6017,13 @@ var ToastProvider = ({
|
|
|
6003
6017
|
children,
|
|
6004
6018
|
position = "top-right"
|
|
6005
6019
|
}) => {
|
|
6006
|
-
const [toasts, setToasts] =
|
|
6007
|
-
const [removing, setRemoving] =
|
|
6008
|
-
const [mounted, setMounted] =
|
|
6009
|
-
|
|
6020
|
+
const [toasts, setToasts] = React40.useState([]);
|
|
6021
|
+
const [removing, setRemoving] = React40.useState(/* @__PURE__ */ new Set());
|
|
6022
|
+
const [mounted, setMounted] = React40.useState(false);
|
|
6023
|
+
React40.useEffect(() => {
|
|
6010
6024
|
setMounted(true);
|
|
6011
6025
|
}, []);
|
|
6012
|
-
const remove =
|
|
6026
|
+
const remove = React40.useCallback((id) => {
|
|
6013
6027
|
setRemoving((prev) => new Set(prev).add(id));
|
|
6014
6028
|
setTimeout(() => {
|
|
6015
6029
|
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
@@ -6020,7 +6034,7 @@ var ToastProvider = ({
|
|
|
6020
6034
|
});
|
|
6021
6035
|
}, EXIT_DURATION);
|
|
6022
6036
|
}, []);
|
|
6023
|
-
const toast =
|
|
6037
|
+
const toast = React40.useCallback(
|
|
6024
6038
|
(type, message, duration = 3e3) => {
|
|
6025
6039
|
const id = `${Date.now()}-${Math.random()}`;
|
|
6026
6040
|
setToasts((prev) => [...prev, { id, type, message }]);
|
|
@@ -6033,7 +6047,7 @@ var ToastProvider = ({
|
|
|
6033
6047
|
return /* @__PURE__ */ jsxs221(ToastContext.Provider, { value: { toast }, children: [
|
|
6034
6048
|
children,
|
|
6035
6049
|
mounted && createPortal3(
|
|
6036
|
-
/* @__PURE__ */
|
|
6050
|
+
/* @__PURE__ */ jsx349("div", { className: clsx_default("lib-xplat-toast-container", position), children: toasts.map((t) => /* @__PURE__ */ jsx349(
|
|
6037
6051
|
ToastItemComponent,
|
|
6038
6052
|
{
|
|
6039
6053
|
item: t,
|
|
@@ -6049,8 +6063,8 @@ var ToastProvider = ({
|
|
|
6049
6063
|
ToastProvider.displayName = "ToastProvider";
|
|
6050
6064
|
|
|
6051
6065
|
// src/components/Tooltip/Tooltip.tsx
|
|
6052
|
-
import
|
|
6053
|
-
import { Fragment as Fragment5, jsx as
|
|
6066
|
+
import React41 from "react";
|
|
6067
|
+
import { Fragment as Fragment5, jsx as jsx350, jsxs as jsxs222 } from "react/jsx-runtime";
|
|
6054
6068
|
var OFFSET = 12;
|
|
6055
6069
|
var SHOW_DELAY = 300;
|
|
6056
6070
|
var Tooltip = (props) => {
|
|
@@ -6061,12 +6075,12 @@ var Tooltip = (props) => {
|
|
|
6061
6075
|
children,
|
|
6062
6076
|
disabled = false
|
|
6063
6077
|
} = props;
|
|
6064
|
-
const triggerRef =
|
|
6065
|
-
const tooltipRef =
|
|
6066
|
-
const [visible, setVisible] =
|
|
6067
|
-
const [pos, setPos] =
|
|
6068
|
-
const delayTimer =
|
|
6069
|
-
const calculatePos =
|
|
6078
|
+
const triggerRef = React41.useRef(null);
|
|
6079
|
+
const tooltipRef = React41.useRef(null);
|
|
6080
|
+
const [visible, setVisible] = React41.useState(false);
|
|
6081
|
+
const [pos, setPos] = React41.useState({ left: 0, top: 0 });
|
|
6082
|
+
const delayTimer = React41.useRef(0);
|
|
6083
|
+
const calculatePos = React41.useCallback((clientX, clientY) => {
|
|
6070
6084
|
const el = tooltipRef.current;
|
|
6071
6085
|
if (!el) return;
|
|
6072
6086
|
const w = el.offsetWidth;
|
|
@@ -6079,37 +6093,37 @@ var Tooltip = (props) => {
|
|
|
6079
6093
|
if (left < 8) left = 8;
|
|
6080
6094
|
setPos({ left, top });
|
|
6081
6095
|
}, []);
|
|
6082
|
-
const handleMouseEnter =
|
|
6096
|
+
const handleMouseEnter = React41.useCallback(() => {
|
|
6083
6097
|
if (disabled) return;
|
|
6084
6098
|
delayTimer.current = window.setTimeout(() => {
|
|
6085
6099
|
setVisible(true);
|
|
6086
6100
|
}, SHOW_DELAY);
|
|
6087
6101
|
}, [disabled]);
|
|
6088
|
-
const handleMouseMove =
|
|
6102
|
+
const handleMouseMove = React41.useCallback((e) => {
|
|
6089
6103
|
if (!visible) return;
|
|
6090
6104
|
calculatePos(e.clientX, e.clientY);
|
|
6091
6105
|
}, [visible, calculatePos]);
|
|
6092
|
-
const handleMouseLeave =
|
|
6106
|
+
const handleMouseLeave = React41.useCallback(() => {
|
|
6093
6107
|
window.clearTimeout(delayTimer.current);
|
|
6094
6108
|
setVisible(false);
|
|
6095
6109
|
}, []);
|
|
6096
|
-
const handleClick =
|
|
6110
|
+
const handleClick = React41.useCallback(() => {
|
|
6097
6111
|
window.clearTimeout(delayTimer.current);
|
|
6098
6112
|
setVisible(false);
|
|
6099
6113
|
}, []);
|
|
6100
|
-
const handleFocus =
|
|
6114
|
+
const handleFocus = React41.useCallback(() => {
|
|
6101
6115
|
if (disabled) return;
|
|
6102
6116
|
setVisible(true);
|
|
6103
6117
|
}, [disabled]);
|
|
6104
|
-
const handleBlur =
|
|
6118
|
+
const handleBlur = React41.useCallback(() => {
|
|
6105
6119
|
setVisible(false);
|
|
6106
6120
|
}, []);
|
|
6107
|
-
|
|
6121
|
+
React41.useLayoutEffect(() => {
|
|
6108
6122
|
if (!visible || !triggerRef.current) return;
|
|
6109
6123
|
const rect = triggerRef.current.getBoundingClientRect();
|
|
6110
6124
|
calculatePos(rect.right, rect.top);
|
|
6111
6125
|
}, [visible, calculatePos]);
|
|
6112
|
-
if (!title && !description) return /* @__PURE__ */
|
|
6126
|
+
if (!title && !description) return /* @__PURE__ */ jsx350(Fragment5, { children });
|
|
6113
6127
|
return /* @__PURE__ */ jsxs222(
|
|
6114
6128
|
"div",
|
|
6115
6129
|
{
|
|
@@ -6123,15 +6137,15 @@ var Tooltip = (props) => {
|
|
|
6123
6137
|
onBlur: handleBlur,
|
|
6124
6138
|
children: [
|
|
6125
6139
|
children,
|
|
6126
|
-
visible && /* @__PURE__ */
|
|
6140
|
+
visible && /* @__PURE__ */ jsx350(Portal_default, { children: /* @__PURE__ */ jsxs222(
|
|
6127
6141
|
"div",
|
|
6128
6142
|
{
|
|
6129
6143
|
ref: tooltipRef,
|
|
6130
6144
|
className: clsx_default("lib-xplat-tooltip", type),
|
|
6131
6145
|
style: { position: "fixed", left: pos.left, top: pos.top },
|
|
6132
6146
|
children: [
|
|
6133
|
-
title && /* @__PURE__ */
|
|
6134
|
-
description && /* @__PURE__ */
|
|
6147
|
+
title && /* @__PURE__ */ jsx350("div", { className: "tooltip-title", children: title }),
|
|
6148
|
+
description && /* @__PURE__ */ jsx350("div", { className: "tooltip-desc", children: description })
|
|
6135
6149
|
]
|
|
6136
6150
|
}
|
|
6137
6151
|
) })
|
|
@@ -6143,11 +6157,11 @@ Tooltip.displayName = "Tooltip";
|
|
|
6143
6157
|
var Tooltip_default = Tooltip;
|
|
6144
6158
|
|
|
6145
6159
|
// src/components/Video/Video.tsx
|
|
6146
|
-
import
|
|
6147
|
-
import { jsx as
|
|
6160
|
+
import React42 from "react";
|
|
6161
|
+
import { jsx as jsx351, jsxs as jsxs223 } from "react/jsx-runtime";
|
|
6148
6162
|
var PipIcon = () => /* @__PURE__ */ jsxs223("svg", { viewBox: "0 0 24 24", width: "1em", height: "1em", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
6149
|
-
/* @__PURE__ */
|
|
6150
|
-
/* @__PURE__ */
|
|
6163
|
+
/* @__PURE__ */ jsx351("rect", { x: "3", y: "5", width: "18", height: "14", rx: "2" }),
|
|
6164
|
+
/* @__PURE__ */ jsx351("rect", { x: "12", y: "11", width: "7", height: "6", rx: "1", fill: "currentColor" })
|
|
6151
6165
|
] });
|
|
6152
6166
|
var formatTime = (sec) => {
|
|
6153
6167
|
if (!Number.isFinite(sec) || sec < 0) return "0:00";
|
|
@@ -6155,7 +6169,7 @@ var formatTime = (sec) => {
|
|
|
6155
6169
|
const s = Math.floor(sec % 60);
|
|
6156
6170
|
return `${m}:${s.toString().padStart(2, "0")}`;
|
|
6157
6171
|
};
|
|
6158
|
-
var Video =
|
|
6172
|
+
var Video = React42.forwardRef((props, ref) => {
|
|
6159
6173
|
const {
|
|
6160
6174
|
src,
|
|
6161
6175
|
poster,
|
|
@@ -6179,21 +6193,21 @@ var Video = React41.forwardRef((props, ref) => {
|
|
|
6179
6193
|
children,
|
|
6180
6194
|
...rest
|
|
6181
6195
|
} = props;
|
|
6182
|
-
const containerRef =
|
|
6183
|
-
const videoRef =
|
|
6184
|
-
const [isPlaying, setIsPlaying] =
|
|
6185
|
-
const [isLoaded, setIsLoaded] =
|
|
6186
|
-
const [currentTime, setCurrentTime] =
|
|
6187
|
-
const [duration, setDuration] =
|
|
6188
|
-
const [buffered, setBuffered] =
|
|
6189
|
-
const [volume, setVolume] =
|
|
6190
|
-
const [isMuted, setIsMuted] =
|
|
6191
|
-
const [isFullscreen, setIsFullscreen] =
|
|
6192
|
-
const [playbackRate, setPlaybackRate] =
|
|
6193
|
-
const [rateMenuOpen, setRateMenuOpen] =
|
|
6194
|
-
const [captionsOn, setCaptionsOn] =
|
|
6195
|
-
const [isPip, setIsPip] =
|
|
6196
|
-
const setRefs =
|
|
6196
|
+
const containerRef = React42.useRef(null);
|
|
6197
|
+
const videoRef = React42.useRef(null);
|
|
6198
|
+
const [isPlaying, setIsPlaying] = React42.useState(Boolean(autoPlay));
|
|
6199
|
+
const [isLoaded, setIsLoaded] = React42.useState(false);
|
|
6200
|
+
const [currentTime, setCurrentTime] = React42.useState(0);
|
|
6201
|
+
const [duration, setDuration] = React42.useState(0);
|
|
6202
|
+
const [buffered, setBuffered] = React42.useState(0);
|
|
6203
|
+
const [volume, setVolume] = React42.useState(1);
|
|
6204
|
+
const [isMuted, setIsMuted] = React42.useState(Boolean(muted));
|
|
6205
|
+
const [isFullscreen, setIsFullscreen] = React42.useState(false);
|
|
6206
|
+
const [playbackRate, setPlaybackRate] = React42.useState(1);
|
|
6207
|
+
const [rateMenuOpen, setRateMenuOpen] = React42.useState(false);
|
|
6208
|
+
const [captionsOn, setCaptionsOn] = React42.useState(false);
|
|
6209
|
+
const [isPip, setIsPip] = React42.useState(false);
|
|
6210
|
+
const setRefs = React42.useCallback(
|
|
6197
6211
|
(el) => {
|
|
6198
6212
|
videoRef.current = el;
|
|
6199
6213
|
if (typeof ref === "function") ref(el);
|
|
@@ -6201,14 +6215,14 @@ var Video = React41.forwardRef((props, ref) => {
|
|
|
6201
6215
|
},
|
|
6202
6216
|
[ref]
|
|
6203
6217
|
);
|
|
6204
|
-
|
|
6218
|
+
React42.useEffect(() => {
|
|
6205
6219
|
const onFsChange = () => {
|
|
6206
6220
|
setIsFullscreen(document.fullscreenElement === containerRef.current);
|
|
6207
6221
|
};
|
|
6208
6222
|
document.addEventListener("fullscreenchange", onFsChange);
|
|
6209
6223
|
return () => document.removeEventListener("fullscreenchange", onFsChange);
|
|
6210
6224
|
}, []);
|
|
6211
|
-
|
|
6225
|
+
React42.useEffect(() => {
|
|
6212
6226
|
const v = videoRef.current;
|
|
6213
6227
|
if (!v) return;
|
|
6214
6228
|
const onEnter = () => setIsPip(true);
|
|
@@ -6328,7 +6342,7 @@ var Video = React41.forwardRef((props, ref) => {
|
|
|
6328
6342
|
ref: containerRef,
|
|
6329
6343
|
className: clsx_default("lib-xplat-video", showControls && "has-controls"),
|
|
6330
6344
|
children: [
|
|
6331
|
-
/* @__PURE__ */
|
|
6345
|
+
/* @__PURE__ */ jsx351(
|
|
6332
6346
|
"video",
|
|
6333
6347
|
{
|
|
6334
6348
|
ref: setRefs,
|
|
@@ -6349,7 +6363,7 @@ var Video = React41.forwardRef((props, ref) => {
|
|
|
6349
6363
|
children
|
|
6350
6364
|
}
|
|
6351
6365
|
),
|
|
6352
|
-
showCenterPlay && /* @__PURE__ */
|
|
6366
|
+
showCenterPlay && /* @__PURE__ */ jsx351(
|
|
6353
6367
|
"button",
|
|
6354
6368
|
{
|
|
6355
6369
|
type: "button",
|
|
@@ -6361,11 +6375,11 @@ var Video = React41.forwardRef((props, ref) => {
|
|
|
6361
6375
|
onClick: togglePlay,
|
|
6362
6376
|
"aria-label": isPlaying ? "\uC77C\uC2DC\uC815\uC9C0" : "\uC7AC\uC0DD",
|
|
6363
6377
|
tabIndex: -1,
|
|
6364
|
-
children: /* @__PURE__ */
|
|
6378
|
+
children: /* @__PURE__ */ jsx351("span", { className: "center-play-icon", children: /* @__PURE__ */ jsx351(PlayCircleIcon_default, {}) })
|
|
6365
6379
|
}
|
|
6366
6380
|
),
|
|
6367
6381
|
showControls && /* @__PURE__ */ jsxs223("div", { className: "controls", onClick: (e) => e.stopPropagation(), children: [
|
|
6368
|
-
/* @__PURE__ */
|
|
6382
|
+
/* @__PURE__ */ jsx351(
|
|
6369
6383
|
"input",
|
|
6370
6384
|
{
|
|
6371
6385
|
type: "range",
|
|
@@ -6383,28 +6397,28 @@ var Video = React41.forwardRef((props, ref) => {
|
|
|
6383
6397
|
}
|
|
6384
6398
|
),
|
|
6385
6399
|
/* @__PURE__ */ jsxs223("div", { className: "controls-row", children: [
|
|
6386
|
-
/* @__PURE__ */
|
|
6400
|
+
/* @__PURE__ */ jsx351(
|
|
6387
6401
|
"button",
|
|
6388
6402
|
{
|
|
6389
6403
|
type: "button",
|
|
6390
6404
|
className: "control-btn",
|
|
6391
6405
|
onClick: togglePlay,
|
|
6392
6406
|
"aria-label": isPlaying ? "\uC77C\uC2DC\uC815\uC9C0" : "\uC7AC\uC0DD",
|
|
6393
|
-
children: isPlaying ? /* @__PURE__ */
|
|
6407
|
+
children: isPlaying ? /* @__PURE__ */ jsx351(PauseIcon_default, {}) : /* @__PURE__ */ jsx351(PlayIcon_default, {})
|
|
6394
6408
|
}
|
|
6395
6409
|
),
|
|
6396
6410
|
/* @__PURE__ */ jsxs223("div", { className: "volume-group", children: [
|
|
6397
|
-
/* @__PURE__ */
|
|
6411
|
+
/* @__PURE__ */ jsx351(
|
|
6398
6412
|
"button",
|
|
6399
6413
|
{
|
|
6400
6414
|
type: "button",
|
|
6401
6415
|
className: "control-btn",
|
|
6402
6416
|
onClick: toggleMute,
|
|
6403
6417
|
"aria-label": isMuted ? "\uC74C\uC18C\uAC70 \uD574\uC81C" : "\uC74C\uC18C\uAC70",
|
|
6404
|
-
children: /* @__PURE__ */
|
|
6418
|
+
children: /* @__PURE__ */ jsx351(VolumeGlyph, {})
|
|
6405
6419
|
}
|
|
6406
6420
|
),
|
|
6407
|
-
/* @__PURE__ */
|
|
6421
|
+
/* @__PURE__ */ jsx351(
|
|
6408
6422
|
"input",
|
|
6409
6423
|
{
|
|
6410
6424
|
type: "range",
|
|
@@ -6424,7 +6438,7 @@ var Video = React41.forwardRef((props, ref) => {
|
|
|
6424
6438
|
" / ",
|
|
6425
6439
|
formatTime(duration)
|
|
6426
6440
|
] }),
|
|
6427
|
-
/* @__PURE__ */
|
|
6441
|
+
/* @__PURE__ */ jsx351("div", { className: "controls-spacer" }),
|
|
6428
6442
|
playbackRates && playbackRates.length > 0 && /* @__PURE__ */ jsxs223("div", { className: clsx_default("rate-group", rateMenuOpen && "is-open"), children: [
|
|
6429
6443
|
/* @__PURE__ */ jsxs223(
|
|
6430
6444
|
"button",
|
|
@@ -6440,7 +6454,7 @@ var Video = React41.forwardRef((props, ref) => {
|
|
|
6440
6454
|
]
|
|
6441
6455
|
}
|
|
6442
6456
|
),
|
|
6443
|
-
rateMenuOpen && /* @__PURE__ */
|
|
6457
|
+
rateMenuOpen && /* @__PURE__ */ jsx351("ul", { className: "rate-menu", role: "menu", children: playbackRates.map((r2) => /* @__PURE__ */ jsx351("li", { children: /* @__PURE__ */ jsxs223(
|
|
6444
6458
|
"button",
|
|
6445
6459
|
{
|
|
6446
6460
|
type: "button",
|
|
@@ -6454,7 +6468,7 @@ var Video = React41.forwardRef((props, ref) => {
|
|
|
6454
6468
|
}
|
|
6455
6469
|
) }, r2)) })
|
|
6456
6470
|
] }),
|
|
6457
|
-
showCaptions && /* @__PURE__ */
|
|
6471
|
+
showCaptions && /* @__PURE__ */ jsx351(
|
|
6458
6472
|
"button",
|
|
6459
6473
|
{
|
|
6460
6474
|
type: "button",
|
|
@@ -6462,37 +6476,37 @@ var Video = React41.forwardRef((props, ref) => {
|
|
|
6462
6476
|
onClick: toggleCaptions,
|
|
6463
6477
|
"aria-label": captionsOn ? "\uC790\uB9C9 \uB044\uAE30" : "\uC790\uB9C9 \uCF1C\uAE30",
|
|
6464
6478
|
"aria-pressed": captionsOn,
|
|
6465
|
-
children: /* @__PURE__ */
|
|
6479
|
+
children: /* @__PURE__ */ jsx351(TypeIcon_default, {})
|
|
6466
6480
|
}
|
|
6467
6481
|
),
|
|
6468
|
-
showPip && pipSupported && /* @__PURE__ */
|
|
6482
|
+
showPip && pipSupported && /* @__PURE__ */ jsx351(
|
|
6469
6483
|
"button",
|
|
6470
6484
|
{
|
|
6471
6485
|
type: "button",
|
|
6472
6486
|
className: clsx_default("control-btn", isPip && "is-active"),
|
|
6473
6487
|
onClick: togglePip,
|
|
6474
6488
|
"aria-label": isPip ? "PIP \uC885\uB8CC" : "PIP",
|
|
6475
|
-
children: /* @__PURE__ */
|
|
6489
|
+
children: /* @__PURE__ */ jsx351(PipIcon, {})
|
|
6476
6490
|
}
|
|
6477
6491
|
),
|
|
6478
|
-
showDownload && /* @__PURE__ */
|
|
6492
|
+
showDownload && /* @__PURE__ */ jsx351(
|
|
6479
6493
|
"a",
|
|
6480
6494
|
{
|
|
6481
6495
|
className: "control-btn",
|
|
6482
6496
|
href: src,
|
|
6483
6497
|
download: downloadFileName ?? true,
|
|
6484
6498
|
"aria-label": "\uB2E4\uC6B4\uB85C\uB4DC",
|
|
6485
|
-
children: /* @__PURE__ */
|
|
6499
|
+
children: /* @__PURE__ */ jsx351(DownloadIcon_default, {})
|
|
6486
6500
|
}
|
|
6487
6501
|
),
|
|
6488
|
-
/* @__PURE__ */
|
|
6502
|
+
/* @__PURE__ */ jsx351(
|
|
6489
6503
|
"button",
|
|
6490
6504
|
{
|
|
6491
6505
|
type: "button",
|
|
6492
6506
|
className: "control-btn",
|
|
6493
6507
|
onClick: toggleFullscreen,
|
|
6494
6508
|
"aria-label": isFullscreen ? "\uC804\uCCB4\uD654\uBA74 \uC885\uB8CC" : "\uC804\uCCB4\uD654\uBA74",
|
|
6495
|
-
children: isFullscreen ? /* @__PURE__ */
|
|
6509
|
+
children: isFullscreen ? /* @__PURE__ */ jsx351(MinimizeIcon_default, {}) : /* @__PURE__ */ jsx351(MaximizeIcon_default, {})
|
|
6496
6510
|
}
|
|
6497
6511
|
)
|
|
6498
6512
|
] })
|
|
@@ -6506,6 +6520,7 @@ var Video_default = Video;
|
|
|
6506
6520
|
export {
|
|
6507
6521
|
Accordion_default as Accordion,
|
|
6508
6522
|
Alert_default as Alert,
|
|
6523
|
+
AutoResizeTextArea_default as AutoResizeTextArea,
|
|
6509
6524
|
Avatar_default as Avatar,
|
|
6510
6525
|
Badge_default as Badge,
|
|
6511
6526
|
Box_default as Box,
|