@transferwise/components 0.0.0-experimental-8a932bb → 0.0.0-experimental-090123d

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.
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","sources":["../../../src/button/src/Button.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unsafe-assignment */\nimport { forwardRef } from 'react';\nimport LegacyButton, { ButtonProps as LegacyButtonProps } from '../LegacyButton';\nimport NewButton from '../Button';\nimport { ButtonProps as NewButtonProps } from '../Button/src/Button.types';\n\ntype LegacyButtonType =\n | 'accent'\n | 'negative'\n | 'positive'\n | 'primary'\n | 'pay'\n | 'secondary'\n | 'danger'\n | 'link'\n | null\n | undefined;\ntype NewButtonType = 'button' | 'submit' | 'reset' | LegacyButtonType | undefined;\n\nexport type ButtonProps =\n | (Omit<LegacyButtonProps, 'ref'> & {\n type?: LegacyButtonType;\n htmlType?: string;\n useNewButton?: false;\n href?: string;\n ref?: React.Ref<HTMLButtonElement | HTMLAnchorElement>;\n })\n | (Omit<Omit<NewButtonProps, 'type'>, 'ref'> & {\n type?: NewButtonType;\n useNewButton: true;\n href?: string;\n ref?: React.Ref<HTMLButtonElement | HTMLAnchorElement>;\n });\n\nconst mapProps = (props: LegacyButtonProps): NewButtonProps => {\n const { priority, size, type, as, ...newProps } = props;\n\n const priorityMapping: Record<string, Record<string, NewButtonProps['priority']>> = {\n accent: {\n primary: 'primary',\n secondary: 'tertiary',\n tertiary: 'minimal',\n },\n positive: {\n primary: 'primary',\n secondary: 'tertiary',\n tertiary: 'tertiary',\n },\n negative: {\n primary: 'primary',\n secondary: 'secondary',\n tertiary: 'secondary',\n },\n };\n\n const mappedPriority =\n type && priority ? priorityMapping[type]?.[priority] || priority : priority || null;\n const mappedAppearance = type === 'negative' ? 'negative' : null;\n\n const legacyButtonTypes: LegacyButtonType[] = [\n 'accent',\n 'negative',\n 'positive',\n 'primary',\n 'pay',\n 'secondary',\n 'danger',\n 'link',\n ];\n\n return {\n ...newProps,\n size:\n size === 'xs' || size === 'sm' ? 'sm' : size === 'md' ? 'md' : size === 'lg' ? 'lg' : size,\n priority: mappedPriority,\n appearance: mappedAppearance || ('appearance' in props ? props.appearance : null),\n type:\n type && !legacyButtonTypes.includes(type as LegacyButtonType) ? type : props.htmlType || null,\n href: as === 'a' ? props.href || '' : null,\n } as NewButtonProps;\n};\n\nconst Button = forwardRef<HTMLButtonElement | HTMLAnchorElement, ButtonProps>((props, ref) => {\n const { useNewButton, as, ...rest } = props;\n\n if (useNewButton) {\n const mappedProps = mapProps(props as LegacyButtonProps);\n return (\n <NewButton\n {...mappedProps}\n ref={ref as React.Ref<HTMLButtonElement | HTMLAnchorElement>}\n as={as}\n />\n );\n }\n\n if (as === 'a') {\n return (\n <LegacyButton\n {...(rest as LegacyButtonProps & React.AnchorHTMLAttributes<HTMLAnchorElement>)}\n ref={ref as React.Ref<HTMLAnchorElement>}\n as=\"a\"\n />\n );\n }\n\n return (\n <LegacyButton\n {...(rest as LegacyButtonProps & React.ButtonHTMLAttributes<HTMLButtonElement>)}\n ref={ref as React.Ref<HTMLButtonElement>}\n as=\"button\"\n />\n );\n});\n\nButton.displayName = 'Button';\n\nexport default Button;\n"],"names":["mapProps","props","priority","size","type","as","newProps","priorityMapping","accent","primary","secondary","tertiary","positive","negative","mappedPriority","mappedAppearance","legacyButtonTypes","appearance","includes","htmlType","href","Button","forwardRef","ref","useNewButton","rest","mappedProps","_jsx","NewButton","LegacyButton","displayName"],"mappings":";;;;;;;AAAA;AAkCA,MAAMA,QAAQ,GAAIC,KAAwB,IAAoB;EAC5D,MAAM;IAAEC,QAAQ;IAAEC,IAAI;IAAEC,IAAI;IAAEC,EAAE;IAAE,GAAGC,QAAAA;AAAU,GAAA,GAAGL,KAAK,CAAA;AAEvD,EAAA,MAAMM,eAAe,GAA+D;AAClFC,IAAAA,MAAM,EAAE;AACNC,MAAAA,OAAO,EAAE,SAAS;AAClBC,MAAAA,S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B,IAAI,IAAI,EAAE,GAAG,IAAA;GACrB,CAAA;AACrB,CAAC,CAAA;AAEKC,MAAAA,MAAM,gBAAGC,gBAAU,CAAqD,CAACrB,KAAK,EAAEsB,GAAG,KAAI;EAC3F,MAAM;IAAEC,YAAY;IAAEnB,EAAE;IAAE,GAAGoB,IAAAA;AAAI,GAAE,GAAGxB,KAAK,CAAA;AAE3C,EAAA,IAAIuB,YAAY,EAAE;AAChB,IAAA,MAAME,WAAW,GAAG1B,QAAQ,CAACC,KAA0B,CAAC,CAAA;IACxD,oBACE0B,cAAA,CAACC,QAAS,EAAA;AAAA,MAAA,GACJF,WAAW;AACfH,MAAAA,GAAG,EAAEA,GAAwD;AAC7DlB,MAAAA,EAAE,EAAEA,EAAAA;AAAG,KACP,CAAA,CAAA;AAEN,GAAA;EAEA,IAAIA,EAAE,KAAK,GAAG,EAAE;IACd,oBACEsB,cAAA,CAACE,QAAY,EAAA;AAAA,MAAA,GACNJ,IAA0E;AAC/EF,MAAAA,GAAG,EAAEA,GAAoC;AACzClB,MAAAA,EAAE,EAAC,GAAA;AAAG,KAAA,CACN,CAAA;AAEN,GAAA;EAEA,oBACEsB,cAAA,CAACE,QAAY,EAAA;AAAA,IAAA,GACNJ,IAA0E;AAC/EF,IAAAA,GAAG,EAAEA,GAAoC;AACzClB,IAAAA,EAAE,EAAC,QAAA;AAAQ,GAAA,CACX,CAAA;AAEN,CAAC,EAAC;AAEFgB,MAAM,CAACS,WAAW,GAAG,QAAQ;;;;"}
1
+ {"version":3,"file":"Button.js","sources":["../../../src/button/src/Button.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unsafe-assignment */\nimport { forwardRef } from 'react';\nimport LegacyButton, { ButtonProps as LegacyButtonProps } from '../LegacyButton';\nimport NewButton from '../Button';\nimport { ButtonProps as NewButtonProps } from '../Button/src/Button.types';\n\ntype LegacyButtonType =\n | 'accent'\n | 'negative'\n | 'positive'\n | 'primary'\n | 'pay'\n | 'secondary'\n | 'danger'\n | 'link'\n | null\n | undefined;\ntype NewButtonType = 'button' | 'submit' | 'reset' | LegacyButtonType | undefined;\n\nexport type ButtonProps =\n | (Omit<LegacyButtonProps, 'ref'> & {\n type?: LegacyButtonType;\n htmlType?: string;\n useNewButton?: false;\n href?: string;\n target?: string;\n ref?: React.Ref<HTMLButtonElement | HTMLAnchorElement>;\n })\n | (Omit<Omit<NewButtonProps, 'type'>, 'ref'> & {\n type?: NewButtonType;\n useNewButton: true;\n href?: string;\n target?: string;\n ref?: React.Ref<HTMLButtonElement | HTMLAnchorElement>;\n });\n\nconst mapProps = (props: LegacyButtonProps): NewButtonProps => {\n const { priority, size, type, as, ...newProps } = props;\n\n const priorityMapping: Record<string, Record<string, NewButtonProps['priority']>> = {\n accent: {\n primary: 'primary',\n secondary: 'tertiary',\n tertiary: 'minimal',\n },\n positive: {\n primary: 'primary',\n secondary: 'tertiary',\n tertiary: 'tertiary',\n },\n negative: {\n primary: 'primary',\n secondary: 'secondary',\n tertiary: 'secondary',\n },\n };\n\n const mappedPriority =\n type && priority ? priorityMapping[type]?.[priority] || priority : priority || null;\n const mappedAppearance = type === 'negative' ? 'negative' : null;\n\n const legacyButtonTypes: LegacyButtonType[] = [\n 'accent',\n 'negative',\n 'positive',\n 'primary',\n 'pay',\n 'secondary',\n 'danger',\n 'link',\n ];\n\n return {\n ...newProps,\n size:\n size === 'xs' || size === 'sm' ? 'sm' : size === 'md' ? 'md' : size === 'lg' ? 'lg' : size,\n priority: mappedPriority,\n appearance: mappedAppearance || ('appearance' in props ? props.appearance : null),\n type:\n type && !legacyButtonTypes.includes(type as LegacyButtonType) ? type : props.htmlType || null,\n href: as === 'a' ? props.href || '' : null,\n } as NewButtonProps;\n};\n\nconst Button = forwardRef<HTMLButtonElement | HTMLAnchorElement, ButtonProps>((props, ref) => {\n const { useNewButton, as, ...rest } = props;\n\n if (useNewButton) {\n const mappedProps = mapProps(props as LegacyButtonProps);\n return (\n <NewButton\n {...mappedProps}\n ref={ref as React.Ref<HTMLButtonElement | HTMLAnchorElement>}\n as={as}\n />\n );\n }\n\n if (as === 'a') {\n return (\n <LegacyButton\n {...(rest as LegacyButtonProps & React.AnchorHTMLAttributes<HTMLAnchorElement>)}\n ref={ref as React.Ref<HTMLAnchorElement>}\n as=\"a\"\n />\n );\n }\n\n return (\n <LegacyButton\n {...(rest as LegacyButtonProps & React.ButtonHTMLAttributes<HTMLButtonElement>)}\n ref={ref as React.Ref<HTMLButtonElement>}\n as=\"button\"\n />\n );\n});\n\nButton.displayName = 'Button';\n\nexport default Button;\n"],"names":["mapProps","props","priority","size","type","as","newProps","priorityMapping","accent","primary","secondary","tertiary","positive","negative","mappedPriority","mappedAppearance","legacyButtonTypes","appearance","includes","htmlType","href","Button","forwardRef","ref","useNewButton","rest","mappedProps","_jsx","NewButton","LegacyButton","displayName"],"mappings":";;;;;;;AAAA;AAoCA,MAAMA,QAAQ,GAAIC,KAAwB,IAAoB;EAC5D,MAAM;IAAEC,QAAQ;IAAEC,IAAI;IAAEC,IAAI;IAAEC,EAAE;IAAE,GAAGC,QAAAA;AAAU,GAAA,GAAGL,KAAK,CAAA;AAEvD,EAAA,MAAMM,eAAe,GAA+D;AAClFC,IAAAA,MAAM,EAAE;AACNC,MAAAA,OAAO,EAAE,SAAS;AAClBC,MAAAA,SAAS,EAAE,UAAU;AACrBC,MAAAA,QAAQ,EAAE,SAAA;KACX;AACDC,IAAAA,QAAQ,EAAE;AACRH,MAAAA,OAAO,EAAE,SAAS;AAClBC,MAAAA,SAAS,EAAE,UAAU;AACrBC,MAAAA,QAAQ,EAAE,UAAA;KACX;AACDE,IAAAA,QAAQ,EAAE;AACRJ,MAAAA,OAAO,EAAE,SAAS;AAClBC,MAAAA,SAAS,EAAE,WAAW;AACtBC,MAAAA,QAAQ,EAAE,WAAA;AACX,KAAA;GACF,CAAA;AAED,EAAA,MAAMG,cAAc,GAClBV,IAAI,IAAIF,QAAQ,GAAGK,eAAe,CAACH,IAAI,CAAC,GAAGF,QAAQ,C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AAC7DlB,MAAAA,EAAE,EAAEA,EAAAA;AAAG,KACP,CAAA,CAAA;AAEN,GAAA;EAEA,IAAIA,EAAE,KAAK,GAAG,EAAE;IACd,oBACEsB,cAAA,CAACE,QAAY,EAAA;AAAA,MAAA,GACNJ,IAA0E;AAC/EF,MAAAA,GAAG,EAAEA,GAAoC;AACzClB,MAAAA,EAAE,EAAC,GAAA;AAAG,KAAA,CACN,CAAA;AAEN,GAAA;EAEA,oBACEsB,cAAA,CAACE,QAAY,EAAA;AAAA,IAAA,GACNJ,IAA0E;AAC/EF,IAAAA,GAAG,EAAEA,GAAoC;AACzClB,IAAAA,EAAE,EAAC,QAAA;AAAQ,GAAA,CACX,CAAA;AAEN,CAAC,EAAC;AAEFgB,MAAM,CAACS,WAAW,GAAG,QAAQ;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Button.mjs","sources":["../../../src/button/src/Button.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unsafe-assignment */\nimport { forwardRef } from 'react';\nimport LegacyButton, { ButtonProps as LegacyButtonProps } from '../LegacyButton';\nimport NewButton from '../Button';\nimport { ButtonProps as NewButtonProps } from '../Button/src/Button.types';\n\ntype LegacyButtonType =\n | 'accent'\n | 'negative'\n | 'positive'\n | 'primary'\n | 'pay'\n | 'secondary'\n | 'danger'\n | 'link'\n | null\n | undefined;\ntype NewButtonType = 'button' | 'submit' | 'reset' | LegacyButtonType | undefined;\n\nexport type ButtonProps =\n | (Omit<LegacyButtonProps, 'ref'> & {\n type?: LegacyButtonType;\n htmlType?: string;\n useNewButton?: false;\n href?: string;\n ref?: React.Ref<HTMLButtonElement | HTMLAnchorElement>;\n })\n | (Omit<Omit<NewButtonProps, 'type'>, 'ref'> & {\n type?: NewButtonType;\n useNewButton: true;\n href?: string;\n ref?: React.Ref<HTMLButtonElement | HTMLAnchorElement>;\n });\n\nconst mapProps = (props: LegacyButtonProps): NewButtonProps => {\n const { priority, size, type, as, ...newProps } = props;\n\n const priorityMapping: Record<string, Record<string, NewButtonProps['priority']>> = {\n accent: {\n primary: 'primary',\n secondary: 'tertiary',\n tertiary: 'minimal',\n },\n positive: {\n primary: 'primary',\n secondary: 'tertiary',\n tertiary: 'tertiary',\n },\n negative: {\n primary: 'primary',\n secondary: 'secondary',\n tertiary: 'secondary',\n },\n };\n\n const mappedPriority =\n type && priority ? priorityMapping[type]?.[priority] || priority : priority || null;\n const mappedAppearance = type === 'negative' ? 'negative' : null;\n\n const legacyButtonTypes: LegacyButtonType[] = [\n 'accent',\n 'negative',\n 'positive',\n 'primary',\n 'pay',\n 'secondary',\n 'danger',\n 'link',\n ];\n\n return {\n ...newProps,\n size:\n size === 'xs' || size === 'sm' ? 'sm' : size === 'md' ? 'md' : size === 'lg' ? 'lg' : size,\n priority: mappedPriority,\n appearance: mappedAppearance || ('appearance' in props ? props.appearance : null),\n type:\n type && !legacyButtonTypes.includes(type as LegacyButtonType) ? type : props.htmlType || null,\n href: as === 'a' ? props.href || '' : null,\n } as NewButtonProps;\n};\n\nconst Button = forwardRef<HTMLButtonElement | HTMLAnchorElement, ButtonProps>((props, ref) => {\n const { useNewButton, as, ...rest } = props;\n\n if (useNewButton) {\n const mappedProps = mapProps(props as LegacyButtonProps);\n return (\n <NewButton\n {...mappedProps}\n ref={ref as React.Ref<HTMLButtonElement | HTMLAnchorElement>}\n as={as}\n />\n );\n }\n\n if (as === 'a') {\n return (\n <LegacyButton\n {...(rest as LegacyButtonProps & React.AnchorHTMLAttributes<HTMLAnchorElement>)}\n ref={ref as React.Ref<HTMLAnchorElement>}\n as=\"a\"\n />\n );\n }\n\n return (\n <LegacyButton\n {...(rest as LegacyButtonProps & React.ButtonHTMLAttributes<HTMLButtonElement>)}\n ref={ref as React.Ref<HTMLButtonElement>}\n as=\"button\"\n />\n );\n});\n\nButton.displayName = 'Button';\n\nexport default Button;\n"],"names":["mapProps","props","priority","size","type","as","newProps","priorityMapping","accent","primary","secondary","tertiary","positive","negative","mappedPriority","mappedAppearance","legacyButtonTypes","appearance","includes","htmlType","href","Button","forwardRef","ref","useNewButton","rest","mappedProps","_jsx","NewButton","LegacyButton","displayName"],"mappings":";;;;;AAAA;AAkCA,MAAMA,QAAQ,GAAIC,KAAwB,IAAoB;EAC5D,MAAM;IAAEC,QAAQ;IAAEC,IAAI;IAAEC,IAAI;IAAEC,EAAE;IAAE,GAAGC,QAAAA;AAAU,GAAA,GAAGL,KAAK,CAAA;AAEvD,EAAA,MAAMM,eAAe,GAA+D;AAClFC,IAAAA,MAAM,EAAE;AACNC,MAAAA,OAAO,EAAE,SAAS;AAClBC,MAAAA,SAAS,EAAE,UAAU;AACrBC,MAAAA,QAAQ,EAAE,SAAA;KACX;AACDC,IAAAA,QAAQ,EAAE;AACRH,MAAAA,OAAO,EAAE,SAAS;AAClBC,MAAAA,SAAS,EAAE,UAAU;AACrBC,MAAAA,QAAQ,EAAE,UAAA;KACX;AACDE,IAAAA,QAAQ,EAAE;AACRJ,MAAAA,OAAO,EAAE,SAAS;AAClBC,MAAAA,SAAS,EAAE,WAAW;AACtBC,MAAAA,QAAQ,EAAE,WAAA;AACX,KAAA;GACF,CAAA;AAED,EAAA,MAAMG,cAAc,GAClBV,IAAI,IAAIF,QAAQ,GAAGK,eAAe,CAACH,IAAI,CAAC,GAAGF,QAAQ,CAAC,IAAIA,QAAQ,GAAGA,QAAQ,IAAI,IAAI,CAAA;EACrF,MAAMa,gBAAgB,GAAGX,IAAI,KAAK,UAAU,GAAG,UAAU,GAAG,IAAI,CAAA;AAEhE,EAAA,MAAMY,iBAAiB,GAAuB,CAC5C,QAAQ,EACR,UAAU,EACV,UAAU,EACV,SAAS,EACT,KAAK,EACL,WAAW,EACX,QAAQ,EACR,MAAM,CACP,CAAA;EAED,OAAO;AACL,IAAA,GAAGV,QAAQ;IACXH,IAAI,EACFA,IAAI,KAAK,IAAI,IAAIA,IAAI,KAAK,IAAI,GAAG,IAAI,GAAGA,IAAI,KAAK,IAAI,GAAG,IAAI,GAAGA,IAAI,KAAK,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AAEN,CAAC,EAAC;AAEFgB,MAAM,CAACS,WAAW,GAAG,QAAQ;;;;"}
1
+ {"version":3,"file":"Button.mjs","sources":["../../../src/button/src/Button.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unsafe-assignment */\nimport { forwardRef } from 'react';\nimport LegacyButton, { ButtonProps as LegacyButtonProps } from '../LegacyButton';\nimport NewButton from '../Button';\nimport { ButtonProps as NewButtonProps } from '../Button/src/Button.types';\n\ntype LegacyButtonType =\n | 'accent'\n | 'negative'\n | 'positive'\n | 'primary'\n | 'pay'\n | 'secondary'\n | 'danger'\n | 'link'\n | null\n | undefined;\ntype NewButtonType = 'button' | 'submit' | 'reset' | LegacyButtonType | undefined;\n\nexport type ButtonProps =\n | (Omit<LegacyButtonProps, 'ref'> & {\n type?: LegacyButtonType;\n htmlType?: string;\n useNewButton?: false;\n href?: string;\n target?: string;\n ref?: React.Ref<HTMLButtonElement | HTMLAnchorElement>;\n })\n | (Omit<Omit<NewButtonProps, 'type'>, 'ref'> & {\n type?: NewButtonType;\n useNewButton: true;\n href?: string;\n target?: string;\n ref?: React.Ref<HTMLButtonElement | HTMLAnchorElement>;\n });\n\nconst mapProps = (props: LegacyButtonProps): NewButtonProps => {\n const { priority, size, type, as, ...newProps } = props;\n\n const priorityMapping: Record<string, Record<string, NewButtonProps['priority']>> = {\n accent: {\n primary: 'primary',\n secondary: 'tertiary',\n tertiary: 'minimal',\n },\n positive: {\n primary: 'primary',\n secondary: 'tertiary',\n tertiary: 'tertiary',\n },\n negative: {\n primary: 'primary',\n secondary: 'secondary',\n tertiary: 'secondary',\n },\n };\n\n const mappedPriority =\n type && priority ? priorityMapping[type]?.[priority] || priority : priority || null;\n const mappedAppearance = type === 'negative' ? 'negative' : null;\n\n const legacyButtonTypes: LegacyButtonType[] = [\n 'accent',\n 'negative',\n 'positive',\n 'primary',\n 'pay',\n 'secondary',\n 'danger',\n 'link',\n ];\n\n return {\n ...newProps,\n size:\n size === 'xs' || size === 'sm' ? 'sm' : size === 'md' ? 'md' : size === 'lg' ? 'lg' : size,\n priority: mappedPriority,\n appearance: mappedAppearance || ('appearance' in props ? props.appearance : null),\n type:\n type && !legacyButtonTypes.includes(type as LegacyButtonType) ? type : props.htmlType || null,\n href: as === 'a' ? props.href || '' : null,\n } as NewButtonProps;\n};\n\nconst Button = forwardRef<HTMLButtonElement | HTMLAnchorElement, ButtonProps>((props, ref) => {\n const { useNewButton, as, ...rest } = props;\n\n if (useNewButton) {\n const mappedProps = mapProps(props as LegacyButtonProps);\n return (\n <NewButton\n {...mappedProps}\n ref={ref as React.Ref<HTMLButtonElement | HTMLAnchorElement>}\n as={as}\n />\n );\n }\n\n if (as === 'a') {\n return (\n <LegacyButton\n {...(rest as LegacyButtonProps & React.AnchorHTMLAttributes<HTMLAnchorElement>)}\n ref={ref as React.Ref<HTMLAnchorElement>}\n as=\"a\"\n />\n );\n }\n\n return (\n <LegacyButton\n {...(rest as LegacyButtonProps & React.ButtonHTMLAttributes<HTMLButtonElement>)}\n ref={ref as React.Ref<HTMLButtonElement>}\n as=\"button\"\n />\n );\n});\n\nButton.displayName = 'Button';\n\nexport default Button;\n"],"names":["mapProps","props","priority","size","type","as","newProps","priorityMapping","accent","primary","secondary","tertiary","positive","negative","mappedPriority","mappedAppearance","legacyButtonTypes","appearance","includes","htmlType","href","Button","forwardRef","ref","useNewButton","rest","mappedProps","_jsx","NewButton","LegacyButton","displayName"],"mappings":";;;;;AAAA;AAoCA,MAAMA,QAAQ,GAAIC,KAAwB,IAAoB;EAC5D,MAAM;IAAEC,QAAQ;IAAEC,IAAI;IAAEC,IAAI;IAAEC,EAAE;IAAE,GAAGC,QAAAA;AAAU,GAAA,GAAGL,KAAK,CAAA;AAEvD,EAAA,MAAMM,eAAe,GAA+D;AAClFC,IAAAA,MAAM,EAAE;AACNC,MAAAA,OAAO,EAAE,SAAS;AAClBC,MAAAA,SAAS,EAAE,UAAU;AACrBC,MAAAA,QAAQ,EAAE,SAAA;KACX;AACDC,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;AAEKC,MAAAA,MAAM,gBAAGC,UAAU,CAAqD,CAACrB,KAAK,EAAEsB,GAAG,KAAI;EAC3F,MAAM;IAAEC,YAAY;IAAEnB,EAAE;IAAE,GAAGoB,IAAAA;AAAI,GAAE,GAAGxB,KAAK,CAAA;AAE3C,EAAA,IAAIuB,YAAY,EAAE;AAChB,IAAA,MAAME,WAAW,GAAG1B,QAAQ,CAACC,KAA0B,CAAC,CAAA;IACxD,oBACE0B,GAAA,CAACC,QAAS,EAAA;AAAA,MAAA,GACJF,WAAW;AACfH,MAAAA,GAAG,EAAEA,GAAwD;AAC7DlB,MAAAA,EAAE,EAAEA,EAAAA;AAAG,KACP,CAAA,CAAA;AAEN,GAAA;EAEA,IAAIA,EAAE,KAAK,GAAG,EAAE;IACd,oBACEsB,GAAA,CAACE,QAAY,EAAA;AAAA,MAAA,GACNJ,IAA0E;AAC/EF,MAAAA,GAAG,EAAEA,GAAoC;AACzClB,MAAAA,EAAE,EAAC,GAAA;AAAG,KAAA,CACN,CAAA;AAEN,GAAA;EAEA,oBACEsB,GAAA,CAACE,QAAY,EAAA;AAAA,IAAA,GACNJ,IAA0E;AAC/EF,IAAAA,GAAG,EAAEA,GAAoC;AACzClB,IAAAA,EAAE,EAAC,QAAA;AAAQ,GAAA,CACX,CAAA;AAEN,CAAC,EAAC;AAEFgB,MAAM,CAACS,WAAW,GAAG,QAAQ;;;;"}
@@ -11,7 +11,7 @@ export type ButtonRefType = PrimitiveButtonElementRef | PrimitiveAnchorElementRe
11
11
  */
12
12
  export interface CommonButtonProps {
13
13
  /** The HTML element to render */
14
- as?: 'button' | 'a';
14
+ as?: 'button' | 'a' | null;
15
15
  /** Additional class name(s) to apply to the button */
16
16
  className?: string;
17
17
  /** Content to be displayed inside the button */
@@ -1 +1 @@
1
- {"version":3,"file":"Button.types.d.ts","sourceRoot":"","sources":["../../../../../src/button/Button/src/Button.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,C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AAC;IAElB,wEAAwE;IACxE,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB,yBAAyB;IACzB,IAAI,CAAC,EAAE,UAAU,CAAC;IAElB;;;OAGG;IACH,QAAQ,CAAC,EAAE,cAAc,CAAC;IAE1B;;;OAGG;IACH,UAAU,CAAC,EAAE,eAAe,CAAC;IAE7B,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;IAE7B,2DAA2D;IAC3D,SAAS,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;IAE9B,2DAA2D;IAC3D,OAAO,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAE7B,iDAAiD;IACjD,GAAG,CAAC,EAAE,aAAa,CAAC;CACrB;AAED,MAAM,MAAM,kBAAkB,GAAG,oBAAoB,GAAG,iBAAiB,CAAC;AAC1E,MAAM,MAAM,kBAAkB,GAAG,oBAAoB,GAAG,iBAAiB,CAAC;AAC1E,MAAM,MAAM,WAAW,GAAG,kBAAkB,GAAG,kBAAkB,CAAC"}
@@ -7,11 +7,13 @@ export type ButtonProps = (Omit<LegacyButtonProps, 'ref'> & {
7
7
  htmlType?: string;
8
8
  useNewButton?: false;
9
9
  href?: string;
10
+ target?: string;
10
11
  ref?: React.Ref<HTMLButtonElement | HTMLAnchorElement>;
11
12
  }) | (Omit<Omit<NewButtonProps, 'type'>, 'ref'> & {
12
13
  type?: NewButtonType;
13
14
  useNewButton: true;
14
15
  href?: string;
16
+ target?: string;
15
17
  ref?: React.Ref<HTMLButtonElement | HTMLAnchorElement>;
16
18
  });
17
19
  declare const Button: import("react").ForwardRefExoticComponent<(Omit<Omit<LegacyButtonProps, "ref"> & {
@@ -19,11 +21,13 @@ declare const Button: import("react").ForwardRefExoticComponent<(Omit<Omit<Legac
19
21
  htmlType?: string;
20
22
  useNewButton?: false;
21
23
  href?: string;
24
+ target?: string;
22
25
  ref?: React.Ref<HTMLButtonElement | HTMLAnchorElement>;
23
26
  }, "ref"> | Omit<Omit<Omit<NewButtonProps, "type">, "ref"> & {
24
27
  type?: NewButtonType;
25
28
  useNewButton: true;
26
29
  href?: string;
30
+ target?: string;
27
31
  ref?: React.Ref<HTMLButtonElement | HTMLAnchorElement>;
28
32
  }, "ref">) & import("react").RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
29
33
  export default Button;
@@ -1 +1 @@
1
- {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/button/src/Button.tsx"],"names":[],"mappings":"AAEA,OAAqB,EAAE,WAAW,IAAI,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEjF,OAAO,EAAE,WAAW,IAAI,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE3E,KAAK,gBAAgB,GACjB,QAAQ,GACR,UAAU,GACV,UAAU,GACV,SAAS,GACT,KAAK,GACL,WAAW,GACX,QAAQ,GACR,MAAM,GACN,IAAI,GACJ,SAAS,CAAC;AACd,KAAK,aAAa,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,GAAG,gBAAgB,GAAG,SAAS,CAAC;AAElF,MAAM,MAAM,WAAW,GACnB,CAAC,IAAI,CAAC,iBAAiB,EAAE,KAAK,CAAC,GAAG;IAChC,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,KAAK,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,GAAG,iBAAiB,CAAC,CAAC;CACxD,CAAC,GACF,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG;IAC3C,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,YAAY,EAAE,IAAI,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,GAAG,iBAAi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AE,IAAI,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,GAAG,iBAAiB,CAAC,CAAC;CACxD,CAAC,CAAC;AAkDP,QAAA,MAAM,MAAM;WA/DC,gBAAgB;eACZ,MAAM;mBACF,KAAK;WACb,MAAM;aACJ,MAAM;UACT,KAAK,CAAC,GAAG,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;;WAG/C,aAAa;kBACN,IAAI;WACX,MAAM;aACJ,MAAM;UACT,KAAK,CAAC,GAAG,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;kFAkF1D,CAAC;AAIH,eAAe,MAAM,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transferwise/components",
3
- "version": "0.0.0-experimental-8a932bb",
3
+ "version": "0.0.0-experimental-090123d",
4
4
  "description": "Neptune React components",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -91,13 +91,13 @@
91
91
  "rollup": "^4.18.1",
92
92
  "rollup-preserve-directives": "^1.1.1",
93
93
  "storybook": "^8.2.2",
94
- "@transferwise/neptune-css": "0.0.0-experimental-8a932bb",
94
+ "@transferwise/neptune-css": "0.0.0-experimental-090123d",
95
95
  "@wise/components-theming": "1.6.1",
96
96
  "@transferwise/less-config": "3.1.0"
97
97
  },
98
98
  "peerDependencies": {
99
99
  "@transferwise/icons": "^3.13.1",
100
- "@transferwise/neptune-css": "0.0.0-experimental-8a932bb",
100
+ "@transferwise/neptune-css": "0.0.0-experimental-090123d",
101
101
  "@wise/art": "^2.16",
102
102
  "@wise/components-theming": "^1.0.0",
103
103
  "react": ">=18",
@@ -18,7 +18,7 @@ export type ButtonRefType = PrimitiveButtonElementRef | PrimitiveAnchorElementRe
18
18
  */
19
19
  export interface CommonButtonProps {
20
20
  /** The HTML element to render */
21
- as?: 'button' | 'a';
21
+ as?: 'button' | 'a' | null;
22
22
 
23
23
  /** Additional class name(s) to apply to the button */
24
24
  className?: string;
@@ -23,12 +23,14 @@ export type ButtonProps =
23
23
  htmlType?: string;
24
24
  useNewButton?: false;
25
25
  href?: string;
26
+ target?: string;
26
27
  ref?: React.Ref<HTMLButtonElement | HTMLAnchorElement>;
27
28
  })
28
29
  | (Omit<Omit<NewButtonProps, 'type'>, 'ref'> & {
29
30
  type?: NewButtonType;
30
31
  useNewButton: true;
31
32
  href?: string;
33
+ target?: string;
32
34
  ref?: React.Ref<HTMLButtonElement | HTMLAnchorElement>;
33
35
  });
34
36
 
@@ -35,6 +35,7 @@ describe('Button', () => {
35
35
  ...legacyProps,
36
36
  as: 'a',
37
37
  href: 'https://example.com',
38
+ target: '_blank',
38
39
  };
39
40
  render(<Button {...linkProps}>Legacy Button</Button>);
40
41
  const linkButton = screen.getByText('Legacy Button');