@laerdal/life-react-components 1.5.1-dev.1.full → 1.5.1-dev.13
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/Accordion/ContentAccordion.cjs +3 -3
- package/dist/Accordion/ContentAccordion.cjs.map +1 -1
- package/dist/Accordion/ContentAccordion.js +2 -3
- package/dist/Accordion/ContentAccordion.js.map +1 -1
- package/dist/Dropdown/BasicDropdown.cjs +7 -2
- package/dist/Dropdown/BasicDropdown.cjs.map +1 -1
- package/dist/Dropdown/BasicDropdown.js +7 -2
- package/dist/Dropdown/BasicDropdown.js.map +1 -1
- package/dist/Dropdown/CommonStyling.cjs +9 -17
- package/dist/Dropdown/CommonStyling.cjs.map +1 -1
- package/dist/Dropdown/CommonStyling.d.ts +0 -3
- package/dist/Dropdown/CommonStyling.js +8 -12
- package/dist/Dropdown/CommonStyling.js.map +1 -1
- package/dist/Dropdown/DropdownContent.cjs +15 -3
- package/dist/Dropdown/DropdownContent.cjs.map +1 -1
- package/dist/Dropdown/DropdownContent.d.ts +1 -0
- package/dist/Dropdown/DropdownContent.js +15 -3
- package/dist/Dropdown/DropdownContent.js.map +1 -1
- package/dist/Dropdown/DropdownFilter.cjs +1 -0
- package/dist/Dropdown/DropdownFilter.cjs.map +1 -1
- package/dist/Dropdown/DropdownFilter.js +1 -0
- package/dist/Dropdown/DropdownFilter.js.map +1 -1
- package/dist/Dropdown/index.cjs +8 -0
- package/dist/Dropdown/index.cjs.map +1 -1
- package/dist/Dropdown/index.d.ts +2 -1
- package/dist/Dropdown/index.js +2 -1
- package/dist/Dropdown/index.js.map +1 -1
- package/dist/InputFields/Checkbox.cjs +5 -4
- package/dist/InputFields/Checkbox.cjs.map +1 -1
- package/dist/InputFields/Checkbox.d.ts +6 -0
- package/dist/InputFields/Checkbox.js +3 -4
- package/dist/InputFields/Checkbox.js.map +1 -1
- package/dist/InputFields/RadioButton.cjs +3 -3
- package/dist/InputFields/RadioButton.cjs.map +1 -1
- package/dist/InputFields/RadioButton.js +2 -3
- package/dist/InputFields/RadioButton.js.map +1 -1
- package/dist/MenuItem/MenuItem.cjs +28 -13
- package/dist/MenuItem/MenuItem.cjs.map +1 -1
- package/dist/MenuItem/MenuItem.d.ts +2 -1
- package/dist/MenuItem/MenuItem.js +25 -11
- package/dist/MenuItem/MenuItem.js.map +1 -1
- package/dist/MenuItem/index.cjs +16 -0
- package/dist/MenuItem/index.cjs.map +1 -0
- package/dist/MenuItem/index.d.ts +1 -0
- package/dist/MenuItem/index.js +2 -0
- package/dist/MenuItem/index.js.map +1 -0
- package/dist/QuizButton/QuizButton.cjs +1 -3
- package/dist/QuizButton/QuizButton.cjs.map +1 -1
- package/dist/QuizButton/QuizButton.js +2 -4
- package/dist/QuizButton/QuizButton.js.map +1 -1
- package/dist/Table/Table.cjs +1 -1
- package/dist/Table/Table.cjs.map +1 -1
- package/dist/Table/Table.js +1 -1
- package/dist/Table/Table.js.map +1 -1
- package/dist/Table/TableBody.cjs +27 -21
- package/dist/Table/TableBody.cjs.map +1 -1
- package/dist/Table/TableBody.js +26 -21
- package/dist/Table/TableBody.js.map +1 -1
- package/dist/Table/TableFooter.cjs +7 -6
- package/dist/Table/TableFooter.cjs.map +1 -1
- package/dist/Table/TableFooter.js +6 -6
- package/dist/Table/TableFooter.js.map +1 -1
- package/dist/Table/TableHeaders.cjs +6 -4
- package/dist/Table/TableHeaders.cjs.map +1 -1
- package/dist/Table/TableHeaders.js +5 -4
- package/dist/Table/TableHeaders.js.map +1 -1
- package/dist/Table/TableStyles.cjs +9 -7
- package/dist/Table/TableStyles.cjs.map +1 -1
- package/dist/Table/TableStyles.js +8 -7
- package/dist/Table/TableStyles.js.map +1 -1
- package/dist/Table/TableTypes.d.ts +2 -0
- package/dist/common/InputStyling.cjs +1 -1
- package/dist/common/InputStyling.cjs.map +1 -1
- package/dist/common/InputStyling.js +1 -1
- package/dist/common/InputStyling.js.map +1 -1
- package/package.json +1 -1
|
@@ -9,9 +9,10 @@ import { CheckboxOff, CheckboxOn, CheckboxSemi } from '../icons/systemicons/Syst
|
|
|
9
9
|
import { COLORS, ComponentTextStyle } from '../styles';
|
|
10
10
|
import { Size } from '../types';
|
|
11
11
|
import { ComponentLStyling, ComponentMStyling, ComponentSStyling } from '../styles/typography';
|
|
12
|
+
import { defaultOnMouseDownHandler } from '../common';
|
|
12
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
14
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
-
var StyledCheckBox = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n width: 100%;\n min-height: 48px;\n min-width: 48px;\n\n ", "\n cursor: pointer;\n\n color: ", ";\n\n .pointerTransparent {\n pointer-events: none;\n }\n\n .checkbox-icon {\n margin: 6px;\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n height: 36px;\n min-width: 36px;\n border-radius: 50%;\n\n svg {\n color: ", ";\n }\n }\n\n .checkbox-label {\n user-select: none;\n cursor: inherit;\n }\n\n &.small {\n ", "\n .checkbox-label {\n padding-top: 14px;\n }\n }\n\n &.medium {\n ", "\n .checkbox-label {\n padding-top: 12px;\n }\n }\n\n &.large {\n ", "\n .checkbox-label {\n padding-top: 12px;\n }\n }\n\n &:not(.disabled):not(.readonly):focus {\n outline: none;\n\n .checkbox-icon {\n background-color: ", ";\n box-shadow: 0 0 8px ", ", 0px 4px 12px rgba(46, 127, 161, 0.25);\n\n svg {\n color: ", ";\n }\n }\n }\n\n &:not(.disabled):not(.readonly):hover {\n .checkbox-icon {\n background-color: ", ";\n\n svg {\n color: ", ";\n }\n }\n }\n\n &:not(.disabled):not(.readonly):active {\n .checkbox-icon {\n background: ", ";\n box-shadow: none;\n\n svg {\n color: ", ";\n }\n }\n }\n\n &.readonly{\n cursor: inherit;\n .checkbox-icon,\n .checkbox-label {\n pointer-events: none;\n }\n }\n \n &.disabled {\n box-shadow: none;\n cursor: not-allowed;\n\n color: ", ";\n\n .checkbox-icon,\n .checkbox-label {\n pointer-events: none;\n }\n\n .checkbox-icon{\n background-color: ", ";\n }\n\n .checkbox-icon svg {\n color: ", ";\n }\n }\n"])), function (props) {
|
|
15
|
+
export var StyledCheckBox = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n width: 100%;\n min-height: 48px;\n min-width: 48px;\n\n ", "\n cursor: pointer;\n\n color: ", ";\n\n .pointerTransparent {\n pointer-events: none;\n }\n\n .checkbox-icon {\n margin: 6px;\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n height: 36px;\n min-width: 36px;\n border-radius: 50%;\n\n svg {\n color: ", ";\n }\n }\n\n .checkbox-label {\n user-select: none;\n cursor: inherit;\n }\n\n &.small {\n ", "\n .checkbox-label {\n padding-top: 14px;\n }\n }\n\n &.medium {\n ", "\n .checkbox-label {\n padding-top: 12px;\n }\n }\n\n &.large {\n ", "\n .checkbox-label {\n padding-top: 12px;\n }\n }\n\n &:not(.disabled):not(.readonly):focus {\n outline: none;\n\n .checkbox-icon {\n background-color: ", ";\n box-shadow: 0 0 8px ", ", 0px 4px 12px rgba(46, 127, 161, 0.25);\n\n svg {\n color: ", ";\n }\n }\n }\n\n &:not(.disabled):not(.readonly):hover {\n .checkbox-icon {\n background-color: ", ";\n\n svg {\n color: ", ";\n }\n }\n }\n\n &:not(.disabled):not(.readonly):active {\n .checkbox-icon {\n background: ", ";\n box-shadow: none;\n\n svg {\n color: ", ";\n }\n }\n }\n\n &.readonly{\n cursor: inherit;\n .checkbox-icon,\n .checkbox-label {\n pointer-events: none;\n }\n }\n \n &.disabled {\n box-shadow: none;\n cursor: not-allowed;\n\n color: ", ";\n\n .checkbox-icon,\n .checkbox-label {\n pointer-events: none;\n }\n\n .checkbox-icon{\n background-color: ", ";\n }\n\n .checkbox-icon svg {\n color: ", ";\n }\n }\n"])), function (props) {
|
|
15
16
|
return props.margin ? "margin: ".concat(props.margin, ";") : '';
|
|
16
17
|
}, COLORS.black, function (props) {
|
|
17
18
|
return props.selected ? COLORS.primary_500 : props.showWarning ? COLORS.warning_400 : COLORS.neutral_600;
|
|
@@ -58,9 +59,7 @@ var Checkbox = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
58
59
|
margin: margin,
|
|
59
60
|
onClick: handleClick,
|
|
60
61
|
onKeyDown: onKeyPress,
|
|
61
|
-
onMouseDown:
|
|
62
|
-
return e.preventDefault();
|
|
63
|
-
},
|
|
62
|
+
onMouseDown: defaultOnMouseDownHandler,
|
|
64
63
|
children: [/*#__PURE__*/_jsx("div", {
|
|
65
64
|
id: id,
|
|
66
65
|
className: 'checkbox-icon',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/InputFields/Checkbox.tsx"],"names":["React","styled","CheckboxOff","CheckboxOn","CheckboxSemi","COLORS","ComponentTextStyle","Size","ComponentLStyling","ComponentMStyling","ComponentSStyling","StyledCheckBox","div","props","margin","black","selected","primary_500","showWarning","warning_400","neutral_600","Regular","white","primary_20","primary_700","primary_100","primary_800","neutral_300","Checkbox","forwardRef","ref","id","select","label","iconPointerEventsTransparent","disabled","size","semiSelected","children","readonly","tabIndexVal","onKeyPress","e","keyCode","handleClick","Medium","toString","toLowerCase","concat"
|
|
1
|
+
{"version":3,"sources":["../../src/InputFields/Checkbox.tsx"],"names":["React","styled","CheckboxOff","CheckboxOn","CheckboxSemi","COLORS","ComponentTextStyle","Size","ComponentLStyling","ComponentMStyling","ComponentSStyling","defaultOnMouseDownHandler","StyledCheckBox","div","props","margin","black","selected","primary_500","showWarning","warning_400","neutral_600","Regular","white","primary_20","primary_700","primary_100","primary_800","neutral_300","Checkbox","forwardRef","ref","id","select","label","iconPointerEventsTransparent","disabled","size","semiSelected","children","readonly","tabIndexVal","onKeyPress","e","keyCode","handleClick","Medium","toString","toLowerCase","concat"],"mappings":";;;;;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,OAAOC,MAAP,MAAmB,mB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components';\nimport {CheckboxOff, CheckboxOn, CheckboxSemi} from '../icons/systemicons/SystemIcons';\nimport {COLORS, ComponentTextStyle} from '../styles';\nimport { Size } from '../types';\nimport {ComponentLStyling, ComponentMStyling, ComponentSStyling} from '../styles/typography';\nimport {defaultOnMouseDownHandler} from '../common';\n\nexport const StyledCheckBox = styled.div<{ disabled?: boolean; showWarning?: boolean; selected?: boolean; margin?: string }>`\n display: flex;\n width: 100%;\n min-height: 48px;\n min-width: 48px;\n\n ${props => (props.margin ? `margin: ${props.margin};` : '')}\n cursor: pointer;\n\n color: ${COLORS.black};\n\n .pointerTransparent {\n pointer-events: none;\n }\n\n .checkbox-icon {\n margin: 6px;\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n height: 36px;\n min-width: 36px;\n border-radius: 50%;\n\n svg {\n color: ${props => (props.selected ? COLORS.primary_500 : props.showWarning ? COLORS.warning_400 : COLORS.neutral_600)};\n }\n }\n\n .checkbox-label {\n user-select: none;\n cursor: inherit;\n }\n\n &.small {\n ${ComponentSStyling(ComponentTextStyle.Regular, COLORS.black)}\n .checkbox-label {\n padding-top: 14px;\n }\n }\n\n &.medium {\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.black)}\n .checkbox-label {\n padding-top: 12px;\n }\n }\n\n &.large {\n ${ComponentLStyling(ComponentTextStyle.Regular, COLORS.black)}\n .checkbox-label {\n padding-top: 12px;\n }\n }\n\n &:not(.disabled):not(.readonly):focus {\n outline: none;\n\n .checkbox-icon {\n background-color: ${COLORS.white};\n box-shadow: 0 0 8px ${COLORS.primary_500}, 0px 4px 12px rgba(46, 127, 161, 0.25);\n\n svg {\n color: ${COLORS.neutral_600};\n }\n }\n }\n\n &:not(.disabled):not(.readonly):hover {\n .checkbox-icon {\n background-color: ${COLORS.primary_20};\n\n svg {\n color: ${COLORS.primary_700};\n }\n }\n }\n\n &:not(.disabled):not(.readonly):active {\n .checkbox-icon {\n background: ${COLORS.primary_100};\n box-shadow: none;\n\n svg {\n color: ${COLORS.primary_800};\n }\n }\n }\n\n &.readonly{\n cursor: inherit;\n .checkbox-icon,\n .checkbox-label {\n pointer-events: none;\n }\n }\n \n &.disabled {\n box-shadow: none;\n cursor: not-allowed;\n\n color: ${COLORS.neutral_300};\n\n .checkbox-icon,\n .checkbox-label {\n pointer-events: none;\n }\n\n .checkbox-icon{\n background-color: ${COLORS.white};\n }\n\n .checkbox-icon svg {\n color: ${COLORS.neutral_300};\n }\n }\n`;\n\ninterface Props {\n id?: string;\n selected: boolean;\n select?: (selected: boolean) => void;\n label?: string;\n showWarning?: boolean;\n disabled?: boolean;\n margin?: string;\n size?: Size;\n iconPointerEventsTransparent?: boolean;\n semiSelected?: boolean;\n readonly?: boolean;\n tabIndexVal?: number;\n}\n\nconst Checkbox = React.forwardRef<HTMLDivElement, Props>(({\n id,\n selected,\n select,\n label,\n showWarning,\n iconPointerEventsTransparent,\n disabled,\n margin,\n size,\n semiSelected,\n children,\n readonly,\n tabIndexVal\n }, ref) => {\n const onKeyPress = (e: any) => {\n if (e.keyCode === 13 && !disabled && !readonly) {\n select && select(!selected);\n }\n };\n\n const handleClick = () => {\n if (disabled || readonly) {\n return;\n }\n select && select(!selected);\n };\n\n size = size ?? Size.Medium;\n\n return (\n <StyledCheckBox key={id}\n ref={ref}\n disabled={disabled}\n className={size.toString().toLowerCase().concat(disabled ? ' disabled' : '').concat(readonly ? ' readonly' : '')}\n selected={selected}\n tabIndex={disabled || readonly ? -1 : (tabIndexVal ? tabIndexVal : 0)}\n showWarning={showWarning}\n margin={margin}\n onClick={handleClick}\n onKeyDown={onKeyPress}\n onMouseDown={defaultOnMouseDownHandler}>\n <div id={id} className={'checkbox-icon'}>\n {\n selected\n ? <CheckboxOn className={iconPointerEventsTransparent ? \"pointerTransparent\" : \"\"} size=\"24px\"/>\n : semiSelected\n ? <CheckboxSemi className={iconPointerEventsTransparent ? \"pointerTransparent\" : \"\"} size=\"24px\"/>\n : <CheckboxOff className={iconPointerEventsTransparent ? \"pointerTransparent\" : \"\"} size=\"24px\"/>\n }\n </div>\n {\n label &&\n (\n <label className={'checkbox-label'}\n htmlFor={id}>\n {label}\n </label>\n )\n }\n {\n !label &&\n <label className={'checkbox-label'}\n htmlFor={id}>\n {children}\n </label>\n }\n </StyledCheckBox>\n );\n});\n\nexport default Checkbox;\n"],"file":"Checkbox.js"}
|
|
@@ -25,6 +25,8 @@ var _types = require("../types");
|
|
|
25
25
|
|
|
26
26
|
var _typography = require("../styles/typography");
|
|
27
27
|
|
|
28
|
+
var _common = require("../common");
|
|
29
|
+
|
|
28
30
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
29
31
|
|
|
30
32
|
var _templateObject;
|
|
@@ -67,9 +69,7 @@ var RadioButton = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
67
69
|
onClick: function onClick() {
|
|
68
70
|
return !disabled && select(!selected);
|
|
69
71
|
},
|
|
70
|
-
onMouseDown:
|
|
71
|
-
return e.preventDefault();
|
|
72
|
-
},
|
|
72
|
+
onMouseDown: _common.defaultOnMouseDownHandler,
|
|
73
73
|
onKeyDown: onKeyPress,
|
|
74
74
|
disabled: disabled,
|
|
75
75
|
className: size.toString().toLowerCase().concat(disabled ? ' disabled' : ''),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/InputFields/RadioButton.tsx"],"names":["StyledRadioButton","styled","div","props","margin","COLORS","black","selected","primary_500","showWarning","warning_400","neutral_600","ComponentTextStyle","Regular","white","primary_20","primary_700","primary_100","primary_800","neutral_300","RadioButton","React","forwardRef","ref","id","label","additionalLabel","select","disabled","iconPointerEventsTransparent","size","tabIndexVal","onKeyPress","e","keyCode","Size","Medium","
|
|
1
|
+
{"version":3,"sources":["../../src/InputFields/RadioButton.tsx"],"names":["StyledRadioButton","styled","div","props","margin","COLORS","black","selected","primary_500","showWarning","warning_400","neutral_600","ComponentTextStyle","Regular","white","primary_20","primary_700","primary_100","primary_800","neutral_300","RadioButton","React","forwardRef","ref","id","label","additionalLabel","select","disabled","iconPointerEventsTransparent","size","tabIndexVal","onKeyPress","e","keyCode","Size","Medium","defaultOnMouseDownHandler","toString","toLowerCase","concat","undefined"],"mappings":";;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,IAAMA,iBAAiB,GAAGC,0BAAOC,GAAV,kzDAMnB,UAAAC,KAAK;AAAA,SAAKA,KAAK,CAACC,MAAN,qBAA0BD,KAAK,CAACC,MAAhC,SAA4C,EAAjD;AAAA,CANc,EASZC,eAAOC,KATK,EA0BR,UAAAH,KAAK;AAAA,SAAKA,KAAK,CAACI,QAAN,GAAiBF,eAAOG,WAAxB,GAAsCL,KAAK,CAACM,WAAN,GAAoBJ,eAAOK,WAA3B,GAAyCL,eAAOM,WAA3F;AAAA,CA1BG,EAwCf,qCAAoBC,2BAAmBC,OAAvC,EAAgDR,eAAOC,KAAvD,CAxCe,EA6CjB,mCAAkBM,2BAAmBC,OAArC,EAA8CR,eAAOC,KAArD,CA7CiB,EAoDjB,mCAAkBM,2BAAmBC,OAArC,EAA8CR,eAAOC,KAArD,CApDiB,EA2DjB,mCAAkBM,2BAAmBC,OAArC,EAA8CR,eAAOC,KAArD,CA3DiB,EAqEGD,eAAOS,KArEV,EAsEKT,eAAOG,WAtEZ,EAyENH,eAAOM,WAzED,EAgFGN,eAAOU,UAhFV,EAmFNV,eAAOW,WAnFD,EA0FHX,eAAOY,WA1FJ,EA8FNZ,eAAOa,WA9FD,EAuGVb,eAAOc,WAvGG,EA+GGd,eAAOS,KA/GV,EAmHRT,eAAOc,WAnHC,CAAvB;;AAsIA,IAAMC,WAAW,gBAAGC,KAAK,CAACC,UAAN,CAAwC,gBAYlDC,GAZkD,EAY1C;AAAA;;AAAA,MAXhBC,EAWgB,QAXhBA,EAWgB;AAAA,MAVhBjB,QAUgB,QAVhBA,QAUgB;AAAA,MAThBkB,KASgB,QAThBA,KASgB;AAAA,MARhBC,eAQgB,QARh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AAe,QAAA,SAAS,EAAEsB,4BAA4B,GAAG,oBAAH,GAA0B,EAAhF;AAAoF,QAAA,IAAI,EAAC;AAAzF,QADhB,EAEI,CAACtB,QAAD,iBAAa,qBAAC,2BAAD;AAAgB,QAAA,SAAS,EAAEsB,4BAA4B,GAAG,oBAAH,GAA0B,EAAjF;AAAqF,QAAA,IAAI,EAAC;AAA1F,QAFjB;AAAA,MAVF,eAcE;AAAK,MAAA,SAAS,EAAE,oBAAhB;AAAA,iBACGJ,KAAK,iBAAI;AAAO,QAAA,OAAO,EAAED,EAAhB;AAAA,kBAAqBC;AAArB,QADZ,EAEGC,eAAe,KAAKe,SAApB,iBAAiC;AAAA,kBAAOf;AAAP,QAFpC;AAAA,MAdF;AAAA,KAAwBF,EAAxB,CADF;AAqBD,CA1CmB,CAApB;;AAbEA,EAAAA,E;AACAjB,EAAAA,Q;AACAoB,EAAAA,M;AACAF,EAAAA,K;AACAC,EAAAA,e;AACAjB,EAAAA,W;AACAmB,EAAAA,Q;AACAC,EAAAA,4B;AACAzB,EAAAA,M;AAEA2B,EAAAA,W;;eA+CaX,W","sourcesContent":["import * as React from 'react';\nimport styled, {css} from 'styled-components';\nimport {RadioButtonOff, RadioButtonOn} from '../icons/systemicons/SystemIcons';\nimport {COLORS, ComponentTextStyle} from '../styles';\nimport { Size } from '../types';\nimport {ComponentLStyling, ComponentMStyling, ComponentSStyling, ComponentXXSStyling} from '../styles/typography';\nimport {defaultOnMouseDownHandler} from '../common';\n\nconst StyledRadioButton = styled.div<{ margin?: string, disabled?: boolean, showWarning?: boolean, selected?: boolean }>`\n display: flex;\n width: 100%;\n min-height: 48px;\n min-width: 48px;\n\n ${props => (props.margin ? `margin: ${props.margin};` : '')}\n cursor: pointer;\n \n color: ${COLORS.black};\n\n .pointerTransparent {\n pointer-events: none;\n }\n\n .radio-button-icon {\n margin: 6px;\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n height: 36px;\n min-width: 36px;\n border-radius: 50%;\n\n svg {\n color: ${props => (props.selected ? COLORS.primary_500 : props.showWarning ? COLORS.warning_400 : COLORS.neutral_600)};\n }\n }\n\n .radio-button-label {\n user-select: none;\n display: flex;\n flex-direction: column;\n\n label{\n cursor: inherit;\n }\n\n span {\n ${ComponentXXSStyling(ComponentTextStyle.Regular, COLORS.black)}\n }\n }\n\n &.small {\n ${ComponentSStyling(ComponentTextStyle.Regular, COLORS.black)}\n .radio-button-label {\n padding-top: 14px;\n }\n }\n\n &.medium {\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.black)}\n .radio-button-label {\n padding-top: 12px;\n }\n }\n\n &.large {\n ${ComponentLStyling(ComponentTextStyle.Regular, COLORS.black)}\n .radio-button-label {\n padding-top: 12px;\n }\n }\n\n &:not(.disabled):focus {\n outline: none;\n\n .radio-button-icon {\n background-color: ${COLORS.white};\n box-shadow: 0 0 8px ${COLORS.primary_500}, 0px 4px 12px rgba(46, 127, 161, 0.25);\n\n svg {\n color: ${COLORS.neutral_600};\n }\n }\n }\n\n &:not(.disabled):hover {\n .radio-button-icon {\n background-color: ${COLORS.primary_20};\n\n svg {\n color: ${COLORS.primary_700};\n }\n }\n }\n\n &:not(.disabled):active {\n .radio-button-icon {\n background: ${COLORS.primary_100};\n box-shadow: none;\n\n svg {\n color: ${COLORS.primary_800};\n }\n }\n }\n\n &.disabled {\n box-shadow: none;\n cursor: not-allowed;\n\n color: ${COLORS.neutral_300};\n\n .radio-button-icon,\n .radio-button-label {\n pointer-events: none;\n }\n\n .radio-button-icon{\n background-color: ${COLORS.white};\n }\n \n .radio-button-icon svg {\n color: ${COLORS.neutral_300};\n }\n }\n`;\n\ninterface Props {\n id: string;\n selected: boolean;\n select: (selected: boolean) => void;\n label?: string;\n additionalLabel?: string;\n showWarning?: boolean;\n disabled?: boolean;\n iconPointerEventsTransparent?: boolean;\n margin?: string;\n size?: Size;\n tabIndexVal?: number;\n}\n\nconst RadioButton = React.forwardRef<HTMLDivElement, Props>(({\n id,\n selected,\n label,\n additionalLabel,\n showWarning,\n select,\n disabled,\n margin,\n iconPointerEventsTransparent,\n size,\n tabIndexVal\n}: Props, ref) => {\n const onKeyPress = (e: any) => {\n if (e.keyCode === 13 && !disabled) {\n select(!selected);\n }\n };\n\n size = size ?? Size.Medium;\n\n return (\n <StyledRadioButton key={id} margin={margin}\n ref={ref}\n onClick={() => !disabled && select(!selected)}\n onMouseDown={defaultOnMouseDownHandler}\n onKeyDown={onKeyPress}\n disabled={disabled}\n className={size.toString().toLowerCase().concat(disabled ? ' disabled' : '')}\n tabIndex={disabled ? -1 : (tabIndexVal ? tabIndexVal : 0)}\n showWarning={showWarning}\n selected={selected}>\n <div className={'radio-button-icon'} id={id}>\n { selected && <RadioButtonOn className={iconPointerEventsTransparent ? \"pointerTransparent\" : \"\"} size=\"24px\"/>}\n { !selected && <RadioButtonOff className={iconPointerEventsTransparent ? \"pointerTransparent\" : \"\"} size=\"24px\"/>}\n </div>\n <div className={'radio-button-label'}>\n {label && <label htmlFor={id}>{label}</label>}\n {additionalLabel !== undefined && <span>{additionalLabel}</span>}\n </div>\n </StyledRadioButton>\n );\n});\n\nexport default RadioButton;\n"],"file":"RadioButton.cjs"}
|
|
@@ -9,6 +9,7 @@ import { RadioButtonOff, RadioButtonOn } from '../icons/systemicons/SystemIcons'
|
|
|
9
9
|
import { COLORS, ComponentTextStyle } from '../styles';
|
|
10
10
|
import { Size } from '../types';
|
|
11
11
|
import { ComponentLStyling, ComponentMStyling, ComponentSStyling, ComponentXXSStyling } from '../styles/typography';
|
|
12
|
+
import { defaultOnMouseDownHandler } from '../common';
|
|
12
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
14
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
15
|
var StyledRadioButton = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n width: 100%;\n min-height: 48px;\n min-width: 48px;\n\n ", "\n cursor: pointer;\n \n color: ", ";\n\n .pointerTransparent {\n pointer-events: none;\n }\n\n .radio-button-icon {\n margin: 6px;\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n height: 36px;\n min-width: 36px;\n border-radius: 50%;\n\n svg {\n color: ", ";\n }\n }\n\n .radio-button-label {\n user-select: none;\n display: flex;\n flex-direction: column;\n\n label{\n cursor: inherit;\n }\n\n span {\n ", "\n }\n }\n\n &.small {\n ", "\n .radio-button-label {\n padding-top: 14px;\n }\n }\n\n &.medium {\n ", "\n .radio-button-label {\n padding-top: 12px;\n }\n }\n\n &.large {\n ", "\n .radio-button-label {\n padding-top: 12px;\n }\n }\n\n &:not(.disabled):focus {\n outline: none;\n\n .radio-button-icon {\n background-color: ", ";\n box-shadow: 0 0 8px ", ", 0px 4px 12px rgba(46, 127, 161, 0.25);\n\n svg {\n color: ", ";\n }\n }\n }\n\n &:not(.disabled):hover {\n .radio-button-icon {\n background-color: ", ";\n\n svg {\n color: ", ";\n }\n }\n }\n\n &:not(.disabled):active {\n .radio-button-icon {\n background: ", ";\n box-shadow: none;\n\n svg {\n color: ", ";\n }\n }\n }\n\n &.disabled {\n box-shadow: none;\n cursor: not-allowed;\n\n color: ", ";\n\n .radio-button-icon,\n .radio-button-label {\n pointer-events: none;\n }\n\n .radio-button-icon{\n background-color: ", ";\n }\n \n .radio-button-icon svg {\n color: ", ";\n }\n }\n"])), function (props) {
|
|
@@ -44,9 +45,7 @@ var RadioButton = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
44
45
|
onClick: function onClick() {
|
|
45
46
|
return !disabled && select(!selected);
|
|
46
47
|
},
|
|
47
|
-
onMouseDown:
|
|
48
|
-
return e.preventDefault();
|
|
49
|
-
},
|
|
48
|
+
onMouseDown: defaultOnMouseDownHandler,
|
|
50
49
|
onKeyDown: onKeyPress,
|
|
51
50
|
disabled: disabled,
|
|
52
51
|
className: size.toString().toLowerCase().concat(disabled ? ' disabled' : ''),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/InputFields/RadioButton.tsx"],"names":["React","styled","RadioButtonOff","RadioButtonOn","COLORS","ComponentTextStyle","Size","ComponentLStyling","ComponentMStyling","ComponentSStyling","ComponentXXSStyling","StyledRadioButton","div","props","margin","black","selected","primary_500","showWarning","warning_400","neutral_600","Regular","white","primary_20","primary_700","primary_100","primary_800","neutral_300","RadioButton","forwardRef","ref","id","label","additionalLabel","select","disabled","iconPointerEventsTransparent","size","tabIndexVal","onKeyPress","e","keyCode","Medium","
|
|
1
|
+
{"version":3,"sources":["../../src/InputFields/RadioButton.tsx"],"names":["React","styled","RadioButtonOff","RadioButtonOn","COLORS","ComponentTextStyle","Size","ComponentLStyling","ComponentMStyling","ComponentSStyling","ComponentXXSStyling","defaultOnMouseDownHandler","StyledRadioButton","div","props","margin","black","selected","primary_500","showWarning","warning_400","neutral_600","Regular","white","primary_20","primary_700","primary_100","primary_800","neutral_300","RadioButton","forwardRef","ref","id","label","additionalLabel","select","disabled","iconPointerEventsTransparent","size","tabIndexVal","onKeyPress","e","keyCode","Medium","toString","toLowerCase","concat","undefined"],"mappings":";;;;;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,OAAOC,MAAP,MAA0B,mBAA1B;AACA,SAAQC,cAAR,EAAwBC,aAAxB,QAA4C,kCAA5C;AACA,SAAQC,MAAR,EAAgBC,kBAAhB,QAAyC,WAAzC;AACA,SAASC,IAAT,QAAqB,UAArB;AACA,SAAQC,iBAAR,EAA2BC,iBAA3B,EAA8CC,iBAA9C,EAAiEC,mBAAjE,QAA2F,sBAA3F;AACA,SAAQC,yBAAR,QAAwC,WAAxC;;;AAEA,IAAMC,iBAAiB,GAAGX,MAAM,CAACY,GAAV,oyDAMnB,UAAAC,KAAK;AAAA,SAAKA,KAAK,CAACC,MAAN,qBAA0BD,KAAK,CAACC,MAAhC,SAA4C,EAAjD;AAAA,CANc,EASZX,MAAM,CAACY,KATK,EA0BR,UAAAF,KAAK;AAAA,SAAKA,KAAK,CAACG,QAAN,GAAiBb,M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AA,SAAS,EAAE,oBAAhB;AAAA,iBACGJ,KAAK,iBAAI;AAAO,QAAA,OAAO,EAAED,EAAhB;AAAA,kBAAqBC;AAArB,QADZ,EAEGC,eAAe,KAAKa,SAApB,iBAAiC;AAAA,kBAAOb;AAAP,QAFpC;AAAA,MAdF;AAAA,KAAwBF,EAAxB,CADF;AAqBD,CA1CmB,CAApB;;AAbEA,EAAAA,E;AACAf,EAAAA,Q;AACAkB,EAAAA,M;AACAF,EAAAA,K;AACAC,EAAAA,e;AACAf,EAAAA,W;AACAiB,EAAAA,Q;AACAC,EAAAA,4B;AACAtB,EAAAA,M;AAEAwB,EAAAA,W;;AA+CF,eAAeV,WAAf","sourcesContent":["import * as React from 'react';\nimport styled, {css} from 'styled-components';\nimport {RadioButtonOff, RadioButtonOn} from '../icons/systemicons/SystemIcons';\nimport {COLORS, ComponentTextStyle} from '../styles';\nimport { Size } from '../types';\nimport {ComponentLStyling, ComponentMStyling, ComponentSStyling, ComponentXXSStyling} from '../styles/typography';\nimport {defaultOnMouseDownHandler} from '../common';\n\nconst StyledRadioButton = styled.div<{ margin?: string, disabled?: boolean, showWarning?: boolean, selected?: boolean }>`\n display: flex;\n width: 100%;\n min-height: 48px;\n min-width: 48px;\n\n ${props => (props.margin ? `margin: ${props.margin};` : '')}\n cursor: pointer;\n \n color: ${COLORS.black};\n\n .pointerTransparent {\n pointer-events: none;\n }\n\n .radio-button-icon {\n margin: 6px;\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n height: 36px;\n min-width: 36px;\n border-radius: 50%;\n\n svg {\n color: ${props => (props.selected ? COLORS.primary_500 : props.showWarning ? COLORS.warning_400 : COLORS.neutral_600)};\n }\n }\n\n .radio-button-label {\n user-select: none;\n display: flex;\n flex-direction: column;\n\n label{\n cursor: inherit;\n }\n\n span {\n ${ComponentXXSStyling(ComponentTextStyle.Regular, COLORS.black)}\n }\n }\n\n &.small {\n ${ComponentSStyling(ComponentTextStyle.Regular, COLORS.black)}\n .radio-button-label {\n padding-top: 14px;\n }\n }\n\n &.medium {\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.black)}\n .radio-button-label {\n padding-top: 12px;\n }\n }\n\n &.large {\n ${ComponentLStyling(ComponentTextStyle.Regular, COLORS.black)}\n .radio-button-label {\n padding-top: 12px;\n }\n }\n\n &:not(.disabled):focus {\n outline: none;\n\n .radio-button-icon {\n background-color: ${COLORS.white};\n box-shadow: 0 0 8px ${COLORS.primary_500}, 0px 4px 12px rgba(46, 127, 161, 0.25);\n\n svg {\n color: ${COLORS.neutral_600};\n }\n }\n }\n\n &:not(.disabled):hover {\n .radio-button-icon {\n background-color: ${COLORS.primary_20};\n\n svg {\n color: ${COLORS.primary_700};\n }\n }\n }\n\n &:not(.disabled):active {\n .radio-button-icon {\n background: ${COLORS.primary_100};\n box-shadow: none;\n\n svg {\n color: ${COLORS.primary_800};\n }\n }\n }\n\n &.disabled {\n box-shadow: none;\n cursor: not-allowed;\n\n color: ${COLORS.neutral_300};\n\n .radio-button-icon,\n .radio-button-label {\n pointer-events: none;\n }\n\n .radio-button-icon{\n background-color: ${COLORS.white};\n }\n \n .radio-button-icon svg {\n color: ${COLORS.neutral_300};\n }\n }\n`;\n\ninterface Props {\n id: string;\n selected: boolean;\n select: (selected: boolean) => void;\n label?: string;\n additionalLabel?: string;\n showWarning?: boolean;\n disabled?: boolean;\n iconPointerEventsTransparent?: boolean;\n margin?: string;\n size?: Size;\n tabIndexVal?: number;\n}\n\nconst RadioButton = React.forwardRef<HTMLDivElement, Props>(({\n id,\n selected,\n label,\n additionalLabel,\n showWarning,\n select,\n disabled,\n margin,\n iconPointerEventsTransparent,\n size,\n tabIndexVal\n}: Props, ref) => {\n const onKeyPress = (e: any) => {\n if (e.keyCode === 13 && !disabled) {\n select(!selected);\n }\n };\n\n size = size ?? Size.Medium;\n\n return (\n <StyledRadioButton key={id} margin={margin}\n ref={ref}\n onClick={() => !disabled && select(!selected)}\n onMouseDown={defaultOnMouseDownHandler}\n onKeyDown={onKeyPress}\n disabled={disabled}\n className={size.toString().toLowerCase().concat(disabled ? ' disabled' : '')}\n tabIndex={disabled ? -1 : (tabIndexVal ? tabIndexVal : 0)}\n showWarning={showWarning}\n selected={selected}>\n <div className={'radio-button-icon'} id={id}>\n { selected && <RadioButtonOn className={iconPointerEventsTransparent ? \"pointerTransparent\" : \"\"} size=\"24px\"/>}\n { !selected && <RadioButtonOff className={iconPointerEventsTransparent ? \"pointerTransparent\" : \"\"} size=\"24px\"/>}\n </div>\n <div className={'radio-button-label'}>\n {label && <label htmlFor={id}>{label}</label>}\n {additionalLabel !== undefined && <span>{additionalLabel}</span>}\n </div>\n </StyledRadioButton>\n );\n});\n\nexport default RadioButton;\n"],"file":"RadioButton.js"}
|
|
@@ -7,7 +7,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
|
-
exports.default = exports.
|
|
10
|
+
exports.default = exports.LockedIconContainer = exports.ItemLabel = exports.ItemIcon = exports.ItemContent = exports.DropdownButtonCSS = exports.DropdownButton = void 0;
|
|
11
11
|
|
|
12
12
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
13
13
|
|
|
@@ -19,6 +19,8 @@ var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
|
19
19
|
|
|
20
20
|
var _styles = require("../styles");
|
|
21
21
|
|
|
22
|
+
var _SystemIcons = require("../icons/systemicons/SystemIcons");
|
|
23
|
+
|
|
22
24
|
var _types = require("../types");
|
|
23
25
|
|
|
24
26
|
var _typography = require("../styles/typography");
|
|
@@ -47,16 +49,16 @@ var ItemIcon = _styledComponents.default.div(_templateObject3 || (_templateObjec
|
|
|
47
49
|
|
|
48
50
|
exports.ItemIcon = ItemIcon;
|
|
49
51
|
|
|
50
|
-
var
|
|
52
|
+
var LockedIconContainer = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n\n"])));
|
|
51
53
|
|
|
52
|
-
exports.
|
|
54
|
+
exports.LockedIconContainer = LockedIconContainer;
|
|
53
55
|
|
|
54
|
-
var ItemContent = _styledComponents.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n margin: auto 0 auto 16px;\n display: flex;\n align-items: center;\n\n ", " {\n flex: 1 0 calc(100% - 40px)
|
|
56
|
+
var ItemContent = _styledComponents.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n margin: auto 0 auto 16px;\n display: flex;\n align-items: center;\n flex-grow: 2;\n\n ", " {\n flex: 1 0 calc(100% - 40px);\n display: flex;\n flex-direction: row;\n align-items: center;\n }\n\n ", " {\n margin-right: 6px;\n svg {\n display: block;\n margin: auto;\n }\n }\n\n ", " {\n flex-grow: 2;\n\n .extraMargin {\n margin-left: calc(100% - 24px);\n }\n }\n"])), ItemLabel, ItemIcon, LockedIconContainer);
|
|
55
57
|
|
|
56
58
|
exports.ItemContent = ItemContent;
|
|
57
59
|
|
|
58
60
|
var DropdownButtonCSS = function DropdownButtonCSS(size) {
|
|
59
|
-
return (0, _styledComponents.css)(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n ", "\n ", "\n ", "\n\n position: relative;\n text-decoration: none;\n display: flex;\n flex-direction: row;\n align-items: center;\n min-height: ", ";\n background-color: ", ";\n border: none;\n cursor: pointer;\n background: transparent;\n width: 100%;\n text-align: left;\n\n span {\n margin: auto 0 auto 16px;\n line-height: 48px;\n }\n\n ", ";\n\n &.active {\n background: ", ";\n\n &::after {\n position: absolute;\n content: ' ';\n width: 4px;\n top:
|
|
61
|
+
return (0, _styledComponents.css)(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n ", "\n ", "\n ", "\n\n position: relative;\n text-decoration: none;\n display: flex;\n flex-direction: row;\n align-items: center;\n min-height: ", ";\n background-color: ", ";\n border: none;\n cursor: pointer;\n background: transparent;\n width: 100%;\n text-align: left;\n\n span {\n margin: auto 0 auto 16px;\n line-height: 48px;\n }\n\n ", ";\n\n &.active {\n background: ", ";\n\n &::after {\n position: absolute;\n content: ' ';\n width: 4px;\n top: 6px;\n bottom: 6px;\n left: 4px;\n background-color: ", ";\n\n border-radius: 4px;\n }\n }\n\n &:disabled, &.disabled-state {\n background-color: transparent;\n cursor: not-allowed;\n color: ", ";\n }\n\n &.locked {\n background-color: transparent;\n cursor: not-allowed;\n color: ", ";\n }\n\n &.active:hover, &.active-hover-state {\n background-color: ", ";\n\n svg {\n color: ", ";\n }\n\n &::after {\n background-color: ", ";\n }\n }\n\n &.active:active, &.active-active-state {\n background-color: ", ";\n\n svg {\n color: ", ";\n }\n\n &::after {\n background-color: ", ";\n }\n }\n "])), size == _types.Size.Small && (0, _typography.ComponentSStyling)(_styles.ComponentTextStyle.Regular, _styles.COLORS.neutral_600), size == _types.Size.Medium && (0, _typography.ComponentMStyling)(_styles.ComponentTextStyle.Regular, _styles.COLORS.neutral_600), size == _types.Size.Large && (0, _typography.ComponentLStyling)(_styles.ComponentTextStyle.Regular, _styles.COLORS.neutral_600), size == _types.Size.Large ? '64px' : size == _types.Size.Medium ? '56px' : '48px', _styles.COLORS.white, _common.CommonInteractionStyling, _styles.COLORS.neutral_20, _styles.COLORS.primary_500, _styles.COLORS.neutral_200, _styles.COLORS.neutral_500, _styles.COLORS.primary_20, _styles.COLORS.primary_600, _styles.COLORS.primary_500, _styles.COLORS.primary_100, _styles.COLORS.primary_800, _styles.COLORS.primary_500);
|
|
60
62
|
};
|
|
61
63
|
|
|
62
64
|
exports.DropdownButtonCSS = DropdownButtonCSS;
|
|
@@ -68,14 +70,15 @@ var MenuItem = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
68
70
|
onClickHandler = _ref.onClickHandler,
|
|
69
71
|
key = _ref.key,
|
|
70
72
|
size = _ref.size,
|
|
73
|
+
className = _ref.className,
|
|
71
74
|
id = _ref.id;
|
|
72
75
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(DropdownButton, {
|
|
73
76
|
type: "button",
|
|
74
77
|
size: size,
|
|
75
|
-
disabled: item.disabled,
|
|
78
|
+
disabled: item.disabled || item.locked,
|
|
76
79
|
ref: ref,
|
|
77
80
|
onClick: onClickHandler,
|
|
78
|
-
className: (item.showDividerAbove ? 'show-divider-above' : '') + ' ' + (active ? 'active' : ''),
|
|
81
|
+
className: className + ' ' + (item.locked ? 'locked' : '') + ' ' + (item.showDividerAbove ? 'show-divider-above' : '') + ' ' + (active ? 'active' : ''),
|
|
79
82
|
id: id,
|
|
80
83
|
children: [item.showDividerAbove && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
81
84
|
className: "divider"
|
|
@@ -83,11 +86,22 @@ var MenuItem = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
83
86
|
children: [item.icon && /*#__PURE__*/(0, _jsxRuntime.jsx)(ItemIcon, {
|
|
84
87
|
children: item.icon
|
|
85
88
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(ItemLabel, {
|
|
86
|
-
children: [
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
},
|
|
90
|
-
|
|
89
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
90
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
91
|
+
children: (_item$displayLabel = item.displayLabel) !== null && _item$displayLabel !== void 0 ? _item$displayLabel : item.value
|
|
92
|
+
}), item.noteLabel && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
93
|
+
style: {
|
|
94
|
+
fontSize: '12px',
|
|
95
|
+
lineHeight: '16px'
|
|
96
|
+
},
|
|
97
|
+
children: item.noteLabel
|
|
98
|
+
})]
|
|
99
|
+
}), item.locked && /*#__PURE__*/(0, _jsxRuntime.jsx)(LockedIconContainer, {
|
|
100
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SystemIcons.LockedOn, {
|
|
101
|
+
color: _styles.COLORS.neutral_400,
|
|
102
|
+
className: "extraMargin",
|
|
103
|
+
size: "24px"
|
|
104
|
+
})
|
|
91
105
|
})]
|
|
92
106
|
})]
|
|
93
107
|
})]
|
|
@@ -97,7 +111,8 @@ MenuItem.propTypes = {
|
|
|
97
111
|
onClickHandler: _propTypes.default.func.isRequired,
|
|
98
112
|
active: _propTypes.default.bool.isRequired,
|
|
99
113
|
id: _propTypes.default.string.isRequired,
|
|
100
|
-
key: _propTypes.default.string.isRequired
|
|
114
|
+
key: _propTypes.default.string.isRequired,
|
|
115
|
+
className: _propTypes.default.string
|
|
101
116
|
};
|
|
102
117
|
var _default = MenuItem;
|
|
103
118
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/MenuItem/MenuItem.tsx"],"names":["DropdownButton","styled","button","props","DropdownButtonCSS","size","ItemLabel","div","ItemIcon","
|
|
1
|
+
{"version":3,"sources":["../../src/MenuItem/MenuItem.tsx"],"names":["DropdownButton","styled","button","props","DropdownButtonCSS","size","ItemLabel","div","ItemIcon","LockedIconContainer","ItemContent","css","Size","Small","ComponentTextStyle","Regular","COLORS","neutral_600","Medium","Large","white","CommonInteractionStyling","neutral_20","primary_500","neutral_200","neutral_500","primary_20","primary_600","primary_100","primary_800","MenuItem","React","forwardRef","ref","active","item","onClickHandler","key","className","id","disabled","locked","showDividerAbove","icon","displayLabel","value","noteLabel","fontSize","lineHeight","neutral_400"],"mappings":";;;;;;;;;;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;;;;;;;AAYO,IAAMA,cAAc,GAAGC,0BAAOC,MAAV,8FACvB,UAACC,KAAD;AAAA,SAAWC,iBAAiB,CAACD,KAAK,CAACE,IAAP,CAA5B;AAAA,CADuB,CAApB;;;;AAIA,IAAMC,SAAS,GAAGL,0BAAOM,GAAV,qFAAf;;;;AACA,IAAMC,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,YAAA,IAAI,EAAC;AAAlE;AADc,UALpB;AAAA,QAFF;AAAA,MAVJ;AAAA,KAOSZ,GAPT,CADF;AAyBD,CAjCgB,CAAjB;;AAlIGD,EAAAA,c;AACAF,EAAAA,M;AACAK,EAAAA,E;AACAF,EAAAA,G;AAEAC,EAAAA,S;;eAgKYR,Q","sourcesContent":["import * as React from 'react';\nimport {Link} from 'react-router-dom';\nimport styled, { css } from 'styled-components';\nimport {BREAKPOINTS, COLORS, ComponentTextStyle} from '../styles';\nimport {ChevronRight, LockedOn} from '../icons/systemicons/SystemIcons';\nimport {Product, Size} from '../types';\nimport {ComponentLStyling, ComponentMStyling, ComponentSStyling} from '../styles/typography';\nimport { DropdownItem } from '../Dropdown/DropdownContent';\nimport { CommonInteractionStyling } from '../common';\n\nexport interface MenuItemProps {\n item: DropdownItem;\n onClickHandler: (e: any) => void;\n active: boolean;\n id: string;\n key: string;\n size?: Size;\n className?: string;\n}\n\nexport const DropdownButton = styled.button<{ size?: Size }>`\n ${(props) => DropdownButtonCSS(props.size)}\n`;\n\nexport const ItemLabel = styled.div``;\nexport const ItemIcon = styled.div``;\n\nexport const LockedIconContainer = styled.div`\n\n`;\n\nexport const ItemContent = styled.div`\n margin: auto 0 auto 16px;\n display: flex;\n align-items: center;\n flex-grow: 2;\n\n ${ItemLabel} {\n flex: 1 0 calc(100% - 40px);\n display: flex;\n flex-direction: row;\n align-items: center;\n }\n\n ${ItemIcon} {\n margin-right: 6px;\n svg {\n display: block;\n margin: auto;\n }\n }\n\n ${LockedIconContainer} {\n flex-grow: 2;\n\n .extraMargin {\n margin-left: calc(100% - 24px);\n }\n }\n`;\n\n\nexport const DropdownButtonCSS = (size?: Size) => {\n return css`\n ${size == Size.Small && ComponentSStyling(ComponentTextStyle.Regular, COLORS.neutral_600)}\n ${size == Size.Medium && ComponentMStyling(ComponentTextStyle.Regular, COLORS.neutral_600)}\n ${size == Size.Large && ComponentLStyling(ComponentTextStyle.Regular, COLORS.neutral_600)}\n\n position: relative;\n text-decoration: none;\n display: flex;\n flex-direction: row;\n align-items: center;\n min-height: ${size == Size.Large ? '64px' : size == Size.Medium ? '56px' : '48px'};\n background-color: ${COLORS.white};\n border: none;\n cursor: pointer;\n background: transparent;\n width: 100%;\n text-align: left;\n\n span {\n margin: auto 0 auto 16px;\n line-height: 48px;\n }\n\n ${CommonInteractionStyling};\n\n &.active {\n background: ${COLORS.neutral_20};\n\n &::after {\n position: absolute;\n content: ' ';\n width: 4px;\n top: 6px;\n bottom: 6px;\n left: 4px;\n background-color: ${COLORS.primary_500};\n\n border-radius: 4px;\n }\n }\n\n &:disabled, &.disabled-state {\n background-color: transparent;\n cursor: not-allowed;\n color: ${COLORS.neutral_200};\n }\n\n &.locked {\n background-color: transparent;\n cursor: not-allowed;\n color: ${COLORS.neutral_500};\n }\n\n &.active:hover, &.active-hover-state {\n background-color: ${COLORS.primary_20};\n\n svg {\n color: ${COLORS.primary_600};\n }\n\n &::after {\n background-color: ${COLORS.primary_500};\n }\n }\n\n &.active:active, &.active-active-state {\n background-color: ${COLORS.primary_100};\n\n svg {\n color: ${COLORS.primary_800};\n }\n\n &::after {\n background-color: ${COLORS.primary_500};\n }\n }\n `;\n};\n\nconst MenuItem = React.forwardRef<HTMLButtonElement, MenuItemProps>(({\n active,\n item,\n onClickHandler,\n key,\n size,\n className,\n id }: MenuItemProps, ref) => {\n return (\n <DropdownButton\n type=\"button\"\n size={size}\n disabled={item.disabled || item.locked}\n ref={ref}\n onClick={onClickHandler}\n className={ className + ' ' + (item.locked ? 'locked' : '') + ' ' + (item.showDividerAbove ? 'show-divider-above' : '') + ' ' + (active ? 'active' : '')}\n key={key}\n id={id}>\n {item.showDividerAbove && <div className=\"divider\" />}\n <ItemContent>\n {item.icon && <ItemIcon>{item.icon}</ItemIcon>}\n <ItemLabel>\n <div>\n <div>{item.displayLabel ?? item.value}</div>\n {item.noteLabel && <div style={{ fontSize: '12px', lineHeight: '16px' }}>{item.noteLabel}</div>}\n </div>\n {item.locked && <LockedIconContainer>\n <LockedOn color={COLORS.neutral_400} className=\"extraMargin\" size=\"24px\" />\n </LockedIconContainer>}\n </ItemLabel>\n </ItemContent>\n </DropdownButton>\n );\n});\n\nexport default MenuItem;\n"],"file":"MenuItem.cjs"}
|
|
@@ -8,13 +8,14 @@ export interface MenuItemProps {
|
|
|
8
8
|
id: string;
|
|
9
9
|
key: string;
|
|
10
10
|
size?: Size;
|
|
11
|
+
className?: string;
|
|
11
12
|
}
|
|
12
13
|
export declare const DropdownButton: import("styled-components").StyledComponent<"button", any, {
|
|
13
14
|
size?: Size | undefined;
|
|
14
15
|
}, never>;
|
|
15
16
|
export declare const ItemLabel: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
16
17
|
export declare const ItemIcon: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
17
|
-
export declare const
|
|
18
|
+
export declare const LockedIconContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
18
19
|
export declare const ItemContent: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
19
20
|
export declare const DropdownButtonCSS: (size?: Size | undefined) => import("styled-components").FlattenSimpleInterpolation;
|
|
20
21
|
declare const MenuItem: React.ForwardRefExoticComponent<MenuItemProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -6,6 +6,7 @@ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _temp
|
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import styled, { css } from 'styled-components';
|
|
8
8
|
import { COLORS, ComponentTextStyle } from '../styles';
|
|
9
|
+
import { LockedOn } from '../icons/systemicons/SystemIcons';
|
|
9
10
|
import { Size } from '../types';
|
|
10
11
|
import { ComponentLStyling, ComponentMStyling, ComponentSStyling } from '../styles/typography';
|
|
11
12
|
import { CommonInteractionStyling } from '../common';
|
|
@@ -16,10 +17,10 @@ export var DropdownButton = styled.button(_templateObject || (_templateObject =
|
|
|
16
17
|
});
|
|
17
18
|
export var ItemLabel = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral([""])));
|
|
18
19
|
export var ItemIcon = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral([""])));
|
|
19
|
-
export var
|
|
20
|
-
export var ItemContent = styled.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n margin: auto 0 auto 16px;\n display: flex;\n align-items: center;\n\n ", " {\n flex: 1 0 calc(100% - 40px)
|
|
20
|
+
export var LockedIconContainer = styled.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n\n"])));
|
|
21
|
+
export var ItemContent = styled.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n margin: auto 0 auto 16px;\n display: flex;\n align-items: center;\n flex-grow: 2;\n\n ", " {\n flex: 1 0 calc(100% - 40px);\n display: flex;\n flex-direction: row;\n align-items: center;\n }\n\n ", " {\n margin-right: 6px;\n svg {\n display: block;\n margin: auto;\n }\n }\n\n ", " {\n flex-grow: 2;\n\n .extraMargin {\n margin-left: calc(100% - 24px);\n }\n }\n"])), ItemLabel, ItemIcon, LockedIconContainer);
|
|
21
22
|
export var DropdownButtonCSS = function DropdownButtonCSS(size) {
|
|
22
|
-
return css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n ", "\n ", "\n ", "\n\n position: relative;\n text-decoration: none;\n display: flex;\n flex-direction: row;\n align-items: center;\n min-height: ", ";\n background-color: ", ";\n border: none;\n cursor: pointer;\n background: transparent;\n width: 100%;\n text-align: left;\n\n span {\n margin: auto 0 auto 16px;\n line-height: 48px;\n }\n\n ", ";\n\n &.active {\n background: ", ";\n\n &::after {\n position: absolute;\n content: ' ';\n width: 4px;\n top:
|
|
23
|
+
return css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n ", "\n ", "\n ", "\n\n position: relative;\n text-decoration: none;\n display: flex;\n flex-direction: row;\n align-items: center;\n min-height: ", ";\n background-color: ", ";\n border: none;\n cursor: pointer;\n background: transparent;\n width: 100%;\n text-align: left;\n\n span {\n margin: auto 0 auto 16px;\n line-height: 48px;\n }\n\n ", ";\n\n &.active {\n background: ", ";\n\n &::after {\n position: absolute;\n content: ' ';\n width: 4px;\n top: 6px;\n bottom: 6px;\n left: 4px;\n background-color: ", ";\n\n border-radius: 4px;\n }\n }\n\n &:disabled, &.disabled-state {\n background-color: transparent;\n cursor: not-allowed;\n color: ", ";\n }\n\n &.locked {\n background-color: transparent;\n cursor: not-allowed;\n color: ", ";\n }\n\n &.active:hover, &.active-hover-state {\n background-color: ", ";\n\n svg {\n color: ", ";\n }\n\n &::after {\n background-color: ", ";\n }\n }\n\n &.active:active, &.active-active-state {\n background-color: ", ";\n\n svg {\n color: ", ";\n }\n\n &::after {\n background-color: ", ";\n }\n }\n "])), size == Size.Small && ComponentSStyling(ComponentTextStyle.Regular, COLORS.neutral_600), size == Size.Medium && ComponentMStyling(ComponentTextStyle.Regular, COLORS.neutral_600), size == Size.Large && ComponentLStyling(ComponentTextStyle.Regular, COLORS.neutral_600), size == Size.Large ? '64px' : size == Size.Medium ? '56px' : '48px', COLORS.white, CommonInteractionStyling, COLORS.neutral_20, COLORS.primary_500, COLORS.neutral_200, COLORS.neutral_500, COLORS.primary_20, COLORS.primary_600, COLORS.primary_500, COLORS.primary_100, COLORS.primary_800, COLORS.primary_500);
|
|
23
24
|
};
|
|
24
25
|
var MenuItem = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
25
26
|
var _item$displayLabel;
|
|
@@ -29,14 +30,15 @@ var MenuItem = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
29
30
|
onClickHandler = _ref.onClickHandler,
|
|
30
31
|
key = _ref.key,
|
|
31
32
|
size = _ref.size,
|
|
33
|
+
className = _ref.className,
|
|
32
34
|
id = _ref.id;
|
|
33
35
|
return /*#__PURE__*/_jsxs(DropdownButton, {
|
|
34
36
|
type: "button",
|
|
35
37
|
size: size,
|
|
36
|
-
disabled: item.disabled,
|
|
38
|
+
disabled: item.disabled || item.locked,
|
|
37
39
|
ref: ref,
|
|
38
40
|
onClick: onClickHandler,
|
|
39
|
-
className: (item.showDividerAbove ? 'show-divider-above' : '') + ' ' + (active ? 'active' : ''),
|
|
41
|
+
className: className + ' ' + (item.locked ? 'locked' : '') + ' ' + (item.showDividerAbove ? 'show-divider-above' : '') + ' ' + (active ? 'active' : ''),
|
|
40
42
|
id: id,
|
|
41
43
|
children: [item.showDividerAbove && /*#__PURE__*/_jsx("div", {
|
|
42
44
|
className: "divider"
|
|
@@ -44,11 +46,22 @@ var MenuItem = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
44
46
|
children: [item.icon && /*#__PURE__*/_jsx(ItemIcon, {
|
|
45
47
|
children: item.icon
|
|
46
48
|
}), /*#__PURE__*/_jsxs(ItemLabel, {
|
|
47
|
-
children: [
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
},
|
|
51
|
-
|
|
49
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
50
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
51
|
+
children: (_item$displayLabel = item.displayLabel) !== null && _item$displayLabel !== void 0 ? _item$displayLabel : item.value
|
|
52
|
+
}), item.noteLabel && /*#__PURE__*/_jsx("div", {
|
|
53
|
+
style: {
|
|
54
|
+
fontSize: '12px',
|
|
55
|
+
lineHeight: '16px'
|
|
56
|
+
},
|
|
57
|
+
children: item.noteLabel
|
|
58
|
+
})]
|
|
59
|
+
}), item.locked && /*#__PURE__*/_jsx(LockedIconContainer, {
|
|
60
|
+
children: /*#__PURE__*/_jsx(LockedOn, {
|
|
61
|
+
color: COLORS.neutral_400,
|
|
62
|
+
className: "extraMargin",
|
|
63
|
+
size: "24px"
|
|
64
|
+
})
|
|
52
65
|
})]
|
|
53
66
|
})]
|
|
54
67
|
})]
|
|
@@ -58,7 +71,8 @@ MenuItem.propTypes = {
|
|
|
58
71
|
onClickHandler: _pt.func.isRequired,
|
|
59
72
|
active: _pt.bool.isRequired,
|
|
60
73
|
id: _pt.string.isRequired,
|
|
61
|
-
key: _pt.string.isRequired
|
|
74
|
+
key: _pt.string.isRequired,
|
|
75
|
+
className: _pt.string
|
|
62
76
|
};
|
|
63
77
|
export default MenuItem;
|
|
64
78
|
//# sourceMappingURL=MenuItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/MenuItem/MenuItem.tsx"],"names":["React","styled","css","COLORS","ComponentTextStyle","Size","ComponentLStyling","ComponentMStyling","ComponentSStyling","CommonInteractionStyling","DropdownButton","button","props","DropdownButtonCSS","size","ItemLabel","div","ItemIcon","
|
|
1
|
+
{"version":3,"sources":["../../src/MenuItem/MenuItem.tsx"],"names":["React","styled","css","COLORS","ComponentTextStyle","LockedOn","Size","ComponentLStyling","ComponentMStyling","ComponentSStyling","CommonInteractionStyling","DropdownButton","button","props","DropdownButtonCSS","size","ItemLabel","div","ItemIcon","LockedIconContainer","ItemContent","Small","Regular","neutral_600","Medium","Large","white","neutral_20","primary_500","neutral_200","neutral_500","primary_20","primary_600","primary_100","primary_800","MenuItem","forwardRef","ref","active","item","onClickHandler","key","className","id","disabled","locked","showDividerAbove","icon","displayLabel","value","noteLabel","fontSize","lineHeight","neutral_400"],"mappings":";;;;;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AAEA,OAAOC,MAAP,IAAiBC,GAAjB,QAA4B,mBAA5B;AACA,SAAqBC,MAArB,EAA6BC,kBAA7B,QAAsD,WAAtD;AACA,SAAsBC,QAAtB,QAAqC,kCAArC;AACA,SAAiBC,IAAjB,QAA4B,UAA5B;AACA,SAAQC,iBAAR,EAA2BC,iBAA3B,EAA8CC,iBAA9C,QAAsE,sBAAtE;AAEA,SAASC,wBAAT,QAAyC,WAAzC;;;AAYA,OAAO,IAAMC,cAAc,GAAGV,MAAM,CAACW,MAAV,gFACvB,UAACC,KAAD;AAAA,SAAWC,iBAAiB,CAACD,KAAK,CAACE,IAAP,CAA5B;AAAA,CADuB,CAApB;AAIP,OAAO,IAAMC,SAAS,GAAGf,MAAM,CAAC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AAAhC,aAAZ;AAAA,sBAAuDb,IAAI,CAACW;AAA5D,YAFrB;AAAA,UADJ,EAKKX,IAAI,CAACM,MAAL,iBAAe,KAAC,mBAAD;AAAA,iCACd,KAAC,QAAD;AAAU,YAAA,KAAK,EAAE1C,MAAM,CAACkD,WAAxB;AAAqC,YAAA,SAAS,EAAC,aAA/C;AAA6D,YAAA,IAAI,EAAC;AAAlE;AADc,UALpB;AAAA,QAFF;AAAA,MAVJ;AAAA,KAOSZ,GAPT,CADF;AAyBD,CAjCgB,CAAjB;;AAlIGD,EAAAA,c;AACAF,EAAAA,M;AACAK,EAAAA,E;AACAF,EAAAA,G;AAEAC,EAAAA,S;;AAgKH,eAAeP,QAAf","sourcesContent":["import * as React from 'react';\nimport {Link} from 'react-router-dom';\nimport styled, { css } from 'styled-components';\nimport {BREAKPOINTS, COLORS, ComponentTextStyle} from '../styles';\nimport {ChevronRight, LockedOn} from '../icons/systemicons/SystemIcons';\nimport {Product, Size} from '../types';\nimport {ComponentLStyling, ComponentMStyling, ComponentSStyling} from '../styles/typography';\nimport { DropdownItem } from '../Dropdown/DropdownContent';\nimport { CommonInteractionStyling } from '../common';\n\nexport interface MenuItemProps {\n item: DropdownItem;\n onClickHandler: (e: any) => void;\n active: boolean;\n id: string;\n key: string;\n size?: Size;\n className?: string;\n}\n\nexport const DropdownButton = styled.button<{ size?: Size }>`\n ${(props) => DropdownButtonCSS(props.size)}\n`;\n\nexport const ItemLabel = styled.div``;\nexport const ItemIcon = styled.div``;\n\nexport const LockedIconContainer = styled.div`\n\n`;\n\nexport const ItemContent = styled.div`\n margin: auto 0 auto 16px;\n display: flex;\n align-items: center;\n flex-grow: 2;\n\n ${ItemLabel} {\n flex: 1 0 calc(100% - 40px);\n display: flex;\n flex-direction: row;\n align-items: center;\n }\n\n ${ItemIcon} {\n margin-right: 6px;\n svg {\n display: block;\n margin: auto;\n }\n }\n\n ${LockedIconContainer} {\n flex-grow: 2;\n\n .extraMargin {\n margin-left: calc(100% - 24px);\n }\n }\n`;\n\n\nexport const DropdownButtonCSS = (size?: Size) => {\n return css`\n ${size == Size.Small && ComponentSStyling(ComponentTextStyle.Regular, COLORS.neutral_600)}\n ${size == Size.Medium && ComponentMStyling(ComponentTextStyle.Regular, COLORS.neutral_600)}\n ${size == Size.Large && ComponentLStyling(ComponentTextStyle.Regular, COLORS.neutral_600)}\n\n position: relative;\n text-decoration: none;\n display: flex;\n flex-direction: row;\n align-items: center;\n min-height: ${size == Size.Large ? '64px' : size == Size.Medium ? '56px' : '48px'};\n background-color: ${COLORS.white};\n border: none;\n cursor: pointer;\n background: transparent;\n width: 100%;\n text-align: left;\n\n span {\n margin: auto 0 auto 16px;\n line-height: 48px;\n }\n\n ${CommonInteractionStyling};\n\n &.active {\n background: ${COLORS.neutral_20};\n\n &::after {\n position: absolute;\n content: ' ';\n width: 4px;\n top: 6px;\n bottom: 6px;\n left: 4px;\n background-color: ${COLORS.primary_500};\n\n border-radius: 4px;\n }\n }\n\n &:disabled, &.disabled-state {\n background-color: transparent;\n cursor: not-allowed;\n color: ${COLORS.neutral_200};\n }\n\n &.locked {\n background-color: transparent;\n cursor: not-allowed;\n color: ${COLORS.neutral_500};\n }\n\n &.active:hover, &.active-hover-state {\n background-color: ${COLORS.primary_20};\n\n svg {\n color: ${COLORS.primary_600};\n }\n\n &::after {\n background-color: ${COLORS.primary_500};\n }\n }\n\n &.active:active, &.active-active-state {\n background-color: ${COLORS.primary_100};\n\n svg {\n color: ${COLORS.primary_800};\n }\n\n &::after {\n background-color: ${COLORS.primary_500};\n }\n }\n `;\n};\n\nconst MenuItem = React.forwardRef<HTMLButtonElement, MenuItemProps>(({\n active,\n item,\n onClickHandler,\n key,\n size,\n className,\n id }: MenuItemProps, ref) => {\n return (\n <DropdownButton\n type=\"button\"\n size={size}\n disabled={item.disabled || item.locked}\n ref={ref}\n onClick={onClickHandler}\n className={ className + ' ' + (item.locked ? 'locked' : '') + ' ' + (item.showDividerAbove ? 'show-divider-above' : '') + ' ' + (active ? 'active' : '')}\n key={key}\n id={id}>\n {item.showDividerAbove && <div className=\"divider\" />}\n <ItemContent>\n {item.icon && <ItemIcon>{item.icon}</ItemIcon>}\n <ItemLabel>\n <div>\n <div>{item.displayLabel ?? item.value}</div>\n {item.noteLabel && <div style={{ fontSize: '12px', lineHeight: '16px' }}>{item.noteLabel}</div>}\n </div>\n {item.locked && <LockedIconContainer>\n <LockedOn color={COLORS.neutral_400} className=\"extraMargin\" size=\"24px\" />\n </LockedIconContainer>}\n </ItemLabel>\n </ItemContent>\n </DropdownButton>\n );\n});\n\nexport default MenuItem;\n"],"file":"MenuItem.js"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
Object.defineProperty(exports, "MenuItem", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function get() {
|
|
11
|
+
return _MenuItem.default;
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
var _MenuItem = _interopRequireDefault(require("./MenuItem"));
|
|
16
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/MenuItem/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA","sourcesContent":["export {default as MenuItem} from './MenuItem';"],"file":"index.cjs"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as MenuItem } from './MenuItem';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/MenuItem/index.tsx"],"names":["default","MenuItem"],"mappings":"AAAA,SAAQA,OAAO,IAAIC,QAAnB,QAAkC,YAAlC","sourcesContent":["export {default as MenuItem} from './MenuItem';"],"file":"index.js"}
|
|
@@ -98,9 +98,7 @@ var QuizButton = function QuizButton(_ref) {
|
|
|
98
98
|
onClick: onClick,
|
|
99
99
|
isSelected: selected,
|
|
100
100
|
tabIndex: disabled || resultType ? -1 : 0,
|
|
101
|
-
onMouseDown:
|
|
102
|
-
return e.preventDefault();
|
|
103
|
-
},
|
|
101
|
+
onMouseDown: _.defaultOnMouseDownHandler,
|
|
104
102
|
size: size,
|
|
105
103
|
className: 'quiz-button '.concat(selected ? ' selected' : '').concat(disabled ? ' disabled' : '').concat(resultType ? ' result ' + resultType : '').concat(className ? ' ' + className : ''),
|
|
106
104
|
"data-testid": 'container',
|