@workday/canvas-kit-react 7.0.0-alpha.0-next.7 → 7.0.0-alpha.78-next.6
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/badge/README.md +2 -3
- package/banner/lib/BannerIcon.tsx +2 -2
- package/button/README.md +68 -1
- package/button/index.ts +1 -1
- package/button/lib/{parts/ButtonContainer.tsx → BaseButton.tsx} +123 -66
- package/button/lib/DeleteButton.tsx +7 -4
- package/button/lib/PrimaryButton.tsx +86 -109
- package/button/lib/SecondaryButton.tsx +44 -66
- package/button/lib/TertiaryButton.tsx +86 -53
- package/button/lib/ToolbarDropdownButton.tsx +12 -11
- package/button/lib/ToolbarIconButton.tsx +22 -17
- package/button/lib/parts/ButtonLabel.tsx +17 -2
- package/button/lib/parts/ButtonLabelIcon.tsx +30 -54
- package/button/lib/parts/index.tsx +0 -2
- package/button/lib/types.ts +2 -2
- package/common/lib/parts/_brand-assets.ts +5 -5
- package/common/lib/utils/StaticStates.tsx +6 -5
- package/dist/commonjs/banner/lib/BannerIcon.js +2 -2
- package/dist/commonjs/button/index.d.ts +1 -1
- package/dist/commonjs/button/index.d.ts.map +1 -1
- package/dist/commonjs/button/index.js +3 -3
- package/dist/commonjs/button/lib/BaseButton.d.ts +31 -0
- package/dist/commonjs/button/lib/BaseButton.d.ts.map +1 -0
- package/dist/commonjs/button/lib/BaseButton.js +198 -0
- package/dist/commonjs/button/lib/DeleteButton.d.ts.map +1 -1
- package/dist/commonjs/button/lib/DeleteButton.js +4 -3
- package/dist/commonjs/button/lib/PrimaryButton.d.ts +4 -76
- package/dist/commonjs/button/lib/PrimaryButton.d.ts.map +1 -1
- package/dist/commonjs/button/lib/PrimaryButton.js +15 -36
- package/dist/commonjs/button/lib/SecondaryButton.d.ts +0 -5
- package/dist/commonjs/button/lib/SecondaryButton.d.ts.map +1 -1
- package/dist/commonjs/button/lib/SecondaryButton.js +16 -38
- package/dist/commonjs/button/lib/TertiaryButton.d.ts +2 -2
- package/dist/commonjs/button/lib/TertiaryButton.d.ts.map +1 -1
- package/dist/commonjs/button/lib/TertiaryButton.js +66 -38
- package/dist/commonjs/button/lib/ToolbarDropdownButton.d.ts.map +1 -1
- package/dist/commonjs/button/lib/ToolbarDropdownButton.js +7 -7
- package/dist/commonjs/button/lib/ToolbarIconButton.d.ts +5 -2
- package/dist/commonjs/button/lib/ToolbarIconButton.d.ts.map +1 -1
- package/dist/commonjs/button/lib/ToolbarIconButton.js +5 -11
- package/dist/commonjs/button/lib/parts/ButtonLabel.d.ts +4 -4
- package/dist/commonjs/button/lib/parts/ButtonLabel.d.ts.map +1 -1
- package/dist/commonjs/button/lib/parts/ButtonLabel.js +35 -1
- package/dist/commonjs/button/lib/parts/ButtonLabelIcon.d.ts +4 -3
- package/dist/commonjs/button/lib/parts/ButtonLabelIcon.d.ts.map +1 -1
- package/dist/commonjs/button/lib/parts/ButtonLabelIcon.js +13 -62
- package/dist/commonjs/button/lib/parts/index.d.ts +0 -2
- package/dist/commonjs/button/lib/parts/index.d.ts.map +1 -1
- package/dist/commonjs/button/lib/parts/index.js +1 -5
- package/dist/commonjs/button/lib/types.d.ts +2 -2
- package/dist/commonjs/button/lib/types.d.ts.map +1 -1
- package/dist/commonjs/common/lib/parts/_brand-assets.d.ts.map +1 -1
- package/dist/commonjs/common/lib/parts/_brand-assets.js +5 -5
- package/dist/commonjs/common/lib/utils/StaticStates.d.ts.map +1 -1
- package/dist/commonjs/common/lib/utils/StaticStates.js +5 -2
- package/dist/commonjs/icon/lib/AccentIcon.d.ts +3 -5
- package/dist/commonjs/icon/lib/AccentIcon.d.ts.map +1 -1
- package/dist/commonjs/icon/lib/AccentIcon.js +8 -24
- package/dist/commonjs/icon/lib/AppletIcon.d.ts +5 -6
- package/dist/commonjs/icon/lib/AppletIcon.d.ts.map +1 -1
- package/dist/commonjs/icon/lib/AppletIcon.js +13 -27
- package/dist/commonjs/icon/lib/Graphic.d.ts +3 -5
- package/dist/commonjs/icon/lib/Graphic.d.ts.map +1 -1
- package/dist/commonjs/icon/lib/Graphic.js +8 -24
- package/dist/commonjs/icon/lib/Icon.d.ts +2 -5
- package/dist/commonjs/icon/lib/Icon.d.ts.map +1 -1
- package/dist/commonjs/icon/lib/Icon.js +10 -25
- package/dist/commonjs/icon/lib/Svg.d.ts +4 -6
- package/dist/commonjs/icon/lib/Svg.d.ts.map +1 -1
- package/dist/commonjs/icon/lib/Svg.js +11 -27
- package/dist/commonjs/icon/lib/SystemIcon.d.ts +5 -6
- package/dist/commonjs/icon/lib/SystemIcon.d.ts.map +1 -1
- package/dist/commonjs/icon/lib/SystemIcon.js +8 -24
- package/dist/commonjs/icon/lib/SystemIconCircle.d.ts +3 -6
- package/dist/commonjs/icon/lib/SystemIconCircle.d.ts.map +1 -1
- package/dist/commonjs/icon/lib/SystemIconCircle.js +7 -25
- package/dist/commonjs/layout/lib/Box.d.ts +17 -0
- package/dist/commonjs/layout/lib/Box.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/Box.js +41 -1
- package/dist/commonjs/modal/lib/ModalOverflowOverlay.js +1 -1
- package/dist/commonjs/pagination/lib/Pagination/Controls.d.ts +2 -2
- package/dist/commonjs/pagination/lib/Pagination/Controls.d.ts.map +1 -1
- package/dist/commonjs/pagination/lib/Pagination/Controls.js +4 -4
- package/dist/commonjs/pagination/lib/Pagination/PageButton.d.ts +1 -2
- package/dist/commonjs/pagination/lib/Pagination/PageButton.d.ts.map +1 -1
- package/dist/commonjs/pagination/lib/Pagination/PageButton.js +34 -9
- package/dist/commonjs/pagination/lib/Pagination/Pagination.d.ts +5 -5
- package/dist/commonjs/pagination/lib/Pagination/Pagination.d.ts.map +1 -1
- package/dist/commonjs/popup/lib/PopupCloseIcon.d.ts +2 -2
- package/dist/commonjs/popup/lib/PopupCloseIcon.d.ts.map +1 -1
- package/dist/commonjs/popup/lib/PopupCloseIcon.js +5 -6
- package/dist/commonjs/popup/lib/hooks/useDisableBodyScroll.d.ts.map +1 -1
- package/dist/commonjs/popup/lib/hooks/useDisableBodyScroll.js +4 -0
- package/dist/commonjs/segmented-control/lib/SegmentedControl.d.ts +9 -7
- package/dist/commonjs/segmented-control/lib/SegmentedControl.d.ts.map +1 -1
- package/dist/commonjs/segmented-control/lib/SegmentedControl.js +21 -57
- package/dist/commonjs/segmented-control/lib/SegmentedControlButton.d.ts +8 -0
- package/dist/commonjs/segmented-control/lib/SegmentedControlButton.d.ts.map +1 -0
- package/dist/commonjs/segmented-control/lib/SegmentedControlButton.js +106 -0
- package/dist/commonjs/side-panel/lib/SidePanel.d.ts.map +1 -1
- package/dist/commonjs/side-panel/lib/SidePanel.js +2 -2
- package/dist/commonjs/tabs/lib/Tabs.d.ts +2 -2
- package/dist/commonjs/tabs/lib/TabsItem.d.ts +1 -2
- package/dist/commonjs/tabs/lib/TabsItem.d.ts.map +1 -1
- package/dist/commonjs/tabs/lib/TabsList.js +1 -1
- package/dist/commonjs/tabs/lib/menu/Menu.d.ts +1 -1
- package/dist/commonjs/tabs/lib/menu/MenuItem.d.ts +1 -2
- package/dist/commonjs/tabs/lib/menu/MenuItem.d.ts.map +1 -1
- package/dist/commonjs/text-input/lib/InputIconContainer.d.ts +1 -1
- package/dist/commonjs/text-input/lib/InputIconContainer.d.ts.map +1 -1
- package/dist/commonjs/tooltip/lib/Tooltip.d.ts +1 -1
- package/dist/commonjs/tooltip/lib/useTooltip.d.ts +1 -1
- package/dist/es6/banner/lib/BannerIcon.js +2 -2
- package/dist/es6/button/index.d.ts +1 -1
- package/dist/es6/button/index.d.ts.map +1 -1
- package/dist/es6/button/index.js +1 -1
- package/dist/es6/button/lib/BaseButton.d.ts +31 -0
- package/dist/es6/button/lib/BaseButton.d.ts.map +1 -0
- package/dist/es6/button/lib/BaseButton.js +174 -0
- package/dist/es6/button/lib/DeleteButton.d.ts.map +1 -1
- package/dist/es6/button/lib/DeleteButton.js +4 -3
- package/dist/es6/button/lib/PrimaryButton.d.ts +4 -76
- package/dist/es6/button/lib/PrimaryButton.d.ts.map +1 -1
- package/dist/es6/button/lib/PrimaryButton.js +15 -35
- package/dist/es6/button/lib/SecondaryButton.d.ts +0 -5
- package/dist/es6/button/lib/SecondaryButton.d.ts.map +1 -1
- package/dist/es6/button/lib/SecondaryButton.js +16 -38
- package/dist/es6/button/lib/TertiaryButton.d.ts +2 -2
- package/dist/es6/button/lib/TertiaryButton.d.ts.map +1 -1
- package/dist/es6/button/lib/TertiaryButton.js +68 -40
- package/dist/es6/button/lib/ToolbarDropdownButton.d.ts.map +1 -1
- package/dist/es6/button/lib/ToolbarDropdownButton.js +8 -8
- package/dist/es6/button/lib/ToolbarIconButton.d.ts +5 -2
- package/dist/es6/button/lib/ToolbarIconButton.d.ts.map +1 -1
- package/dist/es6/button/lib/ToolbarIconButton.js +7 -13
- package/dist/es6/button/lib/parts/ButtonLabel.d.ts +4 -4
- package/dist/es6/button/lib/parts/ButtonLabel.d.ts.map +1 -1
- package/dist/es6/button/lib/parts/ButtonLabel.js +33 -2
- package/dist/es6/button/lib/parts/ButtonLabelIcon.d.ts +4 -3
- package/dist/es6/button/lib/parts/ButtonLabelIcon.d.ts.map +1 -1
- package/dist/es6/button/lib/parts/ButtonLabelIcon.js +13 -42
- package/dist/es6/button/lib/parts/index.d.ts +0 -2
- package/dist/es6/button/lib/parts/index.d.ts.map +1 -1
- package/dist/es6/button/lib/parts/index.js +0 -2
- package/dist/es6/button/lib/types.d.ts +2 -2
- package/dist/es6/button/lib/types.d.ts.map +1 -1
- package/dist/es6/common/lib/parts/_brand-assets.d.ts.map +1 -1
- package/dist/es6/common/lib/parts/_brand-assets.js +5 -5
- package/dist/es6/common/lib/utils/StaticStates.d.ts.map +1 -1
- package/dist/es6/common/lib/utils/StaticStates.js +5 -2
- package/dist/es6/icon/lib/AccentIcon.d.ts +3 -5
- package/dist/es6/icon/lib/AccentIcon.d.ts.map +1 -1
- package/dist/es6/icon/lib/AccentIcon.js +8 -24
- package/dist/es6/icon/lib/AppletIcon.d.ts +5 -6
- package/dist/es6/icon/lib/AppletIcon.d.ts.map +1 -1
- package/dist/es6/icon/lib/AppletIcon.js +11 -25
- package/dist/es6/icon/lib/Graphic.d.ts +3 -5
- package/dist/es6/icon/lib/Graphic.d.ts.map +1 -1
- package/dist/es6/icon/lib/Graphic.js +8 -24
- package/dist/es6/icon/lib/Icon.d.ts +2 -5
- package/dist/es6/icon/lib/Icon.d.ts.map +1 -1
- package/dist/es6/icon/lib/Icon.js +8 -24
- package/dist/es6/icon/lib/Svg.d.ts +4 -6
- package/dist/es6/icon/lib/Svg.d.ts.map +1 -1
- package/dist/es6/icon/lib/Svg.js +10 -27
- package/dist/es6/icon/lib/SystemIcon.d.ts +5 -6
- package/dist/es6/icon/lib/SystemIcon.d.ts.map +1 -1
- package/dist/es6/icon/lib/SystemIcon.js +8 -24
- package/dist/es6/icon/lib/SystemIconCircle.d.ts +3 -6
- package/dist/es6/icon/lib/SystemIconCircle.d.ts.map +1 -1
- package/dist/es6/icon/lib/SystemIconCircle.js +8 -26
- package/dist/es6/layout/lib/Box.d.ts +17 -0
- package/dist/es6/layout/lib/Box.d.ts.map +1 -1
- package/dist/es6/layout/lib/Box.js +39 -0
- package/dist/es6/modal/lib/ModalOverflowOverlay.js +1 -1
- package/dist/es6/pagination/lib/Pagination/Controls.d.ts +2 -2
- package/dist/es6/pagination/lib/Pagination/Controls.d.ts.map +1 -1
- package/dist/es6/pagination/lib/Pagination/Controls.js +5 -5
- package/dist/es6/pagination/lib/Pagination/PageButton.d.ts +1 -2
- package/dist/es6/pagination/lib/Pagination/PageButton.d.ts.map +1 -1
- package/dist/es6/pagination/lib/Pagination/PageButton.js +35 -10
- package/dist/es6/pagination/lib/Pagination/Pagination.d.ts +5 -5
- package/dist/es6/pagination/lib/Pagination/Pagination.d.ts.map +1 -1
- package/dist/es6/popup/lib/PopupCloseIcon.d.ts +2 -2
- package/dist/es6/popup/lib/PopupCloseIcon.d.ts.map +1 -1
- package/dist/es6/popup/lib/PopupCloseIcon.js +6 -7
- package/dist/es6/popup/lib/hooks/useDisableBodyScroll.d.ts.map +1 -1
- package/dist/es6/popup/lib/hooks/useDisableBodyScroll.js +4 -0
- package/dist/es6/segmented-control/lib/SegmentedControl.d.ts +9 -7
- package/dist/es6/segmented-control/lib/SegmentedControl.d.ts.map +1 -1
- package/dist/es6/segmented-control/lib/SegmentedControl.js +20 -57
- package/dist/es6/segmented-control/lib/SegmentedControlButton.d.ts +8 -0
- package/dist/es6/segmented-control/lib/SegmentedControlButton.d.ts.map +1 -0
- package/dist/es6/segmented-control/lib/SegmentedControlButton.js +100 -0
- package/dist/es6/side-panel/lib/SidePanel.d.ts.map +1 -1
- package/dist/es6/side-panel/lib/SidePanel.js +3 -3
- package/dist/es6/tabs/lib/Tabs.d.ts +2 -2
- package/dist/es6/tabs/lib/TabsItem.d.ts +1 -2
- package/dist/es6/tabs/lib/TabsItem.d.ts.map +1 -1
- package/dist/es6/tabs/lib/TabsList.js +1 -1
- package/dist/es6/tabs/lib/menu/Menu.d.ts +1 -1
- package/dist/es6/tabs/lib/menu/MenuItem.d.ts +1 -2
- package/dist/es6/tabs/lib/menu/MenuItem.d.ts.map +1 -1
- package/dist/es6/text-input/lib/InputIconContainer.d.ts +1 -1
- package/dist/es6/text-input/lib/InputIconContainer.d.ts.map +1 -1
- package/dist/es6/tooltip/lib/Tooltip.d.ts +1 -1
- package/dist/es6/tooltip/lib/useTooltip.d.ts +1 -1
- package/icon/README.md +0 -30
- package/icon/lib/AccentIcon.tsx +17 -16
- package/icon/lib/AppletIcon.tsx +18 -12
- package/icon/lib/Graphic.tsx +15 -8
- package/icon/lib/Icon.tsx +10 -8
- package/icon/lib/Svg.tsx +12 -14
- package/icon/lib/SystemIcon.tsx +21 -12
- package/icon/lib/SystemIconCircle.tsx +17 -14
- package/layout/lib/Box.tsx +40 -0
- package/modal/lib/ModalOverflowOverlay.tsx +1 -1
- package/package.json +5 -5
- package/pagination/lib/Pagination/Controls.tsx +6 -10
- package/pagination/lib/Pagination/PageButton.tsx +38 -17
- package/pagination/lib/Pagination/Pagination.tsx +5 -5
- package/popup/lib/PopupCloseIcon.tsx +7 -8
- package/popup/lib/hooks/useDisableBodyScroll.ts +6 -0
- package/segmented-control/README.md +8 -9
- package/segmented-control/lib/SegmentedControl.tsx +39 -78
- package/segmented-control/lib/SegmentedControlButton.tsx +109 -0
- package/side-panel/README.md +3 -3
- package/side-panel/lib/SidePanel.tsx +4 -5
- package/tabs/lib/TabsList.tsx +1 -1
- package/text-input/lib/InputIconContainer.tsx +1 -1
- package/tooltip/README.md +6 -5
- package/tooltip/lib/Tooltip.tsx +1 -1
- package/tooltip/lib/useTooltip.tsx +1 -1
- package/ts3.5/dist/commonjs/button/index.d.ts +1 -1
- package/ts3.5/dist/commonjs/button/lib/BaseButton.d.ts +31 -0
- package/ts3.5/dist/commonjs/button/lib/PrimaryButton.d.ts +4 -76
- package/ts3.5/dist/commonjs/button/lib/SecondaryButton.d.ts +0 -5
- package/ts3.5/dist/commonjs/button/lib/TertiaryButton.d.ts +2 -2
- package/ts3.5/dist/commonjs/button/lib/ToolbarIconButton.d.ts +5 -2
- package/ts3.5/dist/commonjs/button/lib/parts/ButtonLabel.d.ts +4 -4
- package/ts3.5/dist/commonjs/button/lib/parts/ButtonLabelIcon.d.ts +4 -3
- package/ts3.5/dist/commonjs/button/lib/parts/index.d.ts +0 -2
- package/ts3.5/dist/commonjs/button/lib/types.d.ts +2 -2
- package/ts3.5/dist/commonjs/icon/lib/AccentIcon.d.ts +3 -5
- package/ts3.5/dist/commonjs/icon/lib/AppletIcon.d.ts +5 -6
- package/ts3.5/dist/commonjs/icon/lib/Graphic.d.ts +3 -5
- package/ts3.5/dist/commonjs/icon/lib/Icon.d.ts +2 -5
- package/ts3.5/dist/commonjs/icon/lib/Svg.d.ts +4 -6
- package/ts3.5/dist/commonjs/icon/lib/SystemIcon.d.ts +5 -6
- package/ts3.5/dist/commonjs/icon/lib/SystemIconCircle.d.ts +3 -6
- package/ts3.5/dist/commonjs/layout/lib/Box.d.ts +17 -0
- package/ts3.5/dist/commonjs/pagination/lib/Pagination/Controls.d.ts +2 -2
- package/ts3.5/dist/commonjs/pagination/lib/Pagination/PageButton.d.ts +1 -2
- package/ts3.5/dist/commonjs/pagination/lib/Pagination/Pagination.d.ts +5 -5
- package/ts3.5/dist/commonjs/popup/lib/PopupCloseIcon.d.ts +2 -2
- package/ts3.5/dist/commonjs/segmented-control/lib/SegmentedControl.d.ts +9 -7
- package/ts3.5/dist/commonjs/segmented-control/lib/SegmentedControlButton.d.ts +8 -0
- package/ts3.5/dist/commonjs/tabs/lib/Tabs.d.ts +2 -2
- package/ts3.5/dist/commonjs/tabs/lib/TabsItem.d.ts +1 -2
- package/ts3.5/dist/commonjs/tabs/lib/menu/Menu.d.ts +1 -1
- package/ts3.5/dist/commonjs/tabs/lib/menu/MenuItem.d.ts +1 -2
- package/ts3.5/dist/commonjs/text-input/lib/InputIconContainer.d.ts +1 -1
- package/ts3.5/dist/commonjs/tooltip/lib/Tooltip.d.ts +1 -1
- package/ts3.5/dist/commonjs/tooltip/lib/useTooltip.d.ts +1 -1
- package/ts3.5/dist/es6/button/index.d.ts +1 -1
- package/ts3.5/dist/es6/button/lib/BaseButton.d.ts +31 -0
- package/ts3.5/dist/es6/button/lib/PrimaryButton.d.ts +4 -76
- package/ts3.5/dist/es6/button/lib/SecondaryButton.d.ts +0 -5
- package/ts3.5/dist/es6/button/lib/TertiaryButton.d.ts +2 -2
- package/ts3.5/dist/es6/button/lib/ToolbarIconButton.d.ts +5 -2
- package/ts3.5/dist/es6/button/lib/parts/ButtonLabel.d.ts +4 -4
- package/ts3.5/dist/es6/button/lib/parts/ButtonLabelIcon.d.ts +4 -3
- package/ts3.5/dist/es6/button/lib/parts/index.d.ts +0 -2
- package/ts3.5/dist/es6/button/lib/types.d.ts +2 -2
- package/ts3.5/dist/es6/icon/lib/AccentIcon.d.ts +3 -5
- package/ts3.5/dist/es6/icon/lib/AppletIcon.d.ts +5 -6
- package/ts3.5/dist/es6/icon/lib/Graphic.d.ts +3 -5
- package/ts3.5/dist/es6/icon/lib/Icon.d.ts +2 -5
- package/ts3.5/dist/es6/icon/lib/Svg.d.ts +4 -6
- package/ts3.5/dist/es6/icon/lib/SystemIcon.d.ts +5 -6
- package/ts3.5/dist/es6/icon/lib/SystemIconCircle.d.ts +3 -6
- package/ts3.5/dist/es6/layout/lib/Box.d.ts +17 -0
- package/ts3.5/dist/es6/pagination/lib/Pagination/Controls.d.ts +2 -2
- package/ts3.5/dist/es6/pagination/lib/Pagination/PageButton.d.ts +1 -2
- package/ts3.5/dist/es6/pagination/lib/Pagination/Pagination.d.ts +5 -5
- package/ts3.5/dist/es6/popup/lib/PopupCloseIcon.d.ts +2 -2
- package/ts3.5/dist/es6/segmented-control/lib/SegmentedControl.d.ts +9 -7
- package/ts3.5/dist/es6/segmented-control/lib/SegmentedControlButton.d.ts +8 -0
- package/ts3.5/dist/es6/tabs/lib/Tabs.d.ts +2 -2
- package/ts3.5/dist/es6/tabs/lib/TabsItem.d.ts +1 -2
- package/ts3.5/dist/es6/tabs/lib/menu/Menu.d.ts +1 -1
- package/ts3.5/dist/es6/tabs/lib/menu/MenuItem.d.ts +1 -2
- package/ts3.5/dist/es6/text-input/lib/InputIconContainer.d.ts +1 -1
- package/ts3.5/dist/es6/tooltip/lib/Tooltip.d.ts +1 -1
- package/ts3.5/dist/es6/tooltip/lib/useTooltip.d.ts +1 -1
- package/button/lib/IconButton.tsx +0 -279
- package/button/lib/parts/ButtonLabelData.tsx +0 -16
- package/dist/commonjs/button/lib/IconButton.d.ts +0 -44
- package/dist/commonjs/button/lib/IconButton.d.ts.map +0 -1
- package/dist/commonjs/button/lib/IconButton.js +0 -219
- package/dist/commonjs/button/lib/parts/ButtonContainer.d.ts +0 -33
- package/dist/commonjs/button/lib/parts/ButtonContainer.d.ts.map +0 -1
- package/dist/commonjs/button/lib/parts/ButtonContainer.js +0 -126
- package/dist/commonjs/button/lib/parts/ButtonLabelData.d.ts +0 -3
- package/dist/commonjs/button/lib/parts/ButtonLabelData.d.ts.map +0 -1
- package/dist/commonjs/button/lib/parts/ButtonLabelData.js +0 -45
- package/dist/es6/button/lib/IconButton.d.ts +0 -44
- package/dist/es6/button/lib/IconButton.d.ts.map +0 -1
- package/dist/es6/button/lib/IconButton.js +0 -197
- package/dist/es6/button/lib/parts/ButtonContainer.d.ts +0 -33
- package/dist/es6/button/lib/parts/ButtonContainer.d.ts.map +0 -1
- package/dist/es6/button/lib/parts/ButtonContainer.js +0 -120
- package/dist/es6/button/lib/parts/ButtonLabelData.d.ts +0 -3
- package/dist/es6/button/lib/parts/ButtonLabelData.d.ts.map +0 -1
- package/dist/es6/button/lib/parts/ButtonLabelData.js +0 -22
- package/ts3.5/dist/commonjs/button/lib/IconButton.d.ts +0 -44
- package/ts3.5/dist/commonjs/button/lib/parts/ButtonContainer.d.ts +0 -33
- package/ts3.5/dist/commonjs/button/lib/parts/ButtonLabelData.d.ts +0 -3
- package/ts3.5/dist/es6/button/lib/IconButton.d.ts +0 -44
- package/ts3.5/dist/es6/button/lib/parts/ButtonContainer.d.ts +0 -33
- package/ts3.5/dist/es6/button/lib/parts/ButtonLabelData.d.ts +0 -3
|
@@ -1,30 +1,52 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import {styled} from '@workday/canvas-kit-react/common';
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
3
|
+
import {borderRadius, colors, space} from '@workday/canvas-kit-react/tokens';
|
|
4
|
+
import {BaseButton} from '@workday/canvas-kit-react/button';
|
|
5
5
|
|
|
6
6
|
import {PaginationModel} from './types';
|
|
7
7
|
|
|
8
|
-
const
|
|
9
|
-
color: canvas.colors.frenchVanilla100,
|
|
10
|
-
fontWeight: 700,
|
|
11
|
-
pointerEvents: 'none',
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const StyledPageButton = styled(IconButton)<{toggled?: boolean}>(
|
|
8
|
+
const StyledPageButton = styled(BaseButton)<{toggled?: boolean}>(
|
|
15
9
|
{
|
|
16
|
-
|
|
10
|
+
minWidth: space.l,
|
|
11
|
+
width: space.l,
|
|
12
|
+
borderRadius: borderRadius.circle,
|
|
13
|
+
height: space.l,
|
|
17
14
|
},
|
|
18
15
|
({toggled}) => {
|
|
19
|
-
return
|
|
16
|
+
return {
|
|
17
|
+
fontWeight: toggled ? 700 : 'normal',
|
|
18
|
+
};
|
|
20
19
|
}
|
|
21
20
|
);
|
|
22
21
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
const getPaginationButtonColors = (toggled: boolean) => {
|
|
23
|
+
return {
|
|
24
|
+
default: {
|
|
25
|
+
background: toggled ? colors.blueberry400 : 'transparent',
|
|
26
|
+
label: toggled ? colors.frenchVanilla100 : colors.blackPepper400,
|
|
27
|
+
},
|
|
28
|
+
hover: {
|
|
29
|
+
background: toggled ? colors.blueberry400 : colors.soap300,
|
|
30
|
+
label: toggled ? colors.frenchVanilla100 : colors.blackPepper400,
|
|
31
|
+
},
|
|
32
|
+
active: {
|
|
33
|
+
background: toggled ? colors.blueberry400 : 'transparent',
|
|
34
|
+
label: toggled ? colors.frenchVanilla100 : colors.blackPepper400,
|
|
35
|
+
},
|
|
36
|
+
focus: {
|
|
37
|
+
background: toggled ? colors.blueberry400 : 'transparent',
|
|
38
|
+
label: toggled ? colors.frenchVanilla100 : colors.blackPepper400,
|
|
39
|
+
},
|
|
40
|
+
disabled: {
|
|
41
|
+
background: colors.licorice100,
|
|
42
|
+
},
|
|
27
43
|
};
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export type PageButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
47
|
+
model: PaginationModel;
|
|
48
|
+
pageNumber: number;
|
|
49
|
+
};
|
|
28
50
|
|
|
29
51
|
export const PageButton = ({
|
|
30
52
|
model,
|
|
@@ -43,11 +65,10 @@ export const PageButton = ({
|
|
|
43
65
|
return (
|
|
44
66
|
<StyledPageButton
|
|
45
67
|
aria-current={isCurrentPage ? 'page' : undefined}
|
|
68
|
+
colors={getPaginationButtonColors(isCurrentPage)}
|
|
46
69
|
aria-pressed={undefined}
|
|
47
70
|
onClick={handleClick}
|
|
48
|
-
size="small"
|
|
49
71
|
toggled={isCurrentPage}
|
|
50
|
-
variant="square"
|
|
51
72
|
{...elemProps}
|
|
52
73
|
>
|
|
53
74
|
{children || pageNumber}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import {TertiaryButtonProps} from '@workday/canvas-kit-react/button';
|
|
3
3
|
|
|
4
4
|
import {PaginationModel} from './types';
|
|
5
5
|
import {usePaginationModel, UsePaginationModelConfig} from './usePaginationModel';
|
|
@@ -78,7 +78,7 @@ Pagination.Controls = (props: ControlsProps) => {
|
|
|
78
78
|
};
|
|
79
79
|
|
|
80
80
|
Pagination.JumpToFirstButton = (
|
|
81
|
-
props:
|
|
81
|
+
props: TertiaryButtonProps & React.ButtonHTMLAttributes<HTMLButtonElement>
|
|
82
82
|
) => {
|
|
83
83
|
// The linter doesn't recognize the dot syntax, so we're disabling the rule
|
|
84
84
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
@@ -87,7 +87,7 @@ Pagination.JumpToFirstButton = (
|
|
|
87
87
|
};
|
|
88
88
|
|
|
89
89
|
Pagination.StepToPreviousButton = (
|
|
90
|
-
props:
|
|
90
|
+
props: TertiaryButtonProps & React.ButtonHTMLAttributes<HTMLButtonElement>
|
|
91
91
|
) => {
|
|
92
92
|
// The linter doesn't recognize the dot syntax, so we're disabling the rule
|
|
93
93
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
@@ -96,7 +96,7 @@ Pagination.StepToPreviousButton = (
|
|
|
96
96
|
};
|
|
97
97
|
|
|
98
98
|
Pagination.StepToNextButton = (
|
|
99
|
-
props:
|
|
99
|
+
props: TertiaryButtonProps & React.ButtonHTMLAttributes<HTMLButtonElement>
|
|
100
100
|
) => {
|
|
101
101
|
// The linter doesn't recognize the dot syntax, so we're disabling the rule
|
|
102
102
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
@@ -105,7 +105,7 @@ Pagination.StepToNextButton = (
|
|
|
105
105
|
};
|
|
106
106
|
|
|
107
107
|
Pagination.JumpToLastButton = (
|
|
108
|
-
props:
|
|
108
|
+
props: TertiaryButtonProps & React.ButtonHTMLAttributes<HTMLButtonElement>
|
|
109
109
|
) => {
|
|
110
110
|
// The linter doesn't recognize the dot syntax, so we're disabling the rule
|
|
111
111
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
@@ -8,14 +8,13 @@ import {
|
|
|
8
8
|
useModelContext,
|
|
9
9
|
ExtractProps,
|
|
10
10
|
} from '@workday/canvas-kit-react/common';
|
|
11
|
-
import {
|
|
11
|
+
import {TertiaryButton} from '@workday/canvas-kit-react/button';
|
|
12
12
|
|
|
13
13
|
import {usePopupCloseButton, PopupModel, PopupModelContext} from './hooks';
|
|
14
14
|
|
|
15
|
-
const closeIconSpacing =
|
|
16
|
-
const closeIconSpacingSmall = 9;
|
|
15
|
+
const closeIconSpacing = 4;
|
|
17
16
|
|
|
18
|
-
export interface PopupCloseIconProps extends ExtractProps<typeof
|
|
17
|
+
export interface PopupCloseIconProps extends ExtractProps<typeof TertiaryButton, never> {
|
|
19
18
|
/**
|
|
20
19
|
* Optionally pass a model directly to this component. Default is to implicitly use the same
|
|
21
20
|
* model as the container component which uses React context. Only use this for advanced use-cases
|
|
@@ -23,13 +22,13 @@ export interface PopupCloseIconProps extends ExtractProps<typeof IconButton, nev
|
|
|
23
22
|
model?: PopupModel;
|
|
24
23
|
}
|
|
25
24
|
|
|
26
|
-
const StyledCloseIcon = styled(
|
|
25
|
+
const StyledCloseIcon = styled(TertiaryButton)<StyledType & PopupCloseIconProps>(
|
|
27
26
|
{
|
|
28
27
|
position: 'absolute',
|
|
29
28
|
},
|
|
30
29
|
({size}) => ({
|
|
31
|
-
right:
|
|
32
|
-
top:
|
|
30
|
+
right: closeIconSpacing,
|
|
31
|
+
top: closeIconSpacing,
|
|
33
32
|
})
|
|
34
33
|
);
|
|
35
34
|
|
|
@@ -42,6 +41,6 @@ export const PopupCloseIcon = createComponent('button')({
|
|
|
42
41
|
) => {
|
|
43
42
|
const localModel = useModelContext(PopupModelContext, model);
|
|
44
43
|
const props = usePopupCloseButton(localModel, elemProps, ref);
|
|
45
|
-
return <StyledCloseIcon as={Element}
|
|
44
|
+
return <StyledCloseIcon as={Element} size={size} icon={xIcon} {...props} />;
|
|
46
45
|
},
|
|
47
46
|
});
|
|
@@ -16,11 +16,17 @@ export const useDisableBodyScroll = (model: PopupModel, elemProps = {}) => {
|
|
|
16
16
|
if (!visible) {
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
19
|
+
|
|
20
|
+
const overflowY = document.body.style.overflowY;
|
|
21
|
+
const overflowX = document.body.style.overflowX;
|
|
19
22
|
const overflow = document.body.style.overflow;
|
|
23
|
+
|
|
20
24
|
document.body.style.overflow = 'hidden';
|
|
21
25
|
|
|
22
26
|
return () => {
|
|
23
27
|
document.body.style.overflow = overflow;
|
|
28
|
+
document.body.style.overflowY = overflowY;
|
|
29
|
+
document.body.style.overflowX = overflowX;
|
|
24
30
|
};
|
|
25
31
|
}, [visible]);
|
|
26
32
|
|
|
@@ -14,17 +14,16 @@ yarn add @workday/canvas-kit-react
|
|
|
14
14
|
```tsx
|
|
15
15
|
import * as React from 'react';
|
|
16
16
|
import {SegmentedControl} from '@workday/canvas-kit-react/segmented-control';
|
|
17
|
-
import {IconButton} from '@workday/canvas-kit-react/button';
|
|
18
17
|
import {listViewIcon, worksheetsIcon} from '@workday/canvas-system-icons-web';
|
|
19
18
|
|
|
20
19
|
<SegmentedControl>
|
|
21
|
-
<
|
|
22
|
-
<
|
|
20
|
+
<SegmentedControl.Button icon={listViewIcon} aria-label="List View" value="list-view" />
|
|
21
|
+
<SegmentedControl.Button icon={worksheetsIcon} aria-label="Table view" value="table-view" />
|
|
23
22
|
</SegmentedControl>;
|
|
24
23
|
```
|
|
25
24
|
|
|
26
|
-
**Note:** while managing state using a unique `value` for each `
|
|
27
|
-
|
|
25
|
+
**Note:** while managing state using a unique `value` for each `Button` child is encouraged, you can
|
|
26
|
+
also use indexes and omit the `value` field. It is strongly recommended to not mix these two
|
|
28
27
|
methods.
|
|
29
28
|
|
|
30
29
|
## Static Properties
|
|
@@ -35,9 +34,9 @@ methods.
|
|
|
35
34
|
|
|
36
35
|
### Required
|
|
37
36
|
|
|
38
|
-
#### `children:
|
|
37
|
+
#### `children:React.ReactElement<SegmentedControlButtonProps>[]`
|
|
39
38
|
|
|
40
|
-
>
|
|
39
|
+
> Buttons to toggle between.
|
|
41
40
|
|
|
42
41
|
---
|
|
43
42
|
|
|
@@ -45,8 +44,8 @@ methods.
|
|
|
45
44
|
|
|
46
45
|
#### `value: string | number`
|
|
47
46
|
|
|
48
|
-
> Identify which item is selected (toggled=true). If a string is passed, the
|
|
49
|
-
> corresponding value will be selected. If a number is passed, the
|
|
47
|
+
> Identify which item is selected (toggled=true). If a string is passed, the Button with the
|
|
48
|
+
> corresponding value will be selected. If a number is passed, the Button with the corresponding
|
|
50
49
|
> index will be selected.
|
|
51
50
|
|
|
52
51
|
---
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
|
|
3
|
+
import {createComponent} from '@workday/canvas-kit-react/common';
|
|
4
|
+
import {SegmentedControlButton, SegmentedControlButtonProps} from './SegmentedControlButton';
|
|
5
5
|
|
|
6
6
|
export interface SegmentedControlProps {
|
|
7
7
|
/**
|
|
8
|
-
* The
|
|
8
|
+
* The Button children of the SegmentedControl (must be at least two).
|
|
9
9
|
* TODO: Add support for text children
|
|
10
10
|
*/
|
|
11
|
-
children: React.ReactElement<
|
|
11
|
+
children: React.ReactElement<SegmentedControlButtonProps>[];
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* The value or index of the
|
|
15
|
-
* If a string is provided, the
|
|
16
|
-
* If a number is provided, the
|
|
14
|
+
* The value or index of the Button that the SegmentedControl should be toggled on to.
|
|
15
|
+
* If a string is provided, the Button with the corresponding value will be selected.
|
|
16
|
+
* If a number is provided, the Button with the corresponding index will be selected.
|
|
17
17
|
* @default 0
|
|
18
18
|
*/
|
|
19
19
|
value?: string | number;
|
|
@@ -26,54 +26,6 @@ export interface SegmentedControlProps {
|
|
|
26
26
|
onChange?: (value: string | number) => void;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
const SegmentedControlContainer = styled('div')(
|
|
30
|
-
{
|
|
31
|
-
'& button': {
|
|
32
|
-
borderRadius: borderRadius.zero,
|
|
33
|
-
border: `1px solid ${colors.soap500}`,
|
|
34
|
-
borderLeft: 'none',
|
|
35
|
-
'&[aria-pressed="true"]': {
|
|
36
|
-
borderColor: colors.blueberry400,
|
|
37
|
-
'&:hover, &:focus:hover': {
|
|
38
|
-
background: colors.blueberry400,
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
'&:first-of-type': {
|
|
42
|
-
borderRadius: `${borderRadius.m} 0 0 ${borderRadius.m}`,
|
|
43
|
-
borderLeft: `1px solid ${colors.soap500}`,
|
|
44
|
-
},
|
|
45
|
-
'&:last-of-type': {
|
|
46
|
-
borderRadius: `0 ${borderRadius.m} ${borderRadius.m} 0`,
|
|
47
|
-
},
|
|
48
|
-
'&:focus': {
|
|
49
|
-
borderRadius: borderRadius.m,
|
|
50
|
-
zIndex: 1,
|
|
51
|
-
animation: 'none', // reset focusRing animation
|
|
52
|
-
transition: 'all 120ms, border-radius 1ms',
|
|
53
|
-
...mouseFocusBehavior({
|
|
54
|
-
'&': {
|
|
55
|
-
borderRadius: borderRadius.zero,
|
|
56
|
-
'&:first-of-type': {
|
|
57
|
-
borderRadius: `${borderRadius.m} 0 0 ${borderRadius.m}`,
|
|
58
|
-
},
|
|
59
|
-
'&:last-of-type': {
|
|
60
|
-
borderRadius: `0 ${borderRadius.m} ${borderRadius.m} 0`,
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
}),
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
({theme}) => ({
|
|
68
|
-
'& button[aria-pressed="true"]': {
|
|
69
|
-
borderColor: theme.canvas.palette.primary.main,
|
|
70
|
-
'&:hover, &:focus:hover': {
|
|
71
|
-
background: theme.canvas.palette.primary.main,
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
})
|
|
75
|
-
);
|
|
76
|
-
|
|
77
29
|
const onButtonClick = (
|
|
78
30
|
existingOnClick: ((e: React.MouseEvent<HTMLButtonElement>) => void) | undefined,
|
|
79
31
|
onChange: ((value: string | number) => void) | undefined,
|
|
@@ -94,28 +46,37 @@ const onButtonClick = (
|
|
|
94
46
|
}
|
|
95
47
|
};
|
|
96
48
|
|
|
97
|
-
const SegmentedControl = (
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
49
|
+
export const SegmentedControl = createComponent('div')({
|
|
50
|
+
displayName: 'SegmentedControl',
|
|
51
|
+
Component: ({value = 0, children, onChange, ...elemProps}: SegmentedControlProps, ref) => {
|
|
52
|
+
return (
|
|
53
|
+
<div {...elemProps}>
|
|
54
|
+
{React.Children.map(
|
|
55
|
+
children,
|
|
56
|
+
(
|
|
57
|
+
child: React.ReactElement<
|
|
58
|
+
SegmentedControlButtonProps & {
|
|
59
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
60
|
+
} & React.HTMLAttributes<HTMLButtonElement> // segmented control button will have correct props
|
|
61
|
+
>,
|
|
62
|
+
index: number
|
|
63
|
+
) => {
|
|
64
|
+
if (typeof child.type === typeof SegmentedControlButton) {
|
|
65
|
+
return React.cloneElement(child, {
|
|
66
|
+
toggled: typeof value === 'number' ? index === value : child.props.value === value,
|
|
67
|
+
onClick: onButtonClick.bind(undefined, child.props.onClick, onChange, index),
|
|
68
|
+
});
|
|
69
|
+
}
|
|
114
70
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
);
|
|
71
|
+
return child;
|
|
72
|
+
}
|
|
73
|
+
)}
|
|
74
|
+
</div>
|
|
75
|
+
);
|
|
76
|
+
},
|
|
77
|
+
subComponents: {
|
|
78
|
+
Button: SegmentedControlButton,
|
|
79
|
+
},
|
|
80
|
+
});
|
|
120
81
|
|
|
121
82
|
export default SegmentedControl;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {BaseButton, ButtonColors} from '@workday/canvas-kit-react/button';
|
|
3
|
+
import {
|
|
4
|
+
createComponent,
|
|
5
|
+
mouseFocusBehavior,
|
|
6
|
+
styled,
|
|
7
|
+
StyledType,
|
|
8
|
+
} from '@workday/canvas-kit-react/common';
|
|
9
|
+
import {CanvasSystemIcon} from '@workday/design-assets-types';
|
|
10
|
+
import {colors, borderRadius, space} from '@workday/canvas-kit-react/tokens';
|
|
11
|
+
|
|
12
|
+
const getIconButtonColors = (toggled?: boolean): ButtonColors => {
|
|
13
|
+
return {
|
|
14
|
+
default: {
|
|
15
|
+
background: toggled ? colors.blueberry400 : colors.soap200,
|
|
16
|
+
icon: toggled ? colors.frenchVanilla100 : colors.licorice200,
|
|
17
|
+
},
|
|
18
|
+
hover: {
|
|
19
|
+
background: toggled ? colors.blueberry400 : colors.soap300,
|
|
20
|
+
icon: toggled ? colors.frenchVanilla100 : colors.licorice500,
|
|
21
|
+
},
|
|
22
|
+
active: {
|
|
23
|
+
background: toggled ? colors.blueberry400 : colors.soap500,
|
|
24
|
+
icon: toggled ? colors.frenchVanilla100 : colors.licorice500,
|
|
25
|
+
},
|
|
26
|
+
focus: {
|
|
27
|
+
background: toggled ? colors.blueberry400 : undefined,
|
|
28
|
+
icon: toggled ? colors.frenchVanilla100 : colors.licorice500,
|
|
29
|
+
},
|
|
30
|
+
disabled: {
|
|
31
|
+
background: toggled ? colors.soap100 : colors.soap100,
|
|
32
|
+
icon: colors.soap600,
|
|
33
|
+
opacity: '1',
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const StyledButton = styled(BaseButton)<StyledType>(
|
|
39
|
+
{
|
|
40
|
+
borderRadius: borderRadius.zero,
|
|
41
|
+
border: `1px solid ${colors.soap500}`,
|
|
42
|
+
borderLeft: 'none',
|
|
43
|
+
minWidth: space.xl,
|
|
44
|
+
'&:first-of-type': {
|
|
45
|
+
borderRadius: `${borderRadius.m} 0 0 ${borderRadius.m}`,
|
|
46
|
+
borderLeft: `1px solid ${colors.soap500}`,
|
|
47
|
+
},
|
|
48
|
+
'&:last-of-type': {
|
|
49
|
+
borderRadius: `0 ${borderRadius.m} ${borderRadius.m} 0`,
|
|
50
|
+
},
|
|
51
|
+
'&[aria-pressed="true"]': {
|
|
52
|
+
borderColor: `${colors.blueberry400} !important`,
|
|
53
|
+
'&:hover, &:focus:hover': {
|
|
54
|
+
background: colors.blueberry400,
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
'&:focus': {
|
|
58
|
+
borderRadius: borderRadius.m,
|
|
59
|
+
zIndex: 1,
|
|
60
|
+
animation: 'none', // reset focusRing animation
|
|
61
|
+
transition: 'all 120ms, border-radius 1ms',
|
|
62
|
+
...mouseFocusBehavior({
|
|
63
|
+
'&': {
|
|
64
|
+
borderRadius: borderRadius.zero,
|
|
65
|
+
'&:first-of-type': {
|
|
66
|
+
borderRadius: `${borderRadius.m} 0 0 ${borderRadius.m}`,
|
|
67
|
+
},
|
|
68
|
+
'&:last-of-type': {
|
|
69
|
+
borderRadius: `0 ${borderRadius.m} ${borderRadius.m} 0`,
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
}),
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
({theme}) => ({
|
|
76
|
+
'[aria-pressed="true"]': {
|
|
77
|
+
borderColor: theme.canvas.palette.primary.main,
|
|
78
|
+
'&:hover, &:focus:hover': {
|
|
79
|
+
background: theme.canvas.palette.primary.main,
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
})
|
|
83
|
+
);
|
|
84
|
+
|
|
85
|
+
export interface SegmentedControlButtonProps {
|
|
86
|
+
toggled?: boolean;
|
|
87
|
+
icon: CanvasSystemIcon;
|
|
88
|
+
value?: string | number;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export const SegmentedControlButton = createComponent('button')({
|
|
92
|
+
displayName: 'Button',
|
|
93
|
+
Component: ({value, icon, toggled, ...props}: SegmentedControlButtonProps, ref, Element) => {
|
|
94
|
+
console.warn(props);
|
|
95
|
+
return (
|
|
96
|
+
<StyledButton
|
|
97
|
+
as={Element}
|
|
98
|
+
aria-pressed={toggled}
|
|
99
|
+
value={value}
|
|
100
|
+
colors={getIconButtonColors(toggled)}
|
|
101
|
+
fillIcon={toggled}
|
|
102
|
+
ref={ref}
|
|
103
|
+
{...props}
|
|
104
|
+
>
|
|
105
|
+
<BaseButton.Icon size="large" icon={icon} />
|
|
106
|
+
</StyledButton>
|
|
107
|
+
);
|
|
108
|
+
},
|
|
109
|
+
});
|
package/side-panel/README.md
CHANGED
|
@@ -15,7 +15,7 @@ yarn add @workday/canvas-kit-react
|
|
|
15
15
|
|
|
16
16
|
```tsx
|
|
17
17
|
import * as React from 'react';
|
|
18
|
-
import {SecondaryButton,
|
|
18
|
+
import {SecondaryButton, TertiaryButton} from '@workday/canvas-kit-react/button';
|
|
19
19
|
import SidePanel from '@workday/canvas-kit-react/side-panel';
|
|
20
20
|
|
|
21
21
|
interface SidePanelState {
|
|
@@ -41,9 +41,9 @@ class SidePanelExample extends React.Component<{}, SidePanelState> {
|
|
|
41
41
|
{open ? (
|
|
42
42
|
<SecondaryButton variant="primary">Add New</SecondaryButton>
|
|
43
43
|
) : (
|
|
44
|
-
<
|
|
44
|
+
<TertiaryButton size="small" variant="filled">
|
|
45
45
|
<SystemIcon icon={plusIcon} />
|
|
46
|
-
</
|
|
46
|
+
</TertiaryButton>
|
|
47
47
|
)}
|
|
48
48
|
<ul>
|
|
49
49
|
<li css={listItemStyles}>{open && <span>Home</span>}</li>
|
|
@@ -4,7 +4,7 @@ import throttle from 'lodash/throttle';
|
|
|
4
4
|
|
|
5
5
|
import {CanvasSystemIcon} from '@workday/design-assets-types';
|
|
6
6
|
import {colors, space, type, CanvasSpaceValues} from '@workday/canvas-kit-react/tokens';
|
|
7
|
-
import {
|
|
7
|
+
import {TertiaryButton, TertiaryButtonProps} from '@workday/canvas-kit-react/button';
|
|
8
8
|
import {chevronLeftIcon, chevronRightIcon} from '@workday/canvas-system-icons-web';
|
|
9
9
|
|
|
10
10
|
export interface SidePanelProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
@@ -141,7 +141,9 @@ const ChildrenContainer = styled('div')<Pick<SidePanelProps, 'openWidth' | 'open
|
|
|
141
141
|
})
|
|
142
142
|
);
|
|
143
143
|
|
|
144
|
-
const ToggleButton = styled(
|
|
144
|
+
const ToggleButton = styled(TertiaryButton)<
|
|
145
|
+
TertiaryButtonProps & Pick<SidePanelProps, 'openDirection'>
|
|
146
|
+
>(
|
|
145
147
|
{
|
|
146
148
|
position: 'absolute',
|
|
147
149
|
bottom: space.s,
|
|
@@ -220,11 +222,8 @@ export default class SidePanel extends React.Component<SidePanelProps, SidePanel
|
|
|
220
222
|
<ToggleButton
|
|
221
223
|
openDirection={openDirection}
|
|
222
224
|
aria-label={open ? closeNavigationAriaLabel : openNavigationAriaLabel}
|
|
223
|
-
toggled={false}
|
|
224
|
-
size="small"
|
|
225
225
|
onClick={this.onToggleClick}
|
|
226
226
|
icon={this.toggleButtonDirection(open, openDirection)}
|
|
227
|
-
variant="circleFilled"
|
|
228
227
|
/>
|
|
229
228
|
)}
|
|
230
229
|
</SidePanelFooter>
|
package/tabs/lib/TabsList.tsx
CHANGED
|
@@ -5,7 +5,7 @@ import {space} from '@workday/canvas-kit-react/tokens';
|
|
|
5
5
|
import {SystemIcon} from '@workday/canvas-kit-react/icon';
|
|
6
6
|
|
|
7
7
|
export interface InputIconContainerProps extends GrowthBehavior {
|
|
8
|
-
icon?: React.ReactElement<SystemIcon>;
|
|
8
|
+
icon?: React.ReactElement<typeof SystemIcon>;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
const Container = styled('div')<InputIconContainerProps>(({grow}) => ({
|
package/tooltip/README.md
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
A Tooltip component that renders information/text when the user hovers over an element. A tooltip is
|
|
4
4
|
used to label or describe an element. By default, a tooltip will label an element. This is useful
|
|
5
|
-
for
|
|
5
|
+
for TertiaryButtons that render just an icon. A tooltip can also be used to describe additional
|
|
6
|
+
information about an element
|
|
6
7
|
|
|
7
8
|
[> Workday Design Reference](https://design.workday.com/components/popups/tooltips)
|
|
8
9
|
|
|
@@ -18,12 +19,12 @@ yarn add @workday/canvas-kit-react
|
|
|
18
19
|
import * as React from 'react';
|
|
19
20
|
|
|
20
21
|
import {Tooltip} from '@workday/canvas-kit-react/tooltip';
|
|
21
|
-
import {
|
|
22
|
+
import {TertiaryButton} from '@workday/canvas-kit-react/button';
|
|
22
23
|
|
|
23
24
|
const TooltipExample = () => {
|
|
24
25
|
return (
|
|
25
26
|
<Tooltip title="Close">
|
|
26
|
-
<
|
|
27
|
+
<TertiaryButton icon={xIcon} aria-label="Close" />
|
|
27
28
|
</Tooltip>
|
|
28
29
|
);
|
|
29
30
|
};
|
|
@@ -60,8 +61,8 @@ const TooltipExample = () => {
|
|
|
60
61
|
> Determines the tooltip type for accessibility.
|
|
61
62
|
>
|
|
62
63
|
> - `label`: Sets the accessible name for the wrapped element. Use for icons or if tooltip `title`
|
|
63
|
-
> prop is the same as the text content of the wrapped element. E.g.
|
|
64
|
-
> tooltips.
|
|
64
|
+
> prop is the same as the text content of the wrapped element. E.g. TertiaryButtons that render an
|
|
65
|
+
> icon or Ellipsis tooltips.
|
|
65
66
|
> - `describe`: Sets `aria-describedby` of the wrapped element. Use if the tooltip has additional
|
|
66
67
|
> information about the target. **Note**: Assistive technology may ignore `describe` techniques
|
|
67
68
|
> based on verbosity settings. Consider an alternate way to inform a user of additional important
|
package/tooltip/lib/Tooltip.tsx
CHANGED
|
@@ -31,7 +31,7 @@ export interface TooltipProps extends Omit<React.HTMLAttributes<HTMLDivElement>,
|
|
|
31
31
|
* Determines the tooltip type for accessibility.
|
|
32
32
|
*
|
|
33
33
|
* - `label`: Sets the accessible name for the wrapped element. Use for icons or if tooltip
|
|
34
|
-
* `title` prop is the same as the text content of the wrapped element. E.g.
|
|
34
|
+
* `title` prop is the same as the text content of the wrapped element. E.g. TertiaryButtons that render an icon or
|
|
35
35
|
* Ellipsis tooltips.
|
|
36
36
|
* - `describe`: Sets `aria-describedby` of the wrapped element. Use if the tooltip has additional
|
|
37
37
|
* information about the target.
|
|
@@ -62,7 +62,7 @@ export function useTooltip<T extends Element = Element>({
|
|
|
62
62
|
* Determines the tooltip type for accessibility.
|
|
63
63
|
*
|
|
64
64
|
* - `label`: Sets the accessible name for the wrapped element. Use for icons or if tooltip
|
|
65
|
-
* `title` prop is the same as the text content of the wrapped element. E.g.
|
|
65
|
+
* `title` prop is the same as the text content of the wrapped element. E.g. TertiaryButton that renders an icon or
|
|
66
66
|
* Ellipsis tooltips.
|
|
67
67
|
* - `describe`: Sets `aria-describedby` of the wrapped element. Use if the tooltip has additional
|
|
68
68
|
* information about the target.
|
|
@@ -3,9 +3,9 @@ export { SecondaryButton, SecondaryButtonProps } from './lib/SecondaryButton';
|
|
|
3
3
|
export { TertiaryButton, TertiaryButtonProps } from './lib/TertiaryButton';
|
|
4
4
|
export { DeleteButton, DeleteButtonProps } from './lib/DeleteButton';
|
|
5
5
|
export { DeprecatedButton as deprecated_Button, DeprecatedButtonProps, } from './lib/deprecated_Button';
|
|
6
|
-
export { IconButton, IconButtonProps } from './lib/IconButton';
|
|
7
6
|
export { ToolbarIconButton, ToolbarIconButtonProps } from './lib/ToolbarIconButton';
|
|
8
7
|
export { ToolbarDropdownButton, ToolbarDropdownButtonProps } from './lib/ToolbarDropdownButton';
|
|
9
8
|
export { Hyperlink, HyperlinkProps } from './lib/Hyperlink';
|
|
9
|
+
export { BaseButton, ButtonContainerProps } from './lib/BaseButton';
|
|
10
10
|
export * from './lib/types';
|
|
11
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { GrowthBehavior } from '@workday/canvas-kit-react/common';
|
|
3
|
+
import { BoxProps } from '@workday/canvas-kit-react/layout';
|
|
4
|
+
import { ButtonColors, ButtonSizes, IconPositions, TertiaryButtonSizes } from './types';
|
|
5
|
+
import { CanvasSystemIcon } from '@workday/design-assets-types';
|
|
6
|
+
export interface ButtonContainerProps extends BoxProps, GrowthBehavior {
|
|
7
|
+
colors?: ButtonColors;
|
|
8
|
+
/**
|
|
9
|
+
* There are four button sizes: `extraSmall`, `small`, `medium`, and `large`.
|
|
10
|
+
* If no size is provided, it will default to `medium`.
|
|
11
|
+
*
|
|
12
|
+
* @default 'medium'
|
|
13
|
+
*/
|
|
14
|
+
size?: ButtonSizes;
|
|
15
|
+
/**
|
|
16
|
+
* The ref to the button that the styled component renders.
|
|
17
|
+
*/
|
|
18
|
+
ref?: React.Ref<HTMLButtonElement>;
|
|
19
|
+
/**
|
|
20
|
+
* Whether the icon should received filled (colored background layer) or regular styles.
|
|
21
|
+
* Corresponds to `toggled` in ToolbarIconButton
|
|
22
|
+
*/
|
|
23
|
+
fillIcon?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export declare const getMinWidthStyles: (children: React.ReactNode, size: ButtonSizes | TertiaryButtonSizes) => "24px" | "32px" | "40px" | "80px" | "auto" | "48px" | "112px" | "96px";
|
|
26
|
+
export declare const getPaddingStyles: (children: React.ReactNode, size: ButtonSizes | TertiaryButtonSizes, icon: CanvasSystemIcon | undefined, iconPosition: IconPositions | undefined) => string | 0;
|
|
27
|
+
export declare const BaseButton: import("../../common").ElementComponent<"button", ButtonContainerProps> & {
|
|
28
|
+
Icon: import("../../common").ElementComponent<"span", import("./parts/ButtonLabelIcon").ButtonLabelIconProps>;
|
|
29
|
+
Label: import("../../common").ElementComponent<"span", import("./parts/ButtonLabel").ButtonLabelProps>;
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=BaseButton.d.ts.map
|