@wistia/ui 0.5.4 → 0.5.5-beta.05a00a72.6b7da9c

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.mts CHANGED
@@ -1699,7 +1699,7 @@ type TextProps = ComponentPropsWithoutRef<'div'> & {
1699
1699
  /**
1700
1700
  * Used for rending paragraphs and inline text.
1701
1701
  */
1702
- declare const Text: (<C extends ElementType = "div">(props: PolymorphicComponentProps<C, TextProps>) => react.ReactElement | null) & UnknownRecord;
1702
+ declare const Text: (<C extends ElementType = "p">(props: PolymorphicComponentProps<C, TextProps>) => react.ReactElement | null) & UnknownRecord;
1703
1703
 
1704
1704
  type MenuItemLabelProps = {
1705
1705
  /**
package/dist/index.d.ts CHANGED
@@ -1699,7 +1699,7 @@ type TextProps = ComponentPropsWithoutRef<'div'> & {
1699
1699
  /**
1700
1700
  * Used for rending paragraphs and inline text.
1701
1701
  */
1702
- declare const Text: (<C extends ElementType = "div">(props: PolymorphicComponentProps<C, TextProps>) => react.ReactElement | null) & UnknownRecord;
1702
+ declare const Text: (<C extends ElementType = "p">(props: PolymorphicComponentProps<C, TextProps>) => react.ReactElement | null) & UnknownRecord;
1703
1703
 
1704
1704
  type MenuItemLabelProps = {
1705
1705
  /**
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*
3
- * @license @wistia/ui v0.5.4
3
+ * @license @wistia/ui v0.5.5-beta.05a00a72.6b7da9c
4
4
  *
5
5
  * Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
6
6
  *
@@ -5818,7 +5818,6 @@ var StyledLink = styled4.a`
5818
5818
  align-items: baseline;
5819
5819
  gap: var(--wui-space-01);
5820
5820
 
5821
- /* This ensure that the icon is the corect color when the style is solid or the button is disabled */
5822
5821
  && {
5823
5822
  svg {
5824
5823
  width: var(--link-icon-size);
@@ -6090,8 +6089,10 @@ var StyledActionButton = styled6(Button)`
6090
6089
  outline-color: var(--wui-color-focus-ring-disabled);
6091
6090
  cursor: not-allowed;
6092
6091
 
6093
- svg {
6094
- color: var(--wui-color-icon-disabled);
6092
+ && {
6093
+ svg {
6094
+ color: var(--wui-color-icon-disabled);
6095
+ }
6095
6096
  }
6096
6097
  }
6097
6098
  `;
@@ -6102,9 +6103,11 @@ var StyledMainIcon = styled6.div`
6102
6103
  height: 24px;
6103
6104
  transition: color var(--wui-motion-duration-02) var(--wui-motion-ease);
6104
6105
 
6105
- svg {
6106
- width: 24px;
6107
- height: 24px;
6106
+ && {
6107
+ svg {
6108
+ width: 24px;
6109
+ height: 24px;
6110
+ }
6108
6111
  }
6109
6112
  `;
6110
6113
  var StyledSecondaryIcon = styled6.div`
@@ -6126,9 +6129,11 @@ var StyledSecondaryIcon = styled6.div`
6126
6129
  }
6127
6130
  `};
6128
6131
 
6129
- svg {
6130
- width: 24px;
6131
- height: 24px;
6132
+ && {
6133
+ svg {
6134
+ width: 24px;
6135
+ height: 24px;
6136
+ }
6132
6137
  }
6133
6138
  `;
6134
6139
  var StyledLabel = styled6.span`
@@ -7229,6 +7234,7 @@ var body1TextStyle = css19`
7229
7234
  --font-size: var(--wui-typography-body-1-size);
7230
7235
  --font-weight: var(--wui-typography-body-1-weight);
7231
7236
  --line-height: var(--wui-typography-body-1-line-height);
7237
+ --paragraph-spacing: var(--wui-typography-body-1-paragraph-spacing);
7232
7238
  ${bodyBoldStyles}
7233
7239
  `;
7234
7240
  var body2TextStyle = css19`
@@ -7236,6 +7242,7 @@ var body2TextStyle = css19`
7236
7242
  --font-size: var(--wui-typography-body-2-size);
7237
7243
  --font-weight: var(--wui-typography-body-2-weight);
7238
7244
  --line-height: var(--wui-typography-body-2-line-height);
7245
+ --paragraph-spacing: var(--wui-typography-body-2-paragraph-spacing);
7239
7246
  ${bodyBoldStyles}
7240
7247
  `;
7241
7248
  var body3TextStyle = css19`
@@ -7243,6 +7250,7 @@ var body3TextStyle = css19`
7243
7250
  --font-size: var(--wui-typography-body-3-size);
7244
7251
  --font-weight: var(--wui-typography-body-3-weight);
7245
7252
  --line-height: var(--wui-typography-body-3-line-height);
7253
+ --paragraph-spacing: var(--wui-typography-body-3-paragraph-spacing);
7246
7254
  ${bodyBoldStyles}
7247
7255
  `;
7248
7256
  var body4TextStyle = css19`
@@ -7250,6 +7258,7 @@ var body4TextStyle = css19`
7250
7258
  --font-size: var(--wui-typography-body-4-size);
7251
7259
  --font-weight: var(--wui-typography-body-4-weight);
7252
7260
  --line-height: var(--wui-typography-body-4-line-height);
7261
+ --paragraph-spacing: var(--wui-typography-body-4-paragraph-spacing);
7253
7262
  ${bodyBoldStyles}
7254
7263
  `;
7255
7264
  var label1TextStyle = css19`
@@ -7310,6 +7319,23 @@ var variantStyleMap2 = {
7310
7319
  label3: label3TextStyle,
7311
7320
  label4: label4TextStyle
7312
7321
  };
7322
+ var bodyElement = "p";
7323
+ var labelElement = "span";
7324
+ var DEFAULT_ELEMENT3 = bodyElement;
7325
+ var variantElementMap2 = {
7326
+ body1: DEFAULT_ELEMENT3,
7327
+ body2: DEFAULT_ELEMENT3,
7328
+ body3: DEFAULT_ELEMENT3,
7329
+ body4: DEFAULT_ELEMENT3,
7330
+ body1Mono: DEFAULT_ELEMENT3,
7331
+ body2Mono: DEFAULT_ELEMENT3,
7332
+ body3Mono: DEFAULT_ELEMENT3,
7333
+ body4Mono: DEFAULT_ELEMENT3,
7334
+ label1: labelElement,
7335
+ label2: labelElement,
7336
+ label3: labelElement,
7337
+ label4: labelElement
7338
+ };
7313
7339
  var StyledText = styled21.div`
7314
7340
  ${({ $colorScheme }) => getColorScheme($colorScheme)};
7315
7341
  --text-color: ${({ $prominence, $disabled }) => {
@@ -7348,9 +7374,12 @@ var StyledText = styled21.div`
7348
7374
  `}
7349
7375
  ${({ as }) => as === "p" && css19`
7350
7376
  display: block;
7377
+
7378
+ + p {
7379
+ margin-top: var(--paragraph-spacing, var(--wui-space-04));
7380
+ }
7351
7381
  `}
7352
7382
  `;
7353
- var DEFAULT_ELEMENT3 = "div";
7354
7383
  var TextComponent = forwardRef8(
7355
7384
  ({
7356
7385
  align = "left",
@@ -7376,7 +7405,7 @@ var TextComponent = forwardRef8(
7376
7405
  $preventUserSelect: preventUserSelect,
7377
7406
  $prominence: prominence,
7378
7407
  $variant: variant,
7379
- as: renderAs ?? DEFAULT_ELEMENT3,
7408
+ as: renderAs ?? variantElementMap2[variant],
7380
7409
  ...otherProps
7381
7410
  }
7382
7411
  );
@@ -7605,7 +7634,7 @@ Tooltip.displayName = "Tooltip";
7605
7634
  // src/components/Input/Input.tsx
7606
7635
  import { forwardRef as forwardRef9, cloneElement as cloneElement3, useRef as useRef3 } from "react";
7607
7636
  import styled26, { css as css22 } from "styled-components";
7608
- import { isNil as isNil12, isNotNil as isNotNil9 } from "@wistia/type-guards";
7637
+ import { isNil as isNil12, isNotNil as isNotNil9, isRecord as isRecord4 } from "@wistia/type-guards";
7609
7638
  import { jsx as jsx183, jsxs as jsxs15 } from "react/jsx-runtime";
7610
7639
  var inputStyles = css22`
7611
7640
  --wui-input-color-bg: var(--wui-color-bg-surface);
@@ -7692,9 +7721,6 @@ var StyledInputContainer = styled26.div`
7692
7721
  padding-right: 32px;
7693
7722
  }
7694
7723
  `;
7695
- var isValidRef2 = (ref) => {
7696
- return typeof ref === "object" && ref !== null && "current" in ref && isNotNil9(ref.current);
7697
- };
7698
7724
  var Input = forwardRef9(
7699
7725
  ({
7700
7726
  fullWidth = false,
@@ -7706,7 +7732,7 @@ var Input = forwardRef9(
7706
7732
  ...props
7707
7733
  }, externalRef) => {
7708
7734
  const internalRef = useRef3();
7709
- const ref = isValidRef2(externalRef) ? externalRef : internalRef;
7735
+ const ref = isNotNil9(externalRef) && isRecord4(externalRef) && "current" in externalRef ? externalRef : internalRef;
7710
7736
  let leftIconToDisplay = leftIcon;
7711
7737
  if (isNil12(leftIcon) && type === "search") {
7712
7738
  leftIconToDisplay = /* @__PURE__ */ jsx183(Icon, { type: "search" });
@@ -7728,7 +7754,7 @@ var Input = forwardRef9(
7728
7754
  if (isNotNil9(props.onFocus)) {
7729
7755
  props.onFocus(event);
7730
7756
  }
7731
- if (autoSelect && ref && "current" in ref) {
7757
+ if (autoSelect && isValidRef(ref) && "current" in ref) {
7732
7758
  requestAnimationFrame(() => {
7733
7759
  ref.current?.select();
7734
7760
  });
@@ -8576,18 +8602,22 @@ var StyledLeftIconContainer = styled35.div`
8576
8602
  height: var(--menu-item-left-icon-size);
8577
8603
  width: var(--menu-item-left-icon-size);
8578
8604
 
8579
- svg {
8580
- height: var(--menu-item-left-icon-size);
8581
- width: var(--menu-item-left-icon-size);
8605
+ && {
8606
+ svg {
8607
+ height: var(--menu-item-left-icon-size);
8608
+ width: var(--menu-item-left-icon-size);
8609
+ }
8582
8610
  }
8583
8611
  `;
8584
8612
  var StyledRightIconContainer = styled35.div`
8585
8613
  height: var(--menu-item-right-icon-size);
8586
8614
  width: var(--menu-item-right-icon-size);
8587
8615
 
8588
- svg {
8589
- height: var(--menu-item-right-icon-size);
8590
- width: var(--menu-item-right-icon-size);
8616
+ && {
8617
+ svg {
8618
+ height: var(--menu-item-right-icon-size);
8619
+ width: var(--menu-item-right-icon-size);
8620
+ }
8591
8621
  }
8592
8622
  `;
8593
8623
  var StyledLabelAndDescriptionContainer = styled35.div`