@bigmath-ui-library/core 2.0.4

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 (229) hide show
  1. package/LICENSE +7 -0
  2. package/LICENSE.md +1 -0
  3. package/README.md +42 -0
  4. package/dist/cjs/index.css +11 -0
  5. package/dist/cjs/index.js +134365 -0
  6. package/dist/esm/index.css +11 -0
  7. package/dist/esm/index.js +134258 -0
  8. package/package.json +58 -0
  9. package/rollup.config.js +73 -0
  10. package/src/BMClassnameSetup.ts +3 -0
  11. package/src/assets/icons/Calendar.svg +6 -0
  12. package/src/assets/icons/Close.svg +40 -0
  13. package/src/assets/icons/Default-Loading-Circles.svg +31 -0
  14. package/src/assets/icons/alert.svg +6 -0
  15. package/src/assets/icons/aws.svg +19 -0
  16. package/src/assets/icons/caret-down.svg +3 -0
  17. package/src/assets/icons/check.svg +6 -0
  18. package/src/assets/icons/circle-check-solid.svg +7 -0
  19. package/src/assets/icons/circle-check.svg +6 -0
  20. package/src/assets/icons/circle-selected.svg +3 -0
  21. package/src/assets/icons/circle-unselected.svg +3 -0
  22. package/src/assets/icons/close-basic.svg +3 -0
  23. package/src/assets/icons/close_collapse.svg +3 -0
  24. package/src/assets/icons/copy.svg +3 -0
  25. package/src/assets/icons/drag.svg +3 -0
  26. package/src/assets/icons/expand-more.svg +3 -0
  27. package/src/assets/icons/failed-solid.svg +7 -0
  28. package/src/assets/icons/globe.svg +3 -0
  29. package/src/assets/icons/google-cloud.svg +6 -0
  30. package/src/assets/icons/in-active.svg +4 -0
  31. package/src/assets/icons/info-solid.svg +6 -0
  32. package/src/assets/icons/info.svg +6 -0
  33. package/src/assets/icons/k8s.svg +4 -0
  34. package/src/assets/icons/lock-locked.svg +5 -0
  35. package/src/assets/icons/microsoft-azure.svg +9 -0
  36. package/src/assets/icons/onprem.svg +3 -0
  37. package/src/assets/icons/pencil.svg +3 -0
  38. package/src/assets/icons/search.svg +6 -0
  39. package/src/assets/icons/shield.svg +4 -0
  40. package/src/assets/icons/star.svg +3 -0
  41. package/src/assets/icons/success-tick.svg +3 -0
  42. package/src/assets/icons/timer.svg +3 -0
  43. package/src/assets/icons/visibility-off.svg +6 -0
  44. package/src/assets/icons/visibility.svg +6 -0
  45. package/src/assets/icons/warning.svg +6 -0
  46. package/src/bma/components/BMButton/BMButton.tsx +34 -0
  47. package/src/bma/components/BMButton/index.ts +1 -0
  48. package/src/bma/components/BMInput/BMInput.tsx +13 -0
  49. package/src/bma/components/BMInput/BMInputField.tsx +7 -0
  50. package/src/bma/components/BMInput/BMSearch.tsx +6 -0
  51. package/src/bma/components/BMInput/index.ts +3 -0
  52. package/src/bma/index.ts +3 -0
  53. package/src/bma/package.json +4 -0
  54. package/src/bma/theme/BMAutocomplete.ts +12 -0
  55. package/src/bma/theme/BMInput.ts +46 -0
  56. package/src/bma/theme/theme.ts +15 -0
  57. package/src/bma/theme/themeUtils.ts +10 -0
  58. package/src/components/BMAccordion/BMAccordion.tsx +150 -0
  59. package/src/components/BMAccordion/index.ts +1 -0
  60. package/src/components/BMAddSection/BMAddSection.tsx +38 -0
  61. package/src/components/BMAddSection/index.ts +1 -0
  62. package/src/components/BMAlert/BMAlert.tsx +168 -0
  63. package/src/components/BMAlert/index.ts +1 -0
  64. package/src/components/BMAutoComplete/BMAutoComplete.tsx +86 -0
  65. package/src/components/BMAutoComplete/index.ts +1 -0
  66. package/src/components/BMAvatar/BMAvatar.tsx +45 -0
  67. package/src/components/BMAvatar/index.ts +1 -0
  68. package/src/components/BMButton/BMButton.tsx +46 -0
  69. package/src/components/BMButton/BMButtonGroup.tsx +46 -0
  70. package/src/components/BMButton/BMSplitButton.tsx +72 -0
  71. package/src/components/BMButton/index.ts +3 -0
  72. package/src/components/BMCheckbox/BMCheckbox.tsx +44 -0
  73. package/src/components/BMCheckbox/BMCheckboxField.tsx +41 -0
  74. package/src/components/BMCheckbox/index.ts +2 -0
  75. package/src/components/BMCloudSelect/BMCloudList.tsx +43 -0
  76. package/src/components/BMCloudSelect/BMCloudSelect.tsx +109 -0
  77. package/src/components/BMCloudSelect/BMCloudSelectField.tsx +46 -0
  78. package/src/components/BMCloudSelect/index.ts +3 -0
  79. package/src/components/BMCodeBlock/BMCodeBlock.tsx +233 -0
  80. package/src/components/BMCodeBlock/index.ts +1 -0
  81. package/src/components/BMDatePicker/BMDatePicker.tsx +187 -0
  82. package/src/components/BMDatePicker/index.ts +1 -0
  83. package/src/components/BMDropdown/BMDropdown.tsx +107 -0
  84. package/src/components/BMDropdown/index.ts +1 -0
  85. package/src/components/BMForm/BMFormControlLabel.tsx +23 -0
  86. package/src/components/BMForm/BMLabel.tsx +24 -0
  87. package/src/components/BMForm/index.ts +2 -0
  88. package/src/components/BMHelloBanner/BMHelloBanner.tsx +68 -0
  89. package/src/components/BMHelloBanner/index.ts +1 -0
  90. package/src/components/BMInput/BMInput.tsx +31 -0
  91. package/src/components/BMInput/BMInputEditableCode.tsx +120 -0
  92. package/src/components/BMInput/BMInputField.tsx +37 -0
  93. package/src/components/BMInput/BMSearch.tsx +17 -0
  94. package/src/components/BMInput/BMStripeInput.tsx +24 -0
  95. package/src/components/BMInput/index.ts +5 -0
  96. package/src/components/BMLoadingBox/BMLoadingBox.tsx +45 -0
  97. package/src/components/BMLoadingBox/index.ts +1 -0
  98. package/src/components/BMMaps/BMMapMarker.css +12 -0
  99. package/src/components/BMMaps/BMMapMarker.tsx +68 -0
  100. package/src/components/BMMaps/BMMaps.tsx +129 -0
  101. package/src/components/BMMaps/MapIcons.tsx +83 -0
  102. package/src/components/BMMaps/icons/GeoPartition.svg +19 -0
  103. package/src/components/BMMaps/icons/GeoPartitionHover.svg +20 -0
  104. package/src/components/BMMaps/icons/MasterPreferred.svg +19 -0
  105. package/src/components/BMMaps/icons/MasterPreferredHover.svg +20 -0
  106. package/src/components/BMMaps/icons/ReadReplica.svg +18 -0
  107. package/src/components/BMMaps/icons/ReadReplicaHover.svg +19 -0
  108. package/src/components/BMMaps/icons/RegionNotSelected.svg +18 -0
  109. package/src/components/BMMaps/icons/RegionNotSelectedHover.svg +19 -0
  110. package/src/components/BMMaps/icons/RegionPreferred.svg +18 -0
  111. package/src/components/BMMaps/icons/RegionPreferredHover.svg +19 -0
  112. package/src/components/BMMaps/icons/RegionSelected.svg +18 -0
  113. package/src/components/BMMaps/icons/RegionSelectedHover.svg +19 -0
  114. package/src/components/BMMaps/index.ts +5 -0
  115. package/src/components/BMMaps/legend/MapLegend.tsx +80 -0
  116. package/src/components/BMMaps/markerTypes.ts +8 -0
  117. package/src/components/BMModal/BMModal.tsx +313 -0
  118. package/src/components/BMModal/index.ts +1 -0
  119. package/src/components/BMMultiEntry/BMMultiEntry.tsx +328 -0
  120. package/src/components/BMMultiEntry/BMMultiEntryField.tsx +47 -0
  121. package/src/components/BMMultiEntry/index.ts +2 -0
  122. package/src/components/BMMultiLevelStepper/BMMultiLevelStepper.tsx +191 -0
  123. package/src/components/BMMultiLevelStepper/index.ts +1 -0
  124. package/src/components/BMPagination/BMPagination.tsx +64 -0
  125. package/src/components/BMPagination/index.ts +1 -0
  126. package/src/components/BMPassword/BMPassword.tsx +37 -0
  127. package/src/components/BMPassword/BMPasswordField.tsx +50 -0
  128. package/src/components/BMPassword/index.ts +2 -0
  129. package/src/components/BMProgress/BMProgress.tsx +43 -0
  130. package/src/components/BMProgress/index.ts +1 -0
  131. package/src/components/BMRadio/BMRadio.tsx +162 -0
  132. package/src/components/BMRadio/BMRadioGroupField.tsx +40 -0
  133. package/src/components/BMRadio/index.ts +2 -0
  134. package/src/components/BMSelect/BMSelect.tsx +70 -0
  135. package/src/components/BMSelect/BMSelectField.tsx +47 -0
  136. package/src/components/BMSelect/index.ts +2 -0
  137. package/src/components/BMSlider/BMSlider.tsx +16 -0
  138. package/src/components/BMSlider/index.ts +1 -0
  139. package/src/components/BMSmartStatus/BMSmartStatus.tsx +185 -0
  140. package/src/components/BMSmartStatus/index.tsx +1 -0
  141. package/src/components/BMStatus/BMStatus.tsx +98 -0
  142. package/src/components/BMStatus/index.ts +1 -0
  143. package/src/components/BMTable/BMTable.tsx +131 -0
  144. package/src/components/BMTable/index.ts +1 -0
  145. package/src/components/BMTabs/BMTabs.tsx +50 -0
  146. package/src/components/BMTabs/index.ts +1 -0
  147. package/src/components/BMTag/BMTag.tsx +47 -0
  148. package/src/components/BMTag/index.ts +1 -0
  149. package/src/components/BMTagv2/BMTagv2.tsx +250 -0
  150. package/src/components/BMTagv2/index.ts +1 -0
  151. package/src/components/BMToggle/BMMultiToggleButton.tsx +99 -0
  152. package/src/components/BMToggle/BMToggle.tsx +35 -0
  153. package/src/components/BMToggle/BMToggleField.tsx +28 -0
  154. package/src/components/BMToggle/index.ts +3 -0
  155. package/src/components/BMTooltip/BMTooltip.tsx +52 -0
  156. package/src/components/BMTooltip/index.ts +1 -0
  157. package/src/components/BMWarning/BMWarning.tsx +39 -0
  158. package/src/components/BMWarning/index.ts +1 -0
  159. package/src/components/GenericFailure/GenericFailure.tsx +28 -0
  160. package/src/components/GenericFailure/index.ts +1 -0
  161. package/src/components/NoAccess/NoAccess.tsx +40 -0
  162. package/src/components/NoAccess/NoAccessActionTooltip.tsx +53 -0
  163. package/src/components/NoAccess/NoPermissionModal.tsx +55 -0
  164. package/src/components/NoAccess/index.ts +3 -0
  165. package/src/components/index.ts +34 -0
  166. package/src/index.ts +9 -0
  167. package/src/theme/BMAutoComplete.ts +152 -0
  168. package/src/theme/BMAvatar.ts +5 -0
  169. package/src/theme/BMButton.ts +132 -0
  170. package/src/theme/BMButtonGroup.ts +49 -0
  171. package/src/theme/BMCheckbox.ts +16 -0
  172. package/src/theme/BMFormHelperText.ts +19 -0
  173. package/src/theme/BMInput.ts +120 -0
  174. package/src/theme/BMMaps.ts +9 -0
  175. package/src/theme/BMRadio.ts +10 -0
  176. package/src/theme/BMTabs.ts +79 -0
  177. package/src/theme/BMTag.ts +28 -0
  178. package/src/theme/BMToggle.ts +50 -0
  179. package/src/theme/BMTooltip.ts +34 -0
  180. package/src/theme/theme.ts +326 -0
  181. package/src/theme/variables.ts +152 -0
  182. package/src/types/custom.d.ts +9 -0
  183. package/src/types/svg.d.ts +5 -0
  184. package/stories/BMAButton.stories.tsx +67 -0
  185. package/stories/BMAccordion.stories.tsx +55 -0
  186. package/stories/BMAddSection.stories.tsx +40 -0
  187. package/stories/BMAlert.stories.tsx +33 -0
  188. package/stories/BMAutoComplete.stories.tsx +65 -0
  189. package/stories/BMAvatar.stories.tsx +76 -0
  190. package/stories/BMButton.stories.tsx +57 -0
  191. package/stories/BMButton2.stories.tsx +131 -0
  192. package/stories/BMCheckbox.stories.tsx +23 -0
  193. package/stories/BMCloudSelectField.stories.tsx +40 -0
  194. package/stories/BMCodeBlock.stories.tsx +57 -0
  195. package/stories/BMDatePicker.stories.tsx +88 -0
  196. package/stories/BMDropdown.stories.tsx +84 -0
  197. package/stories/BMGroupButton.stories.tsx +53 -0
  198. package/stories/BMHelloBanner.stories.tsx +33 -0
  199. package/stories/BMInput.stories.tsx +184 -0
  200. package/stories/BMInputEditableCode.stories.tsx +86 -0
  201. package/stories/BMInputField.stories.tsx +50 -0
  202. package/stories/BMLoadingBox.stories.tsx +45 -0
  203. package/stories/BMMaps.stories.tsx +29 -0
  204. package/stories/BMModal.stories.tsx +218 -0
  205. package/stories/BMMultiEntry.stories.tsx +93 -0
  206. package/stories/BMMultiLevelStepper.stories.tsx +87 -0
  207. package/stories/BMPagination.stories.tsx +41 -0
  208. package/stories/BMPassword.stories.tsx +133 -0
  209. package/stories/BMProgress.stories.tsx +60 -0
  210. package/stories/BMRadio.stories.tsx +71 -0
  211. package/stories/BMSelect.stories.tsx +160 -0
  212. package/stories/BMSlider.stories.tsx +74 -0
  213. package/stories/BMSmartStatus.stories.tsx +98 -0
  214. package/stories/BMSplitButton.stories.tsx +32 -0
  215. package/stories/BMStatus.stories.tsx +29 -0
  216. package/stories/BMTable.stories.tsx +350 -0
  217. package/stories/BMTabs.stories.tsx +25 -0
  218. package/stories/BMTag.stories.tsx +63 -0
  219. package/stories/BMTagv2.stories.tsx +288 -0
  220. package/stories/BMToggle.stories.tsx +123 -0
  221. package/stories/BMTooltip.stories.tsx +59 -0
  222. package/stories/BMTypography.stories.tsx +79 -0
  223. package/stories/BMWarning.stories.tsx +55 -0
  224. package/stories/GenericFailure.stories.tsx +47 -0
  225. package/stories/NoAccess.stories.tsx +19 -0
  226. package/stories/NoAccessActionTooltip.stories.tsx +50 -0
  227. package/stories/NoPermissionModal.stories.tsx +46 -0
  228. package/tsconfig.base.json +21 -0
  229. package/tsconfig.build.json +23 -0
@@ -0,0 +1,288 @@
1
+ import React from 'react';
2
+ import type { Meta, StoryFn } from "@storybook/react";
3
+ import { Box, Stack } from "@mui/material";
4
+ import { BMTagv2 } from "../src/components/BMTagv2";
5
+ import { Language as LanguageIcon } from '@mui/icons-material';
6
+ import type { BMTagv2Props } from "../src/components/BMTagv2/BMTagv2";
7
+ import AlertIcon from "@coreApp/assets/icons/alert.svg";
8
+ import DragIcon from "@coreApp/assets/icons/drag.svg";
9
+
10
+ const meta: Meta<typeof BMTagv2> = {
11
+ title: "InReview/BMTagv2",
12
+ component: BMTagv2,
13
+ tags: ["autodocs"],
14
+ argTypes: {
15
+ text: { control: "text" },
16
+ size: {
17
+ control: "select",
18
+ options: ["sm", "md", "lg"],
19
+ defaultValue: "md"
20
+ },
21
+ variant: {
22
+ control: "select",
23
+ options: ["default", "primary", "success", "warning", "error", "info"],
24
+ defaultValue: "default"
25
+ },
26
+ prefixIcon: {
27
+ control: "select",
28
+ options: [undefined, "language", "star", "close", "check", "warning", "info", "error"],
29
+ defaultValue: undefined
30
+ },
31
+ suffixIcon: {
32
+ control: "select",
33
+ options: [undefined, "language", "star", "close", "check", "warning", "info", "error"],
34
+ defaultValue: undefined
35
+ },
36
+ noGradient: { control: "boolean" },
37
+ filled: { control: "boolean" }
38
+ },
39
+ decorators: [
40
+ (Story) => (
41
+ <div style={{ margin: "3em" }}>
42
+ <Story />
43
+ </div>
44
+ ),
45
+ ],
46
+ };
47
+
48
+ export default meta;
49
+
50
+ export const AllVariants: StoryFn<BMTagv2Props> = () => {
51
+ return (
52
+ <Stack spacing={4}>
53
+ {/* Size Variants */}
54
+ <Box>
55
+ <h3>Size Variants</h3>
56
+ <Stack direction="row" spacing={2}>
57
+ <BMTagv2 text="Small Tag" size="sm" />
58
+ <BMTagv2 text="Medium Tag" size="md" />
59
+ <BMTagv2 text="Large Tag" size="lg" />
60
+ </Stack>
61
+ </Box>
62
+
63
+ {/* Color Variants */}
64
+ <Box>
65
+ <h3>Color Variants</h3>
66
+ <Stack direction="row" spacing={2}>
67
+ <BMTagv2 text="Default" variant="default" noGradient />
68
+ <BMTagv2 text="Primary" variant="primary" noGradient />
69
+ <BMTagv2 text="Success" variant="success" noGradient />
70
+ <BMTagv2 text="Warning" variant="warning" noGradient />
71
+ <BMTagv2 text="Error" variant="error" noGradient />
72
+ <BMTagv2 text="Info" variant="info" noGradient />
73
+ </Stack>
74
+ </Box>
75
+
76
+ {/* Filled Variants */}
77
+ <Box>
78
+ <h3>Filled Variants</h3>
79
+ <Stack direction="row" spacing={2}>
80
+ <BMTagv2 text="Default" variant="default" noGradient filled />
81
+ <BMTagv2 text="Primary" variant="primary" noGradient filled />
82
+ <BMTagv2 text="Success" variant="success" noGradient filled />
83
+ <BMTagv2 text="Warning" variant="warning" noGradient filled />
84
+ <BMTagv2 text="Error" variant="error" noGradient filled />
85
+ <BMTagv2 text="Info" variant="info" noGradient filled />
86
+ </Stack>
87
+ </Box>
88
+
89
+ {/* Gradient vs Non-Gradient */}
90
+ <Box>
91
+ <h3>Gradient vs Non-Gradient</h3>
92
+ <Stack direction="row" spacing={2}>
93
+ <BMTagv2 text="With Gradient" noGradient={false} />
94
+ <BMTagv2 text="No Gradient" noGradient={true} />
95
+ </Stack>
96
+ </Box>
97
+
98
+ {/* Predefined Icons */}
99
+ <Box>
100
+ <h3>Predefined Icons</h3>
101
+ <Stack direction="row" spacing={2}>
102
+ <BMTagv2
103
+ text="Language Icon"
104
+ prefixIcon="language"
105
+ />
106
+ <BMTagv2
107
+ text="Star Icon"
108
+ prefixIcon="star"
109
+ />
110
+ <BMTagv2
111
+ text="Check Icon"
112
+ prefixIcon="check"
113
+ />
114
+ <BMTagv2
115
+ text="Warning Icon"
116
+ prefixIcon="warning"
117
+ variant="warning"
118
+ noGradient
119
+ />
120
+ <BMTagv2
121
+ text="Error Icon"
122
+ prefixIcon="error"
123
+ variant="error"
124
+ noGradient
125
+ />
126
+ <BMTagv2
127
+ text="Info Icon"
128
+ prefixIcon="info"
129
+ variant="info"
130
+ noGradient
131
+ />
132
+ </Stack>
133
+ </Box>
134
+
135
+ {/* Custom Icons */}
136
+ <Box>
137
+ <h3>Custom Icons</h3>
138
+ <Stack direction="row" spacing={2}>
139
+ <BMTagv2
140
+ text="Custom Prefix"
141
+ prefixIcon={<LanguageIcon />}
142
+ />
143
+ <BMTagv2
144
+ text="Custom Suffix"
145
+ suffixIcon={<LanguageIcon />}
146
+ />
147
+ <BMTagv2
148
+ text="Both Icons"
149
+ prefixIcon="info"
150
+ suffixIcon="close"
151
+ />
152
+ </Stack>
153
+ </Box>
154
+
155
+ {/* Combined Features */}
156
+ <Box>
157
+ <h3>Combined Features</h3>
158
+ <Stack direction="row" spacing={2}>
159
+ <BMTagv2
160
+ text="Large Primary Filled"
161
+ size="lg"
162
+ variant="primary"
163
+ noGradient
164
+ filled
165
+ prefixIcon="language"
166
+ />
167
+ <BMTagv2
168
+ text="Success with Icons"
169
+ variant="success"
170
+ noGradient
171
+ prefixIcon="check"
172
+ suffixIcon="close"
173
+ />
174
+ <BMTagv2
175
+ text="Small Warning"
176
+ size="sm"
177
+ variant="warning"
178
+ noGradient
179
+ prefixIcon="warning"
180
+ suffixIcon="close"
181
+ />
182
+ </Stack>
183
+ </Box>
184
+ </Stack>
185
+ );
186
+ };
187
+
188
+ export const MaintenanceTags: StoryFn<BMTagv2Props>= (args) => {
189
+ return (
190
+ <div style={{ display: 'flex', gap: '8px', backgroundColor: '#e5e5e5', padding: '16px' }}>
191
+ <BMTagv2
192
+ text={
193
+ <span>
194
+ Upcoming Critical Maintenance{' '}
195
+ <a
196
+ href="#"
197
+ style={{
198
+ color: 'inherit',
199
+ textDecoration: 'underline',
200
+ }}
201
+ onClick={(e) => {
202
+ e.preventDefault();
203
+ // Handle click event
204
+ }}
205
+ >
206
+ Details
207
+ </a>
208
+ </span>
209
+ }
210
+ prefixIcon={<AlertIcon />}
211
+ customColor={{
212
+ background: '#FFFAC9',
213
+ color: '#25323D',
214
+ border: '0'
215
+ }}
216
+ />
217
+ <BMTagv2
218
+ text={
219
+ <span>
220
+ Upcoming Critical Maintenance{' '}
221
+ <a
222
+ href="#"
223
+ style={{
224
+ color: 'inherit',
225
+ textDecoration: 'underline',
226
+ }}
227
+ onClick={(e) => {
228
+ e.preventDefault();
229
+ }}
230
+ >
231
+ Details
232
+ </a>
233
+ </span>
234
+ }
235
+ prefixIcon="info"
236
+ variant='primary'
237
+ noGradient
238
+ filled
239
+ />
240
+ <Box sx={{ display: 'flex', alignItems: 'center', height: 20, background: '#ffffff', borderRadius: '4px' }}>
241
+ <BMTagv2
242
+ text="New"
243
+ variant='default'
244
+ size='sm'
245
+ filled
246
+ />
247
+ </Box>
248
+ <BMTagv2
249
+ text="20% OFF"
250
+ size='sm'
251
+ customColor={{
252
+ background: '#EBF8FF',
253
+ color: '#006BBF',
254
+ border: '0px solid #B3E5FC'
255
+ }}
256
+ />
257
+ <BMTagv2
258
+ text="example@gmail.com"
259
+ size='md'
260
+ suffixIcon='close'
261
+ prefixIcon={<DragIcon />}
262
+ customColor={{
263
+ background: '#EBF8FF',
264
+ color: '#006BBF',
265
+ border: '0px solid #B3E5FC'
266
+ }}
267
+ />
268
+ </div>
269
+ );
270
+ }
271
+
272
+ export const Playground: StoryFn<BMTagv2Props> = (args) => {
273
+ return (
274
+ <Box sx={{ display: "flex" }}>
275
+ <BMTagv2 {...args} />
276
+ </Box>
277
+ );
278
+ };
279
+
280
+ Playground.args = {
281
+ text: "Example Tag",
282
+ size: "md",
283
+ variant: "default",
284
+ noGradient: false,
285
+ filled: false,
286
+ prefixIcon: undefined,
287
+ suffixIcon: undefined,
288
+ };
@@ -0,0 +1,123 @@
1
+ import React, { useState } from "react";
2
+ import type { Meta, StoryFn } from "@storybook/react";
3
+ import { useForm, FormProvider } from "react-hook-form";
4
+
5
+ import {
6
+ BMToggle,
7
+ type BMToggleProps,
8
+ BMToggleField,
9
+ BMMultiToggleButton,
10
+ type BMMultiToggleButtonProps,
11
+ } from "../src";
12
+
13
+ const meta: Meta<BMToggleProps> = {
14
+ title: "BMToggle",
15
+ component: BMToggle,
16
+ tags: ["autodocs"],
17
+ decorators: [
18
+ // biome-ignore lint: TODO for any
19
+ (Story) => (
20
+ <div style={{ margin: "3em" }}>
21
+ <Story />
22
+ </div>
23
+ ),
24
+ ],
25
+ };
26
+
27
+ export default meta;
28
+
29
+ export const Toggle: StoryFn<BMToggleProps> = (props) => {
30
+ const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
31
+ alert(event.target.checked);
32
+ };
33
+
34
+ return (
35
+ <div style={{ display: "flex", flexDirection: "column", gap: "32px" }}>
36
+ <BMToggle name="toggle" label="Inline with label" {...props} />
37
+ <BMToggle name="toggle" label="" onChange={handleChange} {...props} />
38
+ <BMToggle name="toggle" label="Disabled" {...props} disabled />
39
+ <BMToggle
40
+ name="toggle"
41
+ label="Checked & Disabled"
42
+ {...props}
43
+ checked
44
+ disabled
45
+ />
46
+ </div>
47
+ );
48
+ };
49
+
50
+ export const ToggleField: StoryFn = () => {
51
+ const methods = useForm({
52
+ defaultValues: {
53
+ enableFeature: true,
54
+ },
55
+ });
56
+
57
+ const onSubmit = (data: any) => {
58
+ alert(JSON.stringify(data, null, 2));
59
+ };
60
+
61
+ return (
62
+ <FormProvider {...methods}>
63
+ <form onSubmit={methods.handleSubmit(onSubmit)}>
64
+ <div style={{ display: "flex", flexDirection: "column", gap: "24px" }}>
65
+ <BMToggleField
66
+ dataTestId="bm-toggle-field"
67
+ name="enableFeature"
68
+ control={methods.control}
69
+ label="Enable Feature"
70
+ />
71
+ <button type="submit">Submit</button>
72
+ </div>
73
+ </form>
74
+ </FormProvider>
75
+ );
76
+ };
77
+
78
+ ToggleField.storyName = "ToggleField";
79
+ ToggleField.parameters = {
80
+ docs: {
81
+ description: {
82
+ story:
83
+ "BMToggleField is a wrapper around BMToggle that connects it to react-hook-form via useController.",
84
+ },
85
+ },
86
+ };
87
+
88
+ type OptionValue = "option1" | "option2" | "option3";
89
+
90
+ const options: BMMultiToggleButtonProps<OptionValue>["options"] = [
91
+ { label: "Option 1", value: "option1" },
92
+ { label: "Option 2", value: "option2" },
93
+ { label: "Option 3", value: "option3" },
94
+ ];
95
+
96
+ export const MultiToggleButton: StoryFn = () => {
97
+ const [value, setValue] = useState<OptionValue>("option1");
98
+
99
+ return (
100
+ <div style={{ maxWidth: 400 }}>
101
+ <BMMultiToggleButton
102
+ options={options}
103
+ value={value}
104
+ onChange={(val) => setValue(val)}
105
+ />
106
+ </div>
107
+ );
108
+ };
109
+
110
+ export const MultiToggleButtonDense: StoryFn = () => {
111
+ const [value, setValue] = useState<OptionValue>("option2");
112
+
113
+ return (
114
+ <div style={{ maxWidth: 400 }}>
115
+ <BMMultiToggleButton
116
+ options={options}
117
+ value={value}
118
+ dense
119
+ onChange={(val) => setValue(val)}
120
+ />
121
+ </div>
122
+ );
123
+ };
@@ -0,0 +1,59 @@
1
+ import { Box, Typography } from "@mui/material";
2
+ import type { Meta } from "@storybook/react";
3
+ import { BMTooltip, BMTooltipProps } from "../src";
4
+
5
+ export default {
6
+ title: "BMTooltip",
7
+ component: BMTooltip,
8
+ parameters: {
9
+ controls: {
10
+ include: ["title", "arrow", "placement"],
11
+ },
12
+ },
13
+ argTypes: {
14
+ arrow: {
15
+ control: { type: "boolean" },
16
+ },
17
+ placement: {
18
+ control: { type: "select" },
19
+ options: [
20
+ "bottom-end",
21
+ "bottom-start",
22
+ "bottom",
23
+ "left-end",
24
+ "left-start",
25
+ "left",
26
+ "right-end",
27
+ "right-start",
28
+ "right",
29
+ "top-end",
30
+ "top-start",
31
+ "top",
32
+ ],
33
+ },
34
+ },
35
+ } as Meta;
36
+
37
+ export const Tooltip = (args: BMTooltipProps) => (
38
+ <Box
39
+ width="100%"
40
+ height="400px"
41
+ display="flex"
42
+ alignItems="center"
43
+ justifyContent="center"
44
+ >
45
+ <BMTooltip {...args} />
46
+ <BMTooltip {...args}>
47
+ <span>
48
+ <Typography variant="body2">{"Text with tooltip"}</Typography>
49
+ </span>
50
+ </BMTooltip>
51
+ </Box>
52
+ );
53
+ Tooltip.args = {
54
+ arrow: true,
55
+ placement: "top-start",
56
+ title:
57
+ "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et " +
58
+ "dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip.",
59
+ };
@@ -0,0 +1,79 @@
1
+ import {
2
+ Box,
3
+ Typography as MuiTypography,
4
+ type TypographyProps,
5
+ } from "@mui/material";
6
+ import type { Meta } from "@storybook/react";
7
+
8
+ const meta: Meta<typeof MuiTypography> = {
9
+ component: MuiTypography,
10
+ title: "Typography",
11
+ };
12
+ export default meta;
13
+
14
+ export const Typography = (props: TypographyProps) => (
15
+ <Box sx={{ width: "100%", maxWidth: 500 }}>
16
+ <MuiTypography variant="h1" gutterBottom {...props}>
17
+ h1. Heading
18
+ </MuiTypography>
19
+ <MuiTypography variant="h2" gutterBottom {...props}>
20
+ h2. Heading
21
+ </MuiTypography>
22
+ <MuiTypography variant="h3" gutterBottom {...props}>
23
+ h3. Heading
24
+ </MuiTypography>
25
+ <MuiTypography variant="h4" gutterBottom {...props}>
26
+ h4. Heading
27
+ </MuiTypography>
28
+ <MuiTypography variant="h5" gutterBottom {...props}>
29
+ h5. Heading
30
+ </MuiTypography>
31
+ <MuiTypography variant="h6" gutterBottom {...props}>
32
+ h6. Heading
33
+ </MuiTypography>
34
+ <MuiTypography variant="subtitle1" gutterBottom {...props}>
35
+ subtitle1. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quos
36
+ blanditiis tenetur
37
+ </MuiTypography>
38
+ <MuiTypography variant="subtitle2" gutterBottom {...props}>
39
+ subtitle2. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quos
40
+ blanditiis tenetur
41
+ </MuiTypography>
42
+ <MuiTypography variant="body1" gutterBottom {...props}>
43
+ body1. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quos
44
+ blanditiis tenetur unde suscipit, quam beatae rerum inventore consectetur,
45
+ neque doloribus, cupiditate numquam dignissimos laborum fugiat deleniti?
46
+ Eum quasi quidem quibusdam.
47
+ </MuiTypography>
48
+ <MuiTypography variant="body2" gutterBottom {...props}>
49
+ body2. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quos
50
+ blanditiis tenetur unde suscipit, quam beatae rerum inventore consectetur,
51
+ neque doloribus, cupiditate numquam dignissimos laborum fugiat deleniti?
52
+ Eum quasi quidem quibusdam.
53
+ </MuiTypography>
54
+ <MuiTypography
55
+ variant="button"
56
+ gutterBottom
57
+ sx={{ display: "block" }}
58
+ {...props}
59
+ >
60
+ button text
61
+ </MuiTypography>
62
+ <MuiTypography
63
+ variant="caption"
64
+ gutterBottom
65
+ sx={{ display: "block" }}
66
+ {...props}
67
+ >
68
+ caption text
69
+ </MuiTypography>
70
+ <MuiTypography
71
+ variant="overline"
72
+ gutterBottom
73
+ sx={{ display: "block" }}
74
+ {...props}
75
+ >
76
+ overline text
77
+ </MuiTypography>
78
+ </Box>
79
+ );
@@ -0,0 +1,55 @@
1
+ import { Link } from "@mui/material";
2
+ import { StoryFn, Meta } from "@storybook/react";
3
+
4
+ import { BMWarning } from "../src";
5
+
6
+ const meta: Meta<typeof BMWarning> = {
7
+ title: "InReview/BMWarning",
8
+ component: BMWarning,
9
+ tags: ["autodocs"],
10
+ parameters: {
11
+ layout: "centered",
12
+ docs: {
13
+ description: {
14
+ component:
15
+ "BMWarning is a wrapper that highlights important messages using a warning chip followed by contextual content. You can pass links, formatted text, or other React elements as children.",
16
+ },
17
+ },
18
+ },
19
+ argTypes: {
20
+ chipText: {
21
+ description: "The text or element shown inside the chip.",
22
+ control: "text",
23
+ },
24
+ children: {
25
+ description: "The message or content displayed next to the chip.",
26
+ control: "text",
27
+ },
28
+ },
29
+ };
30
+
31
+ export default meta;
32
+
33
+ export const Default: StoryFn<typeof BMWarning> = (args) => (
34
+ <BMWarning {...args} />
35
+ );
36
+
37
+ Default.args = {
38
+ chipText: "Warning",
39
+ children: (
40
+ <>
41
+ This is a warning message.{" "}
42
+ <Link href="#" underline="hover">
43
+ Learn more
44
+ </Link>
45
+ </>
46
+ ),
47
+ };
48
+
49
+ Default.parameters = {
50
+ docs: {
51
+ description: {
52
+ story: "A typical warning component with a chip and an external link.",
53
+ },
54
+ },
55
+ };
@@ -0,0 +1,47 @@
1
+ import { Meta, StoryObj } from "@storybook/react";
2
+
3
+ import { GenericFailure } from "../src";
4
+
5
+ const meta: Meta<typeof GenericFailure> = {
6
+ title: "InReview/GenericFailure",
7
+ component: GenericFailure,
8
+ tags: ["autodocs"],
9
+ argTypes: {
10
+ text: {
11
+ control: "text",
12
+ description: "Text to display inside the alert",
13
+ defaultValue: "Something went wrong. Please try again later.",
14
+ },
15
+ sx: {
16
+ control: false,
17
+ description: "MUI sx prop to customize styles",
18
+ },
19
+ },
20
+ };
21
+
22
+ export default meta;
23
+
24
+ type Story = StoryObj<typeof GenericFailure>;
25
+
26
+ export const Default: Story = {
27
+ args: {
28
+ text: "Something went wrong. Please try again later.",
29
+ },
30
+ };
31
+
32
+ export const CustomText: Story = {
33
+ args: {
34
+ text: "We were unable to process your request due to a server error.",
35
+ },
36
+ };
37
+
38
+ export const WithCustomStyles: Story = {
39
+ args: {
40
+ text: "This alert has custom styling.",
41
+ sx: {
42
+ backgroundColor: "#f9f9f9",
43
+ border: "1px solid red",
44
+ borderRadius: 2,
45
+ },
46
+ },
47
+ };
@@ -0,0 +1,19 @@
1
+ import type { Meta, StoryFn } from "@storybook/react";
2
+
3
+ import { NoAccess, NoAccessProps } from "../src";
4
+
5
+ const meta: Meta<typeof NoAccess> = {
6
+ title: "InReview/NoAccess",
7
+ component: NoAccess,
8
+ tags: ["autodocs"],
9
+ };
10
+
11
+ export default meta;
12
+
13
+ export const Default: StoryFn<NoAccessProps> = (args) => <NoAccess {...args} />;
14
+
15
+ Default.args = {
16
+ title: "You don't have permission to view this section",
17
+ subtitle:
18
+ "If you think you should be able to view this section contact your administrator",
19
+ };