@nation-a/ui 0.11.0 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs
CHANGED
|
@@ -9772,7 +9772,7 @@ const DEFAULT_MIN_SNAP = 0;
|
|
|
9772
9772
|
const DEFAULT_MAX_SNAP = "INNER_HEIGHT";
|
|
9773
9773
|
const DEFAULT_BACKDROP_OPACITY = 0.5;
|
|
9774
9774
|
const BottomSheetFrame = React.forwardRef(
|
|
9775
|
-
({ children, className, initialOpenHeightPx, springs }, ref) => {
|
|
9775
|
+
({ children, className, initialOpenHeightPx, springs, style: styleProp, css: cssProp }, ref) => {
|
|
9776
9776
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9777
9777
|
animated.section,
|
|
9778
9778
|
{
|
|
@@ -9792,13 +9792,15 @@ const BottomSheetFrame = React.forwardRef(
|
|
|
9792
9792
|
zIndex: "modal",
|
|
9793
9793
|
backgroundColor: "surface.layer_1",
|
|
9794
9794
|
shadow: "0 -15px 15px 0px rgba(0, 0, 0, 0.05)",
|
|
9795
|
-
willChange: "auto"
|
|
9795
|
+
willChange: "auto",
|
|
9796
|
+
...cssProp
|
|
9796
9797
|
}),
|
|
9797
9798
|
className
|
|
9798
9799
|
),
|
|
9799
9800
|
style: {
|
|
9800
9801
|
bottom: `calc(${initialOpenHeightPx}px - 100dvh)`,
|
|
9801
|
-
transform: springs.transform
|
|
9802
|
+
transform: springs.transform,
|
|
9803
|
+
...styleProp
|
|
9802
9804
|
},
|
|
9803
9805
|
children
|
|
9804
9806
|
}
|
|
@@ -9867,7 +9869,9 @@ const BottomSheet = (props) => {
|
|
|
9867
9869
|
bgBlocking = true,
|
|
9868
9870
|
backdropOpacity = DEFAULT_BACKDROP_OPACITY,
|
|
9869
9871
|
hideHandle = false,
|
|
9870
|
-
expendOnContentDrag = false
|
|
9872
|
+
expendOnContentDrag = false,
|
|
9873
|
+
css: cssProp,
|
|
9874
|
+
style: styleProp
|
|
9871
9875
|
} = props;
|
|
9872
9876
|
const { bottomSheetRef, contentRef, snapToMin, springs } = useBottomSheet({
|
|
9873
9877
|
isOpen,
|
|
@@ -9883,13 +9887,15 @@ const BottomSheet = (props) => {
|
|
|
9883
9887
|
React.useEffect(() => {
|
|
9884
9888
|
if (snapPercent == null ? void 0 : snapPercent.min) setInitialOpenHeightPx(window.innerHeight * (snapPercent == null ? void 0 : snapPercent.min));
|
|
9885
9889
|
}, [snapPercent == null ? void 0 : snapPercent.min]);
|
|
9886
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(animated.div, { children: [
|
|
9890
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(animated.div, { className: css$1({ width: "100%" }), children: [
|
|
9887
9891
|
bgBlocking && /* @__PURE__ */ jsxRuntime.jsx(Backdrop, { isBackdropOpen: isOpen, opacity: backdropOpacity, onBackdropClick: () => snapToMin() }),
|
|
9888
9892
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
9889
9893
|
BottomSheetFrame,
|
|
9890
9894
|
{
|
|
9891
9895
|
ref: bottomSheetRef,
|
|
9892
9896
|
className,
|
|
9897
|
+
style: styleProp,
|
|
9898
|
+
css: cssProp,
|
|
9893
9899
|
springs,
|
|
9894
9900
|
initialOpenHeightPx,
|
|
9895
9901
|
children: [
|
|
@@ -11097,8 +11103,32 @@ const toast = {
|
|
|
11097
11103
|
toast.queue = [];
|
|
11098
11104
|
return queue;
|
|
11099
11105
|
},
|
|
11106
|
+
/**
|
|
11107
|
+
* ToastProvider가 준비되었는지 확인하는 상태
|
|
11108
|
+
*/
|
|
11109
|
+
isReady: false,
|
|
11110
|
+
/**
|
|
11111
|
+
* 대기 중인 토스트 메시지 큐
|
|
11112
|
+
*/
|
|
11113
|
+
pendingToasts: [],
|
|
11114
|
+
/**
|
|
11115
|
+
* ToastProvider에서 호출하여 준비 상태를 설정
|
|
11116
|
+
*/
|
|
11117
|
+
_setReady: () => {
|
|
11118
|
+
toast.isReady = true;
|
|
11119
|
+
if (toast.pendingToasts.length > 0) {
|
|
11120
|
+
toast.pendingToasts.forEach((args) => {
|
|
11121
|
+
toast.show(args[0], args[1]);
|
|
11122
|
+
});
|
|
11123
|
+
toast.pendingToasts = [];
|
|
11124
|
+
}
|
|
11125
|
+
},
|
|
11100
11126
|
// render toast
|
|
11101
11127
|
show: (message, options) => {
|
|
11128
|
+
if (!toast.isReady) {
|
|
11129
|
+
toast.pendingToasts.push([message, options]);
|
|
11130
|
+
return;
|
|
11131
|
+
}
|
|
11102
11132
|
const toastData = {
|
|
11103
11133
|
description: message,
|
|
11104
11134
|
action: (options == null ? void 0 : options.actionLabel) ? {
|
|
@@ -11143,6 +11173,11 @@ const ToastProvider = ({ children }) => {
|
|
|
11143
11173
|
},
|
|
11144
11174
|
overlap: true
|
|
11145
11175
|
});
|
|
11176
|
+
React.useEffect(() => {
|
|
11177
|
+
toast._setReady();
|
|
11178
|
+
return () => {
|
|
11179
|
+
};
|
|
11180
|
+
}, []);
|
|
11146
11181
|
React.useEffect(() => {
|
|
11147
11182
|
let currentZIndexCounter = 1300;
|
|
11148
11183
|
const showToasts = () => {
|
|
@@ -11171,13 +11206,14 @@ const ToastProvider = ({ children }) => {
|
|
|
11171
11206
|
if (toastData.duration) {
|
|
11172
11207
|
options.duration = toastData.duration;
|
|
11173
11208
|
}
|
|
11174
|
-
|
|
11209
|
+
setTimeout(() => {
|
|
11210
|
+
toaster.create(options);
|
|
11211
|
+
}, 0);
|
|
11175
11212
|
} catch (error) {
|
|
11176
11213
|
console.error("Error creating toast:", error);
|
|
11177
11214
|
}
|
|
11178
11215
|
});
|
|
11179
11216
|
};
|
|
11180
|
-
showToasts();
|
|
11181
11217
|
const handleToastQueue = () => showToasts();
|
|
11182
11218
|
window.addEventListener("toast-queue-updated", handleToastQueue);
|
|
11183
11219
|
return () => {
|