@astryxdesign/core 0.1.2-canary.eb7243a → 0.1.2-canary.f03e2cc
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/README.md +12 -12
- package/dist/Avatar/Avatar.d.ts.map +1 -1
- package/dist/Avatar/Avatar.js +5 -11
- package/dist/Breadcrumbs/BreadcrumbItem.d.ts +1 -1
- package/dist/Breadcrumbs/BreadcrumbItem.d.ts.map +1 -1
- package/dist/Breadcrumbs/BreadcrumbItem.js +5 -24
- package/dist/Calendar/Calendar.d.ts.map +1 -1
- package/dist/Calendar/Calendar.js +28 -43
- package/dist/Calendar/styles.d.ts +9 -3
- package/dist/Calendar/styles.d.ts.map +1 -1
- package/dist/Calendar/styles.js +11 -3
- package/dist/Carousel/Carousel.d.ts.map +1 -1
- package/dist/Carousel/Carousel.js +3 -17
- package/dist/Chat/ChatMessageList.d.ts +1 -14
- package/dist/Chat/ChatMessageList.d.ts.map +1 -1
- package/dist/Chat/ChatMessageList.js +0 -2
- package/dist/Chat/useTriggerMenu.d.ts.map +1 -1
- package/dist/Chat/useTriggerMenu.js +1 -4
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +2 -4
- package/dist/CheckboxList/CheckboxList.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxList.js +4 -12
- package/dist/CodeBlock/CodeBlock.d.ts.map +1 -1
- package/dist/CodeBlock/CodeBlock.js +37 -49
- package/dist/ContextMenu/ContextMenu.d.ts +5 -4
- package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/ContextMenu/ContextMenu.js +11 -93
- package/dist/DateInput/DateInput.d.ts.map +1 -1
- package/dist/DateInput/DateInput.js +2 -17
- package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
- package/dist/DateRangeInput/DateRangeInput.js +4 -9
- package/dist/DateTimeInput/DateTimeInput.d.ts +1 -7
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +3 -15
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +0 -12
- package/dist/DropdownMenu/DropdownMenu.d.ts +8 -1
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +14 -42
- package/dist/Field/Field.d.ts +2 -19
- package/dist/Field/Field.d.ts.map +1 -1
- package/dist/Field/Field.js +0 -4
- package/dist/Field/FieldLabel.d.ts +2 -21
- package/dist/Field/FieldLabel.d.ts.map +1 -1
- package/dist/Field/FieldLabel.js +26 -41
- package/dist/FileInput/FileInput.d.ts.map +1 -1
- package/dist/FileInput/FileInput.js +6 -27
- package/dist/InputGroup/InputGroup.d.ts.map +1 -1
- package/dist/InputGroup/InputGroup.js +1 -4
- package/dist/Kbd/Kbd.d.ts.map +1 -1
- package/dist/Kbd/Kbd.js +1 -33
- package/dist/Layer/layerAnimations.stylex.d.ts +0 -4
- package/dist/Layer/layerAnimations.stylex.d.ts.map +1 -1
- package/dist/Layer/layerAnimations.stylex.js +4 -8
- package/dist/Layer/useLayer.d.ts +0 -10
- package/dist/Layer/useLayer.d.ts.map +1 -1
- package/dist/Layer/useLayer.js +6 -41
- package/dist/Layout/padding.stylex.d.ts +0 -51
- package/dist/Layout/padding.stylex.d.ts.map +1 -1
- package/dist/Layout/padding.stylex.js +0 -63
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +2 -4
- package/dist/Link/Link.d.ts +1 -7
- package/dist/Link/Link.d.ts.map +1 -1
- package/dist/Link/Link.js +7 -15
- package/dist/Markdown/Markdown.d.ts.map +1 -1
- package/dist/Markdown/Markdown.js +0 -5
- package/dist/MoreMenu/MoreMenu.d.ts +7 -1
- package/dist/MoreMenu/MoreMenu.d.ts.map +1 -1
- package/dist/MoreMenu/MoreMenu.js +2 -0
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +17 -73
- package/dist/MultiSelector/hooks.d.ts +1 -12
- package/dist/MultiSelector/hooks.d.ts.map +1 -1
- package/dist/MultiSelector/hooks.js +1 -14
- package/dist/NavMenu/NavHeadingMenu.d.ts.map +1 -1
- package/dist/NavMenu/NavHeadingMenu.js +3 -34
- package/dist/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/NumberInput/NumberInput.js +1 -7
- package/dist/Pagination/Pagination.d.ts +1 -1
- package/dist/Pagination/Pagination.d.ts.map +1 -1
- package/dist/Pagination/Pagination.js +1 -15
- package/dist/Popover/usePopover.d.ts +2 -25
- package/dist/Popover/usePopover.d.ts.map +1 -1
- package/dist/Popover/usePopover.js +6 -18
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +1 -4
- package/dist/ProgressBar/ProgressBar.js +1 -1
- package/dist/RadioList/RadioList.d.ts +1 -1
- package/dist/RadioList/RadioList.d.ts.map +1 -1
- package/dist/RadioList/RadioList.js +3 -76
- package/dist/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControl.js +0 -22
- package/dist/SegmentedControl/SegmentedControlItem.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControlItem.js +2 -6
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +18 -54
- package/dist/Selector/hooks.d.ts +1 -8
- package/dist/Selector/hooks.d.ts.map +1 -1
- package/dist/Selector/hooks.js +1 -14
- package/dist/SideNav/SideNavItem.d.ts.map +1 -1
- package/dist/SideNav/SideNavItem.js +1 -1
- package/dist/Skeleton/Skeleton.d.ts.map +1 -1
- package/dist/Skeleton/Skeleton.js +2 -8
- package/dist/Spinner/Spinner.d.ts.map +1 -1
- package/dist/Spinner/Spinner.js +1 -1
- package/dist/Stack/Stack.d.ts +1 -28
- package/dist/Stack/Stack.d.ts.map +1 -1
- package/dist/Stack/Stack.js +1 -17
- package/dist/Stack/StackItem.d.ts +1 -12
- package/dist/Stack/StackItem.d.ts.map +1 -1
- package/dist/Stack/StackItem.js +1 -8
- package/dist/TabList/Tab.d.ts.map +1 -1
- package/dist/TabList/Tab.js +0 -6
- package/dist/TabList/TabList.d.ts +4 -15
- package/dist/TabList/TabList.d.ts.map +1 -1
- package/dist/TabList/TabList.js +4 -58
- package/dist/TabList/TabListContext.d.ts +0 -5
- package/dist/TabList/TabListContext.d.ts.map +1 -1
- package/dist/TabList/TabListContext.js +0 -5
- package/dist/TabList/TabMenu.d.ts.map +1 -1
- package/dist/TabList/TabMenu.js +1 -6
- package/dist/Table/Table.d.ts.map +1 -1
- package/dist/Table/Table.js +1 -7
- package/dist/Table/plugins/pagination/paginateData.d.ts +1 -2
- package/dist/Table/plugins/pagination/paginateData.d.ts.map +1 -1
- package/dist/Table/plugins/pagination/paginateData.js +3 -8
- package/dist/Table/plugins/pagination/useTablePagination.d.ts.map +1 -1
- package/dist/Table/plugins/pagination/useTablePagination.js +1 -6
- package/dist/Table/tableContextMenu.d.ts.map +1 -1
- package/dist/Table/tableContextMenu.js +3 -0
- package/dist/Toast/Toast.d.ts.map +1 -1
- package/dist/Toast/Toast.js +0 -14
- package/dist/Toast/ToastViewport.d.ts.map +1 -1
- package/dist/Toast/ToastViewport.js +3 -132
- package/dist/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/Toolbar/Toolbar.js +3 -7
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +9 -56
- package/dist/TreeList/TreeList.d.ts +1 -1
- package/dist/TreeList/TreeList.d.ts.map +1 -1
- package/dist/TreeList/TreeList.js +2 -78
- package/dist/TreeList/TreeListItem.d.ts +1 -10
- package/dist/TreeList/TreeListItem.d.ts.map +1 -1
- package/dist/TreeList/TreeListItem.js +12 -51
- package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.js +4 -58
- package/dist/astryx.css +0 -7
- package/dist/astryx.umd.js +48 -48
- package/dist/astryx.umd.js.map +4 -4
- package/dist/hooks/index.d.ts +2 -10
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +2 -6
- package/dist/hooks/useClickableContainer.d.ts +1 -16
- package/dist/hooks/useClickableContainer.d.ts.map +1 -1
- package/dist/hooks/useClickableContainer.js +4 -16
- package/dist/hooks/useEntryAnimation.d.ts.map +1 -1
- package/dist/hooks/useEntryAnimation.js +4 -4
- package/dist/hooks/useFocusTrap.d.ts +0 -18
- package/dist/hooks/useFocusTrap.d.ts.map +1 -1
- package/dist/hooks/useFocusTrap.js +3 -87
- package/dist/hooks/useGridFocus.d.ts +1 -32
- package/dist/hooks/useGridFocus.d.ts.map +1 -1
- package/dist/hooks/useGridFocus.js +58 -143
- package/dist/hooks/useListFocus.d.ts +7 -78
- package/dist/hooks/useListFocus.d.ts.map +1 -1
- package/dist/hooks/useListFocus.js +52 -305
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/utils/index.d.ts +0 -2
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +0 -1
- package/package.json +5 -11
- package/src/Avatar/Avatar.tsx +5 -10
- package/src/Breadcrumbs/BreadcrumbItem.tsx +7 -25
- package/src/Breadcrumbs/Breadcrumbs.test.tsx +10 -31
- package/src/Calendar/Calendar.doc.mjs +1 -1
- package/src/Calendar/Calendar.test.tsx +4 -147
- package/src/Calendar/Calendar.tsx +43 -52
- package/src/Calendar/styles.ts +9 -4
- package/src/Carousel/Carousel.test.tsx +0 -20
- package/src/Carousel/Carousel.tsx +1 -16
- package/src/Chat/ChatMessageList.doc.mjs +0 -8
- package/src/Chat/ChatMessageList.test.tsx +0 -18
- package/src/Chat/ChatMessageList.tsx +0 -16
- package/src/Chat/useTriggerMenu.tsx +0 -3
- package/src/CheckboxInput/CheckboxInput.test.tsx +25 -14
- package/src/CheckboxInput/CheckboxInput.tsx +2 -4
- package/src/CheckboxList/CheckboxList.test.tsx +14 -30
- package/src/CheckboxList/CheckboxList.tsx +3 -18
- package/src/CodeBlock/CodeBlock.tsx +33 -61
- package/src/ContextMenu/ContextMenu.doc.mjs +4 -4
- package/src/ContextMenu/ContextMenu.test.tsx +1 -155
- package/src/ContextMenu/ContextMenu.tsx +16 -113
- package/src/DateInput/DateInput.test.tsx +0 -59
- package/src/DateInput/DateInput.tsx +7 -24
- package/src/DateRangeInput/DateRangeInput.test.tsx +18 -69
- package/src/DateRangeInput/DateRangeInput.tsx +3 -7
- package/src/DateTimeInput/DateTimeInput.doc.mjs +0 -7
- package/src/DateTimeInput/DateTimeInput.test.tsx +6 -99
- package/src/DateTimeInput/DateTimeInput.tsx +3 -32
- package/src/Dialog/Dialog.tsx +0 -12
- package/src/DropdownMenu/DropdownMenu.doc.mjs +8 -1
- package/src/DropdownMenu/DropdownMenu.test.tsx +42 -56
- package/src/DropdownMenu/DropdownMenu.tsx +18 -52
- package/src/Field/Field.test.tsx +0 -32
- package/src/Field/Field.tsx +5 -23
- package/src/Field/FieldLabel.tsx +17 -55
- package/src/FileInput/FileInput.test.tsx +49 -104
- package/src/FileInput/FileInput.tsx +3 -27
- package/src/InputGroup/InputGroup.test.tsx +63 -21
- package/src/InputGroup/InputGroup.tsx +1 -4
- package/src/Kbd/Kbd.test.tsx +4 -22
- package/src/Kbd/Kbd.tsx +3 -35
- package/src/Layer/layerAnimations.stylex.ts +4 -20
- package/src/Layer/useLayer.doc.mjs +0 -5
- package/src/Layer/useLayer.tsx +6 -67
- package/src/Layout/padding.stylex.ts +0 -52
- package/src/Lightbox/Lightbox.test.tsx +5 -53
- package/src/Lightbox/Lightbox.tsx +4 -9
- package/src/Link/Link.doc.mjs +0 -14
- package/src/Link/Link.test.tsx +0 -32
- package/src/Link/Link.tsx +4 -41
- package/src/Markdown/Markdown.test.tsx +0 -11
- package/src/Markdown/Markdown.tsx +0 -5
- package/src/MetadataList/MetadataListItem.doc.mjs +0 -4
- package/src/MoreMenu/MoreMenu.doc.mjs +17 -2
- package/src/MoreMenu/MoreMenu.tsx +9 -0
- package/src/MultiSelector/MultiSelector.test.tsx +8 -226
- package/src/MultiSelector/MultiSelector.tsx +19 -91
- package/src/MultiSelector/hooks.ts +0 -27
- package/src/NavMenu/NavHeadingMenu.test.tsx +1 -77
- package/src/NavMenu/NavHeadingMenu.tsx +3 -50
- package/src/NumberInput/NumberInput.test.tsx +38 -72
- package/src/NumberInput/NumberInput.tsx +1 -12
- package/src/Pagination/Pagination.doc.mjs +3 -3
- package/src/Pagination/Pagination.test.tsx +5 -117
- package/src/Pagination/Pagination.tsx +1 -21
- package/src/Popover/usePopover.doc.mjs +3 -7
- package/src/Popover/usePopover.tsx +6 -49
- package/src/PowerSearch/PowerSearch.tsx +0 -3
- package/src/ProgressBar/ProgressBar.test.tsx +26 -34
- package/src/ProgressBar/ProgressBar.tsx +1 -1
- package/src/RadioList/RadioList.test.tsx +14 -129
- package/src/RadioList/RadioList.tsx +8 -103
- package/src/SegmentedControl/SegmentedControl.test.tsx +40 -84
- package/src/SegmentedControl/SegmentedControl.tsx +0 -26
- package/src/SegmentedControl/SegmentedControlItem.tsx +1 -4
- package/src/SelectableCard/SelectableCard.doc.mjs +1 -1
- package/src/Selector/Selector.test.tsx +14 -199
- package/src/Selector/Selector.tsx +38 -74
- package/src/Selector/hooks.ts +0 -23
- package/src/SideNav/SideNav.test.tsx +0 -16
- package/src/SideNav/SideNavItem.tsx +4 -2
- package/src/Skeleton/Skeleton.tsx +1 -11
- package/src/Spinner/Spinner.tsx +1 -7
- package/src/Stack/Stack.doc.mjs +0 -57
- package/src/Stack/Stack.test.tsx +5 -55
- package/src/Stack/Stack.tsx +1 -53
- package/src/Stack/StackItem.test.tsx +0 -23
- package/src/Stack/StackItem.tsx +0 -20
- package/src/TabList/Tab.tsx +0 -6
- package/src/TabList/TabList.doc.mjs +0 -6
- package/src/TabList/TabList.test.tsx +0 -167
- package/src/TabList/TabList.tsx +9 -72
- package/src/TabList/TabListContext.ts +3 -7
- package/src/TabList/TabMenu.tsx +3 -6
- package/src/Table/Table.test.tsx +0 -10
- package/src/Table/Table.tsx +0 -5
- package/src/Table/plugins/pagination/paginateData.ts +3 -10
- package/src/Table/plugins/pagination/useTablePagination.test.tsx +0 -16
- package/src/Table/plugins/pagination/useTablePagination.tsx +1 -8
- package/src/Table/tableContextMenu.tsx +5 -1
- package/src/Toast/Toast.tsx +0 -14
- package/src/Toast/ToastViewport.tsx +21 -167
- package/src/Toolbar/Toolbar.test.tsx +0 -45
- package/src/Toolbar/Toolbar.tsx +2 -5
- package/src/Tooltip/Tooltip.test.tsx +0 -68
- package/src/Tooltip/useTooltip.tsx +8 -55
- package/src/TreeList/TreeList.test.tsx +6 -295
- package/src/TreeList/TreeList.tsx +1 -84
- package/src/TreeList/TreeListItem.tsx +5 -50
- package/src/Typeahead/BaseTypeahead.tsx +8 -69
- package/src/Typeahead/Typeahead.test.tsx +0 -160
- package/src/hooks/index.ts +2 -21
- package/src/hooks/useClickableContainer.ts +4 -16
- package/src/hooks/useEntryAnimation.ts +4 -16
- package/src/hooks/useFocusTrap.ts +4 -98
- package/src/hooks/useGridFocus.ts +64 -184
- package/src/hooks/useListFocus.doc.mjs +10 -49
- package/src/hooks/useListFocus.ts +57 -395
- package/src/index.ts +0 -1
- package/src/utils/index.ts +0 -7
- package/dist/TreeList/treeListItem.markers.stylex.d.ts +0 -16
- package/dist/TreeList/treeListItem.markers.stylex.d.ts.map +0 -1
- package/dist/TreeList/treeListItem.markers.stylex.js +0 -22
- package/dist/VisuallyHidden/VisuallyHidden.d.ts +0 -61
- package/dist/VisuallyHidden/VisuallyHidden.d.ts.map +0 -1
- package/dist/VisuallyHidden/VisuallyHidden.js +0 -65
- package/dist/VisuallyHidden/index.d.ts +0 -11
- package/dist/VisuallyHidden/index.d.ts.map +0 -1
- package/dist/VisuallyHidden/index.js +0 -13
- package/dist/hooks/focusableSelector.d.ts +0 -22
- package/dist/hooks/focusableSelector.d.ts.map +0 -1
- package/dist/hooks/focusableSelector.js +0 -24
- package/dist/hooks/useAnnounce.d.ts +0 -40
- package/dist/hooks/useAnnounce.d.ts.map +0 -1
- package/dist/hooks/useAnnounce.js +0 -142
- package/dist/hooks/useLongPress.d.ts +0 -21
- package/dist/hooks/useLongPress.d.ts.map +0 -1
- package/dist/hooks/useLongPress.js +0 -89
- package/dist/hooks/useTreeFocus.d.ts +0 -133
- package/dist/hooks/useTreeFocus.d.ts.map +0 -1
- package/dist/hooks/useTreeFocus.js +0 -274
- package/dist/hooks/useTypeahead.d.ts +0 -63
- package/dist/hooks/useTypeahead.d.ts.map +0 -1
- package/dist/hooks/useTypeahead.js +0 -117
- package/src/Avatar/Avatar.test.tsx +0 -37
- package/src/CodeBlock/CodeBlock.test.tsx +0 -115
- package/src/Skeleton/Skeleton.test.tsx +0 -25
- package/src/Toast/ToastViewport.test.tsx +0 -204
- package/src/TreeList/treeListItem.markers.stylex.ts +0 -20
- package/src/VisuallyHidden/VisuallyHidden.doc.mjs +0 -80
- package/src/VisuallyHidden/VisuallyHidden.test.tsx +0 -76
- package/src/VisuallyHidden/VisuallyHidden.tsx +0 -113
- package/src/VisuallyHidden/index.ts +0 -15
- package/src/hooks/focusableSelector.ts +0 -25
- package/src/hooks/useAnnounce.test.tsx +0 -101
- package/src/hooks/useAnnounce.ts +0 -168
- package/src/hooks/useFocusTrap.test.tsx +0 -132
- package/src/hooks/useListFocus.test.tsx +0 -375
- package/src/hooks/useLongPress.test.tsx +0 -134
- package/src/hooks/useLongPress.ts +0 -119
- package/src/hooks/useTreeFocus.doc.mjs +0 -126
- package/src/hooks/useTreeFocus.test.tsx +0 -214
- package/src/hooks/useTreeFocus.ts +0 -464
- package/src/hooks/useTypeahead.test.tsx +0 -109
- package/src/hooks/useTypeahead.ts +0 -183
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabListContext.d.ts","sourceRoot":"","sources":["../../src/TabList/TabListContext.ts"],"names":[],"mappings":"AAeA;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE7C;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,MAAM,CAAC;AAE3C
|
|
1
|
+
{"version":3,"file":"TabListContext.d.ts","sourceRoot":"","sources":["../../src/TabList/TabListContext.ts"],"names":[],"mappings":"AAeA;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE7C;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,MAAM,CAAC;AAE3C;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,IAAI,EAAE,WAAW,CAAC;IAClB,MAAM,EAAE,aAAa,CAAC;CACvB;AAED,eAAO,MAAM,cAAc,qDAE1B,CAAC;AAGF;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,mBAAmB,CASvD"}
|
|
@@ -23,11 +23,6 @@ import { createContext, use } from 'react';
|
|
|
23
23
|
* - `'fill'`: tabs stretch equally to fill the container width.
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
|
-
/**
|
|
27
|
-
* Orientation of the tab strip. Controls which arrow keys move focus
|
|
28
|
-
* between tabs and the reported `aria-orientation`.
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
26
|
/**
|
|
32
27
|
* Context for communicating value/onChange/size/layout from TabList to children.
|
|
33
28
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabMenu.d.ts","sourceRoot":"","sources":["../../src/TabList/TabMenu.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,EAAqB,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAGhE,OAAO,EAAiB,KAAK,QAAQ,E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E,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACnC;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,OAAO,EAAE,aAAa,EAAE,CAAC;CAC1B;AA8KD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,OAAO,CAAC,EACtB,GAAG,EACH,KAAK,EACL,OAAO,EACP,MAAM,EACN,SAAS,EACT,KAAK,GACN,EAAE,YAAY,qBA8Id;yBArJe,OAAO"}
|
package/dist/TabList/TabMenu.js
CHANGED
|
@@ -138,10 +138,7 @@ export function TabMenu({
|
|
|
138
138
|
const popover = usePopover({
|
|
139
139
|
hasLightDismiss: true,
|
|
140
140
|
hasCloseButton: false,
|
|
141
|
-
hasAutoFocus: false
|
|
142
|
-
// The popup's own role="menu" is the exposed semantics; a modal dialog
|
|
143
|
-
// wrapper would announce an unnamed dialog around the menu.
|
|
144
|
-
role: 'none'
|
|
141
|
+
hasAutoFocus: false
|
|
145
142
|
});
|
|
146
143
|
const {
|
|
147
144
|
listRef,
|
|
@@ -172,8 +169,6 @@ export function TabMenu({
|
|
|
172
169
|
"aria-haspopup": "menu",
|
|
173
170
|
"aria-expanded": popover.isOpen,
|
|
174
171
|
"aria-controls": menuId,
|
|
175
|
-
"data-tab-menu": "",
|
|
176
|
-
tabIndex: hasSelectedOption ? 0 : -1,
|
|
177
172
|
onClick: handleToggle,
|
|
178
173
|
...mergeProps(themeProps('tab-menu'), stylex.props(styles.trigger, sizeStyles[size], hasSelectedOption && styles.triggerSelected, tabScope, xstyle), className, style),
|
|
179
174
|
children: [/*#__PURE__*/_jsx("span", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../src/Table/Table.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAU,KAAK,YAAY,EAAE,KAAK,GAAG,EAAC,MAAM,OAAO,CAAC;AAQ3D,OAAO,KAAK,EACV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/*#__PURE__*/_jsxs("div", {
|
|
83
|
-
ref: ref
|
|
84
|
-
// Keyboard-focusable so keyboard users can scroll a horizontally
|
|
85
|
-
// overflowing table. Callers may override role/aria-label via htmlProps.
|
|
86
|
-
,
|
|
87
|
-
tabIndex: 0,
|
|
88
|
-
role: "region",
|
|
89
|
-
"aria-label": "Table",
|
|
83
|
+
ref: ref,
|
|
90
84
|
...restHtmlProps,
|
|
91
85
|
...mergeProps(themeProps('table-scroll-wrapper'), stylex.props(scrollWrapperStyles.base, scrollWrapperStyles.containerBleed, ...(pluginStyles ?? []))),
|
|
92
86
|
children: [beforeTable, children, afterTable]
|
|
@@ -12,8 +12,7 @@
|
|
|
12
12
|
*
|
|
13
13
|
* @param data - Full data array
|
|
14
14
|
* @param page - Current page number (1-based)
|
|
15
|
-
* @param pageSize - Number of items per page
|
|
16
|
-
* non-finite values fall back to 10
|
|
15
|
+
* @param pageSize - Number of items per page
|
|
17
16
|
* @returns Slice of data for the current page
|
|
18
17
|
*
|
|
19
18
|
* @example
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paginateData.d.ts","sourceRoot":"","sources":["../../../../src/Table/plugins/pagination/paginateData.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH
|
|
1
|
+
{"version":3,"file":"paginateData.d.ts","sourceRoot":"","sources":["../../../../src/Table/plugins/pagination/paginateData.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAC5B,IAAI,EAAE,CAAC,EAAE,EACT,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,GACf,CAAC,EAAE,CAGL"}
|
|
@@ -15,8 +15,7 @@
|
|
|
15
15
|
*
|
|
16
16
|
* @param data - Full data array
|
|
17
17
|
* @param page - Current page number (1-based)
|
|
18
|
-
* @param pageSize - Number of items per page
|
|
19
|
-
* non-finite values fall back to 10
|
|
18
|
+
* @param pageSize - Number of items per page
|
|
20
19
|
* @returns Slice of data for the current page
|
|
21
20
|
*
|
|
22
21
|
* @example
|
|
@@ -28,10 +27,6 @@
|
|
|
28
27
|
* ```
|
|
29
28
|
*/
|
|
30
29
|
export function paginateData(data, page, pageSize) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
// renders page buttons.
|
|
34
|
-
const size = Number.isFinite(pageSize) ? Math.max(1, Math.floor(pageSize)) : 10;
|
|
35
|
-
const start = (page - 1) * size;
|
|
36
|
-
return data.slice(start, start + size);
|
|
30
|
+
const start = (page - 1) * pageSize;
|
|
31
|
+
return data.slice(start, start + pageSize);
|
|
37
32
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTablePagination.d.ts","sourceRoot":"","sources":["../../../../src/Table/plugins/pagination/useTablePagination.tsx"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,aAAa,CAAC;AA+B7C;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,wBAAwB;IAGvC,qCAAqC;IACrC,IAAI,EAAE,MAAM,CAAC;IAEb,sEAAsE;IACtE,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAIrC;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAIlB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAE9C;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAI3B;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;IAE1D;;;OAGG;IACH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;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAEnB;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;IAE/C;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IAInC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAMD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClE,MAAM,EAAE,wBAAwB,GAC/B,WAAW,CAAC,CAAC,CAAC,CA0FhB"}
|
|
@@ -104,7 +104,7 @@ export function useTablePagination(config) {
|
|
|
104
104
|
totalItems,
|
|
105
105
|
totalPages: totalPagesProp,
|
|
106
106
|
hasMore,
|
|
107
|
-
pageSize
|
|
107
|
+
pageSize = 10,
|
|
108
108
|
onPageSizeChange,
|
|
109
109
|
pageSizeOptions,
|
|
110
110
|
variant = 'pages',
|
|
@@ -113,11 +113,6 @@ export function useTablePagination(config) {
|
|
|
113
113
|
align = 'center',
|
|
114
114
|
label = 'Table pagination'
|
|
115
115
|
} = config;
|
|
116
|
-
|
|
117
|
-
// Same guard as Pagination itself: 0/NaN/negative pageSize would produce an
|
|
118
|
-
// Infinity/NaN totalPages here, which bypasses Pagination's own coercion
|
|
119
|
-
// because it is passed down as the explicit totalPages prop.
|
|
120
|
-
const pageSize = Number.isFinite(pageSizeConfig) ? Math.max(1, Math.floor(pageSizeConfig)) : 10;
|
|
121
116
|
const computedTotalPages = totalPagesProp ?? (totalItems != null ? Math.ceil(totalItems / pageSize) : undefined);
|
|
122
117
|
|
|
123
118
|
// Build Pagination props
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tableContextMenu.d.ts","sourceRoot":"","sources":["../../src/Table/tableContextMenu.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AAEH,OAAO,EAAW,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAG/C,OAAO,KAAK,EAAC,kBAAkB,EAAE,mBAAmB,EAAC,MAAM,SAAS,CAAC;AAErE;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,mBAAmB,GAAG,SAAS,GACvC,kBAAkB,EAAE,CAKtB;
|
|
1
|
+
{"version":3,"file":"tableContextMenu.d.ts","sourceRoot":"","sources":["../../src/Table/tableContextMenu.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AAEH,OAAO,EAAW,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAG/C,OAAO,KAAK,EAAC,kBAAkB,EAAE,mBAAmB,EAAC,MAAM,SAAS,CAAC;AAErE;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,mBAAmB,GAAG,SAAS,GACvC,kBAAkB,EAAE,CAKtB;AAiFD;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,SAAS,EAClB,OAAO,EAAE,mBAAmB,GAAG,SAAS,GACvC,SAAS,CAgBX"}
|
|
@@ -98,6 +98,7 @@ function LazyTableContextMenu({
|
|
|
98
98
|
const [options, setOptions] = useState(null);
|
|
99
99
|
return /*#__PURE__*/_jsx(ContextMenu, {
|
|
100
100
|
items: options ?? [],
|
|
101
|
+
hasAutoFocus: false,
|
|
101
102
|
onOpenChange: open => {
|
|
102
103
|
// Resolve actions when opening; clear on close so state derived later
|
|
103
104
|
// (e.g. current sort direction) is always fresh next open.
|
|
@@ -124,10 +125,12 @@ export function wrapInTableContextMenu(element, actions) {
|
|
|
124
125
|
if (!actions || actions.length === 0) {
|
|
125
126
|
return element;
|
|
126
127
|
}
|
|
128
|
+
// hasAutoFocus={false}: a right-click menu shouldn't pre-highlight the first
|
|
127
129
|
// item (it looked like "ascending" was always selected). Focus moves only
|
|
128
130
|
// when the user arrow-keys into the menu.
|
|
129
131
|
return /*#__PURE__*/_jsx(ContextMenu, {
|
|
130
132
|
items: toContextMenuOptions(actions),
|
|
133
|
+
hasAutoFocus: false,
|
|
131
134
|
children: element
|
|
132
135
|
});
|
|
133
136
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../../src/Toast/Toast.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAiBrC,OAAO,KAAK,EAAC,SAAS,EAAE,kBAAkB,EAAC,MAAM,SAAS,CAAC;AAyD3D,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE,SAAS,CAAC;IAChB,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,UAAU,EAAE,OAAO,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAC;CACjD;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,KAAK,CAAC,EACpB,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,SAAiB,EACjB,SAAS,GACV,EAAE,UAAU,+
|
|
1
|
+
{"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../../src/Toast/Toast.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAiBrC,OAAO,KAAK,EAAC,SAAS,EAAE,kBAAkB,EAAC,MAAM,SAAS,CAAC;AAyD3D,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE,SAAS,CAAC;IAChB,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,UAAU,EAAE,OAAO,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAC;CACjD;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,KAAK,CAAC,EACpB,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,SAAiB,EACjB,SAAS,GACV,EAAE,UAAU,+BAmGZ;yBA3Ge,KAAK"}
|
package/dist/Toast/Toast.js
CHANGED
|
@@ -88,20 +88,6 @@ export function Toast({
|
|
|
88
88
|
}
|
|
89
89
|
};
|
|
90
90
|
}, [autoHideDuration, startTimer]);
|
|
91
|
-
|
|
92
|
-
// Pause the auto-hide timer while the window is not focused, so a toast
|
|
93
|
-
// doesn't silently expire while the user is in another window or tab.
|
|
94
|
-
useEffect(() => {
|
|
95
|
-
if (!isAutoHide) {
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
window.addEventListener('blur', pauseTimer);
|
|
99
|
-
window.addEventListener('focus', resumeTimer);
|
|
100
|
-
return () => {
|
|
101
|
-
window.removeEventListener('blur', pauseTimer);
|
|
102
|
-
window.removeEventListener('focus', resumeTimer);
|
|
103
|
-
};
|
|
104
|
-
}, [isAutoHide, pauseTimer, resumeTimer]);
|
|
105
91
|
const handleDismiss = useCallback(() => {
|
|
106
92
|
onDismiss('manual');
|
|
107
93
|
}, [onDismiss]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToastViewport.d.ts","sourceRoot":"","sources":["../../src/Toast/ToastViewport.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ToastViewport.d.ts","sourceRoot":"","sources":["../../src/Toast/ToastViewport.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAEV,aAAa,EAEd,MAAM,SAAS,CAAC;AA2DjB,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAC,CAAC;IACtE;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,EAC5B,QAAsB,EACtB,UAAc,EACd,KAAK,EACL,UAAiB,EACjB,QAAQ,GACT,EAAE,kBAAkB,+BAuJpB;yBA7Je,aAAa"}
|
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
'use client';
|
|
4
4
|
|
|
5
|
-
import { useCallback, useEffect,
|
|
5
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
6
6
|
import * as stylex from '@stylexjs/stylex';
|
|
7
7
|
import "../theme/tokens.stylex.js";
|
|
8
8
|
import { spacingVars, durationVars, easeVars } from "../theme/tokens.stylex.js";
|
|
9
9
|
import { mergeProps } from "../utils/index.js";
|
|
10
|
-
import { INTERACTIVE_SELECTORS } from "../hooks/useClickableContainer.js";
|
|
11
10
|
import { Toast } from "./Toast.js";
|
|
12
11
|
import { ToastContext } from "./ToastContext.js";
|
|
13
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -75,39 +74,6 @@ export function ToastViewport({
|
|
|
75
74
|
const [exitingIds, setExitingIds] = useState(new Set());
|
|
76
75
|
const toastsRef = useRef(toasts);
|
|
77
76
|
toastsRef.current = toasts;
|
|
78
|
-
|
|
79
|
-
// Show the popover on mount so it enters the top layer.
|
|
80
|
-
const viewportRef = useRef(null);
|
|
81
|
-
// The element that was focused before the user jumped into the viewport
|
|
82
|
-
// (via F6). Used to restore focus once all toasts are dismissed so focus
|
|
83
|
-
// never falls to <body>.
|
|
84
|
-
const prevFocusRef = useRef(null);
|
|
85
|
-
// When a toast is dismissed while focus lives inside it, we need to move
|
|
86
|
-
// focus to a sensible neighbor after that toast unmounts. This holds the
|
|
87
|
-
// id of the toast whose removal should trigger a focus handoff.
|
|
88
|
-
const focusHandoffIdRef = useRef(null);
|
|
89
|
-
// The next toast id that should receive focus once the dismissed toast has
|
|
90
|
-
// unmounted, or 'restore' to fall back to the previously-focused element.
|
|
91
|
-
const pendingFocusRef = useRef(null);
|
|
92
|
-
|
|
93
|
-
// Collect a focusable control within a toast node, if any.
|
|
94
|
-
// Reuses the canonical INTERACTIVE_SELECTORS list (native controls plus
|
|
95
|
-
// role-based interactive elements) instead of a hand-rolled subset, then
|
|
96
|
-
// narrows to the first candidate that can actually receive focus —
|
|
97
|
-
// excluding elements opted out with `tabindex="-1"` and disabled controls.
|
|
98
|
-
const getFocusable = useCallback(container => {
|
|
99
|
-
if (!container) {
|
|
100
|
-
return null;
|
|
101
|
-
}
|
|
102
|
-
const candidates = container.querySelectorAll(INTERACTIVE_SELECTORS);
|
|
103
|
-
for (const candidate of candidates) {
|
|
104
|
-
if (candidate.getAttribute('tabindex') === '-1' || candidate.hasAttribute('disabled') || candidate.getAttribute('aria-disabled') === 'true') {
|
|
105
|
-
continue;
|
|
106
|
-
}
|
|
107
|
-
return candidate;
|
|
108
|
-
}
|
|
109
|
-
return null;
|
|
110
|
-
}, []);
|
|
111
77
|
const addToast = useCallback(entry => {
|
|
112
78
|
setToasts(prev => {
|
|
113
79
|
const {
|
|
@@ -131,25 +97,6 @@ export function ToastViewport({
|
|
|
131
97
|
if (entry) {
|
|
132
98
|
entry.options.onHide?.(reason);
|
|
133
99
|
}
|
|
134
|
-
// If focus currently lives inside the toast being dismissed, remember
|
|
135
|
-
// that its removal must hand focus off to a neighbor (or the element
|
|
136
|
-
// focused before the user entered the viewport) rather than <body>.
|
|
137
|
-
const el = viewportRef.current;
|
|
138
|
-
const active = document.activeElement;
|
|
139
|
-
const dismissedNode = el?.querySelector(`[data-toast-id="${id}"]`) ?? null;
|
|
140
|
-
if (dismissedNode && active instanceof Node && dismissedNode.contains(active)) {
|
|
141
|
-
focusHandoffIdRef.current = id;
|
|
142
|
-
// Pick the neighbor to receive focus while the DOM is still intact:
|
|
143
|
-
// prefer the next toast, then the previous, else restore.
|
|
144
|
-
const remaining = toastsRef.current.filter(t => t.id !== id);
|
|
145
|
-
if (remaining.length > 0) {
|
|
146
|
-
const dismissedIndex = toastsRef.current.findIndex(t => t.id === id);
|
|
147
|
-
const next = toastsRef.current[dismissedIndex + 1] ?? toastsRef.current[dismissedIndex - 1];
|
|
148
|
-
pendingFocusRef.current = next ? next.id : 'restore';
|
|
149
|
-
} else {
|
|
150
|
-
pendingFocusRef.current = 'restore';
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
100
|
setExitingIds(prev => {
|
|
154
101
|
if (prev.has(id)) {
|
|
155
102
|
return prev;
|
|
@@ -168,41 +115,6 @@ export function ToastViewport({
|
|
|
168
115
|
});
|
|
169
116
|
setToasts(prev => prev.filter(t => t.id !== id));
|
|
170
117
|
}, []);
|
|
171
|
-
|
|
172
|
-
// After a dismissed toast unmounts, hand focus off so it never falls to
|
|
173
|
-
// <body>. Runs in a layout effect once the toast list no longer contains
|
|
174
|
-
// the dismissed toast.
|
|
175
|
-
useLayoutEffect(() => {
|
|
176
|
-
const handoffId = focusHandoffIdRef.current;
|
|
177
|
-
const target = pendingFocusRef.current;
|
|
178
|
-
if (handoffId == null || target == null) {
|
|
179
|
-
return;
|
|
180
|
-
}
|
|
181
|
-
// Wait until the dismissed toast is actually gone from the list.
|
|
182
|
-
if (toasts.some(t => t.id === handoffId)) {
|
|
183
|
-
return;
|
|
184
|
-
}
|
|
185
|
-
focusHandoffIdRef.current = null;
|
|
186
|
-
pendingFocusRef.current = null;
|
|
187
|
-
const el = viewportRef.current;
|
|
188
|
-
if (target !== 'restore' && el) {
|
|
189
|
-
const nextNode = el.querySelector(`[data-toast-id="${target}"]`);
|
|
190
|
-
const focusable = getFocusable(nextNode) ?? nextNode;
|
|
191
|
-
if (focusable) {
|
|
192
|
-
focusable.focus();
|
|
193
|
-
return;
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
// No remaining toast to receive focus — restore the previously-focused
|
|
197
|
-
// element if it's still connected, else fall back to the container.
|
|
198
|
-
const prev = prevFocusRef.current;
|
|
199
|
-
prevFocusRef.current = null;
|
|
200
|
-
if (prev && prev.isConnected) {
|
|
201
|
-
prev.focus();
|
|
202
|
-
} else if (el) {
|
|
203
|
-
el.focus();
|
|
204
|
-
}
|
|
205
|
-
}, [toasts, getFocusable]);
|
|
206
118
|
const findByUniqueID = useCallback(uid => {
|
|
207
119
|
return toastsRef.current.find(t => t.options.uniqueID === uid);
|
|
208
120
|
}, []);
|
|
@@ -227,6 +139,7 @@ export function ToastViewport({
|
|
|
227
139
|
}
|
|
228
140
|
|
|
229
141
|
// Show the popover on mount so it enters the top layer
|
|
142
|
+
const viewportRef = useRef(null);
|
|
230
143
|
useEffect(() => {
|
|
231
144
|
if (!isTopLayer) {
|
|
232
145
|
return;
|
|
@@ -240,54 +153,13 @@ export function ToastViewport({
|
|
|
240
153
|
}
|
|
241
154
|
}
|
|
242
155
|
}, [isTopLayer]);
|
|
243
|
-
|
|
244
|
-
// F6 jumps focus into the toast viewport — the standard "go to
|
|
245
|
-
// notifications" affordance. Focus the first control in the newest toast,
|
|
246
|
-
// or the viewport container if none. Toasts are non-modal, so this only
|
|
247
|
-
// moves focus in; Shift+Tab / Escape let focus leave naturally.
|
|
248
|
-
const hasToasts = toasts.length > 0;
|
|
249
|
-
useEffect(() => {
|
|
250
|
-
if (!hasToasts) {
|
|
251
|
-
return;
|
|
252
|
-
}
|
|
253
|
-
const handleKeyDown = e => {
|
|
254
|
-
if (e.key !== 'F6') {
|
|
255
|
-
return;
|
|
256
|
-
}
|
|
257
|
-
const el = viewportRef.current;
|
|
258
|
-
if (!el) {
|
|
259
|
-
return;
|
|
260
|
-
}
|
|
261
|
-
// Already inside the viewport — nothing to do.
|
|
262
|
-
const active = document.activeElement;
|
|
263
|
-
if (active instanceof Node && el.contains(active)) {
|
|
264
|
-
return;
|
|
265
|
-
}
|
|
266
|
-
e.preventDefault();
|
|
267
|
-
// Remember where focus was so it can be restored on dismiss.
|
|
268
|
-
if (active instanceof HTMLElement) {
|
|
269
|
-
prevFocusRef.current = active;
|
|
270
|
-
}
|
|
271
|
-
// Newest toast is the last one rendered in the DOM.
|
|
272
|
-
const toastNodes = el.querySelectorAll('[data-toast-id]');
|
|
273
|
-
const newest = toastNodes[toastNodes.length - 1] ?? null;
|
|
274
|
-
const focusable = getFocusable(newest) ?? newest ?? el;
|
|
275
|
-
focusable.focus();
|
|
276
|
-
};
|
|
277
|
-
document.addEventListener('keydown', handleKeyDown);
|
|
278
|
-
return () => {
|
|
279
|
-
document.removeEventListener('keydown', handleKeyDown);
|
|
280
|
-
};
|
|
281
|
-
}, [hasToasts, getFocusable]);
|
|
282
156
|
const posStyle = position === 'topEnd' ? styles.topEnd : position === 'topStart' ? styles.topStart : position === 'bottomStart' ? styles.bottomStart : styles.bottomEnd;
|
|
283
157
|
return /*#__PURE__*/_jsxs(ToastContext, {
|
|
284
158
|
value: contextValue,
|
|
285
159
|
children: [children, /*#__PURE__*/_jsx("div", {
|
|
286
160
|
ref: viewportRef,
|
|
287
161
|
role: "region",
|
|
288
|
-
"aria-label": "Notifications"
|
|
289
|
-
"aria-modal": false,
|
|
290
|
-
tabIndex: -1
|
|
162
|
+
"aria-label": "Notifications"
|
|
291
163
|
// popover="manual" promotes to the top layer (above dialogs).
|
|
292
164
|
// Omitted inside dialogs where the viewport is already in a top layer.
|
|
293
165
|
,
|
|
@@ -302,7 +174,6 @@ export function ToastViewport({
|
|
|
302
174
|
const dur = o.autoHideDuration ?? 5000;
|
|
303
175
|
const isExiting = exitingIds.has(entry.id);
|
|
304
176
|
return /*#__PURE__*/_jsx("div", {
|
|
305
|
-
"data-toast-id": entry.id,
|
|
306
177
|
...{
|
|
307
178
|
0: {
|
|
308
179
|
className: "x67bb7w xrvj5dj x1tu4anv xvmdzux xjshnde xuedmi6 xsagj69 xlr8y92 x1sopeo2 x5rzir7"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toolbar.d.ts","sourceRoot":"","sources":["../../src/Toolbar/Toolbar.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,4BAA4B,CAAC;AAoH5D,MAAM,MAAM,WAAW,GAAG,WAAW,CAAC;AAEtC,MAAM,WAAW,YAAa,SAAQ,SAAS,CAAC,cAAc,CAAC;IAC7D,gDAAgD;IAChD,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;;OAGG;IACH,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B;;OAEG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;;;OAQG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB;;;OAGG;IACH,GAAG,CAAC,EAAE,WAAW,CAAC;IAClB;;;;OAIG;IACH,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACxC;;;OAGG;IACH,OAAO,CAAC,EAAE,cAAc,CAAC;IAEzB;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,GAAG,QAAQ,GAAG,O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H,OAAO,CAAC,EAAE,cAAc,CAAC;IAEzB;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,GAAG,QAAQ,GAAG,OAAO,GAAG,KAAK,CAAC,EAAE,CAAC;CACnD;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,OAAO,CAAC,EACtB,YAAY,EACZ,aAAa,EACb,UAAU,EACV,KAAK,EACL,IAAW,EACX,GAAO,EACP,WAA0B,EAC1B,OAAuB,EACvB,QAAQ,EACR,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,KAAK,EACT,EAAE,YAAY,+BAgGd;yBA/Ge,OAAO"}
|
package/dist/Toolbar/Toolbar.js
CHANGED
|
@@ -175,13 +175,10 @@ export function Toolbar({
|
|
|
175
175
|
const gapVar = spacingVars[spacingStepToVar[gap]];
|
|
176
176
|
const {
|
|
177
177
|
listRef,
|
|
178
|
-
handleKeyDown
|
|
179
|
-
handleFocus
|
|
178
|
+
handleKeyDown
|
|
180
179
|
} = useListFocus({
|
|
181
|
-
itemSelector: 'button, input, [tabindex]',
|
|
182
|
-
orientation
|
|
183
|
-
hasRovingTabIndex: true,
|
|
184
|
-
hasCaretGuard: true
|
|
180
|
+
itemSelector: 'button, input, [tabindex="0"]',
|
|
181
|
+
orientation
|
|
185
182
|
});
|
|
186
183
|
return /*#__PURE__*/_jsx(SizeProvider, {
|
|
187
184
|
value: size,
|
|
@@ -199,7 +196,6 @@ export function Toolbar({
|
|
|
199
196
|
"aria-label": label,
|
|
200
197
|
"aria-orientation": orientation,
|
|
201
198
|
onKeyDown: handleKeyDown,
|
|
202
|
-
onFocus: handleFocus,
|
|
203
199
|
...mergeProps(themeProps('toolbar', {
|
|
204
200
|
size
|
|
205
201
|
}), stylex.props(hasCenterContent ? styles.baseGrid : styles.baseFlex, orientation === 'vertical' && styles.vertical, sizeStyles.base, dynamicStyles.gap(gapVar), dynamicStyles.tabIndicatorBottom(`calc(-1 * (${blockPaddingVarForSize[size]}${dividers?.includes('bottom') ? ' + 1px' : ''}))`))),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTooltip.d.ts","sourceRoot":"","sources":["../../src/Tooltip/useTooltip.tsx"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,OAAO,EAKL,KAAK,SAAS,EACd,KAAK,WAAW,EACjB,MAAM,OAAO,CAAC;AAEf,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"useTooltip.d.ts","sourceRoot":"","sources":["../../src/Tooltip/useTooltip.tsx"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,OAAO,EAKL,KAAK,SAAS,EACd,KAAK,WAAW,EACjB,MAAM,OAAO,CAAC;AAEf,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,mBAAmB,CAAC;AA+C3B;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE9D,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC;IAE3B;;;OAGG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC;IAE3B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,mBAAmB,CAAC;IAEnC;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IAEpB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,GAAG,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;IAE9B;;;OAGG;IACH,WAAW,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;IAEtC;;;;OAIG;IACH,cAAc,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;IAEzC;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,aAAa,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,kBAAkB,KAAK,SAAS,CAAC;CAC/E;AAyBD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,UAAU,CAAC,OAAO,GAAE,cAAmB,GAAG,aAAa,CAuNtE"}
|
|
@@ -18,14 +18,7 @@ import { layerAnimations } from "../Layer/layerAnimations.stylex.js";
|
|
|
18
18
|
import { themeProps } from "../utils/themeProps.js";
|
|
19
19
|
import "../theme/tokens.stylex.js";
|
|
20
20
|
import { colorVars, radiusVars, spacingVars, typographyVars, typeScaleVars } from "../theme/tokens.stylex.js";
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Grace period (ms) before hiding on pointer-leave when no explicit `hideDelay`
|
|
24
|
-
* is set, so the pointer can travel across the small gap from the trigger onto
|
|
25
|
-
* the tooltip surface without the tooltip disappearing (WCAG 1.4.13 hoverable).
|
|
26
|
-
*/
|
|
27
21
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
28
|
-
const HOVER_BRIDGE_DELAY = 100;
|
|
29
22
|
const styles = {
|
|
30
23
|
container: {
|
|
31
24
|
kWkggS: "x19aspcf",
|
|
@@ -150,28 +143,20 @@ export function useTooltip(options = {}) {
|
|
|
150
143
|
}, delay);
|
|
151
144
|
}, [isEnabled, isOpen, clearTimeouts, layer, delay]);
|
|
152
145
|
|
|
153
|
-
// Schedule hide with delay (suppressed when isOpen is true)
|
|
154
|
-
// A small hover bridge (when hideDelay is 0) lets the pointer travel from the
|
|
155
|
-
// trigger onto the tooltip surface without the tooltip vanishing — required
|
|
156
|
-
// for WCAG 1.4.13 (Content on Hover or Focus: hoverable).
|
|
146
|
+
// Schedule hide with delay (suppressed when isOpen is true)
|
|
157
147
|
const scheduleHide = useCallback(() => {
|
|
158
148
|
if (isOpen === true) {
|
|
159
149
|
return;
|
|
160
150
|
}
|
|
161
151
|
clearTimeouts();
|
|
162
|
-
|
|
163
|
-
|
|
152
|
+
if (hideDelay > 0) {
|
|
153
|
+
hideTimeoutRef.current = setTimeout(() => {
|
|
154
|
+
layer.hide();
|
|
155
|
+
}, hideDelay);
|
|
156
|
+
} else {
|
|
164
157
|
layer.hide();
|
|
165
|
-
}, effectiveHideDelay);
|
|
166
|
-
}, [isOpen, clearTimeouts, layer, hideDelay]);
|
|
167
|
-
|
|
168
|
-
// Cancel a pending hide (e.g. the pointer entered the tooltip surface).
|
|
169
|
-
const cancelHide = useCallback(() => {
|
|
170
|
-
if (hideTimeoutRef.current) {
|
|
171
|
-
clearTimeout(hideTimeoutRef.current);
|
|
172
|
-
hideTimeoutRef.current = null;
|
|
173
158
|
}
|
|
174
|
-
}, []);
|
|
159
|
+
}, [isOpen, clearTimeouts, layer, hideDelay]);
|
|
175
160
|
|
|
176
161
|
// Event handlers
|
|
177
162
|
const handleMouseEnter = useCallback(() => {
|
|
@@ -260,32 +245,6 @@ export function useTooltip(options = {}) {
|
|
|
260
245
|
}
|
|
261
246
|
}, [isOpen, clearTimeouts, layer]);
|
|
262
247
|
|
|
263
|
-
// Dismiss on Escape (WCAG 1.4.13 — dismissible). Uncontrolled tooltips only;
|
|
264
|
-
// a controlled tooltip's visibility is owned by the consumer. The listener is
|
|
265
|
-
// mounted for the lifetime of an uncontrolled tooltip rather than gated on
|
|
266
|
-
// `layer.isOpen` (React state, which can lag a frame behind the DOM) —
|
|
267
|
-
// `layer.hide()` self-guards and no-ops when the layer is already closed.
|
|
268
|
-
// Guarded against IME composition-cancel.
|
|
269
|
-
useEffect(() => {
|
|
270
|
-
if (isOpen !== undefined) {
|
|
271
|
-
return;
|
|
272
|
-
}
|
|
273
|
-
const handleKeyDown = e => {
|
|
274
|
-
if (e.key !== 'Escape') {
|
|
275
|
-
return;
|
|
276
|
-
}
|
|
277
|
-
if (e.isComposing || e.keyCode === 229) {
|
|
278
|
-
return;
|
|
279
|
-
}
|
|
280
|
-
clearTimeouts();
|
|
281
|
-
layer.hide();
|
|
282
|
-
};
|
|
283
|
-
document.addEventListener('keydown', handleKeyDown);
|
|
284
|
-
return () => {
|
|
285
|
-
document.removeEventListener('keydown', handleKeyDown);
|
|
286
|
-
};
|
|
287
|
-
}, [isOpen, layer, clearTimeouts]);
|
|
288
|
-
|
|
289
248
|
// Render function that wraps layer.render with tooltip styling
|
|
290
249
|
const renderTooltip = useCallback((children, props) => {
|
|
291
250
|
const renderPlacement = props?.placement ?? placement;
|
|
@@ -294,13 +253,7 @@ export function useTooltip(options = {}) {
|
|
|
294
253
|
alignment: props?.alignment ?? alignment,
|
|
295
254
|
role: 'tooltip',
|
|
296
255
|
xstyle: [popoverXstyle, layerAnimations[renderPlacement]],
|
|
297
|
-
className: themeProps('tooltip').className
|
|
298
|
-
// Keep the tooltip open while the pointer is over the surface itself
|
|
299
|
-
// (WCAG 1.4.13 hoverable). These sit on the layer container — the
|
|
300
|
-
// element the user actually hovers — not the inner content div, since
|
|
301
|
-
// mouseenter/leave do not bubble.
|
|
302
|
-
onMouseEnter: cancelHide,
|
|
303
|
-
onMouseLeave: scheduleHide
|
|
256
|
+
className: themeProps('tooltip').className
|
|
304
257
|
};
|
|
305
258
|
return layer.render(/*#__PURE__*/_jsx("div", {
|
|
306
259
|
...{
|
|
@@ -308,7 +261,7 @@ export function useTooltip(options = {}) {
|
|
|
308
261
|
},
|
|
309
262
|
children: children
|
|
310
263
|
}), renderProps);
|
|
311
|
-
}, [layer, placement, alignment, popoverXstyle
|
|
264
|
+
}, [layer, placement, alignment, popoverXstyle]);
|
|
312
265
|
return {
|
|
313
266
|
ref,
|
|
314
267
|
positionRef: layer.ref,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file TreeList.tsx
|
|
3
|
-
* @input Uses React, StyleX, theme tokens, TreeListItem, TreeListTypes
|
|
3
|
+
* @input Uses React, StyleX, theme tokens, TreeListItem, TreeListTypes
|
|
4
4
|
* @output Exports TreeList component, TreeListProps type
|
|
5
5
|
* @position Core implementation; consumed by index.ts
|
|
6
6
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeList.d.ts","sourceRoot":"","sources":["../../src/TreeList/TreeList.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAwC,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAI5E,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAE5C,OAAO,KAAK,EAAC,gBAAgB,EAAE,eAAe,EAAC,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"TreeList.d.ts","sourceRoot":"","sources":["../../src/TreeList/TreeList.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAwC,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAI5E,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAE5C,OAAO,KAAK,EAAC,gBAAgB,EAAE,eAAe,EAAC,MAAM,iBAAiB,CAAC;AAOvE,OAAO,EAAC,KAAK,eAAe,EAAC,MAAM,iBAAiB,CAAC;AAErD,MAAM,WAAW,aAAc,SAAQ,SAAS,CAAC,cAAc,CAAC;IAC9D,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAEhC;;;OAGG;IACH,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAE1B;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,eAAe,CAAC;IAE1B;;;OAGG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IAEnB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AA0CD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,QAAQ,CAAC,EACvB,KAAK,EACL,OAAoB,EACpB,MAAM,EACN,MAAM,EACN,SAAS,EACT,KAAK,EACL,aAAa,EAAE,MAAM,EACrB,GAAG,GACJ,EAAE,aAAa,+BAsGf;yBA/Ge,QAAQ"}
|