kiban-design-system 3.7.0 → 3.9.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.
Files changed (116) hide show
  1. package/dist/components/data-table/components/DataTableFooter.d.ts +15 -0
  2. package/dist/components/data-table/components/DataTableFooter.d.ts.map +1 -0
  3. package/dist/components/data-table/components/DataTableFooter.js +25 -0
  4. package/dist/components/data-table/components/DataTableHeader.d.ts +8 -0
  5. package/dist/components/data-table/components/DataTableHeader.d.ts.map +1 -0
  6. package/dist/components/data-table/components/DataTableHeader.js +27 -0
  7. package/dist/components/data-table/components/DataTableHeaderCell.d.ts +11 -0
  8. package/dist/components/data-table/components/DataTableHeaderCell.d.ts.map +1 -0
  9. package/dist/components/data-table/components/DataTableHeaderCell.js +81 -0
  10. package/dist/components/data-table/components/DataTablePagination.d.ts +9 -0
  11. package/dist/components/data-table/components/DataTablePagination.d.ts.map +1 -0
  12. package/dist/components/data-table/components/DataTablePagination.js +36 -0
  13. package/dist/components/data-table/components/DataTableTotalsRow.d.ts +10 -0
  14. package/dist/components/data-table/components/DataTableTotalsRow.d.ts.map +1 -0
  15. package/dist/components/data-table/components/DataTableTotalsRow.js +95 -0
  16. package/dist/components/data-table/data-table.d.ts +26 -0
  17. package/dist/components/data-table/data-table.d.ts.map +1 -0
  18. package/dist/components/data-table/data-table.js +134 -0
  19. package/dist/components/data-table/hooks/useDataTableColumns.d.ts +5 -0
  20. package/dist/components/data-table/hooks/useDataTableColumns.d.ts.map +1 -0
  21. package/dist/components/data-table/hooks/useDataTableColumns.js +39 -0
  22. package/dist/components/data-table/hooks/useDataTableConfig.d.ts +18 -0
  23. package/dist/components/data-table/hooks/useDataTableConfig.d.ts.map +1 -0
  24. package/dist/components/data-table/hooks/useDataTableConfig.js +54 -0
  25. package/dist/components/data-table/hooks/useStickyColumns.d.ts +5 -0
  26. package/dist/components/data-table/hooks/useStickyColumns.d.ts.map +1 -0
  27. package/dist/components/data-table/hooks/useStickyColumns.js +20 -0
  28. package/dist/components/data-table/utils/iconMap.d.ts +4 -0
  29. package/dist/components/data-table/utils/iconMap.d.ts.map +1 -0
  30. package/dist/components/data-table/utils/iconMap.js +11 -0
  31. package/dist/components/data-table/utils/stickyColumns.d.ts +17 -0
  32. package/dist/components/data-table/utils/stickyColumns.d.ts.map +1 -0
  33. package/dist/components/data-table/utils/stickyColumns.js +10 -0
  34. package/dist/components/data-table.d.ts +2 -0
  35. package/dist/components/data-table.d.ts.map +1 -0
  36. package/dist/components/header.d.ts +26 -0
  37. package/dist/components/header.d.ts.map +1 -0
  38. package/dist/components/header.js +81 -0
  39. package/dist/components/otp-form.d.ts +6 -1
  40. package/dist/components/otp-form.d.ts.map +1 -1
  41. package/dist/components/otp-form.js +49 -43
  42. package/dist/components/ui/avatar.d.ts +12 -0
  43. package/dist/components/ui/avatar.d.ts.map +1 -0
  44. package/dist/components/ui/avatar.js +106 -0
  45. package/dist/components/ui/badge.d.ts +10 -0
  46. package/dist/components/ui/badge.d.ts.map +1 -0
  47. package/dist/components/ui/badge.js +40 -0
  48. package/dist/components/ui/checkbox.d.ts +5 -0
  49. package/dist/components/ui/checkbox.d.ts.map +1 -0
  50. package/dist/components/ui/checkbox.js +33 -0
  51. package/dist/components/ui/dropdown-menu.d.ts +29 -0
  52. package/dist/components/ui/dropdown-menu.d.ts.map +1 -0
  53. package/dist/components/ui/dropdown-menu.js +118 -0
  54. package/dist/components/ui/table.d.ts +11 -0
  55. package/dist/components/ui/table.d.ts.map +1 -0
  56. package/dist/components/ui/table.js +115 -0
  57. package/dist/components/ui/tabs.d.ts +8 -0
  58. package/dist/components/ui/tabs.d.ts.map +1 -0
  59. package/dist/components/ui/tooltip.d.ts +8 -0
  60. package/dist/components/ui/tooltip.d.ts.map +1 -0
  61. package/dist/components/ui/tooltip.js +56 -0
  62. package/dist/index.d.ts +7 -0
  63. package/dist/index.d.ts.map +1 -1
  64. package/dist/index.js +97 -67
  65. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +532 -0
  66. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +402 -0
  67. package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +208 -0
  68. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +136 -0
  69. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +130 -0
  70. package/dist/node_modules/@radix-ui/primitive/dist/index.js +9 -0
  71. package/dist/node_modules/@radix-ui/react-arrow/dist/index.js +24 -0
  72. package/dist/node_modules/@radix-ui/react-collection/dist/index.js +50 -0
  73. package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js +29 -0
  74. package/dist/node_modules/@radix-ui/react-context/dist/index.js +53 -0
  75. package/dist/node_modules/@radix-ui/react-direction/dist/index.js +10 -0
  76. package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +127 -0
  77. package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.js +213 -0
  78. package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.js +17 -0
  79. package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.js +136 -0
  80. package/dist/node_modules/@radix-ui/react-id/dist/index.js +13 -0
  81. package/dist/node_modules/@radix-ui/react-menu/dist/index.js +608 -0
  82. package/dist/node_modules/@radix-ui/react-popper/dist/index.js +219 -0
  83. package/dist/node_modules/@radix-ui/react-portal/dist/index.js +15 -0
  84. package/dist/node_modules/@radix-ui/react-presence/dist/index.js +70 -0
  85. package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +36 -0
  86. package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.js +183 -0
  87. package/dist/node_modules/@radix-ui/react-tooltip/dist/index.js +338 -0
  88. package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +10 -0
  89. package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +52 -0
  90. package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +14 -0
  91. package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +6 -0
  92. package/dist/node_modules/@radix-ui/react-use-size/dist/index.js +27 -0
  93. package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.js +32 -0
  94. package/dist/node_modules/aria-hidden/dist/es2015/index.js +52 -0
  95. package/dist/node_modules/get-nonce/dist/es2015/index.js +7 -0
  96. package/dist/node_modules/react-remove-scroll/dist/es2015/Combination.js +11 -0
  97. package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +115 -0
  98. package/dist/node_modules/react-remove-scroll/dist/es2015/UI.js +31 -0
  99. package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +16 -0
  100. package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +68 -0
  101. package/dist/node_modules/react-remove-scroll/dist/es2015/medium.js +5 -0
  102. package/dist/node_modules/react-remove-scroll/dist/es2015/sidecar.js +7 -0
  103. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.js +71 -0
  104. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/constants.js +7 -0
  105. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.js +25 -0
  106. package/dist/node_modules/react-style-singleton/dist/es2015/component.js +11 -0
  107. package/dist/node_modules/react-style-singleton/dist/es2015/hook.js +15 -0
  108. package/dist/node_modules/react-style-singleton/dist/es2015/singleton.js +30 -0
  109. package/dist/node_modules/tslib/tslib.es6.js +27 -0
  110. package/dist/node_modules/use-callback-ref/dist/es2015/assignRef.js +6 -0
  111. package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +26 -0
  112. package/dist/node_modules/use-callback-ref/dist/es2015/useRef.js +25 -0
  113. package/dist/node_modules/use-sidecar/dist/es2015/exports.js +18 -0
  114. package/dist/node_modules/use-sidecar/dist/es2015/medium.js +67 -0
  115. package/dist/style.css +1 -1
  116. package/package.json +8 -1
@@ -0,0 +1,31 @@
1
+ import { __rest as E, __assign as r } from "../../../tslib/tslib.es6.js";
2
+ import * as a from "react";
3
+ import { zeroRightClassName as I, fullWidthClassName as Z } from "../../../react-remove-scroll-bar/dist/es2015/constants.js";
4
+ import { effectCar as W } from "./medium.js";
5
+ import { useMergeRefs as z } from "../../../use-callback-ref/dist/es2015/useMergeRef.js";
6
+ var l = function() {
7
+ }, m = a.forwardRef(function(e, d) {
8
+ var o = a.useRef(null), n = a.useState({
9
+ onScrollCapture: l,
10
+ onWheelCapture: l,
11
+ onTouchMoveCapture: l
12
+ }), f = n[0], v = n[1], h = e.forwardProps, t = e.children, u = e.className, C = e.removeScrollBar, R = e.enabled, g = e.shards, P = e.sideCar, S = e.noRelative, b = e.noIsolation, w = e.inert, N = e.allowPinchZoom, i = e.as, M = i === void 0 ? "div" : i, _ = e.gapMode, B = E(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), k = P, s = z([o, d]), c = r(r({}, B), f);
13
+ return a.createElement(
14
+ a.Fragment,
15
+ null,
16
+ R && a.createElement(k, { sideCar: W, removeScrollBar: C, shards: g, noRelative: S, noIsolation: b, inert: w, setCallbacks: v, allowPinchZoom: !!N, lockRef: o, gapMode: _ }),
17
+ h ? a.cloneElement(a.Children.only(t), r(r({}, c), { ref: s })) : a.createElement(M, r({}, c, { className: u, ref: s }), t)
18
+ );
19
+ });
20
+ m.defaultProps = {
21
+ enabled: !0,
22
+ removeScrollBar: !0,
23
+ inert: !1
24
+ };
25
+ m.classNames = {
26
+ fullWidth: Z,
27
+ zeroRight: I
28
+ };
29
+ export {
30
+ m as RemoveScroll
31
+ };
@@ -0,0 +1,16 @@
1
+ var r = !1;
2
+ if (typeof window < "u")
3
+ try {
4
+ var e = Object.defineProperty({}, "passive", {
5
+ get: function() {
6
+ return r = !0, !0;
7
+ }
8
+ });
9
+ window.addEventListener("test", e, e), window.removeEventListener("test", e, e);
10
+ } catch {
11
+ r = !1;
12
+ }
13
+ var a = r ? { passive: !1 } : !1;
14
+ export {
15
+ a as nonPassive
16
+ };
@@ -0,0 +1,68 @@
1
+ var N = function(r) {
2
+ return r.tagName === "TEXTAREA";
3
+ }, b = function(r, e) {
4
+ if (!(r instanceof Element))
5
+ return !1;
6
+ var t = window.getComputedStyle(r);
7
+ return (
8
+ // not-not-scrollable
9
+ t[e] !== "hidden" && // contains scroll inside self
10
+ !(t.overflowY === t.overflowX && !N(r) && t[e] === "visible")
11
+ );
12
+ }, D = function(r) {
13
+ return b(r, "overflowY");
14
+ }, E = function(r) {
15
+ return b(r, "overflowX");
16
+ }, T = function(r, e) {
17
+ var t = e.ownerDocument, l = e;
18
+ do {
19
+ typeof ShadowRoot < "u" && l instanceof ShadowRoot && (l = l.host);
20
+ var f = g(r, l);
21
+ if (f) {
22
+ var n = m(r, l), i = n[1], o = n[2];
23
+ if (i > o)
24
+ return !0;
25
+ }
26
+ l = l.parentNode;
27
+ } while (l && l !== t.body);
28
+ return !1;
29
+ }, H = function(r) {
30
+ var e = r.scrollTop, t = r.scrollHeight, l = r.clientHeight;
31
+ return [
32
+ e,
33
+ t,
34
+ l
35
+ ];
36
+ }, p = function(r) {
37
+ var e = r.scrollLeft, t = r.scrollWidth, l = r.clientWidth;
38
+ return [
39
+ e,
40
+ t,
41
+ l
42
+ ];
43
+ }, g = function(r, e) {
44
+ return r === "v" ? D(e) : E(e);
45
+ }, m = function(r, e) {
46
+ return r === "v" ? H(e) : p(e);
47
+ }, B = function(r, e) {
48
+ return r === "h" && e === "rtl" ? -1 : 1;
49
+ }, V = function(r, e, t, l, f) {
50
+ var n = B(r, window.getComputedStyle(e).direction), i = n * l, o = t.target, d = e.contains(o), c = !1, s = i > 0, h = 0, S = 0;
51
+ do {
52
+ if (!o)
53
+ break;
54
+ var u = m(r, o), v = u[0], C = u[1], y = u[2], w = C - y - n * v;
55
+ (v || w) && g(r, o) && (h += w, S += v);
56
+ var a = o.parentNode;
57
+ o = a && a.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? a.host : a;
58
+ } while (
59
+ // portaled content
60
+ !d && o !== document.body || // self content
61
+ d && (e.contains(o) || e === o)
62
+ );
63
+ return (s && Math.abs(h) < 1 || !s && Math.abs(S) < 1) && (c = !0), c;
64
+ };
65
+ export {
66
+ V as handleScroll,
67
+ T as locationCouldBeScrolled
68
+ };
@@ -0,0 +1,5 @@
1
+ import { createSidecarMedium as e } from "../../../use-sidecar/dist/es2015/medium.js";
2
+ var a = e();
3
+ export {
4
+ a as effectCar
5
+ };
@@ -0,0 +1,7 @@
1
+ import { RemoveScrollSideCar as r } from "./SideEffect.js";
2
+ import { effectCar as o } from "./medium.js";
3
+ import { exportSidecar as e } from "../../../use-sidecar/dist/es2015/exports.js";
4
+ const f = e(o, r);
5
+ export {
6
+ f as default
7
+ };
@@ -0,0 +1,71 @@
1
+ import * as d from "react";
2
+ import { styleSingleton as f } from "../../../react-style-singleton/dist/es2015/component.js";
3
+ import { noScrollbarsClassName as p, zeroRightClassName as g, fullWidthClassName as l, removedBarSizeVariable as v } from "./constants.js";
4
+ import { getGapWidth as m } from "./utils.js";
5
+ var b = f(), e = "data-scroll-locked", h = function(n, a, o, t) {
6
+ var r = n.left, i = n.top, s = n.right, c = n.gap;
7
+ return o === void 0 && (o = "margin"), `
8
+ .`.concat(p, ` {
9
+ overflow: hidden `).concat(t, `;
10
+ padding-right: `).concat(c, "px ").concat(t, `;
11
+ }
12
+ body[`).concat(e, `] {
13
+ overflow: hidden `).concat(t, `;
14
+ overscroll-behavior: contain;
15
+ `).concat([
16
+ a && "position: relative ".concat(t, ";"),
17
+ o === "margin" && `
18
+ padding-left: `.concat(r, `px;
19
+ padding-top: `).concat(i, `px;
20
+ padding-right: `).concat(s, `px;
21
+ margin-left:0;
22
+ margin-top:0;
23
+ margin-right: `).concat(c, "px ").concat(t, `;
24
+ `),
25
+ o === "padding" && "padding-right: ".concat(c, "px ").concat(t, ";")
26
+ ].filter(Boolean).join(""), `
27
+ }
28
+
29
+ .`).concat(g, ` {
30
+ right: `).concat(c, "px ").concat(t, `;
31
+ }
32
+
33
+ .`).concat(l, ` {
34
+ margin-right: `).concat(c, "px ").concat(t, `;
35
+ }
36
+
37
+ .`).concat(g, " .").concat(g, ` {
38
+ right: 0 `).concat(t, `;
39
+ }
40
+
41
+ .`).concat(l, " .").concat(l, ` {
42
+ margin-right: 0 `).concat(t, `;
43
+ }
44
+
45
+ body[`).concat(e, `] {
46
+ `).concat(v, ": ").concat(c, `px;
47
+ }
48
+ `);
49
+ }, u = function() {
50
+ var n = parseInt(document.body.getAttribute(e) || "0", 10);
51
+ return isFinite(n) ? n : 0;
52
+ }, x = function() {
53
+ d.useEffect(function() {
54
+ return document.body.setAttribute(e, (u() + 1).toString()), function() {
55
+ var n = u() - 1;
56
+ n <= 0 ? document.body.removeAttribute(e) : document.body.setAttribute(e, n.toString());
57
+ };
58
+ }, []);
59
+ }, C = function(n) {
60
+ var a = n.noRelative, o = n.noImportant, t = n.gapMode, r = t === void 0 ? "margin" : t;
61
+ x();
62
+ var i = d.useMemo(function() {
63
+ return m(r);
64
+ }, [r]);
65
+ return d.createElement(b, { styles: h(i, !a, r, o ? "" : "!important") });
66
+ };
67
+ export {
68
+ C as RemoveScrollBar,
69
+ e as lockAttribute,
70
+ x as useLockAttribute
71
+ };
@@ -0,0 +1,7 @@
1
+ var r = "right-scroll-bar-position", a = "width-before-scroll-bar", l = "with-scroll-bars-hidden", e = "--removed-body-scroll-bar-size";
2
+ export {
3
+ a as fullWidthClassName,
4
+ l as noScrollbarsClassName,
5
+ e as removedBarSizeVariable,
6
+ r as zeroRightClassName
7
+ };
@@ -0,0 +1,25 @@
1
+ var a = {
2
+ left: 0,
3
+ top: 0,
4
+ right: 0,
5
+ gap: 0
6
+ }, e = function(t) {
7
+ return parseInt(t || "", 10) || 0;
8
+ }, o = function(t) {
9
+ var n = window.getComputedStyle(document.body), i = n[t === "padding" ? "paddingLeft" : "marginLeft"], r = n[t === "padding" ? "paddingTop" : "marginTop"], d = n[t === "padding" ? "paddingRight" : "marginRight"];
10
+ return [e(i), e(r), e(d)];
11
+ }, f = function(t) {
12
+ if (t === void 0 && (t = "margin"), typeof window > "u")
13
+ return a;
14
+ var n = o(t), i = document.documentElement.clientWidth, r = window.innerWidth;
15
+ return {
16
+ left: n[0],
17
+ top: n[1],
18
+ right: n[2],
19
+ gap: Math.max(0, r - i + n[2] - n[0])
20
+ };
21
+ };
22
+ export {
23
+ f as getGapWidth,
24
+ a as zeroGap
25
+ };
@@ -0,0 +1,11 @@
1
+ import { styleHookSingleton as o } from "./hook.js";
2
+ var s = function() {
3
+ var e = o(), n = function(t) {
4
+ var r = t.styles, l = t.dynamic;
5
+ return e(r, l), null;
6
+ };
7
+ return n;
8
+ };
9
+ export {
10
+ s as styleSingleton
11
+ };
@@ -0,0 +1,15 @@
1
+ import * as o from "react";
2
+ import { stylesheetSingleton as r } from "./singleton.js";
3
+ var i = function() {
4
+ var t = r();
5
+ return function(e, n) {
6
+ o.useEffect(function() {
7
+ return t.add(e), function() {
8
+ t.remove();
9
+ };
10
+ }, [e && n]);
11
+ };
12
+ };
13
+ export {
14
+ i as styleHookSingleton
15
+ };
@@ -0,0 +1,30 @@
1
+ import { getNonce as o } from "../../../get-nonce/dist/es2015/index.js";
2
+ function r() {
3
+ if (!document)
4
+ return null;
5
+ var t = document.createElement("style");
6
+ t.type = "text/css";
7
+ var e = o();
8
+ return e && t.setAttribute("nonce", e), t;
9
+ }
10
+ function l(t, e) {
11
+ t.styleSheet ? t.styleSheet.cssText = e : t.appendChild(document.createTextNode(e));
12
+ }
13
+ function a(t) {
14
+ var e = document.head || document.getElementsByTagName("head")[0];
15
+ e.appendChild(t);
16
+ }
17
+ var c = function() {
18
+ var t = 0, e = null;
19
+ return {
20
+ add: function(n) {
21
+ t == 0 && (e = r()) && (l(e, n), a(e)), t++;
22
+ },
23
+ remove: function() {
24
+ t--, !t && e && (e.parentNode && e.parentNode.removeChild(e), e = null);
25
+ }
26
+ };
27
+ };
28
+ export {
29
+ c as stylesheetSingleton
30
+ };
@@ -0,0 +1,27 @@
1
+ var p = function() {
2
+ return p = Object.assign || function(e) {
3
+ for (var n, r = 1, o = arguments.length; r < o; r++) {
4
+ n = arguments[r];
5
+ for (var a in n) Object.prototype.hasOwnProperty.call(n, a) && (e[a] = n[a]);
6
+ }
7
+ return e;
8
+ }, p.apply(this, arguments);
9
+ };
10
+ function c(t, e) {
11
+ var n = {};
12
+ for (var r in t) Object.prototype.hasOwnProperty.call(t, r) && e.indexOf(r) < 0 && (n[r] = t[r]);
13
+ if (t != null && typeof Object.getOwnPropertySymbols == "function")
14
+ for (var o = 0, r = Object.getOwnPropertySymbols(t); o < r.length; o++)
15
+ e.indexOf(r[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, r[o]) && (n[r[o]] = t[r[o]]);
16
+ return n;
17
+ }
18
+ function l(t, e, n) {
19
+ if (n || arguments.length === 2) for (var r = 0, o = e.length, a; r < o; r++)
20
+ (a || !(r in e)) && (a || (a = Array.prototype.slice.call(e, 0, r)), a[r] = e[r]);
21
+ return t.concat(a || Array.prototype.slice.call(e));
22
+ }
23
+ export {
24
+ p as __assign,
25
+ c as __rest,
26
+ l as __spreadArray
27
+ };
@@ -0,0 +1,6 @@
1
+ function i(n, t) {
2
+ return typeof n == "function" ? n(t) : n && (n.current = t), n;
3
+ }
4
+ export {
5
+ i as assignRef
6
+ };
@@ -0,0 +1,26 @@
1
+ import * as f from "react";
2
+ import { assignRef as o } from "./assignRef.js";
3
+ import { useCallbackRef as l } from "./useRef.js";
4
+ var s = typeof window < "u" ? f.useLayoutEffect : f.useEffect, c = /* @__PURE__ */ new WeakMap();
5
+ function v(e, m) {
6
+ var t = l(null, function(n) {
7
+ return e.forEach(function(u) {
8
+ return o(u, n);
9
+ });
10
+ });
11
+ return s(function() {
12
+ var n = c.get(t);
13
+ if (n) {
14
+ var u = new Set(n), r = new Set(e), i = t.current;
15
+ u.forEach(function(a) {
16
+ r.has(a) || o(a, null);
17
+ }), r.forEach(function(a) {
18
+ u.has(a) || o(a, i);
19
+ });
20
+ }
21
+ c.set(t, e);
22
+ }, [e]), t;
23
+ }
24
+ export {
25
+ v as useMergeRefs
26
+ };
@@ -0,0 +1,25 @@
1
+ import { useState as u } from "react";
2
+ function n(c, r) {
3
+ var e = u(function() {
4
+ return {
5
+ // value
6
+ value: c,
7
+ // last callback
8
+ callback: r,
9
+ // "memoized" public interface
10
+ facade: {
11
+ get current() {
12
+ return e.value;
13
+ },
14
+ set current(a) {
15
+ var t = e.value;
16
+ t !== a && (e.value = a, e.callback(a, t));
17
+ }
18
+ }
19
+ };
20
+ })[0];
21
+ return e.callback = r, e.facade;
22
+ }
23
+ export {
24
+ n as useCallbackRef
25
+ };
@@ -0,0 +1,18 @@
1
+ import { __rest as o, __assign as d } from "../../../tslib/tslib.es6.js";
2
+ import * as n from "react";
3
+ var i = function(r) {
4
+ var e = r.sideCar, a = o(r, ["sideCar"]);
5
+ if (!e)
6
+ throw new Error("Sidecar: please provide `sideCar` property to import the right car");
7
+ var t = e.read();
8
+ if (!t)
9
+ throw new Error("Sidecar medium not found");
10
+ return n.createElement(t, d({}, a));
11
+ };
12
+ i.isSideCarExport = !0;
13
+ function p(r, e) {
14
+ return r.useMedium(e), i;
15
+ }
16
+ export {
17
+ p as exportSidecar
18
+ };
@@ -0,0 +1,67 @@
1
+ import { __assign as d } from "../../../tslib/tslib.es6.js";
2
+ function l(r) {
3
+ return r;
4
+ }
5
+ function h(r, t) {
6
+ t === void 0 && (t = l);
7
+ var e = [], o = !1, c = {
8
+ read: function() {
9
+ if (o)
10
+ throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
11
+ return e.length ? e[e.length - 1] : r;
12
+ },
13
+ useMedium: function(u) {
14
+ var n = t(u, o);
15
+ return e.push(n), function() {
16
+ e = e.filter(function(i) {
17
+ return i !== n;
18
+ });
19
+ };
20
+ },
21
+ assignSyncMedium: function(u) {
22
+ for (o = !0; e.length; ) {
23
+ var n = e;
24
+ e = [], n.forEach(u);
25
+ }
26
+ e = {
27
+ push: function(i) {
28
+ return u(i);
29
+ },
30
+ filter: function() {
31
+ return e;
32
+ }
33
+ };
34
+ },
35
+ assignMedium: function(u) {
36
+ o = !0;
37
+ var n = [];
38
+ if (e.length) {
39
+ var i = e;
40
+ e = [], i.forEach(u), n = e;
41
+ }
42
+ var s = function() {
43
+ var f = n;
44
+ n = [], f.forEach(u);
45
+ }, a = function() {
46
+ return Promise.resolve().then(s);
47
+ };
48
+ a(), e = {
49
+ push: function(f) {
50
+ n.push(f), a();
51
+ },
52
+ filter: function(f) {
53
+ return n = n.filter(f), e;
54
+ }
55
+ };
56
+ }
57
+ };
58
+ return c;
59
+ }
60
+ function v(r) {
61
+ r === void 0 && (r = {});
62
+ var t = h(null);
63
+ return t.options = d({ async: !0, ssr: !1 }, r), t;
64
+ }
65
+ export {
66
+ v as createSidecarMedium
67
+ };