@wistia/vhs 5.0.2-beta.b97af75d.ef7f4d2 → 5.0.2-beta.d42b58b7.331ff68

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.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as styled_components from 'styled-components';
2
- import { css, DefaultTheme, IStyledComponent } from 'styled-components';
2
+ import { css, DefaultTheme } from 'styled-components';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as react from 'react';
5
5
  import { JSX, ReactNode, ComponentPropsWithoutRef, Dispatch, SetStateAction, RefObject, MutableRefObject, MouseEvent, ComponentPropsWithRef, ChangeEvent, ElementType, Ref, ComponentClass, ComponentProps, FocusEvent, HTMLInputTypeAttribute, KeyboardEvent as KeyboardEvent$1, ReactElement, ComponentType, PropsWithChildren } from 'react';
@@ -10,6 +10,7 @@ import { ReactEditor } from 'slate-react';
10
10
  import { HistoryEditor } from 'slate-history';
11
11
  import { DropdownMenuProps, DropdownMenuContentProps, DropdownMenuItemProps, DropdownMenuCheckboxItemProps, DropdownMenuRadioItemProps } from '@radix-ui/react-dropdown-menu';
12
12
  export { DropdownMenuRadioGroup as MenuRadioGroup } from '@radix-ui/react-dropdown-menu';
13
+ import * as styled_components_dist_types from 'styled-components/dist/types';
13
14
 
14
15
  interface VHSTheme {
15
16
  readonly breakpoint: {
@@ -2244,7 +2245,7 @@ declare const KeyboardShortcut: {
2244
2245
  displayName: string;
2245
2246
  };
2246
2247
 
2247
- type LabelProps = {
2248
+ type LabelProps = ComponentPropsWithoutRef<'label'> & {
2248
2249
  /**
2249
2250
  * Pass an arbitrary child node
2250
2251
  */
@@ -2270,9 +2271,9 @@ type LabelProps = {
2270
2271
  * but otherwise hidden on screen.
2271
2272
  */
2272
2273
  screenReaderOnly?: boolean;
2273
- } & Omit<ComponentPropsWithoutRef<'label'>, 'children'>;
2274
+ };
2274
2275
  declare const Label: {
2275
- ({ renderAs, children, disabled, htmlFor, required, screenReaderOnly, className, style, id, ...otherProps }: LabelProps): JSX.Element;
2276
+ ({ renderAs, children, disabled, htmlFor, required, screenReaderOnly, ...otherProps }: LabelProps): JSX.Element;
2276
2277
  displayName: string;
2277
2278
  };
2278
2279
 
@@ -2595,9 +2596,9 @@ declare const Modal: {
2595
2596
  displayName: string;
2596
2597
  };
2597
2598
 
2598
- declare const ModalHeader: IStyledComponent<'web', ComponentPropsWithRef<'div'>>;
2599
- declare const ModalBody: IStyledComponent<'web', ComponentPropsWithRef<'div'>>;
2600
- declare const ModalFooter: IStyledComponent<'web', ComponentPropsWithRef<'div'>>;
2599
+ declare const ModalHeader: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
2600
+ declare const ModalBody: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
2601
+ declare const ModalFooter: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
2601
2602
  type ModalCloseButtonProps = {
2602
2603
  /**
2603
2604
  * Callback invoked when the button is clicked
@@ -3140,7 +3141,57 @@ declare const variantStyleMap: {
3140
3141
  subtitle2: styled_components.RuleSet<object>;
3141
3142
  monospace: styled_components.RuleSet<object>;
3142
3143
  };
3143
- type TextProps = {
3144
+ type TextProps = ComponentPropsWithoutRef<'div'> & {
3145
+ /**
3146
+ * The horizontal alignment
3147
+ * <br />
3148
+ * _Note: this only affects block elements_
3149
+ */
3150
+ align?: keyof typeof alignMap;
3151
+ /**
3152
+ * Displays text as bold type
3153
+ */
3154
+ bold?: boolean;
3155
+ /**
3156
+ * Pass an arbitrary child node
3157
+ */
3158
+ children?: ReactNode | undefined;
3159
+ /**
3160
+ * Allows user to override default button colors
3161
+ */
3162
+ colorOverride?: string;
3163
+ /**
3164
+ * Used to indicate text is part of a "disabled" UI
3165
+ */
3166
+ disabled?: boolean;
3167
+ /**
3168
+ * Attempt to keep the text to a single line by truncating with an ellipsis
3169
+ * <br />
3170
+ * _Note: this only affects block elements_
3171
+ */
3172
+ ellipsis?: boolean;
3173
+ /**
3174
+ * Display the text as inline content
3175
+ */
3176
+ inline?: boolean;
3177
+ /**
3178
+ * Displays text as italic type
3179
+ */
3180
+ italic?: boolean;
3181
+ /**
3182
+ * Prevents text from being highlighted and copied
3183
+ */
3184
+ preventUserSelect?: boolean;
3185
+ /**
3186
+ * The type of html element to render as
3187
+ */
3188
+ renderAs?: keyof typeof renderMap;
3189
+ /**
3190
+ * The text style to display
3191
+ */
3192
+ variant?: keyof typeof variantStyleMap;
3193
+ };
3194
+ declare const Text: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
3144
3195
  /**
3145
3196
  * The horizontal alignment
3146
3197
  * <br />
@@ -3189,8 +3240,7 @@ type TextProps = {
3189
3240
  * The text style to display
3190
3241
  */
3191
3242
  variant?: keyof typeof variantStyleMap;
3192
- } & Omit<ComponentPropsWithRef<'div'>, 'children'>;
3193
- declare const Text: react.ForwardRefExoticComponent<Omit<TextProps, "ref"> & react.RefAttributes<HTMLElement>>;
3243
+ } & react.RefAttributes<HTMLElement>>;
3194
3244
 
3195
3245
  type IconThumbnailProps = {
3196
3246
  /**
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*
3
- * @license @wistia/vhs v5.0.2-beta.b97af75d.ef7f4d2
3
+ * @license @wistia/vhs v5.0.2-beta.d42b58b7.331ff68
4
4
  *
5
5
  * Copyright (c) 2021-2026, Wistia, Inc. and its affiliates.
6
6
  *
@@ -3114,8 +3114,8 @@ var buttonStyle = css2`
3114
3114
  }}
3115
3115
  `;
3116
3116
  var ButtonStyledComponent = styled2.button`
3117
- ${({ $noStyle }) => $noStyle ? buttonResetStyle : buttonStyle}
3118
- `;
3117
+ ${({ $noStyle }) => $noStyle ? buttonResetStyle : buttonStyle}
3118
+ `;
3119
3119
 
3120
3120
  // src/components/Button/getButtonColor.ts
3121
3121
  import { isNonEmptyString } from "@wistia/type-guards";
@@ -4855,7 +4855,7 @@ var variantStyleMap = {
4855
4855
  subtitle2: subtitle2TextStyle,
4856
4856
  monospace: monospaceTextStyle
4857
4857
  };
4858
- var sharedTextStyles = css6`
4858
+ var TextComponent = styled6.div`
4859
4859
  color: ${({ theme: theme2, $colorOverride }) => $colorOverride ?? theme2.color.grey900};
4860
4860
  font-style: normal;
4861
4861
  margin: 0;
@@ -4879,44 +4879,10 @@ var sharedTextStyles = css6`
4879
4879
  ${({ $align }) => css6`
4880
4880
  text-align: ${alignMap[$align]};
4881
4881
  `}
4882
- `;
4883
- var pStyles = css6`
4884
- ${sharedTextStyles}
4885
- display: block;
4886
- margin-bottom: ${({ theme: theme2 }) => theme2.spacing.space05};
4887
- `;
4888
- var StyledH1 = styled6.h1`
4889
- ${sharedTextStyles}
4890
- `;
4891
- var StyledH2 = styled6.h2`
4892
- ${sharedTextStyles}
4893
- `;
4894
- var StyledH3 = styled6.h3`
4895
- ${sharedTextStyles}
4896
- `;
4897
- var StyledH4 = styled6.h4`
4898
- ${sharedTextStyles}
4899
- `;
4900
- var StyledH5 = styled6.h5`
4901
- ${sharedTextStyles}
4902
- `;
4903
- var StyledH6 = styled6.h6`
4904
- ${sharedTextStyles}
4905
- `;
4906
- var StyledDiv = styled6.div`
4907
- ${sharedTextStyles}
4908
- `;
4909
- var StyledLabel = styled6.label`
4910
- ${sharedTextStyles}
4911
- `;
4912
- var StyledP = styled6.p`
4913
- ${pStyles}
4914
- `;
4915
- var StyledPre = styled6.pre`
4916
- ${sharedTextStyles}
4917
- `;
4918
- var StyledSpan = styled6.span`
4919
- ${sharedTextStyles}
4882
+ ${({ as, theme: theme2 }) => as === "p" && css6`
4883
+ display: block;
4884
+ margin-bottom: ${theme2.spacing.space05};
4885
+ `}
4920
4886
  `;
4921
4887
  var Text = forwardRef2(
4922
4888
  ({
@@ -4931,12 +4897,11 @@ var Text = forwardRef2(
4931
4897
  preventUserSelect = false,
4932
4898
  renderAs = "div",
4933
4899
  variant = "body1",
4934
- className,
4935
- style,
4936
- id,
4937
4900
  ...otherProps
4938
- }, ref) => {
4939
- const sharedProps = {
4901
+ }, ref) => /* @__PURE__ */ jsx124(
4902
+ TextComponent,
4903
+ {
4904
+ ref,
4940
4905
  $align: align,
4941
4906
  $bold: bold,
4942
4907
  $colorOverride: colorOverride,
@@ -4946,114 +4911,11 @@ var Text = forwardRef2(
4946
4911
  $italic: italic,
4947
4912
  $preventUserSelect: preventUserSelect,
4948
4913
  $variant: variant,
4949
- className,
4950
- style,
4951
- id
4952
- };
4953
- switch (renderAs) {
4954
- case "h1":
4955
- return /* @__PURE__ */ jsx124(
4956
- StyledH1,
4957
- {
4958
- ...sharedProps,
4959
- ref,
4960
- children
4961
- }
4962
- );
4963
- case "h2":
4964
- return /* @__PURE__ */ jsx124(
4965
- StyledH2,
4966
- {
4967
- ...sharedProps,
4968
- ref,
4969
- children
4970
- }
4971
- );
4972
- case "h3":
4973
- return /* @__PURE__ */ jsx124(
4974
- StyledH3,
4975
- {
4976
- ...sharedProps,
4977
- ref,
4978
- children
4979
- }
4980
- );
4981
- case "h4":
4982
- return /* @__PURE__ */ jsx124(
4983
- StyledH4,
4984
- {
4985
- ...sharedProps,
4986
- ref,
4987
- children
4988
- }
4989
- );
4990
- case "h5":
4991
- return /* @__PURE__ */ jsx124(
4992
- StyledH5,
4993
- {
4994
- ...sharedProps,
4995
- ref,
4996
- children
4997
- }
4998
- );
4999
- case "h6":
5000
- return /* @__PURE__ */ jsx124(
5001
- StyledH6,
5002
- {
5003
- ...sharedProps,
5004
- ref,
5005
- children
5006
- }
5007
- );
5008
- case "label":
5009
- return /* @__PURE__ */ jsx124(
5010
- StyledLabel,
5011
- {
5012
- ...sharedProps,
5013
- ref,
5014
- children
5015
- }
5016
- );
5017
- case "p":
5018
- return /* @__PURE__ */ jsx124(
5019
- StyledP,
5020
- {
5021
- ...sharedProps,
5022
- ref,
5023
- children
5024
- }
5025
- );
5026
- case "pre":
5027
- return /* @__PURE__ */ jsx124(
5028
- StyledPre,
5029
- {
5030
- ...sharedProps,
5031
- ref,
5032
- children
5033
- }
5034
- );
5035
- case "span":
5036
- return /* @__PURE__ */ jsx124(
5037
- StyledSpan,
5038
- {
5039
- ...sharedProps,
5040
- ref,
5041
- children
5042
- }
5043
- );
5044
- case "div":
5045
- default:
5046
- return /* @__PURE__ */ jsx124(
5047
- StyledDiv,
5048
- {
5049
- ...sharedProps,
5050
- ref,
5051
- ...otherProps,
5052
- children
5053
- }
5054
- );
4914
+ as: renderAs,
4915
+ ...otherProps,
4916
+ children
5055
4917
  }
5056
- }
4918
+ )
5057
4919
  );
5058
4920
  Text.displayName = "Text_VHS";
5059
4921
 
@@ -6885,7 +6747,7 @@ var disabledStyle4 = css14`
6885
6747
  color: ${({ theme: theme2 }) => theme2.color.grey500};
6886
6748
  `;
6887
6749
  var SPACE_BETWEEN_LABEL_AND_INPUT = "8px";
6888
- var sharedLabelStyles = css14`
6750
+ var LabelComponent = styled22.label`
6889
6751
  color: ${({ theme: theme2 }) => theme2.color.grey900};
6890
6752
  display: block;
6891
6753
  font-size: 14px;
@@ -6909,21 +6771,6 @@ var sharedLabelStyles = css14`
6909
6771
  ${({ $disabled }) => $disabled && disabledStyle4}
6910
6772
  ${({ $required }) => $required && requiredStyle}
6911
6773
  `;
6912
- var StyledLabel2 = styled22.label`
6913
- ${sharedLabelStyles}
6914
- `;
6915
- var StyledLegend = styled22.legend`
6916
- ${sharedLabelStyles}
6917
- `;
6918
- var StyledDiv2 = styled22.div`
6919
- ${sharedLabelStyles}
6920
- `;
6921
- var StyledP2 = styled22.p`
6922
- ${sharedLabelStyles}
6923
- `;
6924
- var StyledSpan2 = styled22.span`
6925
- ${sharedLabelStyles}
6926
- `;
6927
6774
  var Label = ({
6928
6775
  renderAs = "label",
6929
6776
  children,
@@ -6931,41 +6778,20 @@ var Label = ({
6931
6778
  htmlFor,
6932
6779
  required = false,
6933
6780
  screenReaderOnly = false,
6934
- className,
6935
- style,
6936
- id,
6937
6781
  ...otherProps
6938
- }) => {
6939
- const sharedProps = {
6782
+ }) => /* @__PURE__ */ jsx142(
6783
+ LabelComponent,
6784
+ {
6940
6785
  $disabled: disabled,
6786
+ $renderAs: renderAs,
6941
6787
  $required: required,
6942
6788
  $screenReaderOnly: screenReaderOnly,
6943
- className,
6944
- style,
6945
- id
6946
- };
6947
- switch (renderAs) {
6948
- case "legend":
6949
- return /* @__PURE__ */ jsx142(StyledLegend, { ...sharedProps, children });
6950
- case "div":
6951
- return /* @__PURE__ */ jsx142(StyledDiv2, { ...sharedProps, children });
6952
- case "p":
6953
- return /* @__PURE__ */ jsx142(StyledP2, { ...sharedProps, children });
6954
- case "span":
6955
- return /* @__PURE__ */ jsx142(StyledSpan2, { ...sharedProps, children });
6956
- case "label":
6957
- default:
6958
- return /* @__PURE__ */ jsx142(
6959
- StyledLabel2,
6960
- {
6961
- ...sharedProps,
6962
- htmlFor,
6963
- ...otherProps,
6964
- children
6965
- }
6966
- );
6789
+ as: renderAs,
6790
+ htmlFor: renderAs === "label" ? htmlFor : "",
6791
+ ...otherProps,
6792
+ children
6967
6793
  }
6968
- };
6794
+ );
6969
6795
  Label.displayName = "Label_VHS";
6970
6796
 
6971
6797
  // src/components/FormFieldError/FormFieldError.tsx
@@ -7315,7 +7141,7 @@ var showOnHoverStyles = () => css16`
7315
7141
  opacity: 1;
7316
7142
  }
7317
7143
  `;
7318
- var StyledLabel3 = styled29(Text)`
7144
+ var StyledLabel = styled29(Text)`
7319
7145
  /*
7320
7146
  * This should be able to support an input field when used to rename itself
7321
7147
  */
@@ -7471,7 +7297,7 @@ var CollapsibleGroup = ({
7471
7297
  onClick,
7472
7298
  children: [
7473
7299
  /* @__PURE__ */ jsx150(
7474
- StyledLabel3,
7300
+ StyledLabel,
7475
7301
  {
7476
7302
  $open: open2,
7477
7303
  $styleVariant: variant,
@@ -8246,15 +8072,15 @@ var inputStyle = css17`
8246
8072
  }
8247
8073
  `;
8248
8074
  var InputStyledComponent = styled33.input`
8249
- ${inputStyle}
8250
- ${({ as }) => as === "textarea" && textareaStyle};
8251
- ${({ as }) => as !== "textarea" && ellipsisStyle};
8252
- ${({ $clickToCopy }) => $clickToCopy && clickToCopyStyle};
8253
- ${({ disabled }) => disabled && disabledStyle6};
8254
- ${({ $forceState }) => $forceState === "focus" && focusStyle};
8255
- ${({ $hasError }) => $hasError && errorStyle2};
8256
- ${({ readOnly }) => readOnly && readOnlyStyle};
8257
- `;
8075
+ ${inputStyle}
8076
+ ${({ as }) => as === "textarea" && textareaStyle};
8077
+ ${({ as }) => as !== "textarea" && ellipsisStyle};
8078
+ ${({ $clickToCopy }) => $clickToCopy && clickToCopyStyle};
8079
+ ${({ disabled }) => disabled && disabledStyle6};
8080
+ ${({ $forceState }) => $forceState === "focus" && focusStyle};
8081
+ ${({ $hasError }) => $hasError && errorStyle2};
8082
+ ${({ readOnly }) => readOnly && readOnlyStyle};
8083
+ `;
8258
8084
 
8259
8085
  // src/components/Input/ClickToCopy.tsx
8260
8086
  import { useState as useState17, useEffect as useEffect15 } from "react";
@@ -8815,46 +8641,46 @@ var errorStyle3 = css19`
8815
8641
  border: 1px solid ${({ theme: theme2 }) => theme2.color.error500};
8816
8642
  `;
8817
8643
  var SelectStyledComponent = styled37.select`
8818
- ${ellipsisStyle}
8819
- appearance: none;
8820
- background-color: white;
8821
- border: 1px solid ${({ theme: theme2 }) => theme2.color.grey400};
8822
- border-radius: 4px;
8823
- color: ${({ theme: theme2 }) => theme2.color.grey900};
8824
- cursor: pointer;
8825
- display: block;
8826
- font-size: 14px;
8827
- height: ${({ multiple }) => multiple ? "66px" : "auto"};
8828
- line-height: 20px;
8829
- margin: 0;
8830
- outline: none;
8644
+ ${ellipsisStyle}
8645
+ appearance: none;
8646
+ background-color: white;
8647
+ border: 1px solid ${({ theme: theme2 }) => theme2.color.grey400};
8648
+ border-radius: 4px;
8649
+ color: ${({ theme: theme2 }) => theme2.color.grey900};
8650
+ cursor: pointer;
8651
+ display: block;
8652
+ font-size: 14px;
8653
+ height: ${({ multiple }) => multiple ? "66px" : "auto"};
8654
+ line-height: 20px;
8655
+ margin: 0;
8656
+ outline: none;
8831
8657
 
8832
- /* selects w/ multiple need to be able to scroll */
8833
- overflow-y: ${({ multiple }) => multiple ? "scroll" : "hidden"};
8658
+ /* selects w/ multiple need to be able to scroll */
8659
+ overflow-y: ${({ multiple }) => multiple ? "scroll" : "hidden"};
8834
8660
 
8835
- /* right padding is to prevent text collision with caret icon */
8836
- padding: ${({ theme: theme2 }) => `7px ${theme2.spacing.space06} 7px ${theme2.spacing.space02}`};
8837
- width: 100%;
8661
+ /* right padding is to prevent text collision with caret icon */
8662
+ padding: ${({ theme: theme2 }) => `7px ${theme2.spacing.space06} 7px ${theme2.spacing.space02}`};
8663
+ width: 100%;
8838
8664
 
8839
- &:focus {
8840
- ${focusStyle2}
8841
- }
8665
+ &:focus {
8666
+ ${focusStyle2}
8667
+ }
8842
8668
 
8843
- /* this removes a dotted border around select text when focusing in Firefox */
8844
- &:-moz-focusring {
8845
- color: transparent;
8846
- text-shadow: 0 0 0 #000000;
8847
- }
8669
+ /* this removes a dotted border around select text when focusing in Firefox */
8670
+ &:-moz-focusring {
8671
+ color: transparent;
8672
+ text-shadow: 0 0 0 #000000;
8673
+ }
8848
8674
 
8849
- /* remove drop-down arrow in IE */
8850
- &::-ms-expand {
8851
- display: none;
8852
- }
8675
+ /* remove drop-down arrow in IE */
8676
+ &::-ms-expand {
8677
+ display: none;
8678
+ }
8853
8679
 
8854
- ${({ disabled }) => disabled && disabledStyle7}
8855
- ${({ $hasError }) => $hasError && errorStyle3}
8680
+ ${({ disabled }) => disabled && disabledStyle7}
8681
+ ${({ $hasError }) => $hasError && errorStyle3}
8856
8682
  ${({ $forceState }) => $forceState === "focus" && focusStyle2};
8857
- `;
8683
+ `;
8858
8684
 
8859
8685
  // src/components/Select/Select.tsx
8860
8686
  import { jsx as jsx165, jsxs as jsxs27 } from "react/jsx-runtime";