@transferwise/components 40.12.14-beta-8d6269673c.4 → 40.12.14-inter.59
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.
- package/CHANGELOG.md +270 -0
- package/build/es/no-polyfill/accordion/AccordionItem/AccordionItem.js +1 -1
- package/build/es/no-polyfill/actionButton/ActionButton.js +1 -1
- package/build/es/no-polyfill/alert/Alert.js +1 -1
- package/build/es/no-polyfill/avatar/Avatar.js +1 -1
- package/build/es/no-polyfill/avatarWrapper/AvatarWrapper.js +1 -1
- package/build/es/no-polyfill/body/Body.js +1 -0
- package/build/es/no-polyfill/body/Body.spec.js +1 -0
- package/build/es/no-polyfill/body/Body.story.js +1 -0
- package/build/es/no-polyfill/body/index.js +1 -0
- package/build/es/no-polyfill/button/Button.js +5 -5
- package/build/es/no-polyfill/card/Card.js +1 -1
- package/build/es/no-polyfill/checkbox/Checkbox.js +1 -1
- package/build/es/no-polyfill/checkboxButton/CheckboxButton.js +1 -1
- package/build/es/no-polyfill/checkboxButton/CheckboxButton.spec.js +1 -0
- package/build/es/no-polyfill/checkboxButton/CheckboxButton.story.js +1 -0
- package/build/es/no-polyfill/checkboxOption/CheckboxOption.js +1 -1
- package/build/es/no-polyfill/checkboxOption/CheckboxOption.spec.js +1 -0
- package/build/es/no-polyfill/checkboxOption/CheckboxOption.story.js +1 -0
- package/build/es/no-polyfill/chips/Chip.js +1 -1
- package/build/es/no-polyfill/circularButton/CircularButton.js +1 -1
- package/build/es/no-polyfill/common/Option/Option.js +1 -1
- package/build/es/no-polyfill/common/closeButton/CloseButton.js +1 -1
- package/build/es/no-polyfill/common/domHelpers/index.js +1 -1
- package/build/es/no-polyfill/common/hooks/useTheme/useTheme.spec.js +1 -1
- package/build/es/no-polyfill/common/index.js +1 -1
- package/build/es/no-polyfill/common/propsValues/typography.js +1 -0
- package/build/es/no-polyfill/dateInput/DateInput.js +3 -3
- package/build/es/no-polyfill/dateLookup/dateHeader/DateHeader.js +1 -1
- package/build/es/no-polyfill/dateLookup/dateTrigger/DateTrigger.js +1 -1
- package/build/es/no-polyfill/dateLookup/dayCalendar/table/DayCalendarTable.js +1 -1
- package/build/es/no-polyfill/dateLookup/monthCalendar/table/MonthCalendarTable.js +1 -1
- package/build/es/no-polyfill/dateLookup/tableLink/TableLink.js +1 -1
- package/build/es/no-polyfill/definitionList/DefinitionList.js +1 -1
- package/build/es/no-polyfill/dimmer/Dimmer.js +1 -1
- package/build/es/no-polyfill/display/Display.story.js +1 -0
- package/build/es/no-polyfill/drawer/Drawer.js +1 -1
- package/build/es/no-polyfill/dynamicFieldDefinitionList/DynamicFieldDefinitionList.js +1 -1
- package/build/es/no-polyfill/dynamicFieldDefinitionList/FormattedValue/FormattedValue.js +1 -1
- package/build/es/no-polyfill/flowNavigation/animatedLabel/AnimatedLabel.js +1 -1
- package/build/es/no-polyfill/header/Header.js +2 -2
- package/build/es/no-polyfill/i18n/cs.json +2 -1
- package/build/es/no-polyfill/i18n/de.json +1 -0
- package/build/es/no-polyfill/i18n/es.json +2 -1
- package/build/es/no-polyfill/i18n/fr.json +1 -0
- package/build/es/no-polyfill/i18n/hu.json +1 -0
- package/build/es/no-polyfill/i18n/id.json +1 -0
- package/build/es/no-polyfill/i18n/it.json +2 -1
- package/build/es/no-polyfill/i18n/ja.json +1 -0
- package/build/es/no-polyfill/i18n/pl.json +1 -0
- package/build/es/no-polyfill/i18n/pt.json +2 -1
- package/build/es/no-polyfill/i18n/ro.json +1 -0
- package/build/es/no-polyfill/i18n/ru.json +1 -0
- package/build/es/no-polyfill/i18n/th.json +44 -0
- package/build/es/no-polyfill/i18n/tr.json +2 -1
- package/build/es/no-polyfill/i18n/uk.json +2 -1
- package/build/es/no-polyfill/i18n/zh-CN.json +44 -0
- package/build/es/no-polyfill/i18n/zh.json +1 -0
- package/build/es/no-polyfill/index.js +2 -2
- package/build/es/no-polyfill/info/Info.js +1 -1
- package/build/es/no-polyfill/instructionsList/InstructionsList.js +3 -3
- package/build/es/no-polyfill/link/Link.js +2 -3
- package/build/es/no-polyfill/link/Link.story.js +1 -1
- package/build/es/no-polyfill/modal/Modal.js +1 -1
- package/build/es/no-polyfill/moneyInput/MoneyInput.js +2 -2
- package/build/es/no-polyfill/nudge/Nudge.js +1 -1
- package/build/es/no-polyfill/phoneNumberInput/PhoneNumberInput.js +1 -1
- package/build/es/no-polyfill/popover/Popover.js +1 -1
- package/build/es/no-polyfill/progressBar/ProgressBar.js +1 -1
- package/build/es/no-polyfill/radio/Radio.js +1 -1
- package/build/es/no-polyfill/radioOption/RadioOption.js +1 -1
- package/build/es/no-polyfill/select/Select.js +6 -6
- package/build/es/no-polyfill/select/option/Option.js +1 -1
- package/build/es/no-polyfill/snackbar/Snackbar.js +1 -1
- package/build/es/no-polyfill/stepper/Stepper.js +1 -1
- package/build/es/no-polyfill/summary/Summary.js +1 -1
- package/build/es/no-polyfill/switch/Switch.js +1 -1
- package/build/es/no-polyfill/switchOption/SwitchOption.js +1 -1
- package/build/es/no-polyfill/tabs/Tab.js +1 -1
- package/build/es/no-polyfill/tile/Tile.js +1 -1
- package/build/es/no-polyfill/title/Title.js +1 -0
- package/build/es/no-polyfill/title/Title.spec.js +1 -0
- package/build/es/no-polyfill/title/Title.story.js +1 -0
- package/build/es/no-polyfill/title/index.js +1 -0
- package/build/es/no-polyfill/typeahead/typeaheadOption/TypeaheadOption.js +1 -1
- package/build/es/no-polyfill/upload/Upload.js +1 -1
- package/build/es/no-polyfill/upload/steps/completeStep/completeStep.js +1 -1
- package/build/es/no-polyfill/upload/steps/mediaUploadStep/mediaUploadStep.js +1 -1
- package/build/es/no-polyfill/upload/steps/processingStep/processingStep.js +1 -1
- package/build/es/no-polyfill/upload/steps/uploadImageStep/uploadImageStep.js +1 -1
- package/build/es/no-polyfill/uploadInput/uploadButton/UploadButton.js +1 -1
- package/build/es/no-polyfill/uploadInput/uploadItem/UploadItem.js +2 -2
- package/build/es/polyfill/accordion/AccordionItem/AccordionItem.js +1 -1
- package/build/es/polyfill/actionButton/ActionButton.js +1 -1
- package/build/es/polyfill/alert/Alert.js +1 -1
- package/build/es/polyfill/avatar/Avatar.js +1 -1
- package/build/es/polyfill/avatarWrapper/AvatarWrapper.js +1 -1
- package/build/es/polyfill/body/Body.js +1 -0
- package/build/es/polyfill/body/Body.spec.js +1 -0
- package/build/es/polyfill/body/Body.story.js +1 -0
- package/build/es/polyfill/body/index.js +1 -0
- package/build/es/polyfill/button/Button.js +5 -5
- package/build/es/polyfill/card/Card.js +1 -1
- package/build/es/polyfill/checkbox/Checkbox.js +1 -1
- package/build/es/polyfill/checkboxButton/CheckboxButton.js +1 -1
- package/build/es/polyfill/checkboxButton/CheckboxButton.spec.js +1 -0
- package/build/es/polyfill/checkboxButton/CheckboxButton.story.js +1 -0
- package/build/es/polyfill/checkboxOption/CheckboxOption.js +1 -1
- package/build/es/polyfill/checkboxOption/CheckboxOption.spec.js +1 -0
- package/build/es/polyfill/checkboxOption/CheckboxOption.story.js +1 -0
- package/build/es/polyfill/chips/Chip.js +1 -1
- package/build/es/polyfill/circularButton/CircularButton.js +1 -1
- package/build/es/polyfill/common/Option/Option.js +1 -1
- package/build/es/polyfill/common/closeButton/CloseButton.js +1 -1
- package/build/es/polyfill/common/domHelpers/index.js +1 -1
- package/build/es/polyfill/common/hooks/useTheme/useTheme.spec.js +1 -1
- package/build/es/polyfill/common/index.js +1 -1
- package/build/es/polyfill/common/propsValues/typography.js +1 -0
- package/build/es/polyfill/dateInput/DateInput.js +3 -3
- package/build/es/polyfill/dateLookup/dateHeader/DateHeader.js +1 -1
- package/build/es/polyfill/dateLookup/dateTrigger/DateTrigger.js +1 -1
- package/build/es/polyfill/dateLookup/dayCalendar/table/DayCalendarTable.js +1 -1
- package/build/es/polyfill/dateLookup/monthCalendar/table/MonthCalendarTable.js +1 -1
- package/build/es/polyfill/dateLookup/tableLink/TableLink.js +1 -1
- package/build/es/polyfill/definitionList/DefinitionList.js +1 -1
- package/build/es/polyfill/dimmer/Dimmer.js +1 -1
- package/build/es/polyfill/display/Display.story.js +1 -0
- package/build/es/polyfill/drawer/Drawer.js +1 -1
- package/build/es/polyfill/dynamicFieldDefinitionList/DynamicFieldDefinitionList.js +1 -1
- package/build/es/polyfill/dynamicFieldDefinitionList/FormattedValue/FormattedValue.js +1 -1
- package/build/es/polyfill/flowNavigation/animatedLabel/AnimatedLabel.js +1 -1
- package/build/es/polyfill/header/Header.js +2 -2
- package/build/es/polyfill/i18n/cs.json +2 -1
- package/build/es/polyfill/i18n/de.json +1 -0
- package/build/es/polyfill/i18n/es.json +2 -1
- package/build/es/polyfill/i18n/fr.json +1 -0
- package/build/es/polyfill/i18n/hu.json +1 -0
- package/build/es/polyfill/i18n/id.json +1 -0
- package/build/es/polyfill/i18n/it.json +2 -1
- package/build/es/polyfill/i18n/ja.json +1 -0
- package/build/es/polyfill/i18n/pl.json +1 -0
- package/build/es/polyfill/i18n/pt.json +2 -1
- package/build/es/polyfill/i18n/ro.json +1 -0
- package/build/es/polyfill/i18n/ru.json +1 -0
- package/build/es/polyfill/i18n/th.json +44 -0
- package/build/es/polyfill/i18n/tr.json +2 -1
- package/build/es/polyfill/i18n/uk.json +2 -1
- package/build/es/polyfill/i18n/zh-CN.json +44 -0
- package/build/es/polyfill/i18n/zh.json +1 -0
- package/build/es/polyfill/index.js +2 -2
- package/build/es/polyfill/info/Info.js +1 -1
- package/build/es/polyfill/instructionsList/InstructionsList.js +3 -3
- package/build/es/polyfill/link/Link.js +2 -3
- package/build/es/polyfill/link/Link.story.js +1 -1
- package/build/es/polyfill/modal/Modal.js +1 -1
- package/build/es/polyfill/moneyInput/MoneyInput.js +2 -2
- package/build/es/polyfill/nudge/Nudge.js +1 -1
- package/build/es/polyfill/phoneNumberInput/PhoneNumberInput.js +1 -1
- package/build/es/polyfill/popover/Popover.js +1 -1
- package/build/es/polyfill/progressBar/ProgressBar.js +1 -1
- package/build/es/polyfill/radio/Radio.js +1 -1
- package/build/es/polyfill/radioOption/RadioOption.js +1 -1
- package/build/es/polyfill/select/Select.js +6 -6
- package/build/es/polyfill/select/option/Option.js +1 -1
- package/build/es/polyfill/snackbar/Snackbar.js +1 -1
- package/build/es/polyfill/stepper/Stepper.js +1 -1
- package/build/es/polyfill/summary/Summary.js +1 -1
- package/build/es/polyfill/switch/Switch.js +1 -1
- package/build/es/polyfill/switchOption/SwitchOption.js +1 -1
- package/build/es/polyfill/tabs/Tab.js +1 -1
- package/build/es/polyfill/tile/Tile.js +1 -1
- package/build/es/polyfill/title/Title.js +1 -0
- package/build/es/polyfill/title/Title.spec.js +1 -0
- package/build/es/polyfill/title/Title.story.js +1 -0
- package/build/es/polyfill/title/index.js +1 -0
- package/build/es/polyfill/typeahead/typeaheadOption/TypeaheadOption.js +1 -1
- package/build/es/polyfill/upload/Upload.js +1 -1
- package/build/es/polyfill/upload/steps/completeStep/completeStep.js +1 -1
- package/build/es/polyfill/upload/steps/mediaUploadStep/mediaUploadStep.js +1 -1
- package/build/es/polyfill/upload/steps/processingStep/processingStep.js +1 -1
- package/build/es/polyfill/upload/steps/uploadImageStep/uploadImageStep.js +1 -1
- package/build/es/polyfill/uploadInput/uploadButton/UploadButton.js +1 -1
- package/build/es/polyfill/uploadInput/uploadItem/UploadItem.js +2 -2
- package/build/i18n/cs.json +2 -1
- package/build/i18n/de.json +1 -0
- package/build/i18n/es.json +2 -1
- package/build/i18n/fr.json +1 -0
- package/build/i18n/hu.json +1 -0
- package/build/i18n/id.json +1 -0
- package/build/i18n/it.json +2 -1
- package/build/i18n/ja.json +1 -0
- package/build/i18n/pl.json +1 -0
- package/build/i18n/pt.json +2 -1
- package/build/i18n/ro.json +1 -0
- package/build/i18n/ru.json +1 -0
- package/build/i18n/th.json +44 -0
- package/build/i18n/tr.json +2 -1
- package/build/i18n/uk.json +2 -1
- package/build/i18n/zh-CN.json +44 -0
- package/build/i18n/zh.json +1 -0
- package/build/main.css +1 -1
- package/build/styles/accordion/Accordion.css +1 -1
- package/build/styles/actionButton/ActionButton.css +1 -1
- package/build/styles/avatar/Avatar.css +1 -1
- package/build/styles/chips/Chip.css +1 -1
- package/build/styles/circularButton/CircularButton.css +1 -1
- package/build/styles/common/Option/Option.css +1 -1
- package/build/styles/dateLookup/DateLookup.css +1 -1
- package/build/styles/definitionList/DefinitionList.css +1 -1
- package/build/styles/dimmer/Dimmer.css +1 -1
- package/build/styles/drawer/Drawer.css +1 -1
- package/build/styles/flowNavigation/animatedLabel/AnimatedLabel.css +1 -1
- package/build/styles/header/Header.css +1 -1
- package/build/styles/link/Link.css +1 -1
- package/build/styles/main.css +1 -1
- package/build/styles/modal/Modal.css +1 -1
- package/build/styles/navigationOption/NavigationOption.css +1 -1
- package/build/styles/nudge/Nudge.css +1 -1
- package/build/styles/popover/Popover.css +1 -1
- package/build/styles/select/Select.css +1 -1
- package/build/styles/snackbar/Snackbar.css +1 -1
- package/build/styles/stepper/Stepper.css +1 -1
- package/build/styles/summary/Summary.css +1 -1
- package/build/styles/tabs/Tabs.css +1 -1
- package/build/styles/tile/Tile.css +1 -1
- package/build/styles/typeahead/Typeahead.css +1 -1
- package/build/styles/uploadInput/uploadButton/UploadButton.css +1 -1
- package/build/styles/uploadInput/uploadItem/UploadItem.css +1 -1
- package/build/types/body/Body.d.ts +14 -0
- package/build/types/body/Body.spec.d.ts +1 -0
- package/build/types/body/Body.story.d.ts +8 -0
- package/build/types/body/index.d.ts +1 -0
- package/build/types/button/Button.d.ts +17 -13
- package/build/types/checkboxButton/CheckboxButton.d.ts +4 -17
- package/build/types/checkboxButton/CheckboxButton.spec.d.ts +1 -0
- package/build/types/checkboxButton/CheckboxButton.story.d.ts +7 -0
- package/build/types/checkboxOption/CheckboxOption.d.ts +24 -20
- package/build/types/checkboxOption/CheckboxOption.spec.d.ts +1 -0
- package/build/types/checkboxOption/CheckboxOption.story.d.ts +11 -0
- package/build/types/checkboxOption/index.d.ts +1 -1
- package/build/types/common/Option/Option.d.ts +2 -1
- package/build/types/common/domHelpers/index.d.ts +1 -0
- package/build/types/common/index.d.ts +1 -0
- package/build/types/common/panel/Panel.d.ts +1 -1
- package/build/types/common/propsValues/typography.d.ts +28 -0
- package/build/types/common/responsivePanel/ResponsivePanel.d.ts +1 -1
- package/build/types/dateInput/DateInput.d.ts +1 -0
- package/build/types/definitionList/DefinitionList.d.ts +4 -0
- package/build/types/display/Display.story.d.ts +6 -0
- package/build/types/header/Header.d.ts +1 -1
- package/build/types/header/Header.story.d.ts +1 -1
- package/build/types/index.d.ts +5 -2
- package/build/types/link/Link.d.ts +6 -5
- package/build/types/link/Link.story.d.ts +2 -2
- package/build/types/modal/Modal.d.ts +1 -1
- package/build/types/modal/Modal.story.d.ts +2 -11
- package/build/types/modal/index.d.ts +2 -1
- package/build/types/moneyInput/MoneyInput.d.ts +1 -0
- package/build/types/phoneNumberInput/PhoneNumberInput.d.ts +2 -0
- package/build/types/radioOption/RadioOption.d.ts +1 -0
- package/build/types/select/searchBox/SearchBox.d.ts +1 -1
- package/build/types/switchOption/SwitchOption.d.ts +2 -1
- package/build/types/switchOption/SwitchOption.story.d.ts +2 -1
- package/build/types/title/Title.d.ts +14 -0
- package/build/types/title/Title.spec.d.ts +1 -0
- package/build/types/title/Title.story.d.ts +8 -0
- package/build/types/title/index.d.ts +1 -0
- package/build/types/tooltip/Tooltip.story.d.ts +1 -1
- package/build/umd/no-polyfill/main.js +1 -1
- package/build/umd/polyfill/main.js +1 -1
- package/package.json +15 -7
- package/scripts/generate-type-declarations.js +0 -2
- package/build/styles/actionOption/ActionOption.css +0 -1
- package/build/styles/progressBar/ProgressBar.css +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,274 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [41.5.0](https://github.com/transferwise/neptune-web/compare/@transferwise/components@41.4.1...@transferwise/components@41.5.0) (2022-10-10)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* Add optional ActionButton to DefinitionList ([#1594](https://github.com/transferwise/neptune-web/issues/1594)) ([e26185e](https://github.com/transferwise/neptune-web/commit/e26185e0aef770c3cfa2201a0c0ce5a71b3ed8ca))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [41.4.1](https://github.com/transferwise/neptune-web/compare/@transferwise/components@41.4.0...@transferwise/components@41.4.1) (2022-10-04)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @transferwise/components
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
# [41.4.0](https://github.com/transferwise/neptune-web/compare/@transferwise/components@41.3.2...@transferwise/components@41.4.0) (2022-09-30)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Features
|
|
29
|
+
|
|
30
|
+
* add 'as' prop to support anchor tag buttons ([f9e3ff6](https://github.com/transferwise/neptune-web/commit/f9e3ff6c7b6263299285edd6815d731e9ab984bc))
|
|
31
|
+
* add disabled class ([a793614](https://github.com/transferwise/neptune-web/commit/a79361497f34f238b0c68582f45761aba8ce7642))
|
|
32
|
+
* update and refactor types to support anchor tags ([bcba7f1](https://github.com/transferwise/neptune-web/commit/bcba7f1c20923c48978c20a743b12b82a4353546))
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
## [41.3.2](https://github.com/transferwise/neptune-web/compare/@transferwise/components@41.3.1...@transferwise/components@41.3.2) (2022-09-30)
|
|
39
|
+
|
|
40
|
+
**Note:** Version bump only for package @transferwise/components
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
## [41.3.1](https://github.com/transferwise/neptune-web/compare/@transferwise/components@41.3.0...@transferwise/components@41.3.1) (2022-09-29)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
### Bug Fixes
|
|
50
|
+
|
|
51
|
+
* **CheckboxButton:** props issue ([#1623](https://github.com/transferwise/neptune-web/issues/1623)) ([58b4875](https://github.com/transferwise/neptune-web/commit/58b48753a4b16df5271fff8338107fd8156f7ded))
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
# [41.3.0](https://github.com/transferwise/neptune-web/compare/@transferwise/components@41.2.1...@transferwise/components@41.3.0) (2022-09-23)
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
### Features
|
|
61
|
+
|
|
62
|
+
* expose selectProps for Select, MoneyInput and PhoneNumberInput ([c9899db](https://github.com/transferwise/neptune-web/commit/c9899db6c2fd57cd366236e354b79157e522655f))
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
## [41.2.1](https://github.com/transferwise/neptune-web/compare/@transferwise/components@41.2.0...@transferwise/components@41.2.1) (2022-09-22)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
### Bug Fixes
|
|
72
|
+
|
|
73
|
+
* return default icon size to 16px in dynamic-flows ([#1554](https://github.com/transferwise/neptune-web/issues/1554)) ([591c51b](https://github.com/transferwise/neptune-web/commit/591c51b02089210314a1380ebfa86e11fa6b3d86))
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
# [41.2.0](https://github.com/transferwise/neptune-web/compare/@transferwise/components@41.1.4...@transferwise/components@41.2.0) (2022-09-21)
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
### Features
|
|
83
|
+
|
|
84
|
+
* **CheckboxOption:** add as and name props ([#1601](https://github.com/transferwise/neptune-web/issues/1601)) ([8130120](https://github.com/transferwise/neptune-web/commit/8130120b106198cc4ab1d43e888b54f0a39279ec))
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
## [41.1.4](https://github.com/transferwise/neptune-web/compare/@transferwise/components@41.1.3...@transferwise/components@41.1.4) (2022-08-30)
|
|
91
|
+
|
|
92
|
+
**Note:** Version bump only for package @transferwise/components
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
## [41.1.3](https://github.com/transferwise/neptune-web/compare/@transferwise/components@41.1.2...@transferwise/components@41.1.3) (2022-08-26)
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
### Bug Fixes
|
|
102
|
+
|
|
103
|
+
* **DateLookup:** right align story ([#1579](https://github.com/transferwise/neptune-web/issues/1579)) ([612a69d](https://github.com/transferwise/neptune-web/commit/612a69d9538bc25c2b4a8365d7b06cfb6f342690))
|
|
104
|
+
* **Summary:** Consistent Summary icons - switch to filled ([#1580](https://github.com/transferwise/neptune-web/issues/1580)) ([83d8ff0](https://github.com/transferwise/neptune-web/commit/83d8ff0f7296a8e75f0cee0d936a4d438e4c56dc))
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
## [41.1.2](https://github.com/transferwise/neptune-web/compare/@transferwise/components@41.1.1...@transferwise/components@41.1.2) (2022-08-16)
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
### Bug Fixes
|
|
114
|
+
|
|
115
|
+
* **android-web:** include -webkit-fill-available for potential vh bug ([a7a7b08](https://github.com/transferwise/neptune-web/commit/a7a7b085db90568d0e25e6e39f8ecd7abe04227b))
|
|
116
|
+
* **android-web:** the -webkit-fill seems to have reintroduced the bug ([d9387da](https://github.com/transferwise/neptune-web/commit/d9387da5702fc91e5600339ce000a677a9ba5cc3))
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
## [41.1.1](https://github.com/transferwise/neptune-web/compare/@transferwise/components@41.1.0...@transferwise/components@41.1.1) (2022-08-16)
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
### Bug Fixes
|
|
126
|
+
|
|
127
|
+
* **CloseButton:** position in Alert ([#1567](https://github.com/transferwise/neptune-web/issues/1567)) ([efe2b9e](https://github.com/transferwise/neptune-web/commit/efe2b9efa23d57708f14ec75a37e6fd51eae7d9d))
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
# [41.1.0](https://github.com/transferwise/neptune-web/compare/@transferwise/components@41.0.7...@transferwise/components@41.1.0) (2022-08-15)
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
### Features
|
|
137
|
+
|
|
138
|
+
* **Snackbar:** swap Link to ActionButton ([#1566](https://github.com/transferwise/neptune-web/issues/1566)) ([aeac0b5](https://github.com/transferwise/neptune-web/commit/aeac0b561fc7a25cf872e1a57e42737b3896192f))
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
## [41.0.7](https://github.com/transferwise/neptune-web/compare/@transferwise/components@41.0.6...@transferwise/components@41.0.7) (2022-08-12)
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
### Bug Fixes
|
|
148
|
+
|
|
149
|
+
* **CloseButton:** position in multiple components ([#1565](https://github.com/transferwise/neptune-web/issues/1565)) ([d675ac3](https://github.com/transferwise/neptune-web/commit/d675ac3d6359dc2e9cedb0ec3e18d75b8c14328d))
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
## [41.0.6](https://github.com/transferwise/neptune-web/compare/@transferwise/components@41.0.5...@transferwise/components@41.0.6) (2022-08-10)
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
### Bug Fixes
|
|
159
|
+
|
|
160
|
+
* **Select:** add max-height for dropdown in px and padding inside toggle ([#1563](https://github.com/transferwise/neptune-web/issues/1563)) ([056b530](https://github.com/transferwise/neptune-web/commit/056b530cb6f77fadc0c06aecb36357d3b968c651))
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
## [41.0.5](https://github.com/transferwise/neptune-web/compare/@transferwise/components@41.0.4...@transferwise/components@41.0.5) (2022-08-10)
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
### Bug Fixes
|
|
170
|
+
|
|
171
|
+
* **Modal:** expose TS prop types ([#1564](https://github.com/transferwise/neptune-web/issues/1564)) ([6a233bc](https://github.com/transferwise/neptune-web/commit/6a233bcf8cac09627c6fa0e4faada55a6c0765f0))
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
## [41.0.4](https://github.com/transferwise/neptune-web/compare/@transferwise/components@41.0.3...@transferwise/components@41.0.4) (2022-08-10)
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
### Bug Fixes
|
|
181
|
+
|
|
182
|
+
* **Select:** padding inside toggle ([#1562](https://github.com/transferwise/neptune-web/issues/1562)) ([b8a3c22](https://github.com/transferwise/neptune-web/commit/b8a3c22cb4094ed9059856094fbc3392b88e4b10))
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
## [41.0.3](https://github.com/transferwise/neptune-web/compare/@transferwise/components@41.0.2...@transferwise/components@41.0.3) (2022-08-10)
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
### Bug Fixes
|
|
192
|
+
|
|
193
|
+
* setting default icon size to 24px with AvatarWrapper ([53c2cbe](https://github.com/transferwise/neptune-web/commit/53c2cbef9feea82668cb6845ae26c2f2b95a0975))
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
## [41.0.2](https://github.com/transferwise/neptune-web/compare/@transferwise/components@41.0.1...@transferwise/components@41.0.2) (2022-08-09)
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
### Bug Fixes
|
|
203
|
+
|
|
204
|
+
* shouldn't use filled/circle icon for alert close button and default icons size should be 16px ([#1557](https://github.com/transferwise/neptune-web/issues/1557)) ([809f48c](https://github.com/transferwise/neptune-web/commit/809f48c508818329471feb33543587779b0ddf15))
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
## [41.0.1](https://github.com/transferwise/neptune-web/compare/@transferwise/components@41.0.0...@transferwise/components@41.0.1) (2022-08-09)
|
|
211
|
+
|
|
212
|
+
**Note:** Version bump only for package @transferwise/components
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
# [41.0.0](https://github.com/transferwise/neptune-web/compare/@transferwise/components@40.13.3...@transferwise/components@41.0.0) (2022-08-02)
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
### Features
|
|
222
|
+
|
|
223
|
+
* updating to the next set of icons ([2f00156](https://github.com/transferwise/neptune-web/commit/2f001568aeefe30732f9286ba1df5f5818998e91))
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
### BREAKING CHANGES
|
|
227
|
+
|
|
228
|
+
* this PR now updates all our web components and dynamic forms to use `v3.0.0` of `@transferwise/icons`
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
## [40.13.3](https://github.com/transferwise/neptune-web/compare/@transferwise/components@40.13.2...@transferwise/components@40.13.3) (2022-07-27)
|
|
235
|
+
|
|
236
|
+
**Note:** Version bump only for package @transferwise/components
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
## [40.13.2](https://github.com/transferwise/neptune-web/compare/@transferwise/components@40.13.1...@transferwise/components@40.13.2) (2022-07-26)
|
|
243
|
+
|
|
244
|
+
**Note:** Version bump only for package @transferwise/components
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
## [40.13.1](https://github.com/transferwise/neptune-web/compare/@transferwise/components@40.13.0...@transferwise/components@40.13.1) (2022-07-21)
|
|
251
|
+
|
|
252
|
+
**Note:** Version bump only for package @transferwise/components
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
# [40.13.0](https://github.com/transferwise/neptune-web/compare/@transferwise/components@40.12.13...@transferwise/components@40.13.0) (2022-07-20)
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
### Bug Fixes
|
|
262
|
+
|
|
263
|
+
* checkbox button disabled state DS-2484 ([5934eb6](https://github.com/transferwise/neptune-web/commit/5934eb6cda578ea7b4a0a53d11cf7aa64e008177))
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
### Features
|
|
267
|
+
|
|
268
|
+
* add test for the disabled className ([7933455](https://github.com/transferwise/neptune-web/commit/79334555a1ce60edbb531a073e2c97ad50403bcc))
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
|
|
6
274
|
## [40.12.13](https://github.com/transferwise/neptune-web/compare/@transferwise/components@40.12.12...@transferwise/components@40.12.13) (2022-07-19)
|
|
7
275
|
|
|
8
276
|
**Note:** Version bump only for package @transferwise/components
|
|
@@ -229,6 +497,8 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
229
497
|
### Features
|
|
230
498
|
|
|
231
499
|
* **select:** add aria-attributes and expose dropdownProps ([#1445](https://github.com/transferwise/neptune-web/issues/1445)) ([a5da938](https://github.com/transferwise/neptune-web/commit/a5da938a5a47ce430cc66174736f6ffa13925397))
|
|
500
|
+
* **select:** update `<button>` DOM element `role` attribute to `combobox` ([#1445](https://github.com/transferwise/neptune-web/issues/1445)) ([a5da938](https://github.com/transferwise/neptune-web/commit/a5da938a5a47ce430cc66174736f6ffa13925397))
|
|
501
|
+
* **select:** update `<ul>` DOM element `role` attribute to `listbox` ([#1445](https://github.com/transferwise/neptune-web/issues/1445)) ([a5da938](https://github.com/transferwise/neptune-web/commit/a5da938a5a47ce430cc66174736f6ffa13925397))
|
|
232
502
|
|
|
233
503
|
|
|
234
504
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import classNames from"classnames";import PropTypes from"prop-types";import{cloneElement}from"react";import Chevron from"../../chevron";import{Position,Theme}from"../../common";import Option from"../../common/Option";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var AccordionItem=function(a){var b=a["aria-label"],c=a.id,d=a.title,e=a.content,f=a.onClick,g=a.open,h=a.icon,i=a.theme,j=h?/*#__PURE__*/cloneElement(h,{size:24}):null;return/*#__PURE__*/_jsxs("div",{id:c,className:classNames("np-accordion-item","np-accordion-item--".concat(i),{"np-accordion-item--open":g}),children:[/*#__PURE__*/_jsx(Option,{"aria-label":b,as:"button",media:j,title:d,button:/*#__PURE__*/_jsx(Chevron,{orientation:g?Position.TOP:Position.DOWN}),inverseMediaCircle:!1,onClick:f}),g&&/*#__PURE__*/_jsx(
|
|
1
|
+
import classNames from"classnames";import PropTypes from"prop-types";import{cloneElement}from"react";import Body from"../../body";import Chevron from"../../chevron";import{Position,Theme,Typography}from"../../common";import Option from"../../common/Option";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var AccordionItem=function(a){var b=a["aria-label"],c=a.id,d=a.title,e=a.content,f=a.onClick,g=a.open,h=a.icon,i=a.theme,j=h?/*#__PURE__*/cloneElement(h,{size:24}):null;return/*#__PURE__*/_jsxs("div",{id:c,className:classNames("np-accordion-item","np-accordion-item--".concat(i),{"np-accordion-item--open":g}),children:[/*#__PURE__*/_jsx(Option,{"aria-label":b,as:"button",media:j,title:d,button:/*#__PURE__*/_jsx(Chevron,{orientation:g?Position.TOP:Position.DOWN}),inverseMediaCircle:!1,onClick:f}),g&&/*#__PURE__*/_jsx(Body,{type:Typography.BODY_LARGE,className:classNames("np-accordion-item__content","d-block",{"has-icon":h}),children:e})]})};AccordionItem.propTypes={"aria-label":PropTypes.string,content:PropTypes.node.isRequired,icon:PropTypes.node,id:PropTypes.string,open:PropTypes.bool.isRequired,onClick:PropTypes.func.isRequired,title:PropTypes.node.isRequired,theme:PropTypes.oneOf(["light","dark"])},AccordionItem.defaultProps={"aria-label":void 0,icon:null,id:null,theme:Theme.LIGHT};export default AccordionItem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["disabled","className","onClick","text","children"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import classNames from"classnames";import{forwardRef}from"react";import{jsx as _jsx}from"react/jsx-runtime";var ActionButton=/*#__PURE__*/forwardRef(function(a,b){var c=a.disabled,d=a.className,e=void 0===d?void 0:d,f=a.onClick,g=a.text,h=a.children,i=_objectWithoutProperties(a,_excluded);return/*#__PURE__*/_jsx("button",_objectSpread(_objectSpread({ref:b,type:"button",className:classNames("np-action-btn",e),disabled:void 0!==c&&c,onClick:f},i),{},{children:h||g}))});export default ActionButton;
|
|
1
|
+
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["disabled","className","onClick","text","children"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import classNames from"classnames";import{forwardRef}from"react";import{jsx as _jsx}from"react/jsx-runtime";var ActionButton=/*#__PURE__*/forwardRef(function(a,b){var c=a.disabled,d=a.className,e=void 0===d?void 0:d,f=a.onClick,g=a.text,h=a.children,i=_objectWithoutProperties(a,_excluded);return/*#__PURE__*/_jsx("button",_objectSpread(_objectSpread({ref:b,type:"button",className:classNames("np-action-btn","np-text-body-default-bold",e),disabled:void 0!==c&&c,onClick:f},i),{},{children:h||g}))});export default ActionButton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _defineProperty from"@babel/runtime/helpers/defineProperty";var _deprecatedTypeMap,_iconTypeMap,_deprecatedTypeMapMes;function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import{InfoCircle,CheckCircle,
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _defineProperty from"@babel/runtime/helpers/defineProperty";var _deprecatedTypeMap,_iconTypeMap,_deprecatedTypeMapMes;function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import{InfoCircle,CheckCircle,Warning as AlertIcon,AlertCircle}from"@transferwise/icons";import classNames from"classnames";import PropTypes from"prop-types";import{cloneElement,useState,useRef}from"react";import requiredIf from"react-required-if";import Body from"../body/Body";import{Sentiment,Typography}from"../common";import CloseButton from"../common/closeButton";import Link from"../link";import{logActionRequiredIf,deprecated}from"../utilities";import InlineMarkdown from"./inlineMarkdown";import withArrow from"./withArrow";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var deprecatedTypeMap=(_deprecatedTypeMap={},_defineProperty(_deprecatedTypeMap,Sentiment.SUCCESS,Sentiment.POSITIVE),_defineProperty(_deprecatedTypeMap,Sentiment.INFO,Sentiment.NEUTRAL),_defineProperty(_deprecatedTypeMap,Sentiment.ERROR,Sentiment.NEGATIVE),_deprecatedTypeMap),iconTypeMap=(_iconTypeMap={},_defineProperty(_iconTypeMap,Sentiment.POSITIVE,CheckCircle),_defineProperty(_iconTypeMap,Sentiment.NEUTRAL,InfoCircle),_defineProperty(_iconTypeMap,Sentiment.WARNING,AlertIcon),_defineProperty(_iconTypeMap,Sentiment.NEGATIVE,AlertCircle),_iconTypeMap),Alert=function(a){var b=useState(!1),c=_slicedToArray(b,2),d=c[0],e=c[1],f=a.arrow,g=a.action,h=a.children,i=a.className,j=a.icon,k=a.onDismiss,l=a.message,m=a.type,n=useRef(null);if(f){var r=withArrow(Alert,f);return/*#__PURE__*/_jsx(r,_objectSpread({},a))}logActionRequired(a);var o=deprecatedTypeMap[m]||m,p=iconTypeMap[o],q=j?/*#__PURE__*/cloneElement(j,{size:24}):/*#__PURE__*/_jsx(p,{size:24});return/*#__PURE__*/_jsxs("div",{role:"alert",className:classNames("alert d-flex","alert-".concat(o),i),onTouchStart:function handleTouchStart(){return e(!0)},onTouchEnd:function handleTouchEnd(a){d&&g&&null!==n&&void 0!==n&&n.current&&!n.current.contains(a.target)&&("_blank"===(null===g||void 0===g?void 0:g.target)?window.top.open(g.href):window.top.location.assign(g.href)),e(!1)},onTouchMove:function handleTouchMove(){return e(!1)},children:[q,/*#__PURE__*/_jsxs("div",{className:"flex-grow-1 p-l-2",children:[/*#__PURE__*/_jsx(Body,{className:"d-block",type:Typography.BODY_LARGE,children:h||/*#__PURE__*/_jsx(InlineMarkdown,{children:l})}),g&&/*#__PURE__*/_jsx(Link,{href:g.href,className:"m-t-1","aria-label":g["aria-label"],target:g.target,type:Typography.LINK_LARGE,children:g.text})]}),k&&/*#__PURE__*/_jsx(CloseButton,{ref:n,size:16,className:"m-l-2",onClick:k})]})},deprecatedTypeMapMessage=(_deprecatedTypeMapMes={},_defineProperty(_deprecatedTypeMapMes,Sentiment.SUCCESS,"Sentiment.POSITIVE"),_defineProperty(_deprecatedTypeMapMes,Sentiment.INFO,"Sentiment.NEUTRAL"),_defineProperty(_deprecatedTypeMapMes,Sentiment.ERROR,"Sentiment.NEGATIVE"),_deprecatedTypeMapMes),deprecatedTypes=Object.keys(deprecatedTypeMap);function logActionRequired(a){var b=a.size,c=a.type;logActionRequiredIf("Alert no longer supports any possible variations in size. Please remove the `size` prop.",!!b),logActionRequiredIf("Alert has deprecated the ".concat(c," value for the `type` prop. Please update to ").concat(deprecatedTypeMapMessage[c],"."),deprecatedTypes.includes(c))}Alert.propTypes={/** 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 */action:PropTypes.shape({"aria-label":PropTypes.string,href:PropTypes.string.isRequired,target:PropTypes.string,text:PropTypes.node.isRequired}),className:PropTypes.string,/** An optional icon. If not provided, we will default the icon to something appropriate for the type */icon:PropTypes.element,/** The main body of the alert. Accepts plain text and bold words specified with **double stars*/message:requiredIf(PropTypes.node,function(a){var b=a.children;return!b}),/** The presence of the onDismiss handler will trigger the visibility of the close button */onDismiss:PropTypes.func,/** The type dictates which icon and colour will be used */type:PropTypes.oneOf(["negative","neutral","positive","warning","info","error","success"]),/** @deprecated no arrow for `Alert` component anymore, consider to use [`InlineAlert`](https://transferwise.github.io/neptune-web/components/alerts/InlineAlert) component */arrow:deprecated(PropTypes.oneOf(["up-left","up-center","up-right","down-left","down-center","down-right"]),{component:"Alert",expiryDate:new Date("03-01-2021")}),/** @deprecated use `message` property instead */children:deprecated(requiredIf(PropTypes.node,function(a){var b=a.message;return!b}),{component:"Alert",message:"You should now use the `message` prop. Be aware `message` only accepts plain text or text with **bold** markdown.",expiryDate:new Date("03-01-2021")}),/** @deprecated use `onDismiss` instead */dismissible:deprecated(PropTypes.bool,{component:"Alert",message:"The Alert will now be considered dismissible if an `onDismiss` hander is present.",expiryDate:new Date("03-01-2021")})},Alert.defaultProps={action:void 0,arrow:void 0,className:void 0,dismissible:void 0,icon:void 0,type:Sentiment.NEUTRAL};export default Alert;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import classnames from"classnames";import PropTypes from"prop-types";import{Size,Theme}from"../common";import{AvatarType}from"./avatarTypes";import{jsx as _jsx}from"react/jsx-runtime";var Avatar=function(a){var b=a.backgroundColor,c=a.children,d=a.className,e=a.outlined,f=a.size,g=a.theme,h=a.type;return/*#__PURE__*/_jsx("div",{className:classnames("tw-avatar",d,"tw-avatar--".concat(f),"tw-avatar--".concat(h),"tw-avatar--".concat(g),{"tw-avatar--outlined":e}),children:/*#__PURE__*/_jsx("div",{className:"tw-avatar__content",style:{backgroundColor:b||void 0},children:c})})};Avatar.propTypes={backgroundColor:PropTypes.string,children:PropTypes.node,className:PropTypes.string,outlined:PropTypes.bool,size:PropTypes.oneOf(["sm","md","lg"]),theme:PropTypes.oneOf(["light","dark"]),type:PropTypes.oneOf(["thumbnail","icon","emoji","initials"])},Avatar.defaultProps={backgroundColor:null,children:null,className:null,outlined:!1,size:Size.MEDIUM,theme:Theme.LIGHT,type:AvatarType.THUMBNAIL};export default Avatar;
|
|
1
|
+
import classnames from"classnames";import PropTypes from"prop-types";import{Size,Theme}from"../common";import{AvatarType}from"./avatarTypes";import{jsx as _jsx}from"react/jsx-runtime";var Avatar=function(a){var b=a.backgroundColor,c=a.children,d=a.className,e=a.outlined,f=a.size,g=a.theme,h=a.type;return/*#__PURE__*/_jsx("div",{className:classnames("tw-avatar",d,"tw-avatar--".concat(f),"tw-avatar--".concat(h),"tw-avatar--".concat(g),{"tw-avatar--outlined":e,"np-text-title-body":h===AvatarType.INITIALS}),children:/*#__PURE__*/_jsx("div",{className:"tw-avatar__content",style:{backgroundColor:b||void 0},children:c})})};Avatar.propTypes={backgroundColor:PropTypes.string,children:PropTypes.node,className:PropTypes.string,outlined:PropTypes.bool,size:PropTypes.oneOf(["sm","md","lg"]),theme:PropTypes.oneOf(["light","dark"]),type:PropTypes.oneOf(["thumbnail","icon","emoji","initials"])},Avatar.defaultProps={backgroundColor:null,children:null,className:null,outlined:!1,size:Size.MEDIUM,theme:Theme.LIGHT,type:AvatarType.THUMBNAIL};export default Avatar;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["url","children"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import{
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["url","children"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import{Person as ProfileIcon,Briefcase as BriefcaseIcon}from"@transferwise/icons";import PropTypes from"prop-types";import{useState,useEffect}from"react";import Avatar,{AvatarType}from"../avatar";import Badge from"../badge";import Body from"../body";import{ProfileType,Size}from"../common";import{jsx as _jsx}from"react/jsx-runtime";var OptionalBadge=function(a){var b=a.url,c=a.children,d=_objectWithoutProperties(a,_excluded);return b?/*#__PURE__*/_jsx(Badge,_objectSpread(_objectSpread({badge:/*#__PURE__*/_jsx("img",{src:b,alt:""})},d),{},{children:c})):c};OptionalBadge.propTypes={url:PropTypes.string,children:PropTypes.node.isRequired},OptionalBadge.defaultProps={url:void 0};var AvatarWrapper=function(a){var b=a.url,c=a.profileType,d=a.badgeUrl,e=a.name,f=a.avatarProps,g=a.badgeProps,h=useState(!1),i=_slicedToArray(h,2),j=i[0],k=i[1],l=c===ProfileType.BUSINESS;useEffect(function(){return k(!1)},[b]);return/*#__PURE__*/_jsx(OptionalBadge,_objectSpread(_objectSpread({url:d},g),{},{children:/*#__PURE__*/_jsx(Avatar,_objectSpread({size:Size.MEDIUM},function getAvatarProps(){return b&&!j?_objectSpread({type:AvatarType.THUMBNAIL,children:/*#__PURE__*/_jsx("img",{src:b,alt:"avatar",onError:function onError(){return k(!0)}})},f):c?_objectSpread({type:AvatarType.ICON,children:l?/*#__PURE__*/_jsx(BriefcaseIcon,{size:"24"}):/*#__PURE__*/_jsx(ProfileIcon,{size:"24"})},f):e?_objectSpread({type:AvatarType.INITIALS,children:/*#__PURE__*/_jsx(Body,{children:getInitials(e)})},f):_objectSpread({type:AvatarType.ICON,children:/*#__PURE__*/_jsx(ProfileIcon,{size:"24"})},f)}()))}))};function getInitials(a){var b=a.split(" ").map(function(a){return a[0]}).join("").toUpperCase();return 1===b.length?b[0]:b[0]+b.slice(-1)}AvatarWrapper.defaultProps={url:void 0,profileType:void 0,badgeUrl:void 0,name:void 0,avatarProps:{},badgeProps:{}},AvatarWrapper.propTypes={url:PropTypes.string,profileType:PropTypes.oneOf(["PERSONAL","BUSINESS"]),badgeUrl:PropTypes.string,name:PropTypes.string,avatarProps:PropTypes.shape({}),badgeProps:PropTypes.shape({})};export default AvatarWrapper;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["as","type","className"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import classNames from"classnames";import{Typography}from"../common/propsValues/typography";import{jsx as _jsx}from"react/jsx-runtime";var DEFAULT_TYPE=Typography.BODY_DEFAULT,bodyTypes=new Set([Typography.BODY_DEFAULT,Typography.BODY_DEFAULT_BOLD,Typography.BODY_LARGE,Typography.BODY_LARGE_BOLD]);function Body(a){var b=a.as,c=void 0===b?"span":b,d=a.type,e=void 0===d?DEFAULT_TYPE:d,f=a.className,g=_objectWithoutProperties(a,_excluded),h=bodyTypes.has(e);return/*#__PURE__*/_jsx(c,_objectSpread(_objectSpread({},g),{},{className:classNames("np-text-".concat(h?e:DEFAULT_TYPE),f)}))}export default Body;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Typography}from"../common";import{render,screen}from"../test-utils";import Body from".";import{jsx as _jsx}from"react/jsx-runtime";describe("Body",function(){it("testing default state",function(){render(/*#__PURE__*/_jsx(Body,{children:"Test"}));var a=screen.getByText("Test");expect(a).toBeInTheDocument(),expect(a.tagName).toBe("SPAN"),expect(a).toHaveClass("np-text-".concat(Typography.BODY_DEFAULT))}),it("enforces tag via `as` prop",function(){render(/*#__PURE__*/_jsx(Body,{as:"p",children:"Test"}));var a=screen.getByText("Test");expect(a).toBeInTheDocument(),expect(a.tagName).toBe("P"),expect(a).toHaveClass("np-text-".concat(Typography.BODY_DEFAULT))}),it("supports native HTML attrs",function(){render(/*#__PURE__*/_jsx(Body,{id:"test-id",role:"banner",children:"Test"}));var a=screen.getByText("Test");expect(a).toBeInTheDocument(),expect(a).toHaveAttribute("id","test-id"),expect(a).toHaveAttribute("role","banner")}),it("handles unsupported typography type",function(){render(/*#__PURE__*/_jsx(Body,{type:Typography.TITLE_SCREEN,children:"Test"}));var a=screen.getByText("Test");expect(a).toBeInTheDocument(),expect(a.tagName).toBe("SPAN"),expect(a).toHaveClass("np-text-".concat(Typography.BODY_DEFAULT))})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Typography}from"../common/propsValues/typography";import Title from"../title";import Body from"./Body";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";export default{component:Body,title:"Typography | Body"};export var Basic=function(){return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsxs("div",{children:[/*#__PURE__*/_jsx(Title,{type:Typography.TITLE_SUBSECTION,children:"Body Large Bold"}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE_BOLD,children:["We\u2019re building the world's most ",/*#__PURE__*/_jsx("strong",{children:"international account"}),". We\u2019re building the world's most ",/*#__PURE__*/_jsx("b",{children:"international account"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE_BOLD,children:["\u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448 ",/*#__PURE__*/_jsx("strong",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),". \u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448"," ",/*#__PURE__*/_jsx("b",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE_BOLD,children:["\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("strong",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})," ","\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("b",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE_BOLD,children:["Wir bauen den internationalen ",/*#__PURE__*/_jsx("strong",{children:"Bericht der Welt auf"}),". Wir bauen den internationalen ",/*#__PURE__*/_jsx("b",{children:"Bericht der Welt auf"}),"."]})]}),/*#__PURE__*/_jsxs("div",{children:[/*#__PURE__*/_jsx(Title,{type:Typography.TITLE_SUBSECTION,children:"Body Default"}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT,children:["We\u2019re building the world's most ",/*#__PURE__*/_jsx("strong",{children:"international account"}),". We\u2019re building the world's most ",/*#__PURE__*/_jsx("b",{children:"international account"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT,children:["\u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448 ",/*#__PURE__*/_jsx("strong",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),". \u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448"," ",/*#__PURE__*/_jsx("b",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT,children:["\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("strong",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})," ","\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("b",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT,children:["Wir bauen den internationalen ",/*#__PURE__*/_jsx("strong",{children:"Bericht der Welt auf"}),". Wir bauen den internationalen ",/*#__PURE__*/_jsx("b",{children:"Bericht der Welt auf"}),"."]})]}),/*#__PURE__*/_jsxs("div",{children:[/*#__PURE__*/_jsx(Title,{type:Typography.TITLE_SUBSECTION,children:"Body Default Bold"}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT_BOLD,children:["We\u2019re building the world's most ",/*#__PURE__*/_jsx("strong",{children:"international account"}),". We\u2019re building the world's most ",/*#__PURE__*/_jsx("b",{children:"international account"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT_BOLD,children:["\u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448 ",/*#__PURE__*/_jsx("strong",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),". \u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448"," ",/*#__PURE__*/_jsx("b",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT_BOLD,children:["\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("strong",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})," ","\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("b",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT_BOLD,children:["Wir bauen den internationalen ",/*#__PURE__*/_jsx("strong",{children:"Bericht der Welt auf"}),". Wir bauen den internationalen ",/*#__PURE__*/_jsx("b",{children:"Bericht der Welt auf"}),"."]})]}),/*#__PURE__*/_jsxs("div",{children:[/*#__PURE__*/_jsx(Title,{type:Typography.TITLE_SUBSECTION,children:"Body Large"}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE,children:["We\u2019re building the world's most ",/*#__PURE__*/_jsx("strong",{children:"international account"}),". We\u2019re building the world's most ",/*#__PURE__*/_jsx("b",{children:"international account"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE,children:["\u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448 ",/*#__PURE__*/_jsx("strong",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),". \u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448"," ",/*#__PURE__*/_jsx("b",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE,children:["\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("strong",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})," ","\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("b",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE,children:["Wir bauen den internationalen ",/*#__PURE__*/_jsx("strong",{children:"Bericht der Welt auf"}),". Wir bauen den internationalen ",/*#__PURE__*/_jsx("b",{children:"Bericht der Welt auf"}),"."]})]}),/*#__PURE__*/_jsxs(Title,{type:Typography.TITLE_SUBSECTION,children:["Copy Example without ",/*#__PURE__*/_jsx("code",{children:"<Body />"})," component"]}),/*#__PURE__*/_jsx("p",{children:"Lorem ipsum dolor sit amet consectetur adipisicing elit. Explicabo saepe repellendus accusantium eveniet temporibus perspiciatis iure ut, pariatur nihil totam iusto, delectus, modi possimus soluta. Et iusto odio autem debitis!"}),/*#__PURE__*/_jsx(Title,{type:Typography.TITLE_SUBSECTION,children:"Copy Example without any HTML tag"}),"Lorem ipsum dolor sit amet consectetur adipisicing elit. Explicabo saepe repellendus accusantium eveniet temporibus perspiciatis iure ut, pariatur nihil totam iusto, delectus, modi possimus soluta. Et iusto odio autem debitis!"]})};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{default}from"./Body";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["block","children","className","disabled","
|
|
2
|
-
var s=establishNewType(q),
|
|
1
|
+
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["as","block","children","className","disabled","loading","priority","size","type"],_excluded2=["htmlType"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import classNames from"classnames";import{forwardRef}from"react";import{Size,ControlType,Priority}from"../common";import{typeClassMap,priorityClassMap}from"./classMap";import{establishNewPriority,establishNewType,logDeprecationNotices}from"./legacyUtils";/** @deprecated */import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Button=/*#__PURE__*/forwardRef(function(a,b){var c,d=a.as,e=a.block,f=void 0!==e&&e,g=a.children,h=a.className,i=a.disabled,j=a.loading,k=void 0!==j&&j,l=a.priority,m=void 0===l?Priority.PRIMARY:l,n=a.size,o=void 0===n?Size.MEDIUM:n,p=a.type,q=void 0===p?ControlType.ACCENT:p,r=_objectWithoutProperties(a,_excluded);logDeprecationNotices({size:o,type:q});// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
2
|
+
var s,t=establishNewType(q),u=establishNewPriority(m,q),v=classNames("btn btn-".concat(o),"np-btn np-btn-".concat(o),{"btn-loading":k,"btn-block np-btn-block":f},{disabled:i||k},// @ts-expect-error fix when refactor `typeClassMap` to TypeScript
|
|
3
3
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
4
|
-
typeClassMap[
|
|
4
|
+
typeClassMap[t],// @ts-expect-error fix when refactor `typeClassMap` to TypeScript
|
|
5
5
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
6
|
-
priorityClassMap[
|
|
7
|
-
return/*#__PURE__*/_jsxs(
|
|
6
|
+
priorityClassMap[u],h),w=null!==(c=d)&&void 0!==c?c:"button";// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
7
|
+
if("button"===w){var x=r,y=x.htmlType,z=void 0===y?"button":y,A=_objectWithoutProperties(x,_excluded2);s=_objectSpread(_objectSpread({},A),{},{disabled:i||k,type:z})}else s=_objectSpread({},r);return/*#__PURE__*/_jsxs(w,_objectSpread(_objectSpread({ref:b,className:v},s),{},{children:[g,k&&/*#__PURE__*/_jsx("span",{className:classNames("btn-loader",{"m-l-2":!f})})]}))});export default Button;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["aria-label","as","isExpanded","title","details","children","onClick","icon","id","className"];import classNames from"classnames";import PropTypes from"prop-types";import{forwardRef}from"react";import requiredIf from"react-required-if";import Chevron from"../chevron";import{Position}from"../common";import Option from"../common/Option";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Card=/*#__PURE__*/forwardRef(function(a,b){var c=a["aria-label"],d=a.as,e=a.isExpanded,f=a.title,g=a.details,h=a.children,i=a.onClick,j=a.icon,k=a.id,l=a.className,m=_objectWithoutProperties(a,_excluded),n=!!(e&&h);return/*#__PURE__*/_jsxs(d,{ref:b,className:classNames("np-card",l,{"np-card--expanded":n,"np-card--inactive":!h,"np-card--has-icon":!!j}),id:k,"data-testid":m["data-testid"],children:[/*#__PURE__*/_jsx(Option,{"aria-label":c,as:h?"button":"div",className:classNames("np-card__button"),media:j,title:f,content:g,showMediaAtAllSizes:!0,button:h&&/*#__PURE__*/_jsx(Chevron,{orientation:n?Position.TOP:Position.BOTTOM}),onClick:function onClick(){return h&&i(!e)}}),/*#__PURE__*/_jsx("div",{className:classNames("np-card__divider",{"np-card__divider--expanded":n})}),n&&/*#__PURE__*/_jsx(
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["aria-label","as","isExpanded","title","details","children","onClick","icon","id","className"];import classNames from"classnames";import PropTypes from"prop-types";import{forwardRef}from"react";import requiredIf from"react-required-if";import Body from"../body";import Chevron from"../chevron";import{Position,Typography}from"../common";import Option from"../common/Option";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Card=/*#__PURE__*/forwardRef(function(a,b){var c=a["aria-label"],d=a.as,e=a.isExpanded,f=a.title,g=a.details,h=a.children,i=a.onClick,j=a.icon,k=a.id,l=a.className,m=_objectWithoutProperties(a,_excluded),n=!!(e&&h);return/*#__PURE__*/_jsxs(d,{ref:b,className:classNames("np-card",l,{"np-card--expanded":n,"np-card--inactive":!h,"np-card--has-icon":!!j}),id:k,"data-testid":m["data-testid"],children:[/*#__PURE__*/_jsx(Option,{"aria-label":c,as:h?"button":"div",className:classNames("np-card__button"),media:j,title:f,content:g,showMediaAtAllSizes:!0,button:h&&/*#__PURE__*/_jsx(Chevron,{orientation:n?Position.TOP:Position.BOTTOM}),onClick:function onClick(){return h&&i(!e)}}),/*#__PURE__*/_jsx("div",{className:classNames("np-card__divider",{"np-card__divider--expanded":n})}),n&&/*#__PURE__*/_jsx(Body,{type:Typography.BODY_LARGE,className:"np-card__content d-block",children:h})]})}),hasChildren=function(a){var b=a.children;return b};Card.propTypes={"aria-label":PropTypes.string,as:PropTypes.string,isExpanded:requiredIf(PropTypes.bool,hasChildren),title:PropTypes.node.isRequired,details:PropTypes.node.isRequired,onClick:requiredIf(PropTypes.func,hasChildren),icon:PropTypes.node,children:PropTypes.node,id:PropTypes.string,className:PropTypes.string,"data-testid":PropTypes.string},Card.defaultProps={"aria-label":void 0,as:"div",children:null,id:null,className:null,"data-testid":null};export default Card;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import classNames from"classnames";import PropTypes from"prop-types";import CheckboxButton from"../checkboxButton";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Checkbox=function(a){var b=a.id,c=a.checked,d=a.required,e=a.disabled,f=a.readOnly,g=a.label,h=a.className,i=a.secondary,j=a.onChange,k=a.onFocus,l=a.onBlur,m=d&&!e&&!f&&!c,n=classNames("np-checkbox",{checkbox:!0,"checkbox-lg":i,"has-error":m},h);return/*#__PURE__*/_jsx("div",{id:b,className:n,children:/*#__PURE__*/_jsxs("label",{className:classNames({disabled:e}),children:[/*#__PURE__*/_jsx(CheckboxButton,{className:classNames("p-r-2",{"has-error":m}),checked:c,disabled:e||f,onFocus:k,onChange:function onChange(){return j(!c)},onBlur:l}),/*#__PURE__*/_jsxs(
|
|
1
|
+
import classNames from"classnames";import PropTypes from"prop-types";import Body from"../body/Body";import CheckboxButton from"../checkboxButton";import{Typography}from"../common";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Checkbox=function(a){var b=a.id,c=a.checked,d=a.required,e=a.disabled,f=a.readOnly,g=a.label,h=a.className,i=a.secondary,j=a.onChange,k=a.onFocus,l=a.onBlur,m=d&&!e&&!f&&!c,n=classNames("np-checkbox",{checkbox:!0,"checkbox-lg":i,"has-error":m},h);return/*#__PURE__*/_jsx("div",{id:b,className:n,children:/*#__PURE__*/_jsxs("label",{className:classNames({disabled:e}),children:[/*#__PURE__*/_jsx(CheckboxButton,{className:classNames("p-r-2",{"has-error":m}),checked:c,disabled:e||f,onFocus:k,onChange:function onChange(){return j(!c)},onBlur:l}),/*#__PURE__*/_jsxs(Body,{type:i?Typography.BODY_LARGE_BOLD:Typography.BODY_DEFAULT,children:[g,d&&"*",i&&/*#__PURE__*/_jsx(Body,{children:i})]})]})})};Checkbox.propTypes={id:PropTypes.string,checked:PropTypes.bool,required:PropTypes.bool,disabled:PropTypes.bool,readOnly:PropTypes.bool,label:PropTypes.node.isRequired,secondary:PropTypes.string,onFocus:PropTypes.func,onChange:PropTypes.func.isRequired,onBlur:PropTypes.func,className:PropTypes.string},Checkbox.defaultProps={id:null,checked:!1,required:!1,disabled:!1,readOnly:!1,secondary:null,onFocus:null,onBlur:null,className:void 0};export default Checkbox;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["checked","className","disabled","onChange"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import classNames from"classnames";import
|
|
1
|
+
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["checked","className","disabled","onChange"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import classNames from"classnames";import{forwardRef}from"react";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var CheckboxButton=/*#__PURE__*/forwardRef(function(a,b){var c=a.checked,d=a.className,e=a.disabled,f=a.onChange,g=_objectWithoutProperties(a,_excluded);return/*#__PURE__*/_jsxs("span",{className:classNames("np-checkbox-button",d,e&&"disabled"),children:[/*#__PURE__*/_jsx("input",_objectSpread(_objectSpread({},g),{},{ref:b,type:"checkbox",disabled:e,checked:c,onChange:f})),/*#__PURE__*/_jsx("span",{className:"tw-checkbox-button",children:/*#__PURE__*/_jsx("span",{className:"tw-checkbox-check"})})]})});export default CheckboxButton;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/* eslint-disable jest/expect-expect */ /* eslint-disable testing-library/no-render-in-setup */import"@testing-library/jest-dom";import{render,fireEvent,screen}from"../test-utils";import CheckboxButton from".";import{jsx as _jsx}from"react/jsx-runtime";describe("Checkbox button",function(){describe("by default",function(){render(/*#__PURE__*/_jsx(CheckboxButton,{onChange:jest.fn()}));var a=screen.getByRole("checkbox");it("is not checked",function(){return expect(a).not.toBeChecked()}),it("is not disabled",function(){return expect(a).toBeEnabled()})}),it("applies aria-label if provided",function(){render(/*#__PURE__*/_jsx(CheckboxButton,{"aria-label":"An aria label",onChange:jest.fn()})),expect(screen.getByRole("checkbox",{name:"An aria label"})).toBeInTheDocument()}),it("is checked when checked prop is true",function(){render(/*#__PURE__*/_jsx(CheckboxButton,{checked:!0,onChange:jest.fn()})),expect(screen.getByRole("checkbox")).toBeChecked()}),it("is disabled when disabled prop is true",function(){render(/*#__PURE__*/_jsx(CheckboxButton,{disabled:!0,onChange:jest.fn()}));var a=screen.getByRole("checkbox");expect(a).toBeDisabled()}),it("calls onChange handler on change",function(){var a=jest.fn();render(/*#__PURE__*/_jsx(CheckboxButton,{onChange:a}));var b=screen.getByRole("checkbox");expect(a).not.toHaveBeenCalled(),fireEvent.click(b),expect(a).toHaveBeenCalledTimes(1)})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import{boolean}from"@storybook/addon-knobs";import{useState}from"react";import CheckboxButton from"./CheckboxButton";import{jsx as _jsx}from"react/jsx-runtime";export default{component:CheckboxButton,title:"CheckboxButton"};var onBlur=function(){return console.log("blur")},onClick=function(){return console.log("click")},onFocus=function(){return console.log("focus")};export var Basic=function(){var a=useState(!0),b=_slicedToArray(a,2),c=b[0],d=b[1],e=boolean("disabled",!1);return/*#__PURE__*/_jsx(CheckboxButton,{"aria-label":"Toggle email updates",checked:c,disabled:e,onBlur:onBlur,onClick:onClick,onFocus:onFocus,onChange:function onChange(){return d(!c)}})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _defineProperty from"@babel/runtime/helpers/defineProperty";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import
|
|
1
|
+
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["checked","disabled","onChange"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import{forwardRef}from"react";import CheckboxButton from"../checkboxButton";import Option from"../common/Option";import{jsx as _jsx}from"react/jsx-runtime";var CheckboxOption=/*#__PURE__*/forwardRef(function(a,b){var c=a.checked,d=a.disabled,e=a.onChange,f=_objectWithoutProperties(a,_excluded);return/*#__PURE__*/_jsx(Option,_objectSpread(_objectSpread({},f),{},{ref:b,disabled:d,button:/*#__PURE__*/_jsx(CheckboxButton,{checked:c,disabled:d,onChange:function onChange(){return e(!c)}})}))});export default CheckboxOption;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import _defineProperty from"@babel/runtime/helpers/defineProperty";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}/* eslint-disable jest/expect-expect */import"@testing-library/jest-dom";import{render,fireEvent,screen}from"../test-utils";import CheckboxOption from".";import{jsx as _jsx}from"react/jsx-runtime";describe("Checkbox option",function(){var a={id:"id",name:"name",title:"Title",onChange:jest.fn(),"aria-label":"test-label"};describe("by default",function(){render(/*#__PURE__*/_jsx(CheckboxOption,_objectSpread({},a)));var b=screen.getByRole("checkbox");it("is not checked",function(){expect(b).not.toBeChecked()}),it("is not disabled",function(){expect(b).toBeEnabled()})}),it("has `aria-label` attr",function(){render(/*#__PURE__*/_jsx(CheckboxOption,_objectSpread({},a)));var b=screen.getByLabelText("test-label");expect(b).toBeInTheDocument()}),it("is checked when checked prop is true",function(){render(/*#__PURE__*/_jsx(CheckboxOption,_objectSpread(_objectSpread({},a),{},{checked:!0}))),expect(screen.getByRole("checkbox")).toBeChecked()}),it("is disabled when disabled prop is true",function(){render(/*#__PURE__*/_jsx(CheckboxOption,_objectSpread(_objectSpread({},a),{},{disabled:!0}))),expect(screen.getByRole("checkbox")).toBeDisabled()}),describe("onChange",function(){it("is called with new checked value when the option is clicked",function(){var b=jest.fn(),c=render(/*#__PURE__*/_jsx(CheckboxOption,_objectSpread(_objectSpread({},a),{},{onChange:b}))),d=c.rerender,e=screen.getByLabelText("test-label");expect(b).not.toHaveBeenCalled(),fireEvent.click(e),expect(b).toHaveBeenCalledWith(!0),d(/*#__PURE__*/_jsx(CheckboxOption,_objectSpread(_objectSpread({},a),{},{checked:!0,onChange:b}))),fireEvent.click(e),expect(b).toHaveBeenCalledWith(!1)}),it("is not called if the option is disabled",function(){var b=jest.fn();render(/*#__PURE__*/_jsx(CheckboxOption,_objectSpread(_objectSpread({},a),{},{disabled:!0,onChange:b})));var c=screen.getByLabelText("test-label");expect(b).not.toHaveBeenCalled(),fireEvent.click(c),expect(b).not.toHaveBeenCalled()})})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import{boolean,text}from"@storybook/addon-knobs";import{FastFlag as FastFlagIcon}from"@transferwise/icons";import{useState}from"react";import CheckboxOption from"./CheckboxOption";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export default{component:CheckboxOption,title:"CheckboxOption"};var Template=function(){var a=useState(!0),b=_slicedToArray(a,2),c=b[0],d=b[1],e=text("content","Normally, the button and icon are vertically centered."),f=text("title","Checkbox option"),g=boolean("disabled",!1),h=boolean("showMediaAtAllSizes",!1);return/*#__PURE__*/_jsx(CheckboxOption,{id:"checkbox-option",name:"checkbox-option",checked:c,disabled:g,title:f,content:e,media:/*#__PURE__*/_jsx(FastFlagIcon,{}),showMediaAtAllSizes:h,onChange:function onChange(a){return d(a)}})};export var Basic=function(){return/*#__PURE__*/_jsx(Template,{})};export var Multiple=function(){return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(Template,{}),/*#__PURE__*/_jsx(Template,{}),/*#__PURE__*/_jsx(Template,{})]})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _defineProperty from"@babel/runtime/helpers/defineProperty";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import classNames from"classnames";import CloseButton from"../common/closeButton/CloseButton";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Chip=function(a){var b=a.label,c=a.value,d=a.onRemove,e=a.onClick,f=a.onKeyPress,g=a.className,h=void 0===g?void 0:g,i=a["aria-label"],j=a["aria-checked"],k=a.role,l=a.closeButton,m=e||f,n=m?"button":void 0,o=m?0:-1;return/*#__PURE__*/_jsxs("div",_objectSpread(_objectSpread({role:null!==k&&void 0!==k?k:n,tabIndex:o,"aria-label":i,"aria-checked":j,className:classNames("np-chip","d-flex","align-items-center","justify-content-between",h)},m&&{onClick:e,onKeyPress:f}),{},{children:[/*#__PURE__*/_jsx(
|
|
1
|
+
import _defineProperty from"@babel/runtime/helpers/defineProperty";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import classNames from"classnames";import Body from"../body/Body";import{Typography}from"../common";import CloseButton from"../common/closeButton/CloseButton";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Chip=function(a){var b=a.label,c=a.value,d=a.onRemove,e=a.onClick,f=a.onKeyPress,g=a.className,h=void 0===g?void 0:g,i=a["aria-label"],j=a["aria-checked"],k=a.role,l=a.closeButton,m=e||f,n=m?"button":void 0,o=m?0:-1;return/*#__PURE__*/_jsxs("div",_objectSpread(_objectSpread({role:null!==k&&void 0!==k?k:n,tabIndex:o,"aria-label":i,"aria-checked":j,className:classNames("np-chip","d-flex","align-items-center","justify-content-between",h)},m&&{onClick:e,onKeyPress:f}),{},{children:[/*#__PURE__*/_jsx(Body,{"aria-hidden":!!d,type:Typography.BODY_DEFAULT_BOLD,children:b}),d?/*#__PURE__*/_jsx(CloseButton/* @ts-expect-error remove when CloseButton will be written on TS */,{className:"btn-unstyled m-l-1","aria-label":l&&l["aria-label"],size:16,onClick:d}):null]}),c)};export default Chip;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["className","children","disabled","icon","priority","type"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import classNames from"classnames";import PropTypes from"prop-types";import{cloneElement}from"react";import{typeClassMap,priorityClassMap}from"../button/classMap";import{ControlType,Priority}from"../common";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var CircularButton=function(a){var b=a.className,c=a.children,d=a.disabled,e=a.icon,f=a.priority,g=a.type,h=_objectWithoutProperties(a,_excluded),i=classNames("btn np-btn",typeClassMap[g],priorityClassMap[f]),j=24===e.props.size?e:/*#__PURE__*/cloneElement(e,{size:24});return/*#__PURE__*/_jsxs("label",{className:classNames("np-circular-btn",f,g,d?"disabled":"",b),children:[/*#__PURE__*/_jsx("input",_objectSpread({type:"button","aria-label":c,className:i,disabled:d},h)),j,/*#__PURE__*/_jsx(
|
|
1
|
+
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["className","children","disabled","icon","priority","type"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import classNames from"classnames";import PropTypes from"prop-types";import{cloneElement}from"react";import Body from"../body/Body";import{typeClassMap,priorityClassMap}from"../button/classMap";import{ControlType,Priority}from"../common";import{Typography}from"../common";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var CircularButton=function(a){var b=a.className,c=a.children,d=a.disabled,e=a.icon,f=a.priority,g=a.type,h=_objectWithoutProperties(a,_excluded),i=classNames("btn np-btn",typeClassMap[g],priorityClassMap[f]),j=24===e.props.size?e:/*#__PURE__*/cloneElement(e,{size:24});return/*#__PURE__*/_jsxs("label",{className:classNames("np-circular-btn",f,g,d?"disabled":"",b),children:[/*#__PURE__*/_jsx("input",_objectSpread({type:"button","aria-label":c,className:i,disabled:d},h)),j,/*#__PURE__*/_jsx(Body,{className:"np-circular-btn__label",type:Typography.BODY_DEFAULT_BOLD,children:c})]})};CircularButton.propTypes={className:PropTypes.string,children:PropTypes.string.isRequired,disabled:PropTypes.bool,icon:PropTypes.element.isRequired,onClick:PropTypes.func.isRequired,priority:PropTypes.oneOf(["primary","secondary"]),type:PropTypes.oneOf(["accent","positive","negative"])},CircularButton.defaultProps={className:void 0,disabled:!1,priority:Priority.PRIMARY,type:ControlType.ACCENT};export default CircularButton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["media","title","content","as","button","decision","disabled","complex","inverseMediaCircle","className","showMediaAtAllSizes","showMediaCircle"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import classNames from"classnames";import{forwardRef}from"react";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Option=/*#__PURE__*/forwardRef(function(a,b){var c,d=a.media,e=void 0===d?"":d,f=a.title,g=a.content,h=a.as,i=a.button,j=a.decision,k=a.disabled,l=void 0!==k&&k,m=a.complex,n=a.inverseMediaCircle,o=a.className,p=a.showMediaAtAllSizes,q=a.showMediaCircle,r=_objectWithoutProperties(a,_excluded),s=null!==(c=h)&&void 0!==c?c:"label";return/*#__PURE__*/_jsx(s,_objectSpread(_objectSpread({},r),{},{ref:b,className:classNames("np-option",o,{"decision-complex":m,decision:!(void 0!==j)||j,disabled:l,"np-option__sm-media":p}),disabled:l&&"button"===s,children:/*#__PURE__*/_jsxs("div",{className:"media",children:[e&&/*#__PURE__*/_jsx("div",{className:"media-left",children:!(void 0!==q)||q?/*#__PURE__*/_jsx("div",{className:classNames("circle circle-sm text-primary",{"circle-inverse":!(void 0!==n)||n}),children:e}):/*#__PURE__*/_jsx("div",{className:"np-option__no-media-circle",children:e})}),/*#__PURE__*/_jsxs("div",{className:"media-body",children:[/*#__PURE__*/_jsx(
|
|
1
|
+
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["media","title","content","as","button","decision","disabled","complex","inverseMediaCircle","className","showMediaAtAllSizes","showMediaCircle"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import classNames from"classnames";import{forwardRef}from"react";import Body from"../../body";import{Typography}from"../propsValues/typography";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Option=/*#__PURE__*/forwardRef(function(a,b){var c,d=a.media,e=void 0===d?"":d,f=a.title,g=a.content,h=a.as,i=a.button,j=a.decision,k=a.disabled,l=void 0!==k&&k,m=a.complex,n=a.inverseMediaCircle,o=a.className,p=a.showMediaAtAllSizes,q=a.showMediaCircle,r=_objectWithoutProperties(a,_excluded),s=null!==(c=h)&&void 0!==c?c:"label";return/*#__PURE__*/_jsx(s,_objectSpread(_objectSpread({},r),{},{ref:b,className:classNames("np-option",o,{"decision-complex":m,decision:!(void 0!==j)||j,disabled:l,"np-option__sm-media":p}),disabled:l&&"button"===s,children:/*#__PURE__*/_jsxs("div",{className:"media",children:[e&&/*#__PURE__*/_jsx("div",{className:"media-left",children:!(void 0!==q)||q?/*#__PURE__*/_jsx("div",{className:classNames("circle circle-sm text-primary",{"circle-inverse":!(void 0!==n)||n}),children:e}):/*#__PURE__*/_jsx("div",{className:"np-option__no-media-circle",children:e})}),/*#__PURE__*/_jsxs("div",{className:"media-body",children:[/*#__PURE__*/_jsx(Body,{type:Typography.BODY_LARGE_BOLD,className:"text-primary",children:f}),g&&/*#__PURE__*/_jsx(Body,{className:"d-block",children:g})]}),/*#__PURE__*/_jsx("div",{className:"media-right",children:i})]})}))});export default Option;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Cross as CrossIcon
|
|
1
|
+
import{Cross as CrossIcon}from"@transferwise/icons";import classNames from"classnames";import PropTypes from"prop-types";import{forwardRef}from"react";import{useIntl}from"react-intl";import messages from"./CloseButton.messages";import{jsx as _jsx}from"react/jsx-runtime";export var CloseButton=/*#__PURE__*/forwardRef(function(a,b){var c=useIntl(),d=a.onClick,e=a.size,f=a.className,g=a["aria-label"]||c.formatMessage(messages.ariaLabel);return/*#__PURE__*/_jsx("button",{ref:b,type:"button",className:classNames("np-close-button","close btn-link","text-no-decoration",{"np-close-button--large":e===CloseButton.Size.LARGE},f),"aria-label":g,onClick:d,children:/*#__PURE__*/_jsx(CrossIcon,{size:e})})});CloseButton.Size={SMALL:16,LARGE:24},CloseButton.propTypes={onClick:PropTypes.func.isRequired,className:PropTypes.string,size:PropTypes.oneOf(Object.values(CloseButton.Size)),"aria-label":PropTypes.string},CloseButton.defaultProps={className:null,size:CloseButton.Size.LARGE,"aria-label":void 0};export default CloseButton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export function isServerSide(){return"undefined"==typeof window}export function isBrowser(){return!isServerSide()}export function stopPropagation(a){a.stopPropagation(),a.preventDefault(),a.nativeEvent&&a.nativeEvent.stopImmediatePropagation&&a.nativeEvent.stopImmediatePropagation()}export{addClickClassToDocumentOnIos,removeClickClassFromDocumentOnIos}from"./documentIosClick";
|
|
1
|
+
export function isServerSide(){return"undefined"==typeof window}export function isBrowser(){return!isServerSide()}export function stopPropagation(a){a.stopPropagation(),a.preventDefault(),a.nativeEvent&&a.nativeEvent.stopImmediatePropagation&&a.nativeEvent.stopImmediatePropagation()}export function getSimpleRandomId(a){var b=Math.ceil(999999*Math.random());return"".concat(a).concat(b)}export{addClickClassToDocumentOnIos,removeClickClassFromDocumentOnIos}from"./documentIosClick";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{renderHook}from"@testing-library/react-hooks";import{Theme}from"../../../common/theme";import{ThemeProvider}from"../../../provider";import{useTheme}from"./useTheme";
|
|
1
|
+
import{renderHook}from"@testing-library/react-hooks";import{Theme}from"../../../common/theme";import{ThemeProvider}from"../../../provider";import{useTheme}from"./useTheme";describe("useTheme",function(){it("returns default light theme",function(){var a=renderHook(function(){return useTheme()}),b=a.result.current;expect(b).toStrictEqual(Theme.LIGHT)}),it("returns provided theme",function(){var a=renderHook(function(){return useTheme()},{wrapper:ThemeProvider,initialProps:{theme:Theme.NAVY}}),b=a.result.current;expect(b).toStrictEqual(Theme.NAVY)})});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export{default as HistoryNavigator}from"./historyNavigator";export*from"./domHelpers";export{addNoScrollBodyClass,removeNoScrollBodyClass}from"./DOMOperations";export*from"./theme";export*from"./direction";// Props
|
|
2
|
-
export*from"./propsValues/control";export{Breakpoint}from"./propsValues/breakpoint";export*from"./propsValues/size";export*from"./propsValues/width";export{Type}from"./propsValues/type";export{DateMode}from"./propsValues/dateMode";export{MonthFormat}from"./propsValues/monthFormat";export*from"./propsValues/position";export{Layout}from"./propsValues/layouts";export{Status}from"./propsValues/status";export{Sentiment}from"./propsValues/sentiment";export{ProfileType}from"./propsValues/profileType";export*from"./propsValues/scroll";export{MarkdownNodeType}from"./propsValues/markdownNodeType";export{FileType}from"./fileType";export{Key}from"./key";export*from"./locale";export*from"./commonProps";
|
|
2
|
+
export*from"./propsValues/control";export{Breakpoint}from"./propsValues/breakpoint";export*from"./propsValues/size";export*from"./propsValues/typography";export*from"./propsValues/width";export{Type}from"./propsValues/type";export{DateMode}from"./propsValues/dateMode";export{MonthFormat}from"./propsValues/monthFormat";export*from"./propsValues/position";export{Layout}from"./propsValues/layouts";export{Status}from"./propsValues/status";export{Sentiment}from"./propsValues/sentiment";export{ProfileType}from"./propsValues/profileType";export*from"./propsValues/scroll";export{MarkdownNodeType}from"./propsValues/markdownNodeType";export{FileType}from"./fileType";export{Key}from"./key";export*from"./locale";export*from"./commonProps";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export var Typography;(function(a){a.TITLE_SCREEN="title-screen",a.TITLE_SECTION="title-section",a.TITLE_SUBSECTION="title-subsection",a.TITLE_BODY="title-body",a.TITLE_GROUP="title-group",a.BODY_LARGE="body-large",a.BODY_DEFAULT="body-default",a.BODY_DEFAULT_BOLD="body-default-bold",a.BODY_LARGE_BOLD="body-large-bold",a.LINK_LARGE="link-large",a.LINK_DEFAULT="link-default"})(Typography||(Typography={}));
|