@wistia/ui 0.15.13 → 0.15.14-beta.0ddf5142.0352c4f
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 +59 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +10 -2
- package/dist/index.d.ts +10 -2
- package/dist/index.mjs +59 -6
- 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.15.
|
|
3
|
+
* @license @wistia/ui v0.15.14-beta.0ddf5142.0352c4f
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -13039,6 +13039,7 @@ var Combobox2 = ({
|
|
|
13039
13039
|
// src/components/ContextMenu/ContextMenu.tsx
|
|
13040
13040
|
var import_type_guards43 = require("@wistia/type-guards");
|
|
13041
13041
|
var import_react61 = require("react");
|
|
13042
|
+
var import_react_dom = require("react-dom");
|
|
13042
13043
|
|
|
13043
13044
|
// src/components/Menu/Menu.tsx
|
|
13044
13045
|
var import_react_dropdown_menu = require("@radix-ui/react-dropdown-menu");
|
|
@@ -13708,7 +13709,8 @@ var ContextMenu = ({
|
|
|
13708
13709
|
triggerRef,
|
|
13709
13710
|
children,
|
|
13710
13711
|
side = "bottom",
|
|
13711
|
-
onRequestClose = () => null
|
|
13712
|
+
onRequestClose = () => null,
|
|
13713
|
+
compact = false
|
|
13712
13714
|
}) => {
|
|
13713
13715
|
const [isRightClicked, setIsRightClicked] = (0, import_react61.useState)(false);
|
|
13714
13716
|
const [menuPosition, setMenuPosition] = (0, import_react61.useState)(position ?? { x: 0, y: 0 });
|
|
@@ -13728,9 +13730,13 @@ var ContextMenu = ({
|
|
|
13728
13730
|
return () => null;
|
|
13729
13731
|
}, [position, triggerRef]);
|
|
13730
13732
|
const isOpen = (0, import_type_guards43.isNotNil)(position) || isRightClicked;
|
|
13731
|
-
|
|
13733
|
+
if (!isOpen) {
|
|
13734
|
+
return null;
|
|
13735
|
+
}
|
|
13736
|
+
const menu = /* @__PURE__ */ (0, import_jsx_runtime267.jsx)(
|
|
13732
13737
|
Menu,
|
|
13733
13738
|
{
|
|
13739
|
+
compact,
|
|
13734
13740
|
isOpen,
|
|
13735
13741
|
onOpenChange: (next) => {
|
|
13736
13742
|
setIsRightClicked(next);
|
|
@@ -13756,7 +13762,11 @@ var ContextMenu = ({
|
|
|
13756
13762
|
),
|
|
13757
13763
|
children
|
|
13758
13764
|
}
|
|
13759
|
-
)
|
|
13765
|
+
);
|
|
13766
|
+
if ((0, import_type_guards43.isNotNil)(triggerRef)) {
|
|
13767
|
+
return (0, import_react_dom.createPortal)(menu, document.body);
|
|
13768
|
+
}
|
|
13769
|
+
return menu;
|
|
13760
13770
|
};
|
|
13761
13771
|
|
|
13762
13772
|
// src/components/DataCards/DataCard.tsx
|
|
@@ -14318,10 +14328,44 @@ var import_react64 = require("react");
|
|
|
14318
14328
|
var import_type_guards45 = require("@wistia/type-guards");
|
|
14319
14329
|
var import_styled_components82 = __toESM(require("styled-components"));
|
|
14320
14330
|
var import_jsx_runtime277 = require("react/jsx-runtime");
|
|
14331
|
+
var LARGE_PADDING = "var(--wui-space-02)";
|
|
14332
|
+
var SMALL_PADDING = "var(--wui-space-01)";
|
|
14333
|
+
var getPaddingForVariant = (variant) => {
|
|
14334
|
+
const largePaddingVariants = [
|
|
14335
|
+
"hero",
|
|
14336
|
+
"heading1",
|
|
14337
|
+
"heading2",
|
|
14338
|
+
"heading3",
|
|
14339
|
+
"body1",
|
|
14340
|
+
"label1",
|
|
14341
|
+
"body1Mono"
|
|
14342
|
+
];
|
|
14343
|
+
const smallPaddingVariants = [
|
|
14344
|
+
"heading4",
|
|
14345
|
+
"heading5",
|
|
14346
|
+
"heading6",
|
|
14347
|
+
"body2",
|
|
14348
|
+
"body3",
|
|
14349
|
+
"body4",
|
|
14350
|
+
"label2",
|
|
14351
|
+
"label3",
|
|
14352
|
+
"label4",
|
|
14353
|
+
"body2Mono",
|
|
14354
|
+
"body3Mono",
|
|
14355
|
+
"body4Mono"
|
|
14356
|
+
];
|
|
14357
|
+
if (largePaddingVariants.includes(variant)) {
|
|
14358
|
+
return LARGE_PADDING;
|
|
14359
|
+
}
|
|
14360
|
+
if (smallPaddingVariants.includes(variant)) {
|
|
14361
|
+
return SMALL_PADDING;
|
|
14362
|
+
}
|
|
14363
|
+
return SMALL_PADDING;
|
|
14364
|
+
};
|
|
14321
14365
|
var StyledEditableTextRoot = import_styled_components82.default.div`
|
|
14322
14366
|
display: contents;
|
|
14323
14367
|
|
|
14324
|
-
--wui-editable-text-padding:
|
|
14368
|
+
--wui-editable-text-padding: ${({ $typographicVariant }) => getPaddingForVariant($typographicVariant)};
|
|
14325
14369
|
--wui-editable-text-border-radius: var(--wui-border-radius-01);
|
|
14326
14370
|
`;
|
|
14327
14371
|
var EditableTextContext = (0, import_react64.createContext)(null);
|
|
@@ -14419,6 +14463,7 @@ var EditableTextRoot = ({
|
|
|
14419
14463
|
return /* @__PURE__ */ (0, import_jsx_runtime277.jsx)(
|
|
14420
14464
|
StyledEditableTextRoot,
|
|
14421
14465
|
{
|
|
14466
|
+
$typographicVariant: typographicVariant,
|
|
14422
14467
|
"data-testid": "editable-text-root",
|
|
14423
14468
|
"data-wui-editable-text-root": true,
|
|
14424
14469
|
"data-wui-editable-text-state": getState(),
|
|
@@ -14927,6 +14972,7 @@ var FormField = ({
|
|
|
14927
14972
|
label,
|
|
14928
14973
|
labelPosition,
|
|
14929
14974
|
name,
|
|
14975
|
+
required = false,
|
|
14930
14976
|
value,
|
|
14931
14977
|
...props
|
|
14932
14978
|
}) => {
|
|
@@ -14976,7 +15022,14 @@ var FormField = ({
|
|
|
14976
15022
|
...props,
|
|
14977
15023
|
"data-label-position": labelPosition ?? formState.labelPosition,
|
|
14978
15024
|
children: [
|
|
14979
|
-
!isIntegratedLabel && /* @__PURE__ */ (0, import_jsx_runtime283.jsx)(
|
|
15025
|
+
!isIntegratedLabel && /* @__PURE__ */ (0, import_jsx_runtime283.jsx)(
|
|
15026
|
+
Label,
|
|
15027
|
+
{
|
|
15028
|
+
htmlFor: computedId,
|
|
15029
|
+
required,
|
|
15030
|
+
children: label
|
|
15031
|
+
}
|
|
15032
|
+
),
|
|
14980
15033
|
(0, import_type_guards49.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime283.jsx)(FormControlLabelDescription, { id: descriptionId, children: description }) : null,
|
|
14981
15034
|
(0, import_react73.cloneElement)(children, childProps),
|
|
14982
15035
|
(0, import_type_guards49.isNotNil)(computedError) ? /* @__PURE__ */ (0, import_jsx_runtime283.jsxs)(import_jsx_runtime283.Fragment, { children: [
|