@memobit/libs 3.15.0 → 3.16.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.
package/README.md CHANGED
@@ -1,96 +1,96 @@
1
- # @memobit/libs
2
-
3
- A TypeScript-first React component library — 100+ components, 70+ themes, plus the hooks and helpers needed to glue them together. Built for, and battle-tested across, the [Memobit](https://memobit.ro) family of apps.
4
-
5
- **📚 Live documentation & component playground → [react.memobit.ro](https://react.memobit.ro/)**
6
-
7
- ---
8
-
9
- ## Install
10
-
11
- ```bash
12
- npm install @memobit/libs
13
- ```
14
-
15
- Peer dependencies (you provide these in your own app):
16
-
17
- ```bash
18
- npm install react@^19 react-dom@^19 @memobit/core
19
- ```
20
-
21
- ## Quick start
22
-
23
- ```tsx
24
- import { Button, Card, ToastProvider, useToast } from '@memobit/libs';
25
- import '@memobit/libs/dist/index.css';
26
- import '@memobit/libs/dist/styles/themes.scss'; // optional — only if you want the bundled themes
27
-
28
- function App() {
29
- return (
30
- <ToastProvider>
31
- <Demo />
32
- </ToastProvider>
33
- );
34
- }
35
-
36
- function Demo() {
37
- const { showToast } = useToast();
38
- return (
39
- <Card>
40
- <Button onClick={() => showToast({ type: 'success', message: 'Hello' })}>
41
- Click me
42
- </Button>
43
- </Card>
44
- );
45
- }
46
- ```
47
-
48
- ## What's in the box
49
-
50
- - **Components** — Buttons, forms (Input/Select/Checkbox/DatePicker/ColorPicker/EmojiPicker/FileDropzone…), navigation (Breadcrumb/AppHeader/ControlPanel/Tabs…), overlays (Drawer/Modal/ConfirmDialog/ContextMenu/Tooltip…), data (DataView/Table/Calendar/CalendarHeatmap/Chart…), feedback (Toast/Banner/Badge/Chip/EmptyState…), and many more.
51
- - **Icons** — 470+ stroke icons, each tree-shakeable.
52
- - **Themes** — 70+ ready-made SCSS themes (Arctic Blue, Midnight Atlas, Terracotta Kitchen, Neon Tokyo, …). Theme tokens are pure CSS custom properties, so you can author your own.
53
- - **Hooks** — `useBreakpoint`, `useBodyScrollLock`, `useComponentEffect`, `useAppPersistence`, `useAuth`.
54
- - **Helpers** — date formatting, number formatting, string utilities, search/highlight, pagination, URL helpers.
55
- - **Error reporting** — lives in [`@memobit/core`](https://www.npmjs.com/package/@memobit/core) (React-free, works in Node too), a peer dependency: `ErrorBoundary` crashes are reported through it once the app calls `installErrorReporting`.
56
-
57
- See the [component reference](https://react.memobit.ro/) for props, variants, and live examples.
58
-
59
- ## Theming
60
-
61
- Themes ship as standalone SCSS files. Pick what you need:
62
-
63
- ```scss
64
- // import everything
65
- @use '@memobit/libs/dist/styles/themes.scss';
66
-
67
- // or a single theme
68
- @use '@memobit/libs/dist/styles/theming/arctic-blue.scss';
69
- ```
70
-
71
- All tokens — spacing, typography, radii, transitions, colors — are exposed as CSS custom properties (`--spacing-8`, `--card-bg`, `--button-primary-bg`, etc.) so you can override per-component or per-route without forking the library.
72
-
73
- Token reference:
74
-
75
- - Sizing / spacing / radii / transitions → `@memobit/libs/dist/styles/variables.scss`
76
- - Theme colors → `@memobit/libs/dist/styles/theming/*.scss`
77
-
78
- ## Requirements
79
-
80
- - React **19.2+** and React DOM **19.2+** (peer deps)
81
- - ESM-only (your bundler must support ESM — Vite, Next.js 13+, Webpack 5, esbuild, Rollup all do)
82
- - For SCSS imports: a Sass-capable bundler
83
-
84
- ## TypeScript
85
-
86
- Type definitions are bundled (`dist/index.d.ts`). No `@types/...` package required.
87
-
88
- ## License
89
-
90
- [Apache 2.0](./LICENSE) © Iulian Cristea
91
-
92
- ## Links
93
-
94
- - 📚 Docs & playground — https://react.memobit.ro/
95
- - 🐙 Source — https://github.com/CristeaIulian/memobit-react-library
96
- - 📦 npm — https://www.npmjs.com/package/@memobit/libs
1
+ # @memobit/libs
2
+
3
+ A TypeScript-first React component library — 100+ components, 70+ themes, plus the hooks and helpers needed to glue them together. Built for, and battle-tested across, the [Memobit](https://memobit.ro) family of apps.
4
+
5
+ **📚 Live documentation & component playground → [react.memobit.ro](https://react.memobit.ro/)**
6
+
7
+ ---
8
+
9
+ ## Install
10
+
11
+ ```bash
12
+ npm install @memobit/libs
13
+ ```
14
+
15
+ Peer dependencies (you provide these in your own app):
16
+
17
+ ```bash
18
+ npm install react@^19 react-dom@^19 @memobit/core
19
+ ```
20
+
21
+ ## Quick start
22
+
23
+ ```tsx
24
+ import { Button, Card, ToastProvider, useToast } from '@memobit/libs';
25
+ import '@memobit/libs/dist/index.css';
26
+ import '@memobit/libs/dist/styles/themes.scss'; // optional — only if you want the bundled themes
27
+
28
+ function App() {
29
+ return (
30
+ <ToastProvider>
31
+ <Demo />
32
+ </ToastProvider>
33
+ );
34
+ }
35
+
36
+ function Demo() {
37
+ const { showToast } = useToast();
38
+ return (
39
+ <Card>
40
+ <Button onClick={() => showToast({ type: 'success', message: 'Hello' })}>
41
+ Click me
42
+ </Button>
43
+ </Card>
44
+ );
45
+ }
46
+ ```
47
+
48
+ ## What's in the box
49
+
50
+ - **Components** — Buttons, forms (Input/Select/Checkbox/DatePicker/ColorPicker/EmojiPicker/FileDropzone…), navigation (Breadcrumb/AppHeader/ControlPanel/Tabs…), overlays (Drawer/Modal/ConfirmDialog/ContextMenu/Tooltip…), data (DataView/Table/Calendar/CalendarHeatmap/Chart…), feedback (Toast/Banner/Badge/Chip/EmptyState…), and many more.
51
+ - **Icons** — 470+ stroke icons, each tree-shakeable.
52
+ - **Themes** — 70+ ready-made SCSS themes (Arctic Blue, Midnight Atlas, Terracotta Kitchen, Neon Tokyo, …). Theme tokens are pure CSS custom properties, so you can author your own.
53
+ - **Hooks** — `useBreakpoint`, `useBodyScrollLock`, `useComponentEffect`, `useAppPersistence`, `useAuth`.
54
+ - **Helpers** — date formatting, number formatting, string utilities, search/highlight, pagination, URL helpers.
55
+ - **Error reporting** — lives in [`@memobit/core`](https://www.npmjs.com/package/@memobit/core) (React-free, works in Node too), a peer dependency: `ErrorBoundary` crashes are reported through it once the app calls `installErrorReporting`.
56
+
57
+ See the [component reference](https://react.memobit.ro/) for props, variants, and live examples.
58
+
59
+ ## Theming
60
+
61
+ Themes ship as standalone SCSS files. Pick what you need:
62
+
63
+ ```scss
64
+ // import everything
65
+ @use '@memobit/libs/dist/styles/themes.scss';
66
+
67
+ // or a single theme
68
+ @use '@memobit/libs/dist/styles/theming/arctic-blue.scss';
69
+ ```
70
+
71
+ All tokens — spacing, typography, radii, transitions, colors — are exposed as CSS custom properties (`--spacing-8`, `--card-bg`, `--button-primary-bg`, etc.) so you can override per-component or per-route without forking the library.
72
+
73
+ Token reference:
74
+
75
+ - Sizing / spacing / radii / transitions → `@memobit/libs/dist/styles/variables.scss`
76
+ - Theme colors → `@memobit/libs/dist/styles/theming/*.scss`
77
+
78
+ ## Requirements
79
+
80
+ - React **19.2+** and React DOM **19.2+** (peer deps)
81
+ - ESM-only (your bundler must support ESM — Vite, Next.js 13+, Webpack 5, esbuild, Rollup all do)
82
+ - For SCSS imports: a Sass-capable bundler
83
+
84
+ ## TypeScript
85
+
86
+ Type definitions are bundled (`dist/index.d.ts`). No `@types/...` package required.
87
+
88
+ ## License
89
+
90
+ [Apache 2.0](./LICENSE) © Iulian Cristea
91
+
92
+ ## Links
93
+
94
+ - 📚 Docs & playground — https://react.memobit.ro/
95
+ - 🐙 Source — https://github.com/CristeaIulian/memobit-react-library
96
+ - 📦 npm — https://www.npmjs.com/package/@memobit/libs
@@ -1,26 +1,26 @@
1
1
  import './AnalogClock.css';
2
2
  /* empty css */
3
- import { useMemo as b, useRef as K, useState as nn } from "react";
4
- import { Fragment as rn, jsx as u, jsxs as m } from "react/jsx-runtime";
5
- var p = (r) => r.toString().padStart(2, "0"), N = (r, g, h) => {
3
+ import { useMemo as b, useRef as L, useState as nr } from "react";
4
+ import { Fragment as tr, jsx as l, jsxs as f } from "react/jsx-runtime";
5
+ var M = (n) => n.toString().padStart(2, "0"), x = (n, g, h) => {
6
6
  const k = (h - 90) * Math.PI / 180;
7
7
  return {
8
- x: r + g * Math.cos(k),
9
- y: r + g * Math.sin(k)
8
+ x: n + g * Math.cos(k),
9
+ y: n + g * Math.sin(k)
10
10
  };
11
- }, en = (r) => r === 0 || r > 12, an = ({ value: r, onChange: g, format: h = "24h", withSeconds: k = !1, minuteStep: A = 1, secondStep: w = 1, size: d = 232, disabled: l = !1, showHeader: q = !0, autoAdvance: E = !0, mode: D, onModeChange: L, className: X = "" }) => {
12
- const [Y, G] = nn("hours"), I = K(null), M = K(!1), s = D ?? Y, f = r.hours >= 12, e = b(() => {
13
- const n = d / 2, t = d * 0.078, c = n - t - d * 0.018, a = c - t * 1.85;
11
+ }, er = (n) => n === 0 || n > 12, ir = ({ value: n, onChange: g, format: h = "24h", withSeconds: k = !1, minuteStep: w = 1, secondStep: D = 1, size: d = 232, disabled: u = !1, showHeader: q = !0, autoAdvance: E = !0, mode: C, onModeChange: X, className: Y = "" }) => {
12
+ const [G, J] = nr("hours"), I = L(null), _ = L(!1), s = C ?? G, p = n.hours >= 12, t = b(() => {
13
+ const r = d / 2, e = d * 0.078, c = r - e - d * 0.018, a = c - e * 1.85;
14
14
  return {
15
- center: n,
16
- knobRadius: t,
15
+ center: r,
16
+ knobRadius: e,
17
17
  outerRadius: c,
18
18
  innerRadius: a,
19
19
  ringThreshold: (c + a) / 2
20
20
  };
21
- }, [d]), y = (n) => {
22
- D === void 0 && G(n), L?.(n);
23
- }, C = () => {
21
+ }, [d]), y = (r) => {
22
+ C === void 0 && J(r), X?.(r);
23
+ }, N = () => {
24
24
  if (E) {
25
25
  if (s === "hours") {
26
26
  y("minutes");
@@ -28,7 +28,7 @@ var p = (r) => r.toString().padStart(2, "0"), N = (r, g, h) => {
28
28
  }
29
29
  s === "minutes" && k && y("seconds");
30
30
  }
31
- }, J = b(() => {
31
+ }, O = b(() => {
32
32
  if (s === "hours") {
33
33
  if (h === "12h") return Array.from({ length: 12 }, (a, i) => {
34
34
  const o = i + 1;
@@ -36,17 +36,17 @@ var p = (r) => r.toString().padStart(2, "0"), N = (r, g, h) => {
36
36
  degrees: o * 30,
37
37
  inner: !1,
38
38
  label: `${o}`,
39
- selected: (r.hours % 12 || 12) === o,
39
+ selected: (n.hours % 12 || 12) === o,
40
40
  value: o
41
41
  };
42
42
  });
43
- const t = Array.from({ length: 12 }, (a, i) => {
43
+ const e = Array.from({ length: 12 }, (a, i) => {
44
44
  const o = i + 1;
45
45
  return {
46
46
  degrees: o * 30,
47
47
  inner: !1,
48
48
  label: `${o}`,
49
- selected: r.hours === o,
49
+ selected: n.hours === o,
50
50
  value: o
51
51
  };
52
52
  }), c = Array.from({ length: 12 }, (a, i) => {
@@ -54,240 +54,250 @@ var p = (r) => r.toString().padStart(2, "0"), N = (r, g, h) => {
54
54
  return {
55
55
  degrees: i * 30,
56
56
  inner: !0,
57
- label: p(o),
58
- selected: r.hours === o,
57
+ label: M(o),
58
+ selected: n.hours === o,
59
59
  value: o
60
60
  };
61
61
  });
62
- return [...t, ...c];
62
+ return [...e, ...c];
63
63
  }
64
- const n = s === "minutes" ? r.minutes : r.seconds;
65
- return Array.from({ length: 12 }, (t, c) => {
64
+ const r = s === "minutes" ? n.minutes : n.seconds;
65
+ return Array.from({ length: 12 }, (e, c) => {
66
66
  const a = c * 5;
67
67
  return {
68
68
  degrees: a * 6,
69
69
  inner: !1,
70
- label: p(a),
71
- selected: n === a,
70
+ label: M(a),
71
+ selected: r === a,
72
72
  value: a
73
73
  };
74
74
  });
75
75
  }, [
76
76
  s,
77
77
  h,
78
- r.hours,
79
- r.minutes,
80
- r.seconds
81
- ]), j = b(() => s === "hours" ? {
82
- degrees: r.hours % 12 * 30,
83
- radius: h === "24h" && en(r.hours) ? e.innerRadius : e.outerRadius
78
+ n.hours,
79
+ n.minutes,
80
+ n.seconds
81
+ ]), T = b(() => s === "hours" ? {
82
+ degrees: n.hours % 12 * 30,
83
+ radius: h === "24h" && er(n.hours) ? t.innerRadius : t.outerRadius
84
84
  } : {
85
- degrees: (s === "minutes" ? r.minutes : r.seconds) * 6,
86
- radius: e.outerRadius
85
+ degrees: (s === "minutes" ? n.minutes : n.seconds) * 6,
86
+ radius: t.outerRadius
87
87
  }, [
88
88
  s,
89
89
  h,
90
- e.innerRadius,
91
- e.outerRadius,
92
- r.hours,
93
- r.minutes,
94
- r.seconds
95
- ]), R = N(e.center, j.radius, j.degrees), O = (n, t) => {
90
+ t.innerRadius,
91
+ t.outerRadius,
92
+ n.hours,
93
+ n.minutes,
94
+ n.seconds
95
+ ]), P = x(t.center, T.radius, T.degrees), Q = (r, e) => {
96
96
  const c = I.current?.getBoundingClientRect();
97
97
  if (!c || c.width === 0) return;
98
- const a = d / c.width, i = (n - c.left) * a - e.center, o = (t - c.top) * a - e.center, z = Math.sqrt(i * i + o * o);
99
- let x = Math.atan2(i, -o) * 180 / Math.PI;
100
- if (x < 0 && (x += 360), s === "hours") {
101
- const _ = Math.round(x / 30) % 12;
98
+ const a = d / c.width, i = (r - c.left) * a - t.center, o = (e - c.top) * a - t.center, v = Math.sqrt(i * i + o * o);
99
+ let R = Math.atan2(i, -o) * 180 / Math.PI;
100
+ if (R < 0 && (R += 360), s === "hours") {
101
+ const m = Math.round(R / 30) % 12;
102
102
  if (h === "12h") {
103
- const F = _ === 0 ? 12 : _;
103
+ const K = m === 0 ? 12 : m;
104
104
  return {
105
- ...r,
106
- hours: f ? F % 12 + 12 : F % 12
105
+ ...n,
106
+ hours: p ? K % 12 + 12 : K % 12
107
107
  };
108
108
  }
109
- const v = z < e.ringThreshold ? _ === 0 ? 0 : _ + 12 : _ === 0 ? 12 : _;
109
+ const rr = v < t.ringThreshold ? m === 0 ? 0 : m + 12 : m === 0 ? 12 : m;
110
110
  return {
111
- ...r,
112
- hours: v
111
+ ...n,
112
+ hours: rr
113
113
  };
114
114
  }
115
- const U = s === "minutes" ? A : w, B = Math.round(Math.round(x / 6) / U) * U % 60;
115
+ const B = s === "minutes" ? w : D, F = Math.round(Math.round(R / 6) / B) * B % 60;
116
116
  return s === "minutes" ? {
117
- ...r,
118
- minutes: B
117
+ ...n,
118
+ minutes: F
119
119
  } : {
120
- ...r,
121
- seconds: B
120
+ ...n,
121
+ seconds: F
122
122
  };
123
- }, P = (n) => {
124
- const t = O(n.clientX, n.clientY);
125
- t && g(t);
126
- }, Q = (n) => {
127
- l || (M.current = !0, n.currentTarget.setPointerCapture(n.pointerId), P(n));
128
- }, S = (n) => {
129
- l || !M.current || P(n);
130
- }, V = (n) => {
131
- l || !M.current || (M.current = !1, n.currentTarget.releasePointerCapture(n.pointerId), P(n), C());
132
- }, H = (n) => {
123
+ }, $ = (r) => {
124
+ const e = Q(r.clientX, r.clientY);
125
+ e && g(e);
126
+ }, S = (r) => {
127
+ if (!u) {
128
+ _.current = !0, $(r);
129
+ try {
130
+ r.currentTarget.setPointerCapture(r.pointerId);
131
+ } catch {
132
+ }
133
+ }
134
+ }, V = (r) => {
135
+ u || !_.current || $(r);
136
+ }, W = (r) => {
137
+ u || !_.current || (_.current = !1, r.currentTarget.hasPointerCapture(r.pointerId) && r.currentTarget.releasePointerCapture(r.pointerId), $(r), N());
138
+ }, j = () => {
139
+ u || !_.current || (_.current = !1, N());
140
+ }, H = (r) => {
133
141
  if (s === "hours") {
134
142
  if (h === "12h") {
135
- const t = ((r.hours % 12 || 12) - 1 + n + 12) % 12 + 1;
143
+ const e = ((n.hours % 12 || 12) - 1 + r + 12) % 12 + 1;
136
144
  g({
137
- ...r,
138
- hours: f ? t % 12 + 12 : t % 12
145
+ ...n,
146
+ hours: p ? e % 12 + 12 : e % 12
139
147
  });
140
148
  return;
141
149
  }
142
150
  g({
143
- ...r,
144
- hours: (r.hours + n + 24) % 24
151
+ ...n,
152
+ hours: (n.hours + r + 24) % 24
145
153
  });
146
154
  return;
147
155
  }
148
156
  if (s === "minutes") {
149
157
  g({
150
- ...r,
151
- minutes: (r.minutes + n * A + 60) % 60
158
+ ...n,
159
+ minutes: (n.minutes + r * w + 60) % 60
152
160
  });
153
161
  return;
154
162
  }
155
163
  g({
156
- ...r,
157
- seconds: (r.seconds + n * w + 60) % 60
164
+ ...n,
165
+ seconds: (n.seconds + r * D + 60) % 60
158
166
  });
159
- }, W = (n) => {
160
- if (!l) {
161
- if (n.key === "ArrowUp" || n.key === "ArrowRight") {
162
- n.preventDefault(), H(1);
167
+ }, Z = (r) => {
168
+ if (!u) {
169
+ if (r.key === "ArrowUp" || r.key === "ArrowRight") {
170
+ r.preventDefault(), H(1);
163
171
  return;
164
172
  }
165
- if (n.key === "ArrowDown" || n.key === "ArrowLeft") {
166
- n.preventDefault(), H(-1);
173
+ if (r.key === "ArrowDown" || r.key === "ArrowLeft") {
174
+ r.preventDefault(), H(-1);
167
175
  return;
168
176
  }
169
- (n.key === "Enter" || n.key === " ") && (n.preventDefault(), C());
177
+ (r.key === "Enter" || r.key === " ") && (r.preventDefault(), N());
170
178
  }
171
- }, T = (n) => {
172
- l || n === f || g({
173
- ...r,
174
- hours: n ? r.hours % 12 + 12 : r.hours % 12
179
+ }, U = (r) => {
180
+ u || r === p || g({
181
+ ...n,
182
+ hours: r ? n.hours % 12 + 12 : n.hours % 12
175
183
  });
176
- }, $ = (n) => `analog-clock__segment${s === n ? " analog-clock__segment--active" : ""}`, Z = h === "12h" ? r.hours % 12 || 12 : r.hours;
177
- return /* @__PURE__ */ m("div", {
178
- className: `analog-clock${l ? " analog-clock--disabled" : ""} ${X}`.trim(),
179
- children: [q && /* @__PURE__ */ m("div", {
184
+ }, A = (r) => `analog-clock__segment${s === r ? " analog-clock__segment--active" : ""}`, z = h === "12h" ? n.hours % 12 || 12 : n.hours;
185
+ return /* @__PURE__ */ f("div", {
186
+ className: `analog-clock${u ? " analog-clock--disabled" : ""} ${Y}`.trim(),
187
+ children: [q && /* @__PURE__ */ f("div", {
180
188
  className: "analog-clock__header",
181
- children: [/* @__PURE__ */ m("div", {
189
+ children: [/* @__PURE__ */ f("div", {
182
190
  className: "analog-clock__readout",
183
191
  children: [
184
- /* @__PURE__ */ u("button", {
192
+ /* @__PURE__ */ l("button", {
185
193
  type: "button",
186
- className: $("hours"),
187
- disabled: l,
194
+ className: A("hours"),
195
+ disabled: u,
188
196
  onClick: () => y("hours"),
189
- children: p(Z)
197
+ children: M(z)
190
198
  }),
191
- /* @__PURE__ */ u("span", {
199
+ /* @__PURE__ */ l("span", {
192
200
  className: "analog-clock__separator",
193
201
  children: ":"
194
202
  }),
195
- /* @__PURE__ */ u("button", {
203
+ /* @__PURE__ */ l("button", {
196
204
  type: "button",
197
- className: $("minutes"),
198
- disabled: l,
205
+ className: A("minutes"),
206
+ disabled: u,
199
207
  onClick: () => y("minutes"),
200
- children: p(r.minutes)
208
+ children: M(n.minutes)
201
209
  }),
202
- k && /* @__PURE__ */ m(rn, { children: [/* @__PURE__ */ u("span", {
210
+ k && /* @__PURE__ */ f(tr, { children: [/* @__PURE__ */ l("span", {
203
211
  className: "analog-clock__separator",
204
212
  children: ":"
205
- }), /* @__PURE__ */ u("button", {
213
+ }), /* @__PURE__ */ l("button", {
206
214
  type: "button",
207
- className: $("seconds"),
208
- disabled: l,
215
+ className: A("seconds"),
216
+ disabled: u,
209
217
  onClick: () => y("seconds"),
210
- children: p(r.seconds)
218
+ children: M(n.seconds)
211
219
  })] })
212
220
  ]
213
- }), h === "12h" && /* @__PURE__ */ m("div", {
221
+ }), h === "12h" && /* @__PURE__ */ f("div", {
214
222
  className: "analog-clock__period",
215
- children: [/* @__PURE__ */ u("button", {
223
+ children: [/* @__PURE__ */ l("button", {
216
224
  type: "button",
217
- className: `analog-clock__period-button${f ? "" : " analog-clock__period-button--active"}`,
218
- disabled: l,
219
- onClick: () => T(!1),
225
+ className: `analog-clock__period-button${p ? "" : " analog-clock__period-button--active"}`,
226
+ disabled: u,
227
+ onClick: () => U(!1),
220
228
  children: "AM"
221
- }), /* @__PURE__ */ u("button", {
229
+ }), /* @__PURE__ */ l("button", {
222
230
  type: "button",
223
- className: `analog-clock__period-button${f ? " analog-clock__period-button--active" : ""}`,
224
- disabled: l,
225
- onClick: () => T(!0),
231
+ className: `analog-clock__period-button${p ? " analog-clock__period-button--active" : ""}`,
232
+ disabled: u,
233
+ onClick: () => U(!0),
226
234
  children: "PM"
227
235
  })]
228
236
  })]
229
- }), /* @__PURE__ */ m("svg", {
237
+ }), /* @__PURE__ */ f("svg", {
230
238
  ref: I,
231
239
  className: "analog-clock__dial",
232
240
  width: d,
233
241
  height: d,
234
242
  viewBox: `0 0 ${d} ${d}`,
235
- tabIndex: l ? -1 : 0,
236
- onPointerDown: Q,
237
- onPointerMove: S,
238
- onPointerUp: V,
239
- onKeyDown: W,
243
+ tabIndex: u ? -1 : 0,
244
+ onPointerDown: S,
245
+ onPointerMove: V,
246
+ onPointerUp: W,
247
+ onPointerCancel: j,
248
+ onLostPointerCapture: j,
249
+ onKeyDown: Z,
240
250
  children: [
241
- /* @__PURE__ */ u("circle", {
251
+ /* @__PURE__ */ l("circle", {
242
252
  className: "analog-clock__face",
243
- cx: e.center,
244
- cy: e.center,
245
- r: e.center - 1
253
+ cx: t.center,
254
+ cy: t.center,
255
+ r: t.center - 1
246
256
  }),
247
- s !== "hours" && Array.from({ length: 60 }, (n, t) => {
248
- const c = t % 5 === 0, a = N(e.center, e.outerRadius + e.knobRadius * 0.55, t * 6), i = N(e.center, e.outerRadius + e.knobRadius * (c ? 0.95 : 0.8), t * 6);
249
- return /* @__PURE__ */ u("line", {
257
+ s !== "hours" && Array.from({ length: 60 }, (r, e) => {
258
+ const c = e % 5 === 0, a = x(t.center, t.outerRadius + t.knobRadius * 0.55, e * 6), i = x(t.center, t.outerRadius + t.knobRadius * (c ? 0.95 : 0.8), e * 6);
259
+ return /* @__PURE__ */ l("line", {
250
260
  className: `analog-clock__tick${c ? " analog-clock__tick--major" : ""}`,
251
261
  x1: a.x,
252
262
  y1: a.y,
253
263
  x2: i.x,
254
264
  y2: i.y
255
- }, `tick-${t}`);
265
+ }, `tick-${e}`);
256
266
  }),
257
- /* @__PURE__ */ u("line", {
267
+ /* @__PURE__ */ l("line", {
258
268
  className: "analog-clock__hand",
259
- x1: e.center,
260
- y1: e.center,
261
- x2: R.x,
262
- y2: R.y
269
+ x1: t.center,
270
+ y1: t.center,
271
+ x2: P.x,
272
+ y2: P.y
263
273
  }),
264
- /* @__PURE__ */ u("circle", {
274
+ /* @__PURE__ */ l("circle", {
265
275
  className: "analog-clock__knob",
266
- cx: R.x,
267
- cy: R.y,
268
- r: e.knobRadius
276
+ cx: P.x,
277
+ cy: P.y,
278
+ r: t.knobRadius
269
279
  }),
270
- /* @__PURE__ */ u("circle", {
280
+ /* @__PURE__ */ l("circle", {
271
281
  className: "analog-clock__pivot",
272
- cx: e.center,
273
- cy: e.center,
282
+ cx: t.center,
283
+ cy: t.center,
274
284
  r: d * 0.017
275
285
  }),
276
- J.map((n) => {
277
- const t = N(e.center, n.inner ? e.innerRadius : e.outerRadius, n.degrees);
278
- return /* @__PURE__ */ u("text", {
279
- className: `analog-clock__number${n.inner ? " analog-clock__number--inner" : ""}${n.selected ? " analog-clock__number--selected" : ""}`,
280
- x: t.x,
281
- y: t.y,
286
+ O.map((r) => {
287
+ const e = x(t.center, r.inner ? t.innerRadius : t.outerRadius, r.degrees);
288
+ return /* @__PURE__ */ l("text", {
289
+ className: `analog-clock__number${r.inner ? " analog-clock__number--inner" : ""}${r.selected ? " analog-clock__number--selected" : ""}`,
290
+ x: e.x,
291
+ y: e.y,
282
292
  textAnchor: "middle",
283
293
  dominantBaseline: "central",
284
- children: n.label
285
- }, `${s}-${n.inner ? "inner" : "outer"}-${n.value}`);
294
+ children: r.label
295
+ }, `${s}-${r.inner ? "inner" : "outer"}-${r.value}`);
286
296
  })
287
297
  ]
288
298
  })]
289
299
  });
290
300
  };
291
301
  export {
292
- an as AnalogClock
302
+ ir as AnalogClock
293
303
  };
@@ -6,7 +6,7 @@ import { InputPassword as B } from "../../InputPassword/InputPassword2.js";
6
6
  import { Toast as X } from "../../Toast/Toast2.js";
7
7
  import { HttpMethod as F, buildRequestHeaders as Y } from "../../../helpers/Http.js";
8
8
  import { useAuth as Z } from "../../../hooks/useAuth/useAuth.js";
9
- import { QRCodeSVG as ee } from "../../../node_modules/qrcode.react/lib/esm/index.js";
9
+ import { QRCodeSVG as ee } from "../../../D_/Projects/Web Apps/LIBRARIES/memobit-react/node_modules/qrcode.react/lib/esm/index.js";
10
10
  /* empty css */
11
11
  import { useCallback as U, useEffect as ae, useState as r } from "react";
12
12
  import { Fragment as A, jsx as e, jsxs as s } from "react/jsx-runtime";