@purpurds/autocomplete 5.10.1 → 5.11.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpurds/autocomplete",
3
- "version": "5.10.1",
3
+ "version": "5.11.0",
4
4
  "license": "AGPL-3.0-only",
5
5
  "main": "./dist/autocomplete.cjs.js",
6
6
  "types": "./dist/autocomplete.d.ts",
@@ -15,10 +15,10 @@
15
15
  "source": "src/autocomplete.tsx",
16
16
  "dependencies": {
17
17
  "classnames": "~2.5.0",
18
- "@purpurds/paragraph": "5.10.1",
19
- "@purpurds/tokens": "5.10.1",
20
- "@purpurds/icon": "5.10.1",
21
- "@purpurds/text-field": "5.10.1"
18
+ "@purpurds/icon": "5.11.0",
19
+ "@purpurds/paragraph": "5.11.0",
20
+ "@purpurds/text-field": "5.11.0",
21
+ "@purpurds/tokens": "5.11.0"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@rushstack/eslint-patch": "~1.10.0",
@@ -43,9 +43,9 @@
43
43
  "typescript": "~5.4.2",
44
44
  "vite": "~5.2.2",
45
45
  "vitest": "~1.5.0",
46
- "@purpurds/icon": "5.10.1",
47
- "@purpurds/button": "5.10.1",
48
- "@purpurds/search-field": "5.10.1",
46
+ "@purpurds/icon": "5.11.0",
47
+ "@purpurds/button": "5.11.0",
48
+ "@purpurds/search-field": "5.11.0",
49
49
  "@purpurds/component-rig": "1.0.0"
50
50
  },
51
51
  "scripts": {
@@ -1,8 +1,7 @@
1
1
  import type { ComponentPropsWithRef, ForwardedRef, ReactNode } from "react";
2
- import React, { cloneElement, forwardRef, isValidElement } from "react";
2
+ import React, { cloneElement, forwardRef } from "react";
3
3
  import { IconChevronDown } from "@purpurds/icon";
4
- import type { TextFieldProps } from "@purpurds/text-field";
5
- import { TextField } from "@purpurds/text-field";
4
+ import { isTextField } from "@purpurds/text-field";
6
5
  import c from "classnames/bind";
7
6
 
8
7
  import styles from "./autocomplete.module.scss";
@@ -66,12 +65,7 @@ const AutocompleteComponent = <T extends Option>(
66
65
 
67
66
  const getInputComponent = () => {
68
67
  const input = renderInput(inputProps);
69
- const isCombobox =
70
- combobox &&
71
- noOptionsText &&
72
- input &&
73
- isValidElement<TextFieldProps>(input) &&
74
- input.type === TextField;
68
+ const isCombobox = combobox && noOptionsText && input && isTextField(input);
75
69
 
76
70
  if (isCombobox) {
77
71
  const endAdornment = (