@wistia/ui 0.15.14-beta.1e41934b.72b042b → 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 +86 -69
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +13 -1
- package/dist/index.d.ts +13 -1
- package/dist/index.mjs +67 -50
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -2373,6 +2373,10 @@ type FormFieldProps = ComponentPropsWithoutRef<'div'> & {
|
|
|
2373
2373
|
* The name attribute of the field. It will map to the form data passed into `useFormState`.
|
|
2374
2374
|
*/
|
|
2375
2375
|
name: string;
|
|
2376
|
+
/**
|
|
2377
|
+
* Use if label describes a required form component
|
|
2378
|
+
*/
|
|
2379
|
+
required?: boolean;
|
|
2376
2380
|
/**
|
|
2377
2381
|
* A value that overrides the basic value. This should pair with `onChange`.
|
|
2378
2382
|
*/
|
|
@@ -2386,7 +2390,7 @@ type FormFieldProps = ComponentPropsWithoutRef<'div'> & {
|
|
|
2386
2390
|
* FormField is a compound component that combines a label, form control, and optional description and error message.
|
|
2387
2391
|
*/
|
|
2388
2392
|
declare const FormField: {
|
|
2389
|
-
({ 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;
|
|
2390
2394
|
displayName: string;
|
|
2391
2395
|
};
|
|
2392
2396
|
|
|
@@ -3079,6 +3083,10 @@ type ModalProps = ComponentPropsWithoutRef<'div'> & {
|
|
|
3079
3083
|
* Determines if the title is visible
|
|
3080
3084
|
*/
|
|
3081
3085
|
hideTitle?: boolean;
|
|
3086
|
+
/**
|
|
3087
|
+
* The maximum width the modal can be
|
|
3088
|
+
*/
|
|
3089
|
+
maxWidth?: string;
|
|
3082
3090
|
/**
|
|
3083
3091
|
* When the Modal is dismissed, this function will be called. You'll typically want to set the
|
|
3084
3092
|
* state of `isOpen` to false here
|
|
@@ -3127,6 +3135,10 @@ declare const Modal: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProp
|
|
|
3127
3135
|
* Determines if the title is visible
|
|
3128
3136
|
*/
|
|
3129
3137
|
hideTitle?: boolean;
|
|
3138
|
+
/**
|
|
3139
|
+
* The maximum width the modal can be
|
|
3140
|
+
*/
|
|
3141
|
+
maxWidth?: string;
|
|
3130
3142
|
/**
|
|
3131
3143
|
* When the Modal is dismissed, this function will be called. You'll typically want to set the
|
|
3132
3144
|
* state of `isOpen` to false here
|
package/dist/index.d.ts
CHANGED
|
@@ -2373,6 +2373,10 @@ type FormFieldProps = ComponentPropsWithoutRef<'div'> & {
|
|
|
2373
2373
|
* The name attribute of the field. It will map to the form data passed into `useFormState`.
|
|
2374
2374
|
*/
|
|
2375
2375
|
name: string;
|
|
2376
|
+
/**
|
|
2377
|
+
* Use if label describes a required form component
|
|
2378
|
+
*/
|
|
2379
|
+
required?: boolean;
|
|
2376
2380
|
/**
|
|
2377
2381
|
* A value that overrides the basic value. This should pair with `onChange`.
|
|
2378
2382
|
*/
|
|
@@ -2386,7 +2390,7 @@ type FormFieldProps = ComponentPropsWithoutRef<'div'> & {
|
|
|
2386
2390
|
* FormField is a compound component that combines a label, form control, and optional description and error message.
|
|
2387
2391
|
*/
|
|
2388
2392
|
declare const FormField: {
|
|
2389
|
-
({ 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;
|
|
2390
2394
|
displayName: string;
|
|
2391
2395
|
};
|
|
2392
2396
|
|
|
@@ -3079,6 +3083,10 @@ type ModalProps = ComponentPropsWithoutRef<'div'> & {
|
|
|
3079
3083
|
* Determines if the title is visible
|
|
3080
3084
|
*/
|
|
3081
3085
|
hideTitle?: boolean;
|
|
3086
|
+
/**
|
|
3087
|
+
* The maximum width the modal can be
|
|
3088
|
+
*/
|
|
3089
|
+
maxWidth?: string;
|
|
3082
3090
|
/**
|
|
3083
3091
|
* When the Modal is dismissed, this function will be called. You'll typically want to set the
|
|
3084
3092
|
* state of `isOpen` to false here
|
|
@@ -3127,6 +3135,10 @@ declare const Modal: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProp
|
|
|
3127
3135
|
* Determines if the title is visible
|
|
3128
3136
|
*/
|
|
3129
3137
|
hideTitle?: boolean;
|
|
3138
|
+
/**
|
|
3139
|
+
* The maximum width the modal can be
|
|
3140
|
+
*/
|
|
3141
|
+
maxWidth?: string;
|
|
3130
3142
|
/**
|
|
3131
3143
|
* When the Modal is dismissed, this function will be called. You'll typically want to set the
|
|
3132
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.14-beta.
|
|
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
|
*
|
|
@@ -14787,6 +14787,7 @@ var FormField = ({
|
|
|
14787
14787
|
label,
|
|
14788
14788
|
labelPosition,
|
|
14789
14789
|
name,
|
|
14790
|
+
required = false,
|
|
14790
14791
|
value,
|
|
14791
14792
|
...props
|
|
14792
14793
|
}) => {
|
|
@@ -14836,7 +14837,14 @@ var FormField = ({
|
|
|
14836
14837
|
...props,
|
|
14837
14838
|
"data-label-position": labelPosition ?? formState.labelPosition,
|
|
14838
14839
|
children: [
|
|
14839
|
-
!isIntegratedLabel && /* @__PURE__ */ jsx283(
|
|
14840
|
+
!isIntegratedLabel && /* @__PURE__ */ jsx283(
|
|
14841
|
+
Label,
|
|
14842
|
+
{
|
|
14843
|
+
htmlFor: computedId,
|
|
14844
|
+
required,
|
|
14845
|
+
children: label
|
|
14846
|
+
}
|
|
14847
|
+
),
|
|
14840
14848
|
isNotNil28(description) ? /* @__PURE__ */ jsx283(FormControlLabelDescription, { id: descriptionId, children: description }) : null,
|
|
14841
14849
|
cloneElement8(children, childProps),
|
|
14842
14850
|
isNotNil28(computedError) ? /* @__PURE__ */ jsxs46(Fragment9, { children: [
|
|
@@ -15366,7 +15374,7 @@ Mark.displayName = "Mark_UI";
|
|
|
15366
15374
|
import { forwardRef as forwardRef26 } from "react";
|
|
15367
15375
|
import styled78 from "styled-components";
|
|
15368
15376
|
import { Root as DialogRoot, Portal as DialogPortal } from "@radix-ui/react-dialog";
|
|
15369
|
-
import { isNotNil as
|
|
15377
|
+
import { isNotNil as isNotNil33 } from "@wistia/type-guards";
|
|
15370
15378
|
|
|
15371
15379
|
// src/components/Modal/ModalHeader.tsx
|
|
15372
15380
|
import styled75 from "styled-components";
|
|
@@ -15442,6 +15450,7 @@ var ModalHeader = ({
|
|
|
15442
15450
|
import { forwardRef as forwardRef25 } from "react";
|
|
15443
15451
|
import styled76, { css as css38, keyframes as keyframes4 } from "styled-components";
|
|
15444
15452
|
import { Content as DialogContent } from "@radix-ui/react-dialog";
|
|
15453
|
+
import { isNotNil as isNotNil32 } from "@wistia/type-guards";
|
|
15445
15454
|
|
|
15446
15455
|
// src/private/hooks/useFocusRestore/useFocusRestore.ts
|
|
15447
15456
|
import { useRef as useRef20, useEffect as useEffect19 } from "react";
|
|
@@ -15579,9 +15588,14 @@ var StyledModalContent = styled76(DialogContent)`
|
|
|
15579
15588
|
position: fixed;
|
|
15580
15589
|
top: unset;
|
|
15581
15590
|
left: unset;
|
|
15582
|
-
width: ${({ $width }) =>
|
|
15591
|
+
width: ${({ $width, $maxWidth }) => {
|
|
15592
|
+
if (isNotNil32($maxWidth)) {
|
|
15593
|
+
return "auto";
|
|
15594
|
+
}
|
|
15595
|
+
return $width ?? DEFAULT_MODAL_WIDTH;
|
|
15596
|
+
}};
|
|
15583
15597
|
min-width: ${({ $width }) => $width ?? DEFAULT_MODAL_WIDTH};
|
|
15584
|
-
max-width: var(--wui-modal-max-width);
|
|
15598
|
+
max-width: ${({ $maxWidth }) => $maxWidth ?? "var(--wui-modal-max-width)"};
|
|
15585
15599
|
border-radius: var(--wui-border-radius-03);
|
|
15586
15600
|
animation-duration: var(--wui-motion-duration-03);
|
|
15587
15601
|
animation-timing-function: var(--wui-motion-ease-out);
|
|
@@ -15590,12 +15604,13 @@ var StyledModalContent = styled76(DialogContent)`
|
|
|
15590
15604
|
}
|
|
15591
15605
|
`;
|
|
15592
15606
|
var ModalContent = forwardRef25(
|
|
15593
|
-
({ width, positionVariant = "fixed-top", children, ...props }, ref) => {
|
|
15607
|
+
({ width, positionVariant = "fixed-top", maxWidth, children, ...props }, ref) => {
|
|
15594
15608
|
useFocusRestore();
|
|
15595
15609
|
return /* @__PURE__ */ jsx294(
|
|
15596
15610
|
StyledModalContent,
|
|
15597
15611
|
{
|
|
15598
15612
|
ref,
|
|
15613
|
+
$maxWidth: maxWidth,
|
|
15599
15614
|
$positionVariant: positionVariant,
|
|
15600
15615
|
$width: width,
|
|
15601
15616
|
"aria-describedby": void 0,
|
|
@@ -15665,6 +15680,7 @@ var Modal = forwardRef26(
|
|
|
15665
15680
|
hideTitle = false,
|
|
15666
15681
|
initialFocusRef,
|
|
15667
15682
|
isOpen,
|
|
15683
|
+
maxWidth,
|
|
15668
15684
|
onRequestClose,
|
|
15669
15685
|
positionVariant = "centered",
|
|
15670
15686
|
title,
|
|
@@ -15675,7 +15691,7 @@ var Modal = forwardRef26(
|
|
|
15675
15691
|
DialogRoot,
|
|
15676
15692
|
{
|
|
15677
15693
|
onOpenChange: (open2) => {
|
|
15678
|
-
if (!open2 &&
|
|
15694
|
+
if (!open2 && isNotNil33(onRequestClose)) {
|
|
15679
15695
|
onRequestClose();
|
|
15680
15696
|
}
|
|
15681
15697
|
},
|
|
@@ -15686,8 +15702,9 @@ var Modal = forwardRef26(
|
|
|
15686
15702
|
ModalContent,
|
|
15687
15703
|
{
|
|
15688
15704
|
ref,
|
|
15705
|
+
maxWidth,
|
|
15689
15706
|
onOpenAutoFocus: (event) => {
|
|
15690
|
-
if (
|
|
15707
|
+
if (isNotNil33(initialFocusRef) && initialFocusRef.current) {
|
|
15691
15708
|
event.preventDefault();
|
|
15692
15709
|
requestAnimationFrame(() => {
|
|
15693
15710
|
initialFocusRef.current?.focus();
|
|
@@ -15699,7 +15716,7 @@ var Modal = forwardRef26(
|
|
|
15699
15716
|
...props,
|
|
15700
15717
|
children: [
|
|
15701
15718
|
/* @__PURE__ */ jsx295(ModalScrollArea, { children: /* @__PURE__ */ jsx295(ModalBody, { children }) }),
|
|
15702
|
-
|
|
15719
|
+
isNotNil33(footer) ? /* @__PURE__ */ jsx295(ModalFooter, { children: footer }) : null,
|
|
15703
15720
|
hideCloseButton && hideTitle ? null : /* @__PURE__ */ jsx295(
|
|
15704
15721
|
ModalHeader,
|
|
15705
15722
|
{
|
|
@@ -15745,9 +15762,9 @@ import { Root as Root2, Trigger as Trigger2, Portal, Content as Content2, Close
|
|
|
15745
15762
|
import styled80, { css as css40 } from "styled-components";
|
|
15746
15763
|
|
|
15747
15764
|
// src/private/helpers/getControls/getControlProps.tsx
|
|
15748
|
-
import { isNotNil as
|
|
15765
|
+
import { isNotNil as isNotNil34 } from "@wistia/type-guards";
|
|
15749
15766
|
var getControlProps = (isOpen, onOpenChange) => {
|
|
15750
|
-
return
|
|
15767
|
+
return isNotNil34(onOpenChange) && isNotNil34(isOpen) ? { open: isOpen, onOpenChange } : {};
|
|
15751
15768
|
};
|
|
15752
15769
|
|
|
15753
15770
|
// src/components/Popover/PopoverArrow.tsx
|
|
@@ -15903,7 +15920,7 @@ Popover.displayName = "Popover_UI";
|
|
|
15903
15920
|
// src/components/ProgressBar/ProgressBar.tsx
|
|
15904
15921
|
import styled81 from "styled-components";
|
|
15905
15922
|
import { Root as ProgressRoot, Indicator as ProgressIndicator } from "@radix-ui/react-progress";
|
|
15906
|
-
import { isNotNil as
|
|
15923
|
+
import { isNotNil as isNotNil35 } from "@wistia/type-guards";
|
|
15907
15924
|
import { jsx as jsx299, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
15908
15925
|
var ProgressBarWrapper = styled81.div`
|
|
15909
15926
|
--progress-bar-height: 8px;
|
|
@@ -15959,7 +15976,7 @@ var ProgressBar = ({
|
|
|
15959
15976
|
...props
|
|
15960
15977
|
}) => {
|
|
15961
15978
|
return /* @__PURE__ */ jsxs54(ProgressBarWrapper, { children: [
|
|
15962
|
-
|
|
15979
|
+
isNotNil35(labelLeft) ? /* @__PURE__ */ jsx299(ProgressBarLabel, { children: labelLeft }) : null,
|
|
15963
15980
|
/* @__PURE__ */ jsx299(
|
|
15964
15981
|
StyledProgressBar,
|
|
15965
15982
|
{
|
|
@@ -15977,7 +15994,7 @@ var ProgressBar = ({
|
|
|
15977
15994
|
)
|
|
15978
15995
|
}
|
|
15979
15996
|
),
|
|
15980
|
-
|
|
15997
|
+
isNotNil35(labelRight) ? /* @__PURE__ */ jsx299(ProgressBarLabel, { children: labelRight }) : null
|
|
15981
15998
|
] });
|
|
15982
15999
|
};
|
|
15983
16000
|
ProgressBar.displayName = "ProgressBar_UI";
|
|
@@ -16298,7 +16315,7 @@ RadioCardRoot.displayName = "RadioCardRoot_UI";
|
|
|
16298
16315
|
|
|
16299
16316
|
// src/components/RadioCard/RadioCardDefaultLayout.tsx
|
|
16300
16317
|
import styled85 from "styled-components";
|
|
16301
|
-
import { isNotNil as
|
|
16318
|
+
import { isNotNil as isNotNil36 } from "@wistia/type-guards";
|
|
16302
16319
|
|
|
16303
16320
|
// src/components/RadioCard/RadioCardIndicator.tsx
|
|
16304
16321
|
import styled84 from "styled-components";
|
|
@@ -16372,17 +16389,17 @@ var RadioCardDefaultLayout = ({
|
|
|
16372
16389
|
showIndicator = true
|
|
16373
16390
|
}) => {
|
|
16374
16391
|
return /* @__PURE__ */ jsxs57(StyledCardContent, { children: [
|
|
16375
|
-
showIndicator ? /* @__PURE__ */ jsx302(StyledIndicatorContainer, { $hasIcon:
|
|
16392
|
+
showIndicator ? /* @__PURE__ */ jsx302(StyledIndicatorContainer, { $hasIcon: isNotNil36(icon), children: /* @__PURE__ */ jsx302(RadioCardIndicator, { "data-testid": "wui-radio-card-indicator" }) }) : null,
|
|
16376
16393
|
/* @__PURE__ */ jsxs57(Stack, { gap: "space-02", children: [
|
|
16377
|
-
|
|
16394
|
+
isNotNil36(icon) && /* @__PURE__ */ jsx302(StyledCardIcon, { "data-wui-radio-card-icon": true, children: icon }),
|
|
16378
16395
|
/* @__PURE__ */ jsxs57(
|
|
16379
16396
|
Stack,
|
|
16380
16397
|
{
|
|
16381
16398
|
gap: "space-01",
|
|
16382
|
-
style:
|
|
16399
|
+
style: isNotNil36(icon) ? { paddingLeft: 2 } : void 0,
|
|
16383
16400
|
children: [
|
|
16384
|
-
|
|
16385
|
-
|
|
16401
|
+
isNotNil36(label) && /* @__PURE__ */ jsx302(Text, { variant: "label3", children: /* @__PURE__ */ jsx302("strong", { children: label }) }),
|
|
16402
|
+
isNotNil36(description) && /* @__PURE__ */ jsx302(
|
|
16386
16403
|
Text,
|
|
16387
16404
|
{
|
|
16388
16405
|
prominence: "secondary",
|
|
@@ -16702,7 +16719,7 @@ SegmentedControl.displayName = "SegmentedControl_UI";
|
|
|
16702
16719
|
import { forwardRef as forwardRef33, useEffect as useEffect21, useRef as useRef22 } from "react";
|
|
16703
16720
|
import styled90, { css as css45 } from "styled-components";
|
|
16704
16721
|
import { Item as ToggleGroupItem2 } from "@radix-ui/react-toggle-group";
|
|
16705
|
-
import { isNotNil as
|
|
16722
|
+
import { isNotNil as isNotNil37 } from "@wistia/type-guards";
|
|
16706
16723
|
import { jsxs as jsxs60 } from "react/jsx-runtime";
|
|
16707
16724
|
var segmentedControlItemStyles = css45`
|
|
16708
16725
|
all: unset; /* ToggleGroupItem is a button element */
|
|
@@ -16818,8 +16835,8 @@ var SegmentedControlItem = forwardRef33(
|
|
|
16818
16835
|
{
|
|
16819
16836
|
ref: combinedRef,
|
|
16820
16837
|
...otherProps,
|
|
16821
|
-
$hasLabel:
|
|
16822
|
-
"aria-label":
|
|
16838
|
+
$hasLabel: isNotNil37(label),
|
|
16839
|
+
"aria-label": isNotNil37(label) ? void 0 : ariaLabel,
|
|
16823
16840
|
disabled,
|
|
16824
16841
|
onClick: handleClick,
|
|
16825
16842
|
value,
|
|
@@ -16856,6 +16873,7 @@ var StyledTrigger2 = styled91(Trigger3)`
|
|
|
16856
16873
|
outline: 1px solid var(--wui-input-color-border);
|
|
16857
16874
|
outline-offset: -2px;
|
|
16858
16875
|
border-radius: var(--wui-input-border-radius);
|
|
16876
|
+
min-width: 200px;
|
|
16859
16877
|
text-align: left;
|
|
16860
16878
|
display: inline-flex;
|
|
16861
16879
|
align-items: center;
|
|
@@ -16992,14 +17010,13 @@ Select.displayName = "Select_UI";
|
|
|
16992
17010
|
import { Item, ItemText, ItemIndicator } from "@radix-ui/react-select";
|
|
16993
17011
|
import { forwardRef as forwardRef35 } from "react";
|
|
16994
17012
|
import styled92 from "styled-components";
|
|
16995
|
-
import { isNotNil as
|
|
17013
|
+
import { isNotNil as isNotNil38 } from "@wistia/type-guards";
|
|
16996
17014
|
import { jsx as jsx310, jsxs as jsxs62 } from "react/jsx-runtime";
|
|
16997
17015
|
var StyledItem = styled92(Item)`
|
|
16998
17016
|
${getTypographicStyles("label3")}
|
|
16999
17017
|
align-items: ${({ $checkmarkVerticalAlign }) => $checkmarkVerticalAlign === "center" ? "center" : "flex-start"};
|
|
17000
17018
|
background-color: transparent;
|
|
17001
17019
|
display: flex;
|
|
17002
|
-
gap: var(--wui-space-01);
|
|
17003
17020
|
padding: var(--wui-select-option-padding);
|
|
17004
17021
|
justify-content: space-between;
|
|
17005
17022
|
font-size: var(--font-size);
|
|
@@ -17030,7 +17047,7 @@ var SelectOption = forwardRef35(
|
|
|
17030
17047
|
ref: forwardedRef,
|
|
17031
17048
|
$checkmarkVerticalAlign: checkmarkVerticalAlign,
|
|
17032
17049
|
children: [
|
|
17033
|
-
|
|
17050
|
+
isNotNil38(selectedDisplayValue) ? /* @__PURE__ */ jsxs62("div", { children: [
|
|
17034
17051
|
children,
|
|
17035
17052
|
/* @__PURE__ */ jsx310("div", { style: { display: "none" }, children: /* @__PURE__ */ jsx310(ItemText, { children: selectedDisplayValue }) })
|
|
17036
17053
|
] }) : /* @__PURE__ */ jsx310(ItemText, { children }),
|
|
@@ -17318,7 +17335,7 @@ var TableRow = ({ children, ...props }) => {
|
|
|
17318
17335
|
// src/components/Tabs/Tabs.tsx
|
|
17319
17336
|
import { Root as RadixTabsRoot } from "@radix-ui/react-tabs";
|
|
17320
17337
|
import { useCallback as useCallback19, useState as useState25 } from "react";
|
|
17321
|
-
import { isNotNil as
|
|
17338
|
+
import { isNotNil as isNotNil39 } from "@wistia/type-guards";
|
|
17322
17339
|
|
|
17323
17340
|
// src/components/Tabs/useTabsValue.tsx
|
|
17324
17341
|
import { createContext as createContext12, useContext as useContext18 } from "react";
|
|
@@ -17355,10 +17372,10 @@ var Tabs = ({
|
|
|
17355
17372
|
...props,
|
|
17356
17373
|
onValueChange
|
|
17357
17374
|
};
|
|
17358
|
-
if (
|
|
17375
|
+
if (isNotNil39(value)) {
|
|
17359
17376
|
rootProps.value = value;
|
|
17360
17377
|
}
|
|
17361
|
-
if (
|
|
17378
|
+
if (isNotNil39(defaultValue)) {
|
|
17362
17379
|
rootProps.defaultValue = defaultValue;
|
|
17363
17380
|
}
|
|
17364
17381
|
return /* @__PURE__ */ jsx319(RadixTabsRoot, { ...rootProps, children: /* @__PURE__ */ jsx319(TabsValueProvider, { value: value ?? defaultValue, children: /* @__PURE__ */ jsx319(SelectedItemStyleProvider, { children }) }) });
|
|
@@ -17427,7 +17444,7 @@ TabsList.displayName = "TabsList_UI";
|
|
|
17427
17444
|
|
|
17428
17445
|
// src/components/Tabs/TabsTrigger.tsx
|
|
17429
17446
|
import { forwardRef as forwardRef36, useEffect as useEffect22, useRef as useRef23 } from "react";
|
|
17430
|
-
import { isNotNil as
|
|
17447
|
+
import { isNotNil as isNotNil40 } from "@wistia/type-guards";
|
|
17431
17448
|
|
|
17432
17449
|
// src/components/Tabs/StyledRadixTabsTrigger.tsx
|
|
17433
17450
|
import styled103 from "styled-components";
|
|
@@ -17478,8 +17495,8 @@ var TabsTrigger = forwardRef36(
|
|
|
17478
17495
|
{
|
|
17479
17496
|
...otherProps,
|
|
17480
17497
|
ref: combinedRef,
|
|
17481
|
-
$hasLabel:
|
|
17482
|
-
"aria-label":
|
|
17498
|
+
$hasLabel: isNotNil40(label),
|
|
17499
|
+
"aria-label": isNotNil40(label) ? void 0 : ariaLabel,
|
|
17483
17500
|
disabled,
|
|
17484
17501
|
value,
|
|
17485
17502
|
children: [
|
|
@@ -17494,7 +17511,7 @@ TabsTrigger.displayName = "TabsTrigger_UI";
|
|
|
17494
17511
|
|
|
17495
17512
|
// src/components/Thumbnail/ThumbnailBadge.tsx
|
|
17496
17513
|
import styled104 from "styled-components";
|
|
17497
|
-
import { isNotNil as
|
|
17514
|
+
import { isNotNil as isNotNil41 } from "@wistia/type-guards";
|
|
17498
17515
|
import { jsx as jsx323, jsxs as jsxs67 } from "react/jsx-runtime";
|
|
17499
17516
|
var StyledThumbnailBadge = styled104.div`
|
|
17500
17517
|
align-items: center;
|
|
@@ -17523,7 +17540,7 @@ var StyledThumbnailBadge = styled104.div`
|
|
|
17523
17540
|
`;
|
|
17524
17541
|
var ThumbnailBadge = ({ icon, label, ...props }) => {
|
|
17525
17542
|
return /* @__PURE__ */ jsxs67(StyledThumbnailBadge, { ...props, children: [
|
|
17526
|
-
|
|
17543
|
+
isNotNil41(icon) && icon,
|
|
17527
17544
|
/* @__PURE__ */ jsx323("span", { children: label })
|
|
17528
17545
|
] });
|
|
17529
17546
|
};
|
|
@@ -17532,10 +17549,10 @@ ThumbnailBadge.displayName = "ThumbnailBadge_UI";
|
|
|
17532
17549
|
// src/components/Thumbnail/Thumbnail.tsx
|
|
17533
17550
|
import { forwardRef as forwardRef37, useState as useState26, useRef as useRef24, useCallback as useCallback20, useMemo as useMemo17 } from "react";
|
|
17534
17551
|
import styled106 from "styled-components";
|
|
17535
|
-
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";
|
|
17536
17553
|
|
|
17537
17554
|
// src/private/helpers/getBackgroundGradient/getBackgroundGradient.ts
|
|
17538
|
-
import { isNotNil as
|
|
17555
|
+
import { isNotNil as isNotNil42 } from "@wistia/type-guards";
|
|
17539
17556
|
import { css as css49 } from "styled-components";
|
|
17540
17557
|
var gradients = {
|
|
17541
17558
|
defaultDarkOne: css49`
|
|
@@ -17663,12 +17680,12 @@ var gradients = {
|
|
|
17663
17680
|
};
|
|
17664
17681
|
var gradientMap = Object.keys(gradients);
|
|
17665
17682
|
var getBackgroundGradient = (gradientName = void 0) => {
|
|
17666
|
-
return
|
|
17683
|
+
return isNotNil42(gradientName) ? gradients[gradientName] : gradients.defaultDarkOne;
|
|
17667
17684
|
};
|
|
17668
17685
|
|
|
17669
17686
|
// src/components/Thumbnail/ThumbnailStoryboardViewer.tsx
|
|
17670
17687
|
import styled105 from "styled-components";
|
|
17671
|
-
import { isNotNil as
|
|
17688
|
+
import { isNotNil as isNotNil43 } from "@wistia/type-guards";
|
|
17672
17689
|
import { jsx as jsx324, jsxs as jsxs68 } from "react/jsx-runtime";
|
|
17673
17690
|
var ScrubLine = styled105.div`
|
|
17674
17691
|
position: absolute;
|
|
@@ -17762,8 +17779,8 @@ var ThumbnailStoryboardViewer = ({
|
|
|
17762
17779
|
);
|
|
17763
17780
|
const backgroundSize = `${scaledStoryboardWidth}px ${scaledStoryboardHeight}px`;
|
|
17764
17781
|
const backgroundImage = `url(${storyboardUrl})`;
|
|
17765
|
-
const showScrubLine =
|
|
17766
|
-
const scrubLinePosition =
|
|
17782
|
+
const showScrubLine = isNotNil43(cursorPosition);
|
|
17783
|
+
const scrubLinePosition = isNotNil43(cursorPosition) ? `${cursorPosition - 1}px` : "0";
|
|
17767
17784
|
const viewerStyles = {
|
|
17768
17785
|
position: "relative",
|
|
17769
17786
|
overflow: "hidden",
|
|
@@ -17834,7 +17851,7 @@ var ThumbnailImage = ({ thumbnailImageType, thumbnailUrl }) => {
|
|
|
17834
17851
|
);
|
|
17835
17852
|
};
|
|
17836
17853
|
var StyledThumbnail = styled106.div`
|
|
17837
|
-
background-image: ${({ $backgroundUrl }) =>
|
|
17854
|
+
background-image: ${({ $backgroundUrl }) => isNotNil44($backgroundUrl) ? `url('${$backgroundUrl}')` : void 0};
|
|
17838
17855
|
${({ $backgroundUrl, $gradientBackground }) => (
|
|
17839
17856
|
// if we don't have $backgroundUrl show a gradient
|
|
17840
17857
|
isNil19($backgroundUrl) ? getBackgroundGradient($gradientBackground) : void 0
|
|
@@ -17913,10 +17930,10 @@ var Thumbnail = forwardRef37(
|
|
|
17913
17930
|
const storyboardElementRef = useRef24(null);
|
|
17914
17931
|
const [cursorPosition, setCursorPosition] = useState26(null);
|
|
17915
17932
|
const backgroundUrl = useMemo17(
|
|
17916
|
-
() => thumbnailImageType === "square" &&
|
|
17933
|
+
() => thumbnailImageType === "square" && isNotNil44(thumbnailUrl) ? thumbnailUrl : void 0,
|
|
17917
17934
|
[thumbnailImageType, thumbnailUrl]
|
|
17918
17935
|
);
|
|
17919
|
-
const isScrubbable =
|
|
17936
|
+
const isScrubbable = isNotNil44(storyboard);
|
|
17920
17937
|
const trackStoryboardLoadStatus = useCallback20(() => {
|
|
17921
17938
|
if (storyboardElementRef.current || !storyboard) {
|
|
17922
17939
|
return storyboardElementRef.current;
|
|
@@ -17963,7 +17980,7 @@ var Thumbnail = forwardRef37(
|
|
|
17963
17980
|
width
|
|
17964
17981
|
}
|
|
17965
17982
|
);
|
|
17966
|
-
} else if (
|
|
17983
|
+
} else if (isNotNil44(thumbnailUrl)) {
|
|
17967
17984
|
thumbnailContent = /* @__PURE__ */ jsx325(
|
|
17968
17985
|
ThumbnailImage,
|
|
17969
17986
|
{
|
|
@@ -17988,7 +18005,7 @@ var Thumbnail = forwardRef37(
|
|
|
17988
18005
|
onMouseOut: handleMouseOut,
|
|
17989
18006
|
role: "presentation",
|
|
17990
18007
|
children: [
|
|
17991
|
-
|
|
18008
|
+
isNotNil44(children) ? children : null,
|
|
17992
18009
|
thumbnailContent
|
|
17993
18010
|
]
|
|
17994
18011
|
}
|
|
@@ -18106,7 +18123,7 @@ var ThumbnailCollage = ({
|
|
|
18106
18123
|
|
|
18107
18124
|
// src/components/WistiaLogo/WistiaLogo.tsx
|
|
18108
18125
|
import styled108, { css as css50 } from "styled-components";
|
|
18109
|
-
import { isNotNil as
|
|
18126
|
+
import { isNotNil as isNotNil45 } from "@wistia/type-guards";
|
|
18110
18127
|
import { jsx as jsx327, jsxs as jsxs70 } from "react/jsx-runtime";
|
|
18111
18128
|
var renderBrandmark = (brandmarkColor, iconOnly) => {
|
|
18112
18129
|
if (iconOnly) {
|
|
@@ -18219,7 +18236,7 @@ var WistiaLogo = ({
|
|
|
18219
18236
|
...props,
|
|
18220
18237
|
children: [
|
|
18221
18238
|
/* @__PURE__ */ jsx327("title", { children: title }),
|
|
18222
|
-
|
|
18239
|
+
isNotNil45(description) ? /* @__PURE__ */ jsx327("desc", { children: description }) : null,
|
|
18223
18240
|
renderBrandmark(brandmarkColor, iconOnly),
|
|
18224
18241
|
renderLogotype(logotypeColor, iconOnly)
|
|
18225
18242
|
]
|
|
@@ -18231,7 +18248,7 @@ WistiaLogo.displayName = "WistiaLogo_UI";
|
|
|
18231
18248
|
|
|
18232
18249
|
// src/components/SplitButton/SplitButton.tsx
|
|
18233
18250
|
import styled109 from "styled-components";
|
|
18234
|
-
import { isNotNil as
|
|
18251
|
+
import { isNotNil as isNotNil46 } from "@wistia/type-guards";
|
|
18235
18252
|
import { cloneElement as cloneElement9 } from "react";
|
|
18236
18253
|
import { jsx as jsx328, jsxs as jsxs71 } from "react/jsx-runtime";
|
|
18237
18254
|
var StyledSplitButton = styled109.span`
|
|
@@ -18278,7 +18295,7 @@ var SplitButton = ({
|
|
|
18278
18295
|
children
|
|
18279
18296
|
}
|
|
18280
18297
|
),
|
|
18281
|
-
|
|
18298
|
+
isNotNil46(menuItems) && /* @__PURE__ */ jsx328(
|
|
18282
18299
|
Menu,
|
|
18283
18300
|
{
|
|
18284
18301
|
...menuProps,
|
|
@@ -18297,7 +18314,7 @@ var SplitButton = ({
|
|
|
18297
18314
|
children: menuItems
|
|
18298
18315
|
}
|
|
18299
18316
|
),
|
|
18300
|
-
|
|
18317
|
+
isNotNil46(secondaryAction) && cloneElement9(secondaryAction, { disabled, size, unstyled, variant, colorScheme })
|
|
18301
18318
|
] });
|
|
18302
18319
|
};
|
|
18303
18320
|
SplitButton.displayName = "SplitButton_UI";
|