@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
package/locales/en.json
CHANGED
|
@@ -255,126 +255,6 @@
|
|
|
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
|
-
},
|
|
378
258
|
"@astryx.alertDialog.cancel": {
|
|
379
259
|
"defaultMessage": "Cancel",
|
|
380
260
|
"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,96 +191,6 @@
|
|
|
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
|
-
},
|
|
284
194
|
"@astryx.alertDialog.cancel": {
|
|
285
195
|
"defaultMessage": "⟦Çàñçéł⟧"
|
|
286
196
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astryxdesign/core",
|
|
3
|
-
"version": "0.7.7
|
|
3
|
+
"version": "0.7.7",
|
|
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,11 +824,6 @@
|
|
|
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
|
-
},
|
|
832
827
|
"./internal/touch": {
|
|
833
828
|
"source": "./src/internal/touch.ts",
|
|
834
829
|
"types": "./dist/internal/touch.d.ts",
|
|
@@ -870,9 +865,6 @@
|
|
|
870
865
|
"react-dom": ">=19.0.0"
|
|
871
866
|
},
|
|
872
867
|
"devDependencies": {
|
|
873
|
-
"@astryxdesign/a11y-spec": "0.7.7-canary.fc68123",
|
|
874
|
-
"@astryxdesign/cli": "0.7.7-canary.fc68123",
|
|
875
|
-
"@astryxdesign/interaction-harness": "0.7.7-canary.fc68123",
|
|
876
868
|
"@babel/cli": "^7.29.7",
|
|
877
869
|
"@babel/core": "^7.29.7",
|
|
878
870
|
"@babel/preset-react": "^7.29.7",
|
|
@@ -883,7 +875,10 @@
|
|
|
883
875
|
"@testing-library/jest-dom": "^6.6.0",
|
|
884
876
|
"@testing-library/react": "^16.3.2",
|
|
885
877
|
"@types/babel__core": "^7.20.5",
|
|
886
|
-
"tailwindcss": "^4.3.2"
|
|
878
|
+
"tailwindcss": "^4.3.2",
|
|
879
|
+
"@astryxdesign/a11y-spec": "0.0.0",
|
|
880
|
+
"@astryxdesign/interaction-harness": "0.0.0",
|
|
881
|
+
"@astryxdesign/cli": "0.7.7"
|
|
887
882
|
},
|
|
888
883
|
"dependencies": {
|
|
889
884
|
"intl-messageformat": "^11.2.9"
|
|
@@ -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\
|
|
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.',
|
|
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.
|
|
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.',
|
|
200
200
|
bestPractices: [
|
|
201
201
|
{
|
|
202
202
|
guidance: true,
|
|
@@ -4,9 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file AlertDialog.tsx
|
|
7
|
-
* @input Uses React, StyleX, Dialog, Layout, Heading, Text, Button
|
|
8
|
-
* action-group tracking (hooks/useActionGroupTracking) and the press-group
|
|
9
|
-
* marker (privateAttributes/pressGroupItem.stylex)
|
|
7
|
+
* @input Uses React, StyleX, Dialog, Layout, Heading, Text, Button
|
|
10
8
|
* @output Exports AlertDialog component, AlertDialogProps type
|
|
11
9
|
* @position Core implementation; consumed by index.ts, tested by AlertDialog.test.tsx
|
|
12
10
|
*
|
|
@@ -14,12 +12,11 @@
|
|
|
14
12
|
* - /packages/core/src/AlertDialog/AlertDialog.doc.mjs (props table, features, examples)
|
|
15
13
|
* - /packages/core/src/AlertDialog/AlertDialog.test.tsx (tests for new/changed behavior)
|
|
16
14
|
* - /packages/core/src/AlertDialog/index.ts (exports if types change)
|
|
17
|
-
* - /packages/core/src/AlertDialog/__tests__/AlertDialog.interaction.browser.spec.ts (touch tracking)
|
|
18
15
|
* - /apps/storybook/stories/AlertDialog.stories.tsx (storybook stories)
|
|
19
16
|
* - /packages/cli/assets/templates/blocks/components/AlertDialog/ (showcase blocks)
|
|
20
17
|
*/
|
|
21
18
|
|
|
22
|
-
import React, {useId, useCallback
|
|
19
|
+
import React, {useId, useCallback} from 'react';
|
|
23
20
|
import * as stylex from '@stylexjs/stylex';
|
|
24
21
|
import {Dialog} from '../Dialog/Dialog';
|
|
25
22
|
import {Layout} from '../Layout/Layout';
|
|
@@ -39,22 +36,12 @@ import {
|
|
|
39
36
|
useComponentTranslator,
|
|
40
37
|
} from '../i18n/useComponentTranslator';
|
|
41
38
|
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';
|
|
46
39
|
|
|
47
40
|
registerEnglishFallback(english);
|
|
48
41
|
|
|
49
42
|
const SMALL_SCREEN_QUERY = '(max-width: 640px)';
|
|
50
43
|
|
|
51
44
|
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
|
-
},
|
|
58
45
|
action: {
|
|
59
46
|
maxWidth: '100%',
|
|
60
47
|
minWidth: 0,
|
|
@@ -190,19 +177,6 @@ export function AlertDialog({
|
|
|
190
177
|
onOpenChange(false);
|
|
191
178
|
}, [onOpenChange]);
|
|
192
179
|
|
|
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
|
-
|
|
206
180
|
const buttonActionStyle = [
|
|
207
181
|
styles.action,
|
|
208
182
|
isSmallScreen && styles.stackedAction,
|
|
@@ -214,7 +188,6 @@ export function AlertDialog({
|
|
|
214
188
|
label={cancelLabel}
|
|
215
189
|
onClick={handleCancel}
|
|
216
190
|
xstyle={buttonActionStyle}
|
|
217
|
-
{...actionTrackingProps}
|
|
218
191
|
// Dialog focuses [data-autofocus] itself after showModal(), because
|
|
219
192
|
// React's autoFocus runs during commit while the dialog is invisible.
|
|
220
193
|
// Cancel is least destructive, so it remains the autofocus target even
|
|
@@ -230,7 +203,6 @@ export function AlertDialog({
|
|
|
230
203
|
onClick={onAction}
|
|
231
204
|
isLoading={isActionLoading}
|
|
232
205
|
xstyle={buttonActionStyle}
|
|
233
|
-
{...actionTrackingProps}
|
|
234
206
|
/>
|
|
235
207
|
);
|
|
236
208
|
|
|
@@ -272,17 +244,13 @@ export function AlertDialog({
|
|
|
272
244
|
destructive-above-Cancel narrow order because confirmation
|
|
273
245
|
actions have component-specific meaning here. */}
|
|
274
246
|
<Stack
|
|
275
|
-
ref={actionsRef}
|
|
276
|
-
xstyle={isTracking && styles.trackingRow}
|
|
277
247
|
direction={isSmallScreen ? 'vertical' : 'horizontal'}
|
|
278
248
|
gap={2}
|
|
279
249
|
hAlign={isSmallScreen ? 'stretch' : 'end'}
|
|
280
250
|
wrap={isSmallScreen ? 'nowrap' : 'wrap'}>
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
: [cancelButton, actionButton]}
|
|
285
|
-
</PressGroupContext>
|
|
251
|
+
{isSmallScreen
|
|
252
|
+
? [actionButton, cancelButton]
|
|
253
|
+
: [cancelButton, actionButton]}
|
|
286
254
|
</Stack>
|
|
287
255
|
</LayoutFooter>
|
|
288
256
|
}
|
|
@@ -255,10 +255,6 @@ const styles = stylex.create({
|
|
|
255
255
|
// surface behind the pill itself, fading out across the lower half so the
|
|
256
256
|
// content emerging below has no visible cut line.
|
|
257
257
|
backgroundImage: `linear-gradient(to bottom, ${colorVars['--color-background-surface']} 60%, transparent)`,
|
|
258
|
-
// WebKit can draw this bar under the scrolling body's own layer while the
|
|
259
|
-
// sheet's transform animates, so the pill vanishes until the sheet rests.
|
|
260
|
-
// A layer of its own keeps it above the body.
|
|
261
|
-
willChange: 'transform',
|
|
262
258
|
// Drags are the handle's; a pinch still zooms the page (WCAG 1.4.4).
|
|
263
259
|
touchAction: 'pinch-zoom',
|
|
264
260
|
cursor: {
|
|
@@ -422,7 +418,6 @@ function waitForTransition(
|
|
|
422
418
|
|
|
423
419
|
let done = false;
|
|
424
420
|
let timer: ReturnType<typeof setTimeout> | null = null;
|
|
425
|
-
let backstopMs = 0;
|
|
426
421
|
const finish = () => {
|
|
427
422
|
if (done) {
|
|
428
423
|
return;
|
|
@@ -436,24 +431,9 @@ function waitForTransition(
|
|
|
436
431
|
complete();
|
|
437
432
|
};
|
|
438
433
|
const handleTransitionEnd = (event: TransitionEvent) => {
|
|
439
|
-
if (event.target
|
|
440
|
-
|
|
441
|
-
}
|
|
442
|
-
// The engine cancels a transition whose end value changes mid-flight. A
|
|
443
|
-
// percentage transform does when the closing frame moves the height by a
|
|
444
|
-
// fraction of a pixel. A replacement runs on from where it was. That one
|
|
445
|
-
// ends the motion, not the cancel.
|
|
446
|
-
if (
|
|
447
|
-
event.type === 'transitioncancel' &&
|
|
448
|
-
hasRunningTransition(element, propertyName)
|
|
449
|
-
) {
|
|
450
|
-
if (timer != null) {
|
|
451
|
-
clearTimeout(timer);
|
|
452
|
-
timer = setTimeout(finish, backstopMs);
|
|
453
|
-
}
|
|
454
|
-
return;
|
|
434
|
+
if (event.target === element && event.propertyName === propertyName) {
|
|
435
|
+
finish();
|
|
455
436
|
}
|
|
456
|
-
finish();
|
|
457
437
|
};
|
|
458
438
|
element.addEventListener('transitionend', handleTransitionEnd);
|
|
459
439
|
element.addEventListener('transitioncancel', handleTransitionEnd);
|
|
@@ -504,8 +484,7 @@ function waitForTransition(
|
|
|
504
484
|
return () => {};
|
|
505
485
|
}
|
|
506
486
|
|
|
507
|
-
|
|
508
|
-
timer = setTimeout(finish, backstopMs);
|
|
487
|
+
timer = setTimeout(finish, transitionMs + TRANSITION_BACKSTOP_BUFFER_MS);
|
|
509
488
|
return () => {
|
|
510
489
|
if (timer != null) {
|
|
511
490
|
clearTimeout(timer);
|
|
@@ -515,19 +494,6 @@ function waitForTransition(
|
|
|
515
494
|
};
|
|
516
495
|
}
|
|
517
496
|
|
|
518
|
-
// Whether a CSS transition of `propertyName` still runs on `element`.
|
|
519
|
-
function hasRunningTransition(
|
|
520
|
-
element: HTMLElement,
|
|
521
|
-
propertyName: string,
|
|
522
|
-
): boolean {
|
|
523
|
-
return (element.getAnimations?.() ?? []).some(
|
|
524
|
-
animation =>
|
|
525
|
-
(animation as Animation & {transitionProperty?: string})
|
|
526
|
-
.transitionProperty === propertyName &&
|
|
527
|
-
(animation.playState === 'running' || animation.playState === 'paused'),
|
|
528
|
-
);
|
|
529
|
-
}
|
|
530
|
-
|
|
531
497
|
function parseTransitionTime(value: string): number | null {
|
|
532
498
|
const normalizedValue = value.trim();
|
|
533
499
|
if (!/^-?(?:\d+|\d*\.\d+)(?:ms|s)$/.test(normalizedValue)) {
|
|
@@ -738,9 +738,7 @@ export function useSheetGestures({
|
|
|
738
738
|
}
|
|
739
739
|
return;
|
|
740
740
|
}
|
|
741
|
-
|
|
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.
|
|
741
|
+
recordSheetHeight(node.getBoundingClientRect().height);
|
|
744
742
|
const ro = new ResizeObserver(entries => {
|
|
745
743
|
const entry = entries[0];
|
|
746
744
|
if (entry) {
|
package/src/Button/Button.tsx
CHANGED
|
@@ -53,7 +53,6 @@ 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';
|
|
57
56
|
import {useInputGroup} from '../InputGroup/InputGroupContext';
|
|
58
57
|
import {InputGroupInternalContext} from '../InputGroup/InputGroupInternalContext';
|
|
59
58
|
import {
|
|
@@ -78,12 +77,6 @@ import {isRenderable} from '../utils/isRenderable';
|
|
|
78
77
|
|
|
79
78
|
registerEnglishFallback(english);
|
|
80
79
|
|
|
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
|
-
|
|
87
80
|
/**
|
|
88
81
|
* Base button styles
|
|
89
82
|
* Pseudo-classes are nested within properties per StyleX recommendation:
|
|
@@ -145,19 +138,7 @@ const styles = stylex.create({
|
|
|
145
138
|
default: 'scale(0.98)',
|
|
146
139
|
'@media (pointer: coarse)': 'scale(1)',
|
|
147
140
|
},
|
|
148
|
-
[
|
|
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)',
|
|
141
|
+
'[data-astryx-press="on"]': 'scale(0.98)',
|
|
161
142
|
},
|
|
162
143
|
},
|
|
163
144
|
inactive: {
|
|
@@ -166,7 +147,7 @@ const styles = stylex.create({
|
|
|
166
147
|
transform: {
|
|
167
148
|
default: 'none',
|
|
168
149
|
':active': 'none',
|
|
169
|
-
[
|
|
150
|
+
'[data-astryx-press="on"]': 'none',
|
|
170
151
|
},
|
|
171
152
|
},
|
|
172
153
|
disabled: {
|
|
@@ -179,7 +160,7 @@ const styles = stylex.create({
|
|
|
179
160
|
backgroundImage: {
|
|
180
161
|
default: 'none',
|
|
181
162
|
':active': 'none',
|
|
182
|
-
[
|
|
163
|
+
'[data-astryx-press="on"]': 'none',
|
|
183
164
|
},
|
|
184
165
|
},
|
|
185
166
|
iconOnly: {
|
|
@@ -651,7 +632,6 @@ export function Button({
|
|
|
651
632
|
const t = useComponentTranslator();
|
|
652
633
|
const size = useSize(sizeProp, 'md');
|
|
653
634
|
const buttonGroup = useButtonGroup();
|
|
654
|
-
const isGroupTracked = use(PressGroupContext);
|
|
655
635
|
const inputGroup = useInputGroup();
|
|
656
636
|
|
|
657
637
|
const [isPending, startTransition] = useTransition();
|
|
@@ -780,13 +760,11 @@ export function Button({
|
|
|
780
760
|
sizeStyles[size],
|
|
781
761
|
isIconOnly && styles.iconOnly,
|
|
782
762
|
interactionOverlayStyles.backgroundImage,
|
|
783
|
-
isGroupTracked && styles.trackedOverlay,
|
|
784
763
|
buttonDisabled && styles.inactive,
|
|
785
764
|
isTrueDisabled && styles.disabled,
|
|
786
765
|
useAriaDisabled && styles.ariaDisabled,
|
|
787
766
|
renderAsLink && styles.link,
|
|
788
|
-
!buttonGroup &&
|
|
789
|
-
(isGroupTracked ? styles.pressableTracked : styles.pressable),
|
|
767
|
+
!buttonGroup && styles.pressable,
|
|
790
768
|
buttonGroup &&
|
|
791
769
|
(buttonGroup.orientation === 'horizontal'
|
|
792
770
|
? groupStyles.horizontal
|
|
@@ -151,15 +151,6 @@ 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
|
-
],
|
|
163
154
|
},
|
|
164
155
|
usage: {
|
|
165
156
|
accessibility: [
|
|
@@ -399,15 +390,6 @@ export const docsZh = {
|
|
|
399
390
|
},
|
|
400
391
|
{className: 'astryx-checkbox-label'},
|
|
401
392
|
],
|
|
402
|
-
vars: [
|
|
403
|
-
{
|
|
404
|
-
name: '--_indicator-press-image',
|
|
405
|
-
description:
|
|
406
|
-
'复选框行的触摸按下图像,传递给自行绘制按下效果的第一方指示器。仅在该行自身被按下时根据按下涂层设置,只有该行声明它。',
|
|
407
|
-
default: 'none',
|
|
408
|
-
private: true,
|
|
409
|
-
},
|
|
410
|
-
],
|
|
411
393
|
},
|
|
412
394
|
};
|
|
413
395
|
|