@constructor-io/constructorio-ui-autocomplete 1.23.29 → 1.23.31

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.
@@ -4,7 +4,8 @@ const react_1 = require("react");
4
4
  const useCustomBlur = (isOpen, closeMenu, autocompleteClassName) => {
5
5
  const handleDocumentClick = (0, react_1.useCallback)((event) => {
6
6
  var _a;
7
- if (isOpen && !((_a = event.target) === null || _a === void 0 ? void 0 : _a.closest(`.${autocompleteClassName}`))) {
7
+ const classNames = autocompleteClassName.split(' ').join('.');
8
+ if (isOpen && !((_a = event.target) === null || _a === void 0 ? void 0 : _a.closest(`.${classNames}`))) {
8
9
  closeMenu();
9
10
  }
10
11
  }, [closeMenu, isOpen, autocompleteClassName]);
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = '1.23.29';
3
+ exports.default = '1.23.31';
@@ -1,7 +1,8 @@
1
1
  import { useCallback, useEffect } from 'react';
2
2
  const useCustomBlur = (isOpen, closeMenu, autocompleteClassName) => {
3
3
  const handleDocumentClick = useCallback((event) => {
4
- if (isOpen && !event.target?.closest(`.${autocompleteClassName}`)) {
4
+ const classNames = autocompleteClassName.split(' ').join('.');
5
+ if (isOpen && !event.target?.closest(`.${classNames}`)) {
5
6
  closeMenu();
6
7
  }
7
8
  }, [closeMenu, isOpen, autocompleteClassName]);
@@ -1 +1 @@
1
- export default '1.23.29';
1
+ export default '1.23.31';
@@ -1,4 +1,4 @@
1
- import { ReactNode } from 'react';
1
+ import React, { ReactNode } from 'react';
2
2
  import { Item, Section } from '../../../types';
3
3
  export type RenderResults = (renderResultsArguments: {
4
4
  sections: Section[];
@@ -7,5 +7,5 @@ export type RenderResults = (renderResultsArguments: {
7
7
  type AutocompleteResultsProps = {
8
8
  children?: RenderResults | ReactNode;
9
9
  };
10
- export default function AutocompleteResults(props: AutocompleteResultsProps): JSX.Element;
10
+ export default function AutocompleteResults(props: AutocompleteResultsProps): React.JSX.Element;
11
11
  export {};
@@ -1,2 +1,2 @@
1
- /// <reference types="react" />
2
- export default function CloseIcon(props: any): JSX.Element;
1
+ import React from 'react';
2
+ export default function CloseIcon(props: any): React.JSX.Element;
@@ -1,2 +1,2 @@
1
- /// <reference types="react" />
2
- export default function NoResults(): JSX.Element;
1
+ import React from 'react';
2
+ export default function NoResults(): React.JSX.Element;
@@ -1,3 +1,3 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { CioAutocompleteProps } from '../../../types';
3
- export default function CioAutocomplete(props: CioAutocompleteProps): JSX.Element;
3
+ export default function CioAutocomplete(props: CioAutocompleteProps): React.JSX.Element;
@@ -33,4 +33,4 @@ export declare const CioAutocompleteContext: React.Context<{
33
33
  advancedParameters: import("../../types").AdvancedParameters | undefined;
34
34
  getSearchResultsUrl: ((item: import("../../types").SearchSuggestion) => string) | undefined;
35
35
  }>;
36
- export default function CioAutocompleteProvider(props: CioAutocompleteProps): JSX.Element;
36
+ export default function CioAutocompleteProvider(props: CioAutocompleteProps): React.JSX.Element;
@@ -1,7 +1,7 @@
1
- import { ReactElement } from 'react';
1
+ import React, { ReactElement } from 'react';
2
2
  import { CioAutocompleteProps } from '../../../types';
3
3
  type SearchInputProps = {
4
4
  children?: (args: Partial<Omit<CioAutocompleteProps, 'children'>>) => ReactElement;
5
5
  };
6
- export default function SearchInput(props: SearchInputProps): JSX.Element;
6
+ export default function SearchInput(props: SearchInputProps): React.JSX.Element;
7
7
  export {};
@@ -1,4 +1,4 @@
1
- import { ReactNode } from 'react';
1
+ import React, { ReactNode } from 'react';
2
2
  import { Item } from '../../../types';
3
3
  interface CustomItemProps {
4
4
  item: Item;
@@ -9,5 +9,5 @@ interface CustomItemProps {
9
9
  }) => HTMLElement | ReactNode;
10
10
  query: string;
11
11
  }
12
- export default function CustomSectionItem(props: CustomItemProps): JSX.Element | null;
12
+ export default function CustomSectionItem(props: CustomItemProps): React.JSX.Element | null;
13
13
  export {};
@@ -1,8 +1,8 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { SearchSuggestion } from '../../../types';
3
3
  interface SearchSuggestionItemProps {
4
4
  item: SearchSuggestion;
5
5
  displaySearchTermHighlights?: boolean;
6
6
  }
7
- export default function SearchSuggestionItem(props: SearchSuggestionItemProps): JSX.Element;
7
+ export default function SearchSuggestionItem(props: SearchSuggestionItemProps): React.JSX.Element;
8
8
  export {};
@@ -1,4 +1,4 @@
1
- import { ReactNode } from 'react';
1
+ import React, { ReactNode } from 'react';
2
2
  import { Item } from '../../../types';
3
3
  export interface SectionItemProps {
4
4
  item: Item;
@@ -6,4 +6,4 @@ export interface SectionItemProps {
6
6
  key?: string;
7
7
  displaySearchTermHighlights?: boolean;
8
8
  }
9
- export default function SectionItem(props: SectionItemProps): JSX.Element;
9
+ export default function SectionItem(props: SectionItemProps): React.JSX.Element;
@@ -1,8 +1,8 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { Item } from '../../../types';
3
3
  export interface SectionItemTextProps {
4
4
  item: Item;
5
5
  query: string;
6
6
  highlightSearchTerm?: boolean;
7
7
  }
8
- export default function SectionItemText({ item, query, highlightSearchTerm, }: SectionItemTextProps): JSX.Element;
8
+ export default function SectionItemText({ item, query, highlightSearchTerm, }: SectionItemTextProps): React.JSX.Element;
@@ -1,2 +1,2 @@
1
- declare const _default: "1.23.29";
1
+ declare const _default: "1.23.31";
2
2
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@constructor-io/constructorio-ui-autocomplete",
3
- "version": "1.23.29",
3
+ "version": "1.23.31",
4
4
  "description": "Constructor.io Autocomplete UI library for web applications",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -11,13 +11,11 @@
11
11
  },
12
12
  ".": {
13
13
  "import": "./lib/mjs/index.js",
14
- "require": "./lib/cjs/index.js",
15
- "types": "./lib/types/index.d.ts"
14
+ "require": "./lib/cjs/index.js"
16
15
  },
17
16
  "./cjs": {
18
17
  "import": "./lib/cjs/index.js",
19
- "require": "./lib/cjs/index.js",
20
- "types": "./lib/types/index.d.ts"
18
+ "require": "./lib/cjs/index.js"
21
19
  },
22
20
  "./constructorio-ui-autocomplete-bundled": {
23
21
  "import": "./dist/constructorio-ui-autocomplete-bundled.js",
@@ -45,8 +43,8 @@
45
43
  "author": "Constructor.io Corporation",
46
44
  "license": "MIT",
47
45
  "volta": {
48
- "node": "16.17.0",
49
- "npm": "8.19.2"
46
+ "node": "22.14.0",
47
+ "npm": "10.9.2"
50
48
  },
51
49
  "repository": {
52
50
  "type": "git",
@@ -63,16 +61,22 @@
63
61
  "node": ">=14"
64
62
  },
65
63
  "devDependencies": {
64
+ "@babel/preset-env": "^7.26.9",
65
+ "@babel/preset-react": "^7.26.3",
66
+ "@babel/preset-typescript": "^7.27.0",
67
+ "@chromatic-com/storybook": "^3.2.6",
66
68
  "@cspell/eslint-plugin": "^6.18.1",
67
- "@storybook/addon-a11y": "^7.6.20",
68
- "@storybook/addon-actions": "^7.6.20",
69
- "@storybook/addon-essentials": "^7.6.20",
70
- "@storybook/addon-interactions": "^7.6.20",
71
- "@storybook/addon-links": "^7.6.20",
72
- "@storybook/jest": "^0.2.3",
73
- "@storybook/react-webpack5": "^7.6.20",
74
- "@storybook/test-runner": "^0.16.0",
75
- "@storybook/testing-library": "^0.1.0",
69
+ "@storybook/addon-a11y": "^8.6.12",
70
+ "@storybook/addon-actions": "^8.6.12",
71
+ "@storybook/addon-essentials": "^8.6.12",
72
+ "@storybook/addon-interactions": "^8.6.12",
73
+ "@storybook/addon-links": "^8.6.12",
74
+ "@storybook/addon-webpack5-compiler-babel": "^3.0.6",
75
+ "@storybook/manager-api": "^8.6.12",
76
+ "@storybook/react-webpack5": "^8.6.12",
77
+ "@storybook/test": "^8.6.12",
78
+ "@storybook/test-runner": "^0.22.0",
79
+ "@storybook/theming": "^8.6.12",
76
80
  "@testing-library/jest-dom": "^6.4.5",
77
81
  "@testing-library/react": "^16.0.0",
78
82
  "@types/jest": "^29.5.12",
@@ -89,21 +93,23 @@
89
93
  "eslint-plugin-prettier": "^5.1.3",
90
94
  "eslint-plugin-react": "^7.31.11",
91
95
  "eslint-plugin-react-hooks": "^4.6.0",
92
- "eslint-plugin-storybook": "^0.6.12",
96
+ "eslint-plugin-storybook": "^0.12.0",
93
97
  "husky": "^8.0.1",
94
98
  "jest": "^29.7.0",
95
99
  "jest-environment-jsdom": "^29.7.0",
96
100
  "jest-fail-on-console": "^3.3.0",
97
101
  "license-checker": "^25.0.1",
102
+ "playwright": "^1.52.0",
98
103
  "react": "^18.2.0",
99
104
  "react-dom": "^18.2.0",
100
105
  "start-server-and-test": "^2.0.3",
101
- "storybook": "^7.6.20",
106
+ "storybook": "^8.6.12",
102
107
  "ts-jest": "^29.1.5",
103
108
  "typescript": "^4.8.3",
104
- "vite": "^4.3.7",
109
+ "vite": "^6.3.2",
105
110
  "vite-plugin-css-injected-by-js": "^3.1.1",
106
- "webpack": "^5.75.0"
111
+ "webpack": "^5.75.0",
112
+ "whatwg-fetch": "^3.6.20"
107
113
  },
108
114
  "peerDependencies": {
109
115
  "@constructor-io/constructorio-client-javascript": "^2.51.0",