@fluentui/react-link 9.0.30 → 9.0.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/.swcrc +30 -0
  2. package/CHANGELOG.json +52 -1
  3. package/CHANGELOG.md +17 -2
  4. package/lib/Link.js.map +1 -1
  5. package/lib/components/Link/Link.js.map +1 -1
  6. package/lib/components/Link/Link.types.js.map +1 -1
  7. package/lib/components/Link/index.js.map +1 -1
  8. package/lib/components/Link/renderLink.js +1 -3
  9. package/lib/components/Link/renderLink.js.map +1 -1
  10. package/lib/components/Link/useLink.js +1 -0
  11. package/lib/components/Link/useLink.js.map +1 -1
  12. package/lib/components/Link/useLinkState.js +2 -3
  13. package/lib/components/Link/useLinkState.js.map +1 -1
  14. package/lib/components/Link/useLinkStyles.js.map +1 -1
  15. package/lib/index.js.map +1 -1
  16. package/lib-commonjs/Link.js +5 -4
  17. package/lib-commonjs/Link.js.map +1 -1
  18. package/lib-commonjs/components/Link/Link.js +16 -16
  19. package/lib-commonjs/components/Link/Link.js.map +1 -1
  20. package/lib-commonjs/components/Link/Link.types.js +3 -2
  21. package/lib-commonjs/components/Link/Link.types.js.map +1 -1
  22. package/lib-commonjs/components/Link/index.js +10 -9
  23. package/lib-commonjs/components/Link/index.js.map +1 -1
  24. package/lib-commonjs/components/Link/renderLink.js +13 -18
  25. package/lib-commonjs/components/Link/renderLink.js.map +1 -1
  26. package/lib-commonjs/components/Link/useLink.js +34 -40
  27. package/lib-commonjs/components/Link/useLink.js.map +1 -1
  28. package/lib-commonjs/components/Link/useLinkState.js +45 -56
  29. package/lib-commonjs/components/Link/useLinkState.js.map +1 -1
  30. package/lib-commonjs/components/Link/useLinkStyles.js +165 -90
  31. package/lib-commonjs/components/Link/useLinkStyles.js.map +1 -1
  32. package/lib-commonjs/index.js +17 -39
  33. package/lib-commonjs/index.js.map +1 -1
  34. package/package.json +9 -8
  35. package/lib-amd/Link.js +0 -6
  36. package/lib-amd/Link.js.map +0 -1
  37. package/lib-amd/components/Link/Link.js +0 -16
  38. package/lib-amd/components/Link/Link.js.map +0 -1
  39. package/lib-amd/components/Link/Link.types.js +0 -5
  40. package/lib-amd/components/Link/Link.types.js.map +0 -1
  41. package/lib-amd/components/Link/index.js +0 -11
  42. package/lib-amd/components/Link/index.js.map +0 -1
  43. package/lib-amd/components/Link/renderLink.js +0 -14
  44. package/lib-amd/components/Link/renderLink.js.map +0 -1
  45. package/lib-amd/components/Link/useLink.js +0 -31
  46. package/lib-amd/components/Link/useLink.js.map +0 -1
  47. package/lib-amd/components/Link/useLinkState.js +0 -54
  48. package/lib-amd/components/Link/useLinkState.js.map +0 -1
  49. package/lib-amd/components/Link/useLinkStyles.js +0 -67
  50. package/lib-amd/components/Link/useLinkStyles.js.map +0 -1
  51. package/lib-amd/index.js +0 -12
  52. package/lib-amd/index.js.map +0 -1
@@ -1,11 +0,0 @@
1
- define(["require", "exports", "tslib", "./Link", "./Link.types", "./renderLink", "./useLink", "./useLinkState", "./useLinkStyles"], function (require, exports, tslib_1, Link_1, Link_types_1, renderLink_1, useLink_1, useLinkState_1, useLinkStyles_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- tslib_1.__exportStar(Link_1, exports);
5
- tslib_1.__exportStar(Link_types_1, exports);
6
- tslib_1.__exportStar(renderLink_1, exports);
7
- tslib_1.__exportStar(useLink_1, exports);
8
- tslib_1.__exportStar(useLinkState_1, exports);
9
- tslib_1.__exportStar(useLinkStyles_1, exports);
10
- });
11
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-link/src/components/Link/index.ts"],"names":[],"mappings":";;;IAAA,sCAAuB;IACvB,4CAA6B;IAC7B,4CAA6B;IAC7B,yCAA0B;IAC1B,8CAA+B;IAC/B,+CAAgC","sourcesContent":["export * from './Link';\nexport * from './Link.types';\nexport * from './renderLink';\nexport * from './useLink';\nexport * from './useLinkState';\nexport * from './useLinkStyles';\n"]}
@@ -1,14 +0,0 @@
1
- define(["require", "exports", "tslib", "react", "@fluentui/react-utilities"], function (require, exports, tslib_1, React, react_utilities_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.renderLink_unstable = void 0;
5
- /**
6
- * Renders a Link component by passing the state defined props to the appropriate slots.
7
- */
8
- var renderLink_unstable = function (state) {
9
- var _a = react_utilities_1.getSlots(state), slots = _a.slots, slotProps = _a.slotProps;
10
- return React.createElement(slots.root, tslib_1.__assign({}, slotProps.root));
11
- };
12
- exports.renderLink_unstable = renderLink_unstable;
13
- });
14
- //# sourceMappingURL=renderLink.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"renderLink.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-link/src/components/Link/renderLink.tsx"],"names":[],"mappings":";;;;IAIA;;OAEG;IACI,IAAM,mBAAmB,GAAG,UAAC,KAAgB;QAC5C,IAAA,KAAuB,0BAAQ,CAAY,KAAK,CAAC,EAA/C,KAAK,WAAA,EAAE,SAAS,eAA+B,CAAC;QAExD,OAAO,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI,EAAI,CAAC;IAC5C,CAAC,CAAC;IAJW,QAAA,mBAAmB,uBAI9B","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { LinkSlots, LinkState } from './Link.types';\n\n/**\n * Renders a Link component by passing the state defined props to the appropriate slots.\n */\nexport const renderLink_unstable = (state: LinkState) => {\n const { slots, slotProps } = getSlots<LinkSlots>(state);\n\n return <slots.root {...slotProps.root} />;\n};\n"]}
@@ -1,31 +0,0 @@
1
- define(["require", "exports", "tslib", "@fluentui/react-utilities", "./useLinkState"], function (require, exports, tslib_1, react_utilities_1, useLinkState_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.useLink_unstable = void 0;
5
- /**
6
- * Given user props, defines default props for the Link, calls useLinkState_unstable, and returns processed state.
7
- * @param props - User provided props to the Link component.
8
- * @param ref - User provided ref to be passed to the Link component.
9
- */
10
- var useLink_unstable = function (props, ref) {
11
- var _a = props.appearance, appearance = _a === void 0 ? 'default' : _a, _b = props.disabled, disabled = _b === void 0 ? false : _b, _c = props.disabledFocusable, disabledFocusable = _c === void 0 ? false : _c, _d = props.inline, inline = _d === void 0 ? false : _d;
12
- var as = props.as || (props.href ? 'a' : 'button');
13
- var type = as === 'button' ? 'button' : undefined;
14
- var state = {
15
- // Props passed at the top-level
16
- appearance: appearance,
17
- disabled: disabled,
18
- disabledFocusable: disabledFocusable,
19
- inline: inline,
20
- // Slots definition
21
- components: {
22
- root: 'a',
23
- },
24
- root: react_utilities_1.getNativeElementProps(as, tslib_1.__assign(tslib_1.__assign({ ref: ref, type: type }, props), { as: as })),
25
- };
26
- useLinkState_1.useLinkState_unstable(state);
27
- return state;
28
- };
29
- exports.useLink_unstable = useLink_unstable;
30
- });
31
- //# sourceMappingURL=useLink.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useLink.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-link/src/components/Link/useLink.ts"],"names":[],"mappings":";;;;IAKA;;;;OAIG;IACI,IAAM,gBAAgB,GAAG,UAC9B,KAAgB,EAChB,GAAqD;QAE7C,IAAA,KAAwF,KAAK,WAAvE,EAAtB,UAAU,mBAAG,SAAS,KAAA,EAAE,KAAgE,KAAK,SAArD,EAAhB,QAAQ,mBAAG,KAAK,KAAA,EAAE,KAA8C,KAAK,kBAA1B,EAAzB,iBAAiB,mBAAG,KAAK,KAAA,EAAE,KAAmB,KAAK,OAAV,EAAd,MAAM,mBAAG,KAAK,KAAA,CAAW;QACtG,IAAM,EAAE,GAAG,KAAK,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;QACrD,IAAM,IAAI,GAAG,EAAE,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;QAEpD,IAAM,KAAK,GAAc;YACvB,gCAAgC;YAChC,UAAU,YAAA;YACV,QAAQ,UAAA;YACR,iBAAiB,mBAAA;YACjB,MAAM,QAAA;YAEN,mBAAmB;YACnB,UAAU,EAAE;gBACV,IAAI,EAAE,GAAG;aACV;YAED,IAAI,EAAE,uCAAqB,CAAC,EAAE,sCAC5B,GAAG,KAAA,EACH,IAAI,MAAA,IACD,KAAK,KACR,EAAE,IAAA,IACF;SACH,CAAC;QAEF,oCAAqB,CAAC,KAAK,CAAC,CAAC;QAE7B,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IA/BW,QAAA,gBAAgB,oBA+B3B","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport { useLinkState_unstable } from './useLinkState';\nimport type { LinkProps, LinkState } from './Link.types';\n\n/**\n * Given user props, defines default props for the Link, calls useLinkState_unstable, and returns processed state.\n * @param props - User provided props to the Link component.\n * @param ref - User provided ref to be passed to the Link component.\n */\nexport const useLink_unstable = (\n props: LinkProps,\n ref: React.Ref<HTMLAnchorElement | HTMLButtonElement>,\n): LinkState => {\n const { appearance = 'default', disabled = false, disabledFocusable = false, inline = false } = props;\n const as = props.as || (props.href ? 'a' : 'button');\n const type = as === 'button' ? 'button' : undefined;\n\n const state: LinkState = {\n // Props passed at the top-level\n appearance,\n disabled,\n disabledFocusable,\n inline,\n\n // Slots definition\n components: {\n root: 'a',\n },\n\n root: getNativeElementProps(as, {\n ref,\n type,\n ...props,\n as,\n }),\n };\n\n useLinkState_unstable(state);\n\n return state;\n};\n"]}
@@ -1,54 +0,0 @@
1
- define(["require", "exports", "@fluentui/keyboard-keys"], function (require, exports, keyboard_keys_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.useLinkState_unstable = void 0;
5
- /**
6
- * The useLinkState_unstable hook processes the Link state.
7
- * @param state - Link state to mutate.
8
- */
9
- var useLinkState_unstable = function (state) {
10
- var disabled = state.disabled, disabledFocusable = state.disabledFocusable;
11
- var _a = state.root, onClick = _a.onClick, onKeyDown = _a.onKeyDown, role = _a.role, tabIndex = _a.tabIndex, type = _a.type;
12
- // Add href and tabIndex=0 for anchor elements.
13
- if (state.root.as === 'a') {
14
- state.root.href = disabled ? undefined : state.root.href;
15
- state.root.tabIndex = tabIndex !== null && tabIndex !== void 0 ? tabIndex : (disabled && !disabledFocusable ? undefined : 0);
16
- // Add role="link" for disabled and disabledFocusable links.
17
- if (disabled || disabledFocusable) {
18
- state.root.role = role || 'link';
19
- }
20
- }
21
- // Add type="button" for button elements.
22
- else {
23
- state.root.type = type || 'button';
24
- }
25
- // Disallow click event when component is disabled and eat events when disabledFocusable is set to true.
26
- state.root.onClick = function (ev) {
27
- if (disabled || disabledFocusable) {
28
- ev.preventDefault();
29
- }
30
- else {
31
- onClick === null || onClick === void 0 ? void 0 : onClick(ev);
32
- }
33
- };
34
- // Disallow keydown event when component is disabled and eat events when disabledFocusable is set to true.
35
- state.root.onKeyDown = function (ev) {
36
- if ((disabled || disabledFocusable) && (ev.key === keyboard_keys_1.Enter || ev.key === keyboard_keys_1.Space)) {
37
- ev.preventDefault();
38
- ev.stopPropagation();
39
- }
40
- else {
41
- onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(ev);
42
- }
43
- };
44
- // Set the aria-disabled and disabled props correctly.
45
- state.disabled = disabled || disabledFocusable;
46
- state.root['aria-disabled'] = disabled || disabledFocusable || undefined;
47
- if (state.root.as === 'button') {
48
- state.root.disabled = disabled && !disabledFocusable;
49
- }
50
- return state;
51
- };
52
- exports.useLinkState_unstable = useLinkState_unstable;
53
- });
54
- //# sourceMappingURL=useLinkState.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useLinkState.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-link/src/components/Link/useLinkState.ts"],"names":[],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,iBAAiB,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,KAAK,qBAAK,IAAI,EAAE,CAAC,GAAG,KAAK,qBAAK,CAAC,EAAE;gBAC7E,EAAE,CAAC,cAAc,EAAE,CAAC;gBACpB,EAAE,CAAC,eAAe,EAAE,CAAC;aACtB;iBAAM;gBACL,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAG,EAAE,CAAC,CAAC;aACjB;QACH,CAAC,CAAC;QAEF,sDAAsD;QACtD,KAAK,CAAC,QAAQ,GAAG,QAAQ,IAAI,iBAAiB,CAAC;QAC/C,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,GAAG,QAAQ,IAAI,iBAAiB,IAAI,SAAS,CAAC;QACzE,IAAI,KAAK,CAAC,IAAI,CAAC,EAAE,KAAK,QAAQ,EAAE;YAC9B,KAAK,CAAC,IAAI,CAAC,QAAQ,GAAG,QAAQ,IAAI,CAAC,iBAAiB,CAAC;SACtD;QAED,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IA9CW,QAAA,qBAAqB,yBA8ChC","sourcesContent":["import * as React from 'react';\nimport { Enter, Space } from '@fluentui/keyboard-keys';\nimport type { LinkState } from './Link.types';\n\n/**\n * The useLinkState_unstable hook processes the Link state.\n * @param state - Link state to mutate.\n */\nexport const useLinkState_unstable = (state: LinkState): LinkState => {\n const { disabled, disabledFocusable } = state;\n const { onClick, onKeyDown, role, tabIndex, type } = state.root;\n\n // Add href and tabIndex=0 for anchor elements.\n if (state.root.as === 'a') {\n state.root.href = disabled ? undefined : state.root.href;\n state.root.tabIndex = tabIndex ?? (disabled && !disabledFocusable ? undefined : 0);\n\n // Add role=\"link\" for disabled and disabledFocusable links.\n if (disabled || disabledFocusable) {\n state.root.role = role || 'link';\n }\n }\n // Add type=\"button\" for button elements.\n else {\n state.root.type = type || 'button';\n }\n\n // Disallow click event when component is disabled and eat events when disabledFocusable is set to true.\n state.root.onClick = (ev: React.MouseEvent<HTMLAnchorElement & HTMLButtonElement>) => {\n if (disabled || disabledFocusable) {\n ev.preventDefault();\n } else {\n onClick?.(ev);\n }\n };\n\n // Disallow keydown event when component is disabled and eat events when disabledFocusable is set to true.\n state.root.onKeyDown = (ev: React.KeyboardEvent<HTMLAnchorElement & HTMLButtonElement>) => {\n if ((disabled || disabledFocusable) && (ev.key === Enter || ev.key === Space)) {\n ev.preventDefault();\n ev.stopPropagation();\n } else {\n onKeyDown?.(ev);\n }\n };\n\n // Set the aria-disabled and disabled props correctly.\n state.disabled = disabled || disabledFocusable;\n state.root['aria-disabled'] = disabled || disabledFocusable || undefined;\n if (state.root.as === 'button') {\n state.root.disabled = disabled && !disabledFocusable;\n }\n\n return state;\n};\n"]}
@@ -1,67 +0,0 @@
1
- define(["require", "exports", "tslib", "@griffel/react", "@fluentui/react-tabster", "@fluentui/react-theme"], function (require, exports, tslib_1, react_1, react_tabster_1, react_theme_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.useLinkStyles_unstable = exports.linkClassNames = void 0;
5
- exports.linkClassNames = {
6
- root: 'fui-Link',
7
- };
8
- var useStyles = react_1.makeStyles({
9
- focusIndicator: react_tabster_1.createCustomFocusIndicatorStyle({
10
- textDecorationColor: react_theme_1.tokens.colorStrokeFocus2,
11
- textDecorationLine: 'underline',
12
- textDecorationStyle: 'double',
13
- }),
14
- // Common styles.
15
- root: tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ backgroundColor: 'transparent', boxSizing: 'border-box', color: react_theme_1.tokens.colorBrandForegroundLink, cursor: 'pointer', display: 'inline', fontFamily: react_theme_1.tokens.fontFamilyBase, fontSize: react_theme_1.tokens.fontSizeBase300, fontWeight: react_theme_1.tokens.fontWeightRegular }, react_1.shorthands.margin(0)), react_1.shorthands.padding(0)), react_1.shorthands.overflow('inherit')), { textAlign: 'left', textDecorationLine: 'none', textDecorationThickness: react_theme_1.tokens.strokeWidthThin, textOverflow: 'inherit', userSelect: 'text', ':hover': {
16
- textDecorationLine: 'underline',
17
- color: react_theme_1.tokens.colorBrandForegroundLinkHover,
18
- }, ':active': {
19
- textDecorationLine: 'underline',
20
- color: react_theme_1.tokens.colorBrandForegroundLinkPressed,
21
- } }),
22
- // Overrides when the Link renders as a button.
23
- button: tslib_1.__assign({}, react_1.shorthands.borderStyle('none')),
24
- // Overrides when an href is present so the Link renders as an anchor.
25
- href: {
26
- fontSize: 'inherit',
27
- },
28
- // Overrides when the Link appears subtle.
29
- subtle: {
30
- color: react_theme_1.tokens.colorNeutralForeground2,
31
- ':hover': {
32
- textDecorationLine: 'underline',
33
- color: react_theme_1.tokens.colorNeutralForeground2Hover,
34
- },
35
- ':active': {
36
- textDecorationLine: 'underline',
37
- color: react_theme_1.tokens.colorNeutralForeground2Pressed,
38
- },
39
- },
40
- // Overrides when the Link is rendered inline within text.
41
- inline: {
42
- textDecorationLine: 'underline',
43
- },
44
- // Overrides when the Link is disabled.
45
- disabled: {
46
- textDecorationLine: 'none',
47
- color: react_theme_1.tokens.colorNeutralForegroundDisabled,
48
- cursor: 'not-allowed',
49
- ':hover': {
50
- textDecorationLine: 'none',
51
- color: react_theme_1.tokens.colorNeutralForegroundDisabled,
52
- },
53
- ':active': {
54
- textDecorationLine: 'none',
55
- color: react_theme_1.tokens.colorNeutralForegroundDisabled,
56
- },
57
- },
58
- });
59
- var useLinkStyles_unstable = function (state) {
60
- var styles = useStyles();
61
- var appearance = state.appearance, disabled = state.disabled, inline = state.inline, root = state.root;
62
- state.root.className = react_1.mergeClasses(exports.linkClassNames.root, styles.root, styles.focusIndicator, root.as === 'a' && root.href && styles.href, root.as === 'button' && styles.button, appearance === 'subtle' && styles.subtle, inline && styles.inline, disabled && styles.disabled, state.root.className);
63
- return state;
64
- };
65
- exports.useLinkStyles_unstable = useLinkStyles_unstable;
66
- });
67
- //# sourceMappingURL=useLinkStyles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useLinkStyles.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-link/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I,CAAC,SAAS,CACrB,CAAC;QAEF,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IAjBW,QAAA,sBAAsB,0BAiBjC","sourcesContent":["import { shorthands, makeStyles, mergeClasses } from '@griffel/react';\nimport { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\nimport { tokens } from '@fluentui/react-theme';\nimport type { LinkSlots, LinkState } from './Link.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const linkClassNames: SlotClassNames<LinkSlots> = {\n root: 'fui-Link',\n};\n\nconst useStyles = makeStyles({\n focusIndicator: createCustomFocusIndicatorStyle({\n textDecorationColor: tokens.colorStrokeFocus2,\n textDecorationLine: 'underline',\n textDecorationStyle: 'double',\n }),\n // Common styles.\n root: {\n backgroundColor: 'transparent',\n boxSizing: 'border-box',\n color: tokens.colorBrandForegroundLink,\n cursor: 'pointer',\n display: 'inline',\n fontFamily: tokens.fontFamilyBase,\n fontSize: tokens.fontSizeBase300,\n fontWeight: tokens.fontWeightRegular,\n ...shorthands.margin(0),\n ...shorthands.padding(0),\n ...shorthands.overflow('inherit'),\n textAlign: 'left',\n textDecorationLine: 'none',\n textDecorationThickness: tokens.strokeWidthThin,\n textOverflow: 'inherit',\n userSelect: 'text',\n\n ':hover': {\n textDecorationLine: 'underline',\n color: tokens.colorBrandForegroundLinkHover,\n },\n\n ':active': {\n textDecorationLine: 'underline',\n color: tokens.colorBrandForegroundLinkPressed,\n },\n },\n // Overrides when the Link renders as a button.\n button: {\n ...shorthands.borderStyle('none'),\n },\n // Overrides when an href is present so the Link renders as an anchor.\n href: {\n fontSize: 'inherit',\n },\n // Overrides when the Link appears subtle.\n subtle: {\n color: tokens.colorNeutralForeground2,\n\n ':hover': {\n textDecorationLine: 'underline',\n color: tokens.colorNeutralForeground2Hover,\n },\n\n ':active': {\n textDecorationLine: 'underline',\n color: tokens.colorNeutralForeground2Pressed,\n },\n },\n // Overrides when the Link is rendered inline within text.\n inline: {\n textDecorationLine: 'underline',\n },\n // Overrides when the Link is disabled.\n disabled: {\n textDecorationLine: 'none',\n color: tokens.colorNeutralForegroundDisabled,\n cursor: 'not-allowed',\n\n ':hover': {\n textDecorationLine: 'none',\n color: tokens.colorNeutralForegroundDisabled,\n },\n\n ':active': {\n textDecorationLine: 'none',\n color: tokens.colorNeutralForegroundDisabled,\n },\n },\n});\n\nexport const useLinkStyles_unstable = (state: LinkState): LinkState => {\n const styles = useStyles();\n const { appearance, disabled, inline, root } = state;\n\n state.root.className = mergeClasses(\n linkClassNames.root,\n styles.root,\n styles.focusIndicator,\n root.as === 'a' && root.href && styles.href,\n root.as === 'button' && styles.button,\n appearance === 'subtle' && styles.subtle,\n inline && styles.inline,\n disabled && styles.disabled,\n state.root.className,\n );\n\n return state;\n};\n"]}
package/lib-amd/index.js DELETED
@@ -1,12 +0,0 @@
1
- define(["require", "exports", "./Link"], function (require, exports, Link_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.useLink_unstable = exports.useLinkStyles_unstable = exports.useLinkState_unstable = exports.renderLink_unstable = exports.linkClassNames = exports.Link = void 0;
5
- Object.defineProperty(exports, "Link", { enumerable: true, get: function () { return Link_1.Link; } });
6
- Object.defineProperty(exports, "linkClassNames", { enumerable: true, get: function () { return Link_1.linkClassNames; } });
7
- Object.defineProperty(exports, "renderLink_unstable", { enumerable: true, get: function () { return Link_1.renderLink_unstable; } });
8
- Object.defineProperty(exports, "useLinkState_unstable", { enumerable: true, get: function () { return Link_1.useLinkState_unstable; } });
9
- Object.defineProperty(exports, "useLinkStyles_unstable", { enumerable: true, get: function () { return Link_1.useLinkStyles_unstable; } });
10
- Object.defineProperty(exports, "useLink_unstable", { enumerable: true, get: function () { return Link_1.useLink_unstable; } });
11
- });
12
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/react-components/react-link/src/index.ts"],"names":[],"mappings":";;;;IACE,4FAAA,IAAI,OAAA;IACJ,sGAAA,cAAc,OAAA;IACd,2GAAA,mBAAmB,OAAA;IACnB,6GAAA,qBAAqB,OAAA;IACrB,8GAAA,sBAAsB,OAAA;IACtB,wGAAA,gBAAgB,OAAA","sourcesContent":["export {\n Link,\n linkClassNames,\n renderLink_unstable,\n useLinkState_unstable,\n useLinkStyles_unstable,\n useLink_unstable,\n} from './Link';\nexport type { LinkProps, LinkSlots, LinkState } from './Link';\n"]}