@coveord/plasma-mantine 49.0.0 → 49.1.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 (126) hide show
  1. package/.turbo/turbo-build.log +3 -3
  2. package/.turbo/turbo-test.log +12 -10
  3. package/dist/.tsbuildinfo +1 -1
  4. package/dist/cjs/components/button/Button.js +28 -0
  5. package/dist/cjs/components/button/Button.js.map +1 -0
  6. package/dist/cjs/components/button/ButtonWithDisabledTooltip.js +64 -0
  7. package/dist/cjs/components/button/ButtonWithDisabledTooltip.js.map +1 -0
  8. package/dist/cjs/components/button/index.js +8 -0
  9. package/dist/cjs/components/button/index.js.map +1 -0
  10. package/dist/cjs/components/collection/Collection.js +2 -1
  11. package/dist/cjs/components/collection/Collection.js.map +1 -1
  12. package/dist/cjs/components/date-range-picker/DateRangePickerInlineCalendar.js +3 -2
  13. package/dist/cjs/components/date-range-picker/DateRangePickerInlineCalendar.js.map +1 -1
  14. package/dist/cjs/components/index.js +2 -0
  15. package/dist/cjs/components/index.js.map +1 -1
  16. package/dist/cjs/components/inline-confirm/InlineConfirmButton.js +2 -2
  17. package/dist/cjs/components/inline-confirm/InlineConfirmButton.js.map +1 -1
  18. package/dist/cjs/components/inline-confirm/InlineConfirmPrompt.js +3 -2
  19. package/dist/cjs/components/inline-confirm/InlineConfirmPrompt.js.map +1 -1
  20. package/dist/cjs/components/menu/Menu.js +29 -0
  21. package/dist/cjs/components/menu/Menu.js.map +1 -0
  22. package/dist/cjs/components/menu/index.js +8 -0
  23. package/dist/cjs/components/menu/index.js.map +1 -0
  24. package/dist/cjs/components/modal-wizard/ModalWizard.js +4 -3
  25. package/dist/cjs/components/modal-wizard/ModalWizard.js.map +1 -1
  26. package/dist/cjs/components/table/TableDateRangePicker.js +2 -1
  27. package/dist/cjs/components/table/TableDateRangePicker.js.map +1 -1
  28. package/dist/cjs/components/table/TableHeader.js +2 -1
  29. package/dist/cjs/components/table/TableHeader.js.map +1 -1
  30. package/dist/cjs/index.js +6 -0
  31. package/dist/cjs/index.js.map +1 -1
  32. package/dist/cjs/theme/Theme.js +5 -0
  33. package/dist/cjs/theme/Theme.js.map +1 -1
  34. package/dist/cjs/utils/createPolymorphicComponent.js +14 -0
  35. package/dist/cjs/utils/createPolymorphicComponent.js.map +1 -0
  36. package/dist/cjs/utils/index.js +9 -0
  37. package/dist/cjs/utils/index.js.map +1 -0
  38. package/dist/cjs/utils/overrideComponent.js +29 -0
  39. package/dist/cjs/utils/overrideComponent.js.map +1 -0
  40. package/dist/definitions/components/button/Button.d.ts +16 -0
  41. package/dist/definitions/components/button/Button.d.ts.map +1 -0
  42. package/dist/definitions/components/button/ButtonWithDisabledTooltip.d.ts +24 -0
  43. package/dist/definitions/components/button/ButtonWithDisabledTooltip.d.ts.map +1 -0
  44. package/dist/definitions/components/button/index.d.ts +3 -0
  45. package/dist/definitions/components/button/index.d.ts.map +1 -0
  46. package/dist/definitions/components/collection/Collection.d.ts.map +1 -1
  47. package/dist/definitions/components/date-range-picker/DateRangePickerInlineCalendar.d.ts.map +1 -1
  48. package/dist/definitions/components/index.d.ts +2 -0
  49. package/dist/definitions/components/index.d.ts.map +1 -1
  50. package/dist/definitions/components/inline-confirm/InlineConfirmButton.d.ts +1 -1
  51. package/dist/definitions/components/inline-confirm/InlineConfirmButton.d.ts.map +1 -1
  52. package/dist/definitions/components/inline-confirm/InlineConfirmPrompt.d.ts.map +1 -1
  53. package/dist/definitions/components/menu/Menu.d.ts +16 -0
  54. package/dist/definitions/components/menu/Menu.d.ts.map +1 -0
  55. package/dist/definitions/components/menu/index.d.ts +2 -0
  56. package/dist/definitions/components/menu/index.d.ts.map +1 -0
  57. package/dist/definitions/components/modal-wizard/ModalWizard.d.ts.map +1 -1
  58. package/dist/definitions/components/table/TableDateRangePicker.d.ts.map +1 -1
  59. package/dist/definitions/components/table/TableHeader.d.ts.map +1 -1
  60. package/dist/definitions/index.d.ts +1 -1
  61. package/dist/definitions/index.d.ts.map +1 -1
  62. package/dist/definitions/theme/Theme.d.ts.map +1 -1
  63. package/dist/definitions/utils/createPolymorphicComponent.d.ts +3 -0
  64. package/dist/definitions/utils/createPolymorphicComponent.d.ts.map +1 -0
  65. package/dist/definitions/utils/index.d.ts +3 -0
  66. package/dist/definitions/utils/index.d.ts.map +1 -0
  67. package/dist/definitions/utils/overrideComponent.d.ts +10 -0
  68. package/dist/definitions/utils/overrideComponent.d.ts.map +1 -0
  69. package/dist/esm/components/button/Button.js +18 -0
  70. package/dist/esm/components/button/Button.js.map +1 -0
  71. package/dist/esm/components/button/ButtonWithDisabledTooltip.js +54 -0
  72. package/dist/esm/components/button/ButtonWithDisabledTooltip.js.map +1 -0
  73. package/dist/esm/components/button/index.js +3 -0
  74. package/dist/esm/components/button/index.js.map +1 -0
  75. package/dist/esm/components/collection/Collection.js +2 -1
  76. package/dist/esm/components/collection/Collection.js.map +1 -1
  77. package/dist/esm/components/date-range-picker/DateRangePickerInlineCalendar.js +2 -1
  78. package/dist/esm/components/date-range-picker/DateRangePickerInlineCalendar.js.map +1 -1
  79. package/dist/esm/components/index.js +2 -0
  80. package/dist/esm/components/index.js.map +1 -1
  81. package/dist/esm/components/inline-confirm/InlineConfirmButton.js +1 -1
  82. package/dist/esm/components/inline-confirm/InlineConfirmButton.js.map +1 -1
  83. package/dist/esm/components/inline-confirm/InlineConfirmPrompt.js +2 -1
  84. package/dist/esm/components/inline-confirm/InlineConfirmPrompt.js.map +1 -1
  85. package/dist/esm/components/menu/Menu.js +19 -0
  86. package/dist/esm/components/menu/Menu.js.map +1 -0
  87. package/dist/esm/components/menu/index.js +3 -0
  88. package/dist/esm/components/menu/index.js.map +1 -0
  89. package/dist/esm/components/modal-wizard/ModalWizard.js +3 -2
  90. package/dist/esm/components/modal-wizard/ModalWizard.js.map +1 -1
  91. package/dist/esm/components/table/TableDateRangePicker.js +2 -1
  92. package/dist/esm/components/table/TableDateRangePicker.js.map +1 -1
  93. package/dist/esm/components/table/TableHeader.js +2 -1
  94. package/dist/esm/components/table/TableHeader.js.map +1 -1
  95. package/dist/esm/index.js +1 -1
  96. package/dist/esm/index.js.map +1 -1
  97. package/dist/esm/theme/Theme.js +5 -0
  98. package/dist/esm/theme/Theme.js.map +1 -1
  99. package/dist/esm/utils/createPolymorphicComponent.js +8 -0
  100. package/dist/esm/utils/createPolymorphicComponent.js.map +1 -0
  101. package/dist/esm/utils/index.js +4 -0
  102. package/dist/esm/utils/index.js.map +1 -0
  103. package/dist/esm/utils/overrideComponent.js +19 -0
  104. package/dist/esm/utils/overrideComponent.js.map +1 -0
  105. package/package.json +5 -3
  106. package/src/components/button/Button.tsx +27 -0
  107. package/src/components/button/ButtonWithDisabledTooltip.tsx +58 -0
  108. package/src/components/button/__tests__/ButtonWithDisabledTooltip.spec.tsx +52 -0
  109. package/src/components/button/index.ts +2 -0
  110. package/src/components/collection/Collection.tsx +1 -1
  111. package/src/components/date-range-picker/DateRangePickerInlineCalendar.tsx +2 -1
  112. package/src/components/index.ts +2 -0
  113. package/src/components/inline-confirm/InlineConfirmButton.tsx +2 -1
  114. package/src/components/inline-confirm/InlineConfirmPrompt.tsx +2 -1
  115. package/src/components/menu/Menu.tsx +18 -0
  116. package/src/components/menu/index.ts +1 -0
  117. package/src/components/modal-wizard/ModalWizard.tsx +4 -2
  118. package/src/components/table/TableDateRangePicker.tsx +3 -1
  119. package/src/components/table/TableHeader.tsx +2 -1
  120. package/src/components/table/__tests__/TableActions.spec.tsx +1 -1
  121. package/src/index.ts +1 -1
  122. package/src/theme/Theme.tsx +5 -0
  123. package/src/utils/__tests__/overrideComponent.spec.tsx +74 -0
  124. package/src/utils/createPolymorphicComponent.ts +8 -0
  125. package/src/utils/index.ts +2 -0
  126. package/src/utils/overrideComponent.ts +18 -0
@@ -237,6 +237,11 @@ var plasmaTheme = {
237
237
  fontWeight: 500
238
238
  }
239
239
  }
240
+ },
241
+ ColorSwatch: {
242
+ defaultProps: {
243
+ size: 8
244
+ }
240
245
  }
241
246
  }
242
247
  };
@@ -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 },\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 },\n};\n"],"names":["plasmaTheme","colorScheme","fontFamily","black","color","primary","gray","defaultRadius","spacing","xs","sm","md","lg","xl","primaryColor","headings","fontWeight","sizes","h1","fontSize","lineHeight","undefined","h2","h3","h4","h5","h6","shadows","colors","PlasmaColors","components","Alert","defaultProps","icon","InfoSize24Px","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","Breadcrumbs","separator","ArrowHeadRightSize24Px","Loader","DateRangePicker","cell","textAlign","Anchor","hover","textDecoration","action","Checkbox","List","listStyleType","Radio","labelWrapper","display","alignItems","Popover","shadow","Badge","textTransform","padding"],"mappings":"AAAA;;;;+BAMaA;;;eAAAA;;;;;gCANsC;4BAC/B;4BAGO;AAEpB,IAAMA,cAAoC;IAC7C,2HAA2H;IAC3HC,aAAa;IACbC,YAAY;IACZC,OAAOC,mBAAK,CAACC,OAAO,CAACC,IAAI,CAAC,EAAE;IAC5BC,eAAe;IACfC,SAAS;QACLC,IAAI;QACJC,IAAI;QACJC,IAAI;QACJC,IAAI;QACJC,IAAI;IACR;IACAC,cAAc;IACdC,UAAU;QACNb,YAAY;QACZc,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;Q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;oBACFmD,eAAe;oBACfC,SAAS;oBACT5E,YAAY;gBAChB;YACJ;QACJ;IACJ;AACJ"}
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 },\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 },\n },\n },\n};\n"],"names":["plasmaTheme","colorScheme","fontFamily","black","color","primary","gray","defaultRadius","spacing","xs","sm","md","lg","xl","primaryColor","headings","fontWeight","sizes","h1","fontSize","lineHeight","undefined","h2","h3","h4","h5","h6","shadows","colors","PlasmaColors","components","Alert","defaultProps","icon","InfoSize24Px","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","Breadcrumbs","separator","ArrowHeadRightSize24Px","Loader","DateRangePicker","cell","textAlign","Anchor","hover","textDecoration","action","Checkbox","List","listStyleType","Radio","labelWrapper","display","alignItems","Popover","shadow","Badge","textTransform","padding","ColorSwatch"],"mappings":"AAAA;;;;+BAMaA;;;eAAAA;;;;;gCANsC;4BAC/B;4BAGO;AAEpB,IAAMA,cAAoC;IAC7C,2HAA2H;IAC3HC,aAAa;IACbC,YAAY;IACZC,OAAOC,mBAAK,CAACC,OAAO,CAACC,IAAI,CAAC,EAAE;IAC5BC,eAAe;IACfC,SAAS;QACLC,IAAI;QACJC,IAAI;QACJC,IAAI;QACJC,IAAI;QACJC,IAAI;IACR;IACAC,cAAc;IACdC,UAAU;QACNb,YAAY;QACZc,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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AAS;YACLxD,cAAc;gBACVyD,QAAQ;gBACRrB,WAAW,IAAI;YACnB;QACJ;QACAsB,OAAO;YACHtD,QAAQ;gBACJI,MAAM;oBACFmD,eAAe;oBACfC,SAAS;oBACT5E,YAAY;gBAChB;YACJ;QACJ;QACA6E,aAAa;YACT7D,cAAc;gBACVe,MAAM;YACV;QACJ;IACJ;AACJ"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "createPolymorphicComponent", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return createPolymorphicComponent;
9
+ }
10
+ });
11
+ var _utils = require("@mantine/utils");
12
+ var createPolymorphicComponent = _utils.createPolymorphicComponent;
13
+
14
+ //# sourceMappingURL=createPolymorphicComponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/utils/createPolymorphicComponent.ts"],"sourcesContent":["import {createPolymorphicComponent as mantineCreatePolymorphicComponent} from '@mantine/utils';\n\n/*\n * createPolymorphicComponent is already exported from @mantine/core, but there is an issue when using pnpm + typescript\n * that forces us to use it directly from @mantine/utils (see https://github.com/microsoft/TypeScript/issues/47663)\n * We are simply rexporting it here to avoid having to deal with this issue everywhere\n */\nexport const createPolymorphicComponent = mantineCreatePolymorphicComponent;\n"],"names":["createPolymorphicComponent","mantineCreatePolymorphicComponent"],"mappings":"AAAA;;;;+BAOaA;;;eAAAA;;;qBAPiE;AAOvE,IAAMA,6BAA6BC,iCAAiC"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ var _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
+ _exportStar(require("./createPolymorphicComponent"), exports);
7
+ _exportStar(require("./overrideComponent"), exports);
8
+
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/utils/index.ts"],"sourcesContent":["export * from './createPolymorphicComponent';\nexport * from './overrideComponent';\n"],"names":[],"mappings":"AAAA;;;;;oBAAc;oBACA"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Allows to override static properties from a component function
3
+ *
4
+ * @param component The component which holds the static properties
5
+ * @param properties The new static properties to assign on the component
6
+ * @returns A new component with the specified properties. It doesn't change the original component
7
+ * @example const Menu = overrideComponent(MantineMenu, {Item: MyMenuItem}); // Menu.Item will equal MyMenuItem
8
+ */ "use strict";
9
+ Object.defineProperty(exports, "__esModule", {
10
+ value: true
11
+ });
12
+ Object.defineProperty(exports, "overrideComponent", {
13
+ enumerable: true,
14
+ get: function() {
15
+ return overrideComponent;
16
+ }
17
+ });
18
+ var _toConsumableArray = require("@swc/helpers/lib/_to_consumable_array.js").default;
19
+ var overrideComponent = function(component, properties) {
20
+ var componentClone = function() {
21
+ for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
22
+ args[_key] = arguments[_key];
23
+ }
24
+ return component.apply(void 0, _toConsumableArray(args));
25
+ };
26
+ return Object.assign(componentClone, component, properties);
27
+ };
28
+
29
+ //# sourceMappingURL=overrideComponent.js.map
@@ -0,0 +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;;;;+BAAaA;;;eAAAA;;;;AAAN,IAAMA,oBAAoB,SAI7BC,WACAC,YAC6F;IAC7F,IAAMC,iBAAiB;yCAAIC;YAAAA;;eAAgCH,UAAAA,MAAAA,KAAAA,GAAU,mBAAGG;;IACxE,OAAOC,OAAOC,MAAM,CAACH,gBAAgBF,WAAWC;AACpD"}
@@ -0,0 +1,16 @@
1
+ /// <reference types="react" />
2
+ import { Button as MantineButton, ButtonProps as MantineButtonProps } from '@mantine/core';
3
+ import { ButtonWithDisabledTooltip, ButtonWithDisabledTooltipProps } from './ButtonWithDisabledTooltip';
4
+ export interface ButtonProps extends MantineButtonProps, ButtonWithDisabledTooltipProps {
5
+ }
6
+ export declare const Button: (<C = "button">(props: import("@mantine/utils").PolymorphicComponentProps<C, ButtonProps>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) & Omit<import("react").FunctionComponent<(ButtonProps & {
7
+ component?: any;
8
+ } & Omit<Pick<any, string | number | symbol>, "component" | keyof ButtonProps> & {
9
+ ref?: any;
10
+ }) | (ButtonProps & {
11
+ component: import("react").ElementType<any>;
12
+ })>, never> & {
13
+ Group: typeof MantineButton.Group;
14
+ DisabledTooltip: typeof ButtonWithDisabledTooltip;
15
+ };
16
+ //# sourceMappingURL=Button.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/components/button/Button.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,MAAM,IAAI,aAAa,EAAE,WAAW,IAAI,kBAAkB,EAAkB,MAAM,eAAe,CAAC;AAI1G,OAAO,EAAC,yBAAyB,EAAE,8BAA8B,EAAC,MAAM,6BAA6B,CAAC;AAEtG,MAAM,WAAW,WAAY,SAAQ,kBAAkB,EAAE,8BAA8B;CAAG;AAc1F,eAAO,MAAM,MAAM;;;;;;;WAGP,OAAO,cAAc,KAAK;qBAAmB,gCAAgC;CAC/E,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { Property } from 'csstype';
2
+ import { MouseEventHandler } from 'react';
3
+ export interface ButtonWithDisabledTooltipProps {
4
+ disabled?: boolean;
5
+ onClick?: MouseEventHandler<HTMLButtonElement>;
6
+ /**
7
+ * The tooltip message to display when disabled
8
+ */
9
+ disabledTooltip?: string;
10
+ /**
11
+ * The background color when disabled
12
+ *
13
+ * @default 'unset'
14
+ */
15
+ disabledHoverColor?: Property.BackgroundColor;
16
+ }
17
+ export declare const ButtonWithDisabledTooltip: (<C = "button">(props: import("@mantine/utils").PolymorphicComponentProps<C, ButtonWithDisabledTooltipProps>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) & Omit<import("react").FunctionComponent<(ButtonWithDisabledTooltipProps & {
18
+ component?: any;
19
+ } & Omit<Pick<any, string | number | symbol>, "component" | keyof ButtonWithDisabledTooltipProps> & {
20
+ ref?: any;
21
+ }) | (ButtonWithDisabledTooltipProps & {
22
+ component: import("react").ElementType<any>;
23
+ })>, never> & Record<string, never>;
24
+ //# sourceMappingURL=ButtonWithDisabledTooltip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ButtonWithDisabledTooltip.d.ts","sourceRoot":"","sources":["../../../../src/components/button/ButtonWithDisabledTooltip.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AACjC,OAAO,EAAa,iBAAiB,EAAC,MAAM,OAAO,CAAC;AAIpD,MAAM,WAAW,8BAA8B;IAC3C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IAC/C;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,QAAQ,CAAC,eAAe,CAAC;CACjD;AAoCD,eAAO,MAAM,yBAAyB;;;;;;mCAErC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './Button';
2
+ export { type ButtonWithDisabledTooltipProps } from './ButtonWithDisabledTooltip';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/button/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,OAAO,EAAC,KAAK,8BAA8B,EAAC,MAAM,6BAA6B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Collection.d.ts","sourceRoot":"","sources":["../../../../src/components/collection/Collection.tsx"],"names":[],"mappings":"AACA,OAAO,EAGH,YAAY,EAGZ,qBAAqB,EACrB,iBAAiB,EACjB,SAAS,EAIZ,MAAM,eAAe,CAAC;AACvB,OAAO,EAAC,cAAc,EAAC,MAAM,yBAAyB,CAAC;AAEvD,OAAO,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAGhC,OAAO,SAAS,MAAM,qBAAqB,CAAC;AAG5C,UAAU,eAAe,CAAC,CAAC,CACvB,SAAQ,IAAI,CAAC,qBAAqB,EAAE,gBAAgB,GAAG,mBAAmB,CAAC,EACvE,YAAY,CAAC,SAAS,CAAC,OAAO,SAAS,CAAC,CAAC;IAC7C;;OAEG;IACH,OAAO,EAAE,CAAC,CAAC;IACX;;;;;OAKG;IACH,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,SAAS,CAAC;IAChD;;;;OAIG;IACH,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC;IACZ;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,IAAI,CAAC;IAChC;;;;OAIG;IACH,YAAY,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C;;;;OAIG;IACH,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;IAClD;;;;;OAKG;IACH,YAAY,CAAC,EAAE,CAAC,KAAK,E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OAIG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,IAAI,CAAC;IAChC;;;;OAIG;IACH,YAAY,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C;;;;OAIG;IACH,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;IAClD;;;;;OAKG;IACH,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,KAAK,OAAO,CAAC;IACpC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;;OAIG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAWD,eAAO,MAAM,UAAU,+CAsHtB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"DateRangePickerInlineCalendar.d.ts","sourceRoot":"","sources":["../../../../src/components/date-range-picker/DateRangePickerInlineCalendar.tsx"],"names":[],"mappings":";AACA,OAAO,EAAC,oBAAoB,EAAiB,kBAAkB,EAAC,MAAM,gBAAgB,CAAC;AAGvF,OAAO,EAAC,qBAAqB,EAA8B,MAAM,+BAA+B,CAAC;AACjG,OAAO,EAA0B,4BAA4B,EAAC,MAAM,2BAA2B,CAAC;AAEhG,MAAM,WAAW,kCACb,SAAQ,IAAI,CAAC,4BAA4B,EAAE,YAAY,GAAG,UAAU,CAAC;IACrE;;OAEG;IACH,YAAY,EAAE,oBAAoB,CAAC;IACnC;;;;OAIG;IACH,OAAO,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAC/C;;OAEG;IACH,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB;;;;;;;;;OASG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;IAChD;;OAEG;IACH,kBAAkB,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,OAAO,GAAG,UAAU,CAAC,CAAC;CACvE;AAED,eAAO,MAAM,6BAA6B,4FAQvC,kCAAkC,gBAiEpC,CAAC"}
1
+ {"version":3,"file":"DateRangePickerInlineCalendar.d.ts","sourceRoot":"","sources":["../../../../src/components/date-range-picker/DateRangePickerInlineCalendar.tsx"],"names":[],"mappings":";AACA,OAAO,EAAC,oBAAoB,EAAiB,kBAAkB,EAAC,MAAM,gBAAgB,CAAC;AAIvF,OAAO,EAAC,qBAAqB,EAA8B,MAAM,+BAA+B,CAAC;AACjG,OAAO,EAA0B,4BAA4B,EAAC,MAAM,2BAA2B,CAAC;AAEhG,MAAM,WAAW,kCACb,SAAQ,IAAI,CAAC,4BAA4B,EAAE,YAAY,GAAG,UAAU,CAAC;IACrE;;OAEG;IACH,YAAY,EAAE,oBAAoB,CAAC;IACnC;;;;OAIG;IACH,OAAO,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAC/C;;OAEG;IACH,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB;;;;;;;;;OASG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;IAChD;;OAEG;IACH,kBAAkB,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,OAAO,GAAG,UAAU,CAAC,CAAC;CACvE;AAED,eAAO,MAAM,6BAA6B,4FAQvC,kCAAkC,gBAiEpC,CAAC"}
@@ -9,4 +9,6 @@ export * from './table';
9
9
  export * from './prompt';
10
10
  export * from './modal';
11
11
  export * from './modal-wizard';
12
+ export * from './button';
13
+ export * from './menu';
12
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC"}
@@ -1,5 +1,5 @@
1
- import { ButtonProps } from '@mantine/core';
2
1
  import { HTMLAttributes } from 'react';
2
+ import { ButtonProps } from '../button';
3
3
  interface InlineConfirmButtonProps extends ButtonProps, Omit<HTMLAttributes<HTMLButtonElement>, 'color'> {
4
4
  id: string;
5
5
  }
@@ -1 +1 @@
1
- {"version":3,"file":"InlineConfirmButton.d.ts","sourceRoot":"","sources":["../../../../src/components/inline-confirm/InlineConfirmButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAS,WAAW,EAAC,MAAM,eAAe,CAAC;AAClD,OAAO,EAAC,cAAc,EAAoB,MAAM,OAAO,CAAC;AAGxD,UAAU,wBAAyB,SAAQ,WAAW,EAAE,IAAI,CAAC,cAAc,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IACpG,EAAE,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,mBAAmB,UAAW,wBAAwB,gBAQlE,CAAC"}
1
+ {"version":3,"file":"InlineConfirmButton.d.ts","sourceRoot":"","sources":["../../../../src/components/inline-confirm/InlineConfirmButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAoB,MAAM,OAAO,CAAC;AAExD,OAAO,EAAS,WAAW,EAAC,MAAM,WAAW,CAAC;AAG9C,UAAU,wBAAyB,SAAQ,WAAW,EAAE,IAAI,CAAC,cAAc,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IACpG,EAAE,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,mBAAmB,UAAW,wBAAwB,gBAQlE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"InlineConfirmPrompt.d.ts","sourceRoot":"","sources":["../../../../src/components/inline-confirm/InlineConfirmPrompt.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,iBAAiB,EAAE,SAAS,EAAY,MAAM,OAAO,CAAC;AAI9D,UAAU,wBAAwB;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,SAAS,CAAC;IACjB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,WAAW,CAAC,EAAE,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,mBAAmB,EAAE,iBAAiB,CAAC,wBAAwB,CAkC3E,CAAC"}
1
+ {"version":3,"file":"InlineConfirmPrompt.d.ts","sourceRoot":"","sources":["../../../../src/components/inline-confirm/InlineConfirmPrompt.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,iBAAiB,EAAE,SAAS,EAAY,MAAM,OAAO,CAAC;AAK9D,UAAU,wBAAwB;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,SAAS,CAAC;IACjB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,WAAW,CAAC,EAAE,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,mBAAmB,EAAE,iBAAiB,CAAC,wBAAwB,CAkC3E,CAAC"}
@@ -0,0 +1,16 @@
1
+ /// <reference types="react" />
2
+ import { Menu as MantineMenu, MenuItemProps as MantineMenuItemProps } from '@mantine/core';
3
+ import { ButtonWithDisabledTooltipProps } from '../button';
4
+ export interface MenuItemProps extends MantineMenuItemProps, ButtonWithDisabledTooltipProps {
5
+ }
6
+ export declare const Menu: ((props: import("@mantine/core").MenuProps) => JSX.Element) & typeof MantineMenu & {
7
+ displayName: string;
8
+ Item: (<C = "button">(props: import("@mantine/utils").PolymorphicComponentProps<C, MenuItemProps>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) & Omit<import("react").FunctionComponent<(MenuItemProps & {
9
+ component?: any;
10
+ } & Omit<Pick<any, string | number | symbol>, "component" | keyof MenuItemProps> & {
11
+ ref?: any;
12
+ }) | (MenuItemProps & {
13
+ component: import("react").ElementType<any>;
14
+ })>, never> & Record<string, never>;
15
+ };
16
+ //# sourceMappingURL=Menu.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../../src/components/menu/Menu.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,IAAI,IAAI,WAAW,EAAE,aAAa,IAAI,oBAAoB,EAAC,MAAM,eAAe,CAAC;AAIzF,OAAO,EAAS,8BAA8B,EAAC,MAAM,WAAW,CAAC;AAEjE,MAAM,WAAW,aAAc,SAAQ,oBAAoB,EAAE,8BAA8B;CAAG;AAQ9F,eAAO,MAAM,IAAI;;;;;;;;;CAGf,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './Menu';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/menu/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ModalWizard.d.ts","sourceRoot":"","sources":["../../../../src/components/modal-wizard/ModalWizard.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA4B,YAAY,EAAS,UAAU,EAAY,SAAS,EAAC,MAAM,eAAe,CAAC;AAC9G,OAAO,EAAW,YAAY,EAAoB,MAAM,OAAO,CAAC;AAEhE,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAGlD,QAAA,MAAM,SAAS;;;;CAUZ,CAAC;AAEJ,KAAK,sBAAsB,GAAG,SAAS,CAAC,OAAO,SAAS,CAAC,CAAC;AAE1D,UAAU,gBACN,SAAQ,IAAI,CAAC,YAAY,CAAC,sBAAsB,CAAC,EAAE,YAAY,GAAG,QAAQ,CAAC,EACvE,IAAI,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC;IAC1C;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,OAAO,CAAC;IAEvB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,OAAO,CAAC;IAE3B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,OAAO,CAAC;IAEzB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,OAAO,CAAC;IAExB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,OAAO,CAAC;IAEjC;;SAEK;IACL,QAAQ,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC,CAAC;C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U,CAAC,OAAO,eAAe,CAAC,CAAC,CAAC;CACxD;AAED,UAAU,eAAe;IACrB,CAAC,KAAK,EAAE,gBAAgB,GAAG,YAAY,CAAC;IAExC,IAAI,EAAE,OAAO,eAAe,CAAC;CAChC;AAED,eAAO,MAAM,WAAW,EAAE,eA0HzB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"TableDateRangePicker.d.ts","sourceRoot":"","sources":["../../../../src/components/table/TableDateRangePicker.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAC,iBAAiB,EAAW,MAAM,OAAO,CAAC;AAClD,OAAO,EAAgC,kCAAkC,EAAC,MAAM,sBAAsB,CAAC;AACvG,OAAO,EAAC,qBAAqB,EAAC,MAAM,kDAAkD,CAAC;AAGvF,UAAU,yBACN,SAAQ,IAAI,CAAC,kCAAkC,EAAE,YAAY,GAAG,UAAU,GAAG,oBAAoB,CAAC;IAClG;;;;;;;;;;OAUG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;CACnD;AAED,eAAO,MAAM,oBAAoB,EAAE,iBAAiB,CAAC,yBAAyB,CAuC7E,CAAC"}
1
+ {"version":3,"file":"TableDateRangePicker.d.ts","sourceRoot":"","sources":["../../../../src/components/table/TableDateRangePicker.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAC,iBAAiB,EAAW,MAAM,OAAO,CAAC;AAGlD,OAAO,EAAgC,kCAAkC,EAAC,MAAM,sBAAsB,CAAC;AACvG,OAAO,EAAC,qBAAqB,EAAC,MAAM,kDAAkD,CAAC;AAGvF,UAAU,yBACN,SAAQ,IAAI,CAAC,kCAAkC,EAAE,YAAY,GAAG,UAAU,GAAG,oBAAoB,CAAC;IAClG;;;;;;;;;;OAUG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;CACnD;AAED,eAAO,MAAM,oBAAoB,EAAE,iBAAiB,CAAC,yBAAyB,CAuC7E,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"TableHeader.d.ts","sourceRoot":"","sources":["../../../../src/components/table/TableHeader.tsx"],"names":[],"mappings":"AACA,OAAO,EAAuB,YAAY,EAAS,SAAS,EAAiB,MAAM,eAAe,CAAC;AACnG,OAAO,EAAC,iBAAiB,EAAE,SAAS,EAAC,MAAM,OAAO,CAAC;AAInD,QAAA,MAAM,SAAS;;;;CAQZ,CAAC;AAEJ,KAAK,sBAAsB,GAAG,SAAS,CAAC,OAAO,SAAS,CAAC,CAAC;AAC1D,UAAU,gBAAiB,SAAQ,YAAY,CAAC,sBAAsB,CAAC;IAEnE,QAAQ,CAAC,EAAE,SAAS,CAAC;CACxB;AACD,eAAO,MAAM,WAAW,EAAE,iBAAiB,CAAC,gBAAgB,CA8B3D,CAAC"}
1
+ {"version":3,"file":"TableHeader.d.ts","sourceRoot":"","sources":["../../../../src/components/table/TableHeader.tsx"],"names":[],"mappings":"AACA,OAAO,EAAe,YAAY,EAAS,SAAS,EAAiB,MAAM,eAAe,CAAC;AAC3F,OAAO,EAAC,iBAAiB,EAAE,SAAS,EAAC,MAAM,OAAO,CAAC;AAKnD,QAAA,MAAM,SAAS;;;;CAQZ,CAAC;AAEJ,KAAK,sBAAsB,GAAG,SAAS,CAAC,OAAO,SAAS,CAAC,CAAC;AAC1D,UAAU,gBAAiB,SAAQ,YAAY,CAAC,sBAAsB,CAAC;IAEnE,QAAQ,CAAC,EAAE,SAAS,CAAC;CACxB;AACD,eAAO,MAAM,WAAW,EAAE,iBAAiB,CAAC,gBAAgB,CA8B3D,CAAC"}
@@ -7,7 +7,7 @@ export * from '@mantine/hooks';
7
7
  export { createColumnHelper, type ColumnDef } from '@tanstack/table-core';
8
8
  export * from './components';
9
9
  export * from '@mantine/form';
10
- export { Header, Table, type HeaderProps, Modal } from './components';
10
+ export { Header, Table, type HeaderProps, Modal, Button, type ButtonProps, Menu, type MenuItemProps } from './components';
11
11
  export { useForm, createFormContext } from './form';
12
12
  export * from './theme';
13
13
  declare module '@mantine/core' {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,eAAe,CAAC;AAEpC,OAAO,EAAC,YAAY,EAAC,MAAM,sBAAsB,CAAC;AAElD,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,YAAY,EAAC,iBAAiB,EAAC,MAAM,yBAAyB,CAAC;AAC/D,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAC,kBAAkB,EAAE,KAAK,SAAS,EAAC,MAAM,sBAAsB,CAAC;AACxE,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAE9B,OAAO,EAAC,MAAM,EAAE,KAAK,EAAE,KAAK,WAAW,EAAE,KAAK,EAAC,MAAM,cAAc,CAAC;AACpE,OAAO,EAAC,OAAO,EAAE,iBAAiB,EAAC,MAAM,QAAQ,CAAC;AAElD,cAAc,SAAS,CAAC;AAExB,OAAO,QAAQ,eAAe,CAAC;IAC3B,UAAiB,0BAA0B;QAEvC,MAAM,EAAE,MAAM,CAAC,MAAM,OAAO,YAAY,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,EAAE,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC;KAChF;CACJ"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,eAAe,CAAC;AAEpC,OAAO,EAAC,YAAY,EAAC,MAAM,sBAAsB,CAAC;AAElD,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,YAAY,EAAC,iBAAiB,EAAC,MAAM,yBAAyB,CAAC;AAC/D,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAC,kBAAkB,EAAE,KAAK,SAAS,EAAC,MAAM,sBAAsB,CAAC;AACxE,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAE9B,OAAO,EAAC,MAAM,EAAE,KAAK,EAAE,KAAK,WAAW,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,IAAI,EAAE,KAAK,aAAa,EAAC,MAAM,cAAc,CAAC;AACxH,OAAO,EAAC,OAAO,EAAE,iBAAiB,EAAC,MAAM,QAAQ,CAAC;AAElD,cAAc,SAAS,CAAC;AAExB,OAAO,QAAQ,eAAe,CAAC;IAC3B,UAAiB,0BAA0B;QAEvC,MAAM,EAAE,MAAM,CAAC,MAAM,OAAO,YAAY,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,EAAE,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC;KAChF;CACJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"Theme.d.ts","sourceRoot":"","sources":["../../../src/theme/Theme.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAqB,oBAAoB,EAAoB,MAAM,eAAe,CAAC;AAI1F,eAAO,MAAM,WAAW,EAAE,oBAiLzB,CAAC"}
1
+ {"version":3,"file":"Theme.d.ts","sourceRoot":"","sources":["../../../src/theme/Theme.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAqB,oBAAoB,EAAoB,MAAM,eAAe,CAAC;AAI1F,eAAO,MAAM,WAAW,EAAE,oBAsLzB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { createPolymorphicComponent as mantineCreatePolymorphicComponent } from '@mantine/utils';
2
+ export declare const createPolymorphicComponent: typeof mantineCreatePolymorphicComponent;
3
+ //# sourceMappingURL=createPolymorphicComponent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createPolymorphicComponent.d.ts","sourceRoot":"","sources":["../../../src/utils/createPolymorphicComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,0BAA0B,IAAI,iCAAiC,EAAC,MAAM,gBAAgB,CAAC;AAO/F,eAAO,MAAM,0BAA0B,0CAAoC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './createPolymorphicComponent';
2
+ export * from './overrideComponent';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qBAAqB,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Allows to override static properties from a component function
3
+ *
4
+ * @param component The component which holds the static properties
5
+ * @param properties The new static properties to assign on the component
6
+ * @returns A new component with the specified properties. It doesn't change the original component
7
+ * @example const Menu = overrideComponent(MantineMenu, {Item: MyMenuItem}); // Menu.Item will equal MyMenuItem
8
+ */
9
+ export declare const overrideComponent: <Component extends (...args: Parameters<Component>) => ReturnType<Component>, StaticProperties = Record<keyof Component, never>>(component: Component, properties: StaticProperties) => ((...args: Parameters<Component>) => ReturnType<Component>) & Component & StaticProperties;
10
+ //# sourceMappingURL=overrideComponent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"overrideComponent.d.ts","sourceRoot":"","sources":["../../../src/utils/overrideComponent.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,oRAS7B,CAAC"}
@@ -0,0 +1,18 @@
1
+ import _object_spread from "@swc/helpers/src/_object_spread.mjs";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { Button as MantineButton, useMantineTheme } from "@mantine/core";
4
+ import { forwardRef } from "react";
5
+ import { createPolymorphicComponent } from "../../utils";
6
+ import { ButtonWithDisabledTooltip } from "./ButtonWithDisabledTooltip";
7
+ var _Button = /*#__PURE__*/ forwardRef(function(props, ref) {
8
+ var theme = useMantineTheme();
9
+ return /*#__PURE__*/ _jsx(ButtonWithDisabledTooltip, _object_spread({
10
+ component: MantineButton,
11
+ ref: ref,
12
+ disabledHoverColor: theme.colors.gray[2]
13
+ }, props));
14
+ });
15
+ export var Button = createPolymorphicComponent(_Button);
16
+ Button.DisabledTooltip = ButtonWithDisabledTooltip;
17
+
18
+ //# sourceMappingURL=Button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/button/Button.tsx"],"sourcesContent":["import {Button as MantineButton, ButtonProps as MantineButtonProps, useMantineTheme} from '@mantine/core';\nimport {forwardRef} from 'react';\n\nimport {createPolymorphicComponent} from '../../utils';\nimport {ButtonWithDisabledTooltip, ButtonWithDisabledTooltipProps} from './ButtonWithDisabledTooltip';\n\nexport interface ButtonProps extends MantineButtonProps, ButtonWithDisabledTooltipProps {}\n\nconst _Button = forwardRef<HTMLButtonElement, ButtonProps>((props, ref) => {\n const theme = useMantineTheme();\n return (\n <ButtonWithDisabledTooltip\n component={MantineButton}\n ref={ref}\n disabledHoverColor={theme.colors.gray[2]}\n {...props}\n />\n );\n});\n\nexport const Button = createPolymorphicComponent<\n 'button',\n ButtonProps,\n {Group: typeof MantineButton.Group; DisabledTooltip: typeof ButtonWithDisabledTooltip}\n>(_Button);\n\nButton.DisabledTooltip = ButtonWithDisabledTooltip;\n"],"names":["Button","MantineButton","useMantineTheme","forwardRef","createPolymorphicComponent","ButtonWithDisabledTooltip","_Button","props","ref","theme","component","disabledHoverColor","colors","gray","DisabledTooltip"],"mappings":"AAAA;;AAAA,SAAQA,UAAUC,aAAa,EAAqCC,eAAe,QAAO,gBAAgB;AAC1G,SAAQC,UAAU,QAAO,QAAQ;AAEjC,SAAQC,0BAA0B,QAAO,cAAc;AACvD,SAAQC,yBAAyB,QAAuC,8BAA8B;AAItG,IAAMC,wBAAUH,WAA2C,SAACI,OAAOC,KAAQ;IACvE,IAAMC,QAAQP;IACd,qBACI,KAACG;QACGK,WAAWT;QACXO,KAAKA;QACLG,oBAAoBF,MAAMG,MAAM,CAACC,IAAI,CAAC,EAAE;OACpCN;AAGhB;AAEA,OAAO,IAAMP,SAASI,2BAIpBE,SAAS;AAEXN,OAAOc,eAAe,GAAGT"}
@@ -0,0 +1,54 @@
1
+ import _object_spread from "@swc/helpers/src/_object_spread.mjs";
2
+ import _object_spread_props from "@swc/helpers/src/_object_spread_props.mjs";
3
+ import _object_without_properties from "@swc/helpers/src/_object_without_properties.mjs";
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ import { Box, Tooltip } from "@mantine/core";
6
+ import { forwardRef } from "react";
7
+ import { createPolymorphicComponent } from "../../utils";
8
+ var _ButtonWithDisabledTooltip = /*#__PURE__*/ forwardRef(function(_param, ref) {
9
+ var disabledTooltip = _param.disabledTooltip, disabled = _param.disabled, onClick = _param.onClick, tmp = _param.disabledHoverColor, hoverColor = tmp === void 0 ? "unset" : tmp, others = _object_without_properties(_param, [
10
+ "disabledTooltip",
11
+ "disabled",
12
+ "onClick",
13
+ "disabledHoverColor"
14
+ ]);
15
+ return disabledTooltip ? /*#__PURE__*/ _jsx(Tooltip, {
16
+ label: disabledTooltip,
17
+ disabled: !disabled,
18
+ children: /*#__PURE__*/ _jsx(Box, _object_spread(_object_spread_props(_object_spread({
19
+ component: "button",
20
+ ref: ref
21
+ }, disabled ? {
22
+ "data-disabled": true
23
+ } : {}), {
24
+ sx: function(theme) {
25
+ return {
26
+ "&[data-disabled]": {
27
+ pointerEvents: "all",
28
+ color: theme.colors.gray[5]
29
+ },
30
+ "&[data-disabled]:hover": {
31
+ backgroundColor: hoverColor,
32
+ cursor: "not-allowed"
33
+ }
34
+ };
35
+ },
36
+ onClick: function(event) {
37
+ if (disabled) {
38
+ event.preventDefault();
39
+ event.stopPropagation();
40
+ } else {
41
+ onClick === null || onClick === void 0 ? void 0 : onClick(event);
42
+ }
43
+ }
44
+ }), others))
45
+ }) : /*#__PURE__*/ _jsx(Box, _object_spread({
46
+ component: "button",
47
+ ref: ref,
48
+ disabled: disabled,
49
+ onClick: onClick
50
+ }, others));
51
+ });
52
+ export var ButtonWithDisabledTooltip = createPolymorphicComponent(_ButtonWithDisabledTooltip);
53
+
54
+ //# sourceMappingURL=ButtonWithDisabledTooltip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/button/ButtonWithDisabledTooltip.tsx"],"sourcesContent":["import {Box, Tooltip} from '@mantine/core';\nimport {Property} from 'csstype';\nimport {forwardRef, MouseEventHandler} from 'react';\n\nimport {createPolymorphicComponent} from '../../utils';\n\nexport interface ButtonWithDisabledTooltipProps {\n disabled?: boolean;\n onClick?: MouseEventHandler<HTMLButtonElement>;\n /**\n * The tooltip message to display when disabled\n */\n disabledTooltip?: string;\n /**\n * The background color when disabled\n *\n * @default 'unset'\n */\n disabledHoverColor?: Property.BackgroundColor;\n}\n\nconst _ButtonWithDisabledTooltip = forwardRef<HTMLButtonElement, ButtonWithDisabledTooltipProps>(\n ({disabledTooltip, disabled, onClick, disabledHoverColor: hoverColor = 'unset', ...others}, ref) =>\n disabledTooltip ? (\n <Tooltip label={disabledTooltip} disabled={!disabled}>\n <Box\n component=\"button\"\n ref={ref}\n {...(disabled ? {'data-disabled': true} : {})}\n sx={(theme) => ({\n '&[data-disabled]': {\n pointerEvents: 'all',\n color: theme.colors.gray[5],\n },\n '&[data-disabled]:hover': {\n backgroundColor: hoverColor,\n cursor: 'not-allowed',\n },\n })}\n onClick={(event) => {\n if (disabled) {\n event.preventDefault();\n event.stopPropagation();\n } else {\n onClick?.(event);\n }\n }}\n {...others}\n />\n </Tooltip>\n ) : (\n <Box component=\"button\" ref={ref} disabled={disabled} onClick={onClick} {...others} />\n )\n);\n\nexport const ButtonWithDisabledTooltip = createPolymorphicComponent<'button', ButtonWithDisabledTooltipProps>(\n _ButtonWithDisabledTooltip\n);\n"],"names":["Box","Tooltip","forwardRef","createPolymorphicComponent","_ButtonWithDisabledTooltip","ref","disabledTooltip","disabled","onClick","hoverColor","disabledHoverColor","others","label","component","sx","theme","pointerEvents","color","colors","gray","backgroundColor","cursor","event","preventDefault","stopPropagation","ButtonWithDisabledTooltip"],"mappings":"AAAA;;;;AAAA,SAAQA,GAAG,EAAEC,OAAO,QAAO,gBAAgB;AAE3C,SAAQC,UAAU,QAA0B,QAAQ;AAEpD,SAAQC,0BAA0B,QAAO,cAAc;AAiBvD,IAAMC,2CAA6BF,WAC/B,iBAA4FG;QAA1FC,yBAAAA,iBAAiBC,kBAAAA,UAAUC,iBAAAA,SAA6BC,aAApBC,oBAAoBD,aAAAA,iBAAa,UAAbA,KAAyBE;QAAjFL;QAAiBC;QAAUC;QAASE;;IAClCJ,OAAAA,gCACI,KAACL;QAAQW,OAAON;QAAiBC,UAAU,CAACA;kBACxC,cAAA,KAACP;YACGa,WAAU;YACVR,KAAKA;WACAE,WAAW;YAAC,iBAAiB,IAAI;QAAA,IAAI,CAAC,CAAC;YAC5CO,IAAI,SAACC;uBAAW;oBACZ,oBAAoB;wBAChBC,eAAe;wBACfC,OAAOF,MAAMG,MAAM,CAACC,IAAI,CAAC,EAAE;oBAC/B;oBACA,0BAA0B;wBACtBC,iBAAiBX;wBACjBY,QAAQ;oBACZ;gBACJ;;YACAb,SAAS,SAACc,OAAU;gBAChB,IAAIf,UAAU;oBACVe,MAAMC,cAAc;oBACpBD,MAAME,eAAe;gBACzB,OAAO;oBACHhB,oBAAAA,qBAAAA,KAAAA,IAAAA,QAAUc;gBACd,CAAC;YACL;YACIX;uBAIZ,KAACX;QAAIa,WAAU;QAASR,KAAKA;QAAKE,UAAUA;QAAUC,SAASA;OAAaG,QAC/E;;AAGT,OAAO,IAAMc,4BAA4BtB,2BACrCC,4BACF"}
@@ -0,0 +1,3 @@
1
+ export * from "./Button";
2
+
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/button/index.ts"],"sourcesContent":["export * from './Button';\nexport {type ButtonWithDisabledTooltipProps} from './ButtonWithDisabledTooltip';\n"],"names":[],"mappings":"AAAA,cAAc,WAAW"}
@@ -3,9 +3,10 @@ import _object_spread_props from "@swc/helpers/src/_object_spread_props.mjs";
3
3
  import _object_without_properties from "@swc/helpers/src/_object_without_properties.mjs";
4
4
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
5
  import { AddSize16Px } from "@coveord/plasma-react-icons";
6
- import { Box, Button, Group, Input, Stack, Tooltip, useComponentDefaultProps } from "@mantine/core";
6
+ import { Box, Group, Input, Stack, Tooltip, useComponentDefaultProps } from "@mantine/core";
7
7
  import { useDidUpdate, useId } from "@mantine/hooks";
8
8
  import { DragDropContext, Droppable } from "react-beautiful-dnd";
9
+ import { Button } from "../button";
9
10
  import useStyles from "./Collection.styles";
10
11
  import { CollectionItem } from "./CollectionItem";
11
12
  var defaultProps = {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/collection/Collection.tsx"],"sourcesContent":["import {AddSize16Px} from '@coveord/plasma-react-icons';\nimport {\n Box,\n Button,\n DefaultProps,\n Group,\n Input,\n InputWrapperBaseProps,\n MantineNumberSize,\n Selectors,\n Stack,\n Tooltip,\n useComponentDefaultProps,\n} from '@mantine/core';\nimport {ReorderPayload} from '@mantine/form/lib/types';\nimport {useDidUpdate, useId} from '@mantine/hooks';\nimport {ReactNode} from 'react';\nimport {DragDropContext, Droppable} from 'react-beautiful-dnd';\n\nimport useStyles from './Collection.styles';\nimport {CollectionItem} from './CollectionItem';\n\ninterface CollectionProps<T>\n extends Omit<InputWrapperBaseProps, 'inputContainer' | 'inputWrapperOrder'>,\n DefaultProps<Selectors<typeof useStyles>> {\n /**\n * The default value each new item should have\n */\n newItem: T;\n /**\n * A render function called for each item passed in the `value` prop.\n *\n * @param item The current item's value\n * @param index The current item's index\n */\n children: (item: T, index: number) => ReactNode;\n /**\n * The list of items to display inside the collection\n *\n * @default []\n */\n value?: T[];\n /**\n * Unused, has no effect\n */\n onFocus?: () => void;\n /**\n * Function called whenever the value needs to be updated\n *\n * @param value The whole list of items after the change\n */\n onChange?: (value: T[]) => void;\n /**\n * Function called after an item is removed from the collection using the remove button\n *\n * @param itemIndex The index of the item that was removed\n */\n onRemoveItem?: (itemIndex: number) => void;\n /**\n * Function that gets called whenever a collection item needs to be reordered\n *\n * @param payload The origin and destination index of the item to reorder\n */\n onReorderItem?: (payload: ReorderPayload) => void;\n /**\n * Function that gets called when a new item needs to be added to the collection\n *\n * @param value The the value of the item to insert\n * @param index The index of the new item to insert\n */\n onInsertItem?: (value: T, index: number) => void;\n /**\n * Whether the collection should have drag and drop behavior enabled\n *\n * @default false\n */\n draggable?: boolean;\n /**\n * Whether the collection is disabled, or in other words in read only mode\n *\n * @default false\n */\n disabled?: boolean;\n /**\n * Function that determines if the add item button should be enabled given the current items of the collection.\n * The button is always enabled if this props remains undefined\n *\n * @param values The current items of the collection\n */\n allowAdd?: (values: T[]) => boolean;\n /**\n * The label of the add item button\n *\n * @default \"Add item\"\n */\n addLabel?: string;\n /**\n * The tooltip text displayed when hovering over the disabled add item button\n *\n * @default 'There is already an empty item'\n */\n addDisabledTooltip?: string;\n /**\n * The spacing between the colleciton items\n *\n * @default 'xs'\n */\n spacing?: MantineNumberSize;\n /**\n * Whether the collection is required. When required is true, the collection will hide the remove button if there is only one item\n *\n * @default false\n */\n required?: boolean;\n}\n\nconst defaultProps: Partial<CollectionProps<unknown>> = {\n draggable: false,\n addLabel: 'Add item',\n addDisabledTooltip: 'There is already an empty item',\n disabled: false,\n spacing: 'xs',\n required: false,\n};\n\nexport const Collection = <T,>(props: CollectionProps<T>) => {\n const {\n value,\n onChange,\n onRemoveItem,\n onReorderItem,\n onInsertItem,\n disabled,\n draggable,\n children,\n spacing,\n required,\n newItem,\n addLabel,\n addDisabledTooltip,\n allowAdd,\n label,\n labelProps,\n description,\n descriptionProps,\n error,\n errorProps,\n\n // Style props\n classNames,\n className,\n styles,\n unstyled,\n\n ...others\n } = useComponentDefaultProps('Collection', defaultProps as CollectionProps<T>, props);\n const {classes, cx} = useStyles(null, {classNames, name: 'Collection', styles, unstyled});\n const collectionID = useId('dnd-droppable');\n\n const hasOnlyOneItem = value.length === 1;\n\n /**\n * Enforcing onChange when the value is modified will make sure the errors are carried through.\n */\n useDidUpdate(() => {\n onChange?.(value);\n }, [JSON.stringify(value)]);\n\n const _label = label ? (\n <Input.Label required={required} {...labelProps}>\n {label}\n </Input.Label>\n ) : null;\n\n const _description = description ? (\n <Input.Description {...descriptionProps}>{description}</Input.Description>\n ) : null;\n const _error = error ? <Input.Error {...errorProps}>{error}</Input.Error> : null;\n const _header =\n _label || _description ? (\n <Box mb=\"sm\">\n {_label}\n {_description}\n </Box>\n ) : null;\n\n const items = value.map((item, index) => (\n <CollectionItem\n key={index}\n disabled={disabled}\n draggable={draggable}\n index={index}\n onRemove={() => onRemoveItem?.(index)}\n styles={styles}\n removable={!(required && hasOnlyOneItem)}\n >\n {children(item, index)}\n </CollectionItem>\n ));\n\n const addAllowed = allowAdd?.(value) ?? true;\n\n const _addButton = disabled ? null : (\n <Group>\n <Tooltip label={addDisabledTooltip} disabled={addAllowed}>\n <Box>\n <Button\n variant=\"subtle\"\n leftIcon={<AddSize16Px height={16} />}\n onClick={() => onInsertItem(newItem, value?.length ?? 0)}\n disabled={!addAllowed}\n >\n {addLabel}\n </Button>\n </Box>\n </Tooltip>\n </Group>\n );\n\n return (\n <DragDropContext\n onDragEnd={({destination, source}) => onReorderItem({from: source.index, to: destination?.index || 0})}\n >\n <Droppable direction=\"vertical\" droppableId={collectionID}>\n {(provided) => (\n <Box\n {...provided.droppableProps}\n ref={provided.innerRef}\n className={cx(classes.root, className)}\n {...others}\n >\n {_header}\n <Stack spacing={spacing}>\n {items}\n {provided.placeholder}\n {_addButton}\n {_error}\n </Stack>\n </Box>\n )}\n </Droppable>\n </DragDropContext>\n );\n};\n"],"names":["AddSize16Px","Box","Button","Group","Input","Stack","Tooltip","useComponentDefaultProps","useDidUpdate","useId","DragDropContext","Droppable","useStyles","CollectionItem","defaultProps","draggable","addLabel","addDisabledTooltip","disabled","spacing","required","Collection","props","value","onChange","onRemoveItem","onReorderItem","onInsertItem","children","newItem","allowAdd","label","labelProps","description","descriptionProps","error","errorProps","classNames","className","styles","unstyled","others","name","classes","cx","collectionID","hasOnlyOneItem","length","JSON","stringify","_label","Label","_description","Description","_error","Error","_header","mb","items","map","item","index","onRemove","removable","addAllowed","_addButton","variant","leftIcon","height","onClick","onDragEnd","destination","source","from","to","direction","droppableId","provided","droppableProps","ref","innerRef","root","placeholder"],"mappings":"AAAA;;;;AAAA,SAAQA,WAAW,QAAO,8BAA8B;AACxD,SACIC,GAAG,EACHC,MAAM,EAENC,KAAK,EACLC,KAAK,EAILC,KAAK,EACLC,OAAO,EACPC,wBAAwB,QACrB,gBAAgB;AAEvB,SAAQC,YAAY,EAAEC,KAAK,QAAO,iBAAiB;AAEnD,SAAQC,eAAe,EAAEC,SAAS,QAAO,sBAAsB;AAE/D,OAAOC,eAAe,sBAAsB;AAC5C,SAAQC,cAAc,QAAO,mBAAmB;AAgGhD,IAAMC,eAAkD;IACpDC,WAAW,KAAK;IAChBC,UAAU;IACVC,oBAAoB;IACpBC,UAAU,KAAK;IACfC,SAAS;IACTC,UAAU,KAAK;AACnB;AAEA,OAAO,IAAMC,aAAa,SAAKC,OAA8B;IACzD,IA6BIf,4BAAAA,yBAAyB,cAAcO,cAAoCQ,QA5B3EC,QA4BAhB,0BA5BAgB,OACAC,WA2BAjB,0BA3BAiB,UACAC,eA0BAlB,0BA1BAkB,cACAC,gBAyBAnB,0BAzBAmB,eACAC,eAwBApB,0BAxBAoB,cACAT,WAuBAX,0BAvBAW,UACAH,YAsBAR,0BAtBAQ,WACAa,WAqBArB,0BArBAqB,UACAT,UAoBAZ,0BApBAY,SACAC,WAmBAb,0BAnBAa,UACAS,UAkBAtB,0BAlBAsB,SACAb,WAiBAT,0BAjBAS,UACAC,qBAgBAV,0BAhBAU,oBACAa,WAeAvB,0BAfAuB,UACAC,QAcAxB,0BAdAwB,OACAC,aAaAzB,0BAbAyB,YACAC,cAYA1B,0BAZA0B,aACAC,mBAWA3B,0BAXA2B,kBACAC,QAUA5B,0BAVA4B,OACAC,aASA7B,0BATA6B,YAEA,cAAc;IACdC,aAMA9B,0BANA8B,YACAC,YAKA/B,0BAL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AAAA,qBAAAA,sBAAAA,KAAAA,IAAAA,SAAWP,oBAAXO,uBAAAA,YAAqB,IAAI;QASaP;IAPzD,IAAM0C,aAAa/C,WAAW,IAAI,iBAC9B,KAACf;kBACG,cAAA,KAACG;YAAQyB,OAAOd;YAAoBC,UAAU8C;sBAC1C,cAAA,KAAC/D;0BACG,cAAA,KAACC;oBACGgE,SAAQ;oBACRC,wBAAU,KAACnE;wBAAYoE,QAAQ;;oBAC/BC,SAAS;wBAAM1C,OAAAA,aAAaE,SAASN,CAAAA,gBAAAA,kBAAAA,mBAAAA,KAAAA,IAAAA,MAAOwB,MAAM,cAAbxB,2BAAAA,gBAAiB,CAAC;;oBACvDL,UAAU,CAAC8C;8BAEVhD;;;;MAKpB;IAED,qBACI,KAACN;QACG4D,WAAW;gBAAEC,oBAAAA,aAAaC,eAAAA;YAAY9C,OAAAA,cAAc;gBAAC+C,MAAMD,OAAOX,KAAK;gBAAEa,IAAIH,CAAAA,wBAAAA,yBAAAA,KAAAA,IAAAA,YAAaV,KAAK,AAAD,KAAK;YAAC;;kBAEpG,cAAA,KAAClD;YAAUgE,WAAU;YAAWC,aAAa/B;sBACxC,SAACgC;qCACE,MAAC5E,iFACO4E,SAASC,cAAc;oBAC3BC,KAAKF,SAASG,QAAQ;oBACtB1C,WAAWM,GAAGD,QAAQsC,IAAI,EAAE3C;oBACxBG;;wBAEHe;sCACD,MAACnD;4BAAMc,SAASA;;gCACXuC;gCACAmB,SAASK,WAAW;gCACpBjB;gCACAX;;;;;;;;AAO7B,EAAE"}
1
+ {"version":3,"sources":["../../../../src/components/collection/Collection.tsx"],"sourcesContent":["import {AddSize16Px} from '@coveord/plasma-react-icons';\nimport {\n Box,\n DefaultProps,\n Group,\n Input,\n InputWrapperBaseProps,\n MantineNumberSize,\n Selectors,\n Stack,\n Tooltip,\n useComponentDefaultProps,\n} from '@mantine/core';\nimport {ReorderPayload} from '@mantine/form/lib/types';\nimport {useDidUpdate, useId} from '@mantine/hooks';\nimport {ReactNode} from 'react';\nimport {DragDropContext, Droppable} from 'react-beautiful-dnd';\n\nimport {Button} from '../button';\nimport useStyles from './Collection.styles';\nimport {CollectionItem} from './CollectionItem';\n\ninterface CollectionProps<T>\n extends Omit<InputWrapperBaseProps, 'inputContainer' | 'inputWrapperOrder'>,\n DefaultProps<Selectors<typeof useStyles>> {\n /**\n * The default value each new item should have\n */\n newItem: T;\n /**\n * A render function called for each item passed in the `value` prop.\n *\n * @param item The current item's value\n * @param index The current item's index\n */\n children: (item: T, index: number) => ReactNode;\n /**\n * The list of items to display inside the collection\n *\n * @default []\n */\n value?: T[];\n /**\n * Unused, has no effect\n */\n onFocus?: () => void;\n /**\n * Function called whenever the value needs to be updated\n *\n * @param value The whole list of items after the change\n */\n onChange?: (value: T[]) => void;\n /**\n * Function called after an item is removed from the collection using the remove button\n *\n * @param itemIndex The index of the item that was removed\n */\n onRemoveItem?: (itemIndex: number) => void;\n /**\n * Function that gets called whenever a collection item needs to be reordered\n *\n * @param payload The origin and destination index of the item to reorder\n */\n onReorderItem?: (payload: ReorderPayload) => void;\n /**\n * Function that gets called when a new item needs to be added to the collection\n *\n * @param value The the value of the item to insert\n * @param index The index of the new item to insert\n */\n onInsertItem?: (value: T, index: number) => void;\n /**\n * Whether the collection should have drag and drop behavior enabled\n *\n * @default false\n */\n draggable?: boolean;\n /**\n * Whether the collection is disabled, or in other words in read only mode\n *\n * @default false\n */\n disabled?: boolean;\n /**\n * Function that determines if the add item button should be enabled given the current items of the collection.\n * The button is always enabled if this props remains undefined\n *\n * @param values The current items of the collection\n */\n allowAdd?: (values: T[]) => boolean;\n /**\n * The label of the add item button\n *\n * @default \"Add item\"\n */\n addLabel?: string;\n /**\n * The tooltip text displayed when hovering over the disabled add item button\n *\n * @default 'There is already an empty item'\n */\n addDisabledTooltip?: string;\n /**\n * The spacing between the colleciton items\n *\n * @default 'xs'\n */\n spacing?: MantineNumberSize;\n /**\n * Whether the collection is required. When required is true, the collection will hide the remove button if there is only one item\n *\n * @default false\n */\n required?: boolean;\n}\n\nconst defaultProps: Partial<CollectionProps<unknown>> = {\n draggable: false,\n addLabel: 'Add item',\n addDisabledTooltip: 'There is already an empty item',\n disabled: false,\n spacing: 'xs',\n required: false,\n};\n\nexport const Collection = <T,>(props: CollectionProps<T>) => {\n const {\n value,\n onChange,\n onRemoveItem,\n onReorderItem,\n onInsertItem,\n disabled,\n draggable,\n children,\n spacing,\n required,\n newItem,\n addLabel,\n addDisabledTooltip,\n allowAdd,\n label,\n labelProps,\n description,\n descriptionProps,\n error,\n errorProps,\n\n // Style props\n classNames,\n className,\n styles,\n unstyled,\n\n ...others\n } = useComponentDefaultProps('Collection', defaultProps as CollectionProps<T>, props);\n const {classes, cx} = useStyles(null, {classNames, name: 'Collection', styles, unstyled});\n const collectionID = useId('dnd-droppable');\n\n const hasOnlyOneItem = value.length === 1;\n\n /**\n * Enforcing onChange when the value is modified will make sure the errors are carried through.\n */\n useDidUpdate(() => {\n onChange?.(value);\n }, [JSON.stringify(value)]);\n\n const _label = label ? (\n <Input.Label required={required} {...labelProps}>\n {label}\n </Input.Label>\n ) : null;\n\n const _description = description ? (\n <Input.Description {...descriptionProps}>{description}</Input.Description>\n ) : null;\n const _error = error ? <Input.Error {...errorProps}>{error}</Input.Error> : null;\n const _header =\n _label || _description ? (\n <Box mb=\"sm\">\n {_label}\n {_description}\n </Box>\n ) : null;\n\n const items = value.map((item, index) => (\n <CollectionItem\n key={index}\n disabled={disabled}\n draggable={draggable}\n index={index}\n onRemove={() => onRemoveItem?.(index)}\n styles={styles}\n removable={!(required && hasOnlyOneItem)}\n >\n {children(item, index)}\n </CollectionItem>\n ));\n\n const addAllowed = allowAdd?.(value) ?? true;\n\n const _addButton = disabled ? null : (\n <Group>\n <Tooltip label={addDisabledTooltip} disabled={addAllowed}>\n <Box>\n <Button\n variant=\"subtle\"\n leftIcon={<AddSize16Px height={16} />}\n onClick={() => onInsertItem(newItem, value?.length ?? 0)}\n disabled={!addAllowed}\n >\n {addLabel}\n </Button>\n </Box>\n </Tooltip>\n </Group>\n );\n\n return (\n <DragDropContext\n onDragEnd={({destination, source}) => onReorderItem({from: source.index, to: destination?.index || 0})}\n >\n <Droppable direction=\"vertical\" droppableId={collectionID}>\n {(provided) => (\n <Box\n {...provided.droppableProps}\n ref={provided.innerRef}\n className={cx(classes.root, className)}\n {...others}\n >\n {_header}\n <Stack spacing={spacing}>\n {items}\n {provided.placeholder}\n {_addButton}\n {_error}\n </Stack>\n </Box>\n )}\n </Droppable>\n </DragDropContext>\n );\n};\n"],"names":["AddSize16Px","Box","Group","Input","Stack","Tooltip","useComponentDefaultProps","useDidUpdate","useId","DragDropContext","Droppable","Button","useStyles","CollectionItem","defaultProps","draggable","addLabel","addDisabledTooltip","disabled","spacing","required","Collection","props","value","onChange","onRemoveItem","onReorderItem","onInsertItem","children","newItem","allowAdd","label","labelProps","description","descriptionProps","error","errorProps","classNames","className","styles","unstyled","others","name","classes","cx","collectionID","hasOnlyOneItem","length","JSON","stringify","_label","Label","_description","Description","_error","Error","_header","mb","items","map","item","index","onRemove","removable","addAllowed","_addButton","variant","leftIcon","height","onClick","onDragEnd","destination","source","from","to","direction","droppableId","provided","droppableProps","ref","innerRef","root","placeholder"],"mappings":"AAAA;;;;AAAA,SAAQA,WAAW,QAAO,8BAA8B;AACxD,SACIC,GAAG,EAEHC,KAAK,EACLC,KAAK,EAILC,KAAK,EACLC,OAAO,EACPC,wBAAwB,QACrB,gBAAgB;AAEvB,SAAQC,YAAY,EAAEC,KAAK,QAAO,iBAAiB;AAEnD,SAAQC,eAAe,EAAEC,SAAS,QAAO,sBAAsB;AAE/D,SAAQC,MAAM,QAAO,YAAY;AACjC,OAAOC,eAAe,sBAAsB;AAC5C,SAAQC,cAAc,QAAO,mBAAmB;AAgGhD,IAAMC,eAAkD;IACpDC,WAAW,KAAK;IAChBC,UAAU;IACVC,oBAAoB;IACpBC,UAAU,KAAK;IACfC,SAAS;IACTC,UAAU,KAAK;AACnB;AAEA,OAAO,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BAAAA,yBAAAA,KAAAA,IAAAA,YAAaV,KAAK,AAAD,KAAK;YAAC;;kBAEpG,cAAA,KAACnD;YAAUiE,WAAU;YAAWC,aAAa/B;sBACxC,SAACgC;qCACE,MAAC5E,iFACO4E,SAASC,cAAc;oBAC3BC,KAAKF,SAASG,QAAQ;oBACtB1C,WAAWM,GAAGD,QAAQsC,IAAI,EAAE3C;oBACxBG;;wBAEHe;sCACD,MAACpD;4BAAMe,SAASA;;gCACXuC;gCACAmB,SAASK,WAAW;gCACpBjB;gCACAX;;;;;;;;AAO7B,EAAE"}
@@ -1,9 +1,10 @@
1
1
  import _object_spread from "@swc/helpers/src/_object_spread.mjs";
2
2
  import _object_spread_props from "@swc/helpers/src/_object_spread_props.mjs";
3
3
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
4
- import { Button, Center, Group, Space } from "@mantine/core";
4
+ import { Center, Group, Space } from "@mantine/core";
5
5
  import { RangeCalendar } from "@mantine/dates";
6
6
  import { useForm } from "@mantine/form";
7
+ import { Button } from "../button";
7
8
  import { DateRangePickerPresetSelect } from "./DateRangePickerPresetSelect";
8
9
  import { EditableDateRangePicker } from "./EditableDateRangePicker";
9
10
  export var DateRangePickerInlineCalendar = function(param) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/date-range-picker/DateRangePickerInlineCalendar.tsx"],"sourcesContent":["import {Button, Center, Group, Space} from '@mantine/core';\nimport {DateRangePickerValue, RangeCalendar, RangeCalendarProps} from '@mantine/dates';\nimport {useForm} from '@mantine/form';\n\nimport {DateRangePickerPreset, DateRangePickerPresetSelect} from './DateRangePickerPresetSelect';\nimport {EditableDateRangePicker, EditableDateRangePickerProps} from './EditableDateRangePicker';\n\nexport interface DateRangePickerInlineCalendarProps\n extends Pick<EditableDateRangePickerProps, 'startProps' | 'endProps'> {\n /**\n * Initial selected range\n */\n initialRange: DateRangePickerValue;\n /**\n * Function called when the user applies the new date range\n *\n * @param range the newly selected dates\n */\n onApply: (range: DateRangePickerValue) => void;\n /**\n * Function called when the user click on the cancel button\n */\n onCancel: () => void;\n /**\n * The presets to display\n *\n * @default {}\n * @example\n * {\n * january: {label: 'January', range: [new Date(2022, 0, 1), new Date(2022, 0, 31)]},\n * february: {label: 'February', range: [new Date(2022, 1, 1), new Date(2022, 1, 28)]}\n * }\n */\n presets?: Record<string, DateRangePickerPreset>;\n /**\n * Props for RangeCalendar displayed in the popover\n */\n rangeCalendarProps?: Omit<RangeCalendarProps, 'value' | 'onChange'>;\n}\n\nexport const DateRangePickerInlineCalendar = ({\n initialRange,\n onApply,\n onCancel,\n presets,\n startProps,\n endProps,\n rangeCalendarProps,\n}: DateRangePickerInlineCalendarProps) => {\n const form = useForm({\n initialValues: {\n dates: initialRange,\n },\n });\n const calendarInputProps = form.getInputProps('dates');\n\n const onCalendarApply = () => {\n if (!form.values.dates[1]) {\n form.values.dates[1] = form.values.dates[0]; // when date range is the same day\n }\n onApply(form.values.dates);\n };\n\n return (\n <>\n <Group\n align=\"center\"\n spacing=\"xs\"\n grow\n px=\"md\"\n py=\"sm\"\n sx={(theme) => ({\n borderBottom: `1px solid ${theme.colors.gray[2]}`,\n })}\n >\n <EditableDateRangePicker {...calendarInputProps} startProps={startProps} endProps={endProps} />\n {presets ? (\n <>\n <Space w=\"sm\" />\n <DateRangePickerPresetSelect presets={presets} {...calendarInputProps} />\n </>\n ) : null}\n </Group>\n\n <Center py=\"sm\" px=\"md\">\n <RangeCalendar\n amountOfMonths={2}\n styles={{cell: {textAlign: 'center'}}}\n firstDayOfWeek=\"sunday\"\n allowSingleDateInRange\n {...rangeCalendarProps}\n {...calendarInputProps}\n />\n </Center>\n\n <Group\n position=\"right\"\n spacing=\"xs\"\n px=\"md\"\n py=\"sm\"\n sx={(theme) => ({\n borderTop: `1px solid ${theme.colors.gray[2]}`,\n })}\n >\n <Button size=\"xs\" onClick={onCalendarApply}>\n Apply\n </Button>\n <Button variant=\"outline\" size=\"xs\" onClick={onCancel}>\n Cancel\n </Button>\n </Group>\n </>\n );\n};\n"],"names":["Button","Center","Group","Space","RangeCalendar","useForm","DateRangePickerPresetSelect","EditableDateRangePicker","DateRangePickerInlineCalendar","initialRange","onApply","onCancel","presets","startProps","endProps","rangeCalendarProps","form","initialValues","dates","calendarInputProps","getInputProps","onCalendarApply","values","align","spacing","grow","px","py","sx","theme","borderBottom","colors","gray","w","amountOfMonths","styles","cell","textAlign","firstDayOfWeek","allowSingleDateInRange","position","borderTop","size","onClick","variant"],"mappings":"AAAA;;;AAAA,SAAQA,MAAM,EAAEC,MAAM,EAAEC,KAAK,EAAEC,KAAK,QAAO,gBAAgB;AAC3D,SAA8BC,aAAa,QAA2B,iBAAiB;AACvF,SAAQC,OAAO,QAAO,gBAAgB;AAEtC,SAA+BC,2BAA2B,QAAO,gCAAgC;AACjG,SAAQC,uBAAuB,QAAqC,4BAA4B;AAmChG,OAAO,IAAMC,gCAAgC,gBAQH;QAPtCC,qBAAAA,cACAC,gBAAAA,SACAC,iBAAAA,UACAC,gBAAAA,SACAC,mBAAAA,YACAC,iBAAAA,UACAC,2BAAAA;IAEA,IAAMC,OAAOX,QAAQ;QACjBY,eAAe;YACXC,OAAOT;QACX;IACJ;IACA,IAAMU,qBAAqBH,KAAKI,aAAa,CAAC;IAE9C,IAAMC,kBAAkB,WAAM;QAC1B,IAAI,CAACL,KAAKM,MAAM,CAACJ,KAAK,CAAC,EAAE,EAAE;YACvBF,KAAKM,MAAM,CAACJ,KAAK,CAAC,EAAE,GAAGF,KAAKM,MAAM,CAACJ,KAAK,CAAC,EAAE,EAAE,kCAAkC;QACnF,CAAC;QACDR,QAAQM,KAAKM,MAAM,CAACJ,KAAK;IAC7B;IAEA,qBACI;;0BACI,MAAChB;gBACGqB,OAAM;gBACNC,SAAQ;gBACRC,IAAI;gBACJC,IAAG;gBACHC,IAAG;gBACHC,IAAI,SAACC;2BAAW;wBACZC,cAAc,AAAC,aAAiC,OAArBD,MAAME,MAAM,CAACC,IAAI,CAAC,EAAE;oBACnD;;;kCAEA,KAACzB,iEAA4BY;wBAAoBN,YAAYA;wBAAYC,UAAUA;;oBAClFF,wBACG;;0CACI,KAACT;gCAAM8B,GAAE;;0CACT,KAAC3B;gCAA4BM,SAASA;+BAAaO;;yBAEvD,IAAI;;;0BAGZ,KAAClB;gBAAO0B,IAAG;gBAAKD,IAAG;0BACf,cAAA,KAACtB;oBACG8B,gBAAgB;oBAChBC,QAAQ;wBAACC,MAAM;4BAACC,WAAW;wBAAQ;oBAAC;oBACpCC,gBAAe;oBACfC,sBAAsB;mBAClBxB,oBACAI;;0BAIZ,MAACjB;gBACGsC,UAAS;gBACThB,SAAQ;gBACRE,IAAG;gBACHC,IAAG;gBACHC,IAAI,SAACC;2BAAW;wBACZY,WAAW,AAAC,aAAiC,OAArBZ,MAAME,MAAM,CAACC,IAAI,CAAC,EAAE;oBAChD;;;kCAEA,KAAChC;wBAAO0C,MAAK;wBAAKC,SAAStB;kCAAiB;;kCAG5C,KAACrB;wBAAO4C,SAAQ;wBAAUF,MAAK;wBAAKC,SAAShC;kCAAU;;;;;;AAMvE,EAAE"}
1
+ {"version":3,"sources":["../../../../src/components/date-range-picker/DateRangePickerInlineCalendar.tsx"],"sourcesContent":["import {Center, Group, Space} from '@mantine/core';\nimport {DateRangePickerValue, RangeCalendar, RangeCalendarProps} from '@mantine/dates';\nimport {useForm} from '@mantine/form';\n\nimport {Button} from '../button';\nimport {DateRangePickerPreset, DateRangePickerPresetSelect} from './DateRangePickerPresetSelect';\nimport {EditableDateRangePicker, EditableDateRangePickerProps} from './EditableDateRangePicker';\n\nexport interface DateRangePickerInlineCalendarProps\n extends Pick<EditableDateRangePickerProps, 'startProps' | 'endProps'> {\n /**\n * Initial selected range\n */\n initialRange: DateRangePickerValue;\n /**\n * Function called when the user applies the new date range\n *\n * @param range the newly selected dates\n */\n onApply: (range: DateRangePickerValue) => void;\n /**\n * Function called when the user click on the cancel button\n */\n onCancel: () => void;\n /**\n * The presets to display\n *\n * @default {}\n * @example\n * {\n * january: {label: 'January', range: [new Date(2022, 0, 1), new Date(2022, 0, 31)]},\n * february: {label: 'February', range: [new Date(2022, 1, 1), new Date(2022, 1, 28)]}\n * }\n */\n presets?: Record<string, DateRangePickerPreset>;\n /**\n * Props for RangeCalendar displayed in the popover\n */\n rangeCalendarProps?: Omit<RangeCalendarProps, 'value' | 'onChange'>;\n}\n\nexport const DateRangePickerInlineCalendar = ({\n initialRange,\n onApply,\n onCancel,\n presets,\n startProps,\n endProps,\n rangeCalendarProps,\n}: DateRangePickerInlineCalendarProps) => {\n const form = useForm({\n initialValues: {\n dates: initialRange,\n },\n });\n const calendarInputProps = form.getInputProps('dates');\n\n const onCalendarApply = () => {\n if (!form.values.dates[1]) {\n form.values.dates[1] = form.values.dates[0]; // when date range is the same day\n }\n onApply(form.values.dates);\n };\n\n return (\n <>\n <Group\n align=\"center\"\n spacing=\"xs\"\n grow\n px=\"md\"\n py=\"sm\"\n sx={(theme) => ({\n borderBottom: `1px solid ${theme.colors.gray[2]}`,\n })}\n >\n <EditableDateRangePicker {...calendarInputProps} startProps={startProps} endProps={endProps} />\n {presets ? (\n <>\n <Space w=\"sm\" />\n <DateRangePickerPresetSelect presets={presets} {...calendarInputProps} />\n </>\n ) : null}\n </Group>\n\n <Center py=\"sm\" px=\"md\">\n <RangeCalendar\n amountOfMonths={2}\n styles={{cell: {textAlign: 'center'}}}\n firstDayOfWeek=\"sunday\"\n allowSingleDateInRange\n {...rangeCalendarProps}\n {...calendarInputProps}\n />\n </Center>\n\n <Group\n position=\"right\"\n spacing=\"xs\"\n px=\"md\"\n py=\"sm\"\n sx={(theme) => ({\n borderTop: `1px solid ${theme.colors.gray[2]}`,\n })}\n >\n <Button size=\"xs\" onClick={onCalendarApply}>\n Apply\n </Button>\n <Button variant=\"outline\" size=\"xs\" onClick={onCancel}>\n Cancel\n </Button>\n </Group>\n </>\n );\n};\n"],"names":["Center","Group","Space","RangeCalendar","useForm","Button","DateRangePickerPresetSelect","EditableDateRangePicker","DateRangePickerInlineCalendar","initialRange","onApply","onCancel","presets","startProps","endProps","rangeCalendarProps","form","initialValues","dates","calendarInputProps","getInputProps","onCalendarApply","values","align","spacing","grow","px","py","sx","theme","borderBottom","colors","gray","w","amountOfMonths","styles","cell","textAlign","firstDayOfWeek","allowSingleDateInRange","position","borderTop","size","onClick","variant"],"mappings":"AAAA;;;AAAA,SAAQA,MAAM,EAAEC,KAAK,EAAEC,KAAK,QAAO,gBAAgB;AACnD,SAA8BC,aAAa,QAA2B,iBAAiB;AACvF,SAAQC,OAAO,QAAO,gBAAgB;AAEtC,SAAQC,MAAM,QAAO,YAAY;AACjC,SAA+BC,2BAA2B,QAAO,gCAAgC;AACjG,SAAQC,uBAAuB,QAAqC,4BAA4B;AAmChG,OAAO,IAAMC,gCAAgC,gBAQH;QAPtCC,qBAAAA,cACAC,gBAAAA,SACAC,iBAAAA,UACAC,gBAAAA,SACAC,mBAAAA,YACAC,iBAAAA,UACAC,2BAAAA;IAEA,IAAMC,OAAOZ,QAAQ;QACjBa,eAAe;YACXC,OAAOT;QACX;IACJ;IACA,IAAMU,qBAAqBH,KAAKI,aAAa,CAAC;IAE9C,IAAMC,kBAAkB,WAAM;QAC1B,IAAI,CAACL,KAAKM,MAAM,CAACJ,KAAK,CAAC,EAAE,EAAE;YACvBF,KAAKM,MAAM,CAACJ,KAAK,CAAC,EAAE,GAAGF,KAAKM,MAAM,CAACJ,KAAK,CAAC,EAAE,EAAE,kCAAkC;QACnF,CAAC;QACDR,QAAQM,KAAKM,MAAM,CAACJ,KAAK;IAC7B;IAEA,qBACI;;0BACI,MAACjB;gBACGsB,OAAM;gBACNC,SAAQ;gBACRC,IAAI;gBACJC,IAAG;gBACHC,IAAG;gBACHC,IAAI,SAACC;2BAAW;wBACZC,cAAc,AAAC,aAAiC,OAArBD,MAAME,MAAM,CAACC,IAAI,CAAC,EAAE;oBACnD;;;kCAEA,KAACzB,iEAA4BY;wBAAoBN,YAAYA;wBAAYC,UAAU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