@fluentui/react-link 9.2.32 → 9.3.0

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 CHANGED
@@ -1,12 +1,22 @@
1
1
  # Change Log - @fluentui/react-link
2
2
 
3
- This log was last generated on Mon, 23 Sep 2024 12:36:04 GMT and should not be manually modified.
3
+ This log was last generated on Tue, 08 Oct 2024 22:02:30 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.3.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-link_v9.3.0)
8
+
9
+ Tue, 08 Oct 2024 22:02:30 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-link_v9.2.32..@fluentui/react-link_v9.3.0)
11
+
12
+ ### Minor changes
13
+
14
+ - feat: add LinkContextProvider ([PR #32850](https://github.com/microsoft/fluentui/pull/32850) by vgenaev@gmail.com)
15
+ - Bump @fluentui/react-tabster to v9.22.8 ([PR #33007](https://github.com/microsoft/fluentui/pull/33007) by beachball)
16
+
7
17
  ## [9.2.32](https://github.com/microsoft/fluentui/tree/@fluentui/react-link_v9.2.32)
8
18
 
9
- Mon, 23 Sep 2024 12:36:04 GMT
19
+ Mon, 23 Sep 2024 12:40:17 GMT
10
20
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-link_v9.2.31..@fluentui/react-link_v9.2.32)
11
21
 
12
22
  ### Patches
package/dist/index.d.ts CHANGED
@@ -13,6 +13,14 @@ export declare const Link: ForwardRefComponent<LinkProps>;
13
13
 
14
14
  export declare const linkClassNames: SlotClassNames<LinkSlots>;
15
15
 
16
+ export declare const linkContextDefaultValue: LinkContextValue;
17
+
18
+ export declare const LinkContextProvider: React_2.Provider<LinkContextValue | undefined>;
19
+
20
+ export declare type LinkContextValue = {
21
+ inline?: boolean;
22
+ };
23
+
16
24
  export declare type LinkProps = ComponentProps<LinkSlots> & {
17
25
  /**
18
26
  * A link can appear either with its default style or subtle.
@@ -61,6 +69,8 @@ export declare const renderLink_unstable: (state: LinkState) => JSX.Element;
61
69
  */
62
70
  export declare const useLink_unstable: (props: LinkProps, ref: React_2.Ref<HTMLAnchorElement | HTMLButtonElement | HTMLSpanElement>) => LinkState;
63
71
 
72
+ export declare const useLinkContext: () => LinkContextValue;
73
+
64
74
  /**
65
75
  * The useLinkState_unstable hook processes the Link state.
66
76
  * @param state - Link state to mutate.
package/lib/Link.js CHANGED
@@ -1 +1,2 @@
1
1
  export * from './components/Link/index';
2
+ export * from './contexts';
package/lib/Link.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["Link.ts"],"sourcesContent":["export * from './components/Link/index';\n"],"names":[],"rangeMappings":"","mappings":"AAAA,cAAc,0BAA0B"}
1
+ {"version":3,"sources":["Link.ts"],"sourcesContent":["export * from './components/Link/index';\nexport * from './contexts';\n"],"names":[],"rangeMappings":";","mappings":"AAAA,cAAc,0BAA0B;AACxC,cAAc,aAAa"}
@@ -2,12 +2,14 @@ import * as React from 'react';
2
2
  import { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';
3
3
  import { useBackgroundAppearance } from '@fluentui/react-shared-contexts';
4
4
  import { useLinkState_unstable } from './useLinkState';
5
+ import { useLinkContext } from '../../contexts/linkContext';
5
6
  /**
6
7
  * Given user props, defines default props for the Link, calls useLinkState_unstable, and returns processed state.
7
8
  * @param props - User provided props to the Link component.
8
9
  * @param ref - User provided ref to be passed to the Link component.
9
10
  */ export const useLink_unstable = (props, ref)=>{
10
11
  const backgroundAppearance = useBackgroundAppearance();
12
+ const { inline: inlineContext } = useLinkContext();
11
13
  const { appearance = 'default', disabled = false, disabledFocusable = false, inline = false } = props;
12
14
  const elementType = props.as || (props.href ? 'a' : 'button');
13
15
  // Casting is required here as `as` prop would break the union between `a`, `button` and `span` types
@@ -22,7 +24,7 @@ import { useLinkState_unstable } from './useLinkState';
22
24
  appearance,
23
25
  disabled,
24
26
  disabledFocusable,
25
- inline,
27
+ inline: inline !== null && inline !== void 0 ? inline : !!inlineContext,
26
28
  // Slots definition
27
29
  components: {
28
30
  root: elementType
@@ -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"],"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
+ {"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';\nimport { useLinkContext } from '../../contexts/linkContext';\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 { inline: inlineContext } = useLinkContext();\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: inline ?? !!inlineContext,\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","useLinkContext","useLink_unstable","props","ref","backgroundAppearance","inline","inlineContext","appearance","disabled","disabledFocusable","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;AAEvD,SAASC,cAAc,QAAQ,6BAA6B;AAE5D;;;;CAIC,GACD,OAAO,MAAMC,mBAAmB,CAC9BC,OACAC;IAEA,MAAMC,uBAAuBN;IAC7B,MAAM,EAAEO,QAAQC,aAAa,EAAE,GAAGN;IAClC,MAAM,EAAEO,aAAa,SAAS,EAAEC,WAAW,KAAK,EAAEC,oBAAoB,KAAK,EAAEJ,SAAS,KAAK,EAAE,GAAGH;IAEhG,MAAMQ,cAAcR,MAAMS,EAAE,IAAKT,CAAAA,MAAMU,IAAI,GAAG,MAAM,QAAO;IAE3D,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;QAChCV;QACAC;QACAC;QACAJ,QAAQA,mBAAAA,oBAAAA,SAAU,CAAC,CAACC;QAEpB,mBAAmB;QACnBY,YAAY;YACVC,MAAMT;QACR;QAEAS,MAAMtB,KAAKuB,MAAM,CACfxB,yBAAoCc,aAAa;YAC/CP;YACA,GAAGU,mBAAmB;QACxB,IACA;YAAEH;QAAY;QAEhBN;IACF;IAEAL,sBAAsBkB;IAEtB,OAAOA;AACT,EAAE"}
@@ -0,0 +1 @@
1
+ export * from './linkContext';
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './linkContext';\n"],"names":[],"rangeMappings":"","mappings":"AAAA,cAAc,gBAAgB"}
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ const LinkContext = React.createContext(undefined);
3
+ export const linkContextDefaultValue = {
4
+ inline: false
5
+ };
6
+ export const LinkContextProvider = LinkContext.Provider;
7
+ export const useLinkContext = ()=>{
8
+ var _React_useContext;
9
+ return (_React_useContext = React.useContext(LinkContext)) !== null && _React_useContext !== void 0 ? _React_useContext : linkContextDefaultValue;
10
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["linkContext.ts"],"sourcesContent":["import * as React from 'react';\n\nexport type LinkContextValue = {\n inline?: boolean;\n};\n\nconst LinkContext = React.createContext<LinkContextValue | undefined>(undefined);\n\nexport const linkContextDefaultValue: LinkContextValue = {\n inline: false,\n};\n\nexport const LinkContextProvider = LinkContext.Provider;\nexport const useLinkContext = () => React.useContext(LinkContext) ?? linkContextDefaultValue;\n"],"names":["React","LinkContext","createContext","undefined","linkContextDefaultValue","inline","LinkContextProvider","Provider","useLinkContext","useContext"],"rangeMappings":";;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAM/B,MAAMC,cAAcD,MAAME,aAAa,CAA+BC;AAEtE,OAAO,MAAMC,0BAA4C;IACvDC,QAAQ;AACV,EAAE;AAEF,OAAO,MAAMC,sBAAsBL,YAAYM,QAAQ,CAAC;AACxD,OAAO,MAAMC,iBAAiB;QAAMR;WAAAA,CAAAA,oBAAAA,MAAMS,UAAU,CAACR,0BAAjBD,+BAAAA,oBAAiCI;AAAsB,EAAE"}
package/lib/index.js CHANGED
@@ -1 +1,2 @@
1
1
  export { Link, linkClassNames, renderLink_unstable, useLinkState_unstable, useLinkStyles_unstable, useLink_unstable } from './Link';
2
+ export { linkContextDefaultValue, LinkContextProvider, useLinkContext } from './contexts';
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"],"rangeMappings":"","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';\nexport { linkContextDefaultValue, LinkContextProvider, useLinkContext } from './contexts';\nexport type { LinkContextValue } from './contexts';\n"],"names":["Link","linkClassNames","renderLink_unstable","useLinkState_unstable","useLinkStyles_unstable","useLink_unstable","linkContextDefaultValue","LinkContextProvider","useLinkContext"],"rangeMappings":";","mappings":"AAAA,SACEA,IAAI,EACJC,cAAc,EACdC,mBAAmB,EACnBC,qBAAqB,EACrBC,sBAAsB,EACtBC,gBAAgB,QACX,SAAS;AAEhB,SAASC,uBAAuB,EAAEC,mBAAmB,EAAEC,cAAc,QAAQ,aAAa"}
@@ -4,3 +4,4 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  const _export_star = require("@swc/helpers/_/_export_star");
6
6
  _export_star._(require("./components/Link/index"), exports);
7
+ _export_star._(require("./contexts"), exports);
@@ -1 +1 @@
1
- {"version":3,"sources":["Link.ts"],"sourcesContent":["export * from './components/Link/index';\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;uBAAc"}
1
+ {"version":3,"sources":["Link.ts"],"sourcesContent":["export * from './components/Link/index';\nexport * from './contexts';\n"],"names":[],"rangeMappings":";;;;;;","mappings":";;;;;uBAAc;uBACA"}
@@ -13,8 +13,10 @@ const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
13
13
  const _reactutilities = require("@fluentui/react-utilities");
14
14
  const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
15
15
  const _useLinkState = require("./useLinkState");
16
+ const _linkContext = require("../../contexts/linkContext");
16
17
  const useLink_unstable = (props, ref)=>{
17
18
  const backgroundAppearance = (0, _reactsharedcontexts.useBackgroundAppearance)();
19
+ const { inline: inlineContext } = (0, _linkContext.useLinkContext)();
18
20
  const { appearance = 'default', disabled = false, disabledFocusable = false, inline = false } = props;
19
21
  const elementType = props.as || (props.href ? 'a' : 'button');
20
22
  // Casting is required here as `as` prop would break the union between `a`, `button` and `span` types
@@ -29,7 +31,7 @@ const useLink_unstable = (props, ref)=>{
29
31
  appearance,
30
32
  disabled,
31
33
  disabledFocusable,
32
- inline,
34
+ inline: inline !== null && inline !== void 0 ? inline : !!inlineContext,
33
35
  // Slots definition
34
36
  components: {
35
37
  root: elementType
@@ -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":["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
+ {"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';\nimport { useLinkContext } from '../../contexts/linkContext';\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 { inline: inlineContext } = useLinkContext();\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: inline ?? !!inlineContext,\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","inline","inlineContext","useLinkContext","appearance","disabled","disabledFocusable","elementType","as","href","propsWithAssignedAs","role","undefined","type","state","components","root","slot","always","getIntrinsicElementProps","useLinkState_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAYaA;;;eAAAA;;;;iEAZU;gCACwB;qCACP;8BACF;6BAEP;AAOxB,MAAMA,mBAAmB,CAC9BC,OACAC;IAEA,MAAMC,uBAAuBC,IAAAA,4CAAAA;IAC7B,MAAM,EAAEC,QAAQC,aAAa,EAAE,GAAGC,IAAAA,2BAAAA;IAClC,MAAM,EAAEC,aAAa,SAAS,EAAEC,WAAW,KAAK,EAAEC,oBAAoB,KAAK,EAAEL,SAAS,KAAK,EAAE,GAAGJ;IAEhG,MAAMU,cAAcV,MAAMW,EAAE,IAAKX,CAAAA,MAAMY,IAAI,GAAG,MAAM,QAAA;IAEpD,qGAAqG;IACrG,MAAMC,sBAAsB;QAC1BC,MAAMJ,gBAAgB,SAAS,WAAWK;QAC1CC,MAAMN,gBAAgB,WAAW,WAAWK;QAC5C,GAAGf,KAAK;QACRW,IAAID;IACN;IAEA,MAAMO,QAAmB;QACvB,gCAAgC;QAChCV;QACAC;QACAC;QACAL,QAAQA,WAAAA,QAAAA,WAAAA,KAAAA,IAAAA,SAAU,CAAC,CAACC;QAEpB,mBAAmB;QACnBa,YAAY;YACVC,MAAMT;QACR;QAEAS,MAAMC,oBAAAA,CAAKC,MAAM,CACfC,IAAAA,wCAAAA,EAAoCZ,aAAa;YAC/CT;YACA,GAAGY,mBAAmB;QACxB,IACA;YAAEH;QAAY;QAEhBR;IACF;IAEAqB,IAAAA,mCAAAA,EAAsBN;IAEtB,OAAOA;AACT"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ const _export_star = require("@swc/helpers/_/_export_star");
6
+ _export_star._(require("./linkContext"), exports);
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './linkContext';\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;uBAAc"}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ LinkContextProvider: function() {
13
+ return LinkContextProvider;
14
+ },
15
+ linkContextDefaultValue: function() {
16
+ return linkContextDefaultValue;
17
+ },
18
+ useLinkContext: function() {
19
+ return useLinkContext;
20
+ }
21
+ });
22
+ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
23
+ const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
24
+ const LinkContext = /*#__PURE__*/ _react.createContext(undefined);
25
+ const linkContextDefaultValue = {
26
+ inline: false
27
+ };
28
+ const LinkContextProvider = LinkContext.Provider;
29
+ const useLinkContext = ()=>{
30
+ var _React_useContext;
31
+ return (_React_useContext = _react.useContext(LinkContext)) !== null && _React_useContext !== void 0 ? _React_useContext : linkContextDefaultValue;
32
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["linkContext.ts"],"sourcesContent":["import * as React from 'react';\n\nexport type LinkContextValue = {\n inline?: boolean;\n};\n\nconst LinkContext = React.createContext<LinkContextValue | undefined>(undefined);\n\nexport const linkContextDefaultValue: LinkContextValue = {\n inline: false,\n};\n\nexport const LinkContextProvider = LinkContext.Provider;\nexport const useLinkContext = () => React.useContext(LinkContext) ?? linkContextDefaultValue;\n"],"names":["LinkContextProvider","linkContextDefaultValue","useLinkContext","LinkContext","React","createContext","undefined","inline","Provider","useContext"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAYaA,mBAAAA;eAAAA;;IAJAC,uBAAAA;eAAAA;;IAKAC,cAAAA;eAAAA;;;;iEAbU;AAMvB,MAAMC,4BAAcC,OAAMC,aAAa,CAA+BC;AAE/D,MAAML,0BAA4C;IACvDM,QAAQ;AACV;AAEO,MAAMP,sBAAsBG,YAAYK,QAAQ;AAChD,MAAMN,iBAAiB;QAAME;WAAAA,CAAAA,oBAAAA,OAAMK,UAAU,CAACN,YAAAA,MAAAA,QAAjBC,sBAAAA,KAAAA,IAAAA,oBAAiCH;AAAsB"}
@@ -12,12 +12,21 @@ _export(exports, {
12
12
  Link: function() {
13
13
  return _Link.Link;
14
14
  },
15
+ LinkContextProvider: function() {
16
+ return _contexts.LinkContextProvider;
17
+ },
15
18
  linkClassNames: function() {
16
19
  return _Link.linkClassNames;
17
20
  },
21
+ linkContextDefaultValue: function() {
22
+ return _contexts.linkContextDefaultValue;
23
+ },
18
24
  renderLink_unstable: function() {
19
25
  return _Link.renderLink_unstable;
20
26
  },
27
+ useLinkContext: function() {
28
+ return _contexts.useLinkContext;
29
+ },
21
30
  useLinkState_unstable: function() {
22
31
  return _Link.useLinkState_unstable;
23
32
  },
@@ -29,3 +38,4 @@ _export(exports, {
29
38
  }
30
39
  });
31
40
  const _Link = require("./Link");
41
+ const _contexts = require("./contexts");
@@ -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"],"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"}
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';\nexport { linkContextDefaultValue, LinkContextProvider, useLinkContext } from './contexts';\nexport type { LinkContextValue } from './contexts';\n"],"names":["Link","LinkContextProvider","linkClassNames","linkContextDefaultValue","renderLink_unstable","useLinkContext","useLinkState_unstable","useLinkStyles_unstable","useLink_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IACEA,IAAI;eAAJA,UAAI;;IAQ4BC,mBAAmB;eAAnBA,6BAAmB;;IAPnDC,cAAc;eAAdA,oBAAc;;IAOPC,uBAAuB;eAAvBA,iCAAuB;;IAN9BC,mBAAmB;eAAnBA,yBAAmB;;IAMkCC,cAAc;eAAdA,wBAAc;;IALnEC,qBAAqB;eAArBA,2BAAqB;;IACrBC,sBAAsB;eAAtBA,4BAAsB;;IACtBC,gBAAgB;eAAhBA,sBAAgB;;;sBACX;0BAEsE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-link",
3
- "version": "9.2.32",
3
+ "version": "9.3.0",
4
4
  "description": "Fluent UI React Link component",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -36,7 +36,7 @@
36
36
  "@fluentui/keyboard-keys": "^9.0.7",
37
37
  "@fluentui/react-jsx-runtime": "^9.0.44",
38
38
  "@fluentui/react-shared-contexts": "^9.20.1",
39
- "@fluentui/react-tabster": "^9.22.7",
39
+ "@fluentui/react-tabster": "^9.22.8",
40
40
  "@fluentui/react-theme": "^9.1.20",
41
41
  "@fluentui/react-utilities": "^9.18.15",
42
42
  "@griffel/react": "^1.5.22",