@transferwise/components 46.130.0 → 46.130.2
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/Accordion.js.map +1 -1
- package/build/accordion/Accordion.mjs.map +1 -1
- package/build/actionButton/ActionButton.js.map +1 -1
- package/build/actionButton/ActionButton.mjs.map +1 -1
- package/build/actionOption/ActionOption.js.map +1 -1
- package/build/actionOption/ActionOption.mjs.map +1 -1
- package/build/alert/Alert.js +5 -2
- package/build/alert/Alert.js.map +1 -1
- package/build/alert/Alert.mjs +5 -2
- package/build/alert/Alert.mjs.map +1 -1
- package/build/avatar/Avatar.js.map +1 -1
- package/build/avatar/Avatar.mjs.map +1 -1
- package/build/avatarLayout/AvatarLayout.js.map +1 -1
- package/build/avatarLayout/AvatarLayout.mjs.map +1 -1
- package/build/badge/Badge.js.map +1 -1
- package/build/badge/Badge.mjs.map +1 -1
- package/build/body/Body.js.map +1 -1
- package/build/body/Body.mjs.map +1 -1
- package/build/button/LegacyButton.js.map +1 -1
- package/build/button/LegacyButton.mjs.map +1 -1
- package/build/card/Card.js.map +1 -1
- package/build/card/Card.mjs.map +1 -1
- package/build/checkboxButton/CheckboxButton.js.map +1 -1
- package/build/checkboxButton/CheckboxButton.mjs.map +1 -1
- package/build/checkboxOption/CheckboxOption.js.map +1 -1
- package/build/checkboxOption/CheckboxOption.mjs.map +1 -1
- package/build/circularButton/CircularButton.js.map +1 -1
- package/build/circularButton/CircularButton.mjs.map +1 -1
- package/build/common/propsValues/type.js +1 -1
- package/build/common/propsValues/type.js.map +1 -1
- package/build/common/propsValues/type.mjs +1 -1
- package/build/common/propsValues/type.mjs.map +1 -1
- package/build/common/propsValues/typography.js +1 -1
- package/build/common/propsValues/typography.js.map +1 -1
- package/build/common/propsValues/typography.mjs +1 -1
- package/build/common/propsValues/typography.mjs.map +1 -1
- package/build/criticalBanner/CriticalCommsBanner.js +6 -4
- package/build/criticalBanner/CriticalCommsBanner.js.map +1 -1
- package/build/criticalBanner/CriticalCommsBanner.mjs +6 -4
- package/build/criticalBanner/CriticalCommsBanner.mjs.map +1 -1
- package/build/dateInput/DateInput.js.map +1 -1
- package/build/dateInput/DateInput.mjs.map +1 -1
- package/build/dimmer/Dimmer.js.map +1 -1
- package/build/dimmer/Dimmer.mjs.map +1 -1
- package/build/drawer/Drawer.js.map +1 -1
- package/build/drawer/Drawer.mjs.map +1 -1
- package/build/field/Field.js.map +1 -1
- package/build/field/Field.mjs.map +1 -1
- package/build/flowNavigation/FlowNavigation.js.map +1 -1
- package/build/flowNavigation/FlowNavigation.mjs.map +1 -1
- package/build/header/Header.js.map +1 -1
- package/build/header/Header.mjs.map +1 -1
- package/build/iconButton/IconButton.js.map +1 -1
- package/build/iconButton/IconButton.mjs.map +1 -1
- package/build/legacylistItem/LegacyListItem.js.map +1 -1
- package/build/legacylistItem/LegacyListItem.mjs.map +1 -1
- package/build/list/List.js.map +1 -1
- package/build/list/List.mjs.map +1 -1
- package/build/listItem/Button/ListItemButton.js.map +1 -1
- package/build/listItem/Button/ListItemButton.mjs.map +1 -1
- package/build/listItem/IconButton/ListItemIconButton.js.map +1 -1
- package/build/listItem/IconButton/ListItemIconButton.mjs.map +1 -1
- package/build/listItem/Image/ListItemImage.js.map +1 -1
- package/build/listItem/Image/ListItemImage.mjs.map +1 -1
- package/build/listItem/ListItem.js.map +1 -1
- package/build/listItem/ListItem.mjs.map +1 -1
- package/build/loader/Loader.js.map +1 -1
- package/build/loader/Loader.mjs.map +1 -1
- package/build/logo/Logo.js.map +1 -1
- package/build/logo/Logo.mjs.map +1 -1
- package/build/main.css +45 -36
- package/build/modal/Modal.js.map +1 -1
- package/build/modal/Modal.mjs.map +1 -1
- package/build/navigationOption/NavigationOption.js.map +1 -1
- package/build/navigationOption/NavigationOption.mjs.map +1 -1
- package/build/navigationOptionsList/NavigationOptionsList.js.map +1 -1
- package/build/navigationOptionsList/NavigationOptionsList.mjs.map +1 -1
- package/build/nudge/Nudge.js.map +1 -1
- package/build/nudge/Nudge.mjs.map +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.js.map +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.mjs.map +1 -1
- package/build/popover/Popover.js.map +1 -1
- package/build/popover/Popover.mjs.map +1 -1
- package/build/processIndicator/ProcessIndicator.js.map +1 -1
- package/build/processIndicator/ProcessIndicator.mjs.map +1 -1
- package/build/prompt/ActionPrompt/ActionPrompt.js.map +1 -1
- package/build/prompt/ActionPrompt/ActionPrompt.mjs.map +1 -1
- package/build/prompt/InlinePrompt/InlinePrompt.js.map +1 -1
- package/build/prompt/InlinePrompt/InlinePrompt.mjs.map +1 -1
- package/build/radioOption/RadioOption.js.map +1 -1
- package/build/radioOption/RadioOption.mjs.map +1 -1
- package/build/select/Select.js.map +1 -1
- package/build/select/Select.mjs.map +1 -1
- package/build/statusIcon/StatusIcon.js.map +1 -1
- package/build/statusIcon/StatusIcon.mjs.map +1 -1
- package/build/styles/criticalBanner/CriticalCommsBanner.css +9 -0
- package/build/styles/main.css +45 -36
- package/build/styles/sentimentSurface/SentimentSurface.css +36 -36
- package/build/summary/Summary.js +1 -1
- package/build/summary/Summary.js.map +1 -1
- package/build/summary/Summary.mjs +1 -1
- package/build/summary/Summary.mjs.map +1 -1
- package/build/switchOption/SwitchOption.js +1 -1
- package/build/switchOption/SwitchOption.js.map +1 -1
- package/build/switchOption/SwitchOption.mjs +1 -1
- package/build/switchOption/SwitchOption.mjs.map +1 -1
- package/build/tabs/Tabs.js.map +1 -1
- package/build/tabs/Tabs.mjs.map +1 -1
- package/build/typeahead/Typeahead.js.map +1 -1
- package/build/typeahead/Typeahead.mjs.map +1 -1
- package/build/types/accordion/Accordion.d.ts +8 -2
- package/build/types/accordion/Accordion.d.ts.map +1 -1
- package/build/types/actionButton/ActionButton.d.ts +6 -4
- package/build/types/actionButton/ActionButton.d.ts.map +1 -1
- package/build/types/actionOption/ActionOption.d.ts +1 -1
- package/build/types/alert/Alert.d.ts +7 -2
- package/build/types/alert/Alert.d.ts.map +1 -1
- package/build/types/avatar/Avatar.d.ts +4 -0
- package/build/types/avatar/Avatar.d.ts.map +1 -1
- package/build/types/avatarLayout/AvatarLayout.d.ts +5 -1
- package/build/types/avatarLayout/AvatarLayout.d.ts.map +1 -1
- package/build/types/badge/Badge.d.ts +2 -0
- package/build/types/badge/Badge.d.ts.map +1 -1
- package/build/types/body/Body.d.ts +2 -6
- package/build/types/body/Body.d.ts.map +1 -1
- package/build/types/button/Button.types.d.ts +4 -1
- package/build/types/button/Button.types.d.ts.map +1 -1
- package/build/types/button/LegacyButton.d.ts +4 -4
- package/build/types/card/Card.d.ts +1 -0
- package/build/types/card/Card.d.ts.map +1 -1
- package/build/types/checkboxButton/CheckboxButton.d.ts +2 -0
- package/build/types/checkboxButton/CheckboxButton.d.ts.map +1 -1
- package/build/types/checkboxOption/CheckboxOption.d.ts +1 -1
- package/build/types/circularButton/CircularButton.d.ts +1 -1
- package/build/types/circularButton/CircularButton.d.ts.map +1 -1
- package/build/types/common/propsValues/type.d.ts +1 -1
- package/build/types/common/propsValues/typography.d.ts +2 -2
- package/build/types/criticalBanner/CriticalCommsBanner.d.ts +1 -0
- package/build/types/criticalBanner/CriticalCommsBanner.d.ts.map +1 -1
- package/build/types/dateInput/DateInput.d.ts +5 -0
- package/build/types/dateInput/DateInput.d.ts.map +1 -1
- package/build/types/dimmer/Dimmer.d.ts +6 -0
- package/build/types/dimmer/Dimmer.d.ts.map +1 -1
- package/build/types/drawer/Drawer.d.ts +8 -2
- package/build/types/drawer/Drawer.d.ts.map +1 -1
- package/build/types/field/Field.d.ts +5 -2
- package/build/types/field/Field.d.ts.map +1 -1
- package/build/types/flowNavigation/FlowNavigation.d.ts +3 -0
- package/build/types/flowNavigation/FlowNavigation.d.ts.map +1 -1
- package/build/types/header/Header.d.ts +5 -1
- package/build/types/header/Header.d.ts.map +1 -1
- package/build/types/iconButton/IconButton.d.ts +6 -0
- package/build/types/iconButton/IconButton.d.ts.map +1 -1
- package/build/types/legacylistItem/LegacyListItem.d.ts +1 -1
- package/build/types/list/List.d.ts +1 -0
- package/build/types/list/List.d.ts.map +1 -1
- package/build/types/listItem/Button/ListItemButton.d.ts +4 -0
- package/build/types/listItem/Button/ListItemButton.d.ts.map +1 -1
- package/build/types/listItem/IconButton/ListItemIconButton.d.ts +3 -1
- package/build/types/listItem/IconButton/ListItemIconButton.d.ts.map +1 -1
- package/build/types/listItem/Image/ListItemImage.d.ts +2 -0
- package/build/types/listItem/Image/ListItemImage.d.ts.map +1 -1
- package/build/types/listItem/ListItem.d.ts +3 -0
- package/build/types/listItem/ListItem.d.ts.map +1 -1
- package/build/types/loader/Loader.d.ts +5 -1
- package/build/types/loader/Loader.d.ts.map +1 -1
- package/build/types/logo/Logo.d.ts +4 -1
- package/build/types/logo/Logo.d.ts.map +1 -1
- package/build/types/modal/Modal.d.ts +6 -0
- package/build/types/modal/Modal.d.ts.map +1 -1
- package/build/types/navigationOption/NavigationOption.d.ts +1 -1
- package/build/types/navigationOptionsList/NavigationOptionsList.d.ts +1 -1
- package/build/types/nudge/Nudge.d.ts +1 -1
- package/build/types/nudge/Nudge.d.ts.map +1 -1
- package/build/types/phoneNumberInput/PhoneNumberInput.d.ts +7 -1
- package/build/types/phoneNumberInput/PhoneNumberInput.d.ts.map +1 -1
- package/build/types/popover/Popover.d.ts +1 -0
- package/build/types/popover/Popover.d.ts.map +1 -1
- package/build/types/processIndicator/ProcessIndicator.d.ts +2 -0
- package/build/types/processIndicator/ProcessIndicator.d.ts.map +1 -1
- package/build/types/prompt/ActionPrompt/ActionPrompt.d.ts +8 -1
- package/build/types/prompt/ActionPrompt/ActionPrompt.d.ts.map +1 -1
- package/build/types/prompt/InlinePrompt/InlinePrompt.d.ts +1 -0
- package/build/types/prompt/InlinePrompt/InlinePrompt.d.ts.map +1 -1
- package/build/types/radioOption/RadioOption.d.ts +1 -1
- package/build/types/select/Select.d.ts +4 -0
- package/build/types/select/Select.d.ts.map +1 -1
- package/build/types/statusIcon/StatusIcon.d.ts +3 -1
- package/build/types/statusIcon/StatusIcon.d.ts.map +1 -1
- package/build/types/summary/Summary.d.ts +7 -4
- package/build/types/summary/Summary.d.ts.map +1 -1
- package/build/types/switchOption/SwitchOption.d.ts +1 -1
- package/build/types/tabs/Tabs.d.ts +2 -0
- package/build/types/tabs/Tabs.d.ts.map +1 -1
- package/build/types/typeahead/Typeahead.d.ts +14 -1
- package/build/types/typeahead/Typeahead.d.ts.map +1 -1
- package/build/types/upload/Upload.d.ts +6 -0
- package/build/types/upload/Upload.d.ts.map +1 -1
- package/build/types/uploadInput/UploadInput.d.ts +10 -1
- package/build/types/uploadInput/UploadInput.d.ts.map +1 -1
- package/build/types/withDisplayFormat/WithDisplayFormat.d.ts +3 -0
- package/build/types/withDisplayFormat/WithDisplayFormat.d.ts.map +1 -1
- package/build/upload/Upload.js.map +1 -1
- package/build/upload/Upload.mjs.map +1 -1
- package/build/uploadInput/UploadInput.js.map +1 -1
- package/build/uploadInput/UploadInput.mjs.map +1 -1
- package/build/withDisplayFormat/WithDisplayFormat.js.map +1 -1
- package/build/withDisplayFormat/WithDisplayFormat.mjs.map +1 -1
- package/package.json +1 -1
- package/src/accordion/Accordion.tsx +8 -2
- package/src/actionButton/ActionButton.tsx +4 -3
- package/src/actionOption/ActionOption.tsx +1 -1
- package/src/alert/Alert.tsx +11 -3
- package/src/avatar/Avatar.tsx +4 -0
- package/src/avatarLayout/AvatarLayout.tsx +5 -1
- package/src/badge/Badge.tsx +2 -0
- package/src/body/Body.tsx +2 -6
- package/src/button/Button.types.ts +4 -1
- package/src/button/LegacyButton.tsx +4 -4
- package/src/card/Card.tsx +1 -0
- package/src/checkboxButton/CheckboxButton.tsx +1 -0
- package/src/checkboxOption/CheckboxOption.tsx +1 -1
- package/src/circularButton/CircularButton.tsx +1 -2
- package/src/common/propsValues/type.ts +1 -1
- package/src/common/propsValues/typography.ts +2 -2
- package/src/criticalBanner/CriticalCommsBanner.css +9 -0
- package/src/criticalBanner/CriticalCommsBanner.less +13 -0
- package/src/criticalBanner/CriticalCommsBanner.test.story.tsx +15 -0
- package/src/criticalBanner/CriticalCommsBanner.test.tsx +28 -2
- package/src/criticalBanner/CriticalCommsBanner.tsx +10 -1
- package/src/dateInput/DateInput.tsx +5 -0
- package/src/dimmer/Dimmer.tsx +6 -0
- package/src/drawer/Drawer.tsx +8 -2
- package/src/field/Field.tsx +5 -2
- package/src/flowNavigation/FlowNavigation.tsx +3 -0
- package/src/header/Header.tsx +5 -1
- package/src/iconButton/IconButton.tsx +3 -0
- package/src/legacylistItem/LegacyListItem.tsx +1 -1
- package/src/list/List.tsx +1 -0
- package/src/listItem/Button/ListItemButton.tsx +2 -0
- package/src/listItem/IconButton/ListItemIconButton.tsx +3 -1
- package/src/listItem/Image/ListItemImage.tsx +2 -0
- package/src/listItem/ListItem.tsx +2 -0
- package/src/loader/Loader.tsx +6 -2
- package/src/logo/Logo.tsx +4 -1
- package/src/main.css +45 -36
- package/src/modal/Modal.tsx +6 -0
- package/src/navigationOption/NavigationOption.tsx +1 -1
- package/src/navigationOptionsList/NavigationOptionsList.tsx +1 -1
- package/src/nudge/Nudge.tsx +1 -1
- package/src/phoneNumberInput/PhoneNumberInput.tsx +7 -1
- package/src/popover/Popover.tsx +1 -0
- package/src/processIndicator/ProcessIndicator.tsx +2 -0
- package/src/prompt/ActionPrompt/ActionPrompt.tsx +8 -1
- package/src/prompt/InlinePrompt/InlinePrompt.tsx +1 -0
- package/src/radioOption/RadioOption.tsx +1 -1
- package/src/select/Select.tsx +4 -0
- package/src/sentimentSurface/SentimentSurface.css +36 -36
- package/src/sentimentSurface/SentimentSurface.less +12 -12
- package/src/statusIcon/StatusIcon.tsx +3 -1
- package/src/summary/Summary.tsx +7 -4
- package/src/switchOption/SwitchOption.tsx +1 -1
- package/src/tabs/Tabs.tsx +2 -0
- package/src/typeahead/Typeahead.tsx +14 -2
- package/src/upload/Upload.tsx +6 -0
- package/src/uploadInput/UploadInput.tsx +12 -4
- package/src/withDisplayFormat/WithDisplayFormat.tsx +3 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegacyButton.js","sources":["../../src/button/LegacyButton.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { ElementType, forwardRef, MouseEvent } from 'react';\nimport { useIntl } from 'react-intl';\n\nimport {\n Size,\n ControlType,\n Priority,\n ControlTypeAccent,\n ControlTypeNegative,\n ControlTypePositive,\n PriorityPrimary,\n PrioritySecondary,\n PriorityTertiary,\n SizeExtraSmall,\n SizeSmall,\n SizeMedium,\n SizeLarge,\n} from '../common';\nimport ProcessIndicator from '../processIndicator';\n\nimport messages from '../i18n/commonMessages/Button.messages';\nimport { typeClassMap, priorityClassMap } from './classMap';\nimport { establishNewPriority, establishNewType, logDeprecationNotices } from './legacyUtils';\nimport { ButtonReferenceType } from './Button.types';\n\n/** @deprecated */\ntype DeprecatedTypes = 'primary' | 'pay' | 'secondary' | 'danger' | 'link';\n\n/** @deprecated */\ntype DeprecatedSizes = SizeExtraSmall;\n\n/**\n * @deprecated
|
|
1
|
+
{"version":3,"file":"LegacyButton.js","sources":["../../src/button/LegacyButton.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { ElementType, forwardRef, MouseEvent } from 'react';\nimport { useIntl } from 'react-intl';\n\nimport {\n Size,\n ControlType,\n Priority,\n ControlTypeAccent,\n ControlTypeNegative,\n ControlTypePositive,\n PriorityPrimary,\n PrioritySecondary,\n PriorityTertiary,\n SizeExtraSmall,\n SizeSmall,\n SizeMedium,\n SizeLarge,\n} from '../common';\nimport ProcessIndicator from '../processIndicator';\n\nimport messages from '../i18n/commonMessages/Button.messages';\nimport { typeClassMap, priorityClassMap } from './classMap';\nimport { establishNewPriority, establishNewType, logDeprecationNotices } from './legacyUtils';\nimport { ButtonReferenceType } from './Button.types';\n\n/** @deprecated */\ntype DeprecatedTypes = 'primary' | 'pay' | 'secondary' | 'danger' | 'link';\n\n/** @deprecated */\ntype DeprecatedSizes = SizeExtraSmall;\n\n/**\n * @deprecated Use new button instead of these APIs.\n * @example\n * ```\n * import { Button, ButtonProps } from '@transferwise/components';\n *\n * <Button v2>...</Button>\n * ```\n */\nexport type CommonProps = {\n v2?: false;\n\n /** Makes the button take up the full width of its container */\n block?: boolean;\n\n /**\n * The `target` attribute for HTML anchor.\n * If set to `_blank`, `rel=\"noopener noreferrer\"` is automatically added to the rendered node.\n */\n target?: string;\n /**\n * Toggles the disabled state\n * @default false\n */\n\n disabled?: boolean;\n /**\n * Toggles the loading state\n * @default false\n */\n loading?: boolean;\n type?: ControlTypeAccent | ControlTypeNegative | ControlTypePositive | DeprecatedTypes | null;\n priority?: PriorityPrimary | PrioritySecondary | PriorityTertiary | null;\n size?: SizeSmall | SizeMedium | SizeLarge | DeprecatedSizes;\n htmlType?: 'submit' | 'reset' | 'button';\n};\n\n/**\n * @deprecated Use new button instead of APIs.\n * @example\n * ```\n * import { Button, ButtonProps } from '@transferwise/components';\n *\n * <Button v2>...</Button>\n * ```\n */\nexport type ButtonProps = CommonProps &\n Omit<React.ComponentPropsWithRef<'button'>, 'type'> & {\n as?: 'button';\n };\n\ntype AnchorProps = CommonProps &\n Omit<React.ComponentPropsWithRef<'a'>, 'type'> & {\n as?: 'a';\n };\n\n/**\n * @deprecated Use new button instead of APIs.\n * @example\n * ```\n * import { Button, ButtonProps } from '@transferwise/components';\n *\n * <Button v2>...</Button>\n * ```\n */\nexport type LegacyButtonProps = ButtonProps | AnchorProps;\n\n/**\n * @deprecated Use new Button component via `<Button v2 .. />` and new props.\n */\nconst LegacyButton = forwardRef<ButtonReferenceType, LegacyButtonProps>(\n (\n {\n as: component = 'button',\n block = false,\n children,\n className,\n disabled,\n loading = false,\n priority = Priority.PRIMARY,\n size = Size.MEDIUM,\n type = ControlType.ACCENT,\n onClick,\n ...rest\n }: LegacyButtonProps,\n ref,\n ) => {\n const intl = useIntl();\n\n logDeprecationNotices({ size, type });\n\n const newType = establishNewType(type);\n const newPriority = establishNewPriority(priority, type);\n\n const classes = clsx(\n `btn btn-${size}`,\n `np-btn np-btn-${size}`,\n {\n 'btn-loading': loading,\n 'btn-block np-btn-block': block,\n disabled,\n },\n // @ts-expect-error fix when refactor `typeClassMap` to TypeScript\n typeClassMap[newType],\n // @ts-expect-error fix when refactor `typeClassMap` to TypeScript\n priorityClassMap[newPriority],\n className,\n );\n\n function processIndicatorSize() {\n return ['sm', 'xs'].includes(size) ? 'xxs' : 'xs';\n }\n\n const Element = (component as ElementType) ?? 'button';\n let props;\n\n if (Element === 'button') {\n const { htmlType = 'button', ...restProps } = rest as ButtonProps;\n props = {\n ...restProps,\n disabled,\n 'aria-disabled': loading,\n type: htmlType,\n };\n } else {\n props = {\n ...rest,\n 'aria-disabled': loading,\n } as AnchorProps;\n }\n\n /**\n * Ensures that the button cannot be activated in loading or disabled mode,\n * when `aria-disabled` might be used over the `disabled` HTML attribute\n */\n const handleClick =\n (handler: LegacyButtonProps['onClick']) =>\n (event: MouseEvent<HTMLButtonElement> & MouseEvent<HTMLAnchorElement>) => {\n if (disabled || loading) {\n event.preventDefault();\n } else if (typeof handler === 'function') {\n handler(event);\n }\n };\n\n return (\n <Element\n ref={ref as React.Ref<ButtonReferenceType>}\n className={classes}\n onClick={handleClick(onClick)}\n {...props}\n aria-live={loading ? 'polite' : 'off'}\n aria-busy={loading}\n aria-label={loading ? intl.formatMessage(messages.loadingAriaLabel) : rest['aria-label']}\n >\n {children}\n {loading && (\n <ProcessIndicator\n size={processIndicatorSize()}\n className=\"btn-loader\"\n data-testid=\"ButtonProgressIndicator\"\n />\n )}\n </Element>\n );\n },\n);\n\nexport default LegacyButton;\n"],"names":["LegacyButton","forwardRef","as","component","block","children","className","disabled","loading","priority","Priority","PRIMARY","size","Size","MEDIUM","type","ControlType","ACCENT","onClick","rest","ref","intl","useIntl","logDeprecationNotices","newType","establishNewType","newPriority","establishNewPriority","classes","clsx","typeClassMap","priorityClassMap","processIndicatorSize","includes","Element","props","htmlType","restProps","handleClick","handler","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aAAA,EAAY;AAAyB,KAAA,CAExC;AAAA,GACM,CAAC;AAEd,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegacyButton.mjs","sources":["../../src/button/LegacyButton.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { ElementType, forwardRef, MouseEvent } from 'react';\nimport { useIntl } from 'react-intl';\n\nimport {\n Size,\n ControlType,\n Priority,\n ControlTypeAccent,\n ControlTypeNegative,\n ControlTypePositive,\n PriorityPrimary,\n PrioritySecondary,\n PriorityTertiary,\n SizeExtraSmall,\n SizeSmall,\n SizeMedium,\n SizeLarge,\n} from '../common';\nimport ProcessIndicator from '../processIndicator';\n\nimport messages from '../i18n/commonMessages/Button.messages';\nimport { typeClassMap, priorityClassMap } from './classMap';\nimport { establishNewPriority, establishNewType, logDeprecationNotices } from './legacyUtils';\nimport { ButtonReferenceType } from './Button.types';\n\n/** @deprecated */\ntype DeprecatedTypes = 'primary' | 'pay' | 'secondary' | 'danger' | 'link';\n\n/** @deprecated */\ntype DeprecatedSizes = SizeExtraSmall;\n\n/**\n * @deprecated
|
|
1
|
+
{"version":3,"file":"LegacyButton.mjs","sources":["../../src/button/LegacyButton.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { ElementType, forwardRef, MouseEvent } from 'react';\nimport { useIntl } from 'react-intl';\n\nimport {\n Size,\n ControlType,\n Priority,\n ControlTypeAccent,\n ControlTypeNegative,\n ControlTypePositive,\n PriorityPrimary,\n PrioritySecondary,\n PriorityTertiary,\n SizeExtraSmall,\n SizeSmall,\n SizeMedium,\n SizeLarge,\n} from '../common';\nimport ProcessIndicator from '../processIndicator';\n\nimport messages from '../i18n/commonMessages/Button.messages';\nimport { typeClassMap, priorityClassMap } from './classMap';\nimport { establishNewPriority, establishNewType, logDeprecationNotices } from './legacyUtils';\nimport { ButtonReferenceType } from './Button.types';\n\n/** @deprecated */\ntype DeprecatedTypes = 'primary' | 'pay' | 'secondary' | 'danger' | 'link';\n\n/** @deprecated */\ntype DeprecatedSizes = SizeExtraSmall;\n\n/**\n * @deprecated Use new button instead of these APIs.\n * @example\n * ```\n * import { Button, ButtonProps } from '@transferwise/components';\n *\n * <Button v2>...</Button>\n * ```\n */\nexport type CommonProps = {\n v2?: false;\n\n /** Makes the button take up the full width of its container */\n block?: boolean;\n\n /**\n * The `target` attribute for HTML anchor.\n * If set to `_blank`, `rel=\"noopener noreferrer\"` is automatically added to the rendered node.\n */\n target?: string;\n /**\n * Toggles the disabled state\n * @default false\n */\n\n disabled?: boolean;\n /**\n * Toggles the loading state\n * @default false\n */\n loading?: boolean;\n type?: ControlTypeAccent | ControlTypeNegative | ControlTypePositive | DeprecatedTypes | null;\n priority?: PriorityPrimary | PrioritySecondary | PriorityTertiary | null;\n size?: SizeSmall | SizeMedium | SizeLarge | DeprecatedSizes;\n htmlType?: 'submit' | 'reset' | 'button';\n};\n\n/**\n * @deprecated Use new button instead of APIs.\n * @example\n * ```\n * import { Button, ButtonProps } from '@transferwise/components';\n *\n * <Button v2>...</Button>\n * ```\n */\nexport type ButtonProps = CommonProps &\n Omit<React.ComponentPropsWithRef<'button'>, 'type'> & {\n as?: 'button';\n };\n\ntype AnchorProps = CommonProps &\n Omit<React.ComponentPropsWithRef<'a'>, 'type'> & {\n as?: 'a';\n };\n\n/**\n * @deprecated Use new button instead of APIs.\n * @example\n * ```\n * import { Button, ButtonProps } from '@transferwise/components';\n *\n * <Button v2>...</Button>\n * ```\n */\nexport type LegacyButtonProps = ButtonProps | AnchorProps;\n\n/**\n * @deprecated Use new Button component via `<Button v2 .. />` and new props.\n */\nconst LegacyButton = forwardRef<ButtonReferenceType, LegacyButtonProps>(\n (\n {\n as: component = 'button',\n block = false,\n children,\n className,\n disabled,\n loading = false,\n priority = Priority.PRIMARY,\n size = Size.MEDIUM,\n type = ControlType.ACCENT,\n onClick,\n ...rest\n }: LegacyButtonProps,\n ref,\n ) => {\n const intl = useIntl();\n\n logDeprecationNotices({ size, type });\n\n const newType = establishNewType(type);\n const newPriority = establishNewPriority(priority, type);\n\n const classes = clsx(\n `btn btn-${size}`,\n `np-btn np-btn-${size}`,\n {\n 'btn-loading': loading,\n 'btn-block np-btn-block': block,\n disabled,\n },\n // @ts-expect-error fix when refactor `typeClassMap` to TypeScript\n typeClassMap[newType],\n // @ts-expect-error fix when refactor `typeClassMap` to TypeScript\n priorityClassMap[newPriority],\n className,\n );\n\n function processIndicatorSize() {\n return ['sm', 'xs'].includes(size) ? 'xxs' : 'xs';\n }\n\n const Element = (component as ElementType) ?? 'button';\n let props;\n\n if (Element === 'button') {\n const { htmlType = 'button', ...restProps } = rest as ButtonProps;\n props = {\n ...restProps,\n disabled,\n 'aria-disabled': loading,\n type: htmlType,\n };\n } else {\n props = {\n ...rest,\n 'aria-disabled': loading,\n } as AnchorProps;\n }\n\n /**\n * Ensures that the button cannot be activated in loading or disabled mode,\n * when `aria-disabled` might be used over the `disabled` HTML attribute\n */\n const handleClick =\n (handler: LegacyButtonProps['onClick']) =>\n (event: MouseEvent<HTMLButtonElement> & MouseEvent<HTMLAnchorElement>) => {\n if (disabled || loading) {\n event.preventDefault();\n } else if (typeof handler === 'function') {\n handler(event);\n }\n };\n\n return (\n <Element\n ref={ref as React.Ref<ButtonReferenceType>}\n className={classes}\n onClick={handleClick(onClick)}\n {...props}\n aria-live={loading ? 'polite' : 'off'}\n aria-busy={loading}\n aria-label={loading ? intl.formatMessage(messages.loadingAriaLabel) : rest['aria-label']}\n >\n {children}\n {loading && (\n <ProcessIndicator\n size={processIndicatorSize()}\n className=\"btn-loader\"\n data-testid=\"ButtonProgressIndicator\"\n />\n )}\n </Element>\n );\n },\n);\n\nexport default LegacyButton;\n"],"names":["LegacyButton","forwardRef","as","component","block","children","className","disabled","loading","priority","Priority","PRIMARY","size","Size","MEDIUM","type","ControlType","ACCENT","onClick","rest","ref","intl","useIntl","logDeprecationNotices","newType","establishNewType","newPriority","establishNewPriority","classes","clsx","typeClassMap","priorityClassMap","processIndicatorSize","includes","Element","props","htmlType","restProps","handleClick","handler","event","preventDefault","_jsxs","formatMessage","messages","loadingAriaLabel","_jsx","ProcessIndicator"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsGA,MAAMA,YAAY,gBAAGC,UAAU,CAC7B,CACE;EACEC,EAAE,EAAEC,SAAS,GAAG,QAAQ;AACxBC,EAAAA,KAAK,GAAG,KAAK;EACbC,QAAQ;EACRC,SAAS;EACTC,QAAQ;AACRC,EAAAA,OAAO,GAAG,KAAK;EACfC,QAAQ,GAAGC,QAAQ,CAACC,OAAO;EAC3BC,IAAI,GAAGC,IAAI,CAACC,MAAM;EAClBC,IAAI,GAAGC,WAAW,CAACC,MAAM;EACzBC,OAAO;EACP,GAAGC;AAAI,CACW,EACpBC,GAAG,KACD;AACF,EAAA,MAAMC,IAAI,GAAGC,OAAO,EAAE;AAEtBC,EAAAA,qBAAqB,CAAC;IAAEX,IAAI;AAAEG,IAAAA;AAAI,GAAE,CAAC;AAErC,EAAA,MAAMS,OAAO,GAAGC,gBAAgB,CAACV,IAAI,CAAC;AACtC,EAAA,MAAMW,WAAW,GAAGC,oBAAoB,CAAClB,QAAQ,EAAEM,IAAI,CAAC;EAExD,MAAMa,OAAO,GAAGC,IAAI,CAClB,CAAA,QAAA,EAAWjB,IAAI,CAAA,CAAE,EACjB,CAAA,cAAA,EAAiBA,IAAI,CAAA,CAAE,EACvB;AACE,IAAA,aAAa,EAAEJ,OAAO;AACtB,IAAA,wBAAwB,EAAEJ,KAAK;AAC/BG,IAAAA;GACD;AACD;EACAuB,YAAY,CAACN,OAAO,CAAC;AACrB;AACAO,EAAAA,gBAAgB,CAACL,WAAW,CAAC,EAC7BpB,SAAS,CACV;EAED,SAAS0B,oBAAoBA,GAAA;AAC3B,IAAA,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAACC,QAAQ,CAACrB,IAAI,CAAC,GAAG,KAAK,GAAG,IAAI;AACnD,EAAA;AAEA,EAAA,MAAMsB,OAAO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,EAAC,YAAY;MACtB,aAAA,EAAY;AAAyB,KAAA,CAExC;AAAA,GACM,CAAC;AAEd,CAAC;;;;"}
|
package/build/card/Card.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.js","sources":["../../src/card/Card.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { forwardRef, useId } from 'react';\n\nimport Body from '../body';\nimport Chevron from '../chevron';\nimport { Position, Typography } from '../common';\nimport Option from '../common/Option';\n\nexport interface CardProps {\n 'aria-label'?: string;\n as?: React.ElementType;\n isExpanded?: boolean;\n title: React.ReactNode;\n details: React.ReactNode;\n icon?: React.ReactNode;\n children?: React.ReactNode;\n id?: string;\n className?: string;\n 'data-testid'?: string;\n onClick?: (nextIsExpanded: boolean) => void;\n}\n\n/**\n * @deprecated Use [new ListItem component](?path=/docs/content-listitem--docs) instead.\n * @see https://transferwise.atlassian.net/wiki/spaces/DS/pages/2387314550/Instructions+for+killing+expanding+cards+on+web+design+pattern\n */\nconst Card = forwardRef(function Card(\n {\n 'aria-label': ariaLabel,\n as: Element = 'div',\n isExpanded,\n title,\n details,\n children,\n onClick,\n icon,\n id,\n className,\n 'data-testid': dataTestId,\n }: CardProps,\n reference,\n) {\n const labelId = useId();\n const contentId = useId();\n const isExpandable = Boolean(children);\n\n return (\n <Element\n ref={reference}\n className={clsx('np-card', className, {\n 'np-card--expanded': isExpandable && isExpanded,\n 'np-card--inactive': !children,\n 'np-card--has-icon': !!icon,\n })}\n id={id}\n data-testid={dataTestId}\n >\n <Option\n aria-expanded={isExpandable ? isExpanded : undefined}\n aria-controls={isExpanded ? contentId : undefined}\n id={labelId}\n aria-label={ariaLabel}\n as={isExpandable ? 'button' : 'div'}\n className=\"np-card__button\"\n media={icon}\n title={title}\n content={details}\n showMediaAtAllSizes\n button={\n isExpandable ? (\n <Chevron orientation={isExpanded ? Position.TOP : Position.BOTTOM} />\n ) : null\n }\n onClick={isExpandable ? () => onClick?.(!isExpanded) : undefined}\n />\n\n {isExpandable && (\n <div\n className={clsx('np-card__divider', {\n 'np-card__divider--expanded': isExpanded,\n })}\n />\n )}\n\n {isExpandable && isExpanded && (\n <Body\n as=\"div\"\n type={Typography.BODY_LARGE}\n className={clsx('np-card__content', isExpanded ? 'd-block' : 'hide')}\n id={contentId}\n aria-labelledby={labelId}\n >\n {children}\n </Body>\n )}\n </Element>\n );\n});\n\nexport default Card;\n"],"names":["Card","forwardRef","ariaLabel","as","Element","isExpanded","title","details","children","onClick","icon","id","className","dataTestId","reference","labelId","useId","contentId","isExpandable","Boolean","_jsxs","ref","clsx","_jsx","Option","undefined","media","content","showMediaAtAllSizes","button","Chevron","orientation","Position","TOP","BOTTOM","Body","type","Typography","BODY_LARGE"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"Card.js","sources":["../../src/card/Card.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { forwardRef, useId } from 'react';\n\nimport Body from '../body';\nimport Chevron from '../chevron';\nimport { Position, Typography } from '../common';\nimport Option from '../common/Option';\n\nexport interface CardProps {\n 'aria-label'?: string;\n /** @default 'div' */\n as?: React.ElementType;\n isExpanded?: boolean;\n title: React.ReactNode;\n details: React.ReactNode;\n icon?: React.ReactNode;\n children?: React.ReactNode;\n id?: string;\n className?: string;\n 'data-testid'?: string;\n onClick?: (nextIsExpanded: boolean) => void;\n}\n\n/**\n * @deprecated Use [new ListItem component](?path=/docs/content-listitem--docs) instead.\n * @see https://transferwise.atlassian.net/wiki/spaces/DS/pages/2387314550/Instructions+for+killing+expanding+cards+on+web+design+pattern\n */\nconst Card = forwardRef(function Card(\n {\n 'aria-label': ariaLabel,\n as: Element = 'div',\n isExpanded,\n title,\n details,\n children,\n onClick,\n icon,\n id,\n className,\n 'data-testid': dataTestId,\n }: CardProps,\n reference,\n) {\n const labelId = useId();\n const contentId = useId();\n const isExpandable = Boolean(children);\n\n return (\n <Element\n ref={reference}\n className={clsx('np-card', className, {\n 'np-card--expanded': isExpandable && isExpanded,\n 'np-card--inactive': !children,\n 'np-card--has-icon': !!icon,\n })}\n id={id}\n data-testid={dataTestId}\n >\n <Option\n aria-expanded={isExpandable ? isExpanded : undefined}\n aria-controls={isExpanded ? contentId : undefined}\n id={labelId}\n aria-label={ariaLabel}\n as={isExpandable ? 'button' : 'div'}\n className=\"np-card__button\"\n media={icon}\n title={title}\n content={details}\n showMediaAtAllSizes\n button={\n isExpandable ? (\n <Chevron orientation={isExpanded ? Position.TOP : Position.BOTTOM} />\n ) : null\n }\n onClick={isExpandable ? () => onClick?.(!isExpanded) : undefined}\n />\n\n {isExpandable && (\n <div\n className={clsx('np-card__divider', {\n 'np-card__divider--expanded': isExpanded,\n })}\n />\n )}\n\n {isExpandable && isExpanded && (\n <Body\n as=\"div\"\n type={Typography.BODY_LARGE}\n className={clsx('np-card__content', isExpanded ? 'd-block' : 'hide')}\n id={contentId}\n aria-labelledby={labelId}\n >\n {children}\n </Body>\n )}\n </Element>\n );\n});\n\nexport default Card;\n"],"names":["Card","forwardRef","ariaLabel","as","Element","isExpanded","title","details","children","onClick","icon","id","className","dataTestId","reference","labelId","useId","contentId","isExpandable","Boolean","_jsxs","ref","clsx","_jsx","Option","undefined","media","content","showMediaAtAllSizes","button","Chevron","orientation","Position","TOP","BOTTOM","Body","type","Typography","BODY_LARGE"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,MAAMA,IAAI,gBAAGC,gBAAU,CAAC,SAASD,IAAIA,CACnC;AACE,EAAA,YAAY,EAAEE,SAAS;EACvBC,EAAE,EAAEC,OAAO,GAAG,KAAK;EACnBC,UAAU;EACVC,KAAK;EACLC,OAAO;EACPC,QAAQ;EACRC,OAAO;EACPC,IAAI;EACJC,EAAE;EACFC,SAAS;AACT,EAAA,aAAa,EAAEC;AAAU,CACf,EACZC,SAAS,EAAA;AAET,EAAA,MAAMC,OAAO,GAAGC,WAAK,EAAE;AACvB,EAAA,MAAMC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AClC,QAAA,4BAA4B,EAAEjB;OAC/B;KAAE,CAEN,EAEAa,YAAY,IAAIb,UAAU,iBACzBkB,cAAA,CAACY,YAAI,EAAA;AACHhC,MAAAA,EAAE,EAAC,KAAK;MACRiC,IAAI,EAAEC,qBAAU,CAACC,UAAW;MAC5B1B,SAAS,EAAEU,SAAI,CAAC,kBAAkB,EAAEjB,UAAU,GAAG,SAAS,GAAG,MAAM,CAAE;AACrEM,MAAAA,EAAE,EAAEM,SAAU;AACd,MAAA,iBAAA,EAAiBF,OAAQ;AAAAP,MAAAA,QAAA,EAExBA;AAAQ,KACL,CACP;AAAA,GACM,CAAC;AAEd,CAAC;;;;"}
|
package/build/card/Card.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.mjs","sources":["../../src/card/Card.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { forwardRef, useId } from 'react';\n\nimport Body from '../body';\nimport Chevron from '../chevron';\nimport { Position, Typography } from '../common';\nimport Option from '../common/Option';\n\nexport interface CardProps {\n 'aria-label'?: string;\n as?: React.ElementType;\n isExpanded?: boolean;\n title: React.ReactNode;\n details: React.ReactNode;\n icon?: React.ReactNode;\n children?: React.ReactNode;\n id?: string;\n className?: string;\n 'data-testid'?: string;\n onClick?: (nextIsExpanded: boolean) => void;\n}\n\n/**\n * @deprecated Use [new ListItem component](?path=/docs/content-listitem--docs) instead.\n * @see https://transferwise.atlassian.net/wiki/spaces/DS/pages/2387314550/Instructions+for+killing+expanding+cards+on+web+design+pattern\n */\nconst Card = forwardRef(function Card(\n {\n 'aria-label': ariaLabel,\n as: Element = 'div',\n isExpanded,\n title,\n details,\n children,\n onClick,\n icon,\n id,\n className,\n 'data-testid': dataTestId,\n }: CardProps,\n reference,\n) {\n const labelId = useId();\n const contentId = useId();\n const isExpandable = Boolean(children);\n\n return (\n <Element\n ref={reference}\n className={clsx('np-card', className, {\n 'np-card--expanded': isExpandable && isExpanded,\n 'np-card--inactive': !children,\n 'np-card--has-icon': !!icon,\n })}\n id={id}\n data-testid={dataTestId}\n >\n <Option\n aria-expanded={isExpandable ? isExpanded : undefined}\n aria-controls={isExpanded ? contentId : undefined}\n id={labelId}\n aria-label={ariaLabel}\n as={isExpandable ? 'button' : 'div'}\n className=\"np-card__button\"\n media={icon}\n title={title}\n content={details}\n showMediaAtAllSizes\n button={\n isExpandable ? (\n <Chevron orientation={isExpanded ? Position.TOP : Position.BOTTOM} />\n ) : null\n }\n onClick={isExpandable ? () => onClick?.(!isExpanded) : undefined}\n />\n\n {isExpandable && (\n <div\n className={clsx('np-card__divider', {\n 'np-card__divider--expanded': isExpanded,\n })}\n />\n )}\n\n {isExpandable && isExpanded && (\n <Body\n as=\"div\"\n type={Typography.BODY_LARGE}\n className={clsx('np-card__content', isExpanded ? 'd-block' : 'hide')}\n id={contentId}\n aria-labelledby={labelId}\n >\n {children}\n </Body>\n )}\n </Element>\n );\n});\n\nexport default Card;\n"],"names":["Card","forwardRef","ariaLabel","as","Element","isExpanded","title","details","children","onClick","icon","id","className","dataTestId","reference","labelId","useId","contentId","isExpandable","Boolean","_jsxs","ref","clsx","_jsx","Option","undefined","media","content","showMediaAtAllSizes","button","Chevron","orientation","Position","TOP","BOTTOM","Body","type","Typography","BODY_LARGE"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"Card.mjs","sources":["../../src/card/Card.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { forwardRef, useId } from 'react';\n\nimport Body from '../body';\nimport Chevron from '../chevron';\nimport { Position, Typography } from '../common';\nimport Option from '../common/Option';\n\nexport interface CardProps {\n 'aria-label'?: string;\n /** @default 'div' */\n as?: React.ElementType;\n isExpanded?: boolean;\n title: React.ReactNode;\n details: React.ReactNode;\n icon?: React.ReactNode;\n children?: React.ReactNode;\n id?: string;\n className?: string;\n 'data-testid'?: string;\n onClick?: (nextIsExpanded: boolean) => void;\n}\n\n/**\n * @deprecated Use [new ListItem component](?path=/docs/content-listitem--docs) instead.\n * @see https://transferwise.atlassian.net/wiki/spaces/DS/pages/2387314550/Instructions+for+killing+expanding+cards+on+web+design+pattern\n */\nconst Card = forwardRef(function Card(\n {\n 'aria-label': ariaLabel,\n as: Element = 'div',\n isExpanded,\n title,\n details,\n children,\n onClick,\n icon,\n id,\n className,\n 'data-testid': dataTestId,\n }: CardProps,\n reference,\n) {\n const labelId = useId();\n const contentId = useId();\n const isExpandable = Boolean(children);\n\n return (\n <Element\n ref={reference}\n className={clsx('np-card', className, {\n 'np-card--expanded': isExpandable && isExpanded,\n 'np-card--inactive': !children,\n 'np-card--has-icon': !!icon,\n })}\n id={id}\n data-testid={dataTestId}\n >\n <Option\n aria-expanded={isExpandable ? isExpanded : undefined}\n aria-controls={isExpanded ? contentId : undefined}\n id={labelId}\n aria-label={ariaLabel}\n as={isExpandable ? 'button' : 'div'}\n className=\"np-card__button\"\n media={icon}\n title={title}\n content={details}\n showMediaAtAllSizes\n button={\n isExpandable ? (\n <Chevron orientation={isExpanded ? Position.TOP : Position.BOTTOM} />\n ) : null\n }\n onClick={isExpandable ? () => onClick?.(!isExpanded) : undefined}\n />\n\n {isExpandable && (\n <div\n className={clsx('np-card__divider', {\n 'np-card__divider--expanded': isExpanded,\n })}\n />\n )}\n\n {isExpandable && isExpanded && (\n <Body\n as=\"div\"\n type={Typography.BODY_LARGE}\n className={clsx('np-card__content', isExpanded ? 'd-block' : 'hide')}\n id={contentId}\n aria-labelledby={labelId}\n >\n {children}\n </Body>\n )}\n </Element>\n );\n});\n\nexport default Card;\n"],"names":["Card","forwardRef","ariaLabel","as","Element","isExpanded","title","details","children","onClick","icon","id","className","dataTestId","reference","labelId","useId","contentId","isExpandable","Boolean","_jsxs","ref","clsx","_jsx","Option","undefined","media","content","showMediaAtAllSizes","button","Chevron","orientation","Position","TOP","BOTTOM","Body","type","Typography","BODY_LARGE"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,MAAMA,IA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BACVK,GAAA,CAACO,OAAO,EAAA;QAACC,WAAW,EAAE1B,UAAU,GAAG2B,QAAQ,CAACC,GAAG,GAAGD,QAAQ,CAACE;OAAO,CAAG,GACnE,IACL;MACDzB,OAAO,EAAES,YAAY,GAAG,MAAMT,OAAO,GAAG,CAACJ,UAAU,CAAC,GAAGoB;AAAU,KAAA,CAGnE,EAACP,YAAY,iBACXK,GAAA,CAAA,KAAA,EAAA;AACEX,MAAAA,SAAS,EAAEU,IAAI,CAAC,kBAAkB,EAAE;AAClC,QAAA,4BAA4B,EAAEjB;OAC/B;KAAE,CAEN,EAEAa,YAAY,IAAIb,UAAU,iBACzBkB,GAAA,CAACY,IAAI,EAAA;AACHhC,MAAAA,EAAE,EAAC,KAAK;MACRiC,IAAI,EAAEC,UAAU,CAACC,UAAW;MAC5B1B,SAAS,EAAEU,IAAI,CAAC,kBAAkB,EAAEjB,UAAU,GAAG,SAAS,GAAG,MAAM,CAAE;AACrEM,MAAAA,EAAE,EAAEM,SAAU;AACd,MAAA,iBAAA,EAAiBF,OAAQ;AAAAP,MAAAA,QAAA,EAExBA;AAAQ,KACL,CACP;AAAA,GACM,CAAC;AAEd,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxButton.js","sources":["../../src/checkboxButton/CheckboxButton.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { InputHTMLAttributes, forwardRef, useEffect, useImperativeHandle, useRef } from 'react';\n\nimport { useInputAttributes } from '../inputs/contexts';\n\nexport type CheckboxButtonProps = InputHTMLAttributes<HTMLInputElement> & {\n indeterminate?: boolean;\n};\n\nconst CheckboxButton = forwardRef<HTMLInputElement, CheckboxButtonProps>(function CheckboxButton(\n { checked, indeterminate = false, className, disabled, onChange, ...rest },\n reference,\n) {\n const inputAttributes = useInputAttributes();\n\n const internalRef = useRef<HTMLInputElement>(null);\n\n useImperativeHandle(reference, () => internalRef.current ?? ({} as HTMLInputElement));\n\n useEffect(() => {\n if (internalRef.current) {\n // eslint-disable-next-line functional/immutable-data\n internalRef.current.indeterminate = indeterminate;\n }\n }, [indeterminate, reference]);\n\n return (\n <span className={clsx('np-checkbox-button', className, disabled && 'disabled')}>\n <input\n {...inputAttributes}\n {...rest}\n ref={reference ?? internalRef}\n type=\"checkbox\"\n disabled={disabled}\n checked={checked}\n onChange={onChange}\n />\n <span className=\"tw-checkbox-button\">\n <span className=\"tw-checkbox-check\" />\n <span className=\"np-tw-checkbox-indeterminate\" />\n </span>\n </span>\n );\n});\n\nexport default CheckboxButton;\n"],"names":["CheckboxButton","forwardRef","checked","indeterminate","className","disabled","onChange","rest","reference","inputAttributes","useInputAttributes","internalRef","useRef","useImperativeHandle","current","useEffect","_jsxs","clsx","children","_jsx","ref","type"],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"CheckboxButton.js","sources":["../../src/checkboxButton/CheckboxButton.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { InputHTMLAttributes, forwardRef, useEffect, useImperativeHandle, useRef } from 'react';\n\nimport { useInputAttributes } from '../inputs/contexts';\n\nexport type CheckboxButtonProps = InputHTMLAttributes<HTMLInputElement> & {\n /** @default false */\n indeterminate?: boolean;\n};\n\nconst CheckboxButton = forwardRef<HTMLInputElement, CheckboxButtonProps>(function CheckboxButton(\n { checked, indeterminate = false, className, disabled, onChange, ...rest },\n reference,\n) {\n const inputAttributes = useInputAttributes();\n\n const internalRef = useRef<HTMLInputElement>(null);\n\n useImperativeHandle(reference, () => internalRef.current ?? ({} as HTMLInputElement));\n\n useEffect(() => {\n if (internalRef.current) {\n // eslint-disable-next-line functional/immutable-data\n internalRef.current.indeterminate = indeterminate;\n }\n }, [indeterminate, reference]);\n\n return (\n <span className={clsx('np-checkbox-button', className, disabled && 'disabled')}>\n <input\n {...inputAttributes}\n {...rest}\n ref={reference ?? internalRef}\n type=\"checkbox\"\n disabled={disabled}\n checked={checked}\n onChange={onChange}\n />\n <span className=\"tw-checkbox-button\">\n <span className=\"tw-checkbox-check\" />\n <span className=\"np-tw-checkbox-indeterminate\" />\n </span>\n </span>\n );\n});\n\nexport default CheckboxButton;\n"],"names":["CheckboxButton","forwardRef","checked","indeterminate","className","disabled","onChange","rest","reference","inputAttributes","useInputAttributes","internalRef","useRef","useImperativeHandle","current","useEffect","_jsxs","clsx","children","_jsx","ref","type"],"mappings":";;;;;;;;;AAUA,MAAMA,cAAc,gBAAGC,gBAAU,CAAwC,SAASD,cAAcA,CAC9F;EAAEE,OAAO;AAAEC,EAAAA,aAAa,GAAG,KAAK;EAAEC,SAAS;EAAEC,QAAQ;EAAEC,QAAQ;EAAE,GAAGC;AAAI,CAAE,EAC1EC,SAAS,EAAA;AAET,EAAA,MAAMC,eAAe,GAAGC,2BAAkB,EAAE;AAE5C,EAAA,MAAMC,WAAW,GAAGC,YAAM,CAAmB,IAAI,CAAC;EAElDC,yBAAmB,CAACL,SAAS,EAAE,MAAMG,WAAW,CAACG,OAAO,IAAK,EAAuB,CAAC;AAErFC,EAAAA,eAAS,CAAC,MAAK;IACb,IAAIJ,WAAW,CAACG,OAAO,EAAE;AACvB;AACAH,MAAAA,WAAW,CAACG,OAAO,CAACX,aAAa,GAAGA,aAAa;AACnD,IAAA;AACF,EAAA,CAAC,EAAE,CAACA,aAAa,EAAEK,SAAS,CAAC,CAAC;AAE9B,EAAA,oBACEQ,eAAA,CAAA,MAAA,EAAA;IAAMZ,SAAS,EAAEa,SAAI,CAAC,oBAAoB,EAAEb,SAAS,EAAEC,QAAQ,IAAI,UAAU,CAAE;AAAAa,IAAAA,QAAA,gBAC7EC,cAAA,CAAA,OAAA,EAAA;AAAA,MAAA,GACMV,eAAe;AAAA,MAAA,GACfF,IAAI;MACRa,GAAG,EAAEZ,SAAS,IAAIG,WAAY;AAC9BU,MAAAA,IAAI,EAAC,UAAU;AACfhB,MAAAA,QAAQ,EAAEA,QAAS;AACnBH,MAAAA,OAAO,EAAEA,OAAQ;AACjBI,MAAAA,QAAQ,EAAEA;KAAS,CAErB,eAAAU,eAAA,CAAA,MAAA,EAAA;AAAMZ,MAAAA,SAAS,EAAC,oBAAoB;AAAAc,MAAAA,QAAA,gBAClCC,cAAA,CAAA,MAAA,EAAA;AAAMf,QAAAA,SAAS,EAAC;OAAmB,CACnC,eAAAe,cAAA,CAAA,MAAA,EAAA;AAAMf,QAAAA,SAAS,EAAC;AAA8B,OAAA,CAChD;AAAA,KAAM,CACR;AAAA,GAAM,CAAC;AAEX,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxButton.mjs","sources":["../../src/checkboxButton/CheckboxButton.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { InputHTMLAttributes, forwardRef, useEffect, useImperativeHandle, useRef } from 'react';\n\nimport { useInputAttributes } from '../inputs/contexts';\n\nexport type CheckboxButtonProps = InputHTMLAttributes<HTMLInputElement> & {\n indeterminate?: boolean;\n};\n\nconst CheckboxButton = forwardRef<HTMLInputElement, CheckboxButtonProps>(function CheckboxButton(\n { checked, indeterminate = false, className, disabled, onChange, ...rest },\n reference,\n) {\n const inputAttributes = useInputAttributes();\n\n const internalRef = useRef<HTMLInputElement>(null);\n\n useImperativeHandle(reference, () => internalRef.current ?? ({} as HTMLInputElement));\n\n useEffect(() => {\n if (internalRef.current) {\n // eslint-disable-next-line functional/immutable-data\n internalRef.current.indeterminate = indeterminate;\n }\n }, [indeterminate, reference]);\n\n return (\n <span className={clsx('np-checkbox-button', className, disabled && 'disabled')}>\n <input\n {...inputAttributes}\n {...rest}\n ref={reference ?? internalRef}\n type=\"checkbox\"\n disabled={disabled}\n checked={checked}\n onChange={onChange}\n />\n <span className=\"tw-checkbox-button\">\n <span className=\"tw-checkbox-check\" />\n <span className=\"np-tw-checkbox-indeterminate\" />\n </span>\n </span>\n );\n});\n\nexport default CheckboxButton;\n"],"names":["CheckboxButton","forwardRef","checked","indeterminate","className","disabled","onChange","rest","reference","inputAttributes","useInputAttributes","internalRef","useRef","useImperativeHandle","current","useEffect","_jsxs","clsx","children","_jsx","ref","type"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"CheckboxButton.mjs","sources":["../../src/checkboxButton/CheckboxButton.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { InputHTMLAttributes, forwardRef, useEffect, useImperativeHandle, useRef } from 'react';\n\nimport { useInputAttributes } from '../inputs/contexts';\n\nexport type CheckboxButtonProps = InputHTMLAttributes<HTMLInputElement> & {\n /** @default false */\n indeterminate?: boolean;\n};\n\nconst CheckboxButton = forwardRef<HTMLInputElement, CheckboxButtonProps>(function CheckboxButton(\n { checked, indeterminate = false, className, disabled, onChange, ...rest },\n reference,\n) {\n const inputAttributes = useInputAttributes();\n\n const internalRef = useRef<HTMLInputElement>(null);\n\n useImperativeHandle(reference, () => internalRef.current ?? ({} as HTMLInputElement));\n\n useEffect(() => {\n if (internalRef.current) {\n // eslint-disable-next-line functional/immutable-data\n internalRef.current.indeterminate = indeterminate;\n }\n }, [indeterminate, reference]);\n\n return (\n <span className={clsx('np-checkbox-button', className, disabled && 'disabled')}>\n <input\n {...inputAttributes}\n {...rest}\n ref={reference ?? internalRef}\n type=\"checkbox\"\n disabled={disabled}\n checked={checked}\n onChange={onChange}\n />\n <span className=\"tw-checkbox-button\">\n <span className=\"tw-checkbox-check\" />\n <span className=\"np-tw-checkbox-indeterminate\" />\n </span>\n </span>\n );\n});\n\nexport default CheckboxButton;\n"],"names":["CheckboxButton","forwardRef","checked","indeterminate","className","disabled","onChange","rest","reference","inputAttributes","useInputAttributes","internalRef","useRef","useImperativeHandle","current","useEffect","_jsxs","clsx","children","_jsx","ref","type"],"mappings":";;;;;AAUA,MAAMA,cAAc,gBAAGC,UAAU,CAAwC,SAASD,cAAcA,CAC9F;EAAEE,OAAO;AAAEC,EAAAA,aAAa,GAAG,KAAK;EAAEC,SAAS;EAAEC,QAAQ;EAAEC,QAAQ;EAAE,GAAGC;AAAI,CAAE,EAC1EC,SAAS,EAAA;AAET,EAAA,MAAMC,eAAe,GAAGC,kBAAkB,EAAE;AAE5C,EAAA,MAAMC,WAAW,GAAGC,MAAM,CAAmB,IAAI,CAAC;EAElDC,mBAAmB,CAACL,SAAS,EAAE,MAAMG,WAAW,CAACG,OAAO,IAAK,EAAuB,CAAC;AAErFC,EAAAA,SAAS,CAAC,MAAK;IACb,IAAIJ,WAAW,CAACG,OAAO,EAAE;AACvB;AACAH,MAAAA,WAAW,CAACG,OAAO,CAACX,aAAa,GAAGA,aAAa;AACnD,IAAA;AACF,EAAA,CAAC,EAAE,CAACA,aAAa,EAAEK,SAAS,CAAC,CAAC;AAE9B,EAAA,oBACEQ,IAAA,CAAA,MAAA,EAAA;IAAMZ,SAAS,EAAEa,IAAI,CAAC,oBAAoB,EAAEb,SAAS,EAAEC,QAAQ,IAAI,UAAU,CAAE;AAAAa,IAAAA,QAAA,gBAC7EC,GAAA,CAAA,OAAA,EAAA;AAAA,MAAA,GACMV,eAAe;AAAA,MAAA,GACfF,IAAI;MACRa,GAAG,EAAEZ,SAAS,IAAIG,WAAY;AAC9BU,MAAAA,IAAI,EAAC,UAAU;AACfhB,MAAAA,QAAQ,EAAEA,QAAS;AACnBH,MAAAA,OAAO,EAAEA,OAAQ;AACjBI,MAAAA,QAAQ,EAAEA;KAAS,CAErB,eAAAU,IAAA,CAAA,MAAA,EAAA;AAAMZ,MAAAA,SAAS,EAAC,oBAAoB;AAAAc,MAAAA,QAAA,gBAClCC,GAAA,CAAA,MAAA,EAAA;AAAMf,QAAAA,SAAS,EAAC;OAAmB,CACnC,eAAAe,GAAA,CAAA,MAAA,EAAA;AAAMf,QAAAA,SAAS,EAAC;AAA8B,OAAA,CAChD;AAAA,KAAM,CACR;AAAA,GAAM,CAAC;AAEX,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxOption.js","sources":["../../src/checkboxOption/CheckboxOption.tsx"],"sourcesContent":["import { forwardRef } from 'react';\n\nimport CheckboxButton from '../checkboxButton';\nimport Option from '../common/Option';\nimport { ReferenceType, BaseOptionProps } from '../common/Option/Option';\n\nexport type CheckboxOptionProps = Omit<BaseOptionProps, 'onChange'> & {\n /**\n * The checked state of the checkbox.\n */\n checked?: boolean;\n /**\n * Function to call when the checkbox option is clicked\n */\n onChange?: (value: boolean) => void;\n};\n\n/**\n * @deprecated
|
|
1
|
+
{"version":3,"file":"CheckboxOption.js","sources":["../../src/checkboxOption/CheckboxOption.tsx"],"sourcesContent":["import { forwardRef } from 'react';\n\nimport CheckboxButton from '../checkboxButton';\nimport Option from '../common/Option';\nimport { ReferenceType, BaseOptionProps } from '../common/Option/Option';\n\nexport type CheckboxOptionProps = Omit<BaseOptionProps, 'onChange'> & {\n /**\n * The checked state of the checkbox.\n */\n checked?: boolean;\n /**\n * Function to call when the checkbox option is clicked\n */\n onChange?: (value: boolean) => void;\n};\n\n/**\n * @deprecated Use `<ListItem />` instead.\n * @deprecatedSince 46.104.0\n * @see [Source](../listItem/ListItem.tsx)\n * @see [Storybook](https://storybook.wise.design/?path=/docs/content-listitem--docs)\n * @see [Design docs](https://wise.design/components/list-item)\n * @see [Release notes](https://transferwise.atlassian.net/wiki/spaces/DS/pages/3647251055/List+Item+release+notes)\n */\nconst CheckboxOption = forwardRef<ReferenceType, CheckboxOptionProps>(\n ({ checked, disabled, onChange, ...rest }, reference) => {\n return (\n <Option\n {...rest}\n ref={reference}\n disabled={disabled}\n button={\n <CheckboxButton\n checked={checked}\n disabled={disabled}\n onChange={() => onChange?.(!checked)}\n />\n }\n />\n );\n },\n);\n\nexport default CheckboxOption;\n"],"names":["CheckboxOption","forwardRef","checked","disabled","onChange","rest","reference","_jsx","Option","ref","button","CheckboxButton"],"mappings":";;;;;;;;;AAyBA,MAAMA,cAAc,gBAAGC,gBAAU,CAC/B,CAAC;EAAEC,OAAO;EAAEC,QAAQ;EAAEC,QAAQ;EAAE,GAAGC;CAAM,EAAEC,SAAS,KAAI;EACtD,oBACEC,cAAA,CAACC,cAAM,EAAA;AAAA,IAAA,GACDH,IAAI;AACRI,IAAAA,GAAG,EAAEH,SAAU;AACfH,IAAAA,QAAQ,EAAEA,QAAS;IACnBO,MAAM,eACJH,cAAA,CAACI,sBAAc,EAAA;AACbT,MAAAA,OAAO,EAAEA,OAAQ;AACjBC,MAAAA,QAAQ,EAAEA,QAAS;AACnBC,MAAAA,QAAQ,EAAEA,MAAMA,QAAQ,GAAG,CAACF,OAAO;KAAE;AAExC,GAAA,CACD;AAEN,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxOption.mjs","sources":["../../src/checkboxOption/CheckboxOption.tsx"],"sourcesContent":["import { forwardRef } from 'react';\n\nimport CheckboxButton from '../checkboxButton';\nimport Option from '../common/Option';\nimport { ReferenceType, BaseOptionProps } from '../common/Option/Option';\n\nexport type CheckboxOptionProps = Omit<BaseOptionProps, 'onChange'> & {\n /**\n * The checked state of the checkbox.\n */\n checked?: boolean;\n /**\n * Function to call when the checkbox option is clicked\n */\n onChange?: (value: boolean) => void;\n};\n\n/**\n * @deprecated
|
|
1
|
+
{"version":3,"file":"CheckboxOption.mjs","sources":["../../src/checkboxOption/CheckboxOption.tsx"],"sourcesContent":["import { forwardRef } from 'react';\n\nimport CheckboxButton from '../checkboxButton';\nimport Option from '../common/Option';\nimport { ReferenceType, BaseOptionProps } from '../common/Option/Option';\n\nexport type CheckboxOptionProps = Omit<BaseOptionProps, 'onChange'> & {\n /**\n * The checked state of the checkbox.\n */\n checked?: boolean;\n /**\n * Function to call when the checkbox option is clicked\n */\n onChange?: (value: boolean) => void;\n};\n\n/**\n * @deprecated Use `<ListItem />` instead.\n * @deprecatedSince 46.104.0\n * @see [Source](../listItem/ListItem.tsx)\n * @see [Storybook](https://storybook.wise.design/?path=/docs/content-listitem--docs)\n * @see [Design docs](https://wise.design/components/list-item)\n * @see [Release notes](https://transferwise.atlassian.net/wiki/spaces/DS/pages/3647251055/List+Item+release+notes)\n */\nconst CheckboxOption = forwardRef<ReferenceType, CheckboxOptionProps>(\n ({ checked, disabled, onChange, ...rest }, reference) => {\n return (\n <Option\n {...rest}\n ref={reference}\n disabled={disabled}\n button={\n <CheckboxButton\n checked={checked}\n disabled={disabled}\n onChange={() => onChange?.(!checked)}\n />\n }\n />\n );\n },\n);\n\nexport default CheckboxOption;\n"],"names":["CheckboxOption","forwardRef","checked","disabled","onChange","rest","reference","_jsx","Option","ref","button","CheckboxButton"],"mappings":";;;;;AAyBA,MAAMA,cAAc,gBAAGC,UAAU,CAC/B,CAAC;EAAEC,OAAO;EAAEC,QAAQ;EAAEC,QAAQ;EAAE,GAAGC;CAAM,EAAEC,SAAS,KAAI;EACtD,oBACEC,GAAA,CAACC,MAAM,EAAA;AAAA,IAAA,GACDH,IAAI;AACRI,IAAAA,GAAG,EAAEH,SAAU;AACfH,IAAAA,QAAQ,EAAEA,QAAS;IACnBO,MAAM,eACJH,GAAA,CAACI,cAAc,EAAA;AACbT,MAAAA,OAAO,EAAEA,OAAQ;AACjBC,MAAAA,QAAQ,EAAEA,QAAS;AACnBC,MAAAA,QAAQ,EAAEA,MAAMA,QAAQ,GAAG,CAACF,OAAO;KAAE;AAExC,GAAA,CACD;AAEN,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CircularButton.js","sources":["../../src/circularButton/CircularButton.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport Body from '../body/Body';\nimport {
|
|
1
|
+
{"version":3,"file":"CircularButton.js","sources":["../../src/circularButton/CircularButton.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport Body from '../body/Body';\nimport { Breakpoint, ControlType, Priority, Typography } from '../common';\nimport IconButton, { IconButtonProps } from '../iconButton';\nimport { useMedia } from '../common/hooks/useMedia';\n\n/**\n * @deprecated Use `'default'` instead.\n */\ntype DeprecatedTypes = `${ControlType.ACCENT | ControlType.POSITIVE}`;\n\nexport interface CircularButtonProps {\n className?: string;\n children: string;\n disabled?: boolean;\n icon: React.ReactElement<{ size?: unknown }> | React.ReactNode;\n onClick?: React.MouseEventHandler<HTMLInputElement> &\n React.MouseEventHandler<HTMLButtonElement> &\n React.MouseEventHandler<HTMLAnchorElement>;\n priority?: `${Priority.PRIMARY | Priority.SECONDARY}`;\n /**\n * `\"accent\"` and `\"positive\"` values are **deprecated**, please use `\"default\"` instead\n */\n type?: DeprecatedTypes | 'default' | `${ControlType.NEGATIVE}`;\n}\n\nconst CircularButton = ({\n className,\n children,\n disabled,\n icon,\n onClick,\n priority = Priority.PRIMARY,\n type = 'default',\n}: CircularButtonProps) => {\n const isTinyViewport = useMedia(`(max-width: ${Breakpoint.ZOOM_400}px)`);\n return (\n <label\n className={clsx(\n 'np-circular-btn',\n `np-circular-btn-${priority}-${type}`,\n { 'np-circular-btn-disabled': disabled },\n className,\n )}\n >\n <IconButton\n size={isTinyViewport ? 32 : 56}\n priority={priority}\n type={['accent', 'positive'].includes(type) ? 'default' : (type as IconButtonProps['type'])}\n className={clsx('m-b-1')}\n disabled={disabled}\n onClick={onClick}\n >\n {icon}\n </IconButton>\n <Body\n as=\"span\"\n className={clsx('np-circular-btn-label', { disabled })}\n type={Typography.BODY_DEFAULT_BOLD}\n >\n {children}\n </Body>\n </label>\n );\n};\n\nexport default CircularButton;\n"],"names":["CircularButton","className","children","disabled","icon","onClick","priority","Priority","PRIMARY","type","isTinyViewport","useMedia","Breakpoint","ZOOM_400","_jsxs","clsx","_jsx","IconButton","size","includes","Body","as","Typography","BODY_DEFAULT_BOLD"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,MAAMA,cAAc,GAAGA,CAAC;EACtBC,SAAS;EACTC,QAAQ;EACRC,QAAQ;EACRC,IAAI;EACJC,OAAO;EACPC,QAAQ,GAAGC,gBAAQ,CAACC,OAAO;AAC3BC,EAAAA,IAAI,GAAG;AAAS,CACI,KAAI;EACxB,MAAMC,cAAc,GAAGC,iBAAQ,CAAC,eAAeC,qBAAU,CAACC,QAAQ,CAAA,GAAA,CAAK,CAAC;AACxE,EAAA,oBACEC,eAAA,CAAA,OAAA,EAAA;IACEb,SAAS,EAAEc,SAAI,CACb,iBAAiB,EACjB,mBAAmBT,QAAQ,CAAA,CAAA,EAAIG,IAAI,CAAA,CAAE,EACrC;AAAE,MAAA,0BAA0B,EAAEN;KAAU,EACxCF,SAAS,CACT;IAAAC,QAAA,EAAA,cAEFc,cAAA,CAACC,kBAAU,EAAA;AACTC,MAAAA,IAAI,EAAER,cAAc,GAAG,EAAE,GAAG,EAAG;AAC/BJ,MAAAA,QAAQ,EAAEA,QAAS;AACnBG,MAAAA,IAAI,EAAE,CAAC,QAAQ,EAAE,UAAU,CAAC,CAACU,QAAQ,CAACV,IAAI,CAAC,GAAG,SAAS,GAAIA,IAAiC;AAC5FR,MAAAA,SAAS,EAAEc,SAAI,CAAC,OAAO,CAAE;AACzBZ,MAAAA,QAAQ,EAAEA,QAAS;AACnBE,MAAAA,OAAO,EAAEA,OAAQ;AAAAH,MAAAA,QAAA,EAEhBE;AAAI,KACK,CACZ,eAAAY,cAAA,CAACI,YAAI,EAAA;AACHC,MAAAA,EAAE,EAAC,MAAM;AACTpB,MAAAA,SAAS,EAAEc,SAAI,CAAC,uBAAuB,EAAE;AAAEZ,QAAAA;AAAQ,OAAE,CAAE;MACvDM,IAAI,EAAEa,qBAAU,CAACC,iBAAkB;AAAArB,MAAAA,QAAA,EAElCA;AAAQ,KACL,CACR;AAAA,GAAO,CAAC;AAEZ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CircularButton.mjs","sources":["../../src/circularButton/CircularButton.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport Body from '../body/Body';\nimport {
|
|
1
|
+
{"version":3,"file":"CircularButton.mjs","sources":["../../src/circularButton/CircularButton.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport Body from '../body/Body';\nimport { Breakpoint, ControlType, Priority, Typography } from '../common';\nimport IconButton, { IconButtonProps } from '../iconButton';\nimport { useMedia } from '../common/hooks/useMedia';\n\n/**\n * @deprecated Use `'default'` instead.\n */\ntype DeprecatedTypes = `${ControlType.ACCENT | ControlType.POSITIVE}`;\n\nexport interface CircularButtonProps {\n className?: string;\n children: string;\n disabled?: boolean;\n icon: React.ReactElement<{ size?: unknown }> | React.ReactNode;\n onClick?: React.MouseEventHandler<HTMLInputElement> &\n React.MouseEventHandler<HTMLButtonElement> &\n React.MouseEventHandler<HTMLAnchorElement>;\n priority?: `${Priority.PRIMARY | Priority.SECONDARY}`;\n /**\n * `\"accent\"` and `\"positive\"` values are **deprecated**, please use `\"default\"` instead\n */\n type?: DeprecatedTypes | 'default' | `${ControlType.NEGATIVE}`;\n}\n\nconst CircularButton = ({\n className,\n children,\n disabled,\n icon,\n onClick,\n priority = Priority.PRIMARY,\n type = 'default',\n}: CircularButtonProps) => {\n const isTinyViewport = useMedia(`(max-width: ${Breakpoint.ZOOM_400}px)`);\n return (\n <label\n className={clsx(\n 'np-circular-btn',\n `np-circular-btn-${priority}-${type}`,\n { 'np-circular-btn-disabled': disabled },\n className,\n )}\n >\n <IconButton\n size={isTinyViewport ? 32 : 56}\n priority={priority}\n type={['accent', 'positive'].includes(type) ? 'default' : (type as IconButtonProps['type'])}\n className={clsx('m-b-1')}\n disabled={disabled}\n onClick={onClick}\n >\n {icon}\n </IconButton>\n <Body\n as=\"span\"\n className={clsx('np-circular-btn-label', { disabled })}\n type={Typography.BODY_DEFAULT_BOLD}\n >\n {children}\n </Body>\n </label>\n );\n};\n\nexport default CircularButton;\n"],"names":["CircularButton","className","children","disabled","icon","onClick","priority","Priority","PRIMARY","type","isTinyViewport","useMedia","Breakpoint","ZOOM_400","_jsxs","clsx","_jsx","IconButton","size","includes","Body","as","Typography","BODY_DEFAULT_BOLD"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,MAAMA,cAAc,GAAGA,CAAC;EACtBC,SAAS;EACTC,QAAQ;EACRC,QAAQ;EACRC,IAAI;EACJC,OAAO;EACPC,QAAQ,GAAGC,QAAQ,CAACC,OAAO;AAC3BC,EAAAA,IAAI,GAAG;AAAS,CACI,KAAI;EACxB,MAAMC,cAAc,GAAGC,QAAQ,CAAC,eAAeC,UAAU,CAACC,QAAQ,CAAA,GAAA,CAAK,CAAC;AACxE,EAAA,oBACEC,IAAA,CAAA,OAAA,EAAA;IACEb,SAAS,EAAEc,IAAI,CACb,iBAAiB,EACjB,mBAAmBT,QAAQ,CAAA,CAAA,EAAIG,IAAI,CAAA,CAAE,EACrC;AAAE,MAAA,0BAA0B,EAAEN;KAAU,EACxCF,SAAS,CACT;IAAAC,QAAA,EAAA,cAEFc,GAAA,CAACC,UAAU,EAAA;AACTC,MAAAA,IAAI,EAAER,cAAc,GAAG,EAAE,GAAG,EAAG;AAC/BJ,MAAAA,QAAQ,EAAEA,QAAS;AACnBG,MAAAA,IAAI,EAAE,CAAC,QAAQ,EAAE,UAAU,CAAC,CAACU,QAAQ,CAACV,IAAI,CAAC,GAAG,SAAS,GAAIA,IAAiC;AAC5FR,MAAAA,SAAS,EAAEc,IAAI,CAAC,OAAO,CAAE;AACzBZ,MAAAA,QAAQ,EAAEA,QAAS;AACnBE,MAAAA,OAAO,EAAEA,OAAQ;AAAAH,MAAAA,QAAA,EAEhBE;AAAI,KACK,CACZ,eAAAY,GAAA,CAACI,IAAI,EAAA;AACHC,MAAAA,EAAE,EAAC,MAAM;AACTpB,MAAAA,SAAS,EAAEc,IAAI,CAAC,uBAAuB,EAAE;AAAEZ,QAAAA;AAAQ,OAAE,CAAE;MACvDM,IAAI,EAAEa,UAAU,CAACC,iBAAkB;AAAArB,MAAAA,QAAA,EAElCA;AAAQ,KACL,CACR;AAAA,GAAO,CAAC;AAEZ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type.js","sources":["../../../src/common/propsValues/type.ts"],"sourcesContent":["/**\n * @deprecated
|
|
1
|
+
{"version":3,"file":"type.js","sources":["../../../src/common/propsValues/type.ts"],"sourcesContent":["/**\n * @deprecated Use `ControlType` and `Priority` enums instead.\n */\nexport enum Type {\n PRIMARY = 'primary',\n\n /**\n * @deprecated use\n */\n PAY = 'pay',\n SECONDARY = 'secondary',\n DANGER = 'danger',\n LINK = 'link',\n}\n"],"names":["Type"],"mappings":";;AAAA;;AAEG;AACSA;AAAZ,CAAA,UAAYA,IAAI,EAAA;AACdA,EAAAA,IAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AAEnB;;AAEG;AACHA,EAAAA,IAAA,CAAA,KAAA,CAAA,GAAA,KAAW;AACXA,EAAAA,IAAA,CAAA,WAAA,CAAA,GAAA,WAAuB;AACvBA,EAAAA,IAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACjBA,EAAAA,IAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACf,CAAC,EAVWA,YAAI,KAAJA,YAAI,GAAA,EAAA,CAAA,CAAA;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type.mjs","sources":["../../../src/common/propsValues/type.ts"],"sourcesContent":["/**\n * @deprecated
|
|
1
|
+
{"version":3,"file":"type.mjs","sources":["../../../src/common/propsValues/type.ts"],"sourcesContent":["/**\n * @deprecated Use `ControlType` and `Priority` enums instead.\n */\nexport enum Type {\n PRIMARY = 'primary',\n\n /**\n * @deprecated use\n */\n PAY = 'pay',\n SECONDARY = 'secondary',\n DANGER = 'danger',\n LINK = 'link',\n}\n"],"names":["Type"],"mappings":"AAAA;;AAEG;IACSA;AAAZ,CAAA,UAAYA,IAAI,EAAA;AACdA,EAAAA,IAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AAEnB;;AAEG;AACHA,EAAAA,IAAA,CAAA,KAAA,CAAA,GAAA,KAAW;AACXA,EAAAA,IAAA,CAAA,WAAA,CAAA,GAAA,WAAuB;AACvBA,EAAAA,IAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACjBA,EAAAA,IAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACf,CAAC,EAVWA,IAAI,KAAJA,IAAI,GAAA,EAAA,CAAA,CAAA;;;;"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
exports.Typography = void 0;
|
|
4
4
|
(function (Typography) {
|
|
5
5
|
/**
|
|
6
|
-
* @deprecated
|
|
6
|
+
* @deprecated Use Marketing titles or {@link Typography.DISPLAY_LARGE} instead.
|
|
7
7
|
*/
|
|
8
8
|
Typography["DISPLAY_EXTRA_LARGE"] = "display-extra-large";
|
|
9
9
|
Typography["DISPLAY_LARGE"] = "display-large";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typography.js","sources":["../../../src/common/propsValues/typography.ts"],"sourcesContent":["export enum Typography {\n /**\n * @deprecated
|
|
1
|
+
{"version":3,"file":"typography.js","sources":["../../../src/common/propsValues/typography.ts"],"sourcesContent":["export enum Typography {\n /**\n * @deprecated Use Marketing titles or {@link Typography.DISPLAY_LARGE} instead.\n */\n DISPLAY_EXTRA_LARGE = 'display-extra-large',\n DISPLAY_LARGE = 'display-large',\n DISPLAY_MEDIUM = 'display-medium',\n DISPLAY_SMALL = 'display-small',\n DISPLAY_NUMBER = 'display-number',\n\n TITLE_SCREEN = 'title-screen',\n TITLE_SECTION = 'title-section',\n TITLE_SUBSECTION = 'title-subsection',\n TITLE_BODY = 'title-body',\n TITLE_GROUP = 'title-group',\n\n BODY_LARGE = 'body-large',\n BODY_DEFAULT = 'body-default',\n BODY_DEFAULT_BOLD = 'body-default-bold',\n BODY_LARGE_BOLD = 'body-large-bold',\n\n LINK_LARGE = 'link-large',\n LINK_DEFAULT = 'link-default',\n}\n\n/**\n * @deprecated Use {@link Typography.DISPLAY_LARGE} instead.\n */\nexport type DisplayExtraLarge = 'display-extra-large';\nexport type DisplayLarge = 'display-large';\nexport type DisplayMedium = 'display-medium';\nexport type DisplaySmall = 'display-small';\nexport type DisplayNumber = 'display-number';\n\nexport type DisplayTypes =\n | DisplayExtraLarge\n | DisplayLarge\n | DisplayMedium\n | DisplaySmall\n | DisplayNumber;\n\nexport type TitleScreen = 'title-screen';\nexport type TitleSection = 'title-section';\nexport type TitleSubsection = 'title-subsection';\nexport type TitleBody = 'title-body';\nexport type TitleGroup = 'title-group';\n\nexport type TitleTypes = TitleScreen | TitleSection | TitleSubsection | TitleBody | TitleGroup;\n\nexport type BodyDefault = 'body-default';\nexport type BodyLargeBold = 'body-large-bold';\nexport type BodyDefaultBold = 'body-default-bold';\nexport type BodyLarge = 'body-large';\n\nexport type BodyTypes = BodyLargeBold | BodyDefault | BodyLarge | BodyDefaultBold;\n\nexport type LinkDefault = 'link-default';\nexport type LinkLarge = 'link-large';\n\nexport type LinkTypes = LinkDefault | LinkLarge;\n\nexport type TypographyTypes =\n | TitleScreen\n | TitleSection\n | TitleSubsection\n | TitleBody\n | TitleGroup\n | BodyDefault\n | BodyLargeBold\n | BodyDefaultBold\n | BodyLarge\n | LinkDefault\n | LinkLarge;\n"],"names":["Typography"],"mappings":";;AAAYA;AAAZ,CAAA,UAAYA,UAAU,EAAA;AACpB;;AAEG;AACHA,EAAAA,UAAA,CAAA,qBAAA,CAAA,GAAA,qBAA2C;AAC3CA,EAAAA,UAAA,CAAA,eAAA,CAAA,GAAA,eAA+B;AAC/BA,EAAAA,UAAA,CAAA,gBAAA,CAAA,GAAA,gBAAiC;AACjCA,EAAAA,UAAA,CAAA,eAAA,CAAA,GAAA,eAA+B;AAC/BA,EAAAA,UAAA,CAAA,gBAAA,CAAA,GAAA,gBAAiC;AAEjCA,EAAAA,UAAA,CAAA,cAAA,CAAA,GAAA,cAA6B;AAC7BA,EAAAA,UAAA,CAAA,eAAA,CAAA,GAAA,eAA+B;AAC/BA,EAAAA,UAAA,CAAA,kBAAA,CAAA,GAAA,kBAAqC;AACrCA,EAAAA,UAAA,CAAA,YAAA,CAAA,GAAA,YAAyB;AACzBA,EAAAA,UAAA,CAAA,aAAA,CAAA,GAAA,aAA2B;AAE3BA,EAAAA,UAAA,CAAA,YAAA,CAAA,GAAA,YAAyB;AACzBA,EAAAA,UAAA,CAAA,cAAA,CAAA,GAAA,cAA6B;AAC7BA,EAAAA,UAAA,CAAA,mBAAA,CAAA,GAAA,mBAAuC;AACvCA,EAAAA,UAAA,CAAA,iBAAA,CAAA,GAAA,iBAAmC;AAEnCA,EAAAA,UAAA,CAAA,YAAA,CAAA,GAAA,YAAyB;AACzBA,EAAAA,UAAA,CAAA,cAAA,CAAA,GAAA,cAA6B;AAC/B,CAAC,EAvBWA,kBAAU,KAAVA,kBAAU,GAAA,EAAA,CAAA,CAAA;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var Typography;
|
|
2
2
|
(function (Typography) {
|
|
3
3
|
/**
|
|
4
|
-
* @deprecated
|
|
4
|
+
* @deprecated Use Marketing titles or {@link Typography.DISPLAY_LARGE} instead.
|
|
5
5
|
*/
|
|
6
6
|
Typography["DISPLAY_EXTRA_LARGE"] = "display-extra-large";
|
|
7
7
|
Typography["DISPLAY_LARGE"] = "display-large";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typography.mjs","sources":["../../../src/common/propsValues/typography.ts"],"sourcesContent":["export enum Typography {\n /**\n * @deprecated
|
|
1
|
+
{"version":3,"file":"typography.mjs","sources":["../../../src/common/propsValues/typography.ts"],"sourcesContent":["export enum Typography {\n /**\n * @deprecated Use Marketing titles or {@link Typography.DISPLAY_LARGE} instead.\n */\n DISPLAY_EXTRA_LARGE = 'display-extra-large',\n DISPLAY_LARGE = 'display-large',\n DISPLAY_MEDIUM = 'display-medium',\n DISPLAY_SMALL = 'display-small',\n DISPLAY_NUMBER = 'display-number',\n\n TITLE_SCREEN = 'title-screen',\n TITLE_SECTION = 'title-section',\n TITLE_SUBSECTION = 'title-subsection',\n TITLE_BODY = 'title-body',\n TITLE_GROUP = 'title-group',\n\n BODY_LARGE = 'body-large',\n BODY_DEFAULT = 'body-default',\n BODY_DEFAULT_BOLD = 'body-default-bold',\n BODY_LARGE_BOLD = 'body-large-bold',\n\n LINK_LARGE = 'link-large',\n LINK_DEFAULT = 'link-default',\n}\n\n/**\n * @deprecated Use {@link Typography.DISPLAY_LARGE} instead.\n */\nexport type DisplayExtraLarge = 'display-extra-large';\nexport type DisplayLarge = 'display-large';\nexport type DisplayMedium = 'display-medium';\nexport type DisplaySmall = 'display-small';\nexport type DisplayNumber = 'display-number';\n\nexport type DisplayTypes =\n | DisplayExtraLarge\n | DisplayLarge\n | DisplayMedium\n | DisplaySmall\n | DisplayNumber;\n\nexport type TitleScreen = 'title-screen';\nexport type TitleSection = 'title-section';\nexport type TitleSubsection = 'title-subsection';\nexport type TitleBody = 'title-body';\nexport type TitleGroup = 'title-group';\n\nexport type TitleTypes = TitleScreen | TitleSection | TitleSubsection | TitleBody | TitleGroup;\n\nexport type BodyDefault = 'body-default';\nexport type BodyLargeBold = 'body-large-bold';\nexport type BodyDefaultBold = 'body-default-bold';\nexport type BodyLarge = 'body-large';\n\nexport type BodyTypes = BodyLargeBold | BodyDefault | BodyLarge | BodyDefaultBold;\n\nexport type LinkDefault = 'link-default';\nexport type LinkLarge = 'link-large';\n\nexport type LinkTypes = LinkDefault | LinkLarge;\n\nexport type TypographyTypes =\n | TitleScreen\n | TitleSection\n | TitleSubsection\n | TitleBody\n | TitleGroup\n | BodyDefault\n | BodyLargeBold\n | BodyDefaultBold\n | BodyLarge\n | LinkDefault\n | LinkLarge;\n"],"names":["Typography"],"mappings":"IAAYA;AAAZ,CAAA,UAAYA,UAAU,EAAA;AACpB;;AAEG;AACHA,EAAAA,UAAA,CAAA,qBAAA,CAAA,GAAA,qBAA2C;AAC3CA,EAAAA,UAAA,CAAA,eAAA,CAAA,GAAA,eAA+B;AAC/BA,EAAAA,UAAA,CAAA,gBAAA,CAAA,GAAA,gBAAiC;AACjCA,EAAAA,UAAA,CAAA,eAAA,CAAA,GAAA,eAA+B;AAC/BA,EAAAA,UAAA,CAAA,gBAAA,CAAA,GAAA,gBAAiC;AAEjCA,EAAAA,UAAA,CAAA,cAAA,CAAA,GAAA,cAA6B;AAC7BA,EAAAA,UAAA,CAAA,eAAA,CAAA,GAAA,eAA+B;AAC/BA,EAAAA,UAAA,CAAA,kBAAA,CAAA,GAAA,kBAAqC;AACrCA,EAAAA,UAAA,CAAA,YAAA,CAAA,GAAA,YAAyB;AACzBA,EAAAA,UAAA,CAAA,aAAA,CAAA,GAAA,aAA2B;AAE3BA,EAAAA,UAAA,CAAA,YAAA,CAAA,GAAA,YAAyB;AACzBA,EAAAA,UAAA,CAAA,cAAA,CAAA,GAAA,cAA6B;AAC7BA,EAAAA,UAAA,CAAA,mBAAA,CAAA,GAAA,mBAAuC;AACvCA,EAAAA,UAAA,CAAA,iBAAA,CAAA,GAAA,iBAAmC;AAEnCA,EAAAA,UAAA,CAAA,YAAA,CAAA,GAAA,YAAyB;AACzBA,EAAAA,UAAA,CAAA,cAAA,CAAA,GAAA,cAA6B;AAC/B,CAAC,EAvBWA,UAAU,KAAVA,UAAU,GAAA,EAAA,CAAA,CAAA;;;;"}
|
|
@@ -81,10 +81,12 @@ function CriticalCommsBanner({
|
|
|
81
81
|
children: /*#__PURE__*/jsxRuntime.jsx(Alert.default, {
|
|
82
82
|
title: title,
|
|
83
83
|
message: subtitle,
|
|
84
|
-
action: {
|
|
85
|
-
onClick: action
|
|
86
|
-
|
|
87
|
-
|
|
84
|
+
action: action && {
|
|
85
|
+
onClick: action.onClick,
|
|
86
|
+
href: action.href,
|
|
87
|
+
target: action.target,
|
|
88
|
+
text: action.label,
|
|
89
|
+
as: 'button'
|
|
88
90
|
},
|
|
89
91
|
className: className,
|
|
90
92
|
type: sentiment$1,
|
|
@@ -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 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={{
|
|
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,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,mBAAS,CAACC,QAAQ,gBACjBP,cAAA,CAACQ,cAAM,EAAA;AAACN,IAAAA,EAAE,EAAEN,WAAW,CAACU,mBAAS,CAACC,QAAQ,CAAE;AAACE,IAAAA,IAAI,EAAE,EAAG;AAACC,IAAAA,SAAS,EAAC,wBAAwB;IAAAC,QAAA,eACvFX,cAAA,CAACY,WAAS,EAAA;AAACF,MAAAA,SAAS,EAAC;KAAmB;AAC1C,GAAQ,CACT;AACD,EAAA,CAACJ,mBAAS,CAACO,OAAO,gBAChBb,cAAA,CAACQ,cAAM,EAAA;AAACN,IAAAA,EAAE,EAAEN,WAAW,CAACU,mBAAS,CAACO,OAAO,CAAE;AAACJ,IAAAA,IAAI,EAAE,EAAG;AAACC,IAAAA,SAAS,EAAC,uBAAuB;IAAAC,QAAA,eACrFX,cAAA,CAACY,WAAS,EAAA;AA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|
title: title,
|
|
79
79
|
message: subtitle,
|
|
80
|
-
action: {
|
|
81
|
-
onClick: action
|
|
82
|
-
|
|
83
|
-
|
|
80
|
+
action: action && {
|
|
81
|
+
onClick: action.onClick,
|
|
82
|
+
href: action.href,
|
|
83
|
+
target: action.target,
|
|
84
|
+
text: action.label,
|
|
85
|
+
as: 'button'
|
|
84
86
|
},
|
|
85
87
|
className: className,
|
|
86
88
|
type: sentiment,
|
|
@@ -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 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={{
|
|
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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