@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
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import * as React from 'react';
|
|
24
|
+
import { ButtonLabelIcon } from './parts/ButtonLabelIcon';
|
|
25
|
+
import { ButtonLabel } from './parts/ButtonLabel';
|
|
26
|
+
import { createComponent, mouseFocusBehavior, focusRing, styled, } from '@workday/canvas-kit-react/common';
|
|
27
|
+
import { boxStyleFn } from '@workday/canvas-kit-react/layout';
|
|
28
|
+
import { borderRadius, space, spaceNumbers, type } from '@workday/canvas-kit-react/tokens';
|
|
29
|
+
function getIconColorSelectors(_a, color, fill) {
|
|
30
|
+
var themePrimary = _a.canvas.palette.primary;
|
|
31
|
+
return {
|
|
32
|
+
'&:focus span, &:hover span, & span': {
|
|
33
|
+
'.wd-icon-fill, .wd-icon-accent, .wd-icon-accent2': {
|
|
34
|
+
fill: color,
|
|
35
|
+
},
|
|
36
|
+
'.wd-icon-background': {
|
|
37
|
+
fill: fill ? color : undefined,
|
|
38
|
+
},
|
|
39
|
+
'.wd-icon-background ~ .wd-icon-accent, .wd-icon-background ~ .wd-icon-accent2': {
|
|
40
|
+
fill: fill
|
|
41
|
+
? color === themePrimary.contrast
|
|
42
|
+
? themePrimary.main
|
|
43
|
+
: themePrimary.contrast
|
|
44
|
+
: color,
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
var ButtonContainer = styled('button')(__assign(__assign({}, type.levels.subtext.large), { cursor: 'pointer', display: 'inline-flex', alignItems: 'center', justifyContent: 'center', boxSizing: 'border-box', boxShadow: 'none', outline: 'none', fontWeight: type.properties.fontWeights.bold, lineHeight: 'normal', whiteSpace: 'nowrap', WebkitFontSmoothing: 'antialiased', MozOsxFontSmoothing: 'grayscale', borderRadius: borderRadius.circle, position: 'relative', verticalAlign: 'middle', overflow: 'hidden', border: '1px solid transparent', background: 'transparent', transition: 'box-shadow 120ms linear, border 120ms linear, background-color 120ms linear, color 120ms linear', '&:disabled, &:disabled:active': {
|
|
50
|
+
cursor: 'default',
|
|
51
|
+
boxShadow: 'none',
|
|
52
|
+
opacity: 0.4,
|
|
53
|
+
}, '&:hover:active': { transitionDuration: '40ms' }, '& > *:first-of-type': {
|
|
54
|
+
marginLeft: '0',
|
|
55
|
+
}, '& > *:last-of-type': {
|
|
56
|
+
marginRight: 0,
|
|
57
|
+
} }), function (_a) {
|
|
58
|
+
var size = _a.size;
|
|
59
|
+
switch (size) {
|
|
60
|
+
case 'large':
|
|
61
|
+
return __assign(__assign({}, type.levels.body.small), { fontWeight: type.properties.fontWeights.bold, height: '48px', '& > * ': {
|
|
62
|
+
margin: "0 " + spaceNumbers.xxs / 2 + "px",
|
|
63
|
+
} });
|
|
64
|
+
case 'medium':
|
|
65
|
+
default:
|
|
66
|
+
return {
|
|
67
|
+
height: space.xl,
|
|
68
|
+
'& > * ': {
|
|
69
|
+
margin: "0 " + spaceNumbers.xxs / 2 + "px",
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
case 'small':
|
|
73
|
+
return {
|
|
74
|
+
height: space.l,
|
|
75
|
+
'& > * ': {
|
|
76
|
+
margin: "0 " + spaceNumbers.xxxs / 2 + "px",
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
case 'extraSmall':
|
|
80
|
+
return __assign(__assign({}, type.levels.subtext.medium), { fontWeight: type.properties.fontWeights.bold, height: space.m, '& > * ': {
|
|
81
|
+
margin: "0 " + spaceNumbers.xxxs / 2 + "px",
|
|
82
|
+
} });
|
|
83
|
+
}
|
|
84
|
+
}, function (_a) {
|
|
85
|
+
var grow = _a.grow;
|
|
86
|
+
return grow && { width: '100%', maxWidth: '100%' };
|
|
87
|
+
}, function (_a) {
|
|
88
|
+
var colors = _a.colors, fillIcon = _a.fillIcon, theme = _a.theme;
|
|
89
|
+
if (!colors) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
var baseStyles = __assign({ backgroundColor: colors.default.background, borderColor: colors.default.border, color: colors.default.label }, (colors.default.icon && __assign({ '.wd-icon-fill, .wd-icon-accent, .wd-icon-accent2, .wd-icon-background': {
|
|
93
|
+
transition: 'fill 120ms ease-in',
|
|
94
|
+
} }, getIconColorSelectors(theme, colors.default.icon, fillIcon))));
|
|
95
|
+
var hoverStyles = {
|
|
96
|
+
'&:hover': __assign({ backgroundColor: colors.hover.background, borderColor: colors.hover.border, color: colors.hover.label }, (colors.hover.icon && getIconColorSelectors(theme, colors.hover.icon, fillIcon))),
|
|
97
|
+
};
|
|
98
|
+
var activeStyles = {
|
|
99
|
+
'&:active, &:focus:active, &:hover:active': __assign({ backgroundColor: colors.active.background, borderColor: colors.active.border, color: colors.active.label }, (colors.active.icon && getIconColorSelectors(theme, colors.active.icon, fillIcon))),
|
|
100
|
+
};
|
|
101
|
+
return __assign(__assign(__assign(__assign(__assign(__assign({}, baseStyles), { '&:focus': __assign(__assign({ backgroundColor: colors.focus.background, borderColor: colors.focus.border, color: colors.focus.label }, (colors.focus.focusRing || focusRing({ separation: 2 }, theme))), (colors.focus.icon && getIconColorSelectors(theme, colors.focus.icon, fillIcon))) }), activeStyles), hoverStyles), { '&:disabled, &:active:disabled, &:focus:disabled, &:hover:disabled': __assign({ backgroundColor: colors.disabled.background, borderColor: colors.disabled.border, color: colors.disabled.label, opacity: colors.disabled.opacity }, (colors.disabled.icon && getIconColorSelectors(theme, colors.disabled.icon, fillIcon))) }), mouseFocusBehavior({
|
|
102
|
+
'&:focus': __assign(__assign(__assign(__assign({}, baseStyles), { outline: 'none', boxShadow: 'none', animation: 'none' }), hoverStyles), activeStyles),
|
|
103
|
+
}));
|
|
104
|
+
}, boxStyleFn);
|
|
105
|
+
export var getMinWidthStyles = function (children, size) {
|
|
106
|
+
switch (size) {
|
|
107
|
+
case 'large':
|
|
108
|
+
return children ? '112px' : '48px';
|
|
109
|
+
case 'medium':
|
|
110
|
+
return children ? '96px' : space.xl;
|
|
111
|
+
case 'small':
|
|
112
|
+
return children ? space.xxxl : space.l;
|
|
113
|
+
case 'extraSmall':
|
|
114
|
+
return children ? 'auto' : space.m;
|
|
115
|
+
default:
|
|
116
|
+
return children ? '96px' : space.xl;
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
export var getPaddingStyles = function (children, size, icon, iconPosition) {
|
|
120
|
+
// In order to calculate the correct padding, we need to know its children
|
|
121
|
+
// and what side the icon is on and if there's an icon provided
|
|
122
|
+
if (!children) {
|
|
123
|
+
// icon buttons do not have any padding
|
|
124
|
+
return 0;
|
|
125
|
+
}
|
|
126
|
+
// If there are children AND an icon
|
|
127
|
+
// 1. We check what side the icon is in
|
|
128
|
+
// 2. Adjust padding to visually center the icon and text
|
|
129
|
+
// If there is children (most likely just text)
|
|
130
|
+
// 1. We keep the padding the same on both side
|
|
131
|
+
switch (size) {
|
|
132
|
+
case 'large':
|
|
133
|
+
return icon
|
|
134
|
+
? iconPosition === 'start'
|
|
135
|
+
? "0 " + space.l + " 0 " + space.m
|
|
136
|
+
: "0 " + space.m + " 0 " + space.l
|
|
137
|
+
: "0 " + space.l;
|
|
138
|
+
case 'medium':
|
|
139
|
+
return icon
|
|
140
|
+
? iconPosition === 'start'
|
|
141
|
+
? "0 " + space.m + " 0 20px"
|
|
142
|
+
: "0 20px 0 " + space.m
|
|
143
|
+
: "0 " + space.m;
|
|
144
|
+
case 'small':
|
|
145
|
+
return icon
|
|
146
|
+
? iconPosition === 'start'
|
|
147
|
+
? "0 20px 0 " + space.s
|
|
148
|
+
: "0 " + space.s + " 0 20px"
|
|
149
|
+
: "0 " + space.s;
|
|
150
|
+
case 'extraSmall':
|
|
151
|
+
return icon
|
|
152
|
+
? iconPosition === 'start'
|
|
153
|
+
? "0 " + space.xs + " 0 " + space.xxs
|
|
154
|
+
: "0 " + space.xxs + " 0 " + space.xs
|
|
155
|
+
: "0 " + space.xs;
|
|
156
|
+
default:
|
|
157
|
+
return icon
|
|
158
|
+
? iconPosition === 'start'
|
|
159
|
+
? "0 " + space.m + " 0 20px"
|
|
160
|
+
: "0 20px 0 " + space.m
|
|
161
|
+
: "0 " + space.m;
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
export var BaseButton = createComponent('button')({
|
|
165
|
+
displayName: 'Button',
|
|
166
|
+
Component: function (_a, ref, Element) {
|
|
167
|
+
var children = _a.children, elemProps = __rest(_a, ["children"]);
|
|
168
|
+
return (React.createElement(ButtonContainer, __assign({ as: Element, ref: ref }, elemProps), children));
|
|
169
|
+
},
|
|
170
|
+
subComponents: {
|
|
171
|
+
Icon: ButtonLabelIcon,
|
|
172
|
+
Label: ButtonLabel,
|
|
173
|
+
},
|
|
174
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeleteButton.d.ts","sourceRoot":"","sources":["../../../../button/lib/DeleteButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EACL,cAAc,EAEd,SAAS,EAGV,MAAM,kCAAkC,CAAC;AAE1C,MAAM,WAAW,iBAAkB,SAAQ,SAAS,EAAE,cAAc;IAClE;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;
|
|
1
|
+
{"version":3,"file":"DeleteButton.d.ts","sourceRoot":"","sources":["../../../../button/lib/DeleteButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EACL,cAAc,EAEd,SAAS,EAGV,MAAM,kCAAkC,CAAC;AAE1C,MAAM,WAAW,iBAAkB,SAAQ,SAAS,EAAE,cAAc;IAClE;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AA0BD,eAAO,MAAM,YAAY,sEA0BvB,CAAC"}
|
|
@@ -21,7 +21,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
23
|
import * as React from 'react';
|
|
24
|
-
import {
|
|
24
|
+
import { BaseButton, getMinWidthStyles, getPaddingStyles } from './BaseButton';
|
|
25
25
|
import { useTheme, createComponent, } from '@workday/canvas-kit-react/common';
|
|
26
26
|
var getDeleteButtonColors = function (_a) {
|
|
27
27
|
var themeError = _a.canvas.palette.error;
|
|
@@ -41,6 +41,7 @@ var getDeleteButtonColors = function (_a) {
|
|
|
41
41
|
},
|
|
42
42
|
disabled: {
|
|
43
43
|
background: themeError.light,
|
|
44
|
+
opacity: '1',
|
|
44
45
|
},
|
|
45
46
|
});
|
|
46
47
|
};
|
|
@@ -54,7 +55,7 @@ export var DeleteButton = createComponent('button')({
|
|
|
54
55
|
// TODO: Fix useTheme and make it a real hook
|
|
55
56
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
56
57
|
theme = _b === void 0 ? useTheme() : _b, _c = _a.size, size = _c === void 0 ? 'medium' : _c, children = _a.children, elemProps = __rest(_a, ["theme", "size", "children"]);
|
|
57
|
-
return (React.createElement(
|
|
58
|
-
React.createElement(
|
|
58
|
+
return (React.createElement(BaseButton, __assign({ padding: getPaddingStyles(children, size, undefined, undefined), minWidth: getMinWidthStyles(children, size), ref: ref, as: Element, colors: getDeleteButtonColors(theme), size: size }, elemProps),
|
|
59
|
+
React.createElement(BaseButton.Label, null, children)));
|
|
59
60
|
},
|
|
60
61
|
});
|
|
@@ -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"}
|
|
@@ -23,34 +23,8 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
23
23
|
import * as React from 'react';
|
|
24
24
|
import { useTheme, createComponent, focusRing, } from '@workday/canvas-kit-react/common';
|
|
25
25
|
import { colors } from '@workday/canvas-kit-react/tokens';
|
|
26
|
-
import {
|
|
27
|
-
|
|
28
|
-
var dataLabelSizes = ['medium', 'large'];
|
|
29
|
-
// All disabled buttons are set to 40% opacity.
|
|
30
|
-
// This will eventually live in the ButtonContainer styles, but for now we're scoping it to Primary, Secondary, and Tertiary buttons.
|
|
31
|
-
var disabledButtonOpacity = {
|
|
32
|
-
'&:disabled, &:disabled:active': {
|
|
33
|
-
opacity: 0.4,
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
export var PrimaryButton = createComponent('button')({
|
|
37
|
-
displayName: 'PrimaryButton',
|
|
38
|
-
Component: function (_a, ref, Element) {
|
|
39
|
-
var
|
|
40
|
-
// TODO: Fix useTheme and make it a real hook
|
|
41
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
42
|
-
_b = _a.theme,
|
|
43
|
-
// TODO: Fix useTheme and make it a real hook
|
|
44
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
45
|
-
theme = _b === void 0 ? 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"]);
|
|
46
|
-
return (React.createElement(ButtonContainer, __assign({ ref: ref, as: Element, colors: getPrimaryButtonColors(variant, theme), size: size, extraStyles: disabledButtonOpacity }, elemProps),
|
|
47
|
-
icon && iconPosition === 'left' && (React.createElement(ButtonLabelIcon, { size: size, iconPosition: iconPosition, icon: icon, shouldMirrorIcon: shouldMirrorIcon })),
|
|
48
|
-
React.createElement(ButtonLabel, null, children),
|
|
49
|
-
dataLabel && dataLabelSizes.includes(size) && React.createElement(ButtonLabelData, null, dataLabel),
|
|
50
|
-
icon && iconPosition === 'right' && (React.createElement(ButtonLabelIcon, { size: size, iconPosition: iconPosition, icon: icon, shouldMirrorIcon: shouldMirrorIcon }))));
|
|
51
|
-
},
|
|
52
|
-
});
|
|
53
|
-
export var getPrimaryButtonColors = function (variant, theme) {
|
|
26
|
+
import { BaseButton, getMinWidthStyles, getPaddingStyles } from './BaseButton';
|
|
27
|
+
var getPrimaryButtonColors = function (variant, theme) {
|
|
54
28
|
var themePrimary = theme.canvas.palette.primary;
|
|
55
29
|
switch (variant) {
|
|
56
30
|
case undefined:
|
|
@@ -80,29 +54,25 @@ export var getPrimaryButtonColors = function (variant, theme) {
|
|
|
80
54
|
background: colors.frenchVanilla100,
|
|
81
55
|
icon: colors.blackPepper400,
|
|
82
56
|
label: colors.blackPepper400,
|
|
83
|
-
labelData: colors.blackPepper400,
|
|
84
57
|
},
|
|
85
58
|
hover: {
|
|
86
59
|
background: colors.soap300,
|
|
87
60
|
icon: colors.blackPepper500,
|
|
88
61
|
label: colors.blackPepper500,
|
|
89
|
-
labelData: colors.blackPepper500,
|
|
90
62
|
},
|
|
91
63
|
active: {
|
|
92
|
-
background: colors.
|
|
64
|
+
background: colors.soap400,
|
|
93
65
|
icon: colors.blackPepper500,
|
|
94
66
|
label: colors.blackPepper500,
|
|
95
|
-
labelData: colors.blackPepper500,
|
|
96
67
|
},
|
|
97
68
|
focus: {
|
|
98
69
|
background: colors.frenchVanilla100,
|
|
99
70
|
border: colors.blackPepper400,
|
|
100
71
|
icon: colors.blackPepper400,
|
|
101
72
|
label: colors.blackPepper400,
|
|
102
|
-
labelData: colors.blackPepper400,
|
|
103
73
|
focusRing: focusRing({
|
|
104
74
|
separation: 1,
|
|
105
|
-
innerColor: colors.
|
|
75
|
+
innerColor: colors.blackPepper400,
|
|
106
76
|
outerColor: colors.frenchVanilla100,
|
|
107
77
|
}, theme),
|
|
108
78
|
},
|
|
@@ -111,8 +81,18 @@ export var getPrimaryButtonColors = function (variant, theme) {
|
|
|
111
81
|
background: colors.frenchVanilla100,
|
|
112
82
|
icon: colors.blackPepper400,
|
|
113
83
|
label: colors.blackPepper400,
|
|
114
|
-
labelData: colors.blackPepper400,
|
|
115
84
|
},
|
|
116
85
|
};
|
|
117
86
|
}
|
|
118
87
|
};
|
|
88
|
+
export var PrimaryButton = createComponent('button')({
|
|
89
|
+
displayName: 'PrimaryButton',
|
|
90
|
+
Component: function (_a, ref, Element) {
|
|
91
|
+
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"]);
|
|
92
|
+
var theme = useTheme();
|
|
93
|
+
return (React.createElement(BaseButton, __assign({ ref: ref, size: size, colors: getPrimaryButtonColors(variant, theme), padding: getPaddingStyles(children, size, icon, iconPosition), minWidth: getMinWidthStyles(children, size), as: Element }, elemProps),
|
|
94
|
+
icon && iconPosition === 'start' && (React.createElement(BaseButton.Icon, { size: size, iconPosition: iconPosition, icon: icon, shouldMirrorIcon: shouldMirrorIcon })),
|
|
95
|
+
children && React.createElement(BaseButton.Label, null, children),
|
|
96
|
+
icon && iconPosition === 'end' && (React.createElement(BaseButton.Icon, { size: size, iconPosition: iconPosition, icon: icon, shouldMirrorIcon: shouldMirrorIcon }))));
|
|
97
|
+
},
|
|
98
|
+
});
|
|
@@ -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,YAqFF,CAAC"}
|
|
@@ -23,31 +23,16 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
23
23
|
import * as React from 'react';
|
|
24
24
|
import { colors } from '@workday/canvas-kit-react/tokens';
|
|
25
25
|
import { useTheme, createComponent, focusRing, } from '@workday/canvas-kit-react/common';
|
|
26
|
-
import {
|
|
27
|
-
// Button sizes where data labels are enabled
|
|
28
|
-
var dataLabelSizes = ['medium', 'large'];
|
|
29
|
-
// All disabled buttons are set to 40% opacity.
|
|
30
|
-
// This will eventually live in the ButtonContainer styles, but for now we're scoping it to Primary, Secondary, and Tertiary buttons.
|
|
31
|
-
var disabledButtonOpacity = {
|
|
32
|
-
'&:disabled, &:disabled:active': {
|
|
33
|
-
opacity: 0.4,
|
|
34
|
-
},
|
|
35
|
-
};
|
|
26
|
+
import { BaseButton, getMinWidthStyles, getPaddingStyles } from './BaseButton';
|
|
36
27
|
export var SecondaryButton = createComponent('button')({
|
|
37
28
|
displayName: 'SecondaryButton',
|
|
38
29
|
Component: function (_a, ref, Element) {
|
|
39
|
-
var
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
theme = _b === void 0 ? 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"]);
|
|
46
|
-
return (React.createElement(ButtonContainer, __assign({ ref: ref, as: Element, colors: getSecondaryButtonColors(variant, theme), size: size, extraStyles: disabledButtonOpacity }, elemProps),
|
|
47
|
-
icon && iconPosition === 'left' && (React.createElement(ButtonLabelIcon, { size: size, iconPosition: iconPosition, icon: icon, shouldMirrorIcon: shouldMirrorIcon })),
|
|
48
|
-
React.createElement(ButtonLabel, null, children),
|
|
49
|
-
dataLabel && dataLabelSizes.includes(size) && React.createElement(ButtonLabelData, null, dataLabel),
|
|
50
|
-
icon && iconPosition === 'right' && (React.createElement(ButtonLabelIcon, { size: size, iconPosition: iconPosition, icon: icon, shouldMirrorIcon: shouldMirrorIcon }))));
|
|
30
|
+
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"]);
|
|
31
|
+
var theme = useTheme();
|
|
32
|
+
return (React.createElement(BaseButton, __assign({ ref: ref, size: size, colors: getSecondaryButtonColors(variant, theme), padding: getPaddingStyles(children, size, icon, iconPosition), minWidth: getMinWidthStyles(children, size), as: Element }, elemProps),
|
|
33
|
+
icon && iconPosition === 'start' && (React.createElement(BaseButton.Icon, { size: size, iconPosition: iconPosition, icon: icon, shouldMirrorIcon: shouldMirrorIcon })),
|
|
34
|
+
children && React.createElement(BaseButton.Label, null, children),
|
|
35
|
+
icon && iconPosition === 'end' && (React.createElement(BaseButton.Icon, { size: size, iconPosition: iconPosition, icon: icon, shouldMirrorIcon: shouldMirrorIcon }))));
|
|
51
36
|
},
|
|
52
37
|
});
|
|
53
38
|
export var getSecondaryButtonColors = function (variant, theme) {
|
|
@@ -61,27 +46,23 @@ export var getSecondaryButtonColors = function (variant, theme) {
|
|
|
61
46
|
border: colors.blackPepper400,
|
|
62
47
|
icon: colors.blackPepper400,
|
|
63
48
|
label: colors.blackPepper400,
|
|
64
|
-
labelData: colors.blackPepper400,
|
|
65
49
|
},
|
|
66
50
|
hover: {
|
|
67
51
|
background: colors.blackPepper400,
|
|
68
52
|
border: colors.blackPepper400,
|
|
69
53
|
icon: themePrimary.contrast,
|
|
70
54
|
label: themePrimary.contrast,
|
|
71
|
-
labelData: themePrimary.contrast,
|
|
72
55
|
},
|
|
73
56
|
active: {
|
|
74
57
|
background: colors.blackPepper500,
|
|
75
58
|
border: colors.blackPepper500,
|
|
76
59
|
icon: themePrimary.contrast,
|
|
77
60
|
label: themePrimary.contrast,
|
|
78
|
-
labelData: themePrimary.contrast,
|
|
79
61
|
},
|
|
80
62
|
focus: {
|
|
81
63
|
border: colors.blackPepper400,
|
|
82
64
|
icon: colors.blackPepper400,
|
|
83
65
|
label: colors.blackPepper400,
|
|
84
|
-
labelData: colors.blackPepper400,
|
|
85
66
|
},
|
|
86
67
|
// Identical to 'default' styles. ButtonContainer will set opacity to 40%
|
|
87
68
|
disabled: {
|
|
@@ -89,7 +70,6 @@ export var getSecondaryButtonColors = function (variant, theme) {
|
|
|
89
70
|
border: colors.blackPepper400,
|
|
90
71
|
icon: colors.blackPepper400,
|
|
91
72
|
label: colors.blackPepper400,
|
|
92
|
-
labelData: colors.blackPepper400,
|
|
93
73
|
},
|
|
94
74
|
};
|
|
95
75
|
case 'inverse':
|
|
@@ -103,25 +83,23 @@ export var getSecondaryButtonColors = function (variant, theme) {
|
|
|
103
83
|
hover: {
|
|
104
84
|
background: colors.soap300,
|
|
105
85
|
border: colors.soap300,
|
|
106
|
-
icon: colors.
|
|
107
|
-
label: colors.
|
|
108
|
-
labelData: colors.blackPepper400,
|
|
86
|
+
icon: colors.blackPepper500,
|
|
87
|
+
label: colors.blackPepper500,
|
|
109
88
|
},
|
|
110
89
|
active: {
|
|
111
90
|
background: colors.soap400,
|
|
112
91
|
border: colors.soap400,
|
|
113
|
-
icon: colors.
|
|
114
|
-
label: colors.
|
|
115
|
-
labelData: colors.blackPepper400,
|
|
92
|
+
icon: colors.blackPepper500,
|
|
93
|
+
label: colors.blackPepper500,
|
|
116
94
|
},
|
|
117
95
|
focus: {
|
|
118
96
|
background: colors.frenchVanilla100,
|
|
119
|
-
icon: colors.
|
|
120
|
-
|
|
121
|
-
|
|
97
|
+
icon: colors.blackPepper500,
|
|
98
|
+
border: colors.blackPepper400,
|
|
99
|
+
label: colors.blackPepper500,
|
|
122
100
|
focusRing: focusRing({
|
|
123
|
-
separation:
|
|
124
|
-
innerColor:
|
|
101
|
+
separation: 1,
|
|
102
|
+
innerColor: colors.blackPepper400,
|
|
125
103
|
outerColor: colors.frenchVanilla100,
|
|
126
104
|
}, theme),
|
|
127
105
|
},
|
|
@@ -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"}
|