@arkitektbedriftene/fe-lib 0.4.34 → 0.4.35

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/ui.es.js CHANGED
@@ -1,28 +1,458 @@
1
- import { P as l, y as p, z as i, B as t, R as m } from "./Checkbox-0c1030b1.js";
2
- import { H as D, Q as M, I as $, m as k, J as A, K as w, Y as O, C as P, q as z, v as j, L as N, D as G, W as H, a as R, n as q, p as E, U as J, N as K, r as L, O as Q, S as U, M as V, X as W, t as X, j as Y, T as F, k as Z, b as _, c as oo, l as ao, G as so, E as eo, A as ro, V as to, s as no } from "./Checkbox-0c1030b1.js";
3
- import { jsxs as n, jsx as a } from "react/jsx-runtime";
4
- import { useState as c } from "react";
1
+ import { k as p, s as n, g as f, u as G, j as K, l as U, m as q, n as J, h as Q, e as Z, d as _, F as oo, a as eo, o as ro, f as to, c as no } from "./stitches.config-543644f4.js";
2
+ import { q as Be, p as He } from "./stitches.config-543644f4.js";
3
+ import { jsx as t, jsxs as c, Fragment as ao } from "react/jsx-runtime";
4
+ import { forwardRef as u, createContext as io, useMemo as k, useContext as B, isValidElement as so, cloneElement as lo, useState as co, useId as C } from "react";
5
+ import * as y from "@radix-ui/react-toolbar";
6
+ import { b as $o, c as mo, d as uo } from "./index.esm-55efa2d1.js";
7
+ import * as b from "@radix-ui/react-dialog";
8
+ import * as m from "@radix-ui/react-dropdown-menu";
9
+ import { f as go, g as H } from "./index.esm-e4db0c1f.js";
10
+ import po from "react-select";
11
+ import * as F from "@radix-ui/react-checkbox";
5
12
  import "react-dom";
6
- import "@radix-ui/react-toolbar";
7
- import "./index.esm-3266b7f8.js";
8
- import "@radix-ui/react-dialog";
9
- import "@radix-ui/react-dropdown-menu";
10
- import "react-select";
11
- import "@radix-ui/react-checkbox";
12
- const h = ({ children: s, content: e }) => {
13
- const [o, r] = c(!1);
14
- return /* @__PURE__ */ n(
15
- l,
13
+ const ho = p({
14
+ "0%": {
15
+ transform: "rotate(0)"
16
+ },
17
+ "100%": {
18
+ transform: "rotate(360deg)"
19
+ }
20
+ }), bo = p({
21
+ "0%": {
22
+ strokeDashoffset: 600
23
+ },
24
+ "100%": {
25
+ strokeDashoffset: 0
26
+ }
27
+ }), fo = n("svg", {
28
+ animation: `${ho} 2s linear infinite`
29
+ }), yo = n("circle", {
30
+ animation: `${bo} 1.6s cubic-bezier(0.4, 0.15, 0.6, 0.85) infinite`,
31
+ fill: "transparent",
32
+ stroke: "currentColor",
33
+ strokeDasharray: 300,
34
+ strokeDashoffset: 600,
35
+ strokeLinecap: "round",
36
+ strokeMiterlimit: 10,
37
+ strokeWidth: 12
38
+ }), xo = n("div", {
39
+ lineHeight: 0,
40
+ flexShrink: 0,
41
+ variants: {
42
+ size: {
43
+ xs: {
44
+ width: "1rem",
45
+ height: "1rem"
46
+ },
47
+ sm: {
48
+ width: "1.25rem",
49
+ height: "1.25rem"
50
+ },
51
+ md: {
52
+ width: "1.75rem",
53
+ height: "1.75rem"
54
+ },
55
+ lg: {
56
+ width: "2.25rem",
57
+ height: "2.25rem"
58
+ }
59
+ },
60
+ color: {
61
+ light: {
62
+ color: "$gray200"
63
+ },
64
+ dark: {
65
+ color: "$gray800"
66
+ },
67
+ inherit: {
68
+ color: "inherit"
69
+ }
70
+ }
71
+ },
72
+ defaultVariants: {
73
+ size: "sm",
74
+ color: "dark"
75
+ }
76
+ }), vo = u(
77
+ (o, e) => /* @__PURE__ */ t(
78
+ xo,
79
+ {
80
+ ref: e,
81
+ ...o,
82
+ children: /* @__PURE__ */ t(
83
+ fo,
84
+ {
85
+ x: "0px",
86
+ y: "0px",
87
+ viewBox: "0 0 150 150",
88
+ children: /* @__PURE__ */ t(
89
+ yo,
90
+ {
91
+ cx: "75",
92
+ cy: "75",
93
+ r: "60"
94
+ }
95
+ )
96
+ }
97
+ )
98
+ }
99
+ )
100
+ ), ko = n("button", {
101
+ appearance: "none",
102
+ margin: 0,
103
+ padding: 0,
104
+ border: "none",
105
+ background: "none",
106
+ cursor: "pointer",
107
+ fontFamily: "inherit",
108
+ textAlign: "left",
109
+ textDecoration: "none",
110
+ textIndent: 0,
111
+ lineHeight: 1.25,
112
+ display: "inline-flex",
113
+ justifyContent: "center",
114
+ alignItems: "center",
115
+ gap: "$2",
116
+ position: "relative",
117
+ fontWeight: "$medium",
118
+ borderRadius: "$sm",
119
+ whiteSpace: "nowrap",
120
+ transition: "background 0.2s ease-in-out",
121
+ "&:focus, &:focus-visible": {
122
+ outline: "none"
123
+ },
124
+ "&:focus-visible": {
125
+ boxShadow: "0 0 0 2px white, 0 0 0 4px $colors$focusRing"
126
+ },
127
+ "&:disabled": {
128
+ cursor: "not-allowed"
129
+ },
130
+ variants: {
131
+ color: {
132
+ primary: {
133
+ $$solid: "$colors$blue600",
134
+ $$solidHover: "$colors$blue700",
135
+ $$outline: "$colors$blue600",
136
+ $$outlineHover: "$colors$blue100",
137
+ $$outlineText: "$colors$blue600",
138
+ $$disabled: "$colors$blue200"
139
+ },
140
+ secondary: {
141
+ $$solid: "$colors$gray600",
142
+ $$solidHover: "$colors$gray700",
143
+ $$outline: "$colors$gray400",
144
+ $$outlineHover: "$colors$gray100",
145
+ $$outlineText: "$colors$gray600",
146
+ $$disabled: "$colors$gray200"
147
+ },
148
+ success: {
149
+ $$solid: "$colors$green600",
150
+ $$solidHover: "$colors$green700",
151
+ $$outline: "$colors$green600",
152
+ $$outlineHover: "$colors$green100",
153
+ $$outlineText: "$colors$green600",
154
+ $$disabled: "$colors$green200"
155
+ },
156
+ danger: {
157
+ $$solid: "$colors$red600",
158
+ $$solidHover: "$colors$red700",
159
+ $$outline: "$colors$red600",
160
+ $$outlineHover: "$colors$red100",
161
+ $$outlineText: "$colors$red600",
162
+ $$disabled: "$colors$red200"
163
+ },
164
+ warning: {
165
+ $$solid: "$colors$yellow600",
166
+ $$solidHover: "$colors$yellow700",
167
+ $$outline: "$colors$yellow400",
168
+ $$outlineHover: "$colors$yellow50",
169
+ $$outlineText: "$colors$yellow600",
170
+ $$disabled: "$colors$yellow100"
171
+ }
172
+ },
173
+ size: {
174
+ sm: {
175
+ fontSize: "$sm",
176
+ padding: "$1 $2",
177
+ height: "1.75rem"
178
+ },
179
+ md: {
180
+ fontSize: "$sm",
181
+ padding: "$2 $4",
182
+ height: "2.25rem"
183
+ },
184
+ lg: {
185
+ fontSize: "$md",
186
+ padding: "$3 $6",
187
+ height: "2.75rem"
188
+ }
189
+ },
190
+ variant: {
191
+ primary: {
192
+ background: "$$solid",
193
+ color: "white",
194
+ "&:hover:not(:disabled)": {
195
+ backgroundColor: "$$solidHover"
196
+ },
197
+ "&:disabled": {
198
+ backgroundColor: "$$disabled"
199
+ }
200
+ },
201
+ outline: {
202
+ boxShadow: "inset 0 0 0 1px $$outline",
203
+ color: "$$outlineText",
204
+ "&:hover:not(:disabled)": {
205
+ backgroundColor: "$$outlineHover"
206
+ },
207
+ "&:disabled": {
208
+ boxShadow: "inset 0 0 0 1px $$disabled",
209
+ color: "$$disabled"
210
+ }
211
+ },
212
+ transparent: {
213
+ backgroundColor: "transparent",
214
+ color: "$$outlineText",
215
+ "&:hover:not(:disabled)": {
216
+ backgroundColor: "$$outlineHover"
217
+ },
218
+ "&:disabled": {
219
+ color: "$$disabled"
220
+ }
221
+ }
222
+ },
223
+ icon: {
224
+ true: {}
225
+ }
226
+ },
227
+ compoundVariants: [
228
+ {
229
+ icon: !0,
230
+ size: "sm",
231
+ css: {
232
+ padding: "$1",
233
+ width: "1.75rem"
234
+ }
235
+ },
236
+ {
237
+ icon: !0,
238
+ size: "md",
239
+ css: {
240
+ padding: "$2",
241
+ width: "2.25rem"
242
+ }
243
+ },
16
244
  {
17
- open: o,
18
- onOpenChange: r,
245
+ icon: !0,
246
+ size: "lg",
247
+ css: {
248
+ padding: "$2",
249
+ width: "2.75rem"
250
+ }
251
+ }
252
+ ],
253
+ defaultVariants: {
254
+ variant: "outline",
255
+ color: "secondary",
256
+ size: "md"
257
+ }
258
+ }), M = u(
259
+ ({ children: o, disabled: e, isLoading: r, variant: a, color: i, ...s }, l) => (!i && a === "primary" && (i = "primary"), /* @__PURE__ */ c(
260
+ ko,
261
+ {
262
+ ref: l,
263
+ type: "button",
264
+ role: "button",
265
+ disabled: e || r,
266
+ variant: a,
267
+ color: i,
268
+ ...s,
269
+ children: [
270
+ o,
271
+ r && /* @__PURE__ */ t(vo, { color: "inherit" })
272
+ ]
273
+ }
274
+ ))
275
+ ), Co = n("div", {
276
+ padding: "$3",
277
+ borderRadius: "$md",
278
+ variants: {
279
+ color: {
280
+ warning: {
281
+ background: "$yellow200",
282
+ border: "1px solid $yellow400",
283
+ color: "$yellow900"
284
+ },
285
+ danger: {
286
+ background: "$red200",
287
+ border: "1px solid $red400",
288
+ color: "$red900"
289
+ },
290
+ info: {
291
+ background: "$blue200",
292
+ border: "1px solid $blue400",
293
+ color: "$blue900"
294
+ },
295
+ success: {
296
+ background: "$green200",
297
+ border: "1px solid $green400",
298
+ color: "$green900"
299
+ }
300
+ },
301
+ size: {
302
+ sm: {
303
+ fontSize: "$sm"
304
+ },
305
+ md: {
306
+ fontSize: "$md"
307
+ }
308
+ }
309
+ },
310
+ defaultVariants: {
311
+ color: "info",
312
+ size: "md"
313
+ }
314
+ }), te = u(
315
+ ({ children: o, ...e }, r) => /* @__PURE__ */ t(
316
+ Co,
317
+ {
318
+ ref: r,
319
+ role: "alert",
320
+ ...e,
321
+ children: o
322
+ }
323
+ )
324
+ ), wo = p({
325
+ "0%": { opacity: 0, transform: "translateY(0.5rem)" },
326
+ "100%": { opacity: 1, transform: "translateY(0)" }
327
+ }), So = p({
328
+ "0%": { opacity: 0, transform: "translateX(-0.5rem)" },
329
+ "100%": { opacity: 1, transform: "translateX(0)" }
330
+ }), Io = p({
331
+ "0%": { opacity: 0, transform: "translateY(-0.5rem)" },
332
+ "100%": { opacity: 1, transform: "translateY(0)" }
333
+ }), zo = p({
334
+ "0%": { opacity: 0, transform: "translateX(0.5rem)" },
335
+ "100%": { opacity: 1, transform: "translateX(0)" }
336
+ }), Ro = f({
337
+ backgroundColor: "white",
338
+ boxShadow: "$overlayCard",
339
+ borderRadius: "$sm",
340
+ overflow: "hidden",
341
+ zIndex: "$overlayCard",
342
+ // radix dialogs sets `pointer-events: none;` on body,
343
+ // so for other popups that uses `OverlayCard` to work
344
+ // we need to explicitly set this.
345
+ pointerEvents: "auto"
346
+ }), To = f({
347
+ animationDuration: "400ms",
348
+ animationTimingFunction: "cubic-bezier(0.16, 1, 0.3, 1)",
349
+ willChange: "transform, opacity",
350
+ '&[data-state="open"]': {
351
+ '&[data-side="top"]': { animationName: Io },
352
+ '&[data-side="right"]': { animationName: zo },
353
+ '&[data-side="bottom"]': { animationName: wo },
354
+ '&[data-side="left"]': { animationName: So }
355
+ }
356
+ }), P = n(
357
+ "div",
358
+ Ro,
359
+ To
360
+ ), d = n("div"), w = io(
361
+ {}
362
+ ), Do = ({
363
+ children: o,
364
+ offset: e,
365
+ open: r,
366
+ onOpenChange: a,
367
+ trigger: i = "click",
368
+ hoverDelay: s,
369
+ placement: l = "bottom",
370
+ role: $ = "dialog"
371
+ }) => {
372
+ const { refs: g, floatingStyles: x, context: h } = G({
373
+ open: r,
374
+ onOpenChange: a,
375
+ placement: l,
376
+ whileElementsMounted: eo,
377
+ middleware: [ro(e), to(), no()]
378
+ }), { isMounted: I, styles: z } = K(h, {
379
+ initial: ({ side: L }) => ({
380
+ opacity: 0,
381
+ transform: {
382
+ top: "translateY(-0.5rem)",
383
+ right: "translateX(0.5rem)",
384
+ bottom: "translateY(0.5rem)",
385
+ left: "translateX(-0.5rem)"
386
+ }[L]
387
+ })
388
+ }), O = U(h, { enabled: i === "click" }), N = q(h, {
389
+ enabled: i === "hover",
390
+ delay: s,
391
+ handleClose: J()
392
+ }), X = Q(h), Y = Z(h, { role: $ }), { getFloatingProps: R, getReferenceProps: T } = _([
393
+ O,
394
+ N,
395
+ X,
396
+ Y
397
+ ]), E = k(
398
+ () => ({
399
+ getFloatingProps: R,
400
+ getReferenceProps: T,
401
+ floatingStyles: x,
402
+ refs: g,
403
+ isMounted: I,
404
+ transitionStyles: z
405
+ }),
406
+ [
407
+ R,
408
+ T,
409
+ I,
410
+ g,
411
+ x,
412
+ z
413
+ ]
414
+ );
415
+ return /* @__PURE__ */ t(w.Provider, { value: E, children: o });
416
+ }, Bo = ({ children: o }) => {
417
+ const { getReferenceProps: e, refs: r } = B(w);
418
+ return /* @__PURE__ */ t(ao, { children: so(o) && lo(o, {
419
+ ref: r.setReference,
420
+ ...e()
421
+ }) });
422
+ }, Ho = ({ children: o, overlayCardProps: e }) => {
423
+ const {
424
+ getFloatingProps: r,
425
+ isMounted: a,
426
+ refs: i,
427
+ floatingStyles: s,
428
+ transitionStyles: l
429
+ } = B(w);
430
+ return a ? /* @__PURE__ */ t(oo, { children: /* @__PURE__ */ t(
431
+ d,
432
+ {
433
+ ref: i.setFloating,
434
+ style: s,
435
+ ...r(),
436
+ css: {
437
+ zIndex: "$overlayCard"
438
+ },
439
+ children: /* @__PURE__ */ t(P, { ...e, style: l, children: o })
440
+ }
441
+ ) }) : null;
442
+ }, ne = ({ children: o, content: e }) => {
443
+ const [r, a] = co(!1);
444
+ return /* @__PURE__ */ c(
445
+ Do,
446
+ {
447
+ open: r,
448
+ onOpenChange: a,
19
449
  trigger: "hover",
20
450
  placement: "top",
21
451
  offset: { mainAxis: 8 },
22
452
  role: "tooltip",
23
453
  children: [
24
- /* @__PURE__ */ a(p, { children: s }),
25
- /* @__PURE__ */ a(i, { overlayCardProps: {
454
+ /* @__PURE__ */ t(Bo, { children: o }),
455
+ /* @__PURE__ */ t(Ho, { overlayCardProps: {
26
456
  css: {
27
457
  background: "rgba(0,0,0, 0.9)",
28
458
  color: "#fff",
@@ -33,14 +463,465 @@ const h = ({ children: s, content: e }) => {
33
463
  ]
34
464
  }
35
465
  );
36
- }, I = ({
37
- label: s,
38
- css: e,
39
- error: o,
466
+ }, ae = n("span", {
467
+ flex: "0 0 auto",
468
+ display: "inline-flex",
469
+ padding: "$1 $2",
470
+ fontSize: "$xs",
471
+ fontWeight: "$medium",
472
+ lineHeight: "1",
473
+ whiteSpace: "nowrap",
474
+ borderRadius: "$sm",
475
+ overflow: "hidden",
476
+ variants: {
477
+ color: {
478
+ success: {
479
+ backgroundColor: "$green200",
480
+ color: "$green800"
481
+ },
482
+ warning: {
483
+ backgroundColor: "$yellow100",
484
+ color: "$yellow700"
485
+ },
486
+ danger: {
487
+ backgroundColor: "$red200",
488
+ color: "$red800"
489
+ },
490
+ primary: {
491
+ backgroundColor: "$blue200",
492
+ color: "$blue800"
493
+ },
494
+ secondary: {
495
+ backgroundColor: "$gray200",
496
+ color: "$gray800"
497
+ }
498
+ }
499
+ },
500
+ defaultVariants: {
501
+ color: "primary"
502
+ }
503
+ }), ie = n(y.Root, {
504
+ backgroundColor: "$gray50",
505
+ display: "flex",
506
+ alignItems: "center",
507
+ padding: "$1",
508
+ gap: "$1"
509
+ }), se = n(y.ToggleGroup, {
510
+ display: "flex",
511
+ gap: "$1",
512
+ alignItems: "center"
513
+ }), le = n(y.Separator, {
514
+ width: "1px",
515
+ height: "1.5rem",
516
+ my: "$1",
517
+ mx: "$1",
518
+ backgroundColor: "$border"
519
+ }), A = u(({ css: o, ...e }, r) => /* @__PURE__ */ t(
520
+ M,
521
+ {
522
+ ref: r,
523
+ icon: !0,
524
+ css: {
525
+ width: "auto",
526
+ "&[data-state='on']": {
527
+ backgroundColor: "$blue200",
528
+ color: "$blue800"
529
+ },
530
+ ...o
531
+ },
532
+ ...e
533
+ }
534
+ )), de = u(
535
+ ({ children: o, dropdown: e, ...r }, a) => /* @__PURE__ */ t(
536
+ y.Button,
537
+ {
538
+ asChild: !0,
539
+ ref: a,
540
+ children: /* @__PURE__ */ c(
541
+ A,
542
+ {
543
+ variant: "transparent",
544
+ color: "primary",
545
+ ...r,
546
+ children: [
547
+ o,
548
+ e && /* @__PURE__ */ t($o, {})
549
+ ]
550
+ }
551
+ )
552
+ }
553
+ )
554
+ ), ce = u(({
555
+ children: o,
556
+ value: e,
557
+ ...r
558
+ }, a) => /* @__PURE__ */ t(
559
+ y.ToggleItem,
560
+ {
561
+ value: e,
562
+ asChild: !0,
563
+ ref: a,
564
+ children: /* @__PURE__ */ t(
565
+ A,
566
+ {
567
+ variant: "transparent",
568
+ color: "primary",
569
+ icon: !0,
570
+ ...r,
571
+ children: o
572
+ }
573
+ )
574
+ }
575
+ )), $e = n("div", {
576
+ color: "$$cardText",
577
+ backgroundColor: "$$cardBackground",
578
+ borderRadius: "$md",
579
+ padding: "$4",
580
+ variants: {
581
+ variant: {
582
+ primary: {
583
+ $$cardBackground: "white",
584
+ $$cardText: "$text"
585
+ }
586
+ },
587
+ elevation: {
588
+ none: {
589
+ boxShadow: "none"
590
+ },
591
+ raised: {
592
+ boxShadow: "$md"
593
+ }
594
+ }
595
+ },
596
+ defaultVariants: {
597
+ variant: "primary",
598
+ elevation: "raised"
599
+ }
600
+ }), Fo = n("div", {
601
+ borderRadius: "$md",
602
+ padding: "$1",
603
+ border: "2px solid $blue100",
604
+ background: "white",
605
+ display: "flex",
606
+ alignItems: "center",
607
+ gap: "$1"
608
+ }), me = (o) => /* @__PURE__ */ t(Fo, { ...o }), ue = ({
609
+ children: o,
610
+ active: e = !1,
40
611
  ...r
41
- }) => /* @__PURE__ */ n(t, { css: e, children: [
42
- s && /* @__PURE__ */ a(
43
- t,
612
+ }) => /* @__PURE__ */ t(
613
+ M,
614
+ {
615
+ variant: "transparent",
616
+ color: "primary",
617
+ "data-active": e,
618
+ css: {
619
+ '&[aria-current="page"],&[data-active="true"]': {
620
+ background: "$blue100"
621
+ }
622
+ },
623
+ ...r,
624
+ children: o
625
+ }
626
+ ), Mo = n(b.Overlay, {
627
+ backgroundColor: "rgba(0, 0, 0, 0.7)",
628
+ position: "fixed",
629
+ zIndex: "$overlayCard",
630
+ inset: 0
631
+ }), Po = n(b.Content, {
632
+ backgroundColor: "white",
633
+ borderRadius: "$md",
634
+ position: "fixed",
635
+ zIndex: "$overlayCard",
636
+ top: "50%",
637
+ left: "50%",
638
+ transform: "translate(-50%, -50%)",
639
+ width: "auto",
640
+ maxWidth: "90wv",
641
+ minWidth: "600px",
642
+ maxHeight: "85vh",
643
+ padding: "$8",
644
+ "&:focus": { outline: "none" }
645
+ }), ge = ({
646
+ children: o,
647
+ open: e,
648
+ onOpenChange: r,
649
+ trigger: a,
650
+ css: i,
651
+ contentProps: s
652
+ }) => /* @__PURE__ */ c(b.Root, { open: e, onOpenChange: r, children: [
653
+ a && /* @__PURE__ */ t(b.Trigger, { asChild: !0, children: a }),
654
+ /* @__PURE__ */ c(b.Portal, { children: [
655
+ /* @__PURE__ */ t(Mo, {}),
656
+ /* @__PURE__ */ t(Po, { css: i, ...s, children: o })
657
+ ] })
658
+ ] }), pe = n("h2", {
659
+ fontSize: "$xl",
660
+ fontWeight: "$medium",
661
+ marginBottom: "$6"
662
+ }), he = n("div", {
663
+ display: "flex",
664
+ gap: "$2",
665
+ justifyContent: "flex-end",
666
+ background: "$gray100",
667
+ margin: "$6 -$8 -$8 -$8",
668
+ padding: "$4",
669
+ borderBottomRightRadius: "$md",
670
+ borderBottomLeftRadius: "$md"
671
+ }), be = n("div", {
672
+ display: "flex",
673
+ variants: {
674
+ direction: {
675
+ row: {
676
+ flexDirection: "row"
677
+ },
678
+ column: {
679
+ flexDirection: "column"
680
+ }
681
+ },
682
+ align: {
683
+ start: {
684
+ alignItems: "flex-start"
685
+ },
686
+ center: {
687
+ alignItems: "center"
688
+ }
689
+ },
690
+ gap: {
691
+ 0: { gap: 0 },
692
+ 1: { gap: "$1" },
693
+ 2: { gap: "$2" },
694
+ 3: { gap: "$3" },
695
+ 4: { gap: "$4" },
696
+ 5: { gap: "$5" },
697
+ 6: { gap: "$6" },
698
+ 7: { gap: "$7" },
699
+ 8: { gap: "$8" }
700
+ }
701
+ },
702
+ defaultVariants: {
703
+ direction: "column",
704
+ gap: 4
705
+ }
706
+ }), D = /* @__PURE__ */ new Map(), Ao = (o) => {
707
+ const e = D.get(o);
708
+ if (e)
709
+ return e;
710
+ let r = 0;
711
+ for (let $ = 0; $ < o.length; $++)
712
+ r = o.charCodeAt($) + ((r << 5) - r);
713
+ const l = `hsl(${r % 360}, 80%, 40%)`;
714
+ return D.set(o, l), l;
715
+ }, Wo = n("div", {
716
+ flex: "0 0 auto",
717
+ display: "inline-flex",
718
+ alignItems: "center",
719
+ justifyContent: "center",
720
+ color: "white",
721
+ borderRadius: "$full",
722
+ transition: "background-color 150ms",
723
+ userSelect: "none",
724
+ variants: {
725
+ size: {
726
+ xs: {
727
+ fontSize: "0.6rem",
728
+ width: "1.50rem",
729
+ height: "1.50rem"
730
+ },
731
+ sm: {
732
+ fontSize: "0.8rem",
733
+ width: "1.75rem",
734
+ height: "1.75rem"
735
+ },
736
+ md: {
737
+ fontSize: "0.9rem",
738
+ width: "2rem",
739
+ height: "2rem"
740
+ }
741
+ }
742
+ },
743
+ defaultVariants: {
744
+ size: "md"
745
+ }
746
+ }), fe = ({
747
+ css: o,
748
+ colorString: e,
749
+ ...r
750
+ }) => {
751
+ const a = k(
752
+ () => e ? Ao(e) : "$gray200",
753
+ [e]
754
+ );
755
+ return /* @__PURE__ */ t(Wo, { css: { backgroundColor: a, ...o }, ...r });
756
+ }, Vo = n(P, {
757
+ minWidth: "max(var(--radix-popper-anchor-width), 12rem)",
758
+ padding: "$1"
759
+ }), S = f({
760
+ padding: "$2 $2 $2 1.5rem",
761
+ fontSize: "$sm",
762
+ lineHeight: "1.25",
763
+ cursor: "pointer",
764
+ borderRadius: "$sm",
765
+ position: "relative",
766
+ color: "$primaryTextOnWhite",
767
+ display: "flex",
768
+ alignItems: "center",
769
+ ":focus-visisble": {
770
+ outline: "none"
771
+ },
772
+ "&[data-highlighted], &:hover": {
773
+ outline: "none",
774
+ backgroundColor: "$hoverDarker"
775
+ },
776
+ "&[data-disabled]": {
777
+ color: "$gray500",
778
+ "&:hover": {
779
+ backgroundColor: "transparent"
780
+ }
781
+ }
782
+ }), ye = ({
783
+ side: o = "bottom",
784
+ align: e = "center",
785
+ trigger: r,
786
+ children: a,
787
+ sideOffset: i,
788
+ modal: s
789
+ }) => /* @__PURE__ */ c(m.Root, { modal: s, children: [
790
+ /* @__PURE__ */ t(m.Trigger, { asChild: !0, children: r }),
791
+ /* @__PURE__ */ t(m.Portal, { children: /* @__PURE__ */ t(
792
+ m.Content,
793
+ {
794
+ asChild: !0,
795
+ side: o,
796
+ align: e,
797
+ collisionPadding: 10,
798
+ sideOffset: i,
799
+ children: /* @__PURE__ */ t(Vo, { children: a })
800
+ }
801
+ ) })
802
+ ] }), jo = n(m.ItemIndicator, {
803
+ position: "absolute",
804
+ left: 0,
805
+ top: 0,
806
+ bottom: 0,
807
+ width: "1.5rem",
808
+ display: "flex",
809
+ justifyContent: "center",
810
+ alignItems: "center"
811
+ }), xe = n(m.Separator, {
812
+ height: 1,
813
+ backgroundColor: "$gray200",
814
+ margin: 1
815
+ }), ve = n(m.Item, S), ke = n(m.Item, S, {
816
+ padding: "$2",
817
+ display: "flex",
818
+ alignItems: "center",
819
+ gap: "$2"
820
+ }), Oo = n(m.CheckboxItem, S), Ce = ({
821
+ value: o,
822
+ onChange: e,
823
+ children: r
824
+ }) => /* @__PURE__ */ c(
825
+ Oo,
826
+ {
827
+ checked: o,
828
+ onCheckedChange: e,
829
+ children: [
830
+ /* @__PURE__ */ t(jo, { children: /* @__PURE__ */ t(go, { size: "0.75rem" }) }),
831
+ r
832
+ ]
833
+ }
834
+ ), v = {
835
+ container: (o) => ({
836
+ ...o,
837
+ minWidth: "200px"
838
+ }),
839
+ control: (o, { isFocused: e }) => ({
840
+ ...o,
841
+ "&:hover": {},
842
+ border: e ? "1px solid var(--colors-blue300)" : "1px solid var(--colors-gray300)",
843
+ outline: "none",
844
+ borderRadius: "var(--radii-md)",
845
+ boxShadow: e ? "0 0 0 4px var(--colors-blue100)" : "none"
846
+ }),
847
+ menu: (o) => ({
848
+ ...o,
849
+ boxShadow: "var(--shadows-overlayCard)",
850
+ borderRadius: "var(--radii-md)",
851
+ border: "none",
852
+ padding: "var(--space-1)"
853
+ }),
854
+ option: (o, { isFocused: e, isSelected: r }) => ({
855
+ ...o,
856
+ background: e ? "var(--colors-gray100)" : r ? "var(--colors-blue100)" : "transparent",
857
+ "&:active": {
858
+ background: "var(--colors-gray200)"
859
+ },
860
+ borderRadius: "var(--radii-sm)",
861
+ color: "var(--colors-text)"
862
+ }),
863
+ menuList: (o) => ({
864
+ ...o,
865
+ padding: 0
866
+ }),
867
+ multiValueRemove: (o) => ({
868
+ ...o,
869
+ background: "transparent",
870
+ color: "var(--colors-text)",
871
+ "&:hover": {
872
+ background: "var(--colors-red200)",
873
+ color: "var(--colors-red800)"
874
+ }
875
+ }),
876
+ clearIndicator: (o) => ({
877
+ ...o,
878
+ paddingLeft: 0,
879
+ paddingRight: 0
880
+ }),
881
+ menuPortal: (o) => ({
882
+ ...o,
883
+ zIndex: "var(--zIndices-overlayCard)"
884
+ })
885
+ }, No = {
886
+ control: (o, e) => {
887
+ var r;
888
+ return {
889
+ ...(r = v.control) == null ? void 0 : r.call(v, o, e),
890
+ border: "1px solid var(--colors-red500)",
891
+ boxShadow: e.isFocused ? "0 0 0 4px var(--colors-red100)" : "none"
892
+ };
893
+ }
894
+ }, Xo = {
895
+ IndicatorSeparator: () => null
896
+ }, W = ({
897
+ styles: o,
898
+ components: e,
899
+ error: r,
900
+ ...a
901
+ }) => {
902
+ const i = k(
903
+ () => ({
904
+ ...v,
905
+ ...o,
906
+ ...r ? No : void 0
907
+ }),
908
+ [o, r]
909
+ ), s = k(
910
+ () => ({
911
+ ...Xo,
912
+ ...e
913
+ }),
914
+ [e]
915
+ );
916
+ return /* @__PURE__ */ t(po, { components: s, styles: i, ...a });
917
+ }, we = (o) => /* @__PURE__ */ t(W, { ...o, isSearchable: !0 }), Se = ({
918
+ label: o,
919
+ css: e,
920
+ error: r,
921
+ ...a
922
+ }) => /* @__PURE__ */ c(d, { css: e, children: [
923
+ o && /* @__PURE__ */ t(
924
+ d,
44
925
  {
45
926
  as: "label",
46
927
  css: {
@@ -48,60 +929,282 @@ const h = ({ children: s, content: e }) => {
48
929
  marginBottom: "$2",
49
930
  fontSize: "$md"
50
931
  },
51
- children: s
932
+ children: o
52
933
  }
53
934
  ),
54
- /* @__PURE__ */ a(
55
- m,
935
+ /* @__PURE__ */ t(
936
+ W,
56
937
  {
57
- ...r,
58
- error: o,
938
+ ...a,
939
+ error: r,
59
940
  isSearchable: !1,
60
941
  isMulti: !1
61
942
  }
62
943
  ),
63
- typeof o == "string" && /* @__PURE__ */ a(t, { css: { color: "$red600", fontSize: "$sm", marginTop: "$2" }, children: o })
64
- ] });
944
+ typeof r == "string" && /* @__PURE__ */ t(d, { css: { color: "$red600", fontSize: "$sm", marginTop: "$2" }, children: r })
945
+ ] }), V = f({
946
+ display: "block",
947
+ width: "100%",
948
+ padding: "0.5rem 0.75rem",
949
+ background: "transparent",
950
+ borderRadius: "none",
951
+ outline: "none",
952
+ border: "none",
953
+ fontSize: "$md",
954
+ "-webkit-appearance": "none",
955
+ "-moz-appearance": "none",
956
+ appearance: "none"
957
+ }), j = f({
958
+ display: "block",
959
+ width: "100%",
960
+ background: "#fff",
961
+ border: "1px solid $colors$gray300",
962
+ borderRadius: "$md",
963
+ outline: "none",
964
+ transition: "border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out",
965
+ "&:focus-within": {
966
+ border: "1px solid $colors$blue300",
967
+ boxShadow: "0 0 0 4px $colors$blue100",
968
+ background: "#fff"
969
+ },
970
+ variants: {
971
+ error: {
972
+ true: {
973
+ border: "1px solid $colors$red500",
974
+ "&:focus-within": {
975
+ border: "1px solid $colors$red500",
976
+ boxShadow: "0 0 0 4px $colors$red100"
977
+ }
978
+ }
979
+ }
980
+ }
981
+ }), Yo = n("input", V), Eo = n("div", j, {
982
+ display: "flex",
983
+ alignItems: "center",
984
+ gap: "$2",
985
+ width: "100%"
986
+ }), Ie = u(
987
+ ({ type: o = "text", label: e, error: r, style: a, css: i, suffix: s, id: l, ...$ }, g) => {
988
+ const x = C();
989
+ return l = l || x, /* @__PURE__ */ c(d, { css: i, children: [
990
+ e && /* @__PURE__ */ t(
991
+ d,
992
+ {
993
+ as: "label",
994
+ htmlFor: l,
995
+ css: {
996
+ display: "block",
997
+ marginBottom: "$2",
998
+ fontSize: "$md"
999
+ },
1000
+ children: e
1001
+ }
1002
+ ),
1003
+ /* @__PURE__ */ c(Eo, { error: !!r, children: [
1004
+ /* @__PURE__ */ t(
1005
+ Yo,
1006
+ {
1007
+ id: l,
1008
+ ref: g,
1009
+ type: o,
1010
+ "aria-invalid": r ? "true" : "false",
1011
+ ...$
1012
+ }
1013
+ ),
1014
+ s && /* @__PURE__ */ t(
1015
+ d,
1016
+ {
1017
+ css: {
1018
+ fontSize: "$sm",
1019
+ fontWeight: "$medium",
1020
+ marginRight: "$2"
1021
+ },
1022
+ children: s
1023
+ }
1024
+ ),
1025
+ r && /* @__PURE__ */ t(
1026
+ d,
1027
+ {
1028
+ as: H,
1029
+ css: { color: "$red600", marginRight: "$2" },
1030
+ size: 24
1031
+ }
1032
+ )
1033
+ ] }),
1034
+ typeof r == "string" && /* @__PURE__ */ t(d, { css: { color: "$red600", fontSize: "$sm", marginTop: "$2" }, children: r })
1035
+ ] });
1036
+ }
1037
+ ), Lo = n("textarea", V), Go = n("div", j, {
1038
+ display: "flex",
1039
+ alignItems: "center",
1040
+ gap: "$2",
1041
+ width: "100%"
1042
+ }), ze = u(
1043
+ ({ label: o, error: e, style: r, css: a, suffix: i, id: s, ...l }, $) => {
1044
+ const g = C();
1045
+ return s = s || g, /* @__PURE__ */ c(d, { css: a, children: [
1046
+ o && /* @__PURE__ */ t(
1047
+ d,
1048
+ {
1049
+ as: "label",
1050
+ htmlFor: s,
1051
+ css: {
1052
+ display: "block",
1053
+ marginBottom: "$2",
1054
+ fontSize: "$md"
1055
+ },
1056
+ children: o
1057
+ }
1058
+ ),
1059
+ /* @__PURE__ */ c(Go, { error: !!e, children: [
1060
+ /* @__PURE__ */ t(
1061
+ Lo,
1062
+ {
1063
+ id: s,
1064
+ ref: $,
1065
+ "aria-invalid": e ? "true" : "false",
1066
+ ...l
1067
+ }
1068
+ ),
1069
+ i && /* @__PURE__ */ t(
1070
+ d,
1071
+ {
1072
+ css: {
1073
+ fontSize: "$sm",
1074
+ fontWeight: "$medium",
1075
+ marginRight: "$2"
1076
+ },
1077
+ children: i
1078
+ }
1079
+ ),
1080
+ e && /* @__PURE__ */ t(
1081
+ d,
1082
+ {
1083
+ as: H,
1084
+ css: { color: "$red600", marginRight: "$2" },
1085
+ size: 24
1086
+ }
1087
+ )
1088
+ ] }),
1089
+ typeof e == "string" && /* @__PURE__ */ t(d, { css: { color: "$red600", fontSize: "$sm", marginTop: "$2" }, children: e })
1090
+ ] });
1091
+ }
1092
+ ), Ko = n(F.Root, {
1093
+ display: "flex",
1094
+ alignItems: "center",
1095
+ justifyContent: "center",
1096
+ gap: "$2",
1097
+ color: "#fff",
1098
+ border: "2px solid $blue600",
1099
+ backgroundColor: "transparent",
1100
+ borderRadius: "$sm",
1101
+ "&[data-state=checked], &[data-state=indeterminate]": {
1102
+ backgroundColor: "$blue500"
1103
+ },
1104
+ "&[data-disabled]": {
1105
+ borderColor: "$gray200",
1106
+ backgroundColor: "$gray100",
1107
+ color: "$gray400"
1108
+ },
1109
+ variants: {
1110
+ size: {
1111
+ sm: {
1112
+ width: "1.2rem",
1113
+ height: "1.2rem"
1114
+ },
1115
+ md: {
1116
+ width: "1.5rem",
1117
+ height: "1.5rem"
1118
+ },
1119
+ lg: {
1120
+ width: "2rem",
1121
+ height: "2rem"
1122
+ }
1123
+ }
1124
+ },
1125
+ defaultVariants: {
1126
+ size: "md"
1127
+ }
1128
+ }), Uo = n(F.Indicator, {
1129
+ "[data-icon]": {
1130
+ display: "none"
1131
+ },
1132
+ "&[data-state=checked] [data-icon=checked], &[data-state=indeterminate] [data-icon=indeterminate]": {
1133
+ display: "block"
1134
+ }
1135
+ }), qo = n("label", {
1136
+ flex: "0 1 auto",
1137
+ variants: {
1138
+ size: {
1139
+ sm: {
1140
+ fontSize: "$sm"
1141
+ },
1142
+ md: {
1143
+ fontSize: "$md"
1144
+ },
1145
+ lg: {
1146
+ fontSize: "$lg"
1147
+ }
1148
+ }
1149
+ },
1150
+ defaultVariants: {
1151
+ size: "md"
1152
+ }
1153
+ }), Re = ({
1154
+ id: o,
1155
+ size: e,
1156
+ label: r,
1157
+ ...a
1158
+ }) => {
1159
+ const i = C();
1160
+ return o = o || i, /* @__PURE__ */ c(d, { css: { display: "flex", alignItems: "center", gap: "$2" }, children: [
1161
+ /* @__PURE__ */ t(Ko, { id: o, size: e, ...a, children: /* @__PURE__ */ c(Uo, { children: [
1162
+ /* @__PURE__ */ t(mo, { "data-icon": "indeterminate" }),
1163
+ /* @__PURE__ */ t(uo, { "data-icon": "checked" })
1164
+ ] }) }),
1165
+ r && /* @__PURE__ */ t(qo, { htmlFor: o, size: e, children: r })
1166
+ ] });
1167
+ };
65
1168
  export {
66
- D as Alert,
67
- M as Avatar,
68
- $ as Badge,
69
- t as Box,
70
- k as Button,
1169
+ te as Alert,
1170
+ fe as Avatar,
1171
+ ae as Badge,
1172
+ d as Box,
1173
+ M as Button,
71
1174
  A as ButtonInToolbar,
72
- w as Card,
73
- O as Checkbox,
74
- P as Combobox,
75
- z as Dialog,
76
- j as DialogActions,
77
- N as DialogHeader,
78
- G as DropdownMenu,
79
- H as DropdownMenuCheckboxItem,
80
- R as DropdownMenuIconItem,
81
- q as DropdownMenuItem,
82
- E as DropdownMenuSeparator,
83
- J as MenuOverlayCard,
84
- K as NavBar,
85
- L as NavBarItem,
86
- Q as OverlayCard,
87
- l as Popover,
88
- i as PopoverContent,
89
- p as PopoverTrigger,
90
- I as Select,
91
- U as Spinner,
92
- V as Stack,
93
- W as TextArea,
94
- X as TextInput,
95
- Y as Toolbar,
96
- F as ToolbarButton,
97
- Z as ToolbarSeparator,
98
- _ as ToolbarToggleGroup,
99
- oo as ToolbarToggleItem,
100
- h as Tooltip,
101
- ao as css,
102
- so as getCssText,
103
- eo as globalCss,
104
- ro as keyframes,
105
- to as menuItemStyles,
106
- no as styled
1175
+ $e as Card,
1176
+ Re as Checkbox,
1177
+ we as Combobox,
1178
+ ge as Dialog,
1179
+ he as DialogActions,
1180
+ pe as DialogHeader,
1181
+ ye as DropdownMenu,
1182
+ Ce as DropdownMenuCheckboxItem,
1183
+ ke as DropdownMenuIconItem,
1184
+ ve as DropdownMenuItem,
1185
+ xe as DropdownMenuSeparator,
1186
+ Vo as MenuOverlayCard,
1187
+ me as NavBar,
1188
+ ue as NavBarItem,
1189
+ P as OverlayCard,
1190
+ Do as Popover,
1191
+ Ho as PopoverContent,
1192
+ Bo as PopoverTrigger,
1193
+ Se as Select,
1194
+ vo as Spinner,
1195
+ be as Stack,
1196
+ ze as TextArea,
1197
+ Ie as TextInput,
1198
+ ie as Toolbar,
1199
+ de as ToolbarButton,
1200
+ le as ToolbarSeparator,
1201
+ se as ToolbarToggleGroup,
1202
+ ce as ToolbarToggleItem,
1203
+ ne as Tooltip,
1204
+ f as css,
1205
+ Be as getCssText,
1206
+ He as globalCss,
1207
+ p as keyframes,
1208
+ S as menuItemStyles,
1209
+ n as styled
107
1210
  };