@coveord/plasma-mantine 48.9.1 → 48.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (175) hide show
  1. package/.turbo/turbo-build.log +3 -3
  2. package/.turbo/turbo-test.log +6 -6
  3. package/dist/.tsbuildinfo +1 -1
  4. package/dist/cjs/__tests__/GlobalSetup.js.map +1 -1
  5. package/dist/cjs/__tests__/SetupAfterEnv.js.map +1 -1
  6. package/dist/cjs/__tests__/Utils.js.map +1 -1
  7. package/dist/cjs/components/blank-slate/BlankSlate.js +1 -1
  8. package/dist/cjs/components/blank-slate/BlankSlate.js.map +1 -1
  9. package/dist/cjs/components/blank-slate/index.js.map +1 -1
  10. package/dist/cjs/components/code-editor/CodeEditor.js +7 -7
  11. package/dist/cjs/components/code-editor/CodeEditor.js.map +1 -1
  12. package/dist/cjs/components/code-editor/__mocks__/@monaco-editor/react.js.map +1 -1
  13. package/dist/cjs/components/code-editor/__mocks__/monaco-editor.js.map +1 -1
  14. package/dist/cjs/components/code-editor/index.js.map +1 -1
  15. package/dist/cjs/components/collection/Collection.js +8 -8
  16. package/dist/cjs/components/collection/Collection.js.map +1 -1
  17. package/dist/cjs/components/collection/CollectionItem.js +7 -7
  18. package/dist/cjs/components/collection/CollectionItem.js.map +1 -1
  19. package/dist/cjs/components/collection/Colllection.styles.js.map +1 -1
  20. package/dist/cjs/components/collection/index.js.map +1 -1
  21. package/dist/cjs/components/date-range-picker/DateRangePickerInlineCalendar.js.map +1 -1
  22. package/dist/cjs/components/date-range-picker/DateRangePickerPopoverCalendar.js +5 -5
  23. package/dist/cjs/components/date-range-picker/DateRangePickerPopoverCalendar.js.map +1 -1
  24. package/dist/cjs/components/date-range-picker/DateRangePickerPresetSelect.js +2 -2
  25. package/dist/cjs/components/date-range-picker/DateRangePickerPresetSelect.js.map +1 -1
  26. package/dist/cjs/components/date-range-picker/EditableDateRangePicker.js +1 -1
  27. package/dist/cjs/components/date-range-picker/EditableDateRangePicker.js.map +1 -1
  28. package/dist/cjs/components/date-range-picker/index.js.map +1 -1
  29. package/dist/cjs/components/header/Header.js.map +1 -1
  30. package/dist/cjs/components/header/index.js.map +1 -1
  31. package/dist/cjs/components/index.js.map +1 -1
  32. package/dist/cjs/components/inline-confirm/InlineConfirm.js +1 -1
  33. package/dist/cjs/components/inline-confirm/InlineConfirm.js.map +1 -1
  34. package/dist/cjs/components/inline-confirm/InlineConfirmButton.js +2 -2
  35. package/dist/cjs/components/inline-confirm/InlineConfirmButton.js.map +1 -1
  36. package/dist/cjs/components/inline-confirm/InlineConfirmContext.js.map +1 -1
  37. package/dist/cjs/components/inline-confirm/InlineConfirmPrompt.js +2 -2
  38. package/dist/cjs/components/inline-confirm/InlineConfirmPrompt.js.map +1 -1
  39. package/dist/cjs/components/inline-confirm/index.js.map +1 -1
  40. package/dist/cjs/components/inline-confirm/useInlineConfirm.js.map +1 -1
  41. package/dist/cjs/components/modal-wizard/ModalWizard.js +5 -5
  42. package/dist/cjs/components/modal-wizard/ModalWizard.js.map +1 -1
  43. package/dist/cjs/components/modal-wizard/ModalWizardStep.js.map +1 -1
  44. package/dist/cjs/components/modal-wizard/index.js.map +1 -1
  45. package/dist/cjs/components/prompt/Prompt.js +1 -1
  46. package/dist/cjs/components/prompt/Prompt.js.map +1 -1
  47. package/dist/cjs/components/prompt/PromptFooter.js.map +1 -1
  48. package/dist/cjs/components/prompt/index.js.map +1 -1
  49. package/dist/cjs/components/sticky-footer/StickyFooter.js.map +1 -1
  50. package/dist/cjs/components/sticky-footer/index.js.map +1 -1
  51. package/dist/cjs/components/table/Table.js +14 -14
  52. package/dist/cjs/components/table/Table.js.map +1 -1
  53. package/dist/cjs/components/table/TableActions.js.map +1 -1
  54. package/dist/cjs/components/table/TableCollapsibleColumn.js.map +1 -1
  55. package/dist/cjs/components/table/TableContext.js.map +1 -1
  56. package/dist/cjs/components/table/TableDateRangePicker.js +2 -2
  57. package/dist/cjs/components/table/TableDateRangePicker.js.map +1 -1
  58. package/dist/cjs/components/table/TableFilter.js +3 -3
  59. package/dist/cjs/components/table/TableFilter.js.map +1 -1
  60. package/dist/cjs/components/table/TableFooter.js.map +1 -1
  61. package/dist/cjs/components/table/TableHeader.js.map +1 -1
  62. package/dist/cjs/components/table/TablePagination.js +1 -1
  63. package/dist/cjs/components/table/TablePagination.js.map +1 -1
  64. package/dist/cjs/components/table/TablePerPage.js +5 -5
  65. package/dist/cjs/components/table/TablePerPage.js.map +1 -1
  66. package/dist/cjs/components/table/TablePredicate.js +1 -1
  67. package/dist/cjs/components/table/TablePredicate.js.map +1 -1
  68. package/dist/cjs/components/table/Th.js.map +1 -1
  69. package/dist/cjs/components/table/index.js.map +1 -1
  70. package/dist/cjs/components/table/useTable.js.map +1 -1
  71. package/dist/cjs/hooks/index.js.map +1 -1
  72. package/dist/cjs/hooks/useControlledList.js +2 -2
  73. package/dist/cjs/hooks/useControlledList.js.map +1 -1
  74. package/dist/cjs/hooks/useParentHeight.js +6 -6
  75. package/dist/cjs/hooks/useParentHeight.js.map +1 -1
  76. package/dist/cjs/index.js.map +1 -1
  77. package/dist/cjs/theme/PlasmaColors.js.map +1 -1
  78. package/dist/cjs/theme/Plasmantine.js.map +1 -1
  79. package/dist/cjs/theme/Theme.js +6 -0
  80. package/dist/cjs/theme/Theme.js.map +1 -1
  81. package/dist/cjs/theme/index.js.map +1 -1
  82. package/dist/definitions/components/collection/Collection.d.ts +67 -1
  83. package/dist/definitions/components/collection/Collection.d.ts.map +1 -1
  84. package/dist/definitions/components/header/Header.d.ts +23 -2
  85. package/dist/definitions/components/header/Header.d.ts.map +1 -1
  86. package/dist/definitions/theme/Theme.d.ts.map +1 -1
  87. package/dist/esm/__tests__/GlobalSetup.js.map +1 -1
  88. package/dist/esm/__tests__/SetupAfterEnv.js.map +1 -1
  89. package/dist/esm/__tests__/Utils.js.map +1 -1
  90. package/dist/esm/components/blank-slate/BlankSlate.js +1 -1
  91. package/dist/esm/components/blank-slate/BlankSlate.js.map +1 -1
  92. package/dist/esm/components/blank-slate/index.js.map +1 -1
  93. package/dist/esm/components/code-editor/CodeEditor.js +7 -7
  94. package/dist/esm/components/code-editor/CodeEditor.js.map +1 -1
  95. package/dist/esm/components/code-editor/__mocks__/@monaco-editor/react.js.map +1 -1
  96. package/dist/esm/components/code-editor/__mocks__/monaco-editor.js.map +1 -1
  97. package/dist/esm/components/code-editor/index.js.map +1 -1
  98. package/dist/esm/components/collection/Collection.js +8 -8
  99. package/dist/esm/components/collection/Collection.js.map +1 -1
  100. package/dist/esm/components/collection/CollectionItem.js +7 -7
  101. package/dist/esm/components/collection/CollectionItem.js.map +1 -1
  102. package/dist/esm/components/collection/Colllection.styles.js.map +1 -1
  103. package/dist/esm/components/collection/index.js.map +1 -1
  104. package/dist/esm/components/date-range-picker/DateRangePickerInlineCalendar.js.map +1 -1
  105. package/dist/esm/components/date-range-picker/DateRangePickerPopoverCalendar.js +5 -5
  106. package/dist/esm/components/date-range-picker/DateRangePickerPopoverCalendar.js.map +1 -1
  107. package/dist/esm/components/date-range-picker/DateRangePickerPresetSelect.js +2 -2
  108. package/dist/esm/components/date-range-picker/DateRangePickerPresetSelect.js.map +1 -1
  109. package/dist/esm/components/date-range-picker/EditableDateRangePicker.js +1 -1
  110. package/dist/esm/components/date-range-picker/EditableDateRangePicker.js.map +1 -1
  111. package/dist/esm/components/date-range-picker/index.js.map +1 -1
  112. package/dist/esm/components/header/Header.js.map +1 -1
  113. package/dist/esm/components/header/index.js.map +1 -1
  114. package/dist/esm/components/index.js.map +1 -1
  115. package/dist/esm/components/inline-confirm/InlineConfirm.js +1 -1
  116. package/dist/esm/components/inline-confirm/InlineConfirm.js.map +1 -1
  117. package/dist/esm/components/inline-confirm/InlineConfirmButton.js +2 -2
  118. package/dist/esm/components/inline-confirm/InlineConfirmButton.js.map +1 -1
  119. package/dist/esm/components/inline-confirm/InlineConfirmContext.js.map +1 -1
  120. package/dist/esm/components/inline-confirm/InlineConfirmPrompt.js +2 -2
  121. package/dist/esm/components/inline-confirm/InlineConfirmPrompt.js.map +1 -1
  122. package/dist/esm/components/inline-confirm/index.js.map +1 -1
  123. package/dist/esm/components/inline-confirm/useInlineConfirm.js.map +1 -1
  124. package/dist/esm/components/modal-wizard/ModalWizard.js +5 -5
  125. package/dist/esm/components/modal-wizard/ModalWizard.js.map +1 -1
  126. package/dist/esm/components/modal-wizard/ModalWizardStep.js.map +1 -1
  127. package/dist/esm/components/modal-wizard/index.js.map +1 -1
  128. package/dist/esm/components/prompt/Prompt.js +1 -1
  129. package/dist/esm/components/prompt/Prompt.js.map +1 -1
  130. package/dist/esm/components/prompt/PromptFooter.js.map +1 -1
  131. package/dist/esm/components/prompt/index.js.map +1 -1
  132. package/dist/esm/components/sticky-footer/StickyFooter.js.map +1 -1
  133. package/dist/esm/components/sticky-footer/index.js.map +1 -1
  134. package/dist/esm/components/table/Table.js +14 -14
  135. package/dist/esm/components/table/Table.js.map +1 -1
  136. package/dist/esm/components/table/TableActions.js.map +1 -1
  137. package/dist/esm/components/table/TableCollapsibleColumn.js.map +1 -1
  138. package/dist/esm/components/table/TableContext.js.map +1 -1
  139. package/dist/esm/components/table/TableDateRangePicker.js +2 -2
  140. package/dist/esm/components/table/TableDateRangePicker.js.map +1 -1
  141. package/dist/esm/components/table/TableFilter.js +3 -3
  142. package/dist/esm/components/table/TableFilter.js.map +1 -1
  143. package/dist/esm/components/table/TableFooter.js.map +1 -1
  144. package/dist/esm/components/table/TableHeader.js.map +1 -1
  145. package/dist/esm/components/table/TablePagination.js +1 -1
  146. package/dist/esm/components/table/TablePagination.js.map +1 -1
  147. package/dist/esm/components/table/TablePerPage.js +5 -5
  148. package/dist/esm/components/table/TablePerPage.js.map +1 -1
  149. package/dist/esm/components/table/TablePredicate.js +1 -1
  150. package/dist/esm/components/table/TablePredicate.js.map +1 -1
  151. package/dist/esm/components/table/Th.js.map +1 -1
  152. package/dist/esm/components/table/index.js.map +1 -1
  153. package/dist/esm/components/table/useTable.js.map +1 -1
  154. package/dist/esm/hooks/index.js.map +1 -1
  155. package/dist/esm/hooks/useControlledList.js +2 -2
  156. package/dist/esm/hooks/useControlledList.js.map +1 -1
  157. package/dist/esm/hooks/useParentHeight.js +6 -6
  158. package/dist/esm/hooks/useParentHeight.js.map +1 -1
  159. package/dist/esm/index.js.map +1 -1
  160. package/dist/esm/theme/PlasmaColors.js.map +1 -1
  161. package/dist/esm/theme/Plasmantine.js.map +1 -1
  162. package/dist/esm/theme/Theme.js +6 -0
  163. package/dist/esm/theme/Theme.js.map +1 -1
  164. package/dist/esm/theme/index.js.map +1 -1
  165. package/package.json +7 -7
  166. package/src/components/collection/Collection.tsx +67 -1
  167. package/src/components/header/Header.tsx +23 -2
  168. package/src/theme/Theme.tsx +6 -0
  169. package/dist/cjs/components/code-editor/CodeEditor.example.js +0 -41
  170. package/dist/cjs/components/code-editor/CodeEditor.example.js.map +0 -1
  171. package/dist/definitions/components/code-editor/CodeEditor.example.d.ts +0 -4
  172. package/dist/definitions/components/code-editor/CodeEditor.example.d.ts.map +0 -1
  173. package/dist/esm/components/code-editor/CodeEditor.example.js +0 -31
  174. package/dist/esm/components/code-editor/CodeEditor.example.js.map +0 -1
  175. package/src/components/code-editor/CodeEditor.example.tsx +0 -32
@@ -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 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: 320, sm: 440, md: '45%', 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 },\n TextInput: {\n defaultProps: {\n radius: 8,\n },\n styles: (theme) => ({\n description: {\n fontSize: 'inherit',\n paddingBottom: theme.spacing.xs,\n },\n }),\n },\n Tooltip: {\n defaultProps: {\n color: 'navy',\n withArrow: true,\n withinPortal: 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 },\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","TextInput","radius","description","paddingBottom","Tooltip","withArrow","withinPortal","Breadcrumbs","separator","Loader","DateRangePicker","cell","textAlign","Anchor","hover","textDecoration","action","Checkbox","List","listStyleType","Radio","labelWrapper","display","alignItems"],"mappings":"AAAA;;AAAA,SAAQA,sBAAsB,EAAEC,YAAY,QAAO,6BAA6B,CAAC;AACjF,SAAQC,KAAK,QAAO,wBAAwB,CAAC;AAG7C,SAAQC,YAAY,QAAO,gBAAgB,CAAC;AAE5C,OAAO,IAAMC,WAAW,GAAyB;IAC7CC,WAAW,EAAE,OAAO;IACpBC,UAAU,EAAE,gCAAgC;IAC5CC,KAAK,EAAEL,KAAK,CAACM,OAAO,CAACC,IAAI,CAAC,CAAC,CAAC;IAC5BC,aAAa,EAAE,CAAC;IAChBC,OAAO,EAAE;QACLC,EAAE,E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AAE;oBACVC,OAAO,EAAE,MAAM;oBACfC,UAAU,EAAE,YAAY;iBAC3B;aACJ;SACJ;KACJ;CACJ,CAAC"}
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 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: 320, sm: 440, md: '45%', 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 },\n TextInput: {\n defaultProps: {\n radius: 8,\n },\n styles: (theme) => ({\n description: {\n fontSize: 'inherit',\n paddingBottom: theme.spacing.xs,\n },\n }),\n },\n Tooltip: {\n defaultProps: {\n color: 'navy',\n withArrow: true,\n withinPortal: 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 },\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","TextInput","radius","description","paddingBottom","Tooltip","withArrow","withinPortal","Breadcrumbs","separator","Loader","DateRangePicker","cell","textAlign","Anchor","hover","textDecoration","action","Checkbox","List","listStyleType","Radio","labelWrapper","display","alignItems","Popover","shadow"],"mappings":"AAAA;;AAAA,SAAQA,sBAAsB,EAAEC,YAAY,QAAO,8BAA8B;AACjF,SAAQC,KAAK,QAAO,yBAAyB;AAG7C,SAAQC,YAAY,QAAO,iBAAiB;AAE5C,OAAO,IAAMC,cAAoC;IAC7CC,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,YAAYK;YAAS;YAC5DG,IAAI;gBAACL,UAAU;gBAAIC,YAAY;gBAAQJ,YAAYK;YAAS;YAC5DI,IAAI;gBAACN,UAAU;gBAAIC,YAAY;gBAAQJ,YAAYK;YAAS;YAC5DK,IAAI;gBAACP,UAAU;gBAAIC,YAAY;gBAAQJ,YAAYK;YAAS;QAChE;IACJ;IACAM,SAAS;QACLlB,IAAI;QACJC,IAAI;QACJC,IAAI;QACJC,IAAI;QACJC,IAAI;IACR;IACAe,QAAQ5B;IACR6B,YAAY;QACRC,OAAO;YACHC,cAAc;gBACVC,oBAAM,KAAClC;oBAAamC,QAAQ;;gBAC5BlC,OAAO;YACX;YACAmC,QAAQ;gBAC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ACX;QACJ;QACAkE,iBAAiB;YACb/B,QAAQ;gBACJgC,MAAM;oBACFC,WAAW;gBACf;YACJ;QACJ;QACAC,QAAQ;YACJrC,cAAc;gBACVhC,OAAO;YACX;YACAmC,QAAQ,SAACG;uBAAW;oBAChBC,MAAM,mBACCD,MAAMY,EAAE,CAACoB,KAAK,CAAC;wBACdC,gBAAgB;wBAChBvE,OAAOsC,MAAMT,MAAM,CAAC2C,MAAM,CAAC,EAAE;oBACjC;gBAER;;QACJ;QACAC,UAAU;YACNzC,cAAc;gBACVyB,QAAQ;YACZ;QACJ;QACAiB,MAAM;YACFvC,QAAQ;uBAAO;oBACXI,MAAM;wBACFoC,eAAe;oBACnB;gBACJ;;QACJ;QACAC,OAAO;YACHzC,QAAQ;gBACJ0C,cAAc;oBACVC,SAAS;oBACTC,YAAY;gBAChB;YACJ;QACJ;QACAC,SAAS;YACLhD,cAAc;gBACViD,QAAQ;gBACRpB,WAAW,IAAI;YACnB;QACJ;IACJ;AACJ,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/theme/index.ts"],"sourcesContent":["export * from './Plasmantine';\n"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
1
+ {"version":3,"sources":["../../../src/theme/index.ts"],"sourcesContent":["export * from './Plasmantine';\n"],"names":[],"mappings":"AAAA,cAAc,gBAAgB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coveord/plasma-mantine",
3
- "version": "48.9.1",
3
+ "version": "48.10.0",
4
4
  "description": "A Plasma flavoured Mantine theme",
5
5
  "keywords": [
6
6
  "plasma",
@@ -14,19 +14,19 @@
14
14
  "module": "./dist/esm/index.js",
15
15
  "types": "./dist/definitions/index.d.ts",
16
16
  "dependencies": {
17
- "@coveord/plasma-react-icons": "48.0.0",
18
- "@coveord/plasma-tokens": "47.3.7",
19
17
  "@monaco-editor/react": "4.4.5",
20
- "@swc/helpers": "0.4.11",
18
+ "@swc/helpers": "0.4.12",
21
19
  "@tanstack/react-table": "8.5.11",
22
20
  "@tanstack/table-core": "8.5.11",
23
21
  "dayjs": "1.11.3",
24
22
  "lodash.defaultsdeep": "4.6.1",
25
23
  "monaco-editor": "0.34.0",
26
- "react-beautiful-dnd": "13.1.1"
24
+ "react-beautiful-dnd": "13.1.1",
25
+ "@coveord/plasma-react-icons": "48.10.0",
26
+ "@coveord/plasma-tokens": "47.3.7"
27
27
  },
28
28
  "devDependencies": {
29
- "@emotion/react": "11.10.0",
29
+ "@emotion/react": "11.10.5",
30
30
  "@mantine/carousel": "5.6.4",
31
31
  "@mantine/core": "5.6.2",
32
32
  "@mantine/dates": "5.6.2",
@@ -34,7 +34,7 @@
34
34
  "@mantine/hooks": "5.6.2",
35
35
  "@mantine/modals": "5.6.2",
36
36
  "@swc/cli": "0.1.57",
37
- "@swc/core": "1.3.3",
37
+ "@swc/core": "1.3.16",
38
38
  "@swc/jest": "0.2.23",
39
39
  "@testing-library/dom": "8.18.1",
40
40
  "@testing-library/jest-dom": "5.16.5",
@@ -19,19 +19,85 @@ import {CollectionItem} from './CollectionItem';
19
19
  import useStyles from './Colllection.styles';
20
20
 
21
21
  interface CollectionProps<T> extends DefaultProps<Selectors<typeof useStyles>> {
22
+ /**
23
+ * The default value each new item should have
24
+ */
22
25
  newItem: T;
26
+ /**
27
+ * A render function called for each item passed in the `value` prop.
28
+ *
29
+ * @param item The current item's value
30
+ * @param index The current item's index
31
+ */
23
32
  children: (item: T, index: number) => ReactNode;
24
- defaultValue?: T[];
33
+ /**
34
+ * The list of items to display inside the collection
35
+ *
36
+ * @default []
37
+ */
25
38
  value?: T[];
39
+ /**
40
+ * The initial items of the collection (for uncontrolled usage only)
41
+ */
42
+ defaultValue?: T[];
43
+ /**
44
+ * Unused, has no effect
45
+ */
26
46
  onFocus?: () => void;
47
+ /**
48
+ * Function called whenever the value needs to be updated
49
+ *
50
+ * @param value The whole list of items after the change
51
+ */
27
52
  onChange?: (value: T[]) => void;
53
+ /**
54
+ * Function called after an item is removed from the collection using the remove button
55
+ *
56
+ * @param itemIndex The index of the item that was removed
57
+ */
28
58
  onRemoveItem?: (itemIndex: number) => void;
59
+ /**
60
+ * Whether the collection should have drag and drop behavior enabled
61
+ *
62
+ * @default false
63
+ */
29
64
  draggable?: boolean;
65
+ /**
66
+ * Whether the collection is disabled, or in other words in read only mode
67
+ *
68
+ * @default false
69
+ */
30
70
  disabled?: boolean;
71
+ /**
72
+ * Function that determines if the add item button should be enabled given the current items of the collection.
73
+ * The button is always enabled if this props remains undefined
74
+ *
75
+ * @param values The current items of the collection
76
+ */
31
77
  allowAdd?: (values: T[]) => boolean;
78
+ /**
79
+ * The label of the add item button
80
+ *
81
+ * @default "Add item"
82
+ */
32
83
  addLabel?: string;
84
+ /**
85
+ * The tooltip text displayed when hovering over the disabled add item button
86
+ *
87
+ * @default 'There is already an empty item'
88
+ */
33
89
  addDisabledTooltip?: string;
90
+ /**
91
+ * The spacing between the colleciton items
92
+ *
93
+ * @default 'xs'
94
+ */
34
95
  spacing?: MantineNumberSize;
96
+ /**
97
+ * Whether the collection is required. When required is true, the collection will hide the remove button if there is only one item
98
+ *
99
+ * @default false
100
+ */
35
101
  required?: boolean;
36
102
  }
37
103
 
@@ -1,16 +1,37 @@
1
1
  import {QuestionSize24Px} from '@coveord/plasma-react-icons';
2
2
  import {Anchor, Breadcrumbs, DefaultProps, Divider, Group, Stack, Text, Title, Tooltip} from '@mantine/core';
3
- import {FunctionComponent, PropsWithChildren, ReactNode} from 'react';
3
+ import {FunctionComponent, ReactNode} from 'react';
4
4
 
5
5
  interface HeaderProps extends DefaultProps {
6
+ /**
7
+ * The description text displayed inside the header underneath the title
8
+ */
6
9
  description?: ReactNode;
10
+ /**
11
+ * Action buttons that can be displayed on the right of the header
12
+ */
7
13
  actions?: ReactNode;
14
+ /**
15
+ * Whether the header should have a border on the bottom
16
+ */
8
17
  borderBottom?: boolean;
18
+ /**
19
+ * A href pointing to documentation related to the current panel.
20
+ * When provided, an info icon is rendered next to the title as link to this documentation
21
+ */
9
22
  docLink?: string;
23
+ /**
24
+ * The tooltip text shown when hovering over the doc link icon
25
+ */
10
26
  docLinkTooltipLabel?: string;
27
+ /**
28
+ * The title of the header.
29
+ * If more than one children are provided, each of them act as parts of a breadcrumb
30
+ */
31
+ children: ReactNode;
11
32
  }
12
33
 
13
- export const Header: FunctionComponent<PropsWithChildren<HeaderProps>> = ({
34
+ export const Header: FunctionComponent<HeaderProps> = ({
14
35
  description,
15
36
  actions,
16
37
  borderBottom,
@@ -151,5 +151,11 @@ export const plasmaTheme: MantineThemeOverride = {
151
151
  },
152
152
  },
153
153
  },
154
+ Popover: {
155
+ defaultProps: {
156
+ shadow: 'md',
157
+ withArrow: true,
158
+ },
159
+ },
154
160
  },
155
161
  };
@@ -1,41 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "default", {
6
- enumerable: true,
7
- get: function() {
8
- return _default;
9
- }
10
- });
11
- var _objectSpread = require("@swc/helpers/lib/_object_spread.js").default;
12
- var _jsxRuntime = require("react/jsx-runtime");
13
- var _form = require("@mantine/form");
14
- var _codeEditor = require("./CodeEditor");
15
- var _default = function() {
16
- var form = (0, _form.useForm)({
17
- initialValues: {
18
- config: '{"key":"value"}'
19
- },
20
- validate: {
21
- config: function(jsonValue) {
22
- try {
23
- var config = JSON.parse(jsonValue);
24
- if (!config.key) {
25
- return "The key must have a value";
26
- }
27
- } catch (e) {
28
- return "Invalid JSON";
29
- }
30
- return null;
31
- }
32
- }
33
- });
34
- return /*#__PURE__*/ (0, _jsxRuntime.jsx)(_codeEditor.CodeEditor, _objectSpread({
35
- language: "json",
36
- label: "Configuration",
37
- description: "This JSON configuration is very important"
38
- }, form.getInputProps("config")));
39
- };
40
-
41
- //# sourceMappingURL=CodeEditor.example.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/components/code-editor/CodeEditor.example.tsx"],"sourcesContent":["import {useForm} from '@mantine/form';\nimport {CodeEditor} from './CodeEditor';\n\nexport default () => {\n const form = useForm({\n initialValues: {\n config: '{\"key\":\"value\"}',\n },\n validate: {\n config: (jsonValue) => {\n try {\n const config = JSON.parse(jsonValue);\n if (!config.key) {\n return 'The key must have a value';\n }\n } catch {\n return 'Invalid JSON';\n }\n return null;\n },\n },\n });\n\n return (\n <CodeEditor\n language=\"json\"\n label=\"Configuration\"\n description=\"This JSON configuration is very important\"\n {...form.getInputProps('config')}\n />\n );\n};\n"],"names":["form","useForm","initialValues","config","validate","jsonValue","JSON","parse","key","CodeEditor","language","label","description","getInputProps"],"mappings":"AAAA;;;;+BAGA,SA4BE;;;eA5BF,QA4BE;;;;;oBA/BoB,eAAe;0BACZ,cAAc;IAEvC,QA4BE,GA5Ba,WAAM;IACjB,IAAMA,IAAI,GAAGC,IAAAA,KAAO,QAAA,EAAC;QACjBC,aAAa,EAAE;YACXC,MAAM,EAAE,iBAAiB;SAC5B;QACDC,QAAQ,EAAE;YACND,MAAM,EAAE,SAACE,SAAS,EAAK;gBACnB,IAAI;oBACA,IAAMF,MAAM,GAAGG,IAAI,CAACC,KAAK,CAACF,SAAS,CAAC,AAAC;oBACrC,IAAI,CAACF,MAAM,CAACK,GAAG,EAAE;wBACb,OAAO,2BAA2B,CAAC;oBACvC,CAAC;gBACL,EAAE,UAAM;oBACJ,OAAO,cAAc,CAAC;gBAC1B,CAAC;gBACD,OAAO,IAAI,CAAC;YAChB,CAAC;SACJ;KACJ,CAAC,AAAC;IAEH,qBACI,qBAACC,WAAU,WAAA;QACPC,QAAQ,EAAC,MAAM;QACfC,KAAK,EAAC,eAAe;QACrBC,WAAW,EAAC,2CAA2C;OACnDZ,IAAI,CAACa,aAAa,CAAC,QAAQ,CAAC,EAClC,CACJ;AACN,CAAC"}
@@ -1,4 +0,0 @@
1
- /// <reference types="react" />
2
- declare const _default: () => JSX.Element;
3
- export default _default;
4
- //# sourceMappingURL=CodeEditor.example.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CodeEditor.example.d.ts","sourceRoot":"","sources":["../../../../src/components/code-editor/CodeEditor.example.tsx"],"names":[],"mappings":";;AAGA,wBA4BE"}
@@ -1,31 +0,0 @@
1
- import _object_spread from "@swc/helpers/src/_object_spread.mjs";
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { useForm } from "@mantine/form";
4
- import { CodeEditor } from "./CodeEditor";
5
- export default function() {
6
- var form = useForm({
7
- initialValues: {
8
- config: '{"key":"value"}'
9
- },
10
- validate: {
11
- config: function(jsonValue) {
12
- try {
13
- var config = JSON.parse(jsonValue);
14
- if (!config.key) {
15
- return "The key must have a value";
16
- }
17
- } catch (e) {
18
- return "Invalid JSON";
19
- }
20
- return null;
21
- }
22
- }
23
- });
24
- return /*#__PURE__*/ _jsx(CodeEditor, _object_spread({
25
- language: "json",
26
- label: "Configuration",
27
- description: "This JSON configuration is very important"
28
- }, form.getInputProps("config")));
29
- };
30
-
31
- //# sourceMappingURL=CodeEditor.example.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/components/code-editor/CodeEditor.example.tsx"],"sourcesContent":["import {useForm} from '@mantine/form';\nimport {CodeEditor} from './CodeEditor';\n\nexport default () => {\n const form = useForm({\n initialValues: {\n config: '{\"key\":\"value\"}',\n },\n validate: {\n config: (jsonValue) => {\n try {\n const config = JSON.parse(jsonValue);\n if (!config.key) {\n return 'The key must have a value';\n }\n } catch {\n return 'Invalid JSON';\n }\n return null;\n },\n },\n });\n\n return (\n <CodeEditor\n language=\"json\"\n label=\"Configuration\"\n description=\"This JSON configuration is very important\"\n {...form.getInputProps('config')}\n />\n );\n};\n"],"names":["useForm","CodeEditor","form","initialValues","config","validate","jsonValue","JSON","parse","key","language","label","description","getInputProps"],"mappings":"AAAA;;AAAA,SAAQA,OAAO,QAAO,eAAe,CAAC;AACtC,SAAQC,UAAU,QAAO,cAAc,CAAC;AAExC,eAAe,WAAM;IACjB,IAAMC,IAAI,GAAGF,OAAO,CAAC;QACjBG,aAAa,EAAE;YACXC,MAAM,EAAE,iBAAiB;SAC5B;QACDC,QAAQ,EAAE;YACND,MAAM,EAAE,SAACE,SAAS,EAAK;gBACnB,IAAI;oBACA,IAAMF,MAAM,GAAGG,IAAI,CAACC,KAAK,CAACF,SAAS,CAAC,AAAC;oBACrC,IAAI,CAACF,MAAM,CAACK,GAAG,EAAE;wBACb,OAAO,2BAA2B,CAAC;oBACvC,CAAC;gBACL,EAAE,UAAM;oBACJ,OAAO,cAAc,CAAC;gBAC1B,CAAC;gBACD,OAAO,IAAI,CAAC;YAChB,CAAC;SACJ;KACJ,CAAC,AAAC;IAEH,qBACI,KAACR,UAAU;QACPS,QAAQ,EAAC,MAAM;QACfC,KAAK,EAAC,eAAe;QACrBC,WAAW,EAAC,2CAA2C;OACnDV,IAAI,CAACW,aAAa,CAAC,QAAQ,CAAC,EAClC,CACJ;AACN,CAAC,CAAC"}
@@ -1,32 +0,0 @@
1
- import {useForm} from '@mantine/form';
2
- import {CodeEditor} from './CodeEditor';
3
-
4
- export default () => {
5
- const form = useForm({
6
- initialValues: {
7
- config: '{"key":"value"}',
8
- },
9
- validate: {
10
- config: (jsonValue) => {
11
- try {
12
- const config = JSON.parse(jsonValue);
13
- if (!config.key) {
14
- return 'The key must have a value';
15
- }
16
- } catch {
17
- return 'Invalid JSON';
18
- }
19
- return null;
20
- },
21
- },
22
- });
23
-
24
- return (
25
- <CodeEditor
26
- language="json"
27
- label="Configuration"
28
- description="This JSON configuration is very important"
29
- {...form.getInputProps('config')}
30
- />
31
- );
32
- };