@purpurds/text-field 5.23.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpurds/text-field",
3
- "version": "5.23.0",
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/field-error-text": "5.23.0",
19
- "@purpurds/icon": "5.23.0",
20
- "@purpurds/field-helper-text": "5.23.0",
21
- "@purpurds/button": "5.23.0",
22
- "@purpurds/label": "5.23.0",
23
- "@purpurds/spinner": "5.23.0",
24
- "@purpurds/tokens": "5.23.0"
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",
@@ -51,6 +51,7 @@ const meta = {
51
51
  },
52
52
  startAdornment: { table: { disable: true } },
53
53
  endAdornment: { table: { disable: true } },
54
+ beforeField: { table: { disable: true } },
54
55
  afterField: { table: { disable: true } },
55
56
  },
56
57
 
@@ -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