@digigov/react-icons 2.0.0-rc.1 → 2.0.0-rc.10
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/Base/index.d.ts +95 -0
- package/Base/index.js +69 -0
- package/Base/package.json +6 -0
- package/Icon/index.d.ts +1 -1
- package/Icon/index.js +1 -1
- package/SvgIcon/__snapshots__/index.test.tsx.snap +390 -0
- package/SvgIcon/index.d.ts +37 -0
- package/SvgIcon/index.js +26 -0
- package/SvgIcon/index.test/index.js +105 -0
- package/SvgIcon/index.test/package.json +6 -0
- package/SvgIcon/index.test.d.ts +1 -0
- package/SvgIcon/package.json +6 -0
- package/cjs/Base/index.js +75 -0
- package/cjs/Icon/index.js +1 -1
- package/cjs/SvgIcon/__snapshots__/index.test.tsx.snap +390 -0
- package/cjs/SvgIcon/index.js +33 -0
- package/cjs/SvgIcon/index.test/index.js +108 -0
- package/cjs/lazy/index.js +108 -0
- package/cjs/registry/index.js +4 -0
- package/index.js +1 -1
- package/lazy/index.js +84 -0
- package/lazy.d.ts +12 -0
- package/package.json +3 -3
- package/registry/index.js +4 -0
- package/registry.d.ts +2 -0
- package/src/Base/index.tsx +257 -0
- package/src/Icon/index.tsx +1 -1
- package/src/SvgIcon/__snapshots__/index.test.tsx.snap +390 -0
- package/src/SvgIcon/index.test.tsx +68 -0
- package/src/SvgIcon/index.tsx +72 -0
- package/src/lazy.js +12 -0
- package/src/registry.js +4 -0
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { mount } from 'enzyme';
|
|
3
|
+
import SvgIcon from '@digigov/react-icons/SvgIcon';
|
|
4
|
+
var _ref = /*#__PURE__*/React.createElement(SvgIcon, null);
|
|
5
|
+
it('renders the SvgIcon with no props', function () {
|
|
6
|
+
expect(mount(_ref)).toMatchSnapshot();
|
|
7
|
+
});
|
|
8
|
+
var _ref2 = /*#__PURE__*/React.createElement(SvgIcon, {
|
|
9
|
+
size: "xs"
|
|
10
|
+
}, "hello");
|
|
11
|
+
it('renders the SvgIcon with prop size=xs', function () {
|
|
12
|
+
expect(mount(_ref2)).toMatchSnapshot();
|
|
13
|
+
});
|
|
14
|
+
var _ref3 = /*#__PURE__*/React.createElement(SvgIcon, {
|
|
15
|
+
size: "sm"
|
|
16
|
+
}, "hello");
|
|
17
|
+
it('renders the SvgIcon with prop size=sm', function () {
|
|
18
|
+
expect(mount(_ref3)).toMatchSnapshot();
|
|
19
|
+
});
|
|
20
|
+
var _ref4 = /*#__PURE__*/React.createElement(SvgIcon, {
|
|
21
|
+
size: "md"
|
|
22
|
+
}, "hello");
|
|
23
|
+
it('renders the SvgIcon with prop size=md', function () {
|
|
24
|
+
expect(mount(_ref4)).toMatchSnapshot();
|
|
25
|
+
});
|
|
26
|
+
var _ref5 = /*#__PURE__*/React.createElement(SvgIcon, {
|
|
27
|
+
size: "lg"
|
|
28
|
+
}, "hello");
|
|
29
|
+
it('renders the SvgIcon with prop size=lg', function () {
|
|
30
|
+
expect(mount(_ref5)).toMatchSnapshot();
|
|
31
|
+
});
|
|
32
|
+
var _ref6 = /*#__PURE__*/React.createElement(SvgIcon, {
|
|
33
|
+
size: "xl"
|
|
34
|
+
}, "hello");
|
|
35
|
+
it('renders the SvgIcon with prop size=xl', function () {
|
|
36
|
+
expect(mount(_ref6)).toMatchSnapshot();
|
|
37
|
+
});
|
|
38
|
+
var _ref7 = /*#__PURE__*/React.createElement(SvgIcon, {
|
|
39
|
+
color: "base-content"
|
|
40
|
+
}, "hello");
|
|
41
|
+
it('renders the SvgIcon with prop color=base-content', function () {
|
|
42
|
+
expect(mount(_ref7)).toMatchSnapshot();
|
|
43
|
+
});
|
|
44
|
+
var _ref8 = /*#__PURE__*/React.createElement(SvgIcon, {
|
|
45
|
+
color: "dark"
|
|
46
|
+
}, "hello");
|
|
47
|
+
it('renders the SvgIcon with prop color=dark', function () {
|
|
48
|
+
expect(mount(_ref8)).toMatchSnapshot();
|
|
49
|
+
});
|
|
50
|
+
var _ref9 = /*#__PURE__*/React.createElement(SvgIcon, {
|
|
51
|
+
color: "white"
|
|
52
|
+
}, "hello");
|
|
53
|
+
it('renders the SvgIcon with prop color=white', function () {
|
|
54
|
+
expect(mount(_ref9)).toMatchSnapshot();
|
|
55
|
+
});
|
|
56
|
+
var _ref10 = /*#__PURE__*/React.createElement(SvgIcon, {
|
|
57
|
+
color: "gray"
|
|
58
|
+
}, "hello");
|
|
59
|
+
it('renders the SvgIcon with prop color=gray', function () {
|
|
60
|
+
expect(mount(_ref10)).toMatchSnapshot();
|
|
61
|
+
});
|
|
62
|
+
var _ref11 = /*#__PURE__*/React.createElement(SvgIcon, {
|
|
63
|
+
color: "primary"
|
|
64
|
+
}, "hello");
|
|
65
|
+
it('renders the SvgIcon with prop color=primary', function () {
|
|
66
|
+
expect(mount(_ref11)).toMatchSnapshot();
|
|
67
|
+
});
|
|
68
|
+
var _ref12 = /*#__PURE__*/React.createElement(SvgIcon, {
|
|
69
|
+
color: "success"
|
|
70
|
+
}, "hello");
|
|
71
|
+
it('renders the SvgIcon with prop color=success', function () {
|
|
72
|
+
expect(mount(_ref12)).toMatchSnapshot();
|
|
73
|
+
});
|
|
74
|
+
var _ref13 = /*#__PURE__*/React.createElement(SvgIcon, {
|
|
75
|
+
color: "warning"
|
|
76
|
+
}, "hello");
|
|
77
|
+
it('renders the SvgIcon with prop color=warning', function () {
|
|
78
|
+
expect(mount(_ref13)).toMatchSnapshot();
|
|
79
|
+
});
|
|
80
|
+
var _ref14 = /*#__PURE__*/React.createElement(SvgIcon, {
|
|
81
|
+
color: "error"
|
|
82
|
+
}, "hello");
|
|
83
|
+
it('renders the SvgIcon with prop color=error', function () {
|
|
84
|
+
expect(mount(_ref14)).toMatchSnapshot();
|
|
85
|
+
});
|
|
86
|
+
var _ref15 = /*#__PURE__*/React.createElement(SvgIcon, {
|
|
87
|
+
color: "focus"
|
|
88
|
+
}, "hello");
|
|
89
|
+
it('renders the SvgIcon with prop color=focus', function () {
|
|
90
|
+
expect(mount(_ref15)).toMatchSnapshot();
|
|
91
|
+
});
|
|
92
|
+
var _ref16 = /*#__PURE__*/React.createElement(SvgIcon, {
|
|
93
|
+
color: "warning",
|
|
94
|
+
size: "sm"
|
|
95
|
+
}, "hello");
|
|
96
|
+
it('renders the SvgIcon with prop color=warning and size=sm', function () {
|
|
97
|
+
expect(mount(_ref16)).toMatchSnapshot();
|
|
98
|
+
});
|
|
99
|
+
var _ref17 = /*#__PURE__*/React.createElement(SvgIcon, {
|
|
100
|
+
color: "warning",
|
|
101
|
+
size: "xl"
|
|
102
|
+
}, "hello");
|
|
103
|
+
it('renders the SvgIcon with prop color=error and size= xl', function () {
|
|
104
|
+
expect(mount(_ref17)).toMatchSnapshot();
|
|
105
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = exports.Base = void 0;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
12
|
+
var _excluded = ["as", "margin", "marginTop", "marginBottom", "marginLeft", "marginRight", "m", "mt", "mb", "ml", "mr", "mx", "my", "padding", "paddingTop", "paddingBottom", "paddingLeft", "paddingRight", "p", "pt", "pb", "pr", "pl", "px", "py", "printHidden", "printVisible", "hidden", "xsUpHidden", "smUpHidden", "mdUpHidden", "lgUpHidden", "xlUpHidden", "xsHidden", "smHidden", "mdHidden", "lgHidden", "xlHidden", "children", "className"];
|
|
13
|
+
// This is the first reusable type utility we built
|
|
14
|
+
|
|
15
|
+
// This is a new type utitlity with ref!
|
|
16
|
+
|
|
17
|
+
// This is the type for the "ref" only
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* This is the updated component props using PolymorphicComponentPropWithRef
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* This is the type used in the type annotation for the component
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
var Base = exports.Base = /*#__PURE__*/_react["default"].forwardRef(function Base(_ref, ref) {
|
|
28
|
+
var as = _ref.as,
|
|
29
|
+
margin = _ref.margin,
|
|
30
|
+
marginTop = _ref.marginTop,
|
|
31
|
+
marginBottom = _ref.marginBottom,
|
|
32
|
+
marginLeft = _ref.marginLeft,
|
|
33
|
+
marginRight = _ref.marginRight,
|
|
34
|
+
m = _ref.m,
|
|
35
|
+
mt = _ref.mt,
|
|
36
|
+
mb = _ref.mb,
|
|
37
|
+
ml = _ref.ml,
|
|
38
|
+
mr = _ref.mr,
|
|
39
|
+
mx = _ref.mx,
|
|
40
|
+
my = _ref.my,
|
|
41
|
+
padding = _ref.padding,
|
|
42
|
+
paddingTop = _ref.paddingTop,
|
|
43
|
+
paddingBottom = _ref.paddingBottom,
|
|
44
|
+
paddingLeft = _ref.paddingLeft,
|
|
45
|
+
paddingRight = _ref.paddingRight,
|
|
46
|
+
p = _ref.p,
|
|
47
|
+
pt = _ref.pt,
|
|
48
|
+
pb = _ref.pb,
|
|
49
|
+
pr = _ref.pr,
|
|
50
|
+
pl = _ref.pl,
|
|
51
|
+
px = _ref.px,
|
|
52
|
+
py = _ref.py,
|
|
53
|
+
printHidden = _ref.printHidden,
|
|
54
|
+
printVisible = _ref.printVisible,
|
|
55
|
+
hidden = _ref.hidden,
|
|
56
|
+
xsUpHidden = _ref.xsUpHidden,
|
|
57
|
+
smUpHidden = _ref.smUpHidden,
|
|
58
|
+
mdUpHidden = _ref.mdUpHidden,
|
|
59
|
+
lgUpHidden = _ref.lgUpHidden,
|
|
60
|
+
xlUpHidden = _ref.xlUpHidden,
|
|
61
|
+
xsHidden = _ref.xsHidden,
|
|
62
|
+
smHidden = _ref.smHidden,
|
|
63
|
+
mdHidden = _ref.mdHidden,
|
|
64
|
+
lgHidden = _ref.lgHidden,
|
|
65
|
+
xlHidden = _ref.xlHidden,
|
|
66
|
+
children = _ref.children,
|
|
67
|
+
className = _ref.className,
|
|
68
|
+
props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
69
|
+
var Component = as || 'span';
|
|
70
|
+
return /*#__PURE__*/_react["default"].createElement(Component, (0, _extends2["default"])({
|
|
71
|
+
className: (0, _clsx["default"])(className, (paddingBottom !== undefined ? true : undefined) && "ds-pb-".concat(paddingBottom), (marginBottom !== undefined ? true : undefined) && "ds-mb-".concat(marginBottom), (paddingRight !== undefined ? true : undefined) && "ds-pr-".concat(paddingRight), (marginRight !== undefined ? true : undefined) && "ds-mr-".concat(marginRight), (paddingLeft !== undefined ? true : undefined) && "ds-pl-".concat(paddingLeft), (marginLeft !== undefined ? true : undefined) && "ds-ml-".concat(marginLeft), (paddingTop !== undefined ? true : undefined) && "ds-pt-".concat(paddingTop), (marginTop !== undefined ? true : undefined) && "ds-mt-".concat(marginTop), (padding !== undefined ? true : undefined) && "ds-p-".concat(padding), (margin !== undefined ? true : undefined) && "ds-m-".concat(margin), (mt !== undefined ? true : undefined) && "ds-mt-".concat(mt), (mb !== undefined ? true : undefined) && "ds-mb-".concat(mb), (mr !== undefined ? true : undefined) && "ds-mr-".concat(mr), (ml !== undefined ? true : undefined) && "ds-ml-".concat(ml), (mx !== undefined ? true : undefined) && "ds-mx-".concat(mx), (my !== undefined ? true : undefined) && "ds-my-".concat(my), (pt !== undefined ? true : undefined) && "ds-pt-".concat(pt), (pb !== undefined ? true : undefined) && "ds-pb-".concat(pb), (pr !== undefined ? true : undefined) && "ds-pr-".concat(pr), (pl !== undefined ? true : undefined) && "ds-pl-".concat(pl), (px !== undefined ? true : undefined) && "ds-px-".concat(px), (py !== undefined ? true : undefined) && "ds-py-".concat(py), (m !== undefined ? true : undefined) && "ds-m-".concat(m), (p !== undefined ? true : undefined) && "ds-p-".concat(p), printVisible === 'inline' && 'ds-print-visible-inline', printVisible === 'block' && 'ds-print-visible-block', !!printHidden && 'ds-print-hidden', !!xsUpHidden && 'ds-hidden-xs-up', !!smUpHidden && 'ds-hidden-sm-up', !!mdUpHidden && 'ds-hidden-md-up', !!lgUpHidden && 'ds-hidden-lg-up', !!xlUpHidden && 'ds-hidden-xl-up', !!xsHidden && 'ds-hidden-xs', !!smHidden && 'ds-hidden-sm', !!mdHidden && 'ds-hidden-md', !!lgHidden && 'ds-hidden-lg', !!xlHidden && 'ds-hidden-xl', !!hidden && 'ds-hidden'),
|
|
72
|
+
ref: ref
|
|
73
|
+
}, props), children);
|
|
74
|
+
});
|
|
75
|
+
var _default = exports["default"] = Base;
|
package/cjs/Icon/index.js
CHANGED
|
@@ -11,7 +11,7 @@ var _extends3 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
11
11
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
12
12
|
var _react = _interopRequireDefault(require("react"));
|
|
13
13
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
14
|
-
var _SvgIcon = _interopRequireDefault(require("@digigov/react-
|
|
14
|
+
var _SvgIcon = _interopRequireDefault(require("@digigov/react-icons/SvgIcon"));
|
|
15
15
|
var icons = _interopRequireWildcard(require("@digigov/react-icons/icons"));
|
|
16
16
|
var _excluded = ["icon", "className"];
|
|
17
17
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
@@ -0,0 +1,390 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`renders the SvgIcon with no props 1`] = `
|
|
4
|
+
<ForwardRef(SvgIcon)>
|
|
5
|
+
<ForwardRef(Base)
|
|
6
|
+
aria-hidden="true"
|
|
7
|
+
as="svg"
|
|
8
|
+
className="ds-svg-icon"
|
|
9
|
+
focusable="false"
|
|
10
|
+
viewBox="0 0 24 24"
|
|
11
|
+
>
|
|
12
|
+
<svg
|
|
13
|
+
aria-hidden="true"
|
|
14
|
+
className="ds-svg-icon"
|
|
15
|
+
focusable="false"
|
|
16
|
+
viewBox="0 0 24 24"
|
|
17
|
+
/>
|
|
18
|
+
</ForwardRef(Base)>
|
|
19
|
+
</ForwardRef(SvgIcon)>
|
|
20
|
+
`;
|
|
21
|
+
|
|
22
|
+
exports[`renders the SvgIcon with prop color=base-content 1`] = `
|
|
23
|
+
<ForwardRef(SvgIcon)
|
|
24
|
+
color="base-content"
|
|
25
|
+
>
|
|
26
|
+
<ForwardRef(Base)
|
|
27
|
+
aria-hidden="true"
|
|
28
|
+
as="svg"
|
|
29
|
+
className="ds-svg-icon--base-content ds-svg-icon"
|
|
30
|
+
focusable="false"
|
|
31
|
+
viewBox="0 0 24 24"
|
|
32
|
+
>
|
|
33
|
+
<svg
|
|
34
|
+
aria-hidden="true"
|
|
35
|
+
className="ds-svg-icon--base-content ds-svg-icon"
|
|
36
|
+
focusable="false"
|
|
37
|
+
viewBox="0 0 24 24"
|
|
38
|
+
>
|
|
39
|
+
hello
|
|
40
|
+
</svg>
|
|
41
|
+
</ForwardRef(Base)>
|
|
42
|
+
</ForwardRef(SvgIcon)>
|
|
43
|
+
`;
|
|
44
|
+
|
|
45
|
+
exports[`renders the SvgIcon with prop color=dark 1`] = `
|
|
46
|
+
<ForwardRef(SvgIcon)
|
|
47
|
+
color="dark"
|
|
48
|
+
>
|
|
49
|
+
<ForwardRef(Base)
|
|
50
|
+
aria-hidden="true"
|
|
51
|
+
as="svg"
|
|
52
|
+
className="ds-svg-icon--dark ds-svg-icon"
|
|
53
|
+
focusable="false"
|
|
54
|
+
viewBox="0 0 24 24"
|
|
55
|
+
>
|
|
56
|
+
<svg
|
|
57
|
+
aria-hidden="true"
|
|
58
|
+
className="ds-svg-icon--dark ds-svg-icon"
|
|
59
|
+
focusable="false"
|
|
60
|
+
viewBox="0 0 24 24"
|
|
61
|
+
>
|
|
62
|
+
hello
|
|
63
|
+
</svg>
|
|
64
|
+
</ForwardRef(Base)>
|
|
65
|
+
</ForwardRef(SvgIcon)>
|
|
66
|
+
`;
|
|
67
|
+
|
|
68
|
+
exports[`renders the SvgIcon with prop color=error 1`] = `
|
|
69
|
+
<ForwardRef(SvgIcon)
|
|
70
|
+
color="error"
|
|
71
|
+
>
|
|
72
|
+
<ForwardRef(Base)
|
|
73
|
+
aria-hidden="true"
|
|
74
|
+
as="svg"
|
|
75
|
+
className="ds-svg-icon--error ds-svg-icon"
|
|
76
|
+
focusable="false"
|
|
77
|
+
viewBox="0 0 24 24"
|
|
78
|
+
>
|
|
79
|
+
<svg
|
|
80
|
+
aria-hidden="true"
|
|
81
|
+
className="ds-svg-icon--error ds-svg-icon"
|
|
82
|
+
focusable="false"
|
|
83
|
+
viewBox="0 0 24 24"
|
|
84
|
+
>
|
|
85
|
+
hello
|
|
86
|
+
</svg>
|
|
87
|
+
</ForwardRef(Base)>
|
|
88
|
+
</ForwardRef(SvgIcon)>
|
|
89
|
+
`;
|
|
90
|
+
|
|
91
|
+
exports[`renders the SvgIcon with prop color=error and size= xl 1`] = `
|
|
92
|
+
<ForwardRef(SvgIcon)
|
|
93
|
+
color="warning"
|
|
94
|
+
size="xl"
|
|
95
|
+
>
|
|
96
|
+
<ForwardRef(Base)
|
|
97
|
+
aria-hidden="true"
|
|
98
|
+
as="svg"
|
|
99
|
+
className="ds-svg-icon--warning ds-svg-icon--xl ds-svg-icon"
|
|
100
|
+
focusable="false"
|
|
101
|
+
viewBox="0 0 24 24"
|
|
102
|
+
>
|
|
103
|
+
<svg
|
|
104
|
+
aria-hidden="true"
|
|
105
|
+
className="ds-svg-icon--warning ds-svg-icon--xl ds-svg-icon"
|
|
106
|
+
focusable="false"
|
|
107
|
+
viewBox="0 0 24 24"
|
|
108
|
+
>
|
|
109
|
+
hello
|
|
110
|
+
</svg>
|
|
111
|
+
</ForwardRef(Base)>
|
|
112
|
+
</ForwardRef(SvgIcon)>
|
|
113
|
+
`;
|
|
114
|
+
|
|
115
|
+
exports[`renders the SvgIcon with prop color=focus 1`] = `
|
|
116
|
+
<ForwardRef(SvgIcon)
|
|
117
|
+
color="focus"
|
|
118
|
+
>
|
|
119
|
+
<ForwardRef(Base)
|
|
120
|
+
aria-hidden="true"
|
|
121
|
+
as="svg"
|
|
122
|
+
className="ds-svg-icon--focus ds-svg-icon"
|
|
123
|
+
focusable="false"
|
|
124
|
+
viewBox="0 0 24 24"
|
|
125
|
+
>
|
|
126
|
+
<svg
|
|
127
|
+
aria-hidden="true"
|
|
128
|
+
className="ds-svg-icon--focus ds-svg-icon"
|
|
129
|
+
focusable="false"
|
|
130
|
+
viewBox="0 0 24 24"
|
|
131
|
+
>
|
|
132
|
+
hello
|
|
133
|
+
</svg>
|
|
134
|
+
</ForwardRef(Base)>
|
|
135
|
+
</ForwardRef(SvgIcon)>
|
|
136
|
+
`;
|
|
137
|
+
|
|
138
|
+
exports[`renders the SvgIcon with prop color=gray 1`] = `
|
|
139
|
+
<ForwardRef(SvgIcon)
|
|
140
|
+
color="gray"
|
|
141
|
+
>
|
|
142
|
+
<ForwardRef(Base)
|
|
143
|
+
aria-hidden="true"
|
|
144
|
+
as="svg"
|
|
145
|
+
className="ds-svg-icon--gray ds-svg-icon"
|
|
146
|
+
focusable="false"
|
|
147
|
+
viewBox="0 0 24 24"
|
|
148
|
+
>
|
|
149
|
+
<svg
|
|
150
|
+
aria-hidden="true"
|
|
151
|
+
className="ds-svg-icon--gray ds-svg-icon"
|
|
152
|
+
focusable="false"
|
|
153
|
+
viewBox="0 0 24 24"
|
|
154
|
+
>
|
|
155
|
+
hello
|
|
156
|
+
</svg>
|
|
157
|
+
</ForwardRef(Base)>
|
|
158
|
+
</ForwardRef(SvgIcon)>
|
|
159
|
+
`;
|
|
160
|
+
|
|
161
|
+
exports[`renders the SvgIcon with prop color=primary 1`] = `
|
|
162
|
+
<ForwardRef(SvgIcon)
|
|
163
|
+
color="primary"
|
|
164
|
+
>
|
|
165
|
+
<ForwardRef(Base)
|
|
166
|
+
aria-hidden="true"
|
|
167
|
+
as="svg"
|
|
168
|
+
className="ds-svg-icon--primary ds-svg-icon"
|
|
169
|
+
focusable="false"
|
|
170
|
+
viewBox="0 0 24 24"
|
|
171
|
+
>
|
|
172
|
+
<svg
|
|
173
|
+
aria-hidden="true"
|
|
174
|
+
className="ds-svg-icon--primary ds-svg-icon"
|
|
175
|
+
focusable="false"
|
|
176
|
+
viewBox="0 0 24 24"
|
|
177
|
+
>
|
|
178
|
+
hello
|
|
179
|
+
</svg>
|
|
180
|
+
</ForwardRef(Base)>
|
|
181
|
+
</ForwardRef(SvgIcon)>
|
|
182
|
+
`;
|
|
183
|
+
|
|
184
|
+
exports[`renders the SvgIcon with prop color=success 1`] = `
|
|
185
|
+
<ForwardRef(SvgIcon)
|
|
186
|
+
color="success"
|
|
187
|
+
>
|
|
188
|
+
<ForwardRef(Base)
|
|
189
|
+
aria-hidden="true"
|
|
190
|
+
as="svg"
|
|
191
|
+
className="ds-svg-icon--success ds-svg-icon"
|
|
192
|
+
focusable="false"
|
|
193
|
+
viewBox="0 0 24 24"
|
|
194
|
+
>
|
|
195
|
+
<svg
|
|
196
|
+
aria-hidden="true"
|
|
197
|
+
className="ds-svg-icon--success ds-svg-icon"
|
|
198
|
+
focusable="false"
|
|
199
|
+
viewBox="0 0 24 24"
|
|
200
|
+
>
|
|
201
|
+
hello
|
|
202
|
+
</svg>
|
|
203
|
+
</ForwardRef(Base)>
|
|
204
|
+
</ForwardRef(SvgIcon)>
|
|
205
|
+
`;
|
|
206
|
+
|
|
207
|
+
exports[`renders the SvgIcon with prop color=warning 1`] = `
|
|
208
|
+
<ForwardRef(SvgIcon)
|
|
209
|
+
color="warning"
|
|
210
|
+
>
|
|
211
|
+
<ForwardRef(Base)
|
|
212
|
+
aria-hidden="true"
|
|
213
|
+
as="svg"
|
|
214
|
+
className="ds-svg-icon--warning ds-svg-icon"
|
|
215
|
+
focusable="false"
|
|
216
|
+
viewBox="0 0 24 24"
|
|
217
|
+
>
|
|
218
|
+
<svg
|
|
219
|
+
aria-hidden="true"
|
|
220
|
+
className="ds-svg-icon--warning ds-svg-icon"
|
|
221
|
+
focusable="false"
|
|
222
|
+
viewBox="0 0 24 24"
|
|
223
|
+
>
|
|
224
|
+
hello
|
|
225
|
+
</svg>
|
|
226
|
+
</ForwardRef(Base)>
|
|
227
|
+
</ForwardRef(SvgIcon)>
|
|
228
|
+
`;
|
|
229
|
+
|
|
230
|
+
exports[`renders the SvgIcon with prop color=warning and size=sm 1`] = `
|
|
231
|
+
<ForwardRef(SvgIcon)
|
|
232
|
+
color="warning"
|
|
233
|
+
size="sm"
|
|
234
|
+
>
|
|
235
|
+
<ForwardRef(Base)
|
|
236
|
+
aria-hidden="true"
|
|
237
|
+
as="svg"
|
|
238
|
+
className="ds-svg-icon--warning ds-svg-icon--sm ds-svg-icon"
|
|
239
|
+
focusable="false"
|
|
240
|
+
viewBox="0 0 24 24"
|
|
241
|
+
>
|
|
242
|
+
<svg
|
|
243
|
+
aria-hidden="true"
|
|
244
|
+
className="ds-svg-icon--warning ds-svg-icon--sm ds-svg-icon"
|
|
245
|
+
focusable="false"
|
|
246
|
+
viewBox="0 0 24 24"
|
|
247
|
+
>
|
|
248
|
+
hello
|
|
249
|
+
</svg>
|
|
250
|
+
</ForwardRef(Base)>
|
|
251
|
+
</ForwardRef(SvgIcon)>
|
|
252
|
+
`;
|
|
253
|
+
|
|
254
|
+
exports[`renders the SvgIcon with prop color=white 1`] = `
|
|
255
|
+
<ForwardRef(SvgIcon)
|
|
256
|
+
color="white"
|
|
257
|
+
>
|
|
258
|
+
<ForwardRef(Base)
|
|
259
|
+
aria-hidden="true"
|
|
260
|
+
as="svg"
|
|
261
|
+
className="ds-svg-icon--white ds-svg-icon"
|
|
262
|
+
focusable="false"
|
|
263
|
+
viewBox="0 0 24 24"
|
|
264
|
+
>
|
|
265
|
+
<svg
|
|
266
|
+
aria-hidden="true"
|
|
267
|
+
className="ds-svg-icon--white ds-svg-icon"
|
|
268
|
+
focusable="false"
|
|
269
|
+
viewBox="0 0 24 24"
|
|
270
|
+
>
|
|
271
|
+
hello
|
|
272
|
+
</svg>
|
|
273
|
+
</ForwardRef(Base)>
|
|
274
|
+
</ForwardRef(SvgIcon)>
|
|
275
|
+
`;
|
|
276
|
+
|
|
277
|
+
exports[`renders the SvgIcon with prop size=lg 1`] = `
|
|
278
|
+
<ForwardRef(SvgIcon)
|
|
279
|
+
size="lg"
|
|
280
|
+
>
|
|
281
|
+
<ForwardRef(Base)
|
|
282
|
+
aria-hidden="true"
|
|
283
|
+
as="svg"
|
|
284
|
+
className="ds-svg-icon--lg ds-svg-icon"
|
|
285
|
+
focusable="false"
|
|
286
|
+
viewBox="0 0 24 24"
|
|
287
|
+
>
|
|
288
|
+
<svg
|
|
289
|
+
aria-hidden="true"
|
|
290
|
+
className="ds-svg-icon--lg ds-svg-icon"
|
|
291
|
+
focusable="false"
|
|
292
|
+
viewBox="0 0 24 24"
|
|
293
|
+
>
|
|
294
|
+
hello
|
|
295
|
+
</svg>
|
|
296
|
+
</ForwardRef(Base)>
|
|
297
|
+
</ForwardRef(SvgIcon)>
|
|
298
|
+
`;
|
|
299
|
+
|
|
300
|
+
exports[`renders the SvgIcon with prop size=md 1`] = `
|
|
301
|
+
<ForwardRef(SvgIcon)
|
|
302
|
+
size="md"
|
|
303
|
+
>
|
|
304
|
+
<ForwardRef(Base)
|
|
305
|
+
aria-hidden="true"
|
|
306
|
+
as="svg"
|
|
307
|
+
className="ds-svg-icon--md ds-svg-icon"
|
|
308
|
+
focusable="false"
|
|
309
|
+
viewBox="0 0 24 24"
|
|
310
|
+
>
|
|
311
|
+
<svg
|
|
312
|
+
aria-hidden="true"
|
|
313
|
+
className="ds-svg-icon--md ds-svg-icon"
|
|
314
|
+
focusable="false"
|
|
315
|
+
viewBox="0 0 24 24"
|
|
316
|
+
>
|
|
317
|
+
hello
|
|
318
|
+
</svg>
|
|
319
|
+
</ForwardRef(Base)>
|
|
320
|
+
</ForwardRef(SvgIcon)>
|
|
321
|
+
`;
|
|
322
|
+
|
|
323
|
+
exports[`renders the SvgIcon with prop size=sm 1`] = `
|
|
324
|
+
<ForwardRef(SvgIcon)
|
|
325
|
+
size="sm"
|
|
326
|
+
>
|
|
327
|
+
<ForwardRef(Base)
|
|
328
|
+
aria-hidden="true"
|
|
329
|
+
as="svg"
|
|
330
|
+
className="ds-svg-icon--sm ds-svg-icon"
|
|
331
|
+
focusable="false"
|
|
332
|
+
viewBox="0 0 24 24"
|
|
333
|
+
>
|
|
334
|
+
<svg
|
|
335
|
+
aria-hidden="true"
|
|
336
|
+
className="ds-svg-icon--sm ds-svg-icon"
|
|
337
|
+
focusable="false"
|
|
338
|
+
viewBox="0 0 24 24"
|
|
339
|
+
>
|
|
340
|
+
hello
|
|
341
|
+
</svg>
|
|
342
|
+
</ForwardRef(Base)>
|
|
343
|
+
</ForwardRef(SvgIcon)>
|
|
344
|
+
`;
|
|
345
|
+
|
|
346
|
+
exports[`renders the SvgIcon with prop size=xl 1`] = `
|
|
347
|
+
<ForwardRef(SvgIcon)
|
|
348
|
+
size="xl"
|
|
349
|
+
>
|
|
350
|
+
<ForwardRef(Base)
|
|
351
|
+
aria-hidden="true"
|
|
352
|
+
as="svg"
|
|
353
|
+
className="ds-svg-icon--xl ds-svg-icon"
|
|
354
|
+
focusable="false"
|
|
355
|
+
viewBox="0 0 24 24"
|
|
356
|
+
>
|
|
357
|
+
<svg
|
|
358
|
+
aria-hidden="true"
|
|
359
|
+
className="ds-svg-icon--xl ds-svg-icon"
|
|
360
|
+
focusable="false"
|
|
361
|
+
viewBox="0 0 24 24"
|
|
362
|
+
>
|
|
363
|
+
hello
|
|
364
|
+
</svg>
|
|
365
|
+
</ForwardRef(Base)>
|
|
366
|
+
</ForwardRef(SvgIcon)>
|
|
367
|
+
`;
|
|
368
|
+
|
|
369
|
+
exports[`renders the SvgIcon with prop size=xs 1`] = `
|
|
370
|
+
<ForwardRef(SvgIcon)
|
|
371
|
+
size="xs"
|
|
372
|
+
>
|
|
373
|
+
<ForwardRef(Base)
|
|
374
|
+
aria-hidden="true"
|
|
375
|
+
as="svg"
|
|
376
|
+
className="ds-svg-icon--xs ds-svg-icon"
|
|
377
|
+
focusable="false"
|
|
378
|
+
viewBox="0 0 24 24"
|
|
379
|
+
>
|
|
380
|
+
<svg
|
|
381
|
+
aria-hidden="true"
|
|
382
|
+
className="ds-svg-icon--xs ds-svg-icon"
|
|
383
|
+
focusable="false"
|
|
384
|
+
viewBox="0 0 24 24"
|
|
385
|
+
>
|
|
386
|
+
hello
|
|
387
|
+
</svg>
|
|
388
|
+
</ForwardRef(Base)>
|
|
389
|
+
</ForwardRef(SvgIcon)>
|
|
390
|
+
`;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = exports.SvgIcon = void 0;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
12
|
+
var _Base = _interopRequireDefault(require("@digigov/react-icons/Base"));
|
|
13
|
+
var _excluded = ["size", "color", "children", "className"];
|
|
14
|
+
/**
|
|
15
|
+
* Use SvgIcon as global svg component.
|
|
16
|
+
* SvgIcon can be used inside other svg components as children such as CheckIcon, CaretIcon etc.
|
|
17
|
+
*/
|
|
18
|
+
var SvgIcon = exports.SvgIcon = /*#__PURE__*/_react["default"].forwardRef(function SvgIcon(_ref, ref) {
|
|
19
|
+
var size = _ref.size,
|
|
20
|
+
color = _ref.color,
|
|
21
|
+
children = _ref.children,
|
|
22
|
+
className = _ref.className,
|
|
23
|
+
props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
24
|
+
return /*#__PURE__*/_react["default"].createElement(_Base["default"], (0, _extends2["default"])({
|
|
25
|
+
as: "svg",
|
|
26
|
+
ref: ref,
|
|
27
|
+
className: (0, _clsx["default"])(className, color !== undefined && "ds-svg-icon--".concat(color), size !== undefined && "ds-svg-icon--".concat(size), true && 'ds-svg-icon'),
|
|
28
|
+
focusable: "false",
|
|
29
|
+
viewBox: "0 0 24 24",
|
|
30
|
+
"aria-hidden": "true"
|
|
31
|
+
}, props), children);
|
|
32
|
+
});
|
|
33
|
+
var _default = exports["default"] = SvgIcon;
|