@workday/canvas-kit-react 7.0.0-alpha.0-next.7 → 7.0.0-alpha.80-next.8
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 +41 -64
- 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/card/lib/Card.tsx +1 -1
- 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 +13 -36
- 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/card/lib/Card.js +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 +18 -1
- package/dist/commonjs/layout/lib/Box.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/Box.js +42 -2
- package/dist/commonjs/layout/lib/Flex.d.ts +1 -1
- package/dist/commonjs/layout/lib/Flex.js +1 -1
- package/dist/commonjs/modal/lib/ModalCard.js +1 -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/PopupCard.js +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/toast/lib/Toast.d.ts.map +1 -1
- package/dist/commonjs/toast/lib/Toast.js +1 -1
- package/dist/commonjs/tokens/lib/depth.d.ts +48 -17
- package/dist/commonjs/tokens/lib/depth.d.ts.map +1 -1
- package/dist/commonjs/tokens/lib/depth.js +14 -9
- 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 +13 -36
- 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/card/lib/Card.js +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 +18 -1
- package/dist/es6/layout/lib/Box.d.ts.map +1 -1
- package/dist/es6/layout/lib/Box.js +40 -1
- package/dist/es6/layout/lib/Flex.d.ts +1 -1
- package/dist/es6/layout/lib/Flex.js +1 -1
- package/dist/es6/modal/lib/ModalCard.js +1 -1
- 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/PopupCard.js +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/toast/lib/Toast.d.ts.map +1 -1
- package/dist/es6/toast/lib/Toast.js +1 -1
- package/dist/es6/tokens/lib/depth.d.ts +48 -17
- package/dist/es6/tokens/lib/depth.d.ts.map +1 -1
- package/dist/es6/tokens/lib/depth.js +14 -9
- 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 +41 -1
- package/layout/lib/Flex.tsx +1 -1
- package/modal/lib/ModalCard.tsx +1 -1
- 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/PopupCard.tsx +1 -1
- 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/toast/lib/Toast.tsx +1 -0
- package/tokens/README.md +11 -8
- package/tokens/lib/depth.ts +60 -24
- 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 +18 -1
- package/ts3.5/dist/commonjs/layout/lib/Flex.d.ts +1 -1
- 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/tokens/lib/depth.d.ts +48 -17
- 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 +18 -1
- package/ts3.5/dist/es6/layout/lib/Flex.d.ts +1 -1
- 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/tokens/lib/depth.d.ts +48 -17
- 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
|
@@ -43,7 +43,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
43
43
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
44
|
exports.DeleteButton = void 0;
|
|
45
45
|
var React = __importStar(require("react"));
|
|
46
|
-
var
|
|
46
|
+
var BaseButton_1 = require("./BaseButton");
|
|
47
47
|
var common_1 = require("@workday/canvas-kit-react/common");
|
|
48
48
|
var getDeleteButtonColors = function (_a) {
|
|
49
49
|
var themeError = _a.canvas.palette.error;
|
|
@@ -63,6 +63,7 @@ var getDeleteButtonColors = function (_a) {
|
|
|
63
63
|
},
|
|
64
64
|
disabled: {
|
|
65
65
|
background: themeError.light,
|
|
66
|
+
opacity: '1',
|
|
66
67
|
},
|
|
67
68
|
});
|
|
68
69
|
};
|
|
@@ -76,7 +77,7 @@ exports.DeleteButton = common_1.createComponent('button')({
|
|
|
76
77
|
// TODO: Fix useTheme and make it a real hook
|
|
77
78
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
78
79
|
theme = _b === void 0 ? common_1.useTheme() : _b, _c = _a.size, size = _c === void 0 ? 'medium' : _c, children = _a.children, elemProps = __rest(_a, ["theme", "size", "children"]);
|
|
79
|
-
return (React.createElement(
|
|
80
|
-
React.createElement(
|
|
80
|
+
return (React.createElement(BaseButton_1.BaseButton, __assign({ padding: BaseButton_1.getPaddingStyles(children, size, undefined, undefined), minWidth: BaseButton_1.getMinWidthStyles(children, size), ref: ref, as: Element, colors: getDeleteButtonColors(theme), size: size }, elemProps),
|
|
81
|
+
React.createElement(BaseButton_1.BaseButton.Label, null, children)));
|
|
81
82
|
},
|
|
82
83
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { GrowthBehavior, Themeable
|
|
2
|
+
import { GrowthBehavior, Themeable } from '@workday/canvas-kit-react/common';
|
|
3
3
|
import { CanvasSystemIcon } from '@workday/design-assets-types';
|
|
4
4
|
import { ButtonSizes, IconPositions } from './types';
|
|
5
5
|
export interface PrimaryButtonProps extends Themeable, GrowthBehavior {
|
|
@@ -15,20 +15,15 @@ export interface PrimaryButtonProps extends Themeable, GrowthBehavior {
|
|
|
15
15
|
* @default 'medium'
|
|
16
16
|
*/
|
|
17
17
|
size?: ButtonSizes;
|
|
18
|
-
/**
|
|
19
|
-
* The data label of the Button.
|
|
20
|
-
* Note: not displayed at `small` size
|
|
21
|
-
*/
|
|
22
|
-
dataLabel?: String;
|
|
23
18
|
/**
|
|
24
19
|
* The icon of the Button.
|
|
25
20
|
* Note: not displayed at `small` size
|
|
26
21
|
*/
|
|
27
22
|
icon?: CanvasSystemIcon;
|
|
28
23
|
/**
|
|
29
|
-
* Button icon positions can either be `
|
|
30
|
-
* If no value is provided, it defaults to `
|
|
31
|
-
* @default '
|
|
24
|
+
* Button icon positions can either be `start` or `end`.
|
|
25
|
+
* If no value is provided, it defaults to `start`.
|
|
26
|
+
* @default 'start'
|
|
32
27
|
*/
|
|
33
28
|
iconPosition?: IconPositions;
|
|
34
29
|
/**
|
|
@@ -39,71 +34,4 @@ export interface PrimaryButtonProps extends Themeable, GrowthBehavior {
|
|
|
39
34
|
children?: React.ReactNode;
|
|
40
35
|
}
|
|
41
36
|
export declare const PrimaryButton: import("../../common").ElementComponent<"button", PrimaryButtonProps>;
|
|
42
|
-
export declare const getPrimaryButtonColors: (variant: 'inverse' | undefined, theme: EmotionCanvasTheme) => {
|
|
43
|
-
default: {
|
|
44
|
-
background: string;
|
|
45
|
-
icon: string;
|
|
46
|
-
label: string;
|
|
47
|
-
labelData?: undefined;
|
|
48
|
-
};
|
|
49
|
-
hover: {
|
|
50
|
-
background: string;
|
|
51
|
-
icon?: undefined;
|
|
52
|
-
label?: undefined;
|
|
53
|
-
labelData?: undefined;
|
|
54
|
-
};
|
|
55
|
-
active: {
|
|
56
|
-
background: string;
|
|
57
|
-
icon?: undefined;
|
|
58
|
-
label?: undefined;
|
|
59
|
-
labelData?: undefined;
|
|
60
|
-
};
|
|
61
|
-
focus: {
|
|
62
|
-
background: string;
|
|
63
|
-
border?: undefined;
|
|
64
|
-
icon?: undefined;
|
|
65
|
-
label?: undefined;
|
|
66
|
-
labelData?: undefined;
|
|
67
|
-
focusRing?: undefined;
|
|
68
|
-
};
|
|
69
|
-
disabled: {
|
|
70
|
-
background: string;
|
|
71
|
-
icon?: undefined;
|
|
72
|
-
label?: undefined;
|
|
73
|
-
labelData?: undefined;
|
|
74
|
-
};
|
|
75
|
-
} | {
|
|
76
|
-
default: {
|
|
77
|
-
background: string;
|
|
78
|
-
icon: string;
|
|
79
|
-
label: string;
|
|
80
|
-
labelData: string;
|
|
81
|
-
};
|
|
82
|
-
hover: {
|
|
83
|
-
background: string;
|
|
84
|
-
icon: string;
|
|
85
|
-
label: string;
|
|
86
|
-
labelData: string;
|
|
87
|
-
};
|
|
88
|
-
active: {
|
|
89
|
-
background: string;
|
|
90
|
-
icon: string;
|
|
91
|
-
label: string;
|
|
92
|
-
labelData: string;
|
|
93
|
-
};
|
|
94
|
-
focus: {
|
|
95
|
-
background: string;
|
|
96
|
-
border: string;
|
|
97
|
-
icon: string;
|
|
98
|
-
label: string;
|
|
99
|
-
labelData: string;
|
|
100
|
-
focusRing: import("@emotion/react").CSSObject;
|
|
101
|
-
};
|
|
102
|
-
disabled: {
|
|
103
|
-
background: string;
|
|
104
|
-
icon: string;
|
|
105
|
-
label: string;
|
|
106
|
-
labelData: string;
|
|
107
|
-
};
|
|
108
|
-
};
|
|
109
37
|
//# sourceMappingURL=PrimaryButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimaryButton.d.ts","sourceRoot":"","sources":["../../../../button/lib/PrimaryButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EACL,cAAc,EAEd,SAAS,
|
|
1
|
+
{"version":3,"file":"PrimaryButton.d.ts","sourceRoot":"","sources":["../../../../button/lib/PrimaryButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EACL,cAAc,EAEd,SAAS,EAIV,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAC,WAAW,EAAE,aAAa,EAAC,MAAM,SAAS,CAAC;AA2EnD,MAAM,WAAW,kBAAmB,SAAQ,SAAS,EAAE,cAAc;IACnE;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB;;;OAGG;IACH,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB;;;;OAIG;IACH,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,eAAO,MAAM,aAAa,uEA+CxB,CAAC"}
|
|
@@ -41,37 +41,11 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
41
41
|
return t;
|
|
42
42
|
};
|
|
43
43
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
|
-
exports.
|
|
44
|
+
exports.PrimaryButton = void 0;
|
|
45
45
|
var React = __importStar(require("react"));
|
|
46
46
|
var common_1 = require("@workday/canvas-kit-react/common");
|
|
47
47
|
var tokens_1 = require("@workday/canvas-kit-react/tokens");
|
|
48
|
-
var
|
|
49
|
-
// Button sizes where data labels are enabled
|
|
50
|
-
var dataLabelSizes = ['medium', 'large'];
|
|
51
|
-
// All disabled buttons are set to 40% opacity.
|
|
52
|
-
// This will eventually live in the ButtonContainer styles, but for now we're scoping it to Primary, Secondary, and Tertiary buttons.
|
|
53
|
-
var disabledButtonOpacity = {
|
|
54
|
-
'&:disabled, &:disabled:active': {
|
|
55
|
-
opacity: 0.4,
|
|
56
|
-
},
|
|
57
|
-
};
|
|
58
|
-
exports.PrimaryButton = common_1.createComponent('button')({
|
|
59
|
-
displayName: 'PrimaryButton',
|
|
60
|
-
Component: function (_a, ref, Element) {
|
|
61
|
-
var
|
|
62
|
-
// TODO: Fix useTheme and make it a real hook
|
|
63
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
64
|
-
_b = _a.theme,
|
|
65
|
-
// TODO: Fix useTheme and make it a real hook
|
|
66
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
67
|
-
theme = _b === void 0 ? common_1.useTheme() : _b, _c = _a.size, size = _c === void 0 ? 'medium' : _c, _d = _a.iconPosition, iconPosition = _d === void 0 ? 'left' : _d, variant = _a.variant, dataLabel = _a.dataLabel, icon = _a.icon, _e = _a.shouldMirrorIcon, shouldMirrorIcon = _e === void 0 ? false : _e, children = _a.children, elemProps = __rest(_a, ["theme", "size", "iconPosition", "variant", "dataLabel", "icon", "shouldMirrorIcon", "children"]);
|
|
68
|
-
return (React.createElement(parts_1.ButtonContainer, __assign({ ref: ref, as: Element, colors: exports.getPrimaryButtonColors(variant, theme), size: size, extraStyles: disabledButtonOpacity }, elemProps),
|
|
69
|
-
icon && iconPosition === 'left' && (React.createElement(parts_1.ButtonLabelIcon, { size: size, iconPosition: iconPosition, icon: icon, shouldMirrorIcon: shouldMirrorIcon })),
|
|
70
|
-
React.createElement(parts_1.ButtonLabel, null, children),
|
|
71
|
-
dataLabel && dataLabelSizes.includes(size) && React.createElement(parts_1.ButtonLabelData, null, dataLabel),
|
|
72
|
-
icon && iconPosition === 'right' && (React.createElement(parts_1.ButtonLabelIcon, { size: size, iconPosition: iconPosition, icon: icon, shouldMirrorIcon: shouldMirrorIcon }))));
|
|
73
|
-
},
|
|
74
|
-
});
|
|
48
|
+
var BaseButton_1 = require("./BaseButton");
|
|
75
49
|
var getPrimaryButtonColors = function (variant, theme) {
|
|
76
50
|
var themePrimary = theme.canvas.palette.primary;
|
|
77
51
|
switch (variant) {
|
|
@@ -102,29 +76,25 @@ var getPrimaryButtonColors = function (variant, theme) {
|
|
|
102
76
|
background: tokens_1.colors.frenchVanilla100,
|
|
103
77
|
icon: tokens_1.colors.blackPepper400,
|
|
104
78
|
label: tokens_1.colors.blackPepper400,
|
|
105
|
-
labelData: tokens_1.colors.blackPepper400,
|
|
106
79
|
},
|
|
107
80
|
hover: {
|
|
108
81
|
background: tokens_1.colors.soap300,
|
|
109
82
|
icon: tokens_1.colors.blackPepper500,
|
|
110
83
|
label: tokens_1.colors.blackPepper500,
|
|
111
|
-
labelData: tokens_1.colors.blackPepper500,
|
|
112
84
|
},
|
|
113
85
|
active: {
|
|
114
|
-
background: tokens_1.colors.
|
|
86
|
+
background: tokens_1.colors.soap400,
|
|
115
87
|
icon: tokens_1.colors.blackPepper500,
|
|
116
88
|
label: tokens_1.colors.blackPepper500,
|
|
117
|
-
labelData: tokens_1.colors.blackPepper500,
|
|
118
89
|
},
|
|
119
90
|
focus: {
|
|
120
91
|
background: tokens_1.colors.frenchVanilla100,
|
|
121
92
|
border: tokens_1.colors.blackPepper400,
|
|
122
93
|
icon: tokens_1.colors.blackPepper400,
|
|
123
94
|
label: tokens_1.colors.blackPepper400,
|
|
124
|
-
labelData: tokens_1.colors.blackPepper400,
|
|
125
95
|
focusRing: common_1.focusRing({
|
|
126
96
|
separation: 1,
|
|
127
|
-
innerColor: tokens_1.colors.
|
|
97
|
+
innerColor: tokens_1.colors.blackPepper400,
|
|
128
98
|
outerColor: tokens_1.colors.frenchVanilla100,
|
|
129
99
|
}, theme),
|
|
130
100
|
},
|
|
@@ -133,9 +103,18 @@ var getPrimaryButtonColors = function (variant, theme) {
|
|
|
133
103
|
background: tokens_1.colors.frenchVanilla100,
|
|
134
104
|
icon: tokens_1.colors.blackPepper400,
|
|
135
105
|
label: tokens_1.colors.blackPepper400,
|
|
136
|
-
labelData: tokens_1.colors.blackPepper400,
|
|
137
106
|
},
|
|
138
107
|
};
|
|
139
108
|
}
|
|
140
109
|
};
|
|
141
|
-
exports.
|
|
110
|
+
exports.PrimaryButton = common_1.createComponent('button')({
|
|
111
|
+
displayName: 'PrimaryButton',
|
|
112
|
+
Component: function (_a, ref, Element) {
|
|
113
|
+
var _b = _a.size, size = _b === void 0 ? 'medium' : _b, _c = _a.iconPosition, iconPosition = _c === void 0 ? 'start' : _c, variant = _a.variant, icon = _a.icon, _d = _a.shouldMirrorIcon, shouldMirrorIcon = _d === void 0 ? false : _d, children = _a.children, elemProps = __rest(_a, ["size", "iconPosition", "variant", "icon", "shouldMirrorIcon", "children"]);
|
|
114
|
+
var theme = common_1.useTheme();
|
|
115
|
+
return (React.createElement(BaseButton_1.BaseButton, __assign({ ref: ref, size: size, colors: getPrimaryButtonColors(variant, theme), padding: BaseButton_1.getPaddingStyles(children, size, icon, iconPosition), minWidth: BaseButton_1.getMinWidthStyles(children, size), as: Element }, elemProps),
|
|
116
|
+
icon && iconPosition === 'start' && (React.createElement(BaseButton_1.BaseButton.Icon, { size: size, iconPosition: iconPosition, icon: icon, shouldMirrorIcon: shouldMirrorIcon })),
|
|
117
|
+
children && React.createElement(BaseButton_1.BaseButton.Label, null, children),
|
|
118
|
+
icon && iconPosition === 'end' && (React.createElement(BaseButton_1.BaseButton.Icon, { size: size, iconPosition: iconPosition, icon: icon, shouldMirrorIcon: shouldMirrorIcon }))));
|
|
119
|
+
},
|
|
120
|
+
});
|
|
@@ -15,11 +15,6 @@ export interface SecondaryButtonProps extends Themeable, GrowthBehavior {
|
|
|
15
15
|
* @default 'medium'
|
|
16
16
|
*/
|
|
17
17
|
size?: ButtonSizes;
|
|
18
|
-
/**
|
|
19
|
-
* The data label of the Button.
|
|
20
|
-
* Note: not displayed at `small` size
|
|
21
|
-
*/
|
|
22
|
-
dataLabel?: String;
|
|
23
18
|
/**
|
|
24
19
|
* The icon of the Button.
|
|
25
20
|
* Note: not displayed at `small` size
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SecondaryButton.d.ts","sourceRoot":"","sources":["../../../../button/lib/SecondaryButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EACL,cAAc,EAEd,SAAS,EACT,kBAAkB,EAGnB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAC,YAAY,EAAE,WAAW,EAAE,aAAa,EAAC,MAAM,SAAS,CAAC;AAGjE,MAAM,WAAW,oBAAqB,SAAQ,SAAS,EAAE,cAAc;IACrE;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAChC;;;;;OAKG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB;;;OAGG;IACH,
|
|
1
|
+
{"version":3,"file":"SecondaryButton.d.ts","sourceRoot":"","sources":["../../../../button/lib/SecondaryButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EACL,cAAc,EAEd,SAAS,EACT,kBAAkB,EAGnB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAC,YAAY,EAAE,WAAW,EAAE,aAAa,EAAC,MAAM,SAAS,CAAC;AAGjE,MAAM,WAAW,oBAAqB,SAAQ,SAAS,EAAE,cAAc;IACrE;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAChC;;;;;OAKG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB;;;OAGG;IACH,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB;;;;OAIG;IACH,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,eAAO,MAAM,eAAe,yEA+C1B,CAAC;AAEH,eAAO,MAAM,wBAAwB,YAC1B,SAAS,GAAG,SAAS,SACvB,kBAAkB,KACxB,YAoFF,CAAC"}
|
|
@@ -45,31 +45,16 @@ exports.getSecondaryButtonColors = exports.SecondaryButton = void 0;
|
|
|
45
45
|
var React = __importStar(require("react"));
|
|
46
46
|
var tokens_1 = require("@workday/canvas-kit-react/tokens");
|
|
47
47
|
var common_1 = require("@workday/canvas-kit-react/common");
|
|
48
|
-
var
|
|
49
|
-
// Button sizes where data labels are enabled
|
|
50
|
-
var dataLabelSizes = ['medium', 'large'];
|
|
51
|
-
// All disabled buttons are set to 40% opacity.
|
|
52
|
-
// This will eventually live in the ButtonContainer styles, but for now we're scoping it to Primary, Secondary, and Tertiary buttons.
|
|
53
|
-
var disabledButtonOpacity = {
|
|
54
|
-
'&:disabled, &:disabled:active': {
|
|
55
|
-
opacity: 0.4,
|
|
56
|
-
},
|
|
57
|
-
};
|
|
48
|
+
var BaseButton_1 = require("./BaseButton");
|
|
58
49
|
exports.SecondaryButton = common_1.createComponent('button')({
|
|
59
50
|
displayName: 'SecondaryButton',
|
|
60
51
|
Component: function (_a, ref, Element) {
|
|
61
|
-
var
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
theme = _b === void 0 ? common_1.useTheme() : _b, _c = _a.size, size = _c === void 0 ? 'medium' : _c, _d = _a.iconPosition, iconPosition = _d === void 0 ? 'left' : _d, variant = _a.variant, dataLabel = _a.dataLabel, icon = _a.icon, _e = _a.shouldMirrorIcon, shouldMirrorIcon = _e === void 0 ? false : _e, children = _a.children, elemProps = __rest(_a, ["theme", "size", "iconPosition", "variant", "dataLabel", "icon", "shouldMirrorIcon", "children"]);
|
|
68
|
-
return (React.createElement(parts_1.ButtonContainer, __assign({ ref: ref, as: Element, colors: exports.getSecondaryButtonColors(variant, theme), size: size, extraStyles: disabledButtonOpacity }, elemProps),
|
|
69
|
-
icon && iconPosition === 'left' && (React.createElement(parts_1.ButtonLabelIcon, { size: size, iconPosition: iconPosition, icon: icon, shouldMirrorIcon: shouldMirrorIcon })),
|
|
70
|
-
React.createElement(parts_1.ButtonLabel, null, children),
|
|
71
|
-
dataLabel && dataLabelSizes.includes(size) && React.createElement(parts_1.ButtonLabelData, null, dataLabel),
|
|
72
|
-
icon && iconPosition === 'right' && (React.createElement(parts_1.ButtonLabelIcon, { size: size, iconPosition: iconPosition, icon: icon, shouldMirrorIcon: shouldMirrorIcon }))));
|
|
52
|
+
var _b = _a.size, size = _b === void 0 ? 'medium' : _b, _c = _a.iconPosition, iconPosition = _c === void 0 ? 'start' : _c, variant = _a.variant, icon = _a.icon, _d = _a.shouldMirrorIcon, shouldMirrorIcon = _d === void 0 ? false : _d, children = _a.children, elemProps = __rest(_a, ["size", "iconPosition", "variant", "icon", "shouldMirrorIcon", "children"]);
|
|
53
|
+
var theme = common_1.useTheme();
|
|
54
|
+
return (React.createElement(BaseButton_1.BaseButton, __assign({ ref: ref, size: size, colors: exports.getSecondaryButtonColors(variant, theme), padding: BaseButton_1.getPaddingStyles(children, size, icon, iconPosition), minWidth: BaseButton_1.getMinWidthStyles(children, size), as: Element }, elemProps),
|
|
55
|
+
icon && iconPosition === 'start' && (React.createElement(BaseButton_1.BaseButton.Icon, { size: size, iconPosition: iconPosition, icon: icon, shouldMirrorIcon: shouldMirrorIcon })),
|
|
56
|
+
children && React.createElement(BaseButton_1.BaseButton.Label, null, children),
|
|
57
|
+
icon && iconPosition === 'end' && (React.createElement(BaseButton_1.BaseButton.Icon, { size: size, iconPosition: iconPosition, icon: icon, shouldMirrorIcon: shouldMirrorIcon }))));
|
|
73
58
|
},
|
|
74
59
|
});
|
|
75
60
|
var getSecondaryButtonColors = function (variant, theme) {
|
|
@@ -83,27 +68,23 @@ var getSecondaryButtonColors = function (variant, theme) {
|
|
|
83
68
|
border: tokens_1.colors.blackPepper400,
|
|
84
69
|
icon: tokens_1.colors.blackPepper400,
|
|
85
70
|
label: tokens_1.colors.blackPepper400,
|
|
86
|
-
labelData: tokens_1.colors.blackPepper400,
|
|
87
71
|
},
|
|
88
72
|
hover: {
|
|
89
73
|
background: tokens_1.colors.blackPepper400,
|
|
90
74
|
border: tokens_1.colors.blackPepper400,
|
|
91
75
|
icon: themePrimary.contrast,
|
|
92
76
|
label: themePrimary.contrast,
|
|
93
|
-
labelData: themePrimary.contrast,
|
|
94
77
|
},
|
|
95
78
|
active: {
|
|
96
79
|
background: tokens_1.colors.blackPepper500,
|
|
97
80
|
border: tokens_1.colors.blackPepper500,
|
|
98
81
|
icon: themePrimary.contrast,
|
|
99
82
|
label: themePrimary.contrast,
|
|
100
|
-
labelData: themePrimary.contrast,
|
|
101
83
|
},
|
|
102
84
|
focus: {
|
|
103
85
|
border: tokens_1.colors.blackPepper400,
|
|
104
86
|
icon: tokens_1.colors.blackPepper400,
|
|
105
87
|
label: tokens_1.colors.blackPepper400,
|
|
106
|
-
labelData: tokens_1.colors.blackPepper400,
|
|
107
88
|
},
|
|
108
89
|
// Identical to 'default' styles. ButtonContainer will set opacity to 40%
|
|
109
90
|
disabled: {
|
|
@@ -111,7 +92,6 @@ var getSecondaryButtonColors = function (variant, theme) {
|
|
|
111
92
|
border: tokens_1.colors.blackPepper400,
|
|
112
93
|
icon: tokens_1.colors.blackPepper400,
|
|
113
94
|
label: tokens_1.colors.blackPepper400,
|
|
114
|
-
labelData: tokens_1.colors.blackPepper400,
|
|
115
95
|
},
|
|
116
96
|
};
|
|
117
97
|
case 'inverse':
|
|
@@ -125,22 +105,19 @@ var getSecondaryButtonColors = function (variant, theme) {
|
|
|
125
105
|
hover: {
|
|
126
106
|
background: tokens_1.colors.soap300,
|
|
127
107
|
border: tokens_1.colors.soap300,
|
|
128
|
-
icon: tokens_1.colors.
|
|
129
|
-
label: tokens_1.colors.
|
|
130
|
-
labelData: tokens_1.colors.blackPepper400,
|
|
108
|
+
icon: tokens_1.colors.blackPepper500,
|
|
109
|
+
label: tokens_1.colors.blackPepper500,
|
|
131
110
|
},
|
|
132
111
|
active: {
|
|
133
112
|
background: tokens_1.colors.soap400,
|
|
134
113
|
border: tokens_1.colors.soap400,
|
|
135
|
-
icon: tokens_1.colors.
|
|
136
|
-
label: tokens_1.colors.
|
|
137
|
-
labelData: tokens_1.colors.blackPepper400,
|
|
114
|
+
icon: tokens_1.colors.blackPepper500,
|
|
115
|
+
label: tokens_1.colors.blackPepper500,
|
|
138
116
|
},
|
|
139
117
|
focus: {
|
|
140
118
|
background: tokens_1.colors.frenchVanilla100,
|
|
141
|
-
icon: tokens_1.colors.
|
|
142
|
-
label: tokens_1.colors.
|
|
143
|
-
labelData: tokens_1.colors.blackPepper400,
|
|
119
|
+
icon: tokens_1.colors.blackPepper500,
|
|
120
|
+
label: tokens_1.colors.blackPepper500,
|
|
144
121
|
focusRing: common_1.focusRing({
|
|
145
122
|
separation: 2,
|
|
146
123
|
innerColor: 'currentColor',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Themeable } from '@workday/canvas-kit-react/common';
|
|
3
3
|
import { CanvasSystemIcon } from '@workday/design-assets-types';
|
|
4
|
-
import {
|
|
4
|
+
import { IconPositions, ButtonSizes } from './types';
|
|
5
5
|
export interface TertiaryButtonProps extends Themeable {
|
|
6
6
|
/**
|
|
7
7
|
* The variant of the TertiaryButton.
|
|
@@ -14,7 +14,7 @@ export interface TertiaryButtonProps extends Themeable {
|
|
|
14
14
|
*
|
|
15
15
|
* @default 'medium'
|
|
16
16
|
*/
|
|
17
|
-
size?:
|
|
17
|
+
size?: ButtonSizes;
|
|
18
18
|
/**
|
|
19
19
|
* Button icon positions can either be `left` or `right`.
|
|
20
20
|
* If no value is provided, it defaults to `left`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TertiaryButton.d.ts","sourceRoot":"","sources":["../../../../button/lib/TertiaryButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"TertiaryButton.d.ts","sourceRoot":"","sources":["../../../../button/lib/TertiaryButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAGL,SAAS,EAKV,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAe,aAAa,EAAE,WAAW,EAAC,MAAM,SAAS,CAAC;AAGjE,MAAM,WAAW,mBAAoB,SAAQ,SAAS;IACpD;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAChC;;;;;OAKG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB;;;;OAIG;IACH,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B;;OAEG;IACH,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB;;OAEG;IACH;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAgJD,eAAO,MAAM,cAAc,wEAkDzB,CAAC"}
|
|
@@ -45,8 +45,8 @@ exports.TertiaryButton = void 0;
|
|
|
45
45
|
var React = __importStar(require("react"));
|
|
46
46
|
var common_1 = require("@workday/canvas-kit-react/common");
|
|
47
47
|
var tokens_1 = require("@workday/canvas-kit-react/tokens");
|
|
48
|
-
var
|
|
49
|
-
var getTertiaryButtonColors = function (variant, theme) {
|
|
48
|
+
var BaseButton_1 = require("./BaseButton");
|
|
49
|
+
var getTertiaryButtonColors = function (variant, theme, children) {
|
|
50
50
|
var themePrimary = theme.canvas.palette.primary;
|
|
51
51
|
if (variant === 'inverse') {
|
|
52
52
|
return {
|
|
@@ -86,66 +86,94 @@ var getTertiaryButtonColors = function (variant, theme) {
|
|
|
86
86
|
else {
|
|
87
87
|
return {
|
|
88
88
|
default: {
|
|
89
|
-
icon: themePrimary.main,
|
|
89
|
+
icon: children ? themePrimary.main : tokens_1.colors.blackPepper400,
|
|
90
90
|
label: themePrimary.main,
|
|
91
91
|
},
|
|
92
92
|
hover: {
|
|
93
93
|
background: tokens_1.colors.soap200,
|
|
94
|
-
icon: themePrimary.dark,
|
|
94
|
+
icon: children ? themePrimary.dark : tokens_1.colors.blackPepper500,
|
|
95
95
|
label: themePrimary.dark,
|
|
96
96
|
},
|
|
97
97
|
active: {
|
|
98
98
|
background: tokens_1.colors.soap300,
|
|
99
|
-
icon: themePrimary.dark,
|
|
99
|
+
icon: children ? themePrimary.dark : tokens_1.colors.blackPepper500,
|
|
100
100
|
label: themePrimary.dark,
|
|
101
101
|
},
|
|
102
102
|
focus: {
|
|
103
|
-
icon: themePrimary.
|
|
104
|
-
label: themePrimary.
|
|
105
|
-
focusRing: common_1.focusRing({}, theme),
|
|
103
|
+
icon: children ? themePrimary.main : tokens_1.colors.blackPepper500,
|
|
104
|
+
label: themePrimary.main,
|
|
105
|
+
focusRing: common_1.focusRing({ innerColor: tokens_1.colors.blueberry400 }, theme),
|
|
106
106
|
},
|
|
107
107
|
disabled: {
|
|
108
|
-
icon: themePrimary.main,
|
|
108
|
+
icon: children ? themePrimary.main : tokens_1.colors.blackPepper400,
|
|
109
109
|
label: themePrimary.main,
|
|
110
110
|
},
|
|
111
111
|
};
|
|
112
112
|
}
|
|
113
113
|
};
|
|
114
|
-
var
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
114
|
+
var StyledButtonLabel = common_1.styled(BaseButton_1.BaseButton.Label)({
|
|
115
|
+
textDecoration: 'underline',
|
|
116
|
+
});
|
|
117
|
+
var StyledTertiaryButtonContainer = common_1.styled(BaseButton_1.BaseButton)({
|
|
118
|
+
border: '0',
|
|
119
|
+
}, function (_a) {
|
|
120
|
+
var allCaps = _a.allCaps;
|
|
121
|
+
return ({
|
|
122
|
+
textTransform: allCaps ? 'uppercase' : undefined,
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
var getPaddingStyles = function (icon, iconPosition, children, size) {
|
|
126
|
+
if (children) {
|
|
127
|
+
// if there is an icon on the left, add 4px extra padding to the right for visual balance
|
|
128
|
+
if (icon && iconPosition === 'start') {
|
|
129
|
+
if (size === 'extraSmall') {
|
|
130
|
+
return "0 " + tokens_1.space.xxs + " 0 " + tokens_1.space.xxxs;
|
|
131
|
+
}
|
|
132
|
+
return "0 " + tokens_1.space.xs + " 0 " + tokens_1.space.xxs;
|
|
133
|
+
}
|
|
134
|
+
// if there is an icon on the right, add 4px extra padding to the left for visual balance
|
|
135
|
+
if (icon && iconPosition === 'end') {
|
|
136
|
+
if (size === 'extraSmall') {
|
|
137
|
+
return "0 " + tokens_1.space.xxxs + " 0 " + tokens_1.space.xxs;
|
|
138
|
+
}
|
|
139
|
+
return "0 " + tokens_1.space.xxs + " 0 " + tokens_1.space.xs;
|
|
140
|
+
}
|
|
141
|
+
// if there is no icon, return the default padding
|
|
142
|
+
return "0 " + tokens_1.space.xxs;
|
|
118
143
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
return "0 " + tokens_1.space.xxs + " 0 " + tokens_1.space.xs;
|
|
144
|
+
else {
|
|
145
|
+
return '0';
|
|
122
146
|
}
|
|
123
|
-
// if there is no icon, return the default padding
|
|
124
|
-
return "0 " + tokens_1.space.xxs;
|
|
125
147
|
};
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
148
|
+
var getMinWidthStyles = function (children, size) {
|
|
149
|
+
var minWidthNum;
|
|
150
|
+
switch (size) {
|
|
151
|
+
case 'large':
|
|
152
|
+
minWidthNum = '48px';
|
|
153
|
+
break;
|
|
154
|
+
case 'medium':
|
|
155
|
+
minWidthNum = tokens_1.space.xl;
|
|
156
|
+
break;
|
|
157
|
+
case 'small':
|
|
158
|
+
minWidthNum = tokens_1.space.l;
|
|
159
|
+
break;
|
|
160
|
+
case 'extraSmall':
|
|
161
|
+
minWidthNum = tokens_1.space.m;
|
|
162
|
+
break;
|
|
163
|
+
default:
|
|
164
|
+
minWidthNum = tokens_1.space.xl;
|
|
165
|
+
break;
|
|
166
|
+
}
|
|
167
|
+
return children ? 'auto' : minWidthNum;
|
|
132
168
|
};
|
|
133
169
|
exports.TertiaryButton = common_1.createComponent('button')({
|
|
134
170
|
displayName: 'TertiaryButton',
|
|
135
171
|
Component: function (_a, ref, Element) {
|
|
136
|
-
var
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
theme = _b === void 0 ? common_1.useTheme() : _b, _c = _a.size, size = _c === void 0 ? 'medium' : _c, _d = _a.iconPosition, iconPosition = _d === void 0 ? 'left' : _d, variant = _a.variant, children = _a.children, icon = _a.icon, _e = _a.shouldMirrorIcon, shouldMirrorIcon = _e === void 0 ? false : _e, allCaps = _a.allCaps, elemProps = __rest(_a, ["theme", "size", "iconPosition", "variant", "children", "icon", "shouldMirrorIcon", "allCaps"]);
|
|
143
|
-
var allContainerStyles = __assign({ borderRadius: tokens_1.borderRadius.m, border: '0', padding: getPaddingStyles(icon, iconPosition), minWidth: 'auto', textTransform: allCaps ? 'uppercase' : undefined, '.wdc-text-button-label': {
|
|
144
|
-
textDecoration: 'underline',
|
|
145
|
-
} }, disabledButtonOpacity);
|
|
146
|
-
return (React.createElement(parts_1.ButtonContainer, __assign({ ref: ref, as: Element, colors: getTertiaryButtonColors(variant, theme), size: size, extraStyles: allContainerStyles }, elemProps),
|
|
147
|
-
icon && iconPosition === 'left' && (React.createElement(parts_1.ButtonLabelIcon, { size: size, iconPosition: iconPosition, icon: icon, shouldMirrorIcon: shouldMirrorIcon })),
|
|
148
|
-
React.createElement(parts_1.ButtonLabel, { className: "wdc-text-button-label" }, children),
|
|
149
|
-
icon && iconPosition === 'right' && (React.createElement(parts_1.ButtonLabelIcon, { size: size, iconPosition: iconPosition, icon: icon, shouldMirrorIcon: shouldMirrorIcon }))));
|
|
172
|
+
var _b = _a.size, size = _b === void 0 ? 'medium' : _b, _c = _a.iconPosition, iconPosition = _c === void 0 ? 'start' : _c, variant = _a.variant, children = _a.children, icon = _a.icon, _d = _a.shouldMirrorIcon, shouldMirrorIcon = _d === void 0 ? false : _d, allCaps = _a.allCaps, elemProps = __rest(_a, ["size", "iconPosition", "variant", "children", "icon", "shouldMirrorIcon", "allCaps"]);
|
|
173
|
+
var theme = common_1.useTheme();
|
|
174
|
+
return (React.createElement(StyledTertiaryButtonContainer, __assign({ ref: ref, as: Element, allCaps: allCaps, colors: getTertiaryButtonColors(variant, theme, children), size: size, padding: getPaddingStyles(icon, iconPosition, children, size), minWidth: getMinWidthStyles(children, size), style: { borderRadius: children ? tokens_1.borderRadius.m : tokens_1.borderRadius.circle } }, elemProps),
|
|
175
|
+
icon && iconPosition === 'start' && (React.createElement(BaseButton_1.BaseButton.Icon, { size: size, iconPosition: iconPosition, icon: icon, shouldMirrorIcon: shouldMirrorIcon })),
|
|
176
|
+
children && React.createElement(StyledButtonLabel, null, children),
|
|
177
|
+
icon && iconPosition === 'end' && (React.createElement(BaseButton_1.BaseButton.Icon, { size: size, iconPosition: iconPosition, icon: icon, shouldMirrorIcon: shouldMirrorIcon }))));
|
|
150
178
|
},
|
|
151
179
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolbarDropdownButton.d.ts","sourceRoot":"","sources":["../../../../button/lib/ToolbarDropdownButton.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,SAAS,
|
|
1
|
+
{"version":3,"file":"ToolbarDropdownButton.d.ts","sourceRoot":"","sources":["../../../../button/lib/ToolbarDropdownButton.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,SAAS,EAKV,MAAM,kCAAkC,CAAC;AAI1C,OAAO,EAAC,sBAAsB,EAAC,MAAM,qBAAqB,CAAC;AAE3D,MAAM,WAAW,0BACf,SAAQ,IAAI,CAAC,sBAAsB,EAAE,SAAS,GAAG,gBAAgB,CAAC,EAChE,SAAS;CAAG;AAwBhB,eAAO,MAAM,qBAAqB,+EAuChC,CAAC"}
|
|
@@ -29,10 +29,9 @@ exports.ToolbarDropdownButton = void 0;
|
|
|
29
29
|
var react_1 = __importDefault(require("react"));
|
|
30
30
|
var tokens_1 = require("@workday/canvas-kit-react/tokens");
|
|
31
31
|
var common_1 = require("@workday/canvas-kit-react/common");
|
|
32
|
-
var
|
|
33
|
-
var parts_1 = require("./parts");
|
|
32
|
+
var BaseButton_1 = require("./BaseButton");
|
|
34
33
|
var canvas_system_icons_web_1 = require("@workday/canvas-system-icons-web");
|
|
35
|
-
var
|
|
34
|
+
var StyledToolbarDropdownButton = common_1.styled(BaseButton_1.BaseButton)({
|
|
36
35
|
padding: tokens_1.space.zero,
|
|
37
36
|
minWidth: tokens_1.space.l,
|
|
38
37
|
width: 'auto',
|
|
@@ -52,7 +51,7 @@ var containerStyles = {
|
|
|
52
51
|
marginRight: 0,
|
|
53
52
|
width: 18,
|
|
54
53
|
},
|
|
55
|
-
};
|
|
54
|
+
});
|
|
56
55
|
exports.ToolbarDropdownButton = common_1.createComponent('button')({
|
|
57
56
|
displayName: 'ToolbarDropdownButton',
|
|
58
57
|
Component: function (_a, ref, Element) {
|
|
@@ -63,9 +62,9 @@ exports.ToolbarDropdownButton = common_1.createComponent('button')({
|
|
|
63
62
|
// TODO: Fix useTheme and make it a real hook
|
|
64
63
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
65
64
|
theme = _b === void 0 ? common_1.useTheme() : _b, icon = _a.icon, _c = _a.shouldMirrorIcon, shouldMirrorIcon = _c === void 0 ? false : _c, children = _a.children, elemProps = __rest(_a, ["theme", "icon", "shouldMirrorIcon", "children"]);
|
|
66
|
-
return (react_1.default.createElement(
|
|
67
|
-
icon ? (react_1.default.createElement(
|
|
68
|
-
react_1.default.createElement(
|
|
65
|
+
return (react_1.default.createElement(StyledToolbarDropdownButton, __assign({ ref: ref, as: Element, colors: getToolbarDropdownButtonColors(theme) }, elemProps),
|
|
66
|
+
icon ? (react_1.default.createElement(BaseButton_1.BaseButton.Icon, { className: 'wdc-toolbar-dropdown-btn-custom-icon', icon: icon, shouldMirrorIcon: shouldMirrorIcon })) : (children),
|
|
67
|
+
react_1.default.createElement(BaseButton_1.BaseButton.Icon, { className: 'wdc-toolbar-dropdown-btn-arrow', icon: canvas_system_icons_web_1.chevronDownSmallIcon, shouldMirrorIcon: shouldMirrorIcon })));
|
|
69
68
|
},
|
|
70
69
|
});
|
|
71
70
|
var getToolbarDropdownButtonColors = function (theme) {
|
|
@@ -89,6 +88,7 @@ var getToolbarDropdownButtonColors = function (theme) {
|
|
|
89
88
|
disabled: {
|
|
90
89
|
icon: tokens_1.colors.soap600,
|
|
91
90
|
background: 'transparent',
|
|
91
|
+
opacity: '1',
|
|
92
92
|
},
|
|
93
93
|
};
|
|
94
94
|
};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { Themeable } from '@workday/canvas-kit-react/common';
|
|
2
|
-
import {
|
|
3
|
-
export interface ToolbarIconButtonProps extends Omit<
|
|
2
|
+
import { TertiaryButtonProps } from './TertiaryButton';
|
|
3
|
+
export interface ToolbarIconButtonProps extends Omit<TertiaryButtonProps, 'size' | 'variant'>, Themeable {
|
|
4
|
+
onToggleChange?: (toggled: boolean | undefined) => void;
|
|
5
|
+
toggled?: boolean;
|
|
6
|
+
shouldMirrorIcon?: boolean;
|
|
4
7
|
}
|
|
5
8
|
export declare const ToolbarIconButton: import("../../common").ElementComponent<"button", ToolbarIconButtonProps>;
|
|
6
9
|
//# sourceMappingURL=ToolbarIconButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolbarIconButton.d.ts","sourceRoot":"","sources":["../../../../button/lib/ToolbarIconButton.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,SAAS,
|
|
1
|
+
{"version":3,"file":"ToolbarIconButton.d.ts","sourceRoot":"","sources":["../../../../button/lib/ToolbarIconButton.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,SAAS,EAKV,MAAM,kCAAkC,CAAC;AAG1C,OAAO,EAAC,mBAAmB,EAAC,MAAM,kBAAkB,CAAC;AAErD,MAAM,WAAW,sBACf,SAAQ,IAAI,CAAC,mBAAmB,EAAE,MAAM,GAAG,SAAS,CAAC,EACnD,SAAS;IACX,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,KAAK,IAAI,CAAC;IACxD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAWD,eAAO,MAAM,iBAAiB,2EAiD5B,CAAC"}
|
|
@@ -46,22 +46,15 @@ exports.ToolbarIconButton = void 0;
|
|
|
46
46
|
var React = __importStar(require("react"));
|
|
47
47
|
var tokens_1 = require("@workday/canvas-kit-react/tokens");
|
|
48
48
|
var common_1 = require("@workday/canvas-kit-react/common");
|
|
49
|
-
var
|
|
50
|
-
var
|
|
51
|
-
var containerStyles = (_a = {
|
|
52
|
-
padding: 0,
|
|
53
|
-
minWidth: tokens_1.space.l,
|
|
54
|
-
width: tokens_1.space.l,
|
|
55
|
-
height: tokens_1.space.l,
|
|
56
|
-
borderRadius: tokens_1.borderRadius.m
|
|
57
|
-
},
|
|
49
|
+
var BaseButton_1 = require("./BaseButton");
|
|
50
|
+
var StyledToolbarIconButton = common_1.styled(BaseButton_1.BaseButton)((_a = {},
|
|
58
51
|
_a['& .wd-icon'] = {
|
|
59
52
|
display: 'inline-block',
|
|
60
53
|
verticalAlign: 'middle',
|
|
61
54
|
width: 20,
|
|
62
55
|
height: 20,
|
|
63
56
|
},
|
|
64
|
-
_a);
|
|
57
|
+
_a));
|
|
65
58
|
exports.ToolbarIconButton = common_1.createComponent('button')({
|
|
66
59
|
displayName: 'ToolbarIconButton',
|
|
67
60
|
Component: function (_a, ref, Element) {
|
|
@@ -84,7 +77,7 @@ exports.ToolbarIconButton = common_1.createComponent('button')({
|
|
|
84
77
|
}
|
|
85
78
|
}
|
|
86
79
|
}, [toggled, onToggleChange]);
|
|
87
|
-
return (React.createElement(
|
|
80
|
+
return (React.createElement(StyledToolbarIconButton, __assign({ ref: ref, as: Element, colors: getToolbarIconButtonColors(theme, toggled), size: 'small', fillIcon: toggled, "aria-pressed": toggled, padding: "zero", minWidth: tokens_1.space.l, width: tokens_1.space.l, height: tokens_1.space.l, borderRadius: tokens_1.borderRadius.m }, elemProps), icon ? React.createElement(BaseButton_1.BaseButton.Icon, { icon: icon, shouldMirrorIcon: shouldMirrorIcon }) : children));
|
|
88
81
|
},
|
|
89
82
|
});
|
|
90
83
|
var getToolbarIconButtonColors = function (theme, toggled) {
|
|
@@ -110,6 +103,7 @@ var getToolbarIconButtonColors = function (theme, toggled) {
|
|
|
110
103
|
disabled: {
|
|
111
104
|
icon: toggled ? themePrimary.light : tokens_1.colors.soap600,
|
|
112
105
|
background: toggled ? themePrimary.lightest : 'transparent',
|
|
106
|
+
opacity: '1',
|
|
113
107
|
},
|
|
114
108
|
};
|
|
115
109
|
};
|