@fluentui/react-link 9.0.30 → 9.0.31

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.
Files changed (52) hide show
  1. package/.swcrc +30 -0
  2. package/CHANGELOG.json +52 -1
  3. package/CHANGELOG.md +17 -2
  4. package/lib/Link.js.map +1 -1
  5. package/lib/components/Link/Link.js.map +1 -1
  6. package/lib/components/Link/Link.types.js.map +1 -1
  7. package/lib/components/Link/index.js.map +1 -1
  8. package/lib/components/Link/renderLink.js +1 -3
  9. package/lib/components/Link/renderLink.js.map +1 -1
  10. package/lib/components/Link/useLink.js +1 -0
  11. package/lib/components/Link/useLink.js.map +1 -1
  12. package/lib/components/Link/useLinkState.js +2 -3
  13. package/lib/components/Link/useLinkState.js.map +1 -1
  14. package/lib/components/Link/useLinkStyles.js.map +1 -1
  15. package/lib/index.js.map +1 -1
  16. package/lib-commonjs/Link.js +5 -4
  17. package/lib-commonjs/Link.js.map +1 -1
  18. package/lib-commonjs/components/Link/Link.js +16 -16
  19. package/lib-commonjs/components/Link/Link.js.map +1 -1
  20. package/lib-commonjs/components/Link/Link.types.js +3 -2
  21. package/lib-commonjs/components/Link/Link.types.js.map +1 -1
  22. package/lib-commonjs/components/Link/index.js +10 -9
  23. package/lib-commonjs/components/Link/index.js.map +1 -1
  24. package/lib-commonjs/components/Link/renderLink.js +13 -18
  25. package/lib-commonjs/components/Link/renderLink.js.map +1 -1
  26. package/lib-commonjs/components/Link/useLink.js +34 -40
  27. package/lib-commonjs/components/Link/useLink.js.map +1 -1
  28. package/lib-commonjs/components/Link/useLinkState.js +45 -56
  29. package/lib-commonjs/components/Link/useLinkState.js.map +1 -1
  30. package/lib-commonjs/components/Link/useLinkStyles.js +165 -90
  31. package/lib-commonjs/components/Link/useLinkStyles.js.map +1 -1
  32. package/lib-commonjs/index.js +17 -39
  33. package/lib-commonjs/index.js.map +1 -1
  34. package/package.json +9 -8
  35. package/lib-amd/Link.js +0 -6
  36. package/lib-amd/Link.js.map +0 -1
  37. package/lib-amd/components/Link/Link.js +0 -16
  38. package/lib-amd/components/Link/Link.js.map +0 -1
  39. package/lib-amd/components/Link/Link.types.js +0 -5
  40. package/lib-amd/components/Link/Link.types.js.map +0 -1
  41. package/lib-amd/components/Link/index.js +0 -11
  42. package/lib-amd/components/Link/index.js.map +0 -1
  43. package/lib-amd/components/Link/renderLink.js +0 -14
  44. package/lib-amd/components/Link/renderLink.js.map +0 -1
  45. package/lib-amd/components/Link/useLink.js +0 -31
  46. package/lib-amd/components/Link/useLink.js.map +0 -1
  47. package/lib-amd/components/Link/useLinkState.js +0 -54
  48. package/lib-amd/components/Link/useLinkState.js.map +0 -1
  49. package/lib-amd/components/Link/useLinkStyles.js +0 -67
  50. package/lib-amd/components/Link/useLinkStyles.js.map +0 -1
  51. package/lib-amd/index.js +0 -12
  52. package/lib-amd/index.js.map +0 -1
package/.swcrc ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/swcrc",
3
+ "exclude": [
4
+ "/testing",
5
+ "/**/*.cy.ts",
6
+ "/**/*.cy.tsx",
7
+ "/**/*.spec.ts",
8
+ "/**/*.spec.tsx",
9
+ "/**/*.test.ts",
10
+ "/**/*.test.tsx"
11
+ ],
12
+ "jsc": {
13
+ "parser": {
14
+ "syntax": "typescript",
15
+ "tsx": true,
16
+ "decorators": false,
17
+ "dynamicImport": false
18
+ },
19
+ "externalHelpers": true,
20
+ "transform": {
21
+ "react": {
22
+ "runtime": "classic",
23
+ "useSpread": true
24
+ }
25
+ },
26
+ "target": "es2019"
27
+ },
28
+ "minify": false,
29
+ "sourceMaps": true
30
+ }
package/CHANGELOG.json CHANGED
@@ -2,7 +2,58 @@
2
2
  "name": "@fluentui/react-link",
3
3
  "entries": [
4
4
  {
5
- "date": "Thu, 16 Mar 2023 14:33:33 GMT",
5
+ "date": "Tue, 21 Mar 2023 21:18:51 GMT",
6
+ "tag": "@fluentui/react-link_v9.0.31",
7
+ "version": "9.0.31",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "tristan.watanabe@gmail.com",
12
+ "package": "@fluentui/react-link",
13
+ "commit": "ead1c6d4c2ac3f3596b62b8cbc07b0a03041f11f",
14
+ "comment": "fix: add node field to package.json exports map."
15
+ },
16
+ {
17
+ "author": "tristan.watanabe@gmail.com",
18
+ "package": "@fluentui/react-link",
19
+ "commit": "2fac1a139149bd13b76b1306207bc988dca9c72c",
20
+ "comment": "chore: migrate to swc transpilation approach."
21
+ },
22
+ {
23
+ "author": "beachball",
24
+ "package": "@fluentui/react-link",
25
+ "comment": "Bump @fluentui/keyboard-keys to v9.0.2",
26
+ "commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
27
+ },
28
+ {
29
+ "author": "beachball",
30
+ "package": "@fluentui/react-link",
31
+ "comment": "Bump @fluentui/react-tabster to v9.6.1",
32
+ "commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
33
+ },
34
+ {
35
+ "author": "beachball",
36
+ "package": "@fluentui/react-link",
37
+ "comment": "Bump @fluentui/react-theme to v9.1.7",
38
+ "commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
39
+ },
40
+ {
41
+ "author": "beachball",
42
+ "package": "@fluentui/react-link",
43
+ "comment": "Bump @fluentui/react-utilities to v9.7.2",
44
+ "commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
45
+ },
46
+ {
47
+ "author": "beachball",
48
+ "package": "@fluentui/react-link",
49
+ "comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.20",
50
+ "commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
51
+ }
52
+ ]
53
+ }
54
+ },
55
+ {
56
+ "date": "Thu, 16 Mar 2023 14:36:59 GMT",
6
57
  "tag": "@fluentui/react-link_v9.0.30",
7
58
  "version": "9.0.30",
8
59
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,27 @@
1
1
  # Change Log - @fluentui/react-link
2
2
 
3
- This log was last generated on Thu, 16 Mar 2023 14:33:33 GMT and should not be manually modified.
3
+ This log was last generated on Tue, 21 Mar 2023 21:18:51 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.0.31](https://github.com/microsoft/fluentui/tree/@fluentui/react-link_v9.0.31)
8
+
9
+ Tue, 21 Mar 2023 21:18:51 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-link_v9.0.30..@fluentui/react-link_v9.0.31)
11
+
12
+ ### Patches
13
+
14
+ - fix: add node field to package.json exports map. ([PR #27154](https://github.com/microsoft/fluentui/pull/27154) by tristan.watanabe@gmail.com)
15
+ - chore: migrate to swc transpilation approach. ([PR #27250](https://github.com/microsoft/fluentui/pull/27250) by tristan.watanabe@gmail.com)
16
+ - Bump @fluentui/keyboard-keys to v9.0.2 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
17
+ - Bump @fluentui/react-tabster to v9.6.1 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
18
+ - Bump @fluentui/react-theme to v9.1.7 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
19
+ - Bump @fluentui/react-utilities to v9.7.2 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
20
+ - Bump @fluentui/react-conformance-griffel to v9.0.0-beta.20 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
21
+
7
22
  ## [9.0.30](https://github.com/microsoft/fluentui/tree/@fluentui/react-link_v9.0.30)
8
23
 
9
- Thu, 16 Mar 2023 14:33:33 GMT
24
+ Thu, 16 Mar 2023 14:36:59 GMT
10
25
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-link_v9.0.29..@fluentui/react-link_v9.0.30)
11
26
 
12
27
  ### Patches
package/lib/Link.js.map CHANGED
@@ -1 +1 @@
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
+ {"version":3,"names":[],"sources":["../src/Link.ts"],"sourcesContent":["export * from './components/Link/index';\n"],"mappings":"AAAA,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"names":["React","useLink_unstable","useLinkStyles_unstable","renderLink_unstable","Link","forwardRef","props","ref","state","displayName"],"sources":["../src/packages/react-components/react-link/src/components/Link/Link.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useLink_unstable } from './useLink';\nimport { useLinkStyles_unstable } from './useLinkStyles';\nimport { renderLink_unstable } from './renderLink';\nimport type { LinkProps } from './Link.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * A Link is a reference to data that a user can follow by clicking or tapping it.\n */\nexport const Link: ForwardRefComponent<LinkProps> = React.forwardRef((props, ref) => {\n const state = useLink_unstable(props, ref);\n\n useLinkStyles_unstable(state);\n\n return renderLink_unstable(state);\n // Work around some small mismatches in inferred types which don't matter in practice\n}) as ForwardRefComponent<LinkProps>;\n\nLink.displayName = 'Link';\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,gBAAgB,QAAQ,WAAW;AAC5C,SAASC,sBAAsB,QAAQ,iBAAiB;AACxD,SAASC,mBAAmB,QAAQ,cAAc;AAIlD;;;AAGA,OAAO,MAAMC,IAAI,gBAAmCJ,KAAK,CAACK,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EAClF,MAAMC,KAAK,GAAGP,gBAAgB,CAACK,KAAK,EAAEC,GAAG,CAAC;EAE1CL,sBAAsB,CAACM,KAAK,CAAC;EAE7B,OAAOL,mBAAmB,CAACK,KAAK,CAAC;EACjC;AACF,CAAC,CAAmC;;AAEpCJ,IAAI,CAACK,WAAW,GAAG,MAAM"}
1
+ {"version":3,"names":["React","useLink_unstable","useLinkStyles_unstable","renderLink_unstable","Link","forwardRef","props","ref","state","displayName"],"sources":["../../../src/components/Link/Link.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useLink_unstable } from './useLink';\nimport { useLinkStyles_unstable } from './useLinkStyles';\nimport { renderLink_unstable } from './renderLink';\nimport type { LinkProps } from './Link.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * A Link is a reference to data that a user can follow by clicking or tapping it.\n */\nexport const Link: ForwardRefComponent<LinkProps> = React.forwardRef((props, ref) => {\n const state = useLink_unstable(props, ref);\n\n useLinkStyles_unstable(state);\n\n return renderLink_unstable(state);\n // Work around some small mismatches in inferred types which don't matter in practice\n}) as ForwardRefComponent<LinkProps>;\n\nLink.displayName = 'Link';\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,gBAAgB,QAAQ;AACjC,SAASC,sBAAsB,QAAQ;AACvC,SAASC,mBAAmB,QAAQ;AAIpC;;;AAGA,OAAO,MAAMC,IAAA,gBAAuCJ,KAAA,CAAMK,UAAU,CAAC,CAACC,KAAA,EAAOC,GAAA,KAAQ;EACnF,MAAMC,KAAA,GAAQP,gBAAA,CAAiBK,KAAA,EAAOC,GAAA;EAEtCL,sBAAA,CAAuBM,KAAA;EAEvB,OAAOL,mBAAA,CAAoBK,KAAA;EAC3B;AACF;;AAEAJ,IAAA,CAAKK,WAAW,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"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
+ {"version":3,"names":[],"sources":["../../../src/components/Link/Link.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type LinkSlots = {\n /**\n * Root of the component that renders as either an <a> or a <button> tag.\n */\n root: Slot<'a', 'button'>;\n};\n\nexport type LinkProps = ComponentProps<LinkSlots> & {\n /**\n * A link can appear either with its default style or subtle.\n * If not specified, the link appears with its default styling.\n * @default 'default'\n */\n appearance?: 'default' | 'subtle';\n\n /**\n * Whether the link is disabled.\n * @default false\n */\n disabled?: boolean;\n\n /**\n * When set, allows the link to be focusable even when it has been disabled. This is used in scenarios where it is\n * important to keep a consistent tab order for screen reader and keyboard users.\n * @default false\n */\n disabledFocusable?: boolean;\n\n /**\n * If true, changes styling when the link is being used alongside other text content.\n * @default false\n */\n inline?: boolean;\n};\n\nexport type LinkState = ComponentState<LinkSlots> &\n Required<Pick<LinkProps, 'appearance' | 'disabled' | 'disabledFocusable' | 'inline'>>;\n"],"mappings":"AAAA"}
@@ -1 +1 @@
1
- {"version":3,"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
+ {"version":3,"names":[],"sources":["../../../src/components/Link/index.ts"],"sourcesContent":["export * from './Link';\nexport * from './Link.types';\nexport * from './renderLink';\nexport * from './useLink';\nexport * from './useLinkState';\nexport * from './useLinkStyles';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc"}
@@ -8,8 +8,6 @@ export const renderLink_unstable = state => {
8
8
  slots,
9
9
  slotProps
10
10
  } = getSlots(state);
11
- return /*#__PURE__*/React.createElement(slots.root, {
12
- ...slotProps.root
13
- });
11
+ return /*#__PURE__*/React.createElement(slots.root, slotProps.root);
14
12
  };
15
13
  //# sourceMappingURL=renderLink.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","getSlots","renderLink_unstable","state","slots","slotProps","createElement","root"],"sources":["../src/packages/react-components/react-link/src/components/Link/renderLink.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { LinkSlots, LinkState } from './Link.types';\n\n/**\n * Renders a Link component by passing the state defined props to the appropriate slots.\n */\nexport const renderLink_unstable = (state: LinkState) => {\n const { slots, slotProps } = getSlots<LinkSlots>(state);\n\n return <slots.root {...slotProps.root} />;\n};\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,QAAQ,2BAA2B;AAGpD;;;AAGA,OAAO,MAAMC,mBAAmB,GAAIC,KAAgB,IAAI;EACtD,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGJ,QAAQ,CAAYE,KAAK,CAAC;EAEvD,oBAAOH,KAAA,CAAAM,aAAA,CAACF,KAAK,CAACG,IAAI;IAAA,GAAKF,SAAS,CAACE;EAAI,EAAI;AAC3C,CAAC"}
1
+ {"version":3,"names":["React","getSlots","renderLink_unstable","state","slots","slotProps","createElement","root"],"sources":["../../../src/components/Link/renderLink.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { LinkSlots, LinkState } from './Link.types';\n\n/**\n * Renders a Link component by passing the state defined props to the appropriate slots.\n */\nexport const renderLink_unstable = (state: LinkState) => {\n const { slots, slotProps } = getSlots<LinkSlots>(state);\n\n return <slots.root {...slotProps.root} />;\n};\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,QAAQ,QAAQ;AAGzB;;;AAGA,OAAO,MAAMC,mBAAA,GAAuBC,KAAA,IAAqB;EACvD,MAAM;IAAEC,KAAA;IAAOC;EAAS,CAAE,GAAGJ,QAAA,CAAoBE,KAAA;EAEjD,oBAAOH,KAAA,CAAAM,aAAA,CAACF,KAAA,CAAMG,IAAI,EAAKF,SAAA,CAAUE,IAAI;AACvC"}
@@ -1,3 +1,4 @@
1
+ import * as React from 'react';
1
2
  import { getNativeElementProps } from '@fluentui/react-utilities';
2
3
  import { useLinkState_unstable } from './useLinkState';
3
4
  /**
@@ -1 +1 @@
1
- {"version":3,"names":["getNativeElementProps","useLinkState_unstable","useLink_unstable","props","ref","appearance","disabled","disabledFocusable","inline","as","href","type","undefined","state","components","root"],"sources":["../src/packages/react-components/react-link/src/components/Link/useLink.ts"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport { useLinkState_unstable } from './useLinkState';\nimport type { LinkProps, LinkState } from './Link.types';\n\n/**\n * Given user props, defines default props for the Link, calls useLinkState_unstable, and returns processed state.\n * @param props - User provided props to the Link component.\n * @param ref - User provided ref to be passed to the Link component.\n */\nexport const useLink_unstable = (\n props: LinkProps,\n ref: React.Ref<HTMLAnchorElement | HTMLButtonElement>,\n): LinkState => {\n const { appearance = 'default', disabled = false, disabledFocusable = false, inline = false } = props;\n const as = props.as || (props.href ? 'a' : 'button');\n const type = as === 'button' ? 'button' : undefined;\n\n const state: LinkState = {\n // Props passed at the top-level\n appearance,\n disabled,\n disabledFocusable,\n inline,\n\n // Slots definition\n components: {\n root: 'a',\n },\n\n root: getNativeElementProps(as, {\n ref,\n type,\n ...props,\n as,\n }),\n };\n\n useLinkState_unstable(state);\n\n return state;\n};\n"],"mappings":"AACA,SAASA,qBAAqB,QAAQ,2BAA2B;AACjE,SAASC,qBAAqB,QAAQ,gBAAgB;AAGtD;;;;;AAKA,OAAO,MAAMC,gBAAgB,GAAGA,CAC9BC,KAAgB,EAChBC,GAAqD,KACxC;EACb,MAAM;IAAEC,UAAU,GAAG,SAAS;IAAEC,QAAQ,GAAG,KAAK;IAAEC,iBAAiB,GAAG,KAAK;IAAEC,MAAM,GAAG;EAAK,CAAE,GAAGL,KAAK;EACrG,MAAMM,EAAE,GAAGN,KAAK,CAACM,EAAE,KAAKN,KAAK,CAACO,IAAI,GAAG,GAAG,GAAG,QAAQ,CAAC;EACpD,MAAMC,IAAI,GAAGF,EAAE,KAAK,QAAQ,GAAG,QAAQ,GAAGG,SAAS;EAEnD,MAAMC,KAAK,GAAc;IACvB;IACAR,UAAU;IACVC,QAAQ;IACRC,iBAAiB;IACjBC,MAAM;IAEN;IACAM,UAAU,EAAE;MACVC,IAAI,EAAE;KACP;IAEDA,IAAI,EAAEf,qBAAqB,CAACS,EAAE,EAAE;MAC9BL,GAAG;MACHO,IAAI;MACJ,GAAGR,KAAK;MACRM;KACD;GACF;EAEDR,qBAAqB,CAACY,KAAK,CAAC;EAE5B,OAAOA,KAAK;AACd,CAAC"}
1
+ {"version":3,"names":["React","getNativeElementProps","useLinkState_unstable","useLink_unstable","props","ref","appearance","disabled","disabledFocusable","inline","as","href","type","undefined","state","components","root"],"sources":["../../../src/components/Link/useLink.ts"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport { useLinkState_unstable } from './useLinkState';\nimport type { LinkProps, LinkState } from './Link.types';\n\n/**\n * Given user props, defines default props for the Link, calls useLinkState_unstable, and returns processed state.\n * @param props - User provided props to the Link component.\n * @param ref - User provided ref to be passed to the Link component.\n */\nexport const useLink_unstable = (\n props: LinkProps,\n ref: React.Ref<HTMLAnchorElement | HTMLButtonElement>,\n): LinkState => {\n const { appearance = 'default', disabled = false, disabledFocusable = false, inline = false } = props;\n const as = props.as || (props.href ? 'a' : 'button');\n const type = as === 'button' ? 'button' : undefined;\n\n const state: LinkState = {\n // Props passed at the top-level\n appearance,\n disabled,\n disabledFocusable,\n inline,\n\n // Slots definition\n components: {\n root: 'a',\n },\n\n root: getNativeElementProps(as, {\n ref,\n type,\n ...props,\n as,\n }),\n };\n\n useLinkState_unstable(state);\n\n return state;\n};\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,qBAAqB,QAAQ;AACtC,SAASC,qBAAqB,QAAQ;AAGtC;;;;;AAKA,OAAO,MAAMC,gBAAA,GAAmBA,CAC9BC,KAAA,EACAC,GAAA,KACc;EACd,MAAM;IAAEC,UAAA,GAAa;IAAWC,QAAA,GAAW,KAAK;IAAEC,iBAAA,GAAoB,KAAK;IAAEC,MAAA,GAAS;EAAK,CAAE,GAAGL,KAAA;EAChG,MAAMM,EAAA,GAAKN,KAAA,CAAMM,EAAE,KAAKN,KAAA,CAAMO,IAAI,GAAG,MAAM,QAAQ,CAAD;EAClD,MAAMC,IAAA,GAAOF,EAAA,KAAO,WAAW,WAAWG,SAAS;EAEnD,MAAMC,KAAA,GAAmB;IACvB;IACAR,UAAA;IACAC,QAAA;IACAC,iBAAA;IACAC,MAAA;IAEA;IACAM,UAAA,EAAY;MACVC,IAAA,EAAM;IACR;IAEAA,IAAA,EAAMf,qBAAA,CAAsBS,EAAA,EAAI;MAC9BL,GAAA;MACAO,IAAA;MACA,GAAGR,KAAK;MACRM;IACF;EACF;EAEAR,qBAAA,CAAsBY,KAAA;EAEtB,OAAOA,KAAA;AACT"}
@@ -1,3 +1,4 @@
1
+ import * as React from 'react';
1
2
  import { Enter, Space } from '@fluentui/keyboard-keys';
2
3
  /**
3
4
  * The useLinkState_unstable hook processes the Link state.
@@ -23,9 +24,7 @@ export const useLinkState_unstable = state => {
23
24
  if (disabled || disabledFocusable) {
24
25
  state.root.role = role || 'link';
25
26
  }
26
- }
27
- // Add type="button" for button elements.
28
- else {
27
+ } else {
29
28
  state.root.type = type || 'button';
30
29
  }
31
30
  // Disallow click event when component is disabled and eat events when disabledFocusable is set to true.
@@ -1 +1 @@
1
- {"version":3,"names":["Enter","Space","useLinkState_unstable","state","disabled","disabledFocusable","onClick","onKeyDown","role","tabIndex","type","root","as","href","undefined","ev","preventDefault","key","stopPropagation"],"sources":["../src/packages/react-components/react-link/src/components/Link/useLinkState.ts"],"sourcesContent":["import * as React from 'react';\nimport { Enter, Space } from '@fluentui/keyboard-keys';\nimport type { LinkState } from './Link.types';\n\n/**\n * The useLinkState_unstable hook processes the Link state.\n * @param state - Link state to mutate.\n */\nexport const useLinkState_unstable = (state: LinkState): LinkState => {\n const { disabled, disabledFocusable } = state;\n const { onClick, onKeyDown, role, tabIndex, type } = state.root;\n\n // Add href and tabIndex=0 for anchor elements.\n if (state.root.as === 'a') {\n state.root.href = disabled ? undefined : state.root.href;\n state.root.tabIndex = tabIndex ?? (disabled && !disabledFocusable ? undefined : 0);\n\n // Add role=\"link\" for disabled and disabledFocusable links.\n if (disabled || disabledFocusable) {\n state.root.role = role || 'link';\n }\n }\n // Add type=\"button\" for button elements.\n else {\n state.root.type = type || 'button';\n }\n\n // Disallow click event when component is disabled and eat events when disabledFocusable is set to true.\n state.root.onClick = (ev: React.MouseEvent<HTMLAnchorElement & HTMLButtonElement>) => {\n if (disabled || disabledFocusable) {\n ev.preventDefault();\n } else {\n onClick?.(ev);\n }\n };\n\n // Disallow keydown event when component is disabled and eat events when disabledFocusable is set to true.\n state.root.onKeyDown = (ev: React.KeyboardEvent<HTMLAnchorElement & HTMLButtonElement>) => {\n if ((disabled || disabledFocusable) && (ev.key === Enter || ev.key === Space)) {\n ev.preventDefault();\n ev.stopPropagation();\n } else {\n onKeyDown?.(ev);\n }\n };\n\n // Set the aria-disabled and disabled props correctly.\n state.disabled = disabled || disabledFocusable;\n state.root['aria-disabled'] = disabled || disabledFocusable || undefined;\n if (state.root.as === 'button') {\n state.root.disabled = disabled && !disabledFocusable;\n }\n\n return state;\n};\n"],"mappings":"AACA,SAASA,KAAK,EAAEC,KAAK,QAAQ,yBAAyB;AAGtD;;;;AAIA,OAAO,MAAMC,qBAAqB,GAAIC,KAAgB,IAAe;EACnE,MAAM;IAAEC,QAAQ;IAAEC;EAAiB,CAAE,GAAGF,KAAK;EAC7C,MAAM;IAAEG,OAAO;IAAEC,SAAS;IAAEC,IAAI;IAAEC,QAAQ;IAAEC;EAAI,CAAE,GAAGP,KAAK,CAACQ,IAAI;EAE/D;EACA,IAAIR,KAAK,CAACQ,IAAI,CAACC,EAAE,KAAK,GAAG,EAAE;IACzBT,KAAK,CAACQ,IAAI,CAACE,IAAI,GAAGT,QAAQ,GAAGU,SAAS,GAAGX,KAAK,CAACQ,IAAI,CAACE,IAAI;IACxDV,KAAK,CAACQ,IAAI,CAACF,QAAQ,GAAGA,QAAQ,aAARA,QAAQ,cAARA,QAAQ,GAAKL,QAAQ,IAAI,CAACC,iBAAiB,GAAGS,SAAS,GAAG,CAAE;IAElF;IACA,IAAIV,QAAQ,IAAIC,iBAAiB,EAAE;MACjCF,KAAK,CAACQ,IAAI,CAACH,IAAI,GAAGA,IAAI,IAAI,MAAM;;;EAGpC;EAAA,KACK;IACHL,KAAK,CAACQ,IAAI,CAACD,IAAI,GAAGA,IAAI,IAAI,QAAQ;;EAGpC;EACAP,KAAK,CAACQ,IAAI,CAACL,OAAO,GAAIS,EAA2D,IAAI;IACnF,IAAIX,QAAQ,IAAIC,iBAAiB,EAAE;MACjCU,EAAE,CAACC,cAAc,EAAE;KACpB,MAAM;MACLV,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAGS,EAAE,CAAC;;EAEjB,CAAC;EAED;EACAZ,KAAK,CAACQ,IAAI,CAACJ,SAAS,GAAIQ,EAA8D,IAAI;IACxF,IAAI,CAACX,QAAQ,IAAIC,iBAAiB,MAAMU,EAAE,CAACE,GAAG,KAAKjB,KAAK,IAAIe,EAAE,CAACE,GAAG,KAAKhB,KAAK,CAAC,EAAE;MAC7Ec,EAAE,CAACC,cAAc,EAAE;MACnBD,EAAE,CAACG,eAAe,EAAE;KACrB,MAAM;MACLX,SAAS,aAATA,SAAS,uBAATA,SAAS,CAAGQ,EAAE,CAAC;;EAEnB,CAAC;EAED;EACAZ,KAAK,CAACC,QAAQ,GAAGA,QAAQ,IAAIC,iBAAiB;EAC9CF,KAAK,CAACQ,IAAI,CAAC,eAAe,CAAC,GAAGP,QAAQ,IAAIC,iBAAiB,IAAIS,SAAS;EACxE,IAAIX,KAAK,CAACQ,IAAI,CAACC,EAAE,KAAK,QAAQ,EAAE;IAC9BT,KAAK,CAACQ,IAAI,CAACP,QAAQ,GAAGA,QAAQ,IAAI,CAACC,iBAAiB;;EAGtD,OAAOF,KAAK;AACd,CAAC"}
1
+ {"version":3,"names":["React","Enter","Space","useLinkState_unstable","state","disabled","disabledFocusable","onClick","onKeyDown","role","tabIndex","type","root","as","href","undefined","ev","preventDefault","key","stopPropagation"],"sources":["../../../src/components/Link/useLinkState.ts"],"sourcesContent":["import * as React from 'react';\nimport { Enter, Space } from '@fluentui/keyboard-keys';\nimport type { LinkState } from './Link.types';\n\n/**\n * The useLinkState_unstable hook processes the Link state.\n * @param state - Link state to mutate.\n */\nexport const useLinkState_unstable = (state: LinkState): LinkState => {\n const { disabled, disabledFocusable } = state;\n const { onClick, onKeyDown, role, tabIndex, type } = state.root;\n\n // Add href and tabIndex=0 for anchor elements.\n if (state.root.as === 'a') {\n state.root.href = disabled ? undefined : state.root.href;\n state.root.tabIndex = tabIndex ?? (disabled && !disabledFocusable ? undefined : 0);\n\n // Add role=\"link\" for disabled and disabledFocusable links.\n if (disabled || disabledFocusable) {\n state.root.role = role || 'link';\n }\n }\n // Add type=\"button\" for button elements.\n else {\n state.root.type = type || 'button';\n }\n\n // Disallow click event when component is disabled and eat events when disabledFocusable is set to true.\n state.root.onClick = (ev: React.MouseEvent<HTMLAnchorElement & HTMLButtonElement>) => {\n if (disabled || disabledFocusable) {\n ev.preventDefault();\n } else {\n onClick?.(ev);\n }\n };\n\n // Disallow keydown event when component is disabled and eat events when disabledFocusable is set to true.\n state.root.onKeyDown = (ev: React.KeyboardEvent<HTMLAnchorElement & HTMLButtonElement>) => {\n if ((disabled || disabledFocusable) && (ev.key === Enter || ev.key === Space)) {\n ev.preventDefault();\n ev.stopPropagation();\n } else {\n onKeyDown?.(ev);\n }\n };\n\n // Set the aria-disabled and disabled props correctly.\n state.disabled = disabled || disabledFocusable;\n state.root['aria-disabled'] = disabled || disabledFocusable || undefined;\n if (state.root.as === 'button') {\n state.root.disabled = disabled && !disabledFocusable;\n }\n\n return state;\n};\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,KAAK,EAAEC,KAAK,QAAQ;AAG7B;;;;AAIA,OAAO,MAAMC,qBAAA,GAAyBC,KAAA,IAAgC;EACpE,MAAM;IAAEC,QAAA;IAAUC;EAAiB,CAAE,GAAGF,KAAA;EACxC,MAAM;IAAEG,OAAA;IAASC,SAAA;IAAWC,IAAA;IAAMC,QAAA;IAAUC;EAAI,CAAE,GAAGP,KAAA,CAAMQ,IAAI;EAE/D;EACA,IAAIR,KAAA,CAAMQ,IAAI,CAACC,EAAE,KAAK,KAAK;IACzBT,KAAA,CAAMQ,IAAI,CAACE,IAAI,GAAGT,QAAA,GAAWU,SAAA,GAAYX,KAAA,CAAMQ,IAAI,CAACE,IAAI;IACxDV,KAAA,CAAMQ,IAAI,CAACF,QAAQ,GAAGA,QAAA,aAAAA,QAAA,cAAAA,QAAA,GAAaL,QAAA,IAAY,CAACC,iBAAA,GAAoBS,SAAA,GAAY,CAAC;IAEjF;IACA,IAAIV,QAAA,IAAYC,iBAAA,EAAmB;MACjCF,KAAA,CAAMQ,IAAI,CAACH,IAAI,GAAGA,IAAA,IAAQ;IAC5B;EACF,OAEK;IACHL,KAAA,CAAMQ,IAAI,CAACD,IAAI,GAAGA,IAAA,IAAQ;EAC5B;EAEA;EACAP,KAAA,CAAMQ,IAAI,CAACL,OAAO,GAAIS,EAAA,IAAgE;IACpF,IAAIX,QAAA,IAAYC,iBAAA,EAAmB;MACjCU,EAAA,CAAGC,cAAc;IACnB,OAAO;MACLV,OAAA,aAAAA,OAAA,uBAAAA,OAAA,CAAUS,EAAA;IACZ;EACF;EAEA;EACAZ,KAAA,CAAMQ,IAAI,CAACJ,SAAS,GAAIQ,EAAA,IAAmE;IACzF,IAAI,CAACX,QAAA,IAAYC,iBAAgB,MAAOU,EAAA,CAAGE,GAAG,KAAKjB,KAAA,IAASe,EAAA,CAAGE,GAAG,KAAKhB,KAAI,GAAI;MAC7Ec,EAAA,CAAGC,cAAc;MACjBD,EAAA,CAAGG,eAAe;IACpB,OAAO;MACLX,SAAA,aAAAA,SAAA,uBAAAA,SAAA,CAAYQ,EAAA;IACd;EACF;EAEA;EACAZ,KAAA,CAAMC,QAAQ,GAAGA,QAAA,IAAYC,iBAAA;EAC7BF,KAAA,CAAMQ,IAAI,CAAC,gBAAgB,GAAGP,QAAA,IAAYC,iBAAA,IAAqBS,SAAA;EAC/D,IAAIX,KAAA,CAAMQ,IAAI,CAACC,EAAE,KAAK,UAAU;IAC9BT,KAAA,CAAMQ,IAAI,CAACP,QAAQ,GAAGA,QAAA,IAAY,CAACC,iBAAA;EACrC;EAEA,OAAOF,KAAA;AACT"}
@@ -1 +1 @@
1
- {"version":3,"names":["shorthands","__styles","mergeClasses","createCustomFocusIndicatorStyle","tokens","linkClassNames","root","useStyles","focusIndicator","Brovlpu","B486eqv","Bttzg6e","B3uz8dt","B6ihwck","De3pzq","B7ck84d","sj55zd","Bceei9c","mc9l5x","Bahqtrf","Be2twd7","Bhrd7zp","B6of3ja","t21cq0","jrapky","Frg6f3","z8tnut","z189sj","Byoj8tv","uwmqm3","B68tc82","Bmxbyg5","fsow6f","w71qe1","Bkioxbp","ygn44y","famaaq","Bde5pd6","Bi91k9c","i089h6","lj723h","button","icvyot","vrafjx","oivjwe","wvpqe5","href","subtle","inline","disabled","f","i","d","h","a","useLinkStyles_unstable","state","styles","appearance","className","as"],"sources":["../src/packages/react-components/react-link/src/components/Link/useLinkStyles.ts"],"sourcesContent":["import { shorthands, makeStyles, mergeClasses } from '@griffel/react';\nimport { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\nimport { tokens } from '@fluentui/react-theme';\nimport type { LinkSlots, LinkState } from './Link.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const linkClassNames: SlotClassNames<LinkSlots> = {\n root: 'fui-Link',\n};\n\nconst useStyles = makeStyles({\n focusIndicator: createCustomFocusIndicatorStyle({\n textDecorationColor: tokens.colorStrokeFocus2,\n textDecorationLine: 'underline',\n textDecorationStyle: 'double',\n }),\n // Common styles.\n root: {\n backgroundColor: 'transparent',\n boxSizing: 'border-box',\n color: tokens.colorBrandForegroundLink,\n cursor: 'pointer',\n display: 'inline',\n fontFamily: tokens.fontFamilyBase,\n fontSize: tokens.fontSizeBase300,\n fontWeight: tokens.fontWeightRegular,\n ...shorthands.margin(0),\n ...shorthands.padding(0),\n ...shorthands.overflow('inherit'),\n textAlign: 'left',\n textDecorationLine: 'none',\n textDecorationThickness: tokens.strokeWidthThin,\n textOverflow: 'inherit',\n userSelect: 'text',\n\n ':hover': {\n textDecorationLine: 'underline',\n color: tokens.colorBrandForegroundLinkHover,\n },\n\n ':active': {\n textDecorationLine: 'underline',\n color: tokens.colorBrandForegroundLinkPressed,\n },\n },\n // Overrides when the Link renders as a button.\n button: {\n ...shorthands.borderStyle('none'),\n },\n // Overrides when an href is present so the Link renders as an anchor.\n href: {\n fontSize: 'inherit',\n },\n // Overrides when the Link appears subtle.\n subtle: {\n color: tokens.colorNeutralForeground2,\n\n ':hover': {\n textDecorationLine: 'underline',\n color: tokens.colorNeutralForeground2Hover,\n },\n\n ':active': {\n textDecorationLine: 'underline',\n color: tokens.colorNeutralForeground2Pressed,\n },\n },\n // Overrides when the Link is rendered inline within text.\n inline: {\n textDecorationLine: 'underline',\n },\n // Overrides when the Link is disabled.\n disabled: {\n textDecorationLine: 'none',\n color: tokens.colorNeutralForegroundDisabled,\n cursor: 'not-allowed',\n\n ':hover': {\n textDecorationLine: 'none',\n color: tokens.colorNeutralForegroundDisabled,\n },\n\n ':active': {\n textDecorationLine: 'none',\n color: tokens.colorNeutralForegroundDisabled,\n },\n },\n});\n\nexport const useLinkStyles_unstable = (state: LinkState): LinkState => {\n const styles = useStyles();\n const { appearance, disabled, inline, root } = state;\n\n state.root.className = mergeClasses(\n linkClassNames.root,\n styles.root,\n styles.focusIndicator,\n root.as === 'a' && root.href && styles.href,\n root.as === 'button' && styles.button,\n appearance === 'subtle' && styles.subtle,\n inline && styles.inline,\n disabled && styles.disabled,\n state.root.className,\n );\n\n return state;\n};\n"],"mappings":"AAAA,SAASA,UAAU,EAAAC,QAAA,EAAcC,YAAY,QAAQ,gBAAgB;AACrE,SAASC,+BAA+B,QAAQ,yBAAyB;AACzE,SAASC,MAAM,QAAQ,uBAAuB;AAI9C,OAAO,MAAMC,cAAc,GAA8B;EACvDC,IAAI,EAAE;CACP;AAED,MAAMC,SAAS,gBAAGN,QAAA;EAAAO,cAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;EAAA;EAAAP,IAAA;IAAAQ,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;EAAA;EAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;EAAA;EAAAC,IAAA;IAAA1B,OAAA;EAAA;EAAA2B,MAAA;IAAA/B,MAAA;IAAAqB,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;EAAA;EAAAQ,MAAA;IAAAf,MAAA;EAAA;EAAAgB,QAAA;IAAAhB,MAAA;IAAAjB,MAAA;IAAAC,OAAA;IAAAoB,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;EAAA;AAAA;EAAAU,CAAA;EAAAC,CAAA;EAAAC,CAAA;EAAAC,CAAA;EAAAC,CAAA;AAAA,EA6EhB;AAEF,OAAO,MAAMC,sBAAsB,GAAIC,KAAgB,IAAe;EACpE,MAAMC,MAAM,GAAGlD,SAAS,EAAE;EAC1B,MAAM;IAAEmD,UAAU;IAAET,QAAQ;IAAED,MAAM;IAAE1C;EAAI,CAAE,GAAGkD,KAAK;EAEpDA,KAAK,CAAClD,IAAI,CAACqD,SAAS,GAAGzD,YAAY,CACjCG,cAAc,CAACC,IAAI,EACnBmD,MAAM,CAACnD,IAAI,EACXmD,MAAM,CAACjD,cAAc,EACrBF,IAAI,CAACsD,EAAE,KAAK,GAAG,IAAItD,IAAI,CAACwC,IAAI,IAAIW,MAAM,CAACX,IAAI,EAC3CxC,IAAI,CAACsD,EAAE,KAAK,QAAQ,IAAIH,MAAM,CAAChB,MAAM,EACrCiB,UAAU,KAAK,QAAQ,IAAID,MAAM,CAACV,MAAM,EACxCC,MAAM,IAAIS,MAAM,CAACT,MAAM,EACvBC,QAAQ,IAAIQ,MAAM,CAACR,QAAQ,EAC3BO,KAAK,CAAClD,IAAI,CAACqD,SAAS,CACrB;EAED,OAAOH,KAAK;AACd,CAAC"}
1
+ {"version":3,"names":["shorthands","__styles","mergeClasses","createCustomFocusIndicatorStyle","tokens","linkClassNames","root","useStyles","focusIndicator","Brovlpu","B486eqv","Bttzg6e","B3uz8dt","B6ihwck","De3pzq","B7ck84d","sj55zd","Bceei9c","mc9l5x","Bahqtrf","Be2twd7","Bhrd7zp","B6of3ja","t21cq0","jrapky","Frg6f3","z8tnut","z189sj","Byoj8tv","uwmqm3","B68tc82","Bmxbyg5","fsow6f","w71qe1","Bkioxbp","ygn44y","famaaq","Bde5pd6","Bi91k9c","i089h6","lj723h","button","icvyot","vrafjx","oivjwe","wvpqe5","href","subtle","inline","disabled","f","i","d","h","a","useLinkStyles_unstable","state","styles","appearance","className","as"],"sources":["../../../src/components/Link/useLinkStyles.ts"],"sourcesContent":["import { shorthands, makeStyles, mergeClasses } from '@griffel/react';\nimport { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\nimport { tokens } from '@fluentui/react-theme';\nimport type { LinkSlots, LinkState } from './Link.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const linkClassNames: SlotClassNames<LinkSlots> = {\n root: 'fui-Link',\n};\n\nconst useStyles = makeStyles({\n focusIndicator: createCustomFocusIndicatorStyle({\n textDecorationColor: tokens.colorStrokeFocus2,\n textDecorationLine: 'underline',\n textDecorationStyle: 'double',\n }),\n // Common styles.\n root: {\n backgroundColor: 'transparent',\n boxSizing: 'border-box',\n color: tokens.colorBrandForegroundLink,\n cursor: 'pointer',\n display: 'inline',\n fontFamily: tokens.fontFamilyBase,\n fontSize: tokens.fontSizeBase300,\n fontWeight: tokens.fontWeightRegular,\n ...shorthands.margin(0),\n ...shorthands.padding(0),\n ...shorthands.overflow('inherit'),\n textAlign: 'left',\n textDecorationLine: 'none',\n textDecorationThickness: tokens.strokeWidthThin,\n textOverflow: 'inherit',\n userSelect: 'text',\n\n ':hover': {\n textDecorationLine: 'underline',\n color: tokens.colorBrandForegroundLinkHover,\n },\n\n ':active': {\n textDecorationLine: 'underline',\n color: tokens.colorBrandForegroundLinkPressed,\n },\n },\n // Overrides when the Link renders as a button.\n button: {\n ...shorthands.borderStyle('none'),\n },\n // Overrides when an href is present so the Link renders as an anchor.\n href: {\n fontSize: 'inherit',\n },\n // Overrides when the Link appears subtle.\n subtle: {\n color: tokens.colorNeutralForeground2,\n\n ':hover': {\n textDecorationLine: 'underline',\n color: tokens.colorNeutralForeground2Hover,\n },\n\n ':active': {\n textDecorationLine: 'underline',\n color: tokens.colorNeutralForeground2Pressed,\n },\n },\n // Overrides when the Link is rendered inline within text.\n inline: {\n textDecorationLine: 'underline',\n },\n // Overrides when the Link is disabled.\n disabled: {\n textDecorationLine: 'none',\n color: tokens.colorNeutralForegroundDisabled,\n cursor: 'not-allowed',\n\n ':hover': {\n textDecorationLine: 'none',\n color: tokens.colorNeutralForegroundDisabled,\n },\n\n ':active': {\n textDecorationLine: 'none',\n color: tokens.colorNeutralForegroundDisabled,\n },\n },\n});\n\nexport const useLinkStyles_unstable = (state: LinkState): LinkState => {\n const styles = useStyles();\n const { appearance, disabled, inline, root } = state;\n\n state.root.className = mergeClasses(\n linkClassNames.root,\n styles.root,\n styles.focusIndicator,\n root.as === 'a' && root.href && styles.href,\n root.as === 'button' && styles.button,\n appearance === 'subtle' && styles.subtle,\n inline && styles.inline,\n disabled && styles.disabled,\n state.root.className,\n );\n\n return state;\n};\n"],"mappings":"AAAA,SAASA,UAAU,EAAAC,QAAA,EAAcC,YAAY,QAAQ;AACrD,SAASC,+BAA+B,QAAQ;AAChD,SAASC,MAAM,QAAQ;AAIvB,OAAO,MAAMC,cAAA,GAA4C;EACvDC,IAAA,EAAM;AACR;AAEA,MAAMC,SAAA,gBAAYN,QAAA;EAAAO,cAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;EAAA;EAAAP,IAAA;IAAAQ,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;EAAA;EAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;EAAA;EAAAC,IAAA;IAAA1B,OAAA;EAAA;EAAA2B,MAAA;IAAA/B,MAAA;IAAAqB,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;EAAA;EAAAQ,MAAA;IAAAf,MAAA;EAAA;EAAAgB,QAAA;IAAAhB,MAAA;IAAAjB,MAAA;IAAAC,OAAA;IAAAoB,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;EAAA;AAAA;EAAAU,CAAA;EAAAC,CAAA;EAAAC,CAAA;EAAAC,CAAA;EAAAC,CAAA;AAAA,EA6ElB;AAEA,OAAO,MAAMC,sBAAA,GAA0BC,KAAA,IAAgC;EACrE,MAAMC,MAAA,GAASlD,SAAA;EACf,MAAM;IAAEmD,UAAA;IAAYT,QAAA;IAAUD,MAAA;IAAQ1C;EAAI,CAAE,GAAGkD,KAAA;EAE/CA,KAAA,CAAMlD,IAAI,CAACqD,SAAS,GAAGzD,YAAA,CACrBG,cAAA,CAAeC,IAAI,EACnBmD,MAAA,CAAOnD,IAAI,EACXmD,MAAA,CAAOjD,cAAc,EACrBF,IAAA,CAAKsD,EAAE,KAAK,OAAOtD,IAAA,CAAKwC,IAAI,IAAIW,MAAA,CAAOX,IAAI,EAC3CxC,IAAA,CAAKsD,EAAE,KAAK,YAAYH,MAAA,CAAOhB,MAAM,EACrCiB,UAAA,KAAe,YAAYD,MAAA,CAAOV,MAAM,EACxCC,MAAA,IAAUS,MAAA,CAAOT,MAAM,EACvBC,QAAA,IAAYQ,MAAA,CAAOR,QAAQ,EAC3BO,KAAA,CAAMlD,IAAI,CAACqD,SAAS;EAGtB,OAAOH,KAAA;AACT"}
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["Link","linkClassNames","renderLink_unstable","useLinkState_unstable","useLinkStyles_unstable","useLink_unstable"],"sources":["../src/packages/react-components/react-link/src/index.ts"],"sourcesContent":["export {\n Link,\n linkClassNames,\n renderLink_unstable,\n useLinkState_unstable,\n useLinkStyles_unstable,\n useLink_unstable,\n} from './Link';\nexport type { LinkProps, LinkSlots, LinkState } from './Link';\n"],"mappings":"AAAA,SACEA,IAAI,EACJC,cAAc,EACdC,mBAAmB,EACnBC,qBAAqB,EACrBC,sBAAsB,EACtBC,gBAAgB,QACX,QAAQ"}
1
+ {"version":3,"names":["Link","linkClassNames","renderLink_unstable","useLinkState_unstable","useLinkStyles_unstable","useLink_unstable"],"sources":["../src/index.ts"],"sourcesContent":["export {\n Link,\n linkClassNames,\n renderLink_unstable,\n useLinkState_unstable,\n useLinkStyles_unstable,\n useLink_unstable,\n} from './Link';\nexport type { LinkProps, LinkSlots, LinkState } from './Link';\n"],"mappings":"AAAA,SACEA,IAAI,EACJC,cAAc,EACdC,mBAAmB,EACnBC,qBAAqB,EACrBC,sBAAsB,EACtBC,gBAAgB,QACX"}
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
6
- const tslib_1 = /*#__PURE__*/require("tslib");
7
- tslib_1.__exportStar(require("./components/Link/index"), exports);
5
+ const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
+ _exportStar(require("./components/Link/index"), exports);
7
+ //# sourceMappingURL=Link.js.map
8
+
8
9
  //# sourceMappingURL=Link.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["tslib_1","__exportStar","require","exports"],"sources":["../src/packages/react-components/react-link/src/Link.ts"],"sourcesContent":["export * from './components/Link/index';\n"],"mappings":";;;;;;AAAAA,OAAA,CAAAC,YAAA,CAAAC,OAAA,6BAAAC,OAAA"}
1
+ {"version":3,"sources":["../lib/Link.js"],"sourcesContent":["export * from './components/Link/index';\n//# sourceMappingURL=Link.js.map"],"names":[],"mappings":";;;;;oBAAc;CACd,gCAAgC"}
@@ -1,22 +1,22 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "Link", {
6
+ enumerable: true,
7
+ get: ()=>Link
5
8
  });
6
- exports.Link = void 0;
7
- const React = /*#__PURE__*/require("react");
8
- const useLink_1 = /*#__PURE__*/require("./useLink");
9
- const useLinkStyles_1 = /*#__PURE__*/require("./useLinkStyles");
10
- const renderLink_1 = /*#__PURE__*/require("./renderLink");
11
- /**
12
- * A Link is a reference to data that a user can follow by clicking or tapping it.
13
- */
14
- exports.Link = /*#__PURE__*/React.forwardRef((props, ref) => {
15
- const state = useLink_1.useLink_unstable(props, ref);
16
- useLinkStyles_1.useLinkStyles_unstable(state);
17
- return renderLink_1.renderLink_unstable(state);
18
- // Work around some small mismatches in inferred types which don't matter in practice
9
+ const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
10
+ const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
11
+ const _useLink = require("./useLink");
12
+ const _useLinkStyles = require("./useLinkStyles");
13
+ const _renderLink = require("./renderLink");
14
+ const Link = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
15
+ const state = (0, _useLink.useLink_unstable)(props, ref);
16
+ (0, _useLinkStyles.useLinkStyles_unstable)(state);
17
+ return (0, _renderLink.renderLink_unstable)(state);
18
+ // Work around some small mismatches in inferred types which don't matter in practice
19
19
  });
20
+ Link.displayName = 'Link'; //# sourceMappingURL=Link.js.map
20
21
 
21
- exports.Link.displayName = 'Link';
22
22
  //# sourceMappingURL=Link.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","require","useLink_1","useLinkStyles_1","renderLink_1","exports","Link","forwardRef","props","ref","state","useLink_unstable","useLinkStyles_unstable","renderLink_unstable","displayName"],"sources":["../src/packages/react-components/react-link/src/components/Link/Link.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useLink_unstable } from './useLink';\nimport { useLinkStyles_unstable } from './useLinkStyles';\nimport { renderLink_unstable } from './renderLink';\nimport type { LinkProps } from './Link.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * A Link is a reference to data that a user can follow by clicking or tapping it.\n */\nexport const Link: ForwardRefComponent<LinkProps> = React.forwardRef((props, ref) => {\n const state = useLink_unstable(props, ref);\n\n useLinkStyles_unstable(state);\n\n return renderLink_unstable(state);\n // Work around some small mismatches in inferred types which don't matter in practice\n}) as ForwardRefComponent<LinkProps>;\n\nLink.displayName = 'Link';\n"],"mappings":";;;;;;AAAA,MAAAA,KAAA,gBAAAC,OAAA;AACA,MAAAC,SAAA,gBAAAD,OAAA;AACA,MAAAE,eAAA,gBAAAF,OAAA;AACA,MAAAG,YAAA,gBAAAH,OAAA;AAIA;;;AAGaI,OAAA,CAAAC,IAAI,gBAAmCN,KAAK,CAACO,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EAClF,MAAMC,KAAK,GAAGR,SAAA,CAAAS,gBAAgB,CAACH,KAAK,EAAEC,GAAG,CAAC;EAE1CN,eAAA,CAAAS,sBAAsB,CAACF,KAAK,CAAC;EAE7B,OAAON,YAAA,CAAAS,mBAAmB,CAACH,KAAK,CAAC;EACjC;AACF,CAAC,CAAmC;;AAEpCL,OAAA,CAAAC,IAAI,CAACQ,WAAW,GAAG,MAAM"}
1
+ {"version":3,"sources":["../../../lib/components/Link/Link.js"],"sourcesContent":["import * as React from 'react';\nimport { useLink_unstable } from './useLink';\nimport { useLinkStyles_unstable } from './useLinkStyles';\nimport { renderLink_unstable } from './renderLink';\n/**\n * A Link is a reference to data that a user can follow by clicking or tapping it.\n */\nexport const Link = /*#__PURE__*/React.forwardRef((props, ref) => {\n const state = useLink_unstable(props, ref);\n useLinkStyles_unstable(state);\n return renderLink_unstable(state);\n // Work around some small mismatches in inferred types which don't matter in practice\n});\n\nLink.displayName = 'Link';\n//# sourceMappingURL=Link.js.map"],"names":["Link","React","forwardRef","props","ref","state","useLink_unstable","useLinkStyles_unstable","renderLink_unstable","displayName"],"mappings":";;;;+BAOaA;;aAAAA;;;6DAPU;yBACU;+BACM;4BACH;AAI7B,MAAMA,OAAO,WAAW,GAAEC,OAAMC,UAAU,CAAC,CAACC,OAAOC,MAAQ;IAChE,MAAMC,QAAQC,IAAAA,yBAAgB,EAACH,OAAOC;IACtCG,IAAAA,qCAAsB,EAACF;IACvB,OAAOG,IAAAA,+BAAmB,EAACH;AAC3B,qFAAqF;AACvF;AAEAL,KAAKS,WAAW,GAAG,QACnB,gCAAgC"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
5
+ //# sourceMappingURL=Link.types.js.map
6
+
6
7
  //# sourceMappingURL=Link.types.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../src/packages/react-components/react-link/src/components/Link/Link.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type LinkSlots = {\n /**\n * Root of the component that renders as either an <a> or a <button> tag.\n */\n root: Slot<'a', 'button'>;\n};\n\nexport type LinkProps = ComponentProps<LinkSlots> & {\n /**\n * A link can appear either with its default style or subtle.\n * If not specified, the link appears with its default styling.\n * @default 'default'\n */\n appearance?: 'default' | 'subtle';\n\n /**\n * Whether the link is disabled.\n * @default false\n */\n disabled?: boolean;\n\n /**\n * When set, allows the link to be focusable even when it has been disabled. This is used in scenarios where it is\n * important to keep a consistent tab order for screen reader and keyboard users.\n * @default false\n */\n disabledFocusable?: boolean;\n\n /**\n * If true, changes styling when the link is being used alongside other text content.\n * @default false\n */\n inline?: boolean;\n};\n\nexport type LinkState = ComponentState<LinkSlots> &\n Required<Pick<LinkProps, 'appearance' | 'disabled' | 'disabledFocusable' | 'inline'>>;\n"],"mappings":""}
1
+ {"version":3,"sources":["../../../lib/components/Link/Link.types.js"],"sourcesContent":["export {};\n//# sourceMappingURL=Link.types.js.map"],"names":[],"mappings":";;;;CACA,sCAAsC"}
@@ -1,13 +1,14 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
6
- const tslib_1 = /*#__PURE__*/require("tslib");
7
- tslib_1.__exportStar(require("./Link"), exports);
8
- tslib_1.__exportStar(require("./Link.types"), exports);
9
- tslib_1.__exportStar(require("./renderLink"), exports);
10
- tslib_1.__exportStar(require("./useLink"), exports);
11
- tslib_1.__exportStar(require("./useLinkState"), exports);
12
- tslib_1.__exportStar(require("./useLinkStyles"), exports);
5
+ const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
+ _exportStar(require("./Link"), exports);
7
+ _exportStar(require("./Link.types"), exports);
8
+ _exportStar(require("./renderLink"), exports);
9
+ _exportStar(require("./useLink"), exports);
10
+ _exportStar(require("./useLinkState"), exports);
11
+ _exportStar(require("./useLinkStyles"), exports);
12
+ //# sourceMappingURL=index.js.map
13
+
13
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["tslib_1","__exportStar","require","exports"],"sources":["../src/packages/react-components/react-link/src/components/Link/index.ts"],"sourcesContent":["export * from './Link';\nexport * from './Link.types';\nexport * from './renderLink';\nexport * from './useLink';\nexport * from './useLinkState';\nexport * from './useLinkStyles';\n"],"mappings":";;;;;;AAAAA,OAAA,CAAAC,YAAA,CAAAC,OAAA,YAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,kBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,kBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,eAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,oBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,qBAAAC,OAAA"}
1
+ {"version":3,"sources":["../../../lib/components/Link/index.js"],"sourcesContent":["export * from './Link';\nexport * from './Link.types';\nexport * from './renderLink';\nexport * from './useLink';\nexport * from './useLinkState';\nexport * from './useLinkStyles';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA;oBACA;oBACA;CACd,iCAAiC"}
@@ -1,22 +1,17 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "renderLink_unstable", {
6
+ enumerable: true,
7
+ get: ()=>renderLink_unstable
5
8
  });
6
- exports.renderLink_unstable = void 0;
7
- const React = /*#__PURE__*/require("react");
8
- const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
9
- /**
10
- * Renders a Link component by passing the state defined props to the appropriate slots.
11
- */
12
- const renderLink_unstable = state => {
13
- const {
14
- slots,
15
- slotProps
16
- } = react_utilities_1.getSlots(state);
17
- return React.createElement(slots.root, {
18
- ...slotProps.root
19
- });
20
- };
21
- exports.renderLink_unstable = renderLink_unstable;
9
+ const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
10
+ const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
11
+ const _reactUtilities = require("@fluentui/react-utilities");
12
+ const renderLink_unstable = (state)=>{
13
+ const { slots , slotProps } = (0, _reactUtilities.getSlots)(state);
14
+ return /*#__PURE__*/ _react.createElement(slots.root, slotProps.root);
15
+ }; //# sourceMappingURL=renderLink.js.map
16
+
22
17
  //# sourceMappingURL=renderLink.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","require","react_utilities_1","renderLink_unstable","state","slots","slotProps","getSlots","createElement","root","exports"],"sources":["../src/packages/react-components/react-link/src/components/Link/renderLink.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { LinkSlots, LinkState } from './Link.types';\n\n/**\n * Renders a Link component by passing the state defined props to the appropriate slots.\n */\nexport const renderLink_unstable = (state: LinkState) => {\n const { slots, slotProps } = getSlots<LinkSlots>(state);\n\n return <slots.root {...slotProps.root} />;\n};\n"],"mappings":";;;;;;AAAA,MAAAA,KAAA,gBAAAC,OAAA;AACA,MAAAC,iBAAA,gBAAAD,OAAA;AAGA;;;AAGO,MAAME,mBAAmB,GAAIC,KAAgB,IAAI;EACtD,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGJ,iBAAA,CAAAK,QAAQ,CAAYH,KAAK,CAAC;EAEvD,OAAOJ,KAAA,CAAAQ,aAAA,CAACH,KAAK,CAACI,IAAI;IAAA,GAAKH,SAAS,CAACG;EAAI,EAAI;AAC3C,CAAC;AAJYC,OAAA,CAAAP,mBAAmB,GAAAA,mBAAA"}
1
+ {"version":3,"sources":["../../../lib/components/Link/renderLink.js"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\n/**\n * Renders a Link component by passing the state defined props to the appropriate slots.\n */\nexport const renderLink_unstable = state => {\n const {\n slots,\n slotProps\n } = getSlots(state);\n return /*#__PURE__*/React.createElement(slots.root, slotProps.root);\n};\n//# sourceMappingURL=renderLink.js.map"],"names":["renderLink_unstable","state","slots","slotProps","getSlots","React","createElement","root"],"mappings":";;;;+BAKaA;;aAAAA;;;6DALU;gCACE;AAIlB,MAAMA,sBAAsBC,CAAAA,QAAS;IAC1C,MAAM,EACJC,MAAK,EACLC,UAAS,EACV,GAAGC,IAAAA,wBAAQ,EAACH;IACb,OAAO,WAAW,GAAEI,OAAMC,aAAa,CAACJ,MAAMK,IAAI,EAAEJ,UAAUI,IAAI;AACpE,GACA,sCAAsC"}
@@ -1,44 +1,38 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "useLink_unstable", {
6
+ enumerable: true,
7
+ get: ()=>useLink_unstable
5
8
  });
6
- exports.useLink_unstable = void 0;
7
- const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
8
- const useLinkState_1 = /*#__PURE__*/require("./useLinkState");
9
- /**
10
- * Given user props, defines default props for the Link, calls useLinkState_unstable, and returns processed state.
11
- * @param props - User provided props to the Link component.
12
- * @param ref - User provided ref to be passed to the Link component.
13
- */
14
- const useLink_unstable = (props, ref) => {
15
- const {
16
- appearance = 'default',
17
- disabled = false,
18
- disabledFocusable = false,
19
- inline = false
20
- } = props;
21
- const as = props.as || (props.href ? 'a' : 'button');
22
- const type = as === 'button' ? 'button' : undefined;
23
- const state = {
24
- // Props passed at the top-level
25
- appearance,
26
- disabled,
27
- disabledFocusable,
28
- inline,
29
- // Slots definition
30
- components: {
31
- root: 'a'
32
- },
33
- root: react_utilities_1.getNativeElementProps(as, {
34
- ref,
35
- type,
36
- ...props,
37
- as
38
- })
39
- };
40
- useLinkState_1.useLinkState_unstable(state);
41
- return state;
42
- };
43
- exports.useLink_unstable = useLink_unstable;
9
+ const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
10
+ const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
11
+ const _reactUtilities = require("@fluentui/react-utilities");
12
+ const _useLinkState = require("./useLinkState");
13
+ const useLink_unstable = (props, ref)=>{
14
+ const { appearance ='default' , disabled =false , disabledFocusable =false , inline =false } = props;
15
+ const as = props.as || (props.href ? 'a' : 'button');
16
+ const type = as === 'button' ? 'button' : undefined;
17
+ const state = {
18
+ // Props passed at the top-level
19
+ appearance,
20
+ disabled,
21
+ disabledFocusable,
22
+ inline,
23
+ // Slots definition
24
+ components: {
25
+ root: 'a'
26
+ },
27
+ root: (0, _reactUtilities.getNativeElementProps)(as, {
28
+ ref,
29
+ type,
30
+ ...props,
31
+ as
32
+ })
33
+ };
34
+ (0, _useLinkState.useLinkState_unstable)(state);
35
+ return state;
36
+ }; //# sourceMappingURL=useLink.js.map
37
+
44
38
  //# sourceMappingURL=useLink.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["react_utilities_1","require","useLinkState_1","useLink_unstable","props","ref","appearance","disabled","disabledFocusable","inline","as","href","type","undefined","state","components","root","getNativeElementProps","useLinkState_unstable","exports"],"sources":["../src/packages/react-components/react-link/src/components/Link/useLink.ts"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport { useLinkState_unstable } from './useLinkState';\nimport type { LinkProps, LinkState } from './Link.types';\n\n/**\n * Given user props, defines default props for the Link, calls useLinkState_unstable, and returns processed state.\n * @param props - User provided props to the Link component.\n * @param ref - User provided ref to be passed to the Link component.\n */\nexport const useLink_unstable = (\n props: LinkProps,\n ref: React.Ref<HTMLAnchorElement | HTMLButtonElement>,\n): LinkState => {\n const { appearance = 'default', disabled = false, disabledFocusable = false, inline = false } = props;\n const as = props.as || (props.href ? 'a' : 'button');\n const type = as === 'button' ? 'button' : undefined;\n\n const state: LinkState = {\n // Props passed at the top-level\n appearance,\n disabled,\n disabledFocusable,\n inline,\n\n // Slots definition\n components: {\n root: 'a',\n },\n\n root: getNativeElementProps(as, {\n ref,\n type,\n ...props,\n as,\n }),\n };\n\n useLinkState_unstable(state);\n\n return state;\n};\n"],"mappings":";;;;;;AACA,MAAAA,iBAAA,gBAAAC,OAAA;AACA,MAAAC,cAAA,gBAAAD,OAAA;AAGA;;;;;AAKO,MAAME,gBAAgB,GAAGA,CAC9BC,KAAgB,EAChBC,GAAqD,KACxC;EACb,MAAM;IAAEC,UAAU,GAAG,SAAS;IAAEC,QAAQ,GAAG,KAAK;IAAEC,iBAAiB,GAAG,KAAK;IAAEC,MAAM,GAAG;EAAK,CAAE,GAAGL,KAAK;EACrG,MAAMM,EAAE,GAAGN,KAAK,CAACM,EAAE,KAAKN,KAAK,CAACO,IAAI,GAAG,GAAG,GAAG,QAAQ,CAAC;EACpD,MAAMC,IAAI,GAAGF,EAAE,KAAK,QAAQ,GAAG,QAAQ,GAAGG,SAAS;EAEnD,MAAMC,KAAK,GAAc;IACvB;IACAR,UAAU;IACVC,QAAQ;IACRC,iBAAiB;IACjBC,MAAM;IAEN;IACAM,UAAU,EAAE;MACVC,IAAI,EAAE;KACP;IAEDA,IAAI,EAAEhB,iBAAA,CAAAiB,qBAAqB,CAACP,EAAE,EAAE;MAC9BL,GAAG;MACHO,IAAI;MACJ,GAAGR,KAAK;MACRM;KACD;GACF;EAEDR,cAAA,CAAAgB,qBAAqB,CAACJ,KAAK,CAAC;EAE5B,OAAOA,KAAK;AACd,CAAC;AA/BYK,OAAA,CAAAhB,gBAAgB,GAAAA,gBAAA"}
1
+ {"version":3,"sources":["../../../lib/components/Link/useLink.js"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport { useLinkState_unstable } from './useLinkState';\n/**\n * Given user props, defines default props for the Link, calls useLinkState_unstable, and returns processed state.\n * @param props - User provided props to the Link component.\n * @param ref - User provided ref to be passed to the Link component.\n */\nexport const useLink_unstable = (props, ref) => {\n const {\n appearance = 'default',\n disabled = false,\n disabledFocusable = false,\n inline = false\n } = props;\n const as = props.as || (props.href ? 'a' : 'button');\n const type = as === 'button' ? 'button' : undefined;\n const state = {\n // Props passed at the top-level\n appearance,\n disabled,\n disabledFocusable,\n inline,\n // Slots definition\n components: {\n root: 'a'\n },\n root: getNativeElementProps(as, {\n ref,\n type,\n ...props,\n as\n })\n };\n useLinkState_unstable(state);\n return state;\n};\n//# sourceMappingURL=useLink.js.map"],"names":["useLink_unstable","props","ref","appearance","disabled","disabledFocusable","inline","as","href","type","undefined","state","components","root","getNativeElementProps","useLinkState_unstable"],"mappings":";;;;+BAQaA;;aAAAA;;;6DARU;gCACe;8BACA;AAM/B,MAAMA,mBAAmB,CAACC,OAAOC,MAAQ;IAC9C,MAAM,EACJC,YAAa,UAAS,EACtBC,UAAW,KAAK,CAAA,EAChBC,mBAAoB,KAAK,CAAA,EACzBC,QAAS,KAAK,CAAA,EACf,GAAGL;IACJ,MAAMM,KAAKN,MAAMM,EAAE,IAAKN,CAAAA,MAAMO,IAAI,GAAG,MAAM,QAAQ,AAAD;IAClD,MAAMC,OAAOF,OAAO,WAAW,WAAWG,SAAS;IACnD,MAAMC,QAAQ;QACZ,gCAAgC;QAChCR;QACAC;QACAC;QACAC;QACA,mBAAmB;QACnBM,YAAY;YACVC,MAAM;QACR;QACAA,MAAMC,IAAAA,qCAAqB,EAACP,IAAI;YAC9BL;YACAO;YACA,GAAGR,KAAK;YACRM;QACF;IACF;IACAQ,IAAAA,mCAAqB,EAACJ;IACtB,OAAOA;AACT,GACA,mCAAmC"}