@fluentui/react-link 9.0.11 → 9.0.12
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 +30 -1
- package/CHANGELOG.md +12 -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.map +1 -1
- package/lib/components/Link/useLink.js.map +1 -1
- 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-amd/Link.js +6 -0
- package/lib-amd/Link.js.map +1 -0
- package/lib-amd/components/Link/Link.js +16 -0
- package/lib-amd/components/Link/Link.js.map +1 -0
- package/lib-amd/components/Link/Link.types.js +5 -0
- package/lib-amd/components/Link/Link.types.js.map +1 -0
- package/lib-amd/components/Link/index.js +11 -0
- package/lib-amd/components/Link/index.js.map +1 -0
- package/lib-amd/components/Link/renderLink.js +14 -0
- package/lib-amd/components/Link/renderLink.js.map +1 -0
- package/lib-amd/components/Link/useLink.js +31 -0
- package/lib-amd/components/Link/useLink.js.map +1 -0
- package/lib-amd/components/Link/useLinkState.js +54 -0
- package/lib-amd/components/Link/useLinkState.js.map +1 -0
- package/lib-amd/components/Link/useLinkStyles.js +67 -0
- package/lib-amd/components/Link/useLinkStyles.js.map +1 -0
- package/lib-amd/index.js +12 -0
- package/lib-amd/index.js.map +1 -0
- package/lib-commonjs/Link.js.map +1 -1
- package/lib-commonjs/components/Link/Link.js.map +1 -1
- package/lib-commonjs/components/Link/index.js.map +1 -1
- package/lib-commonjs/components/Link/renderLink.js.map +1 -1
- package/lib-commonjs/components/Link/useLink.js.map +1 -1
- package/lib-commonjs/components/Link/useLinkState.js.map +1 -1
- package/lib-commonjs/components/Link/useLinkStyles.js.map +1 -1
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +5 -6
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,36 @@
|
|
|
2
2
|
"name": "@fluentui/react-link",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Thu, 17 Nov 2022 23:02:38 GMT",
|
|
6
|
+
"tag": "@fluentui/react-link_v9.0.12",
|
|
7
|
+
"version": "9.0.12",
|
|
8
|
+
"comments": {
|
|
9
|
+
"none": [
|
|
10
|
+
{
|
|
11
|
+
"author": "martinhochel@microsoft.com",
|
|
12
|
+
"package": "@fluentui/react-link",
|
|
13
|
+
"commit": "ea768501802d65d63ddc63fff3816fb6b5008ae4",
|
|
14
|
+
"comment": "chore: update package scaffold"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"patch": [
|
|
18
|
+
{
|
|
19
|
+
"author": "beachball",
|
|
20
|
+
"package": "@fluentui/react-link",
|
|
21
|
+
"comment": "Bump @fluentui/react-tabster to v9.3.1",
|
|
22
|
+
"commit": "94e156be5d3b5790d82dccf08c32672733fb9335"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"author": "beachball",
|
|
26
|
+
"package": "@fluentui/react-link",
|
|
27
|
+
"comment": "Bump @fluentui/react-utilities to v9.2.2",
|
|
28
|
+
"commit": "94e156be5d3b5790d82dccf08c32672733fb9335"
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"date": "Fri, 11 Nov 2022 14:58:07 GMT",
|
|
6
35
|
"tag": "@fluentui/react-link_v9.0.11",
|
|
7
36
|
"version": "9.0.11",
|
|
8
37
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-link
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Thu, 17 Nov 2022 23:02:38 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [9.0.12](https://github.com/microsoft/fluentui/tree/@fluentui/react-link_v9.0.12)
|
|
8
|
+
|
|
9
|
+
Thu, 17 Nov 2022 23:02:38 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-link_v9.0.11..@fluentui/react-link_v9.0.12)
|
|
11
|
+
|
|
12
|
+
### Patches
|
|
13
|
+
|
|
14
|
+
- Bump @fluentui/react-tabster to v9.3.1 ([PR #25683](https://github.com/microsoft/fluentui/pull/25683) by beachball)
|
|
15
|
+
- Bump @fluentui/react-utilities to v9.2.2 ([PR #25683](https://github.com/microsoft/fluentui/pull/25683) by beachball)
|
|
16
|
+
|
|
7
17
|
## [9.0.11](https://github.com/microsoft/fluentui/tree/@fluentui/react-link_v9.0.11)
|
|
8
18
|
|
|
9
|
-
Fri, 11 Nov 2022 14:
|
|
19
|
+
Fri, 11 Nov 2022 14:58:07 GMT
|
|
10
20
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-link_v9.0.10..@fluentui/react-link_v9.0.11)
|
|
11
21
|
|
|
12
22
|
### Patches
|
package/lib/Link.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Link.js","sourceRoot":"../src/","sources":["Link.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC","sourcesContent":["export * from './components/Link/index';\n"]}
|
|
1
|
+
{"version":3,"file":"Link.js","sourceRoot":"../src/","sources":["packages/react-components/react-link/src/Link.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC","sourcesContent":["export * from './components/Link/index';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["components/Link/Link.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,gBAAT,QAAiC,WAAjC;AACA,SAAS,sBAAT,QAAuC,iBAAvC;AACA,SAAS,mBAAT,QAAoC,cAApC;AAIA;;AAEG;;AACH,OAAO,MAAM,IAAI,gBAAmC,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;EAClF,MAAM,KAAK,GAAG,gBAAgB,CAAC,KAAD,EAAQ,GAAR,CAA9B;EAEA,sBAAsB,CAAC,KAAD,CAAtB;EAEA,OAAO,mBAAmB,CAAC,KAAD,CAA1B,CALkF,CAMlF;AACD,CAPmD,CAA7C;AASP,IAAI,CAAC,WAAL,GAAmB,MAAnB","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"],"sourceRoot":"../src/"}
|
|
1
|
+
{"version":3,"sources":["packages/react-components/react-link/src/components/Link/Link.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,gBAAT,QAAiC,WAAjC;AACA,SAAS,sBAAT,QAAuC,iBAAvC;AACA,SAAS,mBAAT,QAAoC,cAApC;AAIA;;AAEG;;AACH,OAAO,MAAM,IAAI,gBAAmC,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;EAClF,MAAM,KAAK,GAAG,gBAAgB,CAAC,KAAD,EAAQ,GAAR,CAA9B;EAEA,sBAAsB,CAAC,KAAD,CAAtB;EAEA,OAAO,mBAAmB,CAAC,KAAD,CAA1B,CALkF,CAMlF;AACD,CAPmD,CAA7C;AASP,IAAI,CAAC,WAAL,GAAmB,MAAnB","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"],"sourceRoot":"../src/"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Link.types.js","sourceRoot":"../src/","sources":["components/Link/Link.types.ts"],"names":[],"mappings":"","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"]}
|
|
1
|
+
{"version":3,"file":"Link.types.js","sourceRoot":"../src/","sources":["packages/react-components/react-link/src/components/Link/Link.types.ts"],"names":[],"mappings":"","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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/Link/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC","sourcesContent":["export * from './Link';\nexport * from './Link.types';\nexport * from './renderLink';\nexport * from './useLink';\nexport * from './useLinkState';\nexport * from './useLinkStyles';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["packages/react-components/react-link/src/components/Link/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC","sourcesContent":["export * from './Link';\nexport * from './Link.types';\nexport * from './renderLink';\nexport * from './useLink';\nexport * from './useLinkState';\nexport * from './useLinkStyles';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["components/Link/renderLink.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAGA;;AAEG;;AACH,OAAO,MAAM,mBAAmB,GAAI,KAAD,IAAqB;EACtD,MAAM;IAAE,KAAF;IAAS;EAAT,IAAuB,QAAQ,CAAY,KAAZ,CAArC;EAEA,oBAAO,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;EAAf,CAAX,CAAP;AACD,CAJM","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"],"sourceRoot":"../src/"}
|
|
1
|
+
{"version":3,"sources":["packages/react-components/react-link/src/components/Link/renderLink.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAGA;;AAEG;;AACH,OAAO,MAAM,mBAAmB,GAAI,KAAD,IAAqB;EACtD,MAAM;IAAE,KAAF;IAAS;EAAT,IAAuB,QAAQ,CAAY,KAAZ,CAArC;EAEA,oBAAO,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;EAAf,CAAX,CAAP;AACD,CAJM","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"],"sourceRoot":"../src/"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["components/Link/useLink.ts"],"names":[],"mappings":"AACA,SAAS,qBAAT,QAAsC,2BAAtC;AACA,SAAS,qBAAT,QAAsC,gBAAtC;AAGA;;;;AAIG;;AACH,OAAO,MAAM,gBAAgB,GAAG,CAC9B,KAD8B,EAE9B,GAF8B,KAGjB;EACb,MAAM;IAAE,UAAU,GAAG,SAAf;IAA0B,QAAQ,GAAG,KAArC;IAA4C,iBAAiB,GAAG,KAAhE;IAAuE,MAAM,GAAG;EAAhF,IAA0F,KAAhG;EACA,MAAM,EAAE,GAAG,KAAK,CAAC,EAAN,KAAa,KAAK,CAAC,IAAN,GAAa,GAAb,GAAmB,QAAhC,CAAX;EACA,MAAM,IAAI,GAAG,EAAE,KAAK,QAAP,GAAkB,QAAlB,GAA6B,SAA1C;EAEA,MAAM,KAAK,GAAc;IACvB;IACA,UAFuB;IAGvB,QAHuB;IAIvB,iBAJuB;IAKvB,MALuB;IAOvB;IACA,UAAU,EAAE;MACV,IAAI,EAAE;IADI,CARW;IAYvB,IAAI,EAAE,qBAAqB,CAAC,EAAD,EAAK;MAC9B,GAD8B;MAE9B,IAF8B;MAG9B,GAAG,KAH2B;MAI9B;IAJ8B,CAAL;EAZJ,CAAzB;EAoBA,qBAAqB,CAAC,KAAD,CAArB;EAEA,OAAO,KAAP;AACD,CA/BM","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"],"sourceRoot":"../src/"}
|
|
1
|
+
{"version":3,"sources":["packages/react-components/react-link/src/components/Link/useLink.ts"],"names":[],"mappings":"AACA,SAAS,qBAAT,QAAsC,2BAAtC;AACA,SAAS,qBAAT,QAAsC,gBAAtC;AAGA;;;;AAIG;;AACH,OAAO,MAAM,gBAAgB,GAAG,CAC9B,KAD8B,EAE9B,GAF8B,KAGjB;EACb,MAAM;IAAE,UAAU,GAAG,SAAf;IAA0B,QAAQ,GAAG,KAArC;IAA4C,iBAAiB,GAAG,KAAhE;IAAuE,MAAM,GAAG;EAAhF,IAA0F,KAAhG;EACA,MAAM,EAAE,GAAG,KAAK,CAAC,EAAN,KAAa,KAAK,CAAC,IAAN,GAAa,GAAb,GAAmB,QAAhC,CAAX;EACA,MAAM,IAAI,GAAG,EAAE,KAAK,QAAP,GAAkB,QAAlB,GAA6B,SAA1C;EAEA,MAAM,KAAK,GAAc;IACvB;IACA,UAFuB;IAGvB,QAHuB;IAIvB,iBAJuB;IAKvB,MALuB;IAOvB;IACA,UAAU,EAAE;MACV,IAAI,EAAE;IADI,CARW;IAYvB,IAAI,EAAE,qBAAqB,CAAC,EAAD,EAAK;MAC9B,GAD8B;MAE9B,IAF8B;MAG9B,GAAG,KAH2B;MAI9B;IAJ8B,CAAL;EAZJ,CAAzB;EAoBA,qBAAqB,CAAC,KAAD,CAArB;EAEA,OAAO,KAAP;AACD,CA/BM","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"],"sourceRoot":"../src/"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["components/Link/useLinkState.ts"],"names":[],"mappings":"AACA,SAAS,KAAT,EAAgB,KAAhB,QAA6B,yBAA7B;AAGA;;;AAGG;;AACH,OAAO,MAAM,qBAAqB,GAAI,KAAD,IAAgC;EACnE,MAAM;IAAE,QAAF;IAAY;EAAZ,IAAkC,KAAxC;EACA,MAAM;IAAE,OAAF;IAAW,SAAX;IAAsB,IAAtB;IAA4B;EAA5B,IAAqC,KAAK,CAAC,IAAjD,CAFmE,CAInE;;EACA,IAAI,KAAK,CAAC,IAAN,CAAW,EAAX,KAAkB,GAAtB,EAA2B;IACzB,KAAK,CAAC,IAAN,CAAW,IAAX,GAAkB,QAAQ,GAAG,SAAH,GAAe,KAAK,CAAC,IAAN,CAAW,IAApD;IACA,KAAK,CAAC,IAAN,CAAW,QAAX,GAAsB,QAAQ,IAAI,CAAC,iBAAb,GAAiC,SAAjC,GAA6C,CAAnE,CAFyB,CAIzB;;IACA,IAAI,QAAQ,IAAI,iBAAhB,EAAmC;MACjC,KAAK,CAAC,IAAN,CAAW,IAAX,GAAkB,IAAI,IAAI,MAA1B;IACD;EACF,CARD,CASA;EATA,KAUK;IACH,KAAK,CAAC,IAAN,CAAW,IAAX,GAAkB,IAAI,IAAI,QAA1B;EACD,CAjBkE,CAmBnE;;;EACA,KAAK,CAAC,IAAN,CAAW,OAAX,GAAsB,EAAD,IAAgE;IACnF,IAAI,QAAQ,IAAI,iBAAhB,EAAmC;MACjC,EAAE,CAAC,cAAH;IACD,CAFD,MAEO;MACL,OAAO,KAAA,IAAP,IAAA,OAAO,KAAA,KAAA,CAAP,GAAO,KAAA,CAAP,GAAA,OAAO,CAAG,EAAH,CAAP;IACD;EACF,CAND,CApBmE,CA4BnE;;;EACA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAwB,EAAD,IAAmE;IACxF,IAAI,CAAC,QAAQ,IAAI,iBAAb,MAAoC,EAAE,CAAC,GAAH,KAAW,KAAX,IAAoB,EAAE,CAAC,GAAH,KAAW,KAAnE,CAAJ,EAA+E;MAC7E,EAAE,CAAC,cAAH;MACA,EAAE,CAAC,eAAH;IACD,CAHD,MAGO;MACL,SAAS,KAAA,IAAT,IAAA,SAAS,KAAA,KAAA,CAAT,GAAS,KAAA,CAAT,GAAA,SAAS,CAAG,EAAH,CAAT;IACD;EACF,CAPD,CA7BmE,CAsCnE;;;EACA,KAAK,CAAC,QAAN,GAAiB,QAAQ,IAAI,iBAA7B;EACA,KAAK,CAAC,IAAN,CAAW,eAAX,IAA8B,QAAQ,IAAI,iBAAZ,IAAiC,SAA/D;;EACA,IAAI,KAAK,CAAC,IAAN,CAAW,EAAX,KAAkB,QAAtB,EAAgC;IAC9B,KAAK,CAAC,IAAN,CAAW,QAAX,GAAsB,QAAQ,IAAI,CAAC,iBAAnC;EACD;;EAED,OAAO,KAAP;AACD,CA9CM","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, 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 = 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"],"sourceRoot":"../src/"}
|
|
1
|
+
{"version":3,"sources":["packages/react-components/react-link/src/components/Link/useLinkState.ts"],"names":[],"mappings":"AACA,SAAS,KAAT,EAAgB,KAAhB,QAA6B,yBAA7B;AAGA;;;AAGG;;AACH,OAAO,MAAM,qBAAqB,GAAI,KAAD,IAAgC;EACnE,MAAM;IAAE,QAAF;IAAY;EAAZ,IAAkC,KAAxC;EACA,MAAM;IAAE,OAAF;IAAW,SAAX;IAAsB,IAAtB;IAA4B;EAA5B,IAAqC,KAAK,CAAC,IAAjD,CAFmE,CAInE;;EACA,IAAI,KAAK,CAAC,IAAN,CAAW,EAAX,KAAkB,GAAtB,EAA2B;IACzB,KAAK,CAAC,IAAN,CAAW,IAAX,GAAkB,QAAQ,GAAG,SAAH,GAAe,KAAK,CAAC,IAAN,CAAW,IAApD;IACA,KAAK,CAAC,IAAN,CAAW,QAAX,GAAsB,QAAQ,IAAI,CAAC,iBAAb,GAAiC,SAAjC,GAA6C,CAAnE,CAFyB,CAIzB;;IACA,IAAI,QAAQ,IAAI,iBAAhB,EAAmC;MACjC,KAAK,CAAC,IAAN,CAAW,IAAX,GAAkB,IAAI,IAAI,MAA1B;IACD;EACF,CARD,CASA;EATA,KAUK;IACH,KAAK,CAAC,IAAN,CAAW,IAAX,GAAkB,IAAI,IAAI,QAA1B;EACD,CAjBkE,CAmBnE;;;EACA,KAAK,CAAC,IAAN,CAAW,OAAX,GAAsB,EAAD,IAAgE;IACnF,IAAI,QAAQ,IAAI,iBAAhB,EAAmC;MACjC,EAAE,CAAC,cAAH;IACD,CAFD,MAEO;MACL,OAAO,KAAA,IAAP,IAAA,OAAO,KAAA,KAAA,CAAP,GAAO,KAAA,CAAP,GAAA,OAAO,CAAG,EAAH,CAAP;IACD;EACF,CAND,CApBmE,CA4BnE;;;EACA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAwB,EAAD,IAAmE;IACxF,IAAI,CAAC,QAAQ,IAAI,iBAAb,MAAoC,EAAE,CAAC,GAAH,KAAW,KAAX,IAAoB,EAAE,CAAC,GAAH,KAAW,KAAnE,CAAJ,EAA+E;MAC7E,EAAE,CAAC,cAAH;MACA,EAAE,CAAC,eAAH;IACD,CAHD,MAGO;MACL,SAAS,KAAA,IAAT,IAAA,SAAS,KAAA,KAAA,CAAT,GAAS,KAAA,CAAT,GAAA,SAAS,CAAG,EAAH,CAAT;IACD;EACF,CAPD,CA7BmE,CAsCnE;;;EACA,KAAK,CAAC,QAAN,GAAiB,QAAQ,IAAI,iBAA7B;EACA,KAAK,CAAC,IAAN,CAAW,eAAX,IAA8B,QAAQ,IAAI,iBAAZ,IAAiC,SAA/D;;EACA,IAAI,KAAK,CAAC,IAAN,CAAW,EAAX,KAAkB,QAAtB,EAAgC;IAC9B,KAAK,CAAC,IAAN,CAAW,QAAX,GAAsB,QAAQ,IAAI,CAAC,iBAAnC;EACD;;EAED,OAAO,KAAP;AACD,CA9CM","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, 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 = 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"],"sourceRoot":"../src/"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["components/Link/useLinkStyles.ts"],"names":[],"mappings":"AAAA,SAAS,UAAT,YAAiC,YAAjC,QAAqD,gBAArD;AACA,SAAS,+BAAT,QAAgD,yBAAhD;AACA,SAAS,MAAT,QAAuB,uBAAvB;AAIA,OAAO,MAAM,cAAc,GAA8B;EACvD,IAAI,EAAE;AADiD,CAAlD;;AAIP,MAAM,SAAS,gBAAG;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA,EAAlB;;AA+EA,OAAO,MAAM,sBAAsB,GAAI,KAAD,IAAgC;EACpE,MAAM,MAAM,GAAG,SAAS,EAAxB;EACA,MAAM;IAAE,UAAF;IAAc,QAAd;IAAwB,MAAxB;IAAgC;EAAhC,IAAyC,KAA/C;EAEA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CACjC,cAAc,CAAC,IADkB,EAEjC,MAAM,CAAC,IAF0B,EAGjC,MAAM,CAAC,cAH0B,EAIjC,IAAI,CAAC,EAAL,KAAY,GAAZ,IAAmB,IAAI,CAAC,IAAxB,IAAgC,MAAM,CAAC,IAJN,EAKjC,IAAI,CAAC,EAAL,KAAY,QAAZ,IAAwB,MAAM,CAAC,MALE,EAMjC,UAAU,KAAK,QAAf,IAA2B,MAAM,CAAC,MAND,EAOjC,MAAM,IAAI,MAAM,CAAC,MAPgB,EAQjC,QAAQ,IAAI,MAAM,CAAC,QARc,EASjC,KAAK,CAAC,IAAN,CAAW,SATsB,CAAnC;EAYA,OAAO,KAAP;AACD,CAjBM","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"],"sourceRoot":"../src/"}
|
|
1
|
+
{"version":3,"sources":["packages/react-components/react-link/src/components/Link/useLinkStyles.ts"],"names":[],"mappings":"AAAA,SAAS,UAAT,YAAiC,YAAjC,QAAqD,gBAArD;AACA,SAAS,+BAAT,QAAgD,yBAAhD;AACA,SAAS,MAAT,QAAuB,uBAAvB;AAIA,OAAO,MAAM,cAAc,GAA8B;EACvD,IAAI,EAAE;AADiD,CAAlD;;AAIP,MAAM,SAAS,gBAAG;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA,EAAlB;;AA+EA,OAAO,MAAM,sBAAsB,GAAI,KAAD,IAAgC;EACpE,MAAM,MAAM,GAAG,SAAS,EAAxB;EACA,MAAM;IAAE,UAAF;IAAc,QAAd;IAAwB,MAAxB;IAAgC;EAAhC,IAAyC,KAA/C;EAEA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CACjC,cAAc,CAAC,IADkB,EAEjC,MAAM,CAAC,IAF0B,EAGjC,MAAM,CAAC,cAH0B,EAIjC,IAAI,CAAC,EAAL,KAAY,GAAZ,IAAmB,IAAI,CAAC,IAAxB,IAAgC,MAAM,CAAC,IAJN,EAKjC,IAAI,CAAC,EAAL,KAAY,QAAZ,IAAwB,MAAM,CAAC,MALE,EAMjC,UAAU,KAAK,QAAf,IAA2B,MAAM,CAAC,MAND,EAOjC,MAAM,IAAI,MAAM,CAAC,MAPgB,EAQjC,QAAQ,IAAI,MAAM,CAAC,QARc,EASjC,KAAK,CAAC,IAAN,CAAW,SATsB,CAAnC;EAYA,OAAO,KAAP;AACD,CAjBM","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"],"sourceRoot":"../src/"}
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"names":[],"mappings":"AAAA,SACE,IADF,EAEE,cAFF,EAGE,mBAHF,EAIE,qBAJF,EAKE,sBALF,EAME,gBANF,QAOO,QAPP","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"],"sourceRoot":"../src/"}
|
|
1
|
+
{"version":3,"sources":["packages/react-components/react-link/src/index.ts"],"names":[],"mappings":"AAAA,SACE,IADF,EAEE,cAFF,EAGE,mBAHF,EAIE,qBAJF,EAKE,sBALF,EAME,gBANF,QAOO,QAPP","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"],"sourceRoot":"../src/"}
|
package/lib-amd/Link.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
define(["require", "exports", "tslib", "./components/Link/index"], function (require, exports, tslib_1, index_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
tslib_1.__exportStar(index_1, exports);
|
|
5
|
+
});
|
|
6
|
+
//# sourceMappingURL=Link.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Link.js","sourceRoot":"","sources":["../../../../../../../packages/react-components/react-link/src/Link.ts"],"names":[],"mappings":";;;IAAA,uCAAwC","sourcesContent":["export * from './components/Link/index';\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
define(["require", "exports", "react", "./useLink", "./useLinkStyles", "./renderLink"], function (require, exports, React, useLink_1, useLinkStyles_1, renderLink_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Link = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* A Link is a reference to data that a user can follow by clicking or tapping it.
|
|
7
|
+
*/
|
|
8
|
+
exports.Link = React.forwardRef(function (props, ref) {
|
|
9
|
+
var state = useLink_1.useLink_unstable(props, ref);
|
|
10
|
+
useLinkStyles_1.useLinkStyles_unstable(state);
|
|
11
|
+
return renderLink_1.renderLink_unstable(state);
|
|
12
|
+
// Work around some small mismatches in inferred types which don't matter in practice
|
|
13
|
+
});
|
|
14
|
+
exports.Link.displayName = 'Link';
|
|
15
|
+
});
|
|
16
|
+
//# sourceMappingURL=Link.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Link.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-link/src/components/Link/Link.tsx"],"names":[],"mappings":";;;;IAOA;;OAEG;IACU,QAAA,IAAI,GAAmC,KAAK,CAAC,UAAU,CAAC,UAAC,KAAK,EAAE,GAAG;QAC9E,IAAM,KAAK,GAAG,0BAAgB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAE3C,sCAAsB,CAAC,KAAK,CAAC,CAAC;QAE9B,OAAO,gCAAmB,CAAC,KAAK,CAAC,CAAC;QAClC,qFAAqF;IACvF,CAAC,CAAmC,CAAC;IAErC,YAAI,CAAC,WAAW,GAAG,MAAM,CAAC","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"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Link.types.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-link/src/components/Link/Link.types.ts"],"names":[],"mappings":"","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"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
define(["require", "exports", "tslib", "./Link", "./Link.types", "./renderLink", "./useLink", "./useLinkState", "./useLinkStyles"], function (require, exports, tslib_1, Link_1, Link_types_1, renderLink_1, useLink_1, useLinkState_1, useLinkStyles_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
tslib_1.__exportStar(Link_1, exports);
|
|
5
|
+
tslib_1.__exportStar(Link_types_1, exports);
|
|
6
|
+
tslib_1.__exportStar(renderLink_1, exports);
|
|
7
|
+
tslib_1.__exportStar(useLink_1, exports);
|
|
8
|
+
tslib_1.__exportStar(useLinkState_1, exports);
|
|
9
|
+
tslib_1.__exportStar(useLinkStyles_1, exports);
|
|
10
|
+
});
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-link/src/components/Link/index.ts"],"names":[],"mappings":";;;IAAA,sCAAuB;IACvB,4CAA6B;IAC7B,4CAA6B;IAC7B,yCAA0B;IAC1B,8CAA+B;IAC/B,+CAAgC","sourcesContent":["export * from './Link';\nexport * from './Link.types';\nexport * from './renderLink';\nexport * from './useLink';\nexport * from './useLinkState';\nexport * from './useLinkStyles';\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
define(["require", "exports", "tslib", "react", "@fluentui/react-utilities"], function (require, exports, tslib_1, React, react_utilities_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.renderLink_unstable = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* Renders a Link component by passing the state defined props to the appropriate slots.
|
|
7
|
+
*/
|
|
8
|
+
var renderLink_unstable = function (state) {
|
|
9
|
+
var _a = react_utilities_1.getSlots(state), slots = _a.slots, slotProps = _a.slotProps;
|
|
10
|
+
return React.createElement(slots.root, tslib_1.__assign({}, slotProps.root));
|
|
11
|
+
};
|
|
12
|
+
exports.renderLink_unstable = renderLink_unstable;
|
|
13
|
+
});
|
|
14
|
+
//# sourceMappingURL=renderLink.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderLink.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-link/src/components/Link/renderLink.tsx"],"names":[],"mappings":";;;;IAIA;;OAEG;IACI,IAAM,mBAAmB,GAAG,UAAC,KAAgB;QAC5C,IAAA,KAAuB,0BAAQ,CAAY,KAAK,CAAC,EAA/C,KAAK,WAAA,EAAE,SAAS,eAA+B,CAAC;QAExD,OAAO,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI,EAAI,CAAC;IAC5C,CAAC,CAAC;IAJW,QAAA,mBAAmB,uBAI9B","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"]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
define(["require", "exports", "tslib", "@fluentui/react-utilities", "./useLinkState"], function (require, exports, tslib_1, react_utilities_1, useLinkState_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.useLink_unstable = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* Given user props, defines default props for the Link, calls useLinkState_unstable, and returns processed state.
|
|
7
|
+
* @param props - User provided props to the Link component.
|
|
8
|
+
* @param ref - User provided ref to be passed to the Link component.
|
|
9
|
+
*/
|
|
10
|
+
var useLink_unstable = function (props, ref) {
|
|
11
|
+
var _a = props.appearance, appearance = _a === void 0 ? 'default' : _a, _b = props.disabled, disabled = _b === void 0 ? false : _b, _c = props.disabledFocusable, disabledFocusable = _c === void 0 ? false : _c, _d = props.inline, inline = _d === void 0 ? false : _d;
|
|
12
|
+
var as = props.as || (props.href ? 'a' : 'button');
|
|
13
|
+
var type = as === 'button' ? 'button' : undefined;
|
|
14
|
+
var state = {
|
|
15
|
+
// Props passed at the top-level
|
|
16
|
+
appearance: appearance,
|
|
17
|
+
disabled: disabled,
|
|
18
|
+
disabledFocusable: disabledFocusable,
|
|
19
|
+
inline: inline,
|
|
20
|
+
// Slots definition
|
|
21
|
+
components: {
|
|
22
|
+
root: 'a',
|
|
23
|
+
},
|
|
24
|
+
root: react_utilities_1.getNativeElementProps(as, tslib_1.__assign(tslib_1.__assign({ ref: ref, type: type }, props), { as: as })),
|
|
25
|
+
};
|
|
26
|
+
useLinkState_1.useLinkState_unstable(state);
|
|
27
|
+
return state;
|
|
28
|
+
};
|
|
29
|
+
exports.useLink_unstable = useLink_unstable;
|
|
30
|
+
});
|
|
31
|
+
//# sourceMappingURL=useLink.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLink.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-link/src/components/Link/useLink.ts"],"names":[],"mappings":";;;;IAKA;;;;OAIG;IACI,IAAM,gBAAgB,GAAG,UAC9B,KAAgB,EAChB,GAAqD;QAE7C,IAAA,KAAwF,KAAK,WAAvE,EAAtB,UAAU,mBAAG,SAAS,KAAA,EAAE,KAAgE,KAAK,SAArD,EAAhB,QAAQ,mBAAG,KAAK,KAAA,EAAE,KAA8C,KAAK,kBAA1B,EAAzB,iBAAiB,mBAAG,KAAK,KAAA,EAAE,KAAmB,KAAK,OAAV,EAAd,MAAM,mBAAG,KAAK,KAAA,CAAW;QACtG,IAAM,EAAE,GAAG,KAAK,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;QACrD,IAAM,IAAI,GAAG,EAAE,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;QAEpD,IAAM,KAAK,GAAc;YACvB,gCAAgC;YAChC,UAAU,YAAA;YACV,QAAQ,UAAA;YACR,iBAAiB,mBAAA;YACjB,MAAM,QAAA;YAEN,mBAAmB;YACnB,UAAU,EAAE;gBACV,IAAI,EAAE,GAAG;aACV;YAED,IAAI,EAAE,uCAAqB,CAAC,EAAE,sCAC5B,GAAG,KAAA,EACH,IAAI,MAAA,IACD,KAAK,KACR,EAAE,IAAA,IACF;SACH,CAAC;QAEF,oCAAqB,CAAC,KAAK,CAAC,CAAC;QAE7B,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IA/BW,QAAA,gBAAgB,oBA+B3B","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"]}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
define(["require", "exports", "@fluentui/keyboard-keys"], function (require, exports, keyboard_keys_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.useLinkState_unstable = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* The useLinkState_unstable hook processes the Link state.
|
|
7
|
+
* @param state - Link state to mutate.
|
|
8
|
+
*/
|
|
9
|
+
var useLinkState_unstable = function (state) {
|
|
10
|
+
var disabled = state.disabled, disabledFocusable = state.disabledFocusable;
|
|
11
|
+
var _a = state.root, onClick = _a.onClick, onKeyDown = _a.onKeyDown, role = _a.role, type = _a.type;
|
|
12
|
+
// Add href and tabIndex=0 for anchor elements.
|
|
13
|
+
if (state.root.as === 'a') {
|
|
14
|
+
state.root.href = disabled ? undefined : state.root.href;
|
|
15
|
+
state.root.tabIndex = disabled && !disabledFocusable ? undefined : 0;
|
|
16
|
+
// Add role="link" for disabled and disabledFocusable links.
|
|
17
|
+
if (disabled || disabledFocusable) {
|
|
18
|
+
state.root.role = role || 'link';
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
// Add type="button" for button elements.
|
|
22
|
+
else {
|
|
23
|
+
state.root.type = type || 'button';
|
|
24
|
+
}
|
|
25
|
+
// Disallow click event when component is disabled and eat events when disabledFocusable is set to true.
|
|
26
|
+
state.root.onClick = function (ev) {
|
|
27
|
+
if (disabled || disabledFocusable) {
|
|
28
|
+
ev.preventDefault();
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(ev);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
// Disallow keydown event when component is disabled and eat events when disabledFocusable is set to true.
|
|
35
|
+
state.root.onKeyDown = function (ev) {
|
|
36
|
+
if ((disabled || disabledFocusable) && (ev.key === keyboard_keys_1.Enter || ev.key === keyboard_keys_1.Space)) {
|
|
37
|
+
ev.preventDefault();
|
|
38
|
+
ev.stopPropagation();
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(ev);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
// Set the aria-disabled and disabled props correctly.
|
|
45
|
+
state.disabled = disabled || disabledFocusable;
|
|
46
|
+
state.root['aria-disabled'] = disabled || disabledFocusable || undefined;
|
|
47
|
+
if (state.root.as === 'button') {
|
|
48
|
+
state.root.disabled = disabled && !disabledFocusable;
|
|
49
|
+
}
|
|
50
|
+
return state;
|
|
51
|
+
};
|
|
52
|
+
exports.useLinkState_unstable = useLinkState_unstable;
|
|
53
|
+
});
|
|
54
|
+
//# sourceMappingURL=useLinkState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLinkState.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-link/src/components/Link/useLinkState.ts"],"names":[],"mappings":";;;;IAIA;;;OAGG;IACI,IAAM,qBAAqB,GAAG,UAAC,KAAgB;QAC5C,IAAA,QAAQ,GAAwB,KAAK,SAA7B,EAAE,iBAAiB,GAAK,KAAK,kBAAV,CAAW;QACxC,IAAA,KAAqC,KAAK,CAAC,IAAI,EAA7C,OAAO,aAAA,EAAE,SAAS,eAAA,EAAE,IAAI,UAAA,EAAE,IAAI,UAAe,CAAC;QAEtD,+CAA+C;QAC/C,IAAI,KAAK,CAAC,IAAI,CAAC,EAAE,KAAK,GAAG,EAAE;YACzB,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;YACzD,KAAK,CAAC,IAAI,CAAC,QAAQ,GAAG,QAAQ,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;YAErE,4DAA4D;YAC5D,IAAI,QAAQ,IAAI,iBAAiB,EAAE;gBACjC,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,MAAM,CAAC;aAClC;SACF;QACD,yCAAyC;aACpC;YACH,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,QAAQ,CAAC;SACpC;QAED,wGAAwG;QACxG,KAAK,CAAC,IAAI,CAAC,OAAO,GAAG,UAAC,EAA2D;YAC/E,IAAI,QAAQ,IAAI,iBAAiB,EAAE;gBACjC,EAAE,CAAC,cAAc,EAAE,CAAC;aACrB;iBAAM;gBACL,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAG,EAAE,CAAC,CAAC;aACf;QACH,CAAC,CAAC;QAEF,0GAA0G;QAC1G,KAAK,CAAC,IAAI,CAAC,SAAS,GAAG,UAAC,EAA8D;YACpF,IAAI,CAAC,QAAQ,IAAI,iBAAiB,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,KAAK,qBAAK,IAAI,EAAE,CAAC,GAAG,KAAK,qBAAK,CAAC,EAAE;gBAC7E,EAAE,CAAC,cAAc,EAAE,CAAC;gBACpB,EAAE,CAAC,eAAe,EAAE,CAAC;aACtB;iBAAM;gBACL,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAG,EAAE,CAAC,CAAC;aACjB;QACH,CAAC,CAAC;QAEF,sDAAsD;QACtD,KAAK,CAAC,QAAQ,GAAG,QAAQ,IAAI,iBAAiB,CAAC;QAC/C,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,GAAG,QAAQ,IAAI,iBAAiB,IAAI,SAAS,CAAC;QACzE,IAAI,KAAK,CAAC,IAAI,CAAC,EAAE,KAAK,QAAQ,EAAE;YAC9B,KAAK,CAAC,IAAI,CAAC,QAAQ,GAAG,QAAQ,IAAI,CAAC,iBAAiB,CAAC;SACtD;QAED,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IA9CW,QAAA,qBAAqB,yBA8ChC","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, 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 = 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"]}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
define(["require", "exports", "tslib", "@griffel/react", "@fluentui/react-tabster", "@fluentui/react-theme"], function (require, exports, tslib_1, react_1, react_tabster_1, react_theme_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.useLinkStyles_unstable = exports.linkClassNames = void 0;
|
|
5
|
+
exports.linkClassNames = {
|
|
6
|
+
root: 'fui-Link',
|
|
7
|
+
};
|
|
8
|
+
var useStyles = react_1.makeStyles({
|
|
9
|
+
focusIndicator: react_tabster_1.createCustomFocusIndicatorStyle({
|
|
10
|
+
textDecorationColor: react_theme_1.tokens.colorStrokeFocus2,
|
|
11
|
+
textDecorationLine: 'underline',
|
|
12
|
+
textDecorationStyle: 'double',
|
|
13
|
+
}),
|
|
14
|
+
// Common styles.
|
|
15
|
+
root: tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ backgroundColor: 'transparent', boxSizing: 'border-box', color: react_theme_1.tokens.colorBrandForegroundLink, cursor: 'pointer', display: 'inline', fontFamily: react_theme_1.tokens.fontFamilyBase, fontSize: react_theme_1.tokens.fontSizeBase300, fontWeight: react_theme_1.tokens.fontWeightRegular }, react_1.shorthands.margin(0)), react_1.shorthands.padding(0)), react_1.shorthands.overflow('inherit')), { textAlign: 'left', textDecorationLine: 'none', textDecorationThickness: react_theme_1.tokens.strokeWidthThin, textOverflow: 'inherit', userSelect: 'text', ':hover': {
|
|
16
|
+
textDecorationLine: 'underline',
|
|
17
|
+
color: react_theme_1.tokens.colorBrandForegroundLinkHover,
|
|
18
|
+
}, ':active': {
|
|
19
|
+
textDecorationLine: 'underline',
|
|
20
|
+
color: react_theme_1.tokens.colorBrandForegroundLinkPressed,
|
|
21
|
+
} }),
|
|
22
|
+
// Overrides when the Link renders as a button.
|
|
23
|
+
button: tslib_1.__assign({}, react_1.shorthands.borderStyle('none')),
|
|
24
|
+
// Overrides when an href is present so the Link renders as an anchor.
|
|
25
|
+
href: {
|
|
26
|
+
fontSize: 'inherit',
|
|
27
|
+
},
|
|
28
|
+
// Overrides when the Link appears subtle.
|
|
29
|
+
subtle: {
|
|
30
|
+
color: react_theme_1.tokens.colorNeutralForeground2,
|
|
31
|
+
':hover': {
|
|
32
|
+
textDecorationLine: 'underline',
|
|
33
|
+
color: react_theme_1.tokens.colorNeutralForeground2Hover,
|
|
34
|
+
},
|
|
35
|
+
':active': {
|
|
36
|
+
textDecorationLine: 'underline',
|
|
37
|
+
color: react_theme_1.tokens.colorNeutralForeground2Pressed,
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
// Overrides when the Link is rendered inline within text.
|
|
41
|
+
inline: {
|
|
42
|
+
textDecorationLine: 'underline',
|
|
43
|
+
},
|
|
44
|
+
// Overrides when the Link is disabled.
|
|
45
|
+
disabled: {
|
|
46
|
+
textDecorationLine: 'none',
|
|
47
|
+
color: react_theme_1.tokens.colorNeutralForegroundDisabled,
|
|
48
|
+
cursor: 'not-allowed',
|
|
49
|
+
':hover': {
|
|
50
|
+
textDecorationLine: 'none',
|
|
51
|
+
color: react_theme_1.tokens.colorNeutralForegroundDisabled,
|
|
52
|
+
},
|
|
53
|
+
':active': {
|
|
54
|
+
textDecorationLine: 'none',
|
|
55
|
+
color: react_theme_1.tokens.colorNeutralForegroundDisabled,
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
var useLinkStyles_unstable = function (state) {
|
|
60
|
+
var styles = useStyles();
|
|
61
|
+
var appearance = state.appearance, disabled = state.disabled, inline = state.inline, root = state.root;
|
|
62
|
+
state.root.className = react_1.mergeClasses(exports.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);
|
|
63
|
+
return state;
|
|
64
|
+
};
|
|
65
|
+
exports.useLinkStyles_unstable = useLinkStyles_unstable;
|
|
66
|
+
});
|
|
67
|
+
//# sourceMappingURL=useLinkStyles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLinkStyles.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-link/src/components/Link/useLinkStyles.ts"],"names":[],"mappings":";;;;IAMa,QAAA,cAAc,GAA8B;QACvD,IAAI,EAAE,UAAU;KACjB,CAAC;IAEF,IAAM,SAAS,GAAG,kBAAU,CAAC;QAC3B,cAAc,EAAE,+CAA+B,CAAC;YAC9C,mBAAmB,EAAE,oBAAM,CAAC,iBAAiB;YAC7C,kBAAkB,EAAE,WAAW;YAC/B,mBAAmB,EAAE,QAAQ;SAC9B,CAAC;QACF,iBAAiB;QACjB,IAAI,wEACF,eAAe,EAAE,aAAa,EAC9B,SAAS,EAAE,YAAY,EACvB,KAAK,EAAE,oBAAM,CAAC,wBAAwB,EACtC,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,QAAQ,EACjB,UAAU,EAAE,oBAAM,CAAC,cAAc,EACjC,QAAQ,EAAE,oBAAM,CAAC,eAAe,EAChC,UAAU,EAAE,oBAAM,CAAC,iBAAiB,IACjC,kBAAU,CAAC,MAAM,CAAC,CAAC,CAAC,GACpB,kBAAU,CAAC,OAAO,CAAC,CAAC,CAAC,GACrB,kBAAU,CAAC,QAAQ,CAAC,SAAS,CAAC,KACjC,SAAS,EAAE,MAAM,EACjB,kBAAkB,EAAE,MAAM,EAC1B,uBAAuB,EAAE,oBAAM,CAAC,eAAe,EAC/C,YAAY,EAAE,SAAS,EACvB,UAAU,EAAE,MAAM,EAElB,QAAQ,EAAE;gBACR,kBAAkB,EAAE,WAAW;gBAC/B,KAAK,EAAE,oBAAM,CAAC,6BAA6B;aAC5C,EAED,SAAS,EAAE;gBACT,kBAAkB,EAAE,WAAW;gBAC/B,KAAK,EAAE,oBAAM,CAAC,+BAA+B;aAC9C,GACF;QACD,+CAA+C;QAC/C,MAAM,uBACD,kBAAU,CAAC,WAAW,CAAC,MAAM,CAAC,CAClC;QACD,sEAAsE;QACtE,IAAI,EAAE;YACJ,QAAQ,EAAE,SAAS;SACpB;QACD,0CAA0C;QAC1C,MAAM,EAAE;YACN,KAAK,EAAE,oBAAM,CAAC,uBAAuB;YAErC,QAAQ,EAAE;gBACR,kBAAkB,EAAE,WAAW;gBAC/B,KAAK,EAAE,oBAAM,CAAC,4BAA4B;aAC3C;YAED,SAAS,EAAE;gBACT,kBAAkB,EAAE,WAAW;gBAC/B,KAAK,EAAE,oBAAM,CAAC,8BAA8B;aAC7C;SACF;QACD,0DAA0D;QAC1D,MAAM,EAAE;YACN,kBAAkB,EAAE,WAAW;SAChC;QACD,uCAAuC;QACvC,QAAQ,EAAE;YACR,kBAAkB,EAAE,MAAM;YAC1B,KAAK,EAAE,oBAAM,CAAC,8BAA8B;YAC5C,MAAM,EAAE,aAAa;YAErB,QAAQ,EAAE;gBACR,kBAAkB,EAAE,MAAM;gBAC1B,KAAK,EAAE,oBAAM,CAAC,8BAA8B;aAC7C;YAED,SAAS,EAAE;gBACT,kBAAkB,EAAE,MAAM;gBAC1B,KAAK,EAAE,oBAAM,CAAC,8BAA8B;aAC7C;SACF;KACF,CAAC,CAAC;IAEI,IAAM,sBAAsB,GAAG,UAAC,KAAgB;QACrD,IAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QACnB,IAAA,UAAU,GAA6B,KAAK,WAAlC,EAAE,QAAQ,GAAmB,KAAK,SAAxB,EAAE,MAAM,GAAW,KAAK,OAAhB,EAAE,IAAI,GAAK,KAAK,KAAV,CAAW;QAErD,KAAK,CAAC,IAAI,CAAC,SAAS,GAAG,oBAAY,CACjC,sBAAc,CAAC,IAAI,EACnB,MAAM,CAAC,IAAI,EACX,MAAM,CAAC,cAAc,EACrB,IAAI,CAAC,EAAE,KAAK,GAAG,IAAI,IAAI,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,EAC3C,IAAI,CAAC,EAAE,KAAK,QAAQ,IAAI,MAAM,CAAC,MAAM,EACrC,UAAU,KAAK,QAAQ,IAAI,MAAM,CAAC,MAAM,EACxC,MAAM,IAAI,MAAM,CAAC,MAAM,EACvB,QAAQ,IAAI,MAAM,CAAC,QAAQ,EAC3B,KAAK,CAAC,IAAI,CAAC,SAAS,CACrB,CAAC;QAEF,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IAjBW,QAAA,sBAAsB,0BAiBjC","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"]}
|
package/lib-amd/index.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
define(["require", "exports", "./Link"], function (require, exports, Link_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.useLink_unstable = exports.useLinkStyles_unstable = exports.useLinkState_unstable = exports.renderLink_unstable = exports.linkClassNames = exports.Link = void 0;
|
|
5
|
+
Object.defineProperty(exports, "Link", { enumerable: true, get: function () { return Link_1.Link; } });
|
|
6
|
+
Object.defineProperty(exports, "linkClassNames", { enumerable: true, get: function () { return Link_1.linkClassNames; } });
|
|
7
|
+
Object.defineProperty(exports, "renderLink_unstable", { enumerable: true, get: function () { return Link_1.renderLink_unstable; } });
|
|
8
|
+
Object.defineProperty(exports, "useLinkState_unstable", { enumerable: true, get: function () { return Link_1.useLinkState_unstable; } });
|
|
9
|
+
Object.defineProperty(exports, "useLinkStyles_unstable", { enumerable: true, get: function () { return Link_1.useLinkStyles_unstable; } });
|
|
10
|
+
Object.defineProperty(exports, "useLink_unstable", { enumerable: true, get: function () { return Link_1.useLink_unstable; } });
|
|
11
|
+
});
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/react-components/react-link/src/index.ts"],"names":[],"mappings":";;;;IACE,4FAAA,IAAI,OAAA;IACJ,sGAAA,cAAc,OAAA;IACd,2GAAA,mBAAmB,OAAA;IACnB,6GAAA,qBAAqB,OAAA;IACrB,8GAAA,sBAAsB,OAAA;IACtB,wGAAA,gBAAgB,OAAA","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"]}
|
package/lib-commonjs/Link.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Link.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,yBAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './components/Link/index';\n"],"sourceRoot":"../src/"}
|
|
1
|
+
{"version":3,"sources":["packages/react-components/react-link/src/Link.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,yBAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './components/Link/index';\n"],"sourceRoot":"../src/"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["components/Link/Link.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,SAAA,gBAAA,OAAA,CAAA,WAAA,CAAA;;AACA,MAAA,eAAA,gBAAA,OAAA,CAAA,iBAAA,CAAA;;AACA,MAAA,YAAA,gBAAA,OAAA,CAAA,cAAA,CAAA;AAIA;;AAEG;;;AACU,OAAA,CAAA,IAAA,gBAAuC,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;EAClF,MAAM,KAAK,GAAG,SAAA,CAAA,gBAAA,CAAiB,KAAjB,EAAwB,GAAxB,CAAd;EAEA,eAAA,CAAA,sBAAA,CAAuB,KAAvB;EAEA,OAAO,YAAA,CAAA,mBAAA,CAAoB,KAApB,CAAP,CALkF,CAMlF;AACD,CAPmD,CAAvC;AASb,OAAA,CAAA,IAAA,CAAK,WAAL,GAAmB,MAAnB","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"],"sourceRoot":"../src/"}
|
|
1
|
+
{"version":3,"sources":["packages/react-components/react-link/src/components/Link/Link.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,SAAA,gBAAA,OAAA,CAAA,WAAA,CAAA;;AACA,MAAA,eAAA,gBAAA,OAAA,CAAA,iBAAA,CAAA;;AACA,MAAA,YAAA,gBAAA,OAAA,CAAA,cAAA,CAAA;AAIA;;AAEG;;;AACU,OAAA,CAAA,IAAA,gBAAuC,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;EAClF,MAAM,KAAK,GAAG,SAAA,CAAA,gBAAA,CAAiB,KAAjB,EAAwB,GAAxB,CAAd;EAEA,eAAA,CAAA,sBAAA,CAAuB,KAAvB;EAEA,OAAO,YAAA,CAAA,mBAAA,CAAoB,KAApB,CAAP,CALkF,CAMlF;AACD,CAPmD,CAAvC;AASb,OAAA,CAAA,IAAA,CAAK,WAAL,GAAmB,MAAnB","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"],"sourceRoot":"../src/"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["components/Link/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,QAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,cAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,cAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,WAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,gBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,iBAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './Link';\nexport * from './Link.types';\nexport * from './renderLink';\nexport * from './useLink';\nexport * from './useLinkState';\nexport * from './useLinkStyles';\n"],"sourceRoot":"../src/"}
|
|
1
|
+
{"version":3,"sources":["packages/react-components/react-link/src/components/Link/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,QAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,cAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,cAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,WAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,gBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,iBAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './Link';\nexport * from './Link.types';\nexport * from './renderLink';\nexport * from './useLink';\nexport * from './useLinkState';\nexport * from './useLinkStyles';\n"],"sourceRoot":"../src/"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["components/Link/renderLink.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAGA;;AAEG;;;AACI,MAAM,mBAAmB,GAAI,KAAD,IAAqB;EACtD,MAAM;IAAE,KAAF;IAAS;EAAT,IAAuB,iBAAA,CAAA,QAAA,CAAoB,KAApB,CAA7B;EAEA,OAAO,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;EAAf,CAAX,CAAP;AACD,CAJM;;AAAM,OAAA,CAAA,mBAAA,GAAmB,mBAAnB","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"],"sourceRoot":"../src/"}
|
|
1
|
+
{"version":3,"sources":["packages/react-components/react-link/src/components/Link/renderLink.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAGA;;AAEG;;;AACI,MAAM,mBAAmB,GAAI,KAAD,IAAqB;EACtD,MAAM;IAAE,KAAF;IAAS;EAAT,IAAuB,iBAAA,CAAA,QAAA,CAAoB,KAApB,CAA7B;EAEA,OAAO,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;EAAf,CAAX,CAAP;AACD,CAJM;;AAAM,OAAA,CAAA,mBAAA,GAAmB,mBAAnB","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"],"sourceRoot":"../src/"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["components/Link/useLink.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,MAAA,cAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;AAGA;;;;AAIG;;;AACI,MAAM,gBAAgB,GAAG,CAC9B,KAD8B,EAE9B,GAF8B,KAGjB;EACb,MAAM;IAAE,UAAU,GAAG,SAAf;IAA0B,QAAQ,GAAG,KAArC;IAA4C,iBAAiB,GAAG,KAAhE;IAAuE,MAAM,GAAG;EAAhF,IAA0F,KAAhG;EACA,MAAM,EAAE,GAAG,KAAK,CAAC,EAAN,KAAa,KAAK,CAAC,IAAN,GAAa,GAAb,GAAmB,QAAhC,CAAX;EACA,MAAM,IAAI,GAAG,EAAE,KAAK,QAAP,GAAkB,QAAlB,GAA6B,SAA1C;EAEA,MAAM,KAAK,GAAc;IACvB;IACA,UAFuB;IAGvB,QAHuB;IAIvB,iBAJuB;IAKvB,MALuB;IAOvB;IACA,UAAU,EAAE;MACV,IAAI,EAAE;IADI,CARW;IAYvB,IAAI,EAAE,iBAAA,CAAA,qBAAA,CAAsB,EAAtB,EAA0B;MAC9B,GAD8B;MAE9B,IAF8B;MAG9B,GAAG,KAH2B;MAI9B;IAJ8B,CAA1B;EAZiB,CAAzB;EAoBA,cAAA,CAAA,qBAAA,CAAsB,KAAtB;EAEA,OAAO,KAAP;AACD,CA/BM;;AAAM,OAAA,CAAA,gBAAA,GAAgB,gBAAhB","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"],"sourceRoot":"../src/"}
|
|
1
|
+
{"version":3,"sources":["packages/react-components/react-link/src/components/Link/useLink.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,MAAA,cAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;AAGA;;;;AAIG;;;AACI,MAAM,gBAAgB,GAAG,CAC9B,KAD8B,EAE9B,GAF8B,KAGjB;EACb,MAAM;IAAE,UAAU,GAAG,SAAf;IAA0B,QAAQ,GAAG,KAArC;IAA4C,iBAAiB,GAAG,KAAhE;IAAuE,MAAM,GAAG;EAAhF,IAA0F,KAAhG;EACA,MAAM,EAAE,GAAG,KAAK,CAAC,EAAN,KAAa,KAAK,CAAC,IAAN,GAAa,GAAb,GAAmB,QAAhC,CAAX;EACA,MAAM,IAAI,GAAG,EAAE,KAAK,QAAP,GAAkB,QAAlB,GAA6B,SAA1C;EAEA,MAAM,KAAK,GAAc;IACvB;IACA,UAFuB;IAGvB,QAHuB;IAIvB,iBAJuB;IAKvB,MALuB;IAOvB;IACA,UAAU,EAAE;MACV,IAAI,EAAE;IADI,CARW;IAYvB,IAAI,EAAE,iBAAA,CAAA,qBAAA,CAAsB,EAAtB,EAA0B;MAC9B,GAD8B;MAE9B,IAF8B;MAG9B,GAAG,KAH2B;MAI9B;IAJ8B,CAA1B;EAZiB,CAAzB;EAoBA,cAAA,CAAA,qBAAA,CAAsB,KAAtB;EAEA,OAAO,KAAP;AACD,CA/BM;;AAAM,OAAA,CAAA,gBAAA,GAAgB,gBAAhB","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"],"sourceRoot":"../src/"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["components/Link/useLinkState.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;AAGA;;;AAGG;;;AACI,MAAM,qBAAqB,GAAI,KAAD,IAAgC;EACnE,MAAM;IAAE,QAAF;IAAY;EAAZ,IAAkC,KAAxC;EACA,MAAM;IAAE,OAAF;IAAW,SAAX;IAAsB,IAAtB;IAA4B;EAA5B,IAAqC,KAAK,CAAC,IAAjD,CAFmE,CAInE;;EACA,IAAI,KAAK,CAAC,IAAN,CAAW,EAAX,KAAkB,GAAtB,EAA2B;IACzB,KAAK,CAAC,IAAN,CAAW,IAAX,GAAkB,QAAQ,GAAG,SAAH,GAAe,KAAK,CAAC,IAAN,CAAW,IAApD;IACA,KAAK,CAAC,IAAN,CAAW,QAAX,GAAsB,QAAQ,IAAI,CAAC,iBAAb,GAAiC,SAAjC,GAA6C,CAAnE,CAFyB,CAIzB;;IACA,IAAI,QAAQ,IAAI,iBAAhB,EAAmC;MACjC,KAAK,CAAC,IAAN,CAAW,IAAX,GAAkB,IAAI,IAAI,MAA1B;IACD;EACF,CARD,CASA;EATA,KAUK;IACH,KAAK,CAAC,IAAN,CAAW,IAAX,GAAkB,IAAI,IAAI,QAA1B;EACD,CAjBkE,CAmBnE;;;EACA,KAAK,CAAC,IAAN,CAAW,OAAX,GAAsB,EAAD,IAAgE;IACnF,IAAI,QAAQ,IAAI,iBAAhB,EAAmC;MACjC,EAAE,CAAC,cAAH;IACD,CAFD,MAEO;MACL,OAAO,KAAA,IAAP,IAAA,OAAO,KAAA,KAAA,CAAP,GAAO,KAAA,CAAP,GAAA,OAAO,CAAG,EAAH,CAAP;IACD;EACF,CAND,CApBmE,CA4BnE;;;EACA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAwB,EAAD,IAAmE;IACxF,IAAI,CAAC,QAAQ,IAAI,iBAAb,MAAoC,EAAE,CAAC,GAAH,KAAW,eAAA,CAAA,KAAX,IAAoB,EAAE,CAAC,GAAH,KAAW,eAAA,CAAA,KAAnE,CAAJ,EAA+E;MAC7E,EAAE,CAAC,cAAH;MACA,EAAE,CAAC,eAAH;IACD,CAHD,MAGO;MACL,SAAS,KAAA,IAAT,IAAA,SAAS,KAAA,KAAA,CAAT,GAAS,KAAA,CAAT,GAAA,SAAS,CAAG,EAAH,CAAT;IACD;EACF,CAPD,CA7BmE,CAsCnE;;;EACA,KAAK,CAAC,QAAN,GAAiB,QAAQ,IAAI,iBAA7B;EACA,KAAK,CAAC,IAAN,CAAW,eAAX,IAA8B,QAAQ,IAAI,iBAAZ,IAAiC,SAA/D;;EACA,IAAI,KAAK,CAAC,IAAN,CAAW,EAAX,KAAkB,QAAtB,EAAgC;IAC9B,KAAK,CAAC,IAAN,CAAW,QAAX,GAAsB,QAAQ,IAAI,CAAC,iBAAnC;EACD;;EAED,OAAO,KAAP;AACD,CA9CM;;AAAM,OAAA,CAAA,qBAAA,GAAqB,qBAArB","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, 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 = 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"],"sourceRoot":"../src/"}
|
|
1
|
+
{"version":3,"sources":["packages/react-components/react-link/src/components/Link/useLinkState.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;AAGA;;;AAGG;;;AACI,MAAM,qBAAqB,GAAI,KAAD,IAAgC;EACnE,MAAM;IAAE,QAAF;IAAY;EAAZ,IAAkC,KAAxC;EACA,MAAM;IAAE,OAAF;IAAW,SAAX;IAAsB,IAAtB;IAA4B;EAA5B,IAAqC,KAAK,CAAC,IAAjD,CAFmE,CAInE;;EACA,IAAI,KAAK,CAAC,IAAN,CAAW,EAAX,KAAkB,GAAtB,EAA2B;IACzB,KAAK,CAAC,IAAN,CAAW,IAAX,GAAkB,QAAQ,GAAG,SAAH,GAAe,KAAK,CAAC,IAAN,CAAW,IAApD;IACA,KAAK,CAAC,IAAN,CAAW,QAAX,GAAsB,QAAQ,IAAI,CAAC,iBAAb,GAAiC,SAAjC,GAA6C,CAAnE,CAFyB,CAIzB;;IACA,IAAI,QAAQ,IAAI,iBAAhB,EAAmC;MACjC,KAAK,CAAC,IAAN,CAAW,IAAX,GAAkB,IAAI,IAAI,MAA1B;IACD;EACF,CARD,CASA;EATA,KAUK;IACH,KAAK,CAAC,IAAN,CAAW,IAAX,GAAkB,IAAI,IAAI,QAA1B;EACD,CAjBkE,CAmBnE;;;EACA,KAAK,CAAC,IAAN,CAAW,OAAX,GAAsB,EAAD,IAAgE;IACnF,IAAI,QAAQ,IAAI,iBAAhB,EAAmC;MACjC,EAAE,CAAC,cAAH;IACD,CAFD,MAEO;MACL,OAAO,KAAA,IAAP,IAAA,OAAO,KAAA,KAAA,CAAP,GAAO,KAAA,CAAP,GAAA,OAAO,CAAG,EAAH,CAAP;IACD;EACF,CAND,CApBmE,CA4BnE;;;EACA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAwB,EAAD,IAAmE;IACxF,IAAI,CAAC,QAAQ,IAAI,iBAAb,MAAoC,EAAE,CAAC,GAAH,KAAW,eAAA,CAAA,KAAX,IAAoB,EAAE,CAAC,GAAH,KAAW,eAAA,CAAA,KAAnE,CAAJ,EAA+E;MAC7E,EAAE,CAAC,cAAH;MACA,EAAE,CAAC,eAAH;IACD,CAHD,MAGO;MACL,SAAS,KAAA,IAAT,IAAA,SAAS,KAAA,KAAA,CAAT,GAAS,KAAA,CAAT,GAAA,SAAS,CAAG,EAAH,CAAT;IACD;EACF,CAPD,CA7BmE,CAsCnE;;;EACA,KAAK,CAAC,QAAN,GAAiB,QAAQ,IAAI,iBAA7B;EACA,KAAK,CAAC,IAAN,CAAW,eAAX,IAA8B,QAAQ,IAAI,iBAAZ,IAAiC,SAA/D;;EACA,IAAI,KAAK,CAAC,IAAN,CAAW,EAAX,KAAkB,QAAtB,EAAgC;IAC9B,KAAK,CAAC,IAAN,CAAW,QAAX,GAAsB,QAAQ,IAAI,CAAC,iBAAnC;EACD;;EAED,OAAO,KAAP;AACD,CA9CM;;AAAM,OAAA,CAAA,qBAAA,GAAqB,qBAArB","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, 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 = 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"],"sourceRoot":"../src/"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["components/Link/useLinkStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AACA,MAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AAIa,OAAA,CAAA,cAAA,GAA4C;EACvD,IAAI,EAAE;AADiD,CAA5C;;AAIb,MAAM,SAAS,gBAAG,OAAA,SAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA,EAAlB;;AA+EO,MAAM,sBAAsB,GAAI,KAAD,IAAgC;EACpE,MAAM,MAAM,GAAG,SAAS,EAAxB;EACA,MAAM;IAAE,UAAF;IAAc,QAAd;IAAwB,MAAxB;IAAgC;EAAhC,IAAyC,KAA/C;EAEA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,OAAA,CAAA,YAAA,CACrB,OAAA,CAAA,cAAA,CAAe,IADM,EAErB,MAAM,CAAC,IAFc,EAGrB,MAAM,CAAC,cAHc,EAIrB,IAAI,CAAC,EAAL,KAAY,GAAZ,IAAmB,IAAI,CAAC,IAAxB,IAAgC,MAAM,CAAC,IAJlB,EAKrB,IAAI,CAAC,EAAL,KAAY,QAAZ,IAAwB,MAAM,CAAC,MALV,EAMrB,UAAU,KAAK,QAAf,IAA2B,MAAM,CAAC,MANb,EAOrB,MAAM,IAAI,MAAM,CAAC,MAPI,EAQrB,QAAQ,IAAI,MAAM,CAAC,QARE,EASrB,KAAK,CAAC,IAAN,CAAW,SATU,CAAvB;EAYA,OAAO,KAAP;AACD,CAjBM;;AAAM,OAAA,CAAA,sBAAA,GAAsB,sBAAtB","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"],"sourceRoot":"../src/"}
|
|
1
|
+
{"version":3,"sources":["packages/react-components/react-link/src/components/Link/useLinkStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AACA,MAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AAIa,OAAA,CAAA,cAAA,GAA4C;EACvD,IAAI,EAAE;AADiD,CAA5C;;AAIb,MAAM,SAAS,gBAAG,OAAA,SAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA,EAAlB;;AA+EO,MAAM,sBAAsB,GAAI,KAAD,IAAgC;EACpE,MAAM,MAAM,GAAG,SAAS,EAAxB;EACA,MAAM;IAAE,UAAF;IAAc,QAAd;IAAwB,MAAxB;IAAgC;EAAhC,IAAyC,KAA/C;EAEA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,OAAA,CAAA,YAAA,CACrB,OAAA,CAAA,cAAA,CAAe,IADM,EAErB,MAAM,CAAC,IAFc,EAGrB,MAAM,CAAC,cAHc,EAIrB,IAAI,CAAC,EAAL,KAAY,GAAZ,IAAmB,IAAI,CAAC,IAAxB,IAAgC,MAAM,CAAC,IAJlB,EAKrB,IAAI,CAAC,EAAL,KAAY,QAAZ,IAAwB,MAAM,CAAC,MALV,EAMrB,UAAU,KAAK,QAAf,IAA2B,MAAM,CAAC,MANb,EAOrB,MAAM,IAAI,MAAM,CAAC,MAPI,EAQrB,QAAQ,IAAI,MAAM,CAAC,QARE,EASrB,KAAK,CAAC,IAAN,CAAW,SATU,CAAvB;EAYA,OAAO,KAAP;AACD,CAjBM;;AAAM,OAAA,CAAA,sBAAA,GAAsB,sBAAtB","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"],"sourceRoot":"../src/"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,MAAA,gBAAA,OAAA,CAAA,QAAA,CAAA;;AACE,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,MAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,MAAA,CAAA,IAAA;EAAI;AAAJ,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,gBAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,MAAA,CAAA,cAAA;EAAc;AAAd,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,qBAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,MAAA,CAAA,mBAAA;EAAmB;AAAnB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,uBAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,MAAA,CAAA,qBAAA;EAAqB;AAArB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,wBAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,MAAA,CAAA,sBAAA;EAAsB;AAAtB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,kBAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,MAAA,CAAA,gBAAA;EAAgB;AAAhB,CAAA","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"],"sourceRoot":"../src/"}
|
|
1
|
+
{"version":3,"sources":["packages/react-components/react-link/src/index.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,MAAA,gBAAA,OAAA,CAAA,QAAA,CAAA;;AACE,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,MAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,MAAA,CAAA,IAAA;EAAI;AAAJ,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,gBAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,MAAA,CAAA,cAAA;EAAc;AAAd,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,qBAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,MAAA,CAAA,mBAAA;EAAmB;AAAnB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,uBAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,MAAA,CAAA,qBAAA;EAAqB;AAArB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,wBAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,MAAA,CAAA,sBAAA;EAAsB;AAAtB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,kBAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,MAAA,CAAA,gBAAA;EAAgB;AAAhB,CAAA","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"],"sourceRoot":"../src/"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui/react-link",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.12",
|
|
4
4
|
"description": "Fluent UI React Link component",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -20,10 +20,9 @@
|
|
|
20
20
|
"lint": "just-scripts lint",
|
|
21
21
|
"start": "yarn storybook",
|
|
22
22
|
"test": "jest --passWithNoTests",
|
|
23
|
-
"docs": "api-extractor run --config=config/api-extractor.local.json --local",
|
|
24
|
-
"build:local": "tsc -p ./tsconfig.lib.json --module esnext --emitDeclarationOnly && node ../../../scripts/typescript/normalize-import --output ./dist/types/packages/react-components/react-link/src && yarn docs",
|
|
25
23
|
"storybook": "start-storybook",
|
|
26
|
-
"type-check": "tsc -b tsconfig.json"
|
|
24
|
+
"type-check": "tsc -b tsconfig.json",
|
|
25
|
+
"generate-api": "tsc -p ./tsconfig.lib.json --emitDeclarationOnly && just-scripts api-extractor"
|
|
27
26
|
},
|
|
28
27
|
"devDependencies": {
|
|
29
28
|
"@fluentui/a11y-testing": "^0.1.0",
|
|
@@ -34,9 +33,9 @@
|
|
|
34
33
|
},
|
|
35
34
|
"dependencies": {
|
|
36
35
|
"@fluentui/keyboard-keys": "^9.0.1",
|
|
37
|
-
"@fluentui/react-tabster": "^9.3.
|
|
36
|
+
"@fluentui/react-tabster": "^9.3.1",
|
|
38
37
|
"@fluentui/react-theme": "^9.1.2",
|
|
39
|
-
"@fluentui/react-utilities": "^9.2.
|
|
38
|
+
"@fluentui/react-utilities": "^9.2.2",
|
|
40
39
|
"@griffel/react": "^1.4.2",
|
|
41
40
|
"tslib": "^2.1.0"
|
|
42
41
|
},
|