oolib 2.19.5 → 2.20.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/ActionMenu/index.d.ts +2 -1
- package/dist/components/ActionMenu/index.js +12 -4
- package/dist/components/ActionMenu/styled.js +1 -1
- package/dist/components/Buttons/index.js +28 -2
- package/dist/components/CheckInput/index.d.ts +1 -0
- package/dist/components/CheckInput/index.js +27 -0
- package/dist/components/PercentCompletedPie/index.d.ts +5 -0
- package/dist/components/{PercentCompletedPi → PercentCompletedPie}/index.js +4 -4
- package/dist/components/{PercentCompletedPi → PercentCompletedPie}/styled.d.ts +0 -0
- package/dist/components/{PercentCompletedPi → PercentCompletedPie}/styled.js +3 -3
- package/dist/components/RadioInput/comps/RadioOption/index.d.ts +8 -0
- package/dist/components/RadioInput/comps/RadioOption/index.js +40 -0
- package/dist/components/RadioInput/comps/RadioOption/styled.d.ts +4 -0
- package/dist/components/RadioInput/comps/RadioOption/styled.js +56 -0
- package/dist/components/RadioInput/comps/RadioOption/utils.d.ts +4 -0
- package/dist/components/RadioInput/comps/RadioOption/utils.js +14 -0
- package/dist/components/RadioInput/comps/index.d.ts +1 -0
- package/dist/components/RadioInput/comps/index.js +5 -0
- package/dist/components/RadioInput/index.d.ts +1 -0
- package/dist/components/RadioInput/index.js +52 -0
- package/dist/components/RadioInput/styled.d.ts +1 -0
- package/dist/components/RadioInput/styled.js +37 -0
- package/dist/components/RadioInput/utils.d.ts +6 -0
- package/dist/components/RadioInput/utils.js +20 -0
- package/dist/components/TabBar/index.js +5 -3
- package/dist/components/TabBar/index.styled.js +6 -3
- package/dist/components/ToggleButton/index.js +3 -4
- package/dist/components/ToggleButton/styled.d.ts +1 -0
- package/dist/components/ToggleButton/styled.js +11 -3
- package/dist/icons/index.d.ts +24 -16
- package/dist/icons/index.js +12 -8
- package/dist/index.d.ts +3 -1
- package/dist/index.js +7 -3
- package/package.json +1 -1
- package/dist/components/PercentCompletedPi/index.d.ts +0 -5
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export function ActionMenu({ icon, invert, actions, align, iconSize, ButtonComp: _ButtonComp }: {
|
|
1
|
+
export function ActionMenu({ icon, invert, actions, align, iconSize, ButtonComp: _ButtonComp, setShowActions: setShowActionsInParent }: {
|
|
2
2
|
icon?: string;
|
|
3
3
|
invert: any;
|
|
4
4
|
actions: any;
|
|
5
5
|
align?: string;
|
|
6
6
|
iconSize?: string;
|
|
7
7
|
ButtonComp?: string;
|
|
8
|
+
setShowActions: any;
|
|
8
9
|
}): JSX.Element;
|
|
@@ -38,12 +38,13 @@ exports.ActionMenu = void 0;
|
|
|
38
38
|
var react_1 = __importStar(require("react"));
|
|
39
39
|
var ButtonComps = __importStar(require("../Buttons"));
|
|
40
40
|
var Typo_1 = require("../Typo");
|
|
41
|
+
var icons_1 = require("../../icons");
|
|
41
42
|
var utils_1 = require("./utils");
|
|
42
43
|
var styled_1 = require("./styled");
|
|
43
44
|
var ActionMenu = function (_a) {
|
|
44
45
|
var _b, _c;
|
|
45
46
|
var _d = _a.icon, icon = _d === void 0 ? 'DotsThree' : _d, //most likely will never change
|
|
46
|
-
invert = _a.invert, actions = _a.actions, _e = _a.align, align = _e === void 0 ? 'right' : _e, _f = _a.iconSize, iconSize = _f === void 0 ? 'S' : _f, _g = _a.ButtonComp, _ButtonComp = _g === void 0 ? 'ButtonGhost' : _g;
|
|
47
|
+
invert = _a.invert, actions = _a.actions, _e = _a.align, align = _e === void 0 ? 'right' : _e, _f = _a.iconSize, iconSize = _f === void 0 ? 'S' : _f, _g = _a.ButtonComp, _ButtonComp = _g === void 0 ? 'ButtonGhost' : _g, setShowActionsInParent = _a.setShowActions;
|
|
47
48
|
var actionMenuRef = (0, react_1.useRef)(null);
|
|
48
49
|
var optionsWrapperRef = (0, react_1.useRef)(null);
|
|
49
50
|
var _h = (0, react_1.useState)(false), showActions = _h[0], setShowActions = _h[1];
|
|
@@ -52,9 +53,15 @@ var ActionMenu = function (_a) {
|
|
|
52
53
|
return null;
|
|
53
54
|
var getOpsRect = function () { var _a; return (_a = optionsWrapperRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect(); };
|
|
54
55
|
var ButtonComp = ButtonComps[_ButtonComp];
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
var genOptionIcon = function (iconName) {
|
|
57
|
+
var IconComp = icons_1.icons[iconName];
|
|
58
|
+
return react_1.default.createElement(IconComp, { size: 16 });
|
|
59
|
+
};
|
|
60
|
+
(0, react_1.useEffect)(function () {
|
|
61
|
+
setShowActionsInParent && setShowActionsInParent(showActions);
|
|
62
|
+
}, [showActions]);
|
|
63
|
+
return (react_1.default.createElement(styled_1.StyledActionMenu, { onClick: function () { return console.log('i can hear this'); }, ref: actionMenuRef },
|
|
64
|
+
react_1.default.createElement(ButtonComp, { icon: icon, iconSize: iconSize, invert: invert, stopPropagation: true, onClick: function (e) {
|
|
58
65
|
setShowActions(!showActions);
|
|
59
66
|
}, active: showActions }),
|
|
60
67
|
react_1.default.createElement(styled_1.StyledActionsDropMenu, __assign({}, {
|
|
@@ -69,6 +76,7 @@ var ActionMenu = function (_a) {
|
|
|
69
76
|
action.onClick && action.onClick(ev);
|
|
70
77
|
setShowActions(false);
|
|
71
78
|
}, key: action.display, invert: invert }),
|
|
79
|
+
action.icon && genOptionIcon(action.icon),
|
|
72
80
|
react_1.default.createElement(Typo_1.SANS_2, null, action.display)));
|
|
73
81
|
})))));
|
|
74
82
|
};
|
|
@@ -74,7 +74,7 @@ exports.StyledOptionsWrapper = styled_components_1.default.div(templateObject_9
|
|
|
74
74
|
var invert = _a.invert;
|
|
75
75
|
return (invert ? greyColor80 : white);
|
|
76
76
|
});
|
|
77
|
-
exports.StyledOption = styled_components_1.default.button(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n white-space: nowrap;\n border: none;\n cursor: pointer;\n width: 100%;\n text-align: left;\n padding: 0.25rem 1.2rem;\n background-color: transparent;\n color: ", ";\n ", ";\n &:hover {\n background-color: ", ";\n }\n"], ["\n white-space: nowrap;\n border: none;\n cursor: pointer;\n width: 100%;\n text-align: left;\n padding: 0.25rem 1.2rem;\n background-color: transparent;\n color: ", ";\n ", ";\n &:hover {\n background-color: ", ";\n }\n"])), function (_a) {
|
|
77
|
+
exports.StyledOption = styled_components_1.default.button(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n white-space: nowrap;\n border: none;\n cursor: pointer;\n width: 100%;\n display: flex;\n align-items: center;\n gap: 0.5rem;\n text-align: left;\n padding: 0.25rem 1.2rem;\n background-color: transparent;\n color: ", ";\n ", ";\n &:hover {\n background-color: ", ";\n }\n"], ["\n white-space: nowrap;\n border: none;\n cursor: pointer;\n width: 100%;\n display: flex;\n align-items: center;\n gap: 0.5rem;\n text-align: left;\n padding: 0.25rem 1.2rem;\n background-color: transparent;\n color: ", ";\n ", ";\n &:hover {\n background-color: ", ";\n }\n"])), function (_a) {
|
|
78
78
|
var invert = _a.invert;
|
|
79
79
|
return (invert ? white : greyColor100);
|
|
80
80
|
}, (0, mixins_1.transition)("background-color"), function (_a) {
|
|
@@ -48,7 +48,27 @@ var DisplayIcon = function (_a) {
|
|
|
48
48
|
};
|
|
49
49
|
var ButtonStyledWrapper = function (_a) {
|
|
50
50
|
var props = _a.props, variant = _a.variant;
|
|
51
|
-
var id = props.id, link = props.link, children = props.children, value = props.value, submit = props.submit, icon = props.icon, iconAfter = props.iconAfter, onClick = props.onClick, onMouseDown = props.onMouseDown, active = props.active, disabled = props.disabled, invert = props.invert, theme = props.theme, width = props.width, onMouseEnter = props.onMouseEnter, onMouseLeave = props.onMouseLeave, color = props.color, style = props.style, className = props.className, S = props.S, M = props.M, iconSize = props.iconSize;
|
|
51
|
+
var id = props.id, link = props.link, children = props.children, value = props.value, submit = props.submit, icon = props.icon, iconAfter = props.iconAfter, onClick = props.onClick, onMouseDown = props.onMouseDown, active = props.active, disabled = props.disabled, invert = props.invert, theme = props.theme, width = props.width, onMouseEnter = props.onMouseEnter, onMouseLeave = props.onMouseLeave, color = props.color, style = props.style, className = props.className, S = props.S, M = props.M, iconSize = props.iconSize, stopPropagation = props.stopPropagation;
|
|
52
|
+
/**
|
|
53
|
+
* WHY WE ARE HAVING TO DO STOP PROPAGATION IN THIS TWISTED WAY:
|
|
54
|
+
*
|
|
55
|
+
* We have debounced our mousedown and click events
|
|
56
|
+
* Why debounce? Cuz sometimes users end up double clicking buttons
|
|
57
|
+
* by mistake and end up firing parallel api calls, which leads to all
|
|
58
|
+
* sorts of duplication issues. Hence debounce.
|
|
59
|
+
*
|
|
60
|
+
* Now the problem with debounce is that, it doesnt allow this to work:
|
|
61
|
+
* <Button onClick={e => e.stopPropagation()}/>
|
|
62
|
+
* Funny thing is if you wrap the button in a div, and apply stopPropagation
|
|
63
|
+
* to that div, then it works, but that is a bit messy.
|
|
64
|
+
*
|
|
65
|
+
* Which means, e.stopPropagation has to be done before the debounce,
|
|
66
|
+
* which would have to be done inside the Button Component.
|
|
67
|
+
* Hence the boolean prop stopPropagation which controls this.
|
|
68
|
+
*
|
|
69
|
+
* We dont default to stopPropagation = true, cuz we are unsure
|
|
70
|
+
* of what other sideeffects it might have on the codebase
|
|
71
|
+
*/
|
|
52
72
|
var displayText = (link === null || link === void 0 ? void 0 : link.displayText) || children || value;
|
|
53
73
|
var debouncedOnClick = onClick && (0, lodash_1.debounce)(onClick, 200);
|
|
54
74
|
var debouncedMouseDown = onMouseDown && (0, lodash_1.debounce)(onMouseDown, 150);
|
|
@@ -69,7 +89,13 @@ var ButtonStyledWrapper = function (_a) {
|
|
|
69
89
|
var thisSize = iconSize || size;
|
|
70
90
|
return thisSize === 'S' ? 15 : 20;
|
|
71
91
|
};
|
|
72
|
-
return (react_1.default.createElement(index_styled_1.ButtonStyled, { id: id, style: style, className: className, variant: variant, size: size, active: active, invert: invert, disabled: disabled, theme: theme, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, type: submit ? "submit" : "button", onClick:
|
|
92
|
+
return (react_1.default.createElement(index_styled_1.ButtonStyled, { id: id, style: style, className: className, variant: variant, size: size, active: active, invert: invert, disabled: disabled, theme: theme, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, type: submit ? "submit" : "button", onClick: function (e) {
|
|
93
|
+
stopPropagation && e.stopPropagation();
|
|
94
|
+
debouncedOnClick && debouncedOnClick(e);
|
|
95
|
+
}, onMouseDown: function (e) {
|
|
96
|
+
stopPropagation && e.stopPropagation();
|
|
97
|
+
debouncedMouseDown && debouncedMouseDown(e);
|
|
98
|
+
}, composition: composition, width: width, color: color },
|
|
73
99
|
icon && react_1.default.createElement(DisplayIcon, { icon: icon, size: calcIconSize() }),
|
|
74
100
|
displayText && react_1.default.createElement(Typo_1.SANS_3, { semibold: true }, displayText),
|
|
75
101
|
iconAfter && react_1.default.createElement(DisplayIcon, { icon: iconAfter, size: calcIconSize() })));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function CheckInput(props: any): JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
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.CheckInput = void 0;
|
|
18
|
+
var react_1 = __importDefault(require("react"));
|
|
19
|
+
var BlockLabel_1 = require("../BlockLabel");
|
|
20
|
+
var _EXPORTS_1 = require("../../utils/_EXPORTS");
|
|
21
|
+
var CheckInput = function (props) {
|
|
22
|
+
var id = props.id, injectOtherOption = props.injectOtherOption, value = props.value, onChange = props.onChange, commonIsCorrectDesc = props.commonIsCorrectDesc, options = props.options, optionGroups = props.optionGroups, optionStyle = props.optionStyle, markResult = props.markResult, passChangeHandlerOps = props.passChangeHandlerOps, listType = props.listType, style = props.style, className = props.className, readOnly = props.readOnly;
|
|
23
|
+
return (react_1.default.createElement("div", { className: className, id: id },
|
|
24
|
+
react_1.default.createElement(BlockLabel_1.BlockLabel, __assign({}, (0, _EXPORTS_1.getBlockLabelProps)(props))),
|
|
25
|
+
react_1.default.createElement("input", { type: "checkbox" })));
|
|
26
|
+
};
|
|
27
|
+
exports.CheckInput = CheckInput;
|
|
@@ -3,12 +3,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.PercentCompletedPie = void 0;
|
|
7
7
|
var react_1 = __importDefault(require("react"));
|
|
8
8
|
var Typo_1 = require("../Typo");
|
|
9
9
|
var styled_1 = require("./styled");
|
|
10
|
-
function
|
|
11
|
-
var percent = _a.percent, _b = _a.size, size = _b === void 0 ?
|
|
10
|
+
function PercentCompletedPie(_a) {
|
|
11
|
+
var percent = _a.percent, _b = _a.size, size = _b === void 0 ? 24 : _b, label = _a.label;
|
|
12
12
|
var perUnit = 1.8;
|
|
13
13
|
var transform = "rotate(".concat(parseInt(percent) * perUnit, "deg)");
|
|
14
14
|
return (react_1.default.createElement(styled_1.StyledContainer, null,
|
|
@@ -21,4 +21,4 @@ function PercentCompletedPi(_a) {
|
|
|
21
21
|
react_1.default.createElement(styled_1.StyledFill, { size: size, transform: transform, className: "fill fix" })))),
|
|
22
22
|
(label === null || label === void 0 ? void 0 : label.show) && react_1.default.createElement(Typo_1.LABEL, null, "".concat(percent).concat(label.suffix || ''))));
|
|
23
23
|
}
|
|
24
|
-
exports.
|
|
24
|
+
exports.PercentCompletedPie = PercentCompletedPie;
|
|
File without changes
|
|
@@ -13,7 +13,7 @@ var utilsOolib_1 = require("../../utilsOolib");
|
|
|
13
13
|
exports.StyledContainer = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n gap: 1rem;\n align-items: center;\n"], ["\n display: flex;\n gap: 1rem;\n align-items: center;\n"])));
|
|
14
14
|
exports.StyledWrapper = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n border-radius: 50%;\n ", "\n background-color: ", ";\n"], ["\n border-radius: 50%;\n ", "\n background-color: ", ";\n"])), function (_a) {
|
|
15
15
|
var size = _a.size;
|
|
16
|
-
return "\n width: ".concat(size, ";\n height: ").concat(size, "; \n ");
|
|
16
|
+
return "\n width: ".concat(size, "px;\n height: ").concat(size, "px; \n ");
|
|
17
17
|
}, function (_a) {
|
|
18
18
|
var theme = _a.theme;
|
|
19
19
|
return (0, utilsOolib_1.getPrimaryColor40)(theme.colors);
|
|
@@ -21,11 +21,11 @@ exports.StyledWrapper = styled_components_1.default.div(templateObject_2 || (tem
|
|
|
21
21
|
exports.StyledCircle = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: relative;\n"], ["\n position: relative;\n"])));
|
|
22
22
|
exports.StyledMask = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n ", "\n position: absolute;\n border-radius: 50%;\n \n"], ["\n ", "\n position: absolute;\n border-radius: 50%;\n \n"])), function (_a) {
|
|
23
23
|
var size = _a.size, transform = _a.transform;
|
|
24
|
-
return "\n ".concat(transform ? "transform: ".concat(transform) : '', ";\n width: ").concat(size, ";\n height: ").concat(size, "; \n clip: rect(0px, ").concat(size, ", ").concat(size, ", ").concat((parseFloat(size
|
|
24
|
+
return "\n ".concat(transform ? "transform: ".concat(transform) : '', ";\n width: ").concat(size, "px;\n height: ").concat(size, "px; \n clip: rect(0px, ").concat(size, "px, ").concat(size, "px, ").concat((parseFloat(size) / 2) + 'px', ");\n ");
|
|
25
25
|
});
|
|
26
26
|
exports.StyledFill = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n ", "\n border-radius: 50%;\n position: absolute;\n background-color: ", ";\n"], ["\n ", "\n border-radius: 50%;\n position: absolute;\n background-color: ", ";\n"])), function (_a) {
|
|
27
27
|
var size = _a.size, transform = _a.transform;
|
|
28
|
-
return "\n transform: ".concat(transform, ";\n width: ").concat(size, ";\n height: ").concat(size, "; \n clip: rect(0px, ").concat((parseFloat(size
|
|
28
|
+
return "\n transform: ".concat(transform, ";\n width: ").concat(size, "px;\n height: ").concat(size, "px; \n clip: rect(0px, ").concat((parseFloat(size) / 2) + 'px', ", ").concat(size, "px, 0px);\n ");
|
|
29
29
|
}, function (_a) {
|
|
30
30
|
var theme = _a.theme;
|
|
31
31
|
return (0, utilsOolib_1.getPrimaryColor100)(theme.colors);
|
|
@@ -0,0 +1,40 @@
|
|
|
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.RadioOption = void 0;
|
|
7
|
+
var react_1 = __importDefault(require("react"));
|
|
8
|
+
var themes_1 = require("../../../../themes");
|
|
9
|
+
var icons_1 = require("../../../../icons");
|
|
10
|
+
var Typo_1 = require("../../../Typo");
|
|
11
|
+
var utils_js_1 = require("./utils.js");
|
|
12
|
+
var styled_1 = require("./styled");
|
|
13
|
+
var green = themes_1.colors.green, red = themes_1.colors.red;
|
|
14
|
+
var XCircle = icons_1.icons.XCircle, CheckCircle = icons_1.icons.CheckCircle;
|
|
15
|
+
var RadioOption = function (_a) {
|
|
16
|
+
var id = _a.id, option = _a.option, onChange = _a.onChange, value = _a.value, optionStyle = _a.optionStyle, markResult = _a.markResult;
|
|
17
|
+
var isSelected = option.value === (value === null || value === void 0 ? void 0 : value.value);
|
|
18
|
+
var markingCommand = (0, utils_js_1.getMarkingCommand)({ option: option, isSelected: isSelected });
|
|
19
|
+
return (react_1.default.createElement("div", null,
|
|
20
|
+
react_1.default.createElement(styled_1.StyledOption, { markResult: markResult, style: optionStyle, isSelected: isSelected, onClick: function () { return !markResult && onChange && onChange(id, option); } },
|
|
21
|
+
!markResult || markingCommand === undefined ?
|
|
22
|
+
react_1.default.createElement(styled_1.StyledRadioInput, { isSelected: isSelected, className: 'radioBtn' }, isSelected && react_1.default.createElement(styled_1.StyledRadioInputFill, null))
|
|
23
|
+
:
|
|
24
|
+
["markCorrect", "revealCorrect"].includes(markingCommand) ?
|
|
25
|
+
react_1.default.createElement(CheckCircle, { size: 25, color: green, style: { marginLeft: '-2.25px' } })
|
|
26
|
+
: // then wrong
|
|
27
|
+
react_1.default.createElement(XCircle, { size: 25, color: red, style: { marginLeft: '-2.25px' } }),
|
|
28
|
+
react_1.default.createElement(Typo_1.SANS_3, { bold: markResult && isSelected },
|
|
29
|
+
" ",
|
|
30
|
+
option.display,
|
|
31
|
+
" ")),
|
|
32
|
+
/*
|
|
33
|
+
the minute the results have come in, irrespective of user's answer
|
|
34
|
+
being right or wrong, we always show an explanation
|
|
35
|
+
against the right answer. provided an explanation is provided.
|
|
36
|
+
*/
|
|
37
|
+
option.isCorrect && markResult && option.isCorrectDesc &&
|
|
38
|
+
react_1.default.createElement(styled_1.StyledCorrectMessage, null, option.isCorrectDesc)));
|
|
39
|
+
};
|
|
40
|
+
exports.RadioOption = RadioOption;
|
|
@@ -0,0 +1,56 @@
|
|
|
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.StyledCorrectMessage = exports.StyledRadioInputFill = exports.StyledRadioInput = exports.StyledOption = void 0;
|
|
31
|
+
var styled_components_1 = __importStar(require("styled-components"));
|
|
32
|
+
var themes_1 = require("../../../../themes");
|
|
33
|
+
var mixins_1 = require("../../../../themes/mixins");
|
|
34
|
+
var utilsOolib_1 = require("../../../../utilsOolib");
|
|
35
|
+
var Typo_1 = require("../../../Typo");
|
|
36
|
+
var none = themes_1.colors.none, white = themes_1.colors.white, green = themes_1.colors.green;
|
|
37
|
+
exports.StyledOption = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n gap: 1rem;\n position: relative;\n cursor: ", ";\n \n\n &:hover .radioBtn {\n ", "\n }\n\n"], ["\n display: flex;\n align-items: center;\n gap: 1rem;\n position: relative;\n cursor: ", ";\n \n\n &:hover .radioBtn {\n ", "\n }\n\n"])), function (_a) {
|
|
38
|
+
var markResult = _a.markResult;
|
|
39
|
+
return markResult ? 'initial' : 'pointer';
|
|
40
|
+
}, function (_a) {
|
|
41
|
+
var isSelected = _a.isSelected, theme = _a.theme;
|
|
42
|
+
return !isSelected && (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background: ", ";\n "], ["\n background: ", ";\n "])), (0, utilsOolib_1.getPrimaryColor10)(theme.colors));
|
|
43
|
+
});
|
|
44
|
+
exports.StyledRadioInput = styled_components_1.default.button(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n border-radius: 50%;\n width: 2rem;\n height: 2rem;\n border: 2px solid ", ";\n background-color: ", ";\n flex: 0 0 auto;\n ", "\n\n ", "\n\n"], ["\n border-radius: 50%;\n width: 2rem;\n height: 2rem;\n border: 2px solid ", ";\n background-color: ", ";\n flex: 0 0 auto;\n ", "\n\n ", "\n\n"])), function (_a) {
|
|
45
|
+
var theme = _a.theme;
|
|
46
|
+
return (0, utilsOolib_1.getPrimaryColor100)(theme.colors);
|
|
47
|
+
}, none, (0, mixins_1.transition)('backgrund-color', 0.2), function (_a) {
|
|
48
|
+
var isSelected = _a.isSelected;
|
|
49
|
+
return isSelected && (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n background-color:", ";\n display: flex;\n align-items: center;\n justify-content: center;\n "], ["\n background-color:", ";\n display: flex;\n align-items: center;\n justify-content: center;\n "])), function (_a) {
|
|
50
|
+
var theme = _a.theme;
|
|
51
|
+
return (0, utilsOolib_1.getPrimaryColor100)(theme.colors);
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
exports.StyledRadioInputFill = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n height: 0.8rem;\n width: 0.8rem;\n border-radius: 50%;\n background-color: ", ";\n"], ["\n height: 0.8rem;\n width: 0.8rem;\n border-radius: 50%;\n background-color: ", ";\n"])), white);
|
|
55
|
+
exports.StyledCorrectMessage = (0, styled_components_1.default)(Typo_1.SANS_2)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n color: ", ";\n padding-top: 0.5rem;\n padding-left: 3.3rem;\n"], ["\n color: ", ";\n padding-top: 0.5rem;\n padding-left: 3.3rem;\n"])), green);
|
|
56
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getMarkingCommand = void 0;
|
|
4
|
+
var getMarkingCommand = function (_a) {
|
|
5
|
+
var option = _a.option, isSelected = _a.isSelected;
|
|
6
|
+
if (isSelected) {
|
|
7
|
+
return option.isCorrect ? 'markCorrect' : 'markWrong';
|
|
8
|
+
}
|
|
9
|
+
else { //not selected
|
|
10
|
+
if (option.isCorrect)
|
|
11
|
+
return "revealCorrect";
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
exports.getMarkingCommand = getMarkingCommand;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { RadioOption } from "./RadioOption";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RadioOption = void 0;
|
|
4
|
+
var RadioOption_1 = require("./RadioOption");
|
|
5
|
+
Object.defineProperty(exports, "RadioOption", { enumerable: true, get: function () { return RadioOption_1.RadioOption; } });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function RadioInput(props: any): JSX.Element;
|
|
@@ -0,0 +1,52 @@
|
|
|
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.RadioInput = void 0;
|
|
18
|
+
var react_1 = __importDefault(require("react"));
|
|
19
|
+
var BlockLabel_1 = require("../BlockLabel");
|
|
20
|
+
var Tags_1 = require("../Tags");
|
|
21
|
+
var TextInputs_1 = require("../TextInputs");
|
|
22
|
+
var _EXPORTS_1 = require("../../utils/_EXPORTS");
|
|
23
|
+
var utils_js_1 = require("./utils.js");
|
|
24
|
+
var styled_1 = require("./styled");
|
|
25
|
+
var comps_1 = require("./comps");
|
|
26
|
+
var RadioInput = function (props) {
|
|
27
|
+
var id = props.id, injectOtherOption = props.injectOtherOption, value = props.value, onChange = props.onChange, options = props.options, optionStyle = props.optionStyle, markResult = props.markResult, //instead of rightWrongResult
|
|
28
|
+
listType = props.listType, style = props.style, className = props.className, readOnly = props.readOnly;
|
|
29
|
+
var displayedOptions;
|
|
30
|
+
if (options) {
|
|
31
|
+
if (injectOtherOption && !options.includes(function (op) { return op.value === "other"; })) {
|
|
32
|
+
displayedOptions = options.concat({ value: "other", display: "Other" });
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
displayedOptions = options;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return (react_1.default.createElement("div", { className: className, id: id },
|
|
39
|
+
react_1.default.createElement(BlockLabel_1.BlockLabel, __assign({}, (0, _EXPORTS_1.getBlockLabelProps)(props))),
|
|
40
|
+
readOnly ? ((value === null || value === void 0 ? void 0 : value.display) && react_1.default.createElement(Tags_1.TagDisplay, { display: value.display })) : (react_1.default.createElement(react_1.default.Fragment, null,
|
|
41
|
+
react_1.default.createElement(styled_1.StyledOptionsContainer, { listType: listType, style: style }, displayedOptions === null || displayedOptions === void 0 ? void 0 : displayedOptions.map(function (option) { return react_1.default.createElement(comps_1.RadioOption, __assign({}, {
|
|
42
|
+
option: option,
|
|
43
|
+
id: id,
|
|
44
|
+
onChange: onChange,
|
|
45
|
+
value: value,
|
|
46
|
+
optionStyle: optionStyle,
|
|
47
|
+
markResult: markResult,
|
|
48
|
+
key: option.value
|
|
49
|
+
})); })),
|
|
50
|
+
injectOtherOption && (value === null || value === void 0 ? void 0 : value.value) === "other" && (react_1.default.createElement(TextInputs_1.TextInput, { placeholder: "Please Specify Here", value: value.display_desc, onChange: function (k, v) { return onChange && onChange(id, (0, utils_js_1.createNewValue)(v)); } }))))));
|
|
51
|
+
};
|
|
52
|
+
exports.RadioInput = RadioInput;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const StyledOptionsContainer: any;
|
|
@@ -0,0 +1,37 @@
|
|
|
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.StyledOptionsContainer = void 0;
|
|
31
|
+
var styled_components_1 = __importStar(require("styled-components"));
|
|
32
|
+
exports.StyledOptionsContainer = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n gap: 2rem;\n\n ", "\n"], ["\n display: flex;\n flex-wrap: wrap;\n gap: 2rem;\n\n ", "\n"])), function (_a) {
|
|
33
|
+
var listType = _a.listType;
|
|
34
|
+
return listType === 'vertical' ? (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-direction: column;\n gap: 1.5rem;\n "], ["\n flex-direction: column;\n gap: 1.5rem;\n "]))) :
|
|
35
|
+
'';
|
|
36
|
+
});
|
|
37
|
+
var templateObject_1, templateObject_2;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createNewValue = void 0;
|
|
4
|
+
var createNewValue = function (val) {
|
|
5
|
+
value_desc = ( // discuss if we should add the method textToCamelcase to general utils or JS String Class
|
|
6
|
+
val
|
|
7
|
+
.trim()
|
|
8
|
+
.replace(/[,\/]/gi, '')
|
|
9
|
+
.split(' ')
|
|
10
|
+
.filter(Boolean)
|
|
11
|
+
.map(function (word, idx) { return idx === 0 ? word : word[0].toUpperCase() + word.slice(1); })
|
|
12
|
+
.join(""));
|
|
13
|
+
return {
|
|
14
|
+
value: "other",
|
|
15
|
+
display_desc: val,
|
|
16
|
+
value_desc: value_desc,
|
|
17
|
+
display: "Other",
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
exports.createNewValue = createNewValue;
|
|
@@ -19,18 +19,20 @@ var react_1 = __importDefault(require("react"));
|
|
|
19
19
|
var Typo_1 = require("../Typo");
|
|
20
20
|
var index_styled_1 = require("./index.styled");
|
|
21
21
|
var Base = function (_a) {
|
|
22
|
-
var id = _a.id, options = _a.options, valueProp = _a.value, onChange = _a.onChange, style = _a.style, errorTabs = _a.errorTabs, _b = _a.tabBarStyle, tabBarStyle = _b === void 0 ? '1' : _b, saveValueAsString = _a.saveValueAsString
|
|
22
|
+
var id = _a.id, options = _a.options, valueProp = _a.value, onChange = _a.onChange, style = _a.style, errorTabs = _a.errorTabs, _b = _a.tabBarStyle, tabBarStyle = _b === void 0 ? '1' : _b, saveValueAsString = _a.saveValueAsString, M = _a.M, S = _a.S, _size = _a.size //use any one of these 3
|
|
23
|
+
;
|
|
24
|
+
var size = _size || (S ? 'S' : 'M'); //defaults to M
|
|
23
25
|
var value = saveValueAsString ? options.find(function (d) { return d.value === valueProp; }) : valueProp;
|
|
24
26
|
var handleClick = function (v) {
|
|
25
27
|
onChange && onChange(id, saveValueAsString ? v.value : v);
|
|
26
28
|
};
|
|
27
|
-
return (react_1.default.createElement(index_styled_1.TabBarStyled, { style: style },
|
|
29
|
+
return (react_1.default.createElement(index_styled_1.TabBarStyled, { size: size, style: style },
|
|
28
30
|
react_1.default.createElement(index_styled_1.TabBarContainerStyled, { id: id },
|
|
29
31
|
react_1.default.createElement(index_styled_1.TabBarRowStyled, { id: id }, options.map(function (op) {
|
|
30
32
|
var tabHasError = errorTabs && errorTabs.some(function (tab) { return tab.value === op.value; });
|
|
31
33
|
var tabIsActive = value && op.value === value.value;
|
|
32
34
|
return (react_1.default.createElement(index_styled_1.TabBarTabWrapper, { tabBarStyle: tabBarStyle, key: op.value, active: tabIsActive, error: tabHasError },
|
|
33
|
-
react_1.default.createElement(index_styled_1.TabBarTabStyled, { active: tabIsActive, error: tabHasError, tabBarStyle: tabBarStyle, onClick: function () { return handleClick(op); } },
|
|
35
|
+
react_1.default.createElement(index_styled_1.TabBarTabStyled, { size: size, active: tabIsActive, error: tabHasError, tabBarStyle: tabBarStyle, onClick: function () { return handleClick(op); } },
|
|
34
36
|
react_1.default.createElement(Typo_1.SANS_2, { semibold: tabBarStyle === "1" }, op.display))));
|
|
35
37
|
})))));
|
|
36
38
|
};
|
|
@@ -73,16 +73,19 @@ var tabBarTabStyle2 = (0, styled_components_1.css)(templateObject_10 || (templat
|
|
|
73
73
|
// border-top: ${({ top }) => top && `0.1rem solid ${greyColor5}`};
|
|
74
74
|
// border-bottom: ${({ bottom }) => bottom && `0.1rem solid ${greyColor5}`};
|
|
75
75
|
// `;
|
|
76
|
-
exports.TabBarStyled = styled_components_1.default.div(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n background-color: ", ";\n z-index: 1000;\n height:
|
|
76
|
+
exports.TabBarStyled = styled_components_1.default.div(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n background-color: ", ";\n z-index: 1000;\n height: ", ";\n \n"], ["\n background-color: ", ";\n z-index: 1000;\n height: ", ";\n \n"])), white, function (_a) {
|
|
77
|
+
var size = _a.size;
|
|
78
|
+
return size === 'S' ? '3rem' : '4rem';
|
|
79
|
+
});
|
|
77
80
|
exports.TabBarContainerStyled = styled_components_1.default.div(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n width: fit-content;\n height: 100%;\n"], ["\n width: fit-content;\n height: 100%;\n"])));
|
|
78
81
|
exports.TabBarRowStyled = styled_components_1.default.div(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n display: flex;\n height: 100%;\n"], ["\n display: flex;\n height: 100%;\n"])));
|
|
79
|
-
exports.TabBarTabWrapper = styled_components_1.default.div(templateObject_14 || (templateObject_14 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (_a) {
|
|
82
|
+
exports.TabBarTabWrapper = styled_components_1.default.div(templateObject_14 || (templateObject_14 = __makeTemplateObject(["\n ", "\n display: flex;\n align-items: center;\n"], ["\n ", "\n display: flex;\n align-items: center;\n"])), function (_a) {
|
|
80
83
|
var tabBarStyle = _a.tabBarStyle;
|
|
81
84
|
return tabBarStyle === "1"
|
|
82
85
|
? tabBarWrapperStyle1
|
|
83
86
|
: tabBarStyle === "2" && tabBarWrapperStyle2;
|
|
84
87
|
});
|
|
85
|
-
exports.TabBarTabStyled = styled_components_1.default.button(templateObject_15 || (templateObject_15 = __makeTemplateObject(["\n padding: 0
|
|
88
|
+
exports.TabBarTabStyled = styled_components_1.default.button(templateObject_15 || (templateObject_15 = __makeTemplateObject(["\n padding: 0 2rem;\n cursor: pointer;\n color: ", ";\n background-color: ", ";\n\n border: 0;\n :hover {\n background-color: ", ";\n }\n\n ", "\n"], ["\n padding: 0 2rem;\n cursor: pointer;\n color: ", ";\n background-color: ", ";\n\n border: 0;\n :hover {\n background-color: ", ";\n }\n\n ", "\n"])), greyColor100, none, none, function (_a) {
|
|
86
89
|
var tabBarStyle = _a.tabBarStyle;
|
|
87
90
|
return tabBarStyle === "1"
|
|
88
91
|
? tabBarTabStyle1
|
|
@@ -16,7 +16,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.SingleToggleButton = exports.ToggleButton = void 0;
|
|
18
18
|
var react_1 = __importDefault(require("react"));
|
|
19
|
-
var Typo_1 = require("../Typo");
|
|
20
19
|
var BlockLabel_1 = require("../BlockLabel");
|
|
21
20
|
var _EXPORTS_1 = require("../../utils/_EXPORTS");
|
|
22
21
|
var themes_1 = require("../../themes");
|
|
@@ -47,10 +46,10 @@ function ToggleButton(_a) {
|
|
|
47
46
|
return (react_1.default.createElement("div", null,
|
|
48
47
|
react_1.default.createElement(BlockLabel_1.BlockLabel, __assign({}, (0, _EXPORTS_1.getBlockLabelProps)(props))),
|
|
49
48
|
react_1.default.createElement(styled_1.StyledToggleWrraper, null,
|
|
50
|
-
react_1.default.createElement(
|
|
49
|
+
react_1.default.createElement(styled_1.STYLED_LABEL, __assign({}, { lineHeight: 1, color: leftOptionColor, invert: invert }), options[0].display),
|
|
51
50
|
react_1.default.createElement(styled_1.StyledButtonSlider, { invert: invert, disabled: disabled, onClick: handleClick },
|
|
52
51
|
react_1.default.createElement(styled_1.StyledToggleButton, { invert: invert, disabled: disabled, direction: isLeftOptionActive ? "left" : "right" })),
|
|
53
|
-
react_1.default.createElement(
|
|
52
|
+
react_1.default.createElement(styled_1.STYLED_LABEL, __assign({}, { invert: invert, color: rightOptionColor, lineHeight: 1 }), options[1].display))));
|
|
54
53
|
}
|
|
55
54
|
exports.ToggleButton = ToggleButton;
|
|
56
55
|
function SingleToggleButton(_a) {
|
|
@@ -70,6 +69,6 @@ function SingleToggleButton(_a) {
|
|
|
70
69
|
react_1.default.createElement(styled_1.StyledToggleWrraper, null,
|
|
71
70
|
react_1.default.createElement(styled_1.StyledButtonSlider, { inactive: isInactive, disabled: disabled, invert: invert, onClick: handleClick },
|
|
72
71
|
react_1.default.createElement(styled_1.StyledToggleButton, { direction: isInactive ? "left" : "right", inactive: isInactive, disabled: disabled, invert: invert })),
|
|
73
|
-
react_1.default.createElement(
|
|
72
|
+
react_1.default.createElement(styled_1.STYLED_LABEL, __assign({}, { invert: invert, color: labelColor, lineHeight: 1 }), option.display))));
|
|
74
73
|
}
|
|
75
74
|
exports.SingleToggleButton = SingleToggleButton;
|
|
@@ -7,11 +7,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
7
7
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
8
|
};
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.StyledToggleButton = exports.StyledButtonSlider = exports.StyledToggleWrraper = void 0;
|
|
10
|
+
exports.STYLED_LABEL = exports.StyledToggleButton = exports.StyledButtonSlider = exports.StyledToggleWrraper = void 0;
|
|
11
11
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
12
12
|
var mixins_1 = require("../../themes/mixins");
|
|
13
13
|
var utilsOolib_1 = require("../../utilsOolib");
|
|
14
14
|
var themes_1 = require("../../themes");
|
|
15
|
+
var Typo_1 = require("../Typo");
|
|
15
16
|
var white = themes_1.colors.white, greyColor10 = themes_1.colors.greyColor10, greyColor80 = themes_1.colors.greyColor80, greyColor70 = themes_1.colors.greyColor70, greyColor100 = themes_1.colors.greyColor100, greyColor40 = themes_1.colors.greyColor40;
|
|
16
17
|
exports.StyledToggleWrraper = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n /* justify-content: center; */\n align-items: center;\n gap: 1rem;\n"], ["\n display: flex;\n /* justify-content: center; */\n align-items: center;\n gap: 1rem;\n"])));
|
|
17
18
|
exports.StyledButtonSlider = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n width: 4rem;\n height: 2rem;\n user-select: none;\n position: relative;\n \n border-radius: 1rem;\n cursor: ", ";\n background-color: ", ";\n\n &:hover {\n background-color: ", ";\n }\n\n ", "\n"], ["\n width: 4rem;\n height: 2rem;\n user-select: none;\n position: relative;\n \n border-radius: 1rem;\n cursor: ", ";\n background-color: ", ";\n\n &:hover {\n background-color: ", ";\n }\n\n ", "\n"])), function (_a) {
|
|
@@ -28,7 +29,7 @@ exports.StyledButtonSlider = styled_components_1.default.div(templateObject_2 ||
|
|
|
28
29
|
var colors = _a.theme.colors, inactive = _a.inactive, disabled = _a.disabled;
|
|
29
30
|
return !disabled && (inactive ? greyColor40 : (0, utilsOolib_1.getPrimaryColorText)(colors));
|
|
30
31
|
}, (0, mixins_1.transition)('background-color'));
|
|
31
|
-
exports.StyledToggleButton = styled_components_1.default.button(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n width: 2rem;\n height: 2rem;\n background-color: ", ";\n outline: none;\n ", ";\n border-radius: 50%;\n cursor: ", ";\n border: 2px solid; \n border-color: ", ";\n
|
|
32
|
+
exports.StyledToggleButton = styled_components_1.default.button(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n width: 2rem;\n height: 2rem;\n background-color: ", ";\n outline: none;\n ", ";\n border-radius: 50%;\n cursor: ", ";\n border: 2px solid; \n border-color: ", ";\n position: absolute;\n top: 0;\n left: ", ";\n \n"], ["\n width: 2rem;\n height: 2rem;\n background-color: ", ";\n outline: none;\n ", ";\n border-radius: 50%;\n cursor: ", ";\n border: 2px solid; \n border-color: ", ";\n position: absolute;\n top: 0;\n left: ", ";\n \n"])), function (_a) {
|
|
32
33
|
var invert = _a.invert;
|
|
33
34
|
return invert ? greyColor100 : white;
|
|
34
35
|
}, (0, mixins_1.transition)('border-color', 'left 0.2s'), function (_a) {
|
|
@@ -45,4 +46,11 @@ exports.StyledToggleButton = styled_components_1.default.button(templateObject_3
|
|
|
45
46
|
var direction = _a.direction;
|
|
46
47
|
return direction === 'left' ? '0' : 'calc(100% - 2rem)';
|
|
47
48
|
});
|
|
48
|
-
|
|
49
|
+
exports.STYLED_LABEL = (0, styled_components_1.default)(Typo_1.LABEL)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\ncolor: ", ";\nline-height: ", ";\n", "\n"], ["\ncolor: ", ";\nline-height: ", ";\n", "\n"])), function (_a) {
|
|
50
|
+
var color = _a.color;
|
|
51
|
+
return color;
|
|
52
|
+
}, function (_a) {
|
|
53
|
+
var lineHeight = _a.lineHeight;
|
|
54
|
+
return lineHeight;
|
|
55
|
+
}, (0, mixins_1.transition)('color'));
|
|
56
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
package/dist/icons/index.d.ts
CHANGED
|
@@ -42,6 +42,7 @@ export namespace icons {
|
|
|
42
42
|
export { ArrowDown };
|
|
43
43
|
export { GearSix };
|
|
44
44
|
export { Wrench };
|
|
45
|
+
export { CheckSquare };
|
|
45
46
|
export { CheckSquareOffset };
|
|
46
47
|
export { Cards };
|
|
47
48
|
export { SignOut };
|
|
@@ -67,14 +68,6 @@ export namespace icons {
|
|
|
67
68
|
export { TextBolder };
|
|
68
69
|
export { TextItalic };
|
|
69
70
|
export { TextUnderline };
|
|
70
|
-
export { OkeGoogleIcon };
|
|
71
|
-
export { LetterH };
|
|
72
|
-
export { IndexIcon };
|
|
73
|
-
export { LanguageIcon };
|
|
74
|
-
export { BadgeAdmin };
|
|
75
|
-
export { BadgeSuperAdmin };
|
|
76
|
-
export { BadgeMod };
|
|
77
|
-
export { BadgeVetted };
|
|
78
71
|
export { ArrowRight };
|
|
79
72
|
export { Sliders };
|
|
80
73
|
export { Faders };
|
|
@@ -83,6 +76,17 @@ export namespace icons {
|
|
|
83
76
|
export { SortAscending };
|
|
84
77
|
export { Crosshair };
|
|
85
78
|
export { MicrophoneStage };
|
|
79
|
+
export { File };
|
|
80
|
+
export { FolderSimple };
|
|
81
|
+
export { FolderSimpleStar };
|
|
82
|
+
export { OkeGoogleIcon };
|
|
83
|
+
export { LetterH };
|
|
84
|
+
export { IndexIcon };
|
|
85
|
+
export { LanguageIcon };
|
|
86
|
+
export { BadgeAdmin };
|
|
87
|
+
export { BadgeSuperAdmin };
|
|
88
|
+
export { BadgeMod };
|
|
89
|
+
export { BadgeVetted };
|
|
86
90
|
export { IndiaFlag };
|
|
87
91
|
export { KenyaFlag };
|
|
88
92
|
}
|
|
@@ -129,6 +133,7 @@ import { MapPin } from "phosphor-react";
|
|
|
129
133
|
import { ArrowDown } from "phosphor-react";
|
|
130
134
|
import { GearSix } from "phosphor-react";
|
|
131
135
|
import { Wrench } from "phosphor-react";
|
|
136
|
+
import { CheckSquare } from "phosphor-react";
|
|
132
137
|
import { CheckSquareOffset } from "phosphor-react";
|
|
133
138
|
import { Cards } from "phosphor-react";
|
|
134
139
|
import { SignOut } from "phosphor-react";
|
|
@@ -154,14 +159,6 @@ import { TextHThree } from "phosphor-react";
|
|
|
154
159
|
import { TextBolder } from "phosphor-react";
|
|
155
160
|
import { TextItalic } from "phosphor-react";
|
|
156
161
|
import { TextUnderline } from "phosphor-react";
|
|
157
|
-
import { OkeGoogleIcon } from "./custom";
|
|
158
|
-
import { LetterH } from "./custom";
|
|
159
|
-
import { IndexIcon } from "./custom";
|
|
160
|
-
import { LanguageIcon } from "./custom";
|
|
161
|
-
import { BadgeAdmin } from "./custom";
|
|
162
|
-
import { BadgeSuperAdmin } from "./custom";
|
|
163
|
-
import { BadgeMod } from "./custom";
|
|
164
|
-
import { BadgeVetted } from "./custom";
|
|
165
162
|
import { ArrowRight } from "phosphor-react";
|
|
166
163
|
import { Sliders } from "phosphor-react";
|
|
167
164
|
import { Faders } from "phosphor-react";
|
|
@@ -170,5 +167,16 @@ import { SortDescending } from "phosphor-react";
|
|
|
170
167
|
import { SortAscending } from "phosphor-react";
|
|
171
168
|
import { Crosshair } from "phosphor-react";
|
|
172
169
|
import { MicrophoneStage } from "phosphor-react";
|
|
170
|
+
import { File } from "phosphor-react";
|
|
171
|
+
import { FolderSimple } from "phosphor-react";
|
|
172
|
+
import { FolderSimpleStar } from "phosphor-react";
|
|
173
|
+
import { OkeGoogleIcon } from "./custom";
|
|
174
|
+
import { LetterH } from "./custom";
|
|
175
|
+
import { IndexIcon } from "./custom";
|
|
176
|
+
import { LanguageIcon } from "./custom";
|
|
177
|
+
import { BadgeAdmin } from "./custom";
|
|
178
|
+
import { BadgeSuperAdmin } from "./custom";
|
|
179
|
+
import { BadgeMod } from "./custom";
|
|
180
|
+
import { BadgeVetted } from "./custom";
|
|
173
181
|
import { IndiaFlag } from "./custom";
|
|
174
182
|
import { KenyaFlag } from "./custom";
|
package/dist/icons/index.js
CHANGED
|
@@ -47,6 +47,7 @@ exports.icons = {
|
|
|
47
47
|
ArrowDown: phosphor_react_1.ArrowDown,
|
|
48
48
|
GearSix: phosphor_react_1.GearSix,
|
|
49
49
|
Wrench: phosphor_react_1.Wrench,
|
|
50
|
+
CheckSquare: phosphor_react_1.CheckSquare,
|
|
50
51
|
CheckSquareOffset: phosphor_react_1.CheckSquareOffset,
|
|
51
52
|
Cards: phosphor_react_1.Cards,
|
|
52
53
|
SignOut: phosphor_react_1.SignOut,
|
|
@@ -72,14 +73,6 @@ exports.icons = {
|
|
|
72
73
|
TextBolder: phosphor_react_1.TextBolder,
|
|
73
74
|
TextItalic: phosphor_react_1.TextItalic,
|
|
74
75
|
TextUnderline: phosphor_react_1.TextUnderline,
|
|
75
|
-
OkeGoogleIcon: custom_1.OkeGoogleIcon,
|
|
76
|
-
LetterH: custom_1.LetterH,
|
|
77
|
-
IndexIcon: custom_1.IndexIcon,
|
|
78
|
-
LanguageIcon: custom_1.LanguageIcon,
|
|
79
|
-
BadgeAdmin: custom_1.BadgeAdmin,
|
|
80
|
-
BadgeSuperAdmin: custom_1.BadgeSuperAdmin,
|
|
81
|
-
BadgeMod: custom_1.BadgeMod,
|
|
82
|
-
BadgeVetted: custom_1.BadgeVetted,
|
|
83
76
|
ArrowRight: phosphor_react_1.ArrowRight,
|
|
84
77
|
Sliders: phosphor_react_1.Sliders,
|
|
85
78
|
Faders: phosphor_react_1.Faders,
|
|
@@ -88,6 +81,17 @@ exports.icons = {
|
|
|
88
81
|
SortAscending: phosphor_react_1.SortAscending,
|
|
89
82
|
Crosshair: phosphor_react_1.Crosshair,
|
|
90
83
|
MicrophoneStage: phosphor_react_1.MicrophoneStage,
|
|
84
|
+
File: phosphor_react_1.File,
|
|
85
|
+
FolderSimple: phosphor_react_1.FolderSimple,
|
|
86
|
+
FolderSimpleStar: phosphor_react_1.FolderSimpleStar,
|
|
87
|
+
OkeGoogleIcon: custom_1.OkeGoogleIcon,
|
|
88
|
+
LetterH: custom_1.LetterH,
|
|
89
|
+
IndexIcon: custom_1.IndexIcon,
|
|
90
|
+
LanguageIcon: custom_1.LanguageIcon,
|
|
91
|
+
BadgeAdmin: custom_1.BadgeAdmin,
|
|
92
|
+
BadgeSuperAdmin: custom_1.BadgeSuperAdmin,
|
|
93
|
+
BadgeMod: custom_1.BadgeMod,
|
|
94
|
+
BadgeVetted: custom_1.BadgeVetted,
|
|
91
95
|
IndiaFlag: custom_1.IndiaFlag,
|
|
92
96
|
KenyaFlag: custom_1.KenyaFlag
|
|
93
97
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -20,6 +20,8 @@ export { UserRoleBadge } from "./components/UserRoleBadge";
|
|
|
20
20
|
export { OKELink } from "./components/OKELink";
|
|
21
21
|
export { Tooltip } from "./components/Tooltip";
|
|
22
22
|
export { ActionMenu } from "./components/ActionMenu";
|
|
23
|
-
export {
|
|
23
|
+
export { RadioInput } from "./components/RadioInput";
|
|
24
|
+
export { CheckInput } from "./components/CheckInput";
|
|
25
|
+
export { PercentCompletedPie } from "./components/PercentCompletedPie";
|
|
24
26
|
export { Divider } from "./components/Divider";
|
|
25
27
|
export { CircleLoader, ProgressBar, CircleLoader as Loader } from "./components/LoadersAndProgressBars";
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.Divider = exports.
|
|
17
|
+
exports.Divider = exports.PercentCompletedPie = exports.CheckInput = exports.RadioInput = exports.ActionMenu = exports.Tooltip = exports.OKELink = exports.UserRoleBadge = exports.Section = exports.Loader = exports.ProgressBar = exports.CircleLoader = exports.icons = exports.colors = exports.GlobalStyles = void 0;
|
|
18
18
|
//css and styling related ( styled-components )
|
|
19
19
|
var globalStyles_1 = require("./globalStyles");
|
|
20
20
|
Object.defineProperty(exports, "GlobalStyles", { enumerable: true, get: function () { return globalStyles_1.GlobalStyles; } });
|
|
@@ -52,8 +52,12 @@ var Tooltip_1 = require("./components/Tooltip");
|
|
|
52
52
|
Object.defineProperty(exports, "Tooltip", { enumerable: true, get: function () { return Tooltip_1.Tooltip; } });
|
|
53
53
|
var ActionMenu_1 = require("./components/ActionMenu");
|
|
54
54
|
Object.defineProperty(exports, "ActionMenu", { enumerable: true, get: function () { return ActionMenu_1.ActionMenu; } });
|
|
55
|
-
var
|
|
56
|
-
Object.defineProperty(exports, "
|
|
55
|
+
var RadioInput_1 = require("./components/RadioInput");
|
|
56
|
+
Object.defineProperty(exports, "RadioInput", { enumerable: true, get: function () { return RadioInput_1.RadioInput; } });
|
|
57
|
+
var CheckInput_1 = require("./components/CheckInput");
|
|
58
|
+
Object.defineProperty(exports, "CheckInput", { enumerable: true, get: function () { return CheckInput_1.CheckInput; } });
|
|
59
|
+
var PercentCompletedPie_1 = require("./components/PercentCompletedPie");
|
|
60
|
+
Object.defineProperty(exports, "PercentCompletedPie", { enumerable: true, get: function () { return PercentCompletedPie_1.PercentCompletedPie; } });
|
|
57
61
|
var Divider_1 = require("./components/Divider");
|
|
58
62
|
Object.defineProperty(exports, "Divider", { enumerable: true, get: function () { return Divider_1.Divider; } });
|
|
59
63
|
//utility functions
|
package/package.json
CHANGED