@purpurds/text-field 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/dist/LICENSE.txt +6 -6
- package/dist/text-field.cjs.js +10 -10
- package/dist/text-field.cjs.js.map +1 -1
- package/dist/text-field.d.ts +2 -1
- package/dist/text-field.d.ts.map +1 -1
- package/dist/text-field.es.js +134 -132
- package/dist/text-field.es.js.map +1 -1
- package/package.json +8 -8
- package/src/text-field.tsx +17 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@purpurds/text-field",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.11.0",
|
|
4
4
|
"license": "AGPL-3.0-only",
|
|
5
5
|
"main": "./dist/text-field.cjs.js",
|
|
6
6
|
"types": "./dist/text-field.d.ts",
|
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
"source": "src/text-field.tsx",
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"classnames": "~2.5.0",
|
|
18
|
-
"@purpurds/field-error-text": "5.
|
|
19
|
-
"@purpurds/
|
|
20
|
-
"@purpurds/
|
|
21
|
-
"@purpurds/icon": "5.
|
|
22
|
-
"@purpurds/label": "5.
|
|
23
|
-
"@purpurds/spinner": "5.
|
|
24
|
-
"@purpurds/tokens": "5.
|
|
18
|
+
"@purpurds/field-error-text": "5.11.0",
|
|
19
|
+
"@purpurds/field-helper-text": "5.11.0",
|
|
20
|
+
"@purpurds/button": "5.11.0",
|
|
21
|
+
"@purpurds/icon": "5.11.0",
|
|
22
|
+
"@purpurds/label": "5.11.0",
|
|
23
|
+
"@purpurds/spinner": "5.11.0",
|
|
24
|
+
"@purpurds/tokens": "5.11.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@rushstack/eslint-patch": "~1.10.0",
|
package/src/text-field.tsx
CHANGED
|
@@ -3,7 +3,10 @@ import React, {
|
|
|
3
3
|
ForwardedRef,
|
|
4
4
|
forwardRef,
|
|
5
5
|
HTMLInputTypeAttribute,
|
|
6
|
+
isValidElement,
|
|
7
|
+
ReactElement,
|
|
6
8
|
ReactNode,
|
|
9
|
+
ReactPortal,
|
|
7
10
|
useId,
|
|
8
11
|
} from "react";
|
|
9
12
|
import { Button } from "@purpurds/button";
|
|
@@ -256,3 +259,17 @@ const TextFieldComponent = (
|
|
|
256
259
|
|
|
257
260
|
export const TextField = forwardRef(TextFieldComponent);
|
|
258
261
|
TextField.displayName = "TextField";
|
|
262
|
+
|
|
263
|
+
export const isTextField = (
|
|
264
|
+
child:
|
|
265
|
+
| ReactElement
|
|
266
|
+
| Iterable<ReactNode>
|
|
267
|
+
| ReactPortal
|
|
268
|
+
| string
|
|
269
|
+
| number
|
|
270
|
+
| boolean
|
|
271
|
+
| null
|
|
272
|
+
| undefined
|
|
273
|
+
): child is ReactElement<TextFieldProps> =>
|
|
274
|
+
isValidElement<TextFieldProps>(child) &&
|
|
275
|
+
(child.type as any).displayName === TextField.displayName; // eslint-disable-line @typescript-eslint/no-explicit-any
|