@fluentui/react-link 9.0.30 → 9.0.32
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/.swcrc +30 -0
- package/CHANGELOG.json +67 -1
- package/CHANGELOG.md +26 -2
- package/lib/Link.js.map +1 -1
- package/lib/components/Link/Link.js.map +1 -1
- package/lib/components/Link/Link.types.js.map +1 -1
- package/lib/components/Link/index.js.map +1 -1
- package/lib/components/Link/renderLink.js +1 -3
- package/lib/components/Link/renderLink.js.map +1 -1
- package/lib/components/Link/useLink.js +1 -0
- package/lib/components/Link/useLink.js.map +1 -1
- package/lib/components/Link/useLinkState.js +2 -3
- package/lib/components/Link/useLinkState.js.map +1 -1
- package/lib/components/Link/useLinkStyles.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib-commonjs/Link.js +5 -4
- package/lib-commonjs/Link.js.map +1 -1
- package/lib-commonjs/components/Link/Link.js +16 -16
- package/lib-commonjs/components/Link/Link.js.map +1 -1
- package/lib-commonjs/components/Link/Link.types.js +3 -2
- package/lib-commonjs/components/Link/Link.types.js.map +1 -1
- package/lib-commonjs/components/Link/index.js +10 -9
- package/lib-commonjs/components/Link/index.js.map +1 -1
- package/lib-commonjs/components/Link/renderLink.js +13 -18
- package/lib-commonjs/components/Link/renderLink.js.map +1 -1
- package/lib-commonjs/components/Link/useLink.js +34 -40
- package/lib-commonjs/components/Link/useLink.js.map +1 -1
- package/lib-commonjs/components/Link/useLinkState.js +45 -56
- package/lib-commonjs/components/Link/useLinkState.js.map +1 -1
- package/lib-commonjs/components/Link/useLinkStyles.js +165 -90
- package/lib-commonjs/components/Link/useLinkStyles.js.map +1 -1
- package/lib-commonjs/index.js +17 -39
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +9 -8
- package/lib-amd/Link.js +0 -6
- package/lib-amd/Link.js.map +0 -1
- package/lib-amd/components/Link/Link.js +0 -16
- package/lib-amd/components/Link/Link.js.map +0 -1
- package/lib-amd/components/Link/Link.types.js +0 -5
- package/lib-amd/components/Link/Link.types.js.map +0 -1
- package/lib-amd/components/Link/index.js +0 -11
- package/lib-amd/components/Link/index.js.map +0 -1
- package/lib-amd/components/Link/renderLink.js +0 -14
- package/lib-amd/components/Link/renderLink.js.map +0 -1
- package/lib-amd/components/Link/useLink.js +0 -31
- package/lib-amd/components/Link/useLink.js.map +0 -1
- package/lib-amd/components/Link/useLinkState.js +0 -54
- package/lib-amd/components/Link/useLinkState.js.map +0 -1
- package/lib-amd/components/Link/useLinkStyles.js +0 -67
- package/lib-amd/components/Link/useLinkStyles.js.map +0 -1
- package/lib-amd/index.js +0 -12
- package/lib-amd/index.js.map +0 -1
package/.swcrc
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/swcrc",
|
|
3
|
+
"exclude": [
|
|
4
|
+
"/testing",
|
|
5
|
+
"/**/*.cy.ts",
|
|
6
|
+
"/**/*.cy.tsx",
|
|
7
|
+
"/**/*.spec.ts",
|
|
8
|
+
"/**/*.spec.tsx",
|
|
9
|
+
"/**/*.test.ts",
|
|
10
|
+
"/**/*.test.tsx"
|
|
11
|
+
],
|
|
12
|
+
"jsc": {
|
|
13
|
+
"parser": {
|
|
14
|
+
"syntax": "typescript",
|
|
15
|
+
"tsx": true,
|
|
16
|
+
"decorators": false,
|
|
17
|
+
"dynamicImport": false
|
|
18
|
+
},
|
|
19
|
+
"externalHelpers": true,
|
|
20
|
+
"transform": {
|
|
21
|
+
"react": {
|
|
22
|
+
"runtime": "classic",
|
|
23
|
+
"useSpread": true
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"target": "es2019"
|
|
27
|
+
},
|
|
28
|
+
"minify": false,
|
|
29
|
+
"sourceMaps": true
|
|
30
|
+
}
|
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,73 @@
|
|
|
2
2
|
"name": "@fluentui/react-link",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "Thu,
|
|
5
|
+
"date": "Thu, 23 Mar 2023 12:28:45 GMT",
|
|
6
|
+
"tag": "@fluentui/react-link_v9.0.32",
|
|
7
|
+
"version": "9.0.32",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"author": "beachball",
|
|
12
|
+
"package": "@fluentui/react-link",
|
|
13
|
+
"comment": "Bump @fluentui/react-tabster to v9.6.2",
|
|
14
|
+
"commit": "be0ca69899300abe3c8478c435e0f6837138479b"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"date": "Tue, 21 Mar 2023 21:23:38 GMT",
|
|
21
|
+
"tag": "@fluentui/react-link_v9.0.31",
|
|
22
|
+
"version": "9.0.31",
|
|
23
|
+
"comments": {
|
|
24
|
+
"patch": [
|
|
25
|
+
{
|
|
26
|
+
"author": "tristan.watanabe@gmail.com",
|
|
27
|
+
"package": "@fluentui/react-link",
|
|
28
|
+
"commit": "ead1c6d4c2ac3f3596b62b8cbc07b0a03041f11f",
|
|
29
|
+
"comment": "fix: add node field to package.json exports map."
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"author": "tristan.watanabe@gmail.com",
|
|
33
|
+
"package": "@fluentui/react-link",
|
|
34
|
+
"commit": "2fac1a139149bd13b76b1306207bc988dca9c72c",
|
|
35
|
+
"comment": "chore: migrate to swc transpilation approach."
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"author": "beachball",
|
|
39
|
+
"package": "@fluentui/react-link",
|
|
40
|
+
"comment": "Bump @fluentui/keyboard-keys to v9.0.2",
|
|
41
|
+
"commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"author": "beachball",
|
|
45
|
+
"package": "@fluentui/react-link",
|
|
46
|
+
"comment": "Bump @fluentui/react-tabster to v9.6.1",
|
|
47
|
+
"commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"author": "beachball",
|
|
51
|
+
"package": "@fluentui/react-link",
|
|
52
|
+
"comment": "Bump @fluentui/react-theme to v9.1.7",
|
|
53
|
+
"commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"author": "beachball",
|
|
57
|
+
"package": "@fluentui/react-link",
|
|
58
|
+
"comment": "Bump @fluentui/react-utilities to v9.7.2",
|
|
59
|
+
"commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"author": "beachball",
|
|
63
|
+
"package": "@fluentui/react-link",
|
|
64
|
+
"comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.20",
|
|
65
|
+
"commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"date": "Thu, 16 Mar 2023 14:36:59 GMT",
|
|
6
72
|
"tag": "@fluentui/react-link_v9.0.30",
|
|
7
73
|
"version": "9.0.30",
|
|
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 Thu,
|
|
3
|
+
This log was last generated on Thu, 23 Mar 2023 12:28:45 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [9.0.32](https://github.com/microsoft/fluentui/tree/@fluentui/react-link_v9.0.32)
|
|
8
|
+
|
|
9
|
+
Thu, 23 Mar 2023 12:28:45 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-link_v9.0.31..@fluentui/react-link_v9.0.32)
|
|
11
|
+
|
|
12
|
+
### Patches
|
|
13
|
+
|
|
14
|
+
- Bump @fluentui/react-tabster to v9.6.2 ([PR #27286](https://github.com/microsoft/fluentui/pull/27286) by beachball)
|
|
15
|
+
|
|
16
|
+
## [9.0.31](https://github.com/microsoft/fluentui/tree/@fluentui/react-link_v9.0.31)
|
|
17
|
+
|
|
18
|
+
Tue, 21 Mar 2023 21:23:38 GMT
|
|
19
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-link_v9.0.30..@fluentui/react-link_v9.0.31)
|
|
20
|
+
|
|
21
|
+
### Patches
|
|
22
|
+
|
|
23
|
+
- fix: add node field to package.json exports map. ([PR #27154](https://github.com/microsoft/fluentui/pull/27154) by tristan.watanabe@gmail.com)
|
|
24
|
+
- chore: migrate to swc transpilation approach. ([PR #27250](https://github.com/microsoft/fluentui/pull/27250) by tristan.watanabe@gmail.com)
|
|
25
|
+
- Bump @fluentui/keyboard-keys to v9.0.2 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
|
|
26
|
+
- Bump @fluentui/react-tabster to v9.6.1 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
|
|
27
|
+
- Bump @fluentui/react-theme to v9.1.7 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
|
|
28
|
+
- Bump @fluentui/react-utilities to v9.7.2 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
|
|
29
|
+
- Bump @fluentui/react-conformance-griffel to v9.0.0-beta.20 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
|
|
30
|
+
|
|
7
31
|
## [9.0.30](https://github.com/microsoft/fluentui/tree/@fluentui/react-link_v9.0.30)
|
|
8
32
|
|
|
9
|
-
Thu, 16 Mar 2023 14:
|
|
33
|
+
Thu, 16 Mar 2023 14:36:59 GMT
|
|
10
34
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-link_v9.0.29..@fluentui/react-link_v9.0.30)
|
|
11
35
|
|
|
12
36
|
### Patches
|
package/lib/Link.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":[],"sources":["../src/Link.ts"],"sourcesContent":["export * from './components/Link/index';\n"],"mappings":"AAAA,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useLink_unstable","useLinkStyles_unstable","renderLink_unstable","Link","forwardRef","props","ref","state","displayName"],"sources":["
|
|
1
|
+
{"version":3,"names":["React","useLink_unstable","useLinkStyles_unstable","renderLink_unstable","Link","forwardRef","props","ref","state","displayName"],"sources":["../../../src/components/Link/Link.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useLink_unstable } from './useLink';\nimport { useLinkStyles_unstable } from './useLinkStyles';\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"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,gBAAgB,QAAQ;AACjC,SAASC,sBAAsB,QAAQ;AACvC,SAASC,mBAAmB,QAAQ;AAIpC;;;AAGA,OAAO,MAAMC,IAAA,gBAAuCJ,KAAA,CAAMK,UAAU,CAAC,CAACC,KAAA,EAAOC,GAAA,KAAQ;EACnF,MAAMC,KAAA,GAAQP,gBAAA,CAAiBK,KAAA,EAAOC,GAAA;EAEtCL,sBAAA,CAAuBM,KAAA;EAEvB,OAAOL,mBAAA,CAAoBK,KAAA;EAC3B;AACF;;AAEAJ,IAAA,CAAKK,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/components/Link/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"],"mappings":"AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/components/Link/index.ts"],"sourcesContent":["export * from './Link';\nexport * from './Link.types';\nexport * from './renderLink';\nexport * from './useLink';\nexport * from './useLinkState';\nexport * from './useLinkStyles';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc"}
|
|
@@ -8,8 +8,6 @@ export const renderLink_unstable = state => {
|
|
|
8
8
|
slots,
|
|
9
9
|
slotProps
|
|
10
10
|
} = getSlots(state);
|
|
11
|
-
return /*#__PURE__*/React.createElement(slots.root,
|
|
12
|
-
...slotProps.root
|
|
13
|
-
});
|
|
11
|
+
return /*#__PURE__*/React.createElement(slots.root, slotProps.root);
|
|
14
12
|
};
|
|
15
13
|
//# sourceMappingURL=renderLink.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","getSlots","renderLink_unstable","state","slots","slotProps","createElement","root"],"sources":["
|
|
1
|
+
{"version":3,"names":["React","getSlots","renderLink_unstable","state","slots","slotProps","createElement","root"],"sources":["../../../src/components/Link/renderLink.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } 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 } = getSlots<LinkSlots>(state);\n\n return <slots.root {...slotProps.root} />;\n};\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,QAAQ,QAAQ;AAGzB;;;AAGA,OAAO,MAAMC,mBAAA,GAAuBC,KAAA,IAAqB;EACvD,MAAM;IAAEC,KAAA;IAAOC;EAAS,CAAE,GAAGJ,QAAA,CAAoBE,KAAA;EAEjD,oBAAOH,KAAA,CAAAM,aAAA,CAACF,KAAA,CAAMG,IAAI,EAAKF,SAAA,CAAUE,IAAI;AACvC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getNativeElementProps","useLinkState_unstable","useLink_unstable","props","ref","appearance","disabled","disabledFocusable","inline","as","href","type","undefined","state","components","root"],"sources":["
|
|
1
|
+
{"version":3,"names":["React","getNativeElementProps","useLinkState_unstable","useLink_unstable","props","ref","appearance","disabled","disabledFocusable","inline","as","href","type","undefined","state","components","root"],"sources":["../../../src/components/Link/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"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,qBAAqB,QAAQ;AACtC,SAASC,qBAAqB,QAAQ;AAGtC;;;;;AAKA,OAAO,MAAMC,gBAAA,GAAmBA,CAC9BC,KAAA,EACAC,GAAA,KACc;EACd,MAAM;IAAEC,UAAA,GAAa;IAAWC,QAAA,GAAW,KAAK;IAAEC,iBAAA,GAAoB,KAAK;IAAEC,MAAA,GAAS;EAAK,CAAE,GAAGL,KAAA;EAChG,MAAMM,EAAA,GAAKN,KAAA,CAAMM,EAAE,KAAKN,KAAA,CAAMO,IAAI,GAAG,MAAM,QAAQ,CAAD;EAClD,MAAMC,IAAA,GAAOF,EAAA,KAAO,WAAW,WAAWG,SAAS;EAEnD,MAAMC,KAAA,GAAmB;IACvB;IACAR,UAAA;IACAC,QAAA;IACAC,iBAAA;IACAC,MAAA;IAEA;IACAM,UAAA,EAAY;MACVC,IAAA,EAAM;IACR;IAEAA,IAAA,EAAMf,qBAAA,CAAsBS,EAAA,EAAI;MAC9BL,GAAA;MACAO,IAAA;MACA,GAAGR,KAAK;MACRM;IACF;EACF;EAEAR,qBAAA,CAAsBY,KAAA;EAEtB,OAAOA,KAAA;AACT"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
import { Enter, Space } from '@fluentui/keyboard-keys';
|
|
2
3
|
/**
|
|
3
4
|
* The useLinkState_unstable hook processes the Link state.
|
|
@@ -23,9 +24,7 @@ export const useLinkState_unstable = state => {
|
|
|
23
24
|
if (disabled || disabledFocusable) {
|
|
24
25
|
state.root.role = role || 'link';
|
|
25
26
|
}
|
|
26
|
-
}
|
|
27
|
-
// Add type="button" for button elements.
|
|
28
|
-
else {
|
|
27
|
+
} else {
|
|
29
28
|
state.root.type = type || 'button';
|
|
30
29
|
}
|
|
31
30
|
// Disallow click event when component is disabled and eat events when disabledFocusable is set to true.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Enter","Space","useLinkState_unstable","state","disabled","disabledFocusable","onClick","onKeyDown","role","tabIndex","type","root","as","href","undefined","ev","preventDefault","key","stopPropagation"],"sources":["
|
|
1
|
+
{"version":3,"names":["React","Enter","Space","useLinkState_unstable","state","disabled","disabledFocusable","onClick","onKeyDown","role","tabIndex","type","root","as","href","undefined","ev","preventDefault","key","stopPropagation"],"sources":["../../../src/components/Link/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"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,KAAK,EAAEC,KAAK,QAAQ;AAG7B;;;;AAIA,OAAO,MAAMC,qBAAA,GAAyBC,KAAA,IAAgC;EACpE,MAAM;IAAEC,QAAA;IAAUC;EAAiB,CAAE,GAAGF,KAAA;EACxC,MAAM;IAAEG,OAAA;IAASC,SAAA;IAAWC,IAAA;IAAMC,QAAA;IAAUC;EAAI,CAAE,GAAGP,KAAA,CAAMQ,IAAI;EAE/D;EACA,IAAIR,KAAA,CAAMQ,IAAI,CAACC,EAAE,KAAK,KAAK;IACzBT,KAAA,CAAMQ,IAAI,CAACE,IAAI,GAAGT,QAAA,GAAWU,SAAA,GAAYX,KAAA,CAAMQ,IAAI,CAACE,IAAI;IACxDV,KAAA,CAAMQ,IAAI,CAACF,QAAQ,GAAGA,QAAA,aAAAA,QAAA,cAAAA,QAAA,GAAaL,QAAA,IAAY,CAACC,iBAAA,GAAoBS,SAAA,GAAY,CAAC;IAEjF;IACA,IAAIV,QAAA,IAAYC,iBAAA,EAAmB;MACjCF,KAAA,CAAMQ,IAAI,CAACH,IAAI,GAAGA,IAAA,IAAQ;IAC5B;EACF,OAEK;IACHL,KAAA,CAAMQ,IAAI,CAACD,IAAI,GAAGA,IAAA,IAAQ;EAC5B;EAEA;EACAP,KAAA,CAAMQ,IAAI,CAACL,OAAO,GAAIS,EAAA,IAAgE;IACpF,IAAIX,QAAA,IAAYC,iBAAA,EAAmB;MACjCU,EAAA,CAAGC,cAAc;IACnB,OAAO;MACLV,OAAA,aAAAA,OAAA,uBAAAA,OAAA,CAAUS,EAAA;IACZ;EACF;EAEA;EACAZ,KAAA,CAAMQ,IAAI,CAACJ,SAAS,GAAIQ,EAAA,IAAmE;IACzF,IAAI,CAACX,QAAA,IAAYC,iBAAgB,MAAOU,EAAA,CAAGE,GAAG,KAAKjB,KAAA,IAASe,EAAA,CAAGE,GAAG,KAAKhB,KAAI,GAAI;MAC7Ec,EAAA,CAAGC,cAAc;MACjBD,EAAA,CAAGG,eAAe;IACpB,OAAO;MACLX,SAAA,aAAAA,SAAA,uBAAAA,SAAA,CAAYQ,EAAA;IACd;EACF;EAEA;EACAZ,KAAA,CAAMC,QAAQ,GAAGA,QAAA,IAAYC,iBAAA;EAC7BF,KAAA,CAAMQ,IAAI,CAAC,gBAAgB,GAAGP,QAAA,IAAYC,iBAAA,IAAqBS,SAAA;EAC/D,IAAIX,KAAA,CAAMQ,IAAI,CAACC,EAAE,KAAK,UAAU;IAC9BT,KAAA,CAAMQ,IAAI,CAACP,QAAQ,GAAGA,QAAA,IAAY,CAACC,iBAAA;EACrC;EAEA,OAAOF,KAAA;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["shorthands","__styles","mergeClasses","createCustomFocusIndicatorStyle","tokens","linkClassNames","root","useStyles","focusIndicator","Brovlpu","B486eqv","Bttzg6e","B3uz8dt","B6ihwck","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","f","i","d","h","a","useLinkStyles_unstable","state","styles","appearance","className","as"],"sources":["
|
|
1
|
+
{"version":3,"names":["shorthands","__styles","mergeClasses","createCustomFocusIndicatorStyle","tokens","linkClassNames","root","useStyles","focusIndicator","Brovlpu","B486eqv","Bttzg6e","B3uz8dt","B6ihwck","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","f","i","d","h","a","useLinkStyles_unstable","state","styles","appearance","className","as"],"sources":["../../../src/components/Link/useLinkStyles.ts"],"sourcesContent":["import { shorthands, makeStyles, mergeClasses } from '@griffel/react';\nimport { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\nimport { tokens } from '@fluentui/react-theme';\nimport type { LinkSlots, LinkState } from './Link.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const linkClassNames: SlotClassNames<LinkSlots> = {\n root: 'fui-Link',\n};\n\nconst useStyles = makeStyles({\n focusIndicator: createCustomFocusIndicatorStyle({\n textDecorationColor: tokens.colorStrokeFocus2,\n textDecorationLine: 'underline',\n textDecorationStyle: 'double',\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\n ':hover': {\n textDecorationLine: 'underline',\n color: tokens.colorBrandForegroundLinkHover,\n },\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\n ':hover': {\n textDecorationLine: 'underline',\n color: tokens.colorNeutralForeground2Hover,\n },\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\n ':hover': {\n textDecorationLine: 'none',\n color: tokens.colorNeutralForegroundDisabled,\n },\n\n ':active': {\n textDecorationLine: 'none',\n color: tokens.colorNeutralForegroundDisabled,\n },\n },\n});\n\nexport const useLinkStyles_unstable = (state: LinkState): LinkState => {\n const styles = useStyles();\n const { appearance, disabled, inline, root } = state;\n\n state.root.className = mergeClasses(\n linkClassNames.root,\n styles.root,\n styles.focusIndicator,\n root.as === 'a' && root.href && styles.href,\n root.as === 'button' && styles.button,\n appearance === 'subtle' && styles.subtle,\n inline && styles.inline,\n disabled && styles.disabled,\n state.root.className,\n );\n\n return state;\n};\n"],"mappings":"AAAA,SAASA,UAAU,EAAAC,QAAA,EAAcC,YAAY,QAAQ;AACrD,SAASC,+BAA+B,QAAQ;AAChD,SAASC,MAAM,QAAQ;AAIvB,OAAO,MAAMC,cAAA,GAA4C;EACvDC,IAAA,EAAM;AACR;AAEA,MAAMC,SAAA,gBAAYN,QAAA;EAAAO,cAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;EAAA;EAAAP,IAAA;IAAAQ,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;EAAAC,CAAA;EAAAC,CAAA;AAAA,EA6ElB;AAEA,OAAO,MAAMC,sBAAA,GAA0BC,KAAA,IAAgC;EACrE,MAAMC,MAAA,GAASlD,SAAA;EACf,MAAM;IAAEmD,UAAA;IAAYT,QAAA;IAAUD,MAAA;IAAQ1C;EAAI,CAAE,GAAGkD,KAAA;EAE/CA,KAAA,CAAMlD,IAAI,CAACqD,SAAS,GAAGzD,YAAA,CACrBG,cAAA,CAAeC,IAAI,EACnBmD,MAAA,CAAOnD,IAAI,EACXmD,MAAA,CAAOjD,cAAc,EACrBF,IAAA,CAAKsD,EAAE,KAAK,OAAOtD,IAAA,CAAKwC,IAAI,IAAIW,MAAA,CAAOX,IAAI,EAC3CxC,IAAA,CAAKsD,EAAE,KAAK,YAAYH,MAAA,CAAOhB,MAAM,EACrCiB,UAAA,KAAe,YAAYD,MAAA,CAAOV,MAAM,EACxCC,MAAA,IAAUS,MAAA,CAAOT,MAAM,EACvBC,QAAA,IAAYQ,MAAA,CAAOR,QAAQ,EAC3BO,KAAA,CAAMlD,IAAI,CAACqD,SAAS;EAGtB,OAAOH,KAAA;AACT"}
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Link","linkClassNames","renderLink_unstable","useLinkState_unstable","useLinkStyles_unstable","useLink_unstable"],"sources":["../src/
|
|
1
|
+
{"version":3,"names":["Link","linkClassNames","renderLink_unstable","useLinkState_unstable","useLinkStyles_unstable","useLink_unstable"],"sources":["../src/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"],"mappings":"AAAA,SACEA,IAAI,EACJC,cAAc,EACdC,mBAAmB,EACnBC,qBAAqB,EACrBC,sBAAsB,EACtBC,gBAAgB,QACX"}
|
package/lib-commonjs/Link.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
3
|
+
value: true
|
|
5
4
|
});
|
|
6
|
-
const
|
|
7
|
-
|
|
5
|
+
const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
|
|
6
|
+
_exportStar(require("./components/Link/index"), exports);
|
|
7
|
+
//# sourceMappingURL=Link.js.map
|
|
8
|
+
|
|
8
9
|
//# sourceMappingURL=Link.js.map
|
package/lib-commonjs/Link.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../lib/Link.js"],"sourcesContent":["export * from './components/Link/index';\n//# sourceMappingURL=Link.js.map"],"names":[],"mappings":";;;;;oBAAc;CACd,gCAAgC"}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "Link", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>Link
|
|
5
8
|
});
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
useLinkStyles_1.useLinkStyles_unstable(state);
|
|
17
|
-
return renderLink_1.renderLink_unstable(state);
|
|
18
|
-
// Work around some small mismatches in inferred types which don't matter in practice
|
|
9
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
|
10
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
11
|
+
const _useLink = require("./useLink");
|
|
12
|
+
const _useLinkStyles = require("./useLinkStyles");
|
|
13
|
+
const _renderLink = require("./renderLink");
|
|
14
|
+
const Link = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
15
|
+
const state = (0, _useLink.useLink_unstable)(props, ref);
|
|
16
|
+
(0, _useLinkStyles.useLinkStyles_unstable)(state);
|
|
17
|
+
return (0, _renderLink.renderLink_unstable)(state);
|
|
18
|
+
// Work around some small mismatches in inferred types which don't matter in practice
|
|
19
19
|
});
|
|
20
|
+
Link.displayName = 'Link'; //# sourceMappingURL=Link.js.map
|
|
20
21
|
|
|
21
|
-
exports.Link.displayName = 'Link';
|
|
22
22
|
//# sourceMappingURL=Link.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/Link/Link.js"],"sourcesContent":["import * as React from 'react';\nimport { useLink_unstable } from './useLink';\nimport { useLinkStyles_unstable } from './useLinkStyles';\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 */\nexport 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});\n\nLink.displayName = 'Link';\n//# sourceMappingURL=Link.js.map"],"names":["Link","React","forwardRef","props","ref","state","useLink_unstable","useLinkStyles_unstable","renderLink_unstable","displayName"],"mappings":";;;;+BAOaA;;aAAAA;;;6DAPU;yBACU;+BACM;4BACH;AAI7B,MAAMA,OAAO,WAAW,GAAEC,OAAMC,UAAU,CAAC,CAACC,OAAOC,MAAQ;IAChE,MAAMC,QAAQC,IAAAA,yBAAgB,EAACH,OAAOC;IACtCG,IAAAA,qCAAsB,EAACF;IACvB,OAAOG,IAAAA,+BAAmB,EAACH;AAC3B,qFAAqF;AACvF;AAEAL,KAAKS,WAAW,GAAG,QACnB,gCAAgC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/Link/Link.types.js"],"sourcesContent":["export {};\n//# sourceMappingURL=Link.types.js.map"],"names":[],"mappings":";;;;CACA,sCAAsC"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
3
|
+
value: true
|
|
5
4
|
});
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
|
|
6
|
+
_exportStar(require("./Link"), exports);
|
|
7
|
+
_exportStar(require("./Link.types"), exports);
|
|
8
|
+
_exportStar(require("./renderLink"), exports);
|
|
9
|
+
_exportStar(require("./useLink"), exports);
|
|
10
|
+
_exportStar(require("./useLinkState"), exports);
|
|
11
|
+
_exportStar(require("./useLinkStyles"), exports);
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
13
|
+
|
|
13
14
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/Link/index.js"],"sourcesContent":["export * from './Link';\nexport * from './Link.types';\nexport * from './renderLink';\nexport * from './useLink';\nexport * from './useLinkState';\nexport * from './useLinkStyles';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA;oBACA;oBACA;CACd,iCAAiC"}
|
|
@@ -1,22 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "renderLink_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>renderLink_unstable
|
|
5
8
|
});
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
slots,
|
|
15
|
-
slotProps
|
|
16
|
-
} = react_utilities_1.getSlots(state);
|
|
17
|
-
return React.createElement(slots.root, {
|
|
18
|
-
...slotProps.root
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
exports.renderLink_unstable = renderLink_unstable;
|
|
9
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
|
10
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
11
|
+
const _reactUtilities = require("@fluentui/react-utilities");
|
|
12
|
+
const renderLink_unstable = (state)=>{
|
|
13
|
+
const { slots , slotProps } = (0, _reactUtilities.getSlots)(state);
|
|
14
|
+
return /*#__PURE__*/ _react.createElement(slots.root, slotProps.root);
|
|
15
|
+
}; //# sourceMappingURL=renderLink.js.map
|
|
16
|
+
|
|
22
17
|
//# sourceMappingURL=renderLink.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/Link/renderLink.js"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\n/**\n * Renders a Link component by passing the state defined props to the appropriate slots.\n */\nexport const renderLink_unstable = state => {\n const {\n slots,\n slotProps\n } = getSlots(state);\n return /*#__PURE__*/React.createElement(slots.root, slotProps.root);\n};\n//# sourceMappingURL=renderLink.js.map"],"names":["renderLink_unstable","state","slots","slotProps","getSlots","React","createElement","root"],"mappings":";;;;+BAKaA;;aAAAA;;;6DALU;gCACE;AAIlB,MAAMA,sBAAsBC,CAAAA,QAAS;IAC1C,MAAM,EACJC,MAAK,EACLC,UAAS,EACV,GAAGC,IAAAA,wBAAQ,EAACH;IACb,OAAO,WAAW,GAAEI,OAAMC,aAAa,CAACJ,MAAMK,IAAI,EAAEJ,UAAUI,IAAI;AACpE,GACA,sCAAsC"}
|
|
@@ -1,44 +1,38 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "useLink_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>useLink_unstable
|
|
5
8
|
});
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
type,
|
|
36
|
-
...props,
|
|
37
|
-
as
|
|
38
|
-
})
|
|
39
|
-
};
|
|
40
|
-
useLinkState_1.useLinkState_unstable(state);
|
|
41
|
-
return state;
|
|
42
|
-
};
|
|
43
|
-
exports.useLink_unstable = useLink_unstable;
|
|
9
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
|
10
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
11
|
+
const _reactUtilities = require("@fluentui/react-utilities");
|
|
12
|
+
const _useLinkState = require("./useLinkState");
|
|
13
|
+
const useLink_unstable = (props, ref)=>{
|
|
14
|
+
const { appearance ='default' , disabled =false , disabledFocusable =false , inline =false } = props;
|
|
15
|
+
const as = props.as || (props.href ? 'a' : 'button');
|
|
16
|
+
const type = as === 'button' ? 'button' : undefined;
|
|
17
|
+
const state = {
|
|
18
|
+
// Props passed at the top-level
|
|
19
|
+
appearance,
|
|
20
|
+
disabled,
|
|
21
|
+
disabledFocusable,
|
|
22
|
+
inline,
|
|
23
|
+
// Slots definition
|
|
24
|
+
components: {
|
|
25
|
+
root: 'a'
|
|
26
|
+
},
|
|
27
|
+
root: (0, _reactUtilities.getNativeElementProps)(as, {
|
|
28
|
+
ref,
|
|
29
|
+
type,
|
|
30
|
+
...props,
|
|
31
|
+
as
|
|
32
|
+
})
|
|
33
|
+
};
|
|
34
|
+
(0, _useLinkState.useLinkState_unstable)(state);
|
|
35
|
+
return state;
|
|
36
|
+
}; //# sourceMappingURL=useLink.js.map
|
|
37
|
+
|
|
44
38
|
//# sourceMappingURL=useLink.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/Link/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 */\nexport const useLink_unstable = (props, ref) => {\n const {\n appearance = 'default',\n disabled = false,\n disabledFocusable = false,\n inline = false\n } = 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//# sourceMappingURL=useLink.js.map"],"names":["useLink_unstable","props","ref","appearance","disabled","disabledFocusable","inline","as","href","type","undefined","state","components","root","getNativeElementProps","useLinkState_unstable"],"mappings":";;;;+BAQaA;;aAAAA;;;6DARU;gCACe;8BACA;AAM/B,MAAMA,mBAAmB,CAACC,OAAOC,MAAQ;IAC9C,MAAM,EACJC,YAAa,UAAS,EACtBC,UAAW,KAAK,CAAA,EAChBC,mBAAoB,KAAK,CAAA,EACzBC,QAAS,KAAK,CAAA,EACf,GAAGL;IACJ,MAAMM,KAAKN,MAAMM,EAAE,IAAKN,CAAAA,MAAMO,IAAI,GAAG,MAAM,QAAQ,AAAD;IAClD,MAAMC,OAAOF,OAAO,WAAW,WAAWG,SAAS;IACnD,MAAMC,QAAQ;QACZ,gCAAgC;QAChCR;QACAC;QACAC;QACAC;QACA,mBAAmB;QACnBM,YAAY;YACVC,MAAM;QACR;QACAA,MAAMC,IAAAA,qCAAqB,EAACP,IAAI;YAC9BL;YACAO;YACA,GAAGR,KAAK;YACRM;QACF;IACF;IACAQ,IAAAA,mCAAqB,EAACJ;IACtB,OAAOA;AACT,GACA,mCAAmC"}
|