ali-mohammadi-design-system 1.0.0 → 2.0.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/index.js ADDED
@@ -0,0 +1,742 @@
1
+ import le, { createContext as ue, useMemo as W, useEffect as fe, useContext as de } from "react";
2
+ import y from "prop-types";
3
+ var A = { exports: {} }, h = {};
4
+ var M;
5
+ function pe() {
6
+ if (M) return h;
7
+ M = 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 L;
28
+ function me() {
29
+ return L || (L = 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 === se ? null : e.displayName || e.name || null;
34
+ if (typeof e == "string") return e;
35
+ switch (e) {
36
+ case x:
37
+ return "Fragment";
38
+ case Q:
39
+ return "Profiler";
40
+ case Z:
41
+ return "StrictMode";
42
+ case te:
43
+ return "Suspense";
44
+ case ne:
45
+ return "SuspenseList";
46
+ case ae:
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 X:
54
+ return "Portal";
55
+ case ee:
56
+ return e.displayName || "Context";
57
+ case K:
58
+ return (e._context.displayName || "Context") + ".Consumer";
59
+ case re:
60
+ var s = e.render;
61
+ return e = e.displayName, e || (e = s.displayName || s.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
62
+ case oe:
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 === x) 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 (z.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
+ P || (P = !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 B[e] || (B[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, T, k) {
137
+ var p = f.ref;
138
+ return e = {
139
+ $$typeof: w,
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: T
162
+ }), Object.defineProperty(e, "_debugTask", {
163
+ configurable: !1,
164
+ enumerable: !1,
165
+ writable: !0,
166
+ value: k
167
+ }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
168
+ }
169
+ function F(e, s, f, d, T, k) {
170
+ var p = s.children;
171
+ if (p !== void 0)
172
+ if (d)
173
+ if (ie(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 (z.call(s, "key")) {
183
+ p = o(e);
184
+ var E = Object.keys(s).filter(function(ce) {
185
+ return ce !== "key";
186
+ });
187
+ d = 0 < E.length ? "{key: someKey, " + E.join(": ..., ") + ": ...}" : "{key: someKey}", Y[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
+ ), Y[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 $ in s)
203
+ $ !== "key" && (f[$] = s[$]);
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
+ T,
214
+ k
215
+ );
216
+ }
217
+ function b(e) {
218
+ D(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === v && (e._payload.status === "fulfilled" ? D(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
219
+ }
220
+ function D(e) {
221
+ return typeof e == "object" && e !== null && e.$$typeof === w;
222
+ }
223
+ var R = le, w = /* @__PURE__ */ Symbol.for("react.transitional.element"), X = /* @__PURE__ */ Symbol.for("react.portal"), x = /* @__PURE__ */ Symbol.for("react.fragment"), Z = /* @__PURE__ */ Symbol.for("react.strict_mode"), Q = /* @__PURE__ */ Symbol.for("react.profiler"), K = /* @__PURE__ */ Symbol.for("react.consumer"), ee = /* @__PURE__ */ Symbol.for("react.context"), re = /* @__PURE__ */ Symbol.for("react.forward_ref"), te = /* @__PURE__ */ Symbol.for("react.suspense"), ne = /* @__PURE__ */ Symbol.for("react.suspense_list"), oe = /* @__PURE__ */ Symbol.for("react.memo"), v = /* @__PURE__ */ Symbol.for("react.lazy"), ae = /* @__PURE__ */ Symbol.for("react.activity"), se = /* @__PURE__ */ Symbol.for("react.client.reference"), C = R.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, z = Object.prototype.hasOwnProperty, ie = 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 P, B = {}, N = R.react_stack_bottom_frame.bind(
232
+ R,
233
+ i
234
+ )(), I = _(r(i)), Y = {};
235
+ S.Fragment = x, 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") : N,
243
+ d ? _(r(e)) : I
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") : N,
253
+ d ? _(r(e)) : I
254
+ );
255
+ };
256
+ })()), S;
257
+ }
258
+ var U;
259
+ function Fe() {
260
+ return U || (U = 1, process.env.NODE_ENV === "production" ? A.exports = pe() : A.exports = me()), A.exports;
261
+ }
262
+ var V = Fe();
263
+ const q = {
264
+ neutral: {
265
+ 0: "#FFFFFF",
266
+ 50: "#FAFAFA"
267
+ },
268
+ primary: {
269
+ 50: "#e3f2fd",
270
+ 500: "#2196f3"
271
+ }
272
+ }, be = { 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 }, g = {
273
+ brand: be
274
+ };
275
+ function Ee() {
276
+ const o = {
277
+ colors: {},
278
+ typography: {},
279
+ spacing: {},
280
+ radius: {},
281
+ shadows: {}
282
+ };
283
+ if (g.brand && Object.entries(g.brand).forEach(([n, t]) => {
284
+ if (typeof t == "object" && !Array.isArray(t)) {
285
+ const r = n.toLowerCase();
286
+ o.colors[r] = {}, Object.entries(t).forEach(([a, i]) => {
287
+ (typeof i == "string" || typeof i == "number") && (o.colors[r][a] = i);
288
+ });
289
+ }
290
+ }), g.brand?.TypeScale) {
291
+ const n = g.brand.TypeScale;
292
+ o.typography = {
293
+ fontFamily: n.FontFamily?.YekanBakh,
294
+ sizes: n.Size || {},
295
+ lineHeights: n.Height || {},
296
+ weights: n.Weight || {}
297
+ };
298
+ }
299
+ if (g.brand?.NumberScale) {
300
+ const n = g.brand.NumberScale;
301
+ n.Spacing && (o.spacing = {}, Object.entries(n.Spacing).forEach(([t, r]) => {
302
+ const a = t.replace("spacing-", "");
303
+ o.spacing[a] = typeof r == "number" ? r : parseInt(r);
304
+ })), n.Radius && (o.radius = {}, Object.entries(n.Radius).forEach(([t, r]) => {
305
+ const a = t.replace("Radius-", "").toLowerCase();
306
+ o.radius[a] = typeof r == "number" ? r : parseInt(r);
307
+ }));
308
+ }
309
+ return o;
310
+ }
311
+ const ge = {
312
+ colors: {
313
+ primary: {
314
+ 50: "#e3f2fd",
315
+ 100: "#bbdefb",
316
+ 200: "#90caf9",
317
+ 300: "#64b5f6",
318
+ 400: "#42a5f5",
319
+ 500: "#2196f3",
320
+ 600: "#1e88e5",
321
+ 700: "#1976d2",
322
+ 800: "#1565c0",
323
+ 900: "#0d47a1"
324
+ },
325
+ neutral: {
326
+ 0: "#FFFFFF",
327
+ 50: "#FAFAFA",
328
+ 100: "#F5F5F5",
329
+ 200: "#EEEEEE",
330
+ 300: "#E0E0E0",
331
+ 400: "#BDBDBD",
332
+ 500: "#9E9E9E",
333
+ 600: "#757575",
334
+ 700: "#616161",
335
+ 800: "#424242",
336
+ 900: "#212121"
337
+ },
338
+ success: {
339
+ 50: "#e8f5e9",
340
+ 100: "#c8e6c9",
341
+ 200: "#a5d6a7",
342
+ 300: "#81c784",
343
+ 400: "#66bb6a",
344
+ 500: "#4caf50",
345
+ 600: "#43a047",
346
+ 700: "#388e3c",
347
+ 800: "#2e7d32",
348
+ 900: "#1b5e20"
349
+ },
350
+ error: {
351
+ 50: "#ffebee",
352
+ 100: "#ffcdd2",
353
+ 200: "#ef9a9a",
354
+ 300: "#e57373",
355
+ 400: "#ef5350",
356
+ 500: "#f44336",
357
+ 600: "#e53935",
358
+ 700: "#d32f2f",
359
+ 800: "#c62828",
360
+ 900: "#b71c1c"
361
+ },
362
+ warning: {
363
+ 50: "#fff3e0",
364
+ 100: "#ffe0b2",
365
+ 200: "#ffcc80",
366
+ 300: "#ffb74d",
367
+ 400: "#ffa726",
368
+ 500: "#ff9800",
369
+ 600: "#fb8c00",
370
+ 700: "#f57c00",
371
+ 800: "#ef6c00",
372
+ 900: "#e65100"
373
+ },
374
+ info: {
375
+ 50: "#e3f2fd",
376
+ 100: "#bbdefb",
377
+ 200: "#90caf9",
378
+ 300: "#64b5f6",
379
+ 400: "#42a5f5",
380
+ 500: "#2196f3",
381
+ 600: "#1e88e5",
382
+ 700: "#1976d2",
383
+ 800: "#1565c0",
384
+ 900: "#0d47a1"
385
+ }
386
+ },
387
+ typography: {
388
+ fontFamily: "system-ui, -apple-system, sans-serif",
389
+ baseSize: 16,
390
+ minSize: 14,
391
+ scaleRatio: 1.25,
392
+ sizes: {
393
+ 10: 10,
394
+ 11: 11,
395
+ 12: 12,
396
+ 14: 14,
397
+ 16: 16,
398
+ 18: 18,
399
+ 20: 20,
400
+ 24: 24,
401
+ 28: 28,
402
+ 32: 32,
403
+ 36: 36,
404
+ 48: 48,
405
+ 64: 64
406
+ },
407
+ lineHeights: {
408
+ 10: 10,
409
+ 12: 12,
410
+ 14: 14,
411
+ 16: 16,
412
+ 20: 20,
413
+ 24: 24,
414
+ 28: 28,
415
+ 32: 32,
416
+ 36: 36,
417
+ 40: 40,
418
+ 44: 44,
419
+ 48: 48,
420
+ 74: 74
421
+ },
422
+ weights: {
423
+ regular: "400",
424
+ semibold: "600",
425
+ bold: "700"
426
+ }
427
+ },
428
+ spacing: {
429
+ unit: 4,
430
+ 4: 4,
431
+ 8: 8,
432
+ 12: 12,
433
+ 16: 16,
434
+ 20: 20,
435
+ 24: 24,
436
+ 32: 32,
437
+ 40: 40,
438
+ 48: 48,
439
+ 56: 56,
440
+ 64: 64,
441
+ 72: 72,
442
+ 80: 80
443
+ },
444
+ radius: {
445
+ xs: 4,
446
+ sm: 8,
447
+ md: 12,
448
+ lg: 16,
449
+ xl: 20,
450
+ "2xl": 24,
451
+ "3xl": 28,
452
+ full: 1e3
453
+ },
454
+ shadows: {
455
+ sm: "0px 1px 2px rgba(0, 0, 0, 0.05)",
456
+ md: "0px 4px 6px rgba(0, 0, 0, 0.1)",
457
+ lg: "0px 10px 15px rgba(0, 0, 0, 0.1)",
458
+ xl: "0px 20px 25px rgba(0, 0, 0, 0.1)"
459
+ }
460
+ };
461
+ function O(o, n) {
462
+ const t = { ...o };
463
+ return j(o) && j(n) && Object.keys(n).forEach((r) => {
464
+ j(n[r]) ? r in o ? t[r] = O(o[r], n[r]) : Object.assign(t, { [r]: n[r] }) : Object.assign(t, { [r]: n[r] });
465
+ }), t;
466
+ }
467
+ function j(o) {
468
+ return o && typeof o == "object" && !Array.isArray(o);
469
+ }
470
+ const ye = Ee(), he = O(ge, ye);
471
+ function H(o = {}) {
472
+ return O(he, o);
473
+ }
474
+ function J(o = {}) {
475
+ const n = H(o), t = document.createElement("style");
476
+ t.id = "ds-theme";
477
+ let r = `:root {
478
+ `;
479
+ Object.entries(n.colors).forEach(([c, u]) => {
480
+ typeof u == "object" && Object.entries(u).forEach(([m, F]) => {
481
+ r += ` --${c}-${m}: ${F};
482
+ `;
483
+ });
484
+ });
485
+ const a = n.typography;
486
+ if (r += ` --font-family: ${a.fontFamily};
487
+ `, a.baseSize && a.minSize) {
488
+ const c = (a.baseSize - a.minSize) / 1600, m = `${-320 * c + a.minSize}px + ${c * 100}vw`;
489
+ r += ` --font-size-base: clamp(${a.minSize}px, ${m}, ${a.baseSize}px);
490
+ `;
491
+ } else
492
+ r += ` --font-size-base: ${a.baseSize || 16}px;
493
+ `;
494
+ r += ` --type-scale: ${a.scaleRatio || 1.25};
495
+ `, a.sizes && Object.entries(a.sizes).forEach(([c, u]) => {
496
+ r += ` --font-size-${c}: ${u}px;
497
+ `;
498
+ }), a.lineHeights && Object.entries(a.lineHeights).forEach(([c, u]) => {
499
+ r += ` --line-height-${c}: ${u}px;
500
+ `;
501
+ }), a.weights && Object.entries(a.weights).forEach(([c, u]) => {
502
+ r += ` --font-weight-${c}: ${u};
503
+ `;
504
+ });
505
+ const i = n.spacing.unit || 4;
506
+ r += ` --space-unit: ${i}px;
507
+ `, Object.entries(n.spacing).forEach(([c, u]) => {
508
+ c !== "unit" && (r += ` --space-${c}: ${u}px;
509
+ `);
510
+ }), Object.entries(n.radius).forEach(([c, u]) => {
511
+ r += ` --radius-${c}: ${u}px;
512
+ `;
513
+ }), n.shadows && Object.entries(n.shadows).forEach(([c, u]) => {
514
+ r += ` --shadow-${c}: ${u};
515
+ `;
516
+ }), r += `}
517
+ `, r += `html { font-size: var(--font-size-base); }
518
+ `, r += `body { font-family: var(--font-family); }
519
+ `, t.textContent = r;
520
+ const l = document.getElementById("ds-theme");
521
+ l && l.remove(), document.head.appendChild(t);
522
+ }
523
+ const G = ue(null);
524
+ function Se({ tokens: o = {}, children: n }) {
525
+ const t = W(() => H(o), [o]);
526
+ fe(() => {
527
+ J(t);
528
+ }, [t]);
529
+ const r = W(() => ({
530
+ tokens: t,
531
+ getToken: (a) => {
532
+ const i = a.split(".");
533
+ let l = t;
534
+ for (const c of i)
535
+ if (l && typeof l == "object" && c in l)
536
+ l = l[c];
537
+ else
538
+ return;
539
+ return l;
540
+ }
541
+ }), [t]);
542
+ return /* @__PURE__ */ V.jsx(G.Provider, { value: r, children: n });
543
+ }
544
+ Se.propTypes = {
545
+ tokens: y.object,
546
+ children: y.node.isRequired
547
+ };
548
+ function Re() {
549
+ const o = de(G);
550
+ if (!o) {
551
+ console.warn("useTheme must be used within ThemeProvider. Using default tokens.");
552
+ const { createTokens: n } = require("../tokens/index.js"), t = n();
553
+ return {
554
+ tokens: t,
555
+ getToken: (r) => {
556
+ const a = r.split(".");
557
+ let i = t;
558
+ for (const l of a)
559
+ if (i && typeof i == "object" && l in i)
560
+ i = i[l];
561
+ else
562
+ return;
563
+ return i;
564
+ }
565
+ };
566
+ }
567
+ return o;
568
+ }
569
+ function Te() {
570
+ const { tokens: o, getToken: n } = Re();
571
+ return {
572
+ /**
573
+ * دریافت رنگ
574
+ * @param {string} path - مسیر رنگ مثل 'primary.500' یا 'neutral.100'
575
+ * @returns {string} مقدار رنگ
576
+ */
577
+ color: (t) => {
578
+ const r = n(`colors.${t}`);
579
+ if (r) return r;
580
+ const [a, i] = t.split(".");
581
+ return `var(--${a}-${i}, #000)`;
582
+ },
583
+ /**
584
+ * دریافت spacing
585
+ * @param {string|number} key - کلید spacing مثل '4' یا 'sm'
586
+ * @returns {string} مقدار spacing با واحد px
587
+ */
588
+ spacing: (t) => {
589
+ const r = n(`spacing.${t}`);
590
+ return r ? `${r}px` : `var(--space-${t}, ${t * (o.spacing?.unit || 4)}px)`;
591
+ },
592
+ /**
593
+ * دریافت radius
594
+ * @param {string} key - کلید radius مثل 'md' یا 'lg'
595
+ * @returns {string} مقدار radius با واحد px
596
+ */
597
+ radius: (t) => {
598
+ const r = n(`radius.${t}`);
599
+ return r ? `${r}px` : `var(--radius-${t}, 8px)`;
600
+ },
601
+ /**
602
+ * دریافت typography
603
+ * @param {string} property - ویژگی typography مثل 'fontFamily', 'sizes.16'
604
+ * @returns {string|number} مقدار typography
605
+ */
606
+ typography: (t) => {
607
+ const r = n(`typography.${t}`);
608
+ return r ? typeof r == "number" ? `${r}px` : r : t === "fontFamily" ? "var(--font-family, system-ui, sans-serif)" : `var(--font-${t}, 16px)`;
609
+ },
610
+ /**
611
+ * دریافت shadow
612
+ * @param {string} key - کلید shadow مثل 'sm' یا 'md'
613
+ * @returns {string} مقدار shadow
614
+ */
615
+ shadow: (t) => {
616
+ const r = n(`shadows.${t}`);
617
+ return r || `var(--shadow-${t}, none)`;
618
+ },
619
+ /**
620
+ * دسترسی مستقیم به توکن‌ها
621
+ */
622
+ tokens: o,
623
+ /**
624
+ * دریافت توکن با مسیر دلخواه
625
+ */
626
+ getToken: n
627
+ };
628
+ }
629
+ const Ae = ({ variant: o = "primary", size: n = "md", children: t, className: r = "", ...a }) => {
630
+ const { color: i, spacing: l, radius: c, typography: u } = Te(), m = {
631
+ primary: {
632
+ backgroundColor: i("primary.500"),
633
+ color: "#ffffff",
634
+ border: "none"
635
+ },
636
+ outline: {
637
+ backgroundColor: "transparent",
638
+ border: `2px solid ${i("primary.500")}`,
639
+ color: i("primary.500")
640
+ },
641
+ text: {
642
+ backgroundColor: "transparent",
643
+ border: "none",
644
+ color: i("primary.500")
645
+ },
646
+ secondary: {
647
+ backgroundColor: i("neutral.200"),
648
+ color: i("neutral.900"),
649
+ border: "none"
650
+ },
651
+ success: {
652
+ backgroundColor: i("success.500"),
653
+ color: "#ffffff",
654
+ border: "none"
655
+ },
656
+ error: {
657
+ backgroundColor: i("error.500"),
658
+ color: "#ffffff",
659
+ border: "none"
660
+ }
661
+ }, F = {
662
+ sm: {
663
+ padding: `${l(2)} ${l(4)}`,
664
+ fontSize: u("sizes.14") || "14px"
665
+ },
666
+ md: {
667
+ padding: `${l(3)} ${l(6)}`,
668
+ fontSize: u("sizes.16") || "16px"
669
+ },
670
+ lg: {
671
+ padding: `${l(4)} ${l(8)}`,
672
+ fontSize: u("sizes.18") || "18px"
673
+ }
674
+ };
675
+ return /* @__PURE__ */ V.jsx(
676
+ "button",
677
+ {
678
+ className: `ds-button ds-button--${o} ds-button--${n} ${r}`,
679
+ style: {
680
+ borderRadius: c("md"),
681
+ fontFamily: u("fontFamily"),
682
+ fontWeight: "500",
683
+ cursor: "pointer",
684
+ transition: "all 0.2s ease",
685
+ ...m[o],
686
+ ...F[n],
687
+ ...a.style
688
+ },
689
+ onMouseEnter: (b) => {
690
+ o === "primary" && (b.currentTarget.style.opacity = "0.9");
691
+ },
692
+ onMouseLeave: (b) => {
693
+ o === "primary" && (b.currentTarget.style.opacity = "1");
694
+ },
695
+ ...a,
696
+ children: t
697
+ }
698
+ );
699
+ };
700
+ Ae.propTypes = {
701
+ children: y.node.isRequired,
702
+ variant: y.oneOf(["primary", "outline", "text", "secondary", "success", "error"]),
703
+ size: y.oneOf(["sm", "md", "lg"]),
704
+ className: y.string
705
+ };
706
+ function _e(o = {}) {
707
+ J(o);
708
+ }
709
+ const xe = {};
710
+ function ke(o = {}) {
711
+ let n = "";
712
+ Object.entries(o.colors?.primary || {}).forEach(([t, r]) => {
713
+ n += `$primary-${t}: ${r};
714
+ `;
715
+ }), n += `$font-family: "${o.typography?.fontFamily || "sans-serif"}";
716
+ `, n += `$font-size-base: ${o.typography?.baseSize || 16}px;
717
+ `, xe.writeFileSync("custom-variables.scss", n);
718
+ }
719
+ const $e = {
720
+ colors: {
721
+ primary: q.primary,
722
+ neutral: q.neutral
723
+ },
724
+ spacing: { unit: 4 },
725
+ // 1 = 4px
726
+ typography: { fontFamily: "system-ui, sans-serif", baseSize: 16 }
727
+ };
728
+ export {
729
+ Ae as Button,
730
+ Se as ThemeProvider,
731
+ he as baseTokens,
732
+ H as createTokens,
733
+ Se as default,
734
+ q as defaultColors,
735
+ $e as defaultConfig,
736
+ ge as defaultTokens,
737
+ ke as generateSCSS,
738
+ J as generateTheme,
739
+ _e as injectCSS,
740
+ Re as useTheme,
741
+ Te as useTokens
742
+ };