@memobit/libs 3.35.0 → 4.0.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.
@@ -1,34 +1,34 @@
1
- import { ThemeContext as A } from "./ThemeContextValue.js";
2
- import { Tooltip as F } from "../Tooltip/Tooltip2.js";
1
+ import { DEFAULT_FALLBACK_THEME as F, ThemeContext as R } from "./ThemeContextValue.js";
2
+ import { Tooltip as j } from "../Tooltip/Tooltip2.js";
3
3
  import { THEME_CONFIGS as c, getThemeConfig as k } from "./themeConfig.js";
4
- import { useCallback as m, useEffect as I, useState as v } from "react";
5
- import { jsx as f, jsxs as E } from "react/jsx-runtime";
6
- var b = "theme-stylesheet", w = "theme-font-link", L = "theme-font-link-display", C = "theme-font-link-mono", q = ({ children: M, theme: y, effects: N, onSave: g, allowedThemes: s, fallbackTheme: P = "luna" }) => {
7
- const [d, l] = v(null), [S, a] = v(null), [D, T] = v(!1), O = k(y) === void 0 ? P : y, o = d ?? O, p = S ?? N;
4
+ import { useCallback as m, useEffect as I, useState as E } from "react";
5
+ import { jsx as f, jsxs as v } from "react/jsx-runtime";
6
+ var L = "theme-stylesheet", b = "theme-font-link", w = "theme-font-link-display", C = "theme-font-link-mono", J = ({ children: M, theme: y, effects: N, onSave: g, allowedThemes: s, fallbackTheme: D = F }) => {
7
+ const [d, l] = E(null), [P, a] = E(null), [S, T] = E(!1), U = k(y) === void 0 ? D : y, o = d ?? U, p = P ?? N;
8
8
  I(() => {
9
9
  document.documentElement.setAttribute("data-theme", o);
10
10
  const i = (typeof __MEMOBIT_THEME_URLS__ > "u" ? void 0 : __MEMOBIT_THEME_URLS__)?.[o];
11
11
  if (i !== void 0) {
12
- let e = document.getElementById(b);
13
- e || (e = document.createElement("link"), e.id = b, e.rel = "stylesheet", document.head.appendChild(e));
12
+ let e = document.getElementById(L);
13
+ e || (e = document.createElement("link"), e.id = L, e.rel = "stylesheet", document.head.appendChild(e));
14
14
  const t = new URL(i, import.meta.url).href;
15
15
  e.href !== t && (e.href = t);
16
16
  }
17
17
  const r = k(o);
18
18
  if (r) {
19
- let e = document.getElementById(w);
20
- e || (e = document.createElement("link"), e.id = w, e.rel = "stylesheet", document.head.appendChild(e)), e.href = r.fontUrl;
21
- let t = document.getElementById(L);
22
- r.fontUrlDisplay ? (t || (t = document.createElement("link"), t.id = L, t.rel = "stylesheet", document.head.appendChild(t)), t.href = r.fontUrlDisplay) : t?.remove();
19
+ let e = document.getElementById(b);
20
+ e || (e = document.createElement("link"), e.id = b, e.rel = "stylesheet", document.head.appendChild(e)), e.href = r.fontUrl;
21
+ let t = document.getElementById(w);
22
+ r.fontUrlDisplay ? (t || (t = document.createElement("link"), t.id = w, t.rel = "stylesheet", document.head.appendChild(t)), t.href = r.fontUrlDisplay) : t?.remove();
23
23
  let n = document.getElementById(C);
24
24
  r.fontUrlMono ? (n || (n = document.createElement("link"), n.id = C, n.rel = "stylesheet", document.head.appendChild(n)), n.href = r.fontUrlMono) : n?.remove();
25
25
  }
26
26
  }, [o]);
27
- const U = m((i) => {
27
+ const O = m((i) => {
28
28
  l(i);
29
29
  }, []), K = m((i) => {
30
30
  a(i);
31
- }, []), B = m(() => {
31
+ }, []), A = m(() => {
32
32
  l(null), a(null);
33
33
  }, []);
34
34
  I(() => {
@@ -42,8 +42,8 @@ var b = "theme-stylesheet", w = "theme-font-link", L = "theme-font-link-display"
42
42
  e.preventDefault();
43
43
  const t = c.map((u) => u.value), n = s && s.length > 0 ? t.filter((u) => s.includes(u)) : t;
44
44
  if (n.length === 0) return;
45
- const _ = n.indexOf(o), R = ((_ === -1 ? 0 : _) + (e.key === "]" ? 1 : -1) + n.length) % n.length;
46
- l(n[R]);
45
+ const _ = n.indexOf(o), H = ((_ === -1 ? 0 : _) + (e.key === "]" ? 1 : -1) + n.length) % n.length;
46
+ l(n[H]);
47
47
  } else e.key === "Escape" && d && (e.preventDefault(), l(null), a(null));
48
48
  };
49
49
  return window.addEventListener("keydown", r), () => window.removeEventListener("keydown", r);
@@ -52,7 +52,7 @@ var b = "theme-stylesheet", w = "theme-font-link", L = "theme-font-link-display"
52
52
  d,
53
53
  s
54
54
  ]);
55
- const h = c.findIndex((i) => i.value === o), x = h >= 0 ? c[h].label : o, H = m(() => {
55
+ const h = c.findIndex((i) => i.value === o), x = h >= 0 ? c[h].label : o, B = m(() => {
56
56
  g?.({
57
57
  theme: o,
58
58
  effects: p
@@ -62,16 +62,16 @@ var b = "theme-stylesheet", w = "theme-font-link", L = "theme-font-link-display"
62
62
  p,
63
63
  g
64
64
  ]);
65
- return /* @__PURE__ */ E(A.Provider, {
65
+ return /* @__PURE__ */ v(R.Provider, {
66
66
  value: {
67
67
  theme: o,
68
68
  effects: p,
69
- setPreviewTheme: U,
69
+ setPreviewTheme: O,
70
70
  setPreviewEffects: K,
71
- commitPreview: H,
72
- clearPreview: B
71
+ commitPreview: B,
72
+ clearPreview: A
73
73
  },
74
- children: [M, d && /* @__PURE__ */ E("div", {
74
+ children: [M, d && /* @__PURE__ */ v("div", {
75
75
  style: {
76
76
  position: "fixed",
77
77
  bottom: 16,
@@ -85,7 +85,7 @@ var b = "theme-stylesheet", w = "theme-font-link", L = "theme-font-link-display"
85
85
  boxShadow: "0 4px 16px rgba(0, 0, 0, 0.3)"
86
86
  },
87
87
  children: [
88
- /* @__PURE__ */ f(F, {
88
+ /* @__PURE__ */ f(j, {
89
89
  title: "Copy theme name",
90
90
  children: /* @__PURE__ */ f("span", {
91
91
  onClick: () => {
@@ -95,7 +95,7 @@ var b = "theme-stylesheet", w = "theme-font-link", L = "theme-font-link-display"
95
95
  children: x
96
96
  })
97
97
  }),
98
- /* @__PURE__ */ E("span", {
98
+ /* @__PURE__ */ v("span", {
99
99
  style: {
100
100
  opacity: 0.6,
101
101
  marginLeft: 8,
@@ -116,7 +116,7 @@ var b = "theme-stylesheet", w = "theme-font-link", L = "theme-font-link-display"
116
116
  },
117
117
  children: "[ prev · ] next · Esc revert"
118
118
  }),
119
- D && /* @__PURE__ */ f("div", {
119
+ S && /* @__PURE__ */ f("div", {
120
120
  style: {
121
121
  position: "absolute",
122
122
  bottom: "calc(100% + 6px)",
@@ -136,5 +136,5 @@ var b = "theme-stylesheet", w = "theme-font-link", L = "theme-font-link-display"
136
136
  });
137
137
  };
138
138
  export {
139
- q as ThemeProvider
139
+ J as ThemeProvider
140
140
  };
@@ -1,5 +1,6 @@
1
1
  import { createContext as e } from "react";
2
- var o = e(void 0);
2
+ var r = "sandy-parchment", o = e(void 0);
3
3
  export {
4
+ r as DEFAULT_FALLBACK_THEME,
4
5
  o as ThemeContext
5
6
  };
@@ -1,8 +1,9 @@
1
- import { THEME_CONFIGS as a } from "./themeConfig.js";
2
- var s = (o, r = "luna") => {
3
- const t = o.trim().toLowerCase(), e = a.find((m) => (m.recommendedApps ?? []).some((p) => p.toLowerCase() === t));
1
+ import { DEFAULT_FALLBACK_THEME as a } from "./ThemeContextValue.js";
2
+ import { THEME_CONFIGS as n } from "./themeConfig.js";
3
+ var A = (o, r = a) => {
4
+ const m = o.trim().toLowerCase(), e = n.find((t) => (t.recommendedApps ?? []).some((p) => p.toLowerCase() === m));
4
5
  return e ? e.value : r;
5
6
  };
6
7
  export {
7
- s as getDefaultThemeForApp
8
+ A as getDefaultThemeForApp
8
9
  };
@@ -23,7 +23,7 @@ var r = (i) => {
23
23
  const o = {
24
24
  ...i,
25
25
  lib: d,
26
- libBuildNumber: 672,
26
+ libBuildNumber: 678,
27
27
  libCommit: n,
28
28
  libBuildDate: t
29
29
  };
package/dist/index.d.ts CHANGED
@@ -22,6 +22,7 @@ import { RefObject } from 'react';
22
22
  import { SyntheticEvent } from 'react';
23
23
  import { THEME_CONFIGS } from '@memobit/themes';
24
24
  import { ThemeConfig } from '@memobit/themes';
25
+ import { ThemeName } from '@memobit/themes';
25
26
  import { TouchEvent as TouchEvent_2 } from 'react';
26
27
 
27
28
  export declare const Accordion: default_2.FC<AccordionProps>;
@@ -215,7 +216,12 @@ export declare interface AppNavItem {
215
216
  id: string;
216
217
  label: string;
217
218
  icon: IconName;
218
- count?: number;
219
+ /** A number or short text beside the label ("3/12"). */
220
+ count?: number | string;
221
+ /** Sections with the same group are listed together under that heading in the side list. */
222
+ group?: string;
223
+ /** Tints the section's icon, e.g. a category colour. */
224
+ color?: string;
219
225
  isActive: boolean;
220
226
  onSelect: () => void;
221
227
  }
@@ -808,6 +814,7 @@ export declare interface ContextToastAction {
808
814
  onClick: () => void;
809
815
  }
810
816
 
817
+ /** @deprecated Use PageShell inside an AppFrame / RouterAppFrame (see the page-shell-usage skill). Kept for the showcase demos. */
811
818
  export declare const ControlPanel: default_2.FC<ControlPanelProps>;
812
819
 
813
820
  export declare interface ControlPanelAction {
@@ -1079,6 +1086,7 @@ export declare interface ControlPanelProps {
1079
1086
  visibleColumns?: ControlPanelVisibleColumnsConfig;
1080
1087
  }
1081
1088
 
1089
+ /** @deprecated Use PageShell inside an AppFrame / RouterAppFrame (see the page-shell-usage skill). Kept for the showcase demos. */
1082
1090
  export declare const ControlPanelProvider: default_2.FC<ControlPanelProviderProps>;
1083
1091
 
1084
1092
  declare interface ControlPanelProviderProps {
@@ -1339,7 +1347,7 @@ export declare interface DataViewProps<T> {
1339
1347
  totalItems?: number;
1340
1348
  /** Group rows by a key. Rows render in group sections within the paginated slice. */
1341
1349
  group?: DataViewGroupConfig<T>;
1342
- /** Display the "Showing X-Y of Z" results-count label above the data. Default: true. */
1350
+ /** Display the "Showing X-Y of Z" results-count label above the data. When unset, it appears only if the list needs more than one page. `true` and `false` always show or always hide it. */
1343
1351
  showResultsCount?: boolean;
1344
1352
  /** Unfiltered total used to render the "filtered (... total)" form when smaller than this value. Defaults to `data.length`. */
1345
1353
  totalCount?: number;
@@ -1849,6 +1857,10 @@ export declare interface FilterOption {
1849
1857
  count?: number | string;
1850
1858
  icon?: IconName;
1851
1859
  color?: string;
1860
+ /** A small round picture before the label: a face, a product. */
1861
+ imageUrl?: string;
1862
+ /** A hover hint on the option, for what its label can't say ("5–50 km out"). */
1863
+ hint?: string;
1852
1864
  }
1853
1865
 
1854
1866
  /**
@@ -3044,9 +3056,21 @@ export declare interface PageAction {
3044
3056
  menu?: boolean;
3045
3057
  /** In the menu, draws a divider above this action to start a new group. */
3046
3058
  separator?: boolean;
3059
+ /** Asks first, in a dialog, and runs `onClick` only on yes: for actions that can't be undone. */
3060
+ confirm?: PageActionConfirm;
3047
3061
  onClick: () => void;
3048
3062
  }
3049
3063
 
3064
+ export declare interface PageActionConfirm {
3065
+ /** Defaults to the action's label. */
3066
+ title?: string;
3067
+ message: string;
3068
+ /** Defaults to "Confirm". */
3069
+ confirmLabel?: string;
3070
+ /** Defaults to `danger`. */
3071
+ variant?: ButtonVariant;
3072
+ }
3073
+
3050
3074
  export declare interface PageColumns {
3051
3075
  options: Array<{
3052
3076
  value: string;
@@ -3100,8 +3124,11 @@ export declare interface PageSearch {
3100
3124
  /** Lays out a page's title, actions, search, sort, filters and view options around its content, per device. */
3101
3125
  export declare const PageShell: FC<PageShellProps>;
3102
3126
 
3103
- /** The layouts built so far. More shells (bar, catalog, scope, focus) arrive as pages need them. */
3104
- export declare type PageShellLayout = 'workbench';
3127
+ /**
3128
+ * `workbench` (the default) is the full layout. `focus` is for a page that needs the whole screen and none of the
3129
+ * list chrome, such as a running quiz: a slim top bar with the title, actions and menu, and no side column.
3130
+ */
3131
+ export declare type PageShellLayout = 'workbench' | 'focus';
3105
3132
 
3106
3133
  export declare interface PageShellProps {
3107
3134
  layout?: PageShellLayout;
@@ -3129,14 +3156,15 @@ export declare interface PageShellProps {
3129
3156
  tabs?: PageTabs;
3130
3157
  /** This page's own indicator (e.g. an overdue bell), shown where the frame's `status` goes, in its place. */
3131
3158
  status?: ReactNode;
3159
+ /** A panel docked on the right on desktop (details of the picked item, a map legend); below the content elsewhere. */
3160
+ aside?: ReactNode;
3161
+ /** A bar that stays at the bottom of the screen while the page scrolls, such as a player; above the phone tab bar. */
3162
+ footer?: ReactNode;
3132
3163
  children: ReactNode;
3133
3164
  }
3134
3165
 
3135
3166
  export declare interface PageSort {
3136
- fields: Array<{
3137
- value: string;
3138
- label: string;
3139
- }>;
3167
+ fields: PageSortField[];
3140
3168
  value: PageSortValue;
3141
3169
  /** Marks the sort as changed from the page's default. */
3142
3170
  highlighted?: boolean;
@@ -3145,6 +3173,13 @@ export declare interface PageSort {
3145
3173
 
3146
3174
  export declare type PageSortDirection = 'asc' | 'desc';
3147
3175
 
3176
+ export declare interface PageSortField {
3177
+ value: string;
3178
+ label: string;
3179
+ /** A field that only sorts one way ("Newest first"): picking it sets this direction and hides the direction switch. */
3180
+ direction?: PageSortDirection;
3181
+ }
3182
+
3148
3183
  export declare interface PageSortValue {
3149
3184
  field: string;
3150
3185
  direction: PageSortDirection;
@@ -3176,6 +3211,7 @@ export declare interface PageView {
3176
3211
  groupBy?: PageGroupBy;
3177
3212
  toggles?: PageViewToggle[];
3178
3213
  choices?: PageViewChoice[];
3214
+ sliders?: PageViewSlider[];
3179
3215
  }
3180
3216
 
3181
3217
  /** A display setting that always holds one of its options (currency, whose figures). Not a filter: it never counts as applied. */
@@ -3196,6 +3232,18 @@ export declare interface PageViewMode {
3196
3232
  icon: IconName;
3197
3233
  }
3198
3234
 
3235
+ /** A sized display preference shown with the view options, e.g. photo size. */
3236
+ export declare interface PageViewSlider {
3237
+ id: string;
3238
+ label: string;
3239
+ min: number;
3240
+ max: number;
3241
+ step?: number;
3242
+ unit?: string;
3243
+ value: number;
3244
+ onChange: (value: number) => void;
3245
+ }
3246
+
3199
3247
  /** An on/off display preference shown with the view options, e.g. "Hide empty fields in cards". */
3200
3248
  export declare interface PageViewToggle {
3201
3249
  id: string;
@@ -3398,6 +3446,8 @@ export declare interface RangeFilterSpec extends FilterSpecBase {
3398
3446
  max: number;
3399
3447
  step?: number;
3400
3448
  unit?: string;
3449
+ /** Adds from/to number boxes under the slider, for exact values the thumbs can't hit. */
3450
+ inputs?: boolean;
3401
3451
  }
3402
3452
 
3403
3453
  export declare const RangeSlider: FC<RangeSliderProps>;
@@ -3863,7 +3913,7 @@ export declare interface TextFilterValue {
3863
3913
  mode?: string;
3864
3914
  }
3865
3915
 
3866
- export declare type Theme = 'arctic-blue' | 'asphalt-code' | 'atelier-media' | 'audit-ember' | 'azure-night' | 'blossom-meadow' | 'blueprint-clay' | 'carbon-velocity' | 'chalk-circuit' | 'chrono-atlas' | 'circuit-harbor' | 'cobalt-pulse' | 'citrus-vital' | 'crawler-dusk' | 'crimson-dusk' | 'cyber-forest' | 'dashdarkx' | 'emerald-ledger' | 'garden-harvest' | 'graphite-shell' | 'horizon-amber' | 'indigo-stitch' | 'ivory-serif' | 'kindred-ink' | 'lamplight' | 'lumen' | 'luna' | 'mesh-circuit' | 'midnight-atlas' | 'midnight-amber' | 'noir-marquee' | 'ocean-breeze' | 'ocean-depths' | 'orbital-night' | 'sandstone' | 'sandy-parchment' | 'screening-room' | 'signal-burst' | 'signal-clarity' | 'slate-focus' | 'slate-bazaar' | 'tailwind-vue-dark' | 'terminal-phosphor' | 'terracotta-kitchen' | 'vault-guard' | 'verdant-pulse' | 'vital-aurora' | 'vital-signal' | 'war-room';
3916
+ export declare type Theme = ThemeName;
3867
3917
 
3868
3918
  export { THEME_CONFIGS }
3869
3919
 
@@ -4101,6 +4151,7 @@ export declare interface ToggleSwitchProps {
4101
4151
 
4102
4152
  export declare type ToggleSwitchVariant = 'plain' | 'default' | 'success' | 'info' | 'warning' | 'danger';
4103
4153
 
4154
+ /** @deprecated Use PageShell inside an AppFrame / RouterAppFrame (see the page-shell-usage skill). Kept for the showcase demos. */
4104
4155
  export declare const Toolbar: default_2.FC<ToolbarProps>;
4105
4156
 
4106
4157
  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.35.0", B = 672, L = "7efe6c9", _ = "2026-11-08T05:33:34.358Z", r = "672";
1
+ var I = "4.0.0", B = 678, L = "42fdb7e", _ = "2026-11-08T16:08:44.618Z", r = "678";
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.35.0",
3
- "buildNumber": 672,
4
- "commit": "7efe6c9",
5
- "buildDate": "2026-11-08T05:33:34.358Z"
2
+ "version": "4.0.0",
3
+ "buildNumber": 678,
4
+ "commit": "42fdb7e",
5
+ "buildDate": "2026-11-08T16:08:44.618Z"
6
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memobit/libs",
3
- "version": "3.35.0",
3
+ "version": "4.0.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",
@@ -86,7 +86,7 @@
86
86
  "peerDependencies": {
87
87
  "@memobit/core": "1.0.0",
88
88
  "@memobit/icons": "^1.7.0",
89
- "@memobit/themes": "^1.0.0 || ^2.0.0",
89
+ "@memobit/themes": "^3.0.0",
90
90
  "react": "19.3.0",
91
91
  "react-dom": "19.3.0",
92
92
  "react-router": "8.4.0"