@seed-design/react-field-button 1.0.1 → 1.0.2

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.
@@ -112,7 +112,6 @@ function useFieldButton({ values: propValues, onValuesChange, disabled = false,
112
112
  }
113
113
  }),
114
114
  clearButtonProps: buttonProps({
115
- ...stateProps,
116
115
  type: "button",
117
116
  disabled: disabled || readOnly,
118
117
  onClick: useCallback(()=>setValues([]), [
@@ -112,7 +112,6 @@ function useFieldButton({ values: propValues, onValuesChange, disabled = false,
112
112
  }
113
113
  }),
114
114
  clearButtonProps: domUtils.buttonProps({
115
- ...stateProps,
116
115
  type: "button",
117
116
  disabled: disabled || readOnly,
118
117
  onClick: react.useCallback(()=>setValues([]), [
package/lib/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- var FieldButton12s = require('./FieldButton-12s-Ctrm9BuF.cjs');
1
+ var FieldButton12s = require('./FieldButton-12s-CG6rqNcy.cjs');
2
2
 
3
3
  var FieldButton_namespace = {
4
4
  __proto__: null,
package/lib/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { F as FieldButtonButton, a as FieldButtonClearButton, b as FieldButtonDescription, c as FieldButtonErrorMessage, d as FieldButtonHiddenInput, e as FieldButtonRoot } from './FieldButton-12s-CcR1XhHB.js';
2
- export { u as useFieldButtonContext } from './FieldButton-12s-CcR1XhHB.js';
1
+ import { F as FieldButtonButton, a as FieldButtonClearButton, b as FieldButtonDescription, c as FieldButtonErrorMessage, d as FieldButtonHiddenInput, e as FieldButtonRoot } from './FieldButton-12s-BzczO8x6.js';
2
+ export { u as useFieldButtonContext } from './FieldButton-12s-BzczO8x6.js';
3
3
 
4
4
  var FieldButton_namespace = {
5
5
  __proto__: null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seed-design/react-field-button",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/daangn/seed-design.git",
@@ -1,7 +1,6 @@
1
- import "@testing-library/jest-dom/vitest";
2
- import { cleanup, fireEvent, render } from "@testing-library/react";
1
+ import { fireEvent, render } from "@testing-library/react";
3
2
  import userEvent from "@testing-library/user-event";
4
- import { afterEach, describe, expect, it, vi } from "vitest";
3
+ import { describe, expect, it, mock } from "bun:test";
5
4
 
6
5
  import type { ReactElement } from "react";
7
6
 
@@ -15,8 +14,6 @@ import {
15
14
  type FieldButtonRootProps,
16
15
  } from "./FieldButton";
17
16
 
18
- afterEach(cleanup);
19
-
20
17
  function setUp(jsx: ReactElement) {
21
18
  return {
22
19
  user: userEvent.setup(),
@@ -39,11 +36,6 @@ function FieldButton(props: FieldButtonRootProps) {
39
36
  }
40
37
 
41
38
  describe("useFieldButton", () => {
42
- global.CSS = {
43
- // @ts-expect-error
44
- supports: (_k, _v) => true,
45
- };
46
-
47
39
  it("should render the field button correctly", () => {
48
40
  const { getByRole } = setUp(<FieldButton />);
49
41
  const button = getByRole("button", { name: "Click me" });
@@ -233,7 +225,7 @@ describe("useFieldButton", () => {
233
225
 
234
226
  describe("clear button", () => {
235
227
  it("should call onValuesChange when clear button is clicked", async () => {
236
- const handleValuesChange = vi.fn();
228
+ const handleValuesChange = mock(() => {});
237
229
  const { getByRole, user } = setUp(
238
230
  <FieldButton values={["value1"]} onValuesChange={handleValuesChange} />,
239
231
  );
@@ -244,7 +236,7 @@ describe("useFieldButton", () => {
244
236
  });
245
237
 
246
238
  it("should hide clear button when disabled", async () => {
247
- const handleValuesChange = vi.fn();
239
+ const handleValuesChange = mock(() => {});
248
240
  const { getByText, user } = setUp(
249
241
  <FieldButton disabled values={["value1"]} onValuesChange={handleValuesChange} />,
250
242
  );
@@ -257,7 +249,7 @@ describe("useFieldButton", () => {
257
249
  });
258
250
 
259
251
  it("should hide clear button when readOnly", async () => {
260
- const handleValuesChange = vi.fn();
252
+ const handleValuesChange = mock(() => {});
261
253
  const { getByText, user } = setUp(
262
254
  <FieldButton readOnly values={["value1"]} onValuesChange={handleValuesChange} />,
263
255
  );
@@ -172,8 +172,6 @@ export function useFieldButton({
172
172
  }),
173
173
 
174
174
  clearButtonProps: buttonProps({
175
- ...stateProps,
176
-
177
175
  type: "button",
178
176
  disabled: disabled || readOnly,
179
177