beem-component 2.1.29 → 2.1.31

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 (76) hide show
  1. package/Dockerfile +1 -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 +15 -2
  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 +38 -12
  13. package/dist/components/ChatComponents/ChatBody/chatBody.js +402 -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 +54 -17
  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/ResourceCard/ResourceCard.js +132 -0
  24. package/dist/components/ResourceCard/ResourceCard.stories.js +94 -0
  25. package/dist/components/globalStyles.js +1 -1
  26. package/dist/components/index.js +42 -0
  27. package/dist/components/text.js +11 -10
  28. package/dist/components/typography.js +3 -2
  29. package/package.json +2 -1
  30. package/public/index.html +1 -0
  31. package/src/App.js +804 -1412
  32. package/src/fonts/Inter-Black.woff2 +0 -0
  33. package/src/fonts/Inter-Bold.woff2 +0 -0
  34. package/src/fonts/Inter-ExtraBold.woff2 +0 -0
  35. package/src/fonts/Inter-ExtraLight.woff2 +0 -0
  36. package/src/fonts/Inter-Light.woff2 +0 -0
  37. package/src/fonts/Inter-Medium.woff2 +0 -0
  38. package/src/fonts/Inter-Regular.woff2 +0 -0
  39. package/src/fonts/Inter-SemiBold.woff2 +0 -0
  40. package/src/fonts/Inter-Thin.woff2 +0 -0
  41. package/src/fonts/Inter-VariableFont_opsz,wght.ttf +0 -0
  42. package/src/fonts/InterDisplay-Black.woff2 +0 -0
  43. package/src/fonts/InterDisplay-Bold.woff2 +0 -0
  44. package/src/fonts/InterDisplay-ExtraBold.woff2 +0 -0
  45. package/src/fonts/InterDisplay-ExtraLight.woff2 +0 -0
  46. package/src/fonts/InterDisplay-Light.woff2 +0 -0
  47. package/src/fonts/InterDisplay-Medium.woff2 +0 -0
  48. package/src/fonts/InterDisplay-SemiBold.woff2 +0 -0
  49. package/src/fonts/InterDisplay-Thin.woff2 +0 -0
  50. package/src/fonts.scss +4 -1
  51. package/src/lib/assets/voiceCallIcon.svg +5 -0
  52. package/src/lib/components/Alert/Alert.js +111 -0
  53. package/src/lib/components/Alert/Alert.stories.jsx +66 -0
  54. package/src/lib/components/BmCustomCardTitle/CustomCardTitle.js +162 -0
  55. package/src/lib/components/BmCustomCardTitle/CustomCardTitle.stories.jsx +92 -0
  56. package/src/lib/components/BmSelector/BmSelector.js +14 -1
  57. package/src/lib/components/BmSelector/BmSelector.stories.jsx +10 -0
  58. package/src/lib/components/BmTabv2/BmTabv2.js +109 -0
  59. package/src/lib/components/BmTabv2/BmTabv2.stories.jsx +51 -0
  60. package/src/lib/components/Card_v2/Card.js +46 -13
  61. package/src/lib/components/ChatComponents/ChatBody/chatBody.js +551 -57
  62. package/src/lib/components/DepartmentCard/DepartmentCard.js +130 -0
  63. package/src/lib/components/DepartmentCard/DepartmentCard.stories.jsx +38 -0
  64. package/src/lib/components/HorizontalCard/HorizontalCard.js +276 -0
  65. package/src/lib/components/HorizontalCard/HorizontalCard.stories.jsx +33 -0
  66. package/src/lib/components/InfoPanel/InfoPanel.js +35 -11
  67. package/src/lib/components/InfoPanel/InfoPanel.stories.jsx +42 -2
  68. package/src/lib/components/Modals/modal.js +17 -4
  69. package/src/lib/components/Modals/modals.stories.js +10 -6
  70. package/src/lib/components/ProfileIcon/ProfileIcon.js +4 -0
  71. package/src/lib/components/ResourceCard/ResourceCard.js +213 -0
  72. package/src/lib/components/ResourceCard/ResourceCard.stories.jsx +68 -0
  73. package/src/lib/components/globalStyles.js +2 -1
  74. package/src/lib/components/index.js +13 -0
  75. package/src/lib/components/text.js +17 -11
  76. package/src/lib/components/typography.js +1 -0
package/Dockerfile CHANGED
@@ -24,7 +24,7 @@ COPY --from=build /app/storybook-static /usr/share/nginx/html
24
24
  RUN rm /etc/nginx/conf.d/default.conf
25
25
 
26
26
  # Replace the default NGINX config with your custom one
27
- COPY nginx.conf /etc/nginx/conf.d/default.conf
27
+ COPY nginx.conf /etc/nginx/conf.d/
28
28
 
29
29
 
30
30
  EXPOSE 3000
package/Jenkinsfile CHANGED
@@ -1,33 +1,43 @@
1
1
  pipeline{
2
2
  agent any
3
+ parameters {
4
+ string(name: 'TAG', description: 'Tag Number Ex: v2.0.0')
5
+ }
3
6
  tools {nodejs "nodejs"}
4
7
  environment
5
8
  {
6
- VERSION = "v1.0.${BUILD_NUMBER}"
9
+ VERSION = "${params.TAG != "" ? params.TAG : "v2.0.${BUILD_NUMBER}"}"
7
10
  PROJECT = "bm-components"
8
11
  IMAGE = "$PROJECT:$VERSION"
9
12
  ECRURL = "https://347944191864.dkr.ecr.eu-west-1.amazonaws.com"
10
13
  ECRCRED = "ecr:eu-west-1:awscred"
11
- }
14
+ GIT_CREDS = "master-user-dev"
15
+ GIT_URL = "git@bitbucket.org:bongolive/${PROJECT}.git"
12
16
 
17
+ }
13
18
  stages{
14
19
  stage('Deploy for development') {
15
20
  when {
16
21
  branch 'develop'
17
22
  }
18
23
  steps {
19
- git branch: 'develop',credentialsId: 'bitbucket',url: "https://bitbucket.org/bongolive/${PROJECT}.git"
24
+ git branch: 'develop',credentialsId: "${GIT_CREDS}",url: "${GIT_URL}"
20
25
  }
21
26
  }
22
27
  stage('Deploy for production') {
23
28
  when {
24
29
  branch 'master'
25
30
  }
26
- steps {
27
- git branch: 'master',credentialsId: 'bitbucket',url: "https://bitbucket.org/bongolive/${PROJECT}.git"
31
+ steps {
32
+ git branch: 'master',credentialsId: "${GIT_CREDS}",url: "${GIT_URL}"
28
33
  }
29
34
  }
30
35
  stage('Image build') {
36
+ when {
37
+ expression {
38
+ return params.TAG == ''
39
+ }
40
+ }
31
41
  steps{
32
42
  script
33
43
  {
@@ -36,6 +46,11 @@ pipeline{
36
46
  }
37
47
  }
38
48
  stage('Image push') {
49
+ when {
50
+ expression {
51
+ return params.TAG == ''
52
+ }
53
+ }
39
54
  steps {
40
55
  script
41
56
  {
@@ -0,0 +1,5 @@
1
+ <svg width="418" height="418" viewBox="0 0 418 418" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <circle cx="209" cy="209" r="209" fill="#33B1BA"/>
3
+ <path d="M128.728 105.326L100.728 122.826C92.4077 128.026 91.4251 141.826 92.2276 152.826C100.728 269.326 177.228 310.326 194.728 323.326C208.728 333.726 221.561 331.326 226.228 328.826L252.728 312.326C265.528 302.726 263.061 286.993 260.228 280.326L244.728 255.326C231.528 237.326 211.561 245.493 203.228 251.826C193.228 258.326 192.228 255.326 186.728 251.826C168.328 235.026 155.394 206.159 151.228 193.826C147.628 187.026 152.728 181.993 155.728 180.326L169.728 170.826C178.928 163.226 179.228 149.326 176.228 141.826C171.894 134.326 161.387 117.426 154.024 109.826C146.661 102.226 134.092 103.659 128.728 105.326Z" fill="white"/>
4
+ <path d="M220 156C236.5 158.5 259.5 170.5 256.5 206M225 121.5C281 132.5 295.5 180.5 290.5 211M230.5 88C300.5 97 333 164.5 324.5 216.5" stroke="white" stroke-width="16" stroke-linecap="round"/>
5
+ </svg>
@@ -0,0 +1,83 @@
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 AlertWrapper = _styledComponents.default.div.withConfig({
26
+ displayName: "Alert__AlertWrapper"
27
+ })(["border:1px solid ", ";background-color:", ";border-radius:0.5rem;padding:0.75rem;@media (min-width:640px){padding:1rem;}"], _ref => {
28
+ let {
29
+ themeColor
30
+ } = _ref;
31
+ return hexToRgba(themeColor, 0.2);
32
+ }, _ref2 => {
33
+ let {
34
+ themeColor
35
+ } = _ref2;
36
+ return hexToRgba(themeColor, 0.05);
37
+ });
38
+ const Content = _styledComponents.default.div.withConfig({
39
+ displayName: "Alert__Content"
40
+ })(["display:flex;align-items:flex-start;gap:0.75rem;"]);
41
+ const IconContainer = _styledComponents.default.div.withConfig({
42
+ displayName: "Alert__IconContainer"
43
+ })(["background-color:", ";border-radius:9999px;display:flex;align-items:center;justify-content:center;width:2rem;height:2rem;margin-top:0.125rem;@media (min-width:640px){width:2.1rem;height:2.1rem;}svg{width:1rem;height:1rem;color:", ";@media (min-width:640px){width:1.25rem;height:1.25rem;}}"], _ref3 => {
44
+ let {
45
+ themeColor
46
+ } = _ref3;
47
+ return hexToRgba(themeColor, 0.1);
48
+ }, _ref4 => {
49
+ let {
50
+ themeColor
51
+ } = _ref4;
52
+ return themeColor;
53
+ });
54
+ const TextContent = _styledComponents.default.div.withConfig({
55
+ displayName: "Alert__TextContent"
56
+ })(["flex:1;"]);
57
+ const Title = _styledComponents.default.h3.withConfig({
58
+ displayName: "Alert__Title"
59
+ })(["font-weight:500;color:", ";font-size:0.875rem;margin-bottom:0.25rem;"], _ref5 => {
60
+ let {
61
+ themeColor
62
+ } = _ref5;
63
+ return themeColor;
64
+ });
65
+ const Description = _styledComponents.default.p.withConfig({
66
+ displayName: "Alert__Description"
67
+ })(["color:#6b7280;font-size:0.75rem;@media (min-width:640px){font-size:0.875rem;}"]);
68
+ const BmAlertBox = _ref6 => {
69
+ let {
70
+ icon: Icon,
71
+ themeColor = '#EF4444',
72
+ title,
73
+ description
74
+ } = _ref6;
75
+ return /*#__PURE__*/_react.default.createElement(AlertWrapper, {
76
+ themeColor: themeColor
77
+ }, /*#__PURE__*/_react.default.createElement(Content, null, Icon && /*#__PURE__*/_react.default.createElement(IconContainer, {
78
+ themeColor: themeColor
79
+ }, /*#__PURE__*/_react.default.createElement(Icon, null)), /*#__PURE__*/_react.default.createElement(TextContent, null, /*#__PURE__*/_react.default.createElement(Title, {
80
+ themeColor: themeColor
81
+ }, title), /*#__PURE__*/_react.default.createElement(Description, null, description))));
82
+ };
83
+ var _default = exports.default = BmAlertBox;
@@ -0,0 +1,66 @@
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 = _interopRequireDefault(require("react"));
8
+ var _AccessTime = _interopRequireDefault(require("@mui/icons-material/AccessTime"));
9
+ var _Person = _interopRequireDefault(require("@mui/icons-material/Person"));
10
+ var _CalendarTodayOutlined = _interopRequireDefault(require("@mui/icons-material/CalendarTodayOutlined"));
11
+ var _Alert = _interopRequireDefault(require("./Alert"));
12
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
+ const iconOptions = {
14
+ AccessTimeIcon: _AccessTime.default,
15
+ PersonIcon: _Person.default,
16
+ CalendarTodayOutlinedIcon: _CalendarTodayOutlined.default,
17
+ None: null
18
+ };
19
+ const Template = args => {
20
+ return /*#__PURE__*/_react.default.createElement("div", {
21
+ style: {
22
+ maxWidth: 500,
23
+ margin: '2rem auto'
24
+ }
25
+ }, /*#__PURE__*/_react.default.createElement(_Alert.default, args));
26
+ };
27
+ const Default = exports.Default = Template.bind({});
28
+ Default.args = {
29
+ icon: _AccessTime.default,
30
+ themeColor: '#EF4444',
31
+ title: 'Submission Failed',
32
+ description: 'There was an issue processing your request. Please try again later.'
33
+ };
34
+ Default.argTypes = {
35
+ icon: {
36
+ control: {
37
+ type: 'select',
38
+ labels: Object.keys(iconOptions)
39
+ },
40
+ options: Object.keys(iconOptions),
41
+ mapping: iconOptions
42
+ },
43
+ themeColor: {
44
+ control: 'color'
45
+ },
46
+ title: {
47
+ control: 'text'
48
+ },
49
+ description: {
50
+ control: 'text'
51
+ }
52
+ };
53
+ var _default = exports.default = {
54
+ title: 'Components/BmAlertBox',
55
+ component: _Alert.default,
56
+ argTypes: Default.argTypes
57
+ };
58
+ const Example = () => {
59
+ return /*#__PURE__*/_react.default.createElement(_Alert.default, {
60
+ icon: _AccessTime.default,
61
+ themeColor: "#DC2626",
62
+ title: "Payment Error",
63
+ description: "We couldn't process your payment. Please try again later or contact support."
64
+ });
65
+ };
66
+ exports.Example = Example;
@@ -0,0 +1,181 @@
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 BackgroundStripe = _styledComponents.default.div.withConfig({
26
+ displayName: "CustomCardTitle__BackgroundStripe"
27
+ })(["background-color:", ";padding-top:", ";padding-bottom:", ";padding-left:1rem;padding-right:1rem;@media (min-width:640px){padding-top:", ";padding-bottom:", ";padding-left:1.5rem;padding-right:1.5rem;}"], _ref => {
28
+ let {
29
+ themeColor
30
+ } = _ref;
31
+ return hexToRgba(themeColor, 0.1);
32
+ }, _ref2 => {
33
+ let {
34
+ variant
35
+ } = _ref2;
36
+ return variant === 'confirmation' ? '1rem' : '1.5rem';
37
+ }, _ref3 => {
38
+ let {
39
+ variant
40
+ } = _ref3;
41
+ return variant === 'confirmation' ? '1rem' : '2rem';
42
+ }, _ref4 => {
43
+ let {
44
+ variant
45
+ } = _ref4;
46
+ return variant === 'confirmation' ? '1.5rem' : '2rem';
47
+ }, _ref5 => {
48
+ let {
49
+ variant
50
+ } = _ref5;
51
+ return variant === 'confirmation' ? '1.5rem' : '2.5rem';
52
+ });
53
+ const CardContainer = _styledComponents.default.div.withConfig({
54
+ displayName: "CustomCardTitle__CardContainer"
55
+ })(["background-color:", ";padding:1rem;border-radius:0.75rem;@media (min-width:640px){padding:1.5rem;}"], hexToRgba('#ffffff', 0.7));
56
+ const IconWrapper = _styledComponents.default.div.withConfig({
57
+ displayName: "CustomCardTitle__IconWrapper"
58
+ })(["background-color:", ";height:", ";width:", ";border-radius:9999px;display:flex;align-items:center;justify-content:center;margin:0 auto ", ";@media (min-width:640px){height:", ";width:", ";margin-bottom:", ";}svg{height:", ";width:", ";color:", ";@media (min-width:640px){height:", ";width:", ";}}"], _ref6 => {
59
+ let {
60
+ themeColor
61
+ } = _ref6;
62
+ return hexToRgba(themeColor, 0.1);
63
+ }, _ref7 => {
64
+ let {
65
+ variant
66
+ } = _ref7;
67
+ return variant === 'confirmation' ? '3.5rem' : '4rem';
68
+ }, _ref8 => {
69
+ let {
70
+ variant
71
+ } = _ref8;
72
+ return variant === 'confirmation' ? '3.5rem' : '4rem';
73
+ }, _ref9 => {
74
+ let {
75
+ variant
76
+ } = _ref9;
77
+ return variant === 'confirmation' ? '0.75rem' : '1rem';
78
+ }, _ref0 => {
79
+ let {
80
+ variant
81
+ } = _ref0;
82
+ return variant === 'confirmation' ? '4rem' : '5rem';
83
+ }, _ref1 => {
84
+ let {
85
+ variant
86
+ } = _ref1;
87
+ return variant === 'confirmation' ? '4rem' : '5rem';
88
+ }, _ref10 => {
89
+ let {
90
+ variant
91
+ } = _ref10;
92
+ return variant === 'confirmation' ? '1rem' : '1.25rem';
93
+ }, _ref11 => {
94
+ let {
95
+ variant
96
+ } = _ref11;
97
+ return variant === 'confirmation' ? '1.75rem' : '2rem';
98
+ }, _ref12 => {
99
+ let {
100
+ variant
101
+ } = _ref12;
102
+ return variant === 'confirmation' ? '1.75rem' : '2rem';
103
+ }, _ref13 => {
104
+ let {
105
+ themeColor
106
+ } = _ref13;
107
+ return themeColor;
108
+ }, _ref14 => {
109
+ let {
110
+ variant
111
+ } = _ref14;
112
+ return variant === 'confirmation' ? '2rem' : '2.5rem';
113
+ }, _ref15 => {
114
+ let {
115
+ variant
116
+ } = _ref15;
117
+ return variant === 'confirmation' ? '2rem' : '2.5rem';
118
+ });
119
+ const Title = _styledComponents.default.h2.withConfig({
120
+ displayName: "CustomCardTitle__Title"
121
+ })(["text-align:center;font-size:1.125rem;color:", ";margin-bottom:", ";@media (min-width:640px){font-size:1.25rem;margin-bottom:", ";}"], _ref16 => {
122
+ let {
123
+ themeColor
124
+ } = _ref16;
125
+ return themeColor;
126
+ }, _ref17 => {
127
+ let {
128
+ variant
129
+ } = _ref17;
130
+ return variant === 'confirmation' ? '0.25rem' : '0.5rem';
131
+ }, _ref18 => {
132
+ let {
133
+ variant
134
+ } = _ref18;
135
+ return variant === 'confirmation' ? '0.5rem' : '0.75rem';
136
+ });
137
+ const Description = _styledComponents.default.p.withConfig({
138
+ displayName: "CustomCardTitle__Description"
139
+ })(["text-align:center;font-size:", ";color:#6b7280;@media (min-width:640px){font-size:", ";}"], _ref19 => {
140
+ let {
141
+ variant
142
+ } = _ref19;
143
+ return variant === 'confirmation' ? '0.75rem' : '0.875rem';
144
+ }, _ref20 => {
145
+ let {
146
+ variant
147
+ } = _ref20;
148
+ return variant === 'confirmation' ? '0.875rem' : '1rem';
149
+ });
150
+ const ImageWrapper = _styledComponents.default.div.withConfig({
151
+ displayName: "CustomCardTitle__ImageWrapper"
152
+ })(["width:100%;aspect-ratio:1 / 1;overflow:hidden;border-radius:0.75rem;margin-top:1rem;img{width:100%;height:100%;object-fit:cover;display:block;}"]);
153
+ const BmCustomCardTitle = _ref21 => {
154
+ let {
155
+ icon: Icon,
156
+ themeColor = '#33B1BA',
157
+ title,
158
+ description,
159
+ variant = 'booking',
160
+ withStripe = false,
161
+ imageSrc
162
+ } = _ref21;
163
+ const content = /*#__PURE__*/_react.default.createElement(CardContainer, {
164
+ variant: variant
165
+ }, /*#__PURE__*/_react.default.createElement(IconWrapper, {
166
+ themeColor: themeColor,
167
+ variant: variant
168
+ }, Icon && /*#__PURE__*/_react.default.createElement(Icon, null)), title && /*#__PURE__*/_react.default.createElement(Title, {
169
+ variant: variant
170
+ }, title), description && /*#__PURE__*/_react.default.createElement(Description, {
171
+ variant: variant
172
+ }, description), imageSrc && /*#__PURE__*/_react.default.createElement(ImageWrapper, null, /*#__PURE__*/_react.default.createElement("img", {
173
+ src: imageSrc,
174
+ alt: title || 'Card image'
175
+ })));
176
+ return withStripe ? /*#__PURE__*/_react.default.createElement(BackgroundStripe, {
177
+ themeColor: themeColor,
178
+ variant: variant
179
+ }, content) : content;
180
+ };
181
+ var _default = exports.default = BmCustomCardTitle;
@@ -0,0 +1,92 @@
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 = _interopRequireDefault(require("react"));
8
+ var _CalendarTodayOutlined = _interopRequireDefault(require("@mui/icons-material/CalendarTodayOutlined"));
9
+ var _Check = _interopRequireDefault(require("@mui/icons-material/Check"));
10
+ var _AccessTime = _interopRequireDefault(require("@mui/icons-material/AccessTime"));
11
+ var _Favorite = _interopRequireDefault(require("@mui/icons-material/Favorite"));
12
+ var _CustomCardTitle = _interopRequireDefault(require("./CustomCardTitle"));
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
+ // MUI icons
15
+
16
+ // Icon options mapped by name
17
+ const iconOptions = {
18
+ Calendar: _CalendarTodayOutlined.default,
19
+ Check: _Check.default,
20
+ Clock: _AccessTime.default,
21
+ Heart: _Favorite.default
22
+ };
23
+ const imgs = 'https://i.imgur.com/HiAzUHl.jpeg';
24
+ const Template = args => {
25
+ return /*#__PURE__*/_react.default.createElement("div", {
26
+ style: {
27
+ maxWidth: 500,
28
+ margin: '2rem auto'
29
+ }
30
+ }, /*#__PURE__*/_react.default.createElement(_CustomCardTitle.default, args));
31
+ };
32
+ const Default = exports.Default = Template.bind({});
33
+ Default.args = {
34
+ icon: _CalendarTodayOutlined.default,
35
+ themeColor: '#33B1BA',
36
+ title: 'Book Your Medical Appointment',
37
+ description: 'Schedule a 30-minute consultation with our healthcare specialists',
38
+ variant: 'booking',
39
+ withStripe: true,
40
+ imageSrc: imgs
41
+ };
42
+ Default.argTypes = {
43
+ icon: {
44
+ control: {
45
+ type: 'select',
46
+ labels: Object.keys(iconOptions)
47
+ },
48
+ options: Object.keys(iconOptions),
49
+ mapping: iconOptions
50
+ },
51
+ themeColor: {
52
+ control: 'color'
53
+ },
54
+ title: {
55
+ control: 'text'
56
+ },
57
+ description: {
58
+ control: 'text'
59
+ },
60
+ variant: {
61
+ control: {
62
+ type: 'radio'
63
+ },
64
+ options: ['booking', 'confirmation']
65
+ },
66
+ withStripe: {
67
+ control: {
68
+ type: 'boolean'
69
+ }
70
+ },
71
+ imageSrc: {
72
+ control: 'text',
73
+ description: 'URL of the image to display in the card'
74
+ }
75
+ };
76
+ var _default = exports.default = {
77
+ title: 'Components/BmCustomCardTitle',
78
+ component: _CustomCardTitle.default,
79
+ argTypes: Default.argTypes
80
+ };
81
+ const Example = () => {
82
+ return /*#__PURE__*/_react.default.createElement(_CustomCardTitle.default, {
83
+ icon: _CalendarTodayOutlined.default,
84
+ themeColor: "#33B1BA",
85
+ title: "Book Your Medical Appointment",
86
+ description: "Schedule a 30-minute consultation with our healthcare specialists",
87
+ variant: "booking",
88
+ withStripe: true,
89
+ imageSrc: imgs
90
+ });
91
+ };
92
+ exports.Example = Example;
@@ -89,10 +89,23 @@ const BmSelector = _ref8 => {
89
89
  themeColor,
90
90
  textColor,
91
91
  fontWeight,
92
- name = 'selection'
92
+ name = 'selection',
93
+ useFormik = false
93
94
  } = _ref8;
94
95
  return /*#__PURE__*/_react.default.createElement(RadioGroupWrapper, null, data.map(item => {
95
96
  const isSelected = selectedDataId === item.id;
97
+ const handleChange = () => {
98
+ if (useFormik) {
99
+ onChange({
100
+ target: {
101
+ name,
102
+ value: item.id
103
+ }
104
+ });
105
+ } else {
106
+ onChange(item.id);
107
+ }
108
+ };
96
109
  return /*#__PURE__*/_react.default.createElement("label", {
97
110
  key: item.id,
98
111
  htmlFor: item.id
@@ -101,7 +114,7 @@ const BmSelector = _ref8 => {
101
114
  name: name,
102
115
  value: item.id,
103
116
  checked: isSelected,
104
- onChange: () => onChange(item.id)
117
+ onChange: handleChange
105
118
  }), /*#__PURE__*/_react.default.createElement(TimeSlotCard, {
106
119
  selected: isSelected,
107
120
  themeColor: themeColor
@@ -56,6 +56,12 @@ var _default = exports.default = {
56
56
  endDate: '09:30 AM'
57
57
  }
58
58
  }]
59
+ },
60
+ useFormik: {
61
+ control: {
62
+ type: 'boolean'
63
+ },
64
+ defaultValue: false
59
65
  }
60
66
  }
61
67
  };
@@ -102,6 +108,7 @@ Default.args = {
102
108
  endDate: '09:30 AM'
103
109
  }
104
110
  }],
111
+ useFormik: false,
105
112
  themeColor: '#33B1BA',
106
113
  textColor: '#33B1BA',
107
114
  fontWeight: '',
@@ -124,15 +131,21 @@ const Example = () => {
124
131
  endDate: '11:10 AM'
125
132
  }
126
133
  }];
134
+
135
+ // When you use useFormik as true then you need to pass handleChange func and the name [name="time"].
136
+ // so that is works accordingly
137
+
127
138
  const [selectedDataId, setSelectedDataId] = (0, _react.useState)(null);
128
139
  return /*#__PURE__*/_react.default.createElement(_BmSelector.default, {
140
+ name: "time",
129
141
  data: slots,
130
142
  selectedDataId: selectedDataId,
131
143
  onChange: setSelectedDataId,
132
144
  icon: _AccessTime.default,
133
145
  themeColor: "#33B1BA",
134
146
  textColor: "#33B1BA",
135
- fontWeight: "600"
147
+ fontWeight: "600",
148
+ useFormik: "false"
136
149
  });
137
150
  };
138
151
  exports.Example = Example;
@@ -0,0 +1,51 @@
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 = _interopRequireWildcard(require("styled-components"));
9
+ 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); }
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
+ const TabsContainer = _styledComponents.default.div.withConfig({
12
+ displayName: "BmTabv2__TabsContainer"
13
+ })(["width:100%;"]);
14
+ const TabsHeader = _styledComponents.default.div.withConfig({
15
+ displayName: "BmTabv2__TabsHeader"
16
+ })(["display:flex;justify-content:flex-start;align-items:center;margin-bottom:14px;padding:0 14px;border-radius:var(--radius-lg,12px);flex-wrap:wrap;"]);
17
+ const TabsList = _styledComponents.default.div.withConfig({
18
+ displayName: "BmTabv2__TabsList"
19
+ })(["width:100%;display:inline-flex;background-color:var(--color-muted,#f2f2f2);color:var(--color-muted-foreground,#666);align-items:center;justify-content:center;border-radius:var(--radius-lg,12px);padding:4px 4px;"]);
20
+ const TabsTriggerButton = _styledComponents.default.button.withConfig({
21
+ displayName: "BmTabv2__TabsTriggerButton"
22
+ })(["display:inline-flex;flex:1;align-items:center;justify-content:center;gap:6px;border:1px solid transparent;border-radius:var(--radius-lg,12px);padding:6px 12px;font-size:14px;font-weight:500;white-space:nowrap;transition:color 0.2s,box-shadow 0.2s,background-color 0.2s;cursor:pointer;", " &:focus-visible{outline:none;border-color:var(--color-ring,#2684ff);box-shadow:0 0 0 3px rgba(38,132,255,0.3);}&:disabled{pointer-events:none;opacity:0.5;}svg{flex-shrink:0;pointer-events:none;width:16px;height:16px;}"], _ref => {
23
+ let {
24
+ active
25
+ } = _ref;
26
+ return active ? (0, _styledComponents.css)(["background-color:var(--color-card,#fff);color:var(--color-foreground,#000);border-color:var(--color-border,#ddd);"]) : (0, _styledComponents.css)(["background-color:transparent;color:var(--color-muted-foreground,#666);"]);
27
+ });
28
+ const IconWrapper = _styledComponents.default.span.withConfig({
29
+ displayName: "BmTabv2__IconWrapper"
30
+ })(["display:flex;align-items:center;justify-content:center;"]);
31
+ const BmCustomTab = _ref2 => {
32
+ let {
33
+ value,
34
+ onValueChange,
35
+ tabs = [],
36
+ className
37
+ } = _ref2;
38
+ return /*#__PURE__*/_react.default.createElement(TabsContainer, {
39
+ className: className
40
+ }, /*#__PURE__*/_react.default.createElement(TabsHeader, null, /*#__PURE__*/_react.default.createElement(TabsList, null, tabs.map(tab => {
41
+ const Icon = tab.icon;
42
+ return /*#__PURE__*/_react.default.createElement(TabsTriggerButton, {
43
+ key: tab.value,
44
+ active: value === tab.value,
45
+ onClick: () => onValueChange(tab.value)
46
+ }, Icon && /*#__PURE__*/_react.default.createElement(IconWrapper, null, /*#__PURE__*/_react.default.createElement(Icon, {
47
+ fontSize: "small"
48
+ })), /*#__PURE__*/_react.default.createElement("span", null, tab.label));
49
+ }))));
50
+ };
51
+ var _default = exports.default = BmCustomTab;