@clicktap/ui 0.35.0 → 0.36.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/assets/useControlledState-Cmn8tE-_.js +1 -0
- package/assets/useEffectEvent-gqjrDmw8.js +1 -0
- package/assets/useOverlayTriggerState-CooW9h9l.js +1 -0
- package/components/Collapsible/Collapsible.js +1 -1
- package/components/Collapsible/CollapsibleTrigger.js +3 -3
- package/components/Collapsible/index.js +1 -1
- package/components/Collection/CollectionToolbar/CollectionToolbar.js +1 -1
- package/components/Collection/CollectionToolbar/index.js +1 -1
- package/components/Collection/index.js +1 -1
- package/components/PinInput/PinInput.js +1 -1
- package/components/Select/ButtonSelect.d.ts +3 -0
- package/components/Select/ButtonSelect.js +1 -0
- package/components/Select/ComboBoxSelect.d.ts +9 -0
- package/components/Select/ComboBoxSelect.js +1 -0
- package/components/Select/Option.d.ts +1 -2
- package/components/Select/Option.js +1 -1
- package/components/Select/Option.types.d.ts +2 -2
- package/components/Select/Select.js +1 -1
- package/components/Select/Select.types.d.ts +21 -1
- package/components/Select/index.d.ts +0 -2
- package/components/Select/index.js +1 -1
- package/components/Select/parts.d.ts +36 -0
- package/components/Select/parts.js +1 -0
- package/package.json +1 -1
- package/components/Avatar/Avatar.stories.d.ts +0 -13
- package/components/Badge/Badge.stories.d.ts +0 -8
- package/components/Divider/Divider.stories.d.ts +0 -6
- package/components/Link/Link.stories.d.ts +0 -6
- package/components/Meter/Meter.stories.d.ts +0 -6
- package/components/Select/DropdownSelect.d.ts +0 -16
- package/components/Select/DropdownSelect.js +0 -1
- package/components/Time/Time.stories.d.ts +0 -20
- package/components/TimeInput/TimeInput.stories.d.ts +0 -6
- package/components/ToggleButton/ToggleButton.stories.d.ts +0 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import s,{useState as R,useRef as d,useEffect as V,useReducer as m,useCallback as b}from"react";const y=typeof document<"u"?s.useInsertionEffect??s.useLayoutEffect:()=>{};function C(o,a,c){let[l,i]=R(o||a),r=d(l),u=d(o!==void 0),t=o!==void 0;V(()=>{let e=u.current;e!==t&&process.env.NODE_ENV!=="production"&&console.warn(`WARN: A component changed from ${e?"controlled":"uncontrolled"} to ${t?"controlled":"uncontrolled"}.`),u.current=t},[t]);let f=t?o:l;y(()=>{r.current=f});let[,p]=m(()=>({}),{}),$=b((e,...E)=>{let n=typeof e=="function"?e(r.current):e;Object.is(r.current,n)||(r.current=n,i(n),p(),c?.(n,...E))},[c]);return[f,$]}export{C as $};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import n,{useRef as o,useCallback as c}from"react";const s=e=>e?.ownerDocument??document,b=e=>e&&"window"in e&&e.window===e?e:s(e).defaultView||window;function u(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function i(e){return u(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}const $=typeof document<"u"?n.useLayoutEffect:()=>{};let d=!1;function a(){return d}function m(e,f){if(!a())return f&&e?e.contains(f):!1;if(!e||!f)return!1;let t=f;for(;t!==null;){if(t===e)return!0;t.tagName==="SLOT"&&t.assignedSlot?t=t.assignedSlot.parentNode:i(t)?t=t.host:t=t.parentNode}return!1}function w(e){if(a()&&e.target instanceof Element&&e.target.shadowRoot){if("composedPath"in e)return e.composedPath()[0]??null;if("composedPath"in e.nativeEvent)return e.nativeEvent.composedPath()[0]??null}return e.target}const p=n.useInsertionEffect??$;function E(e){const f=o(null);return p(()=>{f.current=e},[e]),c((...t)=>{const r=f.current;return r?.(...t)},[])}export{m as $,w as a,$ as b,s as c,b as d,E as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import v,{useMemo as m,useContext as Y,useState as $,useRef as b,useEffect as B,createContext as G,useCallback as C}from"react";import{$ as P}from"./useControlledState-Cmn8tE-_.js";const W={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1,valid:!0},q={...W,customError:!0,valid:!1},V={isInvalid:!1,validationDetails:W,validationErrors:[]},H=G({}),z="__reactAriaFormValidationState";function ue(i){if(i[z]){let{realtimeValidation:e,displayValidation:t,updateValidation:l,resetValidation:s,commitValidation:n}=i[z];return{realtimeValidation:e,displayValidation:t,updateValidation:l,resetValidation:s,commitValidation:n}}return J(i)}function J(i){let{isInvalid:e,validationState:t,name:l,value:s,builtinValidation:n,validate:r,validationBehavior:a="aria"}=i;t&&(e||=t==="invalid");let o=e!==void 0?{isInvalid:e,validationErrors:[],validationDetails:q}:null,c=m(()=>{if(!r||s==null)return null;let u=X(r,s);return O(u)},[r,s]);n?.validationDetails.valid&&(n=void 0);let d=Y(H),g=m(()=>l?Array.isArray(l)?l.flatMap(u=>D(d[u])):D(d[l]):[],[d,l]),[h,p]=$(d),[E,S]=$(!1);d!==h&&(p(d),S(!1));let f=m(()=>O(E?[]:g),[E,g]),w=b(V),[x,y]=$(V),I=b(V),j=()=>{if(!Q)return;k(!1);let u=c||n||w.current;A(u,I.current)||(I.current=u,y(u))},[Q,k]=$(!1);return B(j),{realtimeValidation:o||f||c||n||V,displayValidation:a==="native"?o||f||x:o||f||c||n||x,updateValidation(u){a==="aria"&&!A(x,u)?y(u):w.current=u},resetValidation(){let u=V;A(u,I.current)||(I.current=u,y(u)),a==="native"&&k(!1),S(!0)},commitValidation(){a==="native"&&k(!0),S(!0)}}}function D(i){return i?Array.isArray(i)?i:[i]:[]}function X(i,e){if(typeof i=="function"){let t=i(e);if(t&&typeof t!="boolean")return D(t)}return[]}function O(i){return i.length?{isInvalid:!0,validationErrors:i,validationDetails:q}:null}function A(i,e){return i===e?!0:!!i&&!!e&&i.isInvalid===e.isInvalid&&i.validationErrors.length===e.validationErrors.length&&i.validationErrors.every((t,l)=>t===e.validationErrors[l])&&Object.entries(i.validationDetails).every(([t,l])=>e.validationDetails[t]===l)}function Z(i,e){return typeof e.getChildren=="function"?e.getChildren(i.key):i.childNodes}function N(i){return ee(i)}function ee(i,e){for(let t of i)return t}function F(i,e,t){if(e.parentKey===t.parentKey)return e.index-t.index;let l=[..._(i,e),e],s=[..._(i,t),t],n=l.slice(0,s.length).findIndex((r,a)=>r!==s[a]);return n!==-1?(e=l[n],t=s[n],e.index-t.index):l.findIndex(r=>r===t)>=0?1:(s.findIndex(r=>r===e)>=0,-1)}function _(i,e){let t=[],l=e;for(;l?.parentKey!=null;)l=i.getItem(l.parentKey),l&&t.unshift(l);return t}class T{constructor(e){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.iterable=e;let t=r=>{if(this.keyMap.set(r.key,r),r.childNodes&&r.type==="section")for(let a of r.childNodes)t(a)};for(let r of e)t(r);let l=null,s=0,n=0;for(let[r,a]of this.keyMap)l?(l.nextKey=r,a.prevKey=l.key):(this.firstKey=r,a.prevKey=void 0),a.type==="item"&&(a.index=s++),(a.type==="section"||a.type==="item")&&n++,l=a,l.nextKey=void 0;this._size=n,this.lastKey=l?.key??null}*[Symbol.iterator](){yield*this.iterable}get size(){return this._size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){let t=this.keyMap.get(e);return t?t.prevKey??null:null}getKeyAfter(e){let t=this.keyMap.get(e);return t?t.nextKey??null:null}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){return this.keyMap.get(e)??null}at(e){const t=[...this.getKeys()];return this.getItem(t[e])}getChildren(e){return this.keyMap.get(e)?.childNodes||[]}}class K extends Set{constructor(e,t,l){super(e),e instanceof K?(this.anchorKey=t??e.anchorKey,this.currentKey=l??e.currentKey):(this.anchorKey=t??null,this.currentKey=l??null)}}function te(i,e){if(i.size!==e.size)return!1;for(let t of i)if(!e.has(t))return!1;return!0}function le(i){let{selectionMode:e="none",disallowEmptySelection:t=!1,allowDuplicateSelectionEvents:l,selectionBehavior:s="toggle",disabledBehavior:n="all"}=i,r=b(!1),[,a]=$(!1),o=b(null),c=b(null),[,d]=$(null),g=m(()=>L(i.selectedKeys),[i.selectedKeys]),h=m(()=>L(i.defaultSelectedKeys,new K),[i.defaultSelectedKeys]),[p,E]=P(g,h,i.onSelectionChange),S=m(()=>i.disabledKeys?new Set(i.disabledKeys):new Set,[i.disabledKeys]),[f,w]=$(s);s==="replace"&&f==="toggle"&&typeof p=="object"&&p.size===0&&w("replace");let x=b(s);return B(()=>{s!==x.current&&(w(s),x.current=s)},[s]),{selectionMode:e,disallowEmptySelection:t,selectionBehavior:f,setSelectionBehavior:w,get isFocused(){return r.current},setFocused(y){r.current=y,a(y)},get focusedKey(){return o.current},get childFocusStrategy(){return c.current},setFocusedKey(y,I="first"){o.current=y,c.current=I,d(y)},selectedKeys:p,setSelectedKeys(y){(l||!te(y,p))&&E(y)},disabledKeys:S,disabledBehavior:n}}function L(i,e){return i?i==="all"?"all":new K(i):e}class R{constructor(e,t,l){this.collection=e,this.state=t,this.allowsCellSelection=l?.allowsCellSelection??!1,this._isSelectAll=null,this.layoutDelegate=l?.layoutDelegate||null,this.fullCollection=l?.fullCollection||null}get selectionMode(){return this.state.selectionMode}get disallowEmptySelection(){return this.state.disallowEmptySelection}get selectionBehavior(){return this.state.selectionBehavior}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}get isFocused(){return this.state.isFocused}setFocused(e){this.state.setFocused(e)}get focusedKey(){return this.state.focusedKey}get childFocusStrategy(){return this.state.childFocusStrategy}setFocusedKey(e,t){(e==null||this.collection.getItem(e))&&this.state.setFocusedKey(e,t)}get selectedKeys(){return this.state.selectedKeys==="all"?new Set(this.getSelectAllKeys()):this.state.selectedKeys}get rawSelection(){return this.state.selectedKeys}isSelected(e){if(this.state.selectionMode==="none")return!1;let t=this.getKey(e);return t==null?!1:this.state.selectedKeys==="all"?this.canSelectItem(t):this.state.selectedKeys.has(t)}get isEmpty(){return this.state.selectedKeys!=="all"&&this.state.selectedKeys.size===0}get isSelectAll(){if(this.isEmpty)return!1;if(this.state.selectedKeys==="all")return!0;if(this._isSelectAll!=null)return this._isSelectAll;let e=this.getSelectAllKeys(),t=this.state.selectedKeys;return this._isSelectAll=e.every(l=>t.has(l)),this._isSelectAll}get firstSelectedKey(){let e=null;for(let t of this.state.selectedKeys){let l=this.collection.getItem(t);(!e||l&&F(this.collection,l,e)<0)&&(e=l)}return e?.key??null}get lastSelectedKey(){let e=null;for(let t of this.state.selectedKeys){let l=this.collection.getItem(t);(!e||l&&F(this.collection,l,e)>0)&&(e=l)}return e?.key??null}get disabledKeys(){return this.state.disabledKeys}get disabledBehavior(){return this.state.disabledBehavior}extendSelection(e){if(this.selectionMode==="none")return;if(this.selectionMode==="single"){this.replaceSelection(e);return}let t=this.getKey(e);if(t==null)return;let l;if(this.state.selectedKeys==="all")l=new K([t],t,t);else{let s=this.state.selectedKeys,n=s.anchorKey??t;l=new K(s,n,t);for(let r of this.getKeyRange(n,s.currentKey??t))l.delete(r);for(let r of this.getKeyRange(t,n))this.canSelectItem(r)&&l.add(r)}this.state.setSelectedKeys(l)}getKeyRange(e,t){let l=this.collection.getItem(e),s=this.collection.getItem(t);return l&&s?F(this.collection,l,s)<=0?this.getKeyRangeInternal(e,t):this.getKeyRangeInternal(t,e):[]}getKeyRangeInternal(e,t){if(this.layoutDelegate?.getKeyRange)return this.layoutDelegate.getKeyRange(e,t);let l=[],s=e;for(;s!=null;){let n=this.collection.getItem(s);if(n&&(n.type==="item"||n.type==="cell"&&this.allowsCellSelection)&&l.push(s),s===t)return l;s=this.collection.getKeyAfter(s)}return[]}getKey(e){let t=this.collection.getItem(e);if(!t||t.type==="cell"&&this.allowsCellSelection)return e;for(;t&&t.type!=="item"&&t.parentKey!=null;)t=this.collection.getItem(t.parentKey);return!t||t.type!=="item"?null:t.key}toggleSelection(e){if(this.selectionMode==="none")return;if(this.selectionMode==="single"&&!this.isSelected(e)){this.replaceSelection(e);return}let t=this.getKey(e);if(t==null)return;let l=new K(this.state.selectedKeys==="all"?this.getSelectAllKeys():this.state.selectedKeys);l.has(t)?l.delete(t):this.canSelectItem(t)&&(l.add(t),l.anchorKey=t,l.currentKey=t),!(this.disallowEmptySelection&&l.size===0)&&this.state.setSelectedKeys(l)}replaceSelection(e){if(this.selectionMode==="none")return;let t=this.getKey(e);if(t==null)return;let l=this.canSelectItem(t)?new K([t],t,t):new K;this.state.setSelectedKeys(l)}setSelectedKeys(e){if(this.selectionMode==="none")return;let t=new K;for(let l of e){let s=this.getKey(l);if(s!=null&&(t.add(s),this.selectionMode==="single"))break}this.state.setSelectedKeys(t)}getSelectAllKeys(){let e=this.fullCollection??this.collection,t=[],l=s=>{for(;s!=null;){if(this.canSelectItemIn(s,e)){let n=e.getItem(s);n?.type==="item"&&t.push(s),n?.hasChildNodes&&(this.allowsCellSelection||n.type!=="item")&&l(N(Z(n,e))?.key??null)}s=e.getKeyAfter(s)}};return l(e.getFirstKey()),t}selectAll(){!this.isSelectAll&&this.selectionMode==="multiple"&&this.state.setSelectedKeys("all")}clearSelection(){!this.disallowEmptySelection&&(this.state.selectedKeys==="all"||this.state.selectedKeys.size>0)&&this.state.setSelectedKeys(new K)}toggleSelectAll(){this.isSelectAll?this.clearSelection():this.selectAll()}select(e,t){this.selectionMode!=="none"&&(this.selectionMode==="single"?this.isSelected(e)&&!this.disallowEmptySelection?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior==="toggle"||t&&(t.pointerType==="touch"||t.pointerType==="virtual")?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys)return!0;let t=this.selectedKeys;if(e.size!==t.size)return!1;for(let l of e)if(!t.has(l))return!1;for(let l of t)if(!e.has(l))return!1;return!0}canSelectItem(e){return this.canSelectItemIn(e,this.collection)}canSelectItemIn(e,t){if(this.state.selectionMode==="none"||this.state.disabledKeys.has(e))return!1;let l=t.getItem(e);return!(!l||l?.props?.isDisabled||l.type==="cell"&&!this.allowsCellSelection)}isDisabled(e){return this.state.disabledBehavior==="all"&&(this.state.disabledKeys.has(e)||!!this.collection.getItem(e)?.props?.isDisabled)}isLink(e){return!!this.collection.getItem(e)?.props?.href}getItemProps(e){return this.collection.getItem(e)?.props}withCollection(e){return new R(e,this.state,{allowsCellSelection:this.allowsCellSelection,layoutDelegate:this.layoutDelegate||void 0,fullCollection:this.fullCollection??this.collection})}}class ie{build(e,t){return this.context=t,U(()=>this.iterateCollection(e))}*iterateCollection(e){let{children:t,items:l}=e;if(v.isValidElement(t)&&t.type===v.Fragment)yield*this.iterateCollection({children:t.props.children,items:l});else if(typeof t=="function"){if(!l)throw new Error("props.children was a function but props.items is missing");let s=0;for(let n of l)yield*this.getFullNode({value:n,index:s},{renderer:t}),s++}else{let s=[];v.Children.forEach(t,r=>{r&&s.push(r)});let n=0;for(let r of s){let a=this.getFullNode({element:r,index:n},{});for(let o of a)n++,yield o}}}getKey(e,t,l,s){if(e.key!=null)return e.key;if(t.type==="cell"&&t.key!=null)return`${s}${t.key}`;let n=t.value;if(n!=null){let r=n.key??n.id;if(r==null)throw new Error("No key found for item");return r}return s?`${s}.${t.index}`:`$.${t.index}`}getChildState(e,t){return{renderer:t.renderer||e.renderer}}*getFullNode(e,t,l,s){if(v.isValidElement(e.element)&&e.element.type===v.Fragment){let o=[];v.Children.forEach(e.element.props.children,d=>{o.push(d)});let c=e.index??0;for(const d of o)yield*this.getFullNode({element:d,index:c++},t,l,s);return}let n=e.element;if(!n&&e.value&&t&&t.renderer){let o=this.cache.get(e.value);if(o&&(!o.shouldInvalidate||!o.shouldInvalidate(this.context))){o.index=e.index,o.parentKey=s?s.key:null,yield o;return}n=t.renderer(e.value)}if(v.isValidElement(n)){let o=n.type;if(typeof o!="function"&&typeof o.getCollectionNode!="function"){let h=n.type;throw new Error(`Unknown element <${h}> in collection.`)}let c=o.getCollectionNode(n.props,this.context),d=e.index??0,g=c.next();for(;!g.done&&g.value;){let h=g.value;e.index=d;let p=h.key??null;p==null&&(p=h.element?null:this.getKey(n,e,t,l));let S=[...this.getFullNode({...h,key:p,index:d,wrapper:se(e.wrapper,h.wrapper)},this.getChildState(t,h),l?`${l}${n.key}`:n.key,s)];for(let f of S){if(f.value=h.value??e.value??null,f.value&&this.cache.set(f.value,f),e.type&&f.type!==e.type)throw new Error(`Unsupported type <${M(f.type)}> in <${M(s?.type??"unknown parent type")}>. Only <${M(e.type)}> is supported.`);d++,yield f}g=c.next(S)}return}if(e.key==null||e.type==null)return;let r=this,a={type:e.type,props:e.props,key:e.key,parentKey:s?s.key:null,value:e.value??null,level:(s?.level??0)+(s?.type==="item"?1:0),index:e.index,rendered:e.rendered,textValue:e.textValue??"","aria-label":e["aria-label"],wrapper:e.wrapper,shouldInvalidate:e.shouldInvalidate,hasChildNodes:e.hasChildNodes||!1,childNodes:U(function*(){if(!e.hasChildNodes||!e.childNodes)return;let o=0;for(let c of e.childNodes()){c.key!=null&&(c.key=`${a.key}${c.key}`);let d=r.getFullNode({...c,index:o},r.getChildState(t,c),a.key,a);for(let g of d)o++,yield g}})};yield a}constructor(){this.cache=new WeakMap}}function U(i){let e=[],t=null;return{*[Symbol.iterator](){for(let l of e)yield l;t||(t=i());for(let l of t)e.push(l),yield l}}}function se(i,e){if(i&&e)return t=>i(e(t));if(i)return i;if(e)return e}function M(i){return i[0].toUpperCase()+i.slice(1)}function ne(i,e,t){let l=m(()=>new ie,[]),{children:s,items:n,collection:r}=i;return m(()=>{if(r)return r;let o=l.build({children:s,items:n},t);return e(o)},[l,s,n,r,t,e])}function fe(i){let{filter:e,layoutDelegate:t}=i,l=le(i),s=m(()=>i.disabledKeys?new Set(i.disabledKeys):new Set,[i.disabledKeys]),n=C(c=>e?new T(e(c)):new T(c),[e]),r=m(()=>({suppressTextValueWarning:i.suppressTextValueWarning}),[i.suppressTextValueWarning]),a=ne(i,n,r),o=m(()=>new R(a,l,{layoutDelegate:t}),[a,l,t]);return re(a,o),{collection:a,disabledKeys:s,selectionManager:o}}function re(i,e){const t=b(null);B(()=>{if(e.focusedKey!=null&&!i.getItem(e.focusedKey)&&t.current){let l=t.current.getKeyAfter(e.focusedKey),s=null;for(;l!=null;){let n=i.getItem(l);if(n&&n.type==="item"&&!e.isDisabled(l)){s=l;break}l=t.current.getKeyAfter(l)}if(s==null)for(l=t.current.getKeyBefore(e.focusedKey);l!=null;){let n=i.getItem(l);if(n&&n.type==="item"&&!e.isDisabled(l)){s=l;break}l=t.current.getKeyBefore(l)}e.setFocusedKey(s)}t.current=i},[i,e])}function he(i){let[e,t]=P(i.isOpen,i.defaultOpen||!1,i.onOpenChange);const l=C(()=>{t(!0)},[t]),s=C(()=>{t(!1)},[t]),n=C(()=>{t(!e)},[t,e]);return{isOpen:e,setOpen:t,open:l,close:s,toggle:n}}export{fe as $,Z as a,he as b,T as c,ue as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as n}from"react/jsx-runtime";import{useContext as p}from"react";import{motion as a}from"framer-motion";import{CollapsibleTriggerStateContext as l}from"./CollapsibleTrigger.js";import{cn as m}from"../../utils/cn.js";import"react-aria-components";import"../../assets/useControlledState-Cmn8tE-_.js";import"../../assets/useEffectEvent-gqjrDmw8.js";import"react-dom";function x({children:i,className:t}){const{isOpen:o,id:e,defaultOpen:r}=p(l);return n(a.div,{className:m("w-full overflow-hidden",t),id:e,variants:{hidden:{height:"0px",opacity:0},visible:{height:"auto",opacity:1}},initial:r?"visible":"hidden",animate:o?"visible":"hidden",transition:{type:"spring",bounce:0},children:i})}export{x as Collapsible,x as default};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use client";import{jsx as fe}from"react/jsx-runtime";import{Provider as _e}from"react-aria-components";import _,{useState as we,useRef as R,useEffect as W,useReducer as Re,useCallback as h,useMemo as Fe,useContext as He,createContext as Ye,useId as Ge}from"react";import{flushSync as Xe}from"react-dom";import{cn as je}from"../../utils/cn.js";const We=typeof document<"u"?_.useInsertionEffect??_.useLayoutEffect:()=>{};function Be(e,t,i){let[o,s]=we(e||t),l=R(o),u=R(e!==void 0),f=e!==void 0;W(()=>{let T=u.current;T!==f&&process.env.NODE_ENV!=="production"&&console.warn(`WARN: A component changed from ${T?"controlled":"uncontrolled"} to ${f?"controlled":"uncontrolled"}.`),u.current=f},[f]);let m=f?e:o;We(()=>{l.current=m});let[,E]=Re(()=>({}),{}),y=h((T,...V)=>{let K=typeof T=="function"?T(l.current):T;Object.is(l.current,K)||(l.current=K,s(K),E(),i?.(K,...V))},[i]);return[m,y]}const L=e=>e?.ownerDocument??document,D=e=>e&&"window"in e&&e.window===e?e:L(e).defaultView||window;function ze(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function qe(e){return ze(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}const Je=typeof Element<"u"&&"checkVisibility"in Element.prototype;function Qe(e){const t=D(e);if(!(e instanceof t.HTMLElement)&&!(e instanceof t.SVGElement))return!1;let{display:i,visibility:o}=e.style,s=i!=="none"&&o!=="hidden"&&o!=="collapse";if(s){const{getComputedStyle:l}=e.ownerDocument.defaultView;let{display:u,visibility:f}=l(e);s=u!=="none"&&f!=="hidden"&&f!=="collapse"}return s}function Ze(e,t){return!e.hasAttribute("hidden")&&!e.hasAttribute("data-react-aria-prevent-focus")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function Se(e,t){return Je?e.checkVisibility({visibilityProperty:!0})&&!e.closest("[data-react-aria-prevent-focus]"):e.nodeName!=="#comment"&&Qe(e)&&Ze(e,t)&&(!e.parentElement||Se(e.parentElement,e))}const xe=["input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable^="false"])',"permission"],et=xe.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";xe.push('[tabindex]:not([tabindex="-1"]):not([disabled])');function tt(e,t){return e.matches(et)&&!rt(e)&&(t?.skipVisibilityCheck||Se(e))}function rt(e){let t=e;for(;t!=null;){if(t instanceof t.ownerDocument.defaultView.HTMLElement&&t.inert)return!0;t=t.parentElement}return!1}function ke(...e){return(...t)=>{for(let i of e)typeof i=="function"&&i(...t)}}const Le=typeof document<"u"?_.useLayoutEffect:()=>{};let ie=new Map;typeof FinalizationRegistry<"u"&&new FinalizationRegistry(e=>{ie.delete(e)});function nt(e,t){if(e===t)return e;let i=ie.get(e);if(i)return i.forEach(s=>s.current=t),t;let o=ie.get(t);return o?(o.forEach(s=>s.current=e),e):t}function it(...e){return e.length===1&&e[0]?e[0]:t=>{let i=!1;const o=e.map(s=>{const l=de(s,t);return i||=typeof l=="function",l});if(i)return()=>{o.forEach((s,l)=>{typeof s=="function"?s():de(e[l],null)})}}}function de(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Oe(e){var t,i,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(i=Oe(e[t]))&&(o&&(o+=" "),o+=i)}else for(i in e)e[i]&&(o&&(o+=" "),o+=i);return o}function ot(){for(var e,t,i=0,o="",s=arguments.length;i<s;i++)(e=arguments[i])&&(t=Oe(e))&&(o&&(o+=" "),o+=t);return o}function Me(...e){let t={...e[0]};for(let i=1;i<e.length;i++){let o=e[i];for(let s in o){let l=t[s],u=o[s];typeof l=="function"&&typeof u=="function"&&s[0]==="o"&&s[1]==="n"&&s.charCodeAt(2)>=65&&s.charCodeAt(2)<=90?t[s]=ke(l,u):(s==="className"||s==="UNSAFE_className")&&typeof l=="string"&&typeof u=="string"?t[s]=ot(l,u):s==="id"&&l&&u?t.id=nt(l,u):s==="ref"&&l&&u?t.ref=it(l,u):t[s]=u!==void 0?u:l}}return t}function B(e){if(st())e.focus({preventScroll:!0});else{let t=at(e);e.focus(),lt(t)}}let G=null;function st(){if(G==null){G=!1;try{document.createElement("div").focus({get preventScroll(){return G=!0,!0}})}catch{}}return G}function at(e){let t=e.parentNode,i=[],o=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==o;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&i.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return o instanceof HTMLElement&&i.push({element:o,scrollTop:o.scrollTop,scrollLeft:o.scrollLeft}),i}function lt(e){for(let{element:t,scrollTop:i,scrollLeft:o}of e)t.scrollTop=i,t.scrollLeft=o}let ut=!1;function Ce(){return ut}function b(e,t){if(!Ce())return t&&e?e.contains(t):!1;if(!e||!t)return!1;let i=t;for(;i!==null;){if(i===e)return!0;i.tagName==="SLOT"&&i.assignedSlot?i=i.assignedSlot.parentNode:qe(i)?i=i.host:i=i.parentNode}return!1}function p(e){if(Ce()&&e.target instanceof Element&&e.target.shadowRoot){if("composedPath"in e)return e.composedPath()[0]??null;if("composedPath"in e.nativeEvent)return e.nativeEvent.composedPath()[0]??null}return e.target}function ct(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function ft(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function pe(e){for(;e&&!tt(e,{skipVisibilityCheck:!0});)e=e.parentElement;let t=D(e),i=t.document.activeElement;if(!i||i===e)return;let o=!1,s=y=>{(p(y)===i||o)&&y.stopImmediatePropagation()},l=y=>{(p(y)===i||o)&&(y.stopImmediatePropagation(),!e&&!o&&(o=!0,B(i),m()))},u=y=>{(p(y)===e||o)&&y.stopImmediatePropagation()},f=y=>{(p(y)===e||o)&&(y.stopImmediatePropagation(),o||(o=!0,B(i),m()))};t.addEventListener("blur",s,!0),t.addEventListener("focusout",l,!0),t.addEventListener("focusin",f,!0),t.addEventListener("focus",u,!0);let m=()=>{cancelAnimationFrame(E),t.removeEventListener("blur",s,!0),t.removeEventListener("focusout",l,!0),t.removeEventListener("focusin",f,!0),t.removeEventListener("focus",u,!0),o=!1},E=requestAnimationFrame(m);return m}function z(e){if(typeof window>"u"||window.navigator==null)return!1;let t=window.navigator.userAgentData?.brands;return Array.isArray(t)&&t.some(i=>e.test(i.brand))||e.test(window.navigator.userAgent)}function ae(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.userAgentData?.platform||window.navigator.platform):!1}function S(e){if(process.env.NODE_ENV==="test")return e;let t=null;return()=>(t==null&&(t=e()),t)}const F=S(function(){return ae(/^Mac/i)}),dt=S(function(){return ae(/^iPhone/i)}),Ke=S(function(){return ae(/^iPad/i)||F()&&navigator.maxTouchPoints>1}),le=S(function(){return dt()||Ke()});S(function(){return F()||le()});const pt=S(function(){return z(/AppleWebKit/i)&&!gt()}),gt=S(function(){return z(/Chrome/i)}),Ie=S(function(){return z(/Android/i)}),$t=S(function(){return z(/Firefox/i)});let O=new Map,oe=new Set;function ge(){if(typeof window>"u")return;function e(o){return"propertyName"in o}let t=o=>{let s=p(o);if(!e(o)||!s)return;let l=O.get(s);l||(l=new Set,O.set(s,l),s.addEventListener("transitioncancel",i,{once:!0})),l.add(o.propertyName)},i=o=>{let s=p(o);if(!e(o)||!s)return;let l=O.get(s);if(l&&(l.delete(o.propertyName),l.size===0&&(s.removeEventListener("transitioncancel",i),O.delete(s)),O.size===0)){for(let u of oe)u();oe.clear()}};document.body.addEventListener("transitionrun",t),document.body.addEventListener("transitionend",i)}typeof document<"u"&&(document.readyState!=="loading"?ge():document.addEventListener("DOMContentLoaded",ge));function bt(){for(const[e]of O)"isConnected"in e&&!e.isConnected&&O.delete(e)}function yt(e){requestAnimationFrame(()=>{bt(),O.size===0?e():oe.add(e)})}let N="default",se="",j=new WeakMap;function $e(e){if(le()){if(N==="default"){const t=L(e);se=t.documentElement.style.webkitUserSelect,t.documentElement.style.webkitUserSelect="none"}N="disabled"}else if(e instanceof HTMLElement||e instanceof SVGElement){let t="userSelect"in e.style?"userSelect":"webkitUserSelect";j.set(e,e.style[t]),e.style[t]="none"}}function ee(e){if(le()){if(N!=="disabled")return;N="restoring",setTimeout(()=>{yt(()=>{if(N==="restoring"){const t=L(e);t.documentElement.style.webkitUserSelect==="none"&&(t.documentElement.style.webkitUserSelect=se||""),se="",N="default"}})},300)}else if((e instanceof HTMLElement||e instanceof SVGElement)&&e&&j.has(e)){let t=j.get(e),i="userSelect"in e.style?"userSelect":"webkitUserSelect";e.style[i]==="none"&&(e.style[i]=t),e.getAttribute("style")===""&&e.removeAttribute("style"),j.delete(e)}}function be(e){return e?.defaultView?.__webpack_nonce__||globalThis.__webpack_nonce__||void 0}let te=new WeakMap;function vt(e){let t=e??(typeof document<"u"?document:void 0);if(!t)return be(t);if(te.has(t))return te.get(t);let i=t.querySelector('meta[property="csp-nonce"]'),o=i&&i instanceof D(i).HTMLMetaElement&&(i.nonce||i.content)||be(t)||void 0;return o!==void 0&&te.set(t,o),o}function ye(e){return e.pointerType===""&&e.isTrusted?!0:Ie()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function mt(e){return!Ie()&&e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"}function H(e,t,i=!0){let{metaKey:o,ctrlKey:s,altKey:l,shiftKey:u}=t;$t()&&window.event?.type?.startsWith("key")&&e.target==="_blank"&&(F()?o=!0:s=!0);let f=pt()&&F()&&!Ke()&&process.env.NODE_ENV!=="test"?new KeyboardEvent("keydown",{keyIdentifier:"Enter",metaKey:o,ctrlKey:s,altKey:l,shiftKey:u}):new MouseEvent("click",{metaKey:o,ctrlKey:s,altKey:l,shiftKey:u,detail:1,bubbles:!0,cancelable:!0});H.isOpening=i,B(e),e.dispatchEvent(f),H.isOpening=!1}H.isOpening=!1;const Ae=_.createContext({register:()=>{}});Ae.displayName="PressResponderContext";const Tt=_.useInsertionEffect??Le;function re(e){const t=R(null);return Tt(()=>{t.current=e},[e]),h((...i)=>{const o=t.current;return o?.(...i)},[])}function Et(){let e=R(new Map),t=h((s,l,u,f)=>{let m=f?.once?(...E)=>{e.current.delete(u),u(...E)}:u;e.current.set(u,{type:l,eventTarget:s,fn:m,options:f}),s.addEventListener(l,m,f)},[]),i=h((s,l,u,f)=>{let m=e.current.get(u)?.fn||u;s.removeEventListener(l,m,f),e.current.delete(u)},[]),o=h(()=>{e.current.forEach((s,l)=>{i(s.eventTarget,s.type,l,s.options)})},[i]);return W(()=>o,[o]),{addGlobalListener:t,removeGlobalListener:i,removeAllGlobalListeners:o}}function ht(e,t){Le(()=>{if(e&&e.ref&&t)return e.ref.current=t.current,()=>{e.ref&&(e.ref.current=null)}})}function Pt(e){let t=He(Ae);if(t){let{register:i,ref:o,...s}=t;e=Me(s,e),i()}return ht(t,e.ref),e}class X{#e;constructor(t,i,o,s){this.#e=!0;const u=(s?.target??o.currentTarget)?.getBoundingClientRect();let f,m=0,E,y=null;o.clientX!=null&&o.clientY!=null&&(E=o.clientX,y=o.clientY),u&&(E!=null&&y!=null?(f=E-u.left,m=y-u.top):(f=u.width/2,m=u.height/2)),this.type=t,this.pointerType=i,this.target=o.currentTarget,this.shiftKey=o.shiftKey,this.metaKey=o.metaKey,this.ctrlKey=o.ctrlKey,this.altKey=o.altKey,this.x=f,this.y=m,this.key=o.key}continuePropagation(){this.#e=!1}get shouldStopPropagation(){return this.#e}}const ve=Symbol("linkClicked"),me="react-aria-pressable-style",Te="data-react-aria-pressable";function wt(e){let{onPress:t,onPressChange:i,onPressStart:o,onPressEnd:s,onPressUp:l,onClick:u,isDisabled:f,isPressed:m,preventFocusOnPress:E,shouldCancelOnPointerExit:y,allowTextSelectionOnPress:T,ref:V,...K}=Pt(e),[De,ce]=we(!1),I=R({isPressed:!1,ignoreEmulatedMouseEvents:!1,didFirePressStart:!1,isTriggeringEvent:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null,disposables:[]}),{addGlobalListener:M,removeAllGlobalListeners:U}=Et(),P=h((r,c)=>{let v=I.current;if(f||v.didFirePressStart)return!1;let a=!0;if(v.isTriggeringEvent=!0,o){let $=new X("pressstart",c,r);o($),a=$.shouldStopPropagation}return i&&i(!0),v.isTriggeringEvent=!1,v.didFirePressStart=!0,ce(!0),a},[f,o,i]),q=h((r,c,v=!0)=>{let a=I.current;if(!a.didFirePressStart)return!1;a.didFirePressStart=!1,a.isTriggeringEvent=!0;let $=!0;if(s){let n=new X("pressend",c,r);s(n),$=n.shouldStopPropagation}if(i&&i(!1),ce(!1),t&&v&&!f){let n=new X("press",c,r);t(n),$&&=n.shouldStopPropagation}return a.isTriggeringEvent=!1,$},[f,s,i,t]),x=re(q),Ve=h((r,c)=>{let v=I.current;if(f)return!1;if(l){v.isTriggeringEvent=!0;let a=new X("pressup",c,r);return l(a),v.isTriggeringEvent=!1,a.shouldStopPropagation}return!0},[f,l]),A=re(Ve),J=h(r=>{let c=I.current;if(c.isPressed&&c.target){c.didFirePressStart&&c.pointerType!=null&&q(C(c.target,r),c.pointerType,!1),c.isPressed=!1,c.isOverTarget=!1,c.activePointerId=null,c.pointerType=null,U(),T||ee(c.target);for(let v of c.disposables)v();c.disposables=[]}},[T,U,q]),w=re(J),Y=h(r=>{y&&J(r)},[y,J]),Q=h(r=>{f||u?.(r)},[f,u]),Z=h((r,c)=>{if(!f&&u){let v=new MouseEvent("click",r);ft(v,c),u(ct(v))}},[f,u]),Ue=Fe(()=>{let r=I.current,c={onKeyDown(a){if(ne(a.nativeEvent,a.currentTarget)&&b(a.currentTarget,p(a))){Pe(p(a),a.key)&&a.preventDefault();let $=!0;!r.isPressed&&!a.repeat&&(r.target=a.currentTarget,r.isPressed=!0,r.pointerType="keyboard",$=P(a,"keyboard"));let n=a.currentTarget,d=g=>{ne(g,n)&&!g.repeat&&b(n,p(g))&&r.target&&A(C(r.target,g),"keyboard")};M(L(a.currentTarget),"keyup",ke(d,v),!0),$&&a.stopPropagation(),a.metaKey&&F()&&r.metaKeyEvents?.set(a.key,a.nativeEvent)}else a.key==="Meta"&&(r.metaKeyEvents=new Map)},onClick(a){if(!(a&&!b(a.currentTarget,p(a)))&&a&&a.button===0&&!r.isTriggeringEvent&&!H.isOpening){let $=!0;if(f&&a.preventDefault(),!r.ignoreEmulatedMouseEvents&&!r.isPressed&&(r.pointerType==="virtual"||ye(a.nativeEvent))){let n=P(a,"virtual"),d=A(a,"virtual"),g=x(a,"virtual");Q(a),$=n&&d&&g}else if(r.isPressed&&r.pointerType!=="keyboard"){let n=r.pointerType||a.nativeEvent.pointerType||"virtual",d=A(C(a.currentTarget,a),n),g=x(C(a.currentTarget,a),n,!0);$=d&&g,r.isOverTarget=!1,Q(a),w(a)}r.ignoreEmulatedMouseEvents=!1,$&&a.stopPropagation()}}},v=a=>{if(r.isPressed&&r.target&&ne(a,r.target)){Pe(p(a),a.key)&&a.preventDefault();let $=p(a),n=b(r.target,$);x(C(r.target,a),"keyboard",n),n&&Z(a,r.target),U(),a.key!=="Enter"&&ue(r.target)&&b(r.target,$)&&!a[ve]&&(a[ve]=!0,H(r.target,a,!1)),r.isPressed=!1,r.metaKeyEvents?.delete(a.key)}else if(a.key==="Meta"&&r.metaKeyEvents?.size){let $=r.metaKeyEvents;r.metaKeyEvents=void 0;for(let n of $.values())r.target?.dispatchEvent(new KeyboardEvent("keyup",n))}};if(typeof PointerEvent<"u"){c.onPointerDown=n=>{if(n.button!==0||!b(n.currentTarget,p(n)))return;if(mt(n.nativeEvent)){r.pointerType="virtual";return}r.pointerType=n.pointerType;let d=!0;if(!r.isPressed){r.isPressed=!0,r.isOverTarget=!0,r.activePointerId=n.pointerId,r.target=n.currentTarget,T||$e(r.target),d=P(n,r.pointerType);let g=p(n);"releasePointerCapture"in g&&("hasPointerCapture"in g?g.hasPointerCapture(n.pointerId)&&g.releasePointerCapture(n.pointerId):g.releasePointerCapture(n.pointerId)),M(L(n.currentTarget),"pointerup",a,!1),M(L(n.currentTarget),"pointercancel",$,!1)}d&&n.stopPropagation()},c.onMouseDown=n=>{if(b(n.currentTarget,p(n))&&n.button===0){if(E){let d=pe(n.target);d&&r.disposables.push(d)}n.stopPropagation()}},c.onPointerUp=n=>{!b(n.currentTarget,p(n))||r.pointerType==="virtual"||n.button===0&&!r.isPressed&&A(n,r.pointerType||n.pointerType)},c.onPointerEnter=n=>{n.pointerId===r.activePointerId&&r.target&&!r.isOverTarget&&r.pointerType!=null&&(r.isOverTarget=!0,P(C(r.target,n),r.pointerType))},c.onPointerLeave=n=>{n.pointerId===r.activePointerId&&r.target&&r.isOverTarget&&r.pointerType!=null&&(r.isOverTarget=!1,x(C(r.target,n),r.pointerType,!1),Y(n))};let a=n=>{if(n.pointerId===r.activePointerId&&r.isPressed&&n.button===0&&r.target){if(b(r.target,p(n))&&r.pointerType!=null){let d=!1,g=setTimeout(()=>{r.isPressed&&r.target instanceof HTMLElement&&(d?w(n):(B(r.target),r.target.click()))},80);M(n.currentTarget,"click",()=>d=!0,!0),r.disposables.push(()=>clearTimeout(g))}else w(n);r.isOverTarget=!1}},$=n=>{w(n)};c.onDragStart=n=>{b(n.currentTarget,p(n))&&w(n)}}else if(process.env.NODE_ENV==="test"){c.onMouseDown=n=>{if(n.button!==0||!b(n.currentTarget,p(n)))return;if(r.ignoreEmulatedMouseEvents){n.stopPropagation();return}if(r.isPressed=!0,r.isOverTarget=!0,r.target=n.currentTarget,r.pointerType=ye(n.nativeEvent)?"virtual":"mouse",Xe(()=>P(n,r.pointerType))&&n.stopPropagation(),E){let g=pe(n.target);g&&r.disposables.push(g)}M(L(n.currentTarget),"mouseup",a,!1)},c.onMouseEnter=n=>{if(!b(n.currentTarget,p(n)))return;let d=!0;r.isPressed&&!r.ignoreEmulatedMouseEvents&&r.pointerType!=null&&(r.isOverTarget=!0,d=P(n,r.pointerType)),d&&n.stopPropagation()},c.onMouseLeave=n=>{if(!b(n.currentTarget,p(n)))return;let d=!0;r.isPressed&&!r.ignoreEmulatedMouseEvents&&r.pointerType!=null&&(r.isOverTarget=!1,d=x(n,r.pointerType,!1),Y(n)),d&&n.stopPropagation()},c.onMouseUp=n=>{b(n.currentTarget,p(n))&&!r.ignoreEmulatedMouseEvents&&n.button===0&&!r.isPressed&&A(n,r.pointerType||"mouse")};let a=n=>{if(n.button===0){if(r.ignoreEmulatedMouseEvents){r.ignoreEmulatedMouseEvents=!1;return}r.target&&b(r.target,p(n))&&r.pointerType!=null||w(n),r.isOverTarget=!1}};c.onTouchStart=n=>{if(!b(n.currentTarget,p(n)))return;let d=St(n.nativeEvent);if(!d)return;r.activePointerId=d.identifier,r.ignoreEmulatedMouseEvents=!0,r.isOverTarget=!0,r.isPressed=!0,r.target=n.currentTarget,r.pointerType="touch",T||$e(r.target),P(k(r.target,n),r.pointerType)&&n.stopPropagation(),M(D(n.currentTarget),"scroll",$,!0)},c.onTouchMove=n=>{if(!b(n.currentTarget,p(n)))return;if(!r.isPressed){n.stopPropagation();return}let d=Ee(n.nativeEvent,r.activePointerId),g=!0;d&&he(d,n.currentTarget)?!r.isOverTarget&&r.pointerType!=null&&(r.isOverTarget=!0,g=P(k(r.target,n),r.pointerType)):r.isOverTarget&&r.pointerType!=null&&(r.isOverTarget=!1,g=x(k(r.target,n),r.pointerType,!1),Y(k(r.target,n))),g&&n.stopPropagation()},c.onTouchEnd=n=>{if(!b(n.currentTarget,p(n)))return;if(!r.isPressed){n.stopPropagation();return}let d=Ee(n.nativeEvent,r.activePointerId),g=!0;d&&he(d,n.currentTarget)&&r.pointerType!=null?(A(k(r.target,n),r.pointerType),g=x(k(r.target,n),r.pointerType),Z(n.nativeEvent,r.target)):r.isOverTarget&&r.pointerType!=null&&(g=x(k(r.target,n),r.pointerType,!1)),g&&n.stopPropagation(),r.isPressed=!1,r.activePointerId=null,r.isOverTarget=!1,r.ignoreEmulatedMouseEvents=!0,r.target&&!T&&ee(r.target),U()},c.onTouchCancel=n=>{b(n.currentTarget,p(n))&&(n.stopPropagation(),r.isPressed&&w(k(r.target,n)))};let $=n=>{r.isPressed&&b(p(n),r.target)&&w({currentTarget:r.target,shiftKey:!1,ctrlKey:!1,metaKey:!1,altKey:!1})};c.onDragStart=n=>{b(n.currentTarget,p(n))&&w(n)}}return c},[M,f,E,U,T,Y,P,Q,Z]);return W(()=>{if(!V||process.env.NODE_ENV==="test")return;const r=L(V.current);if(!r||!r.head||r.getElementById(me))return;const c=r.createElement("style");c.id=me;let v=vt(r);v&&(c.nonce=v),c.textContent=`
|
|
1
|
+
"use client";import{jsx as le}from"react/jsx-runtime";import{Provider as De}from"react-aria-components";import{$ as Ne}from"../../assets/useControlledState-Cmn8tE-_.js";import Ue,{useRef as he,useCallback as h,useEffect as ee,useState as _e,useMemo as Ve,useContext as Fe,createContext as Re,useId as He}from"react";import{d as D,a as p,c as C,b as Ye,e as q,$ as b}from"../../assets/useEffectEvent-gqjrDmw8.js";import{flushSync as Ge}from"react-dom";import{cn as Xe}from"../../utils/cn.js";const je=typeof Element<"u"&&"checkVisibility"in Element.prototype;function We(e){const t=D(e);if(!(e instanceof t.HTMLElement)&&!(e instanceof t.SVGElement))return!1;let{display:o,visibility:i}=e.style,s=o!=="none"&&i!=="hidden"&&i!=="collapse";if(s){const{getComputedStyle:l}=e.ownerDocument.defaultView;let{display:c,visibility:f}=l(e);s=c!=="none"&&f!=="hidden"&&f!=="collapse"}return s}function Be(e,t){return!e.hasAttribute("hidden")&&!e.hasAttribute("data-react-aria-prevent-focus")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function Ee(e,t){return je?e.checkVisibility({visibilityProperty:!0})&&!e.closest("[data-react-aria-prevent-focus]"):e.nodeName!=="#comment"&&We(e)&&Be(e,t)&&(!e.parentElement||Ee(e.parentElement,e))}const Pe=["input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable^="false"])',"permission"],ze=Pe.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";Pe.push('[tabindex]:not([tabindex="-1"]):not([disabled])');function qe(e,t){return e.matches(ze)&&!Je(e)&&(t?.skipVisibilityCheck||Ee(e))}function Je(e){let t=e;for(;t!=null;){if(t instanceof t.ownerDocument.defaultView.HTMLElement&&t.inert)return!0;t=t.parentElement}return!1}function Se(...e){return(...t)=>{for(let o of e)typeof o=="function"&&o(...t)}}let te=new Map;typeof FinalizationRegistry<"u"&&new FinalizationRegistry(e=>{te.delete(e)});function Qe(e,t){if(e===t)return e;let o=te.get(e);if(o)return o.forEach(s=>s.current=t),t;let i=te.get(t);return i?(i.forEach(s=>s.current=e),e):t}function Ze(...e){return e.length===1&&e[0]?e[0]:t=>{let o=!1;const i=e.map(s=>{const l=ue(s,t);return o||=typeof l=="function",l});if(o)return()=>{i.forEach((s,l)=>{typeof s=="function"?s():ue(e[l],null)})}}}function ue(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function we(e){var t,o,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(o=we(e[t]))&&(i&&(i+=" "),i+=o)}else for(o in e)e[o]&&(i&&(i+=" "),i+=o);return i}function et(){for(var e,t,o=0,i="",s=arguments.length;o<s;o++)(e=arguments[o])&&(t=we(e))&&(i&&(i+=" "),i+=t);return i}function xe(...e){let t={...e[0]};for(let o=1;o<e.length;o++){let i=e[o];for(let s in i){let l=t[s],c=i[s];typeof l=="function"&&typeof c=="function"&&s[0]==="o"&&s[1]==="n"&&s.charCodeAt(2)>=65&&s.charCodeAt(2)<=90?t[s]=Se(l,c):(s==="className"||s==="UNSAFE_className")&&typeof l=="string"&&typeof c=="string"?t[s]=et(l,c):s==="id"&&l&&c?t.id=Qe(l,c):s==="ref"&&l&&c?t.ref=Ze(l,c):t[s]=c!==void 0?c:l}}return t}function Y(e){if(tt())e.focus({preventScroll:!0});else{let t=rt(e);e.focus(),nt(t)}}let F=null;function tt(){if(F==null){F=!1;try{document.createElement("div").focus({get preventScroll(){return F=!0,!0}})}catch{}}return F}function rt(e){let t=e.parentNode,o=[],i=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==i;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&o.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return i instanceof HTMLElement&&o.push({element:i,scrollTop:i.scrollTop,scrollLeft:i.scrollLeft}),o}function nt(e){for(let{element:t,scrollTop:o,scrollLeft:i}of e)t.scrollTop=o,t.scrollLeft=i}function it(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function ot(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function ce(e){for(;e&&!qe(e,{skipVisibilityCheck:!0});)e=e.parentElement;let t=D(e),o=t.document.activeElement;if(!o||o===e)return;let i=!1,s=v=>{(p(v)===o||i)&&v.stopImmediatePropagation()},l=v=>{(p(v)===o||i)&&(v.stopImmediatePropagation(),!e&&!i&&(i=!0,Y(o),T()))},c=v=>{(p(v)===e||i)&&v.stopImmediatePropagation()},f=v=>{(p(v)===e||i)&&(v.stopImmediatePropagation(),i||(i=!0,Y(o),T()))};t.addEventListener("blur",s,!0),t.addEventListener("focusout",l,!0),t.addEventListener("focusin",f,!0),t.addEventListener("focus",c,!0);let T=()=>{cancelAnimationFrame(m),t.removeEventListener("blur",s,!0),t.removeEventListener("focusout",l,!0),t.removeEventListener("focusin",f,!0),t.removeEventListener("focus",c,!0),i=!1},m=requestAnimationFrame(T);return T}function G(e){if(typeof window>"u"||window.navigator==null)return!1;let t=window.navigator.userAgentData?.brands;return Array.isArray(t)&&t.some(o=>e.test(o.brand))||e.test(window.navigator.userAgent)}function ie(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.userAgentData?.platform||window.navigator.platform):!1}function S(e){if(process.env.NODE_ENV==="test")return e;let t=null;return()=>(t==null&&(t=e()),t)}const U=S(function(){return ie(/^Mac/i)}),st=S(function(){return ie(/^iPhone/i)}),ke=S(function(){return ie(/^iPad/i)||U()&&navigator.maxTouchPoints>1}),oe=S(function(){return st()||ke()});S(function(){return U()||oe()});const at=S(function(){return G(/AppleWebKit/i)&&!lt()}),lt=S(function(){return G(/Chrome/i)}),Le=S(function(){return G(/Android/i)}),ut=S(function(){return G(/Firefox/i)});let L=new Map,re=new Set;function fe(){if(typeof window>"u")return;function e(i){return"propertyName"in i}let t=i=>{let s=p(i);if(!e(i)||!s)return;let l=L.get(s);l||(l=new Set,L.set(s,l),s.addEventListener("transitioncancel",o,{once:!0})),l.add(i.propertyName)},o=i=>{let s=p(i);if(!e(i)||!s)return;let l=L.get(s);if(l&&(l.delete(i.propertyName),l.size===0&&(s.removeEventListener("transitioncancel",o),L.delete(s)),L.size===0)){for(let c of re)c();re.clear()}};document.body.addEventListener("transitionrun",t),document.body.addEventListener("transitionend",o)}typeof document<"u"&&(document.readyState!=="loading"?fe():document.addEventListener("DOMContentLoaded",fe));function ct(){for(const[e]of L)"isConnected"in e&&!e.isConnected&&L.delete(e)}function ft(e){requestAnimationFrame(()=>{ct(),L.size===0?e():re.add(e)})}let A="default",ne="",H=new WeakMap;function de(e){if(oe()){if(A==="default"){const t=C(e);ne=t.documentElement.style.webkitUserSelect,t.documentElement.style.webkitUserSelect="none"}A="disabled"}else if(e instanceof HTMLElement||e instanceof SVGElement){let t="userSelect"in e.style?"userSelect":"webkitUserSelect";H.set(e,e.style[t]),e.style[t]="none"}}function J(e){if(oe()){if(A!=="disabled")return;A="restoring",setTimeout(()=>{ft(()=>{if(A==="restoring"){const t=C(e);t.documentElement.style.webkitUserSelect==="none"&&(t.documentElement.style.webkitUserSelect=ne||""),ne="",A="default"}})},300)}else if((e instanceof HTMLElement||e instanceof SVGElement)&&e&&H.has(e)){let t=H.get(e),o="userSelect"in e.style?"userSelect":"webkitUserSelect";e.style[o]==="none"&&(e.style[o]=t),e.getAttribute("style")===""&&e.removeAttribute("style"),H.delete(e)}}function pe(e){return e?.defaultView?.__webpack_nonce__||globalThis.__webpack_nonce__||void 0}let Q=new WeakMap;function dt(e){let t=e??(typeof document<"u"?document:void 0);if(!t)return pe(t);if(Q.has(t))return Q.get(t);let o=t.querySelector('meta[property="csp-nonce"]'),i=o&&o instanceof D(o).HTMLMetaElement&&(o.nonce||o.content)||pe(t)||void 0;return i!==void 0&&Q.set(t,i),i}function ge(e){return e.pointerType===""&&e.isTrusted?!0:Le()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function pt(e){return!Le()&&e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"}function _(e,t,o=!0){let{metaKey:i,ctrlKey:s,altKey:l,shiftKey:c}=t;ut()&&window.event?.type?.startsWith("key")&&e.target==="_blank"&&(U()?i=!0:s=!0);let f=at()&&U()&&!ke()&&process.env.NODE_ENV!=="test"?new KeyboardEvent("keydown",{keyIdentifier:"Enter",metaKey:i,ctrlKey:s,altKey:l,shiftKey:c}):new MouseEvent("click",{metaKey:i,ctrlKey:s,altKey:l,shiftKey:c,detail:1,bubbles:!0,cancelable:!0});_.isOpening=o,Y(e),e.dispatchEvent(f),_.isOpening=!1}_.isOpening=!1;const Oe=Ue.createContext({register:()=>{}});Oe.displayName="PressResponderContext";function gt(){let e=he(new Map),t=h((s,l,c,f)=>{let T=f?.once?(...m)=>{e.current.delete(c),c(...m)}:c;e.current.set(c,{type:l,eventTarget:s,fn:T,options:f}),s.addEventListener(l,T,f)},[]),o=h((s,l,c,f)=>{let T=e.current.get(c)?.fn||c;s.removeEventListener(l,T,f),e.current.delete(c)},[]),i=h(()=>{e.current.forEach((s,l)=>{o(s.eventTarget,s.type,l,s.options)})},[o]);return ee(()=>i,[i]),{addGlobalListener:t,removeGlobalListener:o,removeAllGlobalListeners:i}}function $t(e,t){Ye(()=>{if(e&&e.ref&&t)return e.ref.current=t.current,()=>{e.ref&&(e.ref.current=null)}})}function bt(e){let t=Fe(Oe);if(t){let{register:o,ref:i,...s}=t;e=xe(s,e),o()}return $t(t,e.ref),e}class R{#e;constructor(t,o,i,s){this.#e=!0;const c=(s?.target??i.currentTarget)?.getBoundingClientRect();let f,T=0,m,v=null;i.clientX!=null&&i.clientY!=null&&(m=i.clientX,v=i.clientY),c&&(m!=null&&v!=null?(f=m-c.left,T=v-c.top):(f=c.width/2,T=c.height/2)),this.type=t,this.pointerType=o,this.target=i.currentTarget,this.shiftKey=i.shiftKey,this.metaKey=i.metaKey,this.ctrlKey=i.ctrlKey,this.altKey=i.altKey,this.x=f,this.y=T,this.key=i.key}continuePropagation(){this.#e=!1}get shouldStopPropagation(){return this.#e}}const $e=Symbol("linkClicked"),be="react-aria-pressable-style",ye="data-react-aria-pressable";function yt(e){let{onPress:t,onPressChange:o,onPressStart:i,onPressEnd:s,onPressUp:l,onClick:c,isDisabled:f,isPressed:T,preventFocusOnPress:m,shouldCancelOnPointerExit:v,allowTextSelectionOnPress:w,ref:X,...Ce}=bt(e),[Ke,ae]=_e(!1),K=he({isPressed:!1,ignoreEmulatedMouseEvents:!1,didFirePressStart:!1,isTriggeringEvent:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null,disposables:[]}),{addGlobalListener:O,removeAllGlobalListeners:N}=gt(),E=h((r,u)=>{let y=K.current;if(f||y.didFirePressStart)return!1;let a=!0;if(y.isTriggeringEvent=!0,i){let $=new R("pressstart",u,r);i($),a=$.shouldStopPropagation}return o&&o(!0),y.isTriggeringEvent=!1,y.didFirePressStart=!0,ae(!0),a},[f,i,o]),j=h((r,u,y=!0)=>{let a=K.current;if(!a.didFirePressStart)return!1;a.didFirePressStart=!1,a.isTriggeringEvent=!0;let $=!0;if(s){let n=new R("pressend",u,r);s(n),$=n.shouldStopPropagation}if(o&&o(!1),ae(!1),t&&y&&!f){let n=new R("press",u,r);t(n),$&&=n.shouldStopPropagation}return a.isTriggeringEvent=!1,$},[f,s,o,t]),x=q(j),Ie=h((r,u)=>{let y=K.current;if(f)return!1;if(l){y.isTriggeringEvent=!0;let a=new R("pressup",u,r);return l(a),y.isTriggeringEvent=!1,a.shouldStopPropagation}return!0},[f,l]),I=q(Ie),W=h(r=>{let u=K.current;if(u.isPressed&&u.target){u.didFirePressStart&&u.pointerType!=null&&j(M(u.target,r),u.pointerType,!1),u.isPressed=!1,u.isOverTarget=!1,u.activePointerId=null,u.pointerType=null,N(),w||J(u.target);for(let y of u.disposables)y();u.disposables=[]}},[w,N,j]),P=q(W),V=h(r=>{v&&W(r)},[v,W]),B=h(r=>{f||c?.(r)},[f,c]),z=h((r,u)=>{if(!f&&c){let y=new MouseEvent("click",r);ot(y,u),c(it(y))}},[f,c]),Ae=Ve(()=>{let r=K.current,u={onKeyDown(a){if(Z(a.nativeEvent,a.currentTarget)&&b(a.currentTarget,p(a))){me(p(a),a.key)&&a.preventDefault();let $=!0;!r.isPressed&&!a.repeat&&(r.target=a.currentTarget,r.isPressed=!0,r.pointerType="keyboard",$=E(a,"keyboard"));let n=a.currentTarget,d=g=>{Z(g,n)&&!g.repeat&&b(n,p(g))&&r.target&&I(M(r.target,g),"keyboard")};O(C(a.currentTarget),"keyup",Se(d,y),!0),$&&a.stopPropagation(),a.metaKey&&U()&&r.metaKeyEvents?.set(a.key,a.nativeEvent)}else a.key==="Meta"&&(r.metaKeyEvents=new Map)},onClick(a){if(!(a&&!b(a.currentTarget,p(a)))&&a&&a.button===0&&!r.isTriggeringEvent&&!_.isOpening){let $=!0;if(f&&a.preventDefault(),!r.ignoreEmulatedMouseEvents&&!r.isPressed&&(r.pointerType==="virtual"||ge(a.nativeEvent))){let n=E(a,"virtual"),d=I(a,"virtual"),g=x(a,"virtual");B(a),$=n&&d&&g}else if(r.isPressed&&r.pointerType!=="keyboard"){let n=r.pointerType||a.nativeEvent.pointerType||"virtual",d=I(M(a.currentTarget,a),n),g=x(M(a.currentTarget,a),n,!0);$=d&&g,r.isOverTarget=!1,B(a),P(a)}r.ignoreEmulatedMouseEvents=!1,$&&a.stopPropagation()}}},y=a=>{if(r.isPressed&&r.target&&Z(a,r.target)){me(p(a),a.key)&&a.preventDefault();let $=p(a),n=b(r.target,$);x(M(r.target,a),"keyboard",n),n&&z(a,r.target),N(),a.key!=="Enter"&&se(r.target)&&b(r.target,$)&&!a[$e]&&(a[$e]=!0,_(r.target,a,!1)),r.isPressed=!1,r.metaKeyEvents?.delete(a.key)}else if(a.key==="Meta"&&r.metaKeyEvents?.size){let $=r.metaKeyEvents;r.metaKeyEvents=void 0;for(let n of $.values())r.target?.dispatchEvent(new KeyboardEvent("keyup",n))}};if(typeof PointerEvent<"u"){u.onPointerDown=n=>{if(n.button!==0||!b(n.currentTarget,p(n)))return;if(pt(n.nativeEvent)){r.pointerType="virtual";return}r.pointerType=n.pointerType;let d=!0;if(!r.isPressed){r.isPressed=!0,r.isOverTarget=!0,r.activePointerId=n.pointerId,r.target=n.currentTarget,w||de(r.target),d=E(n,r.pointerType);let g=p(n);"releasePointerCapture"in g&&("hasPointerCapture"in g?g.hasPointerCapture(n.pointerId)&&g.releasePointerCapture(n.pointerId):g.releasePointerCapture(n.pointerId)),O(C(n.currentTarget),"pointerup",a,!1),O(C(n.currentTarget),"pointercancel",$,!1)}d&&n.stopPropagation()},u.onMouseDown=n=>{if(b(n.currentTarget,p(n))&&n.button===0){if(m){let d=ce(n.target);d&&r.disposables.push(d)}n.stopPropagation()}},u.onPointerUp=n=>{!b(n.currentTarget,p(n))||r.pointerType==="virtual"||n.button===0&&!r.isPressed&&I(n,r.pointerType||n.pointerType)},u.onPointerEnter=n=>{n.pointerId===r.activePointerId&&r.target&&!r.isOverTarget&&r.pointerType!=null&&(r.isOverTarget=!0,E(M(r.target,n),r.pointerType))},u.onPointerLeave=n=>{n.pointerId===r.activePointerId&&r.target&&r.isOverTarget&&r.pointerType!=null&&(r.isOverTarget=!1,x(M(r.target,n),r.pointerType,!1),V(n))};let a=n=>{if(n.pointerId===r.activePointerId&&r.isPressed&&n.button===0&&r.target){if(b(r.target,p(n))&&r.pointerType!=null){let d=!1,g=setTimeout(()=>{r.isPressed&&r.target instanceof HTMLElement&&(d?P(n):(Y(r.target),r.target.click()))},80);O(n.currentTarget,"click",()=>d=!0,!0),r.disposables.push(()=>clearTimeout(g))}else P(n);r.isOverTarget=!1}},$=n=>{P(n)};u.onDragStart=n=>{b(n.currentTarget,p(n))&&P(n)}}else if(process.env.NODE_ENV==="test"){u.onMouseDown=n=>{if(n.button!==0||!b(n.currentTarget,p(n)))return;if(r.ignoreEmulatedMouseEvents){n.stopPropagation();return}if(r.isPressed=!0,r.isOverTarget=!0,r.target=n.currentTarget,r.pointerType=ge(n.nativeEvent)?"virtual":"mouse",Ge(()=>E(n,r.pointerType))&&n.stopPropagation(),m){let g=ce(n.target);g&&r.disposables.push(g)}O(C(n.currentTarget),"mouseup",a,!1)},u.onMouseEnter=n=>{if(!b(n.currentTarget,p(n)))return;let d=!0;r.isPressed&&!r.ignoreEmulatedMouseEvents&&r.pointerType!=null&&(r.isOverTarget=!0,d=E(n,r.pointerType)),d&&n.stopPropagation()},u.onMouseLeave=n=>{if(!b(n.currentTarget,p(n)))return;let d=!0;r.isPressed&&!r.ignoreEmulatedMouseEvents&&r.pointerType!=null&&(r.isOverTarget=!1,d=x(n,r.pointerType,!1),V(n)),d&&n.stopPropagation()},u.onMouseUp=n=>{b(n.currentTarget,p(n))&&!r.ignoreEmulatedMouseEvents&&n.button===0&&!r.isPressed&&I(n,r.pointerType||"mouse")};let a=n=>{if(n.button===0){if(r.ignoreEmulatedMouseEvents){r.ignoreEmulatedMouseEvents=!1;return}r.target&&b(r.target,p(n))&&r.pointerType!=null||P(n),r.isOverTarget=!1}};u.onTouchStart=n=>{if(!b(n.currentTarget,p(n)))return;let d=vt(n.nativeEvent);if(!d)return;r.activePointerId=d.identifier,r.ignoreEmulatedMouseEvents=!0,r.isOverTarget=!0,r.isPressed=!0,r.target=n.currentTarget,r.pointerType="touch",w||de(r.target),E(k(r.target,n),r.pointerType)&&n.stopPropagation(),O(D(n.currentTarget),"scroll",$,!0)},u.onTouchMove=n=>{if(!b(n.currentTarget,p(n)))return;if(!r.isPressed){n.stopPropagation();return}let d=ve(n.nativeEvent,r.activePointerId),g=!0;d&&Te(d,n.currentTarget)?!r.isOverTarget&&r.pointerType!=null&&(r.isOverTarget=!0,g=E(k(r.target,n),r.pointerType)):r.isOverTarget&&r.pointerType!=null&&(r.isOverTarget=!1,g=x(k(r.target,n),r.pointerType,!1),V(k(r.target,n))),g&&n.stopPropagation()},u.onTouchEnd=n=>{if(!b(n.currentTarget,p(n)))return;if(!r.isPressed){n.stopPropagation();return}let d=ve(n.nativeEvent,r.activePointerId),g=!0;d&&Te(d,n.currentTarget)&&r.pointerType!=null?(I(k(r.target,n),r.pointerType),g=x(k(r.target,n),r.pointerType),z(n.nativeEvent,r.target)):r.isOverTarget&&r.pointerType!=null&&(g=x(k(r.target,n),r.pointerType,!1)),g&&n.stopPropagation(),r.isPressed=!1,r.activePointerId=null,r.isOverTarget=!1,r.ignoreEmulatedMouseEvents=!0,r.target&&!w&&J(r.target),N()},u.onTouchCancel=n=>{b(n.currentTarget,p(n))&&(n.stopPropagation(),r.isPressed&&P(k(r.target,n)))};let $=n=>{r.isPressed&&b(p(n),r.target)&&P({currentTarget:r.target,shiftKey:!1,ctrlKey:!1,metaKey:!1,altKey:!1})};u.onDragStart=n=>{b(n.currentTarget,p(n))&&P(n)}}return u},[O,f,m,N,w,V,E,B,z]);return ee(()=>{if(!X||process.env.NODE_ENV==="test")return;const r=C(X.current);if(!r||!r.head||r.getElementById(be))return;const u=r.createElement("style");u.id=be;let y=dt(r);y&&(u.nonce=y),u.textContent=`
|
|
2
2
|
@layer {
|
|
3
|
-
[${
|
|
3
|
+
[${ye}] {
|
|
4
4
|
touch-action: pan-x pan-y pinch-zoom;
|
|
5
5
|
}
|
|
6
6
|
}
|
|
7
|
-
`.trim(),r.head.prepend(
|
|
7
|
+
`.trim(),r.head.prepend(u)},[X]),ee(()=>{let r=K.current;return()=>{w||J(r.target??void 0);for(let u of r.disposables)u();r.disposables=[]}},[w]),{isPressed:T||Ke,pressProps:xe(Ce,Ae,{[ye]:!0})}}function se(e){return e.tagName==="A"&&e.hasAttribute("href")}function Z(e,t){const{key:o,code:i}=e,s=t,l=s.getAttribute("role");return(o==="Enter"||o===" "||o==="Spacebar"||i==="Space")&&!(s instanceof D(s).HTMLInputElement&&!Me(s,o)||s instanceof D(s).HTMLTextAreaElement||s.isContentEditable)&&!((l==="link"||!l&&se(s))&&o!=="Enter")}function vt(e){const{targetTouches:t}=e;return t.length>0?t[0]:null}function ve(e,t){const o=e.changedTouches;for(let i=0;i<o.length;i++){const s=o[i];if(s.identifier===t)return s}return null}function k(e,t){let o=0,i=0;return t.targetTouches&&t.targetTouches.length===1&&(o=t.targetTouches[0].clientX,i=t.targetTouches[0].clientY),{currentTarget:e,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,altKey:t.altKey,clientX:o,clientY:i}}function M(e,t){let o=t.clientX,i=t.clientY;return{currentTarget:e,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,altKey:t.altKey,clientX:o,clientY:i,key:t.key}}function Tt(e){let t=0,o=0;return e.width!==void 0?t=e.width/2:e.radiusX!==void 0&&(t=e.radiusX),e.height!==void 0?o=e.height/2:e.radiusY!==void 0&&(o=e.radiusY),{top:e.clientY-o,right:e.clientX+t,bottom:e.clientY+o,left:e.clientX-t}}function mt(e,t){return!(e.left>t.right||t.left>e.right||e.top>t.bottom||t.top>e.bottom)}function Te(e,t){let o=t.getBoundingClientRect(),i=Tt(e);return mt(o,i)}function ht(e){return e instanceof HTMLInputElement?!1:e instanceof HTMLButtonElement?e.type!=="submit"&&e.type!=="reset":!se(e)}function me(e,t){return e instanceof HTMLInputElement?!Me(e,t):ht(e)}const Et=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Me(e,t){return e.type==="checkbox"||e.type==="radio"?t===" ":Et.has(e.type)}const Pt=Re({});function Ct({children:e,className:t,...o}){const i=He(),[s,l]=Ne(o.isOpen,o.defaultOpen||!1,o.onOpenChange),c=h(()=>{l(!s)},[l,s]),{pressProps:f}=yt({onPress:c});return le(De,{values:[[Pt,{isOpen:s,id:i,defaultOpen:o.defaultOpen||!1}]],children:le("div",{...f,role:"button",tabIndex:0,"aria-expanded":s,"aria-controls":i,className:Xe("w-full",t),children:e})})}export{Ct as CollapsibleTrigger,Pt as CollapsibleTriggerStateContext,Ct as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Collapsible as
|
|
1
|
+
import{Collapsible as C}from"./Collapsible.js";import{CollapsibleTrigger as s,CollapsibleTriggerStateContext as x}from"./CollapsibleTrigger.js";import"react/jsx-runtime";import"react";import"framer-motion";import"../../utils/cn.js";import"react-aria-components";import"../../assets/useControlledState-Cmn8tE-_.js";import"../../assets/useEffectEvent-gqjrDmw8.js";import"react-dom";export{C as Collapsible,s as CollapsibleTrigger,x as CollapsibleTriggerStateContext};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsxs as
|
|
1
|
+
"use client";import{jsxs as i,jsx as l}from"react/jsx-runtime";import{Option as p}from"../../Select/Option.js";import{Select as x}from"../../Select/Select.js";import{Button as h}from"../../Button/Button.js";import"framer-motion";import{FilterIcon as d}from"../../Icon/FilterIcon.js";import"react";import"../../Select/ButtonSelect.js";import"react-aria";import"../../../assets/useEffectEvent-gqjrDmw8.js";import"../../../assets/useOverlayTriggerState-CooW9h9l.js";import"../../../assets/useControlledState-Cmn8tE-_.js";import"../../../utils/cn.js";import"../../Select/parts.js";import"../../Select/ComboBoxSelect.js";import"../../Loader/Pulse.js";import"react-aria-components";function K({totalItems:o,startItem:s,endItem:r,setShowMobileFilters:a,availableSortOrders:m,appliedSortOrder:e,onSortChange:n}){const c=[...e?[e]:[],...m];return i("div",{className:"flex flex-col gap-y-5 mb-3",children:[i("div",{className:"flex items-center justify-between lg:justify-end gap-x-2",children:[i(h,{className:"lg:hidden grow-0 shrink-0 basis-auto gap-x-3 px-4",size:"sm",variant:"outline",onPress:()=>a(!0),"aria-details":"show filters",children:[l(d,{className:"w-3 h-3"}),"Filters"]}),l(x,{className:"w-44",selectedKey:e?`${e.code}_${e.direction}`:null,onSelectionChange:n,placeholder:"Sort by",label:"Sort By:",classNames:{input:"text-xs w-44 h-8 min-h-0",value:"text-xs",label:"hidden lg:block text-xs text-gray-600 whitespace-nowrap"},children:c.map(t=>l(p,{textValue:t.label,children:t.label},`${t.code}_${t.direction}`))})]}),o>0&&i("p",{className:"text-sm text-slate-500",children:["Displaying ",s," - ",r," of ",o," items"]})]})}export{K as CollectionToolbar};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{CollectionToolbar as
|
|
1
|
+
import{CollectionToolbar as j}from"./CollectionToolbar.js";import"react/jsx-runtime";import"../../Select/Option.js";import"react";import"../../Select/Select.js";import"../../Select/ButtonSelect.js";import"react-aria";import"../../../assets/useEffectEvent-gqjrDmw8.js";import"../../../assets/useOverlayTriggerState-CooW9h9l.js";import"../../../assets/useControlledState-Cmn8tE-_.js";import"../../../utils/cn.js";import"../../Select/parts.js";import"../../Select/ComboBoxSelect.js";import"framer-motion";import"../../Loader/Pulse.js";import"../../Button/Button.js";import"react-aria-components";import"../../Icon/FilterIcon.js";export{j as CollectionToolbar};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{AttributeDataProvider as
|
|
1
|
+
import{AttributeDataProvider as V,useAttributeData as W}from"./AttributeDataProvider/AttributeDataProvider.js";import{EmptyResults as Y}from"./EmptyResults/EmptyResults.js";import{ProductPrice as _}from"./ProductPrice/ProductPrice.js";import{FilterRenderer as rr}from"./FilterRenderer/FilterRenderer.js";import{CollectionFilterChips as tr}from"./CollectionFilterChips/CollectionFilterChips.js";import{FilterAccordionTitle as pr}from"./FilterAccordionTitle/FilterAccordionTitle.js";import{ProductCardSwatches as er}from"./ProductCardSwatches/ProductCardSwatches.js";import{CollectionFilters as cr}from"./CollectionFilters/CollectionFilters.js";import{CollectionToolbar as xr}from"./CollectionToolbar/CollectionToolbar.js";import"react/jsx-runtime";import"react";import"../../utils/env.js";import"../../utils/swatch.js";import"./FilterRenderer/Renderer/Option.js";import"../Checkbox/Checkbox.js";import"react-aria-components";import"../../utils/cn.js";import"./FilterRenderer/Renderer/useOptionFilterToggle.js";import"./FilterRenderer/Renderer/Swatch.js";import"./FilterRenderer/Renderer/Swatch/SwatchColor.js";import"../Icon/CheckIcon.js";import"../../utils/color.js";import"./FilterRenderer/Renderer/Swatch/SwatchImage.js";import"./FilterRenderer/Renderer/Swatch/SwatchText.js";import"./FilterRenderer/Renderer/Boolean.js";import"../RadioGroup/RadioGroup.js";import"../Radio/Radio.js";import"./FilterRenderer/Renderer/Range.js";import"../Button/Button.js";import"framer-motion";import"../Icon/CrossSmall.js";import"../../utils/collection/getAppliedFilterChips.js";import"../../utils/collection/removeFilterChip.js";import"../Accordion/Accordion.js";import"@nextui-org/accordion";import"../Icon/DownArrow.js";import"../ModalOverlay/ModalOverlay.js";import"../DialogTrigger/DialogTrigger.js";import"../Modal/Modal.js";import"../Drawer/Drawer.js";import"../Icon/Cross.js";import"../Icon/Search.js";import"../../utils/collection/mergeFilters.js";import"../Select/Option.js";import"../Select/Select.js";import"../Select/ButtonSelect.js";import"react-aria";import"../../assets/useEffectEvent-gqjrDmw8.js";import"../../assets/useOverlayTriggerState-CooW9h9l.js";import"../../assets/useControlledState-Cmn8tE-_.js";import"../Select/parts.js";import"../Select/ComboBoxSelect.js";import"../Loader/Pulse.js";import"../Icon/FilterIcon.js";export{V as AttributeDataProvider,tr as CollectionFilterChips,cr as CollectionFilters,xr as CollectionToolbar,Y as EmptyResults,pr as FilterAccordionTitle,rr as FilterRenderer,er as ProductCardSwatches,_ as ProductPrice,W as useAttributeData};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsxs as y,jsx as m}from"react/jsx-runtime";import{useState as
|
|
1
|
+
"use client";import{jsxs as y,jsx as m}from"react/jsx-runtime";import{useState as E,useRef as L,useEffect as $,useCallback as g}from"react";import{Group as P,Label as R}from"react-aria-components";import{cn as f}from"../../utils/cn.js";function Z({autoFocus:A=!1,description:k,errorMessage:b,isDisabled:j=!1,isInvalid:w=!1,isMasked:I=!1,isRequired:N=!0,label:V,length:n=6,name:T,onChange:c,value:_="",type:h="numeric",validationBehavior:S,className:z,classNames:p,...B}){const[r,D]=E(()=>Array(n).fill("")),l=L([]);$(()=>{l.current=l.current.slice(0,n)},[n]),$(()=>{A&&l.current[0]?.focus()},[A]);const J=g(t=>{const e=t.target.value,u=Number(t.target.getAttribute("data-pin-input-index"));e!==""&&u<n-1&&l.current?.[u+1]?.focus();const o=r.map((s,d)=>d===u?e:s);D(o);const a=o.join("");c?.(a)},[r,n,c]),K=g(t=>{const e=Number(t.currentTarget.getAttribute("data-pin-input-index"));if(t.ctrlKey||t.metaKey)return;const u=["Backspace","Delete","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Control","Alt","Meta","Shift","Tab","Enter","Escape"],o={alpha:/^[a-z]$/i,alphanumeric:/^[a-z0-9]$/i,numeric:/^[0-9]$/i};if(!t.key.match(o[h])&&!u.includes(t.key)&&t.preventDefault(),r[e]===""&&e>0&&t.key==="Backspace"){const a=r.map((d,x)=>x===e-1?"":d);D(a),l.current?.[e-1]?.focus(),t.preventDefault();const s=a.join("");c?.(s)}if(r[e]===""&&e<r.length-1&&t.key==="Delete"){const a=r.map((d,x)=>x===e+1?"":d);D(a),l.current?.[e+1]?.focus(),t.preventDefault();const s=a.join("");c?.(s)}},[r,h,c]),v=g(t=>{const e=Number(t.currentTarget.getAttribute("data-pin-input-index"));t.preventDefault();const u=t.clipboardData?.getData("text");if(!u)return;const o=u.split("").filter(i=>{switch(h){case"alpha":return/^[a-zA-Z]$/.test(i);case"alphanumeric":return/^[a-z0-9]$/i.test(i);default:return/^[0-9]$/.test(i)}});if(o.length===0)return;const a=[...r];let s=e;for(let i=0;i<o.length&&e+i<n;i++)a[e+i]=o[i],s=e+i;D(a);const d=a.join("");c?.(d);const x=s+1<n?s+1:n-1;l.current[x]?.focus()},[r,h,n,c]);return y(P,{className:f("flex flex-wrap gap-2",z),"aria-label":V,...B,children:[V&&m(R,{className:f("flex text-slate-500 text-sm grow shrink-0 basis-full",p?.label),children:V}),r.map((t,e)=>m("div",{className:f("flex flex-col w-full flex-1 text-slate-900",p?.inputWrap),children:m("input",{className:f("border-solid border border-slate-300 rounded-md","text-sm text-slate-900 placeholder-slate-400 text-center","h-10 px-2 py-0 m-0 w-full","bg-white","[&::-ms-reveal]:hidden [&::-ms-clear]:hidden","transition-all duration-200 ease-in-out","hover:border-slate-400","focus:outline-2 focus:outline focus:outline-slate-200 focus:border-slate-400","disabled:border-slate-200 disabled:bg-slate-100",w&&"border-red-500 bg-red-100 text-red-600",w&&"hover:border-red-600 focus:border-red-600 focus:outline-red-200",p?.input),onChange:J,onKeyDown:K,onPaste:v,type:I?"password":"text",autoComplete:"one-time-code",ref:u=>{l.current[e]=u},value:t,maxLength:1,"data-pin-input-index":e,disabled:j,required:N,"aria-label":`Pin Input Digit ${e+1}`})},`pin-input-${e}`)),(k||w&&b)&&y("div",{className:f("flex flex-row flex-wrap grow shrink-0 basis-full",p?.textWrap),children:[k&&m("p",{className:f("flex text-slate-500 text-sm grow shrink-0 basis-full",p?.description),children:k}),w&&b&&typeof b=="string"&&m("p",{className:f("flex text-red-500 text-sm grow shrink-0 basis-full",p?.error),children:b})]})]})}export{Z as PinInput,Z as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsxs as K,jsx as g}from"react/jsx-runtime";import{useState as V,useMemo as w,useRef as $,useEffect as H}from"react";import{useSelect as T,useButton as U,HiddenSelect as G}from"react-aria";import{e as O,c as J,a as Q,$ as W}from"../../assets/useEffectEvent-gqjrDmw8.js";import{b as X,$ as Y,d as Z}from"../../assets/useOverlayTriggerState-CooW9h9l.js";import{$ as ee}from"../../assets/useControlledState-Cmn8tE-_.js";import{cn as f}from"../../utils/cn.js";import{ChevronIcon as te,SelectPopover as le,SelectListBox as ne}from"./parts.js";function se(e){let{selectionMode:t="single",shouldCloseOnSelect:a=t==="single"}=e,i=X(e),[x,v]=V(null),u=w(()=>e.defaultValue!==void 0?e.defaultValue:t==="single"?e.defaultSelectedKey??null:[],[e.defaultValue,e.defaultSelectedKey,t]),y=w(()=>e.value!==void 0?e.value:t==="single"?e.selectedKey:void 0,[e.value,e.selectedKey,t]),[s,o]=ee(y,u,e.onChange),l=t==="single"&&Array.isArray(s)?s[0]:s,c=n=>{if(t==="single"){let d=Array.isArray(n)?n[0]??null:n;o(d),d!==l&&e.onSelectionChange?.(d)}else{let d=[];Array.isArray(n)?d=n:n!=null&&(d=[n]),o(d)}},r=Y({...e,selectionMode:t,disallowEmptySelection:t==="single",allowDuplicateSelectionEvents:!0,selectedKeys:w(()=>re(l),[l]),onSelectionChange:n=>{if(n!=="all"){if(t==="single"){let d=n.values().next().value??null;c(d)}else c([...n]);a&&i.close(),E.commitValidation()}}}),m=r.selectionManager.firstSelectedKey,h=w(()=>[...r.selectionManager.selectedKeys].map(n=>r.collection.getItem(n)).filter(n=>n!=null),[r.selectionManager.selectedKeys,r.collection]),E=Z({...e,value:Array.isArray(l)&&l.length===0?null:l}),[I,D]=V(!1),[p]=V(l);return{...E,...r,...i,value:l,defaultValue:u??p,setValue:c,selectedKey:m,setSelectedKey:c,selectedItem:h[0]??null,selectedItems:h,defaultSelectedKey:e.defaultSelectedKey??(e.selectionMode==="single"?p:null),focusStrategy:x,open(n=null){(r.collection.size!==0||e.allowsEmptyCollection)&&(v(n),i.open())},toggle(n=null){(r.collection.size!==0||e.allowsEmptyCollection)&&(v(n),i.toggle())},isFocused:I,setFocused:D}}function re(e){if(e!==void 0)return e===null?[]:Array.isArray(e)?e:[e]}function oe(e){let{ref:t,onInteractOutside:a,isDisabled:i,onInteractOutsideStart:x}=e,v=$({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}),u=O(s=>{a&&P(s,t)&&(x&&x(s),v.current.isPointerDown=!0)}),y=O(s=>{a&&a(s)});H(()=>{let s=v.current;if(i)return;const o=t.current,l=J(o);if(typeof PointerEvent<"u"){let c=r=>{s.isPointerDown&&P(r,t)&&y(r),s.isPointerDown=!1};return l.addEventListener("pointerdown",u,!0),l.addEventListener("click",c,!0),()=>{l.removeEventListener("pointerdown",u,!0),l.removeEventListener("click",c,!0)}}else if(process.env.NODE_ENV==="test"){let c=m=>{s.ignoreEmulatedMouseEvents?s.ignoreEmulatedMouseEvents=!1:s.isPointerDown&&P(m,t)&&y(m),s.isPointerDown=!1},r=m=>{s.ignoreEmulatedMouseEvents=!0,s.isPointerDown&&P(m,t)&&y(m),s.isPointerDown=!1};return l.addEventListener("mousedown",u,!0),l.addEventListener("mouseup",c,!0),l.addEventListener("touchstart",u,!0),l.addEventListener("touchend",r,!0),()=>{l.removeEventListener("mousedown",u,!0),l.removeEventListener("mouseup",c,!0),l.removeEventListener("touchstart",u,!0),l.removeEventListener("touchend",r,!0)}}},[t,i])}function P(e,t){if(e.button>0)return!1;let a=Q(e);if(a){const i=a.ownerDocument;if(!i||!W(i.documentElement,a)||a.closest("[data-react-aria-top-layer]"))return!1}return t.current?!e.composedPath().includes(t.current):!1}function ge(e){const{label:t,description:a,errorMessage:i,children:x,placeholder:v,slots:u,popoverOffset:y,className:s,classNames:o,isLoading:l,name:c,selectedKey:r,defaultSelectedKey:m,onSelectionChange:h,isRequired:E,items:I,autoFocus:D,isInvalid:p,"aria-label":n,"aria-labelledby":d}=e,L=!!(e.isDisabled||l),N={label:t,children:x,items:I,name:c,selectedKey:r,defaultSelectedKey:m,onSelectionChange:h,isDisabled:L,isRequired:E,autoFocus:D,isInvalid:p,"aria-label":n,"aria-labelledby":d},b=se(N),C=$(null),S=$(null),A=$(null),B=$(null),{labelProps:R,triggerProps:F,valueProps:k,menuProps:j,descriptionProps:_,errorMessageProps:z,isInvalid:M}=T(N,b,S),{buttonProps:q}=U(F,S);return oe({ref:C,onInteractOutside:()=>b.close()}),K("div",{ref:C,className:f("flex flex-col","w-full",s),children:[g("label",{...R,className:f("flex","text-xs text-slate-500",o?.label),children:t}),g(G,{state:b,triggerRef:S,label:t,name:c,isDisabled:L}),K("div",{className:f("flex","relative","w-full",o?.comboBoxContainer),children:[K("button",{...q,ref:S,className:f("flex items-center justify-between gap-2","border border-solid border-slate-300","text-sm text-slate-900 text-left","py-0 px-3","h-10 w-full","m-0","rounded-md","bg-white","cursor-pointer","transition-all ease-in-out duration-200","hover:border-slate-400","focus:outline focus:outline-2 focus:outline-slate-200 focus:border-slate-400","disabled:bg-slate-100 disabled:border-slate-300 disabled:cursor-default",M&&"border-red-500 bg-red-100 text-red-600 hover:border-red-600 focus:border-red-600 focus:outline-red-200",o?.input),children:[g("span",{...k,className:f("truncate",!b.selectedItem&&"text-slate-400",o?.value),children:b.selectedItem?b.selectedItem.rendered:v??"Select..."}),g("span",{className:f("shrink-0 [&_svg]:w-4 [&_svg]:h-4",o?.arrowButton),children:g(te,{isOpen:b.isOpen,isDisabled:L,isInvalid:M,buttonIcon:u?.buttonIcon})})]}),b.isOpen&&g(le,{popoverRef:B,offset:y,className:f(o?.listContainer),children:g(ne,{state:b,listBoxProps:j,listBoxRef:A,className:f("max-h-80","overflow-y-auto","outline-none",o?.list)})})]}),a&&g("span",{..._,className:f("flex","text-xs","text-slate-500",o?.description),children:a}),M&&typeof i=="string"&&g("span",{...z,className:f("flex","text-xs","text-red-500",o?.errorMessage),children:i})]})}export{ge as ButtonSelect,ge as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ForwardedRef } from 'react';
|
|
2
|
+
import { SelectProps } from './Select.types';
|
|
3
|
+
interface ComboBoxSelectComponent {
|
|
4
|
+
<T extends object>(props: SelectProps<T> & {
|
|
5
|
+
ref?: ForwardedRef<HTMLInputElement>;
|
|
6
|
+
}): JSX.Element;
|
|
7
|
+
}
|
|
8
|
+
export declare const ComboBoxSelect: ComboBoxSelectComponent;
|
|
9
|
+
export default ComboBoxSelect;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsxs as de,jsx as C}from"react/jsx-runtime";import{useState as v,useMemo as N,useRef as p,useCallback as ce,useEffect as le,forwardRef as ye}from"react";import{useFilter as pe,useObjectRef as xe,useComboBox as he,useButton as Ve,HiddenSelect as Ie}from"react-aria";import{$ as Ce,b as $e,d as Ke,c as Oe,a as Se}from"../../assets/useOverlayTriggerState-CooW9h9l.js";import{$ as me}from"../../assets/useControlledState-Cmn8tE-_.js";import{cn as O}from"../../utils/cn.js";import"framer-motion";import{Pulse as ve}from"../Loader/Pulse.js";import{ChevronIcon as Fe,SelectOverlay as we,SelectListBox as Ae}from"./parts.js";const Re=[];function Ne(e){let{defaultFilter:y,menuTrigger:d="input",allowsEmptyCollection:$=!1,allowsCustomValue:K,shouldCloseOnBlur:m=!0,selectionMode:n="single"}=e,[x,B]=v(!1),[k,ne]=v(!1),[h,T]=v(null),Q=N(()=>e.defaultValue!==void 0?e.defaultValue:n==="single"?e.defaultSelectedKey??null:[],[e.defaultValue,e.defaultSelectedKey,n]),M=N(()=>e.value!==void 0?e.value:n==="single"?e.selectedKey:void 0,[e.value,e.selectedKey,n]),[j,ue]=me(M,Q,e.onChange),o=n==="single"&&Array.isArray(j)?j[0]:j,g=t=>{if(n==="single"){let i=Array.isArray(t)?t[0]??null:t;ue(i),i!==o&&e.onSelectionChange?.(i)}else{let i=[];Array.isArray(t)?i=t:t!=null&&(i=[t]),ue(i)}},{collection:c,selectionManager:f,disabledKeys:F}=Ce({...e,items:e.items??e.defaultItems,selectionMode:n,disallowEmptySelection:n==="single",allowDuplicateSelectionEvents:!0,selectedKeys:N(()=>Te(o),[o]),onSelectionChange:t=>{if(t!=="all")if(n==="single"){let i=t.values().next().value??null;i===o?(e.onSelectionChange?.(i),W(),S()):g(i)}else g([...t])}}),l=n==="single"?f.firstSelectedKey:null,P=N(()=>[...f.selectedKeys].map(t=>c.getItem(t)).filter(t=>t!=null),[f.selectedKeys,c]),[u,H]=me(e.inputValue,ge(e.defaultInputValue,l,c)||"",e.onInputChange),[q]=v(o),[se]=v(u),a=c,b=N(()=>e.items!=null||!y?c:Be(c,u,y),[c,u,y,e.items]),[X,Z]=v(b),E=p("focus"),r=$e({...e,onOpenChange:t=>{e.onOpenChange&&e.onOpenChange(t,t?E.current:void 0),f.setFocused(t),t||f.setFocusedKey(null)},isOpen:void 0,defaultOpen:void 0}),w=(t=null,i)=>{let J=i==="manual"||i==="focus"&&d==="focus";($||b.size>0||J&&a.size>0||e.items)&&(J&&!r.isOpen&&e.items===void 0&&B(!0),E.current=i,T(t),r.open())},_=(t=null,i)=>{let J=i==="manual"||i==="focus"&&d==="focus";!($||b.size>0||J&&a.size>0||e.items)&&!r.isOpen||(J&&!r.isOpen&&e.items===void 0&&B(!0),r.isOpen||(E.current=i),oe(t))},D=ce(()=>{Z(x?a:b)},[x,a,b]),oe=ce((t=null)=>{r.isOpen&&D(),T(t),r.toggle()},[r,D]),S=ce(()=>{r.isOpen&&(D(),r.close())},[r,D]),[U,z]=v(u),W=()=>{let t=l!=null?c.getItem(l)?.textValue??"":"";z(t),H(t)},A=p(o),R=p(l!=null?c.getItem(l)?.textValue??"":"");le(()=>{k&&(b.size>0||$)&&!r.isOpen&&u!==U&&d!=="manual"&&w(null,"input"),!x&&!$&&r.isOpen&&b.size===0&&S(),o!=null&&o!==A.current&&n==="single"&&S(),u!==U&&(f.setFocusedKey(null),B(!1),n==="single"&&u===""&&(e.inputValue===void 0||M===void 0)&&g(null)),o!==A.current&&(e.inputValue===void 0||M===void 0)?W():U!==u&&z(u);let t=l!=null?c.getItem(l)?.textValue??"":"";!k&&l!=null&&e.inputValue===void 0&&l===A.current&&R.current!==t&&(z(t),H(t)),A.current=o,R.current=t});let ee=Ke({...e,value:N(()=>Array.isArray(o)&&o.length===0?null:{inputValue:u,value:o,selectedKey:l},[u,l,o])}),ae=()=>{K&&l==null?te():L()},te=()=>{let t=n==="multiple"?Re:null;A.current=t,g(t),S()},L=(t=!1)=>{if(M!==void 0&&e.inputValue!==void 0){let i=l!=null?c.getItem(l)?.textValue??"":"";(t||n==="multiple"||u!==i)&&(e.onSelectionChange?.(l),e.onChange?.(o)),z(i),S()}else W(),S()};const Y=()=>{if(K){const t=l!=null?c.getItem(l)?.textValue??"":"";u===t?L():te()}else L()};let re=()=>{r.isOpen&&f.focusedKey!=null?f.isSelected(f.focusedKey)&&n==="single"?L(!0):f.select(f.focusedKey):Y()},G=p([u,o]),s=t=>{t?(G.current=[u,o],d==="focus"&&!e.isReadOnly&&w(null,"focus")):(m&&Y(),(u!==G.current[0]||o!==G.current[1])&&ee.commitValidation()),ne(t)},V=N(()=>r.isOpen?x?a:b:X,[r.isOpen,a,b,x,X]),I=e.defaultSelectedKey??(n==="single"?q:null);return{...ee,...r,focusStrategy:h,toggle:_,open:w,close:Y,selectionManager:f,value:o,defaultValue:Q??q,setValue:g,selectedKey:l,selectedItems:P,defaultSelectedKey:I,setSelectedKey:g,disabledKeys:F,isFocused:k,setFocused:s,selectedItem:P[0]??null,collection:V,inputValue:u,defaultInputValue:ge(e.defaultInputValue,I,c)??se,setInputValue:H,commit:re,revert:ae}}function Be(e,y,d){return new Oe(be(e,e,y,d))}function be(e,y,d,$){let K=[];for(let m of y)if(m.type==="section"&&m.hasChildNodes){let n=be(e,Se(m,e),d,$);[...n].some(x=>x.type==="item")&&K.push({...m,childNodes:n})}else m.type==="item"&&$(m.textValue,d)?K.push({...m}):m.type!=="item"&&K.push({...m});return K}function ge(e,y,d){return e==null&&y!=null?d.getItem(y)?.textValue??"":e}function Te(e){if(e!==void 0)return e===null?[]:Array.isArray(e)?e:[e]}function fe(e){return e?typeof e.rendered=="string"?e.rendered:e.textValue??"":""}function Me(e,y){const{label:d,description:$,errorMessage:K,children:m,placeholder:n,isLoading:x,slots:B,popoverOffset:k,className:ne,classNames:h,autoComplete:T,menuTrigger:Q,selectTextOnFocus:M=!0,autoFocusFirstOption:j=!0,searchable:ue,name:o,...g}=e,c=!!(g.isDisabled||x),f=p(!1),F=p(null),l=g.inputValue!==void 0,[P,u]=v(""),H=l?g.inputValue:P,q={...g,label:d,children:m,placeholder:n,isDisabled:c,menuTrigger:Q??"focus",autoComplete:T,inputValue:H,onInputChange:s=>{l||u(s),g.onInputChange?.(s),s===""&&F.current?.selectedKey!=null&&F.current.setSelectedKey(null)},onSelectionChange:s=>{if(!l){const V=s!=null?F.current?.collection.getItem(s):null;u(fe(V))}g.onSelectionChange?.(s)}},{contains:se}=pe({sensitivity:"base"}),a=Ne({...q,defaultFilter:se,allowsEmptyCollection:!0});le(()=>{F.current=a});const b=fe(a.selectedItem);le(()=>{l||f.current||P===b||u(b)},[b,l,P]);const X=p(null),Z=xe(y),E=p(null),ie=p(null),r=p(null),w=p(null),_=p(null),{inputProps:D,listBoxProps:oe,labelProps:S,buttonProps:U,descriptionProps:z,errorMessageProps:W}=he({...q,inputRef:Z,listBoxRef:E,popoverRef:ie,buttonRef:r},a),{buttonProps:A}=Ve(U,r),R=a.displayValidation.isInvalid,{onKeyDown:ee,onFocus:ae,onBlur:te,...L}=D,Y=s=>{s.key==="Home"||s.key==="End"||ee?.(s)};le(()=>{const s=a.selectionManager;if(!j||!a.isOpen||a.inputValue.length===0){_.current=null;return}const V=s.focusedKey;if(V!=null&&V!==_.current)return;const I=a.collection.getFirstKey();_.current=I??null,I!=null&&I!==V&&s.setFocusedKey(I)});const re=s=>{ae?.(s);const V=f.current;if(f.current=!0,V||!M)return;const I=s.target,t=I.value;t&&requestAnimationFrame(()=>{I.value===t&&I.select()})},G=s=>{te?.(s);const V=s.currentTarget;requestAnimationFrame(()=>{document.activeElement!==V&&(f.current=!1,l||u(fe(F.current?.selectedItem)))})};return de("div",{ref:X,className:O("flex flex-col","w-full",ne),children:[C("label",{...S,className:O("flex","text-xs text-slate-500",h?.label),children:d}),C(Ie,{state:a,triggerRef:w,label:d,name:o,isDisabled:c,autoComplete:T}),de("div",{ref:w,className:O("flex","relative","w-full",h?.comboBoxContainer),children:[C("input",{...L,onKeyDown:Y,onFocus:re,onBlur:G,ref:Z,placeholder:n,autoComplete:T,className:O("border border-solid border-slate-300","text-sm text-slate-900","py-0 px-2","h-10 w-full","m-0","rounded-md","bg-white","transition-all ease-in-out duration-200","hover:border-slate-400","focus:border-slate-400 focus:outline focus:outline-2 focus:outline-slate-200","disabled:bg-slate-100 disabled:border-slate-300",x?"disabled:text-slate-900":"disabled:text-slate-500",R&&"border-red-500 bg-red-100 text-red-600 placeholder:text-slate-400",R&&"hover:border-red-600 focus:border-red-600 focus:outline-red-200",h?.input)}),x?C("div",{className:O("absolute top-2 right-2","block",h?.loader),children:B?.loadingIcon||C(ve,{})}):C("button",{...A,ref:r,className:O("absolute top-2 right-0","block","border-none bg-none",h?.arrowButton),children:C(Fe,{isOpen:a.isOpen,isDisabled:c,isInvalid:R,buttonIcon:B?.buttonIcon})}),a.isOpen&&a.collection.size>0&&C(we,{state:a,triggerRef:w,popoverRef:ie,offset:k,className:O(h?.listContainer),children:C(Ae,{state:a,listBoxProps:oe,listBoxRef:E,optionVirtualFocus:!0,className:O("max-h-80","overflow-y-auto","outline-none",h?.list)})})]}),$&&C("span",{...z,className:O("flex","text-xs","text-slate-500",h?.description),children:$}),R&&typeof K=="string"&&C("span",{...W,className:O("flex","text-xs","text-red-500",h?.errorMessage),children:K})]})}const _e=ye(Me);export{_e as ComboBoxSelect,_e as default};
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function Option({ className, ...props }: OptionProps): import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
export declare const Option: <T>(props: import('react-stately').ItemProps<T>) => import("react").JSX.Element;
|
|
3
2
|
export default Option;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import d from"react";function r(t){return null}r.getCollectionNode=function*(e,u){let{childItems:a,title:c,children:f}=e,i=e.title||e.children,n=e.textValue||(typeof i=="string"?i:"")||e["aria-label"]||"";!n&&!u?.suppressTextValueWarning&&process.env.NODE_ENV!=="production"&&console.warn("<Item> with non-plain text contents is unsupported by type to select for accessibility. Please add a `textValue` prop."),yield{type:"item",props:e,rendered:i,textValue:n,"aria-label":e["aria-label"],hasChildNodes:s(e),*childNodes(){if(a)for(let l of a)yield{type:"item",value:l};else if(c){let l=[];d.Children.forEach(f,o=>{l.push({type:"item",element:o})}),yield*l}}}};function s(t){return t.hasChildItems!=null?t.hasChildItems:!!(t.childItems||t.title&&d.Children.count(t.children)>0)}let h=r;const y=h;export{y as Option,y as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export type OptionProps =
|
|
1
|
+
import { ItemProps } from 'react-stately';
|
|
2
|
+
export type OptionProps<T = object> = ItemProps<T>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e
|
|
1
|
+
"use client";import{jsx as e}from"react/jsx-runtime";import{forwardRef as o,Children as n}from"react";import{ButtonSelect as i}from"./ButtonSelect.js";import{ComboBoxSelect as m}from"./ComboBoxSelect.js";import"react-aria";import"../../assets/useEffectEvent-gqjrDmw8.js";import"../../assets/useOverlayTriggerState-CooW9h9l.js";import"../../assets/useControlledState-Cmn8tE-_.js";import"../../utils/cn.js";import"./parts.js";import"framer-motion";import"../Loader/Pulse.js";const c=8;function l(t){return t.items?[...t.items].length:typeof t.children=="function"?Number.POSITIVE_INFINITY:n.count(t.children)}function u(t,r){return(t.searchable==="auto"?l(t)>c:!!t.searchable)?e(m,{ref:r,...t}):e(i,{...t})}const H=o(u);export{H as Select,H as default};
|
|
@@ -15,6 +15,26 @@ export interface SelectProps<T extends object> extends Omit<AriaComboBoxProps<T>
|
|
|
15
15
|
children: ReactNode | ((item: T) => ReactNode);
|
|
16
16
|
slots?: SelectSlots<T>;
|
|
17
17
|
popoverOffset?: number;
|
|
18
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Select the input text on focus so a click lets you type a replacement
|
|
20
|
+
* immediately. Default `true`. (rAF-deferred so a click's caret placement
|
|
21
|
+
* doesn't clear the selection.)
|
|
22
|
+
*/
|
|
23
|
+
selectTextOnFocus?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Pre-focus the first filtered option on input change, so it shows
|
|
26
|
+
* highlighted and Enter/Tab commit it instead of clearing the input.
|
|
27
|
+
* Default `true`. Set `false` for strict "no accidental commit" behavior.
|
|
28
|
+
* (Searchable mode only.)
|
|
29
|
+
*/
|
|
30
|
+
autoFocusFirstOption?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Whether the select is type-to-filter searchable.
|
|
33
|
+
* - `false` (default): button-style picker — click to open, pick one.
|
|
34
|
+
* - `true`: combobox — type to filter; Tab/Enter commit and Tab advances.
|
|
35
|
+
* - `'auto'`: searchable once there are more than ~8 options.
|
|
36
|
+
*/
|
|
37
|
+
searchable?: boolean | 'auto';
|
|
38
|
+
classNames?: SlotsToClasses<'label' | 'name' | 'comboBoxContainer' | 'input' | 'value' | 'loader' | 'arrowButton' | 'description' | 'errorMessage' | 'listContainer' | 'list'>;
|
|
19
39
|
autoComplete?: HTMLInputAutoCompleteAttribute;
|
|
20
40
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Option as a}from"./Option.js";import{Select as d}from"./Select.js";import"react";import"react/jsx-runtime";import"./ButtonSelect.js";import"react-aria";import"../../assets/useEffectEvent-gqjrDmw8.js";import"../../assets/useOverlayTriggerState-CooW9h9l.js";import"../../assets/useControlledState-Cmn8tE-_.js";import"../../utils/cn.js";import"./parts.js";import"./ComboBoxSelect.js";import"framer-motion";import"../Loader/Pulse.js";export{a as Option,d as Select};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ReactNode, RefObject } from 'react';
|
|
2
|
+
import { AriaListBoxOptions } from 'react-aria';
|
|
3
|
+
import { ListState, Node, OverlayTriggerState } from 'react-stately';
|
|
4
|
+
import { SelectSlots } from './Select.types';
|
|
5
|
+
export declare function SelectOption<T extends object>({ item, state, shouldUseVirtualFocus, }: {
|
|
6
|
+
item: Node<T>;
|
|
7
|
+
state: ListState<T>;
|
|
8
|
+
shouldUseVirtualFocus?: boolean;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function SelectListBox<T extends object>({ state, listBoxProps, listBoxRef, className, optionVirtualFocus, }: {
|
|
11
|
+
state: ListState<T>;
|
|
12
|
+
listBoxProps: AriaListBoxOptions<T>;
|
|
13
|
+
listBoxRef: RefObject<HTMLUListElement>;
|
|
14
|
+
className?: string;
|
|
15
|
+
optionVirtualFocus?: boolean;
|
|
16
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare function SelectPopover({ children, popoverRef, offset, className, }: {
|
|
18
|
+
children: ReactNode;
|
|
19
|
+
popoverRef: RefObject<HTMLDivElement>;
|
|
20
|
+
offset?: number;
|
|
21
|
+
className?: string;
|
|
22
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare function SelectOverlay({ state, triggerRef, popoverRef, offset, className, children, }: {
|
|
24
|
+
state: OverlayTriggerState;
|
|
25
|
+
triggerRef: RefObject<HTMLElement>;
|
|
26
|
+
popoverRef: RefObject<HTMLDivElement>;
|
|
27
|
+
offset?: number;
|
|
28
|
+
className?: string;
|
|
29
|
+
children: ReactNode;
|
|
30
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export declare function ChevronIcon({ isOpen, isDisabled, isInvalid, buttonIcon, }: {
|
|
32
|
+
isOpen: boolean;
|
|
33
|
+
isDisabled: boolean;
|
|
34
|
+
isInvalid: boolean;
|
|
35
|
+
buttonIcon?: SelectSlots<object>['buttonIcon'];
|
|
36
|
+
}): ReactNode;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as s,jsxs as p}from"react/jsx-runtime";import{useState as x,useLayoutEffect as f,useRef as m}from"react";import{usePopover as h,Overlay as _,DismissButton as u,useListBox as b,useOption as w}from"react-aria";import{cn as a}from"../../utils/cn.js";function y({item:e,state:o,shouldUseVirtualFocus:r}){const t=m(null),{optionProps:l,isFocused:i,isSelected:n,isDisabled:d}=w({key:e.key,shouldUseVirtualFocus:r},o,t);return s("li",{...l,ref:t,className:a("flex flex-auto items-center","rounded-md","p-2.5 mx-1.5","text-sm","cursor-default outline-none","text-slate-900","transition-all ease-in-out duration-150",i&&"bg-slate-100",n&&"font-semibold",d&&"text-slate-500"),children:e.rendered})}function N({state:e,listBoxProps:o,listBoxRef:r,className:t,optionVirtualFocus:l}){const{listBoxProps:i}=b(o,e,r);return s("ul",{...i,ref:r,className:t,children:[...e.collection].map(n=>s(y,{item:n,state:e,shouldUseVirtualFocus:l},n.key))})}function P({children:e,popoverRef:o,offset:r,className:t}){return s("div",{ref:o,style:{marginTop:r??4},className:a("absolute top-full left-0 z-50 w-full","px-0 py-1.5","rounded-md bg-white","border border-solid border-slate-300","shadow-[0_10px_15px_-3px_rgba(0,0,0,0.1),0_4px_6px_-4px_rgba(0,0,0,0.1)]",t),children:e})}function S({state:e,triggerRef:o,popoverRef:r,offset:t,className:l,children:i}){const{popoverProps:n}=h({triggerRef:o,popoverRef:r,isNonModal:!0,placement:"bottom start",offset:t??4},e),[d,c]=x();return f(()=>{o.current&&c(o.current.offsetWidth)},[o]),s(_,{children:p("div",{...n,ref:r,style:{...n.style,width:d},className:a("z-50","px-0 py-1.5","rounded-md bg-white","border border-solid border-slate-300","shadow-[0_10px_15px_-3px_rgba(0,0,0,0.1),0_4px_6px_-4px_rgba(0,0,0,0.1)]",l),children:[s(u,{onDismiss:()=>e.close()}),i,s(u,{onDismiss:()=>e.close()})]})})}function B({isOpen:e,isDisabled:o,isInvalid:r,buttonIcon:t}){return t?typeof t=="function"?t({isOpen:e,isDisabled:o,isInvalid:r}):t:s("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:a("transition-all ease-in-out duration-200",e?"rotate-180":"rotate-0"),children:s("path",{d:"M6 9L12 15L18 9",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:a(["stroke-slate-900",o&&"stroke-slate-400",r&&"stroke-red-500"])})})}export{B as ChevronIcon,N as SelectListBox,y as SelectOption,S as SelectOverlay,P as SelectPopover};
|
package/package.json
CHANGED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
3
|
-
import { Avatar } from './Avatar';
|
|
4
|
-
import { AvatarGroup } from './AvatarGroup/AvatarGroup';
|
|
5
|
-
declare function Layout({ children }: {
|
|
6
|
-
children: ReactNode;
|
|
7
|
-
}): ReactNode;
|
|
8
|
-
type Story = StoryObj<typeof Avatar>;
|
|
9
|
-
type StoryGroup = StoryObj<typeof AvatarGroup>;
|
|
10
|
-
declare const meta: Meta<typeof Layout>;
|
|
11
|
-
export default meta;
|
|
12
|
-
export declare const AvatarComponent: Story;
|
|
13
|
-
export declare const AvatarGroupComponent: StoryGroup;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { Badge } from './Badge';
|
|
3
|
-
import { BadgeProps } from './Badge.types';
|
|
4
|
-
type Story = StoryObj<typeof Badge>;
|
|
5
|
-
declare function Component(props: BadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
declare const meta: Meta<typeof Component>;
|
|
7
|
-
export default meta;
|
|
8
|
-
export declare const Example: Story;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { SelectProps as AriaSelectProps } from 'react-aria-components';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
3
|
-
export type DropdownSelectProps<T extends object> = Omit<AriaSelectProps<T>, 'children'> & {
|
|
4
|
-
label?: string;
|
|
5
|
-
placeholder?: string;
|
|
6
|
-
children: ReactNode;
|
|
7
|
-
className?: string;
|
|
8
|
-
classNames?: {
|
|
9
|
-
trigger?: string;
|
|
10
|
-
label?: string;
|
|
11
|
-
value?: string;
|
|
12
|
-
listContainer?: string;
|
|
13
|
-
list?: string;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
export declare function DropdownSelect<T extends object>({ label, placeholder, children, className, classNames, ...props }: DropdownSelectProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";import{jsxs as s,jsx as e}from"react/jsx-runtime";import{Select as u,Label as x,Button as p,SelectValue as h,Popover as m,ListBox as b}from"react-aria-components";import{cn as t}from"../../utils/cn.js";function v({label:o,placeholder:l,children:i,className:n,classNames:r,...d}){return s(u,{...d,className:t("flex items-center gap-2",n),children:[o&&e(x,{className:t("text-xs text-slate-500",r?.label),children:o}),s(p,{className:t("flex items-center justify-between","border border-solid border-slate-300","text-sm text-slate-900","py-0 px-3","h-10","rounded-md","bg-white","cursor-pointer","transition-all ease-in-out duration-200","data-[hovered]:border-slate-400","data-[focused]:border-slate-400 data-[focused]:outline data-[focused]:outline-2 data-[focused]:outline-slate-200",r?.trigger),children:[e(h,{className:t("text-sm truncate",r?.value),children:({isPlaceholder:a,selectedText:c})=>e("span",{className:a?"text-slate-400":"",children:a?l??"Select...":c})}),e("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"shrink-0 ml-2",children:e("path",{d:"M6 9L12 15L18 9",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"stroke-slate-900"})})]}),e(m,{className:t("px-0 py-1.5","shadow-[0_10px_15px_-3px_rgba(0,0,0,0.1),0_4px_6px_-4px_rgba(0,0,0,0.1)]","rounded-md","w-[var(--trigger-width)]","bg-white","border border-solid border-slate-300",r?.listContainer),children:e(b,{className:t("max-h-80 overflow-y-auto outline-none",r?.list),children:i})})]})}export{v as DropdownSelect};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { Time } from './Time';
|
|
3
|
-
type Story = StoryObj<typeof Time>;
|
|
4
|
-
/**
|
|
5
|
-
* `<Time>` reads the configured ("server") timezone and the viewer's ("local")
|
|
6
|
-
* timezone from `TimezoneProvider`. In the app the provider is fed by the
|
|
7
|
-
* server-resolved `displayTimezone` (server) and the viewer's cookie (local).
|
|
8
|
-
*/
|
|
9
|
-
declare const meta: Meta<typeof Time>;
|
|
10
|
-
export default meta;
|
|
11
|
-
/** Interactive playground — toggle `local`/`showZone` and the Intl format options. */
|
|
12
|
-
export declare const Example: Story;
|
|
13
|
-
/** Default: renders in the configured ("server") timezone — the hydration- & index-safe baseline. */
|
|
14
|
-
export declare const ServerTime: Story;
|
|
15
|
-
/** Opt-in: renders in the viewer's ("client") timezone via the `local` prop. */
|
|
16
|
-
export declare const LocalTime: Story;
|
|
17
|
-
/** Same instant, both modes side by side — the configured zone vs. the viewer's zone. */
|
|
18
|
-
export declare const ServerVsLocal: Story;
|
|
19
|
-
/** Invalid/empty input renders the `fallback` (default `-`). */
|
|
20
|
-
export declare const Fallback: Story;
|