ali-mohammadi-design-system 2.0.2 → 2.0.5
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/index.cjs +20 -25
- package/dist/index.js +314 -446
- package/package.json +9 -1
- package/src/components/Button/Button.jsx +2 -1
- package/src/index.js +4 -0
- package/src/utils/animations.js +159 -0
- package/src/utils/index.js +4 -0
- package/src/utils/useMUI.js +77 -0
package/dist/index.js
CHANGED
|
@@ -1,266 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
function me() {
|
|
6
|
-
if (L) return h;
|
|
7
|
-
L = 1;
|
|
8
|
-
var o = /* @__PURE__ */ Symbol.for("react.transitional.element"), n = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
9
|
-
function t(r, a, i) {
|
|
10
|
-
var l = null;
|
|
11
|
-
if (i !== void 0 && (l = "" + i), a.key !== void 0 && (l = "" + a.key), "key" in a) {
|
|
12
|
-
i = {};
|
|
13
|
-
for (var c in a)
|
|
14
|
-
c !== "key" && (i[c] = a[c]);
|
|
15
|
-
} else i = a;
|
|
16
|
-
return a = i.ref, {
|
|
17
|
-
$$typeof: o,
|
|
18
|
-
type: r,
|
|
19
|
-
key: l,
|
|
20
|
-
ref: a !== void 0 ? a : null,
|
|
21
|
-
props: i
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
return h.Fragment = n, h.jsx = t, h.jsxs = t, h;
|
|
25
|
-
}
|
|
26
|
-
var S = {};
|
|
27
|
-
var U;
|
|
28
|
-
function Fe() {
|
|
29
|
-
return U || (U = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
30
|
-
function o(e) {
|
|
31
|
-
if (e == null) return null;
|
|
32
|
-
if (typeof e == "function")
|
|
33
|
-
return e.$$typeof === ie ? null : e.displayName || e.name || null;
|
|
34
|
-
if (typeof e == "string") return e;
|
|
35
|
-
switch (e) {
|
|
36
|
-
case T:
|
|
37
|
-
return "Fragment";
|
|
38
|
-
case K:
|
|
39
|
-
return "Profiler";
|
|
40
|
-
case Q:
|
|
41
|
-
return "StrictMode";
|
|
42
|
-
case ne:
|
|
43
|
-
return "Suspense";
|
|
44
|
-
case oe:
|
|
45
|
-
return "SuspenseList";
|
|
46
|
-
case se:
|
|
47
|
-
return "Activity";
|
|
48
|
-
}
|
|
49
|
-
if (typeof e == "object")
|
|
50
|
-
switch (typeof e.tag == "number" && console.error(
|
|
51
|
-
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
52
|
-
), e.$$typeof) {
|
|
53
|
-
case Z:
|
|
54
|
-
return "Portal";
|
|
55
|
-
case re:
|
|
56
|
-
return e.displayName || "Context";
|
|
57
|
-
case ee:
|
|
58
|
-
return (e._context.displayName || "Context") + ".Consumer";
|
|
59
|
-
case te:
|
|
60
|
-
var s = e.render;
|
|
61
|
-
return e = e.displayName, e || (e = s.displayName || s.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
62
|
-
case ae:
|
|
63
|
-
return s = e.displayName || null, s !== null ? s : o(e.type) || "Memo";
|
|
64
|
-
case v:
|
|
65
|
-
s = e._payload, e = e._init;
|
|
66
|
-
try {
|
|
67
|
-
return o(e(s));
|
|
68
|
-
} catch {
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
return null;
|
|
72
|
-
}
|
|
73
|
-
function n(e) {
|
|
74
|
-
return "" + e;
|
|
75
|
-
}
|
|
76
|
-
function t(e) {
|
|
77
|
-
try {
|
|
78
|
-
n(e);
|
|
79
|
-
var s = !1;
|
|
80
|
-
} catch {
|
|
81
|
-
s = !0;
|
|
82
|
-
}
|
|
83
|
-
if (s) {
|
|
84
|
-
s = console;
|
|
85
|
-
var f = s.error, d = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
86
|
-
return f.call(
|
|
87
|
-
s,
|
|
88
|
-
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
89
|
-
d
|
|
90
|
-
), n(e);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
function r(e) {
|
|
94
|
-
if (e === T) return "<>";
|
|
95
|
-
if (typeof e == "object" && e !== null && e.$$typeof === v)
|
|
96
|
-
return "<...>";
|
|
97
|
-
try {
|
|
98
|
-
var s = o(e);
|
|
99
|
-
return s ? "<" + s + ">" : "<...>";
|
|
100
|
-
} catch {
|
|
101
|
-
return "<...>";
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
function a() {
|
|
105
|
-
var e = C.A;
|
|
106
|
-
return e === null ? null : e.getOwner();
|
|
107
|
-
}
|
|
108
|
-
function i() {
|
|
109
|
-
return Error("react-stack-top-frame");
|
|
110
|
-
}
|
|
111
|
-
function l(e) {
|
|
112
|
-
if (P.call(e, "key")) {
|
|
113
|
-
var s = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
114
|
-
if (s && s.isReactWarning) return !1;
|
|
115
|
-
}
|
|
116
|
-
return e.key !== void 0;
|
|
117
|
-
}
|
|
118
|
-
function c(e, s) {
|
|
119
|
-
function f() {
|
|
120
|
-
B || (B = !0, console.error(
|
|
121
|
-
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
122
|
-
s
|
|
123
|
-
));
|
|
124
|
-
}
|
|
125
|
-
f.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
126
|
-
get: f,
|
|
127
|
-
configurable: !0
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
function u() {
|
|
131
|
-
var e = o(this.type);
|
|
132
|
-
return N[e] || (N[e] = !0, console.error(
|
|
133
|
-
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
134
|
-
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
135
|
-
}
|
|
136
|
-
function m(e, s, f, d, A, $) {
|
|
137
|
-
var p = f.ref;
|
|
138
|
-
return e = {
|
|
139
|
-
$$typeof: z,
|
|
140
|
-
type: e,
|
|
141
|
-
key: s,
|
|
142
|
-
props: f,
|
|
143
|
-
_owner: d
|
|
144
|
-
}, (p !== void 0 ? p : null) !== null ? Object.defineProperty(e, "ref", {
|
|
145
|
-
enumerable: !1,
|
|
146
|
-
get: u
|
|
147
|
-
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
148
|
-
configurable: !1,
|
|
149
|
-
enumerable: !1,
|
|
150
|
-
writable: !0,
|
|
151
|
-
value: 0
|
|
152
|
-
}), Object.defineProperty(e, "_debugInfo", {
|
|
153
|
-
configurable: !1,
|
|
154
|
-
enumerable: !1,
|
|
155
|
-
writable: !0,
|
|
156
|
-
value: null
|
|
157
|
-
}), Object.defineProperty(e, "_debugStack", {
|
|
158
|
-
configurable: !1,
|
|
159
|
-
enumerable: !1,
|
|
160
|
-
writable: !0,
|
|
161
|
-
value: A
|
|
162
|
-
}), Object.defineProperty(e, "_debugTask", {
|
|
163
|
-
configurable: !1,
|
|
164
|
-
enumerable: !1,
|
|
165
|
-
writable: !0,
|
|
166
|
-
value: $
|
|
167
|
-
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
168
|
-
}
|
|
169
|
-
function F(e, s, f, d, A, $) {
|
|
170
|
-
var p = s.children;
|
|
171
|
-
if (p !== void 0)
|
|
172
|
-
if (d)
|
|
173
|
-
if (ce(p)) {
|
|
174
|
-
for (d = 0; d < p.length; d++)
|
|
175
|
-
b(p[d]);
|
|
176
|
-
Object.freeze && Object.freeze(p);
|
|
177
|
-
} else
|
|
178
|
-
console.error(
|
|
179
|
-
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
180
|
-
);
|
|
181
|
-
else b(p);
|
|
182
|
-
if (P.call(s, "key")) {
|
|
183
|
-
p = o(e);
|
|
184
|
-
var E = Object.keys(s).filter(function(le) {
|
|
185
|
-
return le !== "key";
|
|
186
|
-
});
|
|
187
|
-
d = 0 < E.length ? "{key: someKey, " + E.join(": ..., ") + ": ...}" : "{key: someKey}", W[p + d] || (E = 0 < E.length ? "{" + E.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
188
|
-
`A props object containing a "key" prop is being spread into JSX:
|
|
189
|
-
let props = %s;
|
|
190
|
-
<%s {...props} />
|
|
191
|
-
React keys must be passed directly to JSX without using spread:
|
|
192
|
-
let props = %s;
|
|
193
|
-
<%s key={someKey} {...props} />`,
|
|
194
|
-
d,
|
|
195
|
-
p,
|
|
196
|
-
E,
|
|
197
|
-
p
|
|
198
|
-
), W[p + d] = !0);
|
|
199
|
-
}
|
|
200
|
-
if (p = null, f !== void 0 && (t(f), p = "" + f), l(s) && (t(s.key), p = "" + s.key), "key" in s) {
|
|
201
|
-
f = {};
|
|
202
|
-
for (var k in s)
|
|
203
|
-
k !== "key" && (f[k] = s[k]);
|
|
204
|
-
} else f = s;
|
|
205
|
-
return p && c(
|
|
206
|
-
f,
|
|
207
|
-
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
208
|
-
), m(
|
|
209
|
-
e,
|
|
210
|
-
p,
|
|
211
|
-
f,
|
|
212
|
-
a(),
|
|
213
|
-
A,
|
|
214
|
-
$
|
|
215
|
-
);
|
|
216
|
-
}
|
|
217
|
-
function b(e) {
|
|
218
|
-
w(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === v && (e._payload.status === "fulfilled" ? w(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
219
|
-
}
|
|
220
|
-
function w(e) {
|
|
221
|
-
return typeof e == "object" && e !== null && e.$$typeof === z;
|
|
222
|
-
}
|
|
223
|
-
var R = ue, z = /* @__PURE__ */ Symbol.for("react.transitional.element"), Z = /* @__PURE__ */ Symbol.for("react.portal"), T = /* @__PURE__ */ Symbol.for("react.fragment"), Q = /* @__PURE__ */ Symbol.for("react.strict_mode"), K = /* @__PURE__ */ Symbol.for("react.profiler"), ee = /* @__PURE__ */ Symbol.for("react.consumer"), re = /* @__PURE__ */ Symbol.for("react.context"), te = /* @__PURE__ */ Symbol.for("react.forward_ref"), ne = /* @__PURE__ */ Symbol.for("react.suspense"), oe = /* @__PURE__ */ Symbol.for("react.suspense_list"), ae = /* @__PURE__ */ Symbol.for("react.memo"), v = /* @__PURE__ */ Symbol.for("react.lazy"), se = /* @__PURE__ */ Symbol.for("react.activity"), ie = /* @__PURE__ */ Symbol.for("react.client.reference"), C = R.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, P = Object.prototype.hasOwnProperty, ce = Array.isArray, _ = console.createTask ? console.createTask : function() {
|
|
224
|
-
return null;
|
|
225
|
-
};
|
|
226
|
-
R = {
|
|
227
|
-
react_stack_bottom_frame: function(e) {
|
|
228
|
-
return e();
|
|
229
|
-
}
|
|
230
|
-
};
|
|
231
|
-
var B, N = {}, I = R.react_stack_bottom_frame.bind(
|
|
232
|
-
R,
|
|
233
|
-
i
|
|
234
|
-
)(), Y = _(r(i)), W = {};
|
|
235
|
-
S.Fragment = T, S.jsx = function(e, s, f) {
|
|
236
|
-
var d = 1e4 > C.recentlyCreatedOwnerStacks++;
|
|
237
|
-
return F(
|
|
238
|
-
e,
|
|
239
|
-
s,
|
|
240
|
-
f,
|
|
241
|
-
!1,
|
|
242
|
-
d ? Error("react-stack-top-frame") : I,
|
|
243
|
-
d ? _(r(e)) : Y
|
|
244
|
-
);
|
|
245
|
-
}, S.jsxs = function(e, s, f) {
|
|
246
|
-
var d = 1e4 > C.recentlyCreatedOwnerStacks++;
|
|
247
|
-
return F(
|
|
248
|
-
e,
|
|
249
|
-
s,
|
|
250
|
-
f,
|
|
251
|
-
!0,
|
|
252
|
-
d ? Error("react-stack-top-frame") : I,
|
|
253
|
-
d ? _(r(e)) : Y
|
|
254
|
-
);
|
|
255
|
-
};
|
|
256
|
-
})()), S;
|
|
257
|
-
}
|
|
258
|
-
var q;
|
|
259
|
-
function be() {
|
|
260
|
-
return q || (q = 1, process.env.NODE_ENV === "production" ? x.exports = me() : x.exports = Fe()), x.exports;
|
|
261
|
-
}
|
|
262
|
-
var H = be();
|
|
263
|
-
const V = {
|
|
1
|
+
import { jsx as S } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as w, useMemo as $, useEffect as z, useContext as B } from "react";
|
|
3
|
+
import l from "prop-types";
|
|
4
|
+
const C = {
|
|
264
5
|
neutral: {
|
|
265
6
|
0: "#FFFFFF",
|
|
266
7
|
50: "#FAFAFA"
|
|
@@ -269,46 +10,46 @@ const V = {
|
|
|
269
10
|
50: "#e3f2fd",
|
|
270
11
|
500: "#2196f3"
|
|
271
12
|
}
|
|
272
|
-
},
|
|
273
|
-
brand:
|
|
13
|
+
}, O = { Neutral: { 0: "#FFFFFF", 50: "#FAFAFA", 100: "#F4F4F5", 200: "#EAEAEB", 300: "#D4D5D6", 400: "#AAABAD", 500: "#7F8185", 600: "#55575C", 700: "#2A2D33", 800: "#232529", 900: "#1B1D21" }, Purple: { 100: "#F9F2FD", 200: "#E6D9EC", 300: "#D9C5E2", 400: "#B38CC5", 500: "#9A65B2", 600: "#813F9F", 700: "#67327F", 800: "#4D265F", 900: "#341940" }, Blue: { 100: "#E5EDFB", 200: "#CCDAF7", 300: "#B2C8F3", 400: "#99B5EF", 500: "#6691E8", 600: "#336CE0", 700: "#0047D8", 800: "#0039AD", 900: "#002B82" }, Violet: { 100: "#EDECFC", 200: "#DCDAFA", 300: "#CAC7F7", 400: "#B9B5F5", 500: "#9690EF", 600: "#736BEA", 700: "#5046E5", 800: "#4038B8", 900: "#191547", 950: "#110E30" }, Yellow: { 100: "#FEF8E9", 200: "#FDF1D3", 300: "#FCEABD", 400: "#FBE3A7", 500: "#FAD67C", 600: "#F8C850", 700: "#F6BA24", 800: "#ECAD11", 900: "#CE960A" }, Red: { 100: "#FFEBEB", 200: "#FFD6D6", 300: "#FFC2C2", 400: "#FFADAD", 500: "#FF8585", 600: "#FF5C5C", 700: "#FF3333", 800: "#CE2929", 900: "#9D1F1F" }, Green: { 100: "#EBFAF1", 200: "#D7F4E4", 300: "#AFE9C8", 400: "#87DFAD", 500: "#5FD491", 600: "#5FD491", 700: "#2CA15E", 800: "#217947", 900: "#16502F" }, Orange: { 100: "#FFF4EB", 200: "#FFE9D6", 300: "#FFDEC2", 400: "#FFD3AE", 500: "#FFBD85", 600: "#FFA75D", 700: "#FF9134", 800: "#E8842F", 900: "#DF771E" }, Cyan: { 100: "#E8F6FF", 200: "#DCF2FF", 300: "#C4E9FF", 400: "#A0DAFF", 500: "#87D1FF", 600: "#56BFFF", 700: "#1DA6FB", 800: "#0B89D6", 900: "#0467A4" }, TypeScale: { Weight: { Regular: "Regular", Bold: "Bold", SemiBold: "Semibold" }, FontFamily: { YekanBakh: "Yekan Bakh FaNum" }, Size: { 10: 10, 11: 11, 12: 12, 14: 14, 16: 16, 18: 18, 20: 20, 24: 24, 28: 28, 32: 32, 36: 36, 48: 48, 64: 64 }, Height: { 10: 10, 12: 12, 14: 14, 16: 16, 20: 20, 24: 24, 28: 28, 32: 32, 36: 36, 40: 40, 44: 44, 48: 48, 74: 74 } }, NumberScale: { Radius: { "Radius-12": 12, "Radius-8": 8, "Radius-4": 4, "Radius-24": 24, "Radius-20": 20, "Radius-16": 16, "Radius-Full": 1e3, "Radius-28": 28 }, Spacing: { "spacing-4": 4, "spacing-8": 8, "spacing-12": 12, "spacing-16": 16, "spacing-20": 20, "spacing-24": 24, "spacing-32": 32, "spacing-40": 40, "spacing-48": 48, "spacing-56": 56, "spacing-64": 64, "spacing-72": 72, "spacing-80": 80 }, StrokeWeight: { StrokeWeight1: 1, StrokeWeight2: 1.5, StrokeWeight4: 3, StrokeWeight3: 2, StrokeWeight5: 4 }, IconSize: { IconSizesmall: 16, IconSizeMedium: 20, IconSizeLarge: 24, IconSizeExtraLarge: 32 } }, Peach: { 100: "#FFEEE5", 200: "#FFDDCC", 300: "#FFCCB2", 400: "#FFBB99", 500: "#FF9966", 600: "#FF7733", 700: "#FF5500", 800: "#CC4400", 900: "#993300" }, Buttons: 104, MinWidth: 64 }, u = {
|
|
14
|
+
brand: O
|
|
274
15
|
};
|
|
275
|
-
function
|
|
276
|
-
const
|
|
16
|
+
function j() {
|
|
17
|
+
const n = {
|
|
277
18
|
colors: {},
|
|
278
19
|
typography: {},
|
|
279
20
|
spacing: {},
|
|
280
21
|
radius: {},
|
|
281
22
|
shadows: {}
|
|
282
23
|
};
|
|
283
|
-
if (
|
|
284
|
-
if (typeof
|
|
285
|
-
const
|
|
286
|
-
|
|
287
|
-
(typeof
|
|
24
|
+
if (u.brand && Object.entries(u.brand).forEach(([t, r]) => {
|
|
25
|
+
if (typeof r == "object" && !Array.isArray(r)) {
|
|
26
|
+
const e = t.toLowerCase();
|
|
27
|
+
n.colors[e] = {}, Object.entries(r).forEach(([o, a]) => {
|
|
28
|
+
(typeof a == "string" || typeof a == "number") && (n.colors[e][o] = a);
|
|
288
29
|
});
|
|
289
30
|
}
|
|
290
|
-
}),
|
|
291
|
-
const
|
|
292
|
-
|
|
293
|
-
fontFamily:
|
|
294
|
-
sizes:
|
|
295
|
-
lineHeights:
|
|
296
|
-
weights:
|
|
31
|
+
}), u.brand?.TypeScale) {
|
|
32
|
+
const t = u.brand.TypeScale;
|
|
33
|
+
n.typography = {
|
|
34
|
+
fontFamily: t.FontFamily?.YekanBakh,
|
|
35
|
+
sizes: t.Size || {},
|
|
36
|
+
lineHeights: t.Height || {},
|
|
37
|
+
weights: t.Weight || {}
|
|
297
38
|
};
|
|
298
39
|
}
|
|
299
|
-
if (
|
|
300
|
-
const
|
|
301
|
-
|
|
302
|
-
const
|
|
303
|
-
|
|
304
|
-
})),
|
|
305
|
-
const
|
|
306
|
-
|
|
40
|
+
if (u.brand?.NumberScale) {
|
|
41
|
+
const t = u.brand.NumberScale;
|
|
42
|
+
t.Spacing && (n.spacing = {}, Object.entries(t.Spacing).forEach(([r, e]) => {
|
|
43
|
+
const o = r.replace("spacing-", "");
|
|
44
|
+
n.spacing[o] = typeof e == "number" ? e : parseInt(e);
|
|
45
|
+
})), t.Radius && (n.radius = {}, Object.entries(t.Radius).forEach(([r, e]) => {
|
|
46
|
+
const o = r.replace("Radius-", "").toLowerCase();
|
|
47
|
+
n.radius[o] = typeof e == "number" ? e : parseInt(e);
|
|
307
48
|
}));
|
|
308
49
|
}
|
|
309
|
-
return
|
|
50
|
+
return n;
|
|
310
51
|
}
|
|
311
|
-
const
|
|
52
|
+
const T = {
|
|
312
53
|
colors: {
|
|
313
54
|
primary: {
|
|
314
55
|
50: "#e3f2fd",
|
|
@@ -458,280 +199,407 @@ const ye = {
|
|
|
458
199
|
xl: "0px 20px 25px rgba(0, 0, 0, 0.1)"
|
|
459
200
|
}
|
|
460
201
|
};
|
|
461
|
-
function
|
|
462
|
-
const
|
|
463
|
-
return
|
|
464
|
-
|
|
465
|
-
}),
|
|
202
|
+
function E(n, t) {
|
|
203
|
+
const r = { ...n };
|
|
204
|
+
return b(n) && b(t) && Object.keys(t).forEach((e) => {
|
|
205
|
+
b(t[e]) ? e in n ? r[e] = E(n[e], t[e]) : Object.assign(r, { [e]: t[e] }) : Object.assign(r, { [e]: t[e] });
|
|
206
|
+
}), r;
|
|
466
207
|
}
|
|
467
|
-
function
|
|
468
|
-
return
|
|
208
|
+
function b(n) {
|
|
209
|
+
return n && typeof n == "object" && !Array.isArray(n);
|
|
469
210
|
}
|
|
470
|
-
const
|
|
471
|
-
function
|
|
472
|
-
return
|
|
211
|
+
const k = j(), h = E(T, k);
|
|
212
|
+
function x(n = {}) {
|
|
213
|
+
return E(h, n);
|
|
473
214
|
}
|
|
474
|
-
function
|
|
475
|
-
const
|
|
476
|
-
|
|
477
|
-
let
|
|
215
|
+
function D(n = {}) {
|
|
216
|
+
const t = x(n), r = document.createElement("style");
|
|
217
|
+
r.id = "ds-theme";
|
|
218
|
+
let e = `:root {
|
|
478
219
|
`;
|
|
479
|
-
Object.entries(
|
|
480
|
-
typeof
|
|
481
|
-
|
|
220
|
+
Object.entries(t.colors).forEach(([i, s]) => {
|
|
221
|
+
typeof s == "object" && Object.entries(s).forEach(([F, g]) => {
|
|
222
|
+
e += ` --${i}-${F}: ${g};
|
|
482
223
|
`;
|
|
483
224
|
});
|
|
484
225
|
});
|
|
485
|
-
const
|
|
486
|
-
if (
|
|
487
|
-
`,
|
|
488
|
-
const
|
|
489
|
-
|
|
226
|
+
const o = t.typography;
|
|
227
|
+
if (e += ` --font-family: ${o.fontFamily};
|
|
228
|
+
`, o.baseSize && o.minSize) {
|
|
229
|
+
const i = (o.baseSize - o.minSize) / 1600, F = `${-320 * i + o.minSize}px + ${i * 100}vw`;
|
|
230
|
+
e += ` --font-size-base: clamp(${o.minSize}px, ${F}, ${o.baseSize}px);
|
|
490
231
|
`;
|
|
491
232
|
} else
|
|
492
|
-
|
|
233
|
+
e += ` --font-size-base: ${o.baseSize || 16}px;
|
|
493
234
|
`;
|
|
494
|
-
|
|
495
|
-
`,
|
|
496
|
-
|
|
235
|
+
e += ` --type-scale: ${o.scaleRatio || 1.25};
|
|
236
|
+
`, o.sizes && Object.entries(o.sizes).forEach(([i, s]) => {
|
|
237
|
+
e += ` --font-size-${i}: ${s}px;
|
|
497
238
|
`;
|
|
498
|
-
}),
|
|
499
|
-
|
|
239
|
+
}), o.lineHeights && Object.entries(o.lineHeights).forEach(([i, s]) => {
|
|
240
|
+
e += ` --line-height-${i}: ${s}px;
|
|
500
241
|
`;
|
|
501
|
-
}),
|
|
502
|
-
|
|
242
|
+
}), o.weights && Object.entries(o.weights).forEach(([i, s]) => {
|
|
243
|
+
e += ` --font-weight-${i}: ${s};
|
|
503
244
|
`;
|
|
504
245
|
});
|
|
505
|
-
const
|
|
506
|
-
|
|
507
|
-
`, Object.entries(
|
|
508
|
-
|
|
246
|
+
const a = t.spacing.unit || 4;
|
|
247
|
+
e += ` --space-unit: ${a}px;
|
|
248
|
+
`, Object.entries(t.spacing).forEach(([i, s]) => {
|
|
249
|
+
i !== "unit" && (e += ` --space-${i}: ${s}px;
|
|
509
250
|
`);
|
|
510
|
-
}), Object.entries(
|
|
511
|
-
|
|
251
|
+
}), Object.entries(t.radius).forEach(([i, s]) => {
|
|
252
|
+
e += ` --radius-${i}: ${s}px;
|
|
512
253
|
`;
|
|
513
|
-
}),
|
|
514
|
-
|
|
254
|
+
}), t.shadows && Object.entries(t.shadows).forEach(([i, s]) => {
|
|
255
|
+
e += ` --shadow-${i}: ${s};
|
|
515
256
|
`;
|
|
516
|
-
}),
|
|
517
|
-
`,
|
|
518
|
-
`,
|
|
519
|
-
`,
|
|
520
|
-
const
|
|
521
|
-
|
|
257
|
+
}), e += `}
|
|
258
|
+
`, e += `html { font-size: var(--font-size-base); }
|
|
259
|
+
`, e += `body { font-family: var(--font-family); }
|
|
260
|
+
`, r.textContent = e;
|
|
261
|
+
const c = document.getElementById("ds-theme");
|
|
262
|
+
c && c.remove(), document.head.appendChild(r);
|
|
522
263
|
}
|
|
523
|
-
const
|
|
524
|
-
function
|
|
525
|
-
const
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
}, [
|
|
529
|
-
const
|
|
530
|
-
tokens:
|
|
531
|
-
getToken: (
|
|
532
|
-
const
|
|
533
|
-
let
|
|
534
|
-
for (const
|
|
535
|
-
if (
|
|
536
|
-
|
|
264
|
+
const A = w(null);
|
|
265
|
+
function I({ tokens: n = {}, children: t }) {
|
|
266
|
+
const r = $(() => x(n), [n]);
|
|
267
|
+
z(() => {
|
|
268
|
+
D(r);
|
|
269
|
+
}, [r]);
|
|
270
|
+
const e = $(() => ({
|
|
271
|
+
tokens: r,
|
|
272
|
+
getToken: (o) => {
|
|
273
|
+
const a = o.split(".");
|
|
274
|
+
let c = r;
|
|
275
|
+
for (const i of a)
|
|
276
|
+
if (c && typeof c == "object" && i in c)
|
|
277
|
+
c = c[i];
|
|
537
278
|
else
|
|
538
279
|
return;
|
|
539
|
-
return
|
|
280
|
+
return c;
|
|
540
281
|
}
|
|
541
|
-
}), [
|
|
542
|
-
return /* @__PURE__ */
|
|
282
|
+
}), [r]);
|
|
283
|
+
return /* @__PURE__ */ S(A.Provider, { value: e, children: t });
|
|
543
284
|
}
|
|
544
|
-
|
|
545
|
-
tokens:
|
|
546
|
-
children:
|
|
285
|
+
I.propTypes = {
|
|
286
|
+
tokens: l.object,
|
|
287
|
+
children: l.node.isRequired
|
|
547
288
|
};
|
|
548
|
-
function
|
|
549
|
-
const
|
|
550
|
-
return
|
|
551
|
-
tokens:
|
|
552
|
-
getToken: (
|
|
553
|
-
const
|
|
554
|
-
let
|
|
555
|
-
for (const
|
|
556
|
-
if (
|
|
557
|
-
|
|
289
|
+
function v() {
|
|
290
|
+
const n = B(A);
|
|
291
|
+
return n || (console.warn("useTheme must be used within ThemeProvider. Using default tokens."), {
|
|
292
|
+
tokens: h,
|
|
293
|
+
getToken: (t) => {
|
|
294
|
+
const r = t.split(".");
|
|
295
|
+
let e = h;
|
|
296
|
+
for (const o of r)
|
|
297
|
+
if (e && typeof e == "object" && o in e)
|
|
298
|
+
e = e[o];
|
|
558
299
|
else
|
|
559
300
|
return;
|
|
560
|
-
return
|
|
301
|
+
return e;
|
|
561
302
|
}
|
|
562
303
|
});
|
|
563
304
|
}
|
|
564
|
-
function
|
|
565
|
-
const { tokens:
|
|
305
|
+
function R() {
|
|
306
|
+
const { tokens: n, getToken: t } = v();
|
|
566
307
|
return {
|
|
567
308
|
/**
|
|
568
309
|
* دریافت رنگ
|
|
569
310
|
* @param {string} path - مسیر رنگ مثل 'primary.500' یا 'neutral.100'
|
|
570
311
|
* @returns {string} مقدار رنگ
|
|
571
312
|
*/
|
|
572
|
-
color: (
|
|
573
|
-
const
|
|
574
|
-
if (
|
|
575
|
-
const [
|
|
576
|
-
return `var(--${
|
|
313
|
+
color: (r) => {
|
|
314
|
+
const e = t(`colors.${r}`);
|
|
315
|
+
if (e) return e;
|
|
316
|
+
const [o, a] = r.split(".");
|
|
317
|
+
return `var(--${o}-${a}, #000)`;
|
|
577
318
|
},
|
|
578
319
|
/**
|
|
579
320
|
* دریافت spacing
|
|
580
321
|
* @param {string|number} key - کلید spacing مثل '4' یا 'sm'
|
|
581
322
|
* @returns {string} مقدار spacing با واحد px
|
|
582
323
|
*/
|
|
583
|
-
spacing: (
|
|
584
|
-
const
|
|
585
|
-
return
|
|
324
|
+
spacing: (r) => {
|
|
325
|
+
const e = t(`spacing.${r}`);
|
|
326
|
+
return e ? `${e}px` : `var(--space-${r}, ${r * (n.spacing?.unit || 4)}px)`;
|
|
586
327
|
},
|
|
587
328
|
/**
|
|
588
329
|
* دریافت radius
|
|
589
330
|
* @param {string} key - کلید radius مثل 'md' یا 'lg'
|
|
590
331
|
* @returns {string} مقدار radius با واحد px
|
|
591
332
|
*/
|
|
592
|
-
radius: (
|
|
593
|
-
const
|
|
594
|
-
return
|
|
333
|
+
radius: (r) => {
|
|
334
|
+
const e = t(`radius.${r}`);
|
|
335
|
+
return e ? `${e}px` : `var(--radius-${r}, 8px)`;
|
|
595
336
|
},
|
|
596
337
|
/**
|
|
597
338
|
* دریافت typography
|
|
598
339
|
* @param {string} property - ویژگی typography مثل 'fontFamily', 'sizes.16'
|
|
599
340
|
* @returns {string|number} مقدار typography
|
|
600
341
|
*/
|
|
601
|
-
typography: (
|
|
602
|
-
const
|
|
603
|
-
return
|
|
342
|
+
typography: (r) => {
|
|
343
|
+
const e = t(`typography.${r}`);
|
|
344
|
+
return e ? typeof e == "number" ? `${e}px` : e : r === "fontFamily" ? "var(--font-family, system-ui, sans-serif)" : `var(--font-${r}, 16px)`;
|
|
604
345
|
},
|
|
605
346
|
/**
|
|
606
347
|
* دریافت shadow
|
|
607
348
|
* @param {string} key - کلید shadow مثل 'sm' یا 'md'
|
|
608
349
|
* @returns {string} مقدار shadow
|
|
609
350
|
*/
|
|
610
|
-
shadow: (
|
|
611
|
-
const
|
|
612
|
-
return
|
|
351
|
+
shadow: (r) => {
|
|
352
|
+
const e = t(`shadows.${r}`);
|
|
353
|
+
return e || `var(--shadow-${r}, none)`;
|
|
613
354
|
},
|
|
614
355
|
/**
|
|
615
356
|
* دسترسی مستقیم به توکنها
|
|
616
357
|
*/
|
|
617
|
-
tokens:
|
|
358
|
+
tokens: n,
|
|
618
359
|
/**
|
|
619
360
|
* دریافت توکن با مسیر دلخواه
|
|
620
361
|
*/
|
|
621
|
-
getToken:
|
|
362
|
+
getToken: t
|
|
622
363
|
};
|
|
623
364
|
}
|
|
624
|
-
const
|
|
625
|
-
|
|
365
|
+
const d = {
|
|
366
|
+
// MUI-compatible easing functions
|
|
367
|
+
easeInOut: "cubic-bezier(0.4, 0, 0.2, 1)",
|
|
368
|
+
easeOut: "cubic-bezier(0.0, 0, 0.2, 1)",
|
|
369
|
+
easeIn: "cubic-bezier(0.4, 0, 1, 1)",
|
|
370
|
+
sharp: "cubic-bezier(0.4, 0, 0.6, 1)"
|
|
371
|
+
}, p = {
|
|
372
|
+
shortest: 150,
|
|
373
|
+
shorter: 200,
|
|
374
|
+
short: 250,
|
|
375
|
+
standard: 300,
|
|
376
|
+
complex: 375,
|
|
377
|
+
enteringScreen: 225,
|
|
378
|
+
leavingScreen: 195
|
|
379
|
+
};
|
|
380
|
+
function f(n = "all", t = {}) {
|
|
381
|
+
const {
|
|
382
|
+
duration: r = p.standard,
|
|
383
|
+
easing: e = d.easeInOut,
|
|
384
|
+
delay: o = 0
|
|
385
|
+
} = t;
|
|
386
|
+
return `${Array.isArray(n) ? n.join(", ") : n} ${r}ms ${e} ${o}ms`;
|
|
387
|
+
}
|
|
388
|
+
const m = {
|
|
389
|
+
// Standard transitions
|
|
390
|
+
create: f,
|
|
391
|
+
// Common transitions
|
|
392
|
+
easing: d,
|
|
393
|
+
duration: p,
|
|
394
|
+
// Preset transitions
|
|
395
|
+
all: (n) => f("all", n),
|
|
396
|
+
color: (n) => f(["color", "background-color", "border-color"], n),
|
|
397
|
+
backgroundColor: (n) => f("background-color", n),
|
|
398
|
+
opacity: (n) => f("opacity", n),
|
|
399
|
+
transform: (n) => f("transform", n),
|
|
400
|
+
boxShadow: (n) => f("box-shadow", n),
|
|
401
|
+
// Complex transitions
|
|
402
|
+
standard: (n) => f("all", {
|
|
403
|
+
duration: p.standard,
|
|
404
|
+
easing: d.easeInOut,
|
|
405
|
+
...n
|
|
406
|
+
}),
|
|
407
|
+
enter: (n) => f("all", {
|
|
408
|
+
duration: p.enteringScreen,
|
|
409
|
+
easing: d.easeOut,
|
|
410
|
+
...n
|
|
411
|
+
}),
|
|
412
|
+
leave: (n) => f("all", {
|
|
413
|
+
duration: p.leavingScreen,
|
|
414
|
+
easing: d.easeIn,
|
|
415
|
+
...n
|
|
416
|
+
})
|
|
417
|
+
};
|
|
418
|
+
function P(n = "all", t = {}) {
|
|
419
|
+
return f(n, t);
|
|
420
|
+
}
|
|
421
|
+
const H = {
|
|
422
|
+
fadeIn: {
|
|
423
|
+
from: { opacity: 0 },
|
|
424
|
+
to: { opacity: 1 }
|
|
425
|
+
},
|
|
426
|
+
fadeOut: {
|
|
427
|
+
from: { opacity: 1 },
|
|
428
|
+
to: { opacity: 0 }
|
|
429
|
+
},
|
|
430
|
+
slideUp: {
|
|
431
|
+
from: { transform: "translateY(20px)", opacity: 0 },
|
|
432
|
+
to: { transform: "translateY(0)", opacity: 1 }
|
|
433
|
+
},
|
|
434
|
+
slideDown: {
|
|
435
|
+
from: { transform: "translateY(-20px)", opacity: 0 },
|
|
436
|
+
to: { transform: "translateY(0)", opacity: 1 }
|
|
437
|
+
},
|
|
438
|
+
scaleIn: {
|
|
439
|
+
from: { transform: "scale(0.8)", opacity: 0 },
|
|
440
|
+
to: { transform: "scale(1)", opacity: 1 }
|
|
441
|
+
},
|
|
442
|
+
scaleOut: {
|
|
443
|
+
from: { transform: "scale(1)", opacity: 1 },
|
|
444
|
+
to: { transform: "scale(0.8)", opacity: 0 }
|
|
445
|
+
}
|
|
446
|
+
};
|
|
447
|
+
function L(n, t = {}) {
|
|
448
|
+
const {
|
|
449
|
+
duration: r = p.standard,
|
|
450
|
+
easing: e = d.easeInOut,
|
|
451
|
+
delay: o = 0,
|
|
452
|
+
iterationCount: a = 1,
|
|
453
|
+
direction: c = "normal",
|
|
454
|
+
fillMode: i = "both"
|
|
455
|
+
} = t;
|
|
456
|
+
return `${n} ${r}ms ${e} ${o}ms ${a} ${c} ${i}`;
|
|
457
|
+
}
|
|
458
|
+
const M = ({ variant: n = "primary", size: t = "md", children: r, className: e = "", ...o }) => {
|
|
459
|
+
const { color: a, spacing: c, radius: i, typography: s } = R(), F = {
|
|
626
460
|
primary: {
|
|
627
|
-
backgroundColor:
|
|
461
|
+
backgroundColor: a("primary.500"),
|
|
628
462
|
color: "#ffffff",
|
|
629
463
|
border: "none"
|
|
630
464
|
},
|
|
631
465
|
outline: {
|
|
632
466
|
backgroundColor: "transparent",
|
|
633
|
-
border: `2px solid ${
|
|
634
|
-
color:
|
|
467
|
+
border: `2px solid ${a("primary.500")}`,
|
|
468
|
+
color: a("primary.500")
|
|
635
469
|
},
|
|
636
470
|
text: {
|
|
637
471
|
backgroundColor: "transparent",
|
|
638
472
|
border: "none",
|
|
639
|
-
color:
|
|
473
|
+
color: a("primary.500")
|
|
640
474
|
},
|
|
641
475
|
secondary: {
|
|
642
|
-
backgroundColor:
|
|
643
|
-
color:
|
|
476
|
+
backgroundColor: a("neutral.200"),
|
|
477
|
+
color: a("neutral.900"),
|
|
644
478
|
border: "none"
|
|
645
479
|
},
|
|
646
480
|
success: {
|
|
647
|
-
backgroundColor:
|
|
481
|
+
backgroundColor: a("success.500"),
|
|
648
482
|
color: "#ffffff",
|
|
649
483
|
border: "none"
|
|
650
484
|
},
|
|
651
485
|
error: {
|
|
652
|
-
backgroundColor:
|
|
486
|
+
backgroundColor: a("error.500"),
|
|
653
487
|
color: "#ffffff",
|
|
654
488
|
border: "none"
|
|
655
489
|
}
|
|
656
|
-
},
|
|
490
|
+
}, g = {
|
|
657
491
|
sm: {
|
|
658
|
-
padding: `${
|
|
659
|
-
fontSize:
|
|
492
|
+
padding: `${c(2)} ${c(4)}`,
|
|
493
|
+
fontSize: s("sizes.14") || "14px"
|
|
660
494
|
},
|
|
661
495
|
md: {
|
|
662
|
-
padding: `${
|
|
663
|
-
fontSize:
|
|
496
|
+
padding: `${c(3)} ${c(6)}`,
|
|
497
|
+
fontSize: s("sizes.16") || "16px"
|
|
664
498
|
},
|
|
665
499
|
lg: {
|
|
666
|
-
padding: `${
|
|
667
|
-
fontSize:
|
|
500
|
+
padding: `${c(4)} ${c(8)}`,
|
|
501
|
+
fontSize: s("sizes.18") || "18px"
|
|
668
502
|
}
|
|
669
503
|
};
|
|
670
|
-
return /* @__PURE__ */
|
|
504
|
+
return /* @__PURE__ */ S(
|
|
671
505
|
"button",
|
|
672
506
|
{
|
|
673
|
-
className: `ds-button ds-button--${
|
|
507
|
+
className: `ds-button ds-button--${n} ds-button--${t} ${e}`,
|
|
674
508
|
style: {
|
|
675
|
-
borderRadius:
|
|
676
|
-
fontFamily:
|
|
509
|
+
borderRadius: i("md"),
|
|
510
|
+
fontFamily: s("fontFamily"),
|
|
677
511
|
fontWeight: "500",
|
|
678
512
|
cursor: "pointer",
|
|
679
|
-
transition:
|
|
680
|
-
...m[o],
|
|
513
|
+
transition: m.standard({ duration: 200 }),
|
|
681
514
|
...F[n],
|
|
682
|
-
...
|
|
515
|
+
...g[t],
|
|
516
|
+
...o.style
|
|
683
517
|
},
|
|
684
|
-
onMouseEnter: (
|
|
685
|
-
|
|
518
|
+
onMouseEnter: (y) => {
|
|
519
|
+
n === "primary" && (y.currentTarget.style.opacity = "0.9");
|
|
686
520
|
},
|
|
687
|
-
onMouseLeave: (
|
|
688
|
-
|
|
521
|
+
onMouseLeave: (y) => {
|
|
522
|
+
n === "primary" && (y.currentTarget.style.opacity = "1");
|
|
689
523
|
},
|
|
690
|
-
...
|
|
691
|
-
children:
|
|
524
|
+
...o,
|
|
525
|
+
children: r
|
|
692
526
|
}
|
|
693
527
|
);
|
|
694
528
|
};
|
|
695
|
-
|
|
696
|
-
children:
|
|
697
|
-
variant:
|
|
698
|
-
size:
|
|
699
|
-
className:
|
|
529
|
+
M.propTypes = {
|
|
530
|
+
children: l.node.isRequired,
|
|
531
|
+
variant: l.oneOf(["primary", "outline", "text", "secondary", "success", "error"]),
|
|
532
|
+
size: l.oneOf(["sm", "md", "lg"]),
|
|
533
|
+
className: l.string
|
|
700
534
|
};
|
|
701
|
-
function
|
|
702
|
-
|
|
535
|
+
function q(n = {}) {
|
|
536
|
+
if (typeof window < "u" && (window.MUI || window.mui))
|
|
537
|
+
try {
|
|
538
|
+
return {
|
|
539
|
+
create: window.MUI?.transitions?.create || m.create,
|
|
540
|
+
easing: window.MUI?.transitions?.easing || m.easing,
|
|
541
|
+
duration: window.MUI?.transitions?.duration || m.duration,
|
|
542
|
+
useMUI: !0
|
|
543
|
+
};
|
|
544
|
+
} catch {
|
|
545
|
+
}
|
|
546
|
+
return {
|
|
547
|
+
...m,
|
|
548
|
+
useMUI: !1
|
|
549
|
+
};
|
|
550
|
+
}
|
|
551
|
+
function K() {
|
|
552
|
+
if (typeof window < "u" && (window.MUI || window.mui))
|
|
553
|
+
try {
|
|
554
|
+
return window.MUI?.theme || window.mui?.theme || null;
|
|
555
|
+
} catch {
|
|
556
|
+
return null;
|
|
557
|
+
}
|
|
558
|
+
return null;
|
|
559
|
+
}
|
|
560
|
+
function V(n = {}) {
|
|
561
|
+
D(n);
|
|
703
562
|
}
|
|
704
|
-
const
|
|
705
|
-
function
|
|
706
|
-
let
|
|
707
|
-
Object.entries(
|
|
708
|
-
|
|
563
|
+
const U = {};
|
|
564
|
+
function G(n = {}) {
|
|
565
|
+
let t = "";
|
|
566
|
+
Object.entries(n.colors?.primary || {}).forEach(([r, e]) => {
|
|
567
|
+
t += `$primary-${r}: ${e};
|
|
709
568
|
`;
|
|
710
|
-
}),
|
|
711
|
-
`,
|
|
712
|
-
`,
|
|
569
|
+
}), t += `$font-family: "${n.typography?.fontFamily || "sans-serif"}";
|
|
570
|
+
`, t += `$font-size-base: ${n.typography?.baseSize || 16}px;
|
|
571
|
+
`, U.writeFileSync("custom-variables.scss", t);
|
|
713
572
|
}
|
|
714
|
-
const
|
|
573
|
+
const J = {
|
|
715
574
|
colors: {
|
|
716
|
-
primary:
|
|
717
|
-
neutral:
|
|
575
|
+
primary: C.primary,
|
|
576
|
+
neutral: C.neutral
|
|
718
577
|
},
|
|
719
578
|
spacing: { unit: 4 },
|
|
720
579
|
// 1 = 4px
|
|
721
580
|
typography: { fontFamily: "system-ui, sans-serif", baseSize: 16 }
|
|
722
581
|
};
|
|
723
582
|
export {
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
583
|
+
M as Button,
|
|
584
|
+
I as ThemeProvider,
|
|
585
|
+
h as baseTokens,
|
|
586
|
+
L as createAnimation,
|
|
587
|
+
x as createTokens,
|
|
588
|
+
f as createTransition,
|
|
589
|
+
I as default,
|
|
590
|
+
C as defaultColors,
|
|
591
|
+
J as defaultConfig,
|
|
592
|
+
T as defaultTokens,
|
|
593
|
+
p as duration,
|
|
594
|
+
d as easing,
|
|
595
|
+
G as generateSCSS,
|
|
596
|
+
D as generateTheme,
|
|
597
|
+
V as injectCSS,
|
|
598
|
+
H as keyframes,
|
|
599
|
+
m as transitions,
|
|
600
|
+
K as useMUITheme,
|
|
601
|
+
q as useMUITransitions,
|
|
602
|
+
v as useTheme,
|
|
603
|
+
R as useTokens,
|
|
604
|
+
P as useTransition
|
|
737
605
|
};
|