@memobit/libs 3.1.3 → 3.1.5
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/dist/components/ColorPicker/ColorPicker.css +1 -1
- package/dist/components/ColorPicker/ColorPicker2.js +178 -148
- package/dist/components/ControlPanel/ControlPanelFilter.js +60 -57
- package/dist/components/Drawer/Drawer2.js +65 -54
- package/dist/components/EmojiPicker/EmojiPicker2.js +21 -18
- package/dist/components/EventCalendar/EventCalendar2.js +30 -32
- package/dist/components/IconPicker/IconPicker2.js +28 -25
- package/dist/helpers/VersionInfo.js +1 -1
- package/dist/hooks/useBodyScrollLock.js +17 -21
- package/dist/index.d.ts +10 -0
- package/dist/version.js +2 -2
- package/dist/version.json +4 -4
- package/package.json +1 -1
|
@@ -4,8 +4,8 @@ import { addDays as Z, addMonths as H } from "../../helpers/Datetime.js";
|
|
|
4
4
|
import { useSwipe as ee } from "../../hooks/useSwipe.js";
|
|
5
5
|
import { buildDroppedStart as te, getWeekDays as ae, startOfDay as T } from "./EventCalendar.helpers.js";
|
|
6
6
|
import { DayAgenda as ne } from "../DayAgenda/DayAgenda2.js";
|
|
7
|
-
import { ToggleButtons as
|
|
8
|
-
import { EventCalendarMonth as
|
|
7
|
+
import { ToggleButtons as re } from "../ToggleButtons/ToggleButtons2.js";
|
|
8
|
+
import { EventCalendarMonth as le } from "./EventCalendar.Month.js";
|
|
9
9
|
import { EventCalendarWeek as oe } from "./EventCalendar.Week.js";
|
|
10
10
|
/* empty css */
|
|
11
11
|
import { useCallback as s, useMemo as ie, useState as f } from "react";
|
|
@@ -18,61 +18,61 @@ var se = [{
|
|
|
18
18
|
key: "week",
|
|
19
19
|
label: "Week",
|
|
20
20
|
icon: "calendar-week"
|
|
21
|
-
}], ce = (
|
|
21
|
+
}], ce = (r) => r.toLocaleDateString(void 0, {
|
|
22
22
|
month: "long",
|
|
23
23
|
year: "numeric"
|
|
24
|
-
}),
|
|
25
|
-
const
|
|
26
|
-
return t.getFullYear() !== a.getFullYear() ? `${t.getDate()} ${
|
|
24
|
+
}), d = (r) => r.toLocaleDateString(void 0, { month: "short" }), de = (r, D) => {
|
|
25
|
+
const l = ae(r, D), t = l[0], a = l[l.length - 1];
|
|
26
|
+
return t.getFullYear() !== a.getFullYear() ? `${t.getDate()} ${d(t)} ${t.getFullYear()} – ${a.getDate()} ${d(a)} ${a.getFullYear()}` : t.getMonth() !== a.getMonth() ? `${t.getDate()} ${d(t)} – ${a.getDate()} ${d(a)} ${a.getFullYear()}` : `${t.getDate()} – ${a.getDate()} ${d(a)} ${a.getFullYear()}`;
|
|
27
27
|
};
|
|
28
|
-
function Se({ activeHours:
|
|
29
|
-
const [A, E] = f(() => T(
|
|
30
|
-
$ && $(e),
|
|
31
|
-
}, [
|
|
32
|
-
w && w(e),
|
|
33
|
-
}, [w,
|
|
28
|
+
function Se({ activeHours: r, className: D, date: l, dayAgenda: t = !1, dayEndHour: a = 24, dayStartHour: y = 0, defaultDurationMinutes: C = 30, emptyLabel: Y, events: b, firstDayOfWeek: v = 0, headerExtra: z, hourHeight: V = 44, maxEventsPerDay: W = 3, onDateChange: $, onDayClick: _, onEventClick: m, onEventDrop: g, onViewChange: w, renderEvent: B, showHeader: x = !0, showWeekNumbers: L = !1, swipeNavigation: P = !0, view: h }) {
|
|
29
|
+
const [A, E] = f(() => T(l ?? /* @__PURE__ */ new Date())), [O, R] = f(h ?? "month"), [c, S] = f(null), [I, u] = f(null), o = l ?? A, i = h ?? O, q = !!g, M = s((e) => {
|
|
30
|
+
$ && $(e), l || E(e);
|
|
31
|
+
}, [l, $]), G = s((e) => {
|
|
32
|
+
w && w(e), h || R(e);
|
|
33
|
+
}, [w, h]), p = s((e) => {
|
|
34
34
|
M(i === "month" ? H(o, e) : Z(o, e * 7));
|
|
35
35
|
}, [
|
|
36
36
|
o,
|
|
37
37
|
i,
|
|
38
38
|
M
|
|
39
39
|
]), J = s((e, X) => {
|
|
40
|
-
!
|
|
41
|
-
}, [
|
|
40
|
+
!c || !g || (g(c, te(c, e, X)), S(null));
|
|
41
|
+
}, [c, g]), k = s((e) => u(T(e)), []), K = s((e) => {
|
|
42
42
|
if (t) {
|
|
43
43
|
k(e.start);
|
|
44
44
|
return;
|
|
45
45
|
}
|
|
46
|
-
|
|
46
|
+
m?.(e);
|
|
47
47
|
}, [
|
|
48
48
|
t,
|
|
49
|
-
|
|
49
|
+
m,
|
|
50
50
|
k
|
|
51
51
|
]), Q = ee({
|
|
52
52
|
enabled: P,
|
|
53
53
|
onSwipeLeft: () => p(1),
|
|
54
54
|
onSwipeRight: () => p(-1)
|
|
55
|
-
}), U = ie(() => i === "month" ? ce(o) : de(o,
|
|
55
|
+
}), U = ie(() => i === "month" ? ce(o) : de(o, v), [
|
|
56
56
|
o,
|
|
57
57
|
i,
|
|
58
|
-
|
|
58
|
+
v
|
|
59
59
|
]), j = {
|
|
60
|
-
activeHours:
|
|
60
|
+
activeHours: r,
|
|
61
61
|
date: o,
|
|
62
62
|
dragEnabled: q,
|
|
63
|
-
draggingId:
|
|
63
|
+
draggingId: c?.id ?? null,
|
|
64
64
|
events: b,
|
|
65
|
-
firstDayOfWeek:
|
|
65
|
+
firstDayOfWeek: v,
|
|
66
66
|
onDayClick: _,
|
|
67
67
|
onDragEnd: () => S(null),
|
|
68
68
|
onDragStart: (e) => S(e),
|
|
69
69
|
onDrop: J,
|
|
70
|
-
onEventClick: t ||
|
|
70
|
+
onEventClick: t || m ? K : void 0,
|
|
71
71
|
renderEvent: B,
|
|
72
72
|
showWeekNumbers: L
|
|
73
73
|
};
|
|
74
74
|
return /* @__PURE__ */ F("div", {
|
|
75
|
-
className: ["event-calendar",
|
|
75
|
+
className: ["event-calendar", D ?? ""].filter(Boolean).join(" "),
|
|
76
76
|
children: [
|
|
77
77
|
x && /* @__PURE__ */ F("div", {
|
|
78
78
|
className: "event-calendar__header",
|
|
@@ -109,7 +109,7 @@ function Se({ activeHours: l, className: v, date: r, dayAgenda: t = !1, dayEndHo
|
|
|
109
109
|
className: "event-calendar__header-extra",
|
|
110
110
|
children: z
|
|
111
111
|
}),
|
|
112
|
-
/* @__PURE__ */ n(
|
|
112
|
+
/* @__PURE__ */ n(re, {
|
|
113
113
|
onToggleChange: (e) => G(e),
|
|
114
114
|
size: "small",
|
|
115
115
|
state: i,
|
|
@@ -120,7 +120,7 @@ function Se({ activeHours: l, className: v, date: r, dayAgenda: t = !1, dayEndHo
|
|
|
120
120
|
/* @__PURE__ */ n("div", {
|
|
121
121
|
className: "event-calendar__viewport",
|
|
122
122
|
...Q,
|
|
123
|
-
children: i === "month" ? /* @__PURE__ */ n(
|
|
123
|
+
children: i === "month" ? /* @__PURE__ */ n(le, {
|
|
124
124
|
...j,
|
|
125
125
|
emptyLabel: Y,
|
|
126
126
|
maxEventsPerDay: W,
|
|
@@ -134,19 +134,17 @@ function Se({ activeHours: l, className: v, date: r, dayAgenda: t = !1, dayEndHo
|
|
|
134
134
|
})
|
|
135
135
|
}),
|
|
136
136
|
I && /* @__PURE__ */ n(ne, {
|
|
137
|
-
activeHours:
|
|
137
|
+
activeHours: r,
|
|
138
138
|
date: I,
|
|
139
|
-
onDateChange:
|
|
139
|
+
onDateChange: u,
|
|
140
140
|
emptyLabel: Y,
|
|
141
141
|
events: b,
|
|
142
142
|
isOpen: !0,
|
|
143
143
|
onAdd: _ ? (e) => {
|
|
144
|
-
|
|
145
|
-
} : void 0,
|
|
146
|
-
onClose: () => m(null),
|
|
147
|
-
onEventClick: c ? (e) => {
|
|
148
|
-
m(null), c(e);
|
|
144
|
+
u(null), _(e);
|
|
149
145
|
} : void 0,
|
|
146
|
+
onClose: () => u(null),
|
|
147
|
+
onEventClick: m,
|
|
150
148
|
renderEvent: B
|
|
151
149
|
})
|
|
152
150
|
]
|
|
@@ -1,51 +1,54 @@
|
|
|
1
1
|
import './IconPicker.css';
|
|
2
|
-
import { Icon as
|
|
3
|
-
import {
|
|
2
|
+
import { Icon as _ } from "../Icon/Icon2.js";
|
|
3
|
+
import { Tooltip as g } from "../Tooltip/Tooltip2.js";
|
|
4
|
+
import { InputSearch as k } from "../InputSearch/InputSearch2.js";
|
|
4
5
|
/* empty css */
|
|
5
|
-
import { useMemo as a, useState as
|
|
6
|
-
import { iconMap as
|
|
7
|
-
import { jsx as c, jsxs as
|
|
8
|
-
import { iconAliases as
|
|
9
|
-
var
|
|
10
|
-
const [
|
|
11
|
-
const e =
|
|
12
|
-
if (!e) return
|
|
13
|
-
const
|
|
14
|
-
return
|
|
15
|
-
}, [
|
|
16
|
-
return /* @__PURE__ */
|
|
6
|
+
import { useMemo as a, useState as v } from "react";
|
|
7
|
+
import { iconMap as N } from "@memobit/icons/map";
|
|
8
|
+
import { jsx as c, jsxs as S } from "react/jsx-runtime";
|
|
9
|
+
import { iconAliases as b } from "@memobit/icons";
|
|
10
|
+
var y = Object.keys(N), M = ({ color: s, emptyLabel: p = "No icons match", icons: n, onChange: m, placeholder: h = "Search icons...", value: d }) => {
|
|
11
|
+
const [i, u] = v(""), o = a(() => n ?? y, [n]), t = a(() => {
|
|
12
|
+
const e = i.trim().toLowerCase();
|
|
13
|
+
if (!e) return o;
|
|
14
|
+
const f = e.replace(/[\s-]+/g, ""), l = (r) => r.includes(e) || r.replace(/-/g, "").includes(f);
|
|
15
|
+
return o.filter((r) => l(r) || (b[r] ?? []).some(l));
|
|
16
|
+
}, [o, i]);
|
|
17
|
+
return /* @__PURE__ */ S("div", {
|
|
17
18
|
className: "icon-picker",
|
|
18
19
|
children: [
|
|
19
20
|
/* @__PURE__ */ c("div", {
|
|
20
21
|
className: "icon-picker__search",
|
|
21
|
-
children: /* @__PURE__ */ c(
|
|
22
|
+
children: /* @__PURE__ */ c(k, {
|
|
22
23
|
autoFocus: !0,
|
|
23
24
|
onChange: u,
|
|
24
25
|
placeholder: h,
|
|
25
|
-
value:
|
|
26
|
+
value: i
|
|
26
27
|
})
|
|
27
28
|
}),
|
|
28
29
|
/* @__PURE__ */ c("div", {
|
|
29
30
|
className: "icon-picker__grid",
|
|
30
|
-
children:
|
|
31
|
+
children: t.length === 0 ? /* @__PURE__ */ c("p", {
|
|
31
32
|
className: "icon-picker__empty",
|
|
32
33
|
children: p
|
|
33
|
-
}) :
|
|
34
|
-
className: `icon-picker__icon${d === e ? " is-selected" : ""}`,
|
|
35
|
-
onClick: () => m?.(e),
|
|
36
|
-
style: s ? { color: s } : void 0,
|
|
34
|
+
}) : t.map((e) => /* @__PURE__ */ c(g, {
|
|
37
35
|
title: e,
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
children: /* @__PURE__ */ c("button", {
|
|
37
|
+
className: `icon-picker__icon${d === e ? " is-selected" : ""}`,
|
|
38
|
+
onClick: () => m?.(e),
|
|
39
|
+
style: s ? { color: s } : void 0,
|
|
40
|
+
type: "button",
|
|
41
|
+
children: /* @__PURE__ */ c(_, { name: e })
|
|
42
|
+
})
|
|
40
43
|
}, e))
|
|
41
44
|
}),
|
|
42
45
|
/* @__PURE__ */ c("p", {
|
|
43
46
|
className: "icon-picker__count",
|
|
44
|
-
children:
|
|
47
|
+
children: t.length === o.length ? `${o.length} icons` : `${t.length} of ${o.length}`
|
|
45
48
|
})
|
|
46
49
|
]
|
|
47
50
|
});
|
|
48
51
|
};
|
|
49
52
|
export {
|
|
50
|
-
|
|
53
|
+
M as IconPicker
|
|
51
54
|
};
|
|
@@ -1,31 +1,27 @@
|
|
|
1
|
-
import { useEffect as
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
document.body.style.overflow = t, document.body.style.position = l, document.body.style.top = n, document.body.style.left = y, document.body.style.right = r, document.body.style.width = s, window.scrollTo(0, c), o.current = null;
|
|
9
|
-
};
|
|
10
|
-
if (e) {
|
|
11
|
-
if (!o.current) {
|
|
12
|
-
const t = window.scrollY;
|
|
13
|
-
o.current = {
|
|
1
|
+
import { useEffect as c } from "react";
|
|
2
|
+
var t = 0, e = null, m = (d) => {
|
|
3
|
+
c(() => {
|
|
4
|
+
if (d) {
|
|
5
|
+
if (t += 1, t === 1) {
|
|
6
|
+
const o = window.scrollY;
|
|
7
|
+
e = {
|
|
14
8
|
overflow: document.body.style.overflow,
|
|
15
9
|
position: document.body.style.position,
|
|
16
10
|
top: document.body.style.top,
|
|
17
11
|
left: document.body.style.left,
|
|
18
12
|
right: document.body.style.right,
|
|
19
13
|
width: document.body.style.width,
|
|
20
|
-
scrollY:
|
|
21
|
-
}, document.body.style.overflow = "hidden", document.body.style.position = "fixed", document.body.style.top = `-${
|
|
14
|
+
scrollY: o
|
|
15
|
+
}, document.body.style.overflow = "hidden", document.body.style.position = "fixed", document.body.style.top = `-${o}px`, document.body.style.left = "0", document.body.style.right = "0", document.body.style.width = "100%";
|
|
22
16
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
17
|
+
return () => {
|
|
18
|
+
if (t -= 1, t > 0 || !e) return;
|
|
19
|
+
const { left: o, overflow: l, position: y, right: n, scrollY: s, top: i, width: r } = e;
|
|
20
|
+
document.body.style.overflow = l, document.body.style.position = y, document.body.style.top = i, document.body.style.left = o, document.body.style.right = n, document.body.style.width = r, window.scrollTo(0, s), e = null;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
}, [d]);
|
|
28
24
|
};
|
|
29
25
|
export {
|
|
30
|
-
|
|
26
|
+
m as useBodyScrollLock
|
|
31
27
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -541,6 +541,16 @@ export declare const ColorPicker: default_2.FC<ColorPickerProps>;
|
|
|
541
541
|
export declare interface ColorPickerProps {
|
|
542
542
|
value?: string;
|
|
543
543
|
onChange?: (hex: string) => void;
|
|
544
|
+
/**
|
|
545
|
+
* Colours to offer for reuse, above the gradient. Pass the ones already in play —
|
|
546
|
+
* the palette a record set is actually using — so picking the same shade again is one
|
|
547
|
+
* click rather than a fresh trip through the gradient. Without it every visit to the
|
|
548
|
+
* picker mints a new near-miss: nine greys that differ by a digit, each its own entry
|
|
549
|
+
* in anything that later groups or filters by colour. Duplicates and anything that
|
|
550
|
+
* isn't a hex are dropped, and the list renders only when something survives.
|
|
551
|
+
*/
|
|
552
|
+
swatches?: string[];
|
|
553
|
+
swatchesLabel?: string;
|
|
544
554
|
}
|
|
545
555
|
|
|
546
556
|
export declare interface ColProps {
|
package/dist/version.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var I = "3.1.
|
|
1
|
+
var I = "3.1.5", B = 452, L = "7f7e753", _ = "2026-10-02T12:17:26.091Z", r = "452";
|
|
2
2
|
export {
|
|
3
3
|
_ as LIB_BUILD_DATE,
|
|
4
|
-
|
|
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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memobit/libs",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.5",
|
|
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",
|