@adam-milo/ui 1.0.32 → 1.0.34
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.
- package/dist/index.cjs +1 -1
- package/dist/index.js +58 -22
- package/dist/index10.cjs +1 -1
- package/dist/index10.js +94 -56
- package/dist/index11.cjs +1 -1
- package/dist/index11.js +199 -40
- package/dist/index12.cjs +1 -1
- package/dist/index12.js +305 -105
- package/dist/index13.cjs +1 -1
- package/dist/index13.js +260 -74
- package/dist/index14.cjs +1 -1
- package/dist/index14.js +135 -27
- package/dist/index15.cjs +1 -1
- package/dist/index15.js +52 -469
- package/dist/index16.cjs +1 -1
- package/dist/index16.js +57 -111
- package/dist/index17.cjs +1 -1
- package/dist/index17.js +101 -20
- package/dist/index18.cjs +1 -1
- package/dist/index18.js +76 -21
- package/dist/index19.cjs +1 -1
- package/dist/index19.js +25 -29
- package/dist/index2.cjs +1 -1
- package/dist/index2.js +6 -4
- package/dist/index20.cjs +1 -1
- package/dist/index20.js +468 -31
- package/dist/index21.cjs +1 -1
- package/dist/index21.js +155 -41
- package/dist/index22.cjs +1 -1
- package/dist/index22.js +42 -12
- package/dist/index23.cjs +1 -0
- package/dist/index23.js +38 -0
- package/dist/index24.cjs +1 -1
- package/dist/index24.js +32 -287
- package/dist/index25.cjs +1 -1
- package/dist/index25.js +115 -13
- package/dist/index26.cjs +1 -0
- package/dist/index26.js +55 -0
- package/dist/index27.cjs +1 -0
- package/dist/index27.js +45 -0
- package/dist/index28.cjs +1 -0
- package/dist/index28.js +53 -0
- package/dist/index29.cjs +1 -0
- package/dist/index29.js +55 -0
- package/dist/index3.cjs +1 -1
- package/dist/index3.js +33 -33
- package/dist/index30.cjs +1 -0
- package/dist/index30.js +72 -0
- package/dist/index31.cjs +1 -0
- package/dist/index31.js +14 -0
- package/dist/index32.cjs +1 -0
- package/dist/index32.js +332 -0
- package/dist/index36.cjs +1 -0
- package/dist/index36.js +386 -0
- package/dist/index37.cjs +1 -0
- package/dist/index37.js +16 -0
- package/dist/index4.cjs +1 -1
- package/dist/index4.js +59 -11
- package/dist/index5.cjs +1 -1
- package/dist/index5.js +19 -35
- package/dist/index6.cjs +1 -1
- package/dist/index6.js +11 -101
- package/dist/index62.cjs +1 -0
- package/dist/index62.js +502 -0
- package/dist/index64.cjs +1 -0
- package/dist/index64.js +11 -0
- package/dist/index65.cjs +1 -0
- package/dist/index65.js +39 -0
- package/dist/index66.cjs +1 -0
- package/dist/index66.js +64 -0
- package/dist/index67.cjs +1 -0
- package/dist/index67.js +212 -0
- package/dist/index68.cjs +1 -0
- package/dist/index68.js +14 -0
- package/dist/index69.cjs +1 -0
- package/dist/index69.js +293 -0
- package/dist/index7.cjs +1 -1
- package/dist/index7.js +46 -97
- package/dist/index70.cjs +1 -0
- package/dist/index70.js +18 -0
- package/dist/index71.cjs +1 -0
- package/dist/index71.js +129 -0
- package/dist/index72.cjs +1 -0
- package/dist/index72.js +43 -0
- package/dist/index73.cjs +1 -0
- package/dist/index73.js +99 -0
- package/dist/index74.cjs +1 -0
- package/dist/index74.js +71 -0
- package/dist/index75.cjs +1 -0
- package/dist/index75.js +36 -0
- package/dist/index76.cjs +1 -0
- package/dist/index76.js +14 -0
- package/dist/index77.cjs +1 -0
- package/dist/index77.js +17 -0
- package/dist/index78.cjs +1 -0
- package/dist/index78.js +6 -0
- package/dist/index79.cjs +1 -0
- package/dist/index79.js +297 -0
- package/dist/index8.cjs +1 -1
- package/dist/index8.js +97 -88
- package/dist/index80.cjs +1 -0
- package/dist/index80.js +25 -0
- package/dist/index81.cjs +1 -0
- package/dist/index81.js +39 -0
- package/dist/index82.cjs +1 -0
- package/dist/index82.js +625 -0
- package/dist/index83.cjs +1 -0
- package/dist/index83.js +721 -0
- package/dist/index84.cjs +1 -0
- package/dist/index84.js +154 -0
- package/dist/index85.cjs +1 -0
- package/dist/index85.js +173 -0
- package/dist/index9.cjs +1 -1
- package/dist/index9.js +55 -197
- package/dist/src/components/core/button/Button.component.d.ts +13 -7
- package/dist/src/components/core/button/Button.component.d.ts.map +1 -1
- package/dist/src/components/core/icon/Icon.component.d.ts +1 -1
- package/dist/src/components/core/icon/Icon.component.d.ts.map +1 -1
- package/dist/src/components/core/icon-button/IconButton.component.d.ts +36 -0
- package/dist/src/components/core/icon-button/IconButton.component.d.ts.map +1 -0
- package/dist/src/components/core/menu-icon-button/MenuIconButton.component.d.ts +79 -0
- package/dist/src/components/core/menu-icon-button/MenuIconButton.component.d.ts.map +1 -0
- package/dist/src/components/feedback/spinner/Spinner.component.d.ts +62 -0
- package/dist/src/components/feedback/spinner/Spinner.component.d.ts.map +1 -0
- package/dist/src/components/forms/input/Input.component.d.ts +5 -0
- package/dist/src/components/forms/input/Input.component.d.ts.map +1 -1
- package/dist/src/components/forms/otp-input/OTPInput.component.d.ts +82 -0
- package/dist/src/components/forms/otp-input/OTPInput.component.d.ts.map +1 -0
- package/dist/src/components/forms/phone-input/PhoneInput.component.d.ts +96 -0
- package/dist/src/components/forms/phone-input/PhoneInput.component.d.ts.map +1 -0
- package/dist/src/components/forms/phone-input/countries.d.ts +93 -0
- package/dist/src/components/forms/phone-input/countries.d.ts.map +1 -0
- package/dist/src/components/forms/select/Select.component.d.ts +5 -1
- package/dist/src/components/forms/select/Select.component.d.ts.map +1 -1
- package/dist/src/components/forms/toggle/Toggle.component.d.ts +80 -0
- package/dist/src/components/forms/toggle/Toggle.component.d.ts.map +1 -0
- package/dist/src/components/layout/auth-layout/AuthLayout.component.d.ts +86 -0
- package/dist/src/components/layout/auth-layout/AuthLayout.component.d.ts.map +1 -0
- package/dist/src/components/overlays/dialog/Dialog.component.d.ts +36 -2
- package/dist/src/components/overlays/dialog/Dialog.component.d.ts.map +1 -1
- package/dist/src/components/typography/heading/Heading.component.d.ts +92 -0
- package/dist/src/components/typography/heading/Heading.component.d.ts.map +1 -0
- package/dist/src/components/typography/link/Link.component.d.ts +80 -0
- package/dist/src/components/typography/link/Link.component.d.ts.map +1 -0
- package/dist/src/index.d.ts +24 -5
- package/dist/src/index.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +2 -1
- /package/dist/{index35.cjs → index50.cjs} +0 -0
- /package/dist/{index35.js → index50.js} +0 -0
- /package/dist/{index42.cjs → index61.cjs} +0 -0
- /package/dist/{index42.js → index61.js} +0 -0
package/dist/index84.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
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/index84.js
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
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]);
|
|
64
|
+
}
|
|
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 [];
|
|
80
|
+
}
|
|
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));
|
|
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
|
|
103
|
+
};
|
|
104
|
+
}
|
|
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
|
+
};
|
|
130
|
+
}
|
|
131
|
+
export {
|
|
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
|
|
154
|
+
};
|
package/dist/index85.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
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/index85.js
ADDED
|
@@ -0,0 +1,173 @@
|
|
|
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
|
|
102
|
+
};
|
|
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
|
+
}
|
|
152
|
+
export {
|
|
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
|
|
173
|
+
};
|
package/dist/index9.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),a=require("./index31.cjs");;/* empty css */const c=r.forwardRef(({label:c,error:t,helperText:d,indeterminate:i=!1,className:s,id:l,required:n,disabled:o,checked:u,"data-cy":b,"data-testid":h,...x},p)=>{const k=r.useId(),m=l||k,y=`${m}-error`,_=`${m}-helper`,$=b||"checkbox",f=h||"checkbox",j=r.useRef(null),N=r.useCallback(e=>{j.current=e,p&&("function"==typeof p?p(e):"current"in p&&(p.current=e))},[p]);r.useEffect(()=>{j.current&&(j.current.indeterminate=i)},[i]);const q=c&&n&&!c.includes("*")?`${c} *`:c;return e.jsxs("div",{className:a.cn("checkbox-wrapper",o&&"checkbox-wrapper--disabled"),"data-cy":`${$}-wrapper`,"data-testid":`${f}-wrapper`,children:[e.jsxs("div",{className:"checkbox__container",children:[e.jsx("input",{ref:N,id:m,type:"checkbox",checked:u,className:a.cn("checkbox__input",t&&"checkbox__input--error",s),"aria-invalid":t?"true":"false","aria-required":n?"true":void 0,"aria-describedby":t?y:d?_:void 0,"data-cy":$,"data-testid":f,"data-indeterminate":i?"true":void 0,disabled:o,required:n,...x}),c&&e.jsx("label",{htmlFor:m,className:"checkbox__label","data-cy":`${$}-label`,"data-testid":`${f}-label`,children:q})]}),t&&e.jsx("span",{id:y,className:"checkbox__error",role:"alert","data-cy":`${$}-error`,"data-testid":`${f}-error`,children:t}),d&&!t&&e.jsx("span",{id:_,className:"checkbox__helper","data-cy":`${$}-helper`,"data-testid":`${f}-helper`,children:d})]})});c.displayName="Checkbox",exports.Checkbox=c;
|
package/dist/index9.js
CHANGED
|
@@ -1,137 +1,82 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef, useId } from "react";
|
|
3
|
-
import
|
|
4
|
-
import { cn } from "./index22.js";
|
|
2
|
+
import { forwardRef, useId, useRef, useCallback, useEffect } from "react";
|
|
3
|
+
import { cn } from "./index31.js";
|
|
5
4
|
/* empty css */
|
|
6
|
-
const
|
|
7
|
-
const SelectTrigger = forwardRef(
|
|
5
|
+
const Checkbox = forwardRef(
|
|
8
6
|
({
|
|
9
|
-
className,
|
|
10
|
-
children,
|
|
11
7
|
label,
|
|
12
8
|
error,
|
|
13
9
|
helperText,
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
indeterminate = false,
|
|
11
|
+
className,
|
|
16
12
|
id: providedId,
|
|
13
|
+
required,
|
|
14
|
+
disabled,
|
|
15
|
+
checked,
|
|
17
16
|
"data-cy": dataCy,
|
|
18
17
|
"data-testid": dataTestId,
|
|
19
|
-
disabled,
|
|
20
|
-
required,
|
|
21
18
|
...props
|
|
22
19
|
}, ref) => {
|
|
23
20
|
const generatedId = useId();
|
|
24
21
|
const id = providedId || generatedId;
|
|
25
22
|
const errorId = `${id}-error`;
|
|
26
23
|
const helperId = `${id}-helper`;
|
|
27
|
-
const finalDataCy = dataCy || "
|
|
28
|
-
const finalTestId = dataTestId || "
|
|
29
|
-
const
|
|
24
|
+
const finalDataCy = dataCy || "checkbox";
|
|
25
|
+
const finalTestId = dataTestId || "checkbox";
|
|
26
|
+
const internalRef = useRef(null);
|
|
27
|
+
const combinedRef = useCallback(
|
|
28
|
+
(element) => {
|
|
29
|
+
internalRef.current = element;
|
|
30
|
+
if (!ref) return;
|
|
31
|
+
if (typeof ref === "function") {
|
|
32
|
+
ref(element);
|
|
33
|
+
} else if ("current" in ref) {
|
|
34
|
+
ref.current = element;
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
[ref]
|
|
38
|
+
);
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
if (internalRef.current) {
|
|
41
|
+
internalRef.current.indeterminate = indeterminate;
|
|
42
|
+
}
|
|
43
|
+
}, [indeterminate]);
|
|
44
|
+
const displayLabel = label && required && !label.includes("*") ? `${label} *` : label;
|
|
30
45
|
return /* @__PURE__ */ jsxs(
|
|
31
46
|
"div",
|
|
32
47
|
{
|
|
33
|
-
className: cn("
|
|
48
|
+
className: cn("checkbox-wrapper", disabled && "checkbox-wrapper--disabled"),
|
|
34
49
|
"data-cy": `${finalDataCy}-wrapper`,
|
|
35
50
|
"data-testid": `${finalTestId}-wrapper`,
|
|
36
51
|
children: [
|
|
37
|
-
/* @__PURE__ */ jsxs("div", { className: "
|
|
38
|
-
/* @__PURE__ */
|
|
39
|
-
|
|
40
|
-
"div",
|
|
41
|
-
{
|
|
42
|
-
className: cn(
|
|
43
|
-
"select-field__border-left",
|
|
44
|
-
error && "select-field__border-left--error",
|
|
45
|
-
isFloating && "select-field__border-left--floating",
|
|
46
|
-
disabled && "select-field__border-left--disabled"
|
|
47
|
-
)
|
|
48
|
-
}
|
|
49
|
-
),
|
|
50
|
-
label && isFloating && /* @__PURE__ */ jsx(
|
|
51
|
-
"div",
|
|
52
|
-
{
|
|
53
|
-
className: cn(
|
|
54
|
-
"select-field__label-container",
|
|
55
|
-
error && "select-field__label-container--error"
|
|
56
|
-
),
|
|
57
|
-
children: /* @__PURE__ */ jsx(
|
|
58
|
-
"span",
|
|
59
|
-
{
|
|
60
|
-
className: cn(
|
|
61
|
-
"select-field__label select-field__label--floating",
|
|
62
|
-
error && "select-field__label--error",
|
|
63
|
-
disabled && "select-field__label--disabled"
|
|
64
|
-
),
|
|
65
|
-
"data-cy": `${finalDataCy}-label`,
|
|
66
|
-
"data-testid": `${finalTestId}-label`,
|
|
67
|
-
children: label
|
|
68
|
-
}
|
|
69
|
-
)
|
|
70
|
-
}
|
|
71
|
-
),
|
|
72
|
-
/* @__PURE__ */ jsx(
|
|
73
|
-
"div",
|
|
74
|
-
{
|
|
75
|
-
className: cn(
|
|
76
|
-
"select-field__border-right",
|
|
77
|
-
error && "select-field__border-right--error",
|
|
78
|
-
isFloating && "select-field__border-right--floating",
|
|
79
|
-
disabled && "select-field__border-right--disabled"
|
|
80
|
-
)
|
|
81
|
-
}
|
|
82
|
-
)
|
|
83
|
-
] }),
|
|
84
|
-
/* @__PURE__ */ jsxs(
|
|
85
|
-
SelectPrimitive.Trigger,
|
|
52
|
+
/* @__PURE__ */ jsxs("div", { className: "checkbox__container", children: [
|
|
53
|
+
/* @__PURE__ */ jsx(
|
|
54
|
+
"input",
|
|
86
55
|
{
|
|
87
|
-
ref,
|
|
56
|
+
ref: combinedRef,
|
|
88
57
|
id,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
fullWidth && "select-trigger--full-width",
|
|
93
|
-
isFloating && "select-trigger--floating",
|
|
94
|
-
className
|
|
95
|
-
),
|
|
58
|
+
type: "checkbox",
|
|
59
|
+
checked,
|
|
60
|
+
className: cn("checkbox__input", error && "checkbox__input--error", className),
|
|
96
61
|
"aria-invalid": error ? "true" : "false",
|
|
97
|
-
"aria-describedby": error ? errorId : helperText ? helperId : void 0,
|
|
98
62
|
"aria-required": required ? "true" : void 0,
|
|
63
|
+
"aria-describedby": error ? errorId : helperText ? helperId : void 0,
|
|
99
64
|
"data-cy": finalDataCy,
|
|
100
65
|
"data-testid": finalTestId,
|
|
66
|
+
"data-indeterminate": indeterminate ? "true" : void 0,
|
|
101
67
|
disabled,
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
/* @__PURE__ */ jsx(
|
|
115
|
-
SelectPrimitive.Icon,
|
|
116
|
-
{
|
|
117
|
-
className: "select-trigger__icon",
|
|
118
|
-
"data-cy": `${finalDataCy}-icon`,
|
|
119
|
-
"data-testid": `${finalTestId}-icon`,
|
|
120
|
-
children: /* @__PURE__ */ jsx(
|
|
121
|
-
"svg",
|
|
122
|
-
{
|
|
123
|
-
width: "24",
|
|
124
|
-
height: "24",
|
|
125
|
-
viewBox: "0 0 24 24",
|
|
126
|
-
fill: "none",
|
|
127
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
128
|
-
"aria-hidden": "true",
|
|
129
|
-
children: /* @__PURE__ */ jsx("path", { d: "M7 10L12 15L17 10H7Z", fill: "currentColor" })
|
|
130
|
-
}
|
|
131
|
-
)
|
|
132
|
-
}
|
|
133
|
-
)
|
|
134
|
-
]
|
|
68
|
+
required,
|
|
69
|
+
...props
|
|
70
|
+
}
|
|
71
|
+
),
|
|
72
|
+
label && /* @__PURE__ */ jsx(
|
|
73
|
+
"label",
|
|
74
|
+
{
|
|
75
|
+
htmlFor: id,
|
|
76
|
+
className: "checkbox__label",
|
|
77
|
+
"data-cy": `${finalDataCy}-label`,
|
|
78
|
+
"data-testid": `${finalTestId}-label`,
|
|
79
|
+
children: displayLabel
|
|
135
80
|
}
|
|
136
81
|
)
|
|
137
82
|
] }),
|
|
@@ -139,7 +84,7 @@ const SelectTrigger = forwardRef(
|
|
|
139
84
|
"span",
|
|
140
85
|
{
|
|
141
86
|
id: errorId,
|
|
142
|
-
className: "
|
|
87
|
+
className: "checkbox__error",
|
|
143
88
|
role: "alert",
|
|
144
89
|
"data-cy": `${finalDataCy}-error`,
|
|
145
90
|
"data-testid": `${finalTestId}-error`,
|
|
@@ -150,7 +95,7 @@ const SelectTrigger = forwardRef(
|
|
|
150
95
|
"span",
|
|
151
96
|
{
|
|
152
97
|
id: helperId,
|
|
153
|
-
className: "
|
|
98
|
+
className: "checkbox__helper",
|
|
154
99
|
"data-cy": `${finalDataCy}-helper`,
|
|
155
100
|
"data-testid": `${finalTestId}-helper`,
|
|
156
101
|
children: helperText
|
|
@@ -161,94 +106,7 @@ const SelectTrigger = forwardRef(
|
|
|
161
106
|
);
|
|
162
107
|
}
|
|
163
108
|
);
|
|
164
|
-
|
|
165
|
-
const SelectValue = SelectPrimitive.Value;
|
|
166
|
-
const SelectContent = forwardRef(
|
|
167
|
-
({
|
|
168
|
-
className,
|
|
169
|
-
children,
|
|
170
|
-
position = "popper",
|
|
171
|
-
"data-cy": dataCy,
|
|
172
|
-
"data-testid": dataTestId,
|
|
173
|
-
...props
|
|
174
|
-
}, ref) => {
|
|
175
|
-
const finalDataCy = dataCy || "select-content";
|
|
176
|
-
const finalTestId = dataTestId || "select-content";
|
|
177
|
-
return /* @__PURE__ */ jsx(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
178
|
-
SelectPrimitive.Content,
|
|
179
|
-
{
|
|
180
|
-
ref,
|
|
181
|
-
className: cn("select-content", className),
|
|
182
|
-
position,
|
|
183
|
-
sideOffset: 8,
|
|
184
|
-
"data-cy": finalDataCy,
|
|
185
|
-
"data-testid": finalTestId,
|
|
186
|
-
...props,
|
|
187
|
-
children: /* @__PURE__ */ jsx(SelectPrimitive.Viewport, { className: "select-viewport", children })
|
|
188
|
-
}
|
|
189
|
-
) });
|
|
190
|
-
}
|
|
191
|
-
);
|
|
192
|
-
SelectContent.displayName = "SelectContent";
|
|
193
|
-
const SelectItem = forwardRef(
|
|
194
|
-
({ className, children, value, "data-cy": dataCy, "data-testid": dataTestId, ...props }, ref) => {
|
|
195
|
-
const finalDataCy = dataCy || `select-item-${value}`;
|
|
196
|
-
const finalTestId = dataTestId || `select-item-${value}`;
|
|
197
|
-
return /* @__PURE__ */ jsx(
|
|
198
|
-
SelectPrimitive.Item,
|
|
199
|
-
{
|
|
200
|
-
ref,
|
|
201
|
-
className: cn("select-item", className),
|
|
202
|
-
value,
|
|
203
|
-
"data-cy": finalDataCy,
|
|
204
|
-
"data-testid": finalTestId,
|
|
205
|
-
...props,
|
|
206
|
-
children: /* @__PURE__ */ jsx(SelectPrimitive.ItemText, { children })
|
|
207
|
-
}
|
|
208
|
-
);
|
|
209
|
-
}
|
|
210
|
-
);
|
|
211
|
-
SelectItem.displayName = "SelectItem";
|
|
212
|
-
const SelectGroup = SelectPrimitive.Group;
|
|
213
|
-
const SelectLabel = forwardRef(
|
|
214
|
-
({ className, "data-cy": dataCy, "data-testid": dataTestId, ...props }, ref) => {
|
|
215
|
-
const finalDataCy = dataCy || "select-label";
|
|
216
|
-
const finalTestId = dataTestId || "select-label";
|
|
217
|
-
return /* @__PURE__ */ jsx(
|
|
218
|
-
SelectPrimitive.Label,
|
|
219
|
-
{
|
|
220
|
-
ref,
|
|
221
|
-
className: cn("select-group-label", className),
|
|
222
|
-
"data-cy": finalDataCy,
|
|
223
|
-
"data-testid": finalTestId,
|
|
224
|
-
...props
|
|
225
|
-
}
|
|
226
|
-
);
|
|
227
|
-
}
|
|
228
|
-
);
|
|
229
|
-
SelectLabel.displayName = "SelectLabel";
|
|
230
|
-
const SelectSeparator = forwardRef(({ className, "data-cy": dataCy, "data-testid": dataTestId, ...props }, ref) => {
|
|
231
|
-
const finalDataCy = dataCy || "select-separator";
|
|
232
|
-
const finalTestId = dataTestId || "select-separator";
|
|
233
|
-
return /* @__PURE__ */ jsx(
|
|
234
|
-
SelectPrimitive.Separator,
|
|
235
|
-
{
|
|
236
|
-
ref,
|
|
237
|
-
className: cn("select-separator", className),
|
|
238
|
-
"data-cy": finalDataCy,
|
|
239
|
-
"data-testid": finalTestId,
|
|
240
|
-
...props
|
|
241
|
-
}
|
|
242
|
-
);
|
|
243
|
-
});
|
|
244
|
-
SelectSeparator.displayName = "SelectSeparator";
|
|
109
|
+
Checkbox.displayName = "Checkbox";
|
|
245
110
|
export {
|
|
246
|
-
|
|
247
|
-
SelectContent,
|
|
248
|
-
SelectGroup,
|
|
249
|
-
SelectItem,
|
|
250
|
-
SelectLabel,
|
|
251
|
-
SelectSeparator,
|
|
252
|
-
SelectTrigger,
|
|
253
|
-
SelectValue
|
|
111
|
+
Checkbox
|
|
254
112
|
};
|