beem-component 2.0.27 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +127 -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,221 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
const hexToRgba = (hex, opacity = 0.6) => {
|
|
5
|
+
try {
|
|
6
|
+
const normalizedHex = hex?.replace('#', '');
|
|
7
|
+
if (
|
|
8
|
+
!normalizedHex ||
|
|
9
|
+
normalizedHex.length !== 6 ||
|
|
10
|
+
!/^[0-9a-fA-F]{6}$/.test(normalizedHex)
|
|
11
|
+
) {
|
|
12
|
+
throw new Error('Invalid hex');
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const r = parseInt(normalizedHex.slice(0, 2), 16);
|
|
16
|
+
const g = parseInt(normalizedHex.slice(2, 4), 16);
|
|
17
|
+
const b = parseInt(normalizedHex.slice(4, 6), 16);
|
|
18
|
+
return `rgba(${r}, ${g}, ${b}, ${opacity})`;
|
|
19
|
+
} catch (e) {
|
|
20
|
+
return `rgba(0, 0, 0, ${opacity})`;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const Panel = styled.div`
|
|
25
|
+
border: 0.0714rem solid rgba(51, 177, 186, 0.1);
|
|
26
|
+
border-radius: 0.5rem;
|
|
27
|
+
overflow: hidden;
|
|
28
|
+
`;
|
|
29
|
+
const SectionSummaryContainer = styled.div`
|
|
30
|
+
display: flex;
|
|
31
|
+
align-items: center;
|
|
32
|
+
margin-bottom: 1rem;
|
|
33
|
+
|
|
34
|
+
@media (min-width: 45.7143rem) {
|
|
35
|
+
margin-bottom: 1.25rem;
|
|
36
|
+
}
|
|
37
|
+
`;
|
|
38
|
+
|
|
39
|
+
const IconBox = styled.div`
|
|
40
|
+
display: flex;
|
|
41
|
+
align-items: center;
|
|
42
|
+
justify-content: center;
|
|
43
|
+
text-align: center;
|
|
44
|
+
margin-right: 0.5rem;
|
|
45
|
+
padding: 0.5rem;
|
|
46
|
+
border-radius: 714.2143rem;
|
|
47
|
+
background-color: ${({ iconBackgroundColor, iconColor }) =>
|
|
48
|
+
iconBackgroundColor && hexToRgba(iconColor, 0.1)};
|
|
49
|
+
|
|
50
|
+
svg {
|
|
51
|
+
height: 1.2rem;
|
|
52
|
+
width: 1.2rem;
|
|
53
|
+
color: ${({ iconColor }) => iconColor || '#00000'};
|
|
54
|
+
|
|
55
|
+
@media (min-width: 45.7143rem) {
|
|
56
|
+
height: 1.5rem;
|
|
57
|
+
width: 1.5rem;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
`;
|
|
61
|
+
|
|
62
|
+
const TextBox = styled.div`
|
|
63
|
+
display: flex;
|
|
64
|
+
flex-direction: column;
|
|
65
|
+
`;
|
|
66
|
+
|
|
67
|
+
const SummaryTitle = styled.p`
|
|
68
|
+
font-weight: 500;
|
|
69
|
+
margin: 0;
|
|
70
|
+
color: ${({ textColor }) => textColor || '#00000'};
|
|
71
|
+
`;
|
|
72
|
+
|
|
73
|
+
const SummarySubtitle = styled.p`
|
|
74
|
+
font-size: 0.75rem;
|
|
75
|
+
color: ${({ textColor }) => hexToRgba(textColor || '#000000', 0.6)};
|
|
76
|
+
margin: 0;
|
|
77
|
+
|
|
78
|
+
@media (min-width: 45.7143rem) {
|
|
79
|
+
font-size: 0.875rem;
|
|
80
|
+
}
|
|
81
|
+
`;
|
|
82
|
+
|
|
83
|
+
const SectionContainer = styled.div`
|
|
84
|
+
padding: 0.75rem 1rem;
|
|
85
|
+
display: flex;
|
|
86
|
+
align-items: center;
|
|
87
|
+
gap: 0.5rem;
|
|
88
|
+
|
|
89
|
+
${({ backgroundColor }) =>
|
|
90
|
+
backgroundColor &&
|
|
91
|
+
`
|
|
92
|
+
background-color: ${hexToRgba(backgroundColor, 0.05)};
|
|
93
|
+
`}
|
|
94
|
+
|
|
95
|
+
@media (max-width: 42.8571rem) {
|
|
96
|
+
padding: 0.5rem 0.75rem;
|
|
97
|
+
gap: 0.25rem;
|
|
98
|
+
}
|
|
99
|
+
`;
|
|
100
|
+
|
|
101
|
+
const SectionTitle = styled.h3`
|
|
102
|
+
font-size: 1.1rem;
|
|
103
|
+
font-weight: 500;
|
|
104
|
+
display: flex;
|
|
105
|
+
align-items: center;
|
|
106
|
+
margin: 0;
|
|
107
|
+
|
|
108
|
+
@media (max-width: 42.8571rem) {
|
|
109
|
+
font-size: 0.9rem;
|
|
110
|
+
}
|
|
111
|
+
`;
|
|
112
|
+
|
|
113
|
+
const SectionBody = styled.div`
|
|
114
|
+
padding: 1rem;
|
|
115
|
+
display: flex;
|
|
116
|
+
flex-direction: column;
|
|
117
|
+
gap: 0.5rem;
|
|
118
|
+
|
|
119
|
+
@media (max-width: 42.8571rem) {
|
|
120
|
+
padding: 0.75rem;
|
|
121
|
+
gap: 0.4rem;
|
|
122
|
+
}
|
|
123
|
+
`;
|
|
124
|
+
|
|
125
|
+
const RowContainer = styled.div`
|
|
126
|
+
display: flex;
|
|
127
|
+
justify-content: space-between;
|
|
128
|
+
font-size: 0.875rem;
|
|
129
|
+
align-items: center;
|
|
130
|
+
|
|
131
|
+
@media (max-width: 42.8571rem) {
|
|
132
|
+
font-size: 0.8rem;
|
|
133
|
+
}
|
|
134
|
+
`;
|
|
135
|
+
|
|
136
|
+
const Label = styled.span`
|
|
137
|
+
color: rgba(0, 0, 0, 0.6);
|
|
138
|
+
|
|
139
|
+
@media (max-width: 42.8571rem) {
|
|
140
|
+
font-size: 0.75rem;
|
|
141
|
+
}
|
|
142
|
+
`;
|
|
143
|
+
|
|
144
|
+
const Value = styled.span`
|
|
145
|
+
font-weight: 500;
|
|
146
|
+
|
|
147
|
+
@media (max-width: 42.8571rem) {
|
|
148
|
+
font-size: 0.75rem;
|
|
149
|
+
}
|
|
150
|
+
`;
|
|
151
|
+
|
|
152
|
+
const Divider = styled.hr`
|
|
153
|
+
border: none;
|
|
154
|
+
border-top: 0.0714rem dashed rgba(51, 177, 186, 0.2);
|
|
155
|
+
margin: 1rem auto;
|
|
156
|
+
max-width: 97%;
|
|
157
|
+
@media (max-width: 42.8571rem) {
|
|
158
|
+
margin: 0.75rem auto;
|
|
159
|
+
max-width: 97%;
|
|
160
|
+
}
|
|
161
|
+
`;
|
|
162
|
+
const SectionSummary = ({
|
|
163
|
+
icon: Icon,
|
|
164
|
+
title,
|
|
165
|
+
iconColor,
|
|
166
|
+
textColor,
|
|
167
|
+
subtitle,
|
|
168
|
+
iconBackgroundColor,
|
|
169
|
+
}) => (
|
|
170
|
+
<SectionSummaryContainer>
|
|
171
|
+
{Icon && (
|
|
172
|
+
<IconBox iconColor={iconColor} iconBackgroundColor={iconBackgroundColor}>
|
|
173
|
+
<Icon />
|
|
174
|
+
</IconBox>
|
|
175
|
+
)}
|
|
176
|
+
<TextBox>
|
|
177
|
+
<SummaryTitle textColor={textColor}>{title}</SummaryTitle>
|
|
178
|
+
<SummarySubtitle textColor={textColor}>{subtitle}</SummarySubtitle>
|
|
179
|
+
</TextBox>
|
|
180
|
+
</SectionSummaryContainer>
|
|
181
|
+
);
|
|
182
|
+
const BmInfoPanel = ({ children }) => <Panel>{children}</Panel>;
|
|
183
|
+
|
|
184
|
+
const Section = ({
|
|
185
|
+
title,
|
|
186
|
+
icon: Icon,
|
|
187
|
+
children,
|
|
188
|
+
showDivider,
|
|
189
|
+
backgroundColor,
|
|
190
|
+
iconColor,
|
|
191
|
+
iconBackgroundColor,
|
|
192
|
+
}) => (
|
|
193
|
+
<>
|
|
194
|
+
{showDivider && <Divider />}
|
|
195
|
+
<SectionContainer backgroundColor={backgroundColor}>
|
|
196
|
+
{Icon && (
|
|
197
|
+
<IconBox
|
|
198
|
+
iconColor={iconColor}
|
|
199
|
+
iconBackgroundColor={iconBackgroundColor}
|
|
200
|
+
>
|
|
201
|
+
<Icon />
|
|
202
|
+
</IconBox>
|
|
203
|
+
)}
|
|
204
|
+
<SectionTitle>{title}</SectionTitle>
|
|
205
|
+
</SectionContainer>
|
|
206
|
+
<SectionBody>{children}</SectionBody>
|
|
207
|
+
</>
|
|
208
|
+
);
|
|
209
|
+
|
|
210
|
+
const Row = ({ label, value }) => (
|
|
211
|
+
<RowContainer>
|
|
212
|
+
<Label>{label}:</Label>
|
|
213
|
+
<Value>{value}</Value>
|
|
214
|
+
</RowContainer>
|
|
215
|
+
);
|
|
216
|
+
|
|
217
|
+
BmInfoPanel.Section = Section;
|
|
218
|
+
BmInfoPanel.Row = Row;
|
|
219
|
+
BmInfoPanel.SectionSummary = SectionSummary;
|
|
220
|
+
|
|
221
|
+
export default BmInfoPanel;
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import CalendarTodayIcon from '@mui/icons-material/CalendarToday';
|
|
3
|
+
import PersonIcon from '@mui/icons-material/Person';
|
|
4
|
+
import BusinessIcon from '@mui/icons-material/Business';
|
|
5
|
+
import BmInfoPanel from './InfoPanel';
|
|
6
|
+
|
|
7
|
+
const formData = {
|
|
8
|
+
departmentName: 'Marketing',
|
|
9
|
+
resourceName: 'John Doe',
|
|
10
|
+
date: new Date(),
|
|
11
|
+
timeSlot: '09:00 - 09:30',
|
|
12
|
+
name: 'Jane Smith',
|
|
13
|
+
phone: '+1234567890',
|
|
14
|
+
email: 'jane.smith@example.com',
|
|
15
|
+
};
|
|
16
|
+
const appointmentDetails = {
|
|
17
|
+
title: 'Consultation',
|
|
18
|
+
duration: '30 mins',
|
|
19
|
+
};
|
|
20
|
+
export default {
|
|
21
|
+
title: 'Components/BmInfoPanel',
|
|
22
|
+
component: BmInfoPanel,
|
|
23
|
+
argTypes: {
|
|
24
|
+
variant: {
|
|
25
|
+
control: { type: 'select' },
|
|
26
|
+
options: ['detailed', 'summary'],
|
|
27
|
+
defaultValue: 'detailed',
|
|
28
|
+
},
|
|
29
|
+
showDivider: { control: 'boolean' },
|
|
30
|
+
backgroundColor: { control: 'color' },
|
|
31
|
+
iconColor: { control: 'color' },
|
|
32
|
+
textColor: { control: 'color' },
|
|
33
|
+
iconBackgroundColor: { control: 'boolean' },
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const Template = ({
|
|
38
|
+
variant,
|
|
39
|
+
showDivider,
|
|
40
|
+
backgroundColor,
|
|
41
|
+
iconColor,
|
|
42
|
+
textColor,
|
|
43
|
+
iconBackgroundColor,
|
|
44
|
+
}) => {
|
|
45
|
+
if (variant === 'summary') {
|
|
46
|
+
return (
|
|
47
|
+
<BmInfoPanel className="p3">
|
|
48
|
+
<BmInfoPanel.SectionSummary
|
|
49
|
+
icon={BusinessIcon}
|
|
50
|
+
title="Operations Department"
|
|
51
|
+
subtitle="Department"
|
|
52
|
+
iconColor={iconColor}
|
|
53
|
+
textColor={textColor}
|
|
54
|
+
/>
|
|
55
|
+
<BmInfoPanel.SectionSummary
|
|
56
|
+
icon={BusinessIcon}
|
|
57
|
+
title="Customer Service"
|
|
58
|
+
subtitle="Department"
|
|
59
|
+
iconColor={iconColor}
|
|
60
|
+
textColor={textColor}
|
|
61
|
+
iconBackgroundColor={iconBackgroundColor}
|
|
62
|
+
/>
|
|
63
|
+
</BmInfoPanel>
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return (
|
|
68
|
+
<BmInfoPanel>
|
|
69
|
+
<BmInfoPanel.Section
|
|
70
|
+
title="Appointment Details"
|
|
71
|
+
icon={CalendarTodayIcon}
|
|
72
|
+
backgroundColor={backgroundColor}
|
|
73
|
+
iconColor={iconColor}
|
|
74
|
+
iconBackgroundColor={iconBackgroundColor}
|
|
75
|
+
>
|
|
76
|
+
<BmInfoPanel.Row label="Type" value="Consultation" />
|
|
77
|
+
<BmInfoPanel.Row label="Department" value="General Medicine" />
|
|
78
|
+
<BmInfoPanel.Row label="Resource" value="Dr. Smith" />
|
|
79
|
+
<BmInfoPanel.Row label="Duration" value="30 minutes" />
|
|
80
|
+
<BmInfoPanel.Row label="Date" value="Monday, June 24, 2025" />
|
|
81
|
+
<BmInfoPanel.Row label="Time" value="09:00 AM" />
|
|
82
|
+
</BmInfoPanel.Section>
|
|
83
|
+
|
|
84
|
+
<BmInfoPanel.Section
|
|
85
|
+
title="Personal Information"
|
|
86
|
+
icon={PersonIcon}
|
|
87
|
+
showDivider={showDivider}
|
|
88
|
+
iconColor={iconColor}
|
|
89
|
+
>
|
|
90
|
+
<BmInfoPanel.Row label="Name" value="John Doe" />
|
|
91
|
+
<BmInfoPanel.Row label="Email" value="john@example.com" />
|
|
92
|
+
<BmInfoPanel.Row label="Phone" value="+255 712 345 678" />
|
|
93
|
+
</BmInfoPanel.Section>
|
|
94
|
+
</BmInfoPanel>
|
|
95
|
+
);
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
export const Default = Template.bind({});
|
|
99
|
+
Default.args = {
|
|
100
|
+
variant: 'detailed',
|
|
101
|
+
showDivider: true,
|
|
102
|
+
backgroundColor: '#33B1BA',
|
|
103
|
+
iconColor: '#33B1BA',
|
|
104
|
+
textColor: '#000000',
|
|
105
|
+
iconBackgroundColor: false,
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
export const ExampleSummary = () => {
|
|
109
|
+
return (
|
|
110
|
+
<BmInfoPanel>
|
|
111
|
+
<BmInfoPanel.Section
|
|
112
|
+
title="Appointment Details"
|
|
113
|
+
icon={CalendarTodayIcon}
|
|
114
|
+
backgroundColor="#fcba03"
|
|
115
|
+
iconColor="#fcba03"
|
|
116
|
+
iconBackgroundColor
|
|
117
|
+
>
|
|
118
|
+
<BmInfoPanel.SectionSummary
|
|
119
|
+
iconColor="#fcba03"
|
|
120
|
+
textColor="#fcba03"
|
|
121
|
+
icon={BusinessIcon}
|
|
122
|
+
title="sales"
|
|
123
|
+
subtitle="Department"
|
|
124
|
+
/>
|
|
125
|
+
<BmInfoPanel.SectionSummary
|
|
126
|
+
icon={BusinessIcon}
|
|
127
|
+
title="Pharma"
|
|
128
|
+
subtitle="Department"
|
|
129
|
+
/>
|
|
130
|
+
</BmInfoPanel.Section>
|
|
131
|
+
</BmInfoPanel>
|
|
132
|
+
);
|
|
133
|
+
};
|
|
134
|
+
export const ExampleDetails = () => {
|
|
135
|
+
return (
|
|
136
|
+
<BmInfoPanel>
|
|
137
|
+
<BmInfoPanel.Section
|
|
138
|
+
title="Appointment Details"
|
|
139
|
+
icon={CalendarTodayIcon}
|
|
140
|
+
backgroundColor="rgba(51, 177, 186, 0.05)"
|
|
141
|
+
>
|
|
142
|
+
<BmInfoPanel.Row label="Type" value={appointmentDetails.title} />
|
|
143
|
+
<BmInfoPanel.Row label="Department" value={formData.departmentName} />
|
|
144
|
+
<BmInfoPanel.Row label="Resource" value={formData.resourceName} />
|
|
145
|
+
<BmInfoPanel.Row label="Duration" value={appointmentDetails.duration} />
|
|
146
|
+
<BmInfoPanel.Row label="Date" value={formData.date.toDateString()} />
|
|
147
|
+
<BmInfoPanel.Row
|
|
148
|
+
label="Time"
|
|
149
|
+
value={formData.timeSlot.split(' - ')[1]}
|
|
150
|
+
/>
|
|
151
|
+
</BmInfoPanel.Section>
|
|
152
|
+
|
|
153
|
+
<BmInfoPanel.Section
|
|
154
|
+
title="Personal Information"
|
|
155
|
+
icon={PersonIcon}
|
|
156
|
+
showDivider
|
|
157
|
+
>
|
|
158
|
+
<BmInfoPanel.Row label="Name" value={formData.name} />
|
|
159
|
+
<BmInfoPanel.Row label="Phone" value={formData.phone} />
|
|
160
|
+
<BmInfoPanel.Row label="Email" value={formData.email} />
|
|
161
|
+
</BmInfoPanel.Section>
|
|
162
|
+
<BmInfoPanel.Section title="Personal Information" icon={PersonIcon}>
|
|
163
|
+
<BmInfoPanel.Row label="Name" value={formData.name} />
|
|
164
|
+
<BmInfoPanel.Row label="Phone" value={formData.phone} />
|
|
165
|
+
<BmInfoPanel.Row label="Email" value={formData.email} />
|
|
166
|
+
</BmInfoPanel.Section>
|
|
167
|
+
</BmInfoPanel>
|
|
168
|
+
);
|
|
169
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
const Wrapper = styled.div`
|
|
5
|
+
display: flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
font-size: 0.875rem;
|
|
8
|
+
|
|
9
|
+
@media (min-width: 45.7143rem) {
|
|
10
|
+
font-size: 1rem;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@media (min-width: 73.1429rem) {
|
|
14
|
+
font-size: 1.125rem;
|
|
15
|
+
}
|
|
16
|
+
`;
|
|
17
|
+
|
|
18
|
+
const IconWrapper = styled.span`
|
|
19
|
+
display: inline-flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
margin-right: 0.575rem;
|
|
22
|
+
|
|
23
|
+
svg {
|
|
24
|
+
color: ${({ color }) => color || 'inherit'};
|
|
25
|
+
font-size: ${({ size }) => size || '0.875rem'};
|
|
26
|
+
|
|
27
|
+
@media (min-width: 45.7143rem) {
|
|
28
|
+
font-size: calc(${({ size }) => size || '0.875rem'} * 1.15);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@media (min-width: 73.1429rem) {
|
|
32
|
+
font-size: calc(${({ size }) => size || '0.875rem'} * 1.3);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
`;
|
|
36
|
+
|
|
37
|
+
const TextWrapper = styled.span`
|
|
38
|
+
color: ${({ color, theme }) => color || theme.labelColor || '#333'};
|
|
39
|
+
display: flex;
|
|
40
|
+
flex-direction: row;
|
|
41
|
+
`;
|
|
42
|
+
|
|
43
|
+
const BmLabelWithIcon = ({
|
|
44
|
+
icon: Icon,
|
|
45
|
+
iconColor,
|
|
46
|
+
iconSize = '0.875rem',
|
|
47
|
+
textColor,
|
|
48
|
+
children,
|
|
49
|
+
className,
|
|
50
|
+
}) => (
|
|
51
|
+
<Wrapper className={className}>
|
|
52
|
+
{Icon && (
|
|
53
|
+
<IconWrapper color={iconColor} size={iconSize}>
|
|
54
|
+
<Icon />
|
|
55
|
+
</IconWrapper>
|
|
56
|
+
)}
|
|
57
|
+
<TextWrapper color={textColor}>{children}</TextWrapper>
|
|
58
|
+
</Wrapper>
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
export default BmLabelWithIcon;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import PeopleIcon from '@mui/icons-material/People';
|
|
4
|
+
import EmailIcon from '@mui/icons-material/Email';
|
|
5
|
+
import SettingsIcon from '@mui/icons-material/Settings';
|
|
6
|
+
import BmLabelWithIcon from './LabelWithIcon';
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
title: 'Components/BmLabelWithIcon',
|
|
10
|
+
component: BmLabelWithIcon,
|
|
11
|
+
argTypes: {
|
|
12
|
+
iconColor: { control: 'color' },
|
|
13
|
+
iconSize: { control: 'text' },
|
|
14
|
+
icon: {
|
|
15
|
+
options: ['People', 'Email', 'Settings'],
|
|
16
|
+
mapping: {
|
|
17
|
+
People: PeopleIcon,
|
|
18
|
+
Email: EmailIcon,
|
|
19
|
+
Settings: SettingsIcon,
|
|
20
|
+
},
|
|
21
|
+
control: { type: 'select' },
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const Template = (args) => (
|
|
27
|
+
<BmLabelWithIcon {...args}>{args.children}</BmLabelWithIcon>
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
export const Default = Template.bind({});
|
|
31
|
+
Default.args = {
|
|
32
|
+
icon: PeopleIcon,
|
|
33
|
+
iconColor: '#6b7280',
|
|
34
|
+
iconSize: '0.875rem',
|
|
35
|
+
children: 'Team Members',
|
|
36
|
+
};
|
|
37
|
+
export const Example = () => {
|
|
38
|
+
return (
|
|
39
|
+
<BmLabelWithIcon
|
|
40
|
+
textColor="#fcba03"
|
|
41
|
+
icon={PeopleIcon}
|
|
42
|
+
iconColor="#fffff"
|
|
43
|
+
iconSize="16px"
|
|
44
|
+
>
|
|
45
|
+
<p>yooo</p> <h5>Team: Engineering</h5>
|
|
46
|
+
</BmLabelWithIcon>
|
|
47
|
+
);
|
|
48
|
+
};
|
|
49
|
+
export const StrongText = Template.bind({});
|
|
50
|
+
StrongText.args = {
|
|
51
|
+
icon: EmailIcon,
|
|
52
|
+
iconColor: '#d97706',
|
|
53
|
+
iconSize: '1.1rem',
|
|
54
|
+
children: (
|
|
55
|
+
<>
|
|
56
|
+
Department: <strong>Marketing</strong>
|
|
57
|
+
</>
|
|
58
|
+
),
|
|
59
|
+
};
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
const hexToRgba = (hex, opacity = 0.6) => {
|
|
5
|
+
try {
|
|
6
|
+
const normalizedHex = hex?.replace('#', '');
|
|
7
|
+
if (
|
|
8
|
+
!normalizedHex ||
|
|
9
|
+
normalizedHex.length !== 6 ||
|
|
10
|
+
!/^[0-9a-fA-F]{6}$/.test(normalizedHex)
|
|
11
|
+
) {
|
|
12
|
+
throw new Error('Invalid hex');
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const r = parseInt(normalizedHex.slice(0, 2), 16);
|
|
16
|
+
const g = parseInt(normalizedHex.slice(2, 4), 16);
|
|
17
|
+
const b = parseInt(normalizedHex.slice(4, 6), 16);
|
|
18
|
+
return `rgba(${r}, ${g}, ${b}, ${opacity})`;
|
|
19
|
+
} catch (e) {
|
|
20
|
+
return `rgba(0, 0, 0, ${opacity})`;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const Container = styled.div`
|
|
25
|
+
margin-bottom: 1rem;
|
|
26
|
+
|
|
27
|
+
--primary-color: ${({ primaryColor }) => primaryColor};
|
|
28
|
+
--primary-light: ${({ primaryColor }) => hexToRgba(primaryColor, 0.2)};
|
|
29
|
+
--primary-lighter: ${({ primaryColor }) => hexToRgba(primaryColor, 0.4)};
|
|
30
|
+
--muted-color: ${({ mutedColor }) => mutedColor};
|
|
31
|
+
--muted-foreground-color: ${({ mutedForegroundColor }) =>
|
|
32
|
+
mutedForegroundColor};
|
|
33
|
+
|
|
34
|
+
@media (min-width: 45.7143rem) {
|
|
35
|
+
margin-bottom: 1.5rem;
|
|
36
|
+
}
|
|
37
|
+
`;
|
|
38
|
+
|
|
39
|
+
const ProgressMobile = styled.div`
|
|
40
|
+
display: flex;
|
|
41
|
+
justify-content: center;
|
|
42
|
+
gap: 0.5rem;
|
|
43
|
+
margin-bottom: 0.5rem;
|
|
44
|
+
|
|
45
|
+
@media (min-width: 45.7143rem) {
|
|
46
|
+
display: none;
|
|
47
|
+
}
|
|
48
|
+
`;
|
|
49
|
+
|
|
50
|
+
const ProgressDot = styled.div`
|
|
51
|
+
width: 0.625rem;
|
|
52
|
+
height: 0.625rem;
|
|
53
|
+
border-radius: 50%;
|
|
54
|
+
background-color: var(--muted-color);
|
|
55
|
+
transition: background-color 0.3s ease;
|
|
56
|
+
|
|
57
|
+
&.active {
|
|
58
|
+
background-color: var(--primary-color);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&.completed {
|
|
62
|
+
background-color: var(--primary-lighter);
|
|
63
|
+
}
|
|
64
|
+
`;
|
|
65
|
+
|
|
66
|
+
const ProgressDesktop = styled.div`
|
|
67
|
+
display: none;
|
|
68
|
+
justify-content: space-between;
|
|
69
|
+
align-items: center;
|
|
70
|
+
margin-bottom: 0.5rem;
|
|
71
|
+
|
|
72
|
+
@media (min-width: 45.7143rem) {
|
|
73
|
+
display: flex;
|
|
74
|
+
}
|
|
75
|
+
`;
|
|
76
|
+
|
|
77
|
+
const Step = styled.div`
|
|
78
|
+
display: flex;
|
|
79
|
+
flex-direction: column;
|
|
80
|
+
align-items: center;
|
|
81
|
+
flex: 1;
|
|
82
|
+
position: relative;
|
|
83
|
+
`;
|
|
84
|
+
|
|
85
|
+
const Circle = styled.div`
|
|
86
|
+
width: 2rem;
|
|
87
|
+
height: 2rem;
|
|
88
|
+
border-radius: 50%;
|
|
89
|
+
display: flex;
|
|
90
|
+
align-items: center;
|
|
91
|
+
justify-content: center;
|
|
92
|
+
font-size: 0.875rem;
|
|
93
|
+
background-color: var(--muted-color);
|
|
94
|
+
color: var(--muted-foreground-color);
|
|
95
|
+
margin-bottom: 0.25rem;
|
|
96
|
+
transition: all 0.3s ease;
|
|
97
|
+
|
|
98
|
+
&.active {
|
|
99
|
+
background-color: var(--primary-color);
|
|
100
|
+
color: white;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
&.completed {
|
|
104
|
+
background-color: var(--primary-light);
|
|
105
|
+
color: var(--primary-color);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
svg {
|
|
109
|
+
width: 1rem;
|
|
110
|
+
height: 1rem;
|
|
111
|
+
}
|
|
112
|
+
`;
|
|
113
|
+
|
|
114
|
+
const Label = styled.span`
|
|
115
|
+
font-size: 0.75rem;
|
|
116
|
+
margin-top: 0.25rem;
|
|
117
|
+
color: var(--muted-foreground-color);
|
|
118
|
+
text-align: center;
|
|
119
|
+
font-weight: 400;
|
|
120
|
+
transition: color 0.3s ease;
|
|
121
|
+
|
|
122
|
+
&.active {
|
|
123
|
+
color: var(--primary-color);
|
|
124
|
+
font-weight: 500;
|
|
125
|
+
}
|
|
126
|
+
`;
|
|
127
|
+
|
|
128
|
+
const ProgressBar = styled.div`
|
|
129
|
+
width: 100%;
|
|
130
|
+
background-color: var(--muted-color);
|
|
131
|
+
height: 0.25rem;
|
|
132
|
+
border-radius: 714.2143rem;
|
|
133
|
+
overflow: hidden;
|
|
134
|
+
`;
|
|
135
|
+
|
|
136
|
+
const Fill = styled.div`
|
|
137
|
+
height: 100%;
|
|
138
|
+
background-color: var(--primary-color);
|
|
139
|
+
transition: width 0.3s ease-out;
|
|
140
|
+
width: ${({ percentage }) => percentage}%;
|
|
141
|
+
border-radius: 714.2143rem;
|
|
142
|
+
`;
|
|
143
|
+
|
|
144
|
+
const BmProgressIndicator = ({
|
|
145
|
+
steps = [],
|
|
146
|
+
currentStep = 0,
|
|
147
|
+
primaryColor = '#33B1BA',
|
|
148
|
+
mutedColor = '#ececf0',
|
|
149
|
+
mutedForegroundColor = '#717182',
|
|
150
|
+
}) => {
|
|
151
|
+
if (!steps || steps.length <= 1) return null;
|
|
152
|
+
|
|
153
|
+
const progressPercentage = (currentStep / (steps.length - 1)) * 100;
|
|
154
|
+
|
|
155
|
+
return (
|
|
156
|
+
<Container
|
|
157
|
+
primaryColor={primaryColor}
|
|
158
|
+
mutedColor={mutedColor}
|
|
159
|
+
mutedForegroundColor={mutedForegroundColor}
|
|
160
|
+
>
|
|
161
|
+
<ProgressMobile>
|
|
162
|
+
{steps.map((step, index) => (
|
|
163
|
+
<ProgressDot
|
|
164
|
+
key={step.key || index}
|
|
165
|
+
className={`${index === currentStep ? 'active' : ''} ${
|
|
166
|
+
index < currentStep ? 'completed' : ''
|
|
167
|
+
}`}
|
|
168
|
+
/>
|
|
169
|
+
))}
|
|
170
|
+
</ProgressMobile>
|
|
171
|
+
|
|
172
|
+
<ProgressDesktop>
|
|
173
|
+
{steps.map((step, index) => {
|
|
174
|
+
const isActive = index === currentStep;
|
|
175
|
+
const isCompleted = index < currentStep;
|
|
176
|
+
|
|
177
|
+
return (
|
|
178
|
+
<Step key={step.key || index}>
|
|
179
|
+
<Circle
|
|
180
|
+
className={`${isActive ? 'active' : ''} ${
|
|
181
|
+
isCompleted ? 'completed' : ''
|
|
182
|
+
}`}
|
|
183
|
+
>
|
|
184
|
+
{isCompleted ? (
|
|
185
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none">
|
|
186
|
+
<path
|
|
187
|
+
d="M13.854 4.146a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.793l6.646-6.647a.5.5 0 0 1 .708 0z"
|
|
188
|
+
fill="currentColor"
|
|
189
|
+
/>
|
|
190
|
+
</svg>
|
|
191
|
+
) : (
|
|
192
|
+
<span>{index + 1}</span>
|
|
193
|
+
)}
|
|
194
|
+
</Circle>
|
|
195
|
+
<Label className={isActive ? 'active' : ''}>{step.label}</Label>
|
|
196
|
+
</Step>
|
|
197
|
+
);
|
|
198
|
+
})}
|
|
199
|
+
</ProgressDesktop>
|
|
200
|
+
|
|
201
|
+
<ProgressBar>
|
|
202
|
+
<Fill percentage={progressPercentage} />
|
|
203
|
+
</ProgressBar>
|
|
204
|
+
</Container>
|
|
205
|
+
);
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
export default BmProgressIndicator;
|