welcome-ui 1.0.0-beta.1 → 1.0.0-beta.3

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 (93) hide show
  1. package/dist/Accordion.js +89 -0
  2. package/dist/Accordion.mjs +579 -0
  3. package/dist/Alert.js +1 -0
  4. package/dist/Alert.mjs +7 -0
  5. package/dist/AspectRatio.js +29 -0
  6. package/dist/AspectRatio.mjs +41 -0
  7. package/dist/Avatar.js +5 -0
  8. package/dist/Avatar.mjs +55 -0
  9. package/dist/Badge.js +17 -0
  10. package/dist/Badge.mjs +53 -0
  11. package/dist/Box.js +1 -0
  12. package/dist/Box.mjs +8 -0
  13. package/dist/Breadcrumb.js +54 -0
  14. package/dist/Breadcrumb.mjs +439 -0
  15. package/dist/Flex.js +1 -0
  16. package/dist/Flex.mjs +26 -0
  17. package/dist/System.js +1 -0
  18. package/dist/System.mjs +51 -0
  19. package/dist/X5NMLKT6-BC1Q56kB.mjs +1258 -0
  20. package/dist/X5NMLKT6-vrNG8i_R.js +14 -0
  21. package/dist/index-0MPAX4B5.mjs +320 -0
  22. package/dist/index-BNA_A0oa.js +155 -0
  23. package/dist/index-BXJQXgy9.js +13 -0
  24. package/dist/index-Bwrtxit1.mjs +84 -0
  25. package/dist/index-Ct2FOeyM.js +17 -0
  26. package/dist/index-DRNn5iIc.js +142 -0
  27. package/dist/index-Du8Nrf16.mjs +128 -0
  28. package/dist/index-MifIgNHW.mjs +47 -0
  29. package/dist/index-V28zHt_Z.js +68 -0
  30. package/dist/index-WmqrMIzg.mjs +19070 -0
  31. package/dist/index.js +147 -5
  32. package/dist/index.mjs +767 -217
  33. package/dist/types/components/Accordion/index.d.ts +16 -0
  34. package/dist/types/components/Accordion/styles.d.ts +6 -0
  35. package/dist/types/components/Accordion/theme.d.ts +10 -0
  36. package/dist/types/components/Alert/Title.d.ts +7 -0
  37. package/dist/types/components/Alert/index.d.ts +24 -0
  38. package/dist/types/components/Alert/styles.d.ts +6 -0
  39. package/dist/types/components/Alert/theme.d.ts +15 -0
  40. package/dist/types/components/AspectRatio/index.d.ts +6 -0
  41. package/dist/types/components/AspectRatio/styles.d.ts +2 -0
  42. package/dist/types/components/Avatar/index.d.ts +16 -0
  43. package/dist/types/components/Avatar/styles.d.ts +2 -0
  44. package/dist/types/components/Avatar/theme.d.ts +9 -0
  45. package/dist/types/components/Avatar/utils.d.ts +3 -0
  46. package/dist/types/components/Badge/index.d.ts +11 -0
  47. package/dist/types/components/Badge/styles.d.ts +8 -0
  48. package/dist/types/components/Badge/theme.d.ts +18 -0
  49. package/dist/types/components/Box/index.d.ts +3 -0
  50. package/dist/types/components/Breadcrumb/Item.d.ts +13 -0
  51. package/dist/types/components/Breadcrumb/Item.styles.d.ts +2 -0
  52. package/dist/types/components/Breadcrumb/index.d.ts +18 -0
  53. package/dist/types/components/Breadcrumb/styles.d.ts +6 -0
  54. package/dist/types/components/Breadcrumb/theme.d.ts +12 -0
  55. package/dist/types/components/Button/index.d.ts +21 -0
  56. package/dist/types/components/Button/styles.d.ts +2 -0
  57. package/dist/types/components/Button/theme.d.ts +13 -0
  58. package/dist/types/components/ButtonGroup/index.d.ts +15 -0
  59. package/dist/types/components/ButtonGroup/styles.d.ts +1 -0
  60. package/dist/types/components/Card/Cover.d.ts +10 -0
  61. package/dist/types/components/Card/Cover.styles.d.ts +1 -0
  62. package/dist/types/components/Card/index.d.ts +8 -0
  63. package/dist/types/components/Card/styles.d.ts +2 -0
  64. package/dist/types/components/Card/theme.d.ts +6 -0
  65. package/dist/types/components/ClearButton/index.d.ts +5 -0
  66. package/dist/types/components/ClearButton/styles.d.ts +1 -0
  67. package/dist/types/components/CloseButton/index.d.ts +3 -0
  68. package/dist/types/components/CloseButton/styles.d.ts +1 -0
  69. package/dist/types/components/Flex/index.d.ts +19 -0
  70. package/dist/types/components/System/index.d.ts +40 -0
  71. package/dist/types/components/WuiProvider/font.d.ts +16 -0
  72. package/dist/types/components/WuiProvider/hide-focus-rings-root.d.ts +8 -0
  73. package/dist/types/components/WuiProvider/index.d.ts +11 -0
  74. package/dist/types/components/WuiProvider/styles.d.ts +5 -0
  75. package/dist/types/components/index.d.ts +15 -0
  76. package/dist/types/index.d.ts +2 -0
  77. package/dist/types/theme/borders.d.ts +6 -0
  78. package/dist/types/theme/colors.d.ts +346 -0
  79. package/dist/types/theme/dark.d.ts +7 -0
  80. package/dist/types/theme/focus.d.ts +10 -0
  81. package/dist/types/theme/fonts.d.ts +18 -0
  82. package/dist/types/theme/index.d.ts +76 -0
  83. package/dist/types/theme/radii.d.ts +12 -0
  84. package/dist/types/theme/screens.d.ts +13 -0
  85. package/dist/types/theme/selection.d.ts +4 -0
  86. package/dist/types/theme/shadows.d.ts +5 -0
  87. package/dist/types/theme/space.d.ts +18 -0
  88. package/dist/types/theme/transitions.d.ts +13 -0
  89. package/dist/types/theme/typography.d.ts +133 -0
  90. package/dist/types/theme/underline.d.ts +9 -0
  91. package/package.json +7 -2
  92. package/dist/Test.js +0 -3
  93. package/dist/Test.mjs +0 -9
package/dist/Alert.mjs ADDED
@@ -0,0 +1,7 @@
1
+ import "react";
2
+ import { A as i } from "./index-0MPAX4B5.mjs";
3
+ import "./System.mjs";
4
+ import "./Box.mjs";
5
+ export {
6
+ i as Alert
7
+ };
@@ -0,0 +1,29 @@
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react"),r=require("./System.js"),t=require("@xstyled/styled-components"),n=t.divBox(({ratio:e})=>t.css`
2
+ position: relative;
3
+
4
+ & > * {
5
+ overflow: hidden;
6
+ position: absolute;
7
+ top: 0;
8
+ right: 0;
9
+ bottom: 0;
10
+ left: 0;
11
+ display: flex;
12
+ justify-content: center;
13
+ align-items: center;
14
+ width: 100%;
15
+ height: 100%;
16
+ }
17
+
18
+ & > img,
19
+ & > video {
20
+ object-fit: cover;
21
+ }
22
+
23
+ &:before {
24
+ height: 0;
25
+ content: '';
26
+ display: block;
27
+ padding-bottom: ${1/e*100}%;
28
+ }
29
+ `),o=r.forwardRef(({ratio:e=4/3,...i},s)=>c.createElement(n,{ratio:e,ref:s,...i}));o.displayName="AspectRatio";exports.AspectRatio=o;
@@ -0,0 +1,41 @@
1
+ "use client";
2
+ import i from "react";
3
+ import { forwardRef as r } from "./System.mjs";
4
+ import a, { css as c } from "@xstyled/styled-components";
5
+ const n = a.divBox(
6
+ ({ ratio: t }) => c`
7
+ position: relative;
8
+
9
+ & > * {
10
+ overflow: hidden;
11
+ position: absolute;
12
+ top: 0;
13
+ right: 0;
14
+ bottom: 0;
15
+ left: 0;
16
+ display: flex;
17
+ justify-content: center;
18
+ align-items: center;
19
+ width: 100%;
20
+ height: 100%;
21
+ }
22
+
23
+ & > img,
24
+ & > video {
25
+ object-fit: cover;
26
+ }
27
+
28
+ &:before {
29
+ height: 0;
30
+ content: '';
31
+ display: block;
32
+ padding-bottom: ${1 / t * 100}%;
33
+ }
34
+ `
35
+ ), s = r(
36
+ ({ ratio: t = 4 / 3, ...e }, o) => /* @__PURE__ */ i.createElement(n, { ratio: t, ref: o, ...e })
37
+ );
38
+ s.displayName = "AspectRatio";
39
+ export {
40
+ s as AspectRatio
41
+ };
package/dist/Avatar.js ADDED
@@ -0,0 +1,5 @@
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react"),s=require("@xstyled/styled-components"),y=require("./System.js"),S=require("./Box.js"),m=require("./index-V28zHt_Z.js");function b(o,e=""){const t=Object.keys(o).filter(r=>r.startsWith("secondary-")),n=e.length%t.length;return t[n]}function A(o=""){const[e,t]=o.split(" ");return e&&t?`${e.charAt(0).toUpperCase()}${t.charAt(0).toUpperCase()}`:e.substring(0,2).toUpperCase()}const C=s(m.Shape2)`
2
+ flex-shrink: 0;
3
+ `,q=s(m.Text2)`
4
+ ${s.th("avatars.text")};
5
+ `,g=a.memo(y.forwardRef(({color:o,fontSize:e,getInitials:t=A,h:n,name:r,shape:h="circle",size:d="md",src:c,w:i,...f},p)=>{const l=s.useTheme(),v=o||b(l.colors,r),u=l.avatars.sizes[d],x=e||`calc(${i?l.toRem(i):u} / 2.5)`;return a.createElement(C,{"aria-label":r,backgroundColor:v,h:n||u,ref:p,role:"img",shape:h,w:i||u,...f},c&&a.createElement("img",{alt:r,src:c}),!c&&a.createElement(S.Box,null,a.createElement(q,{fontSize:x,m:0},t(r))))}));g.displayName="Avatar";exports.Avatar=g;
@@ -0,0 +1,55 @@
1
+ "use client";
2
+ import a, { memo as v } from "react";
3
+ import m, { th as x, useTheme as C } from "@xstyled/styled-components";
4
+ import { forwardRef as S } from "./System.mjs";
5
+ import { Box as b } from "./Box.mjs";
6
+ import { S as y, T as A } from "./index-Du8Nrf16.mjs";
7
+ function $(o, t = "") {
8
+ const e = Object.keys(o).filter((r) => r.startsWith("secondary-")), s = t.length % e.length;
9
+ return e[s];
10
+ }
11
+ function z(o = "") {
12
+ const [t, e] = o.split(" ");
13
+ return t && e ? `${t.charAt(0).toUpperCase()}${e.charAt(0).toUpperCase()}` : t.substring(0, 2).toUpperCase();
14
+ }
15
+ const E = m(y)`
16
+ flex-shrink: 0;
17
+ `, T = m(A)`
18
+ ${x("avatars.text")};
19
+ `, _ = v(
20
+ S(
21
+ ({
22
+ color: o,
23
+ fontSize: t,
24
+ getInitials: e = z,
25
+ h: s,
26
+ name: r,
27
+ shape: f = "circle",
28
+ size: p = "md",
29
+ src: n,
30
+ w: l,
31
+ ...u
32
+ }, h) => {
33
+ const i = C(), d = o || $(i.colors, r), c = i.avatars.sizes[p], g = t || `calc(${l ? i.toRem(l) : c} / 2.5)`;
34
+ return /* @__PURE__ */ a.createElement(
35
+ E,
36
+ {
37
+ "aria-label": r,
38
+ backgroundColor: d,
39
+ h: s || c,
40
+ ref: h,
41
+ role: "img",
42
+ shape: f,
43
+ w: l || c,
44
+ ...u
45
+ },
46
+ n && /* @__PURE__ */ a.createElement("img", { alt: r, src: n }),
47
+ !n && /* @__PURE__ */ a.createElement(b, null, /* @__PURE__ */ a.createElement(T, { fontSize: g, m: 0 }, e(r)))
48
+ );
49
+ }
50
+ )
51
+ );
52
+ _.displayName = "Avatar";
53
+ export {
54
+ _ as Avatar
55
+ };
package/dist/Badge.js ADDED
@@ -0,0 +1,17 @@
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $=require("react"),b=require("./System.js"),e=require("@xstyled/styled-components"),f=e.div(({disabled:t,length:n,size:s,variant:a})=>e.css`
2
+ ${e.th("badges.default")};
3
+ ${e.th(`badges.variants.${a}`)};
4
+ ${e.th(`badges.sizes.${s}`)};
5
+ display: inline-flex;
6
+ align-items: center;
7
+ justify-content: center;
8
+ ${e.system};
9
+
10
+ ${t&&e.css`
11
+ ${e.th(`badges.disabled.${a}`)};
12
+ `}
13
+
14
+ ${n===1&&e.css`
15
+ width: ${e.th(`badges.sizes.${s}.height`)};
16
+ `}
17
+ `),d=b.forwardRef(({children:t,dataTestId:n,disabled:s,size:a="md",variant:g="default",withNumberAbbreviation:r,...c},l)=>{let i;const o=Number.isInteger(t),u=t.toString().length;return o&&r&&t>99?i="99+":i=t,$.createElement(f,{"data-testid":n,disabled:s,length:u,ref:l,size:a,variant:g,...c},i)});d.displayName="Badge";exports.Badge=d;
package/dist/Badge.mjs ADDED
@@ -0,0 +1,53 @@
1
+ "use client";
2
+ import $ from "react";
3
+ import { forwardRef as u } from "./System.mjs";
4
+ import b, { css as g, th as t, system as c } from "@xstyled/styled-components";
5
+ const p = b.div(
6
+ ({ disabled: e, length: i, size: s, variant: a }) => g`
7
+ ${t("badges.default")};
8
+ ${t(`badges.variants.${a}`)};
9
+ ${t(`badges.sizes.${s}`)};
10
+ display: inline-flex;
11
+ align-items: center;
12
+ justify-content: center;
13
+ ${c};
14
+
15
+ ${e && g`
16
+ ${t(`badges.disabled.${a}`)};
17
+ `}
18
+
19
+ ${i === 1 && g`
20
+ width: ${t(`badges.sizes.${s}.height`)};
21
+ `}
22
+ `
23
+ ), x = u(
24
+ ({
25
+ children: e,
26
+ dataTestId: i,
27
+ disabled: s,
28
+ size: a = "md",
29
+ variant: n = "default",
30
+ withNumberAbbreviation: o,
31
+ ...r
32
+ }, f) => {
33
+ let d;
34
+ const l = Number.isInteger(e), m = e.toString().length;
35
+ return l && o && e > 99 ? d = "99+" : d = e, /* @__PURE__ */ $.createElement(
36
+ p,
37
+ {
38
+ "data-testid": i,
39
+ disabled: s,
40
+ length: m,
41
+ ref: f,
42
+ size: a,
43
+ variant: n,
44
+ ...r
45
+ },
46
+ d
47
+ );
48
+ }
49
+ );
50
+ x.displayName = "Badge";
51
+ export {
52
+ x as Badge
53
+ };
package/dist/Box.js ADDED
@@ -0,0 +1 @@
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react"),o=require("@xstyled/styled-components"),c=require("./System.js"),n=c.forwardRef((e,t)=>r.createElement(o.x.div,{ref:t,...e}));exports.Box=n;
package/dist/Box.mjs ADDED
@@ -0,0 +1,8 @@
1
+ "use client";
2
+ import t from "react";
3
+ import { x as o } from "@xstyled/styled-components";
4
+ import { forwardRef as m } from "./System.mjs";
5
+ const c = m((r, e) => /* @__PURE__ */ t.createElement(o.div, { ref: e, ...r }));
6
+ export {
7
+ c as Box
8
+ };
@@ -0,0 +1,54 @@
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react"),_=require("./index-BXJQXgy9.js"),ve=require("./index-Ct2FOeyM.js"),ee=require("./System.js"),fe=require("./Box.js"),u=require("@xstyled/styled-components");var E=[],he=function(){return E.some(function(e){return e.activeTargets.length>0})},pe=function(){return E.some(function(e){return e.skippedTargets.length>0})},V="ResizeObserver loop completed with undelivered notifications.",be=function(){var e;typeof ErrorEvent=="function"?e=new ErrorEvent("error",{message:V}):(e=document.createEvent("Event"),e.initEvent("error",!1,!1),e.message=V),window.dispatchEvent(e)},C;(function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(C||(C={}));var w=function(e){return Object.freeze(e)},ge=function(){function e(t,r){this.inlineSize=t,this.blockSize=r,w(this)}return e}(),te=function(){function e(t,r,n,i){return this.x=t,this.y=r,this.width=n,this.height=i,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,w(this)}return e.prototype.toJSON=function(){var t=this,r=t.x,n=t.y,i=t.top,a=t.right,o=t.bottom,v=t.left,f=t.width,l=t.height;return{x:r,y:n,top:i,right:a,bottom:o,left:v,width:f,height:l}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),F=function(e){return e instanceof SVGElement&&"getBBox"in e},re=function(e){if(F(e)){var t=e.getBBox(),r=t.width,n=t.height;return!r&&!n}var i=e,a=i.offsetWidth,o=i.offsetHeight;return!(a||o||e.getClientRects().length)},X=function(e){var t;if(e instanceof Element)return!0;var r=(t=e==null?void 0:e.ownerDocument)===null||t===void 0?void 0:t.defaultView;return!!(r&&e instanceof r.Element)},me=function(e){switch(e.tagName){case"INPUT":if(e.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},S=typeof window<"u"?window:{},I=new WeakMap,J=/auto|scroll/,xe=/^tb|vertical/,Ee=/msie|trident/i.test(S.navigator&&S.navigator.userAgent),p=function(e){return parseFloat(e||"0")},R=function(e,t,r){return e===void 0&&(e=0),t===void 0&&(t=0),r===void 0&&(r=!1),new ge((r?t:e)||0,(r?e:t)||0)},U=w({devicePixelContentBoxSize:R(),borderBoxSize:R(),contentBoxSize:R(),contentRect:new te(0,0,0,0)}),ne=function(e,t){if(t===void 0&&(t=!1),I.has(e)&&!t)return I.get(e);if(re(e))return I.set(e,U),U;var r=getComputedStyle(e),n=F(e)&&e.ownerSVGElement&&e.getBBox(),i=!Ee&&r.boxSizing==="border-box",a=xe.test(r.writingMode||""),o=!n&&J.test(r.overflowY||""),v=!n&&J.test(r.overflowX||""),f=n?0:p(r.paddingTop),l=n?0:p(r.paddingRight),y=n?0:p(r.paddingBottom),h=n?0:p(r.paddingLeft),N=n?0:p(r.borderTopWidth),k=n?0:p(r.borderRightWidth),D=n?0:p(r.borderBottomWidth),$=n?0:p(r.borderLeftWidth),O=h+l,x=f+y,B=$+k,T=N+D,c=v?e.offsetHeight-T-e.clientHeight:0,d=o?e.offsetWidth-B-e.clientWidth:0,b=i?O+B:0,g=i?x+T:0,m=n?n.width:p(r.width)-b-d,z=n?n.height:p(r.height)-g-c,le=m+O+d+B,de=z+x+c+T,G=w({devicePixelContentBoxSize:R(Math.round(m*devicePixelRatio),Math.round(z*devicePixelRatio),a),borderBoxSize:R(le,de,a),contentBoxSize:R(m,z,a),contentRect:new te(h,f,m,z)});return I.set(e,G),G},ie=function(e,t,r){var n=ne(e,r),i=n.borderBoxSize,a=n.contentBoxSize,o=n.devicePixelContentBoxSize;switch(t){case C.DEVICE_PIXEL_CONTENT_BOX:return o;case C.BORDER_BOX:return i;default:return a}},we=function(){function e(t){var r=ne(t);this.target=t,this.contentRect=r.contentRect,this.borderBoxSize=w([r.borderBoxSize]),this.contentBoxSize=w([r.contentBoxSize]),this.devicePixelContentBoxSize=w([r.devicePixelContentBoxSize])}return e}(),oe=function(e){if(re(e))return 1/0;for(var t=0,r=e.parentNode;r;)t+=1,r=r.parentNode;return t},ze=function(){var e=1/0,t=[];E.forEach(function(o){if(o.activeTargets.length!==0){var v=[];o.activeTargets.forEach(function(l){var y=new we(l.target),h=oe(l.target);v.push(y),l.lastReportedSize=ie(l.target,l.observedBox),h<e&&(e=h)}),t.push(function(){o.callback.call(o.observer,v,o.observer)}),o.activeTargets.splice(0,o.activeTargets.length)}});for(var r=0,n=t;r<n.length;r++){var i=n[r];i()}return e},Y=function(e){E.forEach(function(r){r.activeTargets.splice(0,r.activeTargets.length),r.skippedTargets.splice(0,r.skippedTargets.length),r.observationTargets.forEach(function(i){i.isActive()&&(oe(i.target)>e?r.activeTargets.push(i):r.skippedTargets.push(i))})})},Re=function(){var e=0;for(Y(e);he();)e=ze(),Y(e);return pe()&&be(),e>0},W,se=[],ye=function(){return se.splice(0).forEach(function(e){return e()})},Oe=function(e){if(!W){var t=0,r=document.createTextNode(""),n={characterData:!0};new MutationObserver(function(){return ye()}).observe(r,n),W=function(){r.textContent="".concat(t?t--:t++)}}se.push(e),W()},Be=function(e){Oe(function(){requestAnimationFrame(e)})},M=0,Te=function(){return!!M},Se=250,Ce={attributes:!0,characterData:!0,childList:!0,subtree:!0},K=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Q=function(e){return e===void 0&&(e=0),Date.now()+e},P=!1,ke=function(){function e(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return e.prototype.run=function(t){var r=this;if(t===void 0&&(t=Se),!P){P=!0;var n=Q(t);Be(function(){var i=!1;try{i=Re()}finally{if(P=!1,t=n-Q(),!Te())return;i?r.run(1e3):t>0?r.run(t):r.start()}})}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var t=this,r=function(){return t.observer&&t.observer.observe(document.body,Ce)};document.body?r():S.addEventListener("DOMContentLoaded",r)},e.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),K.forEach(function(r){return S.addEventListener(r,t.listener,!0)}))},e.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),K.forEach(function(r){return S.removeEventListener(r,t.listener,!0)}),this.stopped=!0)},e}(),q=new ke,Z=function(e){!M&&e>0&&q.start(),M+=e,!M&&q.stop()},De=function(e){return!F(e)&&!me(e)&&getComputedStyle(e).display==="inline"},Ie=function(){function e(t,r){this.target=t,this.observedBox=r||C.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var t=ie(this.target,this.observedBox,!0);return De(this.target)&&(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),Ae=function(){function e(t,r){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=r}return e}(),A=new WeakMap,j=function(e,t){for(var r=0;r<e.length;r+=1)if(e[r].target===t)return r;return-1},L=function(){function e(){}return e.connect=function(t,r){var n=new Ae(t,r);A.set(t,n)},e.observe=function(t,r,n){var i=A.get(t),a=i.observationTargets.length===0;j(i.observationTargets,r)<0&&(a&&E.push(i),i.observationTargets.push(new Ie(r,n&&n.box)),Z(1),q.schedule())},e.unobserve=function(t,r){var n=A.get(t),i=j(n.observationTargets,r),a=n.observationTargets.length===1;i>=0&&(a&&E.splice(E.indexOf(n),1),n.observationTargets.splice(i,1),Z(-1))},e.disconnect=function(t){var r=this,n=A.get(t);n.observationTargets.slice().forEach(function(i){return r.unobserve(t,i.target)}),n.activeTargets.splice(0,n.activeTargets.length)},e}(),Le=function(){function e(t){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof t!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");L.connect(this,t)}return e.prototype.observe=function(t,r){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!X(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");L.observe(this,t,r)},e.prototype.unobserve=function(t){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!X(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");L.unobserve(this,t)},e.prototype.disconnect=function(){L.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}();const Me=u.aBox`
2
+ ${u.th("breadcrumbs.item.default")};
3
+ align-items: center;
4
+ transition: medium;
5
+ direction: initial;
6
+
7
+ &:hover {
8
+ ${u.th("breadcrumbs.item.hover")};
9
+ }
10
+
11
+ &[aria-current='page'] {
12
+ ${u.th("breadcrumbs.item.active")};
13
+ }
14
+
15
+ &[aria-disabled='true'] {
16
+ pointer-events: none;
17
+ cursor: default;
18
+ }
19
+ `,Ne=u.spanBox`
20
+ ${u.th("breadcrumbs.separator")};
21
+ display: flex;
22
+ align-items: center;
23
+ `,$e=ee.forwardRef(({children:e,dataTestId:t,isActive:r,separator:n,...i},a)=>{const o=i.href||i.to;return s.createElement(fe.Box,{"aria-label":"breadcrumb",as:"li","data-testid":t,display:"inline-flex",flex:"0 0 auto",lineHeight:"normal"},n&&s.createElement(Ne,{role:"presentation"},n),s.createElement(Me,{"aria-current":r?"page":void 0,"aria-disabled":!o,...i,ref:a},e))}),ae=u.spanBox(({gradientBackground:e,theme:t})=>u.css`
24
+ left: 0;
25
+ background-image: ${ue(t,e)};
26
+ transform-origin: left;
27
+ `),ce=u.spanBox(({gradientBackground:e,theme:t})=>u.css`
28
+ right: 0;
29
+ background-image: ${ue(t,e,"left")};
30
+ transform-origin: right;
31
+ `),We=u.divBox`
32
+ ${u.th("breadcrumbs.list")};
33
+ height: 100%;
34
+ position: relative;
35
+ overflow-x: hidden;
36
+
37
+ ${ae},
38
+ ${ce} {
39
+ position: absolute;
40
+ bottom: 0;
41
+ top: 0;
42
+ width: 30;
43
+ }
44
+ `,Pe=u.olBox`
45
+ display: inline-flex;
46
+ align-items: center;
47
+ max-width: 100%;
48
+ height: 100%;
49
+ overflow-x: auto;
50
+ margin: 0;
51
+ padding: 0;
52
+ list-style: none;
53
+ white-space: nowrap;
54
+ `,ue=(e,t,r="right")=>{const n=u.th(`colors.${t}`)({theme:e}),i=_.hexToRGBA(n,0);return`linear-gradient(to ${r}, ${n}, ${i} 100%)`},H=ee.forwardRef(({children:e,gradientBackground:t="neutral-10",lastChildNotClickable:r=!0,separator:n=s.createElement(ve.RightIcon,{size:"xs"}),...i},a)=>{const o=s.useRef(null),v=s.useRef(),f=s.useRef(),[l,y]=s.useState(!1),[h,N]=s.useState(0),k=s.Children.toArray(e).filter(Boolean),D=k.length,$=k.map((c,d)=>{const b=D===1||D===d+1,g=b&&r;return s.cloneElement(c,{key:`breadcrumb-${d}`,separator:b?void 0:n,isActive:g,...c.props})});function O(c,d){c&&(c.style.transform=`scale3d(${d}, 1, 1)`)}const x=s.useCallback(c=>{const d=1-c;O(v.current,d),O(f.current,c)},[]),B=s.useCallback(()=>{const{current:{offsetWidth:c,scrollLeft:d,scrollWidth:b}}=o,g=b-c,z=_.clamp(Math.abs(d-h),0,g)/g;x(z)},[h,x]),T=s.useMemo(()=>_.throttle(c=>{const[{target:{offsetWidth:d,scrollLeft:b,scrollWidth:g}}]=c,m=g-d;h||N(b===0?0:m),y(m>0)},300,!1),[h]);return s.useEffect(()=>{const c=new Le(T);return c.observe(o.current),()=>c.disconnect()},[]),s.useEffect(()=>{v.current&&f.current&&x(0)},[l,x]),s.createElement(We,{as:"nav",ref:a,...i},l&&s.createElement(ae,{gradientBackground:t,ref:v}),s.createElement(Pe,{dir:"rtl",onScroll:B,ref:o},$.reverse()),l&&s.createElement(ce,{gradientBackground:t,ref:f}))});H.displayName="Breadcrumb";const _e=Object.assign(H,{Item:$e});exports.Breadcrumb=_e;exports.BreadcrumbComponent=H;