@wistia/ui 0.16.0 → 0.16.1-beta.33e7e619.6469e3d

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
@@ -171,7 +171,7 @@ declare const useOnClickOutside: (ref: RefObject<HTMLElement | null | undefined>
171
171
 
172
172
  declare const usePreviousValue: <T>(value: T) => T | undefined;
173
173
 
174
- declare const colorSchemeOptions: readonly ["default", "inherit", "error", "info", "success", "warning", "blue", "green", "orange", "pink", "purple", "red", "yellow", "vendor-hubspot", "vendor-marketo", "vendor-pardot"];
174
+ declare const colorSchemeOptions: readonly ["standard", "inherit", "error", "info", "success", "warning", "blue", "green", "orange", "pink", "purple", "red", "yellow", "vendor-hubspot", "vendor-marketo", "vendor-pardot"];
175
175
  type ColorSchemeTypes = (typeof colorSchemeOptions)[number];
176
176
  type ColorSchemeWrapperProps = ComponentPropsWithoutRef<'div'> & {
177
177
  /**
@@ -1857,7 +1857,7 @@ type TextProps = ComponentPropsWithoutRef<'div'> & {
1857
1857
  * <br />
1858
1858
  * _Note: this only affects block elements_
1859
1859
  */
1860
- truncate?: number;
1860
+ maxLines?: number;
1861
1861
  /**
1862
1862
  * The text style to display
1863
1863
  */
@@ -1952,7 +1952,7 @@ type HeadingProps = ComponentPropsWithoutRef<typeof DEFAULT_ELEMENT> & {
1952
1952
  * <br />
1953
1953
  * _Note: this only affects block elements_
1954
1954
  */
1955
- truncate?: number;
1955
+ maxLines?: number;
1956
1956
  /**
1957
1957
  * The text style to display. This will also affect what element (h1, h2, etc) is rendered, unless the `renderAs` prop is used
1958
1958
  */
package/dist/index.d.ts CHANGED
@@ -171,7 +171,7 @@ declare const useOnClickOutside: (ref: RefObject<HTMLElement | null | undefined>
171
171
 
172
172
  declare const usePreviousValue: <T>(value: T) => T | undefined;
173
173
 
174
- declare const colorSchemeOptions: readonly ["default", "inherit", "error", "info", "success", "warning", "blue", "green", "orange", "pink", "purple", "red", "yellow", "vendor-hubspot", "vendor-marketo", "vendor-pardot"];
174
+ declare const colorSchemeOptions: readonly ["standard", "inherit", "error", "info", "success", "warning", "blue", "green", "orange", "pink", "purple", "red", "yellow", "vendor-hubspot", "vendor-marketo", "vendor-pardot"];
175
175
  type ColorSchemeTypes = (typeof colorSchemeOptions)[number];
176
176
  type ColorSchemeWrapperProps = ComponentPropsWithoutRef<'div'> & {
177
177
  /**
@@ -1857,7 +1857,7 @@ type TextProps = ComponentPropsWithoutRef<'div'> & {
1857
1857
  * <br />
1858
1858
  * _Note: this only affects block elements_
1859
1859
  */
1860
- truncate?: number;
1860
+ maxLines?: number;
1861
1861
  /**
1862
1862
  * The text style to display
1863
1863
  */
@@ -1952,7 +1952,7 @@ type HeadingProps = ComponentPropsWithoutRef<typeof DEFAULT_ELEMENT> & {
1952
1952
  * <br />
1953
1953
  * _Note: this only affects block elements_
1954
1954
  */
1955
- truncate?: number;
1955
+ maxLines?: number;
1956
1956
  /**
1957
1957
  * The text style to display. This will also affect what element (h1, h2, etc) is rendered, unless the `renderAs` prop is used
1958
1958
  */
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*
3
- * @license @wistia/ui v0.16.0
3
+ * @license @wistia/ui v0.16.1-beta.33e7e619.6469e3d
4
4
  *
5
5
  * Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
6
6
  *
@@ -822,7 +822,7 @@ import { css as css4 } from "styled-components";
822
822
 
823
823
  // src/css/designTokens/colorSchemes.tsx
824
824
  import { css as css3 } from "styled-components";
825
- var defaultColorScheme = css3`
825
+ var standardColorScheme = css3`
826
826
  --wui-color-base-1: var(--wui-gray-1);
827
827
  --wui-color-base-2: var(--wui-gray-2);
828
828
  --wui-color-base-3: var(--wui-gray-3);
@@ -1344,7 +1344,7 @@ var baseAliasTokens = css4`
1344
1344
  `;
1345
1345
  var colorAliasTokens = css4`
1346
1346
  --wui-color-bg-app: var(--wui-app-background);
1347
- ${defaultColorScheme}
1347
+ ${standardColorScheme}
1348
1348
  ${baseAliasTokens}
1349
1349
  /* --- Semantic --- */
1350
1350
  /* Error */
@@ -3123,7 +3123,7 @@ Ellipsis.displayName = "Ellipsis_UI";
3123
3123
  // src/private/helpers/getColorScheme/getColorScheme.ts
3124
3124
  import { css as css15 } from "styled-components";
3125
3125
  var colorSchemes = {
3126
- default: defaultColorScheme,
3126
+ standard: standardColorScheme,
3127
3127
  blue: blueColorScheme,
3128
3128
  green: greenColorScheme,
3129
3129
  red: redColorScheme,
@@ -7959,7 +7959,7 @@ var StyledLabel = styled6.span`
7959
7959
  var ActionButton = forwardRef3(
7960
7960
  ({
7961
7961
  icon,
7962
- colorScheme = "default",
7962
+ colorScheme = "standard",
7963
7963
  disabled = false,
7964
7964
  hoverColorScheme,
7965
7965
  variant = "default",
@@ -8074,7 +8074,7 @@ Image.displayName = "Image_UI";
8074
8074
  // src/components/ColorSchemeWrapper/ColorSchemeWrapper.tsx
8075
8075
  import styled8 from "styled-components";
8076
8076
  import { jsx as jsx203 } from "react/jsx-runtime";
8077
- var defaultColorSchemeOptions = ["default", "inherit"];
8077
+ var defaultColorSchemeOptions = ["standard", "inherit"];
8078
8078
  var semanticColorSchemeOptions = ["error", "info", "success", "warning"];
8079
8079
  var brandColorSchemeOptions = [
8080
8080
  "blue",
@@ -8616,11 +8616,11 @@ var StyledHeading = styled12.div`
8616
8616
  line-height: var(--line-height);
8617
8617
  color: var(--text-color);
8618
8618
  ${({ $variant }) => variantStyleMap[$variant]}
8619
- ${({ $truncate }) => {
8620
- if (isNotNil11($truncate)) {
8619
+ ${({ $maxLines }) => {
8620
+ if (isNotNil11($maxLines)) {
8621
8621
  return css21`
8622
8622
  ${ellipsisStyle};
8623
- ${lineClampCss($truncate)};
8623
+ ${lineClampCss($maxLines)};
8624
8624
  `;
8625
8625
  }
8626
8626
  return void 0;
@@ -8657,7 +8657,7 @@ var HeadingComponent = forwardRef6(
8657
8657
  maxChars,
8658
8658
  preventUserSelect = false,
8659
8659
  prominence = "primary",
8660
- truncate,
8660
+ maxLines,
8661
8661
  variant = "heading1",
8662
8662
  renderAs,
8663
8663
  ...props
@@ -8673,7 +8673,7 @@ var HeadingComponent = forwardRef6(
8673
8673
  $inline: inline,
8674
8674
  $preventUserSelect: preventUserSelect,
8675
8675
  $prominence: prominence,
8676
- $truncate: truncate,
8676
+ $maxLines: maxLines,
8677
8677
  $variant: variant,
8678
8678
  as: renderAs ?? variantElementMap[variant] ?? DEFAULT_ELEMENT2,
8679
8679
  ...props,
@@ -8841,11 +8841,11 @@ var StyledText = styled13.div`
8841
8841
  font-style: normal;
8842
8842
  margin: 0;
8843
8843
  ${({ $variant }) => variantStyleMap2[$variant]}
8844
- ${({ $truncate }) => {
8845
- if (isNotNil12($truncate)) {
8844
+ ${({ $maxLines }) => {
8845
+ if (isNotNil12($maxLines)) {
8846
8846
  return css22`
8847
8847
  ${ellipsisStyle};
8848
- ${lineClampCss($truncate)};
8848
+ ${lineClampCss($maxLines)};
8849
8849
  `;
8850
8850
  }
8851
8851
  return void 0;
@@ -8880,7 +8880,7 @@ var TextComponent = forwardRef7(
8880
8880
  maxChars,
8881
8881
  preventUserSelect = false,
8882
8882
  prominence = "primary",
8883
- truncate,
8883
+ maxLines,
8884
8884
  variant = "body2",
8885
8885
  renderAs,
8886
8886
  ...props
@@ -8896,7 +8896,7 @@ var TextComponent = forwardRef7(
8896
8896
  $inline: inline,
8897
8897
  $preventUserSelect: preventUserSelect,
8898
8898
  $prominence: prominence,
8899
- $truncate: truncate,
8899
+ $maxLines: maxLines,
8900
8900
  $variant: variant,
8901
8901
  as: renderAs ?? variantElementMap2[variant] ?? DEFAULT_ELEMENT3,
8902
8902
  ...props,
@@ -13197,7 +13197,7 @@ var MenuItemButton = forwardRef18(({ children, appearance, command, icon, ...pro
13197
13197
  ...props,
13198
13198
  ref,
13199
13199
  $isGated: appearance === "gated",
13200
- colorScheme: colorScheme ?? "default",
13200
+ colorScheme: colorScheme ?? "inherit",
13201
13201
  fullWidth: true,
13202
13202
  unstyled: true,
13203
13203
  children: [
@@ -14178,10 +14178,44 @@ import { createContext as createContext7, useMemo as useMemo13, useState as useS
14178
14178
  import { isNonEmptyString as isNonEmptyString6 } from "@wistia/type-guards";
14179
14179
  import styled63 from "styled-components";
14180
14180
  import { jsx as jsx277 } from "react/jsx-runtime";
14181
+ var LARGE_PADDING = "var(--wui-space-02)";
14182
+ var SMALL_PADDING = "var(--wui-space-01)";
14183
+ var getPaddingForVariant = (variant) => {
14184
+ const largePaddingVariants = [
14185
+ "hero",
14186
+ "heading1",
14187
+ "heading2",
14188
+ "heading3",
14189
+ "body1",
14190
+ "label1",
14191
+ "body1Mono"
14192
+ ];
14193
+ const smallPaddingVariants = [
14194
+ "heading4",
14195
+ "heading5",
14196
+ "heading6",
14197
+ "body2",
14198
+ "body3",
14199
+ "body4",
14200
+ "label2",
14201
+ "label3",
14202
+ "label4",
14203
+ "body2Mono",
14204
+ "body3Mono",
14205
+ "body4Mono"
14206
+ ];
14207
+ if (largePaddingVariants.includes(variant)) {
14208
+ return LARGE_PADDING;
14209
+ }
14210
+ if (smallPaddingVariants.includes(variant)) {
14211
+ return SMALL_PADDING;
14212
+ }
14213
+ return SMALL_PADDING;
14214
+ };
14181
14215
  var StyledEditableTextRoot = styled63.div`
14182
14216
  display: contents;
14183
14217
 
14184
- --wui-editable-text-padding: var(--wui-space-01);
14218
+ --wui-editable-text-padding: ${({ $typographicVariant }) => getPaddingForVariant($typographicVariant)};
14185
14219
  --wui-editable-text-border-radius: var(--wui-border-radius-01);
14186
14220
  `;
14187
14221
  var EditableTextContext = createContext7(null);
@@ -14279,6 +14313,7 @@ var EditableTextRoot = ({
14279
14313
  return /* @__PURE__ */ jsx277(
14280
14314
  StyledEditableTextRoot,
14281
14315
  {
14316
+ $typographicVariant: typographicVariant,
14282
14317
  "data-testid": "editable-text-root",
14283
14318
  "data-wui-editable-text-root": true,
14284
14319
  "data-wui-editable-text-state": getState(),