@doist/reactist 25.2.0 → 26.1.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 (67) hide show
  1. package/dist/reactist.cjs.development.js +225 -121
  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/alert/alert.js +6 -3
  6. package/es/alert/alert.js.map +1 -1
  7. package/es/alert/alert.module.css.js +1 -1
  8. package/es/base-field/base-field.js +98 -46
  9. package/es/base-field/base-field.js.map +1 -1
  10. package/es/base-field/base-field.module.css.js +1 -1
  11. package/es/menu/menu.js +17 -4
  12. package/es/menu/menu.js.map +1 -1
  13. package/es/password-field/password-field.js +5 -4
  14. package/es/password-field/password-field.js.map +1 -1
  15. package/es/select-field/select-field.js +9 -7
  16. package/es/select-field/select-field.js.map +1 -1
  17. package/es/switch-field/switch-field.js +10 -8
  18. package/es/switch-field/switch-field.js.map +1 -1
  19. package/es/text-area/text-area.js +34 -17
  20. package/es/text-area/text-area.js.map +1 -1
  21. package/es/text-area/text-area.module.css.js +1 -1
  22. package/es/text-field/text-field.js +39 -25
  23. package/es/text-field/text-field.js.map +1 -1
  24. package/es/text-field/text-field.module.css.js +1 -1
  25. package/es/tooltip/tooltip.js +4 -2
  26. package/es/tooltip/tooltip.js.map +1 -1
  27. package/lib/alert/alert.js +1 -1
  28. package/lib/alert/alert.js.map +1 -1
  29. package/lib/alert/alert.module.css.js +1 -1
  30. package/lib/base-field/base-field.d.ts +17 -34
  31. package/lib/base-field/base-field.js +1 -1
  32. package/lib/base-field/base-field.js.map +1 -1
  33. package/lib/base-field/base-field.module.css.js +1 -1
  34. package/lib/menu/menu.js +1 -1
  35. package/lib/menu/menu.js.map +1 -1
  36. package/lib/password-field/password-field.d.ts +1 -0
  37. package/lib/password-field/password-field.js +1 -1
  38. package/lib/password-field/password-field.js.map +1 -1
  39. package/lib/select-field/select-field.js +1 -1
  40. package/lib/select-field/select-field.js.map +1 -1
  41. package/lib/switch-field/switch-field.d.ts +1 -1
  42. package/lib/switch-field/switch-field.js +1 -1
  43. package/lib/switch-field/switch-field.js.map +1 -1
  44. package/lib/text-area/text-area.d.ts +9 -1
  45. package/lib/text-area/text-area.js +1 -1
  46. package/lib/text-area/text-area.js.map +1 -1
  47. package/lib/text-area/text-area.module.css.js +1 -1
  48. package/lib/text-field/text-field.js +1 -1
  49. package/lib/text-field/text-field.js.map +1 -1
  50. package/lib/text-field/text-field.module.css.js +1 -1
  51. package/lib/tooltip/tooltip.d.ts +11 -1
  52. package/lib/tooltip/tooltip.js +1 -1
  53. package/lib/tooltip/tooltip.js.map +1 -1
  54. package/package.json +1 -1
  55. package/styles/alert.css +1 -1
  56. package/styles/alert.module.css.css +1 -1
  57. package/styles/base-field.css +3 -2
  58. package/styles/base-field.module.css.css +1 -1
  59. package/styles/index.css +1 -2
  60. package/styles/password-field.css +3 -2
  61. package/styles/reactist.css +5 -5
  62. package/styles/select-field.css +2 -1
  63. package/styles/switch-field.css +2 -1
  64. package/styles/text-area.css +3 -2
  65. package/styles/text-area.module.css.css +1 -1
  66. package/styles/text-field.css +3 -2
  67. package/styles/text-field.module.css.css +1 -1
@@ -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)],
@@ -581,12 +581,14 @@ function Tooltip({
581
581
  position = 'top',
582
582
  gapSize = 3,
583
583
  withArrow = false,
584
+ showTimeout = 500,
585
+ hideTimeout = 100,
584
586
  exceptionallySetClassName
585
587
  }) {
586
588
  const tooltip = react.useTooltipStore({
587
589
  placement: position,
588
- showTimeout: 500,
589
- hideTimeout: 100
590
+ showTimeout,
591
+ hideTimeout
590
592
  });
591
593
  const isOpen = tooltip.useState('open');
592
594
  const child = React__namespace.Children.only(children);
@@ -623,7 +625,7 @@ function Tooltip({
623
625
  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
626
 
625
627
  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"];
628
+ _excluded2$5 = ["variant", "tone", "size", "shape", "type", "disabled", "loading", "tooltip", "render", "onClick", "exceptionallySetClassName", "children", "icon"];
627
629
 
628
630
  function preventDefault(event) {
629
631
  event.preventDefault();
@@ -706,7 +708,7 @@ const IconButton = /*#__PURE__*/React__namespace.forwardRef(function IconButton(
706
708
  children,
707
709
  icon
708
710
  } = _ref2,
709
- props = _objectWithoutProperties(_ref2, _excluded2$3);
711
+ props = _objectWithoutProperties(_ref2, _excluded2$5);
710
712
 
711
713
  const isDisabled = loading || disabled;
712
714
  const buttonElement = /*#__PURE__*/React__namespace.createElement(react.Role.button, _objectSpread2(_objectSpread2({}, props), {}, {
@@ -808,7 +810,7 @@ function CloseIcon(props) {
808
810
  }));
809
811
  }
810
812
 
811
- var modules_6205a58e = {"container":"_51a84fb3","tone-info":"_5649104a","icon":"_79fa06e2","tone-positive":"c67632e4","tone-caution":"_654ff216","tone-critical":"b1ee4ff1"};
813
+ var modules_6205a58e = {"container":"d6be7fe9","content":"ad8ace2f","icon":"ab71a9dc","tone-info":"_043941a6","tone-positive":"f34b89d4","tone-caution":"a069ea07","tone-critical":"e505aabb"};
812
814
 
813
815
  function Alert({
814
816
  id,
@@ -833,10 +835,13 @@ function Alert({
833
835
  className: modules_6205a58e.icon
834
836
  })), /*#__PURE__*/React__namespace.createElement(Column, null, /*#__PURE__*/React__namespace.createElement(Box$1, {
835
837
  paddingY: "xsmall",
836
- paddingRight: onClose != null && closeLabel != null ? undefined : 'small'
838
+ paddingRight: onClose != null && closeLabel != null ? undefined : 'small',
839
+ display: "flex",
840
+ alignItems: "center",
841
+ className: modules_6205a58e.content
837
842
  }, children)), onClose != null && closeLabel != null ? /*#__PURE__*/React__namespace.createElement(Column, {
838
843
  width: "content"
839
- }, /*#__PURE__*/React__namespace.createElement(Button$1, {
844
+ }, /*#__PURE__*/React__namespace.createElement(IconButton, {
840
845
  variant: "quaternary",
841
846
  size: "small",
842
847
  onClick: onClose,
@@ -1743,29 +1748,12 @@ function PasswordHiddenIcon(props) {
1743
1748
  })));
1744
1749
  }
1745
1750
 
1746
- var modules_540a88ff = {"container":"_7acdc928","auxiliaryLabel":"_815bad88","bordered":"e35886fe","error":"_6c7b5dc8","primaryLabel":"ec74af87","secondaryLabel":"_6db0ec44","messageIcon":"_05c35af8"};
1751
+ var modules_540a88ff = {"container":"d5ff04da","auxiliaryLabel":"_8d2b52f1","bordered":"_49c37b27","error":"_922ff337","primaryLabel":"af23c791","loadingIcon":"_75edcef6"};
1747
1752
 
1748
- function FieldHint(props) {
1749
- return /*#__PURE__*/React__namespace.createElement(Text, _objectSpread2({
1750
- as: "p",
1751
- tone: "secondary",
1752
- size: "copy"
1753
- }, props));
1754
- }
1753
+ const MAX_LENGTH_THRESHOLD = 10;
1755
1754
 
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
- }));
1755
+ function fieldToneToTextTone(tone) {
1756
+ return tone === 'error' ? 'danger' : tone === 'success' ? 'positive' : 'secondary';
1769
1757
  }
1770
1758
 
1771
1759
  function FieldMessage({
@@ -1773,55 +1761,117 @@ function FieldMessage({
1773
1761
  children,
1774
1762
  tone
1775
1763
  }) {
1776
- const textTone = tone === 'error' ? 'danger' : tone === 'success' ? 'positive' : 'normal';
1777
1764
  return /*#__PURE__*/React__namespace.createElement(Text, {
1778
1765
  as: "p",
1779
- tone: textTone,
1766
+ tone: fieldToneToTextTone(tone),
1780
1767
  size: "copy",
1781
1768
  id: id
1782
- }, /*#__PURE__*/React__namespace.createElement(Box$1, {
1769
+ }, tone === 'loading' ? /*#__PURE__*/React__namespace.createElement(Box$1, {
1783
1770
  as: "span",
1784
1771
  marginRight: "xsmall",
1785
1772
  display: "inlineFlex",
1786
- className: modules_540a88ff.messageIcon
1787
- }, tone === 'loading' ? /*#__PURE__*/React__namespace.createElement(Spinner, {
1773
+ className: modules_540a88ff.loadingIcon
1774
+ }, /*#__PURE__*/React__namespace.createElement(Spinner, {
1788
1775
  size: 16
1789
- }) : /*#__PURE__*/React__namespace.createElement(MessageIcon, {
1790
- "aria-hidden": true
1791
- })), children);
1776
+ })) : null, children);
1777
+ }
1778
+
1779
+ function FieldCharacterCount({
1780
+ children,
1781
+ tone
1782
+ }) {
1783
+ return /*#__PURE__*/React__namespace.createElement(Text, {
1784
+ tone: fieldToneToTextTone(tone),
1785
+ size: "copy"
1786
+ }, children);
1787
+ }
1788
+
1789
+ function validateInputLength({
1790
+ value,
1791
+ maxLength
1792
+ }) {
1793
+ if (!maxLength) {
1794
+ return {
1795
+ count: null,
1796
+ tone: 'neutral'
1797
+ };
1798
+ }
1799
+
1800
+ const currentLength = String(value || '').length;
1801
+ const isNearMaxLength = maxLength - currentLength <= MAX_LENGTH_THRESHOLD;
1802
+ return {
1803
+ count: currentLength + "/" + maxLength,
1804
+ tone: isNearMaxLength ? 'error' : 'neutral'
1805
+ };
1792
1806
  }
1793
1807
 
1794
1808
  function BaseField({
1795
1809
  variant = 'default',
1796
1810
  label,
1797
- secondaryLabel,
1811
+ value,
1798
1812
  auxiliaryLabel,
1799
- hint,
1800
1813
  message,
1801
1814
  tone = 'neutral',
1802
1815
  className,
1803
1816
  children,
1804
1817
  maxWidth,
1818
+ maxLength,
1805
1819
  hidden,
1806
1820
  'aria-describedby': originalAriaDescribedBy,
1807
1821
  id: originalId
1808
1822
  }) {
1809
1823
  const id = useId(originalId);
1810
- const hintId = useId();
1811
1824
  const messageId = useId();
1812
- const ariaDescribedBy = originalAriaDescribedBy != null ? originalAriaDescribedBy : [message ? messageId : null, hintId].filter(Boolean).join(' ');
1813
- const childrenProps = {
1825
+ const inputLength = validateInputLength({
1826
+ value,
1827
+ maxLength
1828
+ });
1829
+ const [characterCount, setCharacterCount] = React__namespace.useState(inputLength.count);
1830
+ const [characterCountTone, setCharacterCountTone] = React__namespace.useState(inputLength.tone);
1831
+ const ariaDescribedBy = originalAriaDescribedBy != null ? originalAriaDescribedBy : message ? messageId : null;
1832
+
1833
+ const childrenProps = _objectSpread2(_objectSpread2({
1814
1834
  id,
1815
- 'aria-describedby': ariaDescribedBy,
1816
- 'aria-invalid': tone === 'error' ? true : undefined
1817
- };
1835
+ value
1836
+ }, ariaDescribedBy ? {
1837
+ 'aria-describedby': ariaDescribedBy
1838
+ } : {}), {}, {
1839
+ 'aria-invalid': tone === 'error' ? true : undefined,
1840
+
1841
+ onChange(event) {
1842
+ if (!maxLength) {
1843
+ return;
1844
+ }
1845
+
1846
+ const inputLength = validateInputLength({
1847
+ value: event.currentTarget.value,
1848
+ maxLength
1849
+ });
1850
+ setCharacterCount(inputLength.count);
1851
+ setCharacterCountTone(inputLength.tone);
1852
+ }
1853
+
1854
+ });
1855
+
1856
+ React__namespace.useEffect(function updateCharacterCountOnPropChange() {
1857
+ if (!maxLength) {
1858
+ return;
1859
+ }
1860
+
1861
+ const inputLength = validateInputLength({
1862
+ value,
1863
+ maxLength
1864
+ });
1865
+ setCharacterCount(inputLength.count);
1866
+ setCharacterCountTone(inputLength.tone);
1867
+ }, [maxLength, value]);
1818
1868
  return /*#__PURE__*/React__namespace.createElement(Stack, {
1819
- space: "small",
1869
+ space: "xsmall",
1820
1870
  hidden: hidden
1821
1871
  }, /*#__PURE__*/React__namespace.createElement(Box$1, {
1822
1872
  className: [className, modules_540a88ff.container, tone === 'error' ? modules_540a88ff.error : null, variant === 'bordered' ? modules_540a88ff.bordered : null],
1823
1873
  maxWidth: maxWidth
1824
- }, label || secondaryLabel || auxiliaryLabel ? /*#__PURE__*/React__namespace.createElement(Box$1, {
1874
+ }, label || auxiliaryLabel ? /*#__PURE__*/React__namespace.createElement(Box$1, {
1825
1875
  as: "span",
1826
1876
  display: "flex",
1827
1877
  justifyContent: "spaceBetween",
@@ -1832,38 +1882,46 @@ function BaseField({
1832
1882
  htmlFor: id
1833
1883
  }, label ? /*#__PURE__*/React__namespace.createElement("span", {
1834
1884
  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, {
1885
+ }, label) : null), auxiliaryLabel ? /*#__PURE__*/React__namespace.createElement(Box$1, {
1838
1886
  className: modules_540a88ff.auxiliaryLabel,
1839
1887
  paddingLeft: "small"
1840
- }, auxiliaryLabel) : null) : null, children(childrenProps)), message ? /*#__PURE__*/React__namespace.createElement(FieldMessage, {
1888
+ }, auxiliaryLabel) : null) : null, children(childrenProps)), message || characterCount ? /*#__PURE__*/React__namespace.createElement(Columns, {
1889
+ align: "right",
1890
+ space: "small",
1891
+ maxWidth: maxWidth
1892
+ }, message ? /*#__PURE__*/React__namespace.createElement(Column, {
1893
+ width: "auto"
1894
+ }, /*#__PURE__*/React__namespace.createElement(FieldMessage, {
1841
1895
  id: messageId,
1842
1896
  tone: tone
1843
- }, message) : null, hint ? /*#__PURE__*/React__namespace.createElement(FieldHint, {
1844
- id: hintId
1845
- }, hint) : null);
1897
+ }, message)) : null, characterCount ? /*#__PURE__*/React__namespace.createElement(Column, {
1898
+ width: "content"
1899
+ }, /*#__PURE__*/React__namespace.createElement(FieldCharacterCount, {
1900
+ tone: characterCountTone
1901
+ }, characterCount)) : null) : null);
1846
1902
  }
1847
1903
 
1848
- var modules_aaf25250 = {"inputWrapper":"dea25485","bordered":"_80b6b376","error":"_1a32867a","slot":"dbbd207e"};
1904
+ var modules_aaf25250 = {"inputWrapper":"f2de4e8d","readOnly":"ee26e40c","bordered":"_3afb1a56","error":"f3ff9f57","slot":"_3eb7b0ef"};
1849
1905
 
1850
- const _excluded$d = ["variant", "id", "label", "secondaryLabel", "auxiliaryLabel", "hint", "message", "tone", "type", "maxWidth", "hidden", "aria-describedby", "startSlot", "endSlot"];
1906
+ const _excluded$d = ["variant", "id", "label", "value", "auxiliaryLabel", "message", "tone", "type", "maxWidth", "maxLength", "hidden", "aria-describedby", "startSlot", "endSlot", "onChange"],
1907
+ _excluded2$4 = ["onChange"];
1851
1908
  const TextField = /*#__PURE__*/React__namespace.forwardRef(function TextField(_ref, ref) {
1852
1909
  let {
1853
1910
  variant = 'default',
1854
1911
  id,
1855
1912
  label,
1856
- secondaryLabel,
1913
+ value,
1857
1914
  auxiliaryLabel,
1858
- hint,
1859
1915
  message,
1860
1916
  tone,
1861
1917
  type = 'text',
1862
1918
  maxWidth,
1919
+ maxLength,
1863
1920
  hidden,
1864
1921
  'aria-describedby': ariaDescribedBy,
1865
1922
  startSlot,
1866
- endSlot
1923
+ endSlot,
1924
+ onChange: originalOnChange
1867
1925
  } = _ref,
1868
1926
  props = _objectWithoutProperties(_ref, _excluded$d);
1869
1927
 
@@ -1881,39 +1939,52 @@ const TextField = /*#__PURE__*/React__namespace.forwardRef(function TextField(_r
1881
1939
  variant: variant,
1882
1940
  id: id,
1883
1941
  label: label,
1884
- secondaryLabel: secondaryLabel,
1942
+ value: value,
1885
1943
  auxiliaryLabel: auxiliaryLabel,
1886
- hint: hint,
1887
1944
  message: message,
1888
1945
  tone: tone,
1889
1946
  maxWidth: maxWidth,
1947
+ maxLength: maxLength,
1890
1948
  hidden: hidden,
1891
1949
  "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));
1950
+ }, _ref2 => {
1951
+ let {
1952
+ onChange
1953
+ } = _ref2,
1954
+ extraProps = _objectWithoutProperties(_ref2, _excluded2$4);
1955
+
1956
+ return /*#__PURE__*/React__namespace.createElement(Box$1, {
1957
+ display: "flex",
1958
+ alignItems: "center",
1959
+ className: [modules_aaf25250.inputWrapper, tone === 'error' ? modules_aaf25250.error : null, variant === 'bordered' ? modules_aaf25250.bordered : null, props.readOnly ? modules_aaf25250.readOnly : null],
1960
+ onClick: handleClick
1961
+ }, startSlot ? /*#__PURE__*/React__namespace.createElement(Box$1, {
1962
+ className: modules_aaf25250.slot,
1963
+ display: "flex",
1964
+ marginRight: variant === 'bordered' ? 'xsmall' : '-xsmall',
1965
+ marginLeft: variant === 'bordered' ? '-xsmall' : 'xsmall'
1966
+ }, startSlot) : null, /*#__PURE__*/React__namespace.createElement("input", _objectSpread2(_objectSpread2(_objectSpread2({}, props), extraProps), {}, {
1967
+ type: type,
1968
+ ref: combinedRef,
1969
+ maxLength: maxLength,
1970
+ onChange: event => {
1971
+ originalOnChange == null ? void 0 : originalOnChange(event);
1972
+ onChange == null ? void 0 : onChange(event);
1973
+ }
1974
+ })), endSlot ? /*#__PURE__*/React__namespace.createElement(Box$1, {
1975
+ className: modules_aaf25250.slot,
1976
+ display: "flex",
1977
+ marginRight: variant === 'bordered' ? '-xsmall' : 'xsmall',
1978
+ marginLeft: variant === 'bordered' ? 'xsmall' : '-xsmall'
1979
+ }, endSlot) : null);
1980
+ });
1911
1981
  });
1912
1982
 
1913
- const _excluded$c = ["togglePasswordLabel"];
1983
+ const _excluded$c = ["togglePasswordLabel", "endSlot"];
1914
1984
  const PasswordField = /*#__PURE__*/React__namespace.forwardRef(function PasswordField(_ref, ref) {
1915
1985
  let {
1916
- togglePasswordLabel = 'Toggle password visibility'
1986
+ togglePasswordLabel = 'Toggle password visibility',
1987
+ endSlot
1917
1988
  } = _ref,
1918
1989
  props = _objectWithoutProperties(_ref, _excluded$c);
1919
1990
 
@@ -1923,34 +1994,34 @@ const PasswordField = /*#__PURE__*/React__namespace.forwardRef(function Password
1923
1994
  ref: ref,
1924
1995
  // @ts-expect-error TextField does not support type="password", so we override the type check here
1925
1996
  type: isPasswordVisible ? 'text' : 'password',
1926
- endSlot: /*#__PURE__*/React__namespace.createElement(IconButton, {
1997
+ endSlot: /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, endSlot, /*#__PURE__*/React__namespace.createElement(IconButton, {
1927
1998
  variant: "quaternary",
1928
1999
  icon: /*#__PURE__*/React__namespace.createElement(Icon, {
1929
2000
  "aria-hidden": true
1930
2001
  }),
1931
2002
  "aria-label": togglePasswordLabel,
1932
2003
  onClick: () => setPasswordVisible(v => !v)
1933
- })
2004
+ }))
1934
2005
  }));
1935
2006
  });
1936
2007
 
1937
2008
  var modules_1fa9b208 = {"selectWrapper":"b930bb07","bordered":"e1f620b6","error":"_7e87474e"};
1938
2009
 
1939
- const _excluded$b = ["variant", "id", "label", "secondaryLabel", "auxiliaryLabel", "hint", "message", "tone", "maxWidth", "children", "hidden", "aria-describedby"];
2010
+ const _excluded$b = ["variant", "id", "label", "value", "auxiliaryLabel", "message", "tone", "maxWidth", "children", "hidden", "aria-describedby", "onChange"];
1940
2011
  const SelectField = /*#__PURE__*/React__namespace.forwardRef(function SelectField(_ref, ref) {
1941
2012
  let {
1942
2013
  variant = 'default',
1943
2014
  id,
1944
2015
  label,
1945
- secondaryLabel,
2016
+ value,
1946
2017
  auxiliaryLabel,
1947
- hint,
1948
2018
  message,
1949
2019
  tone,
1950
2020
  maxWidth,
1951
2021
  children,
1952
2022
  hidden,
1953
- 'aria-describedby': ariaDescribedBy
2023
+ 'aria-describedby': ariaDescribedBy,
2024
+ onChange: originalOnChange
1954
2025
  } = _ref,
1955
2026
  props = _objectWithoutProperties(_ref, _excluded$b);
1956
2027
 
@@ -1958,9 +2029,8 @@ const SelectField = /*#__PURE__*/React__namespace.forwardRef(function SelectFiel
1958
2029
  variant: variant,
1959
2030
  id: id,
1960
2031
  label: label,
1961
- secondaryLabel: secondaryLabel,
2032
+ value: value,
1962
2033
  auxiliaryLabel: auxiliaryLabel,
1963
- hint: hint,
1964
2034
  message: message,
1965
2035
  tone: tone,
1966
2036
  maxWidth: maxWidth,
@@ -1970,7 +2040,10 @@ const SelectField = /*#__PURE__*/React__namespace.forwardRef(function SelectFiel
1970
2040
  "data-testid": "select-wrapper",
1971
2041
  className: [modules_1fa9b208.selectWrapper, tone === 'error' ? modules_1fa9b208.error : null, variant === 'bordered' ? modules_1fa9b208.bordered : null]
1972
2042
  }, /*#__PURE__*/React__namespace.createElement("select", _objectSpread2(_objectSpread2(_objectSpread2({}, props), extraProps), {}, {
1973
- ref: ref
2043
+ ref: ref,
2044
+ onChange: event => {
2045
+ originalOnChange == null ? void 0 : originalOnChange(event);
2046
+ }
1974
2047
  }), children), /*#__PURE__*/React__namespace.createElement(SelectChevron, {
1975
2048
  "aria-hidden": true
1976
2049
  })));
@@ -1990,13 +2063,14 @@ function SelectChevron(props) {
1990
2063
 
1991
2064
  var modules_8e05f7c9 = {"container":"bae487be","disabled":"_408d32a0","checked":"_99b0ead7","toggle":"_5af09fb5","label":"a66e1846","handle":"_0dcf70ec","keyFocused":"_1f5e7fd4"};
1992
2065
 
1993
- const _excluded$a = ["label", "hint", "disabled", "hidden", "defaultChecked", "id", "aria-describedby", "aria-label", "aria-labelledby", "onChange"];
2066
+ const _excluded$a = ["label", "message", "tone", "disabled", "hidden", "defaultChecked", "id", "aria-describedby", "aria-label", "aria-labelledby", "onChange"];
1994
2067
  const SwitchField = /*#__PURE__*/React__namespace.forwardRef(function SwitchField(_ref, ref) {
1995
2068
  var _ref2, _props$checked, _props$checked2;
1996
2069
 
1997
2070
  let {
1998
2071
  label,
1999
- hint,
2072
+ message,
2073
+ tone = 'neutral',
2000
2074
  disabled = false,
2001
2075
  hidden,
2002
2076
  defaultChecked,
@@ -2009,8 +2083,8 @@ const SwitchField = /*#__PURE__*/React__namespace.forwardRef(function SwitchFiel
2009
2083
  props = _objectWithoutProperties(_ref, _excluded$a);
2010
2084
 
2011
2085
  const id = useId(originalId);
2012
- const hintId = useId();
2013
- const ariaDescribedBy = originalAriaDescribedBy != null ? originalAriaDescribedBy : hint ? hintId : undefined;
2086
+ const messageId = useId();
2087
+ const ariaDescribedBy = originalAriaDescribedBy != null ? originalAriaDescribedBy : message ? messageId : undefined;
2014
2088
  const ariaLabel = originalAriaLabel != null ? originalAriaLabel : undefined;
2015
2089
  const ariaLabelledBy = originalAriaLabelledby != null ? originalAriaLabelledby : undefined;
2016
2090
  const [keyFocused, setKeyFocused] = React__namespace.useState(false);
@@ -2059,35 +2133,40 @@ const SwitchField = /*#__PURE__*/React__namespace.forwardRef(function SwitchFiel
2059
2133
  className: modules_8e05f7c9.handle
2060
2134
  })), /*#__PURE__*/React__namespace.createElement(Text, {
2061
2135
  exceptionallySetClassName: modules_8e05f7c9.label
2062
- }, label)), hint ? /*#__PURE__*/React__namespace.createElement(FieldHint, {
2063
- id: hintId
2064
- }, hint) : null);
2136
+ }, label)), message ? /*#__PURE__*/React__namespace.createElement(FieldMessage, {
2137
+ id: messageId,
2138
+ tone: tone
2139
+ }, message) : null);
2065
2140
  });
2066
2141
 
2067
- var modules_2728c236 = {"textAreaContainer":"_55ccf266","innerContainer":"_89bb7098","bordered":"_02a47358","error":"_704ff540","autoExpand":"_145ca8f0"};
2142
+ var modules_2728c236 = {"textAreaContainer":"a95cb864","innerContainer":"ab9873f7","bordered":"de380efd","error":"_29a9d12f","disableResize":"_44f7147e"};
2068
2143
 
2069
- const _excluded$9 = ["variant", "id", "label", "secondaryLabel", "auxiliaryLabel", "hint", "message", "tone", "maxWidth", "hidden", "aria-describedby", "rows", "autoExpand"];
2144
+ const _excluded$9 = ["variant", "id", "label", "value", "auxiliaryLabel", "message", "tone", "maxWidth", "maxLength", "hidden", "aria-describedby", "rows", "autoExpand", "disableResize", "onChange"],
2145
+ _excluded2$3 = ["onChange"];
2070
2146
  const TextArea = /*#__PURE__*/React__namespace.forwardRef(function TextArea(_ref, ref) {
2071
2147
  let {
2072
2148
  variant = 'default',
2073
2149
  id,
2074
2150
  label,
2075
- secondaryLabel,
2151
+ value,
2076
2152
  auxiliaryLabel,
2077
- hint,
2078
2153
  message,
2079
2154
  tone,
2080
2155
  maxWidth,
2156
+ maxLength,
2081
2157
  hidden,
2082
2158
  'aria-describedby': ariaDescribedBy,
2083
2159
  rows,
2084
- autoExpand = false
2160
+ autoExpand = false,
2161
+ disableResize = false,
2162
+ onChange: originalOnChange
2085
2163
  } = _ref,
2086
2164
  props = _objectWithoutProperties(_ref, _excluded$9);
2087
2165
 
2088
2166
  const containerRef = React__namespace.useRef(null);
2089
2167
  const internalRef = React__namespace.useRef(null);
2090
2168
  const combinedRef = useCallbackRef.useMergeRefs([ref, internalRef]);
2169
+ const textAreaClassName = classNames__default["default"]([autoExpand ? modules_2728c236.disableResize : null, disableResize ? modules_2728c236.disableResize : null]);
2091
2170
  React__namespace.useEffect(function setupAutoExpand() {
2092
2171
  const containerElement = containerRef.current;
2093
2172
 
@@ -2116,25 +2195,37 @@ const TextArea = /*#__PURE__*/React__namespace.forwardRef(function TextArea(_ref
2116
2195
  variant: variant,
2117
2196
  id: id,
2118
2197
  label: label,
2119
- secondaryLabel: secondaryLabel,
2198
+ value: value,
2120
2199
  auxiliaryLabel: auxiliaryLabel,
2121
- hint: hint,
2122
2200
  message: message,
2123
2201
  tone: tone,
2124
2202
  hidden: hidden,
2125
2203
  "aria-describedby": ariaDescribedBy,
2126
2204
  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
- }))));
2205
+ maxWidth: maxWidth,
2206
+ maxLength: maxLength
2207
+ }, _ref2 => {
2208
+ let {
2209
+ onChange
2210
+ } = _ref2,
2211
+ extraProps = _objectWithoutProperties(_ref2, _excluded2$3);
2212
+
2213
+ return /*#__PURE__*/React__namespace.createElement(Box$1, {
2214
+ width: "full",
2215
+ display: "flex",
2216
+ className: modules_2728c236.innerContainer,
2217
+ ref: containerRef
2218
+ }, /*#__PURE__*/React__namespace.createElement("textarea", _objectSpread2(_objectSpread2(_objectSpread2({}, props), extraProps), {}, {
2219
+ ref: combinedRef,
2220
+ rows: rows,
2221
+ className: textAreaClassName,
2222
+ maxLength: maxLength,
2223
+ onChange: event => {
2224
+ originalOnChange == null ? void 0 : originalOnChange(event);
2225
+ onChange == null ? void 0 : onChange(event);
2226
+ }
2227
+ })));
2228
+ });
2138
2229
  });
2139
2230
 
2140
2231
  function getInitials(name) {
@@ -2653,7 +2744,7 @@ function TabAwareSlot({
2653
2744
  const _excluded$4 = ["children", "onItemSelect"],
2654
2745
  _excluded2 = ["exceptionallySetClassName"],
2655
2746
  _excluded3 = ["render"],
2656
- _excluded4 = ["exceptionallySetClassName", "modal"],
2747
+ _excluded4 = ["exceptionallySetClassName", "modal", "flip"],
2657
2748
  _excluded5 = ["value", "children", "onSelect", "hideOnSelect", "onClick", "exceptionallySetClassName"],
2658
2749
  _excluded6 = ["label", "children", "exceptionallySetClassName"];
2659
2750
  const MenuContext = /*#__PURE__*/React__namespace.createContext({
@@ -2662,6 +2753,9 @@ const MenuContext = /*#__PURE__*/React__namespace.createContext({
2662
2753
  getAnchorRect: null,
2663
2754
  setAnchorRect: () => undefined
2664
2755
  });
2756
+ const SubMenuContext = /*#__PURE__*/React__namespace.createContext({
2757
+ isSubMenu: false
2758
+ });
2665
2759
  /**
2666
2760
  * Wrapper component to control a menu. It does not render anything, only providing the state
2667
2761
  * management for the menu components inside it.
@@ -2754,7 +2848,8 @@ const ContextMenuTrigger = /*#__PURE__*/React__namespace.forwardRef(function Con
2754
2848
  const MenuList = /*#__PURE__*/React__namespace.forwardRef(function MenuList(_ref4, ref) {
2755
2849
  let {
2756
2850
  exceptionallySetClassName,
2757
- modal = true
2851
+ modal = true,
2852
+ flip
2758
2853
  } = _ref4,
2759
2854
  props = _objectWithoutProperties(_ref4, _excluded4);
2760
2855
 
@@ -2767,6 +2862,9 @@ const MenuList = /*#__PURE__*/React__namespace.forwardRef(function MenuList(_ref
2767
2862
  throw new Error('MenuList must be wrapped in <Menu/>');
2768
2863
  }
2769
2864
 
2865
+ const {
2866
+ isSubMenu
2867
+ } = React__namespace.useContext(SubMenuContext);
2770
2868
  const isOpen = menuStore.useState('open');
2771
2869
  return isOpen ? /*#__PURE__*/React__namespace.createElement(react.Portal, {
2772
2870
  preserveTabOrder: true
@@ -2777,7 +2875,8 @@ const MenuList = /*#__PURE__*/React__namespace.forwardRef(function MenuList(_ref
2777
2875
  ref: ref,
2778
2876
  className: classNames__default["default"]('reactist_menulist', exceptionallySetClassName),
2779
2877
  getAnchorRect: getAnchorRect != null ? getAnchorRect : undefined,
2780
- modal: modal
2878
+ modal: modal,
2879
+ flip: flip != null ? flip : isSubMenu ? 'bottom' : undefined
2781
2880
  }))) : null;
2782
2881
  });
2783
2882
  /**
@@ -2868,6 +2967,9 @@ const SubMenu = /*#__PURE__*/React__namespace.forwardRef(function SubMenu({
2868
2967
  }, [parentMenuHide, parentMenuItemSelect, onItemSelect]);
2869
2968
  const [button, list] = React__namespace.Children.toArray(children);
2870
2969
  const buttonElement = button;
2970
+ const subMenuContextValue = React__namespace.useMemo(() => ({
2971
+ isSubMenu: true
2972
+ }), []);
2871
2973
  return /*#__PURE__*/React__namespace.createElement(Menu, {
2872
2974
  onItemSelect: handleSubItemSelect
2873
2975
  }, /*#__PURE__*/React__namespace.createElement(react.MenuItem, {
@@ -2875,7 +2977,9 @@ const SubMenu = /*#__PURE__*/React__namespace.forwardRef(function SubMenu({
2875
2977
  ref: ref,
2876
2978
  hideOnClick: false,
2877
2979
  render: buttonElement
2878
- }, buttonElement.props.children), list);
2980
+ }, buttonElement.props.children), /*#__PURE__*/React__namespace.createElement(SubMenuContext.Provider, {
2981
+ value: subMenuContextValue
2982
+ }, list));
2879
2983
  });
2880
2984
  /**
2881
2985
  * A way to semantically group some menu items.