@wistia/ui 0.13.2-beta.e47e5101.ccf43dc → 0.13.2-beta.e9273a7b.cd2e715

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.13.2-beta.e47e5101.ccf43dc
3
+ * @license @wistia/ui v0.13.2-beta.e9273a7b.cd2e715
4
4
  *
5
5
  * Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
6
6
  *
@@ -7166,10 +7166,26 @@ var iconSizeMap = {
7166
7166
  xl: "32",
7167
7167
  xxl: "48"
7168
7168
  };
7169
+ var iconInlineStyle = import_styled_components19.css`
7170
+ [data-wui-icon-inline] {
7171
+ --wui-icon-inline-size: 0.8em;
7172
+ --wui-icon-inline-offset: 0.05em;
7173
+ --wui-icon-vertical-align: none;
7174
+
7175
+ top: var(--wui-icon-inline-offset);
7176
+ position: relative;
7177
+ }
7178
+ `;
7169
7179
  var StyledIcon = import_styled_components19.default.svg`
7170
7180
  ${({ $colorScheme }) => getColorScheme($colorScheme ?? "inherit")}
7181
+ --wui-icon-size: var(--wui-icon-inline-size, ${({ $height }) => $height}px);
7182
+ --wui-icon-vertical-align: middle;
7183
+
7184
+ height: var(--wui-icon-size);
7185
+ width: var(--wui-icon-size);
7171
7186
  `;
7172
7187
  var Icon = ({
7188
+ useInlineStyles = true,
7173
7189
  invertColor,
7174
7190
  colorScheme = "inherit",
7175
7191
  size = "lg",
@@ -7191,7 +7207,7 @@ var Icon = ({
7191
7207
  }
7192
7208
  const IconElement = iconMap[type];
7193
7209
  const defaultStyle = {
7194
- verticalAlign: "middle",
7210
+ verticalAlign: "var(--wui-icon-vertical-align)",
7195
7211
  ...style
7196
7212
  };
7197
7213
  const iconColor = invertColor ? "var(--wui-color-icon-on-fill)" : "var(--wui-color-icon)";
@@ -7199,13 +7215,14 @@ var Icon = ({
7199
7215
  StyledIcon,
7200
7216
  {
7201
7217
  $colorScheme: colorScheme,
7218
+ $height: iconSizeMap[responsiveSize],
7219
+ $width: iconSizeMap[responsiveSize],
7202
7220
  "aria-hidden": "true",
7203
7221
  as: IconElement,
7204
- height: `${iconSizeMap[responsiveSize]}px`,
7222
+ "data-wui-icon-inline": useInlineStyles ? true : void 0,
7205
7223
  role: "presentation",
7206
7224
  style: defaultStyle,
7207
7225
  viewBox: "0 0 24 24",
7208
- width: `${iconSizeMap[responsiveSize]}px`,
7209
7226
  xmlns: "http://www.w3.org/2000/svg",
7210
7227
  ...props,
7211
7228
  color: iconColor
@@ -8219,6 +8236,8 @@ var StyledHeading = import_styled_components28.default.div`
8219
8236
  text-align: ${$align};
8220
8237
  `}
8221
8238
  margin: 0;
8239
+
8240
+ ${iconInlineStyle}
8222
8241
  `;
8223
8242
  var variantElementMap = {
8224
8243
  hero: DEFAULT_ELEMENT2,
@@ -8398,6 +8417,7 @@ var StyledText = import_styled_components29.default.div`
8398
8417
  return "var(--wui-color-text)";
8399
8418
  }};
8400
8419
 
8420
+ ${iconInlineStyle}
8401
8421
  color: var(--text-color);
8402
8422
  font-family: var(--font-family);
8403
8423
  font-size: var(--font-size);
@@ -8624,21 +8644,6 @@ var StyledBanner = import_styled_components32.default.div`
8624
8644
 
8625
8645
  ${({ $colorScheme }) => getColorScheme($colorScheme)};
8626
8646
  `;
8627
- var IconWrapper = (0, import_styled_components32.default)(Box)`
8628
- --wui-banner-icon-size: var(--font-size, 24px);
8629
-
8630
- ${({ $iconPosition }) => $iconPosition === "inline" && import_styled_components32.css`
8631
- display: inline-block;
8632
- vertical-align: text-bottom;
8633
- margin-right: calc(var(--wui-banner-icon-size) / 3);
8634
- `}
8635
-
8636
- svg {
8637
- color: var(--wui-color-icon);
8638
- width: var(--wui-banner-icon-size);
8639
- height: var(--wui-banner-icon-size);
8640
- }
8641
- `;
8642
8647
  var Banner = ({
8643
8648
  bodyText,
8644
8649
  colorScheme = "inherit",
@@ -8701,9 +8706,8 @@ var Banner = ({
8701
8706
  style: { padding: "var(--wui-banner-padding)" },
8702
8707
  children: [
8703
8708
  iconPosition === "above" && /* @__PURE__ */ (0, import_jsx_runtime208.jsx)(
8704
- IconWrapper,
8709
+ Box,
8705
8710
  {
8706
- $iconPosition: "above",
8707
8711
  alignSelf: "stretch",
8708
8712
  direction: "column",
8709
8713
  justifyContent: "center",
@@ -8719,7 +8723,10 @@ var Banner = ({
8719
8723
  justifyContent: "center",
8720
8724
  children: [
8721
8725
  (0, import_type_guards24.isNotNil)(headingText) ? /* @__PURE__ */ (0, import_jsx_runtime208.jsxs)(Heading, { variant: headingVariant, children: [
8722
- iconPosition === "inline" && /* @__PURE__ */ (0, import_jsx_runtime208.jsx)(IconWrapper, { $iconPosition: "inline", children: icon }),
8726
+ iconPosition === "inline" && /* @__PURE__ */ (0, import_jsx_runtime208.jsxs)(import_jsx_runtime208.Fragment, { children: [
8727
+ icon,
8728
+ " "
8729
+ ] }),
8723
8730
  headingText
8724
8731
  ] }) : null,
8725
8732
  /* @__PURE__ */ (0, import_jsx_runtime208.jsx)(Text, { variant: textVariant, children: bodyText })
@@ -10610,10 +10617,7 @@ var Input = (0, import_react44.forwardRef)(
10610
10617
  ...props
10611
10618
  }, externalRef) => {
10612
10619
  const internalRef = (0, import_react44.useRef)();
10613
- const ref = (
10614
- // eslint-disable-next-line react-compiler/react-compiler
10615
- (0, import_type_guards36.isNotNil)(externalRef) && (0, import_type_guards36.isRecord)(externalRef) && "current" in externalRef ? externalRef : internalRef
10616
- );
10620
+ const ref = (0, import_type_guards36.isNotNil)(externalRef) && (0, import_type_guards36.isRecord)(externalRef) && "current" in externalRef ? externalRef : internalRef;
10617
10621
  let leftIconToDisplay = leftIcon;
10618
10622
  if ((0, import_type_guards36.isNil)(leftIcon) && type === "search") {
10619
10623
  leftIconToDisplay = /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(Icon, { type: "search" });