oolib 2.141.4 → 2.143.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Tooltip/index.js +3 -2
- package/dist/components/Tooltip/styled.d.ts +1 -1
- package/dist/components/Tooltip/styled.js +2 -2
- package/dist/icons/index.d.ts +2 -0
- package/dist/icons/index.js +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +5 -0
- package/dist/stories/v2/components/BlockLabel.stories.d.ts +3 -3
- package/dist/stories/v2/components/BlockLabel.stories.js +5 -4
- package/dist/utils/getBlockLabelProps.js +1 -0
- package/dist/v2/components/BlockLabel/index.js +10 -12
- package/dist/v2/components/BlockLabel/index.styled.js +1 -1
- package/dist/v2/components/Hints/comps/BulletIcon.d.ts +1 -0
- package/dist/v2/components/Hints/comps/BulletIcon.js +11 -0
- package/dist/v2/components/Hints/comps/HintsButton.d.ts +5 -0
- package/dist/v2/components/Hints/comps/HintsButton.js +24 -0
- package/dist/v2/components/Hints/contextApi.d.ts +6 -0
- package/dist/v2/components/Hints/contextApi.js +38 -0
- package/dist/v2/components/Hints/index.d.ts +10 -0
- package/dist/v2/components/Hints/index.js +87 -0
- package/dist/v2/components/Hints/styled.d.ts +6 -0
- package/dist/v2/components/Hints/styled.js +57 -0
- package/dist/v2/components/Hints/utils/getPositionStyles.d.ts +1 -0
- package/dist/v2/components/Hints/utils/getPositionStyles.js +17 -0
- package/dist/v2/components/InlineAlert /index.d.ts +25 -0
- package/dist/v2/components/InlineAlert /index.js +54 -0
- package/dist/v2/components/TextInputs/index.js +2 -3
- package/dist/v2/components/TextInputs/index.styled.js +1 -1
- package/dist/v2/themes/colors.d.ts +26 -8
- package/dist/v2/themes/colors.js +31 -9
- package/dist/v2/themes/globalStyles.js +1 -1
- package/package.json +1 -1
- package/dist/stories/v2/components/BlockLabel.stories copy.d.ts +0 -71
- package/dist/stories/v2/components/BlockLabel.stories copy.js +0 -106
|
@@ -74,7 +74,7 @@ var Tooltip = function (_a) {
|
|
|
74
74
|
(0, react_1.useEffect)(function () {
|
|
75
75
|
setShowTooltip(debug);
|
|
76
76
|
}, [debug]);
|
|
77
|
-
return (react_1.default.createElement(styled_1.StyledWrapper, { ref: trackerRef },
|
|
77
|
+
return (react_1.default.createElement(styled_1.StyledWrapper, { ref: trackerRef, id: "wrapper" },
|
|
78
78
|
react_1.default.createElement(styled_1.StyledTooltipTarget, { onMouseEnter: function () {
|
|
79
79
|
if (!isClicked) {
|
|
80
80
|
setShowTooltip(true);
|
|
@@ -88,7 +88,8 @@ var Tooltip = function (_a) {
|
|
|
88
88
|
}, onBlur: function () {
|
|
89
89
|
setIsClicked(false), setShowTooltip(false);
|
|
90
90
|
}, ref: targetRef, tabIndex: 0 }, presetTarget === "infoIcon" ? (react_1.default.createElement(styled_1.StyledIconButton, null,
|
|
91
|
-
|
|
91
|
+
" ",
|
|
92
|
+
react_1.default.createElement(phosphor_react_1.Info, { color: invert ? themes_1.colors.white : themes_1.colors.greyColor100, size: 16, weight: showTooltip ? 'fill' : 'regular' }))) : (children)),
|
|
92
93
|
showTooltip && (react_1.default.createElement(styled_1.StyledTooltipBox, { fixPos: fixPos, isOpen: showTooltip, position: position, show: showTooltip, style: style, invert: invert },
|
|
93
94
|
text.split('\n').filter(Boolean).map(function (singleline, i) { return (react_1.default.createElement(Typo_1.SANS_2, __assign({}, (i !== 0 ? { style: { marginTop: '0.5rem' } } : {})), singleline)); }),
|
|
94
95
|
react_1.default.createElement(styled_1.StyledArrowOutline, { position: position },
|
|
@@ -23,5 +23,5 @@ interface StyledArrowProps {
|
|
|
23
23
|
invert: boolean;
|
|
24
24
|
}
|
|
25
25
|
export declare const StyledArrow: import("styled-components").StyledComponent<"span", any, StyledArrowProps, never>;
|
|
26
|
-
export declare const StyledIconButton: import("styled-components").StyledComponent<"
|
|
26
|
+
export declare const StyledIconButton: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
27
27
|
export {};
|
|
@@ -24,7 +24,7 @@ exports.StyledTooltipBox = styled_components_1.default.div(templateObject_2 || (
|
|
|
24
24
|
var position = _a.position, fixPos = _a.fixPos;
|
|
25
25
|
return (0, util_1.positionTooltip)({ position: position, fixPos: fixPos });
|
|
26
26
|
});
|
|
27
|
-
exports.StyledTooltipTarget = styled_components_1.default.button(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n border: none;\n background: inherit;\n font-size: inherit;\n width: 100%;\n"], ["\n border: none;\n background: inherit;\n font-size: inherit;\n width: 100%;\n"])));
|
|
27
|
+
exports.StyledTooltipTarget = styled_components_1.default.button(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n border: none;\n background: inherit;\n font-size: inherit;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n"], ["\n border: none;\n background: inherit;\n font-size: inherit;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n"])));
|
|
28
28
|
exports.StyledArrowOutline = styled_components_1.default.span(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n background-color: ", ";\n width: 1rem;\n height: 1rem;\n position: absolute;\n clip-path: polygon(", ");\n ", ";\n"], ["\n background-color: ", ";\n width: 1rem;\n height: 1rem;\n position: absolute;\n clip-path: polygon(", ");\n ", ";\n"])), greyColor15, function (_a) {
|
|
29
29
|
var position = _a.position;
|
|
30
30
|
return clipPaths[position];
|
|
@@ -33,5 +33,5 @@ exports.StyledArrow = styled_components_1.default.span(templateObject_5 || (temp
|
|
|
33
33
|
var position = _a.position;
|
|
34
34
|
return clipPaths[position];
|
|
35
35
|
}, util_1.positionArrow);
|
|
36
|
-
exports.StyledIconButton = styled_components_1.default.
|
|
36
|
+
exports.StyledIconButton = styled_components_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n background-color: ", ";\n border: none;\n outline: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n"], ["\n background-color: ", ";\n border: none;\n outline: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n"])), themes_1.colors.none);
|
|
37
37
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
package/dist/icons/index.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export namespace icons {
|
|
|
22
22
|
export { CalendarBlank };
|
|
23
23
|
export { Trash };
|
|
24
24
|
export { DotsThreeVertical };
|
|
25
|
+
export { DotsThreeCircle };
|
|
25
26
|
export { DotsThree };
|
|
26
27
|
export { CaretUp };
|
|
27
28
|
export { CaretDown };
|
|
@@ -200,6 +201,7 @@ import { ArrowLeft } from 'phosphor-react';
|
|
|
200
201
|
import { CalendarBlank } from 'phosphor-react';
|
|
201
202
|
import { Trash } from 'phosphor-react';
|
|
202
203
|
import { DotsThreeVertical } from 'phosphor-react';
|
|
204
|
+
import { DotsThreeCircle } from 'phosphor-react';
|
|
203
205
|
import { DotsThree } from 'phosphor-react';
|
|
204
206
|
import { CaretUp } from 'phosphor-react';
|
|
205
207
|
import { CaretDown } from 'phosphor-react';
|
package/dist/icons/index.js
CHANGED
|
@@ -27,6 +27,7 @@ exports.icons = {
|
|
|
27
27
|
CalendarBlank: phosphor_react_1.CalendarBlank,
|
|
28
28
|
Trash: phosphor_react_1.Trash,
|
|
29
29
|
DotsThreeVertical: phosphor_react_1.DotsThreeVertical,
|
|
30
|
+
DotsThreeCircle: phosphor_react_1.DotsThreeCircle,
|
|
30
31
|
DotsThree: phosphor_react_1.DotsThree,
|
|
31
32
|
CaretUp: phosphor_react_1.CaretUp,
|
|
32
33
|
CaretDown: phosphor_react_1.CaretDown,
|
package/dist/index.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export * from "./components/Paddings";
|
|
|
18
18
|
export * from "./utils/_EXPORTS";
|
|
19
19
|
export * from "./v2/components/Buttons";
|
|
20
20
|
export * from "./v2/components/Typo2";
|
|
21
|
+
export * from "./v2/components/BlockLabel";
|
|
21
22
|
export { colors } from "./themes";
|
|
22
23
|
export { icons } from "./icons";
|
|
23
24
|
export { Section } from "./components/Section";
|
package/dist/index.js
CHANGED
|
@@ -176,5 +176,10 @@ Object.defineProperty(exports, "TableCellResizerPlugin", { enumerable: true, get
|
|
|
176
176
|
/////// V2 components /themes
|
|
177
177
|
__exportStar(require("./v2/components/Buttons"), exports);
|
|
178
178
|
__exportStar(require("./v2/components/Typo2"), exports);
|
|
179
|
+
__exportStar(require("./v2/components/BlockLabel"), exports);
|
|
180
|
+
__exportStar(require(""), exports);
|
|
179
181
|
var themes_2 = require("./v2/themes");
|
|
180
182
|
Object.defineProperty(exports, "colors2", { enumerable: true, get: function () { return themes_2.colors; } });
|
|
183
|
+
// v2 contexts
|
|
184
|
+
var contextApi_2 = require("./v2/components/Hints/contextApi");
|
|
185
|
+
Object.defineProperty(exports, "HintsProvider", { enumerable: true, get: function () { return contextApi_2.HintsProvider; } });
|
|
@@ -36,7 +36,7 @@ declare namespace _default {
|
|
|
36
36
|
let name_8: string;
|
|
37
37
|
export { name_8 as name };
|
|
38
38
|
}
|
|
39
|
-
namespace
|
|
39
|
+
namespace disabled {
|
|
40
40
|
let name_9: string;
|
|
41
41
|
export { name_9 as name };
|
|
42
42
|
}
|
|
@@ -59,8 +59,8 @@ declare namespace _default {
|
|
|
59
59
|
export { errorMessage_1 as errorMessage };
|
|
60
60
|
let isRequired_1: boolean;
|
|
61
61
|
export { isRequired_1 as isRequired };
|
|
62
|
-
let
|
|
63
|
-
export {
|
|
62
|
+
let disabled_1: boolean;
|
|
63
|
+
export { disabled_1 as disabled };
|
|
64
64
|
let readOnly_1: boolean;
|
|
65
65
|
export { readOnly_1 as readOnly };
|
|
66
66
|
let inputOnlyLabel_1: string;
|
|
@@ -12,7 +12,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
exports.Block_Label = void 0;
|
|
15
|
-
var BlockLabel_1 = require("../../../components/BlockLabel");
|
|
15
|
+
var BlockLabel_1 = require("../../../v2/components/BlockLabel");
|
|
16
16
|
var themes_1 = require("../../../themes");
|
|
17
17
|
exports.default = {
|
|
18
18
|
title: "Oolib V 2.0/Components/BlockLabel",
|
|
@@ -47,8 +47,8 @@ exports.default = {
|
|
|
47
47
|
readOnly: {
|
|
48
48
|
name: "Read Only",
|
|
49
49
|
},
|
|
50
|
-
|
|
51
|
-
name: "
|
|
50
|
+
disabled: {
|
|
51
|
+
name: "Disabled",
|
|
52
52
|
},
|
|
53
53
|
inputOnlyLabel: {},
|
|
54
54
|
},
|
|
@@ -62,7 +62,8 @@ exports.default = {
|
|
|
62
62
|
infoTooltip: "",
|
|
63
63
|
errorMessage: "", //gets converted into the appropriate errorMsgs prop below
|
|
64
64
|
isRequired: false,
|
|
65
|
-
|
|
65
|
+
disabled: false,
|
|
66
|
+
// invert: false,
|
|
66
67
|
readOnly: false,
|
|
67
68
|
inputOnlyLabel: "Shows only if label is not defined. AND readOnly = true",
|
|
68
69
|
},
|
|
@@ -28,18 +28,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.BlockLabel = void 0;
|
|
30
30
|
var react_1 = __importStar(require("react"));
|
|
31
|
-
var
|
|
32
|
-
var InlineAlert_1 = require("../../../components/InlineAlert");
|
|
31
|
+
var InlineAlert_1 = require("../InlineAlert ");
|
|
33
32
|
var index_styled_1 = require("./index.styled");
|
|
34
|
-
var colors_1 = require("../../../themes/colors");
|
|
35
33
|
var toArray_1 = require("../../../utils/toArray");
|
|
36
|
-
var Hints_1 = __importDefault(require("
|
|
34
|
+
var Hints_1 = __importDefault(require("../Hints"));
|
|
37
35
|
var Tooltip_1 = require("../../../components/Tooltip");
|
|
38
|
-
var phosphor_react_1 = require("phosphor-react");
|
|
39
36
|
var Typo2_1 = require("../Typo2");
|
|
40
|
-
var
|
|
37
|
+
var colors_1 = require("../../themes/colors");
|
|
38
|
+
var grey40 = colors_1.colors.grey40, grey60 = colors_1.colors.grey60;
|
|
41
39
|
var BlockLabel = function (props) {
|
|
42
|
-
var label = props.label, sublabel = props.sublabel, inputOnlyLabel = props.inputOnlyLabel, invert = props.invert, isRequired = props.isRequired, readOnly = props.readOnly, className = props.className, style = props.style, errorMsgs = props.errorMsgs, hints = props.hints, id = props.id, hintsTitle = props.hintsTitle, hintsBtnLabel = props.hintsBtnLabel, hintsSubtitle = props.hintsSubtitle, hideOptionalLabel = props.hideOptionalLabel, infoTooltip = props.infoTooltip;
|
|
40
|
+
var label = props.label, sublabel = props.sublabel, inputOnlyLabel = props.inputOnlyLabel, invert = props.invert, isRequired = props.isRequired, readOnly = props.readOnly, className = props.className, style = props.style, errorMsgs = props.errorMsgs, hints = props.hints, id = props.id, hintsTitle = props.hintsTitle, hintsBtnLabel = props.hintsBtnLabel, hintsSubtitle = props.hintsSubtitle, hideOptionalLabel = props.hideOptionalLabel, infoTooltip = props.infoTooltip, disabled = props.disabled;
|
|
43
41
|
var shouldCompRender = label ||
|
|
44
42
|
(!readOnly &&
|
|
45
43
|
(sublabel ||
|
|
@@ -54,14 +52,14 @@ var BlockLabel = function (props) {
|
|
|
54
52
|
? "danger"
|
|
55
53
|
: errorMsgs[0].type || "danger";
|
|
56
54
|
return (shouldCompRender && (react_1.default.createElement(index_styled_1.StyledBlockLabel, { style: style, className: className },
|
|
57
|
-
react_1.default.createElement("div", { style: { display: "flex", gap: "
|
|
58
|
-
(label || inputOnlyLabel) && (react_1.default.createElement(Typo2_1.UI_BODY_SM, {
|
|
59
|
-
!readOnly && hints ? (react_1.default.createElement(Hints_1.default, { id: id, title: hintsTitle, btnlabel: hintsBtnLabel, subtitle: hintsSubtitle, hints: hints })) : null,
|
|
60
|
-
optional && !hideOptionalLabel && (react_1.default.createElement(Typo_1.SANS_3, { color: invert ? greyColor40 : greyColor80 }, "(optional)")),
|
|
55
|
+
react_1.default.createElement("div", { style: { display: "flex", gap: "0.4rem" } },
|
|
56
|
+
(label || inputOnlyLabel) && (react_1.default.createElement(Typo2_1.UI_BODY_SM, { color: disabled ? colors_1.colors.grey40 : colors_1.colors.grey80, semibold: true, capitalize: true }, label || inputOnlyLabel)),
|
|
61
57
|
!readOnly && (errorMsgs === null || errorMsgs === void 0 ? void 0 : errorMsgs.length) > 0 ? (react_1.default.createElement(InlineAlert_1.InlineAlert, { text: errText, type: errType, link: errLink, invert: invert })) : null,
|
|
58
|
+
optional && !hideOptionalLabel && (react_1.default.createElement(Typo2_1.UI_BODY_SM, { color: disabled ? colors_1.colors.grey20 : colors_1.colors.grey40 }, "(optional)")),
|
|
59
|
+
!readOnly && hints ? (react_1.default.createElement(Hints_1.default, { id: id, title: hintsTitle, btnlabel: hintsBtnLabel, subtitle: hintsSubtitle, hints: hints, disabled: disabled })) : null,
|
|
62
60
|
infoTooltip && (react_1.default.createElement(Tooltip_1.Tooltip, { text: infoTooltip.text || infoTooltip, position: infoTooltip.position || "right", invert: invert, debug: infoTooltip.debug, popOutOfOverflowHiddenParent: infoTooltip.popOutOfOverflowHiddenParent, presetTarget: "infoIcon" }))),
|
|
63
61
|
!readOnly &&
|
|
64
62
|
sublabel &&
|
|
65
|
-
(0, toArray_1.toArray)(sublabel).map(function (subL, i) { return (react_1.default.createElement(
|
|
63
|
+
(0, toArray_1.toArray)(sublabel).map(function (subL, i) { return (react_1.default.createElement(Typo2_1.UI_CAPTION, { key: i, color: disabled ? colors_1.colors.grey40 : grey60 }, subL)); }))));
|
|
66
64
|
};
|
|
67
65
|
exports.BlockLabel = BlockLabel;
|
|
@@ -9,6 +9,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.StyledInfoTooltipbutton = exports.StyledBlockLabel = void 0;
|
|
11
11
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
12
|
-
exports.StyledBlockLabel = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n gap:
|
|
12
|
+
exports.StyledBlockLabel = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n gap: 0.2rem;\n margin-bottom: 0.2rem;\n position: relative;\n"], ["\n display: flex;\n flex-direction: column;\n gap: 0.2rem;\n margin-bottom: 0.2rem;\n position: relative;\n"])));
|
|
13
13
|
exports.StyledInfoTooltipbutton = styled_components_1.default.button(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n border: none;\n background: none;\n outline: none;\n"], ["\n border: none;\n background: none;\n outline: none;\n"])));
|
|
14
14
|
var templateObject_1, templateObject_2;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function BulletIcon(): import("react").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BulletIcon = void 0;
|
|
4
|
+
var colors_1 = require("../../../themes/colors");
|
|
5
|
+
var DisplayIcon_1 = require("../../../../utils/comps/DisplayIcon");
|
|
6
|
+
var black = colors_1.colors.black;
|
|
7
|
+
var BulletIcon = function () { return (
|
|
8
|
+
// line height of SANS_3 is 21px. Dot is 8px tall. so below css (21/2 - 8/2) makes the circle perfectly aligned with the first line
|
|
9
|
+
React.createElement("div", { style: { fontSize: 0, marginTop: '6.5px', lineHeight: 0 } },
|
|
10
|
+
React.createElement(DisplayIcon_1.DisplayIcon, { color: black, weight: "fill", icon: "Circle", size: 8 }))); };
|
|
11
|
+
exports.BulletIcon = BulletIcon;
|
|
@@ -0,0 +1,24 @@
|
|
|
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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.HintsButton = void 0;
|
|
11
|
+
var phosphor_react_1 = require("phosphor-react");
|
|
12
|
+
var styled_components_1 = __importDefault(require("styled-components"));
|
|
13
|
+
var Typo2_1 = require("../../Typo2");
|
|
14
|
+
var colors_1 = require("../../../themes/colors");
|
|
15
|
+
var hintHover = colors_1.colors.hintHover, hint = colors_1.colors.hint, white = colors_1.colors.white;
|
|
16
|
+
var HintsButton = function (_a) {
|
|
17
|
+
var id = _a.id, btnLabel = _a.btnLabel, onClick = _a.onClick;
|
|
18
|
+
return (React.createElement(StyledButton, { onClick: function () { return onClick(id); } },
|
|
19
|
+
React.createElement(phosphor_react_1.Lightbulb, { size: 13, weight: "bold", style: { marginBottom: "0.2rem" } }),
|
|
20
|
+
React.createElement(Typo2_1.UI_BODY_SM, null, btnLabel)));
|
|
21
|
+
};
|
|
22
|
+
exports.HintsButton = HintsButton;
|
|
23
|
+
var StyledButton = styled_components_1.default.button(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n border: none;\n background: none;\n outline: none;\n cursor: pointer;\n padding: 0;\n margin: 0;\n border-radius: 0.4rem;\n\n display: flex;\n line-height: 100%;\n padding: 0.1rem 0.3rem 0rem 0.3rem;\n align-items: center;\n\n gap: 0.2rem;\n color: ", ";\n\n\n &:hover {\n background-color: ", ";\n /* color: ", "; */\n }\n\n &:active {\n background-color: ", ";\n color: white;\n }\n\n"], ["\n border: none;\n background: none;\n outline: none;\n cursor: pointer;\n padding: 0;\n margin: 0;\n border-radius: 0.4rem;\n\n display: flex;\n line-height: 100%;\n padding: 0.1rem 0.3rem 0rem 0.3rem;\n align-items: center;\n\n gap: 0.2rem;\n color: ", ";\n\n\n &:hover {\n background-color: ", ";\n /* color: ", "; */\n }\n\n &:active {\n background-color: ", ";\n color: white;\n }\n\n"])), hint, hintHover, white, hint);
|
|
24
|
+
var templateObject_1;
|
|
@@ -0,0 +1,38 @@
|
|
|
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.useHintsContext = exports.HintsProvider = exports.HintsContext = void 0;
|
|
27
|
+
var react_1 = __importStar(require("react"));
|
|
28
|
+
exports.HintsContext = (0, react_1.createContext)();
|
|
29
|
+
var HintsProvider = function (_a) {
|
|
30
|
+
var children = _a.children;
|
|
31
|
+
var _b = (0, react_1.useState)(""), active = _b[0], setActive = _b[1];
|
|
32
|
+
return (react_1.default.createElement(exports.HintsContext.Provider, { value: { active: active, setActive: setActive } }, children));
|
|
33
|
+
};
|
|
34
|
+
exports.HintsProvider = HintsProvider;
|
|
35
|
+
var useHintsContext = function () {
|
|
36
|
+
return (0, react_1.useContext)(exports.HintsContext);
|
|
37
|
+
};
|
|
38
|
+
exports.useHintsContext = useHintsContext;
|
|
@@ -0,0 +1,87 @@
|
|
|
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
|
+
var react_1 = __importStar(require("react"));
|
|
27
|
+
var styled_1 = require("./styled");
|
|
28
|
+
var Typo_1 = require("../../../components/Typo");
|
|
29
|
+
var contextApi_1 = require("../../../components/Hints/contextApi");
|
|
30
|
+
var colors_1 = require("../../themes/colors");
|
|
31
|
+
var DisplayIcon_1 = require("../../../utils/comps/DisplayIcon");
|
|
32
|
+
var Buttons_1 = require("../../../components/Buttons");
|
|
33
|
+
var Modal_1 = require("../../../components/Modals/Modal");
|
|
34
|
+
var mixins_1 = require("../../../themes/mixins");
|
|
35
|
+
var useScreenWidth_1 = require("../../../utils/customHooks/useScreenWidth");
|
|
36
|
+
var styled_2 = require("../../../components/Modals/Modal/styled");
|
|
37
|
+
var getPositionStyles_1 = require("./utils/getPositionStyles");
|
|
38
|
+
var BulletIcon_1 = require("./comps/BulletIcon");
|
|
39
|
+
var HintsButton_1 = require("./comps/HintsButton");
|
|
40
|
+
var grey80 = colors_1.colors.grey80, black = colors_1.colors.black;
|
|
41
|
+
var Hints = function (_a) {
|
|
42
|
+
var id = _a.id, hints = _a.hints, _b = _a.title, title = _b === void 0 ? "Hints" : _b, _c = _a.btnlabel, btnlabel = _c === void 0 ? "Hints" : _c, subtitle = _a.subtitle, disabled = _a.disabled;
|
|
43
|
+
//get the context state
|
|
44
|
+
var _d = (0, contextApi_1.useHintsContext)(), active = _d.active, setActive = _d.setActive;
|
|
45
|
+
var screenWidth = (0, useScreenWidth_1.useScreenWidth)();
|
|
46
|
+
var lightBoxRef = (0, react_1.useRef)();
|
|
47
|
+
var _e = (0, react_1.useState)((0, getPositionStyles_1.getPositionStyles)("left")), styles = _e[0], setStyles = _e[1];
|
|
48
|
+
//isStorybook is temporary hack to get correct with on storybook, since a story is getting renderend within an iframe, screen.width gives the incorrect width
|
|
49
|
+
var isDesktop = screenWidth > (0, mixins_1.getBreakPoint)("md");
|
|
50
|
+
(0, react_1.useEffect)(function () {
|
|
51
|
+
if (!lightBoxRef.current)
|
|
52
|
+
return;
|
|
53
|
+
var lightBoxRect = lightBoxRef.current.getBoundingClientRect();
|
|
54
|
+
// by default open on leftside, if the below condition is true than open at the bottom of hints
|
|
55
|
+
//note for future: arrow comp is fixed and lightbox will move to place itself within the visible area
|
|
56
|
+
if (lightBoxRect.left < 0) {
|
|
57
|
+
setStyles((0, getPositionStyles_1.getPositionStyles)("bottom"));
|
|
58
|
+
// setStyles({
|
|
59
|
+
// lightBox: { top: "4rem", right: "0" },
|
|
60
|
+
// arrow: { top: `none`, right: "3.5rem", transform: "none" },
|
|
61
|
+
// });
|
|
62
|
+
}
|
|
63
|
+
}, [active]);
|
|
64
|
+
return (react_1.default.createElement("div", null,
|
|
65
|
+
react_1.default.createElement(styled_1.StyledHints, { onClick: function () { return setActive(id); }, disabled: disabled },
|
|
66
|
+
react_1.default.createElement(HintsButton_1.HintsButton, { id: id, btnLabel: btnlabel, onClick: function () { return setActive(id); } })),
|
|
67
|
+
active === id ? (isDesktop ? (react_1.default.createElement("div", null,
|
|
68
|
+
react_1.default.createElement(styled_1.StyledTriangle, { style: styles.arrow, id: id }),
|
|
69
|
+
react_1.default.createElement(styled_1.StyledLightbox, { style: styles.lightBox, ref: lightBoxRef, id: id },
|
|
70
|
+
react_1.default.createElement(styled_2.StyledModalHeaderStyle2Container, null,
|
|
71
|
+
react_1.default.createElement("div", { style: { position: "absolute", top: "-2.5rem", fontSize: 0 } },
|
|
72
|
+
react_1.default.createElement(DisplayIcon_1.DisplayIcon, { icon: "ModalBulbIcon" })),
|
|
73
|
+
react_1.default.createElement(styled_2.StyledModalHeaderStyle2Title, null,
|
|
74
|
+
react_1.default.createElement(Typo_1.SANS_3, { semibold: true, capitalize: true }, title),
|
|
75
|
+
subtitle ? (react_1.default.createElement(Typo_1.SANS_3_4, { capitalize: true, semibold: true, style: { flexGrow: "1" }, color: grey80 }, subtitle)) : null,
|
|
76
|
+
react_1.default.createElement(Buttons_1.ButtonGhost, { onClick: function () { return setActive(""); }, icon: "X" }))),
|
|
77
|
+
react_1.default.createElement(styled_1.StyledLightBoxContent, null,
|
|
78
|
+
react_1.default.createElement(styled_1.StyledLightBoxList, null, hints.map(function (d) { return (react_1.default.createElement("li", null,
|
|
79
|
+
react_1.default.createElement(BulletIcon_1.BulletIcon, null),
|
|
80
|
+
react_1.default.createElement(Typo_1.SANS_3, null, d))); })))))) : (react_1.default.createElement(Modal_1.Modal, { isStorybook: true, headerStyle: "style2", id: "modal", title: title, onClose: function () { return setActive(""); } },
|
|
81
|
+
react_1.default.createElement("div", { style: { padding: ".5rem 2rem" } },
|
|
82
|
+
react_1.default.createElement(styled_1.StyledLightBoxList, null, hints.map(function (d) { return (react_1.default.createElement("li", null,
|
|
83
|
+
react_1.default.createElement("div", { style: { marginTop: ".5rem", lineHeight: 0 } },
|
|
84
|
+
react_1.default.createElement(DisplayIcon_1.DisplayIcon, { color: black, weight: "fill", icon: "Circle", size: 8 })),
|
|
85
|
+
react_1.default.createElement(Typo_1.SANS_3, null, d))); })))))) : null));
|
|
86
|
+
};
|
|
87
|
+
exports.default = Hints;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export const StyledHints: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
+
export const StyledLightbox: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
|
+
export const StyledLightBoxHeader: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
|
+
export const StyledLightBoxContent: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
|
+
export const StyledLightBoxList: import("styled-components").StyledComponent<"ul", any, {}, never>;
|
|
6
|
+
export const StyledTriangle: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -0,0 +1,57 @@
|
|
|
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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.StyledTriangle = exports.StyledLightBoxList = exports.StyledLightBoxContent = exports.StyledLightBoxHeader = exports.StyledLightbox = exports.StyledHints = void 0;
|
|
11
|
+
var styled_components_1 = __importDefault(require("styled-components"));
|
|
12
|
+
var colors_1 = require("../../themes/colors");
|
|
13
|
+
var globalVariables_1 = require("../../../globalStyles/globalVariables");
|
|
14
|
+
var hintHover = colors_1.colors.hintHover, hint = colors_1.colors.hint, white = colors_1.colors.white, black = colors_1.colors.black, grey20 = colors_1.colors.grey20;
|
|
15
|
+
exports.StyledHints = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n pointer-events: ", ";\n"], ["\n pointer-events: ", ";\n"])), function (_a) {
|
|
16
|
+
var disabled = _a.disabled;
|
|
17
|
+
return disabled && "none";
|
|
18
|
+
});
|
|
19
|
+
exports.StyledLightbox = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n z-index: 1000;\n background: ", ";\n position: absolute;\n width: 30rem;\n height: 35rem;\n ", "\n /* top: ", "; */\n /* right: ", "; */\n\n top: ", ";\n left: ", ";\n bottom: ", ";\n right: ", ";\n\n display: flex;\n flex-direction: column;\n"], ["\n z-index: 1000;\n background: ", ";\n position: absolute;\n width: 30rem;\n height: 35rem;\n ", "\n /* top: ", "; */\n /* right: ", "; */\n\n top: ", ";\n left: ", ";\n bottom: ", ";\n right: ", ";\n\n display: flex;\n flex-direction: column;\n"])), white, globalVariables_1.globalLightboxStyle, function (_a) {
|
|
20
|
+
var style = _a.style;
|
|
21
|
+
return ((style === null || style === void 0 ? void 0 : style.top) ? style.top : "-1rem");
|
|
22
|
+
}, function (_a) {
|
|
23
|
+
var style = _a.style;
|
|
24
|
+
return ((style === null || style === void 0 ? void 0 : style.right) ? style.right : "-31.5rem");
|
|
25
|
+
}, function (_a) {
|
|
26
|
+
var top = _a.style.top;
|
|
27
|
+
return top;
|
|
28
|
+
}, function (_a) {
|
|
29
|
+
var left = _a.style.left;
|
|
30
|
+
return left;
|
|
31
|
+
}, function (_a) {
|
|
32
|
+
var bottom = _a.style.bottom;
|
|
33
|
+
return bottom;
|
|
34
|
+
}, function (_a) {
|
|
35
|
+
var right = _a.style.right;
|
|
36
|
+
return right;
|
|
37
|
+
});
|
|
38
|
+
exports.StyledLightBoxHeader = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n height: 4rem;\n display: flex;\n justify-content: space-between;\n align-items: center;\n border-radius: 2px;\n gap: 1rem;\n\n padding: 1rem 1.5rem;\n"], ["\n height: 4rem;\n display: flex;\n justify-content: space-between;\n align-items: center;\n border-radius: 2px;\n gap: 1rem;\n\n padding: 1rem 1.5rem;\n"])));
|
|
39
|
+
exports.StyledLightBoxContent = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n padding: 0.5rem 2rem 2rem 1.5rem;\n overflow-y: auto;\n"], ["\n padding: 0.5rem 2rem 2rem 1.5rem;\n overflow-y: auto;\n"])));
|
|
40
|
+
exports.StyledLightBoxList = styled_components_1.default.ul(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n padding: 0;\n li {\n list-style-type: none;\n padding: 0.5rem 0;\n display: flex;\n gap: 1rem;\n /* align-items: center; */\n /* ::before {\n content: \"\";\n margin-top: 0.5rem;\n flex: 0 0 .5rem;\n width: .5rem;\n padding: 0%.5r;\n height: .5rem;\n background-color: ", ";\n border-radius: 50%;\n flex-shrink: 0;\n } */\n }\n"], ["\n padding: 0;\n li {\n list-style-type: none;\n padding: 0.5rem 0;\n display: flex;\n gap: 1rem;\n /* align-items: center; */\n /* ::before {\n content: \"\";\n margin-top: 0.5rem;\n flex: 0 0 .5rem;\n width: .5rem;\n padding: 0%.5r;\n height: .5rem;\n background-color: ", ";\n border-radius: 50%;\n flex-shrink: 0;\n } */\n }\n"])), black);
|
|
41
|
+
exports.StyledTriangle = styled_components_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n position: absolute;\n\n width: 10px;\n height: 10px;\n border-style: solid;\n\n border-width: 1px;\n border-color: ", " ", " transparent transparent;\n /* transform:rotate(-45deg); */\n z-index: 1001;\n background-color: white;\n\n top: ", ";\n left: ", ";\n bottom: ", ";\n right: ", ";\n transform: ", ";\n\n /* position:absolute; */\n /* top:.7rem; */\n /* left:-2rem; */\n /* transform :rotate(90deg); */\n"], ["\n position: absolute;\n\n width: 10px;\n height: 10px;\n border-style: solid;\n\n border-width: 1px;\n border-color: ", " ", " transparent transparent;\n /* transform:rotate(-45deg); */\n z-index: 1001;\n background-color: white;\n\n top: ", ";\n left: ", ";\n bottom: ", ";\n right: ", ";\n transform: ", ";\n\n /* position:absolute; */\n /* top:.7rem; */\n /* left:-2rem; */\n /* transform :rotate(90deg); */\n"])), grey20, grey20, function (_a) {
|
|
42
|
+
var top = _a.style.top;
|
|
43
|
+
return top;
|
|
44
|
+
}, function (_a) {
|
|
45
|
+
var left = _a.style.left;
|
|
46
|
+
return left;
|
|
47
|
+
}, function (_a) {
|
|
48
|
+
var bottom = _a.style.bottom;
|
|
49
|
+
return bottom;
|
|
50
|
+
}, function (_a) {
|
|
51
|
+
var right = _a.style.right;
|
|
52
|
+
return right;
|
|
53
|
+
}, function (_a) {
|
|
54
|
+
var transform = _a.style.transform;
|
|
55
|
+
return transform;
|
|
56
|
+
});
|
|
57
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function getPositionStyles(position: any): any;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getPositionStyles = void 0;
|
|
4
|
+
var getPositionStyles = function (position) {
|
|
5
|
+
var styles = {
|
|
6
|
+
left: {
|
|
7
|
+
lightBox: { top: "-2rem", left: "-31.5rem" },
|
|
8
|
+
arrow: { top: ".7rem", left: "-2rem", transform: "rotate(45deg)" },
|
|
9
|
+
},
|
|
10
|
+
bottom: {
|
|
11
|
+
lightBox: { top: "4.5rem", left: "-2rem" },
|
|
12
|
+
arrow: { top: "3.9rem", left: "6rem", transform: "rotate(-45deg)" },
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
return styles[position];
|
|
16
|
+
};
|
|
17
|
+
exports.getPositionStyles = getPositionStyles;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type AlertType = 'success' | 'danger' | 'neutral' | 'neutralInactive';
|
|
3
|
+
interface InlineAlertProps {
|
|
4
|
+
text: string;
|
|
5
|
+
link?: {
|
|
6
|
+
url: string;
|
|
7
|
+
text: string;
|
|
8
|
+
};
|
|
9
|
+
type?: AlertType;
|
|
10
|
+
style?: React.CSSProperties;
|
|
11
|
+
invert?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* @component Renders a inline alert component with customizable text and style.
|
|
15
|
+
*
|
|
16
|
+
* - The props object containing the following properties:
|
|
17
|
+
* @prop {string} props.text: The text to be displayed in the inline alert.
|
|
18
|
+
* @prop {'success' | 'danger' | 'neutral' | 'neutralInactive'} props.type: The type of alert to be displayed. Defaults to "neutral".
|
|
19
|
+
* @prop {React.CSSProperties} props.style: Additional CSS styles to apply to the inline alert.
|
|
20
|
+
* @prop {boolean} props.invert: A boolean indicating whether to invert the colors of the inline alert. Defaults to false.
|
|
21
|
+
* @prop {object} props.link: An object containing the link properties: url and text. If provided, a link is rendered next to the text.
|
|
22
|
+
* @return {ReactElement} The rendered inline alert component.
|
|
23
|
+
*/
|
|
24
|
+
export declare const InlineAlert: React.FunctionComponent<InlineAlertProps>;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.InlineAlert = void 0;
|
|
18
|
+
var react_1 = __importDefault(require("react"));
|
|
19
|
+
var colors_1 = require("../../themes/colors");
|
|
20
|
+
var utilsOolib_1 = require("../../../utilsOolib");
|
|
21
|
+
var success = colors_1.colors.success, error = colors_1.colors.error,
|
|
22
|
+
// invertRed,
|
|
23
|
+
white = colors_1.colors.white,
|
|
24
|
+
// invertGreen,
|
|
25
|
+
grey20 = colors_1.colors.grey20, grey70 = colors_1.colors.grey70, black = colors_1.colors.black;
|
|
26
|
+
/**
|
|
27
|
+
* @component Renders a inline alert component with customizable text and style.
|
|
28
|
+
*
|
|
29
|
+
* - The props object containing the following properties:
|
|
30
|
+
* @prop {string} props.text: The text to be displayed in the inline alert.
|
|
31
|
+
* @prop {'success' | 'danger' | 'neutral' | 'neutralInactive'} props.type: The type of alert to be displayed. Defaults to "neutral".
|
|
32
|
+
* @prop {React.CSSProperties} props.style: Additional CSS styles to apply to the inline alert.
|
|
33
|
+
* @prop {boolean} props.invert: A boolean indicating whether to invert the colors of the inline alert. Defaults to false.
|
|
34
|
+
* @prop {object} props.link: An object containing the link properties: url and text. If provided, a link is rendered next to the text.
|
|
35
|
+
* @return {ReactElement} The rendered inline alert component.
|
|
36
|
+
*/
|
|
37
|
+
var InlineAlert = function (_a) {
|
|
38
|
+
var text = _a.text, link = _a.link, _b = _a.type, type = _b === void 0 ? 'neutral' : _b, style = _a.style, invert = _a.invert;
|
|
39
|
+
var localize = (0, utilsOolib_1.useLocale)();
|
|
40
|
+
var typeColor = {
|
|
41
|
+
success: { normal: success },
|
|
42
|
+
danger: { normal: error },
|
|
43
|
+
neutral: { normal: black },
|
|
44
|
+
neutralInactive: { normal: grey70 },
|
|
45
|
+
};
|
|
46
|
+
return (react_1.default.createElement("h5", { style: __assign({ display: 'flex', alignItems: 'center' }, style) },
|
|
47
|
+
react_1.default.createElement("span", { className: 'UI_BODY_SM', style: { color: typeColor[type][invert ? 'invert' : 'normal'], marginBottom: '0.1rem' } }, localize(text)),
|
|
48
|
+
link && (react_1.default.createElement("a", { className: 'UI_BODY_SM', style: {
|
|
49
|
+
// paddingLeft: '1rem',
|
|
50
|
+
textDecoration: 'underline',
|
|
51
|
+
color: invert ? white : black,
|
|
52
|
+
}, href: link.url, target: "_blank", rel: "noopener noreferrer" }, localize(link.text)))));
|
|
53
|
+
};
|
|
54
|
+
exports.InlineAlert = InlineAlert;
|
|
@@ -84,10 +84,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
84
84
|
exports.NumberInput = exports.URLInput = exports.PhoneInput = exports.EmailInput = exports.PasswordInput = exports.TextInput = void 0;
|
|
85
85
|
var react_1 = __importStar(require("react"));
|
|
86
86
|
var styled_components_1 = require("styled-components");
|
|
87
|
-
var BlockLabel_1 = require("
|
|
87
|
+
var BlockLabel_1 = require("../BlockLabel");
|
|
88
88
|
var LoadersAndProgress_1 = require("../../../components/LoadersAndProgress");
|
|
89
89
|
var OKELink_1 = require("../../../components/OKELink");
|
|
90
|
-
var icons_1 = require("../../../icons");
|
|
91
90
|
var _EXPORTS_1 = require("../../../utils/_EXPORTS");
|
|
92
91
|
var utilsOolib_1 = require("../../../utilsOolib");
|
|
93
92
|
var themes_1 = require("../../themes");
|
|
@@ -190,7 +189,7 @@ function TextInput(_a) {
|
|
|
190
189
|
react_1.default.createElement(Typo2_1.UI_CAPTION, null, localize((clearBtn === null || clearBtn === void 0 ? void 0 : clearBtn.text) || "clear")))),
|
|
191
190
|
actionBtn && (react_1.default.createElement(Buttons_1.ButtonPrimary, { M: true, value: actionBtn.text, invert: actionBtn.invert, onClick: actionBtnEnabaled && actionBtn.onClick, disabled: !actionBtnEnabaled, style: { marginRight: "-2rem" } }))),
|
|
192
191
|
displayValidationMsg && (validationStatus === null || validationStatus === void 0 ? void 0 : validationStatus.msg) && (react_1.default.createElement(index_styled_1.MsgContainerStyled, { status: validationStatus === null || validationStatus === void 0 ? void 0 : validationStatus.type },
|
|
193
|
-
(validationStatus === null || validationStatus === void 0 ? void 0 : validationStatus.type) === "error" && (react_1.default.createElement(DisplayIcon_1.DisplayIcon, { size: 12, icon: "
|
|
192
|
+
(validationStatus === null || validationStatus === void 0 ? void 0 : validationStatus.type) === "error" && (react_1.default.createElement(DisplayIcon_1.DisplayIcon, { size: 12, icon: "WarningDiamond", weight: "fill", color: themes_1.colors.red })),
|
|
194
193
|
react_1.default.createElement(Typo2_1.UI_HELPTEXT, null,
|
|
195
194
|
validationStatus.msg,
|
|
196
195
|
validationStatus.link && (react_1.default.createElement(OKELink_1.OKELink, { style: { marginLeft: "1rem" }, to: validationStatus.link.to }, validationStatus.link.text))))))))));
|
|
@@ -57,7 +57,7 @@ exports.InputContainerStyled = styled_components_1.default.div(templateObject_6
|
|
|
57
57
|
});
|
|
58
58
|
exports.InputStyled = styled_components_1.default.input(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n height: ", ";\n border: none;\n outline: none;\n flex-grow: 1;\n background: transparent;\n color: inherit;\n\n &:-webkit-autofill {\n transition-delay: 9999s;\n }\n\n ::placeholder {\n color: ", ";\n opacity: 1;\n }\n"], ["\n height: ", ";\n border: none;\n outline: none;\n flex-grow: 1;\n background: transparent;\n color: inherit;\n\n &:-webkit-autofill {\n transition-delay: 9999s;\n }\n\n ::placeholder {\n color: ", ";\n opacity: 1;\n }\n"])), globalStyles_1.globalInputHeight, function (_a) {
|
|
59
59
|
var disabled = _a.disabled;
|
|
60
|
-
return (disabled ? themes_1.colors.grey40 : themes_1.colors.
|
|
60
|
+
return (disabled ? themes_1.colors.grey40 : themes_1.colors.grey60);
|
|
61
61
|
});
|
|
62
62
|
exports.ClearButtonStyled = styled_components_1.default.button(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n border-radius: 14px;\n background-color: ", ";\n cursor: pointer;\n border: 0;\n padding: 4px 10px;\n"], ["\n border-radius: 14px;\n background-color: ", ";\n cursor: pointer;\n border: 0;\n padding: 4px 10px;\n"])), themes_1.colors.grey10);
|
|
63
63
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8;
|
|
@@ -10,12 +10,21 @@ export declare const colors: {
|
|
|
10
10
|
onTertiary: string;
|
|
11
11
|
surfaceContainer: string;
|
|
12
12
|
surfaceContainerLow: string;
|
|
13
|
-
grey80: string;
|
|
14
|
-
grey40: string;
|
|
15
13
|
grey10: string;
|
|
14
|
+
grey20: string;
|
|
15
|
+
grey30: string;
|
|
16
|
+
grey40: string;
|
|
17
|
+
grey50: string;
|
|
18
|
+
grey60: string;
|
|
19
|
+
grey70: string;
|
|
20
|
+
grey80: string;
|
|
21
|
+
grey90: string;
|
|
22
|
+
black: string;
|
|
16
23
|
white: string;
|
|
17
|
-
|
|
18
|
-
|
|
24
|
+
success: string;
|
|
25
|
+
error: string;
|
|
26
|
+
hintHover: string;
|
|
27
|
+
hint: string;
|
|
19
28
|
};
|
|
20
29
|
export interface Colors2Type {
|
|
21
30
|
primary: string;
|
|
@@ -29,10 +38,19 @@ export interface Colors2Type {
|
|
|
29
38
|
onTertiary: string;
|
|
30
39
|
surfaceContainer: string;
|
|
31
40
|
surfaceContainerLow: string;
|
|
32
|
-
grey80: string;
|
|
33
|
-
grey40: string;
|
|
34
41
|
grey10: string;
|
|
42
|
+
grey20: string;
|
|
43
|
+
grey30: string;
|
|
44
|
+
grey40: string;
|
|
45
|
+
grey50: string;
|
|
46
|
+
grey60: string;
|
|
47
|
+
grey70: string;
|
|
48
|
+
grey80: string;
|
|
49
|
+
grey90: string;
|
|
35
50
|
white: string;
|
|
36
|
-
|
|
37
|
-
|
|
51
|
+
black: string;
|
|
52
|
+
error: string;
|
|
53
|
+
success: string;
|
|
54
|
+
hintHover: string;
|
|
55
|
+
hint: string;
|
|
38
56
|
}
|
package/dist/v2/themes/colors.js
CHANGED
|
@@ -12,12 +12,25 @@ var tertiaryContainer = "#D4CAD8";
|
|
|
12
12
|
var onTertiary = "#532E68";
|
|
13
13
|
var surfaceContainer = "#EBEEF1";
|
|
14
14
|
var surfaceContainerLow = "#F1F4F7";
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
// const grey80 = '#333333'
|
|
16
|
+
// const grey40 = "#999999"
|
|
17
|
+
// const grey10 = "#E7E7E7"
|
|
18
|
+
var grey10 = '#0000001A';
|
|
19
|
+
var grey20 = '#00000033';
|
|
20
|
+
var grey30 = '#0000004D';
|
|
21
|
+
var grey40 = '#00000066';
|
|
22
|
+
var grey50 = '#00000080';
|
|
23
|
+
var grey60 = '#00000099';
|
|
24
|
+
var grey70 = '#000000B3';
|
|
25
|
+
var grey80 = '#000000CC';
|
|
26
|
+
var grey90 = '#000000E6';
|
|
27
|
+
var black = '#000000';
|
|
18
28
|
var white = "#ffffff";
|
|
19
|
-
|
|
20
|
-
var
|
|
29
|
+
// const green = "#159300";
|
|
30
|
+
var error = "#C41717";
|
|
31
|
+
var success = "#53AC00";
|
|
32
|
+
var hintHover = "#F4E8C3";
|
|
33
|
+
var hint = "#B77222";
|
|
21
34
|
exports.colors = {
|
|
22
35
|
primary: primary,
|
|
23
36
|
secondary: secondary,
|
|
@@ -30,10 +43,19 @@ exports.colors = {
|
|
|
30
43
|
onTertiary: onTertiary,
|
|
31
44
|
surfaceContainer: surfaceContainer,
|
|
32
45
|
surfaceContainerLow: surfaceContainerLow,
|
|
33
|
-
grey80: grey80,
|
|
34
|
-
grey40: grey40,
|
|
35
46
|
grey10: grey10,
|
|
47
|
+
grey20: grey20,
|
|
48
|
+
grey30: grey30,
|
|
49
|
+
grey40: grey40,
|
|
50
|
+
grey50: grey50,
|
|
51
|
+
grey60: grey60,
|
|
52
|
+
grey70: grey70,
|
|
53
|
+
grey80: grey80,
|
|
54
|
+
grey90: grey90,
|
|
55
|
+
black: black,
|
|
36
56
|
white: white,
|
|
37
|
-
|
|
38
|
-
|
|
57
|
+
success: success,
|
|
58
|
+
error: error,
|
|
59
|
+
hintHover: hintHover,
|
|
60
|
+
hint: hint
|
|
39
61
|
};
|
|
@@ -9,6 +9,6 @@ var styled_components_1 = require("styled-components");
|
|
|
9
9
|
var colors_1 = require("./colors");
|
|
10
10
|
exports.globalInputHeight = '36px';
|
|
11
11
|
exports.globalInputElemPadding_v2 = (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: 0 10px;\n"], ["\n padding: 0 10px;\n"])));
|
|
12
|
-
exports.globalInputElemHover_v2 = (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n &:hover {\n &::before{\n border: 1.5px solid ", ";\n box-shadow: 0 4px 10px #00000012
|
|
12
|
+
exports.globalInputElemHover_v2 = (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n &:hover {\n &::before{\n border: 1.5px solid ", ";\n /* box-shadow: 0 4px 10px #00000012; */\n }\n }\n"], ["\n &:hover {\n &::before{\n border: 1.5px solid ", ";\n /* box-shadow: 0 4px 10px #00000012; */\n }\n }\n"])), colors_1.colors.grey30);
|
|
13
13
|
exports.globalInputElemFocused_v2 = (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n&:focus-within {\n &::before{\n border: 1.5px solid ", ";\n box-shadow: 0 4px 10px #00000012;\n }\n }\n"], ["\n&:focus-within {\n &::before{\n border: 1.5px solid ", ";\n box-shadow: 0 4px 10px #00000012;\n }\n }\n"])), colors_1.colors.grey80);
|
|
14
14
|
var templateObject_1, templateObject_2, templateObject_3;
|
package/package.json
CHANGED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
declare namespace _default {
|
|
2
|
-
let title: string;
|
|
3
|
-
namespace argTypes {
|
|
4
|
-
namespace label {
|
|
5
|
-
let name: string;
|
|
6
|
-
}
|
|
7
|
-
namespace sublabel {
|
|
8
|
-
let name_1: string;
|
|
9
|
-
export { name_1 as name };
|
|
10
|
-
}
|
|
11
|
-
namespace showHints {
|
|
12
|
-
let name_2: string;
|
|
13
|
-
export { name_2 as name };
|
|
14
|
-
}
|
|
15
|
-
namespace hintsTitle {
|
|
16
|
-
let name_3: string;
|
|
17
|
-
export { name_3 as name };
|
|
18
|
-
}
|
|
19
|
-
namespace hintsBtnLabel {
|
|
20
|
-
let name_4: string;
|
|
21
|
-
export { name_4 as name };
|
|
22
|
-
}
|
|
23
|
-
namespace infoTooltip {
|
|
24
|
-
let name_5: string;
|
|
25
|
-
export { name_5 as name };
|
|
26
|
-
}
|
|
27
|
-
namespace errorMessage {
|
|
28
|
-
let name_6: string;
|
|
29
|
-
export { name_6 as name };
|
|
30
|
-
}
|
|
31
|
-
namespace isRequired {
|
|
32
|
-
let name_7: string;
|
|
33
|
-
export { name_7 as name };
|
|
34
|
-
}
|
|
35
|
-
namespace readOnly {
|
|
36
|
-
let name_8: string;
|
|
37
|
-
export { name_8 as name };
|
|
38
|
-
}
|
|
39
|
-
namespace invert {
|
|
40
|
-
let name_9: string;
|
|
41
|
-
export { name_9 as name };
|
|
42
|
-
}
|
|
43
|
-
let inputOnlyLabel: {};
|
|
44
|
-
}
|
|
45
|
-
namespace args {
|
|
46
|
-
let label_1: string;
|
|
47
|
-
export { label_1 as label };
|
|
48
|
-
let sublabel_1: string;
|
|
49
|
-
export { sublabel_1 as sublabel };
|
|
50
|
-
let showHints_1: boolean;
|
|
51
|
-
export { showHints_1 as showHints };
|
|
52
|
-
let hintsTitle_1: string;
|
|
53
|
-
export { hintsTitle_1 as hintsTitle };
|
|
54
|
-
let hintsBtnLabel_1: string;
|
|
55
|
-
export { hintsBtnLabel_1 as hintsBtnLabel };
|
|
56
|
-
let infoTooltip_1: string;
|
|
57
|
-
export { infoTooltip_1 as infoTooltip };
|
|
58
|
-
let errorMessage_1: string;
|
|
59
|
-
export { errorMessage_1 as errorMessage };
|
|
60
|
-
let isRequired_1: boolean;
|
|
61
|
-
export { isRequired_1 as isRequired };
|
|
62
|
-
let invert_1: boolean;
|
|
63
|
-
export { invert_1 as invert };
|
|
64
|
-
let readOnly_1: boolean;
|
|
65
|
-
export { readOnly_1 as readOnly };
|
|
66
|
-
let inputOnlyLabel_1: string;
|
|
67
|
-
export { inputOnlyLabel_1 as inputOnlyLabel };
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
export default _default;
|
|
71
|
-
export function Block_Label(args: any): import("react").JSX.Element;
|
|
@@ -1,106 +0,0 @@
|
|
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.Block_Label = void 0;
|
|
15
|
-
var BlockLabel_1 = require("../../../components/BlockLabel");
|
|
16
|
-
var themes_1 = require("../../../themes");
|
|
17
|
-
exports.default = {
|
|
18
|
-
title: "Oolib V 2.0/Components/BlockLabel",
|
|
19
|
-
argTypes: {
|
|
20
|
-
label: {
|
|
21
|
-
name: "Label",
|
|
22
|
-
},
|
|
23
|
-
sublabel: {
|
|
24
|
-
name: "Sub Label",
|
|
25
|
-
},
|
|
26
|
-
showHints: {
|
|
27
|
-
name: "Hints",
|
|
28
|
-
},
|
|
29
|
-
hintsTitle: {
|
|
30
|
-
name: "Hints Title",
|
|
31
|
-
},
|
|
32
|
-
hintsBtnLabel: {
|
|
33
|
-
name: "Hints button text",
|
|
34
|
-
},
|
|
35
|
-
// hintsSubtitle: {
|
|
36
|
-
// name: "Hints Subtitle",
|
|
37
|
-
// },
|
|
38
|
-
infoTooltip: {
|
|
39
|
-
name: "Info Tooltip",
|
|
40
|
-
},
|
|
41
|
-
errorMessage: {
|
|
42
|
-
name: "Error Message",
|
|
43
|
-
},
|
|
44
|
-
isRequired: {
|
|
45
|
-
name: "Required",
|
|
46
|
-
},
|
|
47
|
-
readOnly: {
|
|
48
|
-
name: "Read Only",
|
|
49
|
-
},
|
|
50
|
-
invert: {
|
|
51
|
-
name: "Invert",
|
|
52
|
-
},
|
|
53
|
-
inputOnlyLabel: {},
|
|
54
|
-
},
|
|
55
|
-
args: {
|
|
56
|
-
label: "default label",
|
|
57
|
-
sublabel: "",
|
|
58
|
-
showHints: true,
|
|
59
|
-
hintsTitle: "Hints",
|
|
60
|
-
hintsBtnLabel: "Hints",
|
|
61
|
-
// hintsSubtitle: "",
|
|
62
|
-
infoTooltip: "",
|
|
63
|
-
errorMessage: "", //gets converted into the appropriate errorMsgs prop below
|
|
64
|
-
isRequired: false,
|
|
65
|
-
invert: false,
|
|
66
|
-
readOnly: false,
|
|
67
|
-
inputOnlyLabel: "Shows only if label is not defined. AND readOnly = true",
|
|
68
|
-
},
|
|
69
|
-
};
|
|
70
|
-
var dummyData1 = [
|
|
71
|
-
"आप इस व्यक्ति को कैसे जानते हैं?",
|
|
72
|
-
"वे कहाँ रहते हैं?",
|
|
73
|
-
"क्या आप हमें इस व्यक्ति के बारे में कोई एक छोटी सी घटना बता सकते हैं? इस से पाठक को इस व्यक्ति को समझने मे आसानी होगी।",
|
|
74
|
-
"आपकी इस व्यक्ति से पहचान कैसे हुई?",
|
|
75
|
-
];
|
|
76
|
-
var dummyData2 = [
|
|
77
|
-
"What do you want to write about this person?",
|
|
78
|
-
"What did this person do?",
|
|
79
|
-
"Why are you writing this story? What should we learn from it?",
|
|
80
|
-
"What do you want to write about this person?",
|
|
81
|
-
"What did this person do?",
|
|
82
|
-
"Why are you writing this story? What should we learn from it?",
|
|
83
|
-
"What do you want to write about this person?",
|
|
84
|
-
"What did this person do?",
|
|
85
|
-
"Why are you writing this story? What should we learn from it?",
|
|
86
|
-
"What do you want to write about this person?",
|
|
87
|
-
];
|
|
88
|
-
var Block_Label = function (args) {
|
|
89
|
-
// return () => {
|
|
90
|
-
// document.getElementsByTagName("body")[0].removeChild(hintsRootElem);
|
|
91
|
-
// };
|
|
92
|
-
var errorMsgs = args.errorMessage ? args.errorMessage.split(",") : undefined;
|
|
93
|
-
return (React.createElement("div", null,
|
|
94
|
-
React.createElement("div", { style: {
|
|
95
|
-
display: "flex",
|
|
96
|
-
justifyContent: "space-between",
|
|
97
|
-
position: "relative",
|
|
98
|
-
padding: "2rem",
|
|
99
|
-
backgroundColor: args.invert ? themes_1.colors.greyColor100 : "",
|
|
100
|
-
} },
|
|
101
|
-
React.createElement("div", { style: {
|
|
102
|
-
backgroundColor: args.invert ? themes_1.colors.greyColor100 : "",
|
|
103
|
-
padding: "10px",
|
|
104
|
-
} }, (React.createElement(BlockLabel_1.BlockLabel, __assign({ id: "hints_1", hints: args.showHints ? dummyData2 : "" }, args, { errorMsgs: errorMsgs }))) || "no label provided"))));
|
|
105
|
-
};
|
|
106
|
-
exports.Block_Label = Block_Label;
|