beem-component 2.0.27 → 2.1.1
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/Dockerfile +4 -2
- package/Jenkinsfile +20 -5
- package/dist/components/Accordion/Accordion.js +55 -66
- package/dist/components/Accordion/Accordion.stories.js +5 -6
- package/dist/components/Avatars/avatars.js +33 -23
- package/dist/components/Avatars/avatars.stories.js +5 -10
- package/dist/components/BannerCard/bannerCard.stories.js +6 -7
- package/dist/components/BannerCard/bannerCards.js +38 -40
- package/dist/components/BmSelector/BmSelector.js +120 -0
- package/dist/components/BmSelector/BmSelector.stories.js +138 -0
- package/dist/components/ButtonGroup/buttonGroup.js +14 -15
- package/dist/components/ButtonGroup/buttonGroup.stories.js +11 -26
- package/dist/components/Buttons/Stories/basicbutton.stories.js +5 -10
- package/dist/components/Buttons/Stories/buttonAlertIcons.stories.js +4 -8
- package/dist/components/Buttons/Stories/buttonIconsOnly.stories.js +4 -8
- package/dist/components/Buttons/buttonAlertIcons.js +40 -58
- package/dist/components/Buttons/buttonDropdown copy.js +52 -35
- package/dist/components/Buttons/buttonDropdown.js +5 -3
- package/dist/components/Buttons/buttonIconsOnly.js +32 -25
- package/dist/components/Buttons/buttons.js +105 -72
- package/dist/components/Card_v2/Card.js +78 -0
- package/dist/components/Card_v2/Card.stories.js +60 -0
- package/dist/components/Cards/cards.js +3 -4
- package/dist/components/Cards/cards.stories.js +4 -5
- package/dist/components/ChatComponents/ChatBody/FeedPostComments.js +65 -39
- package/dist/components/ChatComponents/ChatBody/chatBody.js +224 -189
- package/dist/components/ChatComponents/ChatBody/chatBody.stories.js +4 -5
- package/dist/components/ChatComponents/ChatBody/sessionDetails.js +11 -9
- package/dist/components/ChatComponents/ChatBody/sessionTimeline.js +12 -10
- package/dist/components/ChatComponents/ChatHeader/chatHeader.js +3 -4
- package/dist/components/ChatComponents/ChatHeader/chatHeader.stories.js +3 -4
- package/dist/components/ChatComponents/ColorPicker/colorPicker.js +3 -6
- package/dist/components/ChatComponents/ColorPicker/colorPicker.stories.js +7 -10
- package/dist/components/ChatComponents/ContactCards/contactCards.js +40 -31
- package/dist/components/ChatComponents/ContactCards/contactCards.stories.js +3 -4
- package/dist/components/ChatComponents/FormAccordion/FormAccordion.js +3 -4
- package/dist/components/ChatComponents/FormAccordion/FormAccordion.stories.js +3 -4
- package/dist/components/ChatComponents/InfoTab/infoTab.js +3 -5
- package/dist/components/ChatComponents/InfoTab/infoTab.stories.js +3 -4
- package/dist/components/ChatComponents/LabelAccordion/LabelAccordion.js +3 -4
- package/dist/components/ChatComponents/LabelAccordion/LabelAccordion.stories.js +3 -4
- package/dist/components/ChatComponents/NoteAccordion/NoteAccordion.js +3 -4
- package/dist/components/ChatComponents/NoteAccordion/NoteAccordion.stories.js +3 -4
- package/dist/components/Chats/chat.js +56 -50
- package/dist/components/Chats/chatInput.js +9 -14
- package/dist/components/Chats/chatwrapper.js +8 -14
- package/dist/components/Checkbox/checkboxToggler.js +20 -20
- package/dist/components/Checkbox/checkboxToggler.stories.js +12 -35
- package/dist/components/InfoPanel/InfoPanel.js +141 -0
- package/dist/components/InfoPanel/InfoPanel.stories.js +200 -0
- package/dist/components/InputCounter/inputCounter.js +17 -18
- package/dist/components/Jumbotron/Jumbotron.js +8 -11
- package/dist/components/Jumbotron/Jumbotron.stories.js +3 -4
- package/dist/components/LabelWithIcon/LabelWithIcon.js +63 -0
- package/dist/components/LabelWithIcon/LabelWithIcon.stories.js +59 -0
- package/dist/components/Lists/listBox.js +21 -25
- package/dist/components/Lists/listBox.stories.js +7 -20
- package/dist/components/Lists/listHeader.stories.js +4 -8
- package/dist/components/Lists/listheader.js +17 -14
- package/dist/components/Lists/rowLabels.js +26 -24
- package/dist/components/Lists/rowLabels.stories.js +11 -18
- package/dist/components/Loader/loader.js +16 -14
- package/dist/components/Loader/loader.stories.js +4 -8
- package/dist/components/MainWrapper/index.js +3 -4
- package/dist/components/MessageCounter/MessageCounter.stories.js +4 -5
- package/dist/components/MessageCounter/messageCounter.js +15 -10
- package/dist/components/Modals/modal.js +57 -72
- package/dist/components/Modals/modals.stories.js +16 -45
- package/dist/components/MojaAccordion/MojaAccordion.js +49 -55
- package/dist/components/MultipleDateSelector/multipleDateSelector.js +14 -18
- package/dist/components/NoteBar/noteBar.js +22 -32
- package/dist/components/NoteBar/noteBar.stories.js +5 -10
- package/dist/components/PaymentBox/paymentBox.js +14 -11
- package/dist/components/PaymentBox/paymentBox.stories.js +3 -4
- package/dist/components/PerformanceIndicator/performaceIndicator.stories.js +4 -8
- package/dist/components/PerformanceIndicator/performanceIndicator.js +17 -14
- package/dist/components/Pills/pills.js +30 -38
- package/dist/components/Pills/pills.stories.js +5 -10
- package/dist/components/ProfileIcon/ProfileIcon.js +26 -36
- package/dist/components/ProfileIcon/profileIcon.stories.js +6 -12
- package/dist/components/ProgressBar/progressbar.js +14 -12
- package/dist/components/ProgressBar/progressbar.stories.js +4 -8
- package/dist/components/ProgressIndicator/ProgressIndicator.js +121 -0
- package/dist/components/ProgressIndicator/ProgressIndicator.stories.js +99 -0
- package/dist/components/ProgressRing/progressRing.js +48 -50
- package/dist/components/ProgressRing/progressRing.stories.js +5 -10
- package/dist/components/RouteLink/link.js +3 -8
- package/dist/components/RouteLink/link.stories.js +3 -4
- package/dist/components/ScrollBar/scrollBar.js +18 -26
- package/dist/components/SelectionNotice/SelectionNotice.js +57 -0
- package/dist/components/SelectionNotice/SelectionNotice.stories.js +35 -0
- package/dist/components/Stepper/stepper.js +4 -11
- package/dist/components/SuperFluid/Content/index.js +3 -4
- package/dist/components/SuperFluid/ContentTitle.js/index.js +6 -10
- package/dist/components/SuperFluid/SegmentCard/index.js +11 -21
- package/dist/components/Tabs/tabs.js +32 -24
- package/dist/components/Tabs/tabs.stories.js +6 -12
- package/dist/components/Tags/tags.js +65 -63
- package/dist/components/Tags/tags.stories.js +6 -12
- package/dist/components/breakpoints.js +3 -5
- package/dist/components/chatHeader.js +7 -12
- package/dist/components/checkbox.js +30 -25
- package/dist/components/colors.js +31 -62
- package/dist/components/contacts.js +32 -35
- package/dist/components/dropdown.js +18 -39
- package/dist/components/dropdownButton.js +38 -28
- package/dist/components/dropdownItems.js +23 -26
- package/dist/components/examples/App.js +3 -4
- package/dist/components/examples/InfoAccordion.js +3 -4
- package/dist/components/examples/chatBodyExample.js +4 -7
- package/dist/components/examples/selectExample.js +12 -30
- package/dist/components/globalStyles.js +1 -2
- package/dist/components/iconStyles.js +69 -103
- package/dist/components/index-copy.js +197 -197
- package/dist/components/index.js +106 -66
- package/dist/components/input.js +36 -25
- package/dist/components/logo.js +10 -9
- package/dist/components/navbar.js +9 -16
- package/dist/components/search.js +18 -16
- package/dist/components/shadow.js +1 -2
- package/dist/components/text.js +9 -18
- package/dist/components/typography.js +14 -28
- package/dist/components/wrapper.js +4 -6
- package/nginx.conf +26 -12
- package/package.json +3 -1
- package/src/App.js +246 -3
- package/src/lib/components/BmSelector/BmSelector.js +154 -0
- package/src/lib/components/BmSelector/BmSelector.stories.jsx +125 -0
- package/src/lib/components/Buttons/buttons.js +12 -8
- package/src/lib/components/Card_v2/Card.js +128 -0
- package/src/lib/components/Card_v2/Card.stories.jsx +94 -0
- package/src/lib/components/InfoPanel/InfoPanel.js +221 -0
- package/src/lib/components/InfoPanel/InfoPanel.stories.jsx +169 -0
- package/src/lib/components/LabelWithIcon/LabelWithIcon.js +61 -0
- package/src/lib/components/LabelWithIcon/LabelWithIcon.stories.jsx +59 -0
- package/src/lib/components/ProgressIndicator/ProgressIndicator.js +208 -0
- package/src/lib/components/ProgressIndicator/ProgressIndicator.stories.jsx +91 -0
- package/src/lib/components/SelectionNotice/SelectionNotice.js +65 -0
- package/src/lib/components/SelectionNotice/SelectionNotice.stories.jsx +40 -0
- package/src/lib/components/index.js +14 -0
- package/src/util/convertToRGBA.js +21 -0
- package/storybook-static/140.d6695a165d8dcc810b2e.manager.bundle.js +1 -0
- package/storybook-static/140.f87feb0b.iframe.bundle.js +1 -0
- package/storybook-static/149.7cc11ef8.iframe.bundle.js +2 -0
- package/storybook-static/149.7cc11ef8.iframe.bundle.js.LICENSE.txt +14 -0
- package/storybook-static/192.08b67b8c.iframe.bundle.js +1 -0
- package/storybook-static/246.9ad91c22.iframe.bundle.js +2 -0
- package/storybook-static/{vendors~main.7fe78cc2.iframe.bundle.js.LICENSE.txt → 246.9ad91c22.iframe.bundle.js.LICENSE.txt} +48 -16
- package/storybook-static/448.0ad0b2a9.iframe.bundle.js +2 -0
- package/storybook-static/448.0ad0b2a9.iframe.bundle.js.LICENSE.txt +8 -0
- package/storybook-static/448.502f738789de31a83e1c.manager.bundle.js +2 -0
- package/storybook-static/448.502f738789de31a83e1c.manager.bundle.js.LICENSE.txt +8 -0
- package/storybook-static/463.694cb3b0a2f8b0deba70.manager.bundle.js +2 -0
- package/storybook-static/463.694cb3b0a2f8b0deba70.manager.bundle.js.LICENSE.txt +31 -0
- package/storybook-static/463.7b3b5742.iframe.bundle.js +2 -0
- package/storybook-static/463.7b3b5742.iframe.bundle.js.LICENSE.txt +31 -0
- package/storybook-static/58.56a2198b.iframe.bundle.js +1 -0
- package/storybook-static/58.cd3f8ad06a1200571eab.manager.bundle.js +1 -0
- package/storybook-static/676.d74803c6ab12eac1cdb2.manager.bundle.js +2 -0
- package/storybook-static/{vendors~main.1750028c2d68e574fb1d.manager.bundle.js.LICENSE.txt → 676.d74803c6ab12eac1cdb2.manager.bundle.js.LICENSE.txt} +20 -30
- package/storybook-static/720.d729a720931e1312e597.manager.bundle.js +2 -0
- package/storybook-static/720.e12f6aa2.iframe.bundle.js +2 -0
- package/storybook-static/794.0543a68a8b5aa273273a.manager.bundle.js +1 -0
- package/storybook-static/929.5353bbe2.iframe.bundle.js +1 -0
- package/storybook-static/929.ed1807a8ea3e2353d440.manager.bundle.js +1 -0
- package/storybook-static/9b058fcb1416fea75e6c.png +0 -0
- package/storybook-static/f29af3502f15acc765a8.png +0 -0
- package/storybook-static/favicon.ico +0 -0
- package/storybook-static/iframe.html +22 -6
- package/storybook-static/index.html +66 -109
- package/storybook-static/main.1a29aa69.iframe.bundle.js +1 -0
- package/storybook-static/main.69bad789e0a3d801264b.manager.bundle.js +1 -0
- package/storybook-static/project.json +1 -0
- package/storybook-static/runtime~main.87eecef7.iframe.bundle.js +1 -0
- package/storybook-static/runtime~main.dd5308492057ff00c469.manager.bundle.js +1 -0
- package/storybook-static/static/css/main.08a2eb27.css +6 -0
- package/storybook-static/static/css/main.08a2eb27.css.map +1 -0
- package/storybook-static/0.00c62ec79c260aedbb98.manager.bundle.js +0 -2
- package/storybook-static/0.00c62ec79c260aedbb98.manager.bundle.js.LICENSE.txt +0 -8
- package/storybook-static/0.96c45dd8.iframe.bundle.js +0 -1
- package/storybook-static/1.dc6acfa9.iframe.bundle.js +0 -3
- package/storybook-static/1.dc6acfa9.iframe.bundle.js.LICENSE.txt +0 -8
- package/storybook-static/1.dc6acfa9.iframe.bundle.js.map +0 -1
- package/storybook-static/1.dc7dcdaec2def2f224fd.manager.bundle.js +0 -1
- package/storybook-static/2.24353ddc.iframe.bundle.js +0 -1
- package/storybook-static/3.8bb2173c.iframe.bundle.js +0 -1
- package/storybook-static/5.0779e3847d325dece216.manager.bundle.js +0 -1
- package/storybook-static/6.8bd405c2576206749a16.manager.bundle.js +0 -2
- package/storybook-static/7.9d4ba19cf58425e7ff0d.manager.bundle.js +0 -1
- package/storybook-static/7.f0cfc757.iframe.bundle.js +0 -1
- package/storybook-static/8.91de97de.iframe.bundle.js +0 -3
- package/storybook-static/8.91de97de.iframe.bundle.js.map +0 -1
- package/storybook-static/8.b4e9ec0ec7648e02a923.manager.bundle.js +0 -1
- package/storybook-static/9.40ec65d6.iframe.bundle.js +0 -1
- package/storybook-static/asset-manifest.json +0 -30
- package/storybook-static/main.3c8d8027.iframe.bundle.js +0 -1
- package/storybook-static/main.3e5804fe56d1f580b088.manager.bundle.js +0 -1
- package/storybook-static/runtime~main.d3a18d6a.iframe.bundle.js +0 -1
- package/storybook-static/runtime~main.ff106120648356c6069d.manager.bundle.js +0 -1
- package/storybook-static/static/css/main.b44a190d.chunk.css +0 -4
- package/storybook-static/static/css/main.b44a190d.chunk.css.map +0 -1
- package/storybook-static/vendors~main.1750028c2d68e574fb1d.manager.bundle.js +0 -2
- package/storybook-static/vendors~main.7fe78cc2.iframe.bundle.js +0 -3
- package/storybook-static/vendors~main.7fe78cc2.iframe.bundle.js.map +0 -1
- /package/storybook-static/{static/media/PoppinsMedium.0ba26f6c.woff → 0ba26f6cfe2f94ec2b43.woff} +0 -0
- /package/storybook-static/{static/media/PoppinsRegular.13b9af9c.eot → 13b9af9c8b2b4d656251.eot} +0 -0
- /package/storybook-static/{static/media/OpenSans-Regular.1b0809d5.ttf → 1b0809d519837cb7aad3.ttf} +0 -0
- /package/storybook-static/{static/media/PoppinsBold.1eae2d48.woff2 → 1eae2d48398534b6e1fe.woff2} +0 -0
- /package/storybook-static/{static/media/PoppinsRegular.43e9b50d.svg → 43e9b50d6f4141c6275f.svg} +0 -0
- /package/storybook-static/{static/media/PoppinsMedium.49b46ace.eot → 49b46acec5a811ce1edd.eot} +0 -0
- /package/storybook-static/{static/media/PoppinsRegular.4a4d5420.woff → 4a4d54208e3b43dcdd6e.woff} +0 -0
- /package/storybook-static/{static/media/PoppinsBold.53ff6749.eot → 53ff67494885a390867f.eot} +0 -0
- /package/storybook-static/{static/media/PoppinsBold.53ff971f.ttf → 53ff971f3c691d03daf6.ttf} +0 -0
- /package/storybook-static/{static/media/PoppinsSemiBold.5692c77f.ttf → 5692c77f2768f53db4fb.ttf} +0 -0
- /package/storybook-static/{static/media/PoppinsMedium.57a99fa8.woff2 → 57a99fa8569430db3aa1.woff2} +0 -0
- /package/storybook-static/{6.8bd405c2576206749a16.manager.bundle.js.LICENSE.txt → 720.d729a720931e1312e597.manager.bundle.js.LICENSE.txt} +0 -0
- /package/storybook-static/{8.91de97de.iframe.bundle.js.LICENSE.txt → 720.e12f6aa2.iframe.bundle.js.LICENSE.txt} +0 -0
- /package/storybook-static/{static/media/PoppinsSemiBold.80138c67.woff → 80138c67abf7843ea7e5.woff} +0 -0
- /package/storybook-static/{static/media/PoppinsBold.850fc4f3.svg → 850fc4f3768c0af34ea8.svg} +0 -0
- /package/storybook-static/{static/media/PoppinsRegular.9a7cc7ec.woff2 → 9a7cc7ec4e1eda4f7e6d.woff2} +0 -0
- /package/storybook-static/{static/media/PoppinsBold.b33c148b.woff → b33c148b95e9b282af64.woff} +0 -0
- /package/storybook-static/{static/media/PoppinsMedium.b7e43707.svg → b7e43707906d1445e127.svg} +0 -0
- /package/storybook-static/{static/media/PoppinsSemiBold.c442695a.eot → c442695a5fcf958609b8.eot} +0 -0
- /package/storybook-static/{static/media/PoppinsMedium.c98dddbd.ttf → c98dddbdc5b1e18988b9.ttf} +0 -0
- /package/storybook-static/{static/media/PoppinsSemiBold.e1948d56.svg → e1948d56fc87f569ef8d.svg} +0 -0
- /package/storybook-static/{static/media/PoppinsRegular.e1bc9021.ttf → e1bc9021c9d8ba86968b.ttf} +0 -0
- /package/storybook-static/{static/media/PoppinsSemiBold.f27050e2.woff2 → f27050e2684287d42c91.woff2} +0 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
const hexToRgba = function (hex) {
|
|
11
|
+
let opacity = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.6;
|
|
12
|
+
try {
|
|
13
|
+
const normalizedHex = hex === null || hex === void 0 ? void 0 : hex.replace('#', '');
|
|
14
|
+
if (!normalizedHex || normalizedHex.length !== 6 || !/^[0-9a-fA-F]{6}$/.test(normalizedHex)) {
|
|
15
|
+
throw new Error('Invalid hex');
|
|
16
|
+
}
|
|
17
|
+
const r = parseInt(normalizedHex.slice(0, 2), 16);
|
|
18
|
+
const g = parseInt(normalizedHex.slice(2, 4), 16);
|
|
19
|
+
const b = parseInt(normalizedHex.slice(4, 6), 16);
|
|
20
|
+
return "rgba(".concat(r, ", ").concat(g, ", ").concat(b, ", ").concat(opacity, ")");
|
|
21
|
+
} catch (e) {
|
|
22
|
+
return "rgba(0, 0, 0, ".concat(opacity, ")");
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
const CustomRadio = _styledComponents.default.span.withConfig({
|
|
26
|
+
displayName: "BmSelector__CustomRadio"
|
|
27
|
+
})(["display:inline-block;width:0.2143rem;height:0.2143rem;border-radius:714.2143rem;transition:all 0.1s ease-in-out;flex-shrink:0;", " @media (max-width:42.8571rem){width:0.0714rem;height:0.0714rem;}"], _ref => {
|
|
28
|
+
let {
|
|
29
|
+
selected,
|
|
30
|
+
themeColor
|
|
31
|
+
} = _ref;
|
|
32
|
+
return selected ? "\n border: .1429rem solid ".concat(themeColor || '#33B1BA', ";\n background-color: ").concat(themeColor || '#33B1BA', ";\n ") : "\n border: .1429rem solid transparent;\n background-color: transparent;\n ";
|
|
33
|
+
});
|
|
34
|
+
const RadioGroupWrapper = _styledComponents.default.div.withConfig({
|
|
35
|
+
displayName: "BmSelector__RadioGroupWrapper"
|
|
36
|
+
})(["display:flex;flex-direction:column;gap:0.75rem;@media (max-width:42.8571rem){gap:0.5rem;}"]);
|
|
37
|
+
const TimeSlotCard = _styledComponents.default.div.withConfig({
|
|
38
|
+
displayName: "BmSelector__TimeSlotCard"
|
|
39
|
+
})(["display:flex;align-items:center;gap:0.75rem;border:0.0714rem solid ", ";background-color:", ";padding:1rem 1rem;border-radius:0.5rem;transition:border-color 0.2s ease;cursor:pointer;&:hover{border-color:", ";}@media (max-width:42.8571rem){padding:0.75rem 0.75rem;gap:0.5rem;}"], _ref2 => {
|
|
40
|
+
let {
|
|
41
|
+
selected,
|
|
42
|
+
themeColor
|
|
43
|
+
} = _ref2;
|
|
44
|
+
return selected ? themeColor : "".concat(themeColor, "1A");
|
|
45
|
+
}, _ref3 => {
|
|
46
|
+
let {
|
|
47
|
+
selected,
|
|
48
|
+
themeColor
|
|
49
|
+
} = _ref3;
|
|
50
|
+
return selected ? hexToRgba(themeColor, 0.08) : 'transparent';
|
|
51
|
+
}, _ref4 => {
|
|
52
|
+
let {
|
|
53
|
+
themeColor
|
|
54
|
+
} = _ref4;
|
|
55
|
+
return themeColor;
|
|
56
|
+
});
|
|
57
|
+
const Label = _styledComponents.default.label.withConfig({
|
|
58
|
+
displayName: "BmSelector__Label"
|
|
59
|
+
})(["display:flex;align-items:center;flex:1;font-size:0.875rem;font-weight:500;cursor:pointer;svg{font-size:1.1rem;margin-right:0.4rem;color:", ";@media (max-width:42.8571rem){font-size:1rem;}}"], _ref5 => {
|
|
60
|
+
let {
|
|
61
|
+
themeColor
|
|
62
|
+
} = _ref5;
|
|
63
|
+
return themeColor || '#33B1BA';
|
|
64
|
+
});
|
|
65
|
+
const TimeText = _styledComponents.default.span.withConfig({
|
|
66
|
+
displayName: "BmSelector__TimeText"
|
|
67
|
+
})(["color:", ";", " @media (max-width:42.8571rem){font-size:0.85rem;}"], _ref6 => {
|
|
68
|
+
let {
|
|
69
|
+
textColor
|
|
70
|
+
} = _ref6;
|
|
71
|
+
return textColor || '#000';
|
|
72
|
+
}, _ref7 => {
|
|
73
|
+
let {
|
|
74
|
+
fontWeight
|
|
75
|
+
} = _ref7;
|
|
76
|
+
return fontWeight && "font-weight: ".concat(fontWeight, ";");
|
|
77
|
+
});
|
|
78
|
+
const HiddenInput = _styledComponents.default.input.attrs({
|
|
79
|
+
type: 'radio'
|
|
80
|
+
}).withConfig({
|
|
81
|
+
displayName: "BmSelector__HiddenInput"
|
|
82
|
+
})(["display:none;"]);
|
|
83
|
+
const BmSelector = _ref8 => {
|
|
84
|
+
let {
|
|
85
|
+
data = [],
|
|
86
|
+
selectedDataId,
|
|
87
|
+
onChange,
|
|
88
|
+
icon: Icon,
|
|
89
|
+
themeColor,
|
|
90
|
+
textColor,
|
|
91
|
+
fontWeight,
|
|
92
|
+
name = 'selection'
|
|
93
|
+
} = _ref8;
|
|
94
|
+
return /*#__PURE__*/_react.default.createElement(RadioGroupWrapper, null, data.map(item => {
|
|
95
|
+
const isSelected = selectedDataId === item.id;
|
|
96
|
+
return /*#__PURE__*/_react.default.createElement("label", {
|
|
97
|
+
key: item.id,
|
|
98
|
+
htmlFor: item.id
|
|
99
|
+
}, /*#__PURE__*/_react.default.createElement(HiddenInput, {
|
|
100
|
+
id: item.id,
|
|
101
|
+
name: name,
|
|
102
|
+
value: item.id,
|
|
103
|
+
checked: isSelected,
|
|
104
|
+
onChange: () => onChange(item.id)
|
|
105
|
+
}), /*#__PURE__*/_react.default.createElement(TimeSlotCard, {
|
|
106
|
+
selected: isSelected,
|
|
107
|
+
themeColor: themeColor
|
|
108
|
+
}, /*#__PURE__*/_react.default.createElement(CustomRadio, {
|
|
109
|
+
selected: isSelected,
|
|
110
|
+
themeColor: themeColor
|
|
111
|
+
}), /*#__PURE__*/_react.default.createElement(Label, {
|
|
112
|
+
htmlFor: item.id,
|
|
113
|
+
themeColor: themeColor
|
|
114
|
+
}, /*#__PURE__*/_react.default.createElement(Icon, null), /*#__PURE__*/_react.default.createElement(TimeText, {
|
|
115
|
+
fontWeight: fontWeight,
|
|
116
|
+
textColor: textColor
|
|
117
|
+
}, item.label))));
|
|
118
|
+
}));
|
|
119
|
+
};
|
|
120
|
+
var _default = exports.default = BmSelector;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.Example = exports.Default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _AccessTime = _interopRequireDefault(require("@mui/icons-material/AccessTime"));
|
|
9
|
+
var _Event = _interopRequireDefault(require("@mui/icons-material/Event"));
|
|
10
|
+
var _BmSelector = _interopRequireDefault(require("./BmSelector"));
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
13
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
14
|
+
const icons = {
|
|
15
|
+
AccessTimeIcon: _AccessTime.default,
|
|
16
|
+
EventIcon: _Event.default
|
|
17
|
+
};
|
|
18
|
+
var _default = exports.default = {
|
|
19
|
+
title: 'Components/BmSelector',
|
|
20
|
+
component: _BmSelector.default,
|
|
21
|
+
argTypes: {
|
|
22
|
+
icon: {
|
|
23
|
+
name: 'Icon',
|
|
24
|
+
control: {
|
|
25
|
+
type: 'select'
|
|
26
|
+
},
|
|
27
|
+
options: Object.keys(icons),
|
|
28
|
+
defaultValue: 'AccessTimeIcon'
|
|
29
|
+
},
|
|
30
|
+
themeColor: {
|
|
31
|
+
control: 'color',
|
|
32
|
+
defaultValue: '#33B1BA'
|
|
33
|
+
},
|
|
34
|
+
textColor: {
|
|
35
|
+
control: 'color',
|
|
36
|
+
defaultValue: '#33B1BA'
|
|
37
|
+
},
|
|
38
|
+
fontWeight: {
|
|
39
|
+
control: 'text',
|
|
40
|
+
defaultValue: ''
|
|
41
|
+
},
|
|
42
|
+
data: {
|
|
43
|
+
control: 'object',
|
|
44
|
+
defaultValue: [{
|
|
45
|
+
id: 'slot-1',
|
|
46
|
+
label: '08:00 AM - 08:30 AM',
|
|
47
|
+
value: {
|
|
48
|
+
startDate: '08:00 AM',
|
|
49
|
+
endDate: '08:30 AM'
|
|
50
|
+
}
|
|
51
|
+
}, {
|
|
52
|
+
id: 'slot-2',
|
|
53
|
+
label: '09:00 AM - 09:30 AM',
|
|
54
|
+
value: {
|
|
55
|
+
startDate: '09:00 AM',
|
|
56
|
+
endDate: '09:30 AM'
|
|
57
|
+
}
|
|
58
|
+
}]
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
const baseSlots = [{
|
|
63
|
+
id: 'slot-1',
|
|
64
|
+
// ⚠️ id is mandatory for tracking selection
|
|
65
|
+
label: '10:00 AM - 10:30 AM',
|
|
66
|
+
value: {
|
|
67
|
+
startDate: '10:00 AM',
|
|
68
|
+
endDate: '10:30 AM'
|
|
69
|
+
}
|
|
70
|
+
}, {
|
|
71
|
+
id: 'slot-2',
|
|
72
|
+
label: '10:30 AM - 11:10 AM',
|
|
73
|
+
value: {
|
|
74
|
+
startDate: '10:30 AM',
|
|
75
|
+
endDate: '11:10 AM'
|
|
76
|
+
}
|
|
77
|
+
}];
|
|
78
|
+
const Default = args => {
|
|
79
|
+
var _args$data$0$id, _args$data;
|
|
80
|
+
const [selectedDataId, setSelectedDataId] = (0, _react.useState)((_args$data$0$id = (_args$data = args.data) === null || _args$data === void 0 || (_args$data = _args$data[0]) === null || _args$data === void 0 ? void 0 : _args$data.id) !== null && _args$data$0$id !== void 0 ? _args$data$0$id : '');
|
|
81
|
+
return /*#__PURE__*/_react.default.createElement(_BmSelector.default, _extends({}, args, {
|
|
82
|
+
data: baseSlots,
|
|
83
|
+
selectedDataId: selectedDataId,
|
|
84
|
+
onChange: setSelectedDataId,
|
|
85
|
+
icon: icons[args.iconKey] || _AccessTime.default
|
|
86
|
+
}));
|
|
87
|
+
};
|
|
88
|
+
exports.Default = Default;
|
|
89
|
+
Default.args = {
|
|
90
|
+
data: [{
|
|
91
|
+
id: 'slot-1',
|
|
92
|
+
label: '08:00 AM - 08:30 AM',
|
|
93
|
+
value: {
|
|
94
|
+
startDate: '08:00 AM',
|
|
95
|
+
endDate: '08:30 AM'
|
|
96
|
+
}
|
|
97
|
+
}, {
|
|
98
|
+
id: 'slot-2',
|
|
99
|
+
label: '09:00 AM - 09:30 AM',
|
|
100
|
+
value: {
|
|
101
|
+
startDate: '09:00 AM',
|
|
102
|
+
endDate: '09:30 AM'
|
|
103
|
+
}
|
|
104
|
+
}],
|
|
105
|
+
themeColor: '#33B1BA',
|
|
106
|
+
textColor: '#33B1BA',
|
|
107
|
+
fontWeight: '',
|
|
108
|
+
icon: 'AccessTimeIcon'
|
|
109
|
+
};
|
|
110
|
+
const Example = () => {
|
|
111
|
+
const slots = [{
|
|
112
|
+
id: 'slot-1',
|
|
113
|
+
// ⚠️ id is required
|
|
114
|
+
label: '10:00 AM - 10:30 AM',
|
|
115
|
+
value: {
|
|
116
|
+
startDate: '10:00 AM',
|
|
117
|
+
endDate: '10:30 AM'
|
|
118
|
+
}
|
|
119
|
+
}, {
|
|
120
|
+
id: 'slot-2',
|
|
121
|
+
label: '10:30 AM - 11:10 AM',
|
|
122
|
+
value: {
|
|
123
|
+
startDate: '10:30 AM',
|
|
124
|
+
endDate: '11:10 AM'
|
|
125
|
+
}
|
|
126
|
+
}];
|
|
127
|
+
const [selectedDataId, setSelectedDataId] = (0, _react.useState)(null);
|
|
128
|
+
return /*#__PURE__*/_react.default.createElement(_BmSelector.default, {
|
|
129
|
+
data: slots,
|
|
130
|
+
selectedDataId: selectedDataId,
|
|
131
|
+
onChange: setSelectedDataId,
|
|
132
|
+
icon: _AccessTime.default,
|
|
133
|
+
themeColor: "#33B1BA",
|
|
134
|
+
textColor: "#33B1BA",
|
|
135
|
+
fontWeight: "600"
|
|
136
|
+
});
|
|
137
|
+
};
|
|
138
|
+
exports.Example = Example;
|
|
@@ -8,30 +8,29 @@ var _polished = require("polished");
|
|
|
8
8
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
9
9
|
var _colors = require("../colors");
|
|
10
10
|
var _tabs = require("../Tabs/tabs");
|
|
11
|
-
function _interopRequireDefault(
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
12
|
/* eslint-disable consistent-return */
|
|
13
13
|
/* eslint-disable no-unused-vars */
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
const BmButtonGroup = _styledComponents.default.div.withConfig({
|
|
16
16
|
displayName: "buttonGroup__BmButtonGroup"
|
|
17
|
-
})(["display:inline-flex;border:0.071rem solid ", ";background:", ";padding:0.25rem;"], _colors.BmPrimaryWhite,
|
|
18
|
-
|
|
19
|
-
});
|
|
20
|
-
var Item = (0, _styledComponents.default)(_tabs.BmTab).withConfig({
|
|
17
|
+
})(["display:inline-flex;border:0.071rem solid ", ";background:", ";padding:0.25rem;"], _colors.BmPrimaryWhite, props => props.bgColor ? props.bgColor : _colors.BmGrey50);
|
|
18
|
+
const Item = (0, _styledComponents.default)(_tabs.BmTab).withConfig({
|
|
21
19
|
displayName: "buttonGroup__Item"
|
|
22
|
-
})(["", ";box-shadow:none !important;background:", ";border-radius:0rem;padding:0.5rem 2rem;&:hover{background:", ";}"],
|
|
23
|
-
|
|
20
|
+
})(["", ";box-shadow:none !important;background:", ";border-radius:0rem;padding:0.5rem 2rem;&:hover{background:", ";}"], _ref => {
|
|
21
|
+
let {
|
|
22
|
+
active
|
|
23
|
+
} = _ref;
|
|
24
24
|
return active && " \n border: 0.071rem solid ".concat(_colors.BmPrimaryWhite, ";\n background: ").concat(_colors.BmPrimaryWhite, " !important;\n ");
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
}, props => props.bgColor ? props.bgColor : _colors.BmGrey50, _ref2 => {
|
|
26
|
+
let {
|
|
27
|
+
bgColor,
|
|
28
|
+
active
|
|
29
|
+
} = _ref2;
|
|
30
30
|
if (!active) {
|
|
31
31
|
if (bgColor) return "".concat((0, _polished.darken)(0.1, bgColor));
|
|
32
32
|
return "".concat((0, _polished.darken)(0.1, _colors.BmGrey50));
|
|
33
33
|
}
|
|
34
34
|
});
|
|
35
35
|
BmButtonGroup.Item = Item;
|
|
36
|
-
var _default = BmButtonGroup;
|
|
37
|
-
exports.default = _default;
|
|
36
|
+
var _default = exports.default = BmButtonGroup;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -8,33 +7,19 @@ exports.default = exports.BasicSample = void 0;
|
|
|
8
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
8
|
var _buttonGroup = _interopRequireDefault(require("./buttonGroup"));
|
|
10
9
|
require("../../../main.scss");
|
|
11
|
-
function _interopRequireDefault(
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
16
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
17
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
18
|
-
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
19
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
20
|
-
var _default = {
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
12
|
+
/* eslint-disable import/no-anonymous-default-export */
|
|
13
|
+
var _default = exports.default = {
|
|
21
14
|
component: _buttonGroup.default,
|
|
22
15
|
title: 'components/ButtonGroup'
|
|
23
16
|
};
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return /*#__PURE__*/_react.default.createElement(_buttonGroup.default, null, Occurance && Occurance.map(function (e) {
|
|
32
|
-
return /*#__PURE__*/_react.default.createElement(_buttonGroup.default.Item, {
|
|
33
|
-
onClick: function onClick() {
|
|
34
|
-
return setItem(e);
|
|
35
|
-
},
|
|
36
|
-
active: e === item
|
|
37
|
-
}, /*#__PURE__*/_react.default.createElement("p", null, e));
|
|
38
|
-
}));
|
|
17
|
+
const BasicSample = () => {
|
|
18
|
+
const [item, setItem] = (0, _react.useState)();
|
|
19
|
+
const Occurance = ['Now', 'Later', 'Recurring'];
|
|
20
|
+
return /*#__PURE__*/_react.default.createElement(_buttonGroup.default, null, Occurance && Occurance.map(e => /*#__PURE__*/_react.default.createElement(_buttonGroup.default.Item, {
|
|
21
|
+
onClick: () => setItem(e),
|
|
22
|
+
active: e === item
|
|
23
|
+
}, /*#__PURE__*/_react.default.createElement("p", null, e))));
|
|
39
24
|
};
|
|
40
25
|
exports.BasicSample = BasicSample;
|
|
@@ -7,9 +7,9 @@ exports.default = exports.ColoredButton = exports.BasicButton = void 0;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _icons = require("@material-ui/icons");
|
|
9
9
|
var _buttons = require("../buttons");
|
|
10
|
-
function _interopRequireDefault(
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
11
|
/* eslint-disable import/no-anonymous-default-export */
|
|
12
|
-
var _default = {
|
|
12
|
+
var _default = exports.default = {
|
|
13
13
|
component: _buttons.BmButton,
|
|
14
14
|
title: 'components/Buttons/Basic',
|
|
15
15
|
argTypes: {
|
|
@@ -48,12 +48,8 @@ var _default = {
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
};
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
return /*#__PURE__*/_react.default.createElement(_buttons.BmButton, args);
|
|
54
|
-
};
|
|
55
|
-
var BasicButton = MainButton.bind({});
|
|
56
|
-
exports.BasicButton = BasicButton;
|
|
51
|
+
const MainButton = args => /*#__PURE__*/_react.default.createElement(_buttons.BmButton, args);
|
|
52
|
+
const BasicButton = exports.BasicButton = MainButton.bind({});
|
|
57
53
|
BasicButton.args = {
|
|
58
54
|
variant: 'primary',
|
|
59
55
|
size: 'large',
|
|
@@ -61,8 +57,7 @@ BasicButton.args = {
|
|
|
61
57
|
leadingIcon: /*#__PURE__*/_react.default.createElement(_icons.Home, null),
|
|
62
58
|
trailingIcon: /*#__PURE__*/_react.default.createElement(_icons.Favorite, null)
|
|
63
59
|
};
|
|
64
|
-
|
|
65
|
-
exports.ColoredButton = ColoredButton;
|
|
60
|
+
const ColoredButton = exports.ColoredButton = MainButton.bind({});
|
|
66
61
|
ColoredButton.args = {
|
|
67
62
|
variant: 'primary',
|
|
68
63
|
size: 'large',
|
|
@@ -7,9 +7,9 @@ exports.default = exports.ButtonAlertIcon = void 0;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _icons = require("@material-ui/icons");
|
|
9
9
|
var _buttonAlertIcons = require("../buttonAlertIcons");
|
|
10
|
-
function _interopRequireDefault(
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
11
|
/* eslint-disable import/no-anonymous-default-export */
|
|
12
|
-
var _default = {
|
|
12
|
+
var _default = exports.default = {
|
|
13
13
|
component: _buttonAlertIcons.BmAlertIcon,
|
|
14
14
|
title: 'components/Buttons/AlertIcons',
|
|
15
15
|
argTypes: {
|
|
@@ -43,12 +43,8 @@ var _default = {
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
};
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
return /*#__PURE__*/_react.default.createElement(_buttonAlertIcons.BmAlertIcon, args);
|
|
49
|
-
};
|
|
50
|
-
var ButtonAlertIcon = MainButtonAlertIcon.bind({});
|
|
51
|
-
exports.ButtonAlertIcon = ButtonAlertIcon;
|
|
46
|
+
const MainButtonAlertIcon = args => /*#__PURE__*/_react.default.createElement(_buttonAlertIcons.BmAlertIcon, args);
|
|
47
|
+
const ButtonAlertIcon = exports.ButtonAlertIcon = MainButtonAlertIcon.bind({});
|
|
52
48
|
ButtonAlertIcon.args = {
|
|
53
49
|
icon: /*#__PURE__*/_react.default.createElement(_icons.AssignmentLateOutlined, null),
|
|
54
50
|
badgeContent: 4,
|
|
@@ -7,9 +7,9 @@ exports.default = exports.ButtonIcon = void 0;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _icons = require("@material-ui/icons");
|
|
9
9
|
var _buttonIconsOnly = require("../buttonIconsOnly");
|
|
10
|
-
function _interopRequireDefault(
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
11
|
/* eslint-disable import/no-anonymous-default-export */
|
|
12
|
-
var _default = {
|
|
12
|
+
var _default = exports.default = {
|
|
13
13
|
component: _buttonIconsOnly.BmBtnIcon,
|
|
14
14
|
title: 'components/Buttons/IconsOnly',
|
|
15
15
|
argTypes: {
|
|
@@ -44,12 +44,8 @@ var _default = {
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
return /*#__PURE__*/_react.default.createElement(_buttonIconsOnly.BmBtnIcon, args);
|
|
50
|
-
};
|
|
51
|
-
var ButtonIcon = MainButtonIcon.bind({});
|
|
52
|
-
exports.ButtonIcon = ButtonIcon;
|
|
47
|
+
const MainButtonIcon = args => /*#__PURE__*/_react.default.createElement(_buttonIconsOnly.BmBtnIcon, args);
|
|
48
|
+
const ButtonIcon = exports.ButtonIcon = MainButtonIcon.bind({});
|
|
53
49
|
ButtonIcon.args = {
|
|
54
50
|
icon: /*#__PURE__*/_react.default.createElement(_icons.Favorite, null),
|
|
55
51
|
size: 'large',
|
|
@@ -11,71 +11,53 @@ var _styles = require("@material-ui/core/styles");
|
|
|
11
11
|
var _Badge = _interopRequireDefault(require("@material-ui/core/Badge"));
|
|
12
12
|
var _colors = require("../colors");
|
|
13
13
|
var _typography = require("../typography");
|
|
14
|
-
|
|
15
|
-
function _interopRequireDefault(
|
|
16
|
-
function _objectWithoutProperties(
|
|
17
|
-
function _objectWithoutPropertiesLoose(
|
|
18
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
19
|
-
|
|
14
|
+
const _excluded = ["icon", "badgeContent", "badgeColor", "size"];
|
|
15
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
17
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
18
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } /* eslint-disable no-shadow */
|
|
19
|
+
const size = props => {
|
|
20
20
|
if (props.size === 'small') return '1.429rem';
|
|
21
21
|
if (props.size === 'medium') return '1.714rem';
|
|
22
22
|
if (props.size === 'large') return '2.286rem';
|
|
23
23
|
return '2.286rem';
|
|
24
24
|
};
|
|
25
|
-
|
|
25
|
+
const Badgesize = props => {
|
|
26
26
|
if (props.size === 'small') return '0.857rem';
|
|
27
27
|
if (props.size === 'medium') return '0.857rem';
|
|
28
28
|
if (props.size === 'large') return '0.857rem';
|
|
29
29
|
return '0.857rem';
|
|
30
30
|
};
|
|
31
|
-
|
|
31
|
+
const AlertIcon = {
|
|
32
32
|
root: {
|
|
33
|
-
height:
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
width: function width(props) {
|
|
37
|
-
return size(props);
|
|
38
|
-
},
|
|
39
|
-
fill: function fill(props) {
|
|
40
|
-
return props.color || "".concat(_colors.BmSecondaryGrey);
|
|
41
|
-
}
|
|
33
|
+
height: props => size(props),
|
|
34
|
+
width: props => size(props),
|
|
35
|
+
fill: props => props.color || "".concat(_colors.BmSecondaryGrey)
|
|
42
36
|
}
|
|
43
37
|
};
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
fontFamily: "".concat(_typography.PoppinsMedium),
|
|
61
|
-
fontStyle: 'normal',
|
|
62
|
-
fontWeight: 500,
|
|
63
|
-
fontSize: '0.643rem',
|
|
64
|
-
display: 'flex',
|
|
65
|
-
alignItems: 'center',
|
|
66
|
-
textAlign: 'center',
|
|
67
|
-
letterSpacing: '-0.02em'
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
var BmBadge = (0, _styles.withStyles)(BadgeIcon)(function (props) {
|
|
72
|
-
return /*#__PURE__*/_react.default.createElement(_Badge.default, _extends({
|
|
73
|
-
action: true
|
|
74
|
-
}, props));
|
|
38
|
+
const BadgeIcon = () => ({
|
|
39
|
+
badge: {
|
|
40
|
+
height: props => Badgesize(props),
|
|
41
|
+
width: props => Badgesize(props),
|
|
42
|
+
minWidth: props => Badgesize(props),
|
|
43
|
+
background: props => props.badgeColor || "".concat(_colors.BmSecondaryRed),
|
|
44
|
+
color: "".concat(_colors.BmPrimaryWhite),
|
|
45
|
+
fontFamily: "".concat(_typography.PoppinsMedium),
|
|
46
|
+
fontStyle: 'normal',
|
|
47
|
+
fontWeight: 500,
|
|
48
|
+
fontSize: '0.643rem',
|
|
49
|
+
display: 'flex',
|
|
50
|
+
alignItems: 'center',
|
|
51
|
+
textAlign: 'center',
|
|
52
|
+
letterSpacing: '-0.02em'
|
|
53
|
+
}
|
|
75
54
|
});
|
|
76
|
-
|
|
55
|
+
const BmBadge = (0, _styles.withStyles)(BadgeIcon)(props => /*#__PURE__*/_react.default.createElement(_Badge.default, _extends({
|
|
56
|
+
action: true
|
|
57
|
+
}, props)));
|
|
58
|
+
const BmIcon = exports.BmIcon = (0, _styles.withStyles)(AlertIcon)(props => {
|
|
77
59
|
if (props.icon) {
|
|
78
|
-
|
|
60
|
+
const Icon = props.icon.type;
|
|
79
61
|
return /*#__PURE__*/_react.default.createElement(BmBadge, {
|
|
80
62
|
badgeContent: props.badgeContent,
|
|
81
63
|
badgeColor: props.badgeColor,
|
|
@@ -86,16 +68,16 @@ var BmIcon = (0, _styles.withStyles)(AlertIcon)(function (props) {
|
|
|
86
68
|
}
|
|
87
69
|
return null;
|
|
88
70
|
});
|
|
89
|
-
exports.
|
|
90
|
-
var BmBtnIconWrapper = _styledComponents.default.button.withConfig({
|
|
71
|
+
const BmBtnIconWrapper = exports.BmBtnIconWrapper = _styledComponents.default.button.withConfig({
|
|
91
72
|
displayName: "buttonAlertIcons__BmBtnIconWrapper"
|
|
92
73
|
})(["display:flex;flex-direction:row;justify-content:center;align-items:center;padding:0.536rem;border:none;background:none;"]);
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
74
|
+
const BmAlertIcon = props => {
|
|
75
|
+
const {
|
|
76
|
+
icon,
|
|
77
|
+
badgeContent,
|
|
78
|
+
badgeColor,
|
|
79
|
+
size
|
|
80
|
+
} = props,
|
|
99
81
|
rest = _objectWithoutProperties(props, _excluded);
|
|
100
82
|
return /*#__PURE__*/_react.default.createElement(BmBtnIconWrapper, null, /*#__PURE__*/_react.default.createElement(BmIcon, _extends({
|
|
101
83
|
icon: icon,
|