@arkitektbedriftene/fe-lib 0.4.17 → 0.4.18

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.
@@ -11,7 +11,7 @@ import { HeadingNode as le, QuoteNode as se, $isHeadingNode as ce, $createHeadin
11
11
  import { TableNode as he, TableRowNode as pe, TableCellNode as ge, INSERT_TABLE_COMMAND as fe, $getTableCellNodeFromLexicalNode as me, $deleteTableColumn__EXPERIMENTAL as ke, $deleteTableRow__EXPERIMENTAL as be, $insertTableColumn__EXPERIMENTAL as ct, $insertTableRow__EXPERIMENTAL as dt } from "@lexical/table";
12
12
  import { jsx as n, jsxs as f, Fragment as Y } from "react/jsx-runtime";
13
13
  import { createContext as ve, useState as b, useRef as et, useCallback as v, useContext as Ce, useEffect as N, useMemo as Lt, useLayoutEffect as Me } from "react";
14
- import { c as O, s as Tt, D as rt, T as Nt, a as M, B as P, b as yt, d as z, u as nt, e as xt, f as Le, g as Te, o as Et, h as Ne, i as St, j as wt, F as Rt, O as It, k as ye, l as xe, S as Ee, m as $, n as I, p as ut, q as Se, N as we, r as ht, t as Re, v as zt, C as Ie, w as ze, x as _e } from "./Checkbox-22bb995a.js";
14
+ import { c as O, s as Tt, D as rt, T as Nt, a as M, B as P, b as yt, d as z, u as nt, e as xt, f as Le, g as Te, o as Et, h as Ne, i as St, j as wt, F as Rt, O as It, k as ye, l as xe, S as Ee, m as $, n as I, p as ut, q as Se, N as we, r as ht, t as Re, v as zt, C as Ie, w as ze, x as _e } from "./Checkbox-a342242a.js";
15
15
  import "react-select";
16
16
  import { LexicalComposer as $e } from "@lexical/react/LexicalComposer.js";
17
17
  import { RichTextPlugin as Oe } from "@lexical/react/LexicalRichTextPlugin.js";
@@ -1,3 +1,97 @@
1
1
  /// <reference types="react" />
2
- import Select from "react-select";
3
- export declare const ReactSelect: ({ styles, components, ...props }: React.ComponentProps<typeof Select>) => JSX.Element;
2
+ import Select, { type StylesConfig } from "react-select";
3
+ export declare const ReactSelect: ({ styles, components, error, ...props }: Omit<Pick<import("react-select/dist/declarations/src/Select").Props<unknown, boolean, import("react-select").GroupBase<unknown>>, "form" | "value" | "theme" | "onBlur" | "className" | "id" | "aria-errormessage" | "aria-invalid" | "aria-label" | "aria-labelledby" | "onFocus" | "onChange" | "onKeyDown" | "name" | "autoFocus" | "ariaLiveMessages" | "classNamePrefix" | "delimiter" | "formatOptionLabel" | "hideSelectedOptions" | "inputValue" | "inputId" | "instanceId" | "isClearable" | "isOptionSelected" | "menuPortalTarget" | "onInputChange" | "onMenuOpen" | "onMenuClose" | "onMenuScrollToTop" | "onMenuScrollToBottom" | "required"> & {
4
+ isLoading?: boolean | undefined;
5
+ placeholder?: import("react").ReactNode;
6
+ tabIndex?: number | undefined;
7
+ 'aria-live'?: "off" | "assertive" | "polite" | undefined;
8
+ options?: import("react-select").OptionsOrGroups<unknown, import("react-select").GroupBase<unknown>> | undefined;
9
+ backspaceRemovesValue?: boolean | undefined;
10
+ blurInputOnSelect?: boolean | undefined;
11
+ captureMenuScroll?: boolean | undefined;
12
+ classNames?: import("react-select").ClassNamesConfig<unknown, boolean, import("react-select").GroupBase<unknown>> | undefined;
13
+ closeMenuOnSelect?: boolean | undefined;
14
+ closeMenuOnScroll?: boolean | ((event: Event) => boolean) | undefined;
15
+ components?: Partial<import("react-select/dist/declarations/src/components").SelectComponents<unknown, boolean, import("react-select").GroupBase<unknown>>> | undefined;
16
+ controlShouldRenderValue?: boolean | undefined;
17
+ escapeClearsValue?: boolean | undefined;
18
+ filterOption?: ((option: import("react-select/dist/declarations/src/filters").FilterOptionOption<unknown>, inputValue: string) => boolean) | null | undefined;
19
+ formatGroupLabel?: ((group: import("react-select").GroupBase<unknown>) => import("react").ReactNode) | undefined;
20
+ getOptionLabel?: import("react-select").GetOptionLabel<unknown> | undefined;
21
+ getOptionValue?: import("react-select").GetOptionValue<unknown> | undefined;
22
+ isDisabled?: boolean | undefined;
23
+ isOptionDisabled?: ((option: unknown, selectValue: import("react-select").Options<unknown>) => boolean) | undefined;
24
+ isMulti?: boolean | undefined;
25
+ isRtl?: boolean | undefined;
26
+ isSearchable?: boolean | undefined;
27
+ loadingMessage?: ((obj: {
28
+ inputValue: string;
29
+ }) => import("react").ReactNode) | undefined;
30
+ minMenuHeight?: number | undefined;
31
+ maxMenuHeight?: number | undefined;
32
+ menuIsOpen?: boolean | undefined;
33
+ menuPlacement?: import("react-select").MenuPlacement | undefined;
34
+ menuPosition?: import("react-select").MenuPosition | undefined;
35
+ menuShouldBlockScroll?: boolean | undefined;
36
+ menuShouldScrollIntoView?: boolean | undefined;
37
+ noOptionsMessage?: ((obj: {
38
+ inputValue: string;
39
+ }) => import("react").ReactNode) | undefined;
40
+ openMenuOnFocus?: boolean | undefined;
41
+ openMenuOnClick?: boolean | undefined;
42
+ pageSize?: number | undefined;
43
+ screenReaderStatus?: ((obj: {
44
+ count: number;
45
+ }) => string) | undefined;
46
+ styles?: StylesConfig<unknown, boolean, import("react-select").GroupBase<unknown>> | undefined;
47
+ tabSelectsValue?: boolean | undefined;
48
+ unstyled?: boolean | undefined;
49
+ } & {}, "value" | "onChange" | "inputValue" | "menuIsOpen" | "onInputChange" | "onMenuOpen" | "onMenuClose"> & Partial<Pick<import("react-select/dist/declarations/src/Select").Props<unknown, boolean, import("react-select").GroupBase<unknown>>, "form" | "value" | "theme" | "onBlur" | "className" | "id" | "aria-errormessage" | "aria-invalid" | "aria-label" | "aria-labelledby" | "onFocus" | "onChange" | "onKeyDown" | "name" | "autoFocus" | "ariaLiveMessages" | "classNamePrefix" | "delimiter" | "formatOptionLabel" | "hideSelectedOptions" | "inputValue" | "inputId" | "instanceId" | "isClearable" | "isOptionSelected" | "menuPortalTarget" | "onInputChange" | "onMenuOpen" | "onMenuClose" | "onMenuScrollToTop" | "onMenuScrollToBottom" | "required"> & {
50
+ isLoading?: boolean | undefined;
51
+ placeholder?: import("react").ReactNode;
52
+ tabIndex?: number | undefined;
53
+ 'aria-live'?: "off" | "assertive" | "polite" | undefined;
54
+ options?: import("react-select").OptionsOrGroups<unknown, import("react-select").GroupBase<unknown>> | undefined;
55
+ backspaceRemovesValue?: boolean | undefined;
56
+ blurInputOnSelect?: boolean | undefined;
57
+ captureMenuScroll?: boolean | undefined;
58
+ classNames?: import("react-select").ClassNamesConfig<unknown, boolean, import("react-select").GroupBase<unknown>> | undefined;
59
+ closeMenuOnSelect?: boolean | undefined;
60
+ closeMenuOnScroll?: boolean | ((event: Event) => boolean) | undefined;
61
+ components?: Partial<import("react-select/dist/declarations/src/components").SelectComponents<unknown, boolean, import("react-select").GroupBase<unknown>>> | undefined;
62
+ controlShouldRenderValue?: boolean | undefined;
63
+ escapeClearsValue?: boolean | undefined;
64
+ filterOption?: ((option: import("react-select/dist/declarations/src/filters").FilterOptionOption<unknown>, inputValue: string) => boolean) | null | undefined;
65
+ formatGroupLabel?: ((group: import("react-select").GroupBase<unknown>) => import("react").ReactNode) | undefined;
66
+ getOptionLabel?: import("react-select").GetOptionLabel<unknown> | undefined;
67
+ getOptionValue?: import("react-select").GetOptionValue<unknown> | undefined;
68
+ isDisabled?: boolean | undefined;
69
+ isOptionDisabled?: ((option: unknown, selectValue: import("react-select").Options<unknown>) => boolean) | undefined;
70
+ isMulti?: boolean | undefined;
71
+ isRtl?: boolean | undefined;
72
+ isSearchable?: boolean | undefined;
73
+ loadingMessage?: ((obj: {
74
+ inputValue: string;
75
+ }) => import("react").ReactNode) | undefined;
76
+ minMenuHeight?: number | undefined;
77
+ maxMenuHeight?: number | undefined;
78
+ menuIsOpen?: boolean | undefined;
79
+ menuPlacement?: import("react-select").MenuPlacement | undefined;
80
+ menuPosition?: import("react-select").MenuPosition | undefined;
81
+ menuShouldBlockScroll?: boolean | undefined;
82
+ menuShouldScrollIntoView?: boolean | undefined;
83
+ noOptionsMessage?: ((obj: {
84
+ inputValue: string;
85
+ }) => import("react").ReactNode) | undefined;
86
+ openMenuOnFocus?: boolean | undefined;
87
+ openMenuOnClick?: boolean | undefined;
88
+ pageSize?: number | undefined;
89
+ screenReaderStatus?: ((obj: {
90
+ count: number;
91
+ }) => string) | undefined;
92
+ styles?: StylesConfig<unknown, boolean, import("react-select").GroupBase<unknown>> | undefined;
93
+ tabSelectsValue?: boolean | undefined;
94
+ unstyled?: boolean | undefined;
95
+ } & {}> & import("react-select/dist/declarations/src/useStateManager").StateManagerAdditionalProps<unknown> & import("react").RefAttributes<import("react-select/dist/declarations/src/Select").default<unknown, boolean, import("react-select").GroupBase<unknown>>> & {
96
+ error?: string | boolean | undefined;
97
+ }) => JSX.Element;
@@ -4,6 +4,7 @@ import type { GroupBase, Props } from "react-select";
4
4
  type SelectProps = {
5
5
  label?: string;
6
6
  css?: CSS;
7
+ error?: boolean | string;
7
8
  };
8
- export declare const Select: <Option, IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>>({ label, css, ...props }: SelectProps & Omit<Props<Option, IsMulti, Group>, "isMulti" | "isSearchable">) => JSX.Element;
9
+ export declare const Select: <Option, IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>>({ label, css, error, ...props }: SelectProps & Omit<Props<Option, IsMulti, Group>, "isMulti" | "isSearchable">) => JSX.Element;
9
10
  export {};
package/dist/ui.es.js CHANGED
@@ -1,6 +1,6 @@
1
- import { P as l, y as p, z as i, B as r, R as m } from "./Checkbox-22bb995a.js";
2
- import { H as y, Q as M, I as k, m as w, J as A, K as O, X as P, C as $, q as z, v as N, L as j, 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, t as W, k as X, T as F, l as Y, b as Z, d as _, c as oo, G as ao, E as so, A as eo, V as ro, s as to } from "./Checkbox-22bb995a.js";
3
- import { jsxs as t, jsx as a } from "react/jsx-runtime";
1
+ import { P as l, y as p, z as i, B as t, R as m } from "./Checkbox-a342242a.js";
2
+ import { H as D, Q as M, I as $, m as k, J as w, K as A, X as O, C as P, q as z, v as N, L as j, 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, t as W, k as X, T as F, l as Y, b as Z, d as _, c as oo, G as ao, E as so, A as eo, V as ro, s as to } from "./Checkbox-a342242a.js";
3
+ import { jsxs as n, jsx as a } from "react/jsx-runtime";
4
4
  import { useState as c } from "react";
5
5
  import "react-dom";
6
6
  import "@radix-ui/react-toolbar";
@@ -9,19 +9,19 @@ import "@radix-ui/react-dialog";
9
9
  import "@radix-ui/react-dropdown-menu";
10
10
  import "react-select";
11
11
  import "@radix-ui/react-checkbox";
12
- const I = ({ children: o, content: s }) => {
13
- const [e, n] = c(!1);
14
- return /* @__PURE__ */ t(
12
+ const h = ({ children: s, content: e }) => {
13
+ const [o, r] = c(!1);
14
+ return /* @__PURE__ */ n(
15
15
  l,
16
16
  {
17
- open: e,
18
- onOpenChange: n,
17
+ open: o,
18
+ onOpenChange: r,
19
19
  trigger: "hover",
20
20
  placement: "top",
21
21
  offset: { mainAxis: 8 },
22
22
  role: "tooltip",
23
23
  children: [
24
- /* @__PURE__ */ a(p, { children: o }),
24
+ /* @__PURE__ */ a(p, { children: s }),
25
25
  /* @__PURE__ */ a(i, { overlayCardProps: {
26
26
  css: {
27
27
  background: "rgba(0,0,0, 0.9)",
@@ -29,17 +29,18 @@ const I = ({ children: o, content: s }) => {
29
29
  fontSize: "$sm",
30
30
  padding: "$1 $2"
31
31
  }
32
- }, children: s })
32
+ }, children: e })
33
33
  ]
34
34
  }
35
35
  );
36
- }, h = ({
37
- label: o,
38
- css: s,
39
- ...e
40
- }) => /* @__PURE__ */ t(r, { css: s, children: [
41
- o && /* @__PURE__ */ a(
42
- r,
36
+ }, I = ({
37
+ label: s,
38
+ css: e,
39
+ error: o,
40
+ ...r
41
+ }) => /* @__PURE__ */ n(t, { css: e, children: [
42
+ s && /* @__PURE__ */ a(
43
+ t,
43
44
  {
44
45
  as: "label",
45
46
  css: {
@@ -47,21 +48,30 @@ const I = ({ children: o, content: s }) => {
47
48
  marginBottom: "$2",
48
49
  fontSize: "$md"
49
50
  },
50
- children: o
51
+ children: s
51
52
  }
52
53
  ),
53
- /* @__PURE__ */ a(m, { ...e, isSearchable: !1, isMulti: !1 })
54
+ /* @__PURE__ */ a(
55
+ m,
56
+ {
57
+ ...r,
58
+ error: o,
59
+ isSearchable: !1,
60
+ isMulti: !1
61
+ }
62
+ ),
63
+ typeof o == "string" && /* @__PURE__ */ a(t, { css: { color: "$red600", fontSize: "$sm", marginTop: "$2" }, children: o })
54
64
  ] });
55
65
  export {
56
- y as Alert,
66
+ D as Alert,
57
67
  M as Avatar,
58
- k as Badge,
59
- r as Box,
60
- w as Button,
61
- A as ButtonInToolbar,
62
- O as Card,
63
- P as Checkbox,
64
- $ as Combobox,
68
+ $ as Badge,
69
+ t as Box,
70
+ k as Button,
71
+ w as ButtonInToolbar,
72
+ A as Card,
73
+ O as Checkbox,
74
+ P as Combobox,
65
75
  z as Dialog,
66
76
  N as DialogActions,
67
77
  j as DialogHeader,
@@ -77,7 +87,7 @@ export {
77
87
  l as Popover,
78
88
  i as PopoverContent,
79
89
  p as PopoverTrigger,
80
- h as Select,
90
+ I as Select,
81
91
  U as Spinner,
82
92
  V as Stack,
83
93
  W as TextInput,
@@ -86,7 +96,7 @@ export {
86
96
  Y as ToolbarSeparator,
87
97
  Z as ToolbarToggleGroup,
88
98
  _ as ToolbarToggleItem,
89
- I as Tooltip,
99
+ h as Tooltip,
90
100
  oo as css,
91
101
  ao as getCssText,
92
102
  so as globalCss,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkitektbedriftene/fe-lib",
3
- "version": "0.4.17",
3
+ "version": "0.4.18",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {