beem-component 2.1.28 → 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.
Files changed (81) hide show
  1. package/Dockerfile +3 -1
  2. package/Jenkinsfile +20 -5
  3. package/dist/assets/voiceCallIcon.svg +5 -0
  4. package/dist/components/Alert/Alert.js +83 -0
  5. package/dist/components/Alert/Alert.stories.js +66 -0
  6. package/dist/components/BmCustomCardTitle/CustomCardTitle.js +181 -0
  7. package/dist/components/BmCustomCardTitle/CustomCardTitle.stories.js +92 -0
  8. package/dist/components/BmSelector/BmSelector.js +31 -4
  9. package/dist/components/BmSelector/BmSelector.stories.js +14 -1
  10. package/dist/components/BmTabv2/BmTabv2.js +51 -0
  11. package/dist/components/BmTabv2/BmTabv2.stories.js +73 -0
  12. package/dist/components/Card_v2/Card.js +53 -13
  13. package/dist/components/ChatComponents/ChatBody/chatBody.js +404 -104
  14. package/dist/components/DepartmentCard/DepartmentCard.js +99 -0
  15. package/dist/components/DepartmentCard/DepartmentCard.stories.js +53 -0
  16. package/dist/components/HorizontalCard/HorizontalCard.js +142 -0
  17. package/dist/components/HorizontalCard/HorizontalCard.stories.js +40 -0
  18. package/dist/components/InfoPanel/InfoPanel.js +72 -21
  19. package/dist/components/InfoPanel/InfoPanel.stories.js +56 -4
  20. package/dist/components/Modals/modal.js +26 -10
  21. package/dist/components/Modals/modals.stories.js +13 -6
  22. package/dist/components/ProfileIcon/ProfileIcon.js +5 -0
  23. package/dist/components/ProgressIndicator/ProgressIndicator.js +17 -3
  24. package/dist/components/ResourceCard/ResourceCard.js +132 -0
  25. package/dist/components/ResourceCard/ResourceCard.stories.js +94 -0
  26. package/dist/components/SelectionNotice/SelectionNotice.js +17 -3
  27. package/dist/components/globalStyles.js +1 -1
  28. package/dist/components/index.js +42 -0
  29. package/dist/components/text.js +11 -10
  30. package/dist/components/typography.js +3 -2
  31. package/nginx.conf +26 -12
  32. package/package.json +2 -1
  33. package/public/index.html +1 -0
  34. package/src/App.js +805 -1412
  35. package/src/fonts/Inter-Black.woff2 +0 -0
  36. package/src/fonts/Inter-Bold.woff2 +0 -0
  37. package/src/fonts/Inter-ExtraBold.woff2 +0 -0
  38. package/src/fonts/Inter-ExtraLight.woff2 +0 -0
  39. package/src/fonts/Inter-Light.woff2 +0 -0
  40. package/src/fonts/Inter-Medium.woff2 +0 -0
  41. package/src/fonts/Inter-Regular.woff2 +0 -0
  42. package/src/fonts/Inter-SemiBold.woff2 +0 -0
  43. package/src/fonts/Inter-Thin.woff2 +0 -0
  44. package/src/fonts/Inter-VariableFont_opsz,wght.ttf +0 -0
  45. package/src/fonts/InterDisplay-Black.woff2 +0 -0
  46. package/src/fonts/InterDisplay-Bold.woff2 +0 -0
  47. package/src/fonts/InterDisplay-ExtraBold.woff2 +0 -0
  48. package/src/fonts/InterDisplay-ExtraLight.woff2 +0 -0
  49. package/src/fonts/InterDisplay-Light.woff2 +0 -0
  50. package/src/fonts/InterDisplay-Medium.woff2 +0 -0
  51. package/src/fonts/InterDisplay-SemiBold.woff2 +0 -0
  52. package/src/fonts/InterDisplay-Thin.woff2 +0 -0
  53. package/src/fonts.scss +4 -1
  54. package/src/lib/assets/voiceCallIcon.svg +5 -0
  55. package/src/lib/components/Alert/Alert.js +111 -0
  56. package/src/lib/components/Alert/Alert.stories.jsx +66 -0
  57. package/src/lib/components/BmCustomCardTitle/CustomCardTitle.js +162 -0
  58. package/src/lib/components/BmCustomCardTitle/CustomCardTitle.stories.jsx +92 -0
  59. package/src/lib/components/BmSelector/BmSelector.js +34 -2
  60. package/src/lib/components/BmSelector/BmSelector.stories.jsx +10 -0
  61. package/src/lib/components/BmTabv2/BmTabv2.js +109 -0
  62. package/src/lib/components/BmTabv2/BmTabv2.stories.jsx +51 -0
  63. package/src/lib/components/Card_v2/Card.js +63 -12
  64. package/src/lib/components/ChatComponents/ChatBody/chatBody.js +553 -57
  65. package/src/lib/components/DepartmentCard/DepartmentCard.js +130 -0
  66. package/src/lib/components/DepartmentCard/DepartmentCard.stories.jsx +38 -0
  67. package/src/lib/components/HorizontalCard/HorizontalCard.js +276 -0
  68. package/src/lib/components/HorizontalCard/HorizontalCard.stories.jsx +33 -0
  69. package/src/lib/components/InfoPanel/InfoPanel.js +55 -12
  70. package/src/lib/components/InfoPanel/InfoPanel.stories.jsx +42 -2
  71. package/src/lib/components/Modals/modal.js +17 -4
  72. package/src/lib/components/Modals/modals.stories.js +10 -6
  73. package/src/lib/components/ProfileIcon/ProfileIcon.js +4 -0
  74. package/src/lib/components/ProgressIndicator/ProgressIndicator.js +19 -1
  75. package/src/lib/components/ResourceCard/ResourceCard.js +213 -0
  76. package/src/lib/components/ResourceCard/ResourceCard.stories.jsx +68 -0
  77. package/src/lib/components/SelectionNotice/SelectionNotice.js +19 -1
  78. package/src/lib/components/globalStyles.js +2 -1
  79. package/src/lib/components/index.js +13 -0
  80. package/src/lib/components/text.js +17 -11
  81. package/src/lib/components/typography.js +1 -0
@@ -0,0 +1,109 @@
1
+ import React from 'react';
2
+ import styled, { css } from 'styled-components';
3
+
4
+ const TabsContainer = styled.div`
5
+ width: 100%;
6
+ `;
7
+
8
+ const TabsHeader = styled.div`
9
+ display: flex;
10
+ justify-content: flex-start;
11
+ align-items: center;
12
+ margin-bottom: 14px;
13
+ padding: 0 14px;
14
+ border-radius: var(--radius-lg, 12px);
15
+ flex-wrap: wrap;
16
+ `;
17
+
18
+ const TabsList = styled.div`
19
+ width: 100%;
20
+ display: inline-flex;
21
+ background-color: var(--color-muted, #f2f2f2);
22
+ color: var(--color-muted-foreground, #666);
23
+ align-items: center;
24
+ justify-content: center;
25
+ border-radius: var(--radius-lg, 12px);
26
+ padding: 4px 4px;
27
+ `;
28
+
29
+ const TabsTriggerButton = styled.button`
30
+ display: inline-flex;
31
+ flex: 1;
32
+ align-items: center;
33
+ justify-content: center;
34
+ gap: 6px;
35
+ border: 1px solid transparent;
36
+ border-radius: var(--radius-lg, 12px);
37
+ padding: 6px 12px;
38
+ font-size: 14px;
39
+ font-weight: 500;
40
+ white-space: nowrap;
41
+ transition: color 0.2s, box-shadow 0.2s, background-color 0.2s;
42
+ cursor: pointer;
43
+
44
+ ${({ active }) =>
45
+ active
46
+ ? css`
47
+ background-color: var(--color-card, #fff);
48
+ color: var(--color-foreground, #000);
49
+ border-color: var(--color-border, #ddd);
50
+ `
51
+ : css`
52
+ background-color: transparent;
53
+ color: var(--color-muted-foreground, #666);
54
+ `}
55
+
56
+ &:focus-visible {
57
+ outline: none;
58
+ border-color: var(--color-ring, #2684ff);
59
+ box-shadow: 0 0 0 3px rgba(38, 132, 255, 0.3);
60
+ }
61
+
62
+ &:disabled {
63
+ pointer-events: none;
64
+ opacity: 0.5;
65
+ }
66
+
67
+ svg {
68
+ flex-shrink: 0;
69
+ pointer-events: none;
70
+ width: 16px;
71
+ height: 16px;
72
+ }
73
+ `;
74
+
75
+ const IconWrapper = styled.span`
76
+ display: flex;
77
+ align-items: center;
78
+ justify-content: center;
79
+ `;
80
+
81
+ const BmCustomTab = ({ value, onValueChange, tabs = [], className }) => {
82
+ return (
83
+ <TabsContainer className={className}>
84
+ <TabsHeader>
85
+ <TabsList>
86
+ {tabs.map((tab) => {
87
+ const Icon = tab.icon;
88
+ return (
89
+ <TabsTriggerButton
90
+ key={tab.value}
91
+ active={value === tab.value}
92
+ onClick={() => onValueChange(tab.value)}
93
+ >
94
+ {Icon && (
95
+ <IconWrapper>
96
+ <Icon fontSize="small" />
97
+ </IconWrapper>
98
+ )}
99
+ <span>{tab.label}</span>
100
+ </TabsTriggerButton>
101
+ );
102
+ })}
103
+ </TabsList>
104
+ </TabsHeader>
105
+ </TabsContainer>
106
+ );
107
+ };
108
+
109
+ export default BmCustomTab;
@@ -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,8 +1,27 @@
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
- import hexToRgba from '../../../util/convertToRGBA';
5
+ const hexToRgba = (hex, opacity = 0.6) => {
6
+ try {
7
+ const normalizedHex = hex?.replace('#', '');
8
+ if (
9
+ !normalizedHex ||
10
+ normalizedHex.length !== 6 ||
11
+ !/^[0-9a-fA-F]{6}$/.test(normalizedHex)
12
+ ) {
13
+ throw new Error('Invalid hex');
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 {
20
+ return `rgba(0, 0, 0, ${opacity})`;
21
+ }
22
+ };
23
+
24
+ const CardContext = createContext({});
6
25
 
7
26
  const StyledCard = styled.div`
8
27
  background-color: var(--card, #fff);
@@ -35,14 +54,42 @@ const Description = styled.p`
35
54
  margin: 0;
36
55
  `;
37
56
 
38
- const Content = styled.div`
57
+ const ContentWrapper = styled.div`
58
+ min-height: ${({ $contentHeight }) => $contentHeight || '14.2857rem'};
39
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
+ }
40
74
 
41
75
  &:last-child {
42
76
  padding-bottom: 1.5rem;
43
77
  }
78
+
79
+ @media (max-width: 54.8571rem) {
80
+ max-height: calc(100vh - 17.8572rem);
81
+ }
44
82
  `;
45
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
+
46
93
  const Footer = styled.div`
47
94
  display: flex;
48
95
  justify-content: space-between;
@@ -53,7 +100,6 @@ const Footer = styled.div`
53
100
  @media (max-width: 42.8571rem) {
54
101
  flex-direction: column;
55
102
  align-items: stretch;
56
-
57
103
  & > * {
58
104
  width: 100%;
59
105
  }
@@ -65,17 +111,22 @@ function CardComponent({
65
111
  children,
66
112
  borderColor,
67
113
  borderWidth,
114
+ contentHeight,
68
115
  ...props
69
116
  }) {
117
+ const contextValue = { contentHeight };
118
+
70
119
  return (
71
- <StyledCard
72
- className={className}
73
- borderColor={borderColor}
74
- borderWidth={borderWidth}
75
- {...props}
76
- >
77
- {children}
78
- </StyledCard>
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>
79
130
  );
80
131
  }
81
132