@astryxdesign/core 0.7.8-canary.aaacae9 → 0.7.8-canary.ccfadbe
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/dist/AppShell/AppShell.d.ts.map +1 -1
- package/dist/AppShell/AppShell.js +6 -3
- package/dist/CheckboxList/CheckboxList.d.ts +8 -1
- package/dist/CheckboxList/CheckboxList.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxList.js +2 -0
- package/dist/InfoTip/InfoTip.d.ts +5 -5
- package/dist/InfoTip/InfoTip.d.ts.map +1 -1
- package/dist/InfoTip/InfoTip.js +58 -19
- package/dist/Layer/useTouchTrigger.d.ts +13 -7
- package/dist/Layer/useTouchTrigger.d.ts.map +1 -1
- package/dist/Layer/useTouchTrigger.js +17 -6
- package/dist/SideNav/SideNav.d.ts.map +1 -1
- package/dist/SideNav/SideNav.js +36 -5
- package/dist/Tokenizer/Tokenizer.d.ts +0 -14
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +1 -5
- package/dist/Tokenizer/TokenizerBottomSheet.js +3 -5
- package/dist/Tooltip/Tooltip.d.ts +2 -23
- package/dist/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/Tooltip/Tooltip.js +5 -29
- package/dist/Tooltip/useTooltip.d.ts +7 -32
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +176 -71
- package/dist/motion/animatedLayout.d.ts +8 -0
- package/dist/motion/animatedLayout.d.ts.map +1 -1
- package/dist/motion/animatedLayout.js +239 -46
- package/dist/motion/animator.d.ts.map +1 -1
- package/dist/motion/animator.js +1 -7
- package/dist/motion/frameBlock.d.ts +14 -0
- package/dist/motion/frameBlock.d.ts.map +1 -0
- package/dist/motion/frameBlock.js +16 -0
- package/package.json +4 -4
- package/src/AppShell/AppShell.tsx +9 -4
- package/src/CheckboxList/CheckboxList.doc.mjs +7 -0
- package/src/CheckboxList/CheckboxList.tsx +9 -0
- package/src/Icon/Icon.doc.mjs +2 -2
- package/src/InfoTip/InfoTip.tsx +72 -16
- package/src/Layer/useTouchTrigger.ts +17 -6
- package/src/Lightbox/useLightbox.doc.mjs +167 -0
- package/src/SideNav/SideNav.tsx +41 -5
- package/src/Tokenizer/Tokenizer.doc.mjs +0 -16
- package/src/Tokenizer/Tokenizer.tsx +1 -24
- package/src/Tokenizer/TokenizerBottomSheet.tsx +8 -10
- package/src/Tooltip/Tooltip.tsx +6 -42
- package/src/Tooltip/useTooltip.tsx +195 -97
- package/src/motion/animatedLayout.ts +313 -55
- package/src/motion/animator.ts +1 -7
- package/src/motion/frameBlock.ts +16 -0
- package/dist/Layer/usePressPin.d.ts +0 -105
- package/dist/Layer/usePressPin.d.ts.map +0 -1
- package/dist/Layer/usePressPin.js +0 -413
- package/src/Layer/usePressPin.ts +0 -576
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppShell.d.ts","sourceRoot":"","sources":["../../src/AppShell/AppShell.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAQL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"AppShell.d.ts","sourceRoot":"","sources":["../../src/AppShell/AppShell.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAQL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAyCf,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAU5C,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,SAAS,CAAC;AA+ChD;;;GAGG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,QAAQ,EACR,cAAc,EACd,aAAa,EAAE,UAAU,EACzB,MAAe,EACf,SAAS,EACT,OAAO,EACP,MAAM,EACN,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,IAAI,EACR,EAAE,aAAa,qBAsyBf;yBArzBe,QAAQ"}
|
|
@@ -37,7 +37,7 @@ import { MAX_CLOSE_DELAY_MS as MOBILE_NAV_MAX_CLOSE_DELAY_MS } from "../MobileNa
|
|
|
37
37
|
import { SideNavRenderContext } from "../SideNav/SideNavRenderContext.js";
|
|
38
38
|
import { SideNavShellContext } from "../SideNav/railMotion.js";
|
|
39
39
|
import { useAnimatedLayout } from "../hooks/useAnimatedLayout.js";
|
|
40
|
-
import { holdLayoutSwap, landLayoutGlide, layoutMotionFor, playLayoutFrames, playLayoutSwap, reportLayoutChange } from "../motion/animatedLayout.js";
|
|
40
|
+
import { holdLayoutSwap, landLayoutGlide, layoutMotionFor, layoutStartFor, playLayoutFrames, playLayoutSwap, reportLayoutChange } from "../motion/animatedLayout.js";
|
|
41
41
|
import { TopNavRenderContext } from "../TopNav/TopNavRenderContext.js";
|
|
42
42
|
import { TopNavMobileContentContext } from "../TopNav/TopNavMobileContentContext.js";
|
|
43
43
|
import { AppShellMobileContext } from "./AppShellMobileContext.js";
|
|
@@ -609,7 +609,10 @@ export function AppShell({
|
|
|
609
609
|
let entering = 0;
|
|
610
610
|
const last = lastSwapRef.current;
|
|
611
611
|
if (last != null && motion.kind === 'spring') {
|
|
612
|
-
|
|
612
|
+
// Read at the change's own start, where the glide it retargets
|
|
613
|
+
// carries on. After a block, that is later than the frame the
|
|
614
|
+
// timeline still reads.
|
|
615
|
+
const elapsed = Math.max(0, layoutStartFor(main.ownerDocument) - last.startedAt);
|
|
613
616
|
if (elapsed < motion.progress.durationMs) {
|
|
614
617
|
const p = 1 - motion.progress.remaining(elapsed);
|
|
615
618
|
held = last.entering + (1 - last.entering) * p;
|
|
@@ -672,7 +675,7 @@ export function AppShell({
|
|
|
672
675
|
entering
|
|
673
676
|
} = pending;
|
|
674
677
|
lastSwapRef.current = {
|
|
675
|
-
startedAt:
|
|
678
|
+
startedAt: layoutStartFor(main.ownerDocument),
|
|
676
679
|
held,
|
|
677
680
|
entering
|
|
678
681
|
};
|
|
@@ -32,6 +32,13 @@ export interface CheckboxListProps extends Omit<FieldInputBaseProps<HTMLDivEleme
|
|
|
32
32
|
* Description text displayed below the label.
|
|
33
33
|
*/
|
|
34
34
|
description?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Whether the group is optional. Shows the optional indicator after the
|
|
37
|
+
* group label, unless a surrounding `FormLayout` already makes fields
|
|
38
|
+
* optional by default.
|
|
39
|
+
* @default false
|
|
40
|
+
*/
|
|
41
|
+
isOptional?: boolean;
|
|
35
42
|
/**
|
|
36
43
|
* Status indicator for the checkbox group.
|
|
37
44
|
* When set with a message, displays a colored message box below the group.
|
|
@@ -115,7 +122,7 @@ export interface CheckboxListProps extends Omit<FieldInputBaseProps<HTMLDivEleme
|
|
|
115
122
|
* </CheckboxList>
|
|
116
123
|
* ```
|
|
117
124
|
*/
|
|
118
|
-
export declare function CheckboxList({ label, isLabelHidden, description, status, value, onChange, changeAction, density, hasDividers, isDisabled, disabledMessage, isReadOnly, children, ref, width, containerXstyle, containerClassName, containerStyle, controlXstyle, controlClassName, controlStyle, 'aria-labelledby': ariaLabelledByProp, 'aria-describedby': ariaDescribedByProp, ...restProps }: CheckboxListProps): import("react").JSX.Element;
|
|
125
|
+
export declare function CheckboxList({ label, isLabelHidden, description, isOptional, status, value, onChange, changeAction, density, hasDividers, isDisabled, disabledMessage, isReadOnly, children, ref, width, containerXstyle, containerClassName, containerStyle, controlXstyle, controlClassName, controlStyle, 'aria-labelledby': ariaLabelledByProp, 'aria-describedby': ariaDescribedByProp, ...restProps }: CheckboxListProps): import("react").JSX.Element;
|
|
119
126
|
export declare namespace CheckboxList {
|
|
120
127
|
var displayName: string;
|
|
121
128
|
}
|
|
@@ -1 +1 @@
|
|
|
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AKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,aAAqB,EACrB,WAAW,EACX,MAAM,EACN,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,OAAoB,EACpB,WAAmB,EACnB,UAAkB,EAClB,eAAe,EACf,UAAkB,EAClB,QAAQ,EACR,GAAG,EACH,KAAK,EACL,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EAAE,kBAAkB,EACrC,kBAAkB,EAAE,mBAAmB,EACvC,GAAG,SAAS,EACb,EAAE,iBAAiB,+
|
|
1
|
+
{"version":3,"file":"CheckboxList.d.ts","sourceRoot":"","sources":["../../src/CheckboxList/CheckboxList.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAML,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EACL,KAAK,mBAAmB,EAEzB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAE9C,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAEhD,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,qBAAqB,CAAC;AAarD,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAC7C,mBAAmB,CAAC,cAAc,CAAC,EACnC,UAAU,CACX;IACC,mDAAmD;IACnD,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;OAEG;IACH,WAAW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50
|
label,
|
|
51
51
|
isLabelHidden = false,
|
|
52
52
|
description,
|
|
53
|
+
isOptional = false,
|
|
53
54
|
status,
|
|
54
55
|
value,
|
|
55
56
|
onChange,
|
|
@@ -136,6 +137,7 @@ export function CheckboxList({
|
|
|
136
137
|
inputID: inputID,
|
|
137
138
|
labelID: labelID,
|
|
138
139
|
isGroupLabel: true,
|
|
140
|
+
isOptional: isOptional,
|
|
139
141
|
descriptionID: description ? descriptionID : undefined,
|
|
140
142
|
isDisabled: isDisabled,
|
|
141
143
|
status: status ? {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file InfoTip.tsx
|
|
3
|
-
* @input Uses React, StyleX,
|
|
4
|
-
* touch hit area, color/spacing/radius/duration/ease tokens
|
|
3
|
+
* @input Uses React, StyleX, useTooltip, Icon, useComponentTranslator, the
|
|
4
|
+
* shared touch hit area, color/spacing/radius/duration/ease tokens
|
|
5
5
|
* @output Exports InfoTip component, InfoTipProps, InfoTipSize types
|
|
6
6
|
* @position Core implementation; consumed by index.ts, tested by
|
|
7
7
|
* InfoTip.test.tsx; `@astryxdesign/lab` re-exports it, deprecated
|
|
@@ -46,9 +46,9 @@ export interface InfoTipProps extends Pick<BaseProps, 'xstyle' | 'className' | '
|
|
|
46
46
|
* labels, values, and metrics for permission notes, metric definitions, and
|
|
47
47
|
* field help.
|
|
48
48
|
*
|
|
49
|
-
* InfoTip is a
|
|
50
|
-
* announces, and closes the help. The info icon
|
|
51
|
-
* the icon registry, so themes can replace it.
|
|
49
|
+
* InfoTip is a named button that toggles `useTooltip`'s `show()` and `hide()`:
|
|
50
|
+
* the hook previews, holds, announces, and closes the help. The info icon
|
|
51
|
+
* resolves from the icon registry, so themes can replace it.
|
|
52
52
|
*
|
|
53
53
|
* @example
|
|
54
54
|
* ```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InfoTip.d.ts","sourceRoot":"","sources":["../../src/InfoTip/InfoTip.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;GAaG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"InfoTip.d.ts","sourceRoot":"","sources":["../../src/InfoTip/InfoTip.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAKL,KAAK,SAAS,EACd,KAAK,GAAG,EACT,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAE5C,OAAO,EAAO,KAAK,QAAQ,EAAC,MAAM,cAAc,CAAC;AAqBjD;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC;AAEnC,MAAM,WAAW,YAAa,SAAQ,IAAI,CACxC,SAAS,EACT,QAAQ,GAAG,WAAW,GAAG,OAAO,CACjC;IACC,wCAAwC;IACxC,GAAG,CAAC,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAC;IAC7B;;;OAGG;IACH,OAAO,EAAE,SAAS,CAAC;IACnB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;CACpB;AA8CD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,OAAO,CAAC,EACtB,OAAO,EACP,KAAK,EACL,IAAW,EACX,GAAG,EACH,MAAM,EACN,SAAS,EACT,KAAK,GACN,EAAE,YAAY,GAAG,SAAS,CAyF1B;yBAjGe,OAAO"}
|
package/dist/InfoTip/InfoTip.js
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file InfoTip.tsx
|
|
7
|
-
* @input Uses React, StyleX,
|
|
8
|
-
* touch hit area, color/spacing/radius/duration/ease tokens
|
|
7
|
+
* @input Uses React, StyleX, useTooltip, Icon, useComponentTranslator, the
|
|
8
|
+
* shared touch hit area, color/spacing/radius/duration/ease tokens
|
|
9
9
|
* @output Exports InfoTip component, InfoTipProps, InfoTipSize types
|
|
10
10
|
* @position Core implementation; consumed by index.ts, tested by
|
|
11
11
|
* InfoTip.test.tsx; `@astryxdesign/lab` re-exports it, deprecated
|
|
@@ -16,11 +16,12 @@
|
|
|
16
16
|
* - /packages/core/src/InfoTip/InfoTip.test.tsx (tests for new/changed behavior)
|
|
17
17
|
* - /packages/core/src/InfoTip/index.ts (exports if types change)
|
|
18
18
|
*/
|
|
19
|
-
import { useCallback } from 'react';
|
|
19
|
+
import { useCallback, useState } from 'react';
|
|
20
20
|
import * as stylex from '@stylexjs/stylex';
|
|
21
21
|
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
22
22
|
import { Icon } from "../Icon/Icon.js";
|
|
23
|
-
import {
|
|
23
|
+
import { stopInReactTree } from "../Layer/layerClickBoundary.js";
|
|
24
|
+
import { useTooltip } from "../Tooltip/useTooltip.js";
|
|
24
25
|
import { registerEnglishFallback, useComponentTranslator } from "../i18n/useComponentTranslator.js";
|
|
25
26
|
import english from "../i18n/generated-english/InfoTip/InfoTip.generated.js";
|
|
26
27
|
import "../theme/tokens.stylex.js";
|
|
@@ -28,7 +29,7 @@ import { colorVars, durationVars, easeVars, radiusVars, spacingVars } from "../t
|
|
|
28
29
|
import { focusOutlineStyles } from "../utils/focusOutline.stylex.js";
|
|
29
30
|
import { mergeProps } from "../utils/mergeProps.js";
|
|
30
31
|
import { watchHitArea, writeHitInsets } from "../utils/hitArea.js";
|
|
31
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
32
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
32
33
|
registerEnglishFallback(english);
|
|
33
34
|
|
|
34
35
|
/**
|
|
@@ -70,9 +71,9 @@ const styles = {
|
|
|
70
71
|
* labels, values, and metrics for permission notes, metric definitions, and
|
|
71
72
|
* field help.
|
|
72
73
|
*
|
|
73
|
-
* InfoTip is a
|
|
74
|
-
* announces, and closes the help. The info icon
|
|
75
|
-
* the icon registry, so themes can replace it.
|
|
74
|
+
* InfoTip is a named button that toggles `useTooltip`'s `show()` and `hide()`:
|
|
75
|
+
* the hook previews, holds, announces, and closes the help. The info icon
|
|
76
|
+
* resolves from the icon registry, so themes can replace it.
|
|
76
77
|
*
|
|
77
78
|
* @example
|
|
78
79
|
* ```
|
|
@@ -99,28 +100,66 @@ export function InfoTip({
|
|
|
99
100
|
}
|
|
100
101
|
return watchHitArea(button, insets => writeHitInsets(button, insets));
|
|
101
102
|
}, []);
|
|
102
|
-
|
|
103
|
+
// Whether a press pinned the help. A hover or focus preview is not pinned.
|
|
104
|
+
const [isPinned, setIsPinned] = useState(false);
|
|
105
|
+
// Whether the help shows, pinned or previewed: the button names it in
|
|
106
|
+
// `aria-controls` only then.
|
|
107
|
+
const [isShown, setIsShown] = useState(false);
|
|
108
|
+
const handleShow = useCallback(() => setIsShown(true), []);
|
|
109
|
+
// Every close ends the pin: a second press, Escape, a press outside, or
|
|
110
|
+
// focus leaving.
|
|
111
|
+
const handleHide = useCallback(() => {
|
|
112
|
+
setIsShown(false);
|
|
113
|
+
setIsPinned(false);
|
|
114
|
+
}, []);
|
|
115
|
+
const tooltip = useTooltip({
|
|
116
|
+
onShow: handleShow,
|
|
117
|
+
onHide: handleHide
|
|
118
|
+
});
|
|
119
|
+
const mergedRef = useMergedRefs(ref, watchButtonHitArea, tooltip.ref);
|
|
120
|
+
|
|
121
|
+
// A primary mouse or pen press on a preview calls show() first. The hook's
|
|
122
|
+
// press-to-close then leaves it open. The click pins it.
|
|
123
|
+
const handlePointerDownCapture = useCallback(event => {
|
|
124
|
+
if (event.button !== 0 || event.pointerType === 'touch' || isPinned || !isShown) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
tooltip.show();
|
|
128
|
+
}, [isPinned, isShown, tooltip]);
|
|
129
|
+
|
|
130
|
+
// A click, tap, Enter, or Space pins the help, and the next one closes it.
|
|
131
|
+
// The press stops at the button: a clickable row, card, or label around it
|
|
132
|
+
// does nothing, and document listeners still see it.
|
|
133
|
+
const handleClick = useCallback(event => {
|
|
134
|
+
stopInReactTree(event);
|
|
135
|
+
event.preventDefault();
|
|
136
|
+
if (isPinned) {
|
|
137
|
+
tooltip.hide();
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
tooltip.show();
|
|
141
|
+
setIsPinned(true);
|
|
142
|
+
}, [isPinned, tooltip]);
|
|
103
143
|
|
|
104
|
-
// No Escape handler of its own.
|
|
144
|
+
// No Escape handler of its own. The tooltip's entry in the shared dismissal
|
|
105
145
|
// stack takes Escape, so one press never closes both the help and an
|
|
106
146
|
// enclosing Dialog.
|
|
107
|
-
return /*#__PURE__*/
|
|
108
|
-
|
|
109
|
-
// The tooltip is the button's only purpose. A click, a tap, Enter, or
|
|
110
|
-
// Space pins it open, and the press stops at the button. So an InfoTip's
|
|
111
|
-
// content is reachable on a phone and from the keyboard alike.
|
|
112
|
-
,
|
|
113
|
-
triggerBehavior: "toggle",
|
|
114
|
-
children: /*#__PURE__*/_jsx("button", {
|
|
147
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
148
|
+
children: [/*#__PURE__*/_jsx("button", {
|
|
115
149
|
ref: mergedRef,
|
|
116
150
|
type: "button",
|
|
117
151
|
"aria-label": label ?? t('@astryx.infoTip.label'),
|
|
152
|
+
"aria-describedby": tooltip.describedBy,
|
|
153
|
+
"aria-expanded": isPinned,
|
|
154
|
+
"aria-controls": isShown ? tooltip.describedBy : undefined,
|
|
155
|
+
onPointerDownCapture: handlePointerDownCapture,
|
|
156
|
+
onClick: handleClick,
|
|
118
157
|
...mergeProps(stylex.props(focusOutlineStyles.focusVisible, styles.trigger, styles.hitArea, xstyle), className, style),
|
|
119
158
|
children: /*#__PURE__*/_jsx(Icon, {
|
|
120
159
|
icon: "info",
|
|
121
160
|
size: size
|
|
122
161
|
})
|
|
123
|
-
})
|
|
162
|
+
}), tooltip.renderTooltip(content)]
|
|
124
163
|
});
|
|
125
164
|
}
|
|
126
165
|
InfoTip.displayName = 'InfoTip';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @output Exports useTouchTrigger hook, isActionTrigger, LayerTouchTrigger type,
|
|
5
5
|
* tapLandsOnDisabledControl, TOUCH_POINTER_TYPES and useTapStop (internal:
|
|
6
6
|
* not re-exported from index). Also useTouchTriggerInternal, with the
|
|
7
|
-
* outside dismissal's arm for
|
|
7
|
+
* outside dismissal's arm for useTooltip's hold (Core-internal).
|
|
8
8
|
* @position Layer hook; shared touch behavior for useTooltip and useHoverCard
|
|
9
9
|
*
|
|
10
10
|
* SYNC: When modified, update:
|
|
@@ -139,8 +139,8 @@ export interface UseTouchTriggerReturn {
|
|
|
139
139
|
clearTapOpen: () => void;
|
|
140
140
|
}
|
|
141
141
|
/**
|
|
142
|
-
* useTouchTrigger's return plus the outside dismissal's arm, for
|
|
143
|
-
*
|
|
142
|
+
* useTouchTrigger's return plus the outside dismissal's arm, for useTooltip's
|
|
143
|
+
* hold behind show() and hide(). Not exported from the Layer entry point.
|
|
144
144
|
*
|
|
145
145
|
* @internal
|
|
146
146
|
*/
|
|
@@ -148,7 +148,7 @@ export interface UseTouchTriggerInternalReturn extends UseTouchTriggerReturn {
|
|
|
148
148
|
/**
|
|
149
149
|
* Arms the outside dismissal a tap-open gets: a press that lifts outside
|
|
150
150
|
* the trigger and the layer, or a scroll that starts there, hides it. A
|
|
151
|
-
*
|
|
151
|
+
* hold arms it too.
|
|
152
152
|
*/
|
|
153
153
|
armOutsideDismiss: () => void;
|
|
154
154
|
}
|
|
@@ -171,10 +171,16 @@ export interface UseTouchTriggerInternalReturn extends UseTouchTriggerReturn {
|
|
|
171
171
|
*/
|
|
172
172
|
export declare function useTouchTrigger(options: UseTouchTriggerOptions): UseTouchTriggerReturn;
|
|
173
173
|
/**
|
|
174
|
-
* useTouchTrigger, plus the outside dismissal's arm that
|
|
175
|
-
* close on a press or scroll outside.
|
|
174
|
+
* useTouchTrigger, plus the outside dismissal's arm that useTooltip's hold
|
|
175
|
+
* uses to close on a press or scroll outside.
|
|
176
176
|
*
|
|
177
177
|
* @internal
|
|
178
178
|
*/
|
|
179
|
-
export declare function useTouchTriggerInternal(options: UseTouchTriggerOptions
|
|
179
|
+
export declare function useTouchTriggerInternal(options: UseTouchTriggerOptions,
|
|
180
|
+
/**
|
|
181
|
+
* Called when a press that the outside dismissal watches ends with its
|
|
182
|
+
* pointer lifted inside the layer: the layer stays open, and useTooltip
|
|
183
|
+
* ends a hold that the press started.
|
|
184
|
+
*/
|
|
185
|
+
onReleaseInLayer?: () => void): UseTouchTriggerInternalReturn;
|
|
180
186
|
//# sourceMappingURL=useTouchTrigger.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTouchTrigger.d.ts","sourceRoot":"","sources":["../../src/Layer/useTouchTrigger.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,OAAO,EAIL,KAAK,UAAU,IAAI,eAAe,EAClC,KAAK,YAAY,IAAI,iBAAiB,EACtC,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AASf;;;;;;GAMG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,CAAC;AAExD;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,aAA4B,CAAC;AAE7D,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG;IAC1C,aAAa,EAAE,CAAC,KAAK,EAAE,iBAAiB,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IAC3D,OAAO,EAAE,CAAC,KAAK,EAAE,eAAe,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;CACpD,CAAC;AACF,wBAAgB,UAAU,CAAC,KAAK,EAAE,WAAW,GAAG;IAC9C,aAAa,EAAE,CAAC,KAAK,EAAE,iBAAiB,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IAC3D,WAAW,EAAE,CAAC,KAAK,EAAE,eAAe,CAAC,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OAGG;IACH,YAAY,EAAE,OAAO,CAAC;IAEtB,2CAA2C;IAC3C,MAAM,EAAE,OAAO,CAAC;IAEhB,0EAA0E;IAC1E,OAAO,EAAE,MAAM,CAAC;IAEhB,oDAAoD;IACpD,UAAU,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAE1C,uDAAuD;IACvD,IAAI,EAAE,MAAM,IAAI,CAAC;IAEjB,mCAAmC;IACnC,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB;AAED,MAAM,WAAW,qBAAqB;IACpC;;;;OAIG;IACH,iBAAiB,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IAEtC;;;;OAIG;IACH,kBAAkB,EAAE,MAAM,OAAO,CAAC;IAElC;;;;OAIG;IACH,kBAAkB,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;IAElD;;;;;;OAMG;IACH,iBAAiB,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,OAAO,CAAC;IAEpD,gFAAgF;IAChF,YAAY,EAAE,MAAM,IAAI,CAAC;CAC1B;AAED;;;;;GAKG;AACH,MAAM,WAAW,6BAA8B,SAAQ,qBAAqB;IAC1E;;;;OAIG;IACH,iBAAiB,EAAE,MAAM,IAAI,CAAC;CAC/B;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,sBAAsB,GAC9B,qBAAqB,CASvB;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,sBAAsB;AAC/B;;;;GAIG;AACH,gBAAgB,CAAC,EAAE,MAAM,IAAI,GAC5B,6BAA6B,CAkO/B"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @output Exports useTouchTrigger hook, isActionTrigger, LayerTouchTrigger type,
|
|
9
9
|
* tapLandsOnDisabledControl, TOUCH_POINTER_TYPES and useTapStop (internal:
|
|
10
10
|
* not re-exported from index). Also useTouchTriggerInternal, with the
|
|
11
|
-
* outside dismissal's arm for
|
|
11
|
+
* outside dismissal's arm for useTooltip's hold (Core-internal).
|
|
12
12
|
* @position Layer hook; shared touch behavior for useTooltip and useHoverCard
|
|
13
13
|
*
|
|
14
14
|
* SYNC: When modified, update:
|
|
@@ -179,8 +179,8 @@ function isEditable(element) {
|
|
|
179
179
|
}
|
|
180
180
|
|
|
181
181
|
/**
|
|
182
|
-
* useTouchTrigger's return plus the outside dismissal's arm, for
|
|
183
|
-
*
|
|
182
|
+
* useTouchTrigger's return plus the outside dismissal's arm, for useTooltip's
|
|
183
|
+
* hold behind show() and hide(). Not exported from the Layer entry point.
|
|
184
184
|
*
|
|
185
185
|
* @internal
|
|
186
186
|
*/
|
|
@@ -214,12 +214,18 @@ export function useTouchTrigger(options) {
|
|
|
214
214
|
}
|
|
215
215
|
|
|
216
216
|
/**
|
|
217
|
-
* useTouchTrigger, plus the outside dismissal's arm that
|
|
218
|
-
* close on a press or scroll outside.
|
|
217
|
+
* useTouchTrigger, plus the outside dismissal's arm that useTooltip's hold
|
|
218
|
+
* uses to close on a press or scroll outside.
|
|
219
219
|
*
|
|
220
220
|
* @internal
|
|
221
221
|
*/
|
|
222
|
-
export function useTouchTriggerInternal(options
|
|
222
|
+
export function useTouchTriggerInternal(options,
|
|
223
|
+
/**
|
|
224
|
+
* Called when a press that the outside dismissal watches ends with its
|
|
225
|
+
* pointer lifted inside the layer: the layer stays open, and useTooltip
|
|
226
|
+
* ends a hold that the press started.
|
|
227
|
+
*/
|
|
228
|
+
onReleaseInLayer) {
|
|
223
229
|
const {
|
|
224
230
|
touchTrigger,
|
|
225
231
|
isEnabled,
|
|
@@ -242,6 +248,8 @@ export function useTouchTriggerInternal(options) {
|
|
|
242
248
|
hideRef.current = hide;
|
|
243
249
|
const layerIdRef = useRef(layerId);
|
|
244
250
|
layerIdRef.current = layerId;
|
|
251
|
+
const onReleaseInLayerRef = useRef(onReleaseInLayer);
|
|
252
|
+
onReleaseInLayerRef.current = onReleaseInLayer;
|
|
245
253
|
|
|
246
254
|
// Whether a tap is what opened the layer. Only a tap-open owes the user an
|
|
247
255
|
// outside-tap dismissal: a hover-opened layer already closes on
|
|
@@ -291,6 +299,9 @@ export function useTouchTriggerInternal(options) {
|
|
|
291
299
|
}
|
|
292
300
|
// Hover card content is interactive; a tap inside it is not a dismiss.
|
|
293
301
|
if (docs.some(doc => doc.getElementById(layerIdRef.current)?.contains(target) === true)) {
|
|
302
|
+
if (event.type === 'pointerup') {
|
|
303
|
+
onReleaseInLayerRef.current?.();
|
|
304
|
+
}
|
|
294
305
|
return;
|
|
295
306
|
}
|
|
296
307
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SideNav.d.ts","sourceRoot":"","sources":["../../src/SideNav/SideNav.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAQL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAE5C,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAGnD,OAAO,EAGL,KAAK,wBAAwB,EAC7B,KAAK,+BAA+B,EACrC,MAAM,0BAA0B,CAAC;AAKlC,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,2BAA2B,CAAC;AAmR/D,MAAM,WAAW,YAAa,SAAQ,SAAS,CAAC,WAAW,CAAC;IAC1D,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAE7B;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC;IAEvD;;OAEG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB;;OAEG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,MAAM,CAAC,EAAE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AAC;IACpB;;OAEG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;;;;;;;;OASG;IACH,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;;;;;;;;;;;;;;;;;OAmBG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,eAAe,CAAC;IAEtC;;;;;;;;;;;;;OAaG;IACH,WAAW,CAAC,EAAE,OAAO,GAAG,wBAAwB,CAAC;CAClD;AAyBD;;;;;;;;;;;;;;;;;GAiBG;AAEH,wBAAgB,OAAO,CAAC,EACtB,MAAM,EACN,UAAU,EACV,QAAQ,EACR,MAAM,EACN,WAAW,EACX,WAAmB,EACnB,SAAiB,EACjB,MAAM,EACN,SAAS,EACT,KAAK,EACL,aAAa,EAAE,MAAM,EACrB,GAAG,EACH,SAAS,EACT,GAAG,KAAK,EACT,EAAE,YAAY,+BA8fd;yBA7gBe,OAAO"}
|
package/dist/SideNav/SideNav.js
CHANGED
|
@@ -147,6 +147,12 @@ const FOOTER_ICON_SIZE = 'sm';
|
|
|
147
147
|
|
|
148
148
|
/** Where focus was before a collapse, as the move after it needs it. */
|
|
149
149
|
|
|
150
|
+
/** The timeline holds one time per frame, so two reads in one frame match. */
|
|
151
|
+
function frameTimeOf(doc) {
|
|
152
|
+
const time = doc?.timeline?.currentTime;
|
|
153
|
+
return time == null ? null : Number(time);
|
|
154
|
+
}
|
|
155
|
+
|
|
150
156
|
/**
|
|
151
157
|
* Sidebar navigation container for application pages.
|
|
152
158
|
*
|
|
@@ -165,6 +171,7 @@ const FOOTER_ICON_SIZE = 'sm';
|
|
|
165
171
|
* </SideNav>
|
|
166
172
|
* ```
|
|
167
173
|
*/
|
|
174
|
+
|
|
168
175
|
export function SideNav({
|
|
169
176
|
header,
|
|
170
177
|
topContent,
|
|
@@ -205,7 +212,22 @@ export function SideNav({
|
|
|
205
212
|
const {
|
|
206
213
|
ref: modalityRef
|
|
207
214
|
} = useInteractionModalityTracking();
|
|
208
|
-
|
|
215
|
+
// The initial state never animates. A change before the rail's first paint
|
|
216
|
+
// lands at once, unless the rail's own toggle made it. Until a frame runs
|
|
217
|
+
// after the nav attaches, the document timeline reads the frame it read
|
|
218
|
+
// then.
|
|
219
|
+
const mountFrameRef = useRef(null);
|
|
220
|
+
const mountedNavRef = useRef(null);
|
|
221
|
+
const isOwnToggleRef = useRef(false);
|
|
222
|
+
const recordMountFrame = useCallback(nav => {
|
|
223
|
+
// An inline ref re-attaches the same nav on each render. Only a new nav
|
|
224
|
+
// starts a new initial state.
|
|
225
|
+
if (nav != null && nav !== mountedNavRef.current) {
|
|
226
|
+
mountedNavRef.current = nav;
|
|
227
|
+
mountFrameRef.current = frameTimeOf(nav.ownerDocument);
|
|
228
|
+
}
|
|
229
|
+
}, []);
|
|
230
|
+
const mergedNavRef = useMergedRefs(ref, navRef, modalityRef, recordMountFrame);
|
|
209
231
|
const collapseStateRef = useRef({
|
|
210
232
|
isCollapsed: false,
|
|
211
233
|
toggle: () => {},
|
|
@@ -228,10 +250,10 @@ export function SideNav({
|
|
|
228
250
|
});
|
|
229
251
|
const collapsed = resizableHook.isCollapsed;
|
|
230
252
|
|
|
231
|
-
//
|
|
232
|
-
//
|
|
233
|
-
// played after it before paint. Inside AppShell the
|
|
234
|
-
// it through AppShell's own handle
|
|
253
|
+
// A collapse or expand plays the rail's motion, except an app's change
|
|
254
|
+
// before the rail's first paint. It is measured in the commit before the
|
|
255
|
+
// DOM changes and played after it, before paint. Inside AppShell the
|
|
256
|
+
// content area moves with it through AppShell's own handle; outside,
|
|
235
257
|
// SideNav holds its own over its parent.
|
|
236
258
|
const shell = use(SideNavShellContext);
|
|
237
259
|
// A resizable rail's wrapper holds the nav and the handle; outside AppShell
|
|
@@ -248,6 +270,14 @@ export function SideNav({
|
|
|
248
270
|
running?.rail.end();
|
|
249
271
|
running?.endContent();
|
|
250
272
|
motionRef.current = null;
|
|
273
|
+
const isOwnToggle = isOwnToggleRef.current;
|
|
274
|
+
isOwnToggleRef.current = false;
|
|
275
|
+
const frame = frameTimeOf(navRef.current?.ownerDocument);
|
|
276
|
+
if (!isOwnToggle && (frame == null || frame === mountFrameRef.current)) {
|
|
277
|
+
railSnapshotRef.current = null;
|
|
278
|
+
shell?.landContent();
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
251
281
|
railSnapshotRef.current = snapshotRail(shell?.rail() ?? ownRail(), shell?.animatedLayout ?? ownLayout, shown, wasCollapsed);
|
|
252
282
|
// A collapse covers the old rail with its copy; when the rail cannot
|
|
253
283
|
// be copied, the page lands at once with it, on one clock, a running
|
|
@@ -365,6 +395,7 @@ export function SideNav({
|
|
|
365
395
|
}, [noteRailFocus, measureRail]);
|
|
366
396
|
const toggle = useCallback(() => {
|
|
367
397
|
const next = !collapsed;
|
|
398
|
+
isOwnToggleRef.current = true;
|
|
368
399
|
|
|
369
400
|
// Deprecated `handleRef` path only: an out-of-tree button reads this
|
|
370
401
|
// snapshot while rendering, which can happen before SideNav re-renders.
|
|
@@ -238,20 +238,6 @@ export interface TokenizerProps<T extends SearchableItem> extends Omit<FieldInpu
|
|
|
238
238
|
ref?: React.Ref<HTMLInputElement>;
|
|
239
239
|
/** Imperative handle ref for focus/blur control. */
|
|
240
240
|
handleRef?: React.Ref<TokenizerHandle>;
|
|
241
|
-
/**
|
|
242
|
-
* Experimental options, outside the stable compatibility promise: anything
|
|
243
|
-
* in this object may change or be removed in a patch release.
|
|
244
|
-
* @experimental
|
|
245
|
-
*/
|
|
246
|
-
experimental?: {
|
|
247
|
-
/**
|
|
248
|
-
* The earlier spelling of `presentation`, with the same values. The
|
|
249
|
-
* top-level `presentation` wins when both are set.
|
|
250
|
-
* @experimental
|
|
251
|
-
* @deprecated Use the stable `presentation` prop.
|
|
252
|
-
*/
|
|
253
|
-
presentation?: TokenizerPresentation;
|
|
254
|
-
};
|
|
255
241
|
}
|
|
256
242
|
/** How Tokenizer presents its choices; see `TokenizerProps.presentation`. */
|
|
257
243
|
export type TokenizerPresentation = AdaptivePresentation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tokenizer.d.ts","sourceRoot":"","sources":["../../src/Tokenizer/Tokenizer.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,EAYZ,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AAUf,OAAO,EACL,KAAK,mBAAmB,EAEzB,MAAM,qBAAqB,CAAC;AAM7B,OAAO,EACL,KAAK,oBAAoB,EAE1B,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"Tokenizer.d.ts","sourceRoot":"","sources":["../../src/Tokenizer/Tokenizer.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,EAYZ,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AAUf,OAAO,EACL,KAAK,mBAAmB,EAEzB,MAAM,qBAAqB,CAAC;AAM7B,OAAO,EACL,KAAK,oBAAoB,EAE1B,MAAM,kCAAkC,CAAC;AAI1C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAG9C,OAAO,EAGL,KAAK,WAAW,EAKjB,MAAM,UAAU,CAAC;AAIlB,OAAO,EAAiB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AAWtD,OAAO,KAAK,EAEV,cAAc,EACd,YAAY,EACb,MAAM,oBAAoB,CAAC;AAQ5B,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,+BAA+B,CAAC;AAWxE,YAAY,EACV,WAAW,IAAI,eAAe,EAC9B,eAAe,IAAI,mBAAmB,GACvC,MAAM,UAAU,CAAC;AAMl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ChD,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC,GACvB,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC;yBAFL,SAAS"}
|
|
@@ -31,7 +31,6 @@ import { useBusyAnnouncement } from "../hooks/useBusyAnnouncement.js";
|
|
|
31
31
|
import { useAdaptivePresentation } from "../hooks/useAdaptivePresentation.js";
|
|
32
32
|
import { useIsHydrating } from "../hooks/useIsHydrating.js";
|
|
33
33
|
import { VisuallyHidden } from "../VisuallyHidden/index.js";
|
|
34
|
-
import { useDevWarning } from "../hooks/useDevWarning.js";
|
|
35
34
|
import { warnOnce } from "../utils/devWarning.js";
|
|
36
35
|
import { BaseTypeahead } from "../Typeahead/BaseTypeahead.js";
|
|
37
36
|
import { useSize } from "../SizeContext/SizeContext.js";
|
|
@@ -432,8 +431,7 @@ export function Tokenizer({
|
|
|
432
431
|
ref,
|
|
433
432
|
handleRef,
|
|
434
433
|
onKeyDown,
|
|
435
|
-
presentation
|
|
436
|
-
experimental,
|
|
434
|
+
presentation = 'adaptive',
|
|
437
435
|
id: idProp,
|
|
438
436
|
'aria-describedby': ariaDescribedByProp,
|
|
439
437
|
'aria-labelledby': ariaLabelledByProp,
|
|
@@ -473,8 +471,6 @@ export function Tokenizer({
|
|
|
473
471
|
// `adaptive` resolves through the policy the selection controls share. An
|
|
474
472
|
// open sheet keeps its presentation until it closes. A resolution change
|
|
475
473
|
// during a task does not replace the open surface.
|
|
476
|
-
const presentation = presentationProp ?? experimental?.presentation ?? 'adaptive';
|
|
477
|
-
useDevWarning('Tokenizer', '`presentation` and `experimental.presentation` are both set; `presentation` wins. Remove `experimental.presentation`.', presentationProp !== undefined && experimental?.presentation !== undefined);
|
|
478
474
|
const resolvedPresentation = useAdaptivePresentation(presentation);
|
|
479
475
|
const [isSheetOpen, setIsSheetOpen] = useState(false);
|
|
480
476
|
// Latched for the sheet's lifetime: a sheet stays presented after it closes
|
|
@@ -419,11 +419,9 @@ function TokenizerSheetContent({
|
|
|
419
419
|
// `action` is declared on `SearchableItem` for the grid-adopting hosts; the
|
|
420
420
|
// sheet rows have not adopted it, so a row renders the item without the
|
|
421
421
|
// control and says so (`spec:AST-058` FR9), as the inline panel does.
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
}
|
|
426
|
-
}, [results]);
|
|
422
|
+
if (results.some(item => item.action != null)) {
|
|
423
|
+
warnOnce('tokenizer-sheet:item-action', 'Tokenizer', 'A result carries `action`, which the bottom-sheet rows do not render ' + 'yet; the item is shown without it.');
|
|
424
|
+
}
|
|
427
425
|
|
|
428
426
|
// The pending Spinner below stays named, as the inline field's does
|
|
429
427
|
// (`family:input-fields` FR7), but is not a live region; the sheet announces
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file Tooltip.tsx
|
|
3
3
|
* @input Uses React, useTooltip hook
|
|
4
|
-
* @output Exports Tooltip component for hover/focus triggered tooltips
|
|
5
|
-
* module-only TooltipWithTriggerBehavior that InfoTip's press-to-pin uses
|
|
4
|
+
* @output Exports Tooltip component for hover/focus triggered tooltips
|
|
6
5
|
* @position Layer component; uses display:contents wrapper to avoid cloneElement
|
|
7
6
|
*
|
|
8
7
|
* SYNC: When modified, update these files to stay in sync:
|
|
@@ -12,7 +11,6 @@
|
|
|
12
11
|
*/
|
|
13
12
|
import React, { type ReactElement, type ReactNode } from 'react';
|
|
14
13
|
import { type TooltipFocusTrigger, type TooltipTouchTrigger } from './useTooltip.js';
|
|
15
|
-
import { type LayerTriggerBehavior } from '../Layer/usePressPin.js';
|
|
16
14
|
import type { LayerAlignment, LayerPlacement } from '../Layer/useLayer.js';
|
|
17
15
|
export type { TooltipFocusTrigger, TooltipTouchTrigger } from './useTooltip.js';
|
|
18
16
|
export interface TooltipProps {
|
|
@@ -128,27 +126,8 @@ export interface TooltipProps {
|
|
|
128
126
|
* </Tooltip>
|
|
129
127
|
* ```
|
|
130
128
|
*/
|
|
131
|
-
export declare function Tooltip(
|
|
129
|
+
export declare function Tooltip({ children, anchorRef, content, placement, alignment, delay, hideDelay, focusTrigger, touchTrigger, isEnabled, onOpenChange, hasHoverIndication, isOpen, isDefaultOpen, }: TooltipProps): ReactElement;
|
|
132
130
|
export declare namespace Tooltip {
|
|
133
131
|
var displayName: string;
|
|
134
132
|
}
|
|
135
|
-
/**
|
|
136
|
-
* Module-only props for `TooltipWithTriggerBehavior`. Not exported from the
|
|
137
|
-
* package.
|
|
138
|
-
*/
|
|
139
|
-
export interface TooltipWithTriggerBehaviorProps extends TooltipProps {
|
|
140
|
-
/**
|
|
141
|
-
* How the trigger opens the tooltip. `toggle` pins it on a click, a tap,
|
|
142
|
-
* Enter, or Space on a button trigger, and stops that press at the trigger
|
|
143
|
-
* (see `useTooltipWithTriggerBehavior`). InfoTip uses it.
|
|
144
|
-
*
|
|
145
|
-
* @default 'adaptive'
|
|
146
|
-
*/
|
|
147
|
-
triggerBehavior?: LayerTriggerBehavior;
|
|
148
|
-
}
|
|
149
|
-
/**
|
|
150
|
-
* `Tooltip` with a trigger behavior. Module-only: InfoTip's press-to-pin goes
|
|
151
|
-
* through it, and the package does not export it.
|
|
152
|
-
*/
|
|
153
|
-
export declare function TooltipWithTriggerBehavior({ children, anchorRef, content, placement, alignment, delay, hideDelay, focusTrigger, touchTrigger, triggerBehavior, isEnabled, onOpenChange, hasHoverIndication, isOpen, isDefaultOpen, }: TooltipWithTriggerBehaviorProps): ReactElement;
|
|
154
133
|
//# sourceMappingURL=Tooltip.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../src/Tooltip/Tooltip.tsx"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../src/Tooltip/Tooltip.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,EAGZ,KAAK,YAAY,EACjB,KAAK,SAAS,EACf,MAAM,OAAO,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