@arkitektbedriftene/fe-lib 0.4.37 → 0.4.38

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.
@@ -0,0 +1,136 @@
1
+ import { createStitches as l } from "@stitches/react";
2
+ let e = 9999;
3
+ const r = () => (e--, e), { styled: g, css: x, keyframes: d, globalCss: o, getCssText: s } = l({
4
+ theme: {
5
+ colors: {
6
+ gray50: "#F9FAFA",
7
+ gray100: "#EBEEEE",
8
+ gray200: "#CFD6D7",
9
+ gray300: "#B3BEC0",
10
+ gray400: "#97A6A8",
11
+ gray500: "#7C8E91",
12
+ gray600: "#627578",
13
+ gray700: "#4F5F61",
14
+ gray800: "#414D4F",
15
+ gray900: "#2C3435",
16
+ blue50: "#F7FBFB",
17
+ blue100: "#E3F0F2",
18
+ blue200: "#BADADF",
19
+ blue300: "#92C5CC",
20
+ blue400: "#67AEB8",
21
+ blue500: "#3C97A3",
22
+ blue600: "#1F7D8A",
23
+ blue700: "#19656F",
24
+ blue800: "#14525B",
25
+ blue900: "#0E383E",
26
+ yellow50: "#FDFAEF",
27
+ yellow100: "#F9EDCA",
28
+ yellow200: "#EFD27A",
29
+ yellow300: "#E5B626",
30
+ yellow400: "#C89E1C",
31
+ yellow500: "#AA8618",
32
+ yellow600: "#8C6E14",
33
+ yellow700: "#715910",
34
+ yellow800: "#5C490D",
35
+ yellow900: "#3E3109",
36
+ orange500: "#D1721C",
37
+ red50: "#FDF9F9",
38
+ red100: "#F7EBEB",
39
+ red200: "#EBCECD",
40
+ red300: "#DFB1B0",
41
+ red400: "#D39392",
42
+ red500: "#C67473",
43
+ red600: "#B85250",
44
+ red700: "#A92F2D",
45
+ red800: "#901F1E",
46
+ red900: "#631614",
47
+ green50: "#F8FAF9",
48
+ green100: "#E7F0EA",
49
+ green200: "#C5D9CB",
50
+ green300: "#A4C4AD",
51
+ green400: "#82AD8D",
52
+ green500: "#60976F",
53
+ green600: "#3C7F4E",
54
+ green700: "#296839",
55
+ green800: "#21552F",
56
+ green900: "#163920",
57
+ // Primary
58
+ primaryTextOnLightBg: "#194b58",
59
+ primaryBg: "$blue600",
60
+ primaryBgHover: "$blue700",
61
+ primaryTextOnWhite: "$blue600",
62
+ bodyGray: "$gray100",
63
+ hoverDarker: "hsla(214deg, 25%, 21%, 0.06)",
64
+ borderDarker: "hsla(214deg, 25%, 21%, 0.1)",
65
+ selectedDarker: "hsla(214deg, 25%, 21%, 0.06)",
66
+ selectedOnBodyGray: "hsl(214deg, 35%, 80%)",
67
+ darkGrayBg: "#1f2937",
68
+ border: "hsl(214deg, 25%, 80%)",
69
+ text: "#1f2937",
70
+ secondaryText: "$gray500",
71
+ focusRing: "hsla(214deg, 15%, 10%, 0.6)"
72
+ },
73
+ fontSizes: {
74
+ xs: "0.75rem",
75
+ // 12px
76
+ sm: "0.875rem",
77
+ // 14px
78
+ md: "1rem",
79
+ // 16px
80
+ lg: "1.125rem",
81
+ // 18px
82
+ xl: "1.25rem",
83
+ // 20px
84
+ "2xl": "1.5rem",
85
+ // 24px
86
+ "3xl": "1.875rem"
87
+ // 30px
88
+ },
89
+ fontWeights: {
90
+ normal: "var(--ui-font-weight-normal)",
91
+ medium: "var(--ui-font-weight-semibold)",
92
+ bold: "var(--ui-font-weight-bold)"
93
+ },
94
+ space: {
95
+ 1: "0.25rem",
96
+ 2: "0.5rem",
97
+ 3: "0.75rem",
98
+ 4: "1rem",
99
+ 6: "1.5rem",
100
+ 8: "2rem"
101
+ },
102
+ shadows: {
103
+ xs: "0 1px 2px 0 rgba(0, 0, 0, 0.05)",
104
+ sm: "0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",
105
+ md: "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",
106
+ lg: "0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",
107
+ overlayCard: "0 5px 50px 0px rgb(0 0 0 / 0.15), 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)"
108
+ },
109
+ radii: {
110
+ xs: "0.125rem",
111
+ sm: "0.25rem",
112
+ md: "0.5rem",
113
+ mdmd: "calc(0.5rem - 0.125rem)",
114
+ full: "9999px"
115
+ },
116
+ zIndices: {
117
+ /**
118
+ * By using createLayerBelow() we can order the list of layers.
119
+ * Layers higher up will be on top of layers lower down.
120
+ */
121
+ toast: r(),
122
+ overlayCard: r()
123
+ }
124
+ },
125
+ media: {
126
+ lg: "(min-width: 1200px)",
127
+ print: "print"
128
+ }
129
+ });
130
+ export {
131
+ s as a,
132
+ x as c,
133
+ o as g,
134
+ d as k,
135
+ g as s
136
+ };
package/dist/ui.es.js CHANGED
@@ -1,15 +1,16 @@
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";
1
+ import { k as p, s as n, c as f } from "./stitches.config-00c23cdb.js";
2
+ import { a as He, g as Fe } from "./stitches.config-00c23cdb.js";
3
+ import { jsx as t, jsxs as c, Fragment as G } from "react/jsx-runtime";
4
+ import { forwardRef as u, createContext as K, useMemo as k, useContext as B, isValidElement as U, cloneElement as q, useState as J, useId as C } from "react";
5
+ import { useFloating as Q, autoUpdate as Z, offset as _, flip as oo, shift as eo, useTransitionStyles as ro, useClick as to, useHover as no, safePolygon as ao, useDismiss as io, useRole as so, useInteractions as lo, FloatingPortal as co } from "@floating-ui/react";
5
6
  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 { b as $o, c as mo, d as uo } from "./index.esm-ab03d8db.js";
7
8
  import * as b from "@radix-ui/react-dialog";
8
9
  import * as m from "@radix-ui/react-dropdown-menu";
9
- import { f as go, g as H } from "./index.esm-e4db0c1f.js";
10
+ import { f as go, g as H } from "./index.esm-67eba761.js";
10
11
  import po from "react-select";
11
12
  import * as F from "@radix-ui/react-checkbox";
12
- import "react-dom";
13
+ import "@stitches/react";
13
14
  const ho = p({
14
15
  "0%": {
15
16
  transform: "rotate(0)"
@@ -311,7 +312,7 @@ const ho = p({
311
312
  color: "info",
312
313
  size: "md"
313
314
  }
314
- }), te = u(
315
+ }), ne = u(
315
316
  ({ children: o, ...e }, r) => /* @__PURE__ */ t(
316
317
  Co,
317
318
  {
@@ -357,7 +358,7 @@ const ho = p({
357
358
  "div",
358
359
  Ro,
359
360
  To
360
- ), d = n("div"), w = io(
361
+ ), d = n("div"), w = K(
361
362
  {}
362
363
  ), Do = ({
363
364
  children: o,
@@ -369,13 +370,13 @@ const ho = p({
369
370
  placement: l = "bottom",
370
371
  role: $ = "dialog"
371
372
  }) => {
372
- const { refs: g, floatingStyles: x, context: h } = G({
373
+ const { refs: g, floatingStyles: x, context: h } = Q({
373
374
  open: r,
374
375
  onOpenChange: a,
375
376
  placement: l,
376
- whileElementsMounted: eo,
377
- middleware: [ro(e), to(), no()]
378
- }), { isMounted: I, styles: z } = K(h, {
377
+ whileElementsMounted: Z,
378
+ middleware: [_(e), oo(), eo()]
379
+ }), { isMounted: I, styles: z } = ro(h, {
379
380
  initial: ({ side: L }) => ({
380
381
  opacity: 0,
381
382
  transform: {
@@ -385,12 +386,12 @@ const ho = p({
385
386
  left: "translateX(-0.5rem)"
386
387
  }[L]
387
388
  })
388
- }), O = U(h, { enabled: i === "click" }), N = q(h, {
389
+ }), j = to(h, { enabled: i === "click" }), N = no(h, {
389
390
  enabled: i === "hover",
390
391
  delay: s,
391
- handleClose: J()
392
- }), X = Q(h), Y = Z(h, { role: $ }), { getFloatingProps: R, getReferenceProps: T } = _([
393
- O,
392
+ handleClose: ao()
393
+ }), X = io(h), Y = so(h, { role: $ }), { getFloatingProps: R, getReferenceProps: T } = lo([
394
+ j,
394
395
  N,
395
396
  X,
396
397
  Y
@@ -415,7 +416,7 @@ const ho = p({
415
416
  return /* @__PURE__ */ t(w.Provider, { value: E, children: o });
416
417
  }, Bo = ({ children: o }) => {
417
418
  const { getReferenceProps: e, refs: r } = B(w);
418
- return /* @__PURE__ */ t(ao, { children: so(o) && lo(o, {
419
+ return /* @__PURE__ */ t(G, { children: U(o) && q(o, {
419
420
  ref: r.setReference,
420
421
  ...e()
421
422
  }) });
@@ -427,7 +428,7 @@ const ho = p({
427
428
  floatingStyles: s,
428
429
  transitionStyles: l
429
430
  } = B(w);
430
- return a ? /* @__PURE__ */ t(oo, { children: /* @__PURE__ */ t(
431
+ return a ? /* @__PURE__ */ t(co, { children: /* @__PURE__ */ t(
431
432
  d,
432
433
  {
433
434
  ref: i.setFloating,
@@ -439,8 +440,8 @@ const ho = p({
439
440
  children: /* @__PURE__ */ t(P, { ...e, style: l, children: o })
440
441
  }
441
442
  ) }) : null;
442
- }, ne = ({ children: o, content: e }) => {
443
- const [r, a] = co(!1);
443
+ }, ae = ({ children: o, content: e }) => {
444
+ const [r, a] = J(!1);
444
445
  return /* @__PURE__ */ c(
445
446
  Do,
446
447
  {
@@ -463,7 +464,7 @@ const ho = p({
463
464
  ]
464
465
  }
465
466
  );
466
- }, ae = n("span", {
467
+ }, ie = n("span", {
467
468
  flex: "0 0 auto",
468
469
  display: "inline-flex",
469
470
  padding: "$1 $2",
@@ -500,17 +501,17 @@ const ho = p({
500
501
  defaultVariants: {
501
502
  color: "primary"
502
503
  }
503
- }), ie = n(y.Root, {
504
+ }), se = n(y.Root, {
504
505
  backgroundColor: "$gray50",
505
506
  display: "flex",
506
507
  alignItems: "center",
507
508
  padding: "$1",
508
509
  gap: "$1"
509
- }), se = n(y.ToggleGroup, {
510
+ }), le = n(y.ToggleGroup, {
510
511
  display: "flex",
511
512
  gap: "$1",
512
513
  alignItems: "center"
513
- }), le = n(y.Separator, {
514
+ }), de = n(y.Separator, {
514
515
  width: "1px",
515
516
  height: "1.5rem",
516
517
  my: "$1",
@@ -531,7 +532,7 @@ const ho = p({
531
532
  },
532
533
  ...e
533
534
  }
534
- )), de = u(
535
+ )), ce = u(
535
536
  ({ children: o, dropdown: e, ...r }, a) => /* @__PURE__ */ t(
536
537
  y.Button,
537
538
  {
@@ -551,7 +552,7 @@ const ho = p({
551
552
  )
552
553
  }
553
554
  )
554
- ), ce = u(({
555
+ ), $e = u(({
555
556
  children: o,
556
557
  value: e,
557
558
  ...r
@@ -572,7 +573,7 @@ const ho = p({
572
573
  }
573
574
  )
574
575
  }
575
- )), $e = n("div", {
576
+ )), me = n("div", {
576
577
  color: "$$cardText",
577
578
  backgroundColor: "$$cardBackground",
578
579
  borderRadius: "$md",
@@ -605,7 +606,7 @@ const ho = p({
605
606
  display: "flex",
606
607
  alignItems: "center",
607
608
  gap: "$1"
608
- }), me = (o) => /* @__PURE__ */ t(Fo, { ...o }), ue = ({
609
+ }), ue = (o) => /* @__PURE__ */ t(Fo, { ...o }), ge = ({
609
610
  children: o,
610
611
  active: e = !1,
611
612
  ...r
@@ -642,7 +643,7 @@ const ho = p({
642
643
  maxHeight: "85vh",
643
644
  padding: "$8",
644
645
  "&:focus": { outline: "none" }
645
- }), ge = ({
646
+ }), pe = ({
646
647
  children: o,
647
648
  open: e,
648
649
  onOpenChange: r,
@@ -655,11 +656,11 @@ const ho = p({
655
656
  /* @__PURE__ */ t(Mo, {}),
656
657
  /* @__PURE__ */ t(Po, { css: i, ...s, children: o })
657
658
  ] })
658
- ] }), pe = n("h2", {
659
+ ] }), he = n("h2", {
659
660
  fontSize: "$xl",
660
661
  fontWeight: "$medium",
661
662
  marginBottom: "$6"
662
- }), he = n("div", {
663
+ }), be = n("div", {
663
664
  display: "flex",
664
665
  gap: "$2",
665
666
  justifyContent: "flex-end",
@@ -668,7 +669,7 @@ const ho = p({
668
669
  padding: "$4",
669
670
  borderBottomRightRadius: "$md",
670
671
  borderBottomLeftRadius: "$md"
671
- }), be = n("div", {
672
+ }), fe = n("div", {
672
673
  display: "flex",
673
674
  variants: {
674
675
  direction: {
@@ -743,7 +744,7 @@ const ho = p({
743
744
  defaultVariants: {
744
745
  size: "md"
745
746
  }
746
- }), fe = ({
747
+ }), ye = ({
747
748
  css: o,
748
749
  colorString: e,
749
750
  ...r
@@ -779,7 +780,7 @@ const ho = p({
779
780
  backgroundColor: "transparent"
780
781
  }
781
782
  }
782
- }), ye = ({
783
+ }), xe = ({
783
784
  side: o = "bottom",
784
785
  align: e = "center",
785
786
  trigger: r,
@@ -799,7 +800,7 @@ const ho = p({
799
800
  children: /* @__PURE__ */ t(Vo, { children: a })
800
801
  }
801
802
  ) })
802
- ] }), jo = n(m.ItemIndicator, {
803
+ ] }), Oo = n(m.ItemIndicator, {
803
804
  position: "absolute",
804
805
  left: 0,
805
806
  top: 0,
@@ -808,26 +809,26 @@ const ho = p({
808
809
  display: "flex",
809
810
  justifyContent: "center",
810
811
  alignItems: "center"
811
- }), xe = n(m.Separator, {
812
+ }), ve = n(m.Separator, {
812
813
  height: 1,
813
814
  backgroundColor: "$gray200",
814
815
  margin: 1
815
- }), ve = n(m.Item, S), ke = n(m.Item, S, {
816
+ }), ke = n(m.Item, S), Ce = n(m.Item, S, {
816
817
  padding: "$2",
817
818
  display: "flex",
818
819
  alignItems: "center",
819
820
  gap: "$2"
820
- }), Oo = n(m.CheckboxItem, S), Ce = ({
821
+ }), jo = n(m.CheckboxItem, S), we = ({
821
822
  value: o,
822
823
  onChange: e,
823
824
  children: r
824
825
  }) => /* @__PURE__ */ c(
825
- Oo,
826
+ jo,
826
827
  {
827
828
  checked: o,
828
829
  onCheckedChange: e,
829
830
  children: [
830
- /* @__PURE__ */ t(jo, { children: /* @__PURE__ */ t(go, { size: "0.75rem" }) }),
831
+ /* @__PURE__ */ t(Oo, { children: /* @__PURE__ */ t(go, { size: "0.75rem" }) }),
831
832
  r
832
833
  ]
833
834
  }
@@ -914,7 +915,7 @@ const ho = p({
914
915
  [e]
915
916
  );
916
917
  return /* @__PURE__ */ t(po, { components: s, styles: i, ...a });
917
- }, we = (o) => /* @__PURE__ */ t(W, { ...o, isSearchable: !0 }), Se = ({
918
+ }, Se = (o) => /* @__PURE__ */ t(W, { ...o, isSearchable: !0 }), Ie = ({
918
919
  label: o,
919
920
  css: e,
920
921
  error: r,
@@ -954,7 +955,7 @@ const ho = p({
954
955
  "-webkit-appearance": "none",
955
956
  "-moz-appearance": "none",
956
957
  appearance: "none"
957
- }), j = f({
958
+ }), O = f({
958
959
  display: "block",
959
960
  width: "100%",
960
961
  background: "#fff",
@@ -978,12 +979,12 @@ const ho = p({
978
979
  }
979
980
  }
980
981
  }
981
- }), Yo = n("input", V), Eo = n("div", j, {
982
+ }), Yo = n("input", V), Eo = n("div", O, {
982
983
  display: "flex",
983
984
  alignItems: "center",
984
985
  gap: "$2",
985
986
  width: "100%"
986
- }), Ie = u(
987
+ }), ze = u(
987
988
  ({ type: o = "text", label: e, error: r, style: a, css: i, suffix: s, id: l, ...$ }, g) => {
988
989
  const x = C();
989
990
  return l = l || x, /* @__PURE__ */ c(d, { css: i, children: [
@@ -1034,12 +1035,12 @@ const ho = p({
1034
1035
  typeof r == "string" && /* @__PURE__ */ t(d, { css: { color: "$red600", fontSize: "$sm", marginTop: "$2" }, children: r })
1035
1036
  ] });
1036
1037
  }
1037
- ), Lo = n("textarea", V), Go = n("div", j, {
1038
+ ), Lo = n("textarea", V), Go = n("div", O, {
1038
1039
  display: "flex",
1039
1040
  alignItems: "center",
1040
1041
  gap: "$2",
1041
1042
  width: "100%"
1042
- }), ze = u(
1043
+ }), Re = u(
1043
1044
  ({ label: o, error: e, style: r, css: a, suffix: i, id: s, ...l }, $) => {
1044
1045
  const g = C();
1045
1046
  return s = s || g, /* @__PURE__ */ c(d, { css: a, children: [
@@ -1150,7 +1151,7 @@ const ho = p({
1150
1151
  defaultVariants: {
1151
1152
  size: "md"
1152
1153
  }
1153
- }), Re = ({
1154
+ }), Te = ({
1154
1155
  id: o,
1155
1156
  size: e,
1156
1157
  label: r,
@@ -1166,44 +1167,44 @@ const ho = p({
1166
1167
  ] });
1167
1168
  };
1168
1169
  export {
1169
- te as Alert,
1170
- fe as Avatar,
1171
- ae as Badge,
1170
+ ne as Alert,
1171
+ ye as Avatar,
1172
+ ie as Badge,
1172
1173
  d as Box,
1173
1174
  M as Button,
1174
1175
  A as ButtonInToolbar,
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,
1176
+ me as Card,
1177
+ Te as Checkbox,
1178
+ Se as Combobox,
1179
+ pe as Dialog,
1180
+ be as DialogActions,
1181
+ he as DialogHeader,
1182
+ xe as DropdownMenu,
1183
+ we as DropdownMenuCheckboxItem,
1184
+ Ce as DropdownMenuIconItem,
1185
+ ke as DropdownMenuItem,
1186
+ ve as DropdownMenuSeparator,
1186
1187
  Vo as MenuOverlayCard,
1187
- me as NavBar,
1188
- ue as NavBarItem,
1188
+ ue as NavBar,
1189
+ ge as NavBarItem,
1189
1190
  P as OverlayCard,
1190
1191
  Do as Popover,
1191
1192
  Ho as PopoverContent,
1192
1193
  Bo as PopoverTrigger,
1193
- Se as Select,
1194
+ Ie as Select,
1194
1195
  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,
1196
+ fe as Stack,
1197
+ Re as TextArea,
1198
+ ze as TextInput,
1199
+ se as Toolbar,
1200
+ ce as ToolbarButton,
1201
+ de as ToolbarSeparator,
1202
+ le as ToolbarToggleGroup,
1203
+ $e as ToolbarToggleItem,
1204
+ ae as Tooltip,
1204
1205
  f as css,
1205
- Be as getCssText,
1206
- He as globalCss,
1206
+ He as getCssText,
1207
+ Fe as globalCss,
1207
1208
  p as keyframes,
1208
1209
  S as menuItemStyles,
1209
1210
  n as styled
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkitektbedriftene/fe-lib",
3
- "version": "0.4.37",
3
+ "version": "0.4.38",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {