@arkitektbedriftene/fe-lib 5.7.1 → 5.7.2

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.
@@ -1,3 +1,3 @@
1
- export declare const Button: ({ className, isLoading, disabled, ...props }: React.ButtonHTMLAttributes<HTMLButtonElement> & {
1
+ export declare const Button: import('react').ForwardRefExoticComponent<import('react').ButtonHTMLAttributes<HTMLButtonElement> & {
2
2
  isLoading?: boolean;
3
- }) => import("react/jsx-runtime").JSX.Element;
3
+ } & import('react').RefAttributes<HTMLButtonElement>>;
@@ -1,10 +1,12 @@
1
- import { jsxs as n, jsx as o } from "react/jsx-runtime";
1
+ import { jsxs as n, jsx as s } from "react/jsx-runtime";
2
2
  import l from "clsx";
3
- import { Spinner as s } from "./Spinner.es.js";
4
- const d = ({ className: e, isLoading: t, disabled: m, ...r }) => /* @__PURE__ */ n("button", { className: l("btn", e), type: "button", disabled: m || t, "data-loading": t, ...r, children: [
5
- t && /* @__PURE__ */ o(s, { className: "-ml-2" }),
6
- r.children
7
- ] });
3
+ import { forwardRef as p } from "react";
4
+ import { Spinner as f } from "./Spinner.es.js";
5
+ const c = p(({ className: r, isLoading: t, disabled: o, children: m, ...e }, a) => /* @__PURE__ */ n("button", { ref: a, className: l("btn", r), type: "button", disabled: o || t, "data-loading": t, ...e, children: [
6
+ t && /* @__PURE__ */ s(f, { className: "-ml-2" }),
7
+ m
8
+ ] }));
9
+ c.displayName = "Button";
8
10
  export {
9
- d as Button
11
+ c as Button
10
12
  };
@@ -13,11 +13,11 @@ declare const colors: {
13
13
  info: string;
14
14
  };
15
15
  export type TagColors = keyof typeof colors;
16
- export declare function Tag({ children, size, color, icon, className, ...props }: {
16
+ export declare const Tag: import('react').ForwardRefExoticComponent<{
17
17
  children: ReactNode;
18
18
  size?: keyof typeof sizes;
19
19
  color?: keyof typeof colors;
20
20
  className?: string;
21
21
  icon?: ReactNode;
22
- } & React.HTMLAttributes<HTMLElement>): import("react/jsx-runtime").JSX.Element;
22
+ } & import('react').HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
23
23
  export {};
@@ -1,6 +1,7 @@
1
- import { jsxs as a } from "react/jsx-runtime";
1
+ import { jsxs as g } from "react/jsx-runtime";
2
2
  import c from "clsx";
3
- const g = {
3
+ import { forwardRef as o } from "react";
4
+ const d = {
4
5
  sm: "px-2 py-0.5 text-xs",
5
6
  md: "px-2 py-0.5 text-sm"
6
7
  }, x = {
@@ -11,33 +12,32 @@ const g = {
11
12
  danger: "bg-danger-dark text-danger-light",
12
13
  warning: "bg-warning-dark text-warning-light",
13
14
  info: "bg-info-dark text-info-light"
14
- };
15
- function l({
15
+ }, l = o(({
16
16
  children: t,
17
17
  size: e = "sm",
18
18
  color: s = "secondary",
19
19
  icon: r,
20
- className: n,
21
- ...i
22
- }) {
23
- return /* @__PURE__ */ a(
24
- "div",
25
- {
26
- className: c(
27
- "inline-flex items-center justify-center rounded-sm gap-x-2",
28
- "[&>svg]:shrink-0",
29
- g[e],
30
- x[s],
31
- n
32
- ),
33
- ...i,
34
- children: [
35
- r,
36
- t
37
- ]
38
- }
39
- );
40
- }
20
+ className: a,
21
+ ...n
22
+ }, i) => /* @__PURE__ */ g(
23
+ "div",
24
+ {
25
+ ref: i,
26
+ className: c(
27
+ "inline-flex items-center justify-center rounded-sm gap-x-2",
28
+ "[&>svg]:shrink-0",
29
+ d[e],
30
+ x[s],
31
+ a
32
+ ),
33
+ ...n,
34
+ children: [
35
+ r,
36
+ t
37
+ ]
38
+ }
39
+ ));
40
+ l.displayName = "Tag";
41
41
  export {
42
42
  l as Tag
43
43
  };
@@ -1,9 +1,9 @@
1
- export declare const UserMenuButton: ({ firstname, lastname }: {
1
+ export declare const UserMenuButton: import('react').ForwardRefExoticComponent<{
2
2
  firstname: string;
3
3
  lastname: string;
4
- }) => import("react/jsx-runtime").JSX.Element;
5
- export declare const UserMenuCompany: ({ className, name, username }: {
4
+ } & import('react').ButtonHTMLAttributes<HTMLButtonElement> & import('react').RefAttributes<HTMLButtonElement>>;
5
+ export declare const UserMenuCompany: import('react').ForwardRefExoticComponent<{
6
6
  className?: string;
7
7
  name: string;
8
8
  username: string;
9
- }) => import("react/jsx-runtime").JSX.Element;
9
+ } & import('react').HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
@@ -1,29 +1,32 @@
1
- import { jsxs as a, jsx as c } from "react/jsx-runtime";
2
- import r from "clsx";
3
- import { G as n } from "../../iconBase-LROS5hdG.js";
4
- function i(t) {
5
- return n({ tag: "svg", attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z" }, child: [] }] })(t);
1
+ import { jsxs as a, jsx as n } from "react/jsx-runtime";
2
+ import m from "clsx";
3
+ import { forwardRef as c } from "react";
4
+ import { G as i } from "../../iconBase-LROS5hdG.js";
5
+ function o(e) {
6
+ return i({ tag: "svg", attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z" }, child: [] }] })(e);
6
7
  }
7
- function d(t) {
8
- return n({ tag: "svg", attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M406.5 399.6C387.4 352.9 341.5 320 288 320l-64 0c-53.5 0-99.4 32.9-118.5 79.6C69.9 362.2 48 311.7 48 256C48 141.1 141.1 48 256 48s208 93.1 208 208c0 55.7-21.9 106.2-57.5 143.6zm-40.1 32.7C334.4 452.4 296.6 464 256 464s-78.4-11.6-110.5-31.7c7.3-36.7 39.7-64.3 78.5-64.3l64 0c38.8 0 71.2 27.6 78.5 64.3zM256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-272a40 40 0 1 1 0-80 40 40 0 1 1 0 80zm-88-40a88 88 0 1 0 176 0 88 88 0 1 0 -176 0z" }, child: [] }] })(t);
8
+ function l(e) {
9
+ return i({ tag: "svg", attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M406.5 399.6C387.4 352.9 341.5 320 288 320l-64 0c-53.5 0-99.4 32.9-118.5 79.6C69.9 362.2 48 311.7 48 256C48 141.1 141.1 48 256 48s208 93.1 208 208c0 55.7-21.9 106.2-57.5 143.6zm-40.1 32.7C334.4 452.4 296.6 464 256 464s-78.4-11.6-110.5-31.7c7.3-36.7 39.7-64.3 78.5-64.3l64 0c38.8 0 71.2 27.6 78.5 64.3zM256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-272a40 40 0 1 1 0-80 40 40 0 1 1 0 80zm-88-40a88 88 0 1 0 176 0 88 88 0 1 0 -176 0z" }, child: [] }] })(e);
9
10
  }
10
- const h = ({ firstname: t, lastname: e }) => /* @__PURE__ */ a("button", { type: "button", className: "btn gap-x-2", children: [
11
- /* @__PURE__ */ c(d, { size: 16 }),
11
+ const p = c(({ firstname: e, lastname: t, ...s }, r) => /* @__PURE__ */ a("button", { ref: r, type: "button", className: "btn gap-x-2", ...s, children: [
12
+ /* @__PURE__ */ n(l, { size: 16 }),
12
13
  /* @__PURE__ */ a("span", { className: "md:hidden", children: [
13
- t[0],
14
- e[0]
14
+ e[0],
15
+ t[0]
15
16
  ] }),
16
17
  /* @__PURE__ */ a("span", { className: "hidden md:inline max-w-[120px] truncate", children: [
17
- t,
18
+ e,
18
19
  " ",
19
- e
20
+ t
20
21
  ] }),
21
- /* @__PURE__ */ c(i, { size: 12, className: "max-sm:hidden" })
22
- ] }), u = ({ className: t, name: e, username: s }) => /* @__PURE__ */ a("div", { className: r(t), children: [
23
- /* @__PURE__ */ c("div", { className: "text-sm truncate", children: e }),
24
- /* @__PURE__ */ c("div", { className: "text-xs opacity-70 truncate", children: s })
25
- ] });
22
+ /* @__PURE__ */ n(o, { size: 12, className: "max-sm:hidden" })
23
+ ] })), u = c(({ className: e, name: t, username: s, ...r }, d) => /* @__PURE__ */ a("div", { ref: d, className: m(e), ...r, children: [
24
+ /* @__PURE__ */ n("div", { className: "text-sm truncate", children: t }),
25
+ /* @__PURE__ */ n("div", { className: "text-xs opacity-70 truncate", children: s })
26
+ ] }));
27
+ p.displayName = "UserMenuButton";
28
+ u.displayName = "UserMenuCompany";
26
29
  export {
27
- h as UserMenuButton,
30
+ p as UserMenuButton,
28
31
  u as UserMenuCompany
29
32
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkitektbedriftene/fe-lib",
3
- "version": "5.7.1",
3
+ "version": "5.7.2",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./oidc": {