@workday/canvas-kit-react 5.3.17 → 5.4.0-next.1
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/action-bar/lib/ActionBar.tsx +42 -29
- package/avatar/lib/Avatar.tsx +4 -0
- package/button/lib/PrimaryButton.tsx +110 -32
- package/button/lib/SecondaryButton.tsx +31 -16
- package/button/lib/TertiaryButton.tsx +45 -35
- package/button/lib/parts/ButtonContainer.tsx +18 -5
- package/button/lib/parts/ButtonLabelIcon.tsx +34 -14
- package/button/lib/types.ts +11 -0
- package/checkbox/lib/Checkbox.tsx +1 -1
- package/common/README.md +78 -0
- package/common/index.ts +1 -0
- package/common/lib/EllipsisText.tsx +11 -0
- package/common/lib/parts/_brand-assets.ts +6 -6
- package/common/lib/styles/accessibleHide.ts +2 -2
- package/common/lib/theming/README.md +189 -25
- package/common/lib/theming/breakpoints.ts +296 -16
- package/common/lib/theming/types.ts +191 -1
- package/common/lib/utils/components.ts +50 -23
- package/common/lib/utils/elements.ts +5 -1
- package/common/lib/utils/index.ts +2 -0
- package/common/lib/utils/mergeProps.ts +4 -0
- package/common/lib/utils/useConstant.ts +18 -0
- package/common/lib/utils/useResizeObserver.ts +29 -0
- package/common/lib/utils/useUniqueId.ts +46 -4
- package/cookie-banner/README.md +15 -10
- package/cookie-banner/index.ts +3 -3
- package/cookie-banner/lib/CookieBanner.tsx +29 -4
- package/dist/commonjs/action-bar/lib/ActionBar.d.ts.map +1 -1
- package/dist/commonjs/action-bar/lib/ActionBar.js +33 -22
- package/dist/commonjs/avatar/lib/Avatar.d.ts.map +1 -1
- package/dist/commonjs/avatar/lib/Avatar.js +3 -0
- package/dist/commonjs/button/lib/PrimaryButton.d.ts +80 -6
- package/dist/commonjs/button/lib/PrimaryButton.d.ts.map +1 -1
- package/dist/commonjs/button/lib/PrimaryButton.js +80 -26
- package/dist/commonjs/button/lib/SecondaryButton.d.ts +8 -5
- package/dist/commonjs/button/lib/SecondaryButton.d.ts.map +1 -1
- package/dist/commonjs/button/lib/SecondaryButton.js +22 -12
- package/dist/commonjs/button/lib/TertiaryButton.d.ts +8 -4
- package/dist/commonjs/button/lib/TertiaryButton.d.ts.map +1 -1
- package/dist/commonjs/button/lib/TertiaryButton.js +24 -19
- package/dist/commonjs/button/lib/parts/ButtonContainer.d.ts +5 -3
- package/dist/commonjs/button/lib/parts/ButtonContainer.d.ts.map +1 -1
- package/dist/commonjs/button/lib/parts/ButtonContainer.js +7 -9
- package/dist/commonjs/button/lib/parts/ButtonLabel.d.ts +1 -1
- package/dist/commonjs/button/lib/parts/ButtonLabel.d.ts.map +1 -1
- package/dist/commonjs/button/lib/parts/ButtonLabelIcon.d.ts +7 -4
- package/dist/commonjs/button/lib/parts/ButtonLabelIcon.d.ts.map +1 -1
- package/dist/commonjs/button/lib/parts/ButtonLabelIcon.js +28 -13
- package/dist/commonjs/button/lib/types.d.ts +9 -0
- package/dist/commonjs/button/lib/types.d.ts.map +1 -1
- package/dist/commonjs/checkbox/lib/Checkbox.d.ts +1 -1
- package/dist/commonjs/common/index.d.ts +1 -0
- package/dist/commonjs/common/index.d.ts.map +1 -1
- package/dist/commonjs/common/index.js +1 -0
- package/dist/commonjs/common/lib/EllipsisText.d.ts +5 -0
- package/dist/commonjs/common/lib/EllipsisText.d.ts.map +1 -0
- package/dist/commonjs/common/lib/EllipsisText.js +13 -0
- package/dist/commonjs/common/lib/parts/_brand-assets.d.ts.map +1 -1
- package/dist/commonjs/common/lib/parts/_brand-assets.js +6 -6
- package/dist/commonjs/common/lib/styles/accessibleHide.d.ts +2 -2
- package/dist/commonjs/common/lib/styles/accessibleHide.d.ts.map +1 -1
- package/dist/commonjs/common/lib/theming/breakpoints.d.ts +287 -6
- package/dist/commonjs/common/lib/theming/breakpoints.d.ts.map +1 -1
- package/dist/commonjs/common/lib/theming/breakpoints.js +192 -10
- package/dist/commonjs/common/lib/theming/types.d.ts +191 -1
- package/dist/commonjs/common/lib/theming/types.d.ts.map +1 -1
- package/dist/commonjs/common/lib/utils/components.d.ts +19 -9
- package/dist/commonjs/common/lib/utils/components.d.ts.map +1 -1
- package/dist/commonjs/common/lib/utils/components.js +12 -2
- package/dist/commonjs/common/lib/utils/elements.d.ts +2 -2
- package/dist/commonjs/common/lib/utils/elements.d.ts.map +1 -1
- package/dist/commonjs/common/lib/utils/elements.js +4 -1
- package/dist/commonjs/common/lib/utils/index.d.ts +2 -0
- package/dist/commonjs/common/lib/utils/index.d.ts.map +1 -1
- package/dist/commonjs/common/lib/utils/index.js +2 -0
- package/dist/commonjs/common/lib/utils/mergeProps.d.ts.map +1 -1
- package/dist/commonjs/common/lib/utils/mergeProps.js +5 -0
- package/dist/commonjs/common/lib/utils/useConstant.d.ts +9 -0
- package/dist/commonjs/common/lib/utils/useConstant.d.ts.map +1 -0
- package/dist/commonjs/common/lib/utils/useConstant.js +18 -0
- package/dist/commonjs/common/lib/utils/useResizeObserver.d.ts +3 -0
- package/dist/commonjs/common/lib/utils/useResizeObserver.d.ts.map +1 -0
- package/dist/commonjs/common/lib/utils/useResizeObserver.js +42 -0
- package/dist/commonjs/common/lib/utils/useUniqueId.d.ts +28 -0
- package/dist/commonjs/common/lib/utils/useUniqueId.d.ts.map +1 -1
- package/dist/commonjs/common/lib/utils/useUniqueId.js +42 -14
- package/dist/commonjs/cookie-banner/index.d.ts +3 -3
- package/dist/commonjs/cookie-banner/index.d.ts.map +1 -1
- package/dist/commonjs/cookie-banner/index.js +1 -1
- package/dist/commonjs/cookie-banner/lib/CookieBanner.d.ts +19 -2
- package/dist/commonjs/cookie-banner/lib/CookieBanner.d.ts.map +1 -1
- package/dist/commonjs/cookie-banner/lib/CookieBanner.js +19 -8
- package/dist/commonjs/dialog/lib/hooks/useDialogCard.d.ts +4 -16
- package/dist/commonjs/dialog/lib/hooks/useDialogCard.d.ts.map +1 -1
- package/dist/commonjs/dialog/lib/hooks/useDialogPopper.d.ts +5 -2
- package/dist/commonjs/dialog/lib/hooks/useDialogPopper.d.ts.map +1 -1
- package/dist/commonjs/form-field/lib/FormField.d.ts.map +1 -1
- package/dist/commonjs/form-field/lib/FormField.js +1 -2
- package/dist/commonjs/modal/lib/ModalOverlay.d.ts +4 -2
- package/dist/commonjs/modal/lib/ModalOverlay.d.ts.map +1 -1
- package/dist/commonjs/modal/lib/hooks/useModalCard.d.ts +4 -16
- package/dist/commonjs/modal/lib/hooks/useModalCard.d.ts.map +1 -1
- package/dist/commonjs/modal/lib/hooks/useModalHeading.d.ts +5 -17
- package/dist/commonjs/modal/lib/hooks/useModalHeading.d.ts.map +1 -1
- package/dist/commonjs/page-header/index.d.ts +3 -3
- package/dist/commonjs/page-header/index.d.ts.map +1 -1
- package/dist/commonjs/page-header/index.js +1 -1
- package/dist/commonjs/page-header/lib/PageHeader.d.ts +19 -2
- package/dist/commonjs/page-header/lib/PageHeader.d.ts.map +1 -1
- package/dist/commonjs/page-header/lib/PageHeader.js +18 -7
- package/dist/commonjs/pagination/lib/Pagination/PageList.d.ts +1 -1
- package/dist/commonjs/pagination/lib/Pagination/PageList.d.ts.map +1 -1
- package/dist/commonjs/pagination/lib/Pagination/Pagination.d.ts +5 -5
- package/dist/commonjs/pagination/lib/Pagination/common/List.d.ts +1 -1
- package/dist/commonjs/pagination/lib/Pagination/common/List.d.ts.map +1 -1
- package/dist/commonjs/pagination/lib/Pagination/common/utils/getValidChildren.d.ts +1 -1
- package/dist/commonjs/pagination/lib/Pagination/common/utils/getValidChildren.d.ts.map +1 -1
- package/dist/commonjs/popup/lib/PopupCard.js +2 -3
- package/dist/commonjs/popup/lib/hooks/focus-trap-js.d.ts.map +1 -1
- package/dist/commonjs/popup/lib/hooks/focus-trap-js.js +1 -0
- package/dist/commonjs/popup/lib/hooks/usePopupCard.d.ts +5 -2
- package/dist/commonjs/popup/lib/hooks/usePopupCard.d.ts.map +1 -1
- package/dist/commonjs/popup/lib/hooks/usePopupCloseButton.d.ts +4 -2
- package/dist/commonjs/popup/lib/hooks/usePopupCloseButton.d.ts.map +1 -1
- package/dist/commonjs/popup/lib/hooks/usePopupHeading.d.ts +5 -2
- package/dist/commonjs/popup/lib/hooks/usePopupHeading.d.ts.map +1 -1
- package/dist/commonjs/popup/lib/hooks/usePopupPopper.d.ts +4 -2
- package/dist/commonjs/popup/lib/hooks/usePopupPopper.d.ts.map +1 -1
- package/dist/commonjs/popup/lib/hooks/usePopupTarget.d.ts +4 -2
- package/dist/commonjs/popup/lib/hooks/usePopupTarget.d.ts.map +1 -1
- package/dist/commonjs/popup/lib/hooks/useReturnFocus.d.ts +1 -1
- package/dist/commonjs/popup/lib/hooks/useReturnFocus.js +1 -1
- package/dist/commonjs/radio/lib/Radio.d.ts +1 -1
- package/dist/commonjs/switch/lib/Switch.d.ts +1 -1
- package/dist/commonjs/table/lib/TableRow.d.ts +5 -4
- package/dist/commonjs/table/lib/TableRow.d.ts.map +1 -1
- package/dist/commonjs/table/lib/TableRow.js +12 -26
- package/dist/commonjs/tabs/index.d.ts +5 -0
- package/dist/commonjs/tabs/index.d.ts.map +1 -1
- package/dist/commonjs/tabs/index.js +11 -0
- package/dist/commonjs/tabs/lib/Tabs.d.ts +35 -7
- package/dist/commonjs/tabs/lib/Tabs.d.ts.map +1 -1
- package/dist/commonjs/tabs/lib/Tabs.js +28 -7
- package/dist/commonjs/tabs/lib/TabsItem.d.ts +107 -0
- package/dist/commonjs/tabs/lib/TabsItem.d.ts.map +1 -0
- package/dist/commonjs/tabs/lib/TabsItem.js +140 -0
- package/dist/commonjs/tabs/lib/TabsList.d.ts +43 -0
- package/dist/commonjs/tabs/lib/TabsList.d.ts.map +1 -0
- package/dist/commonjs/tabs/lib/TabsList.js +53 -0
- package/dist/commonjs/tabs/lib/TabsMenuPopper.d.ts +21 -0
- package/dist/commonjs/tabs/lib/TabsMenuPopper.d.ts.map +1 -0
- package/dist/commonjs/tabs/lib/{TabList.js → TabsMenuPopper.js} +7 -19
- package/dist/commonjs/tabs/lib/TabsOverflowButton.d.ts +31 -0
- package/dist/commonjs/tabs/lib/TabsOverflowButton.d.ts.map +1 -0
- package/dist/commonjs/tabs/lib/TabsOverflowButton.js +57 -0
- package/{ts3.5/dist/commonjs/tabs/lib/TabPanel.d.ts → dist/commonjs/tabs/lib/TabsPanel.d.ts} +39 -29
- package/dist/commonjs/tabs/lib/TabsPanel.d.ts.map +1 -0
- package/dist/commonjs/tabs/lib/TabsPanel.js +64 -0
- package/dist/{es6/tabs/lib/TabList.d.ts → commonjs/tabs/lib/TabsPanels.d.ts} +5 -5
- package/dist/commonjs/tabs/lib/TabsPanels.d.ts.map +1 -0
- package/dist/commonjs/tabs/lib/TabsPanels.js +21 -0
- package/dist/commonjs/tabs/lib/cursor/index.d.ts +1 -1
- package/dist/commonjs/tabs/lib/cursor/index.d.ts.map +1 -1
- package/dist/commonjs/tabs/lib/cursor/index.js +1 -1
- package/dist/commonjs/tabs/lib/cursor/useCursorModel.d.ts +23 -13
- package/dist/commonjs/tabs/lib/cursor/useCursorModel.d.ts.map +1 -1
- package/dist/commonjs/tabs/lib/cursor/useCursorModel.js +50 -49
- package/dist/commonjs/tabs/lib/cursor/useRovingFocus.d.ts +37 -0
- package/dist/commonjs/tabs/lib/cursor/useRovingFocus.d.ts.map +1 -0
- package/dist/commonjs/tabs/lib/cursor/{hooks.js → useRovingFocus.js} +26 -50
- package/dist/commonjs/tabs/lib/list/index.d.ts +2 -1
- package/dist/commonjs/tabs/lib/list/index.d.ts.map +1 -1
- package/dist/commonjs/tabs/lib/list/index.js +2 -1
- package/dist/commonjs/tabs/lib/list/renderItem.d.ts +4 -0
- package/dist/commonjs/tabs/lib/list/renderItem.d.ts.map +1 -0
- package/dist/commonjs/tabs/lib/list/renderItem.js +18 -0
- package/dist/commonjs/tabs/lib/list/useListModel.d.ts +25 -13
- package/dist/commonjs/tabs/lib/list/useListModel.d.ts.map +1 -1
- package/dist/commonjs/tabs/lib/list/useListModel.js +20 -7
- package/dist/commonjs/tabs/lib/list/useListRegisterItem.d.ts +14 -0
- package/dist/commonjs/tabs/lib/list/useListRegisterItem.d.ts.map +1 -0
- package/dist/commonjs/tabs/lib/list/useListRegisterItem.js +46 -0
- package/dist/commonjs/tabs/lib/menu/Menu.d.ts +80 -0
- package/dist/commonjs/tabs/lib/menu/Menu.d.ts.map +1 -0
- package/dist/commonjs/tabs/lib/menu/Menu.js +94 -0
- package/dist/commonjs/tabs/lib/menu/MenuCard.d.ts +17 -0
- package/dist/commonjs/tabs/lib/menu/MenuCard.d.ts.map +1 -0
- package/dist/commonjs/tabs/lib/menu/MenuCard.js +82 -0
- package/dist/commonjs/tabs/lib/menu/MenuItem.d.ts +62 -0
- package/dist/commonjs/tabs/lib/menu/MenuItem.d.ts.map +1 -0
- package/dist/commonjs/tabs/lib/menu/MenuItem.js +145 -0
- package/dist/commonjs/tabs/lib/menu/MenuList.d.ts +23 -0
- package/dist/commonjs/tabs/lib/menu/MenuList.d.ts.map +1 -0
- package/dist/commonjs/tabs/lib/menu/MenuList.js +52 -0
- package/dist/commonjs/tabs/lib/menu/MenuPopper.d.ts +21 -0
- package/dist/commonjs/tabs/lib/menu/MenuPopper.d.ts.map +1 -0
- package/dist/commonjs/tabs/lib/menu/MenuPopper.js +45 -0
- package/dist/commonjs/tabs/lib/menu/MenuTarget.d.ts +21 -0
- package/dist/commonjs/tabs/lib/menu/MenuTarget.d.ts.map +1 -0
- package/dist/commonjs/tabs/lib/menu/MenuTarget.js +60 -0
- package/dist/commonjs/tabs/lib/menu/index.d.ts +8 -0
- package/dist/commonjs/tabs/lib/menu/index.d.ts.map +1 -0
- package/dist/commonjs/tabs/lib/menu/index.js +18 -0
- package/dist/commonjs/tabs/lib/menu/useMenuModel.d.ts +35 -0
- package/dist/commonjs/tabs/lib/menu/useMenuModel.d.ts.map +1 -0
- package/dist/commonjs/tabs/lib/menu/useMenuModel.js +33 -0
- package/dist/commonjs/tabs/lib/overflow/index.d.ts +5 -0
- package/dist/commonjs/tabs/lib/overflow/index.d.ts.map +1 -0
- package/dist/commonjs/tabs/lib/overflow/index.js +9 -0
- package/dist/commonjs/tabs/lib/overflow/useOverflowMeasureContainer.d.ts +8 -0
- package/dist/commonjs/tabs/lib/overflow/useOverflowMeasureContainer.d.ts.map +1 -0
- package/dist/commonjs/tabs/lib/overflow/useOverflowMeasureContainer.js +22 -0
- package/dist/commonjs/tabs/lib/overflow/useOverflowMeasureItem.d.ts +10 -0
- package/dist/commonjs/tabs/lib/overflow/useOverflowMeasureItem.d.ts.map +1 -0
- package/dist/commonjs/tabs/lib/overflow/useOverflowMeasureItem.js +32 -0
- package/dist/commonjs/tabs/lib/overflow/useOverflowModel.d.ts +69 -0
- package/dist/commonjs/tabs/lib/overflow/useOverflowModel.d.ts.map +1 -0
- package/dist/commonjs/tabs/lib/overflow/useOverflowModel.js +126 -0
- package/dist/commonjs/tabs/lib/overflow/useOverflowTarget.d.ts +11 -0
- package/dist/commonjs/tabs/lib/overflow/useOverflowTarget.d.ts.map +1 -0
- package/dist/commonjs/tabs/lib/overflow/useOverflowTarget.js +35 -0
- package/dist/commonjs/tabs/lib/selection/index.d.ts +4 -0
- package/dist/commonjs/tabs/lib/selection/index.d.ts.map +1 -0
- package/dist/commonjs/tabs/lib/selection/index.js +8 -0
- package/dist/commonjs/tabs/lib/selection/useResetCursorOnBlur.d.ts +13 -0
- package/dist/commonjs/tabs/lib/selection/useResetCursorOnBlur.d.ts.map +1 -0
- package/dist/commonjs/tabs/lib/{hooks.js → selection/useResetCursorOnBlur.js} +8 -9
- package/dist/commonjs/tabs/lib/selection/useSelectionItem.d.ts +8 -0
- package/dist/commonjs/tabs/lib/selection/useSelectionItem.d.ts.map +1 -0
- package/dist/commonjs/tabs/lib/selection/useSelectionItem.js +16 -0
- package/dist/commonjs/tabs/lib/selection/useSelectionModel.d.ts +62 -0
- package/dist/commonjs/tabs/lib/selection/useSelectionModel.d.ts.map +1 -0
- package/dist/commonjs/tabs/lib/selection/useSelectionModel.js +80 -0
- package/dist/commonjs/tabs/lib/useTabsModel.d.ts +39 -38
- package/dist/commonjs/tabs/lib/useTabsModel.d.ts.map +1 -1
- package/dist/commonjs/tabs/lib/useTabsModel.js +50 -37
- package/dist/commonjs/tokens/index.d.ts +3 -20
- package/dist/commonjs/tokens/index.d.ts.map +1 -1
- package/dist/commonjs/tokens/index.js +3 -6
- package/dist/commonjs/tokens/lib/depth.d.ts +109 -3
- package/dist/commonjs/tokens/lib/depth.d.ts.map +1 -1
- package/dist/commonjs/tokens/lib/depth.js +40 -5
- package/dist/commonjs/tooltip/lib/useTooltip.d.ts +1 -1
- package/dist/commonjs/tooltip/lib/useTooltip.js +2 -5
- package/dist/es6/action-bar/lib/ActionBar.d.ts.map +1 -1
- package/dist/es6/action-bar/lib/ActionBar.js +33 -22
- package/dist/es6/avatar/lib/Avatar.d.ts.map +1 -1
- package/dist/es6/avatar/lib/Avatar.js +3 -0
- package/dist/es6/button/lib/PrimaryButton.d.ts +80 -6
- package/dist/es6/button/lib/PrimaryButton.d.ts.map +1 -1
- package/dist/es6/button/lib/PrimaryButton.js +81 -27
- package/dist/es6/button/lib/SecondaryButton.d.ts +8 -5
- package/dist/es6/button/lib/SecondaryButton.d.ts.map +1 -1
- package/dist/es6/button/lib/SecondaryButton.js +22 -12
- package/dist/es6/button/lib/TertiaryButton.d.ts +8 -4
- package/dist/es6/button/lib/TertiaryButton.d.ts.map +1 -1
- package/dist/es6/button/lib/TertiaryButton.js +25 -20
- package/dist/es6/button/lib/parts/ButtonContainer.d.ts +5 -3
- package/dist/es6/button/lib/parts/ButtonContainer.d.ts.map +1 -1
- package/dist/es6/button/lib/parts/ButtonContainer.js +7 -9
- package/dist/es6/button/lib/parts/ButtonLabel.d.ts +1 -1
- package/dist/es6/button/lib/parts/ButtonLabel.d.ts.map +1 -1
- package/dist/es6/button/lib/parts/ButtonLabelIcon.d.ts +7 -4
- package/dist/es6/button/lib/parts/ButtonLabelIcon.d.ts.map +1 -1
- package/dist/es6/button/lib/parts/ButtonLabelIcon.js +28 -13
- package/dist/es6/button/lib/types.d.ts +9 -0
- package/dist/es6/button/lib/types.d.ts.map +1 -1
- package/dist/es6/checkbox/lib/Checkbox.d.ts +1 -1
- package/dist/es6/common/index.d.ts +1 -0
- package/dist/es6/common/index.d.ts.map +1 -1
- package/dist/es6/common/index.js +1 -0
- package/dist/es6/common/lib/EllipsisText.d.ts +5 -0
- package/dist/es6/common/lib/EllipsisText.d.ts.map +1 -0
- package/dist/es6/common/lib/EllipsisText.js +8 -0
- package/dist/es6/common/lib/parts/_brand-assets.d.ts.map +1 -1
- package/dist/es6/common/lib/parts/_brand-assets.js +6 -6
- package/dist/es6/common/lib/styles/accessibleHide.d.ts +2 -2
- package/dist/es6/common/lib/styles/accessibleHide.d.ts.map +1 -1
- package/dist/es6/common/lib/theming/breakpoints.d.ts +287 -6
- package/dist/es6/common/lib/theming/breakpoints.d.ts.map +1 -1
- package/dist/es6/common/lib/theming/breakpoints.js +192 -10
- package/dist/es6/common/lib/theming/types.d.ts +191 -1
- package/dist/es6/common/lib/theming/types.d.ts.map +1 -1
- package/dist/es6/common/lib/utils/components.d.ts +19 -9
- package/dist/es6/common/lib/utils/components.d.ts.map +1 -1
- package/dist/es6/common/lib/utils/components.js +12 -2
- package/dist/es6/common/lib/utils/elements.d.ts +2 -2
- package/dist/es6/common/lib/utils/elements.d.ts.map +1 -1
- package/dist/es6/common/lib/utils/elements.js +4 -1
- package/dist/es6/common/lib/utils/index.d.ts +2 -0
- package/dist/es6/common/lib/utils/index.d.ts.map +1 -1
- package/dist/es6/common/lib/utils/index.js +2 -0
- package/dist/es6/common/lib/utils/mergeProps.d.ts.map +1 -1
- package/dist/es6/common/lib/utils/mergeProps.js +5 -0
- package/dist/es6/common/lib/utils/useConstant.d.ts +9 -0
- package/dist/es6/common/lib/utils/useConstant.d.ts.map +1 -0
- package/dist/es6/common/lib/utils/useConstant.js +15 -0
- package/dist/es6/common/lib/utils/useResizeObserver.d.ts +3 -0
- package/dist/es6/common/lib/utils/useResizeObserver.d.ts.map +1 -0
- package/dist/es6/common/lib/utils/useResizeObserver.js +37 -0
- package/dist/es6/common/lib/utils/useUniqueId.d.ts +28 -0
- package/dist/es6/common/lib/utils/useUniqueId.d.ts.map +1 -1
- package/dist/es6/common/lib/utils/useUniqueId.js +42 -4
- package/dist/es6/cookie-banner/index.d.ts +3 -3
- package/dist/es6/cookie-banner/index.d.ts.map +1 -1
- package/dist/es6/cookie-banner/index.js +3 -3
- package/dist/es6/cookie-banner/lib/CookieBanner.d.ts +19 -2
- package/dist/es6/cookie-banner/lib/CookieBanner.d.ts.map +1 -1
- package/dist/es6/cookie-banner/lib/CookieBanner.js +19 -8
- package/dist/es6/dialog/lib/hooks/useDialogCard.d.ts +4 -16
- package/dist/es6/dialog/lib/hooks/useDialogCard.d.ts.map +1 -1
- package/dist/es6/dialog/lib/hooks/useDialogPopper.d.ts +5 -2
- package/dist/es6/dialog/lib/hooks/useDialogPopper.d.ts.map +1 -1
- package/dist/es6/form-field/lib/FormField.d.ts.map +1 -1
- package/dist/es6/form-field/lib/FormField.js +2 -3
- package/dist/es6/modal/lib/ModalOverlay.d.ts +4 -2
- package/dist/es6/modal/lib/ModalOverlay.d.ts.map +1 -1
- package/dist/es6/modal/lib/hooks/useModalCard.d.ts +4 -16
- package/dist/es6/modal/lib/hooks/useModalCard.d.ts.map +1 -1
- package/dist/es6/modal/lib/hooks/useModalHeading.d.ts +5 -17
- package/dist/es6/modal/lib/hooks/useModalHeading.d.ts.map +1 -1
- package/dist/es6/page-header/index.d.ts +3 -3
- package/dist/es6/page-header/index.d.ts.map +1 -1
- package/dist/es6/page-header/index.js +3 -3
- package/dist/es6/page-header/lib/PageHeader.d.ts +19 -2
- package/dist/es6/page-header/lib/PageHeader.d.ts.map +1 -1
- package/dist/es6/page-header/lib/PageHeader.js +18 -7
- package/dist/es6/pagination/lib/Pagination/PageList.d.ts +1 -1
- package/dist/es6/pagination/lib/Pagination/PageList.d.ts.map +1 -1
- package/dist/es6/pagination/lib/Pagination/Pagination.d.ts +5 -5
- package/dist/es6/pagination/lib/Pagination/common/List.d.ts +1 -1
- package/dist/es6/pagination/lib/Pagination/common/List.d.ts.map +1 -1
- package/dist/es6/pagination/lib/Pagination/common/utils/getValidChildren.d.ts +1 -1
- package/dist/es6/pagination/lib/Pagination/common/utils/getValidChildren.d.ts.map +1 -1
- package/dist/es6/popup/lib/PopupCard.js +3 -4
- package/dist/es6/popup/lib/hooks/focus-trap-js.d.ts.map +1 -1
- package/dist/es6/popup/lib/hooks/focus-trap-js.js +1 -0
- package/dist/es6/popup/lib/hooks/usePopupCard.d.ts +5 -2
- package/dist/es6/popup/lib/hooks/usePopupCard.d.ts.map +1 -1
- package/dist/es6/popup/lib/hooks/usePopupCloseButton.d.ts +4 -2
- package/dist/es6/popup/lib/hooks/usePopupCloseButton.d.ts.map +1 -1
- package/dist/es6/popup/lib/hooks/usePopupHeading.d.ts +5 -2
- package/dist/es6/popup/lib/hooks/usePopupHeading.d.ts.map +1 -1
- package/dist/es6/popup/lib/hooks/usePopupPopper.d.ts +4 -2
- package/dist/es6/popup/lib/hooks/usePopupPopper.d.ts.map +1 -1
- package/dist/es6/popup/lib/hooks/usePopupTarget.d.ts +4 -2
- package/dist/es6/popup/lib/hooks/usePopupTarget.d.ts.map +1 -1
- package/dist/es6/popup/lib/hooks/useReturnFocus.d.ts +1 -1
- package/dist/es6/popup/lib/hooks/useReturnFocus.js +1 -1
- package/dist/es6/radio/lib/Radio.d.ts +1 -1
- package/dist/es6/switch/lib/Switch.d.ts +1 -1
- package/dist/es6/table/lib/TableRow.d.ts +5 -4
- package/dist/es6/table/lib/TableRow.d.ts.map +1 -1
- package/dist/es6/table/lib/TableRow.js +12 -26
- package/dist/es6/tabs/index.d.ts +5 -0
- package/dist/es6/tabs/index.d.ts.map +1 -1
- package/dist/es6/tabs/index.js +5 -0
- package/dist/es6/tabs/lib/Tabs.d.ts +35 -7
- package/dist/es6/tabs/lib/Tabs.d.ts.map +1 -1
- package/dist/es6/tabs/lib/Tabs.js +28 -7
- package/dist/es6/tabs/lib/TabsItem.d.ts +107 -0
- package/dist/es6/tabs/lib/TabsItem.d.ts.map +1 -0
- package/dist/es6/tabs/lib/TabsItem.js +131 -0
- package/dist/es6/tabs/lib/TabsList.d.ts +43 -0
- package/dist/es6/tabs/lib/TabsList.d.ts.map +1 -0
- package/dist/es6/tabs/lib/TabsList.js +44 -0
- package/dist/es6/tabs/lib/TabsMenuPopper.d.ts +21 -0
- package/dist/es6/tabs/lib/TabsMenuPopper.d.ts.map +1 -0
- package/dist/es6/tabs/lib/{TabList.js → TabsMenuPopper.js} +8 -20
- package/dist/es6/tabs/lib/TabsOverflowButton.d.ts +31 -0
- package/dist/es6/tabs/lib/TabsOverflowButton.d.ts.map +1 -0
- package/dist/es6/tabs/lib/TabsOverflowButton.js +48 -0
- package/dist/{commonjs/tabs/lib/TabPanel.d.ts → es6/tabs/lib/TabsPanel.d.ts} +15 -5
- package/dist/es6/tabs/lib/TabsPanel.d.ts.map +1 -0
- package/dist/es6/tabs/lib/TabsPanel.js +59 -0
- package/{ts3.5/dist/commonjs/tabs/lib/TabList.d.ts → dist/es6/tabs/lib/TabsPanels.d.ts} +15 -15
- package/dist/es6/tabs/lib/TabsPanels.d.ts.map +1 -0
- package/dist/es6/tabs/lib/TabsPanels.js +12 -0
- package/dist/es6/tabs/lib/cursor/index.d.ts +1 -1
- package/dist/es6/tabs/lib/cursor/index.d.ts.map +1 -1
- package/dist/es6/tabs/lib/cursor/index.js +1 -1
- package/dist/es6/tabs/lib/cursor/useCursorModel.d.ts +23 -13
- package/dist/es6/tabs/lib/cursor/useCursorModel.d.ts.map +1 -1
- package/dist/es6/tabs/lib/cursor/useCursorModel.js +51 -50
- package/dist/es6/tabs/lib/cursor/useRovingFocus.d.ts +37 -0
- package/dist/es6/tabs/lib/cursor/useRovingFocus.d.ts.map +1 -0
- package/dist/es6/tabs/lib/cursor/useRovingFocus.js +84 -0
- package/dist/es6/tabs/lib/list/index.d.ts +2 -1
- package/dist/es6/tabs/lib/list/index.d.ts.map +1 -1
- package/dist/es6/tabs/lib/list/index.js +2 -1
- package/dist/es6/tabs/lib/list/renderItem.d.ts +4 -0
- package/dist/es6/tabs/lib/list/renderItem.d.ts.map +1 -0
- package/dist/es6/tabs/lib/list/renderItem.js +12 -0
- package/dist/es6/tabs/lib/list/useListModel.d.ts +25 -13
- package/dist/es6/tabs/lib/list/useListModel.d.ts.map +1 -1
- package/dist/es6/tabs/lib/list/useListModel.js +21 -8
- package/dist/es6/tabs/lib/list/useListRegisterItem.d.ts +14 -0
- package/dist/es6/tabs/lib/list/useListRegisterItem.d.ts.map +1 -0
- package/dist/es6/tabs/lib/list/useListRegisterItem.js +41 -0
- package/dist/es6/tabs/lib/menu/Menu.d.ts +80 -0
- package/dist/es6/tabs/lib/menu/Menu.d.ts.map +1 -0
- package/dist/es6/tabs/lib/menu/Menu.js +89 -0
- package/dist/es6/tabs/lib/menu/MenuCard.d.ts +17 -0
- package/dist/es6/tabs/lib/menu/MenuCard.d.ts.map +1 -0
- package/dist/es6/tabs/lib/menu/MenuCard.js +73 -0
- package/dist/es6/tabs/lib/menu/MenuItem.d.ts +62 -0
- package/dist/es6/tabs/lib/menu/MenuItem.d.ts.map +1 -0
- package/dist/es6/tabs/lib/menu/MenuItem.js +136 -0
- package/dist/es6/tabs/lib/menu/MenuList.d.ts +23 -0
- package/dist/es6/tabs/lib/menu/MenuList.d.ts.map +1 -0
- package/dist/es6/tabs/lib/menu/MenuList.js +43 -0
- package/dist/es6/tabs/lib/menu/MenuPopper.d.ts +21 -0
- package/dist/es6/tabs/lib/menu/MenuPopper.d.ts.map +1 -0
- package/dist/es6/tabs/lib/menu/MenuPopper.js +36 -0
- package/dist/es6/tabs/lib/menu/MenuTarget.d.ts +21 -0
- package/dist/es6/tabs/lib/menu/MenuTarget.d.ts.map +1 -0
- package/dist/es6/tabs/lib/menu/MenuTarget.js +51 -0
- package/dist/es6/tabs/lib/menu/index.d.ts +8 -0
- package/dist/es6/tabs/lib/menu/index.d.ts.map +1 -0
- package/dist/es6/tabs/lib/menu/index.js +7 -0
- package/dist/es6/tabs/lib/menu/useMenuModel.d.ts +35 -0
- package/dist/es6/tabs/lib/menu/useMenuModel.d.ts.map +1 -0
- package/dist/es6/tabs/lib/menu/useMenuModel.js +31 -0
- package/dist/es6/tabs/lib/overflow/index.d.ts +5 -0
- package/dist/es6/tabs/lib/overflow/index.d.ts.map +1 -0
- package/dist/es6/tabs/lib/overflow/index.js +4 -0
- package/dist/es6/tabs/lib/overflow/useOverflowMeasureContainer.d.ts +8 -0
- package/dist/es6/tabs/lib/overflow/useOverflowMeasureContainer.d.ts.map +1 -0
- package/dist/es6/tabs/lib/overflow/useOverflowMeasureContainer.js +13 -0
- package/dist/es6/tabs/lib/overflow/useOverflowMeasureItem.d.ts +10 -0
- package/dist/es6/tabs/lib/overflow/useOverflowMeasureItem.d.ts.map +1 -0
- package/dist/es6/tabs/lib/overflow/useOverflowMeasureItem.js +30 -0
- package/dist/es6/tabs/lib/overflow/useOverflowModel.d.ts +69 -0
- package/dist/es6/tabs/lib/overflow/useOverflowModel.d.ts.map +1 -0
- package/dist/es6/tabs/lib/overflow/useOverflowModel.js +120 -0
- package/dist/es6/tabs/lib/overflow/useOverflowTarget.d.ts +11 -0
- package/dist/es6/tabs/lib/overflow/useOverflowTarget.d.ts.map +1 -0
- package/dist/es6/tabs/lib/overflow/useOverflowTarget.js +30 -0
- package/dist/es6/tabs/lib/selection/index.d.ts +4 -0
- package/dist/es6/tabs/lib/selection/index.d.ts.map +1 -0
- package/dist/es6/tabs/lib/selection/index.js +3 -0
- package/dist/es6/tabs/lib/selection/useResetCursorOnBlur.d.ts +13 -0
- package/dist/es6/tabs/lib/selection/useResetCursorOnBlur.d.ts.map +1 -0
- package/dist/es6/tabs/lib/{hooks.js → selection/useResetCursorOnBlur.js} +8 -9
- package/dist/es6/tabs/lib/selection/useSelectionItem.d.ts +8 -0
- package/dist/es6/tabs/lib/selection/useSelectionItem.d.ts.map +1 -0
- package/dist/es6/tabs/lib/selection/useSelectionItem.js +14 -0
- package/dist/es6/tabs/lib/selection/useSelectionModel.d.ts +62 -0
- package/dist/es6/tabs/lib/selection/useSelectionModel.d.ts.map +1 -0
- package/dist/es6/tabs/lib/selection/useSelectionModel.js +75 -0
- package/dist/es6/tabs/lib/useTabsModel.d.ts +39 -38
- package/dist/es6/tabs/lib/useTabsModel.d.ts.map +1 -1
- package/dist/es6/tabs/lib/useTabsModel.js +50 -37
- package/dist/es6/tokens/index.d.ts +3 -20
- package/dist/es6/tokens/index.d.ts.map +1 -1
- package/dist/es6/tokens/index.js +1 -1
- package/dist/es6/tokens/lib/depth.d.ts +109 -3
- package/dist/es6/tokens/lib/depth.d.ts.map +1 -1
- package/dist/es6/tokens/lib/depth.js +40 -2
- package/dist/es6/tooltip/lib/useTooltip.d.ts +1 -1
- package/dist/es6/tooltip/lib/useTooltip.js +2 -2
- package/form-field/lib/FormField.tsx +8 -3
- package/package.json +7 -7
- package/page-header/README.md +11 -6
- package/page-header/index.ts +3 -3
- package/page-header/lib/PageHeader.tsx +28 -3
- package/popup/lib/PopupCard.tsx +3 -3
- package/popup/lib/hooks/focus-trap-js.ts +1 -0
- package/popup/lib/hooks/useReturnFocus.tsx +1 -1
- package/radio/lib/Radio.tsx +1 -1
- package/switch/lib/Switch.tsx +1 -1
- package/table/lib/TableRow.tsx +19 -13
- package/tabs/index.ts +6 -0
- package/tabs/lib/Tabs.tsx +34 -9
- package/tabs/lib/TabsItem.tsx +250 -0
- package/tabs/lib/TabsList.tsx +67 -0
- package/tabs/lib/TabsMenuPopper.tsx +27 -0
- package/tabs/lib/TabsOverflowButton.tsx +58 -0
- package/tabs/lib/{TabPanel.tsx → TabsPanel.tsx} +33 -31
- package/tabs/lib/TabsPanels.tsx +28 -0
- package/tabs/lib/cursor/index.ts +1 -1
- package/tabs/lib/cursor/useCursorModel.tsx +78 -65
- package/tabs/lib/cursor/useRovingFocus.tsx +94 -0
- package/tabs/lib/list/index.ts +2 -1
- package/tabs/lib/list/renderItem.tsx +19 -0
- package/tabs/lib/list/useListModel.tsx +48 -23
- package/tabs/lib/list/useListRegisterItem.tsx +53 -0
- package/tabs/lib/menu/Menu.tsx +95 -0
- package/tabs/lib/menu/MenuCard.tsx +96 -0
- package/tabs/lib/menu/MenuItem.tsx +195 -0
- package/tabs/lib/menu/MenuList.tsx +58 -0
- package/tabs/lib/menu/MenuPopper.tsx +31 -0
- package/tabs/lib/menu/MenuTarget.tsx +52 -0
- package/tabs/lib/menu/index.ts +8 -0
- package/tabs/lib/menu/useMenuModel.tsx +67 -0
- package/tabs/lib/overflow/index.ts +4 -0
- package/tabs/lib/overflow/spec/tsconfig.json +3 -0
- package/tabs/lib/overflow/spec/useOverflowModel.spec.tsx +46 -0
- package/tabs/lib/overflow/useOverflowMeasureContainer.ts +20 -0
- package/tabs/lib/overflow/useOverflowMeasureItem.tsx +40 -0
- package/tabs/lib/overflow/useOverflowModel.tsx +207 -0
- package/tabs/lib/overflow/useOverflowTarget.tsx +42 -0
- package/tabs/lib/selection/index.ts +3 -0
- package/tabs/lib/selection/useResetCursorOnBlur.tsx +29 -0
- package/tabs/lib/selection/useSelectionItem.tsx +26 -0
- package/tabs/lib/selection/useSelectionModel.tsx +133 -0
- package/tabs/lib/useTabsModel.tsx +93 -78
- package/tokens/README.md +5 -12
- package/tokens/index.ts +2 -2
- package/tokens/lib/depth.ts +125 -3
- package/tooltip/lib/useTooltip.tsx +2 -2
- package/ts3.5/dist/commonjs/button/lib/PrimaryButton.d.ts +80 -6
- package/ts3.5/dist/commonjs/button/lib/SecondaryButton.d.ts +8 -5
- package/ts3.5/dist/commonjs/button/lib/TertiaryButton.d.ts +8 -4
- package/ts3.5/dist/commonjs/button/lib/parts/ButtonContainer.d.ts +5 -3
- package/ts3.5/dist/commonjs/button/lib/parts/ButtonLabel.d.ts +1 -1
- package/ts3.5/dist/commonjs/button/lib/parts/ButtonLabelIcon.d.ts +7 -4
- package/ts3.5/dist/commonjs/button/lib/types.d.ts +9 -0
- package/ts3.5/dist/commonjs/checkbox/lib/Checkbox.d.ts +1 -1
- package/ts3.5/dist/commonjs/common/index.d.ts +1 -0
- package/ts3.5/dist/commonjs/common/lib/EllipsisText.d.ts +5 -0
- package/ts3.5/dist/commonjs/common/lib/styles/accessibleHide.d.ts +2 -2
- package/ts3.5/dist/commonjs/common/lib/theming/breakpoints.d.ts +287 -6
- package/ts3.5/dist/commonjs/common/lib/theming/types.d.ts +191 -1
- package/ts3.5/dist/commonjs/common/lib/utils/components.d.ts +19 -9
- package/ts3.5/dist/commonjs/common/lib/utils/elements.d.ts +2 -2
- package/ts3.5/dist/commonjs/common/lib/utils/index.d.ts +2 -0
- package/ts3.5/dist/commonjs/common/lib/utils/useConstant.d.ts +9 -0
- package/ts3.5/dist/commonjs/common/lib/utils/useResizeObserver.d.ts +3 -0
- package/ts3.5/dist/commonjs/common/lib/utils/useUniqueId.d.ts +28 -0
- package/ts3.5/dist/commonjs/cookie-banner/index.d.ts +3 -3
- package/ts3.5/dist/commonjs/cookie-banner/lib/CookieBanner.d.ts +19 -2
- package/ts3.5/dist/commonjs/dialog/lib/hooks/useDialogCard.d.ts +4 -16
- package/ts3.5/dist/commonjs/dialog/lib/hooks/useDialogPopper.d.ts +5 -2
- package/ts3.5/dist/commonjs/modal/lib/ModalOverlay.d.ts +4 -2
- package/ts3.5/dist/commonjs/modal/lib/hooks/useModalCard.d.ts +4 -16
- package/ts3.5/dist/commonjs/modal/lib/hooks/useModalHeading.d.ts +5 -17
- package/ts3.5/dist/commonjs/page-header/index.d.ts +3 -3
- package/ts3.5/dist/commonjs/page-header/lib/PageHeader.d.ts +19 -2
- package/ts3.5/dist/commonjs/pagination/lib/Pagination/PageList.d.ts +1 -1
- package/ts3.5/dist/commonjs/pagination/lib/Pagination/Pagination.d.ts +5 -5
- package/ts3.5/dist/commonjs/pagination/lib/Pagination/common/List.d.ts +1 -1
- package/ts3.5/dist/commonjs/pagination/lib/Pagination/common/utils/getValidChildren.d.ts +1 -1
- package/ts3.5/dist/commonjs/popup/lib/hooks/usePopupCard.d.ts +5 -2
- package/ts3.5/dist/commonjs/popup/lib/hooks/usePopupCloseButton.d.ts +4 -2
- package/ts3.5/dist/commonjs/popup/lib/hooks/usePopupHeading.d.ts +5 -2
- package/ts3.5/dist/commonjs/popup/lib/hooks/usePopupPopper.d.ts +4 -2
- package/ts3.5/dist/commonjs/popup/lib/hooks/usePopupTarget.d.ts +4 -2
- package/ts3.5/dist/commonjs/popup/lib/hooks/useReturnFocus.d.ts +1 -1
- package/ts3.5/dist/commonjs/radio/lib/Radio.d.ts +1 -1
- package/ts3.5/dist/commonjs/switch/lib/Switch.d.ts +1 -1
- package/ts3.5/dist/commonjs/table/lib/TableRow.d.ts +5 -4
- package/ts3.5/dist/commonjs/tabs/index.d.ts +5 -0
- package/ts3.5/dist/commonjs/tabs/lib/Tabs.d.ts +35 -7
- package/ts3.5/dist/commonjs/tabs/lib/TabsItem.d.ts +107 -0
- package/ts3.5/dist/commonjs/tabs/lib/TabsList.d.ts +43 -0
- package/ts3.5/dist/commonjs/tabs/lib/TabsMenuPopper.d.ts +21 -0
- package/ts3.5/dist/commonjs/tabs/lib/TabsOverflowButton.d.ts +31 -0
- package/{dist/es6/tabs/lib/TabPanel.d.ts → ts3.5/dist/commonjs/tabs/lib/TabsPanel.d.ts} +39 -29
- package/ts3.5/dist/{es6/tabs/lib/TabList.d.ts → commonjs/tabs/lib/TabsPanels.d.ts} +5 -5
- package/ts3.5/dist/commonjs/tabs/lib/cursor/index.d.ts +1 -1
- package/ts3.5/dist/commonjs/tabs/lib/cursor/useCursorModel.d.ts +23 -13
- package/ts3.5/dist/commonjs/tabs/lib/cursor/useRovingFocus.d.ts +37 -0
- package/ts3.5/dist/commonjs/tabs/lib/list/index.d.ts +2 -1
- package/ts3.5/dist/commonjs/tabs/lib/list/renderItem.d.ts +4 -0
- package/ts3.5/dist/commonjs/tabs/lib/list/useListModel.d.ts +25 -13
- package/ts3.5/dist/commonjs/tabs/lib/list/useListRegisterItem.d.ts +14 -0
- package/ts3.5/dist/commonjs/tabs/lib/menu/Menu.d.ts +80 -0
- package/ts3.5/dist/commonjs/tabs/lib/menu/MenuCard.d.ts +17 -0
- package/ts3.5/dist/commonjs/tabs/lib/menu/MenuItem.d.ts +62 -0
- package/ts3.5/dist/commonjs/tabs/lib/menu/MenuList.d.ts +23 -0
- package/ts3.5/dist/commonjs/tabs/lib/menu/MenuPopper.d.ts +21 -0
- package/ts3.5/dist/commonjs/tabs/lib/menu/MenuTarget.d.ts +21 -0
- package/ts3.5/dist/commonjs/tabs/lib/menu/index.d.ts +8 -0
- package/ts3.5/dist/commonjs/tabs/lib/menu/useMenuModel.d.ts +35 -0
- package/ts3.5/dist/commonjs/tabs/lib/overflow/index.d.ts +5 -0
- package/ts3.5/dist/commonjs/tabs/lib/overflow/useOverflowMeasureContainer.d.ts +8 -0
- package/ts3.5/dist/commonjs/tabs/lib/overflow/useOverflowMeasureItem.d.ts +10 -0
- package/ts3.5/dist/commonjs/tabs/lib/overflow/useOverflowModel.d.ts +69 -0
- package/ts3.5/dist/commonjs/tabs/lib/overflow/useOverflowTarget.d.ts +11 -0
- package/ts3.5/dist/commonjs/tabs/lib/selection/index.d.ts +4 -0
- package/ts3.5/dist/commonjs/tabs/lib/selection/useResetCursorOnBlur.d.ts +13 -0
- package/ts3.5/dist/commonjs/tabs/lib/selection/useSelectionItem.d.ts +8 -0
- package/ts3.5/dist/commonjs/tabs/lib/selection/useSelectionModel.d.ts +62 -0
- package/ts3.5/dist/commonjs/tabs/lib/useTabsModel.d.ts +39 -38
- package/ts3.5/dist/commonjs/tokens/index.d.ts +3 -20
- package/ts3.5/dist/commonjs/tokens/lib/depth.d.ts +109 -3
- package/ts3.5/dist/commonjs/tooltip/lib/useTooltip.d.ts +1 -1
- package/ts3.5/dist/es6/button/lib/PrimaryButton.d.ts +80 -6
- package/ts3.5/dist/es6/button/lib/SecondaryButton.d.ts +8 -5
- package/ts3.5/dist/es6/button/lib/TertiaryButton.d.ts +8 -4
- package/ts3.5/dist/es6/button/lib/parts/ButtonContainer.d.ts +5 -3
- package/ts3.5/dist/es6/button/lib/parts/ButtonLabel.d.ts +1 -1
- package/ts3.5/dist/es6/button/lib/parts/ButtonLabelIcon.d.ts +7 -4
- package/ts3.5/dist/es6/button/lib/types.d.ts +9 -0
- package/ts3.5/dist/es6/checkbox/lib/Checkbox.d.ts +1 -1
- package/ts3.5/dist/es6/common/index.d.ts +1 -0
- package/ts3.5/dist/es6/common/lib/EllipsisText.d.ts +5 -0
- package/ts3.5/dist/es6/common/lib/styles/accessibleHide.d.ts +2 -2
- package/ts3.5/dist/es6/common/lib/theming/breakpoints.d.ts +287 -6
- package/ts3.5/dist/es6/common/lib/theming/types.d.ts +191 -1
- package/ts3.5/dist/es6/common/lib/utils/components.d.ts +19 -9
- package/ts3.5/dist/es6/common/lib/utils/elements.d.ts +2 -2
- package/ts3.5/dist/es6/common/lib/utils/index.d.ts +2 -0
- package/ts3.5/dist/es6/common/lib/utils/useConstant.d.ts +9 -0
- package/ts3.5/dist/es6/common/lib/utils/useResizeObserver.d.ts +3 -0
- package/ts3.5/dist/es6/common/lib/utils/useUniqueId.d.ts +28 -0
- package/ts3.5/dist/es6/cookie-banner/index.d.ts +3 -3
- package/ts3.5/dist/es6/cookie-banner/lib/CookieBanner.d.ts +19 -2
- package/ts3.5/dist/es6/dialog/lib/hooks/useDialogCard.d.ts +4 -16
- package/ts3.5/dist/es6/dialog/lib/hooks/useDialogPopper.d.ts +5 -2
- package/ts3.5/dist/es6/modal/lib/ModalOverlay.d.ts +4 -2
- package/ts3.5/dist/es6/modal/lib/hooks/useModalCard.d.ts +4 -16
- package/ts3.5/dist/es6/modal/lib/hooks/useModalHeading.d.ts +5 -17
- package/ts3.5/dist/es6/page-header/index.d.ts +3 -3
- package/ts3.5/dist/es6/page-header/lib/PageHeader.d.ts +19 -2
- package/ts3.5/dist/es6/pagination/lib/Pagination/PageList.d.ts +1 -1
- package/ts3.5/dist/es6/pagination/lib/Pagination/Pagination.d.ts +5 -5
- package/ts3.5/dist/es6/pagination/lib/Pagination/common/List.d.ts +1 -1
- package/ts3.5/dist/es6/pagination/lib/Pagination/common/utils/getValidChildren.d.ts +1 -1
- package/ts3.5/dist/es6/popup/lib/hooks/usePopupCard.d.ts +5 -2
- package/ts3.5/dist/es6/popup/lib/hooks/usePopupCloseButton.d.ts +4 -2
- package/ts3.5/dist/es6/popup/lib/hooks/usePopupHeading.d.ts +5 -2
- package/ts3.5/dist/es6/popup/lib/hooks/usePopupPopper.d.ts +4 -2
- package/ts3.5/dist/es6/popup/lib/hooks/usePopupTarget.d.ts +4 -2
- package/ts3.5/dist/es6/popup/lib/hooks/useReturnFocus.d.ts +1 -1
- package/ts3.5/dist/es6/radio/lib/Radio.d.ts +1 -1
- package/ts3.5/dist/es6/switch/lib/Switch.d.ts +1 -1
- package/ts3.5/dist/es6/table/lib/TableRow.d.ts +5 -4
- package/ts3.5/dist/es6/tabs/index.d.ts +5 -0
- package/ts3.5/dist/es6/tabs/lib/Tabs.d.ts +35 -7
- package/ts3.5/dist/es6/tabs/lib/TabsItem.d.ts +107 -0
- package/ts3.5/dist/es6/tabs/lib/TabsList.d.ts +43 -0
- package/ts3.5/dist/es6/tabs/lib/TabsMenuPopper.d.ts +21 -0
- package/ts3.5/dist/es6/tabs/lib/TabsOverflowButton.d.ts +31 -0
- package/ts3.5/dist/es6/tabs/lib/{TabPanel.d.ts → TabsPanel.d.ts} +15 -5
- package/{dist/commonjs/tabs/lib/TabList.d.ts → ts3.5/dist/es6/tabs/lib/TabsPanels.d.ts} +15 -15
- package/ts3.5/dist/es6/tabs/lib/cursor/index.d.ts +1 -1
- package/ts3.5/dist/es6/tabs/lib/cursor/useCursorModel.d.ts +23 -13
- package/ts3.5/dist/es6/tabs/lib/cursor/useRovingFocus.d.ts +37 -0
- package/ts3.5/dist/es6/tabs/lib/list/index.d.ts +2 -1
- package/ts3.5/dist/es6/tabs/lib/list/renderItem.d.ts +4 -0
- package/ts3.5/dist/es6/tabs/lib/list/useListModel.d.ts +25 -13
- package/ts3.5/dist/es6/tabs/lib/list/useListRegisterItem.d.ts +14 -0
- package/ts3.5/dist/es6/tabs/lib/menu/Menu.d.ts +80 -0
- package/ts3.5/dist/es6/tabs/lib/menu/MenuCard.d.ts +17 -0
- package/ts3.5/dist/es6/tabs/lib/menu/MenuItem.d.ts +62 -0
- package/ts3.5/dist/es6/tabs/lib/menu/MenuList.d.ts +23 -0
- package/ts3.5/dist/es6/tabs/lib/menu/MenuPopper.d.ts +21 -0
- package/ts3.5/dist/es6/tabs/lib/menu/MenuTarget.d.ts +21 -0
- package/ts3.5/dist/es6/tabs/lib/menu/index.d.ts +8 -0
- package/ts3.5/dist/es6/tabs/lib/menu/useMenuModel.d.ts +35 -0
- package/ts3.5/dist/es6/tabs/lib/overflow/index.d.ts +5 -0
- package/ts3.5/dist/es6/tabs/lib/overflow/useOverflowMeasureContainer.d.ts +8 -0
- package/ts3.5/dist/es6/tabs/lib/overflow/useOverflowMeasureItem.d.ts +10 -0
- package/ts3.5/dist/es6/tabs/lib/overflow/useOverflowModel.d.ts +69 -0
- package/ts3.5/dist/es6/tabs/lib/overflow/useOverflowTarget.d.ts +11 -0
- package/ts3.5/dist/es6/tabs/lib/selection/index.d.ts +4 -0
- package/ts3.5/dist/es6/tabs/lib/selection/useResetCursorOnBlur.d.ts +13 -0
- package/ts3.5/dist/es6/tabs/lib/selection/useSelectionItem.d.ts +8 -0
- package/ts3.5/dist/es6/tabs/lib/selection/useSelectionModel.d.ts +62 -0
- package/ts3.5/dist/es6/tabs/lib/useTabsModel.d.ts +39 -38
- package/ts3.5/dist/es6/tokens/index.d.ts +3 -20
- package/ts3.5/dist/es6/tokens/lib/depth.d.ts +109 -3
- package/ts3.5/dist/es6/tooltip/lib/useTooltip.d.ts +1 -1
- package/dist/commonjs/tabs/lib/Tab.d.ts +0 -49
- package/dist/commonjs/tabs/lib/Tab.d.ts.map +0 -1
- package/dist/commonjs/tabs/lib/Tab.js +0 -95
- package/dist/commonjs/tabs/lib/TabList.d.ts.map +0 -1
- package/dist/commonjs/tabs/lib/TabPanel.d.ts.map +0 -1
- package/dist/commonjs/tabs/lib/TabPanel.js +0 -56
- package/dist/commonjs/tabs/lib/cursor/hooks.d.ts +0 -39
- package/dist/commonjs/tabs/lib/cursor/hooks.d.ts.map +0 -1
- package/dist/commonjs/tabs/lib/hooks.d.ts +0 -10
- package/dist/commonjs/tabs/lib/hooks.d.ts.map +0 -1
- package/dist/commonjs/tabs/lib/list/hooks.d.ts +0 -11
- package/dist/commonjs/tabs/lib/list/hooks.d.ts.map +0 -1
- package/dist/commonjs/tabs/lib/list/hooks.js +0 -39
- package/dist/es6/tabs/lib/Tab.d.ts +0 -49
- package/dist/es6/tabs/lib/Tab.d.ts.map +0 -1
- package/dist/es6/tabs/lib/Tab.js +0 -86
- package/dist/es6/tabs/lib/TabList.d.ts.map +0 -1
- package/dist/es6/tabs/lib/TabPanel.d.ts.map +0 -1
- package/dist/es6/tabs/lib/TabPanel.js +0 -51
- package/dist/es6/tabs/lib/cursor/hooks.d.ts +0 -39
- package/dist/es6/tabs/lib/cursor/hooks.d.ts.map +0 -1
- package/dist/es6/tabs/lib/cursor/hooks.js +0 -108
- package/dist/es6/tabs/lib/hooks.d.ts +0 -10
- package/dist/es6/tabs/lib/hooks.d.ts.map +0 -1
- package/dist/es6/tabs/lib/list/hooks.d.ts +0 -11
- package/dist/es6/tabs/lib/list/hooks.d.ts.map +0 -1
- package/dist/es6/tabs/lib/list/hooks.js +0 -34
- package/tabs/lib/Tab.tsx +0 -170
- package/tabs/lib/TabList.tsx +0 -59
- package/tabs/lib/cursor/hooks.tsx +0 -122
- package/tabs/lib/hooks.tsx +0 -31
- package/tabs/lib/list/hooks.tsx +0 -45
- package/ts3.5/dist/commonjs/tabs/lib/Tab.d.ts +0 -49
- package/ts3.5/dist/commonjs/tabs/lib/cursor/hooks.d.ts +0 -39
- package/ts3.5/dist/commonjs/tabs/lib/hooks.d.ts +0 -10
- package/ts3.5/dist/commonjs/tabs/lib/list/hooks.d.ts +0 -11
- package/ts3.5/dist/es6/tabs/lib/Tab.d.ts +0 -49
- package/ts3.5/dist/es6/tabs/lib/cursor/hooks.d.ts +0 -39
- package/ts3.5/dist/es6/tabs/lib/hooks.d.ts +0 -10
- package/ts3.5/dist/es6/tabs/lib/list/hooks.d.ts +0 -11
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
-
t[p] = s[p];
|
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
|
-
/** @jsx jsx */
|
|
24
|
-
import React from 'react';
|
|
25
|
-
import { jsx, css } from '@emotion/core';
|
|
26
|
-
import { createComponent, mouseFocusBehavior, useLocalRef, useModelContext, useMountLayout, } from '@workday/canvas-kit-react/common';
|
|
27
|
-
import { TabsModelContext } from './Tabs';
|
|
28
|
-
var styles = css(mouseFocusBehavior({
|
|
29
|
-
'&:focus': {
|
|
30
|
-
outline: 'none',
|
|
31
|
-
},
|
|
32
|
-
}));
|
|
33
|
-
export var TabPanel = createComponent('div')({
|
|
34
|
-
displayName: 'Tabs.Panel',
|
|
35
|
-
Component: function (_a, ref, Element) {
|
|
36
|
-
var children = _a.children, _b = _a.name, name = _b === void 0 ? '' : _b, model = _a.model, elemProps = __rest(_a, ["children", "name", "model"]);
|
|
37
|
-
var _c = useModelContext(TabsModelContext, model), state = _c.state, events = _c.events;
|
|
38
|
-
var _d = React.useState(name), tabName = _d[0], setTabName = _d[1];
|
|
39
|
-
var _e = useLocalRef(ref), localRef = _e.localRef, elementRef = _e.elementRef;
|
|
40
|
-
useMountLayout(function () {
|
|
41
|
-
var index = state.panelIndexRef.current;
|
|
42
|
-
var tabName = name || String(index);
|
|
43
|
-
events.registerPanel({ item: { id: tabName, ref: localRef } });
|
|
44
|
-
setTabName(tabName);
|
|
45
|
-
return function () {
|
|
46
|
-
events.unregisterPanel({ id: tabName });
|
|
47
|
-
};
|
|
48
|
-
});
|
|
49
|
-
return (jsx(Element, __assign({ ref: elementRef, role: "tabpanel", css: styles, "aria-labelledby": "tab-" + state.id + "-" + tabName, hidden: !!tabName && tabName !== state.activeTab, id: "tabpanel-" + state.id + "-" + tabName, tabIndex: 0 }, elemProps), children));
|
|
50
|
-
},
|
|
51
|
-
});
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export declare const orientationKeyMap: {
|
|
3
|
-
readonly horizontal: {
|
|
4
|
-
readonly ArrowLeft: "previous";
|
|
5
|
-
readonly Left: "previous";
|
|
6
|
-
readonly ArrowRight: "next";
|
|
7
|
-
readonly Right: "next";
|
|
8
|
-
readonly Home: "first";
|
|
9
|
-
readonly End: "last";
|
|
10
|
-
};
|
|
11
|
-
readonly vertical: {
|
|
12
|
-
readonly ArrowUp: "previous";
|
|
13
|
-
readonly Up: "previous";
|
|
14
|
-
readonly ArrowDown: "next";
|
|
15
|
-
readonly Down: "next";
|
|
16
|
-
readonly Home: "first";
|
|
17
|
-
readonly End: "last";
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* Handles the roving focus behavior of a Cursor model. It should be added to the element
|
|
22
|
-
* representing the list. It does not handle the tabIndex.
|
|
23
|
-
*
|
|
24
|
-
* @see https://www.w3.org/TR/wai-aria-practices/#kbd_roving_tabindex
|
|
25
|
-
*/
|
|
26
|
-
export declare const useRovingFocusList: (model: import("../../../common").Model<import("./useCursorModel").CursorState, import("./useCursorModel").CursorEvents>, elemProps?: {}) => {
|
|
27
|
-
onKeyDown(event: React.KeyboardEvent<Element>): void;
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* Handles the roving focus behavior of a Cursor model. It should be added to the element
|
|
31
|
-
* representing a list item. It does not handle the tabIndex.
|
|
32
|
-
*
|
|
33
|
-
* @see https://www.w3.org/TR/wai-aria-practices/#kbd_roving_tabindex
|
|
34
|
-
*/
|
|
35
|
-
export declare const useRovingFocusItem: ({ state }: import("../../../common").Model<import("./useCursorModel").CursorState, import("./useCursorModel").CursorEvents>, elemProps?: {}) => {
|
|
36
|
-
onFocus(event: React.FocusEvent<Element>): void;
|
|
37
|
-
onBlur(event: React.FocusEvent<Element>): void;
|
|
38
|
-
};
|
|
39
|
-
//# sourceMappingURL=hooks.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../../../tabs/lib/cursor/hooks.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;CAiBpB,CAAC;AAWX;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB;;CAmC9B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB;;;CAuC9B,CAAC"}
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { mergeProps, useIsRTL, useMount } from '@workday/canvas-kit-react/common';
|
|
3
|
-
import { getItem, getNext } from './useCursorModel';
|
|
4
|
-
export var orientationKeyMap = {
|
|
5
|
-
horizontal: {
|
|
6
|
-
ArrowLeft: 'previous',
|
|
7
|
-
Left: 'previous',
|
|
8
|
-
ArrowRight: 'next',
|
|
9
|
-
Right: 'next',
|
|
10
|
-
Home: 'first',
|
|
11
|
-
End: 'last',
|
|
12
|
-
},
|
|
13
|
-
vertical: {
|
|
14
|
-
ArrowUp: 'previous',
|
|
15
|
-
Up: 'previous',
|
|
16
|
-
ArrowDown: 'next',
|
|
17
|
-
Down: 'next',
|
|
18
|
-
Home: 'first',
|
|
19
|
-
End: 'last',
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
var rightToLeftMap = {
|
|
23
|
-
ArrowLeft: 'ArrowRight',
|
|
24
|
-
Left: 'Right',
|
|
25
|
-
ArrowRight: 'ArrowLeft',
|
|
26
|
-
Right: 'Left',
|
|
27
|
-
Home: 'End',
|
|
28
|
-
End: 'Home',
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
31
|
-
* Handles the roving focus behavior of a Cursor model. It should be added to the element
|
|
32
|
-
* representing the list. It does not handle the tabIndex.
|
|
33
|
-
*
|
|
34
|
-
* @see https://www.w3.org/TR/wai-aria-practices/#kbd_roving_tabindex
|
|
35
|
-
*/
|
|
36
|
-
export var useRovingFocusList = function (model, elemProps) {
|
|
37
|
-
if (elemProps === void 0) { elemProps = {}; }
|
|
38
|
-
var state = model.state, events = model.events;
|
|
39
|
-
var stateRef = React.useRef(state);
|
|
40
|
-
stateRef.current = state;
|
|
41
|
-
// keep track of intentional focus changes. Without this state tracking, all changes to
|
|
42
|
-
// `state.cursorId` or `state.items` would result in focus changes. That is definitely not what
|
|
43
|
-
// we want.
|
|
44
|
-
var keyDownRef = React.useRef(false);
|
|
45
|
-
var isRTL = useIsRTL();
|
|
46
|
-
React.useEffect(function () {
|
|
47
|
-
var _a;
|
|
48
|
-
if (keyDownRef.current) {
|
|
49
|
-
var item = getItem(state.cursorId, state.items);
|
|
50
|
-
(_a = item.ref.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
51
|
-
keyDownRef.current = false;
|
|
52
|
-
}
|
|
53
|
-
}, [state.cursorId, state.items]);
|
|
54
|
-
return mergeProps({
|
|
55
|
-
onKeyDown: function (event) {
|
|
56
|
-
Object.keys(orientationKeyMap[state.orientation]).forEach(function (key) {
|
|
57
|
-
var _a;
|
|
58
|
-
if (isRTL ? event.key === rightToLeftMap[key] : event.key === key) {
|
|
59
|
-
var event_1 = orientationKeyMap[state.orientation][key];
|
|
60
|
-
keyDownRef.current = true;
|
|
61
|
-
(_a = events[event_1]) === null || _a === void 0 ? void 0 : _a.call(events);
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
},
|
|
65
|
-
}, elemProps);
|
|
66
|
-
};
|
|
67
|
-
/**
|
|
68
|
-
* Handles the roving focus behavior of a Cursor model. It should be added to the element
|
|
69
|
-
* representing a list item. It does not handle the tabIndex.
|
|
70
|
-
*
|
|
71
|
-
* @see https://www.w3.org/TR/wai-aria-practices/#kbd_roving_tabindex
|
|
72
|
-
*/
|
|
73
|
-
export var useRovingFocusItem = function (_a, elemProps) {
|
|
74
|
-
var state = _a.state;
|
|
75
|
-
if (elemProps === void 0) { elemProps = {}; }
|
|
76
|
-
// Tracks when this element has focus. If this item is removed while still focused, we have to
|
|
77
|
-
// inform the model to move the cursor to the next item.
|
|
78
|
-
var focusRef = React.useRef(false);
|
|
79
|
-
// Create a ref out of state. We don't want to watch state on unmount, so we use a ref to get the
|
|
80
|
-
// current value at the time of unmounting. Otherwise, `state.items` would be a cached value of an
|
|
81
|
-
// empty array
|
|
82
|
-
var stateRef = React.useRef(state);
|
|
83
|
-
stateRef.current = state;
|
|
84
|
-
useMount(function () {
|
|
85
|
-
return function () {
|
|
86
|
-
if (focusRef.current && stateRef.current.items.length) {
|
|
87
|
-
// Unmount is called before state updates are flushed and we'll never get the last state
|
|
88
|
-
// update, so use `getNext` instead of `getItem`
|
|
89
|
-
var item_1 = getNext(stateRef.current.cursorId, stateRef.current.items);
|
|
90
|
-
// If we call `focus` right away, there seems to be a timing issue where the focus handler
|
|
91
|
-
// never gets called. Waiting until just before a frame is rendered seems to ensure the
|
|
92
|
-
// focus handler is called correctly. Removing will make deleting multiple items fail.
|
|
93
|
-
requestAnimationFrame(function () {
|
|
94
|
-
var _a;
|
|
95
|
-
(_a = item_1.ref.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
});
|
|
100
|
-
return mergeProps({
|
|
101
|
-
onFocus: function (event) {
|
|
102
|
-
focusRef.current = true;
|
|
103
|
-
},
|
|
104
|
-
onBlur: function (event) {
|
|
105
|
-
focusRef.current = false;
|
|
106
|
-
},
|
|
107
|
-
}, elemProps);
|
|
108
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* Reset the cursor to the active tab when the tab list looses focus
|
|
4
|
-
*/
|
|
5
|
-
export declare const useResetCursorOnBlur: ({ state, events }: import("../../common").Model<import("./useTabsModel").TabsState, import("./useTabsModel").TabsEvents>, elemProps?: {}) => {
|
|
6
|
-
onKeyDown(event: React.KeyboardEvent<Element>): void;
|
|
7
|
-
onFocus(): void;
|
|
8
|
-
onBlur(): void;
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=hooks.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../../tabs/lib/hooks.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;CAqBhC,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* Handle list registration. Returns an identifier used to identify this item in the list
|
|
4
|
-
* @param model A ListModel
|
|
5
|
-
* @param localRef A RefObject that will be used to register an item
|
|
6
|
-
* @param id Desired identifier for the List Model. If not provided, it will fall back to the index
|
|
7
|
-
* in the list
|
|
8
|
-
* @param index (Optional) Specify the position of the item if the order is expected to change
|
|
9
|
-
*/
|
|
10
|
-
export declare const useRegisterItem: ({ state, events }: import("../../../common").Model<import("./useListModel").ListState, import("./useListModel").ListEvents>, localRef: React.RefObject<any>, id?: string, index?: number | undefined) => string;
|
|
11
|
-
//# sourceMappingURL=hooks.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../../../tabs/lib/list/hooks.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,kNA8B3B,CAAC"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { useMountLayout } from '@workday/canvas-kit-react/common';
|
|
3
|
-
/**
|
|
4
|
-
* Handle list registration. Returns an identifier used to identify this item in the list
|
|
5
|
-
* @param model A ListModel
|
|
6
|
-
* @param localRef A RefObject that will be used to register an item
|
|
7
|
-
* @param id Desired identifier for the List Model. If not provided, it will fall back to the index
|
|
8
|
-
* in the list
|
|
9
|
-
* @param index (Optional) Specify the position of the item if the order is expected to change
|
|
10
|
-
*/
|
|
11
|
-
export var useRegisterItem = function (_a, localRef, id, index) {
|
|
12
|
-
var state = _a.state, events = _a.events;
|
|
13
|
-
if (id === void 0) { id = ''; }
|
|
14
|
-
var _b = React.useState(id), localId = _b[0], setLocalId = _b[1];
|
|
15
|
-
var firstRender = React.useRef(true);
|
|
16
|
-
React.useLayoutEffect(function () {
|
|
17
|
-
if (index !== undefined && !firstRender.current) {
|
|
18
|
-
events.updateItemPosition({ id: localId, index: index });
|
|
19
|
-
}
|
|
20
|
-
// we only care about the index changing
|
|
21
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
22
|
-
}, [index]);
|
|
23
|
-
useMountLayout(function () {
|
|
24
|
-
var defaultId = state.indexRef.current;
|
|
25
|
-
var itemId = id || String(defaultId);
|
|
26
|
-
events.registerItem({ item: { id: itemId, ref: localRef }, index: index });
|
|
27
|
-
setLocalId(itemId);
|
|
28
|
-
firstRender.current = false;
|
|
29
|
-
return function () {
|
|
30
|
-
events.unregisterItem({ id: itemId });
|
|
31
|
-
};
|
|
32
|
-
});
|
|
33
|
-
return localId;
|
|
34
|
-
};
|
package/tabs/lib/Tab.tsx
DELETED
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
import {colors, space, type, borderRadius} from '@workday/canvas-kit-react/tokens';
|
|
4
|
-
import {
|
|
5
|
-
createComponent,
|
|
6
|
-
focusRing,
|
|
7
|
-
hideMouseFocus,
|
|
8
|
-
mergeProps,
|
|
9
|
-
styled,
|
|
10
|
-
StyledType,
|
|
11
|
-
useLocalRef,
|
|
12
|
-
useModelContext,
|
|
13
|
-
} from '@workday/canvas-kit-react/common';
|
|
14
|
-
|
|
15
|
-
import {TabsModelContext} from './Tabs';
|
|
16
|
-
import {TabsModel} from './useTabsModel';
|
|
17
|
-
import {useRegisterItem} from './list';
|
|
18
|
-
import {useRovingFocusItem} from './cursor';
|
|
19
|
-
|
|
20
|
-
export interface TabProps {
|
|
21
|
-
/**
|
|
22
|
-
* Optionally pass index to tab item. This should be done if `Tabs.Item` components were created
|
|
23
|
-
* via a `Array::map` function. This index will ensure keyboard navigation works even if items are
|
|
24
|
-
* inserted out of order.
|
|
25
|
-
*/
|
|
26
|
-
index?: number;
|
|
27
|
-
/**
|
|
28
|
-
* The label text of the Tab.
|
|
29
|
-
*/
|
|
30
|
-
children: React.ReactNode;
|
|
31
|
-
/**
|
|
32
|
-
* The name of the tab. This name will be used in change events and for `initialTab`. Must match
|
|
33
|
-
* the `name` of the associated tab panel. If this property is not provided, it will default to a
|
|
34
|
-
* string representation of the the zero-based index of the Tab when it was initialized.
|
|
35
|
-
*/
|
|
36
|
-
name?: string;
|
|
37
|
-
/**
|
|
38
|
-
* Optionally pass a model directly to this component. Default is to implicitly use the same
|
|
39
|
-
* model as the container component which uses React context. Only use this for advanced use-cases
|
|
40
|
-
*/
|
|
41
|
-
model?: TabsModel;
|
|
42
|
-
/**
|
|
43
|
-
* Optional id. If not set, it will inherit the ID passed to the `Tabs` component and append the
|
|
44
|
-
* index at the end. Only set this for advanced cases.
|
|
45
|
-
*/
|
|
46
|
-
id?: string;
|
|
47
|
-
/**
|
|
48
|
-
* Part of the ARIA specification for tabs. This attributes links a `role=tab` to a
|
|
49
|
-
* `role=tabpanel`. This value must be the same as the associated `id` attribute of the tab panel.
|
|
50
|
-
* This is automatically set by the component and should only be used in advanced cases.
|
|
51
|
-
*/
|
|
52
|
-
'aria-controls'?: string;
|
|
53
|
-
/**
|
|
54
|
-
* Part of the ARIA specification for tabs. Lets screen readers know which tab is active. This
|
|
55
|
-
* should either be `true` or `undefined` and never `false`. This is automatically set by the
|
|
56
|
-
* component and should only be used in advanced cases.
|
|
57
|
-
*/
|
|
58
|
-
'aria-selected'?: boolean;
|
|
59
|
-
/**
|
|
60
|
-
* Part of the ARIA specification for tabs. The currently active tab should not have a `tabIndex` set while
|
|
61
|
-
* all inactive tabs should have a `tabIndex={-1}`
|
|
62
|
-
*/
|
|
63
|
-
tabIndex?: number;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
const StyledButton = styled('button')<{isSelected: boolean} & StyledType>({
|
|
67
|
-
...type.levels.subtext.large,
|
|
68
|
-
fontWeight: type.properties.fontWeights.medium,
|
|
69
|
-
border: 'none',
|
|
70
|
-
backgroundColor: 'transparent',
|
|
71
|
-
flex: '0 0 auto',
|
|
72
|
-
maxWidth: '280px',
|
|
73
|
-
padding: space.s,
|
|
74
|
-
boxSizing: 'border-box',
|
|
75
|
-
cursor: 'pointer',
|
|
76
|
-
color: colors.licorice300,
|
|
77
|
-
position: 'relative',
|
|
78
|
-
marginLeft: `${space.xxxs}`,
|
|
79
|
-
borderRadius: `${borderRadius.m} ${borderRadius.m} 0px 0px`,
|
|
80
|
-
transition: 'background 150ms ease, color 150ms ease',
|
|
81
|
-
|
|
82
|
-
'&:first-of-type': {
|
|
83
|
-
marginLeft: 0,
|
|
84
|
-
},
|
|
85
|
-
|
|
86
|
-
...hideMouseFocus,
|
|
87
|
-
|
|
88
|
-
'&:hover, &:focus': {
|
|
89
|
-
backgroundColor: colors.soap200,
|
|
90
|
-
color: colors.blackPepper400,
|
|
91
|
-
},
|
|
92
|
-
|
|
93
|
-
'&:focus': {
|
|
94
|
-
outline: `none`,
|
|
95
|
-
...focusRing({inset: 'outer', width: 0, separation: 2}),
|
|
96
|
-
},
|
|
97
|
-
|
|
98
|
-
'&:disabled': {
|
|
99
|
-
color: colors.licorice100,
|
|
100
|
-
'&:hover': {
|
|
101
|
-
cursor: 'auto',
|
|
102
|
-
backgroundColor: `transparent`,
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
|
-
|
|
106
|
-
'&[aria-selected=true]': {
|
|
107
|
-
color: colors.blueberry400,
|
|
108
|
-
cursor: 'default',
|
|
109
|
-
'&:after': {
|
|
110
|
-
position: 'absolute',
|
|
111
|
-
height: space.xxxs,
|
|
112
|
-
borderRadius: `${borderRadius.m} ${borderRadius.m} 0px 0px`,
|
|
113
|
-
backgroundColor: colors.blueberry400,
|
|
114
|
-
bottom: 0,
|
|
115
|
-
content: `''`,
|
|
116
|
-
left: 0,
|
|
117
|
-
marginTop: '-2px',
|
|
118
|
-
width: '100%',
|
|
119
|
-
},
|
|
120
|
-
'&:hover, &:focus': {
|
|
121
|
-
backgroundColor: `transparent`,
|
|
122
|
-
color: colors.blueberry400,
|
|
123
|
-
},
|
|
124
|
-
},
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
const useTab = (
|
|
128
|
-
model: TabsModel,
|
|
129
|
-
elemProps: {index?: number; name?: string} = {},
|
|
130
|
-
ref: React.Ref<HTMLButtonElement>
|
|
131
|
-
) => {
|
|
132
|
-
const {localRef, elementRef} = useLocalRef(ref);
|
|
133
|
-
|
|
134
|
-
const name = useRegisterItem(model, localRef, elemProps.name, elemProps.index);
|
|
135
|
-
const {state, events} = model;
|
|
136
|
-
|
|
137
|
-
const onSelect = () => {
|
|
138
|
-
events.activate({tab: name});
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
const isSelected = !!name && state.activeTab === name;
|
|
142
|
-
|
|
143
|
-
return mergeProps(
|
|
144
|
-
{
|
|
145
|
-
id: `tab-${state.id}-${name}`,
|
|
146
|
-
tabIndex: !!name && state.cursorId === name ? undefined : -1,
|
|
147
|
-
'aria-selected': isSelected,
|
|
148
|
-
'aria-controls': `tabpanel-${state.id}-${name}`,
|
|
149
|
-
onClick: onSelect,
|
|
150
|
-
isSelected: isSelected,
|
|
151
|
-
ref: elementRef,
|
|
152
|
-
},
|
|
153
|
-
useRovingFocusItem(model, elemProps)
|
|
154
|
-
);
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
export const Tab = createComponent('button')({
|
|
158
|
-
displayName: 'Tabs.Item',
|
|
159
|
-
Component: ({model, children, ...elemProps}: TabProps, ref, Element) => {
|
|
160
|
-
const localModel = useModelContext(TabsModelContext, model);
|
|
161
|
-
|
|
162
|
-
const props = useTab(localModel, elemProps, ref);
|
|
163
|
-
|
|
164
|
-
return (
|
|
165
|
-
<StyledButton type="button" role="tab" as={Element} {...props}>
|
|
166
|
-
{children}
|
|
167
|
-
</StyledButton>
|
|
168
|
-
);
|
|
169
|
-
},
|
|
170
|
-
});
|
package/tabs/lib/TabList.tsx
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
import {space, commonColors} from '@workday/canvas-kit-react/tokens';
|
|
4
|
-
import {
|
|
5
|
-
composeHooks,
|
|
6
|
-
createComponent,
|
|
7
|
-
styled,
|
|
8
|
-
StyledType,
|
|
9
|
-
useModelContext,
|
|
10
|
-
} from '@workday/canvas-kit-react/common';
|
|
11
|
-
|
|
12
|
-
import {useRovingFocusList} from './cursor';
|
|
13
|
-
import {TabsModelContext} from './Tabs';
|
|
14
|
-
import {useResetCursorOnBlur} from './hooks';
|
|
15
|
-
import {TabsModel} from './useTabsModel';
|
|
16
|
-
|
|
17
|
-
export interface TabListProps {
|
|
18
|
-
/**
|
|
19
|
-
*
|
|
20
|
-
*/
|
|
21
|
-
children: React.ReactNode;
|
|
22
|
-
/**
|
|
23
|
-
* Optionally pass a model directly to this component. Default is to implicitly use the same
|
|
24
|
-
* model as the container component which uses React context. Only use this for advanced use-cases.
|
|
25
|
-
*/
|
|
26
|
-
model?: TabsModel;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const TabsListContainer = styled('div')({
|
|
30
|
-
display: 'inline-block',
|
|
31
|
-
position: 'relative',
|
|
32
|
-
width: `100%`,
|
|
33
|
-
borderBottom: `1px solid ${commonColors.divider}`,
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
const TabsListInnerContainer = styled('div')<StyledType>({
|
|
37
|
-
display: `flex`,
|
|
38
|
-
margin: `0 ${space.m}`,
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
export const TabList = createComponent('div')({
|
|
42
|
-
displayName: 'Tabs.List',
|
|
43
|
-
Component: ({children, model, ...elemProps}: TabListProps, ref, Element) => {
|
|
44
|
-
const localModel = useModelContext(TabsModelContext, model);
|
|
45
|
-
const props = composeHooks(useRovingFocusList, useResetCursorOnBlur)(
|
|
46
|
-
localModel,
|
|
47
|
-
elemProps,
|
|
48
|
-
ref
|
|
49
|
-
);
|
|
50
|
-
|
|
51
|
-
return (
|
|
52
|
-
<TabsListContainer>
|
|
53
|
-
<TabsListInnerContainer as={Element} ref={ref} role="tablist" {...props}>
|
|
54
|
-
{children}
|
|
55
|
-
</TabsListInnerContainer>
|
|
56
|
-
</TabsListContainer>
|
|
57
|
-
);
|
|
58
|
-
},
|
|
59
|
-
});
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {mergeProps, useIsRTL, useMount} from '@workday/canvas-kit-react/common';
|
|
3
|
-
|
|
4
|
-
import {CursorModel, getItem, getNext} from './useCursorModel';
|
|
5
|
-
|
|
6
|
-
export const orientationKeyMap = {
|
|
7
|
-
horizontal: {
|
|
8
|
-
ArrowLeft: 'previous',
|
|
9
|
-
Left: 'previous',
|
|
10
|
-
ArrowRight: 'next',
|
|
11
|
-
Right: 'next',
|
|
12
|
-
Home: 'first',
|
|
13
|
-
End: 'last',
|
|
14
|
-
},
|
|
15
|
-
vertical: {
|
|
16
|
-
ArrowUp: 'previous',
|
|
17
|
-
Up: 'previous',
|
|
18
|
-
ArrowDown: 'next',
|
|
19
|
-
Down: 'next',
|
|
20
|
-
Home: 'first',
|
|
21
|
-
End: 'last',
|
|
22
|
-
},
|
|
23
|
-
} as const;
|
|
24
|
-
|
|
25
|
-
const rightToLeftMap = {
|
|
26
|
-
ArrowLeft: 'ArrowRight',
|
|
27
|
-
Left: 'Right',
|
|
28
|
-
ArrowRight: 'ArrowLeft',
|
|
29
|
-
Right: 'Left',
|
|
30
|
-
Home: 'End',
|
|
31
|
-
End: 'Home',
|
|
32
|
-
} as const;
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Handles the roving focus behavior of a Cursor model. It should be added to the element
|
|
36
|
-
* representing the list. It does not handle the tabIndex.
|
|
37
|
-
*
|
|
38
|
-
* @see https://www.w3.org/TR/wai-aria-practices/#kbd_roving_tabindex
|
|
39
|
-
*/
|
|
40
|
-
export const useRovingFocusList = (model: CursorModel, elemProps = {}) => {
|
|
41
|
-
const {state, events} = model;
|
|
42
|
-
const stateRef = React.useRef(state);
|
|
43
|
-
stateRef.current = state;
|
|
44
|
-
// keep track of intentional focus changes. Without this state tracking, all changes to
|
|
45
|
-
// `state.cursorId` or `state.items` would result in focus changes. That is definitely not what
|
|
46
|
-
// we want.
|
|
47
|
-
const keyDownRef = React.useRef(false);
|
|
48
|
-
const isRTL = useIsRTL();
|
|
49
|
-
|
|
50
|
-
React.useEffect(() => {
|
|
51
|
-
if (keyDownRef.current) {
|
|
52
|
-
const item = getItem(state.cursorId, state.items);
|
|
53
|
-
item.ref.current?.focus();
|
|
54
|
-
|
|
55
|
-
keyDownRef.current = false;
|
|
56
|
-
}
|
|
57
|
-
}, [state.cursorId, state.items]);
|
|
58
|
-
|
|
59
|
-
return mergeProps(
|
|
60
|
-
{
|
|
61
|
-
onKeyDown(event: React.KeyboardEvent) {
|
|
62
|
-
(Object.keys(
|
|
63
|
-
orientationKeyMap[state.orientation]
|
|
64
|
-
) as (keyof typeof orientationKeyMap[typeof state.orientation])[]).forEach(key => {
|
|
65
|
-
if (isRTL ? event.key === rightToLeftMap[key] : event.key === key) {
|
|
66
|
-
const event = orientationKeyMap[state.orientation][key];
|
|
67
|
-
keyDownRef.current = true;
|
|
68
|
-
events[event]?.();
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
elemProps
|
|
74
|
-
);
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* Handles the roving focus behavior of a Cursor model. It should be added to the element
|
|
79
|
-
* representing a list item. It does not handle the tabIndex.
|
|
80
|
-
*
|
|
81
|
-
* @see https://www.w3.org/TR/wai-aria-practices/#kbd_roving_tabindex
|
|
82
|
-
*/
|
|
83
|
-
export const useRovingFocusItem = ({state}: CursorModel, elemProps = {}) => {
|
|
84
|
-
// Tracks when this element has focus. If this item is removed while still focused, we have to
|
|
85
|
-
// inform the model to move the cursor to the next item.
|
|
86
|
-
const focusRef = React.useRef(false);
|
|
87
|
-
|
|
88
|
-
// Create a ref out of state. We don't want to watch state on unmount, so we use a ref to get the
|
|
89
|
-
// current value at the time of unmounting. Otherwise, `state.items` would be a cached value of an
|
|
90
|
-
// empty array
|
|
91
|
-
const stateRef = React.useRef(state);
|
|
92
|
-
stateRef.current = state;
|
|
93
|
-
|
|
94
|
-
useMount(() => {
|
|
95
|
-
return () => {
|
|
96
|
-
if (focusRef.current && stateRef.current.items.length) {
|
|
97
|
-
// Unmount is called before state updates are flushed and we'll never get the last state
|
|
98
|
-
// update, so use `getNext` instead of `getItem`
|
|
99
|
-
const item = getNext(stateRef.current.cursorId, stateRef.current.items);
|
|
100
|
-
|
|
101
|
-
// If we call `focus` right away, there seems to be a timing issue where the focus handler
|
|
102
|
-
// never gets called. Waiting until just before a frame is rendered seems to ensure the
|
|
103
|
-
// focus handler is called correctly. Removing will make deleting multiple items fail.
|
|
104
|
-
requestAnimationFrame(() => {
|
|
105
|
-
item.ref.current?.focus();
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
return mergeProps(
|
|
112
|
-
{
|
|
113
|
-
onFocus(event: React.FocusEvent) {
|
|
114
|
-
focusRef.current = true;
|
|
115
|
-
},
|
|
116
|
-
onBlur(event: React.FocusEvent) {
|
|
117
|
-
focusRef.current = false;
|
|
118
|
-
},
|
|
119
|
-
},
|
|
120
|
-
elemProps
|
|
121
|
-
);
|
|
122
|
-
};
|
package/tabs/lib/hooks.tsx
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {mergeProps} from '@workday/canvas-kit-react/common';
|
|
3
|
-
|
|
4
|
-
import {orientationKeyMap} from './cursor/hooks';
|
|
5
|
-
import {TabsModel} from './useTabsModel';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Reset the cursor to the active tab when the tab list looses focus
|
|
9
|
-
*/
|
|
10
|
-
export const useResetCursorOnBlur = ({state, events}: TabsModel, elemProps = {}) => {
|
|
11
|
-
const programmaticFocusRef = React.useRef(false);
|
|
12
|
-
return mergeProps(
|
|
13
|
-
{
|
|
14
|
-
onKeyDown(event: React.KeyboardEvent) {
|
|
15
|
-
// Programmatic focus only on any focus change via keyboard
|
|
16
|
-
if (Object.keys(orientationKeyMap[state.orientation]).indexOf(event.key) !== -1) {
|
|
17
|
-
programmaticFocusRef.current = true;
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
onFocus() {
|
|
21
|
-
programmaticFocusRef.current = false;
|
|
22
|
-
},
|
|
23
|
-
onBlur() {
|
|
24
|
-
if (!programmaticFocusRef.current) {
|
|
25
|
-
events.goTo({id: state.activeTab});
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
elemProps
|
|
30
|
-
);
|
|
31
|
-
};
|