@fluentui/react-link 9.0.40 → 9.0.42
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/CHANGELOG.json +67 -1
- package/CHANGELOG.md +26 -2
- package/lib/Link.js +0 -1
- package/lib/Link.js.map +1 -1
- package/lib/components/Link/Link.js +5 -8
- package/lib/components/Link/Link.js.map +1 -1
- package/lib/components/Link/Link.types.js +1 -2
- package/lib/components/Link/Link.types.js.map +1 -1
- package/lib/components/Link/index.js +0 -1
- package/lib/components/Link/index.js.map +1 -1
- package/lib/components/Link/renderLink.js +4 -9
- package/lib/components/Link/renderLink.js.map +1 -1
- package/lib/components/Link/useLink.js +23 -30
- package/lib/components/Link/useLink.js.map +1 -1
- package/lib/components/Link/useLinkState.js +35 -46
- package/lib/components/Link/useLinkState.js.map +1 -1
- package/lib/components/Link/useLinkStyles.styles.js.map +1 -1
- package/lib/index.js +0 -1
- package/lib/index.js.map +1 -1
- package/lib-commonjs/Link.js +0 -3
- package/lib-commonjs/Link.js.map +1 -1
- package/lib-commonjs/components/Link/Link.js +1 -3
- package/lib-commonjs/components/Link/Link.js.map +1 -1
- package/lib-commonjs/components/Link/Link.types.js +0 -3
- package/lib-commonjs/components/Link/Link.types.js.map +1 -1
- package/lib-commonjs/components/Link/index.js +0 -3
- package/lib-commonjs/components/Link/index.js.map +1 -1
- package/lib-commonjs/components/Link/renderLink.js +1 -3
- package/lib-commonjs/components/Link/renderLink.js.map +1 -1
- package/lib-commonjs/components/Link/useLink.js +1 -3
- package/lib-commonjs/components/Link/useLink.js.map +1 -1
- package/lib-commonjs/components/Link/useLinkState.js +1 -3
- package/lib-commonjs/components/Link/useLinkState.js.map +1 -1
- package/lib-commonjs/components/Link/useLinkStyles.styles.js +0 -2
- package/lib-commonjs/components/Link/useLinkStyles.styles.js.map +1 -1
- package/lib-commonjs/index.js +0 -3
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +6 -6
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,73 @@
|
|
|
2
2
|
"name": "@fluentui/react-link",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "Wed,
|
|
5
|
+
"date": "Wed, 31 May 2023 06:42:58 GMT",
|
|
6
|
+
"tag": "@fluentui/react-link_v9.0.42",
|
|
7
|
+
"version": "9.0.42",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"author": "seanmonahan@microsoft.com",
|
|
12
|
+
"package": "@fluentui/react-link",
|
|
13
|
+
"commit": "d640b972d7ac86bfb76ae6c6329f12cdd33b3b7c",
|
|
14
|
+
"comment": "chore: Update Griffel to v1.5.7."
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"author": "beachball",
|
|
18
|
+
"package": "@fluentui/react-link",
|
|
19
|
+
"comment": "Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.6",
|
|
20
|
+
"commit": "17ca96c6b7f684f36a5c63e40e78b4986a86c713"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"author": "beachball",
|
|
24
|
+
"package": "@fluentui/react-link",
|
|
25
|
+
"comment": "Bump @fluentui/react-tabster to v9.7.5",
|
|
26
|
+
"commit": "17ca96c6b7f684f36a5c63e40e78b4986a86c713"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"author": "beachball",
|
|
30
|
+
"package": "@fluentui/react-link",
|
|
31
|
+
"comment": "Bump @fluentui/react-utilities to v9.9.2",
|
|
32
|
+
"commit": "17ca96c6b7f684f36a5c63e40e78b4986a86c713"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"author": "beachball",
|
|
36
|
+
"package": "@fluentui/react-link",
|
|
37
|
+
"comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.22",
|
|
38
|
+
"commit": "17ca96c6b7f684f36a5c63e40e78b4986a86c713"
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"date": "Thu, 25 May 2023 10:00:48 GMT",
|
|
45
|
+
"tag": "@fluentui/react-link_v9.0.41",
|
|
46
|
+
"version": "9.0.41",
|
|
47
|
+
"comments": {
|
|
48
|
+
"patch": [
|
|
49
|
+
{
|
|
50
|
+
"author": "beachball",
|
|
51
|
+
"package": "@fluentui/react-link",
|
|
52
|
+
"comment": "Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.5",
|
|
53
|
+
"commit": "8f7c1b7591b3e665ae39e1b22ab0f0b28fb795c4"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"author": "beachball",
|
|
57
|
+
"package": "@fluentui/react-link",
|
|
58
|
+
"comment": "Bump @fluentui/react-tabster to v9.7.4",
|
|
59
|
+
"commit": "8f7c1b7591b3e665ae39e1b22ab0f0b28fb795c4"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"author": "beachball",
|
|
63
|
+
"package": "@fluentui/react-link",
|
|
64
|
+
"comment": "Bump @fluentui/react-utilities to v9.9.1",
|
|
65
|
+
"commit": "8f7c1b7591b3e665ae39e1b22ab0f0b28fb795c4"
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"date": "Wed, 24 May 2023 20:45:28 GMT",
|
|
6
72
|
"tag": "@fluentui/react-link_v9.0.40",
|
|
7
73
|
"version": "9.0.40",
|
|
8
74
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,36 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-link
|
|
2
2
|
|
|
3
|
-
This log was last generated on Wed,
|
|
3
|
+
This log was last generated on Wed, 31 May 2023 06:42:58 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [9.0.42](https://github.com/microsoft/fluentui/tree/@fluentui/react-link_v9.0.42)
|
|
8
|
+
|
|
9
|
+
Wed, 31 May 2023 06:42:58 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-link_v9.0.41..@fluentui/react-link_v9.0.42)
|
|
11
|
+
|
|
12
|
+
### Patches
|
|
13
|
+
|
|
14
|
+
- chore: Update Griffel to v1.5.7. ([PR #27925](https://github.com/microsoft/fluentui/pull/27925) by seanmonahan@microsoft.com)
|
|
15
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.6 ([PR #28054](https://github.com/microsoft/fluentui/pull/28054) by beachball)
|
|
16
|
+
- Bump @fluentui/react-tabster to v9.7.5 ([PR #28054](https://github.com/microsoft/fluentui/pull/28054) by beachball)
|
|
17
|
+
- Bump @fluentui/react-utilities to v9.9.2 ([PR #28054](https://github.com/microsoft/fluentui/pull/28054) by beachball)
|
|
18
|
+
- Bump @fluentui/react-conformance-griffel to v9.0.0-beta.22 ([PR #28054](https://github.com/microsoft/fluentui/pull/28054) by beachball)
|
|
19
|
+
|
|
20
|
+
## [9.0.41](https://github.com/microsoft/fluentui/tree/@fluentui/react-link_v9.0.41)
|
|
21
|
+
|
|
22
|
+
Thu, 25 May 2023 10:00:48 GMT
|
|
23
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-link_v9.0.40..@fluentui/react-link_v9.0.41)
|
|
24
|
+
|
|
25
|
+
### Patches
|
|
26
|
+
|
|
27
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.5 ([PR #27988](https://github.com/microsoft/fluentui/pull/27988) by beachball)
|
|
28
|
+
- Bump @fluentui/react-tabster to v9.7.4 ([PR #27988](https://github.com/microsoft/fluentui/pull/27988) by beachball)
|
|
29
|
+
- Bump @fluentui/react-utilities to v9.9.1 ([PR #27988](https://github.com/microsoft/fluentui/pull/27988) by beachball)
|
|
30
|
+
|
|
7
31
|
## [9.0.40](https://github.com/microsoft/fluentui/tree/@fluentui/react-link_v9.0.40)
|
|
8
32
|
|
|
9
|
-
Wed, 24 May 2023 20:
|
|
33
|
+
Wed, 24 May 2023 20:45:28 GMT
|
|
10
34
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-link_v9.0.39..@fluentui/react-link_v9.0.40)
|
|
11
35
|
|
|
12
36
|
### Patches
|
package/lib/Link.js
CHANGED
package/lib/Link.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["Link.ts"],"sourcesContent":["export * from './components/Link/index';\n"],"names":[],"mappings":"AAAA,cAAc,0BAA0B"}
|
|
@@ -4,13 +4,10 @@ import { useLinkStyles_unstable } from './useLinkStyles.styles';
|
|
|
4
4
|
import { renderLink_unstable } from './renderLink';
|
|
5
5
|
/**
|
|
6
6
|
* A Link is a reference to data that a user can follow by clicking or tapping it.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
// Work around some small mismatches in inferred types which don't matter in practice
|
|
7
|
+
*/ export const Link = /*#__PURE__*/ React.forwardRef((props, ref)=>{
|
|
8
|
+
const state = useLink_unstable(props, ref);
|
|
9
|
+
useLinkStyles_unstable(state);
|
|
10
|
+
return renderLink_unstable(state);
|
|
11
|
+
// Work around some small mismatches in inferred types which don't matter in practice
|
|
13
12
|
});
|
|
14
|
-
|
|
15
13
|
Link.displayName = 'Link';
|
|
16
|
-
//# sourceMappingURL=Link.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["Link.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useLink_unstable } from './useLink';\nimport { useLinkStyles_unstable } from './useLinkStyles.styles';\nimport { renderLink_unstable } from './renderLink';\nimport type { LinkProps } from './Link.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * A Link is a reference to data that a user can follow by clicking or tapping it.\n */\nexport const Link: ForwardRefComponent<LinkProps> = React.forwardRef((props, ref) => {\n const state = useLink_unstable(props, ref);\n\n useLinkStyles_unstable(state);\n\n return renderLink_unstable(state);\n // Work around some small mismatches in inferred types which don't matter in practice\n}) as ForwardRefComponent<LinkProps>;\n\nLink.displayName = 'Link';\n"],"names":["React","useLink_unstable","useLinkStyles_unstable","renderLink_unstable","Link","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,gBAAgB,QAAQ,YAAY;AAC7C,SAASC,sBAAsB,QAAQ,yBAAyB;AAChE,SAASC,mBAAmB,QAAQ,eAAe;AAInD;;CAEC,GACD,OAAO,MAAMC,qBAAuCJ,MAAMK,UAAU,CAAC,CAACC,OAAOC,MAAQ;IACnF,MAAMC,QAAQP,iBAAiBK,OAAOC;IAEtCL,uBAAuBM;IAEvB,OAAOL,oBAAoBK;AAC3B,qFAAqF;AACvF,GAAqC;AAErCJ,KAAKK,WAAW,GAAG"}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export {};
|
|
2
|
-
//# sourceMappingURL=Link.types.js.map
|
|
1
|
+
export { };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["Link.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type LinkSlots = {\n /**\n * Root of the component that renders as either an <a> or a <button> tag.\n */\n root: Slot<'a', 'button'>;\n};\n\nexport type LinkProps = ComponentProps<LinkSlots> & {\n /**\n * A link can appear either with its default style or subtle.\n * If not specified, the link appears with its default styling.\n * @default 'default'\n */\n appearance?: 'default' | 'subtle';\n\n /**\n * Whether the link is disabled.\n * @default false\n */\n disabled?: boolean;\n\n /**\n * When set, allows the link to be focusable even when it has been disabled. This is used in scenarios where it is\n * important to keep a consistent tab order for screen reader and keyboard users.\n * @default false\n */\n disabledFocusable?: boolean;\n\n /**\n * If true, changes styling when the link is being used alongside other text content.\n * @default false\n */\n inline?: boolean;\n};\n\nexport type LinkState = ComponentState<LinkSlots> &\n Required<Pick<LinkProps, 'appearance' | 'disabled' | 'disabledFocusable' | 'inline'>>;\n"],"names":[],"mappings":"AAAA,WAsCwF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './Link';\nexport * from './Link.types';\nexport * from './renderLink';\nexport * from './useLink';\nexport * from './useLinkState';\nexport * from './useLinkStyles.styles';\n"],"names":[],"mappings":"AAAA,cAAc,SAAS;AACvB,cAAc,eAAe;AAC7B,cAAc,eAAe;AAC7B,cAAc,YAAY;AAC1B,cAAc,iBAAiB;AAC/B,cAAc,yBAAyB"}
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
/** @jsxRuntime classic */ /** @jsx createElement */import { createElement } from '@fluentui/react-jsx-runtime';
|
|
1
|
+
/** @jsxRuntime classic */ /** @jsx createElement */ import { createElement } from '@fluentui/react-jsx-runtime';
|
|
2
2
|
import { getSlotsNext } from '@fluentui/react-utilities';
|
|
3
3
|
/**
|
|
4
4
|
* Renders a Link component by passing the state defined props to the appropriate slots.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
slots,
|
|
9
|
-
slotProps
|
|
10
|
-
} = getSlotsNext(state);
|
|
11
|
-
return /*#__PURE__*/createElement(slots.root, slotProps.root);
|
|
5
|
+
*/ export const renderLink_unstable = (state)=>{
|
|
6
|
+
const { slots , slotProps } = getSlotsNext(state);
|
|
7
|
+
return /*#__PURE__*/ createElement(slots.root, slotProps.root);
|
|
12
8
|
};
|
|
13
|
-
//# sourceMappingURL=renderLink.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["renderLink.tsx"],"sourcesContent":["/** @jsxRuntime classic */\n/** @jsx createElement */\n\nimport { createElement } from '@fluentui/react-jsx-runtime';\n\nimport { getSlotsNext } from '@fluentui/react-utilities';\nimport type { LinkSlots, LinkState } from './Link.types';\n\n/**\n * Renders a Link component by passing the state defined props to the appropriate slots.\n */\nexport const renderLink_unstable = (state: LinkState) => {\n const { slots, slotProps } = getSlotsNext<LinkSlots>(state);\n\n return <slots.root {...slotProps.root} />;\n};\n"],"names":["createElement","getSlotsNext","renderLink_unstable","state","slots","slotProps","root"],"mappings":"AAAA,wBAAwB,GACxB,uBAAuB,GAEvB,SAASA,aAAa,QAAQ,8BAA8B;AAE5D,SAASC,YAAY,QAAQ,4BAA4B;AAGzD;;CAEC,GACD,OAAO,MAAMC,sBAAsB,CAACC,QAAqB;IACvD,MAAM,EAAEC,MAAK,EAAEC,UAAS,EAAE,GAAGJ,aAAwBE;IAErD,qBAAO,AAbT,cAaUC,MAAME,IAAI,EAAKD,UAAUC,IAAI;AACvC,EAAE"}
|
|
@@ -5,34 +5,27 @@ import { useLinkState_unstable } from './useLinkState';
|
|
|
5
5
|
* Given user props, defines default props for the Link, calls useLinkState_unstable, and returns processed state.
|
|
6
6
|
* @param props - User provided props to the Link component.
|
|
7
7
|
* @param ref - User provided ref to be passed to the Link component.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
...props,
|
|
32
|
-
as
|
|
33
|
-
})
|
|
34
|
-
};
|
|
35
|
-
useLinkState_unstable(state);
|
|
36
|
-
return state;
|
|
8
|
+
*/ export const useLink_unstable = (props, ref)=>{
|
|
9
|
+
const { appearance ='default' , disabled =false , disabledFocusable =false , inline =false } = props;
|
|
10
|
+
const as = props.as || (props.href ? 'a' : 'button');
|
|
11
|
+
const type = as === 'button' ? 'button' : undefined;
|
|
12
|
+
const state = {
|
|
13
|
+
// Props passed at the top-level
|
|
14
|
+
appearance,
|
|
15
|
+
disabled,
|
|
16
|
+
disabledFocusable,
|
|
17
|
+
inline,
|
|
18
|
+
// Slots definition
|
|
19
|
+
components: {
|
|
20
|
+
root: 'a'
|
|
21
|
+
},
|
|
22
|
+
root: getNativeElementProps(as, {
|
|
23
|
+
ref,
|
|
24
|
+
type,
|
|
25
|
+
...props,
|
|
26
|
+
as
|
|
27
|
+
})
|
|
28
|
+
};
|
|
29
|
+
useLinkState_unstable(state);
|
|
30
|
+
return state;
|
|
37
31
|
};
|
|
38
|
-
//# sourceMappingURL=useLink.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["useLink.ts"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport { useLinkState_unstable } from './useLinkState';\nimport type { LinkProps, LinkState } from './Link.types';\n\n/**\n * Given user props, defines default props for the Link, calls useLinkState_unstable, and returns processed state.\n * @param props - User provided props to the Link component.\n * @param ref - User provided ref to be passed to the Link component.\n */\nexport const useLink_unstable = (\n props: LinkProps,\n ref: React.Ref<HTMLAnchorElement | HTMLButtonElement>,\n): LinkState => {\n const { appearance = 'default', disabled = false, disabledFocusable = false, inline = false } = props;\n const as = props.as || (props.href ? 'a' : 'button');\n const type = as === 'button' ? 'button' : undefined;\n\n const state: LinkState = {\n // Props passed at the top-level\n appearance,\n disabled,\n disabledFocusable,\n inline,\n\n // Slots definition\n components: {\n root: 'a',\n },\n\n root: getNativeElementProps(as, {\n ref,\n type,\n ...props,\n as,\n }),\n };\n\n useLinkState_unstable(state);\n\n return state;\n};\n"],"names":["React","getNativeElementProps","useLinkState_unstable","useLink_unstable","props","ref","appearance","disabled","disabledFocusable","inline","as","href","type","undefined","state","components","root"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,qBAAqB,QAAQ,4BAA4B;AAClE,SAASC,qBAAqB,QAAQ,iBAAiB;AAGvD;;;;CAIC,GACD,OAAO,MAAMC,mBAAmB,CAC9BC,OACAC,MACc;IACd,MAAM,EAAEC,YAAa,UAAS,EAAEC,UAAW,KAAK,CAAA,EAAEC,mBAAoB,KAAK,CAAA,EAAEC,QAAS,KAAK,CAAA,EAAE,GAAGL;IAChG,MAAMM,KAAKN,MAAMM,EAAE,IAAKN,CAAAA,MAAMO,IAAI,GAAG,MAAM,QAAQ,AAAD;IAClD,MAAMC,OAAOF,OAAO,WAAW,WAAWG,SAAS;IAEnD,MAAMC,QAAmB;QACvB,gCAAgC;QAChCR;QACAC;QACAC;QACAC;QAEA,mBAAmB;QACnBM,YAAY;YACVC,MAAM;QACR;QAEAA,MAAMf,sBAAsBS,IAAI;YAC9BL;YACAO;YACA,GAAGR,KAAK;YACRM;QACF;IACF;IAEAR,sBAAsBY;IAEtB,OAAOA;AACT,EAAE"}
|
|
@@ -3,53 +3,42 @@ import { Enter, Space } from '@fluentui/keyboard-keys';
|
|
|
3
3
|
/**
|
|
4
4
|
* The useLinkState_unstable hook processes the Link state.
|
|
5
5
|
* @param state - Link state to mutate.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
type
|
|
18
|
-
} = state.root;
|
|
19
|
-
// Add href and tabIndex=0 for anchor elements.
|
|
20
|
-
if (state.root.as === 'a') {
|
|
21
|
-
state.root.href = disabled ? undefined : state.root.href;
|
|
22
|
-
state.root.tabIndex = tabIndex !== null && tabIndex !== void 0 ? tabIndex : disabled && !disabledFocusable ? undefined : 0;
|
|
23
|
-
// Add role="link" for disabled and disabledFocusable links.
|
|
24
|
-
if (disabled || disabledFocusable) {
|
|
25
|
-
state.root.role = role || 'link';
|
|
26
|
-
}
|
|
27
|
-
} else {
|
|
28
|
-
state.root.type = type || 'button';
|
|
29
|
-
}
|
|
30
|
-
// Disallow click event when component is disabled and eat events when disabledFocusable is set to true.
|
|
31
|
-
state.root.onClick = ev => {
|
|
32
|
-
if (disabled || disabledFocusable) {
|
|
33
|
-
ev.preventDefault();
|
|
6
|
+
*/ export const useLinkState_unstable = (state)=>{
|
|
7
|
+
const { disabled , disabledFocusable } = state;
|
|
8
|
+
const { onClick , onKeyDown , role , tabIndex , type } = state.root;
|
|
9
|
+
// Add href and tabIndex=0 for anchor elements.
|
|
10
|
+
if (state.root.as === 'a') {
|
|
11
|
+
state.root.href = disabled ? undefined : state.root.href;
|
|
12
|
+
state.root.tabIndex = tabIndex !== null && tabIndex !== void 0 ? tabIndex : disabled && !disabledFocusable ? undefined : 0;
|
|
13
|
+
// Add role="link" for disabled and disabledFocusable links.
|
|
14
|
+
if (disabled || disabledFocusable) {
|
|
15
|
+
state.root.role = role || 'link';
|
|
16
|
+
}
|
|
34
17
|
} else {
|
|
35
|
-
|
|
18
|
+
state.root.type = type || 'button';
|
|
36
19
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
20
|
+
// Disallow click event when component is disabled and eat events when disabledFocusable is set to true.
|
|
21
|
+
state.root.onClick = (ev)=>{
|
|
22
|
+
if (disabled || disabledFocusable) {
|
|
23
|
+
ev.preventDefault();
|
|
24
|
+
} else {
|
|
25
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(ev);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
// Disallow keydown event when component is disabled and eat events when disabledFocusable is set to true.
|
|
29
|
+
state.root.onKeyDown = (ev)=>{
|
|
30
|
+
if ((disabled || disabledFocusable) && (ev.key === Enter || ev.key === Space)) {
|
|
31
|
+
ev.preventDefault();
|
|
32
|
+
ev.stopPropagation();
|
|
33
|
+
} else {
|
|
34
|
+
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(ev);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
// Set the aria-disabled and disabled props correctly.
|
|
38
|
+
state.disabled = disabled || disabledFocusable;
|
|
39
|
+
state.root['aria-disabled'] = disabled || disabledFocusable || undefined;
|
|
40
|
+
if (state.root.as === 'button') {
|
|
41
|
+
state.root.disabled = disabled && !disabledFocusable;
|
|
45
42
|
}
|
|
46
|
-
|
|
47
|
-
// Set the aria-disabled and disabled props correctly.
|
|
48
|
-
state.disabled = disabled || disabledFocusable;
|
|
49
|
-
state.root['aria-disabled'] = disabled || disabledFocusable || undefined;
|
|
50
|
-
if (state.root.as === 'button') {
|
|
51
|
-
state.root.disabled = disabled && !disabledFocusable;
|
|
52
|
-
}
|
|
53
|
-
return state;
|
|
43
|
+
return state;
|
|
54
44
|
};
|
|
55
|
-
//# sourceMappingURL=useLinkState.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["useLinkState.ts"],"sourcesContent":["import * as React from 'react';\nimport { Enter, Space } from '@fluentui/keyboard-keys';\nimport type { LinkState } from './Link.types';\n\n/**\n * The useLinkState_unstable hook processes the Link state.\n * @param state - Link state to mutate.\n */\nexport const useLinkState_unstable = (state: LinkState): LinkState => {\n const { disabled, disabledFocusable } = state;\n const { onClick, onKeyDown, role, tabIndex, type } = state.root;\n\n // Add href and tabIndex=0 for anchor elements.\n if (state.root.as === 'a') {\n state.root.href = disabled ? undefined : state.root.href;\n state.root.tabIndex = tabIndex ?? (disabled && !disabledFocusable ? undefined : 0);\n\n // Add role=\"link\" for disabled and disabledFocusable links.\n if (disabled || disabledFocusable) {\n state.root.role = role || 'link';\n }\n }\n // Add type=\"button\" for button elements.\n else {\n state.root.type = type || 'button';\n }\n\n // Disallow click event when component is disabled and eat events when disabledFocusable is set to true.\n state.root.onClick = (ev: React.MouseEvent<HTMLAnchorElement & HTMLButtonElement>) => {\n if (disabled || disabledFocusable) {\n ev.preventDefault();\n } else {\n onClick?.(ev);\n }\n };\n\n // Disallow keydown event when component is disabled and eat events when disabledFocusable is set to true.\n state.root.onKeyDown = (ev: React.KeyboardEvent<HTMLAnchorElement & HTMLButtonElement>) => {\n if ((disabled || disabledFocusable) && (ev.key === Enter || ev.key === Space)) {\n ev.preventDefault();\n ev.stopPropagation();\n } else {\n onKeyDown?.(ev);\n }\n };\n\n // Set the aria-disabled and disabled props correctly.\n state.disabled = disabled || disabledFocusable;\n state.root['aria-disabled'] = disabled || disabledFocusable || undefined;\n if (state.root.as === 'button') {\n state.root.disabled = disabled && !disabledFocusable;\n }\n\n return state;\n};\n"],"names":["React","Enter","Space","useLinkState_unstable","state","disabled","disabledFocusable","onClick","onKeyDown","role","tabIndex","type","root","as","href","undefined","ev","preventDefault","key","stopPropagation"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,KAAK,EAAEC,KAAK,QAAQ,0BAA0B;AAGvD;;;CAGC,GACD,OAAO,MAAMC,wBAAwB,CAACC,QAAgC;IACpE,MAAM,EAAEC,SAAQ,EAAEC,kBAAiB,EAAE,GAAGF;IACxC,MAAM,EAAEG,QAAO,EAAEC,UAAS,EAAEC,KAAI,EAAEC,SAAQ,EAAEC,KAAI,EAAE,GAAGP,MAAMQ,IAAI;IAE/D,+CAA+C;IAC/C,IAAIR,MAAMQ,IAAI,CAACC,EAAE,KAAK,KAAK;QACzBT,MAAMQ,IAAI,CAACE,IAAI,GAAGT,WAAWU,YAAYX,MAAMQ,IAAI,CAACE,IAAI;QACxDV,MAAMQ,IAAI,CAACF,QAAQ,GAAGA,qBAAAA,sBAAAA,WAAaL,YAAY,CAACC,oBAAoBS,YAAY,CAAC,AAAC;QAElF,4DAA4D;QAC5D,IAAIV,YAAYC,mBAAmB;YACjCF,MAAMQ,IAAI,CAACH,IAAI,GAAGA,QAAQ;QAC5B,CAAC;IACH,OAEK;QACHL,MAAMQ,IAAI,CAACD,IAAI,GAAGA,QAAQ;IAC5B,CAAC;IAED,wGAAwG;IACxGP,MAAMQ,IAAI,CAACL,OAAO,GAAG,CAACS,KAAgE;QACpF,IAAIX,YAAYC,mBAAmB;YACjCU,GAAGC,cAAc;QACnB,OAAO;YACLV,oBAAAA,qBAAAA,KAAAA,IAAAA,QAAUS;QACZ,CAAC;IACH;IAEA,0GAA0G;IAC1GZ,MAAMQ,IAAI,CAACJ,SAAS,GAAG,CAACQ,KAAmE;QACzF,IAAI,AAACX,CAAAA,YAAYC,iBAAgB,KAAOU,CAAAA,GAAGE,GAAG,KAAKjB,SAASe,GAAGE,GAAG,KAAKhB,KAAI,GAAI;YAC7Ec,GAAGC,cAAc;YACjBD,GAAGG,eAAe;QACpB,OAAO;YACLX,sBAAAA,uBAAAA,KAAAA,IAAAA,UAAYQ;QACd,CAAC;IACH;IAEA,sDAAsD;IACtDZ,MAAMC,QAAQ,GAAGA,YAAYC;IAC7BF,MAAMQ,IAAI,CAAC,gBAAgB,GAAGP,YAAYC,qBAAqBS;IAC/D,IAAIX,MAAMQ,IAAI,CAACC,EAAE,KAAK,UAAU;QAC9BT,MAAMQ,IAAI,CAACP,QAAQ,GAAGA,YAAY,CAACC;IACrC,CAAC;IAED,OAAOF;AACT,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["shorthands","__styles","mergeClasses","createCustomFocusIndicatorStyle","tokens","linkClassNames","root","useStyles","focusIndicator","Bttzg6e","B3uz8dt","B6ihwck","g9k6zt","De3pzq","B7ck84d","sj55zd","Bceei9c","mc9l5x","Bahqtrf","Be2twd7","Bhrd7zp","B6of3ja","t21cq0","jrapky","Frg6f3","z8tnut","z189sj","Byoj8tv","uwmqm3","B68tc82","Bmxbyg5","fsow6f","w71qe1","Bkioxbp","ygn44y","famaaq","Bde5pd6","Bi91k9c","i089h6","lj723h","button","icvyot","vrafjx","oivjwe","wvpqe5","href","subtle","inline","disabled","d","h","a","useLinkStyles_unstable","state","styles","appearance","className","as"],"sources":["
|
|
1
|
+
{"version":3,"names":["shorthands","__styles","mergeClasses","createCustomFocusIndicatorStyle","tokens","linkClassNames","root","useStyles","focusIndicator","Bttzg6e","B3uz8dt","B6ihwck","g9k6zt","De3pzq","B7ck84d","sj55zd","Bceei9c","mc9l5x","Bahqtrf","Be2twd7","Bhrd7zp","B6of3ja","t21cq0","jrapky","Frg6f3","z8tnut","z189sj","Byoj8tv","uwmqm3","B68tc82","Bmxbyg5","fsow6f","w71qe1","Bkioxbp","ygn44y","famaaq","Bde5pd6","Bi91k9c","i089h6","lj723h","button","icvyot","vrafjx","oivjwe","wvpqe5","href","subtle","inline","disabled","d","h","a","useLinkStyles_unstable","state","styles","appearance","className","as"],"sources":["useLinkStyles.styles.js"],"sourcesContent":["import { shorthands, makeStyles, mergeClasses } from '@griffel/react';\nimport { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\nimport { tokens } from '@fluentui/react-theme';\nexport const linkClassNames = {\n root: 'fui-Link'\n};\nconst useStyles = makeStyles({\n focusIndicator: createCustomFocusIndicatorStyle({\n textDecorationColor: tokens.colorStrokeFocus2,\n textDecorationLine: 'underline',\n textDecorationStyle: 'double',\n outlineStyle: 'none'\n }),\n // Common styles.\n root: {\n backgroundColor: 'transparent',\n boxSizing: 'border-box',\n color: tokens.colorBrandForegroundLink,\n cursor: 'pointer',\n display: 'inline',\n fontFamily: tokens.fontFamilyBase,\n fontSize: tokens.fontSizeBase300,\n fontWeight: tokens.fontWeightRegular,\n ...shorthands.margin(0),\n ...shorthands.padding(0),\n ...shorthands.overflow('inherit'),\n textAlign: 'left',\n textDecorationLine: 'none',\n textDecorationThickness: tokens.strokeWidthThin,\n textOverflow: 'inherit',\n userSelect: 'text',\n ':hover': {\n textDecorationLine: 'underline',\n color: tokens.colorBrandForegroundLinkHover\n },\n ':active': {\n textDecorationLine: 'underline',\n color: tokens.colorBrandForegroundLinkPressed\n }\n },\n // Overrides when the Link renders as a button.\n button: {\n ...shorthands.borderStyle('none')\n },\n // Overrides when an href is present so the Link renders as an anchor.\n href: {\n fontSize: 'inherit'\n },\n // Overrides when the Link appears subtle.\n subtle: {\n color: tokens.colorNeutralForeground2,\n ':hover': {\n textDecorationLine: 'underline',\n color: tokens.colorNeutralForeground2Hover\n },\n ':active': {\n textDecorationLine: 'underline',\n color: tokens.colorNeutralForeground2Pressed\n }\n },\n // Overrides when the Link is rendered inline within text.\n inline: {\n textDecorationLine: 'underline'\n },\n // Overrides when the Link is disabled.\n disabled: {\n textDecorationLine: 'none',\n color: tokens.colorNeutralForegroundDisabled,\n cursor: 'not-allowed',\n ':hover': {\n textDecorationLine: 'none',\n color: tokens.colorNeutralForegroundDisabled\n },\n ':active': {\n textDecorationLine: 'none',\n color: tokens.colorNeutralForegroundDisabled\n }\n }\n});\nexport const useLinkStyles_unstable = (state)=>{\n const styles = useStyles();\n const { appearance , disabled , inline , root } = state;\n state.root.className = mergeClasses(linkClassNames.root, styles.root, styles.focusIndicator, root.as === 'a' && root.href && styles.href, root.as === 'button' && styles.button, appearance === 'subtle' && styles.subtle, inline && styles.inline, disabled && styles.disabled, state.root.className);\n return state;\n};\n"],"mappings":"AAAA,SAASA,UAAU,EAAAC,QAAA,EAAcC,YAAY,QAAQ,gBAAgB;AACrE,SAASC,+BAA+B,QAAQ,yBAAyB;AACzE,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,OAAO,MAAMC,cAAc,GAAG;EAC1BC,IAAI,EAAE;AACV,CAAC;AACD,MAAMC,SAAS,gBAAGN,QAAA;EAAAO,cAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;EAAA;EAAAN,IAAA;IAAAO,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;EAAA;EAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;EAAA;EAAAC,IAAA;IAAA1B,OAAA;EAAA;EAAA2B,MAAA;IAAA/B,MAAA;IAAAqB,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;EAAA;EAAAQ,MAAA;IAAAf,MAAA;EAAA;EAAAgB,QAAA;IAAAhB,MAAA;IAAAjB,MAAA;IAAAC,OAAA;IAAAoB,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;EAAA;AAAA;EAAAU,CAAA;EAAAC,CAAA;EAAAC,CAAA;AAAA,CAwEjB,CAAC;AACF,OAAO,MAAMC,sBAAsB,GAAIC,KAAK,IAAG;EAC3C,MAAMC,MAAM,GAAG/C,SAAS,CAAC,CAAC;EAC1B,MAAM;IAAEgD,UAAU;IAAGP,QAAQ;IAAGD,MAAM;IAAGzC;EAAM,CAAC,GAAG+C,KAAK;EACxDA,KAAK,CAAC/C,IAAI,CAACkD,SAAS,GAAGtD,YAAY,CAACG,cAAc,CAACC,IAAI,EAAEgD,MAAM,CAAChD,IAAI,EAAEgD,MAAM,CAAC9C,cAAc,EAAEF,IAAI,CAACmD,EAAE,KAAK,GAAG,IAAInD,IAAI,CAACuC,IAAI,IAAIS,MAAM,CAACT,IAAI,EAAEvC,IAAI,CAACmD,EAAE,KAAK,QAAQ,IAAIH,MAAM,CAACd,MAAM,EAAEe,UAAU,KAAK,QAAQ,IAAID,MAAM,CAACR,MAAM,EAAEC,MAAM,IAAIO,MAAM,CAACP,MAAM,EAAEC,QAAQ,IAAIM,MAAM,CAACN,QAAQ,EAAEK,KAAK,CAAC/C,IAAI,CAACkD,SAAS,CAAC;EACtS,OAAOH,KAAK;AAChB,CAAC"}
|
package/lib/index.js
CHANGED
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export {\n Link,\n linkClassNames,\n renderLink_unstable,\n useLinkState_unstable,\n useLinkStyles_unstable,\n useLink_unstable,\n} from './Link';\nexport type { LinkProps, LinkSlots, LinkState } from './Link';\n"],"names":["Link","linkClassNames","renderLink_unstable","useLinkState_unstable","useLinkStyles_unstable","useLink_unstable"],"mappings":"AAAA,SACEA,IAAI,EACJC,cAAc,EACdC,mBAAmB,EACnBC,qBAAqB,EACrBC,sBAAsB,EACtBC,gBAAgB,QACX,SAAS"}
|
package/lib-commonjs/Link.js
CHANGED
package/lib-commonjs/Link.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["Link.js"],"sourcesContent":["export * from './components/Link/index';\n"],"names":[],"mappings":";;;;;oBAAc"}
|
|
@@ -17,6 +17,4 @@ const Link = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
|
17
17
|
return (0, _renderLink.renderLink_unstable)(state);
|
|
18
18
|
// Work around some small mismatches in inferred types which don't matter in practice
|
|
19
19
|
});
|
|
20
|
-
Link.displayName = 'Link';
|
|
21
|
-
|
|
22
|
-
//# sourceMappingURL=Link.js.map
|
|
20
|
+
Link.displayName = 'Link';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["Link.js"],"sourcesContent":["import * as React from 'react';\nimport { useLink_unstable } from './useLink';\nimport { useLinkStyles_unstable } from './useLinkStyles.styles';\nimport { renderLink_unstable } from './renderLink';\n/**\n * A Link is a reference to data that a user can follow by clicking or tapping it.\n */ export const Link = /*#__PURE__*/ React.forwardRef((props, ref)=>{\n const state = useLink_unstable(props, ref);\n useLinkStyles_unstable(state);\n return renderLink_unstable(state);\n// Work around some small mismatches in inferred types which don't matter in practice\n});\nLink.displayName = 'Link';\n"],"names":["Link","React","forwardRef","props","ref","state","useLink_unstable","useLinkStyles_unstable","renderLink_unstable","displayName"],"mappings":";;;;+BAMiBA;;aAAAA;;;6DANM;yBACU;qCACM;4BACH;AAGzB,MAAMA,OAAO,WAAW,GAAGC,OAAMC,UAAU,CAAC,CAACC,OAAOC,MAAM;IACjE,MAAMC,QAAQC,IAAAA,yBAAgB,EAACH,OAAOC;IACtCG,IAAAA,2CAAsB,EAACF;IACvB,OAAOG,IAAAA,+BAAmB,EAACH;AAC/B,qFAAqF;AACrF;AACAL,KAAKS,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
@@ -9,6 +9,3 @@ _exportStar(require("./renderLink"), exports);
|
|
|
9
9
|
_exportStar(require("./useLink"), exports);
|
|
10
10
|
_exportStar(require("./useLinkState"), exports);
|
|
11
11
|
_exportStar(require("./useLinkStyles.styles"), exports);
|
|
12
|
-
//# sourceMappingURL=index.js.map
|
|
13
|
-
|
|
14
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["index.js"],"sourcesContent":["export * from './Link';\nexport * from './Link.types';\nexport * from './renderLink';\nexport * from './useLink';\nexport * from './useLinkState';\nexport * from './useLinkStyles.styles';\n"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA;oBACA;oBACA"}
|
|
@@ -11,6 +11,4 @@ const _reactUtilities = require("@fluentui/react-utilities");
|
|
|
11
11
|
const renderLink_unstable = (state)=>{
|
|
12
12
|
const { slots , slotProps } = (0, _reactUtilities.getSlotsNext)(state);
|
|
13
13
|
return /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.root, slotProps.root);
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
//# sourceMappingURL=renderLink.js.map
|
|
14
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["renderLink.js"],"sourcesContent":["/** @jsxRuntime classic */ /** @jsx createElement */ import { createElement } from '@fluentui/react-jsx-runtime';\nimport { getSlotsNext } from '@fluentui/react-utilities';\n/**\n * Renders a Link component by passing the state defined props to the appropriate slots.\n */ export const renderLink_unstable = (state)=>{\n const { slots , slotProps } = getSlotsNext(state);\n return /*#__PURE__*/ createElement(slots.root, slotProps.root);\n};\n"],"names":["renderLink_unstable","state","slots","slotProps","getSlotsNext","createElement","root"],"mappings":"AAAA,wBAAwB,GAAG,uBAAuB;;;;+BAIjCA;;aAAAA;;iCAJkE;gCACtD;AAGlB,MAAMA,sBAAsB,CAACC,QAAQ;IAC5C,MAAM,EAAEC,MAAK,EAAGC,UAAS,EAAG,GAAGC,IAAAA,4BAAY,EAACH;IAC5C,OAAO,WAAW,GAAGI,IAAAA,8BAAa,EAACH,MAAMI,IAAI,EAAEH,UAAUG,IAAI;AACjE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["useLink.js"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport { useLinkState_unstable } from './useLinkState';\n/**\n * Given user props, defines default props for the Link, calls useLinkState_unstable, and returns processed state.\n * @param props - User provided props to the Link component.\n * @param ref - User provided ref to be passed to the Link component.\n */ export const useLink_unstable = (props, ref)=>{\n const { appearance ='default' , disabled =false , disabledFocusable =false , inline =false } = props;\n const as = props.as || (props.href ? 'a' : 'button');\n const type = as === 'button' ? 'button' : undefined;\n const state = {\n // Props passed at the top-level\n appearance,\n disabled,\n disabledFocusable,\n inline,\n // Slots definition\n components: {\n root: 'a'\n },\n root: getNativeElementProps(as, {\n ref,\n type,\n ...props,\n as\n })\n };\n useLinkState_unstable(state);\n return state;\n};\n"],"names":["useLink_unstable","props","ref","appearance","disabled","disabledFocusable","inline","as","href","type","undefined","state","components","root","getNativeElementProps","useLinkState_unstable"],"mappings":";;;;+BAOiBA;;aAAAA;;;6DAPM;gCACe;8BACA;AAK3B,MAAMA,mBAAmB,CAACC,OAAOC,MAAM;IAC9C,MAAM,EAAEC,YAAY,UAAS,EAAGC,UAAU,KAAK,CAAA,EAAGC,mBAAmB,KAAK,CAAA,EAAGC,QAAQ,KAAK,CAAA,EAAG,GAAGL;IAChG,MAAMM,KAAKN,MAAMM,EAAE,IAAKN,CAAAA,MAAMO,IAAI,GAAG,MAAM,QAAQ,AAAD;IAClD,MAAMC,OAAOF,OAAO,WAAW,WAAWG,SAAS;IACnD,MAAMC,QAAQ;QACV,gCAAgC;QAChCR;QACAC;QACAC;QACAC;QACA,mBAAmB;QACnBM,YAAY;YACRC,MAAM;QACV;QACAA,MAAMC,IAAAA,qCAAqB,EAACP,IAAI;YAC5BL;YACAO;YACA,GAAGR,KAAK;YACRM;QACJ;IACJ;IACAQ,IAAAA,mCAAqB,EAACJ;IACtB,OAAOA;AACX"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["useLinkState.js"],"sourcesContent":["import * as React from 'react';\nimport { Enter, Space } from '@fluentui/keyboard-keys';\n/**\n * The useLinkState_unstable hook processes the Link state.\n * @param state - Link state to mutate.\n */ export const useLinkState_unstable = (state)=>{\n const { disabled , disabledFocusable } = state;\n const { onClick , onKeyDown , role , tabIndex , type } = state.root;\n // Add href and tabIndex=0 for anchor elements.\n if (state.root.as === 'a') {\n state.root.href = disabled ? undefined : state.root.href;\n state.root.tabIndex = tabIndex !== null && tabIndex !== void 0 ? tabIndex : disabled && !disabledFocusable ? undefined : 0;\n // Add role=\"link\" for disabled and disabledFocusable links.\n if (disabled || disabledFocusable) {\n state.root.role = role || 'link';\n }\n } else {\n state.root.type = type || 'button';\n }\n // Disallow click event when component is disabled and eat events when disabledFocusable is set to true.\n state.root.onClick = (ev)=>{\n if (disabled || disabledFocusable) {\n ev.preventDefault();\n } else {\n onClick === null || onClick === void 0 ? void 0 : onClick(ev);\n }\n };\n // Disallow keydown event when component is disabled and eat events when disabledFocusable is set to true.\n state.root.onKeyDown = (ev)=>{\n if ((disabled || disabledFocusable) && (ev.key === Enter || ev.key === Space)) {\n ev.preventDefault();\n ev.stopPropagation();\n } else {\n onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(ev);\n }\n };\n // Set the aria-disabled and disabled props correctly.\n state.disabled = disabled || disabledFocusable;\n state.root['aria-disabled'] = disabled || disabledFocusable || undefined;\n if (state.root.as === 'button') {\n state.root.disabled = disabled && !disabledFocusable;\n }\n return state;\n};\n"],"names":["useLinkState_unstable","state","disabled","disabledFocusable","onClick","onKeyDown","role","tabIndex","type","root","as","href","undefined","ev","preventDefault","key","Enter","Space","stopPropagation"],"mappings":";;;;+BAKiBA;;aAAAA;;;6DALM;8BACM;AAIlB,MAAMA,wBAAwB,CAACC,QAAQ;IAC9C,MAAM,EAAEC,SAAQ,EAAGC,kBAAiB,EAAG,GAAGF;IAC1C,MAAM,EAAEG,QAAO,EAAGC,UAAS,EAAGC,KAAI,EAAGC,SAAQ,EAAGC,KAAI,EAAG,GAAGP,MAAMQ,IAAI;IACpE,+CAA+C;IAC/C,IAAIR,MAAMQ,IAAI,CAACC,EAAE,KAAK,KAAK;QACvBT,MAAMQ,IAAI,CAACE,IAAI,GAAGT,WAAWU,YAAYX,MAAMQ,IAAI,CAACE,IAAI;QACxDV,MAAMQ,IAAI,CAACF,QAAQ,GAAGA,aAAa,IAAI,IAAIA,aAAa,KAAK,IAAIA,WAAWL,YAAY,CAACC,oBAAoBS,YAAY,CAAC;QAC1H,4DAA4D;QAC5D,IAAIV,YAAYC,mBAAmB;YAC/BF,MAAMQ,IAAI,CAACH,IAAI,GAAGA,QAAQ;QAC9B,CAAC;IACL,OAAO;QACHL,MAAMQ,IAAI,CAACD,IAAI,GAAGA,QAAQ;IAC9B,CAAC;IACD,wGAAwG;IACxGP,MAAMQ,IAAI,CAACL,OAAO,GAAG,CAACS,KAAK;QACvB,IAAIX,YAAYC,mBAAmB;YAC/BU,GAAGC,cAAc;QACrB,OAAO;YACHV,YAAY,IAAI,IAAIA,YAAY,KAAK,IAAI,KAAK,IAAIA,QAAQS,GAAG;QACjE,CAAC;IACL;IACA,0GAA0G;IAC1GZ,MAAMQ,IAAI,CAACJ,SAAS,GAAG,CAACQ,KAAK;QACzB,IAAI,AAACX,CAAAA,YAAYC,iBAAgB,KAAOU,CAAAA,GAAGE,GAAG,KAAKC,mBAAK,IAAIH,GAAGE,GAAG,KAAKE,mBAAK,AAAD,GAAI;YAC3EJ,GAAGC,cAAc;YACjBD,GAAGK,eAAe;QACtB,OAAO;YACHb,cAAc,IAAI,IAAIA,cAAc,KAAK,IAAI,KAAK,IAAIA,UAAUQ,GAAG;QACvE,CAAC;IACL;IACA,sDAAsD;IACtDZ,MAAMC,QAAQ,GAAGA,YAAYC;IAC7BF,MAAMQ,IAAI,CAAC,gBAAgB,GAAGP,YAAYC,qBAAqBS;IAC/D,IAAIX,MAAMQ,IAAI,CAACC,EAAE,KAAK,UAAU;QAC5BT,MAAMQ,IAAI,CAACP,QAAQ,GAAGA,YAAY,CAACC;IACvC,CAAC;IACD,OAAOF;AACX"}
|
|
@@ -162,5 +162,3 @@ const useLinkStyles_unstable = (state)=>{
|
|
|
162
162
|
state.root.className = (0, _react.mergeClasses)(linkClassNames.root, styles.root, styles.focusIndicator, root.as === 'a' && root.href && styles.href, root.as === 'button' && styles.button, appearance === 'subtle' && styles.subtle, inline && styles.inline, disabled && styles.disabled, state.root.className);
|
|
163
163
|
return state;
|
|
164
164
|
}; //# sourceMappingURL=useLinkStyles.styles.js.map
|
|
165
|
-
|
|
166
|
-
//# sourceMappingURL=useLinkStyles.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["useLinkStyles.styles.js"],"sourcesContent":["import { shorthands, __styles, mergeClasses } from '@griffel/react';\nimport { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\nimport { tokens } from '@fluentui/react-theme';\nexport const linkClassNames = {\n root: 'fui-Link'\n};\nconst useStyles = /*#__PURE__*/__styles({\n focusIndicator: {\n Bttzg6e: \"fhgqx19\",\n B3uz8dt: \"f1olyrje\",\n B6ihwck: \"f1p93eir\",\n g9k6zt: \"f1nev41a\"\n },\n root: {\n De3pzq: \"f3rmtva\",\n B7ck84d: \"f1ewtqcl\",\n sj55zd: \"fyind8e\",\n Bceei9c: \"f1k6fduh\",\n mc9l5x: \"f1w7gpdv\",\n Bahqtrf: \"fk6fouc\",\n Be2twd7: \"fkhj508\",\n Bhrd7zp: \"figsok6\",\n B6of3ja: \"f1hu3pq6\",\n t21cq0: [\"f11qmguv\", \"f1tyq0we\"],\n jrapky: \"f19f4twv\",\n Frg6f3: [\"f1tyq0we\", \"f11qmguv\"],\n z8tnut: \"f1g0x7ka\",\n z189sj: [\"fhxju0i\", \"f1cnd47f\"],\n Byoj8tv: \"f1qch9an\",\n uwmqm3: [\"f1cnd47f\", \"fhxju0i\"],\n B68tc82: \"fqv5qza\",\n Bmxbyg5: \"f1vmzxwi\",\n fsow6f: [\"f1o700av\", \"fes3tcz\"],\n w71qe1: \"f1iuv45f\",\n Bkioxbp: \"f1cmlufx\",\n ygn44y: \"f9n3di6\",\n famaaq: \"f1ids18y\",\n Bde5pd6: \"f1tx3yz7\",\n Bi91k9c: \"f1deo86v\",\n i089h6: \"f1eh06m1\",\n lj723h: \"f1iescvh\"\n },\n button: {\n icvyot: \"f1ern45e\",\n vrafjx: [\"f1n71otn\", \"f1deefiw\"],\n oivjwe: \"f1h8hb77\",\n wvpqe5: [\"f1deefiw\", \"f1n71otn\"]\n },\n href: {\n Be2twd7: \"fjoy568\"\n },\n subtle: {\n sj55zd: \"fkfq4zb\",\n Bde5pd6: \"f1tx3yz7\",\n Bi91k9c: \"fnwyq0v\",\n i089h6: \"f1eh06m1\",\n lj723h: \"flvvhsy\"\n },\n inline: {\n w71qe1: \"f13mvf36\"\n },\n disabled: {\n w71qe1: \"f1iuv45f\",\n sj55zd: \"f1s2aq7o\",\n Bceei9c: \"fdrzuqr\",\n Bde5pd6: \"fbnuktb\",\n Bi91k9c: \"fvgxktp\",\n i089h6: \"fljg2da\",\n lj723h: \"f19wldhg\"\n }\n}, {\n d: [\".fhgqx19[data-fui-focus-visible]{text-decoration-color:var(--colorStrokeFocus2);}\", \".f1olyrje[data-fui-focus-visible]{text-decoration-line:underline;}\", \".f1p93eir[data-fui-focus-visible]{text-decoration-style:double;}\", \".f1nev41a[data-fui-focus-visible]{outline-style:none;}\", \".f3rmtva{background-color:transparent;}\", \".f1ewtqcl{box-sizing:border-box;}\", \".fyind8e{color:var(--colorBrandForegroundLink);}\", \".f1k6fduh{cursor:pointer;}\", \".f1w7gpdv{display:inline;}\", \".fk6fouc{font-family:var(--fontFamilyBase);}\", \".fkhj508{font-size:var(--fontSizeBase300);}\", \".figsok6{font-weight:var(--fontWeightRegular);}\", \".f1hu3pq6{margin-top:0;}\", \".f11qmguv{margin-right:0;}\", \".f1tyq0we{margin-left:0;}\", \".f19f4twv{margin-bottom:0;}\", \".f1g0x7ka{padding-top:0;}\", \".fhxju0i{padding-right:0;}\", \".f1cnd47f{padding-left:0;}\", \".f1qch9an{padding-bottom:0;}\", \".fqv5qza{overflow-x:inherit;}\", \".f1vmzxwi{overflow-y:inherit;}\", \".f1o700av{text-align:left;}\", \".fes3tcz{text-align:right;}\", \".f1iuv45f{text-decoration-line:none;}\", \".f1cmlufx{text-decoration-thickness:var(--strokeWidthThin);}\", \".f9n3di6{text-overflow:inherit;}\", \".f1ids18y{-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;}\", \".f1ern45e{border-top-style:none;}\", \".f1n71otn{border-right-style:none;}\", \".f1deefiw{border-left-style:none;}\", \".f1h8hb77{border-bottom-style:none;}\", \".fjoy568{font-size:inherit;}\", \".fkfq4zb{color:var(--colorNeutralForeground2);}\", \".f13mvf36{text-decoration-line:underline;}\", \".f1s2aq7o{color:var(--colorNeutralForegroundDisabled);}\", \".fdrzuqr{cursor:not-allowed;}\"],\n h: [\".f1tx3yz7:hover{text-decoration-line:underline;}\", \".f1deo86v:hover{color:var(--colorBrandForegroundLinkHover);}\", \".fnwyq0v:hover{color:var(--colorNeutralForeground2Hover);}\", \".fbnuktb:hover{text-decoration-line:none;}\", \".fvgxktp:hover{color:var(--colorNeutralForegroundDisabled);}\"],\n a: [\".f1eh06m1:active{text-decoration-line:underline;}\", \".f1iescvh:active{color:var(--colorBrandForegroundLinkPressed);}\", \".flvvhsy:active{color:var(--colorNeutralForeground2Pressed);}\", \".fljg2da:active{text-decoration-line:none;}\", \".f19wldhg:active{color:var(--colorNeutralForegroundDisabled);}\"]\n});\nexport const useLinkStyles_unstable = state => {\n const styles = useStyles();\n const {\n appearance,\n disabled,\n inline,\n root\n } = state;\n state.root.className = mergeClasses(linkClassNames.root, styles.root, styles.focusIndicator, root.as === 'a' && root.href && styles.href, root.as === 'button' && styles.button, appearance === 'subtle' && styles.subtle, inline && styles.inline, disabled && styles.disabled, state.root.className);\n return state;\n};\n//# sourceMappingURL=useLinkStyles.styles.js.map"],"names":["linkClassNames","useLinkStyles_unstable","root","useStyles","__styles","focusIndicator","Bttzg6e","B3uz8dt","B6ihwck","g9k6zt","De3pzq","B7ck84d","sj55zd","Bceei9c","mc9l5x","Bahqtrf","Be2twd7","Bhrd7zp","B6of3ja","t21cq0","jrapky","Frg6f3","z8tnut","z189sj","Byoj8tv","uwmqm3","B68tc82","Bmxbyg5","fsow6f","w71qe1","Bkioxbp","ygn44y","famaaq","Bde5pd6","Bi91k9c","i089h6","lj723h","button","icvyot","vrafjx","oivjwe","wvpqe5","href","subtle","inline","disabled","d","h","a","state","styles","appearance","className","mergeClasses","as"],"mappings":";;;;;;;;;;;IAGaA,cAAc,MAAdA;IAwEAC,sBAAsB,MAAtBA;;uBA3EsC;AAG5C,MAAMD,iBAAiB;IAC5BE,MAAM;AACR;AACA,MAAMC,YAAY,WAAW,GAAEC,IAAAA,kBAAQ,EAAC;IACtCC,gBAAgB;QACdC,SAAS;QACTC,SAAS;QACTC,SAAS;QACTC,QAAQ;IACV;IACAP,MAAM;QACJQ,QAAQ;QACRC,SAAS;QACTC,QAAQ;QACRC,SAAS;QACTC,QAAQ;QACRC,SAAS;QACTC,SAAS;QACTC,SAAS;QACTC,SAAS;QACTC,QAAQ;YAAC;YAAY;SAAW;QAChCC,QAAQ;QACRC,QAAQ;YAAC;YAAY;SAAW;QAChCC,QAAQ;QACRC,QAAQ;YAAC;YAAW;SAAW;QAC/BC,SAAS;QACTC,QAAQ;YAAC;YAAY;SAAU;QAC/BC,SAAS;QACTC,SAAS;QACTC,QAAQ;YAAC;YAAY;SAAU;QAC/BC,QAAQ;QACRC,SAAS;QACTC,QAAQ;QACRC,QAAQ;QACRC,SAAS;QACTC,SAAS;QACTC,QAAQ;QACRC,QAAQ;IACV;IACAC,QAAQ;QACNC,QAAQ;QACRC,QAAQ;YAAC;YAAY;SAAW;QAChCC,QAAQ;QACRC,QAAQ;YAAC;YAAY;SAAW;IAClC;IACAC,MAAM;QACJ1B,SAAS;IACX;IACA2B,QAAQ;QACN/B,QAAQ;QACRqB,SAAS;QACTC,SAAS;QACTC,QAAQ;QACRC,QAAQ;IACV;IACAQ,QAAQ;QACNf,QAAQ;IACV;IACAgB,UAAU;QACRhB,QAAQ;QACRjB,QAAQ;QACRC,SAAS;QACToB,SAAS;QACTC,SAAS;QACTC,QAAQ;QACRC,QAAQ;IACV;AACF,GAAG;IACDU,GAAG;QAAC;QAAqF;QAAsE;QAAoE;QAA0D;QAA2C;QAAqC;QAAoD;QAA8B;QAA8B;QAAgD;QAA+C;QAAmD;QAA4B;QAA8B;QAA6B;QAA+B;QAA6B;QAA8B;QAA8B;QAAgC;QAAiC;QAAkC;QAA+B;QAA+B;QAAyC;QAAgE;QAAoC;QAAoG;QAAqC;QAAuC;QAAsC;QAAwC;QAAgC;QAAmD;QAA8C;QAA2D;KAAgC;IACtkDC,GAAG;QAAC;QAAoD;QAAgE;QAA8D;QAA8C;KAA+D;IACnSC,GAAG;QAAC;QAAqD;QAAmE;QAAiE;QAA+C;KAAiE;AAC/S;AACO,MAAM/C,yBAAyBgD,CAAAA,QAAS;IAC7C,MAAMC,SAAS/C;IACf,MAAM,EACJgD,WAAU,EACVN,SAAQ,EACRD,OAAM,EACN1C,KAAI,EACL,GAAG+C;IACJA,MAAM/C,IAAI,CAACkD,SAAS,GAAGC,IAAAA,mBAAY,EAACrD,eAAeE,IAAI,EAAEgD,OAAOhD,IAAI,EAAEgD,OAAO7C,cAAc,EAAEH,KAAKoD,EAAE,KAAK,OAAOpD,KAAKwC,IAAI,IAAIQ,OAAOR,IAAI,EAAExC,KAAKoD,EAAE,KAAK,YAAYJ,OAAOb,MAAM,EAAEc,eAAe,YAAYD,OAAOP,MAAM,EAAEC,UAAUM,OAAON,MAAM,EAAEC,YAAYK,OAAOL,QAAQ,EAAEI,MAAM/C,IAAI,CAACkD,SAAS;IACrS,OAAOH;AACT,GACA,gDAAgD"}
|
package/lib-commonjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["index.js"],"sourcesContent":["export { Link, linkClassNames, renderLink_unstable, useLinkState_unstable, useLinkStyles_unstable, useLink_unstable } from './Link';\n"],"names":["Link","linkClassNames","renderLink_unstable","useLinkState_unstable","useLinkStyles_unstable","useLink_unstable"],"mappings":";;;;;;;;;;;IAASA,IAAI,MAAJA,UAAI;IAAEC,cAAc,MAAdA,oBAAc;IAAEC,mBAAmB,MAAnBA,yBAAmB;IAAEC,qBAAqB,MAArBA,2BAAqB;IAAEC,sBAAsB,MAAtBA,4BAAsB;IAAEC,gBAAgB,MAAhBA,sBAAgB;;sBAAQ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui/react-link",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.42",
|
|
4
4
|
"description": "Fluent UI React Link component",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -29,17 +29,17 @@
|
|
|
29
29
|
"@fluentui/a11y-testing": "^0.1.0",
|
|
30
30
|
"@fluentui/eslint-plugin": "*",
|
|
31
31
|
"@fluentui/react-conformance": "*",
|
|
32
|
-
"@fluentui/react-conformance-griffel": "9.0.0-beta.
|
|
32
|
+
"@fluentui/react-conformance-griffel": "9.0.0-beta.22",
|
|
33
33
|
"@fluentui/scripts-api-extractor": "*",
|
|
34
34
|
"@fluentui/scripts-tasks": "*"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@fluentui/keyboard-keys": "^9.0.3",
|
|
38
|
-
"@fluentui/react-jsx-runtime": "9.0.0-alpha.
|
|
39
|
-
"@fluentui/react-tabster": "^9.7.
|
|
38
|
+
"@fluentui/react-jsx-runtime": "9.0.0-alpha.6",
|
|
39
|
+
"@fluentui/react-tabster": "^9.7.5",
|
|
40
40
|
"@fluentui/react-theme": "^9.1.8",
|
|
41
|
-
"@fluentui/react-utilities": "^9.9.
|
|
42
|
-
"@griffel/react": "^1.5.
|
|
41
|
+
"@fluentui/react-utilities": "^9.9.2",
|
|
42
|
+
"@griffel/react": "^1.5.7",
|
|
43
43
|
"@swc/helpers": "^0.4.14"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|