@molecule/app-ui-react-native 2.0.1 → 2.2.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/README.md +81 -10
- package/dist/components/Alert.d.ts.map +1 -1
- package/dist/components/Alert.js +2 -3
- package/dist/components/Button.d.ts +3 -1
- package/dist/components/Button.d.ts.map +1 -1
- package/dist/components/Button.js +35 -3
- package/dist/components/Skeleton.d.ts.map +1 -1
- package/dist/components/Skeleton.js +13 -12
- package/dist/components/Spinner.js +2 -2
- package/dist/elements/Anchor.d.ts +15 -0
- package/dist/elements/Anchor.d.ts.map +1 -0
- package/dist/elements/Anchor.js +57 -0
- package/dist/elements/Box.d.ts +19 -0
- package/dist/elements/Box.d.ts.map +1 -0
- package/dist/elements/Box.js +157 -0
- package/dist/elements/CheckField.d.ts +18 -0
- package/dist/elements/CheckField.d.ts.map +1 -0
- package/dist/elements/CheckField.js +103 -0
- package/dist/elements/Disclosure.d.ts +11 -0
- package/dist/elements/Disclosure.d.ts.map +1 -0
- package/dist/elements/Disclosure.js +67 -0
- package/dist/elements/Fieldset.d.ts +16 -0
- package/dist/elements/Fieldset.d.ts.map +1 -0
- package/dist/elements/Fieldset.js +34 -0
- package/dist/elements/FileField.d.ts +12 -0
- package/dist/elements/FileField.d.ts.map +1 -0
- package/dist/elements/FileField.js +111 -0
- package/dist/elements/FormArea.d.ts +18 -0
- package/dist/elements/FormArea.d.ts.map +1 -0
- package/dist/elements/FormArea.js +42 -0
- package/dist/elements/GlyphIcon.d.ts +19 -0
- package/dist/elements/GlyphIcon.d.ts.map +1 -0
- package/dist/elements/GlyphIcon.js +43 -0
- package/dist/elements/Image.d.ts +17 -0
- package/dist/elements/Image.d.ts.map +1 -0
- package/dist/elements/Image.js +26 -0
- package/dist/elements/Link.d.ts +20 -0
- package/dist/elements/Link.d.ts.map +1 -0
- package/dist/elements/Link.js +53 -0
- package/dist/elements/Pressable.d.ts +18 -0
- package/dist/elements/Pressable.d.ts.map +1 -0
- package/dist/elements/Pressable.js +108 -0
- package/dist/elements/PulseDots.d.ts +15 -0
- package/dist/elements/PulseDots.d.ts.map +1 -0
- package/dist/elements/PulseDots.js +78 -0
- package/dist/elements/RangeField.d.ts +11 -0
- package/dist/elements/RangeField.d.ts.map +1 -0
- package/dist/elements/RangeField.js +266 -0
- package/dist/elements/RichText.d.ts +23 -0
- package/dist/elements/RichText.d.ts.map +1 -0
- package/dist/elements/RichText.js +55 -0
- package/dist/elements/Rule.d.ts +11 -0
- package/dist/elements/Rule.d.ts.map +1 -0
- package/dist/elements/Rule.js +19 -0
- package/dist/elements/ScrollArea.d.ts +21 -0
- package/dist/elements/ScrollArea.d.ts.map +1 -0
- package/dist/elements/ScrollArea.js +101 -0
- package/dist/elements/SelectAction.d.ts +20 -0
- package/dist/elements/SelectAction.d.ts.map +1 -0
- package/dist/elements/SelectAction.js +117 -0
- package/dist/elements/SelectField.d.ts +11 -0
- package/dist/elements/SelectField.d.ts.map +1 -0
- package/dist/elements/SelectField.js +220 -0
- package/dist/elements/SelectMenu.d.ts +19 -0
- package/dist/elements/SelectMenu.d.ts.map +1 -0
- package/dist/elements/SelectMenu.js +122 -0
- package/dist/elements/Svg.d.ts +155 -0
- package/dist/elements/Svg.d.ts.map +1 -0
- package/dist/elements/Svg.js +535 -0
- package/dist/elements/TableBox.d.ts +19 -0
- package/dist/elements/TableBox.d.ts.map +1 -0
- package/dist/elements/TableBox.js +87 -0
- package/dist/elements/TableCell.d.ts +16 -0
- package/dist/elements/TableCell.d.ts.map +1 -0
- package/dist/elements/TableCell.js +69 -0
- package/dist/elements/Text.d.ts +17 -0
- package/dist/elements/Text.d.ts.map +1 -0
- package/dist/elements/Text.js +96 -0
- package/dist/elements/TextField.d.ts +25 -0
- package/dist/elements/TextField.d.ts.map +1 -0
- package/dist/elements/TextField.js +257 -0
- package/dist/elements/accessibility.d.ts +36 -0
- package/dist/elements/accessibility.d.ts.map +1 -0
- package/dist/elements/accessibility.js +244 -0
- package/dist/elements/className.d.ts +45 -0
- package/dist/elements/className.d.ts.map +1 -0
- package/dist/elements/className.js +8 -0
- package/dist/elements/decimal.d.ts +5 -0
- package/dist/elements/decimal.d.ts.map +1 -0
- package/dist/elements/decimal.js +11 -0
- package/dist/elements/documentUrl.d.ts +35 -0
- package/dist/elements/documentUrl.d.ts.map +1 -0
- package/dist/elements/documentUrl.js +89 -0
- package/dist/elements/drag-drop.d.ts +11 -0
- package/dist/elements/drag-drop.d.ts.map +1 -0
- package/dist/elements/drag-drop.js +277 -0
- package/dist/elements/drag.d.ts +53 -0
- package/dist/elements/drag.d.ts.map +1 -0
- package/dist/elements/drag.js +520 -0
- package/dist/elements/dragModifiers.d.ts +22 -0
- package/dist/elements/dragModifiers.d.ts.map +1 -0
- package/dist/elements/dragModifiers.js +62 -0
- package/dist/elements/events.d.ts +45 -0
- package/dist/elements/events.d.ts.map +1 -0
- package/dist/elements/events.js +101 -0
- package/dist/elements/fieldBounds.d.ts +5 -0
- package/dist/elements/fieldBounds.d.ts.map +1 -0
- package/dist/elements/fieldBounds.js +60 -0
- package/dist/elements/flow.d.ts +36 -0
- package/dist/elements/flow.d.ts.map +1 -0
- package/dist/elements/flow.js +47 -0
- package/dist/elements/form.d.ts +48 -0
- package/dist/elements/form.d.ts.map +1 -0
- package/dist/elements/form.js +112 -0
- package/dist/elements/grid.d.ts +96 -0
- package/dist/elements/grid.d.ts.map +1 -0
- package/dist/elements/grid.js +272 -0
- package/dist/elements/index.d.ts +36 -0
- package/dist/elements/index.d.ts.map +1 -0
- package/dist/elements/index.js +35 -0
- package/dist/elements/inherited.d.ts +181 -0
- package/dist/elements/inherited.d.ts.map +1 -0
- package/dist/elements/inherited.js +512 -0
- package/dist/elements/labels.d.ts +39 -0
- package/dist/elements/labels.d.ts.map +1 -0
- package/dist/elements/labels.js +163 -0
- package/dist/elements/measure.d.ts +27 -0
- package/dist/elements/measure.d.ts.map +1 -0
- package/dist/elements/measure.js +24 -0
- package/dist/elements/outsidePress.d.ts +31 -0
- package/dist/elements/outsidePress.d.ts.map +1 -0
- package/dist/elements/outsidePress.js +94 -0
- package/dist/elements/paste.d.ts +22 -0
- package/dist/elements/paste.d.ts.map +1 -0
- package/dist/elements/paste.js +49 -0
- package/dist/elements/press.d.ts +41 -0
- package/dist/elements/press.d.ts.map +1 -0
- package/dist/elements/press.js +131 -0
- package/dist/elements/rangeKeyboard.d.ts +41 -0
- package/dist/elements/rangeKeyboard.d.ts.map +1 -0
- package/dist/elements/rangeKeyboard.js +58 -0
- package/dist/elements/rangeValues.d.ts +20 -0
- package/dist/elements/rangeValues.d.ts.map +1 -0
- package/dist/elements/rangeValues.js +101 -0
- package/dist/elements/ref.d.ts +16 -0
- package/dist/elements/ref.d.ts.map +1 -0
- package/dist/elements/ref.js +22 -0
- package/dist/elements/reveal.d.ts +8 -0
- package/dist/elements/reveal.d.ts.map +1 -0
- package/dist/elements/reveal.js +10 -0
- package/dist/elements/scrollReveal.d.ts +19 -0
- package/dist/elements/scrollReveal.d.ts.map +1 -0
- package/dist/elements/scrollReveal.js +52 -0
- package/dist/elements/selectOptions.d.ts +25 -0
- package/dist/elements/selectOptions.d.ts.map +1 -0
- package/dist/elements/selectOptions.js +60 -0
- package/dist/elements/style.d.ts +30 -0
- package/dist/elements/style.d.ts.map +1 -0
- package/dist/elements/style.js +368 -0
- package/dist/elements/svgHover.d.ts +41 -0
- package/dist/elements/svgHover.d.ts.map +1 -0
- package/dist/elements/svgHover.js +152 -0
- package/dist/elements/table.d.ts +52 -0
- package/dist/elements/table.d.ts.map +1 -0
- package/dist/elements/table.js +104 -0
- package/dist/elements/types.d.ts +25 -0
- package/dist/elements/types.d.ts.map +1 -0
- package/dist/elements/types.js +8 -0
- package/dist/elements/viewport.d.ts +53 -0
- package/dist/elements/viewport.d.ts.map +1 -0
- package/dist/elements/viewport.js +62 -0
- package/dist/elements/wheelZoom.d.ts +12 -0
- package/dist/elements/wheelZoom.d.ts.map +1 -0
- package/dist/elements/wheelZoom.js +8 -0
- package/dist/index.d.ts +9 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -4
- package/dist/platform/focus.d.ts +31 -0
- package/dist/platform/focus.d.ts.map +1 -0
- package/dist/platform/focus.js +93 -0
- package/dist/platform/index.d.ts +31 -0
- package/dist/platform/index.d.ts.map +1 -0
- package/dist/platform/index.js +179 -0
- package/dist/platform/layout.d.ts +13 -0
- package/dist/platform/layout.d.ts.map +1 -0
- package/dist/platform/layout.js +15 -0
- package/dist/platform/position.d.ts +5 -0
- package/dist/platform/position.d.ts.map +1 -0
- package/dist/platform/position.js +177 -0
- package/dist/platform/stack.d.ts +86 -0
- package/dist/platform/stack.d.ts.map +1 -0
- package/dist/platform/stack.js +318 -0
- package/package.json +67 -8
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Column sizes and row positions shared by native table elements.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import { createContext, useCallback, useMemo, useState } from 'react';
|
|
7
|
+
/** The colspan limit used by HTML cells. */
|
|
8
|
+
export function cellSpan(span) {
|
|
9
|
+
return span !== undefined && Number.isFinite(span)
|
|
10
|
+
? Math.min(1000, Math.max(1, Math.floor(span)))
|
|
11
|
+
: 1;
|
|
12
|
+
}
|
|
13
|
+
/** A native layout dimension that fixes a column, or undefined for an automatic width. */
|
|
14
|
+
export function fixedLength(width) {
|
|
15
|
+
if (typeof width === 'number' && Number.isFinite(width) && width >= 0)
|
|
16
|
+
return width;
|
|
17
|
+
if (typeof width === 'string' && /^\d+(?:\.\d+)?%$/.test(width))
|
|
18
|
+
return width;
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
/** Resolves a fixed dimension against the table's proposed width. */
|
|
22
|
+
export function widthIn(width, available) {
|
|
23
|
+
if (typeof width === 'number')
|
|
24
|
+
return width;
|
|
25
|
+
return width !== undefined && available !== undefined
|
|
26
|
+
? (Number.parseFloat(width) * available) / 100
|
|
27
|
+
: undefined;
|
|
28
|
+
}
|
|
29
|
+
/** Whether the table needs to measure the content of this cell before it can lay it out. */
|
|
30
|
+
export function needsNaturalWidth(track) {
|
|
31
|
+
return track.span === 1 && track.fixed === undefined;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Resolves a table's column widths from the widest unspanned cells. Fixed columns
|
|
35
|
+
* keep their widths. When there is room, auto columns grow in proportion to their
|
|
36
|
+
* natural widths. A wide table keeps its natural sizes so the scroll area can pan.
|
|
37
|
+
*
|
|
38
|
+
* @param available - The table or viewport width.
|
|
39
|
+
* @param cells - The mounted cells and their measurements.
|
|
40
|
+
* @returns The width of each column from left to right.
|
|
41
|
+
*/
|
|
42
|
+
export function tableColumnWidths(available, cells) {
|
|
43
|
+
const count = cells.reduce((end, { track }) => Math.max(end, track.column + track.span), 0);
|
|
44
|
+
const natural = new Array(count).fill(0);
|
|
45
|
+
const fixed = new Map();
|
|
46
|
+
for (const { track, natural: measured } of cells) {
|
|
47
|
+
if (track.span > 1)
|
|
48
|
+
continue;
|
|
49
|
+
const width = widthIn(track.fixed, available);
|
|
50
|
+
if (width !== undefined) {
|
|
51
|
+
fixed.set(track.column, Math.max(fixed.get(track.column) ?? 0, width));
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
natural[track.column] = Math.max(natural[track.column] ?? 0, measured ?? 0);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
const autoTotal = natural.reduce((sum, width, column) => sum + (fixed.has(column) ? 0 : width), 0);
|
|
58
|
+
const fixedTotal = Array.from(fixed.values()).reduce((sum, width) => sum + width, 0);
|
|
59
|
+
const extra = Math.max(0, available - fixedTotal - autoTotal);
|
|
60
|
+
const autoCount = count - fixed.size;
|
|
61
|
+
return natural.map((width, column) => fixed.get(column) ??
|
|
62
|
+
(autoTotal > 0 ? width + (extra * width) / autoTotal : extra / autoCount));
|
|
63
|
+
}
|
|
64
|
+
/** A table's current column widths and the callbacks its cells use to report dimensions. */
|
|
65
|
+
export function useTableLayout(available) {
|
|
66
|
+
const [cells, setCells] = useState(() => new Map());
|
|
67
|
+
const register = useCallback((id, track) => {
|
|
68
|
+
setCells((previous) => new Map(previous).set(id, { track }));
|
|
69
|
+
return () => {
|
|
70
|
+
setCells((previous) => {
|
|
71
|
+
if (previous.get(id)?.track !== track)
|
|
72
|
+
return previous;
|
|
73
|
+
const next = new Map(previous);
|
|
74
|
+
next.delete(id);
|
|
75
|
+
return next;
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
}, []);
|
|
79
|
+
const measure = useCallback((id, track, natural) => {
|
|
80
|
+
if (!Number.isFinite(natural) || natural < 0)
|
|
81
|
+
return;
|
|
82
|
+
setCells((previous) => {
|
|
83
|
+
const cell = previous.get(id);
|
|
84
|
+
if (!cell || cell.track !== track || cell.natural !== undefined)
|
|
85
|
+
return previous;
|
|
86
|
+
return new Map(previous).set(id, { track, natural });
|
|
87
|
+
});
|
|
88
|
+
}, []);
|
|
89
|
+
const widths = useMemo(() => {
|
|
90
|
+
if (available === undefined)
|
|
91
|
+
return undefined;
|
|
92
|
+
const current = Array.from(cells.values());
|
|
93
|
+
if (current.some(({ track, natural }) => needsNaturalWidth(track) && natural === undefined))
|
|
94
|
+
return undefined;
|
|
95
|
+
return tableColumnWidths(available, current);
|
|
96
|
+
}, [available, cells]);
|
|
97
|
+
return useMemo(() => ({ register, measure, widths }), [register, measure, widths]);
|
|
98
|
+
}
|
|
99
|
+
/** The shared layout of the nearest table. */
|
|
100
|
+
export const TableLayout = createContext(null);
|
|
101
|
+
/** The starting column assigned by the nearest row. */
|
|
102
|
+
export const TableColumn = createContext(undefined);
|
|
103
|
+
/** A row's position within its own group. */
|
|
104
|
+
export const TableRowPosition = createContext(undefined);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* React types of the renderer-neutral elements' children and refs, the same as the web kit's
|
|
3
|
+
* (`@molecule/app-ui-react/elements`), so a feature compiled against the web declarations is
|
|
4
|
+
* type-correct here.
|
|
5
|
+
*
|
|
6
|
+
* @module
|
|
7
|
+
*/
|
|
8
|
+
import type { ReactElement, ReactNode, Ref } from 'react';
|
|
9
|
+
import type { ElementHandle } from '@molecule/app-ui';
|
|
10
|
+
/**
|
|
11
|
+
* What an element holds: anything React renders. A native container puts bare text in a `Text`,
|
|
12
|
+
* as the web puts it in an anonymous box, with the text classes the container hands down.
|
|
13
|
+
*/
|
|
14
|
+
export type ElementNode = ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* What an `Svg` or `G` holds: shapes, groups and `SvgText`. A string is not accepted, because
|
|
17
|
+
* an SVG draws text only inside a text element.
|
|
18
|
+
*/
|
|
19
|
+
export type ShapeNode = ReactElement | null | undefined | false | readonly ShapeNode[];
|
|
20
|
+
/** The `ref` every element takes: the host view on native. */
|
|
21
|
+
export interface ElementRefProps {
|
|
22
|
+
/** Receives the rendered host view (see {@link ElementHandle}). */
|
|
23
|
+
ref?: Ref<ElementHandle>;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/elements/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAEzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAErD;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,SAAS,CAAA;AAEnC;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,YAAY,GAAG,IAAI,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,SAAS,EAAE,CAAA;AAEtF,8DAA8D;AAC9D,MAAM,WAAW,eAAe;IAC9B,mEAAmE;IACnE,GAAG,CAAC,EAAE,GAAG,CAAC,aAAa,CAAC,CAAA;CACzB"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Window operations for registered native elements.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import { useLayoutEffect } from 'react';
|
|
7
|
+
import type { ElementHandle, ElementViewport, KitFocusEvent } from '@molecule/app-ui';
|
|
8
|
+
/** Runs after committing native host refs and before painting. */
|
|
9
|
+
export declare const useElementLayoutEffect: typeof useLayoutEffect;
|
|
10
|
+
/**
|
|
11
|
+
* Identifies the native app window whose overlays share one active tooltip.
|
|
12
|
+
*
|
|
13
|
+
* @param _handle - The registered element.
|
|
14
|
+
* @returns The native window identity.
|
|
15
|
+
*/
|
|
16
|
+
export declare function elementWindowScope(_handle: ElementHandle): object;
|
|
17
|
+
/**
|
|
18
|
+
* Reads the current logical-pixel window dimensions. Native content scrolls in a ScrollArea.
|
|
19
|
+
*
|
|
20
|
+
* @param _handle - The registered element.
|
|
21
|
+
* @returns The native window viewport.
|
|
22
|
+
*/
|
|
23
|
+
export declare function readElementViewport(_handle: ElementHandle): ElementViewport;
|
|
24
|
+
/**
|
|
25
|
+
* Reports initial dimensions and later window size changes. ScrollArea reports its own scrolling.
|
|
26
|
+
*
|
|
27
|
+
* @param handle - The registered element.
|
|
28
|
+
* @param update - Receives the current viewport and its resize flag.
|
|
29
|
+
* @returns Unsubscribes from window updates.
|
|
30
|
+
*/
|
|
31
|
+
export declare function observeElementViewport(handle: ElementHandle, update: (viewport: ElementViewport, resized: boolean) => void): () => void;
|
|
32
|
+
/**
|
|
33
|
+
* Measures a positioned surface's actual containing origin inside the native overlay host.
|
|
34
|
+
*
|
|
35
|
+
* @param handle - The positioned view.
|
|
36
|
+
* @param position - The left and top currently applied to the view.
|
|
37
|
+
* @param onMeasure - Receives the window coordinates of the positioning origin.
|
|
38
|
+
*/
|
|
39
|
+
export declare function measurePositionedOrigin(handle: ElementHandle, position: {
|
|
40
|
+
left: number;
|
|
41
|
+
top: number;
|
|
42
|
+
}, onMeasure: (origin: {
|
|
43
|
+
x: number;
|
|
44
|
+
y: number;
|
|
45
|
+
}) => void): void;
|
|
46
|
+
/**
|
|
47
|
+
* Native focus is a device focus action, without a CSS focus-visibility selector.
|
|
48
|
+
*
|
|
49
|
+
* @param _event - The focus event.
|
|
50
|
+
* @returns Whether to show supplemental content.
|
|
51
|
+
*/
|
|
52
|
+
export declare function isElementFocusVisible(_event: KitFocusEvent): boolean;
|
|
53
|
+
//# sourceMappingURL=viewport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewport.d.ts","sourceRoot":"","sources":["../../src/elements/viewport.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,OAAO,CAAA;AAGvC,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAMrF,kEAAkE;AAClE,eAAO,MAAM,sBAAsB,wBAAkB,CAAA;AAErD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,CAEjE;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,aAAa,GAAG,eAAe,CAG3E;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,CAAC,QAAQ,EAAE,eAAe,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,GAC5D,MAAM,IAAI,CAKZ;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,aAAa,EACrB,QAAQ,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,EACvC,SAAS,EAAE,CAAC,MAAM,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,KAAK,IAAI,GACpD,IAAI,CAEN;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAEpE"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Window operations for registered native elements.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import { useLayoutEffect } from 'react';
|
|
7
|
+
import { Dimensions } from 'react-native';
|
|
8
|
+
import { measureElement } from './measure.js';
|
|
9
|
+
const windowScope = {};
|
|
10
|
+
/** Runs after committing native host refs and before painting. */
|
|
11
|
+
export const useElementLayoutEffect = useLayoutEffect;
|
|
12
|
+
/**
|
|
13
|
+
* Identifies the native app window whose overlays share one active tooltip.
|
|
14
|
+
*
|
|
15
|
+
* @param _handle - The registered element.
|
|
16
|
+
* @returns The native window identity.
|
|
17
|
+
*/
|
|
18
|
+
export function elementWindowScope(_handle) {
|
|
19
|
+
return windowScope;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Reads the current logical-pixel window dimensions. Native content scrolls in a ScrollArea.
|
|
23
|
+
*
|
|
24
|
+
* @param _handle - The registered element.
|
|
25
|
+
* @returns The native window viewport.
|
|
26
|
+
*/
|
|
27
|
+
export function readElementViewport(_handle) {
|
|
28
|
+
const { width, height } = Dimensions.get('window');
|
|
29
|
+
return { width, height, contentHeight: height, scrollOwner: 'element' };
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Reports initial dimensions and later window size changes. ScrollArea reports its own scrolling.
|
|
33
|
+
*
|
|
34
|
+
* @param handle - The registered element.
|
|
35
|
+
* @param update - Receives the current viewport and its resize flag.
|
|
36
|
+
* @returns Unsubscribes from window updates.
|
|
37
|
+
*/
|
|
38
|
+
export function observeElementViewport(handle, update) {
|
|
39
|
+
const resize = () => update(readElementViewport(handle), true);
|
|
40
|
+
const subscription = Dimensions.addEventListener('change', resize);
|
|
41
|
+
resize();
|
|
42
|
+
return () => subscription.remove();
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Measures a positioned surface's actual containing origin inside the native overlay host.
|
|
46
|
+
*
|
|
47
|
+
* @param handle - The positioned view.
|
|
48
|
+
* @param position - The left and top currently applied to the view.
|
|
49
|
+
* @param onMeasure - Receives the window coordinates of the positioning origin.
|
|
50
|
+
*/
|
|
51
|
+
export function measurePositionedOrigin(handle, position, onMeasure) {
|
|
52
|
+
measureElement(handle, ({ x, y }) => onMeasure({ x: x - position.left, y: y - position.top }));
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Native focus is a device focus action, without a CSS focus-visibility selector.
|
|
56
|
+
*
|
|
57
|
+
* @param _event - The focus event.
|
|
58
|
+
* @returns Whether to show supplemental content.
|
|
59
|
+
*/
|
|
60
|
+
export function isElementFocusVisible(_event) {
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ElementHandle } from '@molecule/app-ui';
|
|
2
|
+
/**
|
|
3
|
+
* React Native View does not emit wheel events. For touch zoom, pass the element's
|
|
4
|
+
* `zoom` prop and consume its pinch samples.
|
|
5
|
+
*
|
|
6
|
+
* @param _ref - The corresponding web surface.
|
|
7
|
+
* @param _onStep - The corresponding web zoom step.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useWheelZoomShortcut(_ref: {
|
|
10
|
+
readonly current: ElementHandle | null;
|
|
11
|
+
}, _onStep?: (direction: 'in' | 'out') => void): void;
|
|
12
|
+
//# sourceMappingURL=wheelZoom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wheelZoom.d.ts","sourceRoot":"","sources":["../../src/elements/wheelZoom.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAErD;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE;IAAE,QAAQ,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,CAAA;CAAE,EAChD,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,IAAI,GAAG,KAAK,KAAK,IAAI,GAC1C,IAAI,CAAG"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* React Native View does not emit wheel events. For touch zoom, pass the element's
|
|
3
|
+
* `zoom` prop and consume its pinch samples.
|
|
4
|
+
*
|
|
5
|
+
* @param _ref - The corresponding web surface.
|
|
6
|
+
* @param _onStep - The corresponding web zoom step.
|
|
7
|
+
*/
|
|
8
|
+
export function useWheelZoomShortcut(_ref, _onStep) { }
|
package/dist/index.d.ts
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* React Native UI components for molecule.dev.
|
|
3
3
|
*
|
|
4
4
|
* Provides React Native implementations (View/Pressable/Text-based) of the
|
|
5
|
-
* core `@molecule/app-ui` component interfaces
|
|
5
|
+
* core `@molecule/app-ui` component interfaces, including Accordion,
|
|
6
6
|
* Alert, Avatar, Badge, Button, Card (+ CardHeader/CardTitle/CardDescription/
|
|
7
|
-
* CardContent/CardFooter), Checkbox, Container, Dropdown, Flex, Form,
|
|
8
|
-
* FormField, Grid, Input, Label, Modal, Pagination, Progress, RadioGroup,
|
|
9
|
-
* Select, Separator, Skeleton, Spacer, Spinner, Switch, Table, Tabs,
|
|
7
|
+
* CardContent/CardFooter), Checkbox, Container, Dropdown, FileField, Flex, Form,
|
|
8
|
+
* FormArea, FormField, Grid, Input, Label, Modal, Pagination, Progress, RadioGroup,
|
|
9
|
+
* Select, Separator, Skeleton, Spacer, Spinner, Switch, Table, Tabs, TextField,
|
|
10
10
|
* Textarea, Toast (+ ToastProvider / ToastContainer / useToast), Tooltip.
|
|
11
11
|
* Prop types build on `@molecule/app-ui`. Web-only extras (Icon,
|
|
12
12
|
* UserMenu, ThemeToggle, PageHeader, …) live in `@molecule/app-ui-react` and
|
|
@@ -34,6 +34,8 @@
|
|
|
34
34
|
* ```
|
|
35
35
|
*
|
|
36
36
|
* @remarks
|
|
37
|
+
* - Use `@molecule/app-ui-react-native/elements` for renderer-neutral device elements and
|
|
38
|
+
* `@molecule/app-ui-react-native/platform` for the device overlay host.
|
|
37
39
|
* - **Styling requires NativeWind, not just setClassMap.** Components apply ClassMap classes via
|
|
38
40
|
* `className` on React Native primitives — that prop only has an effect when the NativeWind
|
|
39
41
|
* babel preset + Tailwind config are wired into the app AND `setClassMap(classMap)` from
|
|
@@ -47,6 +49,9 @@
|
|
|
47
49
|
* @module
|
|
48
50
|
*/
|
|
49
51
|
export { Accordion, Alert, Avatar, Badge, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Container, Dropdown, DropdownLabel, DropdownSeparator, Flex, Form, FormField, Grid, Input, Label, Modal, Pagination, Progress, RadioGroup, Select, Separator, Skeleton, SkeletonCircle, SkeletonText, Spacer, Spinner, Switch, Table, Tabs, Textarea, Toast, ToastContainer, ToastProvider, Tooltip, useToast, } from './components/index.js';
|
|
52
|
+
export { FileField } from './elements/FileField.js';
|
|
53
|
+
export { FormArea } from './elements/FormArea.js';
|
|
54
|
+
export { TextField } from './elements/TextField.js';
|
|
50
55
|
export type * from './types.js';
|
|
51
56
|
export type { AccordionProps, AlertProps, AvatarProps, BadgeProps, BaseProps, DropdownProps, FormFieldProps, FormProps, ModalProps, PaginationProps, RadioGroupProps, SkeletonProps, SpinnerProps, TableProps, TabsProps, ToastProps, TooltipProps, } from '@molecule/app-ui';
|
|
52
57
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAEH,OAAO,EACL,SAAS,EACT,KAAK,EACL,MAAM,EACN,KAAK,EACL,MAAM,EACN,IAAI,EACJ,WAAW,EACX,eAAe,EACf,UAAU,EACV,UAAU,EACV,SAAS,EACT,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,aAAa,EACb,iBAAiB,EACjB,IAAI,EACJ,IAAI,EACJ,SAAS,EACT,IAAI,EACJ,KAAK,EACL,KAAK,EACL,KAAK,EACL,UAAU,EACV,QAAQ,EACR,UAAU,EACV,MAAM,EACN,SAAS,EACT,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,MAAM,EACN,OAAO,EACP,MAAM,EACN,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,KAAK,EACL,cAAc,EACd,aAAa,EACb,OAAO,EACP,QAAQ,GACT,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,mBAAmB,YAAY,CAAA;AAC/B,YAAY,EACV,cAAc,EACd,UAAU,EACV,WAAW,EACX,UAAU,EACV,SAAS,EACT,aAAa,EACb,cAAc,EACd,SAAS,EACT,UAAU,EACV,eAAe,EACf,eAAe,EACf,aAAa,EACb,YAAY,EACZ,UAAU,EACV,SAAS,EACT,UAAU,EACV,YAAY,GACb,MAAM,kBAAkB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* React Native UI components for molecule.dev.
|
|
3
3
|
*
|
|
4
4
|
* Provides React Native implementations (View/Pressable/Text-based) of the
|
|
5
|
-
* core `@molecule/app-ui` component interfaces
|
|
5
|
+
* core `@molecule/app-ui` component interfaces, including Accordion,
|
|
6
6
|
* Alert, Avatar, Badge, Button, Card (+ CardHeader/CardTitle/CardDescription/
|
|
7
|
-
* CardContent/CardFooter), Checkbox, Container, Dropdown, Flex, Form,
|
|
8
|
-
* FormField, Grid, Input, Label, Modal, Pagination, Progress, RadioGroup,
|
|
9
|
-
* Select, Separator, Skeleton, Spacer, Spinner, Switch, Table, Tabs,
|
|
7
|
+
* CardContent/CardFooter), Checkbox, Container, Dropdown, FileField, Flex, Form,
|
|
8
|
+
* FormArea, FormField, Grid, Input, Label, Modal, Pagination, Progress, RadioGroup,
|
|
9
|
+
* Select, Separator, Skeleton, Spacer, Spinner, Switch, Table, Tabs, TextField,
|
|
10
10
|
* Textarea, Toast (+ ToastProvider / ToastContainer / useToast), Tooltip.
|
|
11
11
|
* Prop types build on `@molecule/app-ui`. Web-only extras (Icon,
|
|
12
12
|
* UserMenu, ThemeToggle, PageHeader, …) live in `@molecule/app-ui-react` and
|
|
@@ -34,6 +34,8 @@
|
|
|
34
34
|
* ```
|
|
35
35
|
*
|
|
36
36
|
* @remarks
|
|
37
|
+
* - Use `@molecule/app-ui-react-native/elements` for renderer-neutral device elements and
|
|
38
|
+
* `@molecule/app-ui-react-native/platform` for the device overlay host.
|
|
37
39
|
* - **Styling requires NativeWind, not just setClassMap.** Components apply ClassMap classes via
|
|
38
40
|
* `className` on React Native primitives — that prop only has an effect when the NativeWind
|
|
39
41
|
* babel preset + Tailwind config are wired into the app AND `setClassMap(classMap)` from
|
|
@@ -47,3 +49,6 @@
|
|
|
47
49
|
* @module
|
|
48
50
|
*/
|
|
49
51
|
export { Accordion, Alert, Avatar, Badge, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Container, Dropdown, DropdownLabel, DropdownSeparator, Flex, Form, FormField, Grid, Input, Label, Modal, Pagination, Progress, RadioGroup, Select, Separator, Skeleton, SkeletonCircle, SkeletonText, Spacer, Spinner, Switch, Table, Tabs, Textarea, Toast, ToastContainer, ToastProvider, Tooltip, useToast, } from './components/index.js';
|
|
52
|
+
export { FileField } from './elements/FileField.js';
|
|
53
|
+
export { FormArea } from './elements/FormArea.js';
|
|
54
|
+
export { TextField } from './elements/TextField.js';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Native focus targets and the dialog's name and description.
|
|
3
|
+
* @module
|
|
4
|
+
*/
|
|
5
|
+
import { type RefCallback } from 'react';
|
|
6
|
+
import type { AriaAttributes, ElementHandle, OverlayTarget } from '@molecule/app-ui';
|
|
7
|
+
/** Focus candidates and dialog speech in one native presentation. */
|
|
8
|
+
export declare class NativeFocusScope {
|
|
9
|
+
readonly controls: Set<OverlayTarget>;
|
|
10
|
+
readonly headings: Set<OverlayTarget>;
|
|
11
|
+
summary: string;
|
|
12
|
+
}
|
|
13
|
+
/** A presentation tracks its own candidates even while another modal covers it. */
|
|
14
|
+
export declare const NativeFocus: import("react").Context<NativeFocusScope>;
|
|
15
|
+
/** The last focused or activated native kit control, while it still exists. */
|
|
16
|
+
export declare function focusedNativeTarget(): OverlayTarget | undefined;
|
|
17
|
+
/** Registers a mounted control or heading and makes it available for focus restoration. */
|
|
18
|
+
export declare function useOverlayTarget<T extends ElementHandle>(forward: RefCallback<T> | undefined, kind: 'control' | 'heading' | undefined): {
|
|
19
|
+
ref: RefCallback<T> | undefined;
|
|
20
|
+
remember: () => void;
|
|
21
|
+
};
|
|
22
|
+
/** Focuses a mounted native target without depending on a React Native renderer private tag. */
|
|
23
|
+
export declare function focusNativeTarget(target: OverlayTarget | undefined): boolean;
|
|
24
|
+
/** Reads names and descriptions registered by actual Text children in this presentation. */
|
|
25
|
+
export declare function useDialogAccessibility(props: AriaAttributes): {
|
|
26
|
+
'aria-label'?: string;
|
|
27
|
+
accessibilityHint?: string;
|
|
28
|
+
};
|
|
29
|
+
/** Announces the dialog context without grouping or hiding its interactive children. */
|
|
30
|
+
export declare function announceDialog(summary: string): void;
|
|
31
|
+
//# sourceMappingURL=focus.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"focus.d.ts","sourceRoot":"","sources":["../../src/platform/focus.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEL,KAAK,WAAW,EAKjB,MAAM,OAAO,CAAA;AAGd,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAIpF,qEAAqE;AACrE,qBAAa,gBAAgB;IAC3B,QAAQ,CAAC,QAAQ,qBAA2B;IAC5C,QAAQ,CAAC,QAAQ,qBAA2B;IAC5C,OAAO,SAAK;CACb;AAED,mFAAmF;AACnF,eAAO,MAAM,WAAW,2CAAwC,CAAA;AAIhE,+EAA+E;AAC/E,wBAAgB,mBAAmB,IAAI,aAAa,GAAG,SAAS,CAE/D;AAED,2FAA2F;AAC3F,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,aAAa,EACtD,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,SAAS,EACnC,IAAI,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,GACtC;IAAE,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IAAC,QAAQ,EAAE,MAAM,IAAI,CAAA;CAAE,CAqB3D;AAOD,gGAAgG;AAChG,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,aAAa,GAAG,SAAS,GAAG,OAAO,CAc5E;AAED,4FAA4F;AAC5F,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,cAAc,GAAG;IAC7D,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B,CAeA;AAED,wFAAwF;AACxF,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAKpD"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Native focus targets and the dialog's name and description.
|
|
3
|
+
* @module
|
|
4
|
+
*/
|
|
5
|
+
import { createContext, useCallback, useContext, useLayoutEffect, useRef, } from 'react';
|
|
6
|
+
import { AccessibilityInfo, findNodeHandle, Platform } from 'react-native';
|
|
7
|
+
import { useReferencedLabelText } from '../elements/labels.js';
|
|
8
|
+
/** Focus candidates and dialog speech in one native presentation. */
|
|
9
|
+
export class NativeFocusScope {
|
|
10
|
+
controls = new Set();
|
|
11
|
+
headings = new Set();
|
|
12
|
+
summary = '';
|
|
13
|
+
}
|
|
14
|
+
/** A presentation tracks its own candidates even while another modal covers it. */
|
|
15
|
+
export const NativeFocus = createContext(new NativeFocusScope());
|
|
16
|
+
let current;
|
|
17
|
+
/** The last focused or activated native kit control, while it still exists. */
|
|
18
|
+
export function focusedNativeTarget() {
|
|
19
|
+
return current?.current ? current : undefined;
|
|
20
|
+
}
|
|
21
|
+
/** Registers a mounted control or heading and makes it available for focus restoration. */
|
|
22
|
+
export function useOverlayTarget(forward, kind) {
|
|
23
|
+
const scope = useContext(NativeFocus);
|
|
24
|
+
const target = useRef(null);
|
|
25
|
+
const candidates = kind === 'control' ? scope.controls : kind === 'heading' ? scope.headings : undefined;
|
|
26
|
+
const ref = useCallback((node) => {
|
|
27
|
+
target.current = node;
|
|
28
|
+
if (node)
|
|
29
|
+
candidates?.add(target);
|
|
30
|
+
else {
|
|
31
|
+
candidates?.delete(target);
|
|
32
|
+
if (current === target)
|
|
33
|
+
current = undefined;
|
|
34
|
+
}
|
|
35
|
+
forward?.(node);
|
|
36
|
+
}, [candidates, forward]);
|
|
37
|
+
const remember = () => {
|
|
38
|
+
if (target.current)
|
|
39
|
+
current = target;
|
|
40
|
+
};
|
|
41
|
+
return { ref: candidates || forward ? ref : undefined, remember };
|
|
42
|
+
}
|
|
43
|
+
/** Real RN host refs have native measurement methods in both Paper and Fabric. */
|
|
44
|
+
function isNativeHost(handle) {
|
|
45
|
+
return 'measureInWindow' in handle && typeof handle.measureInWindow === 'function';
|
|
46
|
+
}
|
|
47
|
+
/** Focuses a mounted native target without depending on a React Native renderer private tag. */
|
|
48
|
+
export function focusNativeTarget(target) {
|
|
49
|
+
const node = target?.current;
|
|
50
|
+
if (!node)
|
|
51
|
+
return false;
|
|
52
|
+
if (Platform.OS === 'web') {
|
|
53
|
+
node.focus();
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
if (!isNativeHost(node))
|
|
57
|
+
return false;
|
|
58
|
+
const tag = findNodeHandle(node);
|
|
59
|
+
if (tag === null)
|
|
60
|
+
return false;
|
|
61
|
+
node.focus();
|
|
62
|
+
AccessibilityInfo.setAccessibilityFocus(tag);
|
|
63
|
+
}
|
|
64
|
+
current = target;
|
|
65
|
+
return true;
|
|
66
|
+
}
|
|
67
|
+
/** Reads names and descriptions registered by actual Text children in this presentation. */
|
|
68
|
+
export function useDialogAccessibility(props) {
|
|
69
|
+
const scope = useContext(NativeFocus);
|
|
70
|
+
const modal = props['aria-modal'] === true || props['aria-modal'] === 'true';
|
|
71
|
+
const title = useReferencedLabelText(modal ? props['aria-labelledby'] : undefined);
|
|
72
|
+
const description = useReferencedLabelText(modal ? props['aria-describedby'] : undefined);
|
|
73
|
+
const name = props['aria-label'] ?? title;
|
|
74
|
+
const summary = [name, description].filter(Boolean).join('. ');
|
|
75
|
+
useLayoutEffect(() => {
|
|
76
|
+
if (!modal)
|
|
77
|
+
return;
|
|
78
|
+
scope.summary = summary;
|
|
79
|
+
return () => {
|
|
80
|
+
scope.summary = '';
|
|
81
|
+
};
|
|
82
|
+
}, [scope, modal, summary]);
|
|
83
|
+
return modal ? { 'aria-label': name, accessibilityHint: description } : {};
|
|
84
|
+
}
|
|
85
|
+
/** Announces the dialog context without grouping or hiding its interactive children. */
|
|
86
|
+
export function announceDialog(summary) {
|
|
87
|
+
if (!summary)
|
|
88
|
+
return;
|
|
89
|
+
if (Platform.OS === 'ios')
|
|
90
|
+
AccessibilityInfo.announceForAccessibilityWithOptions(summary, { queue: true });
|
|
91
|
+
else
|
|
92
|
+
AccessibilityInfo.announceForAccessibility(summary);
|
|
93
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* React Native implementation of the renderer-neutral overlay platform.
|
|
3
|
+
* @module
|
|
4
|
+
*/
|
|
5
|
+
import type { OverlayPlatform, ToastMessageProps } from '@molecule/app-react/overlay';
|
|
6
|
+
import { type ElementHandle } from '@molecule/app-ui';
|
|
7
|
+
export type * from '@molecule/app-react/overlay';
|
|
8
|
+
export type { OverlayAnchorGeometry, OverlayDismissReason, OverlayFocusOptions, OverlayLayerKind, OverlayLayerOptions, OverlayTarget, } from '@molecule/app-ui';
|
|
9
|
+
/** A native host is the accessibility boundary for the background of its presentation. */
|
|
10
|
+
export declare const OverlayHost: OverlayPlatform['OverlayHost'];
|
|
11
|
+
/** Registers an overlay once per open interval and applies updated callbacks in place. */
|
|
12
|
+
export declare const useOverlayLayer: OverlayPlatform['useOverlayLayer'];
|
|
13
|
+
/** Core Modal keeps children in their source tree, including all declaring providers. */
|
|
14
|
+
export declare const OverlayPortal: OverlayPlatform['OverlayPortal'];
|
|
15
|
+
/** A separate press target behind the panel keeps the panel's touches and scroll available. */
|
|
16
|
+
export declare const OverlayBackdrop: OverlayPlatform['OverlayBackdrop'];
|
|
17
|
+
/** Matches minimum logical widths and conjunctions of CSS min/max-width pixel conditions. */
|
|
18
|
+
export declare const useViewportMatch: OverlayPlatform['useViewportMatch'];
|
|
19
|
+
/** Dismisses on committed route traversal, including pops between instances of one screen. */
|
|
20
|
+
export declare const useHistoryPop: OverlayPlatform['useHistoryPop'];
|
|
21
|
+
/** Measures an anchored surface in its presenting window. */
|
|
22
|
+
export declare const useAnchoredPosition: OverlayPlatform['useAnchoredPosition'];
|
|
23
|
+
/** Registers readable hints with the surrounding controls before the tip is opened. */
|
|
24
|
+
export declare const useTooltipDescription: OverlayPlatform['useTooltipDescription'];
|
|
25
|
+
/** Native focus events have no related target. */
|
|
26
|
+
export declare const focusStaysWithin: OverlayPlatform['focusStaysWithin'];
|
|
27
|
+
/** Announces one message via the stock platform API, using the effective live attributes. */
|
|
28
|
+
export declare const ToastMessage: import("react").ForwardRefExoticComponent<Omit<ToastMessageProps, "ref"> & import("react").RefAttributes<ElementHandle>>;
|
|
29
|
+
/** Draws the native arrow with the surface and border tokens of the active ClassMap. */
|
|
30
|
+
export declare const OverlayArrow: OverlayPlatform['OverlayArrow'];
|
|
31
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/platform/index.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAuBH,OAAO,KAAK,EAAgB,eAAe,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AACnG,OAAO,EAAE,KAAK,aAAa,EAAmC,MAAM,kBAAkB,CAAA;AAUtF,mBAAmB,6BAA6B,CAAA;AAChD,YAAY,EACV,qBAAqB,EACrB,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,aAAa,GACd,MAAM,kBAAkB,CAAA;AAoBzB,0FAA0F;AAC1F,eAAO,MAAM,WAAW,EAAE,eAAe,CAAC,aAAa,CA0BtD,CAAA;AAED,0FAA0F;AAC1F,eAAO,MAAM,eAAe,EAAE,eAAe,CAAC,iBAAiB,CAkB9D,CAAA;AAED,yFAAyF;AACzF,eAAO,MAAM,aAAa,EAAE,eAAe,CAAC,eAAe,CAqF1D,CAAA;AAED,+FAA+F;AAC/F,eAAO,MAAM,eAAe,EAAE,eAAe,CAAC,iBAAiB,CAe9D,CAAA;AAID,6FAA6F;AAC7F,eAAO,MAAM,gBAAgB,EAAE,eAAe,CAAC,kBAAkB,CAYhE,CAAA;AAED,8FAA8F;AAC9F,eAAO,MAAM,aAAa,EAAE,eAAe,CAAC,eAAe,CAS1D,CAAA;AAED,6DAA6D;AAC7D,eAAO,MAAM,mBAAmB,EAAE,eAAe,CAAC,qBAAqB,CACd,CAAA;AAEzD,uFAAuF;AACvF,eAAO,MAAM,qBAAqB,EAAE,eAAe,CAAC,uBAAuB,CAG1E,CAAA;AAED,kDAAkD;AAClD,eAAO,MAAM,gBAAgB,EAAE,eAAe,CAAC,kBAAkB,CAAe,CAAA;AAEhF,6FAA6F;AAC7F,eAAO,MAAM,YAAY,0HA2BxB,CAAA;AAED,wFAAwF;AACxF,eAAO,MAAM,YAAY,EAAE,eAAe,CAAC,cAAc,CAgCxD,CAAA"}
|