@transferwise/components 0.0.0-experimental-85f289b → 0.0.0-experimental-c5b4f4d

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.
@@ -29,13 +29,13 @@
29
29
  "neptune.Upload.csButtonText": "Másik fájl feltöltése?",
30
30
  "neptune.Upload.csFailureText": "Feltöltés sikertelen. Kérünk, próbáld újra",
31
31
  "neptune.Upload.csSuccessText": "Feltöltés sikeres",
32
- "neptune.Upload.csTooLargeMessage": "Kérünk, olyan fájlt küldj el, amely kisebb mint {maxSize}MB",
32
+ "neptune.Upload.csTooLargeMessage": "Kérünk, {maxSize} MB-nál kisebb fájlt tölts fel",
33
33
  "neptune.Upload.csWrongTypeMessage": "Nem támogatott fájltípus. Kérünk, próbáld újra másik fájllal",
34
34
  "neptune.Upload.psButtonText": "Mégsem",
35
35
  "neptune.Upload.psProcessingText": "Feltöltés...",
36
36
  "neptune.Upload.usButtonText": "Vagy válaszd ki a fájlt",
37
37
  "neptune.Upload.usDropMessage": "Húzd ide a fájlokat a feltöltéshez",
38
- "neptune.Upload.usPlaceholder": "Húzz ide egy legfeljebb {maxSize} MB méretű fájlt",
38
+ "neptune.Upload.usPlaceholder": "Húzz ide egy {maxSize} MB-nál kisebb fájlt",
39
39
  "neptune.UploadButton.allFileTypes": "Összes fájltípus",
40
40
  "neptune.UploadButton.dropFiles": "Húzd a fájlokat ide a feltöltéshez",
41
41
  "neptune.UploadButton.instructions": "{fileTypes}, legfeljebb {size}MB",
@@ -2720,7 +2720,6 @@ const convertToLocalMidnight = date => {
2720
2720
  return new Date(utcDate.getUTCFullYear(), utcDate.getUTCMonth(), utcDate.getUTCDate());
2721
2721
  };
2722
2722
 
2723
- const MonthBeforeDay = new Set(['en-US', 'ja-JP']);
2724
2723
  const DateInput = ({
2725
2724
  'aria-labelledby': ariaLabelledBy,
2726
2725
  'aria-label': ariaLabel,
@@ -2745,6 +2744,8 @@ const DateInput = ({
2745
2744
  locale,
2746
2745
  formatMessage
2747
2746
  } = useIntl();
2747
+ const MDY = new Set(['en-US']);
2748
+ const YMD = new Set(['hu', 'hu-HU', 'zh-HK', 'zh-CN', 'ja', 'ja-JP']);
2748
2749
  const getDateObject = () => {
2749
2750
  if (value && isDateValid(value)) {
2750
2751
  return typeof value === 'string' ? convertToLocalMidnight(value) : value;
@@ -2910,7 +2911,64 @@ const DateInput = ({
2910
2911
  'col-sm-8': monthYearOnly,
2911
2912
  'col-sm-5': !monthYearOnly
2912
2913
  });
2913
- const monthBeforeDay = MonthBeforeDay.has(locale);
2914
+ const getMonth = () => {
2915
+ return /*#__PURE__*/jsx("div", {
2916
+ className: monthWidth,
2917
+ children: getSelectElement()
2918
+ });
2919
+ };
2920
+ const getDay = () => {
2921
+ return /*#__PURE__*/jsx("div", {
2922
+ className: "col-sm-3",
2923
+ children: /*#__PURE__*/jsxs("label", {
2924
+ children: [/*#__PURE__*/jsx("span", {
2925
+ className: "sr-only",
2926
+ children: dayLabel
2927
+ }), /*#__PURE__*/jsx("div", {
2928
+ className: `input-group input-group-${size}`,
2929
+ children: /*#__PURE__*/jsx(Input, {
2930
+ type: "text",
2931
+ inputMode: "numeric",
2932
+ pattern: "[0-9]*",
2933
+ name: "day",
2934
+ autoComplete: dayAutoComplete,
2935
+ value: day || '',
2936
+ placeholder: placeholders?.day,
2937
+ disabled: disabled,
2938
+ min: 1,
2939
+ onChange: event => handleDayChange(event)
2940
+ })
2941
+ })]
2942
+ })
2943
+ });
2944
+ };
2945
+ const getYear = () => {
2946
+ return /*#__PURE__*/jsx("div", {
2947
+ className: "col-sm-4",
2948
+ children: /*#__PURE__*/jsxs("label", {
2949
+ children: [/*#__PURE__*/jsx("span", {
2950
+ className: "sr-only",
2951
+ children: yearLabel
2952
+ }), /*#__PURE__*/jsx("div", {
2953
+ className: `input-group input-group-${size}`,
2954
+ children: /*#__PURE__*/jsx(Input, {
2955
+ type: "text",
2956
+ inputMode: "numeric",
2957
+ pattern: "[0-9]*",
2958
+ name: "year",
2959
+ autoComplete: yearAutoComplete,
2960
+ placeholder: placeholders?.year,
2961
+ value: year || '',
2962
+ disabled: disabled,
2963
+ min: 1,
2964
+ onChange: event => handleYearChange(event)
2965
+ })
2966
+ })]
2967
+ })
2968
+ });
2969
+ };
2970
+ const monthBeforeDay = MDY.has(locale);
2971
+ const yearFirst = YMD.has(locale);
2914
2972
  return /*#__PURE__*/jsx("div", {
2915
2973
  className: "tw-date",
2916
2974
  id: id,
@@ -2920,59 +2978,28 @@ const DateInput = ({
2920
2978
  ,
2921
2979
  onFocus: event => shouldPropagateOnFocus(event) ? onFocus && onFocus(event) : event.stopPropagation(),
2922
2980
  onBlur: event => shouldPropagateOnBlur(event) ? onBlur && onBlur(event) : event.stopPropagation(),
2923
- children: /*#__PURE__*/jsxs("div", {
2981
+ children: /*#__PURE__*/jsx("div", {
2924
2982
  className: "row",
2925
- children: [monthBeforeDay && /*#__PURE__*/jsx("div", {
2926
- className: monthWidth,
2927
- children: getSelectElement()
2928
- }), !monthYearOnly && /*#__PURE__*/jsx("div", {
2929
- className: "col-sm-3",
2930
- children: /*#__PURE__*/jsxs("label", {
2931
- children: [/*#__PURE__*/jsx("span", {
2932
- className: "sr-only",
2933
- children: dayLabel
2934
- }), /*#__PURE__*/jsx("div", {
2935
- className: `input-group input-group-${size}`,
2936
- children: /*#__PURE__*/jsx(Input, {
2937
- type: "text",
2938
- inputMode: "numeric",
2939
- pattern: "[0-9]*",
2940
- name: "day",
2941
- autoComplete: dayAutoComplete,
2942
- value: day || '',
2943
- placeholder: placeholders.day,
2944
- disabled: disabled,
2945
- min: 1,
2946
- onChange: event => handleDayChange(event)
2947
- })
2948
- })]
2949
- })
2950
- }), !monthBeforeDay && /*#__PURE__*/jsx("div", {
2951
- className: monthWidth,
2952
- children: getSelectElement()
2953
- }), /*#__PURE__*/jsx("div", {
2954
- className: "col-sm-4",
2955
- children: /*#__PURE__*/jsxs("label", {
2956
- children: [/*#__PURE__*/jsx("span", {
2957
- className: "sr-only",
2958
- children: yearLabel
2959
- }), /*#__PURE__*/jsx("div", {
2960
- className: `input-group input-group-${size}`,
2961
- children: /*#__PURE__*/jsx(Input, {
2962
- type: "text",
2963
- inputMode: "numeric",
2964
- pattern: "[0-9]*",
2965
- name: "year",
2966
- autoComplete: yearAutoComplete,
2967
- placeholder: placeholders.year,
2968
- value: year || '',
2969
- disabled: disabled,
2970
- min: 1,
2971
- onChange: event => handleYearChange(event)
2972
- })
2973
- })]
2974
- })
2975
- })]
2983
+ children: function returnOrderedInputs() {
2984
+ if (monthYearOnly) {
2985
+ return /*#__PURE__*/jsxs(Fragment, {
2986
+ children: [!yearFirst && getMonth(), getYear(), yearFirst && getMonth()]
2987
+ });
2988
+ }
2989
+ if (monthBeforeDay) {
2990
+ return /*#__PURE__*/jsxs(Fragment, {
2991
+ children: [getMonth(), getDay(), getYear()]
2992
+ });
2993
+ } else if (yearFirst) {
2994
+ return /*#__PURE__*/jsxs(Fragment, {
2995
+ children: [getYear(), getMonth(), getDay()]
2996
+ });
2997
+ } else {
2998
+ return /*#__PURE__*/jsxs(Fragment, {
2999
+ children: [getDay(), getMonth(), getYear()]
3000
+ });
3001
+ }
3002
+ }()
2976
3003
  })
2977
3004
  });
2978
3005
  };
@@ -14317,13 +14344,13 @@ var hu = {
14317
14344
  "neptune.Upload.csButtonText": "Másik fájl feltöltése?",
14318
14345
  "neptune.Upload.csFailureText": "Feltöltés sikertelen. Kérünk, próbáld újra",
14319
14346
  "neptune.Upload.csSuccessText": "Feltöltés sikeres",
14320
- "neptune.Upload.csTooLargeMessage": "Kérünk, olyan fájlt küldj el, amely kisebb mint {maxSize}MB",
14347
+ "neptune.Upload.csTooLargeMessage": "Kérünk, {maxSize} MB-nál kisebb fájlt tölts fel",
14321
14348
  "neptune.Upload.csWrongTypeMessage": "Nem támogatott fájltípus. Kérünk, próbáld újra másik fájllal",
14322
14349
  "neptune.Upload.psButtonText": "Mégsem",
14323
14350
  "neptune.Upload.psProcessingText": "Feltöltés...",
14324
14351
  "neptune.Upload.usButtonText": "Vagy válaszd ki a fájlt",
14325
14352
  "neptune.Upload.usDropMessage": "Húzd ide a fájlokat a feltöltéshez",
14326
- "neptune.Upload.usPlaceholder": "Húzz ide egy legfeljebb {maxSize} MB méretű fájlt",
14353
+ "neptune.Upload.usPlaceholder": "Húzz ide egy {maxSize} MB-nál kisebb fájlt",
14327
14354
  "neptune.UploadButton.allFileTypes": "Összes fájltípus",
14328
14355
  "neptune.UploadButton.dropFiles": "Húzd a fájlokat ide a feltöltéshez",
14329
14356
  "neptune.UploadButton.instructions": "{fileTypes}, legfeljebb {size}MB",
@@ -15043,6 +15070,7 @@ const translations = {
15043
15070
  cs,
15044
15071
  de,
15045
15072
  en,
15073
+ 'en-US': en,
15046
15074
  es,
15047
15075
  fr,
15048
15076
  hu,