@wistia/ui 0.13.11 → 0.13.12-beta.6e81c50a.e8b6386

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.11
3
+ * @license @wistia/ui v0.13.12-beta.6e81c50a.e8b6386
4
4
  *
5
5
  * Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
6
6
  *
@@ -7184,10 +7184,26 @@ var iconSizeMap = {
7184
7184
  xl: "32",
7185
7185
  xxl: "48"
7186
7186
  };
7187
+ var iconInlineStyle = import_styled_components19.css`
7188
+ [data-wui-icon-inline] {
7189
+ --wui-icon-inline-size: 0.8em;
7190
+ --wui-icon-inline-offset: 0.05em;
7191
+ --wui-icon-vertical-align: none;
7192
+
7193
+ top: var(--wui-icon-inline-offset);
7194
+ position: relative;
7195
+ }
7196
+ `;
7187
7197
  var StyledIcon = import_styled_components19.default.svg`
7188
7198
  ${({ $colorScheme }) => getColorScheme($colorScheme ?? "inherit")}
7199
+ --wui-icon-size: var(--wui-icon-inline-size, ${({ $height }) => $height}px);
7200
+ --wui-icon-vertical-align: middle;
7201
+
7202
+ height: var(--wui-icon-size);
7203
+ width: var(--wui-icon-size);
7189
7204
  `;
7190
7205
  var Icon = ({
7206
+ useInlineStyles = true,
7191
7207
  invertColor,
7192
7208
  colorScheme = "inherit",
7193
7209
  size = "lg",
@@ -7209,7 +7225,7 @@ var Icon = ({
7209
7225
  }
7210
7226
  const IconElement = iconMap[type];
7211
7227
  const defaultStyle = {
7212
- verticalAlign: "middle",
7228
+ verticalAlign: "var(--wui-icon-vertical-align)",
7213
7229
  ...style
7214
7230
  };
7215
7231
  const iconColor = invertColor ? "var(--wui-color-icon-on-fill)" : "var(--wui-color-icon)";
@@ -7217,13 +7233,14 @@ var Icon = ({
7217
7233
  StyledIcon,
7218
7234
  {
7219
7235
  $colorScheme: colorScheme,
7236
+ $height: iconSizeMap[responsiveSize],
7237
+ $width: iconSizeMap[responsiveSize],
7220
7238
  "aria-hidden": "true",
7221
7239
  as: IconElement,
7222
- height: `${iconSizeMap[responsiveSize]}px`,
7240
+ "data-wui-icon-inline": useInlineStyles ? true : void 0,
7223
7241
  role: "presentation",
7224
7242
  style: defaultStyle,
7225
7243
  viewBox: "0 0 24 24",
7226
- width: `${iconSizeMap[responsiveSize]}px`,
7227
7244
  xmlns: "http://www.w3.org/2000/svg",
7228
7245
  ...props,
7229
7246
  color: iconColor
@@ -8247,6 +8264,8 @@ var StyledHeading = import_styled_components28.default.div`
8247
8264
  text-align: ${$align};
8248
8265
  `}
8249
8266
  margin: 0;
8267
+
8268
+ ${iconInlineStyle}
8250
8269
  `;
8251
8270
  var variantElementMap = {
8252
8271
  hero: DEFAULT_ELEMENT2,
@@ -8428,6 +8447,7 @@ var StyledText = import_styled_components29.default.div`
8428
8447
  return "var(--wui-color-text)";
8429
8448
  }};
8430
8449
 
8450
+ ${iconInlineStyle}
8431
8451
  color: var(--text-color);
8432
8452
  font-family: var(--font-family);
8433
8453
  font-size: var(--font-size);
@@ -8654,21 +8674,6 @@ var StyledBanner = import_styled_components32.default.div`
8654
8674
 
8655
8675
  ${({ $colorScheme }) => getColorScheme($colorScheme)};
8656
8676
  `;
8657
- var IconWrapper = (0, import_styled_components32.default)(Box)`
8658
- --wui-banner-icon-size: var(--font-size, 24px);
8659
-
8660
- ${({ $iconPosition }) => $iconPosition === "inline" && import_styled_components32.css`
8661
- display: inline-block;
8662
- vertical-align: text-bottom;
8663
- margin-right: calc(var(--wui-banner-icon-size) / 3);
8664
- `}
8665
-
8666
- svg {
8667
- color: var(--wui-color-icon);
8668
- width: var(--wui-banner-icon-size);
8669
- height: var(--wui-banner-icon-size);
8670
- }
8671
- `;
8672
8677
  var Banner = ({
8673
8678
  bodyText,
8674
8679
  colorScheme = "inherit",
@@ -8731,9 +8736,8 @@ var Banner = ({
8731
8736
  style: { padding: "var(--wui-banner-padding)" },
8732
8737
  children: [
8733
8738
  iconPosition === "above" && /* @__PURE__ */ (0, import_jsx_runtime208.jsx)(
8734
- IconWrapper,
8739
+ Box,
8735
8740
  {
8736
- $iconPosition: "above",
8737
8741
  alignSelf: "stretch",
8738
8742
  direction: "column",
8739
8743
  justifyContent: "center",
@@ -8749,7 +8753,10 @@ var Banner = ({
8749
8753
  justifyContent: "center",
8750
8754
  children: [
8751
8755
  (0, import_type_guards24.isNotNil)(headingText) ? /* @__PURE__ */ (0, import_jsx_runtime208.jsxs)(Heading, { variant: headingVariant, children: [
8752
- iconPosition === "inline" && /* @__PURE__ */ (0, import_jsx_runtime208.jsx)(IconWrapper, { $iconPosition: "inline", children: icon }),
8756
+ iconPosition === "inline" && /* @__PURE__ */ (0, import_jsx_runtime208.jsxs)(import_jsx_runtime208.Fragment, { children: [
8757
+ icon,
8758
+ " "
8759
+ ] }),
8753
8760
  headingText
8754
8761
  ] }) : null,
8755
8762
  /* @__PURE__ */ (0, import_jsx_runtime208.jsx)(Text, { variant: textVariant, children: bodyText })
@@ -10066,7 +10073,7 @@ var ColorPickerProvider = ({
10066
10073
  }),
10067
10074
  [colorForComparison, minimumContrastRatio, opacityForContrastCalculation]
10068
10075
  );
10069
- const valueAsHsv = shouldEnforceMinContrast ? getAccessibleDerivativeColor((0, import_fn4.formatHex)(nonDerivedValueAsHsv)) : nonDerivedValueAsHsv;
10076
+ const valueAsHsv = shouldEnforceMinContrast ? getAccessibleDerivativeColor(nonDerivedValueAsHsv) : nonDerivedValueAsHsv;
10070
10077
  const currentContrastRatio = calculateContrast({
10071
10078
  backgroundColor: valueAsHex,
10072
10079
  foregroundColor: colorForComparison,