@fabio.caffarello/react-design-system 1.0.0 → 1.2.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/README.md +1 -0
- package/dist/index.cjs +4 -4
- package/dist/index.js +330 -176
- package/dist/ui/atoms/Badge/Badge.d.ts +18 -0
- package/dist/ui/atoms/Badge/Badge.stories.d.ts +11 -0
- package/dist/ui/atoms/Badge/Badge.test.d.ts +1 -0
- package/dist/ui/atoms/Select/Select.d.ts +30 -0
- package/dist/ui/atoms/Select/Select.stories.d.ts +10 -0
- package/dist/ui/atoms/Select/Select.test.d.ts +1 -0
- package/dist/ui/atoms/Textarea/Textarea.d.ts +21 -0
- package/dist/ui/atoms/Textarea/Textarea.stories.d.ts +9 -0
- package/dist/ui/atoms/Textarea/Textarea.test.d.ts +1 -0
- package/dist/ui/atoms/index.d.ts +3 -0
- package/dist/ui/molecules/Card/Card.d.ts +22 -0
- package/dist/ui/molecules/Card/Card.stories.d.ts +11 -0
- package/dist/ui/molecules/Card/Card.test.d.ts +1 -0
- package/dist/ui/molecules/index.d.ts +1 -0
- package/package.json +9 -1
- package/src/ui/atoms/Badge/Badge.stories.tsx +86 -0
- package/src/ui/atoms/Badge/Badge.test.tsx +63 -0
- package/src/ui/atoms/Badge/Badge.tsx +60 -0
- package/src/ui/atoms/Select/Select.stories.tsx +93 -0
- package/src/ui/atoms/Select/Select.test.tsx +63 -0
- package/src/ui/atoms/Select/Select.tsx +85 -0
- package/src/ui/atoms/Textarea/Textarea.stories.tsx +72 -0
- package/src/ui/atoms/Textarea/Textarea.test.tsx +55 -0
- package/src/ui/atoms/Textarea/Textarea.tsx +67 -0
- package/src/ui/atoms/index.ts +6 -0
- package/src/ui/molecules/Card/Card.stories.tsx +117 -0
- package/src/ui/molecules/Card/Card.test.tsx +58 -0
- package/src/ui/molecules/Card/Card.tsx +63 -0
- package/src/ui/molecules/index.ts +2 -0
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import te from "react";
|
|
2
|
-
var
|
|
2
|
+
var _ = { exports: {} }, p = {};
|
|
3
3
|
/**
|
|
4
4
|
* @license React
|
|
5
5
|
* react-jsx-runtime.production.js
|
|
@@ -10,28 +10,28 @@ var x = { exports: {} }, _ = {};
|
|
|
10
10
|
* LICENSE file in the root directory of this source tree.
|
|
11
11
|
*/
|
|
12
12
|
var F;
|
|
13
|
-
function
|
|
14
|
-
if (F) return
|
|
13
|
+
function ae() {
|
|
14
|
+
if (F) return p;
|
|
15
15
|
F = 1;
|
|
16
|
-
var
|
|
17
|
-
function
|
|
18
|
-
var
|
|
19
|
-
if (
|
|
20
|
-
|
|
21
|
-
for (var
|
|
22
|
-
|
|
23
|
-
} else
|
|
24
|
-
return
|
|
25
|
-
$$typeof:
|
|
26
|
-
type:
|
|
27
|
-
key:
|
|
28
|
-
ref:
|
|
29
|
-
props:
|
|
16
|
+
var t = Symbol.for("react.transitional.element"), o = Symbol.for("react.fragment");
|
|
17
|
+
function a(n, s, i) {
|
|
18
|
+
var b = null;
|
|
19
|
+
if (i !== void 0 && (b = "" + i), s.key !== void 0 && (b = "" + s.key), "key" in s) {
|
|
20
|
+
i = {};
|
|
21
|
+
for (var f in s)
|
|
22
|
+
f !== "key" && (i[f] = s[f]);
|
|
23
|
+
} else i = s;
|
|
24
|
+
return s = i.ref, {
|
|
25
|
+
$$typeof: t,
|
|
26
|
+
type: n,
|
|
27
|
+
key: b,
|
|
28
|
+
ref: s !== void 0 ? s : null,
|
|
29
|
+
props: i
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
return
|
|
32
|
+
return p.Fragment = o, p.jsx = a, p.jsxs = a, p;
|
|
33
33
|
}
|
|
34
|
-
var
|
|
34
|
+
var x = {};
|
|
35
35
|
/**
|
|
36
36
|
* @license React
|
|
37
37
|
* react-jsx-runtime.development.js
|
|
@@ -42,19 +42,19 @@ var E = {};
|
|
|
42
42
|
* LICENSE file in the root directory of this source tree.
|
|
43
43
|
*/
|
|
44
44
|
var D;
|
|
45
|
-
function
|
|
45
|
+
function ne() {
|
|
46
46
|
return D || (D = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
47
|
-
function
|
|
47
|
+
function t(e) {
|
|
48
48
|
if (e == null) return null;
|
|
49
49
|
if (typeof e == "function")
|
|
50
50
|
return e.$$typeof === K ? null : e.displayName || e.name || null;
|
|
51
51
|
if (typeof e == "string") return e;
|
|
52
52
|
switch (e) {
|
|
53
|
-
case
|
|
53
|
+
case E:
|
|
54
54
|
return "Fragment";
|
|
55
|
-
case
|
|
55
|
+
case q:
|
|
56
56
|
return "Profiler";
|
|
57
|
-
case
|
|
57
|
+
case U:
|
|
58
58
|
return "StrictMode";
|
|
59
59
|
case X:
|
|
60
60
|
return "Suspense";
|
|
@@ -67,100 +67,100 @@ function ae() {
|
|
|
67
67
|
switch (typeof e.tag == "number" && console.error(
|
|
68
68
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
69
69
|
), e.$$typeof) {
|
|
70
|
-
case
|
|
70
|
+
case B:
|
|
71
71
|
return "Portal";
|
|
72
|
-
case
|
|
72
|
+
case V:
|
|
73
73
|
return e.displayName || "Context";
|
|
74
|
-
case
|
|
74
|
+
case J:
|
|
75
75
|
return (e._context.displayName || "Context") + ".Consumer";
|
|
76
|
-
case
|
|
76
|
+
case G:
|
|
77
77
|
var r = e.render;
|
|
78
78
|
return e = e.displayName, e || (e = r.displayName || r.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
79
79
|
case Z:
|
|
80
|
-
return r = e.displayName || null, r !== null ? r :
|
|
81
|
-
case
|
|
80
|
+
return r = e.displayName || null, r !== null ? r : t(e.type) || "Memo";
|
|
81
|
+
case R:
|
|
82
82
|
r = e._payload, e = e._init;
|
|
83
83
|
try {
|
|
84
|
-
return
|
|
84
|
+
return t(e(r));
|
|
85
85
|
} catch {
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
return null;
|
|
89
89
|
}
|
|
90
|
-
function
|
|
90
|
+
function o(e) {
|
|
91
91
|
return "" + e;
|
|
92
92
|
}
|
|
93
|
-
function
|
|
93
|
+
function a(e) {
|
|
94
94
|
try {
|
|
95
|
-
|
|
95
|
+
o(e);
|
|
96
96
|
var r = !1;
|
|
97
97
|
} catch {
|
|
98
98
|
r = !0;
|
|
99
99
|
}
|
|
100
100
|
if (r) {
|
|
101
101
|
r = console;
|
|
102
|
-
var
|
|
103
|
-
return
|
|
102
|
+
var l = r.error, c = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
103
|
+
return l.call(
|
|
104
104
|
r,
|
|
105
105
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
106
|
-
|
|
107
|
-
),
|
|
106
|
+
c
|
|
107
|
+
), o(e);
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
-
function
|
|
111
|
-
if (e ===
|
|
112
|
-
if (typeof e == "object" && e !== null && e.$$typeof ===
|
|
110
|
+
function n(e) {
|
|
111
|
+
if (e === E) return "<>";
|
|
112
|
+
if (typeof e == "object" && e !== null && e.$$typeof === R)
|
|
113
113
|
return "<...>";
|
|
114
114
|
try {
|
|
115
|
-
var r =
|
|
115
|
+
var r = t(e);
|
|
116
116
|
return r ? "<" + r + ">" : "<...>";
|
|
117
117
|
} catch {
|
|
118
118
|
return "<...>";
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
-
function
|
|
122
|
-
var e =
|
|
121
|
+
function s() {
|
|
122
|
+
var e = j.A;
|
|
123
123
|
return e === null ? null : e.getOwner();
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function i() {
|
|
126
126
|
return Error("react-stack-top-frame");
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function b(e) {
|
|
129
129
|
if (A.call(e, "key")) {
|
|
130
130
|
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
131
131
|
if (r && r.isReactWarning) return !1;
|
|
132
132
|
}
|
|
133
133
|
return e.key !== void 0;
|
|
134
134
|
}
|
|
135
|
-
function
|
|
136
|
-
function
|
|
135
|
+
function f(e, r) {
|
|
136
|
+
function l() {
|
|
137
137
|
P || (P = !0, console.error(
|
|
138
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
139
|
r
|
|
140
140
|
));
|
|
141
141
|
}
|
|
142
|
-
|
|
143
|
-
get:
|
|
142
|
+
l.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
143
|
+
get: l,
|
|
144
144
|
configurable: !0
|
|
145
145
|
});
|
|
146
146
|
}
|
|
147
|
-
function
|
|
148
|
-
var e =
|
|
147
|
+
function m() {
|
|
148
|
+
var e = t(this.type);
|
|
149
149
|
return C[e] || (C[e] = !0, console.error(
|
|
150
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
151
|
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
152
152
|
}
|
|
153
|
-
function
|
|
154
|
-
var
|
|
153
|
+
function M(e, r, l, c, h, T) {
|
|
154
|
+
var d = l.ref;
|
|
155
155
|
return e = {
|
|
156
|
-
$$typeof:
|
|
156
|
+
$$typeof: O,
|
|
157
157
|
type: e,
|
|
158
158
|
key: r,
|
|
159
|
-
props:
|
|
160
|
-
_owner:
|
|
161
|
-
}, (
|
|
159
|
+
props: l,
|
|
160
|
+
_owner: c
|
|
161
|
+
}, (d !== void 0 ? d : null) !== null ? Object.defineProperty(e, "ref", {
|
|
162
162
|
enumerable: !1,
|
|
163
|
-
get:
|
|
163
|
+
get: m
|
|
164
164
|
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
165
165
|
configurable: !1,
|
|
166
166
|
enumerable: !1,
|
|
@@ -180,64 +180,64 @@ function ae() {
|
|
|
180
180
|
configurable: !1,
|
|
181
181
|
enumerable: !1,
|
|
182
182
|
writable: !0,
|
|
183
|
-
value:
|
|
183
|
+
value: T
|
|
184
184
|
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
185
185
|
}
|
|
186
|
-
function
|
|
187
|
-
var
|
|
188
|
-
if (
|
|
189
|
-
if (
|
|
190
|
-
if (ee(
|
|
191
|
-
for (
|
|
192
|
-
|
|
193
|
-
Object.freeze && Object.freeze(
|
|
186
|
+
function w(e, r, l, c, h, T) {
|
|
187
|
+
var d = r.children;
|
|
188
|
+
if (d !== void 0)
|
|
189
|
+
if (c)
|
|
190
|
+
if (ee(d)) {
|
|
191
|
+
for (c = 0; c < d.length; c++)
|
|
192
|
+
N(d[c]);
|
|
193
|
+
Object.freeze && Object.freeze(d);
|
|
194
194
|
} else
|
|
195
195
|
console.error(
|
|
196
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
197
|
);
|
|
198
|
-
else
|
|
198
|
+
else N(d);
|
|
199
199
|
if (A.call(r, "key")) {
|
|
200
|
-
|
|
201
|
-
var
|
|
200
|
+
d = t(e);
|
|
201
|
+
var g = Object.keys(r).filter(function(re) {
|
|
202
202
|
return re !== "key";
|
|
203
203
|
});
|
|
204
|
-
|
|
204
|
+
c = 0 < g.length ? "{key: someKey, " + g.join(": ..., ") + ": ...}" : "{key: someKey}", I[d + c] || (g = 0 < g.length ? "{" + g.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
205
205
|
`A props object containing a "key" prop is being spread into JSX:
|
|
206
206
|
let props = %s;
|
|
207
207
|
<%s {...props} />
|
|
208
208
|
React keys must be passed directly to JSX without using spread:
|
|
209
209
|
let props = %s;
|
|
210
210
|
<%s key={someKey} {...props} />`,
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
),
|
|
211
|
+
c,
|
|
212
|
+
d,
|
|
213
|
+
g,
|
|
214
|
+
d
|
|
215
|
+
), I[d + c] = !0);
|
|
216
216
|
}
|
|
217
|
-
if (
|
|
218
|
-
|
|
219
|
-
for (var
|
|
220
|
-
|
|
221
|
-
} else
|
|
222
|
-
return
|
|
223
|
-
|
|
217
|
+
if (d = null, l !== void 0 && (a(l), d = "" + l), b(r) && (a(r.key), d = "" + r.key), "key" in r) {
|
|
218
|
+
l = {};
|
|
219
|
+
for (var k in r)
|
|
220
|
+
k !== "key" && (l[k] = r[k]);
|
|
221
|
+
} else l = r;
|
|
222
|
+
return d && f(
|
|
223
|
+
l,
|
|
224
224
|
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
225
|
-
),
|
|
225
|
+
), M(
|
|
226
226
|
e,
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
227
|
+
d,
|
|
228
|
+
l,
|
|
229
|
+
s(),
|
|
230
230
|
h,
|
|
231
|
-
|
|
231
|
+
T
|
|
232
232
|
);
|
|
233
233
|
}
|
|
234
|
-
function
|
|
235
|
-
|
|
234
|
+
function N(e) {
|
|
235
|
+
S(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === R && (e._payload.status === "fulfilled" ? S(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
236
236
|
}
|
|
237
|
-
function
|
|
238
|
-
return typeof e == "object" && e !== null && e.$$typeof ===
|
|
237
|
+
function S(e) {
|
|
238
|
+
return typeof e == "object" && e !== null && e.$$typeof === O;
|
|
239
239
|
}
|
|
240
|
-
var v = te,
|
|
240
|
+
var v = te, O = Symbol.for("react.transitional.element"), B = Symbol.for("react.portal"), E = Symbol.for("react.fragment"), U = Symbol.for("react.strict_mode"), q = Symbol.for("react.profiler"), J = Symbol.for("react.consumer"), V = Symbol.for("react.context"), G = Symbol.for("react.forward_ref"), X = Symbol.for("react.suspense"), H = Symbol.for("react.suspense_list"), Z = Symbol.for("react.memo"), R = Symbol.for("react.lazy"), Q = Symbol.for("react.activity"), K = Symbol.for("react.client.reference"), j = v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, A = Object.prototype.hasOwnProperty, ee = Array.isArray, y = console.createTask ? console.createTask : function() {
|
|
241
241
|
return null;
|
|
242
242
|
};
|
|
243
243
|
v = {
|
|
@@ -247,93 +247,93 @@ React keys must be passed directly to JSX without using spread:
|
|
|
247
247
|
};
|
|
248
248
|
var P, C = {}, Y = v.react_stack_bottom_frame.bind(
|
|
249
249
|
v,
|
|
250
|
-
|
|
251
|
-
)(),
|
|
252
|
-
|
|
253
|
-
var
|
|
254
|
-
return
|
|
250
|
+
i
|
|
251
|
+
)(), $ = y(n(i)), I = {};
|
|
252
|
+
x.Fragment = E, x.jsx = function(e, r, l) {
|
|
253
|
+
var c = 1e4 > j.recentlyCreatedOwnerStacks++;
|
|
254
|
+
return w(
|
|
255
255
|
e,
|
|
256
256
|
r,
|
|
257
|
-
|
|
257
|
+
l,
|
|
258
258
|
!1,
|
|
259
|
-
|
|
260
|
-
|
|
259
|
+
c ? Error("react-stack-top-frame") : Y,
|
|
260
|
+
c ? y(n(e)) : $
|
|
261
261
|
);
|
|
262
|
-
},
|
|
263
|
-
var
|
|
264
|
-
return
|
|
262
|
+
}, x.jsxs = function(e, r, l) {
|
|
263
|
+
var c = 1e4 > j.recentlyCreatedOwnerStacks++;
|
|
264
|
+
return w(
|
|
265
265
|
e,
|
|
266
266
|
r,
|
|
267
|
-
|
|
267
|
+
l,
|
|
268
268
|
!0,
|
|
269
|
-
|
|
270
|
-
|
|
269
|
+
c ? Error("react-stack-top-frame") : Y,
|
|
270
|
+
c ? y(n(e)) : $
|
|
271
271
|
);
|
|
272
272
|
};
|
|
273
|
-
})()),
|
|
273
|
+
})()), x;
|
|
274
274
|
}
|
|
275
275
|
var L;
|
|
276
276
|
function oe() {
|
|
277
|
-
return L || (L = 1, process.env.NODE_ENV === "production" ?
|
|
277
|
+
return L || (L = 1, process.env.NODE_ENV === "production" ? _.exports = ae() : _.exports = ne()), _.exports;
|
|
278
278
|
}
|
|
279
|
-
var
|
|
280
|
-
function ce({ variant:
|
|
281
|
-
const
|
|
282
|
-
switch (
|
|
279
|
+
var u = oe();
|
|
280
|
+
function ce({ variant: t = "info", className: o, ...a }) {
|
|
281
|
+
const n = [o || ""];
|
|
282
|
+
switch (t) {
|
|
283
283
|
case "warning": {
|
|
284
|
-
|
|
284
|
+
n.push("bg-yellow-100 text-yellow-800 border-yellow-500");
|
|
285
285
|
break;
|
|
286
286
|
}
|
|
287
287
|
case "error": {
|
|
288
|
-
|
|
288
|
+
n.push("bg-red-100 text-red-800 border-red-500");
|
|
289
289
|
break;
|
|
290
290
|
}
|
|
291
291
|
default:
|
|
292
292
|
case "info": {
|
|
293
|
-
|
|
293
|
+
n.push("bg-blue-100 text-blue-800 border-blue-500");
|
|
294
294
|
break;
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
|
-
return /* @__PURE__ */
|
|
297
|
+
return /* @__PURE__ */ u.jsx(
|
|
298
298
|
"div",
|
|
299
299
|
{
|
|
300
300
|
role: "alert",
|
|
301
|
-
className: `border px-4 py-2 rounded-lg ${
|
|
302
|
-
...
|
|
301
|
+
className: `border px-4 py-2 rounded-lg ${n.join(" ")}`,
|
|
302
|
+
...a
|
|
303
303
|
}
|
|
304
304
|
);
|
|
305
305
|
}
|
|
306
306
|
function se({
|
|
307
|
-
variant:
|
|
308
|
-
bold:
|
|
309
|
-
italic:
|
|
310
|
-
className:
|
|
311
|
-
as:
|
|
312
|
-
color:
|
|
313
|
-
...
|
|
307
|
+
variant: t,
|
|
308
|
+
bold: o,
|
|
309
|
+
italic: a,
|
|
310
|
+
className: n,
|
|
311
|
+
as: s,
|
|
312
|
+
color: i,
|
|
313
|
+
...b
|
|
314
314
|
}) {
|
|
315
|
-
const
|
|
316
|
-
let
|
|
317
|
-
if (
|
|
318
|
-
|
|
315
|
+
const f = [n];
|
|
316
|
+
let m;
|
|
317
|
+
if (s)
|
|
318
|
+
m = s;
|
|
319
319
|
else
|
|
320
|
-
switch (
|
|
320
|
+
switch (t) {
|
|
321
321
|
case "heading":
|
|
322
|
-
|
|
322
|
+
m = "h2";
|
|
323
323
|
break;
|
|
324
324
|
case "list":
|
|
325
|
-
|
|
325
|
+
m = "li";
|
|
326
326
|
break;
|
|
327
327
|
case "paragraph":
|
|
328
328
|
default:
|
|
329
|
-
|
|
329
|
+
m = "p";
|
|
330
330
|
break;
|
|
331
331
|
}
|
|
332
|
-
return
|
|
332
|
+
return o && f.push("font-bold"), a && f.push("italic"), i && f.push(`text-${i}`), /* @__PURE__ */ u.jsx(m, { className: f.join(" "), ...b });
|
|
333
333
|
}
|
|
334
|
-
function le({ className:
|
|
335
|
-
const
|
|
336
|
-
|
|
334
|
+
function le({ className: t, ...o }) {
|
|
335
|
+
const a = [
|
|
336
|
+
t,
|
|
337
337
|
"px-large",
|
|
338
338
|
"border",
|
|
339
339
|
"border-1",
|
|
@@ -343,68 +343,218 @@ function le({ className: n, ...a }) {
|
|
|
343
343
|
"h-form-element",
|
|
344
344
|
"text-base"
|
|
345
345
|
];
|
|
346
|
-
return /* @__PURE__ */
|
|
346
|
+
return /* @__PURE__ */ u.jsx("input", { className: a.join(" "), ...o });
|
|
347
347
|
}
|
|
348
348
|
function W({
|
|
349
|
-
className:
|
|
350
|
-
variant:
|
|
351
|
-
...
|
|
349
|
+
className: t,
|
|
350
|
+
variant: o = "regular",
|
|
351
|
+
...a
|
|
352
352
|
}) {
|
|
353
|
-
const
|
|
354
|
-
|
|
353
|
+
const n = [
|
|
354
|
+
t,
|
|
355
355
|
"rounded",
|
|
356
356
|
"h-form-element",
|
|
357
357
|
"lh-form-element",
|
|
358
358
|
"px-large",
|
|
359
359
|
"text-base"
|
|
360
360
|
];
|
|
361
|
-
switch (
|
|
361
|
+
switch (o) {
|
|
362
362
|
case "error":
|
|
363
|
-
|
|
363
|
+
n.push("bg-red-light", "text-red-dark", "font-bold");
|
|
364
364
|
break;
|
|
365
365
|
case "secondary":
|
|
366
|
-
|
|
366
|
+
n.push("bg-transparent", "text-grey-minor", "px-0");
|
|
367
367
|
break;
|
|
368
368
|
case "regular":
|
|
369
369
|
default:
|
|
370
|
-
|
|
370
|
+
n.push("bg-blue-light", "text-blue-dark", "font-bold");
|
|
371
371
|
break;
|
|
372
372
|
}
|
|
373
|
-
return /* @__PURE__ */
|
|
373
|
+
return /* @__PURE__ */ u.jsx("button", { className: n.join(" "), ...a });
|
|
374
374
|
}
|
|
375
|
-
function
|
|
376
|
-
const
|
|
377
|
-
return /* @__PURE__ */
|
|
375
|
+
function ie({ className: t, ...o }) {
|
|
376
|
+
const a = [t, "p-large", "bg-bg", "rounded", "shadow-card"];
|
|
377
|
+
return /* @__PURE__ */ u.jsx("div", { className: a.join(" "), ...o });
|
|
378
378
|
}
|
|
379
|
-
function
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
379
|
+
function de({
|
|
380
|
+
variant: t = "neutral",
|
|
381
|
+
className: o = "",
|
|
382
|
+
children: a,
|
|
383
|
+
...n
|
|
384
|
+
}) {
|
|
385
|
+
const s = [
|
|
386
|
+
"inline-flex",
|
|
387
|
+
"items-center",
|
|
388
|
+
"px-2",
|
|
389
|
+
"py-1",
|
|
390
|
+
"rounded",
|
|
391
|
+
"text-xs",
|
|
392
|
+
"font-medium",
|
|
393
|
+
"border"
|
|
394
|
+
], i = {
|
|
395
|
+
success: "bg-green-100 text-green-800 border-green-500",
|
|
396
|
+
warning: "bg-yellow-100 text-yellow-800 border-yellow-500",
|
|
397
|
+
error: "bg-red-100 text-red-800 border-red-500",
|
|
398
|
+
info: "bg-blue-100 text-blue-800 border-blue-500",
|
|
399
|
+
neutral: "bg-gray-100 text-gray-800 border-gray-500"
|
|
400
|
+
}, b = [
|
|
401
|
+
...s,
|
|
402
|
+
i[t],
|
|
403
|
+
o
|
|
404
|
+
].filter(Boolean).join(" ");
|
|
405
|
+
return /* @__PURE__ */ u.jsx(
|
|
406
|
+
"span",
|
|
407
|
+
{
|
|
408
|
+
role: "status",
|
|
409
|
+
"aria-label": typeof a == "string" ? a : void 0,
|
|
410
|
+
className: b,
|
|
411
|
+
...n,
|
|
412
|
+
children: a
|
|
413
|
+
}
|
|
414
|
+
);
|
|
384
415
|
}
|
|
385
416
|
function fe({
|
|
386
|
-
|
|
387
|
-
|
|
417
|
+
options: t,
|
|
418
|
+
placeholder: o,
|
|
419
|
+
error: a = !1,
|
|
420
|
+
className: n = "",
|
|
388
421
|
...s
|
|
389
422
|
}) {
|
|
390
|
-
|
|
391
|
-
"
|
|
423
|
+
const i = [
|
|
424
|
+
"block",
|
|
425
|
+
"w-full",
|
|
426
|
+
"rounded",
|
|
427
|
+
"h-form-element",
|
|
428
|
+
"px-large",
|
|
429
|
+
"border",
|
|
430
|
+
"text-base",
|
|
431
|
+
"focus:outline-none",
|
|
432
|
+
"focus:ring-2",
|
|
433
|
+
"focus:ring-offset-2"
|
|
434
|
+
], b = a ? "border-red-500 focus:ring-red-500" : "border-gray-300 focus:ring-indigo-500", f = [
|
|
435
|
+
...i,
|
|
436
|
+
b,
|
|
437
|
+
n
|
|
438
|
+
].filter(Boolean).join(" ");
|
|
439
|
+
return /* @__PURE__ */ u.jsxs(
|
|
440
|
+
"select",
|
|
392
441
|
{
|
|
442
|
+
className: f,
|
|
443
|
+
"aria-invalid": a,
|
|
444
|
+
"aria-describedby": a ? `${s.id}-error` : void 0,
|
|
393
445
|
...s,
|
|
394
|
-
|
|
395
|
-
o.
|
|
446
|
+
children: [
|
|
447
|
+
o && /* @__PURE__ */ u.jsx("option", { value: "", disabled: !0, children: o }),
|
|
448
|
+
t.map((m) => /* @__PURE__ */ u.jsx(
|
|
449
|
+
"option",
|
|
450
|
+
{
|
|
451
|
+
value: m.value,
|
|
452
|
+
disabled: m.disabled,
|
|
453
|
+
children: m.label
|
|
454
|
+
},
|
|
455
|
+
m.value
|
|
456
|
+
))
|
|
457
|
+
]
|
|
458
|
+
}
|
|
459
|
+
);
|
|
460
|
+
}
|
|
461
|
+
function be({
|
|
462
|
+
error: t = !1,
|
|
463
|
+
resize: o = "vertical",
|
|
464
|
+
className: a = "",
|
|
465
|
+
...n
|
|
466
|
+
}) {
|
|
467
|
+
const s = [
|
|
468
|
+
"block",
|
|
469
|
+
"w-full",
|
|
470
|
+
"rounded",
|
|
471
|
+
"px-large",
|
|
472
|
+
"py-medium",
|
|
473
|
+
"border",
|
|
474
|
+
"text-base",
|
|
475
|
+
"focus:outline-none",
|
|
476
|
+
"focus:ring-2",
|
|
477
|
+
"focus:ring-offset-2"
|
|
478
|
+
], i = {
|
|
479
|
+
none: "resize-none",
|
|
480
|
+
both: "resize",
|
|
481
|
+
horizontal: "resize-x",
|
|
482
|
+
vertical: "resize-y"
|
|
483
|
+
}, b = t ? "border-red-500 focus:ring-red-500" : "border-gray-300 focus:ring-indigo-500", f = [
|
|
484
|
+
...s,
|
|
485
|
+
i[o],
|
|
486
|
+
b,
|
|
487
|
+
a
|
|
488
|
+
].filter(Boolean).join(" ");
|
|
489
|
+
return /* @__PURE__ */ u.jsx(
|
|
490
|
+
"textarea",
|
|
491
|
+
{
|
|
492
|
+
className: f,
|
|
493
|
+
"aria-invalid": t,
|
|
494
|
+
"aria-describedby": t && n.id ? `${n.id}-error` : void 0,
|
|
495
|
+
...n
|
|
496
|
+
}
|
|
497
|
+
);
|
|
498
|
+
}
|
|
499
|
+
function z({ label: t, ...o }) {
|
|
500
|
+
return o.id || console.error("InputWithLabel component requires an id prop"), /* @__PURE__ */ u.jsxs("div", { className: "mb-medium grid gap-small", children: [
|
|
501
|
+
/* @__PURE__ */ u.jsx(se, { as: "label", htmlFor: o.id, className: "cursor-pointer", children: t }),
|
|
502
|
+
/* @__PURE__ */ u.jsx(le, { ...o })
|
|
503
|
+
] });
|
|
504
|
+
}
|
|
505
|
+
function me({
|
|
506
|
+
variant: t = "default",
|
|
507
|
+
padding: o = "medium",
|
|
508
|
+
className: a = "",
|
|
509
|
+
children: n,
|
|
510
|
+
...s
|
|
511
|
+
}) {
|
|
512
|
+
const i = [
|
|
513
|
+
"bg-white",
|
|
514
|
+
"rounded-lg",
|
|
515
|
+
"border",
|
|
516
|
+
"border-gray-200",
|
|
517
|
+
"shadow-sm"
|
|
518
|
+
], b = {
|
|
519
|
+
default: "",
|
|
520
|
+
hover: "hover:shadow-md transition-shadow cursor-pointer",
|
|
521
|
+
selected: "border-indigo-500 shadow-md"
|
|
522
|
+
}, f = {
|
|
523
|
+
none: "",
|
|
524
|
+
small: "p-2",
|
|
525
|
+
medium: "p-4",
|
|
526
|
+
large: "p-6"
|
|
527
|
+
}, m = [
|
|
528
|
+
...i,
|
|
529
|
+
b[t],
|
|
530
|
+
f[o],
|
|
531
|
+
a
|
|
532
|
+
].filter(Boolean).join(" ");
|
|
533
|
+
return /* @__PURE__ */ u.jsx("div", { className: m, ...s, children: n });
|
|
534
|
+
}
|
|
535
|
+
function ge({
|
|
536
|
+
onForgotPasswordClick: t,
|
|
537
|
+
className: o,
|
|
538
|
+
...a
|
|
539
|
+
}) {
|
|
540
|
+
return /* @__PURE__ */ u.jsx(ie, { className: o, children: /* @__PURE__ */ u.jsxs(
|
|
541
|
+
"form",
|
|
542
|
+
{
|
|
543
|
+
...a,
|
|
544
|
+
onSubmit: (n) => {
|
|
545
|
+
n.preventDefault(), a.onSubmit && a.onSubmit(n);
|
|
396
546
|
},
|
|
397
547
|
children: [
|
|
398
|
-
/* @__PURE__ */
|
|
399
|
-
|
|
548
|
+
/* @__PURE__ */ u.jsx(
|
|
549
|
+
z,
|
|
400
550
|
{
|
|
401
551
|
id: "login-email",
|
|
402
552
|
label: "Your email",
|
|
403
553
|
placeholder: "myname@email.com"
|
|
404
554
|
}
|
|
405
555
|
),
|
|
406
|
-
/* @__PURE__ */
|
|
407
|
-
|
|
556
|
+
/* @__PURE__ */ u.jsx(
|
|
557
|
+
z,
|
|
408
558
|
{
|
|
409
559
|
id: "login-password",
|
|
410
560
|
label: "Your password",
|
|
@@ -412,28 +562,32 @@ function fe({
|
|
|
412
562
|
type: "password"
|
|
413
563
|
}
|
|
414
564
|
),
|
|
415
|
-
/* @__PURE__ */
|
|
416
|
-
/* @__PURE__ */
|
|
565
|
+
/* @__PURE__ */ u.jsxs("div", { className: "flex justify-between", children: [
|
|
566
|
+
/* @__PURE__ */ u.jsx(
|
|
417
567
|
W,
|
|
418
568
|
{
|
|
419
569
|
variant: "secondary",
|
|
420
570
|
type: "button",
|
|
421
|
-
onClick:
|
|
571
|
+
onClick: t,
|
|
422
572
|
children: "Forgot password?"
|
|
423
573
|
}
|
|
424
574
|
),
|
|
425
|
-
/* @__PURE__ */
|
|
575
|
+
/* @__PURE__ */ u.jsx(W, { variant: "regular", type: "submit", children: "Sign in" })
|
|
426
576
|
] })
|
|
427
577
|
]
|
|
428
578
|
}
|
|
429
579
|
) });
|
|
430
580
|
}
|
|
431
581
|
export {
|
|
432
|
-
|
|
582
|
+
de as Badge,
|
|
583
|
+
ie as BoxWrapper,
|
|
433
584
|
W as Button,
|
|
585
|
+
me as Card,
|
|
434
586
|
ce as Info,
|
|
435
587
|
le as Input,
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
588
|
+
z as InputWithLabel,
|
|
589
|
+
ge as LoginBox,
|
|
590
|
+
fe as Select,
|
|
591
|
+
se as Text,
|
|
592
|
+
be as Textarea
|
|
439
593
|
};
|