Skip to content

Commit dba2513

Browse files
authored
feat(Link): support whiteSpace property in link (#1899)
1 parent a0bd250 commit dba2513

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

packages/components/src/components/Link/Link.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
import type { ComponentProps, ComponentType, PropsWithChildren } from "react";
1+
import type {
2+
ComponentProps,
3+
ComponentType,
4+
CSSProperties,
5+
PropsWithChildren,
6+
} from "react";
27
import { useContext } from "react";
38
import * as Aria from "react-aria-components";
49
import type { PropsContext } from "@/lib/propsContext";
@@ -26,6 +31,8 @@ export interface LinkProps
2631
color?: "primary" | "dark" | "light";
2732
"aria-current"?: string;
2833
slot?: string;
34+
/** The whiteSpace css value of the element. */
35+
whiteSpace?: CSSProperties["whiteSpace"];
2936
/** @internal */
3037
unstyled?: boolean;
3138
}
@@ -45,6 +52,8 @@ export const Link = flowComponent("Link", (props) => {
4552
"aria-current": ariaCurrent,
4653
ref,
4754
slot: ignoredSlotProp,
55+
style,
56+
whiteSpace,
4857
...rest
4958
} = props;
5059

@@ -84,6 +93,7 @@ export const Link = flowComponent("Link", (props) => {
8493
{...rest}
8594
className={rootClassName}
8695
ref={ref}
96+
style={{ ...style, whiteSpace }}
8797
>
8898
<PropsContextProvider props={propsContext}>
8999
{children}

packages/remote-elements/src/auto-generated/RemoteLinkElement.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export class RemoteLinkElement extends FlowRemoteElement<RemoteLinkElementProps>
3737
target: {},
3838
translate: {},
3939
unstyled: {},
40+
whiteSpace: {},
4041
};
4142
}
4243

0 commit comments

Comments
 (0)