@astryxdesign/core 0.7.7-canary.ae97fa8 → 0.7.7-canary.b377b21
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 +4 -1
- package/dist/AlertDialog/AlertDialog.d.ts.map +1 -1
- package/dist/AlertDialog/AlertDialog.js +36 -6
- package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetPanel.js +22 -3
- package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
- package/dist/BottomSheet/useSheetGestures.js +3 -1
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +17 -1
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +13 -2
- package/dist/ComplexSelector/ComplexSelector.d.ts +4 -1
- package/dist/ComplexSelector/ComplexSelector.d.ts.map +1 -1
- package/dist/ComplexSelector/ComplexSelector.js +14 -4
- package/dist/ContextMenu/ContextMenu.js +2 -2
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +7 -31
- package/dist/Field/Field.js +2 -2
- package/dist/HoverCard/HoverCard.d.ts +4 -3
- package/dist/HoverCard/HoverCard.d.ts.map +1 -1
- package/dist/HoverCard/useHoverCard.d.ts +5 -4
- package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
- package/dist/HoverCard/useHoverCard.js +17 -31
- package/dist/Icon/Icon.d.ts +5 -1
- package/dist/Icon/Icon.d.ts.map +1 -1
- package/dist/Icon/Icon.js +5 -2
- package/dist/Layer/usePressPin.d.ts +17 -5
- package/dist/Layer/usePressPin.d.ts.map +1 -1
- package/dist/Layer/usePressPin.js +62 -12
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +18 -0
- package/dist/PowerSearch/PowerSearch.d.ts +36 -3
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +433 -127
- package/dist/PowerSearch/PowerSearchBottomSheet.d.ts +100 -0
- package/dist/PowerSearch/PowerSearchBottomSheet.d.ts.map +1 -0
- package/dist/PowerSearch/PowerSearchBottomSheet.js +1913 -0
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts +32 -1
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchEditPopover.js +17 -6
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts +38 -3
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchValueEditor.js +170 -61
- package/dist/PowerSearch/formatFilterValue.d.ts +7 -0
- package/dist/PowerSearch/formatFilterValue.d.ts.map +1 -1
- package/dist/PowerSearch/formatFilterValue.js +11 -1
- package/dist/PowerSearch/formatTokenValue.d.ts +28 -0
- package/dist/PowerSearch/formatTokenValue.d.ts.map +1 -0
- package/dist/PowerSearch/formatTokenValue.js +160 -0
- package/dist/PowerSearch/powerSearchSheetUtils.d.ts +65 -0
- package/dist/PowerSearch/powerSearchSheetUtils.d.ts.map +1 -0
- package/dist/PowerSearch/powerSearchSheetUtils.js +168 -0
- package/dist/RadioList/RadioList.d.ts.map +1 -1
- package/dist/RadioList/RadioList.js +3 -2
- package/dist/RadioList/RadioListItem.d.ts +1 -1
- package/dist/RadioList/RadioListItem.d.ts.map +1 -1
- package/dist/RadioList/RadioListItem.js +5 -3
- package/dist/Resizable/ResizeHandle.d.ts +2 -1
- package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
- package/dist/Resizable/ResizeHandle.js +99 -77
- 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 +60 -58
- package/dist/Switch/useSwitchTouch.js +4 -4
- package/dist/Table/BaseTable.d.ts.map +1 -1
- package/dist/Table/BaseTable.js +29 -8
- package/dist/TextInput/TextInput.d.ts +2 -2
- package/dist/TextInput/TextInput.d.ts.map +1 -1
- package/dist/TextInput/TextInput.js +10 -7
- package/dist/Toast/Toast.d.ts +11 -1
- package/dist/Toast/Toast.d.ts.map +1 -1
- package/dist/Toast/Toast.js +25 -15
- package/dist/Toast/ToastViewport.d.ts.map +1 -1
- package/dist/Toast/ToastViewport.js +94 -34
- package/dist/Toast/types.d.ts +9 -3
- package/dist/Toast/types.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.d.ts +19 -1
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +34 -53
- package/dist/Typeahead/TypeaheadItem.d.ts +2 -1
- package/dist/Typeahead/TypeaheadItem.d.ts.map +1 -1
- package/dist/animator/createAnimator.d.ts +98 -0
- package/dist/animator/createAnimator.d.ts.map +1 -0
- package/dist/animator/createAnimator.js +259 -0
- package/dist/astryx.css +35 -6
- package/dist/gestures/PressTracker.d.ts.map +1 -1
- package/dist/gestures/PressTracker.js +4 -3
- package/dist/hooks/actionGroupTracker.d.ts +4 -1
- package/dist/hooks/actionGroupTracker.d.ts.map +1 -1
- package/dist/hooks/actionGroupTracker.js +13 -3
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/pressGroupContext.d.ts +6 -0
- package/dist/hooks/pressGroupContext.d.ts.map +1 -0
- package/dist/hooks/pressGroupContext.js +20 -0
- package/dist/hooks/useActionGroupTracking.d.ts +53 -0
- package/dist/hooks/useActionGroupTracking.d.ts.map +1 -0
- package/dist/hooks/useActionGroupTracking.js +174 -0
- package/dist/hooks/useAnimator.d.ts +41 -0
- package/dist/hooks/useAnimator.d.ts.map +1 -0
- package/dist/hooks/useAnimator.js +70 -0
- 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 +6 -2
- package/dist/hooks/useLongPress.d.ts.map +1 -1
- package/dist/hooks/useLongPress.js +95 -15
- package/dist/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.d.ts +8 -0
- package/dist/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.js +42 -0
- package/dist/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.js +6 -0
- package/dist/i18n/generated-english/PowerSearch/formatTokenValue.generated.d.ts +8 -0
- package/dist/i18n/generated-english/PowerSearch/formatTokenValue.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/PowerSearch/formatTokenValue.generated.js +14 -0
- package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/en.generated.js +30 -0
- package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pseudo.generated.js +30 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/internal/indicatorPress.stylex.d.ts +20 -0
- package/dist/internal/indicatorPress.stylex.d.ts.map +1 -0
- package/dist/internal/indicatorPress.stylex.js +26 -0
- package/dist/motion/animator.d.ts +14 -14
- package/dist/motion/animator.d.ts.map +1 -1
- package/dist/motion/animator.js +41 -18
- package/dist/motion/uikit/alert.d.ts +41 -0
- package/dist/motion/uikit/alert.d.ts.map +1 -0
- package/dist/motion/uikit/alert.js +43 -0
- package/dist/privateAttributes/pressGroupItem.stylex.d.ts +15 -0
- package/dist/privateAttributes/pressGroupItem.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/pressGroupItem.stylex.js +23 -0
- package/dist/utils/focusReturn.d.ts +15 -0
- package/dist/utils/focusReturn.d.ts.map +1 -1
- package/dist/utils/focusReturn.js +28 -0
- package/dist/utils/interactionOverlay.stylex.d.ts +3 -2
- package/dist/utils/interactionOverlay.stylex.d.ts.map +1 -1
- package/dist/utils/interactionOverlay.stylex.js +3 -2
- package/dist/utils/pressFeedback.d.ts.map +1 -1
- package/dist/utils/pressFeedback.js +19 -6
- package/dist/utils/triggerFocus.d.ts +36 -0
- package/dist/utils/triggerFocus.d.ts.map +1 -0
- package/dist/utils/triggerFocus.js +65 -0
- package/locales/en.json +120 -0
- package/locales/pseudo.json +90 -0
- package/package.json +9 -4
- package/src/AlertDialog/AlertDialog.doc.mjs +2 -2
- package/src/AlertDialog/AlertDialog.tsx +37 -5
- package/src/BottomSheet/BottomSheetPanel.tsx +33 -3
- package/src/BottomSheet/useSheetGestures.ts +3 -1
- package/src/Button/Button.tsx +26 -4
- package/src/CheckboxInput/CheckboxInput.doc.mjs +18 -0
- package/src/CheckboxInput/CheckboxInput.tsx +36 -9
- package/src/ComplexSelector/ComplexSelector.tsx +20 -5
- package/src/ContextMenu/ContextMenu.tsx +2 -2
- package/src/Dialog/Dialog.tsx +10 -31
- package/src/Field/Field.tsx +2 -2
- package/src/HoverCard/HoverCard.doc.mjs +4 -2
- package/src/HoverCard/HoverCard.tsx +4 -3
- package/src/HoverCard/useHoverCard.doc.mjs +178 -36
- package/src/HoverCard/useHoverCard.tsx +46 -52
- package/src/Icon/Icon.doc.mjs +49 -8
- package/src/Icon/Icon.tsx +15 -7
- package/src/Layer/usePressPin.ts +81 -15
- package/src/Lightbox/Lightbox.tsx +18 -0
- package/src/PowerSearch/PowerSearch.doc.mjs +54 -5
- package/src/PowerSearch/PowerSearch.tsx +609 -155
- package/src/PowerSearch/PowerSearchBottomSheet.tsx +2515 -0
- package/src/PowerSearch/PowerSearchEditPopover.tsx +28 -6
- package/src/PowerSearch/PowerSearchValueEditor.tsx +203 -38
- package/src/PowerSearch/formatFilterValue.ts +18 -1
- package/src/PowerSearch/formatTokenValue.ts +215 -0
- package/src/PowerSearch/powerSearchSheetUtils.ts +224 -0
- package/src/RadioList/RadioList.tsx +3 -2
- package/src/RadioList/RadioListItem.tsx +5 -3
- package/src/Resizable/Resizable.doc.mjs +5 -4
- package/src/Resizable/ResizeHandle.tsx +167 -109
- package/src/SegmentedControl/useSegmentedSelectionMotion.ts +6 -3
- package/src/Slider/sliderTouchController.ts +2 -2
- package/src/Spinner/Spinner.tsx +77 -63
- package/src/Switch/useSwitchTouch.ts +4 -4
- package/src/Table/BaseTable.tsx +46 -12
- package/src/TextInput/TextInput.tsx +11 -10
- package/src/Toast/Toast.doc.mjs +4 -3
- package/src/Toast/Toast.tsx +52 -32
- package/src/Toast/ToastViewport.tsx +121 -35
- package/src/Toast/types.ts +9 -3
- package/src/Tooltip/useTooltip.doc.mjs +24 -0
- package/src/Tooltip/useTooltip.tsx +61 -56
- package/src/Typeahead/TypeaheadItem.doc.mjs +6 -3
- package/src/Typeahead/TypeaheadItem.tsx +2 -1
- package/src/animator/createAnimator.doc.mjs +153 -0
- package/src/animator/createAnimator.ts +324 -0
- package/src/gestures/PressTracker.ts +4 -3
- package/src/gestures/README.md +7 -1
- package/src/hooks/actionGroupTracker.ts +20 -5
- package/src/hooks/index.ts +2 -0
- package/src/hooks/pressGroupContext.ts +21 -0
- package/src/hooks/useActionGroupTracking.ts +224 -0
- package/src/hooks/useAnimator.doc.mjs +109 -0
- package/src/hooks/useAnimator.ts +67 -0
- package/src/hooks/useAttachment.ts +1 -1
- package/src/hooks/useInputStatusIcon.tsx +3 -2
- package/src/hooks/useLongPress.doc.mjs +2 -2
- package/src/hooks/useLongPress.ts +136 -15
- package/src/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.ts +43 -0
- package/src/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.ts +6 -0
- package/src/i18n/generated-english/PowerSearch/formatTokenValue.generated.ts +15 -0
- package/src/i18n/generated-locales/en.generated.ts +41 -0
- package/src/i18n/generated-locales/pseudo.generated.ts +42 -0
- package/src/index.ts +13 -0
- package/src/internal/indicatorPress.stylex.ts +24 -0
- package/src/motion/README.md +8 -5
- package/src/motion/animator.ts +61 -29
- package/src/motion/uikit/alert.ts +43 -0
- package/src/privateAttributes/pressGroupItem.stylex.ts +23 -0
- package/src/utils/focusReturn.ts +30 -0
- package/src/utils/interactionOverlay.stylex.ts +3 -2
- package/src/utils/pressFeedback.ts +19 -6
- package/src/utils/triggerFocus.ts +80 -0
package/locales/en.json
CHANGED
|
@@ -255,6 +255,126 @@
|
|
|
255
255
|
"defaultMessage": "{count, number} {count, plural, one {result} other {results}}",
|
|
256
256
|
"description": "Live result-count text next to the PowerSearch input, announced to screen readers on change. Example: `12 results`, `1 result`; keep compact."
|
|
257
257
|
},
|
|
258
|
+
"@astryx.powersearch.sheet.filtersTitle": {
|
|
259
|
+
"defaultMessage": "Filters",
|
|
260
|
+
"description": "Heading and accessible name of the PowerSearch touch sheet that lists the active filters (experimental bottom-sheet presentation). Plural noun."
|
|
261
|
+
},
|
|
262
|
+
"@astryx.powersearch.sheet.addFilter": {
|
|
263
|
+
"defaultMessage": "Add filter",
|
|
264
|
+
"description": "Button label in the PowerSearch touch flow: in the Filters sheet header it opens the field list; in the value step it confirms a new filter. Imperative verb; no leading plus sign."
|
|
265
|
+
},
|
|
266
|
+
"@astryx.powersearch.sheet.noFilters": {
|
|
267
|
+
"defaultMessage": "No filters applied",
|
|
268
|
+
"description": "Heading of the PowerSearch Filters sheet empty state when no filter is active (experimental bottom-sheet presentation). Neutral tone."
|
|
269
|
+
},
|
|
270
|
+
"@astryx.powersearch.sheet.noFiltersDescription": {
|
|
271
|
+
"defaultMessage": "Add a filter to narrow your results and find what you need faster.",
|
|
272
|
+
"description": "Guidance line under the PowerSearch Filters sheet empty state, above its Add filter action. One short sentence."
|
|
273
|
+
},
|
|
274
|
+
"@astryx.powersearch.sheet.clearAll": {
|
|
275
|
+
"defaultMessage": "Clear all",
|
|
276
|
+
"description": "Button label in the PowerSearch Filters sheet footer that asks to remove every editable filter. Imperative verb + determiner."
|
|
277
|
+
},
|
|
278
|
+
"@astryx.powersearch.sheet.clearAllTitle": {
|
|
279
|
+
"defaultMessage": "Clear all filters?",
|
|
280
|
+
"description": "Title and accessible name of the confirmation dialog that Clear all opens in the PowerSearch touch flow. A short question."
|
|
281
|
+
},
|
|
282
|
+
"@astryx.powersearch.sheet.clearAllDescription": {
|
|
283
|
+
"defaultMessage": "This removes all editable filters from this search.",
|
|
284
|
+
"description": "Body text of the PowerSearch Clear all confirmation dialog. Read-only filters stay, so it names editable filters."
|
|
285
|
+
},
|
|
286
|
+
"@astryx.powersearch.sheet.clearAllConfirm": {
|
|
287
|
+
"defaultMessage": "Clear filters",
|
|
288
|
+
"description": "Destructive action of the PowerSearch Clear all confirmation dialog: removes the editable filters. Imperative verb + plural noun."
|
|
289
|
+
},
|
|
290
|
+
"@astryx.powersearch.sheet.clearAllCancel": {
|
|
291
|
+
"defaultMessage": "Keep filters",
|
|
292
|
+
"description": "Safe action of the PowerSearch Clear all confirmation dialog: closes it and changes nothing. Imperative verb + plural noun."
|
|
293
|
+
},
|
|
294
|
+
"@astryx.powersearch.sheet.done": {
|
|
295
|
+
"defaultMessage": "Done",
|
|
296
|
+
"description": "Primary button label in the PowerSearch Filters sheet footer that closes the sheet. Short; marks the end of the filtering task."
|
|
297
|
+
},
|
|
298
|
+
"@astryx.powersearch.sheet.search": {
|
|
299
|
+
"defaultMessage": "Search",
|
|
300
|
+
"description": "Screen-reader-only label of the content-search box at the top of the PowerSearch Add filter sheet; its suggestions list inline below it. Noun or verb as reads best."
|
|
301
|
+
},
|
|
302
|
+
"@astryx.powersearch.sheet.searchResults": {
|
|
303
|
+
"defaultMessage": "Search results",
|
|
304
|
+
"description": "Screen-reader-only name of the inline suggestion list under the PowerSearch Add filter sheet's content search. Plural noun."
|
|
305
|
+
},
|
|
306
|
+
"@astryx.powersearch.sheet.searchFields": {
|
|
307
|
+
"defaultMessage": "Search filters",
|
|
308
|
+
"description": "Screen-reader-only label of the field-list filter box in the PowerSearch Add filter sheet, shown once the config has eight or more fields. Imperative verb + plural noun."
|
|
309
|
+
},
|
|
310
|
+
"@astryx.powersearch.sheet.searchFieldsPlaceholder": {
|
|
311
|
+
"defaultMessage": "Search filters…",
|
|
312
|
+
"description": "Placeholder inside the field-list filter box in the PowerSearch Add filter sheet. Imperative verb; trailing `…` is one character."
|
|
313
|
+
},
|
|
314
|
+
"@astryx.powersearch.sheet.ungroupedFields": {
|
|
315
|
+
"defaultMessage": "General",
|
|
316
|
+
"description": "Heading of the PowerSearch Add filter sheet's list of fields that belong to no group, shown before the named groups. A short noun."
|
|
317
|
+
},
|
|
318
|
+
"@astryx.powersearch.sheet.noMatchingFields": {
|
|
319
|
+
"defaultMessage": "No filters match your search",
|
|
320
|
+
"description": "Empty-state text in the PowerSearch Add filter sheet when the field-list filter matches no field. Neutral tone."
|
|
321
|
+
},
|
|
322
|
+
"@astryx.powersearch.sheet.tryDifferentSearch": {
|
|
323
|
+
"defaultMessage": "Try a different search.",
|
|
324
|
+
"description": "Guidance line under the PowerSearch Add filter sheet's empty search result (\"No results found\", \"No filters match your search\"). One short sentence."
|
|
325
|
+
},
|
|
326
|
+
"@astryx.powersearch.sheet.noResults": {
|
|
327
|
+
"defaultMessage": "No results found",
|
|
328
|
+
"description": "Empty-state text in the PowerSearch Add filter sheet when the content search has no suggestion for the typed query. Neutral tone (not error-y)."
|
|
329
|
+
},
|
|
330
|
+
"@astryx.powersearch.sheet.filterUnavailable": {
|
|
331
|
+
"defaultMessage": "This filter is no longer available",
|
|
332
|
+
"description": "Message in the PowerSearch value step when a config update removed the field or operator being edited; Cancel remains as the way out, and the Filters row keeps its remove action."
|
|
333
|
+
},
|
|
334
|
+
"@astryx.powersearch.sheet.removeFilter": {
|
|
335
|
+
"defaultMessage": "Remove {field} filter",
|
|
336
|
+
"description": "Accessible name and tooltip of the trailing remove button on a PowerSearch Filters sheet row; field is the filter's field label (for example \"Remove Status filter\")."
|
|
337
|
+
},
|
|
338
|
+
"@astryx.powersearch.sheet.relativeDaysAgo": {
|
|
339
|
+
"defaultMessage": "{count, number} {count, plural, one {day} other {days}} ago",
|
|
340
|
+
"description": "A relative-date choice row in the PowerSearch touch sheet, in the past (for example \"3 days ago\"). The popover editor lists the same choices."
|
|
341
|
+
},
|
|
342
|
+
"@astryx.powersearch.sheet.relativeDaysFromNow": {
|
|
343
|
+
"defaultMessage": "{count, number} {count, plural, one {day} other {days}} from now",
|
|
344
|
+
"description": "A relative-date choice row in the PowerSearch touch sheet, in the future (for example \"3 days from now\"). The popover editor lists the same choices."
|
|
345
|
+
},
|
|
346
|
+
"@astryx.powersearch.sheet.relativeWeeksAgo": {
|
|
347
|
+
"defaultMessage": "{count, number} {count, plural, one {week} other {weeks}} ago",
|
|
348
|
+
"description": "A relative-date choice row in the PowerSearch touch sheet, in the past (for example \"3 weeks ago\"). The popover editor lists the same choices."
|
|
349
|
+
},
|
|
350
|
+
"@astryx.powersearch.sheet.relativeWeeksFromNow": {
|
|
351
|
+
"defaultMessage": "{count, number} {count, plural, one {week} other {weeks}} from now",
|
|
352
|
+
"description": "A relative-date choice row in the PowerSearch touch sheet, in the future (for example \"3 weeks from now\"). The popover editor lists the same choices."
|
|
353
|
+
},
|
|
354
|
+
"@astryx.powersearch.sheet.relativeMonthsAgo": {
|
|
355
|
+
"defaultMessage": "{count, number} {count, plural, one {month} other {months}} ago",
|
|
356
|
+
"description": "A relative-date choice row in the PowerSearch touch sheet, in the past (for example \"3 months ago\"). The popover editor lists the same choices."
|
|
357
|
+
},
|
|
358
|
+
"@astryx.powersearch.sheet.relativeMonthsFromNow": {
|
|
359
|
+
"defaultMessage": "{count, number} {count, plural, one {month} other {months}} from now",
|
|
360
|
+
"description": "A relative-date choice row in the PowerSearch touch sheet, in the future (for example \"3 months from now\"). The popover editor lists the same choices."
|
|
361
|
+
},
|
|
362
|
+
"@astryx.powersearch.sheet.fieldOperator": {
|
|
363
|
+
"defaultMessage": "{field} {operator}",
|
|
364
|
+
"description": "A field label joined with an operator label in the PowerSearch touch sheet: the value step's title, an operator radio's name, and the first part of a Filters row (for example \"Status is\"). Translators may reorder the two parts."
|
|
365
|
+
},
|
|
366
|
+
"@astryx.powersearch.sheet.labelValue": {
|
|
367
|
+
"defaultMessage": "{label} {value}",
|
|
368
|
+
"description": "A Filters row's \"field operator\" text joined with its value, as the removal announcement reads it (for example \"Status is Open\"). Translators may reorder the two parts."
|
|
369
|
+
},
|
|
370
|
+
"@astryx.powersearch.sheet.filtersClearedWithCount": {
|
|
371
|
+
"defaultMessage": "All filters removed. {resultCount}",
|
|
372
|
+
"description": "Polite screen-reader announcement after Clear all in the PowerSearch touch sheet when the result count changed with it; resultCount is the field's already formatted result count (for example \"240 results\"). Live-region text, never shown on screen."
|
|
373
|
+
},
|
|
374
|
+
"@astryx.powersearch.sheet.editableFiltersClearedWithCount": {
|
|
375
|
+
"defaultMessage": "Editable filters removed. {resultCount}",
|
|
376
|
+
"description": "Polite screen-reader announcement after Clear all in the PowerSearch touch sheet removes the editable filters, keeps read-only ones, and the result count changed with it; resultCount is the field's already formatted result count (for example \"240 results\"). Live-region text, never shown on screen."
|
|
377
|
+
},
|
|
258
378
|
"@astryx.alertDialog.cancel": {
|
|
259
379
|
"defaultMessage": "Cancel",
|
|
260
380
|
"description": "Button label on the secondary/dismiss button of an AlertDialog (modal confirmation). Imperative verb; consumers usually override with task-specific text."
|
package/locales/pseudo.json
CHANGED
|
@@ -191,6 +191,96 @@
|
|
|
191
191
|
"@astryx.powersearch.resultCount": {
|
|
192
192
|
"defaultMessage": "⟦{count, number} {count, plural, one {result} other {results}}⟧"
|
|
193
193
|
},
|
|
194
|
+
"@astryx.powersearch.sheet.filtersTitle": {
|
|
195
|
+
"defaultMessage": "⟦Ƒíłţéřš⟧"
|
|
196
|
+
},
|
|
197
|
+
"@astryx.powersearch.sheet.addFilter": {
|
|
198
|
+
"defaultMessage": "⟦Àðð ƒíłţéř⟧"
|
|
199
|
+
},
|
|
200
|
+
"@astryx.powersearch.sheet.noFilters": {
|
|
201
|
+
"defaultMessage": "⟦Ñó ƒíłţéřš àþþłíéð⟧"
|
|
202
|
+
},
|
|
203
|
+
"@astryx.powersearch.sheet.noFiltersDescription": {
|
|
204
|
+
"defaultMessage": "⟦Àðð à ƒíłţéř ţó ñàřřóŵ ýóúř řéšúłţš àñð ƒíñð ŵĥàţ ýóú ñééð ƒàšţéř.⟧"
|
|
205
|
+
},
|
|
206
|
+
"@astryx.powersearch.sheet.clearAll": {
|
|
207
|
+
"defaultMessage": "⟦Çłéàř àłł⟧"
|
|
208
|
+
},
|
|
209
|
+
"@astryx.powersearch.sheet.clearAllTitle": {
|
|
210
|
+
"defaultMessage": "⟦Çłéàř àłł ƒíłţéřš?⟧"
|
|
211
|
+
},
|
|
212
|
+
"@astryx.powersearch.sheet.clearAllDescription": {
|
|
213
|
+
"defaultMessage": "⟦Ţĥíš řéɱóṽéš àłł éðíţàƀłé ƒíłţéřš ƒřóɱ ţĥíš šéàřçĥ.⟧"
|
|
214
|
+
},
|
|
215
|
+
"@astryx.powersearch.sheet.clearAllConfirm": {
|
|
216
|
+
"defaultMessage": "⟦Çłéàř ƒíłţéřš⟧"
|
|
217
|
+
},
|
|
218
|
+
"@astryx.powersearch.sheet.clearAllCancel": {
|
|
219
|
+
"defaultMessage": "⟦Ķééþ ƒíłţéřš⟧"
|
|
220
|
+
},
|
|
221
|
+
"@astryx.powersearch.sheet.done": {
|
|
222
|
+
"defaultMessage": "⟦Ðóñé⟧"
|
|
223
|
+
},
|
|
224
|
+
"@astryx.powersearch.sheet.search": {
|
|
225
|
+
"defaultMessage": "⟦Šéàřçĥ⟧"
|
|
226
|
+
},
|
|
227
|
+
"@astryx.powersearch.sheet.searchResults": {
|
|
228
|
+
"defaultMessage": "⟦Šéàřçĥ řéšúłţš⟧"
|
|
229
|
+
},
|
|
230
|
+
"@astryx.powersearch.sheet.searchFields": {
|
|
231
|
+
"defaultMessage": "⟦Šéàřçĥ ƒíłţéřš⟧"
|
|
232
|
+
},
|
|
233
|
+
"@astryx.powersearch.sheet.searchFieldsPlaceholder": {
|
|
234
|
+
"defaultMessage": "⟦Šéàřçĥ ƒíłţéřš…⟧"
|
|
235
|
+
},
|
|
236
|
+
"@astryx.powersearch.sheet.ungroupedFields": {
|
|
237
|
+
"defaultMessage": "⟦Ĝéñéřàł⟧"
|
|
238
|
+
},
|
|
239
|
+
"@astryx.powersearch.sheet.noMatchingFields": {
|
|
240
|
+
"defaultMessage": "⟦Ñó ƒíłţéřš ɱàţçĥ ýóúř šéàřçĥ⟧"
|
|
241
|
+
},
|
|
242
|
+
"@astryx.powersearch.sheet.tryDifferentSearch": {
|
|
243
|
+
"defaultMessage": "⟦Ţřý à ð탃éřéñţ šéàřçĥ.⟧"
|
|
244
|
+
},
|
|
245
|
+
"@astryx.powersearch.sheet.noResults": {
|
|
246
|
+
"defaultMessage": "⟦Ñó řéšúłţš ƒóúñð⟧"
|
|
247
|
+
},
|
|
248
|
+
"@astryx.powersearch.sheet.filterUnavailable": {
|
|
249
|
+
"defaultMessage": "⟦Ţĥíš ƒíłţéř íš ñó łóñĝéř àṽàíłàƀłé⟧"
|
|
250
|
+
},
|
|
251
|
+
"@astryx.powersearch.sheet.removeFilter": {
|
|
252
|
+
"defaultMessage": "⟦Řéɱóṽé {field} ƒíłţéř⟧"
|
|
253
|
+
},
|
|
254
|
+
"@astryx.powersearch.sheet.relativeDaysAgo": {
|
|
255
|
+
"defaultMessage": "⟦{count, number} {count, plural, one {day} other {days}} àĝó⟧"
|
|
256
|
+
},
|
|
257
|
+
"@astryx.powersearch.sheet.relativeDaysFromNow": {
|
|
258
|
+
"defaultMessage": "⟦{count, number} {count, plural, one {day} other {days}} ƒřóɱ ñóŵ⟧"
|
|
259
|
+
},
|
|
260
|
+
"@astryx.powersearch.sheet.relativeWeeksAgo": {
|
|
261
|
+
"defaultMessage": "⟦{count, number} {count, plural, one {week} other {weeks}} àĝó⟧"
|
|
262
|
+
},
|
|
263
|
+
"@astryx.powersearch.sheet.relativeWeeksFromNow": {
|
|
264
|
+
"defaultMessage": "⟦{count, number} {count, plural, one {week} other {weeks}} ƒřóɱ ñóŵ⟧"
|
|
265
|
+
},
|
|
266
|
+
"@astryx.powersearch.sheet.relativeMonthsAgo": {
|
|
267
|
+
"defaultMessage": "⟦{count, number} {count, plural, one {month} other {months}} àĝó⟧"
|
|
268
|
+
},
|
|
269
|
+
"@astryx.powersearch.sheet.relativeMonthsFromNow": {
|
|
270
|
+
"defaultMessage": "⟦{count, number} {count, plural, one {month} other {months}} ƒřóɱ ñóŵ⟧"
|
|
271
|
+
},
|
|
272
|
+
"@astryx.powersearch.sheet.fieldOperator": {
|
|
273
|
+
"defaultMessage": "⟦{field} {operator}⟧"
|
|
274
|
+
},
|
|
275
|
+
"@astryx.powersearch.sheet.labelValue": {
|
|
276
|
+
"defaultMessage": "⟦{label} {value}⟧"
|
|
277
|
+
},
|
|
278
|
+
"@astryx.powersearch.sheet.filtersClearedWithCount": {
|
|
279
|
+
"defaultMessage": "⟦Àłł ƒíłţéřš řéɱóṽéð. {resultCount}⟧"
|
|
280
|
+
},
|
|
281
|
+
"@astryx.powersearch.sheet.editableFiltersClearedWithCount": {
|
|
282
|
+
"defaultMessage": "⟦Éðíţàƀłé ƒíłţéřš řéɱóṽéð. {resultCount}⟧"
|
|
283
|
+
},
|
|
194
284
|
"@astryx.alertDialog.cancel": {
|
|
195
285
|
"defaultMessage": "⟦Çàñçéł⟧"
|
|
196
286
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astryxdesign/core",
|
|
3
|
-
"version": "0.7.7-canary.
|
|
3
|
+
"version": "0.7.7-canary.b377b21",
|
|
4
4
|
"displayName": "Astryx Core",
|
|
5
5
|
"description": "The component library. Accessible, themeable React components with built-in spacing, dark mode, and StyleX styling.",
|
|
6
6
|
"author": "Meta Open Source",
|
|
@@ -824,6 +824,11 @@
|
|
|
824
824
|
"types": "./dist/Markdown/remark.d.ts",
|
|
825
825
|
"default": "./dist/Markdown/remark.js"
|
|
826
826
|
},
|
|
827
|
+
"./internal/indicatorPress.stylex": {
|
|
828
|
+
"source": "./src/internal/indicatorPress.stylex.ts",
|
|
829
|
+
"types": "./dist/internal/indicatorPress.stylex.d.ts",
|
|
830
|
+
"default": "./dist/internal/indicatorPress.stylex.js"
|
|
831
|
+
},
|
|
827
832
|
"./internal/touch": {
|
|
828
833
|
"source": "./src/internal/touch.ts",
|
|
829
834
|
"types": "./dist/internal/touch.d.ts",
|
|
@@ -865,9 +870,9 @@
|
|
|
865
870
|
"react-dom": ">=19.0.0"
|
|
866
871
|
},
|
|
867
872
|
"devDependencies": {
|
|
868
|
-
"@astryxdesign/a11y-spec": "0.7.7-canary.
|
|
869
|
-
"@astryxdesign/cli": "0.7.7-canary.
|
|
870
|
-
"@astryxdesign/interaction-harness": "0.7.7-canary.
|
|
873
|
+
"@astryxdesign/a11y-spec": "0.7.7-canary.b377b21",
|
|
874
|
+
"@astryxdesign/cli": "0.7.7-canary.b377b21",
|
|
875
|
+
"@astryxdesign/interaction-harness": "0.7.7-canary.b377b21",
|
|
871
876
|
"@babel/cli": "^7.29.7",
|
|
872
877
|
"@babel/core": "^7.29.7",
|
|
873
878
|
"@babel/preset-react": "^7.29.7",
|
|
@@ -21,7 +21,7 @@ export const docs = {
|
|
|
21
21
|
],
|
|
22
22
|
usage: {
|
|
23
23
|
description:
|
|
24
|
-
'AlertDialog asks the user to confirm a destructive or irreversible action before it happens. Use it for things like deleting content, revoking access, or discarding unsaved changes.\n\nIt implements the WAI-ARIA APG [Alert Dialog pattern](https://www.w3.org/WAI/ARIA/apg/patterns/alertdialog/): `role="alertdialog"`, a title linked by `aria-labelledby`, a consequence description linked by `aria-describedby`, focus moved into the dialog on open and returned to the trigger on close, and no dismissal by clicking outside. Escape cancels.\n\nAlertDialog passes its requested width through to Dialog, which clamps the surface to the container and dynamic viewport with token gutters. Generic Dialog footers should wrap, but Dialog does not own action semantics or order; consumer composition controls that. AlertDialog owns its confirmation semantics: above 640px, actions render horizontally and may move onto another row; at 640px and below, the destructive action appears above Cancel and both buttons fill the footer width. Button labels retain their standard single-line behavior. The breakpoint follows available width, not pointer or hover capability. The body scrolls when block space is constrained.\n\nFor cases where you want to show an alert without managing open state, use the `useImperativeAlertDialog` hook: call `alert.show(options)` and render `alert.element` in your tree.',
|
|
24
|
+
'AlertDialog asks the user to confirm a destructive or irreversible action before it happens. Use it for things like deleting content, revoking access, or discarding unsaved changes.\n\nIt implements the WAI-ARIA APG [Alert Dialog pattern](https://www.w3.org/WAI/ARIA/apg/patterns/alertdialog/): `role="alertdialog"`, a title linked by `aria-labelledby`, a consequence description linked by `aria-describedby`, focus moved into the dialog on open and returned to the trigger on close, and no dismissal by clicking outside. Escape cancels.\n\nAlertDialog passes its requested width through to Dialog, which clamps the surface to the container and dynamic viewport with token gutters. Generic Dialog footers should wrap, but Dialog does not own action semantics or order; consumer composition controls that. AlertDialog owns its confirmation semantics: above 640px, actions render horizontally and may move onto another row; at 640px and below, the destructive action appears above Cancel and both buttons fill the footer width. Button labels retain their standard single-line behavior. The breakpoint follows available width, not pointer or hover capability. The body scrolls when block space is constrained.\n\nThe two actions are tracked as one group under every pointer, the way iOS tracks the actions of an alert: the action under the pointer highlights as soon as it is pressed, the highlight follows the pointer from one action to the other, and the release runs the action under it. Releasing off both actions runs nothing. The keyboard and assistive technology keep the click of each button.\n\nFor cases where you want to show an alert without managing open state, use the `useImperativeAlertDialog` hook: call `alert.show(options)` and render `alert.element` in your tree.',
|
|
25
25
|
bestPractices: [
|
|
26
26
|
{
|
|
27
27
|
guidance: true,
|
|
@@ -196,7 +196,7 @@ export const docsDense = {
|
|
|
196
196
|
'Confirms destructive/irreversible action before it happens (delete, revoke access, discard unsaved changes).',
|
|
197
197
|
usage: {
|
|
198
198
|
description:
|
|
199
|
-
'AlertDialog confirms destructive/irreversible action (delete, revoke access, discard changes). Implements WAI-ARIA APG Alert Dialog pattern (https://www.w3.org/WAI/ARIA/apg/patterns/alertdialog/): role="alertdialog", aria-labelledby title, aria-describedby description, focus into dialog on open + back to trigger on close, no outside-click dismissal, Escape cancels. Dialog preserves requested width + clamps it to container/dynamic viewport gutters. Generic Dialog footers wrap while consumers own action order. AlertDialog owns confirmation action layout: >640px horizontal buttons may move to another row; <=640px puts the destructive action above Cancel and makes both buttons full width regardless of pointer/hover capability. Button labels remain single-line. Body scrolls when height constrained. To show w/o managing open state, use useImperativeAlertDialog hook: call alert.show(options) + render alert.element in tree.',
|
|
199
|
+
'AlertDialog confirms destructive/irreversible action (delete, revoke access, discard changes). Implements WAI-ARIA APG Alert Dialog pattern (https://www.w3.org/WAI/ARIA/apg/patterns/alertdialog/): role="alertdialog", aria-labelledby title, aria-describedby description, focus into dialog on open + back to trigger on close, no outside-click dismissal, Escape cancels. Dialog preserves requested width + clamps it to container/dynamic viewport gutters. Generic Dialog footers wrap while consumers own action order. AlertDialog owns confirmation action layout: >640px horizontal buttons may move to another row; <=640px puts the destructive action above Cancel and makes both buttons full width regardless of pointer/hover capability. Button labels remain single-line. Body scrolls when height constrained. Every pointer: both actions tracked as one group like iOS alerts (action under pointer highlights at once, highlight follows pointer between actions, release runs action under pointer, release off both runs nothing); keyboard/AT keep each button click. To show w/o managing open state, use useImperativeAlertDialog hook: call alert.show(options) + render alert.element in tree.',
|
|
200
200
|
bestPractices: [
|
|
201
201
|
{
|
|
202
202
|
guidance: true,
|
|
@@ -4,7 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file AlertDialog.tsx
|
|
7
|
-
* @input Uses React, StyleX, Dialog, Layout, Heading, Text, Button
|
|
7
|
+
* @input Uses React, StyleX, Dialog, Layout, Heading, Text, Button, the
|
|
8
|
+
* action-group tracking (hooks/useActionGroupTracking) and the press-group
|
|
9
|
+
* marker (privateAttributes/pressGroupItem.stylex)
|
|
8
10
|
* @output Exports AlertDialog component, AlertDialogProps type
|
|
9
11
|
* @position Core implementation; consumed by index.ts, tested by AlertDialog.test.tsx
|
|
10
12
|
*
|
|
@@ -12,11 +14,12 @@
|
|
|
12
14
|
* - /packages/core/src/AlertDialog/AlertDialog.doc.mjs (props table, features, examples)
|
|
13
15
|
* - /packages/core/src/AlertDialog/AlertDialog.test.tsx (tests for new/changed behavior)
|
|
14
16
|
* - /packages/core/src/AlertDialog/index.ts (exports if types change)
|
|
17
|
+
* - /packages/core/src/AlertDialog/__tests__/AlertDialog.interaction.browser.spec.ts (touch tracking)
|
|
15
18
|
* - /apps/storybook/stories/AlertDialog.stories.tsx (storybook stories)
|
|
16
19
|
* - /packages/cli/assets/templates/blocks/components/AlertDialog/ (showcase blocks)
|
|
17
20
|
*/
|
|
18
21
|
|
|
19
|
-
import React, {useId, useCallback} from 'react';
|
|
22
|
+
import React, {useId, useCallback, useRef} from 'react';
|
|
20
23
|
import * as stylex from '@stylexjs/stylex';
|
|
21
24
|
import {Dialog} from '../Dialog/Dialog';
|
|
22
25
|
import {Layout} from '../Layout/Layout';
|
|
@@ -36,12 +39,22 @@ import {
|
|
|
36
39
|
useComponentTranslator,
|
|
37
40
|
} from '../i18n/useComponentTranslator';
|
|
38
41
|
import english from '../i18n/generated-english/AlertDialog/AlertDialog.generated';
|
|
42
|
+
import {useActionGroupTracking} from '../hooks/useActionGroupTracking';
|
|
43
|
+
import {PressGroupContext} from '../hooks/pressGroupContext';
|
|
44
|
+
import {alertController} from '../motion/uikit/alert';
|
|
45
|
+
import {pressGroupItemProps} from '../privateAttributes/pressGroupItem.stylex';
|
|
39
46
|
|
|
40
47
|
registerEnglishFallback(english);
|
|
41
48
|
|
|
42
49
|
const SMALL_SCREEN_QUERY = '(max-width: 640px)';
|
|
43
50
|
|
|
44
51
|
const styles = stylex.create({
|
|
52
|
+
// The browser may pinch-zoom on the actions but never pans there. Chrome on
|
|
53
|
+
// Android cancels a pointer it pans, which would cancel the group's press.
|
|
54
|
+
// The gesture host keeps an author's narrower touch-action.
|
|
55
|
+
trackingRow: {
|
|
56
|
+
touchAction: 'pinch-zoom',
|
|
57
|
+
},
|
|
45
58
|
action: {
|
|
46
59
|
maxWidth: '100%',
|
|
47
60
|
minWidth: 0,
|
|
@@ -177,6 +190,19 @@ export function AlertDialog({
|
|
|
177
190
|
onOpenChange(false);
|
|
178
191
|
}, [onOpenChange]);
|
|
179
192
|
|
|
193
|
+
// Each action carries the press-group marker from its first render, so the
|
|
194
|
+
// tracker is its only painter.
|
|
195
|
+
const actionsRef = useRef<HTMLElement>(null);
|
|
196
|
+
const isTracking = isOpen && isInline !== true;
|
|
197
|
+
useActionGroupTracking(actionsRef, {
|
|
198
|
+
// The actions row holds only the two buttons.
|
|
199
|
+
itemSelector: 'button',
|
|
200
|
+
highlightOnsetMs: alertController.actions.highlightOnsetMs,
|
|
201
|
+
highlightExpansion: alertController.actions.highlightExpansion,
|
|
202
|
+
isEnabled: isTracking,
|
|
203
|
+
});
|
|
204
|
+
const actionTrackingProps = isTracking ? pressGroupItemProps : undefined;
|
|
205
|
+
|
|
180
206
|
const buttonActionStyle = [
|
|
181
207
|
styles.action,
|
|
182
208
|
isSmallScreen && styles.stackedAction,
|
|
@@ -188,6 +214,7 @@ export function AlertDialog({
|
|
|
188
214
|
label={cancelLabel}
|
|
189
215
|
onClick={handleCancel}
|
|
190
216
|
xstyle={buttonActionStyle}
|
|
217
|
+
{...actionTrackingProps}
|
|
191
218
|
// Dialog focuses [data-autofocus] itself after showModal(), because
|
|
192
219
|
// React's autoFocus runs during commit while the dialog is invisible.
|
|
193
220
|
// Cancel is least destructive, so it remains the autofocus target even
|
|
@@ -203,6 +230,7 @@ export function AlertDialog({
|
|
|
203
230
|
onClick={onAction}
|
|
204
231
|
isLoading={isActionLoading}
|
|
205
232
|
xstyle={buttonActionStyle}
|
|
233
|
+
{...actionTrackingProps}
|
|
206
234
|
/>
|
|
207
235
|
);
|
|
208
236
|
|
|
@@ -244,13 +272,17 @@ export function AlertDialog({
|
|
|
244
272
|
destructive-above-Cancel narrow order because confirmation
|
|
245
273
|
actions have component-specific meaning here. */}
|
|
246
274
|
<Stack
|
|
275
|
+
ref={actionsRef}
|
|
276
|
+
xstyle={isTracking && styles.trackingRow}
|
|
247
277
|
direction={isSmallScreen ? 'vertical' : 'horizontal'}
|
|
248
278
|
gap={2}
|
|
249
279
|
hAlign={isSmallScreen ? 'stretch' : 'end'}
|
|
250
280
|
wrap={isSmallScreen ? 'nowrap' : 'wrap'}>
|
|
251
|
-
{
|
|
252
|
-
|
|
253
|
-
|
|
281
|
+
<PressGroupContext value={isTracking}>
|
|
282
|
+
{isSmallScreen
|
|
283
|
+
? [actionButton, cancelButton]
|
|
284
|
+
: [cancelButton, actionButton]}
|
|
285
|
+
</PressGroupContext>
|
|
254
286
|
</Stack>
|
|
255
287
|
</LayoutFooter>
|
|
256
288
|
}
|
|
@@ -418,6 +418,7 @@ function waitForTransition(
|
|
|
418
418
|
|
|
419
419
|
let done = false;
|
|
420
420
|
let timer: ReturnType<typeof setTimeout> | null = null;
|
|
421
|
+
let backstopMs = 0;
|
|
421
422
|
const finish = () => {
|
|
422
423
|
if (done) {
|
|
423
424
|
return;
|
|
@@ -431,9 +432,24 @@ function waitForTransition(
|
|
|
431
432
|
complete();
|
|
432
433
|
};
|
|
433
434
|
const handleTransitionEnd = (event: TransitionEvent) => {
|
|
434
|
-
if (event.target
|
|
435
|
-
|
|
435
|
+
if (event.target !== element || event.propertyName !== propertyName) {
|
|
436
|
+
return;
|
|
437
|
+
}
|
|
438
|
+
// The engine cancels a transition whose end value changes mid-flight. A
|
|
439
|
+
// percentage transform does when the closing frame moves the height by a
|
|
440
|
+
// fraction of a pixel. A replacement runs on from where it was. That one
|
|
441
|
+
// ends the motion, not the cancel.
|
|
442
|
+
if (
|
|
443
|
+
event.type === 'transitioncancel' &&
|
|
444
|
+
hasRunningTransition(element, propertyName)
|
|
445
|
+
) {
|
|
446
|
+
if (timer != null) {
|
|
447
|
+
clearTimeout(timer);
|
|
448
|
+
timer = setTimeout(finish, backstopMs);
|
|
449
|
+
}
|
|
450
|
+
return;
|
|
436
451
|
}
|
|
452
|
+
finish();
|
|
437
453
|
};
|
|
438
454
|
element.addEventListener('transitionend', handleTransitionEnd);
|
|
439
455
|
element.addEventListener('transitioncancel', handleTransitionEnd);
|
|
@@ -484,7 +500,8 @@ function waitForTransition(
|
|
|
484
500
|
return () => {};
|
|
485
501
|
}
|
|
486
502
|
|
|
487
|
-
|
|
503
|
+
backstopMs = transitionMs + TRANSITION_BACKSTOP_BUFFER_MS;
|
|
504
|
+
timer = setTimeout(finish, backstopMs);
|
|
488
505
|
return () => {
|
|
489
506
|
if (timer != null) {
|
|
490
507
|
clearTimeout(timer);
|
|
@@ -494,6 +511,19 @@ function waitForTransition(
|
|
|
494
511
|
};
|
|
495
512
|
}
|
|
496
513
|
|
|
514
|
+
// Whether a CSS transition of `propertyName` still runs on `element`.
|
|
515
|
+
function hasRunningTransition(
|
|
516
|
+
element: HTMLElement,
|
|
517
|
+
propertyName: string,
|
|
518
|
+
): boolean {
|
|
519
|
+
return (element.getAnimations?.() ?? []).some(
|
|
520
|
+
animation =>
|
|
521
|
+
(animation as Animation & {transitionProperty?: string})
|
|
522
|
+
.transitionProperty === propertyName &&
|
|
523
|
+
(animation.playState === 'running' || animation.playState === 'paused'),
|
|
524
|
+
);
|
|
525
|
+
}
|
|
526
|
+
|
|
497
527
|
function parseTransitionTime(value: string): number | null {
|
|
498
528
|
const normalizedValue = value.trim();
|
|
499
529
|
if (!/^-?(?:\d+|\d*\.\d+)(?:ms|s)$/.test(normalizedValue)) {
|
|
@@ -738,7 +738,9 @@ export function useSheetGestures({
|
|
|
738
738
|
}
|
|
739
739
|
return;
|
|
740
740
|
}
|
|
741
|
-
|
|
741
|
+
// No measure here: reading the height while the sheet mounts forces a
|
|
742
|
+
// layout in the middle of the open. The observer's first report comes
|
|
743
|
+
// after the browser's own layout, before the first paint.
|
|
742
744
|
const ro = new ResizeObserver(entries => {
|
|
743
745
|
const entry = entries[0];
|
|
744
746
|
if (entry) {
|
package/src/Button/Button.tsx
CHANGED
|
@@ -53,6 +53,7 @@ import {iconBoxSizeStyles, type IconSize} from '../Icon/IconSize.stylex';
|
|
|
53
53
|
import {EDGE_COMP_ATTR} from '../Layout/edgeCompensation.stylex';
|
|
54
54
|
import {useSize} from '../SizeContext/SizeContext';
|
|
55
55
|
import {useButtonGroup} from '../ButtonGroup/ButtonGroupContext';
|
|
56
|
+
import {PressGroupContext} from '../hooks/pressGroupContext';
|
|
56
57
|
import {useInputGroup} from '../InputGroup/InputGroupContext';
|
|
57
58
|
import {InputGroupInternalContext} from '../InputGroup/InputGroupInternalContext';
|
|
58
59
|
import {
|
|
@@ -77,6 +78,12 @@ import {isRenderable} from '../utils/isRenderable';
|
|
|
77
78
|
|
|
78
79
|
registerEnglishFallback(english);
|
|
79
80
|
|
|
81
|
+
/**
|
|
82
|
+
* Written by the press controller or a group's tracker while a press is
|
|
83
|
+
* believed. Typed `string`, so StyleX reads it as a computed key.
|
|
84
|
+
*/
|
|
85
|
+
const PRESSED_ON: string = '[data-astryx-press="on"]';
|
|
86
|
+
|
|
80
87
|
/**
|
|
81
88
|
* Base button styles
|
|
82
89
|
* Pseudo-classes are nested within properties per StyleX recommendation:
|
|
@@ -138,7 +145,19 @@ const styles = stylex.create({
|
|
|
138
145
|
default: 'scale(0.98)',
|
|
139
146
|
'@media (pointer: coarse)': 'scale(1)',
|
|
140
147
|
},
|
|
141
|
-
|
|
148
|
+
[PRESSED_ON]: 'scale(0.98)',
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
// A tracked action's own `:active` image paints nothing: the tracker paints
|
|
152
|
+
// the action under the pointer, which need not be the one pressed first.
|
|
153
|
+
trackedOverlay: {
|
|
154
|
+
backgroundSize: {default: null, [`:active:not(${PRESSED_ON})`]: '0 0'},
|
|
155
|
+
},
|
|
156
|
+
// A tracked action's press is painted by its group's tracker alone.
|
|
157
|
+
pressableTracked: {
|
|
158
|
+
transform: {
|
|
159
|
+
default: 'scale(1)',
|
|
160
|
+
[PRESSED_ON]: 'scale(0.98)',
|
|
142
161
|
},
|
|
143
162
|
},
|
|
144
163
|
inactive: {
|
|
@@ -147,7 +166,7 @@ const styles = stylex.create({
|
|
|
147
166
|
transform: {
|
|
148
167
|
default: 'none',
|
|
149
168
|
':active': 'none',
|
|
150
|
-
|
|
169
|
+
[PRESSED_ON]: 'none',
|
|
151
170
|
},
|
|
152
171
|
},
|
|
153
172
|
disabled: {
|
|
@@ -160,7 +179,7 @@ const styles = stylex.create({
|
|
|
160
179
|
backgroundImage: {
|
|
161
180
|
default: 'none',
|
|
162
181
|
':active': 'none',
|
|
163
|
-
|
|
182
|
+
[PRESSED_ON]: 'none',
|
|
164
183
|
},
|
|
165
184
|
},
|
|
166
185
|
iconOnly: {
|
|
@@ -632,6 +651,7 @@ export function Button({
|
|
|
632
651
|
const t = useComponentTranslator();
|
|
633
652
|
const size = useSize(sizeProp, 'md');
|
|
634
653
|
const buttonGroup = useButtonGroup();
|
|
654
|
+
const isGroupTracked = use(PressGroupContext);
|
|
635
655
|
const inputGroup = useInputGroup();
|
|
636
656
|
|
|
637
657
|
const [isPending, startTransition] = useTransition();
|
|
@@ -760,11 +780,13 @@ export function Button({
|
|
|
760
780
|
sizeStyles[size],
|
|
761
781
|
isIconOnly && styles.iconOnly,
|
|
762
782
|
interactionOverlayStyles.backgroundImage,
|
|
783
|
+
isGroupTracked && styles.trackedOverlay,
|
|
763
784
|
buttonDisabled && styles.inactive,
|
|
764
785
|
isTrueDisabled && styles.disabled,
|
|
765
786
|
useAriaDisabled && styles.ariaDisabled,
|
|
766
787
|
renderAsLink && styles.link,
|
|
767
|
-
!buttonGroup &&
|
|
788
|
+
!buttonGroup &&
|
|
789
|
+
(isGroupTracked ? styles.pressableTracked : styles.pressable),
|
|
768
790
|
buttonGroup &&
|
|
769
791
|
(buttonGroup.orientation === 'horizontal'
|
|
770
792
|
? groupStyles.horizontal
|
|
@@ -151,6 +151,15 @@ export const docs = {
|
|
|
151
151
|
},
|
|
152
152
|
{className: 'astryx-checkbox-label'},
|
|
153
153
|
],
|
|
154
|
+
vars: [
|
|
155
|
+
{
|
|
156
|
+
name: '--_indicator-press-image',
|
|
157
|
+
description:
|
|
158
|
+
"The row's touch press image, handed down to a first-party indicator that paints its own press. Set from the press paint only while the row itself is pressed; only this row declares it.",
|
|
159
|
+
default: 'none',
|
|
160
|
+
private: true,
|
|
161
|
+
},
|
|
162
|
+
],
|
|
154
163
|
},
|
|
155
164
|
usage: {
|
|
156
165
|
accessibility: [
|
|
@@ -390,6 +399,15 @@ export const docsZh = {
|
|
|
390
399
|
},
|
|
391
400
|
{className: 'astryx-checkbox-label'},
|
|
392
401
|
],
|
|
402
|
+
vars: [
|
|
403
|
+
{
|
|
404
|
+
name: '--_indicator-press-image',
|
|
405
|
+
description:
|
|
406
|
+
'复选框行的触摸按下图像,传递给自行绘制按下效果的第一方指示器。仅在该行自身被按下时根据按下涂层设置,只有该行声明它。',
|
|
407
|
+
default: 'none',
|
|
408
|
+
private: true,
|
|
409
|
+
},
|
|
410
|
+
],
|
|
393
411
|
},
|
|
394
412
|
};
|
|
395
413
|
|