@wistia/ui 0.20.13 → 0.20.14
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 +8 -0
- package/dist/index.js +10 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -240,6 +240,10 @@ type BaseProps$2 = {
|
|
|
240
240
|
* Disables the link
|
|
241
241
|
*/
|
|
242
242
|
disabled?: boolean;
|
|
243
|
+
/**
|
|
244
|
+
* When true, the link will inherit its color from the parent element instead of using the default link color
|
|
245
|
+
*/
|
|
246
|
+
inheritColor?: boolean;
|
|
243
247
|
/**
|
|
244
248
|
* Icon to display on the left side of the link. Must be an instance of [Icon](?path=/docs/components-icon--docs)
|
|
245
249
|
*/
|
|
@@ -384,6 +388,7 @@ declare const Button: react.ForwardRefExoticComponent<(Omit<BaseButtonProps & re
|
|
|
384
388
|
children: ReactNode;
|
|
385
389
|
colorScheme?: ColorSchemeTypes;
|
|
386
390
|
disabled?: boolean;
|
|
391
|
+
inheritColor?: boolean;
|
|
387
392
|
leftIcon?: ReactNode | undefined;
|
|
388
393
|
rightIcon?: ReactNode | undefined;
|
|
389
394
|
type?: LinkTypes | undefined;
|
|
@@ -415,6 +420,7 @@ declare const Button: react.ForwardRefExoticComponent<(Omit<BaseButtonProps & re
|
|
|
415
420
|
children: ReactNode;
|
|
416
421
|
colorScheme?: ColorSchemeTypes;
|
|
417
422
|
disabled?: boolean;
|
|
423
|
+
inheritColor?: boolean;
|
|
418
424
|
leftIcon?: ReactNode | undefined;
|
|
419
425
|
rightIcon?: ReactNode | undefined;
|
|
420
426
|
type?: LinkTypes | undefined;
|
|
@@ -2936,6 +2942,7 @@ declare const MenuItem: react.ForwardRefExoticComponent<(Omit<DropdownMenuItemPr
|
|
|
2936
2942
|
children: react.ReactNode;
|
|
2937
2943
|
colorScheme?: ColorSchemeTypes;
|
|
2938
2944
|
disabled?: boolean;
|
|
2945
|
+
inheritColor?: boolean;
|
|
2939
2946
|
leftIcon?: react.ReactNode | undefined;
|
|
2940
2947
|
rightIcon?: react.ReactNode | undefined;
|
|
2941
2948
|
type?: LinkTypes | undefined;
|
|
@@ -2977,6 +2984,7 @@ declare const MenuItem: react.ForwardRefExoticComponent<(Omit<DropdownMenuItemPr
|
|
|
2977
2984
|
children: react.ReactNode;
|
|
2978
2985
|
colorScheme?: ColorSchemeTypes;
|
|
2979
2986
|
disabled?: boolean;
|
|
2987
|
+
inheritColor?: boolean;
|
|
2980
2988
|
leftIcon?: react.ReactNode | undefined;
|
|
2981
2989
|
rightIcon?: react.ReactNode | undefined;
|
|
2982
2990
|
type?: LinkTypes | undefined;
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.20.
|
|
3
|
+
* @license @wistia/ui v0.20.14
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2026, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -8051,7 +8051,11 @@ var StyledLink = styled5.a`
|
|
|
8051
8051
|
${({ $colorScheme }) => getColorScheme($colorScheme)}
|
|
8052
8052
|
cursor: ${({ $disabled }) => $disabled ? "not-allowed" : "pointer"};
|
|
8053
8053
|
font-family: inherit;
|
|
8054
|
-
color: ${({ $disabled }) =>
|
|
8054
|
+
color: ${({ $disabled, $inheritColor }) => {
|
|
8055
|
+
if ($disabled) return "var(--wui-color-text-disabled)";
|
|
8056
|
+
if ($inheritColor) return "inherit";
|
|
8057
|
+
return "var(--wui-color-text-link)";
|
|
8058
|
+
}};
|
|
8055
8059
|
text-decoration: ${({ $underline }) => $underline === "always" ? "underline" : "none"};
|
|
8056
8060
|
display: inline-flex;
|
|
8057
8061
|
align-items: baseline;
|
|
@@ -8083,6 +8087,7 @@ var Link = forwardRef(
|
|
|
8083
8087
|
disabled = false,
|
|
8084
8088
|
colorScheme = "inherit",
|
|
8085
8089
|
underline = "none",
|
|
8090
|
+
inheritColor = false,
|
|
8086
8091
|
leftIcon,
|
|
8087
8092
|
rightIcon,
|
|
8088
8093
|
"aria-disabled": ariaDisabled,
|
|
@@ -8092,6 +8097,7 @@ var Link = forwardRef(
|
|
|
8092
8097
|
const inRouterContext = useInRouterContext();
|
|
8093
8098
|
const to = generateHref(props.href, type, disabled);
|
|
8094
8099
|
const shouldUseReactRouterLink = inRouterContext && type !== "external" && !to?.startsWith("http");
|
|
8100
|
+
const hasIcons = isNotNil5(leftIcon) || isNotNil5(rightIcon);
|
|
8095
8101
|
const handleClick = async (event) => {
|
|
8096
8102
|
if (disabled) {
|
|
8097
8103
|
event.preventDefault();
|
|
@@ -8120,6 +8126,8 @@ var Link = forwardRef(
|
|
|
8120
8126
|
$colorScheme: colorScheme,
|
|
8121
8127
|
$disabled: disabled,
|
|
8122
8128
|
$underline: underline,
|
|
8129
|
+
$inheritColor: inheritColor,
|
|
8130
|
+
$hasIcons: hasIcons,
|
|
8123
8131
|
onClick: handleClick,
|
|
8124
8132
|
"aria-disabled": ariaDisabled ?? (disabled ? "true" : void 0)
|
|
8125
8133
|
};
|