aura-omni-search 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.
- package/README.md +72 -0
- package/dist/Spotlight.d.ts +2 -0
- package/dist/adapters/routes.d.ts +18 -0
- package/dist/adapters/useReactRouterItems.d.ts +8 -0
- package/dist/aura-omni-search.css +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.mjs +2717 -0
- package/dist/index.umd.js +6 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/types.d.ts +36 -0
- package/package.json +49 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
(function(P,E){typeof exports=="object"&&typeof module<"u"?E(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],E):(P=typeof globalThis<"u"?globalThis:P||self,E(P.AuraSpotlight={},P.React))})(this,(function(P,E){"use strict";var ee={exports:{}},B={};var de;function Se(){if(de)return B;de=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function o(n,a,s){var i=null;if(s!==void 0&&(i=""+s),a.key!==void 0&&(i=""+a.key),"key"in a){s={};for(var l in a)l!=="key"&&(s[l]=a[l])}else s=a;return a=s.ref,{$$typeof:e,type:n,key:i,ref:a!==void 0?a:null,props:s}}return B.Fragment=t,B.jsx=o,B.jsxs=o,B}var J={};var ue;function je(){return ue||(ue=1,process.env.NODE_ENV!=="production"&&(function(){function e(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===Q?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case f:return"Fragment";case R:return"Profiler";case w:return"StrictMode";case re:return"Suspense";case te:return"SuspenseList";case H:return"Activity"}if(typeof r=="object")switch(typeof r.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),r.$$typeof){case u:return"Portal";case A:return r.displayName||"Context";case N:return(r._context.displayName||"Context")+".Consumer";case I:var p=r.render;return r=r.displayName,r||(r=p.displayName||p.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case oe:return p=r.displayName||null,p!==null?p:e(r.type)||"Memo";case L:p=r._payload,r=r._init;try{return e(r(p))}catch{}}return null}function t(r){return""+r}function o(r){try{t(r);var p=!1}catch{p=!0}if(p){p=console;var k=p.error,C=typeof Symbol=="function"&&Symbol.toStringTag&&r[Symbol.toStringTag]||r.constructor.name||"Object";return k.call(p,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",C),t(r)}}function n(r){if(r===f)return"<>";if(typeof r=="object"&&r!==null&&r.$$typeof===L)return"<...>";try{var p=e(r);return p?"<"+p+">":"<...>"}catch{return"<...>"}}function a(){var r=m.A;return r===null?null:r.getOwner()}function s(){return Error("react-stack-top-frame")}function i(r){if(K.call(r,"key")){var p=Object.getOwnPropertyDescriptor(r,"key").get;if(p&&p.isReactWarning)return!1}return r.key!==void 0}function l(r,p){function k(){G||(G=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",p))}k.isReactWarning=!0,Object.defineProperty(r,"key",{get:k,configurable:!0})}function b(){var r=e(this.type);return $[r]||($[r]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),r=this.props.ref,r!==void 0?r:null}function v(r,p,k,C,ne,ie){var S=k.ref;return r={$$typeof:c,type:r,key:p,props:k,_owner:C},(S!==void 0?S:null)!==null?Object.defineProperty(r,"ref",{enumerable:!1,get:b}):Object.defineProperty(r,"ref",{enumerable:!1,value:null}),r._store={},Object.defineProperty(r._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(r,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(r,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:ne}),Object.defineProperty(r,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ie}),Object.freeze&&(Object.freeze(r.props),Object.freeze(r)),r}function x(r,p,k,C,ne,ie){var S=p.children;if(S!==void 0)if(C)if(Y(S)){for(C=0;C<S.length;C++)y(S[C]);Object.freeze&&Object.freeze(S)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else y(S);if(K.call(p,"key")){S=e(r);var D=Object.keys(p).filter(function(pr){return pr!=="key"});C=0<D.length?"{key: someKey, "+D.join(": ..., ")+": ...}":"{key: someKey}",q[S+C]||(D=0<D.length?"{"+D.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
2
|
+
let props = %s;
|
|
3
|
+
<%s {...props} />
|
|
4
|
+
React keys must be passed directly to JSX without using spread:
|
|
5
|
+
let props = %s;
|
|
6
|
+
<%s key={someKey} {...props} />`,C,S,D,S),q[S+C]=!0)}if(S=null,k!==void 0&&(o(k),S=""+k),i(p)&&(o(p.key),S=""+p.key),"key"in p){k={};for(var ce in p)ce!=="key"&&(k[ce]=p[ce])}else k=p;return S&&l(k,typeof r=="function"?r.displayName||r.name||"Unknown":r),v(r,S,k,a(),ne,ie)}function y(r){j(r)?r._store&&(r._store.validated=1):typeof r=="object"&&r!==null&&r.$$typeof===L&&(r._payload.status==="fulfilled"?j(r._payload.value)&&r._payload.value._store&&(r._payload.value._store.validated=1):r._store&&(r._store.validated=1))}function j(r){return typeof r=="object"&&r!==null&&r.$$typeof===c}var _=E,c=Symbol.for("react.transitional.element"),u=Symbol.for("react.portal"),f=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),A=Symbol.for("react.context"),I=Symbol.for("react.forward_ref"),re=Symbol.for("react.suspense"),te=Symbol.for("react.suspense_list"),oe=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),H=Symbol.for("react.activity"),Q=Symbol.for("react.client.reference"),m=_.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K=Object.prototype.hasOwnProperty,Y=Array.isArray,U=console.createTask?console.createTask:function(){return null};_={react_stack_bottom_frame:function(r){return r()}};var G,$={},V=_.react_stack_bottom_frame.bind(_,s)(),M=U(n(s)),q={};J.Fragment=f,J.jsx=function(r,p,k){var C=1e4>m.recentlyCreatedOwnerStacks++;return x(r,p,k,!1,C?Error("react-stack-top-frame"):V,C?U(n(r)):M)},J.jsxs=function(r,p,k){var C=1e4>m.recentlyCreatedOwnerStacks++;return x(r,p,k,!0,C?Error("react-stack-top-frame"):V,C?U(n(r)):M)}})()),J}var pe;function _e(){return pe||(pe=1,process.env.NODE_ENV==="production"?ee.exports=Se():ee.exports=je()),ee.exports}var g=_e();const Ae=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),fe=(...e)=>e.filter((t,o,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===o).join(" ").trim();var Te={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Ne=E.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:o=2,absoluteStrokeWidth:n,className:a="",children:s,iconNode:i,...l},b)=>E.createElement("svg",{ref:b,...Te,width:t,height:t,stroke:e,strokeWidth:n?Number(o)*24/Number(t):o,className:fe("lucide",a),...l},[...i.map(([v,x])=>E.createElement(v,x)),...Array.isArray(s)?s:[s]]));const be=(e,t)=>{const o=E.forwardRef(({className:n,...a},s)=>E.createElement(Ne,{ref:s,iconNode:t,className:fe(`lucide-${Ae(e)}`,n),...a}));return o.displayName=`${e}`,o};const me=be("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);const Pe=be("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function ge(e){var t,o,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(o=ge(e[t]))&&(n&&(n+=" "),n+=o)}else for(o in e)e[o]&&(n&&(n+=" "),n+=o);return n}function ze(){for(var e,t,o=0,n="",a=arguments.length;o<a;o++)(e=arguments[o])&&(t=ge(e))&&(n&&(n+=" "),n+=t);return n}const se="-",Oe=e=>{const t=Me(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:i=>{const l=i.split(se);return l[0]===""&&l.length!==1&&l.shift(),he(l,t)||Ie(i)},getConflictingClassGroupIds:(i,l)=>{const b=o[i]||[];return l&&n[i]?[...b,...n[i]]:b}}},he=(e,t)=>{if(e.length===0)return t.classGroupId;const o=e[0],n=t.nextPart.get(o),a=n?he(e.slice(1),n):void 0;if(a)return a;if(t.validators.length===0)return;const s=e.join(se);return t.validators.find(({validator:i})=>i(s))?.classGroupId},xe=/^\[(.+)\]$/,Ie=e=>{if(xe.test(e)){const t=xe.exec(e)[1],o=t?.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},Me=e=>{const{theme:t,prefix:o}=e,n={nextPart:new Map,validators:[]};return Ge(Object.entries(e.classGroups),o).forEach(([s,i])=>{ae(i,n,s,t)}),n},ae=(e,t,o,n)=>{e.forEach(a=>{if(typeof a=="string"){const s=a===""?t:ye(t,a);s.classGroupId=o;return}if(typeof a=="function"){if(Le(a)){ae(a(n),t,o,n);return}t.validators.push({validator:a,classGroupId:o});return}Object.entries(a).forEach(([s,i])=>{ae(i,ye(t,s),o,n)})})},ye=(e,t)=>{let o=e;return t.split(se).forEach(n=>{o.nextPart.has(n)||o.nextPart.set(n,{nextPart:new Map,validators:[]}),o=o.nextPart.get(n)}),o},Le=e=>e.isThemeGetter,Ge=(e,t)=>t?e.map(([o,n])=>{const a=n.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([i,l])=>[t+i,l])):s);return[o,a]}):e,We=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,n=new Map;const a=(s,i)=>{o.set(s,i),t++,t>e&&(t=0,n=o,o=new Map)};return{get(s){let i=o.get(s);if(i!==void 0)return i;if((i=n.get(s))!==void 0)return a(s,i),i},set(s,i){o.has(s)?o.set(s,i):a(s,i)}}},ve="!",Fe=e=>{const{separator:t,experimentalParseClassName:o}=e,n=t.length===1,a=t[0],s=t.length,i=l=>{const b=[];let v=0,x=0,y;for(let f=0;f<l.length;f++){let w=l[f];if(v===0){if(w===a&&(n||l.slice(f,f+s)===t)){b.push(l.slice(x,f)),x=f+s;continue}if(w==="/"){y=f;continue}}w==="["?v++:w==="]"&&v--}const j=b.length===0?l:l.substring(x),_=j.startsWith(ve),c=_?j.substring(1):j,u=y&&y>x?y-x:void 0;return{modifiers:b,hasImportantModifier:_,baseClassName:c,maybePostfixModifierPosition:u}};return o?l=>o({className:l,parseClassName:i}):i},Ye=e=>{if(e.length<=1)return e;const t=[];let o=[];return e.forEach(n=>{n[0]==="["?(t.push(...o.sort(),n),o=[]):o.push(n)}),t.push(...o.sort()),t},Ue=e=>({cache:We(e.cacheSize),parseClassName:Fe(e),...Oe(e)}),Ve=/\s+/,De=(e,t)=>{const{parseClassName:o,getClassGroupId:n,getConflictingClassGroupIds:a}=t,s=[],i=e.trim().split(Ve);let l="";for(let b=i.length-1;b>=0;b-=1){const v=i[b],{modifiers:x,hasImportantModifier:y,baseClassName:j,maybePostfixModifierPosition:_}=o(v);let c=!!_,u=n(c?j.substring(0,_):j);if(!u){if(!c){l=v+(l.length>0?" "+l:l);continue}if(u=n(j),!u){l=v+(l.length>0?" "+l:l);continue}c=!1}const f=Ye(x).join(":"),w=y?f+ve:f,R=w+u;if(s.includes(R))continue;s.push(R);const N=a(u,c);for(let A=0;A<N.length;++A){const I=N[A];s.push(w+I)}l=v+(l.length>0?" "+l:l)}return l};function Be(){let e=0,t,o,n="";for(;e<arguments.length;)(t=arguments[e++])&&(o=we(t))&&(n&&(n+=" "),n+=o);return n}const we=e=>{if(typeof e=="string")return e;let t,o="";for(let n=0;n<e.length;n++)e[n]&&(t=we(e[n]))&&(o&&(o+=" "),o+=t);return o};function Je(e,...t){let o,n,a,s=i;function i(b){const v=t.reduce((x,y)=>y(x),e());return o=Ue(v),n=o.cache.get,a=o.cache.set,s=l,l(b)}function l(b){const v=n(b);if(v)return v;const x=De(b,o);return a(b,x),x}return function(){return s(Be.apply(null,arguments))}}const h=e=>{const t=o=>o[e]||[];return t.isThemeGetter=!0,t},ke=/^\[(?:([a-z-]+):)?(.+)\]$/i,Xe=/^\d+\/\d+$/,Ze=new Set(["px","full","screen"]),He=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Qe=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Ke=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,$e=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,qe=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,T=e=>W(e)||Ze.has(e)||Xe.test(e),z=e=>F(e,"length",lr),W=e=>!!e&&!Number.isNaN(Number(e)),le=e=>F(e,"number",W),X=e=>!!e&&Number.isInteger(Number(e)),er=e=>e.endsWith("%")&&W(e.slice(0,-1)),d=e=>ke.test(e),O=e=>He.test(e),rr=new Set(["length","size","percentage"]),tr=e=>F(e,rr,Ee),or=e=>F(e,"position",Ee),nr=new Set(["image","url"]),sr=e=>F(e,nr,cr),ar=e=>F(e,"",ir),Z=()=>!0,F=(e,t,o)=>{const n=ke.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):o(n[2]):!1},lr=e=>Qe.test(e)&&!Ke.test(e),Ee=()=>!1,ir=e=>$e.test(e),cr=e=>qe.test(e),dr=Je(()=>{const e=h("colors"),t=h("spacing"),o=h("blur"),n=h("brightness"),a=h("borderColor"),s=h("borderRadius"),i=h("borderSpacing"),l=h("borderWidth"),b=h("contrast"),v=h("grayscale"),x=h("hueRotate"),y=h("invert"),j=h("gap"),_=h("gradientColorStops"),c=h("gradientColorStopPositions"),u=h("inset"),f=h("margin"),w=h("opacity"),R=h("padding"),N=h("saturate"),A=h("scale"),I=h("sepia"),re=h("skew"),te=h("space"),oe=h("translate"),L=()=>["auto","contain","none"],H=()=>["auto","hidden","clip","visible","scroll"],Q=()=>["auto",d,t],m=()=>[d,t],K=()=>["",T,z],Y=()=>["auto",W,d],U=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],G=()=>["solid","dashed","dotted","double","none"],$=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],V=()=>["start","end","center","between","around","evenly","stretch"],M=()=>["","0",d],q=()=>["auto","avoid","all","avoid-page","page","left","right","column"],r=()=>[W,d];return{cacheSize:500,separator:":",theme:{colors:[Z],spacing:[T,z],blur:["none","",O,d],brightness:r(),borderColor:[e],borderRadius:["none","","full",O,d],borderSpacing:m(),borderWidth:K(),contrast:r(),grayscale:M(),hueRotate:r(),invert:M(),gap:m(),gradientColorStops:[e],gradientColorStopPositions:[er,z],inset:Q(),margin:Q(),opacity:r(),padding:m(),saturate:r(),scale:r(),sepia:M(),skew:r(),space:m(),translate:m()},classGroups:{aspect:[{aspect:["auto","square","video",d]}],container:["container"],columns:[{columns:[O]}],"break-after":[{"break-after":q()}],"break-before":[{"break-before":q()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...U(),d]}],overflow:[{overflow:H()}],"overflow-x":[{"overflow-x":H()}],"overflow-y":[{"overflow-y":H()}],overscroll:[{overscroll:L()}],"overscroll-x":[{"overscroll-x":L()}],"overscroll-y":[{"overscroll-y":L()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[u]}],"inset-x":[{"inset-x":[u]}],"inset-y":[{"inset-y":[u]}],start:[{start:[u]}],end:[{end:[u]}],top:[{top:[u]}],right:[{right:[u]}],bottom:[{bottom:[u]}],left:[{left:[u]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",X,d]}],basis:[{basis:Q()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",d]}],grow:[{grow:M()}],shrink:[{shrink:M()}],order:[{order:["first","last","none",X,d]}],"grid-cols":[{"grid-cols":[Z]}],"col-start-end":[{col:["auto",{span:["full",X,d]},d]}],"col-start":[{"col-start":Y()}],"col-end":[{"col-end":Y()}],"grid-rows":[{"grid-rows":[Z]}],"row-start-end":[{row:["auto",{span:[X,d]},d]}],"row-start":[{"row-start":Y()}],"row-end":[{"row-end":Y()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",d]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",d]}],gap:[{gap:[j]}],"gap-x":[{"gap-x":[j]}],"gap-y":[{"gap-y":[j]}],"justify-content":[{justify:["normal",...V()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...V(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...V(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[R]}],px:[{px:[R]}],py:[{py:[R]}],ps:[{ps:[R]}],pe:[{pe:[R]}],pt:[{pt:[R]}],pr:[{pr:[R]}],pb:[{pb:[R]}],pl:[{pl:[R]}],m:[{m:[f]}],mx:[{mx:[f]}],my:[{my:[f]}],ms:[{ms:[f]}],me:[{me:[f]}],mt:[{mt:[f]}],mr:[{mr:[f]}],mb:[{mb:[f]}],ml:[{ml:[f]}],"space-x":[{"space-x":[te]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[te]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",d,t]}],"min-w":[{"min-w":[d,t,"min","max","fit"]}],"max-w":[{"max-w":[d,t,"none","full","min","max","fit","prose",{screen:[O]},O]}],h:[{h:[d,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[d,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[d,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[d,t,"auto","min","max","fit"]}],"font-size":[{text:["base",O,z]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",le]}],"font-family":[{font:[Z]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",d]}],"line-clamp":[{"line-clamp":["none",W,le]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",T,d]}],"list-image":[{"list-image":["none",d]}],"list-style-type":[{list:["none","disc","decimal",d]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...G(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",T,z]}],"underline-offset":[{"underline-offset":["auto",T,d]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:m()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",d]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",d]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[w]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...U(),or]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",tr]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},sr]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[c]}],"gradient-via-pos":[{via:[c]}],"gradient-to-pos":[{to:[c]}],"gradient-from":[{from:[_]}],"gradient-via":[{via:[_]}],"gradient-to":[{to:[_]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[w]}],"border-style":[{border:[...G(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[w]}],"divide-style":[{divide:G()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...G()]}],"outline-offset":[{"outline-offset":[T,d]}],"outline-w":[{outline:[T,z]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:K()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[T,z]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",O,ar]}],"shadow-color":[{shadow:[Z]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":[...$(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":$()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[n]}],contrast:[{contrast:[b]}],"drop-shadow":[{"drop-shadow":["","none",O,d]}],grayscale:[{grayscale:[v]}],"hue-rotate":[{"hue-rotate":[x]}],invert:[{invert:[y]}],saturate:[{saturate:[N]}],sepia:[{sepia:[I]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[b]}],"backdrop-grayscale":[{"backdrop-grayscale":[v]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[x]}],"backdrop-invert":[{"backdrop-invert":[y]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[N]}],"backdrop-sepia":[{"backdrop-sepia":[I]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",d]}],duration:[{duration:r()}],ease:[{ease:["linear","in","out","in-out",d]}],delay:[{delay:r()}],animate:[{animate:["none","spin","ping","pulse","bounce",d]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[A]}],"scale-x":[{"scale-x":[A]}],"scale-y":[{"scale-y":[A]}],rotate:[{rotate:[X,d]}],"translate-x":[{"translate-x":[oe]}],"translate-y":[{"translate-y":[oe]}],"skew-x":[{"skew-x":[re]}],"skew-y":[{"skew-y":[re]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",d]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",d]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":m()}],"scroll-mx":[{"scroll-mx":m()}],"scroll-my":[{"scroll-my":m()}],"scroll-ms":[{"scroll-ms":m()}],"scroll-me":[{"scroll-me":m()}],"scroll-mt":[{"scroll-mt":m()}],"scroll-mr":[{"scroll-mr":m()}],"scroll-mb":[{"scroll-mb":m()}],"scroll-ml":[{"scroll-ml":m()}],"scroll-p":[{"scroll-p":m()}],"scroll-px":[{"scroll-px":m()}],"scroll-py":[{"scroll-py":m()}],"scroll-ps":[{"scroll-ps":m()}],"scroll-pe":[{"scroll-pe":m()}],"scroll-pt":[{"scroll-pt":m()}],"scroll-pr":[{"scroll-pr":m()}],"scroll-pb":[{"scroll-pb":m()}],"scroll-pl":[{"scroll-pl":m()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",d]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[T,z,le]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}});function Re(...e){return dr(ze(e))}function ur({isOpen:e,onClose:t,items:o,onNavigate:n,searchPlaceholder:a="Search pages, actions, commands..."}){const[s,i]=E.useState(""),[l,b]=E.useState(0),v=E.useRef(null),x=E.useRef(null),y=E.useMemo(()=>{let c=o;if(s.trim()){const u=s.toLowerCase();c=o.filter(f=>{const w=f.label.toLowerCase().includes(u),R=f.description?.toLowerCase().includes(u),N=f.keywords?.some(I=>I.toLowerCase().includes(u)),A=f.group?.toLowerCase().includes(u);return w||R||N||A})}return c.sort((u,f)=>{const w=u.group||"Other",R=f.group||"Other";return w===R?0:w.localeCompare(R)})},[s,o]);E.useEffect(()=>{e&&(i(""),b(0),setTimeout(()=>v.current?.focus(),50))},[e]),E.useEffect(()=>{b(0)},[y]);const j=c=>{c.action?(c.action(),t()):c.route&&(n(c.route),t())},_=c=>{c.key==="ArrowDown"?(c.preventDefault(),b(u=>u<y.length-1?u+1:u)):c.key==="ArrowUp"?(c.preventDefault(),b(u=>u>0?u-1:0)):c.key==="Enter"?(c.preventDefault(),y[l]&&j(y[l])):c.key==="Escape"&&t()};return E.useEffect(()=>{if(x.current&&y.length>0){const u=x.current.querySelectorAll("button[data-spotlight-item]")[l];u&&u.scrollIntoView({block:"nearest"})}},[l,y]),e?g.jsxs("div",{className:"fixed inset-0 z-[9999] flex items-start justify-center pt-2 sm:pt-[10vh] lg:pt-[15vh]",children:[g.jsx("div",{className:"absolute inset-0 bg-background/80 backdrop-blur-sm transition-opacity",onClick:t}),g.jsxs("div",{className:"relative w-full max-w-[96vw] sm:max-w-xl lg:max-w-2xl xl:max-w-3xl bg-popover text-foreground rounded-xl shadow-2xl border border-border overflow-hidden animate-in fade-in zoom-in-95 duration-200",children:[g.jsxs("div",{className:"flex items-center px-4 border-b border-border h-14",children:[g.jsx(me,{className:"w-5 h-5 text-muted-foreground mr-3"}),g.jsx("input",{ref:v,type:"text",className:"flex-1 h-full bg-transparent border-none outline-none text-foreground placeholder-muted-foreground text-sm",placeholder:a,value:s,onChange:c=>i(c.target.value),onKeyDown:_}),g.jsxs("div",{className:"flex items-center gap-2",children:[s&&g.jsx("button",{onClick:()=>i(""),className:"text-muted-foreground hover:text-foreground",children:g.jsx(Pe,{size:16})}),g.jsx("kbd",{className:"hidden sm:inline-flex h-5 select-none items-center gap-1 rounded border border-border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground opacity-100",children:"ESC"})]})]}),g.jsx("div",{ref:x,className:"max-h-[65vh] sm:max-h-[60vh] overflow-y-auto p-2",children:y.length===0?g.jsx("div",{className:"py-12 text-center text-sm text-muted-foreground",children:"No results found."}):y.map((c,u)=>{const f=u===0||c.group!==y[u-1].group;return g.jsxs(E.Fragment,{children:[f&&c.group&&g.jsx("div",{className:"px-3 py-2 text-xs font-semibold text-muted-foreground uppercase tracking-wider sticky top-0 bg-popover z-10",children:c.group}),g.jsxs("button",{"data-spotlight-item":!0,onClick:()=>j(c),className:Re("relative flex cursor-pointer select-none items-center rounded-sm px-3 py-2.5 text-sm outline-none w-full text-left transition-colors",u===l?"bg-accent text-accent-foreground":"hover:bg-muted/50"),children:[g.jsx("div",{className:Re("flex h-8 w-8 items-center justify-center rounded-md border border-border mr-3",u===l?"bg-background":"bg-muted"),children:c.icon||g.jsx(me,{size:14})}),g.jsxs("div",{className:"flex-1 overflow-hidden",children:[g.jsx("div",{className:"truncate font-medium",children:c.label}),c.description&&g.jsx("div",{className:"truncate text-xs text-muted-foreground",children:c.description})]}),c.type&&g.jsx("span",{className:"ml-auto text-[10px] uppercase text-muted-foreground bg-muted px-1.5 py-0.5 rounded",children:c.type})]})]},c.id)})}),g.jsx("div",{className:"h-10 border-t border-border bg-muted/30 px-4 flex items-center justify-between text-[10px] text-muted-foreground",children:g.jsxs("div",{className:"flex gap-2",children:[g.jsx("span",{children:"Use arrow keys to navigate"}),g.jsx("span",{children:"Enter to select"})]})})]})]}):null}function Ce(e,t="",o="Pages"){const n=[];return e.forEach(a=>{const s=a.path.startsWith("/")?a.path:`${t}/${a.path}`.replace(/\/+/g,"/"),i=a.label||a.name||a.title||s;i&&!a.children&&n.push({id:`route-${s}`,label:i,description:`Navigate to ${i}`,route:s,type:"page",group:o,icon:a.icon,keywords:[i,s]}),a.children&&n.push(...Ce(a.children,s,o))}),n}P.Spotlight=ur,P.getSpotlightItemsFromRoutes=Ce,Object.defineProperty(P,Symbol.toStringTag,{value:"Module"})}));
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
export type SpotlightItemType = "page" | "action" | "user" | "tenant" | string;
|
|
3
|
+
export interface SpotlightItem {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
icon?: ReactNode;
|
|
8
|
+
type: SpotlightItemType;
|
|
9
|
+
/**
|
|
10
|
+
* Group identifier for sectioning results (e.g., "Pages", "Actions")
|
|
11
|
+
*/
|
|
12
|
+
group?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Keywords for fuzzy search
|
|
15
|
+
*/
|
|
16
|
+
keywords?: string[];
|
|
17
|
+
/**
|
|
18
|
+
* For navigation items
|
|
19
|
+
*/
|
|
20
|
+
route?: string;
|
|
21
|
+
/**
|
|
22
|
+
* For executable items
|
|
23
|
+
*/
|
|
24
|
+
action?: () => void;
|
|
25
|
+
}
|
|
26
|
+
export interface SpotlightProps {
|
|
27
|
+
isOpen: boolean;
|
|
28
|
+
onClose: () => void;
|
|
29
|
+
items: SpotlightItem[];
|
|
30
|
+
/**
|
|
31
|
+
* Callback to handle navigation.
|
|
32
|
+
* This bridges the gap between different routers (Next, React Router).
|
|
33
|
+
*/
|
|
34
|
+
onNavigate: (path: string) => void;
|
|
35
|
+
searchPlaceholder?: string;
|
|
36
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "aura-omni-search",
|
|
3
|
+
"version": "3.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Universal Command Palette & Global Search for React",
|
|
6
|
+
"main": "./dist/index.umd.js",
|
|
7
|
+
"module": "./dist/index.mjs",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"README.md"
|
|
12
|
+
],
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"import": "./dist/index.mjs",
|
|
17
|
+
"require": "./dist/index.umd.js"
|
|
18
|
+
},
|
|
19
|
+
"./style.css": "./dist/style.css"
|
|
20
|
+
},
|
|
21
|
+
"scripts": {
|
|
22
|
+
"dev": "vite",
|
|
23
|
+
"build": "vite build && tsc --emitDeclarationOnly",
|
|
24
|
+
"preview": "vite preview"
|
|
25
|
+
},
|
|
26
|
+
"peerDependencies": {
|
|
27
|
+
"react": ">=18",
|
|
28
|
+
"react-dom": ">=18"
|
|
29
|
+
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"clsx": "^2.1.1",
|
|
32
|
+
"framer-motion": "^11.12.0",
|
|
33
|
+
"lucide-react": "^0.469.0",
|
|
34
|
+
"tailwind-merge": "^2.6.0"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@vitejs/plugin-react": "^5.1.2",
|
|
38
|
+
"@types/react": "^19.0.0",
|
|
39
|
+
"@types/react-dom": "^19.0.0",
|
|
40
|
+
"react": "^19.2.3",
|
|
41
|
+
"react-dom": "^19.2.3",
|
|
42
|
+
"typescript": "^5.0.0",
|
|
43
|
+
"vite": "^7.3.1",
|
|
44
|
+
"tailwindcss": "^3.4.0",
|
|
45
|
+
"postcss": "^8.4.0",
|
|
46
|
+
"autoprefixer": "^10.4.0",
|
|
47
|
+
"tailwindcss-animate": "^1.0.7"
|
|
48
|
+
}
|
|
49
|
+
}
|