@memobit/libs 3.28.2 → 3.29.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.
Files changed (35) hide show
  1. package/dist/components/Auth/ChangePasswordModal/ChangePasswordModal2.js +7 -7
  2. package/dist/components/Auth/Login/Login2.js +4 -4
  3. package/dist/components/Auth/MfaSetupModal/MfaSetupModal2.js +6 -6
  4. package/dist/components/DataView/DataView.CardView.js +84 -84
  5. package/dist/components/MenuHamburger/MenuHamburger2.js +14 -14
  6. package/dist/components/PageShell/AppFrame.js +27 -0
  7. package/dist/components/PageShell/BottomSheet.js +45 -0
  8. package/dist/components/PageShell/FilterField.css +1 -0
  9. package/dist/components/PageShell/FilterField2.js +294 -0
  10. package/dist/components/PageShell/FilterSections.js +86 -0
  11. package/dist/components/PageShell/PageParts.js +257 -0
  12. package/dist/components/PageShell/PageShell.css +1 -0
  13. package/dist/components/PageShell/PageShell2.js +11 -0
  14. package/dist/components/PageShell/WorkbenchPhone.js +139 -0
  15. package/dist/components/PageShell/WorkbenchShell.js +154 -0
  16. package/dist/components/PageShell/filterRules.js +123 -0
  17. package/dist/components/PageShell/filterValues.js +30 -0
  18. package/dist/components/PageShell/menuItems.js +9 -0
  19. package/dist/components/PageShell/shellText.js +39 -0
  20. package/dist/components/PageShell/useAppFrame.js +6 -0
  21. package/dist/components/PageShell/usePaging.js +23 -0
  22. package/dist/components/PageShell/usePruneStaleFilters.js +17 -0
  23. package/dist/components/PageShell/useSummaryMessages.js +17 -0
  24. package/dist/components/Pagination/Pagination.css +1 -1
  25. package/dist/components/Pagination/Pagination2.js +14 -13
  26. package/dist/components/ScrollToTop/ScrollToTop.css +1 -1
  27. package/dist/components/ScrollToTop/ScrollToTop2.js +20 -19
  28. package/dist/contexts/LanguageContext/libMessages.js +55 -7
  29. package/dist/helpers/VersionInfo.js +1 -1
  30. package/dist/hooks/useAccountMenu.js +6 -6
  31. package/dist/index.d.ts +299 -0
  32. package/dist/index.js +235 -213
  33. package/dist/version.js +2 -2
  34. package/dist/version.json +4 -4
  35. package/package.json +147 -147
@@ -1,22 +1,23 @@
1
1
  import './ScrollToTop.css';
2
- import { libMessages as a } from "../../contexts/LanguageContext/libMessages.js";
3
- import { useMessages as f } from "../../hooks/useLanguage.js";
4
- import { Tooltip as u } from "../Tooltip/Tooltip2.js";
2
+ import { Icon as f } from "../Icon/Icon2.js";
3
+ import { libMessages as u } from "../../contexts/LanguageContext/libMessages.js";
4
+ import { useMessages as a } from "../../hooks/useLanguage.js";
5
+ import { Tooltip as T } from "../Tooltip/Tooltip2.js";
5
6
  /* empty css */
6
- import { useCallback as T, useEffect as d, useState as v } from "react";
7
+ import { useCallback as v, useEffect as b, useState as d } from "react";
7
8
  import { jsx as t } from "react/jsx-runtime";
8
- var k = ({ scrollContainer: o, scrollThreshold: s = 200, className: e }) => {
9
- const i = f(a), [c, p] = v(!1);
10
- d(() => {
11
- const l = o ?? window, r = () => {
9
+ var L = ({ scrollContainer: o, scrollThreshold: e = 200, className: s }) => {
10
+ const i = a(u), [p, c] = d(!1);
11
+ b(() => {
12
+ const r = o ?? window, l = () => {
12
13
  const n = o ? o.scrollTop : window.scrollY;
13
- p(n > s);
14
+ c(n > e);
14
15
  };
15
- return l.addEventListener("scroll", r, { passive: !0 }), () => {
16
- l.removeEventListener("scroll", r);
16
+ return r.addEventListener("scroll", l, { passive: !0 }), () => {
17
+ r.removeEventListener("scroll", l);
17
18
  };
18
- }, [o, s]);
19
- const m = T(() => {
19
+ }, [o, e]);
20
+ const m = v(() => {
20
21
  o ? o.scrollTo({
21
22
  top: 0,
22
23
  behavior: "smooth"
@@ -25,18 +26,18 @@ var k = ({ scrollContainer: o, scrollThreshold: s = 200, className: e }) => {
25
26
  behavior: "smooth"
26
27
  });
27
28
  }, [o]);
28
- return c ? /* @__PURE__ */ t(u, {
29
+ return p ? /* @__PURE__ */ t(T, {
29
30
  title: i.scrollToTop,
30
31
  children: /* @__PURE__ */ t("button", {
31
- className: `scroll-to-top${e ? ` ${e}` : ""}`,
32
+ className: `scroll-to-top${s ? ` ${s}` : ""}`,
32
33
  onClick: m,
33
- children: /* @__PURE__ */ t("span", {
34
- className: "scroll-to-top__icon",
35
- children: "▲"
34
+ children: /* @__PURE__ */ t(f, {
35
+ name: "arrow-up",
36
+ size: "lg"
36
37
  })
37
38
  })
38
39
  }) : null;
39
40
  };
40
41
  export {
41
- k as ScrollToTop
42
+ L as ScrollToTop
42
43
  };
@@ -1,4 +1,4 @@
1
- import { roCount as n, roNumberBeforeNoun as i } from "../../helpers/Language.js";
1
+ import { roCount as r, roNumberBeforeNoun as i } from "../../helpers/Language.js";
2
2
  var l = {
3
3
  cancel: "Cancel",
4
4
  clear: "Clear",
@@ -22,7 +22,7 @@ var l = {
22
22
  sortAscending: "Sort ascending",
23
23
  sortDescending: "Sort descending",
24
24
  resultsCount: (e, a, t, o) => `Showing ${e}-${a} of ${t}${o}`,
25
- resultsCountFiltered: (e, a, t, o, r) => `Showing ${e}-${a} of ${t} filtered${r} (${o} total)`,
25
+ resultsCountFiltered: (e, a, t, o, n) => `Showing ${e}-${a} of ${t} filtered${n} (${o} total)`,
26
26
  rows: "Rows",
27
27
  previous: "Previous",
28
28
  next: "Next",
@@ -51,6 +51,30 @@ var l = {
51
51
  search: "Search",
52
52
  showToolbar: "Show the toolbar",
53
53
  hideToolbar: "Hide the toolbar",
54
+ pageAny: "Any",
55
+ pageClearAll: "Clear all",
56
+ pageShowAll: (e) => `Show all ${e}`,
57
+ pageShowFewer: "Show fewer",
58
+ pageNoMatches: "No matches",
59
+ pageSearchOptions: (e) => `Search ${e.toLowerCase()}`,
60
+ pageSelectedCount: (e) => `${e} selected`,
61
+ pageRatingAtLeast: (e) => `${e}★ and up`,
62
+ pageDateSince: (e) => `since ${e}`,
63
+ pageDateUntil: (e) => `until ${e}`,
64
+ pageShowResults: (e) => e === 0 ? "No results" : `Show ${e} result${e === 1 ? "" : "s"}`,
65
+ pageSortAndView: "Sort and view",
66
+ pageView: "View",
67
+ pageAscending: "Ascending",
68
+ pageDescending: "Descending",
69
+ pageMenu: "Menu",
70
+ pageDone: "Done",
71
+ pageColumnsShown: (e, a) => `${e} of ${a} shown`,
72
+ pageItemCount: (e, a, t, o) => e === a ? `${a} ${a === 1 ? t : o}` : `${e} of ${a} ${a === 1 ? t : o}`,
73
+ pageShowItems: (e, a, t) => e === 0 ? `No ${t} match` : `Show ${e} ${e === 1 ? a : t}`,
74
+ pageAnyWord: "Any word",
75
+ pageAllWords: "All words",
76
+ pageViewCalendar: "Calendar",
77
+ pageViewMap: "Map",
54
78
  selectDate: "Select date...",
55
79
  monthNames: [
56
80
  "January",
@@ -138,7 +162,7 @@ var l = {
138
162
  sortAscending: "Sortează crescător",
139
163
  sortDescending: "Sortează descrescător",
140
164
  resultsCount: (e, a, t, o) => `Se afișează ${e}-${a} din ${o ? i(t) : t}${o}`,
141
- resultsCountFiltered: (e, a, t, o, r) => `Se afișează ${e}-${a} din ${r ? i(t) : t}${r} filtrate (${o} în total)`,
165
+ resultsCountFiltered: (e, a, t, o, n) => `Se afișează ${e}-${a} din ${n ? i(t) : t}${n} filtrate (${o} în total)`,
142
166
  rows: "Rânduri",
143
167
  previous: "Anterioara",
144
168
  next: "Următoarea",
@@ -167,6 +191,30 @@ var l = {
167
191
  search: "Caută",
168
192
  showToolbar: "Arată bara de instrumente",
169
193
  hideToolbar: "Ascunde bara de instrumente",
194
+ pageAny: "Oricare",
195
+ pageClearAll: "Șterge tot",
196
+ pageShowAll: (e) => `Arată toate cele ${e}`,
197
+ pageShowFewer: "Arată mai puține",
198
+ pageNoMatches: "Nicio potrivire",
199
+ pageSearchOptions: (e) => `Caută în ${e.toLowerCase()}`,
200
+ pageSelectedCount: (e) => `${e} selectate`,
201
+ pageRatingAtLeast: (e) => `${e}★ sau mai mult`,
202
+ pageDateSince: (e) => `din ${e}`,
203
+ pageDateUntil: (e) => `până la ${e}`,
204
+ pageShowResults: (e) => e === 0 ? "Niciun rezultat" : `Arată ${r(e, "rezultat", "rezultate")}`,
205
+ pageSortAndView: "Sortare și afișare",
206
+ pageView: "Afișare",
207
+ pageAscending: "Crescător",
208
+ pageDescending: "Descrescător",
209
+ pageMenu: "Meniu",
210
+ pageDone: "Gata",
211
+ pageColumnsShown: (e, a) => `${e} din ${a} afișate`,
212
+ pageItemCount: (e, a, t, o) => e === a ? r(a, t, o) : `${e} din ${r(a, t, o)}`,
213
+ pageShowItems: (e, a, t) => e === 0 ? "Niciun rezultat" : `Arată ${r(e, a, t)}`,
214
+ pageAnyWord: "Oricare cuvânt",
215
+ pageAllWords: "Toate cuvintele",
216
+ pageViewCalendar: "Calendar",
217
+ pageViewMap: "Hartă",
170
218
  selectDate: "Alege data...",
171
219
  monthNames: [
172
220
  "Ianuarie",
@@ -199,8 +247,8 @@ var l = {
199
247
  nextMonth: "Luna următoare",
200
248
  today: "Azi",
201
249
  selectOption: "Alege o opțiune",
202
- selectedCount: (e) => n(e, "selectată", "selectate"),
203
- selectedWithOthers: (e, a) => `${e} (+${n(a, "alta", "altele")})`,
250
+ selectedCount: (e) => r(e, "selectată", "selectate"),
251
+ selectedWithOthers: (e, a) => `${e} (+${r(a, "alta", "altele")})`,
204
252
  createOption: (e) => `Creează „${e}”`,
205
253
  noOptions: "Nu s-au găsit opțiuni",
206
254
  remove: "Elimină",
@@ -231,10 +279,10 @@ var l = {
231
279
  scrollToTop: "Mergi sus",
232
280
  tipOfTheDay: "Sfatul zilei",
233
281
  dismiss: "Închide"
234
- }, u = {
282
+ }, p = {
235
283
  en: l,
236
284
  ro: s
237
285
  };
238
286
  export {
239
- u as libMessages
287
+ p as libMessages
240
288
  };
@@ -23,7 +23,7 @@ var r = (i) => {
23
23
  const o = {
24
24
  ...i,
25
25
  lib: d,
26
- libBuildNumber: 635,
26
+ libBuildNumber: 649,
27
27
  libCommit: n,
28
28
  libBuildDate: t
29
29
  };
@@ -1,10 +1,10 @@
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";
1
+ import { useAuth as d } from "./useAuth/useAuth.js";
2
+ import { ChangePasswordModal as w } from "../components/Auth/ChangePasswordModal/ChangePasswordModal2.js";
3
+ import { ThemeSettings as A } from "../components/ThemeSettings/ThemeSettings2.js";
4
4
  import { useState as s } from "react";
5
5
  import { Fragment as k, jsx as o, jsxs as v } from "react/jsx-runtime";
6
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 () => {
7
+ const { user: u, logout: p } = d(), [f, t] = s(!1), [h, n] = s(!1), [g, a] = s(!1), C = async () => {
8
8
  await p(), window.location.href = m;
9
9
  }, i = {
10
10
  label: c,
@@ -32,12 +32,12 @@ var j = ({ appName: l, mfaModal: e, themeLabel: c = "Theme", loginPath: m = "/lo
32
32
  isActive: !1
33
33
  }
34
34
  ], O = /* @__PURE__ */ v(k, { children: [
35
- /* @__PURE__ */ o(d, {
35
+ /* @__PURE__ */ o(A, {
36
36
  isOpen: f,
37
37
  onClose: () => t(!1),
38
38
  currentApp: l
39
39
  }),
40
- /* @__PURE__ */ o(A, {
40
+ /* @__PURE__ */ o(w, {
41
41
  isOpen: h,
42
42
  onClose: () => n(!1)
43
43
  }),
package/dist/index.d.ts CHANGED
@@ -156,6 +156,20 @@ declare interface AppData<TPages, TTheme> {
156
156
  theme: TTheme;
157
157
  }
158
158
 
159
+ /** Set once per app: its name, logo and app-wide menu. Every PageShell inside it shows them in the right place for the device. */
160
+ export declare const AppFrame: FC<AppFrameProps>;
161
+
162
+ declare type AppFrameContextValue = Omit<AppFrameProps, 'children'>;
163
+
164
+ export declare interface AppFrameProps {
165
+ app: AppIdentity;
166
+ /** Adds the account menu (theme, password, two-factor, logout) and mounts the dialogs it opens. Needs an AuthProvider above. */
167
+ account?: UseAccountMenuOptions;
168
+ /** App-specific menu entries, listed before the account ones. Page actions join them on small screens. */
169
+ menuItems?: MenuHamburgerItem[];
170
+ children: ReactNode;
171
+ }
172
+
159
173
  export declare const AppHeader: default_2.FC<AppHeaderProps>;
160
174
 
161
175
  export declare interface AppHeaderProps {
@@ -169,6 +183,14 @@ export declare interface AppHeaderProps {
169
183
  showSeparator?: boolean;
170
184
  }
171
185
 
186
+ export declare interface AppIdentity {
187
+ name: string;
188
+ icon?: IconName;
189
+ /** The app's own logo, used instead of `icon`: an image URL (e.g. '/icon.svg') or any element. */
190
+ logo?: ReactNode;
191
+ onHomeClick?: () => void;
192
+ }
193
+
172
194
  export declare interface AppPersistenceDefaults<TPages, TTheme> {
173
195
  pages?: TPages;
174
196
  theme: TTheme;
@@ -188,6 +210,18 @@ declare interface AppVersionInfo {
188
210
  buildDate: string;
189
211
  }
190
212
 
213
+ /** A single filter's selected key, if it is one of `allowed`. */
214
+ export declare const asFilterKey: <K extends string | number>(value: FilterValue | undefined, allowed: readonly K[]) => K | undefined;
215
+
216
+ /** A multi filter's selected keys, limited to `allowed`. */
217
+ export declare const asFilterKeys: <K extends string | number>(value: FilterValue | undefined, allowed: readonly K[]) => K[];
218
+
219
+ /** A range filter's [min, max], or null when the range is off. */
220
+ export declare const asFilterRange: (value: FilterValue | undefined) => [number, number] | null;
221
+
222
+ /** A text filter's text and match mode, or null for any other value. */
223
+ export declare const asFilterText: (value: FilterValue | undefined) => TextFilterValue | null;
224
+
191
225
  export declare interface AuthConfig {
192
226
  apiBaseUrl: string;
193
227
  appName?: string;
@@ -355,6 +389,9 @@ export declare const breakpoints: {
355
389
 
356
390
  export declare const buildRequestHeaders: (method: HttpMethod, json?: boolean) => Record<string, string>;
357
391
 
392
+ /** View modes the lib knows: name one and it brings its own translated label and icon. */
393
+ export declare type BuiltInViewMode = 'cards' | 'table' | 'gallery' | 'calendar' | 'map';
394
+
358
395
  export declare interface BulkAction {
359
396
  key: string;
360
397
  label: string;
@@ -1068,6 +1105,8 @@ export declare interface CopyButtonProps {
1068
1105
 
1069
1106
  export declare type CopyButtonStatus = 'idle' | 'copied' | 'error';
1070
1107
 
1108
+ export declare const countActiveFilters: (filters: FilterSpec[], values: PageFilterValues) => number;
1109
+
1071
1110
  export declare const CountryWithFlag: default_2.FC<CountryWithFlagProps>;
1072
1111
 
1073
1112
  declare interface CountryWithFlagProps {
@@ -1286,6 +1325,12 @@ export declare interface DataViewTimelineConfig<T> {
1286
1325
  granularity?: 'day' | 'month';
1287
1326
  }
1288
1327
 
1328
+ export declare interface DateFilterSpec extends FilterSpecBase {
1329
+ kind: 'date';
1330
+ /** Whether items on or after the date match (`since`, the default) or on or before it (`until`). */
1331
+ relation?: 'since' | 'until';
1332
+ }
1333
+
1289
1334
  export declare const DatePicker: default_2.FC<DatePickerProps>;
1290
1335
 
1291
1336
  export declare interface DatePickerProps extends Omit<CalendarProps, 'onChange' | 'value'> {
@@ -1391,6 +1436,8 @@ export declare interface DayAgendaProps<T = unknown> {
1391
1436
  className?: string;
1392
1437
  }
1393
1438
 
1439
+ export declare const defaultFilterValue: (spec: FilterSpec) => FilterValue;
1440
+
1394
1441
  declare type DiffLang = 'javascript' | 'typescript' | 'jsx' | 'tsx' | 'css' | 'scss' | 'html' | 'json' | 'python' | 'bash' | 'plaintext';
1395
1442
 
1396
1443
  declare type DiffMode = 'split' | 'inline';
@@ -1708,6 +1755,22 @@ export declare interface FileDropzoneProps {
1708
1755
  onFiles?: (files: File[]) => void;
1709
1756
  }
1710
1757
 
1758
+ /** Where a filter is drawn: the desktop side column or tablet drawer (`panel`), or the phone sheet (`sheet`). */
1759
+ export declare type FilterContext = 'panel' | 'sheet';
1760
+
1761
+ /** Forces one widget for a `single` or `multi` filter instead of letting the shell choose. */
1762
+ export declare type FilterControl = 'segmented' | 'radio' | 'chips' | 'checklist' | 'search-list';
1763
+
1764
+ /** One filter, drawn with the widget that suits its kind, option count and context. */
1765
+ export declare const FilterField: FC<FilterFieldProps>;
1766
+
1767
+ export declare interface FilterFieldProps {
1768
+ spec: FilterSpec;
1769
+ value: FilterValue | undefined;
1770
+ context: FilterContext;
1771
+ onChange: (value: FilterValue) => void;
1772
+ }
1773
+
1711
1774
  /** Reads an item's lookup id(s): a single id for one-to-one fields, an array for many-to-many (tags). */
1712
1775
  export declare type FilterIdGetter<T> = (item: T) => number | number[] | null | undefined;
1713
1776
 
@@ -1719,11 +1782,45 @@ export declare interface FilterKeyLookup {
1719
1782
  name: string;
1720
1783
  }
1721
1784
 
1785
+ /** What a filter's data is. The widget is chosen from this, the option count and where the filter sits. */
1786
+ export declare type FilterKind = 'single' | 'multi' | 'range' | 'rating' | 'toggle' | 'text' | 'date';
1787
+
1722
1788
  export declare interface FilterLookup {
1723
1789
  id: number;
1724
1790
  name: string;
1725
1791
  }
1726
1792
 
1793
+ export declare interface FilterMode {
1794
+ value: string;
1795
+ label: string;
1796
+ }
1797
+
1798
+ export declare interface FilterOption {
1799
+ value: string | number;
1800
+ label: string;
1801
+ /** How many items carry this option. Shown next to the option when present. */
1802
+ count?: number | string;
1803
+ icon?: IconName;
1804
+ color?: string;
1805
+ }
1806
+
1807
+ /** `pinned` filters start open and stay in sight; `secondary` ones sit at the end. */
1808
+ export declare type FilterPriority = 'pinned' | 'default' | 'secondary';
1809
+
1810
+ export declare type FilterSpec = SingleFilterSpec | MultiFilterSpec | RangeFilterSpec | RatingFilterSpec | ToggleFilterSpec | TextFilterSpec | DateFilterSpec;
1811
+
1812
+ declare interface FilterSpecBase {
1813
+ id: string;
1814
+ label: string;
1815
+ priority?: FilterPriority;
1816
+ }
1817
+
1818
+ /**
1819
+ * A filter's value. By kind: single → option value or null; multi → option values; range → [min, max]
1820
+ * or null; rating → the minimum (0 for any); toggle → boolean; text → TextFilterValue; date → 'YYYY-MM-DD' or null.
1821
+ */
1822
+ export declare type FilterValue = string | number | boolean | null | Array<string | number> | TextFilterValue;
1823
+
1727
1824
  export declare const Flag: default_2.FC<FlagsProps>;
1728
1825
 
1729
1826
  declare interface FlagsProps {
@@ -1922,6 +2019,12 @@ export declare const getRangeLabel: (range: BMIRange, index: number, total: numb
1922
2019
 
1923
2020
  export declare const getResultsCount: (visiblePageSize: number, filteredItemsCount: number, totalItemsCount: number, currentPage: number, itemNoun?: string, language?: Language) => string;
1924
2021
 
2022
+ /**
2023
+ * The fixes that bring saved option filters in line with their current options: selected values that no option
2024
+ * offers anymore (a deleted lookup, a value no item carries) are dropped. Pass filter specs built from loaded data.
2025
+ */
2026
+ export declare const getStaleFilterChanges: (filters: FilterSpec[], values: PageFilterValues) => StaleFilterChange[];
2027
+
1925
2028
  export { getThemeConfig }
1926
2029
 
1927
2030
  export declare const getTodayDateString: () => string;
@@ -2487,6 +2590,8 @@ export declare const isClientErrorStatus: (status: number) => boolean;
2487
2590
  */
2488
2591
  export declare const isDateInRange: (date: Date, start: Date, end: Date) => boolean;
2489
2592
 
2593
+ export declare const isFilterActive: (spec: FilterSpec, value: FilterValue | undefined) => boolean;
2594
+
2490
2595
  /**
2491
2596
  * Checks if two dates are the same day (ignoring time)
2492
2597
  */
@@ -2809,6 +2914,12 @@ declare interface ModalProps {
2809
2914
  usePortal?: boolean;
2810
2915
  }
2811
2916
 
2917
+ export declare interface MultiFilterSpec extends FilterSpecBase {
2918
+ kind: 'multi';
2919
+ options: FilterOption[];
2920
+ control?: FilterControl;
2921
+ }
2922
+
2812
2923
  export declare const NavBar: default_2.FC<NavBarProps>;
2813
2924
 
2814
2925
  export declare interface NavBarItem {
@@ -2854,6 +2965,116 @@ declare interface NotificationPanelProps {
2854
2965
 
2855
2966
  declare type OutputFormat = 'html' | 'markdown';
2856
2967
 
2968
+ export declare interface PageAction {
2969
+ id: string;
2970
+ label: string;
2971
+ icon?: IconName;
2972
+ variant?: ButtonVariant;
2973
+ disabled?: boolean;
2974
+ onClick: () => void;
2975
+ }
2976
+
2977
+ export declare interface PageColumns {
2978
+ options: Array<{
2979
+ value: string;
2980
+ label: string;
2981
+ }>;
2982
+ /** The visible ones. */
2983
+ value: string[];
2984
+ onChange: (value: string[]) => void;
2985
+ }
2986
+
2987
+ export declare interface PageCounts {
2988
+ /** Items left after filtering and search. */
2989
+ shown: number;
2990
+ /** All items. */
2991
+ total: number;
2992
+ }
2993
+
2994
+ export declare type PageFilterValues = Record<string, FilterValue | undefined>;
2995
+
2996
+ /** What the list holds, singular and plural, in the app's language: { one: 'recipe', other: 'recipes' }. */
2997
+ export declare interface PageNoun {
2998
+ one: string;
2999
+ other: string;
3000
+ }
3001
+
3002
+ export declare interface PagePagination {
3003
+ /** 1-indexed. */
3004
+ page: number;
3005
+ pageCount: number;
3006
+ onChange: (page: number) => void;
3007
+ }
3008
+
3009
+ export declare interface PageSearch {
3010
+ value: string;
3011
+ placeholder?: string;
3012
+ onChange: (value: string) => void;
3013
+ }
3014
+
3015
+ /** Lays out a page's title, actions, search, sort, filters and view options around its content, per device. */
3016
+ export declare const PageShell: FC<PageShellProps>;
3017
+
3018
+ /** The layouts built so far. More shells (bar, catalog, scope, focus) arrive as pages need them. */
3019
+ export declare type PageShellLayout = 'workbench';
3020
+
3021
+ export declare interface PageShellProps {
3022
+ layout?: PageShellLayout;
3023
+ title: string;
3024
+ /** The list's size. With `noun` it heads the page ("38 of 171 recipes") and labels the "Show 38 recipes" buttons. */
3025
+ counts?: PageCounts;
3026
+ noun?: PageNoun;
3027
+ /** Extra text for the line under the title, after the counts: e.g. "12 favourites". */
3028
+ heading?: string;
3029
+ primaryAction?: PageAction;
3030
+ /** Secondary actions: shown as buttons on desktop, folded into the menu on smaller screens. */
3031
+ actions?: PageAction[];
3032
+ search?: PageSearch;
3033
+ sort?: PageSort;
3034
+ view?: PageView;
3035
+ filters?: FilterSpec[];
3036
+ values?: PageFilterValues;
3037
+ onFilterChange?: (id: string, value: FilterValue) => void;
3038
+ onClearFilters?: () => void;
3039
+ /** Overrides the text of the "Show N" buttons, which otherwise comes from `noun` ("Show N results" without one). */
3040
+ resultLabel?: (count: number) => string;
3041
+ /** The list's current page, shown at the top (beside the applied filters) once there is more than one. */
3042
+ pagination?: PagePagination;
3043
+ children: ReactNode;
3044
+ }
3045
+
3046
+ export declare interface PageSort {
3047
+ fields: Array<{
3048
+ value: string;
3049
+ label: string;
3050
+ }>;
3051
+ value: PageSortValue;
3052
+ /** Marks the sort as changed from the page's default. */
3053
+ highlighted?: boolean;
3054
+ onChange: (value: PageSortValue) => void;
3055
+ }
3056
+
3057
+ export declare type PageSortDirection = 'asc' | 'desc';
3058
+
3059
+ export declare interface PageSortValue {
3060
+ field: string;
3061
+ direction: PageSortDirection;
3062
+ }
3063
+
3064
+ export declare interface PageView {
3065
+ modes: Array<BuiltInViewMode | PageViewMode>;
3066
+ value: string;
3067
+ onChange: (value: string) => void;
3068
+ /** Optional fields the user can show or hide. Listed with the view options, closed until opened. */
3069
+ columns?: PageColumns;
3070
+ }
3071
+
3072
+ export declare interface PageViewMode {
3073
+ value: string;
3074
+ label: string;
3075
+ icon: IconName;
3076
+ }
3077
+
2857
3078
  export declare const Pagination: FC<PaginationProps>;
2858
3079
 
2859
3080
  declare interface PaginationProps {
@@ -2869,6 +3090,18 @@ declare interface PaginationProps {
2869
3090
  horizontalAlign?: 'left' | 'center' | 'right';
2870
3091
  }
2871
3092
 
3093
+ export declare interface PagingState {
3094
+ /** 1-indexed, and never past the last page. */
3095
+ page: number;
3096
+ pageSize: number;
3097
+ pageCount: number;
3098
+ setPage: (page: number) => void;
3099
+ /** Changes the page size and starts again from page 1. */
3100
+ setPageSize: (pageSize: number) => void;
3101
+ /** Ready for PageShell's `pagination` prop. */
3102
+ pagination: PagePagination;
3103
+ }
3104
+
2872
3105
  export declare const PEDIATRIC_THRESHOLDS: Record<'male' | 'female', Record<number, [number, number, number]>>;
2873
3106
 
2874
3107
  export declare const PieChart: default_2.FC<PieChartProps>;
@@ -3030,6 +3263,14 @@ export declare interface RadioProps {
3030
3263
  className?: string;
3031
3264
  }
3032
3265
 
3266
+ export declare interface RangeFilterSpec extends FilterSpecBase {
3267
+ kind: 'range';
3268
+ min: number;
3269
+ max: number;
3270
+ step?: number;
3271
+ unit?: string;
3272
+ }
3273
+
3033
3274
  export declare const RangeSlider: FC<RangeSliderProps>;
3034
3275
 
3035
3276
  export declare interface RangeSliderProps {
@@ -3062,6 +3303,11 @@ export declare const Rating: FC<RatingProps>;
3062
3303
 
3063
3304
  export declare type RatingFilled = 'full' | 'half' | 'empty';
3064
3305
 
3306
+ export declare interface RatingFilterSpec extends FilterSpecBase {
3307
+ kind: 'rating';
3308
+ max: number;
3309
+ }
3310
+
3065
3311
  export declare type RatingIconType = 'star' | 'bullet' | 'bar' | 'emoji';
3066
3312
 
3067
3313
  declare interface RatingProps {
@@ -3252,6 +3498,12 @@ declare interface SignalStrengthProps {
3252
3498
  className?: string;
3253
3499
  }
3254
3500
 
3501
+ export declare interface SingleFilterSpec extends FilterSpecBase {
3502
+ kind: 'single';
3503
+ options: FilterOption[];
3504
+ control?: FilterControl;
3505
+ }
3506
+
3255
3507
  export declare const Skeleton: default_2.FC<SkeletonProps>;
3256
3508
 
3257
3509
  export declare type SkeletonAnimation = 'pulse' | 'wave' | 'none';
@@ -3387,6 +3639,11 @@ export declare type StackedBarSegmentPattern = 'solid' | 'striped' | 'hatched';
3387
3639
 
3388
3640
  export declare type StackedBarSegmentState = 'default' | 'danger' | 'success' | 'warning' | 'info';
3389
3641
 
3642
+ export declare interface StaleFilterChange {
3643
+ id: string;
3644
+ value: FilterValue;
3645
+ }
3646
+
3390
3647
  export declare const Stats: default_2.FC<StatsProps>;
3391
3648
 
3392
3649
  export declare type StatsAlign = 'left' | 'center';
@@ -3463,6 +3720,20 @@ export declare interface SwipeHandlers {
3463
3720
  onTouchCancel: () => void;
3464
3721
  }
3465
3722
 
3723
+ export declare interface TextFilterSpec extends FilterSpecBase {
3724
+ kind: 'text';
3725
+ placeholder?: string;
3726
+ /** Adds the standard "Any word / All words" choice; the value's `mode` is then a LogicalOperator ('or' or 'and'). */
3727
+ wordMatch?: boolean;
3728
+ /** Custom ways to match the typed text, when `wordMatch` doesn't fit. The first one is the default. */
3729
+ modes?: FilterMode[];
3730
+ }
3731
+
3732
+ export declare interface TextFilterValue {
3733
+ text: string;
3734
+ mode?: string;
3735
+ }
3736
+
3466
3737
  export declare type Theme = 'amber-meridian' | 'archive-indigo' | 'arctic-blue' | 'asphalt-code' | 'atelier-media' | 'audit-ember' | 'azure-night' | 'blossom-meadow' | 'blueprint-clay' | 'blush-market' | 'brass-chronicle' | 'carbon-velocity' | 'chalk-circuit' | 'chrono-atlas' | 'circuit-harbor' | 'clinical-aqua' | 'cobalt-pulse' | 'citrus-vital' | 'command-slate' | 'crawler-dusk' | 'crimson-dusk' | 'cyber-forest' | 'dashdarkx' | 'ember-night' | 'emerald-ledger' | 'frost-petal' | 'garden-harvest' | 'gilded-bear' | 'graphite-shell' | 'horizon-amber' | 'horizon-drift' | 'indigo-stitch' | 'ivory-serif' | 'kindred-ink' | 'lamplight' | 'lavender-mist' | 'light-blue' | 'lumen' | 'luna' | 'mesh-circuit' | 'midnight-atlas' | 'midnight-amber' | 'midnight-folio' | 'mint-meadow' | 'mintone' | 'neon-tokyo' | 'noir-marquee' | 'ocean-breeze' | 'ocean-depths' | 'orbital-night' | 'sandstone' | 'sandy-parchment' | 'screening-room' | 'signal-burst' | 'signal-clarity' | 'slate-focus' | 'slate-bazaar' | 'spectrum-vault' | 'tailwind-vue-dark' | 'terminal-phosphor' | 'terracotta-kitchen' | 'twilight-pulse' | 'vault-guard' | 'velvet-reel' | 'velvet-tome' | 'verdant-pulse' | 'vital-aurora' | 'vital-signal' | 'war-room';
3467
3738
 
3468
3739
  export { THEME_CONFIGS }
@@ -3658,6 +3929,10 @@ export declare type ToastType = 'info' | 'success' | 'warning' | 'danger';
3658
3929
 
3659
3930
  export declare const ToggleButtons: FC<ToggleProps>;
3660
3931
 
3932
+ export declare interface ToggleFilterSpec extends FilterSpecBase {
3933
+ kind: 'toggle';
3934
+ }
3935
+
3661
3936
  declare interface ToggleProps {
3662
3937
  activeVariant?: ButtonVariant;
3663
3938
  onToggleChange: (mode: string) => void;
@@ -3952,6 +4227,9 @@ export declare interface UseAccountMenuReturn {
3952
4227
  modals: ReactElement;
3953
4228
  }
3954
4229
 
4230
+ /** The app identity and menu set by the nearest AppFrame, or null outside one. */
4231
+ export declare const useAppFrame: () => AppFrameContextValue | null;
4232
+
3955
4233
  export declare function useAppPersistence<TPages, TTheme>(appId: string, defaults: AppPersistenceDefaults<TPages, TTheme>): UseAppPersistenceReturn<TPages, TTheme>;
3956
4234
 
3957
4235
  export declare interface UseAppPersistenceReturn<TPages, TTheme> {
@@ -4032,6 +4310,17 @@ export declare interface UseListMotionReturn {
4032
4310
 
4033
4311
  export declare const useMessages: <T>(messages: Localized<T>) => T;
4034
4312
 
4313
+ /** The current page of a list, held by the page so its header and the list agree. */
4314
+ export declare const usePaging: ({ itemCount, initialPageSize, resetOn }: UsePagingOptions) => PagingState;
4315
+
4316
+ declare interface UsePagingOptions {
4317
+ /** Items in the list as shown (after filters and search). */
4318
+ itemCount: number;
4319
+ initialPageSize?: number;
4320
+ /** Values whose change sends the list back to page 1: usually the filters, the search and the sort. */
4321
+ resetOn?: unknown[];
4322
+ }
4323
+
4035
4324
  /**
4036
4325
  * Hook pentru multiple popover-uri cu ID-uri
4037
4326
  * Util când ai multe popover-uri și vrei să le controlezi individual
@@ -4044,6 +4333,16 @@ export declare const usePopover: () => {
4044
4333
  getAnchorEl: (id: string) => HTMLElement | null;
4045
4334
  };
4046
4335
 
4336
+ /** Drops saved filter values whose options are gone, once the data has loaded and whenever the options change. */
4337
+ export declare const usePruneStaleFilters: (filters: FilterSpec[], values: PageFilterValues, { isLoaded, onPrune }: UsePruneStaleFiltersOptions) => void;
4338
+
4339
+ declare interface UsePruneStaleFiltersOptions {
4340
+ /** False until the data the options come from has loaded: an empty list then would wipe valid saved filters. */
4341
+ isLoaded: boolean;
4342
+ /** Applies all the fixes at once (one state update, so none overwrites another). */
4343
+ onPrune: (changes: StaleFilterChange[]) => void;
4344
+ }
4345
+
4047
4346
  export declare interface User {
4048
4347
  id: string;
4049
4348
  username: string;