oolib 2.176.1 → 2.176.2
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/index.d.ts +2 -1
- package/dist/index.js +13 -6
- package/dist/stories/v2/components/RadioButton.stories.d.ts +1 -0
- package/dist/stories/v2/components/RadioButton.stories.js +1 -0
- package/dist/v2/components/Buttons/styled.js +8 -8
- package/dist/v2/components/RadioAndCheckbox/comps/CheckboxList/comps/CheckboxButton/index.js +8 -2
- package/dist/v2/components/RadioAndCheckbox/comps/CheckboxList/comps/CheckboxButton/styled.js +4 -4
- package/dist/v2/components/RadioAndCheckbox/comps/CheckboxList/comps/CheckboxInput/index.js +1 -1
- package/dist/v2/components/RadioAndCheckbox/comps/RadioList/comps/RadioInput/index.d.ts +2 -1
- package/dist/v2/components/RadioAndCheckbox/comps/RadioList/comps/RadioInput/index.js +5 -7
- package/dist/v2/components/RadioAndCheckbox/comps/RadioList/comps/RadioInput/styled.d.ts +1 -1
- package/dist/v2/components/RadioAndCheckbox/comps/RadioList/comps/RadioInput/styled.js +14 -13
- package/dist/v2/components/RadioAndCheckbox/styled.js +5 -4
- package/dist/v2/themes/utils/baseStyling.d.ts +3 -1
- package/dist/v2/themes/utils/baseStyling.js +7 -5
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -76,11 +76,12 @@ export { DataVizAccordion } from "./v2/components/DataVizAccordion";
|
|
|
76
76
|
export { CheckboxList } from "./v2/components/RadioAndCheckbox/comps/CheckboxList";
|
|
77
77
|
export { CheckboxInput } from "./v2/components/RadioAndCheckbox/comps/CheckboxList/comps/CheckboxInput";
|
|
78
78
|
export { CheckboxButton } from "./v2/components/RadioAndCheckbox/comps/CheckboxList/comps/CheckboxButton";
|
|
79
|
+
export { RadioList } from "./v2/components/RadioAndCheckbox/comps/RadioList/index";
|
|
79
80
|
export * as baseStyling from "./v2/themes/utils/baseStyling";
|
|
80
81
|
export { LoaderCircle, ProgressBar, LoaderCircle as Loader, LoaderOverlay } from "./components/LoadersAndProgress";
|
|
81
82
|
export { TagClear, TagLink, TagSelect, TagDisplay } from "./components/Tags";
|
|
82
|
-
export { RadioButton, RadioInput, RadioList } from "./components/RadioAndCheckbox";
|
|
83
83
|
export { BannerAlert, BannerInfo } from "./components/Banners";
|
|
84
84
|
export { BannerContext, useBannerContext, BannerProvider } from "./components/Banners/bannerContext";
|
|
85
85
|
export { TagDisplay as TagDisplayV2, TagLink as TagLinkV2, TagClear as TagClearV2 } from "./v2/components/Tags";
|
|
86
86
|
export { ButtonPrimary as ButtonPrimaryV2, ButtonSecondary as ButtonSecondaryV2, ButtonTertiary as ButtonTertiaryV2, ButtonGhost as ButtonGhostV2, ButtonPrimaryCompact, ButtonSecondaryCompact, ButtonTertiaryCompact } from "./v2/components/Buttons";
|
|
87
|
+
export { RadioInput, RadioButton } from "./v2/components/RadioAndCheckbox/comps/RadioList/comps/RadioInput/index";
|
package/dist/index.js
CHANGED
|
@@ -39,8 +39,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
39
39
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
40
|
};
|
|
41
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
-
exports.VideoInput = exports.ProfileImageInput = exports.ImageInput = exports.MetaBlock = exports.genTagComp = exports.generateOptions = exports.OptionsSingle = exports.DropdownMulti = exports.DropdownSingle = exports.parseCardConfig = exports.ListProfile = exports.CardProfile = exports.CardEmbed = exports.DateTimeRangePicker = exports.DateTimePicker = exports.TimeRangePicker = exports.TimePicker = exports.DateRangePicker = exports.DatePicker = exports.TextLoader = exports.PageScrollIndicator = exports.HomeCover = exports.EmptyStates = exports.ModalSmall = exports.Modal = exports.ModalForms = exports.ModalConfirm = exports.SkeletonLoader = exports.Divider = exports.PercentCompletedPie = exports.Accordion = exports.ActionMenu = exports.Tooltip = exports.OKELink = exports.UserRoleBadge = exports.Section = exports.
|
|
43
|
-
exports.baseStyling = exports.CheckboxButton = exports.CheckboxInput = exports.CheckboxList = exports.DataVizAccordion = exports.BarChart = exports.HomeCoverV2 = exports.DateRangePickerV2 = exports.MetaBlockV2 = exports.colors2 = exports.TabBarV2 = exports.ButtonTertiaryCompact = exports.ButtonSecondaryCompact = exports.ButtonPrimaryCompact = exports.ButtonGhostV2 = exports.ButtonTertiaryV2 = exports.ButtonSecondaryV2 = exports.ButtonPrimaryV2 = exports.TagClearV2 = exports.TagLinkV2 = exports.TagDisplayV2 = exports.HintsProvider = exports.TableCellResizerPlugin = exports.styledOKELinkCSS = exports.SimpleTable = exports.ModalConfirmAction = exports.BannerProvider = exports.useBannerContext = exports.BannerContext = exports.BannerInfo = exports.BannerAlert = exports.GroupQuestionsInputSingle = exports.ResourceInput =
|
|
42
|
+
exports.IFrameInput = exports.PDFInput = exports.AudioInput = exports.VideoInput = exports.ProfileImageInput = exports.ImageInput = exports.MetaBlock = exports.genTagComp = exports.generateOptions = exports.OptionsSingle = exports.DropdownMulti = exports.DropdownSingle = exports.parseCardConfig = exports.ListProfile = exports.CardProfile = exports.CardEmbed = exports.DateTimeRangePicker = exports.DateTimePicker = exports.TimeRangePicker = exports.TimePicker = exports.DateRangePicker = exports.DatePicker = exports.TextLoader = exports.PageScrollIndicator = exports.HomeCover = exports.EmptyStates = exports.ModalSmall = exports.Modal = exports.ModalForms = exports.ModalConfirm = exports.SkeletonLoader = exports.Divider = exports.PercentCompletedPie = exports.Accordion = exports.ActionMenu = exports.Tooltip = exports.OKELink = exports.UserRoleBadge = exports.Section = exports.TagDisplay = exports.TagSelect = exports.TagLink = exports.TagClear = exports.LoaderOverlay = exports.Loader = exports.ProgressBar = exports.LoaderCircle = exports.icons = exports.colors = exports.GlobalStyles = void 0;
|
|
43
|
+
exports.baseStyling = exports.RadioButton = exports.RadioInput = exports.RadioList = exports.CheckboxButton = exports.CheckboxInput = exports.CheckboxList = exports.DataVizAccordion = exports.BarChart = exports.HomeCoverV2 = exports.DateRangePickerV2 = exports.MetaBlockV2 = exports.colors2 = exports.TabBarV2 = exports.ButtonTertiaryCompact = exports.ButtonSecondaryCompact = exports.ButtonPrimaryCompact = exports.ButtonGhostV2 = exports.ButtonTertiaryV2 = exports.ButtonSecondaryV2 = exports.ButtonPrimaryV2 = exports.TagClearV2 = exports.TagLinkV2 = exports.TagDisplayV2 = exports.HintsProvider = exports.TableCellResizerPlugin = exports.styledOKELinkCSS = exports.SimpleTable = exports.ModalConfirmAction = exports.BannerProvider = exports.useBannerContext = exports.BannerContext = exports.BannerInfo = exports.BannerAlert = exports.GroupQuestionsInputSingle = exports.ResourceInput = void 0;
|
|
44
44
|
//css and styling related ( styled-components )
|
|
45
45
|
var globalStyles_1 = require("./globalStyles");
|
|
46
46
|
Object.defineProperty(exports, "GlobalStyles", { enumerable: true, get: function () { return globalStyles_1.GlobalStyles; } });
|
|
@@ -73,10 +73,11 @@ __exportStar(require("./components/Container"), exports);
|
|
|
73
73
|
__exportStar(require("./components/Wrappers"), exports);
|
|
74
74
|
__exportStar(require("./components/Switches"), exports);
|
|
75
75
|
__exportStar(require("./components/TabBar"), exports);
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
76
|
+
// export {
|
|
77
|
+
// RadioButton,
|
|
78
|
+
// RadioInput,
|
|
79
|
+
// RadioList
|
|
80
|
+
// } from './components/RadioAndCheckbox';
|
|
80
81
|
__exportStar(require("./components/Margins"), exports);
|
|
81
82
|
__exportStar(require("./components/Paddings"), exports);
|
|
82
83
|
var Section_1 = require("./components/Section");
|
|
@@ -237,4 +238,10 @@ var CheckboxInput_1 = require("./v2/components/RadioAndCheckbox/comps/CheckboxLi
|
|
|
237
238
|
Object.defineProperty(exports, "CheckboxInput", { enumerable: true, get: function () { return CheckboxInput_1.CheckboxInput; } });
|
|
238
239
|
var CheckboxButton_1 = require("./v2/components/RadioAndCheckbox/comps/CheckboxList/comps/CheckboxButton");
|
|
239
240
|
Object.defineProperty(exports, "CheckboxButton", { enumerable: true, get: function () { return CheckboxButton_1.CheckboxButton; } });
|
|
241
|
+
var index_1 = require("./v2/components/RadioAndCheckbox/comps/RadioList/index");
|
|
242
|
+
Object.defineProperty(exports, "RadioList", { enumerable: true, get: function () { return index_1.RadioList; } });
|
|
243
|
+
var index_2 = require("./v2/components/RadioAndCheckbox/comps/RadioList/comps/RadioInput/index");
|
|
244
|
+
Object.defineProperty(exports, "RadioInput", { enumerable: true, get: function () { return index_2.RadioInput; } });
|
|
245
|
+
var index_3 = require("./v2/components/RadioAndCheckbox/comps/RadioList/comps/RadioInput/index");
|
|
246
|
+
Object.defineProperty(exports, "RadioButton", { enumerable: true, get: function () { return index_3.RadioButton; } });
|
|
240
247
|
exports.baseStyling = __importStar(require("./v2/themes/utils/baseStyling"));
|
|
@@ -72,11 +72,11 @@ var variants = {
|
|
|
72
72
|
return colors ? (0, getDynamicColors_1.getOnPrimary)(colors) : onPrimary;
|
|
73
73
|
}, function (_a) {
|
|
74
74
|
var forceHover = _a.forceHover;
|
|
75
|
-
return forceHover && (0, baseStyling_1.
|
|
75
|
+
return forceHover && (0, baseStyling_1.applyBlackOverlayOnHover)();
|
|
76
76
|
}, function (_a) {
|
|
77
77
|
var disabled = _a.disabled;
|
|
78
78
|
return disabled && disabledStyles;
|
|
79
|
-
}, (0, baseStyling_1.
|
|
79
|
+
}, (0, baseStyling_1.applyBlackOverlayOnHover)()),
|
|
80
80
|
secondary: (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n background-color: ", ";\n color: ", ";\n \n ", "\n ", "\n \n @media (hover: hover) {\n &:hover {\n ", "\n }\n }\n "], ["\n background-color: ", ";\n color: ", ";\n \n ", "\n ", "\n \n @media (hover: hover) {\n &:hover {\n ", "\n }\n }\n "])), function (_a) {
|
|
81
81
|
var colors = _a.theme.colors;
|
|
82
82
|
return colors ? (0, getDynamicColors_1.getSecondaryContainer)(colors) : secondaryContainer;
|
|
@@ -88,22 +88,22 @@ var variants = {
|
|
|
88
88
|
return disabled && disabledStyles;
|
|
89
89
|
}, function (_a) {
|
|
90
90
|
var forceHover = _a.forceHover;
|
|
91
|
-
return forceHover && (0, baseStyling_1.
|
|
92
|
-
}, (0, baseStyling_1.
|
|
91
|
+
return forceHover && (0, baseStyling_1.applyBlackOverlayOnHover)();
|
|
92
|
+
}, (0, baseStyling_1.applyBlackOverlayOnHover)()),
|
|
93
93
|
tertiary: (0, styled_components_1.css)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n background-color: transparent;\n color: ", ";\n /* border: 1px solid ", "; */\n box-sizing: border-box;\n outline: 1px solid ", ";\n ", "\n\n ", "\n\n @media (hover: hover) {\n &:hover {\n ", "\n }\n }\n "], ["\n background-color: transparent;\n color: ", ";\n /* border: 1px solid ", "; */\n box-sizing: border-box;\n outline: 1px solid ", ";\n ", "\n\n ", "\n\n @media (hover: hover) {\n &:hover {\n ", "\n }\n }\n "])), grey80, colors_1.colors.grey10, grey10, function (_a) {
|
|
94
94
|
var disabled = _a.disabled;
|
|
95
95
|
return disabled && (0, styled_components_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n color: ", ";\n pointer-events: none;\n "], ["\n color: ", ";\n pointer-events: none;\n "])), grey40);
|
|
96
96
|
}, function (_a) {
|
|
97
97
|
var forceHover = _a.forceHover;
|
|
98
|
-
return forceHover && (0, baseStyling_1.
|
|
99
|
-
}, (0, baseStyling_1.
|
|
98
|
+
return forceHover && (0, baseStyling_1.applyBlackOverlayOnHover)();
|
|
99
|
+
}, (0, baseStyling_1.applyBlackOverlayOnHover)()),
|
|
100
100
|
ghost: (0, styled_components_1.css)(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n background-color: transparent;\n color: ", ";\n\n ", "\n \n ", "\n \n @media (hover: hover) {\n &:hover {\n ", "\n }\n }\n "], ["\n background-color: transparent;\n color: ", ";\n\n ", "\n \n ", "\n \n @media (hover: hover) {\n &:hover {\n ", "\n }\n }\n "])), grey80, function (_a) {
|
|
101
101
|
var disabled = _a.disabled;
|
|
102
102
|
return disabled && (0, styled_components_1.css)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n color: ", ";\n pointer-events: none;\n "], ["\n color: ", ";\n pointer-events: none;\n "])), grey40);
|
|
103
103
|
}, function (_a) {
|
|
104
104
|
var forceHover = _a.forceHover;
|
|
105
|
-
return forceHover && (0, baseStyling_1.
|
|
106
|
-
}, (0, baseStyling_1.
|
|
105
|
+
return forceHover && (0, baseStyling_1.applyBlackOverlayOnHover)();
|
|
106
|
+
}, (0, baseStyling_1.applyBlackOverlayOnHover)()),
|
|
107
107
|
};
|
|
108
108
|
// Composition Styles
|
|
109
109
|
var getCompositionStyles = function (composition, responsive) {
|
package/dist/v2/components/RadioAndCheckbox/comps/CheckboxList/comps/CheckboxButton/index.js
CHANGED
|
@@ -8,8 +8,12 @@ var react_1 = __importDefault(require("react"));
|
|
|
8
8
|
var icons_1 = require("../../../../../../../icons");
|
|
9
9
|
var themes_1 = require("../../../../../../themes");
|
|
10
10
|
var styled_1 = require("./styled");
|
|
11
|
+
var getDynamicColors_1 = require("../../../../../../themes/utils/getDynamicColors");
|
|
12
|
+
var styled_components_1 = require("styled-components");
|
|
13
|
+
var _EXPORTS_1 = require("../../../../../../../utils/_EXPORTS");
|
|
14
|
+
var mixins_1 = require("../../../../../../../themes/mixins");
|
|
11
15
|
var Check = icons_1.icons.Check, Minus = icons_1.icons.Minus;
|
|
12
|
-
var white = themes_1.colors.white, greyColor100 = themes_1.colors.greyColor100,
|
|
16
|
+
var white = themes_1.colors.white, greyColor100 = themes_1.colors.greyColor100, grey40 = themes_1.colors.grey40;
|
|
13
17
|
/**
|
|
14
18
|
* value and onChange are being passed as props so
|
|
15
19
|
* that it can be generated dynamically via our
|
|
@@ -20,18 +24,20 @@ var CheckboxButton = function (_a) {
|
|
|
20
24
|
var id = _a.id, className = _a.className, _isSelected = _a.isSelected, isMixture = _a.isMixture, //basically if isSelected/value && isMixture is true, then we get that '-' thing in the checkbox (useful on table headers where some (not all) rows are selected below)
|
|
21
25
|
value = _a.value, //can be used interchangibly with isSelected
|
|
22
26
|
onChange = _a.onChange, disabled = _a.disabled, invert = _a.invert, S = _a.S;
|
|
27
|
+
var theme = (0, styled_components_1.useTheme)();
|
|
23
28
|
var isSelected = (_b = _isSelected !== null && _isSelected !== void 0 ? _isSelected : value) !== null && _b !== void 0 ? _b : false;
|
|
24
29
|
var CheckIcon = (isSelected && isMixture)
|
|
25
30
|
? Minus
|
|
26
31
|
: isSelected
|
|
27
32
|
? Check
|
|
28
33
|
: undefined;
|
|
34
|
+
var screenWidth = (0, _EXPORTS_1.useScreenWidth)();
|
|
29
35
|
return (react_1.default.createElement(styled_1.StyledCheckbox, { style: { overflow: 'hidden' }, onClick: function (e) {
|
|
30
36
|
// e.preventDefault();
|
|
31
37
|
// e.stopPropagation(); //this disables the checkbox in checkboxlist which we dont want. so commented. tho we might need this later in table usecase in which case we will have to make stopPropagration a prop
|
|
32
38
|
onChange && onChange(id, !isSelected);
|
|
33
39
|
}, className: className, isSelected: isSelected, disabled: disabled, invert: invert, S: S }, isSelected && (react_1.default.createElement("div", { style: { filter: "drop-shadow(0px 4px 6px rgba(0, 0, 0, 0.25))", display: 'flex' } },
|
|
34
|
-
react_1.default.createElement(CheckIcon, { weight: "bold", color: disabled ? grey40 :
|
|
40
|
+
react_1.default.createElement(CheckIcon, { weight: "bold", color: disabled ? grey40 : (0, getDynamicColors_1.getOnSecondary)(theme === null || theme === void 0 ? void 0 : theme.colors), size: screenWidth >= (0, mixins_1.getBreakPoint)('md') ? 14 : 16, style: {
|
|
35
41
|
flexShrink: 0,
|
|
36
42
|
} })))));
|
|
37
43
|
};
|
package/dist/v2/components/RadioAndCheckbox/comps/CheckboxList/comps/CheckboxButton/styled.js
CHANGED
|
@@ -54,9 +54,9 @@ exports.StyledCheckbox = styled_components_1.default.button(templateObject_3 ||
|
|
|
54
54
|
}
|
|
55
55
|
return "none";
|
|
56
56
|
}, function (_a) {
|
|
57
|
-
var isSelected = _a.isSelected, disabled = _a.disabled,
|
|
57
|
+
var isSelected = _a.isSelected, disabled = _a.disabled, theme = _a.theme;
|
|
58
58
|
if (isSelected) {
|
|
59
|
-
return disabled ? grey5 : (0, getDynamicColors_1.getSecondaryContainer)(colors);
|
|
59
|
+
return disabled ? grey5 : (0, getDynamicColors_1.getSecondaryContainer)(theme === null || theme === void 0 ? void 0 : theme.colors);
|
|
60
60
|
}
|
|
61
61
|
return disabled ? grey5 : "white";
|
|
62
62
|
}, function (_a) {
|
|
@@ -64,10 +64,10 @@ exports.StyledCheckbox = styled_components_1.default.button(templateObject_3 ||
|
|
|
64
64
|
return (disabled ? "not-allowed" : "pointer");
|
|
65
65
|
}, function (_a) {
|
|
66
66
|
var isSelected = _a.isSelected, disabled = _a.disabled;
|
|
67
|
-
return isSelected && !disabled && (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", " \n "], ["\n ", " \n "])), (0, baseStyling_1.
|
|
67
|
+
return isSelected && !disabled && (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", " \n "], ["\n ", " \n "])), (0, baseStyling_1.applyBlackOverlayOnHover)());
|
|
68
68
|
}, function (_a) {
|
|
69
69
|
var isSelected = _a.isSelected, disabled = _a.disabled;
|
|
70
70
|
return !disabled &&
|
|
71
|
-
!isSelected && (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n
|
|
71
|
+
!isSelected && (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n "], ["\n ", "\n "])), baseStyling_1.borderStyleOnHover);
|
|
72
72
|
});
|
|
73
73
|
var templateObject_1, templateObject_2, templateObject_3;
|
|
@@ -21,7 +21,7 @@ var CheckboxInput = function (_a) {
|
|
|
21
21
|
var markingCommand = (0, utils_1.getMarkingCommand)({ option: option, isSelected: isSelected }); // returns undefined if option isn't labeled as 'correct' nor selected
|
|
22
22
|
var genCheckboxButton = function (options) {
|
|
23
23
|
if (options === void 0) { options = {}; }
|
|
24
|
-
return (react_1.default.createElement(CheckboxButton_1.CheckboxButton, { isSelected: isSelected, disabled: disabled, invert: invert, S: S, className: "
|
|
24
|
+
return (react_1.default.createElement(CheckboxButton_1.CheckboxButton, { isSelected: isSelected, disabled: disabled, invert: invert, S: S, className: "radioOrCheckboxButton_inside_input", disabled: disabled }));
|
|
25
25
|
};
|
|
26
26
|
var genCheckSquare = function () { return (react_1.default.createElement("div", { style: { flexShrink: 0 } },
|
|
27
27
|
react_1.default.createElement(CheckSquare, { size: S ? 22.5 : 26, color: disabled ? grey40 : onSecondary, style: {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
export function RadioButton({ isSelected, onClick, disabled, invert, S, readOnly }: {
|
|
1
|
+
export function RadioButton({ isSelected, onClick, disabled, invert, S, readOnly, className }: {
|
|
2
2
|
isSelected: any;
|
|
3
3
|
onClick: any;
|
|
4
4
|
disabled: any;
|
|
5
5
|
invert: any;
|
|
6
6
|
S: any;
|
|
7
7
|
readOnly: any;
|
|
8
|
+
className: any;
|
|
8
9
|
}): React.JSX.Element;
|
|
9
10
|
export function RadioInput({ option, onClick, disabled, invert, value, S, rightWrongResult, }: {
|
|
10
11
|
option: any;
|
|
@@ -11,23 +11,21 @@ var Typo_1 = require("../../../../../../../components/Typo");
|
|
|
11
11
|
var utils_1 = require("../../../../utils");
|
|
12
12
|
var styled_1 = require("../../../../styled");
|
|
13
13
|
var styled_2 = require("./styled");
|
|
14
|
+
var Typo2_1 = require("../../../../../Typo2");
|
|
14
15
|
var invertGreen = themes_1.colors.invertGreen, red = themes_1.colors.red, greyColor40 = themes_1.colors.greyColor40, green = themes_1.colors.green, invertRed = themes_1.colors.invertRed;
|
|
15
16
|
var XCircle = icons_1.icons.XCircle, CheckCircle = icons_1.icons.CheckCircle;
|
|
16
17
|
var RadioButton = function (_a) {
|
|
17
|
-
var isSelected = _a.isSelected, onClick = _a.onClick, disabled = _a.disabled, invert = _a.invert, S = _a.S, readOnly = _a.readOnly;
|
|
18
|
-
return (react_1.default.createElement(styled_2.
|
|
18
|
+
var isSelected = _a.isSelected, onClick = _a.onClick, disabled = _a.disabled, invert = _a.invert, S = _a.S, readOnly = _a.readOnly, className = _a.className;
|
|
19
|
+
return (react_1.default.createElement(styled_2.StyledRadioButton, { style: { overflow: 'hidden' }, className: className || '', onClick: function (ev) { return onClick && onClick(ev); }, isSelected: isSelected, disabled: disabled, invert: invert, S: S, readOnly: readOnly }));
|
|
19
20
|
};
|
|
20
21
|
exports.RadioButton = RadioButton;
|
|
21
22
|
var RadioInput = function (_a) {
|
|
22
23
|
var option = _a.option, onClick = _a.onClick, disabled = _a.disabled, invert = _a.invert, value = _a.value, S = _a.S, rightWrongResult = _a.rightWrongResult;
|
|
23
24
|
var isSelected = option.value === (value === null || value === void 0 ? void 0 : value.value);
|
|
24
25
|
var markingCommand = (0, utils_1.getMarkingCommand)({ option: option, isSelected: isSelected }); // returns undefined if option isn't labeled as 'correct' nor selected
|
|
25
|
-
var TYPO_COMP = S
|
|
26
|
-
? Typo_1.SANS_2
|
|
27
|
-
: Typo_1.SANS_3;
|
|
28
26
|
var genRadioButton = function (options) {
|
|
29
27
|
if (options === void 0) { options = {}; }
|
|
30
|
-
return (react_1.default.createElement(exports.RadioButton, { isSelected: isSelected, invert: invert, S: S, className: '
|
|
28
|
+
return (react_1.default.createElement(exports.RadioButton, { isSelected: isSelected, invert: invert, S: S, className: 'radioOrCheckboxButton_inside_input',
|
|
31
29
|
disabled: options.disabled || disabled //because we force disabled if rightWrongResult exists & no markingCommand exists against this option i.e, it neither has to be marked right nor wrong
|
|
32
30
|
}));
|
|
33
31
|
};
|
|
@@ -48,6 +46,6 @@ var RadioInput = function (_a) {
|
|
|
48
46
|
: genRadioButton({ disabled: true }) //else rightWrongResult has come in, but this doesnt have to be marked right or wrong
|
|
49
47
|
: genRadioButton() // rightWrongResult as not come in. so gen normal radio button
|
|
50
48
|
,
|
|
51
|
-
react_1.default.createElement(
|
|
49
|
+
react_1.default.createElement(Typo2_1.UI_BODY_SM_DF, { bold: rightWrongResult && isSelected, color: disabled && greyColor40, invert: invert }, option.display)));
|
|
52
50
|
};
|
|
53
51
|
exports.RadioInput = RadioInput;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const
|
|
1
|
+
export const StyledRadioButton: import("styled-components").StyledComponent<"button", any, {}, never>;
|
|
@@ -37,18 +37,17 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
37
37
|
};
|
|
38
38
|
})();
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
-
exports.
|
|
40
|
+
exports.StyledRadioButton = void 0;
|
|
41
41
|
var styled_components_1 = __importStar(require("styled-components"));
|
|
42
42
|
var themes_1 = require("../../../../../../themes");
|
|
43
43
|
var mixins_1 = require("../../../../../../../themes/mixins");
|
|
44
|
-
var
|
|
44
|
+
var baseStyling_1 = require("../../../../../../themes/utils/baseStyling");
|
|
45
|
+
var getDynamicColors_1 = require("../../../../../../themes/utils/getDynamicColors");
|
|
45
46
|
var none = themes_1.colors.none, white = themes_1.colors.white, greyColor40 = themes_1.colors.greyColor40, greyColor100 = themes_1.colors.greyColor100, greyColor80 = themes_1.colors.greyColor80, grey5 = themes_1.colors.grey5, grey10 = themes_1.colors.grey10, grey20 = themes_1.colors.grey20;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
exports.StyledRadioInput = styled_components_1.default.button(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n width: 18px;\n height: 18px;\n border-radius: 50%;\n background: ", ";\n border: ", ";\n cursor: ", ";\n display: flex;\n align-items: center;\n justify-content: center;\n\n &:hover {\n ", "\n }\n\n &:focus {\n outline: none;\n box-shadow: ", ";\n }\n\n /* add the smaller circle for selected state */\n &::after {\n content: \"\";\n position: absolute;\n width: 10px;\n height: 10px;\n border-radius: 50%;\n background: ", ";\n border: ", ";\n box-shadow: ", ";\n }\n"], ["\n position: relative;\n width: 18px;\n height: 18px;\n border-radius: 50%;\n background: ", ";\n border: ", ";\n cursor: ", ";\n display: flex;\n align-items: center;\n justify-content: center;\n\n &:hover {\n ", "\n }\n\n &:focus {\n outline: none;\n box-shadow: ", ";\n }\n\n /* add the smaller circle for selected state */\n &::after {\n content: \"\";\n position: absolute;\n width: 10px;\n height: 10px;\n border-radius: 50%;\n background: ", ";\n border: ", ";\n box-shadow: ", ";\n }\n"])), function (_a) {
|
|
49
|
-
var isSelected = _a.isSelected, disabled = _a.disabled;
|
|
47
|
+
exports.StyledRadioButton = styled_components_1.default.button(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: relative;\n width: 2.4rem;\n height: 2.4rem;\n ", "{\n width: 1.8rem;\n height: 1.8rem;\n }\n border-radius: 50%;\n background: ", ";\n border: ", ";\n cursor: ", ";\n display: flex;\n align-items: center;\n justify-content: center;\n\n ", "\n\n &:hover {\n ", "\n }\n\n /* &:focus {\n outline: none;\n box-shadow: ", ";\n } */\n\n /* add the smaller circle for selected state */\n &::after {\n z-index: 1; //so that the black overlay that appears via ::before is below this\n content: \"\";\n position: absolute;\n width: 1.4rem;\n height: 1.4rem;\n ", "{\n width: 1rem;\n height: 1rem;\n }\n border-radius: 50%;\n background: ", ";\n border: ", ";\n box-shadow: ", ";\n }\n"], ["\n position: relative;\n width: 2.4rem;\n height: 2.4rem;\n ", "{\n width: 1.8rem;\n height: 1.8rem;\n }\n border-radius: 50%;\n background: ", ";\n border: ", ";\n cursor: ", ";\n display: flex;\n align-items: center;\n justify-content: center;\n\n ", "\n\n &:hover {\n ", "\n }\n\n /* &:focus {\n outline: none;\n box-shadow: ", ";\n } */\n\n /* add the smaller circle for selected state */\n &::after {\n z-index: 1; //so that the black overlay that appears via ::before is below this\n content: \"\";\n position: absolute;\n width: 1.4rem;\n height: 1.4rem;\n ", "{\n width: 1rem;\n height: 1rem;\n }\n border-radius: 50%;\n background: ", ";\n border: ", ";\n box-shadow: ", ";\n }\n"])), (0, mixins_1.mediaQuery)('md'), function (_a) {
|
|
48
|
+
var isSelected = _a.isSelected, disabled = _a.disabled, theme = _a.theme;
|
|
50
49
|
if (isSelected) {
|
|
51
|
-
return disabled ? grey5 :
|
|
50
|
+
return disabled ? grey5 : (0, getDynamicColors_1.getSecondaryContainer)(theme === null || theme === void 0 ? void 0 : theme.colors);
|
|
52
51
|
}
|
|
53
52
|
return disabled ? grey5 : "none";
|
|
54
53
|
}, function (_a) {
|
|
@@ -60,29 +59,31 @@ exports.StyledRadioInput = styled_components_1.default.button(templateObject_1 |
|
|
|
60
59
|
}, function (_a) {
|
|
61
60
|
var disabled = _a.disabled;
|
|
62
61
|
return (disabled ? "not-allowed" : "pointer");
|
|
62
|
+
}, function (_a) {
|
|
63
|
+
var isSelected = _a.isSelected, disabled = _a.disabled;
|
|
64
|
+
return isSelected && !disabled && (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", " \n "], ["\n ", " \n "])), (0, baseStyling_1.applyBlackOverlayOnHover)());
|
|
63
65
|
}, function (_a) {
|
|
64
66
|
var isSelected = _a.isSelected, disabled = _a.disabled;
|
|
65
67
|
return !disabled &&
|
|
66
|
-
!isSelected &&
|
|
67
|
-
"\n background: rgba(0, 0, 0, 0.05); \n ";
|
|
68
|
+
!isSelected && (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n "], ["\n ", "\n "])), baseStyling_1.borderStyleOnHover);
|
|
68
69
|
}, function (_a) {
|
|
69
70
|
var isSelected = _a.isSelected;
|
|
70
71
|
return isSelected ? "0px 4px 6px rgba(0, 0, 0, 0.25)" : "none";
|
|
71
|
-
}, function (_a) {
|
|
72
|
+
}, (0, mixins_1.mediaQuery)('md'), function (_a) {
|
|
72
73
|
var isSelected = _a.isSelected, disabled = _a.disabled;
|
|
73
74
|
return isSelected ? (disabled ? grey10 : white) : "transparent";
|
|
74
75
|
}, function (_a) {
|
|
75
|
-
var isSelected = _a.isSelected, disabled = _a.disabled;
|
|
76
|
+
var isSelected = _a.isSelected, disabled = _a.disabled, theme = _a.theme;
|
|
76
77
|
return isSelected
|
|
77
78
|
? disabled
|
|
78
79
|
? "1px solid ".concat(grey20)
|
|
79
|
-
: "1px solid ".concat(
|
|
80
|
+
: "1px solid ".concat((0, getDynamicColors_1.getOnSecondary)(theme === null || theme === void 0 ? void 0 : theme.colors))
|
|
80
81
|
: "none";
|
|
81
82
|
}, function (_a) {
|
|
82
83
|
var isSelected = _a.isSelected, disabled = _a.disabled;
|
|
83
84
|
return isSelected && !disabled ? "0px 4px 6px rgba(0, 0, 0, 0.25)" : "none";
|
|
84
85
|
});
|
|
85
|
-
var templateObject_1;
|
|
86
|
+
var templateObject_1, templateObject_2, templateObject_3;
|
|
86
87
|
// we no longer need StyleRadioInputFill since the ::after pseudo is doing the work. It wasn't working without it.
|
|
87
88
|
// export const StyledRadioInputFill = styled.div`
|
|
88
89
|
// width: ${({ isSelected }) => (isSelected ? '10px' : '0px')};
|
|
@@ -42,13 +42,14 @@ var styled_components_1 = __importStar(require("styled-components"));
|
|
|
42
42
|
var themes_1 = require("../../themes");
|
|
43
43
|
var mixins_1 = require("../../../themes/mixins");
|
|
44
44
|
var Typo2_1 = require("../Typo2");
|
|
45
|
+
var baseStyling_1 = require("../../themes/utils/baseStyling");
|
|
45
46
|
exports.StyledOptionsContainer = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n gap: ", ";\n align-items: center;\n\n ", "\n"], ["\n display: flex;\n flex-wrap: wrap;\n gap: ", ";\n align-items: center;\n\n ", "\n"])), function (_a) {
|
|
46
47
|
var S = _a.S;
|
|
47
48
|
return (S ? "0.7rem 1.5rem" : "1rem 2rem");
|
|
48
49
|
}, function (_a) {
|
|
49
50
|
var listType = _a.listType;
|
|
50
51
|
return listType === "vertical"
|
|
51
|
-
? (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-direction: column;\n\n gap: ", "; //0.6 because on mobile checkbox has 0.4 rem extra click area top and bottom. so 1.4rem - 0.8rem\n align-items: flex-start;\n ", " {\n gap: ", ";\n }\n "], ["\n flex-direction: column;\n\n gap: ", "; //0.6 because on mobile checkbox has 0.4 rem extra click area top and bottom. so 1.4rem - 0.8rem\n align-items: flex-start;\n ", " {\n gap: ", ";\n }\n "])), function (_a) {
|
|
52
|
+
? (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-direction: column;\n\n gap: ", "; //0.6 because on mobile checkbox & radio has 0.4 rem extra click area top and bottom. so 1.4rem - 0.8rem\n align-items: flex-start;\n ", " {\n gap: ", ";\n }\n "], ["\n flex-direction: column;\n\n gap: ", "; //0.6 because on mobile checkbox & radio has 0.4 rem extra click area top and bottom. so 1.4rem - 0.8rem\n align-items: flex-start;\n ", " {\n gap: ", ";\n }\n "])), function (_a) {
|
|
52
53
|
var S = _a.S;
|
|
53
54
|
return S
|
|
54
55
|
? "1rem"
|
|
@@ -58,7 +59,7 @@ exports.StyledOptionsContainer = styled_components_1.default.div(templateObject_
|
|
|
58
59
|
return (S ? "1rem" : "1.4rem");
|
|
59
60
|
}) : "";
|
|
60
61
|
});
|
|
61
|
-
exports.StyledOption = styled_components_1.default.button(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n border: none;\n background-color: unset;\n text-align: left;\n display: flex;\n align-items: center;\n /* gap: ", "; */\n gap: 0.8rem;\n padding: 0.4rem 0; //this is so that there is more click area on mobile\n ", " {\n gap: 0.6rem;\n padding: 0;\n }\n position: relative;\n cursor: ", ";\n\n &:hover .
|
|
62
|
+
exports.StyledOption = styled_components_1.default.button(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n border: none;\n background-color: unset;\n text-align: left;\n display: flex;\n align-items: center;\n /* gap: ", "; */\n gap: 0.8rem;\n padding: 0.4rem 0; //this is so that there is more click area on mobile\n ", " {\n gap: 0.6rem;\n padding: 0;\n }\n position: relative;\n cursor: ", ";\n\n &:hover .radioOrCheckboxButton_inside_input {\n ", "\n \n // here we manually trigger what apply10PeecentBlackOnHover does\n ", "\n }\n"], ["\n border: none;\n background-color: unset;\n text-align: left;\n display: flex;\n align-items: center;\n /* gap: ", "; */\n gap: 0.8rem;\n padding: 0.4rem 0; //this is so that there is more click area on mobile\n ", " {\n gap: 0.6rem;\n padding: 0;\n }\n position: relative;\n cursor: ", ";\n\n &:hover .radioOrCheckboxButton_inside_input {\n ", "\n \n // here we manually trigger what apply10PeecentBlackOnHover does\n ", "\n }\n"])), function (_a) {
|
|
62
63
|
var S = _a.S;
|
|
63
64
|
return (S ? "0.7rem" : "1rem");
|
|
64
65
|
}, (0, mixins_1.mediaQuery)("md"), function (_a) {
|
|
@@ -70,9 +71,9 @@ exports.StyledOption = styled_components_1.default.button(templateObject_5 || (t
|
|
|
70
71
|
!rightWrongResult &&
|
|
71
72
|
!disabled && (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n border: 1px solid ", ";\n "], ["\n border: 1px solid ", ";\n "])), themes_1.colors.grey50);
|
|
72
73
|
}, function (_a) {
|
|
73
|
-
var isSelected = _a.isSelected,
|
|
74
|
+
var isSelected = _a.isSelected, disabled = _a.disabled;
|
|
74
75
|
return isSelected &&
|
|
75
|
-
!
|
|
76
|
+
!disabled && (0, styled_components_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n &::before {\n ", "\n }\n "], ["\n &::before {\n ", "\n }\n "])), baseStyling_1.blackOverlayEffect);
|
|
76
77
|
});
|
|
77
78
|
exports.StyledOtherOptionContainer = styled_components_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n display: flex;\n gap: 1rem;\n flex-direction: ", ";\n"], ["\n display: flex;\n gap: 1rem;\n flex-direction: ", ";\n"])), function (_a) {
|
|
78
79
|
var listType = _a.listType;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
interface HoverEffectOptions {
|
|
2
2
|
borderRadius?: string;
|
|
3
3
|
}
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const applyBlackOverlayOnHover: (options?: HoverEffectOptions) => import("styled-components").FlattenSimpleInterpolation;
|
|
5
|
+
export declare const blackOverlayEffect: import("styled-components").FlattenSimpleInterpolation;
|
|
6
|
+
export declare const borderStyleOnHover: import("styled-components").FlattenSimpleInterpolation;
|
|
5
7
|
export {};
|
|
@@ -4,14 +4,16 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
4
4
|
return cooked;
|
|
5
5
|
};
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.
|
|
7
|
+
exports.borderStyleOnHover = exports.blackOverlayEffect = exports.applyBlackOverlayOnHover = void 0;
|
|
8
8
|
var styled_components_1 = require("styled-components");
|
|
9
9
|
var colors_1 = require("../colors");
|
|
10
10
|
// Hover Effects
|
|
11
|
-
var
|
|
11
|
+
var applyBlackOverlayOnHover = function (options) {
|
|
12
12
|
if (options === void 0) { options = {}; }
|
|
13
13
|
var _a = options.borderRadius, borderRadius = _a === void 0 ? 0 : _a; //some cases we want to trigger the
|
|
14
|
-
return (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n &::before {\n content: \"\";\n background-color: transparent;\n position: absolute;\n border-radius: ", ";\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 1;\n }\n &:hover::before {\n
|
|
14
|
+
return (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n &::before {\n content: \"\";\n background-color: transparent;\n position: absolute;\n border-radius: ", ";\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 1;\n }\n &:hover::before {\n ", "\n }\n "], ["\n &::before {\n content: \"\";\n background-color: transparent;\n position: absolute;\n border-radius: ", ";\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 1;\n }\n &:hover::before {\n ", "\n }\n "])), borderRadius, exports.blackOverlayEffect);
|
|
15
15
|
};
|
|
16
|
-
exports.
|
|
17
|
-
|
|
16
|
+
exports.applyBlackOverlayOnHover = applyBlackOverlayOnHover;
|
|
17
|
+
exports.blackOverlayEffect = (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background: ", ";\n"], ["\n background: ", ";\n"])), colors_1.colors.grey10);
|
|
18
|
+
exports.borderStyleOnHover = (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n border: 1px solid ", "\n"], ["\n border: 1px solid ", "\n"])), colors_1.colors.grey50);
|
|
19
|
+
var templateObject_1, templateObject_2, templateObject_3;
|