@sumup-oss/icons 6.11.0 → 6.13.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.
- package/dist/Passkey.js +68 -0
- package/dist/SecurityTimeSensitive.js +69 -0
- package/dist/TrustedCompany.js +68 -0
- package/dist/Unlock.js +68 -0
- package/dist/components/CardScheme/CardScheme.d.ts +61 -0
- package/dist/components/CardScheme/CardScheme.js +30 -0
- package/dist/components/CardScheme/constants.d.ts +6 -0
- package/dist/components/CardScheme/constants.js +44 -0
- package/dist/components/Flag/Flag.d.ts +66 -0
- package/dist/components/Flag/Flag.js +64 -0
- package/dist/components/Flag/constants.d.ts +6 -0
- package/dist/components/Flag/constants.js +265 -0
- package/dist/components/PaymentMethod/PaymentMethod.d.ts +61 -0
- package/dist/components/PaymentMethod/PaymentMethod.js +23 -0
- package/dist/components/PaymentMethod/constants.d.ts +6 -0
- package/dist/components/PaymentMethod/constants.js +58 -0
- package/dist/helpers.d.ts +15 -0
- package/dist/helpers.js +15 -6
- package/dist/icon-sizes.d.ts +15 -0
- package/dist/icon-sizes.js +19 -0
- package/dist/index.d.ts +49 -25
- package/dist/index.js +12 -5
- package/dist/logger.d.ts +19 -0
- package/dist/logger.js +27 -0
- package/manifest.json +45 -25
- package/package.json +10 -2
- package/web/v2/passkey_24.svg +1 -0
- package/web/v2/security_time_sensitive_24.svg +1 -0
- package/web/v2/trusted_company_24.svg +1 -0
- package/web/v2/unlock_24.svg +1 -0
package/dist/Passkey.js
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
const _excluded = ["size"];
|
|
2
|
+
function _objectWithoutProperties(e, t) {
|
|
3
|
+
if (null == e) return {};
|
|
4
|
+
var o,
|
|
5
|
+
r,
|
|
6
|
+
i = _objectWithoutPropertiesLoose(e, t);
|
|
7
|
+
if (Object.getOwnPropertySymbols) {
|
|
8
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
9
|
+
for (r = 0; r < n.length; r++)
|
|
10
|
+
(o = n[r]),
|
|
11
|
+
-1 === t.indexOf(o) &&
|
|
12
|
+
{}.propertyIsEnumerable.call(e, o) &&
|
|
13
|
+
(i[o] = e[o]);
|
|
14
|
+
}
|
|
15
|
+
return i;
|
|
16
|
+
}
|
|
17
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
18
|
+
if (null == r) return {};
|
|
19
|
+
var t = {};
|
|
20
|
+
for (var n in r)
|
|
21
|
+
if ({}.hasOwnProperty.call(r, n)) {
|
|
22
|
+
if (-1 !== e.indexOf(n)) continue;
|
|
23
|
+
t[n] = r[n];
|
|
24
|
+
}
|
|
25
|
+
return t;
|
|
26
|
+
}
|
|
27
|
+
import React from "react";
|
|
28
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
29
|
+
var Passkey24 = function Passkey24(props) {
|
|
30
|
+
return /*#__PURE__*/ _jsx("svg", {
|
|
31
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
32
|
+
width: "24",
|
|
33
|
+
height: "24",
|
|
34
|
+
fill: "none",
|
|
35
|
+
viewBox: "0 0 24 24",
|
|
36
|
+
...props,
|
|
37
|
+
children: /*#__PURE__*/ _jsx("path", {
|
|
38
|
+
fill: "currentColor",
|
|
39
|
+
d: "M20.089 19a.79.79 0 0 0-.795-.79.79.79 0 0 0-.794.79c0 .433.352.789.794.79a.79.79 0 0 0 .795-.79M15.315 7.723A3.73 3.73 0 0 0 11.58 4a3.73 3.73 0 0 0-3.737 3.723 3.73 3.73 0 0 0 3.545 3.717l.192.004.192-.005a3.73 3.73 0 0 0 3.544-3.716M22.09 19a2.79 2.79 0 0 1-2.795 2.79 2.787 2.787 0 0 1-1-5.392v-4.553a1 1 0 0 1 2 0v.789h.795a1 1 0 0 1 0 2h-.795v1.764A2.79 2.79 0 0 1 22.089 19M17.315 7.723a5.7 5.7 0 0 1-2.184 4.49 8.6 8.6 0 0 1 1.667.996 1 1 0 0 1-1.215 1.589 6.59 6.59 0 0 0-6.916-.677 6.57 6.57 0 0 0-2.676 2.419A6.54 6.54 0 0 0 5 20a1 1 0 0 1-2 0c0-1.597.448-3.162 1.294-4.519a8.57 8.57 0 0 1 3.731-3.268 5.7 5.7 0 0 1-2.183-4.49C5.842 4.559 8.414 2 11.579 2s5.736 2.56 5.736 5.723",
|
|
40
|
+
}),
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
const PasskeySizeMap = {
|
|
44
|
+
24: Passkey24,
|
|
45
|
+
};
|
|
46
|
+
export function Passkey(_ref) {
|
|
47
|
+
let _ref$size = _ref.size,
|
|
48
|
+
size = _ref$size === void 0 ? "24" : _ref$size,
|
|
49
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
50
|
+
const Icon = PasskeySizeMap[size] || PasskeySizeMap["24"];
|
|
51
|
+
if (
|
|
52
|
+
process.env.NODE_ENV !== "production" &&
|
|
53
|
+
process.env.NODE_ENV !== "test" &&
|
|
54
|
+
!PasskeySizeMap[size]
|
|
55
|
+
) {
|
|
56
|
+
console.warn(
|
|
57
|
+
new Error(
|
|
58
|
+
"The '".concat(
|
|
59
|
+
size,
|
|
60
|
+
"' size is not supported by the 'Passkey' icon. Please use one of the available sizes: '24'.",
|
|
61
|
+
),
|
|
62
|
+
),
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
return /*#__PURE__*/ _jsx(Icon, {
|
|
66
|
+
...props,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
const _excluded = ["size"];
|
|
2
|
+
function _objectWithoutProperties(e, t) {
|
|
3
|
+
if (null == e) return {};
|
|
4
|
+
var o,
|
|
5
|
+
r,
|
|
6
|
+
i = _objectWithoutPropertiesLoose(e, t);
|
|
7
|
+
if (Object.getOwnPropertySymbols) {
|
|
8
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
9
|
+
for (r = 0; r < n.length; r++)
|
|
10
|
+
(o = n[r]),
|
|
11
|
+
-1 === t.indexOf(o) &&
|
|
12
|
+
{}.propertyIsEnumerable.call(e, o) &&
|
|
13
|
+
(i[o] = e[o]);
|
|
14
|
+
}
|
|
15
|
+
return i;
|
|
16
|
+
}
|
|
17
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
18
|
+
if (null == r) return {};
|
|
19
|
+
var t = {};
|
|
20
|
+
for (var n in r)
|
|
21
|
+
if ({}.hasOwnProperty.call(r, n)) {
|
|
22
|
+
if (-1 !== e.indexOf(n)) continue;
|
|
23
|
+
t[n] = r[n];
|
|
24
|
+
}
|
|
25
|
+
return t;
|
|
26
|
+
}
|
|
27
|
+
import React from "react";
|
|
28
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
29
|
+
var SecurityTimeSensitive24 = function SecurityTimeSensitive24(props) {
|
|
30
|
+
return /*#__PURE__*/ _jsx("svg", {
|
|
31
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
32
|
+
width: "24",
|
|
33
|
+
height: "24",
|
|
34
|
+
fill: "none",
|
|
35
|
+
viewBox: "0 0 24 24",
|
|
36
|
+
...props,
|
|
37
|
+
children: /*#__PURE__*/ _jsx("path", {
|
|
38
|
+
fill: "currentColor",
|
|
39
|
+
d: "M16 9.5a6 6 0 1 1 0 12 6 6 0 0 1 0-12M12 2c.429 0 .842.138 1.184.388l.141.113.009.008c1.423 1.28 3.373 2.191 4.791 2.191.443 0 .866.158 1.2.439l.136.128.123.14c.27.338.416.76.416 1.193V8a1 1 0 1 1-2 0V6.695c-2.05-.047-4.389-1.25-5.995-2.691L12 4l-.005.004v-.001C10.396 5.435 8.05 6.647 6 6.695v6.203c0 1.553.405 2.76 1.059 3.726.66.977 1.612 1.76 2.774 2.4a1 1 0 0 1-.966 1.752c-1.356-.747-2.58-1.725-3.465-3.032C4.511 16.427 4 14.825 4 12.898V6.6c0-.495.19-.975.54-1.333l.136-.128A1.86 1.86 0 0 1 5.875 4.7l.271-.01c1.389-.106 3.194-.99 4.521-2.181l.008-.008A2 2 0 0 1 12 2m4 9.5a4 4 0 1 0 0 8 4 4 0 0 0 0-8m0 1.333a1 1 0 0 1 1 1v1.278l.863.541a1 1 0 1 1-1.06 1.696l-1.333-.833a1 1 0 0 1-.47-.848v-1.834a1 1 0 0 1 1-1",
|
|
40
|
+
}),
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
const SecurityTimeSensitiveSizeMap = {
|
|
44
|
+
24: SecurityTimeSensitive24,
|
|
45
|
+
};
|
|
46
|
+
export function SecurityTimeSensitive(_ref) {
|
|
47
|
+
let _ref$size = _ref.size,
|
|
48
|
+
size = _ref$size === void 0 ? "24" : _ref$size,
|
|
49
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
50
|
+
const Icon =
|
|
51
|
+
SecurityTimeSensitiveSizeMap[size] || SecurityTimeSensitiveSizeMap["24"];
|
|
52
|
+
if (
|
|
53
|
+
process.env.NODE_ENV !== "production" &&
|
|
54
|
+
process.env.NODE_ENV !== "test" &&
|
|
55
|
+
!SecurityTimeSensitiveSizeMap[size]
|
|
56
|
+
) {
|
|
57
|
+
console.warn(
|
|
58
|
+
new Error(
|
|
59
|
+
"The '".concat(
|
|
60
|
+
size,
|
|
61
|
+
"' size is not supported by the 'SecurityTimeSensitive' icon. Please use one of the available sizes: '24'.",
|
|
62
|
+
),
|
|
63
|
+
),
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
return /*#__PURE__*/ _jsx(Icon, {
|
|
67
|
+
...props,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
const _excluded = ["size"];
|
|
2
|
+
function _objectWithoutProperties(e, t) {
|
|
3
|
+
if (null == e) return {};
|
|
4
|
+
var o,
|
|
5
|
+
r,
|
|
6
|
+
i = _objectWithoutPropertiesLoose(e, t);
|
|
7
|
+
if (Object.getOwnPropertySymbols) {
|
|
8
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
9
|
+
for (r = 0; r < n.length; r++)
|
|
10
|
+
(o = n[r]),
|
|
11
|
+
-1 === t.indexOf(o) &&
|
|
12
|
+
{}.propertyIsEnumerable.call(e, o) &&
|
|
13
|
+
(i[o] = e[o]);
|
|
14
|
+
}
|
|
15
|
+
return i;
|
|
16
|
+
}
|
|
17
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
18
|
+
if (null == r) return {};
|
|
19
|
+
var t = {};
|
|
20
|
+
for (var n in r)
|
|
21
|
+
if ({}.hasOwnProperty.call(r, n)) {
|
|
22
|
+
if (-1 !== e.indexOf(n)) continue;
|
|
23
|
+
t[n] = r[n];
|
|
24
|
+
}
|
|
25
|
+
return t;
|
|
26
|
+
}
|
|
27
|
+
import React from "react";
|
|
28
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
29
|
+
var TrustedCompany24 = function TrustedCompany24(props) {
|
|
30
|
+
return /*#__PURE__*/ _jsx("svg", {
|
|
31
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
32
|
+
width: "24",
|
|
33
|
+
height: "24",
|
|
34
|
+
fill: "none",
|
|
35
|
+
viewBox: "0 0 24 24",
|
|
36
|
+
...props,
|
|
37
|
+
children: /*#__PURE__*/ _jsx("path", {
|
|
38
|
+
fill: "currentColor",
|
|
39
|
+
d: "M17.137 10.006a1.6 1.6 0 0 1 .764.272l.112.082.025.023c.765.668 1.785 1.112 2.462 1.112a1.5 1.5 0 0 1 .95.34l.11.1.1.11a1.5 1.5 0 0 1 .34.95v3.5c0 1.514-.542 2.7-1.419 3.6-.85.873-1.97 1.43-3.082 1.818l-.008.003a1.5 1.5 0 0 1-.982-.008v.001l-.013-.005-.01-.003c-1.107-.385-2.22-.94-3.066-1.805-.879-.9-1.42-2.088-1.42-3.602v-3.5l.008-.15a1.5 1.5 0 0 1 .432-.91l.11-.099a1.5 1.5 0 0 1 .95-.339c.676 0 1.701-.449 2.462-1.113l.023-.02A1.6 1.6 0 0 1 16.998 10zM15.6 3c.738 0 1.45.29 1.975.81s.824 1.227.824 1.967v.779h.8c.739 0 1.45.29 1.976.81.526.519.824 1.227.824 1.967q0 .132-.033.259l-.045.167a1 1 0 0 1-1.932-.518l.002-.01a.77.77 0 0 0-.222-.443.81.81 0 0 0-.57-.232h-1.8a1 1 0 0 1-1-1l.001-.029v-1.75a.77.77 0 0 0-.23-.545A.81.81 0 0 0 15.6 5H8.4a.81.81 0 0 0-.57.232.77.77 0 0 0-.23.545V19H9.5a1 1 0 0 1 0 2H4.8c-.739 0-1.45-.29-1.976-.809A2.77 2.77 0 0 1 2 18.223V12c0-.74.298-1.448.824-1.968a2.81 2.81 0 0 1 1.976-.81h.8V5.778c0-.74.299-1.448.825-1.967A2.81 2.81 0 0 1 8.4 3zm1.4 9.116c-.835.654-1.94 1.207-3.001 1.346v3.032c0 .986.334 1.674.852 2.204.515.528 1.256.937 2.156 1.264.892-.328 1.628-.736 2.141-1.263.518-.531.851-1.219.851-2.204v-3.033c-1.06-.138-2.16-.69-2.999-1.346M4.8 11.223a.81.81 0 0 0-.57.232A.77.77 0 0 0 4 12v6.223c0 .202.081.399.23.546A.81.81 0 0 0 4.8 19h.8v-7.777zm9-3.779a1 1 0 0 1 0 2h-3.6a1 1 0 1 1 0-2z",
|
|
40
|
+
}),
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
const TrustedCompanySizeMap = {
|
|
44
|
+
24: TrustedCompany24,
|
|
45
|
+
};
|
|
46
|
+
export function TrustedCompany(_ref) {
|
|
47
|
+
let _ref$size = _ref.size,
|
|
48
|
+
size = _ref$size === void 0 ? "24" : _ref$size,
|
|
49
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
50
|
+
const Icon = TrustedCompanySizeMap[size] || TrustedCompanySizeMap["24"];
|
|
51
|
+
if (
|
|
52
|
+
process.env.NODE_ENV !== "production" &&
|
|
53
|
+
process.env.NODE_ENV !== "test" &&
|
|
54
|
+
!TrustedCompanySizeMap[size]
|
|
55
|
+
) {
|
|
56
|
+
console.warn(
|
|
57
|
+
new Error(
|
|
58
|
+
"The '".concat(
|
|
59
|
+
size,
|
|
60
|
+
"' size is not supported by the 'TrustedCompany' icon. Please use one of the available sizes: '24'.",
|
|
61
|
+
),
|
|
62
|
+
),
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
return /*#__PURE__*/ _jsx(Icon, {
|
|
66
|
+
...props,
|
|
67
|
+
});
|
|
68
|
+
}
|
package/dist/Unlock.js
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
const _excluded = ["size"];
|
|
2
|
+
function _objectWithoutProperties(e, t) {
|
|
3
|
+
if (null == e) return {};
|
|
4
|
+
var o,
|
|
5
|
+
r,
|
|
6
|
+
i = _objectWithoutPropertiesLoose(e, t);
|
|
7
|
+
if (Object.getOwnPropertySymbols) {
|
|
8
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
9
|
+
for (r = 0; r < n.length; r++)
|
|
10
|
+
(o = n[r]),
|
|
11
|
+
-1 === t.indexOf(o) &&
|
|
12
|
+
{}.propertyIsEnumerable.call(e, o) &&
|
|
13
|
+
(i[o] = e[o]);
|
|
14
|
+
}
|
|
15
|
+
return i;
|
|
16
|
+
}
|
|
17
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
18
|
+
if (null == r) return {};
|
|
19
|
+
var t = {};
|
|
20
|
+
for (var n in r)
|
|
21
|
+
if ({}.hasOwnProperty.call(r, n)) {
|
|
22
|
+
if (-1 !== e.indexOf(n)) continue;
|
|
23
|
+
t[n] = r[n];
|
|
24
|
+
}
|
|
25
|
+
return t;
|
|
26
|
+
}
|
|
27
|
+
import React from "react";
|
|
28
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
29
|
+
var Unlock24 = function Unlock24(props) {
|
|
30
|
+
return /*#__PURE__*/ _jsx("svg", {
|
|
31
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
32
|
+
width: "24",
|
|
33
|
+
height: "24",
|
|
34
|
+
fill: "none",
|
|
35
|
+
viewBox: "0 0 24 24",
|
|
36
|
+
...props,
|
|
37
|
+
children: /*#__PURE__*/ _jsx("path", {
|
|
38
|
+
fill: "currentColor",
|
|
39
|
+
d: "M19 12.902a.79.79 0 0 0-.777-.8H5.777a.79.79 0 0 0-.777.8V19.2c0 .453.36.8.777.8h12.446a.79.79 0 0 0 .777-.8zm2 6.298c0 1.535-1.232 2.8-2.777 2.8H5.777C4.232 22 3 20.735 3 19.2v-6.298c0-1.534 1.232-2.8 2.777-2.8h.779v-2.6a5.53 5.53 0 0 1 1.4-3.685 5.406 5.406 0 0 1 7.278-.742 5.5 5.5 0 0 1 2.102 3.332 1 1 0 0 1-1.961.394 3.5 3.5 0 0 0-1.337-2.122 3.405 3.405 0 0 0-4.59.47 3.53 3.53 0 0 0-.892 2.353v2.6h9.667c1.545 0 2.777 1.266 2.777 2.8z",
|
|
40
|
+
}),
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
const UnlockSizeMap = {
|
|
44
|
+
24: Unlock24,
|
|
45
|
+
};
|
|
46
|
+
export function Unlock(_ref) {
|
|
47
|
+
let _ref$size = _ref.size,
|
|
48
|
+
size = _ref$size === void 0 ? "24" : _ref$size,
|
|
49
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
50
|
+
const Icon = UnlockSizeMap[size] || UnlockSizeMap["24"];
|
|
51
|
+
if (
|
|
52
|
+
process.env.NODE_ENV !== "production" &&
|
|
53
|
+
process.env.NODE_ENV !== "test" &&
|
|
54
|
+
!UnlockSizeMap[size]
|
|
55
|
+
) {
|
|
56
|
+
console.warn(
|
|
57
|
+
new Error(
|
|
58
|
+
"The '".concat(
|
|
59
|
+
size,
|
|
60
|
+
"' size is not supported by the 'Unlock' icon. Please use one of the available sizes: '24'.",
|
|
61
|
+
),
|
|
62
|
+
),
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
return /*#__PURE__*/ _jsx(Icon, {
|
|
66
|
+
...props,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2026, SumUp Ltd.
|
|
3
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License.
|
|
5
|
+
* You may obtain a copy of the License at
|
|
6
|
+
*
|
|
7
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
*
|
|
9
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
* See the License for the specific language governing permissions and
|
|
13
|
+
* limitations under the License.
|
|
14
|
+
*/
|
|
15
|
+
import { type HTMLAttributes } from 'react';
|
|
16
|
+
import type { CARD_SCHEMES } from './constants.js';
|
|
17
|
+
type CardSchemeName = (typeof CARD_SCHEMES)[number];
|
|
18
|
+
export type CardSchemeProps = HTMLAttributes<HTMLImageElement> & {
|
|
19
|
+
/**
|
|
20
|
+
* The name of the card scheme.
|
|
21
|
+
*/
|
|
22
|
+
name: CardSchemeName;
|
|
23
|
+
/**
|
|
24
|
+
* The alt text for the card scheme logo. Pass an empty string to hide
|
|
25
|
+
* purely decorative logos from assistive technology.
|
|
26
|
+
*/
|
|
27
|
+
alt: string;
|
|
28
|
+
/**
|
|
29
|
+
* Choose from 3 sizes.
|
|
30
|
+
* @default m
|
|
31
|
+
*/
|
|
32
|
+
size?: 's' | 'm' | 'l';
|
|
33
|
+
/**
|
|
34
|
+
* Additional class name to apply to the image.
|
|
35
|
+
*/
|
|
36
|
+
className?: string;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Renders the logo of a card scheme as an image, loaded from a URL.
|
|
40
|
+
*/
|
|
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>>;
|
|
61
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
import { getIconURL } from '../../helpers.js';
|
|
18
|
+
import { ICON_SIZES } from '../../icon-sizes.js';
|
|
19
|
+
/**
|
|
20
|
+
* Renders the logo of a card scheme as an image, loaded from a URL.
|
|
21
|
+
*/
|
|
22
|
+
export const CardScheme = forwardRef(({ name, alt, style, size = 'm', ...props }, ref) => {
|
|
23
|
+
const sizeValue = ICON_SIZES[size];
|
|
24
|
+
return (_jsx("img", { ref: ref, style: {
|
|
25
|
+
width: sizeValue,
|
|
26
|
+
height: `calc(${sizeValue} * 3 / 4)`,
|
|
27
|
+
...style,
|
|
28
|
+
}, src: getIconURL(name, '32'), ...props, alt: alt }));
|
|
29
|
+
});
|
|
30
|
+
CardScheme.displayName = 'CardScheme';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is auto-generated from manifest.json by `npm run build`.
|
|
3
|
+
* Do not edit it by hand, your changes will be overwritten.
|
|
4
|
+
* To add or remove an entry, edit manifest.json instead.
|
|
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", "sumup_pay", "sumup_scheme", "swile", "ticket", "union_pay", "visa", "visa_electron", "vpay", "vr"];
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is auto-generated from manifest.json by `npm run build`.
|
|
3
|
+
* Do not edit it by hand, your changes will be overwritten.
|
|
4
|
+
* To add or remove an entry, edit manifest.json instead.
|
|
5
|
+
*/
|
|
6
|
+
export const CARD_SCHEMES = [
|
|
7
|
+
"alelo",
|
|
8
|
+
"alternative_payment_method",
|
|
9
|
+
"american_express",
|
|
10
|
+
"apple_pay",
|
|
11
|
+
"bancomat",
|
|
12
|
+
"bancontact",
|
|
13
|
+
"boleto",
|
|
14
|
+
"card_unknown",
|
|
15
|
+
"conecs",
|
|
16
|
+
"diners_club",
|
|
17
|
+
"discover",
|
|
18
|
+
"eftpos",
|
|
19
|
+
"elo",
|
|
20
|
+
"elv",
|
|
21
|
+
"girocard",
|
|
22
|
+
"google_pay",
|
|
23
|
+
"hipercard",
|
|
24
|
+
"ideal",
|
|
25
|
+
"interac",
|
|
26
|
+
"jcb",
|
|
27
|
+
"klarna",
|
|
28
|
+
"maestro",
|
|
29
|
+
"mastercard",
|
|
30
|
+
"pay_pal",
|
|
31
|
+
"pix",
|
|
32
|
+
"pluxee",
|
|
33
|
+
"sodexo",
|
|
34
|
+
"sumup_card",
|
|
35
|
+
"sumup_pay",
|
|
36
|
+
"sumup_scheme",
|
|
37
|
+
"swile",
|
|
38
|
+
"ticket",
|
|
39
|
+
"union_pay",
|
|
40
|
+
"visa",
|
|
41
|
+
"visa_electron",
|
|
42
|
+
"vpay",
|
|
43
|
+
"vr",
|
|
44
|
+
];
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2026, SumUp Ltd.
|
|
3
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License.
|
|
5
|
+
* You may obtain a copy of the License at
|
|
6
|
+
*
|
|
7
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
*
|
|
9
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
* See the License for the specific language governing permissions and
|
|
13
|
+
* limitations under the License.
|
|
14
|
+
*/
|
|
15
|
+
import { type HTMLAttributes } from 'react';
|
|
16
|
+
import type { FLAGS } from './constants.js';
|
|
17
|
+
type CountryCode = (typeof FLAGS)[number];
|
|
18
|
+
type WithSize = {
|
|
19
|
+
/**
|
|
20
|
+
* Choose from 3 sizes.
|
|
21
|
+
*/
|
|
22
|
+
size?: 's' | 'm' | 'l';
|
|
23
|
+
width?: never;
|
|
24
|
+
height?: never;
|
|
25
|
+
};
|
|
26
|
+
type WithHeightWidth = {
|
|
27
|
+
/**
|
|
28
|
+
* The width of the flag image.
|
|
29
|
+
* @deprecated Use the `size` prop instead.
|
|
30
|
+
*/
|
|
31
|
+
width?: number;
|
|
32
|
+
height?: never;
|
|
33
|
+
size?: never;
|
|
34
|
+
} | {
|
|
35
|
+
/**
|
|
36
|
+
* The height of the flag image.
|
|
37
|
+
* @deprecated Use the `size` prop instead.
|
|
38
|
+
*/
|
|
39
|
+
height?: number;
|
|
40
|
+
width?: never;
|
|
41
|
+
size?: never;
|
|
42
|
+
};
|
|
43
|
+
export type FlagProps = HTMLAttributes<HTMLImageElement> & {
|
|
44
|
+
/**
|
|
45
|
+
* The code of the country flag to display, e.g. `'DE'`.
|
|
46
|
+
*/
|
|
47
|
+
countryCode: CountryCode;
|
|
48
|
+
/**
|
|
49
|
+
* The alt text for the flag image. Pass an empty string to hide purely
|
|
50
|
+
* decorative flags from assistive technology.
|
|
51
|
+
*/
|
|
52
|
+
alt: string;
|
|
53
|
+
/**
|
|
54
|
+
* Additional class name to apply to the flag wrapper.
|
|
55
|
+
*/
|
|
56
|
+
className?: string;
|
|
57
|
+
/**
|
|
58
|
+
* Additional class name to apply to the flag's inner image.
|
|
59
|
+
*/
|
|
60
|
+
imageClassName?: string;
|
|
61
|
+
} & (WithSize | WithHeightWidth);
|
|
62
|
+
/**
|
|
63
|
+
* Renders an SVG icon of a flag. Flags are sourced from: https://flagicons.lipis.dev/
|
|
64
|
+
*/
|
|
65
|
+
export declare const Flag: import("react").ForwardRefExoticComponent<FlagProps & import("react").RefAttributes<HTMLImageElement>>;
|
|
66
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
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
|
+
import { getIconURL } from '../../helpers.js';
|
|
18
|
+
import { ICON_SIZES } from '../../icon-sizes.js';
|
|
19
|
+
import { deprecate } from '../../logger.js';
|
|
20
|
+
const ASPECT_RATIO = 4 / 3;
|
|
21
|
+
// Inline styles can't use an `@supports` feature query, so `aspect-ratio`
|
|
22
|
+
// is applied as a progressive enhancement with no fallback for browsers
|
|
23
|
+
// that don't support it.
|
|
24
|
+
const WRAPPER_STYLE = {
|
|
25
|
+
display: 'flex',
|
|
26
|
+
alignItems: 'center',
|
|
27
|
+
justifyContent: 'center',
|
|
28
|
+
aspectRatio: '1 / 1',
|
|
29
|
+
};
|
|
30
|
+
const IMAGE_STYLE = {
|
|
31
|
+
border: '0.5px solid #ccc',
|
|
32
|
+
borderRadius: '2px',
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Renders an SVG icon of a flag. Flags are sourced from: https://flagicons.lipis.dev/
|
|
36
|
+
*/
|
|
37
|
+
export const Flag = forwardRef(({ countryCode, alt, className, imageClassName, style, size, width, height, ...props }, ref) => {
|
|
38
|
+
const flagName = `flag_${countryCode.toLowerCase()}`;
|
|
39
|
+
if (process.env.NODE_ENV !== 'production' && (width || height)) {
|
|
40
|
+
deprecate('Flag', 'The `width` and `height` props are deprecated. Use the `size` prop instead.');
|
|
41
|
+
}
|
|
42
|
+
if (size) {
|
|
43
|
+
const sizeValue = ICON_SIZES[size];
|
|
44
|
+
return (_jsx("div", { className: className, style: WRAPPER_STYLE, children: _jsx("img", { ref: ref, className: imageClassName, style: {
|
|
45
|
+
...IMAGE_STYLE,
|
|
46
|
+
width: sizeValue,
|
|
47
|
+
height: `calc(${sizeValue} * 3 / 4)`,
|
|
48
|
+
...style,
|
|
49
|
+
}, src: getIconURL(flagName), ...props, alt: alt }) }));
|
|
50
|
+
}
|
|
51
|
+
// default dimensions
|
|
52
|
+
const dimensions = { width: 16, height: 12 };
|
|
53
|
+
// for a consistent aspect ratio
|
|
54
|
+
if (height) {
|
|
55
|
+
dimensions.height = height;
|
|
56
|
+
dimensions.width = height * ASPECT_RATIO;
|
|
57
|
+
}
|
|
58
|
+
if (width) {
|
|
59
|
+
dimensions.width = width;
|
|
60
|
+
dimensions.height = width / ASPECT_RATIO;
|
|
61
|
+
}
|
|
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), ...props, alt: alt }) }));
|
|
63
|
+
});
|
|
64
|
+
Flag.displayName = 'Flag';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is auto-generated from manifest.json by `npm run build`.
|
|
3
|
+
* Do not edit it by hand, your changes will be overwritten.
|
|
4
|
+
* To add or remove an entry, edit manifest.json instead.
|
|
5
|
+
*/
|
|
6
|
+
export declare const FLAGS: readonly ["AD", "AE", "AF", "AG", "AI", "AL", "AM", "AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BQ", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CP", "CR", "CU", "CV", "CW", "CX", "CY", "CZ", "DE", "DG", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ES-CT", "ET", "EU", "FI", "FJ", "FK", "FM", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "IC", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IR", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MF", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PC", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW", "PY", "QA", "RE", "RO", "RS", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "SS", "ST", "SV", "SX", "SY", "SZ", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "UM", "UN", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS", "XK", "XX", "YE", "YT", "ZA", "ZM", "ZW"];
|