@wistia/ui 0.16.0 → 0.16.1-beta.31913c60.7cec3f9

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.16.0
3
+ * @license @wistia/ui v0.16.1-beta.31913c60.7cec3f9
4
4
  *
5
5
  * Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
6
6
  *
@@ -1011,7 +1011,7 @@ var import_styled_components4 = require("styled-components");
1011
1011
 
1012
1012
  // src/css/designTokens/colorSchemes.tsx
1013
1013
  var import_styled_components3 = require("styled-components");
1014
- var defaultColorScheme = import_styled_components3.css`
1014
+ var standardColorScheme = import_styled_components3.css`
1015
1015
  --wui-color-base-1: var(--wui-gray-1);
1016
1016
  --wui-color-base-2: var(--wui-gray-2);
1017
1017
  --wui-color-base-3: var(--wui-gray-3);
@@ -1533,7 +1533,7 @@ var baseAliasTokens = import_styled_components4.css`
1533
1533
  `;
1534
1534
  var colorAliasTokens = import_styled_components4.css`
1535
1535
  --wui-color-bg-app: var(--wui-app-background);
1536
- ${defaultColorScheme}
1536
+ ${standardColorScheme}
1537
1537
  ${baseAliasTokens}
1538
1538
  /* --- Semantic --- */
1539
1539
  /* Error */
@@ -3303,7 +3303,7 @@ Ellipsis.displayName = "Ellipsis_UI";
3303
3303
  // src/private/helpers/getColorScheme/getColorScheme.ts
3304
3304
  var import_styled_components16 = require("styled-components");
3305
3305
  var colorSchemes = {
3306
- default: defaultColorScheme,
3306
+ standard: standardColorScheme,
3307
3307
  blue: blueColorScheme,
3308
3308
  green: greenColorScheme,
3309
3309
  red: redColorScheme,
@@ -8139,7 +8139,7 @@ var StyledLabel = import_styled_components23.default.span`
8139
8139
  var ActionButton = (0, import_react24.forwardRef)(
8140
8140
  ({
8141
8141
  icon,
8142
- colorScheme = "default",
8142
+ colorScheme = "standard",
8143
8143
  disabled = false,
8144
8144
  hoverColorScheme,
8145
8145
  variant = "default",
@@ -8254,7 +8254,7 @@ Image.displayName = "Image_UI";
8254
8254
  // src/components/ColorSchemeWrapper/ColorSchemeWrapper.tsx
8255
8255
  var import_styled_components25 = __toESM(require("styled-components"));
8256
8256
  var import_jsx_runtime203 = require("react/jsx-runtime");
8257
- var defaultColorSchemeOptions = ["default", "inherit"];
8257
+ var defaultColorSchemeOptions = ["standard", "inherit"];
8258
8258
  var semanticColorSchemeOptions = ["error", "info", "success", "warning"];
8259
8259
  var brandColorSchemeOptions = [
8260
8260
  "blue",
@@ -8796,11 +8796,11 @@ var StyledHeading = import_styled_components29.default.div`
8796
8796
  line-height: var(--line-height);
8797
8797
  color: var(--text-color);
8798
8798
  ${({ $variant }) => variantStyleMap[$variant]}
8799
- ${({ $truncate }) => {
8800
- if ((0, import_type_guards22.isNotNil)($truncate)) {
8799
+ ${({ $maxLines }) => {
8800
+ if ((0, import_type_guards22.isNotNil)($maxLines)) {
8801
8801
  return import_styled_components29.css`
8802
8802
  ${ellipsisStyle};
8803
- ${lineClampCss($truncate)};
8803
+ ${lineClampCss($maxLines)};
8804
8804
  `;
8805
8805
  }
8806
8806
  return void 0;
@@ -8837,7 +8837,7 @@ var HeadingComponent = (0, import_react28.forwardRef)(
8837
8837
  maxChars,
8838
8838
  preventUserSelect = false,
8839
8839
  prominence = "primary",
8840
- truncate,
8840
+ maxLines,
8841
8841
  variant = "heading1",
8842
8842
  renderAs,
8843
8843
  ...props
@@ -8851,9 +8851,9 @@ var HeadingComponent = (0, import_react28.forwardRef)(
8851
8851
  $colorScheme: colorScheme,
8852
8852
  $disabled: disabled,
8853
8853
  $inline: inline,
8854
+ $maxLines: maxLines,
8854
8855
  $preventUserSelect: preventUserSelect,
8855
8856
  $prominence: prominence,
8856
- $truncate: truncate,
8857
8857
  $variant: variant,
8858
8858
  as: renderAs ?? variantElementMap[variant] ?? DEFAULT_ELEMENT2,
8859
8859
  ...props,
@@ -9021,11 +9021,11 @@ var StyledText = import_styled_components30.default.div`
9021
9021
  font-style: normal;
9022
9022
  margin: 0;
9023
9023
  ${({ $variant }) => variantStyleMap2[$variant]}
9024
- ${({ $truncate }) => {
9025
- if ((0, import_type_guards23.isNotNil)($truncate)) {
9024
+ ${({ $maxLines }) => {
9025
+ if ((0, import_type_guards23.isNotNil)($maxLines)) {
9026
9026
  return import_styled_components30.css`
9027
9027
  ${ellipsisStyle};
9028
- ${lineClampCss($truncate)};
9028
+ ${lineClampCss($maxLines)};
9029
9029
  `;
9030
9030
  }
9031
9031
  return void 0;
@@ -9060,7 +9060,7 @@ var TextComponent = (0, import_react29.forwardRef)(
9060
9060
  maxChars,
9061
9061
  preventUserSelect = false,
9062
9062
  prominence = "primary",
9063
- truncate,
9063
+ maxLines,
9064
9064
  variant = "body2",
9065
9065
  renderAs,
9066
9066
  ...props
@@ -9074,9 +9074,9 @@ var TextComponent = (0, import_react29.forwardRef)(
9074
9074
  $colorScheme: colorScheme,
9075
9075
  $disabled: disabled,
9076
9076
  $inline: inline,
9077
+ $maxLines: maxLines,
9077
9078
  $preventUserSelect: preventUserSelect,
9078
9079
  $prominence: prominence,
9079
- $truncate: truncate,
9080
9080
  $variant: variant,
9081
9081
  as: renderAs ?? variantElementMap2[variant] ?? DEFAULT_ELEMENT3,
9082
9082
  ...props,
@@ -13347,7 +13347,7 @@ var MenuItemButton = (0, import_react57.forwardRef)(({ children, appearance, com
13347
13347
  ...props,
13348
13348
  ref,
13349
13349
  $isGated: appearance === "gated",
13350
- colorScheme: colorScheme ?? "default",
13350
+ colorScheme: colorScheme ?? "inherit",
13351
13351
  fullWidth: true,
13352
13352
  unstyled: true,
13353
13353
  children: [
@@ -14328,10 +14328,44 @@ var import_react64 = require("react");
14328
14328
  var import_type_guards45 = require("@wistia/type-guards");
14329
14329
  var import_styled_components82 = __toESM(require("styled-components"));
14330
14330
  var import_jsx_runtime277 = require("react/jsx-runtime");
14331
+ var LARGE_PADDING = "var(--wui-space-02)";
14332
+ var SMALL_PADDING = "var(--wui-space-01)";
14333
+ var getPaddingForVariant = (variant) => {
14334
+ const largePaddingVariants = [
14335
+ "hero",
14336
+ "heading1",
14337
+ "heading2",
14338
+ "heading3",
14339
+ "body1",
14340
+ "label1",
14341
+ "body1Mono"
14342
+ ];
14343
+ const smallPaddingVariants = [
14344
+ "heading4",
14345
+ "heading5",
14346
+ "heading6",
14347
+ "body2",
14348
+ "body3",
14349
+ "body4",
14350
+ "label2",
14351
+ "label3",
14352
+ "label4",
14353
+ "body2Mono",
14354
+ "body3Mono",
14355
+ "body4Mono"
14356
+ ];
14357
+ if (largePaddingVariants.includes(variant)) {
14358
+ return LARGE_PADDING;
14359
+ }
14360
+ if (smallPaddingVariants.includes(variant)) {
14361
+ return SMALL_PADDING;
14362
+ }
14363
+ return SMALL_PADDING;
14364
+ };
14331
14365
  var StyledEditableTextRoot = import_styled_components82.default.div`
14332
14366
  display: contents;
14333
14367
 
14334
- --wui-editable-text-padding: var(--wui-space-01);
14368
+ --wui-editable-text-padding: ${({ $typographicVariant }) => getPaddingForVariant($typographicVariant)};
14335
14369
  --wui-editable-text-border-radius: var(--wui-border-radius-01);
14336
14370
  `;
14337
14371
  var EditableTextContext = (0, import_react64.createContext)(null);
@@ -14429,6 +14463,7 @@ var EditableTextRoot = ({
14429
14463
  return /* @__PURE__ */ (0, import_jsx_runtime277.jsx)(
14430
14464
  StyledEditableTextRoot,
14431
14465
  {
14466
+ $typographicVariant: typographicVariant,
14432
14467
  "data-testid": "editable-text-root",
14433
14468
  "data-wui-editable-text-root": true,
14434
14469
  "data-wui-editable-text-state": getState(),