@sumup-oss/icons 7.2.0 → 7.3.0

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.
@@ -12,7 +12,7 @@
12
12
  * See the License for the specific language governing permissions and
13
13
  * limitations under the License.
14
14
  */
15
- import { type HTMLAttributes } from 'react';
15
+ import type { HTMLAttributes, Ref } from 'react';
16
16
  import type { CARD_SCHEMES } from './constants.js';
17
17
  type CardSchemeName = (typeof CARD_SCHEMES)[number];
18
18
  export type CardSchemeProps = HTMLAttributes<HTMLImageElement> & {
@@ -34,28 +34,10 @@ export type CardSchemeProps = HTMLAttributes<HTMLImageElement> & {
34
34
  * Additional class name to apply to the image.
35
35
  */
36
36
  className?: string;
37
+ ref?: Ref<HTMLImageElement>;
37
38
  };
38
39
  /**
39
40
  * Renders the logo of a card scheme as an image, loaded from a URL.
40
41
  */
41
- export declare const CardScheme: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLImageElement> & {
42
- /**
43
- * The name of the card scheme.
44
- */
45
- name: CardSchemeName;
46
- /**
47
- * The alt text for the card scheme logo. Pass an empty string to hide
48
- * purely decorative logos from assistive technology.
49
- */
50
- alt: string;
51
- /**
52
- * Choose from 3 sizes.
53
- * @default m
54
- */
55
- size?: "s" | "m" | "l";
56
- /**
57
- * Additional class name to apply to the image.
58
- */
59
- className?: string;
60
- } & import("react").RefAttributes<HTMLImageElement>>;
42
+ export declare function CardScheme({ name, alt, style, size, ref, ...props }: CardSchemeProps): import("react").JSX.Element;
61
43
  export {};
@@ -1,30 +1,14 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- /**
3
- * Copyright 2026, SumUp Ltd.
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- import { forwardRef } from 'react';
17
2
  import { getIconURL } from '../../helpers.js';
18
3
  import { ICON_SIZES } from '../../icon-sizes.js';
19
4
  /**
20
5
  * Renders the logo of a card scheme as an image, loaded from a URL.
21
6
  */
22
- export const CardScheme = forwardRef(({ name, alt, style, size = 'm', ...props }, ref) => {
7
+ export function CardScheme({ name, alt, style, size = 'm', ref, ...props }) {
23
8
  const sizeValue = ICON_SIZES[size];
24
9
  return (_jsx("img", { ref: ref, style: {
25
10
  width: sizeValue,
26
11
  height: `calc(${sizeValue} * 3 / 4)`,
27
12
  ...style,
28
13
  }, src: getIconURL(name, '32'), ...props, alt: alt }));
29
- });
30
- CardScheme.displayName = 'CardScheme';
14
+ }
@@ -3,4 +3,4 @@
3
3
  * Do not edit it by hand, your changes will be overwritten.
4
4
  * To add or remove an entry, edit manifest.json instead.
5
5
  */
6
- export declare const CARD_SCHEMES: readonly ["alelo", "alternative_payment_method", "american_express", "apple_pay", "bancomat", "bancontact", "boleto", "card_unknown", "conecs", "diners_club", "discover", "eftpos", "elo", "elv", "girocard", "google_pay", "hipercard", "ideal", "interac", "jcb", "klarna", "maestro", "mastercard", "pay_pal", "pix", "pluxee", "sodexo", "sumup_card_scheme", "sumup_pay", "sumup_scheme", "swile", "ticket", "union_pay", "visa", "visa_electron", "vpay", "vr"];
6
+ export declare const CARD_SCHEMES: readonly ["alelo", "alternative_payment_method", "american_express", "apple_pay", "bancomat", "bancontact", "boleto", "card_other", "card_unknown", "conecs", "diners_club", "discover", "eftpos", "elo", "elv", "girocard", "google_pay", "hipercard", "ideal", "interac", "jcb", "klarna", "maestro", "mastercard", "pay_pal", "pix", "pluxee", "sodexo", "sumup_card_scheme", "sumup_pay", "sumup_scheme", "swile", "ticket", "union_pay", "visa", "visa_electron", "vpay", "vr"];
@@ -11,6 +11,7 @@ export const CARD_SCHEMES = [
11
11
  "bancomat",
12
12
  "bancontact",
13
13
  "boleto",
14
+ "card_other",
14
15
  "card_unknown",
15
16
  "conecs",
16
17
  "diners_club",
@@ -12,7 +12,7 @@
12
12
  * See the License for the specific language governing permissions and
13
13
  * limitations under the License.
14
14
  */
15
- import { type HTMLAttributes } from 'react';
15
+ import type { HTMLAttributes, Ref } from 'react';
16
16
  import type { FLAGS } from './constants.js';
17
17
  type CountryCode = (typeof FLAGS)[number];
18
18
  type WithSize = {
@@ -58,9 +58,10 @@ export type FlagProps = HTMLAttributes<HTMLImageElement> & {
58
58
  * Additional class name to apply to the flag's inner image.
59
59
  */
60
60
  imageClassName?: string;
61
+ ref?: Ref<HTMLImageElement>;
61
62
  } & (WithSize | WithHeightWidth);
62
63
  /**
63
64
  * Renders an SVG icon of a flag. Flags are sourced from: https://flagicons.lipis.dev/
64
65
  */
65
- export declare const Flag: import("react").ForwardRefExoticComponent<FlagProps & import("react").RefAttributes<HTMLImageElement>>;
66
+ export declare function Flag({ countryCode, alt, className, imageClassName, style, size, width, height, ref, ...props }: FlagProps): import("react").JSX.Element;
66
67
  export {};
@@ -1,19 +1,4 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- /**
3
- * Copyright 2026, SumUp Ltd.
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- import { forwardRef } from 'react';
17
2
  import { getIconURL } from '../../helpers.js';
18
3
  import { ICON_SIZES } from '../../icon-sizes.js';
19
4
  import { deprecate } from '../../logger.js';
@@ -34,14 +19,14 @@ const IMAGE_STYLE = {
34
19
  /**
35
20
  * Renders an SVG icon of a flag. Flags are sourced from: https://flagicons.lipis.dev/
36
21
  */
37
- export const Flag = forwardRef(({ countryCode, alt, className, imageClassName, style, size, width, height, ...props }, ref) => {
22
+ export function Flag({ countryCode, alt, className, imageClassName, style, size, width, height, ref, ...props }) {
38
23
  const flagName = `flag_${countryCode.toLowerCase()}`;
39
24
  if (process.env.NODE_ENV !== 'production' && (width || height)) {
40
25
  deprecate('Flag', 'The `width` and `height` props are deprecated. Use the `size` prop instead.');
41
26
  }
42
27
  if (size) {
43
28
  const sizeValue = ICON_SIZES[size];
44
- return (_jsx("div", { className: className, style: WRAPPER_STYLE, children: _jsx("img", { ref: ref, className: imageClassName, style: {
29
+ return (_jsx("div", { className: className, style: WRAPPER_STYLE, children: _jsx("img", { className: imageClassName, style: {
45
30
  ...IMAGE_STYLE,
46
31
  width: sizeValue,
47
32
  height: `calc(${sizeValue} * 3 / 4)`,
@@ -59,6 +44,5 @@ export const Flag = forwardRef(({ countryCode, alt, className, imageClassName, s
59
44
  dimensions.width = width;
60
45
  dimensions.height = width / ASPECT_RATIO;
61
46
  }
62
- return (_jsx("div", { className: className, style: WRAPPER_STYLE, children: _jsx("img", { ref: ref, className: imageClassName, style: { ...IMAGE_STYLE, ...style }, height: `${dimensions.height}px`, width: `${dimensions.width}px`, src: getIconURL(flagName, '480'), ...props, alt: alt }) }));
63
- });
64
- Flag.displayName = 'Flag';
47
+ return (_jsx("div", { className: className, style: WRAPPER_STYLE, children: _jsx("img", { ref: ref, className: imageClassName, style: { ...IMAGE_STYLE, ...style }, height: `${dimensions.height}px`, width: `${dimensions.width}px`, src: getIconURL(flagName, '480'), alt: alt, ...props }) }));
48
+ }
@@ -12,7 +12,7 @@
12
12
  * See the License for the specific language governing permissions and
13
13
  * limitations under the License.
14
14
  */
15
- import { type HTMLAttributes } from 'react';
15
+ import type { HTMLAttributes, Ref } from 'react';
16
16
  import type { PAYMENT_METHODS } from './constants.js';
17
17
  type PaymentMethodName = (typeof PAYMENT_METHODS)[number];
18
18
  export type PaymentMethodProps = HTMLAttributes<HTMLImageElement> & {
@@ -34,28 +34,10 @@ export type PaymentMethodProps = HTMLAttributes<HTMLImageElement> & {
34
34
  * Additional class name to apply to the image.
35
35
  */
36
36
  className?: string;
37
+ ref?: Ref<HTMLImageElement>;
37
38
  };
38
39
  /**
39
40
  * Renders the logo of a payment method as an image, loaded from a URL.
40
41
  */
41
- export declare const PaymentMethod: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLImageElement> & {
42
- /**
43
- * The name of the payment method.
44
- */
45
- name: PaymentMethodName;
46
- /**
47
- * The alt text for the payment method logo. Pass an empty string to hide
48
- * purely decorative logos from assistive technology.
49
- */
50
- alt: string;
51
- /**
52
- * Choose from 3 sizes.
53
- * @default m
54
- */
55
- size?: "s" | "m" | "l";
56
- /**
57
- * Additional class name to apply to the image.
58
- */
59
- className?: string;
60
- } & import("react").RefAttributes<HTMLImageElement>>;
42
+ export declare function PaymentMethod({ name, alt, style, size, ref, ...props }: PaymentMethodProps): import("react").JSX.Element;
61
43
  export {};
@@ -1,23 +1,9 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- /**
3
- * Copyright 2026, SumUp Ltd.
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- import { forwardRef } from 'react';
17
2
  import { getIconURL } from '../../helpers.js';
18
3
  import { ICON_SIZES } from '../../icon-sizes.js';
19
4
  /**
20
5
  * Renders the logo of a payment method as an image, loaded from a URL.
21
6
  */
22
- export const PaymentMethod = forwardRef(({ name, alt, style, size = 'm', ...props }, ref) => (_jsx("img", { ref: ref, style: { height: ICON_SIZES[size], width: 'auto', ...style }, src: getIconURL(name, '24'), ...props, alt: alt })));
23
- PaymentMethod.displayName = 'PaymentMethod';
7
+ export function PaymentMethod({ name, alt, style, size = 'm', ref, ...props }) {
8
+ return (_jsx("img", { ref: ref, style: { height: ICON_SIZES[size], width: 'auto', ...style }, src: getIconURL(name, '24'), alt: alt, ...props }));
9
+ }
package/dist/index.d.ts CHANGED
@@ -1173,6 +1173,7 @@ export type IconName =
1173
1173
  | "bancontact"
1174
1174
  | "boleto"
1175
1175
  | "card_unknown"
1176
+ | "card_other"
1176
1177
  | "conecs"
1177
1178
  | "diners_club"
1178
1179
  | "discover"
@@ -1861,6 +1862,7 @@ type Icons = {
1861
1862
  bancontact: "24" | "32";
1862
1863
  boleto: "24" | "32";
1863
1864
  card_unknown: "24" | "32";
1865
+ card_other: "32";
1864
1866
  conecs: "24" | "32";
1865
1867
  diners_club: "24" | "32";
1866
1868
  discover: "24" | "32";
package/manifest.json CHANGED
@@ -600,6 +600,11 @@
600
600
  "category": "Card scheme",
601
601
  "size": "32"
602
602
  },
603
+ {
604
+ "name": "card_other",
605
+ "category": "Card scheme",
606
+ "size": "32"
607
+ },
603
608
  {
604
609
  "name": "conecs",
605
610
  "category": "Card scheme",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sumup-oss/icons",
3
- "version": "7.2.0",
3
+ "version": "7.3.0",
4
4
  "description": "A collection of icons by SumUp",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -38,20 +38,20 @@
38
38
  "prepublish": "npm run build"
39
39
  },
40
40
  "devDependencies": {
41
- "@babel/core": "^8.0.1",
42
- "@babel/preset-env": "^8.0.2",
41
+ "@babel/core": "^8.0.6",
42
+ "@babel/preset-env": "^8.0.6",
43
43
  "@babel/preset-react": "^8.0.1",
44
44
  "@biomejs/js-api": "^6.0.0",
45
45
  "@testing-library/jest-dom": "^7.0.1",
46
46
  "@testing-library/react": "^16.3.3",
47
47
  "@types/babel__core": "^7.20.5",
48
- "@types/react": "^19.2.18",
49
- "@types/react-dom": "^19.2.5",
48
+ "@types/react": "^19.3.0",
49
+ "@types/react-dom": "^19.3.0",
50
50
  "fast-xml-parser": "^5.11.1",
51
51
  "jest-axe": "^11.0.0",
52
52
  "jsdom": "^30.0.1",
53
- "react": "^19.2.8",
54
- "react-dom": "^19.2.8",
53
+ "react": "^19.3.0",
54
+ "react-dom": "^19.3.0",
55
55
  "tsx": "^4.23.13",
56
56
  "typescript": "^6.0.3",
57
57
  "vitest": "^4.1.11"
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="32" height="24" fill="none" viewBox="0 0 32 24">
2
+ <rect width="31" height="23" x=".5" y=".5" fill="#fbfbf9" stroke="#e3e2d6" rx="3.5"/>
3
+ <path fill="currentColor" d="M21.5 12.317c.506 0 .917.41.917.916v1.834h1.833a.917.917 0 1 1 0 1.833h-1.833v1.833a.917.917 0 1 1-1.834 0V16.9H18.75a.917.917 0 1 1 0-1.833h1.833v-1.834c0-.506.41-.916.917-.916m1.1-8.25c1.506 0 2.567 1.324 2.567 2.75v4.125a.917.917 0 1 1-1.834 0v-.459H8.667v5.5c0 .6.416.917.733.917h7.517v1.833H9.4c-1.506 0-2.567-1.324-2.567-2.75V6.817c0-1.426 1.06-2.75 2.567-2.75zM9.4 5.9c-.317 0-.733.317-.733.917V8.65h14.666V6.817c0-.6-.416-.917-.733-.917z"/>
4
+ </svg>