oolib 2.118.0 → 2.119.1
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/PageScrollIndicator/index.d.ts +9 -2
- package/dist/components/PageScrollIndicator/index.js +10 -0
- package/dist/components/PageScrollIndicator/styled.d.ts +4 -2
- package/dist/components/RadioAndCheckbox/comps/CheckboxList/comps/CheckboxInput/index.js +7 -6
- package/dist/components/Tags/Comps/TagClear/index.d.ts +26 -0
- package/dist/components/Tags/Comps/TagClear/index.js +35 -0
- package/dist/components/Tags/Comps/TagClear/styled.d.ts +15 -0
- package/dist/components/Tags/Comps/TagClear/styled.js +59 -0
- package/dist/components/Tags/Comps/TagDisplay/index.d.ts +26 -0
- package/dist/components/Tags/Comps/TagDisplay/index.js +31 -0
- package/dist/components/Tags/Comps/TagDisplay/styled.d.ts +9 -0
- package/dist/components/Tags/Comps/TagDisplay/styled.js +44 -0
- package/dist/components/Tags/Comps/TagLink/index.d.ts +24 -0
- package/dist/components/Tags/Comps/TagLink/index.js +31 -0
- package/dist/components/Tags/Comps/TagLink/styled.d.ts +15 -0
- package/dist/components/Tags/Comps/TagLink/styled.js +62 -0
- package/dist/components/Tags/Comps/TagSelect/index.d.ts +33 -0
- package/dist/components/Tags/Comps/TagSelect/index.js +65 -0
- package/dist/components/Tags/Comps/TagSelect/styled.d.ts +8 -0
- package/dist/components/Tags/Comps/TagSelect/styled.js +59 -0
- package/dist/components/Tags/Comps/styled.d.ts +25 -0
- package/dist/components/Tags/Comps/styled.js +52 -0
- package/dist/components/Tags/index.d.ts +4 -42
- package/dist/components/Tags/index.js +9 -87
- package/dist/components/Tags/utils/getTypoComp.d.ts +4 -0
- package/dist/components/Tags/utils/getTypoComp.js +34 -0
- package/dist/stories/PageScrollIndicator.stories.js +1 -1
- package/dist/stories/TagLink.stories.js +0 -1
- package/package.json +1 -1
- package/dist/components/Tags/index.styled.d.ts +0 -8
- package/dist/components/Tags/index.styled.js +0 -194
|
@@ -1,2 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { FunctionComponent } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* @component Renders a PageScrollIndicator component to show scroll progress as a highlight line at the top of the page.
|
|
4
|
+
*
|
|
5
|
+
* - The props object contains no properties.
|
|
6
|
+
*
|
|
7
|
+
* @return {ReactElement} The rendered PageScrollIndicator component.
|
|
8
|
+
*/
|
|
9
|
+
export declare const PageScrollIndicator: FunctionComponent;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
// import React, { useState } from "react";
|
|
3
|
+
// import { useScroll } from "../../utils/customHooks/useScroll";
|
|
4
|
+
// import { StyledScrollHighlight, StyledScrollHighlightVisible } from "./styled";
|
|
2
5
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
6
|
if (k2 === undefined) k2 = k;
|
|
4
7
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -27,6 +30,13 @@ exports.PageScrollIndicator = void 0;
|
|
|
27
30
|
var react_1 = __importStar(require("react"));
|
|
28
31
|
var useScroll_1 = require("../../utils/customHooks/useScroll");
|
|
29
32
|
var styled_1 = require("./styled");
|
|
33
|
+
/**
|
|
34
|
+
* @component Renders a PageScrollIndicator component to show scroll progress as a highlight line at the top of the page.
|
|
35
|
+
*
|
|
36
|
+
* - The props object contains no properties.
|
|
37
|
+
*
|
|
38
|
+
* @return {ReactElement} The rendered PageScrollIndicator component.
|
|
39
|
+
*/
|
|
30
40
|
var PageScrollIndicator = function () {
|
|
31
41
|
var _a = (0, react_1.useState)(0), highLightLine = _a[0], setHighLightLine = _a[1];
|
|
32
42
|
var scrollFn = function () {
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
export const StyledScrollHighlight: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
-
export const StyledScrollHighlightVisible: import("styled-components").StyledComponent<"div", any, {
|
|
1
|
+
export declare const StyledScrollHighlight: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
+
export declare const StyledScrollHighlightVisible: import("styled-components").StyledComponent<"div", any, {
|
|
3
|
+
width: number;
|
|
4
|
+
}, never>;
|
|
@@ -25,10 +25,11 @@ var CheckboxInput = function (_a) {
|
|
|
25
25
|
return (react_1.default.createElement(CheckboxButton_1.CheckboxButton, { isSelected: isSelected, disabled: disabled, invert: invert, S: S, className: 'btn',
|
|
26
26
|
disabled: options.disabled || disabled }));
|
|
27
27
|
};
|
|
28
|
-
var genCheckSquare = function () { return (react_1.default.createElement(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
var genCheckSquare = function () { return (react_1.default.createElement("div", { style: { flexShrink: 0 } },
|
|
29
|
+
react_1.default.createElement(CheckSquare, { size: S ? 22.5 : 26, color: invert ? invertGreen : green, style: {
|
|
30
|
+
margin: '-7px -2.8px -7px -3.2px',
|
|
31
|
+
flexShrink: 0
|
|
32
|
+
} }))); };
|
|
32
33
|
var genXSquare = function () { return (react_1.default.createElement(XSquare, { size: S ? 21.5 : 26, color: invert ? invertRed : red, style: {
|
|
33
34
|
margin: '-7px -2.8px -7px -3.2px',
|
|
34
35
|
flexShrink: 0
|
|
@@ -36,14 +37,14 @@ var CheckboxInput = function (_a) {
|
|
|
36
37
|
return option.loading
|
|
37
38
|
? react_1.default.createElement(TextLoader_1.TextLoader, { style: { width: "8rem", height: "1.5rem" } })
|
|
38
39
|
: inputStyle === 'tagSelect' ? (react_1.default.createElement(Tags_1.TagSelect, { isSelected: isSelected, invert: invert, disabled: disabled, onClick: function () { return !disabled && onClick(isSelected, option); }, display: option.display, value: option.value, style: { alignSelf: 'flex-start' } })) : (react_1.default.createElement(styled_1.StyledOption, { rightWrongResult: rightWrongResult, isSelected: isSelected, disabled: disabled, invert: invert, S: S, onClick: function () { return !rightWrongResult && !disabled && onClick && onClick(isSelected, option); } },
|
|
39
|
-
rightWrongResult
|
|
40
|
+
react_1.default.createElement("div", { style: { flexShrink: 0 } }, rightWrongResult
|
|
40
41
|
? ["markCorrect", "revealCorrect"].includes(markingCommand)
|
|
41
42
|
? genCheckSquare()
|
|
42
43
|
: markingCommand === 'markWrong'
|
|
43
44
|
? genXSquare()
|
|
44
45
|
: genCheckboxButton({ disabled: true }) //else rightWrongResult has come in, but this doesnt have to be marked right or wrong
|
|
45
46
|
: genCheckboxButton() // rightWrongResult has not come in. so gen normal radio button
|
|
46
|
-
|
|
47
|
+
),
|
|
47
48
|
react_1.default.createElement(SuitableTypo, { bold: rightWrongResult && isSelected, color: disabled && greyColor40, invert: invert }, option.display)));
|
|
48
49
|
};
|
|
49
50
|
exports.CheckboxInput = CheckboxInput;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { FunctionComponent } from "react";
|
|
2
|
+
export interface TagClearProps {
|
|
3
|
+
id: string;
|
|
4
|
+
display: string;
|
|
5
|
+
M?: boolean;
|
|
6
|
+
XS?: boolean;
|
|
7
|
+
invert?: boolean;
|
|
8
|
+
onClick?: () => void;
|
|
9
|
+
variant?: 'primary' | 'ghost';
|
|
10
|
+
grey?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* @component Renders a TagClear component with customizable text, style and onClick handler.
|
|
14
|
+
*
|
|
15
|
+
* - The props object containing the following properties:
|
|
16
|
+
* @prop {string} id: The id of the component.
|
|
17
|
+
* @prop {string} display: The text to be displayed inside the TagClear component.
|
|
18
|
+
* @prop {boolean} [M] : A boolean indicating whether the component should render at the large size. Defaults to false.
|
|
19
|
+
* @prop {boolean} [XS] : A boolean indicating whether the component should render at the extra small size. Defaults to false.
|
|
20
|
+
* @prop {boolean} [invert] : A boolean indicating whether to invert the colors of the component. Defaults to false.
|
|
21
|
+
* @prop {() => void} [onClick] : A function to be called when the component is clicked. Defaults to an empty function.
|
|
22
|
+
* @prop {('primary' | 'ghost')} [variant] : A string indicating the variant of the component. Defaults to "primary".
|
|
23
|
+
* @prop {boolean} [grey] : A boolean indicating whether to render the component in the grey variant. Defaults to false.
|
|
24
|
+
* @return {ReactElement} The rendered TagClear component.
|
|
25
|
+
*/
|
|
26
|
+
export declare const TagClear: FunctionComponent<TagClearProps>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.TagClear = void 0;
|
|
7
|
+
var react_1 = __importDefault(require("react"));
|
|
8
|
+
var icons_1 = require("../../../../icons");
|
|
9
|
+
var getTypoComp_1 = require("../../utils/getTypoComp");
|
|
10
|
+
var styled_1 = require("./styled");
|
|
11
|
+
/**
|
|
12
|
+
* @component Renders a TagClear component with customizable text, style and onClick handler.
|
|
13
|
+
*
|
|
14
|
+
* - The props object containing the following properties:
|
|
15
|
+
* @prop {string} id: The id of the component.
|
|
16
|
+
* @prop {string} display: The text to be displayed inside the TagClear component.
|
|
17
|
+
* @prop {boolean} [M] : A boolean indicating whether the component should render at the large size. Defaults to false.
|
|
18
|
+
* @prop {boolean} [XS] : A boolean indicating whether the component should render at the extra small size. Defaults to false.
|
|
19
|
+
* @prop {boolean} [invert] : A boolean indicating whether to invert the colors of the component. Defaults to false.
|
|
20
|
+
* @prop {() => void} [onClick] : A function to be called when the component is clicked. Defaults to an empty function.
|
|
21
|
+
* @prop {('primary' | 'ghost')} [variant] : A string indicating the variant of the component. Defaults to "primary".
|
|
22
|
+
* @prop {boolean} [grey] : A boolean indicating whether to render the component in the grey variant. Defaults to false.
|
|
23
|
+
* @return {ReactElement} The rendered TagClear component.
|
|
24
|
+
*/
|
|
25
|
+
var TagClear = function (_a) {
|
|
26
|
+
var id = _a.id, display = _a.display, M = _a.M, XS = _a.XS, invert = _a.invert, _b = _a.onClick, onClick = _b === void 0 ? function () { } : _b, _c = _a.variant, variant = _c === void 0 ? 'primary' : _c, grey = _a.grey;
|
|
27
|
+
var XIconCom = icons_1.icons['X'];
|
|
28
|
+
var size = M ? 'M' : XS ? 'XS' : 'S';
|
|
29
|
+
var TYPO_COMP = (0, getTypoComp_1.getTypoComp)(size);
|
|
30
|
+
return (react_1.default.createElement(styled_1.StyledTagClear, { invert: invert, size: size, grey: grey, variant: variant },
|
|
31
|
+
react_1.default.createElement(TYPO_COMP, null, display),
|
|
32
|
+
react_1.default.createElement(styled_1.StyledTagClearIconWrapper, { invert: invert, grey: grey, variant: variant, onClick: onClick },
|
|
33
|
+
react_1.default.createElement(XIconCom, { size: size === 'XS' ? '12' : '15', weight: 'bold' }))));
|
|
34
|
+
};
|
|
35
|
+
exports.TagClear = TagClear;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SIZES } from "../styled";
|
|
2
|
+
export interface StyledTagClearProps {
|
|
3
|
+
variant: 'primary' | 'ghost';
|
|
4
|
+
size: keyof typeof SIZES;
|
|
5
|
+
invert?: boolean;
|
|
6
|
+
grey?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const StyledTagClear: import("styled-components").StyledComponent<"div", any, StyledTagClearProps, never>;
|
|
9
|
+
export interface StyledTagClearIconWrapperProps {
|
|
10
|
+
invert?: boolean;
|
|
11
|
+
grey?: boolean;
|
|
12
|
+
variant: 'primary' | 'ghost';
|
|
13
|
+
onClick?: () => void;
|
|
14
|
+
}
|
|
15
|
+
export declare const StyledTagClearIconWrapper: import("styled-components").StyledComponent<"div", any, StyledTagClearIconWrapperProps, never>;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
+
}) : function(o, v) {
|
|
20
|
+
o["default"] = v;
|
|
21
|
+
});
|
|
22
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
23
|
+
if (mod && mod.__esModule) return mod;
|
|
24
|
+
var result = {};
|
|
25
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
26
|
+
__setModuleDefault(result, mod);
|
|
27
|
+
return result;
|
|
28
|
+
};
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
exports.StyledTagClearIconWrapper = exports.StyledTagClear = void 0;
|
|
31
|
+
var styled_components_1 = __importStar(require("styled-components"));
|
|
32
|
+
var styled_1 = require("../styled");
|
|
33
|
+
var themes_1 = require("../../../../themes");
|
|
34
|
+
var utilsOolib_1 = require("../../../../utilsOolib");
|
|
35
|
+
var mixins_1 = require("../../../../themes/mixins");
|
|
36
|
+
var greyColor100 = themes_1.colors.greyColor100, greyColor80 = themes_1.colors.greyColor80, greyColor15 = themes_1.colors.greyColor15, white = themes_1.colors.white;
|
|
37
|
+
exports.StyledTagClear = styled_components_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n ", "\n //overrides of commonStyle\n padding-right: 0;\n gap: 0.5rem;\n //--\n \n ", "\n \n ", "\n"], ["\n ", "\n //overrides of commonStyle\n padding-right: 0;\n gap: 0.5rem;\n //--\n \n ", "\n \n ", "\n"])), function (_a) {
|
|
38
|
+
var size = _a.size;
|
|
39
|
+
return (0, styled_1.commonStyle)({ size: size });
|
|
40
|
+
}, function (_a) {
|
|
41
|
+
var variant = _a.variant, size = _a.size, invert = _a.invert, grey = _a.grey, colors = _a.theme.colors;
|
|
42
|
+
if (variant === 'primary') {
|
|
43
|
+
return grey
|
|
44
|
+
? (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-color: ", ";\n color: ", ";\n "], ["\n background-color: ", ";\n color: ", ";\n "])), !invert ? greyColor15 : greyColor80, !invert ? greyColor80 : greyColor15) : (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background-color: ", ";\n color: ", ";\n "], ["\n background-color: ", ";\n color: ", ";\n "])), !invert ? (0, utilsOolib_1.getPrimaryColor100)(colors) : (0, utilsOolib_1.getPrimaryColor40)(colors), !invert ? white : greyColor100);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
// secondry
|
|
48
|
+
return grey
|
|
49
|
+
? (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n background: none;\n border: ", " solid ", ";\n color: ", ";\n "], ["\n background: none;\n border: ", " solid ", ";\n color: ", ";\n "])), size === 'XS' ? '1px' : '2px', !invert ? greyColor15 : greyColor80, !invert ? greyColor80 : greyColor15) : (0, styled_components_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n background: none;\n border: ", " solid\n ", ";\n color: ", ";\n "], ["\n background: none;\n border: ", " solid\n ", ";\n color: ", ";\n "])), size === 'XS' ? '1px' : '2px', !invert ? (0, utilsOolib_1.getPrimaryColor100)(colors) : (0, utilsOolib_1.getPrimaryColor40)(colors), !invert ? (0, utilsOolib_1.getPrimaryColorText)(colors) : (0, utilsOolib_1.getPrimaryColor40)(colors));
|
|
50
|
+
}
|
|
51
|
+
}, function (_a) {
|
|
52
|
+
var variant = _a.variant;
|
|
53
|
+
return variant === 'ghost' && (0, styled_components_1.css)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n background: none;\n border: none;\n "], ["\n background: none;\n border: none;\n "])));
|
|
54
|
+
});
|
|
55
|
+
exports.StyledTagClearIconWrapper = styled_components_1.default.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n height: 100%;\n padding-right: 0.75rem;\n padding-left: 0.75rem;\n ", ";\n ", ";\n"], ["\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n height: 100%;\n padding-right: 0.75rem;\n padding-left: 0.75rem;\n ", ";\n ", ";\n"])), (0, mixins_1.transition)('color', 'background-color'), function (_a) {
|
|
56
|
+
var invert = _a.invert, grey = _a.grey, colors = _a.theme.colors;
|
|
57
|
+
return grey ? (0, styled_1.greyHover)({ invert: invert, colors: colors }) : (0, styled_1.blueHover)({ invert: invert, colors: colors });
|
|
58
|
+
});
|
|
59
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React, { FunctionComponent } from 'react';
|
|
2
|
+
export interface TagDisplayProps {
|
|
3
|
+
display: string;
|
|
4
|
+
style?: React.CSSProperties;
|
|
5
|
+
invert?: boolean;
|
|
6
|
+
M?: boolean;
|
|
7
|
+
XS?: boolean;
|
|
8
|
+
tagColor?: string;
|
|
9
|
+
textColor?: string;
|
|
10
|
+
variant?: 'primary' | 'secondary';
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* @component Renders a TagDisplay component with customizable text, style and variant.
|
|
14
|
+
*
|
|
15
|
+
* - The props object containing the following properties:
|
|
16
|
+
* @prop {string} display: The text to be displayed inside the TagDisplay component.
|
|
17
|
+
* @prop {React.CSSProperties} style: Additional CSS styles to apply to the TagDisplay.
|
|
18
|
+
* @prop {boolean} [invert] : A boolean indicating whether to invert the colors of the component. Defaults to false.
|
|
19
|
+
* @prop {boolean} [M] : A boolean indicating whether the component should render at the large size. Defaults to false.
|
|
20
|
+
* @prop {boolean} [XS] : A boolean indicating whether the component should render at the extra small size. Defaults to false.
|
|
21
|
+
* @prop {string} [tagColor] : A string indicating the background color of the component. Defaults to undefined.
|
|
22
|
+
* @prop {string} [textColor] : A string indicating the text color of the component. Defaults to undefined.
|
|
23
|
+
* @prop {('primary' | 'secondary')} [variant] : A string indicating the variant of the component. Defaults to "primary".
|
|
24
|
+
* @return {ReactElement} The rendered TagDisplay component.
|
|
25
|
+
*/
|
|
26
|
+
export declare const TagDisplay: FunctionComponent<TagDisplayProps>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.TagDisplay = void 0;
|
|
7
|
+
var react_1 = __importDefault(require("react"));
|
|
8
|
+
var styled_1 = require("./styled");
|
|
9
|
+
var getTypoComp_1 = require("../../utils/getTypoComp");
|
|
10
|
+
/**
|
|
11
|
+
* @component Renders a TagDisplay component with customizable text, style and variant.
|
|
12
|
+
*
|
|
13
|
+
* - The props object containing the following properties:
|
|
14
|
+
* @prop {string} display: The text to be displayed inside the TagDisplay component.
|
|
15
|
+
* @prop {React.CSSProperties} style: Additional CSS styles to apply to the TagDisplay.
|
|
16
|
+
* @prop {boolean} [invert] : A boolean indicating whether to invert the colors of the component. Defaults to false.
|
|
17
|
+
* @prop {boolean} [M] : A boolean indicating whether the component should render at the large size. Defaults to false.
|
|
18
|
+
* @prop {boolean} [XS] : A boolean indicating whether the component should render at the extra small size. Defaults to false.
|
|
19
|
+
* @prop {string} [tagColor] : A string indicating the background color of the component. Defaults to undefined.
|
|
20
|
+
* @prop {string} [textColor] : A string indicating the text color of the component. Defaults to undefined.
|
|
21
|
+
* @prop {('primary' | 'secondary')} [variant] : A string indicating the variant of the component. Defaults to "primary".
|
|
22
|
+
* @return {ReactElement} The rendered TagDisplay component.
|
|
23
|
+
*/
|
|
24
|
+
var TagDisplay = function (_a) {
|
|
25
|
+
var display = _a.display, style = _a.style, invert = _a.invert, M = _a.M, XS = _a.XS, tagColor = _a.tagColor, textColor = _a.textColor, _b = _a.variant, variant = _b === void 0 ? 'primary' : _b;
|
|
26
|
+
var size = M ? 'M' : XS ? 'XS' : 'S';
|
|
27
|
+
var TYPO_COMP = (0, getTypoComp_1.getTypoComp)(size);
|
|
28
|
+
return (react_1.default.createElement(styled_1.StyledTagDisplay, { variant: variant, invert: invert, textColor: textColor, tagColor: tagColor, size: size, style: style },
|
|
29
|
+
react_1.default.createElement(TYPO_COMP, null, display)));
|
|
30
|
+
};
|
|
31
|
+
exports.TagDisplay = TagDisplay;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SIZES } from "../styled";
|
|
2
|
+
export interface StyledTagDisplayProps {
|
|
3
|
+
variant: 'primary' | 'secondary';
|
|
4
|
+
invert?: boolean;
|
|
5
|
+
size: keyof typeof SIZES;
|
|
6
|
+
textColor?: string;
|
|
7
|
+
tagColor?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const StyledTagDisplay: import("styled-components").StyledComponent<"div", any, StyledTagDisplayProps, never>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
+
}) : function(o, v) {
|
|
20
|
+
o["default"] = v;
|
|
21
|
+
});
|
|
22
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
23
|
+
if (mod && mod.__esModule) return mod;
|
|
24
|
+
var result = {};
|
|
25
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
26
|
+
__setModuleDefault(result, mod);
|
|
27
|
+
return result;
|
|
28
|
+
};
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
exports.StyledTagDisplay = void 0;
|
|
31
|
+
var styled_components_1 = __importStar(require("styled-components"));
|
|
32
|
+
var styled_1 = require("../styled");
|
|
33
|
+
var themes_1 = require("../../../../themes");
|
|
34
|
+
var greyColor100 = themes_1.colors.greyColor100, greyColor80 = themes_1.colors.greyColor80, greyColor15 = themes_1.colors.greyColor15, greyColor40 = themes_1.colors.greyColor40;
|
|
35
|
+
exports.StyledTagDisplay = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n ", "\n ", "\n"], ["\n ", "\n ", "\n"])), function (_a) {
|
|
36
|
+
var size = _a.size;
|
|
37
|
+
return (0, styled_1.commonStyle)({ size: size });
|
|
38
|
+
}, function (_a) {
|
|
39
|
+
var variant = _a.variant, invert = _a.invert, size = _a.size, textColor = _a.textColor, tagColor = _a.tagColor;
|
|
40
|
+
return variant === 'primary'
|
|
41
|
+
? (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-color: ", ";\n color: ", ";\n "], ["\n background-color: ", ";\n color: ", ";\n "])), tagColor ? tagColor : !invert ? greyColor15 : greyColor80, textColor ? textColor : !invert ? greyColor80 : greyColor40) : //secondary
|
|
42
|
+
(0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background: none;\n border: ", " solid\n /* border: 2px solid */\n ", ";\n color: ", ";\n "], ["\n background: none;\n border: ", " solid\n /* border: 2px solid */\n ", ";\n color: ", ";\n "])), size === 'XS' ? '1px' : '2px', tagColor ? tagColor : !invert ? (size === 'XS' ? greyColor100 : greyColor15) : greyColor80, textColor ? textColor : !invert ? (size === 'XS' ? greyColor100 : greyColor80) : greyColor15);
|
|
43
|
+
});
|
|
44
|
+
var templateObject_1, templateObject_2, templateObject_3;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { FunctionComponent } from "react";
|
|
2
|
+
export interface TagLinkProps {
|
|
3
|
+
display: string;
|
|
4
|
+
to: string;
|
|
5
|
+
invert?: boolean;
|
|
6
|
+
M?: boolean;
|
|
7
|
+
XS?: boolean;
|
|
8
|
+
variant?: 'primary' | 'secondary';
|
|
9
|
+
color?: 'red' | 'green' | 'black';
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* @component Renders a TagLink component with customizable text, URL, style and variant.
|
|
13
|
+
*
|
|
14
|
+
* - The props object containing the following properties:
|
|
15
|
+
* @prop {string} display: The text to be displayed inside the TagLink component.
|
|
16
|
+
* @prop {string} to: The URL to navigate to when the component is clicked.
|
|
17
|
+
* @prop {boolean} [invert] : A boolean indicating whether to invert the colors of the component. Defaults to false.
|
|
18
|
+
* @prop {boolean} [M] : A boolean indicating whether the component should render at the large size. Defaults to false.
|
|
19
|
+
* @prop {boolean} [XS] : A boolean indicating whether the component should render at the extra small size. Defaults to false.
|
|
20
|
+
* @prop {string} [variant] : A string indicating the variant of the component. Defaults to "primary".
|
|
21
|
+
* @prop {string} [color] : A string indicating the background color of the component. Defaults to undefined.
|
|
22
|
+
* @return {ReactElement} The rendered TagLink component.
|
|
23
|
+
*/
|
|
24
|
+
export declare const TagLink: FunctionComponent<TagLinkProps>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.TagLink = void 0;
|
|
7
|
+
var react_1 = __importDefault(require("react"));
|
|
8
|
+
var getTypoComp_1 = require("../../utils/getTypoComp");
|
|
9
|
+
var styled_1 = require("./styled");
|
|
10
|
+
/**
|
|
11
|
+
* @component Renders a TagLink component with customizable text, URL, style and variant.
|
|
12
|
+
*
|
|
13
|
+
* - The props object containing the following properties:
|
|
14
|
+
* @prop {string} display: The text to be displayed inside the TagLink component.
|
|
15
|
+
* @prop {string} to: The URL to navigate to when the component is clicked.
|
|
16
|
+
* @prop {boolean} [invert] : A boolean indicating whether to invert the colors of the component. Defaults to false.
|
|
17
|
+
* @prop {boolean} [M] : A boolean indicating whether the component should render at the large size. Defaults to false.
|
|
18
|
+
* @prop {boolean} [XS] : A boolean indicating whether the component should render at the extra small size. Defaults to false.
|
|
19
|
+
* @prop {string} [variant] : A string indicating the variant of the component. Defaults to "primary".
|
|
20
|
+
* @prop {string} [color] : A string indicating the background color of the component. Defaults to undefined.
|
|
21
|
+
* @return {ReactElement} The rendered TagLink component.
|
|
22
|
+
*/
|
|
23
|
+
var TagLink = function (_a) {
|
|
24
|
+
var display = _a.display, to = _a.to, invert = _a.invert, M = _a.M, XS = _a.XS, _b = _a.variant, variant = _b === void 0 ? 'primary' : _b, color = _a.color;
|
|
25
|
+
var size = M ? 'M' : XS ? 'XS' : 'S';
|
|
26
|
+
var TYPO_COMP = (0, getTypoComp_1.getTypoComp)(size);
|
|
27
|
+
return (react_1.default.createElement(styled_1.StyledLink, { to: to },
|
|
28
|
+
react_1.default.createElement(styled_1.StyledTagLink, { color: color, variant: variant, invert: invert, size: size },
|
|
29
|
+
react_1.default.createElement(TYPO_COMP, null, display))));
|
|
30
|
+
};
|
|
31
|
+
exports.TagLink = TagLink;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SIZES } from "../styled";
|
|
2
|
+
export declare const StyledLink: import("styled-components").StyledComponent<any, any, any, any>;
|
|
3
|
+
export interface TagLinkStyleProps {
|
|
4
|
+
variant: 'primary' | 'secondary';
|
|
5
|
+
invert?: boolean;
|
|
6
|
+
color?: 'red' | 'green' | 'black';
|
|
7
|
+
size: keyof typeof SIZES;
|
|
8
|
+
theme: any;
|
|
9
|
+
}
|
|
10
|
+
interface StyledTagLinkProps extends TagLinkStyleProps {
|
|
11
|
+
invert?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare const tagLinkStyle: ({ variant, invert, color, size, theme: { colors } }: TagLinkStyleProps) => import("styled-components").FlattenSimpleInterpolation;
|
|
14
|
+
export declare const StyledTagLink: import("styled-components").StyledComponent<"div", any, StyledTagLinkProps, never>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
+
}) : function(o, v) {
|
|
20
|
+
o["default"] = v;
|
|
21
|
+
});
|
|
22
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
23
|
+
if (mod && mod.__esModule) return mod;
|
|
24
|
+
var result = {};
|
|
25
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
26
|
+
__setModuleDefault(result, mod);
|
|
27
|
+
return result;
|
|
28
|
+
};
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
exports.StyledTagLink = exports.tagLinkStyle = exports.StyledLink = void 0;
|
|
31
|
+
var styled_components_1 = __importStar(require("styled-components"));
|
|
32
|
+
var react_router_dom_1 = require("react-router-dom");
|
|
33
|
+
var styled_1 = require("../styled");
|
|
34
|
+
var mixins_1 = require("../../../../themes/mixins");
|
|
35
|
+
var themes_1 = require("../../../../themes");
|
|
36
|
+
var utilsOolib_1 = require("../../../../utilsOolib");
|
|
37
|
+
var greyColor100 = themes_1.colors.greyColor100, greyColor15 = themes_1.colors.greyColor15, red = themes_1.colors.red, invertRed = themes_1.colors.invertRed, green = themes_1.colors.green, invertGreen = themes_1.colors.invertGreen;
|
|
38
|
+
exports.StyledLink = (0, styled_components_1.default)(react_router_dom_1.NavLink)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n text-decoration: none;\n"], ["\n text-decoration: none;\n"])));
|
|
39
|
+
var tagLinkStyle = function (_a) {
|
|
40
|
+
var variant = _a.variant, invert = _a.invert, color = _a.color, size = _a.size, colors = _a.theme.colors;
|
|
41
|
+
switch (true) {
|
|
42
|
+
case variant === 'primary':
|
|
43
|
+
switch (color) {
|
|
44
|
+
case 'red':
|
|
45
|
+
return (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background-color: ", ";\n ", "\n ", "\n "], ["\n background-color: ", ";\n ", "\n ", "\n "])), !invert ? red : invertRed, (0, styled_1.textColor)({ invert: invert }), (0, styled_1.redHover)({ invert: invert }));
|
|
46
|
+
case 'green':
|
|
47
|
+
return (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n background-color: ", ";\n ", "\n ", "\n "], ["\n background-color: ", ";\n ", "\n ", "\n "])), !invert ? green : invertGreen, (0, styled_1.textColor)({ invert: invert }), (0, styled_1.greenHover)({ invert: invert }));
|
|
48
|
+
case 'black':
|
|
49
|
+
return (0, styled_components_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n background-color: ", ";\n ", "\n ", "\n "], ["\n background-color: ", ";\n ", "\n ", "\n "])), !invert ? greyColor100 : greyColor15, (0, styled_1.textColor)({ invert: invert }), (0, styled_1.blackHover)({ invert: invert }));
|
|
50
|
+
default:
|
|
51
|
+
return (0, styled_components_1.css)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n background-color: ", ";\n ", "\n ", "\n "], ["\n background-color: ", ";\n ", "\n ", "\n "])), !invert ? (0, utilsOolib_1.getPrimaryColor100)(colors) : (0, utilsOolib_1.getPrimaryColor40)(colors), (0, styled_1.textColor)({ invert: invert }), (0, styled_1.blueHover)({ invert: invert, colors: colors }));
|
|
52
|
+
}
|
|
53
|
+
default: // variant secondary
|
|
54
|
+
return (0, styled_components_1.css)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n background: none;\n border: ", " solid\n ", ";\n color: ", ";\n ", "\n "], ["\n background: none;\n border: ", " solid\n ", ";\n color: ", ";\n ", "\n "])), size === 'XS' ? '1px' : '2px', !invert ? (0, utilsOolib_1.getPrimaryColor100)(colors) : (0, utilsOolib_1.getPrimaryColor40)(colors), !invert ? (0, utilsOolib_1.getPrimaryColorText)(colors) : (0, utilsOolib_1.getPrimaryColor40)(colors), (0, styled_1.blueHover)({ invert: invert, colors: colors }));
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
exports.tagLinkStyle = tagLinkStyle;
|
|
58
|
+
exports.StyledTagLink = styled_components_1.default.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n ", "\n ", "\n ", ";\n"], ["\n ", "\n ", "\n ", ";\n"])), function (_a) {
|
|
59
|
+
var size = _a.size;
|
|
60
|
+
return (0, styled_1.commonStyle)({ size: size });
|
|
61
|
+
}, function (props) { return (0, exports.tagLinkStyle)(props); }, (0, mixins_1.transition)('background-color', 'color'));
|
|
62
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React, { FunctionComponent } from "react";
|
|
2
|
+
export interface TagSelectProps {
|
|
3
|
+
onClick?: (selectedOption: {
|
|
4
|
+
display: string;
|
|
5
|
+
value: string;
|
|
6
|
+
}) => void;
|
|
7
|
+
isSelected?: boolean;
|
|
8
|
+
display: string;
|
|
9
|
+
value: string;
|
|
10
|
+
M?: boolean;
|
|
11
|
+
XS?: boolean;
|
|
12
|
+
invert?: boolean;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
style?: React.CSSProperties;
|
|
15
|
+
onMouseDown?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* @component Renders a tag select component with customizable text and styling.
|
|
19
|
+
*
|
|
20
|
+
* - The props object containing the following properties:
|
|
21
|
+
* @prop {function} onClick: A function to be called when the tag is clicked. Called with the selected option as an argument.
|
|
22
|
+
* @prop {boolean} isSelected: A boolean indicating whether the tag is selected. Defaults to false.
|
|
23
|
+
* @prop {string} display: The text to be displayed in the tag.
|
|
24
|
+
* @prop {string} value: The value of the tag.
|
|
25
|
+
* @prop {boolean} M: A boolean indicating whether the tag should be medium in size. Defaults to false.
|
|
26
|
+
* @prop {boolean} XS: A boolean indicating whether the tag should be extra small in size. Defaults to false.
|
|
27
|
+
* @prop {boolean} invert: A boolean indicating whether to invert the tag colors. Defaults to false.
|
|
28
|
+
* @prop {boolean} disabled: A boolean indicating whether the tag should be disabled. Defaults to false.
|
|
29
|
+
* @prop {React.CSSProperties} style: Additional CSS styles to apply to the tag.
|
|
30
|
+
* @prop {function} onMouseDown: A function to be called when the user mouses down on the tag. Called with the event as an argument.
|
|
31
|
+
* @return {ReactElement} The rendered tag select component.
|
|
32
|
+
*/
|
|
33
|
+
export declare const TagSelect: FunctionComponent<TagSelectProps>;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.TagSelect = void 0;
|
|
27
|
+
var react_1 = __importStar(require("react"));
|
|
28
|
+
var getTypoComp_1 = require("../../utils/getTypoComp");
|
|
29
|
+
var styled_1 = require("./styled");
|
|
30
|
+
/**
|
|
31
|
+
* @component Renders a tag select component with customizable text and styling.
|
|
32
|
+
*
|
|
33
|
+
* - The props object containing the following properties:
|
|
34
|
+
* @prop {function} onClick: A function to be called when the tag is clicked. Called with the selected option as an argument.
|
|
35
|
+
* @prop {boolean} isSelected: A boolean indicating whether the tag is selected. Defaults to false.
|
|
36
|
+
* @prop {string} display: The text to be displayed in the tag.
|
|
37
|
+
* @prop {string} value: The value of the tag.
|
|
38
|
+
* @prop {boolean} M: A boolean indicating whether the tag should be medium in size. Defaults to false.
|
|
39
|
+
* @prop {boolean} XS: A boolean indicating whether the tag should be extra small in size. Defaults to false.
|
|
40
|
+
* @prop {boolean} invert: A boolean indicating whether to invert the tag colors. Defaults to false.
|
|
41
|
+
* @prop {boolean} disabled: A boolean indicating whether the tag should be disabled. Defaults to false.
|
|
42
|
+
* @prop {React.CSSProperties} style: Additional CSS styles to apply to the tag.
|
|
43
|
+
* @prop {function} onMouseDown: A function to be called when the user mouses down on the tag. Called with the event as an argument.
|
|
44
|
+
* @return {ReactElement} The rendered tag select component.
|
|
45
|
+
*/
|
|
46
|
+
var TagSelect = function (_a) {
|
|
47
|
+
var onClick = _a.onClick, _b = _a.isSelected, isSelected = _b === void 0 ? false : _b, display = _a.display, value = _a.value, M = _a.M, XS = _a.XS, invert = _a.invert, disabled = _a.disabled, style = _a.style, onMouseDown = _a.onMouseDown;
|
|
48
|
+
var _c = (0, react_1.useState)(isSelected), selected = _c[0], setSelected = _c[1];
|
|
49
|
+
var handleOnClick = function () {
|
|
50
|
+
setSelected(!selected);
|
|
51
|
+
onClick && onClick({ display: display, value: value });
|
|
52
|
+
};
|
|
53
|
+
(0, react_1.useLayoutEffect)(function () {
|
|
54
|
+
if (selected && !isSelected) {
|
|
55
|
+
setSelected(isSelected);
|
|
56
|
+
}
|
|
57
|
+
}, [isSelected]);
|
|
58
|
+
var size = M ? 'M' : XS ? 'XS' : 'S';
|
|
59
|
+
var TYPO_COMP = (0, getTypoComp_1.getTypoComp)(size);
|
|
60
|
+
return (react_1.default.createElement(styled_1.StyledTagSelect, { disabled: disabled, invert: invert, onClick: function () { return !onMouseDown && !disabled && handleOnClick(); }, selected: selected, size: size, style: style, onMouseDown: function (ev) {
|
|
61
|
+
return !disabled && onMouseDown && onMouseDown(ev);
|
|
62
|
+
} },
|
|
63
|
+
react_1.default.createElement(TYPO_COMP, null, display)));
|
|
64
|
+
};
|
|
65
|
+
exports.TagSelect = TagSelect;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SIZES } from '../styled';
|
|
2
|
+
export interface StyledTagSelectProps {
|
|
3
|
+
size: keyof typeof SIZES;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
selected?: boolean;
|
|
6
|
+
invert?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const StyledTagSelect: import("styled-components").StyledComponent<"div", any, StyledTagSelectProps, never>;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
+
}) : function(o, v) {
|
|
20
|
+
o["default"] = v;
|
|
21
|
+
});
|
|
22
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
23
|
+
if (mod && mod.__esModule) return mod;
|
|
24
|
+
var result = {};
|
|
25
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
26
|
+
__setModuleDefault(result, mod);
|
|
27
|
+
return result;
|
|
28
|
+
};
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
exports.StyledTagSelect = void 0;
|
|
31
|
+
var styled_components_1 = __importStar(require("styled-components"));
|
|
32
|
+
var colors_1 = require("../../../../themes/colors");
|
|
33
|
+
var mixins_1 = require("../../../../themes/mixins");
|
|
34
|
+
var utilsOolib_1 = require("../../../../utilsOolib");
|
|
35
|
+
var styled_1 = require("../styled");
|
|
36
|
+
var greyColor100 = colors_1.colors.greyColor100, greyColor80 = colors_1.colors.greyColor80, greyColor15 = colors_1.colors.greyColor15, greyColor40 = colors_1.colors.greyColor40, white = colors_1.colors.white;
|
|
37
|
+
exports.StyledTagSelect = styled_components_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n ", "\n ", "\n\n cursor: ", ";\n border-style: solid;\n border-width: ", ";\n\n ", "\n\n @media (hover: hover) {\n &:hover {\n ", "\n }\n }\n"], ["\n ", "\n ", "\n\n cursor: ", ";\n border-style: solid;\n border-width: ", ";\n\n ", "\n\n @media (hover: hover) {\n &:hover {\n ", "\n }\n }\n"])), function (_a) {
|
|
38
|
+
var size = _a.size;
|
|
39
|
+
return (0, styled_1.commonStyle)({ size: size });
|
|
40
|
+
}, (0, mixins_1.transition)('background-color'), function (_a) {
|
|
41
|
+
var disabled = _a.disabled;
|
|
42
|
+
return (disabled ? 'not-allowed' : 'pointer');
|
|
43
|
+
}, function (_a) {
|
|
44
|
+
var size = _a.size;
|
|
45
|
+
return (size === 'XS' ? '1px' : '2px');
|
|
46
|
+
}, function (_a) {
|
|
47
|
+
var disabled = _a.disabled, selected = _a.selected, invert = _a.invert, colors = _a.theme.colors;
|
|
48
|
+
if (disabled) {
|
|
49
|
+
return invert
|
|
50
|
+
? (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n border-color: ", ";\n background-color: ", ";\n color: ", ";\n "], ["\n border-color: ", ";\n background-color: ", ";\n color: ", ";\n "])), greyColor40, greyColor80, greyColor40) : (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n border-color: ", ";\n color: ", ";\n "], ["\n border-color: ", ";\n color: ", ";\n "])), greyColor15, greyColor40);
|
|
51
|
+
}
|
|
52
|
+
return invert
|
|
53
|
+
? (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n border-color: ", ";\n background-color: ", ";\n color: ", ";\n "], ["\n border-color: ", ";\n background-color: ", ";\n color: ", ";\n "])), (0, utilsOolib_1.getPrimaryColor40)(colors), selected ? (0, utilsOolib_1.getPrimaryColor40)(colors) : 'unset', selected ? greyColor100 : (0, utilsOolib_1.getPrimaryColor40)(colors)) : (0, styled_components_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n border-color: ", ";\n background-color: ", ";\n color: ", ";\n "], ["\n border-color: ", ";\n background-color: ", ";\n color: ", ";\n "])), (0, utilsOolib_1.getPrimaryColor100)(colors), selected ? (0, utilsOolib_1.getPrimaryColor100)(colors) : 'unset', selected ? white : (0, utilsOolib_1.getPrimaryColorText)(colors));
|
|
54
|
+
}, function (_a) {
|
|
55
|
+
var selected = _a.selected, invert = _a.invert, disabled = _a.disabled, colors = _a.theme.colors;
|
|
56
|
+
return !selected &&
|
|
57
|
+
!disabled && (0, styled_components_1.css)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n background-color: ", ";\n color: ", ";\n "], ["\n background-color: ", ";\n color: ", ";\n "])), invert ? greyColor80 : (0, utilsOolib_1.getPrimaryColor40)(colors), invert ? (0, utilsOolib_1.getPrimaryColor40)(colors) : (0, utilsOolib_1.getPrimaryColorText)(colors));
|
|
58
|
+
});
|
|
59
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ColorsType } from '../../../themes/colors';
|
|
2
|
+
interface CommonStyleProps {
|
|
3
|
+
size: keyof typeof SIZES;
|
|
4
|
+
}
|
|
5
|
+
interface TextColorProps {
|
|
6
|
+
invert?: boolean;
|
|
7
|
+
colors?: ColorsType;
|
|
8
|
+
}
|
|
9
|
+
export interface HoverProps {
|
|
10
|
+
invert?: boolean;
|
|
11
|
+
colors: ColorsType;
|
|
12
|
+
}
|
|
13
|
+
export declare const SIZES: {
|
|
14
|
+
XS: string;
|
|
15
|
+
S: string;
|
|
16
|
+
M: string;
|
|
17
|
+
};
|
|
18
|
+
export declare const commonStyle: ({ size }: CommonStyleProps) => string;
|
|
19
|
+
export declare const textColor: ({ invert }: TextColorProps) => import("styled-components").FlattenSimpleInterpolation;
|
|
20
|
+
export declare const blueHover: ({ invert, colors }: HoverProps) => import("styled-components").FlattenSimpleInterpolation;
|
|
21
|
+
export declare const redHover: ({ invert }: TextColorProps) => import("styled-components").FlattenSimpleInterpolation;
|
|
22
|
+
export declare const greenHover: ({ invert }: TextColorProps) => import("styled-components").FlattenSimpleInterpolation;
|
|
23
|
+
export declare const blackHover: ({ invert }: TextColorProps) => import("styled-components").FlattenSimpleInterpolation;
|
|
24
|
+
export declare const greyHover: ({ invert }: TextColorProps) => import("styled-components").FlattenSimpleInterpolation;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.greyHover = exports.blackHover = exports.greenHover = exports.redHover = exports.blueHover = exports.textColor = exports.commonStyle = exports.SIZES = void 0;
|
|
8
|
+
var styled_components_1 = require("styled-components");
|
|
9
|
+
var colors_1 = require("../../../themes/colors");
|
|
10
|
+
var utilsOolib_1 = require("../../../utilsOolib");
|
|
11
|
+
var greyColor100 = colors_1.colors.greyColor100, greyColor80 = colors_1.colors.greyColor80, greyColor10 = colors_1.colors.greyColor10, white = colors_1.colors.white, greyColor5 = colors_1.colors.greyColor5, hoverRed = colors_1.colors.hoverRed, hoverInvertRed = colors_1.colors.hoverInvertRed, hoverGreen = colors_1.colors.hoverGreen, invertHoverGreen = colors_1.colors.invertHoverGreen;
|
|
12
|
+
exports.SIZES = {
|
|
13
|
+
XS: '2rem',
|
|
14
|
+
S: "3rem",
|
|
15
|
+
M: "4rem",
|
|
16
|
+
};
|
|
17
|
+
var commonStyle = function (_a) {
|
|
18
|
+
var size = _a.size;
|
|
19
|
+
return "\n padding: ".concat(size === 'XS' ? '0 .5rem' : '0 1rem', ";\n position: relative;\n display: inline-flex;\n column-gap: 1rem;\n align-items: center;\n border-radius: 0.2rem;\n white-space: nowrap;\n height: ").concat(exports.SIZES[size], ";\n max-width: 100%;\n");
|
|
20
|
+
};
|
|
21
|
+
exports.commonStyle = commonStyle;
|
|
22
|
+
var textColor = function (_a) {
|
|
23
|
+
var invert = _a.invert;
|
|
24
|
+
return (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n color: ", ";\n"], ["\n color: ", ";\n"])), invert ? greyColor100 : white);
|
|
25
|
+
};
|
|
26
|
+
exports.textColor = textColor;
|
|
27
|
+
var blueHover = function (_a) {
|
|
28
|
+
var invert = _a.invert, colors = _a.colors;
|
|
29
|
+
return (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n @media (hover: hover) {\n &:hover {\n background-color: ", ";\n color: ", ";\n }\n }\n"], ["\n @media (hover: hover) {\n &:hover {\n background-color: ", ";\n color: ", ";\n }\n }\n"])), invert ? (0, utilsOolib_1.getPrimaryColor10)(colors) : (0, utilsOolib_1.getPrimaryColor40)(colors), invert ? greyColor100 : (0, utilsOolib_1.getPrimaryColorText)(colors));
|
|
30
|
+
};
|
|
31
|
+
exports.blueHover = blueHover;
|
|
32
|
+
var redHover = function (_a) {
|
|
33
|
+
var invert = _a.invert;
|
|
34
|
+
return (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n @media (hover: hover) {\n &:hover {\n background-color: ", ";\n }\n }\n"], ["\n @media (hover: hover) {\n &:hover {\n background-color: ", ";\n }\n }\n"])), invert ? hoverInvertRed : hoverRed);
|
|
35
|
+
};
|
|
36
|
+
exports.redHover = redHover;
|
|
37
|
+
var greenHover = function (_a) {
|
|
38
|
+
var invert = _a.invert;
|
|
39
|
+
return (0, styled_components_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n @media (hover: hover) {\n &:hover {\n background-color: ", ";\n }\n }\n"], ["\n @media (hover: hover) {\n &:hover {\n background-color: ", ";\n }\n }\n"])), invert ? invertHoverGreen : hoverGreen);
|
|
40
|
+
};
|
|
41
|
+
exports.greenHover = greenHover;
|
|
42
|
+
var blackHover = function (_a) {
|
|
43
|
+
var invert = _a.invert;
|
|
44
|
+
return (0, styled_components_1.css)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n @media (hover: hover) {\n &:hover {\n background-color: ", ";\n }\n }\n"], ["\n @media (hover: hover) {\n &:hover {\n background-color: ", ";\n }\n }\n"])), invert ? greyColor5 : greyColor80);
|
|
45
|
+
};
|
|
46
|
+
exports.blackHover = blackHover;
|
|
47
|
+
var greyHover = function (_a) {
|
|
48
|
+
var invert = _a.invert;
|
|
49
|
+
return (0, styled_components_1.css)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n @media (hover: hover) {\n &:hover {\n background-color: ", ";\n }\n }\n"], ["\n @media (hover: hover) {\n &:hover {\n background-color: ", ";\n }\n }\n"])), invert ? greyColor80 : greyColor10);
|
|
50
|
+
};
|
|
51
|
+
exports.greyHover = greyHover;
|
|
52
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
|
@@ -1,42 +1,4 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
M: any;
|
|
6
|
-
XS: any;
|
|
7
|
-
tagColor: any;
|
|
8
|
-
textColor: any;
|
|
9
|
-
variant?: string;
|
|
10
|
-
}): React.JSX.Element;
|
|
11
|
-
export function TagClear({ id, display, M, XS, invert, onClick, variant, grey, }: {
|
|
12
|
-
id: any;
|
|
13
|
-
display: any;
|
|
14
|
-
M: any;
|
|
15
|
-
XS: any;
|
|
16
|
-
invert: any;
|
|
17
|
-
onClick?: () => void;
|
|
18
|
-
variant?: string;
|
|
19
|
-
grey: any;
|
|
20
|
-
}): React.JSX.Element;
|
|
21
|
-
export function TagSelect({ onClick, isSelected, display, value, M, XS, invert, disabled, style, onMouseDown }: {
|
|
22
|
-
onClick: any;
|
|
23
|
-
isSelected?: boolean;
|
|
24
|
-
display: any;
|
|
25
|
-
value: any;
|
|
26
|
-
M: any;
|
|
27
|
-
XS: any;
|
|
28
|
-
invert: any;
|
|
29
|
-
disabled: any;
|
|
30
|
-
style: any;
|
|
31
|
-
onMouseDown: any;
|
|
32
|
-
}): React.JSX.Element;
|
|
33
|
-
export function TagLink({ display, to, invert, M, XS, variant, color }: {
|
|
34
|
-
display: any;
|
|
35
|
-
to: any;
|
|
36
|
-
invert: any;
|
|
37
|
-
M: any;
|
|
38
|
-
XS: any;
|
|
39
|
-
variant?: string;
|
|
40
|
-
color: any;
|
|
41
|
-
}): React.JSX.Element;
|
|
42
|
-
import React from 'react';
|
|
1
|
+
export { TagClear } from './Comps/TagClear';
|
|
2
|
+
export { TagDisplay } from './Comps/TagDisplay';
|
|
3
|
+
export { TagLink } from './Comps/TagLink';
|
|
4
|
+
export { TagSelect } from './Comps/TagSelect';
|
|
@@ -1,89 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
-
}
|
|
19
|
-
Object.defineProperty(o, k2, desc);
|
|
20
|
-
}) : (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
o[k2] = m[k];
|
|
23
|
-
}));
|
|
24
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
-
}) : function(o, v) {
|
|
27
|
-
o["default"] = v;
|
|
28
|
-
});
|
|
29
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
-
if (mod && mod.__esModule) return mod;
|
|
31
|
-
var result = {};
|
|
32
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
-
__setModuleDefault(result, mod);
|
|
34
|
-
return result;
|
|
35
|
-
};
|
|
36
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
-
exports.
|
|
38
|
-
var
|
|
39
|
-
|
|
40
|
-
var
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
var size = M ? "M" : XS ? "XS" : "S";
|
|
47
|
-
var TYPO_COMP = getTypoComp(size);
|
|
48
|
-
return (react_1.default.createElement(index_styled_1.StyledTagDisplay, { variant: variant, invert: invert, textColor: textColor, tagColor: tagColor, size: size, style: style },
|
|
49
|
-
react_1.default.createElement(TYPO_COMP, null, display)));
|
|
50
|
-
}
|
|
51
|
-
exports.TagDisplay = TagDisplay;
|
|
52
|
-
function TagClear(_a) {
|
|
53
|
-
var id = _a.id, display = _a.display, M = _a.M, XS = _a.XS, invert = _a.invert, _b = _a.onClick, onClick = _b === void 0 ? function () { } : _b, _c = _a.variant, variant = _c === void 0 ? 'primary' : _c, grey = _a.grey;
|
|
54
|
-
var XIconCom = icons_1.icons['X'];
|
|
55
|
-
var size = M ? 'M' : XS ? 'XS' : 'S';
|
|
56
|
-
var TYPO_COMP = getTypoComp(size);
|
|
57
|
-
return (react_1.default.createElement(index_styled_1.StyledTagClear, { invert: invert, size: size, grey: grey, variant: variant },
|
|
58
|
-
react_1.default.createElement(TYPO_COMP, null, display),
|
|
59
|
-
react_1.default.createElement(index_styled_1.StyledTagClearIconWrapper, { invert: invert, grey: grey, variant: variant, onClick: onClick },
|
|
60
|
-
react_1.default.createElement(XIconCom, { size: size === 'XS' ? '12' : '15', weight: 'bold' }))));
|
|
61
|
-
}
|
|
62
|
-
exports.TagClear = TagClear;
|
|
63
|
-
function TagSelect(_a) {
|
|
64
|
-
var onClick = _a.onClick, _b = _a.isSelected, isSelected = _b === void 0 ? false : _b, display = _a.display, value = _a.value, M = _a.M, XS = _a.XS, invert = _a.invert, disabled = _a.disabled, style = _a.style, onMouseDown = _a.onMouseDown;
|
|
65
|
-
var _c = (0, react_1.useState)(isSelected), selected = _c[0], setSelected = _c[1];
|
|
66
|
-
var handleOnClick = function () {
|
|
67
|
-
setSelected(!selected);
|
|
68
|
-
onClick && onClick({ display: display, value: value });
|
|
69
|
-
};
|
|
70
|
-
(0, react_1.useLayoutEffect)(function () {
|
|
71
|
-
if (selected && !isSelected) {
|
|
72
|
-
setSelected(isSelected);
|
|
73
|
-
}
|
|
74
|
-
}, [isSelected]);
|
|
75
|
-
var size = M ? 'M' : XS ? 'XS' : 'S';
|
|
76
|
-
var TYPO_COMP = getTypoComp(size);
|
|
77
|
-
return (react_1.default.createElement(index_styled_1.StyledTagSelect, { disabled: disabled, invert: invert, onClick: function () { return !onMouseDown && !disabled && handleOnClick(); }, selected: selected, size: size, style: style, onMouseDown: function (ev) { return !disabled && onMouseDown && onMouseDown(ev); } },
|
|
78
|
-
react_1.default.createElement(TYPO_COMP, null, display)));
|
|
79
|
-
}
|
|
80
|
-
exports.TagSelect = TagSelect;
|
|
81
|
-
function TagLink(_a) {
|
|
82
|
-
var display = _a.display, to = _a.to, invert = _a.invert, M = _a.M, XS = _a.XS, _b = _a.variant, variant = _b === void 0 ? 'primary' : _b, color = _a.color;
|
|
83
|
-
var size = M ? 'M' : XS ? 'XS' : 'S';
|
|
84
|
-
var TYPO_COMP = getTypoComp(size);
|
|
85
|
-
return (react_1.default.createElement(index_styled_1.StyledLink, { to: to },
|
|
86
|
-
react_1.default.createElement(index_styled_1.StyledTagLink, { color: color, variant: variant, invert: invert, size: size },
|
|
87
|
-
react_1.default.createElement(TYPO_COMP, null, display))));
|
|
88
|
-
}
|
|
89
|
-
exports.TagLink = TagLink;
|
|
3
|
+
exports.TagSelect = exports.TagLink = exports.TagDisplay = exports.TagClear = void 0;
|
|
4
|
+
var TagClear_1 = require("./Comps/TagClear");
|
|
5
|
+
Object.defineProperty(exports, "TagClear", { enumerable: true, get: function () { return TagClear_1.TagClear; } });
|
|
6
|
+
var TagDisplay_1 = require("./Comps/TagDisplay");
|
|
7
|
+
Object.defineProperty(exports, "TagDisplay", { enumerable: true, get: function () { return TagDisplay_1.TagDisplay; } });
|
|
8
|
+
var TagLink_1 = require("./Comps/TagLink");
|
|
9
|
+
Object.defineProperty(exports, "TagLink", { enumerable: true, get: function () { return TagLink_1.TagLink; } });
|
|
10
|
+
var TagSelect_1 = require("./Comps/TagSelect");
|
|
11
|
+
Object.defineProperty(exports, "TagSelect", { enumerable: true, get: function () { return TagSelect_1.TagSelect; } });
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const STYLED_ELLIPSIS_SANS_2: import("styled-components").StyledComponent<React.FunctionComponent<import("../../Typo").TypoCompProps>, any, {}, never>;
|
|
3
|
+
export declare const STYLED_ELLIPSIS_SANS_3: import("styled-components").StyledComponent<React.FunctionComponent<import("../../Typo").TypoCompProps>, any, {}, never>;
|
|
4
|
+
export declare const getTypoComp: (size: string) => (props: React.HTMLAttributes<HTMLSpanElement>) => React.JSX.Element;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
var __assign = (this && this.__assign) || function () {
|
|
7
|
+
__assign = Object.assign || function(t) {
|
|
8
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
9
|
+
s = arguments[i];
|
|
10
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
11
|
+
t[p] = s[p];
|
|
12
|
+
}
|
|
13
|
+
return t;
|
|
14
|
+
};
|
|
15
|
+
return __assign.apply(this, arguments);
|
|
16
|
+
};
|
|
17
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.getTypoComp = exports.STYLED_ELLIPSIS_SANS_3 = exports.STYLED_ELLIPSIS_SANS_2 = void 0;
|
|
22
|
+
var react_1 = __importDefault(require("react"));
|
|
23
|
+
var styled_components_1 = __importDefault(require("styled-components"));
|
|
24
|
+
var mixins_1 = require("../../../themes/mixins");
|
|
25
|
+
var Typo_1 = require("../../Typo");
|
|
26
|
+
exports.STYLED_ELLIPSIS_SANS_2 = (0, styled_components_1.default)(Typo_1.SANS_2)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), mixins_1.ellipsis);
|
|
27
|
+
exports.STYLED_ELLIPSIS_SANS_3 = (0, styled_components_1.default)(Typo_1.SANS_3)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), mixins_1.ellipsis);
|
|
28
|
+
var getTypoComp = function (size) {
|
|
29
|
+
return size === 'XS'
|
|
30
|
+
? function (props) { return (react_1.default.createElement(exports.STYLED_ELLIPSIS_SANS_2, __assign({}, props))); }
|
|
31
|
+
: function (props) { return (react_1.default.createElement(exports.STYLED_ELLIPSIS_SANS_3, __assign({ semibold: true }, props))); };
|
|
32
|
+
};
|
|
33
|
+
exports.getTypoComp = getTypoComp;
|
|
34
|
+
var templateObject_1, templateObject_2;
|
|
@@ -21,6 +21,6 @@ var PageScrollIndicator_ = function (args) {
|
|
|
21
21
|
var showDiv = args.showDiv;
|
|
22
22
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
23
23
|
react_1.default.createElement(PageScrollIndicator_1.PageScrollIndicator, null),
|
|
24
|
-
showDiv && react_1.default.createElement("div", { style: { height: "
|
|
24
|
+
showDiv && react_1.default.createElement("div", { style: { height: "2000px" } })));
|
|
25
25
|
};
|
|
26
26
|
exports.PageScrollIndicator_ = PageScrollIndicator_;
|
|
@@ -14,7 +14,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
14
14
|
exports.Tag_Link_Secondary = exports.Tag_Link_Primary = void 0;
|
|
15
15
|
var react_router_dom_1 = require("react-router-dom");
|
|
16
16
|
var Tags_1 = require("../components/Tags");
|
|
17
|
-
var themes_1 = require("../themes");
|
|
18
17
|
exports.default = {
|
|
19
18
|
title: 'Components/Tag Link',
|
|
20
19
|
argTypes: {
|
package/package.json
CHANGED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export const STYLED_ELLIPSIS_SANS_2: import("styled-components").StyledComponent<import("react").FunctionComponent<import("../Typo").TypoCompProps>, any, {}, never>;
|
|
2
|
-
export const STYLED_ELLIPSIS_SANS_3: import("styled-components").StyledComponent<import("react").FunctionComponent<import("../Typo").TypoCompProps>, any, {}, never>;
|
|
3
|
-
export const StyledTagClearIconWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
|
-
export const StyledLink: import("styled-components").StyledComponent<any, any, any, any>;
|
|
5
|
-
export const StyledTagDisplay: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
6
|
-
export const StyledTagClear: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
7
|
-
export const StyledTagSelect: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
8
|
-
export const StyledTagLink: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
-
return cooked;
|
|
5
|
-
};
|
|
6
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
-
if (k2 === undefined) k2 = k;
|
|
8
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
-
}
|
|
12
|
-
Object.defineProperty(o, k2, desc);
|
|
13
|
-
}) : (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
o[k2] = m[k];
|
|
16
|
-
}));
|
|
17
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
-
}) : function(o, v) {
|
|
20
|
-
o["default"] = v;
|
|
21
|
-
});
|
|
22
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
23
|
-
if (mod && mod.__esModule) return mod;
|
|
24
|
-
var result = {};
|
|
25
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
26
|
-
__setModuleDefault(result, mod);
|
|
27
|
-
return result;
|
|
28
|
-
};
|
|
29
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
-
exports.StyledTagLink = exports.StyledTagSelect = exports.StyledTagClear = exports.StyledTagDisplay = exports.StyledLink = exports.StyledTagClearIconWrapper = exports.STYLED_ELLIPSIS_SANS_3 = exports.STYLED_ELLIPSIS_SANS_2 = void 0;
|
|
31
|
-
var styled_components_1 = __importStar(require("styled-components"));
|
|
32
|
-
var colors_1 = require("../../themes/colors");
|
|
33
|
-
var react_router_dom_1 = require("react-router-dom");
|
|
34
|
-
var mixins_1 = require("../../themes/mixins");
|
|
35
|
-
var Typo_1 = require("../Typo");
|
|
36
|
-
var utilsOolib_1 = require("../../utilsOolib");
|
|
37
|
-
var greyColor100 = colors_1.colors.greyColor100, greyColor80 = colors_1.colors.greyColor80, greyColor10 = colors_1.colors.greyColor10, greyColor15 = colors_1.colors.greyColor15, greyColor40 = colors_1.colors.greyColor40, white = colors_1.colors.white, red = colors_1.colors.red, invertRed = colors_1.colors.invertRed, green = colors_1.colors.green, invertGreen = colors_1.colors.invertGreen, greyColor5 = colors_1.colors.greyColor5, hoverRed = colors_1.colors.hoverRed, hoverInvertRed = colors_1.colors.hoverInvertRed, hoverGreen = colors_1.colors.hoverGreen, invertHoverGreen = colors_1.colors.invertHoverGreen;
|
|
38
|
-
var SIZES = {
|
|
39
|
-
XS: '2rem',
|
|
40
|
-
S: "3rem",
|
|
41
|
-
M: "4rem",
|
|
42
|
-
};
|
|
43
|
-
var commonStyle = function (_a) {
|
|
44
|
-
var size = _a.size;
|
|
45
|
-
return "\n padding: ".concat(size === "XS" ? "0 .5rem" : "0 1rem", ";\n position: relative;\n display: inline-flex;\n column-gap: 1rem;\n align-items: center;\n border-radius:0.2rem;\n white-space: nowrap;\n\theight: ").concat(SIZES[size], ";\n max-width: 100%;\n");
|
|
46
|
-
};
|
|
47
|
-
var textColor = function (_a) {
|
|
48
|
-
var invert = _a.invert;
|
|
49
|
-
return (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n color: ", ";\n"], ["\n color: ", ";\n"])), invert ? greyColor100 : white);
|
|
50
|
-
};
|
|
51
|
-
var blueHover = function (_a) {
|
|
52
|
-
var invert = _a.invert, colors = _a.colors;
|
|
53
|
-
return (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n @media (hover: hover){\n &:hover {\n background-color: ", ";\n color: ", ";\t\t\n }\n }\n"], ["\n @media (hover: hover){\n &:hover {\n background-color: ", ";\n color: ", ";\t\t\n }\n }\n"])), invert
|
|
54
|
-
? (0, utilsOolib_1.getPrimaryColor10)(colors)
|
|
55
|
-
: (0, utilsOolib_1.getPrimaryColor40)(colors), invert
|
|
56
|
-
? greyColor100
|
|
57
|
-
: (0, utilsOolib_1.getPrimaryColorText)(colors));
|
|
58
|
-
};
|
|
59
|
-
var redHover = function (_a) {
|
|
60
|
-
var invert = _a.invert;
|
|
61
|
-
return (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n @media (hover: hover){\n &:hover {\n background-color: ", "; \n }\n }\n"], ["\n @media (hover: hover){\n &:hover {\n background-color: ", "; \n }\n }\n"])), invert
|
|
62
|
-
? hoverInvertRed
|
|
63
|
-
: hoverRed);
|
|
64
|
-
};
|
|
65
|
-
var greenHover = function (_a) {
|
|
66
|
-
var invert = _a.invert;
|
|
67
|
-
return (0, styled_components_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n @media (hover: hover){\n &:hover {\n background-color: ", ";\n }\n }\n"], ["\n @media (hover: hover){\n &:hover {\n background-color: ", ";\n }\n }\n"])), invert
|
|
68
|
-
? invertHoverGreen
|
|
69
|
-
: hoverGreen);
|
|
70
|
-
};
|
|
71
|
-
var blackHover = function (_a) {
|
|
72
|
-
var invert = _a.invert;
|
|
73
|
-
return (0, styled_components_1.css)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n @media (hover: hover){\n &:hover{\n background-color: ", ";\n }\n }\n"], ["\n @media (hover: hover){\n &:hover{\n background-color: ", ";\n }\n }\n"])), invert
|
|
74
|
-
? greyColor5
|
|
75
|
-
: greyColor80);
|
|
76
|
-
};
|
|
77
|
-
var greyHover = function (_a) {
|
|
78
|
-
var invert = _a.invert;
|
|
79
|
-
return (0, styled_components_1.css)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n @media (hover: hover){\n &:hover {\n background-color: ", ";\n }\n }\n"], ["\n @media (hover: hover){\n &:hover {\n background-color: ", ";\n }\n }\n"])), invert
|
|
80
|
-
? greyColor80
|
|
81
|
-
: greyColor10);
|
|
82
|
-
};
|
|
83
|
-
exports.STYLED_ELLIPSIS_SANS_2 = (0, styled_components_1.default)(Typo_1.SANS_2)(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), mixins_1.ellipsis);
|
|
84
|
-
exports.STYLED_ELLIPSIS_SANS_3 = (0, styled_components_1.default)(Typo_1.SANS_3)(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), mixins_1.ellipsis);
|
|
85
|
-
var StyledTagDisplay = styled_components_1.default.div(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n ", "\n ", "\n"], ["\n ", "\n ", "\n"])), function (_a) {
|
|
86
|
-
var size = _a.size;
|
|
87
|
-
return commonStyle({ size: size });
|
|
88
|
-
}, function (_a) {
|
|
89
|
-
var variant = _a.variant, invert = _a.invert, size = _a.size, textColor = _a.textColor, tagColor = _a.tagColor;
|
|
90
|
-
return variant === "primary"
|
|
91
|
-
? (0, styled_components_1.css)(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n background-color: ", ";\n color: ", ";\n "], ["\n background-color: ", ";\n color: ", ";\n "])), tagColor
|
|
92
|
-
? tagColor
|
|
93
|
-
: !invert
|
|
94
|
-
? greyColor15
|
|
95
|
-
: greyColor80, textColor ? textColor : !invert ? greyColor80 : greyColor40) : //secondary
|
|
96
|
-
(0, styled_components_1.css)(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n background: none;\n border: ", " solid\n /* border: 2px solid */\n ", ";\n color: ", ";\n "], ["\n background: none;\n border: ", " solid\n /* border: 2px solid */\n ", ";\n color: ", ";\n "])), size === "XS" ? "1px" : "2px", tagColor ? tagColor : !invert ? size === "XS" ? greyColor100 : greyColor15 : greyColor80, textColor ? textColor : !invert ? size === "XS" ? greyColor100 : greyColor80 : greyColor15);
|
|
97
|
-
});
|
|
98
|
-
exports.StyledTagDisplay = StyledTagDisplay;
|
|
99
|
-
var StyledTagClear = styled_components_1.default.div(templateObject_17 || (templateObject_17 = __makeTemplateObject(["\n\n \t", "\n\t//overrides of commonStyle\n\tpadding-right: 0;\n\tgap: 0.5rem;\n\t//--\n\n\t", "\n \n\t\n\t", "\n"], ["\n\n \t", "\n\t//overrides of commonStyle\n\tpadding-right: 0;\n\tgap: 0.5rem;\n\t//--\n\n\t", "\n \n\t\n\t", "\n"])), function (_a) {
|
|
100
|
-
var size = _a.size;
|
|
101
|
-
return commonStyle({ size: size });
|
|
102
|
-
}, function (_a) {
|
|
103
|
-
var variant = _a.variant, size = _a.size, invert = _a.invert, grey = _a.grey, colors = _a.theme.colors;
|
|
104
|
-
if (variant === "primary") {
|
|
105
|
-
return grey
|
|
106
|
-
? (0, styled_components_1.css)(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n background-color: ", ";\n color: ", ";\n "], ["\n background-color: ", ";\n color: ", ";\n "])), !invert ? greyColor15 : greyColor80, !invert ? greyColor80 : greyColor15) : (0, styled_components_1.css)(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n background-color: ", ";\n color: ", ";\n "], ["\n background-color: ", ";\n color: ", ";\n "])), !invert
|
|
107
|
-
? (0, utilsOolib_1.getPrimaryColor100)(colors)
|
|
108
|
-
: (0, utilsOolib_1.getPrimaryColor40)(colors), !invert ? white : greyColor100);
|
|
109
|
-
}
|
|
110
|
-
else {
|
|
111
|
-
// secondry
|
|
112
|
-
return grey
|
|
113
|
-
? (0, styled_components_1.css)(templateObject_14 || (templateObject_14 = __makeTemplateObject(["\n background: none;\n border: ", " solid ", ";\n color: ", ";\n "], ["\n background: none;\n border: ", " solid ", ";\n color: ", ";\n "])), size === "XS" ? "1px" : "2px", !invert ? greyColor15 : greyColor80, !invert ? greyColor80 : greyColor15) : (0, styled_components_1.css)(templateObject_15 || (templateObject_15 = __makeTemplateObject(["\n background: none;\n border: ", " solid\n ", ";\n color: ", ";\n "], ["\n background: none;\n border: ", " solid\n ", ";\n color: ", ";\n "])), size === "XS" ? "1px" : "2px", !invert ? (0, utilsOolib_1.getPrimaryColor100)(colors) : (0, utilsOolib_1.getPrimaryColor40)(colors), !invert
|
|
114
|
-
? (0, utilsOolib_1.getPrimaryColorText)(colors)
|
|
115
|
-
: (0, utilsOolib_1.getPrimaryColor40)(colors));
|
|
116
|
-
}
|
|
117
|
-
}, function (_a) {
|
|
118
|
-
var variant = _a.variant;
|
|
119
|
-
return variant === "ghost" && (0, styled_components_1.css)(templateObject_16 || (templateObject_16 = __makeTemplateObject(["\n background: none;\n\t border: none;\n "], ["\n background: none;\n\t border: none;\n "])));
|
|
120
|
-
});
|
|
121
|
-
exports.StyledTagClear = StyledTagClear;
|
|
122
|
-
var StyledTagClearIconWrapper = styled_components_1.default.div(templateObject_18 || (templateObject_18 = __makeTemplateObject(["\n \tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\tcursor: pointer;\n \theight: 100%;\n\tpadding-right: 0.75rem;\n\tpadding-left: 0.75rem;\n\t", ";\n\t", "\n"], ["\n \tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\tcursor: pointer;\n \theight: 100%;\n\tpadding-right: 0.75rem;\n\tpadding-left: 0.75rem;\n\t", ";\n\t", "\n"])), (0, mixins_1.transition)('color', 'background-color'), function (_a) {
|
|
123
|
-
var invert = _a.invert, grey = _a.grey, colors = _a.theme.colors;
|
|
124
|
-
return grey
|
|
125
|
-
? greyHover({ invert: invert, colors: colors })
|
|
126
|
-
: blueHover({ invert: invert, colors: colors });
|
|
127
|
-
});
|
|
128
|
-
exports.StyledTagClearIconWrapper = StyledTagClearIconWrapper;
|
|
129
|
-
var StyledTagSelect = styled_components_1.default.div(templateObject_24 || (templateObject_24 = __makeTemplateObject(["\n ", "\n ", "\n\n cursor: ", ";\n border-style: solid;\n border-width: ", ";\n \n\n ", "\n \n @media (hover: hover){\n &:hover {\n ", "\n }\n }\n \n"], ["\n ", "\n ", "\n\n cursor: ", ";\n border-style: solid;\n border-width: ", ";\n \n\n ", "\n \n @media (hover: hover){\n &:hover {\n ", "\n }\n }\n \n"])), function (_a) {
|
|
130
|
-
var size = _a.size;
|
|
131
|
-
return commonStyle({ size: size });
|
|
132
|
-
}, (0, mixins_1.transition)("background-color"), function (_a) {
|
|
133
|
-
var disabled = _a.disabled;
|
|
134
|
-
return disabled ? 'not-allowed' : 'pointer';
|
|
135
|
-
}, function (_a) {
|
|
136
|
-
var size = _a.size;
|
|
137
|
-
return size === "XS" ? "1px" : "2px";
|
|
138
|
-
}, function (_a) {
|
|
139
|
-
var disabled = _a.disabled, selected = _a.selected, invert = _a.invert, colors = _a.theme.colors;
|
|
140
|
-
if (disabled) {
|
|
141
|
-
return invert ? (0, styled_components_1.css)(templateObject_19 || (templateObject_19 = __makeTemplateObject(["\n border-color: ", ";\n background-color: ", ";\n color: ", ";\n "], ["\n border-color: ", ";\n background-color: ", ";\n color: ", ";\n "])), greyColor40, greyColor80, greyColor40) : (0, styled_components_1.css)(templateObject_20 || (templateObject_20 = __makeTemplateObject(["\n border-color: ", ";\n color: ", ";\n "], ["\n border-color: ", ";\n color: ", ";\n "])), greyColor15, greyColor40);
|
|
142
|
-
}
|
|
143
|
-
return invert ? (0, styled_components_1.css)(templateObject_21 || (templateObject_21 = __makeTemplateObject(["\n border-color: ", ";\n background-color: ", ";\n color: ", ";\n "], ["\n border-color: ", ";\n background-color: ", ";\n color: ", ";\n "])), (0, utilsOolib_1.getPrimaryColor40)(colors), selected ? (0, utilsOolib_1.getPrimaryColor40)(colors) : 'unset', selected ? greyColor100 : (0, utilsOolib_1.getPrimaryColor40)(colors)) : (0, styled_components_1.css)(templateObject_22 || (templateObject_22 = __makeTemplateObject(["\n border-color: ", ";\n background-color: ", ";\n color: ", ";\n "], ["\n border-color: ", ";\n background-color: ", ";\n color: ", ";\n "])), (0, utilsOolib_1.getPrimaryColor100)(colors), selected ? (0, utilsOolib_1.getPrimaryColor100)(colors) : 'unset', selected ? white : (0, utilsOolib_1.getPrimaryColorText)(colors));
|
|
144
|
-
}, function (_a) {
|
|
145
|
-
var selected = _a.selected, invert = _a.invert, disabled = _a.disabled, colors = _a.theme.colors;
|
|
146
|
-
return !selected && !disabled && (0, styled_components_1.css)(templateObject_23 || (templateObject_23 = __makeTemplateObject(["\n background-color: ", ";\n color: ", ";\n "], ["\n background-color: ", ";\n color: ", ";\n "])), invert ? greyColor80 : (0, utilsOolib_1.getPrimaryColor40)(colors), invert ? (0, utilsOolib_1.getPrimaryColor40)(colors) : (0, utilsOolib_1.getPrimaryColorText)(colors));
|
|
147
|
-
});
|
|
148
|
-
exports.StyledTagSelect = StyledTagSelect;
|
|
149
|
-
var tagLinkStyle = function (_a) {
|
|
150
|
-
var variant = _a.variant, invert = _a.invert, color = _a.color, size = _a.size, colors = _a.theme.colors;
|
|
151
|
-
switch (true) {
|
|
152
|
-
case variant === "primary":
|
|
153
|
-
switch (color) {
|
|
154
|
-
case 'red':
|
|
155
|
-
return (0, styled_components_1.css)(templateObject_25 || (templateObject_25 = __makeTemplateObject(["\n background-color: ", ";\n ", "\n ", ";\n "], ["\n background-color: ", ";\n ", "\n ", ";\n "])), !invert ? red : invertRed, textColor({ invert: invert }), redHover({ invert: invert, color: color }));
|
|
156
|
-
case 'green':
|
|
157
|
-
return (0, styled_components_1.css)(templateObject_26 || (templateObject_26 = __makeTemplateObject(["\n background-color: ", ";\n ", "\n ", ";\n "], ["\n background-color: ", ";\n ", "\n ", ";\n "])), !invert ? green : invertGreen, textColor({ invert: invert }), greenHover({ invert: invert }));
|
|
158
|
-
case 'black':
|
|
159
|
-
return (0, styled_components_1.css)(templateObject_27 || (templateObject_27 = __makeTemplateObject(["\n background-color: ", ";\n ", "\n ", "\n "], ["\n background-color: ", ";\n ", "\n ", "\n "])), !invert ? greyColor100 : greyColor15, textColor({ invert: invert }), blackHover({ invert: invert }));
|
|
160
|
-
default:
|
|
161
|
-
return (0, styled_components_1.css)(templateObject_28 || (templateObject_28 = __makeTemplateObject(["\n background-color: ", ";\n ", "\n ", ";\n "], ["\n background-color: ", ";\n ", "\n ", ";\n "])), !invert ? (0, utilsOolib_1.getPrimaryColor100)(colors) : (0, utilsOolib_1.getPrimaryColor40)(colors), textColor({ invert: invert }), blueHover({ invert: invert }));
|
|
162
|
-
}
|
|
163
|
-
default: // variant secondary
|
|
164
|
-
return (0, styled_components_1.css)(templateObject_29 || (templateObject_29 = __makeTemplateObject(["\n background: none;\n border: ", " solid \n ", ";\n color: ", ";\n ", ";\n "], ["\n background: none;\n border: ", " solid \n ", ";\n color: ", ";\n ", ";\n "])), size === "XS" ? "1px" : "2px", !invert ? (0, utilsOolib_1.getPrimaryColor100)(colors) : (0, utilsOolib_1.getPrimaryColor40)(colors), !invert ? (0, utilsOolib_1.getPrimaryColorText)(colors) : (0, utilsOolib_1.getPrimaryColor40)(colors), blueHover({ invert: invert, colors: colors }));
|
|
165
|
-
}
|
|
166
|
-
};
|
|
167
|
-
var StyledTagLink = styled_components_1.default.div(templateObject_30 || (templateObject_30 = __makeTemplateObject(["\n \t", "\n ", "\n\t ", ";\n"], ["\n \t", "\n ", "\n\t ", ";\n"])), function (_a) {
|
|
168
|
-
var size = _a.size;
|
|
169
|
-
return commonStyle({ size: size });
|
|
170
|
-
}, function (props) { return tagLinkStyle(props); }, (0, mixins_1.transition)("background-color", "color"));
|
|
171
|
-
exports.StyledTagLink = StyledTagLink;
|
|
172
|
-
var StyledLink = (0, styled_components_1.default)(react_router_dom_1.NavLink)(templateObject_31 || (templateObject_31 = __makeTemplateObject(["\n text-decoration: none;\n"], ["\n text-decoration: none;\n"])));
|
|
173
|
-
exports.StyledLink = StyledLink;
|
|
174
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19, templateObject_20, templateObject_21, templateObject_22, templateObject_23, templateObject_24, templateObject_25, templateObject_26, templateObject_27, templateObject_28, templateObject_29, templateObject_30, templateObject_31;
|
|
175
|
-
/* ${({ variant, invert, color, size, theme: { colors } }) => {
|
|
176
|
-
|
|
177
|
-
return variant === "primary"
|
|
178
|
-
? css`
|
|
179
|
-
background-color: ${ !invert
|
|
180
|
-
? getPrimaryColor100(colors)
|
|
181
|
-
: getPrimaryColor40(colors)};
|
|
182
|
-
color: ${ !invert ? white : greyColor100 };
|
|
183
|
-
${blueHover({invert, colors})};
|
|
184
|
-
`
|
|
185
|
-
: // secondary
|
|
186
|
-
css`
|
|
187
|
-
background: none;
|
|
188
|
-
border: ${
|
|
189
|
-
size === "XS" ? "1px" : "2px"} solid ${
|
|
190
|
-
!invert ? getPrimaryColor100(colors) : getPrimaryColor40(colors) };
|
|
191
|
-
color: ${!invert ? getPrimaryColorText(colors) : getPrimaryColor40(colors)};
|
|
192
|
-
${blueHover({invert, colors})}
|
|
193
|
-
`;
|
|
194
|
-
}} */
|