@flux-ui/internals 3.0.0-next.57 → 3.0.0-next.59

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -8,13 +8,13 @@ Built with [`tsdown`](https://github.com/rolldown/tsdown).
8
8
 
9
9
  The package exposes four sub-entry points alongside the root export:
10
10
 
11
- | Entry | Contents |
12
- |-----------------------------|-------------------------------------------------------------------------------------|
13
- | `@flux-ui/internals` | Re-exports of every entry below. |
14
- | `@flux-ui/internals/composable` | `useCalendar`, `useEventListener`, `useFocusTrap`, `useFocusZone`, `useInView`, `useRemembered`, `useScrollEdges`, `useScrollPosition`, … |
15
- | `@flux-ui/internals/data` | Data helpers — e.g. color utilities. |
16
- | `@flux-ui/internals/directive` | Vue directives — `focusTrap`, `heightTransition`. |
17
- | `@flux-ui/internals/util` | Focus helpers (`wrapFocus`, `getFocusableElement(s)`, `getKeyboardFocusableElements`, `getBidirectionalFocusElement`), `flattenVNodeTree`, `animationFrameDebounce`, `warn`, … |
11
+ | Entry | Contents |
12
+ |---------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
13
+ | `@flux-ui/internals` | Re-exports of every entry below. |
14
+ | `@flux-ui/internals/composable` | `useCalendar`, `useEventListener`, `useFocusTrap`, `useFocusZone`, `useInView`, `useRemembered`, `useScrollEdges`, `useScrollPosition`, … |
15
+ | `@flux-ui/internals/data` | Data helpers — e.g. color utilities. |
16
+ | `@flux-ui/internals/directive` | Vue directives — `focusTrap`, `heightTransition`. |
17
+ | `@flux-ui/internals/util` | Focus helpers (`wrapFocus`, `getFocusableElement(s)`, `getKeyboardFocusableElements`, `getBidirectionalFocusElement`), `flattenVNodeTree`, `animationFrameDebounce`, `warn`, … |
18
18
 
19
19
  ## ⭐️ Prerequisites
20
20
 
@@ -1,2 +1,2 @@
1
- import { a as export_default$4, c as export_default$10, d as export_default$2, f as export_default$1, i as export_default$5, l as export_default$9, n as export_default$7, o as export_default$12, p as export_default, r as export_default$6, s as export_default$11, t as export_default$8, u as export_default$3 } from "../index-BhkFHXuX.js";
2
- export { export_default as useCalendar, export_default$1 as useCalendarMonthSwitcher, export_default$2 as useCalendarYearSwitcher, export_default$3 as useEventListener, export_default$4 as useFocusTrap, export_default$5 as useFocusTrapLock, export_default$6 as useFocusTrapReturn, export_default$7 as useFocusTrapSubscription, export_default$8 as useFocusZone, export_default$9 as useInView, export_default$10 as useRemembered, export_default$11 as useScrollEdges, export_default$12 as useScrollPosition };
1
+ import { a as export_default$5, c as export_default$11, d as defaultAnnounce, f as useKeyboardGrab, g as export_default, h as export_default$1, i as export_default$6, l as export_default$10, m as export_default$2, n as export_default$8, o as export_default$13, p as export_default$3, r as export_default$7, s as export_default$12, t as export_default$9, u as export_default$4 } from "../index-4qwf2pQQ.js";
2
+ export { defaultAnnounce as defaultKeyboardGrabAnnounce, export_default as useCalendar, export_default$1 as useCalendarMonthSwitcher, export_default$2 as useCalendarTimeGrid, export_default$3 as useCalendarYearSwitcher, export_default$4 as useEventListener, export_default$5 as useFocusTrap, export_default$6 as useFocusTrapLock, export_default$7 as useFocusTrapReturn, export_default$8 as useFocusTrapSubscription, export_default$9 as useFocusZone, export_default$10 as useInView, useKeyboardGrab, export_default$11 as useRemembered, export_default$12 as useScrollEdges, export_default$13 as useScrollPosition };
@@ -1 +1 @@
1
- import{a as e,c as t,d as n,f as r,i,l as a,n as o,o as s,p as c,r as l,s as u,t as d,u as f}from"../composable-CJXC7sly.js";export{c as useCalendar,r as useCalendarMonthSwitcher,n as useCalendarYearSwitcher,f as useEventListener,l as useFocusTrap,e as useFocusTrapLock,i as useFocusTrapReturn,o as useFocusTrapSubscription,d as useFocusZone,a as useInView,t as useRemembered,u as useScrollEdges,s as useScrollPosition};
1
+ import{a as e,c as t,d as n,f as r,g as i,h as a,i as o,l as s,m as c,n as l,o as u,p as d,r as f,s as p,t as m,u as h}from"../composable-Cp0PgZry.js";export{n as defaultKeyboardGrabAnnounce,i as useCalendar,a as useCalendarMonthSwitcher,c as useCalendarTimeGrid,d as useCalendarYearSwitcher,h as useEventListener,f as useFocusTrap,e as useFocusTrapLock,o as useFocusTrapReturn,l as useFocusTrapSubscription,m as useFocusZone,s as useInView,r as useKeyboardGrab,t as useRemembered,p as useScrollEdges,u as useScrollPosition};
@@ -0,0 +1,2 @@
1
+ import{a as e,d as t,f as n,n as r,r as i,s as a,t as o}from"./util-CwaOsSvo.js";import{computed as s,onMounted as c,onUnmounted as l,ref as u,toValue as d,unref as f,watch as p}from"vue";import{DateTime as m}from"luxon";import{unwrapElement as h,useMutationObserver as g}from"@basmilius/common";function _(e,t){let n=u(!1),r=u(e),i=s(()=>{let e=[],t=f(r).month,n=f(r).startOf(`month`);do e.push(n),n=n.plus({day:1});while(n.month===t);let i=e[0],a=e[e.length-1];for(let t=1;t<i.weekday;++t)e.unshift(i.minus({day:t}));for(let t=a.weekday+1;t<=7;++t)e.push(a.plus({day:t-a.weekday}));for(;e.length/7<6;){let t=e[e.length-1];for(let n=1;n<=7;++n)e.push(t.plus({day:n}))}return e}),a=s(()=>f(i).slice(0,7).map(e=>e.toLocaleString({weekday:t?.weekDayLength??`short`}))),o=s(()=>f(r).plus({month:1})),c=s(()=>f(r).minus({month:1})),l=s(()=>f(r).toLocaleString({month:t?.monthLength??`long`})),d=s(()=>f(r).year.toString());function p(e){n.value=r.value>e,r.value=e}function m(){p(f(r).plus({month:1}))}function h(){p(f(r).minus({month:1}))}return{isTransitioningToPast:n,viewDate:r,viewDateNext:o,viewDatePrevious:c,viewMonth:l,viewYear:d,dates:i,days:a,setViewDate:p,nextMonth:m,previousMonth:h}}function v(e,t){return{months:s(()=>{let n=[],r=f(e),i=r.startOf(`year`);for(;i.month<=12&&i.year===r.year;)n.push({date:i,label:i.toLocaleString({month:t})}),i=i.plus({months:1});return n})}}function y(e,t){return t===7?e.startOf(`week`):e.startOf(`day`)}function b(e){return e===7?{week:1}:e===2?{day:2}:{day:1}}function x(e,t){let n=u(!1),r=u(y(e,d(t)));p(()=>d(t),e=>{r.value=y(f(r),e)});let i=s(()=>{let e=f(r),n=d(t),i=[];for(let t=0;t<n;++t)i.push(e.plus({day:t}));return i}),a=s(()=>{let e=f(i),n=e[0],r=e[e.length-1];if(d(t)===1)return n.toLocaleString({weekday:`long`,day:`numeric`,month:`long`,year:`numeric`});let a=n.month===r.month,o=n.year===r.year;return`${n.toLocaleString(a&&o?{weekday:`short`,day:`numeric`}:{weekday:`short`,day:`numeric`,month:`short`})} – ${r.toLocaleString({weekday:`short`,day:`numeric`,month:`short`,year:o?void 0:`numeric`})}`});function o(e){let i=y(e,d(t));n.value=f(r)>i,r.value=i}function c(){o(f(r).plus(b(d(t))))}function l(){o(f(r).minus(b(d(t))))}return{isTransitioningToPast:n,viewDate:r,viewDates:i,rangeLabel:a,setViewDate:o,next:c,previous:l}}function S(e,t=10){let n=u(0),r=s(()=>{let r=f(e).year,i=[],a=r-r%t+f(n)*t;for(let e=0;e<t;++e)i.push(a+e);return i});function i(){++n.value}function a(){--n.value}return p(e,()=>n.value=0),{years:r,next:i,previous:a}}let C=null;function w(){if(C)return C;if(typeof document>`u`)return null;let e=document.createElement(`div`);return e.setAttribute(`role`,`status`),e.setAttribute(`aria-live`,`polite`),e.setAttribute(`aria-atomic`,`true`),e.style.cssText=`position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0`,document.body.appendChild(e),C=e,e}function T(e){let t=w();t&&(t.textContent=``,requestAnimationFrame(()=>{t.textContent=e}))}function E(e){let t=u(null);e.announce;let n=s(()=>{let t=f(e.itemId),n=f(e.grabbedId);return t!=null&&n===t});function r(){t.value=null}function i(r){if(f(e.isDraggable)&&f(e.itemId)!=null){if(!n.value){(r.key===` `||r.key===`Enter`)&&(r.preventDefault(),t.value=e.onGrab());return}switch(r.key){case`ArrowUp`:r.preventDefault(),e.onMove(`up`);break;case`ArrowDown`:r.preventDefault(),e.onMove(`down`);break;case`ArrowLeft`:r.preventDefault(),e.onMove(`left`);break;case`ArrowRight`:r.preventDefault(),e.onMove(`right`);break;case` `:case`Enter`:{r.preventDefault();let n=t.value;t.value=null,n!==null&&e.onCommit(n);break}case`Escape`:{r.preventDefault();let n=t.value;t.value=null,n!==null&&e.onCancel(n);break}}}}return{isGrabbed:n,handleKeyDown:i,release:r}}function D(e,t,n,r={passive:!0}){p(e,(e,i,a)=>{e&&(e.addEventListener(t,n,r),a(()=>e.removeEventListener(t,n)))},{immediate:!0})}function O(t,n={}){let r=u(n.initial??!1);return p(t,(i,a,o)=>{let s=e(t);if(!s)return;let c=new IntersectionObserver(e=>r.value=e[0]?.isIntersecting??!1,n);c.observe(s),o(()=>c.disconnect())},{immediate:!0}),r}function k(e,t){let n=`flux/${e}`,r=u(i()??t);function i(){if(n in localStorage){let e=JSON.parse(localStorage.getItem(n));return Array.isArray(e)&&e[0]===`DateTime`&&(e=m.fromISO(e[1])),e}return null}return p(r,e=>{let t=e;m.isDateTime(e)&&(t=[`DateTime`,e.toISO({includeOffset:!0,extendedZone:!0})]),localStorage.setItem(n,JSON.stringify(t))}),r}function A(t){let n=u(!0),r=u(!0);return p(t,(i,a,o)=>{let s=e(t);if(!s)return;let c=()=>{let{scrollTop:e,scrollHeight:t,clientHeight:i}=s;n.value=e<=0,r.value=Math.ceil(e+i)>=t},l=new ResizeObserver(c);l.observe(s);for(let e of Array.from(s.children))l.observe(e);let u=new MutationObserver(e=>{for(let t of e){for(let e of Array.from(t.addedNodes))e instanceof Element&&l.observe(e);for(let e of Array.from(t.removedNodes))e instanceof Element&&l.unobserve(e)}c()});u.observe(s,{childList:!0}),s.addEventListener(`scroll`,c,{passive:!0}),c(),o(()=>{s.removeEventListener(`scroll`,c),l.disconnect(),u.disconnect()})},{immediate:!0}),{isAtStart:n,isAtEnd:r}}function j(e){let t=u(0),n=u(0);return e||=u(document),D(e,`scroll`,()=>{let r=f(e);r instanceof Document&&(r=r.scrollingElement),t.value=r?.scrollLeft??0,n.value=r?.scrollTop??0}),{x:t,y:n}}let M=0;function N(e=!1){let t=u(`focus-trap-${++M}`),n=u(!1);return c(()=>r.add(f(t),e=>n.value=e,e)),l(()=>r.remove(f(t))),n}function P(t,n){p(t,(r,i,a)=>{if(!e(t)||f(n))return;let o=document.activeElement;a(()=>{requestAnimationFrame(()=>o?.focus())})})}function F(t,r={}){if(o)return;let{disable:a=u(!1),disableReturn:s=u(!1),attachTo:c=null}=r,l=N(!a);P(t,s),p(t,(r,a,o)=>{let s=e(t),u=c||document;l.value&&s&&document.activeElement&&!s.contains(document.activeElement)&&!s.querySelector(`[autofocus]`)&&i(s,document.activeElement,!0);function d(e){if(!l.value||!s)return;let t=e.target||document.body;s.contains(t)||(e.preventDefault(),e.stopImmediatePropagation(),i(s,t))}function f(e){if(!l.value||!s)return;(!e.relatedTarget||e.relatedTarget===document.body)&&(e.preventDefault(),s.focus());let t=e.target||document.body;s.contains(t)||i(s,t)}if(u.addEventListener(`focusin`,d,{capture:!0}),u.addEventListener(`focusout`,f,{capture:!0}),s){let e=n(s),t=e.findIndex(e=>e.classList.contains(`is-active`)),r=e.findIndex(e=>!e.hasAttribute(`aria-disabled`)),i=e[0];t>-1&&(i=e[t]),r>-1&&(i=e[r]),i&&i.focus()}o(()=>{u.removeEventListener(`focusin`,d),u.removeEventListener(`focusout`,f)})},{immediate:!0}),p(()=>a,()=>{let r=e(t);if(l.value=!a,a||!r)return;let i=n(r);i.includes(document.activeElement)||i[0]?.focus()},{immediate:!0})}function I(e){let t=u(null);c(()=>t.value=r.subscribe(e)),l(()=>t.value?.())}function L(e,{cycle:t=!0,direction:r=`bidirectional`}={}){g(e,()=>a(i(),!1));function i(){let t=n(h(e)),r=t.findIndex(e=>e.classList.contains(`is-active`)),i=t.findIndex(e=>!e.hasAttribute(`aria-disabled`));return r>-1?r:i>-1?i:0}function a(t,r=!0){let i=n(h(e));i.forEach((e,n)=>e.tabIndex=n===t?0:-1),r&&i[t]?.focus()}function o(i){let o=h(e),s=n(o);if(![`Enter`,` `].includes(i.key))switch(r){case`bidirectional`:R(i,o,s,a);break;case`horizontal`:case`vertical`:z(i,o,t,r,s,a);break}}p(e,(t,n,r)=>{let s=h(e);s&&(s.addEventListener(`keydown`,o),a(i(),!1),r(()=>s.removeEventListener(`keydown`,o)))},{immediate:!0})}function R(e,n,r,i){let a;switch(e.key){case`ArrowUp`:a=`up`;break;case`ArrowDown`:a=`down`;break;case`ArrowLeft`:a=`left`;break;case`ArrowRight`:a=`right`;break;default:return}let o=t(n,document.activeElement,a);o&&i(r.indexOf(o)),e.preventDefault()}function z(e,t,n,r,i,o){let s;if(e.key===(r===`horizontal`?`ArrowLeft`:`ArrowUp`))s=-1;else if(e.key===(r===`horizontal`?`ArrowRight`:`ArrowDown`))s=1;else return;let c=a(t,s);c?o(i.indexOf(c)):n&&o(s===1?0:i.length-1),e.preventDefault()}export{N as a,k as c,T as d,E as f,_ as g,v as h,P as i,O as l,x as m,I as n,j as o,S as p,F as r,A as s,L as t,D as u};
2
+ //# sourceMappingURL=composable-Cp0PgZry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"composable-Cp0PgZry.js","names":["unrefTemplateElement","unrefTemplateElement","FOCUS_TRAP_LOCKS","unrefTemplateElement","useFocusTrapLock","unrefTemplateElement","getFocusableElements","FOCUS_TRAP_LOCKS","getFocusableElements","getBidirectionalFocusElement","getFocusableElement"],"sources":["../src/composable/useCalendar.ts","../src/composable/useCalendarMonthSwitcher.ts","../src/composable/useCalendarTimeGrid.ts","../src/composable/useCalendarYearSwitcher.ts","../src/composable/useKeyboardGrab.ts","../src/composable/useEventListener.ts","../src/composable/useInView.ts","../src/composable/useRemembered.ts","../src/composable/useScrollEdges.ts","../src/composable/useScrollPosition.ts","../src/composable/useFocusTrapLock.ts","../src/composable/useFocusTrapReturn.ts","../src/composable/useFocusTrap.ts","../src/composable/useFocusTrapSubscription.ts","../src/composable/useFocusZone.ts"],"sourcesContent":["import type { DateTime } from 'luxon';\nimport { computed, ref, type Ref, unref } from 'vue';\n\nexport default function (initialDate: DateTime, options?: UseCalendarOptions): UseCalendarReturn {\n const isTransitioningToPast = ref(false);\n const viewDate = ref(initialDate);\n\n const dates = computed<DateTime[]>(() => {\n const dates: DateTime[] = [];\n const month = unref(viewDate).month;\n let current = unref(viewDate).startOf('month');\n\n do {\n dates.push(current);\n current = current.plus({day: 1});\n } while (current.month === month);\n\n const first = dates[0];\n const last = dates[dates.length - 1];\n\n for (let i = 1; i < first.weekday; ++i) {\n dates.unshift(first.minus({day: i}));\n }\n\n for (let i = last.weekday + 1; i <= 7; ++i) {\n dates.push(last.plus({day: i - last.weekday}));\n }\n\n while (dates.length / 7 < 6) {\n const last = dates[dates.length - 1];\n\n for (let i = 1; i <= 7; ++i) {\n dates.push(last.plus({day: i}));\n }\n }\n\n return dates;\n });\n\n const days = computed(() => unref(dates)\n .slice(0, 7)\n .map(d => d.toLocaleString({weekday: options?.weekDayLength ?? 'short'})));\n\n const viewDateNext = computed(() => unref(viewDate).plus({month: 1}));\n const viewDatePrevious = computed(() => unref(viewDate).minus({month: 1}));\n const viewMonth = computed(() => unref(viewDate).toLocaleString({month: options?.monthLength ?? 'long'}));\n const viewYear = computed(() => unref(viewDate).year.toString());\n\n function setViewDate(date: DateTime): void {\n isTransitioningToPast.value = viewDate.value > date;\n viewDate.value = date;\n }\n\n function nextMonth(): void {\n setViewDate(unref(viewDate).plus({month: 1}));\n }\n\n function previousMonth(): void {\n setViewDate(unref(viewDate).minus({month: 1}));\n }\n\n return {\n isTransitioningToPast,\n viewDate,\n viewDateNext,\n viewDatePrevious,\n viewMonth,\n viewYear,\n dates,\n days,\n setViewDate,\n nextMonth,\n previousMonth\n };\n}\n\ntype UseCalendarOptions = {\n readonly monthLength?: 'short' | 'long';\n readonly weekDayLength?: 'short' | 'long';\n};\n\ntype UseCalendarReturn = {\n readonly isTransitioningToPast: Ref<boolean>;\n readonly viewDate: Ref<DateTime>;\n readonly viewDateNext: Ref<DateTime>;\n readonly viewDatePrevious: Ref<DateTime>;\n readonly viewMonth: Ref<string>;\n readonly viewYear: Ref<string>;\n readonly dates: Ref<DateTime[]>;\n readonly days: Ref<string[]>;\n\n setViewDate(date: DateTime): void;\n nextMonth(): void;\n previousMonth(): void;\n};\n","import type { DateTime } from 'luxon';\nimport { computed, type Ref, unref } from 'vue';\n\nexport default function (currentDate: Ref<DateTime>, displayLength: 'short' | 'long'): UseCalendarMonthSwitcherReturn {\n const months = computed(() => {\n const months: MonthEntry[] = [];\n const now = unref(currentDate);\n let current = now.startOf('year');\n\n while (current.month <= 12 && current.year === now.year) {\n months.push({\n date: current,\n label: current.toLocaleString({month: displayLength})\n });\n current = current.plus({months: 1});\n }\n\n return months;\n });\n\n return {\n months\n };\n}\n\ntype MonthEntry = {\n readonly date: DateTime;\n readonly label: string;\n};\n\ntype UseCalendarMonthSwitcherReturn = {\n readonly months: Ref<MonthEntry[]>;\n};\n","import type { DateTime } from 'luxon';\nimport { computed, type ComputedRef, type MaybeRefOrGetter, ref, type Ref, toValue, unref, watch } from 'vue';\n\nexport type UseCalendarTimeGridDayCount = 1 | 2 | 7;\n\nexport type UseCalendarTimeGridReturn = {\n readonly isTransitioningToPast: Ref<boolean>;\n readonly viewDate: Ref<DateTime>;\n readonly viewDates: ComputedRef<DateTime[]>;\n readonly rangeLabel: ComputedRef<string>;\n\n setViewDate(date: DateTime): void;\n next(): void;\n previous(): void;\n};\n\nfunction getAnchor(date: DateTime, dayCount: UseCalendarTimeGridDayCount): DateTime {\n return dayCount === 7 ? date.startOf('week') : date.startOf('day');\n}\n\nfunction stepDuration(dayCount: UseCalendarTimeGridDayCount): { day?: number; week?: number } {\n if (dayCount === 7) {\n return {week: 1};\n }\n\n if (dayCount === 2) {\n return {day: 2};\n }\n\n return {day: 1};\n}\n\nexport default function (\n initialDate: DateTime,\n dayCount: MaybeRefOrGetter<UseCalendarTimeGridDayCount>\n): UseCalendarTimeGridReturn {\n const isTransitioningToPast = ref(false);\n const viewDate = ref<DateTime>(getAnchor(initialDate, toValue(dayCount)));\n\n // Re-anchor on dayCount change (e.g. switching from week to two-days view).\n watch(() => toValue(dayCount), (count) => {\n viewDate.value = getAnchor(unref(viewDate), count);\n });\n\n const viewDates = computed<DateTime[]>(() => {\n const anchor = unref(viewDate);\n const count = toValue(dayCount);\n const out: DateTime[] = [];\n\n for (let i = 0; i < count; ++i) {\n out.push(anchor.plus({day: i}));\n }\n\n return out;\n });\n\n const rangeLabel = computed<string>(() => {\n const dates = unref(viewDates);\n const first = dates[0];\n const last = dates[dates.length - 1];\n const count = toValue(dayCount);\n\n if (count === 1) {\n return first.toLocaleString({weekday: 'long', day: 'numeric', month: 'long', year: 'numeric'});\n }\n\n const sameMonth = first.month === last.month;\n const sameYear = first.year === last.year;\n\n const firstFmt = first.toLocaleString(\n sameMonth && sameYear\n ? {weekday: 'short', day: 'numeric'}\n : {weekday: 'short', day: 'numeric', month: 'short'}\n );\n const lastFmt = last.toLocaleString({weekday: 'short', day: 'numeric', month: 'short', year: sameYear ? undefined : 'numeric'});\n\n return `${firstFmt} – ${lastFmt}`;\n });\n\n function setViewDate(date: DateTime): void {\n const anchor = getAnchor(date, toValue(dayCount));\n isTransitioningToPast.value = unref(viewDate) > anchor;\n viewDate.value = anchor;\n }\n\n function next(): void {\n setViewDate(unref(viewDate).plus(stepDuration(toValue(dayCount))));\n }\n\n function previous(): void {\n setViewDate(unref(viewDate).minus(stepDuration(toValue(dayCount))));\n }\n\n return {\n isTransitioningToPast,\n viewDate,\n viewDates,\n rangeLabel,\n setViewDate,\n next,\n previous\n };\n}\n","import type { DateTime } from 'luxon';\nimport { computed, ref, type Ref, unref, watch } from 'vue';\n\nexport default function (currentDate: Ref<DateTime>, limit: number = 10): UseCalendarYearSwitcherReturn {\n const index = ref(0);\n\n const years = computed(() => {\n const year = unref(currentDate).year;\n const years: number[] = [];\n const start = year - (year % limit) + unref(index) * limit;\n\n for (let i = 0; i < limit; ++i) {\n years.push(start + i);\n }\n\n return years;\n });\n\n function next(): void {\n ++index.value;\n }\n\n function previous(): void {\n --index.value;\n }\n\n watch(currentDate, () => index.value = 0);\n\n return {\n years,\n\n next,\n previous\n };\n}\n\ntype UseCalendarYearSwitcherReturn = {\n readonly years: Ref<number[]>;\n\n next(): void;\n previous(): void;\n};\n","import { computed, type ComputedRef, ref, type Ref, unref } from 'vue';\n\nexport type KeyboardGrabDirection = 'up' | 'down' | 'left' | 'right';\n\nexport type UseKeyboardGrabOptions<TPos> = {\n readonly isDraggable: Ref<boolean>;\n readonly itemId: Ref<string | number | null | undefined>;\n readonly grabbedId: Ref<string | number | null>;\n onGrab(): TPos;\n onMove(direction: KeyboardGrabDirection): void;\n onCommit(origin: TPos): void;\n onCancel(origin: TPos): void;\n announce?(message: string): void;\n};\n\nexport type UseKeyboardGrabReturn = {\n readonly isGrabbed: ComputedRef<boolean>;\n handleKeyDown(evt: KeyboardEvent): void;\n release(): void;\n};\n\nlet liveRegion: HTMLElement | null = null;\n\nfunction ensureLiveRegion(): HTMLElement {\n if (liveRegion) {\n return liveRegion;\n }\n\n if (typeof document === 'undefined') {\n return null as unknown as HTMLElement;\n }\n\n const region = document.createElement('div');\n region.setAttribute('role', 'status');\n region.setAttribute('aria-live', 'polite');\n region.setAttribute('aria-atomic', 'true');\n region.style.cssText = 'position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0';\n document.body.appendChild(region);\n liveRegion = region;\n return region;\n}\n\nexport function defaultAnnounce(message: string): void {\n const region = ensureLiveRegion();\n\n if (!region) {\n return;\n }\n\n region.textContent = '';\n requestAnimationFrame(() => {\n region.textContent = message;\n });\n}\n\n/**\n * Generic keyboard-grab state machine. Maps Space/Enter/Escape/Arrow keys\n * onto grab/commit/cancel/move callbacks. The actual movement logic is\n * delegated to `onMove` since it depends on the host component's topology.\n */\nexport default function useKeyboardGrab<TPos>(options: UseKeyboardGrabOptions<TPos>): UseKeyboardGrabReturn {\n const origin = ref<TPos | null>(null);\n const announce = options.announce ?? defaultAnnounce;\n\n const isGrabbed = computed<boolean>(() => {\n const id = unref(options.itemId);\n const grabbed = unref(options.grabbedId);\n\n return id != null && grabbed === id;\n });\n\n function release(): void {\n origin.value = null;\n }\n\n function handleKeyDown(evt: KeyboardEvent): void {\n if (!unref(options.isDraggable)) {\n return;\n }\n\n const id = unref(options.itemId);\n\n if (id == null) {\n return;\n }\n\n if (!isGrabbed.value) {\n if (evt.key === ' ' || evt.key === 'Enter') {\n evt.preventDefault();\n origin.value = options.onGrab() as TPos;\n }\n\n return;\n }\n\n switch (evt.key) {\n case 'ArrowUp':\n evt.preventDefault();\n options.onMove('up');\n break;\n\n case 'ArrowDown':\n evt.preventDefault();\n options.onMove('down');\n break;\n\n case 'ArrowLeft':\n evt.preventDefault();\n options.onMove('left');\n break;\n\n case 'ArrowRight':\n evt.preventDefault();\n options.onMove('right');\n break;\n\n case ' ':\n case 'Enter': {\n evt.preventDefault();\n const o = origin.value;\n origin.value = null;\n\n if (o !== null) {\n options.onCommit(o);\n }\n\n break;\n }\n\n case 'Escape': {\n evt.preventDefault();\n const o = origin.value;\n origin.value = null;\n\n if (o !== null) {\n options.onCancel(o);\n }\n\n break;\n }\n }\n\n // Suppress unused-warning when announce is unused inside the function.\n void announce;\n }\n\n return {\n isGrabbed,\n handleKeyDown,\n release\n };\n}\n","import { watch } from 'vue';\nimport type { TemplateRef } from '../util';\n\nexport default function <K extends keyof HTMLElementEventMap>(elementRef: TemplateRef<HTMLElement>, eventName: K, listener: (evt: HTMLElementEventMap[K]) => any, options: AddEventListenerOptions = {passive: true}): void {\n watch(elementRef, (element: HTMLElement, _, onCleanup) => {\n if (!element) {\n return;\n }\n\n element.addEventListener(eventName, listener, options);\n\n onCleanup(() => element.removeEventListener(eventName, listener));\n }, {immediate: true});\n}\n","import { ref, type Ref, watch } from 'vue';\nimport { type TemplateRef, unrefTemplateElement } from '../util';\n\nexport default function <TElement extends HTMLElement>(containerRef: TemplateRef<TElement>, options: UseInViewOptions = {}): Ref<boolean> {\n const inView = ref(options.initial ?? false);\n\n watch(containerRef, (_, __, onCleanup) => {\n const container = unrefTemplateElement(containerRef);\n\n if (!container) {\n return;\n }\n\n const observer = new IntersectionObserver(entries => inView.value = entries[0]?.isIntersecting ?? false, options);\n observer.observe(container);\n\n onCleanup(() => observer.disconnect());\n }, {immediate: true});\n\n return inView;\n}\n\ntype UseInViewOptions = IntersectionObserverInit & {\n readonly initial?: boolean;\n};\n","import { DateTime } from 'luxon';\nimport { ref, type Ref, watch } from 'vue';\n\nexport default function <T>(key: string, initialValue: T): Ref<T> {\n const realKey = `flux/${key}`;\n const value = ref<T>(get() ?? initialValue);\n\n function get(): T | null {\n if (realKey in localStorage) {\n let storageValue = JSON.parse(localStorage.getItem(realKey)!);\n\n if (Array.isArray(storageValue) && storageValue[0] === 'DateTime') {\n storageValue = DateTime.fromISO(storageValue[1]);\n }\n\n return storageValue;\n }\n\n return null;\n }\n\n watch(value, value => {\n let _value: T = value as T;\n\n if (DateTime.isDateTime(value)) {\n _value = ['DateTime', value.toISO({\n includeOffset: true,\n extendedZone: true\n })] as unknown as T;\n }\n\n localStorage.setItem(realKey, JSON.stringify(_value));\n });\n\n return value as Ref<T>;\n}\n","import { ref, type Ref, watch } from 'vue';\nimport { type TemplateRef, unrefTemplateElement } from '../util';\n\nexport default function <TElement extends HTMLElement>(elementRef: TemplateRef<TElement>): UseScrollEdgesReturn {\n const isAtStart = ref(true);\n const isAtEnd = ref(true);\n\n watch(elementRef, (_, __, onCleanup) => {\n const element = unrefTemplateElement(elementRef);\n\n if (!element) {\n return;\n }\n\n const update = (): void => {\n const {scrollTop, scrollHeight, clientHeight} = element;\n\n isAtStart.value = scrollTop <= 0;\n isAtEnd.value = Math.ceil(scrollTop + clientHeight) >= scrollHeight;\n };\n\n const resizeObserver = new ResizeObserver(update);\n resizeObserver.observe(element);\n\n for (const child of Array.from(element.children)) {\n resizeObserver.observe(child);\n }\n\n const mutationObserver = new MutationObserver(mutations => {\n for (const mutation of mutations) {\n for (const node of Array.from(mutation.addedNodes)) {\n if (node instanceof Element) {\n resizeObserver.observe(node);\n }\n }\n\n for (const node of Array.from(mutation.removedNodes)) {\n if (node instanceof Element) {\n resizeObserver.unobserve(node);\n }\n }\n }\n\n update();\n });\n\n mutationObserver.observe(element, {childList: true});\n element.addEventListener('scroll', update, {passive: true});\n\n update();\n\n onCleanup(() => {\n element.removeEventListener('scroll', update);\n resizeObserver.disconnect();\n mutationObserver.disconnect();\n });\n }, {immediate: true});\n\n return {\n isAtStart,\n isAtEnd\n };\n}\n\nexport type UseScrollEdgesReturn = {\n readonly isAtStart: Ref<boolean>;\n readonly isAtEnd: Ref<boolean>;\n};\n","import { ref, type Ref, unref } from 'vue';\nimport type { TemplateRef } from '../util';\nimport useEventListener from './useEventListener';\n\nexport default function <TElement extends HTMLElement>(elementRef?: TemplateRef<TElement>): UseScrollPositionReturn {\n const x = ref(0);\n const y = ref(0);\n\n if (!elementRef) {\n elementRef = ref(document);\n }\n\n useEventListener(elementRef, 'scroll', () => {\n let element = unref(elementRef);\n\n if (element instanceof Document) {\n element = element.scrollingElement;\n }\n\n x.value = element?.scrollLeft ?? 0;\n y.value = element?.scrollTop ?? 0;\n });\n\n return {\n x,\n y\n };\n}\n\nexport type UseScrollPositionReturn = {\n readonly x: Ref<number>;\n readonly y: Ref<number>;\n};\n","import { onMounted, onUnmounted, ref, type Ref, unref } from 'vue';\nimport { FOCUS_TRAP_LOCKS } from '../util';\n\nlet lockId = 0;\n\nexport default function (autoFocus: boolean = false): Ref<boolean> {\n const id = ref(`focus-trap-${++lockId}`);\n const enabled = ref(false);\n\n onMounted(() => FOCUS_TRAP_LOCKS.add(unref(id), isEnabled => enabled.value = isEnabled, autoFocus));\n onUnmounted(() => FOCUS_TRAP_LOCKS.remove(unref(id)));\n\n return enabled;\n}\n","import { type Ref, unref, watch } from 'vue';\nimport { type TemplateRef, unrefTemplateElement } from '../util';\n\nexport default function (containerRef: TemplateRef<HTMLElement>, disabled: Ref<boolean>): void {\n watch(containerRef, (_, __, onCleanup) => {\n const container = unrefTemplateElement(containerRef);\n\n if (!container || unref(disabled)) {\n return;\n }\n\n const previousTarget = document.activeElement as HTMLElement | null;\n\n onCleanup(() => {\n requestAnimationFrame(() => previousTarget?.focus());\n });\n });\n}\n","import { ref, type Ref, watch } from 'vue';\nimport { getFocusableElements, isSSR, type TemplateRef, unrefTemplateElement, wrapFocus } from '../util';\nimport useFocusTrapLock from './useFocusTrapLock';\nimport useFocusTrapReturn from './useFocusTrapReturn';\n\nexport default function (containerRef: TemplateRef<HTMLElement>, options: UseFocusTrapOptions = {}): void {\n if (isSSR) {\n return;\n }\n\n const {disable = ref(false), disableReturn = ref(false), attachTo = null} = options;\n const enabled = useFocusTrapLock(!disable);\n\n useFocusTrapReturn(containerRef, disableReturn);\n\n watch(containerRef, (_, __, onCleanup) => {\n const container = unrefTemplateElement(containerRef);\n const attach = attachTo || document;\n\n if (enabled.value && container && document.activeElement && !container.contains(document.activeElement) && !container.querySelector('[autofocus]')) {\n wrapFocus(container, document.activeElement, true);\n }\n\n function onFocusIn(evt: FocusEvent): void {\n if (!enabled.value || !container) {\n return;\n }\n\n const newFocusElement = (evt.target as HTMLElement | null) || document.body;\n\n if (container.contains(newFocusElement)) {\n return;\n }\n\n evt.preventDefault();\n evt.stopImmediatePropagation();\n\n wrapFocus(container, newFocusElement);\n }\n\n function onFocusOut(evt: FocusEvent): void {\n if (!enabled.value || !container) {\n return;\n }\n\n if (!evt.relatedTarget || evt.relatedTarget === document.body) {\n evt.preventDefault();\n container.focus();\n }\n\n const newFocusElement = (evt.target as HTMLElement | null) || document.body;\n\n if (container.contains(newFocusElement)) {\n return;\n }\n\n wrapFocus(container, newFocusElement);\n }\n\n attach.addEventListener('focusin', onFocusIn as EventListener, {capture: true});\n attach.addEventListener('focusout', onFocusOut as EventListener, {capture: true});\n\n if (container) {\n const elements = getFocusableElements(container);\n const isActiveIndex = elements.findIndex(e => e.classList.contains('is-active'));\n const notDisabledIndex = elements.findIndex(e => !e.hasAttribute('aria-disabled'));\n let element = elements[0];\n\n if (isActiveIndex > -1) {\n element = elements[isActiveIndex];\n }\n\n if (notDisabledIndex > -1) {\n element = elements[notDisabledIndex];\n }\n\n if (element) {\n element.focus();\n }\n }\n\n onCleanup(() => {\n attach.removeEventListener('focusin', onFocusIn as EventListener);\n attach.removeEventListener('focusout', onFocusOut as EventListener);\n });\n }, {immediate: true});\n\n watch(() => disable, () => {\n const container = unrefTemplateElement(containerRef);\n enabled.value = !disable;\n\n if (disable || !container) {\n return;\n }\n\n const elements = getFocusableElements(container as HTMLElement);\n\n if (elements.includes(document.activeElement as HTMLElement)) {\n return;\n }\n\n elements[0]?.focus();\n }, {immediate: true});\n}\n\ntype UseFocusTrapOptions = {\n attachTo?: HTMLElement | Document;\n disable?: Ref<boolean>;\n disableReturn?: Ref<boolean>;\n};\n","import { onMounted, onUnmounted, ref } from 'vue';\nimport { FOCUS_TRAP_LOCKS, type FocusTrapListener } from '../util';\n\nexport default function (listener: FocusTrapListener): void {\n const unsubscribe = ref<Function | null>(null);\n\n onMounted(() => unsubscribe.value = FOCUS_TRAP_LOCKS.subscribe(listener));\n onUnmounted(() => unsubscribe.value?.());\n}\n","import { unwrapElement, useMutationObserver } from '@basmilius/common';\nimport { type ComponentPublicInstance, type Ref, watch } from 'vue';\nimport { getBidirectionalFocusElement, getFocusableElement, getFocusableElements } from '../util';\n\ntype EligibleElement = ComponentPublicInstance | HTMLElement;\n\nexport default function <TElement extends EligibleElement>(containerRef: Ref<TElement>, {cycle = true, direction = 'bidirectional'}: UseFocusZoneOptions = {}): void {\n useMutationObserver(containerRef, () => updateFocus(findInitialIndex(), false));\n\n function findInitialIndex(): number {\n const container = unwrapElement(containerRef);\n const elements = getFocusableElements(container);\n const isActiveIndex = elements.findIndex(e => e.classList.contains('is-active'));\n const notDisabledIndex = elements.findIndex(e => !e.hasAttribute('aria-disabled'));\n\n if (isActiveIndex > -1) {\n return isActiveIndex;\n }\n\n if (notDisabledIndex > -1) {\n return notDisabledIndex;\n }\n\n return 0;\n }\n\n function updateFocus(elementIndex: number, doFocus: boolean = true): void {\n const container = unwrapElement(containerRef)!;\n const elements = getFocusableElements(container);\n elements.forEach((elm, index) => elm.tabIndex = index === elementIndex ? 0 : -1);\n\n doFocus && elements[elementIndex]?.focus();\n }\n\n function onKeyDown(evt: KeyboardEvent): void {\n const container = unwrapElement(containerRef)!;\n const elements = getFocusableElements(container);\n\n if (['Enter', ' '].includes(evt.key)) {\n return;\n }\n\n switch (direction) {\n case 'bidirectional':\n handleBidirectionalFocus(evt, container, elements, updateFocus);\n break;\n\n case 'horizontal':\n case 'vertical':\n handleDirectionalFocus(evt, container, cycle, direction, elements, updateFocus);\n break;\n }\n }\n\n watch(containerRef, (_, __, onCleanup) => {\n const container = unwrapElement(containerRef);\n\n if (!container) {\n return;\n }\n\n container.addEventListener('keydown', onKeyDown);\n\n updateFocus(findInitialIndex(), false);\n\n onCleanup(() => container.removeEventListener('keydown', onKeyDown));\n }, {immediate: true});\n}\n\nfunction handleBidirectionalFocus(evt: KeyboardEvent, container: HTMLElement, elements: HTMLElement[], updateFocus: (index: number) => void): void {\n let dir: 'up' | 'down' | 'left' | 'right';\n\n switch (evt.key) {\n case 'ArrowUp':\n dir = 'up';\n break;\n\n case 'ArrowDown':\n dir = 'down';\n break;\n\n case 'ArrowLeft':\n dir = 'left';\n break;\n\n case 'ArrowRight':\n dir = 'right';\n break;\n\n default:\n return;\n }\n\n const element = getBidirectionalFocusElement(container, document.activeElement as HTMLElement, dir);\n\n if (element) {\n updateFocus(elements.indexOf(element));\n }\n\n evt.preventDefault();\n}\n\nfunction handleDirectionalFocus(evt: KeyboardEvent, container: HTMLElement, cycle: boolean, direction: 'horizontal' | 'vertical', elements: HTMLElement[], updateFocus: (index: number) => void): void {\n let dir: number;\n\n if (evt.key === (direction === 'horizontal' ? 'ArrowLeft' : 'ArrowUp')) {\n dir = -1;\n } else if (evt.key === (direction === 'horizontal' ? 'ArrowRight' : 'ArrowDown')) {\n dir = 1;\n } else {\n return;\n }\n\n const element = getFocusableElement(container, dir);\n\n if (element) {\n updateFocus(elements.indexOf(element));\n } else if (cycle) {\n updateFocus(dir === 1 ? 0 : elements.length - 1);\n }\n\n evt.preventDefault();\n}\n\ntype UseFocusZoneOptions = {\n readonly cycle?: boolean;\n readonly direction?: 'bidirectional' | 'horizontal' | 'vertical';\n};\n"],"mappings":"wSAGA,SAAA,EAAyB,EAAuB,EAAiD,CAC7F,IAAM,EAAwB,EAAI,GAAM,CAClC,EAAW,EAAI,EAAY,CAE3B,EAAQ,MAA2B,CACrC,IAAM,EAAoB,EAAE,CACtB,EAAQ,EAAM,EAAS,CAAC,MAC1B,EAAU,EAAM,EAAS,CAAC,QAAQ,QAAQ,CAE9C,GACI,EAAM,KAAK,EAAQ,CACnB,EAAU,EAAQ,KAAK,CAAC,IAAK,EAAE,CAAC,OAC3B,EAAQ,QAAU,GAE3B,IAAM,EAAQ,EAAM,GACd,EAAO,EAAM,EAAM,OAAS,GAElC,IAAK,IAAI,EAAI,EAAG,EAAI,EAAM,QAAS,EAAE,EACjC,EAAM,QAAQ,EAAM,MAAM,CAAC,IAAK,EAAE,CAAC,CAAC,CAGxC,IAAK,IAAI,EAAI,EAAK,QAAU,EAAG,GAAK,EAAG,EAAE,EACrC,EAAM,KAAK,EAAK,KAAK,CAAC,IAAK,EAAI,EAAK,QAAQ,CAAC,CAAC,CAGlD,KAAO,EAAM,OAAS,EAAI,GAAG,CACzB,IAAM,EAAO,EAAM,EAAM,OAAS,GAElC,IAAK,IAAI,EAAI,EAAG,GAAK,EAAG,EAAE,EACtB,EAAM,KAAK,EAAK,KAAK,CAAC,IAAK,EAAE,CAAC,CAAC,CAIvC,OAAO,GACT,CAEI,EAAO,MAAe,EAAM,EAAM,CACnC,MAAM,EAAG,EAAE,CACX,IAAI,GAAK,EAAE,eAAe,CAAC,QAAS,GAAS,eAAiB,QAAQ,CAAC,CAAC,CA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yB,EAAK,EAAW,EAAU,EAAY,CAC/D,MAEJ,IAAK,aACL,IAAK,WACD,EAAuB,EAAK,EAAW,EAAO,EAAW,EAAU,EAAY,CAC/E,OAIZ,EAAM,GAAe,EAAG,EAAI,IAAc,CACtC,IAAM,EAAY,EAAc,EAAa,CAExC,IAIL,EAAU,iBAAiB,UAAW,EAAU,CAEhD,EAAY,GAAkB,CAAE,GAAM,CAEtC,MAAgB,EAAU,oBAAoB,UAAW,EAAU,CAAC,GACrE,CAAC,UAAW,GAAK,CAAC,CAGzB,SAAS,EAAyB,EAAoB,EAAwB,EAAyB,EAA4C,CAC/I,IAAI,EAEJ,OAAQ,EAAI,IAAZ,CACI,IAAK,UACD,EAAM,KACN,MAEJ,IAAK,YACD,EAAM,OACN,MAEJ,IAAK,YACD,EAAM,OACN,MAEJ,IAAK,aACD,EAAM,QACN,MAEJ,QACI,OAGR,IAAM,EAAUC,EAA6B,EAAW,SAAS,cAA8B,EAAI,CAE/F,GACA,EAAY,EAAS,QAAQ,EAAQ,CAAC,CAG1C,EAAI,gBAAgB,CAGxB,SAAS,EAAuB,EAAoB,EAAwB,EAAgB,EAAsC,EAAyB,EAA4C,CACnM,IAAI,EAEJ,GAAI,EAAI,OAAS,IAAc,aAAe,YAAc,WACxD,EAAM,WACC,EAAI,OAAS,IAAc,aAAe,aAAe,aAChE,EAAM,OAEN,OAGJ,IAAM,EAAUC,EAAoB,EAAW,EAAI,CAE/C,EACA,EAAY,EAAS,QAAQ,EAAQ,CAAC,CAC/B,GACP,EAAY,IAAQ,EAAI,EAAI,EAAS,OAAS,EAAE,CAGpD,EAAI,gBAAgB"}
@@ -1,9 +1,9 @@
1
1
  import { n as FocusTrapListener, s as TemplateRef } from "./index-B79OP5Th.js";
2
- import { ComponentPublicInstance, Ref } from "vue";
2
+ import { ComponentPublicInstance, ComputedRef, MaybeRefOrGetter, Ref } from "vue";
3
3
  import { DateTime } from "luxon";
4
4
 
5
5
  //#region src/composable/useCalendar.d.ts
6
- declare function export_default$12(initialDate: DateTime, options?: UseCalendarOptions): UseCalendarReturn;
6
+ declare function export_default$13(initialDate: DateTime, options?: UseCalendarOptions): UseCalendarReturn;
7
7
  type UseCalendarOptions = {
8
8
  readonly monthLength?: "short" | "long";
9
9
  readonly weekDayLength?: "short" | "long";
@@ -23,7 +23,7 @@ type UseCalendarReturn = {
23
23
  };
24
24
  //#endregion
25
25
  //#region src/composable/useCalendarMonthSwitcher.d.ts
26
- declare function export_default$11(currentDate: Ref<DateTime>, displayLength: "short" | "long"): UseCalendarMonthSwitcherReturn;
26
+ declare function export_default$12(currentDate: Ref<DateTime>, displayLength: "short" | "long"): UseCalendarMonthSwitcherReturn;
27
27
  type MonthEntry = {
28
28
  readonly date: DateTime;
29
29
  readonly label: string;
@@ -32,6 +32,19 @@ type UseCalendarMonthSwitcherReturn = {
32
32
  readonly months: Ref<MonthEntry[]>;
33
33
  };
34
34
  //#endregion
35
+ //#region src/composable/useCalendarTimeGrid.d.ts
36
+ type UseCalendarTimeGridDayCount = 1 | 2 | 7;
37
+ type UseCalendarTimeGridReturn = {
38
+ readonly isTransitioningToPast: Ref<boolean>;
39
+ readonly viewDate: Ref<DateTime>;
40
+ readonly viewDates: ComputedRef<DateTime[]>;
41
+ readonly rangeLabel: ComputedRef<string>;
42
+ setViewDate(date: DateTime): void;
43
+ next(): void;
44
+ previous(): void;
45
+ };
46
+ declare function export_default$11(initialDate: DateTime, dayCount: MaybeRefOrGetter<UseCalendarTimeGridDayCount>): UseCalendarTimeGridReturn;
47
+ //#endregion
35
48
  //#region src/composable/useCalendarYearSwitcher.d.ts
36
49
  declare function export_default$10(currentDate: Ref<DateTime>, limit?: number): UseCalendarYearSwitcherReturn;
37
50
  type UseCalendarYearSwitcherReturn = {
@@ -40,6 +53,31 @@ type UseCalendarYearSwitcherReturn = {
40
53
  previous(): void;
41
54
  };
42
55
  //#endregion
56
+ //#region src/composable/useKeyboardGrab.d.ts
57
+ type KeyboardGrabDirection = "up" | "down" | "left" | "right";
58
+ type UseKeyboardGrabOptions<TPos> = {
59
+ readonly isDraggable: Ref<boolean>;
60
+ readonly itemId: Ref<string | number | null | undefined>;
61
+ readonly grabbedId: Ref<string | number | null>;
62
+ onGrab(): TPos;
63
+ onMove(direction: KeyboardGrabDirection): void;
64
+ onCommit(origin: TPos): void;
65
+ onCancel(origin: TPos): void;
66
+ announce?(message: string): void;
67
+ };
68
+ type UseKeyboardGrabReturn = {
69
+ readonly isGrabbed: ComputedRef<boolean>;
70
+ handleKeyDown(evt: KeyboardEvent): void;
71
+ release(): void;
72
+ };
73
+ declare function defaultAnnounce(message: string): void;
74
+ /**
75
+ * Generic keyboard-grab state machine. Maps Space/Enter/Escape/Arrow keys
76
+ * onto grab/commit/cancel/move callbacks. The actual movement logic is
77
+ * delegated to `onMove` since it depends on the host component's topology.
78
+ */
79
+ declare function useKeyboardGrab<TPos>(options: UseKeyboardGrabOptions<TPos>): UseKeyboardGrabReturn;
80
+ //#endregion
43
81
  //#region src/composable/useEventListener.d.ts
44
82
  declare function export_default$9<K extends keyof HTMLElementEventMap>(elementRef: TemplateRef<HTMLElement>, eventName: K, listener: (evt: HTMLElementEventMap[K]) => any, options?: AddEventListenerOptions): void;
45
83
  //#endregion
@@ -94,5 +132,5 @@ type UseFocusZoneOptions = {
94
132
  readonly direction?: "bidirectional" | "horizontal" | "vertical";
95
133
  };
96
134
  //#endregion
97
- export { export_default$4 as a, export_default$7 as c, export_default$10 as d, export_default$11 as f, export_default$3 as i, export_default$8 as l, export_default$1 as n, export_default$5 as o, export_default$12 as p, export_default$2 as r, export_default$6 as s, export_default as t, export_default$9 as u };
98
- //# sourceMappingURL=index-BhkFHXuX.d.ts.map
135
+ export { export_default$4 as a, export_default$7 as c, defaultAnnounce as d, useKeyboardGrab as f, export_default$13 as g, export_default$12 as h, export_default$3 as i, export_default$8 as l, export_default$11 as m, export_default$1 as n, export_default$5 as o, export_default$10 as p, export_default$2 as r, export_default$6 as s, export_default as t, export_default$9 as u };
136
+ //# sourceMappingURL=index-4qwf2pQQ.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-4qwf2pQQ.d.ts","names":[],"sources":["../src/composable/useCalendar.ts","../src/composable/useCalendarMonthSwitcher.ts","../src/composable/useCalendarTimeGrid.ts","../src/composable/useCalendarYearSwitcher.ts","../src/composable/useKeyboardGrab.ts","../src/composable/useEventListener.ts","../src/composable/useInView.ts","../src/composable/useRemembered.ts","../src/composable/useScrollEdges.ts","../src/composable/useScrollPosition.ts","../src/composable/useFocusTrap.ts","../src/composable/useFocusTrapLock.ts","../src/composable/useFocusTrapReturn.ts","../src/composable/useFocusTrapSubscription.ts","../src/composable/useFocusZone.ts"],"mappings":";;;;;iBAC+C,iBAAA,CAEtB,WAAA,EAAa,QAAA,EAAU,OAAA,GAAU,kBAAA,GAAqB,iBAAA;AAAA,KAyE1E,kBAAA;EAAA,SACQ,WAAA;EAAA,SACA,aAAA;AAAA;AAAA,KAGR,iBAAA;EAAA,SACQ,qBAAA,EAAuB,GAAA;EAAA,SACvB,QAAA,EAAU,GAAA,CAAI,QAAA;EAAA,SACd,YAAA,EAAc,GAAA,CAAI,QAAA;EAAA,SAClB,gBAAA,EAAkB,GAAA,CAAI,QAAA;EAAA,SACtB,SAAA,EAAW,GAAA;EAAA,SACX,QAAA,EAAU,GAAA;EAAA,SACV,KAAA,EAAO,GAAA,CAAI,QAAA;EAAA,SACX,IAAA,EAAM,GAAA;EAEf,WAAA,CAAY,IAAA,EAAM,QAAA;EAClB,SAAA;EACA,aAAA;AAAA;;;iBC5FsC,iBAAA,CAEjB,WAAA,EAAa,GAAA,CAAI,QAAA,GAAW,aAAA,qBAAkC,8BAAA;AAAA,KAsBlF,UAAA;EAAA,SACQ,IAAA,EAAM,QAAA;EAAA,SACN,KAAA;AAAA;AAAA,KAGR,8BAAA;EAAA,SACQ,MAAA,EAAQ,GAAA,CAAI,UAAA;AAAA;;;KC5Bb,2BAAA;AAAA,KAEA,yBAAA;EAAA,SACC,qBA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AA,GAAwB,GAAA;AAAA,KAmBxH,gBAAA,GAAmB,wBAAA;EAAA,SACX,OAAA;AAAA;;;iBCtBwB,gBAAA,GAAA,CAET,GAAA,UAAa,YAAA,EAAc,CAAA,GAAI,GAAA,CAAI,CAAA;;;iBCFR,gBAAA,kBAEb,WAAA,CAAA,CAAa,UAAA,EAAY,WAAA,CAAY,QAAA,IAAY,oBAAA;AAAA,KA6D/E,oBAAA;EAAA,SACC,SAAA,EAAW,GAAA;EAAA,SACX,OAAA,EAAS,GAAA;AAAA;;;iBCjEW,gBAAA,kBAGS,WAAA,CAAA,CAAa,UAAA,GAAa,WAAA,CAAY,QAAA,IAAY,uBAAA;AAAA,KAyBhF,uBAAA;EAAA,SACC,CAAA,EAAG,GAAA;EAAA,SACH,CAAA,EAAG,GAAA;AAAA;;;iBC9B+E,gBAAA,CAItE,YAAA,EAAc,WAAA,CAAY,WAAA,GAAc,OAAA,GAAS,mBAAA;AAAA,KAoGrE,mBAAA;EACD,QAAA,GAAW,WAAA,GAAc,QAAA;EACzB,OAAA,GAAU,GAAA;EACV,aAAA,GAAgB,GAAA;AAAA;;;iBC5GyC,gBAAA,CAKpC,SAAA,aAA6B,GAAA;;;iBCJC,gBAAA,CAE9B,YAAA,EAAc,WAAA,CAAY,WAAA,GAAc,QAAA,EAAU,GAAA;;;iBCFlB,gBAAA,CAEhC,QAAA,EAAU,iBAAA;;;KCC9B,eAAA,GAAkB,uBAAA,GAA0B,WAAA;AAAA,iBAAA,cAAA,kBAEP,eAAA,CAAA,CAAiB,YAAA,EAAc,GAAA,CAAI,QAAA;EAAY,KAAA;EAAc;AAAA,IAA8B,mBAAA;AAAA,KAsHhI,mBAAA;EAAA,SACQ,KAAA;EAAA,SACA,SAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index-B79OP5Th.d.ts","names":[],"sources":["../src/util/animationFrameDebounce.ts","../src/util/flattenVNodeTree.ts","../src/util/getBidirectionalFocusElement.ts","../src/util/getComponentName.ts","../src/util/getComponentProps.ts","../src/util/getExposedRef.ts","../src/util/getFocusableElement.ts","../src/util/getFocusableElements.ts","../src/util/getKeyboardFocusableElements.ts","../src/util/unrefTemplateElement.ts","../src/util/warn.ts","../src/util/wrapFocus.ts","../src/util/focusTrap.ts","../src/util/index.ts"],"mappings":";;;;iBAAsC,iBAAA,iBAEG,gBAAA,OAAA,CAAwB,EAAA,EAAI,CAAA,GAAI,CAAA;;;iBCF9C,iBAAA,CAGF,MAAA,EAAQ,KAAA,KAAU,KAAA;;;kCCDlB,SAAA,EAAW,WAAA,EAAa,cAAA,EAAgB,WAAA,EAAa,SAAA,qCAA8C,WAAA;;;iBCFjG,gBAAA,CAEF,SAAA,EAAW,aAAA;AAAA,KAU/B,aAAA;EAAA,SACQ,IAAA,EAAM,KAAA;IAAA,SACF,MAAA;EAAA;AAAA;;;oDCZ0B,SAAA,QAAiB,CAAA;;;iBCFR,gBAAA,GAAA,CAExB,QAAA,EAAU,yBAAA,EAA2B,GAAA,WAAc,GAAA,CAAI,CAAA;;;kCCC1D,SAAA,EAAW,WAAA,EAAa,SAAA,UAAmB,aAAA,GAAe,WAAA,eAAsC,WAAA;;;kCCQhG,SAAA,EAAW,WAAA,GAAc,WAAA;;;kCCXzB,IAAA,EAAM,WAAA,GAAc,WAAA;;;KCGjC,eAAA,kBAAiC,WAAA,IAAe,uBAAA,uEAA8F,QAAA,IAAY,QAAA;AAAA,KAC1J,WAAA,kBAA6B,WAAA,IAAe,QAAA,CAAS,UAAA,CAAW,eAAA,CAAgB,QAAA;AAAA,iBAAA,gBAAA,WAEzD,WAAA,CAAA,CAAa,GAAA,EAAK,WAAA,CAAY,CAAA,IAAK,CAAA;;;qCCN1C,IAAA;;;gCCAH,GAAA,EAAK,WAAA,EAAa,SAAA,EAAW,OAAA,EAAS,UAAA;;;cCAzD,kBAAA;EAAA;MACE,MAAA,CAAA;EAAA,IAIA,OAAA,CAAA,GAAW,SAAA;EAOf,GAAA,CAAI,EAAA,EAAI,SAAA,QAAiB,UAAA,EAAY,SAAA,gBAAyB,SAAA;EAW9D,MAAA,CAAO,EAAA,EAAI,SAAA;EAYX,IAAA,CAAA;EAIA,SAAA,CAAU,QAAA,EAAU,iBAAA;EAOpB,MAAA,CAAO,IAAA,EAAM,SAAA,EAAW,SAAA;AAAA;AAAA,UAMlB,SAAA;EACN,EAAA;EACA,SAAA;EAEA,UAAA,CAAW,SAAA;AAAA;AAAA,KAGH,iBAAA,IAAqB,SAAA,WAAoB,UAAA,EAAY,SAAA;AAAA,cAE3D,QAAA,EAAU,kBAAA;;;cC9CH,KAAA"}
1
+ {"version":3,"file":"index-B79OP5Th.d.ts","names":[],"sources":["../src/util/animationFrameDebounce.ts","../src/util/flattenVNodeTree.ts","../src/util/getBidirectionalFocusElement.ts","../src/util/getComponentName.ts","../src/util/getComponentProps.ts","../src/util/getExposedRef.ts","../src/util/getFocusableElement.ts","../src/util/getFocusableElements.ts","../src/util/getKeyboardFocusableElements.ts","../src/util/unrefTemplateElement.ts","../src/util/warn.ts","../src/util/wrapFocus.ts","../src/util/focusTrap.ts","../src/util/index.ts"],"mappings":";;;;iBAAsC,iBAAA,iBAEG,gBAAA,OAAA,CAAwB,EAAA,EAAI,CAAA,GAAI,CAAA;;;iBCFpC,iBAAA,CAEZ,MAAA,EAAQ,KAAA,KAAU,KAAA;;;kCCAlB,SAAA,EAAW,WAAA,EAAa,cAAA,EAAgB,WAAA,EAAa,SAAA,qCAA8C,WAAA;;;iBCFjG,gBAAA,CAEF,SAAA,EAAW,aAAA;AAAA,KAU/B,aAAA;EAAA,SACQ,IAAA,EAAM,KAAA;IAAA,SACF,MAAA;EAAA;AAAA;;;oDCZ0B,SAAA,QAAiB,CAAA;;;iBCFR,gBAAA,GAAA,CAExB,QAAA,EAAU,yBAAA,EAA2B,GAAA,WAAc,GAAA,CAAI,CAAA;;;kCCC1D,SAAA,EAAW,WAAA,EAAa,SAAA,UAAmB,aAAA,GAAe,WAAA,eAAsC,WAAA;;;kCCQhG,SAAA,EAAW,WAAA,GAAc,WAAA;;;kCCXzB,IAAA,EAAM,WAAA,GAAc,WAAA;;;KCGjC,eAAA,kBAAiC,WAAA,IAAe,uBAAA,uEAA8F,QAAA,IAAY,QAAA;AAAA,KAC1J,WAAA,kBAA6B,WAAA,IAAe,QAAA,CAAS,UAAA,CAAW,eAAA,CAAgB,QAAA;AAAA,iBAAA,gBAAA,WAEzD,WAAA,CAAA,CAAa,GAAA,EAAK,WAAA,CAAY,CAAA,IAAK,CAAA;;;qCCN1C,IAAA;;;gCCAH,GAAA,EAAK,WAAA,EAAa,SAAA,EAAW,OAAA,EAAS,UAAA;;;cCAzD,kBAAA;EAAA;MACE,MAAA,CAAA;EAAA,IAIA,OAAA,CAAA,GAAW,SAAA;EAOf,GAAA,CAAI,EAAA,EAAI,SAAA,QAAiB,UAAA,EAAY,SAAA,gBAAyB,SAAA;EAW9D,MAAA,CAAO,EAAA,EAAI,SAAA;EAYX,IAAA,CAAA;EAIA,SAAA,CAAU,QAAA,EAAU,iBAAA;EAOpB,MAAA,CAAO,IAAA,EAAM,SAAA,EAAW,SAAA;AAAA;AAAA,UAMlB,SAAA;EACN,EAAA;EACA,SAAA;EAEA,UAAA,CAAW,SAAA;AAAA;AAAA,KAGH,iBAAA,IAAqB,SAAA,WAAoB,UAAA,EAAY,SAAA;AAAA,cAE3D,QAAA,EAAU,kBAAA;;;cC9CH,KAAA"}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { a as export_default$14, c as export_default$20, d as export_default$12, f as export_default$11, i as export_default$15, l as export_default$19, n as export_default$17, o as export_default$22, p as export_default$10, r as export_default$16, s as export_default$21, t as export_default$18, u as export_default$13 } from "./index-BhkFHXuX.js";
2
- import { _ as export_default, a as export_default$23, c as export_default$9, d as export_default$6, f as export_default$5, g as export_default$1, h as export_default$2, i as export_default$24, l as export_default$8, m as export_default$3, n as FocusTrapListener, o as TemplateElement, p as export_default$4, r as _default, s as TemplateRef, t as isSSR, u as export_default$7 } from "./index-B79OP5Th.js";
1
+ import { a as export_default$15, c as export_default$21, d as defaultAnnounce, f as useKeyboardGrab, g as export_default$10, h as export_default$11, i as export_default$16, l as export_default$20, m as export_default$12, n as export_default$18, o as export_default$23, p as export_default$13, r as export_default$17, s as export_default$22, t as export_default$19, u as export_default$14 } from "./index-4qwf2pQQ.js";
2
+ import { _ as export_default, a as export_default$24, c as export_default$9, d as export_default$6, f as export_default$5, g as export_default$1, h as export_default$2, i as export_default$25, l as export_default$8, m as export_default$3, n as FocusTrapListener, o as TemplateElement, p as export_default$4, r as _default, s as TemplateRef, t as isSSR, u as export_default$7 } from "./index-B79OP5Th.js";
3
3
  import { amber100, amber200, amber300, amber400, amber50, amber500, amber600, amber700, amber800, amber900, amber950, blue100, blue200, blue300, blue400, blue50, blue500, blue600, blue700, blue800, blue900, blue950, cyan100, cyan200, cyan300, cyan400, cyan50, cyan500, cyan600, cyan700, cyan800, cyan900, cyan950, emerald100, emerald200, emerald300, emerald400, emerald50, emerald500, emerald600, emerald700, emerald800, emerald900, emerald950, fuchsia100, fuchsia200, fuchsia300, fuchsia400, fuchsia50, fuchsia500, fuchsia600, fuchsia700, fuchsia800, fuchsia900, fuchsia950, gray100, gray200, gray300, gray400, gray50, gray500, gray600, gray700, gray800, gray900, gray950, green100, green200, green300, green400, green50, green500, green600, green700, green800, green900, green950, indigo100, indigo200, indigo300, indigo400, indigo50, indigo500, indigo600, indigo700, indigo800, indigo900, indigo950, lime100, lime200, lime300, lime400, lime50, lime500, lime600, lime700, lime800, lime900, lime950, neutral100, neutral200, neutral300, neutral400, neutral50, neutral500, neutral600, neutral700, neutral800, neutral900, neutral950, orange100, orange200, orange300, orange400, orange50, orange500, orange600, orange700, orange800, orange900, orange950, pink100, pink200, pink300, pink400, pink50, pink500, pink600, pink700, pink800, pink900, pink950, purple100, purple200, purple300, purple400, purple50, purple500, purple600, purple700, purple800, purple900, purple950, red100, red200, red300, red400, red50, red500, red600, red700, red800, red900, red950, rose100, rose200, rose300, rose400, rose50, rose500, rose600, rose700, rose800, rose900, rose950, sky100, sky200, sky300, sky400, sky50, sky500, sky600, sky700, sky800, sky900, sky950, slate100, slate200, slate300, slate400, slate50, slate500, slate600, slate700, slate800, slate900, slate950, stone100, stone200, stone300, stone400, stone50, stone500, stone600, stone700, stone800, stone900, stone950, teal100, teal200, teal300, teal400, teal50, teal500, teal600, teal700, teal800, teal900, teal950, violet100, violet200, violet300, violet400, violet50, violet500, violet600, violet700, violet800, violet900, violet950, yellow100, yellow200, yellow300, yellow400, yellow50, yellow500, yellow600, yellow700, yellow800, yellow900, yellow950, zinc100, zinc200, zinc300, zinc400, zinc50, zinc500, zinc600, zinc700, zinc800, zinc900, zinc950 } from "./data/index.js";
4
4
  import { n as _default$1, t as _default$2 } from "./index-BRS2s2tX.js";
5
- export { _default as FOCUS_TRAP_LOCKS, FocusTrapListener, TemplateElement, TemplateRef, amber100, amber200, amber300, amber400, amber50, amber500, amber600, amber700, amber800, amber900, amber950, export_default as animationFrameDebounce, blue100, blue200, blue300, blue400, blue50, blue500, blue600, blue700, blue800, blue900, blue950, cyan100, cyan200, cyan300, cyan400, cyan50, cyan500, cyan600, cyan700, cyan800, cyan900, cyan950, emerald100, emerald200, emerald300, emerald400, emerald50, emerald500, emerald600, emerald700, emerald800, emerald900, emerald950, export_default$1 as flattenVNodeTree, fuchsia100, fuchsia200, fuchsia300, fuchsia400, fuchsia50, fuchsia500, fuchsia600, fuchsia700, fuchsia800, fuchsia900, fuchsia950, export_default$2 as getBidirectionalFocusElement, export_default$3 as getComponentName, export_default$4 as getComponentProps, export_default$5 as getExposedRef, export_default$6 as getFocusableElement, export_default$7 as getFocusableElements, export_default$8 as getKeyboardFocusableElements, gray100, gray200, gray300, gray400, gray50, gray500, gray600, gray700, gray800, gray900, gray950, green100, green200, green300, green400, green50, green500, green600, green700, green800, green900, green950, indigo100, indigo200, indigo300, indigo400, indigo50, indigo500, indigo600, indigo700, indigo800, indigo900, indigo950, isSSR, lime100, lime200, lime300, lime400, lime50, lime500, lime600, lime700, lime800, lime900, lime950, neutral100, neutral200, neutral300, neutral400, neutral50, neutral500, neutral600, neutral700, neutral800, neutral900, neutral950, orange100, orange200, orange300, orange400, orange50, orange500, orange600, orange700, orange800, orange900, orange950, pink100, pink200, pink300, pink400, pink50, pink500, pink600, pink700, pink800, pink900, pink950, purple100, purple200, purple300, purple400, purple50, purple500, purple600, purple700, purple800, purple900, purple950, red100, red200, red300, red400, red50, red500, red600, red700, red800, red900, red950, rose100, rose200, rose300, rose400, rose50, rose500, rose600, rose700, rose800, rose900, rose950, sky100, sky200, sky300, sky400, sky50, sky500, sky600, sky700, sky800, sky900, sky950, slate100, slate200, slate300, slate400, slate50, slate500, slate600, slate700, slate800, slate900, slate950, stone100, stone200, stone300, stone400, stone50, stone500, stone600, stone700, stone800, stone900, stone950, teal100, teal200, teal300, teal400, teal50, teal500, teal600, teal700, teal800, teal900, teal950, export_default$9 as unrefTemplateElement, export_default$10 as useCalendar, export_default$11 as useCalendarMonthSwitcher, export_default$12 as useCalendarYearSwitcher, export_default$13 as useEventListener, export_default$14 as useFocusTrap, export_default$15 as useFocusTrapLock, export_default$16 as useFocusTrapReturn, export_default$17 as useFocusTrapSubscription, export_default$18 as useFocusZone, export_default$19 as useInView, export_default$20 as useRemembered, export_default$21 as useScrollEdges, export_default$22 as useScrollPosition, _default$1 as vFocusTrap, _default$2 as vHeightTransition, violet100, violet200, violet300, violet400, violet50, violet500, violet600, violet700, violet800, violet900, violet950, export_default$23 as warn, export_default$24 as wrapFocus, yellow100, yellow200, yellow300, yellow400, yellow50, yellow500, yellow600, yellow700, yellow800, yellow900, yellow950, zinc100, zinc200, zinc300, zinc400, zinc50, zinc500, zinc600, zinc700, zinc800, zinc900, zinc950 };
5
+ export { _default as FOCUS_TRAP_LOCKS, FocusTrapListener, TemplateElement, TemplateRef, amber100, amber200, amber300, amber400, amber50, amber500, amber600, amber700, amber800, amber900, amber950, export_default as animationFrameDebounce, blue100, blue200, blue300, blue400, blue50, blue500, blue600, blue700, blue800, blue900, blue950, cyan100, cyan200, cyan300, cyan400, cyan50, cyan500, cyan600, cyan700, cyan800, cyan900, cyan950, defaultAnnounce as defaultKeyboardGrabAnnounce, emerald100, emerald200, emerald300, emerald400, emerald50, emerald500, emerald600, emerald700, emerald800, emerald900, emerald950, export_default$1 as flattenVNodeTree, fuchsia100, fuchsia200, fuchsia300, fuchsia400, fuchsia50, fuchsia500, fuchsia600, fuchsia700, fuchsia800, fuchsia900, fuchsia950, export_default$2 as getBidirectionalFocusElement, export_default$3 as getComponentName, export_default$4 as getComponentProps, export_default$5 as getExposedRef, export_default$6 as getFocusableElement, export_default$7 as getFocusableElements, export_default$8 as getKeyboardFocusableElements, gray100, gray200, gray300, gray400, gray50, gray500, gray600, gray700, gray800, gray900, gray950, green100, green200, green300, green400, green50, green500, green600, green700, green800, green900, green950, indigo100, indigo200, indigo300, indigo400, indigo50, indigo500, indigo600, indigo700, indigo800, indigo900, indigo950, isSSR, lime100, lime200, lime300, lime400, lime50, lime500, lime600, lime700, lime800, lime900, lime950, neutral100, neutral200, neutral300, neutral400, neutral50, neutral500, neutral600, neutral700, neutral800, neutral900, neutral950, orange100, orange200, orange300, orange400, orange50, orange500, orange600, orange700, orange800, orange900, orange950, pink100, pink200, pink300, pink400, pink50, pink500, pink600, pink700, pink800, pink900, pink950, purple100, purple200, purple300, purple400, purple50, purple500, purple600, purple700, purple800, purple900, purple950, red100, red200, red300, red400, red50, red500, red600, red700, red800, red900, red950, rose100, rose200, rose300, rose400, rose50, rose500, rose600, rose700, rose800, rose900, rose950, sky100, sky200, sky300, sky400, sky50, sky500, sky600, sky700, sky800, sky900, sky950, slate100, slate200, slate300, slate400, slate50, slate500, slate600, slate700, slate800, slate900, slate950, stone100, stone200, stone300, stone400, stone50, stone500, stone600, stone700, stone800, stone900, stone950, teal100, teal200, teal300, teal400, teal50, teal500, teal600, teal700, teal800, teal900, teal950, export_default$9 as unrefTemplateElement, export_default$10 as useCalendar, export_default$11 as useCalendarMonthSwitcher, export_default$12 as useCalendarTimeGrid, export_default$13 as useCalendarYearSwitcher, export_default$14 as useEventListener, export_default$15 as useFocusTrap, export_default$16 as useFocusTrapLock, export_default$17 as useFocusTrapReturn, export_default$18 as useFocusTrapSubscription, export_default$19 as useFocusZone, export_default$20 as useInView, useKeyboardGrab, export_default$21 as useRemembered, export_default$22 as useScrollEdges, export_default$23 as useScrollPosition, _default$1 as vFocusTrap, _default$2 as vHeightTransition, violet100, violet200, violet300, violet400, violet50, violet500, violet600, violet700, violet800, violet900, violet950, export_default$24 as warn, export_default$25 as wrapFocus, yellow100, yellow200, yellow300, yellow400, yellow50, yellow500, yellow600, yellow700, yellow800, yellow900, yellow950, zinc100, zinc200, zinc300, zinc400, zinc50, zinc500, zinc600, zinc700, zinc800, zinc900, zinc950 };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{a as e,c as t,d as n,f as r,i,l as a,n as o,o as s,p as c,r as l,s as u,t as d,u as f}from"./composable-CJXC7sly.js";import{a as p,c as m,d as h,f as g,i as _,l as v,m as y,n as b,o as x,p as S,r as C,s as w,t as T,u as E}from"./util-CwaOsSvo.js";import{amber100 as D,amber200 as O,amber300 as k,amber400 as A,amber50 as j,amber500 as M,amber600 as N,amber700 as P,amber800 as F,amber900 as I,amber950 as L,blue100 as R,blue200 as z,blue300 as B,blue400 as V,blue50 as H,blue500 as U,blue600 as W,blue700 as G,blue800 as K,blue900 as q,blue950 as J,cyan100 as Y,cyan200 as X,cyan300 as Z,cyan400 as Q,cyan50 as $,cyan500 as ee,cyan600 as te,cyan700 as ne,cyan800 as re,cyan900 as ie,cyan950 as ae,emerald100 as oe,emerald200 as se,emerald300 as ce,emerald400 as le,emerald50 as ue,emerald500 as de,emerald600 as fe,emerald700 as pe,emerald800 as me,emerald900 as he,emerald950 as ge,fuchsia100 as _e,fuchsia200 as ve,fuchsia300 as ye,fuchsia400 as be,fuchsia50 as xe,fuchsia500 as Se,fuchsia600 as Ce,fuchsia700 as we,fuchsia800 as Te,fuchsia900 as Ee,fuchsia950 as De,gray100 as Oe,gray200 as ke,gray300 as Ae,gray400 as je,gray50 as Me,gray500 as Ne,gray600 as Pe,gray700 as Fe,gray800 as Ie,gray900 as Le,gray950 as Re,green100 as ze,green200 as Be,green300 as Ve,green400 as He,green50 as Ue,green500 as We,green600 as Ge,green700 as Ke,green800 as qe,green900 as Je,green950 as Ye,indigo100 as Xe,indigo200 as Ze,indigo300 as Qe,indigo400 as $e,indigo50 as et,indigo500 as tt,indigo600 as nt,indigo700 as rt,indigo800 as it,indigo900 as at,indigo950 as ot,lime100 as st,lime200 as ct,lime300 as lt,lime400 as ut,lime50 as dt,lime500 as ft,lime600 as pt,lime700 as mt,lime800 as ht,lime900 as gt,lime950 as _t,neutral100 as vt,neutral200 as yt,neutral300 as bt,neutral400 as xt,neutral50 as St,neutral500 as Ct,neutral600 as wt,neutral700 as Tt,neutral800 as Et,neutral900 as Dt,neutral950 as Ot,orange100 as kt,orange200 as At,orange300 as jt,orange400 as Mt,orange50 as Nt,orange500 as Pt,orange600 as Ft,orange700 as It,orange800 as Lt,orange900 as Rt,orange950 as zt,pink100 as Bt,pink200 as Vt,pink300 as Ht,pink400 as Ut,pink50 as Wt,pink500 as Gt,pink600 as Kt,pink700 as qt,pink800 as Jt,pink900 as Yt,pink950 as Xt,purple100 as Zt,purple200 as Qt,purple300 as $t,purple400 as en,purple50 as tn,purple500 as nn,purple600 as rn,purple700 as an,purple800 as on,purple900 as sn,purple950 as cn,red100 as ln,red200 as un,red300 as dn,red400 as fn,red50 as pn,red500 as mn,red600 as hn,red700 as gn,red800 as _n,red900 as vn,red950 as yn,rose100 as bn,rose200 as xn,rose300 as Sn,rose400 as Cn,rose50 as wn,rose500 as Tn,rose600 as En,rose700 as Dn,rose800 as On,rose900 as kn,rose950 as An,sky100 as jn,sky200 as Mn,sky300 as Nn,sky400 as Pn,sky50 as Fn,sky500 as In,sky600 as Ln,sky700 as Rn,sky800 as zn,sky900 as Bn,sky950 as Vn,slate100 as Hn,slate200 as Un,slate300 as Wn,slate400 as Gn,slate50 as Kn,slate500 as qn,slate600 as Jn,slate700 as Yn,slate800 as Xn,slate900 as Zn,slate950 as Qn,stone100 as $n,stone200 as er,stone300 as tr,stone400 as nr,stone50 as rr,stone500 as ir,stone600 as ar,stone700 as or,stone800 as sr,stone900 as cr,stone950 as lr,teal100 as ur,teal200 as dr,teal300 as fr,teal400 as pr,teal50 as mr,teal500 as hr,teal600 as gr,teal700 as _r,teal800 as vr,teal900 as yr,teal950 as br,violet100 as xr,violet200 as Sr,violet300 as Cr,violet400 as wr,violet50 as Tr,violet500 as Er,violet600 as Dr,violet700 as Or,violet800 as kr,violet900 as Ar,violet950 as jr,yellow100 as Mr,yellow200 as Nr,yellow300 as Pr,yellow400 as Fr,yellow50 as Ir,yellow500 as Lr,yellow600 as Rr,yellow700 as zr,yellow800 as Br,yellow900 as Vr,yellow950 as Hr,zinc100 as Ur,zinc200 as Wr,zinc300 as Gr,zinc400 as Kr,zinc50 as qr,zinc500 as Jr,zinc600 as Yr,zinc700 as Xr,zinc800 as Zr,zinc900 as Qr,zinc950 as $r}from"./data/index.js";import{n as ei,t as ti}from"./directive-Dprka-AO.js";export{b as FOCUS_TRAP_LOCKS,D as amber100,O as amber200,k as amber300,A as amber400,j as amber50,M as amber500,N as amber600,P as amber700,F as amber800,I as amber900,L as amber950,y as animationFrameDebounce,R as blue100,z as blue200,B as blue300,V as blue400,H as blue50,U as blue500,W as blue600,G as blue700,K as blue800,q as blue900,J as blue950,Y as cyan100,X as cyan200,Z as cyan300,Q as cyan400,$ as cyan50,ee as cyan500,te as cyan600,ne as cyan700,re as cyan800,ie as cyan900,ae as cyan950,oe as emerald100,se as emerald200,ce as emerald300,le as emerald400,ue as emerald50,de as emerald500,fe as emerald600,pe as emerald700,me as emerald800,he as emerald900,ge as emerald950,S as flattenVNodeTree,_e as fuchsia100,ve as fuchsia200,ye as fuchsia300,be as fuchsia400,xe as fuchsia50,Se as fuchsia500,Ce as fuchsia600,we as fuchsia700,Te as fuchsia800,Ee as fuchsia900,De as fuchsia950,h as getBidirectionalFocusElement,E as getComponentName,v as getComponentProps,m as getExposedRef,w as getFocusableElement,g as getFocusableElements,x as getKeyboardFocusableElements,Oe as gray100,ke as gray200,Ae as gray300,je as gray400,Me as gray50,Ne as gray500,Pe as gray600,Fe as gray700,Ie as gray800,Le as gray900,Re as gray950,ze as green100,Be as green200,Ve as green300,He as green400,Ue as green50,We as green500,Ge as green600,Ke as green700,qe as green800,Je as green900,Ye as green950,Xe as indigo100,Ze as indigo200,Qe as indigo300,$e as indigo400,et as indigo50,tt as indigo500,nt as indigo600,rt as indigo700,it as indigo800,at as indigo900,ot as indigo950,T as isSSR,st as lime100,ct as lime200,lt as lime300,ut as lime400,dt as lime50,ft as lime500,pt as lime600,mt as lime700,ht as lime800,gt as lime900,_t as lime950,vt as neutral100,yt as neutral200,bt as neutral300,xt as neutral400,St as neutral50,Ct as neutral500,wt as neutral600,Tt as neutral700,Et as neutral800,Dt as neutral900,Ot as neutral950,kt as orange100,At as orange200,jt as orange300,Mt as orange400,Nt as orange50,Pt as orange500,Ft as orange600,It as orange700,Lt as orange800,Rt as orange900,zt as orange950,Bt as pink100,Vt as pink200,Ht as pink300,Ut as pink400,Wt as pink50,Gt as pink500,Kt as pink600,qt as pink700,Jt as pink800,Yt as pink900,Xt as pink950,Zt as purple100,Qt as purple200,$t as purple300,en as purple400,tn as purple50,nn as purple500,rn as purple600,an as purple700,on as purple800,sn as purple900,cn as purple950,ln as red100,un as red200,dn as red300,fn as red400,pn as red50,mn as red500,hn as red600,gn as red700,_n as red800,vn as red900,yn as red950,bn as rose100,xn as rose200,Sn as rose300,Cn as rose400,wn as rose50,Tn as rose500,En as rose600,Dn as rose700,On as rose800,kn as rose900,An as rose950,jn as sky100,Mn as sky200,Nn as sky300,Pn as sky400,Fn as sky50,In as sky500,Ln as sky600,Rn as sky700,zn as sky800,Bn as sky900,Vn as sky950,Hn as slate100,Un as slate200,Wn as slate300,Gn as slate400,Kn as slate50,qn as slate500,Jn as slate600,Yn as slate700,Xn as slate800,Zn as slate900,Qn as slate950,$n as stone100,er as stone200,tr as stone300,nr as stone400,rr as stone50,ir as stone500,ar as stone600,or as stone700,sr as stone800,cr as stone900,lr as stone950,ur as teal100,dr as teal200,fr as teal300,pr as teal400,mr as teal50,hr as teal500,gr as teal600,_r as teal700,vr as teal800,yr as teal900,br as teal950,p as unrefTemplateElement,c as useCalendar,r as useCalendarMonthSwitcher,n as useCalendarYearSwitcher,f as useEventListener,l as useFocusTrap,e as useFocusTrapLock,i as useFocusTrapReturn,o as useFocusTrapSubscription,d as useFocusZone,a as useInView,t as useRemembered,u as useScrollEdges,s as useScrollPosition,ei as vFocusTrap,ti as vHeightTransition,xr as violet100,Sr as violet200,Cr as violet300,wr as violet400,Tr as violet50,Er as violet500,Dr as violet600,Or as violet700,kr as violet800,Ar as violet900,jr as violet950,_ as warn,C as wrapFocus,Mr as yellow100,Nr as yellow200,Pr as yellow300,Fr as yellow400,Ir as yellow50,Lr as yellow500,Rr as yellow600,zr as yellow700,Br as yellow800,Vr as yellow900,Hr as yellow950,Ur as zinc100,Wr as zinc200,Gr as zinc300,Kr as zinc400,qr as zinc50,Jr as zinc500,Yr as zinc600,Xr as zinc700,Zr as zinc800,Qr as zinc900,$r as zinc950};
1
+ import{a as e,c as t,d as n,f as r,g as i,h as a,i as o,l as s,m as c,n as l,o as u,p as d,r as f,s as p,t as m,u as h}from"./composable-Cp0PgZry.js";import{a as g,c as _,d as v,f as y,i as b,l as x,m as S,n as C,o as w,p as T,r as E,s as D,t as O,u as k}from"./util-CwaOsSvo.js";import{amber100 as A,amber200 as j,amber300 as M,amber400 as N,amber50 as P,amber500 as F,amber600 as I,amber700 as L,amber800 as R,amber900 as z,amber950 as B,blue100 as V,blue200 as H,blue300 as U,blue400 as W,blue50 as G,blue500 as K,blue600 as q,blue700 as J,blue800 as Y,blue900 as X,blue950 as Z,cyan100 as Q,cyan200 as $,cyan300 as ee,cyan400 as te,cyan50 as ne,cyan500 as re,cyan600 as ie,cyan700 as ae,cyan800 as oe,cyan900 as se,cyan950 as ce,emerald100 as le,emerald200 as ue,emerald300 as de,emerald400 as fe,emerald50 as pe,emerald500 as me,emerald600 as he,emerald700 as ge,emerald800 as _e,emerald900 as ve,emerald950 as ye,fuchsia100 as be,fuchsia200 as xe,fuchsia300 as Se,fuchsia400 as Ce,fuchsia50 as we,fuchsia500 as Te,fuchsia600 as Ee,fuchsia700 as De,fuchsia800 as Oe,fuchsia900 as ke,fuchsia950 as Ae,gray100 as je,gray200 as Me,gray300 as Ne,gray400 as Pe,gray50 as Fe,gray500 as Ie,gray600 as Le,gray700 as Re,gray800 as ze,gray900 as Be,gray950 as Ve,green100 as He,green200 as Ue,green300 as We,green400 as Ge,green50 as Ke,green500 as qe,green600 as Je,green700 as Ye,green800 as Xe,green900 as Ze,green950 as Qe,indigo100 as $e,indigo200 as et,indigo300 as tt,indigo400 as nt,indigo50 as rt,indigo500 as it,indigo600 as at,indigo700 as ot,indigo800 as st,indigo900 as ct,indigo950 as lt,lime100 as ut,lime200 as dt,lime300 as ft,lime400 as pt,lime50 as mt,lime500 as ht,lime600 as gt,lime700 as _t,lime800 as vt,lime900 as yt,lime950 as bt,neutral100 as xt,neutral200 as St,neutral300 as Ct,neutral400 as wt,neutral50 as Tt,neutral500 as Et,neutral600 as Dt,neutral700 as Ot,neutral800 as kt,neutral900 as At,neutral950 as jt,orange100 as Mt,orange200 as Nt,orange300 as Pt,orange400 as Ft,orange50 as It,orange500 as Lt,orange600 as Rt,orange700 as zt,orange800 as Bt,orange900 as Vt,orange950 as Ht,pink100 as Ut,pink200 as Wt,pink300 as Gt,pink400 as Kt,pink50 as qt,pink500 as Jt,pink600 as Yt,pink700 as Xt,pink800 as Zt,pink900 as Qt,pink950 as $t,purple100 as en,purple200 as tn,purple300 as nn,purple400 as rn,purple50 as an,purple500 as on,purple600 as sn,purple700 as cn,purple800 as ln,purple900 as un,purple950 as dn,red100 as fn,red200 as pn,red300 as mn,red400 as hn,red50 as gn,red500 as _n,red600 as vn,red700 as yn,red800 as bn,red900 as xn,red950 as Sn,rose100 as Cn,rose200 as wn,rose300 as Tn,rose400 as En,rose50 as Dn,rose500 as On,rose600 as kn,rose700 as An,rose800 as jn,rose900 as Mn,rose950 as Nn,sky100 as Pn,sky200 as Fn,sky300 as In,sky400 as Ln,sky50 as Rn,sky500 as zn,sky600 as Bn,sky700 as Vn,sky800 as Hn,sky900 as Un,sky950 as Wn,slate100 as Gn,slate200 as Kn,slate300 as qn,slate400 as Jn,slate50 as Yn,slate500 as Xn,slate600 as Zn,slate700 as Qn,slate800 as $n,slate900 as er,slate950 as tr,stone100 as nr,stone200 as rr,stone300 as ir,stone400 as ar,stone50 as or,stone500 as sr,stone600 as cr,stone700 as lr,stone800 as ur,stone900 as dr,stone950 as fr,teal100 as pr,teal200 as mr,teal300 as hr,teal400 as gr,teal50 as _r,teal500 as vr,teal600 as yr,teal700 as br,teal800 as xr,teal900 as Sr,teal950 as Cr,violet100 as wr,violet200 as Tr,violet300 as Er,violet400 as Dr,violet50 as Or,violet500 as kr,violet600 as Ar,violet700 as jr,violet800 as Mr,violet900 as Nr,violet950 as Pr,yellow100 as Fr,yellow200 as Ir,yellow300 as Lr,yellow400 as Rr,yellow50 as zr,yellow500 as Br,yellow600 as Vr,yellow700 as Hr,yellow800 as Ur,yellow900 as Wr,yellow950 as Gr,zinc100 as Kr,zinc200 as qr,zinc300 as Jr,zinc400 as Yr,zinc50 as Xr,zinc500 as Zr,zinc600 as Qr,zinc700 as $r,zinc800 as ei,zinc900 as ti,zinc950 as ni}from"./data/index.js";import{n as ri,t as ii}from"./directive-Dprka-AO.js";export{C as FOCUS_TRAP_LOCKS,A as amber100,j as amber200,M as amber300,N as amber400,P as amber50,F as amber500,I as amber600,L as amber700,R as amber800,z as amber900,B as amber950,S as animationFrameDebounce,V as blue100,H as blue200,U as blue300,W as blue400,G as blue50,K as blue500,q as blue600,J as blue700,Y as blue800,X as blue900,Z as blue950,Q as cyan100,$ as cyan200,ee as cyan300,te as cyan400,ne as cyan50,re as cyan500,ie as cyan600,ae as cyan700,oe as cyan800,se as cyan900,ce as cyan950,n as defaultKeyboardGrabAnnounce,le as emerald100,ue as emerald200,de as emerald300,fe as emerald400,pe as emerald50,me as emerald500,he as emerald600,ge as emerald700,_e as emerald800,ve as emerald900,ye as emerald950,T as flattenVNodeTree,be as fuchsia100,xe as fuchsia200,Se as fuchsia300,Ce as fuchsia400,we as fuchsia50,Te as fuchsia500,Ee as fuchsia600,De as fuchsia700,Oe as fuchsia800,ke as fuchsia900,Ae as fuchsia950,v as getBidirectionalFocusElement,k as getComponentName,x as getComponentProps,_ as getExposedRef,D as getFocusableElement,y as getFocusableElements,w as getKeyboardFocusableElements,je as gray100,Me as gray200,Ne as gray300,Pe as gray400,Fe as gray50,Ie as gray500,Le as gray600,Re as gray700,ze as gray800,Be as gray900,Ve as gray950,He as green100,Ue as green200,We as green300,Ge as green400,Ke as green50,qe as green500,Je as green600,Ye as green700,Xe as green800,Ze as green900,Qe as green950,$e as indigo100,et as indigo200,tt as indigo300,nt as indigo400,rt as indigo50,it as indigo500,at as indigo600,ot as indigo700,st as indigo800,ct as indigo900,lt as indigo950,O as isSSR,ut as lime100,dt as lime200,ft as lime300,pt as lime400,mt as lime50,ht as lime500,gt as lime600,_t as lime700,vt as lime800,yt as lime900,bt as lime950,xt as neutral100,St as neutral200,Ct as neutral300,wt as neutral400,Tt as neutral50,Et as neutral500,Dt as neutral600,Ot as neutral700,kt as neutral800,At as neutral900,jt as neutral950,Mt as orange100,Nt as orange200,Pt as orange300,Ft as orange400,It as orange50,Lt as orange500,Rt as orange600,zt as orange700,Bt as orange800,Vt as orange900,Ht as orange950,Ut as pink100,Wt as pink200,Gt as pink300,Kt as pink400,qt as pink50,Jt as pink500,Yt as pink600,Xt as pink700,Zt as pink800,Qt as pink900,$t as pink950,en as purple100,tn as purple200,nn as purple300,rn as purple400,an as purple50,on as purple500,sn as purple600,cn as purple700,ln as purple800,un as purple900,dn as purple950,fn as red100,pn as red200,mn as red300,hn as red400,gn as red50,_n as red500,vn as red600,yn as red700,bn as red800,xn as red900,Sn as red950,Cn as rose100,wn as rose200,Tn as rose300,En as rose400,Dn as rose50,On as rose500,kn as rose600,An as rose700,jn as rose800,Mn as rose900,Nn as rose950,Pn as sky100,Fn as sky200,In as sky300,Ln as sky400,Rn as sky50,zn as sky500,Bn as sky600,Vn as sky700,Hn as sky800,Un as sky900,Wn as sky950,Gn as slate100,Kn as slate200,qn as slate300,Jn as slate400,Yn as slate50,Xn as slate500,Zn as slate600,Qn as slate700,$n as slate800,er as slate900,tr as slate950,nr as stone100,rr as stone200,ir as stone300,ar as stone400,or as stone50,sr as stone500,cr as stone600,lr as stone700,ur as stone800,dr as stone900,fr as stone950,pr as teal100,mr as teal200,hr as teal300,gr as teal400,_r as teal50,vr as teal500,yr as teal600,br as teal700,xr as teal800,Sr as teal900,Cr as teal950,g as unrefTemplateElement,i as useCalendar,a as useCalendarMonthSwitcher,c as useCalendarTimeGrid,d as useCalendarYearSwitcher,h as useEventListener,f as useFocusTrap,e as useFocusTrapLock,o as useFocusTrapReturn,l as useFocusTrapSubscription,m as useFocusZone,s as useInView,r as useKeyboardGrab,t as useRemembered,p as useScrollEdges,u as useScrollPosition,ri as vFocusTrap,ii as vHeightTransition,wr as violet100,Tr as violet200,Er as violet300,Dr as violet400,Or as violet50,kr as violet500,Ar as violet600,jr as violet700,Mr as violet800,Nr as violet900,Pr as violet950,b as warn,E as wrapFocus,Fr as yellow100,Ir as yellow200,Lr as yellow300,Rr as yellow400,zr as yellow50,Br as yellow500,Vr as yellow600,Hr as yellow700,Ur as yellow800,Wr as yellow900,Gr as yellow950,Kr as zinc100,qr as zinc200,Jr as zinc300,Yr as zinc400,Xr as zinc50,Zr as zinc500,Qr as zinc600,$r as zinc700,ei as zinc800,ti as zinc900,ni as zinc950};
@@ -1 +1 @@
1
- {"version":3,"file":"util-CwaOsSvo.js","names":["getFocusableElements","getFocusableElements","#traps","#listeners"],"sources":["../src/util/animationFrameDebounce.ts","../src/util/flattenVNodeTree.ts","../src/util/getFocusableElements.ts","../src/util/getBidirectionalFocusElement.ts","../src/util/getComponentName.ts","../src/util/getComponentProps.ts","../src/util/getExposedRef.ts","../src/util/getFocusableElement.ts","../src/util/getKeyboardFocusableElements.ts","../src/util/unrefTemplateElement.ts","../src/util/warn.ts","../src/util/wrapFocus.ts","../src/util/focusTrap.ts","../src/util/index.ts"],"sourcesContent":["import type { FluxMaybePromise } from '@flux-ui/types';\n\nexport default function <T extends () => FluxMaybePromise<void>>(fn: T): T {\n if (typeof requestAnimationFrame === 'undefined') {\n return (() => {}) as T;\n }\n\n let animationFrame = 0;\n\n return (() => {\n cancelAnimationFrame(animationFrame);\n animationFrame = requestAnimationFrame(fn);\n }) as T;\n}\n","import type { VNode } from 'vue';\nimport { Fragment } from 'vue';\n\nexport default function (vnodes: VNode[]): VNode[] {\n const flattened: VNode[] = [];\n\n for (const vnode of vnodes) {\n if (vnode.type === Fragment && Array.isArray(vnode.children)) {\n flattened.push(...(vnode.children as VNode[]));\n continue;\n }\n\n flattened.push(vnode);\n }\n\n return flattened;\n}\n","import { isHtmlElement } from '@basmilius/utils';\n\nconst FOCUSABLE_ELEMENTS = [\n 'a:not([disabled])',\n 'button:not([disabled])',\n 'input[type=checkbox]:not([disabled])',\n 'input[type=radio]:not([disabled])',\n 'input[type=text]:not([disabled])',\n '[tabindex]:not([disabled]):not([tabindex=\"-1\"])'\n].join(',');\n\nexport default function (container: HTMLElement): HTMLElement[] {\n return Array.from(container.querySelectorAll(FOCUSABLE_ELEMENTS))\n .filter(isHtmlElement)\n .filter(elm => elm.offsetWidth > 0 || elm.offsetHeight > 0 || elm === document.activeElement);\n}\n","import getFocusableElements from './getFocusableElements';\n\nexport default function (container: HTMLElement, currentElement: HTMLElement, direction: 'up' | 'down' | 'left' | 'right'): HTMLElement | null {\n const elements = getFocusableElements(container);\n const currentIndex = elements.indexOf(currentElement);\n\n if (currentIndex === -1) {\n return null;\n }\n\n const elementInfos = getBidirectionalInfoForElements(elements);\n\n calculateBidirectionalDistances(elementInfos, currentIndex, direction);\n\n let candidate = determineBidirectionalCandidate(currentIndex, direction, elementInfos, elements);\n\n if (!candidate) {\n if (direction === 'up' || direction === 'left') {\n candidate = elements[currentIndex - 1];\n }\n\n if (direction === 'down' || direction === 'right') {\n candidate = elements[currentIndex + 1];\n }\n }\n\n return candidate;\n}\n\nfunction calculateBidirectionalDistances(elementInfos: BidirectionalInfo[], currentIndex: number, direction: 'up' | 'down' | 'left' | 'right'): void {\n const current = elementInfos[currentIndex];\n\n elementInfos.forEach(r => {\n let point = r.center;\n\n switch (direction) {\n case 'up':\n point = {x: point.x, y: r.top + r.height};\n break;\n\n case 'down':\n point = {x: point.x, y: r.top};\n break;\n\n case 'left':\n point = {x: r.left + r.width, y: point.y};\n break;\n\n case 'right':\n point = {x: r.left, y: point.y};\n break;\n }\n\n r.distance = Math.sqrt(Math.pow(current.center.x - point.x, 2) + Math.pow(current.center.y - point.y, 2));\n });\n}\n\nfunction determineBidirectionalCandidate(currentIndex: number, direction: 'up' | 'down' | 'left' | 'right', elementInfos: BidirectionalInfo[], elements: HTMLElement[]): HTMLElement | null {\n const current = elementInfos[currentIndex];\n let distances: number[] = [];\n\n switch (direction) {\n case 'up':\n distances = elementInfos.map((r, index) => index === currentIndex || r.top + r.height > current.top ? Number.MAX_SAFE_INTEGER : r.distance);\n break;\n\n case 'down':\n distances = elementInfos.map((r, index) => index === currentIndex || r.top < current.top + current.height ? Number.MAX_SAFE_INTEGER : r.distance);\n break;\n\n case 'left':\n distances = elementInfos.map((r, index) => index === currentIndex || r.left + r.width > current.left ? Number.MAX_SAFE_INTEGER : r.distance);\n break;\n\n case 'right':\n distances = elementInfos.map((r, index) => index === currentIndex || r.left < current.left + current.width ? Number.MAX_SAFE_INTEGER : r.distance);\n break;\n }\n\n const candidateIndex = distances.indexOf(Math.min(...distances));\n\n if (distances[candidateIndex] !== Number.MAX_SAFE_INTEGER) {\n return elements[candidateIndex];\n }\n\n return null;\n}\n\nfunction getBidirectionalInfoForElements(elements: HTMLElement[]): BidirectionalInfo[] {\n return elements\n .map(elm => elm.getBoundingClientRect())\n .map(rect => ({\n height: rect.height,\n width: rect.width,\n top: rect.top,\n left: rect.left,\n right: rect.right,\n bottom: rect.bottom,\n center: {\n x: rect.left + rect.width / 2,\n y: rect.top + rect.height / 2\n },\n distance: 0\n }));\n}\n\ntype BidirectionalInfo = Omit<DOMRect, 'x' | 'y' | 'toJSON'> & {\n center: { x: number; y: number; };\n distance: number;\n}\n","import type { VNode } from 'vue';\n\nexport default function (component: ExtendedVNode): string {\n let name = 'UnknownComponent';\n\n if (component.type && component.type.__name) {\n name = component.type.__name;\n }\n\n return name;\n}\n\ntype ExtendedVNode = {\n readonly type: VNode['type'] & {\n readonly __name?: string;\n };\n}\n","import { camelCase } from 'lodash-es';\n\nexport default function <T extends object>(component: any): T {\n return Object.fromEntries(\n Object.entries(component.props ?? {})\n .map(([key, value]) => [camelCase(key), value])\n ) as T;\n}\n","import type { ComponentInternalInstance, Ref } from 'vue';\n\nexport default function <T>(instance: ComponentInternalInstance, key: string): Ref<T> {\n if (!instance.exposed || !(key in instance.exposed)) {\n throw new Error(`'${key}' was not exposed by the component.`);\n }\n\n return instance.exposed[key];\n}\n","import { isHtmlElement } from '@basmilius/utils';\nimport getFocusableElements from './getFocusableElements';\n\nexport default function (container: HTMLElement, direction: number, activeElement: HTMLElement | undefined = undefined): HTMLElement | undefined {\n const elements = getFocusableElements(container);\n const focusedElement = activeElement || document.activeElement;\n\n if (!focusedElement || !isHtmlElement(focusedElement))\n return elements[0] || undefined;\n\n const currentIndex = elements.indexOf(focusedElement);\n\n return elements[currentIndex + direction] || undefined;\n}\n","export default function (root: HTMLElement): HTMLElement[] {\n return Array.from<HTMLElement>(root.querySelectorAll('a[href], button, input, textarea, select, details, [tabindex]:not([tabindex=\"-1\"])'))\n .filter(elm => !elm.hasAttribute('disabled') || elm.getAttribute('disabled') !== 'true')\n .filter(elm => !elm.hasAttribute('aria-disabled') || elm.getAttribute('aria-disabled') !== 'true');\n}\n","import { isHtmlElement } from '@basmilius/utils';\nimport { ComponentPublicInstance, ShallowRef, unref } from 'vue';\n\nexport type TemplateElement<TElement extends HTMLElement> = ComponentPublicInstance<any, any, any, any, any, any, any, any, any, any, any, any, any, any, TElement> | TElement | null;\nexport type TemplateRef<TElement extends HTMLElement> = Readonly<ShallowRef<TemplateElement<TElement>>>;\n\nexport default function <T extends HTMLElement>(ref: TemplateRef<T>): T | null {\n const value = unref(ref);\n\n if (isHtmlElement(value)) {\n return value as T;\n }\n\n return value?.$el;\n}\n","export default function (...data: any): void {\n console.warn('[Flux]', ...data);\n}\n","export default function (elm: HTMLElement, targetElm: Element, forceFirst: boolean = false): void {\n const walker = createFocusWalker(elm);\n const position = targetElm.compareDocumentPosition(elm);\n let wrappedTarget: HTMLElement | null;\n\n if (position && Node.DOCUMENT_POSITION_PRECEDING || forceFirst) {\n wrappedTarget = walker.firstChild() as HTMLElement | null;\n } else {\n wrappedTarget = walker.lastChild() as HTMLElement | null;\n }\n\n const newFocus = wrappedTarget !== null ? wrappedTarget : elm;\n newFocus.focus();\n}\n\nfunction createFocusWalker(elm: HTMLElement): TreeWalker {\n return document.createTreeWalker(elm, NodeFilter.SHOW_ELEMENT, {\n acceptNode: (node: HTMLButtonElement) => node.tabIndex >= 0 && !node.disabled ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP\n });\n}\n","class FocusTrapLockStack {\n get active(): boolean {\n return this.current?.isEnabled ?? false;\n }\n\n get current(): FocusTrap | null {\n return this.#traps[this.#traps.length - 1] ?? null;\n }\n\n #listeners: FocusTrapListener[] = [];\n #traps: FocusTrap[] = [];\n\n add(id: FocusTrap['id'], setEnabled: FocusTrap['setEnabled'], autoFocus: boolean = true): void {\n const trap: FocusTrap = {id, setEnabled, isEnabled: true};\n this.current && this.toggle(this.current, false);\n this.#traps.push(trap);\n\n if (autoFocus) {\n this.toggle(trap, true);\n this.emit();\n }\n }\n\n remove(id: FocusTrap['id']): void {\n const trap = this.#traps.find(t => t.id === id);\n trap && this.toggle(trap, false);\n\n const current = this.current;\n const wasCurrent = current?.id === id;\n this.#traps = this.#traps.filter(t => t.id !== id);\n\n wasCurrent && this.current && this.toggle(this.current, true);\n this.emit();\n }\n\n emit(): void {\n this.#listeners.forEach(listener => listener(this.active, this.#traps));\n }\n\n subscribe(listener: FocusTrapListener): () => void {\n this.#listeners.push(listener);\n listener(this.active, this.#traps);\n\n return () => this.#listeners = this.#listeners.filter(l => l !== listener);\n }\n\n toggle(trap: FocusTrap, isEnabled: boolean): void {\n trap.setEnabled(isEnabled);\n trap.isEnabled = isEnabled;\n }\n}\n\ninterface FocusTrap {\n id: string;\n isEnabled: boolean;\n\n setEnabled(isEnabled: boolean): void;\n}\n\nexport type FocusTrapListener = (isEnabled: boolean, focusTraps: FocusTrap[]) => void;\n\nconst _default: FocusTrapLockStack = new FocusTrapLockStack();\nexport default _default;\n","export { default as animationFrameDebounce } from './animationFrameDebounce';\nexport { default as flattenVNodeTree } from './flattenVNodeTree';\nexport { default as getBidirectionalFocusElement } from './getBidirectionalFocusElement';\nexport { default as getComponentName } from './getComponentName';\nexport { default as getComponentProps } from './getComponentProps';\nexport { default as getExposedRef } from './getExposedRef';\nexport { default as getFocusableElement } from './getFocusableElement';\nexport { default as getFocusableElements } from './getFocusableElements';\nexport { default as getKeyboardFocusableElements } from './getKeyboardFocusableElements';\nexport { default as unrefTemplateElement, type TemplateElement, type TemplateRef } from './unrefTemplateElement';\nexport { default as warn } from './warn';\nexport { default as wrapFocus } from './wrapFocus';\n\nexport { default as FOCUS_TRAP_LOCKS, type FocusTrapListener } from './focusTrap';\n\nexport const isSSR: boolean = !globalThis.document;\n"],"mappings":"iIAEA,SAAA,EAAiE,EAAU,CACvE,GAAI,OAAO,sBAA0B,IACjC,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E,OAAO,EAAiB,EAA0B,CAC9C,EAAK,WAAW,EAAU,CAC1B,EAAK,UAAY,ICjCZ,EAAiB,CAAC,WAAW"}
1
+ {"version":3,"file":"util-CwaOsSvo.js","names":["getFocusableElements","getFocusableElements","#traps","#listeners"],"sources":["../src/util/animationFrameDebounce.ts","../src/util/flattenVNodeTree.ts","../src/util/getFocusableElements.ts","../src/util/getBidirectionalFocusElement.ts","../src/util/getComponentName.ts","../src/util/getComponentProps.ts","../src/util/getExposedRef.ts","../src/util/getFocusableElement.ts","../src/util/getKeyboardFocusableElements.ts","../src/util/unrefTemplateElement.ts","../src/util/warn.ts","../src/util/wrapFocus.ts","../src/util/focusTrap.ts","../src/util/index.ts"],"sourcesContent":["import type { FluxMaybePromise } from '@flux-ui/types';\n\nexport default function <T extends () => FluxMaybePromise<void>>(fn: T): T {\n if (typeof requestAnimationFrame === 'undefined') {\n return (() => {\n }) as T;\n }\n\n let animationFrame = 0;\n\n return (() => {\n cancelAnimationFrame(animationFrame);\n animationFrame = requestAnimationFrame(fn);\n }) as T;\n}\n","import { Fragment, type VNode } from 'vue';\n\nexport default function (vnodes: VNode[]): VNode[] {\n const flattened: VNode[] = [];\n\n for (const vnode of vnodes) {\n if (vnode.type === Fragment && Array.isArray(vnode.children)) {\n flattened.push(...(vnode.children as VNode[]));\n continue;\n }\n\n flattened.push(vnode);\n }\n\n return flattened;\n}\n","import { isHtmlElement } from '@basmilius/utils';\n\nconst FOCUSABLE_ELEMENTS = [\n 'a:not([disabled])',\n 'button:not([disabled])',\n 'input[type=checkbox]:not([disabled])',\n 'input[type=radio]:not([disabled])',\n 'input[type=text]:not([disabled])',\n '[tabindex]:not([disabled]):not([tabindex=\"-1\"])'\n].join(',');\n\nexport default function (container: HTMLElement): HTMLElement[] {\n return Array.from(container.querySelectorAll(FOCUSABLE_ELEMENTS))\n .filter(isHtmlElement)\n .filter(elm => elm.offsetWidth > 0 || elm.offsetHeight > 0 || elm === document.activeElement);\n}\n","import getFocusableElements from './getFocusableElements';\n\nexport default function (container: HTMLElement, currentElement: HTMLElement, direction: 'up' | 'down' | 'left' | 'right'): HTMLElement | null {\n const elements = getFocusableElements(container);\n const currentIndex = elements.indexOf(currentElement);\n\n if (currentIndex === -1) {\n return null;\n }\n\n const elementInfos = getBidirectionalInfoForElements(elements);\n\n calculateBidirectionalDistances(elementInfos, currentIndex, direction);\n\n let candidate = determineBidirectionalCandidate(currentIndex, direction, elementInfos, elements);\n\n if (!candidate) {\n if (direction === 'up' || direction === 'left') {\n candidate = elements[currentIndex - 1];\n }\n\n if (direction === 'down' || direction === 'right') {\n candidate = elements[currentIndex + 1];\n }\n }\n\n return candidate;\n}\n\nfunction calculateBidirectionalDistances(elementInfos: BidirectionalInfo[], currentIndex: number, direction: 'up' | 'down' | 'left' | 'right'): void {\n const current = elementInfos[currentIndex];\n\n elementInfos.forEach(r => {\n let point = r.center;\n\n switch (direction) {\n case 'up':\n point = {x: point.x, y: r.top + r.height};\n break;\n\n case 'down':\n point = {x: point.x, y: r.top};\n break;\n\n case 'left':\n point = {x: r.left + r.width, y: point.y};\n break;\n\n case 'right':\n point = {x: r.left, y: point.y};\n break;\n }\n\n r.distance = Math.sqrt(Math.pow(current.center.x - point.x, 2) + Math.pow(current.center.y - point.y, 2));\n });\n}\n\nfunction determineBidirectionalCandidate(currentIndex: number, direction: 'up' | 'down' | 'left' | 'right', elementInfos: BidirectionalInfo[], elements: HTMLElement[]): HTMLElement | null {\n const current = elementInfos[currentIndex];\n let distances: number[] = [];\n\n switch (direction) {\n case 'up':\n distances = elementInfos.map((r, index) => index === currentIndex || r.top + r.height > current.top ? Number.MAX_SAFE_INTEGER : r.distance);\n break;\n\n case 'down':\n distances = elementInfos.map((r, index) => index === currentIndex || r.top < current.top + current.height ? Number.MAX_SAFE_INTEGER : r.distance);\n break;\n\n case 'left':\n distances = elementInfos.map((r, index) => index === currentIndex || r.left + r.width > current.left ? Number.MAX_SAFE_INTEGER : r.distance);\n break;\n\n case 'right':\n distances = elementInfos.map((r, index) => index === currentIndex || r.left < current.left + current.width ? Number.MAX_SAFE_INTEGER : r.distance);\n break;\n }\n\n const candidateIndex = distances.indexOf(Math.min(...distances));\n\n if (distances[candidateIndex] !== Number.MAX_SAFE_INTEGER) {\n return elements[candidateIndex];\n }\n\n return null;\n}\n\nfunction getBidirectionalInfoForElements(elements: HTMLElement[]): BidirectionalInfo[] {\n return elements\n .map(elm => elm.getBoundingClientRect())\n .map(rect => ({\n height: rect.height,\n width: rect.width,\n top: rect.top,\n left: rect.left,\n right: rect.right,\n bottom: rect.bottom,\n center: {\n x: rect.left + rect.width / 2,\n y: rect.top + rect.height / 2\n },\n distance: 0\n }));\n}\n\ntype BidirectionalInfo = Omit<DOMRect, 'x' | 'y' | 'toJSON'> & {\n center: { x: number; y: number; };\n distance: number;\n}\n","import type { VNode } from 'vue';\n\nexport default function (component: ExtendedVNode): string {\n let name = 'UnknownComponent';\n\n if (component.type && component.type.__name) {\n name = component.type.__name;\n }\n\n return name;\n}\n\ntype ExtendedVNode = {\n readonly type: VNode['type'] & {\n readonly __name?: string;\n };\n}\n","import { camelCase } from 'lodash-es';\n\nexport default function <T extends object>(component: any): T {\n return Object.fromEntries(\n Object.entries(component.props ?? {})\n .map(([key, value]) => [camelCase(key), value])\n ) as T;\n}\n","import type { ComponentInternalInstance, Ref } from 'vue';\n\nexport default function <T>(instance: ComponentInternalInstance, key: string): Ref<T> {\n if (!instance.exposed || !(key in instance.exposed)) {\n throw new Error(`'${key}' was not exposed by the component.`);\n }\n\n return instance.exposed[key];\n}\n","import { isHtmlElement } from '@basmilius/utils';\nimport getFocusableElements from './getFocusableElements';\n\nexport default function (container: HTMLElement, direction: number, activeElement: HTMLElement | undefined = undefined): HTMLElement | undefined {\n const elements = getFocusableElements(container);\n const focusedElement = activeElement || document.activeElement;\n\n if (!focusedElement || !isHtmlElement(focusedElement))\n return elements[0] || undefined;\n\n const currentIndex = elements.indexOf(focusedElement);\n\n return elements[currentIndex + direction] || undefined;\n}\n","export default function (root: HTMLElement): HTMLElement[] {\n return Array.from<HTMLElement>(root.querySelectorAll('a[href], button, input, textarea, select, details, [tabindex]:not([tabindex=\"-1\"])'))\n .filter(elm => !elm.hasAttribute('disabled') || elm.getAttribute('disabled') !== 'true')\n .filter(elm => !elm.hasAttribute('aria-disabled') || elm.getAttribute('aria-disabled') !== 'true');\n}\n","import { isHtmlElement } from '@basmilius/utils';\nimport { type ComponentPublicInstance, type ShallowRef, unref } from 'vue';\n\nexport type TemplateElement<TElement extends HTMLElement> = ComponentPublicInstance<any, any, any, any, any, any, any, any, any, any, any, any, any, any, TElement> | TElement | null;\nexport type TemplateRef<TElement extends HTMLElement> = Readonly<ShallowRef<TemplateElement<TElement>>>;\n\nexport default function <T extends HTMLElement>(ref: TemplateRef<T>): T | null {\n const value = unref(ref);\n\n if (isHtmlElement(value)) {\n return value as T;\n }\n\n return value?.$el;\n}\n","export default function (...data: any): void {\n console.warn('[Flux]', ...data);\n}\n","export default function (elm: HTMLElement, targetElm: Element, forceFirst: boolean = false): void {\n const walker = createFocusWalker(elm);\n const position = targetElm.compareDocumentPosition(elm);\n let wrappedTarget: HTMLElement | null;\n\n if (position && Node.DOCUMENT_POSITION_PRECEDING || forceFirst) {\n wrappedTarget = walker.firstChild() as HTMLElement | null;\n } else {\n wrappedTarget = walker.lastChild() as HTMLElement | null;\n }\n\n const newFocus = wrappedTarget !== null ? wrappedTarget : elm;\n newFocus.focus();\n}\n\nfunction createFocusWalker(elm: HTMLElement): TreeWalker {\n return document.createTreeWalker(elm, NodeFilter.SHOW_ELEMENT, {\n acceptNode: (node: HTMLButtonElement) => node.tabIndex >= 0 && !node.disabled ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP\n });\n}\n","class FocusTrapLockStack {\n get active(): boolean {\n return this.current?.isEnabled ?? false;\n }\n\n get current(): FocusTrap | null {\n return this.#traps[this.#traps.length - 1] ?? null;\n }\n\n #listeners: FocusTrapListener[] = [];\n #traps: FocusTrap[] = [];\n\n add(id: FocusTrap['id'], setEnabled: FocusTrap['setEnabled'], autoFocus: boolean = true): void {\n const trap: FocusTrap = {id, setEnabled, isEnabled: true};\n this.current && this.toggle(this.current, false);\n this.#traps.push(trap);\n\n if (autoFocus) {\n this.toggle(trap, true);\n this.emit();\n }\n }\n\n remove(id: FocusTrap['id']): void {\n const trap = this.#traps.find(t => t.id === id);\n trap && this.toggle(trap, false);\n\n const current = this.current;\n const wasCurrent = current?.id === id;\n this.#traps = this.#traps.filter(t => t.id !== id);\n\n wasCurrent && this.current && this.toggle(this.current, true);\n this.emit();\n }\n\n emit(): void {\n this.#listeners.forEach(listener => listener(this.active, this.#traps));\n }\n\n subscribe(listener: FocusTrapListener): () => void {\n this.#listeners.push(listener);\n listener(this.active, this.#traps);\n\n return () => this.#listeners = this.#listeners.filter(l => l !== listener);\n }\n\n toggle(trap: FocusTrap, isEnabled: boolean): void {\n trap.setEnabled(isEnabled);\n trap.isEnabled = isEnabled;\n }\n}\n\ninterface FocusTrap {\n id: string;\n isEnabled: boolean;\n\n setEnabled(isEnabled: boolean): void;\n}\n\nexport type FocusTrapListener = (isEnabled: boolean, focusTraps: FocusTrap[]) => void;\n\nconst _default: FocusTrapLockStack = new FocusTrapLockStack();\nexport default _default;\n","export { default as animationFrameDebounce } from './animationFrameDebounce';\nexport { default as flattenVNodeTree } from './flattenVNodeTree';\nexport { default as getBidirectionalFocusElement } from './getBidirectionalFocusElement';\nexport { default as getComponentName } from './getComponentName';\nexport { default as getComponentProps } from './getComponentProps';\nexport { default as getExposedRef } from './getExposedRef';\nexport { default as getFocusableElement } from './getFocusableElement';\nexport { default as getFocusableElements } from './getFocusableElements';\nexport { default as getKeyboardFocusableElements } from './getKeyboardFocusableElements';\nexport { default as unrefTemplateElement, type TemplateElement, type TemplateRef } from './unrefTemplateElement';\nexport { default as warn } from './warn';\nexport { default as wrapFocus } from './wrapFocus';\n\nexport { default as FOCUS_TRAP_LOCKS, type FocusTrapListener } from './focusTrap';\n\n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B,EAAS,KAAK,OAAQ,MAAA,EAAY,KAErB,MAAA,EAAkB,MAAA,EAAgB,OAAO,GAAK,IAAM,EAAS,CAG9E,OAAO,EAAiB,EAA0B,CAC9C,EAAK,WAAW,EAAU,CAC1B,EAAK,UAAY,ICjCZ,EAAiB,CAAC,WAAW"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@flux-ui/internals",
3
3
  "description": "Contains internal workings of Flux UI packages.",
4
- "version": "3.0.0-next.57",
4
+ "version": "3.0.0-next.59",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "funding": "https://github.com/sponsors/basmilius",
@@ -59,9 +59,9 @@
59
59
  }
60
60
  },
61
61
  "dependencies": {
62
- "@basmilius/common": "^3.21.0",
63
- "@basmilius/utils": "^3.21.0",
64
- "@flux-ui/types": "3.0.0-next.57",
62
+ "@basmilius/common": "^3.24.0",
63
+ "@basmilius/utils": "^3.24.0",
64
+ "@flux-ui/types": "3.0.0-next.59",
65
65
  "lodash-es": "^4.18.1"
66
66
  },
67
67
  "peerDependencies": {
@@ -1,6 +1,8 @@
1
1
  export { default as useCalendar } from './useCalendar';
2
2
  export { default as useCalendarMonthSwitcher } from './useCalendarMonthSwitcher';
3
+ export { default as useCalendarTimeGrid } from './useCalendarTimeGrid';
3
4
  export { default as useCalendarYearSwitcher } from './useCalendarYearSwitcher';
5
+ export { default as useKeyboardGrab, defaultAnnounce as defaultKeyboardGrabAnnounce } from './useKeyboardGrab';
4
6
  export { default as useEventListener } from './useEventListener';
5
7
  export { default as useInView } from './useInView';
6
8
  export { default as useRemembered } from './useRemembered';
@@ -1,5 +1,5 @@
1
1
  import type { DateTime } from 'luxon';
2
- import { computed, type Ref, ref, unref } from 'vue';
2
+ import { computed, ref, type Ref, unref } from 'vue';
3
3
 
4
4
  export default function (initialDate: DateTime, options?: UseCalendarOptions): UseCalendarReturn {
5
5
  const isTransitioningToPast = ref(false);
@@ -1,6 +1,5 @@
1
1
  import type { DateTime } from 'luxon';
2
- import type { Ref } from 'vue';
3
- import { computed, unref } from 'vue';
2
+ import { computed, type Ref, unref } from 'vue';
4
3
 
5
4
  export default function (currentDate: Ref<DateTime>, displayLength: 'short' | 'long'): UseCalendarMonthSwitcherReturn {
6
5
  const months = computed(() => {
@@ -0,0 +1,103 @@
1
+ import type { DateTime } from 'luxon';
2
+ import { computed, type ComputedRef, type MaybeRefOrGetter, ref, type Ref, toValue, unref, watch } from 'vue';
3
+
4
+ export type UseCalendarTimeGridDayCount = 1 | 2 | 7;
5
+
6
+ export type UseCalendarTimeGridReturn = {
7
+ readonly isTransitioningToPast: Ref<boolean>;
8
+ readonly viewDate: Ref<DateTime>;
9
+ readonly viewDates: ComputedRef<DateTime[]>;
10
+ readonly rangeLabel: ComputedRef<string>;
11
+
12
+ setViewDate(date: DateTime): void;
13
+ next(): void;
14
+ previous(): void;
15
+ };
16
+
17
+ function getAnchor(date: DateTime, dayCount: UseCalendarTimeGridDayCount): DateTime {
18
+ return dayCount === 7 ? date.startOf('week') : date.startOf('day');
19
+ }
20
+
21
+ function stepDuration(dayCount: UseCalendarTimeGridDayCount): { day?: number; week?: number } {
22
+ if (dayCount === 7) {
23
+ return {week: 1};
24
+ }
25
+
26
+ if (dayCount === 2) {
27
+ return {day: 2};
28
+ }
29
+
30
+ return {day: 1};
31
+ }
32
+
33
+ export default function (
34
+ initialDate: DateTime,
35
+ dayCount: MaybeRefOrGetter<UseCalendarTimeGridDayCount>
36
+ ): UseCalendarTimeGridReturn {
37
+ const isTransitioningToPast = ref(false);
38
+ const viewDate = ref<DateTime>(getAnchor(initialDate, toValue(dayCount)));
39
+
40
+ // Re-anchor on dayCount change (e.g. switching from week to two-days view).
41
+ watch(() => toValue(dayCount), (count) => {
42
+ viewDate.value = getAnchor(unref(viewDate), count);
43
+ });
44
+
45
+ const viewDates = computed<DateTime[]>(() => {
46
+ const anchor = unref(viewDate);
47
+ const count = toValue(dayCount);
48
+ const out: DateTime[] = [];
49
+
50
+ for (let i = 0; i < count; ++i) {
51
+ out.push(anchor.plus({day: i}));
52
+ }
53
+
54
+ return out;
55
+ });
56
+
57
+ const rangeLabel = computed<string>(() => {
58
+ const dates = unref(viewDates);
59
+ const first = dates[0];
60
+ const last = dates[dates.length - 1];
61
+ const count = toValue(dayCount);
62
+
63
+ if (count === 1) {
64
+ return first.toLocaleString({weekday: 'long', day: 'numeric', month: 'long', year: 'numeric'});
65
+ }
66
+
67
+ const sameMonth = first.month === last.month;
68
+ const sameYear = first.year === last.year;
69
+
70
+ const firstFmt = first.toLocaleString(
71
+ sameMonth && sameYear
72
+ ? {weekday: 'short', day: 'numeric'}
73
+ : {weekday: 'short', day: 'numeric', month: 'short'}
74
+ );
75
+ const lastFmt = last.toLocaleString({weekday: 'short', day: 'numeric', month: 'short', year: sameYear ? undefined : 'numeric'});
76
+
77
+ return `${firstFmt} – ${lastFmt}`;
78
+ });
79
+
80
+ function setViewDate(date: DateTime): void {
81
+ const anchor = getAnchor(date, toValue(dayCount));
82
+ isTransitioningToPast.value = unref(viewDate) > anchor;
83
+ viewDate.value = anchor;
84
+ }
85
+
86
+ function next(): void {
87
+ setViewDate(unref(viewDate).plus(stepDuration(toValue(dayCount))));
88
+ }
89
+
90
+ function previous(): void {
91
+ setViewDate(unref(viewDate).minus(stepDuration(toValue(dayCount))));
92
+ }
93
+
94
+ return {
95
+ isTransitioningToPast,
96
+ viewDate,
97
+ viewDates,
98
+ rangeLabel,
99
+ setViewDate,
100
+ next,
101
+ previous
102
+ };
103
+ }
@@ -1,6 +1,5 @@
1
1
  import type { DateTime } from 'luxon';
2
- import type { Ref } from 'vue';
3
- import { computed, ref, unref, watch } from 'vue';
2
+ import { computed, ref, type Ref, unref, watch } from 'vue';
4
3
 
5
4
  export default function (currentDate: Ref<DateTime>, limit: number = 10): UseCalendarYearSwitcherReturn {
6
5
  const index = ref(0);
@@ -1,7 +1,5 @@
1
- import type { Ref } from 'vue';
2
- import { ref, watch } from 'vue';
3
- import type { TemplateRef } from '../util';
4
- import { getFocusableElements, isSSR, unrefTemplateElement, wrapFocus } from '../util';
1
+ import { ref, type Ref, watch } from 'vue';
2
+ import { getFocusableElements, isSSR, type TemplateRef, unrefTemplateElement, wrapFocus } from '../util';
5
3
  import useFocusTrapLock from './useFocusTrapLock';
6
4
  import useFocusTrapReturn from './useFocusTrapReturn';
7
5
 
@@ -1,5 +1,4 @@
1
- import type { Ref } from 'vue';
2
- import { onMounted, onUnmounted, ref, unref } from 'vue';
1
+ import { onMounted, onUnmounted, ref, type Ref, unref } from 'vue';
3
2
  import { FOCUS_TRAP_LOCKS } from '../util';
4
3
 
5
4
  let lockId = 0;
@@ -1,6 +1,5 @@
1
1
  import { onMounted, onUnmounted, ref } from 'vue';
2
- import type { FocusTrapListener } from '../util';
3
- import { FOCUS_TRAP_LOCKS } from '../util';
2
+ import { FOCUS_TRAP_LOCKS, type FocusTrapListener } from '../util';
4
3
 
5
4
  export default function (listener: FocusTrapListener): void {
6
5
  const unsubscribe = ref<Function | null>(null);
@@ -1,7 +1,5 @@
1
- import type { Ref } from 'vue';
2
- import { ref, watch } from 'vue';
3
- import type { TemplateRef } from '../util';
4
- import { unrefTemplateElement } from '../util';
1
+ import { ref, type Ref, watch } from 'vue';
2
+ import { type TemplateRef, unrefTemplateElement } from '../util';
5
3
 
6
4
  export default function <TElement extends HTMLElement>(containerRef: TemplateRef<TElement>, options: UseInViewOptions = {}): Ref<boolean> {
7
5
  const inView = ref(options.initial ?? false);
@@ -0,0 +1,152 @@
1
+ import { computed, type ComputedRef, ref, type Ref, unref } from 'vue';
2
+
3
+ export type KeyboardGrabDirection = 'up' | 'down' | 'left' | 'right';
4
+
5
+ export type UseKeyboardGrabOptions<TPos> = {
6
+ readonly isDraggable: Ref<boolean>;
7
+ readonly itemId: Ref<string | number | null | undefined>;
8
+ readonly grabbedId: Ref<string | number | null>;
9
+ onGrab(): TPos;
10
+ onMove(direction: KeyboardGrabDirection): void;
11
+ onCommit(origin: TPos): void;
12
+ onCancel(origin: TPos): void;
13
+ announce?(message: string): void;
14
+ };
15
+
16
+ export type UseKeyboardGrabReturn = {
17
+ readonly isGrabbed: ComputedRef<boolean>;
18
+ handleKeyDown(evt: KeyboardEvent): void;
19
+ release(): void;
20
+ };
21
+
22
+ let liveRegion: HTMLElement | null = null;
23
+
24
+ function ensureLiveRegion(): HTMLElement {
25
+ if (liveRegion) {
26
+ return liveRegion;
27
+ }
28
+
29
+ if (typeof document === 'undefined') {
30
+ return null as unknown as HTMLElement;
31
+ }
32
+
33
+ const region = document.createElement('div');
34
+ region.setAttribute('role', 'status');
35
+ region.setAttribute('aria-live', 'polite');
36
+ region.setAttribute('aria-atomic', 'true');
37
+ region.style.cssText = 'position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0';
38
+ document.body.appendChild(region);
39
+ liveRegion = region;
40
+ return region;
41
+ }
42
+
43
+ export function defaultAnnounce(message: string): void {
44
+ const region = ensureLiveRegion();
45
+
46
+ if (!region) {
47
+ return;
48
+ }
49
+
50
+ region.textContent = '';
51
+ requestAnimationFrame(() => {
52
+ region.textContent = message;
53
+ });
54
+ }
55
+
56
+ /**
57
+ * Generic keyboard-grab state machine. Maps Space/Enter/Escape/Arrow keys
58
+ * onto grab/commit/cancel/move callbacks. The actual movement logic is
59
+ * delegated to `onMove` since it depends on the host component's topology.
60
+ */
61
+ export default function useKeyboardGrab<TPos>(options: UseKeyboardGrabOptions<TPos>): UseKeyboardGrabReturn {
62
+ const origin = ref<TPos | null>(null);
63
+ const announce = options.announce ?? defaultAnnounce;
64
+
65
+ const isGrabbed = computed<boolean>(() => {
66
+ const id = unref(options.itemId);
67
+ const grabbed = unref(options.grabbedId);
68
+
69
+ return id != null && grabbed === id;
70
+ });
71
+
72
+ function release(): void {
73
+ origin.value = null;
74
+ }
75
+
76
+ function handleKeyDown(evt: KeyboardEvent): void {
77
+ if (!unref(options.isDraggable)) {
78
+ return;
79
+ }
80
+
81
+ const id = unref(options.itemId);
82
+
83
+ if (id == null) {
84
+ return;
85
+ }
86
+
87
+ if (!isGrabbed.value) {
88
+ if (evt.key === ' ' || evt.key === 'Enter') {
89
+ evt.preventDefault();
90
+ origin.value = options.onGrab() as TPos;
91
+ }
92
+
93
+ return;
94
+ }
95
+
96
+ switch (evt.key) {
97
+ case 'ArrowUp':
98
+ evt.preventDefault();
99
+ options.onMove('up');
100
+ break;
101
+
102
+ case 'ArrowDown':
103
+ evt.preventDefault();
104
+ options.onMove('down');
105
+ break;
106
+
107
+ case 'ArrowLeft':
108
+ evt.preventDefault();
109
+ options.onMove('left');
110
+ break;
111
+
112
+ case 'ArrowRight':
113
+ evt.preventDefault();
114
+ options.onMove('right');
115
+ break;
116
+
117
+ case ' ':
118
+ case 'Enter': {
119
+ evt.preventDefault();
120
+ const o = origin.value;
121
+ origin.value = null;
122
+
123
+ if (o !== null) {
124
+ options.onCommit(o);
125
+ }
126
+
127
+ break;
128
+ }
129
+
130
+ case 'Escape': {
131
+ evt.preventDefault();
132
+ const o = origin.value;
133
+ origin.value = null;
134
+
135
+ if (o !== null) {
136
+ options.onCancel(o);
137
+ }
138
+
139
+ break;
140
+ }
141
+ }
142
+
143
+ // Suppress unused-warning when announce is unused inside the function.
144
+ void announce;
145
+ }
146
+
147
+ return {
148
+ isGrabbed,
149
+ handleKeyDown,
150
+ release
151
+ };
152
+ }
@@ -1,6 +1,5 @@
1
1
  import { DateTime } from 'luxon';
2
- import type { Ref } from 'vue';
3
- import { ref, watch } from 'vue';
2
+ import { ref, type Ref, watch } from 'vue';
4
3
 
5
4
  export default function <T>(key: string, initialValue: T): Ref<T> {
6
5
  const realKey = `flux/${key}`;
@@ -1,7 +1,5 @@
1
- import type { Ref } from 'vue';
2
- import { ref, watch } from 'vue';
3
- import type { TemplateRef } from '../util';
4
- import { unrefTemplateElement } from '../util';
1
+ import { ref, type Ref, watch } from 'vue';
2
+ import { type TemplateRef, unrefTemplateElement } from '../util';
5
3
 
6
4
  export default function <TElement extends HTMLElement>(elementRef: TemplateRef<TElement>): UseScrollEdgesReturn {
7
5
  const isAtStart = ref(true);
@@ -1,5 +1,4 @@
1
- import type { Ref } from 'vue';
2
- import { ref, unref } from 'vue';
1
+ import { ref, type Ref, unref } from 'vue';
3
2
  import type { TemplateRef } from '../util';
4
3
  import useEventListener from './useEventListener';
5
4
 
@@ -4,4 +4,4 @@ import vHeightTransition from './heightTransition';
4
4
  export {
5
5
  vFocusTrap,
6
6
  vHeightTransition
7
- }
7
+ };
@@ -2,7 +2,8 @@ import type { FluxMaybePromise } from '@flux-ui/types';
2
2
 
3
3
  export default function <T extends () => FluxMaybePromise<void>>(fn: T): T {
4
4
  if (typeof requestAnimationFrame === 'undefined') {
5
- return (() => {}) as T;
5
+ return (() => {
6
+ }) as T;
6
7
  }
7
8
 
8
9
  let animationFrame = 0;
@@ -1,5 +1,4 @@
1
- import type { VNode } from 'vue';
2
- import { Fragment } from 'vue';
1
+ import { Fragment, type VNode } from 'vue';
3
2
 
4
3
  export default function (vnodes: VNode[]): VNode[] {
5
4
  const flattened: VNode[] = [];
@@ -1,5 +1,5 @@
1
1
  import { isHtmlElement } from '@basmilius/utils';
2
- import { ComponentPublicInstance, ShallowRef, unref } from 'vue';
2
+ import { type ComponentPublicInstance, type ShallowRef, unref } from 'vue';
3
3
 
4
4
  export type TemplateElement<TElement extends HTMLElement> = ComponentPublicInstance<any, any, any, any, any, any, any, any, any, any, any, any, any, any, TElement> | TElement | null;
5
5
  export type TemplateRef<TElement extends HTMLElement> = Readonly<ShallowRef<TemplateElement<TElement>>>;
@@ -1,2 +0,0 @@
1
- import{a as e,d as t,f as n,n as r,r as i,s as a,t as o}from"./util-CwaOsSvo.js";import{computed as s,onMounted as c,onUnmounted as l,ref as u,unref as d,watch as f}from"vue";import{DateTime as p}from"luxon";import{unwrapElement as m,useMutationObserver as h}from"@basmilius/common";function g(e,t){let n=u(!1),r=u(e),i=s(()=>{let e=[],t=d(r).month,n=d(r).startOf(`month`);do e.push(n),n=n.plus({day:1});while(n.month===t);let i=e[0],a=e[e.length-1];for(let t=1;t<i.weekday;++t)e.unshift(i.minus({day:t}));for(let t=a.weekday+1;t<=7;++t)e.push(a.plus({day:t-a.weekday}));for(;e.length/7<6;){let t=e[e.length-1];for(let n=1;n<=7;++n)e.push(t.plus({day:n}))}return e}),a=s(()=>d(i).slice(0,7).map(e=>e.toLocaleString({weekday:t?.weekDayLength??`short`}))),o=s(()=>d(r).plus({month:1})),c=s(()=>d(r).minus({month:1})),l=s(()=>d(r).toLocaleString({month:t?.monthLength??`long`})),f=s(()=>d(r).year.toString());function p(e){n.value=r.value>e,r.value=e}function m(){p(d(r).plus({month:1}))}function h(){p(d(r).minus({month:1}))}return{isTransitioningToPast:n,viewDate:r,viewDateNext:o,viewDatePrevious:c,viewMonth:l,viewYear:f,dates:i,days:a,setViewDate:p,nextMonth:m,previousMonth:h}}function _(e,t){return{months:s(()=>{let n=[],r=d(e),i=r.startOf(`year`);for(;i.month<=12&&i.year===r.year;)n.push({date:i,label:i.toLocaleString({month:t})}),i=i.plus({months:1});return n})}}function v(e,t=10){let n=u(0),r=s(()=>{let r=d(e).year,i=[],a=r-r%t+d(n)*t;for(let e=0;e<t;++e)i.push(a+e);return i});function i(){++n.value}function a(){--n.value}return f(e,()=>n.value=0),{years:r,next:i,previous:a}}function y(e,t,n,r={passive:!0}){f(e,(e,i,a)=>{e&&(e.addEventListener(t,n,r),a(()=>e.removeEventListener(t,n)))},{immediate:!0})}function b(t,n={}){let r=u(n.initial??!1);return f(t,(i,a,o)=>{let s=e(t);if(!s)return;let c=new IntersectionObserver(e=>r.value=e[0]?.isIntersecting??!1,n);c.observe(s),o(()=>c.disconnect())},{immediate:!0}),r}function x(e,t){let n=`flux/${e}`,r=u(i()??t);function i(){if(n in localStorage){let e=JSON.parse(localStorage.getItem(n));return Array.isArray(e)&&e[0]===`DateTime`&&(e=p.fromISO(e[1])),e}return null}return f(r,e=>{let t=e;p.isDateTime(e)&&(t=[`DateTime`,e.toISO({includeOffset:!0,extendedZone:!0})]),localStorage.setItem(n,JSON.stringify(t))}),r}function S(t){let n=u(!0),r=u(!0);return f(t,(i,a,o)=>{let s=e(t);if(!s)return;let c=()=>{let{scrollTop:e,scrollHeight:t,clientHeight:i}=s;n.value=e<=0,r.value=Math.ceil(e+i)>=t},l=new ResizeObserver(c);l.observe(s);for(let e of Array.from(s.children))l.observe(e);let u=new MutationObserver(e=>{for(let t of e){for(let e of Array.from(t.addedNodes))e instanceof Element&&l.observe(e);for(let e of Array.from(t.removedNodes))e instanceof Element&&l.unobserve(e)}c()});u.observe(s,{childList:!0}),s.addEventListener(`scroll`,c,{passive:!0}),c(),o(()=>{s.removeEventListener(`scroll`,c),l.disconnect(),u.disconnect()})},{immediate:!0}),{isAtStart:n,isAtEnd:r}}function C(e){let t=u(0),n=u(0);return e||=u(document),y(e,`scroll`,()=>{let r=d(e);r instanceof Document&&(r=r.scrollingElement),t.value=r?.scrollLeft??0,n.value=r?.scrollTop??0}),{x:t,y:n}}let w=0;function T(e=!1){let t=u(`focus-trap-${++w}`),n=u(!1);return c(()=>r.add(d(t),e=>n.value=e,e)),l(()=>r.remove(d(t))),n}function E(t,n){f(t,(r,i,a)=>{if(!e(t)||d(n))return;let o=document.activeElement;a(()=>{requestAnimationFrame(()=>o?.focus())})})}function D(t,r={}){if(o)return;let{disable:a=u(!1),disableReturn:s=u(!1),attachTo:c=null}=r,l=T(!a);E(t,s),f(t,(r,a,o)=>{let s=e(t),u=c||document;l.value&&s&&document.activeElement&&!s.contains(document.activeElement)&&!s.querySelector(`[autofocus]`)&&i(s,document.activeElement,!0);function d(e){if(!l.value||!s)return;let t=e.target||document.body;s.contains(t)||(e.preventDefault(),e.stopImmediatePropagation(),i(s,t))}function f(e){if(!l.value||!s)return;(!e.relatedTarget||e.relatedTarget===document.body)&&(e.preventDefault(),s.focus());let t=e.target||document.body;s.contains(t)||i(s,t)}if(u.addEventListener(`focusin`,d,{capture:!0}),u.addEventListener(`focusout`,f,{capture:!0}),s){let e=n(s),t=e.findIndex(e=>e.classList.contains(`is-active`)),r=e.findIndex(e=>!e.hasAttribute(`aria-disabled`)),i=e[0];t>-1&&(i=e[t]),r>-1&&(i=e[r]),i&&i.focus()}o(()=>{u.removeEventListener(`focusin`,d),u.removeEventListener(`focusout`,f)})},{immediate:!0}),f(()=>a,()=>{let r=e(t);if(l.value=!a,a||!r)return;let i=n(r);i.includes(document.activeElement)||i[0]?.focus()},{immediate:!0})}function O(e){let t=u(null);c(()=>t.value=r.subscribe(e)),l(()=>t.value?.())}function k(e,{cycle:t=!0,direction:r=`bidirectional`}={}){h(e,()=>a(i(),!1));function i(){let t=n(m(e)),r=t.findIndex(e=>e.classList.contains(`is-active`)),i=t.findIndex(e=>!e.hasAttribute(`aria-disabled`));return r>-1?r:i>-1?i:0}function a(t,r=!0){let i=n(m(e));i.forEach((e,n)=>e.tabIndex=n===t?0:-1),r&&i[t]?.focus()}function o(i){let o=m(e),s=n(o);if(![`Enter`,` `].includes(i.key))switch(r){case`bidirectional`:A(i,o,s,a);break;case`horizontal`:case`vertical`:j(i,o,t,r,s,a);break}}f(e,(t,n,r)=>{let s=m(e);s&&(s.addEventListener(`keydown`,o),a(i(),!1),r(()=>s.removeEventListener(`keydown`,o)))},{immediate:!0})}function A(e,n,r,i){let a;switch(e.key){case`ArrowUp`:a=`up`;break;case`ArrowDown`:a=`down`;break;case`ArrowLeft`:a=`left`;break;case`ArrowRight`:a=`right`;break;default:return}let o=t(n,document.activeElement,a);o&&i(r.indexOf(o)),e.preventDefault()}function j(e,t,n,r,i,o){let s;if(e.key===(r===`horizontal`?`ArrowLeft`:`ArrowUp`))s=-1;else if(e.key===(r===`horizontal`?`ArrowRight`:`ArrowDown`))s=1;else return;let c=a(t,s);c?o(i.indexOf(c)):n&&o(s===1?0:i.length-1),e.preventDefault()}export{T as a,x as c,v as d,_ as f,E as i,b as l,O as n,C as o,g as p,D as r,S as s,k as t,y as u};
2
- //# sourceMappingURL=composable-CJXC7sly.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"composable-CJXC7sly.js","names":["unrefTemplateElement","unrefTemplateElement","FOCUS_TRAP_LOCKS","unrefTemplateElement","useFocusTrapLock","unrefTemplateElement","getFocusableElements","FOCUS_TRAP_LOCKS","getFocusableElements","getBidirectionalFocusElement","getFocusableElement"],"sources":["../src/composable/useCalendar.ts","../src/composable/useCalendarMonthSwitcher.ts","../src/composable/useCalendarYearSwitcher.ts","../src/composable/useEventListener.ts","../src/composable/useInView.ts","../src/composable/useRemembered.ts","../src/composable/useScrollEdges.ts","../src/composable/useScrollPosition.ts","../src/composable/useFocusTrapLock.ts","../src/composable/useFocusTrapReturn.ts","../src/composable/useFocusTrap.ts","../src/composable/useFocusTrapSubscription.ts","../src/composable/useFocusZone.ts"],"sourcesContent":["import type { DateTime } from 'luxon';\nimport { computed, type Ref, ref, unref } from 'vue';\n\nexport default function (initialDate: DateTime, options?: UseCalendarOptions): UseCalendarReturn {\n const isTransitioningToPast = ref(false);\n const viewDate = ref(initialDate);\n\n const dates = computed<DateTime[]>(() => {\n const dates: DateTime[] = [];\n const month = unref(viewDate).month;\n let current = unref(viewDate).startOf('month');\n\n do {\n dates.push(current);\n current = current.plus({day: 1});\n } while (current.month === month);\n\n const first = dates[0];\n const last = dates[dates.length - 1];\n\n for (let i = 1; i < first.weekday; ++i) {\n dates.unshift(first.minus({day: i}));\n }\n\n for (let i = last.weekday + 1; i <= 7; ++i) {\n dates.push(last.plus({day: i - last.weekday}));\n }\n\n while (dates.length / 7 < 6) {\n const last = dates[dates.length - 1];\n\n for (let i = 1; i <= 7; ++i) {\n dates.push(last.plus({day: i}));\n }\n }\n\n return dates;\n });\n\n const days = computed(() => unref(dates)\n .slice(0, 7)\n .map(d => d.toLocaleString({weekday: options?.weekDayLength ?? 'short'})));\n\n const viewDateNext = computed(() => unref(viewDate).plus({month: 1}));\n const viewDatePrevious = computed(() => unref(viewDate).minus({month: 1}));\n const viewMonth = computed(() => unref(viewDate).toLocaleString({month: options?.monthLength ?? 'long'}));\n const viewYear = computed(() => unref(viewDate).year.toString());\n\n function setViewDate(date: DateTime): void {\n isTransitioningToPast.value = viewDate.value > date;\n viewDate.value = date;\n }\n\n function nextMonth(): void {\n setViewDate(unref(viewDate).plus({month: 1}));\n }\n\n function previousMonth(): void {\n setViewDate(unref(viewDate).minus({month: 1}));\n }\n\n return {\n isTransitioningToPast,\n viewDate,\n viewDateNext,\n viewDatePrevious,\n viewMonth,\n viewYear,\n dates,\n days,\n setViewDate,\n nextMonth,\n previousMonth\n };\n}\n\ntype UseCalendarOptions = {\n readonly monthLength?: 'short' | 'long';\n readonly weekDayLength?: 'short' | 'long';\n};\n\ntype UseCalendarReturn = {\n readonly isTransitioningToPast: Ref<boolean>;\n readonly viewDate: Ref<DateTime>;\n readonly viewDateNext: Ref<DateTime>;\n readonly viewDatePrevious: Ref<DateTime>;\n readonly viewMonth: Ref<string>;\n readonly viewYear: Ref<string>;\n readonly dates: Ref<DateTime[]>;\n readonly days: Ref<string[]>;\n\n setViewDate(date: DateTime): void;\n nextMonth(): void;\n previousMonth(): void;\n};\n","import type { DateTime } from 'luxon';\nimport type { Ref } from 'vue';\nimport { computed, unref } from 'vue';\n\nexport default function (currentDate: Ref<DateTime>, displayLength: 'short' | 'long'): UseCalendarMonthSwitcherReturn {\n const months = computed(() => {\n const months: MonthEntry[] = [];\n const now = unref(currentDate);\n let current = now.startOf('year');\n\n while (current.month <= 12 && current.year === now.year) {\n months.push({\n date: current,\n label: current.toLocaleString({month: displayLength})\n });\n current = current.plus({months: 1});\n }\n\n return months;\n });\n\n return {\n months\n };\n}\n\ntype MonthEntry = {\n readonly date: DateTime;\n readonly label: string;\n};\n\ntype UseCalendarMonthSwitcherReturn = {\n readonly months: Ref<MonthEntry[]>;\n};\n","import type { DateTime } from 'luxon';\nimport type { Ref } from 'vue';\nimport { computed, ref, unref, watch } from 'vue';\n\nexport default function (currentDate: Ref<DateTime>, limit: number = 10): UseCalendarYearSwitcherReturn {\n const index = ref(0);\n\n const years = computed(() => {\n const year = unref(currentDate).year;\n const years: number[] = [];\n const start = year - (year % limit) + unref(index) * limit;\n\n for (let i = 0; i < limit; ++i) {\n years.push(start + i);\n }\n\n return years;\n });\n\n function next(): void {\n ++index.value;\n }\n\n function previous(): void {\n --index.value;\n }\n\n watch(currentDate, () => index.value = 0);\n\n return {\n years,\n\n next,\n previous\n };\n}\n\ntype UseCalendarYearSwitcherReturn = {\n readonly years: Ref<number[]>;\n\n next(): void;\n previous(): void;\n};\n","import { watch } from 'vue';\nimport type { TemplateRef } from '../util';\n\nexport default function <K extends keyof HTMLElementEventMap>(elementRef: TemplateRef<HTMLElement>, eventName: K, listener: (evt: HTMLElementEventMap[K]) => any, options: AddEventListenerOptions = {passive: true}): void {\n watch(elementRef, (element: HTMLElement, _, onCleanup) => {\n if (!element) {\n return;\n }\n\n element.addEventListener(eventName, listener, options);\n\n onCleanup(() => element.removeEventListener(eventName, listener));\n }, {immediate: true});\n}\n","import type { Ref } from 'vue';\nimport { ref, watch } from 'vue';\nimport type { TemplateRef } from '../util';\nimport { unrefTemplateElement } from '../util';\n\nexport default function <TElement extends HTMLElement>(containerRef: TemplateRef<TElement>, options: UseInViewOptions = {}): Ref<boolean> {\n const inView = ref(options.initial ?? false);\n\n watch(containerRef, (_, __, onCleanup) => {\n const container = unrefTemplateElement(containerRef);\n\n if (!container) {\n return;\n }\n\n const observer = new IntersectionObserver(entries => inView.value = entries[0]?.isIntersecting ?? false, options);\n observer.observe(container);\n\n onCleanup(() => observer.disconnect());\n }, {immediate: true});\n\n return inView;\n}\n\ntype UseInViewOptions = IntersectionObserverInit & {\n readonly initial?: boolean;\n};\n","import { DateTime } from 'luxon';\nimport type { Ref } from 'vue';\nimport { ref, watch } from 'vue';\n\nexport default function <T>(key: string, initialValue: T): Ref<T> {\n const realKey = `flux/${key}`;\n const value = ref<T>(get() ?? initialValue);\n\n function get(): T | null {\n if (realKey in localStorage) {\n let storageValue = JSON.parse(localStorage.getItem(realKey)!);\n\n if (Array.isArray(storageValue) && storageValue[0] === 'DateTime') {\n storageValue = DateTime.fromISO(storageValue[1]);\n }\n\n return storageValue;\n }\n\n return null;\n }\n\n watch(value, value => {\n let _value: T = value as T;\n\n if (DateTime.isDateTime(value)) {\n _value = ['DateTime', value.toISO({\n includeOffset: true,\n extendedZone: true\n })] as unknown as T;\n }\n\n localStorage.setItem(realKey, JSON.stringify(_value));\n });\n\n return value as Ref<T>;\n}\n","import type { Ref } from 'vue';\nimport { ref, watch } from 'vue';\nimport type { TemplateRef } from '../util';\nimport { unrefTemplateElement } from '../util';\n\nexport default function <TElement extends HTMLElement>(elementRef: TemplateRef<TElement>): UseScrollEdgesReturn {\n const isAtStart = ref(true);\n const isAtEnd = ref(true);\n\n watch(elementRef, (_, __, onCleanup) => {\n const element = unrefTemplateElement(elementRef);\n\n if (!element) {\n return;\n }\n\n const update = (): void => {\n const {scrollTop, scrollHeight, clientHeight} = element;\n\n isAtStart.value = scrollTop <= 0;\n isAtEnd.value = Math.ceil(scrollTop + clientHeight) >= scrollHeight;\n };\n\n const resizeObserver = new ResizeObserver(update);\n resizeObserver.observe(element);\n\n for (const child of Array.from(element.children)) {\n resizeObserver.observe(child);\n }\n\n const mutationObserver = new MutationObserver(mutations => {\n for (const mutation of mutations) {\n for (const node of Array.from(mutation.addedNodes)) {\n if (node instanceof Element) {\n resizeObserver.observe(node);\n }\n }\n\n for (const node of Array.from(mutation.removedNodes)) {\n if (node instanceof Element) {\n resizeObserver.unobserve(node);\n }\n }\n }\n\n update();\n });\n\n mutationObserver.observe(element, {childList: true});\n element.addEventListener('scroll', update, {passive: true});\n\n update();\n\n onCleanup(() => {\n element.removeEventListener('scroll', update);\n resizeObserver.disconnect();\n mutationObserver.disconnect();\n });\n }, {immediate: true});\n\n return {\n isAtStart,\n isAtEnd\n };\n}\n\nexport type UseScrollEdgesReturn = {\n readonly isAtStart: Ref<boolean>;\n readonly isAtEnd: Ref<boolean>;\n};\n","import type { Ref } from 'vue';\nimport { ref, unref } from 'vue';\nimport type { TemplateRef } from '../util';\nimport useEventListener from './useEventListener';\n\nexport default function <TElement extends HTMLElement>(elementRef?: TemplateRef<TElement>): UseScrollPositionReturn {\n const x = ref(0);\n const y = ref(0);\n\n if (!elementRef) {\n elementRef = ref(document);\n }\n\n useEventListener(elementRef, 'scroll', () => {\n let element = unref(elementRef);\n\n if (element instanceof Document) {\n element = element.scrollingElement;\n }\n\n x.value = element?.scrollLeft ?? 0;\n y.value = element?.scrollTop ?? 0;\n });\n\n return {\n x,\n y\n };\n}\n\nexport type UseScrollPositionReturn = {\n readonly x: Ref<number>;\n readonly y: Ref<number>;\n};\n","import type { Ref } from 'vue';\nimport { onMounted, onUnmounted, ref, unref } from 'vue';\nimport { FOCUS_TRAP_LOCKS } from '../util';\n\nlet lockId = 0;\n\nexport default function (autoFocus: boolean = false): Ref<boolean> {\n const id = ref(`focus-trap-${++lockId}`);\n const enabled = ref(false);\n\n onMounted(() => FOCUS_TRAP_LOCKS.add(unref(id), isEnabled => enabled.value = isEnabled, autoFocus));\n onUnmounted(() => FOCUS_TRAP_LOCKS.remove(unref(id)));\n\n return enabled;\n}\n","import { type Ref, unref, watch } from 'vue';\nimport { type TemplateRef, unrefTemplateElement } from '../util';\n\nexport default function (containerRef: TemplateRef<HTMLElement>, disabled: Ref<boolean>): void {\n watch(containerRef, (_, __, onCleanup) => {\n const container = unrefTemplateElement(containerRef);\n\n if (!container || unref(disabled)) {\n return;\n }\n\n const previousTarget = document.activeElement as HTMLElement | null;\n\n onCleanup(() => {\n requestAnimationFrame(() => previousTarget?.focus());\n });\n });\n}\n","import type { Ref } from 'vue';\nimport { ref, watch } from 'vue';\nimport type { TemplateRef } from '../util';\nimport { getFocusableElements, isSSR, unrefTemplateElement, wrapFocus } from '../util';\nimport useFocusTrapLock from './useFocusTrapLock';\nimport useFocusTrapReturn from './useFocusTrapReturn';\n\nexport default function (containerRef: TemplateRef<HTMLElement>, options: UseFocusTrapOptions = {}): void {\n if (isSSR) {\n return;\n }\n\n const {disable = ref(false), disableReturn = ref(false), attachTo = null} = options;\n const enabled = useFocusTrapLock(!disable);\n\n useFocusTrapReturn(containerRef, disableReturn);\n\n watch(containerRef, (_, __, onCleanup) => {\n const container = unrefTemplateElement(containerRef);\n const attach = attachTo || document;\n\n if (enabled.value && container && document.activeElement && !container.contains(document.activeElement) && !container.querySelector('[autofocus]')) {\n wrapFocus(container, document.activeElement, true);\n }\n\n function onFocusIn(evt: FocusEvent): void {\n if (!enabled.value || !container) {\n return;\n }\n\n const newFocusElement = (evt.target as HTMLElement | null) || document.body;\n\n if (container.contains(newFocusElement)) {\n return;\n }\n\n evt.preventDefault();\n evt.stopImmediatePropagation();\n\n wrapFocus(container, newFocusElement);\n }\n\n function onFocusOut(evt: FocusEvent): void {\n if (!enabled.value || !container) {\n return;\n }\n\n if (!evt.relatedTarget || evt.relatedTarget === document.body) {\n evt.preventDefault();\n container.focus();\n }\n\n const newFocusElement = (evt.target as HTMLElement | null) || document.body;\n\n if (container.contains(newFocusElement)) {\n return;\n }\n\n wrapFocus(container, newFocusElement);\n }\n\n attach.addEventListener('focusin', onFocusIn as EventListener, {capture: true});\n attach.addEventListener('focusout', onFocusOut as EventListener, {capture: true});\n\n if (container) {\n const elements = getFocusableElements(container);\n const isActiveIndex = elements.findIndex(e => e.classList.contains('is-active'));\n const notDisabledIndex = elements.findIndex(e => !e.hasAttribute('aria-disabled'));\n let element = elements[0];\n\n if (isActiveIndex > -1) {\n element = elements[isActiveIndex];\n }\n\n if (notDisabledIndex > -1) {\n element = elements[notDisabledIndex];\n }\n\n if (element) {\n element.focus();\n }\n }\n\n onCleanup(() => {\n attach.removeEventListener('focusin', onFocusIn as EventListener);\n attach.removeEventListener('focusout', onFocusOut as EventListener);\n });\n }, {immediate: true});\n\n watch(() => disable, () => {\n const container = unrefTemplateElement(containerRef);\n enabled.value = !disable;\n\n if (disable || !container) {\n return;\n }\n\n const elements = getFocusableElements(container as HTMLElement);\n\n if (elements.includes(document.activeElement as HTMLElement)) {\n return;\n }\n\n elements[0]?.focus();\n }, {immediate: true});\n}\n\ntype UseFocusTrapOptions = {\n attachTo?: HTMLElement | Document;\n disable?: Ref<boolean>;\n disableReturn?: Ref<boolean>;\n};\n","import { onMounted, onUnmounted, ref } from 'vue';\nimport type { FocusTrapListener } from '../util';\nimport { FOCUS_TRAP_LOCKS } from '../util';\n\nexport default function (listener: FocusTrapListener): void {\n const unsubscribe = ref<Function | null>(null);\n\n onMounted(() => unsubscribe.value = FOCUS_TRAP_LOCKS.subscribe(listener));\n onUnmounted(() => unsubscribe.value?.());\n}\n","import { unwrapElement, useMutationObserver } from '@basmilius/common';\nimport { type ComponentPublicInstance, type Ref, watch } from 'vue';\nimport { getBidirectionalFocusElement, getFocusableElement, getFocusableElements } from '../util';\n\ntype EligibleElement = ComponentPublicInstance | HTMLElement;\n\nexport default function <TElement extends EligibleElement>(containerRef: Ref<TElement>, {cycle = true, direction = 'bidirectional'}: UseFocusZoneOptions = {}): void {\n useMutationObserver(containerRef, () => updateFocus(findInitialIndex(), false));\n\n function findInitialIndex(): number {\n const container = unwrapElement(containerRef);\n const elements = getFocusableElements(container);\n const isActiveIndex = elements.findIndex(e => e.classList.contains('is-active'));\n const notDisabledIndex = elements.findIndex(e => !e.hasAttribute('aria-disabled'));\n\n if (isActiveIndex > -1) {\n return isActiveIndex;\n }\n\n if (notDisabledIndex > -1) {\n return notDisabledIndex;\n }\n\n return 0;\n }\n\n function updateFocus(elementIndex: number, doFocus: boolean = true): void {\n const container = unwrapElement(containerRef)!;\n const elements = getFocusableElements(container);\n elements.forEach((elm, index) => elm.tabIndex = index === elementIndex ? 0 : -1);\n\n doFocus && elements[elementIndex]?.focus();\n }\n\n function onKeyDown(evt: KeyboardEvent): void {\n const container = unwrapElement(containerRef)!;\n const elements = getFocusableElements(container);\n\n if (['Enter', ' '].includes(evt.key)) {\n return;\n }\n\n switch (direction) {\n case 'bidirectional':\n handleBidirectionalFocus(evt, container, elements, updateFocus);\n break;\n\n case 'horizontal':\n case 'vertical':\n handleDirectionalFocus(evt, container, cycle, direction, elements, updateFocus);\n break;\n }\n }\n\n watch(containerRef, (_, __, onCleanup) => {\n const container = unwrapElement(containerRef);\n\n if (!container) {\n return;\n }\n\n container.addEventListener('keydown', onKeyDown);\n\n updateFocus(findInitialIndex(), false);\n\n onCleanup(() => container.removeEventListener('keydown', onKeyDown));\n }, {immediate: true});\n}\n\nfunction handleBidirectionalFocus(evt: KeyboardEvent, container: HTMLElement, elements: HTMLElement[], updateFocus: (index: number) => void): void {\n let dir: 'up' | 'down' | 'left' | 'right';\n\n switch (evt.key) {\n case 'ArrowUp':\n dir = 'up';\n break;\n\n case 'ArrowDown':\n dir = 'down';\n break;\n\n case 'ArrowLeft':\n dir = 'left';\n break;\n\n case 'ArrowRight':\n dir = 'right';\n break;\n\n default:\n return;\n }\n\n const element = getBidirectionalFocusElement(container, document.activeElement as HTMLElement, dir);\n\n if (element) {\n updateFocus(elements.indexOf(element));\n }\n\n evt.preventDefault();\n}\n\nfunction handleDirectionalFocus(evt: KeyboardEvent, container: HTMLElement, cycle: boolean, direction: 'horizontal' | 'vertical', elements: HTMLElement[], updateFocus: (index: number) => void): void {\n let dir: number;\n\n if (evt.key === (direction === 'horizontal' ? 'ArrowLeft' : 'ArrowUp')) {\n dir = -1;\n } else if (evt.key === (direction === 'horizontal' ? 'ArrowRight' : 'ArrowDown')) {\n dir = 1;\n } else {\n return;\n }\n\n const element = getFocusableElement(container, dir);\n\n if (element) {\n updateFocus(elements.indexOf(element));\n } else if (cycle) {\n updateFocus(dir === 1 ? 0 : elements.length - 1);\n }\n\n evt.preventDefault();\n}\n\ntype UseFocusZoneOptions = {\n readonly cycle?: boolean;\n readonly direction?: 'bidirectional' | 'horizontal' | 'vertical';\n};\n"],"mappings":"2RAGA,SAAA,EAAyB,EAAuB,EAAiD,CAC7F,IAAM,EAAwB,EAAI,GAAM,CAClC,EAAW,EAAI,EAAY,CA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AAC,CAC/B,GACP,EAAY,IAAQ,EAAI,EAAI,EAAS,OAAS,EAAE,CAGpD,EAAI,gBAAgB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-BhkFHXuX.d.ts","names":[],"sources":["../src/composable/useCalendar.ts","../src/composable/useCalendarMonthSwitcher.ts","../src/composable/useCalendarYearSwitcher.ts","../src/composable/useEventListener.ts","../src/composable/useInView.ts","../src/composable/useRemembered.ts","../src/composable/useScrollEdges.ts","../src/composable/useScrollPosition.ts","../src/composable/useFocusTrap.ts","../src/composable/useFocusTrapLock.ts","../src/composable/useFocusTrapReturn.ts","../src/composable/useFocusTrapSubscription.ts","../src/composable/useFocusZone.ts"],"mappings":";;;;;iBAC+C,iBAAA,CAEtB,WAAA,EAAa,QAAA,EAAU,OAAA,GAAU,kBAAA,GAAqB,iBAAA;AAAA,KAyE1E,kBAAA;EAAA,SACQ,WAAA;EAAA,SACA,aAAA;AAAA;AAAA,KAGR,iBAAA;EAAA,SACQ,qBAAA,EAAuB,GAAA;EAAA,SACvB,QAAA,EAAU,GAAA,CAAI,QAAA;EAAA,SACd,YAAA,EAAc,GAAA,CAAI,QAAA;EAAA,SAClB,gBAAA,EAAkB,GAAA,CAAI,QAAA;EAAA,SACtB,SAAA,EAAW,GAAA;EAAA,SACX,QAAA,EAAU,GAAA;EAAA,SACV,KAAA,EAAO,GAAA,CAAI,QAAA;EAAA,SACX,IAAA,EAAM,GAAA;EAEf,WAAA,CAAY,IAAA,EAAM,QAAA;EAClB,SAAA;EACA,aAAA;AAAA;;;iBC5FqB,iBAAA,CAGA,WAAA,EAAa,GAAA,CAAI,QAAA,GAAW,aAAA,qBAAkC,8BAAA;AAAA,KAsBlF,UAAA;EAAA,SACQ,IAAA,EAAM,QAAA;EAAA,SACN,KAAA;AAAA;AAAA,KAGR,8BAAA;EAAA,SACQ,MAAA,EAAQ,GAAA,CAAI,UAAA;AAAA;;;iBC/BA,iBAAA,CAGA,WAAA,EAAa,GAAA,CAAI,QAAA,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