downshift 9.4.0-alpha.1 → 9.4.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 (49) hide show
  1. package/dist/downshift.cjs.cjs +134 -128
  2. package/dist/downshift.d.ts +60 -56
  3. package/dist/downshift.esm.mjs +134 -128
  4. package/dist/downshift.native.cjs.cjs +131 -128
  5. package/dist/downshift.nativeweb.cjs.cjs +134 -128
  6. package/dist/downshift.types.d.ts +5 -4
  7. package/dist/downshift.umd.js +134 -128
  8. package/dist/downshift.umd.js.map +1 -1
  9. package/dist/downshift.umd.min.js +1 -1
  10. package/dist/downshift.umd.min.js.map +1 -1
  11. package/dist/hooks/testUtils/interactions.d.ts +7 -7
  12. package/dist/hooks/useCombobox/__tests__/utils/renderCombobox.d.ts +3 -59
  13. package/dist/hooks/useCombobox/__tests__/utils/renderUseCombobox.d.ts +1 -1
  14. package/dist/hooks/useCombobox/index.types.d.ts +8 -9
  15. package/dist/hooks/useCombobox/utils/getInitialState.d.ts +1 -6
  16. package/dist/hooks/useCombobox/utils/propTypes.d.ts +1 -43
  17. package/dist/hooks/useMultipleSelection/index.types.d.ts +5 -5
  18. package/dist/hooks/useSelect/__tests__/utils/getItemIndexByCharacter.d.ts +1 -1
  19. package/dist/hooks/useSelect/__tests__/utils/renderSelect.d.ts +2 -58
  20. package/dist/hooks/useSelect/__tests__/utils/renderUseSelect.d.ts +1 -1
  21. package/dist/hooks/useSelect/__tests__/utils/stateChangeTestCases.d.ts +29 -50
  22. package/dist/hooks/useSelect/index.types.d.ts +7 -7
  23. package/dist/hooks/useSelect/utils/propTypes.d.ts +1 -38
  24. package/dist/hooks/useTagGroup/__tests__/utils/renderTagGroup.d.ts +1 -63
  25. package/dist/hooks/useTagGroup/__tests__/utils/renderUseTagGroup.d.ts +2 -2
  26. package/dist/hooks/useTagGroup/index.types.d.ts +5 -5
  27. package/dist/hooks/utils/dropdownDefaultProps.d.ts +3 -4
  28. package/dist/hooks/utils/isDropdownStateEqual.d.ts +1 -1
  29. package/dist/hooks/utils/useMouseAndTouchTracker.d.ts +3 -3
  30. package/dist/hooks/utils/useScrollIntoView.d.ts +4 -3
  31. package/dist/utils/getHighlightedIndex.d.ts +1 -1
  32. package/dist/utils/getNonDisabledIndex.d.ts +1 -1
  33. package/dist/utils/index.d.ts +1 -0
  34. package/dist/utils/useIsomorphicLayoutEffect.d.ts +2 -0
  35. package/dist/utils/useLatestRef.d.ts +1 -1
  36. package/package.json +39 -20
  37. package/preact/dist/downshift.cjs.cjs +134 -128
  38. package/preact/dist/downshift.esm.mjs +134 -128
  39. package/preact/dist/downshift.umd.js +134 -128
  40. package/preact/dist/downshift.umd.js.map +1 -1
  41. package/preact/dist/downshift.umd.min.js +1 -1
  42. package/preact/dist/downshift.umd.min.js.map +1 -1
  43. package/typings/index.d.ts +6 -6
  44. package/dist/hooks/useMultipleSelection/index.d.ts +0 -50
  45. package/dist/hooks/useMultipleSelection/reducer.d.ts +0 -1
  46. package/dist/hooks/useMultipleSelection/stateChangeTypes.d.ts +0 -13
  47. package/dist/hooks/useMultipleSelection/utils.d.ts +0 -44
  48. package/preact/dist/downshift.cjs.js +0 -4265
  49. package/preact/dist/downshift.esm.js +0 -4238
@@ -1,38 +1 @@
1
- import PropTypes from 'prop-types';
2
- export declare const propTypes: {
3
- items: PropTypes.Validator<any[]>;
4
- isItemDisabled: PropTypes.Requireable<(...args: any[]) => any>;
5
- getA11yStatusMessage: PropTypes.Requireable<(...args: any[]) => any>;
6
- highlightedIndex: PropTypes.Requireable<number>;
7
- defaultHighlightedIndex: PropTypes.Requireable<number>;
8
- initialHighlightedIndex: PropTypes.Requireable<number>;
9
- isOpen: PropTypes.Requireable<boolean>;
10
- defaultIsOpen: PropTypes.Requireable<boolean>;
11
- initialIsOpen: PropTypes.Requireable<boolean>;
12
- selectedItem: PropTypes.Requireable<any>;
13
- initialSelectedItem: PropTypes.Requireable<any>;
14
- defaultSelectedItem: PropTypes.Requireable<any>;
15
- id: PropTypes.Requireable<string>;
16
- labelId: PropTypes.Requireable<string>;
17
- menuId: PropTypes.Requireable<string>;
18
- getItemId: PropTypes.Requireable<(...args: any[]) => any>;
19
- toggleButtonId: PropTypes.Requireable<string>;
20
- onSelectedItemChange: PropTypes.Requireable<(...args: any[]) => any>;
21
- onHighlightedIndexChange: PropTypes.Requireable<(...args: any[]) => any>;
22
- onStateChange: PropTypes.Requireable<(...args: any[]) => any>;
23
- onIsOpenChange: PropTypes.Requireable<(...args: any[]) => any>;
24
- scrollIntoView: PropTypes.Requireable<(...args: any[]) => any>;
25
- environment: PropTypes.Requireable<PropTypes.InferProps<{
26
- addEventListener: PropTypes.Validator<(...args: any[]) => any>;
27
- removeEventListener: PropTypes.Validator<(...args: any[]) => any>;
28
- document: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
29
- createElement: PropTypes.Validator<(...args: any[]) => any>;
30
- getElementById: PropTypes.Validator<(...args: any[]) => any>;
31
- activeElement: PropTypes.Validator<any>;
32
- body: PropTypes.Validator<any>;
33
- }>>>;
34
- Node: PropTypes.Validator<(...args: any[]) => any>;
35
- }>>;
36
- itemToKey: PropTypes.Requireable<(...args: any[]) => any>;
37
- stateReducer: PropTypes.Requireable<(...args: any[]) => any>;
38
- };
1
+ export declare const propTypes: any;
@@ -1,64 +1,2 @@
1
- import * as React from 'react';
2
1
  import { UseTagGroupProps } from '../../index.types';
3
- export declare function renderTagGroup(props?: Partial<UseTagGroupProps<string>>): {
4
- getTags: () => HTMLElement[];
5
- getTagGroup: () => HTMLElement;
6
- clickOnTag: (index: number) => Promise<void>;
7
- clickOnRemoveTag: (index: number) => Promise<void>;
8
- getTagsRemoves: () => HTMLElement[];
9
- user: import("@testing-library/user-event").UserEvent;
10
- container: HTMLElement;
11
- baseElement: HTMLElement;
12
- debug: (baseElement?: ReactDOMClient.Container | any | Array<ReactDOMClient.Container | any> | undefined, maxLength?: number | undefined, options?: import("node_modules/pretty-format/build").OptionsReceived | undefined) => void;
13
- rerender: (ui: React.ReactNode) => void;
14
- unmount: () => void;
15
- asFragment: () => DocumentFragment;
16
- getByLabelText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => HTMLElement;
17
- getAllByLabelText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => HTMLElement[];
18
- queryByLabelText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => HTMLElement | null;
19
- queryAllByLabelText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => HTMLElement[];
20
- findByLabelText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement>;
21
- findAllByLabelText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement[]>;
22
- getByPlaceholderText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement;
23
- getAllByPlaceholderText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[];
24
- queryByPlaceholderText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement | null;
25
- queryAllByPlaceholderText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[];
26
- findByPlaceholderText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement>;
27
- findAllByPlaceholderText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement[]>;
28
- getByText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => HTMLElement;
29
- getAllByText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => HTMLElement[];
30
- queryByText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => HTMLElement | null;
31
- queryAllByText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => HTMLElement[];
32
- findByText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement>;
33
- findAllByText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement[]>;
34
- getByAltText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement;
35
- getAllByAltText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[];
36
- queryByAltText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement | null;
37
- queryAllByAltText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[];
38
- findByAltText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement>;
39
- findAllByAltText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement[]>;
40
- getByTitle: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement;
41
- getAllByTitle: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[];
42
- queryByTitle: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement | null;
43
- queryAllByTitle: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[];
44
- findByTitle: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement>;
45
- findAllByTitle: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement[]>;
46
- getByDisplayValue: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement;
47
- getAllByDisplayValue: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[];
48
- queryByDisplayValue: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement | null;
49
- queryAllByDisplayValue: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[];
50
- findByDisplayValue: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement>;
51
- findAllByDisplayValue: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement[]>;
52
- getByRole: (role: import("@testing-library/react").ByRoleMatcher, options?: import("@testing-library/react").ByRoleOptions | undefined) => HTMLElement;
53
- getAllByRole: (role: import("@testing-library/react").ByRoleMatcher, options?: import("@testing-library/react").ByRoleOptions | undefined) => HTMLElement[];
54
- queryByRole: (role: import("@testing-library/react").ByRoleMatcher, options?: import("@testing-library/react").ByRoleOptions | undefined) => HTMLElement | null;
55
- queryAllByRole: (role: import("@testing-library/react").ByRoleMatcher, options?: import("@testing-library/react").ByRoleOptions | undefined) => HTMLElement[];
56
- findByRole: (role: import("@testing-library/react").ByRoleMatcher, options?: import("@testing-library/react").ByRoleOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement>;
57
- findAllByRole: (role: import("@testing-library/react").ByRoleMatcher, options?: import("@testing-library/react").ByRoleOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement[]>;
58
- getByTestId: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement;
59
- getAllByTestId: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[];
60
- queryByTestId: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement | null;
61
- queryAllByTestId: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[];
62
- findByTestId: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement>;
63
- findAllByTestId: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement[]>;
64
- };
2
+ export declare function renderTagGroup(props?: Partial<UseTagGroupProps<string>>): any;
@@ -1,2 +1,2 @@
1
- import { UseTagGroupProps, UseTagGroupReturnValue } from '../../index.types';
2
- export declare function renderUseTagGroup(initialProps?: Partial<UseTagGroupProps<string>>): import("@testing-library/react").RenderHookResult<UseTagGroupReturnValue<string>, Partial<UseTagGroupProps<string>>>;
1
+ import { UseTagGroupProps } from '../../index.types';
2
+ export declare function renderUseTagGroup(initialProps?: Partial<UseTagGroupProps<string>>): any;
@@ -1,4 +1,4 @@
1
- import { Environment } from '../../downshift.types';
1
+ import { AnyRef, Environment } from '../../downshift.types';
2
2
  export interface UseTagGroupState<Item> {
3
3
  activeIndex: number;
4
4
  items: Item[];
@@ -52,12 +52,12 @@ export interface UseTagGroupReturnValue<Item> {
52
52
  export interface GetTagPropsOptions extends React.HTMLProps<HTMLElement> {
53
53
  index: number;
54
54
  refKey?: string;
55
- ref?: React.Ref<any>;
55
+ ref?: AnyRef;
56
56
  }
57
57
  export interface GetTagPropsReturnValue {
58
58
  'aria-describedby': string;
59
59
  id: string;
60
- ref?: React.Ref<any>;
60
+ ref?: AnyRef;
61
61
  role: 'option';
62
62
  onPress?: (event: React.BaseSyntheticEvent) => void;
63
63
  onClick?: React.MouseEventHandler;
@@ -75,11 +75,11 @@ export interface GetTagRemovePropsReturnValue {
75
75
  }
76
76
  export interface GetTagGroupPropsOptions extends React.HTMLProps<HTMLElement> {
77
77
  refKey?: string;
78
- ref?: React.Ref<any>;
78
+ ref?: AnyRef;
79
79
  }
80
80
  export interface GetTagGroupPropsReturnValue {
81
81
  id: string;
82
- ref?: React.Ref<any>;
82
+ ref?: AnyRef;
83
83
  role: 'listbox';
84
84
  'aria-live': 'polite';
85
85
  'aria-atomic': 'false';
@@ -1,13 +1,12 @@
1
- import { scrollIntoView } from '../../utils';
2
1
  export declare const dropdownDefaultProps: {
3
2
  itemToString(item: unknown): string;
4
3
  itemToKey(item: unknown): unknown;
5
4
  isItemDisabled(_item: unknown): boolean;
6
- stateReducer: <S, A>(_state: S, actionAndChanges: (A & {
5
+ stateReducer: <S, A>(_state: S, actionAndChanges: A & {
7
6
  props: any;
8
- }) & {
7
+ } & {
9
8
  changes: Partial<S>;
10
9
  }) => Partial<S>;
11
- scrollIntoView: typeof scrollIntoView;
10
+ scrollIntoView: any;
12
11
  environment: (Window & typeof globalThis) | undefined;
13
12
  };
@@ -10,7 +10,7 @@ type DropdownState<Item> = {
10
10
  *
11
11
  * @param prevState The previous dropdown state.
12
12
  * @param newState The new dropdown state.
13
- * @returns Wheather the states are deeply equal.
13
+ * @returns Whether the states are deeply equal.
14
14
  */
15
15
  export declare function isDropdownStateEqual<Item>(prevState: DropdownState<Item>, newState: DropdownState<Item>): boolean;
16
16
  export {};
@@ -6,10 +6,10 @@ import { Environment } from '../../downshift.types';
6
6
  * @param environment The environment to add the event listeners to, for instance window.
7
7
  * @param handleBlur The function that is called if mouseDown or touchEnd occured outside the downshiftElements.
8
8
  * @param downshiftRefs The refs for the elements that should not trigger a blur action from mouseDown or touchEnd.
9
- * @returns The mouse and touch events information.
9
+ * @returns A ref holding the mouse and touch events information. Read `.current` only inside event handlers/effects.
10
10
  */
11
- export declare function useMouseAndTouchTracker(environment: Environment | undefined, handleBlur: () => void, downshiftRefs: React.RefObject<HTMLElement>[]): {
11
+ export declare function useMouseAndTouchTracker(environment: Environment | undefined, handleBlur: () => void, downshiftRefs: React.RefObject<HTMLElement>[]): React.MutableRefObject<{
12
12
  isMouseDown: boolean;
13
13
  isTouchMove: boolean;
14
14
  isTouchEnd: boolean;
15
- };
15
+ }>;
@@ -1,11 +1,12 @@
1
+ import * as React from 'react';
1
2
  /**
2
3
  * Utility hook that scrolls an item from a menu into view.
3
4
  * @param scrollIntoView The function that does the scroll.
4
5
  * @param highlightedIndex The index of the item that should be scrolled.
5
6
  * @param isOpen If the menu is open or not.
6
- * @param menuElement The menu element.
7
- * @param itemElements The object containing item elements.
7
+ * @param menuRef The ref to the menu element.
8
+ * @param itemsRef The ref to the object containing item elements.
8
9
  * @param getItemId The function to get the item id from index.
9
10
  * @returns Function that when called prevents the scroll.
10
11
  */
11
- export declare function useScrollIntoView(scrollIntoView: (node: HTMLElement, menuNode: HTMLElement) => void, highlightedIndex: number, isOpen: boolean, menuElement: HTMLElement | null, itemElements: Record<string, HTMLElement>, getItemId: (index: number) => string): () => void;
12
+ export declare function useScrollIntoView(scrollIntoView: (node: HTMLElement, menuNode: HTMLElement) => void, highlightedIndex: number, isOpen: boolean, menuRef: React.MutableRefObject<HTMLElement | null>, itemsRef: React.MutableRefObject<Record<string, HTMLElement>>, getItemId: (index: number) => string): () => void;
@@ -8,4 +8,4 @@
8
8
  * @param circular If the search reaches the end, if it can search again starting from the other end.
9
9
  * @returns The next highlightedIndex.
10
10
  */
11
- export declare function getHighlightedIndex<Item>(start: number, offset: number, items: Item[], isItemDisabled: (item: Item, index: number) => boolean, circular?: boolean): number;
11
+ export declare function getHighlightedIndex<Item>(start: number, offset: number, items: Item[], isItemDisabled: (item: Item, index: number) => boolean, circular?: boolean): any;
@@ -8,4 +8,4 @@
8
8
  * @param circular If the search reaches the end, if it can search again starting from the other end.
9
9
  * @returns The next non-disabled index.
10
10
  */
11
- export declare function getNonDisabledIndex<Item>(start: number, backwards: boolean, items: Item[], isItemDisabled: (item: Item, index: number) => boolean, circular?: boolean): number;
11
+ export declare function getNonDisabledIndex<Item>(start: number, backwards: boolean, items: Item[], isItemDisabled: (item: Item, index: number) => boolean, circular?: boolean): any;
@@ -1,4 +1,5 @@
1
1
  export { generateId, setIdCounter, resetIdCounter } from './generateId';
2
+ export { useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect';
2
3
  export { useLatestRef } from './useLatestRef';
3
4
  export { handleRefs } from './handleRefs';
4
5
  export { callAllEventHandlers } from './callAllEventHandlers';
@@ -0,0 +1,2 @@
1
+ import * as React from 'react';
2
+ export declare const useIsomorphicLayoutEffect: typeof React.useEffect;
@@ -1,2 +1,2 @@
1
1
  import * as React from 'react';
2
- export declare function useLatestRef<T>(val: T): React.MutableRefObject<T>;
2
+ export declare function useLatestRef<T>(value: T): React.MutableRefObject<T>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "downshift",
3
- "version": "9.4.0-alpha.1",
3
+ "version": "9.4.0",
4
4
  "description": "🏎 A set of primitives to build simple, flexible, WAI-ARIA compliant React autocomplete, combobox or select dropdown components.",
5
5
  "main": "dist/downshift.cjs.cjs",
6
6
  "react-native": "dist/downshift.native.cjs.cjs",
@@ -24,24 +24,31 @@
24
24
  "test:flow:coverage": "flow-coverage-report",
25
25
  "test:build": "jest --config other/misc-tests/jest.config.js",
26
26
  "// FIXME: test:build": "jest --projects other/misc-tests other/react-native",
27
- "test:cypress:dev": "npm-run-all --parallel --race docs:dev cy:open",
28
- "pretest:cypress": "npm run docs:build --silent",
29
- "test:cypress": "start-server-and-test docs:serve http://localhost:6006 cy:run",
30
- "cy:run": "cypress run",
31
- "cy:open": "cypress open",
27
+ "test:e2e:dev": "playwright test --ui",
28
+ "pretest:e2e": "npm run docs:build --silent",
29
+ "test:e2e": "playwright test",
30
+ "pw:run": "playwright test",
31
+ "pw:open": "playwright test --ui",
32
32
  "build-and-test": "npm run build -s && npm run test:build -s",
33
33
  "docs:build": "docusaurus build",
34
34
  "docs:dev": "docusaurus start",
35
35
  "docs:serve": "docusaurus serve --port 6006",
36
36
  "docs:clear": "docusaurus clear",
37
37
  "setup": "npm install && npm run validate",
38
- "validate": "kcd-scripts validate lint,build-and-test,test:cover,test:ts,test:ssr,test:cypress"
38
+ "validate": "kcd-scripts validate lint,build-and-test,test:cover,test:ts,test:ssr,test:e2e"
39
39
  },
40
40
  "husky": {
41
41
  "hooks": {
42
- "pre-commit": "unset ELECTRON_RUN_AS_NODE && kcd-scripts pre-commit"
42
+ "pre-commit": "kcd-scripts pre-commit"
43
43
  }
44
44
  },
45
+ "lint-staged": {
46
+ "*.+(js|jsx|json|yml|yaml|css|less|scss|ts|tsx|md|gql|graphql|mdx|vue)": [
47
+ "kcd-scripts format",
48
+ "kcd-scripts lint",
49
+ "kcd-scripts test --findRelatedTests --passWithNoTests"
50
+ ]
51
+ },
45
52
  "files": [
46
53
  "dist",
47
54
  "typings",
@@ -89,15 +96,14 @@
89
96
  },
90
97
  "devDependencies": {
91
98
  "@babel/helpers": "^7.28.6",
92
- "@babel/plugin-proposal-private-methods": "^7.18.6",
93
- "@babel/plugin-proposal-private-property-in-object": "^7.21.11",
94
- "@docusaurus/core": "3.3.2",
95
- "@docusaurus/module-type-aliases": "3.3.2",
96
- "@docusaurus/preset-classic": "3.3.2",
99
+ "@docusaurus/babel": "3.10.1",
100
+ "@docusaurus/core": "3.10.1",
101
+ "@docusaurus/module-type-aliases": "3.10.1",
102
+ "@docusaurus/preset-classic": "3.10.1",
97
103
  "@mdx-js/react": "^3.0.1",
104
+ "@playwright/test": "^1.60.0",
98
105
  "@rollup/plugin-babel": "^6.1.0",
99
106
  "@rollup/plugin-commonjs": "^29.0.0",
100
- "@testing-library/cypress": "^10.1.0",
101
107
  "@testing-library/dom": "^10.4.1",
102
108
  "@testing-library/jest-dom": "^6.9.1",
103
109
  "@testing-library/preact": "^3.2.4",
@@ -114,10 +120,9 @@
114
120
  "buble": "^0.20.0",
115
121
  "cpy-cli": "^6.0.0",
116
122
  "cross-env": "^10.1.0",
117
- "cypress": "15.9.0",
118
123
  "eslint": "^8.57.0",
119
- "eslint-plugin-cypress": "^3.6.0",
120
124
  "eslint-plugin-react": "7.37.5",
125
+ "eslint-plugin-react-hooks": "^7.1.1",
121
126
  "flow-bin": "^0.299.0",
122
127
  "flow-coverage-report": "^0.8.0",
123
128
  "get-pkg-repo": "5.0.0",
@@ -127,6 +132,7 @@
127
132
  "preact": "^10.28.2",
128
133
  "prism-react-renderer": "^2.4.1",
129
134
  "react": "^18.3.1",
135
+ "react-compiler-runtime": "^1.0.0",
130
136
  "react-dom": "^18.3.1",
131
137
  "react-is": "^18.3.1",
132
138
  "react-native": "^0.76.0",
@@ -135,13 +141,17 @@
135
141
  "start-server-and-test": "^2.1.3",
136
142
  "typescript": "^5.9.3"
137
143
  },
144
+ "overrides": {
145
+ "eslint-plugin-react-hooks": "^7.1.1"
146
+ },
138
147
  "eslintConfig": {
139
148
  "parserOptions": {
140
149
  "ecmaVersion": 2023,
141
150
  "project": [
142
151
  "./tsconfig.json",
143
152
  "./docusaurus/tsconfig.json",
144
- "./test/tsconfig.json"
153
+ "./test/tsconfig.json",
154
+ "./e2e/tsconfig.json"
145
155
  ],
146
156
  "sourceType": "module"
147
157
  },
@@ -167,6 +177,7 @@
167
177
  },
168
178
  "extends": "./node_modules/kcd-scripts/eslint.js",
169
179
  "rules": {
180
+ "react-hooks/refs": "error",
170
181
  "react/jsx-indent": "off",
171
182
  "react/prop-types": "off",
172
183
  "max-lines-per-function": "off",
@@ -181,11 +192,16 @@
181
192
  "overrides": [
182
193
  {
183
194
  "files": [
184
- "cypress/**/*.js"
195
+ "e2e/**/*.ts"
185
196
  ],
186
197
  "rules": {
187
198
  "testing-library/prefer-screen-queries": "off",
188
- "testing-library/await-async-query": "off"
199
+ "import/no-extraneous-dependencies": [
200
+ "error",
201
+ {
202
+ "devDependencies": true
203
+ }
204
+ ]
189
205
  }
190
206
  }
191
207
  ]
@@ -196,7 +212,10 @@
196
212
  "dist",
197
213
  ".docusaurus",
198
214
  "build",
199
- "test"
215
+ "test",
216
+ "typings",
217
+ "playwright-report",
218
+ "test-results"
200
219
  ],
201
220
  "repository": {
202
221
  "type": "git",