@wistia/ui 0.20.11 → 0.20.12-beta.194021cb.7ecdb1f

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.ts CHANGED
@@ -237,6 +237,10 @@ type BaseProps$2 = {
237
237
  * Disables the link
238
238
  */
239
239
  disabled?: boolean;
240
+ /**
241
+ * When true, the link will inherit its color from the parent element instead of using the default link color
242
+ */
243
+ inheritColor?: boolean;
240
244
  /**
241
245
  * Icon to display on the left side of the link. Must be an instance of [Icon](?path=/docs/components-icon--docs)
242
246
  */
@@ -381,6 +385,7 @@ declare const Button: react.ForwardRefExoticComponent<(Omit<BaseButtonProps & re
381
385
  children: ReactNode;
382
386
  colorScheme?: ColorSchemeTypes;
383
387
  disabled?: boolean;
388
+ inheritColor?: boolean;
384
389
  leftIcon?: ReactNode | undefined;
385
390
  rightIcon?: ReactNode | undefined;
386
391
  type?: LinkTypes | undefined;
@@ -412,6 +417,7 @@ declare const Button: react.ForwardRefExoticComponent<(Omit<BaseButtonProps & re
412
417
  children: ReactNode;
413
418
  colorScheme?: ColorSchemeTypes;
414
419
  disabled?: boolean;
420
+ inheritColor?: boolean;
415
421
  leftIcon?: ReactNode | undefined;
416
422
  rightIcon?: ReactNode | undefined;
417
423
  type?: LinkTypes | undefined;
@@ -2933,6 +2939,7 @@ declare const MenuItem: react.ForwardRefExoticComponent<(Omit<DropdownMenuItemPr
2933
2939
  children: react.ReactNode;
2934
2940
  colorScheme?: ColorSchemeTypes;
2935
2941
  disabled?: boolean;
2942
+ inheritColor?: boolean;
2936
2943
  leftIcon?: react.ReactNode | undefined;
2937
2944
  rightIcon?: react.ReactNode | undefined;
2938
2945
  type?: LinkTypes | undefined;
@@ -2974,6 +2981,7 @@ declare const MenuItem: react.ForwardRefExoticComponent<(Omit<DropdownMenuItemPr
2974
2981
  children: react.ReactNode;
2975
2982
  colorScheme?: ColorSchemeTypes;
2976
2983
  disabled?: boolean;
2984
+ inheritColor?: boolean;
2977
2985
  leftIcon?: react.ReactNode | undefined;
2978
2986
  rightIcon?: react.ReactNode | undefined;
2979
2987
  type?: LinkTypes | undefined;
@@ -3646,6 +3654,10 @@ type SegmentedControlProps = Omit<ToggleGroupSingleProps, 'type'> & {
3646
3654
  * `SegmentedControlItem`s that will be rendered in grouping
3647
3655
  */
3648
3656
  children?: ReactNode;
3657
+ /**
3658
+ * Determines the color scheme for the SegmentedControl and its children.
3659
+ */
3660
+ colorScheme?: ColorSchemeTypes;
3649
3661
  /**
3650
3662
  * Set the entire `SegmentedControl` to be disabled
3651
3663
  */
@@ -3877,6 +3889,14 @@ type StackProps = {
3877
3889
  * @type 'baseline' | 'center' | 'flex-end' | 'flex-start' | 'stretch' | ResponsiveObject<'baseline' | 'center' | 'flex-end' | 'flex-start' | 'stretch'>
3878
3890
  */
3879
3891
  alignItems?: AlignItemsType | ResponsiveObject<AlignItemsType>;
3892
+ /**
3893
+ * Padding to apply to the stack container. Use `x` for horizontal (left/right) padding and `y` for vertical (top/bottom) padding.
3894
+ * Each value can be a [responsive prop](/docs/ui-docs-responsive-props--docs).
3895
+ */
3896
+ padding?: {
3897
+ x?: ResponsiveObject<Spacings> | Spacings;
3898
+ y?: ResponsiveObject<Spacings> | Spacings;
3899
+ };
3880
3900
  renderAs?: ElementType;
3881
3901
  };
3882
3902
  /**
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*
3
- * @license @wistia/ui v0.20.11
3
+ * @license @wistia/ui v0.20.12-beta.194021cb.7ecdb1f
4
4
  *
5
5
  * Copyright (c) 2024-2026, Wistia, Inc. and its affiliates.
6
6
  *
@@ -8042,18 +8042,21 @@ var StyledLink = styled5.a`
8042
8042
  ${({ $colorScheme }) => getColorScheme($colorScheme)}
8043
8043
  cursor: ${({ $disabled }) => $disabled ? "not-allowed" : "pointer"};
8044
8044
  font-family: inherit;
8045
- color: ${({ $disabled }) => $disabled ? "var(--wui-color-text-disabled)" : "var(--wui-color-text-link)"};
8045
+ color: ${({ $disabled, $inheritColor }) => {
8046
+ if ($disabled) return "var(--wui-color-text-disabled)";
8047
+ if ($inheritColor) return "inherit";
8048
+ return "var(--wui-color-text-link)";
8049
+ }};
8046
8050
  text-decoration: ${({ $underline }) => $underline === "always" ? "underline" : "none"};
8047
- display: inline-flex;
8048
- align-items: baseline;
8049
- gap: var(--wui-space-01);
8051
+ display: ${({ $hasIcons }) => $hasIcons ? "inline-flex" : "inline"};
8052
+ align-items: ${({ $hasIcons }) => $hasIcons ? "baseline" : "initial"};
8053
+ gap: ${({ $hasIcons }) => $hasIcons ? "var(--wui-space-01)" : "0"};
8050
8054
 
8051
8055
  &:hover {
8052
8056
  text-decoration: ${({ $underline }) => $underline === "hover" || $underline === "always" ? "underline" : "none"};
8053
8057
  }
8054
8058
 
8055
8059
  button& {
8056
- display: inline;
8057
8060
  line-height: inherit;
8058
8061
  vertical-align: baseline;
8059
8062
  }
@@ -8074,6 +8077,7 @@ var Link = forwardRef(
8074
8077
  disabled = false,
8075
8078
  colorScheme = "inherit",
8076
8079
  underline = "none",
8080
+ inheritColor = false,
8077
8081
  leftIcon,
8078
8082
  rightIcon,
8079
8083
  "aria-disabled": ariaDisabled,
@@ -8083,6 +8087,7 @@ var Link = forwardRef(
8083
8087
  const inRouterContext = useInRouterContext();
8084
8088
  const to = generateHref(props.href, type, disabled);
8085
8089
  const shouldUseReactRouterLink = inRouterContext && type !== "external" && !to?.startsWith("http");
8090
+ const hasIcons = isNotNil5(leftIcon) || isNotNil5(rightIcon);
8086
8091
  const handleClick = async (event) => {
8087
8092
  if (disabled) {
8088
8093
  event.preventDefault();
@@ -8111,6 +8116,8 @@ var Link = forwardRef(
8111
8116
  $colorScheme: colorScheme,
8112
8117
  $disabled: disabled,
8113
8118
  $underline: underline,
8119
+ $inheritColor: inheritColor,
8120
+ $hasIcons: hasIcons,
8114
8121
  onClick: handleClick,
8115
8122
  "aria-disabled": ariaDisabled ?? (disabled ? "true" : void 0)
8116
8123
  };
@@ -10050,12 +10057,23 @@ var StyledStack = styled26.div`
10050
10057
  flex-direction: ${({ $direction }) => $direction === "horizontal" ? "row" : "column"};
10051
10058
  gap: ${({ $gap }) => `var(--wui-${$gap})`};
10052
10059
  align-items: ${({ $alignItems }) => $alignItems};
10060
+ ${({ $paddingX }) => $paddingX && `padding-left: var(--wui-${$paddingX}); padding-right: var(--wui-${$paddingX});`}
10061
+ ${({ $paddingY }) => $paddingY && `padding-top: var(--wui-${$paddingY}); padding-bottom: var(--wui-${$paddingY});`}
10053
10062
  `;
10054
10063
  var StackComponent = forwardRef10(
10055
- ({ renderAs, direction = "vertical", gap = "space-02", alignItems = "stretch", ...props }, ref) => {
10064
+ ({
10065
+ renderAs,
10066
+ direction = "vertical",
10067
+ gap = "space-02",
10068
+ alignItems = "stretch",
10069
+ padding,
10070
+ ...props
10071
+ }, ref) => {
10056
10072
  const responsiveGap = useResponsiveProp(gap);
10057
10073
  const responsiveDirection = useResponsiveProp(direction);
10058
10074
  const responsiveAlignItems = useResponsiveProp(alignItems);
10075
+ const responsivePaddingX = useResponsiveProp(padding?.x);
10076
+ const responsivePaddingY = useResponsiveProp(padding?.y);
10059
10077
  return /* @__PURE__ */ jsx240(
10060
10078
  StyledStack,
10061
10079
  {
@@ -10063,6 +10081,8 @@ var StackComponent = forwardRef10(
10063
10081
  $alignItems: responsiveAlignItems,
10064
10082
  $direction: responsiveDirection,
10065
10083
  $gap: responsiveGap,
10084
+ $paddingX: responsivePaddingX,
10085
+ $paddingY: responsivePaddingY,
10066
10086
  as: renderAs ?? DEFAULT_ELEMENT4,
10067
10087
  ...props
10068
10088
  }
@@ -17561,6 +17581,9 @@ var SelectedItemIndicator = () => {
17561
17581
  // src/components/SegmentedControl/SegmentedControl.tsx
17562
17582
  import { jsx as jsx330, jsxs as jsxs60 } from "react/jsx-runtime";
17563
17583
  var segmentedControlStyles = css46`
17584
+ ${({ $colorScheme }) => $colorScheme && getColorScheme($colorScheme)};
17585
+ --wui-color-text-selected: var(--wui-color-text-link);
17586
+
17564
17587
  display: inline-flex;
17565
17588
  background-color: var(--wui-color-bg-surface-secondary);
17566
17589
  border-radius: var(--wui-border-radius-rounded);
@@ -17577,6 +17600,7 @@ var StyledSegmentedControl = styled92(ToggleGroupRoot2)`
17577
17600
  var SegmentedControl = forwardRef32(
17578
17601
  ({
17579
17602
  children,
17603
+ colorScheme = "inherit",
17580
17604
  disabled = false,
17581
17605
  fullWidth = false,
17582
17606
  selectedValue,
@@ -17590,6 +17614,7 @@ var SegmentedControl = forwardRef32(
17590
17614
  StyledSegmentedControl,
17591
17615
  {
17592
17616
  ref,
17617
+ $colorScheme: colorScheme,
17593
17618
  $fullWidth: fullWidth,
17594
17619
  disabled,
17595
17620
  loop: true,