@wistia/ui 0.15.13 → 0.15.14-beta.50e89a95.396fb5b
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 +98 -71
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +18 -2
- package/dist/index.d.ts +18 -2
- package/dist/index.mjs +79 -52
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1634,6 +1634,10 @@ declare const Combobox: ({ placeholder, value, onChange, searchValue, onSearchVa
|
|
|
1634
1634
|
type ContextMenuProps = {
|
|
1635
1635
|
children: ReactNode;
|
|
1636
1636
|
onRequestClose?: () => void;
|
|
1637
|
+
/**
|
|
1638
|
+
* If the menu is compact
|
|
1639
|
+
*/
|
|
1640
|
+
compact?: boolean;
|
|
1637
1641
|
} & ({
|
|
1638
1642
|
position: {
|
|
1639
1643
|
x: number;
|
|
@@ -1652,7 +1656,7 @@ type ContextMenuProps = {
|
|
|
1652
1656
|
* 1. By providing a `triggerRef`, which will render the menu when the referenced element is right-clicked.
|
|
1653
1657
|
* 2. By providing a `position` prop, which will render the menu at the specified coordinates.
|
|
1654
1658
|
*/
|
|
1655
|
-
declare const ContextMenu: ({ position, triggerRef, children, side, onRequestClose, }: ContextMenuProps) => react_jsx_runtime.JSX.Element | null;
|
|
1659
|
+
declare const ContextMenu: ({ position, triggerRef, children, side, onRequestClose, compact, }: ContextMenuProps) => react_jsx_runtime.JSX.Element | null;
|
|
1656
1660
|
|
|
1657
1661
|
type DataCardProps = ComponentPropsWithoutRef<'div'> & Partial<Pick<ButtonAsLinkProps, 'beforeAction' | 'disabled' | 'href' | 'onClick' | 'type'>> & {
|
|
1658
1662
|
/**
|
|
@@ -2369,6 +2373,10 @@ type FormFieldProps = ComponentPropsWithoutRef<'div'> & {
|
|
|
2369
2373
|
* The name attribute of the field. It will map to the form data passed into `useFormState`.
|
|
2370
2374
|
*/
|
|
2371
2375
|
name: string;
|
|
2376
|
+
/**
|
|
2377
|
+
* Use if label describes a required form component
|
|
2378
|
+
*/
|
|
2379
|
+
required?: boolean;
|
|
2372
2380
|
/**
|
|
2373
2381
|
* A value that overrides the basic value. This should pair with `onChange`.
|
|
2374
2382
|
*/
|
|
@@ -2382,7 +2390,7 @@ type FormFieldProps = ComponentPropsWithoutRef<'div'> & {
|
|
|
2382
2390
|
* FormField is a compound component that combines a label, form control, and optional description and error message.
|
|
2383
2391
|
*/
|
|
2384
2392
|
declare const FormField: {
|
|
2385
|
-
({ children, description, error, id, label, labelPosition, name, value, ...props }: FormFieldProps): JSX$1.Element;
|
|
2393
|
+
({ children, description, error, id, label, labelPosition, name, required, value, ...props }: FormFieldProps): JSX$1.Element;
|
|
2386
2394
|
displayName: string;
|
|
2387
2395
|
};
|
|
2388
2396
|
|
|
@@ -3075,6 +3083,10 @@ type ModalProps = ComponentPropsWithoutRef<'div'> & {
|
|
|
3075
3083
|
* Determines if the title is visible
|
|
3076
3084
|
*/
|
|
3077
3085
|
hideTitle?: boolean;
|
|
3086
|
+
/**
|
|
3087
|
+
* The maximum width the modal can be
|
|
3088
|
+
*/
|
|
3089
|
+
maxWidth?: string;
|
|
3078
3090
|
/**
|
|
3079
3091
|
* When the Modal is dismissed, this function will be called. You'll typically want to set the
|
|
3080
3092
|
* state of `isOpen` to false here
|
|
@@ -3123,6 +3135,10 @@ declare const Modal: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProp
|
|
|
3123
3135
|
* Determines if the title is visible
|
|
3124
3136
|
*/
|
|
3125
3137
|
hideTitle?: boolean;
|
|
3138
|
+
/**
|
|
3139
|
+
* The maximum width the modal can be
|
|
3140
|
+
*/
|
|
3141
|
+
maxWidth?: string;
|
|
3126
3142
|
/**
|
|
3127
3143
|
* When the Modal is dismissed, this function will be called. You'll typically want to set the
|
|
3128
3144
|
* state of `isOpen` to false here
|
package/dist/index.d.ts
CHANGED
|
@@ -1634,6 +1634,10 @@ declare const Combobox: ({ placeholder, value, onChange, searchValue, onSearchVa
|
|
|
1634
1634
|
type ContextMenuProps = {
|
|
1635
1635
|
children: ReactNode;
|
|
1636
1636
|
onRequestClose?: () => void;
|
|
1637
|
+
/**
|
|
1638
|
+
* If the menu is compact
|
|
1639
|
+
*/
|
|
1640
|
+
compact?: boolean;
|
|
1637
1641
|
} & ({
|
|
1638
1642
|
position: {
|
|
1639
1643
|
x: number;
|
|
@@ -1652,7 +1656,7 @@ type ContextMenuProps = {
|
|
|
1652
1656
|
* 1. By providing a `triggerRef`, which will render the menu when the referenced element is right-clicked.
|
|
1653
1657
|
* 2. By providing a `position` prop, which will render the menu at the specified coordinates.
|
|
1654
1658
|
*/
|
|
1655
|
-
declare const ContextMenu: ({ position, triggerRef, children, side, onRequestClose, }: ContextMenuProps) => react_jsx_runtime.JSX.Element | null;
|
|
1659
|
+
declare const ContextMenu: ({ position, triggerRef, children, side, onRequestClose, compact, }: ContextMenuProps) => react_jsx_runtime.JSX.Element | null;
|
|
1656
1660
|
|
|
1657
1661
|
type DataCardProps = ComponentPropsWithoutRef<'div'> & Partial<Pick<ButtonAsLinkProps, 'beforeAction' | 'disabled' | 'href' | 'onClick' | 'type'>> & {
|
|
1658
1662
|
/**
|
|
@@ -2369,6 +2373,10 @@ type FormFieldProps = ComponentPropsWithoutRef<'div'> & {
|
|
|
2369
2373
|
* The name attribute of the field. It will map to the form data passed into `useFormState`.
|
|
2370
2374
|
*/
|
|
2371
2375
|
name: string;
|
|
2376
|
+
/**
|
|
2377
|
+
* Use if label describes a required form component
|
|
2378
|
+
*/
|
|
2379
|
+
required?: boolean;
|
|
2372
2380
|
/**
|
|
2373
2381
|
* A value that overrides the basic value. This should pair with `onChange`.
|
|
2374
2382
|
*/
|
|
@@ -2382,7 +2390,7 @@ type FormFieldProps = ComponentPropsWithoutRef<'div'> & {
|
|
|
2382
2390
|
* FormField is a compound component that combines a label, form control, and optional description and error message.
|
|
2383
2391
|
*/
|
|
2384
2392
|
declare const FormField: {
|
|
2385
|
-
({ children, description, error, id, label, labelPosition, name, value, ...props }: FormFieldProps): JSX$1.Element;
|
|
2393
|
+
({ children, description, error, id, label, labelPosition, name, required, value, ...props }: FormFieldProps): JSX$1.Element;
|
|
2386
2394
|
displayName: string;
|
|
2387
2395
|
};
|
|
2388
2396
|
|
|
@@ -3075,6 +3083,10 @@ type ModalProps = ComponentPropsWithoutRef<'div'> & {
|
|
|
3075
3083
|
* Determines if the title is visible
|
|
3076
3084
|
*/
|
|
3077
3085
|
hideTitle?: boolean;
|
|
3086
|
+
/**
|
|
3087
|
+
* The maximum width the modal can be
|
|
3088
|
+
*/
|
|
3089
|
+
maxWidth?: string;
|
|
3078
3090
|
/**
|
|
3079
3091
|
* When the Modal is dismissed, this function will be called. You'll typically want to set the
|
|
3080
3092
|
* state of `isOpen` to false here
|
|
@@ -3123,6 +3135,10 @@ declare const Modal: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProp
|
|
|
3123
3135
|
* Determines if the title is visible
|
|
3124
3136
|
*/
|
|
3125
3137
|
hideTitle?: boolean;
|
|
3138
|
+
/**
|
|
3139
|
+
* The maximum width the modal can be
|
|
3140
|
+
*/
|
|
3141
|
+
maxWidth?: string;
|
|
3126
3142
|
/**
|
|
3127
3143
|
* When the Modal is dismissed, this function will be called. You'll typically want to set the
|
|
3128
3144
|
* state of `isOpen` to false here
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.15.
|
|
3
|
+
* @license @wistia/ui v0.15.14-beta.50e89a95.396fb5b
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -12877,6 +12877,7 @@ var Combobox2 = ({
|
|
|
12877
12877
|
// src/components/ContextMenu/ContextMenu.tsx
|
|
12878
12878
|
import { isNil as isNil16, isNotNil as isNotNil24 } from "@wistia/type-guards";
|
|
12879
12879
|
import { useEffect as useEffect16, useState as useState17 } from "react";
|
|
12880
|
+
import { createPortal } from "react-dom";
|
|
12880
12881
|
|
|
12881
12882
|
// src/components/Menu/Menu.tsx
|
|
12882
12883
|
import {
|
|
@@ -13558,7 +13559,8 @@ var ContextMenu = ({
|
|
|
13558
13559
|
triggerRef,
|
|
13559
13560
|
children,
|
|
13560
13561
|
side = "bottom",
|
|
13561
|
-
onRequestClose = () => null
|
|
13562
|
+
onRequestClose = () => null,
|
|
13563
|
+
compact = false
|
|
13562
13564
|
}) => {
|
|
13563
13565
|
const [isRightClicked, setIsRightClicked] = useState17(false);
|
|
13564
13566
|
const [menuPosition, setMenuPosition] = useState17(position ?? { x: 0, y: 0 });
|
|
@@ -13578,9 +13580,13 @@ var ContextMenu = ({
|
|
|
13578
13580
|
return () => null;
|
|
13579
13581
|
}, [position, triggerRef]);
|
|
13580
13582
|
const isOpen = isNotNil24(position) || isRightClicked;
|
|
13581
|
-
|
|
13583
|
+
if (!isOpen) {
|
|
13584
|
+
return null;
|
|
13585
|
+
}
|
|
13586
|
+
const menu = /* @__PURE__ */ jsx267(
|
|
13582
13587
|
Menu,
|
|
13583
13588
|
{
|
|
13589
|
+
compact,
|
|
13584
13590
|
isOpen,
|
|
13585
13591
|
onOpenChange: (next) => {
|
|
13586
13592
|
setIsRightClicked(next);
|
|
@@ -13606,7 +13612,11 @@ var ContextMenu = ({
|
|
|
13606
13612
|
),
|
|
13607
13613
|
children
|
|
13608
13614
|
}
|
|
13609
|
-
)
|
|
13615
|
+
);
|
|
13616
|
+
if (isNotNil24(triggerRef)) {
|
|
13617
|
+
return createPortal(menu, document.body);
|
|
13618
|
+
}
|
|
13619
|
+
return menu;
|
|
13610
13620
|
};
|
|
13611
13621
|
|
|
13612
13622
|
// src/components/DataCards/DataCard.tsx
|
|
@@ -14777,6 +14787,7 @@ var FormField = ({
|
|
|
14777
14787
|
label,
|
|
14778
14788
|
labelPosition,
|
|
14779
14789
|
name,
|
|
14790
|
+
required = false,
|
|
14780
14791
|
value,
|
|
14781
14792
|
...props
|
|
14782
14793
|
}) => {
|
|
@@ -14826,7 +14837,14 @@ var FormField = ({
|
|
|
14826
14837
|
...props,
|
|
14827
14838
|
"data-label-position": labelPosition ?? formState.labelPosition,
|
|
14828
14839
|
children: [
|
|
14829
|
-
!isIntegratedLabel && /* @__PURE__ */ jsx283(
|
|
14840
|
+
!isIntegratedLabel && /* @__PURE__ */ jsx283(
|
|
14841
|
+
Label,
|
|
14842
|
+
{
|
|
14843
|
+
htmlFor: computedId,
|
|
14844
|
+
required,
|
|
14845
|
+
children: label
|
|
14846
|
+
}
|
|
14847
|
+
),
|
|
14830
14848
|
isNotNil28(description) ? /* @__PURE__ */ jsx283(FormControlLabelDescription, { id: descriptionId, children: description }) : null,
|
|
14831
14849
|
cloneElement8(children, childProps),
|
|
14832
14850
|
isNotNil28(computedError) ? /* @__PURE__ */ jsxs46(Fragment9, { children: [
|
|
@@ -15356,7 +15374,7 @@ Mark.displayName = "Mark_UI";
|
|
|
15356
15374
|
import { forwardRef as forwardRef26 } from "react";
|
|
15357
15375
|
import styled78 from "styled-components";
|
|
15358
15376
|
import { Root as DialogRoot, Portal as DialogPortal } from "@radix-ui/react-dialog";
|
|
15359
|
-
import { isNotNil as
|
|
15377
|
+
import { isNotNil as isNotNil33 } from "@wistia/type-guards";
|
|
15360
15378
|
|
|
15361
15379
|
// src/components/Modal/ModalHeader.tsx
|
|
15362
15380
|
import styled75 from "styled-components";
|
|
@@ -15432,6 +15450,7 @@ var ModalHeader = ({
|
|
|
15432
15450
|
import { forwardRef as forwardRef25 } from "react";
|
|
15433
15451
|
import styled76, { css as css38, keyframes as keyframes4 } from "styled-components";
|
|
15434
15452
|
import { Content as DialogContent } from "@radix-ui/react-dialog";
|
|
15453
|
+
import { isNotNil as isNotNil32 } from "@wistia/type-guards";
|
|
15435
15454
|
|
|
15436
15455
|
// src/private/hooks/useFocusRestore/useFocusRestore.ts
|
|
15437
15456
|
import { useRef as useRef20, useEffect as useEffect19 } from "react";
|
|
@@ -15569,9 +15588,14 @@ var StyledModalContent = styled76(DialogContent)`
|
|
|
15569
15588
|
position: fixed;
|
|
15570
15589
|
top: unset;
|
|
15571
15590
|
left: unset;
|
|
15572
|
-
width: ${({ $width }) =>
|
|
15591
|
+
width: ${({ $width, $maxWidth }) => {
|
|
15592
|
+
if (isNotNil32($maxWidth)) {
|
|
15593
|
+
return "auto";
|
|
15594
|
+
}
|
|
15595
|
+
return $width ?? DEFAULT_MODAL_WIDTH;
|
|
15596
|
+
}};
|
|
15573
15597
|
min-width: ${({ $width }) => $width ?? DEFAULT_MODAL_WIDTH};
|
|
15574
|
-
max-width: var(--wui-modal-max-width);
|
|
15598
|
+
max-width: ${({ $maxWidth }) => $maxWidth ?? "var(--wui-modal-max-width)"};
|
|
15575
15599
|
border-radius: var(--wui-border-radius-03);
|
|
15576
15600
|
animation-duration: var(--wui-motion-duration-03);
|
|
15577
15601
|
animation-timing-function: var(--wui-motion-ease-out);
|
|
@@ -15580,12 +15604,13 @@ var StyledModalContent = styled76(DialogContent)`
|
|
|
15580
15604
|
}
|
|
15581
15605
|
`;
|
|
15582
15606
|
var ModalContent = forwardRef25(
|
|
15583
|
-
({ width, positionVariant = "fixed-top", children, ...props }, ref) => {
|
|
15607
|
+
({ width, positionVariant = "fixed-top", maxWidth, children, ...props }, ref) => {
|
|
15584
15608
|
useFocusRestore();
|
|
15585
15609
|
return /* @__PURE__ */ jsx294(
|
|
15586
15610
|
StyledModalContent,
|
|
15587
15611
|
{
|
|
15588
15612
|
ref,
|
|
15613
|
+
$maxWidth: maxWidth,
|
|
15589
15614
|
$positionVariant: positionVariant,
|
|
15590
15615
|
$width: width,
|
|
15591
15616
|
"aria-describedby": void 0,
|
|
@@ -15655,6 +15680,7 @@ var Modal = forwardRef26(
|
|
|
15655
15680
|
hideTitle = false,
|
|
15656
15681
|
initialFocusRef,
|
|
15657
15682
|
isOpen,
|
|
15683
|
+
maxWidth,
|
|
15658
15684
|
onRequestClose,
|
|
15659
15685
|
positionVariant = "centered",
|
|
15660
15686
|
title,
|
|
@@ -15665,7 +15691,7 @@ var Modal = forwardRef26(
|
|
|
15665
15691
|
DialogRoot,
|
|
15666
15692
|
{
|
|
15667
15693
|
onOpenChange: (open2) => {
|
|
15668
|
-
if (!open2 &&
|
|
15694
|
+
if (!open2 && isNotNil33(onRequestClose)) {
|
|
15669
15695
|
onRequestClose();
|
|
15670
15696
|
}
|
|
15671
15697
|
},
|
|
@@ -15676,8 +15702,9 @@ var Modal = forwardRef26(
|
|
|
15676
15702
|
ModalContent,
|
|
15677
15703
|
{
|
|
15678
15704
|
ref,
|
|
15705
|
+
maxWidth,
|
|
15679
15706
|
onOpenAutoFocus: (event) => {
|
|
15680
|
-
if (
|
|
15707
|
+
if (isNotNil33(initialFocusRef) && initialFocusRef.current) {
|
|
15681
15708
|
event.preventDefault();
|
|
15682
15709
|
requestAnimationFrame(() => {
|
|
15683
15710
|
initialFocusRef.current?.focus();
|
|
@@ -15689,7 +15716,7 @@ var Modal = forwardRef26(
|
|
|
15689
15716
|
...props,
|
|
15690
15717
|
children: [
|
|
15691
15718
|
/* @__PURE__ */ jsx295(ModalScrollArea, { children: /* @__PURE__ */ jsx295(ModalBody, { children }) }),
|
|
15692
|
-
|
|
15719
|
+
isNotNil33(footer) ? /* @__PURE__ */ jsx295(ModalFooter, { children: footer }) : null,
|
|
15693
15720
|
hideCloseButton && hideTitle ? null : /* @__PURE__ */ jsx295(
|
|
15694
15721
|
ModalHeader,
|
|
15695
15722
|
{
|
|
@@ -15735,9 +15762,9 @@ import { Root as Root2, Trigger as Trigger2, Portal, Content as Content2, Close
|
|
|
15735
15762
|
import styled80, { css as css40 } from "styled-components";
|
|
15736
15763
|
|
|
15737
15764
|
// src/private/helpers/getControls/getControlProps.tsx
|
|
15738
|
-
import { isNotNil as
|
|
15765
|
+
import { isNotNil as isNotNil34 } from "@wistia/type-guards";
|
|
15739
15766
|
var getControlProps = (isOpen, onOpenChange) => {
|
|
15740
|
-
return
|
|
15767
|
+
return isNotNil34(onOpenChange) && isNotNil34(isOpen) ? { open: isOpen, onOpenChange } : {};
|
|
15741
15768
|
};
|
|
15742
15769
|
|
|
15743
15770
|
// src/components/Popover/PopoverArrow.tsx
|
|
@@ -15893,7 +15920,7 @@ Popover.displayName = "Popover_UI";
|
|
|
15893
15920
|
// src/components/ProgressBar/ProgressBar.tsx
|
|
15894
15921
|
import styled81 from "styled-components";
|
|
15895
15922
|
import { Root as ProgressRoot, Indicator as ProgressIndicator } from "@radix-ui/react-progress";
|
|
15896
|
-
import { isNotNil as
|
|
15923
|
+
import { isNotNil as isNotNil35 } from "@wistia/type-guards";
|
|
15897
15924
|
import { jsx as jsx299, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
15898
15925
|
var ProgressBarWrapper = styled81.div`
|
|
15899
15926
|
--progress-bar-height: 8px;
|
|
@@ -15949,7 +15976,7 @@ var ProgressBar = ({
|
|
|
15949
15976
|
...props
|
|
15950
15977
|
}) => {
|
|
15951
15978
|
return /* @__PURE__ */ jsxs54(ProgressBarWrapper, { children: [
|
|
15952
|
-
|
|
15979
|
+
isNotNil35(labelLeft) ? /* @__PURE__ */ jsx299(ProgressBarLabel, { children: labelLeft }) : null,
|
|
15953
15980
|
/* @__PURE__ */ jsx299(
|
|
15954
15981
|
StyledProgressBar,
|
|
15955
15982
|
{
|
|
@@ -15967,7 +15994,7 @@ var ProgressBar = ({
|
|
|
15967
15994
|
)
|
|
15968
15995
|
}
|
|
15969
15996
|
),
|
|
15970
|
-
|
|
15997
|
+
isNotNil35(labelRight) ? /* @__PURE__ */ jsx299(ProgressBarLabel, { children: labelRight }) : null
|
|
15971
15998
|
] });
|
|
15972
15999
|
};
|
|
15973
16000
|
ProgressBar.displayName = "ProgressBar_UI";
|
|
@@ -16288,7 +16315,7 @@ RadioCardRoot.displayName = "RadioCardRoot_UI";
|
|
|
16288
16315
|
|
|
16289
16316
|
// src/components/RadioCard/RadioCardDefaultLayout.tsx
|
|
16290
16317
|
import styled85 from "styled-components";
|
|
16291
|
-
import { isNotNil as
|
|
16318
|
+
import { isNotNil as isNotNil36 } from "@wistia/type-guards";
|
|
16292
16319
|
|
|
16293
16320
|
// src/components/RadioCard/RadioCardIndicator.tsx
|
|
16294
16321
|
import styled84 from "styled-components";
|
|
@@ -16362,17 +16389,17 @@ var RadioCardDefaultLayout = ({
|
|
|
16362
16389
|
showIndicator = true
|
|
16363
16390
|
}) => {
|
|
16364
16391
|
return /* @__PURE__ */ jsxs57(StyledCardContent, { children: [
|
|
16365
|
-
showIndicator ? /* @__PURE__ */ jsx302(StyledIndicatorContainer, { $hasIcon:
|
|
16392
|
+
showIndicator ? /* @__PURE__ */ jsx302(StyledIndicatorContainer, { $hasIcon: isNotNil36(icon), children: /* @__PURE__ */ jsx302(RadioCardIndicator, { "data-testid": "wui-radio-card-indicator" }) }) : null,
|
|
16366
16393
|
/* @__PURE__ */ jsxs57(Stack, { gap: "space-02", children: [
|
|
16367
|
-
|
|
16394
|
+
isNotNil36(icon) && /* @__PURE__ */ jsx302(StyledCardIcon, { "data-wui-radio-card-icon": true, children: icon }),
|
|
16368
16395
|
/* @__PURE__ */ jsxs57(
|
|
16369
16396
|
Stack,
|
|
16370
16397
|
{
|
|
16371
16398
|
gap: "space-01",
|
|
16372
|
-
style:
|
|
16399
|
+
style: isNotNil36(icon) ? { paddingLeft: 2 } : void 0,
|
|
16373
16400
|
children: [
|
|
16374
|
-
|
|
16375
|
-
|
|
16401
|
+
isNotNil36(label) && /* @__PURE__ */ jsx302(Text, { variant: "label3", children: /* @__PURE__ */ jsx302("strong", { children: label }) }),
|
|
16402
|
+
isNotNil36(description) && /* @__PURE__ */ jsx302(
|
|
16376
16403
|
Text,
|
|
16377
16404
|
{
|
|
16378
16405
|
prominence: "secondary",
|
|
@@ -16692,7 +16719,7 @@ SegmentedControl.displayName = "SegmentedControl_UI";
|
|
|
16692
16719
|
import { forwardRef as forwardRef33, useEffect as useEffect21, useRef as useRef22 } from "react";
|
|
16693
16720
|
import styled90, { css as css45 } from "styled-components";
|
|
16694
16721
|
import { Item as ToggleGroupItem2 } from "@radix-ui/react-toggle-group";
|
|
16695
|
-
import { isNotNil as
|
|
16722
|
+
import { isNotNil as isNotNil37 } from "@wistia/type-guards";
|
|
16696
16723
|
import { jsxs as jsxs60 } from "react/jsx-runtime";
|
|
16697
16724
|
var segmentedControlItemStyles = css45`
|
|
16698
16725
|
all: unset; /* ToggleGroupItem is a button element */
|
|
@@ -16808,8 +16835,8 @@ var SegmentedControlItem = forwardRef33(
|
|
|
16808
16835
|
{
|
|
16809
16836
|
ref: combinedRef,
|
|
16810
16837
|
...otherProps,
|
|
16811
|
-
$hasLabel:
|
|
16812
|
-
"aria-label":
|
|
16838
|
+
$hasLabel: isNotNil37(label),
|
|
16839
|
+
"aria-label": isNotNil37(label) ? void 0 : ariaLabel,
|
|
16813
16840
|
disabled,
|
|
16814
16841
|
onClick: handleClick,
|
|
16815
16842
|
value,
|
|
@@ -16983,7 +17010,7 @@ Select.displayName = "Select_UI";
|
|
|
16983
17010
|
import { Item, ItemText, ItemIndicator } from "@radix-ui/react-select";
|
|
16984
17011
|
import { forwardRef as forwardRef35 } from "react";
|
|
16985
17012
|
import styled92 from "styled-components";
|
|
16986
|
-
import { isNotNil as
|
|
17013
|
+
import { isNotNil as isNotNil38 } from "@wistia/type-guards";
|
|
16987
17014
|
import { jsx as jsx310, jsxs as jsxs62 } from "react/jsx-runtime";
|
|
16988
17015
|
var StyledItem = styled92(Item)`
|
|
16989
17016
|
${getTypographicStyles("label3")}
|
|
@@ -17020,7 +17047,7 @@ var SelectOption = forwardRef35(
|
|
|
17020
17047
|
ref: forwardedRef,
|
|
17021
17048
|
$checkmarkVerticalAlign: checkmarkVerticalAlign,
|
|
17022
17049
|
children: [
|
|
17023
|
-
|
|
17050
|
+
isNotNil38(selectedDisplayValue) ? /* @__PURE__ */ jsxs62("div", { children: [
|
|
17024
17051
|
children,
|
|
17025
17052
|
/* @__PURE__ */ jsx310("div", { style: { display: "none" }, children: /* @__PURE__ */ jsx310(ItemText, { children: selectedDisplayValue }) })
|
|
17026
17053
|
] }) : /* @__PURE__ */ jsx310(ItemText, { children }),
|
|
@@ -17308,7 +17335,7 @@ var TableRow = ({ children, ...props }) => {
|
|
|
17308
17335
|
// src/components/Tabs/Tabs.tsx
|
|
17309
17336
|
import { Root as RadixTabsRoot } from "@radix-ui/react-tabs";
|
|
17310
17337
|
import { useCallback as useCallback19, useState as useState25 } from "react";
|
|
17311
|
-
import { isNotNil as
|
|
17338
|
+
import { isNotNil as isNotNil39 } from "@wistia/type-guards";
|
|
17312
17339
|
|
|
17313
17340
|
// src/components/Tabs/useTabsValue.tsx
|
|
17314
17341
|
import { createContext as createContext12, useContext as useContext18 } from "react";
|
|
@@ -17345,10 +17372,10 @@ var Tabs = ({
|
|
|
17345
17372
|
...props,
|
|
17346
17373
|
onValueChange
|
|
17347
17374
|
};
|
|
17348
|
-
if (
|
|
17375
|
+
if (isNotNil39(value)) {
|
|
17349
17376
|
rootProps.value = value;
|
|
17350
17377
|
}
|
|
17351
|
-
if (
|
|
17378
|
+
if (isNotNil39(defaultValue)) {
|
|
17352
17379
|
rootProps.defaultValue = defaultValue;
|
|
17353
17380
|
}
|
|
17354
17381
|
return /* @__PURE__ */ jsx319(RadixTabsRoot, { ...rootProps, children: /* @__PURE__ */ jsx319(TabsValueProvider, { value: value ?? defaultValue, children: /* @__PURE__ */ jsx319(SelectedItemStyleProvider, { children }) }) });
|
|
@@ -17417,7 +17444,7 @@ TabsList.displayName = "TabsList_UI";
|
|
|
17417
17444
|
|
|
17418
17445
|
// src/components/Tabs/TabsTrigger.tsx
|
|
17419
17446
|
import { forwardRef as forwardRef36, useEffect as useEffect22, useRef as useRef23 } from "react";
|
|
17420
|
-
import { isNotNil as
|
|
17447
|
+
import { isNotNil as isNotNil40 } from "@wistia/type-guards";
|
|
17421
17448
|
|
|
17422
17449
|
// src/components/Tabs/StyledRadixTabsTrigger.tsx
|
|
17423
17450
|
import styled103 from "styled-components";
|
|
@@ -17468,8 +17495,8 @@ var TabsTrigger = forwardRef36(
|
|
|
17468
17495
|
{
|
|
17469
17496
|
...otherProps,
|
|
17470
17497
|
ref: combinedRef,
|
|
17471
|
-
$hasLabel:
|
|
17472
|
-
"aria-label":
|
|
17498
|
+
$hasLabel: isNotNil40(label),
|
|
17499
|
+
"aria-label": isNotNil40(label) ? void 0 : ariaLabel,
|
|
17473
17500
|
disabled,
|
|
17474
17501
|
value,
|
|
17475
17502
|
children: [
|
|
@@ -17484,7 +17511,7 @@ TabsTrigger.displayName = "TabsTrigger_UI";
|
|
|
17484
17511
|
|
|
17485
17512
|
// src/components/Thumbnail/ThumbnailBadge.tsx
|
|
17486
17513
|
import styled104 from "styled-components";
|
|
17487
|
-
import { isNotNil as
|
|
17514
|
+
import { isNotNil as isNotNil41 } from "@wistia/type-guards";
|
|
17488
17515
|
import { jsx as jsx323, jsxs as jsxs67 } from "react/jsx-runtime";
|
|
17489
17516
|
var StyledThumbnailBadge = styled104.div`
|
|
17490
17517
|
align-items: center;
|
|
@@ -17513,7 +17540,7 @@ var StyledThumbnailBadge = styled104.div`
|
|
|
17513
17540
|
`;
|
|
17514
17541
|
var ThumbnailBadge = ({ icon, label, ...props }) => {
|
|
17515
17542
|
return /* @__PURE__ */ jsxs67(StyledThumbnailBadge, { ...props, children: [
|
|
17516
|
-
|
|
17543
|
+
isNotNil41(icon) && icon,
|
|
17517
17544
|
/* @__PURE__ */ jsx323("span", { children: label })
|
|
17518
17545
|
] });
|
|
17519
17546
|
};
|
|
@@ -17522,10 +17549,10 @@ ThumbnailBadge.displayName = "ThumbnailBadge_UI";
|
|
|
17522
17549
|
// src/components/Thumbnail/Thumbnail.tsx
|
|
17523
17550
|
import { forwardRef as forwardRef37, useState as useState26, useRef as useRef24, useCallback as useCallback20, useMemo as useMemo17 } from "react";
|
|
17524
17551
|
import styled106 from "styled-components";
|
|
17525
|
-
import { isNil as isNil19, isNotNil as
|
|
17552
|
+
import { isNil as isNil19, isNotNil as isNotNil44, isUndefined as isUndefined7, isEmptyString as isEmptyString2, isString as isString4 } from "@wistia/type-guards";
|
|
17526
17553
|
|
|
17527
17554
|
// src/private/helpers/getBackgroundGradient/getBackgroundGradient.ts
|
|
17528
|
-
import { isNotNil as
|
|
17555
|
+
import { isNotNil as isNotNil42 } from "@wistia/type-guards";
|
|
17529
17556
|
import { css as css49 } from "styled-components";
|
|
17530
17557
|
var gradients = {
|
|
17531
17558
|
defaultDarkOne: css49`
|
|
@@ -17653,12 +17680,12 @@ var gradients = {
|
|
|
17653
17680
|
};
|
|
17654
17681
|
var gradientMap = Object.keys(gradients);
|
|
17655
17682
|
var getBackgroundGradient = (gradientName = void 0) => {
|
|
17656
|
-
return
|
|
17683
|
+
return isNotNil42(gradientName) ? gradients[gradientName] : gradients.defaultDarkOne;
|
|
17657
17684
|
};
|
|
17658
17685
|
|
|
17659
17686
|
// src/components/Thumbnail/ThumbnailStoryboardViewer.tsx
|
|
17660
17687
|
import styled105 from "styled-components";
|
|
17661
|
-
import { isNotNil as
|
|
17688
|
+
import { isNotNil as isNotNil43 } from "@wistia/type-guards";
|
|
17662
17689
|
import { jsx as jsx324, jsxs as jsxs68 } from "react/jsx-runtime";
|
|
17663
17690
|
var ScrubLine = styled105.div`
|
|
17664
17691
|
position: absolute;
|
|
@@ -17752,8 +17779,8 @@ var ThumbnailStoryboardViewer = ({
|
|
|
17752
17779
|
);
|
|
17753
17780
|
const backgroundSize = `${scaledStoryboardWidth}px ${scaledStoryboardHeight}px`;
|
|
17754
17781
|
const backgroundImage = `url(${storyboardUrl})`;
|
|
17755
|
-
const showScrubLine =
|
|
17756
|
-
const scrubLinePosition =
|
|
17782
|
+
const showScrubLine = isNotNil43(cursorPosition);
|
|
17783
|
+
const scrubLinePosition = isNotNil43(cursorPosition) ? `${cursorPosition - 1}px` : "0";
|
|
17757
17784
|
const viewerStyles = {
|
|
17758
17785
|
position: "relative",
|
|
17759
17786
|
overflow: "hidden",
|
|
@@ -17824,7 +17851,7 @@ var ThumbnailImage = ({ thumbnailImageType, thumbnailUrl }) => {
|
|
|
17824
17851
|
);
|
|
17825
17852
|
};
|
|
17826
17853
|
var StyledThumbnail = styled106.div`
|
|
17827
|
-
background-image: ${({ $backgroundUrl }) =>
|
|
17854
|
+
background-image: ${({ $backgroundUrl }) => isNotNil44($backgroundUrl) ? `url('${$backgroundUrl}')` : void 0};
|
|
17828
17855
|
${({ $backgroundUrl, $gradientBackground }) => (
|
|
17829
17856
|
// if we don't have $backgroundUrl show a gradient
|
|
17830
17857
|
isNil19($backgroundUrl) ? getBackgroundGradient($gradientBackground) : void 0
|
|
@@ -17903,10 +17930,10 @@ var Thumbnail = forwardRef37(
|
|
|
17903
17930
|
const storyboardElementRef = useRef24(null);
|
|
17904
17931
|
const [cursorPosition, setCursorPosition] = useState26(null);
|
|
17905
17932
|
const backgroundUrl = useMemo17(
|
|
17906
|
-
() => thumbnailImageType === "square" &&
|
|
17933
|
+
() => thumbnailImageType === "square" && isNotNil44(thumbnailUrl) ? thumbnailUrl : void 0,
|
|
17907
17934
|
[thumbnailImageType, thumbnailUrl]
|
|
17908
17935
|
);
|
|
17909
|
-
const isScrubbable =
|
|
17936
|
+
const isScrubbable = isNotNil44(storyboard);
|
|
17910
17937
|
const trackStoryboardLoadStatus = useCallback20(() => {
|
|
17911
17938
|
if (storyboardElementRef.current || !storyboard) {
|
|
17912
17939
|
return storyboardElementRef.current;
|
|
@@ -17953,7 +17980,7 @@ var Thumbnail = forwardRef37(
|
|
|
17953
17980
|
width
|
|
17954
17981
|
}
|
|
17955
17982
|
);
|
|
17956
|
-
} else if (
|
|
17983
|
+
} else if (isNotNil44(thumbnailUrl)) {
|
|
17957
17984
|
thumbnailContent = /* @__PURE__ */ jsx325(
|
|
17958
17985
|
ThumbnailImage,
|
|
17959
17986
|
{
|
|
@@ -17978,7 +18005,7 @@ var Thumbnail = forwardRef37(
|
|
|
17978
18005
|
onMouseOut: handleMouseOut,
|
|
17979
18006
|
role: "presentation",
|
|
17980
18007
|
children: [
|
|
17981
|
-
|
|
18008
|
+
isNotNil44(children) ? children : null,
|
|
17982
18009
|
thumbnailContent
|
|
17983
18010
|
]
|
|
17984
18011
|
}
|
|
@@ -18096,7 +18123,7 @@ var ThumbnailCollage = ({
|
|
|
18096
18123
|
|
|
18097
18124
|
// src/components/WistiaLogo/WistiaLogo.tsx
|
|
18098
18125
|
import styled108, { css as css50 } from "styled-components";
|
|
18099
|
-
import { isNotNil as
|
|
18126
|
+
import { isNotNil as isNotNil45 } from "@wistia/type-guards";
|
|
18100
18127
|
import { jsx as jsx327, jsxs as jsxs70 } from "react/jsx-runtime";
|
|
18101
18128
|
var renderBrandmark = (brandmarkColor, iconOnly) => {
|
|
18102
18129
|
if (iconOnly) {
|
|
@@ -18209,7 +18236,7 @@ var WistiaLogo = ({
|
|
|
18209
18236
|
...props,
|
|
18210
18237
|
children: [
|
|
18211
18238
|
/* @__PURE__ */ jsx327("title", { children: title }),
|
|
18212
|
-
|
|
18239
|
+
isNotNil45(description) ? /* @__PURE__ */ jsx327("desc", { children: description }) : null,
|
|
18213
18240
|
renderBrandmark(brandmarkColor, iconOnly),
|
|
18214
18241
|
renderLogotype(logotypeColor, iconOnly)
|
|
18215
18242
|
]
|
|
@@ -18221,7 +18248,7 @@ WistiaLogo.displayName = "WistiaLogo_UI";
|
|
|
18221
18248
|
|
|
18222
18249
|
// src/components/SplitButton/SplitButton.tsx
|
|
18223
18250
|
import styled109 from "styled-components";
|
|
18224
|
-
import { isNotNil as
|
|
18251
|
+
import { isNotNil as isNotNil46 } from "@wistia/type-guards";
|
|
18225
18252
|
import { cloneElement as cloneElement9 } from "react";
|
|
18226
18253
|
import { jsx as jsx328, jsxs as jsxs71 } from "react/jsx-runtime";
|
|
18227
18254
|
var StyledSplitButton = styled109.span`
|
|
@@ -18268,7 +18295,7 @@ var SplitButton = ({
|
|
|
18268
18295
|
children
|
|
18269
18296
|
}
|
|
18270
18297
|
),
|
|
18271
|
-
|
|
18298
|
+
isNotNil46(menuItems) && /* @__PURE__ */ jsx328(
|
|
18272
18299
|
Menu,
|
|
18273
18300
|
{
|
|
18274
18301
|
...menuProps,
|
|
@@ -18287,7 +18314,7 @@ var SplitButton = ({
|
|
|
18287
18314
|
children: menuItems
|
|
18288
18315
|
}
|
|
18289
18316
|
),
|
|
18290
|
-
|
|
18317
|
+
isNotNil46(secondaryAction) && cloneElement9(secondaryAction, { disabled, size, unstyled, variant, colorScheme })
|
|
18291
18318
|
] });
|
|
18292
18319
|
};
|
|
18293
18320
|
SplitButton.displayName = "SplitButton_UI";
|