welcome-ui 1.0.0-beta.6 → 1.0.0-beta.7

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 (81) hide show
  1. package/dist/{AXB53BZF-KWM2jKTz.js → AXB53BZF-CAQ85RSy.js} +1 -1
  2. package/dist/{AXB53BZF-BxNazDnS.mjs → AXB53BZF-DCqNWRx3.mjs} +2 -2
  3. package/dist/Accordion.js +1 -1
  4. package/dist/Accordion.mjs +2 -2
  5. package/dist/{BYC7LY2E-BkAEL2VD.js → BYC7LY2E-BE1a2svb.js} +1 -1
  6. package/dist/{BYC7LY2E-BAjGN7k_.mjs → BYC7LY2E-BNqcw1O8.mjs} +2 -2
  7. package/dist/Breadcrumb.js +1 -1
  8. package/dist/Breadcrumb.mjs +4 -3
  9. package/dist/CustomInput-CHhz-wtr.js +1064 -0
  10. package/dist/CustomInput-DsJYqH0X.mjs +1272 -0
  11. package/dist/DatePicker.js +1 -1
  12. package/dist/DatePicker.mjs +1 -1
  13. package/dist/DateTimePicker.js +1 -1
  14. package/dist/DateTimePicker.mjs +1 -1
  15. package/dist/DateTimePickerCommon.js +1 -1
  16. package/dist/DateTimePickerCommon.mjs +1 -1
  17. package/dist/Drawer.js +1 -1
  18. package/dist/Drawer.mjs +3 -3
  19. package/dist/DropdownMenu.js +1 -1
  20. package/dist/DropdownMenu.mjs +5 -5
  21. package/dist/FileDrop.js +1 -1
  22. package/dist/FileDrop.mjs +4 -3
  23. package/dist/{JC64G2H7-CQsqXPS_.mjs → JC64G2H7-HxATiU-t.mjs} +2 -2
  24. package/dist/{JC64G2H7-YkBMNrtl.js → JC64G2H7-VmOGyhc1.js} +1 -1
  25. package/dist/{MTZPJQMC-DZ3zg4be.mjs → MTZPJQMC-C9lHSyrL.mjs} +1 -1
  26. package/dist/{MTZPJQMC-5Xg78Uyy.js → MTZPJQMC-D0pYOjc_.js} +1 -1
  27. package/dist/Modal.js +1 -1
  28. package/dist/Modal.mjs +3 -3
  29. package/dist/{P4IRICAX-DF0_vmod.mjs → P4IRICAX-C0oIr4wI.mjs} +1 -1
  30. package/dist/{P4IRICAX-nhgZ26A1.js → P4IRICAX-t3xfwWga.js} +1 -1
  31. package/dist/Popover.js +1 -1
  32. package/dist/Popover.mjs +1 -1
  33. package/dist/{QYJ6MIDR-CRK3satR.js → QYJ6MIDR-T-fJ_t8N.js} +1 -1
  34. package/dist/{QYJ6MIDR-Cy39pEs2.mjs → QYJ6MIDR-YegHsExc.mjs} +2 -2
  35. package/dist/{SYRFVSLH-BpAfr7UE.js → SYRFVSLH-Babm193P.js} +1 -1
  36. package/dist/{SYRFVSLH-DyepaZf7.mjs → SYRFVSLH-DXZgEwus.mjs} +1 -1
  37. package/dist/Search.js +7 -7
  38. package/dist/Search.mjs +36 -36
  39. package/dist/Select.js +1 -1
  40. package/dist/Select.mjs +5 -4
  41. package/dist/Tabs.js +8 -8
  42. package/dist/Tabs.mjs +168 -173
  43. package/dist/TimePicker.js +1 -1
  44. package/dist/TimePicker.mjs +1 -1
  45. package/dist/Toast.js +1 -1
  46. package/dist/Toast.mjs +1 -1
  47. package/dist/Tooltip.js +1 -1
  48. package/dist/Tooltip.mjs +2 -2
  49. package/dist/{VEVQD5MH-mN1wMozH.js → VEVQD5MH-Cal9SWXl.js} +1 -1
  50. package/dist/{VEVQD5MH-De4r89YE.mjs → VEVQD5MH-DOp_qaPw.mjs} +1 -1
  51. package/dist/{VGCJ63VH-fv0YLRh8.mjs → VGCJ63VH-BqPfqkK_.mjs} +1 -1
  52. package/dist/{VGCJ63VH-BNLwLOaC.js → VGCJ63VH-Cuf7P3qW.js} +1 -1
  53. package/dist/WelcomeLoader.js +1 -11
  54. package/dist/WelcomeLoader.mjs +25 -5086
  55. package/dist/{index-BPNky7_R.js → index-B8roHPE-.js} +1 -1
  56. package/dist/index-BFQbRuqA.mjs +165 -0
  57. package/dist/{index-BYdkhqH4.mjs → index-BZmKn5VO.mjs} +11 -14
  58. package/dist/index-BjGfAqCk.mjs +209 -0
  59. package/dist/{index-BHi0wohR.js → index-CQyLvMJP.js} +23 -23
  60. package/dist/{index-DG4lwZUW.mjs → index-Cjf3wLkx.mjs} +3 -3
  61. package/dist/index-CmBs24Im.mjs +413 -0
  62. package/dist/index-DG7ovxHW.js +117 -0
  63. package/dist/index-DSZG0Sqy.js +54 -0
  64. package/dist/index-DhF591OM.js +42 -0
  65. package/dist/index.js +7 -7
  66. package/dist/index.mjs +2154 -2216
  67. package/dist/{usePopover-Bbhh3p_j.mjs → usePopover-AbS2gpZq.mjs} +2 -2
  68. package/dist/{usePopover-PCWsuJNF.js → usePopover-CzPtX0h_.js} +1 -1
  69. package/package.json +1 -1
  70. package/dist/CustomInput-DUq7mNvC.mjs +0 -7826
  71. package/dist/CustomInput-NV_j0IWq.js +0 -1070
  72. package/dist/downshift.esm-DAo-GJwH.js +0 -1
  73. package/dist/downshift.esm-K4YLLQXl.mjs +0 -1085
  74. package/dist/index-BLom3M2B.js +0 -2
  75. package/dist/index-BZq8PyIk.js +0 -46
  76. package/dist/index-CGZVoNIN.mjs +0 -1077
  77. package/dist/index-DPMCsVtB.js +0 -54
  78. package/dist/index-R0G4mc9j.mjs +0 -2347
  79. package/dist/index-SbQUT2mU.mjs +0 -639
  80. package/dist/index-_oF_K5ZN.js +0 -122
  81. package/dist/index-mPb8TbpM.mjs +0 -447
@@ -1,122 +0,0 @@
1
- "use client";"use strict";const a=require("react"),de=require("./downshift.esm-DAo-GJwH.js"),Ye=require("./_commonjsHelpers-DvH0V_XJ.js"),Ae=require("./Icon.js"),Ze=require("./ClearButton.js"),M=require("./System.js"),ze=require("./create-event-YSlay9Ef.js"),ye=require("./field-styles-D_gf6ypV.js"),ve=require("./Tag.js"),u=require("@xstyled/styled-components"),Qe=require("./Field.js"),Q=require("./overflow-ellipsis-C2ESrF8C.js"),Xe=require("./Box.js"),Ge=15,Je=15,et='<path fill="currentColor" fill-rule="evenodd" d="M50 71a4.399 4.399 0 0 1-2.936-1.119L17.49 43.552a4.468 4.468 0 0 1-.377-6.283 4.416 4.416 0 0 1 6.253-.379l26.278 23.397 26.632-29.81a4.412 4.412 0 0 1 6.253-.338 4.464 4.464 0 0 1 .337 6.283l-29.57 33.1A4.412 4.412 0 0 1 49.998 71Z" clip-rule="evenodd"/>',tt={width:Ge,height:Je,block:et},be=e=>a.createElement(Ae.Icon,{alt:"Down",content:tt,...e});var P={exports:{}},Ce={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ả:"A",Ạ:"A",Ẩ:"A",Ẫ:"A",Ậ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ẻ:"E",Ẽ:"E",Ẹ:"E",Ể:"E",Ễ:"E",Ệ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ỉ:"I",Ị:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ỏ:"O",Ọ:"O",Ổ:"O",Ỗ:"O",Ộ:"O",Ờ:"O",Ở:"O",Ỡ:"O",Ớ:"O",Ợ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ủ:"U",Ụ:"U",Ử:"U",Ữ:"U",Ự:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ả:"a",ạ:"a",ẩ:"a",ẫ:"a",ậ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ẻ:"e",ẽ:"e",ẹ:"e",ể:"e",ễ:"e",ệ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ỉ:"i",ị:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ỏ:"o",ọ:"o",ổ:"o",ỗ:"o",ộ:"o",ờ:"o",ở:"o",ỡ:"o",ớ:"o",ợ:"o",ù:"u",ú:"u",û:"u",ü:"u",ủ:"u",ụ:"u",ử:"u",ữ:"u",ự:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z",й:"и",Й:"И",ё:"е",Ё:"Е"},we=Object.keys(Ce).join("|"),nt=new RegExp(we,"g"),rt=new RegExp(we,"");function ot(e){return Ce[e]}var Oe=function(e){return e.replace(nt,ot)},st=function(e){return!!e.match(rt)};P.exports=Oe;P.exports.has=st;P.exports.remove=Oe;var lt=P.exports;const at=Ye.getDefaultExportFromCjs(lt);/**
2
- * @name match-sorter
3
- * @license MIT license.
4
- * @copyright (c) 2020 Kent C. Dodds
5
- * @author Kent C. Dodds <me@kentcdodds.com> (https://kentcdodds.com)
6
- */const E={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0},it=(e,t)=>String(e.rankedValue).localeCompare(String(t.rankedValue));function X(e,t,n){n===void 0&&(n={});const{keys:r,threshold:o=E.MATCHES,baseSort:i=it,sorter:h=f=>f.sort((d,s)=>ft(d,s,i))}=n,m=e.reduce(c,[]);return h(m).map(f=>{let{item:d}=f;return d});function c(f,d,s){const p=ct(d,r,t,n),{rank:w,keyThreshold:y=o}=p;return w>=y&&f.push({...p,item:d,index:s}),f}}X.rankings=E;function ct(e,t,n,r){if(!t){const i=e;return{rankedValue:i,rank:fe(i,n,r),keyIndex:-1,keyThreshold:r.threshold}}return pt(e,t).reduce((i,h,m)=>{let{rank:c,rankedValue:f,keyIndex:d,keyThreshold:s}=i,{itemValue:p,attributes:w}=h,y=fe(p,n,r),R=f;const{minRanking:$,maxRanking:F,threshold:W}=w;return y<$&&y>=E.MATCHES?y=$:y>F&&(y=F),y>c&&(c=y,d=m,s=W,R=p),{rankedValue:R,rank:c,keyIndex:d,keyThreshold:s}},{rankedValue:e,rank:E.NO_MATCH,keyIndex:-1,keyThreshold:r.threshold})}function fe(e,t,n){return e=he(e,n),t=he(t,n),t.length>e.length?E.NO_MATCH:e===t?E.CASE_SENSITIVE_EQUAL:(e=e.toLowerCase(),t=t.toLowerCase(),e===t?E.EQUAL:e.startsWith(t)?E.STARTS_WITH:e.includes(` ${t}`)?E.WORD_STARTS_WITH:e.includes(t)?E.CONTAINS:t.length===1?E.NO_MATCH:ut(e).includes(t)?E.ACRONYM:dt(e,t))}function ut(e){let t="";return e.split(" ").forEach(r=>{r.split("-").forEach(i=>{t+=i.substr(0,1)})}),t}function dt(e,t){let n=0,r=0;function o(c,f,d){for(let s=d,p=f.length;s<p;s++)if(f[s]===c)return n+=1,s+1;return-1}function i(c){const f=1/c,d=n/t.length;return E.MATCHES+d*f}const h=o(t[0],e,0);if(h<0)return E.NO_MATCH;r=h;for(let c=1,f=t.length;c<f;c++){const d=t[c];if(r=o(d,e,r),!(r>-1))return E.NO_MATCH}const m=r-h;return i(m)}function ft(e,t,n){const{rank:i,keyIndex:h}=e,{rank:m,keyIndex:c}=t;return i===m?h===c?n(e,t):h<c?-1:1:i>m?-1:1}function he(e,t){let{keepDiacritics:n}=t;return e=`${e}`,n||(e=at(e)),e}function ht(e,t){typeof t=="object"&&(t=t.key);let n;if(typeof t=="function")n=t(e);else if(e==null)n=null;else if(Object.hasOwnProperty.call(e,t))n=e[t];else{if(t.includes("."))return mt(t,e);n=null}return n==null?[]:Array.isArray(n)?n:[String(n)]}function mt(e,t){const n=e.split(".");let r=[t];for(let o=0,i=n.length;o<i;o++){const h=n[o];let m=[];for(let c=0,f=r.length;c<f;c++){const d=r[c];if(d!=null)if(Object.hasOwnProperty.call(d,h)){const s=d[h];s!=null&&m.push(s)}else h==="*"&&(m=m.concat(d))}r=m}return Array.isArray(r[0])?[].concat(...r):r}function pt(e,t){const n=[];for(let r=0,o=t.length;r<o;r++){const i=t[r],h=gt(i),m=ht(e,i);for(let c=0,f=m.length;c<f;c++)n.push({itemValue:m[c],attributes:h})}return n}const me={maxRanking:1/0,minRanking:-1/0};function gt(e){return typeof e=="string"?me:{...me,...e}}const J="",Se=e=>{if(typeof e=="number")return String(e);if(typeof e=="string"){const t=e.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g);return t&&t.map(n=>n.toLowerCase()).join("-")}},pe=e=>e?e.label:J,It=e=>e.reduce((t,n)=>n.label&&t.length>n.label.length?t:n.label,J),Et=(e,t,n)=>{const r=t.find(o=>e.value===o.value);return r&&n?t.filter(o=>e.value!==o.value):r?t:[...t,e]},Z=(e,t)=>!!t.find(n=>n.value===e),G=(e,t=[])=>t.find(r=>r.label===(e.label||e)||r.value===(e.value||e))||{value:Se(e),label:e},At=(e,t,n=!1)=>{const r=n?t.flatMap(o=>o.options):t;return!e&&e!==0?[]:Array.isArray(e)?e.map(o=>G(o,r)):[G(e,r)]},yt=(e,t)=>!!t.find(n=>n.value===e.value),vt=(e,t)=>yt(e,t)?e.value:e.label,ge=(e,t)=>{if(e)return e.map(n=>vt(n,t))},bt=(e,t)=>{if(e)return e.filter(n=>!t.find(r=>r.value===n.value))},Ct=({inputValue:e,isMultiple:t,isSearchable:n,options:r,renderItem:o})=>{const i=G(e,r);return t?e:i.label?n?i.label:o(i):J},ke=u(Qe.IconWrapper)``,xe=u(Xe.Box).withConfig({shouldForwardProp:M.shouldForwardProp})(({disabled:e})=>u.css`
7
- position: relative;
8
- ${u.system}
9
- ${ke} {
10
- color: ${e?u.th("defaultFields.select.disabled.color"):"initial"};
11
- }
12
- `),wt=u.div`
13
- position: relative;
14
- `,Ie=u("div").withConfig({shouldForwardProp:M.shouldForwardProp})(({iconPlacement:e,isClearable:t,size:n,transparent:r,variant:o})=>u.css`
15
- position: relative;
16
- ${ye.defaultFieldStyles({size:n,variant:o,transparent:r,isClearable:t,iconPlacement:e})};
17
- ${Q.overflowEllipsis};
18
- cursor: pointer;
19
- ${u.system}
20
- line-height: 1em;
21
-
22
- br {
23
- display: none;
24
- }
25
-
26
- &::before {
27
- content: attr(data-spacer);
28
- visibility: hidden;
29
- display: block;
30
- height: 0;
31
- }
32
-
33
- &:empty {
34
- &::after {
35
- content: attr(placeholder);
36
- position: absolute;
37
- top: 0;
38
- right: 0;
39
- bottom: 0;
40
- left: 0;
41
- ${Q.overflowEllipsis};
42
- padding: inherit;
43
- ${u.th("defaultFields.placeholder")}
44
- }
45
- &::before {
46
- height: auto;
47
- }
48
- }
49
- `),Ot=u.ul`
50
- ${u.th("defaultFields.select.default")};
51
- ${u.th("cards.default")};
52
- position: absolute;
53
- z-index: 2;
54
- right: 0;
55
- left: 0;
56
- margin: 0;
57
- margin-top: md;
58
- padding: 0;
59
- transition: medium;
60
- overflow: auto;
61
- -webkit-overflow-scrolling: touch;
62
-
63
- &:hover > * {
64
- cursor: pointer;
65
- }
66
- `,z=u.li(({allowUnselectFromList:e,isDisabled:t,isHighlighted:n,isMultiple:r,isSelected:o})=>u.css`
67
- color: beige-70;
68
- ${n&&u.th("defaultFields.select.highlighted")};
69
- ${o&&!r&&u.th("defaultFields.select.selected")};
70
- ${o&&r&&!e&&u.th("defaultFields.select.existing")};
71
- ${t&&u.th("defaultFields.select.disabled")};
72
- ${Q.overflowEllipsis};
73
- padding: md;
74
- list-style: none;
75
- text-decoration: none;
76
- font-size: sm;
77
- transition: background ${u.th.transition("medium")};
78
- `),St=u.divBox(({size:e})=>u.css`
79
- position: absolute;
80
- padding: 0;
81
- top: 0;
82
- bottom: 0;
83
- right: ${e==="xs"?"sm":"md"};
84
- display: flex;
85
- gap: xs;
86
- `),Ee=u.button.withConfig({shouldForwardProp:M.shouldForwardProp})(({isOpen:e})=>u.css`
87
- position: relative;
88
- height: 100%;
89
- padding: 0;
90
- outline: none !important; /* important for firefox */
91
- appearance: none;
92
- cursor: pointer;
93
- border: none;
94
- background: transparent;
95
- display: flex;
96
- align-items: center;
97
- justify-content: center;
98
-
99
- ${Ae.StyledIcon} {
100
- transform: ${e?"rotate3d(0, 0, 1, 180deg)":"rotate3d(0)"};
101
- transition: medium;
102
- }
103
-
104
- &:not(:last-child) {
105
- width: auto;
106
- }
107
-
108
- &:disabled {
109
- color: ${u.th("defaultFields.select.disabled.color")};
110
- }
111
- `),kt=u.divBox`
112
- margin-top: lg;
113
-
114
- ${ve.StyledTag}:not(:last-child) {
115
- margin-right: sm;
116
- margin-bottom: sm;
117
- }
118
-
119
- &:empty {
120
- display: none;
121
- }
122
- `;function xt(e,t){return a.createElement(kt,{role:"list"},e.map(n=>a.createElement(ve.Tag,{key:n.value,onRemove:()=>t(n.value.toString()),role:"listitem"},n.label)))}const Tt=de.Downshift$1.default||de.Downshift$1,Vt=M.forwardRef(({allowUnselectFromList:e,autoComplete:t="off",autoFocus:n,dataTestId:r,disableCloseOnSelect:o,disabled:i,groupsEnabled:h,icon:m,id:c,isClearable:f,isCreatable:d,isMultiple:s,isSearchable:p,name:w,onBlur:y,onChange:R,onClick:$,onCreate:F,onFocus:W,options:A=[],placeholder:ee="Choose from…",renderCreateItem:Te=k=>`Create "${k}"`,renderGroupHeader:Ve,renderItem:j=pe,renderMultiple:Ue=xt,size:D="md",transparent:Re,value:te,variant:$e,...ne},H)=>{const k=a.useMemo(()=>At(te,A,h),[te,A,h]),B=!s&&k[0]||null,K=B?B.label:"",[O,L]=a.useState(k),[b,N]=a.useState(K),[_,q]=a.useState(A),[S,x]=a.useState(!1);p=d||p,a.useEffect(()=>{var l;n&&((l=H==null?void 0:H.current)==null||l.focus(),p&&x(!0))},[p,n,H]),a.useEffect(()=>{L(k),N(K),q(A)},[K,A,k]);const Fe=l=>{if(p&&l!==b){let g=[];h?g=X(A,l,{keys:[I=>I.label,I=>I.options.map(T=>T.label)]}):g=X(A,l,{keys:["label"]}),N(l),q(g)}},He=()=>{p&&!S&&x(!0)},re=l=>{let g=[];h?g=ge(l,A.flatMap(V=>V.options)):g=ge(l,A);const I=s?g:g[0],T=ze.createEvent({name:w,value:s?l:l[0]});if(R&&R(I,T),d){const V=bt(l,A);V.length&&F&&F(V[0].label,T)}},Ne=l=>{let g,I;!l||l!=null&&l.disabled?(g=s?O:[],I=!0):(g=s?Et(l,O,e):[l],I=s),I&&N(""),q(A),L(g),re(g),o||x(!1)},De=l=>{const g=O.filter(I=>I.value!==l);L(g),re(g)},_e=l=>{s&&l.selectedItem?N(""):p&&l.selectedItem&&N(l.selectedItem.label),q(A),x(!1)},qe=It(A),oe=Ct({inputValue:b,isMultiple:s,isSearchable:p,options:A,renderItem:j});return a.createElement(Tt,{id:c,inputValue:p?oe:"",isOpen:S,itemToString:pe,onInputValueChange:Fe,onOuterClick:_e,onSelect:Ne,selectedItem:B},({clearSelection:l,getInputProps:g,getItemProps:I,getMenuProps:T,getRootProps:V,getToggleButtonProps:Me,highlightedIndex:Y})=>{const se=!!(d&&b&&!Z(b,O)),Pe=S&&(_.length||se),We=f&&b,je=a.createElement(Ee,{as:"div"},a.createElement(Ze.ClearButton,{onClick:l})),Be=a.createElement(Ee,{"data-testid":r&&`${r}-arrow-icon`,disabled:i,isOpen:S,size:D,tabIndex:-1,...Me({onClick:()=>x(!S)})},a.createElement(be,{size:"sm"})),Ke=U=>{$&&$(U),x(!S)},Le=V(ne),le=g({autoComplete:t,autoFocus:n,"data-spacer":qe||ee,"data-testid":r,disabled:i,iconPlacement:m?"both":"right",id:c,name:w,onBlur:y,onClick:i?void 0:Ke,onFocus:W,onKeyDown:He,placeholder:ee,ref:H,size:D,tabIndex:0,variant:S?"focused":$e,isClearable:f,transparent:Re,...ne}),ae=ye.FIELD_ICON_SIZE[D];return a.createElement(xe,{...Le,disabled:i},a.createElement(wt,null,p?a.createElement(Ie,{as:"input",type:"text",...le}):a.createElement(Ie,{...le},oe),m&&a.createElement(ke,{iconPlacement:"left",size:ae},a.cloneElement(m,{...m.props,size:ae})),a.createElement(St,{size:D},We&&je,Be)),Pe&&a.createElement(Ot,{...T()},_.reduce((U,v,ie)=>{if(h&&"options"in v)U.itemsToRender.push(a.createElement(a.Fragment,{key:v.label},Ve(v),v.options&&v.options.map(C=>{const ce=U.itemIndex++,ue=Z(C.value,O);return a.createElement(z,{allowUnselectFromList:e,isDisabled:C.disabled,isHighlighted:Y===ce,isMultiple:s,key:C.value,...I({index:ce,isSelected:ue,item:C})},j(C,ue))})));else if("value"in v){const C=Z(v.value,O);U.itemsToRender.push(a.createElement(z,{allowUnselectFromList:e,isDisabled:v.disabled,isHighlighted:Y===ie,isMultiple:s,key:v.value,...I({index:ie,isSelected:C,item:v})},j(v,C)))}return U},{itemsToRender:[],itemIndex:0}).itemsToRender,se&&b.length&&a.createElement(z,{isHighlighted:Y===_.length,key:"add",...I({index:_.length,item:{value:Se(b),label:b}})},Te(b))),s&&Ue(O,De))})}),Ut=xe;exports.DownIcon=be;exports.Select=Vt;exports.StyledSelect=Ut;
@@ -1,447 +0,0 @@
1
- "use client";
2
- import g, { useRef as _, useState as q, Children as me, cloneElement as xe, useCallback as J, useMemo as Ee, useEffect as U } from "react";
3
- import "./Icon.mjs";
4
- import { R as Re } from "./index-BRDOakbf.mjs";
5
- import { forwardRef as ie } from "./System.mjs";
6
- import { t as we } from "./throttle-BDBzFeFj.mjs";
7
- import { Box as ze } from "./Box.mjs";
8
- import B, { th as w, css as oe } from "@xstyled/styled-components";
9
- var x = [], Be = function() {
10
- return x.some(function(e) {
11
- return e.activeTargets.length > 0;
12
- });
13
- }, Oe = function() {
14
- return x.some(function(e) {
15
- return e.skippedTargets.length > 0;
16
- });
17
- }, Y = "ResizeObserver loop completed with undelivered notifications.", ye = function() {
18
- var e;
19
- typeof ErrorEvent == "function" ? e = new ErrorEvent("error", {
20
- message: Y
21
- }) : (e = document.createEvent("Event"), e.initEvent("error", !1, !1), e.message = Y), window.dispatchEvent(e);
22
- }, $;
23
- (function(e) {
24
- e.BORDER_BOX = "border-box", e.CONTENT_BOX = "content-box", e.DEVICE_PIXEL_CONTENT_BOX = "device-pixel-content-box";
25
- })($ || ($ = {}));
26
- var E = function(e) {
27
- return Object.freeze(e);
28
- }, Te = /* @__PURE__ */ function() {
29
- function e(t, r) {
30
- this.inlineSize = t, this.blockSize = r, E(this);
31
- }
32
- return e;
33
- }(), se = function() {
34
- function e(t, r, n, i) {
35
- 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, E(this);
36
- }
37
- return e.prototype.toJSON = function() {
38
- var t = this, r = t.x, n = t.y, i = t.top, s = t.right, o = t.bottom, l = t.left, d = t.width, c = t.height;
39
- return { x: r, y: n, top: i, right: s, bottom: o, left: l, width: d, height: c };
40
- }, e.fromRect = function(t) {
41
- return new e(t.x, t.y, t.width, t.height);
42
- }, e;
43
- }(), V = function(e) {
44
- return e instanceof SVGElement && "getBBox" in e;
45
- }, ae = function(e) {
46
- if (V(e)) {
47
- var t = e.getBBox(), r = t.width, n = t.height;
48
- return !r && !n;
49
- }
50
- var i = e, s = i.offsetWidth, o = i.offsetHeight;
51
- return !(s || o || e.getClientRects().length);
52
- }, K = function(e) {
53
- var t;
54
- if (e instanceof Element)
55
- return !0;
56
- var r = (t = e == null ? void 0 : e.ownerDocument) === null || t === void 0 ? void 0 : t.defaultView;
57
- return !!(r && e instanceof r.Element);
58
- }, Se = function(e) {
59
- switch (e.tagName) {
60
- case "INPUT":
61
- if (e.type !== "image")
62
- break;
63
- case "VIDEO":
64
- case "AUDIO":
65
- case "EMBED":
66
- case "OBJECT":
67
- case "CANVAS":
68
- case "IFRAME":
69
- case "IMG":
70
- return !0;
71
- }
72
- return !1;
73
- }, C = typeof window < "u" ? window : {}, A = /* @__PURE__ */ new WeakMap(), Q = /auto|scroll/, Ce = /^tb|vertical/, $e = /msie|trident/i.test(C.navigator && C.navigator.userAgent), v = function(e) {
74
- return parseFloat(e || "0");
75
- }, z = function(e, t, r) {
76
- return e === void 0 && (e = 0), t === void 0 && (t = 0), r === void 0 && (r = !1), new Te((r ? t : e) || 0, (r ? e : t) || 0);
77
- }, Z = E({
78
- devicePixelContentBoxSize: z(),
79
- borderBoxSize: z(),
80
- contentBoxSize: z(),
81
- contentRect: new se(0, 0, 0, 0)
82
- }), ce = function(e, t) {
83
- if (t === void 0 && (t = !1), A.has(e) && !t)
84
- return A.get(e);
85
- if (ae(e))
86
- return A.set(e, Z), Z;
87
- var r = getComputedStyle(e), n = V(e) && e.ownerSVGElement && e.getBBox(), i = !$e && r.boxSizing === "border-box", s = Ce.test(r.writingMode || ""), o = !n && Q.test(r.overflowY || ""), l = !n && Q.test(r.overflowX || ""), d = n ? 0 : v(r.paddingTop), c = n ? 0 : v(r.paddingRight), O = n ? 0 : v(r.paddingBottom), f = n ? 0 : v(r.paddingLeft), N = n ? 0 : v(r.borderTopWidth), k = n ? 0 : v(r.borderRightWidth), D = n ? 0 : v(r.borderBottomWidth), W = n ? 0 : v(r.borderLeftWidth), y = f + c, m = d + O, T = W + k, S = N + D, a = l ? e.offsetHeight - S - e.clientHeight : 0, u = o ? e.offsetWidth - T - e.clientWidth : 0, h = i ? y + T : 0, p = i ? m + S : 0, b = n ? n.width : v(r.width) - h - u, R = n ? n.height : v(r.height) - p - a, be = b + y + u + T, ge = R + m + a + S, X = E({
88
- devicePixelContentBoxSize: z(Math.round(b * devicePixelRatio), Math.round(R * devicePixelRatio), s),
89
- borderBoxSize: z(be, ge, s),
90
- contentBoxSize: z(b, R, s),
91
- contentRect: new se(f, d, b, R)
92
- });
93
- return A.set(e, X), X;
94
- }, ue = function(e, t, r) {
95
- var n = ce(e, r), i = n.borderBoxSize, s = n.contentBoxSize, o = n.devicePixelContentBoxSize;
96
- switch (t) {
97
- case $.DEVICE_PIXEL_CONTENT_BOX:
98
- return o;
99
- case $.BORDER_BOX:
100
- return i;
101
- default:
102
- return s;
103
- }
104
- }, ke = /* @__PURE__ */ function() {
105
- function e(t) {
106
- var r = ce(t);
107
- this.target = t, this.contentRect = r.contentRect, this.borderBoxSize = E([r.borderBoxSize]), this.contentBoxSize = E([r.contentBoxSize]), this.devicePixelContentBoxSize = E([r.devicePixelContentBoxSize]);
108
- }
109
- return e;
110
- }(), le = function(e) {
111
- if (ae(e))
112
- return 1 / 0;
113
- for (var t = 0, r = e.parentNode; r; )
114
- t += 1, r = r.parentNode;
115
- return t;
116
- }, De = function() {
117
- var e = 1 / 0, t = [];
118
- x.forEach(function(o) {
119
- if (o.activeTargets.length !== 0) {
120
- var l = [];
121
- o.activeTargets.forEach(function(c) {
122
- var O = new ke(c.target), f = le(c.target);
123
- l.push(O), c.lastReportedSize = ue(c.target, c.observedBox), f < e && (e = f);
124
- }), t.push(function() {
125
- o.callback.call(o.observer, l, o.observer);
126
- }), o.activeTargets.splice(0, o.activeTargets.length);
127
- }
128
- });
129
- for (var r = 0, n = t; r < n.length; r++) {
130
- var i = n[r];
131
- i();
132
- }
133
- return e;
134
- }, j = function(e) {
135
- x.forEach(function(r) {
136
- r.activeTargets.splice(0, r.activeTargets.length), r.skippedTargets.splice(0, r.skippedTargets.length), r.observationTargets.forEach(function(i) {
137
- i.isActive() && (le(i.target) > e ? r.activeTargets.push(i) : r.skippedTargets.push(i));
138
- });
139
- });
140
- }, Ae = function() {
141
- var e = 0;
142
- for (j(e); Be(); )
143
- e = De(), j(e);
144
- return Oe() && ye(), e > 0;
145
- }, P, de = [], Ie = function() {
146
- return de.splice(0).forEach(function(e) {
147
- return e();
148
- });
149
- }, Le = function(e) {
150
- if (!P) {
151
- var t = 0, r = document.createTextNode(""), n = { characterData: !0 };
152
- new MutationObserver(function() {
153
- return Ie();
154
- }).observe(r, n), P = function() {
155
- r.textContent = "".concat(t ? t-- : t++);
156
- };
157
- }
158
- de.push(e), P();
159
- }, Me = function(e) {
160
- Le(function() {
161
- requestAnimationFrame(e);
162
- });
163
- }, M = 0, Ne = function() {
164
- return !!M;
165
- }, We = 250, _e = { attributes: !0, characterData: !0, childList: !0, subtree: !0 }, ee = [
166
- "resize",
167
- "load",
168
- "transitionend",
169
- "animationend",
170
- "animationstart",
171
- "animationiteration",
172
- "keyup",
173
- "keydown",
174
- "mouseup",
175
- "mousedown",
176
- "mouseover",
177
- "mouseout",
178
- "blur",
179
- "focus"
180
- ], te = function(e) {
181
- return e === void 0 && (e = 0), Date.now() + e;
182
- }, F = !1, Pe = function() {
183
- function e() {
184
- var t = this;
185
- this.stopped = !0, this.listener = function() {
186
- return t.schedule();
187
- };
188
- }
189
- return e.prototype.run = function(t) {
190
- var r = this;
191
- if (t === void 0 && (t = We), !F) {
192
- F = !0;
193
- var n = te(t);
194
- Me(function() {
195
- var i = !1;
196
- try {
197
- i = Ae();
198
- } finally {
199
- if (F = !1, t = n - te(), !Ne())
200
- return;
201
- i ? r.run(1e3) : t > 0 ? r.run(t) : r.start();
202
- }
203
- });
204
- }
205
- }, e.prototype.schedule = function() {
206
- this.stop(), this.run();
207
- }, e.prototype.observe = function() {
208
- var t = this, r = function() {
209
- return t.observer && t.observer.observe(document.body, _e);
210
- };
211
- document.body ? r() : C.addEventListener("DOMContentLoaded", r);
212
- }, e.prototype.start = function() {
213
- var t = this;
214
- this.stopped && (this.stopped = !1, this.observer = new MutationObserver(this.listener), this.observe(), ee.forEach(function(r) {
215
- return C.addEventListener(r, t.listener, !0);
216
- }));
217
- }, e.prototype.stop = function() {
218
- var t = this;
219
- this.stopped || (this.observer && this.observer.disconnect(), ee.forEach(function(r) {
220
- return C.removeEventListener(r, t.listener, !0);
221
- }), this.stopped = !0);
222
- }, e;
223
- }(), G = new Pe(), re = function(e) {
224
- !M && e > 0 && G.start(), M += e, !M && G.stop();
225
- }, Fe = function(e) {
226
- return !V(e) && !Se(e) && getComputedStyle(e).display === "inline";
227
- }, He = function() {
228
- function e(t, r) {
229
- this.target = t, this.observedBox = r || $.CONTENT_BOX, this.lastReportedSize = {
230
- inlineSize: 0,
231
- blockSize: 0
232
- };
233
- }
234
- return e.prototype.isActive = function() {
235
- var t = ue(this.target, this.observedBox, !0);
236
- return Fe(this.target) && (this.lastReportedSize = t), this.lastReportedSize.inlineSize !== t.inlineSize || this.lastReportedSize.blockSize !== t.blockSize;
237
- }, e;
238
- }(), Ge = /* @__PURE__ */ function() {
239
- function e(t, r) {
240
- this.activeTargets = [], this.skippedTargets = [], this.observationTargets = [], this.observer = t, this.callback = r;
241
- }
242
- return e;
243
- }(), I = /* @__PURE__ */ new WeakMap(), ne = function(e, t) {
244
- for (var r = 0; r < e.length; r += 1)
245
- if (e[r].target === t)
246
- return r;
247
- return -1;
248
- }, L = function() {
249
- function e() {
250
- }
251
- return e.connect = function(t, r) {
252
- var n = new Ge(t, r);
253
- I.set(t, n);
254
- }, e.observe = function(t, r, n) {
255
- var i = I.get(t), s = i.observationTargets.length === 0;
256
- ne(i.observationTargets, r) < 0 && (s && x.push(i), i.observationTargets.push(new He(r, n && n.box)), re(1), G.schedule());
257
- }, e.unobserve = function(t, r) {
258
- var n = I.get(t), i = ne(n.observationTargets, r), s = n.observationTargets.length === 1;
259
- i >= 0 && (s && x.splice(x.indexOf(n), 1), n.observationTargets.splice(i, 1), re(-1));
260
- }, e.disconnect = function(t) {
261
- var r = this, n = I.get(t);
262
- n.observationTargets.slice().forEach(function(i) {
263
- return r.unobserve(t, i.target);
264
- }), n.activeTargets.splice(0, n.activeTargets.length);
265
- }, e;
266
- }(), Ve = function() {
267
- function e(t) {
268
- if (arguments.length === 0)
269
- throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");
270
- if (typeof t != "function")
271
- throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");
272
- L.connect(this, t);
273
- }
274
- return e.prototype.observe = function(t, r) {
275
- if (arguments.length === 0)
276
- throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");
277
- if (!K(t))
278
- throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");
279
- L.observe(this, t, r);
280
- }, e.prototype.unobserve = function(t) {
281
- if (arguments.length === 0)
282
- throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");
283
- if (!K(t))
284
- throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");
285
- L.unobserve(this, t);
286
- }, e.prototype.disconnect = function() {
287
- L.disconnect(this);
288
- }, e.toString = function() {
289
- return "function ResizeObserver () { [polyfill code] }";
290
- }, e;
291
- }();
292
- const Xe = (e, t, r) => Math.min(Math.max(e, t), r), qe = B.aBox`
293
- ${w("breadcrumbs.item.default")};
294
- align-items: center;
295
- transition: medium;
296
- direction: initial;
297
-
298
- &:hover {
299
- ${w("breadcrumbs.item.hover")};
300
- }
301
-
302
- &[aria-current='page'] {
303
- ${w("breadcrumbs.item.active")};
304
- }
305
-
306
- &[aria-disabled='true'] {
307
- pointer-events: none;
308
- cursor: default;
309
- }
310
- `, Je = B.spanBox`
311
- ${w("breadcrumbs.separator")};
312
- display: flex;
313
- align-items: center;
314
- `, Ue = ie(
315
- ({ children: e, dataTestId: t, isActive: r, separator: n, ...i }, s) => {
316
- const o = i.href || i.to;
317
- return /* @__PURE__ */ g.createElement(
318
- ze,
319
- {
320
- "aria-label": "breadcrumb",
321
- as: "li",
322
- "data-testid": t,
323
- display: "inline-flex",
324
- flex: "0 0 auto",
325
- lineHeight: "normal"
326
- },
327
- n && /* @__PURE__ */ g.createElement(Je, { role: "presentation" }, n),
328
- /* @__PURE__ */ g.createElement(
329
- qe,
330
- {
331
- "aria-current": r ? "page" : void 0,
332
- "aria-disabled": !o,
333
- ...i,
334
- ref: s
335
- },
336
- e
337
- )
338
- );
339
- }
340
- ), H = (e, t, r) => parseInt(e.substring(t, r), 16), Ye = (e) => /(^[0-9a-fA-F]{6}$)|(^[0-9a-fA-F]{3}$)/.test(e), Ke = (e) => {
341
- if (!e || (e = e.replace("#", ""), !Ye(e)))
342
- return;
343
- e.length === 3 && (e = `${e[0]}${e[0]}${e[1]}${e[1]}${e[2]}${e[2]}`);
344
- const t = (i) => H(i, 0, 2), r = (i) => H(i, 2, 4), n = (i) => H(i, 4, 6);
345
- return `${t(e)}, ${r(e)}, ${n(e)}`;
346
- }, Qe = (e, t = 1) => e ? e.startsWith("#") ? `rgba(${Ke(e)}, ${t})` : e : void 0, fe = B.spanBox(
347
- ({ gradientBackground: e, theme: t }) => oe`
348
- left: 0;
349
- background-image: ${he(t, e)};
350
- transform-origin: left;
351
- `
352
- ), ve = B.spanBox(
353
- ({ gradientBackground: e, theme: t }) => oe`
354
- right: 0;
355
- background-image: ${he(t, e, "left")};
356
- transform-origin: right;
357
- `
358
- ), Ze = B.divBox`
359
- ${w("breadcrumbs.list")};
360
- height: 100%;
361
- position: relative;
362
- overflow-x: hidden;
363
-
364
- ${fe},
365
- ${ve} {
366
- position: absolute;
367
- bottom: 0;
368
- top: 0;
369
- width: 30;
370
- }
371
- `, je = B.olBox`
372
- display: inline-flex;
373
- align-items: center;
374
- max-width: 100%;
375
- height: 100%;
376
- overflow-x: auto;
377
- margin: 0;
378
- padding: 0;
379
- list-style: none;
380
- white-space: nowrap;
381
- `, he = (e, t, r = "right") => {
382
- const n = w(`colors.${t}`)({ theme: e }), i = Qe(n, 0);
383
- return `linear-gradient(to ${r}, ${n}, ${i} 100%)`;
384
- }, pe = ie(
385
- ({
386
- children: e,
387
- gradientBackground: t = "neutral-10",
388
- lastChildNotClickable: r = !0,
389
- separator: n = /* @__PURE__ */ g.createElement(Re, { size: "xs" }),
390
- ...i
391
- }, s) => {
392
- const o = _(null), l = _(), d = _(), [c, O] = q(!1), [f, N] = q(0), k = me.toArray(e).filter(Boolean), D = k.length, W = k.map((a, u) => {
393
- const h = D === 1 || D === u + 1, p = h && r;
394
- return xe(a, {
395
- // eslint-disable-next-line react/no-array-index-key
396
- key: `breadcrumb-${u}`,
397
- separator: h ? void 0 : n,
398
- isActive: p,
399
- ...a.props
400
- });
401
- });
402
- function y(a, u) {
403
- a && (a.style.transform = `scale3d(${u}, 1, 1)`);
404
- }
405
- const m = J((a) => {
406
- const u = 1 - a;
407
- y(l.current, u), y(d.current, a);
408
- }, []), T = J(() => {
409
- const {
410
- current: { offsetWidth: a, scrollLeft: u, scrollWidth: h }
411
- } = o, p = h - a, R = Xe(Math.abs(u - f), 0, p) / p;
412
- m(R);
413
- }, [f, m]), S = Ee(
414
- () => we(
415
- (a) => {
416
- const [
417
- {
418
- // Is offsetWidth really needed ?
419
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
420
- // @ts-ignore
421
- target: { offsetWidth: u, scrollLeft: h, scrollWidth: p }
422
- }
423
- ] = a, b = p - u;
424
- f || N(h === 0 ? 0 : b), O(b > 0);
425
- },
426
- 300,
427
- !1
428
- ),
429
- [f]
430
- );
431
- return U(() => {
432
- const a = new Ve(S);
433
- return a.observe(o.current), () => a.disconnect();
434
- }, []), U(() => {
435
- l.current && d.current && m(0);
436
- }, [c, m]), /* @__PURE__ */ g.createElement(Ze, { as: "nav", ref: s, ...i }, c && /* @__PURE__ */ g.createElement(fe, { gradientBackground: t, ref: l }), /* @__PURE__ */ g.createElement(je, { dir: "rtl", onScroll: T, ref: o }, W.reverse()), c && /* @__PURE__ */ g.createElement(ve, { gradientBackground: t, ref: d }));
437
- }
438
- );
439
- pe.displayName = "Breadcrumb";
440
- const at = Object.assign(pe, {
441
- Item: Ue
442
- });
443
- export {
444
- pe as B,
445
- at as a,
446
- Qe as h
447
- };