@astryxdesign/core 0.7.7-canary.fc68123 → 0.7.7
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/CHANGELOG.md +104 -0
- package/dist/AlertDialog/AlertDialog.d.ts +1 -4
- package/dist/AlertDialog/AlertDialog.d.ts.map +1 -1
- package/dist/AlertDialog/AlertDialog.js +6 -36
- package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetPanel.js +4 -23
- package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
- package/dist/BottomSheet/useSheetGestures.js +1 -3
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +1 -17
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +2 -13
- package/dist/ComplexSelector/ComplexSelector.d.ts +1 -4
- package/dist/ComplexSelector/ComplexSelector.d.ts.map +1 -1
- package/dist/ComplexSelector/ComplexSelector.js +4 -14
- package/dist/ContextMenu/ContextMenu.js +2 -2
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +31 -7
- package/dist/Field/Field.js +2 -2
- package/dist/HoverCard/HoverCard.d.ts +3 -4
- package/dist/HoverCard/HoverCard.d.ts.map +1 -1
- package/dist/HoverCard/HoverCard.js +2 -27
- package/dist/HoverCard/useHoverCard.d.ts +4 -5
- package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
- package/dist/HoverCard/useHoverCard.js +31 -17
- package/dist/Icon/Icon.d.ts +1 -5
- package/dist/Icon/Icon.d.ts.map +1 -1
- package/dist/Icon/Icon.js +2 -5
- package/dist/Layer/usePressPin.d.ts +5 -17
- package/dist/Layer/usePressPin.d.ts.map +1 -1
- package/dist/Layer/usePressPin.js +12 -62
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +0 -18
- package/dist/PowerSearch/PowerSearch.d.ts +3 -36
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +127 -433
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts +1 -32
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchEditPopover.js +6 -17
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts +3 -38
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchValueEditor.js +61 -170
- package/dist/PowerSearch/formatFilterValue.d.ts +0 -7
- package/dist/PowerSearch/formatFilterValue.d.ts.map +1 -1
- package/dist/PowerSearch/formatFilterValue.js +1 -11
- package/dist/RadioList/RadioList.d.ts.map +1 -1
- package/dist/RadioList/RadioList.js +2 -3
- package/dist/RadioList/RadioListItem.d.ts +1 -1
- package/dist/RadioList/RadioListItem.d.ts.map +1 -1
- package/dist/RadioList/RadioListItem.js +3 -5
- package/dist/Resizable/ResizeHandle.d.ts +1 -2
- package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
- package/dist/Resizable/ResizeHandle.js +77 -99
- package/dist/SegmentedControl/useSegmentedSelectionMotion.d.ts.map +1 -1
- package/dist/SegmentedControl/useSegmentedSelectionMotion.js +3 -3
- package/dist/Slider/sliderTouchController.js +2 -2
- package/dist/Spinner/Spinner.d.ts +1 -1
- package/dist/Spinner/Spinner.d.ts.map +1 -1
- package/dist/Spinner/Spinner.js +58 -60
- package/dist/Switch/useSwitchTouch.js +4 -4
- package/dist/Table/BaseTable.d.ts.map +1 -1
- package/dist/Table/BaseTable.js +8 -29
- package/dist/TextInput/TextInput.d.ts +2 -2
- package/dist/TextInput/TextInput.d.ts.map +1 -1
- package/dist/TextInput/TextInput.js +7 -10
- package/dist/Toast/Toast.d.ts +1 -11
- package/dist/Toast/Toast.d.ts.map +1 -1
- package/dist/Toast/Toast.js +15 -25
- package/dist/Toast/ToastViewport.d.ts.map +1 -1
- package/dist/Toast/ToastViewport.js +34 -94
- package/dist/Toast/types.d.ts +3 -9
- package/dist/Toast/types.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.d.ts +1 -19
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +53 -34
- package/dist/Typeahead/TypeaheadItem.d.ts +1 -2
- package/dist/Typeahead/TypeaheadItem.d.ts.map +1 -1
- package/dist/astryx.css +6 -35
- package/dist/gestures/PressTracker.d.ts.map +1 -1
- package/dist/gestures/PressTracker.js +3 -4
- package/dist/hooks/actionGroupTracker.d.ts +1 -4
- package/dist/hooks/actionGroupTracker.d.ts.map +1 -1
- package/dist/hooks/actionGroupTracker.js +3 -13
- package/dist/hooks/index.d.ts +0 -1
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +0 -1
- package/dist/hooks/useAttachment.d.ts +1 -1
- package/dist/hooks/useAttachment.js +1 -1
- package/dist/hooks/useInputStatusIcon.d.ts +1 -1
- package/dist/hooks/useInputStatusIcon.d.ts.map +1 -1
- package/dist/hooks/useInputStatusIcon.js +2 -2
- package/dist/hooks/useLongPress.d.ts +2 -6
- package/dist/hooks/useLongPress.d.ts.map +1 -1
- package/dist/hooks/useLongPress.js +15 -95
- package/dist/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.js +0 -6
- package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/en.generated.js +0 -30
- package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pseudo.generated.js +0 -30
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -4
- package/dist/motion/animatedLayout.d.ts.map +1 -1
- package/dist/motion/animatedLayout.js +6 -5
- package/dist/motion/animator.d.ts +14 -14
- package/dist/motion/animator.d.ts.map +1 -1
- package/dist/motion/animator.js +18 -41
- package/dist/utils/dateParser.d.ts.map +1 -1
- package/dist/utils/dateParser.js +0 -12
- package/dist/utils/focusReturn.d.ts +0 -15
- package/dist/utils/focusReturn.d.ts.map +1 -1
- package/dist/utils/focusReturn.js +0 -28
- package/dist/utils/interactionOverlay.stylex.d.ts +2 -3
- package/dist/utils/interactionOverlay.stylex.d.ts.map +1 -1
- package/dist/utils/interactionOverlay.stylex.js +2 -3
- package/dist/utils/pressFeedback.d.ts.map +1 -1
- package/dist/utils/pressFeedback.js +6 -19
- package/locales/en.json +0 -120
- package/locales/pseudo.json +0 -90
- package/package.json +5 -10
- package/src/AlertDialog/AlertDialog.doc.mjs +2 -2
- package/src/AlertDialog/AlertDialog.tsx +5 -37
- package/src/BottomSheet/BottomSheetPanel.tsx +3 -37
- package/src/BottomSheet/useSheetGestures.ts +1 -3
- package/src/Button/Button.tsx +4 -26
- package/src/CheckboxInput/CheckboxInput.doc.mjs +0 -18
- package/src/CheckboxInput/CheckboxInput.tsx +9 -36
- package/src/ComplexSelector/ComplexSelector.tsx +5 -20
- package/src/ContextMenu/ContextMenu.tsx +2 -2
- package/src/Dialog/Dialog.tsx +31 -10
- package/src/Field/Field.tsx +2 -2
- package/src/HoverCard/HoverCard.doc.mjs +2 -4
- package/src/HoverCard/HoverCard.tsx +4 -35
- package/src/HoverCard/useHoverCard.doc.mjs +36 -178
- package/src/HoverCard/useHoverCard.tsx +52 -46
- package/src/Icon/Icon.doc.mjs +8 -49
- package/src/Icon/Icon.tsx +7 -15
- package/src/Layer/usePressPin.ts +15 -81
- package/src/Lightbox/Lightbox.tsx +0 -18
- package/src/PowerSearch/PowerSearch.doc.mjs +5 -54
- package/src/PowerSearch/PowerSearch.tsx +155 -609
- package/src/PowerSearch/PowerSearchEditPopover.tsx +6 -28
- package/src/PowerSearch/PowerSearchValueEditor.tsx +38 -203
- package/src/PowerSearch/formatFilterValue.ts +1 -18
- package/src/RadioList/RadioList.tsx +2 -3
- package/src/RadioList/RadioListItem.tsx +3 -5
- package/src/Resizable/Resizable.doc.mjs +4 -5
- package/src/Resizable/ResizeHandle.tsx +109 -167
- package/src/SegmentedControl/useSegmentedSelectionMotion.ts +3 -6
- package/src/Slider/sliderTouchController.ts +2 -2
- package/src/Spinner/Spinner.tsx +63 -77
- package/src/Switch/useSwitchTouch.ts +4 -4
- package/src/Table/BaseTable.tsx +12 -46
- package/src/TextInput/TextInput.tsx +10 -11
- package/src/Toast/Toast.doc.mjs +3 -4
- package/src/Toast/Toast.tsx +32 -52
- package/src/Toast/ToastViewport.tsx +35 -121
- package/src/Toast/types.ts +3 -9
- package/src/Tooltip/useTooltip.doc.mjs +0 -24
- package/src/Tooltip/useTooltip.tsx +56 -61
- package/src/Typeahead/TypeaheadItem.doc.mjs +3 -6
- package/src/Typeahead/TypeaheadItem.tsx +1 -2
- package/src/gestures/PressTracker.ts +3 -4
- package/src/gestures/README.md +1 -7
- package/src/hooks/actionGroupTracker.ts +5 -20
- package/src/hooks/index.ts +0 -2
- package/src/hooks/useAttachment.ts +1 -1
- package/src/hooks/useInputStatusIcon.tsx +2 -3
- package/src/hooks/useLongPress.doc.mjs +2 -2
- package/src/hooks/useLongPress.ts +15 -136
- package/src/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.ts +0 -6
- package/src/i18n/generated-locales/en.generated.ts +0 -41
- package/src/i18n/generated-locales/pseudo.generated.ts +0 -42
- package/src/index.ts +0 -13
- package/src/motion/README.md +5 -9
- package/src/motion/animatedLayout.ts +4 -5
- package/src/motion/animator.ts +29 -61
- package/src/utils/dateParser.ts +0 -16
- package/src/utils/focusReturn.ts +0 -30
- package/src/utils/interactionOverlay.stylex.ts +2 -3
- package/src/utils/pressFeedback.ts +6 -19
- package/dist/PowerSearch/PowerSearchBottomSheet.d.ts +0 -100
- package/dist/PowerSearch/PowerSearchBottomSheet.d.ts.map +0 -1
- package/dist/PowerSearch/PowerSearchBottomSheet.js +0 -1913
- package/dist/PowerSearch/formatTokenValue.d.ts +0 -28
- package/dist/PowerSearch/formatTokenValue.d.ts.map +0 -1
- package/dist/PowerSearch/formatTokenValue.js +0 -160
- package/dist/PowerSearch/powerSearchSheetUtils.d.ts +0 -65
- package/dist/PowerSearch/powerSearchSheetUtils.d.ts.map +0 -1
- package/dist/PowerSearch/powerSearchSheetUtils.js +0 -168
- package/dist/animator/createAnimator.d.ts +0 -98
- package/dist/animator/createAnimator.d.ts.map +0 -1
- package/dist/animator/createAnimator.js +0 -259
- package/dist/hooks/pressGroupContext.d.ts +0 -6
- package/dist/hooks/pressGroupContext.d.ts.map +0 -1
- package/dist/hooks/pressGroupContext.js +0 -20
- package/dist/hooks/useActionGroupTracking.d.ts +0 -53
- package/dist/hooks/useActionGroupTracking.d.ts.map +0 -1
- package/dist/hooks/useActionGroupTracking.js +0 -174
- package/dist/hooks/useAnimator.d.ts +0 -41
- package/dist/hooks/useAnimator.d.ts.map +0 -1
- package/dist/hooks/useAnimator.js +0 -70
- package/dist/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.d.ts +0 -8
- package/dist/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.d.ts.map +0 -1
- package/dist/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.js +0 -42
- package/dist/i18n/generated-english/PowerSearch/formatTokenValue.generated.d.ts +0 -8
- package/dist/i18n/generated-english/PowerSearch/formatTokenValue.generated.d.ts.map +0 -1
- package/dist/i18n/generated-english/PowerSearch/formatTokenValue.generated.js +0 -14
- package/dist/internal/indicatorPress.stylex.d.ts +0 -20
- package/dist/internal/indicatorPress.stylex.d.ts.map +0 -1
- package/dist/internal/indicatorPress.stylex.js +0 -26
- package/dist/motion/progress.d.ts +0 -88
- package/dist/motion/progress.d.ts.map +0 -1
- package/dist/motion/progress.js +0 -128
- package/dist/motion/uikit/alert.d.ts +0 -41
- package/dist/motion/uikit/alert.d.ts.map +0 -1
- package/dist/motion/uikit/alert.js +0 -43
- package/dist/privateAttributes/pressGroupItem.stylex.d.ts +0 -15
- package/dist/privateAttributes/pressGroupItem.stylex.d.ts.map +0 -1
- package/dist/privateAttributes/pressGroupItem.stylex.js +0 -23
- package/dist/utils/triggerFocus.d.ts +0 -36
- package/dist/utils/triggerFocus.d.ts.map +0 -1
- package/dist/utils/triggerFocus.js +0 -65
- package/src/PowerSearch/PowerSearchBottomSheet.tsx +0 -2515
- package/src/PowerSearch/formatTokenValue.ts +0 -215
- package/src/PowerSearch/powerSearchSheetUtils.ts +0 -224
- package/src/animator/createAnimator.doc.mjs +0 -153
- package/src/animator/createAnimator.ts +0 -324
- package/src/hooks/pressGroupContext.ts +0 -21
- package/src/hooks/useActionGroupTracking.ts +0 -224
- package/src/hooks/useAnimator.doc.mjs +0 -109
- package/src/hooks/useAnimator.ts +0 -67
- package/src/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.ts +0 -43
- package/src/i18n/generated-english/PowerSearch/formatTokenValue.generated.ts +0 -15
- package/src/internal/indicatorPress.stylex.ts +0 -24
- package/src/motion/progress.ts +0 -155
- package/src/motion/uikit/alert.ts +0 -43
- package/src/privateAttributes/pressGroupItem.stylex.ts +0 -23
- package/src/utils/triggerFocus.ts +0 -80
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../src/Dialog/Dialog.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AA6B5C,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAMhD,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../src/Dialog/Dialog.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AA6B5C,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAMhD,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,SAAS,CAAC;AA+B9C;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,gBAAgB,CAAC;AAEnD;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,CAAC;AAEzD,4EAA4E;AAC5E,UAAU,mBAAmB;IAC3B,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC1B;AAED;;;;;GAKG;AACH,MAAM,WAAW,cAAe,SAAQ,mBAAmB;IACzD,6EAA6E;IAC7E,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,yEAAyE;IACzE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB;AAuBD,2FAA2F;AAC3F,eAAO,MAAM,uCAAuC;;;;;;;;;;;CAW1C,CAAC;AAwLX;;;;;;;;;GASG;AACH,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,cAAc;;;;;EAUpE;AAED,MAAM,WAAW,WAAY,SAAQ,SAAS,CAAC,iBAAiB,CAAC;IAC/D,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACnC;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;;;;OAOG;IACH,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,OAAO,CAAC;IAE3C;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAExB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAE5B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC;IAEpC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;IAExB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;IAExB;;;;OAIG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IAEtB;;;OAGG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,MAAM,CAAC,EACrB,MAAM,EAAE,UAAU,EAClB,QAAgB,EAChB,YAAY,EACZ,KAAW,EACX,SAAmB,EACnB,QAAQ,EACR,OAAoB,EACpB,OAAgB,EAChB,OAAO,EACP,QAAQ,EACR,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,KAAK,EACT,EAAE,WAAW,sCAgbb;yBAhce,MAAM"}
|
package/dist/Dialog/Dialog.js
CHANGED
|
@@ -55,7 +55,7 @@ import { DialogContext } from "./DialogContext.js";
|
|
|
55
55
|
import { themeProps } from "../utils/themeProps.js";
|
|
56
56
|
import { focusOutlineProps } from "../utils/focusOutline.stylex.js";
|
|
57
57
|
import { useInteractionModalityTracking } from "../utils/interactionModality.js";
|
|
58
|
-
import { focusForLastInput,
|
|
58
|
+
import { focusForLastInput, isFocusLost } from "../utils/focusReturn.js";
|
|
59
59
|
import { ModalAnnounceProvider } from "../hooks/ModalAnnounceProvider.js";
|
|
60
60
|
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
61
61
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -461,15 +461,39 @@ export function Dialog({
|
|
|
461
461
|
}, [isOpen, isInline]);
|
|
462
462
|
|
|
463
463
|
// A dialog that unmounts while open (rendered only while open, or removed
|
|
464
|
-
// with the rest of a view) never runs the close branch above
|
|
465
|
-
//
|
|
464
|
+
// with the rest of a view) never runs the close branch above, and removing a
|
|
465
|
+
// <dialog> does not run the browser's own focus return. Focus left inside
|
|
466
|
+
// it, or dropped to the body by the removal, goes back to the opener.
|
|
466
467
|
useEffect(() => {
|
|
467
|
-
|
|
468
|
-
if (isInline || dialog == null) {
|
|
468
|
+
if (isInline) {
|
|
469
469
|
return;
|
|
470
470
|
}
|
|
471
|
-
const
|
|
472
|
-
|
|
471
|
+
const dialog = dialogRef.current;
|
|
472
|
+
// Read now: a removed iframe's document has no window, so its frame
|
|
473
|
+
// element can no longer be found once the dialog is gone.
|
|
474
|
+
const host = dialog?.ownerDocument.defaultView?.frameElement ?? null;
|
|
475
|
+
return () => {
|
|
476
|
+
const trigger = triggerElementRef.current;
|
|
477
|
+
if (dialog == null || trigger == null) {
|
|
478
|
+
return;
|
|
479
|
+
}
|
|
480
|
+
// Checked once the commit has finished: StrictMode's simulated unmount
|
|
481
|
+
// leaves the dialog in the document, and only a real removal returns
|
|
482
|
+
// focus.
|
|
483
|
+
queueMicrotask(() => {
|
|
484
|
+
if (dialog.isConnected || !trigger.isConnected) {
|
|
485
|
+
return;
|
|
486
|
+
}
|
|
487
|
+
// isFocusLost reads the dialog's own document. For a dialog in an
|
|
488
|
+
// iframe, the document that hosts the frame must also have lost focus
|
|
489
|
+
// or keep it on that frame, wherever the opener is: a control the
|
|
490
|
+
// user pressed outside the frame to remove the dialog, or the frame
|
|
491
|
+
// itself, keeps its focus.
|
|
492
|
+
if (isFocusLost(dialog) && (host == null || isFocusLost(host))) {
|
|
493
|
+
focusForLastInput(trigger);
|
|
494
|
+
}
|
|
495
|
+
});
|
|
496
|
+
};
|
|
473
497
|
}, [isInline]);
|
|
474
498
|
|
|
475
499
|
// Host app-global surfaces (toasts) inside this modal while it is open, so
|
package/dist/Field/Field.js
CHANGED
|
@@ -22,11 +22,11 @@ import { FieldStatus } from "../FieldStatus/FieldStatus.js";
|
|
|
22
22
|
import { useFieldStatusAnnouncement } from "../FieldStatus/useFieldStatusAnnouncement.js";
|
|
23
23
|
import "../theme/tokens.stylex.js";
|
|
24
24
|
import { spacingVars, borderVars, sizeVars } from "../theme/tokens.stylex.js";
|
|
25
|
-
import { mergeProps } from "../utils/
|
|
25
|
+
import { mergeProps } from "../utils/index.js";
|
|
26
26
|
import { useDevWarning } from "../hooks/useDevWarning.js";
|
|
27
27
|
import { FormLayoutContext } from "../FormLayout/FormLayoutContext.js";
|
|
28
28
|
import { Text } from "../Text/Text.js";
|
|
29
|
-
import { VisuallyHidden } from "../VisuallyHidden/
|
|
29
|
+
import { VisuallyHidden } from "../VisuallyHidden/index.js";
|
|
30
30
|
import { themeProps } from "../utils/themeProps.js";
|
|
31
31
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
32
32
|
const styles = {
|
|
@@ -47,10 +47,9 @@ export interface HoverCardProps extends Pick<BaseProps, 'xstyle' | 'className' |
|
|
|
47
47
|
hideDelay?: number;
|
|
48
48
|
/**
|
|
49
49
|
* When to trigger on focus:
|
|
50
|
-
* - `auto`:
|
|
51
|
-
*
|
|
52
|
-
* - `
|
|
53
|
-
* - `never`: never on focus (for composite widgets)
|
|
50
|
+
* - `auto`: Only if element is naturally focusable
|
|
51
|
+
* - `always`: Always attach focus listeners
|
|
52
|
+
* - `never`: Never attach focus listeners (for composite widgets)
|
|
54
53
|
*
|
|
55
54
|
* @default 'auto'
|
|
56
55
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HoverCard.d.ts","sourceRoot":"","sources":["../../src/HoverCard/HoverCard.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"HoverCard.d.ts","sourceRoot":"","sources":["../../src/HoverCard/HoverCard.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAsB,KAAK,YAAY,EAAE,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAG7E,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC3B,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAC,cAAc,EAAE,cAAc,EAAC,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAG5C,YAAY,EACV,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,gBAAgB,CAAC;AA6ExB,MAAM,WAAW,cAAe,SAAQ,IAAI,CAC1C,SAAS,EACT,QAAQ,GAAG,WAAW,GAAG,OAAO,CACjC;IACC;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;OAEG;IACH,OAAO,EAAE,SAAS,CAAC;IAEnB;;;OAGG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC;IAE3B;;;OAGG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC;IAE3B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,qBAAqB,CAAC;IAErC;;;;;;;;OAQG;IACH,YAAY,CAAC,EAAE,qBAAqB,CAAC;IAErC;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IAEzC;;;;;;;;OAQG;IACH,kBAAkB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAEtC;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAiBD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,SAAS,CAAC,EACxB,QAAQ,EACR,OAAO,EACP,SAAmB,EACnB,SAAoB,EACpB,KAAW,EACX,SAAe,EACf,YAAqB,EACrB,YAAqB,EACrB,SAAgB,EAChB,KAAK,EACL,YAAY,EACZ,kBAA2B,EAC3B,MAAM,EACN,aAAa,EACb,MAAM,EACN,SAAS,EACT,KAAK,GACN,EAAE,cAAc,GAAG,YAAY,CAoL/B;yBAtMe,SAAS"}
|
|
@@ -15,8 +15,7 @@
|
|
|
15
15
|
* - /apps/storybook/stories/HoverCard.stories.tsx
|
|
16
16
|
* - /packages/cli/assets/templates/blocks/components/HoverCard/ (showcase blocks)
|
|
17
17
|
*/
|
|
18
|
-
import { useCallback, useRef
|
|
19
|
-
import { observeMutations } from "../utils/sharedMutationObserver.js";
|
|
18
|
+
import { useCallback, useRef } from 'react';
|
|
20
19
|
import { useIsomorphicLayoutEffect } from "../hooks/useIsomorphicLayoutEffect.js";
|
|
21
20
|
import * as stylex from '@stylexjs/stylex';
|
|
22
21
|
import { useHoverCard } from "./useHoverCard.js";
|
|
@@ -139,30 +138,6 @@ export function HoverCard({
|
|
|
139
138
|
onHide: handleHide
|
|
140
139
|
});
|
|
141
140
|
|
|
142
|
-
// The wrapper's first element is the trigger, and it can be replaced after
|
|
143
|
-
// mount: by new children, or by a child component that swaps its own root
|
|
144
|
-
// without a render here. Syncs with the DOM: on a replacement the wiring
|
|
145
|
-
// below re-runs, so the old element is released before the new one is wired.
|
|
146
|
-
const [triggerReplacements, setTriggerReplacements] = useState(0);
|
|
147
|
-
const observedTriggerRef = useRef(null);
|
|
148
|
-
useIsomorphicLayoutEffect(() => {
|
|
149
|
-
const wrapper = wrapperRef.current;
|
|
150
|
-
if (textOnly || wrapper == null) {
|
|
151
|
-
return;
|
|
152
|
-
}
|
|
153
|
-
observedTriggerRef.current = wrapper.firstElementChild;
|
|
154
|
-
return observeMutations(wrapper, {
|
|
155
|
-
childList: true
|
|
156
|
-
}, () => {
|
|
157
|
-
const trigger = wrapper.firstElementChild;
|
|
158
|
-
if (trigger === observedTriggerRef.current) {
|
|
159
|
-
return;
|
|
160
|
-
}
|
|
161
|
-
observedTriggerRef.current = trigger;
|
|
162
|
-
setTriggerReplacements(count => count + 1);
|
|
163
|
-
});
|
|
164
|
-
}, [textOnly]);
|
|
165
|
-
|
|
166
141
|
// For element children with display:contents, attach ref to first child
|
|
167
142
|
useIsomorphicLayoutEffect(() => {
|
|
168
143
|
if (textOnly) {
|
|
@@ -249,7 +224,7 @@ export function HoverCard({
|
|
|
249
224
|
firstChild.removeAttribute('aria-describedby');
|
|
250
225
|
}
|
|
251
226
|
};
|
|
252
|
-
}, [textOnly, label, hoverCard.ref, hoverCard.id, hoverCard.isOpen, hoverCard.describedBy
|
|
227
|
+
}, [textOnly, label, hoverCard.ref, hoverCard.id, hoverCard.isOpen, hoverCard.describedBy]);
|
|
253
228
|
|
|
254
229
|
// While closed, useLayer leaves only an inert <template> marker at this JSX
|
|
255
230
|
// position. When the card needs to open, it uses that marker to keep the
|
|
@@ -11,7 +11,7 @@ import { type ReactNode, type RefCallback } from 'react';
|
|
|
11
11
|
import { type ContextRenderProps, type LayerAlignment, type LayerPlacement } from '../Layer/useLayer.js';
|
|
12
12
|
import { type LayerTouchTrigger } from '../Layer/useTouchTrigger.js';
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* Focus trigger behavior for hover cards
|
|
15
15
|
*/
|
|
16
16
|
export type HoverCardFocusTrigger = 'auto' | 'always' | 'never';
|
|
17
17
|
/**
|
|
@@ -41,10 +41,9 @@ export interface HoverCardOptions {
|
|
|
41
41
|
hideDelay?: number;
|
|
42
42
|
/**
|
|
43
43
|
* When to trigger on focus:
|
|
44
|
-
* - `auto`:
|
|
45
|
-
*
|
|
46
|
-
* - `
|
|
47
|
-
* - `never`: never on focus (for composite widgets)
|
|
44
|
+
* - `auto`: Only if element is naturally focusable
|
|
45
|
+
* - `always`: Always attach focus listeners
|
|
46
|
+
* - `never`: Never attach focus listeners (for composite widgets)
|
|
48
47
|
*
|
|
49
48
|
* @default 'auto'
|
|
50
49
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useHoverCard.d.ts","sourceRoot":"","sources":["../../src/HoverCard/useHoverCard.tsx"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"useHoverCard.d.ts","sourceRoot":"","sources":["../../src/HoverCard/useHoverCard.tsx"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,WAAW,EACjB,MAAM,OAAO,CAAC;AAEf,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,0BAA0B,CAAC;AA8BlC;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEhE;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;AAEtD,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC;IAE3B;;;OAGG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC;IAE3B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,qBAAqB,CAAC;IAErC;;;;;;;;OAQG;IACH,YAAY,CAAC,EAAE,qBAAqB,CAAC;IAErC;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IAEpB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,GAAG,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;IAE9B;;;OAGG;IACH,WAAW,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;IAEtC;;;;OAIG;IACH,cAAc,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;IAEzC;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;;;OAMG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;;;;;;OAOG;IACH,eAAe,EAAE,CACf,QAAQ,EAAE,SAAS,EACnB,KAAK,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,aAAa,CAAC,KAC5C,SAAS,CAAC;IAEf;;OAEG;IACH,IAAI,EAAE,MAAM,IAAI,CAAC;IAEjB;;OAEG;IACH,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB;AAyBD;;;;;;;;;;;;;;;;GAgBG;AAEH,wBAAgB,YAAY,CAAC,OAAO,GAAE,gBAAqB,GAAG,eAAe,CA8c5E"}
|
|
@@ -11,8 +11,7 @@
|
|
|
11
11
|
* SYNC: When modified, update:
|
|
12
12
|
* - /packages/core/src/HoverCard/index.ts
|
|
13
13
|
*/
|
|
14
|
-
import { useCallback, useEffect, useRef
|
|
15
|
-
import { createTriggerFocusGate } from "../utils/triggerFocus.js";
|
|
14
|
+
import { useCallback, useEffect, useRef } from 'react';
|
|
16
15
|
import * as stylex from '@stylexjs/stylex';
|
|
17
16
|
import { useLayer } from "../Layer/useLayer.js";
|
|
18
17
|
import { useTouchTrigger } from "../Layer/useTouchTrigger.js";
|
|
@@ -34,13 +33,35 @@ const styles = {
|
|
|
34
33
|
};
|
|
35
34
|
|
|
36
35
|
/**
|
|
37
|
-
*
|
|
36
|
+
* Focus trigger behavior for hover cards
|
|
38
37
|
*/
|
|
39
38
|
|
|
40
39
|
/**
|
|
41
40
|
* Touch trigger behavior for hover cards
|
|
42
41
|
*/
|
|
43
42
|
|
|
43
|
+
/**
|
|
44
|
+
* Check if an element is naturally focusable
|
|
45
|
+
*/
|
|
46
|
+
function isFocusable(element) {
|
|
47
|
+
// Elements with explicit tabindex
|
|
48
|
+
if (element.hasAttribute('tabindex')) {
|
|
49
|
+
return element.tabIndex >= 0;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Naturally focusable elements
|
|
53
|
+
const focusableTags = ['A', 'BUTTON', 'INPUT', 'SELECT', 'TEXTAREA'];
|
|
54
|
+
if (focusableTags.includes(element.tagName)) {
|
|
55
|
+
return !element.disabled;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Elements with contenteditable
|
|
59
|
+
if (element.isContentEditable) {
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
|
|
44
65
|
/**
|
|
45
66
|
* Hook for hover card behavior with hover/focus triggers.
|
|
46
67
|
*
|
|
@@ -199,12 +220,8 @@ export function useHoverCard(options = {}) {
|
|
|
199
220
|
const handlePointerDown = useCallback(event => {
|
|
200
221
|
handleTouchPointerDown(event);
|
|
201
222
|
}, [handleTouchPointerDown]);
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
// focus that counted still hides on blur (utils/triggerFocus.ts).
|
|
205
|
-
const [focusGate] = useState(createTriggerFocusGate);
|
|
206
|
-
const handleFocusIn = useCallback(e => {
|
|
207
|
-
if (!focusGate.focusIn(e, focusTrigger) || !isEnabled) {
|
|
223
|
+
const handleFocusIn = useCallback(() => {
|
|
224
|
+
if (!isEnabled) {
|
|
208
225
|
return;
|
|
209
226
|
}
|
|
210
227
|
// A tap focuses the trigger it activates. Opening on that focus would
|
|
@@ -220,11 +237,8 @@ export function useHoverCard(options = {}) {
|
|
|
220
237
|
}
|
|
221
238
|
clearTimeouts();
|
|
222
239
|
showLayer();
|
|
223
|
-
}, [
|
|
240
|
+
}, [isEnabled, isTouchInteraction, clearTimeouts, showLayer]);
|
|
224
241
|
const handleFocusOut = useCallback(e => {
|
|
225
|
-
if (!focusGate.focusOut(e, focusTrigger)) {
|
|
226
|
-
return;
|
|
227
|
-
}
|
|
228
242
|
// Check if focus is moving to the hover card content
|
|
229
243
|
const relatedTarget = e.relatedTarget;
|
|
230
244
|
const popoverElement = document.getElementById(layerId);
|
|
@@ -233,7 +247,7 @@ export function useHoverCard(options = {}) {
|
|
|
233
247
|
return;
|
|
234
248
|
}
|
|
235
249
|
scheduleHide();
|
|
236
|
-
}, [
|
|
250
|
+
}, [layerId, scheduleHide]);
|
|
237
251
|
|
|
238
252
|
// Escape dismissal (WCAG 1.4.13) goes through the shared layer stack: a
|
|
239
253
|
// visible card is the top-most layer, so it takes the press and consumes it.
|
|
@@ -315,9 +329,9 @@ export function useHoverCard(options = {}) {
|
|
|
315
329
|
el.addEventListener('mouseleave', handleMouseLeave);
|
|
316
330
|
el.addEventListener('pointerdown', handlePointerDown);
|
|
317
331
|
|
|
318
|
-
//
|
|
319
|
-
|
|
320
|
-
if (
|
|
332
|
+
// Attach focus listeners based on focusTrigger option
|
|
333
|
+
const shouldAttachFocus = focusTrigger === 'always' || focusTrigger === 'auto' && isFocusable(el);
|
|
334
|
+
if (shouldAttachFocus) {
|
|
321
335
|
el.addEventListener('focusin', handleFocusIn);
|
|
322
336
|
el.addEventListener('focusout', handleFocusOut);
|
|
323
337
|
}
|
package/dist/Icon/Icon.d.ts
CHANGED
|
@@ -105,11 +105,7 @@ export type IconType = ComponentType<SVGProps<SVGSVGElement>>;
|
|
|
105
105
|
* Extends SVGProps to allow passing additional SVG attributes (used when icon is a component).
|
|
106
106
|
*/
|
|
107
107
|
export interface IconProps extends Omit<SVGProps<SVGSVGElement>, 'ref' | 'color'> {
|
|
108
|
-
/**
|
|
109
|
-
* Ref to the rendered SVG element when `icon` is an icon component. A
|
|
110
|
-
* semantic or namespaced name renders inside an internal wrapper, and the
|
|
111
|
-
* ref is not attached.
|
|
112
|
-
*/
|
|
108
|
+
/** Ref forwarded to the root element */
|
|
113
109
|
ref?: React.Ref<SVGSVGElement>;
|
|
114
110
|
/**
|
|
115
111
|
* Icon to render. Can be:
|
package/dist/Icon/Icon.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../src/Icon/Icon.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,EAAC,KAAK,aAAa,EAAE,KAAK,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC/D,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAC3C,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAInD,OAAO,KAAK,EAAC,QAAQ,EAAE,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AACvE,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,SAAS,CAAC;AAIzC,OAAO,EAAiB,KAAK,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAEhE,YAAY,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAiDhD,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8Df,CAAC;AAMH,MAAM,MAAM,SAAS,GAAG,MAAM,OAAO,WAAW,CAAC;AAEjD;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG,aAAa,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC;AAE9D;;;GAGG;AACH,MAAM,WAAW,SAAU,SAAQ,IAAI,CACrC,QAAQ,CAAC,aAAa,CAAC,EACvB,KAAK,GAAG,OAAO,CAChB;IACC
|
|
1
|
+
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../src/Icon/Icon.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,EAAC,KAAK,aAAa,EAAE,KAAK,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC/D,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAC3C,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAInD,OAAO,KAAK,EAAC,QAAQ,EAAE,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AACvE,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,SAAS,CAAC;AAIzC,OAAO,EAAiB,KAAK,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAEhE,YAAY,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAiDhD,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8Df,CAAC;AAMH,MAAM,MAAM,SAAS,GAAG,MAAM,OAAO,WAAW,CAAC;AAEjD;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG,aAAa,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC;AAE9D;;;GAGG;AACH,MAAM,WAAW,SAAU,SAAQ,IAAI,CACrC,QAAQ,CAAC,aAAa,CAAC,EACvB,KAAK,GAAG,OAAO,CAChB;IACC,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IAC/B;;;;;;OAMG;IACH,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,kBAAkB,CAAC;IAC/C;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;;;;;;;;;;OAYG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB;;;;;;;;;;;;;;;OAeG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB;AAyBD;;;;;;;GAOG;AACH,wBAAgB,IAAI,CAAC,EACnB,IAAI,EACJ,KAAiB,EACjB,IAAI,EAAE,QAAQ,EACd,OAAO,EACP,KAAK,EACL,GAAG,EACH,SAAS,EACT,KAAK,EACL,MAAM,EACN,GAAG,KAAK,EACT,EAAE,SAAS,qBAoDX;yBA/De,IAAI;;;AA2IpB;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,KAAK,CAAC,SAAS,GAAG,QAAQ,EAChC,KAAK,CAAC,EAAE;IAAC,IAAI,CAAC,EAAE,QAAQ,CAAC;IAAC,KAAK,CAAC,EAAE,SAAS,CAAA;CAAC,GAC3C,KAAK,CAAC,SAAS,CAYjB"}
|
package/dist/Icon/Icon.js
CHANGED
|
@@ -193,9 +193,7 @@ const colorStyles = {
|
|
|
193
193
|
*
|
|
194
194
|
* - Non-empty `label` → meaningful image: `role="img"` + `aria-label`, and no
|
|
195
195
|
* `aria-hidden` (an `aria-hidden` element is removed from the accessibility
|
|
196
|
-
* tree, so its accessible name would be ignored).
|
|
197
|
-
* `aria-hidden: undefined`. Many icon components, such as Heroicons, write
|
|
198
|
-
* `aria-hidden="true"` unless a prop replaces it.
|
|
196
|
+
* tree, so its accessible name would be ignored).
|
|
199
197
|
* - Omitted or empty `label` → decorative default: `aria-hidden="true"`.
|
|
200
198
|
*
|
|
201
199
|
* The result is spread BEFORE `{...props}` in both render modes so an explicit
|
|
@@ -204,8 +202,7 @@ const colorStyles = {
|
|
|
204
202
|
function getIconA11yProps(label) {
|
|
205
203
|
return label != null && label !== '' ? {
|
|
206
204
|
role: 'img',
|
|
207
|
-
'aria-label': label
|
|
208
|
-
'aria-hidden': undefined
|
|
205
|
+
'aria-label': label
|
|
209
206
|
} : {
|
|
210
207
|
'aria-hidden': 'true'
|
|
211
208
|
};
|
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
* @file usePressPin.ts
|
|
3
3
|
* @input A hover layer's trigger, open state, show and hide, and its
|
|
4
4
|
* `triggerBehavior` and `touchTrigger` options
|
|
5
|
-
* @output usePressPin, the press toggle that pins a hover layer open
|
|
6
|
-
*
|
|
7
|
-
* stopPressPinClick; the LayerTriggerBehavior type
|
|
5
|
+
* @output usePressPin, the press toggle that pins a hover layer open;
|
|
6
|
+
* isPressPinTrigger; stopPressPinClick; the LayerTriggerBehavior type
|
|
8
7
|
* @position Core-internal: one call per hover layer, useTooltip's. It owns
|
|
9
8
|
* the layer's touch trigger, so the host makes no second touch-trigger call.
|
|
10
9
|
*
|
|
@@ -67,18 +66,8 @@ export interface UsePressPinReturn {
|
|
|
67
66
|
isHeldOpen: () => boolean;
|
|
68
67
|
/** Wires the trigger element, or unwires it with `null`. */
|
|
69
68
|
attach: (element: HTMLElement | null) => void;
|
|
70
|
-
/** Drops the pin
|
|
69
|
+
/** Drops the pin: Escape, or a hide that came from elsewhere. */
|
|
71
70
|
unpin: () => void;
|
|
72
|
-
/**
|
|
73
|
-
* The app's `show()`: shows the layer and holds it open, as a pin does,
|
|
74
|
-
* until `release`, Escape, a press outside, or focus leaving the trigger
|
|
75
|
-
* and the layer. A controlled layer reports the request instead.
|
|
76
|
-
*/
|
|
77
|
-
hold: () => void;
|
|
78
|
-
/** The app's `hide()`: drops the hold and hides the layer. */
|
|
79
|
-
release: () => void;
|
|
80
|
-
/** Whether the app's `show()` holds the layer open now. */
|
|
81
|
-
isAppHeld: () => boolean;
|
|
82
71
|
/**
|
|
83
72
|
* While pinned, focus moving onto an element outside the trigger and the
|
|
84
73
|
* layer closes it. Returns whether the pin decided. The pin calls it for its
|
|
@@ -86,9 +75,8 @@ export interface UsePressPinReturn {
|
|
|
86
75
|
*/
|
|
87
76
|
handleFocusLeave: (event: FocusEvent) => boolean;
|
|
88
77
|
/**
|
|
89
|
-
* Whether the layer shows pinned on a wired trigger
|
|
90
|
-
*
|
|
91
|
-
* a `label`.
|
|
78
|
+
* Whether the layer shows pinned on a wired trigger. The host then announces
|
|
79
|
+
* its rendered text, unless the layer has a `label`.
|
|
92
80
|
*/
|
|
93
81
|
isPinShown: boolean;
|
|
94
82
|
/** The layer's touch trigger (useTouchTriggerInternal), wired to the pin. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePressPin.d.ts","sourceRoot":"","sources":["../../src/Layer/usePressPin.ts"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"usePressPin.d.ts","sourceRoot":"","sources":["../../src/Layer/usePressPin.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAKL,KAAK,UAAU,IAAI,eAAe,EAClC,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAIf,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC3B,MAAM,mBAAmB,CAAC;AAE3B;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAAG,UAAU,GAAG,QAAQ,CAAC;AAKzD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI,CAI9D;AAED,0EAA0E;AAC1E,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAM3D;AAED,MAAM,WAAW,kBAAkB;IACjC,qCAAqC;IACrC,eAAe,EAAE,oBAAoB,CAAC;IACtC,oDAAoD;IACpD,SAAS,EAAE,OAAO,CAAC;IACnB,mEAAmE;IACnE,MAAM,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B,mCAAmC;IACnC,WAAW,EAAE,OAAO,CAAC;IACrB,sCAAsC;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,mDAAmD;IACnD,SAAS,EAAE,MAAM,CAAC;IAClB,0CAA0C;IAC1C,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,2BAA2B;IAC3B,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,sEAAsE;IACtE,MAAM,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IAClC,2FAA2F;IAC3F,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4EAA4E;IAC5E,YAAY,EAAE,iBAAiB,CAAC;IAChC,iEAAiE;IACjE,UAAU,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;CAC3C;AAED,MAAM,WAAW,iBAAiB;IAChC,+EAA+E;IAC/E,eAAe,EAAE,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,KAAK,OAAO,CAAC;IAC1D;;;;OAIG;IACH,UAAU,EAAE,MAAM,OAAO,CAAC;IAC1B,4DAA4D;IAC5D,MAAM,EAAE,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC;IAC9C,iEAAiE;IACjE,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB;;;;OAIG;IACH,gBAAgB,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,OAAO,CAAC;IACjD;;;OAGG;IACH,UAAU,EAAE,OAAO,CAAC;IACpB,6EAA6E;IAC7E,KAAK,EAAE,IAAI,CACT,qBAAqB,EACnB,mBAAmB,GACnB,oBAAoB,GACpB,oBAAoB,GACpB,mBAAmB,GACnB,cAAc,CACjB,CAAC;CACH;AAwBD;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,iBAAiB,CA+V1E"}
|
|
@@ -6,9 +6,8 @@
|
|
|
6
6
|
* @file usePressPin.ts
|
|
7
7
|
* @input A hover layer's trigger, open state, show and hide, and its
|
|
8
8
|
* `triggerBehavior` and `touchTrigger` options
|
|
9
|
-
* @output usePressPin, the press toggle that pins a hover layer open
|
|
10
|
-
*
|
|
11
|
-
* stopPressPinClick; the LayerTriggerBehavior type
|
|
9
|
+
* @output usePressPin, the press toggle that pins a hover layer open;
|
|
10
|
+
* isPressPinTrigger; stopPressPinClick; the LayerTriggerBehavior type
|
|
12
11
|
* @position Core-internal: one call per hover layer, useTooltip's. It owns
|
|
13
12
|
* the layer's touch trigger, so the host makes no second touch-trigger call.
|
|
14
13
|
*
|
|
@@ -95,19 +94,8 @@ export function usePressPin(options) {
|
|
|
95
94
|
setIsPinnedState(next);
|
|
96
95
|
}, []);
|
|
97
96
|
|
|
98
|
-
// The app's show() holds the layer on any trigger, in any mode.
|
|
99
|
-
const isAppHeldRef = useRef(false);
|
|
100
|
-
const [isAppHeldState, setIsAppHeldState] = useState(false);
|
|
101
|
-
const setAppHeld = useCallback(next => {
|
|
102
|
-
isAppHeldRef.current = next;
|
|
103
|
-
setIsAppHeldState(next);
|
|
104
|
-
}, []);
|
|
105
|
-
|
|
106
97
|
// The last offered element lets a `triggerBehavior` change rewire it.
|
|
107
98
|
const triggerRef = useRef(null);
|
|
108
|
-
// Every offered trigger, in any mode, so focus leaving ends a pin or an
|
|
109
|
-
// app hold.
|
|
110
|
-
const focusTargetRef = useRef(null);
|
|
111
99
|
const offeredRef = useRef(null);
|
|
112
100
|
// A primitive: re-attaching the same trigger renders nothing.
|
|
113
101
|
const [offeredKind, setOfferedKind] = useState('none');
|
|
@@ -118,13 +106,6 @@ export function usePressPin(options) {
|
|
|
118
106
|
// a pinned layer through the pin, so the pin drops with it.
|
|
119
107
|
const hideFromTouch = useCallback(() => {
|
|
120
108
|
const current = optionsRef.current;
|
|
121
|
-
if (isAppHeldRef.current) {
|
|
122
|
-
setAppHeld(false);
|
|
123
|
-
if (current.isOpen !== undefined) {
|
|
124
|
-
current.report(false);
|
|
125
|
-
return;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
109
|
if (current.triggerBehavior === 'toggle' && triggerRef.current != null) {
|
|
129
110
|
if (current.isOpen !== undefined) {
|
|
130
111
|
current.report(false);
|
|
@@ -135,7 +116,7 @@ export function usePressPin(options) {
|
|
|
135
116
|
}
|
|
136
117
|
}
|
|
137
118
|
current.hide();
|
|
138
|
-
}, [setPinned
|
|
119
|
+
}, [setPinned]);
|
|
139
120
|
const {
|
|
140
121
|
isTouchPointerRef,
|
|
141
122
|
isTouchInteraction,
|
|
@@ -157,14 +138,13 @@ export function usePressPin(options) {
|
|
|
157
138
|
const close = useCallback(() => {
|
|
158
139
|
const current = optionsRef.current;
|
|
159
140
|
clearTapOpen();
|
|
160
|
-
setAppHeld(false);
|
|
161
141
|
if (current.isOpen !== undefined) {
|
|
162
142
|
current.report(false);
|
|
163
143
|
return;
|
|
164
144
|
}
|
|
165
145
|
setPinned(false);
|
|
166
146
|
current.hide();
|
|
167
|
-
}, [setPinned,
|
|
147
|
+
}, [setPinned, clearTapOpen]);
|
|
168
148
|
const announceName = useCallback(() => {
|
|
169
149
|
const current = optionsRef.current;
|
|
170
150
|
const name = current.label?.trim() ?? '';
|
|
@@ -253,9 +233,6 @@ export function usePressPin(options) {
|
|
|
253
233
|
}, [pressFromKey]);
|
|
254
234
|
const isHeldOpen = useCallback(() => {
|
|
255
235
|
const current = optionsRef.current;
|
|
256
|
-
if (isAppHeldRef.current && current.isLayerOpen) {
|
|
257
|
-
return current.isOpen !== false;
|
|
258
|
-
}
|
|
259
236
|
if (current.triggerBehavior !== 'toggle' || triggerRef.current == null) {
|
|
260
237
|
return false;
|
|
261
238
|
}
|
|
@@ -268,7 +245,7 @@ export function usePressPin(options) {
|
|
|
268
245
|
return false;
|
|
269
246
|
}
|
|
270
247
|
const next = event.relatedTarget;
|
|
271
|
-
const trigger =
|
|
248
|
+
const trigger = triggerRef.current;
|
|
272
249
|
// Focus that leaves for no element is a press's to decide. The trigger
|
|
273
250
|
// can sit in another document, so the check uses its own window.
|
|
274
251
|
const view = trigger?.ownerDocument.defaultView;
|
|
@@ -283,8 +260,6 @@ export function usePressPin(options) {
|
|
|
283
260
|
return true;
|
|
284
261
|
}, [isHeldOpen, close]);
|
|
285
262
|
const unwire = useCallback(() => {
|
|
286
|
-
focusTargetRef.current?.removeEventListener('focusout', handleFocusLeave);
|
|
287
|
-
focusTargetRef.current = null;
|
|
288
263
|
const previous = triggerRef.current;
|
|
289
264
|
if (previous == null) {
|
|
290
265
|
return;
|
|
@@ -292,6 +267,7 @@ export function usePressPin(options) {
|
|
|
292
267
|
previous.removeEventListener('click', handlePress);
|
|
293
268
|
previous.removeEventListener('keydown', handleKeyDown);
|
|
294
269
|
previous.removeEventListener('keyup', handleKeyUp);
|
|
270
|
+
previous.removeEventListener('focusout', handleFocusLeave);
|
|
295
271
|
const own = ownStateRef.current;
|
|
296
272
|
if (own != null) {
|
|
297
273
|
restoreAttribute(previous, 'aria-expanded', own.expanded);
|
|
@@ -314,14 +290,10 @@ export function usePressPin(options) {
|
|
|
314
290
|
mode: current.triggerBehavior
|
|
315
291
|
};
|
|
316
292
|
unwire();
|
|
317
|
-
if (element == null) {
|
|
293
|
+
if (element == null || current.triggerBehavior !== 'toggle') {
|
|
318
294
|
return;
|
|
319
295
|
}
|
|
320
|
-
|
|
321
|
-
// attaches none, and an app hold needs it on any trigger.
|
|
322
|
-
element.addEventListener('focusout', handleFocusLeave);
|
|
323
|
-
focusTargetRef.current = element;
|
|
324
|
-
if (current.triggerBehavior !== 'toggle' || !isPressPinTrigger(element)) {
|
|
296
|
+
if (!isPressPinTrigger(element)) {
|
|
325
297
|
return;
|
|
326
298
|
}
|
|
327
299
|
element.addEventListener('click', handlePress);
|
|
@@ -329,6 +301,8 @@ export function usePressPin(options) {
|
|
|
329
301
|
element.addEventListener('keydown', handleKeyDown);
|
|
330
302
|
element.addEventListener('keyup', handleKeyUp);
|
|
331
303
|
}
|
|
304
|
+
// Its own focus-leave listener: `focusTrigger="never"` attaches none.
|
|
305
|
+
element.addEventListener('focusout', handleFocusLeave);
|
|
332
306
|
ownStateRef.current = {
|
|
333
307
|
expanded: element.getAttribute('aria-expanded'),
|
|
334
308
|
controls: element.getAttribute('aria-controls')
|
|
@@ -354,28 +328,7 @@ export function usePressPin(options) {
|
|
|
354
328
|
if (isPinnedRef.current) {
|
|
355
329
|
setPinned(false);
|
|
356
330
|
}
|
|
357
|
-
|
|
358
|
-
setAppHeld(false);
|
|
359
|
-
}
|
|
360
|
-
}, [setPinned, setAppHeld]);
|
|
361
|
-
const hold = useCallback(() => {
|
|
362
|
-
const current = optionsRef.current;
|
|
363
|
-
if (!current.isEnabled) {
|
|
364
|
-
return;
|
|
365
|
-
}
|
|
366
|
-
setAppHeld(true);
|
|
367
|
-
armOutsideDismiss();
|
|
368
|
-
announceName();
|
|
369
|
-
if (current.isOpen !== undefined) {
|
|
370
|
-
current.report(true);
|
|
371
|
-
return;
|
|
372
|
-
}
|
|
373
|
-
current.show();
|
|
374
|
-
}, [setAppHeld, armOutsideDismiss, announceName]);
|
|
375
|
-
const release = useCallback(() => {
|
|
376
|
-
close();
|
|
377
|
-
}, [close]);
|
|
378
|
-
const isAppHeld = useCallback(() => isAppHeldRef.current, []);
|
|
331
|
+
}, [setPinned]);
|
|
379
332
|
|
|
380
333
|
// Each path that hides a pinned layer drops the pin itself, so a layer that
|
|
381
334
|
// does not show is never reported expanded.
|
|
@@ -391,15 +344,12 @@ export function usePressPin(options) {
|
|
|
391
344
|
writeAttribute(trigger, 'aria-expanded', isExpanded ? 'true' : 'false');
|
|
392
345
|
writeAttribute(trigger, 'aria-controls', isLayerOpen ? layerId : null);
|
|
393
346
|
});
|
|
394
|
-
const isPinShown = isToggleMode && isWired && isExpanded
|
|
347
|
+
const isPinShown = isToggleMode && isWired && isExpanded;
|
|
395
348
|
return {
|
|
396
349
|
isToggleTrigger,
|
|
397
350
|
isHeldOpen,
|
|
398
351
|
attach,
|
|
399
352
|
unpin,
|
|
400
|
-
hold,
|
|
401
|
-
release,
|
|
402
|
-
isAppHeld,
|
|
403
353
|
handleFocusLeave,
|
|
404
354
|
isPinShown,
|
|
405
355
|
touch: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Lightbox.d.ts","sourceRoot":"","sources":["../../src/Lightbox/Lightbox.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AASf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"Lightbox.d.ts","sourceRoot":"","sources":["../../src/Lightbox/Lightbox.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AASf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAsB5C;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,OAAO,CAAC;AAElD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,uBAAuB;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,gEAAgE;IAChE,GAAG,EAAE,MAAM,CAAC;IACZ,iDAAiD;IACjD,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,IAAI,CAAC,EAAE,iBAAiB,CAAC;CAC1B;AAED,MAAM,WAAW,aAAc,SAAQ,SAAS,CAAC,iBAAiB,CAAC;IACjE,+CAA+C;IAC/C,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACnC;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB;;;OAGG;IACH,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACxC;;;OAGG;IACH,KAAK,EAAE,aAAa,GAAG,aAAa,EAAE,CAAC;IACvC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAmKD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAgB,QAAQ,CAAC,EACvB,MAAM,EACN,YAAY,EACZ,KAAK,EACL,KAAK,EAAE,eAAe,EACtB,YAAgB,EAChB,aAAa,EACb,OAAe,EACf,WAAmB,EACnB,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,OAAO,EAAE,WAAW,EACpB,SAAS,EAAE,aAAa,EACxB,GAAG,KAAK,EACT,EAAE,aAAa,sCAsdf;yBAtee,QAAQ"}
|
|
@@ -42,7 +42,6 @@ import { isRtlElement } from "../hooks/isRtlElement.js";
|
|
|
42
42
|
import { registerEnglishFallback, useComponentTranslator } from "../i18n/useComponentTranslator.js";
|
|
43
43
|
import english from "../i18n/generated-english/Lightbox/Lightbox.generated.js";
|
|
44
44
|
import { isRenderable } from "../utils/isRenderable.js";
|
|
45
|
-
import { prepareFocusReturnOnRemoval } from "../utils/focusReturn.js";
|
|
46
45
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
47
46
|
registerEnglishFallback(english);
|
|
48
47
|
/**
|
|
@@ -327,23 +326,6 @@ export function Lightbox({
|
|
|
327
326
|
}
|
|
328
327
|
}
|
|
329
328
|
}, [isOpen, hasItem]);
|
|
330
|
-
|
|
331
|
-
// A viewer that unmounts while open (rendered only while open, or removed
|
|
332
|
-
// with the rest of a view) never runs the close branch above. Focus the
|
|
333
|
-
// removal lost goes back to the opener while the opener is still on the
|
|
334
|
-
// page.
|
|
335
|
-
useEffect(() => {
|
|
336
|
-
const dialog = dialogRef.current;
|
|
337
|
-
if (dialog == null) {
|
|
338
|
-
return;
|
|
339
|
-
}
|
|
340
|
-
const returnFocusOnRemoval = prepareFocusReturnOnRemoval(dialog);
|
|
341
|
-
return () => {
|
|
342
|
-
if (dialog.open) {
|
|
343
|
-
returnFocusOnRemoval(triggerElementRef.current);
|
|
344
|
-
}
|
|
345
|
-
};
|
|
346
|
-
}, [hasItem]);
|
|
347
329
|
const handleClose = useCallback(() => {
|
|
348
330
|
onOpenChange(false);
|
|
349
331
|
}, [onOpenChange]);
|