Skip to content

Commit 793ea62

Browse files
[Link] Documentation and tester update for link on Android (#2442)
### Platforms Impacted - [ ] iOS - [ ] macOS - [ ] win32 (Office) - [ ] windows - [x] android ### Description of changes Updates the documentation and tester app for Link for android. ### Verification Visual Verification on Android ### Pull request checklist This PR has considered (when applicable): - [ ] Automated Tests - [x] Documentation and examples - [ ] Keyboard Accessibility - [ ] Voiceover - [ ] Internationalization and Right-to-left Layouts
1 parent 7a257fe commit 793ea62

File tree

8 files changed

+50
-30
lines changed

8 files changed

+50
-30
lines changed

apps/fluent-tester/src/TestComponents/LinkExperimental/LinkTest.tsx

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -152,20 +152,22 @@ const linkSections: TestSection[] = [
152152
name: 'Inline Links',
153153
component: InlineLinks,
154154
},
155-
...Platform.select({
156-
// As per design discussion , There is no use case for subtle link on Android , No tokens available for same.
157-
android: [null],
158-
default: [
159-
{
160-
name: 'Subtle Links',
161-
component: SubtleLinks,
162-
},
163-
],
155+
Platform.select({
156+
// As per design discussion, there is no use case for subtle link on Android, no tokens available for the same.
157+
android: null,
158+
default: {
159+
name: 'Subtle Links',
160+
component: SubtleLinks,
161+
},
164162
}),
165-
{
166-
name: 'Custom Link',
167-
component: CustomLinks,
168-
},
163+
Platform.select({
164+
android: null,
165+
default: {
166+
name: 'Custom Link',
167+
component: CustomLinks,
168+
},
169+
}),
170+
169171
{
170172
name: 'Link E2E Test',
171173
component: LinkE2ETest,
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "doc and tester update for link on Android",
4+
"packageName": "@fluentui-react-native/experimental-link",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "spec update , address pr feedbacks",
4+
"packageName": "@fluentui-react-native/link",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "doc and tester update for link on Android",
4+
"packageName": "@fluentui-react-native/tester",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}

packages/components/Link/SPEC.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ Below is the set of props the Text supports:
7575
export interface LinkProps extends IWithPressableOptions<TextProps> {
7676
/**
7777
* The appearance of the link, either `default` or `subtle`
78+
* Note: 'subtle' is not supported for Android
7879
* @default default
7980
*/
8081
appearance?: LinkAppearance;
@@ -100,6 +101,7 @@ export interface LinkProps extends IWithPressableOptions<TextProps> {
100101
url?: string;
101102
/**
102103
* Text that should show in a tooltip when the user hovers over a button.
104+
* Note: Not supported for Android
103105
*/
104106
tooltip?: string;
105107
}
@@ -121,6 +123,8 @@ export interface LinkTokens extends TextTokens {
121123
}
122124
```
123125

126+
Note: 'hovered','focused','visited','subtle' are not supported for Android
127+
124128
## Behaviors
125129

126130
### Link with url

packages/experimental/Link/src/Link.types.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export const linkName = 'Link';
77
export type LinkState = IPressableState & {
88
/**
99
* Specifies whether the link has been visited.
10+
* Note: Not supported for Android
1011
* @default false
1112
*/
1213
visited?: boolean;
@@ -24,6 +25,7 @@ export type LinkState = IPressableState & {
2425
inline?: boolean;
2526
/**
2627
* Specifies whether the link is subtle.
28+
* Note: Not supported for Android
2729
* @default false
2830
*/
2931
subtle?: boolean;
@@ -32,6 +34,7 @@ export type LinkState = IPressableState & {
3234
/**
3335
* Link tokens, these are the internally configurable values for Link elements. In particular these
3436
* drive decisions on how to build the styles
37+
* Note: 'hovered','focused','visited','subtle' are not supported for Android
3538
*/
3639
export interface LinkTokens extends TextTokens {
3740
hovered?: LinkTokens;
@@ -51,6 +54,7 @@ export type LinkAppearance = 'default' | 'subtle';
5154
export interface LinkProps extends IWithPressableOptions<TextProps> {
5255
/**
5356
* The appearance of the link, either `default` or `subtle`
57+
* Note: 'subtle' is not supported for Android
5458
* @default default
5559
*/
5660
appearance?: LinkAppearance;
@@ -76,6 +80,7 @@ export interface LinkProps extends IWithPressableOptions<TextProps> {
7680
url?: string;
7781
/**
7882
* Text that should show in a tooltip when the user hovers over a button.
83+
* Note: Not supported for Android
7984
*/
8085
tooltip?: string;
8186
}

packages/experimental/Link/src/LinkTokens.android.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export const defaultLinkTokens: TokenSettings<LinkTokens, Theme> = (t: Theme) =>
66
({
77
color: t.colors.brandForeground1,
88
alignSelf: 'flex-start',
9-
variant: 'body1',
9+
variant: 'caption1Strong',
1010
inline: {
1111
textDecorationLine: 'underline',
1212
},

packages/experimental/Link/src/__tests__/__snapshots__/Link.test.tsx.snap

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,8 @@ exports[`Link component tests Default Link 1`] = `
3838
Object {
3939
"alignSelf": "flex-start",
4040
"color": "#0f6cbd",
41-
"fontFamily": "Segoe UI",
42-
"fontSize": 13,
43-
"fontWeight": "400",
4441
"margin": 0,
45-
"variant": "body1",
42+
"variant": "caption1Strong",
4643
}
4744
}
4845
>
@@ -88,11 +85,8 @@ exports[`Link component tests Default Link as a pressable 1`] = `
8885
Object {
8986
"alignSelf": "flex-start",
9087
"color": "#0f6cbd",
91-
"fontFamily": "Segoe UI",
92-
"fontSize": 13,
93-
"fontWeight": "400",
9488
"margin": 0,
95-
"variant": "body1",
89+
"variant": "caption1Strong",
9690
}
9791
}
9892
>
@@ -129,12 +123,9 @@ exports[`Link component tests Inline Link 1`] = `
129123
Object {
130124
"alignSelf": "flex-start",
131125
"color": "#0f6cbd",
132-
"fontFamily": "Segoe UI",
133-
"fontSize": 13,
134-
"fontWeight": "400",
135126
"margin": 0,
136127
"textDecorationLine": "underline",
137-
"variant": "body1",
128+
"variant": "caption1Strong",
138129
}
139130
}
140131
tooltip="https://www.bing.com"
@@ -182,11 +173,8 @@ exports[`Link component tests Subtle Link 1`] = `
182173
Object {
183174
"alignSelf": "flex-start",
184175
"color": "#0f6cbd",
185-
"fontFamily": "Segoe UI",
186-
"fontSize": 13,
187-
"fontWeight": "400",
188176
"margin": 0,
189-
"variant": "body1",
177+
"variant": "caption1Strong",
190178
}
191179
}
192180
>

0 commit comments

Comments
 (0)