@fangzsx/component-library 0.0.7 → 0.0.9

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.
@@ -0,0 +1,242 @@
1
+ import * as a from "react";
2
+ import { jsxs as I, jsx as g } from "react/jsx-runtime";
3
+ import { g as w, a as N, u as C, s as O, c as T, b as c, d as R, m as E, P as e } from "./ButtonBase-CAtBagnK.js";
4
+ function j(o) {
5
+ return w("MuiSvgIcon", o);
6
+ }
7
+ N("MuiSvgIcon", ["root", "colorPrimary", "colorSecondary", "colorAction", "colorError", "colorDisabled", "fontSizeInherit", "fontSizeSmall", "fontSizeMedium", "fontSizeLarge"]);
8
+ const V = (o) => {
9
+ const {
10
+ color: r,
11
+ fontSize: n,
12
+ classes: i
13
+ } = o, t = {
14
+ root: ["root", r !== "inherit" && `color${c(r)}`, `fontSize${c(n)}`]
15
+ };
16
+ return R(t, j, i);
17
+ }, $ = O("svg", {
18
+ name: "MuiSvgIcon",
19
+ slot: "Root",
20
+ overridesResolver: (o, r) => {
21
+ const {
22
+ ownerState: n
23
+ } = o;
24
+ return [r.root, n.color !== "inherit" && r[`color${c(n.color)}`], r[`fontSize${c(n.fontSize)}`]];
25
+ }
26
+ })(E(({
27
+ theme: o
28
+ }) => ({
29
+ userSelect: "none",
30
+ width: "1em",
31
+ height: "1em",
32
+ display: "inline-block",
33
+ flexShrink: 0,
34
+ transition: o.transitions?.create?.("fill", {
35
+ duration: (o.vars ?? o).transitions?.duration?.shorter
36
+ }),
37
+ variants: [
38
+ {
39
+ props: (r) => !r.hasSvgAsChild,
40
+ style: {
41
+ // the <svg> will define the property that has `currentColor`
42
+ // for example heroicons uses fill="none" and stroke="currentColor"
43
+ fill: "currentColor"
44
+ }
45
+ },
46
+ {
47
+ props: {
48
+ fontSize: "inherit"
49
+ },
50
+ style: {
51
+ fontSize: "inherit"
52
+ }
53
+ },
54
+ {
55
+ props: {
56
+ fontSize: "small"
57
+ },
58
+ style: {
59
+ fontSize: o.typography?.pxToRem?.(20) || "1.25rem"
60
+ }
61
+ },
62
+ {
63
+ props: {
64
+ fontSize: "medium"
65
+ },
66
+ style: {
67
+ fontSize: o.typography?.pxToRem?.(24) || "1.5rem"
68
+ }
69
+ },
70
+ {
71
+ props: {
72
+ fontSize: "large"
73
+ },
74
+ style: {
75
+ fontSize: o.typography?.pxToRem?.(35) || "2.1875rem"
76
+ }
77
+ },
78
+ // TODO v5 deprecate color prop, v6 remove for sx
79
+ ...Object.entries((o.vars ?? o).palette).filter(([, r]) => r && r.main).map(([r]) => ({
80
+ props: {
81
+ color: r
82
+ },
83
+ style: {
84
+ color: (o.vars ?? o).palette?.[r]?.main
85
+ }
86
+ })),
87
+ {
88
+ props: {
89
+ color: "action"
90
+ },
91
+ style: {
92
+ color: (o.vars ?? o).palette?.action?.active
93
+ }
94
+ },
95
+ {
96
+ props: {
97
+ color: "disabled"
98
+ },
99
+ style: {
100
+ color: (o.vars ?? o).palette?.action?.disabled
101
+ }
102
+ },
103
+ {
104
+ props: {
105
+ color: "inherit"
106
+ },
107
+ style: {
108
+ color: void 0
109
+ }
110
+ }
111
+ ]
112
+ }))), l = /* @__PURE__ */ a.forwardRef(function(r, n) {
113
+ const i = C({
114
+ props: r,
115
+ name: "MuiSvgIcon"
116
+ }), {
117
+ children: t,
118
+ className: y,
119
+ color: v = "inherit",
120
+ component: f = "svg",
121
+ fontSize: h = "medium",
122
+ htmlColor: z,
123
+ inheritViewBox: d = !1,
124
+ titleAccess: s,
125
+ viewBox: m = "0 0 24 24",
126
+ ...x
127
+ } = i, p = /* @__PURE__ */ a.isValidElement(t) && t.type === "svg", u = {
128
+ ...i,
129
+ color: v,
130
+ component: f,
131
+ fontSize: h,
132
+ instanceFontSize: r.fontSize,
133
+ inheritViewBox: d,
134
+ viewBox: m,
135
+ hasSvgAsChild: p
136
+ }, S = {};
137
+ d || (S.viewBox = m);
138
+ const b = V(u);
139
+ return /* @__PURE__ */ I($, {
140
+ as: f,
141
+ className: T(b.root, y),
142
+ focusable: "false",
143
+ color: z,
144
+ "aria-hidden": s ? void 0 : !0,
145
+ role: s ? "img" : void 0,
146
+ ref: n,
147
+ ...S,
148
+ ...x,
149
+ ...p && t.props,
150
+ ownerState: u,
151
+ children: [p ? t.props.children : t, s ? /* @__PURE__ */ g("title", {
152
+ children: s
153
+ }) : null]
154
+ });
155
+ });
156
+ process.env.NODE_ENV !== "production" && (l.propTypes = {
157
+ // ┌────────────────────────────── Warning ──────────────────────────────┐
158
+ // │ These PropTypes are generated from the TypeScript type definitions. │
159
+ // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
160
+ // └─────────────────────────────────────────────────────────────────────┘
161
+ /**
162
+ * Node passed into the SVG element.
163
+ */
164
+ children: e.node,
165
+ /**
166
+ * Override or extend the styles applied to the component.
167
+ */
168
+ classes: e.object,
169
+ /**
170
+ * @ignore
171
+ */
172
+ className: e.string,
173
+ /**
174
+ * The color of the component.
175
+ * It supports both default and custom theme colors, which can be added as shown in the
176
+ * [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
177
+ * You can use the `htmlColor` prop to apply a color attribute to the SVG element.
178
+ * @default 'inherit'
179
+ */
180
+ color: e.oneOfType([e.oneOf(["inherit", "action", "disabled", "primary", "secondary", "error", "info", "success", "warning"]), e.string]),
181
+ /**
182
+ * The component used for the root node.
183
+ * Either a string to use a HTML element or a component.
184
+ */
185
+ component: e.elementType,
186
+ /**
187
+ * The fontSize applied to the icon. Defaults to 24px, but can be configure to inherit font size.
188
+ * @default 'medium'
189
+ */
190
+ fontSize: e.oneOfType([e.oneOf(["inherit", "large", "medium", "small"]), e.string]),
191
+ /**
192
+ * Applies a color attribute to the SVG element.
193
+ */
194
+ htmlColor: e.string,
195
+ /**
196
+ * If `true`, the root node will inherit the custom `component`'s viewBox and the `viewBox`
197
+ * prop will be ignored.
198
+ * Useful when you want to reference a custom `component` and have `SvgIcon` pass that
199
+ * `component`'s viewBox to the root node.
200
+ * @default false
201
+ */
202
+ inheritViewBox: e.bool,
203
+ /**
204
+ * The shape-rendering attribute. The behavior of the different options is described on the
205
+ * [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Attribute/shape-rendering).
206
+ * If you are having issues with blurry icons you should investigate this prop.
207
+ */
208
+ shapeRendering: e.string,
209
+ /**
210
+ * The system prop that allows defining system overrides as well as additional CSS styles.
211
+ */
212
+ sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object]),
213
+ /**
214
+ * Provides a human-readable title for the element that contains it.
215
+ * https://www.w3.org/TR/SVG-access/#Equivalent
216
+ */
217
+ titleAccess: e.string,
218
+ /**
219
+ * Allows you to redefine what the coordinates without units mean inside an SVG element.
220
+ * For example, if the SVG element is 500 (width) by 200 (height),
221
+ * and you pass viewBox="0 0 50 20",
222
+ * this means that the coordinates inside the SVG will go from the top left corner (0,0)
223
+ * to bottom right (50,20) and each unit will be worth 10px.
224
+ * @default '0 0 24 24'
225
+ */
226
+ viewBox: e.string
227
+ });
228
+ l.muiName = "SvgIcon";
229
+ function D(o, r) {
230
+ function n(i, t) {
231
+ return /* @__PURE__ */ g(l, {
232
+ "data-testid": process.env.NODE_ENV !== "production" ? `${r}Icon` : void 0,
233
+ ref: t,
234
+ ...i,
235
+ children: o
236
+ });
237
+ }
238
+ return process.env.NODE_ENV !== "production" && (n.displayName = `${r}Icon`), n.muiName = l.muiName, /* @__PURE__ */ a.memo(/* @__PURE__ */ a.forwardRef(n));
239
+ }
240
+ export {
241
+ D as c
242
+ };