@doist/reactist 25.1.1 → 26.0.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.
Files changed (57) hide show
  1. package/dist/reactist.cjs.development.js +202 -115
  2. package/dist/reactist.cjs.development.js.map +1 -1
  3. package/dist/reactist.cjs.production.min.js +1 -1
  4. package/dist/reactist.cjs.production.min.js.map +1 -1
  5. package/es/base-field/base-field.js +98 -46
  6. package/es/base-field/base-field.js.map +1 -1
  7. package/es/base-field/base-field.module.css.js +1 -1
  8. package/es/modal/modal.js +5 -3
  9. package/es/modal/modal.js.map +1 -1
  10. package/es/password-field/password-field.js +5 -4
  11. package/es/password-field/password-field.js.map +1 -1
  12. package/es/select-field/select-field.js +9 -7
  13. package/es/select-field/select-field.js.map +1 -1
  14. package/es/switch-field/switch-field.js +10 -8
  15. package/es/switch-field/switch-field.js.map +1 -1
  16. package/es/text-area/text-area.js +34 -17
  17. package/es/text-area/text-area.js.map +1 -1
  18. package/es/text-area/text-area.module.css.js +1 -1
  19. package/es/text-field/text-field.js +39 -25
  20. package/es/text-field/text-field.js.map +1 -1
  21. package/es/text-field/text-field.module.css.js +1 -1
  22. package/lib/base-field/base-field.d.ts +17 -34
  23. package/lib/base-field/base-field.js +1 -1
  24. package/lib/base-field/base-field.js.map +1 -1
  25. package/lib/base-field/base-field.module.css.js +1 -1
  26. package/lib/modal/modal-stories-components.d.ts +1 -1
  27. package/lib/modal/modal.d.ts +2 -2
  28. package/lib/modal/modal.js +1 -1
  29. package/lib/modal/modal.js.map +1 -1
  30. package/lib/password-field/password-field.d.ts +1 -0
  31. package/lib/password-field/password-field.js +1 -1
  32. package/lib/password-field/password-field.js.map +1 -1
  33. package/lib/select-field/select-field.js +1 -1
  34. package/lib/select-field/select-field.js.map +1 -1
  35. package/lib/switch-field/switch-field.d.ts +1 -1
  36. package/lib/switch-field/switch-field.js +1 -1
  37. package/lib/switch-field/switch-field.js.map +1 -1
  38. package/lib/text-area/text-area.d.ts +9 -1
  39. package/lib/text-area/text-area.js +1 -1
  40. package/lib/text-area/text-area.js.map +1 -1
  41. package/lib/text-area/text-area.module.css.js +1 -1
  42. package/lib/text-field/text-field.js +1 -1
  43. package/lib/text-field/text-field.js.map +1 -1
  44. package/lib/text-field/text-field.module.css.js +1 -1
  45. package/package.json +1 -1
  46. package/styles/base-field.css +3 -2
  47. package/styles/base-field.module.css.css +1 -1
  48. package/styles/index.css +9 -1
  49. package/styles/password-field.css +3 -2
  50. package/styles/reactist.css +4 -4
  51. package/styles/select-field.css +2 -1
  52. package/styles/switch-field.css +2 -1
  53. package/styles/text-area.css +3 -2
  54. package/styles/text-area.module.css.css +1 -1
  55. package/styles/text-field.css +3 -2
  56. package/styles/text-field.module.css.css +1 -1
  57. /package/styles/{stack.css → divider.css} +0 -0
@@ -367,7 +367,7 @@ const Box$1 = /*#__PURE__*/polymorphicComponent(function Box(_ref9, ref) {
367
367
  var modules_67f2d07a = {"container":"eae3d34f","container-xsmall":"_9b4012c9","container-small":"e35e0320","container-medium":"_0703e67f","container-large":"_1cf15621","container-xlarge":"_1c7dff67","container-xxlarge":"_25bee9b6","columnWidth-content":"_4bb9987d","columnWidth-auto":"_9dd31975","columnWidth-1-2":"_38d11c0e","columnWidth-1-3":"_7ac225c6","columnWidth-2-3":"_9c340680","columnWidth-1-4":"_81cb99d2","columnWidth-3-4":"_10fd355f","columnWidth-1-5":"_3ee66520","columnWidth-2-5":"df1201a5","columnWidth-3-5":"f772e0b2","columnWidth-4-5":"_880cbbb1"};
368
368
 
369
369
  const _excluded$u = ["width", "children", "exceptionallySetClassName"],
370
- _excluded2$4 = ["space", "align", "alignY", "collapseBelow", "children", "exceptionallySetClassName"];
370
+ _excluded2$6 = ["space", "align", "alignY", "collapseBelow", "children", "exceptionallySetClassName"];
371
371
  const Column = /*#__PURE__*/polymorphicComponent(function Column(_ref, ref) {
372
372
  let {
373
373
  width = 'auto',
@@ -394,7 +394,7 @@ const Columns = /*#__PURE__*/polymorphicComponent(function Columns(_ref2, ref) {
394
394
  children,
395
395
  exceptionallySetClassName
396
396
  } = _ref2,
397
- props = _objectWithoutProperties(_ref2, _excluded2$4);
397
+ props = _objectWithoutProperties(_ref2, _excluded2$6);
398
398
 
399
399
  return /*#__PURE__*/React__namespace.createElement(Box$1, _objectSpread2(_objectSpread2({}, props), {}, {
400
400
  className: [exceptionallySetClassName, modules_67f2d07a.container, getClassNames(modules_67f2d07a, 'container', space)],
@@ -623,7 +623,7 @@ function Tooltip({
623
623
  var modules_5357ebb8 = {"baseButton":"_3930afa0","label":"_90654824","shape-rounded":"c05d17c2","size-small":"_1e29d236","size-normal":"_7246d092","size-large":"_2d084671","disabled":"_2b0b9d95","iconButton":"abd5766f","startIcon":"_380e7c73","endIcon":"_20fe4105","variant-primary":"_7ea1378e","variant-secondary":"_64ee8afd","variant-tertiary":"_650176bf","variant-quaternary":"aa19cb97","tone-destructive":"_7a2d9a8c"};
624
624
 
625
625
  const _excluded$p = ["variant", "tone", "size", "shape", "type", "disabled", "loading", "tooltip", "render", "onClick", "exceptionallySetClassName", "children", "startIcon", "endIcon", "width", "align"],
626
- _excluded2$3 = ["variant", "tone", "size", "shape", "type", "disabled", "loading", "tooltip", "render", "onClick", "exceptionallySetClassName", "children", "icon"];
626
+ _excluded2$5 = ["variant", "tone", "size", "shape", "type", "disabled", "loading", "tooltip", "render", "onClick", "exceptionallySetClassName", "children", "icon"];
627
627
 
628
628
  function preventDefault(event) {
629
629
  event.preventDefault();
@@ -706,7 +706,7 @@ const IconButton = /*#__PURE__*/React__namespace.forwardRef(function IconButton(
706
706
  children,
707
707
  icon
708
708
  } = _ref2,
709
- props = _objectWithoutProperties(_ref2, _excluded2$3);
709
+ props = _objectWithoutProperties(_ref2, _excluded2$5);
710
710
 
711
711
  const isDisabled = loading || disabled;
712
712
  const buttonElement = /*#__PURE__*/React__namespace.createElement(react.Role.button, _objectSpread2(_objectSpread2({}, props), {}, {
@@ -1743,29 +1743,12 @@ function PasswordHiddenIcon(props) {
1743
1743
  })));
1744
1744
  }
1745
1745
 
1746
- var modules_540a88ff = {"container":"_7acdc928","auxiliaryLabel":"_815bad88","bordered":"e35886fe","error":"_6c7b5dc8","primaryLabel":"ec74af87","secondaryLabel":"_6db0ec44","messageIcon":"_05c35af8"};
1746
+ var modules_540a88ff = {"container":"d5ff04da","auxiliaryLabel":"_8d2b52f1","bordered":"_49c37b27","error":"_922ff337","primaryLabel":"af23c791","loadingIcon":"_75edcef6"};
1747
1747
 
1748
- function FieldHint(props) {
1749
- return /*#__PURE__*/React__namespace.createElement(Text, _objectSpread2({
1750
- as: "p",
1751
- tone: "secondary",
1752
- size: "copy"
1753
- }, props));
1754
- }
1748
+ const MAX_LENGTH_THRESHOLD = 10;
1755
1749
 
1756
- function MessageIcon(props) {
1757
- return /*#__PURE__*/React__namespace.createElement("svg", _objectSpread2({
1758
- width: "16",
1759
- height: "16",
1760
- viewBox: "0 0 16 16",
1761
- fill: "none",
1762
- xmlns: "http://www.w3.org/2000/svg"
1763
- }, props), /*#__PURE__*/React__namespace.createElement("path", {
1764
- fillRule: "evenodd",
1765
- clipRule: "evenodd",
1766
- d: "M8 2.5C4.96243 2.5 2.5 4.96243 2.5 8C2.5 11.0376 4.96243 13.5 8 13.5C11.0376 13.5 13.5 11.0376 13.5 8C13.5 4.96243 11.0376 2.5 8 2.5ZM1.5 8C1.5 4.41015 4.41015 1.5 8 1.5C11.5899 1.5 14.5 4.41015 14.5 8C14.5 11.5899 11.5899 14.5 8 14.5C4.41015 14.5 1.5 11.5899 1.5 8ZM8.66667 10.3333C8.66667 10.7015 8.36819 11 8 11C7.63181 11 7.33333 10.7015 7.33333 10.3333C7.33333 9.96514 7.63181 9.66667 8 9.66667C8.36819 9.66667 8.66667 9.96514 8.66667 10.3333ZM8.65766 5.65766C8.65766 5.29445 8.36322 5 8 5C7.99087 5.00008 7.98631 5.00013 7.98175 5.00025C7.97719 5.00038 7.97263 5.00059 7.96352 5.00101C7.60086 5.02116 7.3232 5.33149 7.34335 5.69415L7.50077 8.52774C7.53575 9.15742 8.46425 9.15742 8.49923 8.52774L8.65665 5.69415C8.65707 5.68503 8.65728 5.68047 8.65741 5.67591C8.65754 5.67135 8.65758 5.66679 8.65766 5.65766Z",
1767
- fill: "currentColor"
1768
- }));
1750
+ function fieldToneToTextTone(tone) {
1751
+ return tone === 'error' ? 'danger' : tone === 'success' ? 'positive' : 'secondary';
1769
1752
  }
1770
1753
 
1771
1754
  function FieldMessage({
@@ -1773,55 +1756,117 @@ function FieldMessage({
1773
1756
  children,
1774
1757
  tone
1775
1758
  }) {
1776
- const textTone = tone === 'error' ? 'danger' : tone === 'success' ? 'positive' : 'normal';
1777
1759
  return /*#__PURE__*/React__namespace.createElement(Text, {
1778
1760
  as: "p",
1779
- tone: textTone,
1761
+ tone: fieldToneToTextTone(tone),
1780
1762
  size: "copy",
1781
1763
  id: id
1782
- }, /*#__PURE__*/React__namespace.createElement(Box$1, {
1764
+ }, tone === 'loading' ? /*#__PURE__*/React__namespace.createElement(Box$1, {
1783
1765
  as: "span",
1784
1766
  marginRight: "xsmall",
1785
1767
  display: "inlineFlex",
1786
- className: modules_540a88ff.messageIcon
1787
- }, tone === 'loading' ? /*#__PURE__*/React__namespace.createElement(Spinner, {
1768
+ className: modules_540a88ff.loadingIcon
1769
+ }, /*#__PURE__*/React__namespace.createElement(Spinner, {
1788
1770
  size: 16
1789
- }) : /*#__PURE__*/React__namespace.createElement(MessageIcon, {
1790
- "aria-hidden": true
1791
- })), children);
1771
+ })) : null, children);
1772
+ }
1773
+
1774
+ function FieldCharacterCount({
1775
+ children,
1776
+ tone
1777
+ }) {
1778
+ return /*#__PURE__*/React__namespace.createElement(Text, {
1779
+ tone: fieldToneToTextTone(tone),
1780
+ size: "copy"
1781
+ }, children);
1782
+ }
1783
+
1784
+ function validateInputLength({
1785
+ value,
1786
+ maxLength
1787
+ }) {
1788
+ if (!maxLength) {
1789
+ return {
1790
+ count: null,
1791
+ tone: 'neutral'
1792
+ };
1793
+ }
1794
+
1795
+ const currentLength = String(value || '').length;
1796
+ const isNearMaxLength = maxLength - currentLength <= MAX_LENGTH_THRESHOLD;
1797
+ return {
1798
+ count: currentLength + "/" + maxLength,
1799
+ tone: isNearMaxLength ? 'error' : 'neutral'
1800
+ };
1792
1801
  }
1793
1802
 
1794
1803
  function BaseField({
1795
1804
  variant = 'default',
1796
1805
  label,
1797
- secondaryLabel,
1806
+ value,
1798
1807
  auxiliaryLabel,
1799
- hint,
1800
1808
  message,
1801
1809
  tone = 'neutral',
1802
1810
  className,
1803
1811
  children,
1804
1812
  maxWidth,
1813
+ maxLength,
1805
1814
  hidden,
1806
1815
  'aria-describedby': originalAriaDescribedBy,
1807
1816
  id: originalId
1808
1817
  }) {
1809
1818
  const id = useId(originalId);
1810
- const hintId = useId();
1811
1819
  const messageId = useId();
1812
- const ariaDescribedBy = originalAriaDescribedBy != null ? originalAriaDescribedBy : [message ? messageId : null, hintId].filter(Boolean).join(' ');
1813
- const childrenProps = {
1820
+ const inputLength = validateInputLength({
1821
+ value,
1822
+ maxLength
1823
+ });
1824
+ const [characterCount, setCharacterCount] = React__namespace.useState(inputLength.count);
1825
+ const [characterCountTone, setCharacterCountTone] = React__namespace.useState(inputLength.tone);
1826
+ const ariaDescribedBy = originalAriaDescribedBy != null ? originalAriaDescribedBy : message ? messageId : null;
1827
+
1828
+ const childrenProps = _objectSpread2(_objectSpread2({
1814
1829
  id,
1815
- 'aria-describedby': ariaDescribedBy,
1816
- 'aria-invalid': tone === 'error' ? true : undefined
1817
- };
1830
+ value
1831
+ }, ariaDescribedBy ? {
1832
+ 'aria-describedby': ariaDescribedBy
1833
+ } : {}), {}, {
1834
+ 'aria-invalid': tone === 'error' ? true : undefined,
1835
+
1836
+ onChange(event) {
1837
+ if (!maxLength) {
1838
+ return;
1839
+ }
1840
+
1841
+ const inputLength = validateInputLength({
1842
+ value: event.currentTarget.value,
1843
+ maxLength
1844
+ });
1845
+ setCharacterCount(inputLength.count);
1846
+ setCharacterCountTone(inputLength.tone);
1847
+ }
1848
+
1849
+ });
1850
+
1851
+ React__namespace.useEffect(function updateCharacterCountOnPropChange() {
1852
+ if (!maxLength) {
1853
+ return;
1854
+ }
1855
+
1856
+ const inputLength = validateInputLength({
1857
+ value,
1858
+ maxLength
1859
+ });
1860
+ setCharacterCount(inputLength.count);
1861
+ setCharacterCountTone(inputLength.tone);
1862
+ }, [maxLength, value]);
1818
1863
  return /*#__PURE__*/React__namespace.createElement(Stack, {
1819
- space: "small",
1864
+ space: "xsmall",
1820
1865
  hidden: hidden
1821
1866
  }, /*#__PURE__*/React__namespace.createElement(Box$1, {
1822
1867
  className: [className, modules_540a88ff.container, tone === 'error' ? modules_540a88ff.error : null, variant === 'bordered' ? modules_540a88ff.bordered : null],
1823
1868
  maxWidth: maxWidth
1824
- }, label || secondaryLabel || auxiliaryLabel ? /*#__PURE__*/React__namespace.createElement(Box$1, {
1869
+ }, label || auxiliaryLabel ? /*#__PURE__*/React__namespace.createElement(Box$1, {
1825
1870
  as: "span",
1826
1871
  display: "flex",
1827
1872
  justifyContent: "spaceBetween",
@@ -1832,38 +1877,46 @@ function BaseField({
1832
1877
  htmlFor: id
1833
1878
  }, label ? /*#__PURE__*/React__namespace.createElement("span", {
1834
1879
  className: modules_540a88ff.primaryLabel
1835
- }, label) : null, secondaryLabel ? /*#__PURE__*/React__namespace.createElement("span", {
1836
- className: modules_540a88ff.secondaryLabel
1837
- }, "\u00A0(", secondaryLabel, ")") : null), auxiliaryLabel ? /*#__PURE__*/React__namespace.createElement(Box$1, {
1880
+ }, label) : null), auxiliaryLabel ? /*#__PURE__*/React__namespace.createElement(Box$1, {
1838
1881
  className: modules_540a88ff.auxiliaryLabel,
1839
1882
  paddingLeft: "small"
1840
- }, auxiliaryLabel) : null) : null, children(childrenProps)), message ? /*#__PURE__*/React__namespace.createElement(FieldMessage, {
1883
+ }, auxiliaryLabel) : null) : null, children(childrenProps)), message || characterCount ? /*#__PURE__*/React__namespace.createElement(Columns, {
1884
+ align: "right",
1885
+ space: "small",
1886
+ maxWidth: maxWidth
1887
+ }, message ? /*#__PURE__*/React__namespace.createElement(Column, {
1888
+ width: "auto"
1889
+ }, /*#__PURE__*/React__namespace.createElement(FieldMessage, {
1841
1890
  id: messageId,
1842
1891
  tone: tone
1843
- }, message) : null, hint ? /*#__PURE__*/React__namespace.createElement(FieldHint, {
1844
- id: hintId
1845
- }, hint) : null);
1892
+ }, message)) : null, characterCount ? /*#__PURE__*/React__namespace.createElement(Column, {
1893
+ width: "content"
1894
+ }, /*#__PURE__*/React__namespace.createElement(FieldCharacterCount, {
1895
+ tone: characterCountTone
1896
+ }, characterCount)) : null) : null);
1846
1897
  }
1847
1898
 
1848
- var modules_aaf25250 = {"inputWrapper":"dea25485","bordered":"_80b6b376","error":"_1a32867a","slot":"dbbd207e"};
1899
+ var modules_aaf25250 = {"inputWrapper":"f2de4e8d","readOnly":"ee26e40c","bordered":"_3afb1a56","error":"f3ff9f57","slot":"_3eb7b0ef"};
1849
1900
 
1850
- const _excluded$d = ["variant", "id", "label", "secondaryLabel", "auxiliaryLabel", "hint", "message", "tone", "type", "maxWidth", "hidden", "aria-describedby", "startSlot", "endSlot"];
1901
+ const _excluded$d = ["variant", "id", "label", "value", "auxiliaryLabel", "message", "tone", "type", "maxWidth", "maxLength", "hidden", "aria-describedby", "startSlot", "endSlot", "onChange"],
1902
+ _excluded2$4 = ["onChange"];
1851
1903
  const TextField = /*#__PURE__*/React__namespace.forwardRef(function TextField(_ref, ref) {
1852
1904
  let {
1853
1905
  variant = 'default',
1854
1906
  id,
1855
1907
  label,
1856
- secondaryLabel,
1908
+ value,
1857
1909
  auxiliaryLabel,
1858
- hint,
1859
1910
  message,
1860
1911
  tone,
1861
1912
  type = 'text',
1862
1913
  maxWidth,
1914
+ maxLength,
1863
1915
  hidden,
1864
1916
  'aria-describedby': ariaDescribedBy,
1865
1917
  startSlot,
1866
- endSlot
1918
+ endSlot,
1919
+ onChange: originalOnChange
1867
1920
  } = _ref,
1868
1921
  props = _objectWithoutProperties(_ref, _excluded$d);
1869
1922
 
@@ -1881,39 +1934,52 @@ const TextField = /*#__PURE__*/React__namespace.forwardRef(function TextField(_r
1881
1934
  variant: variant,
1882
1935
  id: id,
1883
1936
  label: label,
1884
- secondaryLabel: secondaryLabel,
1937
+ value: value,
1885
1938
  auxiliaryLabel: auxiliaryLabel,
1886
- hint: hint,
1887
1939
  message: message,
1888
1940
  tone: tone,
1889
1941
  maxWidth: maxWidth,
1942
+ maxLength: maxLength,
1890
1943
  hidden: hidden,
1891
1944
  "aria-describedby": ariaDescribedBy
1892
- }, extraProps => /*#__PURE__*/React__namespace.createElement(Box$1, {
1893
- display: "flex",
1894
- alignItems: "center",
1895
- className: [modules_aaf25250.inputWrapper, tone === 'error' ? modules_aaf25250.error : null, variant === 'bordered' ? modules_aaf25250.bordered : null],
1896
- onClick: handleClick
1897
- }, startSlot ? /*#__PURE__*/React__namespace.createElement(Box$1, {
1898
- className: modules_aaf25250.slot,
1899
- display: "flex",
1900
- marginRight: variant === 'bordered' ? 'xsmall' : '-xsmall',
1901
- marginLeft: variant === 'bordered' ? '-xsmall' : 'xsmall'
1902
- }, startSlot) : null, /*#__PURE__*/React__namespace.createElement("input", _objectSpread2(_objectSpread2(_objectSpread2({}, props), extraProps), {}, {
1903
- type: type,
1904
- ref: combinedRef
1905
- })), endSlot ? /*#__PURE__*/React__namespace.createElement(Box$1, {
1906
- className: modules_aaf25250.slot,
1907
- display: "flex",
1908
- marginRight: variant === 'bordered' ? '-xsmall' : 'xsmall',
1909
- marginLeft: variant === 'bordered' ? 'xsmall' : '-xsmall'
1910
- }, endSlot) : null));
1945
+ }, _ref2 => {
1946
+ let {
1947
+ onChange
1948
+ } = _ref2,
1949
+ extraProps = _objectWithoutProperties(_ref2, _excluded2$4);
1950
+
1951
+ return /*#__PURE__*/React__namespace.createElement(Box$1, {
1952
+ display: "flex",
1953
+ alignItems: "center",
1954
+ className: [modules_aaf25250.inputWrapper, tone === 'error' ? modules_aaf25250.error : null, variant === 'bordered' ? modules_aaf25250.bordered : null, props.readOnly ? modules_aaf25250.readOnly : null],
1955
+ onClick: handleClick
1956
+ }, startSlot ? /*#__PURE__*/React__namespace.createElement(Box$1, {
1957
+ className: modules_aaf25250.slot,
1958
+ display: "flex",
1959
+ marginRight: variant === 'bordered' ? 'xsmall' : '-xsmall',
1960
+ marginLeft: variant === 'bordered' ? '-xsmall' : 'xsmall'
1961
+ }, startSlot) : null, /*#__PURE__*/React__namespace.createElement("input", _objectSpread2(_objectSpread2(_objectSpread2({}, props), extraProps), {}, {
1962
+ type: type,
1963
+ ref: combinedRef,
1964
+ maxLength: maxLength,
1965
+ onChange: event => {
1966
+ originalOnChange == null ? void 0 : originalOnChange(event);
1967
+ onChange == null ? void 0 : onChange(event);
1968
+ }
1969
+ })), endSlot ? /*#__PURE__*/React__namespace.createElement(Box$1, {
1970
+ className: modules_aaf25250.slot,
1971
+ display: "flex",
1972
+ marginRight: variant === 'bordered' ? '-xsmall' : 'xsmall',
1973
+ marginLeft: variant === 'bordered' ? 'xsmall' : '-xsmall'
1974
+ }, endSlot) : null);
1975
+ });
1911
1976
  });
1912
1977
 
1913
- const _excluded$c = ["togglePasswordLabel"];
1978
+ const _excluded$c = ["togglePasswordLabel", "endSlot"];
1914
1979
  const PasswordField = /*#__PURE__*/React__namespace.forwardRef(function PasswordField(_ref, ref) {
1915
1980
  let {
1916
- togglePasswordLabel = 'Toggle password visibility'
1981
+ togglePasswordLabel = 'Toggle password visibility',
1982
+ endSlot
1917
1983
  } = _ref,
1918
1984
  props = _objectWithoutProperties(_ref, _excluded$c);
1919
1985
 
@@ -1923,34 +1989,34 @@ const PasswordField = /*#__PURE__*/React__namespace.forwardRef(function Password
1923
1989
  ref: ref,
1924
1990
  // @ts-expect-error TextField does not support type="password", so we override the type check here
1925
1991
  type: isPasswordVisible ? 'text' : 'password',
1926
- endSlot: /*#__PURE__*/React__namespace.createElement(IconButton, {
1992
+ endSlot: /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, endSlot, /*#__PURE__*/React__namespace.createElement(IconButton, {
1927
1993
  variant: "quaternary",
1928
1994
  icon: /*#__PURE__*/React__namespace.createElement(Icon, {
1929
1995
  "aria-hidden": true
1930
1996
  }),
1931
1997
  "aria-label": togglePasswordLabel,
1932
1998
  onClick: () => setPasswordVisible(v => !v)
1933
- })
1999
+ }))
1934
2000
  }));
1935
2001
  });
1936
2002
 
1937
2003
  var modules_1fa9b208 = {"selectWrapper":"b930bb07","bordered":"e1f620b6","error":"_7e87474e"};
1938
2004
 
1939
- const _excluded$b = ["variant", "id", "label", "secondaryLabel", "auxiliaryLabel", "hint", "message", "tone", "maxWidth", "children", "hidden", "aria-describedby"];
2005
+ const _excluded$b = ["variant", "id", "label", "value", "auxiliaryLabel", "message", "tone", "maxWidth", "children", "hidden", "aria-describedby", "onChange"];
1940
2006
  const SelectField = /*#__PURE__*/React__namespace.forwardRef(function SelectField(_ref, ref) {
1941
2007
  let {
1942
2008
  variant = 'default',
1943
2009
  id,
1944
2010
  label,
1945
- secondaryLabel,
2011
+ value,
1946
2012
  auxiliaryLabel,
1947
- hint,
1948
2013
  message,
1949
2014
  tone,
1950
2015
  maxWidth,
1951
2016
  children,
1952
2017
  hidden,
1953
- 'aria-describedby': ariaDescribedBy
2018
+ 'aria-describedby': ariaDescribedBy,
2019
+ onChange: originalOnChange
1954
2020
  } = _ref,
1955
2021
  props = _objectWithoutProperties(_ref, _excluded$b);
1956
2022
 
@@ -1958,9 +2024,8 @@ const SelectField = /*#__PURE__*/React__namespace.forwardRef(function SelectFiel
1958
2024
  variant: variant,
1959
2025
  id: id,
1960
2026
  label: label,
1961
- secondaryLabel: secondaryLabel,
2027
+ value: value,
1962
2028
  auxiliaryLabel: auxiliaryLabel,
1963
- hint: hint,
1964
2029
  message: message,
1965
2030
  tone: tone,
1966
2031
  maxWidth: maxWidth,
@@ -1970,7 +2035,10 @@ const SelectField = /*#__PURE__*/React__namespace.forwardRef(function SelectFiel
1970
2035
  "data-testid": "select-wrapper",
1971
2036
  className: [modules_1fa9b208.selectWrapper, tone === 'error' ? modules_1fa9b208.error : null, variant === 'bordered' ? modules_1fa9b208.bordered : null]
1972
2037
  }, /*#__PURE__*/React__namespace.createElement("select", _objectSpread2(_objectSpread2(_objectSpread2({}, props), extraProps), {}, {
1973
- ref: ref
2038
+ ref: ref,
2039
+ onChange: event => {
2040
+ originalOnChange == null ? void 0 : originalOnChange(event);
2041
+ }
1974
2042
  }), children), /*#__PURE__*/React__namespace.createElement(SelectChevron, {
1975
2043
  "aria-hidden": true
1976
2044
  })));
@@ -1990,13 +2058,14 @@ function SelectChevron(props) {
1990
2058
 
1991
2059
  var modules_8e05f7c9 = {"container":"bae487be","disabled":"_408d32a0","checked":"_99b0ead7","toggle":"_5af09fb5","label":"a66e1846","handle":"_0dcf70ec","keyFocused":"_1f5e7fd4"};
1992
2060
 
1993
- const _excluded$a = ["label", "hint", "disabled", "hidden", "defaultChecked", "id", "aria-describedby", "aria-label", "aria-labelledby", "onChange"];
2061
+ const _excluded$a = ["label", "message", "tone", "disabled", "hidden", "defaultChecked", "id", "aria-describedby", "aria-label", "aria-labelledby", "onChange"];
1994
2062
  const SwitchField = /*#__PURE__*/React__namespace.forwardRef(function SwitchField(_ref, ref) {
1995
2063
  var _ref2, _props$checked, _props$checked2;
1996
2064
 
1997
2065
  let {
1998
2066
  label,
1999
- hint,
2067
+ message,
2068
+ tone = 'neutral',
2000
2069
  disabled = false,
2001
2070
  hidden,
2002
2071
  defaultChecked,
@@ -2009,8 +2078,8 @@ const SwitchField = /*#__PURE__*/React__namespace.forwardRef(function SwitchFiel
2009
2078
  props = _objectWithoutProperties(_ref, _excluded$a);
2010
2079
 
2011
2080
  const id = useId(originalId);
2012
- const hintId = useId();
2013
- const ariaDescribedBy = originalAriaDescribedBy != null ? originalAriaDescribedBy : hint ? hintId : undefined;
2081
+ const messageId = useId();
2082
+ const ariaDescribedBy = originalAriaDescribedBy != null ? originalAriaDescribedBy : message ? messageId : undefined;
2014
2083
  const ariaLabel = originalAriaLabel != null ? originalAriaLabel : undefined;
2015
2084
  const ariaLabelledBy = originalAriaLabelledby != null ? originalAriaLabelledby : undefined;
2016
2085
  const [keyFocused, setKeyFocused] = React__namespace.useState(false);
@@ -2059,35 +2128,40 @@ const SwitchField = /*#__PURE__*/React__namespace.forwardRef(function SwitchFiel
2059
2128
  className: modules_8e05f7c9.handle
2060
2129
  })), /*#__PURE__*/React__namespace.createElement(Text, {
2061
2130
  exceptionallySetClassName: modules_8e05f7c9.label
2062
- }, label)), hint ? /*#__PURE__*/React__namespace.createElement(FieldHint, {
2063
- id: hintId
2064
- }, hint) : null);
2131
+ }, label)), message ? /*#__PURE__*/React__namespace.createElement(FieldMessage, {
2132
+ id: messageId,
2133
+ tone: tone
2134
+ }, message) : null);
2065
2135
  });
2066
2136
 
2067
- var modules_2728c236 = {"textAreaContainer":"_55ccf266","innerContainer":"_89bb7098","bordered":"_02a47358","error":"_704ff540","autoExpand":"_145ca8f0"};
2137
+ var modules_2728c236 = {"textAreaContainer":"a95cb864","innerContainer":"ab9873f7","bordered":"de380efd","error":"_29a9d12f","disableResize":"_44f7147e"};
2068
2138
 
2069
- const _excluded$9 = ["variant", "id", "label", "secondaryLabel", "auxiliaryLabel", "hint", "message", "tone", "maxWidth", "hidden", "aria-describedby", "rows", "autoExpand"];
2139
+ const _excluded$9 = ["variant", "id", "label", "value", "auxiliaryLabel", "message", "tone", "maxWidth", "maxLength", "hidden", "aria-describedby", "rows", "autoExpand", "disableResize", "onChange"],
2140
+ _excluded2$3 = ["onChange"];
2070
2141
  const TextArea = /*#__PURE__*/React__namespace.forwardRef(function TextArea(_ref, ref) {
2071
2142
  let {
2072
2143
  variant = 'default',
2073
2144
  id,
2074
2145
  label,
2075
- secondaryLabel,
2146
+ value,
2076
2147
  auxiliaryLabel,
2077
- hint,
2078
2148
  message,
2079
2149
  tone,
2080
2150
  maxWidth,
2151
+ maxLength,
2081
2152
  hidden,
2082
2153
  'aria-describedby': ariaDescribedBy,
2083
2154
  rows,
2084
- autoExpand = false
2155
+ autoExpand = false,
2156
+ disableResize = false,
2157
+ onChange: originalOnChange
2085
2158
  } = _ref,
2086
2159
  props = _objectWithoutProperties(_ref, _excluded$9);
2087
2160
 
2088
2161
  const containerRef = React__namespace.useRef(null);
2089
2162
  const internalRef = React__namespace.useRef(null);
2090
2163
  const combinedRef = useCallbackRef.useMergeRefs([ref, internalRef]);
2164
+ const textAreaClassName = classNames__default["default"]([autoExpand ? modules_2728c236.disableResize : null, disableResize ? modules_2728c236.disableResize : null]);
2091
2165
  React__namespace.useEffect(function setupAutoExpand() {
2092
2166
  const containerElement = containerRef.current;
2093
2167
 
@@ -2116,25 +2190,37 @@ const TextArea = /*#__PURE__*/React__namespace.forwardRef(function TextArea(_ref
2116
2190
  variant: variant,
2117
2191
  id: id,
2118
2192
  label: label,
2119
- secondaryLabel: secondaryLabel,
2193
+ value: value,
2120
2194
  auxiliaryLabel: auxiliaryLabel,
2121
- hint: hint,
2122
2195
  message: message,
2123
2196
  tone: tone,
2124
2197
  hidden: hidden,
2125
2198
  "aria-describedby": ariaDescribedBy,
2126
2199
  className: [modules_2728c236.textAreaContainer, tone === 'error' ? modules_2728c236.error : null, variant === 'bordered' ? modules_2728c236.bordered : null],
2127
- maxWidth: maxWidth
2128
- }, extraProps => /*#__PURE__*/React__namespace.createElement(Box$1, {
2129
- width: "full",
2130
- display: "flex",
2131
- className: modules_2728c236.innerContainer,
2132
- ref: containerRef
2133
- }, /*#__PURE__*/React__namespace.createElement("textarea", _objectSpread2(_objectSpread2(_objectSpread2({}, props), extraProps), {}, {
2134
- ref: combinedRef,
2135
- rows: rows,
2136
- className: autoExpand ? modules_2728c236.autoExpand : undefined
2137
- }))));
2200
+ maxWidth: maxWidth,
2201
+ maxLength: maxLength
2202
+ }, _ref2 => {
2203
+ let {
2204
+ onChange
2205
+ } = _ref2,
2206
+ extraProps = _objectWithoutProperties(_ref2, _excluded2$3);
2207
+
2208
+ return /*#__PURE__*/React__namespace.createElement(Box$1, {
2209
+ width: "full",
2210
+ display: "flex",
2211
+ className: modules_2728c236.innerContainer,
2212
+ ref: containerRef
2213
+ }, /*#__PURE__*/React__namespace.createElement("textarea", _objectSpread2(_objectSpread2(_objectSpread2({}, props), extraProps), {}, {
2214
+ ref: combinedRef,
2215
+ rows: rows,
2216
+ className: textAreaClassName,
2217
+ maxLength: maxLength,
2218
+ onChange: event => {
2219
+ originalOnChange == null ? void 0 : originalOnChange(event);
2220
+ onChange == null ? void 0 : onChange(event);
2221
+ }
2222
+ })));
2223
+ });
2138
2224
  });
2139
2225
 
2140
2226
  function getInitials(name) {
@@ -2427,7 +2513,7 @@ function ModalHeader(_ref2) {
2427
2513
  * Renders the body of a modal.
2428
2514
  *
2429
2515
  * Convenient to use alongside ModalHeader and/or ModalFooter as needed. It ensures, among other
2430
- * things, that the contet of the modal body expands or contracts depending on the modal height
2516
+ * things, that the content of the modal body expands or contracts depending on the modal height
2431
2517
  * setting or the size of the content. The body content also automatically scrolls when it's too
2432
2518
  * large to fit the available space.
2433
2519
  *
@@ -2436,7 +2522,7 @@ function ModalHeader(_ref2) {
2436
2522
  * @see ModalFooter
2437
2523
  */
2438
2524
 
2439
- function ModalBody(_ref3) {
2525
+ const ModalBody = /*#__PURE__*/React.forwardRef(function ModalBody(_ref3, ref) {
2440
2526
  let {
2441
2527
  exceptionallySetClassName,
2442
2528
  children
@@ -2447,6 +2533,7 @@ function ModalBody(_ref3) {
2447
2533
  height
2448
2534
  } = React__namespace.useContext(ModalContext);
2449
2535
  return /*#__PURE__*/React__namespace.createElement(Box$1, _objectSpread2(_objectSpread2({}, props), {}, {
2536
+ ref: ref,
2450
2537
  className: exceptionallySetClassName,
2451
2538
  flexGrow: height === 'expand' ? 1 : 0,
2452
2539
  height: height === 'expand' ? 'full' : undefined,
@@ -2455,7 +2542,7 @@ function ModalBody(_ref3) {
2455
2542
  padding: "large",
2456
2543
  paddingBottom: "xxlarge"
2457
2544
  }, children));
2458
- }
2545
+ });
2459
2546
  /**
2460
2547
  * Renders a standard modal footer area.
2461
2548
  *