beem-component 2.1.29 → 2.1.30
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 +1 -1
- package/Jenkinsfile +20 -5
- package/dist/assets/voiceCallIcon.svg +5 -0
- package/dist/components/Alert/Alert.js +83 -0
- package/dist/components/Alert/Alert.stories.js +66 -0
- package/dist/components/BmCustomCardTitle/CustomCardTitle.js +181 -0
- package/dist/components/BmCustomCardTitle/CustomCardTitle.stories.js +92 -0
- package/dist/components/BmSelector/BmSelector.js +15 -2
- package/dist/components/BmSelector/BmSelector.stories.js +14 -1
- package/dist/components/BmTabv2/BmTabv2.js +51 -0
- package/dist/components/BmTabv2/BmTabv2.stories.js +73 -0
- package/dist/components/Card_v2/Card.js +38 -12
- package/dist/components/ChatComponents/ChatBody/chatBody.js +404 -104
- package/dist/components/DepartmentCard/DepartmentCard.js +99 -0
- package/dist/components/DepartmentCard/DepartmentCard.stories.js +53 -0
- package/dist/components/HorizontalCard/HorizontalCard.js +142 -0
- package/dist/components/HorizontalCard/HorizontalCard.stories.js +40 -0
- package/dist/components/InfoPanel/InfoPanel.js +54 -17
- package/dist/components/InfoPanel/InfoPanel.stories.js +56 -4
- package/dist/components/Modals/modal.js +26 -10
- package/dist/components/Modals/modals.stories.js +13 -6
- package/dist/components/ProfileIcon/ProfileIcon.js +5 -0
- package/dist/components/ResourceCard/ResourceCard.js +132 -0
- package/dist/components/ResourceCard/ResourceCard.stories.js +94 -0
- package/dist/components/globalStyles.js +1 -1
- package/dist/components/index.js +42 -0
- package/dist/components/text.js +11 -10
- package/dist/components/typography.js +3 -2
- package/package.json +2 -1
- package/public/index.html +1 -0
- package/src/App.js +805 -1412
- package/src/fonts/Inter-Black.woff2 +0 -0
- package/src/fonts/Inter-Bold.woff2 +0 -0
- package/src/fonts/Inter-ExtraBold.woff2 +0 -0
- package/src/fonts/Inter-ExtraLight.woff2 +0 -0
- package/src/fonts/Inter-Light.woff2 +0 -0
- package/src/fonts/Inter-Medium.woff2 +0 -0
- package/src/fonts/Inter-Regular.woff2 +0 -0
- package/src/fonts/Inter-SemiBold.woff2 +0 -0
- package/src/fonts/Inter-Thin.woff2 +0 -0
- package/src/fonts/Inter-VariableFont_opsz,wght.ttf +0 -0
- package/src/fonts/InterDisplay-Black.woff2 +0 -0
- package/src/fonts/InterDisplay-Bold.woff2 +0 -0
- package/src/fonts/InterDisplay-ExtraBold.woff2 +0 -0
- package/src/fonts/InterDisplay-ExtraLight.woff2 +0 -0
- package/src/fonts/InterDisplay-Light.woff2 +0 -0
- package/src/fonts/InterDisplay-Medium.woff2 +0 -0
- package/src/fonts/InterDisplay-SemiBold.woff2 +0 -0
- package/src/fonts/InterDisplay-Thin.woff2 +0 -0
- package/src/fonts.scss +4 -1
- package/src/lib/assets/voiceCallIcon.svg +5 -0
- package/src/lib/components/Alert/Alert.js +111 -0
- package/src/lib/components/Alert/Alert.stories.jsx +66 -0
- package/src/lib/components/BmCustomCardTitle/CustomCardTitle.js +162 -0
- package/src/lib/components/BmCustomCardTitle/CustomCardTitle.stories.jsx +92 -0
- package/src/lib/components/BmSelector/BmSelector.js +14 -1
- package/src/lib/components/BmSelector/BmSelector.stories.jsx +10 -0
- package/src/lib/components/BmTabv2/BmTabv2.js +109 -0
- package/src/lib/components/BmTabv2/BmTabv2.stories.jsx +51 -0
- package/src/lib/components/Card_v2/Card.js +46 -13
- package/src/lib/components/ChatComponents/ChatBody/chatBody.js +553 -57
- package/src/lib/components/DepartmentCard/DepartmentCard.js +130 -0
- package/src/lib/components/DepartmentCard/DepartmentCard.stories.jsx +38 -0
- package/src/lib/components/HorizontalCard/HorizontalCard.js +276 -0
- package/src/lib/components/HorizontalCard/HorizontalCard.stories.jsx +33 -0
- package/src/lib/components/InfoPanel/InfoPanel.js +35 -11
- package/src/lib/components/InfoPanel/InfoPanel.stories.jsx +42 -2
- package/src/lib/components/Modals/modal.js +17 -4
- package/src/lib/components/Modals/modals.stories.js +10 -6
- package/src/lib/components/ProfileIcon/ProfileIcon.js +4 -0
- package/src/lib/components/ResourceCard/ResourceCard.js +213 -0
- package/src/lib/components/ResourceCard/ResourceCard.stories.jsx +68 -0
- package/src/lib/components/globalStyles.js +2 -1
- package/src/lib/components/index.js +13 -0
- package/src/lib/components/text.js +17 -11
- package/src/lib/components/typography.js +1 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
|
|
3
|
+
import CalendarTodayOutlinedIcon from '@mui/icons-material/CalendarTodayOutlined';
|
|
4
|
+
import GroupIcon from '@mui/icons-material/Group';
|
|
5
|
+
import BusinessIcon from '@mui/icons-material/Business';
|
|
6
|
+
import BmCustomTab from './BmTabv2';
|
|
7
|
+
|
|
8
|
+
export const ExampleCustomTabsUsage = () => {
|
|
9
|
+
const [activeTab, setActiveTab] = useState('departments');
|
|
10
|
+
|
|
11
|
+
const tabs = [
|
|
12
|
+
{ value: 'departments', label: 'Departments', icon: BusinessIcon },
|
|
13
|
+
{ value: 'resources', label: 'Resources', icon: GroupIcon },
|
|
14
|
+
{ value: 'events', label: 'Events', icon: CalendarTodayOutlinedIcon },
|
|
15
|
+
];
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<div style={{ padding: 20 }}>
|
|
19
|
+
<BmCustomTab value={activeTab} onValueChange={setActiveTab} tabs={tabs} />
|
|
20
|
+
<div style={{ marginTop: 20 }}>
|
|
21
|
+
<strong>Current Tab:</strong> {activeTab}
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export default {
|
|
28
|
+
title: 'Components/CustomTabs',
|
|
29
|
+
component: BmCustomTab,
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const ExampleTabs = () => {
|
|
33
|
+
const [activeTab, setActiveTab] = useState('departments');
|
|
34
|
+
|
|
35
|
+
const tabs = [
|
|
36
|
+
{ value: 'departments', label: 'Departments', icon: BusinessIcon },
|
|
37
|
+
{ value: 'resources', label: 'Resources', icon: GroupIcon },
|
|
38
|
+
{ value: 'events', label: 'Events', icon: CalendarTodayOutlinedIcon },
|
|
39
|
+
];
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<>
|
|
43
|
+
<BmCustomTab value={activeTab} onValueChange={setActiveTab} tabs={tabs} />
|
|
44
|
+
<div style={{ marginTop: '20px' }}>
|
|
45
|
+
<p>
|
|
46
|
+
You have selected: <strong>{activeTab}</strong>
|
|
47
|
+
</p>
|
|
48
|
+
</div>
|
|
49
|
+
</>
|
|
50
|
+
);
|
|
51
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable func-style */
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import React, { createContext, useContext } from 'react';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
|
|
5
5
|
const hexToRgba = (hex, opacity = 0.6) => {
|
|
@@ -12,16 +12,17 @@ const hexToRgba = (hex, opacity = 0.6) => {
|
|
|
12
12
|
) {
|
|
13
13
|
throw new Error('Invalid hex');
|
|
14
14
|
}
|
|
15
|
-
|
|
16
15
|
const r = parseInt(normalizedHex.slice(0, 2), 16);
|
|
17
16
|
const g = parseInt(normalizedHex.slice(2, 4), 16);
|
|
18
17
|
const b = parseInt(normalizedHex.slice(4, 6), 16);
|
|
19
18
|
return `rgba(${r}, ${g}, ${b}, ${opacity})`;
|
|
20
|
-
} catch
|
|
19
|
+
} catch {
|
|
21
20
|
return `rgba(0, 0, 0, ${opacity})`;
|
|
22
21
|
}
|
|
23
22
|
};
|
|
24
23
|
|
|
24
|
+
const CardContext = createContext({});
|
|
25
|
+
|
|
25
26
|
const StyledCard = styled.div`
|
|
26
27
|
background-color: var(--card, #fff);
|
|
27
28
|
color: var(--card-foreground, #000);
|
|
@@ -53,14 +54,42 @@ const Description = styled.p`
|
|
|
53
54
|
margin: 0;
|
|
54
55
|
`;
|
|
55
56
|
|
|
56
|
-
const
|
|
57
|
+
const ContentWrapper = styled.div`
|
|
58
|
+
min-height: ${({ $contentHeight }) => $contentHeight || '14.2857rem'};
|
|
57
59
|
padding: 0 1.5rem;
|
|
60
|
+
max-height: calc(100vh - 28.5714rem);
|
|
61
|
+
overflow-y: auto;
|
|
62
|
+
scrollbar-width: thin;
|
|
63
|
+
scrollbar-color: ${() => hexToRgba('#33b1ba', 0.2)} transparent;
|
|
64
|
+
|
|
65
|
+
&::-webkit-scrollbar-thumb {
|
|
66
|
+
background: ${() => hexToRgba('#33b1ba', 0.3)};
|
|
67
|
+
border-radius: 0.6429rem;
|
|
68
|
+
transition: background 0.2s ease;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&::-webkit-scrollbar-thumb:hover {
|
|
72
|
+
background: ${() => hexToRgba('#33b1ba', 0.4)};
|
|
73
|
+
}
|
|
58
74
|
|
|
59
75
|
&:last-child {
|
|
60
76
|
padding-bottom: 1.5rem;
|
|
61
77
|
}
|
|
78
|
+
|
|
79
|
+
@media (max-width: 54.8571rem) {
|
|
80
|
+
max-height: calc(100vh - 17.8572rem);
|
|
81
|
+
}
|
|
62
82
|
`;
|
|
63
83
|
|
|
84
|
+
function Content({ children, style }) {
|
|
85
|
+
const { contentHeight } = useContext(CardContext);
|
|
86
|
+
return (
|
|
87
|
+
<ContentWrapper $contentHeight={contentHeight} style={style}>
|
|
88
|
+
{children}
|
|
89
|
+
</ContentWrapper>
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
|
|
64
93
|
const Footer = styled.div`
|
|
65
94
|
display: flex;
|
|
66
95
|
justify-content: space-between;
|
|
@@ -71,7 +100,6 @@ const Footer = styled.div`
|
|
|
71
100
|
@media (max-width: 42.8571rem) {
|
|
72
101
|
flex-direction: column;
|
|
73
102
|
align-items: stretch;
|
|
74
|
-
|
|
75
103
|
& > * {
|
|
76
104
|
width: 100%;
|
|
77
105
|
}
|
|
@@ -83,17 +111,22 @@ function CardComponent({
|
|
|
83
111
|
children,
|
|
84
112
|
borderColor,
|
|
85
113
|
borderWidth,
|
|
114
|
+
contentHeight,
|
|
86
115
|
...props
|
|
87
116
|
}) {
|
|
117
|
+
const contextValue = { contentHeight };
|
|
118
|
+
|
|
88
119
|
return (
|
|
89
|
-
<
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
120
|
+
<CardContext.Provider value={contextValue}>
|
|
121
|
+
<StyledCard
|
|
122
|
+
className={className}
|
|
123
|
+
borderColor={borderColor}
|
|
124
|
+
borderWidth={borderWidth}
|
|
125
|
+
{...props}
|
|
126
|
+
>
|
|
127
|
+
{children}
|
|
128
|
+
</StyledCard>
|
|
129
|
+
</CardContext.Provider>
|
|
97
130
|
);
|
|
98
131
|
}
|
|
99
132
|
|