@coveord/plasma-mantine 49.2.0 → 49.2.3

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 (186) hide show
  1. package/.eslintrc.js +9 -4
  2. package/.turbo/turbo-build.log +3 -3
  3. package/.turbo/turbo-test.log +35 -31
  4. package/{src/components/code-editor/__mocks__ → __mocks__}/@monaco-editor/react.tsx +6 -8
  5. package/{src/components/code-editor/__mocks__ → __mocks__}/monaco-editor.ts +0 -0
  6. package/dist/.tsbuildinfo +1 -1
  7. package/dist/cjs/__tests__/Utils.js.map +1 -1
  8. package/dist/cjs/__tests__/VitestSetup.js +35 -0
  9. package/dist/cjs/__tests__/VitestSetup.js.map +1 -0
  10. package/dist/cjs/components/blank-slate/BlankSlate.js.map +1 -1
  11. package/dist/cjs/components/blank-slate/index.js.map +1 -1
  12. package/dist/cjs/components/button/Button.js.map +1 -1
  13. package/dist/cjs/components/button/ButtonWithDisabledTooltip.js.map +1 -1
  14. package/dist/cjs/components/button/index.js.map +1 -1
  15. package/dist/cjs/components/code-editor/CodeEditor.js.map +1 -1
  16. package/dist/cjs/components/code-editor/index.js.map +1 -1
  17. package/dist/cjs/components/code-editor/languages/xml.js.map +1 -1
  18. package/dist/cjs/components/collection/Collection.js.map +1 -1
  19. package/dist/cjs/components/collection/Collection.styles.js.map +1 -1
  20. package/dist/cjs/components/collection/CollectionItem.js.map +1 -1
  21. package/dist/cjs/components/collection/index.js.map +1 -1
  22. package/dist/cjs/components/date-range-picker/DateRangePickerInlineCalendar.js.map +1 -1
  23. package/dist/cjs/components/date-range-picker/DateRangePickerPopoverCalendar.js.map +1 -1
  24. package/dist/cjs/components/date-range-picker/DateRangePickerPresetSelect.js.map +1 -1
  25. package/dist/cjs/components/date-range-picker/EditableDateRangePicker.js.map +1 -1
  26. package/dist/cjs/components/date-range-picker/index.js.map +1 -1
  27. package/dist/cjs/components/header/Header.js.map +1 -1
  28. package/dist/cjs/components/header/index.js.map +1 -1
  29. package/dist/cjs/components/index.js.map +1 -1
  30. package/dist/cjs/components/inline-confirm/InlineConfirm.js.map +1 -1
  31. package/dist/cjs/components/inline-confirm/InlineConfirmButton.js.map +1 -1
  32. package/dist/cjs/components/inline-confirm/InlineConfirmContext.js.map +1 -1
  33. package/dist/cjs/components/inline-confirm/InlineConfirmMenuItem.js.map +1 -1
  34. package/dist/cjs/components/inline-confirm/InlineConfirmPrompt.js.map +1 -1
  35. package/dist/cjs/components/inline-confirm/index.js.map +1 -1
  36. package/dist/cjs/components/inline-confirm/useInlineConfirm.js.map +1 -1
  37. package/dist/cjs/components/menu/Menu.js.map +1 -1
  38. package/dist/cjs/components/menu/index.js.map +1 -1
  39. package/dist/cjs/components/modal/Modal.js.map +1 -1
  40. package/dist/cjs/components/modal/index.js.map +1 -1
  41. package/dist/cjs/components/modal-wizard/ModalWizard.js.map +1 -1
  42. package/dist/cjs/components/modal-wizard/ModalWizardStep.js.map +1 -1
  43. package/dist/cjs/components/modal-wizard/index.js.map +1 -1
  44. package/dist/cjs/components/prompt/Prompt.js.map +1 -1
  45. package/dist/cjs/components/prompt/PromptFooter.js.map +1 -1
  46. package/dist/cjs/components/prompt/index.js.map +1 -1
  47. package/dist/cjs/components/sticky-footer/StickyFooter.js.map +1 -1
  48. package/dist/cjs/components/sticky-footer/index.js.map +1 -1
  49. package/dist/cjs/components/table/Table.js.map +1 -1
  50. package/dist/cjs/components/table/TableActions.js.map +1 -1
  51. package/dist/cjs/components/table/TableCollapsibleColumn.js.map +1 -1
  52. package/dist/cjs/components/table/TableContext.js.map +1 -1
  53. package/dist/cjs/components/table/TableDateRangePicker.js.map +1 -1
  54. package/dist/cjs/components/table/TableFilter.js.map +1 -1
  55. package/dist/cjs/components/table/TableFooter.js.map +1 -1
  56. package/dist/cjs/components/table/TableHeader.js.map +1 -1
  57. package/dist/cjs/components/table/TablePagination.js.map +1 -1
  58. package/dist/cjs/components/table/TablePerPage.js.map +1 -1
  59. package/dist/cjs/components/table/TablePredicate.js.map +1 -1
  60. package/dist/cjs/components/table/TableSelectableColumn.js.map +1 -1
  61. package/dist/cjs/components/table/Th.js.map +1 -1
  62. package/dist/cjs/components/table/index.js.map +1 -1
  63. package/dist/cjs/components/table/useRowSelection.js.map +1 -1
  64. package/dist/cjs/components/table/useTable.js.map +1 -1
  65. package/dist/cjs/form/FormProvider.js.map +1 -1
  66. package/dist/cjs/form/index.js.map +1 -1
  67. package/dist/cjs/form/useForm.js.map +1 -1
  68. package/dist/cjs/hooks/index.js.map +1 -1
  69. package/dist/cjs/hooks/useControlledList.js.map +1 -1
  70. package/dist/cjs/hooks/useParentHeight.js.map +1 -1
  71. package/dist/cjs/index.js.map +1 -1
  72. package/dist/cjs/theme/PlasmaColors.js.map +1 -1
  73. package/dist/cjs/theme/Plasmantine.js.map +1 -1
  74. package/dist/cjs/theme/Theme.js.map +1 -1
  75. package/dist/cjs/theme/index.js.map +1 -1
  76. package/dist/cjs/utils/createPolymorphicComponent.js.map +1 -1
  77. package/dist/cjs/utils/index.js.map +1 -1
  78. package/dist/cjs/utils/overrideComponent.js.map +1 -1
  79. package/dist/definitions/__tests__/Utils.d.ts +1 -1
  80. package/dist/definitions/__tests__/Utils.d.ts.map +1 -1
  81. package/dist/definitions/__tests__/VitestSetup.d.ts +2 -0
  82. package/dist/definitions/__tests__/VitestSetup.d.ts.map +1 -0
  83. package/dist/esm/__tests__/Utils.js +1 -1
  84. package/dist/esm/__tests__/Utils.js.map +1 -1
  85. package/dist/esm/__tests__/VitestSetup.js +30 -0
  86. package/dist/esm/__tests__/VitestSetup.js.map +1 -0
  87. package/dist/esm/components/blank-slate/BlankSlate.js.map +1 -1
  88. package/dist/esm/components/button/Button.js.map +1 -1
  89. package/dist/esm/components/button/ButtonWithDisabledTooltip.js.map +1 -1
  90. package/dist/esm/components/code-editor/CodeEditor.js.map +1 -1
  91. package/dist/esm/components/code-editor/languages/xml.js.map +1 -1
  92. package/dist/esm/components/collection/Collection.js.map +1 -1
  93. package/dist/esm/components/collection/CollectionItem.js.map +1 -1
  94. package/dist/esm/components/date-range-picker/DateRangePickerInlineCalendar.js.map +1 -1
  95. package/dist/esm/components/date-range-picker/DateRangePickerPopoverCalendar.js.map +1 -1
  96. package/dist/esm/components/date-range-picker/DateRangePickerPresetSelect.js.map +1 -1
  97. package/dist/esm/components/date-range-picker/EditableDateRangePicker.js.map +1 -1
  98. package/dist/esm/components/header/Header.js.map +1 -1
  99. package/dist/esm/components/inline-confirm/InlineConfirm.js.map +1 -1
  100. package/dist/esm/components/inline-confirm/InlineConfirmButton.js.map +1 -1
  101. package/dist/esm/components/inline-confirm/InlineConfirmMenuItem.js.map +1 -1
  102. package/dist/esm/components/inline-confirm/InlineConfirmPrompt.js.map +1 -1
  103. package/dist/esm/components/menu/Menu.js.map +1 -1
  104. package/dist/esm/components/modal/Modal.js.map +1 -1
  105. package/dist/esm/components/modal-wizard/ModalWizard.js.map +1 -1
  106. package/dist/esm/components/prompt/Prompt.js.map +1 -1
  107. package/dist/esm/components/prompt/PromptFooter.js.map +1 -1
  108. package/dist/esm/components/sticky-footer/StickyFooter.js.map +1 -1
  109. package/dist/esm/components/table/Table.js.map +1 -1
  110. package/dist/esm/components/table/TableActions.js.map +1 -1
  111. package/dist/esm/components/table/TableCollapsibleColumn.js.map +1 -1
  112. package/dist/esm/components/table/TableDateRangePicker.js.map +1 -1
  113. package/dist/esm/components/table/TableFilter.js.map +1 -1
  114. package/dist/esm/components/table/TableFooter.js.map +1 -1
  115. package/dist/esm/components/table/TableHeader.js.map +1 -1
  116. package/dist/esm/components/table/TablePagination.js.map +1 -1
  117. package/dist/esm/components/table/TablePerPage.js.map +1 -1
  118. package/dist/esm/components/table/TablePredicate.js.map +1 -1
  119. package/dist/esm/components/table/TableSelectableColumn.js.map +1 -1
  120. package/dist/esm/components/table/Th.js.map +1 -1
  121. package/dist/esm/components/table/useRowSelection.js.map +1 -1
  122. package/dist/esm/form/FormProvider.js.map +1 -1
  123. package/dist/esm/form/useForm.js.map +1 -1
  124. package/dist/esm/hooks/useControlledList.js.map +1 -1
  125. package/dist/esm/hooks/useParentHeight.js.map +1 -1
  126. package/dist/esm/theme/Plasmantine.js.map +1 -1
  127. package/dist/esm/theme/Theme.js.map +1 -1
  128. package/dist/esm/utils/overrideComponent.js.map +1 -1
  129. package/package.json +9 -8
  130. package/src/__tests__/Utils.tsx +1 -1
  131. package/src/__tests__/VitestSetup.ts +27 -0
  132. package/src/components/code-editor/__tests__/CodeEditor.spec.tsx +7 -5
  133. package/src/components/collection/__tests__/Collection.spec.tsx +2 -2
  134. package/src/components/date-range-picker/__tests__/DateRangePickerInlineCalendar.spec.tsx +17 -17
  135. package/src/components/date-range-picker/__tests__/DateRangePickerPopoverCalendar.spec.tsx +11 -7
  136. package/src/components/date-range-picker/__tests__/DateRangePickerPresetSelect.spec.tsx +1 -1
  137. package/src/components/inline-confirm/__tests__/InlineConfirm.spec.tsx +6 -6
  138. package/src/components/modal/__tests__/Modal.spec.tsx +3 -3
  139. package/src/components/modal-wizard/__tests__/ModalWizard.spec.tsx +8 -8
  140. package/src/components/prompt/__tests__/Prompt.spec.tsx +2 -2
  141. package/src/components/table/__tests__/Table.spec.tsx +1 -1
  142. package/src/components/table/__tests__/TableActions.spec.tsx +1 -1
  143. package/src/components/table/__tests__/TableDateRangePicker.spec.tsx +11 -8
  144. package/src/components/table/__tests__/TableFilter.spec.tsx +4 -4
  145. package/src/components/table/__tests__/TablePagination.spec.tsx +2 -2
  146. package/src/components/table/__tests__/TablePerPage.spec.tsx +3 -3
  147. package/src/components/table/__tests__/TablePredicate.spec.tsx +2 -2
  148. package/src/components/table/__tests__/Th.spec.tsx +1 -1
  149. package/src/hooks/__tests__/useControlledList.spec.tsx +1 -1
  150. package/tsconfig.build.json +2 -1
  151. package/tsconfig.json +3 -2
  152. package/vitest.config.ts +24 -0
  153. package/dist/cjs/__tests__/GlobalSetup.js +0 -17
  154. package/dist/cjs/__tests__/GlobalSetup.js.map +0 -1
  155. package/dist/cjs/__tests__/Setup.js +0 -6
  156. package/dist/cjs/__tests__/Setup.js.map +0 -1
  157. package/dist/cjs/__tests__/SetupAfterEnv.js +0 -19
  158. package/dist/cjs/__tests__/SetupAfterEnv.js.map +0 -1
  159. package/dist/cjs/components/code-editor/__mocks__/@monaco-editor/react.js +0 -45
  160. package/dist/cjs/components/code-editor/__mocks__/@monaco-editor/react.js.map +0 -1
  161. package/dist/cjs/components/code-editor/__mocks__/monaco-editor.js +0 -24
  162. package/dist/cjs/components/code-editor/__mocks__/monaco-editor.js.map +0 -1
  163. package/dist/definitions/__tests__/GlobalSetup.d.ts +0 -3
  164. package/dist/definitions/__tests__/GlobalSetup.d.ts.map +0 -1
  165. package/dist/definitions/__tests__/Setup.d.ts +0 -5
  166. package/dist/definitions/__tests__/Setup.d.ts.map +0 -1
  167. package/dist/definitions/__tests__/SetupAfterEnv.d.ts +0 -7
  168. package/dist/definitions/__tests__/SetupAfterEnv.d.ts.map +0 -1
  169. package/dist/definitions/components/code-editor/__mocks__/@monaco-editor/react.d.ts +0 -10
  170. package/dist/definitions/components/code-editor/__mocks__/@monaco-editor/react.d.ts.map +0 -1
  171. package/dist/definitions/components/code-editor/__mocks__/monaco-editor.d.ts +0 -8
  172. package/dist/definitions/components/code-editor/__mocks__/monaco-editor.d.ts.map +0 -1
  173. package/dist/esm/__tests__/GlobalSetup.js +0 -7
  174. package/dist/esm/__tests__/GlobalSetup.js.map +0 -1
  175. package/dist/esm/__tests__/Setup.js +0 -5
  176. package/dist/esm/__tests__/Setup.js.map +0 -1
  177. package/dist/esm/__tests__/SetupAfterEnv.js +0 -15
  178. package/dist/esm/__tests__/SetupAfterEnv.js.map +0 -1
  179. package/dist/esm/components/code-editor/__mocks__/@monaco-editor/react.js +0 -24
  180. package/dist/esm/components/code-editor/__mocks__/@monaco-editor/react.js.map +0 -1
  181. package/dist/esm/components/code-editor/__mocks__/monaco-editor.js +0 -14
  182. package/dist/esm/components/code-editor/__mocks__/monaco-editor.js.map +0 -1
  183. package/jest.config.js +0 -26
  184. package/src/__tests__/GlobalSetup.ts +0 -5
  185. package/src/__tests__/Setup.ts +0 -4
  186. package/src/__tests__/SetupAfterEnv.ts +0 -16
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/hooks/useControlledList.ts"],"sourcesContent":["import {useUncontrolled} from '@mantine/hooks';\n\ninterface UseControlledList<T> {\n /** Initial value for uncontrolled state */\n defaultValue?: T[];\n /** Value for controlled state */\n value?: T[];\n /** Controlled state onChange handler */\n onChange?: (values: T[]) => void;\n}\n\ninterface ListHandlers<T> {\n /** Appends the item at the end of the list */\n append: (item: T) => void;\n /** Removes the item at the index from the list */\n remove: (index: number) => void;\n /** Moves the item at the \"from\" position to another position within the list */\n reorder: ({from, to}: {from: number; to: number}) => void;\n}\n\n/**\n * Manage a list of items in a controlled fashion, to be used with inputs\n */\nexport const useControlledList = <T>({defaultValue, value, onChange}: UseControlledList<T>): [T[], ListHandlers<T>] => {\n const [values, handleChange] = useUncontrolled({\n value,\n defaultValue,\n finalValue: [],\n onChange,\n });\n\n const remove = (index: number) => {\n const newValues = values.filter((_, i) => i !== index);\n handleChange?.(newValues);\n };\n\n const append = (item: T) => {\n const newValues = [...values, item];\n handleChange?.(newValues);\n };\n\n const reorder = ({from, to}: {from: number; to: number}) => {\n const newValues = [...values];\n const item = values[from];\n\n newValues.splice(from, 1);\n newValues.splice(to, 0, item);\n\n handleChange?.(newValues);\n };\n\n return [values, {remove, append, reorder}];\n};\n"],"names":["useUncontrolled","useControlledList","defaultValue","value","onChange","finalValue","values","handleChange","remove","index","newValues","filter","_","i","append","item","reorder","from","to","splice"],"mappings":"AAAA;;AAAA,SAAQA,eAAe,QAAO,iBAAiB;AAoB/C;;CAEC,GACD,OAAO,IAAMC,oBAAoB,gBAAsF;QAAjFC,qBAAAA,cAAcC,cAAAA,OAAOC,iBAAAA;IACvD,IAA+BJ,oCAAAA,gBAAgB;QAC3CG,OAAAA;QACAD,cAAAA;QACAG,YAAY,EAAE;QACdD,UAAAA;IACJ,QALOE,SAAwBN,qBAAhBO,eAAgBP;IAO/B,IAAMQ,SAAS,SAACC,OAAkB;QAC9B,IAAMC,YAAYJ,OAAOK,MAAM,CAAC,SAACC,GAAGC;mBAAMA,MAAMJ;;QAChDF,yBAAAA,0BAAAA,KAAAA,IAAAA,aAAeG;IACnB;IAEA,IAAMI,SAAS,SAACC,MAAY;QACxB,IAAML,YAAY,AAAC,qBAAGJ,eAAJ;YAAYS;SAAK;QACnCR,yBAAAA,0BAAAA,KAAAA,IAAAA,aAAeG;IACnB;IAEA,IAAMM,UAAU,gBAA4C;YAA1CC,aAAAA,MAAMC,WAAAA;QACpB,IAAMR,YAAa,qBAAGJ;QACtB,IAAMS,OAAOT,MAAM,CAACW,KAAK;QAEzBP,UAAUS,MAAM,CAACF,MAAM;QACvBP,UAAUS,MAAM,CAACD,IAAI,GAAGH;QAExBR,yBAAAA,0BAAAA,KAAAA,IAAAA,aAAeG;IACnB;IAEA,OAAO;QAACJ;QAAQ;YAACE,QAAAA;YAAQM,QAAAA;YAAQE,SAAAA;QAAO;KAAE;AAC9C,EAAE"}
1
+ {"version":3,"sources":["../../../src/hooks/useControlledList.ts"],"sourcesContent":["import {useUncontrolled} from '@mantine/hooks';\n\ninterface UseControlledList<T> {\n /** Initial value for uncontrolled state */\n defaultValue?: T[];\n /** Value for controlled state */\n value?: T[];\n /** Controlled state onChange handler */\n onChange?: (values: T[]) => void;\n}\n\ninterface ListHandlers<T> {\n /** Appends the item at the end of the list */\n append: (item: T) => void;\n /** Removes the item at the index from the list */\n remove: (index: number) => void;\n /** Moves the item at the \"from\" position to another position within the list */\n reorder: ({from, to}: {from: number; to: number}) => void;\n}\n\n/**\n * Manage a list of items in a controlled fashion, to be used with inputs\n */\nexport const useControlledList = <T>({defaultValue, value, onChange}: UseControlledList<T>): [T[], ListHandlers<T>] => {\n const [values, handleChange] = useUncontrolled({\n value,\n defaultValue,\n finalValue: [],\n onChange,\n });\n\n const remove = (index: number) => {\n const newValues = values.filter((_, i) => i !== index);\n handleChange?.(newValues);\n };\n\n const append = (item: T) => {\n const newValues = [...values, item];\n handleChange?.(newValues);\n };\n\n const reorder = ({from, to}: {from: number; to: number}) => {\n const newValues = [...values];\n const item = values[from];\n\n newValues.splice(from, 1);\n newValues.splice(to, 0, item);\n\n handleChange?.(newValues);\n };\n\n return [values, {remove, append, reorder}];\n};\n"],"names":["useUncontrolled","useControlledList","defaultValue","value","onChange","finalValue","values","handleChange","remove","index","newValues","filter","_","i","append","item","reorder","from","to","splice"],"mappings":";;AAAA,SAAQA,eAAe,QAAO,iBAAiB;AAoB/C;;CAEC,GACD,OAAO,IAAMC,oBAAoB,gBAAsF;QAAjFC,qBAAAA,cAAcC,cAAAA,OAAOC,iBAAAA;IACvD,IAA+BJ,oCAAAA,gBAAgB;QAC3CG,OAAAA;QACAD,cAAAA;QACAG,YAAY,EAAE;QACdD,UAAAA;IACJ,QALOE,SAAwBN,qBAAhBO,eAAgBP;IAO/B,IAAMQ,SAAS,SAACC,OAAkB;QAC9B,IAAMC,YAAYJ,OAAOK,MAAM,CAAC,SAACC,GAAGC;mBAAMA,MAAMJ;;QAChDF,yBAAAA,0BAAAA,KAAAA,IAAAA,aAAeG;IACnB;IAEA,IAAMI,SAAS,SAACC,MAAY;QACxB,IAAML,YAAY,AAAC,qBAAGJ,eAAJ;YAAYS;SAAK;QACnCR,yBAAAA,0BAAAA,KAAAA,IAAAA,aAAeG;IACnB;IAEA,IAAMM,UAAU,gBAA4C;YAA1CC,aAAAA,MAAMC,WAAAA;QACpB,IAAMR,YAAa,qBAAGJ;QACtB,IAAMS,OAAOT,MAAM,CAACW,KAAK;QAEzBP,UAAUS,MAAM,CAACF,MAAM;QACvBP,UAAUS,MAAM,CAACD,IAAI,GAAGH;QAExBR,yBAAAA,0BAAAA,KAAAA,IAAAA,aAAeG;IACnB;IAEA,OAAO;QAACJ;QAAQ;YAACE,QAAAA;YAAQM,QAAAA;YAAQE,SAAAA;QAAO;KAAE;AAC9C,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/hooks/useParentHeight.ts"],"sourcesContent":["import {useEffect, useRef, useState} from 'react';\n\nconst getElementInnerHeight = (el: HTMLElement): number => {\n const fullHeight = el.getBoundingClientRect().height;\n const cs = getComputedStyle(el);\n const padding = parseFloat(cs.paddingTop) + parseFloat(cs.paddingBottom);\n const border = parseFloat(cs.borderTopWidth) + parseFloat(cs.borderBottomWidth);\n return fullHeight - padding - border;\n};\n\n/**\n * Computes the available height of the parent element on mount\n */\nexport const useParentHeight = (): [number, React.MutableRefObject<HTMLDivElement>] => {\n const [height, setHeight] = useState(-1);\n const ref = useRef<HTMLDivElement>();\n\n useEffect(() => {\n if (ref.current) {\n setHeight(getElementInnerHeight(ref.current.parentElement));\n }\n }, [ref.current]);\n\n return [height, ref];\n};\n"],"names":["useEffect","useRef","useState","getElementInnerHeight","el","fullHeight","getBoundingClientRect","height","cs","getComputedStyle","padding","parseFloat","paddingTop","paddingBottom","border","borderTopWidth","borderBottomWidth","useParentHeight","setHeight","ref","current","parentElement"],"mappings":"AAAA;AAAA,SAAQA,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAO,QAAQ;AAElD,IAAMC,wBAAwB,SAACC,IAA4B;IACvD,IAAMC,aAAaD,GAAGE,qBAAqB,GAAGC,MAAM;IACpD,IAAMC,KAAKC,iBAAiBL;IAC5B,IAAMM,UAAUC,WAAWH,GAAGI,UAAU,IAAID,WAAWH,GAAGK,aAAa;IACvE,IAAMC,SAASH,WAAWH,GAAGO,cAAc,IAAIJ,WAAWH,GAAGQ,iBAAiB;IAC9E,OAAOX,aAAaK,UAAUI;AAClC;AAEA;;CAEC,GACD,OAAO,IAAMG,kBAAkB,WAAwD;IACnF,IAA4Bf,6BAAAA,SAAS,CAAC,QAA/BK,SAAqBL,cAAbgB,YAAahB;IAC5B,IAAMiB,MAAMlB;IAEZD,UAAU,WAAM;QACZ,IAAImB,IAAIC,OAAO,EAAE;YACbF,UAAUf,sBAAsBgB,IAAIC,OAAO,CAACC,aAAa;QAC7D,CAAC;IACL,GAAG;QAACF,IAAIC,OAAO;KAAC;IAEhB,OAAO;QAACb;QAAQY;KAAI;AACxB,EAAE"}
1
+ {"version":3,"sources":["../../../src/hooks/useParentHeight.ts"],"sourcesContent":["import {useEffect, useRef, useState} from 'react';\n\nconst getElementInnerHeight = (el: HTMLElement): number => {\n const fullHeight = el.getBoundingClientRect().height;\n const cs = getComputedStyle(el);\n const padding = parseFloat(cs.paddingTop) + parseFloat(cs.paddingBottom);\n const border = parseFloat(cs.borderTopWidth) + parseFloat(cs.borderBottomWidth);\n return fullHeight - padding - border;\n};\n\n/**\n * Computes the available height of the parent element on mount\n */\nexport const useParentHeight = (): [number, React.MutableRefObject<HTMLDivElement>] => {\n const [height, setHeight] = useState(-1);\n const ref = useRef<HTMLDivElement>();\n\n useEffect(() => {\n if (ref.current) {\n setHeight(getElementInnerHeight(ref.current.parentElement));\n }\n }, [ref.current]);\n\n return [height, ref];\n};\n"],"names":["useEffect","useRef","useState","getElementInnerHeight","el","fullHeight","getBoundingClientRect","height","cs","getComputedStyle","padding","parseFloat","paddingTop","paddingBottom","border","borderTopWidth","borderBottomWidth","useParentHeight","setHeight","ref","current","parentElement"],"mappings":";AAAA,SAAQA,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAO,QAAQ;AAElD,IAAMC,wBAAwB,SAACC,IAA4B;IACvD,IAAMC,aAAaD,GAAGE,qBAAqB,GAAGC,MAAM;IACpD,IAAMC,KAAKC,iBAAiBL;IAC5B,IAAMM,UAAUC,WAAWH,GAAGI,UAAU,IAAID,WAAWH,GAAGK,aAAa;IACvE,IAAMC,SAASH,WAAWH,GAAGO,cAAc,IAAIJ,WAAWH,GAAGQ,iBAAiB;IAC9E,OAAOX,aAAaK,UAAUI;AAClC;AAEA;;CAEC,GACD,OAAO,IAAMG,kBAAkB,WAAwD;IACnF,IAA4Bf,6BAAAA,SAAS,CAAC,QAA/BK,SAAqBL,cAAbgB,YAAahB;IAC5B,IAAMiB,MAAMlB;IAEZD,UAAU,WAAM;QACZ,IAAImB,IAAIC,OAAO,EAAE;YACbF,UAAUf,sBAAsBgB,IAAIC,OAAO,CAACC,aAAa;QAC7D,CAAC;IACL,GAAG;QAACF,IAAIC,OAAO;KAAC;IAEhB,OAAO;QAACb;QAAQY;KAAI;AACxB,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/theme/Plasmantine.tsx"],"sourcesContent":["import {MantineProvider} from '@mantine/core';\nimport {FunctionComponent, PropsWithChildren} from 'react';\n\nimport {plasmaTheme} from './Theme';\n\nexport const Plasmantine: FunctionComponent<PropsWithChildren> = ({children}) => (\n <MantineProvider withGlobalStyles withNormalizeCSS theme={plasmaTheme}>\n {children}\n </MantineProvider>\n);\n"],"names":["MantineProvider","plasmaTheme","Plasmantine","children","withGlobalStyles","withNormalizeCSS","theme"],"mappings":"AAAA;AAAA,SAAQA,eAAe,QAAO,gBAAgB;AAG9C,SAAQC,WAAW,QAAO,UAAU;AAEpC,OAAO,IAAMC,cAAoD;QAAEC,iBAAAA;yBAC/D,KAACH;QAAgBI,gBAAgB;QAACC,gBAAgB;QAACC,OAAOL;kBACrDE;;EAEP"}
1
+ {"version":3,"sources":["../../../src/theme/Plasmantine.tsx"],"sourcesContent":["import {MantineProvider} from '@mantine/core';\nimport {FunctionComponent, PropsWithChildren} from 'react';\n\nimport {plasmaTheme} from './Theme';\n\nexport const Plasmantine: FunctionComponent<PropsWithChildren> = ({children}) => (\n <MantineProvider withGlobalStyles withNormalizeCSS theme={plasmaTheme}>\n {children}\n </MantineProvider>\n);\n"],"names":["MantineProvider","plasmaTheme","Plasmantine","children","withGlobalStyles","withNormalizeCSS","theme"],"mappings":";AAAA,SAAQA,eAAe,QAAO,gBAAgB;AAG9C,SAAQC,WAAW,QAAO,UAAU;AAEpC,OAAO,IAAMC,cAAoD;QAAEC,iBAAAA;yBAC/D,KAACH;QAAgBI,gBAAgB;QAACC,gBAAgB;QAACC,OAAOL;kBACrDE;;EAEP"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/theme/Theme.tsx"],"sourcesContent":["import {ArrowHeadRightSize24Px, InfoSize24Px} from '@coveord/plasma-react-icons';\nimport {color} from '@coveord/plasma-tokens';\nimport {ButtonStylesParams, MantineThemeOverride, ModalStylesParams} from '@mantine/core';\n\nimport {PlasmaColors} from './PlasmaColors';\n\nexport const plasmaTheme: MantineThemeOverride = {\n // These are overrides over https://github.com/mantinedev/mantine/blob/master/src/mantine-styles/src/theme/default-theme.ts\n colorScheme: 'light',\n fontFamily: 'canada-type-gibson, sans-serif',\n black: color.primary.gray[9],\n defaultRadius: 8,\n spacing: {\n xs: 8,\n sm: 16,\n md: 24,\n lg: 32,\n xl: 40,\n },\n primaryColor: 'action',\n headings: {\n fontFamily: 'canada-type-gibson, sans-serif',\n fontWeight: 500,\n sizes: {\n h1: {fontSize: 48, lineHeight: '56px', fontWeight: undefined},\n h2: {fontSize: 32, lineHeight: '40px', fontWeight: undefined},\n h3: {fontSize: 28, lineHeight: '40px', fontWeight: undefined},\n h4: {fontSize: 24, lineHeight: '32px', fontWeight: undefined},\n h5: {fontSize: 18, lineHeight: '28px', fontWeight: undefined},\n h6: {fontSize: 16, lineHeight: '24px', fontWeight: undefined},\n },\n },\n shadows: {\n xs: '0px 1px 0px rgba(4, 8, 31, 0.08)',\n sm: '0px 2px 4px rgba(4, 8, 31, 0.12)',\n md: '0px 4px 8px rgba(4, 8, 31, 0.08)',\n lg: '0px 8px 16px rgba(7, 12, 41, 0.06)',\n xl: '0px 16px 24px rgba(4, 8, 31, 0.06)',\n },\n colors: PlasmaColors,\n components: {\n Alert: {\n defaultProps: {\n icon: <InfoSize24Px height={24} />,\n color: 'navy',\n },\n styles: {\n title: {\n fontWeight: 500,\n },\n },\n },\n Title: {\n styles: (theme) => ({\n root: {\n '&:is(h1,h2,h3,h4,h5,h6)': {letterSpacing: '0.011em', color: theme.colors.gray[9]},\n },\n }),\n },\n Button: {\n styles: (theme, params: ButtonStylesParams) => ({\n root: {\n fontWeight: 400,\n backgroundColor: params.variant === 'outline' ? 'white' : undefined,\n },\n }),\n },\n Modal: {\n styles: (theme, {size, fullScreen}: ModalStylesParams) => ({\n modal: {\n width: fullScreen\n ? undefined\n : theme.fn.size({size, sizes: {xs: 440, sm: 550, md: 800, lg: 1334, xl: '85%'}}),\n },\n }),\n defaultProps: {\n overlayColor: color.primary.navy[9],\n overlayOpacity: 0.9,\n },\n },\n InputWrapper: {\n defaultProps: {\n withAsterisk: false,\n },\n styles: (theme) => ({\n label: {\n marginBottom: theme.spacing.xs,\n lineHeight: '20px',\n },\n description: {\n lineHeight: '20px',\n fontSize: theme.fontSizes.sm,\n color: theme.colors.gray[7],\n marginBottom: theme.spacing.xs,\n },\n invalid: {\n color: theme.colors.red[9],\n borderColor: theme.colors.red[6],\n },\n error: {\n color: theme.colors.red[9],\n },\n }),\n },\n TextInput: {\n defaultProps: {\n radius: 8,\n },\n },\n Tooltip: {\n defaultProps: {\n color: 'navy',\n withArrow: true,\n withinPortal: true,\n multiline: true,\n },\n },\n Breadcrumbs: {\n defaultProps: {\n separator: <ArrowHeadRightSize24Px height={24} />,\n },\n },\n Loader: {\n defaultProps: {\n variant: 'dots',\n color: 'action',\n },\n },\n DateRangePicker: {\n styles: {\n cell: {\n textAlign: 'center',\n },\n },\n },\n Anchor: {\n defaultProps: {\n color: 'action',\n },\n styles: (theme) => ({\n root: {\n ...theme.fn.hover({\n textDecoration: 'underline',\n color: theme.colors.action[8],\n }),\n },\n }),\n },\n Checkbox: {\n defaultProps: {\n radius: 'sm',\n },\n },\n List: {\n styles: () => ({\n root: {\n listStyleType: 'disc',\n },\n }),\n },\n Radio: {\n styles: {\n labelWrapper: {\n display: 'flex',\n alignItems: 'flex-start',\n },\n },\n },\n Popover: {\n defaultProps: {\n shadow: 'md',\n withArrow: true,\n },\n },\n Badge: {\n styles: {\n root: {\n textTransform: 'none',\n padding: '4px 8px',\n fontWeight: 500,\n },\n },\n },\n ColorSwatch: {\n defaultProps: {\n size: 8,\n withShadow: false,\n },\n },\n MenuItem: {\n defaultProps: {\n fw: 300,\n },\n },\n },\n};\n"],"names":["ArrowHeadRightSize24Px","InfoSize24Px","color","PlasmaColors","plasmaTheme","colorScheme","fontFamily","black","primary","gray","defaultRadius","spacing","xs","sm","md","lg","xl","primaryColor","headings","fontWeight","sizes","h1","fontSize","lineHeight","undefined","h2","h3","h4","h5","h6","shadows","colors","components","Alert","defaultProps","icon","height","styles","title","Title","theme","root","letterSpacing","Button","params","backgroundColor","variant","Modal","size","fullScreen","modal","width","fn","overlayColor","navy","overlayOpacity","InputWrapper","withAsterisk","label","marginBottom","description","fontSizes","invalid","red","borderColor","error","TextInput","radius","Tooltip","withArrow","withinPortal","multiline","Breadcrumbs","separator","Loader","DateRangePicker","cell","textAlign","Anchor","hover","textDecoration","action","Checkbox","List","listStyleType","Radio","labelWrapper","display","alignItems","Popover","shadow","Badge","textTransform","padding","ColorSwatch","withShadow","MenuItem","fw"],"mappings":"AAAA;;AAAA,SAAQA,sBAAsB,EAAEC,YAAY,QAAO,8BAA8B;AACjF,SAAQC,KAAK,QAAO,yBAAyB;AAG7C,SAAQC,YAAY,QAAO,iBAAiB;AAE5C,OAAO,IAAMC,cAAoC;IAC7C,2HAA2H;IAC3HC,aAAa;IACbC,YAAY;IACZC,OAAOL,MAAMM,OAAO,CAACC,IAAI,CAAC,EAAE;IAC5BC,eAAe;IACfC,SAAS;QACLC,IAAI;QACJC,IAAI;QACJC,IAAI;QACJC,IAAI;QACJC,IAAI;IACR;IACAC,cAAc;IACdC,UAAU;QACNZ,YAAY;QACZa,YAAY;QACZC,OAAO;YACHC,IAAI;gBAACC,UAAU;gBAAIC,YAAY;gBAAQJ,YAAYK;YAAS;YAC5DC,IAAI;gBAACH,UAAU;gBAAIC,YAAY;gBAAQJ,YAAYK;YAAS;YAC5DE,IAAI;gBAACJ,UAAU;gBAAIC,YAAY;gBAAQJ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F2C,eAAe;oBACnB;gBACJ;;QACJ;QACAC,OAAO;YACHhD,QAAQ;gBACJiD,cAAc;oBACVC,SAAS;oBACTC,YAAY;gBAChB;YACJ;QACJ;QACAC,SAAS;YACLvD,cAAc;gBACVwD,QAAQ;gBACRrB,WAAW,IAAI;YACnB;QACJ;QACAsB,OAAO;YACHtD,QAAQ;gBACJI,MAAM;oBACFmD,eAAe;oBACfC,SAAS;oBACT1E,YAAY;gBAChB;YACJ;QACJ;QACA2E,aAAa;YACT5D,cAAc;gBACVc,MAAM;gBACN+C,YAAY,KAAK;YACrB;QACJ;QACAC,UAAU;YACN9D,cAAc;gBACV+D,IAAI;YACR;QACJ;IACJ;AACJ,EAAE"}
1
+ {"version":3,"sources":["../../../src/theme/Theme.tsx"],"sourcesContent":["import {ArrowHeadRightSize24Px, InfoSize24Px} from '@coveord/plasma-react-icons';\nimport {color} from '@coveord/plasma-tokens';\nimport {ButtonStylesParams, MantineThemeOverride, ModalStylesParams} from '@mantine/core';\n\nimport {PlasmaColors} from './PlasmaColors';\n\nexport const plasmaTheme: MantineThemeOverride = {\n // These are overrides over https://github.com/mantinedev/mantine/blob/master/src/mantine-styles/src/theme/default-theme.ts\n colorScheme: 'light',\n fontFamily: 'canada-type-gibson, sans-serif',\n black: color.primary.gray[9],\n defaultRadius: 8,\n spacing: {\n xs: 8,\n sm: 16,\n md: 24,\n lg: 32,\n xl: 40,\n },\n primaryColor: 'action',\n headings: {\n fontFamily: 'canada-type-gibson, sans-serif',\n fontWeight: 500,\n sizes: {\n h1: {fontSize: 48, lineHeight: '56px', fontWeight: undefined},\n h2: {fontSize: 32, lineHeight: '40px', fontWeight: undefined},\n h3: {fontSize: 28, lineHeight: '40px', fontWeight: undefined},\n h4: {fontSize: 24, lineHeight: '32px', fontWeight: undefined},\n h5: {fontSize: 18, lineHeight: '28px', fontWeight: undefined},\n h6: {fontSize: 16, lineHeight: '24px', fontWeight: undefined},\n },\n },\n shadows: {\n xs: '0px 1px 0px rgba(4, 8, 31, 0.08)',\n sm: '0px 2px 4px rgba(4, 8, 31, 0.12)',\n md: '0px 4px 8px rgba(4, 8, 31, 0.08)',\n lg: '0px 8px 16px rgba(7, 12, 41, 0.06)',\n xl: '0px 16px 24px rgba(4, 8, 31, 0.06)',\n },\n colors: PlasmaColors,\n components: {\n Alert: {\n defaultProps: {\n icon: <InfoSize24Px height={24} />,\n color: 'navy',\n },\n styles: {\n title: {\n fontWeight: 500,\n },\n },\n },\n Title: {\n styles: (theme) => ({\n root: {\n '&:is(h1,h2,h3,h4,h5,h6)': {letterSpacing: '0.011em', color: theme.colors.gray[9]},\n },\n }),\n },\n Button: {\n styles: (theme, params: ButtonStylesParams) => ({\n root: {\n fontWeight: 400,\n backgroundColor: params.variant === 'outline' ? 'white' : undefined,\n },\n }),\n },\n Modal: {\n styles: (theme, {size, fullScreen}: ModalStylesParams) => ({\n modal: {\n width: fullScreen\n ? undefined\n : theme.fn.size({size, sizes: {xs: 440, sm: 550, md: 800, lg: 1334, xl: '85%'}}),\n },\n }),\n defaultProps: {\n overlayColor: color.primary.navy[9],\n overlayOpacity: 0.9,\n },\n },\n InputWrapper: {\n defaultProps: {\n withAsterisk: false,\n },\n styles: (theme) => ({\n label: {\n marginBottom: theme.spacing.xs,\n lineHeight: '20px',\n },\n description: {\n lineHeight: '20px',\n fontSize: theme.fontSizes.sm,\n color: theme.colors.gray[7],\n marginBottom: theme.spacing.xs,\n },\n invalid: {\n color: theme.colors.red[9],\n borderColor: theme.colors.red[6],\n },\n error: {\n color: theme.colors.red[9],\n },\n }),\n },\n TextInput: {\n defaultProps: {\n radius: 8,\n },\n },\n Tooltip: {\n defaultProps: {\n color: 'navy',\n withArrow: true,\n withinPortal: true,\n multiline: true,\n },\n },\n Breadcrumbs: {\n defaultProps: {\n separator: <ArrowHeadRightSize24Px height={24} />,\n },\n },\n Loader: {\n defaultProps: {\n variant: 'dots',\n color: 'action',\n },\n },\n DateRangePicker: {\n styles: {\n cell: {\n textAlign: 'center',\n },\n },\n },\n Anchor: {\n defaultProps: {\n color: 'action',\n },\n styles: (theme) => ({\n root: {\n ...theme.fn.hover({\n textDecoration: 'underline',\n color: theme.colors.action[8],\n }),\n },\n }),\n },\n Checkbox: {\n defaultProps: {\n radius: 'sm',\n },\n },\n List: {\n styles: () => ({\n root: {\n listStyleType: 'disc',\n },\n }),\n },\n Radio: {\n styles: {\n labelWrapper: {\n display: 'flex',\n alignItems: 'flex-start',\n },\n },\n },\n Popover: {\n defaultProps: {\n shadow: 'md',\n withArrow: true,\n },\n },\n Badge: {\n styles: {\n root: {\n textTransform: 'none',\n padding: '4px 8px',\n fontWeight: 500,\n },\n },\n },\n ColorSwatch: {\n defaultProps: {\n size: 8,\n withShadow: false,\n },\n },\n MenuItem: {\n defaultProps: {\n fw: 300,\n },\n },\n },\n};\n"],"names":["ArrowHeadRightSize24Px","InfoSize24Px","color","PlasmaColors","plasmaTheme","colorScheme","fontFamily","black","primary","gray","defaultRadius","spacing","xs","sm","md","lg","xl","primaryColor","headings","fontWeight","sizes","h1","fontSize","lineHeight","undefined","h2","h3","h4","h5","h6","shadows","colors","components","Alert","defaultProps","icon","height","styles","title","Title","theme","root","letterSpacing","Button","params","backgroundColor","variant","Modal","size","fullScreen","modal","width","fn","overlayColor","navy","overlayOpacity","InputWrapper","withAsterisk","label","marginBottom","description","fontSizes","invalid","red","borderColor","error","TextInput","radius","Tooltip","withArrow","withinPortal","multiline","Breadcrumbs","separator","Loader","DateRangePicker","cell","textAlign","Anchor","hover","textDecoration","action","Checkbox","List","listStyleType","Radio","labelWrapper","display","alignItems","Popover","shadow","Badge","textTransform","padding","ColorSwatch","withShadow","MenuItem","fw"],"mappings":";;AAAA,SAAQA,sBAAsB,EAAEC,YAAY,QAAO,8BAA8B;AACjF,SAAQC,KAAK,QAAO,yBAAyB;AAG7C,SAAQC,YAAY,QAAO,iBAAiB;AAE5C,OAAO,IAAMC,cAAoC;IAC7C,2HAA2H;IAC3HC,aAAa;IACbC,YAAY;IACZC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AAQ;gBACJuC,MAAM;oBACFC,WAAW;gBACf;YACJ;QACJ;QACAC,QAAQ;YACJ5C,cAAc;gBACVhC,OAAO;YACX;YACAmC,QAAQ,SAACG;uBAAW;oBAChBC,MAAM,mBACCD,MAAMY,EAAE,CAAC2B,KAAK,CAAC;wBACdC,gBAAgB;wBAChB9E,OAAOsC,MAAMT,MAAM,CAACkD,MAAM,CAAC,EAAE;oBACjC;gBAER;;QACJ;QACAC,UAAU;YACNhD,cAAc;gBACViC,QAAQ;YACZ;QACJ;QACAgB,MAAM;YACF9C,QAAQ;uBAAO;oBACXI,MAAM;wBACF2C,eAAe;oBACnB;gBACJ;;QACJ;QACAC,OAAO;YACHhD,QAAQ;gBACJiD,cAAc;oBACVC,SAAS;oBACTC,YAAY;gBAChB;YACJ;QACJ;QACAC,SAAS;YACLvD,cAAc;gBACVwD,QAAQ;gBACRrB,WAAW,IAAI;YACnB;QACJ;QACAsB,OAAO;YACHtD,QAAQ;gBACJI,MAAM;oBACFmD,eAAe;oBACfC,SAAS;oBACT1E,YAAY;gBAChB;YACJ;QACJ;QACA2E,aAAa;YACT5D,cAAc;gBACVc,MAAM;gBACN+C,YAAY,KAAK;YACrB;QACJ;QACAC,UAAU;YACN9D,cAAc;gBACV+D,IAAI;YACR;QACJ;IACJ;AACJ,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/utils/overrideComponent.ts"],"sourcesContent":["/**\n * Allows to override static properties from a component function\n *\n * @param component The component which holds the static properties\n * @param properties The new static properties to assign on the component\n * @returns A new component with the specified properties. It doesn't change the original component\n * @example const Menu = overrideComponent(MantineMenu, {Item: MyMenuItem}); // Menu.Item will equal MyMenuItem\n */\nexport const overrideComponent = <\n Component extends (...args: Parameters<Component>) => ReturnType<Component>,\n StaticProperties = Record<keyof Component, never>\n>(\n component: Component,\n properties: StaticProperties\n): ((...args: Parameters<Component>) => ReturnType<Component>) & Component & StaticProperties => {\n const componentClone = (...args: Parameters<Component>) => component(...args);\n return Object.assign(componentClone, component, properties);\n};\n"],"names":["overrideComponent","component","properties","componentClone","args","Object","assign"],"mappings":"AAAA;;;;;;;CAOC,GACD;AAAA,OAAO,IAAMA,oBAAoB,SAI7BC,WACAC,YAC6F;IAC7F,IAAMC,iBAAiB;yCAAIC;YAAAA;;eAAgCH,UAAAA,MAAAA,KAAAA,GAAU,qBAAGG;;IACxE,OAAOC,OAAOC,MAAM,CAACH,gBAAgBF,WAAWC;AACpD,EAAE"}
1
+ {"version":3,"sources":["../../../src/utils/overrideComponent.ts"],"sourcesContent":["/**\n * Allows to override static properties from a component function\n *\n * @param component The component which holds the static properties\n * @param properties The new static properties to assign on the component\n * @returns A new component with the specified properties. It doesn't change the original component\n * @example const Menu = overrideComponent(MantineMenu, {Item: MyMenuItem}); // Menu.Item will equal MyMenuItem\n */\nexport const overrideComponent = <\n Component extends (...args: Parameters<Component>) => ReturnType<Component>,\n StaticProperties = Record<keyof Component, never>\n>(\n component: Component,\n properties: StaticProperties\n): ((...args: Parameters<Component>) => ReturnType<Component>) & Component & StaticProperties => {\n const componentClone = (...args: Parameters<Component>) => component(...args);\n return Object.assign(componentClone, component, properties);\n};\n"],"names":["overrideComponent","component","properties","componentClone","args","Object","assign"],"mappings":"AAAA;;;;;;;CAOC;AACD,OAAO,IAAMA,oBAAoB,SAI7BC,WACAC,YAC6F;IAC7F,IAAMC,iBAAiB;yCAAIC;YAAAA;;eAAgCH,UAAAA,MAAAA,KAAAA,GAAU,qBAAGG;;IACxE,OAAOC,OAAOC,MAAM,CAACH,gBAAgBF,WAAWC;AACpD,EAAE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coveord/plasma-mantine",
3
- "version": "49.2.0",
3
+ "version": "49.2.3",
4
4
  "description": "A Plasma flavoured Mantine theme",
5
5
  "keywords": [
6
6
  "plasma",
@@ -23,7 +23,7 @@
23
23
  "lodash.defaultsdeep": "4.6.1",
24
24
  "monaco-editor": "0.34.0",
25
25
  "react-beautiful-dnd": "13.1.1",
26
- "@coveord/plasma-react-icons": "48.28.3",
26
+ "@coveord/plasma-react-icons": "49.2.2",
27
27
  "@coveord/plasma-tokens": "48.25.0"
28
28
  },
29
29
  "devDependencies": {
@@ -35,7 +35,7 @@
35
35
  "@mantine/hooks": "5.9.2",
36
36
  "@mantine/modals": "5.9.2",
37
37
  "@swc/cli": "0.1.57",
38
- "@swc/core": "1.3.22",
38
+ "@swc/core": "1.3.31",
39
39
  "@swc/jest": "0.2.23",
40
40
  "@testing-library/dom": "8.18.1",
41
41
  "@testing-library/jest-dom": "5.16.5",
@@ -49,8 +49,9 @@
49
49
  "@types/testing-library__jest-dom": "5.14.5",
50
50
  "csstype": "3.1.1",
51
51
  "embla-carousel-react": "7.0.4",
52
- "eslint-plugin-jest": "27.1.1",
53
52
  "eslint-plugin-testing-library": "5.7.2",
53
+ "eslint-plugin-vitest": "0.0.32",
54
+ "eslint-plugin-vitest-globals": "1.2.0",
54
55
  "identity-obj-proxy": "3.0.0",
55
56
  "jest": "29.2.1",
56
57
  "jest-environment-jsdom": "29.1.2",
@@ -60,7 +61,8 @@
60
61
  "react-dom": "18.2.0",
61
62
  "rimraf": "3.0.2",
62
63
  "tslib": "2.4.0",
63
- "typescript": "4.9.3"
64
+ "typescript": "4.9.3",
65
+ "vitest": "0.28.3"
64
66
  },
65
67
  "peerDependencies": {
66
68
  "@emotion/react": "^11.10.0",
@@ -78,8 +80,7 @@
78
80
  "build": "node ../../scripts/build",
79
81
  "clean": "rimraf dist",
80
82
  "start": "node ../../scripts/start",
81
- "test": "jest --maxWorkers=65%",
82
- "test:watch": "jest --watchAll",
83
- "test:debug": "node --inspect-brk node_modules/jest/bin/jest --runInBand --watchAll --detectOpenHandles --forceExit"
83
+ "test": "TZ=UTC vitest run",
84
+ "test:watch": "TZ=UTC vitest"
84
85
  }
85
86
  }
@@ -10,6 +10,6 @@ const customRender = (ui: ReactElement, options?: Omit<RenderOptions, 'queries'>
10
10
  return render(ui, {wrapper: TestWrapper, ...options});
11
11
  };
12
12
 
13
- export {userEvent};
14
13
  export * from '@testing-library/react';
14
+ export {userEvent};
15
15
  export {customRender as render};
@@ -0,0 +1,27 @@
1
+ import matchers from '@testing-library/jest-dom/matchers';
2
+ import {cleanup} from '@testing-library/react';
3
+ expect.extend(matchers);
4
+ Object.defineProperty(window, 'matchMedia', {
5
+ writable: true,
6
+ value: vi.fn().mockImplementation((query) => ({
7
+ matches: false,
8
+ media: query,
9
+ onchange: null,
10
+ addListener: vi.fn(), // deprecated
11
+ removeListener: vi.fn(), // deprecated
12
+ addEventListener: vi.fn(),
13
+ removeEventListener: vi.fn(),
14
+ dispatchEvent: vi.fn(),
15
+ })),
16
+ });
17
+ window.ResizeObserver =
18
+ window.ResizeObserver ||
19
+ vi.fn().mockImplementation(() => ({
20
+ disconnect: vi.fn(),
21
+ observe: vi.fn(),
22
+ unobserve: vi.fn(),
23
+ }));
24
+
25
+ afterEach(() => {
26
+ cleanup();
27
+ });
@@ -1,24 +1,26 @@
1
- import {useForm} from '@mantine/form';
2
1
  import {loader} from '@monaco-editor/react';
3
2
  import {render, screen, waitForElementToBeRemoved, within} from '@test-utils';
3
+ import {useForm} from '../../../form';
4
4
 
5
5
  import {CodeEditor} from '../CodeEditor';
6
6
  import {XML} from '../languages/xml';
7
7
 
8
+ vi.mock('monaco-editor');
9
+ vi.mock('@monaco-editor/react');
10
+
8
11
  describe('CodeEditor', () => {
9
12
  beforeEach(() => {
10
- jest.clearAllMocks();
13
+ vi.clearAllMocks();
11
14
  });
12
15
 
13
16
  it('renders the monaco editor and a copy to clipboard button', async () => {
14
- jest.mock('monaco-editor');
15
17
  render(<CodeEditor label="label" description="description" />);
16
18
 
17
19
  await waitForElementToBeRemoved(screen.queryByRole('presentation'));
18
20
 
19
21
  expect(screen.getByText(/label/)).toBeInTheDocument();
20
22
  expect(screen.getByText(/description/)).toBeInTheDocument();
21
- expect(screen.getByTestId('monaco-editor')).toBeInTheDocument();
23
+ expect(await screen.findByTestId('monaco-editor')).toBeInTheDocument();
22
24
  expect(await screen.findByRole('button', {name: /copy/i})).toBeInTheDocument();
23
25
  });
24
26
 
@@ -56,7 +58,7 @@ describe('CodeEditor', () => {
56
58
  });
57
59
 
58
60
  it('loads the xml language in the monaco instance if the editor language is xml', async () => {
59
- const xmlLanguageSpy = jest.spyOn(XML, 'register').mockImplementation();
61
+ const xmlLanguageSpy = vi.spyOn(XML, 'register').mockImplementation(vi.fn());
60
62
  render(<CodeEditor label="label" description="description" monacoLoader="cdn" language="xml" />);
61
63
  expect(xmlLanguageSpy).toHaveBeenCalledTimes(1);
62
64
  });
@@ -54,7 +54,7 @@ describe('Collection', () => {
54
54
 
55
55
  it('calls the onRemoveItem function when clicking on a remove button', async () => {
56
56
  const user = userEvent.setup({delay: null});
57
- const onRemoveItemSpy = jest.fn();
57
+ const onRemoveItemSpy = vi.fn();
58
58
  const Fixture = () => {
59
59
  const form = useForm({initialValues: {fruits: ['banana', 'orange']}});
60
60
  return (
@@ -128,7 +128,7 @@ describe('Collection', () => {
128
128
  });
129
129
 
130
130
  it('disables the add button whenever allowAdd callback returns false', () => {
131
- const allowAdd = jest.fn().mockImplementation(() => false);
131
+ const allowAdd = vi.fn().mockImplementation(() => false);
132
132
  const Fixture = () => {
133
133
  const form = useForm({initialValues: {fruits: ['banana', 'orange']}});
134
134
  return (
@@ -6,8 +6,8 @@ import {DateRangePickerInlineCalendar} from '../DateRangePickerInlineCalendar';
6
6
  describe('DateRangePickerInlineCalendar', () => {
7
7
  it('calls onApply when the user clicks on the apply button', async () => {
8
8
  const user = userEvent.setup({delay: null});
9
- const onApply = jest.fn();
10
- render(<DateRangePickerInlineCalendar initialRange={[null, null]} onApply={onApply} onCancel={jest.fn()} />);
9
+ const onApply = vi.fn();
10
+ render(<DateRangePickerInlineCalendar initialRange={[null, null]} onApply={onApply} onCancel={vi.fn()} />);
11
11
 
12
12
  await user.click(screen.getByRole('button', {name: 'Apply'}));
13
13
 
@@ -17,8 +17,8 @@ describe('DateRangePickerInlineCalendar', () => {
17
17
 
18
18
  it('calls onCancel when the user clicks on the cancel button', async () => {
19
19
  const user = userEvent.setup({delay: null});
20
- const onCancel = jest.fn();
21
- render(<DateRangePickerInlineCalendar initialRange={[null, null]} onApply={jest.fn()} onCancel={onCancel} />);
20
+ const onCancel = vi.fn();
21
+ render(<DateRangePickerInlineCalendar initialRange={[null, null]} onApply={vi.fn()} onCancel={onCancel} />);
22
22
 
23
23
  await user.click(screen.getByRole('button', {name: 'Cancel'}));
24
24
 
@@ -26,14 +26,14 @@ describe('DateRangePickerInlineCalendar', () => {
26
26
  });
27
27
 
28
28
  it('does not render the preset searchbox when there is no presets', () => {
29
- render(<DateRangePickerInlineCalendar initialRange={[null, null]} onApply={jest.fn()} onCancel={jest.fn()} />);
29
+ render(<DateRangePickerInlineCalendar initialRange={[null, null]} onApply={vi.fn()} onCancel={vi.fn()} />);
30
30
 
31
31
  expect(screen.queryByRole('searchbox')).not.toBeInTheDocument();
32
32
  });
33
33
 
34
34
  it('calls onApply with the selected dates when choosing a preset', async () => {
35
35
  const user = userEvent.setup({delay: null});
36
- const onApply = jest.fn();
36
+ const onApply = vi.fn();
37
37
  render(
38
38
  <DateRangePickerInlineCalendar
39
39
  presets={{
@@ -41,7 +41,7 @@ describe('DateRangePickerInlineCalendar', () => {
41
41
  }}
42
42
  initialRange={[null, null]}
43
43
  onApply={onApply}
44
- onCancel={jest.fn()}
44
+ onCancel={vi.fn()}
45
45
  />
46
46
  );
47
47
 
@@ -58,9 +58,9 @@ describe('DateRangePickerInlineCalendar', () => {
58
58
 
59
59
  it('calls onApply with the selected dates when clicking in the calendar', async () => {
60
60
  const user = userEvent.setup({delay: null});
61
- jest.useFakeTimers().setSystemTime(new Date(2022, 0, 31));
62
- const onApply = jest.fn();
63
- render(<DateRangePickerInlineCalendar initialRange={[null, null]} onApply={onApply} onCancel={jest.fn()} />);
61
+ vi.useFakeTimers().setSystemTime(new Date(2022, 0, 31));
62
+ const onApply = vi.fn();
63
+ render(<DateRangePickerInlineCalendar initialRange={[null, null]} onApply={onApply} onCancel={vi.fn()} />);
64
64
 
65
65
  // click once for the start, once for the end
66
66
  await user.click(screen.getAllByRole('button', {name: '8'})[0]);
@@ -70,27 +70,27 @@ describe('DateRangePickerInlineCalendar', () => {
70
70
 
71
71
  expect(onApply).toHaveBeenCalledWith([new Date(2022, 0, 8), new Date(2022, 0, 14)]);
72
72
 
73
- jest.useRealTimers();
73
+ vi.useRealTimers();
74
74
  });
75
75
 
76
76
  it('set end date same as start date if only one date is selected when clicking in the calendar', async () => {
77
77
  const user = userEvent.setup({delay: null});
78
- jest.useFakeTimers().setSystemTime(new Date(2022, 0, 31));
79
- const onApply = jest.fn();
80
- render(<DateRangePickerInlineCalendar initialRange={[null, null]} onApply={onApply} onCancel={jest.fn()} />);
78
+ vi.useFakeTimers().setSystemTime(new Date(2022, 0, 31));
79
+ const onApply = vi.fn();
80
+ render(<DateRangePickerInlineCalendar initialRange={[null, null]} onApply={onApply} onCancel={vi.fn()} />);
81
81
 
82
82
  await user.click(screen.getAllByRole('button', {name: '8'})[0]);
83
83
  await user.click(screen.getByRole('button', {name: 'Apply'}));
84
84
 
85
85
  expect(onApply).toHaveBeenCalledWith([new Date(2022, 0, 8), new Date(2022, 0, 8)]);
86
86
 
87
- jest.useRealTimers();
87
+ vi.useRealTimers();
88
88
  });
89
89
 
90
90
  it('calls onApply with the selected dates when typing in the inputs', async () => {
91
91
  const user = userEvent.setup({delay: null});
92
- const onApply = jest.fn();
93
- render(<DateRangePickerInlineCalendar initialRange={[null, null]} onApply={onApply} onCancel={jest.fn()} />);
92
+ const onApply = vi.fn();
93
+ render(<DateRangePickerInlineCalendar initialRange={[null, null]} onApply={onApply} onCancel={vi.fn()} />);
94
94
 
95
95
  const startInput = screen.getByRole('textbox', {
96
96
  name: /start/i,
@@ -7,10 +7,13 @@ import {DateRangePickerPopoverCalendar} from '../DateRangePickerPopoverCalendar'
7
7
  // Since we're mocking the date and the animations are timer based we're mocking useReduceMotion to disable all the animations
8
8
  // I tried wrapping the components in <MantineProvider theme={{components: {Transition: {defaultProps: {duration: 0}}}}}>
9
9
  // but the animation was still happening. :(
10
- jest.mock('@mantine/hooks', () => ({
11
- ...jest.requireActual('@mantine/hooks'),
12
- useReducedMotion: () => true,
13
- }));
10
+ vi.mock('@mantine/hooks', async () => {
11
+ const actual = await vi.importActual('@mantine/hooks');
12
+ return {
13
+ ...actual,
14
+ useReduceMotion: () => true,
15
+ };
16
+ });
14
17
 
15
18
  describe('DateRangePickerPopoverCalendar', () => {
16
19
  it('does not render the preset searchbox when there is no presets', () => {
@@ -49,7 +52,7 @@ describe('DateRangePickerPopoverCalendar', () => {
49
52
 
50
53
  it('calls onApply with the selected dates when clicking in the calendar', async () => {
51
54
  const user = userEvent.setup({delay: null});
52
- jest.useFakeTimers().setSystemTime(new Date(2022, 0, 31));
55
+ vi.useFakeTimers().setSystemTime(new Date(2022, 0, 31));
53
56
  const Fixture = () => {
54
57
  const form = useForm<{dates: DateRangePickerValue}>({initialValues: {dates: [null, null]}});
55
58
  return (
@@ -67,11 +70,12 @@ describe('DateRangePickerPopoverCalendar', () => {
67
70
  await user.click(screen.getAllByRole('button', {name: '14'})[0]);
68
71
 
69
72
  // hides the calendar when the second date is clicked
70
- expect(screen.queryByRole('button', {name: '8'})).not.toBeInTheDocument();
73
+ expect(screen.queryAllByRole('button', {name: '8'})[0]).not.toBeVisible();
74
+ expect(screen.queryAllByRole('button', {name: '8'})[1]).not.toBeVisible();
71
75
 
72
76
  expect(screen.getByTestId('json')).toHaveTextContent('["2022-01-08T00:00:00.000Z","2022-01-14T00:00:00.000Z"]');
73
77
 
74
- jest.useRealTimers();
78
+ vi.useRealTimers();
75
79
  });
76
80
 
77
81
  it('calls onApply with the selected dates when typing in the inputs', async () => {
@@ -5,7 +5,7 @@ import {DateRangePickerPresetSelect} from '../DateRangePickerPresetSelect';
5
5
  describe('DateRangePickerPresetSelect', () => {
6
6
  it('calls onChange when selecting a preset', async () => {
7
7
  const user = userEvent.setup({delay: null});
8
- const onChange = jest.fn();
8
+ const onChange = vi.fn();
9
9
  render(
10
10
  <DateRangePickerPresetSelect
11
11
  value={[null, null]}
@@ -12,7 +12,7 @@ describe('InlineConfirm', () => {
12
12
 
13
13
  it('calls the onClick prop when clicking on a button', async () => {
14
14
  const user = userEvent.setup({delay: null});
15
- const onClickSpy = jest.fn();
15
+ const onClickSpy = vi.fn();
16
16
  render(
17
17
  <InlineConfirm>
18
18
  <InlineConfirm.Button id="delete" onClick={onClickSpy}>
@@ -28,7 +28,7 @@ describe('InlineConfirm', () => {
28
28
 
29
29
  it('calls the onClick prop when clicking on the menu item', async () => {
30
30
  const user = userEvent.setup({delay: null});
31
- const onClickSpy = jest.fn();
31
+ const onClickSpy = vi.fn();
32
32
  render(
33
33
  <InlineConfirm>
34
34
  <Menu>
@@ -55,7 +55,7 @@ describe('InlineConfirm', () => {
55
55
  render(
56
56
  <InlineConfirm>
57
57
  <InlineConfirm.Button id="my-button-id">Remove</InlineConfirm.Button>
58
- <InlineConfirm.Prompt id="my-button-id" label="Are you sure?" onConfirm={jest.fn()} />
58
+ <InlineConfirm.Prompt id="my-button-id" label="Are you sure?" onConfirm={vi.fn()} />
59
59
  </InlineConfirm>
60
60
  );
61
61
  expect(screen.queryByText('Are you sure?')).not.toBeInTheDocument();
@@ -69,7 +69,7 @@ describe('InlineConfirm', () => {
69
69
 
70
70
  it('hides the prompt when the user cancel and call onConfirm when the user confirms', async () => {
71
71
  const user = userEvent.setup({delay: null});
72
- const confirmSpy = jest.fn();
72
+ const confirmSpy = vi.fn();
73
73
  render(
74
74
  <InlineConfirm>
75
75
  <InlineConfirm.Button id="my-button-id">Remove</InlineConfirm.Button>
@@ -103,10 +103,10 @@ describe('InlineConfirm', () => {
103
103
  render(
104
104
  <InlineConfirm>
105
105
  <InlineConfirm.Button id="remove">Remove</InlineConfirm.Button>
106
- <InlineConfirm.Prompt id="remove" label="Delete X?" onConfirm={jest.fn()} />
106
+ <InlineConfirm.Prompt id="remove" label="Delete X?" onConfirm={vi.fn()} />
107
107
 
108
108
  <InlineConfirm.Button id="print">Print</InlineConfirm.Button>
109
- <InlineConfirm.Prompt id="print" label="Print?" onConfirm={jest.fn()} />
109
+ <InlineConfirm.Prompt id="print" label="Print?" onConfirm={vi.fn()} />
110
110
  </InlineConfirm>
111
111
  );
112
112
 
@@ -6,7 +6,7 @@ import {Modal} from '../Modal';
6
6
  describe('Modal', () => {
7
7
  it('renders title, desctiption, close button, and child', () => {
8
8
  render(
9
- <Modal opened onClose={jest.fn()} title="title" description="modal description">
9
+ <Modal opened onClose={vi.fn()} title="title" description="modal description">
10
10
  <Container>Children</Container>
11
11
  </Modal>
12
12
  );
@@ -22,7 +22,7 @@ describe('Modal', () => {
22
22
  render(
23
23
  <Modal
24
24
  opened
25
- onClose={jest.fn()}
25
+ onClose={vi.fn()}
26
26
  title={
27
27
  <div>
28
28
  <QuestionSize32Px />
@@ -38,7 +38,7 @@ describe('Modal', () => {
38
38
  });
39
39
 
40
40
  it('trigger onClose function when click on the close button', () => {
41
- const onClose = jest.fn();
41
+ const onClose = vi.fn();
42
42
  render(
43
43
  <Modal opened onClose={onClose} title="title">
44
44
  <Container>Children</Container>
@@ -169,7 +169,7 @@ describe('ModalWizard', () => {
169
169
  ];
170
170
 
171
171
  const isDirty = () => false;
172
- const onClose = jest.fn();
172
+ const onClose = vi.fn();
173
173
 
174
174
  render(
175
175
  <ModalWizard isDirty={isDirty} onClose={onClose} closeButtonLabel="closebuttonlabel" opened={true}>
@@ -205,7 +205,7 @@ describe('ModalWizard', () => {
205
205
  ];
206
206
 
207
207
  const isDirty = () => false;
208
- const onClose = jest.fn();
208
+ const onClose = vi.fn();
209
209
 
210
210
  render(
211
211
  <ModalWizard isDirty={isDirty} onClose={onClose} opened={true}>
@@ -241,8 +241,8 @@ describe('ModalWizard', () => {
241
241
  ];
242
242
 
243
243
  const isDirty = () => false;
244
- const onClose = jest.fn();
245
- const onFinish = jest.fn();
244
+ const onClose = vi.fn();
245
+ const onFinish = vi.fn();
246
246
 
247
247
  render(
248
248
  <ModalWizard isDirty={isDirty} onClose={onClose} onFinish={onFinish} opened={true}>
@@ -278,8 +278,8 @@ describe('ModalWizard', () => {
278
278
  ];
279
279
 
280
280
  const isDirty = () => true;
281
- const onClose = jest.fn();
282
- const handleDirtyState = jest.fn();
281
+ const onClose = vi.fn();
282
+ const handleDirtyState = vi.fn();
283
283
 
284
284
  render(
285
285
  <ModalWizard
@@ -323,8 +323,8 @@ describe('ModalWizard', () => {
323
323
  ];
324
324
 
325
325
  const isDirty = () => true;
326
- const onClose = jest.fn();
327
- const handleDirtyState = jest.fn();
326
+ const onClose = vi.fn();
327
+ const handleDirtyState = vi.fn();
328
328
 
329
329
  render(
330
330
  <ModalWizard
@@ -4,7 +4,7 @@ import {Prompt} from '../Prompt';
4
4
  describe('Prompt', () => {
5
5
  it('displays the title, body and close button', () => {
6
6
  render(
7
- <Prompt variant="default" opened onClose={jest.fn()} title="title modal">
7
+ <Prompt variant="default" opened onClose={vi.fn()} title="title modal">
8
8
  content modal
9
9
  <Prompt.Footer>footer content</Prompt.Footer>
10
10
  </Prompt>
@@ -16,7 +16,7 @@ describe('Prompt', () => {
16
16
  });
17
17
 
18
18
  it('calls onClose when clicking on the close button', () => {
19
- const onClose = jest.fn();
19
+ const onClose = vi.fn();
20
20
  render(
21
21
  <Prompt variant="default" opened onClose={onClose} title="title modal">
22
22
  content modal
@@ -169,7 +169,7 @@ describe('Table', () => {
169
169
 
170
170
  it('calls an action when user double clicks on a row', async () => {
171
171
  const user = userEvent.setup();
172
- const doubleClickSpy = jest.fn();
172
+ const doubleClickSpy = vi.fn();
173
173
  render(
174
174
  <Table<RowData>
175
175
  data={[{firstName: 'Mario'}, {firstName: 'Luigi'}]}
@@ -38,7 +38,7 @@ describe('Table.Actions', () => {
38
38
  describe('when multi row selection is enabled', () => {
39
39
  it('passes down an array of selected rows', async () => {
40
40
  const user = userEvent.setup({delay: null});
41
- const renderSpy = jest.fn().mockImplementation(() => <div />);
41
+ const renderSpy = vi.fn().mockImplementation(() => <div />);
42
42
  render(
43
43
  <Table<RowData>
44
44
  data={[{name: 'fruit'}, {name: 'vegetable'}, {name: 'bread'}]}
@@ -11,20 +11,23 @@ const columns: Array<ColumnDef<RowData>> = [columnHelper.accessor('name', {enabl
11
11
  // Since we're mocking the date and the animations are timer based we're mocking useReduceMotion to disable all the animations
12
12
  // I tried wrapping the components in <MantineProvider theme={{components: {Transition: {defaultProps: {duration: 0}}}}}>
13
13
  // but the animation was still happening. :(
14
- jest.mock('@mantine/hooks', () => ({
15
- ...jest.requireActual('@mantine/hooks'),
16
- useReducedMotion: () => true,
17
- }));
14
+ vi.mock('@mantine/hooks', async () => {
15
+ const actual = await vi.importActual('@mantine/hooks');
16
+ return {
17
+ ...actual,
18
+ useReduceMotion: () => true,
19
+ };
20
+ });
18
21
 
19
22
  describe('Table.DateRangePicker', () => {
20
- jest.setTimeout(15000);
23
+ // vi.setTimeout(15000);
21
24
 
22
25
  beforeEach(() => {
23
- jest.useFakeTimers().setSystemTime(new Date(2022, 0, 15));
26
+ vi.useFakeTimers().setSystemTime(new Date(2022, 0, 15));
24
27
  });
25
28
 
26
29
  afterEach(() => {
27
- jest.useRealTimers();
30
+ vi.useRealTimers();
28
31
  });
29
32
 
30
33
  it('displays the intial dates', async () => {
@@ -47,7 +50,7 @@ describe('Table.DateRangePicker', () => {
47
50
 
48
51
  it('displays the selected date range in the table', async () => {
49
52
  const user = userEvent.setup({delay: null});
50
- const onChange = jest.fn();
53
+ const onChange = vi.fn();
51
54
  render(
52
55
  <Table
53
56
  data={[{name: 'fruit'}, {name: 'vegetable'}]}