@transferwise/components 46.134.0 → 46.135.1
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/accordion/AccordionItem/AccordionItem.js +1 -0
- package/build/accordion/AccordionItem/AccordionItem.js.map +1 -1
- package/build/accordion/AccordionItem/AccordionItem.mjs +1 -0
- package/build/accordion/AccordionItem/AccordionItem.mjs.map +1 -1
- package/build/actionButton/ActionButton.js +1 -0
- package/build/actionButton/ActionButton.js.map +1 -1
- package/build/actionButton/ActionButton.mjs +1 -0
- package/build/actionButton/ActionButton.mjs.map +1 -1
- package/build/actionOption/ActionOption.js +1 -0
- package/build/actionOption/ActionOption.js.map +1 -1
- package/build/actionOption/ActionOption.mjs +1 -0
- package/build/actionOption/ActionOption.mjs.map +1 -1
- package/build/alert/Alert.js +1 -0
- package/build/alert/Alert.js.map +1 -1
- package/build/alert/Alert.mjs +1 -0
- package/build/alert/Alert.mjs.map +1 -1
- package/build/alert/inlineMarkdown/InlineMarkdown.js +1 -0
- package/build/alert/inlineMarkdown/InlineMarkdown.js.map +1 -1
- package/build/alert/inlineMarkdown/InlineMarkdown.mjs +1 -0
- package/build/alert/inlineMarkdown/InlineMarkdown.mjs.map +1 -1
- package/build/avatar/Avatar.js +1 -0
- package/build/avatar/Avatar.js.map +1 -1
- package/build/avatar/Avatar.mjs +1 -0
- package/build/avatar/Avatar.mjs.map +1 -1
- package/build/avatarView/AvatarView.js +1 -0
- package/build/avatarView/AvatarView.js.map +1 -1
- package/build/avatarView/AvatarView.mjs +1 -0
- package/build/avatarView/AvatarView.mjs.map +1 -1
- package/build/avatarWrapper/AvatarWrapper.js +1 -0
- package/build/avatarWrapper/AvatarWrapper.js.map +1 -1
- package/build/avatarWrapper/AvatarWrapper.mjs +1 -0
- package/build/avatarWrapper/AvatarWrapper.mjs.map +1 -1
- package/build/badge/Badge.js +1 -0
- package/build/badge/Badge.js.map +1 -1
- package/build/badge/Badge.mjs +1 -0
- package/build/badge/Badge.mjs.map +1 -1
- package/build/badge/BadgeAssets.js +2 -1
- package/build/badge/BadgeAssets.js.map +1 -1
- package/build/badge/BadgeAssets.mjs +2 -1
- package/build/badge/BadgeAssets.mjs.map +1 -1
- package/build/button/Button.js +1 -0
- package/build/button/Button.js.map +1 -1
- package/build/button/Button.mjs +1 -0
- package/build/button/Button.mjs.map +1 -1
- package/build/button/LegacyButton.js +1 -0
- package/build/button/LegacyButton.js.map +1 -1
- package/build/button/LegacyButton.mjs +1 -0
- package/build/button/LegacyButton.mjs.map +1 -1
- package/build/button/classMap.js +1 -0
- package/build/button/classMap.js.map +1 -1
- package/build/button/classMap.mjs +1 -0
- package/build/button/classMap.mjs.map +1 -1
- package/build/button/legacyUtils/legacyUtils.js +1 -0
- package/build/button/legacyUtils/legacyUtils.js.map +1 -1
- package/build/button/legacyUtils/legacyUtils.mjs +1 -0
- package/build/button/legacyUtils/legacyUtils.mjs.map +1 -1
- package/build/card/Card.js +1 -0
- package/build/card/Card.js.map +1 -1
- package/build/card/Card.mjs +1 -0
- package/build/card/Card.mjs.map +1 -1
- package/build/checkbox/Checkbox.js +1 -0
- package/build/checkbox/Checkbox.js.map +1 -1
- package/build/checkbox/Checkbox.mjs +1 -0
- package/build/checkbox/Checkbox.mjs.map +1 -1
- package/build/chevron/Chevron.js +1 -0
- package/build/chevron/Chevron.js.map +1 -1
- package/build/chevron/Chevron.mjs +1 -0
- package/build/chevron/Chevron.mjs.map +1 -1
- package/build/chips/Chip.js +1 -0
- package/build/chips/Chip.js.map +1 -1
- package/build/chips/Chip.mjs +1 -0
- package/build/chips/Chip.mjs.map +1 -1
- package/build/circularButton/CircularButton.js +1 -0
- package/build/circularButton/CircularButton.js.map +1 -1
- package/build/circularButton/CircularButton.mjs +1 -0
- package/build/circularButton/CircularButton.mjs.map +1 -1
- package/build/common/locale/index.js +9 -4
- package/build/common/locale/index.js.map +1 -1
- package/build/common/locale/index.mjs +9 -4
- package/build/common/locale/index.mjs.map +1 -1
- package/build/common/panel/Panel.js +1 -0
- package/build/common/panel/Panel.js.map +1 -1
- package/build/common/panel/Panel.mjs +1 -0
- package/build/common/panel/Panel.mjs.map +1 -1
- package/build/common/responsivePanel/ResponsivePanel.js +1 -0
- package/build/common/responsivePanel/ResponsivePanel.js.map +1 -1
- package/build/common/responsivePanel/ResponsivePanel.mjs +1 -0
- package/build/common/responsivePanel/ResponsivePanel.mjs.map +1 -1
- package/build/criticalBanner/CriticalCommsBanner.js +1 -0
- package/build/criticalBanner/CriticalCommsBanner.js.map +1 -1
- package/build/criticalBanner/CriticalCommsBanner.mjs +1 -0
- package/build/criticalBanner/CriticalCommsBanner.mjs.map +1 -1
- package/build/dateInput/DateInput.js +1 -1
- package/build/dateInput/DateInput.mjs +1 -1
- package/build/dateLookup/DateLookup.js +1 -1
- package/build/dateLookup/DateLookup.mjs +1 -1
- package/build/dateLookup/dateHeader/DateHeader.js +1 -0
- package/build/dateLookup/dateHeader/DateHeader.js.map +1 -1
- package/build/dateLookup/dateHeader/DateHeader.mjs +1 -0
- package/build/dateLookup/dateHeader/DateHeader.mjs.map +1 -1
- package/build/decision/Decision.js +1 -0
- package/build/decision/Decision.js.map +1 -1
- package/build/decision/Decision.mjs +1 -0
- package/build/decision/Decision.mjs.map +1 -1
- package/build/definitionList/DefinitionList.js +1 -0
- package/build/definitionList/DefinitionList.js.map +1 -1
- package/build/definitionList/DefinitionList.mjs +1 -0
- package/build/definitionList/DefinitionList.mjs.map +1 -1
- package/build/dimmer/Dimmer.js +1 -0
- package/build/dimmer/Dimmer.js.map +1 -1
- package/build/dimmer/Dimmer.mjs +1 -0
- package/build/dimmer/Dimmer.mjs.map +1 -1
- package/build/display/Display.js +1 -0
- package/build/display/Display.js.map +1 -1
- package/build/display/Display.mjs +1 -0
- package/build/display/Display.mjs.map +1 -1
- package/build/drawer/Drawer.js +1 -0
- package/build/drawer/Drawer.js.map +1 -1
- package/build/drawer/Drawer.mjs +1 -0
- package/build/drawer/Drawer.mjs.map +1 -1
- package/build/expressiveMoneyInput/currencySelector/CurrencySelector.js +4 -3
- package/build/expressiveMoneyInput/currencySelector/CurrencySelector.js.map +1 -1
- package/build/expressiveMoneyInput/currencySelector/CurrencySelector.mjs +4 -3
- package/build/expressiveMoneyInput/currencySelector/CurrencySelector.mjs.map +1 -1
- package/build/field/Field.js +1 -0
- package/build/field/Field.js.map +1 -1
- package/build/field/Field.mjs +1 -0
- package/build/field/Field.mjs.map +1 -1
- package/build/flowNavigation/FlowNavigation.js +1 -0
- package/build/flowNavigation/FlowNavigation.js.map +1 -1
- package/build/flowNavigation/FlowNavigation.mjs +1 -0
- package/build/flowNavigation/FlowNavigation.mjs.map +1 -1
- package/build/header/Header.js +1 -0
- package/build/header/Header.js.map +1 -1
- package/build/header/Header.mjs +1 -0
- package/build/header/Header.mjs.map +1 -1
- package/build/info/Info.js +1 -0
- package/build/info/Info.js.map +1 -1
- package/build/info/Info.mjs +1 -0
- package/build/info/Info.mjs.map +1 -1
- package/build/inlineAlert/InlineAlert.js +1 -0
- package/build/inlineAlert/InlineAlert.js.map +1 -1
- package/build/inlineAlert/InlineAlert.mjs +1 -0
- package/build/inlineAlert/InlineAlert.mjs.map +1 -1
- package/build/inputs/SearchInput.js +1 -0
- package/build/inputs/SearchInput.js.map +1 -1
- package/build/inputs/SearchInput.mjs +1 -0
- package/build/inputs/SearchInput.mjs.map +1 -1
- package/build/instructionsList/InstructionsList.js +1 -0
- package/build/instructionsList/InstructionsList.js.map +1 -1
- package/build/instructionsList/InstructionsList.mjs +1 -0
- package/build/instructionsList/InstructionsList.mjs.map +1 -1
- package/build/link/Link.js +1 -0
- package/build/link/Link.js.map +1 -1
- package/build/link/Link.mjs +1 -0
- package/build/link/Link.mjs.map +1 -1
- package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.js +1 -0
- package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.js.map +1 -1
- package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.mjs +1 -0
- package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.mjs.map +1 -1
- package/build/listItem/ListItem.js +1 -0
- package/build/listItem/ListItem.js.map +1 -1
- package/build/listItem/ListItem.mjs +1 -0
- package/build/listItem/ListItem.mjs.map +1 -1
- package/build/listItem/Prompt/ListItemPrompt.js +1 -0
- package/build/listItem/Prompt/ListItemPrompt.js.map +1 -1
- package/build/listItem/Prompt/ListItemPrompt.mjs +1 -0
- package/build/listItem/Prompt/ListItemPrompt.mjs.map +1 -1
- package/build/loader/Loader.js +1 -0
- package/build/loader/Loader.js.map +1 -1
- package/build/loader/Loader.mjs +1 -0
- package/build/loader/Loader.mjs.map +1 -1
- package/build/main.css +33 -22
- package/build/markdown/Markdown.js +1 -0
- package/build/markdown/Markdown.js.map +1 -1
- package/build/markdown/Markdown.mjs +1 -0
- package/build/markdown/Markdown.mjs.map +1 -1
- package/build/modal/Modal.js +1 -0
- package/build/modal/Modal.js.map +1 -1
- package/build/modal/Modal.mjs +1 -0
- package/build/modal/Modal.mjs.map +1 -1
- package/build/navigationOption/NavigationOption.js +1 -0
- package/build/navigationOption/NavigationOption.js.map +1 -1
- package/build/navigationOption/NavigationOption.mjs +1 -0
- package/build/navigationOption/NavigationOption.mjs.map +1 -1
- package/build/nudge/Nudge.js +1 -0
- package/build/nudge/Nudge.js.map +1 -1
- package/build/nudge/Nudge.mjs +1 -0
- package/build/nudge/Nudge.mjs.map +1 -1
- package/build/overlayHeader/OverlayHeader.js +1 -0
- package/build/overlayHeader/OverlayHeader.js.map +1 -1
- package/build/overlayHeader/OverlayHeader.mjs +1 -0
- package/build/overlayHeader/OverlayHeader.mjs.map +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.js +1 -0
- package/build/phoneNumberInput/PhoneNumberInput.js.map +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.mjs +1 -0
- package/build/phoneNumberInput/PhoneNumberInput.mjs.map +1 -1
- package/build/popover/Popover.js +1 -0
- package/build/popover/Popover.js.map +1 -1
- package/build/popover/Popover.mjs +1 -0
- package/build/popover/Popover.mjs.map +1 -1
- package/build/processIndicator/ProcessIndicator.js +1 -0
- package/build/processIndicator/ProcessIndicator.js.map +1 -1
- package/build/processIndicator/ProcessIndicator.mjs +1 -0
- package/build/processIndicator/ProcessIndicator.mjs.map +1 -1
- package/build/progressBar/ProgressBar.js +1 -0
- package/build/progressBar/ProgressBar.js.map +1 -1
- package/build/progressBar/ProgressBar.mjs +1 -0
- package/build/progressBar/ProgressBar.mjs.map +1 -1
- package/build/promoCard/PromoCard.js +1 -0
- package/build/promoCard/PromoCard.js.map +1 -1
- package/build/promoCard/PromoCard.mjs +1 -0
- package/build/promoCard/PromoCard.mjs.map +1 -1
- package/build/promoCard/PromoCardIndicator.js +1 -0
- package/build/promoCard/PromoCardIndicator.js.map +1 -1
- package/build/promoCard/PromoCardIndicator.mjs +1 -0
- package/build/promoCard/PromoCardIndicator.mjs.map +1 -1
- package/build/prompt/ActionPrompt/ActionPrompt.js +1 -0
- package/build/prompt/ActionPrompt/ActionPrompt.js.map +1 -1
- package/build/prompt/ActionPrompt/ActionPrompt.mjs +1 -0
- package/build/prompt/ActionPrompt/ActionPrompt.mjs.map +1 -1
- package/build/prompt/InfoPrompt/InfoPrompt.js +1 -0
- package/build/prompt/InfoPrompt/InfoPrompt.js.map +1 -1
- package/build/prompt/InfoPrompt/InfoPrompt.mjs +1 -0
- package/build/prompt/InfoPrompt/InfoPrompt.mjs.map +1 -1
- package/build/prompt/InlinePrompt/InlinePrompt.js +1 -0
- package/build/prompt/InlinePrompt/InlinePrompt.js.map +1 -1
- package/build/prompt/InlinePrompt/InlinePrompt.mjs +1 -0
- package/build/prompt/InlinePrompt/InlinePrompt.mjs.map +1 -1
- package/build/radio/Radio.js +1 -0
- package/build/radio/Radio.js.map +1 -1
- package/build/radio/Radio.mjs +1 -0
- package/build/radio/Radio.mjs.map +1 -1
- package/build/segmentedControl/SegmentedControl.js +1 -0
- package/build/segmentedControl/SegmentedControl.js.map +1 -1
- package/build/segmentedControl/SegmentedControl.mjs +1 -0
- package/build/segmentedControl/SegmentedControl.mjs.map +1 -1
- package/build/select/Select.js +1 -0
- package/build/select/Select.js.map +1 -1
- package/build/select/Select.mjs +1 -0
- package/build/select/Select.mjs.map +1 -1
- package/build/select/option/Option.js +1 -0
- package/build/select/option/Option.js.map +1 -1
- package/build/select/option/Option.mjs +1 -0
- package/build/select/option/Option.mjs.map +1 -1
- package/build/statusIcon/StatusIcon.js +1 -0
- package/build/statusIcon/StatusIcon.js.map +1 -1
- package/build/statusIcon/StatusIcon.mjs +1 -0
- package/build/statusIcon/StatusIcon.mjs.map +1 -1
- package/build/stepper/Stepper.js +1 -0
- package/build/stepper/Stepper.js.map +1 -1
- package/build/stepper/Stepper.mjs +1 -0
- package/build/stepper/Stepper.mjs.map +1 -1
- package/build/sticky/Sticky.js +1 -0
- package/build/sticky/Sticky.js.map +1 -1
- package/build/sticky/Sticky.mjs +1 -0
- package/build/sticky/Sticky.mjs.map +1 -1
- package/build/styles/css/neptune.css +33 -22
- package/build/styles/less/neptune-tokens.less +5 -4
- package/build/styles/main.css +33 -22
- package/build/styles/props/neptune-tokens.css +3 -2
- package/build/styles/styles/less/neptune.css +33 -22
- package/build/summary/Summary.js +1 -0
- package/build/summary/Summary.js.map +1 -1
- package/build/summary/Summary.mjs +1 -0
- package/build/summary/Summary.mjs.map +1 -1
- package/build/table/Table.js +1 -0
- package/build/table/Table.js.map +1 -1
- package/build/table/Table.mjs +1 -0
- package/build/table/Table.mjs.map +1 -1
- package/build/table/TableRow.js +1 -0
- package/build/table/TableRow.js.map +1 -1
- package/build/table/TableRow.mjs +1 -0
- package/build/table/TableRow.mjs.map +1 -1
- package/build/table/TableStatusText.js +1 -0
- package/build/table/TableStatusText.js.map +1 -1
- package/build/table/TableStatusText.mjs +1 -0
- package/build/table/TableStatusText.mjs.map +1 -1
- package/build/tabs/Tabs.js +1 -0
- package/build/tabs/Tabs.js.map +1 -1
- package/build/tabs/Tabs.mjs +1 -0
- package/build/tabs/Tabs.mjs.map +1 -1
- package/build/tile/Tile.js +1 -0
- package/build/tile/Tile.js.map +1 -1
- package/build/tile/Tile.mjs +1 -0
- package/build/tile/Tile.mjs.map +1 -1
- package/build/title/Title.js +1 -0
- package/build/title/Title.js.map +1 -1
- package/build/title/Title.mjs +1 -0
- package/build/title/Title.mjs.map +1 -1
- package/build/tooltip/Tooltip.js +1 -0
- package/build/tooltip/Tooltip.js.map +1 -1
- package/build/tooltip/Tooltip.mjs +1 -0
- package/build/tooltip/Tooltip.mjs.map +1 -1
- package/build/typeahead/Typeahead.js +1 -0
- package/build/typeahead/Typeahead.js.map +1 -1
- package/build/typeahead/Typeahead.mjs +1 -0
- package/build/typeahead/Typeahead.mjs.map +1 -1
- package/build/types/badge/BadgeAssets.d.ts.map +1 -1
- package/build/types/common/locale/index.d.ts +1 -1
- package/build/types/common/locale/index.d.ts.map +1 -1
- package/build/types/expressiveMoneyInput/currencySelector/CurrencySelector.d.ts.map +1 -1
- package/build/upload/Upload.js +1 -0
- package/build/upload/Upload.js.map +1 -1
- package/build/upload/Upload.mjs +1 -0
- package/build/upload/Upload.mjs.map +1 -1
- package/build/upload/steps/completeStep/completeStep.js +1 -0
- package/build/upload/steps/completeStep/completeStep.js.map +1 -1
- package/build/upload/steps/completeStep/completeStep.mjs +1 -0
- package/build/upload/steps/completeStep/completeStep.mjs.map +1 -1
- package/build/upload/steps/processingStep/processingStep.js +1 -0
- package/build/upload/steps/processingStep/processingStep.js.map +1 -1
- package/build/upload/steps/processingStep/processingStep.mjs +1 -0
- package/build/upload/steps/processingStep/processingStep.mjs.map +1 -1
- package/build/upload/steps/uploadImageStep/uploadImageStep.js +1 -0
- package/build/upload/steps/uploadImageStep/uploadImageStep.js.map +1 -1
- package/build/upload/steps/uploadImageStep/uploadImageStep.mjs +1 -0
- package/build/upload/steps/uploadImageStep/uploadImageStep.mjs.map +1 -1
- package/build/uploadInput/UploadInput.js +1 -0
- package/build/uploadInput/UploadInput.js.map +1 -1
- package/build/uploadInput/UploadInput.mjs +1 -0
- package/build/uploadInput/UploadInput.mjs.map +1 -1
- package/build/uploadInput/uploadButton/UploadButton.js +1 -0
- package/build/uploadInput/uploadButton/UploadButton.js.map +1 -1
- package/build/uploadInput/uploadButton/UploadButton.mjs +1 -0
- package/build/uploadInput/uploadButton/UploadButton.mjs.map +1 -1
- package/build/uploadInput/uploadButton/defaults.js +1 -0
- package/build/uploadInput/uploadButton/defaults.js.map +1 -1
- package/build/uploadInput/uploadButton/defaults.mjs +1 -0
- package/build/uploadInput/uploadButton/defaults.mjs.map +1 -1
- package/build/uploadInput/uploadItem/UploadItem.js +1 -0
- package/build/uploadInput/uploadItem/UploadItem.js.map +1 -1
- package/build/uploadInput/uploadItem/UploadItem.mjs +1 -0
- package/build/uploadInput/uploadItem/UploadItem.mjs.map +1 -1
- package/build/withDisplayFormat/WithDisplayFormat.js +1 -0
- package/build/withDisplayFormat/WithDisplayFormat.js.map +1 -1
- package/build/withDisplayFormat/WithDisplayFormat.mjs +1 -0
- package/build/withDisplayFormat/WithDisplayFormat.mjs.map +1 -1
- package/package.json +17 -17
- package/src/avatarView/AvatarView.story.tsx +1 -1
- package/src/avatarView/AvatarView.test.story.tsx +108 -1
- package/src/badge/BadgeAssets.tsx +2 -0
- package/src/common/locale/index.test.ts +13 -4
- package/src/common/locale/index.ts +9 -3
- package/src/expressiveMoneyInput/ExpressiveMoneyInput.story.tsx +18 -0
- package/src/expressiveMoneyInput/currencySelector/CurrencySelector.test.tsx +119 -1
- package/src/expressiveMoneyInput/currencySelector/CurrencySelector.tsx +4 -3
- package/src/main.css +33 -22
- package/src/styles/less/neptune.css +33 -22
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Panel.js","sources":["../../../src/common/panel/Panel.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport {\n CSSProperties,\n HTMLAttributes,\n MutableRefObject,\n PropsWithChildren,\n SyntheticEvent,\n forwardRef,\n useContext,\n useEffect,\n useState,\n} from 'react';\nimport { usePopper } from 'react-popper';\n\nimport { Position, PositionBottom, PositionLeft, PositionRight, PositionTop } from '..';\nimport Dimmer from '../../dimmer';\nimport { OverlayIdContext } from '../../provider/overlay/OverlayIdProvider';\n\nconst POPOVER_OFFSET = [0, 16];\n\n// By default the flip positioning explores only the opposite alternative. So if left is passed and there's no enough space\n// the right one gets chosen. If there's no space on both sides popover goes back to the initially chosen one left.\n// This mapping forces popover to try the four available positions before going back to the initial chosen one.\nconst fallbackPlacements = {\n [Position.TOP]: [Position.BOTTOM, Position.RIGHT, Position.LEFT],\n [Position.BOTTOM]: [Position.TOP, Position.RIGHT, Position.LEFT],\n [Position.LEFT]: [Position.RIGHT, Position.TOP, Position.BOTTOM],\n [Position.RIGHT]: [Position.LEFT, Position.TOP, Position.BOTTOM],\n};\n\nexport type PanelProps = PropsWithChildren<{\n arrow?: boolean;\n flip?: boolean;\n altAxis?: boolean;\n open?: boolean;\n onClose?: (event: Event | SyntheticEvent) => void;\n position?: PositionBottom | PositionLeft | PositionRight | PositionTop;\n anchorRef: MutableRefObject<Element | null>;\n anchorWidth?: boolean;\n considerHeight?: boolean;\n}> &\n HTMLAttributes<HTMLDivElement>;\n\nconst Panel = forwardRef<HTMLDivElement, PanelProps>(function Panel(\n {\n arrow = false,\n flip = true,\n altAxis = false,\n children,\n open = false,\n onClose,\n position = Position.BOTTOM,\n anchorRef,\n anchorWidth = false,\n considerHeight = false,\n ...rest\n }: PanelProps,\n reference,\n) {\n const [arrowElement, setArrowElement] = useState<HTMLDivElement | null>(null);\n const [popperElement, setPopperElement] = useState<HTMLDivElement | null>(null);\n\n const modifiers = [];\n\n if (altAxis) {\n modifiers.push({\n // https://popper.js.org/docs/v2/modifiers/prevent-overflow\n name: 'preventOverflow',\n options: {\n altAxis: true,\n tether: false,\n },\n });\n }\n\n if (arrow) {\n modifiers.push({\n name: 'arrow',\n options: {\n element: arrowElement,\n options: {\n padding: 8, // 8px from the edges of the popper\n },\n },\n });\n // This lets you displace a popper element from its reference element.\n modifiers.push({ name: 'offset', options: { offset: POPOVER_OFFSET } });\n }\n if (flip && fallbackPlacements[position]) {\n modifiers.push({\n name: 'flip',\n options: {\n fallbackPlacements: fallbackPlacements[position],\n },\n });\n }\n\n const { styles, attributes, forceUpdate } = usePopper(anchorRef.current, popperElement, {\n placement: position,\n modifiers,\n });\n\n // If the trigger is not visible when the position is calculated, it will be incorrect. Because this can happen repeatedly (on resize for example),\n // it is most simple just to always position before opening\n useEffect(() => {\n if (open && forceUpdate) {\n forceUpdate();\n }\n }, [open]);\n\n const contentStyle: CSSProperties = {\n ...(anchorWidth ? { width: anchorRef.current?.clientWidth } : undefined),\n };\n\n const overlayId = useContext(OverlayIdContext);\n\n return (\n <Dimmer open={open} transparent fadeContentOnEnter fadeContentOnExit onClose={onClose}>\n <div\n id={overlayId}\n {...rest}\n ref={setPopperElement}\n role=\"dialog\"\n style={{ ...styles.popper }}\n {...attributes.popper}\n className={clsx('np-panel', { 'np-panel--open': open }, rest.className)}\n >\n <div ref={reference} style={contentStyle} className={clsx('np-panel__content')}>\n {children}\n {/* Arrow has to stay inside content to get the same animations as the \"dialog\" and to get hidden when panel is closed. */}\n {arrow && (\n <div ref={setArrowElement} className={clsx('np-panel__arrow')} style={styles.arrow} />\n )}\n </div>\n </div>\n </Dimmer>\n );\n});\n\nexport default Panel;\n"],"names":["POPOVER_OFFSET","fallbackPlacements","Position","TOP","BOTTOM","RIGHT","LEFT","Panel","forwardRef","arrow","flip","altAxis","children","open","onClose","position","anchorRef","anchorWidth","considerHeight","rest","reference","arrowElement","setArrowElement","useState","popperElement","setPopperElement","modifiers","push","name","options","tether","element","padding","offset","styles","attributes","forceUpdate","usePopper","current","placement","useEffect","contentStyle","width","clientWidth","undefined","overlayId","useContext","OverlayIdContext","_jsx","Dimmer","transparent","fadeContentOnEnter","fadeContentOnExit","id","ref","role","style","popper","className","clsx","_jsxs"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Panel.js","sources":["../../../src/common/panel/Panel.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport {\n CSSProperties,\n HTMLAttributes,\n MutableRefObject,\n PropsWithChildren,\n SyntheticEvent,\n forwardRef,\n useContext,\n useEffect,\n useState,\n} from 'react';\nimport { usePopper } from 'react-popper';\n\nimport { Position, PositionBottom, PositionLeft, PositionRight, PositionTop } from '..';\nimport Dimmer from '../../dimmer';\nimport { OverlayIdContext } from '../../provider/overlay/OverlayIdProvider';\n\nconst POPOVER_OFFSET = [0, 16];\n\n// By default the flip positioning explores only the opposite alternative. So if left is passed and there's no enough space\n// the right one gets chosen. If there's no space on both sides popover goes back to the initially chosen one left.\n// This mapping forces popover to try the four available positions before going back to the initial chosen one.\nconst fallbackPlacements = {\n [Position.TOP]: [Position.BOTTOM, Position.RIGHT, Position.LEFT],\n [Position.BOTTOM]: [Position.TOP, Position.RIGHT, Position.LEFT],\n [Position.LEFT]: [Position.RIGHT, Position.TOP, Position.BOTTOM],\n [Position.RIGHT]: [Position.LEFT, Position.TOP, Position.BOTTOM],\n};\n\nexport type PanelProps = PropsWithChildren<{\n arrow?: boolean;\n flip?: boolean;\n altAxis?: boolean;\n open?: boolean;\n onClose?: (event: Event | SyntheticEvent) => void;\n position?: PositionBottom | PositionLeft | PositionRight | PositionTop;\n anchorRef: MutableRefObject<Element | null>;\n anchorWidth?: boolean;\n considerHeight?: boolean;\n}> &\n HTMLAttributes<HTMLDivElement>;\n\nconst Panel = forwardRef<HTMLDivElement, PanelProps>(function Panel(\n {\n arrow = false,\n flip = true,\n altAxis = false,\n children,\n open = false,\n onClose,\n position = Position.BOTTOM,\n anchorRef,\n anchorWidth = false,\n considerHeight = false,\n ...rest\n }: PanelProps,\n reference,\n) {\n const [arrowElement, setArrowElement] = useState<HTMLDivElement | null>(null);\n const [popperElement, setPopperElement] = useState<HTMLDivElement | null>(null);\n\n const modifiers = [];\n\n if (altAxis) {\n modifiers.push({\n // https://popper.js.org/docs/v2/modifiers/prevent-overflow\n name: 'preventOverflow',\n options: {\n altAxis: true,\n tether: false,\n },\n });\n }\n\n if (arrow) {\n modifiers.push({\n name: 'arrow',\n options: {\n element: arrowElement,\n options: {\n padding: 8, // 8px from the edges of the popper\n },\n },\n });\n // This lets you displace a popper element from its reference element.\n modifiers.push({ name: 'offset', options: { offset: POPOVER_OFFSET } });\n }\n if (flip && fallbackPlacements[position]) {\n modifiers.push({\n name: 'flip',\n options: {\n fallbackPlacements: fallbackPlacements[position],\n },\n });\n }\n\n const { styles, attributes, forceUpdate } = usePopper(anchorRef.current, popperElement, {\n placement: position,\n modifiers,\n });\n\n // If the trigger is not visible when the position is calculated, it will be incorrect. Because this can happen repeatedly (on resize for example),\n // it is most simple just to always position before opening\n useEffect(() => {\n if (open && forceUpdate) {\n forceUpdate();\n }\n }, [open]);\n\n const contentStyle: CSSProperties = {\n ...(anchorWidth ? { width: anchorRef.current?.clientWidth } : undefined),\n };\n\n const overlayId = useContext(OverlayIdContext);\n\n return (\n <Dimmer open={open} transparent fadeContentOnEnter fadeContentOnExit onClose={onClose}>\n <div\n id={overlayId}\n {...rest}\n ref={setPopperElement}\n role=\"dialog\"\n style={{ ...styles.popper }}\n {...attributes.popper}\n className={clsx('np-panel', { 'np-panel--open': open }, rest.className)}\n >\n <div ref={reference} style={contentStyle} className={clsx('np-panel__content')}>\n {children}\n {/* Arrow has to stay inside content to get the same animations as the \"dialog\" and to get hidden when panel is closed. */}\n {arrow && (\n <div ref={setArrowElement} className={clsx('np-panel__arrow')} style={styles.arrow} />\n )}\n </div>\n </div>\n </Dimmer>\n );\n});\n\nexport default Panel;\n"],"names":["POPOVER_OFFSET","fallbackPlacements","Position","TOP","BOTTOM","RIGHT","LEFT","Panel","forwardRef","arrow","flip","altAxis","children","open","onClose","position","anchorRef","anchorWidth","considerHeight","rest","reference","arrowElement","setArrowElement","useState","popperElement","setPopperElement","modifiers","push","name","options","tether","element","padding","offset","styles","attributes","forceUpdate","usePopper","current","placement","useEffect","contentStyle","width","clientWidth","undefined","overlayId","useContext","OverlayIdContext","_jsx","Dimmer","transparent","fadeContentOnEnter","fadeContentOnExit","id","ref","role","style","popper","className","clsx","_jsxs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,MAAMA,cAAc,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC;AAE9B;AACA;AACA;AACA,MAAMC,kBAAkB,GAAG;AACzB,EAAA,CAACC,iBAAQ,CAACC,GAAG,GAAG,CAACD,iBAAQ,CAACE,MAAM,EAAEF,iBAAQ,CAACG,KAAK,EAAEH,iBAAQ,CAACI,IAAI,CAAC;AAChE,EAAA,CAACJ,iBAAQ,CAACE,MAAM,GAAG,CAACF,iBAAQ,CAACC,GAAG,EAAED,iBAAQ,CAACG,KAAK,EAAEH,iBAAQ,CAACI,IAAI,CAAC;AAChE,EAAA,CAACJ,iBAAQ,CAACI,IAAI,GAAG,CAACJ,iBAAQ,CAACG,KAAK,EAAEH,iBAAQ,CAACC,GAAG,EAAED,iBAAQ,CAACE,MAAM,CAAC;AAChE,EAAA,CAACF,iBAAQ,CAACG,KAAK,GAAG,CAACH,iBAAQ,CAACI,IAAI,EAAEJ,iBAAQ,CAACC,GAAG,EAAED,iBAAQ,CAACE,MAAM;CAChE;AAeD,MAAMG,KAAK,gBAAGC,gBAAU,CAA6B,SAASD,KAAKA,CACjE;AACEE,EAAAA,KAAK,GAAG,KAAK;AACbC,EAAAA,IAAI,GAAG,IAAI;AACXC,EAAAA,OAAO,GAAG,KAAK;EACfC,QAAQ;AACRC,EAAAA,IAAI,GAAG,KAAK;EACZC,OAAO;YACPC,UAAQ,GAAGb,iBAAQ,CAACE,MAAM;EAC1BY,SAAS;AACTC,EAAAA,WAAW,GAAG,KAAK;AACnBC,EAAAA,cAAc,GAAG,KAAK;EACtB,GAAGC;AAAI,CACI,EACbC,SAAS,EAAA;EAET,MAAM,CAACC,YAAY,EAAEC,eAAe,CAAC,GAAGC,cAAQ,CAAwB,IAAI,CAAC;EAC7E,MAAM,CAAC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AAEtB,MAAM,CAACzB;AAAM,SAAA,CACpF;OACE;KACF;AACP,GAAQ,CAAC;AAEb,CAAC;;;;"}
|
|
@@ -20,6 +20,7 @@ import '../propsValues/variant.mjs';
|
|
|
20
20
|
import '../propsValues/scroll.mjs';
|
|
21
21
|
import '../propsValues/markdownNodeType.mjs';
|
|
22
22
|
import '../fileType.mjs';
|
|
23
|
+
import '@transferwise/formatting';
|
|
23
24
|
import '@transferwise/icons';
|
|
24
25
|
import 'react-intl';
|
|
25
26
|
import '../closeButton/CloseButton.messages.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Panel.mjs","sources":["../../../src/common/panel/Panel.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport {\n CSSProperties,\n HTMLAttributes,\n MutableRefObject,\n PropsWithChildren,\n SyntheticEvent,\n forwardRef,\n useContext,\n useEffect,\n useState,\n} from 'react';\nimport { usePopper } from 'react-popper';\n\nimport { Position, PositionBottom, PositionLeft, PositionRight, PositionTop } from '..';\nimport Dimmer from '../../dimmer';\nimport { OverlayIdContext } from '../../provider/overlay/OverlayIdProvider';\n\nconst POPOVER_OFFSET = [0, 16];\n\n// By default the flip positioning explores only the opposite alternative. So if left is passed and there's no enough space\n// the right one gets chosen. If there's no space on both sides popover goes back to the initially chosen one left.\n// This mapping forces popover to try the four available positions before going back to the initial chosen one.\nconst fallbackPlacements = {\n [Position.TOP]: [Position.BOTTOM, Position.RIGHT, Position.LEFT],\n [Position.BOTTOM]: [Position.TOP, Position.RIGHT, Position.LEFT],\n [Position.LEFT]: [Position.RIGHT, Position.TOP, Position.BOTTOM],\n [Position.RIGHT]: [Position.LEFT, Position.TOP, Position.BOTTOM],\n};\n\nexport type PanelProps = PropsWithChildren<{\n arrow?: boolean;\n flip?: boolean;\n altAxis?: boolean;\n open?: boolean;\n onClose?: (event: Event | SyntheticEvent) => void;\n position?: PositionBottom | PositionLeft | PositionRight | PositionTop;\n anchorRef: MutableRefObject<Element | null>;\n anchorWidth?: boolean;\n considerHeight?: boolean;\n}> &\n HTMLAttributes<HTMLDivElement>;\n\nconst Panel = forwardRef<HTMLDivElement, PanelProps>(function Panel(\n {\n arrow = false,\n flip = true,\n altAxis = false,\n children,\n open = false,\n onClose,\n position = Position.BOTTOM,\n anchorRef,\n anchorWidth = false,\n considerHeight = false,\n ...rest\n }: PanelProps,\n reference,\n) {\n const [arrowElement, setArrowElement] = useState<HTMLDivElement | null>(null);\n const [popperElement, setPopperElement] = useState<HTMLDivElement | null>(null);\n\n const modifiers = [];\n\n if (altAxis) {\n modifiers.push({\n // https://popper.js.org/docs/v2/modifiers/prevent-overflow\n name: 'preventOverflow',\n options: {\n altAxis: true,\n tether: false,\n },\n });\n }\n\n if (arrow) {\n modifiers.push({\n name: 'arrow',\n options: {\n element: arrowElement,\n options: {\n padding: 8, // 8px from the edges of the popper\n },\n },\n });\n // This lets you displace a popper element from its reference element.\n modifiers.push({ name: 'offset', options: { offset: POPOVER_OFFSET } });\n }\n if (flip && fallbackPlacements[position]) {\n modifiers.push({\n name: 'flip',\n options: {\n fallbackPlacements: fallbackPlacements[position],\n },\n });\n }\n\n const { styles, attributes, forceUpdate } = usePopper(anchorRef.current, popperElement, {\n placement: position,\n modifiers,\n });\n\n // If the trigger is not visible when the position is calculated, it will be incorrect. Because this can happen repeatedly (on resize for example),\n // it is most simple just to always position before opening\n useEffect(() => {\n if (open && forceUpdate) {\n forceUpdate();\n }\n }, [open]);\n\n const contentStyle: CSSProperties = {\n ...(anchorWidth ? { width: anchorRef.current?.clientWidth } : undefined),\n };\n\n const overlayId = useContext(OverlayIdContext);\n\n return (\n <Dimmer open={open} transparent fadeContentOnEnter fadeContentOnExit onClose={onClose}>\n <div\n id={overlayId}\n {...rest}\n ref={setPopperElement}\n role=\"dialog\"\n style={{ ...styles.popper }}\n {...attributes.popper}\n className={clsx('np-panel', { 'np-panel--open': open }, rest.className)}\n >\n <div ref={reference} style={contentStyle} className={clsx('np-panel__content')}>\n {children}\n {/* Arrow has to stay inside content to get the same animations as the \"dialog\" and to get hidden when panel is closed. */}\n {arrow && (\n <div ref={setArrowElement} className={clsx('np-panel__arrow')} style={styles.arrow} />\n )}\n </div>\n </div>\n </Dimmer>\n );\n});\n\nexport default Panel;\n"],"names":["POPOVER_OFFSET","fallbackPlacements","Position","TOP","BOTTOM","RIGHT","LEFT","Panel","forwardRef","arrow","flip","altAxis","children","open","onClose","position","anchorRef","anchorWidth","considerHeight","rest","reference","arrowElement","setArrowElement","useState","popperElement","setPopperElement","modifiers","push","name","options","tether","element","padding","offset","styles","attributes","forceUpdate","usePopper","current","placement","useEffect","contentStyle","width","clientWidth","undefined","overlayId","useContext","OverlayIdContext","_jsx","Dimmer","transparent","fadeContentOnEnter","fadeContentOnExit","id","ref","role","style","popper","className","clsx","_jsxs"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Panel.mjs","sources":["../../../src/common/panel/Panel.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport {\n CSSProperties,\n HTMLAttributes,\n MutableRefObject,\n PropsWithChildren,\n SyntheticEvent,\n forwardRef,\n useContext,\n useEffect,\n useState,\n} from 'react';\nimport { usePopper } from 'react-popper';\n\nimport { Position, PositionBottom, PositionLeft, PositionRight, PositionTop } from '..';\nimport Dimmer from '../../dimmer';\nimport { OverlayIdContext } from '../../provider/overlay/OverlayIdProvider';\n\nconst POPOVER_OFFSET = [0, 16];\n\n// By default the flip positioning explores only the opposite alternative. So if left is passed and there's no enough space\n// the right one gets chosen. If there's no space on both sides popover goes back to the initially chosen one left.\n// This mapping forces popover to try the four available positions before going back to the initial chosen one.\nconst fallbackPlacements = {\n [Position.TOP]: [Position.BOTTOM, Position.RIGHT, Position.LEFT],\n [Position.BOTTOM]: [Position.TOP, Position.RIGHT, Position.LEFT],\n [Position.LEFT]: [Position.RIGHT, Position.TOP, Position.BOTTOM],\n [Position.RIGHT]: [Position.LEFT, Position.TOP, Position.BOTTOM],\n};\n\nexport type PanelProps = PropsWithChildren<{\n arrow?: boolean;\n flip?: boolean;\n altAxis?: boolean;\n open?: boolean;\n onClose?: (event: Event | SyntheticEvent) => void;\n position?: PositionBottom | PositionLeft | PositionRight | PositionTop;\n anchorRef: MutableRefObject<Element | null>;\n anchorWidth?: boolean;\n considerHeight?: boolean;\n}> &\n HTMLAttributes<HTMLDivElement>;\n\nconst Panel = forwardRef<HTMLDivElement, PanelProps>(function Panel(\n {\n arrow = false,\n flip = true,\n altAxis = false,\n children,\n open = false,\n onClose,\n position = Position.BOTTOM,\n anchorRef,\n anchorWidth = false,\n considerHeight = false,\n ...rest\n }: PanelProps,\n reference,\n) {\n const [arrowElement, setArrowElement] = useState<HTMLDivElement | null>(null);\n const [popperElement, setPopperElement] = useState<HTMLDivElement | null>(null);\n\n const modifiers = [];\n\n if (altAxis) {\n modifiers.push({\n // https://popper.js.org/docs/v2/modifiers/prevent-overflow\n name: 'preventOverflow',\n options: {\n altAxis: true,\n tether: false,\n },\n });\n }\n\n if (arrow) {\n modifiers.push({\n name: 'arrow',\n options: {\n element: arrowElement,\n options: {\n padding: 8, // 8px from the edges of the popper\n },\n },\n });\n // This lets you displace a popper element from its reference element.\n modifiers.push({ name: 'offset', options: { offset: POPOVER_OFFSET } });\n }\n if (flip && fallbackPlacements[position]) {\n modifiers.push({\n name: 'flip',\n options: {\n fallbackPlacements: fallbackPlacements[position],\n },\n });\n }\n\n const { styles, attributes, forceUpdate } = usePopper(anchorRef.current, popperElement, {\n placement: position,\n modifiers,\n });\n\n // If the trigger is not visible when the position is calculated, it will be incorrect. Because this can happen repeatedly (on resize for example),\n // it is most simple just to always position before opening\n useEffect(() => {\n if (open && forceUpdate) {\n forceUpdate();\n }\n }, [open]);\n\n const contentStyle: CSSProperties = {\n ...(anchorWidth ? { width: anchorRef.current?.clientWidth } : undefined),\n };\n\n const overlayId = useContext(OverlayIdContext);\n\n return (\n <Dimmer open={open} transparent fadeContentOnEnter fadeContentOnExit onClose={onClose}>\n <div\n id={overlayId}\n {...rest}\n ref={setPopperElement}\n role=\"dialog\"\n style={{ ...styles.popper }}\n {...attributes.popper}\n className={clsx('np-panel', { 'np-panel--open': open }, rest.className)}\n >\n <div ref={reference} style={contentStyle} className={clsx('np-panel__content')}>\n {children}\n {/* Arrow has to stay inside content to get the same animations as the \"dialog\" and to get hidden when panel is closed. */}\n {arrow && (\n <div ref={setArrowElement} className={clsx('np-panel__arrow')} style={styles.arrow} />\n )}\n </div>\n </div>\n </Dimmer>\n );\n});\n\nexport default Panel;\n"],"names":["POPOVER_OFFSET","fallbackPlacements","Position","TOP","BOTTOM","RIGHT","LEFT","Panel","forwardRef","arrow","flip","altAxis","children","open","onClose","position","anchorRef","anchorWidth","considerHeight","rest","reference","arrowElement","setArrowElement","useState","popperElement","setPopperElement","modifiers","push","name","options","tether","element","padding","offset","styles","attributes","forceUpdate","usePopper","current","placement","useEffect","contentStyle","width","clientWidth","undefined","overlayId","useContext","OverlayIdContext","_jsx","Dimmer","transparent","fadeContentOnEnter","fadeContentOnExit","id","ref","role","style","popper","className","clsx","_jsxs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,MAAMA,cAAc,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC;AAE9B;AACA;AACA;AACA,MAAMC,kBAAkB,GAAG;AACzB,EAAA,CAACC,QAAQ,CAACC,GAAG,GAAG,CAACD,QAAQ,CAACE,MAAM,EAAEF,QAAQ,CAACG,KAAK,EAAEH,QAAQ,CAACI,IAAI,CAAC;AAChE,EAAA,CAACJ,QAAQ,CAACE,MAAM,GAAG,CAACF,QAAQ,CAACC,GAAG,EAAED,QAAQ,CAACG,KAAK,EAAEH,QAAQ,CAACI,IAAI,CAAC;AAChE,EAAA,CAACJ,QAAQ,CAACI,IAAI,GAAG,CAACJ,QAAQ,CAACG,KAAK,EAAEH,QAAQ,CAACC,GAAG,EAAED,QAAQ,CAACE,MAAM,CAAC;AAChE,EAAA,CAACF,QAAQ,CAACG,KAAK,GAAG,CAACH,QAAQ,CA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AS;MAAA,GACxBtB,UAAU,CAACsB,MAAM;AACrBC,MAAAA,SAAS,EAAEC,IAAI,CAAC,UAAU,EAAE;AAAE,QAAA,gBAAgB,EAAE9C;AAAI,OAAE,EAAEM,IAAI,CAACuC,SAAS,CAAE;AAAA9C,MAAAA,QAAA,eAExEgD,IAAA,CAAA,KAAA,EAAA;AAAKN,QAAAA,GAAG,EAAElC,SAAU;AAACoC,QAAAA,KAAK,EAAEf,YAAa;AAACiB,QAAAA,SAAS,EAAEC,IAAI,CAAC,mBAAmB,CAAE;AAAA/C,QAAAA,QAAA,EAAA,CAC5EA,QAAQ,EAERH,KAAK,iBACJuC,GAAA,CAAA,KAAA,EAAA;AAAKM,UAAAA,GAAG,EAAEhC,eAAgB;AAACoC,UAAAA,SAAS,EAAEC,IAAI,CAAC,iBAAiB,CAAE;UAACH,KAAK,EAAEtB,MAAM,CAACzB;AAAM,SAAA,CACpF;OACE;KACF;AACP,GAAQ,CAAC;AAEb,CAAC;;;;"}
|
|
@@ -23,6 +23,7 @@ require('../propsValues/variant.js');
|
|
|
23
23
|
require('../propsValues/scroll.js');
|
|
24
24
|
require('../propsValues/markdownNodeType.js');
|
|
25
25
|
require('../fileType.js');
|
|
26
|
+
require('@transferwise/formatting');
|
|
26
27
|
require('@transferwise/icons');
|
|
27
28
|
require('clsx');
|
|
28
29
|
require('react-intl');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResponsivePanel.js","sources":["../../../src/common/responsivePanel/ResponsivePanel.tsx"],"sourcesContent":["import { forwardRef } from 'react';\n\nimport { Position } from '..';\nimport BottomSheet from '../bottomSheet';\nimport { useLayout } from '../hooks';\nimport Panel, { type PanelProps } from '../panel';\nimport { isServerSide } from '../domHelpers';\n\nconst ResponsivePanel = forwardRef<HTMLDivElement, PanelProps>(function ResponsivePanel(\n {\n anchorRef,\n arrow = false,\n flip = true,\n children,\n className = undefined,\n onClose,\n open = false,\n position = Position.BOTTOM,\n anchorWidth = false,\n 'aria-label': ariaLabel,\n considerHeight = false,\n 'aria-labelledby': ariaLabelledBy,\n }: PanelProps,\n reference,\n) {\n const { isMobile } = useLayout();\n const SHORT_SCREEN = 500;\n const isShortViewport = considerHeight && !isServerSide() && window.innerHeight < SHORT_SCREEN;\n\n if (isMobile || isShortViewport) {\n return (\n <BottomSheet\n key=\"bottomSheet\"\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n open={open}\n className={className}\n onClose={onClose}\n >\n {children}\n </BottomSheet>\n );\n }\n return (\n <Panel\n key=\"panel\"\n ref={reference}\n flip={flip}\n arrow={arrow}\n open={open}\n position={position}\n anchorWidth={anchorWidth}\n anchorRef={anchorRef}\n aria-label={ariaLabel}\n considerHeight={considerHeight}\n aria-labelledby={ariaLabelledBy}\n className={className}\n onClose={onClose}\n >\n {children}\n </Panel>\n );\n});\n\nexport default ResponsivePanel;\n"],"names":["ResponsivePanel","forwardRef","anchorRef","arrow","flip","children","className","undefined","onClose","open","position","Position","BOTTOM","anchorWidth","ariaLabel","considerHeight","ariaLabelledBy","reference","isMobile","useLayout","SHORT_SCREEN","isShortViewport","isServerSide","window","innerHeight","_jsx","BottomSheet","Panel","ref"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ResponsivePanel.js","sources":["../../../src/common/responsivePanel/ResponsivePanel.tsx"],"sourcesContent":["import { forwardRef } from 'react';\n\nimport { Position } from '..';\nimport BottomSheet from '../bottomSheet';\nimport { useLayout } from '../hooks';\nimport Panel, { type PanelProps } from '../panel';\nimport { isServerSide } from '../domHelpers';\n\nconst ResponsivePanel = forwardRef<HTMLDivElement, PanelProps>(function ResponsivePanel(\n {\n anchorRef,\n arrow = false,\n flip = true,\n children,\n className = undefined,\n onClose,\n open = false,\n position = Position.BOTTOM,\n anchorWidth = false,\n 'aria-label': ariaLabel,\n considerHeight = false,\n 'aria-labelledby': ariaLabelledBy,\n }: PanelProps,\n reference,\n) {\n const { isMobile } = useLayout();\n const SHORT_SCREEN = 500;\n const isShortViewport = considerHeight && !isServerSide() && window.innerHeight < SHORT_SCREEN;\n\n if (isMobile || isShortViewport) {\n return (\n <BottomSheet\n key=\"bottomSheet\"\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n open={open}\n className={className}\n onClose={onClose}\n >\n {children}\n </BottomSheet>\n );\n }\n return (\n <Panel\n key=\"panel\"\n ref={reference}\n flip={flip}\n arrow={arrow}\n open={open}\n position={position}\n anchorWidth={anchorWidth}\n anchorRef={anchorRef}\n aria-label={ariaLabel}\n considerHeight={considerHeight}\n aria-labelledby={ariaLabelledBy}\n className={className}\n onClose={onClose}\n >\n {children}\n </Panel>\n );\n});\n\nexport default ResponsivePanel;\n"],"names":["ResponsivePanel","forwardRef","anchorRef","arrow","flip","children","className","undefined","onClose","open","position","Position","BOTTOM","anchorWidth","ariaLabel","considerHeight","ariaLabelledBy","reference","isMobile","useLayout","SHORT_SCREEN","isShortViewport","isServerSide","window","innerHeight","_jsx","BottomSheet","Panel","ref"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,MAAMA,eAAe,gBAAGC,gBAAU,CAA6B,SAASD,eAAeA,CACrF;EACEE,SAAS;AACTC,EAAAA,KAAK,GAAG,KAAK;AACbC,EAAAA,IAAI,GAAG,IAAI;EACXC,QAAQ;AACRC,EAAAA,SAAS,GAAGC,SAAS;EACrBC,OAAO;AACPC,EAAAA,IAAI,GAAG,KAAK;YACZC,UAAQ,GAAGC,iBAAQ,CAACC,MAAM;AAC1BC,EAAAA,WAAW,GAAG,KAAK;AACnB,EAAA,YAAY,EAAEC,SAAS;AACvBC,EAAAA,cAAc,GAAG,KAAK;AACtB,EAAA,iBAAiB,EAAEC;AAAc,CACtB,EACbC,SAAS,EAAA;EAET,MAAM;AAAEC,IAAAA;GAAU,GAAGC,mBAAS,EAAE;EAChC,MAAMC,YAAY,GAAG,GAAG;AACxB,EAAA,MAAMC,eAAe,GAAGN,cAAc,IAAI,CAACO,6BAAY,EAAE,IAAIC,MAAM,CAACC,WAAW,GAAGJ,YAAY;EAE9F,IAAIF,QAAQ,IAAIG,eAAe,EAAE;IAC/B,oBACEI,cAAA,CAACC,mBAAW,EAAA;AAEV,MAAA,YAAA,EAAYZ,SAAU;AACtB,MAAA,iBAAA,EAAiBE,cAAe;AAChCP,MAAAA,IAAI,EAAEA,IAAK;AACXH,MAAAA,SAAS,EAAEA,SAAU;AACrBE,MAAAA,OAAO,EAAEA,OAAQ;AAAAH,MAAAA,QAAA,EAEhBA;AAAQ,KAAA,EAPL,aAQO,CAAC;AAElB,EAAA;EACA,oBACEoB,cAAA,CAACE,aAAK,EAAA;AAEJC,IAAAA,GAAG,EAAEX,SAAU;AACfb,IAAAA,IAAI,EAAEA,IAAK;AACXD,IAAAA,KAAK,EAAEA,KAAM;AACbM,IAAAA,IAAI,EAAEA,IAAK;AACXC,IAAAA,QAAQ,EAAEA,UAAS;AACnBG,IAAAA,WAAW,EAAEA,WAAY;AACzBX,IAAAA,SAAS,EAAEA,SAAU;AACrB,IAAA,YAAA,EAAYY,SAAU;AACtBC,IAAAA,cAAc,EAAEA,cAAe;AAC/B,IAAA,iBAAA,EAAiBC,cAAe;AAChCV,IAAAA,SAAS,EAAEA,SAAU;AACrBE,IAAAA,OAAO,EAAEA,OAAQ;AAAAH,IAAAA,QAAA,EAEhBA;AAAQ,GAAA,EAdL,OAeC,CAAC;AAEZ,CAAC;;;;"}
|
|
@@ -19,6 +19,7 @@ import '../propsValues/variant.mjs';
|
|
|
19
19
|
import '../propsValues/scroll.mjs';
|
|
20
20
|
import '../propsValues/markdownNodeType.mjs';
|
|
21
21
|
import '../fileType.mjs';
|
|
22
|
+
import '@transferwise/formatting';
|
|
22
23
|
import '@transferwise/icons';
|
|
23
24
|
import 'clsx';
|
|
24
25
|
import 'react-intl';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResponsivePanel.mjs","sources":["../../../src/common/responsivePanel/ResponsivePanel.tsx"],"sourcesContent":["import { forwardRef } from 'react';\n\nimport { Position } from '..';\nimport BottomSheet from '../bottomSheet';\nimport { useLayout } from '../hooks';\nimport Panel, { type PanelProps } from '../panel';\nimport { isServerSide } from '../domHelpers';\n\nconst ResponsivePanel = forwardRef<HTMLDivElement, PanelProps>(function ResponsivePanel(\n {\n anchorRef,\n arrow = false,\n flip = true,\n children,\n className = undefined,\n onClose,\n open = false,\n position = Position.BOTTOM,\n anchorWidth = false,\n 'aria-label': ariaLabel,\n considerHeight = false,\n 'aria-labelledby': ariaLabelledBy,\n }: PanelProps,\n reference,\n) {\n const { isMobile } = useLayout();\n const SHORT_SCREEN = 500;\n const isShortViewport = considerHeight && !isServerSide() && window.innerHeight < SHORT_SCREEN;\n\n if (isMobile || isShortViewport) {\n return (\n <BottomSheet\n key=\"bottomSheet\"\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n open={open}\n className={className}\n onClose={onClose}\n >\n {children}\n </BottomSheet>\n );\n }\n return (\n <Panel\n key=\"panel\"\n ref={reference}\n flip={flip}\n arrow={arrow}\n open={open}\n position={position}\n anchorWidth={anchorWidth}\n anchorRef={anchorRef}\n aria-label={ariaLabel}\n considerHeight={considerHeight}\n aria-labelledby={ariaLabelledBy}\n className={className}\n onClose={onClose}\n >\n {children}\n </Panel>\n );\n});\n\nexport default ResponsivePanel;\n"],"names":["ResponsivePanel","forwardRef","anchorRef","arrow","flip","children","className","undefined","onClose","open","position","Position","BOTTOM","anchorWidth","ariaLabel","considerHeight","ariaLabelledBy","reference","isMobile","useLayout","SHORT_SCREEN","isShortViewport","isServerSide","window","innerHeight","_jsx","BottomSheet","Panel","ref"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ResponsivePanel.mjs","sources":["../../../src/common/responsivePanel/ResponsivePanel.tsx"],"sourcesContent":["import { forwardRef } from 'react';\n\nimport { Position } from '..';\nimport BottomSheet from '../bottomSheet';\nimport { useLayout } from '../hooks';\nimport Panel, { type PanelProps } from '../panel';\nimport { isServerSide } from '../domHelpers';\n\nconst ResponsivePanel = forwardRef<HTMLDivElement, PanelProps>(function ResponsivePanel(\n {\n anchorRef,\n arrow = false,\n flip = true,\n children,\n className = undefined,\n onClose,\n open = false,\n position = Position.BOTTOM,\n anchorWidth = false,\n 'aria-label': ariaLabel,\n considerHeight = false,\n 'aria-labelledby': ariaLabelledBy,\n }: PanelProps,\n reference,\n) {\n const { isMobile } = useLayout();\n const SHORT_SCREEN = 500;\n const isShortViewport = considerHeight && !isServerSide() && window.innerHeight < SHORT_SCREEN;\n\n if (isMobile || isShortViewport) {\n return (\n <BottomSheet\n key=\"bottomSheet\"\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n open={open}\n className={className}\n onClose={onClose}\n >\n {children}\n </BottomSheet>\n );\n }\n return (\n <Panel\n key=\"panel\"\n ref={reference}\n flip={flip}\n arrow={arrow}\n open={open}\n position={position}\n anchorWidth={anchorWidth}\n anchorRef={anchorRef}\n aria-label={ariaLabel}\n considerHeight={considerHeight}\n aria-labelledby={ariaLabelledBy}\n className={className}\n onClose={onClose}\n >\n {children}\n </Panel>\n );\n});\n\nexport default ResponsivePanel;\n"],"names":["ResponsivePanel","forwardRef","anchorRef","arrow","flip","children","className","undefined","onClose","open","position","Position","BOTTOM","anchorWidth","ariaLabel","considerHeight","ariaLabelledBy","reference","isMobile","useLayout","SHORT_SCREEN","isShortViewport","isServerSide","window","innerHeight","_jsx","BottomSheet","Panel","ref"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,MAAMA,eAAe,gBAAGC,UAAU,CAA6B,SAASD,eAAeA,CACrF;EACEE,SAAS;AACTC,EAAAA,KAAK,GAAG,KAAK;AACbC,EAAAA,IAAI,GAAG,IAAI;EACXC,QAAQ;AACRC,EAAAA,SAAS,GAAGC,SAAS;EACrBC,OAAO;AACPC,EAAAA,IAAI,GAAG,KAAK;EACZC,QAAQ,GAAGC,QAAQ,CAACC,MAAM;AAC1BC,EAAAA,WAAW,GAAG,KAAK;AAC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('../common/propsValues/markdownNodeType.js');
|
|
26
26
|
require('../common/fileType.js');
|
|
27
|
+
require('@transferwise/formatting');
|
|
27
28
|
require('react');
|
|
28
29
|
require('react-intl');
|
|
29
30
|
require('../common/closeButton/CloseButton.messages.js');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CriticalCommsBanner.js","sources":["../../src/criticalBanner/CriticalCommsBanner.tsx"],"sourcesContent":["import { Alert as AlertIcon, ClockBorderless as ClockIcon } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { PropsWithChildren } from 'react';\n\nimport Alert from '../alert';\nimport { Sentiment } from '../common';\nimport Circle, { CircleProps } from '../common/circle';\nimport SentimentSurface from '../sentimentSurface';\n\nexport type CriticalCommsBannerSentiment =\n | `${Sentiment.WARNING}`\n | `${Sentiment.NEGATIVE}`\n | `${Sentiment.NEUTRAL}`;\n\nexport type CriticalCommsBannerProps = {\n title: string;\n subtitle?: string;\n action?: {\n label: string;\n href?: string;\n target?: HTMLAnchorElement['target'];\n onClick?: () => void;\n };\n sentiment?: CriticalCommsBannerSentiment;\n className?: string;\n};\n\nconst makeSurface = (sentiment: CriticalCommsBannerSentiment) => {\n const Surface = (props: PropsWithChildren<Pick<CircleProps, 'className'>>) => (\n <SentimentSurface as=\"span\" emphasis=\"elevated\" sentiment={sentiment} {...props} />\n );\n Surface.displayName = `CriticalCommsSurface(${sentiment})`;\n return Surface;\n};\n\nconst iconBySentiment: Record<CriticalCommsBannerSentiment, React.ReactNode> = {\n [Sentiment.NEGATIVE]: (\n <Circle as={makeSurface(Sentiment.NEGATIVE)} size={32} className=\"status-circle negative\">\n <AlertIcon className=\"status-icon light\" />\n </Circle>\n ),\n [Sentiment.WARNING]: (\n <Circle as={makeSurface(Sentiment.WARNING)} size={32} className=\"status-circle warning\">\n <AlertIcon className=\"status-icon dark\" />\n </Circle>\n ),\n [Sentiment.NEUTRAL]: (\n <Circle as={makeSurface(Sentiment.NEUTRAL)} size={32} className=\"status-circle neutral\">\n <ClockIcon className=\"status-icon dark\" />\n </Circle>\n ),\n};\n\nfunction CriticalCommsBanner({\n title,\n subtitle,\n action,\n sentiment = Sentiment.NEGATIVE,\n className,\n}: CriticalCommsBannerProps) {\n return (\n <SentimentSurface\n sentiment={sentiment}\n emphasis=\"elevated\"\n className={clsx('critical-comms', className)}\n >\n <Alert\n title={title}\n message={subtitle}\n action={\n action && {\n onClick: action.onClick,\n href: action.href,\n target: action.target,\n text: action.label,\n as: 'button',\n }\n }\n className={className}\n type={sentiment}\n icon={iconBySentiment[sentiment]}\n />\n </SentimentSurface>\n );\n}\n\nexport default CriticalCommsBanner;\n"],"names":["makeSurface","sentiment","Surface","props","_jsx","SentimentSurface","as","emphasis","displayName","iconBySentiment","Sentiment","NEGATIVE","Circle","size","className","children","AlertIcon","WARNING","NEUTRAL","ClockIcon","CriticalCommsBanner","title","subtitle","action","clsx","Alert","message","onClick","href","target","text","label","type","icon"],"mappings":"
|
|
1
|
+
{"version":3,"file":"CriticalCommsBanner.js","sources":["../../src/criticalBanner/CriticalCommsBanner.tsx"],"sourcesContent":["import { Alert as AlertIcon, ClockBorderless as ClockIcon } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { PropsWithChildren } from 'react';\n\nimport Alert from '../alert';\nimport { Sentiment } from '../common';\nimport Circle, { CircleProps } from '../common/circle';\nimport SentimentSurface from '../sentimentSurface';\n\nexport type CriticalCommsBannerSentiment =\n | `${Sentiment.WARNING}`\n | `${Sentiment.NEGATIVE}`\n | `${Sentiment.NEUTRAL}`;\n\nexport type CriticalCommsBannerProps = {\n title: string;\n subtitle?: string;\n action?: {\n label: string;\n href?: string;\n target?: HTMLAnchorElement['target'];\n onClick?: () => void;\n };\n sentiment?: CriticalCommsBannerSentiment;\n className?: string;\n};\n\nconst makeSurface = (sentiment: CriticalCommsBannerSentiment) => {\n const Surface = (props: PropsWithChildren<Pick<CircleProps, 'className'>>) => (\n <SentimentSurface as=\"span\" emphasis=\"elevated\" sentiment={sentiment} {...props} />\n );\n Surface.displayName = `CriticalCommsSurface(${sentiment})`;\n return Surface;\n};\n\nconst iconBySentiment: Record<CriticalCommsBannerSentiment, React.ReactNode> = {\n [Sentiment.NEGATIVE]: (\n <Circle as={makeSurface(Sentiment.NEGATIVE)} size={32} className=\"status-circle negative\">\n <AlertIcon className=\"status-icon light\" />\n </Circle>\n ),\n [Sentiment.WARNING]: (\n <Circle as={makeSurface(Sentiment.WARNING)} size={32} className=\"status-circle warning\">\n <AlertIcon className=\"status-icon dark\" />\n </Circle>\n ),\n [Sentiment.NEUTRAL]: (\n <Circle as={makeSurface(Sentiment.NEUTRAL)} size={32} className=\"status-circle neutral\">\n <ClockIcon className=\"status-icon dark\" />\n </Circle>\n ),\n};\n\nfunction CriticalCommsBanner({\n title,\n subtitle,\n action,\n sentiment = Sentiment.NEGATIVE,\n className,\n}: CriticalCommsBannerProps) {\n return (\n <SentimentSurface\n sentiment={sentiment}\n emphasis=\"elevated\"\n className={clsx('critical-comms', className)}\n >\n <Alert\n title={title}\n message={subtitle}\n action={\n action && {\n onClick: action.onClick,\n href: action.href,\n target: action.target,\n text: action.label,\n as: 'button',\n }\n }\n className={className}\n type={sentiment}\n icon={iconBySentiment[sentiment]}\n />\n </SentimentSurface>\n );\n}\n\nexport default CriticalCommsBanner;\n"],"names":["makeSurface","sentiment","Surface","props","_jsx","SentimentSurface","as","emphasis","displayName","iconBySentiment","Sentiment","NEGATIVE","Circle","size","className","children","AlertIcon","WARNING","NEUTRAL","ClockIcon","CriticalCommsBanner","title","subtitle","action","clsx","Alert","message","onClick","href","target","text","label","type","icon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,MAAMA,WAAW,GAAIC,SAAuC,IAAI;AAC9D,EAAA,MAAMC,OAAO,GAAIC,KAAwD,iBACvEC,cAAA,CAACC,wBAAgB,EAAA;AAACC,IAAAA,EAAE,EAAC,MAAM;AAACC,IAAAA,QAAQ,EAAC,UAAU;AAACN,IAAAA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,oBACEV,cAAA,CAACC,wBAAgB,EAAA;AACfJ,IAAAA,SAAS,EAAEA,WAAU;AACrBM,IAAAA,QAAQ,EAAC,UAAU;AACnBO,IAAAA,SAAS,EAAEU,SAAI,CAAC,gBAAgB,EAAEV,SAAS,CAAE;IAAAC,QAAA,eAE7CX,cAAA,CAACqB,aAAK,EAAA;AACJJ,MAAAA,KAAK,EAAEA,KAAM;AACbK,MAAAA,OAAO,EAAEJ,QAAS;MAClBC,MAAM,EACJA,MAAM,IAAI;QACRI,OAAO,EAAEJ,MAAM,CAACI,OAAO;QACvBC,IAAI,EAAEL,MAAM,CAACK,IAAI;QACjBC,MAAM,EAAEN,MAAM,CAACM,MAAM;QACrBC,IAAI,EAAEP,MAAM,CAACQ,KAAK;AAClBzB,QAAAA,EAAE,EAAE;OAEP;AACDQ,MAAAA,SAAS,EAAEA,SAAU;AACrBkB,MAAAA,IAAI,EAAE/B,WAAU;MAChBgC,IAAI,EAAExB,eAAe,CAACR,WAAS;KAAE;AAErC,GAAkB,CAAC;AAEvB;;;;"}
|
|
@@ -20,6 +20,7 @@ import '../common/propsValues/variant.mjs';
|
|
|
20
20
|
import '../common/propsValues/scroll.mjs';
|
|
21
21
|
import '../common/propsValues/markdownNodeType.mjs';
|
|
22
22
|
import '../common/fileType.mjs';
|
|
23
|
+
import '@transferwise/formatting';
|
|
23
24
|
import 'react';
|
|
24
25
|
import 'react-intl';
|
|
25
26
|
import '../common/closeButton/CloseButton.messages.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CriticalCommsBanner.mjs","sources":["../../src/criticalBanner/CriticalCommsBanner.tsx"],"sourcesContent":["import { Alert as AlertIcon, ClockBorderless as ClockIcon } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { PropsWithChildren } from 'react';\n\nimport Alert from '../alert';\nimport { Sentiment } from '../common';\nimport Circle, { CircleProps } from '../common/circle';\nimport SentimentSurface from '../sentimentSurface';\n\nexport type CriticalCommsBannerSentiment =\n | `${Sentiment.WARNING}`\n | `${Sentiment.NEGATIVE}`\n | `${Sentiment.NEUTRAL}`;\n\nexport type CriticalCommsBannerProps = {\n title: string;\n subtitle?: string;\n action?: {\n label: string;\n href?: string;\n target?: HTMLAnchorElement['target'];\n onClick?: () => void;\n };\n sentiment?: CriticalCommsBannerSentiment;\n className?: string;\n};\n\nconst makeSurface = (sentiment: CriticalCommsBannerSentiment) => {\n const Surface = (props: PropsWithChildren<Pick<CircleProps, 'className'>>) => (\n <SentimentSurface as=\"span\" emphasis=\"elevated\" sentiment={sentiment} {...props} />\n );\n Surface.displayName = `CriticalCommsSurface(${sentiment})`;\n return Surface;\n};\n\nconst iconBySentiment: Record<CriticalCommsBannerSentiment, React.ReactNode> = {\n [Sentiment.NEGATIVE]: (\n <Circle as={makeSurface(Sentiment.NEGATIVE)} size={32} className=\"status-circle negative\">\n <AlertIcon className=\"status-icon light\" />\n </Circle>\n ),\n [Sentiment.WARNING]: (\n <Circle as={makeSurface(Sentiment.WARNING)} size={32} className=\"status-circle warning\">\n <AlertIcon className=\"status-icon dark\" />\n </Circle>\n ),\n [Sentiment.NEUTRAL]: (\n <Circle as={makeSurface(Sentiment.NEUTRAL)} size={32} className=\"status-circle neutral\">\n <ClockIcon className=\"status-icon dark\" />\n </Circle>\n ),\n};\n\nfunction CriticalCommsBanner({\n title,\n subtitle,\n action,\n sentiment = Sentiment.NEGATIVE,\n className,\n}: CriticalCommsBannerProps) {\n return (\n <SentimentSurface\n sentiment={sentiment}\n emphasis=\"elevated\"\n className={clsx('critical-comms', className)}\n >\n <Alert\n title={title}\n message={subtitle}\n action={\n action && {\n onClick: action.onClick,\n href: action.href,\n target: action.target,\n text: action.label,\n as: 'button',\n }\n }\n className={className}\n type={sentiment}\n icon={iconBySentiment[sentiment]}\n />\n </SentimentSurface>\n );\n}\n\nexport default CriticalCommsBanner;\n"],"names":["makeSurface","sentiment","Surface","props","_jsx","SentimentSurface","as","emphasis","displayName","iconBySentiment","Sentiment","NEGATIVE","Circle","size","className","children","AlertIcon","WARNING","NEUTRAL","ClockIcon","CriticalCommsBanner","title","subtitle","action","clsx","Alert","message","onClick","href","target","text","label","type","icon"],"mappings":"
|
|
1
|
+
{"version":3,"file":"CriticalCommsBanner.mjs","sources":["../../src/criticalBanner/CriticalCommsBanner.tsx"],"sourcesContent":["import { Alert as AlertIcon, ClockBorderless as ClockIcon } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { PropsWithChildren } from 'react';\n\nimport Alert from '../alert';\nimport { Sentiment } from '../common';\nimport Circle, { CircleProps } from '../common/circle';\nimport SentimentSurface from '../sentimentSurface';\n\nexport type CriticalCommsBannerSentiment =\n | `${Sentiment.WARNING}`\n | `${Sentiment.NEGATIVE}`\n | `${Sentiment.NEUTRAL}`;\n\nexport type CriticalCommsBannerProps = {\n title: string;\n subtitle?: string;\n action?: {\n label: string;\n href?: string;\n target?: HTMLAnchorElement['target'];\n onClick?: () => void;\n };\n sentiment?: CriticalCommsBannerSentiment;\n className?: string;\n};\n\nconst makeSurface = (sentiment: CriticalCommsBannerSentiment) => {\n const Surface = (props: PropsWithChildren<Pick<CircleProps, 'className'>>) => (\n <SentimentSurface as=\"span\" emphasis=\"elevated\" sentiment={sentiment} {...props} />\n );\n Surface.displayName = `CriticalCommsSurface(${sentiment})`;\n return Surface;\n};\n\nconst iconBySentiment: Record<CriticalCommsBannerSentiment, React.ReactNode> = {\n [Sentiment.NEGATIVE]: (\n <Circle as={makeSurface(Sentiment.NEGATIVE)} size={32} className=\"status-circle negative\">\n <AlertIcon className=\"status-icon light\" />\n </Circle>\n ),\n [Sentiment.WARNING]: (\n <Circle as={makeSurface(Sentiment.WARNING)} size={32} className=\"status-circle warning\">\n <AlertIcon className=\"status-icon dark\" />\n </Circle>\n ),\n [Sentiment.NEUTRAL]: (\n <Circle as={makeSurface(Sentiment.NEUTRAL)} size={32} className=\"status-circle neutral\">\n <ClockIcon className=\"status-icon dark\" />\n </Circle>\n ),\n};\n\nfunction CriticalCommsBanner({\n title,\n subtitle,\n action,\n sentiment = Sentiment.NEGATIVE,\n className,\n}: CriticalCommsBannerProps) {\n return (\n <SentimentSurface\n sentiment={sentiment}\n emphasis=\"elevated\"\n className={clsx('critical-comms', className)}\n >\n <Alert\n title={title}\n message={subtitle}\n action={\n action && {\n onClick: action.onClick,\n href: action.href,\n target: action.target,\n text: action.label,\n as: 'button',\n }\n }\n className={className}\n type={sentiment}\n icon={iconBySentiment[sentiment]}\n />\n </SentimentSurface>\n );\n}\n\nexport default CriticalCommsBanner;\n"],"names":["makeSurface","sentiment","Surface","props","_jsx","SentimentSurface","as","emphasis","displayName","iconBySentiment","Sentiment","NEGATIVE","Circle","size","className","children","AlertIcon","WARNING","NEUTRAL","ClockIcon","CriticalCommsBanner","title","subtitle","action","clsx","Alert","message","onClick","href","target","text","label","type","icon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,MAAMA,WAAW,GAAIC,SAAuC,IAAI;AAC9D,EAAA,MAAMC,OAAO,GAAIC,KAAwD,iBACvEC,GAAA,CAACC,gBAAgB,EAAA;AAACC,IAAAA,EAAE,EAAC,MAAM;AAACC,IAAAA,QAAQ,EAAC,UAAU;AAACN,IAAAA,SAAS,EAAEA,SAAU;IAAA,GAAKE;AAAK,GAAC,CACjF;AACDD,EAAAA,OAAO,CAACM,WAAW,GAAG,CAAA,qBAAA,EAAwBP,SAAS,CAAA,CAAA,CAAG;AAC1D,EAAA,OAAOC,OAAO;AAChB,CAAC;AAED,MAAMO,eAAe,GAA0D;AAC7E,EAAA,CAACC,SAAS,CAACC,QAAQ,gBACjBP,GAAA,CAACQ,MAAM,EAAA;AAACN,IAAAA,EAAE,EAAEN,WAAW,CAACU,SAAS,CAACC,QAAQ,CAAE;AAACE,IAAAA,IAAI,EAAE,EAAG;AAACC,IAAAA,SAAS,EAAC,wBAAwB;IAAAC,QAAA,eACvFX,GAAA,CAACY,KAAS,EAAA;AAACF,MAAAA,SAAS,EAAC;KAA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AA,EAAE,EAAE;OAEP;AACDQ,MAAAA,SAAS,EAAEA,SAAU;AACrBkB,MAAAA,IAAI,EAAE/B,SAAU;MAChBgC,IAAI,EAAExB,eAAe,CAACR,SAAS;KAAE;AAErC,GAAkB,CAAC;AAEvB;;;;"}
|
|
@@ -36,9 +36,9 @@ require('../common/propsValues/variant.js');
|
|
|
36
36
|
require('../common/propsValues/scroll.js');
|
|
37
37
|
require('../common/propsValues/markdownNodeType.js');
|
|
38
38
|
require('../common/fileType.js');
|
|
39
|
+
require('@transferwise/formatting');
|
|
39
40
|
require('../common/closeButton/CloseButton.messages.js');
|
|
40
41
|
require('../inputs/SelectInput/SelectInput.messages.js');
|
|
41
|
-
require('@transferwise/formatting');
|
|
42
42
|
var getMonthNames = require('../common/dateUtils/getMonthNames/getMonthNames.js');
|
|
43
43
|
var isDateValid = require('../common/dateUtils/isDateValid/isDateValid.js');
|
|
44
44
|
var isMonthAndYearFormat = require('../common/dateUtils/isMonthAndYearFormat/isMonthAndYearFormat.js');
|
|
@@ -32,9 +32,9 @@ import '../common/propsValues/variant.mjs';
|
|
|
32
32
|
import '../common/propsValues/scroll.mjs';
|
|
33
33
|
import '../common/propsValues/markdownNodeType.mjs';
|
|
34
34
|
import '../common/fileType.mjs';
|
|
35
|
+
import '@transferwise/formatting';
|
|
35
36
|
import '../common/closeButton/CloseButton.messages.mjs';
|
|
36
37
|
import '../inputs/SelectInput/SelectInput.messages.mjs';
|
|
37
|
-
import '@transferwise/formatting';
|
|
38
38
|
import { getMonthNames } from '../common/dateUtils/getMonthNames/getMonthNames.mjs';
|
|
39
39
|
import { isDateValid } from '../common/dateUtils/isDateValid/isDateValid.mjs';
|
|
40
40
|
import { isMonthAndYearFormat } from '../common/dateUtils/isMonthAndYearFormat/isMonthAndYearFormat.mjs';
|
|
@@ -23,11 +23,11 @@ require('../common/propsValues/variant.js');
|
|
|
23
23
|
require('../common/propsValues/scroll.js');
|
|
24
24
|
require('../common/propsValues/markdownNodeType.js');
|
|
25
25
|
require('../common/fileType.js');
|
|
26
|
+
require('@transferwise/formatting');
|
|
26
27
|
require('@transferwise/icons');
|
|
27
28
|
require('react-intl');
|
|
28
29
|
require('../common/closeButton/CloseButton.messages.js');
|
|
29
30
|
var jsxRuntime = require('react/jsx-runtime');
|
|
30
|
-
require('@transferwise/formatting');
|
|
31
31
|
var moveToWithinRange = require('../common/dateUtils/moveToWithinRange/moveToWithinRange.js');
|
|
32
32
|
var isWithinRange = require('../common/dateUtils/isWithinRange/isWithinRange.js');
|
|
33
33
|
var getDateView = require('../common/dateUtils/getDateView/getDateView.js');
|
|
@@ -19,11 +19,11 @@ import '../common/propsValues/variant.mjs';
|
|
|
19
19
|
import '../common/propsValues/scroll.mjs';
|
|
20
20
|
import '../common/propsValues/markdownNodeType.mjs';
|
|
21
21
|
import '../common/fileType.mjs';
|
|
22
|
+
import '@transferwise/formatting';
|
|
22
23
|
import '@transferwise/icons';
|
|
23
24
|
import 'react-intl';
|
|
24
25
|
import '../common/closeButton/CloseButton.messages.mjs';
|
|
25
26
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
26
|
-
import '@transferwise/formatting';
|
|
27
27
|
import { moveToWithinRange } from '../common/dateUtils/moveToWithinRange/moveToWithinRange.mjs';
|
|
28
28
|
import { isWithinRange } from '../common/dateUtils/isWithinRange/isWithinRange.mjs';
|
|
29
29
|
import { returnDateView } from '../common/dateUtils/getDateView/getDateView.mjs';
|
|
@@ -23,6 +23,7 @@ require('../../common/propsValues/variant.js');
|
|
|
23
23
|
require('../../common/propsValues/scroll.js');
|
|
24
24
|
require('../../common/propsValues/markdownNodeType.js');
|
|
25
25
|
require('../../common/fileType.js');
|
|
26
|
+
require('@transferwise/formatting');
|
|
26
27
|
var icons = require('@transferwise/icons');
|
|
27
28
|
require('react');
|
|
28
29
|
require('../../common/closeButton/CloseButton.messages.js');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateHeader.js","sources":["../../../src/dateLookup/dateHeader/DateHeader.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useIntl } from 'react-intl';\n\nimport { Typography } from '../../common';\nimport { useLayout } from '../../common/hooks';\nimport Title from '../../title';\nimport messages from '../DateLookup.messages';\nimport Button from '../../button/Button';\nimport { ChevronDown, ChevronLeft, ChevronRight } from '@transferwise/icons';\nimport IconButton from '../../iconButton';\n\ninterface DateHeaderProps {\n label?: string;\n onLabelClick?: () => void;\n onPreviousClick: () => void;\n onNextClick: () => void;\n dateMode: string;\n}\n\nconst DateHeader: React.FC<DateHeaderProps> = ({\n label,\n onLabelClick,\n onPreviousClick,\n onNextClick,\n dateMode,\n}) => {\n const intl = useIntl();\n const { isMobile } = useLayout();\n return (\n <div className={clsx('text-xs-center', !isMobile && ['clearfix', 'p-y-1'])}>\n <div className=\"pull-left-single-direction\">\n <IconButton\n size={40}\n priority=\"minimal\"\n className=\"d-inline-flex\"\n aria-label={`${intl.formatMessage(messages.previous)} ${dateMode}`}\n onClick={onPreviousClick}\n >\n <ChevronLeft className=\"left-single-direction\" />\n </IconButton>\n </div>\n {label && (\n <Title type={Typography.TITLE_BODY} className=\"tw-date-lookup-header-current-container\">\n <Button\n v2\n size=\"md\"\n type=\"button\"\n priority=\"tertiary\"\n className=\"tw-date-lookup-header-current\"\n aria-label={intl.formatMessage(messages.goTo20YearView)}\n addonEnd={{ type: 'icon', value: <ChevronDown /> }}\n onClick={onLabelClick}\n >\n {label}\n </Button>\n </Title>\n )}\n <div className=\"pull-right-single-direction\">\n <IconButton\n size={40}\n className=\"d-inline-flex\"\n aria-label={`${intl.formatMessage(messages.next)} ${dateMode}`}\n priority=\"minimal\"\n onClick={onNextClick}\n >\n <ChevronRight className=\"right-single-direction\" />\n </IconButton>\n </div>\n </div>\n );\n};\n\nexport default DateHeader;\n"],"names":["DateHeader","label","onLabelClick","onPreviousClick","onNextClick","dateMode","intl","useIntl","isMobile","useLayout","_jsxs","className","clsx","children","_jsx","IconButton","size","priority","formatMessage","messages","previous","onClick","ChevronLeft","Title","type","Typography","TITLE_BODY","Button","v2","goTo20YearView","addonEnd","value","ChevronDown","next","ChevronRight"],"mappings":"
|
|
1
|
+
{"version":3,"file":"DateHeader.js","sources":["../../../src/dateLookup/dateHeader/DateHeader.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useIntl } from 'react-intl';\n\nimport { Typography } from '../../common';\nimport { useLayout } from '../../common/hooks';\nimport Title from '../../title';\nimport messages from '../DateLookup.messages';\nimport Button from '../../button/Button';\nimport { ChevronDown, ChevronLeft, ChevronRight } from '@transferwise/icons';\nimport IconButton from '../../iconButton';\n\ninterface DateHeaderProps {\n label?: string;\n onLabelClick?: () => void;\n onPreviousClick: () => void;\n onNextClick: () => void;\n dateMode: string;\n}\n\nconst DateHeader: React.FC<DateHeaderProps> = ({\n label,\n onLabelClick,\n onPreviousClick,\n onNextClick,\n dateMode,\n}) => {\n const intl = useIntl();\n const { isMobile } = useLayout();\n return (\n <div className={clsx('text-xs-center', !isMobile && ['clearfix', 'p-y-1'])}>\n <div className=\"pull-left-single-direction\">\n <IconButton\n size={40}\n priority=\"minimal\"\n className=\"d-inline-flex\"\n aria-label={`${intl.formatMessage(messages.previous)} ${dateMode}`}\n onClick={onPreviousClick}\n >\n <ChevronLeft className=\"left-single-direction\" />\n </IconButton>\n </div>\n {label && (\n <Title type={Typography.TITLE_BODY} className=\"tw-date-lookup-header-current-container\">\n <Button\n v2\n size=\"md\"\n type=\"button\"\n priority=\"tertiary\"\n className=\"tw-date-lookup-header-current\"\n aria-label={intl.formatMessage(messages.goTo20YearView)}\n addonEnd={{ type: 'icon', value: <ChevronDown /> }}\n onClick={onLabelClick}\n >\n {label}\n </Button>\n </Title>\n )}\n <div className=\"pull-right-single-direction\">\n <IconButton\n size={40}\n className=\"d-inline-flex\"\n aria-label={`${intl.formatMessage(messages.next)} ${dateMode}`}\n priority=\"minimal\"\n onClick={onNextClick}\n >\n <ChevronRight className=\"right-single-direction\" />\n </IconButton>\n </div>\n </div>\n );\n};\n\nexport default DateHeader;\n"],"names":["DateHeader","label","onLabelClick","onPreviousClick","onNextClick","dateMode","intl","useIntl","isMobile","useLayout","_jsxs","className","clsx","children","_jsx","IconButton","size","priority","formatMessage","messages","previous","onClick","ChevronLeft","Title","type","Typography","TITLE_BODY","Button","v2","goTo20YearView","addonEnd","value","ChevronDown","next","ChevronRight"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,MAAMA,UAAU,GAA8BA,CAAC;EAC7CC,KAAK;EACLC,YAAY;EACZC,eAAe;EACfC,WAAW;AACXC,EAAAA;AAAQ,CACT,KAAI;AACH,EAAA,MAAMC,IAAI,GAAGC,iBAAO,EAAE;EACtB,MAAM;AAAEC,IAAAA;GAAU,GAAGC,mBAAS,EAAE;AAChC,EAAA,oBACEC,eAAA,CAAA,KAAA,EAAA;AAAKC,IAAAA,SAAS,EAAEC,SAAI,CAAC,gBAAgB,EAAE,CAACJ,QAAQ,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,CAAE;AAAAK,IAAAA,QAAA,gBACzEC,cAAA,CAAA,KAAA,EAAA;AAAKH,MAAAA,SAAS,EAAC,4BAA4B;MAAAE,QAAA,eACzCC,cAAA,CAACC,kBAAU,EAAA;AACTC,QAAAA,IAAI,EAAE,EAAG;AACTC,QAAAA,QAAQ,EAAC,SAAS;AAClBN,QAAAA,SAAS,EAAC,eAAe;QACzB,YAAA,EAAY,CAAA,EAAGL,IAAI,CAACY,aAAa,CAACC,2BAAQ,CAACC,QAAQ,CAAC,CAAA,CAAA,EAAIf,QAAQ,CAAA,CAAG;AACnEgB,QAAAA,OAAO,EAAElB,eAAgB;QAAAU,QAAA,eAEzBC,cAAA,CAACQ,iBAAW,EAAA;AAACX,UAAAA,SAAS,EAAC;SAAuB;OACpC;AACd,KAAK,CACL,EAACV,KAAK,iBACJa,cAAA,CAACS,aAAK,EAAA;MAACC,IAAI,EAAEC,qBAAU,CAACC,UAAW;AAACf,MAAAA,SAAS,EAAC,yCAAyC;MAAAE,QAAA,eACrFC,cAAA,CAACa,cAAM,EAAA;QACLC,EAAE,EAAA,IAAA;AACFZ,QAAAA,IAAI,EAAC,IAAI;AACTQ,QAAAA,IAAI,EAAC,QAAQ;AACbP,QAAAA,QAAQ,EAAC,UAAU;AACnBN,QAAAA,SAAS,EAAC,+BAA+B;AACzC,QAAA,YAAA,EAAYL,IAAI,CAACY,aAAa,CAACC,2BAAQ,CAACU,cAAc,CAAE;AACxDC,QAAAA,QAAQ,EAAE;AAAEN,UAAAA,IAAI,EAAE,MAAM;AAAEO,UAAAA,KAAK,eAAEjB,cAAA,CAACkB,iBAAW,EAAA,EAAA;SAAM;AACnDX,QAAAA,OAAO,EAAEnB,YAAa;AAAAW,QAAAA,QAAA,EAErBZ;OACK;KACH,CACR,eACDa,cAAA,CAAA,KAAA,EAAA;AAAKH,MAAAA,SAAS,EAAC,6BAA6B;MAAAE,QAAA,eAC1CC,cAAA,CAACC,kBAAU,EAAA;AACTC,QAAAA,IAAI,EAAE,EAAG;AACTL,QAAAA,SAAS,EAAC,eAAe;QACzB,YAAA,EAAY,CAAA,EAAGL,IAAI,CAACY,aAAa,CAACC,2BAAQ,CAACc,IAAI,CAAC,CAAA,CAAA,EAAI5B,QAAQ,CAAA,CAAG;AAC/DY,QAAAA,QAAQ,EAAC,SAAS;AAClBI,QAAAA,OAAO,EAAEjB,WAAY;QAAAS,QAAA,eAErBC,cAAA,CAACoB,kBAAY,EAAA;AAACvB,UAAAA,SAAS,EAAC;SAAwB;OACtC;AACd,KAAK,CACP;AAAA,GAAK,CAAC;AAEV;;;;"}
|
|
@@ -19,6 +19,7 @@ import '../../common/propsValues/variant.mjs';
|
|
|
19
19
|
import '../../common/propsValues/scroll.mjs';
|
|
20
20
|
import '../../common/propsValues/markdownNodeType.mjs';
|
|
21
21
|
import '../../common/fileType.mjs';
|
|
22
|
+
import '@transferwise/formatting';
|
|
22
23
|
import { ChevronLeft, ChevronDown, ChevronRight } from '@transferwise/icons';
|
|
23
24
|
import 'react';
|
|
24
25
|
import '../../common/closeButton/CloseButton.messages.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateHeader.mjs","sources":["../../../src/dateLookup/dateHeader/DateHeader.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useIntl } from 'react-intl';\n\nimport { Typography } from '../../common';\nimport { useLayout } from '../../common/hooks';\nimport Title from '../../title';\nimport messages from '../DateLookup.messages';\nimport Button from '../../button/Button';\nimport { ChevronDown, ChevronLeft, ChevronRight } from '@transferwise/icons';\nimport IconButton from '../../iconButton';\n\ninterface DateHeaderProps {\n label?: string;\n onLabelClick?: () => void;\n onPreviousClick: () => void;\n onNextClick: () => void;\n dateMode: string;\n}\n\nconst DateHeader: React.FC<DateHeaderProps> = ({\n label,\n onLabelClick,\n onPreviousClick,\n onNextClick,\n dateMode,\n}) => {\n const intl = useIntl();\n const { isMobile } = useLayout();\n return (\n <div className={clsx('text-xs-center', !isMobile && ['clearfix', 'p-y-1'])}>\n <div className=\"pull-left-single-direction\">\n <IconButton\n size={40}\n priority=\"minimal\"\n className=\"d-inline-flex\"\n aria-label={`${intl.formatMessage(messages.previous)} ${dateMode}`}\n onClick={onPreviousClick}\n >\n <ChevronLeft className=\"left-single-direction\" />\n </IconButton>\n </div>\n {label && (\n <Title type={Typography.TITLE_BODY} className=\"tw-date-lookup-header-current-container\">\n <Button\n v2\n size=\"md\"\n type=\"button\"\n priority=\"tertiary\"\n className=\"tw-date-lookup-header-current\"\n aria-label={intl.formatMessage(messages.goTo20YearView)}\n addonEnd={{ type: 'icon', value: <ChevronDown /> }}\n onClick={onLabelClick}\n >\n {label}\n </Button>\n </Title>\n )}\n <div className=\"pull-right-single-direction\">\n <IconButton\n size={40}\n className=\"d-inline-flex\"\n aria-label={`${intl.formatMessage(messages.next)} ${dateMode}`}\n priority=\"minimal\"\n onClick={onNextClick}\n >\n <ChevronRight className=\"right-single-direction\" />\n </IconButton>\n </div>\n </div>\n );\n};\n\nexport default DateHeader;\n"],"names":["DateHeader","label","onLabelClick","onPreviousClick","onNextClick","dateMode","intl","useIntl","isMobile","useLayout","_jsxs","className","clsx","children","_jsx","IconButton","size","priority","formatMessage","messages","previous","onClick","ChevronLeft","Title","type","Typography","TITLE_BODY","Button","v2","goTo20YearView","addonEnd","value","ChevronDown","next","ChevronRight"],"mappings":"
|
|
1
|
+
{"version":3,"file":"DateHeader.mjs","sources":["../../../src/dateLookup/dateHeader/DateHeader.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useIntl } from 'react-intl';\n\nimport { Typography } from '../../common';\nimport { useLayout } from '../../common/hooks';\nimport Title from '../../title';\nimport messages from '../DateLookup.messages';\nimport Button from '../../button/Button';\nimport { ChevronDown, ChevronLeft, ChevronRight } from '@transferwise/icons';\nimport IconButton from '../../iconButton';\n\ninterface DateHeaderProps {\n label?: string;\n onLabelClick?: () => void;\n onPreviousClick: () => void;\n onNextClick: () => void;\n dateMode: string;\n}\n\nconst DateHeader: React.FC<DateHeaderProps> = ({\n label,\n onLabelClick,\n onPreviousClick,\n onNextClick,\n dateMode,\n}) => {\n const intl = useIntl();\n const { isMobile } = useLayout();\n return (\n <div className={clsx('text-xs-center', !isMobile && ['clearfix', 'p-y-1'])}>\n <div className=\"pull-left-single-direction\">\n <IconButton\n size={40}\n priority=\"minimal\"\n className=\"d-inline-flex\"\n aria-label={`${intl.formatMessage(messages.previous)} ${dateMode}`}\n onClick={onPreviousClick}\n >\n <ChevronLeft className=\"left-single-direction\" />\n </IconButton>\n </div>\n {label && (\n <Title type={Typography.TITLE_BODY} className=\"tw-date-lookup-header-current-container\">\n <Button\n v2\n size=\"md\"\n type=\"button\"\n priority=\"tertiary\"\n className=\"tw-date-lookup-header-current\"\n aria-label={intl.formatMessage(messages.goTo20YearView)}\n addonEnd={{ type: 'icon', value: <ChevronDown /> }}\n onClick={onLabelClick}\n >\n {label}\n </Button>\n </Title>\n )}\n <div className=\"pull-right-single-direction\">\n <IconButton\n size={40}\n className=\"d-inline-flex\"\n aria-label={`${intl.formatMessage(messages.next)} ${dateMode}`}\n priority=\"minimal\"\n onClick={onNextClick}\n >\n <ChevronRight className=\"right-single-direction\" />\n </IconButton>\n </div>\n </div>\n );\n};\n\nexport default DateHeader;\n"],"names":["DateHeader","label","onLabelClick","onPreviousClick","onNextClick","dateMode","intl","useIntl","isMobile","useLayout","_jsxs","className","clsx","children","_jsx","IconButton","size","priority","formatMessage","messages","previous","onClick","ChevronLeft","Title","type","Typography","TITLE_BODY","Button","v2","goTo20YearView","addonEnd","value","ChevronDown","next","ChevronRight"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,MAAMA,UAAU,GAA8BA,CAAC;EAC7CC,KAAK;EACLC,YAAY;EACZC,eAAe;EACfC,WAAW;AACXC,EAAAA;AAAQ,CACT,KAAI;AACH,EAAA,MAAMC,IAAI,GAAGC,OAAO,EAAE;EACtB,MAAM;AAAEC,IAAAA;GAAU,GAAGC,SAAS,EAAE;AAChC,EAAA,oBACEC,IAAA,CAAA,KAAA,EAAA;AAAKC,IAAAA,SAAS,EAAEC,IAAI,CAAC,gBAAgB,EAAE,CAACJ,QAAQ,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,CAAE;AAAAK,IAAAA,QAAA,gBACzEC,GAAA,CAAA,KAAA,EAAA;AAAKH,MAAAA,SAAS,EAAC,4BAA4B;MAAAE,QAAA,eACzCC,GAAA,CAACC,UAAU,EAAA;AACTC,QAAAA,IAAI,EAAE,EAAG;AACTC,QAAAA,QAAQ,EAAC,SAAS;AAClBN,QAAAA,SAAS,EAAC,eAAe;QACzB,YAAA,EAAY,CAAA,EAAGL,IAAI,CAACY,aAAa,CAACC,QAAQ,CAACC,QAAQ,CAAC,CAAA,CAAA,EAAIf,QAAQ,CAAA,CAAG;AACnEgB,QAAAA,OAAO,EAAElB,eAAgB;QAAAU,QAAA,eAEzBC,GAAA,CAACQ,WAAW,EAAA;AAACX,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../common/propsValues/markdownNodeType.js');
|
|
24
24
|
require('../common/fileType.js');
|
|
25
|
+
require('@transferwise/formatting');
|
|
25
26
|
require('@transferwise/icons');
|
|
26
27
|
require('react');
|
|
27
28
|
require('react-intl');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Decision.js","sources":["../../src/decision/Decision.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport { Size, Breakpoint, SizeSmall, SizeMedium } from '../common';\nimport { useScreenSize } from '../common/hooks/useScreenSize';\nimport NavigationOption from '../navigationOption';\nimport Tile from '../tile';\n\ninterface DecisionOption {\n 'aria-label'?: string;\n description?: React.ReactNode;\n disabled?: boolean;\n href?: string;\n target?: React.HTMLAttributeAnchorTarget;\n media: {\n block: React.ReactNode;\n list: React.ReactNode;\n };\n onClick?: (event?: React.MouseEvent<HTMLElement>) => void;\n title: React.ReactNode;\n}\n\nexport enum DecisionPresentation {\n LIST = 'LIST',\n LIST_BLOCK = 'LIST_BLOCK',\n LIST_BLOCK_GRID = 'LIST_BLOCK_GRID',\n}\n\nexport enum DecisionType {\n NAVIGATION = 'NAVIGATION',\n}\n\nexport interface DecisionProps {\n /** A list of elements to be rendered */\n options: readonly DecisionOption[];\n /** Handles the display mode of the component */\n presentation?: `${DecisionPresentation}`;\n /** Size currently affects only Tile dimension */\n size?: SizeSmall | SizeMedium;\n /** Decide which kind of element type needs to be rendered ex: Navigation Options or in the future Radio or Checkbox Options */\n type?: `${DecisionType}`;\n\n /** Display media in a circle in list presentation */\n showMediaCircleInList?: boolean;\n\n /** Sets navigation options to be aligned with the parent container */\n isContainerAligned?: boolean;\n}\n\nconst Decision = ({\n options,\n presentation = DecisionPresentation.LIST,\n size = Size.MEDIUM,\n type = DecisionType.NAVIGATION,\n showMediaCircleInList = true,\n isContainerAligned = false,\n}: DecisionProps) => {\n const screenXs = useScreenSize(Breakpoint.EXTRA_SMALL);\n const screenSm = useScreenSize(Breakpoint.SMALL);\n\n if (type === DecisionType.NAVIGATION) {\n const renderedOptions = options.map(\n (\n {\n 'aria-label': ariaLabel,\n title,\n description,\n disabled,\n href,\n target,\n media: { list },\n onClick,\n },\n key,\n ) => (\n <NavigationOption\n // eslint-disable-next-line react/no-array-index-key\n key={`nav-${key}`}\n aria-label={ariaLabel}\n complex={false}\n content={description}\n disabled={disabled}\n href={href}\n target={target}\n media={list}\n showMediaAtAllSizes\n showMediaCircle={showMediaCircleInList}\n isContainerAligned={isContainerAligned}\n title={title}\n onClick={onClick}\n />\n ),\n );\n\n if (\n presentation === DecisionPresentation.LIST_BLOCK ||\n presentation === DecisionPresentation.LIST_BLOCK_GRID\n ) {\n const isSmall = size === Size.SMALL;\n const breakpoint = isSmall ? screenXs : screenSm;\n\n const isGrid = presentation === DecisionPresentation.LIST_BLOCK_GRID;\n\n return (\n <div\n className={clsx(\n 'np-decision d-flex',\n {\n 'np-decision--small': isSmall,\n 'np-decision--grid': isGrid,\n },\n breakpoint ? isGrid && 'flex-wrap' : 'flex-column',\n )}\n >\n {breakpoint\n ? options.map(\n (\n {\n 'aria-label': ariaLabel,\n description,\n disabled,\n href,\n target,\n media: { block },\n onClick,\n title,\n },\n key,\n ) => (\n <Tile\n // eslint-disable-next-line react/no-array-index-key\n key={`tile-${key}`}\n className={clsx(`np-decision__tile${isSmall ? '--small' : ''}`, {\n 'np-decision__tile--fixed-width': isGrid,\n })}\n aria-label={ariaLabel}\n description={description}\n disabled={disabled}\n href={href}\n target={target}\n media={block}\n size={isSmall ? Size.SMALL : Size.MEDIUM}\n title={title}\n onClick={onClick}\n />\n ),\n )\n : renderedOptions}\n </div>\n );\n }\n // LIST\n return <>{renderedOptions}</>;\n }\n return null;\n};\n\nexport default Decision;\n"],"names":["DecisionPresentation","DecisionType","Decision","options","presentation","LIST","size","Size","MEDIUM","type","NAVIGATION","showMediaCircleInList","isContainerAligned","screenXs","useScreenSize","Breakpoint","EXTRA_SMALL","screenSm","SMALL","renderedOptions","map","ariaLabel","title","description","disabled","href","target","media","list","onClick","key","_jsx","NavigationOption","complex","content","showMediaAtAllSizes","showMediaCircle","LIST_BLOCK","LIST_BLOCK_GRID","isSmall","breakpoint","isGrid","className","clsx","children","block","Tile","_Fragment"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Decision.js","sources":["../../src/decision/Decision.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport { Size, Breakpoint, SizeSmall, SizeMedium } from '../common';\nimport { useScreenSize } from '../common/hooks/useScreenSize';\nimport NavigationOption from '../navigationOption';\nimport Tile from '../tile';\n\ninterface DecisionOption {\n 'aria-label'?: string;\n description?: React.ReactNode;\n disabled?: boolean;\n href?: string;\n target?: React.HTMLAttributeAnchorTarget;\n media: {\n block: React.ReactNode;\n list: React.ReactNode;\n };\n onClick?: (event?: React.MouseEvent<HTMLElement>) => void;\n title: React.ReactNode;\n}\n\nexport enum DecisionPresentation {\n LIST = 'LIST',\n LIST_BLOCK = 'LIST_BLOCK',\n LIST_BLOCK_GRID = 'LIST_BLOCK_GRID',\n}\n\nexport enum DecisionType {\n NAVIGATION = 'NAVIGATION',\n}\n\nexport interface DecisionProps {\n /** A list of elements to be rendered */\n options: readonly DecisionOption[];\n /** Handles the display mode of the component */\n presentation?: `${DecisionPresentation}`;\n /** Size currently affects only Tile dimension */\n size?: SizeSmall | SizeMedium;\n /** Decide which kind of element type needs to be rendered ex: Navigation Options or in the future Radio or Checkbox Options */\n type?: `${DecisionType}`;\n\n /** Display media in a circle in list presentation */\n showMediaCircleInList?: boolean;\n\n /** Sets navigation options to be aligned with the parent container */\n isContainerAligned?: boolean;\n}\n\nconst Decision = ({\n options,\n presentation = DecisionPresentation.LIST,\n size = Size.MEDIUM,\n type = DecisionType.NAVIGATION,\n showMediaCircleInList = true,\n isContainerAligned = false,\n}: DecisionProps) => {\n const screenXs = useScreenSize(Breakpoint.EXTRA_SMALL);\n const screenSm = useScreenSize(Breakpoint.SMALL);\n\n if (type === DecisionType.NAVIGATION) {\n const renderedOptions = options.map(\n (\n {\n 'aria-label': ariaLabel,\n title,\n description,\n disabled,\n href,\n target,\n media: { list },\n onClick,\n },\n key,\n ) => (\n <NavigationOption\n // eslint-disable-next-line react/no-array-index-key\n key={`nav-${key}`}\n aria-label={ariaLabel}\n complex={false}\n content={description}\n disabled={disabled}\n href={href}\n target={target}\n media={list}\n showMediaAtAllSizes\n showMediaCircle={showMediaCircleInList}\n isContainerAligned={isContainerAligned}\n title={title}\n onClick={onClick}\n />\n ),\n );\n\n if (\n presentation === DecisionPresentation.LIST_BLOCK ||\n presentation === DecisionPresentation.LIST_BLOCK_GRID\n ) {\n const isSmall = size === Size.SMALL;\n const breakpoint = isSmall ? screenXs : screenSm;\n\n const isGrid = presentation === DecisionPresentation.LIST_BLOCK_GRID;\n\n return (\n <div\n className={clsx(\n 'np-decision d-flex',\n {\n 'np-decision--small': isSmall,\n 'np-decision--grid': isGrid,\n },\n breakpoint ? isGrid && 'flex-wrap' : 'flex-column',\n )}\n >\n {breakpoint\n ? options.map(\n (\n {\n 'aria-label': ariaLabel,\n description,\n disabled,\n href,\n target,\n media: { block },\n onClick,\n title,\n },\n key,\n ) => (\n <Tile\n // eslint-disable-next-line react/no-array-index-key\n key={`tile-${key}`}\n className={clsx(`np-decision__tile${isSmall ? '--small' : ''}`, {\n 'np-decision__tile--fixed-width': isGrid,\n })}\n aria-label={ariaLabel}\n description={description}\n disabled={disabled}\n href={href}\n target={target}\n media={block}\n size={isSmall ? Size.SMALL : Size.MEDIUM}\n title={title}\n onClick={onClick}\n />\n ),\n )\n : renderedOptions}\n </div>\n );\n }\n // LIST\n return <>{renderedOptions}</>;\n }\n return null;\n};\n\nexport default Decision;\n"],"names":["DecisionPresentation","DecisionType","Decision","options","presentation","LIST","size","Size","MEDIUM","type","NAVIGATION","showMediaCircleInList","isContainerAligned","screenXs","useScreenSize","Breakpoint","EXTRA_SMALL","screenSm","SMALL","renderedOptions","map","ariaLabel","title","description","disabled","href","target","media","list","onClick","key","_jsx","NavigationOption","complex","content","showMediaAtAllSizes","showMediaCircle","LIST_BLOCK","LIST_BLOCK_GRID","isSmall","breakpoint","isGrid","className","clsx","children","block","Tile","_Fragment"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBYA;AAAZ,CAAA,UAAYA,oBAAoB,EAAA;AAC9BA,EAAAA,oBAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACbA,EAAAA,oBAAA,CAAA,YAAA,CAAA,GAAA,YAAyB;AACzBA,EAAAA,oBAAA,CAAA,iBAAA,CAAA,GAAA,iBAAmC;AACrC,CAAC,EAJWA,4BAAoB,KAApBA,4BAAoB,GAAA,EAAA,CAAA,CAAA;AAMpBC;AAAZ,CAAA,UAAYA,YAAY,EAAA;AACtBA,EAAAA,YAAA,CAAA,YAAA,CAAA,GAAA,YAAyB;AAC3B,CAAC,EAFWA,oBAAY,KAAZA,oBAAY,GAAA,EAAA,CAAA,CAAA;AAqBxB,MAAMC,QAAQ,GAAGA,CAAC;EAChBC,OAAO;EACPC,YAAY,GAAGJ,4BAAoB,CAACK,IAAI;QACxCC,MAAI,GAAGC,SAAI,CAACC,MAAM;EAClBC,IAAI,GAAGR,oBAAY,CAACS,UAAU;AAC9BC,EAAAA,qBAAqB,GAAG,IAAI;AAC5BC,EAAAA,kBAAkB,GAAG;AAAK,CACZ,KAAI;AAClB,EAAA,MAAMC,QAAQ,GAAGC,2BAAa,CAACC,qBAAU,CAACC,WAAW,CAAC;AACtD,EAAA,MAAMC,QAAQ,GAAGH,2BAAa,CAACC,qBAAU,CAACG,KAAK,CAAC;AAEhD,EAAA,IAAIT,IAAI,KAAKR,oBAAY,CAACS,UAAU,EAAE;AACpC,IAAA,MAAMS,eAAe,GAAGhB,OAAO,CAACiB,GAAG,CACjC,CACE;AACE,MAAA,YAAY,EAAEC,SAAS;MACvBC,KAAK;MACLC,WAAW;MACXC,QAAQ;MACRC,IAAI;MACJC,MAAM;AACNC,MAAAA,KAAK,EAAE;AAAEC,QAAAA;OAAM;AACfC,MA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EkB,YAAAA;WAAO;UAChBhB,OAAO;AACPP,UAAAA;AAAK,SACN,EACDQ,GAAG,kBAEHC,cAAA,CAACe;AACC;AAAA,UAAA;UAEAJ,SAAS,EAAEC,SAAI,CAAC,CAAA,iBAAA,EAAoBJ,OAAO,GAAG,SAAS,GAAG,EAAE,CAAA,CAAE,EAAE;AAC9D,YAAA,gCAAgC,EAAEE;AACnC,WAAA,CAAE;AACH,UAAA,YAAA,EAAYpB,SAAU;AACtBE,UAAAA,WAAW,EAAEA,WAAY;AACzBC,UAAAA,QAAQ,EAAEA,QAAS;AACnBC,UAAAA,IAAI,EAAEA,IAAK;AACXC,UAAAA,MAAM,EAAEA,MAAO;AACfC,UAAAA,KAAK,EAAEkB,KAAM;UACbvC,IAAI,EAAEiC,OAAO,GAAGhC,SAAI,CAACW,KAAK,GAAGX,SAAI,CAACC,MAAO;AACzCc,UAAAA,KAAK,EAAEA,KAAM;AACbO,UAAAA,OAAO,EAAEA;AAAQ,SAAA,EAZZ,CAAA,KAAA,EAAQC,GAAG,CAAA,CAYC,CAEpB,CACF,GACDX;AAAe,OAChB,CAAC;AAEV,IAAA;AACA;IACA,oBAAOY,cAAA,CAAAgB,mBAAA,EAAA;AAAAH,MAAAA,QAAA,EAAGzB;AAAe,MAAI;AAC/B,EAAA;AACA,EAAA,OAAO,IAAI;AACb;;;;"}
|
|
@@ -18,6 +18,7 @@ import '../common/propsValues/variant.mjs';
|
|
|
18
18
|
import '../common/propsValues/scroll.mjs';
|
|
19
19
|
import '../common/propsValues/markdownNodeType.mjs';
|
|
20
20
|
import '../common/fileType.mjs';
|
|
21
|
+
import '@transferwise/formatting';
|
|
21
22
|
import '@transferwise/icons';
|
|
22
23
|
import 'react';
|
|
23
24
|
import 'react-intl';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Decision.mjs","sources":["../../src/decision/Decision.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport { Size, Breakpoint, SizeSmall, SizeMedium } from '../common';\nimport { useScreenSize } from '../common/hooks/useScreenSize';\nimport NavigationOption from '../navigationOption';\nimport Tile from '../tile';\n\ninterface DecisionOption {\n 'aria-label'?: string;\n description?: React.ReactNode;\n disabled?: boolean;\n href?: string;\n target?: React.HTMLAttributeAnchorTarget;\n media: {\n block: React.ReactNode;\n list: React.ReactNode;\n };\n onClick?: (event?: React.MouseEvent<HTMLElement>) => void;\n title: React.ReactNode;\n}\n\nexport enum DecisionPresentation {\n LIST = 'LIST',\n LIST_BLOCK = 'LIST_BLOCK',\n LIST_BLOCK_GRID = 'LIST_BLOCK_GRID',\n}\n\nexport enum DecisionType {\n NAVIGATION = 'NAVIGATION',\n}\n\nexport interface DecisionProps {\n /** A list of elements to be rendered */\n options: readonly DecisionOption[];\n /** Handles the display mode of the component */\n presentation?: `${DecisionPresentation}`;\n /** Size currently affects only Tile dimension */\n size?: SizeSmall | SizeMedium;\n /** Decide which kind of element type needs to be rendered ex: Navigation Options or in the future Radio or Checkbox Options */\n type?: `${DecisionType}`;\n\n /** Display media in a circle in list presentation */\n showMediaCircleInList?: boolean;\n\n /** Sets navigation options to be aligned with the parent container */\n isContainerAligned?: boolean;\n}\n\nconst Decision = ({\n options,\n presentation = DecisionPresentation.LIST,\n size = Size.MEDIUM,\n type = DecisionType.NAVIGATION,\n showMediaCircleInList = true,\n isContainerAligned = false,\n}: DecisionProps) => {\n const screenXs = useScreenSize(Breakpoint.EXTRA_SMALL);\n const screenSm = useScreenSize(Breakpoint.SMALL);\n\n if (type === DecisionType.NAVIGATION) {\n const renderedOptions = options.map(\n (\n {\n 'aria-label': ariaLabel,\n title,\n description,\n disabled,\n href,\n target,\n media: { list },\n onClick,\n },\n key,\n ) => (\n <NavigationOption\n // eslint-disable-next-line react/no-array-index-key\n key={`nav-${key}`}\n aria-label={ariaLabel}\n complex={false}\n content={description}\n disabled={disabled}\n href={href}\n target={target}\n media={list}\n showMediaAtAllSizes\n showMediaCircle={showMediaCircleInList}\n isContainerAligned={isContainerAligned}\n title={title}\n onClick={onClick}\n />\n ),\n );\n\n if (\n presentation === DecisionPresentation.LIST_BLOCK ||\n presentation === DecisionPresentation.LIST_BLOCK_GRID\n ) {\n const isSmall = size === Size.SMALL;\n const breakpoint = isSmall ? screenXs : screenSm;\n\n const isGrid = presentation === DecisionPresentation.LIST_BLOCK_GRID;\n\n return (\n <div\n className={clsx(\n 'np-decision d-flex',\n {\n 'np-decision--small': isSmall,\n 'np-decision--grid': isGrid,\n },\n breakpoint ? isGrid && 'flex-wrap' : 'flex-column',\n )}\n >\n {breakpoint\n ? options.map(\n (\n {\n 'aria-label': ariaLabel,\n description,\n disabled,\n href,\n target,\n media: { block },\n onClick,\n title,\n },\n key,\n ) => (\n <Tile\n // eslint-disable-next-line react/no-array-index-key\n key={`tile-${key}`}\n className={clsx(`np-decision__tile${isSmall ? '--small' : ''}`, {\n 'np-decision__tile--fixed-width': isGrid,\n })}\n aria-label={ariaLabel}\n description={description}\n disabled={disabled}\n href={href}\n target={target}\n media={block}\n size={isSmall ? Size.SMALL : Size.MEDIUM}\n title={title}\n onClick={onClick}\n />\n ),\n )\n : renderedOptions}\n </div>\n );\n }\n // LIST\n return <>{renderedOptions}</>;\n }\n return null;\n};\n\nexport default Decision;\n"],"names":["DecisionPresentation","DecisionType","Decision","options","presentation","LIST","size","Size","MEDIUM","type","NAVIGATION","showMediaCircleInList","isContainerAligned","screenXs","useScreenSize","Breakpoint","EXTRA_SMALL","screenSm","SMALL","renderedOptions","map","ariaLabel","title","description","disabled","href","target","media","list","onClick","key","_jsx","NavigationOption","complex","content","showMediaAtAllSizes","showMediaCircle","LIST_BLOCK","LIST_BLOCK_GRID","isSmall","breakpoint","isGrid","className","clsx","children","block","Tile","_Fragment"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Decision.mjs","sources":["../../src/decision/Decision.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport { Size, Breakpoint, SizeSmall, SizeMedium } from '../common';\nimport { useScreenSize } from '../common/hooks/useScreenSize';\nimport NavigationOption from '../navigationOption';\nimport Tile from '../tile';\n\ninterface DecisionOption {\n 'aria-label'?: string;\n description?: React.ReactNode;\n disabled?: boolean;\n href?: string;\n target?: React.HTMLAttributeAnchorTarget;\n media: {\n block: React.ReactNode;\n list: React.ReactNode;\n };\n onClick?: (event?: React.MouseEvent<HTMLElement>) => void;\n title: React.ReactNode;\n}\n\nexport enum DecisionPresentation {\n LIST = 'LIST',\n LIST_BLOCK = 'LIST_BLOCK',\n LIST_BLOCK_GRID = 'LIST_BLOCK_GRID',\n}\n\nexport enum DecisionType {\n NAVIGATION = 'NAVIGATION',\n}\n\nexport interface DecisionProps {\n /** A list of elements to be rendered */\n options: readonly DecisionOption[];\n /** Handles the display mode of the component */\n presentation?: `${DecisionPresentation}`;\n /** Size currently affects only Tile dimension */\n size?: SizeSmall | SizeMedium;\n /** Decide which kind of element type needs to be rendered ex: Navigation Options or in the future Radio or Checkbox Options */\n type?: `${DecisionType}`;\n\n /** Display media in a circle in list presentation */\n showMediaCircleInList?: boolean;\n\n /** Sets navigation options to be aligned with the parent container */\n isContainerAligned?: boolean;\n}\n\nconst Decision = ({\n options,\n presentation = DecisionPresentation.LIST,\n size = Size.MEDIUM,\n type = DecisionType.NAVIGATION,\n showMediaCircleInList = true,\n isContainerAligned = false,\n}: DecisionProps) => {\n const screenXs = useScreenSize(Breakpoint.EXTRA_SMALL);\n const screenSm = useScreenSize(Breakpoint.SMALL);\n\n if (type === DecisionType.NAVIGATION) {\n const renderedOptions = options.map(\n (\n {\n 'aria-label': ariaLabel,\n title,\n description,\n disabled,\n href,\n target,\n media: { list },\n onClick,\n },\n key,\n ) => (\n <NavigationOption\n // eslint-disable-next-line react/no-array-index-key\n key={`nav-${key}`}\n aria-label={ariaLabel}\n complex={false}\n content={description}\n disabled={disabled}\n href={href}\n target={target}\n media={list}\n showMediaAtAllSizes\n showMediaCircle={showMediaCircleInList}\n isContainerAligned={isContainerAligned}\n title={title}\n onClick={onClick}\n />\n ),\n );\n\n if (\n presentation === DecisionPresentation.LIST_BLOCK ||\n presentation === DecisionPresentation.LIST_BLOCK_GRID\n ) {\n const isSmall = size === Size.SMALL;\n const breakpoint = isSmall ? screenXs : screenSm;\n\n const isGrid = presentation === DecisionPresentation.LIST_BLOCK_GRID;\n\n return (\n <div\n className={clsx(\n 'np-decision d-flex',\n {\n 'np-decision--small': isSmall,\n 'np-decision--grid': isGrid,\n },\n breakpoint ? isGrid && 'flex-wrap' : 'flex-column',\n )}\n >\n {breakpoint\n ? options.map(\n (\n {\n 'aria-label': ariaLabel,\n description,\n disabled,\n href,\n target,\n media: { block },\n onClick,\n title,\n },\n key,\n ) => (\n <Tile\n // eslint-disable-next-line react/no-array-index-key\n key={`tile-${key}`}\n className={clsx(`np-decision__tile${isSmall ? '--small' : ''}`, {\n 'np-decision__tile--fixed-width': isGrid,\n })}\n aria-label={ariaLabel}\n description={description}\n disabled={disabled}\n href={href}\n target={target}\n media={block}\n size={isSmall ? Size.SMALL : Size.MEDIUM}\n title={title}\n onClick={onClick}\n />\n ),\n )\n : renderedOptions}\n </div>\n );\n }\n // LIST\n return <>{renderedOptions}</>;\n }\n return null;\n};\n\nexport default Decision;\n"],"names":["DecisionPresentation","DecisionType","Decision","options","presentation","LIST","size","Size","MEDIUM","type","NAVIGATION","showMediaCircleInList","isContainerAligned","screenXs","useScreenSize","Breakpoint","EXTRA_SMALL","screenSm","SMALL","renderedOptions","map","ariaLabel","title","description","disabled","href","target","media","list","onClick","key","_jsx","NavigationOption","complex","content","showMediaAtAllSizes","showMediaCircle","LIST_BLOCK","LIST_BLOCK_GRID","isSmall","breakpoint","isGrid","className","clsx","children","block","Tile","_Fragment"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAqBYA;AAAZ,CAAA,UAAYA,oBAAoB,EAAA;AAC9BA,EAAAA,oBAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACbA,EAAAA,oBAAA,CAAA,YAAA,CAAA,GAAA,YAAyB;AACzB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AAAA,WAAW,EAAEA,WAAY;AACzBC,UAAAA,QAAQ,EAAEA,QAAS;AACnBC,UAAAA,IAAI,EAAEA,IAAK;AACXC,UAAAA,MAAM,EAAEA,MAAO;AACfC,UAAAA,KAAK,EAAEkB,KAAM;UACbvC,IAAI,EAAEiC,OAAO,GAAGhC,IAAI,CAACW,KAAK,GAAGX,IAAI,CAACC,MAAO;AACzCc,UAAAA,KAAK,EAAEA,KAAM;AACbO,UAAAA,OAAO,EAAEA;AAAQ,SAAA,EAZZ,CAAA,KAAA,EAAQC,GAAG,CAAA,CAYC,CAEpB,CACF,GACDX;AAAe,OAChB,CAAC;AAEV,IAAA;AACA;IACA,oBAAOY,GAAA,CAAAgB,QAAA,EAAA;AAAAH,MAAAA,QAAA,EAAGzB;AAAe,MAAI;AAC/B,EAAA;AACA,EAAA,OAAO,IAAI;AACb;;;;"}
|
|
@@ -22,6 +22,7 @@ require('../common/propsValues/variant.js');
|
|
|
22
22
|
require('../common/propsValues/scroll.js');
|
|
23
23
|
require('../common/propsValues/markdownNodeType.js');
|
|
24
24
|
require('../common/fileType.js');
|
|
25
|
+
require('@transferwise/formatting');
|
|
25
26
|
require('@transferwise/icons');
|
|
26
27
|
require('react');
|
|
27
28
|
require('react-intl');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefinitionList.js","sources":["../../src/definitionList/DefinitionList.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport { Layout } from '../common';\nimport Button from '../button';\n\nexport interface DefinitionListDefinition {\n action?: {\n label: string;\n onClick?: React.MouseEventHandler<HTMLButtonElement>;\n };\n title: React.ReactNode;\n value: React.ReactNode;\n key: string;\n}\n\nexport type DefinitionListLayout =\n `${Layout.VERTICAL_TWO_COLUMN | Layout.VERTICAL_ONE_COLUMN | Layout.HORIZONTAL_JUSTIFIED | Layout.HORIZONTAL_LEFT_ALIGNED | Layout.HORIZONTAL_RIGHT_ALIGNED}`;\n\nexport interface DefinitionListProps {\n definitions?: DefinitionListDefinition[];\n layout?: DefinitionListLayout;\n muted?: boolean;\n}\n\nconst isLayoutHorizontal = (layout: DefinitionListLayout) =>\n layout === Layout.HORIZONTAL_LEFT_ALIGNED ||\n layout === Layout.HORIZONTAL_RIGHT_ALIGNED ||\n layout === Layout.HORIZONTAL_JUSTIFIED;\n\nconst getAlignmentClasses = (\n layout: DefinitionListLayout,\n action: DefinitionListDefinition['action'],\n) => {\n const classes = ['d-flex'];\n\n if (action) {\n if (isLayoutHorizontal(layout)) {\n classes.push('align-items-center');\n } else {\n classes.push('align-items-start');\n }\n }\n\n if (layout === Layout.HORIZONTAL_RIGHT_ALIGNED) {\n classes.push('text-sm-right tw-definition-list--right-aligned-desktop');\n } else {\n classes.push('justify-content-between');\n }\n\n if (layout === Layout.HORIZONTAL_JUSTIFIED) {\n classes.push('text-sm-justify');\n }\n\n return classes;\n};\n\nconst defaultDefinitions = [] satisfies DefinitionListProps['definitions'];\n\nexport default function DefinitionList({\n definitions = defaultDefinitions,\n layout = 'VERTICAL_TWO_COLUMN',\n muted,\n}: DefinitionListProps) {\n return (\n <dl\n className={clsx('tw-definition-list d-flex ', {\n 'text-muted': muted,\n 'flex-column': layout === Layout.VERTICAL_ONE_COLUMN,\n 'tw-definition-list--columns flex-column flex-row--sm':\n layout === Layout.VERTICAL_TWO_COLUMN,\n 'tw-definition-list--horizontal flex-column': isLayoutHorizontal(layout),\n })}\n >\n {definitions\n .filter((definition) => definition)\n .map(({ action, title, value, key }) => (\n <div key={key} className=\"tw-definition-list__item\">\n <dt>{title}</dt>\n <dd className={clsx(...getAlignmentClasses(layout, action))}>\n <div>{value}</div>\n {action ? (\n <div\n className={clsx(\n isLayoutHorizontal(layout) ? 'p-l-2' : 'p-x-2',\n 'tw-definition-list__action',\n )}\n >\n <Button as=\"button\" size=\"sm\" v2 onClick={action.onClick}>\n {action.label}\n </Button>\n </div>\n ) : null}\n </dd>\n </div>\n ))}\n </dl>\n );\n}\n"],"names":["isLayoutHorizontal","layout","Layout","HORIZONTAL_LEFT_ALIGNED","HORIZONTAL_RIGHT_ALIGNED","HORIZONTAL_JUSTIFIED","getAlignmentClasses","action","classes","push","defaultDefinitions","DefinitionList","definitions","muted","_jsx","className","clsx","VERTICAL_ONE_COLUMN","VERTICAL_TWO_COLUMN","children","filter","definition","map","title","value","key","_jsxs","Button","as","size","v2","onClick","label"],"mappings":"
|
|
1
|
+
{"version":3,"file":"DefinitionList.js","sources":["../../src/definitionList/DefinitionList.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport { Layout } from '../common';\nimport Button from '../button';\n\nexport interface DefinitionListDefinition {\n action?: {\n label: string;\n onClick?: React.MouseEventHandler<HTMLButtonElement>;\n };\n title: React.ReactNode;\n value: React.ReactNode;\n key: string;\n}\n\nexport type DefinitionListLayout =\n `${Layout.VERTICAL_TWO_COLUMN | Layout.VERTICAL_ONE_COLUMN | Layout.HORIZONTAL_JUSTIFIED | Layout.HORIZONTAL_LEFT_ALIGNED | Layout.HORIZONTAL_RIGHT_ALIGNED}`;\n\nexport interface DefinitionListProps {\n definitions?: DefinitionListDefinition[];\n layout?: DefinitionListLayout;\n muted?: boolean;\n}\n\nconst isLayoutHorizontal = (layout: DefinitionListLayout) =>\n layout === Layout.HORIZONTAL_LEFT_ALIGNED ||\n layout === Layout.HORIZONTAL_RIGHT_ALIGNED ||\n layout === Layout.HORIZONTAL_JUSTIFIED;\n\nconst getAlignmentClasses = (\n layout: DefinitionListLayout,\n action: DefinitionListDefinition['action'],\n) => {\n const classes = ['d-flex'];\n\n if (action) {\n if (isLayoutHorizontal(layout)) {\n classes.push('align-items-center');\n } else {\n classes.push('align-items-start');\n }\n }\n\n if (layout === Layout.HORIZONTAL_RIGHT_ALIGNED) {\n classes.push('text-sm-right tw-definition-list--right-aligned-desktop');\n } else {\n classes.push('justify-content-between');\n }\n\n if (layout === Layout.HORIZONTAL_JUSTIFIED) {\n classes.push('text-sm-justify');\n }\n\n return classes;\n};\n\nconst defaultDefinitions = [] satisfies DefinitionListProps['definitions'];\n\nexport default function DefinitionList({\n definitions = defaultDefinitions,\n layout = 'VERTICAL_TWO_COLUMN',\n muted,\n}: DefinitionListProps) {\n return (\n <dl\n className={clsx('tw-definition-list d-flex ', {\n 'text-muted': muted,\n 'flex-column': layout === Layout.VERTICAL_ONE_COLUMN,\n 'tw-definition-list--columns flex-column flex-row--sm':\n layout === Layout.VERTICAL_TWO_COLUMN,\n 'tw-definition-list--horizontal flex-column': isLayoutHorizontal(layout),\n })}\n >\n {definitions\n .filter((definition) => definition)\n .map(({ action, title, value, key }) => (\n <div key={key} className=\"tw-definition-list__item\">\n <dt>{title}</dt>\n <dd className={clsx(...getAlignmentClasses(layout, action))}>\n <div>{value}</div>\n {action ? (\n <div\n className={clsx(\n isLayoutHorizontal(layout) ? 'p-l-2' : 'p-x-2',\n 'tw-definition-list__action',\n )}\n >\n <Button as=\"button\" size=\"sm\" v2 onClick={action.onClick}>\n {action.label}\n </Button>\n </div>\n ) : null}\n </dd>\n </div>\n ))}\n </dl>\n );\n}\n"],"names":["isLayoutHorizontal","layout","Layout","HORIZONTAL_LEFT_ALIGNED","HORIZONTAL_RIGHT_ALIGNED","HORIZONTAL_JUSTIFIED","getAlignmentClasses","action","classes","push","defaultDefinitions","DefinitionList","definitions","muted","_jsx","className","clsx","VERTICAL_ONE_COLUMN","VERTICAL_TWO_COLUMN","children","filter","definition","map","title","value","key","_jsxs","Button","as","size","v2","onClick","label"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,MAAMA,kBAAkB,GAAIC,MAA4B,IACtDA,MAAM,KAAKC,cAAM,CAACC,uBAAuB,IACzCF,MAAM,KAAKC,cAAM,CAACE,wBAAwB,IAC1CH,MAAM,KAAKC,cAAM,CAACG,oBAAoB;AAExC,MAAMC,mBAAmB,GAAGA,CAC1BL,MAA4B,EAC5BM,MAA0C,KACxC;AACF,EAAA,MAAMC,OAAO,GAAG,CAAC,QAAQ,CAAC;AAE1B,EAAA,I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,kBACjCC,eAAA,CAAA,KAAA,EAAA;AAAeX,MAAAA,SAAS,EAAC,0BAA0B;AAAAI,MAAAA,QAAA,gBACjDL,cAAA,CAAA,IAAA,EAAA;AAAAK,QAAAA,QAAA,EAAKI;OAAU,CACf,eAAAG,eAAA,CAAA,IAAA,EAAA;QAAIX,SAAS,EAAEC,SAAI,CAAC,GAAGV,mBAAmB,CAACL,MAAM,EAAEM,MAAM,CAAC,CAAE;AAAAY,QAAAA,QAAA,gBAC1DL,cAAA,CAAA,KAAA,EAAA;AAAAK,UAAAA,QAAA,EAAMK;AAAK,SAAM,CACjB,EAACjB,MAAM,gBACLO,cAAA,CAAA,KAAA,EAAA;AACEC,UAAAA,SAAS,EAAEC,SAAI,CACbhB,kBAAkB,CAACC,MAAM,CAAC,GAAG,OAAO,GAAG,OAAO,EAC9C,4BAA4B,CAC5B;UAAAkB,QAAA,eAEFL,cAAA,CAACa,uBAAM,EAAA;AAACC,YAAAA,EAAE,EAAC,QAAQ;AAACC,YAAAA,IAAI,EAAC,IAAI;YAACC,EAAE,EAAA,IAAA;YAACC,OAAO,EAAExB,MAAM,CAACwB,OAAQ;YAAAZ,QAAA,EACtDZ,MAAM,CAACyB;WACF;SACL,CAAC,GACJ,IAAI;AAAA,OACN,CACN;AAAA,KAAA,EAjBUP,GAiBL,CACN;AAAC,GACF,CAAC;AAET;;;;"}
|
|
@@ -18,6 +18,7 @@ import '../common/propsValues/variant.mjs';
|
|
|
18
18
|
import '../common/propsValues/scroll.mjs';
|
|
19
19
|
import '../common/propsValues/markdownNodeType.mjs';
|
|
20
20
|
import '../common/fileType.mjs';
|
|
21
|
+
import '@transferwise/formatting';
|
|
21
22
|
import '@transferwise/icons';
|
|
22
23
|
import 'react';
|
|
23
24
|
import 'react-intl';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefinitionList.mjs","sources":["../../src/definitionList/DefinitionList.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport { Layout } from '../common';\nimport Button from '../button';\n\nexport interface DefinitionListDefinition {\n action?: {\n label: string;\n onClick?: React.MouseEventHandler<HTMLButtonElement>;\n };\n title: React.ReactNode;\n value: React.ReactNode;\n key: string;\n}\n\nexport type DefinitionListLayout =\n `${Layout.VERTICAL_TWO_COLUMN | Layout.VERTICAL_ONE_COLUMN | Layout.HORIZONTAL_JUSTIFIED | Layout.HORIZONTAL_LEFT_ALIGNED | Layout.HORIZONTAL_RIGHT_ALIGNED}`;\n\nexport interface DefinitionListProps {\n definitions?: DefinitionListDefinition[];\n layout?: DefinitionListLayout;\n muted?: boolean;\n}\n\nconst isLayoutHorizontal = (layout: DefinitionListLayout) =>\n layout === Layout.HORIZONTAL_LEFT_ALIGNED ||\n layout === Layout.HORIZONTAL_RIGHT_ALIGNED ||\n layout === Layout.HORIZONTAL_JUSTIFIED;\n\nconst getAlignmentClasses = (\n layout: DefinitionListLayout,\n action: DefinitionListDefinition['action'],\n) => {\n const classes = ['d-flex'];\n\n if (action) {\n if (isLayoutHorizontal(layout)) {\n classes.push('align-items-center');\n } else {\n classes.push('align-items-start');\n }\n }\n\n if (layout === Layout.HORIZONTAL_RIGHT_ALIGNED) {\n classes.push('text-sm-right tw-definition-list--right-aligned-desktop');\n } else {\n classes.push('justify-content-between');\n }\n\n if (layout === Layout.HORIZONTAL_JUSTIFIED) {\n classes.push('text-sm-justify');\n }\n\n return classes;\n};\n\nconst defaultDefinitions = [] satisfies DefinitionListProps['definitions'];\n\nexport default function DefinitionList({\n definitions = defaultDefinitions,\n layout = 'VERTICAL_TWO_COLUMN',\n muted,\n}: DefinitionListProps) {\n return (\n <dl\n className={clsx('tw-definition-list d-flex ', {\n 'text-muted': muted,\n 'flex-column': layout === Layout.VERTICAL_ONE_COLUMN,\n 'tw-definition-list--columns flex-column flex-row--sm':\n layout === Layout.VERTICAL_TWO_COLUMN,\n 'tw-definition-list--horizontal flex-column': isLayoutHorizontal(layout),\n })}\n >\n {definitions\n .filter((definition) => definition)\n .map(({ action, title, value, key }) => (\n <div key={key} className=\"tw-definition-list__item\">\n <dt>{title}</dt>\n <dd className={clsx(...getAlignmentClasses(layout, action))}>\n <div>{value}</div>\n {action ? (\n <div\n className={clsx(\n isLayoutHorizontal(layout) ? 'p-l-2' : 'p-x-2',\n 'tw-definition-list__action',\n )}\n >\n <Button as=\"button\" size=\"sm\" v2 onClick={action.onClick}>\n {action.label}\n </Button>\n </div>\n ) : null}\n </dd>\n </div>\n ))}\n </dl>\n );\n}\n"],"names":["isLayoutHorizontal","layout","Layout","HORIZONTAL_LEFT_ALIGNED","HORIZONTAL_RIGHT_ALIGNED","HORIZONTAL_JUSTIFIED","getAlignmentClasses","action","classes","push","defaultDefinitions","DefinitionList","definitions","muted","_jsx","className","clsx","VERTICAL_ONE_COLUMN","VERTICAL_TWO_COLUMN","children","filter","definition","map","title","value","key","_jsxs","Button","as","size","v2","onClick","label"],"mappings":"
|
|
1
|
+
{"version":3,"file":"DefinitionList.mjs","sources":["../../src/definitionList/DefinitionList.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport { Layout } from '../common';\nimport Button from '../button';\n\nexport interface DefinitionListDefinition {\n action?: {\n label: string;\n onClick?: React.MouseEventHandler<HTMLButtonElement>;\n };\n title: React.ReactNode;\n value: React.ReactNode;\n key: string;\n}\n\nexport type DefinitionListLayout =\n `${Layout.VERTICAL_TWO_COLUMN | Layout.VERTICAL_ONE_COLUMN | Layout.HORIZONTAL_JUSTIFIED | Layout.HORIZONTAL_LEFT_ALIGNED | Layout.HORIZONTAL_RIGHT_ALIGNED}`;\n\nexport interface DefinitionListProps {\n definitions?: DefinitionListDefinition[];\n layout?: DefinitionListLayout;\n muted?: boolean;\n}\n\nconst isLayoutHorizontal = (layout: DefinitionListLayout) =>\n layout === Layout.HORIZONTAL_LEFT_ALIGNED ||\n layout === Layout.HORIZONTAL_RIGHT_ALIGNED ||\n layout === Layout.HORIZONTAL_JUSTIFIED;\n\nconst getAlignmentClasses = (\n layout: DefinitionListLayout,\n action: DefinitionListDefinition['action'],\n) => {\n const classes = ['d-flex'];\n\n if (action) {\n if (isLayoutHorizontal(layout)) {\n classes.push('align-items-center');\n } else {\n classes.push('align-items-start');\n }\n }\n\n if (layout === Layout.HORIZONTAL_RIGHT_ALIGNED) {\n classes.push('text-sm-right tw-definition-list--right-aligned-desktop');\n } else {\n classes.push('justify-content-between');\n }\n\n if (layout === Layout.HORIZONTAL_JUSTIFIED) {\n classes.push('text-sm-justify');\n }\n\n return classes;\n};\n\nconst defaultDefinitions = [] satisfies DefinitionListProps['definitions'];\n\nexport default function DefinitionList({\n definitions = defaultDefinitions,\n layout = 'VERTICAL_TWO_COLUMN',\n muted,\n}: DefinitionListProps) {\n return (\n <dl\n className={clsx('tw-definition-list d-flex ', {\n 'text-muted': muted,\n 'flex-column': layout === Layout.VERTICAL_ONE_COLUMN,\n 'tw-definition-list--columns flex-column flex-row--sm':\n layout === Layout.VERTICAL_TWO_COLUMN,\n 'tw-definition-list--horizontal flex-column': isLayoutHorizontal(layout),\n })}\n >\n {definitions\n .filter((definition) => definition)\n .map(({ action, title, value, key }) => (\n <div key={key} className=\"tw-definition-list__item\">\n <dt>{title}</dt>\n <dd className={clsx(...getAlignmentClasses(layout, action))}>\n <div>{value}</div>\n {action ? (\n <div\n className={clsx(\n isLayoutHorizontal(layout) ? 'p-l-2' : 'p-x-2',\n 'tw-definition-list__action',\n )}\n >\n <Button as=\"button\" size=\"sm\" v2 onClick={action.onClick}>\n {action.label}\n </Button>\n </div>\n ) : null}\n </dd>\n </div>\n ))}\n </dl>\n );\n}\n"],"names":["isLayoutHorizontal","layout","Layout","HORIZONTAL_LEFT_ALIGNED","HORIZONTAL_RIGHT_ALIGNED","HORIZONTAL_JUSTIFIED","getAlignmentClasses","action","classes","push","defaultDefinitions","DefinitionList","definitions","muted","_jsx","className","clsx","VERTICAL_ONE_COLUMN","VERTICAL_TWO_COLUMN","children","filter","definition","map","title","value","key","_jsxs","Button","as","size","v2","onClick","label"],"mappings":";;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ues/variant.js');
|
|
|
27
27
|
require('../common/propsValues/scroll.js');
|
|
28
28
|
require('../common/propsValues/markdownNodeType.js');
|
|
29
29
|
require('../common/fileType.js');
|
|
30
|
+
require('@transferwise/formatting');
|
|
30
31
|
require('@transferwise/icons');
|
|
31
32
|
require('react-intl');
|
|
32
33
|
require('../common/closeButton/CloseButton.messages.js');
|