@coveord/plasma-mantine 57.2.0 → 58.0.1

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 +104 -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,29 +1,46 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { IconAlertSquareFilled, IconAlertTriangleFilled, IconBulbFilled, IconHelpCircle, IconInfoCircle, IconInfoCircleFilled } from '@coveord/plasma-react-icons';
3
- import { Box, createVarsResolver, polymorphicFactory, useProps, useStyles } from '@mantine/core';
2
+ import { IconAlertSquare, IconAlertTriangle, IconBulb, IconCheck, IconHelpCircle, IconInfoCircle } from '@coveord/plasma-react-icons';
3
+ import { Box, createPolymorphicComponent, createVarsResolver, polymorphicFactory, useProps, useStyles } from '@mantine/core';
4
+ import { forwardRef } from 'react';
4
5
  import classes from './InfoToken.module.css';
5
6
  const defaultProps = {
6
- variant: 'information',
7
+ variant: 'outline',
8
+ type: 'information',
7
9
  size: 'xs'
8
10
  };
9
- const colorResolver = (variant)=>{
10
- switch(variant){
11
+ const colorResolver = (type)=>{
12
+ switch(type){
11
13
  case 'error':
12
14
  return 'var(--mantine-color-error)';
13
15
  case 'advice':
14
16
  case 'question':
15
17
  return 'var(--coveo-color-text-primary)';
16
18
  case 'warning':
17
- return 'var(--mantine-color-warning-filled)';
19
+ return 'var(--mantine-color-yellow-text)';
20
+ case 'success':
21
+ return 'var(--mantine-color-green-text)';
18
22
  case 'information':
19
23
  default:
20
- return 'var(--mantine-color-gray-3)';
24
+ return 'var(--mantine-color-gray-text)';
21
25
  }
22
26
  };
23
- const sizeResolver = (size)=>{
24
- if (typeof size === 'number') {
25
- return size;
27
+ const bgColorResolver = (type)=>{
28
+ switch(type){
29
+ case 'error':
30
+ return 'var(--mantine-color-red-light)';
31
+ case 'advice':
32
+ case 'question':
33
+ return 'var(--mantine-primary-color-light)';
34
+ case 'warning':
35
+ return 'var(--mantine-color-yellow-light)';
36
+ case 'success':
37
+ return 'var(--mantine-color-green-light)';
38
+ case 'information':
39
+ default:
40
+ return 'var(--mantine-color-gray-light)';
26
41
  }
42
+ };
43
+ const sizeResolver = (size)=>{
27
44
  switch(size){
28
45
  case 'sm':
29
46
  return 20;
@@ -31,41 +48,40 @@ const sizeResolver = (size)=>{
31
48
  return 24;
32
49
  case 'lg':
33
50
  return 32;
34
- case 'xl':
35
- return 40;
36
51
  case 'xs':
37
52
  default:
38
53
  return 16;
39
54
  }
40
55
  };
41
- const iconResolver = (variant)=>{
42
- switch(variant){
56
+ const iconResolver = (type)=>{
57
+ switch(type){
43
58
  case 'error':
44
- return IconAlertSquareFilled;
45
- case 'information':
46
- return IconInfoCircleFilled;
47
- case 'information-outline':
48
- return IconInfoCircle;
59
+ return IconAlertSquare;
49
60
  case 'question':
50
61
  return IconHelpCircle;
51
62
  case 'warning':
52
- return IconAlertTriangleFilled;
63
+ return IconAlertTriangle;
53
64
  case 'advice':
65
+ return IconBulb;
66
+ case 'success':
67
+ return IconCheck;
54
68
  default:
55
- return IconBulbFilled;
69
+ return IconInfoCircle;
56
70
  }
57
71
  };
58
- const varsResolver = createVarsResolver((_theme, { variant })=>{
59
- const color = colorResolver(variant);
72
+ const varsResolver = createVarsResolver((_theme, { type })=>{
73
+ const color = colorResolver(type);
74
+ const bgColor = bgColorResolver(type);
60
75
  return {
61
76
  root: {
62
- '--info-token-color': color
77
+ '--it-color': color,
78
+ '--it-bg': bgColor
63
79
  }
64
80
  };
65
81
  });
66
- export const InfoToken = polymorphicFactory((_props, ref)=>{
82
+ const _InfoToken = polymorphicFactory((_props, ref)=>{
67
83
  const props = useProps('InfoToken', defaultProps, _props);
68
- const { variant, vars, className, style, unstyled, styles, classNames, size, ...others } = props;
84
+ const { variant, type, vars, className, style, unstyled, styles, classNames, size, ...others } = props;
69
85
  const getStyles = useStyles({
70
86
  name: 'InfoToken',
71
87
  classes,
@@ -77,12 +93,12 @@ export const InfoToken = polymorphicFactory((_props, ref)=>{
77
93
  vars,
78
94
  varsResolver
79
95
  });
80
- const IconComponent = iconResolver(variant);
96
+ const IconComponent = iconResolver(type);
81
97
  return /*#__PURE__*/ _jsx(Box, {
82
98
  ref: ref,
83
99
  variant: variant,
84
100
  role: "img",
85
- "aria-label": variant,
101
+ "aria-label": type,
86
102
  size: size,
87
103
  ...getStyles('root', {
88
104
  className,
@@ -96,34 +112,22 @@ export const InfoToken = polymorphicFactory((_props, ref)=>{
96
112
  })
97
113
  });
98
114
  });
99
- const TokenInformation = InfoToken.withProps({
100
- variant: 'information'
101
- });
102
- TokenInformation.displayName = 'InfoToken.Information';
103
- const TokenInformationOutline = InfoToken.withProps({
104
- variant: 'information-outline'
105
- });
106
- const TokenAdvice = InfoToken.withProps({
107
- variant: 'advice'
108
- });
109
- TokenAdvice.displayName = 'InfoToken.Advice';
110
- const TokenWarning = InfoToken.withProps({
111
- variant: 'warning'
112
- });
113
- TokenWarning.displayName = 'InfoToken.Warning';
114
- const TokenError = InfoToken.withProps({
115
- variant: 'error'
116
- });
117
- TokenError.displayName = 'InfoToken.Error';
118
- const TokenQuestion = InfoToken.withProps({
119
- variant: 'question'
120
- });
121
- TokenQuestion.displayName = 'InfoToken.Question';
122
- InfoToken.Information = TokenInformation;
123
- InfoToken.InformationOutline = TokenInformationOutline;
124
- InfoToken.Advice = TokenAdvice;
125
- InfoToken.Warning = TokenWarning;
126
- InfoToken.Error = TokenError;
127
- InfoToken.Question = TokenQuestion;
115
+ const createInfoTokenCompound = (type, displayName)=>{
116
+ const Component = createPolymorphicComponent(/*#__PURE__*/ forwardRef((props, ref)=>/*#__PURE__*/ _jsx(_InfoToken, {
117
+ ref: ref,
118
+ ...props,
119
+ type: type
120
+ })));
121
+ Component.displayName = displayName;
122
+ return Component;
123
+ };
124
+ export const InfoToken = {
125
+ Information: createInfoTokenCompound('information', 'InfoToken.Information'),
126
+ Advice: createInfoTokenCompound('advice', 'InfoToken.Advice'),
127
+ Warning: createInfoTokenCompound('warning', 'InfoToken.Warning'),
128
+ Error: createInfoTokenCompound('error', 'InfoToken.Error'),
129
+ Question: createInfoTokenCompound('question', 'InfoToken.Question'),
130
+ Success: createInfoTokenCompound('success', 'InfoToken.Success')
131
+ };
128
132
 
129
133
  //# sourceMappingURL=InfoToken.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/InfoToken/InfoToken.tsx"],"sourcesContent":["import {\n IconAlertSquareFilled,\n IconAlertTriangleFilled,\n IconBulbFilled,\n IconHelpCircle,\n IconInfoCircle,\n IconInfoCircleFilled,\n TablerIcon,\n} from '@coveord/plasma-react-icons';\nimport {\n Box,\n BoxProps,\n createVarsResolver,\n Factory,\n MantineSize,\n polymorphicFactory,\n StylesApiProps,\n useProps,\n useStyles,\n} from '@mantine/core';\nimport classes from './InfoToken.module.css';\n\nexport type InfoTokenFactory = Factory<{\n props: InfoTokenProps;\n defaultRef: HTMLDivElement;\n defaultComponent: 'div';\n stylesNames: InfoTokenComponentStylesNames;\n vars: InfoTokenCssVariables;\n variant: InfoTokenVariant;\n staticComponents: {\n Information: typeof TokenInformation;\n InformationOutline: typeof TokenInformationOutline;\n Advice: typeof TokenAdvice;\n Warning: typeof TokenWarning;\n Error: typeof TokenError;\n Question: typeof TokenQuestion;\n };\n}>;\nexport type InfoTokenComponentStylesNames = 'root';\nexport type InfoTokenVariant = 'information' | 'information-outline' | 'advice' | 'warning' | 'error' | 'question';\nexport type InfoTokenCssVariables = {\n root: '--info-token-color';\n};\n\nexport interface InfoTokenProps extends BoxProps, StylesApiProps<InfoTokenFactory> {\n /**\n * The variant of the token.\n *\n * @default 'information'\n */\n variant?: InfoTokenVariant;\n /**\n * The size of the info token.\n *\n * @default 'sm'\n */\n size?: MantineSize;\n}\n\nconst defaultProps: Partial<InfoTokenProps> = {variant: 'information', size: 'xs'};\n\nconst colorResolver = (variant: InfoTokenVariant): string => {\n switch (variant) {\n case 'error':\n return 'var(--mantine-color-error)';\n case 'advice':\n case 'question':\n return 'var(--coveo-color-text-primary)';\n case 'warning':\n return 'var(--mantine-color-warning-filled)';\n case 'information':\n default:\n return 'var(--mantine-color-gray-3)';\n }\n};\n\nconst sizeResolver = (size: MantineSize): number => {\n if (typeof size === 'number') {\n return size;\n }\n switch (size) {\n case 'sm':\n return 20;\n case 'md':\n return 24;\n case 'lg':\n return 32;\n case 'xl':\n return 40;\n case 'xs':\n default:\n return 16;\n }\n};\n\nconst iconResolver = (variant: InfoTokenVariant): TablerIcon => {\n switch (variant) {\n case 'error':\n return IconAlertSquareFilled;\n case 'information':\n return IconInfoCircleFilled;\n case 'information-outline':\n return IconInfoCircle;\n case 'question':\n return IconHelpCircle;\n case 'warning':\n return IconAlertTriangleFilled;\n case 'advice':\n default:\n return IconBulbFilled;\n }\n};\n\nconst varsResolver = createVarsResolver<InfoTokenFactory>((_theme, {variant}) => {\n const color = colorResolver(variant);\n return {\n root: {\n '--info-token-color': color,\n },\n };\n});\n\nexport const InfoToken = polymorphicFactory<InfoTokenFactory>((_props, ref) => {\n const props = useProps('InfoToken', defaultProps, _props);\n const {variant, vars, className, style, unstyled, styles, classNames, size, ...others} = props;\n const getStyles = useStyles<InfoTokenFactory>({\n name: 'InfoToken',\n classes,\n className,\n props,\n style,\n styles,\n unstyled,\n vars,\n varsResolver,\n });\n const IconComponent = iconResolver(variant);\n return (\n <Box\n ref={ref}\n variant={variant}\n role=\"img\"\n aria-label={variant}\n size={size}\n {...getStyles('root', {\n className,\n style,\n styles,\n classNames,\n })}\n {...others}\n >\n <IconComponent size={sizeResolver(size)} />\n </Box>\n );\n});\n\nconst TokenInformation = InfoToken.withProps({\n variant: 'information',\n});\n(TokenInformation as typeof InfoToken).displayName = 'InfoToken.Information';\nconst TokenInformationOutline = InfoToken.withProps({\n variant: 'information-outline',\n});\nconst TokenAdvice = InfoToken.withProps({variant: 'advice'});\n(TokenAdvice as typeof InfoToken).displayName = 'InfoToken.Advice';\nconst TokenWarning = InfoToken.withProps({variant: 'warning'});\n(TokenWarning as typeof InfoToken).displayName = 'InfoToken.Warning';\nconst TokenError = InfoToken.withProps({variant: 'error'});\n(TokenError as typeof InfoToken).displayName = 'InfoToken.Error';\nconst TokenQuestion = InfoToken.withProps({variant: 'question'});\n(TokenQuestion as typeof InfoToken).displayName = 'InfoToken.Question';\n\nInfoToken.Information = TokenInformation;\nInfoToken.InformationOutline = TokenInformationOutline;\nInfoToken.Advice = TokenAdvice;\nInfoToken.Warning = TokenWarning;\nInfoToken.Error = TokenError;\nInfoToken.Question = TokenQuestion;\n"],"names":["IconAlertSquareFilled","IconAlertTriangleFilled","IconBulbFilled","IconHelpCircle","IconInfoCircle","IconInfoCircleFilled","Box","createVarsResolver","polymorphicFactory","useProps","useStyles","classes","defaultProps","variant","size","colorResolver","sizeResolver","iconResolver","varsResolver","_theme","color","root","InfoToken","_props","ref","props","vars","className","style","unstyled","styles","classNames","others","getStyles","name","IconComponent","role","aria-label","TokenInformation","withProps","displayName","TokenInformationOutline","TokenAdvice","TokenWarning","TokenError","TokenQuestion","Information","InformationOutline","Advice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QAAO,GAAGP;IACzF,MAAMQ,YAAYvB,UAA4B;QAC1CwB,MAAM;QACNvB;QACAgB;QACAF;QACAG;QACAE;QACAD;QACAH;QACAR;IACJ;IACA,MAAMiB,gBAAgBlB,aAAaJ;IACnC,qBACI,KAACP;QACGkB,KAAKA;QACLX,SAASA;QACTuB,MAAK;QACLC,cAAYxB;QACZC,MAAMA;QACL,GAAGmB,UAAU,QAAQ;YAClBN;YACAC;YACAE;YACAC;QACJ,EAAE;QACD,GAAGC,MAAM;kBAEV,cAAA,KAACG;YAAcrB,MAAME,aAAaF;;;AAG9C,GAAG;AAEH,MAAMwB,mBAAmBhB,UAAUiB,SAAS,CAAC;IACzC1B,SAAS;AACb;AACCyB,iBAAsCE,WAAW,GAAG;AACrD,MAAMC,0BAA0BnB,UAAUiB,SAAS,CAAC;IAChD1B,SAAS;AACb;AACA,MAAM6B,cAAcpB,UAAUiB,SAAS,CAAC;IAAC1B,SAAS;AAAQ;AACzD6B,YAAiCF,WAAW,GAAG;AAChD,MAAMG,eAAerB,UAAUiB,SAAS,CAAC;IAAC1B,SAAS;AAAS;AAC3D8B,aAAkCH,WAAW,GAAG;AACjD,MAAMI,aAAatB,UAAUiB,SAAS,CAAC;IAAC1B,SAAS;AAAO;AACvD+B,WAAgCJ,WAAW,GAAG;AAC/C,MAAMK,gBAAgBvB,UAAUiB,SAAS,CAAC;IAAC1B,SAAS;AAAU;AAC7DgC,cAAmCL,WAAW,GAAG;AAElDlB,UAAUwB,WAAW,GAAGR;AACxBhB,UAAUyB,kBAAkB,GAAGN;AAC/BnB,UAAU0B,MAAM,GAAGN;AACnBpB,UAAU2B,OAAO,GAAGN;AACpBrB,UAAU4B,KAAK,GAAGN;AAClBtB,UAAU6B,QAAQ,GAAGN"}
1
+ {"version":3,"sources":["../../../../src/components/InfoToken/InfoToken.tsx"],"sourcesContent":["import {\n IconAlertSquare,\n IconAlertTriangle,\n IconBulb,\n IconCheck,\n IconHelpCircle,\n IconInfoCircle,\n TablerIcon,\n} from '@coveord/plasma-react-icons';\nimport {\n Box,\n BoxProps,\n createPolymorphicComponent,\n createVarsResolver,\n Factory,\n PolymorphicComponentProps,\n polymorphicFactory,\n StylesApiProps,\n useProps,\n useStyles,\n} from '@mantine/core';\nimport {forwardRef, FunctionComponent, ReactElement} from 'react';\nimport classes from './InfoToken.module.css';\n\nexport type InfoTokenFactory = Factory<{\n props: InfoTokenInternalProps;\n defaultRef: HTMLDivElement;\n defaultComponent: 'div';\n stylesNames: InfoTokenComponentStylesNames;\n vars: InfoTokenCssVariables;\n variant: InfoTokenVariant;\n}>;\nexport type InfoTokenComponentStylesNames = 'root';\nexport type InfoTokenType = 'information' | 'advice' | 'warning' | 'error' | 'question' | 'success';\nexport type InfoTokenVariant = 'outline' | 'light';\nexport type InfoTokenSizes = 'xs' | 'sm' | 'md' | 'lg';\nexport type InfoTokenCssVariables = {\n root: '--it-color' | '--it-bg';\n};\n\ninterface InfoTokenInternalProps extends BoxProps, StylesApiProps<InfoTokenFactory> {\n /**\n * The variant of the token.\n *\n * @default 'outline'\n */\n variant?: InfoTokenVariant;\n /**\n * The semantic type of the token\n *\n * @default 'information'\n */\n type?: InfoTokenType;\n /**\n * The size of the info token.\n *\n * @default 'xs'\n */\n size?: InfoTokenSizes;\n}\n\nexport type InfoTokenProps = Omit<InfoTokenInternalProps, 'type'>;\n\ntype InfoTokenCompoundComponent = (<C = 'div'>(props: PolymorphicComponentProps<C, InfoTokenProps>) => ReactElement) &\n Omit<FunctionComponent<PolymorphicComponentProps<any, InfoTokenProps>>, never>;\n\nconst defaultProps: Partial<InfoTokenInternalProps> = {variant: 'outline', type: 'information', size: 'xs'};\n\nconst colorResolver = (type: InfoTokenType): string => {\n switch (type) {\n case 'error':\n return 'var(--mantine-color-error)';\n case 'advice':\n case 'question':\n return 'var(--coveo-color-text-primary)';\n case 'warning':\n return 'var(--mantine-color-yellow-text)';\n case 'success':\n return 'var(--mantine-color-green-text)';\n case 'information':\n default:\n return 'var(--mantine-color-gray-text)';\n }\n};\n\nconst bgColorResolver = (type: InfoTokenType): string => {\n switch (type) {\n case 'error':\n return 'var(--mantine-color-red-light)';\n case 'advice':\n case 'question':\n return 'var(--mantine-primary-color-light)';\n case 'warning':\n return 'var(--mantine-color-yellow-light)';\n case 'success':\n return 'var(--mantine-color-green-light)';\n case 'information':\n default:\n return 'var(--mantine-color-gray-light)';\n }\n};\n\nconst sizeResolver = (size: InfoTokenSizes): number => {\n switch (size) {\n case 'sm':\n return 20;\n case 'md':\n return 24;\n case 'lg':\n return 32;\n case 'xs':\n default:\n return 16;\n }\n};\n\nconst iconResolver = (type: InfoTokenType): TablerIcon => {\n switch (type) {\n case 'error':\n return IconAlertSquare;\n case 'question':\n return IconHelpCircle;\n case 'warning':\n return IconAlertTriangle;\n case 'advice':\n return IconBulb;\n case 'success':\n return IconCheck;\n default:\n return IconInfoCircle;\n }\n};\n\nconst varsResolver = createVarsResolver<InfoTokenFactory>((_theme, {type}) => {\n const color = colorResolver(type);\n const bgColor = bgColorResolver(type);\n return {\n root: {\n '--it-color': color,\n '--it-bg': bgColor,\n },\n };\n});\n\nconst _InfoToken = polymorphicFactory<InfoTokenFactory>((_props, ref) => {\n const props = useProps('InfoToken', defaultProps, _props);\n const {variant, type, vars, className, style, unstyled, styles, classNames, size, ...others} = props;\n const getStyles = useStyles<InfoTokenFactory>({\n name: 'InfoToken',\n classes,\n className,\n props,\n style,\n styles,\n unstyled,\n vars,\n varsResolver,\n });\n const IconComponent = iconResolver(type);\n return (\n <Box\n ref={ref}\n variant={variant}\n role=\"img\"\n aria-label={type}\n size={size}\n {...getStyles('root', {\n className,\n style,\n styles,\n classNames,\n })}\n {...others}\n >\n <IconComponent size={sizeResolver(size)} />\n </Box>\n );\n});\n\nconst createInfoTokenCompound = (type: InfoTokenType, displayName: string): InfoTokenCompoundComponent => {\n const Component: InfoTokenCompoundComponent = createPolymorphicComponent<'div', InfoTokenProps>(\n forwardRef<any, InfoTokenProps>((props, ref) => <_InfoToken ref={ref} {...props} type={type} />),\n );\n Component.displayName = displayName;\n return Component;\n};\n\nexport const InfoToken = {\n Information: createInfoTokenCompound('information', 'InfoToken.Information'),\n Advice: createInfoTokenCompound('advice', 'InfoToken.Advice'),\n Warning: createInfoTokenCompound('warning', 'InfoToken.Warning'),\n Error: createInfoTokenCompound('error', 'InfoToken.Error'),\n Question: createInfoTokenCompound('question', 'InfoToken.Question'),\n Success: createInfoTokenCompound('success', 'InfoToken.Success'),\n} as const;\n"],"names":["IconAlertSquare","IconAlertTriangle","IconBulb","IconCheck","IconHelpCircle","IconInfoCircle","Box","createPolymorphicComponent","createVarsResolver","polymorphicFactory","useProps","useStyles","forwardRef","classes","defaultProps","variant","type","size","colorResolver","bgColorResolver","sizeResolver","iconResolver","varsResolver","_theme","color","bgColor","root","_InfoToken","_props","ref","props","vars","className","style","unstyled","styles","classNames","others","getStyles","name","IconComponent","role","aria-label","createInfoTokenCompound","displayName","Component","InfoToken","Information","Advice","Warning","Error","Question","Success"],"mappings":";AAAA,SACIA,eAAe,EACfC,iBAAiB,EACjBC,QAAQ,EACRC,SAAS,EACTC,cAAc,EACdC,cAAc,QAEX,8BAA8B;AACrC,SACIC,GAAG,EAEHC,0BAA0B,EAC1BC,kBAAkB,EAGlBC,kBAAkB,EAElBC,QAAQ,EACRC,SAAS,QACN,gBAAgB;AACvB,SAAQC,UAAU,QAAwC,QAAQ;AAClE,OAAOC,aAAa,yBAAyB;AA4C7C,MAAMC,eAAgD;IAACC,SAAS;IAAWC,MAAM;IAAeC,MAAM;AAAI;AAE1G,MAAMC,gBAAgB,CAACF;IACnB,OAAQA;QACJ,KAAK;YACD,OAAO;QACX,KAAK;QACL,KAAK;YACD,OAAO;QACX,KAAK;YACD,OAAO;QACX,KAAK;YACD,OAAO;QACX,KAAK;QACL;YACI,OAAO;IACf;AACJ;AAEA,MAAMG,kBAAkB,CAACH;IACrB,OAAQA;QACJ,KAAK;YACD,OAAO;QACX,KAAK;QACL,KAAK;YACD,OAAO;QAC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D,MAAMC,YAAwCtC,yCAC1CK,WAAgC,CAACkB,OAAOD,oBAAQ,KAACF;YAAWE,KAAKA;YAAM,GAAGC,KAAK;YAAEd,MAAMA;;IAE3F6B,UAAUD,WAAW,GAAGA;IACxB,OAAOC;AACX;AAEA,OAAO,MAAMC,YAAY;IACrBC,aAAaJ,wBAAwB,eAAe;IACpDK,QAAQL,wBAAwB,UAAU;IAC1CM,SAASN,wBAAwB,WAAW;IAC5CO,OAAOP,wBAAwB,SAAS;IACxCQ,UAAUR,wBAAwB,YAAY;IAC9CS,SAAST,wBAAwB,WAAW;AAChD,EAAW"}
@@ -1,8 +1,16 @@
1
1
  .root {
2
- --info-token-color: var(--mantine-color-primary);
3
-
4
2
  display: inline-flex;
5
3
  flex-shrink: 0;
6
4
  align-items: center;
7
- color: var(--info-token-color);
5
+ color: var(--it-color);
6
+
7
+ &[data-variant='light'] {
8
+ background-color: var(--it-bg);
9
+ border-radius: var(--mantine-spacing-xxs);
10
+ padding: var(--mantine-spacing-xs);
11
+
12
+ &[data-size='xs'] {
13
+ padding: var(--mantine-spacing-xxs);
14
+ }
15
+ }
8
16
  }
@@ -12,7 +12,7 @@ export declare const InlineConfirmTarget: (<C = (<C_1 = "button">(props: import(
12
12
  }) | (ButtonProps & {
13
13
  component: React.ElementType;
14
14
  renderRoot?: (props: Record<string, any>) => any;
15
- })>, never> & import("node_modules/@mantine/core/lib/core/factory/factory.js").ThemeExtend<{
15
+ })>, never> & import("@mantine/core").ThemeExtend<{
16
16
  props: ButtonProps;
17
17
  defaultRef: HTMLButtonElement;
18
18
  defaultComponent: "button";
@@ -30,7 +30,7 @@ export declare const InlineConfirmTarget: (<C = (<C_1 = "button">(props: import(
30
30
  DestructiveTertiary: <L = "button">(props: import("@mantine/core").PolymorphicComponentProps<L, ButtonProps>) => React.ReactElement;
31
31
  DestructiveQuaternary: <L = "button">(props: import("@mantine/core").PolymorphicComponentProps<L, ButtonProps>) => React.ReactElement;
32
32
  };
33
- }> & import("node_modules/@mantine/core/lib/core/factory/factory.js").ComponentClasses<{
33
+ }> & import("@mantine/core").ComponentClasses<{
34
34
  props: ButtonProps;
35
35
  defaultRef: HTMLButtonElement;
36
36
  defaultComponent: "button";
@@ -48,7 +48,7 @@ export declare const InlineConfirmTarget: (<C = (<C_1 = "button">(props: import(
48
48
  DestructiveTertiary: <L = "button">(props: import("@mantine/core").PolymorphicComponentProps<L, ButtonProps>) => React.ReactElement;
49
49
  DestructiveQuaternary: <L = "button">(props: import("@mantine/core").PolymorphicComponentProps<L, ButtonProps>) => React.ReactElement;
50
50
  };
51
- }> & import("node_modules/@mantine/core/lib/core/factory/polymorphic-factory.js").PolymorphicComponentWithProps<{
51
+ }> & import("@mantine/core").PolymorphicComponentWithProps<{
52
52
  props: ButtonProps;
53
53
  defaultRef: HTMLButtonElement;
54
54
  defaultComponent: "button";
@@ -1,2 +1,15 @@
1
- export { Input, type InputFactory, type InputProps } from '@mantine/core';
1
+ import { Input as MantineInput, type InputFactory as MantineInputFactory, type InputProps } from '@mantine/core';
2
+ import { InputLabelInfo, type InputLabelInfoFactory, type InputLabelInfoProps, type InputLabelInfoStylesNames } from './InputLabelInfo.js';
3
+ type PlasmaInputFactory = Omit<MantineInputFactory, 'staticComponents'> & {
4
+ staticComponents: MantineInputFactory['staticComponents'] & {
5
+ LabelInfo: typeof InputLabelInfo;
6
+ };
7
+ };
8
+ declare const Input: typeof MantineInput & {
9
+ LabelInfo: typeof InputLabelInfo;
10
+ };
11
+ export { Input };
12
+ export type InputFactory = PlasmaInputFactory;
13
+ export type { InputProps, InputLabelInfoFactory, InputLabelInfoProps, InputLabelInfoStylesNames };
14
+ export { InputLabelInfo };
2
15
  //# sourceMappingURL=Input.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/Input.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,KAAK,EAAE,KAAK,YAAY,EAAE,KAAK,UAAU,EAAC,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/Input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,IAAI,YAAY,EAAE,KAAK,YAAY,IAAI,mBAAmB,EAAE,KAAK,UAAU,EAAC,MAAM,eAAe,CAAC;AAC/G,OAAO,EACH,cAAc,EACd,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,yBAAyB,EACjC,MAAM,qBAAqB,CAAC;AAE7B,KAAK,kBAAkB,GAAG,IAAI,CAAC,mBAAmB,EAAE,kBAAkB,CAAC,GAAG;IACtE,gBAAgB,EAAE,mBAAmB,CAAC,kBAAkB,CAAC,GAAG;QACxD,SAAS,EAAE,OAAO,cAAc,CAAC;KACpC,CAAC;CACL,CAAC;AAEF,QAAA,MAAM,KAAK,EAAmB,OAAO,YAAY,GAAG;IAChD,SAAS,EAAE,OAAO,cAAc,CAAC;CACpC,CAAC;AAOF,OAAO,EAAC,KAAK,EAAC,CAAC;AACf,MAAM,MAAM,YAAY,GAAG,kBAAkB,CAAC;AAC9C,YAAY,EAAC,UAAU,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,yBAAyB,EAAC,CAAC;AAChG,OAAO,EAAC,cAAc,EAAC,CAAC"}
@@ -1,5 +1,10 @@
1
- import { Input } from '@mantine/core';
1
+ import { Input as MantineInput } from '@mantine/core';
2
+ import { InputLabelInfo } from './InputLabelInfo.js';
3
+ const Input = MantineInput;
2
4
  Input.displayName = 'Input';
3
- export { Input } from '@mantine/core';
5
+ Input.LabelInfo = InputLabelInfo;
6
+ InputLabelInfo.displayName = 'Input.LabelInfo';
7
+ export { Input };
8
+ export { InputLabelInfo };
4
9
 
5
10
  //# sourceMappingURL=Input.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/Input/Input.ts"],"sourcesContent":["import {Input} from '@mantine/core';\n\nInput.displayName = 'Input';\n\nexport {Input, type InputFactory, type InputProps} from '@mantine/core';\n"],"names":["Input","displayName"],"mappings":"AAAA,SAAQA,KAAK,QAAO,gBAAgB;AAEpCA,MAAMC,WAAW,GAAG;AAEpB,SAAQD,KAAK,QAA2C,gBAAgB"}
1
+ {"version":3,"sources":["../../../../src/components/Input/Input.ts"],"sourcesContent":["import {Input as MantineInput, type InputFactory as MantineInputFactory, type InputProps} from '@mantine/core';\nimport {\n InputLabelInfo,\n type InputLabelInfoFactory,\n type InputLabelInfoProps,\n type InputLabelInfoStylesNames,\n} from './InputLabelInfo.js';\n\ntype PlasmaInputFactory = Omit<MantineInputFactory, 'staticComponents'> & {\n staticComponents: MantineInputFactory['staticComponents'] & {\n LabelInfo: typeof InputLabelInfo;\n };\n};\n\nconst Input = MantineInput as typeof MantineInput & {\n LabelInfo: typeof InputLabelInfo;\n};\n\nInput.displayName = 'Input';\nInput.LabelInfo = InputLabelInfo;\n\nInputLabelInfo.displayName = 'Input.LabelInfo';\n\nexport {Input};\nexport type InputFactory = PlasmaInputFactory;\nexport type {InputProps, InputLabelInfoFactory, InputLabelInfoProps, InputLabelInfoStylesNames};\nexport {InputLabelInfo};\n"],"names":["Input","MantineInput","InputLabelInfo","displayName","LabelInfo"],"mappings":"AAAA,SAAQA,SAASC,YAAY,QAAkE,gBAAgB;AAC/G,SACIC,cAAc,QAIX,sBAAsB;AAQ7B,MAAMF,QAAQC;AAIdD,MAAMG,WAAW,GAAG;AACpBH,MAAMI,SAAS,GAAGF;AAElBA,eAAeC,WAAW,GAAG;AAE7B,SAAQH,KAAK,GAAE;AAGf,SAAQE,cAAc,GAAE"}
@@ -0,0 +1,17 @@
1
+ import { StylesApiProps, type Factory, type TooltipProps } from '@mantine/core';
2
+ import { type ReactNode } from 'react';
3
+ export type InputLabelInfoStylesNames = 'labelInfo';
4
+ export interface InputLabelInfoProps extends Omit<TooltipProps, 'label' | 'classNames' | 'attributes' | 'styles' | 'vars'>, StylesApiProps<InputLabelInfoFactory> {
5
+ children: ReactNode;
6
+ }
7
+ export type InputLabelInfoFactory = Factory<{
8
+ props: InputLabelInfoProps;
9
+ ref: HTMLSpanElement;
10
+ stylesNames: InputLabelInfoStylesNames;
11
+ }>;
12
+ export declare const InputLabelInfo: import("@mantine/core").MantineComponent<{
13
+ props: InputLabelInfoProps;
14
+ ref: HTMLSpanElement;
15
+ stylesNames: InputLabelInfoStylesNames;
16
+ }>;
17
+ //# sourceMappingURL=InputLabelInfo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InputLabelInfo.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/InputLabelInfo.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAU,cAAc,EAAgC,KAAK,OAAO,EAAE,KAAK,YAAY,EAAC,MAAM,eAAe,CAAC;AACrH,OAAO,EAAC,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAIrC,MAAM,MAAM,yBAAyB,GAAG,WAAW,CAAC;AAEpD,MAAM,WAAW,mBACb,SACI,IAAI,CAAC,YAAY,EAAE,OAAO,GAAG,YAAY,GAAG,YAAY,GAAG,QAAQ,GAAG,MAAM,CAAC,EAC7E,cAAc,CAAC,qBAAqB,CAAC;IACzC,QAAQ,EAAE,SAAS,CAAC;CACvB;AAED,MAAM,MAAM,qBAAqB,GAAG,OAAO,CAAC;IACxC,KAAK,EAAE,mBAAmB,CAAC;IAC3B,GAAG,EAAE,eAAe,CAAC;IACrB,WAAW,EAAE,yBAAyB,CAAC;CAC1C,CAAC,CAAC;AAIH,eAAO,MAAM,cAAc;WAPhB,mBAAmB;SACrB,eAAe;iBACP,yBAAyB;EAyBxC,CAAC"}
@@ -0,0 +1,35 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { factory, Tooltip, useProps, useStyles } from '@mantine/core';
3
+ import { InfoToken } from '../InfoToken/InfoToken.js';
4
+ import classes from './InputLabelInfo.module.css';
5
+ const defaultProps = {};
6
+ export const InputLabelInfo = factory((_props, ref)=>{
7
+ const props = useProps('InputLabelInfo', defaultProps, _props);
8
+ const { classNames, className, style, styles, unstyled, vars, children, attributes, ...others } = props;
9
+ const getStyles = useStyles({
10
+ name: 'InputLabelInfo',
11
+ props,
12
+ style,
13
+ styles,
14
+ unstyled,
15
+ attributes,
16
+ className,
17
+ classes,
18
+ classNames,
19
+ vars
20
+ });
21
+ return /*#__PURE__*/ _jsx(Tooltip, {
22
+ label: children,
23
+ ...others,
24
+ children: /*#__PURE__*/ _jsx(InfoToken.Information, {
25
+ component: "span",
26
+ ...getStyles('labelInfo', {
27
+ className,
28
+ style
29
+ }),
30
+ ref: ref
31
+ })
32
+ });
33
+ });
34
+
35
+ //# sourceMappingURL=InputLabelInfo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/Input/InputLabelInfo.tsx"],"sourcesContent":["import {factory, StylesApiProps, Tooltip, useProps, useStyles, type Factory, type TooltipProps} from '@mantine/core';\nimport {type ReactNode} from 'react';\nimport {InfoToken} from '../InfoToken/InfoToken.js';\nimport classes from './InputLabelInfo.module.css';\n\nexport type InputLabelInfoStylesNames = 'labelInfo';\n\nexport interface InputLabelInfoProps\n extends\n Omit<TooltipProps, 'label' | 'classNames' | 'attributes' | 'styles' | 'vars'>,\n StylesApiProps<InputLabelInfoFactory> {\n children: ReactNode;\n}\n\nexport type InputLabelInfoFactory = Factory<{\n props: InputLabelInfoProps;\n ref: HTMLSpanElement;\n stylesNames: InputLabelInfoStylesNames;\n}>;\n\nconst defaultProps = {} satisfies Partial<InputLabelInfoProps>;\n\nexport const InputLabelInfo = factory<InputLabelInfoFactory>((_props, ref) => {\n const props = useProps('InputLabelInfo', defaultProps, _props);\n const {classNames, className, style, styles, unstyled, vars, children, attributes, ...others} = props;\n const getStyles = useStyles<InputLabelInfoFactory>({\n name: 'InputLabelInfo',\n props,\n style,\n styles,\n unstyled,\n attributes,\n className,\n classes,\n classNames,\n vars,\n });\n return (\n <Tooltip label={children} {...others}>\n <InfoToken.Information component=\"span\" {...getStyles('labelInfo', {className, style})} ref={ref} />\n </Tooltip>\n );\n});\n"],"names":["factory","Tooltip","useProps","useStyles","InfoToken","classes","defaultProps","InputLabelInfo","_props","ref","props","classNames","className","style","styles","unstyled","vars","children","attributes","others","getStyles","name","label","Information","component"],"mappings":";AAAA,SAAQA,OAAO,EAAkBC,OAAO,EAAEC,QAAQ,EAAEC,SAAS,QAAwC,gBAAgB;AAErH,SAAQC,SAAS,QAAO,4BAA4B;AACpD,OAAOC,aAAa,8BAA8B;AAiBlD,MAAMC,eAAe,CAAC;AAEtB,OAAO,MAAMC,iBAAiBP,QAA+B,CAACQ,QAAQC;IAClE,MAAMC,QAAQR,SAAS,kBAAkBI,cAAcE;IACvD,MAAM,EAACG,UAAU,EAAEC,SAAS,EAAEC,KAAK,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,UAAU,EAAE,GAAGC,QAAO,GAAGT;IAChG,MAAMU,YAAYjB,UAAiC;QAC/CkB,MAAM;QACNX;QACAG;QACAC;QACAC;QACAG;QACAN;QACAP;QACAM;QACAK;IACJ;IACA,qBACI,KAACf;QAAQqB,OAAOL;QAAW,GAAGE,MAAM;kBAChC,cAAA,KAACf,UAAUmB,WAAW;YAACC,WAAU;YAAQ,GAAGJ,UAAU,aAAa;gBAACR;gBAAWC;YAAK,EAAE;YAAEJ,KAAKA;;;AAGzG,GAAG"}
@@ -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
+ }
@@ -20,7 +20,7 @@ const PlasmaModal = factory(({ title, description, help, ...otherProps }, ref)=>
20
20
  ...otherProps
21
21
  });
22
22
  });
23
- PlasmaModal.displayName = '@coveord/plasma-mantine/Modal';
23
+ PlasmaModal.displayName = 'Modal';
24
24
  PlasmaModal.Root = MantineModal.Root;
25
25
  PlasmaModal.Body = MantineModal.Body;
26
26
  PlasmaModal.Overlay = MantineModal.Overlay;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/Modal/Modal.tsx"],"sourcesContent":["import {\n factory,\n Modal as MantineModal,\n ModalFactory as MantineModalFactory,\n ModalProps as MantineModalProps,\n} from '@mantine/core';\nimport {Header, type HeaderDocAnchorProps, type HeaderProps} from '../Header/Header.js';\nimport {ModalFooter as PlasmaModalFooter} from './ModalFooter.js';\n\ninterface PlasmaModalProps extends MantineModalProps {\n /**\n * Description of the modal, displayed below the title.\n */\n description?: HeaderProps['description'];\n /**\n * Help link for the modal, displayed in the header.\n * Usually provides a link to external documentation or help resources.\n */\n help?: HeaderDocAnchorProps;\n}\n\n// Need to redeclare the factory to override and add footer to the props type\ntype PlasmaModalFactory = Omit<MantineModalFactory, 'staticComponents'> & {\n props: PlasmaModalProps;\n staticComponents: MantineModalFactory['staticComponents'] & {\n Footer: typeof PlasmaModalFooter;\n };\n};\n\nconst PlasmaModal = factory<PlasmaModalFactory>(({title, description, help, ...otherProps}, ref) => {\n const header =\n typeof title === 'string' ? (\n <Header titleComponent=\"div\" variant=\"secondary\" description={description}>\n {title}\n {help && <Header.DocAnchor {...help} />}\n </Header>\n ) : (\n title\n );\n return <MantineModal ref={ref} title={header} {...otherProps} />;\n});\n\nPlasmaModal.displayName = '@coveord/plasma-mantine/Modal';\nPlasmaModal.Root = MantineModal.Root;\nPlasmaModal.Body = MantineModal.Body;\nPlasmaModal.Overlay = MantineModal.Overlay;\nPlasmaModal.Content = MantineModal.Content;\nPlasmaModal.Header = MantineModal.Header;\nPlasmaModal.Title = MantineModal.Title;\nPlasmaModal.CloseButton = MantineModal.CloseButton;\nPlasmaModal.Stack = MantineModal.Stack;\nPlasmaModal.Footer = PlasmaModalFooter;\n\nexport const Modal = PlasmaModal;\nexport type ModalProps = PlasmaModalProps;\n\nexport type ModalFactory = PlasmaModalFactory;\nexport type {ModalRootProps, ModalCssVariables, ModalStylesNames} from '@mantine/core';\n"],"names":["factory","Modal","MantineModal","Header","ModalFooter","PlasmaModalFooter","PlasmaModal","title","description","help","otherProps","ref","header","titleComponent","variant","DocAnchor","displayName","Root","Body","Overlay","Content","Title","CloseButton","Stack","Footer"],"mappings":";AAAA,SACIA,OAAO,EACPC,SAASC,YAAY,QAGlB,gBAAgB;AACvB,SAAQC,MAAM,QAAoD,sBAAsB;AACxF,SAAQC,eAAeC,iBAAiB,QAAO,mBAAmB;AAsBlE,MAAMC,cAAcN,QAA4B,CAAC,EAACO,KAAK,EAAEC,WAAW,EAAEC,IAAI,EAAE,GAAGC,YAAW,EAAEC;IACxF,MAAMC,SACF,OAAOL,UAAU,yBACb,MAACJ;QAAOU,gBAAe;QAAMC,SAAQ;QAAYN,aAAaA;;YACzDD;YACAE,sBAAQ,KAACN,OAAOY,SAAS;gBAAE,GAAGN,IAAI;;;SAGvCF;IAER,qBAAO,KAACL;QAAaS,KAAKA;QAAKJ,OAAOK;QAAS,GAAGF,UAAU;;AAChE;AAEAJ,YAAYU,WAAW,GAAG;AAC1BV,YAAYW,IAAI,GAAGf,aAAae,IAAI;AACpCX,YAAYY,IAAI,GAAGhB,aAAagB,IAAI;AACpCZ,YAAYa,OAAO,GAAGjB,aAAaiB,OAAO;AAC1Cb,YAAYc,OAAO,GAAGlB,aAAakB,OAAO;AAC1Cd,YAAYH,MAAM,GAAGD,aAAaC,MAAM;AACxCG,YAAYe,KAAK,GAAGnB,aAAamB,KAAK;AACtCf,YAAYgB,WAAW,GAAGpB,aAAaoB,WAAW;AAClDhB,YAAYiB,KAAK,GAAGrB,aAAaqB,KAAK;AACtCjB,YAAYkB,MAAM,GAAGnB;AAErB,OAAO,MAAMJ,QAAQK,YAAY"}
1
+ {"version":3,"sources":["../../../../src/components/Modal/Modal.tsx"],"sourcesContent":["import {\n factory,\n Modal as MantineModal,\n ModalFactory as MantineModalFactory,\n ModalProps as MantineModalProps,\n} from '@mantine/core';\nimport {Header, type HeaderDocAnchorProps, type HeaderProps} from '../Header/Header.js';\nimport {ModalFooter as PlasmaModalFooter} from './ModalFooter.js';\n\ninterface PlasmaModalProps extends MantineModalProps {\n /**\n * Description of the modal, displayed below the title.\n */\n description?: HeaderProps['description'];\n /**\n * Help link for the modal, displayed in the header.\n * Usually provides a link to external documentation or help resources.\n */\n help?: HeaderDocAnchorProps;\n}\n\n// Need to redeclare the factory to override and add footer to the props type\ntype PlasmaModalFactory = Omit<MantineModalFactory, 'staticComponents'> & {\n props: PlasmaModalProps;\n staticComponents: MantineModalFactory['staticComponents'] & {\n Footer: typeof PlasmaModalFooter;\n };\n};\n\nconst PlasmaModal = factory<PlasmaModalFactory>(({title, description, help, ...otherProps}, ref) => {\n const header =\n typeof title === 'string' ? (\n <Header titleComponent=\"div\" variant=\"secondary\" description={description}>\n {title}\n {help && <Header.DocAnchor {...help} />}\n </Header>\n ) : (\n title\n );\n return <MantineModal ref={ref} title={header} {...otherProps} />;\n});\n\nPlasmaModal.displayName = 'Modal';\nPlasmaModal.Root = MantineModal.Root;\nPlasmaModal.Body = MantineModal.Body;\nPlasmaModal.Overlay = MantineModal.Overlay;\nPlasmaModal.Content = MantineModal.Content;\nPlasmaModal.Header = MantineModal.Header;\nPlasmaModal.Title = MantineModal.Title;\nPlasmaModal.CloseButton = MantineModal.CloseButton;\nPlasmaModal.Stack = MantineModal.Stack;\nPlasmaModal.Footer = PlasmaModalFooter;\n\nexport const Modal = PlasmaModal;\nexport type ModalProps = PlasmaModalProps;\n\nexport type ModalFactory = PlasmaModalFactory;\nexport type {ModalRootProps, ModalCssVariables, ModalStylesNames} from '@mantine/core';\n"],"names":["factory","Modal","MantineModal","Header","ModalFooter","PlasmaModalFooter","PlasmaModal","title","description","help","otherProps","ref","header","titleComponent","variant","DocAnchor","displayName","Root","Body","Overlay","Content","Title","CloseButton","Stack","Footer"],"mappings":";AAAA,SACIA,OAAO,EACPC,SAASC,YAAY,QAGlB,gBAAgB;AACvB,SAAQC,MAAM,QAAoD,sBAAsB;AACxF,SAAQC,eAAeC,iBAAiB,QAAO,mBAAmB;AAsBlE,MAAMC,cAAcN,QAA4B,CAAC,EAACO,KAAK,EAAEC,WAAW,EAAEC,IAAI,EAAE,GAAGC,YAAW,EAAEC;IACxF,MAAMC,SACF,OAAOL,UAAU,yBACb,MAACJ;QAAOU,gBAAe;QAAMC,SAAQ;QAAYN,aAAaA;;YACzDD;YACAE,sBAAQ,KAACN,OAAOY,SAAS;gBAAE,GAAGN,IAAI;;;SAGvCF;IAER,qBAAO,KAACL;QAAaS,KAAKA;QAAKJ,OAAOK;QAAS,GAAGF,UAAU;;AAChE;AAEAJ,YAAYU,WAAW,GAAG;AAC1BV,YAAYW,IAAI,GAAGf,aAAae,IAAI;AACpCX,YAAYY,IAAI,GAAGhB,aAAagB,IAAI;AACpCZ,YAAYa,OAAO,GAAGjB,aAAaiB,OAAO;AAC1Cb,YAAYc,OAAO,GAAGlB,aAAakB,OAAO;AAC1Cd,YAAYH,MAAM,GAAGD,aAAaC,MAAM;AACxCG,YAAYe,KAAK,GAAGnB,aAAamB,KAAK;AACtCf,YAAYgB,WAAW,GAAGpB,aAAaoB,WAAW;AAClDhB,YAAYiB,KAAK,GAAGrB,aAAaqB,KAAK;AACtCjB,YAAYkB,MAAM,GAAGnB;AAErB,OAAO,MAAMJ,QAAQK,YAAY"}
@@ -20,10 +20,12 @@ export const ModalFooter = factory((props, ref)=>{
20
20
  props.h
21
21
  ]);
22
22
  return /*#__PURE__*/ _jsx(StickyFooter, {
23
+ borderTop: true,
23
24
  className: classes.root,
24
25
  ref: footerRef,
25
26
  ...props
26
27
  });
27
28
  });
29
+ ModalFooter.displayName = 'Modal.Footer';
28
30
 
29
31
  //# sourceMappingURL=ModalFooter.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/Modal/ModalFooter.tsx"],"sourcesContent":["import {useRef, useEffect} from 'react';\nimport {Factory, factory} from '@mantine/core';\nimport {StickyFooter, type StickyFooterProps, type StickyFooterStylesNames} from '../StickyFooter/StickyFooter.js';\nimport classes from './ModalFooter.module.css';\n\nexport interface ModalFooterProps extends Omit<StickyFooterProps, 'variant'> {}\n\nexport type ModalFooterStylesNames = StickyFooterStylesNames;\n\nexport type ModalFooterFactory = Factory<{\n props: ModalFooterProps;\n ref: HTMLDivElement;\n stylesNames: ModalFooterStylesNames;\n}>;\n\nconst ensuresFooterHasEvenHeight = (footer: HTMLElement) => {\n const remainder = footer.offsetHeight % 2;\n footer.style.height = `${footer.offsetHeight - remainder + 2}px`;\n};\n\nexport const ModalFooter = factory<ModalFooterFactory>((props, ref) => {\n const _ref = useRef<HTMLDivElement>(null);\n\n const footerRef = ref || _ref;\n\n useEffect(() => {\n if (typeof footerRef !== 'function' && footerRef.current) {\n ensuresFooterHasEvenHeight(footerRef.current);\n }\n\n // if ref === 'function', this is a callback ref. Haven't found any solution for adjusting the height in this case\n }, [ref, props.h]);\n\n return <StickyFooter className={classes.root} ref={footerRef} {...props} />;\n});\n"],"names":["useRef","useEffect","factory","StickyFooter","classes","ensuresFooterHasEvenHeight","footer","remainder","offsetHeight","style","height","ModalFooter","props","ref","_ref","footerRef","current","h","className","root"],"mappings":";AAAA,SAAQA,MAAM,EAAEC,SAAS,QAAO,QAAQ;AACxC,SAAiBC,OAAO,QAAO,gBAAgB;AAC/C,SAAQC,YAAY,QAA6D,kCAAkC;AACnH,OAAOC,aAAa,2BAA2B;AAY/C,MAAMC,6BAA6B,CAACC;IAChC,MAAMC,YAAYD,OAAOE,YAAY,GAAG;IACxCF,OAAOG,KAAK,CAACC,MAAM,GAAG,GAAGJ,OAAOE,YAAY,GAAGD,YAAY,EAAE,EAAE,CAAC;AACpE;AAEA,OAAO,MAAMI,cAAcT,QAA4B,CAACU,OAAOC;IAC3D,MAAMC,OAAOd,OAAuB;IAEpC,MAAMe,YAAYF,OAAOC;IAEzBb,UAAU;QACN,IAAI,OAAOc,cAAc,cAAcA,UAAUC,OAAO,EAAE;YACtDX,2BAA2BU,UAAUC,OAAO;QAChD;IAEA,kHAAkH;IACtH,GAAG;QAACH;QAAKD,MAAMK,CAAC;KAAC;IAEjB,qBAAO,KAACd;QAAae,WAAWd,QAAQe,IAAI;QAAEN,KAAKE;QAAY,GAAGH,KAAK;;AAC3E,GAAG"}
1
+ {"version":3,"sources":["../../../../src/components/Modal/ModalFooter.tsx"],"sourcesContent":["import {useRef, useEffect} from 'react';\nimport {Factory, factory} from '@mantine/core';\nimport {StickyFooter, type StickyFooterProps, type StickyFooterStylesNames} from '../StickyFooter/StickyFooter.js';\nimport classes from './ModalFooter.module.css';\n\nexport interface ModalFooterProps extends Omit<StickyFooterProps, 'variant'> {}\n\nexport type ModalFooterStylesNames = StickyFooterStylesNames;\n\nexport type ModalFooterFactory = Factory<{\n props: ModalFooterProps;\n ref: HTMLDivElement;\n stylesNames: ModalFooterStylesNames;\n}>;\n\nconst ensuresFooterHasEvenHeight = (footer: HTMLElement) => {\n const remainder = footer.offsetHeight % 2;\n footer.style.height = `${footer.offsetHeight - remainder + 2}px`;\n};\n\nexport const ModalFooter = factory<ModalFooterFactory>((props, ref) => {\n const _ref = useRef<HTMLDivElement>(null);\n\n const footerRef = ref || _ref;\n\n useEffect(() => {\n if (typeof footerRef !== 'function' && footerRef.current) {\n ensuresFooterHasEvenHeight(footerRef.current);\n }\n\n // if ref === 'function', this is a callback ref. Haven't found any solution for adjusting the height in this case\n }, [ref, props.h]);\n\n return <StickyFooter borderTop className={classes.root} ref={footerRef} {...props} />;\n});\n\nModalFooter.displayName = 'Modal.Footer';\n"],"names":["useRef","useEffect","factory","StickyFooter","classes","ensuresFooterHasEvenHeight","footer","remainder","offsetHeight","style","height","ModalFooter","props","ref","_ref","footerRef","current","h","borderTop","className","root","displayName"],"mappings":";AAAA,SAAQA,MAAM,EAAEC,SAAS,QAAO,QAAQ;AACxC,SAAiBC,OAAO,QAAO,gBAAgB;AAC/C,SAAQC,YAAY,QAA6D,kCAAkC;AACnH,OAAOC,aAAa,2BAA2B;AAY/C,MAAMC,6BAA6B,CAACC;IAChC,MAAMC,YAAYD,OAAOE,YAAY,GAAG;IACxCF,OAAOG,KAAK,CAACC,MAAM,GAAG,GAAGJ,OAAOE,YAAY,GAAGD,YAAY,EAAE,EAAE,CAAC;AACpE;AAEA,OAAO,MAAMI,cAAcT,QAA4B,CAACU,OAAOC;IAC3D,MAAMC,OAAOd,OAAuB;IAEpC,MAAMe,YAAYF,OAAOC;IAEzBb,UAAU;QACN,IAAI,OAAOc,cAAc,cAAcA,UAAUC,OAAO,EAAE;YACtDX,2BAA2BU,UAAUC,OAAO;QAChD;IAEA,kHAAkH;IACtH,GAAG;QAACH;QAAKD,MAAMK,CAAC;KAAC;IAEjB,qBAAO,KAACd;QAAae,SAAS;QAACC,WAAWf,QAAQgB,IAAI;QAAEP,KAAKE;QAAY,GAAGH,KAAK;;AACrF,GAAG;AAEHD,YAAYU,WAAW,GAAG"}
@@ -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
  }
@@ -1,49 +1,49 @@
1
1
  import { Factory, ModalRootProps, ModalStylesNames, StylesApiProps } from '@mantine/core';
2
- import { ReactNode } from 'react';
3
- import { PromptCancelButton, PromptCancelButtonStylesNamesVariant } from './PromptCancelButton.js';
4
- import { PromptConfirmButton, PromptConfirmButtonStylesNamesVariant } from './PromptConfirmButton.js';
5
- export type PromptVariant = 'success' | 'warning' | 'critical' | 'info';
2
+ import { FunctionComponent, ReactElement, ReactNode } from 'react';
3
+ import { PromptCancelButtonStylesNamesVariant } from './PromptCancelButton.js';
4
+ import { PromptConfirmButtonStylesNamesVariant } from './PromptConfirmButton.js';
5
+ export type PromptVariant = 'success' | 'warning' | 'critical' | 'information';
6
6
  export type PromptVars = {
7
7
  root: '--prompt-icon-size';
8
8
  };
9
9
  export type PromptStylesNames = Exclude<ModalStylesNames, 'title'> | 'icon' | PromptCancelButtonStylesNamesVariant | PromptConfirmButtonStylesNamesVariant;
10
- export interface PromptProps extends StylesApiProps<PromptFactory>, Omit<ModalRootProps, 'classNames' | 'styles' | 'vars' | 'attributes'> {
11
- /**
12
- * Controls prompt appearance
13
- *
14
- * @default "info"
15
- */
16
- variant?: PromptVariant;
10
+ type PromptStylesApiProps = Omit<StylesApiProps<PromptFactory>, 'variant'>;
11
+ export interface PromptProps extends PromptStylesApiProps, Omit<ModalRootProps, 'classNames' | 'styles' | 'vars' | 'attributes' | 'variant'> {
17
12
  children: ReactNode;
18
13
  title: ReactNode;
19
14
  }
15
+ interface PromptInternalProps extends PromptProps {
16
+ variant?: PromptVariant;
17
+ }
20
18
  export type PromptFactory = Factory<{
21
- props: PromptProps;
22
- ref: HTMLDivElement;
23
- vars: PromptVars;
24
- variant: PromptVariant;
25
- stylesNames: PromptStylesNames;
26
- staticComponents: {
27
- CancelButton: typeof PromptCancelButton;
28
- ConfirmButton: typeof PromptConfirmButton;
29
- Footer: typeof PromptFooter;
30
- };
31
- }>;
32
- export declare const Prompt: import("@mantine/core").MantineComponent<{
33
- props: PromptProps;
19
+ props: PromptInternalProps;
34
20
  ref: HTMLDivElement;
35
21
  vars: PromptVars;
36
22
  variant: PromptVariant;
37
23
  stylesNames: PromptStylesNames;
38
- staticComponents: {
39
- CancelButton: typeof PromptCancelButton;
40
- ConfirmButton: typeof PromptConfirmButton;
41
- Footer: typeof PromptFooter;
42
- };
43
- }>;
44
- declare const PromptFooter: import("react").ForwardRefExoticComponent<import("../Modal/ModalFooter.js").ModalFooterProps & import("react").RefAttributes<HTMLDivElement> & {
45
- component?: any;
46
- renderRoot?: (props: Record<string, any>) => React.ReactNode;
47
24
  }>;
25
+ type PromptCompoundComponent = ((props: PromptProps) => ReactElement) & Omit<FunctionComponent<PromptProps>, never>;
26
+ export declare const Prompt: {
27
+ readonly Information: PromptCompoundComponent;
28
+ readonly Success: PromptCompoundComponent;
29
+ readonly Warning: PromptCompoundComponent;
30
+ readonly Critical: PromptCompoundComponent;
31
+ readonly CancelButton: import("@mantine/core").MantineComponent<{
32
+ props: import("./PromptCancelButton.js").PromptCancelButtonProps;
33
+ ref: HTMLButtonElement;
34
+ stylesNames: PromptCancelButtonStylesNamesVariant;
35
+ compound: true;
36
+ }>;
37
+ readonly ConfirmButton: import("@mantine/core").MantineComponent<{
38
+ props: import("./PromptConfirmButton.js").PromptConfirmButtonProps;
39
+ ref: HTMLButtonElement;
40
+ stylesNames: PromptConfirmButtonStylesNamesVariant;
41
+ compound: true;
42
+ }>;
43
+ readonly Footer: FunctionComponent<import("../Modal/ModalFooter.js").ModalFooterProps & import("react").RefAttributes<HTMLDivElement> & {
44
+ component?: any;
45
+ renderRoot?: (props: Record<string, any>) => React.ReactNode;
46
+ }>;
47
+ };
48
48
  export {};
49
49
  //# sourceMappingURL=Prompt.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Prompt.d.ts","sourceRoot":"","sources":["../../../../src/components/Prompt/Prompt.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGH,OAAO,EACP,cAAc,EACd,gBAAgB,EAChB,cAAc,EAIjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAwC,SAAS,EAAC,MAAM,OAAO,CAAC;AAIvE,OAAO,EAAC,kBAAkB,EAAE,oCAAoC,EAAC,MAAM,yBAAyB,CAAC;AACjG,OAAO,EAAC,mBAAmB,EAAE,qCAAqC,EAAC,MAAM,0BAA0B,CAAC;AAMpG,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,GAAG,MAAM,CAAC;AACxE,MAAM,MAAM,UAAU,GAAG;IAAC,IAAI,EAAE,oBAAoB,CAAA;CAAC,CAAC;AACtD,MAAM,MAAM,iBAAiB,GACvB,OAAO,CAAC,gBAAgB,EAAE,OAAO,CAAC,GAClC,MAAM,GACN,oCAAoC,GACpC,qCAAqC,CAAC;AAE5C,MAAM,WAAW,WACb,SAAQ,cAAc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