@memobit/libs 3.31.0 → 3.32.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 @@
1
+ .theme-lab{left:var(--spacing-16);bottom:var(--spacing-16);z-index:100000;gap:var(--spacing-12);width:min(var(--spacing-400), 100vw - var(--spacing-32));max-height:calc(100vh - var(--spacing-32));padding:var(--spacing-16);border:var(--spacing-1) solid var(--card-border-color);border-radius:var(--radius);background:var(--modal-background-color);-webkit-backdrop-filter:var(--card-backdrop-filter);backdrop-filter:var(--card-backdrop-filter);box-shadow:var(--modal-box-shadow);color:var(--body-color);font-size:var(--font-size-sm);flex-direction:column;display:flex;position:fixed;overflow-y:auto}.theme-lab__pill{left:var(--spacing-16);bottom:var(--spacing-16);z-index:100000;align-items:center;gap:var(--spacing-8);padding:var(--spacing-8) var(--spacing-12);border:var(--spacing-1) solid var(--card-border-color);border-radius:var(--radius-full);background:var(--modal-background-color);box-shadow:var(--card-box-shadow);color:var(--body-color);font:inherit;font-size:var(--font-size-xs);font-weight:var(--font-weight-semibold);cursor:pointer;transition:border-color var(--transition-fast);display:inline-flex;position:fixed}.theme-lab__pill:hover{border-color:var(--card-hover-border-color)}.theme-lab__header{align-items:center;gap:var(--spacing-8);display:flex}.theme-lab__title{font-family:var(--font-family-display);font-size:var(--font-size-md);font-weight:var(--font-weight-bold);color:var(--body-title-color)}.theme-lab__hint{color:var(--body-color-muted);font-size:var(--font-size-xs);flex:1}.theme-lab__note{color:var(--body-color-muted);font-size:var(--font-size-xs)}.theme-lab__axis{gap:var(--spacing-6);flex-direction:column;display:flex}.theme-lab__axis-label{color:var(--form-control-label-color);font-size:var(--font-size-xs);font-weight:var(--font-weight-semibold);letter-spacing:var(--form-control-label-letter-spacing);text-transform:var(--form-control-label-text-transform)}.theme-lab__chips{gap:var(--spacing-6);flex-wrap:wrap;display:flex}
@@ -0,0 +1,85 @@
1
+ import './ThemeLab.css';
2
+ import { Icon as d } from "../Icon/Icon2.js";
3
+ import { useTheme as p } from "../ThemeSettings/useTheme.js";
4
+ import { Button as v } from "../Button/Button2.js";
5
+ import { Tooltip as u } from "../Tooltip/Tooltip2.js";
6
+ import { Chip as b } from "../Chip/Chip2.js";
7
+ import { ToggleButtons as _ } from "../ToggleButtons/ToggleButtons2.js";
8
+ import { getThemeConfig as f } from "../ThemeSettings/themeConfig.js";
9
+ import { useThemeLab as T } from "./useThemeLab.js";
10
+ /* empty css */
11
+ import { useState as g } from "react";
12
+ import { jsx as e, jsxs as i } from "react/jsx-runtime";
13
+ import { AUTHORED_THEMES as m } from "@memobit/themes";
14
+ var N = [{
15
+ key: "classic",
16
+ label: "v1 Classic"
17
+ }, {
18
+ key: "authored",
19
+ label: "v2 Authored"
20
+ }], C = new Set(m.map((t) => t.id)), E = (t) => f(t) !== void 0, P = ({ storageKey: t = "memobit:theme-lab" }) => {
21
+ const { theme: s, setPreviewTheme: r } = p(), { engine: l, setEngine: h } = T(t), [n, o] = g(!1), c = {
22
+ classic: `v1 · ${s}`,
23
+ authored: `v2 authored · ${s}`
24
+ };
25
+ return n ? /* @__PURE__ */ i("div", {
26
+ className: "theme-lab",
27
+ children: [
28
+ /* @__PURE__ */ i("div", {
29
+ className: "theme-lab__header",
30
+ children: [
31
+ /* @__PURE__ */ e("span", {
32
+ className: "theme-lab__title",
33
+ children: "Theme lab"
34
+ }),
35
+ /* @__PURE__ */ e("span", {
36
+ className: "theme-lab__hint",
37
+ children: "Press \\ to flip v1 / v2"
38
+ }),
39
+ /* @__PURE__ */ e(u, {
40
+ title: "Collapse",
41
+ children: /* @__PURE__ */ e(v, {
42
+ variant: "ghost",
43
+ size: "small",
44
+ icon: "minus",
45
+ onClick: () => o(!1)
46
+ })
47
+ })
48
+ ]
49
+ }),
50
+ /* @__PURE__ */ e(_, {
51
+ states: N,
52
+ state: l,
53
+ size: "small",
54
+ onToggleChange: (a) => h(a === "authored" ? "authored" : "classic")
55
+ }),
56
+ /* @__PURE__ */ e("span", {
57
+ className: "theme-lab__note",
58
+ children: l === "classic" ? `v1 shows the classic theme "${s}".` : C.has(s) ? `v2 is "${s}" written as its design choices, with every component value derived from them.` : `"${s}" has no authored version yet, so v1 shows through. Pick one below.`
59
+ }),
60
+ /* @__PURE__ */ i("div", {
61
+ className: "theme-lab__axis",
62
+ children: [/* @__PURE__ */ e("span", {
63
+ className: "theme-lab__axis-label",
64
+ children: "Authored themes"
65
+ }), /* @__PURE__ */ e("div", {
66
+ className: "theme-lab__chips",
67
+ children: m.map((a) => /* @__PURE__ */ e(b, {
68
+ size: "small",
69
+ selected: a.id === s,
70
+ onClick: () => E(a.id) && r(a.id),
71
+ children: a.label
72
+ }, a.id))
73
+ })]
74
+ })
75
+ ]
76
+ }) : /* @__PURE__ */ i("button", {
77
+ type: "button",
78
+ className: "theme-lab__pill",
79
+ onClick: () => o(!0),
80
+ children: [/* @__PURE__ */ e(d, { name: "theme-picker" }), c[l]]
81
+ });
82
+ };
83
+ export {
84
+ P as ThemeLab
85
+ };
@@ -0,0 +1,31 @@
1
+ import { useEffect as i, useState as s } from "react";
2
+ import { applyAuthoredEngine as l, clearAuthoredEngine as c } from "@memobit/themes";
3
+ var u = (e) => {
4
+ try {
5
+ const t = JSON.parse(localStorage.getItem(e) ?? "null");
6
+ return typeof t == "object" && t !== null && "engine" in t && t.engine === "authored" ? "authored" : "classic";
7
+ } catch {
8
+ return "classic";
9
+ }
10
+ }, d = (e, t) => {
11
+ try {
12
+ localStorage.setItem(e, JSON.stringify({ engine: t }));
13
+ } catch {
14
+ }
15
+ }, E = (e) => e instanceof HTMLElement && (e.tagName === "INPUT" || e.tagName === "TEXTAREA" || e.tagName === "SELECT" || e.isContentEditable), h = (e) => {
16
+ const [t, r] = s(() => u(e));
17
+ return i(() => {
18
+ t === "authored" ? l() : c(), d(e, t);
19
+ }, [t, e]), i(() => {
20
+ const a = (n) => {
21
+ n.key !== "\\" || n.ctrlKey || n.metaKey || n.altKey || E(n.target) || (n.preventDefault(), r((o) => o === "authored" ? "classic" : "authored"));
22
+ };
23
+ return window.addEventListener("keydown", a), () => window.removeEventListener("keydown", a);
24
+ }, []), {
25
+ engine: t,
26
+ setEngine: r
27
+ };
28
+ };
29
+ export {
30
+ h as useThemeLab
31
+ };
@@ -23,7 +23,7 @@ var r = (i) => {
23
23
  const o = {
24
24
  ...i,
25
25
  lib: d,
26
- libBuildNumber: 656,
26
+ libBuildNumber: 659,
27
27
  libCommit: n,
28
28
  libBuildDate: t
29
29
  };
@@ -39,6 +39,7 @@
39
39
  "logout",
40
40
  "map",
41
41
  "menu-hamburger",
42
+ "minus",
42
43
  "move",
43
44
  "next",
44
45
  "other",
@@ -0,0 +1,23 @@
1
+ import { FC } from 'react';
2
+
3
+ /**
4
+ * Dev tool: switches the app between a classic theme (v1) and its hand-made authored version
5
+ * (v2) from @memobit/themes 2.0, so the two can be compared on real pages. Render it inside
6
+ * ThemeProvider, import `@memobit/themes/authored.css` in the app, and load it lazily behind
7
+ * `import.meta.env.DEV` so production builds leave it out.
8
+ */
9
+ export declare const ThemeLab: FC<ThemeLabProps>;
10
+
11
+ export declare interface ThemeLabProps {
12
+ /** Where the chosen engine is remembered. Defaults to one key shared by every app on the origin. */
13
+ storageKey?: string;
14
+ }
15
+
16
+ export { }
17
+
18
+
19
+ declare global {
20
+ interface Window {
21
+ __VERSIONS__: FullVersionInfo;
22
+ }
23
+ }
@@ -0,0 +1,4 @@
1
+ import { ThemeLab as m } from "./components/ThemeLab/ThemeLab2.js";
2
+ export {
3
+ m as ThemeLab
4
+ };
package/dist/version.js CHANGED
@@ -1,7 +1,7 @@
1
- var I = "3.31.0", B = 656, L = "4f487ea", _ = "2026-11-07T19:44:52.809Z", a = "656";
1
+ var I = "3.32.0", B = 659, L = "2664552", _ = "2026-11-07T19:52:13.281Z", r = "659";
2
2
  export {
3
3
  _ as LIB_BUILD_DATE,
4
- a as LIB_BUILD_ID,
4
+ r as LIB_BUILD_ID,
5
5
  B as LIB_BUILD_NUMBER,
6
6
  L as LIB_COMMIT,
7
7
  I as LIB_VERSION
package/dist/version.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
- "version": "3.31.0",
3
- "buildNumber": 656,
4
- "commit": "4f487ea",
5
- "buildDate": "2026-11-07T19:44:52.809Z"
2
+ "version": "3.32.0",
3
+ "buildNumber": 659,
4
+ "commit": "2664552",
5
+ "buildDate": "2026-11-07T19:52:13.281Z"
6
6
  }
package/package.json CHANGED
@@ -1,147 +1,151 @@
1
- {
2
- "name": "@memobit/libs",
3
- "version": "3.31.0",
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
- "keywords": [
6
- "react",
7
- "react-components",
8
- "component-library",
9
- "ui",
10
- "ui-kit",
11
- "design-system",
12
- "typescript",
13
- "hooks",
14
- "memobit"
15
- ],
16
- "author": "Iulian Cristea <iulianx@gmail.com>",
17
- "license": "Apache-2.0",
18
- "homepage": "https://react.memobit.ro/",
19
- "repository": {
20
- "type": "git",
21
- "url": "git+https://github.com/CristeaIulian/memobit-react-library.git"
22
- },
23
- "bugs": {
24
- "url": "https://github.com/CristeaIulian/memobit-react-library/issues"
25
- },
26
- "publishConfig": {
27
- "access": "public"
28
- },
29
- "sideEffects": [
30
- "**/*.css",
31
- "**/*.scss"
32
- ],
33
- "type": "module",
34
- "main": "dist/index.js",
35
- "module": "dist/index.js",
36
- "types": "dist/index.d.ts",
37
- "exports": {
38
- ".": {
39
- "types": "./dist/index.d.ts",
40
- "import": "./dist/index.js"
41
- },
42
- "./dist/index.css": "./dist/index.css",
43
- "./mfa": {
44
- "types": "./dist/mfa.d.ts",
45
- "import": "./dist/mfa.js"
46
- },
47
- "./http": {
48
- "types": "./dist/http.d.ts",
49
- "import": "./dist/http.js"
50
- },
51
- "./router": {
52
- "types": "./dist/router.d.ts",
53
- "import": "./dist/router.js"
54
- },
55
- "./dist/styles/variables.scss": "./dist/styles/variables.scss",
56
- "./dist/styles/base.scss": "./dist/styles/base.scss",
57
- "./dist/styles/effects.scss": "./dist/styles/effects.scss",
58
- "./dist/styles/highlight.scss": "./dist/styles/highlight.scss",
59
- "./dist/styles/scrollbars.scss": "./dist/styles/scrollbars.scss",
60
- "./dist/styles/utilities.scss": "./dist/styles/utilities.scss",
61
- "./dist/styles/utility-classes.scss": "./dist/styles/utility-classes.scss",
62
- "./dist/components/*": "./dist/components/*"
63
- },
64
- "files": [
65
- "dist"
66
- ],
67
- "scripts": {
68
- "build": "vite build && npm pack",
69
- "release": "npm run build && npm publish",
70
- "check:npm-auth": "node scripts/check-npm-auth.mjs",
71
- "ship": "npm run check:npm-auth && npm version patch && npm run release && git push --follow-tags",
72
- "ship:minor": "npm run check:npm-auth && npm version minor && npm run release && git push --follow-tags",
73
- "ship:major": "npm run check:npm-auth && npm version major && npm run release && git push --follow-tags",
74
- "prepublishOnly": "vite build",
75
- "dev": "vite build --watch",
76
- "playground": "vite serve playground --config playground/vite.config.ts",
77
- "lint": "eslint .",
78
- "lint:fix": "eslint . --fix",
79
- "format": "prettier --write \"**/*.{ts,tsx,js,jsx,mjs,cjs,css,scss}\"",
80
- "format:check": "prettier --check \"**/*.{ts,tsx,js,jsx,mjs,cjs,css,scss}\""
81
- },
82
- "peerDependencies": {
83
- "@memobit/core": "1.0.0",
84
- "@memobit/icons": "^1.7.0",
85
- "@memobit/themes": "^1.0.0 || ^2.0.0",
86
- "react": "19.3.0",
87
- "react-dom": "19.3.0",
88
- "react-router": "8.4.0"
89
- },
90
- "peerDependenciesMeta": {
91
- "react-router": {
92
- "optional": true
93
- }
94
- },
95
- "devDependencies": {
96
- "@eslint/js": "9.39.4",
97
- "@memobit/core": "file:../memobit-core",
98
- "@memobit/icons": "file:../memobit-react-icons",
99
- "@memobit/themes": "file:../memobit-react-themes",
100
- "@microsoft/api-extractor": "7.59.2",
101
- "@types/node": "25.9.8",
102
- "@types/react": "19.3.0",
103
- "@types/react-dom": "19.3.0",
104
- "@vitejs/plugin-react": "6.1.1",
105
- "esbuild": "0.28.2",
106
- "eslint": "9.39.4",
107
- "eslint-config-prettier": "10.1.8",
108
- "eslint-plugin-import": "2.32.0",
109
- "eslint-plugin-prettier": "5.5.6",
110
- "eslint-plugin-react": "7.37.5",
111
- "eslint-plugin-react-hooks": "7.1.1",
112
- "eslint-plugin-react-refresh": "0.5.7",
113
- "eslint-plugin-simple-import-sort": "14.0.0",
114
- "globals": "17.12.0",
115
- "prettier": "3.9.9",
116
- "qrcode.react": "4.2.0",
117
- "react": "19.3.0",
118
- "react-dom": "19.3.0",
119
- "react-router": "8.4.0",
120
- "sass": "1.105.0",
121
- "terser": "5.51.2",
122
- "typescript": "6.0.3",
123
- "typescript-eslint": "8.70.1",
124
- "vite": "8.3.3",
125
- "vite-plugin-dts": "5.1.1",
126
- "vite-plugin-static-copy": "4.1.1"
127
- },
128
- "overrides": {
129
- "@rushstack/ts-command-line": {
130
- "argparse": "2.0.1"
131
- },
132
- "brace-expansion@1": "1.1.21",
133
- "brace-expansion@5": "5.0.12",
134
- "esbuild": "0.28.2",
135
- "fast-uri@3": "3.1.9",
136
- "immutable": "5.1.9",
137
- "js-yaml": "4.3.2",
138
- "minimatch@10": "10.2.6",
139
- "nanoid@3": "3.3.18",
140
- "picomatch@2": "2.3.2",
141
- "postcss": "8.5.28",
142
- "source-map-js": "1.2.2",
143
- "vite-plugin-static-copy": {
144
- "chokidar": "5.0.0"
145
- }
146
- }
147
- }
1
+ {
2
+ "name": "@memobit/libs",
3
+ "version": "3.32.0",
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
+ "keywords": [
6
+ "react",
7
+ "react-components",
8
+ "component-library",
9
+ "ui",
10
+ "ui-kit",
11
+ "design-system",
12
+ "typescript",
13
+ "hooks",
14
+ "memobit"
15
+ ],
16
+ "author": "Iulian Cristea <iulianx@gmail.com>",
17
+ "license": "Apache-2.0",
18
+ "homepage": "https://react.memobit.ro/",
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+https://github.com/CristeaIulian/memobit-react-library.git"
22
+ },
23
+ "bugs": {
24
+ "url": "https://github.com/CristeaIulian/memobit-react-library/issues"
25
+ },
26
+ "publishConfig": {
27
+ "access": "public"
28
+ },
29
+ "sideEffects": [
30
+ "**/*.css",
31
+ "**/*.scss"
32
+ ],
33
+ "type": "module",
34
+ "main": "dist/index.js",
35
+ "module": "dist/index.js",
36
+ "types": "dist/index.d.ts",
37
+ "exports": {
38
+ ".": {
39
+ "types": "./dist/index.d.ts",
40
+ "import": "./dist/index.js"
41
+ },
42
+ "./dist/index.css": "./dist/index.css",
43
+ "./mfa": {
44
+ "types": "./dist/mfa.d.ts",
45
+ "import": "./dist/mfa.js"
46
+ },
47
+ "./http": {
48
+ "types": "./dist/http.d.ts",
49
+ "import": "./dist/http.js"
50
+ },
51
+ "./router": {
52
+ "types": "./dist/router.d.ts",
53
+ "import": "./dist/router.js"
54
+ },
55
+ "./theme-lab": {
56
+ "types": "./dist/theme-lab.d.ts",
57
+ "import": "./dist/theme-lab.js"
58
+ },
59
+ "./dist/styles/variables.scss": "./dist/styles/variables.scss",
60
+ "./dist/styles/base.scss": "./dist/styles/base.scss",
61
+ "./dist/styles/effects.scss": "./dist/styles/effects.scss",
62
+ "./dist/styles/highlight.scss": "./dist/styles/highlight.scss",
63
+ "./dist/styles/scrollbars.scss": "./dist/styles/scrollbars.scss",
64
+ "./dist/styles/utilities.scss": "./dist/styles/utilities.scss",
65
+ "./dist/styles/utility-classes.scss": "./dist/styles/utility-classes.scss",
66
+ "./dist/components/*": "./dist/components/*"
67
+ },
68
+ "files": [
69
+ "dist"
70
+ ],
71
+ "scripts": {
72
+ "build": "vite build && npm pack",
73
+ "release": "npm run build && npm publish",
74
+ "check:npm-auth": "node scripts/check-npm-auth.mjs",
75
+ "ship": "npm run check:npm-auth && npm version patch && npm run release && git push --follow-tags",
76
+ "ship:minor": "npm run check:npm-auth && npm version minor && npm run release && git push --follow-tags",
77
+ "ship:major": "npm run check:npm-auth && npm version major && npm run release && git push --follow-tags",
78
+ "prepublishOnly": "vite build",
79
+ "dev": "vite build --watch",
80
+ "playground": "vite serve playground --config playground/vite.config.ts",
81
+ "lint": "eslint .",
82
+ "lint:fix": "eslint . --fix",
83
+ "format": "prettier --write \"**/*.{ts,tsx,js,jsx,mjs,cjs,css,scss}\"",
84
+ "format:check": "prettier --check \"**/*.{ts,tsx,js,jsx,mjs,cjs,css,scss}\""
85
+ },
86
+ "peerDependencies": {
87
+ "@memobit/core": "1.0.0",
88
+ "@memobit/icons": "^1.7.0",
89
+ "@memobit/themes": "^1.0.0 || ^2.0.0",
90
+ "react": "19.3.0",
91
+ "react-dom": "19.3.0",
92
+ "react-router": "8.4.0"
93
+ },
94
+ "peerDependenciesMeta": {
95
+ "react-router": {
96
+ "optional": true
97
+ }
98
+ },
99
+ "devDependencies": {
100
+ "@eslint/js": "9.39.4",
101
+ "@memobit/core": "file:../memobit-core",
102
+ "@memobit/icons": "file:../memobit-react-icons",
103
+ "@memobit/themes": "file:../memobit-react-themes",
104
+ "@microsoft/api-extractor": "7.59.2",
105
+ "@types/node": "25.9.8",
106
+ "@types/react": "19.3.0",
107
+ "@types/react-dom": "19.3.0",
108
+ "@vitejs/plugin-react": "6.1.1",
109
+ "esbuild": "0.28.2",
110
+ "eslint": "9.39.4",
111
+ "eslint-config-prettier": "10.1.8",
112
+ "eslint-plugin-import": "2.32.0",
113
+ "eslint-plugin-prettier": "5.5.6",
114
+ "eslint-plugin-react": "7.37.5",
115
+ "eslint-plugin-react-hooks": "7.1.1",
116
+ "eslint-plugin-react-refresh": "0.5.7",
117
+ "eslint-plugin-simple-import-sort": "14.0.0",
118
+ "globals": "17.12.0",
119
+ "prettier": "3.9.9",
120
+ "qrcode.react": "4.2.0",
121
+ "react": "19.3.0",
122
+ "react-dom": "19.3.0",
123
+ "react-router": "8.4.0",
124
+ "sass": "1.105.0",
125
+ "terser": "5.51.2",
126
+ "typescript": "6.0.3",
127
+ "typescript-eslint": "8.70.1",
128
+ "vite": "8.3.3",
129
+ "vite-plugin-dts": "5.1.1",
130
+ "vite-plugin-static-copy": "4.1.1"
131
+ },
132
+ "overrides": {
133
+ "@rushstack/ts-command-line": {
134
+ "argparse": "2.0.1"
135
+ },
136
+ "brace-expansion@1": "1.1.21",
137
+ "brace-expansion@5": "5.0.12",
138
+ "esbuild": "0.28.2",
139
+ "fast-uri@3": "3.1.9",
140
+ "immutable": "5.1.9",
141
+ "js-yaml": "4.3.2",
142
+ "minimatch@10": "10.2.6",
143
+ "nanoid@3": "3.3.18",
144
+ "picomatch@2": "2.3.2",
145
+ "postcss": "8.5.28",
146
+ "source-map-js": "1.2.2",
147
+ "vite-plugin-static-copy": {
148
+ "chokidar": "5.0.0"
149
+ }
150
+ }
151
+ }