1 | "use strict";
|
2 |
|
3 | var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
4 |
|
5 | var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
6 |
|
7 | Object.defineProperty(exports, "__esModule", {
|
8 | value: true
|
9 | });
|
10 | exports.default = exports.styles = void 0;
|
11 |
|
12 | var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
13 |
|
14 | var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
15 |
|
16 | var React = _interopRequireWildcard(require("react"));
|
17 |
|
18 | var _propTypes = _interopRequireDefault(require("prop-types"));
|
19 |
|
20 | var _clsx = _interopRequireDefault(require("clsx"));
|
21 |
|
22 | var _withStyles = _interopRequireDefault(require("../styles/withStyles"));
|
23 |
|
24 | var _capitalize = _interopRequireDefault(require("../utils/capitalize"));
|
25 |
|
26 | var styles = function styles(theme) {
|
27 | return {
|
28 |
|
29 | root: {
|
30 | userSelect: 'none',
|
31 | width: '1em',
|
32 | height: '1em',
|
33 | display: 'inline-block',
|
34 | fill: 'currentColor',
|
35 | flexShrink: 0,
|
36 | fontSize: theme.typography.pxToRem(24),
|
37 | transition: theme.transitions.create('fill', {
|
38 | duration: theme.transitions.duration.shorter
|
39 | })
|
40 | },
|
41 |
|
42 |
|
43 | colorPrimary: {
|
44 | color: theme.palette.primary.main
|
45 | },
|
46 |
|
47 |
|
48 | colorSecondary: {
|
49 | color: theme.palette.secondary.main
|
50 | },
|
51 |
|
52 |
|
53 | colorAction: {
|
54 | color: theme.palette.action.active
|
55 | },
|
56 |
|
57 |
|
58 | colorError: {
|
59 | color: theme.palette.error.main
|
60 | },
|
61 |
|
62 |
|
63 | colorDisabled: {
|
64 | color: theme.palette.action.disabled
|
65 | },
|
66 |
|
67 |
|
68 | fontSizeInherit: {
|
69 | fontSize: 'inherit'
|
70 | },
|
71 |
|
72 |
|
73 | fontSizeSmall: {
|
74 | fontSize: theme.typography.pxToRem(20)
|
75 | },
|
76 |
|
77 |
|
78 | fontSizeLarge: {
|
79 | fontSize: theme.typography.pxToRem(35)
|
80 | }
|
81 | };
|
82 | };
|
83 |
|
84 | exports.styles = styles;
|
85 | var SvgIcon = React.forwardRef(function SvgIcon(props, ref) {
|
86 | var children = props.children,
|
87 | classes = props.classes,
|
88 | className = props.className,
|
89 | _props$color = props.color,
|
90 | color = _props$color === void 0 ? 'inherit' : _props$color,
|
91 | _props$component = props.component,
|
92 | Component = _props$component === void 0 ? 'svg' : _props$component,
|
93 | _props$fontSize = props.fontSize,
|
94 | fontSize = _props$fontSize === void 0 ? 'default' : _props$fontSize,
|
95 | htmlColor = props.htmlColor,
|
96 | titleAccess = props.titleAccess,
|
97 | _props$viewBox = props.viewBox,
|
98 | viewBox = _props$viewBox === void 0 ? '0 0 24 24' : _props$viewBox,
|
99 | other = (0, _objectWithoutProperties2.default)(props, ["children", "classes", "className", "color", "component", "fontSize", "htmlColor", "titleAccess", "viewBox"]);
|
100 | return React.createElement(Component, (0, _extends2.default)({
|
101 | className: (0, _clsx.default)(classes.root, className, color !== 'inherit' && classes["color".concat((0, _capitalize.default)(color))], fontSize !== 'default' && classes["fontSize".concat((0, _capitalize.default)(fontSize))]),
|
102 | focusable: "false",
|
103 | viewBox: viewBox,
|
104 | color: htmlColor,
|
105 | "aria-hidden": titleAccess ? undefined : true,
|
106 | role: titleAccess ? 'img' : undefined,
|
107 | ref: ref
|
108 | }, other), children, titleAccess ? React.createElement("title", null, titleAccess) : null);
|
109 | });
|
110 | process.env.NODE_ENV !== "production" ? SvgIcon.propTypes = {
|
111 |
|
112 |
|
113 |
|
114 |
|
115 |
|
116 | |
117 |
|
118 |
|
119 | children: _propTypes.default.node,
|
120 |
|
121 | |
122 |
|
123 |
|
124 |
|
125 | classes: _propTypes.default.object,
|
126 |
|
127 | |
128 |
|
129 |
|
130 | className: _propTypes.default.string,
|
131 |
|
132 | |
133 |
|
134 |
|
135 |
|
136 | color: _propTypes.default.oneOf(['action', 'disabled', 'error', 'inherit', 'primary', 'secondary']),
|
137 |
|
138 | |
139 |
|
140 |
|
141 |
|
142 | component: _propTypes.default
|
143 |
|
144 | .elementType,
|
145 |
|
146 | |
147 |
|
148 |
|
149 | fontSize: _propTypes.default.oneOf(['default', 'inherit', 'large', 'small']),
|
150 |
|
151 | |
152 |
|
153 |
|
154 | htmlColor: _propTypes.default.string,
|
155 |
|
156 | |
157 |
|
158 |
|
159 |
|
160 |
|
161 | shapeRendering: _propTypes.default.string,
|
162 |
|
163 | |
164 |
|
165 |
|
166 |
|
167 | titleAccess: _propTypes.default.string,
|
168 |
|
169 | |
170 |
|
171 |
|
172 |
|
173 |
|
174 |
|
175 |
|
176 | viewBox: _propTypes.default.string
|
177 | } : void 0;
|
178 | SvgIcon.muiName = 'SvgIcon';
|
179 |
|
180 | var _default = (0, _withStyles.default)(styles, {
|
181 | name: 'MuiSvgIcon'
|
182 | })(SvgIcon);
|
183 |
|
184 | exports.default = _default; |
\ | No newline at end of file |