@coveord/plasma-mantine 52.26.2 → 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.
- package/.turbo/turbo-build.log +3 -3
- package/.turbo/turbo-test.log +64 -64
- package/dist/.tsbuildinfo +1 -1
- package/dist/cjs/components/inline-confirm/InlineConfirmButton.d.ts.map +1 -1
- package/dist/cjs/components/inline-confirm/InlineConfirmButton.js +2 -2
- package/dist/cjs/components/inline-confirm/InlineConfirmButton.js.map +1 -1
- package/dist/esm/components/inline-confirm/InlineConfirmButton.d.ts.map +1 -1
- package/dist/esm/components/inline-confirm/InlineConfirmButton.js +1 -1
- package/dist/esm/components/inline-confirm/InlineConfirmButton.js.map +1 -1
- package/package.json +1 -1
- package/src/components/inline-confirm/InlineConfirmButton.tsx +1 -2
- package/src/components/inline-confirm/__tests__/InlineConfirm.spec.tsx +20 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InlineConfirmButton.d.ts","sourceRoot":"","sources":["../../../../src/components/inline-confirm/InlineConfirmButton.tsx"],"names":[],"mappings":"
|
|
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)(
|
|
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 {
|
|
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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InlineConfirmButton.d.ts","sourceRoot":"","sources":["../../../../src/components/inline-confirm/InlineConfirmButton.tsx"],"names":[],"mappings":"
|
|
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 {
|
|
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"}
|
package/package.json
CHANGED
|
@@ -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
|
});
|