@laerdal/life-react-components 1.8.0-dev.34 → 1.8.0-dev.36.full
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/Button/Iconbutton.cjs +5 -7
- package/dist/Button/Iconbutton.cjs.map +1 -1
- package/dist/Button/Iconbutton.d.ts +0 -2
- package/dist/Button/Iconbutton.js +5 -7
- package/dist/Button/Iconbutton.js.map +1 -1
- package/dist/ChipsInput/ChipInputField.cjs +3 -2
- package/dist/ChipsInput/ChipInputField.cjs.map +1 -1
- package/dist/ChipsInput/ChipInputField.js +3 -2
- package/dist/ChipsInput/ChipInputField.js.map +1 -1
- package/dist/Dropdown/BasicDropdown.cjs +2 -0
- package/dist/Dropdown/BasicDropdown.cjs.map +1 -1
- package/dist/Dropdown/BasicDropdown.js +2 -0
- package/dist/Dropdown/BasicDropdown.js.map +1 -1
- package/dist/Dropdown/DropdownFilter.cjs +2 -0
- package/dist/Dropdown/DropdownFilter.cjs.map +1 -1
- package/dist/Dropdown/DropdownFilter.d.ts +1 -1
- package/dist/Dropdown/DropdownFilter.js +2 -0
- package/dist/Dropdown/DropdownFilter.js.map +1 -1
- package/dist/InputFields/DatepickerField.cjs +3 -2
- package/dist/InputFields/DatepickerField.cjs.map +1 -1
- package/dist/InputFields/DatepickerField.js +3 -2
- package/dist/InputFields/DatepickerField.js.map +1 -1
- package/dist/InputFields/Label.cjs +14 -24
- package/dist/InputFields/Label.cjs.map +1 -1
- package/dist/InputFields/Label.js +16 -24
- package/dist/InputFields/Label.js.map +1 -1
- package/dist/InputFields/PasswordField.cjs +1 -1
- package/dist/InputFields/PasswordField.cjs.map +1 -1
- package/dist/InputFields/PasswordField.js +1 -1
- package/dist/InputFields/PasswordField.js.map +1 -1
- package/dist/InputFields/QuickSearch.cjs +3 -2
- package/dist/InputFields/QuickSearch.cjs.map +1 -1
- package/dist/InputFields/QuickSearch.js +3 -2
- package/dist/InputFields/QuickSearch.js.map +1 -1
- package/dist/InputFields/TextField.cjs +16 -26
- package/dist/InputFields/TextField.cjs.map +1 -1
- package/dist/InputFields/TextField.d.ts +1 -3
- package/dist/InputFields/TextField.js +18 -27
- package/dist/InputFields/TextField.js.map +1 -1
- package/dist/InputFields/Textarea.cjs +20 -26
- package/dist/InputFields/Textarea.cjs.map +1 -1
- package/dist/InputFields/Textarea.d.ts +11 -1
- package/dist/InputFields/Textarea.js +24 -31
- package/dist/InputFields/Textarea.js.map +1 -1
- package/dist/InputFields/components/SearchBarInput.cjs +1 -1
- package/dist/InputFields/components/SearchBarInput.cjs.map +1 -1
- package/dist/InputFields/components/SearchBarInput.js +1 -1
- package/dist/InputFields/components/SearchBarInput.js.map +1 -1
- package/dist/InputFields/components/SearchField.cjs +1 -1
- package/dist/InputFields/components/SearchField.cjs.map +1 -1
- package/dist/InputFields/components/SearchField.js +1 -1
- package/dist/InputFields/components/SearchField.js.map +1 -1
- package/dist/InputFields/styling.cjs +13 -15
- package/dist/InputFields/styling.cjs.map +1 -1
- package/dist/InputFields/styling.d.ts +1 -4
- package/dist/InputFields/styling.js +10 -13
- package/dist/InputFields/styling.js.map +1 -1
- package/dist/Popover/Popover.cjs +267 -0
- package/dist/Popover/Popover.cjs.map +1 -0
- package/dist/Popover/Popover.d.ts +26 -0
- package/dist/Popover/Popover.js +231 -0
- package/dist/Popover/Popover.js.map +1 -0
- package/dist/Popover/index.cjs +16 -0
- package/dist/Popover/index.cjs.map +1 -0
- package/dist/Popover/index.d.ts +1 -0
- package/dist/Popover/index.js +2 -0
- package/dist/Popover/index.js.map +1 -0
- package/dist/index.cjs +14 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/styles/z-indexes.cjs +2 -1
- package/dist/styles/z-indexes.cjs.map +1 -1
- package/dist/styles/z-indexes.d.ts +1 -0
- package/dist/styles/z-indexes.js +2 -1
- package/dist/styles/z-indexes.js.map +1 -1
- package/dist/types.cjs +11 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.ts +6 -0
- package/dist/types.js +9 -0
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
- package/dist/InputFields/types.cjs +0 -6
- package/dist/InputFields/types.cjs.map +0 -1
- package/dist/InputFields/types.d.ts +0 -38
- package/dist/InputFields/types.js +0 -2
- package/dist/InputFields/types.js.map +0 -1
|
@@ -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.activeErrorMessageState = exports.Warning = exports.ValidationStyling = exports.
|
|
10
|
+
exports.activeErrorMessageState = exports.Warning = exports.ValidationStyling = exports.StyledIcon = exports.SearchIconWrapper = exports.RequiredStar = exports.InputWrapper = exports.InputFieldStyling = exports.ErrorMessage = exports.AutofilledMessage = void 0;
|
|
11
11
|
|
|
12
12
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
13
13
|
|
|
@@ -17,7 +17,7 @@ var _styles = require("../styles");
|
|
|
17
17
|
|
|
18
18
|
var _typography = require("../styles/typography");
|
|
19
19
|
|
|
20
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11
|
|
20
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11;
|
|
21
21
|
|
|
22
22
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
23
|
|
|
@@ -34,9 +34,9 @@ var readOnlyState = (0, _styledComponents.css)(_templateObject2 || (_templateObj
|
|
|
34
34
|
var activeErrorMessageState = (0, _styledComponents.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n box-shadow: inset 0 0 0 2px ", ";\n"])), _styles.COLORS.critical_400);
|
|
35
35
|
exports.activeErrorMessageState = activeErrorMessageState;
|
|
36
36
|
|
|
37
|
-
var InputFieldStyling = _styledComponents.default.input(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n height: 48px;\n width: 100%;\n border-radius: 4px;\n\n border: 0;\n -webkit-appearance: none;\n ", "\n background-color: #fff;\n box-sizing: border-box;\n padding: 0 16px !important;\n\n outline: none;\n position: relative;\n\n font-size: 16px;\n\n &::placeholder {\n ", "\n }\n\n ", " {\n font-size: 18px;\n line-height: 18px;\n height: 56px;\n padding: 0 16px !important;\n\n &::placeholder {\n ", "\n }\n }\n\n &.small {\n font-size: 16px;\n height: 48px;\n &::placeholder {\n font-size: 16px;\n }\n }\n &.medium {\n font-size: 18px;\n height: 56px;\n &::placeholder {\n font-size: 18px;\n }\n }\n\n color: ", " !important;\n\n ", "\n\n &:read-only:not(:disabled) {\n ", "\n }\n\n &:disabled {\n border: 1px solid ", ";\n pointer-events: none;\n box-shadow: none !important;\n outline: none;\n cursor: not-allowed;\n color: ", " !important;\n }\n &:focus:not(.focus-visible) {\n box-shadow: inset 0px 0px 0px 2px ", ";\n }\n\n &.focus-visible
|
|
37
|
+
var InputFieldStyling = _styledComponents.default.input(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n height: 48px;\n width: 100%;\n border-radius: 4px;\n\n border: 0;\n -webkit-appearance: none;\n ", "\n background-color: #fff;\n box-sizing: border-box;\n padding: 0 16px !important;\n\n outline: none;\n position: relative;\n\n font-size: 16px;\n\n &::placeholder {\n ", "\n }\n\n ", " {\n font-size: 18px;\n line-height: 18px;\n height: 56px;\n padding: 0 16px !important;\n\n &::placeholder {\n ", "\n }\n }\n\n &.small {\n font-size: 16px;\n height: 48px;\n &::placeholder {\n font-size: 16px;\n }\n }\n &.medium {\n font-size: 18px;\n height: 56px;\n &::placeholder {\n font-size: 18px;\n }\n }\n\n color: ", " !important;\n\n ", "\n\n &:read-only:not(:disabled) {\n ", "\n }\n \n &:disabled {\n border: 1px solid ", ";\n pointer-events: none;\n box-shadow: none !important;\n outline: none;\n cursor: not-allowed;\n color: ", " !important;\n }\n &:focus:not(.focus-visible) {\n box-shadow: inset 0px 0px 0px 2px ", ";\n }\n \n &.focus-visible{\n ", "\n }\n\n &.invalid {\n box-shadow: inset 0 0 0 2px ", ";\n }\n &.valid {\n box-shadow: inset 0 0 0 2px ", ";\n }\n \n &:not(.placeholder) {\n line-height: 40px;\n }\n\n &.invalid {\n margin-bottom: 0 !important;\n }\n\n &:hover {\n box-shadow: inset 0px 0px 0px 2px ", ";\n }\n\n &.active {\n box-shadow: inset 0px 0px 0px 2px ", ";\n }\n\n &.show-checkmark.valid {\n background-image: none;\n }\n\n &.show-checkmark.pending {\n background-image: none;\n }\n \n"])), function (props) {
|
|
38
38
|
return props.withoutBorder ? "-webkit-box-shadow: none;\n -moz-box-shadow: none;\n box-shadow: none;\n " : "-webkit-box-shadow: inset 0px 0px 0px 1px ".concat(_styles.COLORS.neutral_400, ";\n -moz-box-shadow: inset 0px 0px 0px 1px ").concat(_styles.COLORS.neutral_400, ";\n box-shadow: inset 0px 0px 0px 1px ").concat(_styles.COLORS.neutral_400, ";");
|
|
39
|
-
}, (0, _typography.ComponentSStyling)(_typography.ComponentTextStyle.Italic, _styles.COLORS.
|
|
39
|
+
}, (0, _typography.ComponentSStyling)(_typography.ComponentTextStyle.Italic, _styles.COLORS.neutral_600), _styles.BREAKPOINTS.MEDIUM, (0, _typography.ComponentMStyling)(_typography.ComponentTextStyle.Italic, _styles.COLORS.neutral_600), _styles.COLORS.black, function (props) {
|
|
40
40
|
return props.activeErrorMessage ? activeErrorMessageState : '';
|
|
41
41
|
}, function (props) {
|
|
42
42
|
return props.suppressReadOnlyStyles ? '' : readOnlyState;
|
|
@@ -46,23 +46,21 @@ exports.InputFieldStyling = InputFieldStyling;
|
|
|
46
46
|
var ValidationStyling = (0, _styledComponents.css)(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n &.error-msg {\n ", "\n text-align: center;\n font-weight: 400;\n box-sizing: border-box;\n }\n\n &.error-msg {\n padding-top: 8px;\n padding-bottom: 0;\n ", "\n font-weight: 700;\n line-height: 15px;\n }\n"])), (0, _typography.ComponentXXSStyling)(_typography.ComponentTextStyle.Regular, _styles.COLORS.black), (0, _typography.ComponentXXSStyling)(_typography.ComponentTextStyle.Regular, '#e76468'));
|
|
47
47
|
exports.ValidationStyling = ValidationStyling;
|
|
48
48
|
|
|
49
|
-
var
|
|
49
|
+
var RequiredStar = _styledComponents.default.span(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n font-size: 28px;\n line-height: 12px;\n font-weight: 700;\n position: relative;\n top: 10px;\n"])), _styles.COLORS.critical_500);
|
|
50
|
+
|
|
51
|
+
exports.RequiredStar = RequiredStar;
|
|
52
|
+
|
|
53
|
+
var Warning = _styledComponents.default.div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n font-size: 12px;\n line-height: 140%;\n\n ", " {\n font-size: 14px;\n }\n\n &.small {\n font-size: 12px;\n }\n &.medium {\n font-size: 14px;\n }\n\n & * {\n vertical-align: middle;\n display: inline-block;\n }\n\n svg {\n margin-right: 4px;\n }\n"])), _styles.BREAKPOINTS.MEDIUM);
|
|
50
54
|
|
|
51
55
|
exports.Warning = Warning;
|
|
52
|
-
var ErrorMessage = (0, _styledComponents.default)(Warning)(
|
|
56
|
+
var ErrorMessage = (0, _styledComponents.default)(Warning)(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n"])), _styles.COLORS.critical_500);
|
|
53
57
|
exports.ErrorMessage = ErrorMessage;
|
|
54
|
-
var
|
|
55
|
-
return props.type === 'invalid' ? _styles.COLORS.critical_500 : _styles.COLORS.correct_500;
|
|
56
|
-
});
|
|
57
|
-
exports.ValidationMessage = ValidationMessage;
|
|
58
|
-
var NoteMessage = (0, _styledComponents.default)(Warning)(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["\n margin: 4px 0px;\n color: ", ";\n"])), _styles.COLORS.neutral_500);
|
|
59
|
-
exports.NoteMessage = NoteMessage;
|
|
60
|
-
var AutofilledMessage = (0, _styledComponents.default)(Warning)(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n"])), _styles.COLORS.neutral_600);
|
|
58
|
+
var AutofilledMessage = (0, _styledComponents.default)(Warning)(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n"])), _styles.COLORS.neutral_600);
|
|
61
59
|
exports.AutofilledMessage = AutofilledMessage;
|
|
62
60
|
|
|
63
|
-
var StyledIcon = _styledComponents.default.div(
|
|
61
|
+
var StyledIcon = _styledComponents.default.div(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2.default)(["\n border-radius: 50%;\n"])));
|
|
64
62
|
|
|
65
63
|
exports.StyledIcon = StyledIcon;
|
|
66
|
-
var SearchIconWrapper = (0, _styledComponents.default)(StyledIcon)(
|
|
64
|
+
var SearchIconWrapper = (0, _styledComponents.default)(StyledIcon)(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n border-radius: 50%;\n"])));
|
|
67
65
|
exports.SearchIconWrapper = SearchIconWrapper;
|
|
68
66
|
//# sourceMappingURL=styling.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/InputFields/styling.ts"],"names":["InputWrapper","styled","div","props","readOnly","disabled","margin","readOnlyState","css","COLORS","neutral_100","neutral_300","neutral_600","activeErrorMessageState","critical_400","InputFieldStyling","input","withoutBorder","neutral_400","ComponentTextStyle","Italic","
|
|
1
|
+
{"version":3,"sources":["../../src/InputFields/styling.ts"],"names":["InputWrapper","styled","div","props","readOnly","disabled","margin","readOnlyState","css","COLORS","neutral_100","neutral_300","neutral_600","activeErrorMessageState","critical_400","InputFieldStyling","input","withoutBorder","neutral_400","ComponentTextStyle","Italic","BREAKPOINTS","MEDIUM","black","activeErrorMessage","suppressReadOnlyStyles","primary_800","focusStyles","correct_500","primary_700","ValidationStyling","Regular","RequiredStar","span","critical_500","Warning","ErrorMessage","AutofilledMessage","StyledIcon","SearchIconWrapper"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;AACA;;;;;;;;AAEO,IAAMA,YAAY,GAAGC,0BAAOC,GAAV,yHAErB,UAACC,KAAD;AAAA,SAAYA,KAAK,CAACC,QAAN,IAAkBD,KAAK,CAACE,QAAxB,GAAmC,sBAAnC,GAA4D,EAAxE;AAAA,CAFqB,EAGrB,UAACF,KAAD;AAAA,SAAYA,KAAK,CAACG,MAAN,qBAA0BH,KAAK,CAACG,MAAhC,SAA4C,EAAxD;AAAA,CAHqB,CAAlB;;;AAMP,IAAMC,aAAa,OAAGC,qBAAH,kQACGC,eAAOC,WADV,EAEaD,eAAOE,WAFpB,EAGRF,eAAOG,WAHC,CAAnB;AAQO,IAAMC,uBAAuB,OAAGL,qBAAH,8HACJC,eAAOK,YADH,CAA7B;;;AAIP,IAAMC,iBAAiB,GAAGd,0BAAOe,KAAV,koDAanB,UAACb,KAAD;AAAA,SACAA,KAAK,CAACc,aAAN,oJAKiDR,eAAOS,WALxD,6DAM2CT,eAAOS,WANlD,wDAOsCT,eAAOS,WAP7C,MADA;AAAA,CAbmB,EAgCjB,mCAAkBC,+BAAmBC,MAArC,EAA6CX,eAAOG,WAApD,CAhCiB,EAmCnBS,oBAAYC,MAnCO,EA0Cf,mCAAkBH,+BAAmBC,MAArC,EAA6CX,eAAOG,WAApD,CA1Ce,EA6DZH,eAAOc,KA7DK,EA+DnB,UAACpB,KAAD;AAAA,SAAYA,KAAK,CAACqB,kBAAN,GAA2BX,uBAA3B,GAAqD,EAAjE;AAAA,CA/DmB,EAkEjB,UAAAV,KAAK;AAAA,SAAIA,KAAK,CAACsB,sBAAN,GAA+B,EAA/B,GAAoClB,aAAxC;AAAA,CAlEY,EAsECE,eAAOC,WAtER,EA2EVD,eAAOE,WA3EG,EA8EiBF,eAAOiB,WA9ExB,EAkFjBC,mBAlFiB,EAsFWlB,eAAOK,YAtFlB,EAyFWL,eAAOmB,WAzFlB,EAqGiBnB,eAAOoB,WArGxB,EAyGiBpB,eAAOiB,WAzGxB,CAAvB;;;AAsHA,IAAMI,iBAAiB,OAAGtB,qBAAH,sUAEjB,qCAAoBW,+BAAmBY,OAAvC,EAAgDtB,eAAOc,KAAvD,CAFiB,EAWjB,qCAAoBJ,+BAAmBY,OAAvC,EAAgD,SAAhD,CAXiB,CAAvB;;;AAiBO,IAAMC,YAAY,GAAG/B,0BAAOgC,IAAV,4MACdxB,eAAOyB,YADO,CAAlB;;;;AAQA,IAAMC,OAAO,GAAGlC,0BAAOC,GAAV,6WAIhBmB,oBAAYC,MAJI,CAAb;;;AAwBA,IAAMc,YAAY,GAAG,+BAAOD,OAAP,CAAH,wGACd1B,eAAOyB,YADO,CAAlB;;AAGA,IAAMG,iBAAiB,GAAG,+BAAOF,OAAP,CAAH,wGACnB1B,eAAOG,WADY,CAAvB;;;AAMA,IAAM0B,UAAU,GAAGrC,0BAAOC,GAAV,gHAAhB;;;AAIA,IAAMqC,iBAAiB,GAAG,+BAAOD,UAAP,CAAH,uIAAvB","sourcesContent":["import styled, { css } from 'styled-components';\nimport {BREAKPOINTS, COLORS, focusStyles} from '../styles';\nimport { ComponentXXSStyling, ComponentTextStyle, ComponentSStyling, ComponentMStyling } from '../styles/typography';\n\nexport const InputWrapper = styled.div<{ readOnly?: boolean; disabled?: boolean; margin?: string }>`\n outline: none;\n ${(props) => (props.readOnly || props.disabled ? 'cursor: not-allowed;' : '')};\n ${(props) => (props.margin ? `margin: ${props.margin};` : '')}\n`;\n\nconst readOnlyState = css`\n background-color: ${COLORS.neutral_100};\n box-shadow: inset 0 0 0 1px ${COLORS.neutral_300} !important;\n color: ${COLORS.neutral_600} !important;\n pointer-events: none;\n outline: none;\n cursor: not-allowed;\n`;\nexport const activeErrorMessageState = css`\n box-shadow: inset 0 0 0 2px ${COLORS.critical_400};\n`;\n\nconst InputFieldStyling = styled.input<{\n activeErrorMessage?: boolean;\n active?: boolean;\n withoutBorder?: boolean;\n size?: string;\n suppressReadOnlyStyles?: boolean;\n}>`\n height: 48px;\n width: 100%;\n border-radius: 4px;\n\n border: 0;\n -webkit-appearance: none;\n ${(props) =>\n props.withoutBorder\n ? `-webkit-box-shadow: none;\n -moz-box-shadow: none;\n box-shadow: none;\n `\n : `-webkit-box-shadow: inset 0px 0px 0px 1px ${COLORS.neutral_400};\n -moz-box-shadow: inset 0px 0px 0px 1px ${COLORS.neutral_400};\n box-shadow: inset 0px 0px 0px 1px ${COLORS.neutral_400};`}\n background-color: #fff;\n box-sizing: border-box;\n padding: 0 16px !important;\n\n outline: none;\n position: relative;\n\n font-size: 16px;\n\n &::placeholder {\n ${ComponentSStyling(ComponentTextStyle.Italic, COLORS.neutral_600)}\n }\n\n ${BREAKPOINTS.MEDIUM} {\n font-size: 18px;\n line-height: 18px;\n height: 56px;\n padding: 0 16px !important;\n\n &::placeholder {\n ${ComponentMStyling(ComponentTextStyle.Italic, COLORS.neutral_600)}\n }\n }\n\n &.small {\n font-size: 16px;\n height: 48px;\n &::placeholder {\n font-size: 16px;\n }\n }\n &.medium {\n font-size: 18px;\n height: 56px;\n &::placeholder {\n font-size: 18px;\n }\n }\n\n color: ${COLORS.black} !important;\n\n ${(props) => (props.activeErrorMessage ? activeErrorMessageState : '')}\n\n &:read-only:not(:disabled) {\n ${props => props.suppressReadOnlyStyles ? '' : readOnlyState}\n }\n \n &:disabled {\n border: 1px solid ${COLORS.neutral_100};\n pointer-events: none;\n box-shadow: none !important;\n outline: none;\n cursor: not-allowed;\n color: ${COLORS.neutral_300} !important;\n }\n &:focus:not(.focus-visible) {\n box-shadow: inset 0px 0px 0px 2px ${COLORS.primary_800};\n }\n \n &.focus-visible{\n ${focusStyles}\n }\n\n &.invalid {\n box-shadow: inset 0 0 0 2px ${COLORS.critical_400};\n }\n &.valid {\n box-shadow: inset 0 0 0 2px ${COLORS.correct_500};\n }\n \n &:not(.placeholder) {\n line-height: 40px;\n }\n\n &.invalid {\n margin-bottom: 0 !important;\n }\n\n &:hover {\n box-shadow: inset 0px 0px 0px 2px ${COLORS.primary_700};\n }\n\n &.active {\n box-shadow: inset 0px 0px 0px 2px ${COLORS.primary_800};\n }\n\n &.show-checkmark.valid {\n background-image: none;\n }\n\n &.show-checkmark.pending {\n background-image: none;\n }\n \n`;\n\nconst ValidationStyling = css`\n &.error-msg {\n ${ComponentXXSStyling(ComponentTextStyle.Regular, COLORS.black)}\n text-align: center;\n font-weight: 400;\n box-sizing: border-box;\n }\n\n &.error-msg {\n padding-top: 8px;\n padding-bottom: 0;\n ${ComponentXXSStyling(ComponentTextStyle.Regular, '#e76468')}\n font-weight: 700;\n line-height: 15px;\n }\n`;\n\nexport const RequiredStar = styled.span`\n color: ${COLORS.critical_500};\n font-size: 28px;\n line-height: 12px;\n font-weight: 700;\n position: relative;\n top: 10px;\n`;\nexport const Warning = styled.div`\n font-size: 12px;\n line-height: 140%;\n\n ${BREAKPOINTS.MEDIUM} {\n font-size: 14px;\n }\n\n &.small {\n font-size: 12px;\n }\n &.medium {\n font-size: 14px;\n }\n\n & * {\n vertical-align: middle;\n display: inline-block;\n }\n\n svg {\n margin-right: 4px;\n }\n`;\nexport const ErrorMessage = styled(Warning)`\n color: ${COLORS.critical_500};\n`;\nexport const AutofilledMessage = styled(Warning)`\n color: ${COLORS.neutral_600};\n`;\n\nexport { ValidationStyling, InputFieldStyling };\n\nexport const StyledIcon = styled.div`\n border-radius: 50%;\n`;\n\nexport const SearchIconWrapper = styled(StyledIcon)`\n position: absolute;\n border-radius: 50%;\n`;\n"],"file":"styling.cjs"}
|
|
@@ -12,12 +12,9 @@ declare const InputFieldStyling: import("styled-components").StyledComponent<"in
|
|
|
12
12
|
suppressReadOnlyStyles?: boolean | undefined;
|
|
13
13
|
}, never>;
|
|
14
14
|
declare const ValidationStyling: import("styled-components").FlattenSimpleInterpolation;
|
|
15
|
+
export declare const RequiredStar: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
15
16
|
export declare const Warning: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
16
17
|
export declare const ErrorMessage: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
17
|
-
export declare const ValidationMessage: import("styled-components").StyledComponent<"div", any, {
|
|
18
|
-
type: 'valid' | 'invalid';
|
|
19
|
-
}, never>;
|
|
20
|
-
export declare const NoteMessage: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
21
18
|
export declare const AutofilledMessage: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
22
19
|
export { ValidationStyling, InputFieldStyling };
|
|
23
20
|
export declare const StyledIcon: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
2
|
|
|
3
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11
|
|
3
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11;
|
|
4
4
|
|
|
5
5
|
import styled, { css } from 'styled-components';
|
|
6
6
|
import { BREAKPOINTS, COLORS, focusStyles } from '../styles';
|
|
7
|
-
import { ComponentXXSStyling, ComponentTextStyle, ComponentSStyling, ComponentMStyling
|
|
7
|
+
import { ComponentXXSStyling, ComponentTextStyle, ComponentSStyling, ComponentMStyling } from '../styles/typography';
|
|
8
8
|
export var InputWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n outline: none;\n ", ";\n ", "\n"])), function (props) {
|
|
9
9
|
return props.readOnly || props.disabled ? 'cursor: not-allowed;' : '';
|
|
10
10
|
}, function (props) {
|
|
@@ -12,22 +12,19 @@ export var InputWrapper = styled.div(_templateObject || (_templateObject = _tagg
|
|
|
12
12
|
});
|
|
13
13
|
var readOnlyState = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background-color: ", ";\n box-shadow: inset 0 0 0 1px ", " !important;\n color: ", " !important;\n pointer-events: none;\n outline: none;\n cursor: not-allowed;\n"])), COLORS.neutral_100, COLORS.neutral_300, COLORS.neutral_600);
|
|
14
14
|
export var activeErrorMessageState = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n box-shadow: inset 0 0 0 2px ", ";\n"])), COLORS.critical_400);
|
|
15
|
-
var InputFieldStyling = styled.input(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n height: 48px;\n width: 100%;\n border-radius: 4px;\n\n border: 0;\n -webkit-appearance: none;\n ", "\n background-color: #fff;\n box-sizing: border-box;\n padding: 0 16px !important;\n\n outline: none;\n position: relative;\n\n font-size: 16px;\n\n &::placeholder {\n ", "\n }\n\n ", " {\n font-size: 18px;\n line-height: 18px;\n height: 56px;\n padding: 0 16px !important;\n\n &::placeholder {\n ", "\n }\n }\n\n &.small {\n font-size: 16px;\n height: 48px;\n &::placeholder {\n font-size: 16px;\n }\n }\n &.medium {\n font-size: 18px;\n height: 56px;\n &::placeholder {\n font-size: 18px;\n }\n }\n\n color: ", " !important;\n\n ", "\n\n &:read-only:not(:disabled) {\n ", "\n }\n\n &:disabled {\n border: 1px solid ", ";\n pointer-events: none;\n box-shadow: none !important;\n outline: none;\n cursor: not-allowed;\n color: ", " !important;\n }\n &:focus:not(.focus-visible) {\n box-shadow: inset 0px 0px 0px 2px ", ";\n }\n\n &.focus-visible
|
|
15
|
+
var InputFieldStyling = styled.input(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n height: 48px;\n width: 100%;\n border-radius: 4px;\n\n border: 0;\n -webkit-appearance: none;\n ", "\n background-color: #fff;\n box-sizing: border-box;\n padding: 0 16px !important;\n\n outline: none;\n position: relative;\n\n font-size: 16px;\n\n &::placeholder {\n ", "\n }\n\n ", " {\n font-size: 18px;\n line-height: 18px;\n height: 56px;\n padding: 0 16px !important;\n\n &::placeholder {\n ", "\n }\n }\n\n &.small {\n font-size: 16px;\n height: 48px;\n &::placeholder {\n font-size: 16px;\n }\n }\n &.medium {\n font-size: 18px;\n height: 56px;\n &::placeholder {\n font-size: 18px;\n }\n }\n\n color: ", " !important;\n\n ", "\n\n &:read-only:not(:disabled) {\n ", "\n }\n \n &:disabled {\n border: 1px solid ", ";\n pointer-events: none;\n box-shadow: none !important;\n outline: none;\n cursor: not-allowed;\n color: ", " !important;\n }\n &:focus:not(.focus-visible) {\n box-shadow: inset 0px 0px 0px 2px ", ";\n }\n \n &.focus-visible{\n ", "\n }\n\n &.invalid {\n box-shadow: inset 0 0 0 2px ", ";\n }\n &.valid {\n box-shadow: inset 0 0 0 2px ", ";\n }\n \n &:not(.placeholder) {\n line-height: 40px;\n }\n\n &.invalid {\n margin-bottom: 0 !important;\n }\n\n &:hover {\n box-shadow: inset 0px 0px 0px 2px ", ";\n }\n\n &.active {\n box-shadow: inset 0px 0px 0px 2px ", ";\n }\n\n &.show-checkmark.valid {\n background-image: none;\n }\n\n &.show-checkmark.pending {\n background-image: none;\n }\n \n"])), function (props) {
|
|
16
16
|
return props.withoutBorder ? "-webkit-box-shadow: none;\n -moz-box-shadow: none;\n box-shadow: none;\n " : "-webkit-box-shadow: inset 0px 0px 0px 1px ".concat(COLORS.neutral_400, ";\n -moz-box-shadow: inset 0px 0px 0px 1px ").concat(COLORS.neutral_400, ";\n box-shadow: inset 0px 0px 0px 1px ").concat(COLORS.neutral_400, ";");
|
|
17
|
-
}, ComponentSStyling(ComponentTextStyle.Italic, COLORS.
|
|
17
|
+
}, ComponentSStyling(ComponentTextStyle.Italic, COLORS.neutral_600), BREAKPOINTS.MEDIUM, ComponentMStyling(ComponentTextStyle.Italic, COLORS.neutral_600), COLORS.black, function (props) {
|
|
18
18
|
return props.activeErrorMessage ? activeErrorMessageState : '';
|
|
19
19
|
}, function (props) {
|
|
20
20
|
return props.suppressReadOnlyStyles ? '' : readOnlyState;
|
|
21
21
|
}, COLORS.neutral_100, COLORS.neutral_300, COLORS.primary_800, focusStyles, COLORS.critical_400, COLORS.correct_500, COLORS.primary_700, COLORS.primary_800);
|
|
22
22
|
var ValidationStyling = css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n &.error-msg {\n ", "\n text-align: center;\n font-weight: 400;\n box-sizing: border-box;\n }\n\n &.error-msg {\n padding-top: 8px;\n padding-bottom: 0;\n ", "\n font-weight: 700;\n line-height: 15px;\n }\n"])), ComponentXXSStyling(ComponentTextStyle.Regular, COLORS.black), ComponentXXSStyling(ComponentTextStyle.Regular, '#e76468'));
|
|
23
|
-
export var
|
|
24
|
-
export var
|
|
25
|
-
export var
|
|
26
|
-
|
|
27
|
-
});
|
|
28
|
-
export var NoteMessage = styled(Warning)(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n margin: 4px 0px;\n color: ", ";\n"])), COLORS.neutral_500);
|
|
29
|
-
export var AutofilledMessage = styled(Warning)(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n color: ", ";\n"])), COLORS.neutral_600);
|
|
23
|
+
export var RequiredStar = styled.span(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n color: ", ";\n font-size: 28px;\n line-height: 12px;\n font-weight: 700;\n position: relative;\n top: 10px;\n"])), COLORS.critical_500);
|
|
24
|
+
export var Warning = styled.div(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n font-size: 12px;\n line-height: 140%;\n\n ", " {\n font-size: 14px;\n }\n\n &.small {\n font-size: 12px;\n }\n &.medium {\n font-size: 14px;\n }\n\n & * {\n vertical-align: middle;\n display: inline-block;\n }\n\n svg {\n margin-right: 4px;\n }\n"])), BREAKPOINTS.MEDIUM);
|
|
25
|
+
export var ErrorMessage = styled(Warning)(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n color: ", ";\n"])), COLORS.critical_500);
|
|
26
|
+
export var AutofilledMessage = styled(Warning)(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n color: ", ";\n"])), COLORS.neutral_600);
|
|
30
27
|
export { ValidationStyling, InputFieldStyling };
|
|
31
|
-
export var StyledIcon = styled.div(
|
|
32
|
-
export var SearchIconWrapper = styled(StyledIcon)(
|
|
28
|
+
export var StyledIcon = styled.div(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n border-radius: 50%;\n"])));
|
|
29
|
+
export var SearchIconWrapper = styled(StyledIcon)(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n position: absolute;\n border-radius: 50%;\n"])));
|
|
33
30
|
//# sourceMappingURL=styling.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/InputFields/styling.ts"],"names":["styled","css","BREAKPOINTS","COLORS","focusStyles","ComponentXXSStyling","ComponentTextStyle","ComponentSStyling","ComponentMStyling","
|
|
1
|
+
{"version":3,"sources":["../../src/InputFields/styling.ts"],"names":["styled","css","BREAKPOINTS","COLORS","focusStyles","ComponentXXSStyling","ComponentTextStyle","ComponentSStyling","ComponentMStyling","InputWrapper","div","props","readOnly","disabled","margin","readOnlyState","neutral_100","neutral_300","neutral_600","activeErrorMessageState","critical_400","InputFieldStyling","input","withoutBorder","neutral_400","Italic","MEDIUM","black","activeErrorMessage","suppressReadOnlyStyles","primary_800","correct_500","primary_700","ValidationStyling","Regular","RequiredStar","span","critical_500","Warning","ErrorMessage","AutofilledMessage","StyledIcon","SearchIconWrapper"],"mappings":";;;;AAAA,OAAOA,MAAP,IAAiBC,GAAjB,QAA4B,mBAA5B;AACA,SAAQC,WAAR,EAAq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sECZ,MAAM,CAACa,WAtER,EA2EVb,MAAM,CAACc,WA3EG,EA8EiBd,MAAM,CAAC2B,WA9ExB,EAkFjB1B,WAlFiB,EAsFWD,MAAM,CAACiB,YAtFlB,EAyFWjB,MAAM,CAAC4B,WAzFlB,EAqGiB5B,MAAM,CAAC6B,WArGxB,EAyGiB7B,MAAM,CAAC2B,WAzGxB,CAAvB;AAsHA,IAAMG,iBAAiB,GAAGhC,GAAH,uTAEjBI,mBAAmB,CAACC,kBAAkB,CAAC4B,OAApB,EAA6B/B,MAAM,CAACwB,KAApC,CAFF,EAWjBtB,mBAAmB,CAACC,kBAAkB,CAAC4B,OAApB,EAA6B,SAA7B,CAXF,CAAvB;AAiBA,OAAO,IAAMC,YAAY,GAAGnC,MAAM,CAACoC,IAAV,8LACdjC,MAAM,CAACkC,YADO,CAAlB;AAQP,OAAO,IAAMC,OAAO,GAAGtC,MAAM,CAACU,GAAV,+VAIhBR,WAAW,CAACwB,MAJI,CAAb;AAwBP,OAAO,IAAMa,YAAY,GAAGvC,MAAM,CAACsC,OAAD,CAAT,0FACdnC,MAAM,CAACkC,YADO,CAAlB;AAGP,OAAO,IAAMG,iBAAiB,GAAGxC,MAAM,CAACsC,OAAD,CAAT,0FACnBnC,MAAM,CAACe,WADY,CAAvB;AAIP,SAASe,iBAAT,EAA4BZ,iBAA5B;AAEA,OAAO,IAAMoB,UAAU,GAAGzC,MAAM,CAACU,GAAV,kGAAhB;AAIP,OAAO,IAAMgC,iBAAiB,GAAG1C,MAAM,CAACyC,UAAD,CAAT,yHAAvB","sourcesContent":["import styled, { css } from 'styled-components';\nimport {BREAKPOINTS, COLORS, focusStyles} from '../styles';\nimport { ComponentXXSStyling, ComponentTextStyle, ComponentSStyling, ComponentMStyling } from '../styles/typography';\n\nexport const InputWrapper = styled.div<{ readOnly?: boolean; disabled?: boolean; margin?: string }>`\n outline: none;\n ${(props) => (props.readOnly || props.disabled ? 'cursor: not-allowed;' : '')};\n ${(props) => (props.margin ? `margin: ${props.margin};` : '')}\n`;\n\nconst readOnlyState = css`\n background-color: ${COLORS.neutral_100};\n box-shadow: inset 0 0 0 1px ${COLORS.neutral_300} !important;\n color: ${COLORS.neutral_600} !important;\n pointer-events: none;\n outline: none;\n cursor: not-allowed;\n`;\nexport const activeErrorMessageState = css`\n box-shadow: inset 0 0 0 2px ${COLORS.critical_400};\n`;\n\nconst InputFieldStyling = styled.input<{\n activeErrorMessage?: boolean;\n active?: boolean;\n withoutBorder?: boolean;\n size?: string;\n suppressReadOnlyStyles?: boolean;\n}>`\n height: 48px;\n width: 100%;\n border-radius: 4px;\n\n border: 0;\n -webkit-appearance: none;\n ${(props) =>\n props.withoutBorder\n ? `-webkit-box-shadow: none;\n -moz-box-shadow: none;\n box-shadow: none;\n `\n : `-webkit-box-shadow: inset 0px 0px 0px 1px ${COLORS.neutral_400};\n -moz-box-shadow: inset 0px 0px 0px 1px ${COLORS.neutral_400};\n box-shadow: inset 0px 0px 0px 1px ${COLORS.neutral_400};`}\n background-color: #fff;\n box-sizing: border-box;\n padding: 0 16px !important;\n\n outline: none;\n position: relative;\n\n font-size: 16px;\n\n &::placeholder {\n ${ComponentSStyling(ComponentTextStyle.Italic, COLORS.neutral_600)}\n }\n\n ${BREAKPOINTS.MEDIUM} {\n font-size: 18px;\n line-height: 18px;\n height: 56px;\n padding: 0 16px !important;\n\n &::placeholder {\n ${ComponentMStyling(ComponentTextStyle.Italic, COLORS.neutral_600)}\n }\n }\n\n &.small {\n font-size: 16px;\n height: 48px;\n &::placeholder {\n font-size: 16px;\n }\n }\n &.medium {\n font-size: 18px;\n height: 56px;\n &::placeholder {\n font-size: 18px;\n }\n }\n\n color: ${COLORS.black} !important;\n\n ${(props) => (props.activeErrorMessage ? activeErrorMessageState : '')}\n\n &:read-only:not(:disabled) {\n ${props => props.suppressReadOnlyStyles ? '' : readOnlyState}\n }\n \n &:disabled {\n border: 1px solid ${COLORS.neutral_100};\n pointer-events: none;\n box-shadow: none !important;\n outline: none;\n cursor: not-allowed;\n color: ${COLORS.neutral_300} !important;\n }\n &:focus:not(.focus-visible) {\n box-shadow: inset 0px 0px 0px 2px ${COLORS.primary_800};\n }\n \n &.focus-visible{\n ${focusStyles}\n }\n\n &.invalid {\n box-shadow: inset 0 0 0 2px ${COLORS.critical_400};\n }\n &.valid {\n box-shadow: inset 0 0 0 2px ${COLORS.correct_500};\n }\n \n &:not(.placeholder) {\n line-height: 40px;\n }\n\n &.invalid {\n margin-bottom: 0 !important;\n }\n\n &:hover {\n box-shadow: inset 0px 0px 0px 2px ${COLORS.primary_700};\n }\n\n &.active {\n box-shadow: inset 0px 0px 0px 2px ${COLORS.primary_800};\n }\n\n &.show-checkmark.valid {\n background-image: none;\n }\n\n &.show-checkmark.pending {\n background-image: none;\n }\n \n`;\n\nconst ValidationStyling = css`\n &.error-msg {\n ${ComponentXXSStyling(ComponentTextStyle.Regular, COLORS.black)}\n text-align: center;\n font-weight: 400;\n box-sizing: border-box;\n }\n\n &.error-msg {\n padding-top: 8px;\n padding-bottom: 0;\n ${ComponentXXSStyling(ComponentTextStyle.Regular, '#e76468')}\n font-weight: 700;\n line-height: 15px;\n }\n`;\n\nexport const RequiredStar = styled.span`\n color: ${COLORS.critical_500};\n font-size: 28px;\n line-height: 12px;\n font-weight: 700;\n position: relative;\n top: 10px;\n`;\nexport const Warning = styled.div`\n font-size: 12px;\n line-height: 140%;\n\n ${BREAKPOINTS.MEDIUM} {\n font-size: 14px;\n }\n\n &.small {\n font-size: 12px;\n }\n &.medium {\n font-size: 14px;\n }\n\n & * {\n vertical-align: middle;\n display: inline-block;\n }\n\n svg {\n margin-right: 4px;\n }\n`;\nexport const ErrorMessage = styled(Warning)`\n color: ${COLORS.critical_500};\n`;\nexport const AutofilledMessage = styled(Warning)`\n color: ${COLORS.neutral_600};\n`;\n\nexport { ValidationStyling, InputFieldStyling };\n\nexport const StyledIcon = styled.div`\n border-radius: 50%;\n`;\n\nexport const SearchIconWrapper = styled(StyledIcon)`\n position: absolute;\n border-radius: 50%;\n`;\n"],"file":"styling.js"}
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports.default = void 0;
|
|
11
|
+
|
|
12
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
|
+
|
|
14
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
15
|
+
|
|
16
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
17
|
+
|
|
18
|
+
var React = _interopRequireWildcard(require("react"));
|
|
19
|
+
|
|
20
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
21
|
+
|
|
22
|
+
var _ = require("..");
|
|
23
|
+
|
|
24
|
+
var _Button = require("../Button");
|
|
25
|
+
|
|
26
|
+
var _icons = require("../icons");
|
|
27
|
+
|
|
28
|
+
var _styles = require("../styles");
|
|
29
|
+
|
|
30
|
+
var _types = require("../types");
|
|
31
|
+
|
|
32
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
33
|
+
|
|
34
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12;
|
|
35
|
+
|
|
36
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
37
|
+
|
|
38
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
39
|
+
|
|
40
|
+
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n height: ", ";\n width: ", ";\n border-radius: 4px;\n background: ", ";\n cursor: default;\n box-shadow: ", ";\n\n position: absolute; \n visibility: hidden;\n opacity: 0;\n z-index: ", ";\n\n ", "\n ", "\n\n ", "\n ", "\n\n &::after {\n height: 16px;\n width: 16px;\n content: \"\";\n position: absolute;\n background: ", ";\n\n ", "\n ", "\n\n ", "\n ", "\n"])), function (props) {
|
|
41
|
+
return props.size === _types.Size.Small ? '240px' : props.size === _types.Size.Large ? '480px' : '360px';
|
|
42
|
+
}, function (props) {
|
|
43
|
+
return props.size === _types.Size.Small ? '344px' : props.size === _types.Size.Large ? '624px' : '464px';
|
|
44
|
+
}, _.COLORS.white, _styles.BOXSHADOWS.BOXSHADOW_CENTERED, _styles.Z_INDEXES.popover, function (props) {
|
|
45
|
+
return props.position == _types.Position.Bottom ? 'right: 50%; top: calc(100% + 8px); transform: translateX(50%);' : '';
|
|
46
|
+
}, function (props) {
|
|
47
|
+
return props.position == _types.Position.Top ? 'right: 50%; bottom: calc(100% + 8px); transform: translateX(50%);' : '';
|
|
48
|
+
}, function (props) {
|
|
49
|
+
return props.position == _types.Position.Left ? 'bottom: 50%; right: calc(100% + 8px); transform: translateY(50%);' : '';
|
|
50
|
+
}, function (props) {
|
|
51
|
+
return props.position == _types.Position.Right ? 'bottom: 50%; left: calc(100% + 8px); transform: translateY(50%);' : '';
|
|
52
|
+
}, _.COLORS.white, function (props) {
|
|
53
|
+
return props.position == _types.Position.Bottom ? 'right: 50%; bottom: 100%; transform: translateY(50%) rotate(45deg);' : '';
|
|
54
|
+
}, function (props) {
|
|
55
|
+
return props.position == _types.Position.Top ? 'right: 50%; top: 100%; transform: translateY(-50%) rotate(45deg);' : '';
|
|
56
|
+
}, function (props) {
|
|
57
|
+
return props.position == _types.Position.Left ? 'bottom: 50%; left: 100%; transform: translateX(-50%) rotate(45deg);' : '';
|
|
58
|
+
}, function (props) {
|
|
59
|
+
return props.position == _types.Position.Right ? 'bottom: 50%; right: 100%; transform: translateX(50%) rotate(45deg);' : '';
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
var TopContainer = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n height: ", ";\n width: ", ";\n display: flex;\n"])), function (props) {
|
|
63
|
+
return props.size === _types.Size.Small ? '56px' : props.size === _types.Size.Large ? '72px' : '64px';
|
|
64
|
+
}, function (props) {
|
|
65
|
+
return props.size === _types.Size.Small ? '344px' : props.size === _types.Size.Large ? '624px' : '464px';
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
var MainContentWrapper = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n padding: ", ";\n"])), function (props) {
|
|
69
|
+
return props.size === _types.Size.Small ? '8px 0 8px 16px' : props.size === _types.Size.Large ? '8px 0 8px 24px' : '8px 0 8px 20px';
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
var MiddleContainer = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n height: ", ";\n width: ", ";\n padding-right: ", ";\n overflow-y: auto;\n ", "\n"])), function (props) {
|
|
73
|
+
return props.size === _types.Size.Small ? '104px' : props.size === _types.Size.Large ? '304px' : '208px';
|
|
74
|
+
}, function (props) {
|
|
75
|
+
return props.size === _types.Size.Small ? '312px' : props.size === _types.Size.Large ? '576px' : '424px';
|
|
76
|
+
}, function (props) {
|
|
77
|
+
return props.size === _types.Size.Small ? '6px' : props.size === _types.Size.Large ? '14px' : '10px';
|
|
78
|
+
}, (0, _styles.scrollBarStyling)(_types.Size.Small));
|
|
79
|
+
|
|
80
|
+
var BottomContainer = _styledComponents.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n height: ", ";\n width: ", ";\n display: flex;\n\n .bottom-flex {\n flex: 1;\n }\n"])), function (props) {
|
|
81
|
+
return props.size === _types.Size.Small ? '64px' : props.size === _types.Size.Large ? '88px' : '72px';
|
|
82
|
+
}, function (props) {
|
|
83
|
+
return props.size === _types.Size.Small ? '344px' : props.size === _types.Size.Large ? '624px' : '464px';
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
var TextContainer = _styledComponents.default.div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: column;\n margin: ", ";\n flex-grow: 1;\n"])), function (props) {
|
|
87
|
+
return renderMargins(props.note, props.size);
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
var NoteContainer = _styledComponents.default.div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n ", "\n"])), function (props) {
|
|
91
|
+
return props.size === _types.Size.Small ? (0, _styles.ComponentXXSStyling)(_.ComponentTextStyle.Regular, _.COLORS.neutral_600) : props.size === _types.Size.Large ? (0, _styles.ComponentSStyling)(_.ComponentTextStyle.Regular, _.COLORS.neutral_600) : (0, _.ComponentXSStyling)(_.ComponentTextStyle.Regular, _.COLORS.neutral_600);
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
var LabelContainer = _styledComponents.default.div(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n ", "\n"])), function (props) {
|
|
95
|
+
return props.size === _types.Size.Small ? (0, _styles.ComponentSStyling)(_.ComponentTextStyle.Bold, null) : props.size === _types.Size.Large ? (0, _styles.ComponentLStyling)(_.ComponentTextStyle.Bold, null) : (0, _styles.ComponentMStyling)(_.ComponentTextStyle.Bold, null);
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
var CloseButtonContainer = _styledComponents.default.div(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["\n margin: ", ";\n"])), function (props) {
|
|
99
|
+
return props.size === _types.Size.Small ? '4px 16px 4px 0' : props.size === _types.Size.Large ? '12px 24px 12px 0' : '8px 20px 8px 0';
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
var TextButtonContainer = _styledComponents.default.div(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2.default)(["\n margin: ", ";\n"])), function (props) {
|
|
103
|
+
return props.size === _types.Size.Small ? '8px 0 8px 16px' : props.size === _types.Size.Large ? '16px 0 16px 24px' : '12px 0 12px 20px';
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
var IconButtonContainer = _styledComponents.default.div(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2.default)(["\n margin: ", ";\n display: flex;\n"])), function (props) {
|
|
107
|
+
return props.size === _types.Size.Small ? '8px 16px 8px 0' : props.size === _types.Size.Large ? '16px 24px 16px 0' : '12px 20px 12px 0';
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
var Wrapper = _styledComponents.default.div(_templateObject12 || (_templateObject12 = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n\n .pointer-space {\n height: ", ";\n width: ", ";\n position: absolute;\n\n ", ";\n ", ";\n\n ", ";\n ", ";\n }\n\n ", "\n"])), function (props) {
|
|
111
|
+
return props.position === _types.Position.Top || props.position === _types.Position.Bottom ? '8px' : '100%';
|
|
112
|
+
}, function (props) {
|
|
113
|
+
return props.position === _types.Position.Left || props.position === _types.Position.Right ? '8px' : '100%';
|
|
114
|
+
}, function (props) {
|
|
115
|
+
return props.position === _types.Position.Left ? 'right:100%; bottom: 0%' : '';
|
|
116
|
+
}, function (props) {
|
|
117
|
+
return props.position === _types.Position.Right ? 'left:100%; bottom: 0%' : '';
|
|
118
|
+
}, function (props) {
|
|
119
|
+
return props.position === _types.Position.Top ? 'bottom: 100%' : '';
|
|
120
|
+
}, function (props) {
|
|
121
|
+
return props.position === _types.Position.Bottom ? 'top: 100%' : '';
|
|
122
|
+
}, function (props) {
|
|
123
|
+
return props.showOnClick ? "".concat(Container, " {\n visibility: ").concat(props.showPopover ? 'visible' : 'hidden', ";\n opacity: ").concat(props.showPopover ? '1' : '0', ";\n }\n cursor: pointer;") : "&:hover {\n ".concat(Container, " {\n visibility: visible;\n opacity: 1;\n }\n }");
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
var renderMargins = function renderMargins(isNotePresent, size) {
|
|
127
|
+
if (isNotePresent) {
|
|
128
|
+
return size === _types.Size.Small ? '10px 16px' : size === _types.Size.Large ? '14px 24px' : '12px 20px';
|
|
129
|
+
} else {
|
|
130
|
+
return size === _types.Size.Small ? '18px 16px' : size === _types.Size.Large ? '24px' : '20px';
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
var Popover = function Popover(_ref) {
|
|
135
|
+
var _bottomSectionProps$t, _bottomSectionProps$i;
|
|
136
|
+
|
|
137
|
+
var _ref$size = _ref.size,
|
|
138
|
+
size = _ref$size === void 0 ? _types.Size.Medium : _ref$size,
|
|
139
|
+
topSectionProps = _ref.topSectionProps,
|
|
140
|
+
bottomSectionProps = _ref.bottomSectionProps,
|
|
141
|
+
mainContent = _ref.mainContent,
|
|
142
|
+
children = _ref.children,
|
|
143
|
+
position = _ref.position,
|
|
144
|
+
_ref$showOnClick = _ref.showOnClick,
|
|
145
|
+
showOnClick = _ref$showOnClick === void 0 ? false : _ref$showOnClick;
|
|
146
|
+
|
|
147
|
+
var _React$useState = React.useState(false),
|
|
148
|
+
_React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
|
|
149
|
+
showPopover = _React$useState2[0],
|
|
150
|
+
setShowPopover = _React$useState2[1];
|
|
151
|
+
|
|
152
|
+
var popoverRef = React.useRef();
|
|
153
|
+
React.useEffect(function () {
|
|
154
|
+
var checkIfClickedOutside = function checkIfClickedOutside(e) {
|
|
155
|
+
if (showPopover && popoverRef.current && !popoverRef.current.contains(e.target)) {
|
|
156
|
+
setShowPopover(false);
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
document.addEventListener("mousedown", checkIfClickedOutside);
|
|
161
|
+
return function () {
|
|
162
|
+
document.removeEventListener("mousedown", checkIfClickedOutside);
|
|
163
|
+
};
|
|
164
|
+
}, [showPopover]);
|
|
165
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Wrapper, {
|
|
166
|
+
position: position,
|
|
167
|
+
showOnClick: showOnClick,
|
|
168
|
+
showPopover: showPopover,
|
|
169
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(Container, {
|
|
170
|
+
size: size,
|
|
171
|
+
position: position,
|
|
172
|
+
ref: popoverRef,
|
|
173
|
+
children: [!!topSectionProps && /*#__PURE__*/(0, _jsxRuntime.jsxs)(TopContainer, {
|
|
174
|
+
size: size,
|
|
175
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(TextContainer, {
|
|
176
|
+
note: !!(topSectionProps !== null && topSectionProps !== void 0 && topSectionProps.note),
|
|
177
|
+
size: size,
|
|
178
|
+
children: [(topSectionProps === null || topSectionProps === void 0 ? void 0 : topSectionProps.note) && /*#__PURE__*/(0, _jsxRuntime.jsx)(NoteContainer, {
|
|
179
|
+
size: size,
|
|
180
|
+
children: topSectionProps.note
|
|
181
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(LabelContainer, {
|
|
182
|
+
size: size,
|
|
183
|
+
children: topSectionProps === null || topSectionProps === void 0 ? void 0 : topSectionProps.text
|
|
184
|
+
})]
|
|
185
|
+
}), showOnClick && /*#__PURE__*/(0, _jsxRuntime.jsx)(CloseButtonContainer, {
|
|
186
|
+
size: size,
|
|
187
|
+
"data-testid": 'closeBtn',
|
|
188
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.IconButton, {
|
|
189
|
+
action: function action() {
|
|
190
|
+
return setShowPopover(false);
|
|
191
|
+
},
|
|
192
|
+
useTransparentBackground: true,
|
|
193
|
+
iconColor: _.COLORS.neutral_600,
|
|
194
|
+
variant: "secondary",
|
|
195
|
+
shape: "circular",
|
|
196
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.SystemIcons.Close, {})
|
|
197
|
+
})
|
|
198
|
+
})]
|
|
199
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(MainContentWrapper, {
|
|
200
|
+
size: size,
|
|
201
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(MiddleContainer, {
|
|
202
|
+
size: size,
|
|
203
|
+
children: mainContent
|
|
204
|
+
})
|
|
205
|
+
}), !!bottomSectionProps && /*#__PURE__*/(0, _jsxRuntime.jsxs)(BottomContainer, {
|
|
206
|
+
size: size,
|
|
207
|
+
children: [!!(bottomSectionProps !== null && bottomSectionProps !== void 0 && (_bottomSectionProps$t = bottomSectionProps.textButton) !== null && _bottomSectionProps$t !== void 0 && _bottomSectionProps$t.icon) && /*#__PURE__*/(0, _jsxRuntime.jsx)(TextButtonContainer, {
|
|
208
|
+
size: size,
|
|
209
|
+
"data-testid": 'textBtn',
|
|
210
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.Button, {
|
|
211
|
+
size: size,
|
|
212
|
+
variant: "secondary",
|
|
213
|
+
icon: bottomSectionProps.textButton.icon,
|
|
214
|
+
onClick: bottomSectionProps.textButton.action,
|
|
215
|
+
children: bottomSectionProps.textButton.label
|
|
216
|
+
})
|
|
217
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
218
|
+
className: "bottom-flex"
|
|
219
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(IconButtonContainer, {
|
|
220
|
+
size: size,
|
|
221
|
+
"data-testid": 'iconBtn',
|
|
222
|
+
children: bottomSectionProps === null || bottomSectionProps === void 0 ? void 0 : (_bottomSectionProps$i = bottomSectionProps.iconButtons) === null || _bottomSectionProps$i === void 0 ? void 0 : _bottomSectionProps$i.map(function (iconButton) {
|
|
223
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.IconButton, {
|
|
224
|
+
action: iconButton.action,
|
|
225
|
+
variant: "secondary",
|
|
226
|
+
shape: "circular",
|
|
227
|
+
useTransparentBackground: true,
|
|
228
|
+
children: iconButton.icon
|
|
229
|
+
});
|
|
230
|
+
})
|
|
231
|
+
})]
|
|
232
|
+
})]
|
|
233
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
234
|
+
onClick: function onClick() {
|
|
235
|
+
return showOnClick && setShowPopover(!showPopover);
|
|
236
|
+
},
|
|
237
|
+
children: [children, /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
238
|
+
className: "pointer-space"
|
|
239
|
+
})]
|
|
240
|
+
})]
|
|
241
|
+
});
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
Popover.propTypes = {
|
|
245
|
+
topSectionProps: _propTypes.default.shape({
|
|
246
|
+
text: _propTypes.default.string.isRequired,
|
|
247
|
+
note: _propTypes.default.string
|
|
248
|
+
}),
|
|
249
|
+
bottomSectionProps: _propTypes.default.shape({
|
|
250
|
+
iconButtons: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
251
|
+
icon: _propTypes.default.node.isRequired,
|
|
252
|
+
action: _propTypes.default.func.isRequired,
|
|
253
|
+
label: _propTypes.default.string
|
|
254
|
+
})),
|
|
255
|
+
textButton: _propTypes.default.shape({
|
|
256
|
+
icon: _propTypes.default.node.isRequired,
|
|
257
|
+
action: _propTypes.default.func.isRequired,
|
|
258
|
+
label: _propTypes.default.string
|
|
259
|
+
})
|
|
260
|
+
}),
|
|
261
|
+
mainContent: _propTypes.default.node.isRequired,
|
|
262
|
+
children: _propTypes.default.node.isRequired,
|
|
263
|
+
showOnClick: _propTypes.default.bool.isRequired
|
|
264
|
+
};
|
|
265
|
+
var _default = Popover;
|
|
266
|
+
exports.default = _default;
|
|
267
|
+
//# sourceMappingURL=Popover.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/Popover/Popover.tsx"],"names":["Container","styled","div","props","size","Size","Small","Large","COLORS","white","BOXSHADOWS","BOXSHADOW_CENTERED","Z_INDEXES","popover","position","Position","Bottom","Top","Left","Right","TopContainer","MainContentWrapper","MiddleContainer","BottomContainer","TextContainer","renderMargins","note","NoteContainer","ComponentTextStyle","Regular","neutral_600","LabelContainer","Bold","CloseButtonContainer","TextButtonContainer","IconButtonContainer","Wrapper","showOnClick","showPopover","isNotePresent","Popover","Medium","topSectionProps","bottomSectionProps","mainContent","children","React","useState","setShowPopover","popoverRef","useRef","useEffect","checkIfClickedOutside","e","current","contains","target","document","addEventListener","removeEventListener","text","textButton","icon","action","label","iconButtons","map","iconButton"],"mappings":";;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,IAAMA,SAAS,GAAGC,0BAAOC,GAAV,weACH,UAAAC,KAAK;AAAA,SAAEA,KAAK,CAACC,IAAN,KAAaC,YAAKC,KAAlB,GAA0B,OAA1B,GAAqCH,KAAK,CAACC,IAAN,KAAaC,YAAKE,KAAlB,GAA0B,OAA1B,GAAoC,OAA3E;AAAA,CADF,EAEJ,UAAAJ,KAAK;AAAA,SAAEA,KAAK,CAACC,IAAN,KAAaC,YAAKC,KAAlB,GAA0B,OAA1B,GAAqCH,KAAK,CAACC,IAAN,KAAaC,YAAKE,KAAlB,GAA0B,OAA1B,GAAoC,OAA3E;AAAA,CAFD,EAICC,S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D,IAA3B;AAAiC,yBAAa,SAA9C;AAAA,oBACGuC,kBADH,aACGA,kBADH,gDACGA,kBAAkB,CAAEsB,WADvB,0DACG,sBAAiCC,GAAjC,CAAqC,UAACC,UAAD;AAAA,gCAElC,qBAAC,kBAAD;AAAY,cAAA,MAAM,EAAEA,UAAU,CAACJ,MAA/B;AAAuC,cAAA,OAAO,EAAC,WAA/C;AAA2D,cAAA,KAAK,EAAC,UAAjE;AAA4E,cAAA,wBAAwB,MAApG;AAAA,wBACGI,UAAU,CAACL;AADd,cAFkC;AAAA,WAArC;AADH,UAXF;AAAA,QA/BJ;AAAA,MADF,eAuDE;AAAK,MAAA,OAAO,EAAE;AAAA,eAAIzB,WAAW,IAAIW,cAAc,CAAC,CAACV,WAAF,CAAjC;AAAA,OAAd;AAAA,iBACGO,QADH,eAGE;AAAK,QAAA,SAAS,EAAC;AAAf,QAHF;AAAA,MAvDF;AAAA,IADF;AAgED,CA5FD;;;AAREH,EAAAA,e;AAjBAkB,IAAAA,I;AACAlC,IAAAA,I;;AAiBAiB,EAAAA,kB;AAPAsB,IAAAA,W;AANAH,MAAAA,I;AACAC,MAAAA,M;AACAC,MAAAA,K;;AAKAH,IAAAA,U;AAPAC,MAAAA,I;AACAC,MAAAA,M;AACAC,MAAAA,K;;;AAYApB,EAAAA,W;AACAC,EAAAA,Q;AAEAR,EAAAA,W;;eAiGaG,O","sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\nimport { COLORS, ComponentTextStyle, ComponentXSStyling } from '..';\nimport { Button, IconButton } from '../Button';\nimport { SystemIcons } from '../icons';\nimport { BOXSHADOWS, ComponentLStyling, ComponentMStyling, ComponentSStyling, ComponentXXSStyling, scrollBarStyling, Z_INDEXES } from '../styles';\nimport { Position, Size } from '../types';\n\nconst Container = styled.div<{size: Size, position: Position}>`\n height: ${props=>props.size===Size.Small ? '240px' : (props.size===Size.Large ? '480px' : '360px')};\n width: ${props=>props.size===Size.Small ? '344px' : (props.size===Size.Large ? '624px' : '464px')};\n border-radius: 4px;\n background: ${COLORS.white};\n cursor: default;\n box-shadow: ${BOXSHADOWS.BOXSHADOW_CENTERED};\n\n position: absolute; \n visibility: hidden;\n opacity: 0;\n z-index: ${Z_INDEXES.popover};\n\n ${props => (props.position == Position.Bottom ? 'right: 50%; top: calc(100% + 8px); transform: translateX(50%);' : '')}\n ${props => (props.position == Position.Top ? 'right: 50%; bottom: calc(100% + 8px); transform: translateX(50%);' : '')}\n\n ${props => (props.position == Position.Left ? 'bottom: 50%; right: calc(100% + 8px); transform: translateY(50%);' : '')}\n ${props => (props.position == Position.Right ? 'bottom: 50%; left: calc(100% + 8px); transform: translateY(50%);' : '')}\n\n &::after {\n height: 16px;\n width: 16px;\n content: \"\";\n position: absolute;\n background: ${COLORS.white};\n\n ${props => (props.position == Position.Bottom ? 'right: 50%; bottom: 100%; transform: translateY(50%) rotate(45deg);' : '')}\n ${props => (props.position == Position.Top ? 'right: 50%; top: 100%; transform: translateY(-50%) rotate(45deg);' : '')}\n\n ${props => (props.position == Position.Left ? 'bottom: 50%; left: 100%; transform: translateX(-50%) rotate(45deg);' : '')}\n ${props => (props.position == Position.Right ? 'bottom: 50%; right: 100%; transform: translateX(50%) rotate(45deg);' : '')}\n`;\n\nconst TopContainer = styled.div<{size: Size}>`\n height: ${props=>props.size===Size.Small ? '56px' : (props.size===Size.Large ? '72px' : '64px')};\n width: ${props=>props.size===Size.Small ? '344px' : (props.size===Size.Large ? '624px' : '464px')};\n display: flex;\n`;\n\nconst MainContentWrapper = styled.div<{size: Size}>`\n padding: ${props=>props.size===Size.Small ? '8px 0 8px 16px' : (props.size===Size.Large ? '8px 0 8px 24px' : '8px 0 8px 20px')};\n`;\n\nconst MiddleContainer = styled.div<{size: Size}>`\n height: ${props=>props.size===Size.Small ? '104px' : (props.size===Size.Large ? '304px' : '208px')};\n width: ${props=>props.size===Size.Small ? '312px' : (props.size===Size.Large ? '576px' : '424px')};\n padding-right: ${props=>props.size===Size.Small ? '6px' : (props.size===Size.Large ? '14px' : '10px')};\n overflow-y: auto;\n ${scrollBarStyling(Size.Small)}\n`;\n\nconst BottomContainer = styled.div<{size: Size}>`\n height: ${props=>props.size===Size.Small ? '64px' : (props.size===Size.Large ? '88px' : '72px')};\n width: ${props=>props.size===Size.Small ? '344px' : (props.size===Size.Large ? '624px' : '464px')};\n display: flex;\n\n .bottom-flex {\n flex: 1;\n }\n`;\n\nconst TextContainer = styled.div<{note: boolean, size: Size}>`\n display: flex;\n flex-direction: column;\n margin: ${props=>renderMargins(props.note, props.size)};\n flex-grow: 1;\n`;\n\nconst NoteContainer = styled.div<{size: Size}>`\n ${props=>props.size===Size.Small ? ComponentXXSStyling(ComponentTextStyle.Regular, COLORS.neutral_600) : (props.size===Size.Large ? ComponentSStyling(ComponentTextStyle.Regular, COLORS.neutral_600) : ComponentXSStyling(ComponentTextStyle.Regular, COLORS.neutral_600))}\n`;\n\nconst LabelContainer = styled.div<{size: Size}>`\n ${props=>props.size===Size.Small ? ComponentSStyling(ComponentTextStyle.Bold, null) : (props.size===Size.Large ? ComponentLStyling(ComponentTextStyle.Bold, null) : ComponentMStyling(ComponentTextStyle.Bold, null))}\n`;\n\nconst CloseButtonContainer = styled.div<{size: Size}>`\n margin: ${props=>props.size===Size.Small ? '4px 16px 4px 0' : (props.size===Size.Large ? '12px 24px 12px 0' : '8px 20px 8px 0')};\n`;\n\nconst TextButtonContainer = styled.div<{size: Size}>`\n margin: ${props=>props.size===Size.Small ? '8px 0 8px 16px' : (props.size===Size.Large ? '16px 0 16px 24px' : '12px 0 12px 20px')};\n`;\n\nconst IconButtonContainer = styled.div<{size: Size}>`\n margin: ${props=>props.size===Size.Small ? '8px 16px 8px 0' : (props.size===Size.Large ? '16px 24px 16px 0' : '12px 20px 12px 0')};\n display: flex;\n`;\n\nconst Wrapper = styled.div<{position: Position, showOnClick: boolean, showPopover: boolean}>`\n position: relative;\n\n .pointer-space {\n height: ${props=>props.position===Position.Top || props.position===Position.Bottom ? '8px' : '100%'};\n width: ${props=>props.position===Position.Left || props.position===Position.Right ? '8px' : '100%'};\n position: absolute;\n\n ${props=>props.position===Position.Left ? 'right:100%; bottom: 0%' : ''};\n ${props=>props.position===Position.Right ? 'left:100%; bottom: 0%' : ''};\n\n ${props=>props.position===Position.Top ? 'bottom: 100%' : ''};\n ${props=>props.position===Position.Bottom ? 'top: 100%' : ''};\n }\n\n ${props=>props.showOnClick ? \n `${Container} {\n visibility: ${props.showPopover ? 'visible' : 'hidden'};\n opacity: ${props.showPopover ? '1' : '0'};\n }\n cursor: pointer;` \n : \n `&:hover {\n ${Container} {\n visibility: visible;\n opacity: 1;\n }\n }`\n }\n`;\n\nconst renderMargins = (isNotePresent: boolean, size: Size): string => {\n if(isNotePresent){\n return (size===Size.Small ? '10px 16px' : (size===Size.Large ? '14px 24px' : '12px 20px'));\n }\n else{\n return (size===Size.Small ? '18px 16px' : (size===Size.Large ? '24px' : '20px'));\n }\n}\n\ntype topSectionProps = {\n text: string;\n note?: string;\n}\n\ntype actionButtonProps = {\n icon: React.ReactNode;\n action: ()=>void;\n label?: string;\n}\n\ntype bottomSectionProps = {\n iconButtons?: actionButtonProps[];\n textButton?: actionButtonProps;\n}\n\ntype PopoverProps = {\n size?: Size.Small | Size.Medium | Size.Large;\n topSectionProps?: topSectionProps;\n bottomSectionProps?: bottomSectionProps;\n mainContent: React.ReactNode;\n children: React.ReactNode;\n position: Position.Top | Position.Bottom | Position.Right | Position.Left;\n showOnClick: boolean;\n}\n\nconst Popover: React.FunctionComponent<PopoverProps> = \n({\n size=Size.Medium,\n topSectionProps,\n bottomSectionProps,\n mainContent,\n children,\n position,\n showOnClick=false\n}) => {\n\n const [showPopover, setShowPopover] = React.useState(false);\n const popoverRef = React.useRef<any>();\n\n React.useEffect(()=>{\n const checkIfClickedOutside = (e: { target: any; }) => {\n if (showPopover && popoverRef.current && !popoverRef.current.contains(e.target)) {\n setShowPopover(false);\n }\n }\n\n document.addEventListener(\"mousedown\", checkIfClickedOutside)\n\n return () => {\n document.removeEventListener(\"mousedown\", checkIfClickedOutside)\n }\n },[showPopover]);\n\n return (\n <Wrapper position={position} showOnClick={showOnClick} showPopover={showPopover}>\n <Container size={size} position={position} ref={popoverRef}>\n {!!topSectionProps && \n <TopContainer size={size}>\n <TextContainer note={!!topSectionProps?.note} size={size}>\n {topSectionProps?.note && \n <NoteContainer size={size}>\n {topSectionProps.note}\n </NoteContainer>\n }\n <LabelContainer size={size}>\n {topSectionProps?.text}\n </LabelContainer>\n </TextContainer>\n\n {showOnClick && \n <CloseButtonContainer size={size} data-testid={'closeBtn'}>\n <IconButton action={()=>setShowPopover(false)} useTransparentBackground iconColor={COLORS.neutral_600} variant='secondary' shape='circular'>\n <SystemIcons.Close />\n </IconButton>\n </CloseButtonContainer>\n }\n </TopContainer>\n }\n\n <MainContentWrapper size={size}>\n <MiddleContainer size={size}>\n {mainContent}\n </MiddleContainer>\n </MainContentWrapper>\n\n {!!bottomSectionProps && \n <BottomContainer size={size}>\n {!!bottomSectionProps?.textButton?.icon && \n <TextButtonContainer size={size} data-testid={'textBtn'}>\n <Button size={size} variant='secondary' icon={bottomSectionProps.textButton.icon} onClick={bottomSectionProps.textButton.action}>\n {bottomSectionProps.textButton.label}\n </Button>\n </TextButtonContainer>\n }\n\n <div className='bottom-flex'/>\n \n <IconButtonContainer size={size} data-testid={'iconBtn'}>\n {bottomSectionProps?.iconButtons?.map((iconButton) =>\n \n <IconButton action={iconButton.action} variant='secondary' shape='circular' useTransparentBackground>\n {iconButton.icon}\n </IconButton> \n )}\n </IconButtonContainer>\n </BottomContainer>\n }\n </Container>\n\n <div onClick={()=>showOnClick && setShowPopover(!showPopover)}>\n {children}\n\n <div className='pointer-space'/>\n </div>\n\n </Wrapper>\n );\n};\n\nexport default Popover;"],"file":"Popover.cjs"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Position, Size } from '../types';
|
|
3
|
+
declare type topSectionProps = {
|
|
4
|
+
text: string;
|
|
5
|
+
note?: string;
|
|
6
|
+
};
|
|
7
|
+
declare type actionButtonProps = {
|
|
8
|
+
icon: React.ReactNode;
|
|
9
|
+
action: () => void;
|
|
10
|
+
label?: string;
|
|
11
|
+
};
|
|
12
|
+
declare type bottomSectionProps = {
|
|
13
|
+
iconButtons?: actionButtonProps[];
|
|
14
|
+
textButton?: actionButtonProps;
|
|
15
|
+
};
|
|
16
|
+
declare type PopoverProps = {
|
|
17
|
+
size?: Size.Small | Size.Medium | Size.Large;
|
|
18
|
+
topSectionProps?: topSectionProps;
|
|
19
|
+
bottomSectionProps?: bottomSectionProps;
|
|
20
|
+
mainContent: React.ReactNode;
|
|
21
|
+
children: React.ReactNode;
|
|
22
|
+
position: Position.Top | Position.Bottom | Position.Right | Position.Left;
|
|
23
|
+
showOnClick: boolean;
|
|
24
|
+
};
|
|
25
|
+
declare const Popover: React.FunctionComponent<PopoverProps>;
|
|
26
|
+
export default Popover;
|