@fluentui/react-link 9.74.7-experimental.cli-api.20261006-ccaa611d58.0 → 9.75.0-experimental.css-modules.20261031-810ab07afb.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 +33 -11
- package/README.md +11 -0
- package/lib/components/Link/Link.js.map +1 -1
- package/lib/components/Link/Link.module.css +124 -0
- 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 +2 -2
- package/lib/components/Link/renderLink.js.map +1 -1
- package/lib/components/Link/useLink.js.map +1 -1
- package/lib/components/Link/useLinkState.js.map +1 -1
- package/lib/components/Link/useLinkStyles.styles.css.js +9 -0
- package/lib/components/Link/useLinkStyles.styles.css.js.map +1 -0
- package/lib/components/Link/useLinkStyles.styles.raw.css.js +9 -0
- package/lib/components/Link/useLinkStyles.styles.raw.css.js.map +1 -0
- package/lib/components/Link/useLinkStyles.styles.raw.js.map +1 -1
- package/lib/contexts/index.js.map +1 -1
- package/lib/contexts/linkContext.js.map +1 -1
- package/lib-commonjs/Link.cjs +11 -11
- package/lib-commonjs/Link.cjs.map +1 -1
- package/lib-commonjs/components/Link/Link.cjs.map +1 -1
- package/lib-commonjs/components/Link/Link.module.css +124 -0
- package/lib-commonjs/components/Link/Link.types.cjs.map +1 -1
- package/lib-commonjs/components/Link/index.cjs +8 -8
- package/lib-commonjs/components/Link/index.cjs.map +1 -1
- package/lib-commonjs/components/Link/renderLink.cjs.map +1 -1
- package/lib-commonjs/components/Link/useLink.cjs +3 -3
- package/lib-commonjs/components/Link/useLink.cjs.map +1 -1
- package/lib-commonjs/components/Link/useLinkState.cjs.map +1 -1
- package/lib-commonjs/components/Link/useLinkStyles.styles.cjs +3 -3
- package/lib-commonjs/components/Link/useLinkStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/Link/useLinkStyles.styles.css.cjs +28 -0
- package/lib-commonjs/components/Link/useLinkStyles.styles.css.cjs.map +1 -0
- package/lib-commonjs/components/Link/useLinkStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/Link/useLinkStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/Link/useLinkStyles.styles.raw.css.cjs +28 -0
- package/lib-commonjs/components/Link/useLinkStyles.styles.raw.css.cjs.map +1 -0
- package/lib-commonjs/contexts/index.cjs +4 -4
- package/lib-commonjs/contexts/index.cjs.map +1 -1
- package/lib-commonjs/contexts/linkContext.cjs +4 -4
- package/lib-commonjs/contexts/linkContext.cjs.map +1 -1
- package/lib-commonjs/index.cjs +11 -11
- package/lib-commonjs/index.cjs.map +1 -1
- package/package.json +14 -14
- package/dist/metadata/api/api-root.json +0 -1
- package/dist/metadata/index.json +0 -1
|
@@ -5,29 +5,29 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
Link
|
|
12
|
+
get Link () {
|
|
13
13
|
return _Link.Link;
|
|
14
14
|
},
|
|
15
|
-
linkClassNames
|
|
15
|
+
get linkClassNames () {
|
|
16
16
|
return _useLinkStylesstyles.linkClassNames;
|
|
17
17
|
},
|
|
18
|
-
renderLink_unstable
|
|
18
|
+
get renderLink_unstable () {
|
|
19
19
|
return _renderLink.renderLink_unstable;
|
|
20
20
|
},
|
|
21
|
-
useLinkBase_unstable
|
|
21
|
+
get useLinkBase_unstable () {
|
|
22
22
|
return _useLink.useLinkBase_unstable;
|
|
23
23
|
},
|
|
24
|
-
useLinkState_unstable
|
|
24
|
+
get useLinkState_unstable () {
|
|
25
25
|
return _useLinkState.useLinkState_unstable;
|
|
26
26
|
},
|
|
27
|
-
useLinkStyles_unstable
|
|
27
|
+
get useLinkStyles_unstable () {
|
|
28
28
|
return _useLinkStylesstyles.useLinkStyles_unstable;
|
|
29
29
|
},
|
|
30
|
-
useLink_unstable
|
|
30
|
+
get useLink_unstable () {
|
|
31
31
|
return _useLink.useLink_unstable;
|
|
32
32
|
}
|
|
33
33
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Link/index.ts"],"sourcesContent":["export { Link } from './Link';\nexport type { LinkBaseProps, LinkBaseState, LinkProps, LinkSlots, LinkState } from './Link.types';\nexport { renderLink_unstable } from './renderLink';\nexport { useLink_unstable, useLinkBase_unstable } from './useLink';\nexport { useLinkState_unstable } from './useLinkState';\nexport { linkClassNames, useLinkStyles_unstable } from './useLinkStyles.styles';\n"],"names":["Link","renderLink_unstable","useLink_unstable","useLinkBase_unstable","useLinkState_unstable","linkClassNames","useLinkStyles_unstable"],"mappings":";;;;;;;;;;;;eAASA,UAAI;;;eAKJK,mCAAc;;;eAHdJ,+BAAmB;;;eACDE,6BAAoB;;;eACtCC,mCAAqB;;;eACLE,2CAAsB;;;eAFtCJ,yBAAgB;;;sBAHJ,YAAS;4BAEM,kBAAe;yBACI,eAAY;8BAC7B,oBAAiB;qCACA,4BAAyB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Link/renderLink.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport type { LinkSlots, LinkBaseState } 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: LinkBaseState): JSXElement => {\n assertSlots<LinkSlots>(state);\n\n return <state.root />;\n};\n"],"names":["assertSlots","renderLink_unstable","state","root"],"mappings":";;;;;;;;;;;gCACA,gDAAiD,GAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAOjD,MAAMC,sBAAsB,CAACC;QAClCF,2BAAAA,EAAuBE;IAEvB,OAAA,WAAA,OAAO,eAAA,EAACA,MAAMC,IAAI,EAAA,CAAA;AACpB,EAAE"}
|
|
@@ -6,14 +6,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
function _export(target, all) {
|
|
7
7
|
for(var name in all)Object.defineProperty(target, name, {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: all
|
|
9
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
_export(exports, {
|
|
13
|
-
useLinkBase_unstable
|
|
13
|
+
get useLinkBase_unstable () {
|
|
14
14
|
return useLinkBase_unstable;
|
|
15
15
|
},
|
|
16
|
-
useLink_unstable
|
|
16
|
+
get useLink_unstable () {
|
|
17
17
|
return useLink_unstable;
|
|
18
18
|
}
|
|
19
19
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Link/useLink.ts"],"sourcesContent":["'use client';\n\nimport type * 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 { LinkBaseProps, LinkBaseState, 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', inline: inlineProp, ...baseProps } = props;\n\n const state = useLinkBase_unstable(baseProps, ref);\n\n return {\n appearance,\n backgroundAppearance,\n inline: inlineProp ?? !!inlineContext,\n ...state,\n };\n};\n\n/**\n * Base hook for Link component, which manages state related to ARIA, keyboard handling,\n * disabled behavior, and slot structure. This hook excludes design-specific props (appearance, inline).\n *\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 useLinkBase_unstable = (\n props: LinkBaseProps,\n ref: React.Ref<HTMLAnchorElement | HTMLButtonElement | HTMLSpanElement>,\n): LinkBaseState => {\n const { disabled = false, disabledFocusable = 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 LinkBaseProps;\n\n const state: LinkBaseState = {\n // Props passed at the top-level\n disabled,\n disabledFocusable,\n\n // Slots definition\n components: {\n root: elementType,\n },\n\n root: slot.always(\n getIntrinsicElementProps<LinkBaseProps>(elementType, {\n ref,\n ...propsWithAssignedAs,\n } as const),\n { elementType },\n ),\n };\n\n useLinkState_unstable(state);\n\n return state;\n};\n"],"names":["getIntrinsicElementProps","slot","useBackgroundAppearance","useLinkState_unstable","useLinkContext","useLink_unstable","props","ref","backgroundAppearance","inline","inlineContext","appearance","inlineProp","baseProps","state","useLinkBase_unstable","disabled","disabledFocusable","elementType","as","href","propsWithAssignedAs","role","undefined","type","components","root","always"],"mappings":"AAAA;;;;;;;;;;;;QAuCae;;;;;;;gCApCkC,4BAA4B;qCACnC,kCAAkC;8BACpC,oBAAiB;6BAExB,gCAA6B;AAOrD,MAAMV,mBAAmB,CAC9BC,OACAC;IAEA,MAAMC,2BAAuBN,4CAAAA;IAC7B,MAAM,EAAEO,QAAQC,aAAa,EAAE,OAAGN,2BAAAA;IAClC,MAAM,EAAEO,aAAa,SAAS,EAAEF,QAAQG,UAAU,EAAE,GAAGC,WAAW,GAAGP;IAErE,MAAMQ,QAAQC,qBAAqBF,WAAWN;IAE9C,OAAO;QACLI;QACAH;QACAC,MAAM,EAAEG,eAAAA,QAAAA,eAAAA,KAAAA,IAAAA,aAAc,CAAC,CAACF;QACxB,GAAGI,KAAK;IACV;AACF,EAAE;AASK,6BAA6B,CAClCR,OACAC;IAEA,MAAM,EAAES,WAAW,KAAK,EAAEC,oBAAoB,KAAK,EAAE,GAAGX;IAExD,MAAMY,cAAcZ,MAAMa,EAAE,IAAKb,CAAAA,MAAMc,IAAI,GAAG,MAAM,QAAA,CAAO;IAE3D,qGAAqG;IACrG,MAAMC,sBAAsB;QAC1BC,MAAMJ,gBAAgB,SAAS,WAAWK;QAC1CC,MAAMN,gBAAgB,WAAW,WAAWK;QAC5C,GAAGjB,KAAK;QACRa,IAAID;IACN;IAEA,MAAMJ,QAAuB;QAC3B,gCAAgC;QAChCE;QACAC;QAEA,mBAAmB;QACnBQ,YAAY;YACVC,MAAMR;QACR;QAEAQ,MAAMzB,oBAAAA,CAAK0B,MAAM,KACf3B,wCAAAA,EAAwCkB,aAAa;YACnDX;YACA,GAAGc,mBAAmB;QACxB,IACA;YAAEH;QAAY;IAElB;QAEAf,mCAAAA,EAAsBW;IAEtB,OAAOA;AACT,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Link/useLinkState.ts"],"sourcesContent":["import type * as React from 'react';\nimport { Enter, Space } from '@fluentui/keyboard-keys';\nimport type { LinkBaseState } 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: LinkBaseState): LinkBaseState => {\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 const keyPressed = ev.key === Enter || ev.key === Space;\n\n if ((disabled || disabledFocusable) && keyPressed) {\n ev.preventDefault();\n ev.stopPropagation();\n } else {\n onKeyDown?.(ev);\n // if there is already onKeyDown provided - respect it\n if (state.root.as === 'span' && !!state.root.onClick && !onKeyDown && keyPressed) {\n ev.preventDefault();\n ev.currentTarget.click();\n }\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":["Enter","Space","useLinkState_unstable","state","disabled","disabledFocusable","onClick","onKeyDown","role","tabIndex","root","as","href","undefined","ev","preventDefault","keyPressed","key","stopPropagation","currentTarget","click"],"mappings":";;;;+BAQaE;;;;;;8BAPgB,0BAA0B;AAOhD,8BAA8B,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,IA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R,MAAMO,IAAI,CAACN,QAAQ,GAAGA,YAAY,CAACC;IACrC;IAEA,OAAOF;AACT,EAAE"}
|
|
@@ -6,14 +6,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
function _export(target, all) {
|
|
7
7
|
for(var name in all)Object.defineProperty(target, name, {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: all
|
|
9
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
_export(exports, {
|
|
13
|
-
linkClassNames
|
|
13
|
+
get linkClassNames () {
|
|
14
14
|
return linkClassNames;
|
|
15
15
|
},
|
|
16
|
-
useLinkStyles_unstable
|
|
16
|
+
get useLinkStyles_unstable () {
|
|
17
17
|
return useLinkStyles_unstable;
|
|
18
18
|
}
|
|
19
19
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useLinkStyles.styles.js"],"sourcesContent":["'use client';\nimport { 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.colorNeutralForeground2Link,\n ':hover': {\n textDecorationLine: 'underline',\n color: tokens.colorNeutralForeground2LinkHover\n },\n ':active': {\n textDecorationLine: 'underline',\n color: tokens.colorNeutralForeground2LinkPressed\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 // There is no native disabled state for links, so we need to explicitly style the disabled state for high contrast mode.\n '@media (forced-colors: active)': {\n color: 'GrayText',\n ':hover': {\n color: 'GrayText'\n },\n ':active': {\n color: 'GrayText'\n }\n }\n },\n inverted: {\n color: tokens.colorBrandForegroundInverted,\n ':hover': {\n color: tokens.colorBrandForegroundInverted\n },\n ':active': {\n color: tokens.colorBrandForegroundInverted\n }\n },\n brand: {\n color: tokens.colorNeutralForegroundInvertedLink,\n ':hover': {\n color: tokens.colorNeutralForegroundInvertedLinkHover\n },\n ':active': {\n color: tokens.colorNeutralForegroundInvertedLinkPressed\n }\n }\n});\nexport const useLinkStyles_unstable = (state)=>{\n const styles = useStyles();\n const { appearance, disabled, inline, root, backgroundAppearance } = state;\n // eslint-disable-next-line react-hooks/immutability\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, backgroundAppearance === 'brand' && styles.brand, inline && styles.inline, disabled && styles.disabled, state.root.className);\n return state;\n};\n"],"names":["shorthands","__styles","mergeClasses","createCustomFocusIndicatorStyle","tokens","linkClassNames","root","useStyles","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","B7iucu3","Bahaeuw","Boo3t63","inverted","brand","d","p","i","h","a","m","useLinkStyles_unstable","state","styles","appearance","backgroundAppearance","className","as"],"mappings":"AAAA,YAAY;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"sources":["useLinkStyles.styles.js"],"sourcesContent":["'use client';\nimport { 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.colorNeutralForeground2Link,\n ':hover': {\n textDecorationLine: 'underline',\n color: tokens.colorNeutralForeground2LinkHover\n },\n ':active': {\n textDecorationLine: 'underline',\n color: tokens.colorNeutralForeground2LinkPressed\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 // There is no native disabled state for links, so we need to explicitly style the disabled state for high contrast mode.\n '@media (forced-colors: active)': {\n color: 'GrayText',\n ':hover': {\n color: 'GrayText'\n },\n ':active': {\n color: 'GrayText'\n }\n }\n },\n inverted: {\n color: tokens.colorBrandForegroundInverted,\n ':hover': {\n color: tokens.colorBrandForegroundInverted\n },\n ':active': {\n color: tokens.colorBrandForegroundInverted\n }\n },\n brand: {\n color: tokens.colorNeutralForegroundInvertedLink,\n ':hover': {\n color: tokens.colorNeutralForegroundInvertedLinkHover\n },\n ':active': {\n color: tokens.colorNeutralForegroundInvertedLinkPressed\n }\n }\n});\nexport const useLinkStyles_unstable = (state)=>{\n const styles = useStyles();\n const { appearance, disabled, inline, root, backgroundAppearance } = state;\n // eslint-disable-next-line react-hooks/immutability\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, backgroundAppearance === 'brand' && styles.brand, inline && styles.inline, disabled && styles.disabled, state.root.className);\n return state;\n};\n"],"names":["shorthands","__styles","mergeClasses","createCustomFocusIndicatorStyle","tokens","linkClassNames","root","useStyles","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","B7iucu3","Bahaeuw","Boo3t63","inverted","brand","d","p","i","h","a","m","useLinkStyles_unstable","state","styles","appearance","backgroundAppearance","className","as"],"mappings":"AAAA,YAAY;;;;;;;;;;;;QAICK,cAAc;;;QA2Gd2D,sBAAsB;;;;uBA9GkB,gBAAgB;AAG9D,uBAAuB;IAC1B1D,IAAI,EAAE;AACV,CAAC;AACD,MAAMC,SAAS,GAAA,WAAA,OAAGN,eAAA,EAAA;IAAAO,cAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,MAAA,EAAA;IAAA;IAAAN,IAAA,EAAA;QAAAO,OAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,OAAA,EAAA;QAAA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AEY,oBAAoB,KAAK,OAAO,IAAIF,MAAM,CAACT,KAAK,EAAEN,MAAM,IAAIe,MAAM,CAACf,MAAM,EAAEC,QAAQ,IAAIc,MAAM,CAACd,QAAQ,EAAEa,KAAK,CAAC3D,IAAI,CAAC+D,SAAS,CAAC;IAChZ,OAAOJ,KAAK;AAChB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
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: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
get linkClassNames () {
|
|
13
|
+
return linkClassNames;
|
|
14
|
+
},
|
|
15
|
+
get useLinkStyles_unstable () {
|
|
16
|
+
return useLinkStyles_unstable;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
20
|
+
const _clsx = require("clsx");
|
|
21
|
+
const _Linkmodulecss = /*#__PURE__*/ _interop_require_default._(require("./Link.module.css"));
|
|
22
|
+
const linkClassNames = {
|
|
23
|
+
root: 'fui-Link'
|
|
24
|
+
};
|
|
25
|
+
const useLinkStyles_unstable = (state)=>{
|
|
26
|
+
state.root.className = (0, _clsx.clsx)(linkClassNames.root, _Linkmodulecss.default.root, state.root.as === 'a' && state.root.href && _Linkmodulecss.default.href, state.root.as === 'button' && _Linkmodulecss.default.button, _Linkmodulecss.default[state.appearance], state.backgroundAppearance && _Linkmodulecss.default[state.backgroundAppearance], state.inline && _Linkmodulecss.default.inline, state.disabled && _Linkmodulecss.default.disabled, state.root.className);
|
|
27
|
+
return state;
|
|
28
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Link/useLinkStyles.styles.css.ts"],"sourcesContent":["import { clsx } from 'clsx';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { LinkSlots, LinkState } from './Link.types';\nimport styles from './Link.module.css';\n\nexport const linkClassNames: SlotClassNames<LinkSlots> = {\n root: 'fui-Link',\n};\n\nexport const useLinkStyles_unstable = (state: LinkState): LinkState => {\n state.root.className = clsx(\n linkClassNames.root,\n styles.root,\n state.root.as === 'a' && state.root.href && styles.href,\n state.root.as === 'button' && styles.button,\n styles[state.appearance],\n state.backgroundAppearance && styles[state.backgroundAppearance],\n state.inline && styles.inline,\n state.disabled && styles.disabled,\n state.root.className,\n );\n\n return state;\n};\n"],"names":["clsx","styles","linkClassNames","root","useLinkStyles_unstable","state","className","as","href","button","appearance","backgroundAppearance","inline","disabled"],"mappings":";;;;;;;;;;;QAKaE;;;;;;;;sBALQ,OAAO;wEAGT,oBAAoB;AAEhC,uBAAkD;IACvDC,MAAM;AACR,EAAE;AAEK,MAAMC,yBAAyB,CAACC;IACrCA,MAAMF,IAAI,CAACG,SAAS,OAAGN,UAAAA,EACrBE,eAAeC,IAAI,EACnBF,sBAAAA,CAAOE,IAAI,EACXE,MAAMF,IAAI,CAACI,EAAE,KAAK,OAAOF,MAAMF,IAAI,CAACK,IAAI,IAAIP,sBAAAA,CAAOO,IAAI,EACvDH,MAAMF,IAAI,CAACI,EAAE,KAAK,YAAYN,sBAAAA,CAAOQ,MAAM,EAC3CR,sBAAM,CAACI,MAAMK,UAAU,CAAC,EACxBL,MAAMM,oBAAoB,IAAIV,sBAAM,CAACI,MAAMM,oBAAoB,CAAC,EAChEN,MAAMO,MAAM,IAAIX,sBAAAA,CAAOW,MAAM,EAC7BP,MAAMQ,QAAQ,IAAIZ,sBAAAA,CAAOY,QAAQ,EACjCR,MAAMF,IAAI,CAACG,SAAS;IAGtB,OAAOD;AACT,EAAE"}
|
|
@@ -6,14 +6,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
function _export(target, all) {
|
|
7
7
|
for(var name in all)Object.defineProperty(target, name, {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: all
|
|
9
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
_export(exports, {
|
|
13
|
-
linkClassNames
|
|
13
|
+
get linkClassNames () {
|
|
14
14
|
return linkClassNames;
|
|
15
15
|
},
|
|
16
|
-
useLinkStyles_unstable
|
|
16
|
+
get useLinkStyles_unstable () {
|
|
17
17
|
return useLinkStyles_unstable;
|
|
18
18
|
}
|
|
19
19
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Link/useLinkStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { 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 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\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.colorNeutralForeground2Link,\n\n ':hover': {\n textDecorationLine: 'underline',\n color: tokens.colorNeutralForeground2LinkHover,\n },\n\n ':active': {\n textDecorationLine: 'underline',\n color: tokens.colorNeutralForeground2LinkPressed,\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 // There is no native disabled state for links, so we need to explicitly style the disabled state for high contrast mode.\n '@media (forced-colors: active)': {\n color: 'GrayText',\n\n ':hover': {\n color: 'GrayText',\n },\n\n ':active': {\n color: 'GrayText',\n },\n },\n },\n inverted: {\n color: tokens.colorBrandForegroundInverted,\n ':hover': {\n color: tokens.colorBrandForegroundInverted,\n },\n ':active': {\n color: tokens.colorBrandForegroundInverted,\n },\n },\n brand: {\n color: tokens.colorNeutralForegroundInvertedLink,\n ':hover': {\n color: tokens.colorNeutralForegroundInvertedLinkHover,\n },\n ':active': {\n color: tokens.colorNeutralForegroundInvertedLinkPressed,\n },\n },\n});\n\nexport const useLinkStyles_unstable = (state: LinkState): LinkState => {\n const styles = useStyles();\n const { appearance, disabled, inline, root, backgroundAppearance } = state;\n\n // eslint-disable-next-line react-hooks/immutability\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 backgroundAppearance === 'inverted' && styles.inverted,\n backgroundAppearance === 'brand' && styles.brand,\n inline && styles.inline,\n disabled && styles.disabled,\n state.root.className,\n );\n\n return state;\n};\n"],"names":["shorthands","makeStyles","mergeClasses","createCustomFocusIndicatorStyle","tokens","linkClassNames","root","useStyles","focusIndicator","textDecorationColor","colorStrokeFocus2","textDecorationLine","textDecorationStyle","outlineStyle","backgroundColor","boxSizing","color","colorBrandForegroundLink","cursor","display","fontFamily","fontFamilyBase","fontSize","fontSizeBase300","fontWeight","fontWeightRegular","margin","padding","overflow","textAlign","textDecorationThickness","strokeWidthThin","textOverflow","userSelect","colorBrandForegroundLinkHover","colorBrandForegroundLinkPressed","button","borderStyle","href","subtle","colorNeutralForeground2Link","colorNeutralForeground2LinkHover","colorNeutralForeground2LinkPressed","inline","disabled","colorNeutralForegroundDisabled","inverted","colorBrandForegroundInverted","brand","colorNeutralForegroundInvertedLink","colorNeutralForegroundInvertedLinkHover","colorNeutralForegroundInvertedLinkPressed","useLinkStyles_unstable","state","styles","appearance","backgroundAppearance","className","as"],"mappings":"AAAA;;;;;;;;;;;;QAQaK;;;QAsHA+C;;;;uBA5HwC,iBAAiB;8BACtB,0BAA0B;4BACnD,wBAAwB;AAIxC,uBAAkD;IACvD9C,MAAM;AACR,EAAE;AAEF,MAAMC,gBAAYN,iBAAAA,EAAW;IAC3BO,oBAAgBL,6CAAAA,EAAgC;QAC9CM,qBAAqBL,kBAAAA,CAAOM,iBAAiB;QAC7CC,oBAAoB;QACpBC,qBAAqB;QACrBC,cAAc;IAChB;IACA,iBAAiB;IACjBP,MAAM;QACJ,kBAAkB;YAChBO,cAAc;QAChB;QACAC,iBAAiB;QACjBC,WAAW;QACXC,OAAOZ,kBAAAA,CAAOa,wBAAwB;QACtCC,QAAQ;QACRC,SAAS;QACTC,YAAYhB,kBAAAA,CAAOiB,cAAc;QACjCC,UAAUlB,kBAAAA,CAAOmB,eAAe;QAChCC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AOZ,kBAAAA,CAAO2C,4BAA4B;QAC5C;IACF;IACAC,OAAO;QACLhC,OAAOZ,kBAAAA,CAAO6C,kCAAkC;QAChD,UAAU;YACRjC,OAAOZ,kBAAAA,CAAO8C,uCAAuC;QACvD;QACA,WAAW;YACTlC,OAAOZ,kBAAAA,CAAO+C,yCAAyC;QACzD;IACF;AACF;AAEO,+BAA+B,CAACE;IACrC,MAAMC,SAAS/C;IACf,MAAM,EAAEgD,UAAU,EAAEX,QAAQ,EAAED,MAAM,EAAErC,IAAI,EAAEkD,oBAAoB,EAAE,GAAGH;IAErE,oDAAoD;IACpDA,MAAM/C,IAAI,CAACmD,SAAS,OAAGvD,mBAAAA,EACrBG,eAAeC,IAAI,EACnBgD,OAAOhD,IAAI,EACXgD,OAAO9C,cAAc,EACrBF,KAAKoD,EAAE,KAAK,OAAOpD,KAAKgC,IAAI,IAAIgB,OAAOhB,IAAI,EAC3ChC,KAAKoD,EAAE,KAAK,YAAYJ,OAAOlB,MAAM,EACrCmB,eAAe,YAAYD,OAAOf,MAAM,EACxCiB,yBAAyB,cAAcF,OAAOR,QAAQ,EACtDU,yBAAyB,WAAWF,OAAON,KAAK,EAChDL,UAAUW,OAAOX,MAAM,EACvBC,YAAYU,OAAOV,QAAQ,EAC3BS,MAAM/C,IAAI,CAACmD,SAAS;IAGtB,OAAOJ;AACT,EAAE"}
|
|
@@ -0,0 +1,28 @@
|
|
|
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: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
get linkClassNames () {
|
|
13
|
+
return linkClassNames;
|
|
14
|
+
},
|
|
15
|
+
get useLinkStyles_unstable () {
|
|
16
|
+
return useLinkStyles_unstable;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
20
|
+
const _clsx = require("clsx");
|
|
21
|
+
const _Linkmodulecss = /*#__PURE__*/ _interop_require_default._(require("./Link.module.css"));
|
|
22
|
+
const linkClassNames = {
|
|
23
|
+
root: 'fui-Link'
|
|
24
|
+
};
|
|
25
|
+
const useLinkStyles_unstable = (state)=>{
|
|
26
|
+
state.root.className = (0, _clsx.clsx)(linkClassNames.root, _Linkmodulecss.default.root, state.root.as === 'a' && state.root.href && _Linkmodulecss.default.href, state.root.as === 'button' && _Linkmodulecss.default.button, _Linkmodulecss.default[state.appearance], state.backgroundAppearance && _Linkmodulecss.default[state.backgroundAppearance], state.inline && _Linkmodulecss.default.inline, state.disabled && _Linkmodulecss.default.disabled, state.root.className);
|
|
27
|
+
return state;
|
|
28
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Link/useLinkStyles.styles.css.ts"],"sourcesContent":["import { clsx } from 'clsx';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { LinkSlots, LinkState } from './Link.types';\nimport styles from './Link.module.css';\n\nexport const linkClassNames: SlotClassNames<LinkSlots> = {\n root: 'fui-Link',\n};\n\nexport const useLinkStyles_unstable = (state: LinkState): LinkState => {\n state.root.className = clsx(\n linkClassNames.root,\n styles.root,\n state.root.as === 'a' && state.root.href && styles.href,\n state.root.as === 'button' && styles.button,\n styles[state.appearance],\n state.backgroundAppearance && styles[state.backgroundAppearance],\n state.inline && styles.inline,\n state.disabled && styles.disabled,\n state.root.className,\n );\n\n return state;\n};\n"],"names":["clsx","styles","linkClassNames","root","useLinkStyles_unstable","state","className","as","href","button","appearance","backgroundAppearance","inline","disabled"],"mappings":";;;;;;;;;;;QAKaE;;;;;;;;sBALQ,OAAO;wEAGT,oBAAoB;AAEhC,uBAAkD;IACvDC,MAAM;AACR,EAAE;AAEK,MAAMC,yBAAyB,CAACC;IACrCA,MAAMF,IAAI,CAACG,SAAS,OAAGN,UAAAA,EACrBE,eAAeC,IAAI,EACnBF,sBAAAA,CAAOE,IAAI,EACXE,MAAMF,IAAI,CAACI,EAAE,KAAK,OAAOF,MAAMF,IAAI,CAACK,IAAI,IAAIP,sBAAAA,CAAOO,IAAI,EACvDH,MAAMF,IAAI,CAACI,EAAE,KAAK,YAAYN,sBAAAA,CAAOQ,MAAM,EAC3CR,sBAAM,CAACI,MAAMK,UAAU,CAAC,EACxBL,MAAMM,oBAAoB,IAAIV,sBAAM,CAACI,MAAMM,oBAAoB,CAAC,EAChEN,MAAMO,MAAM,IAAIX,sBAAAA,CAAOW,MAAM,EAC7BP,MAAMQ,QAAQ,IAAIZ,sBAAAA,CAAOY,QAAQ,EACjCR,MAAMF,IAAI,CAACG,SAAS;IAGtB,OAAOD;AACT,EAAE"}
|
|
@@ -5,17 +5,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
LinkContextProvider
|
|
12
|
+
get LinkContextProvider () {
|
|
13
13
|
return _linkContext.LinkContextProvider;
|
|
14
14
|
},
|
|
15
|
-
linkContextDefaultValue
|
|
15
|
+
get linkContextDefaultValue () {
|
|
16
16
|
return _linkContext.linkContextDefaultValue;
|
|
17
17
|
},
|
|
18
|
-
useLinkContext
|
|
18
|
+
get useLinkContext () {
|
|
19
19
|
return _linkContext.useLinkContext;
|
|
20
20
|
}
|
|
21
21
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../src/contexts/index.ts"],"sourcesContent":["export type { LinkContextValue } from './linkContext';\nexport { LinkContextProvider, linkContextDefaultValue, useLinkContext } from './linkContext';\n"],"names":["LinkContextProvider","linkContextDefaultValue","useLinkContext"],"mappings":";;;;;;;;;;;;eACSA,gCAAmB;;;eAAEC,oCAAuB;;;eAAEC,2BAAc;;;6BAAQ,mBAAgB"}
|
|
@@ -6,17 +6,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
function _export(target, all) {
|
|
7
7
|
for(var name in all)Object.defineProperty(target, name, {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: all
|
|
9
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
_export(exports, {
|
|
13
|
-
LinkContextProvider
|
|
13
|
+
get LinkContextProvider () {
|
|
14
14
|
return LinkContextProvider;
|
|
15
15
|
},
|
|
16
|
-
linkContextDefaultValue
|
|
16
|
+
get linkContextDefaultValue () {
|
|
17
17
|
return linkContextDefaultValue;
|
|
18
18
|
},
|
|
19
|
-
useLinkContext
|
|
19
|
+
get useLinkContext () {
|
|
20
20
|
return useLinkContext;
|
|
21
21
|
}
|
|
22
22
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../src/contexts/linkContext.ts"],"sourcesContent":["'use client';\n\nimport * 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 = (): LinkContextValue => React.useContext(LinkContext) ?? linkContextDefaultValue;\n"],"names":["React","LinkContext","createContext","undefined","linkContextDefaultValue","inline","LinkContextProvider","Provider","useLinkContext","useContext"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;iEAEuB,QAAQ;AAM/B,MAAMC,4BAAcD,OAAME,aAAa,CAA+BC;AAE/D,MAAMC,0BAA4C;IACvDC,QAAQ;AACV,EAAE;AAEK,MAAMC,sBAAsBL,YAAYM,QAAQ,CAAC;AACjD,MAAMC,iBAAiB;QAAwBR;YAAAA,oBAAAA,OAAMS,UAAU,CAACR,YAAAA,MAAAA,QAAjBD,sBAAAA,KAAAA,IAAAA,oBAAiCI;EAAwB"}
|
package/lib-commonjs/index.cjs
CHANGED
|
@@ -5,38 +5,38 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
Link
|
|
12
|
+
get Link () {
|
|
13
13
|
return _Link.Link;
|
|
14
14
|
},
|
|
15
|
-
LinkContextProvider
|
|
15
|
+
get LinkContextProvider () {
|
|
16
16
|
return _index.LinkContextProvider;
|
|
17
17
|
},
|
|
18
|
-
linkClassNames
|
|
18
|
+
get linkClassNames () {
|
|
19
19
|
return _Link.linkClassNames;
|
|
20
20
|
},
|
|
21
|
-
linkContextDefaultValue
|
|
21
|
+
get linkContextDefaultValue () {
|
|
22
22
|
return _index.linkContextDefaultValue;
|
|
23
23
|
},
|
|
24
|
-
renderLink_unstable
|
|
24
|
+
get renderLink_unstable () {
|
|
25
25
|
return _Link.renderLink_unstable;
|
|
26
26
|
},
|
|
27
|
-
useLinkBase_unstable
|
|
27
|
+
get useLinkBase_unstable () {
|
|
28
28
|
return _Link.useLinkBase_unstable;
|
|
29
29
|
},
|
|
30
|
-
useLinkContext
|
|
30
|
+
get useLinkContext () {
|
|
31
31
|
return _index.useLinkContext;
|
|
32
32
|
},
|
|
33
|
-
useLinkState_unstable
|
|
33
|
+
get useLinkState_unstable () {
|
|
34
34
|
return _Link.useLinkState_unstable;
|
|
35
35
|
},
|
|
36
|
-
useLinkStyles_unstable
|
|
36
|
+
get useLinkStyles_unstable () {
|
|
37
37
|
return _Link.useLinkStyles_unstable;
|
|
38
38
|
},
|
|
39
|
-
useLink_unstable
|
|
39
|
+
get useLink_unstable () {
|
|
40
40
|
return _Link.useLink_unstable;
|
|
41
41
|
}
|
|
42
42
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n Link,\n linkClassNames,\n renderLink_unstable,\n useLinkState_unstable,\n useLinkStyles_unstable,\n useLink_unstable,\n useLinkBase_unstable,\n} from './Link';\nexport type { LinkProps, LinkSlots, LinkState, LinkBaseProps, LinkBaseState } 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","useLinkBase_unstable","linkContextDefaultValue","LinkContextProvider","useLinkContext"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n Link,\n linkClassNames,\n renderLink_unstable,\n useLinkState_unstable,\n useLinkStyles_unstable,\n useLink_unstable,\n useLinkBase_unstable,\n} from './Link';\nexport type { LinkProps, LinkSlots, LinkState, LinkBaseProps, LinkBaseState } 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","useLinkBase_unstable","linkContextDefaultValue","LinkContextProvider","useLinkContext"],"mappings":";;;;;;;;;;;;eACEA,UAAI;;;eAS4BQ,0BAAmB;;;eARnDP,oBAAc;;;eAQPM,8BAAuB;;;eAP9BL,yBAAmB;;;eAInBI,0BAAoB;;;eAGiCG,qBAAc;;;eANnEN,2BAAqB;;;eACrBC,4BAAsB;;;eACtBC,sBAAgB;;;sBAEX,YAAS;uBAE6D,sBAAa"}
|
package/package.json
CHANGED
|
@@ -1,25 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui/react-link",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.75.0-experimental.css-modules.20261031-810ab07afb.0",
|
|
4
4
|
"description": "Fluent UI React Link component",
|
|
5
5
|
"main": "lib-commonjs/index.cjs",
|
|
6
6
|
"module": "lib/index.js",
|
|
7
7
|
"typings": "./dist/index.d.ts",
|
|
8
|
-
"sideEffects":
|
|
8
|
+
"sideEffects": [
|
|
9
|
+
"**/*.css"
|
|
10
|
+
],
|
|
9
11
|
"repository": {
|
|
10
12
|
"type": "git",
|
|
11
13
|
"url": "https://github.com/microsoft/fluentui"
|
|
12
14
|
},
|
|
13
15
|
"license": "MIT",
|
|
14
16
|
"dependencies": {
|
|
15
|
-
"@fluentui/keyboard-keys": "9.
|
|
16
|
-
"@fluentui/react-jsx-runtime": "9.
|
|
17
|
-
"@fluentui/react-shared-contexts": "9.
|
|
18
|
-
"@fluentui/react-tabster": "9.
|
|
19
|
-
"@fluentui/react-theme": "9.
|
|
20
|
-
"@fluentui/react-utilities": "9.
|
|
17
|
+
"@fluentui/keyboard-keys": "9.75.0-experimental.css-modules.20261031-810ab07afb.0",
|
|
18
|
+
"@fluentui/react-jsx-runtime": "9.75.0-experimental.css-modules.20261031-810ab07afb.0",
|
|
19
|
+
"@fluentui/react-shared-contexts": "9.75.0-experimental.css-modules.20261031-810ab07afb.0",
|
|
20
|
+
"@fluentui/react-tabster": "9.75.0-experimental.css-modules.20261031-810ab07afb.0",
|
|
21
|
+
"@fluentui/react-theme": "9.75.0-experimental.css-modules.20261031-810ab07afb.0",
|
|
22
|
+
"@fluentui/react-utilities": "9.75.0-experimental.css-modules.20261031-810ab07afb.0",
|
|
21
23
|
"@griffel/react": "^1.5.32",
|
|
22
|
-
"@swc/helpers": "^0.5.1"
|
|
24
|
+
"@swc/helpers": "^0.5.1",
|
|
25
|
+
"clsx": "^2.1.1"
|
|
23
26
|
},
|
|
24
27
|
"peerDependencies": {
|
|
25
28
|
"@types/react": ">=16.14.0 <20.0.0",
|
|
@@ -42,7 +45,6 @@
|
|
|
42
45
|
"default": "./lib-commonjs/index.cjs"
|
|
43
46
|
}
|
|
44
47
|
},
|
|
45
|
-
"./metadata.json": "./dist/metadata/index.json",
|
|
46
48
|
"./package.json": "./package.json"
|
|
47
49
|
},
|
|
48
50
|
"files": [
|
|
@@ -50,9 +52,7 @@
|
|
|
50
52
|
"dist/*.d.ts",
|
|
51
53
|
"dist/*.d.cts",
|
|
52
54
|
"lib",
|
|
53
|
-
"lib-commonjs"
|
|
54
|
-
"dist/metadata"
|
|
55
|
+
"lib-commonjs"
|
|
55
56
|
],
|
|
56
|
-
"type": "module"
|
|
57
|
-
"fluentuiCatalog": "./metadata.json"
|
|
57
|
+
"type": "module"
|
|
58
58
|
}
|