@fluentui/react-link 9.2.26 → 9.2.27
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.md +15 -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/index.js.map +1 -1
- package/lib-commonjs/Link.js.map +1 -1
- package/lib-commonjs/components/Link/Link.js.map +1 -1
- package/lib-commonjs/components/Link/Link.types.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.styles.js.map +1 -1
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,25 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-link
|
|
2
2
|
|
|
3
|
-
This log was last generated on Mon,
|
|
3
|
+
This log was last generated on Mon, 15 Jul 2024 17:20:16 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [9.2.27](https://github.com/microsoft/fluentui/tree/@fluentui/react-link_v9.2.27)
|
|
8
|
+
|
|
9
|
+
Mon, 15 Jul 2024 17:20:16 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-link_v9.2.26..@fluentui/react-link_v9.2.27)
|
|
11
|
+
|
|
12
|
+
### Patches
|
|
13
|
+
|
|
14
|
+
- fix: revert incorectly set npm versions in all packages ([PR #31937](https://github.com/microsoft/fluentui/pull/31937) by martinhochel@microsoft.com)
|
|
15
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.41 ([PR #31998](https://github.com/microsoft/fluentui/pull/31998) by beachball)
|
|
16
|
+
- Bump @fluentui/react-shared-contexts to v9.19.1 ([PR #31998](https://github.com/microsoft/fluentui/pull/31998) by beachball)
|
|
17
|
+
- Bump @fluentui/react-tabster to v9.22.2 ([PR #31998](https://github.com/microsoft/fluentui/pull/31998) by beachball)
|
|
18
|
+
- Bump @fluentui/react-utilities to v9.18.12 ([PR #31998](https://github.com/microsoft/fluentui/pull/31998) by beachball)
|
|
19
|
+
|
|
7
20
|
## [9.2.26](https://github.com/microsoft/fluentui/tree/@fluentui/react-link_v9.2.26)
|
|
8
21
|
|
|
9
|
-
Mon, 01 Jul 2024 20:
|
|
22
|
+
Mon, 01 Jul 2024 20:30:52 GMT
|
|
10
23
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-link_v9.2.25..@fluentui/react-link_v9.2.26)
|
|
11
24
|
|
|
12
25
|
### Patches
|
package/lib/Link.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Link.ts"],"sourcesContent":["export * from './components/Link/index';\n"],"names":[],"mappings":"AAAA,cAAc,0BAA0B"}
|
|
1
|
+
{"version":3,"sources":["Link.ts"],"sourcesContent":["export * from './components/Link/index';\n"],"names":[],"rangeMappings":"","mappings":"AAAA,cAAc,0BAA0B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Link.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useLink_unstable } from './useLink';\nimport { useLinkStyles_unstable } from './useLinkStyles.styles';\nimport { renderLink_unstable } from './renderLink';\nimport type { LinkProps } from './Link.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * A Link is a reference to data that a user can follow by clicking or tapping it.\n */\nexport const Link: ForwardRefComponent<LinkProps> = React.forwardRef((props, ref) => {\n const state = useLink_unstable(props, ref);\n\n useLinkStyles_unstable(state);\n\n return renderLink_unstable(state);\n // Work around some small mismatches in inferred types which don't matter in practice\n}) as ForwardRefComponent<LinkProps>;\n\nLink.displayName = 'Link';\n"],"names":["React","useLink_unstable","useLinkStyles_unstable","renderLink_unstable","Link","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,gBAAgB,QAAQ,YAAY;AAC7C,SAASC,sBAAsB,QAAQ,yBAAyB;AAChE,SAASC,mBAAmB,QAAQ,eAAe;AAInD;;CAEC,GACD,OAAO,MAAMC,qBAAuCJ,MAAMK,UAAU,CAAC,CAACC,OAAOC;IAC3E,MAAMC,QAAQP,iBAAiBK,OAAOC;IAEtCL,uBAAuBM;IAEvB,OAAOL,oBAAoBK;AAC3B,qFAAqF;AACvF,GAAqC;AAErCJ,KAAKK,WAAW,GAAG"}
|
|
1
|
+
{"version":3,"sources":["Link.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useLink_unstable } from './useLink';\nimport { useLinkStyles_unstable } from './useLinkStyles.styles';\nimport { renderLink_unstable } from './renderLink';\nimport type { LinkProps } from './Link.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * A Link is a reference to data that a user can follow by clicking or tapping it.\n */\nexport const Link: ForwardRefComponent<LinkProps> = React.forwardRef((props, ref) => {\n const state = useLink_unstable(props, ref);\n\n useLinkStyles_unstable(state);\n\n return renderLink_unstable(state);\n // Work around some small mismatches in inferred types which don't matter in practice\n}) as ForwardRefComponent<LinkProps>;\n\nLink.displayName = 'Link';\n"],"names":["React","useLink_unstable","useLinkStyles_unstable","renderLink_unstable","Link","forwardRef","props","ref","state","displayName"],"rangeMappings":";;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,gBAAgB,QAAQ,YAAY;AAC7C,SAASC,sBAAsB,QAAQ,yBAAyB;AAChE,SAASC,mBAAmB,QAAQ,eAAe;AAInD;;CAEC,GACD,OAAO,MAAMC,qBAAuCJ,MAAMK,UAAU,CAAC,CAACC,OAAOC;IAC3E,MAAMC,QAAQP,iBAAiBK,OAAOC;IAEtCL,uBAAuBM;IAEvB,OAAOL,oBAAoBK;AAC3B,qFAAqF;AACvF,GAAqC;AAErCJ,KAAKK,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Link.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { BackgroundAppearanceContextValue } from '@fluentui/react-shared-contexts';\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' | 'span'>;\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 backgroundAppearance?: BackgroundAppearanceContextValue;\n };\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["Link.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { BackgroundAppearanceContextValue } from '@fluentui/react-shared-contexts';\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' | 'span'>;\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 backgroundAppearance?: BackgroundAppearanceContextValue;\n };\n"],"names":[],"rangeMappings":"","mappings":"AAsCA,WAGI"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './Link';\nexport * from './Link.types';\nexport * from './renderLink';\nexport * from './useLink';\nexport * from './useLinkState';\nexport * from './useLinkStyles.styles';\n"],"names":[],"mappings":"AAAA,cAAc,SAAS;AACvB,cAAc,eAAe;AAC7B,cAAc,eAAe;AAC7B,cAAc,YAAY;AAC1B,cAAc,iBAAiB;AAC/B,cAAc,yBAAyB"}
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './Link';\nexport * from './Link.types';\nexport * from './renderLink';\nexport * from './useLink';\nexport * from './useLinkState';\nexport * from './useLinkStyles.styles';\n"],"names":[],"rangeMappings":";;;;;","mappings":"AAAA,cAAc,SAAS;AACvB,cAAc,eAAe;AAC7B,cAAc,eAAe;AAC7B,cAAc,YAAY;AAC1B,cAAc,iBAAiB;AAC/B,cAAc,yBAAyB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["renderLink.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } 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 assertSlots<LinkSlots>(state);\n\n return <state.root />;\n};\n"],"names":["assertSlots","renderLink_unstable","state","root"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAGxD;;CAEC,GACD,OAAO,MAAMC,sBAAsB,CAACC;IAClCF,YAAuBE;IAEvB,qBAAO,KAACA,MAAMC,IAAI;AACpB,EAAE"}
|
|
1
|
+
{"version":3,"sources":["renderLink.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } 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 assertSlots<LinkSlots>(state);\n\n return <state.root />;\n};\n"],"names":["assertSlots","renderLink_unstable","state","root"],"rangeMappings":";;;;;;;","mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAGxD;;CAEC,GACD,OAAO,MAAMC,sBAAsB,CAACC;IAClCF,YAAuBE;IAEvB,qBAAO,KAACA,MAAMC,IAAI;AACpB,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useLink.ts"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\nimport { useBackgroundAppearance } from '@fluentui/react-shared-contexts';\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 | HTMLSpanElement>,\n): LinkState => {\n const backgroundAppearance = useBackgroundAppearance();\n const { appearance = 'default', disabled = false, disabledFocusable = false, inline = false } = props;\n\n const elementType = props.as || (props.href ? 'a' : 'button');\n\n // Casting is required here as `as` prop would break the union between `a`, `button` and `span` types\n const propsWithAssignedAs = {\n role: elementType === 'span' ? 'button' : undefined,\n type: elementType === 'button' ? 'button' : undefined,\n ...props,\n as: elementType,\n } as LinkProps;\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: elementType,\n },\n\n root: slot.always(\n getIntrinsicElementProps<LinkProps>(elementType, {\n ref,\n ...propsWithAssignedAs,\n } as const),\n { elementType },\n ),\n backgroundAppearance,\n };\n\n useLinkState_unstable(state);\n\n return state;\n};\n"],"names":["React","getIntrinsicElementProps","slot","useBackgroundAppearance","useLinkState_unstable","useLink_unstable","props","ref","backgroundAppearance","appearance","disabled","disabledFocusable","inline","elementType","as","href","propsWithAssignedAs","role","undefined","type","state","components","root","always"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,EAAEC,IAAI,QAAQ,4BAA4B;AAC3E,SAASC,uBAAuB,QAAQ,kCAAkC;AAC1E,SAASC,qBAAqB,QAAQ,iBAAiB;AAGvD;;;;CAIC,GACD,OAAO,MAAMC,mBAAmB,CAC9BC,OACAC;IAEA,MAAMC,uBAAuBL;IAC7B,MAAM,EAAEM,aAAa,SAAS,EAAEC,WAAW,KAAK,EAAEC,oBAAoB,KAAK,EAAEC,SAAS,KAAK,EAAE,GAAGN;IAEhG,MAAMO,cAAcP,MAAMQ,EAAE,IAAKR,CAAAA,MAAMS,IAAI,GAAG,MAAM,QAAO;IAE3D,qGAAqG;IACrG,MAAMC,sBAAsB;QAC1BC,MAAMJ,gBAAgB,SAAS,WAAWK;QAC1CC,MAAMN,gBAAgB,WAAW,WAAWK;QAC5C,GAAGZ,KAAK;QACRQ,IAAID;IACN;IAEA,MAAMO,QAAmB;QACvB,gCAAgC;QAChCX;QACAC;QACAC;QACAC;QAEA,mBAAmB;QACnBS,YAAY;YACVC,MAAMT;QACR;QAEAS,MAAMpB,KAAKqB,MAAM,CACftB,yBAAoCY,aAAa;YAC/CN;YACA,GAAGS,mBAAmB;QACxB,IACA;YAAEH;QAAY;QAEhBL;IACF;IAEAJ,sBAAsBgB;IAEtB,OAAOA;AACT,EAAE"}
|
|
1
|
+
{"version":3,"sources":["useLink.ts"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\nimport { useBackgroundAppearance } from '@fluentui/react-shared-contexts';\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 | HTMLSpanElement>,\n): LinkState => {\n const backgroundAppearance = useBackgroundAppearance();\n const { appearance = 'default', disabled = false, disabledFocusable = false, inline = false } = props;\n\n const elementType = props.as || (props.href ? 'a' : 'button');\n\n // Casting is required here as `as` prop would break the union between `a`, `button` and `span` types\n const propsWithAssignedAs = {\n role: elementType === 'span' ? 'button' : undefined,\n type: elementType === 'button' ? 'button' : undefined,\n ...props,\n as: elementType,\n } as LinkProps;\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: elementType,\n },\n\n root: slot.always(\n getIntrinsicElementProps<LinkProps>(elementType, {\n ref,\n ...propsWithAssignedAs,\n } as const),\n { elementType },\n ),\n backgroundAppearance,\n };\n\n useLinkState_unstable(state);\n\n return state;\n};\n"],"names":["React","getIntrinsicElementProps","slot","useBackgroundAppearance","useLinkState_unstable","useLink_unstable","props","ref","backgroundAppearance","appearance","disabled","disabledFocusable","inline","elementType","as","href","propsWithAssignedAs","role","undefined","type","state","components","root","always"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,EAAEC,IAAI,QAAQ,4BAA4B;AAC3E,SAASC,uBAAuB,QAAQ,kCAAkC;AAC1E,SAASC,qBAAqB,QAAQ,iBAAiB;AAGvD;;;;CAIC,GACD,OAAO,MAAMC,mBAAmB,CAC9BC,OACAC;IAEA,MAAMC,uBAAuBL;IAC7B,MAAM,EAAEM,aAAa,SAAS,EAAEC,WAAW,KAAK,EAAEC,oBAAoB,KAAK,EAAEC,SAAS,KAAK,EAAE,GAAGN;IAEhG,MAAMO,cAAcP,MAAMQ,EAAE,IAAKR,CAAAA,MAAMS,IAAI,GAAG,MAAM,QAAO;IAE3D,qGAAqG;IACrG,MAAMC,sBAAsB;QAC1BC,MAAMJ,gBAAgB,SAAS,WAAWK;QAC1CC,MAAMN,gBAAgB,WAAW,WAAWK;QAC5C,GAAGZ,KAAK;QACRQ,IAAID;IACN;IAEA,MAAMO,QAAmB;QACvB,gCAAgC;QAChCX;QACAC;QACAC;QACAC;QAEA,mBAAmB;QACnBS,YAAY;YACVC,MAAMT;QACR;QAEAS,MAAMpB,KAAKqB,MAAM,CACftB,yBAAoCY,aAAa;YAC/CN;YACA,GAAGS,mBAAmB;QACxB,IACA;YAAEH;QAAY;QAEhBL;IACF;IAEAJ,sBAAsBgB;IAEtB,OAAOA;AACT,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useLinkState.ts"],"sourcesContent":["import * as React from 'react';\nimport { Enter, Space } from '@fluentui/keyboard-keys';\nimport type { LinkState } from './Link.types';\n\n/**\n * The useLinkState_unstable hook processes the Link state.\n * @param state - Link state to mutate.\n */\nexport const useLinkState_unstable = (state: LinkState): LinkState => {\n const { disabled, disabledFocusable } = state;\n const { onClick, onKeyDown, role, tabIndex } = state.root;\n\n // Add href for anchor elements.\n if (state.root.as === 'a') {\n state.root.href = disabled ? undefined : state.root.href;\n\n // Add role=\"link\" for disabled and disabledFocusable links.\n if (disabled || disabledFocusable) {\n state.root.role = role || 'link';\n }\n }\n\n // Add tabIndex=0 for anchor and span elements.\n if (state.root.as === 'a' || state.root.as === 'span') {\n state.root.tabIndex = tabIndex ?? (disabled && !disabledFocusable ? undefined : 0);\n }\n\n // Disallow click event when component is disabled and eat events when disabledFocusable is set to true.\n state.root.onClick = (ev: React.MouseEvent<HTMLAnchorElement & HTMLButtonElement>) => {\n if (disabled || disabledFocusable) {\n ev.preventDefault();\n } else {\n onClick?.(ev);\n }\n };\n\n // Disallow keydown event when component is disabled and eat events when disabledFocusable is set to true.\n state.root.onKeyDown = (ev: React.KeyboardEvent<HTMLAnchorElement & HTMLButtonElement>) => {\n if ((disabled || disabledFocusable) && (ev.key === Enter || ev.key === Space)) {\n ev.preventDefault();\n ev.stopPropagation();\n } else {\n onKeyDown?.(ev);\n }\n };\n\n // Set the aria-disabled and disabled props correctly.\n state.disabled = disabled || disabledFocusable;\n state.root['aria-disabled'] = disabled || disabledFocusable || undefined;\n if (state.root.as === 'button') {\n state.root.disabled = disabled && !disabledFocusable;\n }\n\n return state;\n};\n"],"names":["React","Enter","Space","useLinkState_unstable","state","disabled","disabledFocusable","onClick","onKeyDown","role","tabIndex","root","as","href","undefined","ev","preventDefault","key","stopPropagation"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,KAAK,EAAEC,KAAK,QAAQ,0BAA0B;AAGvD;;;CAGC,GACD,OAAO,MAAMC,wBAAwB,CAACC;IACpC,MAAM,EAAEC,QAAQ,EAAEC,iBAAiB,EAAE,GAAGF;IACxC,MAAM,EAAEG,OAAO,EAAEC,SAAS,EAAEC,IAAI,EAAEC,QAAQ,EAAE,GAAGN,MAAMO,IAAI;IAEzD,gCAAgC;IAChC,IAAIP,MAAMO,IAAI,CAACC,EAAE,KAAK,KAAK;QACzBR,MAAMO,IAAI,CAACE,IAAI,GAAGR,WAAWS,YAAYV,MAAMO,IAAI,CAACE,IAAI;QAExD,4DAA4D;QAC5D,IAAIR,YAAYC,mBAAmB;YACjCF,MAAMO,IAAI,CAACF,IAAI,GAAGA,QAAQ;QAC5B;IACF;IAEA,+CAA+C;IAC/C,IAAIL,MAAMO,IAAI,CAACC,EAAE,KAAK,OAAOR,MAAMO,IAAI,CAACC,EAAE,KAAK,QAAQ;QACrDR,MAAMO,IAAI,CAACD,QAAQ,GAAGA,qBAAAA,sBAAAA,WAAaL,YAAY,CAACC,oBAAoBQ,YAAY;IAClF;IAEA,wGAAwG;IACxGV,MAAMO,IAAI,CAACJ,OAAO,GAAG,CAACQ;QACpB,IAAIV,YAAYC,mBAAmB;YACjCS,GAAGC,cAAc;QACnB,OAAO;YACLT,oBAAAA,8BAAAA,QAAUQ;QACZ;IACF;IAEA,0GAA0G;IAC1GX,MAAMO,IAAI,CAACH,SAAS,GAAG,CAACO;QACtB,IAAI,AAACV,CAAAA,YAAYC,iBAAgB,KAAOS,CAAAA,GAAGE,GAAG,KAAKhB,SAASc,GAAGE,GAAG,KAAKf,KAAI,GAAI;YAC7Ea,GAAGC,cAAc;YACjBD,GAAGG,eAAe;QACpB,OAAO;YACLV,sBAAAA,gCAAAA,UAAYO;QACd;IACF;IAEA,sDAAsD;IACtDX,MAAMC,QAAQ,GAAGA,YAAYC;IAC7BF,MAAMO,IAAI,CAAC,gBAAgB,GAAGN,YAAYC,qBAAqBQ;IAC/D,IAAIV,MAAMO,IAAI,CAACC,EAAE,KAAK,UAAU;QAC9BR,MAAMO,IAAI,CAACN,QAAQ,GAAGA,YAAY,CAACC;IACrC;IAEA,OAAOF;AACT,EAAE"}
|
|
1
|
+
{"version":3,"sources":["useLinkState.ts"],"sourcesContent":["import * as React from 'react';\nimport { Enter, Space } from '@fluentui/keyboard-keys';\nimport type { LinkState } from './Link.types';\n\n/**\n * The useLinkState_unstable hook processes the Link state.\n * @param state - Link state to mutate.\n */\nexport const useLinkState_unstable = (state: LinkState): LinkState => {\n const { disabled, disabledFocusable } = state;\n const { onClick, onKeyDown, role, tabIndex } = state.root;\n\n // Add href for anchor elements.\n if (state.root.as === 'a') {\n state.root.href = disabled ? undefined : state.root.href;\n\n // Add role=\"link\" for disabled and disabledFocusable links.\n if (disabled || disabledFocusable) {\n state.root.role = role || 'link';\n }\n }\n\n // Add tabIndex=0 for anchor and span elements.\n if (state.root.as === 'a' || state.root.as === 'span') {\n state.root.tabIndex = tabIndex ?? (disabled && !disabledFocusable ? undefined : 0);\n }\n\n // Disallow click event when component is disabled and eat events when disabledFocusable is set to true.\n state.root.onClick = (ev: React.MouseEvent<HTMLAnchorElement & HTMLButtonElement>) => {\n if (disabled || disabledFocusable) {\n ev.preventDefault();\n } else {\n onClick?.(ev);\n }\n };\n\n // Disallow keydown event when component is disabled and eat events when disabledFocusable is set to true.\n state.root.onKeyDown = (ev: React.KeyboardEvent<HTMLAnchorElement & HTMLButtonElement>) => {\n if ((disabled || disabledFocusable) && (ev.key === Enter || ev.key === Space)) {\n ev.preventDefault();\n ev.stopPropagation();\n } else {\n onKeyDown?.(ev);\n }\n };\n\n // Set the aria-disabled and disabled props correctly.\n state.disabled = disabled || disabledFocusable;\n state.root['aria-disabled'] = disabled || disabledFocusable || undefined;\n if (state.root.as === 'button') {\n state.root.disabled = disabled && !disabledFocusable;\n }\n\n return state;\n};\n"],"names":["React","Enter","Space","useLinkState_unstable","state","disabled","disabledFocusable","onClick","onKeyDown","role","tabIndex","root","as","href","undefined","ev","preventDefault","key","stopPropagation"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,KAAK,EAAEC,KAAK,QAAQ,0BAA0B;AAGvD;;;CAGC,GACD,OAAO,MAAMC,wBAAwB,CAACC;IACpC,MAAM,EAAEC,QAAQ,EAAEC,iBAAiB,EAAE,GAAGF;IACxC,MAAM,EAAEG,OAAO,EAAEC,SAAS,EAAEC,IAAI,EAAEC,QAAQ,EAAE,GAAGN,MAAMO,IAAI;IAEzD,gCAAgC;IAChC,IAAIP,MAAMO,IAAI,CAACC,EAAE,KAAK,KAAK;QACzBR,MAAMO,IAAI,CAACE,IAAI,GAAGR,WAAWS,YAAYV,MAAMO,IAAI,CAACE,IAAI;QAExD,4DAA4D;QAC5D,IAAIR,YAAYC,mBAAmB;YACjCF,MAAMO,IAAI,CAACF,IAAI,GAAGA,QAAQ;QAC5B;IACF;IAEA,+CAA+C;IAC/C,IAAIL,MAAMO,IAAI,CAACC,EAAE,KAAK,OAAOR,MAAMO,IAAI,CAACC,EAAE,KAAK,QAAQ;QACrDR,MAAMO,IAAI,CAACD,QAAQ,GAAGA,qBAAAA,sBAAAA,WAAaL,YAAY,CAACC,oBAAoBQ,YAAY;IAClF;IAEA,wGAAwG;IACxGV,MAAMO,IAAI,CAACJ,OAAO,GAAG,CAACQ;QACpB,IAAIV,YAAYC,mBAAmB;YACjCS,GAAGC,cAAc;QACnB,OAAO;YACLT,oBAAAA,8BAAAA,QAAUQ;QACZ;IACF;IAEA,0GAA0G;IAC1GX,MAAMO,IAAI,CAACH,SAAS,GAAG,CAACO;QACtB,IAAI,AAACV,CAAAA,YAAYC,iBAAgB,KAAOS,CAAAA,GAAGE,GAAG,KAAKhB,SAASc,GAAGE,GAAG,KAAKf,KAAI,GAAI;YAC7Ea,GAAGC,cAAc;YACjBD,GAAGG,eAAe;QACpB,OAAO;YACLV,sBAAAA,gCAAAA,UAAYO;QACd;IACF;IAEA,sDAAsD;IACtDX,MAAMC,QAAQ,GAAGA,YAAYC;IAC7BF,MAAMO,IAAI,CAAC,gBAAgB,GAAGN,YAAYC,qBAAqBQ;IAC/D,IAAIV,MAAMO,IAAI,CAACC,EAAE,KAAK,UAAU;QAC9BR,MAAMO,IAAI,CAACN,QAAQ,GAAGA,YAAY,CAACC;IACrC;IAEA,OAAOF;AACT,EAAE"}
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export {\n Link,\n linkClassNames,\n renderLink_unstable,\n useLinkState_unstable,\n useLinkStyles_unstable,\n useLink_unstable,\n} from './Link';\nexport type { LinkProps, LinkSlots, LinkState } from './Link';\n"],"names":["Link","linkClassNames","renderLink_unstable","useLinkState_unstable","useLinkStyles_unstable","useLink_unstable"],"mappings":"AAAA,SACEA,IAAI,EACJC,cAAc,EACdC,mBAAmB,EACnBC,qBAAqB,EACrBC,sBAAsB,EACtBC,gBAAgB,QACX,SAAS"}
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export {\n Link,\n linkClassNames,\n renderLink_unstable,\n useLinkState_unstable,\n useLinkStyles_unstable,\n useLink_unstable,\n} from './Link';\nexport type { LinkProps, LinkSlots, LinkState } from './Link';\n"],"names":["Link","linkClassNames","renderLink_unstable","useLinkState_unstable","useLinkStyles_unstable","useLink_unstable"],"rangeMappings":"","mappings":"AAAA,SACEA,IAAI,EACJC,cAAc,EACdC,mBAAmB,EACnBC,qBAAqB,EACrBC,sBAAsB,EACtBC,gBAAgB,QACX,SAAS"}
|
package/lib-commonjs/Link.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Link.
|
|
1
|
+
{"version":3,"sources":["Link.ts"],"sourcesContent":["export * from './components/Link/index';\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;uBAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Link.
|
|
1
|
+
{"version":3,"sources":["Link.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useLink_unstable } from './useLink';\nimport { useLinkStyles_unstable } from './useLinkStyles.styles';\nimport { renderLink_unstable } from './renderLink';\nimport type { LinkProps } from './Link.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * A Link is a reference to data that a user can follow by clicking or tapping it.\n */\nexport const Link: ForwardRefComponent<LinkProps> = React.forwardRef((props, ref) => {\n const state = useLink_unstable(props, ref);\n\n useLinkStyles_unstable(state);\n\n return renderLink_unstable(state);\n // Work around some small mismatches in inferred types which don't matter in practice\n}) as ForwardRefComponent<LinkProps>;\n\nLink.displayName = 'Link';\n"],"names":["Link","React","forwardRef","props","ref","state","useLink_unstable","useLinkStyles_unstable","renderLink_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAUaA;;;eAAAA;;;;iEAVU;yBACU;qCACM;4BACH;AAO7B,MAAMA,OAAAA,WAAAA,GAAuCC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IAC3E,MAAMC,QAAQC,IAAAA,yBAAAA,EAAiBH,OAAOC;IAEtCG,IAAAA,2CAAAA,EAAuBF;IAEvB,OAAOG,IAAAA,+BAAAA,EAAoBH;AAC3B,qFAAqF;AACvF;AAEAL,KAAKS,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"sources":["Link.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { BackgroundAppearanceContextValue } from '@fluentui/react-shared-contexts';\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' | 'span'>;\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 backgroundAppearance?: BackgroundAppearanceContextValue;\n };\n"],"names":[],"rangeMappings":"","mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './Link';\nexport * from './Link.types';\nexport * from './renderLink';\nexport * from './useLink';\nexport * from './useLinkState';\nexport * from './useLinkStyles.styles';\n"],"names":[],"rangeMappings":";;;;;;;;;;","mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA;uBACA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["renderLink.
|
|
1
|
+
{"version":3,"sources":["renderLink.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } 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 assertSlots<LinkSlots>(state);\n\n return <state.root />;\n};\n"],"names":["renderLink_unstable","state","assertSlots","_jsx","root"],"rangeMappings":";;;;;;;;;;;;;;;","mappings":";;;;+BASaA;;;eAAAA;;;4BARb;gCAE4B;AAMrB,MAAMA,sBAAsB,CAACC;IAClCC,IAAAA,2BAAAA,EAAuBD;IAEvB,OAAA,WAAA,GAAOE,IAAAA,eAAA,EAACF,MAAMG,IAAI,EAAA,CAAA;AACpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useLink.
|
|
1
|
+
{"version":3,"sources":["useLink.ts"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\nimport { useBackgroundAppearance } from '@fluentui/react-shared-contexts';\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 | HTMLSpanElement>,\n): LinkState => {\n const backgroundAppearance = useBackgroundAppearance();\n const { appearance = 'default', disabled = false, disabledFocusable = false, inline = false } = props;\n\n const elementType = props.as || (props.href ? 'a' : 'button');\n\n // Casting is required here as `as` prop would break the union between `a`, `button` and `span` types\n const propsWithAssignedAs = {\n role: elementType === 'span' ? 'button' : undefined,\n type: elementType === 'button' ? 'button' : undefined,\n ...props,\n as: elementType,\n } as LinkProps;\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: elementType,\n },\n\n root: slot.always(\n getIntrinsicElementProps<LinkProps>(elementType, {\n ref,\n ...propsWithAssignedAs,\n } as const),\n { elementType },\n ),\n backgroundAppearance,\n };\n\n useLinkState_unstable(state);\n\n return state;\n};\n"],"names":["useLink_unstable","props","ref","backgroundAppearance","useBackgroundAppearance","appearance","disabled","disabledFocusable","inline","elementType","as","href","propsWithAssignedAs","role","undefined","type","state","components","root","slot","always","getIntrinsicElementProps","useLinkState_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAWaA;;;eAAAA;;;;iEAXU;gCACwB;qCACP;8BACF;AAQ/B,MAAMA,mBAAmB,CAC9BC,OACAC;IAEA,MAAMC,uBAAuBC,IAAAA,4CAAAA;IAC7B,MAAM,EAAEC,aAAa,SAAS,EAAEC,WAAW,KAAK,EAAEC,oBAAoB,KAAK,EAAEC,SAAS,KAAK,EAAE,GAAGP;IAEhG,MAAMQ,cAAcR,MAAMS,EAAE,IAAKT,CAAAA,MAAMU,IAAI,GAAG,MAAM,QAAA;IAEpD,qGAAqG;IACrG,MAAMC,sBAAsB;QAC1BC,MAAMJ,gBAAgB,SAAS,WAAWK;QAC1CC,MAAMN,gBAAgB,WAAW,WAAWK;QAC5C,GAAGb,KAAK;QACRS,IAAID;IACN;IAEA,MAAMO,QAAmB;QACvB,gCAAgC;QAChCX;QACAC;QACAC;QACAC;QAEA,mBAAmB;QACnBS,YAAY;YACVC,MAAMT;QACR;QAEAS,MAAMC,oBAAAA,CAAKC,MAAM,CACfC,IAAAA,wCAAAA,EAAoCZ,aAAa;YAC/CP;YACA,GAAGU,mBAAmB;QACxB,IACA;YAAEH;QAAY;QAEhBN;IACF;IAEAmB,IAAAA,mCAAAA,EAAsBN;IAEtB,OAAOA;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useLinkState.
|
|
1
|
+
{"version":3,"sources":["useLinkState.ts"],"sourcesContent":["import * as React from 'react';\nimport { Enter, Space } from '@fluentui/keyboard-keys';\nimport type { LinkState } from './Link.types';\n\n/**\n * The useLinkState_unstable hook processes the Link state.\n * @param state - Link state to mutate.\n */\nexport const useLinkState_unstable = (state: LinkState): LinkState => {\n const { disabled, disabledFocusable } = state;\n const { onClick, onKeyDown, role, tabIndex } = state.root;\n\n // Add href for anchor elements.\n if (state.root.as === 'a') {\n state.root.href = disabled ? undefined : state.root.href;\n\n // Add role=\"link\" for disabled and disabledFocusable links.\n if (disabled || disabledFocusable) {\n state.root.role = role || 'link';\n }\n }\n\n // Add tabIndex=0 for anchor and span elements.\n if (state.root.as === 'a' || state.root.as === 'span') {\n state.root.tabIndex = tabIndex ?? (disabled && !disabledFocusable ? undefined : 0);\n }\n\n // Disallow click event when component is disabled and eat events when disabledFocusable is set to true.\n state.root.onClick = (ev: React.MouseEvent<HTMLAnchorElement & HTMLButtonElement>) => {\n if (disabled || disabledFocusable) {\n ev.preventDefault();\n } else {\n onClick?.(ev);\n }\n };\n\n // Disallow keydown event when component is disabled and eat events when disabledFocusable is set to true.\n state.root.onKeyDown = (ev: React.KeyboardEvent<HTMLAnchorElement & HTMLButtonElement>) => {\n if ((disabled || disabledFocusable) && (ev.key === Enter || ev.key === Space)) {\n ev.preventDefault();\n ev.stopPropagation();\n } else {\n onKeyDown?.(ev);\n }\n };\n\n // Set the aria-disabled and disabled props correctly.\n state.disabled = disabled || disabledFocusable;\n state.root['aria-disabled'] = disabled || disabledFocusable || undefined;\n if (state.root.as === 'button') {\n state.root.disabled = disabled && !disabledFocusable;\n }\n\n return state;\n};\n"],"names":["useLinkState_unstable","state","disabled","disabledFocusable","onClick","onKeyDown","role","tabIndex","root","as","href","undefined","ev","preventDefault","key","Enter","Space","stopPropagation"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAQaA;;;eAAAA;;;;iEARU;8BACM;AAOtB,MAAMA,wBAAwB,CAACC;IACpC,MAAM,EAAEC,QAAQ,EAAEC,iBAAiB,EAAE,GAAGF;IACxC,MAAM,EAAEG,OAAO,EAAEC,SAAS,EAAEC,IAAI,EAAEC,QAAQ,EAAE,GAAGN,MAAMO,IAAI;IAEzD,gCAAgC;IAChC,IAAIP,MAAMO,IAAI,CAACC,EAAE,KAAK,KAAK;QACzBR,MAAMO,IAAI,CAACE,IAAI,GAAGR,WAAWS,YAAYV,MAAMO,IAAI,CAACE,IAAI;QAExD,4DAA4D;QAC5D,IAAIR,YAAYC,mBAAmB;YACjCF,MAAMO,IAAI,CAACF,IAAI,GAAGA,QAAQ;QAC5B;IACF;IAEA,+CAA+C;IAC/C,IAAIL,MAAMO,IAAI,CAACC,EAAE,KAAK,OAAOR,MAAMO,IAAI,CAACC,EAAE,KAAK,QAAQ;QACrDR,MAAMO,IAAI,CAACD,QAAQ,GAAGA,aAAAA,QAAAA,aAAAA,KAAAA,IAAAA,WAAaL,YAAY,CAACC,oBAAoBQ,YAAY;IAClF;IAEA,wGAAwG;IACxGV,MAAMO,IAAI,CAACJ,OAAO,GAAG,CAACQ;QACpB,IAAIV,YAAYC,mBAAmB;YACjCS,GAAGC,cAAc;QACnB,OAAO;YACLT,YAAAA,QAAAA,YAAAA,KAAAA,IAAAA,KAAAA,IAAAA,QAAUQ;QACZ;IACF;IAEA,0GAA0G;IAC1GX,MAAMO,IAAI,CAACH,SAAS,GAAG,CAACO;QACtB,IAAI,AAACV,CAAAA,YAAYC,iBAAAA,KAAuBS,CAAAA,GAAGE,GAAG,KAAKC,mBAAAA,IAASH,GAAGE,GAAG,KAAKE,mBAAI,AAAJA,GAAQ;YAC7EJ,GAAGC,cAAc;YACjBD,GAAGK,eAAe;QACpB,OAAO;YACLZ,cAAAA,QAAAA,cAAAA,KAAAA,IAAAA,KAAAA,IAAAA,UAAYO;QACd;IACF;IAEA,sDAAsD;IACtDX,MAAMC,QAAQ,GAAGA,YAAYC;IAC7BF,MAAMO,IAAI,CAAC,gBAAgB,GAAGN,YAAYC,qBAAqBQ;IAC/D,IAAIV,MAAMO,IAAI,CAACC,EAAE,KAAK,UAAU;QAC9BR,MAAMO,IAAI,CAACN,QAAQ,GAAGA,YAAY,CAACC;IACrC;IAEA,OAAOF;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useLinkStyles.styles.js"],"sourcesContent":["import { shorthands,
|
|
1
|
+
{"version":3,"sources":["useLinkStyles.styles.js"],"sourcesContent":["import { shorthands, makeStyles, mergeClasses } from '@griffel/react';\nimport { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\nimport { tokens } from '@fluentui/react-theme';\nexport const linkClassNames = {\n root: 'fui-Link'\n};\nconst useStyles = makeStyles({\n focusIndicator: createCustomFocusIndicatorStyle({\n textDecorationColor: tokens.colorStrokeFocus2,\n textDecorationLine: 'underline',\n textDecorationStyle: 'double',\n outlineStyle: 'none'\n }),\n // Common styles.\n root: {\n ':focus-visible': {\n outlineStyle: 'none'\n },\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 margin: '0',\n padding: '0',\n overflow: 'inherit',\n textAlign: 'left',\n textDecorationLine: 'none',\n textDecorationThickness: tokens.strokeWidthThin,\n textOverflow: 'inherit',\n userSelect: 'text',\n ':hover': {\n textDecorationLine: 'underline',\n color: tokens.colorBrandForegroundLinkHover\n },\n ':active': {\n textDecorationLine: 'underline',\n color: tokens.colorBrandForegroundLinkPressed\n }\n },\n // Overrides when the Link renders as a button.\n button: {\n ...shorthands.borderStyle('none')\n },\n // Overrides when an href is present so the Link renders as an anchor.\n href: {\n fontSize: 'inherit'\n },\n // Overrides when the Link appears subtle.\n subtle: {\n color: tokens.colorNeutralForeground2,\n ':hover': {\n textDecorationLine: 'underline',\n color: tokens.colorNeutralForeground2Hover\n },\n ':active': {\n textDecorationLine: 'underline',\n color: tokens.colorNeutralForeground2Pressed\n }\n },\n // Overrides when the Link is rendered inline within text.\n inline: {\n textDecorationLine: 'underline'\n },\n // Overrides when the Link is disabled.\n disabled: {\n textDecorationLine: 'none',\n color: tokens.colorNeutralForegroundDisabled,\n cursor: 'not-allowed',\n ':hover': {\n textDecorationLine: 'none',\n color: tokens.colorNeutralForegroundDisabled\n },\n ':active': {\n textDecorationLine: 'none',\n color: tokens.colorNeutralForegroundDisabled\n }\n },\n inverted: {\n color: tokens.colorBrandForegroundInverted,\n ':hover': {\n color: tokens.colorBrandForegroundInvertedHover\n },\n ':active': {\n color: tokens.colorBrandForegroundInvertedPressed\n }\n }\n});\nexport const useLinkStyles_unstable = (state)=>{\n 'use no memo';\n const styles = useStyles();\n const { appearance, disabled, inline, root, backgroundAppearance } = state;\n state.root.className = mergeClasses(linkClassNames.root, styles.root, styles.focusIndicator, root.as === 'a' && root.href && styles.href, root.as === 'button' && styles.button, appearance === 'subtle' && styles.subtle, backgroundAppearance === 'inverted' && styles.inverted, inline && styles.inline, disabled && styles.disabled, state.root.className);\n return state;\n};\n"],"names":["linkClassNames","useLinkStyles_unstable","root","useStyles","__styles","focusIndicator","Bttzg6e","B3uz8dt","B6ihwck","g9k6zt","B486eqv","De3pzq","B7ck84d","sj55zd","Bceei9c","mc9l5x","Bahqtrf","Be2twd7","Bhrd7zp","jrapky","Frg6f3","t21cq0","B6of3ja","B74szlk","Byoj8tv","uwmqm3","z189sj","z8tnut","B0ocmuz","B68tc82","Bmxbyg5","Bpg54ce","fsow6f","w71qe1","Bkioxbp","ygn44y","famaaq","Bde5pd6","Bi91k9c","i089h6","lj723h","button","icvyot","vrafjx","oivjwe","wvpqe5","href","subtle","inline","disabled","inverted","d","p","i","h","a","state","styles","appearance","backgroundAppearance","className","mergeClasses","as"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAGaA,cAAc;eAAdA;;IAwFAC,sBAAsB;eAAtBA;;;uBA3FwC;AAG9C,MAAMD,iBAAiB;IAC1BE,MAAM;AACV;AACA,MAAMC,YAAS,WAAA,GAAGC,IAAAA,eAAA,EAAA;IAAAC,gBAAA;QAAAC,SAAA;QAAAC,SAAA;QAAAC,SAAA;QAAAC,QAAA;IAAA;IAAAP,MAAA;QAAAQ,SAAA;QAAAC,QAAA;QAAAC,SAAA;QAAAC,QAAA;QAAAC,SAAA;QAAAC,QAAA;QAAAC,SAAA;QAAAC,SAAA;QAAAC,SAAA;QAAAC,QAAA;QAAAC,QAAA;QAAAC,QAAA;QAAAC,SAAA;QAAAC,SAAA;QAAAC,SAAA;QAAAC,QAAA;QAAAC,QAAA;QAAAC,QAAA;QAAAC,SAAA;QAAAC,SAAA;QAAAC,SAAA;QAAAC,SAAA;QAAAC,QAAA;YAAA;YAAA;SAAA;QAAAC,QAAA;QAAAC,SAAA;QAAAC,QAAA;QAAAC,QAAA;QAAAC,SAAA;QAAAC,SAAA;QAAAC,QAAA;QAAAC,QAAA;IAAA;IAAAC,QAAA;QAAAC,QAAA;QAAAC,QAAA;YAAA;YAAA;SAAA;QAAAC,QAAA;QAAAC,QAAA;YAAA;YAAA;SAAA;IAAA;IAAAC,MAAA;QAAA7B,SAAA;IAAA;IAAA8B,QAAA;QAAAlC,QAAA;QAAAwB,SAAA;QAAAC,SAAA;QAAAC,QAAA;QAAAC,QAAA;IAAA;IAAAQ,QAAA;QAAAf,QAAA;IAAA;IAAAgB,UAAA;QAAAhB,QAAA;QAAApB,QAAA;QAAAC,SAAA;QAAAuB,SAAA;QAAAC,SAAA;QAAAC,QAAA;QAAAC,QAAA;IAAA;IAAAU,UAAA;QAAArC,QAAA;QAAAyB,SAAA;QAAAE,QAAA;IAAA;AAAA,GAAA;IAAAW,GAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;YAAA;YAAA;gBAAAC,GAAA,CAAA;YAAA;SAAA;QAAA;YAAA;YAAA;gBAAAA,GAAA,CAAA;YAAA;SAAA;QAAA;YAAA;YAAA;gBAAAA,GAAA,CAAA;YAAA;SAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;KAAA;IAAAC,GAAA;QAAA;KAAA;IAAAC,GAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;KAAA;IAAAC,GAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;KAAA;AAAA;AAqFX,MAAMtD,yBAA0BuD,CAAAA;IACnC;IACA,MAAMC,SAAStD;IACf,MAAM,EAAEuD,UAAU,EAAET,QAAQ,EAAED,MAAM,EAAE9C,IAAI,EAAEyD,oBAAAA,EAAsB,GAAGH;IACrEA,MAAMtD,IAAI,CAAC0D,SAAS,GAAGC,IAAAA,mBAAY,EAAC7D,eAAeE,IAAI,EAAEuD,OAAOvD,IAAI,EAAEuD,OAAOpD,cAAc,EAAEH,KAAK4D,EAAE,KAAK,OAAO5D,KAAK4C,IAAI,IAAIW,OAAOX,IAAI,EAAE5C,KAAK4D,EAAE,KAAK,YAAYL,OAAOhB,MAAM,EAAEiB,eAAe,YAAYD,OAAOV,MAAM,EAAEY,yBAAyB,cAAcF,OAAOP,QAAQ,EAAEF,UAAUS,OAAOT,MAAM,EAAEC,YAAYQ,OAAOR,QAAQ,EAAEO,MAAMtD,IAAI,CAAC0D,SAAS;IAC7V,OAAOJ;AACX"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export {\n Link,\n linkClassNames,\n renderLink_unstable,\n useLinkState_unstable,\n useLinkStyles_unstable,\n useLink_unstable,\n} from './Link';\nexport type { LinkProps, LinkSlots, LinkState } from './Link';\n"],"names":["Link","linkClassNames","renderLink_unstable","useLinkState_unstable","useLinkStyles_unstable","useLink_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IACEA,IAAI;eAAJA,UAAI;;IACJC,cAAc;eAAdA,oBAAc;;IACdC,mBAAmB;eAAnBA,yBAAmB;;IACnBC,qBAAqB;eAArBA,2BAAqB;;IACrBC,sBAAsB;eAAtBA,4BAAsB;;IACtBC,gBAAgB;eAAhBA,sBAAgB;;;sBACX"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui/react-link",
|
|
3
|
-
"version": "9.2.
|
|
3
|
+
"version": "9.2.27",
|
|
4
4
|
"description": "Fluent UI React Link component",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@fluentui/keyboard-keys": "^9.0.7",
|
|
37
|
-
"@fluentui/react-jsx-runtime": "^9.0.
|
|
38
|
-
"@fluentui/react-shared-contexts": "^9.19.
|
|
39
|
-
"@fluentui/react-tabster": "^9.22.
|
|
37
|
+
"@fluentui/react-jsx-runtime": "^9.0.41",
|
|
38
|
+
"@fluentui/react-shared-contexts": "^9.19.1",
|
|
39
|
+
"@fluentui/react-tabster": "^9.22.2",
|
|
40
40
|
"@fluentui/react-theme": "^9.1.19",
|
|
41
|
-
"@fluentui/react-utilities": "^9.18.
|
|
41
|
+
"@fluentui/react-utilities": "^9.18.12",
|
|
42
42
|
"@griffel/react": "^1.5.22",
|
|
43
43
|
"@swc/helpers": "^0.5.1"
|
|
44
44
|
},
|