@coveord/plasma-mantine 49.1.1 → 49.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/.turbo/turbo-build.log +3 -3
  2. package/.turbo/turbo-test.log +12 -11
  3. package/dist/.tsbuildinfo +1 -1
  4. package/dist/cjs/components/button/Button.js +17 -8
  5. package/dist/cjs/components/button/Button.js.map +1 -1
  6. package/dist/cjs/components/button/ButtonWithDisabledTooltip.js +17 -36
  7. package/dist/cjs/components/button/ButtonWithDisabledTooltip.js.map +1 -1
  8. package/dist/cjs/components/inline-confirm/InlineConfirm.js +2 -0
  9. package/dist/cjs/components/inline-confirm/InlineConfirm.js.map +1 -1
  10. package/dist/cjs/components/inline-confirm/InlineConfirmButton.js +16 -11
  11. package/dist/cjs/components/inline-confirm/InlineConfirmButton.js.map +1 -1
  12. package/dist/cjs/components/inline-confirm/InlineConfirmMenuItem.js +33 -0
  13. package/dist/cjs/components/inline-confirm/InlineConfirmMenuItem.js.map +1 -0
  14. package/dist/cjs/components/menu/Menu.js +17 -6
  15. package/dist/cjs/components/menu/Menu.js.map +1 -1
  16. package/dist/cjs/theme/Theme.js +9 -2
  17. package/dist/cjs/theme/Theme.js.map +1 -1
  18. package/dist/definitions/components/button/Button.d.ts +1 -2
  19. package/dist/definitions/components/button/Button.d.ts.map +1 -1
  20. package/dist/definitions/components/button/ButtonWithDisabledTooltip.d.ts +10 -9
  21. package/dist/definitions/components/button/ButtonWithDisabledTooltip.d.ts.map +1 -1
  22. package/dist/definitions/components/inline-confirm/InlineConfirm.d.ts +2 -0
  23. package/dist/definitions/components/inline-confirm/InlineConfirm.d.ts.map +1 -1
  24. package/dist/definitions/components/inline-confirm/InlineConfirmButton.d.ts +4 -4
  25. package/dist/definitions/components/inline-confirm/InlineConfirmButton.d.ts.map +1 -1
  26. package/dist/definitions/components/inline-confirm/InlineConfirmMenuItem.d.ts +8 -0
  27. package/dist/definitions/components/inline-confirm/InlineConfirmMenuItem.d.ts.map +1 -0
  28. package/dist/definitions/components/menu/Menu.d.ts.map +1 -1
  29. package/dist/definitions/theme/Theme.d.ts.map +1 -1
  30. package/dist/esm/components/button/Button.js +18 -9
  31. package/dist/esm/components/button/Button.js.map +1 -1
  32. package/dist/esm/components/button/ButtonWithDisabledTooltip.js +18 -37
  33. package/dist/esm/components/button/ButtonWithDisabledTooltip.js.map +1 -1
  34. package/dist/esm/components/inline-confirm/InlineConfirm.js +2 -0
  35. package/dist/esm/components/inline-confirm/InlineConfirm.js.map +1 -1
  36. package/dist/esm/components/inline-confirm/InlineConfirmButton.js +16 -11
  37. package/dist/esm/components/inline-confirm/InlineConfirmButton.js.map +1 -1
  38. package/dist/esm/components/inline-confirm/InlineConfirmMenuItem.js +23 -0
  39. package/dist/esm/components/inline-confirm/InlineConfirmMenuItem.js.map +1 -0
  40. package/dist/esm/components/menu/Menu.js +17 -6
  41. package/dist/esm/components/menu/Menu.js.map +1 -1
  42. package/dist/esm/theme/Theme.js +9 -2
  43. package/dist/esm/theme/Theme.js.map +1 -1
  44. package/package.json +1 -1
  45. package/src/components/button/Button.tsx +13 -18
  46. package/src/components/button/ButtonWithDisabledTooltip.tsx +17 -38
  47. package/src/components/button/__tests__/Button.spec.tsx +12 -0
  48. package/src/components/button/__tests__/ButtonWithDisabledTooltip.spec.tsx +22 -28
  49. package/src/components/inline-confirm/InlineConfirm.tsx +3 -0
  50. package/src/components/inline-confirm/InlineConfirmButton.tsx +15 -11
  51. package/src/components/inline-confirm/InlineConfirmMenuItem.tsx +21 -0
  52. package/src/components/inline-confirm/__tests__/InlineConfirm.spec.tsx +25 -0
  53. package/src/components/menu/Menu.tsx +13 -4
  54. package/src/theme/Theme.tsx +7 -0
@@ -9,20 +9,29 @@ Object.defineProperty(exports, "Button", {
9
9
  }
10
10
  });
11
11
  var _objectSpread = require("@swc/helpers/lib/_object_spread.js").default;
12
+ var _objectWithoutProperties = require("@swc/helpers/lib/_object_without_properties.js").default;
12
13
  var _jsxRuntime = require("react/jsx-runtime");
13
14
  var _core = require("@mantine/core");
14
15
  var _react = require("react");
15
16
  var _utils = require("../../utils");
16
17
  var _buttonWithDisabledTooltip = require("./ButtonWithDisabledTooltip");
17
- var _Button = /*#__PURE__*/ (0, _react.forwardRef)(function(props, ref) {
18
- var theme = (0, _core.useMantineTheme)();
19
- return /*#__PURE__*/ (0, _jsxRuntime.jsx)(_buttonWithDisabledTooltip.ButtonWithDisabledTooltip, _objectSpread({
20
- component: _core.Button,
21
- ref: ref,
22
- disabledHoverColor: theme.colors.gray[2]
23
- }, props));
18
+ var _Button = /*#__PURE__*/ (0, _react.forwardRef)(function(_param, ref) /*#__PURE__*/ {
19
+ var disabledTooltip = _param.disabledTooltip, disabled = _param.disabled, disabledTooltipProps = _param.disabledTooltipProps, others = _objectWithoutProperties(_param, [
20
+ "disabledTooltip",
21
+ "disabled",
22
+ "disabledTooltipProps"
23
+ ]);
24
+ return (0, _jsxRuntime.jsx)(_buttonWithDisabledTooltip.ButtonWithDisabledTooltip, {
25
+ disabled: disabled,
26
+ disabledTooltip: disabledTooltip,
27
+ disabledTooltipProps: disabledTooltipProps,
28
+ children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_core.Button, _objectSpread({
29
+ ref: ref,
30
+ disabled: disabled
31
+ }, others))
32
+ });
24
33
  });
25
34
  var Button = (0, _utils.createPolymorphicComponent)(_Button);
26
- Button.DisabledTooltip = _buttonWithDisabledTooltip.ButtonWithDisabledTooltip;
35
+ Button.Group = _core.Button.Group;
27
36
 
28
37
  //# sourceMappingURL=Button.js.map
@@ -1 +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","_Button","forwardRef","props","ref","theme","useMantineTheme","ButtonWithDisabledTooltip","component","MantineButton","disabledHoverColor","colors","gray","createPolymorphicComponent","DisabledTooltip"],"mappings":"AAAA;;;;+BAoBaA;;;eAAAA;;;;;oBApB6E;qBACjE;qBAEgB;yCAC+B;AAIxE,IAAMC,wBAAUC,IAAAA,iBAAU,EAAiC,SAACC,OAAOC,KAAQ;IACvE,IAAMC,QAAQC,IAAAA,qBAAe;IAC7B,qBACI,qBAACC,oDAAyB;QACtBC,WAAWC,YAAa;QACxBL,KAAKA;QACLM,oBAAoBL,MAAMM,MAAM,CAACC,IAAI,CAAC,EAAE;OACpCT;AAGhB;AAEO,IAAMH,SAASa,IAAAA,iCAA0B,EAI9CZ;AAEFD,OAAOc,eAAe,GAAGP,oDAAyB"}
1
+ {"version":3,"sources":["../../../../src/components/button/Button.tsx"],"sourcesContent":["import {Button as MantineButton, ButtonProps as MantineButtonProps} 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>(\n ({disabledTooltip, disabled, disabledTooltipProps, ...others}, ref) => (\n <ButtonWithDisabledTooltip\n disabled={disabled}\n disabledTooltip={disabledTooltip}\n disabledTooltipProps={disabledTooltipProps}\n >\n <MantineButton ref={ref} disabled={disabled} {...others} />\n </ButtonWithDisabledTooltip>\n )\n);\n\nexport const Button = createPolymorphicComponent<'button', ButtonProps, {Group: typeof MantineButton.Group}>(_Button);\nButton.Group = MantineButton.Group;\n"],"names":["Button","_Button","forwardRef","ref","disabledTooltip","disabled","disabledTooltipProps","others","ButtonWithDisabledTooltip","MantineButton","createPolymorphicComponent","Group"],"mappings":"AAAA;;;;+BAoBaA;;;eAAAA;;;;;;oBApB4D;qBAChD;qBAEgB;yCAC+B;AAIxE,IAAMC,wBAAUC,IAAAA,iBAAU,EACtB,iBAA+DC,mBAC3D;QADFC,yBAAAA,iBAAiBC,kBAAAA,UAAUC,8BAAAA,sBAAyBC;QAApDH;QAAiBC;QAAUC;;WACzB,qBAACE,oDAAyB;QACtBH,UAAUA;QACVD,iBAAiBA;QACjBE,sBAAsBA;kBAEtB,cAAA,qBAACG,YAAa;YAACN,KAAKA;YAAKE,UAAUA;WAAcE;;AAC1B;AAI5B,IAAMP,SAASU,IAAAA,iCAA0B,EAA6DT;AAC7GD,OAAOW,KAAK,GAAGF,YAAa,CAACE,KAAK"}
@@ -16,48 +16,29 @@ var _core = require("@mantine/core");
16
16
  var _react = require("react");
17
17
  var _utils = require("../../utils");
18
18
  var _ButtonWithDisabledTooltip = /*#__PURE__*/ (0, _react.forwardRef)(function(_param, ref) {
19
- var disabledTooltip = _param.disabledTooltip, disabled = _param.disabled, onClick = _param.onClick, tmp = _param.disabledHoverColor, hoverColor = tmp === void 0 ? "unset" : tmp, others = _objectWithoutProperties(_param, [
19
+ var disabledTooltip = _param.disabledTooltip, disabled = _param.disabled, children = _param.children, disabledTooltipProps = _param.disabledTooltipProps, others = _objectWithoutProperties(_param, [
20
20
  "disabledTooltip",
21
21
  "disabled",
22
- "onClick",
23
- "disabledHoverColor"
22
+ "children",
23
+ "disabledTooltipProps"
24
24
  ]);
25
- return disabledTooltip ? /*#__PURE__*/ (0, _jsxRuntime.jsx)(_core.Tooltip, {
25
+ return disabledTooltip ? /*#__PURE__*/ (0, _jsxRuntime.jsx)(_core.Tooltip, _objectSpreadProps(_objectSpread({
26
26
  label: disabledTooltip,
27
- disabled: !disabled,
28
- children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_core.Box, _objectSpread(_objectSpreadProps(_objectSpread({
29
- component: "button",
30
- ref: ref
31
- }, disabled ? {
32
- "data-disabled": true
33
- } : {}), {
34
- sx: function(theme) {
35
- return {
36
- "&[data-disabled]": {
37
- pointerEvents: "all",
38
- color: theme.colors.gray[5]
39
- },
40
- "&[data-disabled]:hover": {
41
- backgroundColor: hoverColor,
42
- cursor: "not-allowed"
43
- }
44
- };
45
- },
46
- onClick: function(event) {
47
- if (disabled) {
48
- event.preventDefault();
49
- event.stopPropagation();
50
- } else {
51
- onClick === null || onClick === void 0 ? void 0 : onClick(event);
27
+ disabled: !disabled
28
+ }, disabledTooltipProps), {
29
+ children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_core.Box, _objectSpreadProps(_objectSpread({
30
+ ref: ref,
31
+ sx: {
32
+ "&:hover": {
33
+ cursor: "not-allowed"
52
34
  }
53
35
  }
54
- }), others))
55
- }) : /*#__PURE__*/ (0, _jsxRuntime.jsx)(_core.Box, _objectSpread({
56
- component: "button",
57
- ref: ref,
58
- disabled: disabled,
59
- onClick: onClick
60
- }, others));
36
+ }, others), {
37
+ children: children
38
+ }))
39
+ })) : /*#__PURE__*/ (0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
40
+ children: children
41
+ });
61
42
  });
62
43
  var ButtonWithDisabledTooltip = (0, _utils.createPolymorphicComponent)(_ButtonWithDisabledTooltip);
63
44
 
@@ -1 +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":["ButtonWithDisabledTooltip","_ButtonWithDisabledTooltip","forwardRef","ref","disabledTooltip","disabled","onClick","hoverColor","disabledHoverColor","others","Tooltip","label","Box","component","sx","theme","pointerEvents","color","colors","gray","backgroundColor","cursor","event","preventDefault","stopPropagation","createPolymorphicComponent"],"mappings":"AAAA;;;;+BAuDaA;;;eAAAA;;;;;;;oBAvDc;qBAEiB;qBAEH;AAiBzC,IAAMC,2CAA6BC,IAAAA,iBAAU,EACzC,iBAA4FC;QAA1FC,yBAAAA,iBAAiBC,kBAAAA,UAAUC,iBAAAA,SAA6BC,aAApBC,oBAAoBD,aAAAA,iBAAa,UAAbA,KAAyBE;QAAjFL;QAAiBC;QAAUC;QAASE;;IAClCJ,OAAAA,gCACI,qBAACM,aAAO;QAACC,OAAOP;QAAiBC,UAAU,CAACA;kBACxC,cAAA,qBAACO,SAAG;YACAC,WAAU;YACVV,KAAKA;WACAE,WAAW;YAAC,iBAAiB,IAAI;QAAA,IAAI,CAAC,CAAC;YAC5CS,IAAI,SAACC;uBAAW;oBACZ,oBAAoB;wBAChBC,eAAe;wBACfC,OAAOF,MAAMG,MAAM,CAACC,IAAI,CAAC,EAAE;oBAC/B;oBACA,0BAA0B;wBACtBC,iBAAiBb;wBACjBc,QAAQ;oBACZ;gBACJ;;YACAf,SAAS,SAACgB,OAAU;gBAChB,IAAIjB,UAAU;oBACViB,MAAMC,cAAc;oBACpBD,MAAME,eAAe;gBACzB,OAAO;oBACHlB,oBAAAA,qBAAAA,KAAAA,IAAAA,QAAUgB;gBACd,CAAC;YACL;YACIb;uBAIZ,qBAACG,SAAG;QAACC,WAAU;QAASV,KAAKA;QAAKE,UAAUA;QAAUC,SAASA;OAAaG,QAC/E;;AAGF,IAAMT,4BAA4ByB,IAAAA,iCAA0B,EAC/DxB"}
1
+ {"version":3,"sources":["../../../../src/components/button/ButtonWithDisabledTooltip.tsx"],"sourcesContent":["import {Box, Tooltip, TooltipProps} from '@mantine/core';\nimport {forwardRef, ReactNode} from 'react';\n\nimport {createPolymorphicComponent} from '../../utils';\n\nexport interface ButtonWithDisabledTooltipProps {\n /**\n * The tooltip message to display when disabled\n */\n disabledTooltip?: string;\n /**\n * Whether the button underneath the tooltip is disabled\n */\n disabled?: boolean;\n children?: ReactNode;\n /**\n * Additional tooltip props to set on the disabled button tooltip\n */\n disabledTooltipProps?: Omit<TooltipProps, 'disabled' | 'label' | 'children'>;\n}\n\nconst _ButtonWithDisabledTooltip = forwardRef<HTMLDivElement, ButtonWithDisabledTooltipProps>(\n ({disabledTooltip, disabled, children, disabledTooltipProps, ...others}, ref) =>\n disabledTooltip ? (\n <Tooltip label={disabledTooltip} disabled={!disabled} {...disabledTooltipProps}>\n <Box ref={ref} sx={{'&:hover': {cursor: 'not-allowed'}}} {...others}>\n {children}\n </Box>\n </Tooltip>\n ) : (\n <>{children}</>\n )\n);\n\nexport const ButtonWithDisabledTooltip = createPolymorphicComponent<'div', ButtonWithDisabledTooltipProps>(\n _ButtonWithDisabledTooltip\n);\n"],"names":["ButtonWithDisabledTooltip","_ButtonWithDisabledTooltip","forwardRef","ref","disabledTooltip","disabled","children","disabledTooltipProps","others","Tooltip","label","Box","sx","cursor","createPolymorphicComponent"],"mappings":"AAAA;;;;+BAkCaA;;;eAAAA;;;;;;;oBAlC4B;qBACL;qBAEK;AAkBzC,IAAMC,2CAA6BC,IAAAA,iBAAU,EACzC,iBAAyEC,KACrEC;QADFA,yBAAAA,iBAAiBC,kBAAAA,UAAUC,kBAAAA,UAAUC,8BAAAA,sBAAyBC;QAA9DJ;QAAiBC;QAAUC;QAAUC;;WACnCH,gCACI,qBAACK,aAAO;QAACC,OAAON;QAAiBC,UAAU,CAACA;OAAcE;kBACtD,cAAA,qBAACI,SAAG;YAACR,KAAKA;YAAKS,IAAI;gBAAC,WAAW;oBAACC,QAAQ;gBAAa;YAAC;WAAOL;sBACxDF;;wBAIT;kBAAGA;MACN;AAAD;AAGD,IAAMN,4BAA4Bc,IAAAA,iCAA0B,EAC/Db"}
@@ -13,6 +13,7 @@ var _jsxRuntime = require("react/jsx-runtime");
13
13
  var _react = require("react");
14
14
  var _inlineConfirmButton = require("./InlineConfirmButton");
15
15
  var _inlineConfirmContext = require("./InlineConfirmContext");
16
+ var _inlineConfirmMenuItem = require("./InlineConfirmMenuItem");
16
17
  var _inlineConfirmPrompt = require("./InlineConfirmPrompt");
17
18
  var InlineConfirm = function(param) {
18
19
  var children = param.children;
@@ -35,5 +36,6 @@ var InlineConfirm = function(param) {
35
36
  };
36
37
  InlineConfirm.Prompt = _inlineConfirmPrompt.InlineConfirmPrompt;
37
38
  InlineConfirm.Button = _inlineConfirmButton.InlineConfirmButton;
39
+ InlineConfirm.MenuItem = _inlineConfirmMenuItem.InlineConfirmMenuItem;
38
40
 
39
41
  //# sourceMappingURL=InlineConfirm.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/inline-confirm/InlineConfirm.tsx"],"sourcesContent":["import {Children, FunctionComponent, PropsWithChildren, ReactElement, useState} from 'react';\n\nimport {InlineConfirmButton} from './InlineConfirmButton';\nimport {InlineConfirmContext} from './InlineConfirmContext';\nimport {InlineConfirmPrompt} from './InlineConfirmPrompt';\n\ntype InlineConfirmType = FunctionComponent<PropsWithChildren> & {\n Prompt: typeof InlineConfirmPrompt;\n Button: typeof InlineConfirmButton;\n};\n\nexport const InlineConfirm: InlineConfirmType = ({children}) => {\n const [confirmingId, setConfirmingId] = useState<string | null>(null);\n\n const convertedChildren = Children.toArray(children) as ReactElement[];\n const prompt = convertedChildren.find(\n (child) => child.type === InlineConfirmPrompt && child.props.id === confirmingId\n );\n const clearConfirm = () => setConfirmingId(null);\n\n return (\n <InlineConfirmContext.Provider value={{confirmingId, setConfirmingId, clearConfirm}}>\n {prompt ?? children}\n </InlineConfirmContext.Provider>\n );\n};\n\nInlineConfirm.Prompt = InlineConfirmPrompt;\nInlineConfirm.Button = InlineConfirmButton;\n"],"names":["InlineConfirm","children","useState","confirmingId","setConfirmingId","convertedChildren","Children","toArray","prompt","find","child","type","InlineConfirmPrompt","props","id","clearConfirm","InlineConfirmContext","Provider","value","Prompt","Button","InlineConfirmButton"],"mappings":"AAAA;;;;+BAWaA;;;eAAAA;;;;;qBAXwE;mCAEnD;oCACC;mCACD;AAO3B,IAAMA,gBAAmC,gBAAgB;QAAdC,iBAAAA;IAC9C,IAAwCC,2BAAAA,IAAAA,eAAQ,EAAgB,IAAI,OAA7DC,eAAiCD,cAAnBE,kBAAmBF;IAExC,IAAMG,oBAAoBC,eAAQ,CAACC,OAAO,CAACN;IAC3C,IAAMO,SAASH,kBAAkBI,IAAI,CACjC,SAACC;eAAUA,MAAMC,IAAI,KAAKC,wCAAmB,IAAIF,MAAMG,KAAK,CAACC,EAAE,KAAKX;;IAExE,IAAMY,eAAe;eAAMX,gBAAgB,IAAI;;IAE/C,qBACI,qBAACY,0CAAoB,CAACC,QAAQ;QAACC,OAAO;YAACf,cAAAA;YAAcC,iBAAAA;YAAiBW,cAAAA;QAAY;kBAC7EP,mBAAAA,oBAAAA,SAAUP,QAAQ;;AAG/B;AAEAD,cAAcmB,MAAM,GAAGP,wCAAmB;AAC1CZ,cAAcoB,MAAM,GAAGC,wCAAmB"}
1
+ {"version":3,"sources":["../../../../src/components/inline-confirm/InlineConfirm.tsx"],"sourcesContent":["import {Children, FunctionComponent, PropsWithChildren, ReactElement, useState} from 'react';\n\nimport {InlineConfirmButton} from './InlineConfirmButton';\nimport {InlineConfirmContext} from './InlineConfirmContext';\nimport {InlineConfirmMenuItem} from './InlineConfirmMenuItem';\nimport {InlineConfirmPrompt} from './InlineConfirmPrompt';\n\ntype InlineConfirmType = FunctionComponent<PropsWithChildren> & {\n Prompt: typeof InlineConfirmPrompt;\n Button: typeof InlineConfirmButton;\n MenuItem: typeof InlineConfirmMenuItem;\n};\n\nexport const InlineConfirm: InlineConfirmType = ({children}) => {\n const [confirmingId, setConfirmingId] = useState<string | null>(null);\n\n const convertedChildren = Children.toArray(children) as ReactElement[];\n const prompt = convertedChildren.find(\n (child) => child.type === InlineConfirmPrompt && child.props.id === confirmingId\n );\n const clearConfirm = () => setConfirmingId(null);\n\n return (\n <InlineConfirmContext.Provider value={{confirmingId, setConfirmingId, clearConfirm}}>\n {prompt ?? children}\n </InlineConfirmContext.Provider>\n );\n};\n\nInlineConfirm.Prompt = InlineConfirmPrompt;\nInlineConfirm.Button = InlineConfirmButton;\nInlineConfirm.MenuItem = InlineConfirmMenuItem;\n"],"names":["InlineConfirm","children","useState","confirmingId","setConfirmingId","convertedChildren","Children","toArray","prompt","find","child","type","InlineConfirmPrompt","props","id","clearConfirm","InlineConfirmContext","Provider","value","Prompt","Button","InlineConfirmButton","MenuItem","InlineConfirmMenuItem"],"mappings":"AAAA;;;;+BAaaA;;;eAAAA;;;;;qBAbwE;mCAEnD;oCACC;qCACC;mCACF;AAQ3B,IAAMA,gBAAmC,gBAAgB;QAAdC,iBAAAA;IAC9C,IAAwCC,2BAAAA,IAAAA,eAAQ,EAAgB,IAAI,OAA7DC,eAAiCD,cAAnBE,kBAAmBF;IAExC,IAAMG,oBAAoBC,eAAQ,CAACC,OAAO,CAACN;IAC3C,IAAMO,SAASH,kBAAkBI,IAAI,CACjC,SAACC;eAAUA,MAAMC,IAAI,KAAKC,wCAAmB,IAAIF,MAAMG,KAAK,CAACC,EAAE,KAAKX;;IAExE,IAAMY,eAAe;eAAMX,gBAAgB,IAAI;;IAE/C,qBACI,qBAACY,0CAAoB,CAACC,QAAQ;QAACC,OAAO;YAACf,cAAAA;YAAcC,iBAAAA;YAAiBW,cAAAA;QAAY;kBAC7EP,mBAAAA,oBAAAA,SAAUP,QAAQ;;AAG/B;AAEAD,cAAcmB,MAAM,GAAGP,wCAAmB;AAC1CZ,cAAcoB,MAAM,GAAGC,wCAAmB;AAC1CrB,cAAcsB,QAAQ,GAAGC,4CAAqB"}
@@ -9,20 +9,25 @@ Object.defineProperty(exports, "InlineConfirmButton", {
9
9
  }
10
10
  });
11
11
  var _objectSpread = require("@swc/helpers/lib/_object_spread.js").default;
12
- var _objectSpreadProps = require("@swc/helpers/lib/_object_spread_props.js").default;
12
+ var _objectWithoutProperties = require("@swc/helpers/lib/_object_without_properties.js").default;
13
13
  var _jsxRuntime = require("react/jsx-runtime");
14
- var _button = require("../button");
14
+ var _core = require("@mantine/core");
15
+ var _react = require("react");
15
16
  var _useInlineConfirm = require("./useInlineConfirm");
16
- var InlineConfirmButton = function(props) {
17
+ var InlineConfirmButton = /*#__PURE__*/ (0, _react.forwardRef)(function(_param, ref) {
18
+ var onClick = _param.onClick, id = _param.id, others = _objectWithoutProperties(_param, [
19
+ "onClick",
20
+ "id"
21
+ ]);
17
22
  var setConfirmingId = (0, _useInlineConfirm.useInlineConfirm)().setConfirmingId;
18
- var onClick = function(e) {
19
- var _props_onClick;
20
- setConfirmingId(props.id);
21
- (_props_onClick = props.onClick) === null || _props_onClick === void 0 ? void 0 : _props_onClick.call(props, e);
23
+ var handleOnClick = function(e) {
24
+ setConfirmingId(id);
25
+ onClick === null || onClick === void 0 ? void 0 : onClick(e);
22
26
  };
23
- return /*#__PURE__*/ (0, _jsxRuntime.jsx)(_button.Button, _objectSpreadProps(_objectSpread({}, props), {
24
- onClick: onClick
25
- }));
26
- };
27
+ return /*#__PURE__*/ (0, _jsxRuntime.jsx)(_core.Button, _objectSpread({
28
+ ref: ref,
29
+ onClick: handleOnClick
30
+ }, others));
31
+ });
27
32
 
28
33
  //# sourceMappingURL=InlineConfirmButton.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/inline-confirm/InlineConfirmButton.tsx"],"sourcesContent":["import {HTMLAttributes, MouseEventHandler} from 'react';\n\nimport {Button, ButtonProps} from '../button';\nimport {useInlineConfirm} from './useInlineConfirm';\n\ninterface InlineConfirmButtonProps extends ButtonProps, Omit<HTMLAttributes<HTMLButtonElement>, 'color'> {\n id: string;\n}\n\nexport const InlineConfirmButton = (props: InlineConfirmButtonProps) => {\n const {setConfirmingId} = useInlineConfirm();\n const onClick: MouseEventHandler<HTMLButtonElement> = (e) => {\n setConfirmingId(props.id);\n props.onClick?.(e);\n };\n\n return <Button {...props} onClick={onClick} />;\n};\n"],"names":["InlineConfirmButton","props","setConfirmingId","useInlineConfirm","onClick","e","id","Button"],"mappings":"AAAA;;;;+BASaA;;;eAAAA;;;;;;sBAPqB;gCACH;AAMxB,IAAMA,sBAAsB,SAACC,OAAoC;IACpE,IAAM,AAACC,kBAAmBC,IAAAA,kCAAgB,IAAnCD;IACP,IAAME,UAAgD,SAACC,GAAM;YAEzDJ;QADAC,gBAAgBD,MAAMK,EAAE;QACxBL,CAAAA,iBAAAA,MAAMG,OAAO,cAAbH,4BAAAA,KAAAA,IAAAA,eAAAA,KAAAA,OAAgBI;IACpB;IAEA,qBAAO,qBAACE,cAAM,uCAAKN;QAAOG,SAASA;;AACvC"}
1
+ {"version":3,"sources":["../../../../src/components/inline-confirm/InlineConfirmButton.tsx"],"sourcesContent":["import {Button} from '@mantine/core';\nimport {forwardRef, MouseEventHandler} from 'react';\n\nimport {ButtonProps} from '../button';\nimport {useInlineConfirm} from './useInlineConfirm';\n\nexport interface InlineConfirmButtonProps extends ButtonProps {\n id: string;\n onClick?: MouseEventHandler<HTMLButtonElement>;\n}\n\nexport const InlineConfirmButton = forwardRef<HTMLButtonElement, InlineConfirmButtonProps>(\n ({onClick, id, ...others}, ref) => {\n const {setConfirmingId} = useInlineConfirm();\n const handleOnClick: MouseEventHandler<HTMLButtonElement> = (e) => {\n setConfirmingId(id);\n onClick?.(e);\n };\n\n return <Button ref={ref} onClick={handleOnClick} {...others} />;\n }\n);\n"],"names":["InlineConfirmButton","forwardRef","ref","onClick","id","others","setConfirmingId","useInlineConfirm","handleOnClick","e","Button"],"mappings":"AAAA;;;;+BAWaA;;;eAAAA;;;;;;oBAXQ;qBACuB;gCAGb;AAOxB,IAAMA,oCAAsBC,IAAAA,iBAAU,EACzC,iBAA2BC,KAAQ;QAAjCC,iBAAAA,SAASC,YAAAA,IAAOC;QAAhBF;QAASC;;IACP,IAAM,AAACE,kBAAmBC,IAAAA,kCAAgB,IAAnCD;IACP,IAAME,gBAAsD,SAACC,GAAM;QAC/DH,gBAAgBF;QAChBD,oBAAAA,qBAAAA,KAAAA,IAAAA,QAAUM;IACd;IAEA,qBAAO,qBAACC,YAAM;QAACR,KAAKA;QAAKC,SAASK;OAAmBH;AACzD"}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "InlineConfirmMenuItem", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return InlineConfirmMenuItem;
9
+ }
10
+ });
11
+ var _objectSpread = require("@swc/helpers/lib/_object_spread.js").default;
12
+ var _objectWithoutProperties = require("@swc/helpers/lib/_object_without_properties.js").default;
13
+ var _jsxRuntime = require("react/jsx-runtime");
14
+ var _react = require("react");
15
+ var _menu = require("../menu");
16
+ var _useInlineConfirm = require("./useInlineConfirm");
17
+ var InlineConfirmMenuItem = /*#__PURE__*/ (0, _react.forwardRef)(function(_param, ref) {
18
+ var onClick = _param.onClick, id = _param.id, others = _objectWithoutProperties(_param, [
19
+ "onClick",
20
+ "id"
21
+ ]);
22
+ var setConfirmingId = (0, _useInlineConfirm.useInlineConfirm)().setConfirmingId;
23
+ var handleOnClick = function(e) {
24
+ setConfirmingId(id);
25
+ onClick === null || onClick === void 0 ? void 0 : onClick(e);
26
+ };
27
+ return /*#__PURE__*/ (0, _jsxRuntime.jsx)(_menu.Menu.Item, _objectSpread({
28
+ ref: ref,
29
+ onClick: handleOnClick
30
+ }, others));
31
+ });
32
+
33
+ //# sourceMappingURL=InlineConfirmMenuItem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/inline-confirm/InlineConfirmMenuItem.tsx"],"sourcesContent":["import {forwardRef, MouseEventHandler} from 'react';\n\nimport {Menu, MenuItemProps} from '../menu';\nimport {useInlineConfirm} from './useInlineConfirm';\n\nexport interface InlineConfirmMenuItemProps extends MenuItemProps {\n id: string;\n onClick?: MouseEventHandler<HTMLButtonElement>;\n}\n\nexport const InlineConfirmMenuItem = forwardRef<HTMLButtonElement, InlineConfirmMenuItemProps>(\n ({onClick, id, ...others}, ref) => {\n const {setConfirmingId} = useInlineConfirm();\n const handleOnClick: MouseEventHandler<HTMLButtonElement> = (e) => {\n setConfirmingId(id);\n onClick?.(e);\n };\n\n return <Menu.Item ref={ref} onClick={handleOnClick} {...others} />;\n }\n);\n"],"names":["InlineConfirmMenuItem","forwardRef","ref","onClick","id","others","setConfirmingId","useInlineConfirm","handleOnClick","e","Menu","Item"],"mappings":"AAAA;;;;+BAUaA;;;eAAAA;;;;;;qBAV+B;oBAEV;gCACH;AAOxB,IAAMA,sCAAwBC,IAAAA,iBAAU,EAC3C,iBAA2BC,KAAQ;QAAjCC,iBAAAA,SAASC,YAAAA,IAAOC;QAAhBF;QAASC;;IACP,IAAM,AAACE,kBAAmBC,IAAAA,kCAAgB,IAAnCD;IACP,IAAME,gBAAsD,SAACC,GAAM;QAC/DH,gBAAgBF;QAChBD,oBAAAA,qBAAAA,KAAAA,IAAAA,QAAUM;IACd;IAEA,qBAAO,qBAACC,UAAI,CAACC,IAAI;QAACT,KAAKA;QAAKC,SAASK;OAAmBH;AAC5D"}
@@ -9,16 +9,27 @@ Object.defineProperty(exports, "Menu", {
9
9
  }
10
10
  });
11
11
  var _objectSpread = require("@swc/helpers/lib/_object_spread.js").default;
12
+ var _objectWithoutProperties = require("@swc/helpers/lib/_object_without_properties.js").default;
12
13
  var _jsxRuntime = require("react/jsx-runtime");
13
14
  var _core = require("@mantine/core");
14
15
  var _react = require("react");
15
16
  var _utils = require("../../utils");
16
- var _button = require("../button");
17
- var _MenuItem = /*#__PURE__*/ (0, _react.forwardRef)(function(props, ref) {
18
- return /*#__PURE__*/ (0, _jsxRuntime.jsx)(_button.Button.DisabledTooltip, _objectSpread({
19
- component: _core.Menu.Item,
20
- ref: ref
21
- }, props));
17
+ var _buttonWithDisabledTooltip = require("../button/ButtonWithDisabledTooltip");
18
+ var _MenuItem = /*#__PURE__*/ (0, _react.forwardRef)(function(_param, ref) /*#__PURE__*/ {
19
+ var disabledTooltip = _param.disabledTooltip, disabled = _param.disabled, disabledTooltipProps = _param.disabledTooltipProps, others = _objectWithoutProperties(_param, [
20
+ "disabledTooltip",
21
+ "disabled",
22
+ "disabledTooltipProps"
23
+ ]);
24
+ return (0, _jsxRuntime.jsx)(_buttonWithDisabledTooltip.ButtonWithDisabledTooltip, {
25
+ disabled: disabled,
26
+ disabledTooltip: disabledTooltip,
27
+ disabledTooltipProps: disabledTooltipProps,
28
+ children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_core.Menu.Item, _objectSpread({
29
+ ref: ref,
30
+ disabled: disabled
31
+ }, others))
32
+ });
22
33
  });
23
34
  var MenuItem = (0, _utils.createPolymorphicComponent)(_MenuItem);
24
35
  var Menu = (0, _utils.overrideComponent)(_core.Menu, {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/menu/Menu.tsx"],"sourcesContent":["import {Menu as MantineMenu, MenuItemProps as MantineMenuItemProps} from '@mantine/core';\nimport {forwardRef} from 'react';\n\nimport {createPolymorphicComponent, overrideComponent} from '../../utils';\nimport {Button, ButtonWithDisabledTooltipProps} from '../button';\n\nexport interface MenuItemProps extends MantineMenuItemProps, ButtonWithDisabledTooltipProps {}\n\nconst _MenuItem = forwardRef<HTMLButtonElement, MenuItemProps>((props, ref) => (\n <Button.DisabledTooltip component={MantineMenu.Item} ref={ref} {...props} />\n));\n\nconst MenuItem = createPolymorphicComponent<'button', MenuItemProps>(_MenuItem);\n\nexport const Menu = overrideComponent(MantineMenu, {\n displayName: '@coveord/plasma-mantine/Menu',\n Item: MenuItem,\n});\n"],"names":["Menu","_MenuItem","forwardRef","props","ref","Button","DisabledTooltip","component","MantineMenu","Item","MenuItem","createPolymorphicComponent","overrideComponent","displayName"],"mappings":"AAAA;;;;+BAcaA;;;eAAAA;;;;;oBAd4D;qBAChD;qBAEmC;sBACP;AAIrD,IAAMC,0BAAYC,IAAAA,iBAAU,EAAmC,SAACC,OAAOC;yBACnE,qBAACC,cAAM,CAACC,eAAe;QAACC,WAAWC,UAAW,CAACC,IAAI;QAAEL,KAAKA;OAASD;;AAGvE,IAAMO,WAAWC,IAAAA,iCAA0B,EAA0BV;AAE9D,IAAMD,OAAOY,IAAAA,wBAAiB,EAACJ,UAAW,EAAE;IAC/CK,aAAa;IACbJ,MAAMC;AACV"}
1
+ {"version":3,"sources":["../../../../src/components/menu/Menu.tsx"],"sourcesContent":["import {Menu as MantineMenu, MenuItemProps as MantineMenuItemProps} from '@mantine/core';\nimport {forwardRef} from 'react';\n\nimport {createPolymorphicComponent, overrideComponent} from '../../utils';\nimport {ButtonWithDisabledTooltipProps} from '../button';\nimport {ButtonWithDisabledTooltip} from '../button/ButtonWithDisabledTooltip';\n\nexport interface MenuItemProps extends MantineMenuItemProps, ButtonWithDisabledTooltipProps {}\n\nconst _MenuItem = forwardRef<HTMLButtonElement, MenuItemProps>(\n ({disabledTooltip, disabled, disabledTooltipProps, ...others}, ref) => (\n <ButtonWithDisabledTooltip\n disabled={disabled}\n disabledTooltip={disabledTooltip}\n disabledTooltipProps={disabledTooltipProps}\n >\n <MantineMenu.Item ref={ref} disabled={disabled} {...others} />\n </ButtonWithDisabledTooltip>\n )\n);\n\nconst MenuItem = createPolymorphicComponent<'button', MenuItemProps>(_MenuItem);\n\nexport const Menu = overrideComponent(MantineMenu, {\n displayName: '@coveord/plasma-mantine/Menu',\n Item: MenuItem,\n});\n"],"names":["Menu","_MenuItem","forwardRef","ref","disabledTooltip","disabled","disabledTooltipProps","others","ButtonWithDisabledTooltip","MantineMenu","Item","MenuItem","createPolymorphicComponent","overrideComponent","displayName"],"mappings":"AAAA;;;;+BAuBaA;;;eAAAA;;;;;;oBAvB4D;qBAChD;qBAEmC;yCAEpB;AAIxC,IAAMC,0BAAYC,IAAAA,iBAAU,EACxB,iBAA+DC,mBAC3D;QADFC,yBAAAA,iBAAiBC,kBAAAA,UAAUC,8BAAAA,sBAAyBC;QAApDH;QAAiBC;QAAUC;;WACzB,qBAACE,oDAAyB;QACtBH,UAAUA;QACVD,iBAAiBA;QACjBE,sBAAsBA;kBAEtB,cAAA,qBAACG,UAAW,CAACC,IAAI;YAACP,KAAKA;YAAKE,UAAUA;WAAcE;;AAC7B;AAInC,IAAMI,WAAWC,IAAAA,iCAA0B,EAA0BX;AAE9D,IAAMD,OAAOa,IAAAA,wBAAiB,EAACJ,UAAW,EAAE;IAC/CK,aAAa;IACbJ,MAAMC;AACV"}
@@ -165,7 +165,8 @@ var plasmaTheme = {
165
165
  defaultProps: {
166
166
  color: "navy",
167
167
  withArrow: true,
168
- withinPortal: true
168
+ withinPortal: true,
169
+ multiline: true
169
170
  }
170
171
  },
171
172
  Breadcrumbs: {
@@ -240,7 +241,13 @@ var plasmaTheme = {
240
241
  },
241
242
  ColorSwatch: {
242
243
  defaultProps: {
243
- size: 8
244
+ size: 8,
245
+ withShadow: false
246
+ }
247
+ },
248
+ MenuItem: {
249
+ defaultProps: {
250
+ fw: 300
244
251
  }
245
252
  }
246
253
  }
@@ -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 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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UAAU;YACNjD,cAAc;gBACVkC,QAAQ;YACZ;QACJ;QACAgB,MAAM;YACF9C,QAAQ;uBAAO;oBACXI,MAAM;wBACF2C,eAAe;oBACnB;gBACJ;;QACJ;QACAC,OAAO;YACHhD,QAAQ;gBACJiD,cAAc;oBACVC,SAAS;oBACTC,YAAY;gBAChB;YACJ;QACJ;QACAC,SAAS;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"}
1
+ {"version":3,"sources":["../../../src/theme/Theme.tsx"],"sourcesContent":["import {ArrowHeadRightSize24Px, InfoSize24Px} from '@coveord/plasma-react-icons';\nimport {color} from '@coveord/plasma-tokens';\nimport {ButtonStylesParams, MantineThemeOverride, ModalStylesParams} from '@mantine/core';\n\nimport {PlasmaColors} from './PlasmaColors';\n\nexport const plasmaTheme: MantineThemeOverride = {\n // These are overrides over https://github.com/mantinedev/mantine/blob/master/src/mantine-styles/src/theme/default-theme.ts\n colorScheme: 'light',\n fontFamily: 'canada-type-gibson, sans-serif',\n black: color.primary.gray[9],\n defaultRadius: 8,\n spacing: {\n xs: 8,\n sm: 16,\n md: 24,\n lg: 32,\n xl: 40,\n },\n primaryColor: 'action',\n headings: {\n fontFamily: 'canada-type-gibson, sans-serif',\n fontWeight: 500,\n sizes: {\n h1: {fontSize: 48, lineHeight: '56px', fontWeight: undefined},\n h2: {fontSize: 32, lineHeight: '40px', fontWeight: undefined},\n h3: {fontSize: 28, lineHeight: '40px', fontWeight: undefined},\n h4: {fontSize: 24, lineHeight: '32px', fontWeight: undefined},\n h5: {fontSize: 18, lineHeight: '28px', fontWeight: undefined},\n h6: {fontSize: 16, lineHeight: '24px', fontWeight: undefined},\n },\n },\n shadows: {\n xs: '0px 1px 0px rgba(4, 8, 31, 0.08)',\n sm: '0px 2px 4px rgba(4, 8, 31, 0.12)',\n md: '0px 4px 8px rgba(4, 8, 31, 0.08)',\n lg: '0px 8px 16px rgba(7, 12, 41, 0.06)',\n xl: '0px 16px 24px rgba(4, 8, 31, 0.06)',\n },\n colors: PlasmaColors,\n components: {\n Alert: {\n defaultProps: {\n icon: <InfoSize24Px height={24} />,\n color: 'navy',\n },\n styles: {\n title: {\n fontWeight: 500,\n },\n },\n },\n Title: {\n styles: (theme) => ({\n root: {\n '&:is(h1,h2,h3,h4,h5,h6)': {letterSpacing: '0.011em', color: theme.colors.gray[9]},\n },\n }),\n },\n Button: {\n styles: (theme, params: ButtonStylesParams) => ({\n root: {\n fontWeight: 400,\n backgroundColor: params.variant === 'outline' ? 'white' : undefined,\n },\n }),\n },\n Modal: {\n styles: (theme, {size, fullScreen}: ModalStylesParams) => ({\n modal: {\n width: fullScreen\n ? undefined\n : theme.fn.size({size, sizes: {xs: 440, sm: 550, md: 800, lg: 1334, xl: '85%'}}),\n },\n }),\n defaultProps: {\n overlayColor: color.primary.navy[9],\n overlayOpacity: 0.9,\n },\n },\n InputWrapper: {\n defaultProps: {\n withAsterisk: false,\n },\n styles: (theme) => ({\n label: {\n marginBottom: theme.spacing.xs,\n lineHeight: '20px',\n },\n description: {\n lineHeight: '20px',\n fontSize: theme.fontSizes.sm,\n color: theme.colors.gray[7],\n marginBottom: theme.spacing.xs,\n },\n invalid: {\n color: theme.colors.red[9],\n borderColor: theme.colors.red[6],\n },\n error: {\n color: theme.colors.red[9],\n },\n }),\n },\n TextInput: {\n defaultProps: {\n radius: 8,\n },\n },\n Tooltip: {\n defaultProps: {\n color: 'navy',\n withArrow: true,\n withinPortal: true,\n multiline: true,\n },\n },\n Breadcrumbs: {\n defaultProps: {\n separator: <ArrowHeadRightSize24Px height={24} />,\n },\n },\n Loader: {\n defaultProps: {\n variant: 'dots',\n color: 'action',\n },\n },\n DateRangePicker: {\n styles: {\n cell: {\n textAlign: 'center',\n },\n },\n },\n Anchor: {\n defaultProps: {\n color: 'action',\n },\n styles: (theme) => ({\n root: {\n ...theme.fn.hover({\n textDecoration: 'underline',\n color: theme.colors.action[8],\n }),\n },\n }),\n },\n Checkbox: {\n defaultProps: {\n radius: 'sm',\n },\n },\n List: {\n styles: () => ({\n root: {\n listStyleType: 'disc',\n },\n }),\n },\n Radio: {\n styles: {\n labelWrapper: {\n display: 'flex',\n alignItems: 'flex-start',\n },\n },\n },\n Popover: {\n defaultProps: {\n shadow: 'md',\n withArrow: true,\n },\n },\n Badge: {\n styles: {\n root: {\n textTransform: 'none',\n padding: '4px 8px',\n fontWeight: 500,\n },\n },\n },\n ColorSwatch: {\n defaultProps: {\n size: 8,\n withShadow: false,\n },\n },\n MenuItem: {\n defaultProps: {\n fw: 300,\n },\n },\n },\n};\n"],"names":["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","multiline","Breadcrumbs","separator","ArrowHeadRightSize24Px","Loader","DateRangePicker","cell","textAlign","Anchor","hover","textDecoration","action","Checkbox","List","listStyleType","Radio","labelWrapper","display","alignItems","Popover","shadow","Badge","textTransform","padding","ColorSwatch","withShadow","MenuItem","fw"],"mappings":"AAAA;;;;+BAMaA;;;eAAAA;;;;;gCANsC;4BAC/B;4BAGO;AAEpB,IAAMA,cAAoC;IAC7C,2HAA2H;IAC3HC,aAAa;IACbC,YAAY;IACZC,OAAOC,mBAAK,CAACC,OAAO,CAACC,IAAI,CAAC,EAA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BACFC,WAAW;gBACf;YACJ;QACJ;QACAC,QAAQ;YACJ9C,cAAc;gBACV5B,OAAO;YACX;YACAgC,QAAQ,SAACG;uBAAW;oBAChBC,MAAM,kBACCD,MAAMY,EAAE,CAAC4B,KAAK,CAAC;wBACdC,gBAAgB;wBAChB5E,OAAOmC,MAAMX,MAAM,CAACqD,MAAM,CAAC,EAAE;oBACjC;gBAER;;QACJ;QACAC,UAAU;YACNlD,cAAc;gBACVkC,QAAQ;YACZ;QACJ;QACAiB,MAAM;YACF/C,QAAQ;uBAAO;oBACXI,MAAM;wBACF4C,eAAe;oBACnB;gBACJ;;QACJ;QACAC,OAAO;YACHjD,QAAQ;gBACJkD,cAAc;oBACVC,SAAS;oBACTC,YAAY;gBAChB;YACJ;QACJ;QACAC,SAAS;YACLzD,cAAc;gBACV0D,QAAQ;gBACRtB,WAAW,IAAI;YACnB;QACJ;QACAuB,OAAO;YACHvD,QAAQ;gBACJI,MAAM;oBACFoD,eAAe;oBACfC,SAAS;oBACT7E,YAAY;gBAChB;YACJ;QACJ;QACA8E,aAAa;YACT9D,cAAc;gBACVe,MAAM;gBACNgD,YAAY,KAAK;YACrB;QACJ;QACAC,UAAU;YACNhE,cAAc;gBACViE,IAAI;YACR;QACJ;IACJ;AACJ"}
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { Button as MantineButton, ButtonProps as MantineButtonProps } from '@mantine/core';
3
- import { ButtonWithDisabledTooltip, ButtonWithDisabledTooltipProps } from './ButtonWithDisabledTooltip';
3
+ import { ButtonWithDisabledTooltipProps } from './ButtonWithDisabledTooltip';
4
4
  export interface ButtonProps extends MantineButtonProps, ButtonWithDisabledTooltipProps {
5
5
  }
6
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 & {
@@ -11,6 +11,5 @@ export declare const Button: (<C = "button">(props: import("@mantine/utils").Pol
11
11
  component: import("react").ElementType<any>;
12
12
  })>, never> & {
13
13
  Group: typeof MantineButton.Group;
14
- DisabledTooltip: typeof ButtonWithDisabledTooltip;
15
14
  };
16
15
  //# sourceMappingURL=Button.d.ts.map
@@ -1 +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"}
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,EAAC,MAAM,eAAe,CAAC;AAIzF,OAAO,EAA4B,8BAA8B,EAAC,MAAM,6BAA6B,CAAC;AAEtG,MAAM,WAAW,WAAY,SAAQ,kBAAkB,EAAE,8BAA8B;CAAG;AAc1F,eAAO,MAAM,MAAM;;;;;;;WAA6D,OAAO,cAAc,KAAK;CAAW,CAAC"}
@@ -1,20 +1,21 @@
1
- import { Property } from 'csstype';
2
- import { MouseEventHandler } from 'react';
1
+ import { TooltipProps } from '@mantine/core';
2
+ import { ReactNode } from 'react';
3
3
  export interface ButtonWithDisabledTooltipProps {
4
- disabled?: boolean;
5
- onClick?: MouseEventHandler<HTMLButtonElement>;
6
4
  /**
7
5
  * The tooltip message to display when disabled
8
6
  */
9
7
  disabledTooltip?: string;
10
8
  /**
11
- * The background color when disabled
12
- *
13
- * @default 'unset'
9
+ * Whether the button underneath the tooltip is disabled
10
+ */
11
+ disabled?: boolean;
12
+ children?: ReactNode;
13
+ /**
14
+ * Additional tooltip props to set on the disabled button tooltip
14
15
  */
15
- disabledHoverColor?: Property.BackgroundColor;
16
+ disabledTooltipProps?: Omit<TooltipProps, 'disabled' | 'label' | 'children'>;
16
17
  }
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
+ export declare const ButtonWithDisabledTooltip: (<C = "div">(props: import("@mantine/utils").PolymorphicComponentProps<C, ButtonWithDisabledTooltipProps>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) & Omit<import("react").FunctionComponent<(ButtonWithDisabledTooltipProps & {
18
19
  component?: any;
19
20
  } & Omit<Pick<any, string | number | symbol>, "component" | keyof ButtonWithDisabledTooltipProps> & {
20
21
  ref?: any;
@@ -1 +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"}
1
+ {"version":3,"file":"ButtonWithDisabledTooltip.d.ts","sourceRoot":"","sources":["../../../../src/components/button/ButtonWithDisabledTooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,YAAY,EAAC,MAAM,eAAe,CAAC;AACzD,OAAO,EAAa,SAAS,EAAC,MAAM,OAAO,CAAC;AAI5C,MAAM,WAAW,8BAA8B;IAC3C;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;OAEG;IACH,oBAAoB,CAAC,EAAE,IAAI,CAAC,YAAY,EAAE,UAAU,GAAG,OAAO,GAAG,UAAU,CAAC,CAAC;CAChF;AAeD,eAAO,MAAM,yBAAyB;;;;;;mCAErC,CAAC"}
@@ -1,9 +1,11 @@
1
1
  import { FunctionComponent, PropsWithChildren } from 'react';
2
2
  import { InlineConfirmButton } from './InlineConfirmButton';
3
+ import { InlineConfirmMenuItem } from './InlineConfirmMenuItem';
3
4
  import { InlineConfirmPrompt } from './InlineConfirmPrompt';
4
5
  type InlineConfirmType = FunctionComponent<PropsWithChildren> & {
5
6
  Prompt: typeof InlineConfirmPrompt;
6
7
  Button: typeof InlineConfirmButton;
8
+ MenuItem: typeof InlineConfirmMenuItem;
7
9
  };
8
10
  export declare const InlineConfirm: InlineConfirmType;
9
11
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"InlineConfirm.d.ts","sourceRoot":"","sources":["../../../../src/components/inline-confirm/InlineConfirm.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAW,iBAAiB,EAAE,iBAAiB,EAAyB,MAAM,OAAO,CAAC;AAE7F,OAAO,EAAC,mBAAmB,EAAC,MAAM,uBAAuB,CAAC;AAE1D,OAAO,EAAC,mBAAmB,EAAC,MAAM,uBAAuB,CAAC;AAE1D,KAAK,iBAAiB,GAAG,iBAAiB,CAAC,iBAAiB,CAAC,GAAG;IAC5D,MAAM,EAAE,OAAO,mBAAmB,CAAC;IACnC,MAAM,EAAE,OAAO,mBAAmB,CAAC;CACtC,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,iBAc3B,CAAC"}
1
+ {"version":3,"file":"InlineConfirm.d.ts","sourceRoot":"","sources":["../../../../src/components/inline-confirm/InlineConfirm.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAW,iBAAiB,EAAE,iBAAiB,EAAyB,MAAM,OAAO,CAAC;AAE7F,OAAO,EAAC,mBAAmB,EAAC,MAAM,uBAAuB,CAAC;AAE1D,OAAO,EAAC,qBAAqB,EAAC,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAC,mBAAmB,EAAC,MAAM,uBAAuB,CAAC;AAE1D,KAAK,iBAAiB,GAAG,iBAAiB,CAAC,iBAAiB,CAAC,GAAG;IAC5D,MAAM,EAAE,OAAO,mBAAmB,CAAC;IACnC,MAAM,EAAE,OAAO,mBAAmB,CAAC;IACnC,QAAQ,EAAE,OAAO,qBAAqB,CAAC;CAC1C,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,iBAc3B,CAAC"}
@@ -1,8 +1,8 @@
1
- import { HTMLAttributes } from 'react';
1
+ import { MouseEventHandler } from 'react';
2
2
  import { ButtonProps } from '../button';
3
- interface InlineConfirmButtonProps extends ButtonProps, Omit<HTMLAttributes<HTMLButtonElement>, 'color'> {
3
+ export interface InlineConfirmButtonProps extends ButtonProps {
4
4
  id: string;
5
+ onClick?: MouseEventHandler<HTMLButtonElement>;
5
6
  }
6
- export declare const InlineConfirmButton: (props: InlineConfirmButtonProps) => JSX.Element;
7
- export {};
7
+ export declare const InlineConfirmButton: import("react").ForwardRefExoticComponent<InlineConfirmButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
8
8
  //# sourceMappingURL=InlineConfirmButton.d.ts.map
@@ -1 +1 @@
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
+ {"version":3,"file":"InlineConfirmButton.d.ts","sourceRoot":"","sources":["../../../../src/components/inline-confirm/InlineConfirmButton.tsx"],"names":[],"mappings":"AACA,OAAO,EAAa,iBAAiB,EAAC,MAAM,OAAO,CAAC;AAEpD,OAAO,EAAC,WAAW,EAAC,MAAM,WAAW,CAAC;AAGtC,MAAM,WAAW,wBAAyB,SAAQ,WAAW;IACzD,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,CAAC,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;CAClD;AAED,eAAO,MAAM,mBAAmB,wHAU/B,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { MouseEventHandler } from 'react';
2
+ import { MenuItemProps } from '../menu';
3
+ export interface InlineConfirmMenuItemProps extends MenuItemProps {
4
+ id: string;
5
+ onClick?: MouseEventHandler<HTMLButtonElement>;
6
+ }
7
+ export declare const InlineConfirmMenuItem: import("react").ForwardRefExoticComponent<InlineConfirmMenuItemProps & import("react").RefAttributes<HTMLButtonElement>>;
8
+ //# sourceMappingURL=InlineConfirmMenuItem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InlineConfirmMenuItem.d.ts","sourceRoot":"","sources":["../../../../src/components/inline-confirm/InlineConfirmMenuItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,iBAAiB,EAAC,MAAM,OAAO,CAAC;AAEpD,OAAO,EAAO,aAAa,EAAC,MAAM,SAAS,CAAC;AAG5C,MAAM,WAAW,0BAA2B,SAAQ,aAAa;IAC7D,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,CAAC,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;CAClD;AAED,eAAO,MAAM,qBAAqB,0HAUjC,CAAC"}
@@ -1 +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"}
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,EAAC,8BAA8B,EAAC,MAAM,WAAW,CAAC;AAGzD,MAAM,WAAW,aAAc,SAAQ,oBAAoB,EAAE,8BAA8B;CAAG;AAgB9F,eAAO,MAAM,IAAI;;;;;;;;;CAGf,CAAC"}
@@ -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,oBAsLzB,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,oBA6LzB,CAAC"}
@@ -1,18 +1,27 @@
1
1
  import _object_spread from "@swc/helpers/src/_object_spread.mjs";
2
+ import _object_without_properties from "@swc/helpers/src/_object_without_properties.mjs";
2
3
  import { jsx as _jsx } from "react/jsx-runtime";
3
- import { Button as MantineButton, useMantineTheme } from "@mantine/core";
4
+ import { Button as MantineButton } from "@mantine/core";
4
5
  import { forwardRef } from "react";
5
6
  import { createPolymorphicComponent } from "../../utils";
6
7
  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));
8
+ var _Button = /*#__PURE__*/ forwardRef(function(_param, ref) /*#__PURE__*/ {
9
+ var disabledTooltip = _param.disabledTooltip, disabled = _param.disabled, disabledTooltipProps = _param.disabledTooltipProps, others = _object_without_properties(_param, [
10
+ "disabledTooltip",
11
+ "disabled",
12
+ "disabledTooltipProps"
13
+ ]);
14
+ return _jsx(ButtonWithDisabledTooltip, {
15
+ disabled: disabled,
16
+ disabledTooltip: disabledTooltip,
17
+ disabledTooltipProps: disabledTooltipProps,
18
+ children: /*#__PURE__*/ _jsx(MantineButton, _object_spread({
19
+ ref: ref,
20
+ disabled: disabled
21
+ }, others))
22
+ });
14
23
  });
15
24
  export var Button = createPolymorphicComponent(_Button);
16
- Button.DisabledTooltip = ButtonWithDisabledTooltip;
25
+ Button.Group = MantineButton.Group;
17
26
 
18
27
  //# sourceMappingURL=Button.js.map
@@ -1 +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"}
1
+ {"version":3,"sources":["../../../../src/components/button/Button.tsx"],"sourcesContent":["import {Button as MantineButton, ButtonProps as MantineButtonProps} 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>(\n ({disabledTooltip, disabled, disabledTooltipProps, ...others}, ref) => (\n <ButtonWithDisabledTooltip\n disabled={disabled}\n disabledTooltip={disabledTooltip}\n disabledTooltipProps={disabledTooltipProps}\n >\n <MantineButton ref={ref} disabled={disabled} {...others} />\n </ButtonWithDisabledTooltip>\n )\n);\n\nexport const Button = createPolymorphicComponent<'button', ButtonProps, {Group: typeof MantineButton.Group}>(_Button);\nButton.Group = MantineButton.Group;\n"],"names":["Button","MantineButton","forwardRef","createPolymorphicComponent","ButtonWithDisabledTooltip","_Button","ref","disabledTooltip","disabled","disabledTooltipProps","others","Group"],"mappings":"AAAA;;;AAAA,SAAQA,UAAUC,aAAa,QAA0C,gBAAgB;AACzF,SAAQC,UAAU,QAAO,QAAQ;AAEjC,SAAQC,0BAA0B,QAAO,cAAc;AACvD,SAAQC,yBAAyB,QAAuC,8BAA8B;AAItG,IAAMC,wBAAUH,WACZ,iBAA+DI,mBAC3D;QADFC,yBAAAA,iBAAiBC,kBAAAA,UAAUC,8BAAAA,sBAAyBC;QAApDH;QAAiBC;QAAUC;;WACzB,KAACL;QACGI,UAAUA;QACVD,iBAAiBA;QACjBE,sBAAsBA;kBAEtB,cAAA,KAACR;YAAcK,KAAKA;YAAKE,UAAUA;WAAcE;;AAC1B;AAInC,OAAO,IAAMV,SAASG,2BAAuFE,SAAS;AACtHL,OAAOW,KAAK,GAAGV,cAAcU,KAAK"}