@sap-ux/ui-components 1.0.9 → 1.0.10
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/dist/components/UILink/UILink.d.ts +7 -4
- package/dist/components/UILink/UILink.d.ts.map +1 -1
- package/dist/components/UILink/UILink.js +17 -5
- package/dist/components/UILink/UILink.js.map +1 -1
- package/package.json +1 -1
- package/storybook/iframe.html +1 -1
- package/storybook/{main.ef990619.iframe.bundle.js → main.1856d024.iframe.bundle.js} +7 -7
- package/storybook/project.json +1 -1
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ILinkProps } from '@fluentui/react';
|
|
3
|
+
export interface UILinkProps extends ILinkProps {
|
|
4
|
+
secondary?: boolean;
|
|
5
|
+
}
|
|
3
6
|
/**
|
|
4
7
|
* UILink component
|
|
5
8
|
* based on https://developer.microsoft.com/en-us/fluentui#/controls/web/link
|
|
6
9
|
*
|
|
7
10
|
* @exports
|
|
8
11
|
* @class UILink
|
|
9
|
-
* @extends {React.Component<
|
|
12
|
+
* @extends {React.Component<UILinkProps, {}>}
|
|
10
13
|
*/
|
|
11
|
-
export declare class UILink extends React.Component<
|
|
14
|
+
export declare class UILink extends React.Component<UILinkProps, {}> {
|
|
12
15
|
/**
|
|
13
16
|
* Initializes component properties.
|
|
14
17
|
*
|
|
15
|
-
* @param {
|
|
18
|
+
* @param {UILinkProps} props
|
|
16
19
|
*/
|
|
17
|
-
constructor(props:
|
|
20
|
+
constructor(props: UILinkProps);
|
|
18
21
|
/**
|
|
19
22
|
* @returns {JSX.Element}
|
|
20
23
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UILink.d.ts","sourceRoot":"","sources":["../../../src/components/UILink/UILink.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,UAAU,EAAe,MAAM,iBAAiB,CAAC;AAG/D;;;;;;;GAOG;AACH,qBAAa,MAAO,SAAQ,KAAK,CAAC,SAAS,CAAC,
|
|
1
|
+
{"version":3,"file":"UILink.d.ts","sourceRoot":"","sources":["../../../src/components/UILink/UILink.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,UAAU,EAAe,MAAM,iBAAiB,CAAC;AAG/D,MAAM,WAAW,WAAY,SAAQ,UAAU;IAC3C,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAaD;;;;;;;GAOG;AACH,qBAAa,MAAO,SAAQ,KAAK,CAAC,SAAS,CAAC,WAAW,EAAE,EAAE,CAAC;IACxD;;;;OAIG;gBACgB,KAAK,EAAE,WAAW;IAIrC;;OAEG;IACH,MAAM,IAAI,GAAG,CAAC,OAAO;CAgCxB"}
|
|
@@ -6,19 +6,29 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.UILink = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const react_2 = require("@fluentui/react");
|
|
9
|
+
const linkStyle = {
|
|
10
|
+
primary: {
|
|
11
|
+
color: 'var(--vscode-textLink-foreground)',
|
|
12
|
+
hoverColor: 'var(--vscode-textLink-activeForeground)'
|
|
13
|
+
},
|
|
14
|
+
secondary: {
|
|
15
|
+
color: 'var(--vscode-foreground)',
|
|
16
|
+
hoverColor: 'var(--vscode-foreground)'
|
|
17
|
+
}
|
|
18
|
+
};
|
|
9
19
|
/**
|
|
10
20
|
* UILink component
|
|
11
21
|
* based on https://developer.microsoft.com/en-us/fluentui#/controls/web/link
|
|
12
22
|
*
|
|
13
23
|
* @exports
|
|
14
24
|
* @class UILink
|
|
15
|
-
* @extends {React.Component<
|
|
25
|
+
* @extends {React.Component<UILinkProps, {}>}
|
|
16
26
|
*/
|
|
17
27
|
class UILink extends react_1.default.Component {
|
|
18
28
|
/**
|
|
19
29
|
* Initializes component properties.
|
|
20
30
|
*
|
|
21
|
-
* @param {
|
|
31
|
+
* @param {UILinkProps} props
|
|
22
32
|
*/
|
|
23
33
|
constructor(props) {
|
|
24
34
|
super(props);
|
|
@@ -27,19 +37,21 @@ class UILink extends react_1.default.Component {
|
|
|
27
37
|
* @returns {JSX.Element}
|
|
28
38
|
*/
|
|
29
39
|
render() {
|
|
40
|
+
const { secondary } = this.props;
|
|
41
|
+
const styles = secondary ? linkStyle.secondary : linkStyle.primary;
|
|
30
42
|
const linkStyles = () => {
|
|
31
43
|
return {
|
|
32
44
|
root: {
|
|
33
|
-
color:
|
|
45
|
+
color: styles.color,
|
|
34
46
|
fontFamily: 'var(--vscode-font-family)',
|
|
35
47
|
textDecoration: 'underline',
|
|
36
48
|
selectors: {
|
|
37
49
|
'&:hover, &:hover:focus, &:hover:active': {
|
|
38
|
-
color:
|
|
50
|
+
color: styles.hoverColor,
|
|
39
51
|
textDecoration: 'none'
|
|
40
52
|
},
|
|
41
53
|
'&:active, &:focus': {
|
|
42
|
-
color:
|
|
54
|
+
color: styles.hoverColor,
|
|
43
55
|
textDecoration: 'none',
|
|
44
56
|
outline: 'none'
|
|
45
57
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UILink.js","sourceRoot":"","sources":["../../../src/components/UILink/UILink.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAG1B,2CAAuC;
|
|
1
|
+
{"version":3,"file":"UILink.js","sourceRoot":"","sources":["../../../src/components/UILink/UILink.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAG1B,2CAAuC;AAMvC,MAAM,SAAS,GAAG;IACd,OAAO,EAAE;QACL,KAAK,EAAE,mCAAmC;QAC1C,UAAU,EAAE,yCAAyC;KACxD;IACD,SAAS,EAAE;QACP,KAAK,EAAE,0BAA0B;QACjC,UAAU,EAAE,0BAA0B;KACzC;CACJ,CAAC;AAEF;;;;;;;GAOG;AACH,MAAa,MAAO,SAAQ,eAAK,CAAC,SAA0B;IACxD;;;;OAIG;IACH,YAAmB,KAAkB;QACjC,KAAK,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;IAED;;OAEG;IACH,MAAM;QACF,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QACjC,MAAM,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC;QACnE,MAAM,UAAU,GAAG,GAAyB,EAAE;YAC1C,OAAO;gBACH,IAAI,EAAE;oBACF,KAAK,EAAE,MAAM,CAAC,KAAK;oBACnB,UAAU,EAAE,2BAA2B;oBACvC,cAAc,EAAE,WAAW;oBAC3B,SAAS,EAAE;wBACP,wCAAwC,EAAE;4BACtC,KAAK,EAAE,MAAM,CAAC,UAAU;4BACxB,cAAc,EAAE,MAAM;yBACzB;wBACD,mBAAmB,EAAE;4BACjB,KAAK,EAAE,MAAM,CAAC,UAAU;4BACxB,cAAc,EAAE,MAAM;4BACtB,OAAO,EAAE,MAAM;yBAClB;wBACD,+BAA+B;wBAC/B,oCAAoC,EAAE;4BAClC,SAAS,EAAE,MAAM;4BACjB,OAAO,EAAE,qCAAqC;4BAC9C,aAAa,EAAE,MAAM;yBACxB;qBACJ;iBACJ;aACJ,CAAC;QACN,CAAC,CAAC;QAEF,OAAO,8BAAC,YAAI,OAAK,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,GAAI,CAAC;IACxD,CAAC;CACJ;AA7CD,wBA6CC"}
|
package/package.json
CHANGED
package/storybook/iframe.html
CHANGED
|
@@ -377,4 +377,4 @@
|
|
|
377
377
|
|
|
378
378
|
|
|
379
379
|
|
|
380
|
-
window['STORIES'] = [{"titlePrefix":"","directory":"./stories","files":"*.story.tsx","importPathMatcher":"^\\.[\\\\/](?:stories\\/(?!\\.)(?=.)[^/]*?\\.story\\.tsx)$"}];</script><script src="runtime~main.3e35adfa.iframe.bundle.js"></script><script src="93.546e1b61.iframe.bundle.js"></script><script src="main.
|
|
380
|
+
window['STORIES'] = [{"titlePrefix":"","directory":"./stories","files":"*.story.tsx","importPathMatcher":"^\\.[\\\\/](?:stories\\/(?!\\.)(?=.)[^/]*?\\.story\\.tsx)$"}];</script><script src="runtime~main.3e35adfa.iframe.bundle.js"></script><script src="93.546e1b61.iframe.bundle.js"></script><script src="main.1856d024.iframe.bundle.js"></script></body></html>
|