@memobit/libs 3.5.0 → 3.6.0

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,102 @@
1
+ var l = {
2
+ Continue: 100,
3
+ SwitchingProtocols: 101,
4
+ Ok: 200,
5
+ Created: 201,
6
+ Accepted: 202,
7
+ NoContent: 204,
8
+ PartialContent: 206,
9
+ MovedPermanently: 301,
10
+ Found: 302,
11
+ SeeOther: 303,
12
+ NotModified: 304,
13
+ TemporaryRedirect: 307,
14
+ PermanentRedirect: 308,
15
+ BadRequest: 400,
16
+ Unauthorized: 401,
17
+ PaymentRequired: 402,
18
+ Forbidden: 403,
19
+ NotFound: 404,
20
+ MethodNotAllowed: 405,
21
+ NotAcceptable: 406,
22
+ RequestTimeout: 408,
23
+ Conflict: 409,
24
+ Gone: 410,
25
+ PayloadTooLarge: 413,
26
+ UnsupportedMediaType: 415,
27
+ UnprocessableEntity: 422,
28
+ Locked: 423,
29
+ TooManyRequests: 429,
30
+ InternalServerError: 500,
31
+ NotImplemented: 501,
32
+ BadGateway: 502,
33
+ ServiceUnavailable: 503,
34
+ GatewayTimeout: 504
35
+ }, n = {
36
+ Get: "GET",
37
+ Post: "POST",
38
+ Put: "PUT",
39
+ Patch: "PATCH",
40
+ Delete: "DELETE"
41
+ }, w = (e) => e >= 200 && e < 300, C = (e) => e >= 400 && e < 500, E = (e) => e >= 500 && e < 600, f = "csrf_token", h = "X-CSRF-Token", v = () => {
42
+ const e = document.cookie.match(new RegExp(`(?:^|;\\s*)${f}=([^;]+)`));
43
+ return e ? decodeURIComponent(e[1]) : null;
44
+ }, m = (e, r = !0) => {
45
+ const s = r ? { "Content-Type": "application/json" } : {};
46
+ if (e !== n.Get) {
47
+ const i = v();
48
+ i && (s[h] = i);
49
+ }
50
+ return s;
51
+ }, y = class extends Error {
52
+ constructor(e, r) {
53
+ super(e), this.name = "ApiError", this.status = r;
54
+ }
55
+ }, T = async (e) => {
56
+ try {
57
+ const r = await e.json();
58
+ if (r && typeof r == "object") {
59
+ if ("error" in r && typeof r.error == "string") return r.error;
60
+ if ("message" in r && typeof r.message == "string") return r.message;
61
+ }
62
+ } catch {
63
+ }
64
+ return `Request failed (${e.status}${e.statusText ? ` ${e.statusText}` : ""})`;
65
+ }, P = ({ baseUrl: e, loginPath: r = "/login" }) => {
66
+ let s = !1;
67
+ const i = (t) => `${e.replace(/\/$/, "")}/${t.replace(/^\//, "")}`, c = async (t, o, u, p = !0) => {
68
+ const a = await fetch(i(t), {
69
+ method: o,
70
+ headers: m(o, p),
71
+ credentials: "include",
72
+ body: u
73
+ });
74
+ if (a.status === l.Unauthorized && !window.location.pathname.startsWith(r))
75
+ return s || (s = !0, window.location.href = `${r}?session_expired=true`), new Promise(() => {
76
+ });
77
+ if (!a.ok) throw new y(await T(a), a.status);
78
+ if (a.status !== l.NoContent)
79
+ return await a.json();
80
+ }, d = (t, o, u) => c(t, o, u === void 0 ? void 0 : JSON.stringify(u));
81
+ return {
82
+ get: (t) => c(t, n.Get),
83
+ post: (t, o) => d(t, n.Post, o),
84
+ put: (t, o) => d(t, n.Put, o),
85
+ patch: (t, o) => d(t, n.Patch, o),
86
+ delete: (t) => c(t, n.Delete),
87
+ upload: (t, o) => c(t, n.Post, o, !1)
88
+ };
89
+ };
90
+ export {
91
+ y as ApiError,
92
+ h as CSRF_HEADER,
93
+ n as HttpMethod,
94
+ l as HttpStatus,
95
+ m as buildRequestHeaders,
96
+ P as createApiClient,
97
+ v as getCsrfToken,
98
+ C as isClientErrorStatus,
99
+ E as isServerErrorStatus,
100
+ w as isSuccessStatus,
101
+ T as readErrorMessage
102
+ };
@@ -0,0 +1,19 @@
1
+ var s = "/data-files/images", g = () => `${s}/default.jpg`, i = (t) => `${s}/category/${t}.jpg`, c = (t, a) => typeof t != "string" ? URL.createObjectURL(t) : t ? t.includes("/data-files/images") || t.startsWith("blob:") || t.startsWith("http") ? t : `${s}/specific/${t}` : a ? i(a) : g(), l = (t, a) => {
2
+ const r = g(), e = a ? i(a) : r;
3
+ return t ? t.endsWith(r) ? null : t.includes("/data-files/images/category/") ? r : e : e;
4
+ }, u = (t, a) => {
5
+ const r = t.currentTarget, e = l(r.src, a);
6
+ if (e && !r.src.endsWith(e)) {
7
+ r.src = e;
8
+ return;
9
+ }
10
+ r.onerror = null;
11
+ };
12
+ export {
13
+ s as IMAGES_BASE_PATH,
14
+ u as applyImageFallback,
15
+ i as getCategoryImageUrl,
16
+ g as getDefaultImageUrl,
17
+ c as getImageUrl,
18
+ l as getNextImageFallback
19
+ };
@@ -1,4 +1,4 @@
1
- var o = (r) => Number((typeof r == "number" ? r : Number(r)).toFixed(2)), n = (r, e) => (r > e && console.warn(`Could not get percent of value ${r} from a total ${e}. Total must be higher or at least equal to value.`), r === e ? r === 0 ? 0 : 100 : r / (e / 100)), u = (r, e) => {
1
+ var o = (r) => Number((typeof r == "number" ? r : Number(r)).toFixed(2)), a = (r, e) => (r > e && console.warn(`Could not get percent of value ${r} from a total ${e}. Total must be higher or at least equal to value.`), r === e ? r === 0 ? 0 : 100 : r / (e / 100)), n = (r, e) => {
2
2
  const t = r + e;
3
3
  return t === 0 ? {
4
4
  a: 0,
@@ -7,9 +7,10 @@ var o = (r) => Number((typeof r == "number" ? r : Number(r)).toFixed(2)), n = (r
7
7
  a: Math.round(r / t * 100 * 10) / 10,
8
8
  b: Math.round(e / t * 100 * 10) / 10
9
9
  };
10
- };
10
+ }, m = (r, e, t) => Math.min(t, Math.max(e, r));
11
11
  export {
12
+ m as clamp,
12
13
  o as format2Digits,
13
- n as getPercent,
14
- u as getPercentsOf2Numbers
14
+ a as getPercent,
15
+ n as getPercentsOf2Numbers
15
16
  };
@@ -23,7 +23,7 @@ var r = (i) => {
23
23
  const o = {
24
24
  ...i,
25
25
  lib: d,
26
- libBuildNumber: 479,
26
+ libBuildNumber: 484,
27
27
  libCommit: n,
28
28
  libBuildDate: t
29
29
  };
@@ -0,0 +1,58 @@
1
+ import { ThemeSettings as d } from "../components/ThemeSettings/ThemeSettings2.js";
2
+ import { useAuth as w } from "./useAuth/useAuth.js";
3
+ import { ChangePasswordModal as A } from "../components/Auth/ChangePasswordModal/ChangePasswordModal2.js";
4
+ import { useState as s } from "react";
5
+ import { Fragment as k, jsx as o, jsxs as v } from "react/jsx-runtime";
6
+ var j = ({ appName: l, mfaModal: e, themeLabel: c = "Theme", loginPath: m = "/login" }) => {
7
+ const { user: u, logout: p } = w(), [f, t] = s(!1), [h, n] = s(!1), [g, a] = s(!1), C = async () => {
8
+ await p(), window.location.href = m;
9
+ }, i = {
10
+ label: c,
11
+ icon: "theme-picker",
12
+ onClick: () => t(!0),
13
+ isActive: !1,
14
+ separator: !0
15
+ }, r = [
16
+ {
17
+ label: "Change Password",
18
+ icon: "lock",
19
+ onClick: () => n(!0),
20
+ isActive: !1
21
+ },
22
+ ...e ? [{
23
+ label: "Two-factor Authentication",
24
+ icon: "key",
25
+ onClick: () => a(!0),
26
+ isActive: !1
27
+ }] : [],
28
+ {
29
+ label: `Logout ${u?.username ?? ""}`.trim(),
30
+ icon: "logout",
31
+ onClick: C,
32
+ isActive: !1
33
+ }
34
+ ], O = /* @__PURE__ */ v(k, { children: [
35
+ /* @__PURE__ */ o(d, {
36
+ isOpen: f,
37
+ onClose: () => t(!1),
38
+ currentApp: l
39
+ }),
40
+ /* @__PURE__ */ o(A, {
41
+ isOpen: h,
42
+ onClose: () => n(!1)
43
+ }),
44
+ e && /* @__PURE__ */ o(e, {
45
+ isOpen: g,
46
+ onClose: () => a(!1)
47
+ })
48
+ ] });
49
+ return {
50
+ themeItem: i,
51
+ accountItems: r,
52
+ items: [i, ...r],
53
+ modals: O
54
+ };
55
+ };
56
+ export {
57
+ j as useAccountMenu
58
+ };
package/dist/http.d.ts ADDED
@@ -0,0 +1,97 @@
1
+ export declare interface ApiClient {
2
+ get: <T>(path: string) => Promise<T>;
3
+ post: <T, P = unknown>(path: string, payload?: P) => Promise<T>;
4
+ put: <T, P = unknown>(path: string, payload?: P) => Promise<T>;
5
+ patch: <T, P = unknown>(path: string, payload?: P) => Promise<T>;
6
+ delete: <T>(path: string) => Promise<T>;
7
+ upload: <T>(path: string, formData: FormData) => Promise<T>;
8
+ }
9
+
10
+ export declare interface ApiClientConfig {
11
+ baseUrl: string;
12
+ loginPath?: string;
13
+ }
14
+
15
+ export declare class ApiError extends Error {
16
+ readonly status: number;
17
+ constructor(message: string, status: number);
18
+ }
19
+
20
+ export declare const buildRequestHeaders: (method: HttpMethod, json?: boolean) => Record<string, string>;
21
+
22
+ /**
23
+ * Cookie-session API client shared by the memobit apps: sends credentials, adds the CSRF
24
+ * header on mutating requests, surfaces the server's `error` message, and on 401 navigates
25
+ * to the login page. The 401 path returns a promise that never settles so callers don't
26
+ * flash an error toast while the browser is already leaving the page.
27
+ */
28
+ export declare const createApiClient: ({ baseUrl, loginPath }: ApiClientConfig) => ApiClient;
29
+
30
+ export declare const CSRF_HEADER = "X-CSRF-Token";
31
+
32
+ export declare const getCsrfToken: () => string | null;
33
+
34
+ export declare const HttpMethod: {
35
+ readonly Get: "GET";
36
+ readonly Post: "POST";
37
+ readonly Put: "PUT";
38
+ readonly Patch: "PATCH";
39
+ readonly Delete: "DELETE";
40
+ };
41
+
42
+ export declare type HttpMethod = (typeof HttpMethod)[keyof typeof HttpMethod];
43
+
44
+ export declare const HttpStatus: {
45
+ readonly Continue: 100;
46
+ readonly SwitchingProtocols: 101;
47
+ readonly Ok: 200;
48
+ readonly Created: 201;
49
+ readonly Accepted: 202;
50
+ readonly NoContent: 204;
51
+ readonly PartialContent: 206;
52
+ readonly MovedPermanently: 301;
53
+ readonly Found: 302;
54
+ readonly SeeOther: 303;
55
+ readonly NotModified: 304;
56
+ readonly TemporaryRedirect: 307;
57
+ readonly PermanentRedirect: 308;
58
+ readonly BadRequest: 400;
59
+ readonly Unauthorized: 401;
60
+ readonly PaymentRequired: 402;
61
+ readonly Forbidden: 403;
62
+ readonly NotFound: 404;
63
+ readonly MethodNotAllowed: 405;
64
+ readonly NotAcceptable: 406;
65
+ readonly RequestTimeout: 408;
66
+ readonly Conflict: 409;
67
+ readonly Gone: 410;
68
+ readonly PayloadTooLarge: 413;
69
+ readonly UnsupportedMediaType: 415;
70
+ readonly UnprocessableEntity: 422;
71
+ readonly Locked: 423;
72
+ readonly TooManyRequests: 429;
73
+ readonly InternalServerError: 500;
74
+ readonly NotImplemented: 501;
75
+ readonly BadGateway: 502;
76
+ readonly ServiceUnavailable: 503;
77
+ readonly GatewayTimeout: 504;
78
+ };
79
+
80
+ export declare type HttpStatus = (typeof HttpStatus)[keyof typeof HttpStatus];
81
+
82
+ export declare const isClientErrorStatus: (status: number) => boolean;
83
+
84
+ export declare const isServerErrorStatus: (status: number) => boolean;
85
+
86
+ export declare const isSuccessStatus: (status: number) => boolean;
87
+
88
+ export declare const readErrorMessage: (response: Response) => Promise<string>;
89
+
90
+ export { }
91
+
92
+
93
+ declare global {
94
+ interface Window {
95
+ __VERSIONS__: FullVersionInfo;
96
+ }
97
+ }
package/dist/http.js ADDED
@@ -0,0 +1,14 @@
1
+ import { ApiError as t, CSRF_HEADER as e, HttpMethod as s, HttpStatus as i, buildRequestHeaders as o, createApiClient as a, getCsrfToken as u, isClientErrorStatus as S, isServerErrorStatus as p, isSuccessStatus as E, readErrorMessage as d } from "./helpers/Http.js";
2
+ export {
3
+ t as ApiError,
4
+ e as CSRF_HEADER,
5
+ s as HttpMethod,
6
+ i as HttpStatus,
7
+ o as buildRequestHeaders,
8
+ a as createApiClient,
9
+ u as getCsrfToken,
10
+ S as isClientErrorStatus,
11
+ p as isServerErrorStatus,
12
+ E as isSuccessStatus,
13
+ d as readErrorMessage
14
+ };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { Component } from 'react';
2
+ import { ComponentType } from 'react';
2
3
  import { Context } from 'react';
3
4
  import { CSSProperties } from 'react';
4
5
  import { default as default_2 } from 'react';
@@ -15,6 +16,7 @@ import { ReactElement } from 'react';
15
16
  import { ReactNode } from 'react';
16
17
  import { ReactPortal } from 'react';
17
18
  import { RefAttributes } from 'react';
19
+ import { SyntheticEvent } from 'react';
18
20
  import { THEME_CONFIGS } from '@memobit/themes';
19
21
  import { ThemeConfig } from '@memobit/themes';
20
22
  import { TouchEvent as TouchEvent_2 } from 'react';
@@ -37,6 +39,11 @@ export declare interface AccordionProps {
37
39
  className?: string;
38
40
  }
39
41
 
42
+ declare interface AccountMenuModalProps {
43
+ isOpen: boolean;
44
+ onClose: () => void;
45
+ }
46
+
40
47
  /**
41
48
  * Adds days to a date
42
49
  */
@@ -104,6 +111,25 @@ export declare interface AngleSliderProps {
104
111
 
105
112
  export declare type AngleSliderVariant = 'accent' | 'info' | 'success' | 'warning' | 'danger';
106
113
 
114
+ export declare interface ApiClient {
115
+ get: <T>(path: string) => Promise<T>;
116
+ post: <T, P = unknown>(path: string, payload?: P) => Promise<T>;
117
+ put: <T, P = unknown>(path: string, payload?: P) => Promise<T>;
118
+ patch: <T, P = unknown>(path: string, payload?: P) => Promise<T>;
119
+ delete: <T>(path: string) => Promise<T>;
120
+ upload: <T>(path: string, formData: FormData) => Promise<T>;
121
+ }
122
+
123
+ export declare interface ApiClientConfig {
124
+ baseUrl: string;
125
+ loginPath?: string;
126
+ }
127
+
128
+ export declare class ApiError extends Error {
129
+ readonly status: number;
130
+ constructor(message: string, status: number);
131
+ }
132
+
107
133
  export declare const APP_DATE_FORMAT = "DD MMM YYYY";
108
134
 
109
135
  export declare const APP_DATE_TIME_FORMAT = "DD MMM YYYY HH:mm";
@@ -126,6 +152,8 @@ export declare interface AppHeaderProps {
126
152
  showSeparator?: boolean;
127
153
  }
128
154
 
155
+ export declare const applyImageFallback: (event: SyntheticEvent<HTMLImageElement>, categoryKey?: string) => void;
156
+
129
157
  export declare interface AppPersistenceDefaults<TPages, TTheme> {
130
158
  pages?: TPages;
131
159
  theme: TTheme;
@@ -303,6 +331,8 @@ export declare const breakpoints: {
303
331
  };
304
332
  };
305
333
 
334
+ export declare const buildRequestHeaders: (method: HttpMethod, json?: boolean) => Record<string, string>;
335
+
306
336
  export declare interface BulkAction {
307
337
  key: string;
308
338
  label: string;
@@ -479,6 +509,20 @@ declare interface ChangePasswordModalProps {
479
509
  onClose: () => void;
480
510
  }
481
511
 
512
+ export declare const chartColors: {
513
+ readonly axis: "var(--body-color-muted)";
514
+ readonly grid: "var(--border-color)";
515
+ readonly text: "var(--body-color)";
516
+ };
517
+
518
+ declare interface ChartTooltipStyle {
519
+ contentStyle: CSSProperties;
520
+ itemStyle: CSSProperties;
521
+ labelStyle: CSSProperties;
522
+ }
523
+
524
+ export declare const chartTooltipStyle: ChartTooltipStyle;
525
+
482
526
  export declare const Checkbox: FC<CheckboxProps>;
483
527
 
484
528
  declare interface CheckboxProps {
@@ -512,6 +556,8 @@ export declare type ChipSize = 'xsmall' | 'small' | 'medium' | 'large';
512
556
 
513
557
  export declare type ChipVariant = 'plain' | 'default' | 'success' | 'info' | 'warning' | 'danger';
514
558
 
559
+ export declare const clamp: (value: number, min: number, max: number) => number;
560
+
515
561
  export declare const Col: FC<ColProps>;
516
562
 
517
563
  export declare const CollapsibleSection: default_2.FC<CollapsibleSectionProps>;
@@ -977,6 +1023,16 @@ declare interface CountryWithFlagProps {
977
1023
  className?: string;
978
1024
  }
979
1025
 
1026
+ /**
1027
+ * Cookie-session API client shared by the memobit apps: sends credentials, adds the CSRF
1028
+ * header on mutating requests, surfaces the server's `error` message, and on 401 navigates
1029
+ * to the login page. The 401 path returns a promise that never settles so callers don't
1030
+ * flash an error toast while the browser is already leaving the page.
1031
+ */
1032
+ export declare const createApiClient: ({ baseUrl, loginPath }: ApiClientConfig) => ApiClient;
1033
+
1034
+ export declare const CSRF_HEADER = "X-CSRF-Token";
1035
+
980
1036
  declare function DataView_2<T>({ columns, data, rowKey, pinnedIds, selectable, onSelectionChange, selectedIds: controlledSelectedIds, pageSizeOptions, initialPageSize, showPageSize, card, actions, actionsWidth, timeline, onRowClick, rowHref, rowClassName, rowDetail, empty, initialSortKey, initialSortDirection, sortKey: controlledSortKey, sortDirection: controlledSortDirection, onSortChange, miniSort, showCardSortControls, desktopView, cardMaxWidth, className, onPageChange, onPageSizeChange, currentPage: controlledCurrentPage, totalItems: controlledTotalItems, group, showResultsCount, totalCount, itemNoun, columnSelector, }: DataViewProps<T>): default_2.JSX.Element;
981
1037
  export { DataView_2 as DataView }
982
1038
 
@@ -1646,11 +1702,26 @@ export declare const formatSecondsToMediaTime: (seconds: number | undefined) =>
1646
1702
 
1647
1703
  export declare const fuzzyMatch: (text: string, query: string) => boolean;
1648
1704
 
1705
+ export declare const getCategoryImageUrl: (categoryKey: string) => string;
1706
+
1707
+ export declare const getCsrfToken: () => string | null;
1708
+
1649
1709
  /**
1650
1710
  * Gets the number of days in a specific month
1651
1711
  */
1652
1712
  export declare const getDaysInMonth: (year: number, month: number) => number;
1653
1713
 
1714
+ export declare const getDefaultImageUrl: () => string;
1715
+
1716
+ /**
1717
+ * Resolves what an <img> should show for a stored image value:
1718
+ * - a File (new, unsaved upload) → a blob URL
1719
+ * - a full URL, blob URL or already-prefixed path → unchanged
1720
+ * - empty → the category fallback, else the app default
1721
+ * - a bare filename → its path under specific/
1722
+ */
1723
+ export declare const getImageUrl: (filename: string | File, categoryKey?: string) => string;
1724
+
1654
1725
  export declare const getIndicatorColor: (bmi: number, ranges: BMIRange[]) => string;
1655
1726
 
1656
1727
  export declare const getIndicatorPosition: (bmi: number, ranges: BMIRange[]) => number;
@@ -1668,6 +1739,8 @@ export declare const getIsoWeek: (date: Date) => number;
1668
1739
  */
1669
1740
  export declare const getMonthMatrix: (year: number, month: number, firstDayOfWeek?: 0 | 1) => Date[][];
1670
1741
 
1742
+ export declare const getNextImageFallback: (currentSrc: string, categoryKey?: string) => string | null;
1743
+
1671
1744
  export declare const getPediatricRanges: (p5: number, p85: number, p95: number) => BMIRange[];
1672
1745
 
1673
1746
  export declare const getPercent: (value: number, total: number) => number;
@@ -1735,6 +1808,54 @@ export declare const htmlToMarkdown: (html: string) => string;
1735
1808
  */
1736
1809
  export declare const htmlToPlainText: (html: string | undefined | null) => string;
1737
1810
 
1811
+ export declare const HttpMethod: {
1812
+ readonly Get: "GET";
1813
+ readonly Post: "POST";
1814
+ readonly Put: "PUT";
1815
+ readonly Patch: "PATCH";
1816
+ readonly Delete: "DELETE";
1817
+ };
1818
+
1819
+ export declare type HttpMethod = (typeof HttpMethod)[keyof typeof HttpMethod];
1820
+
1821
+ export declare const HttpStatus: {
1822
+ readonly Continue: 100;
1823
+ readonly SwitchingProtocols: 101;
1824
+ readonly Ok: 200;
1825
+ readonly Created: 201;
1826
+ readonly Accepted: 202;
1827
+ readonly NoContent: 204;
1828
+ readonly PartialContent: 206;
1829
+ readonly MovedPermanently: 301;
1830
+ readonly Found: 302;
1831
+ readonly SeeOther: 303;
1832
+ readonly NotModified: 304;
1833
+ readonly TemporaryRedirect: 307;
1834
+ readonly PermanentRedirect: 308;
1835
+ readonly BadRequest: 400;
1836
+ readonly Unauthorized: 401;
1837
+ readonly PaymentRequired: 402;
1838
+ readonly Forbidden: 403;
1839
+ readonly NotFound: 404;
1840
+ readonly MethodNotAllowed: 405;
1841
+ readonly NotAcceptable: 406;
1842
+ readonly RequestTimeout: 408;
1843
+ readonly Conflict: 409;
1844
+ readonly Gone: 410;
1845
+ readonly PayloadTooLarge: 413;
1846
+ readonly UnsupportedMediaType: 415;
1847
+ readonly UnprocessableEntity: 422;
1848
+ readonly Locked: 423;
1849
+ readonly TooManyRequests: 429;
1850
+ readonly InternalServerError: 500;
1851
+ readonly NotImplemented: 501;
1852
+ readonly BadGateway: 502;
1853
+ readonly ServiceUnavailable: 503;
1854
+ readonly GatewayTimeout: 504;
1855
+ };
1856
+
1857
+ export declare type HttpStatus = (typeof HttpStatus)[keyof typeof HttpStatus];
1858
+
1738
1859
  export declare const Icon: default_2.FC<IconProps>;
1739
1860
 
1740
1861
  /**
@@ -1785,6 +1906,8 @@ export declare type IconSize = 'sm' | 'md' | 'lg' | 'xl' | 'xxl' | 'xxxl';
1785
1906
 
1786
1907
  export declare type IconVariant = 'default' | 'muted' | 'accent' | 'info' | 'success' | 'warning' | 'danger';
1787
1908
 
1909
+ export declare const IMAGES_BASE_PATH = "/data-files/images";
1910
+
1788
1911
  export declare const InfiniteScroll: ({ children, onLoadMore, hasMore, isLoading, threshold, rootMargin, height, onScrollChange, endMessage, className, }: InfiniteScrollProps) => JSX.Element;
1789
1912
 
1790
1913
  declare interface InfiniteScrollProps {
@@ -2153,6 +2276,8 @@ export declare const isAfter: (date: Date, compareDate: Date) => boolean;
2153
2276
  */
2154
2277
  export declare const isBefore: (date: Date, compareDate: Date) => boolean;
2155
2278
 
2279
+ export declare const isClientErrorStatus: (status: number) => boolean;
2280
+
2156
2281
  /**
2157
2282
  * Checks if a date is within a range (inclusive)
2158
2283
  */
@@ -2163,6 +2288,10 @@ export declare const isDateInRange: (date: Date, start: Date, end: Date) => bool
2163
2288
  */
2164
2289
  export declare const isSameDay: (date1: Date, date2: Date) => boolean;
2165
2290
 
2291
+ export declare const isServerErrorStatus: (status: number) => boolean;
2292
+
2293
+ export declare const isSuccessStatus: (status: number) => boolean;
2294
+
2166
2295
  /**
2167
2296
  * Checks if a date is today
2168
2297
  */
@@ -2676,6 +2805,8 @@ declare interface RatingProps {
2676
2805
 
2677
2806
  export declare type RatingVariant = 'success' | 'info' | 'warning' | 'danger';
2678
2807
 
2808
+ export declare const readErrorMessage: (response: Response) => Promise<string>;
2809
+
2679
2810
  export declare const RichTextEditor: ({ advanced, error, format, id, label, onBlur, onChange, placeholder, required, value, }: RichTextEditorProps) => default_2.JSX.Element;
2680
2811
 
2681
2812
  declare interface RichTextEditorProps {
@@ -3435,6 +3566,22 @@ declare type TreeVariant = 'default' | 'info' | 'success' | 'warning' | 'danger'
3435
3566
 
3436
3567
  export declare const truncateText: (text: string, maxLength?: number, separator?: string) => string;
3437
3568
 
3569
+ export declare const useAccountMenu: ({ appName, mfaModal: MfaModal, themeLabel, loginPath }: UseAccountMenuOptions) => UseAccountMenuReturn;
3570
+
3571
+ export declare interface UseAccountMenuOptions {
3572
+ appName: string;
3573
+ mfaModal?: ComponentType<AccountMenuModalProps>;
3574
+ themeLabel?: string;
3575
+ loginPath?: string;
3576
+ }
3577
+
3578
+ export declare interface UseAccountMenuReturn {
3579
+ themeItem: MenuHamburgerItem;
3580
+ accountItems: MenuHamburgerItem[];
3581
+ items: MenuHamburgerItem[];
3582
+ modals: ReactElement;
3583
+ }
3584
+
3438
3585
  export declare function useAppPersistence<TPages, TTheme>(appId: string, defaults: AppPersistenceDefaults<TPages, TTheme>): UseAppPersistenceReturn<TPages, TTheme>;
3439
3586
 
3440
3587
  export declare interface UseAppPersistenceReturn<TPages, TTheme> {