@fluentui/react-link 9.74.9-experimental.menu-disable-autofocus.20261008-e9914a95c6.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 +20 -10
- 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 +12 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,22 +1,32 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-link
|
|
2
2
|
|
|
3
|
-
<!-- This log was last generated on
|
|
3
|
+
<!-- This log was last generated on Sat, 31 Oct 2026 11:08:46 GMT and should not be manually modified. -->
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
-
## [9.
|
|
7
|
+
## [9.75.0-experimental.css-modules.20261031-810ab07afb.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-link_v9.75.0-experimental.css-modules.20261031-810ab07afb.0)
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Sat, 31 Oct 2026 11:08:46 GMT
|
|
10
10
|
|
|
11
11
|
### Changes
|
|
12
12
|
|
|
13
|
-
- Release 9.
|
|
14
|
-
- Bump @fluentui/keyboard-keys to v9.
|
|
15
|
-
- Bump @fluentui/react-jsx-runtime to v9.
|
|
16
|
-
- Bump @fluentui/react-shared-contexts to v9.
|
|
17
|
-
- Bump @fluentui/react-tabster to v9.
|
|
18
|
-
- Bump @fluentui/react-theme to v9.
|
|
19
|
-
- Bump @fluentui/react-utilities to v9.
|
|
13
|
+
- Release 9.75.0-experimental.css-modules.20261031-810ab07afb ([commit](https://github.com/microsoft/fluentui/commit/undefined) by 257645319+office-ogx-auth-helper[bot]@users.noreply.github.com)
|
|
14
|
+
- Bump @fluentui/keyboard-keys to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
15
|
+
- Bump @fluentui/react-jsx-runtime to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
16
|
+
- Bump @fluentui/react-shared-contexts to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
17
|
+
- Bump @fluentui/react-tabster to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
18
|
+
- Bump @fluentui/react-theme to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
19
|
+
- Bump @fluentui/react-utilities to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
20
|
+
|
|
21
|
+
## [9.8.6](https://github.com/microsoft/fluentui/tree/@fluentui/react-link_v9.8.6)
|
|
22
|
+
|
|
23
|
+
Mon, 19 Oct 2026 16:49:01 GMT
|
|
24
|
+
|
|
25
|
+
### Patches
|
|
26
|
+
|
|
27
|
+
- Bump @fluentui/react-jsx-runtime to v9.4.7 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
28
|
+
- Bump @fluentui/react-tabster to v9.26.19 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
29
|
+
- Bump @fluentui/react-utilities to v9.27.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
20
30
|
|
|
21
31
|
## [9.8.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-link_v9.8.5)
|
|
22
32
|
|
package/README.md
CHANGED
|
@@ -37,3 +37,14 @@ See [SPEC.md](./SPEC.md).
|
|
|
37
37
|
### Migration Guide
|
|
38
38
|
|
|
39
39
|
If you're upgrading to Fluent UI v9 see [MIGRATION.md](./MIGRATION.md) for guidance on updating to the latest Link implementation.
|
|
40
|
+
|
|
41
|
+
## Opt-in CSS Modules styles
|
|
42
|
+
|
|
43
|
+
The `use*Styles.styles.css` modules beside the existing Griffel hooks provide opt-in,
|
|
44
|
+
layered CSS alternatives with the same exports. Configure the bundler to replace
|
|
45
|
+
`.styles` with `.styles.css.ts` for source imports and `.styles.js` with
|
|
46
|
+
`.styles.css.js` for built imports. Load CSS Modules as default class-name maps and
|
|
47
|
+
retain the package CSS assets. Default component imports still use Griffel.
|
|
48
|
+
Composed components require their own style alternatives; this does not remove
|
|
49
|
+
all reachable Griffel dependencies. Browser, forced-colors, RTL, and visual-regression
|
|
50
|
+
parity must be validated before switching defaults.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Link/Link.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useLink_unstable } from './useLink';\nimport { useLinkStyles_unstable } from './useLinkStyles.styles';\nimport { renderLink_unstable } from './renderLink';\nimport type { LinkProps } from './Link.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\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 useCustomStyleHook_unstable('useLinkStyles_unstable')(state);\n\n return renderLink_unstable(state);\n // Work around some small mismatches in inferred types which don't matter in practice\n}) as ForwardRefComponent<LinkProps>;\n\nLink.displayName = 'Link';\n"],"names":["React","useLink_unstable","useLinkStyles_unstable","renderLink_unstable","useCustomStyleHook_unstable","Link","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,gBAAgB,QAAQ,eAAY;AAC7C,SAASC,sBAAsB,QAAQ,4BAAyB;AAChE,SAASC,mBAAmB,QAAQ,kBAAe;AAGnD,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;CAEC,GACD,OAAO,MAAMC,qBAAuCL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IAC3E,MAAMC,QAAQR,iBAAiBM,OAAOC;IAEtCN,uBAAuBO;IAEvBL,4BAA4B,0BAA0BK;IAEtD,OAAON,oBAAoBM;AAC3B,qFAAqF;AACvF,GAAqC;AAErCJ,KAAKK,WAAW,GAAG"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
@layer fluentui {
|
|
2
|
+
.root {
|
|
3
|
+
background-color: transparent;
|
|
4
|
+
box-sizing: border-box;
|
|
5
|
+
color: var(--colorBrandForegroundLink);
|
|
6
|
+
cursor: pointer;
|
|
7
|
+
display: inline;
|
|
8
|
+
font-family: var(--fontFamilyBase);
|
|
9
|
+
font-size: var(--fontSizeBase300);
|
|
10
|
+
font-weight: var(--fontWeightRegular);
|
|
11
|
+
margin: 0;
|
|
12
|
+
padding: 0;
|
|
13
|
+
overflow: inherit;
|
|
14
|
+
text-align: left;
|
|
15
|
+
&:dir(rtl) {
|
|
16
|
+
text-align: right;
|
|
17
|
+
}
|
|
18
|
+
text-decoration-line: none;
|
|
19
|
+
text-decoration-thickness: var(--strokeWidthThin);
|
|
20
|
+
text-overflow: inherit;
|
|
21
|
+
user-select: text;
|
|
22
|
+
&:focus-visible {
|
|
23
|
+
outline-style: none;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&:hover {
|
|
27
|
+
text-decoration-line: underline;
|
|
28
|
+
color: var(--colorBrandForegroundLinkHover);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&:active {
|
|
32
|
+
text-decoration-line: underline;
|
|
33
|
+
color: var(--colorBrandForegroundLinkPressed);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.root:where(.button) {
|
|
38
|
+
border-top-style: none;
|
|
39
|
+
border-inline-end-style: none;
|
|
40
|
+
border-bottom-style: none;
|
|
41
|
+
border-inline-start-style: none;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.root:where(.href) {
|
|
45
|
+
font-size: inherit;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.root:where(.subtle) {
|
|
49
|
+
color: var(--colorNeutralForeground2Link);
|
|
50
|
+
&:hover {
|
|
51
|
+
text-decoration-line: underline;
|
|
52
|
+
color: var(--colorNeutralForeground2LinkHover);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&:active {
|
|
56
|
+
text-decoration-line: underline;
|
|
57
|
+
color: var(--colorNeutralForeground2LinkPressed);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.root:where(.inverted) {
|
|
62
|
+
color: var(--colorBrandForegroundInverted);
|
|
63
|
+
&:hover {
|
|
64
|
+
color: var(--colorBrandForegroundInverted);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&:active {
|
|
68
|
+
color: var(--colorBrandForegroundInverted);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.root:where(.brand) {
|
|
73
|
+
color: var(--colorNeutralForegroundInvertedLink);
|
|
74
|
+
&:hover {
|
|
75
|
+
color: var(--colorNeutralForegroundInvertedLinkHover);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
&:active {
|
|
79
|
+
color: var(--colorNeutralForegroundInvertedLinkPressed);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.root:where(.inline) {
|
|
84
|
+
text-decoration-line: underline;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.root:where(.disabled) {
|
|
88
|
+
text-decoration-line: none;
|
|
89
|
+
color: var(--colorNeutralForegroundDisabled);
|
|
90
|
+
cursor: not-allowed;
|
|
91
|
+
&:hover {
|
|
92
|
+
text-decoration-line: none;
|
|
93
|
+
color: var(--colorNeutralForegroundDisabled);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
&:active {
|
|
97
|
+
text-decoration-line: none;
|
|
98
|
+
color: var(--colorNeutralForegroundDisabled);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
@media (forced-colors: active) {
|
|
102
|
+
color: GrayText;
|
|
103
|
+
&:hover {
|
|
104
|
+
color: GrayText;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
&:active {
|
|
108
|
+
color: GrayText;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.root {
|
|
114
|
+
&[data-fui-focus-visible] {
|
|
115
|
+
text-decoration-color: var(--colorStrokeFocus2);
|
|
116
|
+
text-decoration-line: underline;
|
|
117
|
+
text-decoration-style: double;
|
|
118
|
+
outline-style: none;
|
|
119
|
+
}
|
|
120
|
+
&:where(.disabled)[data-fui-focus-visible] {
|
|
121
|
+
text-decoration-line: none;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Link/Link.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, DistributiveOmit, Slot } from '@fluentui/react-utilities';\nimport type { BackgroundAppearanceContextValue } from '@fluentui/react-shared-contexts';\n\nexport type LinkSlots = {\n /**\n * Root of the component that renders as either an <a> or a <button> tag.\n */\n root: Slot<'a', 'button' | 'span'>;\n};\n\nexport type LinkProps = ComponentProps<LinkSlots> & {\n /**\n * A link can appear either with its default style or subtle.\n * If not specified, the link appears with its default styling.\n * @default 'default'\n */\n appearance?: 'default' | 'subtle';\n\n /**\n * Whether the link is disabled.\n * @default false\n */\n disabled?: boolean;\n\n /**\n * When set, allows the link to be focusable even when it has been disabled. This is used in scenarios where it is\n * important to keep a consistent tab order for screen reader and keyboard users.\n * @default false\n */\n disabledFocusable?: boolean;\n\n /**\n * If true, changes styling when the link is being used alongside other text content.\n * @default false\n */\n inline?: boolean;\n};\n\n/**\n * Link props without design-specific props (appearance, inline).\n * Use this when building a base link that is unstyled or uses a custom design system.\n */\nexport type LinkBaseProps = DistributiveOmit<LinkProps, 'appearance' | 'inline'>;\n\nexport type LinkState = ComponentState<LinkSlots> &\n Required<Pick<LinkProps, 'appearance' | 'disabled' | 'disabledFocusable' | 'inline'>> & {\n backgroundAppearance?: BackgroundAppearanceContextValue;\n };\n\n/**\n * Link state without design-specific state (appearance, backgroundAppearance, inline).\n */\nexport type LinkBaseState = DistributiveOmit<LinkState, 'appearance' | 'backgroundAppearance' | 'inline'>;\n"],"names":[],"mappings":"AAiDA;;CAEC,GACD,WAA0G"}
|
|
@@ -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":"AAAA,SAASA,IAAI,QAAQ,YAAS;AAE9B,SAASC,mBAAmB,QAAQ,kBAAe;AACnD,SAASC,gBAAgB,EAAEC,oBAAoB,QAAQ,eAAY;AACnE,SAASC,qBAAqB,QAAQ,oBAAiB;AACvD,SAASC,cAAc,EAAEC,sBAAsB,QAAQ,4BAAyB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import { assertSlots } from "@fluentui/react-utilities";
|
|
1
|
+
import { jsx as _jsx } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
|
+
import { assertSlots } from "@fluentui/react-utilities";
|
|
3
3
|
/**
|
|
4
4
|
* Renders a Link component by passing the state defined props to the appropriate slots.
|
|
5
5
|
*/ export const renderLink_unstable = (state)=>{
|
|
@@ -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":";AAAA,0BAA0B,GAC1B,iDAAiD,GAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAIxD;;CAEC,GACD,OAAO,MAAMC,sBAAsB,CAACC;IAClCF,YAAuBE;IAEvB,qBAAO,KAACA,MAAMC,IAAI;AACpB,EAAE"}
|
|
@@ -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;AAGA,SAASA,wBAAwB,EAAEC,IAAI,QAAQ,4BAA4B;AAC3E,SAASC,uBAAuB,QAAQ,kCAAkC;AAC1E,SAASC,qBAAqB,QAAQ,oBAAiB;AAEvD,SAASC,cAAc,QAAQ,gCAA6B;AAE5D;;;;CAIC,GACD,OAAO,MAAMC,mBAAmB,CAC9BC,OACAC;IAEA,MAAMC,uBAAuBN;IAC7B,MAAM,EAAEO,QAAQC,aAAa,EAAE,GAAGN;IAClC,MAAM,EAAEO,aAAa,SAAS,EAAEF,QAAQG,UAAU,EAAE,GAAGC,WAAW,GAAGP;IAErE,MAAMQ,QAAQC,qBAAqBF,WAAWN;IAE9C,OAAO;QACLI;QACAH;QACAC,MAAM,EAAEG,uBAAAA,wBAAAA,aAAc,CAAC,CAACF;QACxB,GAAGI,KAAK;IACV;AACF,EAAE;AAEF;;;;;;CAMC,GACD,OAAO,MAAMC,uBAAuB,CAClCT,OACAC;IAEA,MAAM,EAAES,WAAW,KAAK,EAAEC,oBAAoB,KAAK,EAAE,GAAGX;IAExD,MAAMY,cAAcZ,MAAMa,EAAE,IAAKb,CAAAA,MAAMc,IAAI,GAAG,MAAM,QAAO;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,KAAK0B,MAAM,CACf3B,yBAAwCkB,aAAa;YACnDX;YACA,GAAGc,mBAAmB;QACxB,IACA;YAAEH;QAAY;IAElB;IAEAf,sBAAsBW;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":"AACA,SAASA,KAAK,EAAEC,KAAK,QAAQ,0BAA0B;AAGvD;;;CAGC,GACD,OAAO,MAAMC,wBAAwB,CAACC;IACpC,MAAM,EAAEC,QAAQ,EAAEC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AAQ,GAAGA,YAAYC;IAC7BF,MAAMO,IAAI,CAAC,gBAAgB,GAAGN,YAAYC,qBAAqBQ;IAC/D,IAAIV,MAAMO,IAAI,CAACC,EAAE,KAAK,UAAU;QAC9BR,MAAMO,IAAI,CAACN,QAAQ,GAAGA,YAAY,CAACC;IACrC;IAEA,OAAOF;AACT,EAAE"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { clsx } from "clsx";
|
|
2
|
+
import styles from "./Link.module.css";
|
|
3
|
+
export const linkClassNames = {
|
|
4
|
+
root: 'fui-Link'
|
|
5
|
+
};
|
|
6
|
+
export const useLinkStyles_unstable = (state)=>{
|
|
7
|
+
state.root.className = clsx(linkClassNames.root, styles.root, state.root.as === 'a' && state.root.href && styles.href, state.root.as === 'button' && styles.button, styles[state.appearance], state.backgroundAppearance && styles[state.backgroundAppearance], state.inline && styles.inline, state.disabled && styles.disabled, state.root.className);
|
|
8
|
+
return state;
|
|
9
|
+
};
|
|
@@ -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":"AAAA,SAASA,IAAI,QAAQ,OAAO;AAG5B,OAAOC,YAAY,oBAAoB;AAEvC,OAAO,MAAMC,iBAA4C;IACvDC,MAAM;AACR,EAAE;AAEF,OAAO,MAAMC,yBAAyB,CAACC;IACrCA,MAAMF,IAAI,CAACG,SAAS,GAAGN,KACrBE,eAAeC,IAAI,EACnBF,OAAOE,IAAI,EACXE,MAAMF,IAAI,CAACI,EAAE,KAAK,OAAOF,MAAMF,IAAI,CAACK,IAAI,IAAIP,OAAOO,IAAI,EACvDH,MAAMF,IAAI,CAACI,EAAE,KAAK,YAAYN,OAAOQ,MAAM,EAC3CR,MAAM,CAACI,MAAMK,UAAU,CAAC,EACxBL,MAAMM,oBAAoB,IAAIV,MAAM,CAACI,MAAMM,oBAAoB,CAAC,EAChEN,MAAMO,MAAM,IAAIX,OAAOW,MAAM,EAC7BP,MAAMQ,QAAQ,IAAIZ,OAAOY,QAAQ,EACjCR,MAAMF,IAAI,CAACG,SAAS;IAGtB,OAAOD;AACT,EAAE"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { clsx } from "clsx";
|
|
2
|
+
import styles from "./Link.module.css";
|
|
3
|
+
export const linkClassNames = {
|
|
4
|
+
root: 'fui-Link'
|
|
5
|
+
};
|
|
6
|
+
export const useLinkStyles_unstable = (state)=>{
|
|
7
|
+
state.root.className = clsx(linkClassNames.root, styles.root, state.root.as === 'a' && state.root.href && styles.href, state.root.as === 'button' && styles.button, styles[state.appearance], state.backgroundAppearance && styles[state.backgroundAppearance], state.inline && styles.inline, state.disabled && styles.disabled, state.root.className);
|
|
8
|
+
return state;
|
|
9
|
+
};
|
|
@@ -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":"AAAA,SAASA,IAAI,QAAQ,OAAO;AAG5B,OAAOC,YAAY,oBAAoB;AAEvC,OAAO,MAAMC,iBAA4C;IACvDC,MAAM;AACR,EAAE;AAEF,OAAO,MAAMC,yBAAyB,CAACC;IACrCA,MAAMF,IAAI,CAACG,SAAS,GAAGN,KACrBE,eAAeC,IAAI,EACnBF,OAAOE,IAAI,EACXE,MAAMF,IAAI,CAACI,EAAE,KAAK,OAAOF,MAAMF,IAAI,CAACK,IAAI,IAAIP,OAAOO,IAAI,EACvDH,MAAMF,IAAI,CAACI,EAAE,KAAK,YAAYN,OAAOQ,MAAM,EAC3CR,MAAM,CAACI,MAAMK,UAAU,CAAC,EACxBL,MAAMM,oBAAoB,IAAIV,MAAM,CAACI,MAAMM,oBAAoB,CAAC,EAChEN,MAAMO,MAAM,IAAIX,OAAOW,MAAM,EAC7BP,MAAMQ,QAAQ,IAAIZ,OAAOY,QAAQ,EACjCR,MAAMF,IAAI,CAACG,SAAS;IAGtB,OAAOD;AACT,EAAE"}
|
|
@@ -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":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;AACT,EAAE"}
|
|
@@ -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":"AACA,SAASA,mBAAmB,EAAEC,uBAAuB,EAAEC,cAAc,QAAQ,mBAAgB"}
|
|
@@ -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;AAEA,YAAYA,WAAW,QAAQ;AAM/B,MAAMC,cAAcD,MAAME,aAAa,CAA+BC;AAEtE,OAAO,MAAMC,0BAA4C;IACvDC,QAAQ;AACV,EAAE;AAEF,OAAO,MAAMC,sBAAsBL,YAAYM,QAAQ,CAAC;AACxD,OAAO,MAAMC,iBAAiB;QAAwBR;YAAAA,oBAAAA,MAAMS,UAAU,CAACR,0BAAjBD,+BAAAA,oBAAiCI;EAAwB"}
|
package/lib-commonjs/Link.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 _index.Link;
|
|
14
14
|
},
|
|
15
|
-
LinkContextProvider
|
|
15
|
+
get LinkContextProvider () {
|
|
16
16
|
return _index1.LinkContextProvider;
|
|
17
17
|
},
|
|
18
|
-
linkClassNames
|
|
18
|
+
get linkClassNames () {
|
|
19
19
|
return _index.linkClassNames;
|
|
20
20
|
},
|
|
21
|
-
linkContextDefaultValue
|
|
21
|
+
get linkContextDefaultValue () {
|
|
22
22
|
return _index1.linkContextDefaultValue;
|
|
23
23
|
},
|
|
24
|
-
renderLink_unstable
|
|
24
|
+
get renderLink_unstable () {
|
|
25
25
|
return _index.renderLink_unstable;
|
|
26
26
|
},
|
|
27
|
-
useLinkBase_unstable
|
|
27
|
+
get useLinkBase_unstable () {
|
|
28
28
|
return _index.useLinkBase_unstable;
|
|
29
29
|
},
|
|
30
|
-
useLinkContext
|
|
30
|
+
get useLinkContext () {
|
|
31
31
|
return _index1.useLinkContext;
|
|
32
32
|
},
|
|
33
|
-
useLinkState_unstable
|
|
33
|
+
get useLinkState_unstable () {
|
|
34
34
|
return _index.useLinkState_unstable;
|
|
35
35
|
},
|
|
36
|
-
useLinkStyles_unstable
|
|
36
|
+
get useLinkStyles_unstable () {
|
|
37
37
|
return _index.useLinkStyles_unstable;
|
|
38
38
|
},
|
|
39
|
-
useLink_unstable
|
|
39
|
+
get useLink_unstable () {
|
|
40
40
|
return _index.useLink_unstable;
|
|
41
41
|
}
|
|
42
42
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/Link.ts"],"sourcesContent":["export type { LinkProps, LinkSlots, LinkState, LinkBaseProps, LinkBaseState } from './components/Link/index';\nexport {\n Link,\n linkClassNames,\n renderLink_unstable,\n useLinkState_unstable,\n useLinkStyles_unstable,\n useLink_unstable,\n useLinkBase_unstable,\n} from './components/Link/index';\nexport type { LinkContextValue } from './contexts';\nexport { LinkContextProvider, linkContextDefaultValue, useLinkContext } from './contexts';\n"],"names":["Link","linkClassNames","renderLink_unstable","useLinkState_unstable","useLinkStyles_unstable","useLink_unstable","useLinkBase_unstable","LinkContextProvider","linkContextDefaultValue","useLinkContext"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/Link.ts"],"sourcesContent":["export type { LinkProps, LinkSlots, LinkState, LinkBaseProps, LinkBaseState } from './components/Link/index';\nexport {\n Link,\n linkClassNames,\n renderLink_unstable,\n useLinkState_unstable,\n useLinkStyles_unstable,\n useLink_unstable,\n useLinkBase_unstable,\n} from './components/Link/index';\nexport type { LinkContextValue } from './contexts';\nexport { LinkContextProvider, linkContextDefaultValue, useLinkContext } from './contexts';\n"],"names":["Link","linkClassNames","renderLink_unstable","useLinkState_unstable","useLinkStyles_unstable","useLink_unstable","useLinkBase_unstable","LinkContextProvider","linkContextDefaultValue","useLinkContext"],"mappings":";;;;;;;;;;;;eAEEA,WAAI;;;eASGO,2BAAmB;;;eAR1BN,qBAAc;;;eAQcO,+BAAuB;;;eAPnDN,0BAAmB;;;eAInBI,2BAAoB;;;eAGiCG,sBAAc;;;eANnEN,4BAAqB;;;eACrBC,6BAAsB;;;eACtBC,uBAAgB;;;uBAEX,6BAA0B;wBAE4C,sBAAa"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Link/Link.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useLink_unstable } from './useLink';\nimport { useLinkStyles_unstable } from './useLinkStyles.styles';\nimport { renderLink_unstable } from './renderLink';\nimport type { LinkProps } from './Link.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\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 useCustomStyleHook_unstable('useLinkStyles_unstable')(state);\n\n return renderLink_unstable(state);\n // Work around some small mismatches in inferred types which don't matter in practice\n}) as ForwardRefComponent<LinkProps>;\n\nLink.displayName = 'Link';\n"],"names":["React","useLink_unstable","useLinkStyles_unstable","renderLink_unstable","useCustomStyleHook_unstable","Link","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;;;;;;;;;;;;iEAEuB,QAAQ;yBACE,eAAY;qCACN,4BAAyB;4BAC5B,kBAAe;qCAGP,kCAAkC;AAKvE,MAAMK,OAAAA,WAAAA,GAAuCL,OAAMM,UAAU,CAAC,CAACC,OAAOC;IAC3E,MAAMC,YAAQR,yBAAAA,EAAiBM,OAAOC;QAEtCN,2CAAAA,EAAuBO;QAEvBL,gDAAAA,EAA4B,0BAA0BK;IAEtD,WAAON,+BAAAA,EAAoBM;AAC3B,qFAAqF;AACvF,GAAqC;AAErCJ,KAAKK,WAAW,GAAG"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
@layer fluentui {
|
|
2
|
+
.root {
|
|
3
|
+
background-color: transparent;
|
|
4
|
+
box-sizing: border-box;
|
|
5
|
+
color: var(--colorBrandForegroundLink);
|
|
6
|
+
cursor: pointer;
|
|
7
|
+
display: inline;
|
|
8
|
+
font-family: var(--fontFamilyBase);
|
|
9
|
+
font-size: var(--fontSizeBase300);
|
|
10
|
+
font-weight: var(--fontWeightRegular);
|
|
11
|
+
margin: 0;
|
|
12
|
+
padding: 0;
|
|
13
|
+
overflow: inherit;
|
|
14
|
+
text-align: left;
|
|
15
|
+
&:dir(rtl) {
|
|
16
|
+
text-align: right;
|
|
17
|
+
}
|
|
18
|
+
text-decoration-line: none;
|
|
19
|
+
text-decoration-thickness: var(--strokeWidthThin);
|
|
20
|
+
text-overflow: inherit;
|
|
21
|
+
user-select: text;
|
|
22
|
+
&:focus-visible {
|
|
23
|
+
outline-style: none;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&:hover {
|
|
27
|
+
text-decoration-line: underline;
|
|
28
|
+
color: var(--colorBrandForegroundLinkHover);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&:active {
|
|
32
|
+
text-decoration-line: underline;
|
|
33
|
+
color: var(--colorBrandForegroundLinkPressed);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.root:where(.button) {
|
|
38
|
+
border-top-style: none;
|
|
39
|
+
border-inline-end-style: none;
|
|
40
|
+
border-bottom-style: none;
|
|
41
|
+
border-inline-start-style: none;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.root:where(.href) {
|
|
45
|
+
font-size: inherit;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.root:where(.subtle) {
|
|
49
|
+
color: var(--colorNeutralForeground2Link);
|
|
50
|
+
&:hover {
|
|
51
|
+
text-decoration-line: underline;
|
|
52
|
+
color: var(--colorNeutralForeground2LinkHover);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&:active {
|
|
56
|
+
text-decoration-line: underline;
|
|
57
|
+
color: var(--colorNeutralForeground2LinkPressed);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.root:where(.inverted) {
|
|
62
|
+
color: var(--colorBrandForegroundInverted);
|
|
63
|
+
&:hover {
|
|
64
|
+
color: var(--colorBrandForegroundInverted);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&:active {
|
|
68
|
+
color: var(--colorBrandForegroundInverted);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.root:where(.brand) {
|
|
73
|
+
color: var(--colorNeutralForegroundInvertedLink);
|
|
74
|
+
&:hover {
|
|
75
|
+
color: var(--colorNeutralForegroundInvertedLinkHover);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
&:active {
|
|
79
|
+
color: var(--colorNeutralForegroundInvertedLinkPressed);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.root:where(.inline) {
|
|
84
|
+
text-decoration-line: underline;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.root:where(.disabled) {
|
|
88
|
+
text-decoration-line: none;
|
|
89
|
+
color: var(--colorNeutralForegroundDisabled);
|
|
90
|
+
cursor: not-allowed;
|
|
91
|
+
&:hover {
|
|
92
|
+
text-decoration-line: none;
|
|
93
|
+
color: var(--colorNeutralForegroundDisabled);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
&:active {
|
|
97
|
+
text-decoration-line: none;
|
|
98
|
+
color: var(--colorNeutralForegroundDisabled);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
@media (forced-colors: active) {
|
|
102
|
+
color: GrayText;
|
|
103
|
+
&:hover {
|
|
104
|
+
color: GrayText;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
&:active {
|
|
108
|
+
color: GrayText;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.root {
|
|
114
|
+
&[data-fui-focus-visible] {
|
|
115
|
+
text-decoration-color: var(--colorStrokeFocus2);
|
|
116
|
+
text-decoration-line: underline;
|
|
117
|
+
text-decoration-style: double;
|
|
118
|
+
outline-style: none;
|
|
119
|
+
}
|
|
120
|
+
&:where(.disabled)[data-fui-focus-visible] {
|
|
121
|
+
text-decoration-line: none;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Link/Link.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, DistributiveOmit, Slot } from '@fluentui/react-utilities';\nimport type { BackgroundAppearanceContextValue } from '@fluentui/react-shared-contexts';\n\nexport type LinkSlots = {\n /**\n * Root of the component that renders as either an <a> or a <button> tag.\n */\n root: Slot<'a', 'button' | 'span'>;\n};\n\nexport type LinkProps = ComponentProps<LinkSlots> & {\n /**\n * A link can appear either with its default style or subtle.\n * If not specified, the link appears with its default styling.\n * @default 'default'\n */\n appearance?: 'default' | 'subtle';\n\n /**\n * Whether the link is disabled.\n * @default false\n */\n disabled?: boolean;\n\n /**\n * When set, allows the link to be focusable even when it has been disabled. This is used in scenarios where it is\n * important to keep a consistent tab order for screen reader and keyboard users.\n * @default false\n */\n disabledFocusable?: boolean;\n\n /**\n * If true, changes styling when the link is being used alongside other text content.\n * @default false\n */\n inline?: boolean;\n};\n\n/**\n * Link props without design-specific props (appearance, inline).\n * Use this when building a base link that is unstyled or uses a custom design system.\n */\nexport type LinkBaseProps = DistributiveOmit<LinkProps, 'appearance' | 'inline'>;\n\nexport type LinkState = ComponentState<LinkSlots> &\n Required<Pick<LinkProps, 'appearance' | 'disabled' | 'disabledFocusable' | 'inline'>> & {\n backgroundAppearance?: BackgroundAppearanceContextValue;\n };\n\n/**\n * Link state without design-specific state (appearance, backgroundAppearance, inline).\n */\nexport type LinkBaseState = DistributiveOmit<LinkState, 'appearance' | 'backgroundAppearance' | 'inline'>;\n"],"names":[],"mappings":"AAiDA;;CAEC,GACD,WAA0G"}
|
|
@@ -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,iBAA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AChFF,GAAGC,cAAc;gBACjBD,GAAGK,aAAa,CAACC,KAAK;YACxB;QACF;IACF;IAEA,sDAAsD;IACtDjB,MAAMC,QAAQ,GAAGA,YAAYC;IAC7BF,MAAMO,IAAI,CAAC,gBAAgB,GAAGN,YAAYC,qBAAqBQ;IAC/D,IAAIV,MAAMO,IAAI,CAACC,EAAE,KAAK,UAAU;QAC9BR,MAAMO,IAAI,CAACN,QAAQ,GAAGA,YAAY,CAACC;IACrC;IAEA,OAAOF;AACT,EAAE"}
|
|
@@ -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,EA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AG,IAAIhE,IAAI,CAAC2C,IAAI,IAAIiB,MAAM,CAACjB,IAAI,EAAE3C,IAAI,CAACgE,EAAE,KAAK,QAAQ,IAAIJ,MAAM,CAACtB,MAAM,EAAEuB,UAAU,KAAK,QAAQ,IAAID,MAAM,CAAChB,MAAM,EAAEkB,oBAAoB,KAAK,UAAU,IAAIF,MAAM,CAACV,QAAQ,EAAEY,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;I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
+
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",
|