@memobit/libs 3.24.0 → 3.25.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.
@@ -2,8 +2,8 @@ import './ErrorBoundary.css';
2
2
  import { EmptyState as s } from "../EmptyState/EmptyState2.js";
3
3
  /* empty css */
4
4
  import { Component as a } from "react";
5
- import { logger as c } from "@memobit/core";
6
5
  import { jsx as o } from "react/jsx-runtime";
6
+ import { logger as c } from "@memobit/core";
7
7
  var h = class extends a {
8
8
  constructor(...r) {
9
9
  super(...r), this.state = { error: null }, this.reset = () => {
@@ -0,0 +1,20 @@
1
+ import './Icon.css';
2
+ /* empty css */
3
+ import "react";
4
+ import { animatedIconMap as m } from "@memobit/icons/animated";
5
+ import { jsx as t } from "react/jsx-runtime";
6
+ var f = ({ className: r = "", name: c, size: n, variant: o }) => {
7
+ const e = [
8
+ "icon",
9
+ n ? `icon--${n}` : "",
10
+ o && o !== "default" ? `icon--${o}` : "",
11
+ r
12
+ ].filter(Boolean).join(" ");
13
+ return /* @__PURE__ */ t("span", {
14
+ className: e,
15
+ children: m[c]
16
+ });
17
+ };
18
+ export {
19
+ f as AnimatedIcon
20
+ };
@@ -1,11 +1,11 @@
1
1
  import './Icon.css';
2
2
  /* empty css */
3
3
  import { useEffect as g, useState as I } from "react";
4
- import { logger as y } from "@memobit/core";
5
- import { canLoadMoreIcons as n, getIcon as N, loadIcon as w } from "@memobit/icons/map";
6
- import { jsx as x } from "react/jsx-runtime";
4
+ import { jsx as y } from "react/jsx-runtime";
5
+ import { logger as N } from "@memobit/core";
6
+ import { canLoadMoreIcons as n, getIcon as w, loadIcon as x } from "@memobit/icons/map";
7
7
  var c = /* @__PURE__ */ new Set(), a = (e) => {
8
- c.has(e) || (c.add(e), y.warn(n ? "[@memobit/libs] No icon named <name>." : "[@memobit/libs] No icon named <name>. If this app trims icons with @memobit/icons/vite, add it to the plugin's `include` option or use `lazy` — a name that only exists at runtime cannot be found by the source scan.", { name: e }));
8
+ c.has(e) || (c.add(e), N.warn(n ? "[@memobit/libs] No icon named <name>." : "[@memobit/libs] No icon named <name>. If this app trims icons with @memobit/icons/vite, add it to the plugin's `include` option or use `lazy` — a name that only exists at runtime cannot be found by the source scan.", { name: e }));
9
9
  }, C = ({ className: e = "", fade: l, fadeOnHover: d, name: o, pulse: u, pulseOnHover: f, size: r, spin: p, spinOnHover: m, variant: t }) => {
10
10
  const h = [
11
11
  "icon",
@@ -18,11 +18,11 @@ var c = /* @__PURE__ */ new Set(), a = (e) => {
18
18
  d ? "icon--fade-hover" : "",
19
19
  f ? "icon--pulse-hover" : "",
20
20
  e
21
- ].filter(Boolean).join(" "), [, v] = I(null), i = N(o);
21
+ ].filter(Boolean).join(" "), [, v] = I(null), i = w(o);
22
22
  return g(() => {
23
23
  if (i !== void 0 || !n) return;
24
24
  let s = !0;
25
- return w(o).then((b) => {
25
+ return x(o).then((b) => {
26
26
  if (s) {
27
27
  if (b === void 0) {
28
28
  a(o);
@@ -34,7 +34,7 @@ var c = /* @__PURE__ */ new Set(), a = (e) => {
34
34
  }), () => {
35
35
  s = !1;
36
36
  };
37
- }, [i, o]), i === void 0 && !n && a(o), /* @__PURE__ */ x("span", {
37
+ }, [i, o]), i === void 0 && !n && a(o), /* @__PURE__ */ y("span", {
38
38
  className: h,
39
39
  children: i
40
40
  });
@@ -4,15 +4,15 @@ import { Tooltip as v } from "../Tooltip/Tooltip2.js";
4
4
  import { InputSearch as y } from "../InputSearch/InputSearch2.js";
5
5
  /* empty css */
6
6
  import { useEffect as C, useMemo as h, useState as d } from "react";
7
- import { canLoadMoreIcons as S, iconMap as b, loadAllIcons as j } from "@memobit/icons/map";
8
- import { jsx as c, jsxs as A } from "react/jsx-runtime";
7
+ import { jsx as c, jsxs as S } from "react/jsx-runtime";
8
+ import { canLoadMoreIcons as b, iconMap as j, loadAllIcons as A } from "@memobit/icons/map";
9
9
  import { iconAliases as L } from "@memobit/icons";
10
- var T = S ? null : Object.keys(b), q = ({ color: a, emptyLabel: u = "No icons match", icons: o, onChange: f, placeholder: _ = "Search icons...", value: g }) => {
10
+ var T = b ? null : Object.keys(j), q = ({ color: a, emptyLabel: u = "No icons match", icons: o, onChange: f, placeholder: _ = "Search icons...", value: g }) => {
11
11
  const [s, k] = d(""), [r, I] = d(T);
12
12
  C(() => {
13
13
  if (r || o) return;
14
14
  let e = !0;
15
- return j().then((l) => {
15
+ return A().then((l) => {
16
16
  e && I(Object.keys(l));
17
17
  }, () => {
18
18
  }), () => {
@@ -25,7 +25,7 @@ var T = S ? null : Object.keys(b), q = ({ color: a, emptyLabel: u = "No icons ma
25
25
  const l = e.replace(/[\s-]+/g, ""), m = (i) => i.includes(e) || i.replace(/-/g, "").includes(l);
26
26
  return t.filter((i) => m(i) || (L[i] ?? []).some(m));
27
27
  }, [t, s]);
28
- return /* @__PURE__ */ A("div", {
28
+ return /* @__PURE__ */ S("div", {
29
29
  className: "icon-picker",
30
30
  children: [
31
31
  /* @__PURE__ */ c("div", {
@@ -7,8 +7,8 @@ import { fitRegionToAspect as q, initialRegion as E } from "./cropGeometry.js";
7
7
  import { useCropDrag as J } from "./useCropDrag.js";
8
8
  /* empty css */
9
9
  import { useEffect as Z, useMemo as ee, useRef as re, useState as n } from "react";
10
- import { logger as A } from "@memobit/core";
11
10
  import { jsx as a, jsxs as d } from "react/jsx-runtime";
11
+ import { logger as A } from "@memobit/core";
12
12
  var oe = 1200, ae = 0.9, te = [
13
13
  "nw",
14
14
  "ne",
@@ -3,8 +3,8 @@ import { Modal as x } from "../Modal/Modal2.js";
3
3
  import { Radio as C } from "../Radio/Radio2.js";
4
4
  /* empty css */
5
5
  import { useEffect as S, useState as n } from "react";
6
- import { logger as b } from "@memobit/core";
7
- import { jsx as a, jsxs as q } from "react/jsx-runtime";
6
+ import { jsx as a, jsxs as b } from "react/jsx-runtime";
7
+ import { logger as q } from "@memobit/core";
8
8
  var U = ({ isOpen: m = !1, list: c, title: f, onClose: t, onSave: u, icon: v, value: i }) => {
9
9
  const [r, l] = n(i), [s, d] = n(!1), [p, o] = n("");
10
10
  S(() => {
@@ -24,11 +24,11 @@ var U = ({ isOpen: m = !1, list: c, title: f, onClose: t, onSave: u, icon: v, va
24
24
  d(!1);
25
25
  }
26
26
  }, h = (e) => {
27
- typeof e == "string" || typeof e == "number" ? l(e) : b.error("QuickOptionUpdate received an unsupported value type", void 0, { type: typeof e });
27
+ typeof e == "string" || typeof e == "number" ? l(e) : q.error("QuickOptionUpdate received an unsupported value type", void 0, { type: typeof e });
28
28
  };
29
29
  return /* @__PURE__ */ a("div", {
30
30
  className: "quick-set",
31
- children: /* @__PURE__ */ q(x, {
31
+ children: /* @__PURE__ */ b(x, {
32
32
  isOpen: m,
33
33
  titleIcon: v,
34
34
  title: f,
@@ -1,8 +1,8 @@
1
1
  import { HttpMethod as o, buildRequestHeaders as A } from "../../helpers/Http.js";
2
2
  import { AuthContext as U } from "./AuthContext.context.js";
3
3
  import { useCallback as i, useEffect as j, useState as c } from "react";
4
- import { logger as h } from "@memobit/core";
5
4
  import { jsx as B } from "react/jsx-runtime";
5
+ import { logger as h } from "@memobit/core";
6
6
  function C({ children: f, config: a }) {
7
7
  const [d, u] = c(null), [p, s] = c(!0);
8
8
  j(() => {
@@ -23,7 +23,7 @@ var r = (i) => {
23
23
  const o = {
24
24
  ...i,
25
25
  lib: d,
26
- libBuildNumber: 593,
26
+ libBuildNumber: 596,
27
27
  libCommit: n,
28
28
  libBuildDate: t
29
29
  };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { AnimatedIconName } from '@memobit/icons/animated';
1
2
  import { Component } from 'react';
2
3
  import { ComponentType } from 'react';
3
4
  import { Context } from 'react';
@@ -113,6 +114,19 @@ export declare interface AngleSliderProps {
113
114
 
114
115
  export declare type AngleSliderVariant = 'accent' | 'info' | 'success' | 'warning' | 'danger';
115
116
 
117
+ /**
118
+ * An icon that moves on its own, for something happening right now (motion in a room, a job
119
+ * running). Sized and coloured like `Icon`; the animation lives in the SVG itself.
120
+ */
121
+ export declare const AnimatedIcon: default_2.FC<AnimatedIconProps>;
122
+
123
+ declare interface AnimatedIconProps {
124
+ className?: string;
125
+ name: AnimatedIconName;
126
+ size?: IconSize;
127
+ variant?: IconVariant;
128
+ }
129
+
116
130
  export declare interface ApiClient {
117
131
  get: <T>(path: string) => Promise<T>;
118
132
  post: <T, P = unknown>(path: string, payload?: P) => Promise<T>;