@purpurds/text-field 5.22.0 → 5.24.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 +6 -0
- package/dist/text-field.d.ts.map +1 -1
- package/dist/text-field.es.js +205 -203
- package/dist/text-field.es.js.map +1 -1
- package/package.json +8 -8
- package/src/text-field.stories.tsx +1 -0
- package/src/text-field.tsx +8 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@purpurds/text-field",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.24.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/button": "5.
|
|
19
|
-
"@purpurds/
|
|
20
|
-
"@purpurds/
|
|
21
|
-
"@purpurds/
|
|
22
|
-
"@purpurds/
|
|
23
|
-
"@purpurds/
|
|
24
|
-
"@purpurds/
|
|
18
|
+
"@purpurds/button": "5.24.0",
|
|
19
|
+
"@purpurds/icon": "5.24.0",
|
|
20
|
+
"@purpurds/label": "5.24.0",
|
|
21
|
+
"@purpurds/field-helper-text": "5.24.0",
|
|
22
|
+
"@purpurds/tokens": "5.24.0",
|
|
23
|
+
"@purpurds/field-error-text": "5.24.0",
|
|
24
|
+
"@purpurds/spinner": "5.24.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@rushstack/eslint-patch": "~1.10.0",
|
package/src/text-field.tsx
CHANGED
|
@@ -24,6 +24,12 @@ type TextFieldBaseProps = {
|
|
|
24
24
|
["data-testid"]?: string;
|
|
25
25
|
className?: string;
|
|
26
26
|
|
|
27
|
+
/**
|
|
28
|
+
* Use to display e.g. a button before the text field.
|
|
29
|
+
*
|
|
30
|
+
* _NOTE: Should ideally only be used by other purpur components!_
|
|
31
|
+
*/
|
|
32
|
+
beforeField?: ReactNode;
|
|
27
33
|
/**
|
|
28
34
|
* Use to display e.g. a button after the text field.
|
|
29
35
|
*
|
|
@@ -107,6 +113,7 @@ const TextFieldComponent = (
|
|
|
107
113
|
["data-testid"]: dataTestId,
|
|
108
114
|
className,
|
|
109
115
|
clearButtonAllyLabel,
|
|
116
|
+
beforeField,
|
|
110
117
|
afterField,
|
|
111
118
|
endAdornment,
|
|
112
119
|
errorText,
|
|
@@ -208,6 +215,7 @@ const TextFieldComponent = (
|
|
|
208
215
|
</Label>
|
|
209
216
|
)}
|
|
210
217
|
<div className={cx(`${rootClassName}__field-row`)}>
|
|
218
|
+
{!!beforeField && beforeField}
|
|
211
219
|
<div className={inputContainerClassnames}>
|
|
212
220
|
{!!startAdornments.length && (
|
|
213
221
|
<div
|