@coveord/plasma-mantine 52.26.1 → 52.26.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.
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"InlineConfirmButton.d.ts","sourceRoot":"","sources":["../../../../src/components/inline-confirm/InlineConfirmButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,iBAAiB,EAAC,MAAM,OAAO,CAAC;AACpD,OAAO,EAAS,WAAW,EAAC,MAAM,WAAW,CAAC;AAI9C,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"}
@@ -11,8 +11,8 @@ Object.defineProperty(exports, "InlineConfirmButton", {
11
11
  var _object_spread = require("@swc/helpers/_/_object_spread");
12
12
  var _object_without_properties = require("@swc/helpers/_/_object_without_properties");
13
13
  var _jsxruntime = require("react/jsx-runtime");
14
- var _core = require("@mantine/core");
15
14
  var _react = require("react");
15
+ var _button = require("../button");
16
16
  var _useInlineConfirm = require("./useInlineConfirm");
17
17
  var InlineConfirmButton = /*#__PURE__*/ (0, _react.forwardRef)(function(_param, ref) {
18
18
  var onClick = _param.onClick, id = _param.id, others = _object_without_properties._(_param, [
@@ -25,7 +25,7 @@ var InlineConfirmButton = /*#__PURE__*/ (0, _react.forwardRef)(function(_param,
25
25
  setConfirmingId(id);
26
26
  (_onClick = onClick) === null || _onClick === void 0 ? void 0 : _onClick(e);
27
27
  };
28
- return /*#__PURE__*/ (0, _jsxruntime.jsx)(_core.Button, _object_spread._({
28
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(_button.Button, _object_spread._({
29
29
  ref: ref,
30
30
  onClick: handleOnClick
31
31
  }, others));
@@ -1 +1 @@
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":";;;;+BAWaA;;;eAAAA;;;;;;oBAXQ;qBACuB;gCAGb;AAOxB,IAAMA,oCAAsBC,IAAAA,iBAAU,EACzC,iBAA2BC;QAAzBC,iBAAAA,SAASC,YAAAA,IAAOC;QAAhBF;QAASC;;IACP,IAAM,AAACE,kBAAmBC,IAAAA,kCAAgB,IAAnCD;IACP,IAAME,gBAAsD,SAACC;YAEzDN;QADAG,gBAAgBF;SAChBD,WAAAA,qBAAAA,+BAAAA,SAAUM;IACd;IAEA,qBAAO,qBAACC,YAAM;QAACR,KAAKA;QAAKC,SAASK;OAAmBH;AACzD"}
1
+ {"version":3,"sources":["../../../../src/components/inline-confirm/InlineConfirmButton.tsx"],"sourcesContent":["import {forwardRef, MouseEventHandler} from 'react';\nimport {Button, ButtonProps} from '../button';\n\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":";;;;+BAUaA;;;eAAAA;;;;;;qBAV+B;sBACV;gCAEH;AAOxB,IAAMA,oCAAsBC,IAAAA,iBAAU,EACzC,iBAA2BC;QAAzBC,iBAAAA,SAASC,YAAAA,IAAOC;QAAhBF;QAASC;;IACP,IAAM,AAACE,kBAAmBC,IAAAA,kCAAgB,IAAnCD;IACP,IAAME,gBAAsD,SAACC;YAEzDN;QADAG,gBAAgBF;SAChBD,WAAAA,qBAAAA,+BAAAA,SAAUM;IACd;IAEA,qBAAO,qBAACC,cAAM;QAACR,KAAKA;QAAKC,SAASK;OAAmBH;AACzD"}
@@ -13,11 +13,7 @@ var _object_spread_props = require("@swc/helpers/_/_object_spread_props");
13
13
  var _jsxruntime = require("react/jsx-runtime");
14
14
  var _core = require("@mantine/core");
15
15
  var TableLoading = function(props) {
16
- return /*#__PURE__*/ (0, _jsxruntime.jsx)(_core.Skeleton, _object_spread_props._(_object_spread._({
17
- style: {
18
- display: "inline-block"
19
- }
20
- }, props), {
16
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(_core.Skeleton, _object_spread_props._(_object_spread._({}, props), {
21
17
  sx: !props.visible ? {
22
18
  borderRadius: 0
23
19
  } : undefined,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/components/table/table-loading/TableLoading.tsx"],"sourcesContent":["import {Skeleton, SkeletonProps} from '@mantine/core';\nimport {FunctionComponent} from 'react';\n\nexport const TableLoading: FunctionComponent<SkeletonProps> = (props) => (\n <Skeleton style={{display: 'inline-block'}} {...props} sx={!props.visible ? {borderRadius: 0} : undefined}>\n {props.children}\n </Skeleton>\n);\n"],"names":["TableLoading","props","Skeleton","style","display","sx","visible","borderRadius","undefined","children"],"mappings":";;;;+BAGaA;;;eAAAA;;;;;;oBAHyB;AAG/B,IAAMA,eAAiD,SAACC;yBAC3D,qBAACC,cAAQ;QAACC,OAAO;YAACC,SAAS;QAAc;OAAOH;QAAOI,IAAI,CAACJ,MAAMK,OAAO,GAAG;YAACC,cAAc;QAAC,IAAIC;kBAC3FP,MAAMQ,QAAQ"}
1
+ {"version":3,"sources":["../../../../../src/components/table/table-loading/TableLoading.tsx"],"sourcesContent":["import {Skeleton, SkeletonProps} from '@mantine/core';\nimport {FunctionComponent} from 'react';\n\nexport const TableLoading: FunctionComponent<SkeletonProps> = (props) => (\n <Skeleton {...props} sx={!props.visible ? {borderRadius: 0} : undefined}>\n {props.children}\n </Skeleton>\n);\n"],"names":["TableLoading","props","Skeleton","sx","visible","borderRadius","undefined","children"],"mappings":";;;;+BAGaA;;;eAAAA;;;;;;oBAHyB;AAG/B,IAAMA,eAAiD,SAACC;yBAC3D,qBAACC,cAAQ,8CAAKD;QAAOE,IAAI,CAACF,MAAMG,OAAO,GAAG;YAACC,cAAc;QAAC,IAAIC;kBACzDL,MAAMM,QAAQ"}
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"InlineConfirmButton.d.ts","sourceRoot":"","sources":["../../../../src/components/inline-confirm/InlineConfirmButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,iBAAiB,EAAC,MAAM,OAAO,CAAC;AACpD,OAAO,EAAS,WAAW,EAAC,MAAM,WAAW,CAAC;AAI9C,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"}
@@ -1,8 +1,8 @@
1
1
  import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
2
2
  import { _ as _object_without_properties } from "@swc/helpers/_/_object_without_properties";
3
3
  import { jsx as _jsx } from "react/jsx-runtime";
4
- import { Button } from "@mantine/core";
5
4
  import { forwardRef } from "react";
5
+ import { Button } from "../button";
6
6
  import { useInlineConfirm } from "./useInlineConfirm";
7
7
  export var InlineConfirmButton = /*#__PURE__*/ forwardRef(function(_param, ref) {
8
8
  var onClick = _param.onClick, id = _param.id, others = _object_without_properties(_param, [
@@ -1 +1 @@
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":["Button","forwardRef","useInlineConfirm","InlineConfirmButton","ref","onClick","id","others","setConfirmingId","handleOnClick","e"],"mappings":";;;AAAA,SAAQA,MAAM,QAAO,gBAAgB;AACrC,SAAQC,UAAU,QAA0B,QAAQ;AAGpD,SAAQC,gBAAgB,QAAO,qBAAqB;AAOpD,OAAO,IAAMC,oCAAsBF,WAC/B,iBAA2BG;QAAzBC,iBAAAA,SAASC,YAAAA,IAAOC;QAAhBF;QAASC;;IACP,IAAM,AAACE,kBAAmBN,mBAAnBM;IACP,IAAMC,gBAAsD,SAACC;YAEzDL;QADAG,gBAAgBF;SAChBD,WAAAA,qBAAAA,+BAAAA,SAAUK;IACd;IAEA,qBAAO,KAACV;QAAOI,KAAKA;QAAKC,SAASI;OAAmBF;AACzD,GACF"}
1
+ {"version":3,"sources":["../../../../src/components/inline-confirm/InlineConfirmButton.tsx"],"sourcesContent":["import {forwardRef, MouseEventHandler} from 'react';\nimport {Button, ButtonProps} from '../button';\n\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":["forwardRef","Button","useInlineConfirm","InlineConfirmButton","ref","onClick","id","others","setConfirmingId","handleOnClick","e"],"mappings":";;;AAAA,SAAQA,UAAU,QAA0B,QAAQ;AACpD,SAAQC,MAAM,QAAoB,YAAY;AAE9C,SAAQC,gBAAgB,QAAO,qBAAqB;AAOpD,OAAO,IAAMC,oCAAsBH,WAC/B,iBAA2BI;QAAzBC,iBAAAA,SAASC,YAAAA,IAAOC;QAAhBF;QAASC;;IACP,IAAM,AAACE,kBAAmBN,mBAAnBM;IACP,IAAMC,gBAAsD,SAACC;YAEzDL;QADAG,gBAAgBF;SAChBD,WAAAA,qBAAAA,+BAAAA,SAAUK;IACd;IAEA,qBAAO,KAACT;QAAOG,KAAKA;QAAKC,SAASI;OAAmBF;AACzD,GACF"}
@@ -3,11 +3,7 @@ import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
3
3
  import { jsx as _jsx } from "react/jsx-runtime";
4
4
  import { Skeleton } from "@mantine/core";
5
5
  export var TableLoading = function(props) {
6
- return /*#__PURE__*/ _jsx(Skeleton, _object_spread_props(_object_spread({
7
- style: {
8
- display: "inline-block"
9
- }
10
- }, props), {
6
+ return /*#__PURE__*/ _jsx(Skeleton, _object_spread_props(_object_spread({}, props), {
11
7
  sx: !props.visible ? {
12
8
  borderRadius: 0
13
9
  } : undefined,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/components/table/table-loading/TableLoading.tsx"],"sourcesContent":["import {Skeleton, SkeletonProps} from '@mantine/core';\nimport {FunctionComponent} from 'react';\n\nexport const TableLoading: FunctionComponent<SkeletonProps> = (props) => (\n <Skeleton style={{display: 'inline-block'}} {...props} sx={!props.visible ? {borderRadius: 0} : undefined}>\n {props.children}\n </Skeleton>\n);\n"],"names":["Skeleton","TableLoading","props","style","display","sx","visible","borderRadius","undefined","children"],"mappings":";;;AAAA,SAAQA,QAAQ,QAAsB,gBAAgB;AAGtD,OAAO,IAAMC,eAAiD,SAACC;yBAC3D,KAACF;QAASG,OAAO;YAACC,SAAS;QAAc;OAAOF;QAAOG,IAAI,CAACH,MAAMI,OAAO,GAAG;YAACC,cAAc;QAAC,IAAIC;kBAC3FN,MAAMO,QAAQ;;EAErB"}
1
+ {"version":3,"sources":["../../../../../src/components/table/table-loading/TableLoading.tsx"],"sourcesContent":["import {Skeleton, SkeletonProps} from '@mantine/core';\nimport {FunctionComponent} from 'react';\n\nexport const TableLoading: FunctionComponent<SkeletonProps> = (props) => (\n <Skeleton {...props} sx={!props.visible ? {borderRadius: 0} : undefined}>\n {props.children}\n </Skeleton>\n);\n"],"names":["Skeleton","TableLoading","props","sx","visible","borderRadius","undefined","children"],"mappings":";;;AAAA,SAAQA,QAAQ,QAAsB,gBAAgB;AAGtD,OAAO,IAAMC,eAAiD,SAACC;yBAC3D,KAACF,kDAAaE;QAAOC,IAAI,CAACD,MAAME,OAAO,GAAG;YAACC,cAAc;QAAC,IAAIC;kBACzDJ,MAAMK,QAAQ;;EAErB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coveord/plasma-mantine",
3
- "version": "52.26.1",
3
+ "version": "52.26.3",
4
4
  "description": "A Plasma flavoured Mantine theme",
5
5
  "keywords": [
6
6
  "plasma",
@@ -1,7 +1,6 @@
1
- import {Button} from '@mantine/core';
2
1
  import {forwardRef, MouseEventHandler} from 'react';
2
+ import {Button, ButtonProps} from '../button';
3
3
 
4
- import {ButtonProps} from '../button';
5
4
  import {useInlineConfirm} from './useInlineConfirm';
6
5
 
7
6
  export interface InlineConfirmButtonProps extends ButtonProps {
@@ -120,4 +120,24 @@ describe('InlineConfirm', () => {
120
120
  expect(screen.queryByText('Delete X?')).not.toBeInTheDocument();
121
121
  expect(screen.getByText('Print?')).toBeVisible();
122
122
  });
123
+
124
+ it('shows tooltip when button is disabled', async () => {
125
+ const user = userEvent.setup();
126
+ const onClickSpy = vi.fn();
127
+ render(
128
+ <InlineConfirm>
129
+ <InlineConfirm.Button id="delete" onClick={onClickSpy} disabled disabledTooltip="You shall not pass">
130
+ Delete
131
+ </InlineConfirm.Button>
132
+ </InlineConfirm>,
133
+ );
134
+
135
+ const deleteButton = screen.getByRole('button', {name: 'Delete'});
136
+ expect(deleteButton).toBeDisabled();
137
+ expect(screen.queryByRole('tooltip', {name: /You shall not pass/i})).not.toBeInTheDocument();
138
+
139
+ await user.hover(deleteButton.parentElement);
140
+
141
+ expect(screen.getByRole('tooltip', {name: /You shall not pass/i})).toBeInTheDocument();
142
+ });
123
143
  });
@@ -2,7 +2,7 @@ import {Skeleton, SkeletonProps} from '@mantine/core';
2
2
  import {FunctionComponent} from 'react';
3
3
 
4
4
  export const TableLoading: FunctionComponent<SkeletonProps> = (props) => (
5
- <Skeleton style={{display: 'inline-block'}} {...props} sx={!props.visible ? {borderRadius: 0} : undefined}>
5
+ <Skeleton {...props} sx={!props.visible ? {borderRadius: 0} : undefined}>
6
6
  {props.children}
7
7
  </Skeleton>
8
8
  );