@expo/styleguide-search-ui 2.2.2 → 2.2.4

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.
@@ -125,8 +125,8 @@
125
125
  }
126
126
 
127
127
  [cmdk-item] mark {
128
- color: var(--blue12);
129
- background: var(--blue4);
128
+ color: var(--blue-12);
129
+ background: var(--blue-4);
130
130
  border-radius: 2px;
131
131
  opacity: 0.85;
132
132
  }
@@ -177,11 +177,11 @@
177
177
  }
178
178
 
179
179
  html.dark-theme [cmdk-item] mark {
180
- background: var(--blue6);
180
+ background: var(--blue-6);
181
181
  }
182
182
 
183
183
  html.dark-theme [cmdk-item][data-selected='true'] mark {
184
- background: var(--blue7);
184
+ background: var(--blue-7);
185
185
  }
186
186
 
187
187
  [cmdk-list]::-webkit-scrollbar {
@@ -194,10 +194,10 @@ html.dark-theme [cmdk-item][data-selected='true'] mark {
194
194
  }
195
195
 
196
196
  [cmdk-list]::-webkit-scrollbar-thumb {
197
- background-color: var(--slate5);
197
+ background-color: var(--slate-5);
198
198
  border-radius: 10px;
199
199
  }
200
200
 
201
201
  [cmdk-list]::-webkit-scrollbar-thumb:hover {
202
- background-color: var(--slate6);
202
+ background-color: var(--slate-6);
203
203
  }
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";var e=require("cmdk"),t=require("@expo/styleguide-icons/outline/SearchSmIcon"),l=require("@expo/styleguide-icons/outline/XIcon"),a=require("lodash.groupby"),n=require("react"),r=require("@expo/styleguide"),s=require("@expo/styleguide-icons/outline/ArrowUpRightIcon"),c=require("@expo/styleguide-icons/outline/ChevronRightIcon"),m=require("@expo/styleguide-icons/custom/GithubIcon"),o=require("@sanity/client"),i=require("@sanity/image-url"),u=require("@expo/styleguide-icons/custom/PlanEnterpriseIcon"),d=require("@expo/styleguide-icons/outline/BookOpen02Icon"),p=require("@expo/styleguide-icons/outline/GraduationHat02Icon"),g=require("@expo/styleguide-icons/outline/Hash02Icon"),C=require("@expo/styleguide-icons/outline/Home02Icon");const E=({isLoading:e})=>n.createElement("div",{role:"progressbar",className:r.mergeClasses("bg-palette-blue9 h-0.5 absolute mt-[11px] left-px",e&&"animate-[searchUIBarLoader_2s_infinite_ease-in-out]")});function x(){return n.createElement(c.ChevronRightIcon,{className:"icon-xs text-icon-quaternary inline-block relative mx-1 -top-px"})}const h=()=>n.createElement(s.ArrowUpRightIcon,{className:"text-icon-tertiary self-center ml-auto shrink-0"}),v=({className:e})=>n.createElement("svg",{viewBox:"-11.5 -10.23174 23 20.46348",className:r.mergeClasses("icon-md text-icon-secondary",e)},n.createElement("circle",{cx:"0",cy:"0",r:"2.05",fill:"currentColor"}),n.createElement("g",{stroke:"currentColor",strokeWidth:"1",fill:"none"},n.createElement("ellipse",{rx:"11",ry:"4.2"}),n.createElement("ellipse",{rx:"11",ry:"4.2",transform:"rotate(60)"}),n.createElement("ellipse",{rx:"11",ry:"4.2",transform:"rotate(120)"}))),y=()=>n.createElement("svg",{width:"77",height:"19",viewBox:"0 0 2197 500",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-label":"Algolia",role:"img"},n.createElement("g",{clipPath:"url(#clip0_1_2)"},n.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1070.38 275.3V5.90999C1070.38 2.27998 1067.14 -0.480015 1063.56 0.0799852L1013.1 8.01999C1010.23 8.46999 1008.11 10.95 1008.11 13.86L1008.28 287.08C1008.28 300 1008.28 379.78 1104.25 382.57C1107.58 382.67 1110.34 379.99 1110.34 376.66V335.88C1110.34 332.92 1108.15 330.37 1105.22 330.04C1070.37 326.03 1070.37 282.47 1070.37 275.32L1070.38 275.3Z"}),n.createElement("path",{d:"M1902.56 104.73H1851.78C1848.52 104.73 1845.88 107.372 1845.88 110.63V376.73C1845.88 379.988 1848.52 382.63 1851.78 382.63H1902.56C1905.82 382.63 1908.46 379.988 1908.46 376.73V110.63C1908.46 107.372 1905.82 104.73 1902.56 104.73Z"}),n.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1851.78 71.38H1902.55C1905.81 71.38 1908.45 68.74 1908.45 65.48V5.90001C1908.45 2.28001 1905.21 -0.489988 1901.63 0.0700121L1850.86 8.02001C1847.99 8.47001 1845.87 10.94 1845.87 13.85V65.47C1845.87 68.73 1848.51 71.37 1851.77 71.37L1851.78 71.38Z"}),n.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1764.03 275.3V5.90999C1764.03 2.27998 1760.79 -0.480015 1757.21 0.0799852L1706.75 8.01999C1703.88 8.46999 1701.76 10.95 1701.76 13.86L1701.93 287.08C1701.93 300 1701.93 379.78 1797.9 382.57C1801.23 382.67 1803.99 379.99 1803.99 376.66V335.88C1803.99 332.92 1801.8 330.37 1798.87 330.04C1764.02 326.03 1764.02 282.47 1764.02 275.32L1764.03 275.3Z"}),n.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1631.95 142.72C1620.81 130.47 1607.12 121.07 1591.17 114.41C1575.25 107.88 1557.91 104.56 1539.1 104.56C1520.32 104.56 1502.95 107.73 1487.18 114.41C1471.59 121.07 1457.89 130.46 1446.42 142.72C1434.95 154.95 1426.04 169.59 1419.66 186.75C1413.28 203.92 1410.42 224.12 1410.42 245.11C1410.42 266.1 1413.61 281.98 1419.97 299.32C1426.35 316.64 1435.11 331.43 1446.42 343.68C1457.71 355.91 1471.25 365.3 1487.02 372.14C1502.79 378.97 1527.14 382.47 1539.42 382.62C1551.67 382.62 1576.2 378.8 1592.12 372.14C1608.04 365.46 1621.58 355.91 1632.9 343.68C1644.19 331.43 1652.95 316.64 1659.15 299.32C1665.37 281.98 1668.39 266.1 1668.39 245.11C1668.39 224.12 1665.05 203.92 1658.36 186.75C1651.98 169.58 1643.22 154.95 1631.93 142.72H1631.95ZM1587.52 306.47C1576.05 322.22 1559.96 330.17 1539.43 330.17C1518.88 330.17 1502.8 322.37 1491.33 306.47C1479.86 290.72 1474.12 272.46 1474.12 245.27C1474.12 218.38 1479.71 196.13 1491.18 180.4C1502.63 164.65 1518.72 156.88 1539.25 156.88C1559.8 156.88 1575.88 164.66 1587.34 180.4C1598.81 195.97 1604.7 218.38 1604.7 245.27C1604.7 272.46 1598.98 290.57 1587.51 306.47H1587.52Z"}),n.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M894.42 104.73H845.09C796.73 104.73 754.18 130.21 729.34 168.83C714.82 191.41 706.35 218.46 706.35 247.56C706.35 292.45 726.48 332.48 757.94 358.66C760.87 361.26 763.99 363.64 767.25 365.8C780.11 374.29 795.36 379.27 811.77 379.27C813 379.27 814.23 379.24 815.45 379.18C815.81 379.16 816.16 379.13 816.52 379.11C817.39 379.06 818.27 379 819.14 378.91C819.48 378.88 819.82 378.83 820.16 378.79C821.07 378.69 821.98 378.58 822.89 378.45C823.1 378.42 823.31 378.38 823.52 378.35C856.41 373.28 885.08 347.53 894.42 315.54V373.37C894.42 376.63 897.06 379.27 900.32 379.27H950.74C954 379.27 956.64 376.63 956.64 373.37V110.63C956.64 107.37 954 104.73 950.74 104.73H894.42ZM894.42 311.65C882.22 321.81 866.45 325.63 849.58 326.77C849.42 326.78 849.25 326.8 849.09 326.81C847.97 326.88 846.85 326.91 845.73 326.91C803.49 326.91 768.61 291.02 768.61 247.54C768.61 237.29 770.57 227.53 774.03 218.56C785.25 189.44 812.8 168.82 845.09 168.82H894.42V311.65Z"}),n.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2133.97 104.73H2084.64C2036.28 104.73 1993.73 130.21 1968.89 168.83C1954.37 191.41 1945.9 218.46 1945.9 247.56C1945.9 292.45 1966.03 332.48 1997.49 358.66C2000.42 361.26 2003.54 363.64 2006.8 365.8C2019.66 374.29 2034.91 379.27 2051.32 379.27C2052.55 379.27 2053.78 379.24 2055 379.18C2055.36 379.16 2055.71 379.13 2056.07 379.11C2056.94 379.06 2057.82 379 2058.69 378.91C2059.03 378.88 2059.37 378.83 2059.71 378.79C2060.62 378.69 2061.53 378.58 2062.44 378.45C2062.65 378.42 2062.86 378.38 2063.07 378.35C2095.96 373.28 2124.63 347.53 2133.97 315.54V373.37C2133.97 376.63 2136.61 379.27 2139.87 379.27H2190.29C2193.55 379.27 2196.19 376.63 2196.19 373.37V110.63C2196.19 107.37 2193.55 104.73 2190.29 104.73H2133.97ZM2133.97 311.65C2121.77 321.81 2106 325.63 2089.13 326.77C2088.97 326.78 2088.8 326.8 2088.64 326.81C2087.52 326.88 2086.4 326.91 2085.28 326.91C2043.04 326.91 2008.16 291.02 2008.16 247.54C2008.16 237.29 2010.12 227.53 2013.58 218.56C2024.8 189.44 2052.35 168.82 2084.64 168.82H2133.97V311.65Z"}),n.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1314.05 104.73H1264.72C1216.36 104.73 1173.81 130.21 1148.97 168.83C1137.18 187.17 1129.37 208.47 1126.86 231.42C1126.28 236.72 1125.98 242.1 1125.98 247.56C1125.98 253.02 1126.29 258.71 1126.91 264.15C1131.19 302.24 1150.05 335.76 1177.57 358.67C1180.5 361.27 1183.62 363.65 1186.88 365.81C1199.74 374.3 1214.99 379.28 1231.4 379.28C1249.39 379.28 1266.01 373.35 1279.56 363.31C1295.85 351.73 1308.44 334.77 1314.04 315.56V365.82H1313.93V376.9C1313.93 398.74 1308.22 415.17 1296.59 426.26C1284.98 437.34 1265.55 442.89 1238.34 442.89C1227.22 442.89 1209.55 442.3 1191.74 440.48C1188.91 440.19 1186.28 441.98 1185.47 444.7L1172.69 487.81C1171.67 491.27 1173.96 494.83 1177.52 495.34C1199.04 498.42 1220.04 500.02 1232.17 500.02C1281.08 500.02 1317.33 489.27 1341.06 467.81C1362.54 448.4 1374.21 418.92 1376.26 379.29V110.63C1376.26 107.37 1373.62 104.73 1370.36 104.73H1314.04H1314.05ZM1314.05 168.83C1314.05 168.83 1314.7 307.96 1314.05 312.19C1301.97 321.96 1286.94 325.78 1270.56 326.89C1270.4 326.9 1270.23 326.92 1270.07 326.93C1268.95 327 1267.83 327.03 1266.71 327.03C1265.39 327.03 1264.08 327 1262.77 326.93C1222.36 324.82 1188.25 289.67 1188.25 247.55C1188.25 237.3 1190.21 227.54 1193.67 218.57C1204.89 189.45 1232.44 168.83 1264.73 168.83H1314.06H1314.05Z"}),n.createElement("path",{d:"M249.83 0C113.3 0 2.00001 110.09 0.0300098 246.16C-1.96999 384.35 110.15 498.86 248.36 499.66C291.04 499.91 332.15 489.47 368.66 469.63C372.22 467.7 372.77 462.8 369.74 460.12L346.36 439.4C341.61 435.19 334.85 434 329 436.48C303.52 447.32 275.83 452.86 247.29 452.51C135.61 451.14 45.38 358.22 47.16 246.55C48.92 136.29 139.16 47.14 249.83 47.14H452.52V407.41L337.52 305.23C333.8 301.92 328.1 302.57 325.1 306.54C306.64 330.98 276.57 346.18 243.17 343.88C196.84 340.68 159.3 303.38 155.83 257.07C151.68 201.83 195.46 155.55 249.83 155.55C299.01 155.55 339.51 193.4 343.74 241.5C344.12 245.78 346.05 249.77 349.26 252.62L379.21 279.17C382.61 282.18 388 280.34 388.84 275.87C391 264.32 391.76 252.29 390.91 239.95C386.09 169.61 329.11 113.02 258.74 108.69C178.06 103.72 110.61 166.83 108.47 245.94C106.38 323.04 169.55 389.5 246.66 391.2C278.85 391.91 308.69 381.79 332.8 364.25L483.06 497.45C489.5 503.16 499.67 498.59 499.67 489.98V9.48C499.66 4.25 495.42 0 490.18 0H249.83Z"})),n.createElement("defs",null,n.createElement("clipPath",null,n.createElement("rect",{width:2196.2,height:500})))),f=()=>n.createElement("div",{className:"flex gap-4 px-4 h-11 items-center"},n.createElement("p",{className:"text-3xs text-tertiary inline-flex gap-2 items-center max-md-gutters:hidden"},n.createElement("kbd",null,"↵"),n.createElement("span",null,"to select")),n.createElement("p",{className:"text-3xs text-tertiary inline-flex gap-2 items-center max-md-gutters:hidden"},n.createElement("kbd",null,"↑"),n.createElement("kbd",null,"↓"),n.createElement("span",null,"to navigate")),n.createElement("p",{className:"text-3xs text-tertiary inline-flex gap-2 items-center max-md-gutters:hidden"},n.createElement("kbd",null,"esc"),n.createElement("span",null,"to close")),n.createElement("p",{className:"text-3xs text-tertiary inline-flex gap-2 items-center ml-auto"},n.createElement("span",null,"Search by"),n.createElement("a",{href:"https://www.algolia.com/developers/?utm_medium=referral&utm_content=powered_by&utm_source=expo.dev.com&utm_campaign=docsearch",target:"_blank"},n.createElement(y,null)))),N=o.createClient({projectId:"siias52v",dataset:"production",useCdn:!0,apiVersion:"2024-09-03"}),b=i({projectId:"siias52v",dataset:"production"});const k=async(e,t,l,a)=>{const{hits:n,libraries:r}=await t(e,a).then((e=>e.json()));l(n||r||[])},I=(e,t,l,a,n,r={})=>[`https://${t}-dsn.algolia.net/1/indexes/${a}/query`,{method:"POST",headers:{"X-Algolia-Application-Id":t,"X-Algolia-API-Key":l},body:JSON.stringify({params:`query=${e}&hitsPerPage=${n}`,highlightPreTag:"<mark>",highlightPostTag:"</mark>",...r})}],S=(e,t)=>fetch(...I(e,"QEX7PB7D46","6652d26570e8628af4601e1d78ad456b","expo",20,{facetFilters:[["version:none",`version:${t}`]]})),q=e=>fetch(...I(e,"8TDSE0OHGQ","c9c791d9d5fd7f315d7f3859b32c1f3b","react-native-v2",5,{facetFilters:[["version:current"]]})),H=e=>N.fetch(`*[_type == "post" && (title match "${e}*" || metadataDescription match "${e}*")] | order(publishAt desc)[0...10] {\n title,\n slug,\n tags,\n metadataDescription,\n mainImage\n }`),L=e=>fetch(`https://reactnative.directory/api/libraries?search=${encodeURI(e)}&limit=5`),_=(e,t)=>({dangerouslySetInnerHTML:{__html:e._highlightResult.hierarchy[`${t}`]?.value||""}}),w=(e,t=36)=>{if(!e||!e.length)return"";const l=Math.max(e.indexOf("<mark>")-t,0),a=Math.min(e.indexOf("</mark>")+t+6,e.length);return`${0!==l?"…":""}${e.substring(l,a).trim()}${a!==e.length?"…":""}`},M=(e,t=!1)=>t?{}:{dangerouslySetInnerHTML:{__html:e._highlightResult.content?.value?w(e._highlightResult.content?.value):w(e._highlightResult.hierarchy.lvl1?.value||"",82)}},R=["/versions/","/more/"],$=e=>R.some((t=>e.includes(t))),V=["/app-signing/","/build/","/build-reference/","/development/","/eas/","/eas/metadata/","/eas-update/","/submit/"],P=e=>V.some((t=>e.includes(t))),K=["/get-started/","/develop/","/deploy/","/faq/","/core-concepts/","/debugging/","/config-plugins/"],T=e=>K.some((t=>e.includes(t))),F=["/tutorial","/ui-programming/","/additional-resources/"],D=e=>F.some((t=>e.includes(t))),U=()=>/(Mac|iPhone|iPod|iPad)/i.test(navigator?.platform??navigator?.userAgentData?.platform??""),Z=(e,t)=>{if(!e||!e.length)return"";const l=e.toLowerCase().indexOf(t.toLowerCase());if(-1===l)return e;const a=l+t.length;return e.substring(0,l)+"<mark>"+e.substring(l,a)+"</mark>"+e.substring(a)},O=({children:t,url:l,isExternalLink:a,isNested:s,onSelect:c,className:m,value:o})=>{const[i,u]=n.useState(!1);return n.createElement(e.Command.Item,{className:r.mergeClasses("relative",m),value:o,"data-nested":!!s||void 0,onMouseUp:e=>{1!==e.button&&2!==e.button||(navigator.clipboard?.writeText(l),u(!0),setTimeout((()=>u(!1)),1500))},onSelect:()=>{((e,t=!1)=>{const l=document.createElement("a");t&&(l.target="_blank",l.rel="noopener noreferrer"),l.href=e,l.click()})(l,a),c&&c()},onContextMenu:e=>{e.preventDefault()}},t,i&&n.createElement("div",{className:"text-2xs font-medium absolute rounded-full px-2 right-2.5 top-[calc(50%-13px)] border-secondary bg-info text-info"},"Copied!"))},A=new Intl.NumberFormat,G=({item:e,onSelect:t,query:l})=>n.createElement(O,{value:`rnd-${e.npmPkg}`,url:e.githubUrl,isExternalLink:!0,onSelect:t},n.createElement("div",{className:"inline-flex gap-3 items-center"},n.createElement(m.GithubIcon,{className:"text-icon-secondary"}),n.createElement("div",null,n.createElement("p",{className:"text-xs font-medium",dangerouslySetInnerHTML:{__html:Z(e.npmPkg,l)}}),n.createElement("p",{className:"text-3xs text-quaternary"},A.format(e.github.stats.stars)," stars · ",A.format(e.npm.downloads)," downloads")),n.createElement(h,null))),j=({item:e,levelKey:t="lvl0"})=>e.hierarchy[t]?n.createElement(n.Fragment,null,n.createElement(x,null),n.createElement("span",{..._(e,t)})):null,B=({item:e,onSelect:t})=>{const{lvl0:l,lvl1:a,lvl2:r,lvl3:s,lvl4:c}=e.hierarchy;return n.createElement(O,{value:`rn-${e.objectID}`,url:e.url,isExternalLink:!0,onSelect:t},n.createElement("div",{className:"inline-flex gap-3 items-center"},n.createElement(v,{className:"shrink-0"}),n.createElement("div",null,c&&n.createElement(n.Fragment,null,n.createElement("p",{className:"text-xs font-medium",..._(e,"lvl4")}),n.createElement("p",{className:"text-3xs text-quaternary"},n.createElement("span",{..._(e,"lvl0")}),n.createElement(j,{item:e,levelKey:"lvl1"}),n.createElement(j,{item:e,levelKey:"lvl2"}),n.createElement(j,{item:e,levelKey:"lvl3"}))),!c&&s&&n.createElement(n.Fragment,null,n.createElement("p",{className:"text-xs font-medium",..._(e,"lvl3")}),n.createElement("p",{className:"text-3xs text-quaternary"},n.createElement("span",{..._(e,"lvl0")}),n.createElement(j,{item:e,levelKey:"lvl1"}),n.createElement(j,{item:e,levelKey:"lvl2"}))),!s&&r&&n.createElement(n.Fragment,null,n.createElement("p",{className:"text-xs font-medium",..._(e,"lvl2")}),n.createElement("p",{className:"text-3xs text-quaternary"},n.createElement("span",{..._(e,"lvl0")}),n.createElement(j,{item:e,levelKey:"lvl1"}))),!s&&!r&&a&&n.createElement(n.Fragment,null,n.createElement("p",{className:"text-xs font-medium",..._(e,"lvl1")}),n.createElement("p",{className:"text-3xs text-quaternary",..._(e,"lvl0")})),!s&&!r&&!a&&l&&n.createElement("p",{className:"text-xs font-medium",..._(e,"lvl0")}),n.createElement("p",{className:"text-2xs text-secondary",...M(e,!0)})),n.createElement(h,null)))},X=({url:e,className:t,isNested:l})=>l?n.createElement(g.Hash02Icon,{className:r.mergeClasses("icon-sm text-icon-quaternary",t)}):$(e)?n.createElement(r.DocsLogo,{className:r.mergeClasses("text-icon-secondary",t)}):P(e)?n.createElement(u.PlanEnterpriseIcon,{className:r.mergeClasses("text-icon-secondary",t)}):T(e)?n.createElement(C.Home02Icon,{className:r.mergeClasses("text-icon-secondary",t)}):D(e)?n.createElement(p.GraduationHat02Icon,{className:r.mergeClasses("text-icon-secondary",t)}):n.createElement(d.BookOpen02Icon,{className:r.mergeClasses("text-icon-secondary",t)}),Q=e=>$(e)?"Reference":P(e)?"Expo Application Services":T(e)?"Home":D(e)?"Learn":"Guides",W=({url:e,isNested:t=!1})=>t?n.createElement(n.Fragment,null,n.createElement("span",{className:"text-3xs text-quaternary"},Q(e)),n.createElement(x,null)):n.createElement("p",{className:"text-3xs text-quaternary"},Q(e)),z=({item:e,onSelect:t,isNested:l,transformUrl:a})=>{const{lvl0:s,lvl2:c,lvl3:m,lvl4:o,lvl6:i}=e.hierarchy,u=r.mergeClasses(l?"text-2xs":"text-xs font-medium"),d=r.mergeClasses("text-3xs text-quaternary",l&&"hidden");return n.createElement(O,{className:r.mergeClasses(l&&"ml-8 !min-h-[32px]"),value:`expodocs-${e.objectID}`,onSelect:t,url:a?a(e.url):e.url,isNested:l,isExternalLink:!a},n.createElement("div",{className:"flex gap-3 jutify-between"},n.createElement("div",{className:"inline-flex items-center gap-3 break-words"},n.createElement(X,{url:e.url,isNested:l,className:"shrink-0"}),n.createElement("div",null,i&&n.createElement(n.Fragment,null,n.createElement("p",{className:u,..._(e,"lvl6")}),!l&&n.createElement("p",{className:"text-3xs text-quaternary"},n.createElement(W,{url:e.url,isNested:!0}),n.createElement("span",{..._(e,"lvl0")}),n.createElement(j,{item:e,levelKey:"lvl2"}),n.createElement(j,{item:e,levelKey:"lvl3"}),n.createElement(j,{item:e,levelKey:"lvl4"}))),!i&&o&&n.createElement(n.Fragment,null,n.createElement("p",{className:u,..._(e,"lvl4")}),!l&&n.createElement("p",{className:d},n.createElement(W,{url:e.url,isNested:!0}),n.createElement("span",{..._(e,"lvl0")}),n.createElement(j,{item:e,levelKey:"lvl2"}),n.createElement(j,{item:e,levelKey:"lvl3"}))),!i&&!o&&m&&n.createElement(n.Fragment,null,n.createElement("p",{className:u,..._(e,"lvl3")}),!l&&n.createElement("p",{className:d},n.createElement(W,{url:e.url,isNested:!0}),n.createElement("span",{..._(e,"lvl0")}),n.createElement(j,{item:e,levelKey:"lvl2"}))),!i&&!o&&!m&&c&&n.createElement(n.Fragment,null,n.createElement("p",{className:u,..._(e,"lvl2")}),!l&&n.createElement("p",{className:d},n.createElement(W,{url:e.url,isNested:!0}),n.createElement("span",{..._(e,"lvl0")}))),!i&&!o&&!m&&!c&&s&&n.createElement(n.Fragment,null,n.createElement("p",{className:u,..._(e,"lvl0")}),n.createElement(W,{url:e.url})),(!l||e.content)&&n.createElement("p",{className:r.mergeClasses("text-secondary",l?"text-3xs":"text-2xs"),...M(e)}))),!a&&n.createElement(h,null)))},J=({item:e,onSelect:t,query:l})=>{return n.createElement(O,{value:`expo-blog-${e.slug.current}`,url:`https://expo.dev/blog/${e.slug.current}`,isExternalLink:!0,onSelect:t},n.createElement("div",{className:"inline-flex gap-3 items-center"},n.createElement("img",{src:(a=e.mainImage.image.asset._ref,b.image(a).auto("format").height(150).url()),alt:e.mainImage.altText,className:"size-11 object-cover rounded-md my-0.5"}),n.createElement("div",null,n.createElement("p",{className:"text-xs font-medium",dangerouslySetInnerHTML:{__html:Z(e.title,l)}}),n.createElement("p",{className:"text-3xs text-quaternary",dangerouslySetInnerHTML:{__html:Z(e.metadataDescription,l)}})),n.createElement(h,null)));var a},Y=e.Command.Item;exports.CommandItemBase=Y,exports.CommandItemBaseWithCopy=O,exports.CommandMenu=({config:{docsVersion:r,docsTransformUrl:s},open:c,setOpen:m,customSections:o=[]})=>{const[i,u]=n.useState(!1),[d,p]=n.useState(!0),[g,C]=n.useState(""),[x,h]=n.useState(null),[v,y]=n.useState([]),[N,b]=n.useState([]),[I,_]=n.useState([]),[w,M]=n.useState([]),R=async()=>k(g,S,y,r),$=async()=>(async(e,t,l)=>{l(await t(e))})(g,H,b),V=async()=>k(g,q,_),P=async()=>k(g,L,M),K=()=>m(!1),T=e=>{Promise.all([R(),$(),V(),P(),...o?.map((e=>e.getItemsAsync(g)))]).then(e)};n.useEffect((()=>{h("undefined"!=typeof navigator&&U())}),[]),n.useEffect((()=>{if(null!==x){const e=e=>{"k"===e.key&&(x?e.metaKey:e.ctrlKey)&&(e.preventDefault(),m((e=>!e)))};return document.addEventListener("keydown",e,!1),()=>document.removeEventListener("keydown",e)}}),[x]),n.useEffect((()=>{c&&!i&&T((()=>{u(!0),p(!1)}))}),[c]),n.useEffect((()=>{if(c){p(!0);const e=setTimeout((()=>T((()=>p(!1)))),150);return()=>clearTimeout(e)}}),[g]);const F=a(v.map((e=>({...e,baseUrl:e.url.replace(/#.+/,"")}))),"baseUrl"),D=[v.length>0&&n.createElement(e.Command.Group,{heading:"Expo documentation",key:"expo-docs-group"},Object.values(F).map((e=>e.sort(((e,t)=>e.url.localeCompare(e.baseUrl)-t.url.localeCompare(t.baseUrl))).slice(0,6).map(((e,t)=>n.createElement(z,{isNested:0!==t,item:e,onSelect:K,key:`hit-expo-docs-${e.objectID}`,transformUrl:s})))))),N.length>0&&n.createElement(e.Command.Group,{heading:"Expo blog",key:"expo-blog-group"},N.map((e=>n.createElement(J,{item:e,onSelect:K,key:`hit-expo-blog-${e.slug.current}`,query:g})))),I.length>0&&n.createElement(e.Command.Group,{heading:"React Native documentation",key:"rn-docs-group"},I.map((e=>n.createElement(B,{item:e,onSelect:K,key:`hit-rn-docs-${e.objectID}`})))),w.length>0&&n.createElement(e.Command.Group,{heading:"React Native directory",key:"rn-directory-group"},w.map((e=>n.createElement(G,{item:e,onSelect:K,key:`hit-rn-dir-${e.npmPkg}`,query:g}))))];return o?.forEach((({items:t,heading:l,sectionIndex:a})=>t.length>0&&D.splice(a,0,n.createElement(e.Command.Group,{heading:l,key:`${a}-${l}`},t)))),n.createElement(e.Command.Dialog,{open:c,onOpenChange:m,label:"Search Menu",shouldFilter:!1},n.createElement(t.SearchSmIcon,{className:"text-icon-secondary absolute top-[29px] left-[29px] transition-opacity duration-200"}),n.createElement("div",{className:"absolute top-[25px] right-[25px] cursor-pointer p-1 rounded-sm hocus:bg-element"},n.createElement(l.XIcon,{className:"text-icon-secondary",onClick:()=>m(!1)})),n.createElement(e.Command.Input,{value:g,onValueChange:C,placeholder:"Search…"}),n.createElement(E,{isLoading:d}),n.createElement(e.Command.List,null,i&&D,0===D.filter(Boolean).length&&n.createElement(e.Command.Empty,{key:"no-results-group"},n.createElement("p",{className:"text-secondary text-xs"},"No results found."))),n.createElement(f,null))},exports.CommandMenuTrigger=({setOpen:e,className:l})=>{const[a,s]=n.useState(null);return n.useEffect((()=>{s("undefined"!=typeof navigator&&U())}),[]),n.createElement(r.Button,{theme:"secondary",leftSlot:n.createElement(t.SearchSmIcon,{className:"icon-md text-icon-secondary"}),rightSlot:null!==a?n.createElement("div",{className:"ml-auto max-md-gutters:hidden"},n.createElement("kbd",{className:"!h-5 !leading-[19px]"},a?"⌘":"Ctrl")," ",n.createElement("kbd",{className:"!h-5 !leading-[19px]"},"K")):void 0,className:r.mergeClasses("cmdk-trigger bg-default pl-2.5 pr-3 border border-default shadow-xs min-h-[40px]",l),onClick:()=>e(!0)},n.createElement("p",{className:"text-secondary font-normal leading-normal text-xs"},"Search"))},exports.addHighlight=Z;
1
+ "use strict";var e=require("cmdk"),t=require("@expo/styleguide-icons/outline/SearchSmIcon"),l=require("@expo/styleguide-icons/outline/XIcon"),a=require("lodash.groupby"),n=require("react"),r=require("@expo/styleguide"),s=require("@expo/styleguide-icons/outline/ArrowUpRightIcon"),c=require("@expo/styleguide-icons/outline/ChevronRightIcon"),m=require("@expo/styleguide-icons/custom/GithubIcon"),o=require("@sanity/client"),i=require("@sanity/image-url"),u=require("@expo/styleguide-icons/custom/PlanEnterpriseIcon"),d=require("@expo/styleguide-icons/outline/BookOpen02Icon"),p=require("@expo/styleguide-icons/outline/GraduationHat02Icon"),g=require("@expo/styleguide-icons/outline/Hash02Icon"),C=require("@expo/styleguide-icons/outline/Home02Icon");const E=({isLoading:e})=>n.createElement("div",{role:"progressbar",className:r.mergeClasses("bg-palette-blue9 h-0.5 absolute mt-[11px] left-px",e&&"animate-[searchUIBarLoader_2s_infinite_ease-in-out]")});function x(){return n.createElement(c.ChevronRightIcon,{className:"icon-xs text-icon-quaternary inline-block relative mx-1 -top-px"})}const h=()=>n.createElement(s.ArrowUpRightIcon,{className:"text-icon-tertiary self-center ml-auto shrink-0"}),v=({className:e})=>n.createElement("svg",{viewBox:"-11.5 -10.23174 23 20.46348",className:r.mergeClasses("icon-md text-icon-secondary",e)},n.createElement("circle",{cx:"0",cy:"0",r:"2.05",fill:"currentColor"}),n.createElement("g",{stroke:"currentColor",strokeWidth:"1",fill:"none"},n.createElement("ellipse",{rx:"11",ry:"4.2"}),n.createElement("ellipse",{rx:"11",ry:"4.2",transform:"rotate(60)"}),n.createElement("ellipse",{rx:"11",ry:"4.2",transform:"rotate(120)"}))),y=()=>n.createElement("svg",{width:"77",height:"19",viewBox:"0 0 2197 500",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-label":"Algolia",role:"img"},n.createElement("g",{clipPath:"url(#clip0_1_2)"},n.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1070.38 275.3V5.90999C1070.38 2.27998 1067.14 -0.480015 1063.56 0.0799852L1013.1 8.01999C1010.23 8.46999 1008.11 10.95 1008.11 13.86L1008.28 287.08C1008.28 300 1008.28 379.78 1104.25 382.57C1107.58 382.67 1110.34 379.99 1110.34 376.66V335.88C1110.34 332.92 1108.15 330.37 1105.22 330.04C1070.37 326.03 1070.37 282.47 1070.37 275.32L1070.38 275.3Z"}),n.createElement("path",{d:"M1902.56 104.73H1851.78C1848.52 104.73 1845.88 107.372 1845.88 110.63V376.73C1845.88 379.988 1848.52 382.63 1851.78 382.63H1902.56C1905.82 382.63 1908.46 379.988 1908.46 376.73V110.63C1908.46 107.372 1905.82 104.73 1902.56 104.73Z"}),n.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1851.78 71.38H1902.55C1905.81 71.38 1908.45 68.74 1908.45 65.48V5.90001C1908.45 2.28001 1905.21 -0.489988 1901.63 0.0700121L1850.86 8.02001C1847.99 8.47001 1845.87 10.94 1845.87 13.85V65.47C1845.87 68.73 1848.51 71.37 1851.77 71.37L1851.78 71.38Z"}),n.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1764.03 275.3V5.90999C1764.03 2.27998 1760.79 -0.480015 1757.21 0.0799852L1706.75 8.01999C1703.88 8.46999 1701.76 10.95 1701.76 13.86L1701.93 287.08C1701.93 300 1701.93 379.78 1797.9 382.57C1801.23 382.67 1803.99 379.99 1803.99 376.66V335.88C1803.99 332.92 1801.8 330.37 1798.87 330.04C1764.02 326.03 1764.02 282.47 1764.02 275.32L1764.03 275.3Z"}),n.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1631.95 142.72C1620.81 130.47 1607.12 121.07 1591.17 114.41C1575.25 107.88 1557.91 104.56 1539.1 104.56C1520.32 104.56 1502.95 107.73 1487.18 114.41C1471.59 121.07 1457.89 130.46 1446.42 142.72C1434.95 154.95 1426.04 169.59 1419.66 186.75C1413.28 203.92 1410.42 224.12 1410.42 245.11C1410.42 266.1 1413.61 281.98 1419.97 299.32C1426.35 316.64 1435.11 331.43 1446.42 343.68C1457.71 355.91 1471.25 365.3 1487.02 372.14C1502.79 378.97 1527.14 382.47 1539.42 382.62C1551.67 382.62 1576.2 378.8 1592.12 372.14C1608.04 365.46 1621.58 355.91 1632.9 343.68C1644.19 331.43 1652.95 316.64 1659.15 299.32C1665.37 281.98 1668.39 266.1 1668.39 245.11C1668.39 224.12 1665.05 203.92 1658.36 186.75C1651.98 169.58 1643.22 154.95 1631.93 142.72H1631.95ZM1587.52 306.47C1576.05 322.22 1559.96 330.17 1539.43 330.17C1518.88 330.17 1502.8 322.37 1491.33 306.47C1479.86 290.72 1474.12 272.46 1474.12 245.27C1474.12 218.38 1479.71 196.13 1491.18 180.4C1502.63 164.65 1518.72 156.88 1539.25 156.88C1559.8 156.88 1575.88 164.66 1587.34 180.4C1598.81 195.97 1604.7 218.38 1604.7 245.27C1604.7 272.46 1598.98 290.57 1587.51 306.47H1587.52Z"}),n.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M894.42 104.73H845.09C796.73 104.73 754.18 130.21 729.34 168.83C714.82 191.41 706.35 218.46 706.35 247.56C706.35 292.45 726.48 332.48 757.94 358.66C760.87 361.26 763.99 363.64 767.25 365.8C780.11 374.29 795.36 379.27 811.77 379.27C813 379.27 814.23 379.24 815.45 379.18C815.81 379.16 816.16 379.13 816.52 379.11C817.39 379.06 818.27 379 819.14 378.91C819.48 378.88 819.82 378.83 820.16 378.79C821.07 378.69 821.98 378.58 822.89 378.45C823.1 378.42 823.31 378.38 823.52 378.35C856.41 373.28 885.08 347.53 894.42 315.54V373.37C894.42 376.63 897.06 379.27 900.32 379.27H950.74C954 379.27 956.64 376.63 956.64 373.37V110.63C956.64 107.37 954 104.73 950.74 104.73H894.42ZM894.42 311.65C882.22 321.81 866.45 325.63 849.58 326.77C849.42 326.78 849.25 326.8 849.09 326.81C847.97 326.88 846.85 326.91 845.73 326.91C803.49 326.91 768.61 291.02 768.61 247.54C768.61 237.29 770.57 227.53 774.03 218.56C785.25 189.44 812.8 168.82 845.09 168.82H894.42V311.65Z"}),n.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2133.97 104.73H2084.64C2036.28 104.73 1993.73 130.21 1968.89 168.83C1954.37 191.41 1945.9 218.46 1945.9 247.56C1945.9 292.45 1966.03 332.48 1997.49 358.66C2000.42 361.26 2003.54 363.64 2006.8 365.8C2019.66 374.29 2034.91 379.27 2051.32 379.27C2052.55 379.27 2053.78 379.24 2055 379.18C2055.36 379.16 2055.71 379.13 2056.07 379.11C2056.94 379.06 2057.82 379 2058.69 378.91C2059.03 378.88 2059.37 378.83 2059.71 378.79C2060.62 378.69 2061.53 378.58 2062.44 378.45C2062.65 378.42 2062.86 378.38 2063.07 378.35C2095.96 373.28 2124.63 347.53 2133.97 315.54V373.37C2133.97 376.63 2136.61 379.27 2139.87 379.27H2190.29C2193.55 379.27 2196.19 376.63 2196.19 373.37V110.63C2196.19 107.37 2193.55 104.73 2190.29 104.73H2133.97ZM2133.97 311.65C2121.77 321.81 2106 325.63 2089.13 326.77C2088.97 326.78 2088.8 326.8 2088.64 326.81C2087.52 326.88 2086.4 326.91 2085.28 326.91C2043.04 326.91 2008.16 291.02 2008.16 247.54C2008.16 237.29 2010.12 227.53 2013.58 218.56C2024.8 189.44 2052.35 168.82 2084.64 168.82H2133.97V311.65Z"}),n.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1314.05 104.73H1264.72C1216.36 104.73 1173.81 130.21 1148.97 168.83C1137.18 187.17 1129.37 208.47 1126.86 231.42C1126.28 236.72 1125.98 242.1 1125.98 247.56C1125.98 253.02 1126.29 258.71 1126.91 264.15C1131.19 302.24 1150.05 335.76 1177.57 358.67C1180.5 361.27 1183.62 363.65 1186.88 365.81C1199.74 374.3 1214.99 379.28 1231.4 379.28C1249.39 379.28 1266.01 373.35 1279.56 363.31C1295.85 351.73 1308.44 334.77 1314.04 315.56V365.82H1313.93V376.9C1313.93 398.74 1308.22 415.17 1296.59 426.26C1284.98 437.34 1265.55 442.89 1238.34 442.89C1227.22 442.89 1209.55 442.3 1191.74 440.48C1188.91 440.19 1186.28 441.98 1185.47 444.7L1172.69 487.81C1171.67 491.27 1173.96 494.83 1177.52 495.34C1199.04 498.42 1220.04 500.02 1232.17 500.02C1281.08 500.02 1317.33 489.27 1341.06 467.81C1362.54 448.4 1374.21 418.92 1376.26 379.29V110.63C1376.26 107.37 1373.62 104.73 1370.36 104.73H1314.04H1314.05ZM1314.05 168.83C1314.05 168.83 1314.7 307.96 1314.05 312.19C1301.97 321.96 1286.94 325.78 1270.56 326.89C1270.4 326.9 1270.23 326.92 1270.07 326.93C1268.95 327 1267.83 327.03 1266.71 327.03C1265.39 327.03 1264.08 327 1262.77 326.93C1222.36 324.82 1188.25 289.67 1188.25 247.55C1188.25 237.3 1190.21 227.54 1193.67 218.57C1204.89 189.45 1232.44 168.83 1264.73 168.83H1314.06H1314.05Z"}),n.createElement("path",{d:"M249.83 0C113.3 0 2.00001 110.09 0.0300098 246.16C-1.96999 384.35 110.15 498.86 248.36 499.66C291.04 499.91 332.15 489.47 368.66 469.63C372.22 467.7 372.77 462.8 369.74 460.12L346.36 439.4C341.61 435.19 334.85 434 329 436.48C303.52 447.32 275.83 452.86 247.29 452.51C135.61 451.14 45.38 358.22 47.16 246.55C48.92 136.29 139.16 47.14 249.83 47.14H452.52V407.41L337.52 305.23C333.8 301.92 328.1 302.57 325.1 306.54C306.64 330.98 276.57 346.18 243.17 343.88C196.84 340.68 159.3 303.38 155.83 257.07C151.68 201.83 195.46 155.55 249.83 155.55C299.01 155.55 339.51 193.4 343.74 241.5C344.12 245.78 346.05 249.77 349.26 252.62L379.21 279.17C382.61 282.18 388 280.34 388.84 275.87C391 264.32 391.76 252.29 390.91 239.95C386.09 169.61 329.11 113.02 258.74 108.69C178.06 103.72 110.61 166.83 108.47 245.94C106.38 323.04 169.55 389.5 246.66 391.2C278.85 391.91 308.69 381.79 332.8 364.25L483.06 497.45C489.5 503.16 499.67 498.59 499.67 489.98V9.48C499.66 4.25 495.42 0 490.18 0H249.83Z"})),n.createElement("defs",null,n.createElement("clipPath",null,n.createElement("rect",{width:2196.2,height:500})))),f=()=>n.createElement("div",{className:"flex gap-4 px-4 h-11 items-center"},n.createElement("p",{className:"text-3xs text-tertiary inline-flex gap-2 items-center max-md-gutters:hidden"},n.createElement("kbd",null,"↵"),n.createElement("span",null,"to select")),n.createElement("p",{className:"text-3xs text-tertiary inline-flex gap-2 items-center max-md-gutters:hidden"},n.createElement("kbd",null,"↑"),n.createElement("kbd",null,"↓"),n.createElement("span",null,"to navigate")),n.createElement("p",{className:"text-3xs text-tertiary inline-flex gap-2 items-center max-md-gutters:hidden"},n.createElement("kbd",null,"esc"),n.createElement("span",null,"to close")),n.createElement("p",{className:"text-3xs text-tertiary inline-flex gap-2 items-center ml-auto"},n.createElement("span",null,"Search by"),n.createElement("a",{href:"https://www.algolia.com/developers/?utm_medium=referral&utm_content=powered_by&utm_source=expo.dev.com&utm_campaign=docsearch",target:"_blank"},n.createElement(y,null)))),N=o.createClient({projectId:"siias52v",dataset:"production",useCdn:!0,apiVersion:"2024-09-03"}),b=i({projectId:"siias52v",dataset:"production"});const k=async(e,t,l,a)=>{const{hits:n,libraries:r}=await t(e,a).then((e=>e.json()));l(n||r||[])},I=(e,t,l,a,n,r={})=>[`https://${t}-dsn.algolia.net/1/indexes/${a}/query`,{method:"POST",headers:{"X-Algolia-Application-Id":t,"X-Algolia-API-Key":l},body:JSON.stringify({params:`query=${e}&hitsPerPage=${n}`,highlightPreTag:"<mark>",highlightPostTag:"</mark>",...r})}],S=(e,t)=>fetch(...I(e,"QEX7PB7D46","6652d26570e8628af4601e1d78ad456b","expo",20,{facetFilters:[["version:none",`version:${t}`]]})),q=e=>fetch(...I(e,"8TDSE0OHGQ","c9c791d9d5fd7f315d7f3859b32c1f3b","react-native-v2",5,{facetFilters:[["version:current"]]})),H=e=>N.fetch(`*[_type == "post" && publishAt < now() && (title match "${e}*" || metadataDescription match "${e}*")] | order(publishAt desc)[0...10] {\n title,\n slug,\n tags,\n metadataDescription,\n mainImage\n }`),L=e=>fetch(`https://reactnative.directory/api/libraries?search=${encodeURI(e)}&limit=5`),w=(e,t)=>({dangerouslySetInnerHTML:{__html:e._highlightResult.hierarchy[`${t}`]?.value||""}}),_=(e,t=36)=>{if(!e||!e.length)return"";const l=Math.max(e.indexOf("<mark>")-t,0),a=Math.min(e.indexOf("</mark>")+t+6,e.length);return`${0!==l?"…":""}${e.substring(l,a).trim()}${a!==e.length?"…":""}`},M=(e,t=!1)=>t?{}:{dangerouslySetInnerHTML:{__html:e._highlightResult.content?.value?_(e._highlightResult.content?.value):_(e._highlightResult.hierarchy.lvl1?.value||"",82)}},R=["/versions/","/more/"],$=e=>R.some((t=>e.includes(t))),V=["/app-signing/","/build/","/build-reference/","/development/","/eas/","/eas/metadata/","/eas-update/","/submit/"],P=e=>V.some((t=>e.includes(t))),K=["/get-started/","/develop/","/deploy/","/faq/","/core-concepts/","/debugging/","/config-plugins/"],T=e=>K.some((t=>e.includes(t))),F=["/tutorial","/ui-programming/","/additional-resources/"],D=e=>F.some((t=>e.includes(t))),U=()=>/(Mac|iPhone|iPod|iPad)/i.test(navigator?.platform??navigator?.userAgentData?.platform??""),Z=(e,t)=>{if(!e||!e.length)return"";const l=e.toLowerCase().indexOf(t.toLowerCase());if(-1===l)return e;const a=l+t.length;return e.substring(0,l)+"<mark>"+e.substring(l,a)+"</mark>"+e.substring(a)},A=({children:t,url:l,isExternalLink:a,isNested:s,onSelect:c,className:m,value:o})=>{const[i,u]=n.useState(!1);return n.createElement(e.Command.Item,{className:r.mergeClasses("relative",m),value:o,"data-nested":!!s||void 0,onMouseUp:e=>{1!==e.button&&2!==e.button||(navigator.clipboard?.writeText(l),u(!0),setTimeout((()=>u(!1)),1500))},onSelect:()=>{((e,t=!1)=>{const l=document.createElement("a");t&&(l.target="_blank",l.rel="noopener noreferrer"),l.href=e,l.click()})(l,a),c&&c()},onContextMenu:e=>{e.preventDefault()}},t,i&&n.createElement("div",{className:"text-2xs font-medium absolute rounded-full px-2 right-2.5 top-[calc(50%-13px)] border-secondary bg-info text-info"},"Copied!"))},O=new Intl.NumberFormat,G=({item:e,onSelect:t,query:l})=>n.createElement(A,{value:`rnd-${e.npmPkg}`,url:e.githubUrl,isExternalLink:!0,onSelect:t},n.createElement("div",{className:"inline-flex gap-3 items-center"},n.createElement(m.GithubIcon,{className:"text-icon-secondary"}),n.createElement("div",null,n.createElement("p",{className:"text-xs font-medium",dangerouslySetInnerHTML:{__html:Z(e.npmPkg,l)}}),n.createElement("p",{className:"text-3xs text-quaternary"},O.format(e.github.stats.stars)," stars · ",O.format(e.npm.downloads)," downloads")),n.createElement(h,null))),j=({item:e,levelKey:t="lvl0"})=>e.hierarchy[t]?n.createElement(n.Fragment,null,n.createElement(x,null),n.createElement("span",{...w(e,t)})):null,B=({item:e,onSelect:t})=>{const{lvl0:l,lvl1:a,lvl2:r,lvl3:s,lvl4:c}=e.hierarchy;return n.createElement(A,{value:`rn-${e.objectID}`,url:e.url,isExternalLink:!0,onSelect:t},n.createElement("div",{className:"inline-flex gap-3 items-center"},n.createElement(v,{className:"shrink-0"}),n.createElement("div",null,c&&n.createElement(n.Fragment,null,n.createElement("p",{className:"text-xs font-medium",...w(e,"lvl4")}),n.createElement("p",{className:"text-3xs text-quaternary"},n.createElement("span",{...w(e,"lvl0")}),n.createElement(j,{item:e,levelKey:"lvl1"}),n.createElement(j,{item:e,levelKey:"lvl2"}),n.createElement(j,{item:e,levelKey:"lvl3"}))),!c&&s&&n.createElement(n.Fragment,null,n.createElement("p",{className:"text-xs font-medium",...w(e,"lvl3")}),n.createElement("p",{className:"text-3xs text-quaternary"},n.createElement("span",{...w(e,"lvl0")}),n.createElement(j,{item:e,levelKey:"lvl1"}),n.createElement(j,{item:e,levelKey:"lvl2"}))),!s&&r&&n.createElement(n.Fragment,null,n.createElement("p",{className:"text-xs font-medium",...w(e,"lvl2")}),n.createElement("p",{className:"text-3xs text-quaternary"},n.createElement("span",{...w(e,"lvl0")}),n.createElement(j,{item:e,levelKey:"lvl1"}))),!s&&!r&&a&&n.createElement(n.Fragment,null,n.createElement("p",{className:"text-xs font-medium",...w(e,"lvl1")}),n.createElement("p",{className:"text-3xs text-quaternary",...w(e,"lvl0")})),!s&&!r&&!a&&l&&n.createElement("p",{className:"text-xs font-medium",...w(e,"lvl0")}),n.createElement("p",{className:"text-2xs text-secondary",...M(e,!0)})),n.createElement(h,null)))},X=({url:e,className:t,isNested:l})=>l?n.createElement(g.Hash02Icon,{className:r.mergeClasses("icon-sm text-icon-quaternary",t)}):$(e)?n.createElement(r.DocsLogo,{className:r.mergeClasses("text-icon-secondary",t)}):P(e)?n.createElement(u.PlanEnterpriseIcon,{className:r.mergeClasses("text-icon-secondary",t)}):T(e)?n.createElement(C.Home02Icon,{className:r.mergeClasses("text-icon-secondary",t)}):D(e)?n.createElement(p.GraduationHat02Icon,{className:r.mergeClasses("text-icon-secondary",t)}):n.createElement(d.BookOpen02Icon,{className:r.mergeClasses("text-icon-secondary",t)}),Q=e=>$(e)?"Reference":P(e)?"Expo Application Services":T(e)?"Home":D(e)?"Learn":"Guides",W=({url:e,isNested:t=!1})=>t?n.createElement(n.Fragment,null,n.createElement("span",{className:"text-3xs text-quaternary"},Q(e)),n.createElement(x,null)):n.createElement("p",{className:"text-3xs text-quaternary"},Q(e)),z=({item:e,onSelect:t,isNested:l,transformUrl:a})=>{const{lvl0:s,lvl2:c,lvl3:m,lvl4:o,lvl6:i}=e.hierarchy,u=r.mergeClasses(l?"text-2xs":"text-xs font-medium"),d=r.mergeClasses("text-3xs text-quaternary",l&&"hidden");return n.createElement(A,{className:r.mergeClasses(l&&"ml-8 !min-h-[32px]"),value:`expodocs-${e.objectID}`,onSelect:t,url:a?a(e.url):e.url,isNested:l,isExternalLink:!a},n.createElement("div",{className:"flex gap-3 jutify-between"},n.createElement("div",{className:"inline-flex items-center gap-3 break-words"},n.createElement(X,{url:e.url,isNested:l,className:"shrink-0"}),n.createElement("div",null,i&&n.createElement(n.Fragment,null,n.createElement("p",{className:u,...w(e,"lvl6")}),!l&&n.createElement("p",{className:"text-3xs text-quaternary"},n.createElement(W,{url:e.url,isNested:!0}),n.createElement("span",{...w(e,"lvl0")}),n.createElement(j,{item:e,levelKey:"lvl2"}),n.createElement(j,{item:e,levelKey:"lvl3"}),n.createElement(j,{item:e,levelKey:"lvl4"}))),!i&&o&&n.createElement(n.Fragment,null,n.createElement("p",{className:u,...w(e,"lvl4")}),!l&&n.createElement("p",{className:d},n.createElement(W,{url:e.url,isNested:!0}),n.createElement("span",{...w(e,"lvl0")}),n.createElement(j,{item:e,levelKey:"lvl2"}),n.createElement(j,{item:e,levelKey:"lvl3"}))),!i&&!o&&m&&n.createElement(n.Fragment,null,n.createElement("p",{className:u,...w(e,"lvl3")}),!l&&n.createElement("p",{className:d},n.createElement(W,{url:e.url,isNested:!0}),n.createElement("span",{...w(e,"lvl0")}),n.createElement(j,{item:e,levelKey:"lvl2"}))),!i&&!o&&!m&&c&&n.createElement(n.Fragment,null,n.createElement("p",{className:u,...w(e,"lvl2")}),!l&&n.createElement("p",{className:d},n.createElement(W,{url:e.url,isNested:!0}),n.createElement("span",{...w(e,"lvl0")}))),!i&&!o&&!m&&!c&&s&&n.createElement(n.Fragment,null,n.createElement("p",{className:u,...w(e,"lvl0")}),n.createElement(W,{url:e.url})),(!l||e.content)&&n.createElement("p",{className:r.mergeClasses("text-secondary",l?"text-3xs":"text-2xs"),...M(e)}))),!a&&n.createElement(h,null)))},J=({item:e,onSelect:t,query:l})=>{return n.createElement(A,{value:`expo-blog-${e.slug.current}`,url:`https://expo.dev/blog/${e.slug.current}`,isExternalLink:!0,onSelect:t},n.createElement("div",{className:"inline-flex gap-3 items-center"},n.createElement("img",{src:(a=e.mainImage.image.asset._ref,b.image(a).auto("format").height(150).url()),alt:e.mainImage.altText,className:"size-11 object-cover rounded-md my-0.5"}),n.createElement("div",null,n.createElement("p",{className:"text-xs font-medium",dangerouslySetInnerHTML:{__html:Z(e.title,l)}}),n.createElement("p",{className:"text-3xs text-quaternary",dangerouslySetInnerHTML:{__html:Z(e.metadataDescription,l)}})),n.createElement(h,null)));var a},Y=e.Command.Item;exports.CommandItemBase=Y,exports.CommandItemBaseWithCopy=A,exports.CommandMenu=({config:{docsVersion:r,docsTransformUrl:s},open:c,setOpen:m,customSections:o=[]})=>{const[i,u]=n.useState(!1),[d,p]=n.useState(!0),[g,C]=n.useState(""),[x,h]=n.useState(null),[v,y]=n.useState([]),[N,b]=n.useState([]),[I,w]=n.useState([]),[_,M]=n.useState([]),R=async()=>k(g,S,y,r),$=async()=>(async(e,t,l)=>{l(await t(e))})(g,H,b),V=async()=>k(g,q,w),P=async()=>k(g,L,M),K=()=>m(!1),T=e=>{Promise.all([R(),$(),V(),P(),...o?.map((e=>e.getItemsAsync(g)))]).then(e)};n.useEffect((()=>{h("undefined"!=typeof navigator&&U())}),[]),n.useEffect((()=>{if(null!==x){const e=e=>{"k"===e.key&&(x?e.metaKey:e.ctrlKey)&&(e.preventDefault(),m((e=>!e)))};return document.addEventListener("keydown",e,!1),()=>document.removeEventListener("keydown",e)}}),[x]),n.useEffect((()=>{c&&!i&&T((()=>{u(!0),p(!1)}))}),[c]),n.useEffect((()=>{if(c){p(!0);const e=setTimeout((()=>T((()=>p(!1)))),150);return()=>clearTimeout(e)}}),[g]);const F=a(v.map((e=>({...e,baseUrl:e.url.replace(/#.+/,"")}))),"baseUrl"),D=[v.length>0&&n.createElement(e.Command.Group,{heading:"Expo documentation",key:"expo-docs-group"},Object.values(F).map((e=>e.sort(((e,t)=>e.url.localeCompare(e.baseUrl)-t.url.localeCompare(t.baseUrl))).slice(0,6).map(((e,t)=>n.createElement(z,{isNested:0!==t,item:e,onSelect:K,key:`hit-expo-docs-${e.objectID}`,transformUrl:s})))))),N.length>0&&n.createElement(e.Command.Group,{heading:"Expo blog",key:"expo-blog-group"},N.map((e=>n.createElement(J,{item:e,onSelect:K,key:`hit-expo-blog-${e.slug.current}`,query:g})))),I.length>0&&n.createElement(e.Command.Group,{heading:"React Native documentation",key:"rn-docs-group"},I.map((e=>n.createElement(B,{item:e,onSelect:K,key:`hit-rn-docs-${e.objectID}`})))),_.length>0&&n.createElement(e.Command.Group,{heading:"React Native directory",key:"rn-directory-group"},_.map((e=>n.createElement(G,{item:e,onSelect:K,key:`hit-rn-dir-${e.npmPkg}`,query:g}))))];return o?.forEach((({items:t,heading:l,sectionIndex:a})=>t.length>0&&D.splice(a,0,n.createElement(e.Command.Group,{heading:l,key:`${a}-${l}`},t)))),n.createElement(e.Command.Dialog,{open:c,onOpenChange:m,label:"Search Menu",shouldFilter:!1},n.createElement(t.SearchSmIcon,{className:"text-icon-secondary absolute top-[29px] left-[29px] transition-opacity duration-200"}),n.createElement("div",{className:"absolute top-[25px] right-[25px] cursor-pointer p-1 rounded-sm hocus:bg-element"},n.createElement(l.XIcon,{className:"text-icon-secondary",onClick:()=>m(!1)})),n.createElement(e.Command.Input,{value:g,onValueChange:C,placeholder:"Search…"}),n.createElement(E,{isLoading:d}),n.createElement(e.Command.List,null,i&&D,0===D.filter(Boolean).length&&n.createElement(e.Command.Empty,{key:"no-results-group"},n.createElement("p",{className:"text-secondary text-xs"},"No results found."))),n.createElement(f,null))},exports.CommandMenuTrigger=({setOpen:e,className:l})=>{const[a,s]=n.useState(null);return n.useEffect((()=>{s("undefined"!=typeof navigator&&U())}),[]),n.createElement(r.Button,{theme:"secondary",leftSlot:n.createElement(t.SearchSmIcon,{className:"icon-md text-icon-secondary"}),rightSlot:null!==a?n.createElement("div",{className:"ml-auto max-md-gutters:hidden"},n.createElement("kbd",{className:"!h-5 !leading-[19px]"},a?"⌘":"Ctrl")," ",n.createElement("kbd",{className:"!h-5 !leading-[19px]"},"K")):void 0,className:r.mergeClasses("cmdk-trigger bg-default pl-2.5 pr-3 border border-default shadow-xs min-h-[40px]",l),onClick:()=>e(!0)},n.createElement("p",{className:"text-secondary font-normal leading-normal text-xs"},"Search"))},exports.addHighlight=Z;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expo/styleguide-search-ui",
3
- "version": "2.2.2",
3
+ "version": "2.2.4",
4
4
  "description": "Expo's common search component for use on the web.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -47,5 +47,5 @@
47
47
  "eslintConfig": {
48
48
  "extends": "universe/web"
49
49
  },
50
- "gitHead": "9e8abe7da65402a0c0d254829e77ce838b564f91"
50
+ "gitHead": "17a64cceb42446d29582908410483293615b4fc6"
51
51
  }