@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.
Files changed (32) hide show
  1. package/README.md +1 -0
  2. package/dist/index.cjs +4 -4
  3. package/dist/index.js +330 -176
  4. package/dist/ui/atoms/Badge/Badge.d.ts +18 -0
  5. package/dist/ui/atoms/Badge/Badge.stories.d.ts +11 -0
  6. package/dist/ui/atoms/Badge/Badge.test.d.ts +1 -0
  7. package/dist/ui/atoms/Select/Select.d.ts +30 -0
  8. package/dist/ui/atoms/Select/Select.stories.d.ts +10 -0
  9. package/dist/ui/atoms/Select/Select.test.d.ts +1 -0
  10. package/dist/ui/atoms/Textarea/Textarea.d.ts +21 -0
  11. package/dist/ui/atoms/Textarea/Textarea.stories.d.ts +9 -0
  12. package/dist/ui/atoms/Textarea/Textarea.test.d.ts +1 -0
  13. package/dist/ui/atoms/index.d.ts +3 -0
  14. package/dist/ui/molecules/Card/Card.d.ts +22 -0
  15. package/dist/ui/molecules/Card/Card.stories.d.ts +11 -0
  16. package/dist/ui/molecules/Card/Card.test.d.ts +1 -0
  17. package/dist/ui/molecules/index.d.ts +1 -0
  18. package/package.json +9 -1
  19. package/src/ui/atoms/Badge/Badge.stories.tsx +86 -0
  20. package/src/ui/atoms/Badge/Badge.test.tsx +63 -0
  21. package/src/ui/atoms/Badge/Badge.tsx +60 -0
  22. package/src/ui/atoms/Select/Select.stories.tsx +93 -0
  23. package/src/ui/atoms/Select/Select.test.tsx +63 -0
  24. package/src/ui/atoms/Select/Select.tsx +85 -0
  25. package/src/ui/atoms/Textarea/Textarea.stories.tsx +72 -0
  26. package/src/ui/atoms/Textarea/Textarea.test.tsx +55 -0
  27. package/src/ui/atoms/Textarea/Textarea.tsx +67 -0
  28. package/src/ui/atoms/index.ts +6 -0
  29. package/src/ui/molecules/Card/Card.stories.tsx +117 -0
  30. package/src/ui/molecules/Card/Card.test.tsx +58 -0
  31. package/src/ui/molecules/Card/Card.tsx +63 -0
  32. 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 x = { exports: {} }, _ = {};
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 ne() {
14
- if (F) return _;
13
+ function ae() {
14
+ if (F) return p;
15
15
  F = 1;
16
- var n = Symbol.for("react.transitional.element"), a = Symbol.for("react.fragment");
17
- function s(o, c, f) {
18
- var m = null;
19
- if (f !== void 0 && (m = "" + f), c.key !== void 0 && (m = "" + c.key), "key" in c) {
20
- f = {};
21
- for (var d in c)
22
- d !== "key" && (f[d] = c[d]);
23
- } else f = c;
24
- return c = f.ref, {
25
- $$typeof: n,
26
- type: o,
27
- key: m,
28
- ref: c !== void 0 ? c : null,
29
- props: f
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 _.Fragment = a, _.jsx = s, _.jsxs = s, _;
32
+ return p.Fragment = o, p.jsx = a, p.jsxs = a, p;
33
33
  }
34
- var E = {};
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 ae() {
45
+ function ne() {
46
46
  return D || (D = 1, process.env.NODE_ENV !== "production" && (function() {
47
- function n(e) {
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 R:
53
+ case E:
54
54
  return "Fragment";
55
- case V:
55
+ case q:
56
56
  return "Profiler";
57
- case J:
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 q:
70
+ case B:
71
71
  return "Portal";
72
- case G:
72
+ case V:
73
73
  return e.displayName || "Context";
74
- case z:
74
+ case J:
75
75
  return (e._context.displayName || "Context") + ".Consumer";
76
- case B:
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 : n(e.type) || "Memo";
81
- case g:
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 n(e(r));
84
+ return t(e(r));
85
85
  } catch {
86
86
  }
87
87
  }
88
88
  return null;
89
89
  }
90
- function a(e) {
90
+ function o(e) {
91
91
  return "" + e;
92
92
  }
93
- function s(e) {
93
+ function a(e) {
94
94
  try {
95
- a(e);
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 t = r.error, l = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
103
- return t.call(
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
- l
107
- ), a(e);
106
+ c
107
+ ), o(e);
108
108
  }
109
109
  }
110
- function o(e) {
111
- if (e === R) return "<>";
112
- if (typeof e == "object" && e !== null && e.$$typeof === g)
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 = n(e);
115
+ var r = t(e);
116
116
  return r ? "<" + r + ">" : "<...>";
117
117
  } catch {
118
118
  return "<...>";
119
119
  }
120
120
  }
121
- function c() {
122
- var e = T.A;
121
+ function s() {
122
+ var e = j.A;
123
123
  return e === null ? null : e.getOwner();
124
124
  }
125
- function f() {
125
+ function i() {
126
126
  return Error("react-stack-top-frame");
127
127
  }
128
- function m(e) {
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 d(e, r) {
136
- function t() {
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
- t.isReactWarning = !0, Object.defineProperty(e, "key", {
143
- get: t,
142
+ l.isReactWarning = !0, Object.defineProperty(e, "key", {
143
+ get: l,
144
144
  configurable: !0
145
145
  });
146
146
  }
147
- function b() {
148
- var e = n(this.type);
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 U(e, r, t, l, h, j) {
154
- var u = t.ref;
153
+ function M(e, r, l, c, h, T) {
154
+ var d = l.ref;
155
155
  return e = {
156
- $$typeof: N,
156
+ $$typeof: O,
157
157
  type: e,
158
158
  key: r,
159
- props: t,
160
- _owner: l
161
- }, (u !== void 0 ? u : null) !== null ? Object.defineProperty(e, "ref", {
159
+ props: l,
160
+ _owner: c
161
+ }, (d !== void 0 ? d : null) !== null ? Object.defineProperty(e, "ref", {
162
162
  enumerable: !1,
163
- get: b
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: j
183
+ value: T
184
184
  }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
185
185
  }
186
- function y(e, r, t, l, h, j) {
187
- var u = r.children;
188
- if (u !== void 0)
189
- if (l)
190
- if (ee(u)) {
191
- for (l = 0; l < u.length; l++)
192
- S(u[l]);
193
- Object.freeze && Object.freeze(u);
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 S(u);
198
+ else N(d);
199
199
  if (A.call(r, "key")) {
200
- u = n(e);
201
- var p = Object.keys(r).filter(function(re) {
200
+ d = t(e);
201
+ var g = Object.keys(r).filter(function(re) {
202
202
  return re !== "key";
203
203
  });
204
- l = 0 < p.length ? "{key: someKey, " + p.join(": ..., ") + ": ...}" : "{key: someKey}", $[u + l] || (p = 0 < p.length ? "{" + p.join(": ..., ") + ": ...}" : "{}", console.error(
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
- l,
212
- u,
213
- p,
214
- u
215
- ), $[u + l] = !0);
211
+ c,
212
+ d,
213
+ g,
214
+ d
215
+ ), I[d + c] = !0);
216
216
  }
217
- if (u = null, t !== void 0 && (s(t), u = "" + t), m(r) && (s(r.key), u = "" + r.key), "key" in r) {
218
- t = {};
219
- for (var w in r)
220
- w !== "key" && (t[w] = r[w]);
221
- } else t = r;
222
- return u && d(
223
- t,
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
- ), U(
225
+ ), M(
226
226
  e,
227
- u,
228
- t,
229
- c(),
227
+ d,
228
+ l,
229
+ s(),
230
230
  h,
231
- j
231
+ T
232
232
  );
233
233
  }
234
- function S(e) {
235
- O(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === g && (e._payload.status === "fulfilled" ? O(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
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 O(e) {
238
- return typeof e == "object" && e !== null && e.$$typeof === N;
237
+ function S(e) {
238
+ return typeof e == "object" && e !== null && e.$$typeof === O;
239
239
  }
240
- var v = te, N = Symbol.for("react.transitional.element"), q = Symbol.for("react.portal"), R = Symbol.for("react.fragment"), J = Symbol.for("react.strict_mode"), V = Symbol.for("react.profiler"), z = Symbol.for("react.consumer"), G = Symbol.for("react.context"), B = Symbol.for("react.forward_ref"), X = Symbol.for("react.suspense"), H = Symbol.for("react.suspense_list"), Z = Symbol.for("react.memo"), g = Symbol.for("react.lazy"), Q = Symbol.for("react.activity"), K = Symbol.for("react.client.reference"), T = v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, A = Object.prototype.hasOwnProperty, ee = Array.isArray, k = console.createTask ? console.createTask : function() {
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
- f
251
- )(), I = k(o(f)), $ = {};
252
- E.Fragment = R, E.jsx = function(e, r, t) {
253
- var l = 1e4 > T.recentlyCreatedOwnerStacks++;
254
- return y(
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
- t,
257
+ l,
258
258
  !1,
259
- l ? Error("react-stack-top-frame") : Y,
260
- l ? k(o(e)) : I
259
+ c ? Error("react-stack-top-frame") : Y,
260
+ c ? y(n(e)) : $
261
261
  );
262
- }, E.jsxs = function(e, r, t) {
263
- var l = 1e4 > T.recentlyCreatedOwnerStacks++;
264
- return y(
262
+ }, x.jsxs = function(e, r, l) {
263
+ var c = 1e4 > j.recentlyCreatedOwnerStacks++;
264
+ return w(
265
265
  e,
266
266
  r,
267
- t,
267
+ l,
268
268
  !0,
269
- l ? Error("react-stack-top-frame") : Y,
270
- l ? k(o(e)) : I
269
+ c ? Error("react-stack-top-frame") : Y,
270
+ c ? y(n(e)) : $
271
271
  );
272
272
  };
273
- })()), E;
273
+ })()), x;
274
274
  }
275
275
  var L;
276
276
  function oe() {
277
- return L || (L = 1, process.env.NODE_ENV === "production" ? x.exports = ne() : x.exports = ae()), x.exports;
277
+ return L || (L = 1, process.env.NODE_ENV === "production" ? _.exports = ae() : _.exports = ne()), _.exports;
278
278
  }
279
- var i = oe();
280
- function ce({ variant: n = "info", className: a, ...s }) {
281
- const o = [a || ""];
282
- switch (n) {
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
- o.push("bg-yellow-100 text-yellow-800 border-yellow-500");
284
+ n.push("bg-yellow-100 text-yellow-800 border-yellow-500");
285
285
  break;
286
286
  }
287
287
  case "error": {
288
- o.push("bg-red-100 text-red-800 border-red-500");
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
- o.push("bg-blue-100 text-blue-800 border-blue-500");
293
+ n.push("bg-blue-100 text-blue-800 border-blue-500");
294
294
  break;
295
295
  }
296
296
  }
297
- return /* @__PURE__ */ i.jsx(
297
+ return /* @__PURE__ */ u.jsx(
298
298
  "div",
299
299
  {
300
300
  role: "alert",
301
- className: `border px-4 py-2 rounded-lg ${o.join(" ")}`,
302
- ...s
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: n,
308
- bold: a,
309
- italic: s,
310
- className: o,
311
- as: c,
312
- color: f,
313
- ...m
307
+ variant: t,
308
+ bold: o,
309
+ italic: a,
310
+ className: n,
311
+ as: s,
312
+ color: i,
313
+ ...b
314
314
  }) {
315
- const d = [o];
316
- let b;
317
- if (c)
318
- b = c;
315
+ const f = [n];
316
+ let m;
317
+ if (s)
318
+ m = s;
319
319
  else
320
- switch (n) {
320
+ switch (t) {
321
321
  case "heading":
322
- b = "h2";
322
+ m = "h2";
323
323
  break;
324
324
  case "list":
325
- b = "li";
325
+ m = "li";
326
326
  break;
327
327
  case "paragraph":
328
328
  default:
329
- b = "p";
329
+ m = "p";
330
330
  break;
331
331
  }
332
- return a && d.push("font-bold"), s && d.push("italic"), f && d.push(`text-${f}`), /* @__PURE__ */ i.jsx(b, { className: d.join(" "), ...m });
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: n, ...a }) {
335
- const s = [
336
- n,
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__ */ i.jsx("input", { className: s.join(" "), ...a });
346
+ return /* @__PURE__ */ u.jsx("input", { className: a.join(" "), ...o });
347
347
  }
348
348
  function W({
349
- className: n,
350
- variant: a = "regular",
351
- ...s
349
+ className: t,
350
+ variant: o = "regular",
351
+ ...a
352
352
  }) {
353
- const o = [
354
- n,
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 (a) {
361
+ switch (o) {
362
362
  case "error":
363
- o.push("bg-red-light", "text-red-dark", "font-bold");
363
+ n.push("bg-red-light", "text-red-dark", "font-bold");
364
364
  break;
365
365
  case "secondary":
366
- o.push("bg-transparent", "text-grey-minor", "px-0");
366
+ n.push("bg-transparent", "text-grey-minor", "px-0");
367
367
  break;
368
368
  case "regular":
369
369
  default:
370
- o.push("bg-blue-light", "text-blue-dark", "font-bold");
370
+ n.push("bg-blue-light", "text-blue-dark", "font-bold");
371
371
  break;
372
372
  }
373
- return /* @__PURE__ */ i.jsx("button", { className: o.join(" "), ...s });
373
+ return /* @__PURE__ */ u.jsx("button", { className: n.join(" "), ...a });
374
374
  }
375
- function ue({ className: n, ...a }) {
376
- const s = [n, "p-large", "bg-bg", "rounded", "shadow-card"];
377
- return /* @__PURE__ */ i.jsx("div", { className: s.join(" "), ...a });
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 M({ label: n, ...a }) {
380
- return a.id || console.error("InputWithLabel component requires an id prop"), /* @__PURE__ */ i.jsxs("div", { className: "mb-medium grid gap-small", children: [
381
- /* @__PURE__ */ i.jsx(se, { as: "label", htmlFor: a.id, className: "cursor-pointer", children: n }),
382
- /* @__PURE__ */ i.jsx(le, { ...a })
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
- onForgotPasswordClick: n,
387
- className: a,
417
+ options: t,
418
+ placeholder: o,
419
+ error: a = !1,
420
+ className: n = "",
388
421
  ...s
389
422
  }) {
390
- return /* @__PURE__ */ i.jsx(ue, { className: a, children: /* @__PURE__ */ i.jsxs(
391
- "form",
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
- onSubmit: (o) => {
395
- o.preventDefault(), s.onSubmit && s.onSubmit(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__ */ i.jsx(
399
- M,
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__ */ i.jsx(
407
- M,
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__ */ i.jsxs("div", { className: "flex justify-between", children: [
416
- /* @__PURE__ */ i.jsx(
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: n,
571
+ onClick: t,
422
572
  children: "Forgot password?"
423
573
  }
424
574
  ),
425
- /* @__PURE__ */ i.jsx(W, { variant: "regular", type: "submit", children: "Sign in" })
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
- ue as BoxWrapper,
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
- M as InputWithLabel,
437
- fe as LoginBox,
438
- se as Text
588
+ z as InputWithLabel,
589
+ ge as LoginBox,
590
+ fe as Select,
591
+ se as Text,
592
+ be as Textarea
439
593
  };