@trackunit/custom-field-components 1.6.70 → 1.6.73

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/index.cjs.js CHANGED
@@ -237,7 +237,7 @@ const AddStringListField = ({ id, label, isEditing, setIsEditing, onAdd }) => {
237
237
  setIsEditing(false);
238
238
  }
239
239
  };
240
- return (jsxRuntime.jsxs(reactModal.Modal, { ...modal, className: "max-w-lg", dataTestId: `${id}-edit-modal`, children: [jsxRuntime.jsx(reactComponents.CardHeader, { heading: t("customfield.stringlistfield.addField.Heading", { label: label }), onClose: modal.close }), jsxRuntime.jsx(reactComponents.CardBody, { children: jsxRuntime.jsx(reactFormComponents.TextInput, { dataTestId: `${id}-edit-modal-input`, onChange: e => setInputValue(e.target.value), placeholder: t("customfield.stringlistfield.addField.InputPlaceholder", { label: label }), value: inputValue }) }), jsxRuntime.jsxs(reactComponents.CardFooter, { children: [jsxRuntime.jsx(reactComponents.Button, { dataTestId: `${id}-edit-modal-discard-button`, onClick: modal.close, variant: "ghost-neutral", children: t("customfield.stringlistfield.discard") }), jsxRuntime.jsx(reactComponents.Button, { dataTestId: `${id}-edit-modal-add-button`, onClick: handleAdd, children: t("customfield.stringlistfield.add") })] })] }));
240
+ return (jsxRuntime.jsxs(reactModal.Modal, { ...modal, className: "max-w-lg", dataTestId: `${id}-edit-modal`, children: [jsxRuntime.jsx(reactComponents.CardHeader, { heading: t("customfield.stringlistfield.addField.Heading", { label: label }), onClose: modal.close }), jsxRuntime.jsx(reactComponents.CardBody, { children: jsxRuntime.jsx(reactFormComponents.TextBaseInput, { dataTestId: `${id}-edit-modal-input`, onChange: e => setInputValue(e.target.value), placeholder: t("customfield.stringlistfield.addField.InputPlaceholder", { label: label }), value: inputValue }) }), jsxRuntime.jsxs(reactComponents.CardFooter, { children: [jsxRuntime.jsx(reactComponents.Button, { dataTestId: `${id}-edit-modal-discard-button`, onClick: modal.close, variant: "ghost-neutral", children: t("customfield.stringlistfield.discard") }), jsxRuntime.jsx(reactComponents.Button, { dataTestId: `${id}-edit-modal-add-button`, onClick: handleAdd, children: t("customfield.stringlistfield.add") })] })] }));
241
241
  };
242
242
 
243
243
  const StringListInput = ({ value: initialValue, onSave, onDelete, disabled, id, index }) => {
@@ -250,7 +250,7 @@ const StringListInput = ({ value: initialValue, onSave, onDelete, disabled, id,
250
250
  onSave(localValue);
251
251
  }
252
252
  }, [localValue, initialValue, onSave]);
253
- return (jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [jsxRuntime.jsx(reactFormComponents.TextInput, { "data-testid": `${id}-${index}-input`, disabled: disabled, onBlur: handleBlur, onChange: e => setLocalValue(e.target.value), value: localValue }), jsxRuntime.jsx(reactComponents.IconButton, { disabled: disabled, icon: jsxRuntime.jsx(reactComponents.Icon, { name: "Trash", size: "small" }), onClick: onDelete, variant: "secondary-danger" })] }));
253
+ return (jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [jsxRuntime.jsx(reactFormComponents.TextBaseInput, { "data-testid": `${id}-${index}-input`, disabled: disabled, onBlur: handleBlur, onChange: e => setLocalValue(e.target.value), value: localValue }), jsxRuntime.jsx(reactComponents.IconButton, { disabled: disabled, icon: jsxRuntime.jsx(reactComponents.Icon, { name: "Trash", size: "small" }), onClick: onDelete, variant: "secondary-danger" })] }));
254
254
  };
255
255
  /**
256
256
  * A custom field that displays a list of strings.
package/index.esm.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { jsx, jsxs } from 'react/jsx-runtime';
2
2
  import { registerTranslations, useNamespaceTranslation } from '@trackunit/i18n-library-translation';
3
3
  import { getCustomFieldValueForDisplayInUI } from '@trackunit/iris-app-runtime-core';
4
- import { FormGroup, Checkbox, DateField, Select, TextInput, useGetPhoneValidationRules, NumberField, TextField, PhoneField, ActionButton } from '@trackunit/react-form-components';
4
+ import { FormGroup, Checkbox, DateField, Select, TextBaseInput, useGetPhoneValidationRules, NumberField, TextField, PhoneField, ActionButton } from '@trackunit/react-form-components';
5
5
  import { uuidv4, exhaustiveCheck } from '@trackunit/shared-utils';
6
6
  import { useState, useEffect, useCallback, createElement, useMemo } from 'react';
7
7
  import { Controller, useWatch } from 'react-hook-form';
@@ -235,7 +235,7 @@ const AddStringListField = ({ id, label, isEditing, setIsEditing, onAdd }) => {
235
235
  setIsEditing(false);
236
236
  }
237
237
  };
238
- return (jsxs(Modal, { ...modal, className: "max-w-lg", dataTestId: `${id}-edit-modal`, children: [jsx(CardHeader, { heading: t("customfield.stringlistfield.addField.Heading", { label: label }), onClose: modal.close }), jsx(CardBody, { children: jsx(TextInput, { dataTestId: `${id}-edit-modal-input`, onChange: e => setInputValue(e.target.value), placeholder: t("customfield.stringlistfield.addField.InputPlaceholder", { label: label }), value: inputValue }) }), jsxs(CardFooter, { children: [jsx(Button, { dataTestId: `${id}-edit-modal-discard-button`, onClick: modal.close, variant: "ghost-neutral", children: t("customfield.stringlistfield.discard") }), jsx(Button, { dataTestId: `${id}-edit-modal-add-button`, onClick: handleAdd, children: t("customfield.stringlistfield.add") })] })] }));
238
+ return (jsxs(Modal, { ...modal, className: "max-w-lg", dataTestId: `${id}-edit-modal`, children: [jsx(CardHeader, { heading: t("customfield.stringlistfield.addField.Heading", { label: label }), onClose: modal.close }), jsx(CardBody, { children: jsx(TextBaseInput, { dataTestId: `${id}-edit-modal-input`, onChange: e => setInputValue(e.target.value), placeholder: t("customfield.stringlistfield.addField.InputPlaceholder", { label: label }), value: inputValue }) }), jsxs(CardFooter, { children: [jsx(Button, { dataTestId: `${id}-edit-modal-discard-button`, onClick: modal.close, variant: "ghost-neutral", children: t("customfield.stringlistfield.discard") }), jsx(Button, { dataTestId: `${id}-edit-modal-add-button`, onClick: handleAdd, children: t("customfield.stringlistfield.add") })] })] }));
239
239
  };
240
240
 
241
241
  const StringListInput = ({ value: initialValue, onSave, onDelete, disabled, id, index }) => {
@@ -248,7 +248,7 @@ const StringListInput = ({ value: initialValue, onSave, onDelete, disabled, id,
248
248
  onSave(localValue);
249
249
  }
250
250
  }, [localValue, initialValue, onSave]);
251
- return (jsxs("div", { className: "flex items-center gap-2", children: [jsx(TextInput, { "data-testid": `${id}-${index}-input`, disabled: disabled, onBlur: handleBlur, onChange: e => setLocalValue(e.target.value), value: localValue }), jsx(IconButton, { disabled: disabled, icon: jsx(Icon, { name: "Trash", size: "small" }), onClick: onDelete, variant: "secondary-danger" })] }));
251
+ return (jsxs("div", { className: "flex items-center gap-2", children: [jsx(TextBaseInput, { "data-testid": `${id}-${index}-input`, disabled: disabled, onBlur: handleBlur, onChange: e => setLocalValue(e.target.value), value: localValue }), jsx(IconButton, { disabled: disabled, icon: jsx(Icon, { name: "Trash", size: "small" }), onClick: onDelete, variant: "secondary-danger" })] }));
252
252
  };
253
253
  /**
254
254
  * A custom field that displays a list of strings.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/custom-field-components",
3
- "version": "1.6.70",
3
+ "version": "1.6.73",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -12,16 +12,16 @@
12
12
  "react-select": "^5.10.0",
13
13
  "@testing-library/react": "16.2.0",
14
14
  "jest-fetch-mock": "^3.0.3",
15
- "@trackunit/react-form-components": "1.7.34",
16
- "@trackunit/shared-utils": "1.8.45",
17
- "@trackunit/custom-field-api": "1.6.49",
18
- "@trackunit/iris-app-runtime-core": "1.7.47",
19
- "@trackunit/react-components": "1.8.18",
20
- "@trackunit/react-modal": "1.7.1",
21
- "@trackunit/react-core-hooks": "1.6.48",
22
- "@trackunit/i18n-library-translation": "1.6.49",
23
- "@trackunit/iris-app-runtime-core-api": "1.6.47",
24
- "@trackunit/react-test-setup": "1.3.45"
15
+ "@trackunit/react-form-components": "1.7.37",
16
+ "@trackunit/shared-utils": "1.8.48",
17
+ "@trackunit/custom-field-api": "1.6.52",
18
+ "@trackunit/iris-app-runtime-core": "1.7.50",
19
+ "@trackunit/react-components": "1.8.21",
20
+ "@trackunit/react-modal": "1.7.4",
21
+ "@trackunit/react-core-hooks": "1.6.51",
22
+ "@trackunit/i18n-library-translation": "1.6.52",
23
+ "@trackunit/iris-app-runtime-core-api": "1.6.50",
24
+ "@trackunit/react-test-setup": "1.3.48"
25
25
  },
26
26
  "module": "./index.esm.js",
27
27
  "main": "./index.cjs.js",