@transferwise/components 0.0.0-experimental-a9e2e05 → 0.0.0-experimental-e92f7ac
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/avatarLayout/AvatarLayout.js +2 -9
- package/build/avatarLayout/AvatarLayout.js.map +1 -1
- package/build/avatarLayout/AvatarLayout.mjs +2 -9
- package/build/avatarLayout/AvatarLayout.mjs.map +1 -1
- package/build/button/{LegacyButton/Button.js → Button.js} +24 -25
- package/build/button/Button.js.map +1 -0
- package/build/button/{LegacyButton/Button.mjs → Button.mjs} +24 -25
- package/build/button/Button.mjs.map +1 -0
- package/build/button/classMap.js +42 -0
- package/build/button/classMap.js.map +1 -0
- package/build/button/classMap.mjs +39 -0
- package/build/button/classMap.mjs.map +1 -0
- package/build/button/{LegacyButton/legacyUtils → legacyUtils}/legacyUtils.js +21 -21
- package/build/button/legacyUtils/legacyUtils.js.map +1 -0
- package/build/button/{LegacyButton/legacyUtils → legacyUtils}/legacyUtils.mjs +21 -21
- package/build/button/legacyUtils/legacyUtils.mjs.map +1 -0
- package/build/circularButton/CircularButton.js +1 -1
- package/build/circularButton/CircularButton.js.map +1 -1
- package/build/circularButton/CircularButton.mjs +1 -1
- package/build/circularButton/CircularButton.mjs.map +1 -1
- package/build/common/action/Action.js +1 -1
- package/build/common/action/Action.js.map +1 -1
- package/build/common/action/Action.mjs +1 -1
- package/build/common/action/Action.mjs.map +1 -1
- package/build/criticalBanner/CriticalCommsBanner.js +1 -1
- package/build/criticalBanner/CriticalCommsBanner.mjs +1 -1
- package/build/header/Header.js +1 -1
- package/build/header/Header.mjs +1 -1
- package/build/index.js +1 -1
- package/build/index.mjs +1 -1
- package/build/link/Link.js +3 -8
- package/build/link/Link.js.map +1 -1
- package/build/link/Link.mjs +3 -8
- package/build/link/Link.mjs.map +1 -1
- package/build/main.css +29 -288
- package/build/nudge/Nudge.js +1 -1
- package/build/nudge/Nudge.js.map +1 -1
- package/build/nudge/Nudge.mjs +1 -1
- package/build/nudge/Nudge.mjs.map +1 -1
- package/build/select/Select.js +1 -1
- package/build/select/Select.mjs +1 -1
- package/build/styles/avatarLayout/AvatarLayout.css +0 -11
- package/build/styles/iconButton/IconButton.css +29 -24
- package/build/styles/main.css +29 -288
- package/build/types/avatarLayout/AvatarLayout.d.ts +2 -1
- package/build/types/avatarLayout/AvatarLayout.d.ts.map +1 -1
- package/build/types/avatarLayout/index.d.ts +0 -1
- package/build/types/avatarLayout/index.d.ts.map +1 -1
- package/build/types/button/{LegacyButton/Button.d.ts → Button.d.ts} +5 -8
- package/build/types/button/Button.d.ts.map +1 -0
- package/build/types/button/classMap.d.ts.map +1 -0
- package/build/types/button/index.d.ts +2 -2
- package/build/types/button/index.d.ts.map +1 -1
- package/build/types/button/legacyUtils/index.d.ts.map +1 -0
- package/build/types/button/{LegacyButton/legacyUtils → legacyUtils}/legacyUtils.d.ts +1 -1
- package/build/types/button/legacyUtils/legacyUtils.d.ts.map +1 -0
- package/build/types/link/Link.d.ts +2 -2
- package/build/types/link/Link.d.ts.map +1 -1
- package/build/types/test-utils/index.d.ts.map +1 -1
- package/build/upload/steps/completeStep/completeStep.js +1 -1
- package/build/upload/steps/completeStep/completeStep.mjs +1 -1
- package/build/upload/steps/processingStep/processingStep.js +1 -1
- package/build/upload/steps/processingStep/processingStep.mjs +1 -1
- package/build/uploadInput/UploadInput.js +1 -1
- package/build/uploadInput/UploadInput.mjs +1 -1
- package/package.json +3 -3
- package/src/avatarLayout/AvatarLayout.css +0 -11
- package/src/avatarLayout/AvatarLayout.less +1 -18
- package/src/avatarLayout/AvatarLayout.tsx +3 -11
- package/src/avatarLayout/index.ts +0 -1
- package/src/avatarWrapper/AvatarWrapper.story.tsx +0 -2
- package/src/button/{LegacyButton/Button.less → Button.less} +1 -1
- package/src/button/{LegacyButton/Button.spec.tsx → Button.spec.tsx} +3 -3
- package/src/button/Button.story.tsx +163 -0
- package/src/button/{LegacyButton/Button.tsx → Button.tsx} +9 -14
- package/src/button/{LegacyButton/classMap.ts → classMap.ts} +1 -1
- package/src/button/index.ts +3 -2
- package/src/button/{LegacyButton/legacyUtils → legacyUtils}/legacyUtils.spec.tsx +2 -2
- package/src/button/{LegacyButton/legacyUtils → legacyUtils}/legacyUtils.ts +2 -2
- package/src/circularButton/CircularButton.tsx +1 -1
- package/src/common/action/Action.tsx +1 -1
- package/src/iconButton/IconButton.css +29 -24
- package/src/iconButton/IconButton.less +4 -4
- package/src/link/Link.tsx +6 -15
- package/src/main.css +29 -288
- package/src/main.less +1 -2
- package/src/nudge/Nudge.tsx +1 -1
- package/src/phoneNumberInput/PhoneNumberInput.spec.tsx +283 -0
- package/src/primitives/PrimitiveAnchor/stories/PrimitiveAnchor.story.tsx +1 -1
- package/src/primitives/PrimitiveAnchor/test/PrimitiveAnchor.spec.tsx +1 -1
- package/src/primitives/PrimitiveButton/stories/PrimitiveButton.story.tsx +1 -1
- package/src/primitives/PrimitiveButton/test/PrimitiveButton.spec.tsx +3 -2
- package/src/test-utils/index.tsx +1 -0
- package/build/button/Button/src/Button.js +0 -93
- package/build/button/Button/src/Button.js.map +0 -1
- package/build/button/Button/src/Button.mjs +0 -91
- package/build/button/Button/src/Button.mjs.map +0 -1
- package/build/button/LegacyButton/Button.js.map +0 -1
- package/build/button/LegacyButton/Button.mjs.map +0 -1
- package/build/button/LegacyButton/classMap.js +0 -42
- package/build/button/LegacyButton/classMap.js.map +0 -1
- package/build/button/LegacyButton/classMap.mjs +0 -39
- package/build/button/LegacyButton/classMap.mjs.map +0 -1
- package/build/button/LegacyButton/legacyUtils/legacyUtils.js.map +0 -1
- package/build/button/LegacyButton/legacyUtils/legacyUtils.mjs.map +0 -1
- package/build/button/src/Button.js +0 -66
- package/build/button/src/Button.js.map +0 -1
- package/build/button/src/Button.mjs +0 -64
- package/build/button/src/Button.mjs.map +0 -1
- package/build/styles/button/Button/less/Button.css +0 -253
- package/build/styles/button/Button/less/Button.vars.css +0 -57
- package/build/types/button/Button/index.d.ts +0 -3
- package/build/types/button/Button/index.d.ts.map +0 -1
- package/build/types/button/Button/src/Button.d.ts +0 -4
- package/build/types/button/Button/src/Button.d.ts.map +0 -1
- package/build/types/button/Button/src/Button.types.d.ts +0 -50
- package/build/types/button/Button/src/Button.types.d.ts.map +0 -1
- package/build/types/button/Button/src/index.d.ts +0 -2
- package/build/types/button/Button/src/index.d.ts.map +0 -1
- package/build/types/button/LegacyButton/Button.d.ts.map +0 -1
- package/build/types/button/LegacyButton/classMap.d.ts.map +0 -1
- package/build/types/button/LegacyButton/index.d.ts +0 -3
- package/build/types/button/LegacyButton/index.d.ts.map +0 -1
- package/build/types/button/LegacyButton/legacyUtils/index.d.ts.map +0 -1
- package/build/types/button/LegacyButton/legacyUtils/legacyUtils.d.ts.map +0 -1
- package/build/types/button/src/Button.d.ts +0 -47
- package/build/types/button/src/Button.d.ts.map +0 -1
- package/build/types/button/src/index.d.ts +0 -3
- package/build/types/button/src/index.d.ts.map +0 -1
- package/src/button/Button/index.ts +0 -2
- package/src/button/Button/less/Button.css +0 -253
- package/src/button/Button/less/Button.less +0 -221
- package/src/button/Button/less/Button.vars.css +0 -57
- package/src/button/Button/less/Button.vars.less +0 -65
- package/src/button/Button/src/Button.tsx +0 -116
- package/src/button/Button/src/Button.types.ts +0 -70
- package/src/button/Button/src/index.ts +0 -1
- package/src/button/Button/stories/Button.story.tsx +0 -314
- package/src/button/Button/stories/Button.tests.story.tsx +0 -288
- package/src/button/Button/test/Button.spec.tsx +0 -328
- package/src/button/LegacyButton/Button.story.tsx +0 -224
- package/src/button/LegacyButton/index.ts +0 -3
- package/src/button/src/Button.tsx +0 -87
- package/src/button/src/index.ts +0 -2
- package/src/button/test/Button.spec.tsx +0 -32
- package/src/phoneNumberInput/PhoneNumberInput.rtl.spec.tsx +0 -32
- package/src/phoneNumberInput/PhoneNumberInput.spec.js +0 -356
- /package/build/styles/button/{LegacyButton/Button.css → Button.css} +0 -0
- /package/build/types/button/{LegacyButton/classMap.d.ts → classMap.d.ts} +0 -0
- /package/build/types/button/{LegacyButton/legacyUtils → legacyUtils}/index.d.ts +0 -0
- /package/src/button/{LegacyButton/Button.css → Button.css} +0 -0
- /package/src/button/{LegacyButton/__snapshots__ → __snapshots__}/Button.spec.tsx.snap +0 -0
- /package/src/button/{LegacyButton/legacyUtils → legacyUtils}/index.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CircularButton.js","sources":["../../src/circularButton/CircularButton.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { cloneElement } from 'react';\n\nimport Body from '../body/Body';\nimport { typeClassMap, priorityClassMap } from '../button/
|
|
1
|
+
{"version":3,"file":"CircularButton.js","sources":["../../src/circularButton/CircularButton.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { cloneElement } from 'react';\n\nimport Body from '../body/Body';\nimport { typeClassMap, priorityClassMap } from '../button/classMap';\nimport { Breakpoint, ControlType, Priority, Typography } from '../common';\nimport Circle from '../common/circle';\nimport { useMedia } from '../common/hooks/useMedia';\n\nexport interface CircularButtonProps {\n className?: string;\n children: string;\n disabled?: boolean;\n icon: React.ReactElement<{ size?: unknown }>;\n onClick?: React.MouseEventHandler<HTMLInputElement>;\n priority?: `${Priority.PRIMARY | Priority.SECONDARY}`;\n type?: `${ControlType.ACCENT | ControlType.POSITIVE | ControlType.NEGATIVE}`;\n}\n\nconst CircularButton = ({\n className,\n children,\n disabled,\n icon,\n priority = Priority.PRIMARY,\n type = ControlType.ACCENT,\n ...rest\n}: CircularButtonProps) => {\n const classes = clsx('btn np-btn', 'm-b-1', typeClassMap[type], priorityClassMap[priority]);\n\n const iconElement = Number(icon.props.size) !== 24 ? cloneElement(icon, { size: 24 }) : icon;\n\n const isTinyViewport = useMedia(`(max-width: ${Breakpoint.ZOOM_400}px)`);\n\n return (\n <label className={clsx('np-circular-btn', priority, type, disabled && 'disabled', className)}>\n <Circle\n as=\"input\"\n // @ts-expect-error it's input[type=button] element\n type=\"button\"\n size={isTinyViewport ? 72 : 56}\n aria-label={children}\n className={classes}\n disabled={disabled}\n {...rest}\n />\n {iconElement}\n <Body as=\"span\" className=\"np-circular-btn__label\" type={Typography.BODY_DEFAULT_BOLD}>\n {children}\n </Body>\n </label>\n );\n};\n\nexport default CircularButton;\n"],"names":["CircularButton","className","children","disabled","icon","priority","Priority","PRIMARY","type","ControlType","ACCENT","rest","classes","clsx","typeClassMap","priorityClassMap","iconElement","Number","props","size","cloneElement","isTinyViewport","useMedia","Breakpoint","ZOOM_400","_jsxs","_jsx","Circle","as","Body","Typography","BODY_DEFAULT_BOLD"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBMA,MAAAA,cAAc,GAAGA,CAAC;EACtBC,SAAS;EACTC,QAAQ;EACRC,QAAQ;EACRC,IAAI;EACJC,QAAQ,GAAGC,gBAAQ,CAACC,OAAO;EAC3BC,IAAI,GAAGC,mBAAW,CAACC,MAAM;EACzB,GAAGC,IAAAA;AACiB,CAAA,KAAI;AACxB,EAAA,MAAMC,OAAO,GAAGC,SAAI,CAAC,YAAY,EAAE,OAAO,EAAEC,qBAAY,CAACN,IAAI,CAAC,EAAEO,yBAAgB,CAACV,QAAQ,CAAC,CAAC,CAAA;AAE3F,EAAA,MAAMW,WAAW,GAAGC,MAAM,CAACb,IAAI,CAACc,KAAK,CAACC,IAAI,CAAC,KAAK,EAAE,gBAAGC,kBAAY,CAAChB,IAAI,EAAE;AAAEe,IAAAA,IAAI,EAAE,EAAA;GAAI,CAAC,GAAGf,IAAI,CAAA;EAE5F,MAAMiB,cAAc,GAAGC,iBAAQ,CAAC,eAAeC,qBAAU,CAACC,QAAQ,CAAA,GAAA,CAAK,CAAC,CAAA;AAExE,EAAA,oBACEC,eAAA,CAAA,OAAA,EAAA;AAAOxB,IAAAA,SAAS,EAAEY,SAAI,CAAC,iBAAiB,EAAER,QAAQ,EAAEG,IAAI,EAAEL,QAAQ,IAAI,UAAU,EAAEF,SAAS,CAAE;IAAAC,QAAA,EAAA,cAC3FwB,cAAA,CAACC,MAAM,EAAA;AACLC,MAAAA,EAAE,EAAC,OAAA;AACH;AAAA;AACApB,MAAAA,IAAI,EAAC,QAAQ;AACbW,MAAAA,IAAI,EAAEE,cAAc,GAAG,EAAE,GAAG,EAAG;AAC/B,MAAA,YAAA,EAAYnB,QAAS;AACrBD,MAAAA,SAAS,EAAEW,OAAQ;AACnBT,MAAAA,QAAQ,EAAEA,QAAS;MAAA,GACfQ,IAAAA;AAAI,KAEV,CAAA,EAACK,WAAW,eACZU,cAAA,CAACG,IAAI,EAAA;AAACD,MAAAA,EAAE,EAAC,MAAM;AAAC3B,MAAAA,SAAS,EAAC,wBAAwB;MAACO,IAAI,EAAEsB,qBAAU,CAACC,iBAAkB;AAAA7B,MAAAA,QAAA,EACnFA,QAAAA;AAAQ,KACL,CACR,CAAA;AAAA,GAAO,CAAC,CAAA;AAEZ;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { clsx } from 'clsx';
|
|
2
2
|
import { cloneElement } from 'react';
|
|
3
3
|
import Body from '../body/Body.mjs';
|
|
4
|
-
import { typeClassMap, priorityClassMap } from '../button/
|
|
4
|
+
import { typeClassMap, priorityClassMap } from '../button/classMap.mjs';
|
|
5
5
|
import '../common/theme.mjs';
|
|
6
6
|
import '../common/direction.mjs';
|
|
7
7
|
import { Priority, ControlType } from '../common/propsValues/control.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CircularButton.mjs","sources":["../../src/circularButton/CircularButton.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { cloneElement } from 'react';\n\nimport Body from '../body/Body';\nimport { typeClassMap, priorityClassMap } from '../button/
|
|
1
|
+
{"version":3,"file":"CircularButton.mjs","sources":["../../src/circularButton/CircularButton.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { cloneElement } from 'react';\n\nimport Body from '../body/Body';\nimport { typeClassMap, priorityClassMap } from '../button/classMap';\nimport { Breakpoint, ControlType, Priority, Typography } from '../common';\nimport Circle from '../common/circle';\nimport { useMedia } from '../common/hooks/useMedia';\n\nexport interface CircularButtonProps {\n className?: string;\n children: string;\n disabled?: boolean;\n icon: React.ReactElement<{ size?: unknown }>;\n onClick?: React.MouseEventHandler<HTMLInputElement>;\n priority?: `${Priority.PRIMARY | Priority.SECONDARY}`;\n type?: `${ControlType.ACCENT | ControlType.POSITIVE | ControlType.NEGATIVE}`;\n}\n\nconst CircularButton = ({\n className,\n children,\n disabled,\n icon,\n priority = Priority.PRIMARY,\n type = ControlType.ACCENT,\n ...rest\n}: CircularButtonProps) => {\n const classes = clsx('btn np-btn', 'm-b-1', typeClassMap[type], priorityClassMap[priority]);\n\n const iconElement = Number(icon.props.size) !== 24 ? cloneElement(icon, { size: 24 }) : icon;\n\n const isTinyViewport = useMedia(`(max-width: ${Breakpoint.ZOOM_400}px)`);\n\n return (\n <label className={clsx('np-circular-btn', priority, type, disabled && 'disabled', className)}>\n <Circle\n as=\"input\"\n // @ts-expect-error it's input[type=button] element\n type=\"button\"\n size={isTinyViewport ? 72 : 56}\n aria-label={children}\n className={classes}\n disabled={disabled}\n {...rest}\n />\n {iconElement}\n <Body as=\"span\" className=\"np-circular-btn__label\" type={Typography.BODY_DEFAULT_BOLD}>\n {children}\n </Body>\n </label>\n );\n};\n\nexport default CircularButton;\n"],"names":["CircularButton","className","children","disabled","icon","priority","Priority","PRIMARY","type","ControlType","ACCENT","rest","classes","clsx","typeClassMap","priorityClassMap","iconElement","Number","props","size","cloneElement","isTinyViewport","useMedia","Breakpoint","ZOOM_400","_jsxs","_jsx","Circle","as","Body","Typography","BODY_DEFAULT_BOLD"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBMA,MAAAA,cAAc,GAAGA,CAAC;EACtBC,SAAS;EACTC,QAAQ;EACRC,QAAQ;EACRC,IAAI;EACJC,QAAQ,GAAGC,QAAQ,CAACC,OAAO;EAC3BC,IAAI,GAAGC,WAAW,CAACC,MAAM;EACzB,GAAGC,IAAAA;AACiB,CAAA,KAAI;AACxB,EAAA,MAAMC,OAAO,GAAGC,IAAI,CAAC,YAAY,EAAE,OAAO,EAAEC,YAAY,CAACN,IAAI,CAAC,EAAEO,gBAAgB,CAACV,QAAQ,CAAC,CAAC,CAAA;AAE3F,EAAA,MAAMW,WAAW,GAAGC,MAAM,CAACb,IAAI,CAACc,KAAK,CAACC,IAAI,CAAC,KAAK,EAAE,gBAAGC,YAAY,CAAChB,IAAI,EAAE;AAAEe,IAAAA,IAAI,EAAE,EAAA;GAAI,CAAC,GAAGf,IAAI,CAAA;EAE5F,MAAMiB,cAAc,GAAGC,QAAQ,CAAC,eAAeC,UAAU,CAACC,QAAQ,CAAA,GAAA,CAAK,CAAC,CAAA;AAExE,EAAA,oBACEC,IAAA,CAAA,OAAA,EAAA;AAAOxB,IAAAA,SAAS,EAAEY,IAAI,CAAC,iBAAiB,EAAER,QAAQ,EAAEG,IAAI,EAAEL,QAAQ,IAAI,UAAU,EAAEF,SAAS,CAAE;IAAAC,QAAA,EAAA,cAC3FwB,GAAA,CAACC,MAAM,EAAA;AACLC,MAAAA,EAAE,EAAC,OAAA;AACH;AAAA;AACApB,MAAAA,IAAI,EAAC,QAAQ;AACbW,MAAAA,IAAI,EAAEE,cAAc,GAAG,EAAE,GAAG,EAAG;AAC/B,MAAA,YAAA,EAAYnB,QAAS;AACrBD,MAAAA,SAAS,EAAEW,OAAQ;AACnBT,MAAAA,QAAQ,EAAEA,QAAS;MAAA,GACfQ,IAAAA;AAAI,KAEV,CAAA,EAACK,WAAW,eACZU,GAAA,CAACG,IAAI,EAAA;AAACD,MAAAA,EAAE,EAAC,MAAM;AAAC3B,MAAAA,SAAS,EAAC,wBAAwB;MAACO,IAAI,EAAEsB,UAAU,CAACC,iBAAkB;AAAA7B,MAAAA,QAAA,EACnFA,QAAAA;AAAQ,KACL,CACR,CAAA;AAAA,GAAO,CAAC,CAAA;AAEZ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Action.js","sources":["../../../src/common/action/Action.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport Link from '../../link';\nimport { Typography } from '../propsValues/typography';\nimport ActionButton from '../../actionButton';\nimport { Priority } from '../propsValues/control';\n\nexport type ActionOptions = {\n 'aria-label'?: string;\n href?: string;\n target?: string;\n text: React.ReactNode;\n onClick?: () => void;\n};\n\ntype Props = {\n variant?: 'button' | 'action-button';\n action: ActionOptions;\n className?: string;\n};\n\nexport function Action({ action, className, variant = 'button' }: Props) {\n if ('href' in action) {\n return (\n <Link\n href={action.href
|
|
1
|
+
{"version":3,"file":"Action.js","sources":["../../../src/common/action/Action.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport Link from '../../link';\nimport { Typography } from '../propsValues/typography';\nimport ActionButton from '../../actionButton';\nimport { Priority } from '../propsValues/control';\n\nexport type ActionOptions = {\n 'aria-label'?: string;\n href?: string;\n target?: string;\n text: React.ReactNode;\n onClick?: () => void;\n};\n\ntype Props = {\n variant?: 'button' | 'action-button';\n action: ActionOptions;\n className?: string;\n};\n\nexport function Action({ action, className, variant = 'button' }: Props) {\n if ('href' in action) {\n return (\n <Link\n href={action.href}\n className={className}\n aria-label={action['aria-label']}\n target={action.target}\n type={Typography.LINK_LARGE}\n onClick={action.onClick}\n >\n {action.text}\n </Link>\n );\n }\n\n return variant === 'button' ? (\n <button\n type=\"button\"\n aria-label={action['aria-label']}\n className={clsx('btn-unstyled np-text-link-large', className)}\n onClick={action.onClick}\n >\n {action.text}\n </button>\n ) : (\n <ActionButton\n aria-label={action['aria-label']}\n priority={Priority.SECONDARY}\n className={clsx(className)}\n onClick={action.onClick}\n >\n {action.text}\n </ActionButton>\n );\n}\n"],"names":["Action","action","className","variant","_jsx","Link","href","target","type","Typography","LINK_LARGE","onClick","children","text","clsx","ActionButton","priority","Priority","SECONDARY"],"mappings":";;;;;;;;;AAoBM,SAAUA,MAAMA,CAAC;EAAEC,MAAM;EAAEC,SAAS;AAAEC,EAAAA,OAAO,GAAG,QAAA;AAAiB,CAAA,EAAA;EACrE,IAAI,MAAM,IAAIF,MAAM,EAAE;IACpB,oBACEG,cAAA,CAACC,IAAI,EAAA;MACHC,IAAI,EAAEL,MAAM,CAACK,IAAK;AAClBJ,MAAAA,SAAS,EAAEA,SAAU;MACrB,YAAYD,EAAAA,MAAM,CAAC,YAAY,CAAE;MACjCM,MAAM,EAAEN,MAAM,CAACM,MAAO;MACtBC,IAAI,EAAEC,qBAAU,CAACC,UAAW;MAC5BC,OAAO,EAAEV,MAAM,CAACU,OAAQ;MAAAC,QAAA,EAEvBX,MAAM,CAACY,IAAAA;AAAI,KACR,CAAC,CAAA;AAEX,GAAA;AAEA,EAAA,OAAOV,OAAO,KAAK,QAAQ,gBACzBC,cAAA,CAAA,QAAA,EAAA;AACEI,IAAAA,IAAI,EAAC,QAAQ;IACb,YAAYP,EAAAA,MAAM,CAAC,YAAY,CAAE;AACjCC,IAAAA,SAAS,EAAEY,SAAI,CAAC,iCAAiC,EAAEZ,SAAS,CAAE;IAC9DS,OAAO,EAAEV,MAAM,CAACU,OAAQ;IAAAC,QAAA,EAEvBX,MAAM,CAACY,IAAAA;AAAI,GACN,CAAC,gBAETT,cAAA,CAACW,YAAY,EAAA;IACX,YAAYd,EAAAA,MAAM,CAAC,YAAY,CAAE;IACjCe,QAAQ,EAAEC,gBAAQ,CAACC,SAAU;AAC7BhB,IAAAA,SAAS,EAAEY,SAAI,CAACZ,SAAS,CAAE;IAC3BS,OAAO,EAAEV,MAAM,CAACU,OAAQ;IAAAC,QAAA,EAEvBX,MAAM,CAACY,IAAAA;AAAI,GACA,CACf,CAAA;AACH;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Action.mjs","sources":["../../../src/common/action/Action.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport Link from '../../link';\nimport { Typography } from '../propsValues/typography';\nimport ActionButton from '../../actionButton';\nimport { Priority } from '../propsValues/control';\n\nexport type ActionOptions = {\n 'aria-label'?: string;\n href?: string;\n target?: string;\n text: React.ReactNode;\n onClick?: () => void;\n};\n\ntype Props = {\n variant?: 'button' | 'action-button';\n action: ActionOptions;\n className?: string;\n};\n\nexport function Action({ action, className, variant = 'button' }: Props) {\n if ('href' in action) {\n return (\n <Link\n href={action.href
|
|
1
|
+
{"version":3,"file":"Action.mjs","sources":["../../../src/common/action/Action.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport Link from '../../link';\nimport { Typography } from '../propsValues/typography';\nimport ActionButton from '../../actionButton';\nimport { Priority } from '../propsValues/control';\n\nexport type ActionOptions = {\n 'aria-label'?: string;\n href?: string;\n target?: string;\n text: React.ReactNode;\n onClick?: () => void;\n};\n\ntype Props = {\n variant?: 'button' | 'action-button';\n action: ActionOptions;\n className?: string;\n};\n\nexport function Action({ action, className, variant = 'button' }: Props) {\n if ('href' in action) {\n return (\n <Link\n href={action.href}\n className={className}\n aria-label={action['aria-label']}\n target={action.target}\n type={Typography.LINK_LARGE}\n onClick={action.onClick}\n >\n {action.text}\n </Link>\n );\n }\n\n return variant === 'button' ? (\n <button\n type=\"button\"\n aria-label={action['aria-label']}\n className={clsx('btn-unstyled np-text-link-large', className)}\n onClick={action.onClick}\n >\n {action.text}\n </button>\n ) : (\n <ActionButton\n aria-label={action['aria-label']}\n priority={Priority.SECONDARY}\n className={clsx(className)}\n onClick={action.onClick}\n >\n {action.text}\n </ActionButton>\n );\n}\n"],"names":["Action","action","className","variant","_jsx","Link","href","target","type","Typography","LINK_LARGE","onClick","children","text","clsx","ActionButton","priority","Priority","SECONDARY"],"mappings":";;;;;;;AAoBM,SAAUA,MAAMA,CAAC;EAAEC,MAAM;EAAEC,SAAS;AAAEC,EAAAA,OAAO,GAAG,QAAA;AAAiB,CAAA,EAAA;EACrE,IAAI,MAAM,IAAIF,MAAM,EAAE;IACpB,oBACEG,GAAA,CAACC,IAAI,EAAA;MACHC,IAAI,EAAEL,MAAM,CAACK,IAAK;AAClBJ,MAAAA,SAAS,EAAEA,SAAU;MACrB,YAAYD,EAAAA,MAAM,CAAC,YAAY,CAAE;MACjCM,MAAM,EAAEN,MAAM,CAACM,MAAO;MACtBC,IAAI,EAAEC,UAAU,CAACC,UAAW;MAC5BC,OAAO,EAAEV,MAAM,CAACU,OAAQ;MAAAC,QAAA,EAEvBX,MAAM,CAACY,IAAAA;AAAI,KACR,CAAC,CAAA;AAEX,GAAA;AAEA,EAAA,OAAOV,OAAO,KAAK,QAAQ,gBACzBC,GAAA,CAAA,QAAA,EAAA;AACEI,IAAAA,IAAI,EAAC,QAAQ;IACb,YAAYP,EAAAA,MAAM,CAAC,YAAY,CAAE;AACjCC,IAAAA,SAAS,EAAEY,IAAI,CAAC,iCAAiC,EAAEZ,SAAS,CAAE;IAC9DS,OAAO,EAAEV,MAAM,CAACU,OAAQ;IAAAC,QAAA,EAEvBX,MAAM,CAACY,IAAAA;AAAI,GACN,CAAC,gBAETT,GAAA,CAACW,YAAY,EAAA;IACX,YAAYd,EAAAA,MAAM,CAAC,YAAY,CAAE;IACjCe,QAAQ,EAAEC,QAAQ,CAACC,SAAU;AAC7BhB,IAAAA,SAAS,EAAEY,IAAI,CAACZ,SAAS,CAAE;IAC3BS,OAAO,EAAEV,MAAM,CAACU,OAAQ;IAAAC,QAAA,EAEvBX,MAAM,CAACY,IAAAA;AAAI,GACA,CACf,CAAA;AACH;;;;"}
|
|
@@ -6,7 +6,7 @@ var clsx = require('clsx');
|
|
|
6
6
|
var avatarTypes = require('../avatar/avatarTypes.js');
|
|
7
7
|
var Avatar = require('../avatar/Avatar.js');
|
|
8
8
|
var Body = require('../body/Body.js');
|
|
9
|
-
var Button = require('../button/
|
|
9
|
+
var Button = require('../button/Button.js');
|
|
10
10
|
require('../common/theme.js');
|
|
11
11
|
require('../common/direction.js');
|
|
12
12
|
var control = require('../common/propsValues/control.js');
|
|
@@ -4,7 +4,7 @@ import { clsx } from 'clsx';
|
|
|
4
4
|
import { AvatarType } from '../avatar/avatarTypes.mjs';
|
|
5
5
|
import Avatar from '../avatar/Avatar.mjs';
|
|
6
6
|
import Body from '../body/Body.mjs';
|
|
7
|
-
import Button from '../button/
|
|
7
|
+
import Button from '../button/Button.mjs';
|
|
8
8
|
import '../common/theme.mjs';
|
|
9
9
|
import '../common/direction.mjs';
|
|
10
10
|
import { ControlType, Priority } from '../common/propsValues/control.mjs';
|
package/build/header/Header.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var clsx = require('clsx');
|
|
6
|
-
var Button = require('../button/
|
|
6
|
+
var Button = require('../button/Button.js');
|
|
7
7
|
require('../common/theme.js');
|
|
8
8
|
require('../common/direction.js');
|
|
9
9
|
require('../common/propsValues/control.js');
|
package/build/header/Header.mjs
CHANGED
package/build/index.js
CHANGED
|
@@ -21,7 +21,7 @@ require('react/jsx-runtime');
|
|
|
21
21
|
var Image = require('./image/Image.js');
|
|
22
22
|
require('@transferwise/icons');
|
|
23
23
|
var Body = require('./body/Body.js');
|
|
24
|
-
var Button = require('./button/
|
|
24
|
+
var Button = require('./button/Button.js');
|
|
25
25
|
var IconButton = require('./iconButton/IconButton.js');
|
|
26
26
|
var Carousel = require('./carousel/Carousel.js');
|
|
27
27
|
var Card = require('./card/Card.js');
|
package/build/index.mjs
CHANGED
|
@@ -19,7 +19,7 @@ import 'react/jsx-runtime';
|
|
|
19
19
|
export { default as Image } from './image/Image.mjs';
|
|
20
20
|
import '@transferwise/icons';
|
|
21
21
|
export { default as Body } from './body/Body.mjs';
|
|
22
|
-
export { default as Button } from './button/
|
|
22
|
+
export { default as Button } from './button/Button.mjs';
|
|
23
23
|
export { default as IconButton } from './iconButton/IconButton.mjs';
|
|
24
24
|
export { default as Carousel } from './carousel/Carousel.mjs';
|
|
25
25
|
export { default as Card } from './card/Card.mjs';
|
package/build/link/Link.js
CHANGED
|
@@ -3,8 +3,6 @@
|
|
|
3
3
|
var icons = require('@transferwise/icons');
|
|
4
4
|
var clsx = require('clsx');
|
|
5
5
|
var reactIntl = require('react-intl');
|
|
6
|
-
require('../primitives/PrimitiveButton/src/PrimitiveButton.js');
|
|
7
|
-
var PrimitiveAnchor = require('../primitives/PrimitiveAnchor/src/PrimitiveAnchor.js');
|
|
8
6
|
var Link_messages = require('./Link.messages.js');
|
|
9
7
|
var jsxRuntime = require('react/jsx-runtime');
|
|
10
8
|
|
|
@@ -18,17 +16,14 @@ const Link = ({
|
|
|
18
16
|
onClick,
|
|
19
17
|
...props
|
|
20
18
|
}) => {
|
|
19
|
+
const isBlank = target === '_blank';
|
|
21
20
|
const {
|
|
22
21
|
formatMessage
|
|
23
22
|
} = reactIntl.useIntl();
|
|
24
|
-
|
|
25
|
-
const classNames = clsx.clsx('np-link', 'd-inline-flex', {
|
|
26
|
-
[`np-text-${type}`]: type
|
|
27
|
-
}, className);
|
|
28
|
-
return /*#__PURE__*/jsxRuntime.jsxs(PrimitiveAnchor, {
|
|
23
|
+
return /*#__PURE__*/jsxRuntime.jsxs("a", {
|
|
29
24
|
href: href,
|
|
30
25
|
target: target,
|
|
31
|
-
className:
|
|
26
|
+
className: clsx.clsx('np-link', type ? `np-text-${type}` : undefined, 'd-inline-flex', className),
|
|
32
27
|
"aria-label": ariaLabel,
|
|
33
28
|
rel: isBlank ? 'noreferrer' : undefined,
|
|
34
29
|
onClick: onClick,
|
package/build/link/Link.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Link.js","sources":["../../src/link/Link.tsx"],"sourcesContent":["import { NavigateAway as NavigateAwayIcon } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport {
|
|
1
|
+
{"version":3,"file":"Link.js","sources":["../../src/link/Link.tsx"],"sourcesContent":["import { NavigateAway as NavigateAwayIcon } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { AnchorHTMLAttributes } from 'react';\nimport { useIntl } from 'react-intl';\n\nimport { LinkLarge, LinkDefault } from '../common';\n\nimport messages from './Link.messages';\n\nexport type Props = AnchorHTMLAttributes<HTMLAnchorElement> & { type?: LinkLarge | LinkDefault };\n\n/**\n * Standard Link component with navigate away icon\n *\n * Documentation: https://transferwise.github.io/neptune-web/components/content/Link\n */\nconst Link = ({\n className,\n children,\n href,\n target,\n type,\n 'aria-label': ariaLabel,\n onClick,\n ...props\n}: Props) => {\n const isBlank = target === '_blank';\n\n const { formatMessage } = useIntl();\n\n return (\n <a\n href={href}\n target={target}\n className={clsx('np-link', type ? `np-text-${type}` : undefined, 'd-inline-flex', className)}\n aria-label={ariaLabel}\n rel={isBlank ? 'noreferrer' : undefined}\n onClick={onClick}\n {...props}\n >\n {children} {isBlank && <NavigateAwayIcon title={formatMessage(messages.opensInNewTab)} />}\n </a>\n );\n};\n\nexport default Link;\n"],"names":["Link","className","children","href","target","type","ariaLabel","onClick","props","isBlank","formatMessage","useIntl","_jsxs","clsx","undefined","rel","_jsx","NavigateAwayIcon","title","messages","opensInNewTab"],"mappings":";;;;;;;;AAgBMA,MAAAA,IAAI,GAAGA,CAAC;EACZC,SAAS;EACTC,QAAQ;EACRC,IAAI;EACJC,MAAM;EACNC,IAAI;AACJ,EAAA,YAAY,EAAEC,SAAS;EACvBC,OAAO;EACP,GAAGC,KAAAA;AACG,CAAA,KAAI;AACV,EAAA,MAAMC,OAAO,GAAGL,MAAM,KAAK,QAAQ,CAAA;EAEnC,MAAM;AAAEM,IAAAA,aAAAA;GAAe,GAAGC,iBAAO,EAAE,CAAA;AAEnC,EAAA,oBACEC,eAAA,CAAA,GAAA,EAAA;AACET,IAAAA,IAAI,EAAEA,IAAK;AACXC,IAAAA,MAAM,EAAEA,MAAO;AACfH,IAAAA,SAAS,EAAEY,SAAI,CAAC,SAAS,EAAER,IAAI,GAAG,CAAA,QAAA,EAAWA,IAAI,CAAA,CAAE,GAAGS,SAAS,EAAE,eAAe,EAAEb,SAAS,CAAE;AAC7F,IAAA,YAAA,EAAYK,SAAU;AACtBS,IAAAA,GAAG,EAAEN,OAAO,GAAG,YAAY,GAAGK,SAAU;AACxCP,IAAAA,OAAO,EAAEA,OAAQ;AAAA,IAAA,GACbC,KAAK;IAAAN,QAAA,EAAA,CAERA,QAAQ,EAAE,GAAA,EAACO,OAAO,iBAAIO,cAAA,CAACC,kBAAgB,EAAA;AAACC,MAAAA,KAAK,EAAER,aAAa,CAACS,aAAQ,CAACC,aAAa,CAAA;AAAE,MAAG,CAAA;AAAA,GACxF,CAAC,CAAA;AAER;;;;"}
|
package/build/link/Link.mjs
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { NavigateAway } from '@transferwise/icons';
|
|
2
2
|
import { clsx } from 'clsx';
|
|
3
3
|
import { useIntl } from 'react-intl';
|
|
4
|
-
import '../primitives/PrimitiveButton/src/PrimitiveButton.mjs';
|
|
5
|
-
import PrimitiveAnchor from '../primitives/PrimitiveAnchor/src/PrimitiveAnchor.mjs';
|
|
6
4
|
import messages from './Link.messages.mjs';
|
|
7
5
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
8
6
|
|
|
@@ -16,17 +14,14 @@ const Link = ({
|
|
|
16
14
|
onClick,
|
|
17
15
|
...props
|
|
18
16
|
}) => {
|
|
17
|
+
const isBlank = target === '_blank';
|
|
19
18
|
const {
|
|
20
19
|
formatMessage
|
|
21
20
|
} = useIntl();
|
|
22
|
-
|
|
23
|
-
const classNames = clsx('np-link', 'd-inline-flex', {
|
|
24
|
-
[`np-text-${type}`]: type
|
|
25
|
-
}, className);
|
|
26
|
-
return /*#__PURE__*/jsxs(PrimitiveAnchor, {
|
|
21
|
+
return /*#__PURE__*/jsxs("a", {
|
|
27
22
|
href: href,
|
|
28
23
|
target: target,
|
|
29
|
-
className:
|
|
24
|
+
className: clsx('np-link', type ? `np-text-${type}` : undefined, 'd-inline-flex', className),
|
|
30
25
|
"aria-label": ariaLabel,
|
|
31
26
|
rel: isBlank ? 'noreferrer' : undefined,
|
|
32
27
|
onClick: onClick,
|
package/build/link/Link.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Link.mjs","sources":["../../src/link/Link.tsx"],"sourcesContent":["import { NavigateAway as NavigateAwayIcon } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport {
|
|
1
|
+
{"version":3,"file":"Link.mjs","sources":["../../src/link/Link.tsx"],"sourcesContent":["import { NavigateAway as NavigateAwayIcon } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { AnchorHTMLAttributes } from 'react';\nimport { useIntl } from 'react-intl';\n\nimport { LinkLarge, LinkDefault } from '../common';\n\nimport messages from './Link.messages';\n\nexport type Props = AnchorHTMLAttributes<HTMLAnchorElement> & { type?: LinkLarge | LinkDefault };\n\n/**\n * Standard Link component with navigate away icon\n *\n * Documentation: https://transferwise.github.io/neptune-web/components/content/Link\n */\nconst Link = ({\n className,\n children,\n href,\n target,\n type,\n 'aria-label': ariaLabel,\n onClick,\n ...props\n}: Props) => {\n const isBlank = target === '_blank';\n\n const { formatMessage } = useIntl();\n\n return (\n <a\n href={href}\n target={target}\n className={clsx('np-link', type ? `np-text-${type}` : undefined, 'd-inline-flex', className)}\n aria-label={ariaLabel}\n rel={isBlank ? 'noreferrer' : undefined}\n onClick={onClick}\n {...props}\n >\n {children} {isBlank && <NavigateAwayIcon title={formatMessage(messages.opensInNewTab)} />}\n </a>\n );\n};\n\nexport default Link;\n"],"names":["Link","className","children","href","target","type","ariaLabel","onClick","props","isBlank","formatMessage","useIntl","_jsxs","clsx","undefined","rel","_jsx","NavigateAwayIcon","title","messages","opensInNewTab"],"mappings":";;;;;;AAgBMA,MAAAA,IAAI,GAAGA,CAAC;EACZC,SAAS;EACTC,QAAQ;EACRC,IAAI;EACJC,MAAM;EACNC,IAAI;AACJ,EAAA,YAAY,EAAEC,SAAS;EACvBC,OAAO;EACP,GAAGC,KAAAA;AACG,CAAA,KAAI;AACV,EAAA,MAAMC,OAAO,GAAGL,MAAM,KAAK,QAAQ,CAAA;EAEnC,MAAM;AAAEM,IAAAA,aAAAA;GAAe,GAAGC,OAAO,EAAE,CAAA;AAEnC,EAAA,oBACEC,IAAA,CAAA,GAAA,EAAA;AACET,IAAAA,IAAI,EAAEA,IAAK;AACXC,IAAAA,MAAM,EAAEA,MAAO;AACfH,IAAAA,SAAS,EAAEY,IAAI,CAAC,SAAS,EAAER,IAAI,GAAG,CAAA,QAAA,EAAWA,IAAI,CAAA,CAAE,GAAGS,SAAS,EAAE,eAAe,EAAEb,SAAS,CAAE;AAC7F,IAAA,YAAA,EAAYK,SAAU;AACtBS,IAAAA,GAAG,EAAEN,OAAO,GAAG,YAAY,GAAGK,SAAU;AACxCP,IAAAA,OAAO,EAAEA,OAAQ;AAAA,IAAA,GACbC,KAAK;IAAAN,QAAA,EAAA,CAERA,QAAQ,EAAE,GAAA,EAACO,OAAO,iBAAIO,GAAA,CAACC,YAAgB,EAAA;AAACC,MAAAA,KAAK,EAAER,aAAa,CAACS,QAAQ,CAACC,aAAa,CAAA;AAAE,MAAG,CAAA;AAAA,GACxF,CAAC,CAAA;AAER;;;;"}
|