@arkitektbedriftene/fe-lib 0.3.22 → 0.3.23

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.
@@ -9,6 +9,7 @@ import { TableNode as Ot, TableRowNode as _t, TableCellNode as Rt } from "@lexic
9
9
  import { jsx as o, jsxs as C, Fragment as j } from "react/jsx-runtime";
10
10
  import { createContext as zt, useState as v, useRef as Z, useCallback as M, useContext as Bt, useEffect as z, useMemo as tt, useLayoutEffect as Dt } from "react";
11
11
  import { c as w, s as et, D as Ht, T as Ft, a as m, B as O, b as Pt, d as S, u as $t, e as At, f as Wt, g as jt, o as Kt, h as Ut, i as Yt, j as qt, F as Gt, O as Qt, k as Xt, l as Vt, S as Jt } from "./DropdownMenu-7a3b57bd.js";
12
+ import "react-select";
12
13
  import { LexicalComposer as Zt } from "@lexical/react/LexicalComposer.js";
13
14
  import { RichTextPlugin as te } from "@lexical/react/LexicalRichTextPlugin.js";
14
15
  import ee from "@lexical/react/LexicalErrorBoundary.js";
@@ -70,7 +71,7 @@ const se = ({
70
71
  tag: e
71
72
  }
72
73
  ), r.blur();
73
- }, vr = (t, r, e) => {
74
+ }, Cr = (t, r, e) => {
74
75
  let n = 0;
75
76
  const a = dt({
76
77
  nodes: r,
@@ -99,7 +100,7 @@ const se = ({
99
100
  return a.update(() => {
100
101
  s = ct(a);
101
102
  }), { html: s, trimCount: n };
102
- }, Cr = [
103
+ }, br = [
103
104
  xt,
104
105
  Et,
105
106
  V,
@@ -691,7 +692,7 @@ const Ue = () => /* @__PURE__ */ C(j, { children: [
691
692
  },
692
693
  children: /* @__PURE__ */ o(Jt, {})
693
694
  }
694
- ), br = ({
695
+ ), Tr = ({
695
696
  isLoading: t,
696
697
  children: r,
697
698
  placeholderText: e,
@@ -762,14 +763,14 @@ const Ue = () => /* @__PURE__ */ C(j, { children: [
762
763
  ) });
763
764
  };
764
765
  export {
765
- br as RichTextEditor,
766
+ Tr as RichTextEditor,
766
767
  ce as clearEditorState,
767
- Cr as defaultNodes,
768
+ br as defaultNodes,
768
769
  de as isEditorState,
769
770
  nt as isJSON,
770
771
  at as richTextContext,
771
772
  he as setStateFromPlainText,
772
- vr as stateToHTML,
773
+ Cr as stateToHTML,
773
774
  Me as useHasFocusWithin,
774
775
  ve as useRichTextContext
775
776
  };
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import { ReactSelect } from "./ReactSelect";
3
+ export type ComboboxProps = {
4
+ clearable?: boolean;
5
+ multi?: boolean;
6
+ } & Omit<React.ComponentProps<typeof ReactSelect>, "isMulti" | "isClearable" | "isSearchable">;
7
+ export declare const Combobox: ({ clearable, multi, ...props }: ComboboxProps) => JSX.Element;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import Select from "react-select";
3
+ export declare const ReactSelect: (props: React.ComponentProps<typeof Select>) => JSX.Element;
package/dist/ui/ui.d.ts CHANGED
@@ -11,3 +11,4 @@ export * from './components/Toolbar';
11
11
  export * from './components/Card';
12
12
  export * from './components/Menu/Menu';
13
13
  export * from './components/Menu/DropdownMenu';
14
+ export * from './components/Form/Combobox';
package/dist/ui.es.js CHANGED
@@ -1,63 +1,135 @@
1
- import { P as t, m as n, n as p } from "./DropdownMenu-7a3b57bd.js";
2
- import { A as x, t as y, B as I, r as M, v as S, C as w, D as B, z as D, a as h, y as O, x as P, M as k, O as A, S as $, k as j, T as z, l as q, b as G, d as E, c as F, q as H, p as J, w as K, s as L } from "./DropdownMenu-7a3b57bd.js";
3
- import { jsxs as l, jsx as o } from "react/jsx-runtime";
4
- import { useState as m } from "react";
1
+ import { P as t, m as n, n as l } from "./DropdownMenu-7a3b57bd.js";
2
+ import { A as k, t as M, B, r as D, v as P, C as R, D as O, z, a as A, y as $, x as j, M as L, O as q, S as G, k as V, T as W, l as E, b as H, d as J, c as K, q as N, p as Q, w as U, s as X } from "./DropdownMenu-7a3b57bd.js";
3
+ import { jsxs as d, jsx as e } from "react/jsx-runtime";
4
+ import { useState as i } from "react";
5
+ import p from "react-select";
5
6
  import "react-dom";
6
7
  import "@radix-ui/react-toolbar";
7
8
  import "./index.esm-d078f232.js";
8
9
  import "@radix-ui/react-dropdown-menu";
9
- const T = ({ children: r, content: a }) => {
10
- const [e, s] = m(!1);
11
- return /* @__PURE__ */ l(
10
+ const S = ({ children: o, content: r }) => {
11
+ const [a, s] = i(!1);
12
+ return /* @__PURE__ */ d(
12
13
  t,
13
14
  {
14
- open: e,
15
+ open: a,
15
16
  onOpenChange: s,
16
17
  trigger: "hover",
17
18
  placement: "top",
18
19
  offset: { mainAxis: 8 },
19
20
  role: "tooltip",
20
21
  children: [
21
- /* @__PURE__ */ o(n, { children: r }),
22
- /* @__PURE__ */ o(p, { overlayCardProps: {
22
+ /* @__PURE__ */ e(n, { children: o }),
23
+ /* @__PURE__ */ e(l, { overlayCardProps: {
23
24
  css: {
24
25
  background: "rgba(0,0,0, 0.9)",
25
26
  color: "#fff",
26
27
  fontSize: "$sm",
27
28
  padding: "$1 $2"
28
29
  }
29
- }, children: a })
30
+ }, children: r })
30
31
  ]
31
32
  }
32
33
  );
33
- };
34
+ }, c = {
35
+ container: (o) => ({
36
+ ...o,
37
+ minWidth: "200px"
38
+ }),
39
+ control: (o, { isFocused: r }) => ({
40
+ ...o,
41
+ "&:hover": {},
42
+ border: r ? "1px solid var(--colors-blue300)" : "1px solid var(--colors-gray300)",
43
+ outline: "none",
44
+ borderRadius: "var(--radii-sm)",
45
+ boxShadow: r ? "0 0 0 4px var(--colors-blue100)" : "none"
46
+ }),
47
+ menu: (o) => ({
48
+ ...o,
49
+ boxShadow: "var(--shadows-overlayCard)",
50
+ borderRadius: "var(--radii-md)",
51
+ border: "none",
52
+ padding: "var(--space-1)"
53
+ }),
54
+ option: (o, { isFocused: r, isSelected: a }) => ({
55
+ ...o,
56
+ background: r ? "var(--colors-gray100)" : a ? "var(--colors-blue100)" : "transparent",
57
+ "&:active": {
58
+ background: "var(--colors-gray200)"
59
+ },
60
+ borderRadius: "var(--radii-sm)",
61
+ color: "var(--colors-text)"
62
+ }),
63
+ menuList: (o) => ({
64
+ ...o,
65
+ padding: 0
66
+ }),
67
+ multiValueRemove: (o) => ({
68
+ ...o,
69
+ background: "transparent",
70
+ color: "var(--colors-text)",
71
+ "&:hover": {
72
+ background: "var(--colors-red200)",
73
+ color: "var(--colors-red800)"
74
+ }
75
+ }),
76
+ clearIndicator: (o) => ({
77
+ ...o,
78
+ paddingLeft: 0,
79
+ paddingRight: 0
80
+ }),
81
+ menuPortal: (o) => ({
82
+ ...o,
83
+ zIndex: "var(--zIndices-overlayCard)"
84
+ })
85
+ }, m = () => null, u = (o) => /* @__PURE__ */ e(
86
+ p,
87
+ {
88
+ components: { IndicatorSeparator: m },
89
+ styles: c,
90
+ ...o
91
+ }
92
+ ), I = ({
93
+ clearable: o = !0,
94
+ multi: r = !1,
95
+ ...a
96
+ }) => (o = r ? !1 : o, /* @__PURE__ */ e(
97
+ u,
98
+ {
99
+ ...a,
100
+ isClearable: o,
101
+ isMulti: r,
102
+ isSearchable: !0
103
+ }
104
+ ));
34
105
  export {
35
- x as Alert,
36
- y as Badge,
37
- I as Box,
38
- M as Button,
39
- S as ButtonInToolbar,
40
- w as Card,
41
- B as DropdownMenu,
42
- D as DropdownMenuCheckboxItem,
43
- h as DropdownMenuIconItem,
44
- O as DropdownMenuItem,
45
- P as DropdownMenuSeparator,
46
- k as MenuOverlayCard,
47
- A as OverlayCard,
106
+ k as Alert,
107
+ M as Badge,
108
+ B as Box,
109
+ D as Button,
110
+ P as ButtonInToolbar,
111
+ R as Card,
112
+ I as Combobox,
113
+ O as DropdownMenu,
114
+ z as DropdownMenuCheckboxItem,
115
+ A as DropdownMenuIconItem,
116
+ $ as DropdownMenuItem,
117
+ j as DropdownMenuSeparator,
118
+ L as MenuOverlayCard,
119
+ q as OverlayCard,
48
120
  t as Popover,
49
- p as PopoverContent,
121
+ l as PopoverContent,
50
122
  n as PopoverTrigger,
51
- $ as Spinner,
52
- j as Toolbar,
53
- z as ToolbarButton,
54
- q as ToolbarSeparator,
55
- G as ToolbarToggleGroup,
56
- E as ToolbarToggleItem,
57
- T as Tooltip,
58
- F as css,
59
- H as globalCss,
60
- J as keyframes,
61
- K as menuItemStyles,
62
- L as styled
123
+ G as Spinner,
124
+ V as Toolbar,
125
+ W as ToolbarButton,
126
+ E as ToolbarSeparator,
127
+ H as ToolbarToggleGroup,
128
+ J as ToolbarToggleItem,
129
+ S as Tooltip,
130
+ K as css,
131
+ N as globalCss,
132
+ Q as keyframes,
133
+ U as menuItemStyles,
134
+ X as styled
63
135
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkitektbedriftene/fe-lib",
3
- "version": "0.3.22",
3
+ "version": "0.3.23",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {