@adam-milo/ui 1.0.27 → 1.0.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 (160) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.js +3 -1
  3. package/dist/index10.cjs +1 -1
  4. package/dist/index10.js +1 -1
  5. package/dist/index11.cjs +1 -1
  6. package/dist/index11.js +1 -1
  7. package/dist/index12.cjs +1 -1
  8. package/dist/index12.js +1 -1
  9. package/dist/index13.cjs +1 -1
  10. package/dist/index13.js +1 -1
  11. package/dist/index14.cjs +1 -1
  12. package/dist/index14.js +1 -1
  13. package/dist/index15.cjs +1 -1
  14. package/dist/index15.js +2 -2
  15. package/dist/index16.cjs +1 -1
  16. package/dist/index16.js +1 -1
  17. package/dist/index17.cjs +1 -1
  18. package/dist/index17.js +1 -1
  19. package/dist/index18.cjs +1 -1
  20. package/dist/index18.js +1 -1
  21. package/dist/index19.cjs +1 -1
  22. package/dist/index19.js +43 -12
  23. package/dist/index2.cjs +1 -1
  24. package/dist/index2.js +1 -1
  25. package/dist/index20.cjs +1 -0
  26. package/dist/index20.js +14 -0
  27. package/dist/index22.cjs +1 -1
  28. package/dist/index22.js +20 -299
  29. package/dist/index23.cjs +1 -1
  30. package/dist/index23.js +298 -13
  31. package/dist/index24.cjs +1 -0
  32. package/dist/index24.js +16 -0
  33. package/dist/{index26.cjs → index27.cjs} +1 -1
  34. package/dist/{index26.js → index27.js} +21 -21
  35. package/dist/index3.cjs +1 -1
  36. package/dist/index3.js +2 -2
  37. package/dist/index4.cjs +1 -1
  38. package/dist/index4.js +1 -1
  39. package/dist/index40.cjs +1 -1
  40. package/dist/index40.js +18 -3
  41. package/dist/index41.cjs +1 -1
  42. package/dist/index41.js +3 -8
  43. package/dist/index42.cjs +1 -1
  44. package/dist/index42.js +7 -66
  45. package/dist/index43.cjs +1 -1
  46. package/dist/index43.js +66 -35
  47. package/dist/index44.cjs +1 -1
  48. package/dist/index44.js +31 -56
  49. package/dist/index45.cjs +1 -1
  50. package/dist/index45.js +60 -6
  51. package/dist/index46.cjs +1 -1
  52. package/dist/index46.js +6 -208
  53. package/dist/index47.cjs +1 -1
  54. package/dist/index47.js +203 -20
  55. package/dist/index48.cjs +1 -1
  56. package/dist/index48.js +23 -202
  57. package/dist/index49.cjs +1 -1
  58. package/dist/index49.js +204 -10
  59. package/dist/index5.cjs +1 -1
  60. package/dist/index5.js +1 -1
  61. package/dist/index50.cjs +1 -1
  62. package/dist/index50.js +10 -289
  63. package/dist/index51.cjs +1 -1
  64. package/dist/index51.js +288 -13
  65. package/dist/index52.cjs +1 -1
  66. package/dist/index52.js +14 -39
  67. package/dist/index53.cjs +1 -1
  68. package/dist/index53.js +36 -82
  69. package/dist/index54.cjs +1 -1
  70. package/dist/index54.js +84 -9
  71. package/dist/index55.cjs +1 -1
  72. package/dist/index55.js +8 -65
  73. package/dist/index56.cjs +1 -1
  74. package/dist/index56.js +68 -3
  75. package/dist/index57.cjs +1 -1
  76. package/dist/index57.js +3 -11
  77. package/dist/index58.cjs +1 -1
  78. package/dist/index58.js +11 -31
  79. package/dist/index59.cjs +1 -1
  80. package/dist/index59.js +30 -118
  81. package/dist/index6.cjs +1 -1
  82. package/dist/index6.js +2 -2
  83. package/dist/index60.cjs +1 -1
  84. package/dist/index60.js +120 -9
  85. package/dist/index61.cjs +1 -1
  86. package/dist/index61.js +8 -14
  87. package/dist/index63.cjs +1 -1
  88. package/dist/index63.js +14 -22
  89. package/dist/index64.cjs +1 -1
  90. package/dist/index64.js +291 -33
  91. package/dist/index65.cjs +1 -1
  92. package/dist/index65.js +22 -622
  93. package/dist/index66.cjs +1 -1
  94. package/dist/index66.js +35 -35
  95. package/dist/index67.cjs +1 -1
  96. package/dist/index67.js +620 -33
  97. package/dist/index68.cjs +1 -1
  98. package/dist/index68.js +37 -5
  99. package/dist/index69.cjs +1 -1
  100. package/dist/index69.js +36 -8
  101. package/dist/index7.cjs +1 -1
  102. package/dist/index7.js +1 -1
  103. package/dist/index70.cjs +1 -1
  104. package/dist/index70.js +5 -3
  105. package/dist/index71.cjs +1 -1
  106. package/dist/index71.js +8 -33
  107. package/dist/index72.cjs +1 -1
  108. package/dist/index72.js +3 -178
  109. package/dist/index73.cjs +1 -1
  110. package/dist/index73.js +31 -17
  111. package/dist/index74.cjs +1 -1
  112. package/dist/index74.js +165 -706
  113. package/dist/index75.cjs +1 -1
  114. package/dist/index75.js +16 -149
  115. package/dist/index76.cjs +1 -1
  116. package/dist/index76.js +697 -149
  117. package/dist/index77.cjs +1 -1
  118. package/dist/index77.js +146 -80
  119. package/dist/index78.cjs +1 -1
  120. package/dist/index78.js +170 -44
  121. package/dist/index79.cjs +1 -1
  122. package/dist/index79.js +85 -10
  123. package/dist/index8.cjs +1 -1
  124. package/dist/index8.js +1 -1
  125. package/dist/index80.cjs +1 -1
  126. package/dist/index80.js +44 -16
  127. package/dist/index81.cjs +1 -1
  128. package/dist/index81.js +10 -99
  129. package/dist/index82.cjs +1 -1
  130. package/dist/index82.js +15 -7
  131. package/dist/index83.cjs +1 -1
  132. package/dist/index83.js +99 -26
  133. package/dist/index84.cjs +1 -1
  134. package/dist/index84.js +8 -34
  135. package/dist/index85.cjs +1 -1
  136. package/dist/index85.js +27 -14
  137. package/dist/index86.cjs +1 -1
  138. package/dist/index86.js +30 -41
  139. package/dist/index87.cjs +1 -1
  140. package/dist/index87.js +13 -6
  141. package/dist/index88.cjs +1 -0
  142. package/dist/index88.js +48 -0
  143. package/dist/index89.cjs +1 -0
  144. package/dist/index89.js +9 -0
  145. package/dist/index9.cjs +1 -1
  146. package/dist/index9.js +2 -2
  147. package/dist/src/components/typography/text/Text.component.d.ts +93 -0
  148. package/dist/src/components/typography/text/Text.component.d.ts.map +1 -0
  149. package/dist/src/index.d.ts +2 -0
  150. package/dist/src/index.d.ts.map +1 -1
  151. package/dist/style.css +1 -1
  152. package/package.json +1 -1
  153. package/dist/index21.cjs +0 -1
  154. package/dist/index21.js +0 -22
  155. package/dist/index38.cjs +0 -1
  156. package/dist/index38.js +0 -21
  157. package/dist/index62.cjs +0 -1
  158. package/dist/index62.js +0 -297
  159. /package/dist/{index34.cjs → index35.cjs} +0 -0
  160. /package/dist/{index34.js → index35.js} +0 -0
package/dist/index77.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index66.cjs");function r(n){return n}exports.createSidecarMedium=function(e){void 0===e&&(e={});var t=function(n,e){void 0===e&&(e=r);var t=[],u=!1;return{read:function(){if(u)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return t.length?t[t.length-1]:n},useMedium:function(n){var r=e(n,u);return t.push(r),function(){t=t.filter(function(n){return n!==r})}},assignSyncMedium:function(n){for(u=!0;t.length;){var r=t;t=[],r.forEach(n)}t={push:function(r){return n(r)},filter:function(){return t}}},assignMedium:function(n){u=!0;var r=[];if(t.length){var e=t;t=[],e.forEach(n),r=t}var i=function(){var e=r;r=[],e.forEach(n)},o=function(){return Promise.resolve().then(i)};o(),t={push:function(n){r.push(n),o()},filter:function(n){return r=r.filter(n),t}}}}}(null);return t.options=n.__assign({async:!0,ssr:!1},e),t};
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=Math.min,e=Math.max,o=Math.round,n=Math.floor,r={left:"right",right:"left",bottom:"top",top:"bottom"},i={start:"end",end:"start"};function s(t){return t.split("-")[0]}function p(t){return t.split("-")[1]}function c(t){return"x"===t?"y":"x"}function u(t){return"y"===t?"height":"width"}const x=new Set(["top","bottom"]);function a(t){return x.has(s(t))?"y":"x"}function g(t){return c(a(t))}function f(t){return t.replace(/start|end/g,t=>i[t])}const l=["left","right"],m=["right","left"],h=["top","bottom"],d=["bottom","top"];function b(t){return t.replace(/left|right|bottom|top/g,t=>r[t])}function y(t){return{top:0,right:0,bottom:0,left:0,...t}}exports.clamp=function(o,n,r){return e(o,t(n,r))},exports.createCoords=t=>({x:t,y:t}),exports.evaluate=function(t,e){return"function"==typeof t?t(e):t},exports.expandPaddingObject=y,exports.floor=n,exports.getAlignment=p,exports.getAlignmentAxis=g,exports.getAlignmentSides=function(t,e,o){void 0===o&&(o=!1);const n=p(t),r=g(t),i=u(r);let s="x"===r?n===(o?"end":"start")?"right":"left":"start"===n?"bottom":"top";return e.reference[i]>e.floating[i]&&(s=b(s)),[s,b(s)]},exports.getAxisLength=u,exports.getExpandedPlacements=function(t){const e=b(t);return[f(t),e,f(e)]},exports.getOppositeAlignmentPlacement=f,exports.getOppositeAxis=c,exports.getOppositeAxisPlacements=function(t,e,o,n){const r=p(t);let i=function(t,e,o){switch(t){case"top":case"bottom":return o?e?m:l:e?l:m;case"left":case"right":return e?h:d;default:return[]}}(s(t),"start"===o,n);return r&&(i=i.map(t=>t+"-"+r),e&&(i=i.concat(i.map(f)))),i},exports.getOppositePlacement=b,exports.getPaddingObject=function(t){return"number"!=typeof t?y(t):{top:t,right:t,bottom:t,left:t}},exports.getSide=s,exports.getSideAxis=a,exports.max=e,exports.min=t,exports.rectToClientRect=function(t){const{x:e,y:o,width:n,height:r}=t;return{width:n,height:r,top:o,left:e,right:e+n,bottom:o+r,x:e,y:o}},exports.round=o,exports.sides=["top","right","bottom","left"];
package/dist/index77.js CHANGED
@@ -1,88 +1,154 @@
1
- import { __assign } from "./index66.js";
2
- function ItoI(a) {
3
- return a;
1
+ const sides = ["top", "right", "bottom", "left"];
2
+ const min = Math.min;
3
+ const max = Math.max;
4
+ const round = Math.round;
5
+ const floor = Math.floor;
6
+ const createCoords = (v) => ({
7
+ x: v,
8
+ y: v
9
+ });
10
+ const oppositeSideMap = {
11
+ left: "right",
12
+ right: "left",
13
+ bottom: "top",
14
+ top: "bottom"
15
+ };
16
+ const oppositeAlignmentMap = {
17
+ start: "end",
18
+ end: "start"
19
+ };
20
+ function clamp(start, value, end) {
21
+ return max(start, min(value, end));
22
+ }
23
+ function evaluate(value, param) {
24
+ return typeof value === "function" ? value(param) : value;
25
+ }
26
+ function getSide(placement) {
27
+ return placement.split("-")[0];
28
+ }
29
+ function getAlignment(placement) {
30
+ return placement.split("-")[1];
31
+ }
32
+ function getOppositeAxis(axis) {
33
+ return axis === "x" ? "y" : "x";
34
+ }
35
+ function getAxisLength(axis) {
36
+ return axis === "y" ? "height" : "width";
37
+ }
38
+ const yAxisSides = /* @__PURE__ */ new Set(["top", "bottom"]);
39
+ function getSideAxis(placement) {
40
+ return yAxisSides.has(getSide(placement)) ? "y" : "x";
41
+ }
42
+ function getAlignmentAxis(placement) {
43
+ return getOppositeAxis(getSideAxis(placement));
44
+ }
45
+ function getAlignmentSides(placement, rects, rtl) {
46
+ if (rtl === void 0) {
47
+ rtl = false;
48
+ }
49
+ const alignment = getAlignment(placement);
50
+ const alignmentAxis = getAlignmentAxis(placement);
51
+ const length = getAxisLength(alignmentAxis);
52
+ let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top";
53
+ if (rects.reference[length] > rects.floating[length]) {
54
+ mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
55
+ }
56
+ return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
57
+ }
58
+ function getExpandedPlacements(placement) {
59
+ const oppositePlacement = getOppositePlacement(placement);
60
+ return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
61
+ }
62
+ function getOppositeAlignmentPlacement(placement) {
63
+ return placement.replace(/start|end/g, (alignment) => oppositeAlignmentMap[alignment]);
4
64
  }
5
- function innerCreateMedium(defaults, middleware) {
6
- if (middleware === void 0) {
7
- middleware = ItoI;
65
+ const lrPlacement = ["left", "right"];
66
+ const rlPlacement = ["right", "left"];
67
+ const tbPlacement = ["top", "bottom"];
68
+ const btPlacement = ["bottom", "top"];
69
+ function getSideList(side, isStart, rtl) {
70
+ switch (side) {
71
+ case "top":
72
+ case "bottom":
73
+ if (rtl) return isStart ? rlPlacement : lrPlacement;
74
+ return isStart ? lrPlacement : rlPlacement;
75
+ case "left":
76
+ case "right":
77
+ return isStart ? tbPlacement : btPlacement;
78
+ default:
79
+ return [];
8
80
  }
9
- var buffer = [];
10
- var assigned = false;
11
- var medium = {
12
- read: function() {
13
- if (assigned) {
14
- throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
15
- }
16
- if (buffer.length) {
17
- return buffer[buffer.length - 1];
18
- }
19
- return defaults;
20
- },
21
- useMedium: function(data) {
22
- var item = middleware(data, assigned);
23
- buffer.push(item);
24
- return function() {
25
- buffer = buffer.filter(function(x) {
26
- return x !== item;
27
- });
28
- };
29
- },
30
- assignSyncMedium: function(cb) {
31
- assigned = true;
32
- while (buffer.length) {
33
- var cbs = buffer;
34
- buffer = [];
35
- cbs.forEach(cb);
36
- }
37
- buffer = {
38
- push: function(x) {
39
- return cb(x);
40
- },
41
- filter: function() {
42
- return buffer;
43
- }
44
- };
45
- },
46
- assignMedium: function(cb) {
47
- assigned = true;
48
- var pendingQueue = [];
49
- if (buffer.length) {
50
- var cbs = buffer;
51
- buffer = [];
52
- cbs.forEach(cb);
53
- pendingQueue = buffer;
54
- }
55
- var executeQueue = function() {
56
- var cbs2 = pendingQueue;
57
- pendingQueue = [];
58
- cbs2.forEach(cb);
59
- };
60
- var cycle = function() {
61
- return Promise.resolve().then(executeQueue);
62
- };
63
- cycle();
64
- buffer = {
65
- push: function(x) {
66
- pendingQueue.push(x);
67
- cycle();
68
- },
69
- filter: function(filter) {
70
- pendingQueue = pendingQueue.filter(filter);
71
- return buffer;
72
- }
73
- };
81
+ }
82
+ function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
83
+ const alignment = getAlignment(placement);
84
+ let list = getSideList(getSide(placement), direction === "start", rtl);
85
+ if (alignment) {
86
+ list = list.map((side) => side + "-" + alignment);
87
+ if (flipAlignment) {
88
+ list = list.concat(list.map(getOppositeAlignmentPlacement));
74
89
  }
90
+ }
91
+ return list;
92
+ }
93
+ function getOppositePlacement(placement) {
94
+ return placement.replace(/left|right|bottom|top/g, (side) => oppositeSideMap[side]);
95
+ }
96
+ function expandPaddingObject(padding) {
97
+ return {
98
+ top: 0,
99
+ right: 0,
100
+ bottom: 0,
101
+ left: 0,
102
+ ...padding
75
103
  };
76
- return medium;
77
104
  }
78
- function createSidecarMedium(options) {
79
- if (options === void 0) {
80
- options = {};
81
- }
82
- var medium = innerCreateMedium(null);
83
- medium.options = __assign({ async: true, ssr: false }, options);
84
- return medium;
105
+ function getPaddingObject(padding) {
106
+ return typeof padding !== "number" ? expandPaddingObject(padding) : {
107
+ top: padding,
108
+ right: padding,
109
+ bottom: padding,
110
+ left: padding
111
+ };
112
+ }
113
+ function rectToClientRect(rect) {
114
+ const {
115
+ x,
116
+ y,
117
+ width,
118
+ height
119
+ } = rect;
120
+ return {
121
+ width,
122
+ height,
123
+ top: y,
124
+ left: x,
125
+ right: x + width,
126
+ bottom: y + height,
127
+ x,
128
+ y
129
+ };
85
130
  }
86
131
  export {
87
- createSidecarMedium
132
+ clamp,
133
+ createCoords,
134
+ evaluate,
135
+ expandPaddingObject,
136
+ floor,
137
+ getAlignment,
138
+ getAlignmentAxis,
139
+ getAlignmentSides,
140
+ getAxisLength,
141
+ getExpandedPlacements,
142
+ getOppositeAlignmentPlacement,
143
+ getOppositeAxis,
144
+ getOppositeAxisPlacements,
145
+ getOppositePlacement,
146
+ getPaddingObject,
147
+ getSide,
148
+ getSideAxis,
149
+ max,
150
+ min,
151
+ rectToClientRect,
152
+ round,
153
+ sides
88
154
  };
package/dist/index78.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),n=require("./index79.cjs"),e=require("./index69.cjs"),o=require("./index84.cjs");function c(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const e in t)if("default"!==e){const o=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,o.get?o:{enumerable:!0,get:()=>t[e]})}return n.default=t,Object.freeze(n)}const r=c(t);var a=n.styleSingleton(),i="data-scroll-locked",l=function(t,n,o,c){var r=t.left,a=t.top,l=t.right,d=t.gap;return void 0===o&&(o="margin"),"\n .".concat(e.noScrollbarsClassName," {\n overflow: hidden ").concat(c,";\n padding-right: ").concat(d,"px ").concat(c,";\n }\n body[").concat(i,"] {\n overflow: hidden ").concat(c,";\n overscroll-behavior: contain;\n ").concat([n&&"position: relative ".concat(c,";"),"margin"===o&&"\n padding-left: ".concat(r,"px;\n padding-top: ").concat(a,"px;\n padding-right: ").concat(l,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(d,"px ").concat(c,";\n "),"padding"===o&&"padding-right: ".concat(d,"px ").concat(c,";")].filter(Boolean).join(""),"\n }\n \n .").concat(e.zeroRightClassName," {\n right: ").concat(d,"px ").concat(c,";\n }\n \n .").concat(e.fullWidthClassName," {\n margin-right: ").concat(d,"px ").concat(c,";\n }\n \n .").concat(e.zeroRightClassName," .").concat(e.zeroRightClassName," {\n right: 0 ").concat(c,";\n }\n \n .").concat(e.fullWidthClassName," .").concat(e.fullWidthClassName," {\n margin-right: 0 ").concat(c,";\n }\n \n body[").concat(i,"] {\n ").concat(e.removedBarSizeVariable,": ").concat(d,"px;\n }\n")},d=function(){var t=parseInt(document.body.getAttribute(i)||"0",10);return isFinite(t)?t:0},s=function(){r.useEffect(function(){return document.body.setAttribute(i,(d()+1).toString()),function(){var t=d()-1;t<=0?document.body.removeAttribute(i):document.body.setAttribute(i,t.toString())}},[])};exports.RemoveScrollBar=function(t){var n=t.noRelative,e=t.noImportant,c=t.gapMode,i=void 0===c?"margin":c;s();var d=r.useMemo(function(){return o.getGapWidth(i)},[i]);return r.createElement(a,{styles:l(d,!n,i,e?"":"!important")})},exports.lockAttribute=i,exports.useLockAttribute=s;
1
+ "use strict";function e(){return"undefined"!=typeof window}function t(e){return r(e)?(e.nodeName||"").toLowerCase():"#document"}function n(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function o(e){var t;return null==(t=(r(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function r(t){return!!e()&&(t instanceof Node||t instanceof n(t).Node)}function s(t){return!!e()&&(t instanceof Element||t instanceof n(t).Element)}function c(t){return!!e()&&(t instanceof HTMLElement||t instanceof n(t).HTMLElement)}function i(t){return!(!e()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof n(t).ShadowRoot)}Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=new Set(["inline","contents"]);function u(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=g(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!l.has(r)}const a=new Set(["table","td","th"]);const f=[":popover-open",":modal"];function p(e){return f.some(t=>{try{return e.matches(t)}catch(n){return!1}})}const d=["transform","translate","scale","rotate","perspective"],m=["transform","translate","scale","rotate","perspective","filter"],w=["paint","layout","strict","content"];function v(e){const t=x(),n=s(e)?g(e):e;return d.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||m.some(e=>(n.willChange||"").includes(e))||w.some(e=>(n.contain||"").includes(e))}function x(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const y=new Set(["html","body","#document"]);function S(e){return y.has(t(e))}function g(e){return n(e).getComputedStyle(e)}function h(e){if("html"===t(e))return e;const n=e.assignedSlot||e.parentNode||i(e)&&e.host||o(e);return i(n)?n.host:n}function b(e){const t=h(e);return S(t)?e.ownerDocument?e.ownerDocument.body:e.body:c(t)&&u(t)?t:b(t)}function E(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}exports.getComputedStyle=g,exports.getContainingBlock=function(e){let t=h(e);for(;c(t)&&!S(t);){if(v(t))return t;if(p(t))return null;t=h(t)}return null},exports.getDocumentElement=o,exports.getFrameElement=E,exports.getNearestOverflowAncestor=b,exports.getNodeName=t,exports.getNodeScroll=function(e){return s(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}},exports.getOverflowAncestors=function e(t,o,r){var s;void 0===o&&(o=[]),void 0===r&&(r=!0);const c=b(t),i=c===(null==(s=t.ownerDocument)?void 0:s.body),l=n(c);if(i){const t=E(l);return o.concat(l,l.visualViewport||[],u(c)?c:[],t&&r?e(t):[])}return o.concat(c,e(c,[],r))},exports.getParentNode=h,exports.getWindow=n,exports.isContainingBlock=v,exports.isElement=s,exports.isHTMLElement=c,exports.isLastTraversableNode=S,exports.isNode=r,exports.isOverflowElement=u,exports.isShadowRoot=i,exports.isTableElement=function(e){return a.has(t(e))},exports.isTopLayer=p,exports.isWebKit=x;
package/dist/index78.js CHANGED
@@ -1,47 +1,173 @@
1
- import * as React from "react";
2
- import { styleSingleton } from "./index79.js";
3
- import { noScrollbarsClassName, zeroRightClassName, fullWidthClassName, removedBarSizeVariable } from "./index69.js";
4
- import { getGapWidth } from "./index84.js";
5
- var Style = styleSingleton();
6
- var lockAttribute = "data-scroll-locked";
7
- var getStyles = function(_a, allowRelative, gapMode, important) {
8
- var left = _a.left, top = _a.top, right = _a.right, gap = _a.gap;
9
- if (gapMode === void 0) {
10
- gapMode = "margin";
11
- }
12
- return "\n .".concat(noScrollbarsClassName, " {\n overflow: hidden ").concat(important, ";\n padding-right: ").concat(gap, "px ").concat(important, ";\n }\n body[").concat(lockAttribute, "] {\n overflow: hidden ").concat(important, ";\n overscroll-behavior: contain;\n ").concat([
13
- allowRelative && "position: relative ".concat(important, ";"),
14
- gapMode === "margin" && "\n padding-left: ".concat(left, "px;\n padding-top: ").concat(top, "px;\n padding-right: ").concat(right, "px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(gap, "px ").concat(important, ";\n "),
15
- gapMode === "padding" && "padding-right: ".concat(gap, "px ").concat(important, ";")
16
- ].filter(Boolean).join(""), "\n }\n \n .").concat(zeroRightClassName, " {\n right: ").concat(gap, "px ").concat(important, ";\n }\n \n .").concat(fullWidthClassName, " {\n margin-right: ").concat(gap, "px ").concat(important, ";\n }\n \n .").concat(zeroRightClassName, " .").concat(zeroRightClassName, " {\n right: 0 ").concat(important, ";\n }\n \n .").concat(fullWidthClassName, " .").concat(fullWidthClassName, " {\n margin-right: 0 ").concat(important, ";\n }\n \n body[").concat(lockAttribute, "] {\n ").concat(removedBarSizeVariable, ": ").concat(gap, "px;\n }\n");
17
- };
18
- var getCurrentUseCounter = function() {
19
- var counter = parseInt(document.body.getAttribute(lockAttribute) || "0", 10);
20
- return isFinite(counter) ? counter : 0;
21
- };
22
- var useLockAttribute = function() {
23
- React.useEffect(function() {
24
- document.body.setAttribute(lockAttribute, (getCurrentUseCounter() + 1).toString());
25
- return function() {
26
- var newCounter = getCurrentUseCounter() - 1;
27
- if (newCounter <= 0) {
28
- document.body.removeAttribute(lockAttribute);
29
- } else {
30
- document.body.setAttribute(lockAttribute, newCounter.toString());
31
- }
1
+ function hasWindow() {
2
+ return typeof window !== "undefined";
3
+ }
4
+ function getNodeName(node) {
5
+ if (isNode(node)) {
6
+ return (node.nodeName || "").toLowerCase();
7
+ }
8
+ return "#document";
9
+ }
10
+ function getWindow(node) {
11
+ var _node$ownerDocument;
12
+ return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
13
+ }
14
+ function getDocumentElement(node) {
15
+ var _ref;
16
+ return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
17
+ }
18
+ function isNode(value) {
19
+ if (!hasWindow()) {
20
+ return false;
21
+ }
22
+ return value instanceof Node || value instanceof getWindow(value).Node;
23
+ }
24
+ function isElement(value) {
25
+ if (!hasWindow()) {
26
+ return false;
27
+ }
28
+ return value instanceof Element || value instanceof getWindow(value).Element;
29
+ }
30
+ function isHTMLElement(value) {
31
+ if (!hasWindow()) {
32
+ return false;
33
+ }
34
+ return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
35
+ }
36
+ function isShadowRoot(value) {
37
+ if (!hasWindow() || typeof ShadowRoot === "undefined") {
38
+ return false;
39
+ }
40
+ return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
41
+ }
42
+ const invalidOverflowDisplayValues = /* @__PURE__ */ new Set(["inline", "contents"]);
43
+ function isOverflowElement(element) {
44
+ const {
45
+ overflow,
46
+ overflowX,
47
+ overflowY,
48
+ display
49
+ } = getComputedStyle(element);
50
+ return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !invalidOverflowDisplayValues.has(display);
51
+ }
52
+ const tableElements = /* @__PURE__ */ new Set(["table", "td", "th"]);
53
+ function isTableElement(element) {
54
+ return tableElements.has(getNodeName(element));
55
+ }
56
+ const topLayerSelectors = [":popover-open", ":modal"];
57
+ function isTopLayer(element) {
58
+ return topLayerSelectors.some((selector) => {
59
+ try {
60
+ return element.matches(selector);
61
+ } catch (_e) {
62
+ return false;
63
+ }
64
+ });
65
+ }
66
+ const transformProperties = ["transform", "translate", "scale", "rotate", "perspective"];
67
+ const willChangeValues = ["transform", "translate", "scale", "rotate", "perspective", "filter"];
68
+ const containValues = ["paint", "layout", "strict", "content"];
69
+ function isContainingBlock(elementOrCss) {
70
+ const webkit = isWebKit();
71
+ const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;
72
+ return transformProperties.some((value) => css[value] ? css[value] !== "none" : false) || (css.containerType ? css.containerType !== "normal" : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== "none" : false) || !webkit && (css.filter ? css.filter !== "none" : false) || willChangeValues.some((value) => (css.willChange || "").includes(value)) || containValues.some((value) => (css.contain || "").includes(value));
73
+ }
74
+ function getContainingBlock(element) {
75
+ let currentNode = getParentNode(element);
76
+ while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
77
+ if (isContainingBlock(currentNode)) {
78
+ return currentNode;
79
+ } else if (isTopLayer(currentNode)) {
80
+ return null;
81
+ }
82
+ currentNode = getParentNode(currentNode);
83
+ }
84
+ return null;
85
+ }
86
+ function isWebKit() {
87
+ if (typeof CSS === "undefined" || !CSS.supports) return false;
88
+ return CSS.supports("-webkit-backdrop-filter", "none");
89
+ }
90
+ const lastTraversableNodeNames = /* @__PURE__ */ new Set(["html", "body", "#document"]);
91
+ function isLastTraversableNode(node) {
92
+ return lastTraversableNodeNames.has(getNodeName(node));
93
+ }
94
+ function getComputedStyle(element) {
95
+ return getWindow(element).getComputedStyle(element);
96
+ }
97
+ function getNodeScroll(element) {
98
+ if (isElement(element)) {
99
+ return {
100
+ scrollLeft: element.scrollLeft,
101
+ scrollTop: element.scrollTop
32
102
  };
33
- }, []);
34
- };
35
- var RemoveScrollBar = function(_a) {
36
- var noRelative = _a.noRelative, noImportant = _a.noImportant, _b = _a.gapMode, gapMode = _b === void 0 ? "margin" : _b;
37
- useLockAttribute();
38
- var gap = React.useMemo(function() {
39
- return getGapWidth(gapMode);
40
- }, [gapMode]);
41
- return React.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? "!important" : "") });
42
- };
103
+ }
104
+ return {
105
+ scrollLeft: element.scrollX,
106
+ scrollTop: element.scrollY
107
+ };
108
+ }
109
+ function getParentNode(node) {
110
+ if (getNodeName(node) === "html") {
111
+ return node;
112
+ }
113
+ const result = (
114
+ // Step into the shadow DOM of the parent of a slotted node.
115
+ node.assignedSlot || // DOM Element detected.
116
+ node.parentNode || // ShadowRoot detected.
117
+ isShadowRoot(node) && node.host || // Fallback.
118
+ getDocumentElement(node)
119
+ );
120
+ return isShadowRoot(result) ? result.host : result;
121
+ }
122
+ function getNearestOverflowAncestor(node) {
123
+ const parentNode = getParentNode(node);
124
+ if (isLastTraversableNode(parentNode)) {
125
+ return node.ownerDocument ? node.ownerDocument.body : node.body;
126
+ }
127
+ if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
128
+ return parentNode;
129
+ }
130
+ return getNearestOverflowAncestor(parentNode);
131
+ }
132
+ function getOverflowAncestors(node, list, traverseIframes) {
133
+ var _node$ownerDocument2;
134
+ if (list === void 0) {
135
+ list = [];
136
+ }
137
+ if (traverseIframes === void 0) {
138
+ traverseIframes = true;
139
+ }
140
+ const scrollableAncestor = getNearestOverflowAncestor(node);
141
+ const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
142
+ const win = getWindow(scrollableAncestor);
143
+ if (isBody) {
144
+ const frameElement = getFrameElement(win);
145
+ return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
146
+ }
147
+ return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
148
+ }
149
+ function getFrameElement(win) {
150
+ return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
151
+ }
43
152
  export {
44
- RemoveScrollBar,
45
- lockAttribute,
46
- useLockAttribute
153
+ getComputedStyle,
154
+ getContainingBlock,
155
+ getDocumentElement,
156
+ getFrameElement,
157
+ getNearestOverflowAncestor,
158
+ getNodeName,
159
+ getNodeScroll,
160
+ getOverflowAncestors,
161
+ getParentNode,
162
+ getWindow,
163
+ isContainingBlock,
164
+ isElement,
165
+ isHTMLElement,
166
+ isLastTraversableNode,
167
+ isNode,
168
+ isOverflowElement,
169
+ isShadowRoot,
170
+ isTableElement,
171
+ isTopLayer,
172
+ isWebKit
47
173
  };
package/dist/index79.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index85.cjs");exports.styleSingleton=function(){var t=e.styleHookSingleton();return function(e){var n=e.styles,r=e.dynamic;return t(n,r),null}};
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index68.cjs");function r(n){return n}exports.createSidecarMedium=function(e){void 0===e&&(e={});var t=function(n,e){void 0===e&&(e=r);var t=[],u=!1;return{read:function(){if(u)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return t.length?t[t.length-1]:n},useMedium:function(n){var r=e(n,u);return t.push(r),function(){t=t.filter(function(n){return n!==r})}},assignSyncMedium:function(n){for(u=!0;t.length;){var r=t;t=[],r.forEach(n)}t={push:function(r){return n(r)},filter:function(){return t}}},assignMedium:function(n){u=!0;var r=[];if(t.length){var e=t;t=[],e.forEach(n),r=t}var i=function(){var e=r;r=[],e.forEach(n)},o=function(){return Promise.resolve().then(i)};o(),t={push:function(n){r.push(n),o()},filter:function(n){return r=r.filter(n),t}}}}}(null);return t.options=n.__assign({async:!0,ssr:!1},e),t};
package/dist/index79.js CHANGED
@@ -1,13 +1,88 @@
1
- import { styleHookSingleton } from "./index85.js";
2
- var styleSingleton = function() {
3
- var useStyle = styleHookSingleton();
4
- var Sheet = function(_a) {
5
- var styles = _a.styles, dynamic = _a.dynamic;
6
- useStyle(styles, dynamic);
7
- return null;
1
+ import { __assign } from "./index68.js";
2
+ function ItoI(a) {
3
+ return a;
4
+ }
5
+ function innerCreateMedium(defaults, middleware) {
6
+ if (middleware === void 0) {
7
+ middleware = ItoI;
8
+ }
9
+ var buffer = [];
10
+ var assigned = false;
11
+ var medium = {
12
+ read: function() {
13
+ if (assigned) {
14
+ throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
15
+ }
16
+ if (buffer.length) {
17
+ return buffer[buffer.length - 1];
18
+ }
19
+ return defaults;
20
+ },
21
+ useMedium: function(data) {
22
+ var item = middleware(data, assigned);
23
+ buffer.push(item);
24
+ return function() {
25
+ buffer = buffer.filter(function(x) {
26
+ return x !== item;
27
+ });
28
+ };
29
+ },
30
+ assignSyncMedium: function(cb) {
31
+ assigned = true;
32
+ while (buffer.length) {
33
+ var cbs = buffer;
34
+ buffer = [];
35
+ cbs.forEach(cb);
36
+ }
37
+ buffer = {
38
+ push: function(x) {
39
+ return cb(x);
40
+ },
41
+ filter: function() {
42
+ return buffer;
43
+ }
44
+ };
45
+ },
46
+ assignMedium: function(cb) {
47
+ assigned = true;
48
+ var pendingQueue = [];
49
+ if (buffer.length) {
50
+ var cbs = buffer;
51
+ buffer = [];
52
+ cbs.forEach(cb);
53
+ pendingQueue = buffer;
54
+ }
55
+ var executeQueue = function() {
56
+ var cbs2 = pendingQueue;
57
+ pendingQueue = [];
58
+ cbs2.forEach(cb);
59
+ };
60
+ var cycle = function() {
61
+ return Promise.resolve().then(executeQueue);
62
+ };
63
+ cycle();
64
+ buffer = {
65
+ push: function(x) {
66
+ pendingQueue.push(x);
67
+ cycle();
68
+ },
69
+ filter: function(filter) {
70
+ pendingQueue = pendingQueue.filter(filter);
71
+ return buffer;
72
+ }
73
+ };
74
+ }
8
75
  };
9
- return Sheet;
10
- };
76
+ return medium;
77
+ }
78
+ function createSidecarMedium(options) {
79
+ if (options === void 0) {
80
+ options = {};
81
+ }
82
+ var medium = innerCreateMedium(null);
83
+ medium.options = __assign({ async: true, ssr: false }, options);
84
+ return medium;
85
+ }
11
86
  export {
12
- styleSingleton
87
+ createSidecarMedium
13
88
  };
package/dist/index8.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),a=require("./index19.cjs");;/* empty css */const d=r.forwardRef(({label:d,error:i,helperText:t,className:s,id:l,required:c,disabled:o,checked:n,"data-cy":p,"data-testid":u,...b},h)=>{const x=r.useId(),y=l||x,_=`${y}-error`,m=`${y}-helper`,$=p||"radio",j=u||"radio",N=r.useRef(null),f=r.useCallback(e=>{N.current=e,h&&("function"==typeof h?h(e):"current"in h&&(h.current=e))},[h]),q=d&&c&&!d.includes("*")?`${d} *`:d;return e.jsxs("div",{className:a.cn("radio-wrapper",o&&"radio-wrapper--disabled"),"data-cy":`${$}-wrapper`,"data-testid":`${j}-wrapper`,children:[e.jsxs("div",{className:"radio__container",children:[e.jsx("input",{ref:f,id:y,type:"radio",checked:n,className:a.cn("radio__input",i&&"radio__input--error",s),"aria-describedby":i?_:t?m:void 0,"data-cy":$,"data-testid":j,disabled:o,required:c,...b}),d&&e.jsx("label",{htmlFor:y,className:"radio__label","data-cy":`${$}-label`,"data-testid":`${j}-label`,children:q})]}),i&&e.jsx("span",{id:_,className:"radio__error",role:"alert","data-cy":`${$}-error`,"data-testid":`${j}-error`,children:i}),t&&!i&&e.jsx("span",{id:m,className:"radio__helper","data-cy":`${$}-helper`,"data-testid":`${j}-helper`,children:t})]})});d.displayName="Radio",exports.Radio=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),a=require("./index20.cjs");;/* empty css */const d=r.forwardRef(({label:d,error:i,helperText:t,className:s,id:l,required:c,disabled:o,checked:n,"data-cy":p,"data-testid":u,...b},h)=>{const x=r.useId(),y=l||x,_=`${y}-error`,m=`${y}-helper`,$=p||"radio",j=u||"radio",N=r.useRef(null),f=r.useCallback(e=>{N.current=e,h&&("function"==typeof h?h(e):"current"in h&&(h.current=e))},[h]),q=d&&c&&!d.includes("*")?`${d} *`:d;return e.jsxs("div",{className:a.cn("radio-wrapper",o&&"radio-wrapper--disabled"),"data-cy":`${$}-wrapper`,"data-testid":`${j}-wrapper`,children:[e.jsxs("div",{className:"radio__container",children:[e.jsx("input",{ref:f,id:y,type:"radio",checked:n,className:a.cn("radio__input",i&&"radio__input--error",s),"aria-describedby":i?_:t?m:void 0,"data-cy":$,"data-testid":j,disabled:o,required:c,...b}),d&&e.jsx("label",{htmlFor:y,className:"radio__label","data-cy":`${$}-label`,"data-testid":`${j}-label`,children:q})]}),i&&e.jsx("span",{id:_,className:"radio__error",role:"alert","data-cy":`${$}-error`,"data-testid":`${j}-error`,children:i}),t&&!i&&e.jsx("span",{id:m,className:"radio__helper","data-cy":`${$}-helper`,"data-testid":`${j}-helper`,children:t})]})});d.displayName="Radio",exports.Radio=d;
package/dist/index8.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { forwardRef, useId, useRef, useCallback } from "react";
3
- import { cn } from "./index19.js";
3
+ import { cn } from "./index20.js";
4
4
  /* empty css */
5
5
  const Radio = forwardRef(
6
6
  ({
package/dist/index80.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e=!1;if("undefined"!=typeof window)try{var t=Object.defineProperty({},"passive",{get:function(){return e=!0,!0}});window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(r){e=!1}var n=!!e&&{passive:!1};exports.nonPassive=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),n=require("./index81.cjs"),e=require("./index71.cjs"),o=require("./index86.cjs");function c(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const e in t)if("default"!==e){const o=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,o.get?o:{enumerable:!0,get:()=>t[e]})}return n.default=t,Object.freeze(n)}const r=c(t);var a=n.styleSingleton(),i="data-scroll-locked",l=function(t,n,o,c){var r=t.left,a=t.top,l=t.right,d=t.gap;return void 0===o&&(o="margin"),"\n .".concat(e.noScrollbarsClassName," {\n overflow: hidden ").concat(c,";\n padding-right: ").concat(d,"px ").concat(c,";\n }\n body[").concat(i,"] {\n overflow: hidden ").concat(c,";\n overscroll-behavior: contain;\n ").concat([n&&"position: relative ".concat(c,";"),"margin"===o&&"\n padding-left: ".concat(r,"px;\n padding-top: ").concat(a,"px;\n padding-right: ").concat(l,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(d,"px ").concat(c,";\n "),"padding"===o&&"padding-right: ".concat(d,"px ").concat(c,";")].filter(Boolean).join(""),"\n }\n \n .").concat(e.zeroRightClassName," {\n right: ").concat(d,"px ").concat(c,";\n }\n \n .").concat(e.fullWidthClassName," {\n margin-right: ").concat(d,"px ").concat(c,";\n }\n \n .").concat(e.zeroRightClassName," .").concat(e.zeroRightClassName," {\n right: 0 ").concat(c,";\n }\n \n .").concat(e.fullWidthClassName," .").concat(e.fullWidthClassName," {\n margin-right: 0 ").concat(c,";\n }\n \n body[").concat(i,"] {\n ").concat(e.removedBarSizeVariable,": ").concat(d,"px;\n }\n")},d=function(){var t=parseInt(document.body.getAttribute(i)||"0",10);return isFinite(t)?t:0},s=function(){r.useEffect(function(){return document.body.setAttribute(i,(d()+1).toString()),function(){var t=d()-1;t<=0?document.body.removeAttribute(i):document.body.setAttribute(i,t.toString())}},[])};exports.RemoveScrollBar=function(t){var n=t.noRelative,e=t.noImportant,c=t.gapMode,i=void 0===c?"margin":c;s();var d=r.useMemo(function(){return o.getGapWidth(i)},[i]);return r.createElement(a,{styles:l(d,!n,i,e?"":"!important")})},exports.lockAttribute=i,exports.useLockAttribute=s;