@acronis-platform/ui-react 0.56.1 → 0.57.1

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 (44) hide show
  1. package/dist/components/ui/avatar/avatar.js +7 -7
  2. package/dist/components/ui/avatar/avatar.js.map +1 -1
  3. package/dist/components/ui/bar-chart/bar-chart.js +104 -0
  4. package/dist/components/ui/bar-chart/bar-chart.js.map +1 -0
  5. package/dist/components/ui/chart/chart.js +49 -49
  6. package/dist/components/ui/chart/chart.js.map +1 -1
  7. package/dist/components/ui/checkbox/checkbox.js +1 -1
  8. package/dist/components/ui/checkbox/checkbox.js.map +1 -1
  9. package/dist/components/ui/chip/chip.js +28 -28
  10. package/dist/components/ui/chip/chip.js.map +1 -1
  11. package/dist/components/ui/data-table/data-table.js +223 -155
  12. package/dist/components/ui/data-table/data-table.js.map +1 -1
  13. package/dist/components/ui/input-text/input-text.js +8 -8
  14. package/dist/components/ui/input-text/input-text.js.map +1 -1
  15. package/dist/components/ui/link/link.js +16 -16
  16. package/dist/components/ui/link/link.js.map +1 -1
  17. package/dist/components/ui/page-header/page-header.js +159 -49
  18. package/dist/components/ui/page-header/page-header.js.map +1 -1
  19. package/dist/components/ui/search/search.js +6 -6
  20. package/dist/components/ui/search/search.js.map +1 -1
  21. package/dist/components/ui/table/table.js +32 -32
  22. package/dist/components/ui/table/table.js.map +1 -1
  23. package/dist/components/ui/toolbar/toolbar.js +214 -0
  24. package/dist/components/ui/toolbar/toolbar.js.map +1 -0
  25. package/dist/hooks/use-intersection-observer.js +26 -0
  26. package/dist/hooks/use-intersection-observer.js.map +1 -0
  27. package/dist/index.js +356 -343
  28. package/dist/index.js.map +1 -1
  29. package/dist/react.js +356 -343
  30. package/dist/react.js.map +1 -1
  31. package/dist/src/components/ui/bar-chart/bar-chart.d.ts +28 -0
  32. package/dist/src/components/ui/bar-chart/index.d.ts +1 -0
  33. package/dist/src/components/ui/data-table/data-table.d.ts +107 -4
  34. package/dist/src/components/ui/data-table/data-table.docs.d.ts +88 -4
  35. package/dist/src/components/ui/data-table/index.d.ts +1 -1
  36. package/dist/src/components/ui/page-header/index.d.ts +1 -1
  37. package/dist/src/components/ui/page-header/page-header.d.ts +9 -3
  38. package/dist/src/components/ui/toolbar/index.d.ts +1 -0
  39. package/dist/src/components/ui/toolbar/toolbar.d.ts +23 -0
  40. package/dist/src/hooks/index.d.ts +1 -0
  41. package/dist/src/hooks/use-intersection-observer.d.ts +26 -0
  42. package/dist/src/index.d.ts +2 -0
  43. package/dist/ui-react.css +1 -1
  44. package/package.json +3 -3
@@ -0,0 +1,26 @@
1
+ import { useRef as v, useState as b, useEffect as l } from "react";
2
+ function p({
3
+ onIntersect: n,
4
+ disabled: t = !1,
5
+ root: r,
6
+ rootMargin: s,
7
+ threshold: c
8
+ }) {
9
+ const u = v(n);
10
+ u.current = n;
11
+ const [e, o] = b(null);
12
+ return l(() => {
13
+ if (t || !e) return;
14
+ const f = new IntersectionObserver(
15
+ (i) => {
16
+ i.some((m) => m.isIntersecting) && u.current();
17
+ },
18
+ { root: r, rootMargin: s, threshold: c }
19
+ );
20
+ return f.observe(e), () => f.disconnect();
21
+ }, [e, t, r, s, c]), o;
22
+ }
23
+ export {
24
+ p as useIntersectionObserver
25
+ };
26
+ //# sourceMappingURL=use-intersection-observer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-intersection-observer.js","sources":["../../src/hooks/use-intersection-observer.ts"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\n\nexport interface UseIntersectionObserverOptions extends IntersectionObserverInit {\n /** Called each time the observed element intersects its root. */\n onIntersect: () => void;\n /**\n * Skip observing — e.g. there's nothing left to load, or a load is already\n * in flight. Disconnects any existing observer.\n */\n disabled?: boolean;\n}\n\n/**\n * Wires a single `IntersectionObserver` on the returned ref callback's element\n * and calls `onIntersect` each time it intersects. Re-creates the observer when\n * the element, `disabled`, or any `IntersectionObserverInit` option changes;\n * disconnects on cleanup. `onIntersect` itself doesn't need to be memoized by\n * the caller — the latest version is always used (via a ref) without\n * reconnecting the observer.\n *\n * Takes a ref *callback* (not a `RefObject`) rather than accepting one from the\n * caller — attaching to `element.current` inside a `useEffect` keyed on a\n * `RefObject` misses conditionally-mounted elements: the `ref` object's\n * identity never changes when its `.current` is populated, so an effect keyed\n * on it (rather than on the element itself) never re-runs once the element\n * actually mounts. Routing the DOM node through `useState` instead makes the\n * mount itself a dependency.\n */\nexport function useIntersectionObserver<T extends Element>({\n onIntersect,\n disabled = false,\n root,\n rootMargin,\n threshold,\n}: UseIntersectionObserverOptions): (node: T | null) => void {\n const onIntersectRef = useRef(onIntersect);\n onIntersectRef.current = onIntersect;\n\n const [element, setElement] = useState<T | null>(null);\n\n useEffect(() => {\n if (disabled || !element) return;\n\n const observer = new IntersectionObserver(\n (entries) => {\n if (entries.some((entry) => entry.isIntersecting)) {\n onIntersectRef.current();\n }\n },\n { root, rootMargin, threshold }\n );\n observer.observe(element);\n return () => observer.disconnect();\n }, [element, disabled, root, rootMargin, threshold]);\n\n return setElement;\n}\n"],"names":["useIntersectionObserver","onIntersect","disabled","root","rootMargin","threshold","onIntersectRef","useRef","element","setElement","useState","useEffect","observer","entries","entry"],"mappings":";AA4BO,SAASA,EAA2C;AAAA,EACzD,aAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,MAAAC;AAAA,EACA,YAAAC;AAAA,EACA,WAAAC;AACF,GAA6D;AAC3D,QAAMC,IAAiBC,EAAON,CAAW;AACzC,EAAAK,EAAe,UAAUL;AAEzB,QAAM,CAACO,GAASC,CAAU,IAAIC,EAAmB,IAAI;AAErD,SAAAC,EAAU,MAAM;AACd,QAAIT,KAAY,CAACM,EAAS;AAE1B,UAAMI,IAAW,IAAI;AAAA,MACnB,CAACC,MAAY;AACX,QAAIA,EAAQ,KAAK,CAACC,MAAUA,EAAM,cAAc,KAC9CR,EAAe,QAAA;AAAA,MAEnB;AAAA,MACA,EAAE,MAAAH,GAAM,YAAAC,GAAY,WAAAC,EAAA;AAAA,IAAU;AAEhC,WAAAO,EAAS,QAAQJ,CAAO,GACjB,MAAMI,EAAS,WAAA;AAAA,EACxB,GAAG,CAACJ,GAASN,GAAUC,GAAMC,GAAYC,CAAS,CAAC,GAE5CI;AACT;"}