@coveord/plasma-mantine 57.2.0 → 58.0.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.
Files changed (250) hide show
  1. package/.turbo/turbo-build.log +4 -4
  2. package/.turbo/turbo-test.log +106 -104
  3. package/dist/.tsbuildinfo +1 -1
  4. package/dist/cjs/components/ActionIcon/ActionIcon.d.ts +3 -3
  5. package/dist/cjs/components/Alert/Alert.d.ts +3 -3
  6. package/dist/cjs/components/Alert/Alert.js +4 -12
  7. package/dist/cjs/components/Alert/Alert.js.map +1 -1
  8. package/dist/cjs/components/Badge/Badge.d.ts +3 -3
  9. package/dist/cjs/components/BrowserPreview/BrowserPreview.d.ts +1 -1
  10. package/dist/cjs/components/BrowserPreview/BrowserPreview.d.ts.map +1 -1
  11. package/dist/cjs/components/BrowserPreview/BrowserPreview.js +1 -2
  12. package/dist/cjs/components/BrowserPreview/BrowserPreview.js.map +1 -1
  13. package/dist/cjs/components/Button/Button.d.ts +3 -3
  14. package/dist/cjs/components/ChildForm/ChildForm.d.ts +5 -4
  15. package/dist/cjs/components/ChildForm/ChildForm.d.ts.map +1 -1
  16. package/dist/cjs/components/ChildForm/ChildForm.js +4 -2
  17. package/dist/cjs/components/ChildForm/ChildForm.js.map +1 -1
  18. package/dist/cjs/components/Collection/Collection.d.ts +6 -6
  19. package/dist/cjs/components/Collection/CollectionAddButton.d.ts +1 -1
  20. package/dist/cjs/components/Collection/CollectionAddButton.d.ts.map +1 -1
  21. package/dist/cjs/components/Collection/CollectionContext.d.ts +1 -1
  22. package/dist/cjs/components/Collection/CollectionContext.d.ts.map +1 -1
  23. package/dist/cjs/components/Collection/layouts/CollectionLayouts.d.ts +5 -5
  24. package/dist/cjs/components/Collection/layouts/horizontal-layout/HorizontalLayout.d.ts +3 -3
  25. package/dist/cjs/components/Collection/layouts/horizontal-layout/HorizontalLayoutBody.d.ts +1 -1
  26. package/dist/cjs/components/Collection/layouts/horizontal-layout/HorizontalLayoutBody.d.ts.map +1 -1
  27. package/dist/cjs/components/Collection/layouts/horizontal-layout/HorizontalLayoutHeader.d.ts +1 -1
  28. package/dist/cjs/components/Collection/layouts/horizontal-layout/HorizontalLayoutHeader.d.ts.map +1 -1
  29. package/dist/cjs/components/Collection/layouts/shared/itemRenderer.d.ts +3 -3
  30. package/dist/cjs/components/Collection/layouts/vertical-layout/VerticalLayout.d.ts +2 -2
  31. package/dist/cjs/components/Collection/layouts/vertical-layout/VerticalLayoutBody.d.ts +1 -1
  32. package/dist/cjs/components/Collection/layouts/vertical-layout/VerticalLayoutBody.d.ts.map +1 -1
  33. package/dist/cjs/components/DateRangePicker/DateRangePickerInlineCalendar.d.ts +1 -1
  34. package/dist/cjs/components/DateRangePicker/DateRangePickerInlineCalendar.d.ts.map +1 -1
  35. package/dist/cjs/components/DateRangePicker/DateRangePickerPopoverCalendar.d.ts +1 -1
  36. package/dist/cjs/components/DateRangePicker/DateRangePickerPopoverCalendar.d.ts.map +1 -1
  37. package/dist/cjs/components/DateTimeRangePicker/DateTimeRangePicker.d.ts +1 -1
  38. package/dist/cjs/components/DateTimeRangePicker/DateTimeRangePicker.d.ts.map +1 -1
  39. package/dist/cjs/components/EllipsisText/EllipsisText.d.ts +3 -3
  40. package/dist/cjs/components/Header/Header.context.d.ts +1 -1
  41. package/dist/cjs/components/Header/Header.context.d.ts.map +1 -1
  42. package/dist/cjs/components/Header/Header.module.css +0 -5
  43. package/dist/cjs/components/Header/HeaderBreadcrumbs/HeaderBreadcrumbAnchor.d.ts +3 -3
  44. package/dist/cjs/components/Header/HeaderBreadcrumbs/HeaderBreadcrumbText.d.ts +3 -3
  45. package/dist/cjs/components/Header/HeaderDocAnchor/HeaderDocAnchor.js +2 -4
  46. package/dist/cjs/components/Header/HeaderDocAnchor/HeaderDocAnchor.js.map +1 -1
  47. package/dist/cjs/components/InfoToken/InfoToken.d.ts +26 -82
  48. package/dist/cjs/components/InfoToken/InfoToken.d.ts.map +1 -1
  49. package/dist/cjs/components/InfoToken/InfoToken.js +62 -55
  50. package/dist/cjs/components/InfoToken/InfoToken.js.map +1 -1
  51. package/dist/cjs/components/InfoToken/InfoToken.module.css +11 -3
  52. package/dist/cjs/components/InlineConfirm/InlineConfirmTarget.d.ts +3 -3
  53. package/dist/cjs/components/Input/Input.d.ts +14 -1
  54. package/dist/cjs/components/Input/Input.d.ts.map +1 -1
  55. package/dist/cjs/components/Input/Input.js +17 -5
  56. package/dist/cjs/components/Input/Input.js.map +1 -1
  57. package/dist/cjs/components/Input/InputLabelInfo.d.ts +17 -0
  58. package/dist/cjs/components/Input/InputLabelInfo.d.ts.map +1 -0
  59. package/dist/cjs/components/Input/InputLabelInfo.js +58 -0
  60. package/dist/cjs/components/Input/InputLabelInfo.js.map +1 -0
  61. package/dist/cjs/components/Input/InputLabelInfo.module.css +5 -0
  62. package/dist/cjs/components/Menu/Menu.d.ts +1 -1
  63. package/dist/cjs/components/Modal/Modal.js +1 -1
  64. package/dist/cjs/components/Modal/Modal.js.map +1 -1
  65. package/dist/cjs/components/Modal/ModalFooter.js +2 -0
  66. package/dist/cjs/components/Modal/ModalFooter.js.map +1 -1
  67. package/dist/cjs/components/Modal/ModalFooter.module.css +2 -2
  68. package/dist/cjs/components/Prompt/Prompt.context.d.ts +1 -1
  69. package/dist/cjs/components/Prompt/Prompt.context.d.ts.map +1 -1
  70. package/dist/cjs/components/Prompt/Prompt.d.ts +33 -33
  71. package/dist/cjs/components/Prompt/Prompt.d.ts.map +1 -1
  72. package/dist/cjs/components/Prompt/Prompt.js +38 -18
  73. package/dist/cjs/components/Prompt/Prompt.js.map +1 -1
  74. package/dist/cjs/components/Prompt/Prompt.module.css +0 -17
  75. package/dist/cjs/components/Prompt/PromptCancelButton.d.ts.map +1 -1
  76. package/dist/cjs/components/Prompt/PromptCancelButton.js +1 -0
  77. package/dist/cjs/components/Prompt/PromptCancelButton.js.map +1 -1
  78. package/dist/cjs/components/Prompt/PromptConfirmButton.d.ts.map +1 -1
  79. package/dist/cjs/components/Prompt/PromptConfirmButton.js +2 -1
  80. package/dist/cjs/components/Prompt/PromptConfirmButton.js.map +1 -1
  81. package/dist/cjs/components/StickyFooter/StickyFooter.js +1 -1
  82. package/dist/cjs/components/StickyFooter/StickyFooter.js.map +1 -1
  83. package/dist/cjs/components/Table/Table.d.ts +4 -4
  84. package/dist/cjs/components/Table/layouts/TableLayoutControl.d.ts +1 -1
  85. package/dist/cjs/components/Table/layouts/TableLayoutControl.d.ts.map +1 -1
  86. package/dist/cjs/components/Table/layouts/row-layout/RowLayoutBody.d.ts +1 -1
  87. package/dist/cjs/components/Table/layouts/row-layout/RowLayoutContext.d.ts +1 -1
  88. package/dist/cjs/components/Table/layouts/row-layout/RowLayoutContext.d.ts.map +1 -1
  89. package/dist/cjs/components/Table/layouts/row-layout/RowLayoutHeader.d.ts +1 -1
  90. package/dist/cjs/components/Table/table-actions/TableActionItem.d.ts +3 -3
  91. package/dist/cjs/components/Table/table-actions/TableActionsList.d.ts +2 -2
  92. package/dist/cjs/components/Table/table-header/Th.d.ts +1 -1
  93. package/dist/cjs/index.d.ts +1 -1
  94. package/dist/cjs/index.d.ts.map +1 -1
  95. package/dist/cjs/index.js +7 -1
  96. package/dist/cjs/index.js.map +1 -1
  97. package/dist/cjs/styles/Breadcrumbs.module.css +0 -4
  98. package/dist/cjs/styles/Checkbox.module.css +0 -1
  99. package/dist/cjs/styles/InputWrapper.module.css +0 -4
  100. package/dist/cjs/styles/NavLink.module.css +0 -2
  101. package/dist/cjs/styles/Radio.module.css +0 -1
  102. package/dist/cjs/styles/RadioCard.module.css +0 -1
  103. package/dist/cjs/styles/Select.module.css +0 -2
  104. package/dist/cjs/styles/Tabs.module.css +2 -2
  105. package/dist/cjs/theme/Theme.js +3 -5
  106. package/dist/cjs/theme/Theme.js.map +1 -1
  107. package/dist/cjs/theme/plasmaCSSVariablesResolver.d.ts.map +1 -1
  108. package/dist/cjs/theme/plasmaCSSVariablesResolver.js +3 -6
  109. package/dist/cjs/theme/plasmaCSSVariablesResolver.js.map +1 -1
  110. package/dist/esm/components/ActionIcon/ActionIcon.d.ts +3 -3
  111. package/dist/esm/components/Alert/Alert.d.ts +3 -3
  112. package/dist/esm/components/Alert/Alert.js +4 -12
  113. package/dist/esm/components/Alert/Alert.js.map +1 -1
  114. package/dist/esm/components/Badge/Badge.d.ts +3 -3
  115. package/dist/esm/components/BrowserPreview/BrowserPreview.js +1 -2
  116. package/dist/esm/components/BrowserPreview/BrowserPreview.js.map +1 -1
  117. package/dist/esm/components/Button/Button.d.ts +3 -3
  118. package/dist/esm/components/ChildForm/ChildForm.d.ts +5 -4
  119. package/dist/esm/components/ChildForm/ChildForm.d.ts.map +1 -1
  120. package/dist/esm/components/ChildForm/ChildForm.js +4 -2
  121. package/dist/esm/components/ChildForm/ChildForm.js.map +1 -1
  122. package/dist/esm/components/EllipsisText/EllipsisText.d.ts +3 -3
  123. package/dist/esm/components/Header/Header.module.css +0 -5
  124. package/dist/esm/components/Header/HeaderBreadcrumbs/HeaderBreadcrumbAnchor.d.ts +3 -3
  125. package/dist/esm/components/Header/HeaderBreadcrumbs/HeaderBreadcrumbText.d.ts +3 -3
  126. package/dist/esm/components/Header/HeaderDocAnchor/HeaderDocAnchor.js +2 -4
  127. package/dist/esm/components/Header/HeaderDocAnchor/HeaderDocAnchor.js.map +1 -1
  128. package/dist/esm/components/InfoToken/InfoToken.d.ts +26 -82
  129. package/dist/esm/components/InfoToken/InfoToken.d.ts.map +1 -1
  130. package/dist/esm/components/InfoToken/InfoToken.js +61 -57
  131. package/dist/esm/components/InfoToken/InfoToken.js.map +1 -1
  132. package/dist/esm/components/InfoToken/InfoToken.module.css +11 -3
  133. package/dist/esm/components/InlineConfirm/InlineConfirmTarget.d.ts +3 -3
  134. package/dist/esm/components/Input/Input.d.ts +14 -1
  135. package/dist/esm/components/Input/Input.d.ts.map +1 -1
  136. package/dist/esm/components/Input/Input.js +7 -2
  137. package/dist/esm/components/Input/Input.js.map +1 -1
  138. package/dist/esm/components/Input/InputLabelInfo.d.ts +17 -0
  139. package/dist/esm/components/Input/InputLabelInfo.d.ts.map +1 -0
  140. package/dist/esm/components/Input/InputLabelInfo.js +35 -0
  141. package/dist/esm/components/Input/InputLabelInfo.js.map +1 -0
  142. package/dist/esm/components/Input/InputLabelInfo.module.css +5 -0
  143. package/dist/esm/components/Modal/Modal.js +1 -1
  144. package/dist/esm/components/Modal/Modal.js.map +1 -1
  145. package/dist/esm/components/Modal/ModalFooter.js +2 -0
  146. package/dist/esm/components/Modal/ModalFooter.js.map +1 -1
  147. package/dist/esm/components/Modal/ModalFooter.module.css +2 -2
  148. package/dist/esm/components/Prompt/Prompt.d.ts +33 -33
  149. package/dist/esm/components/Prompt/Prompt.d.ts.map +1 -1
  150. package/dist/esm/components/Prompt/Prompt.js +38 -19
  151. package/dist/esm/components/Prompt/Prompt.js.map +1 -1
  152. package/dist/esm/components/Prompt/Prompt.module.css +0 -17
  153. package/dist/esm/components/Prompt/PromptCancelButton.d.ts.map +1 -1
  154. package/dist/esm/components/Prompt/PromptCancelButton.js +1 -0
  155. package/dist/esm/components/Prompt/PromptCancelButton.js.map +1 -1
  156. package/dist/esm/components/Prompt/PromptConfirmButton.d.ts.map +1 -1
  157. package/dist/esm/components/Prompt/PromptConfirmButton.js +2 -1
  158. package/dist/esm/components/Prompt/PromptConfirmButton.js.map +1 -1
  159. package/dist/esm/components/StickyFooter/StickyFooter.js +1 -1
  160. package/dist/esm/components/StickyFooter/StickyFooter.js.map +1 -1
  161. package/dist/esm/components/Table/Table.d.ts +3 -3
  162. package/dist/esm/components/Table/table-actions/TableActionItem.d.ts +3 -3
  163. package/dist/esm/index.d.ts +1 -1
  164. package/dist/esm/index.d.ts.map +1 -1
  165. package/dist/esm/index.js +1 -1
  166. package/dist/esm/index.js.map +1 -1
  167. package/dist/esm/styles/Breadcrumbs.module.css +0 -4
  168. package/dist/esm/styles/Checkbox.module.css +0 -1
  169. package/dist/esm/styles/InputWrapper.module.css +0 -4
  170. package/dist/esm/styles/NavLink.module.css +0 -2
  171. package/dist/esm/styles/Radio.module.css +0 -1
  172. package/dist/esm/styles/RadioCard.module.css +0 -1
  173. package/dist/esm/styles/Select.module.css +0 -2
  174. package/dist/esm/styles/Tabs.module.css +2 -2
  175. package/dist/esm/theme/Theme.js +3 -5
  176. package/dist/esm/theme/Theme.js.map +1 -1
  177. package/dist/esm/theme/plasmaCSSVariablesResolver.d.ts.map +1 -1
  178. package/dist/esm/theme/plasmaCSSVariablesResolver.js +3 -6
  179. package/dist/esm/theme/plasmaCSSVariablesResolver.js.map +1 -1
  180. package/package.json +23 -23
  181. package/src/components/Alert/Alert.tsx +4 -4
  182. package/src/components/BrowserPreview/BrowserPreview.tsx +1 -1
  183. package/src/components/ChildForm/ChildForm.tsx +10 -3
  184. package/src/components/ChildForm/__tests__/ChildForm.spec.tsx +29 -4
  185. package/src/components/Header/Header.module.css +0 -5
  186. package/src/components/Header/HeaderDocAnchor/HeaderDocAnchor.tsx +2 -2
  187. package/src/components/InfoToken/InfoToken.module.css +11 -3
  188. package/src/components/InfoToken/InfoToken.tsx +83 -67
  189. package/src/components/Input/Input.ts +24 -2
  190. package/src/components/Input/InputLabelInfo.module.css +5 -0
  191. package/src/components/Input/InputLabelInfo.tsx +43 -0
  192. package/src/components/Input/__tests__/Input.spec.tsx +33 -0
  193. package/src/components/Modal/Modal.tsx +1 -1
  194. package/src/components/Modal/ModalFooter.module.css +2 -2
  195. package/src/components/Modal/ModalFooter.tsx +3 -1
  196. package/src/components/Prompt/Prompt.module.css +0 -17
  197. package/src/components/Prompt/Prompt.tsx +48 -34
  198. package/src/components/Prompt/PromptCancelButton.tsx +3 -1
  199. package/src/components/Prompt/PromptConfirmButton.tsx +4 -2
  200. package/src/components/Prompt/__tests__/Prompt.spec.tsx +18 -16
  201. package/src/components/StickyFooter/StickyFooter.tsx +1 -1
  202. package/src/components/Switch/__tests__/Switch.spec.tsx +27 -0
  203. package/src/index.ts +9 -1
  204. package/src/styles/Breadcrumbs.module.css +0 -4
  205. package/src/styles/Checkbox.module.css +0 -1
  206. package/src/styles/InputWrapper.module.css +0 -4
  207. package/src/styles/NavLink.module.css +0 -2
  208. package/src/styles/Radio.module.css +0 -1
  209. package/src/styles/RadioCard.module.css +0 -1
  210. package/src/styles/Select.module.css +0 -2
  211. package/src/styles/Tabs.module.css +2 -2
  212. package/src/theme/Theme.tsx +3 -3
  213. package/src/theme/__tests__/plasmaCSSVariablesResolver.spec.ts +3 -6
  214. package/src/theme/plasmaCSSVariablesResolver.ts +3 -6
  215. package/dist/cjs/components/Prompt/icons/CriticalIcon.d.ts +0 -3
  216. package/dist/cjs/components/Prompt/icons/CriticalIcon.d.ts.map +0 -1
  217. package/dist/cjs/components/Prompt/icons/CriticalIcon.js +0 -29
  218. package/dist/cjs/components/Prompt/icons/CriticalIcon.js.map +0 -1
  219. package/dist/cjs/components/Prompt/icons/InfoIcon.d.ts +0 -3
  220. package/dist/cjs/components/Prompt/icons/InfoIcon.d.ts.map +0 -1
  221. package/dist/cjs/components/Prompt/icons/InfoIcon.js +0 -29
  222. package/dist/cjs/components/Prompt/icons/InfoIcon.js.map +0 -1
  223. package/dist/cjs/components/Prompt/icons/SuccessIcon.d.ts +0 -3
  224. package/dist/cjs/components/Prompt/icons/SuccessIcon.d.ts.map +0 -1
  225. package/dist/cjs/components/Prompt/icons/SuccessIcon.js +0 -29
  226. package/dist/cjs/components/Prompt/icons/SuccessIcon.js.map +0 -1
  227. package/dist/cjs/components/Prompt/icons/WarningIcon.d.ts +0 -3
  228. package/dist/cjs/components/Prompt/icons/WarningIcon.d.ts.map +0 -1
  229. package/dist/cjs/components/Prompt/icons/WarningIcon.js +0 -29
  230. package/dist/cjs/components/Prompt/icons/WarningIcon.js.map +0 -1
  231. package/dist/esm/components/Prompt/icons/CriticalIcon.d.ts +0 -3
  232. package/dist/esm/components/Prompt/icons/CriticalIcon.d.ts.map +0 -1
  233. package/dist/esm/components/Prompt/icons/CriticalIcon.js +0 -17
  234. package/dist/esm/components/Prompt/icons/CriticalIcon.js.map +0 -1
  235. package/dist/esm/components/Prompt/icons/InfoIcon.d.ts +0 -3
  236. package/dist/esm/components/Prompt/icons/InfoIcon.d.ts.map +0 -1
  237. package/dist/esm/components/Prompt/icons/InfoIcon.js +0 -17
  238. package/dist/esm/components/Prompt/icons/InfoIcon.js.map +0 -1
  239. package/dist/esm/components/Prompt/icons/SuccessIcon.d.ts +0 -3
  240. package/dist/esm/components/Prompt/icons/SuccessIcon.d.ts.map +0 -1
  241. package/dist/esm/components/Prompt/icons/SuccessIcon.js +0 -17
  242. package/dist/esm/components/Prompt/icons/SuccessIcon.js.map +0 -1
  243. package/dist/esm/components/Prompt/icons/WarningIcon.d.ts +0 -3
  244. package/dist/esm/components/Prompt/icons/WarningIcon.d.ts.map +0 -1
  245. package/dist/esm/components/Prompt/icons/WarningIcon.js +0 -17
  246. package/dist/esm/components/Prompt/icons/WarningIcon.js.map +0 -1
  247. package/src/components/Prompt/icons/CriticalIcon.tsx +0 -18
  248. package/src/components/Prompt/icons/InfoIcon.tsx +0 -18
  249. package/src/components/Prompt/icons/SuccessIcon.tsx +0 -17
  250. package/src/components/Prompt/icons/WarningIcon.tsx +0 -18
@@ -1,83 +1,106 @@
1
1
  import {
2
- IconAlertSquareFilled,
3
- IconAlertTriangleFilled,
4
- IconBulbFilled,
2
+ IconAlertSquare,
3
+ IconAlertTriangle,
4
+ IconBulb,
5
+ IconCheck,
5
6
  IconHelpCircle,
6
7
  IconInfoCircle,
7
- IconInfoCircleFilled,
8
8
  TablerIcon,
9
9
  } from '@coveord/plasma-react-icons';
10
10
  import {
11
11
  Box,
12
12
  BoxProps,
13
+ createPolymorphicComponent,
13
14
  createVarsResolver,
14
15
  Factory,
15
- MantineSize,
16
+ PolymorphicComponentProps,
16
17
  polymorphicFactory,
17
18
  StylesApiProps,
18
19
  useProps,
19
20
  useStyles,
20
21
  } from '@mantine/core';
22
+ import {forwardRef, FunctionComponent, ReactElement} from 'react';
21
23
  import classes from './InfoToken.module.css';
22
24
 
23
25
  export type InfoTokenFactory = Factory<{
24
- props: InfoTokenProps;
26
+ props: InfoTokenInternalProps;
25
27
  defaultRef: HTMLDivElement;
26
28
  defaultComponent: 'div';
27
29
  stylesNames: InfoTokenComponentStylesNames;
28
30
  vars: InfoTokenCssVariables;
29
31
  variant: InfoTokenVariant;
30
- staticComponents: {
31
- Information: typeof TokenInformation;
32
- InformationOutline: typeof TokenInformationOutline;
33
- Advice: typeof TokenAdvice;
34
- Warning: typeof TokenWarning;
35
- Error: typeof TokenError;
36
- Question: typeof TokenQuestion;
37
- };
38
32
  }>;
39
33
  export type InfoTokenComponentStylesNames = 'root';
40
- export type InfoTokenVariant = 'information' | 'information-outline' | 'advice' | 'warning' | 'error' | 'question';
34
+ export type InfoTokenType = 'information' | 'advice' | 'warning' | 'error' | 'question' | 'success';
35
+ export type InfoTokenVariant = 'outline' | 'light';
36
+ export type InfoTokenSizes = 'xs' | 'sm' | 'md' | 'lg';
41
37
  export type InfoTokenCssVariables = {
42
- root: '--info-token-color';
38
+ root: '--it-color' | '--it-bg';
43
39
  };
44
40
 
45
- export interface InfoTokenProps extends BoxProps, StylesApiProps<InfoTokenFactory> {
41
+ interface InfoTokenInternalProps extends BoxProps, StylesApiProps<InfoTokenFactory> {
46
42
  /**
47
43
  * The variant of the token.
48
44
  *
49
- * @default 'information'
45
+ * @default 'outline'
50
46
  */
51
47
  variant?: InfoTokenVariant;
48
+ /**
49
+ * The semantic type of the token
50
+ *
51
+ * @default 'information'
52
+ */
53
+ type?: InfoTokenType;
52
54
  /**
53
55
  * The size of the info token.
54
56
  *
55
- * @default 'sm'
57
+ * @default 'xs'
56
58
  */
57
- size?: MantineSize;
59
+ size?: InfoTokenSizes;
58
60
  }
59
61
 
60
- const defaultProps: Partial<InfoTokenProps> = {variant: 'information', size: 'xs'};
62
+ export type InfoTokenProps = Omit<InfoTokenInternalProps, 'type'>;
61
63
 
62
- const colorResolver = (variant: InfoTokenVariant): string => {
63
- switch (variant) {
64
+ type InfoTokenCompoundComponent = (<C = 'div'>(props: PolymorphicComponentProps<C, InfoTokenProps>) => ReactElement) &
65
+ Omit<FunctionComponent<PolymorphicComponentProps<any, InfoTokenProps>>, never>;
66
+
67
+ const defaultProps: Partial<InfoTokenInternalProps> = {variant: 'outline', type: 'information', size: 'xs'};
68
+
69
+ const colorResolver = (type: InfoTokenType): string => {
70
+ switch (type) {
64
71
  case 'error':
65
72
  return 'var(--mantine-color-error)';
66
73
  case 'advice':
67
74
  case 'question':
68
75
  return 'var(--coveo-color-text-primary)';
69
76
  case 'warning':
70
- return 'var(--mantine-color-warning-filled)';
77
+ return 'var(--mantine-color-yellow-text)';
78
+ case 'success':
79
+ return 'var(--mantine-color-green-text)';
71
80
  case 'information':
72
81
  default:
73
- return 'var(--mantine-color-gray-3)';
82
+ return 'var(--mantine-color-gray-text)';
74
83
  }
75
84
  };
76
85
 
77
- const sizeResolver = (size: MantineSize): number => {
78
- if (typeof size === 'number') {
79
- return size;
86
+ const bgColorResolver = (type: InfoTokenType): string => {
87
+ switch (type) {
88
+ case 'error':
89
+ return 'var(--mantine-color-red-light)';
90
+ case 'advice':
91
+ case 'question':
92
+ return 'var(--mantine-primary-color-light)';
93
+ case 'warning':
94
+ return 'var(--mantine-color-yellow-light)';
95
+ case 'success':
96
+ return 'var(--mantine-color-green-light)';
97
+ case 'information':
98
+ default:
99
+ return 'var(--mantine-color-gray-light)';
80
100
  }
101
+ };
102
+
103
+ const sizeResolver = (size: InfoTokenSizes): number => {
81
104
  switch (size) {
82
105
  case 'sm':
83
106
  return 20;
@@ -85,44 +108,43 @@ const sizeResolver = (size: MantineSize): number => {
85
108
  return 24;
86
109
  case 'lg':
87
110
  return 32;
88
- case 'xl':
89
- return 40;
90
111
  case 'xs':
91
112
  default:
92
113
  return 16;
93
114
  }
94
115
  };
95
116
 
96
- const iconResolver = (variant: InfoTokenVariant): TablerIcon => {
97
- switch (variant) {
117
+ const iconResolver = (type: InfoTokenType): TablerIcon => {
118
+ switch (type) {
98
119
  case 'error':
99
- return IconAlertSquareFilled;
100
- case 'information':
101
- return IconInfoCircleFilled;
102
- case 'information-outline':
103
- return IconInfoCircle;
120
+ return IconAlertSquare;
104
121
  case 'question':
105
122
  return IconHelpCircle;
106
123
  case 'warning':
107
- return IconAlertTriangleFilled;
124
+ return IconAlertTriangle;
108
125
  case 'advice':
126
+ return IconBulb;
127
+ case 'success':
128
+ return IconCheck;
109
129
  default:
110
- return IconBulbFilled;
130
+ return IconInfoCircle;
111
131
  }
112
132
  };
113
133
 
114
- const varsResolver = createVarsResolver<InfoTokenFactory>((_theme, {variant}) => {
115
- const color = colorResolver(variant);
134
+ const varsResolver = createVarsResolver<InfoTokenFactory>((_theme, {type}) => {
135
+ const color = colorResolver(type);
136
+ const bgColor = bgColorResolver(type);
116
137
  return {
117
138
  root: {
118
- '--info-token-color': color,
139
+ '--it-color': color,
140
+ '--it-bg': bgColor,
119
141
  },
120
142
  };
121
143
  });
122
144
 
123
- export const InfoToken = polymorphicFactory<InfoTokenFactory>((_props, ref) => {
145
+ const _InfoToken = polymorphicFactory<InfoTokenFactory>((_props, ref) => {
124
146
  const props = useProps('InfoToken', defaultProps, _props);
125
- const {variant, vars, className, style, unstyled, styles, classNames, size, ...others} = props;
147
+ const {variant, type, vars, className, style, unstyled, styles, classNames, size, ...others} = props;
126
148
  const getStyles = useStyles<InfoTokenFactory>({
127
149
  name: 'InfoToken',
128
150
  classes,
@@ -134,13 +156,13 @@ export const InfoToken = polymorphicFactory<InfoTokenFactory>((_props, ref) => {
134
156
  vars,
135
157
  varsResolver,
136
158
  });
137
- const IconComponent = iconResolver(variant);
159
+ const IconComponent = iconResolver(type);
138
160
  return (
139
161
  <Box
140
162
  ref={ref}
141
163
  variant={variant}
142
164
  role="img"
143
- aria-label={variant}
165
+ aria-label={type}
144
166
  size={size}
145
167
  {...getStyles('root', {
146
168
  className,
@@ -155,25 +177,19 @@ export const InfoToken = polymorphicFactory<InfoTokenFactory>((_props, ref) => {
155
177
  );
156
178
  });
157
179
 
158
- const TokenInformation = InfoToken.withProps({
159
- variant: 'information',
160
- });
161
- (TokenInformation as typeof InfoToken).displayName = 'InfoToken.Information';
162
- const TokenInformationOutline = InfoToken.withProps({
163
- variant: 'information-outline',
164
- });
165
- const TokenAdvice = InfoToken.withProps({variant: 'advice'});
166
- (TokenAdvice as typeof InfoToken).displayName = 'InfoToken.Advice';
167
- const TokenWarning = InfoToken.withProps({variant: 'warning'});
168
- (TokenWarning as typeof InfoToken).displayName = 'InfoToken.Warning';
169
- const TokenError = InfoToken.withProps({variant: 'error'});
170
- (TokenError as typeof InfoToken).displayName = 'InfoToken.Error';
171
- const TokenQuestion = InfoToken.withProps({variant: 'question'});
172
- (TokenQuestion as typeof InfoToken).displayName = 'InfoToken.Question';
180
+ const createInfoTokenCompound = (type: InfoTokenType, displayName: string): InfoTokenCompoundComponent => {
181
+ const Component: InfoTokenCompoundComponent = createPolymorphicComponent<'div', InfoTokenProps>(
182
+ forwardRef<any, InfoTokenProps>((props, ref) => <_InfoToken ref={ref} {...props} type={type} />),
183
+ );
184
+ Component.displayName = displayName;
185
+ return Component;
186
+ };
173
187
 
174
- InfoToken.Information = TokenInformation;
175
- InfoToken.InformationOutline = TokenInformationOutline;
176
- InfoToken.Advice = TokenAdvice;
177
- InfoToken.Warning = TokenWarning;
178
- InfoToken.Error = TokenError;
179
- InfoToken.Question = TokenQuestion;
188
+ export const InfoToken = {
189
+ Information: createInfoTokenCompound('information', 'InfoToken.Information'),
190
+ Advice: createInfoTokenCompound('advice', 'InfoToken.Advice'),
191
+ Warning: createInfoTokenCompound('warning', 'InfoToken.Warning'),
192
+ Error: createInfoTokenCompound('error', 'InfoToken.Error'),
193
+ Question: createInfoTokenCompound('question', 'InfoToken.Question'),
194
+ Success: createInfoTokenCompound('success', 'InfoToken.Success'),
195
+ } as const;
@@ -1,5 +1,27 @@
1
- import {Input} from '@mantine/core';
1
+ import {Input as MantineInput, type InputFactory as MantineInputFactory, type InputProps} from '@mantine/core';
2
+ import {
3
+ InputLabelInfo,
4
+ type InputLabelInfoFactory,
5
+ type InputLabelInfoProps,
6
+ type InputLabelInfoStylesNames,
7
+ } from './InputLabelInfo.js';
8
+
9
+ type PlasmaInputFactory = Omit<MantineInputFactory, 'staticComponents'> & {
10
+ staticComponents: MantineInputFactory['staticComponents'] & {
11
+ LabelInfo: typeof InputLabelInfo;
12
+ };
13
+ };
14
+
15
+ const Input = MantineInput as typeof MantineInput & {
16
+ LabelInfo: typeof InputLabelInfo;
17
+ };
2
18
 
3
19
  Input.displayName = 'Input';
20
+ Input.LabelInfo = InputLabelInfo;
21
+
22
+ InputLabelInfo.displayName = 'Input.LabelInfo';
4
23
 
5
- export {Input, type InputFactory, type InputProps} from '@mantine/core';
24
+ export {Input};
25
+ export type InputFactory = PlasmaInputFactory;
26
+ export type {InputProps, InputLabelInfoFactory, InputLabelInfoProps, InputLabelInfoStylesNames};
27
+ export {InputLabelInfo};
@@ -0,0 +1,5 @@
1
+ .labelInfo {
2
+ position: relative; /* Required to make it work within a Switch label */
3
+ margin-left: var(--mantine-spacing-xxs);
4
+ vertical-align: text-bottom;
5
+ }
@@ -0,0 +1,43 @@
1
+ import {factory, StylesApiProps, Tooltip, useProps, useStyles, type Factory, type TooltipProps} from '@mantine/core';
2
+ import {type ReactNode} from 'react';
3
+ import {InfoToken} from '../InfoToken/InfoToken.js';
4
+ import classes from './InputLabelInfo.module.css';
5
+
6
+ export type InputLabelInfoStylesNames = 'labelInfo';
7
+
8
+ export interface InputLabelInfoProps
9
+ extends
10
+ Omit<TooltipProps, 'label' | 'classNames' | 'attributes' | 'styles' | 'vars'>,
11
+ StylesApiProps<InputLabelInfoFactory> {
12
+ children: ReactNode;
13
+ }
14
+
15
+ export type InputLabelInfoFactory = Factory<{
16
+ props: InputLabelInfoProps;
17
+ ref: HTMLSpanElement;
18
+ stylesNames: InputLabelInfoStylesNames;
19
+ }>;
20
+
21
+ const defaultProps = {} satisfies Partial<InputLabelInfoProps>;
22
+
23
+ export const InputLabelInfo = factory<InputLabelInfoFactory>((_props, ref) => {
24
+ const props = useProps('InputLabelInfo', defaultProps, _props);
25
+ const {classNames, className, style, styles, unstyled, vars, children, attributes, ...others} = props;
26
+ const getStyles = useStyles<InputLabelInfoFactory>({
27
+ name: 'InputLabelInfo',
28
+ props,
29
+ style,
30
+ styles,
31
+ unstyled,
32
+ attributes,
33
+ className,
34
+ classes,
35
+ classNames,
36
+ vars,
37
+ });
38
+ return (
39
+ <Tooltip label={children} {...others}>
40
+ <InfoToken.Information component="span" {...getStyles('labelInfo', {className, style})} ref={ref} />
41
+ </Tooltip>
42
+ );
43
+ });
@@ -0,0 +1,33 @@
1
+ import {render, screen, userEvent} from '@test-utils';
2
+
3
+ import {Input, InputLabelInfo} from '../Input.js';
4
+
5
+ describe('Input', () => {
6
+ it('exposes InputLabelInfo as a compound component', () => {
7
+ expect(Input.LabelInfo).toBe(InputLabelInfo);
8
+ });
9
+
10
+ it('renders LabelInfo inside the label prop and shows its tooltip content on hover', async () => {
11
+ const user = userEvent.setup();
12
+ render(
13
+ <Input.Wrapper
14
+ label={
15
+ <>
16
+ <span>Field label</span>
17
+ <Input.LabelInfo>Helpful tooltip</Input.LabelInfo>
18
+ </>
19
+ }
20
+ >
21
+ <Input />
22
+ </Input.Wrapper>,
23
+ );
24
+
25
+ expect(screen.getByText('Field label')).toBeVisible();
26
+ const infoToken = screen.getByRole('img', {name: 'information'});
27
+ expect(infoToken).toBeVisible();
28
+
29
+ await user.hover(infoToken);
30
+
31
+ expect(await screen.findByRole('tooltip')).toHaveTextContent('Helpful tooltip');
32
+ });
33
+ });
@@ -40,7 +40,7 @@ const PlasmaModal = factory<PlasmaModalFactory>(({title, description, help, ...o
40
40
  return <MantineModal ref={ref} title={header} {...otherProps} />;
41
41
  });
42
42
 
43
- PlasmaModal.displayName = '@coveord/plasma-mantine/Modal';
43
+ PlasmaModal.displayName = 'Modal';
44
44
  PlasmaModal.Root = MantineModal.Root;
45
45
  PlasmaModal.Body = MantineModal.Body;
46
46
  PlasmaModal.Overlay = MantineModal.Overlay;
@@ -1,10 +1,10 @@
1
1
  :global(.mantine-Modal-body) {
2
2
  .root {
3
3
  margin: calc(-1 * var(--mb-padding));
4
- margin-top: 0;
4
+ margin-top: var(--mb-padding);
5
5
  }
6
6
  }
7
7
 
8
8
  .root {
9
- padding: var(--mb-padding, var(--mantine-spacing-lg, 32px));
9
+ padding: var(--mb-padding, var(--mantine-spacing-md, 24px));
10
10
  }
@@ -31,5 +31,7 @@ export const ModalFooter = factory<ModalFooterFactory>((props, ref) => {
31
31
  // if ref === 'function', this is a callback ref. Haven't found any solution for adjusting the height in this case
32
32
  }, [ref, props.h]);
33
33
 
34
- return <StickyFooter className={classes.root} ref={footerRef} {...props} />;
34
+ return <StickyFooter borderTop className={classes.root} ref={footerRef} {...props} />;
35
35
  });
36
+
37
+ ModalFooter.displayName = 'Modal.Footer';
@@ -1,20 +1,3 @@
1
- .root {
2
- --prompt-icon-size: 32px;
3
- }
4
-
5
- .body {
6
- padding-left: calc(var(--prompt-icon-size) + var(--mantine-spacing-sm) + var(--mb-padding));
7
- }
8
-
9
- .icon {
10
- width: var(--prompt-icon-size);
11
- height: var(--prompt-icon-size);
12
- }
13
-
14
1
  .header {
15
2
  gap: var(--mantine-spacing-sm);
16
3
  }
17
-
18
- .inner {
19
- color: var(--mantine-color-dimmed);
20
- }
@@ -9,18 +9,15 @@ import {
9
9
  useProps,
10
10
  useStyles,
11
11
  } from '@mantine/core';
12
- import {Children, ComponentType, ReactElement, ReactNode} from 'react';
12
+ import {Children, ComponentProps, ComponentType, forwardRef, FunctionComponent, ReactElement, ReactNode} from 'react';
13
+ import {InfoToken} from '../InfoToken/InfoToken.js';
13
14
  import {Modal} from '../Modal/Modal.js';
14
15
  import {PromptContextProvider} from './Prompt.context.js';
15
16
  import classes from './Prompt.module.css';
16
17
  import {PromptCancelButton, PromptCancelButtonStylesNamesVariant} from './PromptCancelButton.js';
17
18
  import {PromptConfirmButton, PromptConfirmButtonStylesNamesVariant} from './PromptConfirmButton.js';
18
- import CriticalIcon from './icons/CriticalIcon.js';
19
- import InfoIcon from './icons/InfoIcon.js';
20
- import SuccessIcon from './icons/SuccessIcon.js';
21
- import WarningIcon from './icons/WarningIcon.js';
22
19
 
23
- export type PromptVariant = 'success' | 'warning' | 'critical' | 'info';
20
+ export type PromptVariant = 'success' | 'warning' | 'critical' | 'information';
24
21
  export type PromptVars = {root: '--prompt-icon-size'};
25
22
  export type PromptStylesNames =
26
23
  | Exclude<ModalStylesNames, 'title'>
@@ -28,45 +25,39 @@ export type PromptStylesNames =
28
25
  | PromptCancelButtonStylesNamesVariant
29
26
  | PromptConfirmButtonStylesNamesVariant;
30
27
 
28
+ type PromptStylesApiProps = Omit<StylesApiProps<PromptFactory>, 'variant'>;
29
+
31
30
  export interface PromptProps
32
- extends StylesApiProps<PromptFactory>,
33
- Omit<ModalRootProps, 'classNames' | 'styles' | 'vars' | 'attributes'> {
34
- /**
35
- * Controls prompt appearance
36
- *
37
- * @default "info"
38
- */
39
- variant?: PromptVariant;
31
+ extends PromptStylesApiProps, Omit<ModalRootProps, 'classNames' | 'styles' | 'vars' | 'attributes' | 'variant'> {
40
32
  children: ReactNode;
41
33
  title: ReactNode;
42
34
  }
43
35
 
36
+ interface PromptInternalProps extends PromptProps {
37
+ variant?: PromptVariant;
38
+ }
39
+
44
40
  export type PromptFactory = Factory<{
45
- props: PromptProps;
41
+ props: PromptInternalProps;
46
42
  ref: HTMLDivElement;
47
43
  vars: PromptVars;
48
44
  variant: PromptVariant;
49
45
  stylesNames: PromptStylesNames;
50
- staticComponents: {
51
- CancelButton: typeof PromptCancelButton;
52
- ConfirmButton: typeof PromptConfirmButton;
53
- Footer: typeof PromptFooter;
54
- };
55
46
  }>;
56
47
 
57
- const PromptVariantIconsMapping: Record<PromptVariant, ComponentType> = {
58
- success: SuccessIcon,
59
- warning: WarningIcon,
60
- critical: CriticalIcon,
61
- info: InfoIcon,
48
+ const PromptVariantIconsMapping: Record<PromptVariant, typeof InfoToken.Information> = {
49
+ success: InfoToken.Success,
50
+ warning: InfoToken.Warning,
51
+ critical: InfoToken.Error,
52
+ information: InfoToken.Information,
62
53
  };
63
54
 
64
- const defaultProps: Partial<PromptProps> = {
65
- variant: 'info',
55
+ const defaultProps: Partial<PromptInternalProps> = {
56
+ variant: 'information',
66
57
  centered: true,
67
58
  };
68
59
 
69
- export const Prompt = factory<PromptFactory>((_props, ref) => {
60
+ const _Prompt = factory<PromptFactory>((_props, ref) => {
70
61
  const props = useProps('Prompt', defaultProps, _props);
71
62
  const {
72
63
  variant,
@@ -98,7 +89,7 @@ export const Prompt = factory<PromptFactory>((_props, ref) => {
98
89
  const otherChildren: ReactElement[] = [];
99
90
 
100
91
  Children.forEach(children, (child: ReactElement) => {
101
- (child.type === Prompt.Footer ? footers : otherChildren).push(child);
92
+ (child.type === PromptFooter ? footers : otherChildren).push(child);
102
93
  });
103
94
 
104
95
  const IconComponent = PromptVariantIconsMapping[variant];
@@ -109,7 +100,12 @@ export const Prompt = factory<PromptFactory>((_props, ref) => {
109
100
  <Modal.Overlay {...getStyles('overlay', stylesApiProps)} />
110
101
  <Modal.Content {...getStyles('content', stylesApiProps)}>
111
102
  <Modal.Header {...getStyles('header', stylesApiProps)}>
112
- <IconComponent />
103
+ <IconComponent
104
+ {...getStyles('icon', stylesApiProps)}
105
+ variant="light"
106
+ size="sm"
107
+ aria-label={variant}
108
+ />
113
109
  <Modal.Title>
114
110
  <Title order={3} component="div">
115
111
  {title}
@@ -126,9 +122,27 @@ export const Prompt = factory<PromptFactory>((_props, ref) => {
126
122
  </PromptContextProvider>
127
123
  );
128
124
  });
125
+ _Prompt.displayName = 'Prompt';
126
+
127
+ type PromptCompoundComponent = ((props: PromptProps) => ReactElement) & Omit<FunctionComponent<PromptProps>, never>;
129
128
 
130
- const PromptFooter = Modal.Footer.withProps({pt: 0});
129
+ const PromptFooter: ComponentType<ComponentProps<typeof Modal.Footer>> = (props) => <Modal.Footer {...props} />;
130
+ PromptFooter.displayName = 'Prompt.Footer';
131
+
132
+ const createPromptCompound = (variant: PromptVariant, displayName: string): PromptCompoundComponent => {
133
+ const Component = forwardRef<HTMLDivElement, PromptProps>((props, ref) => (
134
+ <_Prompt ref={ref} {...props} variant={variant} />
135
+ ));
136
+ Component.displayName = displayName;
137
+ return Component as PromptCompoundComponent;
138
+ };
131
139
 
132
- Prompt.CancelButton = PromptCancelButton;
133
- Prompt.ConfirmButton = PromptConfirmButton;
134
- Prompt.Footer = PromptFooter;
140
+ export const Prompt = {
141
+ Information: createPromptCompound('information', 'Prompt.Information'),
142
+ Success: createPromptCompound('success', 'Prompt.Success'),
143
+ Warning: createPromptCompound('warning', 'Prompt.Warning'),
144
+ Critical: createPromptCompound('critical', 'Prompt.Critical'),
145
+ CancelButton: PromptCancelButton,
146
+ ConfirmButton: PromptConfirmButton,
147
+ Footer: PromptFooter,
148
+ } as const;
@@ -5,7 +5,8 @@ import {usePromptContext} from './Prompt.context.js';
5
5
  export type PromptCancelButtonStylesNamesVariant = 'cancel';
6
6
 
7
7
  export interface PromptCancelButtonProps
8
- extends CompoundStylesApiProps<PromptCancelButtonFactory>,
8
+ extends
9
+ CompoundStylesApiProps<PromptCancelButtonFactory>,
9
10
  Omit<ButtonProps, 'primary' | 'classNames' | 'styles' | 'vars' | 'variant'> {}
10
11
 
11
12
  export type PromptCancelButtonFactory = Factory<{
@@ -24,3 +25,4 @@ export const PromptCancelButton = factory<PromptCancelButtonFactory>((_props, re
24
25
 
25
26
  return <Button.Tertiary ref={ref} {...others} {...getStyles('cancel', {style, styles, className, classNames})} />;
26
27
  });
28
+ PromptCancelButton.displayName = 'Prompt.CancelButton';
@@ -7,7 +7,8 @@ import {usePromptContext} from './Prompt.context.js';
7
7
  export type PromptConfirmButtonStylesNamesVariant = 'confirm';
8
8
 
9
9
  export interface PromptConfirmButtonProps
10
- extends CompoundStylesApiProps<PromptConfirmButtonFactory>,
10
+ extends
11
+ CompoundStylesApiProps<PromptConfirmButtonFactory>,
11
12
  Omit<ButtonProps, 'primary' | 'classNames' | 'styles' | 'vars' | 'variant'> {}
12
13
 
13
14
  export type PromptConfirmButtonFactory = Factory<{
@@ -24,7 +25,7 @@ const COMPONENT_BY_VARIANT: Record<
24
25
  ) => ReactElement<any, string | JSXElementConstructor<any>>
25
26
  > = {
26
27
  success: Button.Primary,
27
- info: Button.Primary,
28
+ information: Button.Primary,
28
29
  warning: Button.DestructivePrimary,
29
30
  critical: Button.DestructivePrimary,
30
31
  };
@@ -58,3 +59,4 @@ export const PromptConfirmButton = factory<PromptConfirmButtonFactory>((_props,
58
59
  />
59
60
  );
60
61
  });
62
+ PromptConfirmButton.displayName = 'Prompt.ConfirmButton';
@@ -1,13 +1,13 @@
1
1
  import {render, screen} from '@test-utils';
2
- import {Prompt, PromptVariant} from '../Prompt.js';
2
+ import {Prompt} from '../Prompt.js';
3
3
 
4
4
  describe('Prompt', () => {
5
5
  it('displays the title, body and close button', () => {
6
6
  render(
7
- <Prompt opened onClose={vi.fn()} title="title modal">
7
+ <Prompt.Information opened onClose={vi.fn()} title="title modal">
8
8
  content modal
9
9
  <Prompt.Footer>footer content</Prompt.Footer>
10
- </Prompt>,
10
+ </Prompt.Information>,
11
11
  );
12
12
  expect(screen.getByRole('dialog', {name: /title modal/i})).toBeInTheDocument();
13
13
  expect(screen.getByText(/content modal/i)).toBeInTheDocument();
@@ -19,24 +19,26 @@ describe('Prompt', () => {
19
19
  it('calls onClose when clicking on the close button', () => {
20
20
  const onClose = vi.fn();
21
21
  render(
22
- <Prompt opened onClose={onClose} title="title modal">
22
+ <Prompt.Information opened onClose={onClose} title="title modal">
23
23
  content modal
24
- </Prompt>,
24
+ </Prompt.Information>,
25
25
  );
26
26
 
27
27
  screen.getByRole('button').click();
28
28
  expect(onClose).toHaveBeenCalledTimes(1);
29
29
  });
30
30
 
31
- it.each(['info', 'success', 'warning', 'critical'])(
32
- 'displays a $0 icon when the prompt is of variant $0',
33
- (variant) => {
34
- render(
35
- <Prompt opened onClose={vi.fn()} title="title modal" variant={variant as PromptVariant}>
36
- content modal
37
- </Prompt>,
38
- );
39
- expect(screen.getByRole('img', {name: variant})).toBeVisible();
40
- },
41
- );
31
+ it.each([
32
+ ['information', Prompt.Information],
33
+ ['success', Prompt.Success],
34
+ ['warning', Prompt.Warning],
35
+ ['critical', Prompt.Critical],
36
+ ])('displays a %s icon when the prompt is of variant %s', (variant, Component) => {
37
+ render(
38
+ <Component opened onClose={vi.fn()} title="title modal">
39
+ content modal
40
+ </Component>,
41
+ );
42
+ expect(screen.getByRole('img', {name: variant})).toBeVisible();
43
+ });
42
44
  });
@@ -33,7 +33,7 @@ export type StickyFooterFactory = Factory<{
33
33
  }>;
34
34
 
35
35
  const defaultProps: Partial<StickyFooterProps> = {
36
- gap: 'sm',
36
+ gap: 'xs',
37
37
  justify: 'flex-end',
38
38
  };
39
39