initial commit
This commit is contained in:
1
node_modules/@headlessui/react/dist/utils/bugs.d.ts
generated
vendored
Normal file
1
node_modules/@headlessui/react/dist/utils/bugs.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare function isDisabledReactIssue7711(element: Element): boolean;
|
||||
1
node_modules/@headlessui/react/dist/utils/bugs.js
generated
vendored
Normal file
1
node_modules/@headlessui/react/dist/utils/bugs.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
function r(n){let e=n.parentElement,l=null;for(;e&&!(e instanceof HTMLFieldSetElement);)e instanceof HTMLLegendElement&&(l=e),e=e.parentElement;let t=(e==null?void 0:e.getAttribute("disabled"))==="";return t&&i(l)?!1:t}function i(n){if(!n)return!1;let e=n.previousElementSibling;for(;e!==null;){if(e instanceof HTMLLegendElement)return!1;e=e.previousElementSibling}return!0}export{r as isDisabledReactIssue7711};
|
||||
25
node_modules/@headlessui/react/dist/utils/calculate-active-index.d.ts
generated
vendored
Normal file
25
node_modules/@headlessui/react/dist/utils/calculate-active-index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
export declare enum Focus {
|
||||
/** Focus the first non-disabled item. */
|
||||
First = 0,
|
||||
/** Focus the previous non-disabled item. */
|
||||
Previous = 1,
|
||||
/** Focus the next non-disabled item. */
|
||||
Next = 2,
|
||||
/** Focus the last non-disabled item. */
|
||||
Last = 3,
|
||||
/** Focus a specific item based on the `id` of the item. */
|
||||
Specific = 4,
|
||||
/** Focus no items at all. */
|
||||
Nothing = 5
|
||||
}
|
||||
export declare function calculateActiveIndex<TItem>(action: {
|
||||
focus: Focus.Specific;
|
||||
id: string;
|
||||
} | {
|
||||
focus: Exclude<Focus, Focus.Specific>;
|
||||
}, resolvers: {
|
||||
resolveItems(): TItem[];
|
||||
resolveActiveIndex(): number | null;
|
||||
resolveId(item: TItem): string;
|
||||
resolveDisabled(item: TItem): boolean;
|
||||
}): number | null;
|
||||
1
node_modules/@headlessui/react/dist/utils/calculate-active-index.js
generated
vendored
Normal file
1
node_modules/@headlessui/react/dist/utils/calculate-active-index.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
function f(r){throw new Error("Unexpected object: "+r)}var a=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(a||{});function x(r,n){let t=n.resolveItems();if(t.length<=0)return null;let l=n.resolveActiveIndex(),s=l!=null?l:-1,d=(()=>{switch(r.focus){case 0:return t.findIndex(e=>!n.resolveDisabled(e));case 1:{let e=t.slice().reverse().findIndex((i,c,u)=>s!==-1&&u.length-c-1>=s?!1:!n.resolveDisabled(i));return e===-1?e:t.length-1-e}case 2:return t.findIndex((e,i)=>i<=s?!1:!n.resolveDisabled(e));case 3:{let e=t.slice().reverse().findIndex(i=>!n.resolveDisabled(i));return e===-1?e:t.length-1-e}case 4:return t.findIndex(e=>n.resolveId(e)===r.id);case 5:return null;default:f(r)}})();return d===-1?l:d}export{a as Focus,x as calculateActiveIndex};
|
||||
1
node_modules/@headlessui/react/dist/utils/class-names.d.ts
generated
vendored
Normal file
1
node_modules/@headlessui/react/dist/utils/class-names.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare function classNames(...classes: (false | null | undefined | string)[]): string;
|
||||
1
node_modules/@headlessui/react/dist/utils/class-names.js
generated
vendored
Normal file
1
node_modules/@headlessui/react/dist/utils/class-names.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
function t(...r){return Array.from(new Set(r.flatMap(n=>typeof n=="string"?n.split(" "):[]))).filter(Boolean).join(" ")}export{t as classNames};
|
||||
12
node_modules/@headlessui/react/dist/utils/disposables.d.ts
generated
vendored
Normal file
12
node_modules/@headlessui/react/dist/utils/disposables.d.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
export type Disposables = ReturnType<typeof disposables>;
|
||||
export declare function disposables(): {
|
||||
addEventListener<TEventName extends keyof WindowEventMap>(element: HTMLElement | Window | Document, name: TEventName, listener: (event: WindowEventMap[TEventName]) => any, options?: boolean | AddEventListenerOptions): () => void;
|
||||
requestAnimationFrame(callback: FrameRequestCallback): () => void;
|
||||
nextFrame(callback: FrameRequestCallback): () => void;
|
||||
setTimeout(callback: (...args: any[]) => void, ms?: number | undefined, ...args: any[]): () => void;
|
||||
microTask(cb: () => void): () => void;
|
||||
style(node: HTMLElement, property: string, value: string): () => void;
|
||||
group(cb: (d: typeof this) => void): () => void;
|
||||
add(cb: () => void): () => void;
|
||||
dispose(): void;
|
||||
};
|
||||
1
node_modules/@headlessui/react/dist/utils/disposables.js
generated
vendored
Normal file
1
node_modules/@headlessui/react/dist/utils/disposables.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
import{microTask as i}from'./micro-task.js';function o(){let n=[],r={addEventListener(e,t,s,a){return e.addEventListener(t,s,a),r.add(()=>e.removeEventListener(t,s,a))},requestAnimationFrame(...e){let t=requestAnimationFrame(...e);return r.add(()=>cancelAnimationFrame(t))},nextFrame(...e){return r.requestAnimationFrame(()=>r.requestAnimationFrame(...e))},setTimeout(...e){let t=setTimeout(...e);return r.add(()=>clearTimeout(t))},microTask(...e){let t={current:!0};return i(()=>{t.current&&e[0]()}),r.add(()=>{t.current=!1})},style(e,t,s){let a=e.style.getPropertyValue(t);return Object.assign(e.style,{[t]:s}),this.add(()=>{Object.assign(e.style,{[t]:a})})},group(e){let t=o();return e(t),this.add(()=>t.dispose())},add(e){return n.push(e),()=>{let t=n.indexOf(e);if(t>=0)for(let s of n.splice(t,1))s()}},dispose(){for(let e of n.splice(0))e()}};return r}export{o as disposables};
|
||||
1
node_modules/@headlessui/react/dist/utils/document-ready.d.ts
generated
vendored
Normal file
1
node_modules/@headlessui/react/dist/utils/document-ready.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare function onDocumentReady(cb: () => void): void;
|
||||
1
node_modules/@headlessui/react/dist/utils/document-ready.js
generated
vendored
Normal file
1
node_modules/@headlessui/react/dist/utils/document-ready.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
function t(n){function e(){document.readyState!=="loading"&&(n(),document.removeEventListener("DOMContentLoaded",e))}typeof window!="undefined"&&typeof document!="undefined"&&(document.addEventListener("DOMContentLoaded",e),e())}export{t as onDocumentReady};
|
||||
17
node_modules/@headlessui/react/dist/utils/env.d.ts
generated
vendored
Normal file
17
node_modules/@headlessui/react/dist/utils/env.d.ts
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
type RenderEnv = 'client' | 'server';
|
||||
type HandoffState = 'pending' | 'complete';
|
||||
declare class Env {
|
||||
current: RenderEnv;
|
||||
handoffState: HandoffState;
|
||||
currentId: number;
|
||||
set(env: RenderEnv): void;
|
||||
reset(): void;
|
||||
nextId(): number;
|
||||
get isServer(): boolean;
|
||||
get isClient(): boolean;
|
||||
private detect;
|
||||
handoff(): void;
|
||||
get isHandoffComplete(): boolean;
|
||||
}
|
||||
export declare let env: Env;
|
||||
export {};
|
||||
1
node_modules/@headlessui/react/dist/utils/env.js
generated
vendored
Normal file
1
node_modules/@headlessui/react/dist/utils/env.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
var i=Object.defineProperty;var d=(t,e,n)=>e in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var r=(t,e,n)=>(d(t,typeof e!="symbol"?e+"":e,n),n);class o{constructor(){r(this,"current",this.detect());r(this,"handoffState","pending");r(this,"currentId",0)}set(e){this.current!==e&&(this.handoffState="pending",this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window=="undefined"||typeof document=="undefined"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}}let s=new o;export{s as env};
|
||||
41
node_modules/@headlessui/react/dist/utils/focus-management.d.ts
generated
vendored
Normal file
41
node_modules/@headlessui/react/dist/utils/focus-management.d.ts
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
export declare enum Focus {
|
||||
/** Focus the first non-disabled element */
|
||||
First = 1,
|
||||
/** Focus the previous non-disabled element */
|
||||
Previous = 2,
|
||||
/** Focus the next non-disabled element */
|
||||
Next = 4,
|
||||
/** Focus the last non-disabled element */
|
||||
Last = 8,
|
||||
/** Wrap tab around */
|
||||
WrapAround = 16,
|
||||
/** Prevent scrolling the focusable elements into view */
|
||||
NoScroll = 32
|
||||
}
|
||||
export declare enum FocusResult {
|
||||
/** Something went wrong while trying to focus. */
|
||||
Error = 0,
|
||||
/** When `Focus.WrapAround` is enabled, going from position `N` to `N+1` where `N` is the last index in the array, then we overflow. */
|
||||
Overflow = 1,
|
||||
/** Focus was successful. */
|
||||
Success = 2,
|
||||
/** When `Focus.WrapAround` is enabled, going from position `N` to `N-1` where `N` is the first index in the array, then we underflow. */
|
||||
Underflow = 3
|
||||
}
|
||||
export declare function getFocusableElements(container?: HTMLElement | null): HTMLElement[];
|
||||
export declare enum FocusableMode {
|
||||
/** The element itself must be focusable. */
|
||||
Strict = 0,
|
||||
/** The element should be inside of a focusable element. */
|
||||
Loose = 1
|
||||
}
|
||||
export declare function isFocusableElement(element: HTMLElement, mode?: FocusableMode): boolean;
|
||||
export declare function restoreFocusIfNecessary(element: HTMLElement | null): void;
|
||||
export declare function focusElement(element: HTMLElement | null): void;
|
||||
export declare function sortByDomNode<T>(nodes: T[], resolveKey?: (item: T) => HTMLElement | null): T[];
|
||||
export declare function focusFrom(current: HTMLElement | null, focus: Focus): FocusResult;
|
||||
export declare function focusIn(container: HTMLElement | HTMLElement[], focus: Focus, { sorted, relativeTo, skipElements, }?: Partial<{
|
||||
sorted: boolean;
|
||||
relativeTo: HTMLElement | null;
|
||||
skipElements: HTMLElement[];
|
||||
}>): FocusResult;
|
||||
1
node_modules/@headlessui/react/dist/utils/focus-management.js
generated
vendored
Normal file
1
node_modules/@headlessui/react/dist/utils/focus-management.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
import{disposables as b}from'./disposables.js';import{match as L}from'./match.js';import{getOwnerDocument as m}from'./owner.js';let c=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var M=(n=>(n[n.First=1]="First",n[n.Previous=2]="Previous",n[n.Next=4]="Next",n[n.Last=8]="Last",n[n.WrapAround=16]="WrapAround",n[n.NoScroll=32]="NoScroll",n))(M||{}),N=(o=>(o[o.Error=0]="Error",o[o.Overflow=1]="Overflow",o[o.Success=2]="Success",o[o.Underflow=3]="Underflow",o))(N||{}),F=(t=>(t[t.Previous=-1]="Previous",t[t.Next=1]="Next",t))(F||{});function f(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(c)).sort((r,t)=>Math.sign((r.tabIndex||Number.MAX_SAFE_INTEGER)-(t.tabIndex||Number.MAX_SAFE_INTEGER)))}var T=(t=>(t[t.Strict=0]="Strict",t[t.Loose=1]="Loose",t))(T||{});function h(e,r=0){var t;return e===((t=m(e))==null?void 0:t.body)?!1:L(r,{[0](){return e.matches(c)},[1](){let l=e;for(;l!==null;){if(l.matches(c))return!0;l=l.parentElement}return!1}})}function D(e){let r=m(e);b().nextFrame(()=>{r&&!h(r.activeElement,0)&&y(e)})}var w=(t=>(t[t.Keyboard=0]="Keyboard",t[t.Mouse=1]="Mouse",t))(w||{});typeof window!="undefined"&&typeof document!="undefined"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function y(e){e==null||e.focus({preventScroll:!0})}let S=["textarea","input"].join(",");function H(e){var r,t;return(t=(r=e==null?void 0:e.matches)==null?void 0:r.call(e,S))!=null?t:!1}function I(e,r=t=>t){return e.slice().sort((t,l)=>{let o=r(t),i=r(l);if(o===null||i===null)return 0;let n=o.compareDocumentPosition(i);return n&Node.DOCUMENT_POSITION_FOLLOWING?-1:n&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function _(e,r){return O(f(),r,{relativeTo:e})}function O(e,r,{sorted:t=!0,relativeTo:l=null,skipElements:o=[]}={}){let i=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,n=Array.isArray(e)?t?I(e):e:f(e);o.length>0&&n.length>1&&(n=n.filter(s=>!o.includes(s))),l=l!=null?l:i.activeElement;let E=(()=>{if(r&5)return 1;if(r&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),x=(()=>{if(r&1)return 0;if(r&2)return Math.max(0,n.indexOf(l))-1;if(r&4)return Math.max(0,n.indexOf(l))+1;if(r&8)return n.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),p=r&32?{preventScroll:!0}:{},d=0,a=n.length,u;do{if(d>=a||d+a<=0)return 0;let s=x+d;if(r&16)s=(s+a)%a;else{if(s<0)return 3;if(s>=a)return 1}u=n[s],u==null||u.focus(p),d+=E}while(u!==i.activeElement);return r&6&&H(u)&&u.select(),2}export{M as Focus,N as FocusResult,T as FocusableMode,y as focusElement,_ as focusFrom,O as focusIn,f as getFocusableElements,h as isFocusableElement,D as restoreFocusIfNecessary,I as sortByDomNode};
|
||||
4
node_modules/@headlessui/react/dist/utils/form.d.ts
generated
vendored
Normal file
4
node_modules/@headlessui/react/dist/utils/form.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
type Entries = [string, string][];
|
||||
export declare function objectToFormEntries(source?: Record<string, any>, parentKey?: string | null, entries?: Entries): Entries;
|
||||
export declare function attemptSubmit(elementInForm: HTMLElement): void;
|
||||
export {};
|
||||
1
node_modules/@headlessui/react/dist/utils/form.js
generated
vendored
Normal file
1
node_modules/@headlessui/react/dist/utils/form.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
function e(i={},s=null,t=[]){for(let[r,n]of Object.entries(i))o(t,f(s,r),n);return t}function f(i,s){return i?i+"["+s+"]":s}function o(i,s,t){if(Array.isArray(t))for(let[r,n]of t.entries())o(i,f(s,r.toString()),n);else t instanceof Date?i.push([s,t.toISOString()]):typeof t=="boolean"?i.push([s,t?"1":"0"]):typeof t=="string"?i.push([s,t]):typeof t=="number"?i.push([s,`${t}`]):t==null?i.push([s,""]):e(t,s,i)}function p(i){var t,r;let s=(t=i==null?void 0:i.form)!=null?t:i.closest("form");if(s){for(let n of s.elements)if(n!==i&&(n.tagName==="INPUT"&&n.type==="submit"||n.tagName==="BUTTON"&&n.type==="submit"||n.nodeName==="INPUT"&&n.type==="image")){n.click();return}(r=s.requestSubmit)==null||r.call(s)}}export{p as attemptSubmit,e as objectToFormEntries};
|
||||
1
node_modules/@headlessui/react/dist/utils/get-text-value.d.ts
generated
vendored
Normal file
1
node_modules/@headlessui/react/dist/utils/get-text-value.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare function getTextValue(element: HTMLElement): string;
|
||||
1
node_modules/@headlessui/react/dist/utils/get-text-value.js
generated
vendored
Normal file
1
node_modules/@headlessui/react/dist/utils/get-text-value.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
let a=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function o(e){var r,i;let n=(r=e.innerText)!=null?r:"",t=e.cloneNode(!0);if(!(t instanceof HTMLElement))return n;let u=!1;for(let f of t.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))f.remove(),u=!0;let l=u?(i=t.innerText)!=null?i:"":n;return a.test(l)&&(l=l.replace(a,"")),l}function g(e){let n=e.getAttribute("aria-label");if(typeof n=="string")return n.trim();let t=e.getAttribute("aria-labelledby");if(t){let u=t.split(" ").map(l=>{let r=document.getElementById(l);if(r){let i=r.getAttribute("aria-label");return typeof i=="string"?i.trim():o(r).trim()}return null}).filter(Boolean);if(u.length>0)return u.join(", ")}return o(e).trim()}export{g as getTextValue};
|
||||
1
node_modules/@headlessui/react/dist/utils/match.d.ts
generated
vendored
Normal file
1
node_modules/@headlessui/react/dist/utils/match.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare function match<TValue extends string | number = string, TReturnValue = unknown>(value: TValue, lookup: Record<TValue, TReturnValue | ((...args: any[]) => TReturnValue)>, ...args: any[]): TReturnValue;
|
||||
1
node_modules/@headlessui/react/dist/utils/match.js
generated
vendored
Normal file
1
node_modules/@headlessui/react/dist/utils/match.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
function u(r,n,...a){if(r in n){let e=n[r];return typeof e=="function"?e(...a):e}let t=new Error(`Tried to handle "${r}" but there is no handler defined. Only defined handlers are: ${Object.keys(n).map(e=>`"${e}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,u),t}export{u as match};
|
||||
1
node_modules/@headlessui/react/dist/utils/micro-task.d.ts
generated
vendored
Normal file
1
node_modules/@headlessui/react/dist/utils/micro-task.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare function microTask(cb: () => void): void;
|
||||
1
node_modules/@headlessui/react/dist/utils/micro-task.js
generated
vendored
Normal file
1
node_modules/@headlessui/react/dist/utils/micro-task.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
function t(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(o=>setTimeout(()=>{throw o}))}export{t as microTask};
|
||||
1
node_modules/@headlessui/react/dist/utils/once.d.ts
generated
vendored
Normal file
1
node_modules/@headlessui/react/dist/utils/once.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare function once<T>(cb: (...args: T[]) => void): (...args: T[]) => void;
|
||||
1
node_modules/@headlessui/react/dist/utils/once.js
generated
vendored
Normal file
1
node_modules/@headlessui/react/dist/utils/once.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
function l(r){let e={called:!1};return(...t)=>{if(!e.called)return e.called=!0,r(...t)}}export{l as once};
|
||||
2
node_modules/@headlessui/react/dist/utils/owner.d.ts
generated
vendored
Normal file
2
node_modules/@headlessui/react/dist/utils/owner.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import { MutableRefObject } from 'react';
|
||||
export declare function getOwnerDocument<T extends Element | MutableRefObject<Element | null>>(element: T | null | undefined): Document | null;
|
||||
1
node_modules/@headlessui/react/dist/utils/owner.js
generated
vendored
Normal file
1
node_modules/@headlessui/react/dist/utils/owner.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
import{env as n}from'./env.js';function e(r){return n.isServer?null:r instanceof Node?r.ownerDocument:r!=null&&r.hasOwnProperty("current")&&r.current instanceof Node?r.current.ownerDocument:document}export{e as getOwnerDocument};
|
||||
3
node_modules/@headlessui/react/dist/utils/platform.d.ts
generated
vendored
Normal file
3
node_modules/@headlessui/react/dist/utils/platform.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export declare function isIOS(): boolean;
|
||||
export declare function isAndroid(): boolean;
|
||||
export declare function isMobile(): boolean;
|
||||
1
node_modules/@headlessui/react/dist/utils/platform.js
generated
vendored
Normal file
1
node_modules/@headlessui/react/dist/utils/platform.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
function t(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function i(){return/Android/gi.test(window.navigator.userAgent)}function n(){return t()||i()}export{i as isAndroid,t as isIOS,n as isMobile};
|
||||
60
node_modules/@headlessui/react/dist/utils/render.d.ts
generated
vendored
Normal file
60
node_modules/@headlessui/react/dist/utils/render.d.ts
generated
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
import { ElementType, ReactElement, Ref } from 'react';
|
||||
import { Props, XOR, __, Expand } from '../types.js';
|
||||
export declare enum Features {
|
||||
/** No features at all */
|
||||
None = 0,
|
||||
/**
|
||||
* When used, this will allow us to use one of the render strategies.
|
||||
*
|
||||
* **The render strategies are:**
|
||||
* - **Unmount** _(Will unmount the component.)_
|
||||
* - **Hidden** _(Will hide the component using the [hidden] attribute.)_
|
||||
*/
|
||||
RenderStrategy = 1,
|
||||
/**
|
||||
* When used, this will allow the user of our component to be in control. This can be used when
|
||||
* you want to transition based on some state.
|
||||
*/
|
||||
Static = 2
|
||||
}
|
||||
export declare enum RenderStrategy {
|
||||
Unmount = 0,
|
||||
Hidden = 1
|
||||
}
|
||||
type PropsForFeature<TPassedInFeatures extends Features, TForFeature extends Features, TProps> = {
|
||||
[P in TPassedInFeatures]: P extends TForFeature ? TProps : __;
|
||||
}[TPassedInFeatures];
|
||||
export type PropsForFeatures<T extends Features> = XOR<PropsForFeature<T, Features.Static, {
|
||||
static?: boolean;
|
||||
}>, PropsForFeature<T, Features.RenderStrategy, {
|
||||
unmount?: boolean;
|
||||
}>>;
|
||||
export declare function render<TFeature extends Features, TTag extends ElementType, TSlot>({ ourProps, theirProps, slot, defaultTag, features, visible, name, }: {
|
||||
ourProps: Expand<Props<TTag, TSlot, any> & PropsForFeatures<TFeature>> & {
|
||||
ref?: Ref<HTMLElement | ElementType>;
|
||||
};
|
||||
theirProps: Expand<Props<TTag, TSlot, any>>;
|
||||
slot?: TSlot;
|
||||
defaultTag: ElementType;
|
||||
features?: TFeature;
|
||||
visible?: boolean;
|
||||
name: string;
|
||||
}): ReactElement<any, string | import("react").JSXElementConstructor<any>> | null;
|
||||
export type HasDisplayName = {
|
||||
displayName: string;
|
||||
};
|
||||
export type RefProp<T extends Function> = T extends (props: any, ref: Ref<infer RefType>) => any ? {
|
||||
ref?: Ref<RefType>;
|
||||
} : never;
|
||||
/**
|
||||
* This is a hack, but basically we want to keep the full 'API' of the component, but we do want to
|
||||
* wrap it in a forwardRef so that we _can_ passthrough the ref
|
||||
*/
|
||||
export declare function forwardRefWithAs<T extends {
|
||||
name: string;
|
||||
displayName?: string;
|
||||
}>(component: T): T & {
|
||||
displayName: string;
|
||||
};
|
||||
export declare function compact<T extends Record<any, any>>(object: T): {} & T;
|
||||
export {};
|
||||
4
node_modules/@headlessui/react/dist/utils/render.js
generated
vendored
Normal file
4
node_modules/@headlessui/react/dist/utils/render.js
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import{Fragment as T,cloneElement as x,createElement as E,forwardRef as b,isValidElement as h}from"react";import{classNames as F}from'./class-names.js';import{match as P}from'./match.js';var S=(a=>(a[a.None=0]="None",a[a.RenderStrategy=1]="RenderStrategy",a[a.Static=2]="Static",a))(S||{}),j=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(j||{});function X({ourProps:r,theirProps:t,slot:e,defaultTag:a,features:s,visible:n=!0,name:f}){let o=N(t,r);if(n)return c(o,e,a,f);let u=s!=null?s:0;if(u&2){let{static:l=!1,...p}=o;if(l)return c(p,e,a,f)}if(u&1){let{unmount:l=!0,...p}=o;return P(l?0:1,{[0](){return null},[1](){return c({...p,hidden:!0,style:{display:"none"}},e,a,f)}})}return c(o,e,a,f)}function c(r,t={},e,a){let{as:s=e,children:n,refName:f="ref",...o}=g(r,["unmount","static"]),u=r.ref!==void 0?{[f]:r.ref}:{},l=typeof n=="function"?n(t):n;"className"in o&&o.className&&typeof o.className=="function"&&(o.className=o.className(t));let p={};if(t){let i=!1,m=[];for(let[y,d]of Object.entries(t))typeof d=="boolean"&&(i=!0),d===!0&&m.push(y);i&&(p["data-headlessui-state"]=m.join(" "))}if(s===T&&Object.keys(R(o)).length>0){if(!h(l)||Array.isArray(l)&&l.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${a} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(o).map(d=>` - ${d}`).join(`
|
||||
`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(d=>` - ${d}`).join(`
|
||||
`)].join(`
|
||||
`));let i=l.props,m=typeof(i==null?void 0:i.className)=="function"?(...d)=>F(i==null?void 0:i.className(...d),o.className):F(i==null?void 0:i.className,o.className),y=m?{className:m}:{};return x(l,Object.assign({},N(l.props,R(g(o,["ref"]))),p,u,w(l.ref,u.ref),y))}return E(s,Object.assign({},g(o,["ref"]),s!==T&&u,s!==T&&p),l)}function w(...r){return{ref:r.every(t=>t==null)?void 0:t=>{for(let e of r)e!=null&&(typeof e=="function"?e(t):e.current=t)}}}function N(...r){var a;if(r.length===0)return{};if(r.length===1)return r[0];let t={},e={};for(let s of r)for(let n in s)n.startsWith("on")&&typeof s[n]=="function"?((a=e[n])!=null||(e[n]=[]),e[n].push(s[n])):t[n]=s[n];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(e).map(s=>[s,void 0])));for(let s in e)Object.assign(t,{[s](n,...f){let o=e[s];for(let u of o){if((n instanceof Event||(n==null?void 0:n.nativeEvent)instanceof Event)&&n.defaultPrevented)return;u(n,...f)}}});return t}function D(r){var t;return Object.assign(b(r),{displayName:(t=r.displayName)!=null?t:r.name})}function R(r){let t=Object.assign({},r);for(let e in t)t[e]===void 0&&delete t[e];return t}function g(r,t=[]){let e=Object.assign({},r);for(let a of t)a in e&&delete e[a];return e}export{S as Features,j as RenderStrategy,R as compact,D as forwardRefWithAs,X as render};
|
||||
5
node_modules/@headlessui/react/dist/utils/stable-collection.d.ts
generated
vendored
Normal file
5
node_modules/@headlessui/react/dist/utils/stable-collection.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import * as React from 'react';
|
||||
export declare function StableCollection({ children }: {
|
||||
children: React.ReactNode | React.ReactNode[];
|
||||
}): JSX.Element;
|
||||
export declare function useStableCollectionIndex(group: string): number;
|
||||
1
node_modules/@headlessui/react/dist/utils/stable-collection.js
generated
vendored
Normal file
1
node_modules/@headlessui/react/dist/utils/stable-collection.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
import*as r from"react";const s=r.createContext(null);function a(){return{groups:new Map,get(n,t){var c;let e=this.groups.get(n);e||(e=new Map,this.groups.set(n,e));let l=(c=e.get(t))!=null?c:0;e.set(t,l+1);let o=Array.from(e.keys()).indexOf(t);function i(){let u=e.get(t);u>1?e.set(t,u-1):e.delete(t)}return[o,i]}}}function C({children:n}){let t=r.useRef(a());return r.createElement(s.Provider,{value:t},n)}function d(n){let t=r.useContext(s);if(!t)throw new Error("You must wrap your component in a <StableCollection>");let e=f(),[l,o]=t.current.get(n,e);return r.useEffect(()=>o,[]),l}function f(){var l,o,i;let n=(i=(o=(l=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)==null?void 0:l.ReactCurrentOwner)==null?void 0:o.current)!=null?i:null;if(!n)return Symbol();let t=[],e=n;for(;e;)t.push(e.index),e=e.return;return"$."+t.join(".")}export{C as StableCollection,d as useStableCollectionIndex};
|
||||
1
node_modules/@headlessui/react/dist/utils/start-transition.d.ts
generated
vendored
Normal file
1
node_modules/@headlessui/react/dist/utils/start-transition.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare let startTransition: any;
|
||||
1
node_modules/@headlessui/react/dist/utils/start-transition.js
generated
vendored
Normal file
1
node_modules/@headlessui/react/dist/utils/start-transition.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
var t;import r from"react";let a=(t=r.startTransition)!=null?t:function(i){i()};export{a as startTransition};
|
||||
11
node_modules/@headlessui/react/dist/utils/store.d.ts
generated
vendored
Normal file
11
node_modules/@headlessui/react/dist/utils/store.d.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
type ChangeFn = () => void;
|
||||
type UnsubscribeFn = () => void;
|
||||
type ActionFn<T> = (this: T, ...args: any[]) => T | void;
|
||||
type StoreActions<Key extends string, T> = Record<Key, ActionFn<T>>;
|
||||
export interface Store<T, ActionKey extends string> {
|
||||
getSnapshot(): T;
|
||||
subscribe(onChange: ChangeFn): UnsubscribeFn;
|
||||
dispatch(action: ActionKey, ...args: any[]): void;
|
||||
}
|
||||
export declare function createStore<T, ActionKey extends string>(initial: () => T, actions: StoreActions<ActionKey, T>): Store<T, ActionKey>;
|
||||
export {};
|
||||
1
node_modules/@headlessui/react/dist/utils/store.js
generated
vendored
Normal file
1
node_modules/@headlessui/react/dist/utils/store.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
function a(o,r){let t=o(),n=new Set;return{getSnapshot(){return t},subscribe(e){return n.add(e),()=>n.delete(e)},dispatch(e,...s){let i=r[e].call(t,...s);i&&(t=i,n.forEach(c=>c()))}}}export{a as createStore};
|
||||
Reference in New Issue
Block a user