@ostack.tech/ui 0.2.0 → 0.2.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/ostack-ui.js
CHANGED
|
@@ -8810,20 +8810,15 @@ function useIsInRoot() {
|
|
|
8810
8810
|
const RootElement = forwardRef(
|
|
8811
8811
|
function RootElement2({
|
|
8812
8812
|
asChild,
|
|
8813
|
-
|
|
8813
|
+
includeErrorBoundary,
|
|
8814
|
+
errorBoundaryProps,
|
|
8814
8815
|
className,
|
|
8815
8816
|
children,
|
|
8816
|
-
errorBoundaryProps,
|
|
8817
8817
|
...otherProps
|
|
8818
8818
|
}, forwardedRef) {
|
|
8819
8819
|
const prefix = usePrefix();
|
|
8820
8820
|
const [locale] = useLocale();
|
|
8821
8821
|
const errorBoundChildren = (children2) => /* @__PURE__ */ jsx(ErrorBoundary, { ...errorBoundaryProps, children: children2 });
|
|
8822
|
-
const content = isInRoot ? children : asChild ? cloneElement(
|
|
8823
|
-
children,
|
|
8824
|
-
void 0,
|
|
8825
|
-
errorBoundChildren(children.props.children)
|
|
8826
|
-
) : errorBoundChildren(children);
|
|
8827
8822
|
const As = asChild ? Slot : "div";
|
|
8828
8823
|
return /* @__PURE__ */ jsx(
|
|
8829
8824
|
As,
|
|
@@ -8832,7 +8827,13 @@ const RootElement = forwardRef(
|
|
|
8832
8827
|
className: cx(prefix("root"), className),
|
|
8833
8828
|
...otherProps,
|
|
8834
8829
|
ref: forwardedRef,
|
|
8835
|
-
children:
|
|
8830
|
+
children: includeErrorBoundary ? asChild ? cloneElement(
|
|
8831
|
+
children,
|
|
8832
|
+
void 0,
|
|
8833
|
+
errorBoundChildren(
|
|
8834
|
+
children.props.children
|
|
8835
|
+
)
|
|
8836
|
+
) : errorBoundChildren(children) : children
|
|
8836
8837
|
}
|
|
8837
8838
|
);
|
|
8838
8839
|
}
|
|
@@ -8896,13 +8897,21 @@ const Root = forwardRef(function Root2({
|
|
|
8896
8897
|
`Root: Properties ${Object.keys(topMostProps).map((prop) => `\`${prop}\``).join(", ")} have no effect in nested \`Root\` components. Please set any of these properties on the top-most \`Root\` component instead.`
|
|
8897
8898
|
);
|
|
8898
8899
|
}
|
|
8900
|
+
const rootEl = /* @__PURE__ */ jsx(
|
|
8901
|
+
RootElement,
|
|
8902
|
+
{
|
|
8903
|
+
includeErrorBoundary: !isInRoot,
|
|
8904
|
+
...otherProps,
|
|
8905
|
+
ref: forwardedRef
|
|
8906
|
+
}
|
|
8907
|
+
);
|
|
8899
8908
|
return isInRoot ? /* @__PURE__ */ jsx(PrefixProvider, { prefix: newPrefix, children: /* @__PURE__ */ jsx(
|
|
8900
8909
|
LocalizationProvider,
|
|
8901
8910
|
{
|
|
8902
8911
|
defaultLocale,
|
|
8903
8912
|
locale: controlledLocale,
|
|
8904
8913
|
onLocaleChange,
|
|
8905
|
-
children:
|
|
8914
|
+
children: rootEl
|
|
8906
8915
|
}
|
|
8907
8916
|
) }) : /* @__PURE__ */ jsx(RootContext.Provider, { value: true, children: /* @__PURE__ */ jsx(PrefixProvider, { prefix: newPrefix, children: /* @__PURE__ */ jsx(
|
|
8908
8917
|
ErrorReportingProvider,
|
|
@@ -8940,7 +8949,7 @@ const Root = forwardRef(function Root2({
|
|
|
8940
8949
|
swipeDirection: toastsSwipeDirection,
|
|
8941
8950
|
swipeThreshold: toastsSwipeThreshold,
|
|
8942
8951
|
children: /* @__PURE__ */ jsxs(ToastManagerProvider, { children: [
|
|
8943
|
-
|
|
8952
|
+
rootEl,
|
|
8944
8953
|
/* @__PURE__ */ jsx(Portal, { container: portalsContainer, asChild: true, children: /* @__PURE__ */ jsx(
|
|
8945
8954
|
ToastViewport,
|
|
8946
8955
|
{
|