@contentful/field-editor-url 1.3.35 → 1.4.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.
@@ -53,7 +53,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
53
53
  return newObj;
54
54
  }
55
55
  function UrlEditor(props) {
56
- const { field } = props;
56
+ const { field, id } = props;
57
57
  return _react.createElement(_fieldeditorshared.FieldConnector, {
58
58
  field: field,
59
59
  isInitiallyDisabled: props.isInitiallyDisabled
@@ -61,6 +61,7 @@ function UrlEditor(props) {
61
61
  return _react.createElement("div", {
62
62
  "data-test-id": "url-editor"
63
63
  }, _react.createElement(_f36components.TextInput, {
64
+ id: id,
64
65
  isRequired: field.required,
65
66
  isInvalid: errors.length > 0,
66
67
  isDisabled: disabled,
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import { TextInput } from '@contentful/f36-components';
3
3
  import { FieldConnector } from '@contentful/field-editor-shared';
4
4
  export function UrlEditor(props) {
5
- const { field } = props;
5
+ const { field, id } = props;
6
6
  return React.createElement(FieldConnector, {
7
7
  field: field,
8
8
  isInitiallyDisabled: props.isInitiallyDisabled
@@ -10,6 +10,7 @@ export function UrlEditor(props) {
10
10
  return React.createElement("div", {
11
11
  "data-test-id": "url-editor"
12
12
  }, React.createElement(TextInput, {
13
+ id: id,
13
14
  isRequired: field.required,
14
15
  isInvalid: errors.length > 0,
15
16
  isDisabled: disabled,
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { FieldAPI } from '@contentful/field-editor-shared';
2
+ import { type FieldAPI } from '@contentful/field-editor-shared';
3
3
  export interface UrlEditorProps {
4
4
  /**
5
5
  * is the field disabled initially
@@ -9,6 +9,10 @@ export interface UrlEditorProps {
9
9
  * sdk.field
10
10
  */
11
11
  field: FieldAPI;
12
+ /**
13
+ * id used for associating the input field with its label
14
+ */
15
+ id?: string;
12
16
  children?: (props: {
13
17
  value: string | null | undefined;
14
18
  }) => React.ReactNode;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/field-editor-url",
3
- "version": "1.3.35",
3
+ "version": "1.4.0",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "types": "dist/types/index.d.ts",
@@ -50,5 +50,5 @@
50
50
  "publishConfig": {
51
51
  "registry": "https://npm.pkg.github.com/"
52
52
  },
53
- "gitHead": "1d0dc6dc10cf4ad43aa48b04fa67d29ab7edaee8"
53
+ "gitHead": "7ec565308c8d4da384b8fec6f5d840bdf6d4927d"
54
54
  }