@transferwise/components 0.0.0-experimental-5b64b75 → 0.0.0-experimental-48c38c1
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/build/es/no-polyfill/accordion/Accordion.js +1 -1
- package/build/es/no-polyfill/accordion/Accordion.story.js +1 -1
- 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/actionButton/ActionButton.spec.js +1 -1
- package/build/es/no-polyfill/actionButton/ActionButton.story.js +1 -1
- package/build/es/no-polyfill/actionOption/ActionOption.js +1 -1
- package/build/es/no-polyfill/actionOption/ActionOption.story.js +1 -1
- package/build/es/no-polyfill/alert/Alert.js +1 -1
- package/build/es/no-polyfill/alert/Alert.story.js +1 -1
- package/build/es/no-polyfill/alert/inlineMarkdown/InlineMarkdown.js +1 -1
- package/build/es/no-polyfill/alert/withArrow/alertArrowPositions.js +1 -1
- package/build/es/no-polyfill/alert/withArrow/withArrow.js +1 -1
- package/build/es/no-polyfill/avatar/Avatar.js +1 -1
- package/build/es/no-polyfill/avatar/Avatar.story.js +1 -1
- package/build/es/no-polyfill/avatar/avatarTypes.js +1 -1
- package/build/es/no-polyfill/avatar/colors/colors.js +2 -2
- package/build/es/no-polyfill/avatarWrapper/AvatarWrapper.js +1 -1
- package/build/es/no-polyfill/avatarWrapper/AvatarWrapper.story.js +1 -1
- package/build/es/no-polyfill/badge/Badge.js +1 -1
- package/build/es/no-polyfill/body/Body.js +2 -2
- package/build/es/no-polyfill/body/Body.spec.js +1 -1
- package/build/es/no-polyfill/body/Body.story.js +1 -1
- package/build/es/no-polyfill/button/Button.js +5 -5
- package/build/es/no-polyfill/button/Button.story.js +1 -1
- package/build/es/no-polyfill/button/classMap.js +1 -1
- package/build/es/no-polyfill/button/legacyUtils/legacyUtils.js +2 -2
- 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/checkbox/Checkbox.story.js +1 -1
- package/build/es/no-polyfill/checkboxButton/CheckboxButton.js +1 -1
- package/build/es/no-polyfill/checkboxButton/CheckboxButton.spec.js +1 -1
- package/build/es/no-polyfill/checkboxButton/CheckboxButton.story.js +2 -2
- package/build/es/no-polyfill/checkboxOption/CheckboxOption.js +1 -1
- package/build/es/no-polyfill/checkboxOption/CheckboxOption.spec.js +1 -1
- package/build/es/no-polyfill/checkboxOption/CheckboxOption.story.js +1 -1
- package/build/es/no-polyfill/chevron/Chevron.js +1 -1
- package/build/es/no-polyfill/chevron/Chevron.story.js +1 -1
- package/build/es/no-polyfill/chips/Chip.js +1 -1
- package/build/es/no-polyfill/chips/Chips.js +1 -1
- package/build/es/no-polyfill/chips/Chips.spec.js +1 -1
- package/build/es/no-polyfill/chips/Chips.story.js +1 -1
- package/build/es/no-polyfill/circularButton/CircularButton.js +1 -1
- package/build/es/no-polyfill/common/DOMOperations/DOMOperations.js +3 -3
- package/build/es/no-polyfill/common/Option/Option.js +1 -1
- package/build/es/no-polyfill/common/RadioButton/RadioButton.js +1 -1
- package/build/es/no-polyfill/common/bottomSheet/BottomSheet.js +4 -4
- package/build/es/no-polyfill/common/bottomSheet/BottomSheet.spec.js +1 -1
- package/build/es/no-polyfill/common/bottomSheet/BottomSheet.story.js +2 -2
- package/build/es/no-polyfill/common/closeButton/CloseButton.js +1 -1
- package/build/es/no-polyfill/common/dateUtils/getDayNames/getDayNames.js +2 -2
- package/build/es/no-polyfill/common/dateUtils/getMonthNames/getMonthNames.js +1 -1
- package/build/es/no-polyfill/common/dateUtils/isDateValid/isDateValid.js +1 -1
- package/build/es/no-polyfill/common/dateUtils/isMonthAndYearFormat/isMonthAndYearFormat.js +1 -1
- package/build/es/no-polyfill/common/deviceDetection/deviceDetection.js +1 -1
- package/build/es/no-polyfill/common/direction.js +1 -1
- package/build/es/no-polyfill/common/domHelpers/index.js +1 -1
- package/build/es/no-polyfill/common/fakeEvents.js +1 -1
- package/build/es/no-polyfill/common/fileType.js +1 -1
- package/build/es/no-polyfill/common/flowHeader/FlowHeader.js +1 -1
- package/build/es/no-polyfill/common/focusBoundary/FocusBoundary.js +1 -1
- package/build/es/no-polyfill/common/focusBoundary/FocusBoundary.spec.js +1 -1
- package/build/es/no-polyfill/common/focusBoundary/utils/getFocusableElements.js +2 -2
- package/build/es/no-polyfill/common/focusBoundary/utils/resetFocus.js +1 -1
- package/build/es/no-polyfill/common/historyNavigator/historyNavigator.js +1 -1
- package/build/es/no-polyfill/common/hooks/useClientWidth/useClientWidth.js +3 -3
- package/build/es/no-polyfill/common/hooks/useConditionalListener/useConditionalListener.js +1 -1
- package/build/es/no-polyfill/common/hooks/useDirection/useDirection.js +1 -1
- package/build/es/no-polyfill/common/hooks/useHasIntersected/useHasIntersected.js +2 -2
- package/build/es/no-polyfill/common/hooks/useLayout/useLayout.js +1 -1
- package/build/es/no-polyfill/common/key.js +1 -1
- package/build/es/no-polyfill/common/locale/index.js +7 -7
- package/build/es/no-polyfill/common/panel/Panel.js +6 -6
- package/build/es/no-polyfill/common/propsValues/breakpoint.js +1 -1
- package/build/es/no-polyfill/common/propsValues/control.js +1 -1
- package/build/es/no-polyfill/common/propsValues/dateMode.js +1 -1
- package/build/es/no-polyfill/common/propsValues/layouts.js +1 -1
- package/build/es/no-polyfill/common/propsValues/markdownNodeType.js +1 -1
- package/build/es/no-polyfill/common/propsValues/monthFormat.js +1 -1
- package/build/es/no-polyfill/common/propsValues/position.js +1 -1
- package/build/es/no-polyfill/common/propsValues/profileType.js +1 -1
- package/build/es/no-polyfill/common/propsValues/scroll.js +1 -1
- package/build/es/no-polyfill/common/propsValues/sentiment.js +1 -1
- package/build/es/no-polyfill/common/propsValues/size.js +1 -1
- package/build/es/no-polyfill/common/propsValues/status.js +1 -1
- package/build/es/no-polyfill/common/propsValues/type.js +1 -1
- package/build/es/no-polyfill/common/propsValues/typography.js +1 -1
- package/build/es/no-polyfill/common/propsValues/variant.js +1 -1
- package/build/es/no-polyfill/common/propsValues/width.js +1 -1
- package/build/es/no-polyfill/common/requirements.js +2 -2
- package/build/es/no-polyfill/common/responsivePanel/ResponsivePanel.js +1 -1
- package/build/es/no-polyfill/common/textFormat/formatWithPattern/formatWithPattern.js +2 -2
- package/build/es/no-polyfill/common/textFormat/getCountOfSymbolsInSelection/getCountOfSymbolsInSelection.js +1 -1
- package/build/es/no-polyfill/common/textFormat/getCursorPositionAfterKeystroke/getCursorPositionAfterKeystroke.js +1 -1
- package/build/es/no-polyfill/common/textFormat/getDistanceToSymbol/getDistanceToSymbol.js +1 -1
- package/build/es/no-polyfill/common/textFormat/getSymbolsInPatternWithPosition/getSymbolsInPatternWithPosition.js +1 -1
- package/build/es/no-polyfill/common/textFormat/unformatWithPattern/unformatWithPattern.js +1 -1
- package/build/es/no-polyfill/common/theme.js +1 -1
- package/build/es/no-polyfill/criticalBanner/CriticalCommsBanner.js +1 -1
- package/build/es/no-polyfill/criticalBanner/CriticalCommsBanner.story.js +1 -1
- package/build/es/no-polyfill/dateInput/DateInput.js +4 -10
- package/build/es/no-polyfill/dateInput/DateInput.story.js +1 -1
- package/build/es/no-polyfill/dateInput/utils/convertToLocalMidnight/convertToLocalMidnight.js +1 -1
- package/build/es/no-polyfill/dateInput/utils/explodeDate/explodeDate.js +1 -1
- package/build/es/no-polyfill/dateLookup/DateLookup.js +3 -4
- 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/DayCalendar.js +1 -1
- package/build/es/no-polyfill/dateLookup/dayCalendar/table/DayCalendarTable.js +4 -5
- package/build/es/no-polyfill/dateLookup/monthCalendar/MonthCalendar.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/dateLookup/yearCalendar/YearCalendar.js +1 -1
- package/build/es/no-polyfill/dateLookup/yearCalendar/table/YearCalendarTable.js +1 -1
- package/build/es/no-polyfill/decision/Decision.js +5 -5
- package/build/es/no-polyfill/decision/decisionEnums.js +2 -2
- package/build/es/no-polyfill/definitionList/DefinitionList.js +1 -1
- package/build/es/no-polyfill/dimmer/Dimmer.js +3 -3
- package/build/es/no-polyfill/dimmer/Dimmer.story.js +2 -2
- package/build/es/no-polyfill/dimmer/dimmerManager/DimmerManager.js +3 -3
- package/build/es/no-polyfill/display/Display.js +1 -1
- package/build/es/no-polyfill/display/Display.story.js +2 -2
- package/build/es/no-polyfill/drawer/Drawer.js +1 -1
- package/build/es/no-polyfill/dropFade/DropFade.js +3 -3
- package/build/es/no-polyfill/dropFade/DropFade.story.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/dynamicFieldDefinitionList/utils/createDefinitions.js +2 -2
- package/build/es/no-polyfill/dynamicFieldDefinitionList/utils/text-format.js +1 -1
- package/build/es/no-polyfill/emphasis/Emphasis.js +2 -2
- package/build/es/no-polyfill/emphasis/Emphasis.story.js +1 -1
- package/build/es/no-polyfill/emphasis/EmphasisHtmlTransformer.js +2 -2
- package/build/es/no-polyfill/flowNavigation/FlowNavigation.js +2 -2
- package/build/es/no-polyfill/flowNavigation/animatedLabel/AnimatedLabel.js +1 -1
- package/build/es/no-polyfill/flowNavigation/backButton/BackButton.js +1 -1
- package/build/es/no-polyfill/header/Header.js +2 -2
- package/build/es/no-polyfill/header/Header.spec.js +1 -1
- package/build/es/no-polyfill/header/Header.story.js +2 -1
- package/build/es/no-polyfill/i18n/index.js +1 -1
- package/build/es/no-polyfill/image/Image.js +2 -2
- package/build/es/no-polyfill/info/Info.js +1 -1
- package/build/es/no-polyfill/info/Info.story.js +1 -1
- package/build/es/no-polyfill/info/infoPresentations.js +1 -1
- package/build/es/no-polyfill/inlineAlert/InlineAlert.js +1 -1
- package/build/es/no-polyfill/inputWithDisplayFormat/InputWithDisplayFormat.js +1 -1
- package/build/es/no-polyfill/inputs/Input.js +1 -1
- package/build/es/no-polyfill/inputs/TextArea.js +1 -1
- package/build/es/no-polyfill/inputs/_common.js +2 -2
- package/build/es/no-polyfill/instructionsList/InstructionsList.js +3 -3
- package/build/es/no-polyfill/link/Link.js +2 -2
- package/build/es/no-polyfill/link/Link.spec.js +1 -1
- package/build/es/no-polyfill/link/Link.story.js +1 -1
- package/build/es/no-polyfill/listItem/ListItem.js +1 -1
- package/build/es/no-polyfill/listItem/ListItem.spec.js +1 -1
- package/build/es/no-polyfill/listItem/ListItem.story.js +1 -1
- package/build/es/no-polyfill/loader/Loader.js +2 -2
- package/build/es/no-polyfill/loader/Loader.story.js +1 -1
- package/build/es/no-polyfill/logo/Logo.js +1 -1
- package/build/es/no-polyfill/logo/Logo.story.js +1 -1
- package/build/es/no-polyfill/logo/logoTypes.js +1 -1
- package/build/es/no-polyfill/markdown/Markdown.js +1 -1
- package/build/es/no-polyfill/markdown/Markdown.story.js +1 -1
- package/build/es/no-polyfill/modal/Modal.js +1 -1
- package/build/es/no-polyfill/modal/Modal.story.js +2 -2
- package/build/es/no-polyfill/money/Money.js +1 -1
- package/build/es/no-polyfill/money/Money.story.js +1 -1
- package/build/es/no-polyfill/moneyInput/MoneyInput.js +1 -1
- package/build/es/no-polyfill/moneyInput/MoneyInput.story.js +1 -1
- package/build/es/no-polyfill/moneyInput/currencyFormatting.js +2 -2
- package/build/es/no-polyfill/navigationOption/NavigationOption.js +1 -1
- package/build/es/no-polyfill/navigationOptionsList/NavigationOptionsList.js +1 -1
- package/build/es/no-polyfill/nudge/Nudge.js +1 -1
- package/build/es/no-polyfill/overlayHeader/OverlayHeader.js +1 -1
- package/build/es/no-polyfill/phoneNumberInput/PhoneNumberInput.js +1 -1
- package/build/es/no-polyfill/phoneNumberInput/data/countries.js +1 -1
- package/build/es/no-polyfill/phoneNumberInput/utils/cleanNumber/cleanNumber.js +1 -1
- package/build/es/no-polyfill/phoneNumberInput/utils/excludeCountries/excludeCountries.js +2 -2
- package/build/es/no-polyfill/phoneNumberInput/utils/explodeNumberModel/index.js +1 -1
- package/build/es/no-polyfill/phoneNumberInput/utils/filterOptionsForQuery/index.js +1 -1
- package/build/es/no-polyfill/phoneNumberInput/utils/findCountryByCode/index.js +1 -1
- package/build/es/no-polyfill/phoneNumberInput/utils/findCountryByPrefix/index.js +1 -1
- package/build/es/no-polyfill/phoneNumberInput/utils/groupCountriesByPrefix/groupCountriesByPrefix.js +1 -1
- package/build/es/no-polyfill/phoneNumberInput/utils/isOptionAndFitsQuery/isOptionAndFitsQuery.js +1 -1
- package/build/es/no-polyfill/phoneNumberInput/utils/isStringNumeric/isStringNumeric.js +1 -1
- package/build/es/no-polyfill/phoneNumberInput/utils/isValidPhoneNumber/isValidPhoneNumber.js +1 -1
- package/build/es/no-polyfill/phoneNumberInput/utils/longestMatchingPrefix/index.js +1 -1
- package/build/es/no-polyfill/phoneNumberInput/utils/setDefaultPrefix/index.js +2 -2
- package/build/es/no-polyfill/phoneNumberInput/utils/sortArrayByProperty/sortArrayByProperty.js +2 -2
- package/build/es/no-polyfill/popover/Popover.js +2 -2
- package/build/es/no-polyfill/processIndicator/ProcessIndicator.js +4 -4
- package/build/es/no-polyfill/processIndicator/ProcessIndicator.story.js +1 -1
- package/build/es/no-polyfill/progress/Progress.js +1 -1
- package/build/es/no-polyfill/progress/Progress.story.js +1 -1
- package/build/es/no-polyfill/progressBar/ProgressBar.js +1 -1
- package/build/es/no-polyfill/progressBar/ProgressBar.story.js +1 -1
- package/build/es/no-polyfill/provider/Provider.js +1 -1
- package/build/es/no-polyfill/provider/Provider.spec.js +1 -1
- package/build/es/no-polyfill/provider/Provider.story.js +1 -1
- package/build/es/no-polyfill/provider/direction/DirectionProvider.js +1 -1
- package/build/es/no-polyfill/provider/direction/DirectionProvider.spec.js +1 -1
- package/build/es/no-polyfill/provider/language/LanguageProvider.js +1 -1
- package/build/es/no-polyfill/provider/language/LanguageProvider.spec.js +1 -1
- package/build/es/no-polyfill/radio/Radio.js +1 -1
- package/build/es/no-polyfill/radioGroup/RadioGroup.js +2 -2
- package/build/es/no-polyfill/radioOption/RadioOption.js +1 -1
- package/build/es/no-polyfill/section/Section.js +1 -1
- package/build/es/no-polyfill/section/Section.spec.js +1 -1
- package/build/es/no-polyfill/section/Section.story.js +1 -1
- package/build/es/no-polyfill/select/Select.js +8 -9
- package/build/es/no-polyfill/select/option/Option.js +1 -1
- package/build/es/no-polyfill/select/searchBox/SearchBox.js +1 -1
- package/build/es/no-polyfill/sizeSwapper/SizeSwapper.js +3 -3
- package/build/es/no-polyfill/slidingPanel/SlidingPanel.js +1 -1
- package/build/es/no-polyfill/snackbar/Snackbar.js +1 -1
- package/build/es/no-polyfill/snackbar/SnackbarContext.js +1 -1
- package/build/es/no-polyfill/snackbar/SnackbarProvider.js +1 -1
- package/build/es/no-polyfill/snackbar/useSnackbar.js +1 -1
- package/build/es/no-polyfill/statusIcon/StatusIcon.js +1 -1
- package/build/es/no-polyfill/statusIcon/StatusIcon.story.js +1 -1
- package/build/es/no-polyfill/stepper/Stepper.js +1 -1
- package/build/es/no-polyfill/stepper/deviceDetection.js +2 -2
- package/build/es/no-polyfill/sticky/Sticky.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/switch/Switch.story.js +1 -1
- package/build/es/no-polyfill/switchOption/SwitchOption.js +1 -1
- package/build/es/no-polyfill/switchOption/SwitchOption.story.js +1 -1
- package/build/es/no-polyfill/tabs/Tab.js +1 -1
- package/build/es/no-polyfill/tabs/TabList.js +1 -1
- package/build/es/no-polyfill/tabs/TabPanel.js +1 -1
- package/build/es/no-polyfill/tabs/Tabs.js +1 -5
- package/build/es/no-polyfill/tabs/utils.js +2 -2
- package/build/es/no-polyfill/textareaWithDisplayFormat/TextareaWithDisplayFormat.js +1 -1
- package/build/es/no-polyfill/tile/Tile.js +1 -1
- package/build/es/no-polyfill/title/Title.js +1 -1
- package/build/es/no-polyfill/title/Title.spec.js +1 -1
- package/build/es/no-polyfill/title/Title.story.js +1 -1
- package/build/es/no-polyfill/tooltip/Tooltip.js +7 -7
- package/build/es/no-polyfill/tooltip/Tooltip.spec.js +1 -1
- package/build/es/no-polyfill/tooltip/Tooltip.story.js +1 -1
- package/build/es/no-polyfill/typeahead/Typeahead.js +1 -1
- package/build/es/no-polyfill/typeahead/typeaheadInput/TypeaheadInput.js +1 -1
- package/build/es/no-polyfill/typeahead/typeaheadOption/TypeaheadOption.js +1 -1
- package/build/es/no-polyfill/typeahead/util/highlight.js +1 -1
- package/build/es/no-polyfill/upload/Upload.js +2 -6
- 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/upload/uploadSteps.js +1 -1
- package/build/es/no-polyfill/upload/utils/asyncFileRead/asyncFileRead.js +1 -1
- package/build/es/no-polyfill/upload/utils/getFileType/getFileType.js +1 -1
- package/build/es/no-polyfill/upload/utils/getSupportedSpotMimeTypes/getSupportedSpotMimeTypes.js +1 -1
- package/build/es/no-polyfill/upload/utils/isSizeValid/isSizeValid.js +1 -1
- package/build/es/no-polyfill/upload/utils/isTypeValid/isTypeValid.js +1 -1
- package/build/es/no-polyfill/upload/utils/postData/postData.js +1 -1
- package/build/es/no-polyfill/upload/utils/requestMedia/requestMedia.js +1 -1
- package/build/es/no-polyfill/uploadInput/UploadInput.js +7 -7
- package/build/es/no-polyfill/uploadInput/UploadInput.spec.js +1 -1
- package/build/es/no-polyfill/uploadInput/UploadInput.story.js +1 -1
- package/build/es/no-polyfill/uploadInput/uploadButton/UploadButton.js +1 -1
- package/build/es/no-polyfill/uploadInput/uploadButton/UploadButton.spec.js +3 -3
- package/build/es/no-polyfill/uploadInput/uploadButton/defaults.js +1 -1
- package/build/es/no-polyfill/uploadInput/uploadButton/getAllowedFileTypes.js +3 -3
- package/build/es/no-polyfill/uploadInput/uploadButton/getAllowedFileTypes.spec.js +1 -1
- package/build/es/no-polyfill/uploadInput/uploadItem/UploadItem.js +2 -2
- package/build/es/no-polyfill/uploadInput/uploadItem/UploadItem.spec.js +1 -1
- package/build/es/no-polyfill/uploadInput/uploadItem/UploadItemBody.js +1 -1
- package/build/es/no-polyfill/utilities/deprecatedProperty/deprecatedProperty.js +1 -1
- package/build/es/no-polyfill/withDisplayFormat/WithDisplayFormat.js +3 -4
- package/build/es/no-polyfill/withNextPortal/withNextPortal.js +1 -1
- package/build/es/polyfill/accordion/Accordion.js +1 -1
- package/build/es/polyfill/accordion/Accordion.story.js +1 -1
- package/build/es/polyfill/accordion/AccordionItem/AccordionItem.js +1 -1
- package/build/es/polyfill/actionButton/ActionButton.js +1 -1
- package/build/es/polyfill/actionButton/ActionButton.spec.js +1 -1
- package/build/es/polyfill/actionButton/ActionButton.story.js +1 -1
- package/build/es/polyfill/actionOption/ActionOption.js +1 -1
- package/build/es/polyfill/actionOption/ActionOption.story.js +1 -1
- package/build/es/polyfill/alert/Alert.js +1 -1
- package/build/es/polyfill/alert/Alert.story.js +1 -1
- package/build/es/polyfill/alert/inlineMarkdown/InlineMarkdown.js +1 -1
- package/build/es/polyfill/alert/withArrow/alertArrowPositions.js +1 -1
- package/build/es/polyfill/alert/withArrow/withArrow.js +1 -1
- package/build/es/polyfill/avatar/Avatar.js +1 -1
- package/build/es/polyfill/avatar/Avatar.story.js +1 -1
- package/build/es/polyfill/avatar/avatarTypes.js +1 -1
- package/build/es/polyfill/avatar/colors/colors.js +2 -2
- package/build/es/polyfill/avatarWrapper/AvatarWrapper.js +1 -1
- package/build/es/polyfill/avatarWrapper/AvatarWrapper.story.js +1 -1
- package/build/es/polyfill/badge/Badge.js +1 -1
- package/build/es/polyfill/body/Body.js +2 -2
- package/build/es/polyfill/body/Body.spec.js +1 -1
- package/build/es/polyfill/body/Body.story.js +1 -1
- package/build/es/polyfill/button/Button.js +5 -5
- package/build/es/polyfill/button/Button.story.js +1 -1
- package/build/es/polyfill/button/classMap.js +1 -1
- package/build/es/polyfill/button/legacyUtils/legacyUtils.js +2 -2
- package/build/es/polyfill/card/Card.js +1 -1
- package/build/es/polyfill/checkbox/Checkbox.js +1 -1
- package/build/es/polyfill/checkbox/Checkbox.story.js +1 -1
- package/build/es/polyfill/checkboxButton/CheckboxButton.js +1 -1
- package/build/es/polyfill/checkboxButton/CheckboxButton.spec.js +1 -1
- package/build/es/polyfill/checkboxButton/CheckboxButton.story.js +2 -2
- package/build/es/polyfill/checkboxOption/CheckboxOption.js +1 -1
- package/build/es/polyfill/checkboxOption/CheckboxOption.spec.js +1 -1
- package/build/es/polyfill/checkboxOption/CheckboxOption.story.js +1 -1
- package/build/es/polyfill/chevron/Chevron.js +1 -1
- package/build/es/polyfill/chevron/Chevron.story.js +1 -1
- package/build/es/polyfill/chips/Chip.js +1 -1
- package/build/es/polyfill/chips/Chips.js +1 -1
- package/build/es/polyfill/chips/Chips.spec.js +1 -1
- package/build/es/polyfill/chips/Chips.story.js +1 -1
- package/build/es/polyfill/circularButton/CircularButton.js +1 -1
- package/build/es/polyfill/common/DOMOperations/DOMOperations.js +3 -3
- package/build/es/polyfill/common/Option/Option.js +1 -1
- package/build/es/polyfill/common/RadioButton/RadioButton.js +1 -1
- package/build/es/polyfill/common/bottomSheet/BottomSheet.js +4 -4
- package/build/es/polyfill/common/bottomSheet/BottomSheet.spec.js +1 -1
- package/build/es/polyfill/common/bottomSheet/BottomSheet.story.js +2 -2
- package/build/es/polyfill/common/closeButton/CloseButton.js +1 -1
- package/build/es/polyfill/common/dateUtils/getDayNames/getDayNames.js +2 -2
- package/build/es/polyfill/common/dateUtils/getMonthNames/getMonthNames.js +1 -1
- package/build/es/polyfill/common/dateUtils/isDateValid/isDateValid.js +1 -1
- package/build/es/polyfill/common/dateUtils/isMonthAndYearFormat/isMonthAndYearFormat.js +1 -1
- package/build/es/polyfill/common/deviceDetection/deviceDetection.js +1 -1
- package/build/es/polyfill/common/direction.js +1 -1
- package/build/es/polyfill/common/domHelpers/index.js +1 -1
- package/build/es/polyfill/common/fakeEvents.js +1 -1
- package/build/es/polyfill/common/fileType.js +1 -1
- package/build/es/polyfill/common/flowHeader/FlowHeader.js +1 -1
- package/build/es/polyfill/common/focusBoundary/FocusBoundary.js +1 -1
- package/build/es/polyfill/common/focusBoundary/FocusBoundary.spec.js +1 -1
- package/build/es/polyfill/common/focusBoundary/utils/getFocusableElements.js +2 -2
- package/build/es/polyfill/common/focusBoundary/utils/resetFocus.js +1 -1
- package/build/es/polyfill/common/historyNavigator/historyNavigator.js +1 -1
- package/build/es/polyfill/common/hooks/useClientWidth/useClientWidth.js +3 -3
- package/build/es/polyfill/common/hooks/useConditionalListener/useConditionalListener.js +1 -1
- package/build/es/polyfill/common/hooks/useDirection/useDirection.js +1 -1
- package/build/es/polyfill/common/hooks/useHasIntersected/useHasIntersected.js +2 -2
- package/build/es/polyfill/common/hooks/useLayout/useLayout.js +1 -1
- package/build/es/polyfill/common/key.js +1 -1
- package/build/es/polyfill/common/locale/index.js +7 -7
- package/build/es/polyfill/common/panel/Panel.js +6 -6
- package/build/es/polyfill/common/propsValues/breakpoint.js +1 -1
- package/build/es/polyfill/common/propsValues/control.js +1 -1
- package/build/es/polyfill/common/propsValues/dateMode.js +1 -1
- package/build/es/polyfill/common/propsValues/layouts.js +1 -1
- package/build/es/polyfill/common/propsValues/markdownNodeType.js +1 -1
- package/build/es/polyfill/common/propsValues/monthFormat.js +1 -1
- package/build/es/polyfill/common/propsValues/position.js +1 -1
- package/build/es/polyfill/common/propsValues/profileType.js +1 -1
- package/build/es/polyfill/common/propsValues/scroll.js +1 -1
- package/build/es/polyfill/common/propsValues/sentiment.js +1 -1
- package/build/es/polyfill/common/propsValues/size.js +1 -1
- package/build/es/polyfill/common/propsValues/status.js +1 -1
- package/build/es/polyfill/common/propsValues/type.js +1 -1
- package/build/es/polyfill/common/propsValues/typography.js +1 -1
- package/build/es/polyfill/common/propsValues/variant.js +1 -1
- package/build/es/polyfill/common/propsValues/width.js +1 -1
- package/build/es/polyfill/common/requirements.js +2 -2
- package/build/es/polyfill/common/responsivePanel/ResponsivePanel.js +1 -1
- package/build/es/polyfill/common/textFormat/formatWithPattern/formatWithPattern.js +2 -2
- package/build/es/polyfill/common/textFormat/getCountOfSymbolsInSelection/getCountOfSymbolsInSelection.js +1 -1
- package/build/es/polyfill/common/textFormat/getCursorPositionAfterKeystroke/getCursorPositionAfterKeystroke.js +1 -1
- package/build/es/polyfill/common/textFormat/getDistanceToSymbol/getDistanceToSymbol.js +1 -1
- package/build/es/polyfill/common/textFormat/getSymbolsInPatternWithPosition/getSymbolsInPatternWithPosition.js +1 -1
- package/build/es/polyfill/common/textFormat/unformatWithPattern/unformatWithPattern.js +1 -1
- package/build/es/polyfill/common/theme.js +1 -1
- package/build/es/polyfill/criticalBanner/CriticalCommsBanner.js +1 -1
- package/build/es/polyfill/criticalBanner/CriticalCommsBanner.story.js +1 -1
- package/build/es/polyfill/dateInput/DateInput.js +4 -10
- package/build/es/polyfill/dateInput/DateInput.story.js +1 -1
- package/build/es/polyfill/dateInput/utils/convertToLocalMidnight/convertToLocalMidnight.js +1 -1
- package/build/es/polyfill/dateInput/utils/explodeDate/explodeDate.js +1 -1
- package/build/es/polyfill/dateLookup/DateLookup.js +3 -4
- 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/DayCalendar.js +1 -1
- package/build/es/polyfill/dateLookup/dayCalendar/table/DayCalendarTable.js +4 -5
- package/build/es/polyfill/dateLookup/monthCalendar/MonthCalendar.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/dateLookup/yearCalendar/YearCalendar.js +1 -1
- package/build/es/polyfill/dateLookup/yearCalendar/table/YearCalendarTable.js +1 -1
- package/build/es/polyfill/decision/Decision.js +5 -5
- package/build/es/polyfill/decision/decisionEnums.js +2 -2
- package/build/es/polyfill/definitionList/DefinitionList.js +1 -1
- package/build/es/polyfill/dimmer/Dimmer.js +3 -3
- package/build/es/polyfill/dimmer/Dimmer.story.js +2 -2
- package/build/es/polyfill/dimmer/dimmerManager/DimmerManager.js +3 -3
- package/build/es/polyfill/display/Display.js +1 -1
- package/build/es/polyfill/display/Display.story.js +2 -2
- package/build/es/polyfill/drawer/Drawer.js +1 -1
- package/build/es/polyfill/dropFade/DropFade.js +3 -3
- package/build/es/polyfill/dropFade/DropFade.story.js +1 -1
- package/build/es/polyfill/dynamicFieldDefinitionList/DynamicFieldDefinitionList.js +1 -1
- package/build/es/polyfill/dynamicFieldDefinitionList/FormattedValue/FormattedValue.js +2 -2
- package/build/es/polyfill/dynamicFieldDefinitionList/utils/createDefinitions.js +2 -2
- package/build/es/polyfill/dynamicFieldDefinitionList/utils/text-format.js +1 -1
- package/build/es/polyfill/emphasis/Emphasis.js +2 -2
- package/build/es/polyfill/emphasis/Emphasis.story.js +1 -1
- package/build/es/polyfill/emphasis/EmphasisHtmlTransformer.js +2 -2
- package/build/es/polyfill/flowNavigation/FlowNavigation.js +2 -2
- package/build/es/polyfill/flowNavigation/animatedLabel/AnimatedLabel.js +1 -1
- package/build/es/polyfill/flowNavigation/backButton/BackButton.js +1 -1
- package/build/es/polyfill/header/Header.js +2 -2
- package/build/es/polyfill/header/Header.spec.js +1 -1
- package/build/es/polyfill/header/Header.story.js +2 -1
- package/build/es/polyfill/i18n/index.js +1 -1
- package/build/es/polyfill/image/Image.js +2 -2
- package/build/es/polyfill/info/Info.js +1 -1
- package/build/es/polyfill/info/Info.story.js +1 -1
- package/build/es/polyfill/info/infoPresentations.js +1 -1
- package/build/es/polyfill/inlineAlert/InlineAlert.js +1 -1
- package/build/es/polyfill/inputWithDisplayFormat/InputWithDisplayFormat.js +1 -1
- package/build/es/polyfill/inputs/Input.js +1 -1
- package/build/es/polyfill/inputs/TextArea.js +1 -1
- package/build/es/polyfill/inputs/_common.js +2 -2
- package/build/es/polyfill/instructionsList/InstructionsList.js +3 -3
- package/build/es/polyfill/link/Link.js +2 -2
- package/build/es/polyfill/link/Link.spec.js +1 -1
- package/build/es/polyfill/link/Link.story.js +1 -1
- package/build/es/polyfill/listItem/ListItem.js +1 -1
- package/build/es/polyfill/listItem/ListItem.spec.js +1 -1
- package/build/es/polyfill/listItem/ListItem.story.js +1 -1
- package/build/es/polyfill/loader/Loader.js +2 -2
- package/build/es/polyfill/loader/Loader.story.js +1 -1
- package/build/es/polyfill/logo/Logo.js +1 -1
- package/build/es/polyfill/logo/Logo.story.js +1 -1
- package/build/es/polyfill/logo/logoTypes.js +1 -1
- package/build/es/polyfill/markdown/Markdown.js +1 -1
- package/build/es/polyfill/markdown/Markdown.story.js +1 -1
- package/build/es/polyfill/modal/Modal.js +1 -1
- package/build/es/polyfill/modal/Modal.story.js +2 -2
- package/build/es/polyfill/money/Money.js +1 -1
- package/build/es/polyfill/money/Money.story.js +1 -1
- package/build/es/polyfill/moneyInput/MoneyInput.js +1 -1
- package/build/es/polyfill/moneyInput/MoneyInput.story.js +1 -1
- package/build/es/polyfill/moneyInput/currencyFormatting.js +2 -2
- package/build/es/polyfill/navigationOption/NavigationOption.js +1 -1
- package/build/es/polyfill/navigationOptionsList/NavigationOptionsList.js +1 -1
- package/build/es/polyfill/nudge/Nudge.js +1 -1
- package/build/es/polyfill/overlayHeader/OverlayHeader.js +1 -1
- package/build/es/polyfill/phoneNumberInput/PhoneNumberInput.js +1 -1
- package/build/es/polyfill/phoneNumberInput/data/countries.js +1 -1
- package/build/es/polyfill/phoneNumberInput/utils/cleanNumber/cleanNumber.js +1 -1
- package/build/es/polyfill/phoneNumberInput/utils/excludeCountries/excludeCountries.js +3 -3
- package/build/es/polyfill/phoneNumberInput/utils/explodeNumberModel/index.js +2 -2
- package/build/es/polyfill/phoneNumberInput/utils/filterOptionsForQuery/index.js +2 -2
- package/build/es/polyfill/phoneNumberInput/utils/findCountryByCode/index.js +1 -1
- package/build/es/polyfill/phoneNumberInput/utils/findCountryByPrefix/index.js +1 -1
- package/build/es/polyfill/phoneNumberInput/utils/groupCountriesByPrefix/groupCountriesByPrefix.js +1 -1
- package/build/es/polyfill/phoneNumberInput/utils/isOptionAndFitsQuery/isOptionAndFitsQuery.js +2 -2
- package/build/es/polyfill/phoneNumberInput/utils/isStringNumeric/isStringNumeric.js +1 -1
- package/build/es/polyfill/phoneNumberInput/utils/isValidPhoneNumber/isValidPhoneNumber.js +2 -2
- package/build/es/polyfill/phoneNumberInput/utils/longestMatchingPrefix/index.js +1 -1
- package/build/es/polyfill/phoneNumberInput/utils/setDefaultPrefix/index.js +2 -2
- package/build/es/polyfill/phoneNumberInput/utils/sortArrayByProperty/sortArrayByProperty.js +2 -2
- package/build/es/polyfill/popover/Popover.js +2 -2
- package/build/es/polyfill/processIndicator/ProcessIndicator.js +4 -4
- package/build/es/polyfill/processIndicator/ProcessIndicator.story.js +1 -1
- package/build/es/polyfill/progress/Progress.js +1 -1
- package/build/es/polyfill/progress/Progress.story.js +1 -1
- package/build/es/polyfill/progressBar/ProgressBar.js +1 -1
- package/build/es/polyfill/progressBar/ProgressBar.story.js +1 -1
- package/build/es/polyfill/provider/Provider.js +1 -1
- package/build/es/polyfill/provider/Provider.spec.js +1 -1
- package/build/es/polyfill/provider/Provider.story.js +1 -1
- package/build/es/polyfill/provider/direction/DirectionProvider.js +1 -1
- package/build/es/polyfill/provider/direction/DirectionProvider.spec.js +1 -1
- package/build/es/polyfill/provider/language/LanguageProvider.js +1 -1
- package/build/es/polyfill/provider/language/LanguageProvider.spec.js +1 -1
- package/build/es/polyfill/radio/Radio.js +1 -1
- package/build/es/polyfill/radioGroup/RadioGroup.js +2 -2
- package/build/es/polyfill/radioOption/RadioOption.js +1 -1
- package/build/es/polyfill/section/Section.js +1 -1
- package/build/es/polyfill/section/Section.spec.js +1 -1
- package/build/es/polyfill/section/Section.story.js +1 -1
- package/build/es/polyfill/select/Select.js +8 -9
- package/build/es/polyfill/select/option/Option.js +2 -2
- package/build/es/polyfill/select/searchBox/SearchBox.js +1 -1
- package/build/es/polyfill/sizeSwapper/SizeSwapper.js +3 -3
- package/build/es/polyfill/slidingPanel/SlidingPanel.js +1 -1
- package/build/es/polyfill/snackbar/Snackbar.js +1 -1
- package/build/es/polyfill/snackbar/SnackbarContext.js +1 -1
- package/build/es/polyfill/snackbar/SnackbarProvider.js +1 -1
- package/build/es/polyfill/snackbar/useSnackbar.js +1 -1
- package/build/es/polyfill/statusIcon/StatusIcon.js +1 -1
- package/build/es/polyfill/statusIcon/StatusIcon.story.js +1 -1
- package/build/es/polyfill/stepper/Stepper.js +1 -1
- package/build/es/polyfill/stepper/deviceDetection.js +2 -2
- package/build/es/polyfill/sticky/Sticky.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/switch/Switch.story.js +1 -1
- package/build/es/polyfill/switchOption/SwitchOption.js +1 -1
- package/build/es/polyfill/switchOption/SwitchOption.story.js +1 -1
- package/build/es/polyfill/tabs/Tab.js +1 -1
- package/build/es/polyfill/tabs/TabList.js +1 -1
- package/build/es/polyfill/tabs/TabPanel.js +1 -1
- package/build/es/polyfill/tabs/Tabs.js +1 -5
- package/build/es/polyfill/tabs/utils.js +2 -2
- package/build/es/polyfill/textareaWithDisplayFormat/TextareaWithDisplayFormat.js +1 -1
- package/build/es/polyfill/tile/Tile.js +1 -1
- package/build/es/polyfill/title/Title.js +1 -1
- package/build/es/polyfill/title/Title.spec.js +1 -1
- package/build/es/polyfill/title/Title.story.js +1 -1
- package/build/es/polyfill/tooltip/Tooltip.js +7 -7
- package/build/es/polyfill/tooltip/Tooltip.spec.js +1 -1
- package/build/es/polyfill/tooltip/Tooltip.story.js +1 -1
- package/build/es/polyfill/typeahead/Typeahead.js +1 -1
- package/build/es/polyfill/typeahead/typeaheadInput/TypeaheadInput.js +1 -1
- package/build/es/polyfill/typeahead/typeaheadOption/TypeaheadOption.js +1 -1
- package/build/es/polyfill/typeahead/util/highlight.js +1 -1
- package/build/es/polyfill/upload/Upload.js +2 -6
- 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/upload/uploadSteps.js +1 -1
- package/build/es/polyfill/upload/utils/asyncFileRead/asyncFileRead.js +1 -1
- package/build/es/polyfill/upload/utils/getFileType/getFileType.js +1 -1
- package/build/es/polyfill/upload/utils/getSupportedSpotMimeTypes/getSupportedSpotMimeTypes.js +2 -2
- package/build/es/polyfill/upload/utils/isSizeValid/isSizeValid.js +1 -1
- package/build/es/polyfill/upload/utils/isTypeValid/isTypeValid.js +1 -1
- package/build/es/polyfill/upload/utils/postData/postData.js +1 -1
- package/build/es/polyfill/upload/utils/requestMedia/requestMedia.js +1 -1
- package/build/es/polyfill/uploadInput/UploadInput.js +7 -7
- package/build/es/polyfill/uploadInput/UploadInput.spec.js +1 -1
- package/build/es/polyfill/uploadInput/UploadInput.story.js +1 -1
- package/build/es/polyfill/uploadInput/uploadButton/UploadButton.js +1 -1
- package/build/es/polyfill/uploadInput/uploadButton/UploadButton.spec.js +3 -3
- package/build/es/polyfill/uploadInput/uploadButton/defaults.js +1 -1
- package/build/es/polyfill/uploadInput/uploadButton/getAllowedFileTypes.js +3 -3
- package/build/es/polyfill/uploadInput/uploadButton/getAllowedFileTypes.spec.js +1 -1
- package/build/es/polyfill/uploadInput/uploadItem/UploadItem.js +2 -2
- package/build/es/polyfill/uploadInput/uploadItem/UploadItem.spec.js +1 -1
- package/build/es/polyfill/uploadInput/uploadItem/UploadItemBody.js +1 -1
- package/build/es/polyfill/utilities/deprecatedProperty/deprecatedProperty.js +1 -1
- package/build/es/polyfill/withDisplayFormat/WithDisplayFormat.js +3 -4
- package/build/es/polyfill/withNextPortal/withNextPortal.js +1 -1
- package/build/main.css +1 -4194
- package/build/styles/accordion/Accordion.css +1 -59
- package/build/styles/actionButton/ActionButton.css +1 -36
- package/build/styles/avatar/Avatar.css +1 -239
- package/build/styles/badge/Badge.css +1 -67
- package/build/styles/button/Button.css +1 -17
- package/build/styles/card/Card.css +1 -88
- package/build/styles/checkboxButton/CheckboxButton.css +1 -21
- package/build/styles/chips/Chip.css +1 -169
- package/build/styles/circularButton/CircularButton.css +1 -175
- package/build/styles/common/Option/Option.css +1 -74
- package/build/styles/common/RadioButton/RadioButton.css +1 -3
- package/build/styles/common/bottomSheet/BottomSheet.css +1 -44
- package/build/styles/common/closeButton/CloseButton.css +1 -44
- package/build/styles/common/panel/Panel.css +1 -67
- package/build/styles/criticalBanner/CriticalCommsBanner.css +1 -73
- package/build/styles/dateInput/DateInput.css +1 -3
- package/build/styles/dateLookup/DateLookup.css +1 -80
- package/build/styles/dateLookup/dateTrigger/DateTrigger.css +1 -53
- package/build/styles/decision/Decision.css +1 -69
- package/build/styles/definitionList/DefinitionList.css +1 -48
- package/build/styles/dimmer/Dimmer.css +1 -68
- package/build/styles/drawer/Drawer.css +1 -77
- package/build/styles/dropFade/DropFade.css +1 -19
- package/build/styles/dynamicFieldDefinitionList/FormattedValue/FormattedValue.css +1 -4
- package/build/styles/emphasis/Emphasis.css +1 -25
- package/build/styles/flowNavigation/FlowNavigation.css +1 -85
- package/build/styles/flowNavigation/animatedLabel/AnimatedLabel.css +1 -26
- package/build/styles/flowNavigation/backButton/BackButton.css +1 -28
- package/build/styles/header/Header.css +1 -19
- package/build/styles/image/Image.css +1 -13
- package/build/styles/info/Info.css +1 -37
- package/build/styles/inputs/Input.css +1 -53
- package/build/styles/inputs/TextArea.css +1 -59
- package/build/styles/instructionsList/InstructionsList.css +1 -30
- package/build/styles/link/Link.css +1 -12
- package/build/styles/listItem/ListItem.css +1 -6
- package/build/styles/loader/Loader.css +1 -295
- package/build/styles/logo/Logo.css +1 -10
- package/build/styles/main.css +1 -4194
- package/build/styles/modal/Modal.css +1 -133
- package/build/styles/moneyInput/MoneyInput.css +1 -128
- package/build/styles/navigationOption/NavigationOption.css +1 -61
- package/build/styles/navigationOptionsList/NavigationOptionsList.css +1 -12
- package/build/styles/nudge/Nudge.css +1 -138
- package/build/styles/overlayHeader/OverlayHeader.css +1 -31
- package/build/styles/phoneNumberInput/PhoneNumberInput.css +1 -17
- package/build/styles/popover/Popover.css +1 -36
- package/build/styles/progress/Progress.css +1 -35
- package/build/styles/progressBar/ProgressBar.css +1 -9
- package/build/styles/section/Section.css +1 -8
- package/build/styles/select/Select.css +1 -319
- package/build/styles/slidingPanel/SlidingPanel.css +1 -96
- package/build/styles/snackbar/Snackbar.css +1 -84
- package/build/styles/statusIcon/StatusIcon.css +1 -50
- package/build/styles/stepper/Stepper.css +1 -108
- package/build/styles/summary/Summary.css +1 -86
- package/build/styles/switch/Switch.css +1 -64
- package/build/styles/tabs/Tabs.css +1 -104
- package/build/styles/tile/Tile.css +1 -58
- package/build/styles/tooltip/Tooltip.css +1 -38
- package/build/styles/typeahead/Typeahead.css +1 -167
- package/build/styles/typeahead/typeaheadOption/TypeaheadOption.css +1 -6
- package/build/styles/upload/Upload.css +1 -15
- package/build/styles/uploadInput/UploadInput.css +1 -53
- package/build/styles/uploadInput/uploadButton/UploadButton.css +1 -44
- package/build/styles/uploadInput/uploadItem/UploadItem.css +1 -60
- package/build/umd/no-polyfill/main.js +1 -1
- package/build/umd/polyfill/main.js +1 -1
- package/package.json +3 -3
|
@@ -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 PropTypes from"prop-types";import{useState}from"react";import{Theme}from"../common";import AccordionItem from"./AccordionItem";import{jsx as _jsx}from"react/jsx-runtime";
|
|
1
|
+
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";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 PropTypes from"prop-types";import{useState}from"react";import{Theme}from"../common";import AccordionItem from"./AccordionItem";import{jsx as _jsx}from"react/jsx-runtime";var Accordion=function(a){var b=a.items,c=a.onClick,d=a.indexOpen,e=a.theme,f=useState(function(){return b.map(function(a,b){return b===d})}),g=_slicedToArray(f,2),h=g[0],i=g[1],j=function(a){c&&c(a);var b=_toConsumableArray(h);b[a]=!h[a],i(b)};return b.map(function(a,b){return/*#__PURE__*/_jsx(AccordionItem,_objectSpread(_objectSpread({open:h[b],onClick:function(){return j(b)}},a),{},{theme:e}),a.id||b)})};Accordion.propTypes={indexOpen:PropTypes.number,items:PropTypes.arrayOf(PropTypes.shape({id:PropTypes.string,title:PropTypes.node.isRequired,content:PropTypes.node.isRequired,icon:PropTypes.node})).isRequired,onClick:PropTypes.func,theme:PropTypes.oneOf(["light","dark"])},Accordion.defaultProps={indexOpen:-1,onClick:null,theme:Theme.LIGHT};export default Accordion;
|
|
@@ -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{FastFlag as FastFlagIcon}from"@transferwise/icons";import{Scroll,Size}from"../common";import Modal from"../modal";import{lorem10,lorem40,storyConfig}from"../test-utils";import Accordion from"./Accordion";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:Accordion,title:"Content/Accordion",args:{items:[{title:"Item 1",content:lorem10,id:"Item 1"},{title:"Item 2",content:lorem40,id:"Item 2"},{title:"Item 3",content:lorem10,id:"Item 3"},{title:"Item 4",content:lorem10,id:"Item 4",icon:/*#__PURE__*/_jsx(FastFlagIcon,{size:24})}]}};export
|
|
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{FastFlag as FastFlagIcon}from"@transferwise/icons";import{Scroll,Size}from"../common";import Modal from"../modal";import{lorem10,lorem40,storyConfig}from"../test-utils";import Accordion from"./Accordion";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:Accordion,title:"Content/Accordion",args:{items:[{title:"Item 1",content:lorem10,id:"Item 1"},{title:"Item 2",content:lorem40,id:"Item 2"},{title:"Item 3",content:lorem10,id:"Item 3"},{title:"Item 4",content:lorem10,id:"Item 4",icon:/*#__PURE__*/_jsx(FastFlagIcon,{size:24})}]}};export var Basic={args:{indexOpen:0}};export var BasicMobile=storyConfig(Basic,{variants:["mobile"]});export var Variants=storyConfig({args:{indexOpen:0}},{variants:["default","dark","rtl"]});export var Multiple={render:function render(a){var b=a.items;return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(Accordion,_objectSpread(_objectSpread({},a),{},{items:[b[0]]})),/*#__PURE__*/_jsx(Accordion,_objectSpread(_objectSpread({},a),{},{items:[b[0]],indexOpen:0})),/*#__PURE__*/_jsx(Accordion,_objectSpread(_objectSpread({},a),{},{items:b}))]})}};export var InModal={parameters:{chromatic:{delay:1e3}},render:function render(a){var b=a.items;return/*#__PURE__*/_jsx(Modal,{body:/*#__PURE__*/_jsxs("div",{className:"p-a-1",children:[/*#__PURE__*/_jsx("h3",{className:"m-t-2 m-b-4 text-xs-center",children:"Large transfer tips"}),/*#__PURE__*/_jsx(Accordion,_objectSpread(_objectSpread({},a),{},{items:[b[0]]})),/*#__PURE__*/_jsx(Accordion,_objectSpread(_objectSpread({},a),{},{items:[b[0]],indexOpen:0})),/*#__PURE__*/_jsx(Accordion,_objectSpread(_objectSpread({},a),{},{items:b}))]}),scroll:Scroll.CONTENT,size:Size.LARGE,open:!0,footer:/*#__PURE__*/_jsx("div",{className:"p-a-3 text-xs-center",children:/*#__PURE__*/_jsx("a",{href:"/large-amounts",children:"Learn more"})}),onClose:function onClose(){}})}};export var InModalMobile=storyConfig(InModal,{variants:["mobile"]});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useTheme}from"@wise/components-theming";import classNames from"classnames";import PropTypes from"prop-types";import{cloneElement}from"react";import Body from"../../body";import Chevron from"../../chevron";import{Position,Size,Typography,Theme}from"../../common";import Option from"../../common/Option";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";
|
|
1
|
+
import{useTheme}from"@wise/components-theming";import classNames from"classnames";import PropTypes from"prop-types";import{cloneElement}from"react";import Body from"../../body";import Chevron from"../../chevron";import{Position,Size,Typography,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=useTheme(),k=j.isModern,l=h?/*#__PURE__*/cloneElement(h,{size:24}):null;return/*#__PURE__*/_jsxs("div",{id:c,className:classNames("np-accordion-item","np-accordion-item--".concat(i),l?"np-accordion-item--with-icon":null,{"np-accordion-item--open":g}),children:[/*#__PURE__*/_jsx(Option,{"aria-label":b,as:"button",type:"button",media:l,title:d,button:/*#__PURE__*/_jsx(Chevron,{orientation:g?Position.TOP:Position.DOWN,size:k?Size.MEDIUM:Size.SMALL}),inverseMediaCircle:!1,onClick:f}),g&&/*#__PURE__*/_jsx(Body,{as:"span",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";
|
|
1
|
+
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["disabled","className","onClick","priority","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{Priority}from"../common";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.priority,h=void 0===g?Priority.PRIMARY:g,i=a.text,j=a.children,k=_objectWithoutProperties(a,_excluded);return/*#__PURE__*/_jsx("button",_objectSpread(_objectSpread({ref:b,type:"button",className:classNames("np-action-btn","np-text-body-default-bold",h===Priority.SECONDARY?"btn-priority-2":"btn-priority-1",e),disabled:void 0!==c&&c,onClick:f},k),{},{children:j||i}))});export default ActionButton;
|
|
@@ -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"@testing-library/jest-dom";import{render,screen,userEvent}from"../test-utils";import ActionButton from".";import{jsx as _jsx}from"react/jsx-runtime";describe("ActionButton",()
|
|
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"@testing-library/jest-dom";import{render,screen,userEvent}from"../test-utils";import ActionButton from".";import{jsx as _jsx}from"react/jsx-runtime";describe("ActionButton",function(){var a={children:"Personal profile",onClick:jest.fn()};describe("by default",function(){beforeEach(function(){render(/*#__PURE__*/_jsx(ActionButton,_objectSpread({},a)))}),it("renders the text",function(){expect(screen.getByText("Personal profile")).toBeInTheDocument()}),it("is not disabled",function(){expect(screen.getByRole("button")).toBeEnabled()}),it("renders the button",function(){expect(render(/*#__PURE__*/_jsx(ActionButton,_objectSpread({},a))).container).toMatchSnapshot()})}),describe("button attributes",function(){it("disables the button if disabled",function(){render(/*#__PURE__*/_jsx(ActionButton,_objectSpread(_objectSpread({},a),{},{disabled:!0}))),expect(screen.getByRole("button")).toBeDisabled()}),it("passes through custom classes if set",function(){render(/*#__PURE__*/_jsx(ActionButton,_objectSpread(_objectSpread({},a),{},{className:"catsarethebest"}))),expect(screen.getByRole("button")).toHaveClass("catsarethebest")})}),describe("onClick",function(){it("calls onClick when clicked",function(){var b=jest.fn();render(/*#__PURE__*/_jsx(ActionButton,_objectSpread(_objectSpread({},a),{},{onClick:b}))),userEvent.click(screen.getByRole("button")),expect(b).toHaveBeenCalledTimes(1)}),it("does not call onClick when clicked if disabled",function(){var b=jest.fn();render(/*#__PURE__*/_jsx(ActionButton,_objectSpread(_objectSpread({},a),{},{disabled:!0,onClick:b}))),userEvent.click(screen.getByRole("button")),expect(b).toHaveBeenCalledTimes(0)})}),describe("deprecated",function(){it("text prop",function(){var a=jest.fn();render(/*#__PURE__*/_jsx(ActionButton,{disabled:!0,text:"Text prop",onClick:a})),expect(screen.getByText("Text prop")).toBeInTheDocument()})}),describe("priority",function(){it("is rendered for primary",function(){render(/*#__PURE__*/_jsx(ActionButton,{priority:"primary"})),expect(screen.getByRole("button")).toHaveClass("btn-priority-1")}),it("is rendered for secondary",function(){render(/*#__PURE__*/_jsx(ActionButton,{priority:"secondary"})),expect(screen.getByRole("button")).toHaveClass("btn-priority-2")}),it("is backwards compatible if nothing is passed in",function(){render(/*#__PURE__*/_jsx(ActionButton,{})),expect(screen.getByRole("button")).toHaveClass("btn-priority-1")})})});
|
|
@@ -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{Settings}from"@transferwise/icons";import{storyConfig}from"../test-utils/story-config";import ActionButton from"./ActionButton";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export default{component:ActionButton,title:"Actions/ActionButton",tags:["autodocs"]};export
|
|
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{Settings}from"@transferwise/icons";import{storyConfig}from"../test-utils/story-config";import ActionButton from"./ActionButton";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export default{component:ActionButton,title:"Actions/ActionButton",tags:["autodocs"]};export var Basic=storyConfig({render:function render(a){return/*#__PURE__*/_jsxs("div",{style:{display:"flex",gap:"0.4rem",flexWrap:"wrap"},children:[/*#__PURE__*/_jsx(ActionButton,_objectSpread(_objectSpread({priority:"primary"},a),{},{children:"Primary label"})),/*#__PURE__*/_jsx(ActionButton,_objectSpread(_objectSpread({priority:"secondary"},a),{},{children:"Secondary label"})),/*#__PURE__*/_jsxs(ActionButton,_objectSpread(_objectSpread({priority:"primary"},a),{},{style:{display:"flex",gap:"0.4rem"},children:[/*#__PURE__*/_jsx(Settings,{}),"Primary label"]})),/*#__PURE__*/_jsxs(ActionButton,_objectSpread(_objectSpread({priority:"secondary"},a),{},{style:{display:"flex",gap:"0.4rem"},children:[/*#__PURE__*/_jsx(Settings,{}),"Secondary label"]}))]})}},{variants:["default","dark","rtl","mobile"]});export var Disabled=storyConfig({render:Basic.render,args:{disabled:!0}},{variants:["default","dark","rtl","mobile"]});
|
|
@@ -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 ActionButton from"../actionButton";import Option from"../common/Option";import{jsx as _jsx}from"react/jsx-runtime";
|
|
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 ActionButton from"../actionButton";import Option from"../common/Option";import{jsx as _jsx}from"react/jsx-runtime";var ActionOption=function(a){var b=a.action,c=a.disabled,d=a.onClick,e=a.media,f=a.title,g=a.content,h=a.complex,i=a.className,j=a.showMediaAtAllSizes,k=a.showMediaCircle,l=a.isContainerAligned,m={media:e,title:f,content:g,complex:h,disabled:c,showMediaAtAllSizes:j,showMediaCircle:k,className:classNames("tw-action-option",i),isContainerAligned:l};return/*#__PURE__*/_jsx(Option,_objectSpread(_objectSpread({},m),{},{button:/*#__PURE__*/_jsx(ActionButton,{disabled:c,"aria-label":function getAriaLabel(){var a=[];return"string"==typeof f&&a.push(f),"string"==typeof b&&a.push(b),a.join(", ")||void 0}(),onClick:d,children:b})}))};export default ActionOption;
|
|
@@ -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{action}from"@storybook/addon-actions";import{FastFlag as FastFlagIcon}from"@transferwise/icons";import{Nudge}from"..";import ActionOption from"./ActionOption";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:ActionOption,title:"Option/ActionOption",args:{title:"Action option",content:"Normally, the button and icon are vertically centered.",action:"Action",media:/*#__PURE__*/_jsx(FastFlagIcon,{}),showMediaCircle:!1},tags:["autodocs"]};export
|
|
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{action}from"@storybook/addon-actions";import{FastFlag as FastFlagIcon}from"@transferwise/icons";import{Nudge}from"..";import ActionOption from"./ActionOption";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:ActionOption,title:"Option/ActionOption",args:{title:"Action option",content:"Normally, the button and icon are vertically centered.",action:"Action",media:/*#__PURE__*/_jsx(FastFlagIcon,{}),showMediaCircle:!1},tags:["autodocs"]};export var Basic={render:function render(a){return/*#__PURE__*/_jsx(ActionOption,_objectSpread({},a))}};export var WithContainerContent={render:function render(a){return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx("h2",{className:"m-b-2",children:"Choose how to pay"}),/*#__PURE__*/_jsx(ActionOption,_objectSpread({},a)),/*#__PURE__*/_jsx(ActionOption,_objectSpread({},a)),/*#__PURE__*/_jsx(ActionOption,_objectSpread({},a)),/*#__PURE__*/_jsx(Nudge,{className:"m-t-2",mediaName:"globe",title:"Text that is no longer than two lines.",link:"Link",href:"#",onClick:action("action clicked"),onDismiss:action("dismissed")})]})}};
|
|
@@ -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{InfoCircle,Warning as AlertTriangle,CrossCircle,CheckCircle,Clock}from"@transferwise/icons";import{useTheme}from"@wise/components-theming";import classNames from"classnames";import PropTypes from"prop-types";import{useState,useRef}from"react";import requiredIf from"react-required-if";import Body from"../body/Body";import{Sentiment,Size,Typography,Variant}from"../common";import{CloseButton}from"../common/closeButton";import Link from"../link";import StatusIcon from"../statusIcon";import Title from"../title/Title";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";
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _defineProperty from"@babel/runtime/helpers/defineProperty";var _deprecatedTypeMap,_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,Warning as AlertTriangle,CrossCircle,CheckCircle,Clock}from"@transferwise/icons";import{useTheme}from"@wise/components-theming";import classNames from"classnames";import PropTypes from"prop-types";import{useState,useRef}from"react";import requiredIf from"react-required-if";import Body from"../body/Body";import{Sentiment,Size,Typography,Variant}from"../common";import{CloseButton}from"../common/closeButton";import Link from"../link";import StatusIcon from"../statusIcon";import Title from"../title/Title";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),Alert=function(a){var b,c=useTheme(),d=c.isModern,e=(b={},_defineProperty(b,Sentiment.POSITIVE,CheckCircle),_defineProperty(b,Sentiment.NEUTRAL,InfoCircle),_defineProperty(b,Sentiment.WARNING,AlertTriangle),_defineProperty(b,Sentiment.NEGATIVE,CrossCircle),_defineProperty(b,Sentiment.PENDING,Clock),b),f=useState(!1),g=_slicedToArray(f,2),h=g[0],i=g[1],j=a.arrow,k=a.action,l=a.children,m=a.className,n=a.icon,o=a.onDismiss,p=a.message,q=a.title,r=a.type,s=a.variant,t=useRef(null);if(j){var u=withArrow(Alert,j);return/*#__PURE__*/_jsx(u,_objectSpread({},a))}logActionRequired(a);var v=deprecatedTypeMap[r]||r,w=e[v];return/*#__PURE__*/_jsxs("div",{role:"alert",className:classNames("alert d-flex","alert-".concat(v),m),onTouchStart:function handleTouchStart(){return i(!0)},onTouchEnd:function handleTouchEnd(a){h&&k&&null!==t&&void 0!==t&&t.current&&!t.current.contains(a.target)&&("_blank"===(null===k||void 0===k?void 0:k.target)?window.top.open(k.href):window.top.location.assign(k.href)),i(!1)},onTouchMove:function handleTouchMove(){return i(!1)},children:[/*#__PURE__*/_jsxs("div",{className:classNames("alert__content","d-flex","flex-grow-1",s),"data-testid":s,children:[function(){return n?/*#__PURE__*/_jsx("div",{className:"alert__icon",children:n}):d?/*#__PURE__*/_jsx(StatusIcon,{size:Size.LARGE,sentiment:v}):/*#__PURE__*/_jsx(w,{size:24})}(),/*#__PURE__*/_jsxs("div",{className:"alert__message",children:[q&&/*#__PURE__*/_jsx(Title,{className:"m-b-1",type:Typography.TITLE_BODY,children:q}),/*#__PURE__*/_jsx(Body,{as:"span",className:"d-block",type:Typography.BODY_LARGE,children:l||/*#__PURE__*/_jsx(InlineMarkdown,{children:p})}),k&&/*#__PURE__*/_jsx(Link,{href:k.href,className:"m-t-1","aria-label":k["aria-label"],target:k.target,type:Typography.LINK_LARGE,children:k.text})]})]}),o&&/*#__PURE__*/_jsx(CloseButton,{ref:t,className:"m-l-2",onClick:o})]})},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,/** Title for the alert component */title:PropTypes.string,/** 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"]),variant:PropTypes.oneOf(["desktop","mobile"]),/** @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,variant:Variant.DESKTOP};export default Alert;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/* eslint-disable no-alert */import{ClockBorderless}from"@transferwise/icons";import{Sentiment}from"../common";import Alert from"./Alert";import{AlertArrowPosition}from"./withArrow";import{jsx as _jsx}from"react/jsx-runtime";export default{component:Alert,title:"Feedback/Alert",args:{type:Sentiment.POSITIVE,message:"Payments sent to your bank details **today** might not arrive in time for the holidays."},argTypes:{arrow:{name:"arrow (deprecated)",type:{name:"enum",value:Object.keys(AlertArrowPosition)}},type:{type:{name:"enum",value:[Sentiment.POSITIVE,Sentiment.NEGATIVE,Sentiment.NEUTRAL,Sentiment.WARNING,Sentiment.PENDING]}}},tags:["autodocs"]};export
|
|
1
|
+
/* eslint-disable no-alert */import{ClockBorderless}from"@transferwise/icons";import{Sentiment}from"../common";import Alert from"./Alert";import{AlertArrowPosition}from"./withArrow";import{jsx as _jsx}from"react/jsx-runtime";export default{component:Alert,title:"Feedback/Alert",args:{type:Sentiment.POSITIVE,message:"Payments sent to your bank details **today** might not arrive in time for the holidays."},argTypes:{arrow:{name:"arrow (deprecated)",type:{name:"enum",value:Object.keys(AlertArrowPosition)}},type:{type:{name:"enum",value:[Sentiment.POSITIVE,Sentiment.NEGATIVE,Sentiment.NEUTRAL,Sentiment.WARNING,Sentiment.PENDING]}}},tags:["autodocs"]};export var Basic={args:{onDismiss:void 0}};export var WithAction={args:{action:{href:"/",text:"Read more"}}};export var WithArrow={args:{arrow:AlertArrowPosition.TOP_LEFT}};var CustomIcon=function(){return/*#__PURE__*/_jsx("div",{style:{width:"100%",height:"100%",color:"#ffffff",backgroundColor:"#454745",display:"flex",alignItems:"center",borderRadius:"50%",justifyContent:"center"},children:/*#__PURE__*/_jsx(ClockBorderless,{size:"32"})})};export var WithCustomIcon={args:{icon:/*#__PURE__*/_jsx(CustomIcon,{})}};export var WithTitle={args:{type:Sentiment.NEUTRAL,title:"We\u2019re reviewing your information."}};
|
|
@@ -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 PropTypes from"prop-types";import{MarkdownNodeType}from"../../common";import Markdown from"../../markdown";import{jsx as _jsx}from"react/jsx-runtime";
|
|
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 PropTypes from"prop-types";import{MarkdownNodeType}from"../../common";import Markdown from"../../markdown";import{jsx as _jsx}from"react/jsx-runtime";var allowList=[MarkdownNodeType.STRONG],InlineMarkdown=function(a){return/*#__PURE__*/_jsx(Markdown,_objectSpread(_objectSpread({},a),{},{as:"span",allowList:allowList,blockList:void 0}))};InlineMarkdown.propTypes={children:PropTypes.string.isRequired,className:PropTypes.string},InlineMarkdown.defaultProps={className:void 0};export default InlineMarkdown;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// TODO: consider to move this enum into component file once we migrate it on TypeScript or replace with some common enum
|
|
2
|
-
export
|
|
2
|
+
export var ArrowPosition=/*#__PURE__*/function(a){return a.TOP_LEFT="up-left",a.TOP="up-center",a.TOP_RIGHT="up-right",a.BOTTOM_LEFT="down-left",a.BOTTOM="down-center",a.BOTTOM_RIGHT="down-right",a}({});
|
|
@@ -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 PropTypes from"prop-types";import{ArrowPosition}from"./alertArrowPositions";import{jsx as _jsx}from"react/jsx-runtime";function withArrow(a,b){
|
|
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 PropTypes from"prop-types";import{ArrowPosition}from"./alertArrowPositions";import{jsx as _jsx}from"react/jsx-runtime";function withArrow(a,b){var c=function(c){return/*#__PURE__*/_jsx(a,_objectSpread(_objectSpread({},c),{},{className:classNames(c.className,arrowClasses(b)),arrow:void 0}))};return c.propTypes={className:PropTypes.string},c.defaultProps={className:void 0},c}function arrowClasses(a){if(a){var b=["arrow"],c=ArrowPosition.BOTTOM,d=ArrowPosition.BOTTOM_LEFT,e=ArrowPosition.BOTTOM_RIGHT,f=ArrowPosition.TOP,g=ArrowPosition.TOP_RIGHT,h=ArrowPosition.TOP_LEFT;switch(a){case c:return b.concat("arrow-bottom","arrow-center");case d:return b.concat("arrow-bottom","arrow-left");case e:return b.concat("arrow-bottom","arrow-right");case f:return b.concat("arrow-center");case g:return b.concat("arrow-right");case h:default:return b;}}return""}export default withArrow;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import classnames from"classnames";import{useMemo}from"react";import{Theme}from"../common";import{getAvatarColorFromSeed}from"./colors";import{jsx as _jsx}from"react/jsx-runtime";
|
|
1
|
+
import classnames from"classnames";import{useMemo}from"react";import{Theme}from"../common";import{getAvatarColorFromSeed}from"./colors";import{jsx as _jsx}from"react/jsx-runtime";var backwardsCompatibleSize=function(a){return"sm"===a?24:"md"===a?48:"lg"===a?72:a},Avatar=function(a){var b=a.backgroundColor,c=void 0===b?null:b,d=a.backgroundColorSeed,e=void 0===d?null:d,f=a.children,g=void 0===f?null:f,h=a.className,i=void 0===h?null:h,j=a.outlined,k=a.size,l=void 0===k?48:k,m=a.theme,n=void 0===m?Theme.LIGHT:m,o=a.type,p=void 0===o?"thumbnail":o,q=useMemo(function(){return!c&&e?"var(".concat(getAvatarColorFromSeed(e),")"):void 0},[c,e]),r=backwardsCompatibleSize(l);return/*#__PURE__*/_jsx("div",{className:classnames("tw-avatar",i,"tw-avatar--".concat(r),"tw-avatar--".concat(p),{"tw-avatar--outlined":void 0!==j&&j,"tw-avatar--branded":!!q,"np-text-title-body":"initials"===p}),children:/*#__PURE__*/_jsx("div",{className:"tw-avatar__content",style:{backgroundColor:c||q},children:g})})};export default Avatar;
|
|
@@ -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*as wiseIcons from"@transferwise/icons";import{Size}from"../common";import{storyConfig}from"../test-utils";import Avatar,{AvatarType}from".";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export default{component:Avatar,title:"Content/Avatar",tags:["autodocs"]};export
|
|
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*as wiseIcons from"@transferwise/icons";import{Size}from"../common";import{storyConfig}from"../test-utils";import Avatar,{AvatarType}from".";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export default{component:Avatar,title:"Content/Avatar",tags:["autodocs"]};export var Emoji={render:function render(a){return/*#__PURE__*/_jsx(Avatar,_objectSpread(_objectSpread({},a),{},{children:"\u2708\uFE0F"}))},args:{type:AvatarType.EMOJI,size:Size.MEDIUM}};export var Flag={render:function render(a){return/*#__PURE__*/_jsx(Avatar,_objectSpread(_objectSpread({},a),{},{children:/*#__PURE__*/_jsx("img",{src:"https://wise.com/web-art/assets/flags/gbp.svg",alt:""})}))},args:{type:AvatarType.THUMBNAIL,size:Size.MEDIUM,outlined:!0}};export var Table=storyConfig({render:function render(){var a="https://wise.com/web-art/assets/flags/gbp.svg",b="#d6f5e3",c="\u2708\uFE0F",d="GN",e=wiseIcons.Check;return/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsxs("table",{children:["Outlined",/*#__PURE__*/_jsxs("tr",{children:[/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.LARGE,type:AvatarType.THUMBNAIL,outlined:!0,children:/*#__PURE__*/_jsx("img",{src:"https://wise.com/web-art/assets/flags/jpy.svg",alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:56,type:AvatarType.THUMBNAIL,outlined:!0,children:/*#__PURE__*/_jsx("img",{src:"https://wise.com/web-art/assets/flags/jpy.svg",alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.MEDIUM,type:AvatarType.THUMBNAIL,outlined:!0,children:/*#__PURE__*/_jsx("img",{src:"https://wise.com/web-art/assets/flags/jpy.svg",alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:40,type:AvatarType.THUMBNAIL,outlined:!0,children:/*#__PURE__*/_jsx("img",{src:"https://wise.com/web-art/assets/flags/jpy.svg",alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.SMALL,type:AvatarType.THUMBNAIL,outlined:!0,children:/*#__PURE__*/_jsx("img",{src:"https://wise.com/web-art/assets/flags/jpy.svg",alt:""})})})]}),"Image URL",/*#__PURE__*/_jsxs("tr",{children:[/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.LARGE,type:AvatarType.THUMBNAIL,children:/*#__PURE__*/_jsx("img",{src:a,alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:56,type:AvatarType.THUMBNAIL,children:/*#__PURE__*/_jsx("img",{src:a,alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.MEDIUM,type:AvatarType.THUMBNAIL,children:/*#__PURE__*/_jsx("img",{src:a,alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:40,type:AvatarType.THUMBNAIL,children:/*#__PURE__*/_jsx("img",{src:a,alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.SMALL,type:AvatarType.THUMBNAIL,children:/*#__PURE__*/_jsx("img",{src:a,alt:""})})})]}),"Emoji",/*#__PURE__*/_jsxs("tr",{children:[/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.LARGE,type:AvatarType.EMOJI,children:c})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:56,type:AvatarType.EMOJI,children:c})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.MEDIUM,type:AvatarType.EMOJI,children:c})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:40,type:AvatarType.EMOJI,children:c})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.SMALL,type:AvatarType.EMOJI,children:c})})]}),/*#__PURE__*/_jsx("div",{style:{paddingBottom:"20px"},children:/*#__PURE__*/_jsx("span",{style:{position:"absolute"},children:"Custom background and icon"})}),/*#__PURE__*/_jsxs("tr",{children:[/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.LARGE,type:AvatarType.ICON,backgroundColor:b,children:/*#__PURE__*/_jsx(e,{size:24})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:56,type:AvatarType.ICON,backgroundColor:b,children:/*#__PURE__*/_jsx(e,{size:24})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.MEDIUM,type:AvatarType.ICON,backgroundColor:b,children:/*#__PURE__*/_jsx(e,{size:24})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:40,type:AvatarType.ICON,backgroundColor:b,children:/*#__PURE__*/_jsx(e,{size:24})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.SMALL,type:AvatarType.ICON,backgroundColor:b,children:/*#__PURE__*/_jsx(e,{size:16})})})]}),"Initials",/*#__PURE__*/_jsxs("tr",{children:[/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:72,type:AvatarType.INITIALS,children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:56,type:AvatarType.INITIALS,children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:48,type:AvatarType.INITIALS,children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:40,type:AvatarType.INITIALS,children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:24,type:AvatarType.INITIALS,children:d})})]}),"Branded",/*#__PURE__*/_jsxs("tr",{children:[/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:72,type:AvatarType.INITIALS,backgroundColorSeed:"1",children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:56,type:AvatarType.INITIALS,backgroundColorSeed:"2",children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:48,type:AvatarType.INITIALS,backgroundColorSeed:"3",children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:40,type:AvatarType.INITIALS,backgroundColorSeed:"4",children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:24,type:AvatarType.INITIALS,backgroundColorSeed:"5",children:d})})]})]})})}},{variants:["default","dark","rtl"]});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// TODO: consider to move this enum into component file once we migrate it on TypeScript or replace with some common enum
|
|
2
|
-
export
|
|
2
|
+
export var AvatarType=/*#__PURE__*/function(a){return a.THUMBNAIL="thumbnail",a.ICON="icon",a.EMOJI="emoji",a.INITIALS="initials",a}({});
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* The colors we support generating an Avatar background color from a "seed" for.
|
|
3
3
|
* Changing this array will change the assignment between seeds.
|
|
4
4
|
* Do not change this array.
|
|
5
|
-
*/
|
|
5
|
+
*/var avatarColors=["--color-bright-blue","--color-bright-yellow","--color-bright-pink","--color-bright-orange"],hashSeed=function(a){for(var b=avatarColors.length,c=0,d=1,e=0;e<a.length;e++)c=(c+a.charCodeAt(e)*d)%b,d=d*31%b;return c};/*
|
|
6
6
|
* Takes in a "seed" string and spits out an index for the color we should use.
|
|
7
7
|
* This implementation has been synced across all three clients so that we consistently
|
|
8
8
|
* generate branded avatar colors when rendering a list of Avatars.
|
|
9
9
|
* Do not change this implementation.
|
|
10
|
-
*/export
|
|
10
|
+
*/export var getAvatarColorFromSeed=function(a){return avatarColors[hashSeed(a)]};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";
|
|
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","altText","statusIcon","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{ProfileType,Size,Sentiment}from"../common";import StatusIcon from"../statusIcon/StatusIcon";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";var OptionalBadge=function(a){var b=a.url,c=a.altText,d=a.statusIcon,e=a.children,f=_objectWithoutProperties(a,_excluded);return b?/*#__PURE__*/_jsx(Badge,_objectSpread(_objectSpread({badge:/*#__PURE__*/_jsx("img",{src:b,alt:c})},f),{},{children:e})):d?/*#__PURE__*/_jsx(Badge,_objectSpread(_objectSpread({badge:/*#__PURE__*/_jsx(StatusIcon,{sentiment:d,size:Size.SMALL})},f),{},{children:e})):e};OptionalBadge.propTypes={url:PropTypes.string,altText:PropTypes.string,statusIcon:PropTypes.oneOf([Sentiment.POSITIVE,Sentiment.NEGATIVE,Sentiment.NEUTRAL,Sentiment.WARNING,Sentiment.PENDING]),children:PropTypes.node.isRequired},OptionalBadge.defaultProps={url:void 0,altText:void 0,statusIcon:void 0};var AvatarWrapper=function(a){var b=a.url,c=a.profileType,d=a.profileId,e=a.badgeUrl,f=a.badgeAltText,g=a.badgeStatusIcon,h=a.name,i=a.avatarProps,j=a.badgeProps,k=useState(!1),l=_slicedToArray(k,2),m=l[0],n=l[1],o=c===ProfileType.BUSINESS;useEffect(function(){return n(!1)},[b]);return/*#__PURE__*/_jsx(OptionalBadge,_objectSpread(_objectSpread({url:e,altText:f,statusIcon:g},j),{},{children:/*#__PURE__*/_jsx(Avatar,_objectSpread({size:Size.MEDIUM},function getAvatarProps(){return b&&!m?_objectSpread({type:AvatarType.THUMBNAIL,children:/*#__PURE__*/_jsx("img",{src:b,alt:"avatar",onError:function onError(){return n(!0)}})},i):c?_objectSpread({type:AvatarType.ICON,children:o?/*#__PURE__*/_jsx(BriefcaseIcon,{size:"24"}):/*#__PURE__*/_jsx(ProfileIcon,{size:"24"})},i):h?_objectSpread({type:AvatarType.INITIALS,children:/*#__PURE__*/_jsx(_Fragment,{children:getInitials(h)}),backgroundColorSeed:null===d||void 0===d?void 0:d.toString()},i):_objectSpread({type:AvatarType.ICON,children:/*#__PURE__*/_jsx(ProfileIcon,{size:"24"})},i)}()))}))};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,profileId:void 0,badgeUrl:void 0,badgeAltText:void 0,badgeStatusIcon:void 0,name:void 0,avatarProps:{},badgeProps:{}},AvatarWrapper.propTypes={url:PropTypes.string,profileType:PropTypes.oneOf([ProfileType.PERSONAL,ProfileType.BUSINESS]),profileId:PropTypes.number,badgeUrl:PropTypes.string,badgeAltText:PropTypes.string,badgeStatusIcon:PropTypes.oneOf([Sentiment.POSITIVE,Sentiment.NEGATIVE,Sentiment.NEUTRAL,Sentiment.WARNING,Sentiment.PENDING]),name:PropTypes.string,avatarProps:PropTypes.shape({}),badgeProps:PropTypes.shape({})};export default AvatarWrapper;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ProfileType,Sentiment}from"../common";import AvatarWrapper from"./AvatarWrapper";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export default{component:AvatarWrapper,title:"Content/AvatarWrapper",argTypes:{profileType:{type:{name:"enum",value:Object.keys(ProfileType)}},badgeStatusIcon:{type:{name:"enum",value:[Sentiment.POSITIVE,Sentiment.NEGATIVE,Sentiment.NEUTRAL,Sentiment.WARNING,Sentiment.PENDING]}}},tags:["autodocs"]};export
|
|
1
|
+
import{ProfileType,Sentiment}from"../common";import AvatarWrapper from"./AvatarWrapper";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export default{component:AvatarWrapper,title:"Content/AvatarWrapper",argTypes:{profileType:{type:{name:"enum",value:Object.keys(ProfileType)}},badgeStatusIcon:{type:{name:"enum",value:[Sentiment.POSITIVE,Sentiment.NEGATIVE,Sentiment.NEUTRAL,Sentiment.WARNING,Sentiment.PENDING]}}},tags:["autodocs"]};export var WithBadgeUrl={args:{badgeUrl:"https://wise.com/public-resources/assets/brand/fast_flag_badge_personal.svg",avatarProps:{outlined:!0}}};export var WithBadgeStatus={args:{profileType:ProfileType.BUSINESS,badgeStatusIcon:Sentiment.PENDING,avatarProps:{outlined:!1}}};export var All={args:{avatarProps:{outlined:!0}},render:function render(a){var b=a.avatarProps;return/*#__PURE__*/_jsxs("div",{style:{maxWidth:"300px",display:"flex",justifyContent:"space-between"},children:[/*#__PURE__*/_jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx("b",{children:"No Badges"})})," ","Personal",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{profileType:ProfileType.PERSONAL,avatarProps:b})}),"Business",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{profileType:ProfileType.BUSINESS,avatarProps:b})}),"Avatar",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{url:"https://wise.com/web-art/assets/flags/jpy.svg",profileType:ProfileType.BUSINESS,avatarProps:b})}),"Initials",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{name:"A A",avatarProps:b})}),"Default",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{avatarProps:b})})]}),/*#__PURE__*/_jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx("b",{children:"Badges"})}),"Personal",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{badgeUrl:"https://wise.com/public-resources/assets/brand/fast_flag_badge_personal.svg",badgeAltText:"wise fast flag badge",profileType:ProfileType.PERSONAL,avatarProps:b})}),"Business",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{badgeStatusIcon:Sentiment.POSITIVE,profileType:ProfileType.BUSINESS,avatarProps:b})}),"Avatar",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{badgeStatusIcon:Sentiment.NEGATIVE,url:"https://wise.com/web-art/assets/flags/hrk.svg",profileType:ProfileType.BUSINESS,avatarProps:b})}),"Initials",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{badgeStatusIcon:Sentiment.NEUTRAL,name:"A A",avatarProps:b})}),"Default",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{badgeStatusIcon:Sentiment.PENDING,avatarProps:b})})]})]})}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import classNames from"classnames";import{Size,Theme}from"../common";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";
|
|
1
|
+
import _defineProperty from"@babel/runtime/helpers/defineProperty";import classNames from"classnames";import{Size,Theme}from"../common";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Badge=function(a){var b,c=a.badge,d=a.className,e=void 0===d?void 0:d,f=a.size,g=void 0===f?Size.SMALL:f,h=a.border,i=void 0===h?Theme.LIGHT:h,j=a.children,k=classNames("tw-badge",(b={},_defineProperty(b,"tw-badge-border-".concat(i),i),_defineProperty(b,"tw-badge-".concat(g),g),b),e);return/*#__PURE__*/_jsxs("div",{className:k,children:[/*#__PURE__*/_jsx("div",{className:"tw-badge__children",children:j}),/*#__PURE__*/_jsx("div",{className:"tw-badge__content",children:c})]})};export default Badge;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";
|
|
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{forwardRef}from"react";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]),Body=/*#__PURE__*/forwardRef(function(a,b){var c=a.as,d=void 0===c?"div":c,e=a.type,f=void 0===e?DEFAULT_TYPE:e,g=a.className,h=_objectWithoutProperties(a,_excluded),i=bodyTypes.has(f);return/*#__PURE__*/_jsx(d,_objectSpread(_objectSpread({},h),{},{// @ts-expect-error TODO: Remove when component could be rewritten with generics
|
|
2
2
|
// See: https://fettblog.eu/typescript-react-generic-forward-refs/
|
|
3
|
-
ref:b,className:classNames("np-text-".concat(
|
|
3
|
+
ref:b,className:classNames("np-text-".concat(i?f:DEFAULT_TYPE),g)}))});export default Body;
|
|
@@ -1 +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",()
|
|
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("DIV"),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("DIV"),expect(a).toHaveClass("np-text-".concat(Typography.BODY_DEFAULT))})});
|
|
@@ -1 +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{title:"Typography/Body",component:Body,tags:["autodocs"]};export
|
|
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{title:"Typography/Body",component:Body,tags:["autodocs"]};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!"]})};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";
|
|
2
|
-
|
|
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
|
-
|
|
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 _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{userEvent,within}from"@storybook/testing-library";import{ControlType,Priority}from"../common";import{storyConfig}from"../test-utils";import Button from"./Button";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:Button,title:"Actions/Button",args:{children:"Button text"},argTypes:{as:{type:{name:"enum",value:["button","a"]}}},tags:["autodocs"]};export
|
|
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{userEvent,within}from"@storybook/testing-library";import{ControlType,Priority}from"../common";import{storyConfig}from"../test-utils";import Button from"./Button";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:Button,title:"Actions/Button",args:{children:"Button text"},argTypes:{as:{type:{name:"enum",value:["button","a"]}}},tags:["autodocs"]};export var Basic={};export var Focused=storyConfig({parameters:{chromatic:{delay:1e3}},play:function play(a){var b=a.canvasElement,c=within(b);userEvent.click(c.getByRole("button"))}},{variants:["dark"]});export var Variants=storyConfig({args:{className:"m-r-2"},render:function render(a){return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsxs("div",{className:"m-b-2",children:[/*#__PURE__*/_jsx("div",{className:"title-4 m-b-1",children:"Accent"}),/*#__PURE__*/_jsx(Button,_objectSpread(_objectSpread({},a),{},{priority:Priority.PRIMARY,type:ControlType.ACCENT})),/*#__PURE__*/_jsx(Button,_objectSpread(_objectSpread({},a),{},{priority:Priority.SECONDARY,type:ControlType.ACCENT})),/*#__PURE__*/_jsx(Button,_objectSpread(_objectSpread({},a),{},{priority:Priority.TERTIARY,type:ControlType.ACCENT}))]}),/*#__PURE__*/_jsxs("div",{className:"m-b-2",children:[/*#__PURE__*/_jsx("div",{className:"title-4 m-b-1",children:"Positive"}),/*#__PURE__*/_jsx(Button,_objectSpread(_objectSpread({},a),{},{priority:Priority.PRIMARY,type:ControlType.POSITIVE})),/*#__PURE__*/_jsx(Button,_objectSpread(_objectSpread({},a),{},{priority:Priority.SECONDARY,type:ControlType.POSITIVE}))]}),/*#__PURE__*/_jsxs("div",{className:"m-b-2",children:[/*#__PURE__*/_jsx("div",{className:"title-4 m-b-1",children:"Negative"}),/*#__PURE__*/_jsx(Button,_objectSpread(_objectSpread({},a),{},{priority:Priority.PRIMARY,type:ControlType.NEGATIVE})),/*#__PURE__*/_jsx(Button,_objectSpread(_objectSpread({},a),{},{priority:Priority.SECONDARY,type:ControlType.NEGATIVE}))]}),/*#__PURE__*/_jsxs("div",{className:"m-b-2",children:[/*#__PURE__*/_jsx("div",{className:"title-4 m-b-1",children:"Disabled"}),/*#__PURE__*/_jsx(Button,_objectSpread(_objectSpread({},a),{},{priority:Priority.PRIMARY,disabled:!0})),/*#__PURE__*/_jsx(Button,_objectSpread(_objectSpread({},a),{},{priority:Priority.SECONDARY,disabled:!0})),/*#__PURE__*/_jsx(Button,_objectSpread(_objectSpread({},a),{},{priority:Priority.TERTIARY,disabled:!0}))]})]})}},{variants:["default","dark","rtl"]});export var SocialMedia=storyConfig({render:function render(){return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx("div",{className:"m-b-2",children:/*#__PURE__*/_jsx("button",{type:"button",className:"btn btn-google",children:"Login with Google"})}),/*#__PURE__*/_jsx("div",{className:"m-b-2",children:/*#__PURE__*/_jsx("button",{type:"button",className:"btn btn-facebook",children:"Login with Facebook"})})]})}},{variants:["default","dark","rtl"]});export var SocialMediaMobile=storyConfig(SocialMedia,{variants:["default","dark","rtl","mobile"]});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ControlType,Priority}from"../common";export
|
|
1
|
+
import _defineProperty from"@babel/runtime/helpers/defineProperty";var _typeClassMap,_priorityClassMap;import{ControlType,Priority}from"../common";export var typeClassMap=(_typeClassMap={},_defineProperty(_typeClassMap,ControlType.ACCENT,"btn-accent"),_defineProperty(_typeClassMap,ControlType.POSITIVE,"btn-positive"),_defineProperty(_typeClassMap,ControlType.NEGATIVE,"btn-negative"),_typeClassMap);export var priorityClassMap=(_priorityClassMap={},_defineProperty(_priorityClassMap,Priority.PRIMARY,"btn-priority-1"),_defineProperty(_priorityClassMap,Priority.SECONDARY,"btn-priority-2"),_defineProperty(_priorityClassMap,Priority.TERTIARY,"btn-priority-3"),_priorityClassMap);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{ControlType,Priority,Size,Type}from"../../common";import{logActionRequiredIf}from"../../utilities";
|
|
1
|
+
import _defineProperty from"@babel/runtime/helpers/defineProperty";var _deprecatedTypeMap,_oldTypePriorityMap,_deprecatedTypeMapMes;import{ControlType,Priority,Size,Type}from"../../common";import{logActionRequiredIf}from"../../utilities";var deprecatedTypeMap=(_deprecatedTypeMap={},_defineProperty(_deprecatedTypeMap,Type.PRIMARY,ControlType.ACCENT),_defineProperty(_deprecatedTypeMap,Type.SECONDARY,ControlType.ACCENT),_defineProperty(_deprecatedTypeMap,Type.LINK,ControlType.ACCENT),_defineProperty(_deprecatedTypeMap,Type.PAY,ControlType.POSITIVE),_defineProperty(_deprecatedTypeMap,Type.DANGER,ControlType.NEGATIVE),_deprecatedTypeMap),oldTypePriorityMap=(_oldTypePriorityMap={},_defineProperty(_oldTypePriorityMap,Type.DANGER,Priority.SECONDARY),_defineProperty(_oldTypePriorityMap,Type.LINK,Priority.TERTIARY),_defineProperty(_oldTypePriorityMap,Type.SECONDARY,Priority.SECONDARY),_oldTypePriorityMap),deprecatedTypeMapMessage=(_deprecatedTypeMapMes={},_defineProperty(_deprecatedTypeMapMes,Type.DANGER,"Type.NEGATIVE"),_defineProperty(_deprecatedTypeMapMes,Type.LINK,"ControlType.ACCENT with priority Priority.TERTIARY"),_defineProperty(_deprecatedTypeMapMes,Type.PAY,"ControlType.POSITIVE"),_defineProperty(_deprecatedTypeMapMes,Type.PRIMARY,"ControlType.ACCENT"),_defineProperty(_deprecatedTypeMapMes,Type.SECONDARY,"ControlType.ACCENT with priority Priority.SECONDARY"),_deprecatedTypeMapMes),deprecatedTypes=Object.keys(deprecatedTypeMap);export var establishNewType=function(a){return deprecatedTypeMap[a]||a};export var establishNewPriority=function(a,b){var c=establishNewType(b);// The old SECONDARY and LINK types now map to priorities. If they're still using one of
|
|
2
2
|
// these old types, ignore whatever priority they've passed and use this instead.
|
|
3
3
|
return oldTypePriorityMap[b]?oldTypePriorityMap[b]:a===Priority.TERTIARY&&c!==ControlType.ACCENT?Priority.SECONDARY:a;// Only ControlType.ACCENT supports tertiary styles
|
|
4
|
-
};export
|
|
4
|
+
};export var logDeprecationNotices=function(a){var b=a.size,c=a.type;logActionRequiredIf("Button has deprecated the `Size.EXTRA_SMALL` value for the `size` prop. Please use Size.SMALL instead.",b===Size.EXTRA_SMALL),logActionRequiredIf("Button has deprecated the ".concat(c," value for the `type` prop. Please update to ").concat(deprecatedTypeMapMessage[c],"."),deprecatedTypes.includes(c))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";
|
|
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,{as:"span",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{useTheme}from"@wise/components-theming";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";
|
|
1
|
+
import{useTheme}from"@wise/components-theming";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=useTheme(),n=m.isModern,o=classNames("np-checkbox",{checkbox:!0,"checkbox-lg":i,disabled:n&&e},h),p=e||f;return/*#__PURE__*/_jsx("div",{id:b,className:o,children:/*#__PURE__*/_jsxs("label",{className:classNames({disabled:e}),children:[/*#__PURE__*/_jsx(CheckboxButton,{className:"p-r-2",checked:c,disabled:p,required:!p&&d,onFocus:k,onChange:function onChange(){return j(!c)},onBlur:l}),/*#__PURE__*/_jsxs(Body,{as:"span",className:"np-checkbox__text",type:i?Typography.BODY_LARGE_BOLD:Typography.BODY_LARGE,children:[/*#__PURE__*/_jsx("span",{className:d?"has-required":void 0,children:g}),i&&/*#__PURE__*/_jsx(Body,{as:"span",className:classNames({secondary:!n}),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";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{lorem10,storyConfig}from"../test-utils";import Checkbox from"./Checkbox";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:Checkbox,title:"Forms/Checkbox",args:{label:"This is the label"},tags:["autodocs"]};export
|
|
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{lorem10,storyConfig}from"../test-utils";import Checkbox from"./Checkbox";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:Checkbox,title:"Forms/Checkbox",args:{label:"This is the label"},tags:["autodocs"]};export var Basic={};export var Multiple=storyConfig({render:function render(a){return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(Checkbox,_objectSpread({},a)),/*#__PURE__*/_jsx(Checkbox,_objectSpread(_objectSpread({},a),{},{checked:!0})),/*#__PURE__*/_jsx(Checkbox,_objectSpread(_objectSpread({},a),{},{label:lorem10})),/*#__PURE__*/_jsx(Checkbox,_objectSpread(_objectSpread({},a),{},{label:lorem10,secondary:lorem10})),/*#__PURE__*/_jsx(Checkbox,_objectSpread(_objectSpread({},a),{},{disabled:!0}))]})}},{variants:["default","dark","rtl"]});export var MultipleMobile=storyConfig(Multiple,{variants:["default","dark","rtl","mobile"]});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";
|
|
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;
|
|
@@ -1 +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",()
|
|
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)})});
|
|
@@ -1,2 +1,2 @@
|
|
|
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{action}from"@storybook/addon-actions";import{useState}from"react";import CheckboxButton from"./CheckboxButton";import{jsx as _jsx}from"react/jsx-runtime";export default{component:CheckboxButton,title:"Actions/CheckboxButton",tags:["autodocs"],args:{onBlur:action("blur"),onClick:action("click"),onFocus:action("focus")}};export
|
|
2
|
-
|
|
1
|
+
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";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{action}from"@storybook/addon-actions";import{useState}from"react";import CheckboxButton from"./CheckboxButton";import{jsx as _jsx}from"react/jsx-runtime";export default{component:CheckboxButton,title:"Actions/CheckboxButton",tags:["autodocs"],args:{onBlur:action("blur"),onClick:action("click"),onFocus:action("focus")}};export var Basic={args:{"aria-label":"Toggle email updates",disabled:!1},render:function render(a){// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
2
|
+
var b=useState(!0),c=_slicedToArray(b,2),d=c[0],e=c[1];return/*#__PURE__*/_jsx(CheckboxButton,_objectSpread(_objectSpread({},a),{},{checked:d,onChange:function onChange(){return e(!d)}}))}};
|