Initial commit

This commit is contained in:
2025-03-07 19:22:02 +01:00
commit 4a98255d83
55743 changed files with 5280367 additions and 0 deletions
+41
View File
@@ -0,0 +1,41 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
Link: function() {
return _index.Link;
},
LinkContextProvider: function() {
return _contexts.LinkContextProvider;
},
linkClassNames: function() {
return _index.linkClassNames;
},
linkContextDefaultValue: function() {
return _contexts.linkContextDefaultValue;
},
renderLink_unstable: function() {
return _index.renderLink_unstable;
},
useLinkContext: function() {
return _contexts.useLinkContext;
},
useLinkState_unstable: function() {
return _index.useLinkState_unstable;
},
useLinkStyles_unstable: function() {
return _index.useLinkStyles_unstable;
},
useLink_unstable: function() {
return _index.useLink_unstable;
}
});
const _index = require("./components/Link/index");
const _contexts = require("./contexts");
+1
View File
@@ -0,0 +1 @@
{"version":3,"sources":["../src/Link.ts"],"sourcesContent":["export type { LinkProps, LinkSlots, LinkState } from './components/Link/index';\nexport {\n Link,\n linkClassNames,\n renderLink_unstable,\n useLinkState_unstable,\n useLinkStyles_unstable,\n useLink_unstable,\n} from './components/Link/index';\nexport type { LinkContextValue } from './contexts';\nexport { LinkContextProvider, linkContextDefaultValue, useLinkContext } from './contexts';\n"],"names":["Link","LinkContextProvider","linkClassNames","linkContextDefaultValue","renderLink_unstable","useLinkContext","useLinkState_unstable","useLinkStyles_unstable","useLink_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAEEA,IAAI;eAAJA,WAAI;;IAQGC,mBAAmB;eAAnBA,6BAAmB;;IAP1BC,cAAc;eAAdA,qBAAc;;IAOcC,uBAAuB;eAAvBA,iCAAuB;;IANnDC,mBAAmB;eAAnBA,0BAAmB;;IAMkCC,cAAc;eAAdA,wBAAc;;IALnEC,qBAAqB;eAArBA,4BAAqB;;IACrBC,sBAAsB;eAAtBA,6BAAsB;;IACtBC,gBAAgB;eAAhBA,uBAAgB;;;uBACX;0BAEsE"}
+22
View File
@@ -0,0 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "Link", {
enumerable: true,
get: function() {
return Link;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _useLink = require("./useLink");
const _useLinkStylesstyles = require("./useLinkStyles.styles");
const _renderLink = require("./renderLink");
const Link = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
const state = (0, _useLink.useLink_unstable)(props, ref);
(0, _useLinkStylesstyles.useLinkStyles_unstable)(state);
return (0, _renderLink.renderLink_unstable)(state);
// Work around some small mismatches in inferred types which don't matter in practice
});
Link.displayName = 'Link';
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Link/Link.tsx"],"sourcesContent":["import * 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';\n\n/**\n * A Link is a reference to data that a user can follow by clicking or tapping it.\n */\nexport const Link: ForwardRefComponent<LinkProps> = React.forwardRef((props, ref) => {\n const state = useLink_unstable(props, ref);\n\n useLinkStyles_unstable(state);\n\n return renderLink_unstable(state);\n // Work around some small mismatches in inferred types which don't matter in practice\n}) as ForwardRefComponent<LinkProps>;\n\nLink.displayName = 'Link';\n"],"names":["Link","React","forwardRef","props","ref","state","useLink_unstable","useLinkStyles_unstable","renderLink_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAUaA;;;eAAAA;;;;iEAVU;yBACU;qCACM;4BACH;AAO7B,MAAMA,OAAAA,WAAAA,GAAuCC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IAC3E,MAAMC,QAAQC,IAAAA,yBAAAA,EAAiBH,OAAOC;IAEtCG,IAAAA,2CAAAA,EAAuBF;IAEvB,OAAOG,IAAAA,+BAAAA,EAAoBH;AAC3B,qFAAqF;AACvF;AAEAL,KAAKS,WAAW,GAAG"}
@@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Link/Link.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { 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\nexport type LinkState = ComponentState<LinkSlots> &\n Required<Pick<LinkProps, 'appearance' | 'disabled' | 'disabledFocusable' | 'inline'>> & {\n backgroundAppearance?: BackgroundAppearanceContextValue;\n };\n"],"names":[],"rangeMappings":"","mappings":""}
@@ -0,0 +1,35 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
Link: function() {
return _Link.Link;
},
linkClassNames: function() {
return _useLinkStylesstyles.linkClassNames;
},
renderLink_unstable: function() {
return _renderLink.renderLink_unstable;
},
useLinkState_unstable: function() {
return _useLinkState.useLinkState_unstable;
},
useLinkStyles_unstable: function() {
return _useLinkStylesstyles.useLinkStyles_unstable;
},
useLink_unstable: function() {
return _useLink.useLink_unstable;
}
});
const _Link = require("./Link");
const _renderLink = require("./renderLink");
const _useLink = require("./useLink");
const _useLinkState = require("./useLinkState");
const _useLinkStylesstyles = require("./useLinkStyles.styles");
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Link/index.ts"],"sourcesContent":["export { Link } from './Link';\nexport type { LinkProps, LinkSlots, LinkState } from './Link.types';\nexport { renderLink_unstable } from './renderLink';\nexport { useLink_unstable } from './useLink';\nexport { useLinkState_unstable } from './useLinkState';\nexport { linkClassNames, useLinkStyles_unstable } from './useLinkStyles.styles';\n"],"names":["Link","linkClassNames","renderLink_unstable","useLinkState_unstable","useLinkStyles_unstable","useLink_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAASA,IAAI;eAAJA,UAAI;;IAKJC,cAAc;eAAdA,mCAAc;;IAHdC,mBAAmB;eAAnBA,+BAAmB;;IAEnBC,qBAAqB;eAArBA,mCAAqB;;IACLC,sBAAsB;eAAtBA,2CAAsB;;IAFtCC,gBAAgB;eAAhBA,yBAAgB;;;sBAHJ;4BAEe;yBACH;8BACK;qCACiB"}
@@ -0,0 +1,16 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "renderLink_unstable", {
enumerable: true,
get: function() {
return renderLink_unstable;
}
});
const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
const _reactutilities = require("@fluentui/react-utilities");
const renderLink_unstable = (state)=>{
(0, _reactutilities.assertSlots)(state);
return /*#__PURE__*/ (0, _jsxruntime.jsx)(state.root, {});
};
@@ -0,0 +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 { 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 assertSlots<LinkSlots>(state);\n\n return <state.root />;\n};\n"],"names":["renderLink_unstable","state","assertSlots","_jsx","root"],"rangeMappings":";;;;;;;;;;;;;;;","mappings":";;;;+BASaA;;;eAAAA;;;4BARb;gCAE4B;AAMrB,MAAMA,sBAAsB,CAACC;IAClCC,IAAAA,2BAAAA,EAAuBD;IAEvB,OAAA,WAAA,GAAOE,IAAAA,eAAA,EAACF,MAAMG,IAAI,EAAA,CAAA;AACpB"}
@@ -0,0 +1,49 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "useLink_unstable", {
enumerable: true,
get: function() {
return useLink_unstable;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _reactutilities = require("@fluentui/react-utilities");
const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
const _useLinkState = require("./useLinkState");
const _linkContext = require("../../contexts/linkContext");
const useLink_unstable = (props, ref)=>{
const backgroundAppearance = (0, _reactsharedcontexts.useBackgroundAppearance)();
const { inline: inlineContext } = (0, _linkContext.useLinkContext)();
const { appearance = 'default', disabled = false, disabledFocusable = false, inline = false } = props;
const elementType = props.as || (props.href ? 'a' : 'button');
// Casting is required here as `as` prop would break the union between `a`, `button` and `span` types
const propsWithAssignedAs = {
role: elementType === 'span' ? 'button' : undefined,
type: elementType === 'button' ? 'button' : undefined,
...props,
as: elementType
};
const state = {
// Props passed at the top-level
appearance,
disabled,
disabledFocusable,
inline: inline !== null && inline !== void 0 ? inline : !!inlineContext,
// Slots definition
components: {
root: elementType
},
root: _reactutilities.slot.always((0, _reactutilities.getIntrinsicElementProps)(elementType, {
ref,
...propsWithAssignedAs
}), {
elementType
}),
backgroundAppearance
};
(0, _useLinkState.useLinkState_unstable)(state);
return state;
};
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Link/useLink.ts"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\nimport { useBackgroundAppearance } from '@fluentui/react-shared-contexts';\nimport { useLinkState_unstable } from './useLinkState';\nimport type { LinkProps, LinkState } from './Link.types';\nimport { useLinkContext } from '../../contexts/linkContext';\n\n/**\n * Given user props, defines default props for the Link, calls useLinkState_unstable, and returns processed state.\n * @param props - User provided props to the Link component.\n * @param ref - User provided ref to be passed to the Link component.\n */\nexport const useLink_unstable = (\n props: LinkProps,\n ref: React.Ref<HTMLAnchorElement | HTMLButtonElement | HTMLSpanElement>,\n): LinkState => {\n const backgroundAppearance = useBackgroundAppearance();\n const { inline: inlineContext } = useLinkContext();\n const { appearance = 'default', disabled = false, disabledFocusable = false, inline = false } = props;\n\n const elementType = props.as || (props.href ? 'a' : 'button');\n\n // Casting is required here as `as` prop would break the union between `a`, `button` and `span` types\n const propsWithAssignedAs = {\n role: elementType === 'span' ? 'button' : undefined,\n type: elementType === 'button' ? 'button' : undefined,\n ...props,\n as: elementType,\n } as LinkProps;\n\n const state: LinkState = {\n // Props passed at the top-level\n appearance,\n disabled,\n disabledFocusable,\n inline: inline ?? !!inlineContext,\n\n // Slots definition\n components: {\n root: elementType,\n },\n\n root: slot.always(\n getIntrinsicElementProps<LinkProps>(elementType, {\n ref,\n ...propsWithAssignedAs,\n } as const),\n { elementType },\n ),\n backgroundAppearance,\n };\n\n useLinkState_unstable(state);\n\n return state;\n};\n"],"names":["useLink_unstable","props","ref","backgroundAppearance","useBackgroundAppearance","inline","inlineContext","useLinkContext","appearance","disabled","disabledFocusable","elementType","as","href","propsWithAssignedAs","role","undefined","type","state","components","root","slot","always","getIntrinsicElementProps","useLinkState_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAYaA;;;eAAAA;;;;iEAZU;gCACwB;qCACP;8BACF;6BAEP;AAOxB,MAAMA,mBAAmB,CAC9BC,OACAC;IAEA,MAAMC,uBAAuBC,IAAAA,4CAAAA;IAC7B,MAAM,EAAEC,QAAQC,aAAa,EAAE,GAAGC,IAAAA,2BAAAA;IAClC,MAAM,EAAEC,aAAa,SAAS,EAAEC,WAAW,KAAK,EAAEC,oBAAoB,KAAK,EAAEL,SAAS,KAAK,EAAE,GAAGJ;IAEhG,MAAMU,cAAcV,MAAMW,EAAE,IAAKX,CAAAA,MAAMY,IAAI,GAAG,MAAM,QAAA;IAEpD,qGAAqG;IACrG,MAAMC,sBAAsB;QAC1BC,MAAMJ,gBAAgB,SAAS,WAAWK;QAC1CC,MAAMN,gBAAgB,WAAW,WAAWK;QAC5C,GAAGf,KAAK;QACRW,IAAID;IACN;IAEA,MAAMO,QAAmB;QACvB,gCAAgC;QAChCV;QACAC;QACAC;QACAL,QAAQA,WAAAA,QAAAA,WAAAA,KAAAA,IAAAA,SAAU,CAAC,CAACC;QAEpB,mBAAmB;QACnBa,YAAY;YACVC,MAAMT;QACR;QAEAS,MAAMC,oBAAAA,CAAKC,MAAM,CACfC,IAAAA,wCAAAA,EAAoCZ,aAAa;YAC/CT;YACA,GAAGY,mBAAmB;QACxB,IACA;YAAEH;QAAY;QAEhBR;IACF;IAEAqB,IAAAA,mCAAAA,EAAsBN;IAEtB,OAAOA;AACT"}
@@ -0,0 +1,59 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "useLinkState_unstable", {
enumerable: true,
get: function() {
return useLinkState_unstable;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _keyboardkeys = require("@fluentui/keyboard-keys");
const useLinkState_unstable = (state)=>{
const { disabled, disabledFocusable } = state;
const { onClick, onKeyDown, role, tabIndex } = state.root;
// Add href for anchor elements.
if (state.root.as === 'a') {
state.root.href = disabled ? undefined : state.root.href;
// Add role="link" for disabled and disabledFocusable links.
if (disabled || disabledFocusable) {
state.root.role = role || 'link';
}
}
// Add tabIndex=0 for anchor and span elements.
if (state.root.as === 'a' || state.root.as === 'span') {
state.root.tabIndex = tabIndex !== null && tabIndex !== void 0 ? tabIndex : disabled && !disabledFocusable ? undefined : 0;
}
// Disallow click event when component is disabled and eat events when disabledFocusable is set to true.
state.root.onClick = (ev)=>{
if (disabled || disabledFocusable) {
ev.preventDefault();
} else {
onClick === null || onClick === void 0 ? void 0 : onClick(ev);
}
};
// Disallow keydown event when component is disabled and eat events when disabledFocusable is set to true.
state.root.onKeyDown = (ev)=>{
const keyPressed = ev.key === _keyboardkeys.Enter || ev.key === _keyboardkeys.Space;
if ((disabled || disabledFocusable) && keyPressed) {
ev.preventDefault();
ev.stopPropagation();
} else {
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(ev);
// if there is already onKeyDown provided - respect it
if (state.root.as === 'span' && !!state.root.onClick && !onKeyDown && keyPressed) {
ev.preventDefault();
ev.currentTarget.click();
}
}
};
// Set the aria-disabled and disabled props correctly.
state.disabled = disabled || disabledFocusable;
state.root['aria-disabled'] = disabled || disabledFocusable || undefined;
if (state.root.as === 'button') {
state.root.disabled = disabled && !disabledFocusable;
}
return state;
};
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Link/useLinkState.ts"],"sourcesContent":["import * as React from 'react';\nimport { Enter, Space } from '@fluentui/keyboard-keys';\nimport type { LinkState } from './Link.types';\n\n/**\n * The useLinkState_unstable hook processes the Link state.\n * @param state - Link state to mutate.\n */\nexport const useLinkState_unstable = (state: LinkState): LinkState => {\n const { disabled, disabledFocusable } = state;\n const { onClick, onKeyDown, role, tabIndex } = 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":["useLinkState_unstable","state","disabled","disabledFocusable","onClick","onKeyDown","role","tabIndex","root","as","href","undefined","ev","preventDefault","keyPressed","key","Enter","Space","stopPropagation","currentTarget","click"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAQaA;;;eAAAA;;;;iEARU;8BACM;AAOtB,MAAMA,wBAAwB,CAACC;IACpC,MAAM,EAAEC,QAAQ,EAAEC,iBAAiB,EAAE,GAAGF;IACxC,MAAM,EAAEG,OAAO,EAAEC,SAAS,EAAEC,IAAI,EAAEC,QAAQ,EAAE,GAAGN,MAAMO,IAAI;IAEzD,gCAAgC;IAChC,IAAIP,MAAMO,IAAI,CAACC,EAAE,KAAK,KAAK;QACzBR,MAAMO,IAAI,CAACE,IAAI,GAAGR,WAAWS,YAAYV,MAAMO,IAAI,CAACE,IAAI;QAExD,4DAA4D;QAC5D,IAAIR,YAAYC,mBAAmB;YACjCF,MAAMO,IAAI,CAACF,IAAI,GAAGA,QAAQ;QAC5B;IACF;IAEA,+CAA+C;IAC/C,IAAIL,MAAMO,IAAI,CAACC,EAAE,KAAK,OAAOR,MAAMO,IAAI,CAACC,EAAE,KAAK,QAAQ;QACrDR,MAAMO,IAAI,CAACD,QAAQ,GAAGA,aAAAA,QAAAA,aAAAA,KAAAA,IAAAA,WAAaL,YAAY,CAACC,oBAAoBQ,YAAY;IAClF;IAEA,wGAAwG;IACxGV,MAAMO,IAAI,CAACJ,OAAO,GAAG,CAACQ;QACpB,IAAIV,YAAYC,mBAAmB;YACjCS,GAAGC,cAAc;QACnB,OAAO;YACLT,YAAAA,QAAAA,YAAAA,KAAAA,IAAAA,KAAAA,IAAAA,QAAUQ;QACZ;IACF;IAEA,0GAA0G;IAC1GX,MAAMO,IAAI,CAACH,SAAS,GAAG,CAACO;QACtB,MAAME,aAAaF,GAAGG,GAAG,KAAKC,mBAAAA,IAASJ,GAAGG,GAAG,KAAKE,mBAAAA;QAElD,IAAI,AAACf,CAAAA,YAAYC,iBAAAA,KAAsBW,YAAY;YACjDF,GAAGC,cAAc;YACjBD,GAAGM,eAAe;QACpB,OAAO;YACLb,cAAAA,QAAAA,cAAAA,KAAAA,IAAAA,KAAAA,IAAAA,UAAYO;YACZ,sDAAsD;YACtD,IAAIX,MAAMO,IAAI,CAACC,EAAE,KAAK,UAAU,CAAC,CAACR,MAAMO,IAAI,CAACJ,OAAO,IAAI,CAACC,aAAaS,YAAY;gBAChFF,GAAGC,cAAc;gBACjBD,GAAGO,aAAa,CAACC,KAAK;YACxB;QACF;IACF;IAEA,sDAAsD;IACtDnB,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"}
@@ -0,0 +1,180 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
linkClassNames: function() {
return linkClassNames;
},
useLinkStyles_unstable: function() {
return useLinkStyles_unstable;
}
});
const _react = require("@griffel/react");
const linkClassNames = {
root: 'fui-Link'
};
const useStyles = /*#__PURE__*/ (0, _react.__styles)({
focusIndicator: {
Bttzg6e: "fhgqx19",
B3uz8dt: "f1olyrje",
B6ihwck: "f1p93eir",
g9k6zt: "f1nev41a"
},
root: {
B486eqv: "f2hkw1w",
De3pzq: "f3rmtva",
B7ck84d: "f1ewtqcl",
sj55zd: "fyind8e",
Bceei9c: "f1k6fduh",
mc9l5x: "f1w7gpdv",
Bahqtrf: "fk6fouc",
Be2twd7: "fkhj508",
Bhrd7zp: "figsok6",
jrapky: 0,
Frg6f3: 0,
t21cq0: 0,
B6of3ja: 0,
B74szlk: "f1s184ao",
Byoj8tv: 0,
uwmqm3: 0,
z189sj: 0,
z8tnut: 0,
B0ocmuz: "f1mk8lai",
B68tc82: 0,
Bmxbyg5: 0,
Bpg54ce: "fnbmjn9",
fsow6f: [
"f1o700av",
"fes3tcz"
],
w71qe1: "f1iuv45f",
Bkioxbp: "f1cmlufx",
ygn44y: "f9n3di6",
famaaq: "f1ids18y",
Bde5pd6: "f1tx3yz7",
Bi91k9c: "f1deo86v",
i089h6: "f1eh06m1",
lj723h: "f1iescvh"
},
button: {
icvyot: "f1ern45e",
vrafjx: [
"f1n71otn",
"f1deefiw"
],
oivjwe: "f1h8hb77",
wvpqe5: [
"f1deefiw",
"f1n71otn"
]
},
href: {
Be2twd7: "fjoy568"
},
subtle: {
sj55zd: "fkfq4zb",
Bde5pd6: "f1tx3yz7",
Bi91k9c: "fnwyq0v",
i089h6: "f1eh06m1",
lj723h: "flvvhsy"
},
inline: {
w71qe1: "f13mvf36"
},
disabled: {
w71qe1: "f1iuv45f",
sj55zd: "f1s2aq7o",
Bceei9c: "fdrzuqr",
Bde5pd6: "fbnuktb",
Bi91k9c: "fvgxktp",
i089h6: "fljg2da",
lj723h: "f19wldhg"
},
inverted: {
sj55zd: "f1qz2gb0",
Bi91k9c: "f1mlt8il",
lj723h: "f1hsd4st"
}
}, {
d: [
".fhgqx19[data-fui-focus-visible]{text-decoration-color:var(--colorStrokeFocus2);}",
".f1olyrje[data-fui-focus-visible]{text-decoration-line:underline;}",
".f1p93eir[data-fui-focus-visible]{text-decoration-style:double;}",
".f1nev41a[data-fui-focus-visible]{outline-style:none;}",
".f3rmtva{background-color:transparent;}",
".f1ewtqcl{box-sizing:border-box;}",
".fyind8e{color:var(--colorBrandForegroundLink);}",
".f1k6fduh{cursor:pointer;}",
".f1w7gpdv{display:inline;}",
".fk6fouc{font-family:var(--fontFamilyBase);}",
".fkhj508{font-size:var(--fontSizeBase300);}",
".figsok6{font-weight:var(--fontWeightRegular);}",
[
".f1s184ao{margin:0;}",
{
p: -1
}
],
[
".f1mk8lai{padding:0;}",
{
p: -1
}
],
[
".fnbmjn9{overflow:inherit;}",
{
p: -1
}
],
".f1o700av{text-align:left;}",
".fes3tcz{text-align:right;}",
".f1iuv45f{text-decoration-line:none;}",
".f1cmlufx{text-decoration-thickness:var(--strokeWidthThin);}",
".f9n3di6{text-overflow:inherit;}",
".f1ids18y{-webkit-user-select:text;-moz-user-select:text;user-select:text;}",
".f1ern45e{border-top-style:none;}",
".f1n71otn{border-right-style:none;}",
".f1deefiw{border-left-style:none;}",
".f1h8hb77{border-bottom-style:none;}",
".fjoy568{font-size:inherit;}",
".fkfq4zb{color:var(--colorNeutralForeground2);}",
".f13mvf36{text-decoration-line:underline;}",
".f1s2aq7o{color:var(--colorNeutralForegroundDisabled);}",
".fdrzuqr{cursor:not-allowed;}",
".f1qz2gb0{color:var(--colorBrandForegroundInverted);}"
],
i: [
".f2hkw1w:focus-visible{outline-style:none;}"
],
h: [
".f1tx3yz7:hover{text-decoration-line:underline;}",
".f1deo86v:hover{color:var(--colorBrandForegroundLinkHover);}",
".fnwyq0v:hover{color:var(--colorNeutralForeground2Hover);}",
".fbnuktb:hover{text-decoration-line:none;}",
".fvgxktp:hover{color:var(--colorNeutralForegroundDisabled);}",
".f1mlt8il:hover{color:var(--colorBrandForegroundInvertedHover);}"
],
a: [
".f1eh06m1:active{text-decoration-line:underline;}",
".f1iescvh:active{color:var(--colorBrandForegroundLinkPressed);}",
".flvvhsy:active{color:var(--colorNeutralForeground2Pressed);}",
".fljg2da:active{text-decoration-line:none;}",
".f19wldhg:active{color:var(--colorNeutralForegroundDisabled);}",
".f1hsd4st:active{color:var(--colorBrandForegroundInvertedPressed);}"
]
});
const useLinkStyles_unstable = (state)=>{
'use no memo';
const styles = useStyles();
const { appearance, disabled, inline, root, backgroundAppearance } = state;
state.root.className = (0, _react.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, inline && styles.inline, disabled && styles.disabled, state.root.className);
return state;
};
File diff suppressed because one or more lines are too long
+22
View File
@@ -0,0 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
LinkContextProvider: function() {
return _linkContext.LinkContextProvider;
},
linkContextDefaultValue: function() {
return _linkContext.linkContextDefaultValue;
},
useLinkContext: function() {
return _linkContext.useLinkContext;
}
});
const _linkContext = require("./linkContext");
+1
View File
@@ -0,0 +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"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IACSA,mBAAmB;eAAnBA,gCAAmB;;IAAEC,uBAAuB;eAAvBA,oCAAuB;;IAAEC,cAAc;eAAdA,2BAAc;;;6BAAQ"}
+32
View File
@@ -0,0 +1,32 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
LinkContextProvider: function() {
return LinkContextProvider;
},
linkContextDefaultValue: function() {
return linkContextDefaultValue;
},
useLinkContext: function() {
return useLinkContext;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const LinkContext = /*#__PURE__*/ _react.createContext(undefined);
const linkContextDefaultValue = {
inline: false
};
const LinkContextProvider = LinkContext.Provider;
const useLinkContext = ()=>{
var _React_useContext;
return (_React_useContext = _react.useContext(LinkContext)) !== null && _React_useContext !== void 0 ? _React_useContext : linkContextDefaultValue;
};
@@ -0,0 +1 @@
{"version":3,"sources":["../src/contexts/linkContext.ts"],"sourcesContent":["import * as React from 'react';\n\nexport type LinkContextValue = {\n inline?: boolean;\n};\n\nconst LinkContext = React.createContext<LinkContextValue | undefined>(undefined);\n\nexport const linkContextDefaultValue: LinkContextValue = {\n inline: false,\n};\n\nexport const LinkContextProvider = LinkContext.Provider;\nexport const useLinkContext = () => React.useContext(LinkContext) ?? linkContextDefaultValue;\n"],"names":["LinkContextProvider","linkContextDefaultValue","useLinkContext","LinkContext","React","createContext","undefined","inline","Provider","useContext"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAYaA,mBAAAA;eAAAA;;IAJAC,uBAAAA;eAAAA;;IAKAC,cAAAA;eAAAA;;;;iEAbU;AAMvB,MAAMC,4BAAcC,OAAMC,aAAa,CAA+BC;AAE/D,MAAML,0BAA4C;IACvDM,QAAQ;AACV;AAEO,MAAMP,sBAAsBG,YAAYK,QAAQ;AAChD,MAAMN,iBAAiB;QAAME;WAAAA,CAAAA,oBAAAA,OAAMK,UAAU,CAACN,YAAAA,MAAAA,QAAjBC,sBAAAA,KAAAA,IAAAA,oBAAiCH;AAAsB"}
+41
View File
@@ -0,0 +1,41 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
Link: function() {
return _Link.Link;
},
LinkContextProvider: function() {
return _contexts.LinkContextProvider;
},
linkClassNames: function() {
return _Link.linkClassNames;
},
linkContextDefaultValue: function() {
return _contexts.linkContextDefaultValue;
},
renderLink_unstable: function() {
return _Link.renderLink_unstable;
},
useLinkContext: function() {
return _contexts.useLinkContext;
},
useLinkState_unstable: function() {
return _Link.useLinkState_unstable;
},
useLinkStyles_unstable: function() {
return _Link.useLinkStyles_unstable;
},
useLink_unstable: function() {
return _Link.useLink_unstable;
}
});
const _Link = require("./Link");
const _contexts = require("./contexts");
+1
View File
@@ -0,0 +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} from './Link';\nexport type { LinkProps, LinkSlots, LinkState } from './Link';\nexport { linkContextDefaultValue, LinkContextProvider, useLinkContext } from './contexts';\nexport type { LinkContextValue } from './contexts';\n"],"names":["Link","LinkContextProvider","linkClassNames","linkContextDefaultValue","renderLink_unstable","useLinkContext","useLinkState_unstable","useLinkStyles_unstable","useLink_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IACEA,IAAI;eAAJA,UAAI;;IAQ4BC,mBAAmB;eAAnBA,6BAAmB;;IAPnDC,cAAc;eAAdA,oBAAc;;IAOPC,uBAAuB;eAAvBA,iCAAuB;;IAN9BC,mBAAmB;eAAnBA,yBAAmB;;IAMkCC,cAAc;eAAdA,wBAAc;;IALnEC,qBAAqB;eAArBA,2BAAqB;;IACrBC,sBAAsB;eAAtBA,4BAAsB;;IACtBC,gBAAgB;eAAhBA,sBAAgB;;;sBACX;0BAEsE"}