@transferwise/components 45.0.1 → 45.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 (103) hide show
  1. package/LICENSE.md +4 -4
  2. package/README.md +3 -0
  3. package/build/es/no-polyfill/actionOption/ActionOption.story.js +1 -1
  4. package/build/es/no-polyfill/avatarWrapper/AvatarWrapper.js +1 -2
  5. package/build/es/no-polyfill/button/Button.js +1 -1
  6. package/build/es/no-polyfill/checkboxButton/CheckboxButton.story.js +1 -1
  7. package/build/es/no-polyfill/checkboxOption/CheckboxOption.story.js +1 -1
  8. package/build/es/no-polyfill/chips/Chips.story.js +1 -1
  9. package/build/es/no-polyfill/common/bottomSheet/BottomSheet.js +1 -21
  10. package/build/es/no-polyfill/common/hooks/useHasIntersected/useHasIntersected.js +1 -2
  11. package/build/es/no-polyfill/common/requirements.js +1 -19
  12. package/build/es/no-polyfill/dateInput/DateInput.js +3 -9
  13. package/build/es/no-polyfill/index.js +1 -1
  14. package/build/es/no-polyfill/inputs/Input.js +1 -0
  15. package/build/es/no-polyfill/inputs/TextArea.js +1 -0
  16. package/build/es/no-polyfill/inputs/_common.js +2 -0
  17. package/build/es/no-polyfill/modal/Modal.js +1 -2
  18. package/build/es/no-polyfill/moneyInput/MoneyInput.js +1 -1
  19. package/build/es/no-polyfill/phoneNumberInput/PhoneNumberInput.js +1 -1
  20. package/build/es/no-polyfill/progressBar/ProgressBar.story.js +1 -1
  21. package/build/es/no-polyfill/provider/Provider.spec.js +1 -2
  22. package/build/es/no-polyfill/select/searchBox/SearchBox.js +1 -1
  23. package/build/es/no-polyfill/slidingPanel/SlidingPanel.js +1 -1
  24. package/build/es/no-polyfill/tabs/Tabs.js +1 -6
  25. package/build/es/no-polyfill/typeahead/typeaheadInput/TypeaheadInput.js +1 -1
  26. package/build/es/no-polyfill/uploadInput/UploadInput.story.js +1 -1
  27. package/build/es/no-polyfill/utils.js +0 -0
  28. package/build/es/no-polyfill/withDisplayFormat/WithDisplayFormat.js +1 -2
  29. package/build/es/polyfill/actionOption/ActionOption.story.js +1 -1
  30. package/build/es/polyfill/avatarWrapper/AvatarWrapper.js +1 -2
  31. package/build/es/polyfill/button/Button.js +1 -1
  32. package/build/es/polyfill/checkboxButton/CheckboxButton.story.js +1 -1
  33. package/build/es/polyfill/checkboxOption/CheckboxOption.story.js +1 -1
  34. package/build/es/polyfill/chips/Chips.story.js +1 -1
  35. package/build/es/polyfill/common/bottomSheet/BottomSheet.js +1 -21
  36. package/build/es/polyfill/common/hooks/useHasIntersected/useHasIntersected.js +1 -2
  37. package/build/es/polyfill/common/requirements.js +1 -19
  38. package/build/es/polyfill/dateInput/DateInput.js +3 -9
  39. package/build/es/polyfill/index.js +1 -1
  40. package/build/es/polyfill/inputs/Input.js +1 -0
  41. package/build/es/polyfill/inputs/TextArea.js +1 -0
  42. package/build/es/polyfill/inputs/_common.js +2 -0
  43. package/build/es/polyfill/modal/Modal.js +1 -2
  44. package/build/es/polyfill/moneyInput/MoneyInput.js +1 -1
  45. package/build/es/polyfill/phoneNumberInput/PhoneNumberInput.js +1 -1
  46. package/build/es/polyfill/progressBar/ProgressBar.story.js +1 -1
  47. package/build/es/polyfill/provider/Provider.spec.js +1 -2
  48. package/build/es/polyfill/select/searchBox/SearchBox.js +1 -1
  49. package/build/es/polyfill/slidingPanel/SlidingPanel.js +1 -1
  50. package/build/es/polyfill/tabs/Tabs.js +1 -6
  51. package/build/es/polyfill/typeahead/typeaheadInput/TypeaheadInput.js +1 -1
  52. package/build/es/polyfill/uploadInput/UploadInput.story.js +1 -1
  53. package/build/es/polyfill/utils.js +0 -0
  54. package/build/es/polyfill/withDisplayFormat/WithDisplayFormat.js +1 -2
  55. package/build/main.css +1 -1
  56. package/build/styles/inputs/Input.css +1 -0
  57. package/build/styles/inputs/TextArea.css +1 -0
  58. package/build/styles/main.css +1 -1
  59. package/build/types/accordion/AccordionItem/AccordionItem.d.ts +8 -9
  60. package/build/types/actionButton/ActionButton.story.d.ts +7 -3
  61. package/build/types/actionOption/ActionOption.story.d.ts +4 -13
  62. package/build/types/alert/inlineMarkdown/InlineMarkdown.d.ts +2 -3
  63. package/build/types/alert/withArrow/withArrow.d.ts +1 -2
  64. package/build/types/checkboxButton/CheckboxButton.story.d.ts +4 -2
  65. package/build/types/checkboxOption/CheckboxOption.story.d.ts +4 -5
  66. package/build/types/chips/Chips.story.d.ts +9 -14
  67. package/build/types/common/RadioButton/RadioButton.d.ts +7 -8
  68. package/build/types/dateLookup/dateHeader/DateHeader.d.ts +4 -5
  69. package/build/types/dateLookup/dateTrigger/DateTrigger.d.ts +8 -9
  70. package/build/types/dateLookup/monthCalendar/table/MonthCalendarTable.d.ts +6 -7
  71. package/build/types/dateLookup/tableLink/TableLink.d.ts +8 -9
  72. package/build/types/dateLookup/yearCalendar/YearCalendar.d.ts +7 -8
  73. package/build/types/dateLookup/yearCalendar/table/YearCalendarTable.d.ts +6 -7
  74. package/build/types/dynamicFieldDefinitionList/FormattedValue/FormattedValue.d.ts +2 -16
  75. package/build/types/flowNavigation/animatedLabel/AnimatedLabel.d.ts +3 -4
  76. package/build/types/flowNavigation/backButton/BackButton.d.ts +3 -4
  77. package/build/types/index.d.ts +4 -0
  78. package/build/types/inputs/Input.d.ts +13 -0
  79. package/build/types/inputs/TextArea.d.ts +10 -0
  80. package/build/types/inputs/_common.d.ts +5 -0
  81. package/build/types/modal/Modal.story.d.ts +3 -2
  82. package/build/types/progressBar/ProgressBar.story.d.ts +3 -3
  83. package/build/types/provider/Provider.story.d.ts +2 -6
  84. package/build/types/select/searchBox/SearchBox.d.ts +1 -1
  85. package/build/types/tabs/TabList.d.ts +1 -2
  86. package/build/types/tabs/TabPanel.d.ts +4 -7
  87. package/build/types/test-utils/GlobalsDecorator.d.ts +4 -5
  88. package/build/types/test-utils/index.d.ts +1 -1
  89. package/build/types/tile/Tile.d.ts +9 -10
  90. package/build/types/tooltip/Tooltip.story.d.ts +2 -1
  91. package/build/types/typeahead/typeaheadInput/TypeaheadInput.d.ts +15 -16
  92. package/build/types/typeahead/typeaheadOption/TypeaheadOption.d.ts +4 -9
  93. package/build/types/upload/steps/completeStep/completeStep.d.ts +9 -10
  94. package/build/types/upload/steps/mediaUploadStep/mediaUploadStep.d.ts +8 -9
  95. package/build/types/upload/steps/processingStep/processingStep.d.ts +8 -9
  96. package/build/types/upload/steps/uploadImageStep/uploadImageStep.d.ts +8 -9
  97. package/build/types/uploadInput/UploadInput.story.d.ts +20 -37
  98. package/build/types/utils.d.ts +1 -0
  99. package/build/types/withDisplayFormat/WithDisplayFormat.d.ts +18 -19
  100. package/build/umd/no-polyfill/main.js +1 -1
  101. package/build/umd/polyfill/main.js +1 -1
  102. package/package.json +65 -33
  103. package/upgrades/2021-04-v35-36-typescript-support.js +1 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transferwise/components",
3
- "version": "45.0.1",
3
+ "version": "45.1.0",
4
4
  "description": "Neptune React components",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./build/umd/polyfill/main.js",
@@ -20,30 +20,6 @@
20
20
  "fullname": "transferwise/neptune",
21
21
  "url": "git+https://github.com/transferwise/neptune-web.git"
22
22
  },
23
- "scripts": {
24
- "dev": "npm-run-all --parallel dev:*",
25
- "dev:watch-less": "gulp watchLess --dest=src",
26
- "dev:storybook": "storybook dev -p 3001",
27
- "dev:translations": "npx npm-watch",
28
- "build": "npm-run-all build:*",
29
- "build:clean": "rm -rf lib build",
30
- "build:crowdin-source-file": "formatjs extract 'src/**/*.messages.+(js|ts|tsx)' --out-file src/i18n/en.json --format simple && prettier --find-config-path --write src/i18n/*.json",
31
- "build:compile-css": "gulp compileLess --dest=src",
32
- "build:es": "NODE_ENV=es babel src --extensions '.tsx,.js,.ts' -d build/es/polyfill --ignore '**/*.spec.js','**/*.story.js','**/__mocks__','**/test-utils'",
33
- "build:es-nopolyfill": "NODE_ENV=es-nopolyfill babel src --extensions '.tsx,.js,.ts' -d build/es/no-polyfill --ignore '**/*.spec.js','**/*.story.js','**/__mocks__','**/test-utils'",
34
- "build:umd": "NODE_ENV=umd rollup -c",
35
- "build:umd-nopolyfill": "NODE_ENV=umd-nopolyfill rollup -c",
36
- "build:generate-types": "tsc && node ./scripts/generate-type-declarations.js",
37
- "build:copy-files": "cpx 'src/**/!(db)/*.{json,svg}' build/es/polyfill & cpx 'src/**/!(db)/*.{json,svg}' build/es/no-polyfill",
38
- "build:copy-css": "cpx 'src/main.css' build/ & cpx 'src/**/*.css' build/styles/",
39
- "build:copy-lang": "cpx 'src/i18n/*.json' build/i18n && cpx 'src/i18n/index.js' build/i18n",
40
- "docs": "yarn build",
41
- "test": "jest --env=jsdom --maxWorkers=4 --config=../../node_modules/@transferwise/test-config/jest.config.js",
42
- "test:watch": "jest --watch --env=jsdom --config=../../node_modules/@transferwise/test-config/jest.config.js",
43
- "lint": "jest --maxWorkers=4 --config ../../node_modules/@transferwise/test-config/test/jest.lint.js",
44
- "lint:fix": "eslint 'src/**/*.{js,ts,tsx}' --fix",
45
- "build-storybook": "storybook build"
46
- },
47
23
  "bin": {
48
24
  "neptune-upgrade-util": "scripts/neptune-upgrader.js"
49
25
  },
@@ -54,28 +30,53 @@
54
30
  "@rollup/plugin-image": "^3.0.1",
55
31
  "@rollup/plugin-json": "^4.0.3",
56
32
  "@rollup/plugin-node-resolve": "^7.1.3",
33
+ "@storybook/addon-a11y": "^7.0.6",
34
+ "@storybook/addon-actions": "^7.0.6",
35
+ "@storybook/addon-essentials": "^7.0.6",
36
+ "@storybook/addon-interactions": "^7.0.6",
37
+ "@storybook/addon-knobs": "^7.0.0",
38
+ "@storybook/addon-viewport": "^7.0.6",
39
+ "@storybook/addons": "^7.0.0",
40
+ "@storybook/api": "^7.0.0",
41
+ "@storybook/components": "^7.0.0",
42
+ "@storybook/core-events": "^7.0.0",
43
+ "@storybook/react": "^7.0.6",
44
+ "@storybook/react-webpack5": "^7.0.6",
45
+ "@storybook/testing-library": "^0.1.0",
46
+ "@storybook/theming": "^7.0.0",
47
+ "@testing-library/dom": "^7.21.4",
48
+ "@testing-library/jest-dom": "^5.14.1",
49
+ "@testing-library/react": "^12.0.0",
50
+ "@testing-library/react-hooks": "^8.0.0",
51
+ "@testing-library/user-event": "^13.2.1",
57
52
  "@transferwise/icons": "^3.2.3",
58
- "@transferwise/less-config": "^3.0.6",
59
- "@transferwise/neptune-css": "^14.3.45",
60
53
  "@transferwise/neptune-tokens": "^8.4.0",
61
- "@transferwise/test-config": "^5.0.3",
62
54
  "@types/jest": "^26.0.20",
63
55
  "@types/jscodeshift": "^0.11.0",
64
56
  "@types/node": "^14.14.31",
65
- "@types/react-transition-group": "4.4.2",
57
+ "@types/react-transition-group": "4.4.5",
58
+ "@types/testing-library__jest-dom": "^5.14.5",
66
59
  "@wise/art": "^2.0.1",
67
- "@wise/components-theming": "^0.7.4",
60
+ "@wojtekmaj/enzyme-adapter-react-17": "^0.6.3",
68
61
  "babel-plugin-inline-react-svg": "^2.0.1",
62
+ "enzyme": "^3.11.0",
69
63
  "html-loader": "^1.3.2",
64
+ "jest": "^27.0.6",
65
+ "jest-cli": "^27.0.6",
66
+ "jest-fetch-mock": "^3.0.3",
70
67
  "lodash.times": "^4.3.2",
71
68
  "npm-watch": "^0.11.0",
72
69
  "react-intl": "^5.10.0",
73
70
  "rollup": "^2.34.0",
74
- "rollup-plugin-uglify": "^6.0.4"
71
+ "rollup-plugin-uglify": "^6.0.4",
72
+ "storybook": "^7.0.6",
73
+ "@transferwise/less-config": "3.0.6",
74
+ "@transferwise/neptune-css": "14.3.48",
75
+ "@wise/components-theming": "0.7.5"
75
76
  },
76
77
  "peerDependencies": {
77
78
  "@transferwise/icons": "^3.2.3",
78
- "@transferwise/neptune-css": "^14.3.47",
79
+ "@transferwise/neptune-css": "^14.3.48",
79
80
  "@wise/art": "^2",
80
81
  "@wise/components-theming": "0.5 - 0.7",
81
82
  "currency-flags": "^4.0.2",
@@ -125,5 +126,36 @@
125
126
  },
126
127
  "publishConfig": {
127
128
  "access": "public"
129
+ },
130
+ "scripts": {
131
+ "dev": "npm-run-all --parallel dev:*",
132
+ "dev:watch-less": "gulp watchLess --dest=src",
133
+ "dev:translations": "npx npm-watch",
134
+ "sb:dev": "storybook dev -p 3001",
135
+ "sb:build": "storybook build",
136
+ "build-css": "gulp compileLess --dest=src",
137
+ "build": "npm-run-all build:*",
138
+ "build:clean": "rm -rf lib build",
139
+ "build:crowdin-source-file": "formatjs extract 'src/**/*.messages.+(js|ts|tsx)' --out-file src/i18n/en.json --format simple && prettier --find-config-path --write src/i18n/*.json",
140
+ "build:es": "NODE_ENV=es babel src --extensions '.tsx,.js,.ts' -d build/es/polyfill --ignore '**/*.spec.js','**/*.story.js','**/__mocks__','**/test-utils'",
141
+ "build:es-nopolyfill": "NODE_ENV=es-nopolyfill babel src --extensions '.tsx,.js,.ts' -d build/es/no-polyfill --ignore '**/*.spec.js','**/*.story.js','**/__mocks__','**/test-utils'",
142
+ "build:umd": "NODE_ENV=umd rollup -c",
143
+ "build:umd-nopolyfill": "NODE_ENV=umd-nopolyfill rollup -c",
144
+ "build:generate-types": "tsc && node ./scripts/generate-type-declarations.js",
145
+ "build:copy-files": "cpx 'src/**/!(db)/*.{json,svg}' build/es/polyfill & cpx 'src/**/!(db)/*.{json,svg}' build/es/no-polyfill",
146
+ "build:copy-css": "cpx 'src/main.css' build/ & cpx 'src/**/*.css' build/styles/",
147
+ "build:copy-lang": "cpx 'src/i18n/*.json' build/i18n && cpx 'src/i18n/index.js' build/i18n",
148
+ "docs": "pnpm build",
149
+ "test": "jest --env=jsdom --maxWorkers=4",
150
+ "test:watch": "jest --watch --env=jsdom",
151
+ "test:visual": "build-storybook && percy storybook ./storybook-static",
152
+ "lint": "pnpm run lint:check",
153
+ "lint:check": "npm-run-all --parallel lint:check:*",
154
+ "lint:check:format": "prettier --check --ignore-path ../../.prettierignore . || echo \"Prettier failed. Remove this to make this a failure\"",
155
+ "lint:check:js+ts": "eslint --ext .js,.jsx,.mjs,.ts,.tsx,.mts --ignore-path ../../.gitignore .",
156
+ "lint:check:types": "tsc --noEmit --emitDeclarationOnly false",
157
+ "lint:fix": "npm-run-all --serial lint:fix:*",
158
+ "lint:fix:format": "prettier --write --ignore-path ../../.prettierignore .",
159
+ "lint:fix:js+ts": "pnpm run lint:check:js+ts --fix"
128
160
  }
129
- }
161
+ }
@@ -254,6 +254,7 @@ export default function codemod(file, api, options) {
254
254
  },
255
255
  })
256
256
  .replaceWith(() => {
257
+ // eslint-disable-next-line unicorn/prevent-abbreviations -- this is a useless rule, and useless application of it
257
258
  const newProp = ButtonTypeBreakingChange.Type.includes(enumItemValue)
258
259
  ? 'Type'
259
260
  : 'ControlType';