@transferwise/components 46.27.0 → 46.28.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 (125) hide show
  1. package/build/i18n/th.json +2 -2
  2. package/build/index.js +327 -630
  3. package/build/index.js.map +1 -1
  4. package/build/index.mjs +328 -631
  5. package/build/index.mjs.map +1 -1
  6. package/build/types/alert/Alert.d.ts +47 -58
  7. package/build/types/alert/Alert.d.ts.map +1 -1
  8. package/build/types/alert/index.d.ts +2 -1
  9. package/build/types/alert/index.d.ts.map +1 -1
  10. package/build/types/button/Button.d.ts +7 -9
  11. package/build/types/button/Button.d.ts.map +1 -1
  12. package/build/types/common/dateUtils/isWithinRange/isWithinRange.d.ts +1 -1
  13. package/build/types/common/dateUtils/isWithinRange/isWithinRange.d.ts.map +1 -1
  14. package/build/types/common/dateUtils/moveToWithinRange/moveToWithinRange.d.ts +1 -1
  15. package/build/types/common/dateUtils/moveToWithinRange/moveToWithinRange.d.ts.map +1 -1
  16. package/build/types/common/propsValues/sentiment.d.ts +0 -1
  17. package/build/types/common/propsValues/sentiment.d.ts.map +1 -1
  18. package/build/types/dateLookup/DateLookup.d.ts +75 -28
  19. package/build/types/dateLookup/DateLookup.d.ts.map +1 -1
  20. package/build/types/dateLookup/DateLookup.messages.d.ts +42 -63
  21. package/build/types/dateLookup/DateLookup.messages.d.ts.map +1 -1
  22. package/build/types/dateLookup/dateHeader/DateHeader.d.ts +9 -22
  23. package/build/types/dateLookup/dateHeader/DateHeader.d.ts.map +1 -1
  24. package/build/types/dateLookup/dateHeader/index.d.ts +1 -1
  25. package/build/types/dateLookup/dateHeader/index.d.ts.map +1 -1
  26. package/build/types/dateLookup/dateTrigger/DateTrigger.d.ts +13 -31
  27. package/build/types/dateLookup/dateTrigger/DateTrigger.d.ts.map +1 -1
  28. package/build/types/dateLookup/dateTrigger/index.d.ts +1 -1
  29. package/build/types/dateLookup/dateTrigger/index.d.ts.map +1 -1
  30. package/build/types/dateLookup/dayCalendar/DayCalendar.d.ts +19 -2
  31. package/build/types/dateLookup/dayCalendar/DayCalendar.d.ts.map +1 -1
  32. package/build/types/dateLookup/dayCalendar/index.d.ts +1 -1
  33. package/build/types/dateLookup/dayCalendar/index.d.ts.map +1 -1
  34. package/build/types/dateLookup/dayCalendar/table/DayCalendarTable.d.ts +12 -2
  35. package/build/types/dateLookup/dayCalendar/table/DayCalendarTable.d.ts.map +1 -1
  36. package/build/types/dateLookup/dayCalendar/table/index.d.ts +1 -1
  37. package/build/types/dateLookup/dayCalendar/table/index.d.ts.map +1 -1
  38. package/build/types/dateLookup/getStartOfDay/getStartOfDay.d.ts +1 -1
  39. package/build/types/dateLookup/getStartOfDay/getStartOfDay.d.ts.map +1 -1
  40. package/build/types/dateLookup/getStartOfDay/index.d.ts +1 -1
  41. package/build/types/dateLookup/getStartOfDay/index.d.ts.map +1 -1
  42. package/build/types/dateLookup/index.d.ts +2 -1
  43. package/build/types/dateLookup/index.d.ts.map +1 -1
  44. package/build/types/dateLookup/monthCalendar/MonthCalendar.d.ts +17 -2
  45. package/build/types/dateLookup/monthCalendar/MonthCalendar.d.ts.map +1 -1
  46. package/build/types/dateLookup/monthCalendar/index.d.ts +1 -1
  47. package/build/types/dateLookup/monthCalendar/index.d.ts.map +1 -1
  48. package/build/types/dateLookup/monthCalendar/table/MonthCalendarTable.d.ts +10 -26
  49. package/build/types/dateLookup/monthCalendar/table/MonthCalendarTable.d.ts.map +1 -1
  50. package/build/types/dateLookup/monthCalendar/table/index.d.ts +1 -1
  51. package/build/types/dateLookup/monthCalendar/table/index.d.ts.map +1 -1
  52. package/build/types/dateLookup/yearCalendar/YearCalendar.d.ts +15 -2
  53. package/build/types/dateLookup/yearCalendar/YearCalendar.d.ts.map +1 -1
  54. package/build/types/dateLookup/yearCalendar/index.d.ts +1 -1
  55. package/build/types/dateLookup/yearCalendar/index.d.ts.map +1 -1
  56. package/build/types/dateLookup/yearCalendar/table/YearCalendarTable.d.ts +10 -26
  57. package/build/types/dateLookup/yearCalendar/table/YearCalendarTable.d.ts.map +1 -1
  58. package/build/types/dateLookup/yearCalendar/table/index.d.ts +1 -1
  59. package/build/types/dateLookup/yearCalendar/table/index.d.ts.map +1 -1
  60. package/build/types/index.d.ts +2 -1
  61. package/build/types/index.d.ts.map +1 -1
  62. package/build/types/inlineAlert/InlineAlert.d.ts +2 -4
  63. package/build/types/inlineAlert/InlineAlert.d.ts.map +1 -1
  64. package/build/types/inputs/SelectInput.d.ts.map +1 -1
  65. package/build/types/inputs/_BottomSheet.d.ts.map +1 -1
  66. package/build/types/inputs/_Popover.d.ts.map +1 -1
  67. package/build/types/statusIcon/StatusIcon.d.ts +1 -1
  68. package/build/types/statusIcon/StatusIcon.d.ts.map +1 -1
  69. package/package.json +1 -1
  70. package/src/alert/{Alert.spec.js → Alert.spec.tsx} +43 -40
  71. package/src/alert/Alert.story.tsx +1 -2
  72. package/src/alert/Alert.tsx +218 -0
  73. package/src/alert/index.ts +2 -0
  74. package/src/button/Button.tsx +6 -10
  75. package/src/common/dateUtils/isWithinRange/isWithinRange.spec.ts +21 -0
  76. package/src/common/dateUtils/isWithinRange/isWithinRange.ts +2 -2
  77. package/src/common/dateUtils/moveToWithinRange/moveToWithinRange.ts +8 -4
  78. package/src/common/propsValues/sentiment.ts +0 -10
  79. package/src/dateLookup/DateLookup.state.spec.js +7 -0
  80. package/src/dateLookup/{DateLookup.story.js → DateLookup.story.tsx} +13 -14
  81. package/src/dateLookup/DateLookup.tests.story.tsx +70 -0
  82. package/src/dateLookup/{DateLookup.js → DateLookup.tsx} +115 -81
  83. package/src/dateLookup/dateHeader/{DateHeader.js → DateHeader.tsx} +15 -15
  84. package/src/dateLookup/dateTrigger/DateTrigger.spec.js +0 -22
  85. package/src/dateLookup/dateTrigger/{DateTrigger.js → DateTrigger.tsx} +15 -32
  86. package/src/dateLookup/dayCalendar/{DayCalendar.js → DayCalendar.tsx} +14 -21
  87. package/src/dateLookup/dayCalendar/table/{DayCalendarTable.js → DayCalendarTable.tsx} +26 -37
  88. package/src/dateLookup/getStartOfDay/{getStartOfDay.js → getStartOfDay.tsx} +1 -1
  89. package/src/dateLookup/index.ts +2 -0
  90. package/src/dateLookup/monthCalendar/{MonthCalendar.js → MonthCalendar.tsx} +19 -22
  91. package/src/dateLookup/monthCalendar/table/{MonthCalendarTable.js → MonthCalendarTable.tsx} +31 -30
  92. package/src/dateLookup/yearCalendar/{YearCalendar.js → YearCalendar.tsx} +18 -21
  93. package/src/dateLookup/yearCalendar/table/{YearCalendarTable.js → YearCalendarTable.tsx} +26 -28
  94. package/src/i18n/th.json +2 -2
  95. package/src/index.ts +2 -1
  96. package/src/inlineAlert/InlineAlert.spec.tsx +0 -7
  97. package/src/inlineAlert/InlineAlert.tsx +19 -47
  98. package/src/inputs/InputGroup.tsx +3 -3
  99. package/src/inputs/SelectInput.tsx +1 -0
  100. package/src/inputs/_BottomSheet.tsx +44 -54
  101. package/src/inputs/_Popover.tsx +20 -23
  102. package/src/statusIcon/StatusIcon.tsx +14 -14
  103. package/build/types/alert/withArrow/alertArrowPositions.d.ts +0 -9
  104. package/build/types/alert/withArrow/alertArrowPositions.d.ts.map +0 -1
  105. package/build/types/alert/withArrow/index.d.ts +0 -3
  106. package/build/types/alert/withArrow/index.d.ts.map +0 -1
  107. package/build/types/alert/withArrow/withArrow.d.ts +0 -11
  108. package/build/types/alert/withArrow/withArrow.d.ts.map +0 -1
  109. package/src/alert/Alert.js +0 -196
  110. package/src/alert/index.js +0 -1
  111. package/src/alert/withArrow/alertArrowPositions.ts +0 -9
  112. package/src/alert/withArrow/index.js +0 -2
  113. package/src/alert/withArrow/withArrow.js +0 -50
  114. package/src/alert/withArrow/withArrow.spec.js +0 -51
  115. package/src/dateLookup/index.js +0 -1
  116. /package/src/dateLookup/{DateLookup.messages.js → DateLookup.messages.ts} +0 -0
  117. /package/src/dateLookup/dateHeader/{index.js → index.ts} +0 -0
  118. /package/src/dateLookup/dateTrigger/{index.js → index.ts} +0 -0
  119. /package/src/dateLookup/dayCalendar/{index.js → index.ts} +0 -0
  120. /package/src/dateLookup/dayCalendar/table/{index.js → index.ts} +0 -0
  121. /package/src/dateLookup/getStartOfDay/{index.js → index.ts} +0 -0
  122. /package/src/dateLookup/monthCalendar/{index.js → index.ts} +0 -0
  123. /package/src/dateLookup/monthCalendar/table/{index.js → index.ts} +0 -0
  124. /package/src/dateLookup/yearCalendar/{index.js → index.ts} +0 -0
  125. /package/src/dateLookup/yearCalendar/table/{index.js → index.ts} +0 -0
package/build/index.js CHANGED
@@ -7,20 +7,20 @@ var reactId = require('@radix-ui/react-id');
7
7
  var icons = require('@transferwise/icons');
8
8
  var reactIntl = require('react-intl');
9
9
  var PropTypes = require('prop-types');
10
+ var commonmark = require('commonmark');
10
11
  var componentsTheming = require('@wise/components-theming');
11
12
  var formatting = require('@transferwise/formatting');
12
13
  var react$1 = require('@headlessui/react');
13
14
  var mergeProps = require('merge-props');
14
15
  var index_js = require('use-sync-external-store/shim/index.js');
15
16
  var react = require('@floating-ui/react');
16
- var focus = require('@react-aria/focus');
17
17
  var overlays = require('@react-aria/overlays');
18
18
  var reactTransitionGroup = require('react-transition-group');
19
+ var neptuneValidation = require('@transferwise/neptune-validation');
20
+ var reactDom = require('react-dom');
21
+ var focus = require('@react-aria/focus');
19
22
  var reactPopper = require('react-popper');
20
23
  var throttle = require('lodash.throttle');
21
- var reactDom = require('react-dom');
22
- var neptuneValidation = require('@transferwise/neptune-validation');
23
- var commonmark = require('commonmark');
24
24
  var art = require('@wise/art');
25
25
  var clamp$2 = require('lodash.clamp');
26
26
  var debounce = require('lodash.debounce');
@@ -51,9 +51,9 @@ function _interopNamespace(e) {
51
51
  var classNames__default = /*#__PURE__*/_interopDefault(classNames);
52
52
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
53
53
  var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
54
+ var commonmark__default = /*#__PURE__*/_interopDefault(commonmark);
54
55
  var mergeProps__default = /*#__PURE__*/_interopDefault(mergeProps);
55
56
  var throttle__default = /*#__PURE__*/_interopDefault(throttle);
56
- var commonmark__default = /*#__PURE__*/_interopDefault(commonmark);
57
57
  var clamp__default = /*#__PURE__*/_interopDefault(clamp$2);
58
58
  var debounce__default = /*#__PURE__*/_interopDefault(debounce);
59
59
  var requiredIf__default = /*#__PURE__*/_interopDefault(requiredIf);
@@ -807,22 +807,22 @@ const Link = ({
807
807
  });
808
808
  };
809
809
 
810
+ const iconTypeMap = {
811
+ positive: icons.Check,
812
+ neutral: icons.Info,
813
+ warning: icons.Alert,
814
+ negative: icons.Cross,
815
+ pending: icons.ClockBorderless,
816
+ info: icons.Info,
817
+ error: icons.Cross,
818
+ success: icons.Check
819
+ };
810
820
  const StatusIcon = ({
811
- sentiment = exports.Sentiment.NEUTRAL,
812
- size = exports.Size.MEDIUM
821
+ sentiment = 'neutral',
822
+ size = 'md'
813
823
  }) => {
814
- const iconTypeMap = {
815
- [exports.Sentiment.POSITIVE]: icons.Check,
816
- [exports.Sentiment.NEUTRAL]: icons.Info,
817
- [exports.Sentiment.WARNING]: icons.Alert,
818
- [exports.Sentiment.NEGATIVE]: icons.Cross,
819
- [exports.Sentiment.PENDING]: icons.ClockBorderless,
820
- [exports.Sentiment.INFO]: icons.Info,
821
- [exports.Sentiment.ERROR]: icons.Cross,
822
- [exports.Sentiment.SUCCESS]: icons.Check
823
- };
824
- const iconColor = [exports.Sentiment.WARNING, exports.Sentiment.PENDING].includes(sentiment) ? 'dark' : 'light';
825
824
  const Icon = iconTypeMap[sentiment];
825
+ const iconColor = sentiment === 'warning' || sentiment === 'pending' ? 'dark' : 'light';
826
826
  return /*#__PURE__*/jsxRuntime.jsx("span", {
827
827
  "data-testid": "status-icon",
828
828
  className: classNames__default.default('status-circle', 'status-circle-' + size, sentiment),
@@ -832,7 +832,7 @@ const StatusIcon = ({
832
832
  });
833
833
  };
834
834
 
835
- function logActionRequired$1(message) {
835
+ function logActionRequired(message) {
836
836
  if (['development', 'test'].includes(process?.env?.NODE_ENV)) {
837
837
  // eslint-disable-next-line no-console
838
838
  console.warn(message);
@@ -840,48 +840,10 @@ function logActionRequired$1(message) {
840
840
  }
841
841
  function logActionRequiredIf(message, conditional) {
842
842
  if (conditional) {
843
- logActionRequired$1(message);
843
+ logActionRequired(message);
844
844
  }
845
845
  }
846
846
 
847
- const deprecatedMessage = ({
848
- component,
849
- propName,
850
- message,
851
- expiryDate
852
- }) => {
853
- const messages = [`${component} has deprecated the use of ${propName}.`];
854
- if (message) {
855
- messages.push(message);
856
- }
857
- if (expiryDate) {
858
- messages.push(`${propName} will be removed on or after ${expiryDate.toLocaleString('en-GB', {
859
- year: 'numeric',
860
- month: 'numeric',
861
- day: 'numeric'
862
- })}`);
863
- }
864
- return messages.join(' ');
865
- };
866
- const deprecated = (validator, {
867
- component,
868
- message = '',
869
- newProp: newProperty = null,
870
- expiryDate = null
871
- }) => (props, propertyName, ...rest) => {
872
- const newPropertyMessage = newProperty ? `Please use ${newProperty} instead.` : message;
873
- if (props[propertyName] != null && typeof props[propertyName] !== 'undefined') {
874
- logActionRequired$1(deprecatedMessage({
875
- component,
876
- propName: propertyName,
877
- message: newPropertyMessage,
878
- expiryDate
879
- }));
880
- }
881
- return validator(props, propertyName, ...rest);
882
- };
883
- var deprecated$1 = deprecated;
884
-
885
847
  const reader = new commonmark__default.default.Parser();
886
848
  const writer = new commonmark__default.default.HtmlRenderer({
887
849
  safe: true
@@ -901,7 +863,7 @@ function Markdown({
901
863
  const linkTarget = config?.link?.target ?? '_self';
902
864
  const paragraphClass = config?.paragraph?.className ?? '';
903
865
  if (allowList != null && blockList != null) {
904
- logActionRequired$1('Markdown supports only one of `allowList` or `blockList` to be used at a time. `blockList` will be ignored.');
866
+ logActionRequired('Markdown supports only one of `allowList` or `blockList` to be used at a time. `blockList` will be ignored.');
905
867
  }
906
868
  const parser = nodes => {
907
869
  const parsed = reader.parse(nodes);
@@ -962,146 +924,98 @@ InlineMarkdown.defaultProps = {
962
924
  };
963
925
  var InlineMarkdown$1 = InlineMarkdown;
964
926
 
965
- // TODO: consider to move this enum into component file once we migrate it on TypeScript or replace with some common enum
966
- exports.AlertArrowPosition = void 0;
967
- (function (ArrowPosition) {
968
- ArrowPosition["TOP_LEFT"] = "up-left";
969
- ArrowPosition["TOP"] = "up-center";
970
- ArrowPosition["TOP_RIGHT"] = "up-right";
971
- ArrowPosition["BOTTOM_LEFT"] = "down-left";
972
- ArrowPosition["BOTTOM"] = "down-center";
973
- ArrowPosition["BOTTOM_RIGHT"] = "down-right";
974
- })(exports.AlertArrowPosition || (exports.AlertArrowPosition = {}));
975
-
976
- function withArrow(Alert, arrow) {
977
- const AlertWithArrow = props => /*#__PURE__*/jsxRuntime.jsx(Alert, {
978
- ...props,
979
- className: classNames__default.default(props.className, arrowClasses(arrow)),
980
- arrow: undefined
981
- });
982
- AlertWithArrow.propTypes = {
983
- className: PropTypes__default.default.string
984
- };
985
- AlertWithArrow.defaultProps = {
986
- className: undefined
987
- };
988
- return AlertWithArrow;
927
+ var AlertArrowPosition;
928
+ (function (AlertArrowPosition) {
929
+ AlertArrowPosition["TOP_LEFT"] = "up-left";
930
+ AlertArrowPosition["TOP"] = "up-center";
931
+ AlertArrowPosition["TOP_RIGHT"] = "up-right";
932
+ AlertArrowPosition["BOTTOM_LEFT"] = "down-left";
933
+ AlertArrowPosition["BOTTOM"] = "down-center";
934
+ AlertArrowPosition["BOTTOM_RIGHT"] = "down-right";
935
+ })(AlertArrowPosition || (AlertArrowPosition = {}));
936
+ function resolveType(type) {
937
+ switch (type) {
938
+ case 'success':
939
+ return 'positive';
940
+ case 'info':
941
+ return 'neutral';
942
+ case 'error':
943
+ return 'negative';
944
+ }
945
+ return type;
989
946
  }
990
- function arrowClasses(arrow) {
991
- if (arrow) {
992
- const classes = ['arrow'];
993
- const {
994
- BOTTOM,
995
- BOTTOM_LEFT,
996
- BOTTOM_RIGHT,
997
- TOP,
998
- TOP_RIGHT,
999
- TOP_LEFT
1000
- } = exports.AlertArrowPosition;
1001
- switch (arrow) {
1002
- case BOTTOM:
1003
- return classes.concat('arrow-bottom', 'arrow-center');
1004
- case BOTTOM_LEFT:
1005
- return classes.concat('arrow-bottom', 'arrow-left');
1006
- case BOTTOM_RIGHT:
1007
- return classes.concat('arrow-bottom', 'arrow-right');
1008
- case TOP:
1009
- return classes.concat('arrow-center');
1010
- case TOP_RIGHT:
1011
- return classes.concat('arrow-right');
1012
- case TOP_LEFT:
1013
- default:
1014
- return classes;
947
+ function Alert({
948
+ arrow,
949
+ action,
950
+ children,
951
+ className,
952
+ dismissible,
953
+ icon,
954
+ onDismiss,
955
+ message,
956
+ size,
957
+ title,
958
+ type = 'neutral',
959
+ variant = 'desktop'
960
+ }) {
961
+ React.useEffect(() => {
962
+ if (arrow !== undefined) {
963
+ logActionRequired("Alert component doesn't support 'arrow' anymore, use 'InlineAlert' instead.");
1015
964
  }
1016
- }
1017
- return '';
1018
- }
1019
-
1020
- const deprecatedTypeMap$1 = {
1021
- [exports.Sentiment.SUCCESS]: exports.Sentiment.POSITIVE,
1022
- [exports.Sentiment.INFO]: exports.Sentiment.NEUTRAL,
1023
- [exports.Sentiment.ERROR]: exports.Sentiment.NEGATIVE
1024
- };
1025
- const Alert = props => {
1026
- const {
1027
- isModern
1028
- } = componentsTheming.useTheme();
1029
- const iconTypeMap = {
1030
- [exports.Sentiment.POSITIVE]: icons.CheckCircle,
1031
- [exports.Sentiment.NEUTRAL]: icons.InfoCircle,
1032
- [exports.Sentiment.WARNING]: icons.Warning,
1033
- [exports.Sentiment.NEGATIVE]: icons.CrossCircle,
1034
- [exports.Sentiment.PENDING]: icons.Clock
1035
- };
1036
- const [shouldFire, setShouldFire] = React.useState(false);
1037
- const {
1038
- arrow,
1039
- action,
1040
- children,
1041
- className,
1042
- icon,
1043
- onDismiss,
1044
- message,
1045
- title,
1046
- type,
1047
- variant
1048
- } = props;
1049
- const closeButtonReference = React.useRef(null);
1050
- if (arrow) {
1051
- const AlertWithArrow = withArrow(Alert, arrow);
1052
- return /*#__PURE__*/jsxRuntime.jsx(AlertWithArrow, {
1053
- ...props
1054
- });
1055
- }
1056
- logActionRequired(props);
1057
- const mappedType = deprecatedTypeMap$1[type] || type;
1058
- const Icon = iconTypeMap[mappedType];
1059
- function generateIcon() {
1060
- if (icon) {
1061
- return /*#__PURE__*/jsxRuntime.jsx("div", {
1062
- className: "alert__icon",
1063
- children: icon
1064
- });
965
+ }, [arrow]);
966
+ React.useEffect(() => {
967
+ if (children !== undefined) {
968
+ logActionRequired("Alert component doesn't support 'children' anymore, use 'message' instead.");
1065
969
  }
1066
- if (isModern) {
1067
- return /*#__PURE__*/jsxRuntime.jsx(StatusIcon, {
1068
- size: exports.Size.LARGE,
1069
- sentiment: mappedType
1070
- });
1071
- } else {
1072
- return /*#__PURE__*/jsxRuntime.jsx(Icon, {
1073
- size: 24
1074
- });
970
+ }, [children]);
971
+ React.useEffect(() => {
972
+ if (dismissible !== undefined) {
973
+ logActionRequired("Alert component doesn't support 'dismissible' anymore, use 'onDismiss' instead.");
1075
974
  }
1076
- }
1077
- const handleTouchStart = () => setShouldFire(true);
1078
- const handleTouchMove = () => setShouldFire(false);
1079
- const handleTouchEnd = event => {
1080
- if (shouldFire && action) {
975
+ }, [dismissible]);
976
+ React.useEffect(() => {
977
+ if (size !== undefined) {
978
+ logActionRequired("Alert component doesn't support 'size' anymore, please remove that prop.");
979
+ }
980
+ }, [size]);
981
+ const resolvedType = resolveType(type);
982
+ React.useEffect(() => {
983
+ if (resolvedType !== type) {
984
+ logActionRequired(`Alert component has deprecated '${type}' value for the 'type' prop. Please use '${resolvedType}' instead.`);
985
+ }
986
+ }, [resolvedType, type]);
987
+ const [shouldFire, setShouldFire] = React.useState(false);
988
+ const closeButtonReference = React.useRef(null);
989
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
990
+ className: classNames__default.default('alert d-flex', `alert-${resolvedType}`, arrow != null && alertArrowClassNames(arrow), className),
991
+ "data-testid": "alert",
992
+ onTouchStart: () => setShouldFire(true),
993
+ onTouchEnd: event => {
994
+ if (shouldFire && action &&
1081
995
  // Check if current event is triggered from closeButton
1082
- if (closeButtonReference?.current && !closeButtonReference.current.contains(event.target)) {
1083
- if (action?.target === '_blank') {
1084
- window.top.open(action.href);
996
+ event.target instanceof Node && closeButtonReference.current && !closeButtonReference.current.contains(event.target)) {
997
+ if (action.target === '_blank') {
998
+ window.top?.open(action.href);
1085
999
  } else {
1086
- window.top.location.assign(action.href);
1000
+ window.top?.location.assign(action.href);
1087
1001
  }
1088
1002
  }
1089
- }
1090
- setShouldFire(false);
1091
- };
1092
- return /*#__PURE__*/jsxRuntime.jsxs("div", {
1093
- className: classNames__default.default('alert d-flex', `alert-${mappedType}`, className),
1094
- "data-testid": "alert",
1095
- onTouchStart: handleTouchStart,
1096
- onTouchEnd: handleTouchEnd,
1097
- onTouchMove: handleTouchMove,
1003
+ setShouldFire(false);
1004
+ },
1005
+ onTouchMove: () => setShouldFire(false),
1098
1006
  children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
1099
1007
  className: classNames__default.default('alert__content', 'd-flex', 'flex-grow-1', variant),
1100
1008
  "data-testid": variant,
1101
- children: [generateIcon(), /*#__PURE__*/jsxRuntime.jsxs("div", {
1009
+ children: [icon ? /*#__PURE__*/jsxRuntime.jsx("div", {
1010
+ className: "alert__icon",
1011
+ children: icon
1012
+ }) : /*#__PURE__*/jsxRuntime.jsx(StatusIcon, {
1013
+ size: exports.Size.LARGE,
1014
+ sentiment: resolvedType
1015
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
1102
1016
  className: "alert__message",
1103
1017
  children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
1104
- role: exports.Sentiment.NEGATIVE === mappedType ? 'alert' : 'status',
1018
+ role: exports.Sentiment.NEGATIVE === resolvedType ? 'alert' : 'status',
1105
1019
  children: [title && /*#__PURE__*/jsxRuntime.jsx(Title, {
1106
1020
  className: "m-b-1",
1107
1021
  type: exports.Typography.TITLE_BODY,
@@ -1129,72 +1043,24 @@ const Alert = props => {
1129
1043
  onClick: onDismiss
1130
1044
  })]
1131
1045
  });
1132
- };
1133
- const deprecatedTypeMapMessage$1 = {
1134
- [exports.Sentiment.SUCCESS]: 'Sentiment.POSITIVE',
1135
- [exports.Sentiment.INFO]: 'Sentiment.NEUTRAL',
1136
- [exports.Sentiment.ERROR]: 'Sentiment.NEGATIVE'
1137
- };
1138
- const deprecatedTypes$1 = Object.keys(deprecatedTypeMap$1);
1139
- function logActionRequired({
1140
- size,
1141
- type
1142
- }) {
1143
- logActionRequiredIf('Alert no longer supports any possible variations in size. Please remove the `size` prop.', !!size);
1144
- logActionRequiredIf(`Alert has deprecated the ${type} value for the \`type\` prop. Please update to ${deprecatedTypeMapMessage$1[type]}.`, deprecatedTypes$1.includes(type));
1145
1046
  }
1146
- Alert.propTypes = {
1147
- /** An optional call to action to sit under the main body of the alert. If your label is short, use aria-label to provide more context */
1148
- action: PropTypes__default.default.shape({
1149
- 'aria-label': PropTypes__default.default.string,
1150
- href: PropTypes__default.default.string.isRequired,
1151
- target: PropTypes__default.default.string,
1152
- text: PropTypes__default.default.node.isRequired
1153
- }),
1154
- className: PropTypes__default.default.string,
1155
- /** An optional icon. If not provided, we will default the icon to something appropriate for the type */
1156
- icon: PropTypes__default.default.element,
1157
- /** Title for the alert component */
1158
- title: PropTypes__default.default.string,
1159
- /** The main body of the alert. Accepts plain text and bold words specified with **double stars*/
1160
- message: requiredIf__default.default(PropTypes__default.default.node, ({
1161
- children
1162
- }) => !children),
1163
- /** The presence of the onDismiss handler will trigger the visibility of the close button */
1164
- onDismiss: PropTypes__default.default.func,
1165
- /** The type dictates which icon and colour will be used */
1166
- type: PropTypes__default.default.oneOf(['negative', 'neutral', 'positive', 'warning', 'info', 'error', 'success']),
1167
- variant: PropTypes__default.default.oneOf(['desktop', 'mobile']),
1168
- /** @deprecated no arrow for `Alert` component anymore, consider to use [`InlineAlert`](https://transferwise.github.io/neptune-web/components/alerts/InlineAlert) component */
1169
- arrow: deprecated$1(PropTypes__default.default.oneOf(['up-left', 'up-center', 'up-right', 'down-left', 'down-center', 'down-right']), {
1170
- component: 'Alert',
1171
- expiryDate: new Date('03-01-2021')
1172
- }),
1173
- /** @deprecated use `message` property instead */
1174
- children: deprecated$1(requiredIf__default.default(PropTypes__default.default.node, ({
1175
- message
1176
- }) => !message), {
1177
- component: 'Alert',
1178
- message: 'You should now use the `message` prop. Be aware `message` only accepts plain text or text with **bold** markdown.',
1179
- expiryDate: new Date('03-01-2021')
1180
- }),
1181
- /** @deprecated use `onDismiss` instead */
1182
- dismissible: deprecated$1(PropTypes__default.default.bool, {
1183
- component: 'Alert',
1184
- message: 'The Alert will now be considered dismissible if an `onDismiss` hander is present.',
1185
- expiryDate: new Date('03-01-2021')
1186
- })
1187
- };
1188
- Alert.defaultProps = {
1189
- action: undefined,
1190
- arrow: undefined,
1191
- className: undefined,
1192
- dismissible: undefined,
1193
- icon: undefined,
1194
- type: exports.Sentiment.NEUTRAL,
1195
- variant: exports.Variant.DESKTOP
1196
- };
1197
- var Alert$1 = Alert;
1047
+ function alertArrowClassNames(arrow) {
1048
+ switch (arrow) {
1049
+ case 'down-center':
1050
+ return 'arrow arrow-bottom arrow-center';
1051
+ case 'down-left':
1052
+ return 'arrow arrow-bottom arrow-left';
1053
+ case 'down-right':
1054
+ return 'arrow arrow-bottom arrow-right';
1055
+ case 'up-center':
1056
+ return 'arrow arrow-center';
1057
+ case 'up-right':
1058
+ return 'arrow arrow-right';
1059
+ case 'up-left':
1060
+ default:
1061
+ return 'arrow';
1062
+ }
1063
+ }
1198
1064
 
1199
1065
  // TODO: consider to move this enum into component file once we migrate it on TypeScript or replace with some common enum
1200
1066
  exports.AvatarType = void 0;
@@ -1420,6 +1286,7 @@ const FocusBoundary = ({
1420
1286
  })
1421
1287
  });
1422
1288
  };
1289
+ var FocusBoundary$1 = FocusBoundary;
1423
1290
 
1424
1291
  function withNextPortalWrapper(Component) {
1425
1292
  return function (props) {
@@ -1561,7 +1428,7 @@ const Dimmer = ({
1561
1428
  onExited: onExited,
1562
1429
  children: /*#__PURE__*/jsxRuntime.jsx(DimmerContentWrapper, {
1563
1430
  scrollBody: !transparent,
1564
- children: /*#__PURE__*/jsxRuntime.jsx(FocusBoundary, {
1431
+ children: /*#__PURE__*/jsxRuntime.jsx(FocusBoundary$1, {
1565
1432
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
1566
1433
  ref: dimmerReference,
1567
1434
  className: classNames__default.default('dimmer', {
@@ -2193,7 +2060,7 @@ var messages$b = reactIntl.defineMessages({
2193
2060
  }
2194
2061
  });
2195
2062
 
2196
- const typeClassMap$1 = {
2063
+ const typeClassMap = {
2197
2064
  [exports.ControlType.ACCENT]: 'btn-accent',
2198
2065
  [exports.ControlType.POSITIVE]: 'btn-positive',
2199
2066
  [exports.ControlType.NEGATIVE]: 'btn-negative'
@@ -2277,7 +2144,7 @@ const Button = /*#__PURE__*/React.forwardRef(({
2277
2144
  },
2278
2145
  // @ts-expect-error fix when refactor `typeClassMap` to TypeScript
2279
2146
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
2280
- typeClassMap$1[newType],
2147
+ typeClassMap[newType],
2281
2148
  // @ts-expect-error fix when refactor `typeClassMap` to TypeScript
2282
2149
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
2283
2150
  priorityClassMap[newPriority], className);
@@ -2662,7 +2529,7 @@ const CircularButton = ({
2662
2529
  type = exports.ControlType.ACCENT,
2663
2530
  ...rest
2664
2531
  }) => {
2665
- const classes = classNames__default.default('btn np-btn', typeClassMap$1[type], priorityClassMap[priority]);
2532
+ const classes = classNames__default.default('btn np-btn', typeClassMap[type], priorityClassMap[priority]);
2666
2533
  const iconElement = Number(icon.props.size) !== 24 ? /*#__PURE__*/React.cloneElement(icon, {
2667
2534
  size: 24
2668
2535
  }) : icon;
@@ -2697,11 +2564,17 @@ function getDayNames(locale, format = 'short') {
2697
2564
 
2698
2565
  // Makes sure that date is between min and max dates, returns a cloned min or max
2699
2566
  function moveToWithinRange(date, min, max) {
2700
- return isWithinRange(date, min, max) ? date : new Date(min && date < min ? +min : +max);
2567
+ if (min && date < min) {
2568
+ return new Date(min);
2569
+ }
2570
+ if (max && date > max) {
2571
+ return new Date(max);
2572
+ }
2573
+ return date;
2701
2574
  }
2702
2575
 
2703
2576
  function isWithinRange(date, min, max) {
2704
- return !date || (!min || date >= min) && (!max || date <= max);
2577
+ return (!min || date >= min) && (!max || date <= max);
2705
2578
  }
2706
2579
 
2707
2580
  const getMonthNames = (locale, format = 'long') => {
@@ -3225,7 +3098,7 @@ var dateTriggerMessages = reactIntl.defineMessages({
3225
3098
 
3226
3099
  const DateTrigger = ({
3227
3100
  selectedDate,
3228
- size,
3101
+ size = exports.Size.MEDIUM,
3229
3102
  placeholder,
3230
3103
  label,
3231
3104
  monthFormat,
@@ -3237,19 +3110,6 @@ const DateTrigger = ({
3237
3110
  locale,
3238
3111
  formatMessage
3239
3112
  } = reactIntl.useIntl();
3240
- const handleKeyDown = event => {
3241
- if (neptuneValidation.isKey({
3242
- keyType: 'Space',
3243
- event: event
3244
- }) || neptuneValidation.isKey({
3245
- keyType: 'Enter',
3246
- event: event
3247
- })) {
3248
- event.stopPropagation();
3249
- event.preventDefault();
3250
- onClear();
3251
- }
3252
- };
3253
3113
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
3254
3114
  children: [/*#__PURE__*/jsxRuntime.jsxs("button", {
3255
3115
  className: `btn btn-${size} btn-input np-date-trigger`,
@@ -3286,29 +3146,12 @@ const DateTrigger = ({
3286
3146
  event.stopPropagation();
3287
3147
  event.preventDefault();
3288
3148
  onClear();
3289
- },
3290
- onKeyPress: handleKeyDown
3149
+ }
3291
3150
  })
3292
3151
  })]
3293
3152
  }) : null]
3294
3153
  });
3295
3154
  };
3296
- DateTrigger.propTypes = {
3297
- selectedDate: PropTypes__default.default.instanceOf(Date),
3298
- size: PropTypes__default.default.oneOf(['sm', 'md', 'lg']),
3299
- placeholder: PropTypes__default.default.string.isRequired,
3300
- label: PropTypes__default.default.string.isRequired,
3301
- monthFormat: PropTypes__default.default.oneOf(['short', 'long']).isRequired,
3302
- disabled: PropTypes__default.default.bool.isRequired,
3303
- onClick: PropTypes__default.default.func,
3304
- onClear: PropTypes__default.default.func
3305
- };
3306
- DateTrigger.defaultProps = {
3307
- selectedDate: null,
3308
- size: exports.Size.MEDIUM,
3309
- onClear: undefined
3310
- };
3311
- var DateTrigger$1 = DateTrigger;
3312
3155
 
3313
3156
  var messages$8 = reactIntl.defineMessages({
3314
3157
  next: {
@@ -3390,18 +3233,6 @@ const DateHeader = ({
3390
3233
  })]
3391
3234
  });
3392
3235
  };
3393
- DateHeader.propTypes = {
3394
- label: PropTypes__default.default.string,
3395
- onLabelClick: PropTypes__default.default.func,
3396
- onPreviousClick: PropTypes__default.default.func.isRequired,
3397
- onNextClick: PropTypes__default.default.func.isRequired,
3398
- dateMode: PropTypes__default.default.string
3399
- };
3400
- DateHeader.defaultProps = {
3401
- label: null,
3402
- onLabelClick: () => {}
3403
- };
3404
- var DateHeader$1 = DateHeader;
3405
3236
 
3406
3237
  function getFocusableTime(props) {
3407
3238
  return props.timeSpan.find(time => props.isActive(time)) || props.timeSpan.find(time => props.isNow(time) && !props.isDisabled(time)) || props.timeSpan.find(time => !props.isDisabled(time));
@@ -3487,10 +3318,9 @@ class DayCalendarTable extends React.PureComponent {
3487
3318
  let week = [];
3488
3319
  const weeks = [];
3489
3320
  let i;
3490
-
3491
3321
  // Pad first week
3492
3322
  for (i = 1; i < firstDayOfMonth; i += 1) {
3493
- week.push(false);
3323
+ week.push(-1);
3494
3324
  }
3495
3325
  // Fill in days
3496
3326
  for (i = 1; i <= daysInMonth; i += 1) {
@@ -3503,7 +3333,7 @@ class DayCalendarTable extends React.PureComponent {
3503
3333
  if (week.length > 0) {
3504
3334
  // Pad last week
3505
3335
  for (i = week.length; i < 7; i += 1) {
3506
- week.push(false);
3336
+ week.push(-1);
3507
3337
  }
3508
3338
  weeks.push(week);
3509
3339
  }
@@ -3558,12 +3388,10 @@ class DayCalendarTable extends React.PureComponent {
3558
3388
  const {
3559
3389
  viewMonth,
3560
3390
  viewYear,
3561
- intl: {
3562
- locale
3563
- }
3391
+ intl
3564
3392
  } = this.props;
3565
3393
  const weeks = this.getTableStructure();
3566
- let autoFocusDay = this.getAutofocusDay(weeks, viewMonth, viewYear);
3394
+ const autoFocusDay = this.getAutofocusDay(weeks);
3567
3395
  return /*#__PURE__*/jsxRuntime.jsxs("table", {
3568
3396
  className: "table table-condensed table-bordered tw-date-lookup-calendar m-b-0",
3569
3397
  children: [/*#__PURE__*/jsxRuntime.jsx("thead", {
@@ -3589,12 +3417,12 @@ class DayCalendarTable extends React.PureComponent {
3589
3417
  children: weeks.map((week, weekIndex) => /*#__PURE__*/jsxRuntime.jsx("tr", {
3590
3418
  children: week.map((day, dayIndex) => /*#__PURE__*/jsxRuntime.jsx("td", {
3591
3419
  className: dayIndex > 4 ? 'weekend' : '',
3592
- children: day && /*#__PURE__*/jsxRuntime.jsx(TableLink, {
3420
+ children: day !== -1 && /*#__PURE__*/jsxRuntime.jsx(TableLink, {
3593
3421
  item: day,
3594
3422
  type: "day",
3595
- title: formatting.formatDate(new Date(viewYear, viewMonth, day), locale, SHORT_DAY_FORMAT),
3423
+ title: formatting.formatDate(new Date(viewYear, viewMonth, day), intl.locale, SHORT_DAY_FORMAT),
3596
3424
  autofocus: day === autoFocusDay,
3597
- longTitle: formatting.formatDate(new Date(viewYear, viewMonth, day), locale),
3425
+ longTitle: formatting.formatDate(new Date(viewYear, viewMonth, day), intl.locale),
3598
3426
  active: this.isActive(day),
3599
3427
  disabled: this.isDisabled(day),
3600
3428
  today: this.isToday(day),
@@ -3606,19 +3434,6 @@ class DayCalendarTable extends React.PureComponent {
3606
3434
  });
3607
3435
  }
3608
3436
  }
3609
- DayCalendarTable.propTypes = {
3610
- selectedDate: PropTypes__default.default.instanceOf(Date),
3611
- min: PropTypes__default.default.instanceOf(Date),
3612
- max: PropTypes__default.default.instanceOf(Date),
3613
- viewMonth: PropTypes__default.default.number.isRequired,
3614
- viewYear: PropTypes__default.default.number.isRequired,
3615
- onSelect: PropTypes__default.default.func.isRequired
3616
- };
3617
- DayCalendarTable.defaultProps = {
3618
- selectedDate: null,
3619
- min: null,
3620
- max: null
3621
- };
3622
3437
  var DayCalendarTable$1 = reactIntl.injectIntl(DayCalendarTable);
3623
3438
 
3624
3439
  class DayCalendar extends React.PureComponent {
@@ -3658,7 +3473,7 @@ class DayCalendar extends React.PureComponent {
3658
3473
  onSelect
3659
3474
  } = this.props;
3660
3475
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
3661
- children: [/*#__PURE__*/jsxRuntime.jsx(DateHeader$1, {
3476
+ children: [/*#__PURE__*/jsxRuntime.jsx(DateHeader, {
3662
3477
  label: formatting.formatDate(new Date(viewYear, viewMonth), locale, {
3663
3478
  month: monthFormat,
3664
3479
  year: 'numeric'
@@ -3678,22 +3493,6 @@ class DayCalendar extends React.PureComponent {
3678
3493
  });
3679
3494
  }
3680
3495
  }
3681
- DayCalendar.propTypes = {
3682
- selectedDate: PropTypes__default.default.instanceOf(Date),
3683
- min: PropTypes__default.default.instanceOf(Date),
3684
- max: PropTypes__default.default.instanceOf(Date),
3685
- viewMonth: PropTypes__default.default.number.isRequired,
3686
- viewYear: PropTypes__default.default.number.isRequired,
3687
- monthFormat: PropTypes__default.default.oneOf([exports.MonthFormat.LONG, exports.MonthFormat.SHORT]).isRequired,
3688
- onSelect: PropTypes__default.default.func.isRequired,
3689
- onLabelClick: PropTypes__default.default.func.isRequired,
3690
- onViewDateUpdate: PropTypes__default.default.func.isRequired
3691
- };
3692
- DayCalendar.defaultProps = {
3693
- selectedDate: null,
3694
- min: null,
3695
- max: null
3696
- };
3697
3496
  var DayCalendar$1 = reactIntl.injectIntl(DayCalendar);
3698
3497
 
3699
3498
  const ROWS$1 = 3;
@@ -3725,7 +3524,7 @@ const MonthCalendarTable = ({
3725
3524
  });
3726
3525
  };
3727
3526
  const isActive = month => {
3728
- return selectedDate && month === selectedDate.getMonth() && viewYear === selectedDate.getFullYear();
3527
+ return !!(selectedDate && month === selectedDate.getMonth() && viewYear === selectedDate.getFullYear());
3729
3528
  };
3730
3529
  const isThisMonth = month => {
3731
3530
  return viewYear === new Date().getFullYear() && month === new Date().getMonth();
@@ -3735,7 +3534,9 @@ const MonthCalendarTable = ({
3735
3534
  return !!(min && date < new Date(min.getFullYear(), min.getMonth()) || max && date > new Date(max.getFullYear(), max.getMonth()));
3736
3535
  };
3737
3536
  const autofocusMonth = (() => {
3738
- const months = [...new Array(ROWS$1 * COLS$1)].map((_, index) => index);
3537
+ const months = Array.from({
3538
+ length: ROWS$1 * COLS$1
3539
+ }, (_, index) => index);
3739
3540
  return getFocusableTime({
3740
3541
  isActive,
3741
3542
  isNow: isThisMonth,
@@ -3749,33 +3550,23 @@ const MonthCalendarTable = ({
3749
3550
  className: "sr-only",
3750
3551
  children: /*#__PURE__*/jsxRuntime.jsx("tr", {
3751
3552
  children: /*#__PURE__*/jsxRuntime.jsx("th", {
3752
- colSpan: "3",
3553
+ colSpan: COLS$1,
3753
3554
  children: placeholder
3754
3555
  })
3755
3556
  })
3756
3557
  }), /*#__PURE__*/jsxRuntime.jsx("tbody", {
3757
- children: [...new Array(ROWS$1)].map((row, rowIndex) => /*#__PURE__*/jsxRuntime.jsx("tr", {
3758
- children: [...new Array(COLS$1)].map((col, colIndex) => /*#__PURE__*/jsxRuntime.jsx("td", {
3558
+ children: Array.from({
3559
+ length: ROWS$1
3560
+ }, (_, rowIndex) => /*#__PURE__*/jsxRuntime.jsx("tr", {
3561
+ children: Array.from({
3562
+ length: COLS$1
3563
+ }, (_, colIndex) => /*#__PURE__*/jsxRuntime.jsx("td", {
3759
3564
  children: getLink(rowIndex * COLS$1 + colIndex)
3760
3565
  }, colIndex))
3761
3566
  }, rowIndex))
3762
3567
  })]
3763
3568
  });
3764
3569
  };
3765
- MonthCalendarTable.propTypes = {
3766
- selectedDate: PropTypes__default.default.instanceOf(Date),
3767
- min: PropTypes__default.default.instanceOf(Date),
3768
- max: PropTypes__default.default.instanceOf(Date),
3769
- viewYear: PropTypes__default.default.number.isRequired,
3770
- placeholder: PropTypes__default.default.string.isRequired,
3771
- onSelect: PropTypes__default.default.func.isRequired
3772
- };
3773
- MonthCalendarTable.defaultProps = {
3774
- selectedDate: null,
3775
- min: null,
3776
- max: null
3777
- };
3778
- var MonthCalendarTable$1 = MonthCalendarTable;
3779
3570
 
3780
3571
  class MonthCalendar extends React.PureComponent {
3781
3572
  onMonthSelect = month => {
@@ -3808,7 +3599,7 @@ class MonthCalendar extends React.PureComponent {
3808
3599
  onLabelClick
3809
3600
  } = this.props;
3810
3601
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
3811
- children: [/*#__PURE__*/jsxRuntime.jsx(DateHeader$1, {
3602
+ children: [/*#__PURE__*/jsxRuntime.jsx(DateHeader, {
3812
3603
  dateMode: formatMessage(messages$8.year),
3813
3604
  label: formatting.formatDate(new Date(viewYear, 0), locale, {
3814
3605
  year: 'numeric'
@@ -3816,32 +3607,17 @@ class MonthCalendar extends React.PureComponent {
3816
3607
  onLabelClick: onLabelClick,
3817
3608
  onPreviousClick: this.selectPreviousYear,
3818
3609
  onNextClick: this.selectNextYear
3819
- }), /*#__PURE__*/jsxRuntime.jsx(MonthCalendarTable$1, {
3820
- selectedDate,
3821
- min,
3822
- max,
3823
- viewYear,
3824
- placeholder,
3610
+ }), /*#__PURE__*/jsxRuntime.jsx(MonthCalendarTable, {
3611
+ selectedDate: selectedDate,
3612
+ min: min,
3613
+ max: max,
3614
+ viewYear: viewYear,
3615
+ placeholder: placeholder,
3825
3616
  onSelect: this.onMonthSelect
3826
3617
  })]
3827
3618
  });
3828
3619
  }
3829
3620
  }
3830
- MonthCalendar.propTypes = {
3831
- selectedDate: PropTypes__default.default.instanceOf(Date),
3832
- min: PropTypes__default.default.instanceOf(Date),
3833
- max: PropTypes__default.default.instanceOf(Date),
3834
- viewYear: PropTypes__default.default.number.isRequired,
3835
- placeholder: PropTypes__default.default.string.isRequired,
3836
- onSelect: PropTypes__default.default.func.isRequired,
3837
- onLabelClick: PropTypes__default.default.func.isRequired,
3838
- onViewDateUpdate: PropTypes__default.default.func.isRequired
3839
- };
3840
- MonthCalendar.defaultProps = {
3841
- selectedDate: null,
3842
- min: null,
3843
- max: null
3844
- };
3845
3621
  var MonthCalendar$1 = reactIntl.injectIntl(MonthCalendar);
3846
3622
 
3847
3623
  const ROWS = 5;
@@ -3883,7 +3659,9 @@ const YearCalendarTable = ({
3883
3659
  return !!(min && year < min.getFullYear() || max && year > max.getFullYear());
3884
3660
  };
3885
3661
  const autofocusYear = (() => {
3886
- const years = [...new Array(ROWS * COLS)].map((_, index) => startYear + index);
3662
+ const years = Array.from({
3663
+ length: ROWS * COLS
3664
+ }, (_, index) => startYear + index);
3887
3665
  return getFocusableTime({
3888
3666
  isActive,
3889
3667
  isNow: isThisYear,
@@ -3897,33 +3675,23 @@ const YearCalendarTable = ({
3897
3675
  className: "sr-only",
3898
3676
  children: /*#__PURE__*/jsxRuntime.jsx("tr", {
3899
3677
  children: /*#__PURE__*/jsxRuntime.jsx("th", {
3900
- colSpan: "4",
3678
+ colSpan: COLS,
3901
3679
  children: placeholder
3902
3680
  })
3903
3681
  })
3904
3682
  }), /*#__PURE__*/jsxRuntime.jsx("tbody", {
3905
- children: [...new Array(ROWS)].map((row, rowIndex) => /*#__PURE__*/jsxRuntime.jsx("tr", {
3906
- children: [...new Array(COLS)].map((col, colIndex) => /*#__PURE__*/jsxRuntime.jsx("td", {
3683
+ children: Array.from({
3684
+ length: ROWS
3685
+ }, (_, rowIndex) => /*#__PURE__*/jsxRuntime.jsx("tr", {
3686
+ children: Array.from({
3687
+ length: COLS
3688
+ }, (_, colIndex) => /*#__PURE__*/jsxRuntime.jsx("td", {
3907
3689
  children: getLink(startYear + rowIndex * COLS + colIndex)
3908
3690
  }, colIndex))
3909
3691
  }, rowIndex))
3910
3692
  })]
3911
3693
  });
3912
3694
  };
3913
- YearCalendarTable.propTypes = {
3914
- selectedDate: PropTypes__default.default.instanceOf(Date),
3915
- min: PropTypes__default.default.instanceOf(Date),
3916
- max: PropTypes__default.default.instanceOf(Date),
3917
- viewYear: PropTypes__default.default.number.isRequired,
3918
- placeholder: PropTypes__default.default.string.isRequired,
3919
- onSelect: PropTypes__default.default.func.isRequired
3920
- };
3921
- YearCalendarTable.defaultProps = {
3922
- selectedDate: null,
3923
- min: null,
3924
- max: null
3925
- };
3926
- var YearCalendarTable$1 = YearCalendarTable;
3927
3695
 
3928
3696
  class YearCalendar extends React.PureComponent {
3929
3697
  onYearSelect = year => {
@@ -3954,43 +3722,35 @@ class YearCalendar extends React.PureComponent {
3954
3722
  }
3955
3723
  } = this.props;
3956
3724
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
3957
- children: [/*#__PURE__*/jsxRuntime.jsx(DateHeader$1, {
3725
+ children: [/*#__PURE__*/jsxRuntime.jsx(DateHeader, {
3958
3726
  dateMode: formatMessage(messages$8.twentyYears),
3959
3727
  onPreviousClick: this.selectPreviousYears,
3960
3728
  onNextClick: this.selectNextYears
3961
- }), /*#__PURE__*/jsxRuntime.jsx(YearCalendarTable$1, {
3962
- selectedDate,
3963
- min,
3964
- max,
3965
- viewYear,
3966
- placeholder,
3729
+ }), /*#__PURE__*/jsxRuntime.jsx(YearCalendarTable, {
3730
+ selectedDate: selectedDate,
3731
+ min: min,
3732
+ max: max,
3733
+ viewYear: viewYear,
3734
+ placeholder: placeholder,
3967
3735
  onSelect: this.onYearSelect
3968
3736
  })]
3969
3737
  });
3970
3738
  }
3971
3739
  }
3972
- YearCalendar.propTypes = {
3973
- selectedDate: PropTypes__default.default.instanceOf(Date),
3974
- min: PropTypes__default.default.instanceOf(Date),
3975
- max: PropTypes__default.default.instanceOf(Date),
3976
- viewYear: PropTypes__default.default.number.isRequired,
3977
- placeholder: PropTypes__default.default.string.isRequired,
3978
- onSelect: PropTypes__default.default.func.isRequired,
3979
- onViewDateUpdate: PropTypes__default.default.func.isRequired
3980
- };
3981
- YearCalendar.defaultProps = {
3982
- selectedDate: null,
3983
- min: null,
3984
- max: null
3985
- };
3986
3740
  var YearCalendar$1 = reactIntl.injectIntl(YearCalendar);
3987
3741
 
3988
- const MODE = {
3989
- DAY: 'day',
3990
- MONTH: 'month',
3991
- YEAR: 'year'
3992
- };
3993
3742
  class DateLookup extends React.PureComponent {
3743
+ static defaultProps = {
3744
+ value: null,
3745
+ min: null,
3746
+ max: null,
3747
+ size: exports.Size.MEDIUM,
3748
+ placeholder: '',
3749
+ label: '',
3750
+ monthFormat: exports.MonthFormat.LONG,
3751
+ disabled: false,
3752
+ clearable: false
3753
+ };
3994
3754
  element = /*#__PURE__*/React.createRef();
3995
3755
  dropdown = /*#__PURE__*/React.createRef();
3996
3756
  constructor(props) {
@@ -4003,7 +3763,7 @@ class DateLookup extends React.PureComponent {
4003
3763
  viewMonth: (props.value || new Date()).getMonth(),
4004
3764
  viewYear: (props.value || new Date()).getFullYear(),
4005
3765
  open: false,
4006
- mode: MODE.DAY,
3766
+ mode: 'day',
4007
3767
  isMobile: false
4008
3768
  };
4009
3769
  }
@@ -4011,20 +3771,20 @@ class DateLookup extends React.PureComponent {
4011
3771
  const propsSelected = getStartOfDay(props.value);
4012
3772
  const propsMin = getStartOfDay(props.min);
4013
3773
  const propsMax = getStartOfDay(props.max);
4014
- const hasSelectedChanged = +state.selectedDate !== +propsSelected;
4015
- const hasMinChanged = +state.min !== +propsMin;
4016
- const hasMaxChanged = +state.max !== +propsMax;
3774
+ const hasSelectedChanged = state.selectedDate?.getTime() !== propsSelected?.getTime();
3775
+ const hasMinChanged = state.min?.getTime() !== propsMin?.getTime();
3776
+ const hasMaxChanged = state.max?.getTime() !== propsMax?.getTime();
4017
3777
  if (hasSelectedChanged || hasMinChanged || hasMaxChanged) {
4018
3778
  const selectedDate = hasSelectedChanged ? propsSelected : state.selectedDate;
4019
3779
  const min = hasMinChanged ? propsMin : state.min;
4020
3780
  const max = hasMaxChanged ? propsMax : state.max;
4021
- // make sure that selected date is within allowed range
4022
- if (!isWithinRange(selectedDate, min, max)) {
3781
+ if (selectedDate && !isWithinRange(selectedDate, min, max)) {
4023
3782
  props.onChange(moveToWithinRange(selectedDate, min, max));
4024
3783
  return null;
4025
3784
  }
4026
- const viewMonth = (selectedDate || new Date()).getMonth();
4027
- const viewYear = (selectedDate || new Date()).getFullYear();
3785
+ const viewDateThatIsWithinRange = selectedDate || (min || max) && moveToWithinRange(new Date(), min, max) || new Date();
3786
+ const viewMonth = viewDateThatIsWithinRange.getMonth();
3787
+ const viewYear = viewDateThatIsWithinRange.getFullYear();
4028
3788
  return {
4029
3789
  selectedDate,
4030
3790
  min,
@@ -4036,12 +3796,12 @@ class DateLookup extends React.PureComponent {
4036
3796
  return null;
4037
3797
  }
4038
3798
  componentDidUpdate(previousProps) {
4039
- if (+this.props.value !== +previousProps.value && this.state.open) {
3799
+ if (this.props.value?.getTime() !== previousProps.value?.getTime() && this.state.open) {
4040
3800
  this.focusOn('.active');
4041
3801
  }
4042
- this.mediaQuery = window.matchMedia(`(max-width: ${exports.Breakpoint.SMALL}px)`);
3802
+ const mediaQuery = window.matchMedia(`(max-width: ${exports.Breakpoint.SMALL}px)`);
4043
3803
  this.setState({
4044
- isMobile: this.mediaQuery.matches
3804
+ isMobile: mediaQuery.matches
4045
3805
  });
4046
3806
  }
4047
3807
  componentWillUnmount() {
@@ -4054,7 +3814,7 @@ class DateLookup extends React.PureComponent {
4054
3814
  } = this.props;
4055
3815
  this.setState({
4056
3816
  open: true,
4057
- mode: MODE.DAY
3817
+ mode: 'day'
4058
3818
  });
4059
3819
  if (onFocus) {
4060
3820
  onFocus();
@@ -4143,17 +3903,19 @@ class DateLookup extends React.PureComponent {
4143
3903
  }
4144
3904
  let date;
4145
3905
  if (selectedDate) {
4146
- date = new Date(mode === MODE.YEAR ? selectedDate.getFullYear() + yearsToAdd : selectedDate.getFullYear(), mode === MODE.MONTH ? selectedDate.getMonth() + monthsToAdd : selectedDate.getMonth(), mode === MODE.DAY ? selectedDate.getDate() + daysToAdd : selectedDate.getDate());
3906
+ date = new Date(mode === 'year' ? selectedDate.getFullYear() + yearsToAdd : selectedDate.getFullYear(), mode === 'month' ? selectedDate.getMonth() + monthsToAdd : selectedDate.getMonth(), mode === 'day' ? selectedDate.getDate() + daysToAdd : selectedDate.getDate());
4147
3907
  } else {
4148
3908
  date = getStartOfDay(new Date());
4149
3909
  }
4150
- date = moveToWithinRange(date, min, max);
4151
- if (+date !== +selectedDate) {
3910
+ if (date) {
3911
+ date = moveToWithinRange(date, min, max);
3912
+ }
3913
+ if (date?.getTime() !== selectedDate?.getTime()) {
4152
3914
  this.props.onChange(date);
4153
3915
  }
4154
3916
  };
4155
3917
  focusOn = (preferredElement, fallbackElement) => {
4156
- const element = this.element.current.querySelector(preferredElement);
3918
+ const element = this.element.current?.querySelector(preferredElement);
4157
3919
  if (element) {
4158
3920
  element.focus();
4159
3921
  } else if (fallbackElement) {
@@ -4167,9 +3929,9 @@ class DateLookup extends React.PureComponent {
4167
3929
  this.focusOn('.active', '.today');
4168
3930
  });
4169
3931
  };
4170
- switchToDays = () => this.switchMode(MODE.DAY);
4171
- switchToMonths = () => this.switchMode(MODE.MONTH);
4172
- switchToYears = () => this.switchMode(MODE.YEAR);
3932
+ switchToDays = () => this.switchMode('day');
3933
+ switchToMonths = () => this.switchMode('month');
3934
+ switchToYears = () => this.switchMode('year');
4173
3935
  handleSelectedDateUpdate = selectedDate => {
4174
3936
  this.setState({
4175
3937
  selectedDate
@@ -4206,31 +3968,31 @@ class DateLookup extends React.PureComponent {
4206
3968
  className: classNames__default.default({
4207
3969
  'p-a-1': !isMobile
4208
3970
  }),
4209
- children: [mode === MODE.DAY && /*#__PURE__*/jsxRuntime.jsx(DayCalendar$1, {
4210
- selectedDate,
4211
- min,
4212
- max,
4213
- viewMonth,
4214
- viewYear,
4215
- monthFormat,
3971
+ children: [mode === 'day' && /*#__PURE__*/jsxRuntime.jsx(DayCalendar$1, {
3972
+ selectedDate: selectedDate,
3973
+ min: min,
3974
+ max: max,
3975
+ viewMonth: viewMonth,
3976
+ viewYear: viewYear,
3977
+ monthFormat: monthFormat,
4216
3978
  onSelect: this.handleSelectedDateUpdate,
4217
3979
  onLabelClick: this.switchToYears,
4218
3980
  onViewDateUpdate: this.handleViewDateUpdate
4219
- }), mode === MODE.MONTH && /*#__PURE__*/jsxRuntime.jsx(MonthCalendar$1, {
4220
- selectedDate,
4221
- min,
4222
- max,
4223
- viewYear,
4224
- placeholder,
3981
+ }), mode === 'month' && /*#__PURE__*/jsxRuntime.jsx(MonthCalendar$1, {
3982
+ selectedDate: selectedDate,
3983
+ min: min,
3984
+ max: max,
3985
+ viewYear: viewYear,
3986
+ placeholder: placeholder,
4225
3987
  onSelect: this.switchToDays,
4226
3988
  onLabelClick: this.switchToYears,
4227
3989
  onViewDateUpdate: this.handleViewDateUpdate
4228
- }), mode === MODE.YEAR && /*#__PURE__*/jsxRuntime.jsx(YearCalendar$1, {
4229
- selectedDate,
4230
- min,
4231
- max,
4232
- viewYear,
4233
- placeholder,
3990
+ }), mode === 'year' && /*#__PURE__*/jsxRuntime.jsx(YearCalendar$1, {
3991
+ selectedDate: selectedDate,
3992
+ min: min,
3993
+ max: max,
3994
+ viewYear: viewYear,
3995
+ placeholder: placeholder,
4234
3996
  onSelect: this.switchToMonths,
4235
3997
  onViewDateUpdate: this.handleViewDateUpdate
4236
3998
  })]
@@ -4256,21 +4018,20 @@ class DateLookup extends React.PureComponent {
4256
4018
  value
4257
4019
  } = this.props;
4258
4020
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
4259
- // eslint-disable-line jsx-a11y/no-static-element-interactions
4260
4021
  ref: this.element,
4261
4022
  id: this.props.id,
4262
4023
  "aria-labelledby": ariaLabelledBy,
4263
4024
  className: "input-group",
4264
4025
  onKeyDown: this.handleKeyDown,
4265
- children: [/*#__PURE__*/jsxRuntime.jsx(DateTrigger$1, {
4266
- selectedDate,
4267
- size,
4268
- placeholder,
4269
- label,
4270
- monthFormat,
4271
- disabled,
4026
+ children: [/*#__PURE__*/jsxRuntime.jsx(DateTrigger, {
4027
+ selectedDate: selectedDate,
4028
+ size: size,
4029
+ placeholder: placeholder,
4030
+ label: label,
4031
+ monthFormat: monthFormat,
4032
+ disabled: disabled || false,
4272
4033
  onClick: this.open,
4273
- onClear: !disabled && clearable && value ? this.handleClear : null
4034
+ onClear: !disabled && clearable && value ? this.handleClear : undefined
4274
4035
  }), /*#__PURE__*/jsxRuntime.jsx(ResponsivePanel$1, {
4275
4036
  anchorRef: this.element,
4276
4037
  open: open,
@@ -4282,36 +4043,6 @@ class DateLookup extends React.PureComponent {
4282
4043
  });
4283
4044
  }
4284
4045
  }
4285
- DateLookup.propTypes = {
4286
- id: PropTypes__default.default.string,
4287
- value: PropTypes__default.default.instanceOf(Date),
4288
- min: PropTypes__default.default.instanceOf(Date),
4289
- max: PropTypes__default.default.instanceOf(Date),
4290
- size: PropTypes__default.default.oneOf(['sm', 'md', 'lg']),
4291
- placeholder: PropTypes__default.default.string,
4292
- label: PropTypes__default.default.string,
4293
- 'aria-labelledby': PropTypes__default.default.string,
4294
- monthFormat: PropTypes__default.default.oneOf(['long', 'short']),
4295
- disabled: PropTypes__default.default.bool,
4296
- onChange: PropTypes__default.default.func.isRequired,
4297
- onFocus: PropTypes__default.default.func,
4298
- onBlur: PropTypes__default.default.func,
4299
- clearable: PropTypes__default.default.bool
4300
- };
4301
- DateLookup.defaultProps = {
4302
- value: null,
4303
- min: null,
4304
- max: null,
4305
- size: exports.Size.MEDIUM,
4306
- placeholder: '',
4307
- label: '',
4308
- monthFormat: exports.MonthFormat.LONG,
4309
- disabled: false,
4310
- onFocus: null,
4311
- onBlur: null,
4312
- clearable: false
4313
- };
4314
- var DateLookup$1 = DateLookup;
4315
4046
 
4316
4047
  const NavigationOption = /*#__PURE__*/React.forwardRef(({
4317
4048
  as: component = 'button',
@@ -5898,7 +5629,7 @@ function Popover$1({
5898
5629
  const resolvedPlacement = resolvePlacement(preferredPlacement);
5899
5630
  React.useEffect(() => {
5900
5631
  if (resolvedPlacement !== preferredPlacement) {
5901
- logActionRequired$1(`Popover has deprecated ${preferredPlacement} value for the 'preferredPlacement' prop. Please use ${resolvedPlacement} instead.`);
5632
+ logActionRequired(`Popover has deprecated ${preferredPlacement} value for the 'preferredPlacement' prop. Please use ${resolvedPlacement} instead.`);
5902
5633
  }
5903
5634
  }, [preferredPlacement, resolvedPlacement]);
5904
5635
  const anchorReference = React.useRef(null);
@@ -6003,49 +5734,22 @@ const Info = ({
6003
5734
  });
6004
5735
  };
6005
5736
 
6006
- const typeClassMap = {
6007
- [exports.Sentiment.ERROR]: 'danger',
6008
- [exports.Sentiment.NEGATIVE]: 'danger'
6009
- };
6010
- const InlineAlert = ({
5737
+ function InlineAlert({
6011
5738
  id,
6012
- type = exports.Sentiment.NEUTRAL,
5739
+ type = 'neutral',
6013
5740
  className,
6014
5741
  children
6015
- }) => {
6016
- const {
6017
- isModern
6018
- } = componentsTheming.useTheme();
6019
- const typeClass = `alert-${typeClassMap[type] || type}`;
6020
- if (isModern) {
6021
- return /*#__PURE__*/jsxRuntime.jsxs("div", {
6022
- role: "alert",
6023
- id: id,
6024
- className: classNames__default.default('alert alert-detach', typeClass, className),
6025
- children: [(type === 'error' || type === 'negative') && /*#__PURE__*/jsxRuntime.jsx(icons.AlertCircle, {}), /*#__PURE__*/jsxRuntime.jsx("div", {
6026
- children: children
6027
- })]
6028
- });
6029
- }
6030
- const getAlertContents = ({
6031
- children,
6032
- className
6033
- }) => {
6034
- return /*#__PURE__*/jsxRuntime.jsx("div", {
6035
- role: "alert",
6036
- id: id,
6037
- className: classNames__default.default('alert alert-detach p-x-2 p-y-1', typeClass, className),
5742
+ }) {
5743
+ const danger = type === 'negative' || type === 'error';
5744
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
5745
+ role: "alert",
5746
+ id: id,
5747
+ className: classNames__default.default('alert alert-detach', `alert-${danger ? 'danger' : type}`, className),
5748
+ children: [danger && /*#__PURE__*/jsxRuntime.jsx(icons.AlertCircle, {}), /*#__PURE__*/jsxRuntime.jsx("div", {
6038
5749
  children: children
6039
- });
6040
- };
6041
- const AlertWithArrow = withArrow(getAlertContents, exports.AlertArrowPosition.TOP_LEFT);
6042
- return /*#__PURE__*/jsxRuntime.jsx(AlertWithArrow, {
6043
- id,
6044
- type,
6045
- className,
6046
- children
5750
+ })]
6047
5751
  });
6048
- };
5752
+ }
6049
5753
 
6050
5754
  /*
6051
5755
  * Inspired by:
@@ -6144,9 +5848,9 @@ function InputAddon({
6144
5848
  const ref = React.useRef(null);
6145
5849
  useResizeObserver(ref, entry => {
6146
5850
  // TODO: Remove fallback once most browsers support `borderBoxSize`
6147
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
6148
- if (entry.borderBoxSize != null) {
6149
- setInputPadding(entry.borderBoxSize[0].inlineSize);
5851
+ const inlineSize = entry.borderBoxSize?.[0]?.inlineSize;
5852
+ if (inlineSize != null) {
5853
+ setInputPadding(inlineSize);
6150
5854
  } else {
6151
5855
  const targetStyle = getComputedStyle(entry.target);
6152
5856
  setInputPadding(entry.contentRect.width + Number.parseFloat(targetStyle.paddingInlineStart) + Number.parseFloat(targetStyle.paddingInlineEnd));
@@ -6293,65 +5997,61 @@ function BottomSheet({
6293
5997
  theme: "personal",
6294
5998
  screenMode: theme === 'personal' ? screenMode : 'light',
6295
5999
  isNotRootProvider: true,
6296
- children: /*#__PURE__*/jsxRuntime.jsx(react$1.Transition, {
6000
+ children: /*#__PURE__*/jsxRuntime.jsxs(react$1.Transition, {
6297
6001
  show: open,
6298
6002
  className: "np-bottom-sheet-v2-container",
6299
6003
  beforeEnter: () => {
6300
6004
  setFloatingKey(prev => prev + 1);
6301
6005
  },
6302
6006
  afterLeave: onCloseEnd,
6303
- children: /*#__PURE__*/jsxRuntime.jsxs(FocusBoundary, {
6304
- children: [/*#__PURE__*/jsxRuntime.jsx(react$1.Transition.Child, {
6305
- enter: "np-bottom-sheet-v2-backdrop-container--enter",
6306
- enterFrom: "np-bottom-sheet-v2-backdrop-container--enter-from",
6307
- leave: "np-bottom-sheet-v2-backdrop-container--leave",
6308
- leaveTo: "np-bottom-sheet-v2-backdrop-container--leave-to",
6309
- children: /*#__PURE__*/jsxRuntime.jsx("div", {
6310
- className: "np-bottom-sheet-v2-backdrop"
6311
- })
6312
- }), /*#__PURE__*/jsxRuntime.jsx("div", {
6313
- className: "np-bottom-sheet-v2",
6314
- children: /*#__PURE__*/jsxRuntime.jsx(react$1.Transition.Child, {
6315
- className: "np-bottom-sheet-v2-content",
6316
- enter: "np-bottom-sheet-v2-content--enter",
6317
- enterFrom: "np-bottom-sheet-v2-content--enter-from",
6318
- leave: "np-bottom-sheet-v2-content--leave",
6319
- leaveTo: "np-bottom-sheet-v2-content--leave-to",
6320
- children: /*#__PURE__*/jsxRuntime.jsx(react.FloatingFocusManager, {
6321
- context: context,
6322
- initialFocus: initialFocusRef,
6323
- guards: false,
6324
- modal: false,
6325
- children: /*#__PURE__*/jsxRuntime.jsxs("div", {
6326
- // Force inner state invalidation on open
6327
- ref: refs.setFloating,
6328
- className: "np-bottom-sheet-v2-content-inner-container",
6329
- ...getFloatingProps(),
6330
- children: [/*#__PURE__*/jsxRuntime.jsx("div", {
6331
- className: "np-bottom-sheet-v2-header",
6332
- children: /*#__PURE__*/jsxRuntime.jsx(CloseButton, {
6333
- size: exports.Size.SMALL,
6334
- onClick: () => {
6335
- onClose?.();
6336
- }
6337
- })
6338
- }), /*#__PURE__*/jsxRuntime.jsxs("div", {
6339
- className: classNames__default.default('np-bottom-sheet-v2-content-inner', title && 'np-bottom-sheet-v2-content-inner--has-title', {
6340
- 'np-bottom-sheet-v2-content-inner--padding-md': padding === 'md'
6341
- }),
6342
- children: [title ? /*#__PURE__*/jsxRuntime.jsx("h2", {
6343
- className: "np-bottom-sheet-v2-title np-text-title-body",
6344
- children: title
6345
- }) : null, /*#__PURE__*/jsxRuntime.jsx("div", {
6346
- className: "np-bottom-sheet-v2-body np-text-body-default",
6347
- children: children
6348
- })]
6007
+ children: [/*#__PURE__*/jsxRuntime.jsx(react$1.Transition.Child, {
6008
+ enter: "np-bottom-sheet-v2-backdrop-container--enter",
6009
+ enterFrom: "np-bottom-sheet-v2-backdrop-container--enter-from",
6010
+ leave: "np-bottom-sheet-v2-backdrop-container--leave",
6011
+ leaveTo: "np-bottom-sheet-v2-backdrop-container--leave-to",
6012
+ children: /*#__PURE__*/jsxRuntime.jsx("div", {
6013
+ className: "np-bottom-sheet-v2-backdrop"
6014
+ })
6015
+ }), /*#__PURE__*/jsxRuntime.jsx("div", {
6016
+ className: "np-bottom-sheet-v2",
6017
+ children: /*#__PURE__*/jsxRuntime.jsx(react$1.Transition.Child, {
6018
+ className: "np-bottom-sheet-v2-content",
6019
+ enter: "np-bottom-sheet-v2-content--enter",
6020
+ enterFrom: "np-bottom-sheet-v2-content--enter-from",
6021
+ leave: "np-bottom-sheet-v2-content--leave",
6022
+ leaveTo: "np-bottom-sheet-v2-content--leave-to",
6023
+ children: /*#__PURE__*/jsxRuntime.jsx(react.FloatingFocusManager, {
6024
+ context: context,
6025
+ initialFocus: initialFocusRef,
6026
+ children: /*#__PURE__*/jsxRuntime.jsxs("div", {
6027
+ // Force inner state invalidation on open
6028
+ ref: refs.setFloating,
6029
+ className: "np-bottom-sheet-v2-content-inner-container",
6030
+ ...getFloatingProps(),
6031
+ children: [/*#__PURE__*/jsxRuntime.jsx("div", {
6032
+ className: "np-bottom-sheet-v2-header",
6033
+ children: /*#__PURE__*/jsxRuntime.jsx(CloseButton, {
6034
+ size: exports.Size.SMALL,
6035
+ onClick: () => {
6036
+ onClose?.();
6037
+ }
6038
+ })
6039
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
6040
+ className: classNames__default.default('np-bottom-sheet-v2-content-inner', title && 'np-bottom-sheet-v2-content-inner--has-title', {
6041
+ 'np-bottom-sheet-v2-content-inner--padding-md': padding === 'md'
6042
+ }),
6043
+ children: [title ? /*#__PURE__*/jsxRuntime.jsx("h2", {
6044
+ className: "np-bottom-sheet-v2-title np-text-title-body",
6045
+ children: title
6046
+ }) : null, /*#__PURE__*/jsxRuntime.jsx("div", {
6047
+ className: "np-bottom-sheet-v2-body np-text-body-default",
6048
+ children: children
6349
6049
  })]
6350
- }, floatingKey)
6351
- })
6050
+ })]
6051
+ }, floatingKey)
6352
6052
  })
6353
- })]
6354
- })
6053
+ })
6054
+ })]
6355
6055
  })
6356
6056
  })
6357
6057
  })]
@@ -6449,36 +6149,32 @@ function Popover({
6449
6149
  setFloatingKey(prev => prev + 1);
6450
6150
  },
6451
6151
  afterLeave: onCloseEnd,
6452
- children: /*#__PURE__*/jsxRuntime.jsx(FocusBoundary, {
6453
- children: /*#__PURE__*/jsxRuntime.jsx(react.FloatingFocusManager, {
6454
- context: context,
6455
- guards: false,
6456
- modal: false,
6457
- children: /*#__PURE__*/jsxRuntime.jsx("div", {
6458
- // Force inner state invalidation on open
6459
- ref: refs.setFloating,
6460
- className: classNames__default.default('np-popover-v2-container', {
6461
- 'np-popover-v2-container--size-md': size === 'md',
6462
- 'np-popover-v2-container--size-lg': size === 'lg'
6463
- })
6464
- // eslint-disable-next-line react/forbid-dom-props
6465
- ,
6466
- style: floatingStyles,
6467
- ...getFloatingProps(),
6468
- children: /*#__PURE__*/jsxRuntime.jsxs("div", {
6469
- className: classNames__default.default('np-popover-v2', title && 'np-popover-v2--has-title', {
6470
- 'np-popover-v2--padding-md': padding === 'md'
6471
- }),
6472
- children: [title ? /*#__PURE__*/jsxRuntime.jsx("h2", {
6473
- className: "np-popover-v2-title np-text-title-body",
6474
- children: title
6475
- }) : null, /*#__PURE__*/jsxRuntime.jsx("div", {
6476
- className: "np-popover-v2-content np-text-body-default",
6477
- children: children
6478
- })]
6479
- })
6480
- }, floatingKey)
6481
- })
6152
+ children: /*#__PURE__*/jsxRuntime.jsx(react.FloatingFocusManager, {
6153
+ context: context,
6154
+ children: /*#__PURE__*/jsxRuntime.jsx("div", {
6155
+ // Force inner state invalidation on open
6156
+ ref: refs.setFloating,
6157
+ className: classNames__default.default('np-popover-v2-container', {
6158
+ 'np-popover-v2-container--size-md': size === 'md',
6159
+ 'np-popover-v2-container--size-lg': size === 'lg'
6160
+ })
6161
+ // eslint-disable-next-line react/forbid-dom-props
6162
+ ,
6163
+ style: floatingStyles,
6164
+ ...getFloatingProps(),
6165
+ children: /*#__PURE__*/jsxRuntime.jsxs("div", {
6166
+ className: classNames__default.default('np-popover-v2', title && 'np-popover-v2--has-title', {
6167
+ 'np-popover-v2--padding-md': padding === 'md'
6168
+ }),
6169
+ children: [title ? /*#__PURE__*/jsxRuntime.jsx("h2", {
6170
+ className: "np-popover-v2-title np-text-title-body",
6171
+ children: title
6172
+ }) : null, /*#__PURE__*/jsxRuntime.jsx("div", {
6173
+ className: "np-popover-v2-content np-text-body-default",
6174
+ children: children
6175
+ })]
6176
+ })
6177
+ }, floatingKey)
6482
6178
  })
6483
6179
  })
6484
6180
  })
@@ -6857,6 +6553,7 @@ function SelectInputOptions({
6857
6553
  })
6858
6554
  }) : null, /*#__PURE__*/jsxRuntime.jsxs("section", {
6859
6555
  ref: listboxContainerRef,
6556
+ tabIndex: -1,
6860
6557
  className: classNames__default.default('np-select-input-listbox-container', items.some(item => item.type === 'group') && 'np-select-input-listbox-container--has-group'),
6861
6558
  children: [resultsEmpty ? /*#__PURE__*/jsxRuntime.jsxs("div", {
6862
6559
  id: statusId,
@@ -14866,10 +14563,10 @@ var th = {
14866
14563
  "neptune.ClearButton.ariaLabel": "ล้าง",
14867
14564
  "neptune.CloseButton.ariaLabel": "ปิด",
14868
14565
  "neptune.DateInput.day.label": "วัน",
14869
- "neptune.DateInput.day.placeholder": "DD",
14566
+ "neptune.DateInput.day.placeholder": "วัน",
14870
14567
  "neptune.DateInput.month.label": "เดือน",
14871
14568
  "neptune.DateInput.year.label": "ปี",
14872
- "neptune.DateInput.year.placeholder": "YYYY",
14569
+ "neptune.DateInput.year.placeholder": "ปี",
14873
14570
  "neptune.DateLookup.day": "วัน",
14874
14571
  "neptune.DateLookup.goTo20YearView": "ไปที่มุมมอง 20 ปี",
14875
14572
  "neptune.DateLookup.month": "เดือน",
@@ -15174,7 +14871,7 @@ const translations = {
15174
14871
  exports.Accordion = Accordion;
15175
14872
  exports.ActionButton = ActionButton;
15176
14873
  exports.ActionOption = ActionOption;
15177
- exports.Alert = Alert$1;
14874
+ exports.Alert = Alert;
15178
14875
  exports.Avatar = Avatar;
15179
14876
  exports.AvatarWrapper = AvatarWrapper;
15180
14877
  exports.Badge = Badge;
@@ -15194,7 +14891,7 @@ exports.CriticalCommsBanner = CriticalCommsBanner;
15194
14891
  exports.DEFAULT_LANG = DEFAULT_LANG;
15195
14892
  exports.DEFAULT_LOCALE = DEFAULT_LOCALE;
15196
14893
  exports.DateInput = DateInput;
15197
- exports.DateLookup = DateLookup$1;
14894
+ exports.DateLookup = DateLookup;
15198
14895
  exports.Decision = Decision;
15199
14896
  exports.DefinitionList = DefinitionList$1;
15200
14897
  exports.Dimmer = Dimmer$1;