@wistia/ui 0.8.23-beta.3716df75.ff92946 → 0.8.23
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 +21 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.mjs +56 -37
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.8.23
|
|
3
|
+
* @license @wistia/ui v0.8.23
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -7790,6 +7790,7 @@ var makePolymorphic = (component) => {
|
|
|
7790
7790
|
|
|
7791
7791
|
// src/components/Box/Box.tsx
|
|
7792
7792
|
var import_jsx_runtime199 = require("react/jsx-runtime");
|
|
7793
|
+
var isDev = process.env["NODE_ENV"] === "development" || process.env["NODE_ENV"] === "test";
|
|
7793
7794
|
var getGapStyle = (gap) => {
|
|
7794
7795
|
if ((0, import_type_guards20.isNotNil)(gap)) {
|
|
7795
7796
|
if ((0, import_type_guards20.isRecord)(gap)) {
|
|
@@ -7884,6 +7885,22 @@ var StyledBoxComponent = import_styled_components27.default.div`
|
|
|
7884
7885
|
justify-content: ${({ $justifyContent }) => $justifyContent};
|
|
7885
7886
|
order: ${({ $order }) => (0, import_type_guards20.isNotNil)($order) ? $order : null};
|
|
7886
7887
|
`;
|
|
7888
|
+
var wrapChildren = (children) => {
|
|
7889
|
+
if ((0, import_type_guards20.isNotNil)(children)) {
|
|
7890
|
+
if (typeof children === "object" && isDev) {
|
|
7891
|
+
return import_react26.Children.map(children, (child) => {
|
|
7892
|
+
if ((0, import_type_guards20.isNil)(child)) return null;
|
|
7893
|
+
const elementParams = {};
|
|
7894
|
+
if (child.type?.displayName === "Box" || child.type?.displayName === "Box_UI") {
|
|
7895
|
+
elementParams.hasBoxParent = true;
|
|
7896
|
+
}
|
|
7897
|
+
return (0, import_react26.cloneElement)(child, elementParams);
|
|
7898
|
+
});
|
|
7899
|
+
}
|
|
7900
|
+
return children;
|
|
7901
|
+
}
|
|
7902
|
+
return null;
|
|
7903
|
+
};
|
|
7887
7904
|
var DEFAULT_ELEMENT = "div";
|
|
7888
7905
|
var BoxComponent = (0, import_react26.forwardRef)(
|
|
7889
7906
|
({
|
|
@@ -7897,6 +7914,8 @@ var BoxComponent = (0, import_react26.forwardRef)(
|
|
|
7897
7914
|
fillViewport = false,
|
|
7898
7915
|
gap,
|
|
7899
7916
|
grow,
|
|
7917
|
+
hasBoxParent = false,
|
|
7918
|
+
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
7900
7919
|
height,
|
|
7901
7920
|
inline = false,
|
|
7902
7921
|
justifyContent = "flex-start",
|
|
@@ -7957,7 +7976,7 @@ var BoxComponent = (0, import_react26.forwardRef)(
|
|
|
7957
7976
|
$wrapItems: wrapItems,
|
|
7958
7977
|
as: renderAs ?? DEFAULT_ELEMENT,
|
|
7959
7978
|
...props,
|
|
7960
|
-
children
|
|
7979
|
+
children: wrapChildren(children)
|
|
7961
7980
|
}
|
|
7962
7981
|
);
|
|
7963
7982
|
}
|