@openorgus/react 0.0.1
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/components/Button.d.ts +10 -0
- package/dist/index.d.ts +2 -0
- package/dist/opengrid-react.es.js +420 -0
- package/dist/opengrid-react.umd.js +56 -0
- package/dist/types.d.ts +88 -0
- package/dist/utils/styleUtils.d.ts +17 -0
- package/package.json +40 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ComponentProps, DesignSystem, GlobalConfig, GranularStyles } from '../types';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
interface ButtonProps {
|
|
4
|
+
designSystem: DesignSystem;
|
|
5
|
+
componentProps: ComponentProps;
|
|
6
|
+
globalConfig: GlobalConfig;
|
|
7
|
+
granularStyles: GranularStyles;
|
|
8
|
+
}
|
|
9
|
+
export declare const Button: React.FC<ButtonProps>;
|
|
10
|
+
export {};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,420 @@
|
|
|
1
|
+
import oe, { forwardRef as B, createElement as C } from "react";
|
|
2
|
+
var P = { exports: {} }, g = {};
|
|
3
|
+
/**
|
|
4
|
+
* @license React
|
|
5
|
+
* react-jsx-runtime.production.js
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the MIT license found in the
|
|
10
|
+
* LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/
|
|
12
|
+
var D;
|
|
13
|
+
function ne() {
|
|
14
|
+
if (D) return g;
|
|
15
|
+
D = 1;
|
|
16
|
+
var r = Symbol.for("react.transitional.element"), n = Symbol.for("react.fragment");
|
|
17
|
+
function l(c, i, d) {
|
|
18
|
+
var b = null;
|
|
19
|
+
if (d !== void 0 && (b = "" + d), i.key !== void 0 && (b = "" + i.key), "key" in i) {
|
|
20
|
+
d = {};
|
|
21
|
+
for (var p in i)
|
|
22
|
+
p !== "key" && (d[p] = i[p]);
|
|
23
|
+
} else d = i;
|
|
24
|
+
return i = d.ref, {
|
|
25
|
+
$$typeof: r,
|
|
26
|
+
type: c,
|
|
27
|
+
key: b,
|
|
28
|
+
ref: i !== void 0 ? i : null,
|
|
29
|
+
props: d
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
return g.Fragment = n, g.jsx = l, g.jsxs = l, g;
|
|
33
|
+
}
|
|
34
|
+
var E = {};
|
|
35
|
+
/**
|
|
36
|
+
* @license React
|
|
37
|
+
* react-jsx-runtime.development.js
|
|
38
|
+
*
|
|
39
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
40
|
+
*
|
|
41
|
+
* This source code is licensed under the MIT license found in the
|
|
42
|
+
* LICENSE file in the root directory of this source tree.
|
|
43
|
+
*/
|
|
44
|
+
var F;
|
|
45
|
+
function ie() {
|
|
46
|
+
return F || (F = 1, process.env.NODE_ENV !== "production" && function() {
|
|
47
|
+
function r(e) {
|
|
48
|
+
if (e == null) return null;
|
|
49
|
+
if (typeof e == "function")
|
|
50
|
+
return e.$$typeof === ee ? null : e.displayName || e.name || null;
|
|
51
|
+
if (typeof e == "string") return e;
|
|
52
|
+
switch (e) {
|
|
53
|
+
case $:
|
|
54
|
+
return "Fragment";
|
|
55
|
+
case X:
|
|
56
|
+
return "Profiler";
|
|
57
|
+
case V:
|
|
58
|
+
return "StrictMode";
|
|
59
|
+
case H:
|
|
60
|
+
return "Suspense";
|
|
61
|
+
case Z:
|
|
62
|
+
return "SuspenseList";
|
|
63
|
+
case K:
|
|
64
|
+
return "Activity";
|
|
65
|
+
}
|
|
66
|
+
if (typeof e == "object")
|
|
67
|
+
switch (typeof e.tag == "number" && console.error(
|
|
68
|
+
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
69
|
+
), e.$$typeof) {
|
|
70
|
+
case S:
|
|
71
|
+
return "Portal";
|
|
72
|
+
case q:
|
|
73
|
+
return e.displayName || "Context";
|
|
74
|
+
case G:
|
|
75
|
+
return (e._context.displayName || "Context") + ".Consumer";
|
|
76
|
+
case J:
|
|
77
|
+
var o = e.render;
|
|
78
|
+
return e = e.displayName, e || (e = o.displayName || o.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
79
|
+
case Q:
|
|
80
|
+
return o = e.displayName || null, o !== null ? o : r(e.type) || "Memo";
|
|
81
|
+
case k:
|
|
82
|
+
o = e._payload, e = e._init;
|
|
83
|
+
try {
|
|
84
|
+
return r(e(o));
|
|
85
|
+
} catch {
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
function n(e) {
|
|
91
|
+
return "" + e;
|
|
92
|
+
}
|
|
93
|
+
function l(e) {
|
|
94
|
+
try {
|
|
95
|
+
n(e);
|
|
96
|
+
var o = !1;
|
|
97
|
+
} catch {
|
|
98
|
+
o = !0;
|
|
99
|
+
}
|
|
100
|
+
if (o) {
|
|
101
|
+
o = console;
|
|
102
|
+
var s = o.error, u = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
103
|
+
return s.call(
|
|
104
|
+
o,
|
|
105
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
106
|
+
u
|
|
107
|
+
), n(e);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
function c(e) {
|
|
111
|
+
if (e === $) return "<>";
|
|
112
|
+
if (typeof e == "object" && e !== null && e.$$typeof === k)
|
|
113
|
+
return "<...>";
|
|
114
|
+
try {
|
|
115
|
+
var o = r(e);
|
|
116
|
+
return o ? "<" + o + ">" : "<...>";
|
|
117
|
+
} catch {
|
|
118
|
+
return "<...>";
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
function i() {
|
|
122
|
+
var e = w.A;
|
|
123
|
+
return e === null ? null : e.getOwner();
|
|
124
|
+
}
|
|
125
|
+
function d() {
|
|
126
|
+
return Error("react-stack-top-frame");
|
|
127
|
+
}
|
|
128
|
+
function b(e) {
|
|
129
|
+
if (W.call(e, "key")) {
|
|
130
|
+
var o = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
131
|
+
if (o && o.isReactWarning) return !1;
|
|
132
|
+
}
|
|
133
|
+
return e.key !== void 0;
|
|
134
|
+
}
|
|
135
|
+
function p(e, o) {
|
|
136
|
+
function s() {
|
|
137
|
+
y || (y = !0, console.error(
|
|
138
|
+
"%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)",
|
|
139
|
+
o
|
|
140
|
+
));
|
|
141
|
+
}
|
|
142
|
+
s.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
143
|
+
get: s,
|
|
144
|
+
configurable: !0
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
function v() {
|
|
148
|
+
var e = r(this.type);
|
|
149
|
+
return L[e] || (L[e] = !0, console.error(
|
|
150
|
+
"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."
|
|
151
|
+
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
152
|
+
}
|
|
153
|
+
function x(e, o, s, u, _, A) {
|
|
154
|
+
var f = s.ref;
|
|
155
|
+
return e = {
|
|
156
|
+
$$typeof: N,
|
|
157
|
+
type: e,
|
|
158
|
+
key: o,
|
|
159
|
+
props: s,
|
|
160
|
+
_owner: u
|
|
161
|
+
}, (f !== void 0 ? f : null) !== null ? Object.defineProperty(e, "ref", {
|
|
162
|
+
enumerable: !1,
|
|
163
|
+
get: v
|
|
164
|
+
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
165
|
+
configurable: !1,
|
|
166
|
+
enumerable: !1,
|
|
167
|
+
writable: !0,
|
|
168
|
+
value: 0
|
|
169
|
+
}), Object.defineProperty(e, "_debugInfo", {
|
|
170
|
+
configurable: !1,
|
|
171
|
+
enumerable: !1,
|
|
172
|
+
writable: !0,
|
|
173
|
+
value: null
|
|
174
|
+
}), Object.defineProperty(e, "_debugStack", {
|
|
175
|
+
configurable: !1,
|
|
176
|
+
enumerable: !1,
|
|
177
|
+
writable: !0,
|
|
178
|
+
value: _
|
|
179
|
+
}), Object.defineProperty(e, "_debugTask", {
|
|
180
|
+
configurable: !1,
|
|
181
|
+
enumerable: !1,
|
|
182
|
+
writable: !0,
|
|
183
|
+
value: A
|
|
184
|
+
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
185
|
+
}
|
|
186
|
+
function m(e, o, s, u, _, A) {
|
|
187
|
+
var f = o.children;
|
|
188
|
+
if (f !== void 0)
|
|
189
|
+
if (u)
|
|
190
|
+
if (re(f)) {
|
|
191
|
+
for (u = 0; u < f.length; u++)
|
|
192
|
+
R(f[u]);
|
|
193
|
+
Object.freeze && Object.freeze(f);
|
|
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 R(f);
|
|
199
|
+
if (W.call(o, "key")) {
|
|
200
|
+
f = r(e);
|
|
201
|
+
var h = Object.keys(o).filter(function(te) {
|
|
202
|
+
return te !== "key";
|
|
203
|
+
});
|
|
204
|
+
u = 0 < h.length ? "{key: someKey, " + h.join(": ..., ") + ": ...}" : "{key: someKey}", M[f + u] || (h = 0 < h.length ? "{" + h.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
|
+
f,
|
|
213
|
+
h,
|
|
214
|
+
f
|
|
215
|
+
), M[f + u] = !0);
|
|
216
|
+
}
|
|
217
|
+
if (f = null, s !== void 0 && (l(s), f = "" + s), b(o) && (l(o.key), f = "" + o.key), "key" in o) {
|
|
218
|
+
s = {};
|
|
219
|
+
for (var O in o)
|
|
220
|
+
O !== "key" && (s[O] = o[O]);
|
|
221
|
+
} else s = o;
|
|
222
|
+
return f && p(
|
|
223
|
+
s,
|
|
224
|
+
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
225
|
+
), x(
|
|
226
|
+
e,
|
|
227
|
+
f,
|
|
228
|
+
s,
|
|
229
|
+
i(),
|
|
230
|
+
_,
|
|
231
|
+
A
|
|
232
|
+
);
|
|
233
|
+
}
|
|
234
|
+
function R(e) {
|
|
235
|
+
t(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === k && (e._payload.status === "fulfilled" ? t(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
236
|
+
}
|
|
237
|
+
function t(e) {
|
|
238
|
+
return typeof e == "object" && e !== null && e.$$typeof === N;
|
|
239
|
+
}
|
|
240
|
+
var a = oe, N = Symbol.for("react.transitional.element"), S = Symbol.for("react.portal"), $ = Symbol.for("react.fragment"), V = Symbol.for("react.strict_mode"), X = Symbol.for("react.profiler"), G = Symbol.for("react.consumer"), q = Symbol.for("react.context"), J = Symbol.for("react.forward_ref"), H = Symbol.for("react.suspense"), Z = Symbol.for("react.suspense_list"), Q = Symbol.for("react.memo"), k = Symbol.for("react.lazy"), K = Symbol.for("react.activity"), ee = Symbol.for("react.client.reference"), w = a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, W = Object.prototype.hasOwnProperty, re = Array.isArray, T = console.createTask ? console.createTask : function() {
|
|
241
|
+
return null;
|
|
242
|
+
};
|
|
243
|
+
a = {
|
|
244
|
+
react_stack_bottom_frame: function(e) {
|
|
245
|
+
return e();
|
|
246
|
+
}
|
|
247
|
+
};
|
|
248
|
+
var y, L = {}, Y = a.react_stack_bottom_frame.bind(
|
|
249
|
+
a,
|
|
250
|
+
d
|
|
251
|
+
)(), I = T(c(d)), M = {};
|
|
252
|
+
E.Fragment = $, E.jsx = function(e, o, s) {
|
|
253
|
+
var u = 1e4 > w.recentlyCreatedOwnerStacks++;
|
|
254
|
+
return m(
|
|
255
|
+
e,
|
|
256
|
+
o,
|
|
257
|
+
s,
|
|
258
|
+
!1,
|
|
259
|
+
u ? Error("react-stack-top-frame") : Y,
|
|
260
|
+
u ? T(c(e)) : I
|
|
261
|
+
);
|
|
262
|
+
}, E.jsxs = function(e, o, s) {
|
|
263
|
+
var u = 1e4 > w.recentlyCreatedOwnerStacks++;
|
|
264
|
+
return m(
|
|
265
|
+
e,
|
|
266
|
+
o,
|
|
267
|
+
s,
|
|
268
|
+
!0,
|
|
269
|
+
u ? Error("react-stack-top-frame") : Y,
|
|
270
|
+
u ? T(c(e)) : I
|
|
271
|
+
);
|
|
272
|
+
};
|
|
273
|
+
}()), E;
|
|
274
|
+
}
|
|
275
|
+
process.env.NODE_ENV === "production" ? P.exports = ne() : P.exports = ie();
|
|
276
|
+
var j = P.exports;
|
|
277
|
+
/**
|
|
278
|
+
* @license lucide-react v0.469.0 - ISC
|
|
279
|
+
*
|
|
280
|
+
* This source code is licensed under the ISC license.
|
|
281
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
282
|
+
*/
|
|
283
|
+
const ae = (r) => r.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), z = (...r) => r.filter((n, l, c) => !!n && n.trim() !== "" && c.indexOf(n) === l).join(" ").trim();
|
|
284
|
+
/**
|
|
285
|
+
* @license lucide-react v0.469.0 - ISC
|
|
286
|
+
*
|
|
287
|
+
* This source code is licensed under the ISC license.
|
|
288
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
289
|
+
*/
|
|
290
|
+
var se = {
|
|
291
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
292
|
+
width: 24,
|
|
293
|
+
height: 24,
|
|
294
|
+
viewBox: "0 0 24 24",
|
|
295
|
+
fill: "none",
|
|
296
|
+
stroke: "currentColor",
|
|
297
|
+
strokeWidth: 2,
|
|
298
|
+
strokeLinecap: "round",
|
|
299
|
+
strokeLinejoin: "round"
|
|
300
|
+
};
|
|
301
|
+
/**
|
|
302
|
+
* @license lucide-react v0.469.0 - ISC
|
|
303
|
+
*
|
|
304
|
+
* This source code is licensed under the ISC license.
|
|
305
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
306
|
+
*/
|
|
307
|
+
const de = B(
|
|
308
|
+
({
|
|
309
|
+
color: r = "currentColor",
|
|
310
|
+
size: n = 24,
|
|
311
|
+
strokeWidth: l = 2,
|
|
312
|
+
absoluteStrokeWidth: c,
|
|
313
|
+
className: i = "",
|
|
314
|
+
children: d,
|
|
315
|
+
iconNode: b,
|
|
316
|
+
...p
|
|
317
|
+
}, v) => C(
|
|
318
|
+
"svg",
|
|
319
|
+
{
|
|
320
|
+
ref: v,
|
|
321
|
+
...se,
|
|
322
|
+
width: n,
|
|
323
|
+
height: n,
|
|
324
|
+
stroke: r,
|
|
325
|
+
strokeWidth: c ? Number(l) * 24 / Number(n) : l,
|
|
326
|
+
className: z("lucide", i),
|
|
327
|
+
...p
|
|
328
|
+
},
|
|
329
|
+
[
|
|
330
|
+
...b.map(([x, m]) => C(x, m)),
|
|
331
|
+
...Array.isArray(d) ? d : [d]
|
|
332
|
+
]
|
|
333
|
+
)
|
|
334
|
+
);
|
|
335
|
+
/**
|
|
336
|
+
* @license lucide-react v0.469.0 - ISC
|
|
337
|
+
*
|
|
338
|
+
* This source code is licensed under the ISC license.
|
|
339
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
340
|
+
*/
|
|
341
|
+
const U = (r, n) => {
|
|
342
|
+
const l = B(
|
|
343
|
+
({ className: c, ...i }, d) => C(de, {
|
|
344
|
+
ref: d,
|
|
345
|
+
iconNode: n,
|
|
346
|
+
className: z(`lucide-${ae(r)}`, c),
|
|
347
|
+
...i
|
|
348
|
+
})
|
|
349
|
+
);
|
|
350
|
+
return l.displayName = `${r}`, l;
|
|
351
|
+
};
|
|
352
|
+
/**
|
|
353
|
+
* @license lucide-react v0.469.0 - ISC
|
|
354
|
+
*
|
|
355
|
+
* This source code is licensed under the ISC license.
|
|
356
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
357
|
+
*/
|
|
358
|
+
const ce = U("LoaderCircle", [
|
|
359
|
+
["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]
|
|
360
|
+
]);
|
|
361
|
+
/**
|
|
362
|
+
* @license lucide-react v0.469.0 - ISC
|
|
363
|
+
*
|
|
364
|
+
* This source code is licensed under the ISC license.
|
|
365
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
366
|
+
*/
|
|
367
|
+
const ue = U("MousePointer2", [
|
|
368
|
+
[
|
|
369
|
+
"path",
|
|
370
|
+
{
|
|
371
|
+
d: "M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z",
|
|
372
|
+
key: "edeuup"
|
|
373
|
+
}
|
|
374
|
+
]
|
|
375
|
+
]), fe = (r, n, l, c = "button") => {
|
|
376
|
+
const { variant: i, isHovered: d, isFocused: b, isActive: p, isTouched: v, isError: x, isDisabled: m } = n, { primaryColor: R } = l, t = R;
|
|
377
|
+
let a = "";
|
|
378
|
+
return d && (a += " brightness-95 transform -translate-y-0.5 shadow-md "), b && (a += ` ring-2 ring-offset-2 ring-${t}-500 dark:ring-${t}-400 z-10 `), p && (a += " transform scale-95 brightness-90 shadow-inner "), v && (a += " opacity-70 "), m && (a += " opacity-50 cursor-not-allowed grayscale pointer-events-none "), i === "primary" ? ((c === "button" || c === "surface") && (a += ` bg-${t}-600 text-white border border-transparent shadow-sm`, r === "MUI" && (a += " shadow-md hover:shadow-lg uppercase tracking-wider font-medium"), r === "Apple" && (a += " shadow-sm bg-gradient-to-b from-blue-500 to-blue-600 border-blue-400")), c === "input" && (a += ` bg-gray-100 dark:bg-gray-800 border-b-2 border-${t}-600 rounded-t-md px-4 py-2`)) : i === "secondary" ? c === "button" && (a += ` bg-white dark:bg-gray-800 text-${t}-700 dark:text-${t}-300 border border-gray-200 dark:border-gray-700`, r === "MUI" && (a += ` border-2 border-${t}-600 text-${t}-600 font-medium uppercase`)) : i === "tertiary" ? a += " text-gray-600 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800" : i === "outline" ? a += ` bg-transparent border-2 border-${t}-500 text-${t}-600 dark:text-${t}-400` : i === "ghost" ? a += ` bg-transparent text-${t}-600 dark:text-${t}-400 hover:bg-${t}-50 dark:hover:bg-${t}-900/20` : i === "soft" ? a += ` bg-${t}-100 dark:bg-${t}-900/40 text-${t}-800 dark:text-${t}-200 border border-${t}-200 dark:border-${t}-800` : i === "link" ? a += ` bg-transparent text-${t}-600 dark:text-${t}-400 underline underline-offset-4 hover:text-${t}-800 p-0 shadow-none border-none h-auto` : i === "danger" ? a += ` bg-${t}-700 text-white hover:bg-${t}-800 border border-${t}-700` : i === "success" ? a += ` bg-${t}-600 text-white hover:bg-${t}-700 border border-${t}-600` : i === "warning" && (a += ` bg-${t}-500 text-white hover:bg-${t}-600 border border-${t}-500`), x && (c === "input" ? a += ` border-${t}-600 focus:ring-${t}-500 text-${t}-900 dark:text-${t}-100` : a += ` ring-2 ring-${t}-500 ring-offset-1`), a;
|
|
379
|
+
}, le = (r, n) => r.borderRadius && r.borderRadius !== n.baseRadius ? `${r.borderRadius}px` : `${n.baseRadius}px`, be = (r, n) => ({
|
|
380
|
+
width: r.width === "auto" ? void 0 : r.width,
|
|
381
|
+
height: r.height === "auto" ? void 0 : r.height,
|
|
382
|
+
paddingTop: r.paddingY ? `${r.paddingY}px` : void 0,
|
|
383
|
+
paddingBottom: r.paddingY ? `${r.paddingY}px` : void 0,
|
|
384
|
+
paddingLeft: r.paddingX ? `${r.paddingX}px` : void 0,
|
|
385
|
+
paddingRight: r.paddingX ? `${r.paddingX}px` : void 0,
|
|
386
|
+
marginTop: r.marginTop ? `${r.marginTop}px` : void 0,
|
|
387
|
+
marginBottom: r.marginBottom ? `${r.marginBottom}px` : void 0,
|
|
388
|
+
borderTopWidth: r.borderTopWidth ? `${r.borderTopWidth}px` : void 0,
|
|
389
|
+
borderRightWidth: r.borderRightWidth ? `${r.borderRightWidth}px` : void 0,
|
|
390
|
+
borderBottomWidth: r.borderBottomWidth ? `${r.borderBottomWidth}px` : void 0,
|
|
391
|
+
borderLeftWidth: r.borderLeftWidth ? `${r.borderLeftWidth}px` : void 0,
|
|
392
|
+
borderColor: r.borderColor !== "transparent" ? r.borderColor : void 0,
|
|
393
|
+
borderRadius: le(r, n),
|
|
394
|
+
opacity: r.opacity / 100,
|
|
395
|
+
boxShadow: r.boxShadow !== "none" ? r.boxShadow : void 0,
|
|
396
|
+
animation: r.animation !== "none" ? r.animation : void 0,
|
|
397
|
+
fontWeight: r.fontWeight !== "normal" ? r.fontWeight : void 0,
|
|
398
|
+
letterSpacing: r.letterSpacing !== "normal" ? r.letterSpacing : void 0
|
|
399
|
+
}), me = ({ designSystem: r, componentProps: n, globalConfig: l, granularStyles: c }) => {
|
|
400
|
+
const i = be(c, l), d = fe(r, n, l, "button");
|
|
401
|
+
return /* @__PURE__ */ j.jsxs(
|
|
402
|
+
"button",
|
|
403
|
+
{
|
|
404
|
+
style: i,
|
|
405
|
+
disabled: n.isDisabled || n.isLoading,
|
|
406
|
+
className: `
|
|
407
|
+
flex items-center gap-2 transition-all duration-200 font-medium select-none
|
|
408
|
+
${n.size === "SM" ? "px-4 py-2 text-xs" : n.size === "LG" ? "px-8 py-4 text-lg" : "px-6 py-2 text-sm"}
|
|
409
|
+
${d}
|
|
410
|
+
`,
|
|
411
|
+
children: [
|
|
412
|
+
n.isLoading ? /* @__PURE__ */ j.jsx(ce, { className: "animate-spin", size: 16 }) : /* @__PURE__ */ j.jsx(ue, { size: 16 }),
|
|
413
|
+
n.text || "Button"
|
|
414
|
+
]
|
|
415
|
+
}
|
|
416
|
+
);
|
|
417
|
+
};
|
|
418
|
+
export {
|
|
419
|
+
me as Button
|
|
420
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
(function(h,b){typeof exports=="object"&&typeof module<"u"?b(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],b):(h=typeof globalThis<"u"?globalThis:h||self,b(h.OpenGridReact={},h.React))})(this,function(h,b){"use strict";var T={exports:{}},g={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var y;function S(){if(y)return g;y=1;var r=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function l(c,i,d){var p=null;if(d!==void 0&&(p=""+d),i.key!==void 0&&(p=""+i.key),"key"in i){d={};for(var m in i)m!=="key"&&(d[m]=i[m])}else d=i;return i=d.ref,{$$typeof:r,type:c,key:p,ref:i!==void 0?i:null,props:d}}return g.Fragment=n,g.jsx=l,g.jsxs=l,g}var E={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.development.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var W;function V(){return W||(W=1,process.env.NODE_ENV!=="production"&&function(){function r(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===fe?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case A:return"Fragment";case oe:return"Profiler";case te:return"StrictMode";case se:return"Suspense";case de:return"SuspenseList";case ue:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case re:return"Portal";case ie:return e.displayName||"Context";case ne:return(e._context.displayName||"Context")+".Consumer";case ae:var o=e.render;return e=e.displayName,e||(e=o.displayName||o.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ce:return o=e.displayName||null,o!==null?o:r(e.type)||"Memo";case O:o=e._payload,e=e._init;try{return r(e(o))}catch{}}return null}function n(e){return""+e}function l(e){try{n(e);var o=!1}catch{o=!0}if(o){o=console;var s=o.error,u=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return s.call(o,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",u),n(e)}}function c(e){if(e===A)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===O)return"<...>";try{var o=r(e);return o?"<"+o+">":"<...>"}catch{return"<...>"}}function i(){var e=j.A;return e===null?null:e.getOwner()}function d(){return Error("react-stack-top-frame")}function p(e){if(M.call(e,"key")){var o=Object.getOwnPropertyDescriptor(e,"key").get;if(o&&o.isReactWarning)return!1}return e.key!==void 0}function m(e,o){function s(){B||(B=!0,console.error("%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)",o))}s.isReactWarning=!0,Object.defineProperty(e,"key",{get:s,configurable:!0})}function R(){var e=r(this.type);return D[e]||(D[e]=!0,console.error("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.")),e=this.props.ref,e!==void 0?e:null}function _(e,o,s,u,w,P){var f=s.ref;return e={$$typeof:I,type:e,key:o,props:s,_owner:u},(f!==void 0?f:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:R}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:w}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:P}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function v(e,o,s,u,w,P){var f=o.children;if(f!==void 0)if(u)if(le(f)){for(u=0;u<f.length;u++)k(f[u]);Object.freeze&&Object.freeze(f)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else k(f);if(M.call(o,"key")){f=r(e);var x=Object.keys(o).filter(function(be){return be!=="key"});u=0<x.length?"{key: someKey, "+x.join(": ..., ")+": ...}":"{key: someKey}",U[f+u]||(x=0<x.length?"{"+x.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
|
+
let props = %s;
|
|
19
|
+
<%s {...props} />
|
|
20
|
+
React keys must be passed directly to JSX without using spread:
|
|
21
|
+
let props = %s;
|
|
22
|
+
<%s key={someKey} {...props} />`,u,f,x,f),U[f+u]=!0)}if(f=null,s!==void 0&&(l(s),f=""+s),p(o)&&(l(o.key),f=""+o.key),"key"in o){s={};for(var N in o)N!=="key"&&(s[N]=o[N])}else s=o;return f&&m(s,typeof e=="function"?e.displayName||e.name||"Unknown":e),_(e,f,s,i(),w,P)}function k(e){t(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===O&&(e._payload.status==="fulfilled"?t(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function t(e){return typeof e=="object"&&e!==null&&e.$$typeof===I}var a=b,I=Symbol.for("react.transitional.element"),re=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),te=Symbol.for("react.strict_mode"),oe=Symbol.for("react.profiler"),ne=Symbol.for("react.consumer"),ie=Symbol.for("react.context"),ae=Symbol.for("react.forward_ref"),se=Symbol.for("react.suspense"),de=Symbol.for("react.suspense_list"),ce=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),ue=Symbol.for("react.activity"),fe=Symbol.for("react.client.reference"),j=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,M=Object.prototype.hasOwnProperty,le=Array.isArray,C=console.createTask?console.createTask:function(){return null};a={react_stack_bottom_frame:function(e){return e()}};var B,D={},F=a.react_stack_bottom_frame.bind(a,d)(),z=C(c(d)),U={};E.Fragment=A,E.jsx=function(e,o,s){var u=1e4>j.recentlyCreatedOwnerStacks++;return v(e,o,s,!1,u?Error("react-stack-top-frame"):F,u?C(c(e)):z)},E.jsxs=function(e,o,s){var u=1e4>j.recentlyCreatedOwnerStacks++;return v(e,o,s,!0,u?Error("react-stack-top-frame"):F,u?C(c(e)):z)}}()),E}process.env.NODE_ENV==="production"?T.exports=S():T.exports=V();var $=T.exports;/**
|
|
23
|
+
* @license lucide-react v0.469.0 - ISC
|
|
24
|
+
*
|
|
25
|
+
* This source code is licensed under the ISC license.
|
|
26
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
27
|
+
*/const X=r=>r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),L=(...r)=>r.filter((n,l,c)=>!!n&&n.trim()!==""&&c.indexOf(n)===l).join(" ").trim();/**
|
|
28
|
+
* @license lucide-react v0.469.0 - ISC
|
|
29
|
+
*
|
|
30
|
+
* This source code is licensed under the ISC license.
|
|
31
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
32
|
+
*/var G={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
33
|
+
* @license lucide-react v0.469.0 - ISC
|
|
34
|
+
*
|
|
35
|
+
* This source code is licensed under the ISC license.
|
|
36
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
37
|
+
*/const J=b.forwardRef(({color:r="currentColor",size:n=24,strokeWidth:l=2,absoluteStrokeWidth:c,className:i="",children:d,iconNode:p,...m},R)=>b.createElement("svg",{ref:R,...G,width:n,height:n,stroke:r,strokeWidth:c?Number(l)*24/Number(n):l,className:L("lucide",i),...m},[...p.map(([_,v])=>b.createElement(_,v)),...Array.isArray(d)?d:[d]]));/**
|
|
38
|
+
* @license lucide-react v0.469.0 - ISC
|
|
39
|
+
*
|
|
40
|
+
* This source code is licensed under the ISC license.
|
|
41
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
42
|
+
*/const Y=(r,n)=>{const l=b.forwardRef(({className:c,...i},d)=>b.createElement(J,{ref:d,iconNode:n,className:L(`lucide-${X(r)}`,c),...i}));return l.displayName=`${r}`,l};/**
|
|
43
|
+
* @license lucide-react v0.469.0 - ISC
|
|
44
|
+
*
|
|
45
|
+
* This source code is licensed under the ISC license.
|
|
46
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
47
|
+
*/const H=Y("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
48
|
+
* @license lucide-react v0.469.0 - ISC
|
|
49
|
+
*
|
|
50
|
+
* This source code is licensed under the ISC license.
|
|
51
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
52
|
+
*/const Z=Y("MousePointer2",[["path",{d:"M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z",key:"edeuup"}]]),q=(r,n,l,c="button")=>{const{variant:i,isHovered:d,isFocused:p,isActive:m,isTouched:R,isError:_,isDisabled:v}=n,{primaryColor:k}=l,t=k;let a="";return d&&(a+=" brightness-95 transform -translate-y-0.5 shadow-md "),p&&(a+=` ring-2 ring-offset-2 ring-${t}-500 dark:ring-${t}-400 z-10 `),m&&(a+=" transform scale-95 brightness-90 shadow-inner "),R&&(a+=" opacity-70 "),v&&(a+=" opacity-50 cursor-not-allowed grayscale pointer-events-none "),i==="primary"?((c==="button"||c==="surface")&&(a+=` bg-${t}-600 text-white border border-transparent shadow-sm`,r==="MUI"&&(a+=" shadow-md hover:shadow-lg uppercase tracking-wider font-medium"),r==="Apple"&&(a+=" shadow-sm bg-gradient-to-b from-blue-500 to-blue-600 border-blue-400")),c==="input"&&(a+=` bg-gray-100 dark:bg-gray-800 border-b-2 border-${t}-600 rounded-t-md px-4 py-2`)):i==="secondary"?c==="button"&&(a+=` bg-white dark:bg-gray-800 text-${t}-700 dark:text-${t}-300 border border-gray-200 dark:border-gray-700`,r==="MUI"&&(a+=` border-2 border-${t}-600 text-${t}-600 font-medium uppercase`)):i==="tertiary"?a+=" text-gray-600 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800":i==="outline"?a+=` bg-transparent border-2 border-${t}-500 text-${t}-600 dark:text-${t}-400`:i==="ghost"?a+=` bg-transparent text-${t}-600 dark:text-${t}-400 hover:bg-${t}-50 dark:hover:bg-${t}-900/20`:i==="soft"?a+=` bg-${t}-100 dark:bg-${t}-900/40 text-${t}-800 dark:text-${t}-200 border border-${t}-200 dark:border-${t}-800`:i==="link"?a+=` bg-transparent text-${t}-600 dark:text-${t}-400 underline underline-offset-4 hover:text-${t}-800 p-0 shadow-none border-none h-auto`:i==="danger"?a+=` bg-${t}-700 text-white hover:bg-${t}-800 border border-${t}-700`:i==="success"?a+=` bg-${t}-600 text-white hover:bg-${t}-700 border border-${t}-600`:i==="warning"&&(a+=` bg-${t}-500 text-white hover:bg-${t}-600 border border-${t}-500`),_&&(c==="input"?a+=` border-${t}-600 focus:ring-${t}-500 text-${t}-900 dark:text-${t}-100`:a+=` ring-2 ring-${t}-500 ring-offset-1`),a},Q=(r,n)=>r.borderRadius&&r.borderRadius!==n.baseRadius?`${r.borderRadius}px`:`${n.baseRadius}px`,K=(r,n)=>({width:r.width==="auto"?void 0:r.width,height:r.height==="auto"?void 0:r.height,paddingTop:r.paddingY?`${r.paddingY}px`:void 0,paddingBottom:r.paddingY?`${r.paddingY}px`:void 0,paddingLeft:r.paddingX?`${r.paddingX}px`:void 0,paddingRight:r.paddingX?`${r.paddingX}px`:void 0,marginTop:r.marginTop?`${r.marginTop}px`:void 0,marginBottom:r.marginBottom?`${r.marginBottom}px`:void 0,borderTopWidth:r.borderTopWidth?`${r.borderTopWidth}px`:void 0,borderRightWidth:r.borderRightWidth?`${r.borderRightWidth}px`:void 0,borderBottomWidth:r.borderBottomWidth?`${r.borderBottomWidth}px`:void 0,borderLeftWidth:r.borderLeftWidth?`${r.borderLeftWidth}px`:void 0,borderColor:r.borderColor!=="transparent"?r.borderColor:void 0,borderRadius:Q(r,n),opacity:r.opacity/100,boxShadow:r.boxShadow!=="none"?r.boxShadow:void 0,animation:r.animation!=="none"?r.animation:void 0,fontWeight:r.fontWeight!=="normal"?r.fontWeight:void 0,letterSpacing:r.letterSpacing!=="normal"?r.letterSpacing:void 0}),ee=({designSystem:r,componentProps:n,globalConfig:l,granularStyles:c})=>{const i=K(c,l),d=q(r,n,l,"button");return $.jsxs("button",{style:i,disabled:n.isDisabled||n.isLoading,className:`
|
|
53
|
+
flex items-center gap-2 transition-all duration-200 font-medium select-none
|
|
54
|
+
${n.size==="SM"?"px-4 py-2 text-xs":n.size==="LG"?"px-8 py-4 text-lg":"px-6 py-2 text-sm"}
|
|
55
|
+
${d}
|
|
56
|
+
`,children:[n.isLoading?$.jsx(H,{className:"animate-spin",size:16}):$.jsx(Z,{size:16}),n.text||"Button"]})};h.Button=ee,Object.defineProperty(h,Symbol.toStringTag,{value:"Module"})});
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
export type ComponentStatus = 'Draft' | 'Ready' | 'Deprecated';
|
|
2
|
+
export interface ComponentItem {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
category: string;
|
|
6
|
+
status: ComponentStatus;
|
|
7
|
+
description: string;
|
|
8
|
+
}
|
|
9
|
+
export interface Category {
|
|
10
|
+
id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
items: ComponentItem[];
|
|
13
|
+
}
|
|
14
|
+
export type TabId = 'about' | 'usage' | 'tokens' | 'ada' | 'animations' | 'html' | 'css' | 'tailwind' | 'react' | 'react-native' | 'swift' | 'kotlin';
|
|
15
|
+
export interface TabOption {
|
|
16
|
+
id: TabId;
|
|
17
|
+
label: string;
|
|
18
|
+
}
|
|
19
|
+
export type ViewportId = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';
|
|
20
|
+
export interface ViewportDefinition {
|
|
21
|
+
id: ViewportId;
|
|
22
|
+
label: string;
|
|
23
|
+
width: number;
|
|
24
|
+
icon: string;
|
|
25
|
+
}
|
|
26
|
+
export type DesignSystem = 'Custom' | 'MUI' | 'Apple';
|
|
27
|
+
export interface ComponentProps {
|
|
28
|
+
variant: string;
|
|
29
|
+
size: string;
|
|
30
|
+
orientation: 'horizontal' | 'vertical';
|
|
31
|
+
textAlign: 'left' | 'center' | 'right';
|
|
32
|
+
iconStyle: 'filled' | 'outlined' | 'rounded' | 'sharp' | 'two-tone';
|
|
33
|
+
isDisabled: boolean;
|
|
34
|
+
isLoading: boolean;
|
|
35
|
+
isError: boolean;
|
|
36
|
+
isChecked: boolean;
|
|
37
|
+
isIndeterminate: boolean;
|
|
38
|
+
isHovered: boolean;
|
|
39
|
+
isFocused: boolean;
|
|
40
|
+
isActive: boolean;
|
|
41
|
+
isTouched: boolean;
|
|
42
|
+
text: string;
|
|
43
|
+
}
|
|
44
|
+
export interface GranularStyles {
|
|
45
|
+
width: string;
|
|
46
|
+
height: string;
|
|
47
|
+
paddingX: number;
|
|
48
|
+
paddingY: number;
|
|
49
|
+
marginTop: number;
|
|
50
|
+
marginBottom: number;
|
|
51
|
+
borderTopWidth: number;
|
|
52
|
+
borderRightWidth: number;
|
|
53
|
+
borderBottomWidth: number;
|
|
54
|
+
borderLeftWidth: number;
|
|
55
|
+
borderColor: string;
|
|
56
|
+
borderRadius: number;
|
|
57
|
+
opacity: number;
|
|
58
|
+
boxShadow: string;
|
|
59
|
+
animation: string;
|
|
60
|
+
fontWeight: string;
|
|
61
|
+
letterSpacing: string;
|
|
62
|
+
}
|
|
63
|
+
export interface GlobalConfig {
|
|
64
|
+
primaryColor: string;
|
|
65
|
+
secondaryColor?: string;
|
|
66
|
+
tertiaryColor?: string;
|
|
67
|
+
baseRadius: number;
|
|
68
|
+
activeFont?: string;
|
|
69
|
+
iconSize?: number;
|
|
70
|
+
iconColor?: 'default' | 'primary' | 'secondary' | 'custom';
|
|
71
|
+
iconCustomColor?: string;
|
|
72
|
+
illustrationSize?: number;
|
|
73
|
+
illustrationColor?: 'default' | 'primary' | 'secondary' | 'custom';
|
|
74
|
+
illustrationCustomColor?: string;
|
|
75
|
+
cursorEffect?: string;
|
|
76
|
+
cursorColor?: string;
|
|
77
|
+
cursorSecondaryColor?: string;
|
|
78
|
+
cursorTertiaryColor?: string;
|
|
79
|
+
}
|
|
80
|
+
export interface AnimationConfig {
|
|
81
|
+
type: 'spring' | 'easing' | 'steps';
|
|
82
|
+
preset: string;
|
|
83
|
+
duration: number;
|
|
84
|
+
stiffness: number;
|
|
85
|
+
damping: number;
|
|
86
|
+
mass: number;
|
|
87
|
+
velocity: number;
|
|
88
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { GlobalConfig, GranularStyles, ComponentProps, DesignSystem } from '../types';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
export declare const getRadiusClass: (globalConfig: GlobalConfig) => "rounded-none" | "rounded-sm" | "rounded-md" | "rounded-lg" | "rounded-xl" | "rounded-2xl";
|
|
5
|
+
export declare const getColorClass: (globalConfig: GlobalConfig, type: "bg" | "text" | "border" | "ring", role?: "primary" | "secondary" | "tertiary" | "success" | "danger" | "warning" | "info") => string;
|
|
6
|
+
export declare const getColorShade: (globalConfig: GlobalConfig, type: "bg" | "text" | "border", shade?: 50 | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900, role?: "primary" | "secondary" | "tertiary") => string;
|
|
7
|
+
export declare const getColorValue: (globalConfig: GlobalConfig, role?: "primary" | "secondary" | "tertiary", shade?: number) => string;
|
|
8
|
+
/**
|
|
9
|
+
* Generates the specific tailwind classes for the combination of Variant + State + Design System
|
|
10
|
+
*/
|
|
11
|
+
export declare const getComponentVariantClasses: (designSystem: DesignSystem, componentProps: ComponentProps, globalConfig: GlobalConfig, baseType?: "button" | "input" | "surface") => string;
|
|
12
|
+
export declare const getThemeClasses: (_globalConfig: GlobalConfig, _variant?: "container" | "input" | "panel") => string;
|
|
13
|
+
/**
|
|
14
|
+
* Get border radius value - uses granularStyles if explicitly set, otherwise falls back to globalConfig.baseRadius
|
|
15
|
+
*/
|
|
16
|
+
export declare const getBorderRadius: (granularStyles: GranularStyles, globalConfig: GlobalConfig) => string;
|
|
17
|
+
export declare const getAppliedStyles: (granularStyles: GranularStyles, globalConfig: GlobalConfig) => React.CSSProperties;
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@openorgus/react",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "dist/opengrid-react.umd.js",
|
|
6
|
+
"module": "dist/opengrid-react.es.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist"
|
|
10
|
+
],
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"import": "./dist/opengrid-react.es.js",
|
|
14
|
+
"require": "./dist/opengrid-react.umd.js",
|
|
15
|
+
"types": "./dist/index.d.ts"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"dev": "vite",
|
|
20
|
+
"build": "tsc && vite build",
|
|
21
|
+
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
|
22
|
+
"preview": "vite preview"
|
|
23
|
+
},
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"react": "^19.0.0",
|
|
26
|
+
"react-dom": "^19.0.0"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@types/node": "^20.0.0",
|
|
30
|
+
"@types/react": "^19.0.0",
|
|
31
|
+
"@types/react-dom": "^19.0.0",
|
|
32
|
+
"@vitejs/plugin-react": "^4.0.0",
|
|
33
|
+
"typescript": "^5.0.0",
|
|
34
|
+
"vite": "^5.0.0",
|
|
35
|
+
"vite-plugin-dts": "^3.0.0"
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"lucide-react": "^0.469.0"
|
|
39
|
+
}
|
|
40
|
+
}
|