@astryxdesign/core 0.7.16 → 0.7.17-canary.g16fe6a8
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/AlertDialog/AlertDialog.d.ts +7 -4
- package/dist/AlertDialog/AlertDialog.d.ts.map +1 -1
- package/dist/AlertDialog/AlertDialog.js +41 -12
- package/dist/AlertDialog/useAlertMotion.d.ts +16 -0
- package/dist/AlertDialog/useAlertMotion.d.ts.map +1 -0
- package/dist/AlertDialog/useAlertMotion.js +277 -0
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +10 -3
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +5 -2
- package/dist/ComplexSelector/ComplexSelector.d.ts.map +1 -1
- package/dist/ComplexSelector/ComplexSelector.js +10 -4
- package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/ContextMenu/ContextMenu.js +20 -8
- package/dist/DropdownMenu/menuItemRoles.d.ts.map +1 -1
- package/dist/DropdownMenu/menuItemRoles.js +5 -2
- package/dist/Icon/Icon.js +4 -4
- package/dist/Icon/globalIconRegistry.d.ts.map +1 -1
- package/dist/Icon/globalIconRegistry.js +16 -6
- package/dist/Icon/useIcon.js +5 -5
- package/dist/Item/Item.d.ts +49 -67
- package/dist/Item/Item.d.ts.map +1 -1
- package/dist/Item/Item.js +91 -99
- package/dist/Layer/inputHold.d.ts +9 -7
- package/dist/Layer/inputHold.d.ts.map +1 -1
- package/dist/Layer/inputHold.js +74 -24
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +129 -8
- package/dist/Link/Link.d.ts.map +1 -1
- package/dist/Link/Link.js +6 -1
- package/dist/List/ListItem.d.ts +5 -7
- package/dist/List/ListItem.d.ts.map +1 -1
- package/dist/List/ListItem.js +11 -1
- package/dist/MetadataList/MetadataListItem.d.ts +7 -2
- package/dist/MetadataList/MetadataListItem.d.ts.map +1 -1
- package/dist/MetadataList/MetadataListItem.js +3 -1
- package/dist/MobileNav/MobileNav.d.ts.map +1 -1
- package/dist/MobileNav/MobileNav.js +32 -23
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +15 -7
- package/dist/Pagination/Pagination.d.ts +25 -2
- package/dist/Pagination/Pagination.d.ts.map +1 -1
- package/dist/Pagination/Pagination.js +87 -47
- package/dist/Popover/popoverSurfaceMotion.d.ts.map +1 -1
- package/dist/Popover/popoverSurfaceMotion.js +4 -9
- package/dist/Popover/usePopover.d.ts.map +1 -1
- package/dist/Popover/usePopover.js +4 -1
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +11 -5
- package/dist/Slider/Slider.d.ts.map +1 -1
- package/dist/Slider/Slider.js +15 -4
- package/dist/Swipe/SwipeActionsLayer.d.ts +31 -0
- package/dist/Swipe/SwipeActionsLayer.d.ts.map +1 -0
- package/dist/Swipe/SwipeActionsLayer.js +358 -0
- package/dist/Swipe/createSwipe.d.ts +26 -0
- package/dist/Swipe/createSwipe.d.ts.map +1 -0
- package/dist/Swipe/createSwipe.js +97 -0
- package/dist/Swipe/index.d.ts +3 -0
- package/dist/Swipe/index.d.ts.map +1 -0
- package/dist/Swipe/index.js +5 -0
- package/dist/Swipe/swipeHost.d.ts +208 -0
- package/dist/Swipe/swipeHost.d.ts.map +1 -0
- package/dist/Swipe/swipeHost.js +122 -0
- package/dist/Swipe/swipeHost.stylex.d.ts +21 -0
- package/dist/Swipe/swipeHost.stylex.d.ts.map +1 -0
- package/dist/Swipe/swipeHost.stylex.js +27 -0
- package/dist/Swipe/useSwipeAction.d.ts +220 -0
- package/dist/Swipe/useSwipeAction.d.ts.map +1 -0
- package/dist/Swipe/useSwipeAction.js +1122 -0
- package/dist/Table/TableCell.d.ts.map +1 -1
- package/dist/Table/TableCell.js +2 -2
- package/dist/Table/TableHeaderCell.d.ts.map +1 -1
- package/dist/Table/TableHeaderCell.js +25 -3
- package/dist/Table/plugins/selection/useTableSelection.d.ts.map +1 -1
- package/dist/Table/plugins/selection/useTableSelection.js +20 -2
- package/dist/Table/tableContextMenu.d.ts +6 -0
- package/dist/Table/tableContextMenu.d.ts.map +1 -1
- package/dist/Table/tableContextMenu.js +10 -1
- package/dist/Toast/Toast.d.ts.map +1 -1
- package/dist/Toast/Toast.js +10 -5
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +6 -1
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +1 -1
- package/dist/TopNav/TopNav.d.ts.map +1 -1
- package/dist/TopNav/TopNav.js +6 -1
- package/dist/astryx.css +33 -18
- package/dist/dragToSnapPoints/compositorSettle.d.ts +38 -0
- package/dist/dragToSnapPoints/compositorSettle.d.ts.map +1 -0
- package/dist/dragToSnapPoints/compositorSettle.js +140 -0
- package/dist/dragToSnapPoints/createDragToSnapPoints.d.ts +29 -5
- package/dist/dragToSnapPoints/createDragToSnapPoints.d.ts.map +1 -1
- package/dist/dragToSnapPoints/createDragToSnapPoints.js +123 -7
- package/dist/hooks/useHotkeys.d.ts +1 -1
- package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/en.generated.js +2 -0
- package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pseudo.generated.js +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/motion/themeTiming.d.ts +11 -4
- package/dist/motion/themeTiming.d.ts.map +1 -1
- package/dist/motion/themeTiming.js +14 -4
- package/dist/motion/uikit/swipeActions.d.ts +148 -0
- package/dist/motion/uikit/swipeActions.d.ts.map +1 -0
- package/dist/motion/uikit/swipeActions.js +150 -0
- package/dist/privateAttributes/layerRoot.stylex.d.ts +2 -0
- package/dist/privateAttributes/layerRoot.stylex.d.ts.map +1 -1
- package/dist/privateAttributes/layerRoot.stylex.js +10 -3
- package/dist/privateAttributes/pressHeld.stylex.d.ts +5 -0
- package/dist/privateAttributes/pressHeld.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/pressHeld.stylex.js +31 -0
- package/dist/reset.font.a11y.chromium.spec.d.ts.map +1 -0
- package/dist/theme/defineTheme.d.ts +18 -1
- package/dist/theme/defineTheme.d.ts.map +1 -1
- package/dist/theme/defineTheme.js +17 -0
- package/dist/theme/generateThemeRules.d.ts.map +1 -1
- package/dist/theme/generateThemeRules.js +188 -83
- package/dist/theme/index.d.ts +1 -1
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/mergeComponents.d.ts +13 -5
- package/dist/theme/mergeComponents.d.ts.map +1 -1
- package/dist/theme/mergeComponents.js +74 -6
- package/dist/theme/resolveThemeValues.js +2 -2
- package/dist/theme/themeAdaptations.d.ts.map +1 -1
- package/dist/theme/themeAdaptations.js +4 -1
- package/dist/utils/pressFeedback.d.ts.map +1 -1
- package/dist/utils/pressFeedback.js +4 -1
- package/locales/en.json +8 -0
- package/locales/pseudo.json +6 -0
- package/package.json +10 -5
- package/src/AlertDialog/AlertDialog.doc.mjs +3 -3
- package/src/AlertDialog/AlertDialog.tsx +49 -11
- package/src/AlertDialog/useAlertMotion.ts +313 -0
- package/src/Button/Button.tsx +16 -5
- package/src/Chat/useChatDictation.doc.mjs +246 -0
- package/src/CheckboxInput/CheckboxInput.tsx +5 -1
- package/src/ComplexSelector/ComplexSelector.tsx +20 -8
- package/src/ContextMenu/ContextMenu.tsx +22 -12
- package/src/DropdownMenu/menuItemRoles.ts +9 -6
- package/src/Icon/Icon.tsx +4 -4
- package/src/Icon/globalIconRegistry.tsx +27 -15
- package/src/Icon/useIcon.ts +5 -5
- package/src/Item/Item.doc.mjs +8 -2
- package/src/Item/Item.tsx +143 -158
- package/src/Layer/inputHold.ts +95 -24
- package/src/Lightbox/Lightbox.tsx +200 -11
- package/src/Link/Link.tsx +14 -6
- package/src/List/ListItem.doc.mjs +21 -6
- package/src/List/ListItem.tsx +16 -7
- package/src/MetadataList/MetadataListItem.doc.mjs +36 -1
- package/src/MetadataList/MetadataListItem.tsx +7 -2
- package/src/MobileNav/MobileNav.tsx +45 -28
- package/src/MultiSelector/MultiSelector.tsx +28 -11
- package/src/Pagination/Pagination.doc.mjs +39 -3
- package/src/Pagination/Pagination.tsx +122 -55
- package/src/Popover/popoverSurfaceMotion.ts +4 -13
- package/src/Popover/usePopover.tsx +7 -1
- package/src/Selector/Selector.tsx +21 -9
- package/src/Slider/Slider.tsx +26 -3
- package/src/Swipe/SwipeActionsLayer.tsx +438 -0
- package/src/Swipe/createSwipe.doc.mjs +118 -0
- package/src/Swipe/createSwipe.ts +112 -0
- package/src/Swipe/index.ts +6 -0
- package/src/Swipe/swipeHost.stylex.ts +27 -0
- package/src/Swipe/swipeHost.ts +255 -0
- package/src/Swipe/useSwipeAction.ts +1414 -0
- package/src/Table/Table.doc.mjs +1 -1
- package/src/Table/TableCell.tsx +5 -4
- package/src/Table/TableHeaderCell.tsx +31 -3
- package/src/Table/plugins/selection/useTableSelection.tsx +18 -2
- package/src/Table/tableContextMenu.tsx +15 -1
- package/src/Toast/Toast.tsx +28 -5
- package/src/Tokenizer/Tokenizer.tsx +18 -5
- package/src/Tooltip/useTooltip.tsx +2 -3
- package/src/TopNav/TopNav.tsx +17 -1
- package/src/dragToSnapPoints/compositorSettle.ts +175 -0
- package/src/dragToSnapPoints/createDragToSnapPoints.ts +146 -11
- package/src/hooks/useHotkeys.doc.mjs +4 -4
- package/src/hooks/useHotkeys.ts +1 -1
- package/src/i18n/generated-locales/en.generated.ts +2 -0
- package/src/i18n/generated-locales/pseudo.generated.ts +2 -0
- package/src/index.ts +1 -0
- package/src/motion/MEASUREMENTS.md +16 -0
- package/src/motion/README.md +1 -0
- package/src/motion/themeTiming.ts +20 -4
- package/src/motion/uikit/swipeActions.ts +142 -0
- package/src/privateAttributes/layerRoot.stylex.ts +10 -3
- package/src/privateAttributes/pressHeld.stylex.ts +31 -0
- package/src/reset.css +7 -0
- package/src/theme/defineTheme.ts +22 -1
- package/src/theme/generateThemeRules.ts +274 -124
- package/src/theme/index.ts +1 -0
- package/src/theme/mergeComponents.ts +86 -10
- package/src/theme/resolveThemeValues.ts +2 -2
- package/src/theme/syntax/useSyntaxTheme.doc.mjs +95 -0
- package/src/theme/themeAdaptations.ts +3 -1
- package/src/utils/pressFeedback.ts +8 -1
- package/dist/Item/ItemSwipeLayer.d.ts +0 -51
- package/dist/Item/ItemSwipeLayer.d.ts.map +0 -1
- package/dist/Item/ItemSwipeLayer.js +0 -282
- package/dist/Item/useSwipeAction.d.ts +0 -77
- package/dist/Item/useSwipeAction.d.ts.map +0 -1
- package/dist/Item/useSwipeAction.js +0 -551
- package/src/Item/ItemSwipeLayer.tsx +0 -400
- package/src/Item/useSwipeAction.ts +0 -752
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* @file AlertDialog.tsx
|
|
3
3
|
* @input Uses React, StyleX, Dialog, Layout, Heading, Text, Button, the
|
|
4
4
|
* action-group tracking (hooks/useActionGroupTracking), the press-group
|
|
5
|
-
* context (hooks/pressGroupContext)
|
|
6
|
-
* (hooks/useGroupPressTracking)
|
|
5
|
+
* context (hooks/pressGroupContext), the group pointers
|
|
6
|
+
* (hooks/useGroupPressTracking) and the touch motion (useAlertMotion)
|
|
7
7
|
* @output Exports AlertDialog component, AlertDialogProps type
|
|
8
8
|
* @position Core implementation; consumed by index.ts, tested by AlertDialog.test.tsx
|
|
9
9
|
*
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
* - /packages/core/src/AlertDialog/AlertDialog.test.tsx (tests for new/changed behavior)
|
|
13
13
|
* - /packages/core/src/AlertDialog/index.ts (exports if types change)
|
|
14
14
|
* - /packages/core/src/AlertDialog/__tests__/AlertDialog.interaction.browser.spec.ts (touch tracking)
|
|
15
|
+
* - /packages/core/src/AlertDialog/__tests__/AlertDialog.motion.interaction.browser.spec.ts (touch motion)
|
|
15
16
|
* - /apps/storybook/stories/AlertDialog.stories.tsx (storybook stories)
|
|
16
17
|
* - /packages/cli/assets/templates/blocks/components/AlertDialog/ (showcase blocks)
|
|
17
18
|
*/
|
|
@@ -70,7 +71,9 @@ export interface AlertDialogProps extends BaseProps<HTMLDialogElement> {
|
|
|
70
71
|
onAction: () => unknown;
|
|
71
72
|
/**
|
|
72
73
|
* The width of the dialog.
|
|
73
|
-
* Numbers are treated as pixels, strings are used as-is.
|
|
74
|
+
* Numbers are treated as pixels, strings are used as-is. On a phone (a
|
|
75
|
+
* compact window under a coarse primary pointer) the default is iOS's alert
|
|
76
|
+
* width, 320, in every theme. A width set here wins there too.
|
|
74
77
|
* @default 400
|
|
75
78
|
*/
|
|
76
79
|
width?: number | string;
|
|
@@ -101,7 +104,7 @@ export interface AlertDialogProps extends BaseProps<HTMLDialogElement> {
|
|
|
101
104
|
* />
|
|
102
105
|
* ```
|
|
103
106
|
*/
|
|
104
|
-
export declare function AlertDialog({ ref, isOpen, isInline, onOpenChange, title, description, cancelLabel: cancelLabelFromProps, actionLabel, actionVariant, isActionLoading, onAction, width, xstyle, className, style, 'data-testid': testId, ...rest }: AlertDialogProps): React.JSX.Element;
|
|
107
|
+
export declare function AlertDialog({ ref, isOpen, isInline, onOpenChange, title, description, cancelLabel: cancelLabelFromProps, actionLabel, actionVariant, isActionLoading, onAction, width: widthProp, xstyle, className, style, 'data-testid': testId, ...rest }: AlertDialogProps): React.JSX.Element;
|
|
105
108
|
export declare namespace AlertDialog {
|
|
106
109
|
var displayName: string;
|
|
107
110
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlertDialog.d.ts","sourceRoot":"","sources":["../../src/AlertDialog/AlertDialog.tsx"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"AlertDialog.d.ts","sourceRoot":"","sources":["../../src/AlertDialog/AlertDialog.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;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6,8 +6,8 @@
|
|
|
6
6
|
* @file AlertDialog.tsx
|
|
7
7
|
* @input Uses React, StyleX, Dialog, Layout, Heading, Text, Button, the
|
|
8
8
|
* action-group tracking (hooks/useActionGroupTracking), the press-group
|
|
9
|
-
* context (hooks/pressGroupContext)
|
|
10
|
-
* (hooks/useGroupPressTracking)
|
|
9
|
+
* context (hooks/pressGroupContext), the group pointers
|
|
10
|
+
* (hooks/useGroupPressTracking) and the touch motion (useAlertMotion)
|
|
11
11
|
* @output Exports AlertDialog component, AlertDialogProps type
|
|
12
12
|
* @position Core implementation; consumed by index.ts, tested by AlertDialog.test.tsx
|
|
13
13
|
*
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
* - /packages/core/src/AlertDialog/AlertDialog.test.tsx (tests for new/changed behavior)
|
|
17
17
|
* - /packages/core/src/AlertDialog/index.ts (exports if types change)
|
|
18
18
|
* - /packages/core/src/AlertDialog/__tests__/AlertDialog.interaction.browser.spec.ts (touch tracking)
|
|
19
|
+
* - /packages/core/src/AlertDialog/__tests__/AlertDialog.motion.interaction.browser.spec.ts (touch motion)
|
|
19
20
|
* - /apps/storybook/stories/AlertDialog.stories.tsx (storybook stories)
|
|
20
21
|
* - /packages/cli/assets/templates/blocks/components/AlertDialog/ (showcase blocks)
|
|
21
22
|
*/
|
|
@@ -32,6 +33,7 @@ import { Button } from "../Button/Button.js";
|
|
|
32
33
|
import { mergeProps } from "../utils/mergeProps.js";
|
|
33
34
|
import { themeProps } from "../utils/themeProps.js";
|
|
34
35
|
import { useMediaQuery } from "../hooks/useMediaQuery.js";
|
|
36
|
+
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
35
37
|
import { useTouchPresentation } from "../utils/touchPresentation.js";
|
|
36
38
|
import { registerEnglishFallback, useComponentTranslator } from "../i18n/useComponentTranslator.js";
|
|
37
39
|
import english from "../i18n/generated-english/AlertDialog/AlertDialog.generated.js";
|
|
@@ -39,14 +41,23 @@ import { useActionGroupTracking } from "../hooks/useActionGroupTracking.js";
|
|
|
39
41
|
import { PressGroupContext } from "../hooks/pressGroupContext.js";
|
|
40
42
|
import { GROUP_PRESS_POINTERS } from "../hooks/useGroupPressTracking.js";
|
|
41
43
|
import { alertController } from "../motion/uikit/alert.js";
|
|
44
|
+
import { useAlertMotion } from "./useAlertMotion.js";
|
|
42
45
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
43
46
|
registerEnglishFallback(english);
|
|
44
47
|
const SMALL_SCREEN_QUERY = '(max-width: 640px)';
|
|
48
|
+
|
|
49
|
+
/** iOS's alert is 320 px wide on a phone, in every theme. */
|
|
50
|
+
const PHONE_WIDTH = 320;
|
|
45
51
|
const styles = {
|
|
46
52
|
trackingRow: {
|
|
47
53
|
kFalU9: "x1j4r261",
|
|
48
54
|
$$css: true
|
|
49
55
|
},
|
|
56
|
+
touchMotion: {
|
|
57
|
+
kKVMdj: "x1a5igra",
|
|
58
|
+
kAVvgx: "x8ifjc1",
|
|
59
|
+
$$css: true
|
|
60
|
+
},
|
|
50
61
|
action: {
|
|
51
62
|
ks0D6T: "x193iq5w",
|
|
52
63
|
k7Eaqz: "xeuugli",
|
|
@@ -95,7 +106,7 @@ export function AlertDialog({
|
|
|
95
106
|
actionVariant = 'destructive',
|
|
96
107
|
isActionLoading,
|
|
97
108
|
onAction,
|
|
98
|
-
width
|
|
109
|
+
width: widthProp,
|
|
99
110
|
xstyle,
|
|
100
111
|
className,
|
|
101
112
|
style,
|
|
@@ -110,6 +121,29 @@ export function AlertDialog({
|
|
|
110
121
|
// keep narrow visual, DOM, and tab order aligned for its destructive/cancel
|
|
111
122
|
// semantics without coupling action order to pointer or hover capability.
|
|
112
123
|
const isSmallScreen = useMediaQuery(SMALL_SCREEN_QUERY);
|
|
124
|
+
|
|
125
|
+
// Only under the touch presentation does a press slide across the
|
|
126
|
+
// actions, and does the alert scale in and fade out. A desktop press stays
|
|
127
|
+
// the native button's, and a mouse keeps the theme's entrance.
|
|
128
|
+
const {
|
|
129
|
+
isTouch,
|
|
130
|
+
isCompact
|
|
131
|
+
} = useTouchPresentation();
|
|
132
|
+
const width = widthProp ?? (isTouch && isCompact ? PHONE_WIDTH : 400);
|
|
133
|
+
const motion = useAlertMotion({
|
|
134
|
+
isOpen,
|
|
135
|
+
isEnabled: isTouch && isInline !== true
|
|
136
|
+
});
|
|
137
|
+
// While the alert fades out, its content is inert. The dialog's own Escape
|
|
138
|
+
// still fires (inert content does not stop its cancel event), so it is
|
|
139
|
+
// ignored here until the alert is hidden.
|
|
140
|
+
const isLeaving = motion.isDriving && motion.isPresented && !isOpen;
|
|
141
|
+
const handleOpenChange = useCallback(next => {
|
|
142
|
+
if (!isLeaving) {
|
|
143
|
+
onOpenChange(next);
|
|
144
|
+
}
|
|
145
|
+
}, [isLeaving, onOpenChange]);
|
|
146
|
+
const mergedRef = useMergedRefs(ref, motion.ref);
|
|
113
147
|
const handleCancel = useCallback(() => {
|
|
114
148
|
onOpenChange(false);
|
|
115
149
|
}, [onOpenChange]);
|
|
@@ -117,11 +151,6 @@ export function AlertDialog({
|
|
|
117
151
|
// Through the group's context, each action's Button writes the press-group
|
|
118
152
|
// marker from its first render. So the tracker is its only painter.
|
|
119
153
|
const actionsRef = useRef(null);
|
|
120
|
-
// Only under the touch presentation does a press slide across the
|
|
121
|
-
// actions. A desktop press stays the native button's.
|
|
122
|
-
const {
|
|
123
|
-
isTouch
|
|
124
|
-
} = useTouchPresentation();
|
|
125
154
|
const isTracking = isOpen && isInline !== true && isTouch;
|
|
126
155
|
useActionGroupTracking(actionsRef, {
|
|
127
156
|
// The actions row holds only the two buttons.
|
|
@@ -154,10 +183,10 @@ export function AlertDialog({
|
|
|
154
183
|
}, "action");
|
|
155
184
|
return /*#__PURE__*/_jsx(Dialog, {
|
|
156
185
|
...rest,
|
|
157
|
-
ref:
|
|
158
|
-
isOpen:
|
|
186
|
+
ref: mergedRef,
|
|
187
|
+
isOpen: motion.isPresented,
|
|
159
188
|
isInline: isInline,
|
|
160
|
-
onOpenChange:
|
|
189
|
+
onOpenChange: handleOpenChange,
|
|
161
190
|
width: width,
|
|
162
191
|
purpose: "form"
|
|
163
192
|
// `alertdialog` is a modal role: it promises an interruption the user
|
|
@@ -173,7 +202,7 @@ export function AlertDialog({
|
|
|
173
202
|
className,
|
|
174
203
|
style
|
|
175
204
|
}),
|
|
176
|
-
xstyle: xstyle,
|
|
205
|
+
xstyle: [motion.isDriving && styles.touchMotion, xstyle],
|
|
177
206
|
"data-testid": testId,
|
|
178
207
|
children: /*#__PURE__*/_jsx(Layout, {
|
|
179
208
|
content: /*#__PURE__*/_jsxs(LayoutContent, {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface AlertMotionOptions {
|
|
2
|
+
/** The caller's open state. */
|
|
3
|
+
isOpen: boolean;
|
|
4
|
+
/** Run the touch motion (under a finger: a coarse primary pointer). */
|
|
5
|
+
isEnabled: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface AlertMotion {
|
|
8
|
+
/** Whether the Dialog is open: true while the alert is shown or leaving. */
|
|
9
|
+
readonly isPresented: boolean;
|
|
10
|
+
/** True while the motion drives the dialog (its theme entrance is off). */
|
|
11
|
+
readonly isDriving: boolean;
|
|
12
|
+
/** Callback ref for the dialog element. */
|
|
13
|
+
readonly ref: (element: HTMLElement | null) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare function useAlertMotion({ isOpen, isEnabled, }: AlertMotionOptions): AlertMotion;
|
|
16
|
+
//# sourceMappingURL=useAlertMotion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAlertMotion.d.ts","sourceRoot":"","sources":["../../src/AlertDialog/useAlertMotion.ts"],"names":[],"mappings":"AA+GA,MAAM,WAAW,kBAAkB;IACjC,+BAA+B;IAC/B,MAAM,EAAE,OAAO,CAAC;IAChB,uEAAuE;IACvE,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,4EAA4E;IAC5E,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,2EAA2E;IAC3E,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,2CAA2C;IAC3C,QAAQ,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC;CACrD;AAED,wBAAgB,cAAc,CAAC,EAC7B,MAAM,EACN,SAAS,GACV,EAAE,kBAAkB,GAAG,WAAW,CAsLlC"}
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @file useAlertMotion.ts
|
|
7
|
+
* @input Whether the alert is open, whether it runs the touch motion, the
|
|
8
|
+
* motion animator, the theme's timing tokens and the layer runtime's input
|
|
9
|
+
* hold (Layer/inputHold)
|
|
10
|
+
* @output Exports useAlertMotion and AlertMotion: when the Dialog is presented
|
|
11
|
+
* (it stays open while the alert leaves), and the callback ref that puts
|
|
12
|
+
* the animators and the input hold on the dialog
|
|
13
|
+
* @position Internal hook of AlertDialog: the touch presentation's motion
|
|
14
|
+
*
|
|
15
|
+
* SYNC: When modified, update useAlertMotion.test.tsx and
|
|
16
|
+
* __tests__/AlertDialog.motion.interaction.browser.spec.ts
|
|
17
|
+
*/
|
|
18
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
19
|
+
import { useCommittedRef } from "../hooks/useCommittedRef.js";
|
|
20
|
+
import { useIsomorphicLayoutEffect } from "../hooks/useIsomorphicLayoutEffect.js";
|
|
21
|
+
import { createMotionEngine } from "../motion/animator.js";
|
|
22
|
+
import { mapProgress, mapRange } from "../motion/progress.js";
|
|
23
|
+
import { readThemeTimingOrInstant } from "../motion/themeTiming.js";
|
|
24
|
+
import { holdInput } from "../Layer/inputHold.js";
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The presentation plays the theme's entrance easing over its duration step
|
|
28
|
+
* for UIKit's measured 404 ms alert present. A tap opens an alert, and a tap
|
|
29
|
+
* has no velocity, so no spring plays.
|
|
30
|
+
*/
|
|
31
|
+
const ALERT_ENTRANCE_TOKENS = {
|
|
32
|
+
duration: '--duration-medium-max',
|
|
33
|
+
easing: '--ease-entrance'
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/** The dismissal plays the exit duration and easing that every overlay shares. */
|
|
37
|
+
const ALERT_EXIT_TOKENS = {
|
|
38
|
+
duration: '--duration-exit',
|
|
39
|
+
easing: '--ease-exit'
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/** iOS's alert starts at 1.2 times its size. */
|
|
43
|
+
const PRESENT_SCALE_FROM = 1.2;
|
|
44
|
+
|
|
45
|
+
/** A dialog that misses its exit's end still closes this long after it. */
|
|
46
|
+
const EXIT_BACKSTOP_MS = 100;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* The 1.2 start, never wider than the viewport: a wide alert would otherwise
|
|
50
|
+
* start past the screen's edges. One layout read, as the alert opens.
|
|
51
|
+
*/
|
|
52
|
+
function presentScaleFrom(element) {
|
|
53
|
+
const width = element?.offsetWidth ?? 0;
|
|
54
|
+
const viewport = element?.ownerDocument.documentElement.clientWidth ?? 0;
|
|
55
|
+
return width > 0 && viewport > 0 ? Math.max(1, Math.min(PRESENT_SCALE_FROM, viewport / width)) : PRESENT_SCALE_FROM;
|
|
56
|
+
}
|
|
57
|
+
function between(progress, from, to) {
|
|
58
|
+
// Unclamped, so an easing that overshoots carries the value with it.
|
|
59
|
+
return mapProgress(progress, mapRange([0, 1], [from, to], {
|
|
60
|
+
clamp: false
|
|
61
|
+
}));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Fades the alert and its dimming to `opacity` from the values on screen, on
|
|
66
|
+
* `progress`. The scale keeps its own curve if it still moves.
|
|
67
|
+
*/
|
|
68
|
+
function fadeFromHere(panel, backdrop, opacity, progress) {
|
|
69
|
+
backdrop.play({
|
|
70
|
+
opacity: between(progress, backdrop.get('opacity'), opacity)
|
|
71
|
+
});
|
|
72
|
+
return panel.play({
|
|
73
|
+
opacity: between(progress, panel.get('opacity'), opacity)
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Presents the alert and its dimming from their start values on one curve.
|
|
79
|
+
* From rest and with no start time, the browser starts both at the frame that
|
|
80
|
+
* commits them, the frame that first shows the dialog. Under reduced motion
|
|
81
|
+
* the animator plays its own opacity-only cross-fade instead.
|
|
82
|
+
*/
|
|
83
|
+
function present(panel, backdrop, scaleFrom, progress) {
|
|
84
|
+
const handle = panel.play({
|
|
85
|
+
opacity: between(progress, 0, 1),
|
|
86
|
+
scale: between(progress, scaleFrom, 1)
|
|
87
|
+
});
|
|
88
|
+
backdrop.play({
|
|
89
|
+
opacity: between(progress, 0, 1)
|
|
90
|
+
});
|
|
91
|
+
return handle;
|
|
92
|
+
}
|
|
93
|
+
export function useAlertMotion({
|
|
94
|
+
isOpen,
|
|
95
|
+
isEnabled
|
|
96
|
+
}) {
|
|
97
|
+
// The alert stays presented while it leaves. This is set during render, so
|
|
98
|
+
// the Dialog never commits a close before the exit ends.
|
|
99
|
+
const [isLeaving, setIsLeaving] = useState(false);
|
|
100
|
+
const [lastIsOpen, setLastIsOpen] = useState(isOpen);
|
|
101
|
+
if (lastIsOpen !== isOpen) {
|
|
102
|
+
setLastIsOpen(isOpen);
|
|
103
|
+
setIsLeaving(!isOpen && isEnabled);
|
|
104
|
+
}
|
|
105
|
+
const isPresented = isOpen || isLeaving;
|
|
106
|
+
const [animators] = useState(() => ({
|
|
107
|
+
panel: createMotionEngine(null),
|
|
108
|
+
backdrop: createMotionEngine(null, {
|
|
109
|
+
pseudoElement: '::backdrop',
|
|
110
|
+
base: {
|
|
111
|
+
opacity: 1
|
|
112
|
+
}
|
|
113
|
+
})
|
|
114
|
+
}));
|
|
115
|
+
// Whether the motion drives the dialog, as of the last commit. The callback
|
|
116
|
+
// ref reads it when React attaches the dialog.
|
|
117
|
+
const isEnabledRef = useCommittedRef(isEnabled);
|
|
118
|
+
|
|
119
|
+
// The animators hold the dialog only while the motion drives it, so a mouse
|
|
120
|
+
// presentation keeps its own styles. The callback is stable, so a caller's
|
|
121
|
+
// changing ref does not attach them again on every render.
|
|
122
|
+
const elementRef = useRef(null);
|
|
123
|
+
const ref = useCallback(node => {
|
|
124
|
+
elementRef.current = node;
|
|
125
|
+
const target = isEnabledRef.current ? node : null;
|
|
126
|
+
animators.panel.attach(target);
|
|
127
|
+
animators.backdrop.attach(target);
|
|
128
|
+
}, [animators, isEnabledRef]);
|
|
129
|
+
// Effect: syncs the motion animators' element with the pointer that drives
|
|
130
|
+
// the alert. A finger attaches them, and a mouse gets the dialog back at rest.
|
|
131
|
+
useIsomorphicLayoutEffect(() => {
|
|
132
|
+
const {
|
|
133
|
+
panel,
|
|
134
|
+
backdrop
|
|
135
|
+
} = animators;
|
|
136
|
+
if (isEnabled) {
|
|
137
|
+
panel.attach(elementRef.current);
|
|
138
|
+
backdrop.attach(elementRef.current);
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
// A mouse took over from a finger: the theme's styles show again.
|
|
142
|
+
if (panel.element != null) {
|
|
143
|
+
panel.set({
|
|
144
|
+
opacity: 1,
|
|
145
|
+
scale: 1
|
|
146
|
+
});
|
|
147
|
+
backdrop.set({
|
|
148
|
+
opacity: 1
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
panel.attach(null);
|
|
152
|
+
backdrop.attach(null);
|
|
153
|
+
}, [animators, isEnabled]);
|
|
154
|
+
|
|
155
|
+
// Hidden even when mounted open, so a first render that is open presents
|
|
156
|
+
// like any other opening.
|
|
157
|
+
const statusRef = useRef('hidden');
|
|
158
|
+
// Only the exit in flight may hide the dialog when it ends.
|
|
159
|
+
const exitRef = useRef(null);
|
|
160
|
+
const exitMsRef = useRef(0);
|
|
161
|
+
const releaseHoldRef = useRef(null);
|
|
162
|
+
// The action that the dismissal's hold took focus from. A reopen during the
|
|
163
|
+
// exit gives focus back to it.
|
|
164
|
+
const blurredByDismissalRef = useRef(null);
|
|
165
|
+
// Effect: releases the input hold on the dialog at unmount, so the alert
|
|
166
|
+
// goes at once. The alert then counts as hidden again. StrictMode runs
|
|
167
|
+
// every cleanup once and then every effect, and the replay must present it
|
|
168
|
+
// again and place its hold.
|
|
169
|
+
useEffect(() => () => {
|
|
170
|
+
releaseHoldRef.current?.();
|
|
171
|
+
releaseHoldRef.current = null;
|
|
172
|
+
statusRef.current = 'hidden';
|
|
173
|
+
exitRef.current = null;
|
|
174
|
+
blurredByDismissalRef.current = null;
|
|
175
|
+
}, []);
|
|
176
|
+
|
|
177
|
+
// Effect: syncs the dialog's animations and its input hold with the alert's
|
|
178
|
+
// state: hidden, open or leaving.
|
|
179
|
+
useEffect(() => {
|
|
180
|
+
const was = statusRef.current;
|
|
181
|
+
const now = !isPresented ? 'hidden' : isOpen ? 'open' : 'leaving';
|
|
182
|
+
statusRef.current = now;
|
|
183
|
+
if (!isEnabled || was === now) {
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
const {
|
|
187
|
+
panel,
|
|
188
|
+
backdrop
|
|
189
|
+
} = animators;
|
|
190
|
+
const element = elementRef.current;
|
|
191
|
+
// One hold at a time on the alert: a new transition replaces the last.
|
|
192
|
+
const hold = (until, scope) => {
|
|
193
|
+
releaseHoldRef.current?.();
|
|
194
|
+
releaseHoldRef.current = element == null ? null : holdInput(element, {
|
|
195
|
+
until,
|
|
196
|
+
scope
|
|
197
|
+
});
|
|
198
|
+
};
|
|
199
|
+
if (now === 'open' && was === 'hidden') {
|
|
200
|
+
// The Dialog opened its modal in this flush, before this effect, and
|
|
201
|
+
// nothing has painted it yet. A finger's or a pen's input waits until
|
|
202
|
+
// the alert has entered. Keys and assistive technology stay live.
|
|
203
|
+
const scaleFrom = presentScaleFrom(element);
|
|
204
|
+
panel.set({
|
|
205
|
+
opacity: 0,
|
|
206
|
+
scale: scaleFrom
|
|
207
|
+
});
|
|
208
|
+
backdrop.set({
|
|
209
|
+
opacity: 0
|
|
210
|
+
});
|
|
211
|
+
const handle = present(panel, backdrop, scaleFrom, readThemeTimingOrInstant(element, ALERT_ENTRANCE_TOKENS));
|
|
212
|
+
hold(handle.finished, 'viewport');
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
if (now === 'open' && was === 'leaving') {
|
|
216
|
+
// Reopened during the exit: it fades back from where it is.
|
|
217
|
+
exitRef.current = null;
|
|
218
|
+
const handle = fadeFromHere(panel, backdrop, 1, readThemeTimingOrInstant(element, ALERT_ENTRANCE_TOKENS));
|
|
219
|
+
hold(handle.finished, 'viewport');
|
|
220
|
+
// The dismissal's hold is released and the content is live again. The
|
|
221
|
+
// action it took focus from gets focus back, unless focus went
|
|
222
|
+
// somewhere else meanwhile.
|
|
223
|
+
const blurred = blurredByDismissalRef.current;
|
|
224
|
+
blurredByDismissalRef.current = null;
|
|
225
|
+
const doc = element?.ownerDocument;
|
|
226
|
+
if (blurred?.isConnected === true && doc != null && (doc.activeElement == null || doc.activeElement === doc.body)) {
|
|
227
|
+
blurred.focus({
|
|
228
|
+
preventScroll: true
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
if (now === 'leaving') {
|
|
234
|
+
// During the dismissal no input reaches the alert: its content is inert
|
|
235
|
+
// and the hold's shield catches every touch.
|
|
236
|
+
const progress = readThemeTimingOrInstant(element, ALERT_EXIT_TOKENS);
|
|
237
|
+
exitMsRef.current = progress.duration * 1000;
|
|
238
|
+
const handle = fadeFromHere(panel, backdrop, 0, progress);
|
|
239
|
+
const focused = element?.ownerDocument.activeElement;
|
|
240
|
+
blurredByDismissalRef.current = focused instanceof HTMLElement && focused !== element && element?.contains(focused) === true ? focused : null;
|
|
241
|
+
hold(handle.finished, 'layer');
|
|
242
|
+
exitRef.current = handle;
|
|
243
|
+
void handle.finished.then(isDone => {
|
|
244
|
+
if (isDone && exitRef.current === handle) {
|
|
245
|
+
exitRef.current = null;
|
|
246
|
+
setIsLeaving(false);
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
// Hidden: the exit ended and the Dialog closed its modal.
|
|
252
|
+
exitRef.current = null;
|
|
253
|
+
blurredByDismissalRef.current = null;
|
|
254
|
+
releaseHoldRef.current?.();
|
|
255
|
+
releaseHoldRef.current = null;
|
|
256
|
+
}, [animators, isEnabled, isOpen, isPresented]);
|
|
257
|
+
|
|
258
|
+
// Effect: a timer that hides the dialog once the exit has had its time. It
|
|
259
|
+
// covers an exit whose end is never reported (animations off, a detached
|
|
260
|
+
// element). An unmount during the exit removes the dialog at once, and the
|
|
261
|
+
// ref detaches the animators.
|
|
262
|
+
useEffect(() => {
|
|
263
|
+
if (!isLeaving) {
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
const backstop = setTimeout(() => {
|
|
267
|
+
exitRef.current = null;
|
|
268
|
+
setIsLeaving(false);
|
|
269
|
+
}, exitMsRef.current + EXIT_BACKSTOP_MS);
|
|
270
|
+
return () => clearTimeout(backstop);
|
|
271
|
+
}, [isLeaving]);
|
|
272
|
+
return {
|
|
273
|
+
isPresented,
|
|
274
|
+
isDriving: isEnabled,
|
|
275
|
+
ref
|
|
276
|
+
};
|
|
277
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/Button/Button.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,SAAS,EAAE,SAAS,EAAC,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AA0C3C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,EACR,UAAU,EACV,OAAO,EACP,IAAI,EACJ,EAAE,EACF,MAAM,EACN,GAAG,EACH,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,KAAK,EACT,EAAE,WAAW,GAAG,SAAS,CAiXzB;yBA1Ye,MAAM"}
|
package/dist/Button/Button.js
CHANGED
|
@@ -58,6 +58,13 @@ registerEnglishFallback(english);
|
|
|
58
58
|
*/
|
|
59
59
|
const PRESSED_ON = '[data-astryx-press="on"]';
|
|
60
60
|
|
|
61
|
+
/**
|
|
62
|
+
* The button's own popup is open. A press does not scale it then, so the
|
|
63
|
+
* popup anchors to the button at rest. A disclosure button, with no popup,
|
|
64
|
+
* keeps its press.
|
|
65
|
+
*/
|
|
66
|
+
const POPUP_OPEN = '[aria-expanded="true"][aria-haspopup]:not([aria-haspopup="false"])';
|
|
67
|
+
|
|
61
68
|
/** `aria-haspopup` values of a trigger that keeps its own press and opening. */
|
|
62
69
|
const MENU_POPUPS = new Set(['true', 'menu', 'listbox']);
|
|
63
70
|
|
|
@@ -88,13 +95,13 @@ const styles = {
|
|
|
88
95
|
k7Eaqz: "xeuugli",
|
|
89
96
|
ks0D6T: "x193iq5w",
|
|
90
97
|
kkrTdU: "x1ypdohk x16khyan",
|
|
91
|
-
k1ekBW: "xrafxwg",
|
|
98
|
+
k1ekBW: "xrafxwg xrkqygm",
|
|
92
99
|
kIyJzY: "xuedmi6 x12w9bfk",
|
|
93
100
|
kAMwcw: "xlr8y92",
|
|
94
101
|
$$css: true
|
|
95
102
|
},
|
|
96
103
|
pressable: {
|
|
97
|
-
k3aq6I: "x3oybdh
|
|
104
|
+
k3aq6I: "x3oybdh x1u44piu x1pcrg6r xhr8rl2 x1ua7476 x11q126q x7208gc x6cxksl",
|
|
98
105
|
$$css: true
|
|
99
106
|
},
|
|
100
107
|
trackedOverlay: {
|
|
@@ -102,7 +109,7 @@ const styles = {
|
|
|
102
109
|
$$css: true
|
|
103
110
|
},
|
|
104
111
|
pressableTracked: {
|
|
105
|
-
k3aq6I: "x3oybdh
|
|
112
|
+
k3aq6I: "x3oybdh x11q126q x7208gc x6cxksl",
|
|
106
113
|
$$css: true
|
|
107
114
|
},
|
|
108
115
|
inactive: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxInput.d.ts","sourceRoot":"","sources":["../../src/CheckboxInput/CheckboxInput.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAOL,KAAK,WAAW,EAChB,KAAK,UAAU,EAGf,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAS3C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAG9C,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AACtC,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAwIhD,QAAA,MAAM,iBAAiB;;;;;;;;;EASrB,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,MAAM,OAAO,iBAAiB,CAAC;AAE/D,MAAM,WAAW,kBAAmB,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;IACrE,wDAAwD;IACxD,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAClC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IACxE;;OAEG;IACH,YAAY,CAAC,EAAE,CACb,OAAO,EAAE,OAAO,EACh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EACL,GAAG,EACH,kBAAkB,EAAE,mBAAmB,EACvC,GAAG,IAAI,EACR,EAAE,kBAAkB,+BA4SpB;yBAvUe,aAAa"}
|
|
@@ -368,8 +368,11 @@ export function CheckboxInput({
|
|
|
368
368
|
onFocus: onFocus,
|
|
369
369
|
onBlur: onBlur,
|
|
370
370
|
"aria-readonly": isReadOnly || undefined,
|
|
371
|
-
"aria-describedby": ariaDescribedBy
|
|
372
|
-
|
|
371
|
+
"aria-describedby": ariaDescribedBy
|
|
372
|
+
// Chromium reports an unchecked native-required checkbox invalid
|
|
373
|
+
// before any interaction; the invalid state follows status instead.
|
|
374
|
+
,
|
|
375
|
+
"aria-invalid": status?.type === 'error' ? true : isRequired ? false : undefined,
|
|
373
376
|
"aria-busy": isBusy || undefined,
|
|
374
377
|
...stylex.props(styles.input, rtlStyles.centerInline('-50%'), styles.inputCoarse, wrapperSizeStyles[size], isDisabled && styles.inputDisabled)
|
|
375
378
|
}), /*#__PURE__*/_jsx("span", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComplexSelector.d.ts","sourceRoot":"","sources":["../../src/ComplexSelector/ComplexSelector.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,EAQZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACzB,MAAM,qBAAqB,CAAC;AAO7B,OAAO,EAAuB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AAI5D,OAAO,KAAK,EAAC,cAAc,EAAE,cAAc,EAAC,MAAM,mBAAmB,CAAC;AAoBtE,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAG9C,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file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b,EAAE,oBAAoB,CAAC,KAAK,CAAC,qBAmd7B;yBA3fe,eAAe"}
|
|
@@ -49,6 +49,12 @@ registerEnglishFallback(english);
|
|
|
49
49
|
// The popup content's own block-size cap; the viewport cap is the layer
|
|
50
50
|
// runtime's.
|
|
51
51
|
const CONTENT_BLOCK_CAP = '480px';
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* The trigger's own list is open. A press does not scale the box then, so the
|
|
55
|
+
* list anchors to the box at rest.
|
|
56
|
+
*/
|
|
57
|
+
const LAYER_OPEN = ':has([aria-expanded="true"])';
|
|
52
58
|
const styles = {
|
|
53
59
|
statusTip: {
|
|
54
60
|
k1xSpc: "x3nfvp2",
|
|
@@ -114,8 +120,8 @@ const styles = {
|
|
|
114
120
|
kWkggS: "xjbqb8w",
|
|
115
121
|
kGVxlE: "x1gnnqk1 x1s17dad x15ysqaf",
|
|
116
122
|
k63SB2: "x1e4wzip",
|
|
117
|
-
k1ekBW: "xrafxwg",
|
|
118
|
-
k3aq6I: "x3oybdh
|
|
123
|
+
k1ekBW: "xrafxwg xhu4vej",
|
|
124
|
+
k3aq6I: "x3oybdh x1g2qjg4 x182m0z6 x5euuyh",
|
|
119
125
|
$$css: true
|
|
120
126
|
},
|
|
121
127
|
triggerSecondary: {
|
|
@@ -123,8 +129,8 @@ const styles = {
|
|
|
123
129
|
kWkggS: "x17x4s8c",
|
|
124
130
|
kGVxlE: "x1gnnqk1 x1s17dad x15ysqaf",
|
|
125
131
|
k63SB2: "x1e4wzip",
|
|
126
|
-
k1ekBW: "xrafxwg",
|
|
127
|
-
k3aq6I: "x3oybdh
|
|
132
|
+
k1ekBW: "xrafxwg xhu4vej",
|
|
133
|
+
k3aq6I: "x3oybdh x1g2qjg4 x182m0z6 x5euuyh",
|
|
128
134
|
$$css: true
|
|
129
135
|
},
|
|
130
136
|
triggerGhostDisabled: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextMenu.d.ts","sourceRoot":"","s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