@asyra/design-system 0.2.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/README.md +1 -0
- package/dist/components/Button/Button.d.ts +17 -0
- package/dist/components/Button/Button.stories.d.ts +9 -0
- package/dist/components/Button/index.d.ts +1 -0
- package/dist/components/Icon/Icon.d.ts +12 -0
- package/dist/components/Icon/index.d.ts +1 -0
- package/dist/components/Icon/svgs-components.d.ts +11 -0
- package/dist/components/Input/Input.d.ts +16 -0
- package/dist/components/Input/Input.stories.d.ts +6 -0
- package/dist/components/Input/index.d.ts +1 -0
- package/dist/components/Text/Text.d.ts +11 -0
- package/dist/components/Text/Text.stories.d.ts +7 -0
- package/dist/components/Text/index.d.ts +1 -0
- package/dist/design-system.css +1 -0
- package/dist/index.css +819 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.es.js +615 -0
- package/dist/index.es.js.map +1 -0
- package/dist/index.umd.js +26 -0
- package/dist/index.umd.js.map +1 -0
- package/package.json +58 -0
package/dist/index.d.ts
ADDED
package/dist/index.es.js
ADDED
|
@@ -0,0 +1,615 @@
|
|
|
1
|
+
import * as E from "react";
|
|
2
|
+
import je, { useRef as We, useState as Fe, useCallback as Y, useEffect as $e } from "react";
|
|
3
|
+
var k = { exports: {} }, x = {};
|
|
4
|
+
/**
|
|
5
|
+
* @license React
|
|
6
|
+
* react-jsx-runtime.production.js
|
|
7
|
+
*
|
|
8
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
9
|
+
*
|
|
10
|
+
* This source code is licensed under the MIT license found in the
|
|
11
|
+
* LICENSE file in the root directory of this source tree.
|
|
12
|
+
*/
|
|
13
|
+
var ie;
|
|
14
|
+
function He() {
|
|
15
|
+
if (ie) return x;
|
|
16
|
+
ie = 1;
|
|
17
|
+
var e = Symbol.for("react.transitional.element"), r = Symbol.for("react.fragment");
|
|
18
|
+
function n(s, a, i) {
|
|
19
|
+
var l = null;
|
|
20
|
+
if (i !== void 0 && (l = "" + i), a.key !== void 0 && (l = "" + a.key), "key" in a) {
|
|
21
|
+
i = {};
|
|
22
|
+
for (var N in a)
|
|
23
|
+
N !== "key" && (i[N] = a[N]);
|
|
24
|
+
} else i = a;
|
|
25
|
+
return a = i.ref, {
|
|
26
|
+
$$typeof: e,
|
|
27
|
+
type: s,
|
|
28
|
+
key: l,
|
|
29
|
+
ref: a !== void 0 ? a : null,
|
|
30
|
+
props: i
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
return x.Fragment = r, x.jsx = n, x.jsxs = n, x;
|
|
34
|
+
}
|
|
35
|
+
var P = {};
|
|
36
|
+
/**
|
|
37
|
+
* @license React
|
|
38
|
+
* react-jsx-runtime.development.js
|
|
39
|
+
*
|
|
40
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
41
|
+
*
|
|
42
|
+
* This source code is licensed under the MIT license found in the
|
|
43
|
+
* LICENSE file in the root directory of this source tree.
|
|
44
|
+
*/
|
|
45
|
+
var le;
|
|
46
|
+
function Ve() {
|
|
47
|
+
return le || (le = 1, process.env.NODE_ENV !== "production" && function() {
|
|
48
|
+
function e(t) {
|
|
49
|
+
if (t == null) return null;
|
|
50
|
+
if (typeof t == "function")
|
|
51
|
+
return t.$$typeof === De ? null : t.displayName || t.name || null;
|
|
52
|
+
if (typeof t == "string") return t;
|
|
53
|
+
switch (t) {
|
|
54
|
+
case O:
|
|
55
|
+
return "Fragment";
|
|
56
|
+
case we:
|
|
57
|
+
return "Profiler";
|
|
58
|
+
case ge:
|
|
59
|
+
return "StrictMode";
|
|
60
|
+
case xe:
|
|
61
|
+
return "Suspense";
|
|
62
|
+
case Pe:
|
|
63
|
+
return "SuspenseList";
|
|
64
|
+
case Me:
|
|
65
|
+
return "Activity";
|
|
66
|
+
}
|
|
67
|
+
if (typeof t == "object")
|
|
68
|
+
switch (typeof t.tag == "number" && console.error(
|
|
69
|
+
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
70
|
+
), t.$$typeof) {
|
|
71
|
+
case L:
|
|
72
|
+
return "Portal";
|
|
73
|
+
case pe:
|
|
74
|
+
return (t.displayName || "Context") + ".Provider";
|
|
75
|
+
case Se:
|
|
76
|
+
return (t._context.displayName || "Context") + ".Consumer";
|
|
77
|
+
case Le:
|
|
78
|
+
var o = t.render;
|
|
79
|
+
return t = t.displayName, t || (t = o.displayName || o.name || "", t = t !== "" ? "ForwardRef(" + t + ")" : "ForwardRef"), t;
|
|
80
|
+
case be:
|
|
81
|
+
return o = t.displayName || null, o !== null ? o : e(t.type) || "Memo";
|
|
82
|
+
case te:
|
|
83
|
+
o = t._payload, t = t._init;
|
|
84
|
+
try {
|
|
85
|
+
return e(t(o));
|
|
86
|
+
} catch {
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
function r(t) {
|
|
92
|
+
return "" + t;
|
|
93
|
+
}
|
|
94
|
+
function n(t) {
|
|
95
|
+
try {
|
|
96
|
+
r(t);
|
|
97
|
+
var o = !1;
|
|
98
|
+
} catch {
|
|
99
|
+
o = !0;
|
|
100
|
+
}
|
|
101
|
+
if (o) {
|
|
102
|
+
o = console;
|
|
103
|
+
var c = o.error, u = typeof Symbol == "function" && Symbol.toStringTag && t[Symbol.toStringTag] || t.constructor.name || "Object";
|
|
104
|
+
return c.call(
|
|
105
|
+
o,
|
|
106
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
107
|
+
u
|
|
108
|
+
), r(t);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
function s(t) {
|
|
112
|
+
if (t === O) return "<>";
|
|
113
|
+
if (typeof t == "object" && t !== null && t.$$typeof === te)
|
|
114
|
+
return "<...>";
|
|
115
|
+
try {
|
|
116
|
+
var o = e(t);
|
|
117
|
+
return o ? "<" + o + ">" : "<...>";
|
|
118
|
+
} catch {
|
|
119
|
+
return "<...>";
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
function a() {
|
|
123
|
+
var t = W.A;
|
|
124
|
+
return t === null ? null : t.getOwner();
|
|
125
|
+
}
|
|
126
|
+
function i() {
|
|
127
|
+
return Error("react-stack-top-frame");
|
|
128
|
+
}
|
|
129
|
+
function l(t) {
|
|
130
|
+
if (re.call(t, "key")) {
|
|
131
|
+
var o = Object.getOwnPropertyDescriptor(t, "key").get;
|
|
132
|
+
if (o && o.isReactWarning) return !1;
|
|
133
|
+
}
|
|
134
|
+
return t.key !== void 0;
|
|
135
|
+
}
|
|
136
|
+
function N(t, o) {
|
|
137
|
+
function c() {
|
|
138
|
+
ne || (ne = !0, console.error(
|
|
139
|
+
"%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)",
|
|
140
|
+
o
|
|
141
|
+
));
|
|
142
|
+
}
|
|
143
|
+
c.isReactWarning = !0, Object.defineProperty(t, "key", {
|
|
144
|
+
get: c,
|
|
145
|
+
configurable: !0
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
function h() {
|
|
149
|
+
var t = e(this.type);
|
|
150
|
+
return oe[t] || (oe[t] = !0, console.error(
|
|
151
|
+
"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."
|
|
152
|
+
)), t = this.props.ref, t !== void 0 ? t : null;
|
|
153
|
+
}
|
|
154
|
+
function p(t, o, c, u, d, R, $, H) {
|
|
155
|
+
return c = R.ref, t = {
|
|
156
|
+
$$typeof: U,
|
|
157
|
+
type: t,
|
|
158
|
+
key: o,
|
|
159
|
+
props: R,
|
|
160
|
+
_owner: d
|
|
161
|
+
}, (c !== void 0 ? c : null) !== null ? Object.defineProperty(t, "ref", {
|
|
162
|
+
enumerable: !1,
|
|
163
|
+
get: h
|
|
164
|
+
}) : Object.defineProperty(t, "ref", { enumerable: !1, value: null }), t._store = {}, Object.defineProperty(t._store, "validated", {
|
|
165
|
+
configurable: !1,
|
|
166
|
+
enumerable: !1,
|
|
167
|
+
writable: !0,
|
|
168
|
+
value: 0
|
|
169
|
+
}), Object.defineProperty(t, "_debugInfo", {
|
|
170
|
+
configurable: !1,
|
|
171
|
+
enumerable: !1,
|
|
172
|
+
writable: !0,
|
|
173
|
+
value: null
|
|
174
|
+
}), Object.defineProperty(t, "_debugStack", {
|
|
175
|
+
configurable: !1,
|
|
176
|
+
enumerable: !1,
|
|
177
|
+
writable: !0,
|
|
178
|
+
value: $
|
|
179
|
+
}), Object.defineProperty(t, "_debugTask", {
|
|
180
|
+
configurable: !1,
|
|
181
|
+
enumerable: !1,
|
|
182
|
+
writable: !0,
|
|
183
|
+
value: H
|
|
184
|
+
}), Object.freeze && (Object.freeze(t.props), Object.freeze(t)), t;
|
|
185
|
+
}
|
|
186
|
+
function C(t, o, c, u, d, R, $, H) {
|
|
187
|
+
var T = o.children;
|
|
188
|
+
if (T !== void 0)
|
|
189
|
+
if (u)
|
|
190
|
+
if (Ue(T)) {
|
|
191
|
+
for (u = 0; u < T.length; u++)
|
|
192
|
+
D(T[u]);
|
|
193
|
+
Object.freeze && Object.freeze(T);
|
|
194
|
+
} else
|
|
195
|
+
console.error(
|
|
196
|
+
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
197
|
+
);
|
|
198
|
+
else D(T);
|
|
199
|
+
if (re.call(o, "key")) {
|
|
200
|
+
T = e(t);
|
|
201
|
+
var I = Object.keys(o).filter(function(ke) {
|
|
202
|
+
return ke !== "key";
|
|
203
|
+
});
|
|
204
|
+
u = 0 < I.length ? "{key: someKey, " + I.join(": ..., ") + ": ...}" : "{key: someKey}", ce[T + u] || (I = 0 < I.length ? "{" + I.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
205
|
+
`A props object containing a "key" prop is being spread into JSX:
|
|
206
|
+
let props = %s;
|
|
207
|
+
<%s {...props} />
|
|
208
|
+
React keys must be passed directly to JSX without using spread:
|
|
209
|
+
let props = %s;
|
|
210
|
+
<%s key={someKey} {...props} />`,
|
|
211
|
+
u,
|
|
212
|
+
T,
|
|
213
|
+
I,
|
|
214
|
+
T
|
|
215
|
+
), ce[T + u] = !0);
|
|
216
|
+
}
|
|
217
|
+
if (T = null, c !== void 0 && (n(c), T = "" + c), l(o) && (n(o.key), T = "" + o.key), "key" in o) {
|
|
218
|
+
c = {};
|
|
219
|
+
for (var V in o)
|
|
220
|
+
V !== "key" && (c[V] = o[V]);
|
|
221
|
+
} else c = o;
|
|
222
|
+
return T && N(
|
|
223
|
+
c,
|
|
224
|
+
typeof t == "function" ? t.displayName || t.name || "Unknown" : t
|
|
225
|
+
), p(
|
|
226
|
+
t,
|
|
227
|
+
T,
|
|
228
|
+
R,
|
|
229
|
+
d,
|
|
230
|
+
a(),
|
|
231
|
+
c,
|
|
232
|
+
$,
|
|
233
|
+
H
|
|
234
|
+
);
|
|
235
|
+
}
|
|
236
|
+
function D(t) {
|
|
237
|
+
typeof t == "object" && t !== null && t.$$typeof === U && t._store && (t._store.validated = 1);
|
|
238
|
+
}
|
|
239
|
+
var A = je, U = Symbol.for("react.transitional.element"), L = Symbol.for("react.portal"), O = Symbol.for("react.fragment"), ge = Symbol.for("react.strict_mode"), we = Symbol.for("react.profiler"), Se = Symbol.for("react.consumer"), pe = Symbol.for("react.context"), Le = Symbol.for("react.forward_ref"), xe = Symbol.for("react.suspense"), Pe = Symbol.for("react.suspense_list"), be = Symbol.for("react.memo"), te = Symbol.for("react.lazy"), Me = Symbol.for("react.activity"), De = Symbol.for("react.client.reference"), W = A.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, re = Object.prototype.hasOwnProperty, Ue = Array.isArray, F = console.createTask ? console.createTask : function() {
|
|
240
|
+
return null;
|
|
241
|
+
};
|
|
242
|
+
A = {
|
|
243
|
+
"react-stack-bottom-frame": function(t) {
|
|
244
|
+
return t();
|
|
245
|
+
}
|
|
246
|
+
};
|
|
247
|
+
var ne, oe = {}, se = A["react-stack-bottom-frame"].bind(
|
|
248
|
+
A,
|
|
249
|
+
i
|
|
250
|
+
)(), ae = F(s(i)), ce = {};
|
|
251
|
+
P.Fragment = O, P.jsx = function(t, o, c, u, d) {
|
|
252
|
+
var R = 1e4 > W.recentlyCreatedOwnerStacks++;
|
|
253
|
+
return C(
|
|
254
|
+
t,
|
|
255
|
+
o,
|
|
256
|
+
c,
|
|
257
|
+
!1,
|
|
258
|
+
u,
|
|
259
|
+
d,
|
|
260
|
+
R ? Error("react-stack-top-frame") : se,
|
|
261
|
+
R ? F(s(t)) : ae
|
|
262
|
+
);
|
|
263
|
+
}, P.jsxs = function(t, o, c, u, d) {
|
|
264
|
+
var R = 1e4 > W.recentlyCreatedOwnerStacks++;
|
|
265
|
+
return C(
|
|
266
|
+
t,
|
|
267
|
+
o,
|
|
268
|
+
c,
|
|
269
|
+
!0,
|
|
270
|
+
u,
|
|
271
|
+
d,
|
|
272
|
+
R ? Error("react-stack-top-frame") : se,
|
|
273
|
+
R ? F(s(t)) : ae
|
|
274
|
+
);
|
|
275
|
+
};
|
|
276
|
+
}()), P;
|
|
277
|
+
}
|
|
278
|
+
var Ee;
|
|
279
|
+
function Ye() {
|
|
280
|
+
return Ee || (Ee = 1, process.env.NODE_ENV === "production" ? k.exports = He() : k.exports = Ve()), k.exports;
|
|
281
|
+
}
|
|
282
|
+
var f = Ye();
|
|
283
|
+
const ue = ({ label: e, classNames: r = "text-gray-200" }) => {
|
|
284
|
+
const n = typeof e == "string" ? e : e.toString();
|
|
285
|
+
return /* @__PURE__ */ f.jsx("span", { className: r, children: n });
|
|
286
|
+
};
|
|
287
|
+
var Z;
|
|
288
|
+
(function(e) {
|
|
289
|
+
e.SELECT = "select", e.RECTANGLE = "rectangle";
|
|
290
|
+
})(Z || (Z = {}));
|
|
291
|
+
var Te;
|
|
292
|
+
(function(e) {
|
|
293
|
+
e.SCENE_TREE = "sceneTree", e.ELEMENT_SELECTION = "elementSelection", e.PROPS = "props";
|
|
294
|
+
})(Te || (Te = {}));
|
|
295
|
+
var fe;
|
|
296
|
+
(function(e) {
|
|
297
|
+
e.ADD_PROPERTY = "addProperty", e.REMOVE_PROPERTY = "removeProperty", e.UPDATE_PROPERTY = "updateProperty";
|
|
298
|
+
})(fe || (fe = {}));
|
|
299
|
+
var Re;
|
|
300
|
+
(function(e) {
|
|
301
|
+
e.ADD_ELEMENT = "addElement", e.REMOVE_ELEMENT = "removeElement", e.UPDATE_ELEMENT_COMPUTED_DATA = "updateElementComputedData";
|
|
302
|
+
})(Re || (Re = {}));
|
|
303
|
+
var _e;
|
|
304
|
+
(function(e) {
|
|
305
|
+
e.ELEMENT = "element", e.VERTEX = "vertex";
|
|
306
|
+
})(_e || (_e = {}));
|
|
307
|
+
var Ne;
|
|
308
|
+
(function(e) {
|
|
309
|
+
e.SELECT_ELEMENTS = "selectElements", e.DESELECT_ELEMENTS = "deselectElements", e.SELECT_VERTICES = "selectVertices", e.DESELECT_VERTICES = "deselectVertices";
|
|
310
|
+
})(Ne || (Ne = {}));
|
|
311
|
+
var S;
|
|
312
|
+
(function(e) {
|
|
313
|
+
e.PX = "px", e.PERCENT = "pct";
|
|
314
|
+
})(S || (S = {}));
|
|
315
|
+
var de;
|
|
316
|
+
(function(e) {
|
|
317
|
+
e.NONE = "none", e.UNDO = "undo", e.REDO = "redo";
|
|
318
|
+
})(de || (de = {}));
|
|
319
|
+
var me;
|
|
320
|
+
(function(e) {
|
|
321
|
+
e.NONE = "none", e.PAN = "pan", e.ZOOM = "zoom";
|
|
322
|
+
})(me || (me = {}));
|
|
323
|
+
var X;
|
|
324
|
+
(function(e) {
|
|
325
|
+
e.LG = "lg", e.MD = "md", e.SM = "sm";
|
|
326
|
+
})(X || (X = {}));
|
|
327
|
+
var w;
|
|
328
|
+
(function(e) {
|
|
329
|
+
e.META = "meta", e.CTRL = "ctrl", e.ALT = "alt", e.SHIFT = "shift";
|
|
330
|
+
})(w || (w = {}));
|
|
331
|
+
w.META, w.CTRL, w.ALT, w.SHIFT;
|
|
332
|
+
var y;
|
|
333
|
+
(function(e) {
|
|
334
|
+
e.WHEEL = "wheel";
|
|
335
|
+
})(y || (y = {}));
|
|
336
|
+
y.WHEEL;
|
|
337
|
+
var b;
|
|
338
|
+
(function(e) {
|
|
339
|
+
e.INPUT = "input", e.TEXT = "text", e.TEXTAREA = "textarea";
|
|
340
|
+
})(b || (b = {}));
|
|
341
|
+
b.INPUT, b.TEXT, b.TEXTAREA;
|
|
342
|
+
var Oe;
|
|
343
|
+
(function(e) {
|
|
344
|
+
e.KEYBOARD = "keyboard", e.POINTER = "pointer", e.WHEEL = "wheel";
|
|
345
|
+
})(Oe || (Oe = {}));
|
|
346
|
+
var m;
|
|
347
|
+
(function(e) {
|
|
348
|
+
e.LEFT = "left", e.RIGHT = "right", e.MIDDLE = "middle", e.NONE = "none";
|
|
349
|
+
})(m || (m = {}));
|
|
350
|
+
m.LEFT, m.RIGHT, m.MIDDLE, m.NONE;
|
|
351
|
+
var he;
|
|
352
|
+
(function(e) {
|
|
353
|
+
e.LEFT_MOUSE_DOWN = "leftMouseDown", e.LEFT_MOUSE_UP = "leftMouseUp", e.LEFT_MOUSE_MOVE = "leftMouseMove", e.RIGHT_MOUSE_DOWN = "rightMouseDown", e.RIGHT_MOUSE_UP = "rightMouseUp", e.MOUSE_DOUBLE_CLICK = "mouseDoubleClick", e.WHEEL = "wheel";
|
|
354
|
+
})(he || (he = {}));
|
|
355
|
+
m.NONE;
|
|
356
|
+
var Ce;
|
|
357
|
+
(function(e) {
|
|
358
|
+
e.WINDOWS = "windows", e.MAC = "mac", e.LINUX = "linux";
|
|
359
|
+
})(Ce || (Ce = {}));
|
|
360
|
+
var B;
|
|
361
|
+
(function(e) {
|
|
362
|
+
e.ACTION = "action", e.DESIGN = "design", e.PREVIEW = "preview";
|
|
363
|
+
})(B || (B = {}));
|
|
364
|
+
var z;
|
|
365
|
+
(function(e) {
|
|
366
|
+
e.INTERACTION_START_TRANSACTION = "INTERACTION_START_TRANSACTION", e.INTERACTION_END_TRANSACTION = "INTERACTION_END_TRANSACTION";
|
|
367
|
+
})(z || (z = {}));
|
|
368
|
+
var q;
|
|
369
|
+
(function(e) {
|
|
370
|
+
e.INTERACTION_SELECT_ELEMENTS = "INTERACTION_SELECT_ELEMENTS", e.INTERACTION_MOVE_ELEMENTS = "INTERACTION_MOVE_ELEMENTS", e.INTERACTION_DELETE_ELEMENTS = "INTERACTION_DELETE_ELEMENTS", e.INTERACTION_CREATE_ELEMENT = "INTERACTION_CREATE_ELEMENT", e.INTERACTION_RESIZE_ELEMENT = "INTERACTION_RESIZE_ELEMENT", e.INTERACTION_END_RESIZE_ELEMENT = "INTERACTION_END_RESIZE_ELEMENT", e.INTERACTION_RESET_ELEMENT_SIZE = "INTERACTION_RESET_ELEMENT_SIZE";
|
|
371
|
+
})(q || (q = {}));
|
|
372
|
+
var J;
|
|
373
|
+
(function(e) {
|
|
374
|
+
e.INTERACTION_SWITCH_PRIMARY_TOOL = "INTERACTION_SWITCH_PRIMARY_TOOL";
|
|
375
|
+
})(J || (J = {}));
|
|
376
|
+
var Q;
|
|
377
|
+
(function(e) {
|
|
378
|
+
e.INTERACTION_UNDOREDO = "INTERACTION_UNDOREDO";
|
|
379
|
+
})(Q || (Q = {}));
|
|
380
|
+
var K;
|
|
381
|
+
(function(e) {
|
|
382
|
+
e.INTERACTION_ZOOM_FIT = "INTERACTION_ZOOM_FIT", e.INTERACTION_PAN_ZOOM = "INTERACTION_PAN_ZOOM";
|
|
383
|
+
})(K || (K = {}));
|
|
384
|
+
({
|
|
385
|
+
...z,
|
|
386
|
+
...q,
|
|
387
|
+
...J,
|
|
388
|
+
...Q,
|
|
389
|
+
...K
|
|
390
|
+
});
|
|
391
|
+
var Ae;
|
|
392
|
+
(function(e) {
|
|
393
|
+
e.INPUT_DRAG_START = "INPUT_DRAG_START", e.INPUT_DRAG_UPDATE = "INPUT_DRAG_UPDATE", e.INPUT_DRAG_END = "INPUT_DRAG_END", e.INPUT_MOUSE_MOVE = "INPUT_MOUSE_MOVE", e.INPUT_WHEEL_SCROLL = "INPUT_WHEEL_SCROLL", e.INPUT_SHORTCUT_ARROW = "INPUT_SHORTCUT_ARROW", e.INPUT_SHORTCUT_UNDOREDO = "INPUT_SHORTCUT_UNDOREDO", e.INPUT_SHORTCUT_ZOOM_PRESET = "INPUT_SHORTCUT_ZOOM_PRESET", e.INPUT_SHORTCUT_SWITCH_PRIMARY_TOOL = "INPUT_SHORTCUT_SWITCH_PRIMARY_TOOL";
|
|
394
|
+
})(Ae || (Ae = {}));
|
|
395
|
+
B.DESIGN;
|
|
396
|
+
Z.SELECT;
|
|
397
|
+
m.NONE;
|
|
398
|
+
const G = (e) => e ? e.charAt(0).toUpperCase() + e.slice(1) : "", ee = (e) => isFinite(Number(e));
|
|
399
|
+
var _;
|
|
400
|
+
(function(e) {
|
|
401
|
+
e.DEFAULT = "default", e.WORKSPACE = "ws", e.FRAME = "fr", e.ELEMENT = "el", e.PROPS = "pp";
|
|
402
|
+
})(_ || (_ = {}));
|
|
403
|
+
const Ge = "default", Ie = "0", v = "-", Ze = new Set(Object.values(_));
|
|
404
|
+
class Xe {
|
|
405
|
+
constructor() {
|
|
406
|
+
this.counter = {}, this.init();
|
|
407
|
+
}
|
|
408
|
+
init() {
|
|
409
|
+
Object.values(_).forEach((r) => {
|
|
410
|
+
this.counter[r] = r === _.DEFAULT ? Ie : `${r}${v}${Ie}`;
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
current(r = _.DEFAULT) {
|
|
414
|
+
return r ? this.counter[r] : "";
|
|
415
|
+
}
|
|
416
|
+
load(r, n) {
|
|
417
|
+
const s = this.current(n);
|
|
418
|
+
if (!s)
|
|
419
|
+
return "";
|
|
420
|
+
const a = s.split(v), i = parseInt(a[a.length - 1]), l = r.split(v);
|
|
421
|
+
parseInt(l[l.length - 1]) > i && this.update(n, r);
|
|
422
|
+
}
|
|
423
|
+
update(r = _.DEFAULT, n) {
|
|
424
|
+
r && (this.counter[r] = n);
|
|
425
|
+
}
|
|
426
|
+
increase(r = _.DEFAULT) {
|
|
427
|
+
if (!r)
|
|
428
|
+
return "";
|
|
429
|
+
const n = this.current(r);
|
|
430
|
+
if (!n)
|
|
431
|
+
return "";
|
|
432
|
+
const s = n.split(v), i = parseInt(s[s.length - 1]) + 1, l = r === Ge ? i.toString() : `${r}${v}${i}`;
|
|
433
|
+
return this.update(r, l), l;
|
|
434
|
+
}
|
|
435
|
+
valid(r, n = _.DEFAULT) {
|
|
436
|
+
if (!r || !n || !Ze.has(n))
|
|
437
|
+
return !1;
|
|
438
|
+
if (n === _.DEFAULT)
|
|
439
|
+
return ee(r);
|
|
440
|
+
const s = r.split(v);
|
|
441
|
+
return s.length !== 2 ? !1 : s[0] === n ? ee(s[1]) : !1;
|
|
442
|
+
}
|
|
443
|
+
clear() {
|
|
444
|
+
this.init();
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
new Xe();
|
|
448
|
+
var j;
|
|
449
|
+
(function(e) {
|
|
450
|
+
e.WORKSPACE = "workspace", e.FRAME = "frame", e.GROUP = "group", e.ELEMENT = "element", e.RECTANGLE = "rectangle";
|
|
451
|
+
})(j || (j = {}));
|
|
452
|
+
const ye = "0", g = " ", Be = new Set(Object.values(j));
|
|
453
|
+
class ze {
|
|
454
|
+
constructor() {
|
|
455
|
+
this.counter = {}, Object.values(j).forEach((r) => {
|
|
456
|
+
this.counter[r] = `${G(r)}${g}${ye}`;
|
|
457
|
+
});
|
|
458
|
+
}
|
|
459
|
+
current(r) {
|
|
460
|
+
return this.counter[r];
|
|
461
|
+
}
|
|
462
|
+
load(r, n) {
|
|
463
|
+
const s = this.current(n);
|
|
464
|
+
if (!s)
|
|
465
|
+
return "";
|
|
466
|
+
const a = s.split(g), i = parseInt(a[a.length - 1]), l = r.split(g);
|
|
467
|
+
parseInt(l[l.length - 1]) > i && this.update(n, r);
|
|
468
|
+
}
|
|
469
|
+
update(r, n) {
|
|
470
|
+
this.counter[r] = n;
|
|
471
|
+
}
|
|
472
|
+
increase(r) {
|
|
473
|
+
const n = this.current(r);
|
|
474
|
+
if (!n)
|
|
475
|
+
return "";
|
|
476
|
+
const s = n.split(g), i = parseInt(s[s.length - 1]) + 1, l = `${G(r)}${g}${i}`;
|
|
477
|
+
return this.update(r, l), l;
|
|
478
|
+
}
|
|
479
|
+
valid(r, n) {
|
|
480
|
+
if (!r || !n || !Be.has(n))
|
|
481
|
+
return !1;
|
|
482
|
+
const s = r.split(g);
|
|
483
|
+
return s.length !== 2 ? !1 : s[0] === G(n) ? ee(s[1]) : !1;
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
new ze();
|
|
487
|
+
var ve;
|
|
488
|
+
(function(e) {
|
|
489
|
+
e.POSITION = "position", e.DIMENSION = "dimension";
|
|
490
|
+
})(ve || (ve = {}));
|
|
491
|
+
S.PX, S.PX;
|
|
492
|
+
S.PX, S.PX;
|
|
493
|
+
var M;
|
|
494
|
+
(function(e) {
|
|
495
|
+
e.UNDEFINED = "undefined", e.WORKSPACE = "workspace", e.FRAME = "frame", e.GROUP = "group", e.ELEMENT = "element", e.RECTANGLE = "rectangle", e.OVAL = "oval";
|
|
496
|
+
})(M || (M = {}));
|
|
497
|
+
M.WORKSPACE, M.FRAME, M.GROUP;
|
|
498
|
+
const qe = (e) => /* @__PURE__ */ E.createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ E.createElement("rect", { x: 4.5, y: 4.5, width: 15, height: 15, stroke: "currentColor", strokeLinecap: "square", strokeDasharray: "3 3" })), Je = (e) => /* @__PURE__ */ E.createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ E.createElement("rect", { x: 4.5, y: 4.5, width: 15, height: 15, stroke: "currentColor", strokeLinecap: "square" })), Qe = (e) => /* @__PURE__ */ E.createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ E.createElement("path", { d: "M11.81 6.5C8.31 6.5 5.26 8.87 4 12C5.26 15.13 8.31 17.5 11.81 17.5C15.31 17.5 18.36 15.13 19.62 12C18.36 8.87 15.31 6.5 11.81 6.5Z", stroke: "currentColor", strokeWidth: 1.5 }), /* @__PURE__ */ E.createElement("path", { d: "M11.81 14.5C13.1907 14.5 14.31 13.3807 14.31 12C14.31 10.6193 13.1907 9.5 11.81 9.5C10.4293 9.5 9.31 10.6193 9.31 12C9.31 13.3807 10.4293 14.5 11.81 14.5Z", stroke: "currentColor", strokeWidth: 1.5 })), Ke = (e) => /* @__PURE__ */ E.createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ E.createElement("path", { d: "M4.81 7.5L18.81 16.5", stroke: "currentColor", strokeWidth: 1.5 }), /* @__PURE__ */ E.createElement("path", { d: "M11.81 6.5C8.31 6.5 5.26 8.87 4 12C5.26 15.13 8.31 17.5 11.81 17.5C15.31 17.5 18.36 15.13 19.62 12C18.36 8.87 15.31 6.5 11.81 6.5Z", stroke: "currentColor", strokeWidth: 1.5 }), /* @__PURE__ */ E.createElement("path", { d: "M11.81 14.5C13.1907 14.5 14.31 13.3807 14.31 12C14.31 10.6193 13.1907 9.5 11.81 9.5C10.4293 9.5 9.31 10.6193 9.31 12C9.31 13.3807 10.4293 14.5 11.81 14.5Z", stroke: "currentColor", strokeWidth: 1.5 })), et = (e) => /* @__PURE__ */ E.createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ E.createElement("path", { d: "M17 10.5H7C6.44772 10.5 6 10.9477 6 11.5V17.5C6 18.0523 6.44772 18.5 7 18.5H17C17.5523 18.5 18 18.0523 18 17.5V11.5C18 10.9477 17.5523 10.5 17 10.5Z", stroke: "currentColor", strokeWidth: 1.5 }), /* @__PURE__ */ E.createElement("path", { d: "M9 10.5V7.5C9 6.395 9.895 5.5 11 5.5H13C14.105 5.5 15 6.395 15 7.5V10.5", stroke: "currentColor", strokeWidth: 1.5 })), tt = (e) => /* @__PURE__ */ E.createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ E.createElement("path", { d: "M17 10.5H7C6.44772 10.5 6 10.9477 6 11.5V17.5C6 18.0523 6.44772 18.5 7 18.5H17C17.5523 18.5 18 18.0523 18 17.5V11.5C18 10.9477 17.5523 10.5 17 10.5Z", stroke: "currentColor", strokeWidth: 1.5 }), /* @__PURE__ */ E.createElement("path", { d: "M9 10.5V7.5C9 6.395 9.895 5.5 11 5.5H13C14.105 5.5 15 6.395 15 7.5V8.5", stroke: "currentColor", strokeWidth: 1.5 })), rt = (e) => /* @__PURE__ */ E.createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ E.createElement("path", { d: "M11 19L5 5L19 11L15 13L19 17L17 19L13 15L11 19Z", stroke: "currentColor", strokeWidth: 1.5 })), nt = {
|
|
499
|
+
Group: qe,
|
|
500
|
+
Rectangle: Je,
|
|
501
|
+
Visible: Qe,
|
|
502
|
+
Invisible: Ke,
|
|
503
|
+
Lock: et,
|
|
504
|
+
Unlock: tt,
|
|
505
|
+
Select: rt
|
|
506
|
+
}, ot = {
|
|
507
|
+
lg: "text-4xl",
|
|
508
|
+
md: "text-2xl",
|
|
509
|
+
sm: "text-xl"
|
|
510
|
+
}, lt = ({
|
|
511
|
+
name: e,
|
|
512
|
+
size: r = X.MD,
|
|
513
|
+
showCursor: n = !0,
|
|
514
|
+
className: s
|
|
515
|
+
}) => {
|
|
516
|
+
const a = nt[e];
|
|
517
|
+
return /* @__PURE__ */ f.jsx(
|
|
518
|
+
"span",
|
|
519
|
+
{
|
|
520
|
+
className: `inline-flex items-center justify-center ${n ? "cursor-pointer" : ""} ${ot[r]} ${s || ""}`,
|
|
521
|
+
children: a ? /* @__PURE__ */ f.jsx(a, {}) : /* @__PURE__ */ f.jsx("span", { children: e })
|
|
522
|
+
}
|
|
523
|
+
);
|
|
524
|
+
}, st = {
|
|
525
|
+
primary: "bg-primary text-white hover:bg-primary-70",
|
|
526
|
+
secondary: "bg-secondary text-white hover:bg-secondary-70",
|
|
527
|
+
accent: "bg-accent text-white hover:bg-accent-70",
|
|
528
|
+
warning: "bg-warning text-white hover:bg-warning-70"
|
|
529
|
+
}, at = {
|
|
530
|
+
sm: "px-2 py-1 text-sm",
|
|
531
|
+
md: "px-4 py-2 text-md",
|
|
532
|
+
lg: "px-6 py-3 text-lg"
|
|
533
|
+
}, Et = ({
|
|
534
|
+
variant: e = "primary",
|
|
535
|
+
size: r = "md",
|
|
536
|
+
disabled: n = !1,
|
|
537
|
+
label: s,
|
|
538
|
+
onClick: a
|
|
539
|
+
}) => /* @__PURE__ */ f.jsx(
|
|
540
|
+
"button",
|
|
541
|
+
{
|
|
542
|
+
className: `font-sans rounded-md shadow-subtle transition-colors duration-200
|
|
543
|
+
${st[e]} ${at[r]}
|
|
544
|
+
${n ? "opacity-50 cursor-not-allowed" : "hover:shadow-md"}`,
|
|
545
|
+
onClick: a,
|
|
546
|
+
disabled: n,
|
|
547
|
+
children: s
|
|
548
|
+
}
|
|
549
|
+
), ct = {
|
|
550
|
+
small: "h-4 text-sm",
|
|
551
|
+
medium: "h-6 text-base",
|
|
552
|
+
large: "h-8 text-lg"
|
|
553
|
+
}, ut = ({
|
|
554
|
+
value: e,
|
|
555
|
+
placeholder: r = "Enter text...",
|
|
556
|
+
disabled: n = !1,
|
|
557
|
+
prefix: s,
|
|
558
|
+
suffix: a,
|
|
559
|
+
size: i = "medium",
|
|
560
|
+
onChange: l,
|
|
561
|
+
...N
|
|
562
|
+
}) => {
|
|
563
|
+
const h = We(null), [p, C] = Fe((e == null ? void 0 : e.toString()) ?? ""), D = Y(
|
|
564
|
+
(L) => {
|
|
565
|
+
if (!h.current)
|
|
566
|
+
return;
|
|
567
|
+
const O = h.current;
|
|
568
|
+
L.code === "Enter" && O.blur();
|
|
569
|
+
},
|
|
570
|
+
[h.current]
|
|
571
|
+
), A = Y(
|
|
572
|
+
(L) => {
|
|
573
|
+
const O = L.target.value;
|
|
574
|
+
C(O);
|
|
575
|
+
},
|
|
576
|
+
[C]
|
|
577
|
+
), U = Y(() => {
|
|
578
|
+
l(p);
|
|
579
|
+
}, [p, l]);
|
|
580
|
+
return $e(() => {
|
|
581
|
+
C((e == null ? void 0 : e.toString()) ?? "");
|
|
582
|
+
}, [e]), /* @__PURE__ */ f.jsxs(
|
|
583
|
+
"div",
|
|
584
|
+
{
|
|
585
|
+
className: `group flex items-center transition-colors rounded focus-within:ring-1 focus-within:ring-inset focus-within:ring-blue-400
|
|
586
|
+
bg-transparent text-white ${ct[i]} ${n ? "opacity-50 cursor-not-allowed" : ""}`,
|
|
587
|
+
children: [
|
|
588
|
+
s && /* @__PURE__ */ f.jsx("div", { className: "w-6 text-center", children: /* @__PURE__ */ f.jsx(ue, { label: s, classNames: "text-gray-400" }) }),
|
|
589
|
+
/* @__PURE__ */ f.jsx(
|
|
590
|
+
"input",
|
|
591
|
+
{
|
|
592
|
+
type: "text",
|
|
593
|
+
ref: h,
|
|
594
|
+
value: p,
|
|
595
|
+
onKeyDown: D,
|
|
596
|
+
onChange: A,
|
|
597
|
+
onBlur: U,
|
|
598
|
+
placeholder: r,
|
|
599
|
+
disabled: n,
|
|
600
|
+
...N,
|
|
601
|
+
className: "bg-transparent w-full px-1 outline-none placeholder-gray-500"
|
|
602
|
+
}
|
|
603
|
+
),
|
|
604
|
+
a && /* @__PURE__ */ f.jsx("div", { className: "w-6 text-center", children: /* @__PURE__ */ f.jsx(ue, { label: a, classNames: "text-gray-400" }) })
|
|
605
|
+
]
|
|
606
|
+
}
|
|
607
|
+
);
|
|
608
|
+
};
|
|
609
|
+
export {
|
|
610
|
+
Et as Button,
|
|
611
|
+
lt as Icon,
|
|
612
|
+
ut as Input,
|
|
613
|
+
ue as Text
|
|
614
|
+
};
|
|
615
|
+
//# sourceMappingURL=index.es.js.map
|