@companix/uikit 0.1.27 → 0.1.29

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.
Files changed (66) hide show
  1. package/dist/ImageBase/ImageBase.scss +50 -0
  2. package/dist/ImageBase/index.d.ts +8 -0
  3. package/dist/bundle.es.js +63 -61
  4. package/dist/bundle.es10.js +1 -1
  5. package/dist/bundle.es13.js +4 -4
  6. package/dist/bundle.es14.js +3 -3
  7. package/dist/bundle.es15.js +2 -2
  8. package/dist/bundle.es17.js +1 -1
  9. package/dist/bundle.es23.js +5 -5
  10. package/dist/bundle.es25.js +1 -1
  11. package/dist/bundle.es26.js +1 -1
  12. package/dist/bundle.es27.js +1 -1
  13. package/dist/bundle.es28.js +1 -1
  14. package/dist/bundle.es29.js +1 -1
  15. package/dist/bundle.es30.js +1 -1
  16. package/dist/bundle.es31.js +4 -4
  17. package/dist/bundle.es32.js +2 -2
  18. package/dist/bundle.es35.js +2 -2
  19. package/dist/bundle.es41.js +1 -1
  20. package/dist/bundle.es42.js +2 -2
  21. package/dist/bundle.es45.js +54 -33
  22. package/dist/bundle.es46.js +33 -20
  23. package/dist/bundle.es47.js +19 -47
  24. package/dist/bundle.es48.js +49 -11
  25. package/dist/bundle.es49.js +11 -13
  26. package/dist/bundle.es50.js +13 -13
  27. package/dist/bundle.es51.js +13 -30
  28. package/dist/bundle.es52.js +30 -11
  29. package/dist/bundle.es53.js +10 -25
  30. package/dist/bundle.es54.js +17 -29
  31. package/dist/bundle.es55.js +36 -48
  32. package/dist/bundle.es56.js +49 -55
  33. package/dist/bundle.es57.js +56 -8
  34. package/dist/bundle.es58.js +8 -26
  35. package/dist/bundle.es59.js +27 -5
  36. package/dist/bundle.es60.js +5 -66
  37. package/dist/bundle.es61.js +66 -23
  38. package/dist/bundle.es62.js +22 -23
  39. package/dist/bundle.es63.js +24 -90
  40. package/dist/bundle.es64.js +90 -18
  41. package/dist/bundle.es65.js +17 -93
  42. package/dist/bundle.es66.js +93 -73
  43. package/dist/bundle.es67.js +73 -23
  44. package/dist/bundle.es68.js +20 -35
  45. package/dist/bundle.es69.js +39 -24
  46. package/dist/bundle.es70.js +24 -79
  47. package/dist/bundle.es71.js +71 -85
  48. package/dist/bundle.es72.js +93 -10
  49. package/dist/bundle.es73.js +10 -6
  50. package/dist/bundle.es74.js +5 -69
  51. package/dist/bundle.es75.js +68 -10
  52. package/dist/bundle.es76.js +11 -42
  53. package/dist/bundle.es77.js +42 -32
  54. package/dist/bundle.es78.js +31 -64
  55. package/dist/bundle.es79.js +65 -40
  56. package/dist/bundle.es80.js +40 -14
  57. package/dist/bundle.es81.js +15 -32
  58. package/dist/bundle.es82.js +23 -61
  59. package/dist/bundle.es83.js +69 -13
  60. package/dist/bundle.es84.js +2 -2
  61. package/dist/bundle.es85.js +2 -2
  62. package/dist/bundle.es86.js +12 -12
  63. package/dist/bundle.es87.js +16 -0
  64. package/dist/index.d.ts +2 -0
  65. package/dist/index.scss +1 -0
  66. package/package.json +1 -1
@@ -1,68 +1,35 @@
1
- var a = /* @__PURE__ */ ((o) => (o.Mod = "Mod", o.Alt = "Alt", o.Shift = "Shift", o.Meta = "Meta", o))(a || {});
2
- const l = [
3
- "Shift",
4
- "Mod",
5
- "ArrowDown",
6
- "ArrowUp",
7
- "Mod+ArrowDown",
8
- "Mod+ArrowUp",
9
- "Enter",
10
- "Escape",
11
- "Backspace",
12
- "Shift+Enter",
13
- "Mod+Enter",
14
- "ArrowLeft",
15
- "ArrowRight",
16
- "Tab",
17
- "Shift+Tab",
18
- "Space",
19
- "Mod+B",
20
- "Mod+U",
21
- "Mod+I",
22
- "Mod+S",
23
- "Mod+K",
24
- "Mod+Equal",
25
- "Mod+Shift+Equal",
26
- "Mod+Minus",
27
- "Mod+Shift+Minus",
28
- "PageUp",
29
- "PageDown",
30
- "Home",
31
- "End"
32
- ], c = typeof navigator < "u" && /Mac|iPhone|iPad|iPod/i.test(navigator.platform), d = (o) => o.key === "Meta" || o.metaKey, s = (o) => o.key === "Control" || o.ctrlKey, M = {
33
- Mod: (o) => c ? d(o) : s(o),
34
- Alt: (o) => o.key === "Alt" || o.altKey,
35
- Shift: (o) => o.key === "Shift" || o.shiftKey,
36
- Meta: (o) => c ? s(o) : d(o)
37
- }, f = (o) => {
38
- try {
39
- const t = [];
40
- for (const e of Object.values(a))
41
- M[e](o) && t.push(e);
42
- if (["Meta", "Control", "Alt", "Shift"].includes(o.key)) {
43
- const e = t.join("+");
44
- return { key: e, code: e };
45
- }
46
- const r = ["Key", "Digit", "Numpad"].find((e) => o.code.startsWith(e)), n = r ? o.code.slice(r.length) : o.code, i = o.key.length === 1 ? o.key.toUpperCase() : o.key;
47
- return {
48
- key: [...t, i].join("+"),
49
- code: [...t, n].join("+")
1
+ import { jsxs as E, jsx as c } from "react/jsx-runtime";
2
+ import { useRef as p, useState as v, useLayoutEffect as N, useEffect as y } from "react";
3
+ import { Editor as R } from "./bundle.es42.js";
4
+ const k = (d) => {
5
+ const {
6
+ id: e,
7
+ className: f,
8
+ inputClassName: i,
9
+ placeholderClassName: m,
10
+ placeholder: r,
11
+ value: s,
12
+ inputMode: n,
13
+ onCreate: b,
14
+ onClick: A
15
+ } = d, u = p(null), o = p(null), [h, a] = v(!0);
16
+ return N(() => {
17
+ const t = document.createElement("span");
18
+ t.setAttribute("contenteditable", "true"), t.setAttribute("class", i), t.dataset.placeholder = r, e && t.setAttribute("id", e), n && t.setAttribute("inputmode", n), u.current && u.current.appendChild(t);
19
+ const l = new R(t), C = l.onContentChange((x) => {
20
+ a(x.length === 0);
21
+ });
22
+ return b(l), o.current = t, () => {
23
+ C(), o.current = null, t.remove();
50
24
  };
51
- } catch {
52
- return;
53
- }
54
- }, y = (o) => {
55
- const t = f(o);
56
- if (!t)
57
- return null;
58
- const { key: r, code: n } = t;
59
- return [r, n].find((i) => l.includes(i)) ?? null;
60
- }, u = (o) => (t) => {
61
- o(y(t), t);
25
+ }, []), y(() => {
26
+ const t = o.current;
27
+ t && (e && t.setAttribute("id", e), n && t.setAttribute("inputmode", n), s && (t.textContent = s, a(!1)), t.setAttribute("class", i), t.setAttribute("role", "textbox"), t.setAttribute("aria-multiline", "true"), r && t.setAttribute("aria-label", r));
28
+ }, [e, i, n, r, s]), /* @__PURE__ */ E("div", { role: "presentation", className: f, children: [
29
+ h && /* @__PURE__ */ c("span", { "aria-hidden": "true", className: m, children: r }),
30
+ /* @__PURE__ */ c("div", { role: "presentation", ref: u, onClick: A })
31
+ ] });
62
32
  };
63
33
  export {
64
- a as Modifier,
65
- f as getKeyCombo,
66
- y as getModuleKeyCombo,
67
- u as onElementKeyDownFactory
34
+ k as WriteBarInput
68
35
  };
@@ -1,43 +1,68 @@
1
- import { isTextNode as s, isElementNode as i } from "@companix/utils-browser";
2
- const a = (t) => s(t) ? t.nodeValue || "" : i(t) && t.nodeName === "IMG" ? t.getAttribute("alt") || "" : i(t) && t.nodeName === "DIV" || i(t) && t.nodeName === "BR" && !(t.parentElement && i(t.parentElement) && t.parentElement.nodeName === "DIV" && t.parentElement.getAttribute("contenteditable") !== "true") ? `
3
- ` : "", m = (t) => {
4
- const e = document.getSelection();
5
- if (!e || e.rangeCount === 0)
6
- return {};
7
- const n = e.getRangeAt(0);
8
- return n && t.contains(n.commonAncestorContainer) ? { range: n, selection: e } : {};
9
- }, l = (t, e, n) => {
10
- let r = n, o = e;
11
- t === e && (r = 0, o = t.childNodes[n]);
12
- const c = document.createTreeWalker(t, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT);
13
- for (; c.nextNode(); ) {
14
- if (c.currentNode === o)
15
- return r;
16
- r += a(c.currentNode).length;
1
+ var a = /* @__PURE__ */ ((o) => (o.Mod = "Mod", o.Alt = "Alt", o.Shift = "Shift", o.Meta = "Meta", o))(a || {});
2
+ const l = [
3
+ "Shift",
4
+ "Mod",
5
+ "ArrowDown",
6
+ "ArrowUp",
7
+ "Mod+ArrowDown",
8
+ "Mod+ArrowUp",
9
+ "Enter",
10
+ "Escape",
11
+ "Backspace",
12
+ "Shift+Enter",
13
+ "Mod+Enter",
14
+ "ArrowLeft",
15
+ "ArrowRight",
16
+ "Tab",
17
+ "Shift+Tab",
18
+ "Space",
19
+ "Mod+B",
20
+ "Mod+U",
21
+ "Mod+I",
22
+ "Mod+S",
23
+ "Mod+K",
24
+ "Mod+Equal",
25
+ "Mod+Shift+Equal",
26
+ "Mod+Minus",
27
+ "Mod+Shift+Minus",
28
+ "PageUp",
29
+ "PageDown",
30
+ "Home",
31
+ "End"
32
+ ], c = typeof navigator < "u" && /Mac|iPhone|iPad|iPod/i.test(navigator.platform), d = (o) => o.key === "Meta" || o.metaKey, s = (o) => o.key === "Control" || o.ctrlKey, M = {
33
+ Mod: (o) => c ? d(o) : s(o),
34
+ Alt: (o) => o.key === "Alt" || o.altKey,
35
+ Shift: (o) => o.key === "Shift" || o.shiftKey,
36
+ Meta: (o) => c ? s(o) : d(o)
37
+ }, f = (o) => {
38
+ try {
39
+ const t = [];
40
+ for (const e of Object.values(a))
41
+ M[e](o) && t.push(e);
42
+ if (["Meta", "Control", "Alt", "Shift"].includes(o.key)) {
43
+ const e = t.join("+");
44
+ return { key: e, code: e };
45
+ }
46
+ const r = ["Key", "Digit", "Numpad"].find((e) => o.code.startsWith(e)), n = r ? o.code.slice(r.length) : o.code, i = o.key.length === 1 ? o.key.toUpperCase() : o.key;
47
+ return {
48
+ key: [...t, i].join("+"),
49
+ code: [...t, n].join("+")
50
+ };
51
+ } catch {
52
+ return;
17
53
  }
18
- return r;
19
- }, f = (t, e) => {
20
- const n = l(t, e.startContainer, e.startOffset);
21
- return {
22
- from: n,
23
- to: e.collapsed ? n : l(t, e.endContainer, e.endOffset)
24
- };
25
- }, g = () => {
26
- const t = window.getSelection();
27
- if (!t || !t.rangeCount) return;
28
- const e = t.getRangeAt(0);
29
- if (e.commonAncestorContainer === document) return;
30
- const n = e.commonAncestorContainer.parentElement;
31
- if (!n) return;
32
- const r = n.getBoundingClientRect(), o = e.getBoundingClientRect().bottom - r.bottom;
33
- o > 0 && n.scrollBy({ top: o });
34
- }, d = (t) => t.replace(/&nbsp;/gi, " ").replace(/<br\s*\/?>/gi, `
35
- `);
54
+ }, y = (o) => {
55
+ const t = f(o);
56
+ if (!t)
57
+ return null;
58
+ const { key: r, code: n } = t;
59
+ return [r, n].find((i) => l.includes(i)) ?? null;
60
+ }, u = (o) => (t) => {
61
+ o(y(t), t);
62
+ };
36
63
  export {
37
- m as getEditorSelection,
38
- a as getNodeTextContent,
39
- l as getPlainTextOffset,
40
- f as getTextSelectionOffsets,
41
- d as normalizeEditorText,
42
- g as scrollSelectionIntoView
64
+ a as Modifier,
65
+ f as getKeyCombo,
66
+ y as getModuleKeyCombo,
67
+ u as onElementKeyDownFactory
43
68
  };
@@ -1,17 +1,43 @@
1
- const r = (e, o) => {
2
- let t;
3
- try {
4
- t = localStorage.getItem(e) || void 0;
5
- } catch {
1
+ import { isTextNode as s, isElementNode as i } from "@companix/utils-browser";
2
+ const a = (t) => s(t) ? t.nodeValue || "" : i(t) && t.nodeName === "IMG" ? t.getAttribute("alt") || "" : i(t) && t.nodeName === "DIV" || i(t) && t.nodeName === "BR" && !(t.parentElement && i(t.parentElement) && t.parentElement.nodeName === "DIV" && t.parentElement.getAttribute("contenteditable") !== "true") ? `
3
+ ` : "", m = (t) => {
4
+ const e = document.getSelection();
5
+ if (!e || e.rangeCount === 0)
6
+ return {};
7
+ const n = e.getRangeAt(0);
8
+ return n && t.contains(n.commonAncestorContainer) ? { range: n, selection: e } : {};
9
+ }, l = (t, e, n) => {
10
+ let r = n, o = e;
11
+ t === e && (r = 0, o = t.childNodes[n]);
12
+ const c = document.createTreeWalker(t, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT);
13
+ for (; c.nextNode(); ) {
14
+ if (c.currentNode === o)
15
+ return r;
16
+ r += a(c.currentNode).length;
6
17
  }
7
- return t ?? o;
8
- }, m = (e) => (e || (e = window.matchMedia("(prefers-color-scheme: dark)")), e.matches ? "dark" : "light"), s = (e) => {
9
- const [o, t] = ["theme-light", "theme-dark"];
10
- let c = e;
11
- e === "system" && (c = m()), document.documentElement.classList.remove(o, t), document.documentElement.classList.add(c === "dark" ? t : o), document.documentElement.style.colorScheme = c;
12
- };
18
+ return r;
19
+ }, f = (t, e) => {
20
+ const n = l(t, e.startContainer, e.startOffset);
21
+ return {
22
+ from: n,
23
+ to: e.collapsed ? n : l(t, e.endContainer, e.endOffset)
24
+ };
25
+ }, g = () => {
26
+ const t = window.getSelection();
27
+ if (!t || !t.rangeCount) return;
28
+ const e = t.getRangeAt(0);
29
+ if (e.commonAncestorContainer === document) return;
30
+ const n = e.commonAncestorContainer.parentElement;
31
+ if (!n) return;
32
+ const r = n.getBoundingClientRect(), o = e.getBoundingClientRect().bottom - r.bottom;
33
+ o > 0 && n.scrollBy({ top: o });
34
+ }, d = (t) => t.replace(/&nbsp;/gi, " ").replace(/<br\s*\/?>/gi, `
35
+ `);
13
36
  export {
14
- r as getColorScheme,
15
- m as getSystemColorScheme,
16
- s as updateDOM
37
+ m as getEditorSelection,
38
+ a as getNodeTextContent,
39
+ l as getPlainTextOffset,
40
+ f as getTextSelectionOffsets,
41
+ d as normalizeEditorText,
42
+ g as scrollSelectionIntoView
17
43
  };
@@ -1,34 +1,17 @@
1
- import { jsx as s, Fragment as p } from "react/jsx-runtime";
2
- import { forwardRef as f, useState as c, useImperativeHandle as u } from "react";
3
- import { AlertDialog as x } from "./bundle.es26.js";
4
- const g = f((l, a) => {
5
- const [i, o] = c([]);
6
- u(
7
- a,
8
- () => ({
9
- showAlert: (e) => {
10
- o((t) => [...t, e]);
11
- }
12
- }),
13
- []
14
- );
15
- const d = (e) => {
16
- o((t) => {
17
- const r = [...t], n = r.findIndex((m) => m.id === e);
18
- return n !== -1 && r.splice(n, 1), r;
19
- });
20
- };
21
- return /* @__PURE__ */ s(p, { children: i.map(({ id: e, ...t }) => /* @__PURE__ */ s(
22
- x,
23
- {
24
- defaultOpen: !0,
25
- onClosed: () => d(e),
26
- ...l,
27
- ...t
28
- },
29
- `alert-${e}`
30
- )) });
31
- });
1
+ const r = (e, o) => {
2
+ let t;
3
+ try {
4
+ t = localStorage.getItem(e) || void 0;
5
+ } catch {
6
+ }
7
+ return t ?? o;
8
+ }, m = (e) => (e || (e = window.matchMedia("(prefers-color-scheme: dark)")), e.matches ? "dark" : "light"), s = (e) => {
9
+ const [o, t] = ["theme-light", "theme-dark"];
10
+ let c = e;
11
+ e === "system" && (c = m()), document.documentElement.classList.remove(o, t), document.documentElement.classList.add(c === "dark" ? t : o), document.documentElement.style.colorScheme = c;
12
+ };
32
13
  export {
33
- g as Viewport
14
+ r as getColorScheme,
15
+ m as getSystemColorScheme,
16
+ s as updateDOM
34
17
  };
@@ -1,72 +1,34 @@
1
- import { jsxs as y, jsx as I } from "react/jsx-runtime";
2
- import { forwardRef as $, useState as b, useMemo as C, useImperativeHandle as w, useCallback as P, createElement as j } from "react";
3
- import * as c from "@radix-ui/react-toast";
4
- import { customCSS as k } from "@companix/utils-browser";
5
- import { Toast as E } from "./bundle.es55.js";
6
- var u = /* @__PURE__ */ ((r) => (r["top-center"] = "up", r["top-left"] = "left", r["top-right"] = "right", r["bottom-center"] = "down", r["bottom-left"] = "left", r["bottom-right"] = "right", r))(u || {});
7
- const M = $((r, h) => {
8
- const { side: l = "top", align: f = "center", gap: d = 14, duration: g, swipeThreshold: x, closeIcon: T } = r, [i, p] = b([]), a = C(() => ({}), []);
9
- w(
10
- h,
1
+ import { jsx as s, Fragment as p } from "react/jsx-runtime";
2
+ import { forwardRef as f, useState as c, useImperativeHandle as u } from "react";
3
+ import { AlertDialog as x } from "./bundle.es26.js";
4
+ const g = f((l, a) => {
5
+ const [i, o] = c([]);
6
+ u(
7
+ a,
11
8
  () => ({
12
- showToast: (t) => {
13
- p((o) => {
14
- const e = [...o], n = o.findIndex((s) => s.id === t.id);
15
- return n === -1 ? e.push(t) : e[n] = t, e;
16
- });
9
+ showAlert: (e) => {
10
+ o((t) => [...t, e]);
17
11
  }
18
12
  }),
19
13
  []
20
14
  );
21
- const m = P((t) => {
22
- t.forEach(({ id: o }, e) => {
23
- let n = 0;
24
- for (let s = e + 1; s < t.length; s++)
25
- a[t[s].id] && (n += a[t[s].id].clientHeight + d);
26
- a[o] && a[o].style.setProperty("--offset", `${n}px`);
27
- });
28
- }, []), v = (t) => {
29
- p((o) => {
30
- const e = [...o], n = e.findIndex((s) => s.id === t);
31
- return n !== -1 && e.splice(n, 1), e;
15
+ const d = (e) => {
16
+ o((t) => {
17
+ const r = [...t], n = r.findIndex((m) => m.id === e);
18
+ return n !== -1 && r.splice(n, 1), r;
32
19
  });
33
20
  };
34
- return /* @__PURE__ */ y(
35
- c.Provider,
21
+ return /* @__PURE__ */ s(p, { children: i.map(({ id: e, ...t }) => /* @__PURE__ */ s(
22
+ x,
36
23
  {
37
- swipeThreshold: x,
38
- swipeDirection: u[`${l}-${f}`],
39
- children: [
40
- i.map(({ id: t, ...o }) => /* @__PURE__ */ j(
41
- E,
42
- {
43
- ...o,
44
- id: t,
45
- key: `toaster-${t}`,
46
- duration: o.duration ?? g,
47
- closeIcon: T,
48
- onInitialized: (e) => {
49
- a[t] = e, m(i);
50
- },
51
- onClosing: () => {
52
- delete a[t], m(i);
53
- },
54
- onClosed: () => v(t)
55
- }
56
- )),
57
- /* @__PURE__ */ I(
58
- c.Viewport,
59
- {
60
- "data-side": l,
61
- "data-align": f,
62
- className: "toaster-viewport",
63
- style: k({ "--toasters-gap": `${d}px` })
64
- }
65
- )
66
- ]
67
- }
68
- );
24
+ defaultOpen: !0,
25
+ onClosed: () => d(e),
26
+ ...l,
27
+ ...t
28
+ },
29
+ `alert-${e}`
30
+ )) });
69
31
  });
70
32
  export {
71
- M as Viewport
33
+ g as Viewport
72
34
  };
@@ -1,16 +1,72 @@
1
- import { useRef as l, useCallback as p } from "react";
2
- import { useEffectWithLayout as d } from "./bundle.es86.js";
3
- const g = (r, f) => {
4
- const c = l(null), i = l(null), o = { Right: c, Left: i }, u = p((t) => {
5
- if (r.current) {
6
- const n = r.current.style, e = o[t];
7
- e.current && e.current.clientWidth ? n[`padding${t}`] !== `${e.current.clientWidth}px` && (n[`padding${t}`] = `${e.current.clientWidth}px`) : n[`padding${t}`] && (n[`padding${t}`] = "");
1
+ import { jsxs as y, jsx as I } from "react/jsx-runtime";
2
+ import { forwardRef as $, useState as b, useMemo as C, useImperativeHandle as w, useCallback as P, createElement as j } from "react";
3
+ import * as c from "@radix-ui/react-toast";
4
+ import { customCSS as k } from "@companix/utils-browser";
5
+ import { Toast as E } from "./bundle.es56.js";
6
+ var u = /* @__PURE__ */ ((r) => (r["top-center"] = "up", r["top-left"] = "left", r["top-right"] = "right", r["bottom-center"] = "down", r["bottom-left"] = "left", r["bottom-right"] = "right", r))(u || {});
7
+ const M = $((r, h) => {
8
+ const { side: l = "top", align: f = "center", gap: d = 14, duration: g, swipeThreshold: x, closeIcon: T } = r, [i, p] = b([]), a = C(() => ({}), []);
9
+ w(
10
+ h,
11
+ () => ({
12
+ showToast: (t) => {
13
+ p((o) => {
14
+ const e = [...o], n = o.findIndex((s) => s.id === t.id);
15
+ return n === -1 ? e.push(t) : e[n] = t, e;
16
+ });
17
+ }
18
+ }),
19
+ []
20
+ );
21
+ const m = P((t) => {
22
+ t.forEach(({ id: o }, e) => {
23
+ let n = 0;
24
+ for (let s = e + 1; s < t.length; s++)
25
+ a[t[s].id] && (n += a[t[s].id].clientHeight + d);
26
+ a[o] && a[o].style.setProperty("--offset", `${n}px`);
27
+ });
28
+ }, []), v = (t) => {
29
+ p((o) => {
30
+ const e = [...o], n = e.findIndex((s) => s.id === t);
31
+ return n !== -1 && e.splice(n, 1), e;
32
+ });
33
+ };
34
+ return /* @__PURE__ */ y(
35
+ c.Provider,
36
+ {
37
+ swipeThreshold: x,
38
+ swipeDirection: u[`${l}-${f}`],
39
+ children: [
40
+ i.map(({ id: t, ...o }) => /* @__PURE__ */ j(
41
+ E,
42
+ {
43
+ ...o,
44
+ id: t,
45
+ key: `toaster-${t}`,
46
+ duration: o.duration ?? g,
47
+ closeIcon: T,
48
+ onInitialized: (e) => {
49
+ a[t] = e, m(i);
50
+ },
51
+ onClosing: () => {
52
+ delete a[t], m(i);
53
+ },
54
+ onClosed: () => v(t)
55
+ }
56
+ )),
57
+ /* @__PURE__ */ I(
58
+ c.Viewport,
59
+ {
60
+ "data-side": l,
61
+ "data-align": f,
62
+ className: "toaster-viewport",
63
+ style: k({ "--toasters-gap": `${d}px` })
64
+ }
65
+ )
66
+ ]
8
67
  }
9
- }, []);
10
- return d(() => {
11
- u("Left"), u("Right");
12
- }, f), { rightRef: c, leftRef: i };
13
- };
68
+ );
69
+ });
14
70
  export {
15
- g as useInputPadding
71
+ M as Viewport
16
72
  };
@@ -1,10 +1,10 @@
1
1
  import { jsxs as d, jsx as o } from "react/jsx-runtime";
2
2
  import { useCallback as u, useMemo as h } from "react";
3
3
  import { Select as p } from "./bundle.es13.js";
4
- import { getMonths as k, getYears as z, DEFAULT_MAX_YEAR as f, DEFAULT_MIN_YEAR as g } from "./bundle.es66.js";
4
+ import { getMonths as k, getYears as z, DEFAULT_MAX_YEAR as f, DEFAULT_MIN_YEAR as g } from "./bundle.es67.js";
5
5
  import { Icon as C } from "./bundle.es36.js";
6
6
  import { faChevronLeft as E, faChevronRight as T } from "@companix/icons-solid";
7
- import { setMonth as _, setYear as F } from "./bundle.es60.js";
7
+ import { setMonth as _, setYear as F } from "./bundle.es61.js";
8
8
  const y = ({
9
9
  viewDate: n,
10
10
  onChange: c,
@@ -1,5 +1,5 @@
1
- import { subMonths as L, addMonths as N, useDayDisableCheker as R } from "./bundle.es60.js";
2
- import { DEFAULT_MIN_YEAR as w, DEFAULT_MAX_YEAR as A } from "./bundle.es66.js";
1
+ import { subMonths as L, addMonths as N, useDayDisableCheker as R } from "./bundle.es61.js";
2
+ import { DEFAULT_MIN_YEAR as w, DEFAULT_MAX_YEAR as A } from "./bundle.es67.js";
3
3
  import { useState as U, useCallback as M } from "react";
4
4
  const X = ({
5
5
  value: p,
@@ -1,16 +1,16 @@
1
- import { useRef as f, useLayoutEffect as u, useEffect as s } from "react";
2
- const o = (t, r) => {
3
- const e = f(!1);
4
- u(() => {
5
- e.current = !0, t();
6
- }, []), s(() => {
7
- if (e.current) {
8
- e.current = !1;
9
- return;
1
+ import { useRef as l, useCallback as p } from "react";
2
+ import { useEffectWithLayout as d } from "./bundle.es87.js";
3
+ const g = (r, f) => {
4
+ const c = l(null), i = l(null), o = { Right: c, Left: i }, u = p((t) => {
5
+ if (r.current) {
6
+ const n = r.current.style, e = o[t];
7
+ e.current && e.current.clientWidth ? n[`padding${t}`] !== `${e.current.clientWidth}px` && (n[`padding${t}`] = `${e.current.clientWidth}px`) : n[`padding${t}`] && (n[`padding${t}`] = "");
10
8
  }
11
- t();
12
- }, r);
9
+ }, []);
10
+ return d(() => {
11
+ u("Left"), u("Right");
12
+ }, f), { rightRef: c, leftRef: i };
13
13
  };
14
14
  export {
15
- o as useEffectWithLayout
15
+ g as useInputPadding
16
16
  };
@@ -0,0 +1,16 @@
1
+ import { useRef as f, useLayoutEffect as u, useEffect as s } from "react";
2
+ const o = (t, r) => {
3
+ const e = f(!1);
4
+ u(() => {
5
+ e.current = !0, t();
6
+ }, []), s(() => {
7
+ if (e.current) {
8
+ e.current = !1;
9
+ return;
10
+ }
11
+ t();
12
+ }, r);
13
+ };
14
+ export {
15
+ o as useEffectWithLayout
16
+ };
package/dist/index.d.ts CHANGED
@@ -81,6 +81,8 @@ export { DropArea, DropAreaProvider, useDragEnter } from './DropArea';
81
81
  export type { DropAreaProps } from './DropArea';
82
82
  export { Table } from './Table';
83
83
  export type { TableProps } from './Table';
84
+ export { ImageBase } from './ImageBase';
85
+ export type { ImageBaseProps } from './ImageBase';
84
86
  export { ThemeProvider, useTheme } from './ThemeProvider';
85
87
  export { ColorSchemeScript, colorSchemeScript } from './ThemeProvider/script';
86
88
  export { useLocalStorage, LocalStorageProvider } from './__hooks/use-local-storage';
package/dist/index.scss CHANGED
@@ -32,3 +32,4 @@
32
32
  @use './Blank/Blank.scss';
33
33
  @use './WriteBar/WireBar.scss';
34
34
  @use './DropArea/DropArea.scss';
35
+ @use './ImageBase/ImageBase.scss';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@companix/uikit",
3
- "version": "0.1.27",
3
+ "version": "0.1.29",
4
4
  "main": "./dist/bundle.es.js",
5
5
  "module": "./dist/bundle.es.js",
6
6
  "types": "./dist/index.d.ts",