@expo/styleguide-search-ui 2.3.5 → 3.0.0

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.
@@ -131,7 +131,7 @@
131
131
  opacity: 0.85;
132
132
  }
133
133
 
134
- [cmdk-list] {
134
+ [cmdk-list], .result-container {
135
135
  height: calc(75vh - 50px - 50px - 20px);
136
136
  max-height: calc(75vh - 50px - 50px - 20px);
137
137
  overflow: auto;
@@ -142,8 +142,70 @@
142
142
  margin: 12px 0 0;
143
143
  }
144
144
 
145
+ .prompt-result {
146
+ > * {
147
+ @apply mb-2.5 last:mb-0;
148
+ }
149
+
150
+ h2, h3, h4 {
151
+ @apply heading-base mt-3.5;
152
+ }
153
+
154
+ h5, h6 {
155
+ @apply heading-sm mt-3.5;
156
+ }
157
+
158
+ code {
159
+ @apply bg-subtle border border-secondary rounded-sm px-0.5;
160
+ }
161
+
162
+ pre {
163
+ @apply text-2xs bg-screen border border-default shadow-xs p-3 rounded-md whitespace-pre-wrap break-words;
164
+
165
+ code {
166
+ @apply p-0 border-0 bg-transparent;
167
+ }
168
+ }
169
+
170
+ ul, ol {
171
+ @apply marker:text-secondary pl-5;
172
+
173
+ * {
174
+ @apply mb-2 last:mb-0;
175
+ }
176
+ }
177
+
178
+ ul {
179
+ @apply list-disc;
180
+ }
181
+
182
+ ol {
183
+ @apply list-decimal;
184
+ }
185
+
186
+ hr {
187
+ @apply border-secondary my-3;
188
+ }
189
+
190
+ table {
191
+ @apply border border-default;
192
+
193
+ thead, tr {
194
+ @apply border-b border-secondary last:border-b-0;
195
+ }
196
+
197
+ th {
198
+ @apply bg-subtle;
199
+ }
200
+
201
+ th, td {
202
+ @apply py-1.5 px-2 leading-[1.25] border-r border-secondary last:border-r-0;
203
+ }
204
+ }
205
+ }
206
+
145
207
  @media screen and (max-width: 788px) {
146
- [cmdk-list] {
208
+ [cmdk-list], .result-container {
147
209
  height: calc(96dvh - 50px - 50px - 20px);
148
210
  max-height: calc(96dvh - 50px - 50px - 20px);
149
211
  }
@@ -184,20 +246,20 @@ html.dark-theme [cmdk-item][data-selected='true'] mark {
184
246
  background: var(--blue-7);
185
247
  }
186
248
 
187
- [cmdk-list]::-webkit-scrollbar {
249
+ [cmdk-list]::-webkit-scrollbar, .result-container::-webkit-scrollbar {
188
250
  width: 6px;
189
251
  }
190
252
 
191
- [cmdk-list]::-webkit-scrollbar-track {
253
+ [cmdk-list]::-webkit-scrollbar-track, .result-container::-webkit-scrollbar-track {
192
254
  background-color: transparent;
193
255
  cursor: pointer;
194
256
  }
195
257
 
196
- [cmdk-list]::-webkit-scrollbar-thumb {
258
+ [cmdk-list]::-webkit-scrollbar-thumb, .result-container::-webkit-scrollbar-thumb {
197
259
  background-color: var(--slate-5);
198
260
  border-radius: 10px;
199
261
  }
200
262
 
201
- [cmdk-list]::-webkit-scrollbar-thumb:hover {
263
+ [cmdk-list]::-webkit-scrollbar-thumb:hover, .result-container::-webkit-scrollbar-thumb:hover {
202
264
  background-color: var(--slate-6);
203
265
  }
package/dist/index.d.ts CHANGED
@@ -5,14 +5,9 @@ export { addHighlight } from './src/utils';
5
5
  export * from './src/types';
6
6
  export declare const CommandItemBase: import("react").ForwardRefExoticComponent<{
7
7
  children?: React.ReactNode;
8
- } & Omit<Pick<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
9
- ref?: React.Ref<HTMLDivElement>;
10
- } & {
11
- asChild?: boolean;
12
- }, "key" | keyof import("react").HTMLAttributes<HTMLDivElement> | "asChild">, "value" | "onSelect" | "disabled"> & {
8
+ } & Omit<import("react").HTMLAttributes<HTMLDivElement>, "value" | "onSelect" | "disabled"> & {
13
9
  disabled?: boolean;
14
10
  onSelect?: (value: string) => void;
15
11
  value?: string;
16
- keywords?: string[];
17
12
  forceMount?: boolean;
18
13
  } & import("react").RefAttributes<HTMLDivElement>>;
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("@expo/styleguide-icons/outline/Download01Icon"),i=require("@expo/styleguide-icons/outline/Star01Icon"),u=require("@sanity/client"),d=require("@sanity/image-url"),p=require("@expo/styleguide-icons/custom/PlanEnterpriseIcon"),g=require("@expo/styleguide-icons/outline/BookOpen02Icon"),C=require("@expo/styleguide-icons/outline/GraduationHat02Icon"),E=require("@expo/styleguide-icons/outline/Hash02Icon"),x=require("@expo/styleguide-icons/outline/Home02Icon");const h=({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 v(){return n.createElement(c.ChevronRightIcon,{className:"icon-xs text-icon-quaternary inline-block relative mx-1 -top-px"})}const y=()=>n.createElement(s.ArrowUpRightIcon,{className:"text-icon-tertiary self-center ml-auto shrink-0"}),f=({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)"}))),N=()=>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})))),b=()=>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(N,null)))),I=u.createClient({projectId:"siias52v",dataset:"production",useCdn:!0,apiVersion:"2024-09-03"}),k=d({projectId:"siias52v",dataset:"production"});const S=async(e,t,l,a)=>{const{hits:n,libraries:r}=await t(e,a).then((e=>e.json()));l(n||r||[])},q=(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})}],H=(e,t)=>fetch(...q(e,"QEX7PB7D46","6652d26570e8628af4601e1d78ad456b","expo",20,{facetFilters:[["version:none",`version:${t}`]]})),L=e=>fetch(...q(e,"8TDSE0OHGQ","c9c791d9d5fd7f315d7f3859b32c1f3b","react-native-v2",5,{facetFilters:[["version:current"]]})),w=e=>I.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 }`),_=e=>fetch(`https://reactnative.directory/api/libraries?search=${encodeURI(e)}&limit=5`),M=(e,t)=>({dangerouslySetInnerHTML:{__html:e._highlightResult.hierarchy[`${t}`]?.value||""}}),R=(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?"…":""}`},$=(e,t=!1)=>t?{}:{dangerouslySetInnerHTML:{__html:e._highlightResult.content?.value?R(e._highlightResult.content?.value):R(e._highlightResult.hierarchy.lvl1?.value||"",82)}},V=["/versions/","/more/"],K=e=>V.some((t=>e.includes(t))),P=["/app-signing/","/build/","/build-reference/","/development/","/eas/","/eas/metadata/","/eas-update/","/submit/"],D=e=>P.some((t=>e.includes(t))),F=["/get-started/","/develop/","/deploy/","/faq/","/core-concepts/","/debugging/","/config-plugins/"],T=e=>F.some((t=>e.includes(t))),U=["/tutorial","/ui-programming/","/additional-resources/"],Z=e=>U.some((t=>e.includes(t))),A=()=>/(Mac|iPhone|iPod|iPad)/i.test(navigator?.platform??navigator?.userAgentData?.platform??""),O=(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)},G=({children:t,url:l,isExternalLink:a,isNested:s,onSelect:c,className:m,value:o})=>{const[i,u]=n.useState(!1),[d,p]=n.useState(!1);return n.createElement(e.Command.Item,{className:r.mergeClasses("relative",m),value:o,"data-nested":!!s||void 0,onMouseDown:e=>{(e.metaKey||e.ctrlKey)&&p(!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,!!d||a),d?p(!1):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!"))},j=new Intl.NumberFormat,B=({item:e,onSelect:t,query:l})=>n.createElement(G,{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:O(e.npmPkg,l)}}),n.createElement("p",{className:"flex items-center gap-1 text-3xs text-quaternary"},n.createElement(i.Star01Icon,{className:"icon-2xs text-icon-quaternary"}),j.format(e.github.stats.stars)," stars",e.npm.downloads?n.createElement(n.Fragment,null," ","· ",n.createElement(o.Download01Icon,{className:"icon-2xs text-icon-quaternary"}),j.format(e.npm.downloads)," downloads"):void 0)),n.createElement(y,null))),X=({item:e,levelKey:t="lvl0"})=>e.hierarchy[t]?n.createElement(n.Fragment,null,n.createElement(v,null),n.createElement("span",{...M(e,t)})):null,Q=({item:e,onSelect:t})=>{const{lvl0:l,lvl1:a,lvl2:r,lvl3:s,lvl4:c}=e.hierarchy;return n.createElement(G,{value:`rn-${e.objectID}`,url:e.url,isExternalLink:!0,onSelect:t},n.createElement("div",{className:"inline-flex gap-3 items-center"},n.createElement(f,{className:"shrink-0"}),n.createElement("div",null,c&&n.createElement(n.Fragment,null,n.createElement("p",{className:"text-xs font-medium",...M(e,"lvl4")}),n.createElement("p",{className:"text-3xs text-quaternary"},n.createElement("span",{...M(e,"lvl0")}),n.createElement(X,{item:e,levelKey:"lvl1"}),n.createElement(X,{item:e,levelKey:"lvl2"}),n.createElement(X,{item:e,levelKey:"lvl3"}))),!c&&s&&n.createElement(n.Fragment,null,n.createElement("p",{className:"text-xs font-medium",...M(e,"lvl3")}),n.createElement("p",{className:"text-3xs text-quaternary"},n.createElement("span",{...M(e,"lvl0")}),n.createElement(X,{item:e,levelKey:"lvl1"}),n.createElement(X,{item:e,levelKey:"lvl2"}))),!s&&r&&n.createElement(n.Fragment,null,n.createElement("p",{className:"text-xs font-medium",...M(e,"lvl2")}),n.createElement("p",{className:"text-3xs text-quaternary"},n.createElement("span",{...M(e,"lvl0")}),n.createElement(X,{item:e,levelKey:"lvl1"}))),!s&&!r&&a&&n.createElement(n.Fragment,null,n.createElement("p",{className:"text-xs font-medium",...M(e,"lvl1")}),n.createElement("p",{className:"text-3xs text-quaternary",...M(e,"lvl0")})),!s&&!r&&!a&&l&&n.createElement("p",{className:"text-xs font-medium",...M(e,"lvl0")}),n.createElement("p",{className:"text-2xs text-secondary",...$(e,!0)})),n.createElement(y,null)))},W=({url:e,className:t,isNested:l})=>l?n.createElement(E.Hash02Icon,{className:r.mergeClasses("icon-sm text-icon-quaternary",t)}):K(e)?n.createElement(r.DocsLogo,{className:r.mergeClasses("text-icon-secondary",t)}):D(e)?n.createElement(p.PlanEnterpriseIcon,{className:r.mergeClasses("text-icon-secondary",t)}):T(e)?n.createElement(x.Home02Icon,{className:r.mergeClasses("text-icon-secondary",t)}):Z(e)?n.createElement(C.GraduationHat02Icon,{className:r.mergeClasses("text-icon-secondary",t)}):n.createElement(g.BookOpen02Icon,{className:r.mergeClasses("text-icon-secondary",t)}),z=e=>K(e)?"Reference":D(e)?"Expo Application Services":T(e)?"Home":Z(e)?"Learn":"Guides",J=({url:e,isNested:t=!1})=>t?n.createElement(n.Fragment,null,n.createElement("span",{className:"text-3xs text-quaternary"},z(e)),n.createElement(v,null)):n.createElement("p",{className:"text-3xs text-quaternary"},z(e)),Y=({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(G,{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 justify-between"},n.createElement("div",{className:"inline-flex items-center gap-3 break-words"},n.createElement(W,{url:e.url,isNested:l,className:"shrink-0"}),n.createElement("div",null,i&&n.createElement(n.Fragment,null,n.createElement("p",{className:u,...M(e,"lvl6")}),!l&&n.createElement("p",{className:"text-3xs text-quaternary"},n.createElement(J,{url:e.url,isNested:!0}),n.createElement("span",{...M(e,"lvl0")}),n.createElement(X,{item:e,levelKey:"lvl2"}),n.createElement(X,{item:e,levelKey:"lvl3"}),n.createElement(X,{item:e,levelKey:"lvl4"}))),!i&&o&&n.createElement(n.Fragment,null,n.createElement("p",{className:u,...M(e,"lvl4")}),!l&&n.createElement("p",{className:d},n.createElement(J,{url:e.url,isNested:!0}),n.createElement("span",{...M(e,"lvl0")}),n.createElement(X,{item:e,levelKey:"lvl2"}),n.createElement(X,{item:e,levelKey:"lvl3"}))),!i&&!o&&m&&n.createElement(n.Fragment,null,n.createElement("p",{className:u,...M(e,"lvl3")}),!l&&n.createElement("p",{className:d},n.createElement(J,{url:e.url,isNested:!0}),n.createElement("span",{...M(e,"lvl0")}),n.createElement(X,{item:e,levelKey:"lvl2"}))),!i&&!o&&!m&&c&&n.createElement(n.Fragment,null,n.createElement("p",{className:u,...M(e,"lvl2")}),!l&&n.createElement("p",{className:d},n.createElement(J,{url:e.url,isNested:!0}),n.createElement("span",{...M(e,"lvl0")}))),!i&&!o&&!m&&!c&&s&&n.createElement(n.Fragment,null,n.createElement("p",{className:u,...M(e,"lvl0")}),n.createElement(J,{url:e.url})),(!l||e.content)&&n.createElement("p",{className:r.mergeClasses("text-secondary",l?"text-3xs":"text-2xs"),...$(e)}))),!a&&n.createElement(y,null)))},ee=({item:e,onSelect:t,query:l})=>{return n.createElement(G,{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,k.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:O(e.title,l)}}),n.createElement("p",{className:"text-3xs text-quaternary",dangerouslySetInnerHTML:{__html:O(e.metadataDescription,l)}})),n.createElement(y,null)));var a},te=e.Command.Item;exports.CommandItemBase=te,exports.CommandItemBaseWithCopy=G,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(""),[E,x]=n.useState(null),[v,y]=n.useState([]),[f,N]=n.useState([]),[I,k]=n.useState([]),[q,M]=n.useState([]),R=async()=>S(g,H,y,r),$=async()=>(async(e,t,l)=>{l(await t(e))})(g,w,N),V=async()=>S(g,L,k),K=async()=>S(g,_,M),P=()=>m(!1),D=e=>{Promise.all([R(),$(),V(),K(),...o?.map((e=>e.getItemsAsync(g)))]).then(e)};n.useEffect((()=>{x("undefined"!=typeof navigator&&A())}),[]),n.useEffect((()=>{if(null!==E){const e=e=>{"k"===e.key&&(E?e.metaKey:e.ctrlKey)&&(e.preventDefault(),m((e=>!e)))};return document.addEventListener("keydown",e,!1),()=>document.removeEventListener("keydown",e)}}),[E]),n.useEffect((()=>{c&&!i&&D((()=>{u(!0),p(!1)}))}),[c]),n.useEffect((()=>{if(c){p(!0);const e=setTimeout((()=>D((()=>p(!1)))),150);return()=>clearTimeout(e)}}),[g]);const F=a(v.map((e=>({...e,baseUrl:e.url.replace(/#.+/,"")}))),"baseUrl"),T=[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(Y,{isNested:0!==t,item:e,onSelect:P,key:`hit-expo-docs-${e.objectID}`,transformUrl:s})))))),f.length>0&&n.createElement(e.Command.Group,{heading:"Expo blog",key:"expo-blog-group"},f.map((e=>n.createElement(ee,{item:e,onSelect:P,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(Q,{item:e,onSelect:P,key:`hit-rn-docs-${e.objectID}`})))),q.length>0&&n.createElement(e.Command.Group,{heading:"React Native directory",key:"rn-directory-group"},q.map((e=>n.createElement(B,{item:e,onSelect:P,key:`hit-rn-dir-${e.npmPkg}`,query:g}))))];return o?.forEach((({items:t,heading:l,sectionIndex:a})=>t.length>0&&T.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(h,{isLoading:d}),n.createElement(e.Command.List,null,i&&T,0===T.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(b,null))},exports.CommandMenuTrigger=({setOpen:e,className:l})=>{const[a,s]=n.useState(null);return n.useEffect((()=>{s("undefined"!=typeof navigator&&A())}),[]),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=O;
1
+ "use strict";var e=require("cmdk"),t=require("@kapaai/react-sdk"),a=require("react"),l=require("@expo/styleguide-icons/outline/SearchSmIcon"),n=require("@expo/styleguide-icons/outline/Stars02Icon"),r=require("@expo/styleguide-icons/outline/XIcon"),s=require("lodash.groupby"),c=require("@expo/styleguide"),o=require("@expo/styleguide-icons/outline/ArrowUpRightIcon"),m=require("@expo/styleguide-icons/outline/ChevronRightIcon"),i=require("@sanity/client"),u=require("@sanity/image-url"),d=require("@expo/styleguide-icons/custom/GithubIcon"),p=require("@expo/styleguide-icons/outline/Download01Icon"),g=require("@expo/styleguide-icons/outline/Star01Icon"),E=require("@expo/styleguide-icons/custom/PlanEnterpriseIcon"),x=require("@expo/styleguide-icons/outline/BookOpen02Icon"),h=require("@expo/styleguide-icons/outline/GraduationHat02Icon"),C=require("@expo/styleguide-icons/outline/Hash02Icon"),v=require("@expo/styleguide-icons/outline/Home02Icon"),y=require("@expo/styleguide-icons/outline/ClipboardIcon"),f=require("@expo/styleguide-icons/outline/ThumbsDownIcon"),N=require("@expo/styleguide-icons/outline/ThumbsUpIcon"),b=require("@expo/styleguide-icons/solid/ThumbsDownSolidIcon"),k=require("@expo/styleguide-icons/solid/ThumbsUpSolidIcon"),I=require("markdown-to-jsx");const S=({isLoading:e,className:t})=>a.createElement("div",{role:"progressbar",className:c.mergeClasses("bg-palette-blue9 h-0.5 absolute mt-[11px] left-px",e&&"animate-[searchUIBarLoader_2s_infinite_ease-in-out]",t)});function w(){return a.createElement(m.ChevronRightIcon,{className:"icon-xs text-icon-quaternary inline-block relative mx-1 -top-px"})}const q=()=>a.createElement(o.ArrowUpRightIcon,{className:"text-icon-tertiary self-center ml-auto shrink-0"}),L=({className:e})=>a.createElement("svg",{viewBox:"-11.5 -10.23174 23 20.46348",className:c.mergeClasses("icon-md text-icon-secondary",e)},a.createElement("circle",{cx:"0",cy:"0",r:"2.05",fill:"currentColor"}),a.createElement("g",{stroke:"currentColor",strokeWidth:"1",fill:"none"},a.createElement("ellipse",{rx:"11",ry:"4.2"}),a.createElement("ellipse",{rx:"11",ry:"4.2",transform:"rotate(60)"}),a.createElement("ellipse",{rx:"11",ry:"4.2",transform:"rotate(120)"}))),H=({className:e})=>a.createElement("svg",{width:"77",height:"19",viewBox:"0 0 2197 500",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-label":"Algolia",className:e,role:"img"},a.createElement("g",{clipPath:"url(#clip0_1_2)"},a.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"}),a.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"}),a.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"}),a.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"}),a.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"}),a.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"}),a.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"}),a.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"}),a.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"})),a.createElement("defs",null,a.createElement("clipPath",null,a.createElement("rect",{width:2196.2,height:500})))),M=({className:e})=>a.createElement("svg",{height:"19",width:"72",viewBox:"0 0 989 262",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",className:e},a.createElement("path",{d:"m345.202 187.216c-1.602 0-2.9-1.3-2.898-2.903l.192-131.3758c.003-1.599 1.3-2.8941 2.899-2.8941h21.913c1.601 0 2.899 1.2977 2.899 2.8983v68.9056c0 2.83 3.639 3.982 5.268 1.668l30.607-43.4845c.543-.7712 1.427-1.2301 2.37-1.2301h26.556c2.365 0 3.734 2.6785 2.35 4.5952l-34.565 47.8594c-.751 1.04-.73 2.45.053 3.466l36.845 47.828c1.468 1.905.11 4.667-2.296 4.667h-28.159c-.933 0-1.808-.449-2.353-1.206l-31.425-43.693c-1.644-2.285-5.251-1.123-5.251 1.692v40.308c0 1.601-1.298 2.899-2.899 2.899z"}),a.createElement("path",{d:"m477.369 190.227c-7.763 0-14.355-1.472-19.776-4.417-5.354-3.011-9.436-6.993-12.247-11.945-2.744-5.02-4.116-10.541-4.116-16.564 0-5.019.77-9.603 2.309-13.753 1.539-4.149 4.016-7.796 7.429-10.941 3.48-3.213 8.131-5.89 13.953-8.031 4.016-1.473 8.801-2.778 14.355-3.915 5.555-1.138 11.846-2.209 18.872-3.213 4.589-.699 9.476-1.441 14.664-2.225 1.701-.258 2.481 2.042.974 2.873-1.028.566-2.292-.179-2.378-1.35-.372-5.108-1.881-8.956-4.526-11.544-3.079-3.012-8.232-4.518-15.459-4.518-4.016 0-8.198.971-12.548 2.911-3.548 1.583-6.228 4.168-8.04 7.754-.706 1.398-2.282 2.21-3.774 1.737l-19.281-6.114c-1.515-.48-2.37-2.096-1.811-3.583 2.906-7.7358 7.751-14.125 14.535-19.1678 7.563-5.6216 17.869-8.4323 30.919-8.4323 9.57 0 18.069 1.4723 25.497 4.4169 7.429 2.9446 13.05 8.0307 16.865 15.2584 2.142 4.0154 3.413 8.0308 3.815 12.0458.401 4.016.602 8.5.602 13.452v63.355c0 1.601-1.298 2.899-2.898 2.899h-18.095c-1.601 0-2.899-1.298-2.899-2.899v-14.76c0-1.47 1.876-2.088 2.75-.906.395.534.399 1.264.002 1.796-5.102 6.832-10.603 11.819-16.504 14.962-6.09 3.212-13.82 4.818-23.189 4.818zm5.822-21.482c5.019 0 9.236-.87 12.649-2.61 3.48-1.807 6.223-3.848 8.231-6.123 2.075-2.276 3.48-4.183 4.216-5.722 1.406-2.945 2.209-6.358 2.41-10.24.211-3.117.339-5.818.383-8.101.017-.882.847-1.529 1.703-1.315 1.428.357 1.345 2.42-.106 2.665-5.205.882-9.612 1.66-13.224 2.334-5.019.87-9.068 1.674-12.146 2.41-3.079.736-5.789 1.539-8.131 2.409-2.677 1.071-4.852 2.242-6.525 3.513-1.606 1.205-2.811 2.543-3.614 4.016-.736 1.472-1.104 3.112-1.104 4.919 0 2.476.602 4.617 1.807 6.424 1.271 1.74 3.045 3.079 5.32 4.016s4.986 1.405 8.131 1.405z"}),a.createElement("path",{d:"m611.484 190.227c-10.774 0-19.775-2.509-27.003-7.529-7.228-5.019-12.682-11.845-16.363-20.478-3.614-8.633-5.421-18.37-5.421-29.212 0-10.841 1.807-20.579 5.421-29.212 3.614-8.6329 8.934-15.4591 15.961-20.4783s15.694-7.5288 26-7.5288c10.373 0 19.408 2.4761 27.104 7.4284s13.652 11.745 17.868 20.3777c4.283 8.567 6.425 18.371 6.425 29.413 0 10.842-2.108 20.579-6.324 29.212-4.15 8.633-9.972 15.459-17.467 20.478-7.496 5.02-16.229 7.529-26.201 7.529zm-50.506 45.173c-1.601 0-2.898-1.297-2.898-2.898v-150.8033c0-1.6007 1.297-2.8983 2.898-2.8983h18.296c1.6 0 2.898 1.2976 2.898 2.8983v69.6793c0 .943.764 1.707 1.706 1.707.943 0 1.707.764 1.707 1.707v77.71c0 1.601-1.298 2.898-2.898 2.898zm46.089-69.466c5.89 0 10.708-1.472 14.456-4.417 3.747-2.944 6.525-6.893 8.332-11.845 1.807-5.019 2.71-10.574 2.71-16.664 0-6.023-.937-11.511-2.811-16.463-1.874-5.019-4.785-9.001-8.733-11.946-3.882-3.011-8.868-4.517-14.958-4.517-5.688 0-10.306 1.372-13.853 4.116-3.48 2.744-6.023 6.592-7.629 11.544s-2.409 10.708-2.409 17.266c0 6.559.803 12.314 2.409 17.266 1.606 4.953 4.216 8.801 7.83 11.544 3.681 2.744 8.566 4.116 14.656 4.116z"}),a.createElement("path",{d:"m707.657 190.227c-7.763 0-14.355-1.472-19.775-4.417-5.354-3.011-9.437-6.993-12.247-11.945-2.744-5.02-4.116-10.541-4.116-16.564 0-5.019.77-9.603 2.309-13.753 1.539-4.149 4.015-7.796 7.428-10.941 3.48-3.213 8.131-5.89 13.954-8.031 4.015-1.473 8.8-2.778 14.355-3.915 5.554-1.138 11.845-2.209 18.872-3.213 4.588-.699 9.476-1.441 14.663-2.225 1.702-.258 2.482 2.042.974 2.873-1.027.566-2.292-.179-2.377-1.35-.372-5.108-1.881-8.956-4.526-11.544-3.079-3.012-8.232-4.518-15.46-4.518-4.015 0-8.198.971-12.548 2.911-3.548 1.583-6.227 4.168-8.039 7.754-.706 1.398-2.282 2.21-3.775 1.737l-19.281-6.114c-1.514-.48-2.369-2.096-1.81-3.583 2.906-7.7358 7.751-14.125 14.535-19.1678 7.562-5.6216 17.868-8.4323 30.918-8.4323 9.57 0 18.069 1.4723 25.498 4.4169 7.428 2.9446 13.05 8.0307 16.865 15.2584 2.141 4.0154 3.413 8.0308 3.814 12.0458.402 4.016.603 8.5.603 13.452v63.355c0 1.601-1.298 2.899-2.899 2.899h-18.095c-1.6 0-2.898-1.298-2.898-2.899v-14.76c0-1.47 1.876-2.088 2.75-.906.395.534.399 1.264.001 1.796-5.101 6.832-10.603 11.819-16.504 14.962-6.09 3.212-13.819 4.818-23.189 4.818zm5.823-21.482c5.019 0 9.235-.87 12.648-2.61 3.48-1.807 6.224-3.848 8.232-6.123 2.074-2.276 3.48-4.183 4.216-5.722 1.405-2.945 2.208-6.358 2.409-10.24.211-3.117.339-5.818.384-8.101.017-.882.847-1.529 1.702-1.315 1.428.357 1.346 2.42-.105 2.665-5.205.882-9.613 1.66-13.224 2.334-5.019.87-9.068 1.674-12.147 2.41-3.078.736-5.788 1.539-8.131 2.409-2.677 1.071-4.852 2.242-6.525 3.513-1.606 1.205-2.81 2.543-3.614 4.016-.736 1.472-1.104 3.112-1.104 4.919 0 2.476.603 4.617 1.807 6.424 1.272 1.74 3.045 3.079 5.321 4.016 2.275.937 4.985 1.405 8.131 1.405z"}),a.createElement("path",{d:"m795.884 187.216c-1.601 0-2.898-1.298-2.898-2.899v-21.508c0-1.6 1.297-2.898 2.898-2.898h21.508c1.601 0 2.899 1.298 2.899 2.898v21.508c0 1.601-1.298 2.899-2.899 2.899z"}),a.createElement("path",{d:"m876.97 190.227c-7.763 0-14.355-1.472-19.776-4.417-5.353-3.011-9.436-6.993-12.247-11.945-2.743-5.02-4.115-10.541-4.115-16.564 0-5.019.769-9.603 2.309-13.753 1.539-4.149 4.015-7.796 7.428-10.941 3.48-3.213 8.131-5.89 13.954-8.031 4.015-1.473 8.8-2.778 14.355-3.915 5.554-1.138 11.845-2.209 18.872-3.213 4.588-.699 9.476-1.441 14.663-2.225 1.702-.258 2.482 2.042.974 2.873-1.027.566-2.292-.179-2.377-1.35-.372-5.108-1.881-8.956-4.527-11.544-3.078-3.012-8.231-4.518-15.459-4.518-4.015 0-8.198.971-12.548 2.911-3.548 1.583-6.228 4.168-8.039 7.754-.706 1.398-2.282 2.21-3.775 1.737l-19.281-6.114c-1.515-.48-2.37-2.096-1.811-3.583 2.907-7.7358 7.752-14.125 14.536-19.1678 7.562-5.6216 17.868-8.4323 30.918-8.4323 9.57 0 18.069 1.4723 25.498 4.4169 7.428 2.9446 13.05 8.0307 16.864 15.2584 2.142 4.0154 3.413 8.0308 3.815 12.0458.401 4.016.602 8.5.602 13.452v63.355c0 1.601-1.297 2.899-2.898 2.899h-18.095c-1.601 0-2.898-1.298-2.898-2.899v-14.76c0-1.47 1.876-2.088 2.75-.906.395.534.399 1.264.001 1.796-5.102 6.832-10.603 11.819-16.504 14.962-6.09 3.212-13.82 4.818-23.189 4.818zm5.823-21.482c5.019 0 9.235-.87 12.648-2.61 3.48-1.807 6.224-3.848 8.232-6.123 2.074-2.276 3.479-4.183 4.216-5.722 1.405-2.945 2.208-6.358 2.409-10.24.211-3.117.339-5.818.384-8.101.017-.882.846-1.529 1.702-1.315 1.428.357 1.345 2.42-.106 2.665-5.204.882-9.612 1.66-13.223 2.334-5.019.87-9.068 1.674-12.147 2.41-3.078.736-5.789 1.539-8.131 2.409-2.677 1.071-4.852 2.242-6.525 3.513-1.606 1.205-2.811 2.543-3.614 4.016-.736 1.472-1.104 3.112-1.104 4.919 0 2.476.602 4.617 1.807 6.424 1.272 1.74 3.045 3.079 5.32 4.016 2.276.937 4.986 1.405 8.132 1.405z"}),a.createElement("path",{d:"m962.788 63.7427c-1.601 0-2.899-1.2976-2.899-2.8983v-18.2957c0-1.6007 1.298-2.8983 2.899-2.8983h21.508c1.6 0 2.898 1.2976 2.898 2.8983v18.2957c0 1.6007-1.298 2.8983-2.898 2.8983zm0 123.4733c-1.601 0-2.899-1.298-2.899-2.899v-102.6183c0-1.6007 1.298-2.8983 2.899-2.8983h21.508c1.6 0 2.898 1.2976 2.898 2.8983v102.6183c0 1.601-1.298 2.899-2.898 2.899z"}),a.createElement("path",{d:"m195.824.5c36.051 0 65.277 29.2254 65.277 65.2764v130.4476c0 36.051-29.226 65.276-65.277 65.276h-130.447c-36.051 0-65.276414-29.225-65.276414-65.276v-130.4476c0-36.051 29.225414-65.2764 65.276414-65.2764zm-116.5564 56.5498c-.9608 0-1.7401.7785-1.7403 1.7393v136.5899c0 .961.7794 1.74 1.7403 1.74h30.3914c.961 0 1.74-.779 1.74-1.74v-38.541c0-.961.779-1.74 1.74-1.74h14.775c.614 0 1.182.323 1.495.851l23.995 40.32c.313.527.881.85 1.495.85h35.002c1.36 0 2.194-1.49 1.483-2.65l-34.842-56.785c-.357-.582-.341-1.319.042-1.884l34.817-51.466c.781-1.1555-.046-2.7149-1.442-2.7149h-34.843c-.608 0-1.172.3172-1.487.837l-24.899 41.0349c-.316.52-.88.838-1.488.838h-14.103c-.961 0-1.74-.779-1.74-1.74v-63.7999c0-.9609-.779-1.7392-1.74-1.7393z"}));function T({isPromptMode:e}){return a.createElement("div",{className:"flex gap-4 px-4 h-11 items-center"},a.createElement("p",{className:"text-3xs text-tertiary inline-flex gap-2 items-center max-md-gutters:hidden"},a.createElement("kbd",null,"↵"),a.createElement("span",null,"to select")),a.createElement("p",{className:"text-3xs text-tertiary inline-flex gap-2 items-center max-md-gutters:hidden"},a.createElement("kbd",null,"↑"),a.createElement("kbd",null,"↓"),a.createElement("span",null,"to navigate")),a.createElement("p",{className:"text-3xs text-tertiary inline-flex gap-2 items-center max-md-gutters:hidden"},a.createElement("kbd",null,"esc"),a.createElement("span",null,"to close")),e?a.createElement("p",{className:"text-3xs text-tertiary inline-flex gap-1.5 items-center ml-auto"},a.createElement("span",null,"AI assistant by"),a.createElement("a",{href:"https://www.kapa.ai/",target:"_blank"},a.createElement(M,{className:"hocus:opacity-80"}))):a.createElement("p",{className:"text-3xs text-tertiary inline-flex gap-2 items-center ml-auto"},a.createElement("span",null,"Search by"),a.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"},a.createElement(H,{className:"hocus:opacity-80"}))))}const _=i.createClient({projectId:"siias52v",dataset:"production",useCdn:!0,apiVersion:"2024-09-03"}),R=u({projectId:"siias52v",dataset:"production"});const P=async(e,t,a,l)=>{const{hits:n,libraries:r}=await t(e,l).then((e=>e.json()));a(n||r||[])},A=(e,t,a,l,n,r={})=>[`https://${t}-dsn.algolia.net/1/indexes/${l}/query`,{method:"POST",headers:{"X-Algolia-Application-Id":t,"X-Algolia-API-Key":a},body:JSON.stringify({params:`query=${e}&hitsPerPage=${n}`,highlightPreTag:"<mark>",highlightPostTag:"</mark>",...r})}],V=(e,t)=>fetch(...A(e,"QEX7PB7D46","6652d26570e8628af4601e1d78ad456b","expo",20,{facetFilters:[["version:none",`version:${t}`]]})),$=e=>fetch(...A(e,"8TDSE0OHGQ","c9c791d9d5fd7f315d7f3859b32c1f3b","react-native-v2",5,{facetFilters:[["version:current"]]})),z=e=>_.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 }`),F=e=>fetch(`https://reactnative.directory/api/libraries?search=${encodeURI(e)}&limit=5`),D=(e,t)=>({dangerouslySetInnerHTML:{__html:e._highlightResult.hierarchy[`${t}`]?.value||""}}),K=(e,t=36)=>{if(!e||!e.length)return"";const a=Math.max(e.indexOf("<mark>")-t,0),l=Math.min(e.indexOf("</mark>")+t+6,e.length);return`${0!==a?"…":""}${e.substring(a,l).trim()}${l!==e.length?"…":""}`},U=(e,t=!1)=>t?{}:{dangerouslySetInnerHTML:{__html:e._highlightResult.content?.value?K(e._highlightResult.content?.value):K(e._highlightResult.hierarchy.lvl1?.value||"",82)}},G=["/versions/","/more/"],B=e=>G.some((t=>e.includes(t))),Z=["/app-signing/","/build/","/build-reference/","/development/","/eas/","/eas/metadata/","/eas-update/","/submit/"],j=e=>Z.some((t=>e.includes(t))),O=["/get-started/","/develop/","/deploy/","/faq/","/core-concepts/","/debugging/","/config-plugins/"],X=e=>O.some((t=>e.includes(t))),Q=["/tutorial","/ui-programming/","/additional-resources/"],W=e=>Q.some((t=>e.includes(t))),J=()=>/(Mac|iPhone|iPod|iPad)/i.test(navigator?.platform??navigator?.userAgentData?.platform??""),Y=(e,t)=>{if(!e||!e.length)return"";const a=e.toLowerCase().indexOf(t.toLowerCase());if(-1===a)return e;const l=a+t.length;return e.substring(0,a)+"<mark>"+e.substring(a,l)+"</mark>"+e.substring(l)},ee=({children:t,url:l,isExternalLink:n,isNested:r,onSelect:s,className:o,value:m})=>{const[i,u]=a.useState(!1),[d,p]=a.useState(!1);return a.createElement(e.Command.Item,{className:c.mergeClasses("relative",o),value:m,"data-nested":!!r||void 0,onMouseDown:e=>{(e.metaKey||e.ctrlKey)&&p(!0)},onMouseUp:e=>{!l||1!==e.button&&2!==e.button||function(e){navigator.clipboard?.writeText(e),u(!0),setTimeout((()=>u(!1)),1500)}(l)},onSelect:()=>{l&&((e,t=!1)=>{const a=document.createElement("a");t&&(a.target="_blank",a.rel="noopener noreferrer"),a.href=e,a.click()})(l,!!d||n),d?p(!1):s&&s()},onContextMenu:e=>{e.preventDefault()}},t,i&&a.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!"))},te=new Intl.NumberFormat,ae=({item:e,onSelect:t,query:l})=>a.createElement(ee,{value:`rnd-${e.npmPkg}`,url:e.githubUrl,isExternalLink:!0,onSelect:t},a.createElement("div",{className:"inline-flex gap-3 items-center"},a.createElement(d.GithubIcon,{className:"text-icon-secondary"}),a.createElement("div",null,a.createElement("p",{className:"text-xs font-medium",dangerouslySetInnerHTML:{__html:Y(e.npmPkg,l)}}),a.createElement("p",{className:"flex items-center gap-1 text-3xs text-quaternary"},a.createElement(g.Star01Icon,{className:"icon-2xs text-icon-quaternary"}),te.format(e.github.stats.stars)," stars",e.npm.downloads?a.createElement(a.Fragment,null," ","· ",a.createElement(p.Download01Icon,{className:"icon-2xs text-icon-quaternary"}),te.format(e.npm.downloads)," downloads"):void 0)),a.createElement(q,null))),le=({item:e,levelKey:t="lvl0"})=>e.hierarchy[t]?a.createElement(a.Fragment,null,a.createElement(w,null),a.createElement("span",{...D(e,t)})):null,ne=({item:e,onSelect:t})=>{const{lvl0:l,lvl1:n,lvl2:r,lvl3:s,lvl4:c}=e.hierarchy;return a.createElement(ee,{value:`rn-${e.objectID}`,url:e.url,isExternalLink:!0,onSelect:t},a.createElement("div",{className:"inline-flex gap-3 items-center"},a.createElement(L,{className:"shrink-0"}),a.createElement("div",null,c&&a.createElement(a.Fragment,null,a.createElement("p",{className:"text-xs font-medium",...D(e,"lvl4")}),a.createElement("p",{className:"text-3xs text-quaternary"},a.createElement("span",{...D(e,"lvl0")}),a.createElement(le,{item:e,levelKey:"lvl1"}),a.createElement(le,{item:e,levelKey:"lvl2"}),a.createElement(le,{item:e,levelKey:"lvl3"}))),!c&&s&&a.createElement(a.Fragment,null,a.createElement("p",{className:"text-xs font-medium",...D(e,"lvl3")}),a.createElement("p",{className:"text-3xs text-quaternary"},a.createElement("span",{...D(e,"lvl0")}),a.createElement(le,{item:e,levelKey:"lvl1"}),a.createElement(le,{item:e,levelKey:"lvl2"}))),!s&&r&&a.createElement(a.Fragment,null,a.createElement("p",{className:"text-xs font-medium",...D(e,"lvl2")}),a.createElement("p",{className:"text-3xs text-quaternary"},a.createElement("span",{...D(e,"lvl0")}),a.createElement(le,{item:e,levelKey:"lvl1"}))),!s&&!r&&n&&a.createElement(a.Fragment,null,a.createElement("p",{className:"text-xs font-medium",...D(e,"lvl1")}),a.createElement("p",{className:"text-3xs text-quaternary",...D(e,"lvl0")})),!s&&!r&&!n&&l&&a.createElement("p",{className:"text-xs font-medium",...D(e,"lvl0")}),a.createElement("p",{className:"text-2xs text-secondary",...U(e,!0)})),a.createElement(q,null)))},re=({url:e,className:t,isNested:l})=>l?a.createElement(C.Hash02Icon,{className:c.mergeClasses("icon-sm text-icon-quaternary",t)}):B(e)?a.createElement(c.DocsLogo,{className:c.mergeClasses("text-icon-secondary",t)}):j(e)?a.createElement(E.PlanEnterpriseIcon,{className:c.mergeClasses("text-icon-secondary",t)}):X(e)?a.createElement(v.Home02Icon,{className:c.mergeClasses("text-icon-secondary",t)}):W(e)?a.createElement(h.GraduationHat02Icon,{className:c.mergeClasses("text-icon-secondary",t)}):a.createElement(x.BookOpen02Icon,{className:c.mergeClasses("text-icon-secondary",t)}),se=e=>B(e)?"Reference":j(e)?"Expo Application Services":X(e)?"Home":W(e)?"Learn":"Guides",ce=({url:e,isNested:t=!1})=>t?a.createElement(a.Fragment,null,a.createElement("span",{className:"text-3xs text-quaternary"},se(e)),a.createElement(w,null)):a.createElement("p",{className:"text-3xs text-quaternary"},se(e)),oe=({item:e,onSelect:t,isNested:l,transformUrl:n})=>{const{lvl0:r,lvl2:s,lvl3:o,lvl4:m,lvl6:i}=e.hierarchy,u=c.mergeClasses(l?"text-2xs":"text-xs font-medium"),d=c.mergeClasses("text-3xs text-quaternary",l&&"hidden");return a.createElement(ee,{className:c.mergeClasses(l&&"ml-8 !min-h-[32px]"),value:`expodocs-${e.objectID}`,onSelect:t,url:n?n(e.url):e.url,isNested:l,isExternalLink:!n},a.createElement("div",{className:"flex gap-3 justify-between"},a.createElement("div",{className:"inline-flex items-center gap-3 break-words"},a.createElement(re,{url:e.url,isNested:l,className:"shrink-0"}),a.createElement("div",null,i&&a.createElement(a.Fragment,null,a.createElement("p",{className:u,...D(e,"lvl6")}),!l&&a.createElement("p",{className:"text-3xs text-quaternary"},a.createElement(ce,{url:e.url,isNested:!0}),a.createElement("span",{...D(e,"lvl0")}),a.createElement(le,{item:e,levelKey:"lvl2"}),a.createElement(le,{item:e,levelKey:"lvl3"}),a.createElement(le,{item:e,levelKey:"lvl4"}))),!i&&m&&a.createElement(a.Fragment,null,a.createElement("p",{className:u,...D(e,"lvl4")}),!l&&a.createElement("p",{className:d},a.createElement(ce,{url:e.url,isNested:!0}),a.createElement("span",{...D(e,"lvl0")}),a.createElement(le,{item:e,levelKey:"lvl2"}),a.createElement(le,{item:e,levelKey:"lvl3"}))),!i&&!m&&o&&a.createElement(a.Fragment,null,a.createElement("p",{className:u,...D(e,"lvl3")}),!l&&a.createElement("p",{className:d},a.createElement(ce,{url:e.url,isNested:!0}),a.createElement("span",{...D(e,"lvl0")}),a.createElement(le,{item:e,levelKey:"lvl2"}))),!i&&!m&&!o&&s&&a.createElement(a.Fragment,null,a.createElement("p",{className:u,...D(e,"lvl2")}),!l&&a.createElement("p",{className:d},a.createElement(ce,{url:e.url,isNested:!0}),a.createElement("span",{...D(e,"lvl0")}))),!i&&!m&&!o&&!s&&r&&a.createElement(a.Fragment,null,a.createElement("p",{className:u,...D(e,"lvl0")}),a.createElement(ce,{url:e.url})),(!l||e.content)&&a.createElement("p",{className:c.mergeClasses("text-secondary",l?"text-3xs":"text-2xs"),...U(e)}))),!n&&a.createElement(q,null)))},me=({item:e,onSelect:t,query:l})=>{return a.createElement(ee,{value:`expo-blog-${e.slug.current}`,url:`https://expo.dev/blog/${e.slug.current}`,isExternalLink:!0,onSelect:t},a.createElement("div",{className:"inline-flex gap-3 items-center"},a.createElement("img",{src:(n=e.mainImage.image.asset._ref,R.image(n).auto("format").height(150).url()),alt:e.mainImage.altText,className:"size-11 object-cover rounded-md my-0.5"}),a.createElement("div",null,a.createElement("p",{className:"text-xs font-medium",dangerouslySetInnerHTML:{__html:Y(e.title,l)}}),a.createElement("p",{className:"text-3xs text-quaternary",dangerouslySetInnerHTML:{__html:Y(e.metadataDescription,l)}})),a.createElement(q,null)));var n};function ie({children:e,isLoading:t}){const[l,n]=a.useState(!1),[r,s]=a.useState(!1);return a.useEffect((()=>{if(a.isValidElement(e)&&"string"==typeof e.props.children)return n(!0)}),[t]),a.createElement("pre",{className:"relative shadow-xs"},e,a.createElement(c.Button,{className:"absolute right-1.5 top-1.5",leftSlot:a.createElement(y.ClipboardIcon,{className:"text-icon-secondary"}),size:"xs",theme:"quaternary",disabled:r||!l,onClick:()=>{a.isValidElement(e)&&"string"==typeof e.props.children&&(navigator.clipboard?.writeText(e?.props?.children),s(!0),setTimeout((()=>s(!1)),1500))}}))}function ue({conversation:e,isGeneratingAnswer:t,isPreparingAnswer:l,addFeedback:n}){const[r,s]=a.useState(!1),[o,m]=a.useState(void 0),i=l||t,u=e?.getLatest();return a.createElement(a.Fragment,null,a.createElement(S,{isLoading:i}),a.createElement("div",{className:"result-container flex flex-col gap-4 p-4 w-full"},l&&a.createElement("div",{className:"flex text-xs size-full items-center justify-center text-quaternary"},"Preparing answer..."),a.createElement(I,{children:u?.answer??"",options:{overrides:{a:{component:c.Link},pre:{component:ie,props:{isLoading:i}}}},className:"prompt-result text-xs"}),!i&&u?.id&&a.createElement(a.Fragment,null,a.createElement("div",{className:"inline-flex items-center w-full gap-2"},a.createElement(c.Button,{skipCapitalization:!0,theme:"secondary",className:"mr-auto",size:"xs",leftSlot:a.createElement(y.ClipboardIcon,null),disabled:r,onClick:()=>{u?.answer&&(navigator.clipboard?.writeText(u.answer),s(!0),setTimeout((()=>s(!1)),1500))}},"Copy answer"),a.createElement("p",{className:"text-tertiary text-2xs"},"Rate answer:"),a.createElement(c.Button,{theme:"secondary",size:"xs",disabled:o,leftSlot:!0===o?a.createElement(k.ThumbsUpSolidIcon,{className:"text-icon-success"}):a.createElement(N.ThumbsUpIcon,{className:"text-icon-success"}),onClick:()=>{n?.(u.id,"upvote"),m(!0)}}),a.createElement(c.Button,{theme:"secondary",size:"xs",disabled:o,leftSlot:!1===o?a.createElement(b.ThumbsDownSolidIcon,{className:"text-icon-danger"}):a.createElement(f.ThumbsDownIcon,{className:"text-icon-danger"}),onClick:()=>{n?.(u.id,"downvote"),m(!1)}})))))}const de=({config:{docsVersion:c,docsTransformUrl:o},open:m,setOpen:i,customSections:u=[]})=>{const[d,p]=a.useState(!1),[g,E]=a.useState(!0),[x,h]=a.useState(""),[C,v]=a.useState(null),[y,f]=a.useState(!1),{conversation:N,submitQuery:b,isGeneratingAnswer:k,isPreparingAnswer:I,addFeedback:w,stopGeneration:q,resetConversation:L}=t.useChat(),[H,M]=a.useState([]),[_,R]=a.useState([]),[A,D]=a.useState([]),[K,U]=a.useState([]),G=async()=>P(x,V,M,c),B=async()=>(async(e,t,a)=>{a(await t(e))})(x,z,R),Z=async()=>P(x,$,D),j=async()=>P(x,F,U),O=()=>i(!1),X=e=>{Promise.all([G(),B(),Z(),j(),...u?.map((e=>e.getItemsAsync(x)))]).then(e)};a.useEffect((()=>{v("undefined"!=typeof navigator&&J())}),[]),a.useEffect((()=>{if(null!==C){const e=e=>{"k"===e.key&&(C?e.metaKey:e.ctrlKey)&&(e.preventDefault(),i((e=>!e)))};return document.addEventListener("keydown",e,!1),()=>document.removeEventListener("keydown",e)}}),[C]),a.useEffect((()=>{m&&!d&&X((()=>{p(!0),E(!1)}))}),[m]),a.useEffect((()=>{if(m){E(!0),f(!1),(I||k)&&(q(),L());const e=setTimeout((()=>X((()=>E(!1)))),150);return()=>clearTimeout(e)}}),[x]);const Q=s(H.map((e=>({...e,baseUrl:e.url.replace(/#.+/,"")}))),"baseUrl"),W=[x.length>0&&a.createElement(e.Command.Group,{heading:"Ask AI",key:"expo-ai-prompt"},a.createElement(ee,{value:"expo-ai-prompt",onSelect:()=>{b(x),f(!0)}},a.createElement("div",{className:"inline-flex gap-3 items-center"},a.createElement(n.Stars02Icon,{className:"text-icon-secondary"}),a.createElement("p",{className:"text-xs font-medium"},"Ask Expo's AI assistant")))),H.length>0&&a.createElement(e.Command.Group,{heading:"Expo documentation",key:"expo-docs-group"},Object.values(Q).map((e=>e.sort(((e,t)=>e.url.localeCompare(e.baseUrl)-t.url.localeCompare(t.baseUrl))).slice(0,6).map(((e,t)=>a.createElement(oe,{isNested:0!==t,item:e,onSelect:O,key:`hit-expo-docs-${e.objectID}`,transformUrl:o})))))),_.length>0&&a.createElement(e.Command.Group,{heading:"Expo blog",key:"expo-blog-group"},_.map((e=>a.createElement(me,{item:e,onSelect:O,key:`hit-expo-blog-${e.slug.current}`,query:x})))),A.length>0&&a.createElement(e.Command.Group,{heading:"React Native documentation",key:"rn-docs-group"},A.map((e=>a.createElement(ne,{item:e,onSelect:O,key:`hit-rn-docs-${e.objectID}`})))),K.length>0&&a.createElement(e.Command.Group,{heading:"React Native directory",key:"rn-directory-group"},K.map((e=>a.createElement(ae,{item:e,onSelect:O,key:`hit-rn-dir-${e.npmPkg}`,query:x}))))];return u?.forEach((({items:t,heading:l,sectionIndex:n})=>t.length>0&&W.splice(n,0,a.createElement(e.Command.Group,{heading:l,key:`${n}-${l}`},t)))),a.createElement(t.KapaProvider,{userTrackingMode:"none",integrationId:"bf5bd579-bb83-4591-8cc9-d87b6cdcb712",callbacks:{}},a.createElement(e.Command.Dialog,{open:m,onOpenChange:i,label:"Search Menu",shouldFilter:!1},a.createElement(l.SearchSmIcon,{className:"text-icon-secondary absolute top-[29px] left-[29px] transition-opacity duration-200"}),a.createElement("div",{className:"absolute top-[25px] right-[25px] cursor-pointer p-1 rounded-sm hocus:bg-element"},a.createElement(r.XIcon,{className:"text-icon-secondary",onClick:()=>i(!1)})),a.createElement(e.Command.Input,{value:x,onValueChange:h,placeholder:"Search or ask AI…",autoFocus:!0}),a.createElement(S,{isLoading:g}),y?a.createElement(ue,{conversation:N,isGeneratingAnswer:k,isPreparingAnswer:I,addFeedback:w}):a.createElement(e.Command.List,null,d&&W,0===W.filter(Boolean).length&&a.createElement(e.Command.Empty,{key:"no-results-group"},a.createElement("p",{className:"text-secondary text-xs"},"No results found."))),a.createElement(T,{isPromptMode:y})))},pe=e.Command.Item;exports.CommandItemBase=pe,exports.CommandItemBaseWithCopy=ee,exports.CommandMenu=e=>a.createElement(t.KapaProvider,{userTrackingMode:"none",integrationId:"bf5bd579-bb83-4591-8cc9-d87b6cdcb712",callbacks:{}},a.createElement(de,{...e})),exports.CommandMenuTrigger=({setOpen:e,className:t})=>{const[n,r]=a.useState(null);return a.useEffect((()=>{r("undefined"!=typeof navigator&&J())}),[]),a.createElement(c.Button,{theme:"secondary",leftSlot:a.createElement(l.SearchSmIcon,{className:"icon-md text-icon-secondary"}),rightSlot:null!==n?a.createElement("div",{className:"ml-auto max-md-gutters:hidden"},a.createElement("kbd",{className:"!h-5 !leading-[19px]"},n?"⌘":"Ctrl")," ",a.createElement("kbd",{className:"!h-5 !leading-[19px]"},"K")):void 0,className:c.mergeClasses("cmdk-trigger bg-default pl-2.5 pr-3 border border-default shadow-xs min-h-[40px]",t),onClick:()=>e(!0)},a.createElement("p",{className:"text-secondary font-normal leading-normal text-xs"},"Search"))},exports.addHighlight=Y;
@@ -2,4 +2,5 @@ import React, { HTMLAttributes } from 'react';
2
2
  export declare function FootnoteArrowIcon(): React.JSX.Element;
3
3
  export declare const ExternalLinkIcon: () => React.JSX.Element;
4
4
  export declare const ReactIcon: ({ className }: HTMLAttributes<SVGSVGElement>) => React.JSX.Element;
5
- export declare const AlgoliaLogo: () => React.JSX.Element;
5
+ export declare const AlgoliaLogo: ({ className }: HTMLAttributes<SVGSVGElement>) => React.JSX.Element;
6
+ export declare const KapaLogo: ({ className }: HTMLAttributes<SVGSVGElement>) => React.JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { type UseChat } from '@kapaai/react-sdk';
2
+ import React from 'react';
3
+ type Props = Partial<UseChat>;
4
+ export declare function AIPromptResult({ conversation, isGeneratingAnswer, isPreparingAnswer, addFeedback }: Props): React.JSX.Element;
5
+ export {};
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  type Props = {
3
3
  isLoading?: boolean;
4
+ className?: string;
4
5
  };
5
- export declare const BarLoader: ({ isLoading }: Props) => React.JSX.Element;
6
+ export declare const BarLoader: ({ isLoading, className }: Props) => React.JSX.Element;
6
7
  export {};
@@ -1,2 +1,6 @@
1
1
  import React from 'react';
2
- export declare const CommandFooter: () => React.JSX.Element;
2
+ type Props = {
3
+ isPromptMode: boolean;
4
+ };
5
+ export declare function CommandFooter({ isPromptMode }: Props): React.JSX.Element;
6
+ export {};
@@ -1,6 +1,6 @@
1
1
  import React, { PropsWithChildren } from 'react';
2
2
  type Props = PropsWithChildren<{
3
- url: string;
3
+ url?: string;
4
4
  onSelect?: () => void;
5
5
  isExternalLink?: boolean;
6
6
  isNested?: boolean;
@@ -1,10 +1,3 @@
1
- import React, { Dispatch, SetStateAction } from 'react';
2
- import type { CommandMenuConfig, CommandMenuSection } from '../types';
3
- type Props = {
4
- open: boolean;
5
- setOpen: Dispatch<SetStateAction<boolean>>;
6
- config: CommandMenuConfig;
7
- customSections?: CommandMenuSection[];
8
- };
9
- export declare const CommandMenu: ({ config: { docsVersion, docsTransformUrl }, open, setOpen, customSections, }: Props) => React.JSX.Element;
10
- export {};
1
+ import React from 'react';
2
+ import type { CommandMenuProps } from '../types';
3
+ export declare const CommandMenu: (props: CommandMenuProps) => React.JSX.Element;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { CommandMenuProps } from '../types';
3
+ export declare const CommandMenuContent: ({ config: { docsVersion, docsTransformUrl }, open, setOpen, customSections, }: CommandMenuProps) => React.JSX.Element;
@@ -0,0 +1,6 @@
1
+ import React, { PropsWithChildren } from 'react';
2
+ type Props = PropsWithChildren<{
3
+ isLoading: boolean;
4
+ }>;
5
+ export declare function PromptResultCodeBlock({ children, isLoading }: Props): React.JSX.Element;
6
+ export {};
@@ -1,4 +1,10 @@
1
- import type { ReactNode } from 'react';
1
+ import type { Dispatch, ReactNode, SetStateAction } from 'react';
2
+ export type CommandMenuProps = {
3
+ open: boolean;
4
+ setOpen: Dispatch<SetStateAction<boolean>>;
5
+ config: CommandMenuConfig;
6
+ customSections?: CommandMenuSection[];
7
+ };
2
8
  export type CommandMenuConfig = {
3
9
  docsVersion: string;
4
10
  docsTransformUrl?: (url: string) => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expo/styleguide-search-ui",
3
- "version": "2.3.5",
3
+ "version": "3.0.0",
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",
@@ -29,11 +29,13 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@expo/styleguide": "^9.1.2",
32
- "@expo/styleguide-icons": "^2.2.1",
32
+ "@expo/styleguide-icons": "^2.2.2",
33
+ "@kapaai/react-sdk": "^0.3.0",
33
34
  "@sanity/client": "^6.28.3",
34
35
  "@sanity/image-url": "^1.1.0",
35
36
  "cmdk": "^0.2.1",
36
- "lodash.groupby": "^4.6.0"
37
+ "lodash.groupby": "^4.6.0",
38
+ "markdown-to-jsx": "^7.7.10"
37
39
  },
38
40
  "devDependencies": {
39
41
  "@types/lodash.groupby": "^4.6.9",
@@ -50,5 +52,5 @@
50
52
  "eslintConfig": {
51
53
  "extends": "universe/web"
52
54
  },
53
- "gitHead": "494be5d177448e915b4392c2599fcf50c5aec836"
55
+ "gitHead": "d6da8b4056a8d94bbac07e58ab9a53352e39446d"
54
56
  }