@memobit/libs 3.34.0 → 3.36.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.
@@ -31,7 +31,7 @@ var i = ({ counts: e, noun: a, heading: l }, r) => [e && a ? r.pageItemCount(e.s
31
31
  icon: "map"
32
32
  };
33
33
  }
34
- }, g = (e, a) => e.map((l) => typeof l == "string" ? t(l, a) : l), n = (e) => !!(e.columns || e.groupBy || e.toggles?.length || e.choices?.length);
34
+ }, g = (e, a) => e.map((l) => typeof l == "string" ? t(l, a) : l), n = (e) => !!(e.columns || e.groupBy || e.toggles?.length || e.choices?.length || e.sliders?.length);
35
35
  export {
36
36
  i as getHeadingText,
37
37
  s as getResultLabel,
@@ -0,0 +1,35 @@
1
+ import { libMessages as s } from "../../contexts/LanguageContext/libMessages.js";
2
+ import { useMessages as c } from "../../hooks/useLanguage.js";
3
+ import a from "../ConfirmDialog/ConfirmDialog2.js";
4
+ import { useState as f } from "react";
5
+ import { jsx as u } from "react/jsx-runtime";
6
+ var x = (r, l) => {
7
+ const i = c(s), [n, e] = f(null), t = (o) => o.confirm ? {
8
+ ...o,
9
+ onClick: () => e(o)
10
+ } : o, m = /* @__PURE__ */ u(a, {
11
+ isOpen: n !== null,
12
+ title: n?.confirm?.title ?? n?.label ?? "",
13
+ message: n?.confirm?.message ?? "",
14
+ confirm: {
15
+ text: n?.confirm?.confirmLabel ?? i.confirm,
16
+ variant: n?.confirm?.variant ?? "danger",
17
+ onClick: () => {
18
+ n?.onClick(), e(null);
19
+ }
20
+ },
21
+ cancel: {
22
+ text: i.cancel,
23
+ onClick: () => e(null)
24
+ },
25
+ usePortal: !0
26
+ });
27
+ return {
28
+ primaryAction: r && t(r),
29
+ actions: l.map(t),
30
+ dialog: m
31
+ };
32
+ };
33
+ export {
34
+ x as useConfirmedActions
35
+ };
@@ -1,11 +1,12 @@
1
- import { libMessages as a } from "../../contexts/LanguageContext/libMessages.js";
2
- import { useMessages as t } from "../../hooks/useLanguage.js";
1
+ import { libMessages as t } from "../../contexts/LanguageContext/libMessages.js";
2
+ import { useMessages as a } from "../../hooks/useLanguage.js";
3
3
  import { useMemo as s } from "react";
4
4
  var g = () => {
5
- const e = t(a);
5
+ const e = a(t);
6
6
  return s(() => ({
7
7
  any: e.pageAny,
8
8
  selectedCount: e.pageSelectedCount,
9
+ without: e.pageWithout,
9
10
  ratingAtLeast: e.pageRatingAtLeast,
10
11
  dateSince: e.pageDateSince,
11
12
  dateUntil: e.pageDateUntil,
@@ -1,18 +1,20 @@
1
- import { AppFrame as m } from "../PageShell/AppFrame.js";
2
- import { useMemo as p } from "react";
3
- import { jsx as u } from "react/jsx-runtime";
4
- import { matchPath as r, useLocation as d, useNavigate as f } from "react-router";
5
- var k = ({ nav: n, app: e, ...s }) => {
6
- const { pathname: t } = d(), a = f(), l = p(() => n.map((o) => ({
1
+ import { AppFrame as i } from "../PageShell/AppFrame.js";
2
+ import { useMemo as e } from "react";
3
+ import { jsx as m } from "react/jsx-runtime";
4
+ import { matchPath as p, useLocation as d, useNavigate as f } from "react-router";
5
+ var k = ({ nav: n, app: r, ...l }) => {
6
+ const { pathname: t } = d(), a = f(), s = e(() => n.map((o) => ({
7
7
  id: o.path,
8
8
  label: o.label,
9
9
  icon: o.icon,
10
10
  count: o.count,
11
- isActive: r({
11
+ group: o.group,
12
+ color: o.color,
13
+ isActive: p({
12
14
  path: o.path,
13
15
  end: o.end ?? o.path === "/"
14
- }, t) !== null || (o.activeOn ?? []).some((i) => r({
15
- path: i,
16
+ }, t) !== null || (o.activeOn ?? []).some((u) => p({
17
+ path: u,
16
18
  end: !1
17
19
  }, t) !== null),
18
20
  onSelect: () => a(o.path)
@@ -20,19 +22,19 @@ var k = ({ nav: n, app: e, ...s }) => {
20
22
  n,
21
23
  t,
22
24
  a
23
- ]), c = n[0]?.path ?? "/", h = p(() => ({
24
- ...e,
25
- onHomeClick: e.onHomeClick ?? (t === c ? void 0 : () => a(c))
25
+ ]), c = n[0]?.path ?? "/", h = e(() => ({
26
+ ...r,
27
+ onHomeClick: r.onHomeClick ?? (t === c ? void 0 : () => a(c))
26
28
  }), [
27
- e,
29
+ r,
28
30
  t,
29
31
  c,
30
32
  a
31
33
  ]);
32
- return /* @__PURE__ */ u(m, {
33
- ...s,
34
+ return /* @__PURE__ */ m(i, {
35
+ ...l,
34
36
  app: h,
35
- nav: l
37
+ nav: s
36
38
  });
37
39
  };
38
40
  export {
@@ -58,6 +58,7 @@ var l = {
58
58
  pageNoMatches: "No matches",
59
59
  pageSearchOptions: (e) => `Search ${e.toLowerCase()}`,
60
60
  pageSelectedCount: (e) => `${e} selected`,
61
+ pageWithout: (e) => `Without ${e}`,
61
62
  pageRatingAtLeast: (e) => `${e}★ and up`,
62
63
  pageDateSince: (e) => `since ${e}`,
63
64
  pageDateUntil: (e) => `until ${e}`,
@@ -199,6 +200,7 @@ var l = {
199
200
  pageNoMatches: "Nicio potrivire",
200
201
  pageSearchOptions: (e) => `Caută în ${e.toLowerCase()}`,
201
202
  pageSelectedCount: (e) => `${e} selectate`,
203
+ pageWithout: (e) => `Fără ${e}`,
202
204
  pageRatingAtLeast: (e) => `${e}★ sau mai mult`,
203
205
  pageDateSince: (e) => `din ${e}`,
204
206
  pageDateUntil: (e) => `până la ${e}`,
@@ -23,7 +23,7 @@ var r = (i) => {
23
23
  const o = {
24
24
  ...i,
25
25
  lib: d,
26
- libBuildNumber: 668,
26
+ libBuildNumber: 675,
27
27
  libCommit: n,
28
28
  libBuildDate: t
29
29
  };
package/dist/index.d.ts CHANGED
@@ -215,7 +215,12 @@ export declare interface AppNavItem {
215
215
  id: string;
216
216
  label: string;
217
217
  icon: IconName;
218
- count?: number;
218
+ /** A number or short text beside the label ("3/12"). */
219
+ count?: number | string;
220
+ /** Sections with the same group are listed together under that heading in the side list. */
221
+ group?: string;
222
+ /** Tints the section's icon, e.g. a category colour. */
223
+ color?: string;
219
224
  isActive: boolean;
220
225
  onSelect: () => void;
221
226
  }
@@ -808,6 +813,7 @@ export declare interface ContextToastAction {
808
813
  onClick: () => void;
809
814
  }
810
815
 
816
+ /** @deprecated Use PageShell inside an AppFrame / RouterAppFrame (see the page-shell-usage skill). Kept for the showcase demos. */
811
817
  export declare const ControlPanel: default_2.FC<ControlPanelProps>;
812
818
 
813
819
  export declare interface ControlPanelAction {
@@ -1079,6 +1085,7 @@ export declare interface ControlPanelProps {
1079
1085
  visibleColumns?: ControlPanelVisibleColumnsConfig;
1080
1086
  }
1081
1087
 
1088
+ /** @deprecated Use PageShell inside an AppFrame / RouterAppFrame (see the page-shell-usage skill). Kept for the showcase demos. */
1082
1089
  export declare const ControlPanelProvider: default_2.FC<ControlPanelProviderProps>;
1083
1090
 
1084
1091
  declare interface ControlPanelProviderProps {
@@ -1849,6 +1856,10 @@ export declare interface FilterOption {
1849
1856
  count?: number | string;
1850
1857
  icon?: IconName;
1851
1858
  color?: string;
1859
+ /** A small round picture before the label: a face, a product. */
1860
+ imageUrl?: string;
1861
+ /** A hover hint on the option, for what its label can't say ("5–50 km out"). */
1862
+ hint?: string;
1852
1863
  }
1853
1864
 
1854
1865
  /**
@@ -2980,6 +2991,11 @@ export declare interface MultiFilterSpec extends FilterSpecBase {
2980
2991
  kind: 'multi';
2981
2992
  options: FilterOption[];
2982
2993
  control?: FilterControl;
2994
+ /**
2995
+ * What the applied chips list: the picked options (default), or the ones left out ("Without X"). Use `excluded`
2996
+ * with a `defaultValue` of every option, for filters where everything is on until the user turns some off.
2997
+ */
2998
+ chips?: 'selected' | 'excluded';
2983
2999
  }
2984
3000
 
2985
3001
  export declare const NavBar: default_2.FC<NavBarProps>;
@@ -3039,9 +3055,21 @@ export declare interface PageAction {
3039
3055
  menu?: boolean;
3040
3056
  /** In the menu, draws a divider above this action to start a new group. */
3041
3057
  separator?: boolean;
3058
+ /** Asks first, in a dialog, and runs `onClick` only on yes: for actions that can't be undone. */
3059
+ confirm?: PageActionConfirm;
3042
3060
  onClick: () => void;
3043
3061
  }
3044
3062
 
3063
+ export declare interface PageActionConfirm {
3064
+ /** Defaults to the action's label. */
3065
+ title?: string;
3066
+ message: string;
3067
+ /** Defaults to "Confirm". */
3068
+ confirmLabel?: string;
3069
+ /** Defaults to `danger`. */
3070
+ variant?: ButtonVariant;
3071
+ }
3072
+
3045
3073
  export declare interface PageColumns {
3046
3074
  options: Array<{
3047
3075
  value: string;
@@ -3095,8 +3123,11 @@ export declare interface PageSearch {
3095
3123
  /** Lays out a page's title, actions, search, sort, filters and view options around its content, per device. */
3096
3124
  export declare const PageShell: FC<PageShellProps>;
3097
3125
 
3098
- /** The layouts built so far. More shells (bar, catalog, scope, focus) arrive as pages need them. */
3099
- export declare type PageShellLayout = 'workbench';
3126
+ /**
3127
+ * `workbench` (the default) is the full layout. `focus` is for a page that needs the whole screen and none of the
3128
+ * list chrome, such as a running quiz: a slim top bar with the title, actions and menu, and no side column.
3129
+ */
3130
+ export declare type PageShellLayout = 'workbench' | 'focus';
3100
3131
 
3101
3132
  export declare interface PageShellProps {
3102
3133
  layout?: PageShellLayout;
@@ -3124,14 +3155,15 @@ export declare interface PageShellProps {
3124
3155
  tabs?: PageTabs;
3125
3156
  /** This page's own indicator (e.g. an overdue bell), shown where the frame's `status` goes, in its place. */
3126
3157
  status?: ReactNode;
3158
+ /** A panel docked on the right on desktop (details of the picked item, a map legend); below the content elsewhere. */
3159
+ aside?: ReactNode;
3160
+ /** A bar that stays at the bottom of the screen while the page scrolls, such as a player; above the phone tab bar. */
3161
+ footer?: ReactNode;
3127
3162
  children: ReactNode;
3128
3163
  }
3129
3164
 
3130
3165
  export declare interface PageSort {
3131
- fields: Array<{
3132
- value: string;
3133
- label: string;
3134
- }>;
3166
+ fields: PageSortField[];
3135
3167
  value: PageSortValue;
3136
3168
  /** Marks the sort as changed from the page's default. */
3137
3169
  highlighted?: boolean;
@@ -3140,6 +3172,13 @@ export declare interface PageSort {
3140
3172
 
3141
3173
  export declare type PageSortDirection = 'asc' | 'desc';
3142
3174
 
3175
+ export declare interface PageSortField {
3176
+ value: string;
3177
+ label: string;
3178
+ /** A field that only sorts one way ("Newest first"): picking it sets this direction and hides the direction switch. */
3179
+ direction?: PageSortDirection;
3180
+ }
3181
+
3143
3182
  export declare interface PageSortValue {
3144
3183
  field: string;
3145
3184
  direction: PageSortDirection;
@@ -3171,6 +3210,7 @@ export declare interface PageView {
3171
3210
  groupBy?: PageGroupBy;
3172
3211
  toggles?: PageViewToggle[];
3173
3212
  choices?: PageViewChoice[];
3213
+ sliders?: PageViewSlider[];
3174
3214
  }
3175
3215
 
3176
3216
  /** A display setting that always holds one of its options (currency, whose figures). Not a filter: it never counts as applied. */
@@ -3191,6 +3231,18 @@ export declare interface PageViewMode {
3191
3231
  icon: IconName;
3192
3232
  }
3193
3233
 
3234
+ /** A sized display preference shown with the view options, e.g. photo size. */
3235
+ export declare interface PageViewSlider {
3236
+ id: string;
3237
+ label: string;
3238
+ min: number;
3239
+ max: number;
3240
+ step?: number;
3241
+ unit?: string;
3242
+ value: number;
3243
+ onChange: (value: number) => void;
3244
+ }
3245
+
3194
3246
  /** An on/off display preference shown with the view options, e.g. "Hide empty fields in cards". */
3195
3247
  export declare interface PageViewToggle {
3196
3248
  id: string;
@@ -3393,6 +3445,8 @@ export declare interface RangeFilterSpec extends FilterSpecBase {
3393
3445
  max: number;
3394
3446
  step?: number;
3395
3447
  unit?: string;
3448
+ /** Adds from/to number boxes under the slider, for exact values the thumbs can't hit. */
3449
+ inputs?: boolean;
3396
3450
  }
3397
3451
 
3398
3452
  export declare const RangeSlider: FC<RangeSliderProps>;
@@ -4096,6 +4150,7 @@ export declare interface ToggleSwitchProps {
4096
4150
 
4097
4151
  export declare type ToggleSwitchVariant = 'plain' | 'default' | 'success' | 'info' | 'warning' | 'danger';
4098
4152
 
4153
+ /** @deprecated Use PageShell inside an AppFrame / RouterAppFrame (see the page-shell-usage skill). Kept for the showcase demos. */
4099
4154
  export declare const Toolbar: default_2.FC<ToolbarProps>;
4100
4155
 
4101
4156
  export declare interface ToolbarControlPanelToggleConfig {
package/dist/router.d.ts CHANGED
@@ -43,7 +43,12 @@ declare interface AppNavItem {
43
43
  id: string;
44
44
  label: string;
45
45
  icon: IconName;
46
- count?: number;
46
+ /** A number or short text beside the label ("3/12"). */
47
+ count?: number | string;
48
+ /** Sections with the same group are listed together under that heading in the side list. */
49
+ group?: string;
50
+ /** Tints the section's icon, e.g. a category colour. */
51
+ color?: string;
47
52
  isActive: boolean;
48
53
  onSelect: () => void;
49
54
  }
@@ -52,7 +57,11 @@ export declare interface AppRouteNavItem {
52
57
  path: string;
53
58
  label: string;
54
59
  icon: IconName;
55
- count?: number;
60
+ count?: number | string;
61
+ /** Sections with the same group are listed together under that heading. */
62
+ group?: string;
63
+ /** Tints the section's icon. */
64
+ color?: string;
56
65
  /** Whether only the exact path counts as this section. Defaults to true for '/' and false otherwise, so '/archive/12' still lights up Archive. */
57
66
  end?: boolean;
58
67
  /** Other paths that belong to this section, e.g. ['/person/:id/*'] for a People section's detail pages. */
package/dist/version.js CHANGED
@@ -1,4 +1,4 @@
1
- var I = "3.34.0", B = 668, L = "c895360", _ = "2026-11-07T22:47:26.741Z", r = "668";
1
+ var I = "3.36.0", B = 675, L = "26e0028", _ = "2026-11-08T07:38:36.944Z", r = "675";
2
2
  export {
3
3
  _ as LIB_BUILD_DATE,
4
4
  r as LIB_BUILD_ID,
package/dist/version.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
- "version": "3.34.0",
3
- "buildNumber": 668,
4
- "commit": "c895360",
5
- "buildDate": "2026-11-07T22:47:26.741Z"
2
+ "version": "3.36.0",
3
+ "buildNumber": 675,
4
+ "commit": "26e0028",
5
+ "buildDate": "2026-11-08T07:38:36.944Z"
6
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memobit/libs",
3
- "version": "3.34.0",
3
+ "version": "3.36.0",
4
4
  "description": "React component library powering the Memobit apps — 100+ components, helpers and hooks. Icons ship as @memobit/icons and themes as @memobit/themes. TypeScript-first, ESM-only, React 19.",
5
5
  "keywords": [
6
6
  "react",