@lumx/react 4.21.0 → 4.21.1-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_internal/{CcLi-Wuu.js → CusEA38-.js} +111 -6
- package/_internal/CusEA38-.js.map +1 -0
- package/index.d.ts +8 -61
- package/index.js +118 -232
- package/index.js.map +1 -1
- package/package.json +4 -3
- package/utils/index.js +1 -1
- package/_internal/CcLi-Wuu.js.map +0 -1
|
@@ -26,6 +26,104 @@ function useDisabledStateContext() {
|
|
|
26
26
|
return useContext(DisabledStateContext);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
/** Border box of the root element: the viewport, at any document scroll position. */
|
|
30
|
+
const VIEWPORT_BOX = {
|
|
31
|
+
left: 0,
|
|
32
|
+
top: 0,
|
|
33
|
+
scaleX: 1,
|
|
34
|
+
scaleY: 1
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/** Computed overflow values that render a scrollbar. `overlay` is legacy but still in the wild. */
|
|
38
|
+
const SCROLLABLE_OVERFLOW = ['auto', 'scroll', 'overlay'];
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Border box of an element in viewport coordinates, with the scale its CSS transform applies.
|
|
42
|
+
*
|
|
43
|
+
* `getBoundingClientRect` is transformed while the `client*` metrics are not, so a press has to be
|
|
44
|
+
* scaled back into layout space before the two are compared.
|
|
45
|
+
*/
|
|
46
|
+
function getBorderBox(target) {
|
|
47
|
+
const {
|
|
48
|
+
left,
|
|
49
|
+
top,
|
|
50
|
+
width,
|
|
51
|
+
height
|
|
52
|
+
} = target.getBoundingClientRect();
|
|
53
|
+
const {
|
|
54
|
+
offsetWidth,
|
|
55
|
+
offsetHeight
|
|
56
|
+
} = target;
|
|
57
|
+
return {
|
|
58
|
+
left,
|
|
59
|
+
top,
|
|
60
|
+
scaleX: offsetWidth ? width / offsetWidth : 1,
|
|
61
|
+
scaleY: offsetHeight ? height / offsetHeight : 1
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** Check if an axis renders a scrollbar. `hidden`, `clip` and `visible` overflow without one. */
|
|
66
|
+
function rendersScrollbar(overflow, isRoot) {
|
|
67
|
+
// The root element hands its overflow to the viewport, where `visible` behaves as `auto`.
|
|
68
|
+
return SCROLLABLE_OVERFLOW.includes(overflow) || isRoot && overflow === 'visible';
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Check if a mouse press landed in the scrollbar gutter of the element it targets.
|
|
73
|
+
*
|
|
74
|
+
* A browser dispatches a `mousedown` on the scrolling element when you press its scrollbar, and that
|
|
75
|
+
* element is an ancestor of any popover it holds, so click away detection has to ignore the press.
|
|
76
|
+
*
|
|
77
|
+
* Touch is out of scope: a touch has no scrollbar to hit, and `TouchEvent` carries no coordinates.
|
|
78
|
+
*
|
|
79
|
+
* @param event - The press event.
|
|
80
|
+
* @param target - The element the press landed on.
|
|
81
|
+
* @returns `true` if the press landed on a scrollbar of `target`.
|
|
82
|
+
*/
|
|
83
|
+
function isScrollbarPress(event, target) {
|
|
84
|
+
if (!(event instanceof MouseEvent) || !(target instanceof HTMLElement)) {
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
const {
|
|
88
|
+
clientLeft,
|
|
89
|
+
clientTop,
|
|
90
|
+
clientWidth,
|
|
91
|
+
clientHeight,
|
|
92
|
+
scrollWidth,
|
|
93
|
+
scrollHeight
|
|
94
|
+
} = target;
|
|
95
|
+
// A hidden or detached element has no client box, so it renders no scrollbar.
|
|
96
|
+
if (!clientWidth && !clientHeight) {
|
|
97
|
+
return false;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// The root element's border box moves with the scroll position, so measure against the viewport.
|
|
101
|
+
const isRoot = target === target.ownerDocument.documentElement;
|
|
102
|
+
const {
|
|
103
|
+
left,
|
|
104
|
+
top,
|
|
105
|
+
scaleX,
|
|
106
|
+
scaleY
|
|
107
|
+
} = isRoot ? VIEWPORT_BOX : getBorderBox(target);
|
|
108
|
+
// `clientLeft` and `clientTop` cover a scrollbar placed before the padding edge, as in RTL.
|
|
109
|
+
const offsetX = (event.clientX - left) / scaleX - clientLeft;
|
|
110
|
+
const offsetY = (event.clientY - top) / scaleY - clientTop;
|
|
111
|
+
|
|
112
|
+
// A vertical scrollbar sits beside the client box, so it shows up on X. Horizontal mirrors it.
|
|
113
|
+
const beyondClientBoxX = offsetX < 0 || offsetX > clientWidth;
|
|
114
|
+
const beyondClientBoxY = offsetY < 0 || offsetY > clientHeight;
|
|
115
|
+
if (!beyondClientBoxX && !beyondClientBoxY) {
|
|
116
|
+
return false;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// The border sits outside the client box too, hence the overflow checks.
|
|
120
|
+
const {
|
|
121
|
+
overflowX,
|
|
122
|
+
overflowY
|
|
123
|
+
} = getComputedStyle(target);
|
|
124
|
+
return beyondClientBoxX && scrollHeight > clientHeight && rendersScrollbar(overflowY, isRoot) || beyondClientBoxY && scrollWidth > clientWidth && rendersScrollbar(overflowX, isRoot);
|
|
125
|
+
}
|
|
126
|
+
|
|
29
127
|
/**
|
|
30
128
|
* Shared types and logic for ClickAway detection.
|
|
31
129
|
*
|
|
@@ -35,20 +133,27 @@ function useDisabledStateContext() {
|
|
|
35
133
|
* (React context, Vue provide/inject) are implemented in each framework package.
|
|
36
134
|
*/
|
|
37
135
|
|
|
136
|
+
|
|
38
137
|
/** Event types that trigger click away detection. */
|
|
39
138
|
const CLICK_AWAY_EVENT_TYPES = ['mousedown', 'touchstart'];
|
|
40
139
|
|
|
41
140
|
/** Callback triggered when a click away is detected. */
|
|
42
141
|
|
|
43
142
|
/**
|
|
44
|
-
* Check if
|
|
143
|
+
* Check if a press event is a click away from all the given elements.
|
|
45
144
|
*
|
|
145
|
+
* @param event - The press event.
|
|
46
146
|
* @param targets - The event target elements (from `event.target` and `event.composedPath()`).
|
|
47
147
|
* @param elements - The elements considered "inside" the click away context.
|
|
48
|
-
* @returns `true` if the
|
|
148
|
+
* @returns `true` if the press is a click away.
|
|
49
149
|
*/
|
|
50
|
-
function isClickAway(targets, elements) {
|
|
51
|
-
|
|
150
|
+
function isClickAway(event, targets, elements) {
|
|
151
|
+
// Containment first: it costs no layout work and rules out most presses.
|
|
152
|
+
if (elements.some(element => element instanceof Node && targets.some(target => element.contains(target)))) {
|
|
153
|
+
return false;
|
|
154
|
+
}
|
|
155
|
+
// Pressing a scrollbar lands outside the click away context but is not a click away.
|
|
156
|
+
return !targets.some(target => isScrollbarPress(event, target));
|
|
52
157
|
}
|
|
53
158
|
|
|
54
159
|
/**
|
|
@@ -70,7 +175,7 @@ function setupClickAway(getElements, callback) {
|
|
|
70
175
|
const listener = evt => {
|
|
71
176
|
const targets = [evt.composedPath?.()[0], evt.target].filter(t => t instanceof Node);
|
|
72
177
|
const elements = getElements();
|
|
73
|
-
if (isClickAway(targets, elements)) {
|
|
178
|
+
if (isClickAway(evt, targets, elements)) {
|
|
74
179
|
callback(evt);
|
|
75
180
|
}
|
|
76
181
|
};
|
|
@@ -262,4 +367,4 @@ const Portal = ({
|
|
|
262
367
|
};
|
|
263
368
|
|
|
264
369
|
export { ClickAwayProvider as C, DisabledStateProvider as D, InfiniteScroll as I, Portal as P, PortalProvider as a, useDisabledStateContext as u };
|
|
265
|
-
//# sourceMappingURL=
|
|
370
|
+
//# sourceMappingURL=CusEA38-.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CusEA38-.js","sources":["../../src/utils/disabled/DisabledStateContext.tsx","../../../lumx-core/src/js/utils/ClickAway/isScrollbarPress.ts","../../../lumx-core/src/js/utils/ClickAway/index.ts","../../src/hooks/useClickAway.tsx","../../src/utils/ClickAwayProvider/ClickAwayProvider.tsx","../../../lumx-core/src/js/utils/InfiniteScroll/setupInfiniteScrollObserver.ts","../../../lumx-core/src/js/utils/InfiniteScroll/index.tsx","../../src/utils/InfiniteScroll/InfiniteScroll.tsx","../../src/utils/Portal/PortalProvider.tsx","../../src/utils/Portal/Portal.tsx"],"sourcesContent":["import React, { useContext } from 'react';\n\nimport { DisabledStateContextValue } from '@lumx/core/js/utils/disabledState';\n\nexport const DisabledStateContext = React.createContext<DisabledStateContextValue>({ state: null });\n\nexport type DisabledStateProviderProps = DisabledStateContextValue & {\n children: React.ReactNode;\n};\n\n/**\n * Disabled state provider.\n * All nested LumX Design System components inherit this disabled state.\n */\nexport function DisabledStateProvider({ children, ...value }: DisabledStateProviderProps) {\n return <DisabledStateContext.Provider value={value}>{children}</DisabledStateContext.Provider>;\n}\n\n/**\n * Get DisabledState context value\n */\nexport function useDisabledStateContext(): DisabledStateContextValue {\n return useContext(DisabledStateContext);\n}\n","/** Border box of the root element: the viewport, at any document scroll position. */\nconst VIEWPORT_BOX = { left: 0, top: 0, scaleX: 1, scaleY: 1 };\n\n/** Computed overflow values that render a scrollbar. `overlay` is legacy but still in the wild. */\nconst SCROLLABLE_OVERFLOW = ['auto', 'scroll', 'overlay'];\n\n/**\n * Border box of an element in viewport coordinates, with the scale its CSS transform applies.\n *\n * `getBoundingClientRect` is transformed while the `client*` metrics are not, so a press has to be\n * scaled back into layout space before the two are compared.\n */\nfunction getBorderBox(target: HTMLElement) {\n const { left, top, width, height } = target.getBoundingClientRect();\n const { offsetWidth, offsetHeight } = target;\n return {\n left,\n top,\n scaleX: offsetWidth ? width / offsetWidth : 1,\n scaleY: offsetHeight ? height / offsetHeight : 1,\n };\n}\n\n/** Check if an axis renders a scrollbar. `hidden`, `clip` and `visible` overflow without one. */\nfunction rendersScrollbar(overflow: string, isRoot: boolean): boolean {\n // The root element hands its overflow to the viewport, where `visible` behaves as `auto`.\n return SCROLLABLE_OVERFLOW.includes(overflow) || (isRoot && overflow === 'visible');\n}\n\n/**\n * Check if a mouse press landed in the scrollbar gutter of the element it targets.\n *\n * A browser dispatches a `mousedown` on the scrolling element when you press its scrollbar, and that\n * element is an ancestor of any popover it holds, so click away detection has to ignore the press.\n *\n * Touch is out of scope: a touch has no scrollbar to hit, and `TouchEvent` carries no coordinates.\n *\n * @param event - The press event.\n * @param target - The element the press landed on.\n * @returns `true` if the press landed on a scrollbar of `target`.\n */\nexport function isScrollbarPress(event: Event, target: EventTarget | null): boolean {\n if (!(event instanceof MouseEvent) || !(target instanceof HTMLElement)) {\n return false;\n }\n\n const { clientLeft, clientTop, clientWidth, clientHeight, scrollWidth, scrollHeight } = target;\n // A hidden or detached element has no client box, so it renders no scrollbar.\n if (!clientWidth && !clientHeight) {\n return false;\n }\n\n // The root element's border box moves with the scroll position, so measure against the viewport.\n const isRoot = target === target.ownerDocument.documentElement;\n const { left, top, scaleX, scaleY } = isRoot ? VIEWPORT_BOX : getBorderBox(target);\n // `clientLeft` and `clientTop` cover a scrollbar placed before the padding edge, as in RTL.\n const offsetX = (event.clientX - left) / scaleX - clientLeft;\n const offsetY = (event.clientY - top) / scaleY - clientTop;\n\n // A vertical scrollbar sits beside the client box, so it shows up on X. Horizontal mirrors it.\n const beyondClientBoxX = offsetX < 0 || offsetX > clientWidth;\n const beyondClientBoxY = offsetY < 0 || offsetY > clientHeight;\n if (!beyondClientBoxX && !beyondClientBoxY) {\n return false;\n }\n\n // The border sits outside the client box too, hence the overflow checks.\n const { overflowX, overflowY } = getComputedStyle(target);\n return (\n (beyondClientBoxX && scrollHeight > clientHeight && rendersScrollbar(overflowY, isRoot)) ||\n (beyondClientBoxY && scrollWidth > clientWidth && rendersScrollbar(overflowX, isRoot))\n );\n}\n","/**\n * Shared types and logic for ClickAway detection.\n *\n * ClickAway detects clicks outside a set of elements and triggers a callback.\n * The core logic (event listening + target checking) is framework-agnostic.\n * Framework-specific wrappers (React hook, Vue composable) and context providers\n * (React context, Vue provide/inject) are implemented in each framework package.\n */\n\nimport type { Falsy } from '@lumx/core/js/types';\nimport { isScrollbarPress } from '@lumx/core/js/utils/ClickAway/isScrollbarPress';\n\n/** Event types that trigger click away detection. */\nexport const CLICK_AWAY_EVENT_TYPES = ['mousedown', 'touchstart'] as const;\n\n/** Callback triggered when a click away is detected. */\nexport type ClickAwayCallback = EventListener | Falsy;\n\n/**\n * Check if a press event is a click away from all the given elements.\n *\n * @param event - The press event.\n * @param targets - The event target elements (from `event.target` and `event.composedPath()`).\n * @param elements - The elements considered \"inside\" the click away context.\n * @returns `true` if the press is a click away.\n */\nexport function isClickAway(event: Event, targets: HTMLElement[], elements: HTMLElement[]): boolean {\n // Containment first: it costs no layout work and rules out most presses.\n if (elements.some((element) => element instanceof Node && targets.some((target) => element.contains(target)))) {\n return false;\n }\n // Pressing a scrollbar lands outside the click away context but is not a click away.\n return !targets.some((target) => isScrollbarPress(event, target));\n}\n\n/**\n * Imperative setup for click away detection.\n * Adds mousedown/touchstart listeners on `document` and calls the callback when a click\n * occurs outside the elements returned by `getElements`.\n *\n * Note: when `getElements` returns an empty array, any click is considered a click away.\n * Callers should guard against calling `setupClickAway` when no refs are registered.\n *\n * @param getElements - Getter returning the current list of elements considered \"inside\".\n * @param callback - Callback to invoke on click away.\n * @returns A teardown function that removes the event listeners.\n */\nexport function setupClickAway(\n getElements: () => HTMLElement[],\n callback: ClickAwayCallback,\n): (() => void) | undefined {\n if (!callback) {\n return undefined;\n }\n\n const listener: EventListener = (evt) => {\n const targets = [evt.composedPath?.()[0], evt.target].filter((t): t is HTMLElement => t instanceof Node);\n const elements = getElements();\n if (isClickAway(evt, targets, elements)) {\n callback(evt);\n }\n };\n\n CLICK_AWAY_EVENT_TYPES.forEach((evtType) => document.addEventListener(evtType, listener));\n return () => {\n CLICK_AWAY_EVENT_TYPES.forEach((evtType) => document.removeEventListener(evtType, listener));\n };\n}\n","import { RefObject, useEffect } from 'react';\n\nimport { Falsy } from '@lumx/react/utils/type';\nimport { setupClickAway } from '@lumx/core/js/utils/ClickAway';\n\nexport interface ClickAwayParameters {\n /**\n * A callback function to call when the user clicks away from the elements.\n */\n callback: EventListener | Falsy;\n /**\n * Elements considered within the click away context (clicking outside them will trigger the click away callback).\n */\n childrenRefs: RefObject<Array<RefObject<HTMLElement>>>;\n}\n\n/**\n * Listen to clicks away from the given elements and callback the passed in function.\n *\n * Warning: If you need to detect click away on nested React portals, please use the `ClickAwayProvider` component.\n */\nexport function useClickAway({ callback, childrenRefs }: ClickAwayParameters): void {\n useEffect(() => {\n const getElements = () => {\n const refs = childrenRefs.current;\n if (!refs) return [];\n return refs.map((ref) => ref?.current).filter(Boolean) as HTMLElement[];\n };\n return setupClickAway(getElements, callback);\n }, [callback, childrenRefs]);\n}\n","import { createContext, RefObject, useContext, useEffect, useMemo, useRef } from 'react';\nimport { ClickAwayParameters, useClickAway } from '@lumx/react/hooks/useClickAway';\n\ninterface ContextValue {\n childrenRefs: Array<RefObject<HTMLElement>>;\n addRefs(...newChildrenRefs: Array<RefObject<HTMLElement>>): void;\n}\n\nconst ClickAwayAncestorContext = createContext<ContextValue | null>(null);\n\ninterface ClickAwayProviderProps extends ClickAwayParameters {\n /**\n * (Optional) Element that should be considered as part of the parent\n */\n parentRef?: RefObject<HTMLElement>;\n /**\n * Children\n */\n children?: React.ReactNode;\n}\n\n/**\n * Component combining the `useClickAway` hook with a React context to hook into the React component tree and make sure\n * we take into account both the DOM tree and the React tree to detect click away.\n *\n * @return the react component.\n */\nexport const ClickAwayProvider: React.FC<ClickAwayProviderProps> = ({\n children,\n callback,\n childrenRefs,\n parentRef,\n}) => {\n const parentContext = useContext(ClickAwayAncestorContext);\n const currentContext = useMemo(() => {\n const context: ContextValue = {\n childrenRefs: [],\n /**\n * Add element refs to the current context and propagate to the parent context.\n */\n addRefs(...newChildrenRefs) {\n // Add element refs that should be considered as inside the click away context.\n context.childrenRefs.push(...newChildrenRefs);\n\n if (parentContext) {\n // Also add then to the parent context\n parentContext.addRefs(...newChildrenRefs);\n if (parentRef) {\n // The parent element is also considered as inside the parent click away context but not inside the current context\n parentContext.addRefs(parentRef);\n }\n }\n },\n };\n return context;\n }, [parentContext, parentRef]);\n\n useEffect(() => {\n const { current: currentRefs } = childrenRefs;\n if (!currentRefs) {\n return;\n }\n currentContext.addRefs(...currentRefs);\n }, [currentContext, childrenRefs]);\n\n useClickAway({ callback, childrenRefs: useRef(currentContext.childrenRefs) });\n return <ClickAwayAncestorContext.Provider value={currentContext}>{children}</ClickAwayAncestorContext.Provider>;\n};\nClickAwayProvider.displayName = 'ClickAwayProvider';\n","type EventCallback = (evt?: Event) => void;\n\n/**\n * Sets up an IntersectionObserver on the given element.\n * Calls `callback` when at least one observed entry is intersecting.\n * Returns a cleanup function that unobserves the element.\n */\nexport function setupInfiniteScrollObserver(\n element: Element,\n callback: EventCallback,\n options?: IntersectionObserverInit,\n): () => void {\n const observer = new IntersectionObserver((entries = []) => {\n const hasIntersection = entries.some((entry) => entry.isIntersecting);\n\n if (!hasIntersection) {\n return;\n }\n\n callback();\n }, options);\n\n observer.observe(element);\n\n return () => {\n observer.unobserve(element);\n };\n}\n","import type { CommonRef } from '../../types';\n\nexport { setupInfiniteScrollObserver } from './setupInfiniteScrollObserver';\n\nexport const INFINITE_SCROLL_CLASSNAME = 'lumx-infinite-scroll-anchor';\n\nexport interface InfiniteScrollProps {\n /**\n * Callback when infinite scroll component is in view.\n * Omit (e.g. while loading) to temporarily disable without changing the callback's\n * identity when re-enabled — keeps the underlying observer stable.\n */\n // eslint-disable-next-line react/no-unused-prop-types\n callback?(evt?: Event): void;\n /** Customize intersection observer option */\n // eslint-disable-next-line react/no-unused-prop-types\n options?: IntersectionObserverInit;\n}\n\n/**\n * Framework-agnostic InfiniteScroll sentinel component.\n *\n * Renders a tiny invisible div that triggers a callback when it enters the viewport\n * (or intersects its root element) via IntersectionObserver.\n *\n * The div has a small height (4px) to avoid issues when a browser zoom is applied,\n * where a zero-height element might not trigger IntersectionObserver reliably.\n */\nexport const InfiniteScroll = ({ ref }: { ref?: CommonRef }) => (\n // In order to avoid issues when a zoom is added to the browser, we add a small height to the div so that\n // the intersection has a higher chance of working correctly.\n <div ref={ref} aria-hidden=\"true\" className={INFINITE_SCROLL_CLASSNAME} style={{ height: '4px' }} />\n);\n","import React, { useEffect } from 'react';\nimport {\n InfiniteScroll as UI,\n type InfiniteScrollProps,\n setupInfiniteScrollObserver,\n} from '@lumx/core/js/utils/InfiniteScroll';\n\nexport type { InfiniteScrollProps };\n\n/**\n * Handles basic callback pattern by using intersection observers.\n */\nexport const InfiniteScroll: React.FC<InfiniteScrollProps> = ({ callback, options }) => {\n const elementRef = React.useRef<HTMLDivElement | null>(null);\n\n useEffect(() => {\n const { current: element } = elementRef;\n if (!element || !callback) {\n return undefined;\n }\n\n return setupInfiniteScrollObserver(element, callback, options);\n // `options?.root` starts as `null` (before the scrollable list's ref attaches) and is\n // then set to the real element — must be a dep, or the observer gets stuck watching\n // the wrong root (falling back to the viewport) for the component's whole lifetime.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [elementRef.current, callback, options?.root]);\n\n return UI({ ref: elementRef });\n};\n","import React from 'react';\nimport type { PortalInit } from '@lumx/core/js/utils/Portal';\n\nexport type { PortalInit, PortalProviderProps } from '@lumx/core/js/utils/Portal';\n\nexport const PortalContext = React.createContext<PortalInit>(() => ({ container: document.body }));\n\nexport interface ReactPortalProviderProps {\n children?: React.ReactNode;\n value: PortalInit;\n}\n\n/**\n * Customize where <Portal> wrapped elements render (tooltip, popover, dialog, etc.)\n */\nexport const PortalProvider: React.FC<ReactPortalProviderProps> = PortalContext.Provider;\n","import React from 'react';\nimport { createPortal } from 'react-dom';\nimport { PortalContext } from './PortalProvider';\n\nexport type { PortalProps } from '@lumx/core/js/utils/Portal';\n\nexport interface ReactPortalProps {\n enabled?: boolean;\n children: React.ReactNode;\n}\n\n/**\n * Render children in a portal outside the current DOM position\n * (defaults to `document.body` but can be customized with the PortalContextProvider)\n */\nexport const Portal: React.FC<ReactPortalProps> = ({ children, enabled = true }) => {\n const init = React.useContext(PortalContext);\n const context = React.useMemo(\n () => {\n return enabled ? init() : null;\n },\n // Only update on 'enabled'\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [enabled],\n );\n\n React.useLayoutEffect(() => {\n return context?.teardown;\n }, [context?.teardown, enabled]);\n\n const { container } = context ?? {};\n if (!container || typeof container === 'string') {\n return <>{children}</>;\n }\n return createPortal(children, container);\n};\n"],"names":["DisabledStateContext","React","createContext","state","DisabledStateProvider","children","value","_jsx","Provider","useDisabledStateContext","useContext","VIEWPORT_BOX","left","top","scaleX","scaleY","SCROLLABLE_OVERFLOW","getBorderBox","target","width","height","getBoundingClientRect","offsetWidth","offsetHeight","rendersScrollbar","overflow","isRoot","includes","isScrollbarPress","event","MouseEvent","HTMLElement","clientLeft","clientTop","clientWidth","clientHeight","scrollWidth","scrollHeight","ownerDocument","documentElement","offsetX","clientX","offsetY","clientY","beyondClientBoxX","beyondClientBoxY","overflowX","overflowY","getComputedStyle","CLICK_AWAY_EVENT_TYPES","isClickAway","targets","elements","some","element","Node","contains","setupClickAway","getElements","callback","undefined","listener","evt","composedPath","filter","t","forEach","evtType","document","addEventListener","removeEventListener","useClickAway","childrenRefs","useEffect","refs","current","map","ref","Boolean","ClickAwayAncestorContext","ClickAwayProvider","parentRef","parentContext","currentContext","useMemo","context","addRefs","newChildrenRefs","push","currentRefs","useRef","displayName","setupInfiniteScrollObserver","options","observer","IntersectionObserver","entries","hasIntersection","entry","isIntersecting","observe","unobserve","INFINITE_SCROLL_CLASSNAME","InfiniteScroll","className","style","elementRef","root","UI","PortalContext","container","body","PortalProvider","Portal","enabled","init","useLayoutEffect","teardown","_Fragment","createPortal"],"mappings":";;;;AAIO,MAAMA,oBAAoB,gBAAGC,cAAK,CAACC,aAAa,CAA4B;AAAEC,EAAAA,KAAK,EAAE;AAAK,CAAC,CAAC;AAMnG;AACA;AACA;AACA;AACO,SAASC,qBAAqBA,CAAC;EAAEC,QAAQ;EAAE,GAAGC;AAAkC,CAAC,EAAE;AACtF,EAAA,oBAAOC,GAAA,CAACP,oBAAoB,CAACQ,QAAQ,EAAA;AAACF,IAAAA,KAAK,EAAEA,KAAM;AAAAD,IAAAA,QAAA,EAAEA;AAAQ,GAAgC,CAAC;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AAkD,GAAGH,aAAa,CAACrG;;ACJhF;AACA;AACA;AACA;AACO,MAAMyG,MAAkC,GAAGA,CAAC;EAAE5G,QAAQ;AAAE6G,EAAAA,OAAO,GAAG;AAAK,CAAC,KAAK;AAChF,EAAA,MAAMC,IAAI,GAAGlH,cAAK,CAACS,UAAU,CAACmG,aAAa,CAAC;AAC5C,EAAA,MAAMxB,OAAO,GAAGpF,cAAK,CAACmF,OAAO,CACzB,MAAM;AACF,IAAA,OAAO8B,OAAO,GAAGC,IAAI,EAAE,GAAG,IAAI;EAClC,CAAC;AACD;AACA;EACA,CAACD,OAAO,CACZ,CAAC;EAEDjH,cAAK,CAACmH,eAAe,CAAC,MAAM;IACxB,OAAO/B,OAAO,EAAEgC,QAAQ;EAC5B,CAAC,EAAE,CAAChC,OAAO,EAAEgC,QAAQ,EAAEH,OAAO,CAAC,CAAC;EAEhC,MAAM;AAAEJ,IAAAA;AAAU,GAAC,GAAGzB,OAAO,IAAI,EAAE;AACnC,EAAA,IAAI,CAACyB,SAAS,IAAI,OAAOA,SAAS,KAAK,QAAQ,EAAE;IAC7C,oBAAOvG,GAAA,CAAA+G,QAAA,EAAA;AAAAjH,MAAAA,QAAA,EAAGA;AAAQ,KAAG,CAAC;AAC1B,EAAA;AACA,EAAA,oBAAOkH,YAAY,CAAClH,QAAQ,EAAEyG,SAAS,CAAC;AAC5C;;;;"}
|
package/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import * as _lumx_core_js_types from '@lumx/core/js/types';
|
|
|
4
4
|
import { ValueOf as ValueOf$1, GenericProps as GenericProps$1, HasTheme as HasTheme$1, PropsToOverride, HasAriaDisabled as HasAriaDisabled$1, HasRequiredLinkHref as HasRequiredLinkHref$1, HasClassName as HasClassName$1, HasCloseMode as HasCloseMode$1, JSXElement as JSXElement$1, CommonRef as CommonRef$1, Falsy, HeadingElement as HeadingElement$1, HasAriaLabelOrLabelledBy, NamedProps } from '@lumx/core/js/types';
|
|
5
5
|
export * from '@lumx/core/js/types';
|
|
6
6
|
import * as React$1 from 'react';
|
|
7
|
-
import React__default, { Ref, ReactElement, ReactNode, SyntheticEvent, MouseEventHandler, KeyboardEventHandler,
|
|
7
|
+
import React__default, { Ref, ReactElement, ReactNode, SyntheticEvent, MouseEventHandler, KeyboardEventHandler, RefObject, SetStateAction, Key, CSSProperties, ElementType as ElementType$1, HTMLInputTypeAttribute, ComponentProps, ImgHTMLAttributes } from 'react';
|
|
8
8
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
9
9
|
|
|
10
10
|
/** LumX Component Type. */
|
|
@@ -282,11 +282,6 @@ type KebabCase<S> = S extends `${infer C}${infer T}` ? T extends Uncapitalize<T>
|
|
|
282
282
|
/** Transform the component name into the lumx class name. */
|
|
283
283
|
type LumxClassName<TComponentName extends string> = `lumx-${KebabCase<TComponentName>}`;
|
|
284
284
|
|
|
285
|
-
/**
|
|
286
|
-
* Elevation index, used to derive a box-shadow depth.
|
|
287
|
-
*/
|
|
288
|
-
type Elevation = 1 | 2 | 3 | 4 | 5;
|
|
289
|
-
|
|
290
285
|
type HasRequiredLinkHref<E> = E extends 'a' ? {
|
|
291
286
|
href: string;
|
|
292
287
|
} : Record<string, unknown>;
|
|
@@ -787,7 +782,7 @@ declare const CLASSNAME$2: LumxClassName<typeof COMPONENT_NAME$2>;
|
|
|
787
782
|
/**
|
|
788
783
|
* Component default props.
|
|
789
784
|
*/
|
|
790
|
-
declare const DEFAULT_PROPS
|
|
785
|
+
declare const DEFAULT_PROPS: Partial<ButtonProps$1>;
|
|
791
786
|
|
|
792
787
|
interface ButtonProps extends GenericProps$1, ReactToJSX<ButtonProps$1> {
|
|
793
788
|
/** callback for clicking on the button */
|
|
@@ -869,57 +864,6 @@ interface ButtonGroupProps extends GenericProps$1, ReactToJSX<ButtonGroupProps$1
|
|
|
869
864
|
*/
|
|
870
865
|
declare const ButtonGroup: Comp<ButtonGroupProps, HTMLDivElement>;
|
|
871
866
|
|
|
872
|
-
/**
|
|
873
|
-
* Defines the props of the component.
|
|
874
|
-
*/
|
|
875
|
-
interface CardProps$1 extends HasClassName {
|
|
876
|
-
/** Customize the rendered root element (e.g. `div`, `article`, `section`, `li`, `aside`), defaults to `div`. */
|
|
877
|
-
as?: any;
|
|
878
|
-
/** Content of the card. */
|
|
879
|
-
children?: JSXElement;
|
|
880
|
-
/** Elevation depth of the card, defaults to no elevation. */
|
|
881
|
-
elevation?: Elevation;
|
|
882
|
-
/** reference to the root element */
|
|
883
|
-
ref?: CommonRef;
|
|
884
|
-
}
|
|
885
|
-
/**
|
|
886
|
-
* Component default props.
|
|
887
|
-
*/
|
|
888
|
-
declare const DEFAULT_PROPS: {
|
|
889
|
-
readonly as: "div";
|
|
890
|
-
};
|
|
891
|
-
/** Root element rendered when no `as` prop is provided. */
|
|
892
|
-
type DefaultCardTag = typeof DEFAULT_PROPS.as;
|
|
893
|
-
|
|
894
|
-
/**
|
|
895
|
-
* Defines the props of the component.
|
|
896
|
-
*/
|
|
897
|
-
type CardProps<E extends ElementType$1 = DefaultCardTag> = GenericProps$1 & ReactToJSX<CardProps$1, 'as'> & HasPolymorphicAs$1<E> & {
|
|
898
|
-
/** Card content. */
|
|
899
|
-
children?: ReactNode;
|
|
900
|
-
};
|
|
901
|
-
/**
|
|
902
|
-
* Card component.
|
|
903
|
-
*
|
|
904
|
-
* @param props Component props.
|
|
905
|
-
* @param ref Component ref.
|
|
906
|
-
* @return React element.
|
|
907
|
-
*/
|
|
908
|
-
declare const Card: (<E extends ElementType$1 = "div">(props: GenericProps$1 & ReactToJSX<CardProps$1, "as"> & React$1.PropsWithoutRef<React$1.ComponentProps<E>> & {
|
|
909
|
-
as?: E | undefined;
|
|
910
|
-
} & {
|
|
911
|
-
/** Card content. */
|
|
912
|
-
children?: ReactNode;
|
|
913
|
-
} & React$1.ComponentProps<E> & {
|
|
914
|
-
ref?: ComponentRef<E> | undefined;
|
|
915
|
-
}) => React.JSX.Element) & {
|
|
916
|
-
displayName: string;
|
|
917
|
-
className: "lumx-card";
|
|
918
|
-
defaultProps: {
|
|
919
|
-
readonly as: "div";
|
|
920
|
-
};
|
|
921
|
-
};
|
|
922
|
-
|
|
923
867
|
/**
|
|
924
868
|
* Defines the props of the component.
|
|
925
869
|
*/
|
|
@@ -1527,7 +1471,10 @@ interface Offset {
|
|
|
1527
1471
|
/** Offset size away from the reference. */
|
|
1528
1472
|
away?: number;
|
|
1529
1473
|
}
|
|
1530
|
-
|
|
1474
|
+
/**
|
|
1475
|
+
* Popover elevation index.
|
|
1476
|
+
*/
|
|
1477
|
+
type Elevation = 1 | 2 | 3 | 4 | 5;
|
|
1531
1478
|
/** Popover size value — pixel value, or "t-shirt" size token. */
|
|
1532
1479
|
type PopoverSize = PXSize | (typeof POPOVER_SIZES)[number];
|
|
1533
1480
|
/** Popover height value — extends PopoverSize with viewport-relative unit. */
|
|
@@ -5928,5 +5875,5 @@ declare const ThemeProvider: React__default.FC<{
|
|
|
5928
5875
|
/** Get the theme in the current context. */
|
|
5929
5876
|
declare function useTheme(): ThemeContextValue;
|
|
5930
5877
|
|
|
5931
|
-
export { AlertDialog, Autocomplete, AutocompleteMultiple, Avatar, Badge, BadgeWrapper, Button, ButtonEmphasis, ButtonGroup, CLASSNAME$2 as CLASSNAME, COMPONENT_NAME$2 as COMPONENT_NAME,
|
|
5932
|
-
export type { AlertDialogProps, AutocompleteMultipleProps, AutocompleteProps, AvatarProps, AvatarSize, BadgeProps, BadgeWrapperProps, BaseButtonProps, ButtonGroupProps, ButtonProps, ButtonSize,
|
|
5878
|
+
export { AlertDialog, Autocomplete, AutocompleteMultiple, Avatar, Badge, BadgeWrapper, Button, ButtonEmphasis, ButtonGroup, CLASSNAME$2 as CLASSNAME, COMPONENT_NAME$2 as COMPONENT_NAME, Checkbox, Chip, ChipGroup, Combobox, CommentBlock, CommentBlockVariant, DEFAULT_PROPS, DatePicker, DatePickerControlled, DatePickerField, Dialog, DialogHeading, Divider, DragHandle, Dropdown, ExpansionPanel, Flag, FlexBox, GenericBlock, GenericBlockGapSize, Grid, GridColumn, GridItem, Heading, HeadingLevelProvider, Icon, IconButton, ImageBlock, ImageBlockCaptionPosition, ImageLightbox, InlineList, InputHelper, InputLabel, Lightbox, Link, LinkPreview, List, ListDivider, ListItem, ListSection, ListSubheader, MenuButton, ListDivider as MenuDivider, MenuItem, Message, Mosaic, Navigation, Notification, Placement, Popover, PopoverDialog, PostBlock, Progress, ProgressCircular, ProgressLinear, ProgressTracker, ProgressTrackerProvider, ProgressTrackerStep, ProgressTrackerStepPanel, ProgressVariant, RadioButton, RadioGroup, RawInputText, RawInputTextarea, Select, SelectButton, SelectMultiple, SelectMultipleField, SelectTextField, SelectVariant, SelectionChipGroup, SideNavigation, SideNavigationItem, SkeletonCircle, SkeletonRectangle, SkeletonRectangleVariant, SkeletonTypography, Slider, Slides, Slideshow, SlideshowControls, SlideshowItem, Switch, CLASSNAME as TIME_PICKER_FIELD_CLASSNAME, COMPONENT_NAME as TIME_PICKER_FIELD_COMPONENT_NAME, Tab, TabList, TabListLayout, TabPanel, TabProvider, Table, TableBody, TableCell, TableCellVariant, TableCellVariant as TableCellVariantType, TableHeader, TableRow, Text, TextField, ThOrder, ThOrder as ThOrderType, ThemeProvider, Thumbnail, ThumbnailAspectRatio, ThumbnailObjectFit, ThumbnailVariant, TimePickerField, Toolbar, Tooltip, Uploader, UploaderVariant, UserBlock, clamp, useFocusPointStyle, useHeadingLevel, useTheme };
|
|
5879
|
+
export type { AlertDialogProps, AutocompleteMultipleProps, AutocompleteProps, AvatarProps, AvatarSize, BadgeProps, BadgeWrapperProps, BaseButtonProps, ButtonGroupProps, ButtonProps, ButtonSize, CheckboxProps, ChipGroupProps, ChipProps, ComboboxButtonProps, ComboboxInputProps, ComboboxListProps, ComboboxOptionActionProps, ComboboxOptionMoreInfoProps, ComboboxOptionProps, ComboboxOptionSkeletonProps, ComboboxPopoverComponentProps, ComboboxPopoverProps, ComboboxProviderProps, ComboboxSectionProps, ComboboxStateProps, CommentBlockProps, DatePickerControlledProps, DatePickerFieldProps, DatePickerProps, DialogHeadingProps, DialogProps, DialogSizes, DividerProps, DragHandleProps, DropdownProps, Elevation, ExpansionPanelProps, FlagProps, FlexBoxProps, FlexHorizontalAlignment, FlexVerticalAlignment, FocusPoint, GapSize, GenericBlockProps, GenericBlockSectionProps, GridColumnGapSize, GridColumnProps, GridItemProps, GridProps, HeadingLevelProviderProps, HeadingProps, IconButtonProps, IconProps, IconSizes, ImageBlockProps, ImageBlockSize, ImageLightboxProps, InlineListProps, InputHelperProps, InputLabelProps, LightboxProps, LinkPreviewProps, LinkProps, ListDividerProps, ListItemProps, ListItemSize, ListProps, ListSectionProps, ListSubheaderProps, MarginAutoAlignment, MenuButtonProps, ListDividerProps as MenuDividerProps, MenuItemActionProps, MenuItemProps, MessageProps, MosaicProps, MultipleSelectButtonProps, MultipleSelectTextFieldProps, NavigationProps, NotificationProps, Offset, PopoverDialogProps, PopoverHeight, PopoverProps, PopoverWidth, PostBlockProps, ProgressCircularProps, ProgressCircularSize, ProgressLinearProps, ProgressProps, ProgressTrackerProps, ProgressTrackerProviderProps, ProgressTrackerStepPanelProps, ProgressTrackerStepProps, RadioButtonProps, RadioGroupProps, RawInputTextProps, RawInputTextareaProps, SelectButtonProps, SelectListStatus as SelectButtonStatus, SelectButtonTranslations, SelectListStatus, SelectMultipleProps, SelectProps, SelectTextFieldProps, SelectListStatus as SelectTextFieldStatus, SelectTextFieldTranslations, SelectionChipGroupProps, SideNavigationItemProps, SideNavigationProps, SingleSelectButtonProps, SingleSelectTextFieldProps, SkeletonCircleProps, SkeletonRectangleProps, SkeletonTypographyProps, SliderProps, SlidesProps, SlideshowControlsProps, SlideshowItemProps, SlideshowProps, SwitchProps, TabListProps, TabPanelProps, TabProps, TabProviderProps, TableBodyProps, TableCellProps, TableHeaderProps, TableProps, TableRowProps, TextFieldProps, TextProps, ThumbnailProps, ThumbnailSize, TimePickerFieldProps, ToolbarProps, TooltipPlacement, TooltipProps, UploaderProps, UploaderSize, UserBlockProps, UserBlockSize };
|