@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.cjs 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
  *
@@ -5921,7 +5921,6 @@ var StyledLink = import_styled_components19.default.a`
5921
5921
  align-items: baseline;
5922
5922
  gap: var(--wui-space-01);
5923
5923
 
5924
- /* This ensure that the icon is the corect color when the style is solid or the button is disabled */
5925
5924
  && {
5926
5925
  svg {
5927
5926
  width: var(--link-icon-size);
@@ -6193,8 +6192,10 @@ var StyledActionButton = (0, import_styled_components21.default)(Button)`
6193
6192
  outline-color: var(--wui-color-focus-ring-disabled);
6194
6193
  cursor: not-allowed;
6195
6194
 
6196
- svg {
6197
- color: var(--wui-color-icon-disabled);
6195
+ && {
6196
+ svg {
6197
+ color: var(--wui-color-icon-disabled);
6198
+ }
6198
6199
  }
6199
6200
  }
6200
6201
  `;
@@ -6205,9 +6206,11 @@ var StyledMainIcon = import_styled_components21.default.div`
6205
6206
  height: 24px;
6206
6207
  transition: color var(--wui-motion-duration-02) var(--wui-motion-ease);
6207
6208
 
6208
- svg {
6209
- width: 24px;
6210
- height: 24px;
6209
+ && {
6210
+ svg {
6211
+ width: 24px;
6212
+ height: 24px;
6213
+ }
6211
6214
  }
6212
6215
  `;
6213
6216
  var StyledSecondaryIcon = import_styled_components21.default.div`
@@ -6229,9 +6232,11 @@ var StyledSecondaryIcon = import_styled_components21.default.div`
6229
6232
  }
6230
6233
  `};
6231
6234
 
6232
- svg {
6233
- width: 24px;
6234
- height: 24px;
6235
+ && {
6236
+ svg {
6237
+ width: 24px;
6238
+ height: 24px;
6239
+ }
6235
6240
  }
6236
6241
  `;
6237
6242
  var StyledLabel = import_styled_components21.default.span`
@@ -7332,6 +7337,7 @@ var body1TextStyle = import_styled_components36.css`
7332
7337
  --font-size: var(--wui-typography-body-1-size);
7333
7338
  --font-weight: var(--wui-typography-body-1-weight);
7334
7339
  --line-height: var(--wui-typography-body-1-line-height);
7340
+ --paragraph-spacing: var(--wui-typography-body-1-paragraph-spacing);
7335
7341
  ${bodyBoldStyles}
7336
7342
  `;
7337
7343
  var body2TextStyle = import_styled_components36.css`
@@ -7339,6 +7345,7 @@ var body2TextStyle = import_styled_components36.css`
7339
7345
  --font-size: var(--wui-typography-body-2-size);
7340
7346
  --font-weight: var(--wui-typography-body-2-weight);
7341
7347
  --line-height: var(--wui-typography-body-2-line-height);
7348
+ --paragraph-spacing: var(--wui-typography-body-2-paragraph-spacing);
7342
7349
  ${bodyBoldStyles}
7343
7350
  `;
7344
7351
  var body3TextStyle = import_styled_components36.css`
@@ -7346,6 +7353,7 @@ var body3TextStyle = import_styled_components36.css`
7346
7353
  --font-size: var(--wui-typography-body-3-size);
7347
7354
  --font-weight: var(--wui-typography-body-3-weight);
7348
7355
  --line-height: var(--wui-typography-body-3-line-height);
7356
+ --paragraph-spacing: var(--wui-typography-body-3-paragraph-spacing);
7349
7357
  ${bodyBoldStyles}
7350
7358
  `;
7351
7359
  var body4TextStyle = import_styled_components36.css`
@@ -7353,6 +7361,7 @@ var body4TextStyle = import_styled_components36.css`
7353
7361
  --font-size: var(--wui-typography-body-4-size);
7354
7362
  --font-weight: var(--wui-typography-body-4-weight);
7355
7363
  --line-height: var(--wui-typography-body-4-line-height);
7364
+ --paragraph-spacing: var(--wui-typography-body-4-paragraph-spacing);
7356
7365
  ${bodyBoldStyles}
7357
7366
  `;
7358
7367
  var label1TextStyle = import_styled_components36.css`
@@ -7413,6 +7422,23 @@ var variantStyleMap2 = {
7413
7422
  label3: label3TextStyle,
7414
7423
  label4: label4TextStyle
7415
7424
  };
7425
+ var bodyElement = "p";
7426
+ var labelElement = "span";
7427
+ var DEFAULT_ELEMENT3 = bodyElement;
7428
+ var variantElementMap2 = {
7429
+ body1: DEFAULT_ELEMENT3,
7430
+ body2: DEFAULT_ELEMENT3,
7431
+ body3: DEFAULT_ELEMENT3,
7432
+ body4: DEFAULT_ELEMENT3,
7433
+ body1Mono: DEFAULT_ELEMENT3,
7434
+ body2Mono: DEFAULT_ELEMENT3,
7435
+ body3Mono: DEFAULT_ELEMENT3,
7436
+ body4Mono: DEFAULT_ELEMENT3,
7437
+ label1: labelElement,
7438
+ label2: labelElement,
7439
+ label3: labelElement,
7440
+ label4: labelElement
7441
+ };
7416
7442
  var StyledText = import_styled_components36.default.div`
7417
7443
  ${({ $colorScheme }) => getColorScheme($colorScheme)};
7418
7444
  --text-color: ${({ $prominence, $disabled }) => {
@@ -7451,9 +7477,12 @@ var StyledText = import_styled_components36.default.div`
7451
7477
  `}
7452
7478
  ${({ as }) => as === "p" && import_styled_components36.css`
7453
7479
  display: block;
7480
+
7481
+ + p {
7482
+ margin-top: var(--paragraph-spacing, var(--wui-space-04));
7483
+ }
7454
7484
  `}
7455
7485
  `;
7456
- var DEFAULT_ELEMENT3 = "div";
7457
7486
  var TextComponent = (0, import_react20.forwardRef)(
7458
7487
  ({
7459
7488
  align = "left",
@@ -7479,7 +7508,7 @@ var TextComponent = (0, import_react20.forwardRef)(
7479
7508
  $preventUserSelect: preventUserSelect,
7480
7509
  $prominence: prominence,
7481
7510
  $variant: variant,
7482
- as: renderAs ?? DEFAULT_ELEMENT3,
7511
+ as: renderAs ?? variantElementMap2[variant],
7483
7512
  ...otherProps
7484
7513
  }
7485
7514
  );
@@ -7789,9 +7818,6 @@ var StyledInputContainer = import_styled_components41.default.div`
7789
7818
  padding-right: 32px;
7790
7819
  }
7791
7820
  `;
7792
- var isValidRef2 = (ref) => {
7793
- return typeof ref === "object" && ref !== null && "current" in ref && (0, import_type_guards23.isNotNil)(ref.current);
7794
- };
7795
7821
  var Input = (0, import_react21.forwardRef)(
7796
7822
  ({
7797
7823
  fullWidth = false,
@@ -7803,7 +7829,7 @@ var Input = (0, import_react21.forwardRef)(
7803
7829
  ...props
7804
7830
  }, externalRef) => {
7805
7831
  const internalRef = (0, import_react21.useRef)();
7806
- const ref = isValidRef2(externalRef) ? externalRef : internalRef;
7832
+ const ref = (0, import_type_guards23.isNotNil)(externalRef) && (0, import_type_guards23.isRecord)(externalRef) && "current" in externalRef ? externalRef : internalRef;
7807
7833
  let leftIconToDisplay = leftIcon;
7808
7834
  if ((0, import_type_guards23.isNil)(leftIcon) && type === "search") {
7809
7835
  leftIconToDisplay = /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(Icon, { type: "search" });
@@ -7825,7 +7851,7 @@ var Input = (0, import_react21.forwardRef)(
7825
7851
  if ((0, import_type_guards23.isNotNil)(props.onFocus)) {
7826
7852
  props.onFocus(event);
7827
7853
  }
7828
- if (autoSelect && ref && "current" in ref) {
7854
+ if (autoSelect && isValidRef(ref) && "current" in ref) {
7829
7855
  requestAnimationFrame(() => {
7830
7856
  ref.current?.select();
7831
7857
  });
@@ -8661,18 +8687,22 @@ var StyledLeftIconContainer = import_styled_components50.default.div`
8661
8687
  height: var(--menu-item-left-icon-size);
8662
8688
  width: var(--menu-item-left-icon-size);
8663
8689
 
8664
- svg {
8665
- height: var(--menu-item-left-icon-size);
8666
- width: var(--menu-item-left-icon-size);
8690
+ && {
8691
+ svg {
8692
+ height: var(--menu-item-left-icon-size);
8693
+ width: var(--menu-item-left-icon-size);
8694
+ }
8667
8695
  }
8668
8696
  `;
8669
8697
  var StyledRightIconContainer = import_styled_components50.default.div`
8670
8698
  height: var(--menu-item-right-icon-size);
8671
8699
  width: var(--menu-item-right-icon-size);
8672
8700
 
8673
- svg {
8674
- height: var(--menu-item-right-icon-size);
8675
- width: var(--menu-item-right-icon-size);
8701
+ && {
8702
+ svg {
8703
+ height: var(--menu-item-right-icon-size);
8704
+ width: var(--menu-item-right-icon-size);
8705
+ }
8676
8706
  }
8677
8707
  `;
8678
8708
  var StyledLabelAndDescriptionContainer = import_styled_components50.default.div`