@kobalte/utils
Advanced tools
Comparing version 0.9.0 to 0.9.1
@@ -10,9 +10,2 @@ import { Accessor, JSX, ValidComponent, ComponentProps } from 'solid-js'; | ||
/*! | ||
* Portions of this file are based on code from ariakit. | ||
* MIT Licensed, Copyright (c) Diego Haz. | ||
* | ||
* Credits to the Ariakit team: | ||
* https://github.com/ariakit/ariakit/blob/da142672eddefa99365773ced72171facc06fdcb/packages/ariakit-utils/src/array.ts | ||
*/ | ||
/** | ||
@@ -27,13 +20,6 @@ * Immutably adds an item at the given index to an array. | ||
/*! | ||
* Original code by Chakra UI | ||
* MIT Licensed, Copyright (c) 2019 Segun Adebayo. | ||
* | ||
* Credits to the Chakra UI team: | ||
* https://github.com/chakra-ui/chakra-ui/blob/main/packages/utils/src/assertion.ts | ||
*/ | ||
declare function isNumber(value: any): value is number; | ||
declare function isArray<T>(value: any): value is Array<T>; | ||
declare function isString(value: any): value is string; | ||
declare function isFunction<T extends Function = Function>(value: any): value is T; | ||
declare function isNumber(value: unknown): value is number; | ||
declare function isArray<T>(value: unknown): value is Array<T>; | ||
declare function isString(value: unknown): value is string; | ||
declare function isFunction<T extends Function = Function>(value: unknown): value is T; | ||
@@ -45,9 +31,2 @@ /** | ||
/*! | ||
* Portions of this file are based on code from react-spectrum. | ||
* Apache License Version 2.0, Copyright 2020 Adobe. | ||
* | ||
* Credits to the React Spectrum team: | ||
* https://github.com/solidjs-community/solid-aria/blob/2c5f54feb5cfea514b1ee0a52d0416878f882351/packages/utils/src/createGlobalListeners.ts | ||
*/ | ||
interface GlobalListeners { | ||
@@ -62,9 +41,2 @@ addGlobalListener<K extends keyof DocumentEventMap>(el: EventTarget, type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; | ||
/*! | ||
* Portions of this file are based on code from ariakit. | ||
* MIT Licensed, Copyright (c) Diego Haz. | ||
* | ||
* Credits to the Ariakit team: | ||
* https://github.com/ariakit/ariakit/blob/232bc79018ec20967fec1e097a9474aba3bb5be7/packages/ariakit-utils/src/dom.ts | ||
*/ | ||
/** | ||
@@ -115,10 +87,2 @@ * Similar to `Element.prototype.contains`, but a little faster when `element` is the same as `child`. | ||
/*! | ||
* Portions of this file are based on code from react-spectrum. | ||
* Apache License Version 2.0, Copyright 2020 Adobe. | ||
* | ||
* Credits to the React Spectrum team: | ||
* https://github.com/adobe/react-spectrum/blob/f6e686fe9d3b983d48650980c1ecfdde320bc62f/packages/@react-aria/focus/src/FocusScope.tsx | ||
*/ | ||
interface FocusManager { | ||
@@ -154,27 +118,6 @@ /** Moves focus to the next focusable or tabbable element in the focus scope. */ | ||
/*! | ||
* Portions of this file are based on code from react-spectrum. | ||
* Apache License Version 2.0, Copyright 2020 Adobe. | ||
* | ||
* Credits to the React Spectrum team: | ||
* https://github.com/adobe/react-spectrum/blob/a9dea8a3672179e6c38aafd1429daf44c7ea2ff6/packages/@react-aria/utils/src/focusWithoutScrolling.ts | ||
*/ | ||
declare function focusWithoutScrolling(element: HTMLElement | null | undefined): void; | ||
/*! | ||
* Portions of this file are based on code from react-spectrum. | ||
* Apache License Version 2.0, Copyright 2020 Adobe. | ||
* | ||
* Credits to the React Spectrum team: | ||
* https://github.com/adobe/react-spectrum/blob/a9dea8a3672179e6c38aafd1429daf44c7ea2ff6/packages/@react-aria/utils/src/getScrollParent.ts | ||
*/ | ||
declare function getScrollParent(node: Element | null): Element; | ||
/*! | ||
* Portions of this file are based on code from react-spectrum. | ||
* Apache License Version 2.0, Copyright 2020 Adobe. | ||
* | ||
* Credits to the React Spectrum team: | ||
* https://github.com/adobe/react-spectrum/blob/a9dea8a3672179e6c38aafd1429daf44c7ea2ff6/packages/@react-aria/utils/src/isVirtualEvent.ts | ||
*/ | ||
declare function isVirtualClick(event: MouseEvent | PointerEvent): boolean; | ||
@@ -186,9 +129,2 @@ declare function isVirtualPointerEvent(event: PointerEvent): boolean; | ||
/*! | ||
* Portions of this file are based on code from react-spectrum. | ||
* Apache License Version 2.0, Copyright 2020 Adobe. | ||
* | ||
* Credits to the React Spectrum team: | ||
* https://github.com/adobe/react-spectrum/blob/ff3e690fffc6c54367b8057e28a0e5b9211f37b5/packages/@react-stately/utils/src/number.ts | ||
*/ | ||
/** | ||
@@ -199,10 +135,4 @@ * Takes a value and forces it to the closest min/max if it's outside. Also forces it to the closest valid step. | ||
declare function snapValueToStep(value: number, min: number, max: number, step: number): number; | ||
declare const getPrecision: (n: number) => number; | ||
/*! | ||
* Portions of this file are based on code from react-spectrum. | ||
* Apache License Version 2.0, Copyright 2020 Adobe. | ||
* | ||
* Credits to the React Spectrum team: | ||
* https://github.com/adobe/react-spectrum/blob/cf9ab24f3255be1530d0f584061a01aa1e8180e6/packages/@react-aria/utils/src/platform.ts | ||
*/ | ||
declare function isMac(): boolean; | ||
@@ -217,10 +147,2 @@ declare function isIPhone(): boolean; | ||
/*! | ||
* Portions of this file are based on code from ariakit. | ||
* MIT Licensed, Copyright (c) Diego Haz. | ||
* | ||
* Credits to the Ariakit team: | ||
* https://github.com/ariakit/ariakit/blob/84e97943ad637a582c01c9b56d880cd95f595737/packages/ariakit/src/hovercard/__utils/polygon.ts | ||
* https://github.com/ariakit/ariakit/blob/f2a96973de523d67e41eec983263936c489ef3e2/packages/ariakit/src/hovercard/__utils/debug-polygon.ts | ||
*/ | ||
type Point = [number, number]; | ||
@@ -242,20 +164,6 @@ type Polygon = Point[]; | ||
type OverrideComponentProps<T extends ValidComponent, P> = OverrideProps<ComponentProps<T>, P>; | ||
declare function mergeDefaultProps<T extends Record<string, any>>(defaultProps: Partial<T>, props: T): T; | ||
declare function mergeDefaultProps<T extends {}, D extends Partial<T>>(defaultProps: D, props: T): OverrideProps<T, D>; | ||
/*! | ||
* Portions of this file are based on code from react-spectrum. | ||
* Apache License Version 2.0, Copyright 2020 Adobe. | ||
* | ||
* Credits to the React Spectrum team: | ||
* https://github.com/adobe/react-spectrum/blob/a9dea8a3672179e6c38aafd1429daf44c7ea2ff6/packages/@react-aria/utils/src/runAfterTransition.ts | ||
*/ | ||
declare function runAfterTransition(fn: () => void): void; | ||
/*! | ||
* Portions of this file are based on code from react-spectrum. | ||
* Apache License Version 2.0, Copyright 2020 Adobe. | ||
* | ||
* Credits to the React Spectrum team: | ||
* https://github.com/adobe/react-spectrum/blob/8f2f2acb3d5850382ebe631f055f88c704aa7d17/packages/@react-aria/utils/src/scrollIntoView.ts | ||
*/ | ||
interface ScrollIntoViewportOpts { | ||
@@ -280,16 +188,2 @@ /** The optional containing element of the target to be centered in the viewport. */ | ||
/*! | ||
* Portions of this file are based on code from ariakit. | ||
* MIT Licensed, Copyright (c) Diego Haz. | ||
* | ||
* Credits to the Ariakit team: | ||
* https://github.com/ariakit/ariakit/blob/main/packages/ariakit-utils/src/focus.ts | ||
* | ||
* Portions of this file are based on code from react-spectrum. | ||
* Apache License Version 2.0, Copyright 2020 Adobe. | ||
* | ||
* Credits to the React Spectrum team: | ||
* https://github.com/adobe/react-spectrum/blob/main/packages/%40react-aria/focus/src/isElementVisible.ts | ||
* https://github.com/adobe/react-spectrum/blob/8f2f2acb3d5850382ebe631f055f88c704aa7d17/packages/@react-aria/focus/src/FocusScope.tsx | ||
*/ | ||
declare const FOCUSABLE_ELEMENT_SELECTOR: string; | ||
@@ -343,2 +237,2 @@ declare const TABBABLE_ELEMENT_SELECTOR: string; | ||
export { EventKey, FOCUSABLE_ELEMENT_SELECTOR, FocusManager, FocusManagerOptions, Orientation, OverrideComponentProps, OverrideProps, Point, Polygon, RangeValue, TABBABLE_ELEMENT_SELECTOR, ValidationState, addItemToArray, callHandler, clamp, composeEventHandlers, contains, createFocusManager, createGenerateId, createGlobalListeners, debugPolygon, focusWithoutScrolling, getActiveElement, getAllTabbableIn, getDocument, getEventPoint, getFocusableTreeWalker, getScrollParent, getWindow, hasFocusWithin, isAndroid, isAppleDevice, isArray, isChrome, isCtrlKey, isElementVisible, isFocusable, isFrame, isFunction, isIOS, isIPad, isIPhone, isMac, isNumber, isPointInPolygon, isString, isTabbable, isVirtualClick, isVirtualPointerEvent, isWebKit, mergeDefaultProps, noop, removeItemFromArray, runAfterTransition, scrollIntoView, scrollIntoViewport, snapValueToStep, visuallyHiddenStyles }; | ||
export { EventKey, FOCUSABLE_ELEMENT_SELECTOR, FocusManager, FocusManagerOptions, Orientation, OverrideComponentProps, OverrideProps, Point, Polygon, RangeValue, TABBABLE_ELEMENT_SELECTOR, ValidationState, addItemToArray, callHandler, clamp, composeEventHandlers, contains, createFocusManager, createGenerateId, createGlobalListeners, debugPolygon, focusWithoutScrolling, getActiveElement, getAllTabbableIn, getDocument, getEventPoint, getFocusableTreeWalker, getPrecision, getScrollParent, getWindow, hasFocusWithin, isAndroid, isAppleDevice, isArray, isChrome, isCtrlKey, isElementVisible, isFocusable, isFrame, isFunction, isIOS, isIPad, isIPhone, isMac, isNumber, isPointInPolygon, isString, isTabbable, isVirtualClick, isVirtualPointerEvent, isWebKit, mergeDefaultProps, noop, removeItemFromArray, runAfterTransition, scrollIntoView, scrollIntoViewport, snapValueToStep, visuallyHiddenStyles }; |
@@ -83,3 +83,6 @@ import { onCleanup, mergeProps } from 'solid-js'; | ||
if (isFrame(activeElement) && activeElement.contentDocument) { | ||
return getActiveElement(activeElement.contentDocument.body, activeDescendant); | ||
return getActiveElement( | ||
activeElement.contentDocument.body, | ||
activeDescendant | ||
); | ||
} | ||
@@ -131,3 +134,3 @@ if (activeDescendant) { | ||
// @ts-ignore | ||
window.navigator["userAgentData"]?.brands.some( | ||
window.navigator.userAgentData?.brands.some( | ||
(brand) => re.test(brand.brand) | ||
@@ -138,5 +141,5 @@ ) || re.test(window.navigator.userAgent) | ||
function testPlatform(re) { | ||
return typeof window !== "undefined" && window.navigator != null ? ( | ||
return typeof window !== "undefined" && window.navigator != null ? re.test( | ||
// @ts-ignore | ||
re.test(window.navigator["userAgentData"]?.platform || window.navigator.platform) | ||
window.navigator.userAgentData?.platform || window.navigator.platform | ||
) : false; | ||
@@ -271,4 +274,9 @@ } | ||
]; | ||
var tabbableElements = [...focusableElements, '[tabindex]:not([tabindex="-1"]):not([disabled])']; | ||
var FOCUSABLE_ELEMENT_SELECTOR = focusableElements.join(":not([hidden]),") + ",[tabindex]:not([disabled]):not([hidden])"; | ||
var tabbableElements = [ | ||
...focusableElements, | ||
'[tabindex]:not([tabindex="-1"]):not([disabled])' | ||
]; | ||
var FOCUSABLE_ELEMENT_SELECTOR = `${focusableElements.join( | ||
":not([hidden])," | ||
)},[tabindex]:not([disabled]):not([hidden])`; | ||
var TABBABLE_ELEMENT_SELECTOR = tabbableElements.join( | ||
@@ -278,3 +286,5 @@ ':not([hidden]):not([tabindex="-1"]),' | ||
function getAllTabbableIn(container, includeContainer) { | ||
const elements = Array.from(container.querySelectorAll(FOCUSABLE_ELEMENT_SELECTOR)); | ||
const elements = Array.from( | ||
container.querySelectorAll(FOCUSABLE_ELEMENT_SELECTOR) | ||
); | ||
const tabbableElements2 = elements.filter(isTabbable); | ||
@@ -300,3 +310,3 @@ if (includeContainer && isTabbable(container)) { | ||
function hasNegativeTabIndex(element) { | ||
const tabIndex = parseInt(element.getAttribute("tabindex") || "0", 10); | ||
const tabIndex = Number.parseInt(element.getAttribute("tabindex") || "0", 10); | ||
return tabIndex < 0; | ||
@@ -332,3 +342,5 @@ } | ||
if (!contains(element, activeElement)) { | ||
const activeDescendant = activeElement.getAttribute("aria-activedescendant"); | ||
const activeDescendant = activeElement.getAttribute( | ||
"aria-activedescendant" | ||
); | ||
if (!activeDescendant) { | ||
@@ -344,5 +356,4 @@ return false; | ||
return !!element.querySelector(`#${CSS.escape(activeDescendant)}`); | ||
} else { | ||
return true; | ||
} | ||
return true; | ||
} | ||
@@ -413,3 +424,6 @@ | ||
} | ||
const { tabbable = defaultOptions().tabbable, accept = defaultOptions().accept } = opts; | ||
const { | ||
tabbable = defaultOptions().tabbable, | ||
accept = defaultOptions().accept | ||
} = opts; | ||
const walker = getFocusableTreeWalker(root, { tabbable, accept }); | ||
@@ -427,3 +441,6 @@ const nextNode = walker.nextNode(); | ||
} | ||
const { tabbable = defaultOptions().tabbable, accept = defaultOptions().accept } = opts; | ||
const { | ||
tabbable = defaultOptions().tabbable, | ||
accept = defaultOptions().accept | ||
} = opts; | ||
const walker = getFocusableTreeWalker(root, { tabbable, accept }); | ||
@@ -486,10 +503,13 @@ const next = last(walker); | ||
function getScrollParent(node) { | ||
while (node && !isScrollable(node)) { | ||
node = node.parentElement; | ||
let parentNode = node; | ||
while (parentNode && !isScrollable(parentNode)) { | ||
parentNode = parentNode.parentElement; | ||
} | ||
return node || document.scrollingElement || document.documentElement; | ||
return parentNode || document.scrollingElement || document.documentElement; | ||
} | ||
function isScrollable(node) { | ||
const style = window.getComputedStyle(node); | ||
return /(auto|scroll)/.test(style.overflow + style.overflowX + style.overflowY); | ||
return /(auto|scroll)/.test( | ||
style.overflow + style.overflowX + style.overflowY | ||
); | ||
} | ||
@@ -517,15 +537,15 @@ | ||
// src/number.ts | ||
function clamp(value, min = -Infinity, max = Infinity) { | ||
function clamp(value, min = Number.NEGATIVE_INFINITY, max = Number.POSITIVE_INFINITY) { | ||
return Math.min(Math.max(value, min), max); | ||
} | ||
function snapValueToStep(value, min, max, step) { | ||
const remainder = (value - (isNaN(min) ? 0 : min)) % step; | ||
const remainder = (value - (Number.isNaN(min) ? 0 : min)) % step; | ||
let snappedValue = Math.abs(remainder) * 2 >= step ? value + Math.sign(remainder) * (step - Math.abs(remainder)) : value - remainder; | ||
if (!isNaN(min)) { | ||
if (!Number.isNaN(min)) { | ||
if (snappedValue < min) { | ||
snappedValue = min; | ||
} else if (!isNaN(max) && snappedValue > max) { | ||
} else if (!Number.isNaN(max) && snappedValue > max) { | ||
snappedValue = min + Math.floor((max - min) / step) * step; | ||
} | ||
} else if (!isNaN(max) && snappedValue > max) { | ||
} else if (!Number.isNaN(max) && snappedValue > max) { | ||
snappedValue = Math.floor(max / step) * step; | ||
@@ -537,3 +557,3 @@ } | ||
if (precision > 0) { | ||
const pow = Math.pow(10, precision); | ||
const pow = 10 ** precision; | ||
snappedValue = Math.round(snappedValue * pow) / pow; | ||
@@ -543,2 +563,11 @@ } | ||
} | ||
var getPrecision = (n) => { | ||
let e = 1; | ||
let precision = 0; | ||
while (Math.round(n * e) / e !== n) { | ||
e *= 10; | ||
precision++; | ||
} | ||
return precision; | ||
}; | ||
@@ -586,3 +615,3 @@ // src/polygon.ts | ||
} | ||
} else if (y == yi && (x >= xj && x <= xi || x >= xi && x <= xj)) { | ||
} else if (y === yi && (x >= xj && x <= xi || x >= xi && x <= xj)) { | ||
return true; | ||
@@ -609,3 +638,6 @@ } | ||
svg.style.zIndex = "999999"; | ||
const polygon = document.createElementNS("http://www.w3.org/2000/svg", "polygon"); | ||
const polygon = document.createElementNS( | ||
"http://www.w3.org/2000/svg", | ||
"polygon" | ||
); | ||
polygon.setAttribute("id", id); | ||
@@ -642,3 +674,6 @@ polygon.setAttribute("points", "0,0 0,0"); | ||
transitionsByElement.set(e.target, transitions); | ||
e.target.addEventListener("transitioncancel", onTransitionEnd); | ||
e.target.addEventListener( | ||
"transitioncancel", | ||
onTransitionEnd | ||
); | ||
} | ||
@@ -657,3 +692,6 @@ transitions.add(e.propertyName); | ||
if (properties.size === 0) { | ||
e.target.removeEventListener("transitioncancel", onTransitionEnd); | ||
e.target.removeEventListener( | ||
"transitioncancel", | ||
onTransitionEnd | ||
); | ||
transitionsByElement.delete(e.target); | ||
@@ -718,3 +756,4 @@ } | ||
break; | ||
} else if (child.offsetParent.contains(ancestor)) { | ||
} | ||
if (child.offsetParent.contains(ancestor)) { | ||
sum -= ancestor[prop]; | ||
@@ -736,3 +775,6 @@ break; | ||
if (Math.abs(originalLeft - newLeft) > 1 || Math.abs(originalTop - newTop) > 1) { | ||
opts?.containingElement?.scrollIntoView?.({ block: "center", inline: "center" }); | ||
opts?.containingElement?.scrollIntoView?.({ | ||
block: "center", | ||
inline: "center" | ||
}); | ||
targetElement.scrollIntoView?.({ block: "nearest" }); | ||
@@ -743,3 +785,6 @@ } | ||
while (targetElement && scrollParent && targetElement !== root && scrollParent !== root) { | ||
scrollIntoView(scrollParent, targetElement); | ||
scrollIntoView( | ||
scrollParent, | ||
targetElement | ||
); | ||
targetElement = scrollParent; | ||
@@ -765,111 +810,5 @@ scrollParent = getScrollParent(targetElement); | ||
}; | ||
/*! | ||
* Portions of this file are based on code from ariakit. | ||
* MIT Licensed, Copyright (c) Diego Haz. | ||
* | ||
* Credits to the Ariakit team: | ||
* https://github.com/ariakit/ariakit/blob/da142672eddefa99365773ced72171facc06fdcb/packages/ariakit-utils/src/array.ts | ||
*/ | ||
/*! | ||
* Original code by Chakra UI | ||
* MIT Licensed, Copyright (c) 2019 Segun Adebayo. | ||
* | ||
* Credits to the Chakra UI team: | ||
* https://github.com/chakra-ui/chakra-ui/blob/main/packages/utils/src/assertion.ts | ||
*/ | ||
/*! | ||
* Portions of this file are based on code from react-spectrum. | ||
* Apache License Version 2.0, Copyright 2020 Adobe. | ||
* | ||
* Credits to the React Spectrum team: | ||
* https://github.com/solidjs-community/solid-aria/blob/2c5f54feb5cfea514b1ee0a52d0416878f882351/packages/utils/src/createGlobalListeners.ts | ||
*/ | ||
/*! | ||
* Portions of this file are based on code from ariakit. | ||
* MIT Licensed, Copyright (c) Diego Haz. | ||
* | ||
* Credits to the Ariakit team: | ||
* https://github.com/ariakit/ariakit/blob/232bc79018ec20967fec1e097a9474aba3bb5be7/packages/ariakit-utils/src/dom.ts | ||
*/ | ||
/*! | ||
* Portions of this file are based on code from react-spectrum. | ||
* Apache License Version 2.0, Copyright 2020 Adobe. | ||
* | ||
* Credits to the React Spectrum team: | ||
* https://github.com/adobe/react-spectrum/blob/cf9ab24f3255be1530d0f584061a01aa1e8180e6/packages/@react-aria/utils/src/platform.ts | ||
*/ | ||
/*! | ||
* Portions of this file are based on code from react-spectrum. | ||
* Apache License Version 2.0, Copyright 2020 Adobe. | ||
* | ||
* Credits to the React Spectrum team: | ||
* https://github.com/adobe/react-spectrum/blob/a9dea8a3672179e6c38aafd1429daf44c7ea2ff6/packages/@react-aria/utils/src/focusWithoutScrolling.ts | ||
*/ | ||
/*! | ||
* Portions of this file are based on code from ariakit. | ||
* MIT Licensed, Copyright (c) Diego Haz. | ||
* | ||
* Credits to the Ariakit team: | ||
* https://github.com/ariakit/ariakit/blob/main/packages/ariakit-utils/src/focus.ts | ||
* | ||
* Portions of this file are based on code from react-spectrum. | ||
* Apache License Version 2.0, Copyright 2020 Adobe. | ||
* | ||
* Credits to the React Spectrum team: | ||
* https://github.com/adobe/react-spectrum/blob/main/packages/%40react-aria/focus/src/isElementVisible.ts | ||
* https://github.com/adobe/react-spectrum/blob/8f2f2acb3d5850382ebe631f055f88c704aa7d17/packages/@react-aria/focus/src/FocusScope.tsx | ||
*/ | ||
/*! | ||
* Portions of this file are based on code from react-spectrum. | ||
* Apache License Version 2.0, Copyright 2020 Adobe. | ||
* | ||
* Credits to the React Spectrum team: | ||
* https://github.com/adobe/react-spectrum/blob/f6e686fe9d3b983d48650980c1ecfdde320bc62f/packages/@react-aria/focus/src/FocusScope.tsx | ||
*/ | ||
/*! | ||
* Portions of this file are based on code from react-spectrum. | ||
* Apache License Version 2.0, Copyright 2020 Adobe. | ||
* | ||
* Credits to the React Spectrum team: | ||
* https://github.com/adobe/react-spectrum/blob/a9dea8a3672179e6c38aafd1429daf44c7ea2ff6/packages/@react-aria/utils/src/getScrollParent.ts | ||
*/ | ||
/*! | ||
* Portions of this file are based on code from react-spectrum. | ||
* Apache License Version 2.0, Copyright 2020 Adobe. | ||
* | ||
* Credits to the React Spectrum team: | ||
* https://github.com/adobe/react-spectrum/blob/a9dea8a3672179e6c38aafd1429daf44c7ea2ff6/packages/@react-aria/utils/src/isVirtualEvent.ts | ||
*/ | ||
/*! | ||
* Portions of this file are based on code from react-spectrum. | ||
* Apache License Version 2.0, Copyright 2020 Adobe. | ||
* | ||
* Credits to the React Spectrum team: | ||
* https://github.com/adobe/react-spectrum/blob/ff3e690fffc6c54367b8057e28a0e5b9211f37b5/packages/@react-stately/utils/src/number.ts | ||
*/ | ||
/*! | ||
* Portions of this file are based on code from ariakit. | ||
* MIT Licensed, Copyright (c) Diego Haz. | ||
* | ||
* Credits to the Ariakit team: | ||
* https://github.com/ariakit/ariakit/blob/84e97943ad637a582c01c9b56d880cd95f595737/packages/ariakit/src/hovercard/__utils/polygon.ts | ||
* https://github.com/ariakit/ariakit/blob/f2a96973de523d67e41eec983263936c489ef3e2/packages/ariakit/src/hovercard/__utils/debug-polygon.ts | ||
*/ | ||
/*! | ||
* Portions of this file are based on code from react-spectrum. | ||
* Apache License Version 2.0, Copyright 2020 Adobe. | ||
* | ||
* Credits to the React Spectrum team: | ||
* https://github.com/adobe/react-spectrum/blob/a9dea8a3672179e6c38aafd1429daf44c7ea2ff6/packages/@react-aria/utils/src/runAfterTransition.ts | ||
*/ | ||
/*! | ||
* Portions of this file are based on code from react-spectrum. | ||
* Apache License Version 2.0, Copyright 2020 Adobe. | ||
* | ||
* Credits to the React Spectrum team: | ||
* https://github.com/adobe/react-spectrum/blob/8f2f2acb3d5850382ebe631f055f88c704aa7d17/packages/@react-aria/utils/src/scrollIntoView.ts | ||
*/ | ||
export { EventKey, FOCUSABLE_ELEMENT_SELECTOR, TABBABLE_ELEMENT_SELECTOR, addItemToArray, callHandler, clamp, composeEventHandlers, contains, createFocusManager, createGenerateId, createGlobalListeners, debugPolygon, focusWithoutScrolling, getActiveElement, getAllTabbableIn, getDocument, getEventPoint, getFocusableTreeWalker, getScrollParent, getWindow, hasFocusWithin, isAndroid, isAppleDevice, isArray, isChrome, isCtrlKey, isElementVisible, isFocusable, isFrame, isFunction, isIOS, isIPad, isIPhone, isMac, isNumber, isPointInPolygon, isString, isTabbable, isVirtualClick, isVirtualPointerEvent, isWebKit, mergeDefaultProps, noop, removeItemFromArray, runAfterTransition, scrollIntoView, scrollIntoViewport, snapValueToStep, visuallyHiddenStyles }; | ||
export { EventKey, FOCUSABLE_ELEMENT_SELECTOR, TABBABLE_ELEMENT_SELECTOR, addItemToArray, callHandler, clamp, composeEventHandlers, contains, createFocusManager, createGenerateId, createGlobalListeners, debugPolygon, focusWithoutScrolling, getActiveElement, getAllTabbableIn, getDocument, getEventPoint, getFocusableTreeWalker, getPrecision, getScrollParent, getWindow, hasFocusWithin, isAndroid, isAppleDevice, isArray, isChrome, isCtrlKey, isElementVisible, isFocusable, isFrame, isFunction, isIOS, isIPad, isIPhone, isMac, isNumber, isPointInPolygon, isString, isTabbable, isVirtualClick, isVirtualPointerEvent, isWebKit, mergeDefaultProps, noop, removeItemFromArray, runAfterTransition, scrollIntoView, scrollIntoViewport, snapValueToStep, visuallyHiddenStyles }; | ||
//# sourceMappingURL=out.js.map | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@kobalte/utils", | ||
"version": "0.9.0", | ||
"version": "0.9.1", | ||
"private": false, | ||
@@ -38,3 +38,4 @@ "description": "Common utilities and types for Kobalte.", | ||
"require": "./dist/index.cjs" | ||
} | ||
}, | ||
"./src/*": "./src/*" | ||
}, | ||
@@ -44,4 +45,6 @@ "main": "./dist/index.cjs", | ||
"types": "./dist/index.d.ts", | ||
"source": "src/index.ts", | ||
"files": [ | ||
"dist" | ||
"dist", | ||
"src" | ||
], | ||
@@ -58,3 +61,3 @@ "dependencies": { | ||
"peerDependencies": { | ||
"solid-js": "^1.7.11" | ||
"solid-js": "^1.8.8" | ||
}, | ||
@@ -61,0 +64,0 @@ "publishConfig": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
32
3089
235246