@workday/canvas-kit-react 16.0.0-alpha.0499-next.0 → 16.0.0
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/common/lib/CanvasProvider.tsx +156 -324
- package/common/lib/theming/README.md +49 -6
- package/common/lib/theming/brandScope.ts +566 -0
- package/common/lib/theming/index.ts +1 -0
- package/common/lib/theming/sanaTheme.ts +133 -0
- package/common/lib/theming/types.ts +292 -0
- package/dist/commonjs/action-bar/lib/ActionBarList.js +1 -1
- package/dist/commonjs/action-bar/lib/ActionBarOverflowButton.js +1 -1
- package/dist/commonjs/avatar/lib/Avatar.js +13 -13
- package/dist/commonjs/avatar/lib/AvatarImage.js +1 -1
- package/dist/commonjs/avatar/lib/AvatarName.js +1 -1
- package/dist/commonjs/avatar/lib/BaseAvatar.js +14 -14
- package/dist/commonjs/badge/lib/CountBadge.js +6 -6
- package/dist/commonjs/banner/lib/Banner.js +5 -5
- package/dist/commonjs/banner/lib/BannerActionText.js +2 -2
- package/dist/commonjs/banner/lib/BannerIcon.js +1 -1
- package/dist/commonjs/banner/lib/BannerLabel.js +1 -1
- package/dist/commonjs/breadcrumbs/lib/BreadcrumbsCurrentItem.js +1 -1
- package/dist/commonjs/breadcrumbs/lib/BreadcrumbsItem.js +1 -1
- package/dist/commonjs/breadcrumbs/lib/BreadcrumbsLink.js +1 -1
- package/dist/commonjs/breadcrumbs/lib/BreadcrumbsList.js +1 -1
- package/dist/commonjs/breadcrumbs/lib/BreadcrumbsMenu.js +2 -2
- package/dist/commonjs/breadcrumbs/lib/BreadcrumbsOverflowButton.js +1 -1
- package/dist/commonjs/button/lib/BaseButton.js +21 -21
- package/dist/commonjs/button/lib/DeleteButton.js +2 -2
- package/dist/commonjs/button/lib/ExternalHyperlink.js +1 -1
- package/dist/commonjs/button/lib/Hyperlink.js +5 -5
- package/dist/commonjs/button/lib/PrimaryButton.js +2 -2
- package/dist/commonjs/button/lib/SecondaryButton.js +2 -2
- package/dist/commonjs/button/lib/TertiaryButton.js +14 -14
- package/dist/commonjs/button/lib/ToolbarDropdownButton.js +3 -3
- package/dist/commonjs/button/lib/ToolbarIconButton.js +1 -1
- package/dist/commonjs/button/lib/parts/ButtonLabel.js +1 -1
- package/dist/commonjs/button/lib/parts/ButtonLabelIcon.js +5 -5
- package/dist/commonjs/card/lib/Card.js +3 -3
- package/dist/commonjs/card/lib/CardBody.js +1 -1
- package/dist/commonjs/card/lib/CardHeading.js +1 -1
- package/dist/commonjs/checkbox/lib/CheckBackground.js +6 -6
- package/dist/commonjs/checkbox/lib/CheckboxCheck.js +6 -6
- package/dist/commonjs/checkbox/lib/CheckboxContainer.js +2 -2
- package/dist/commonjs/checkbox/lib/CheckboxInput.js +5 -5
- package/dist/commonjs/checkbox/lib/CheckboxRipple.js +1 -1
- package/dist/commonjs/collection/lib/ListBox.js +3 -3
- package/dist/commonjs/color-picker/lib/ColorInput.js +3 -3
- package/dist/commonjs/color-picker/lib/ColorPreview.js +1 -1
- package/dist/commonjs/color-picker/lib/parts/ColorSwatch.js +2 -2
- package/dist/commonjs/combobox/lib/ComboboxMenuList.js +1 -1
- package/dist/commonjs/common/lib/AccessibleHide.js +1 -1
- package/dist/commonjs/common/lib/CanvasProvider.d.ts +296 -5
- package/dist/commonjs/common/lib/CanvasProvider.d.ts.map +1 -1
- package/dist/commonjs/common/lib/CanvasProvider.js +105 -287
- package/dist/commonjs/common/lib/EllipsisText.js +1 -1
- package/dist/commonjs/common/lib/styles/cornerShape.js +1 -1
- package/dist/commonjs/common/lib/theming/brandScope.d.ts +64 -0
- package/dist/commonjs/common/lib/theming/brandScope.d.ts.map +1 -0
- package/dist/commonjs/common/lib/theming/brandScope.js +499 -0
- package/dist/commonjs/common/lib/theming/index.d.ts +1 -0
- package/dist/commonjs/common/lib/theming/index.d.ts.map +1 -1
- package/dist/commonjs/common/lib/theming/index.js +1 -0
- package/dist/commonjs/common/lib/theming/sanaTheme.d.ts +33 -0
- package/dist/commonjs/common/lib/theming/sanaTheme.d.ts.map +1 -0
- package/dist/commonjs/common/lib/theming/sanaTheme.js +130 -0
- package/dist/commonjs/common/lib/theming/types.d.ts +162 -0
- package/dist/commonjs/common/lib/theming/types.d.ts.map +1 -1
- package/dist/commonjs/common/lib/theming/types.js +81 -1
- package/dist/commonjs/expandable/lib/Expandable.js +1 -1
- package/dist/commonjs/expandable/lib/ExpandableAvatar.js +1 -1
- package/dist/commonjs/expandable/lib/ExpandableContent.js +1 -1
- package/dist/commonjs/expandable/lib/ExpandableIcon.js +10 -10
- package/dist/commonjs/expandable/lib/ExpandableTarget.js +1 -1
- package/dist/commonjs/expandable/lib/ExpandableTitle.js +1 -1
- package/dist/commonjs/form-field/lib/FormFieldField.js +1 -1
- package/dist/commonjs/form-field/lib/FormFieldGroupLabel.js +5 -5
- package/dist/commonjs/form-field/lib/FormFieldGroupList.js +3 -3
- package/dist/commonjs/form-field/lib/FormFieldHint.js +3 -3
- package/dist/commonjs/form-field/lib/FormFieldLabel.js +6 -6
- package/dist/commonjs/form-field/lib/formFieldStencil.js +8 -8
- package/dist/commonjs/icon/lib/AccentIcon.js +2 -2
- package/dist/commonjs/icon/lib/AppletIcon.js +1 -1
- package/dist/commonjs/icon/lib/ExpressiveIcon.js +1 -1
- package/dist/commonjs/icon/lib/Graphic.js +4 -4
- package/dist/commonjs/icon/lib/Svg.js +3 -3
- package/dist/commonjs/icon/lib/SystemIcon.js +1 -1
- package/dist/commonjs/icon/lib/SystemIconCircle.js +2 -2
- package/dist/commonjs/information-highlight/lib/InformationHighlight.js +9 -9
- package/dist/commonjs/information-highlight/lib/parts/Body.js +3 -3
- package/dist/commonjs/information-highlight/lib/parts/Heading.js +3 -3
- package/dist/commonjs/information-highlight/lib/parts/Link.js +3 -3
- package/dist/commonjs/loading-dots/lib/LoadingDots.js +3 -3
- package/dist/commonjs/menu/lib/MenuCard.js +1 -1
- package/dist/commonjs/menu/lib/MenuDivider.js +1 -1
- package/dist/commonjs/menu/lib/MenuGroup.js +1 -1
- package/dist/commonjs/menu/lib/MenuItem.js +1 -1
- package/dist/commonjs/menu/lib/MenuList.js +3 -3
- package/dist/commonjs/modal/lib/ModalBody.js +1 -1
- package/dist/commonjs/modal/lib/ModalCard.js +1 -1
- package/dist/commonjs/modal/lib/ModalHeading.js +1 -1
- package/dist/commonjs/modal/lib/ModalOverflowOverlay.js +1 -1
- package/dist/commonjs/modal/lib/ModalOverlay.js +2 -2
- package/dist/commonjs/pagination/lib/Pagination/AdditionalDetails.js +2 -2
- package/dist/commonjs/pagination/lib/Pagination/Controls.js +2 -2
- package/dist/commonjs/pagination/lib/Pagination/GoTo/Form.js +1 -1
- package/dist/commonjs/pagination/lib/Pagination/GoTo/Label.js +1 -1
- package/dist/commonjs/pagination/lib/Pagination/GoTo/TextInput.js +1 -1
- package/dist/commonjs/pagination/lib/Pagination/Nav.js +1 -1
- package/dist/commonjs/pagination/lib/Pagination/PageButton.js +2 -2
- package/dist/commonjs/pagination/lib/Pagination/PageList.js +1 -1
- package/dist/commonjs/pagination/lib/Pagination/Pagination.js +1 -1
- package/dist/commonjs/pagination/lib/Pagination/common/List.js +2 -2
- package/dist/commonjs/pill/lib/Pill.d.ts +2 -2
- package/dist/commonjs/pill/lib/Pill.js +3 -3
- package/dist/commonjs/pill/lib/PillAvatar.js +1 -1
- package/dist/commonjs/pill/lib/PillCount.js +1 -1
- package/dist/commonjs/pill/lib/PillIcon.js +1 -1
- package/dist/commonjs/pill/lib/PillIconButton.js +1 -1
- package/dist/commonjs/pill/lib/PillLabel.js +1 -1
- package/dist/commonjs/popup/lib/PopupBody.js +1 -1
- package/dist/commonjs/popup/lib/PopupButtonGroup.js +5 -5
- package/dist/commonjs/popup/lib/PopupCard.js +2 -2
- package/dist/commonjs/popup/lib/PopupCloseIcon.js +1 -1
- package/dist/commonjs/popup/lib/PopupHeading.js +1 -1
- package/dist/commonjs/popup/lib/hooks/useDisableBodyScroll.js +1 -1
- package/dist/commonjs/popup/lib/hooks/usePopupStack.d.ts.map +1 -1
- package/dist/commonjs/popup/lib/hooks/usePopupStack.js +18 -16
- package/dist/commonjs/segmented-control/lib/SegmentedControlItem.js +16 -16
- package/dist/commonjs/segmented-control/lib/SegmentedControlList.js +6 -6
- package/dist/commonjs/select/lib/SelectCard.js +1 -1
- package/dist/commonjs/select/lib/SelectInput.js +3 -3
- package/dist/commonjs/side-panel/lib/SidePanel.js +8 -8
- package/dist/commonjs/side-panel/lib/SidePanelHeading.js +3 -3
- package/dist/commonjs/side-panel/lib/SidePanelToggleButton.js +7 -7
- package/dist/commonjs/skeleton/lib/Skeleton.js +2 -2
- package/dist/commonjs/skeleton/lib/parts/SkeletonHeader.js +1 -1
- package/dist/commonjs/skeleton/lib/parts/SkeletonShape.js +2 -2
- package/dist/commonjs/skeleton/lib/parts/SkeletonText.js +2 -2
- package/dist/commonjs/switch/lib/Switch.js +7 -7
- package/dist/commonjs/table/lib/BaseTable.js +1 -1
- package/dist/commonjs/table/lib/Table.js +7 -7
- package/dist/commonjs/table/lib/parts/BaseTableBody.js +1 -1
- package/dist/commonjs/table/lib/parts/BaseTableCaption.js +1 -1
- package/dist/commonjs/table/lib/parts/BaseTableCell.js +1 -1
- package/dist/commonjs/table/lib/parts/BaseTableHead.js +1 -1
- package/dist/commonjs/table/lib/parts/BaseTableHeader.js +1 -1
- package/dist/commonjs/table/lib/parts/css-grid-table/TableRow.js +1 -1
- package/dist/commonjs/tabs/lib/TabsItem.js +1 -1
- package/dist/commonjs/tabs/lib/TabsList.js +8 -8
- package/dist/commonjs/tabs/lib/TabsOverflowButton.js +1 -1
- package/dist/commonjs/testing/lib/ComponentStatesTable.js +1 -1
- package/dist/commonjs/testing/lib/StaticStates.d.ts +2 -2
- package/dist/commonjs/testing/lib/StaticStates.d.ts.map +1 -1
- package/dist/commonjs/testing/lib/StaticStates.js +5 -2
- package/dist/commonjs/text/lib/LabelText.js +6 -6
- package/dist/commonjs/text/lib/Text.js +16 -16
- package/dist/commonjs/text/lib/TypeLevelComponents.js +4 -4
- package/dist/commonjs/text-area/lib/TextArea.js +5 -5
- package/dist/commonjs/text-input/lib/InputGroup.js +7 -7
- package/dist/commonjs/text-input/lib/TextInput.js +5 -5
- package/dist/commonjs/toast/lib/Toast.js +1 -1
- package/dist/commonjs/toast/lib/ToastBody.js +1 -1
- package/dist/commonjs/toast/lib/ToastCloseIcon.js +1 -1
- package/dist/commonjs/toast/lib/ToastIcon.js +1 -1
- package/dist/commonjs/toast/lib/ToastMessage.js +1 -1
- package/dist/commonjs/tooltip/lib/TooltipContainer.js +4 -4
- package/dist/commonjs/version/lib/version.js +1 -1
- package/dist/es6/action-bar/lib/ActionBarList.js +1 -1
- package/dist/es6/action-bar/lib/ActionBarOverflowButton.js +1 -1
- package/dist/es6/avatar/lib/Avatar.js +13 -13
- package/dist/es6/avatar/lib/AvatarImage.js +1 -1
- package/dist/es6/avatar/lib/AvatarName.js +1 -1
- package/dist/es6/avatar/lib/BaseAvatar.js +14 -14
- package/dist/es6/badge/lib/CountBadge.js +6 -6
- package/dist/es6/banner/lib/Banner.js +5 -5
- package/dist/es6/banner/lib/BannerActionText.js +2 -2
- package/dist/es6/banner/lib/BannerIcon.js +1 -1
- package/dist/es6/banner/lib/BannerLabel.js +1 -1
- package/dist/es6/breadcrumbs/lib/BreadcrumbsCurrentItem.js +1 -1
- package/dist/es6/breadcrumbs/lib/BreadcrumbsItem.js +1 -1
- package/dist/es6/breadcrumbs/lib/BreadcrumbsLink.js +1 -1
- package/dist/es6/breadcrumbs/lib/BreadcrumbsList.js +1 -1
- package/dist/es6/breadcrumbs/lib/BreadcrumbsMenu.js +2 -2
- package/dist/es6/breadcrumbs/lib/BreadcrumbsOverflowButton.js +1 -1
- package/dist/es6/button/lib/BaseButton.js +21 -21
- package/dist/es6/button/lib/DeleteButton.js +2 -2
- package/dist/es6/button/lib/ExternalHyperlink.js +1 -1
- package/dist/es6/button/lib/Hyperlink.js +5 -5
- package/dist/es6/button/lib/PrimaryButton.js +2 -2
- package/dist/es6/button/lib/SecondaryButton.js +2 -2
- package/dist/es6/button/lib/TertiaryButton.js +14 -14
- package/dist/es6/button/lib/ToolbarDropdownButton.js +3 -3
- package/dist/es6/button/lib/ToolbarIconButton.js +1 -1
- package/dist/es6/button/lib/parts/ButtonLabel.js +1 -1
- package/dist/es6/button/lib/parts/ButtonLabelIcon.js +5 -5
- package/dist/es6/card/lib/Card.js +3 -3
- package/dist/es6/card/lib/CardBody.js +1 -1
- package/dist/es6/card/lib/CardHeading.js +1 -1
- package/dist/es6/checkbox/lib/CheckBackground.js +6 -6
- package/dist/es6/checkbox/lib/CheckboxCheck.js +6 -6
- package/dist/es6/checkbox/lib/CheckboxContainer.js +2 -2
- package/dist/es6/checkbox/lib/CheckboxInput.js +5 -5
- package/dist/es6/checkbox/lib/CheckboxRipple.js +1 -1
- package/dist/es6/collection/lib/ListBox.js +3 -3
- package/dist/es6/color-picker/lib/ColorInput.js +3 -3
- package/dist/es6/color-picker/lib/ColorPreview.js +1 -1
- package/dist/es6/color-picker/lib/parts/ColorSwatch.js +2 -2
- package/dist/es6/combobox/lib/ComboboxMenuList.js +1 -1
- package/dist/es6/common/lib/AccessibleHide.js +1 -1
- package/dist/es6/common/lib/CanvasProvider.d.ts +296 -5
- package/dist/es6/common/lib/CanvasProvider.d.ts.map +1 -1
- package/dist/es6/common/lib/CanvasProvider.js +82 -288
- package/dist/es6/common/lib/EllipsisText.js +1 -1
- package/dist/es6/common/lib/styles/cornerShape.js +1 -1
- package/dist/es6/common/lib/theming/brandScope.d.ts +64 -0
- package/dist/es6/common/lib/theming/brandScope.d.ts.map +1 -0
- package/dist/es6/common/lib/theming/brandScope.js +483 -0
- package/dist/es6/common/lib/theming/index.d.ts +1 -0
- package/dist/es6/common/lib/theming/index.d.ts.map +1 -1
- package/dist/es6/common/lib/theming/index.js +1 -0
- package/dist/es6/common/lib/theming/sanaTheme.d.ts +33 -0
- package/dist/es6/common/lib/theming/sanaTheme.d.ts.map +1 -0
- package/dist/es6/common/lib/theming/sanaTheme.js +127 -0
- package/dist/es6/common/lib/theming/types.d.ts +162 -0
- package/dist/es6/common/lib/theming/types.d.ts.map +1 -1
- package/dist/es6/common/lib/theming/types.js +78 -0
- package/dist/es6/expandable/lib/Expandable.js +1 -1
- package/dist/es6/expandable/lib/ExpandableAvatar.js +1 -1
- package/dist/es6/expandable/lib/ExpandableContent.js +1 -1
- package/dist/es6/expandable/lib/ExpandableIcon.js +10 -10
- package/dist/es6/expandable/lib/ExpandableTarget.js +1 -1
- package/dist/es6/expandable/lib/ExpandableTitle.js +1 -1
- package/dist/es6/form-field/lib/FormFieldField.js +1 -1
- package/dist/es6/form-field/lib/FormFieldGroupLabel.js +5 -5
- package/dist/es6/form-field/lib/FormFieldGroupList.js +3 -3
- package/dist/es6/form-field/lib/FormFieldHint.js +3 -3
- package/dist/es6/form-field/lib/FormFieldLabel.js +6 -6
- package/dist/es6/form-field/lib/formFieldStencil.js +8 -8
- package/dist/es6/icon/lib/AccentIcon.js +2 -2
- package/dist/es6/icon/lib/AppletIcon.js +1 -1
- package/dist/es6/icon/lib/ExpressiveIcon.js +1 -1
- package/dist/es6/icon/lib/Graphic.js +4 -4
- package/dist/es6/icon/lib/Svg.js +3 -3
- package/dist/es6/icon/lib/SystemIcon.js +1 -1
- package/dist/es6/icon/lib/SystemIconCircle.js +2 -2
- package/dist/es6/information-highlight/lib/InformationHighlight.js +9 -9
- package/dist/es6/information-highlight/lib/parts/Body.js +3 -3
- package/dist/es6/information-highlight/lib/parts/Heading.js +3 -3
- package/dist/es6/information-highlight/lib/parts/Link.js +3 -3
- package/dist/es6/loading-dots/lib/LoadingDots.js +3 -3
- package/dist/es6/menu/lib/MenuCard.js +1 -1
- package/dist/es6/menu/lib/MenuDivider.js +1 -1
- package/dist/es6/menu/lib/MenuGroup.js +1 -1
- package/dist/es6/menu/lib/MenuItem.js +1 -1
- package/dist/es6/menu/lib/MenuList.js +3 -3
- package/dist/es6/modal/lib/ModalBody.js +1 -1
- package/dist/es6/modal/lib/ModalCard.js +1 -1
- package/dist/es6/modal/lib/ModalHeading.js +1 -1
- package/dist/es6/modal/lib/ModalOverflowOverlay.js +1 -1
- package/dist/es6/modal/lib/ModalOverlay.js +2 -2
- package/dist/es6/pagination/lib/Pagination/AdditionalDetails.js +2 -2
- package/dist/es6/pagination/lib/Pagination/Controls.js +2 -2
- package/dist/es6/pagination/lib/Pagination/GoTo/Form.js +1 -1
- package/dist/es6/pagination/lib/Pagination/GoTo/Label.js +1 -1
- package/dist/es6/pagination/lib/Pagination/GoTo/TextInput.js +1 -1
- package/dist/es6/pagination/lib/Pagination/Nav.js +1 -1
- package/dist/es6/pagination/lib/Pagination/PageButton.js +2 -2
- package/dist/es6/pagination/lib/Pagination/PageList.js +1 -1
- package/dist/es6/pagination/lib/Pagination/Pagination.js +1 -1
- package/dist/es6/pagination/lib/Pagination/common/List.js +2 -2
- package/dist/es6/pill/lib/Pill.d.ts +2 -2
- package/dist/es6/pill/lib/Pill.js +3 -3
- package/dist/es6/pill/lib/PillAvatar.js +1 -1
- package/dist/es6/pill/lib/PillCount.js +1 -1
- package/dist/es6/pill/lib/PillIcon.js +1 -1
- package/dist/es6/pill/lib/PillIconButton.js +1 -1
- package/dist/es6/pill/lib/PillLabel.js +1 -1
- package/dist/es6/popup/lib/PopupBody.js +1 -1
- package/dist/es6/popup/lib/PopupButtonGroup.js +5 -5
- package/dist/es6/popup/lib/PopupCard.js +2 -2
- package/dist/es6/popup/lib/PopupCloseIcon.js +1 -1
- package/dist/es6/popup/lib/PopupHeading.js +1 -1
- package/dist/es6/popup/lib/hooks/useDisableBodyScroll.js +1 -1
- package/dist/es6/popup/lib/hooks/usePopupStack.d.ts.map +1 -1
- package/dist/es6/popup/lib/hooks/usePopupStack.js +13 -11
- package/dist/es6/segmented-control/lib/SegmentedControlItem.js +16 -16
- package/dist/es6/segmented-control/lib/SegmentedControlList.js +6 -6
- package/dist/es6/select/lib/SelectCard.js +1 -1
- package/dist/es6/select/lib/SelectInput.js +3 -3
- package/dist/es6/side-panel/lib/SidePanel.js +8 -8
- package/dist/es6/side-panel/lib/SidePanelHeading.js +3 -3
- package/dist/es6/side-panel/lib/SidePanelToggleButton.js +7 -7
- package/dist/es6/skeleton/lib/Skeleton.js +2 -2
- package/dist/es6/skeleton/lib/parts/SkeletonHeader.js +1 -1
- package/dist/es6/skeleton/lib/parts/SkeletonShape.js +2 -2
- package/dist/es6/skeleton/lib/parts/SkeletonText.js +2 -2
- package/dist/es6/switch/lib/Switch.js +7 -7
- package/dist/es6/table/lib/BaseTable.js +1 -1
- package/dist/es6/table/lib/Table.js +7 -7
- package/dist/es6/table/lib/parts/BaseTableBody.js +1 -1
- package/dist/es6/table/lib/parts/BaseTableCaption.js +1 -1
- package/dist/es6/table/lib/parts/BaseTableCell.js +1 -1
- package/dist/es6/table/lib/parts/BaseTableHead.js +1 -1
- package/dist/es6/table/lib/parts/BaseTableHeader.js +1 -1
- package/dist/es6/table/lib/parts/css-grid-table/TableRow.js +1 -1
- package/dist/es6/tabs/lib/TabsItem.js +1 -1
- package/dist/es6/tabs/lib/TabsList.js +8 -8
- package/dist/es6/tabs/lib/TabsOverflowButton.js +1 -1
- package/dist/es6/testing/lib/ComponentStatesTable.js +1 -1
- package/dist/es6/testing/lib/StaticStates.d.ts +2 -2
- package/dist/es6/testing/lib/StaticStates.d.ts.map +1 -1
- package/dist/es6/testing/lib/StaticStates.js +6 -3
- package/dist/es6/text/lib/LabelText.js +6 -6
- package/dist/es6/text/lib/Text.js +16 -16
- package/dist/es6/text/lib/TypeLevelComponents.js +4 -4
- package/dist/es6/text-area/lib/TextArea.js +5 -5
- package/dist/es6/text-input/lib/InputGroup.js +7 -7
- package/dist/es6/text-input/lib/TextInput.js +5 -5
- package/dist/es6/toast/lib/Toast.js +1 -1
- package/dist/es6/toast/lib/ToastBody.js +1 -1
- package/dist/es6/toast/lib/ToastCloseIcon.js +1 -1
- package/dist/es6/toast/lib/ToastIcon.js +1 -1
- package/dist/es6/toast/lib/ToastMessage.js +1 -1
- package/dist/es6/tooltip/lib/TooltipContainer.js +4 -4
- package/dist/es6/version/lib/version.js +1 -1
- package/package.json +4 -4
- package/popup/lib/hooks/usePopupStack.ts +13 -11
- package/testing/lib/StaticStates.tsx +11 -9
|
@@ -1,305 +1,99 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { CacheProvider, ThemeProvider } from '@emotion/react';
|
|
3
|
-
import
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { createStyles, getCache } from '@workday/canvas-kit-styling';
|
|
4
5
|
import { base, brand, system } from '@workday/canvas-tokens-web';
|
|
5
|
-
import { defaultCanvasTheme, useTheme } from './theming';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
lighter: 'lighter',
|
|
9
|
-
light: 'light',
|
|
10
|
-
main: 'base',
|
|
11
|
-
dark: 'dark',
|
|
12
|
-
darkest: 'darkest',
|
|
13
|
-
contrast: 'accent',
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* Mapping from deprecated theme palette keys to new numerical brand tokens.
|
|
17
|
-
* This ensures backwards compatibility when consumers use the old theme format.
|
|
18
|
-
* For example: palette.primary.main -> brand.primary600
|
|
19
|
-
*/
|
|
20
|
-
const numericalTokenMapping = {
|
|
21
|
-
lightest: '25',
|
|
22
|
-
lighter: '50',
|
|
23
|
-
light: '200',
|
|
24
|
-
main: '600',
|
|
25
|
-
dark: '700',
|
|
26
|
-
darkest: '800',
|
|
27
|
-
};
|
|
28
|
-
/**
|
|
29
|
-
* Mapping from deprecated theme palette colors to new brand token names.
|
|
30
|
-
* For example:
|
|
31
|
-
* `primary` -> `primary`
|
|
32
|
-
* `error` -> `critical`
|
|
33
|
-
* `success` -> `positive`
|
|
34
|
-
* `alert` -> `caution`
|
|
35
|
-
* `neutral` -> `neutral`
|
|
36
|
-
*/
|
|
37
|
-
const brandColorMapping = {
|
|
38
|
-
primary: 'primary',
|
|
39
|
-
error: 'critical',
|
|
40
|
-
success: 'positive',
|
|
41
|
-
alert: 'caution',
|
|
42
|
-
neutral: 'neutral',
|
|
43
|
-
};
|
|
6
|
+
import { defaultCanvasTheme, getTheme, isNumericalTheme, resolveThemingScope, useTheme, } from './theming';
|
|
7
|
+
import { hasExplicitSemanticPalette, writeBrandScopeSemantic, writeNumericalTheme, writeSemanticTheme, } from './theming/brandScope';
|
|
8
|
+
import { sanaCanvasProviderTheme } from './theming/sanaTheme';
|
|
44
9
|
/**
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* These are all the `system.color.brand.*` tokens that can be customized via theming.
|
|
50
|
-
* Each token references a brand token that can be overridden through the CanvasProvider theme prop.
|
|
51
|
-
*
|
|
52
|
-
* ### Focus Tokens
|
|
53
|
-
* - `system.color.brand.focus.primary` → `brand.primary.500` → Controlled by `focusOutline` (separately from `palette.primary.main`, which controls `brand.primary.600`)
|
|
54
|
-
* - `system.color.brand.focus.critical` → `brand.critical.500` → Controlled by `palette.error.dark` or `errorInner`
|
|
55
|
-
* - `system.color.brand.focus.caution.inner` → `brand.caution.400` → Controlled by `palette.alert.main` or `alertInner`
|
|
56
|
-
* - `system.color.brand.focus.caution.outer` → `brand.caution.500` → Controlled by `palette.alert.dark` or `alertOuter`
|
|
57
|
-
*
|
|
58
|
-
* ### Border Tokens
|
|
59
|
-
* - `system.color.brand.border.primary` → `brand.primary.500` → Controlled by `focusOutline` (separately from `palette.primary.main`, which controls `brand.primary.600`)
|
|
60
|
-
* - `system.color.brand.border.critical` → `brand.critical.500` → Controlled by `palette.error.dark` or `errorInner`
|
|
61
|
-
* - `system.color.brand.border.caution` → `brand.caution.500` → Controlled by `palette.alert.dark` or `alertOuter`
|
|
62
|
-
*
|
|
63
|
-
* ### Surface Tokens
|
|
64
|
-
* - `system.color.brand.surface.primary.default` → `brand.primary.A25` → Controlled by `palette.primary.lightest`
|
|
65
|
-
* - `system.color.brand.surface.primary.strong` → `brand.primary.A50` → Controlled by `palette.primary.lighter`
|
|
66
|
-
* - `system.color.brand.surface.critical.default` → `brand.critical.A25` → Controlled by `palette.error.lightest`
|
|
67
|
-
* - `system.color.brand.surface.critical.strong` → `brand.critical.A50` → Controlled by `palette.error.lighter`
|
|
68
|
-
* - `system.color.brand.surface.caution.default` → `brand.caution.A25` → Controlled by `palette.alert.lightest`
|
|
69
|
-
* - `system.color.brand.surface.caution.strong` → `brand.caution.A50` → Controlled by `palette.alert.lighter`
|
|
70
|
-
* - `system.color.brand.surface.positive.default` → `brand.positive.A25` → Controlled by `palette.success.lightest`
|
|
71
|
-
* - `system.color.brand.surface.positive.strong` → `brand.positive.A50` → Controlled by `palette.success.lighter`
|
|
72
|
-
* - `system.color.brand.surface.selected` → `brand.primary.A50` → Controlled by `palette.primary.lighter`
|
|
73
|
-
*
|
|
74
|
-
* ### Accent Tokens
|
|
75
|
-
* - `system.color.brand.accent.primary` → `brand.primary.600` → Controlled by `palette.primary.main`
|
|
76
|
-
* - `system.color.brand.accent.critical` → `brand.critical.600` → Controlled by `palette.error.main`
|
|
77
|
-
* - `system.color.brand.accent.caution` → `brand.caution.400` → Controlled by `palette.alert.main`
|
|
78
|
-
* - `system.color.brand.accent.positive` → `brand.positive.600` → Controlled by `palette.success.main`
|
|
79
|
-
* - `system.color.brand.accent.action` → `brand.primary.600` → Controlled by `palette.primary.main`
|
|
80
|
-
*
|
|
81
|
-
* ### Foreground (Text/Icon) Tokens
|
|
82
|
-
* - `system.color.brand.fg.primary.default` → `brand.primary.600` → Controlled by `palette.primary.main`
|
|
83
|
-
* - `system.color.brand.fg.primary.strong` → `brand.primary.700` → Controlled by `palette.primary.dark`
|
|
84
|
-
* - `system.color.brand.fg.critical.default` → `brand.critical.600` → Controlled by `palette.error.main`
|
|
85
|
-
* - `system.color.brand.fg.critical.strong` → `brand.critical.700` → Controlled by `palette.error.dark`
|
|
86
|
-
* - `system.color.brand.fg.caution.default` → `brand.caution.600` → Controlled by `palette.alert.darkest`
|
|
87
|
-
* - `system.color.brand.fg.caution.strong` → `brand.caution.700` → Controlled by `palette.alert.dark` (Note: no direct mapping, inherits default)
|
|
88
|
-
* - `system.color.brand.fg.positive.default` → `brand.positive.600` → Controlled by `palette.success.main`
|
|
89
|
-
* - `system.color.brand.fg.positive.strong` → `brand.positive.700` → Controlled by `palette.success.dark`
|
|
90
|
-
* - `system.color.brand.fg.selected` → `brand.primary.700` → Controlled by `palette.primary.dark`
|
|
10
|
+
* Context for providing brand CSS variables to popup containers.
|
|
11
|
+
* This carries the resolved CSS variable style map from CanvasProvider
|
|
12
|
+
* to usePopupStack for proper popup theming, regardless of whether
|
|
13
|
+
* a numerical or legacy theme is used.
|
|
91
14
|
*/
|
|
92
|
-
const
|
|
93
|
-
focusOutline: brand.common.focus,
|
|
94
|
-
alertInner: brand.common.caution.inner,
|
|
95
|
-
alertOuter: brand.common.caution.outer,
|
|
96
|
-
errorInner: brand.common.critical, // maps to brand.critical500
|
|
97
|
-
};
|
|
15
|
+
export const CanvasBrandStyleContext = React.createContext({});
|
|
98
16
|
/**
|
|
99
17
|
* If you wish to reset the theme to the default, apply this class on the CanvasProvider.
|
|
100
18
|
*/
|
|
101
|
-
export const defaultBranding = createStyles({ name: "
|
|
19
|
+
export const defaultBranding = createStyles({ name: "3z3im2", styles: "--cnvs-brand-common-alert-inner:var(--cnvs-base-palette-amber-400);--cnvs-brand-common-alert-outer:var(--cnvs-base-palette-amber-500);--cnvs-brand-common-error-inner:var(--cnvs-base-palette-red-500);--cnvs-brand-common-focus-outline:var(--cnvs-base-palette-blue-500);--cnvs-brand-neutral-accent:var(--cnvs-base-palette-neutral-0);--cnvs-brand-neutral-darkest:var(--cnvs-base-palette-slate-800);--cnvs-brand-neutral-dark:var(--cnvs-base-palette-slate-700);--cnvs-brand-neutral-base:var(--cnvs-base-palette-slate-600);--cnvs-brand-neutral-light:var(--cnvs-base-palette-slate-200);--cnvs-brand-neutral-lighter:var(--cnvs-base-palette-slate-50);--cnvs-brand-neutral-lightest:var(--cnvs-base-palette-slate-25);--cnvs-brand-success-accent:var(--cnvs-base-palette-neutral-0);--cnvs-brand-success-darkest:var(--cnvs-base-palette-green-800);--cnvs-brand-success-dark:var(--cnvs-base-palette-green-700);--cnvs-brand-success-base:var(--cnvs-base-palette-green-600);--cnvs-brand-success-light:var(--cnvs-base-palette-green-200);--cnvs-brand-success-lighter:var(--cnvs-base-palette-green-50);--cnvs-brand-success-lightest:var(--cnvs-base-palette-green-25);--cnvs-brand-error-accent:var(--cnvs-base-palette-neutral-0);--cnvs-brand-error-darkest:var(--cnvs-base-palette-red-800);--cnvs-brand-error-dark:var(--cnvs-base-palette-red-700);--cnvs-brand-error-base:var(--cnvs-base-palette-red-600);--cnvs-brand-error-light:var(--cnvs-base-palette-red-200);--cnvs-brand-error-lighter:var(--cnvs-base-palette-red-50);--cnvs-brand-error-lightest:var(--cnvs-base-palette-red-25);--cnvs-brand-alert-accent:var(--cnvs-base-palette-neutral-900);--cnvs-brand-alert-darkest:var(--cnvs-base-palette-amber-600);--cnvs-brand-alert-dark:var(--cnvs-base-palette-amber-500);--cnvs-brand-alert-base:var(--cnvs-base-palette-amber-400);--cnvs-brand-alert-light:var(--cnvs-base-palette-amber-200);--cnvs-brand-alert-lighter:var(--cnvs-base-palette-amber-50);--cnvs-brand-alert-lightest:var(--cnvs-base-palette-amber-25);--cnvs-brand-primary-accent:var(--cnvs-base-palette-neutral-0);--cnvs-brand-primary-darkest:var(--cnvs-base-palette-blue-800);--cnvs-brand-primary-dark:var(--cnvs-base-palette-blue-700);--cnvs-brand-primary-base:var(--cnvs-base-palette-blue-600);--cnvs-brand-primary-light:var(--cnvs-base-palette-blue-200);--cnvs-brand-primary-lighter:var(--cnvs-base-palette-blue-50);--cnvs-brand-primary-lightest:var(--cnvs-base-palette-blue-25);--cnvs-brand-gradient-primary:linear-gradient(90deg, var(--cnvs-brand-primary-base) 0%, var(--cnvs-brand-primary-dark) 100%);--cnvs-sys-color-brand-focus-primary:var(--cnvs-brand-common-focus-outline);--cnvs-sys-color-brand-border-primary:var(--cnvs-brand-common-focus-outline);--cnvs-sys-color-brand-accent-primary:var(--cnvs-brand-primary-base);--cnvs-sys-color-brand-accent-action:var(--cnvs-brand-primary-base);--cnvs-sys-color-brand-accent-critical:var(--cnvs-brand-error-base);--cnvs-sys-color-brand-accent-caution:var(--cnvs-brand-alert-base);--cnvs-sys-color-brand-accent-positive:var(--cnvs-brand-success-base);--cnvs-sys-color-brand-fg-primary-default:var(--cnvs-brand-primary-base);--cnvs-sys-color-brand-fg-primary-strong:var(--cnvs-brand-primary-dark);--cnvs-sys-color-brand-fg-critical-default:var(--cnvs-brand-error-base);--cnvs-sys-color-brand-fg-critical-strong:var(--cnvs-brand-error-dark);--cnvs-sys-color-brand-fg-caution-default:var(--cnvs-brand-alert-darkest);--cnvs-sys-color-brand-fg-caution-strong:var(--cnvs-brand-alert-darkest);--cnvs-sys-color-brand-fg-positive-default:var(--cnvs-brand-success-base);--cnvs-sys-color-brand-fg-positive-strong:var(--cnvs-brand-success-dark);--cnvs-sys-color-brand-fg-selected:var(--cnvs-brand-primary-dark);--cnvs-sys-color-brand-focus-critical:var(--cnvs-brand-error-dark);--cnvs-sys-color-brand-border-critical:var(--cnvs-brand-error-base);--cnvs-sys-color-brand-focus-caution-inner:var(--cnvs-brand-common-alert-inner);--cnvs-sys-color-brand-focus-caution-outer:var(--cnvs-brand-alert-dark);--cnvs-sys-color-brand-border-caution:var(--cnvs-brand-alert-dark);--cnvs-sys-color-brand-surface-primary-default:var(--cnvs-brand-primary-lightest);--cnvs-sys-color-brand-surface-primary-strong:var(--cnvs-brand-primary-lighter);--cnvs-sys-color-brand-surface-critical-default:var(--cnvs-brand-error-lightest);--cnvs-sys-color-brand-surface-critical-strong:var(--cnvs-brand-error-lighter);--cnvs-sys-color-brand-surface-caution-default:var(--cnvs-brand-alert-lightest);--cnvs-sys-color-brand-surface-caution-strong:var(--cnvs-brand-alert-lighter);--cnvs-sys-color-brand-surface-positive-default:var(--cnvs-brand-success-lightest);--cnvs-sys-color-brand-surface-positive-strong:var(--cnvs-brand-success-lighter);--cnvs-sys-color-brand-surface-selected:var(--cnvs-brand-primary-lighter);" });
|
|
20
|
+
/** Pure function — safe to call outside React hooks (e.g. usePopupStack). */
|
|
21
|
+
export function canvasThemeToCssVars(theme, elemProps, options) {
|
|
22
|
+
var _a, _b;
|
|
23
|
+
const className = elemProps.className || '';
|
|
24
|
+
const style = { ...(elemProps.style || {}) };
|
|
25
|
+
const scope = (_a = options === null || options === void 0 ? void 0 : options.themeScope) !== null && _a !== void 0 ? _a : resolveThemingScope(theme);
|
|
26
|
+
if (!theme) {
|
|
27
|
+
return { ...elemProps, className, style };
|
|
28
|
+
}
|
|
29
|
+
if (isNumericalTheme(theme)) {
|
|
30
|
+
writeNumericalTheme(theme, style, scope);
|
|
31
|
+
}
|
|
32
|
+
else if (!hasExplicitSemanticPalette(theme)) {
|
|
33
|
+
// `{canvas: {}}` — no inline overrides; global CSS (e.g. Sana) cascades through.
|
|
34
|
+
}
|
|
35
|
+
else if (scope === 'brand') {
|
|
36
|
+
writeBrandScopeSemantic(theme, style);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
const filledTheme = (_b = options === null || options === void 0 ? void 0 : options.filledSemanticTheme) !== null && _b !== void 0 ? _b : getTheme(theme);
|
|
40
|
+
writeSemanticTheme(filledTheme.canvas.palette, style, { writeAll: true });
|
|
41
|
+
}
|
|
42
|
+
return { ...elemProps, className, style };
|
|
43
|
+
}
|
|
102
44
|
export const useCanvasThemeToCssVars = (
|
|
103
45
|
/**
|
|
104
46
|
* @deprecated ⚠️ `theme` is deprecated. In previous versions of Canvas Kit, we allowed teams to pass a theme object, this supported [Emotion's theming](https://emotion.sh/docs/theming). Now that we're shifting to a global theming approach based on CSS variables, we advise to no longer using the theme prop. For more information, view our [Theming Docs](https://workday.github.io/canvas-kit/?path=/docs/features-theming-overview--docs#-preferred-approach-v14).
|
|
105
47
|
*/
|
|
106
|
-
theme, elemProps) => {
|
|
107
|
-
const filledTheme = useTheme(theme);
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
if (color === 'common') {
|
|
113
|
-
['focusOutline', 'alertInner', 'alertOuter', 'errorInner'].forEach(key => {
|
|
114
|
-
if (palette.common[key] !== defaultCanvasTheme.palette.common[key]) {
|
|
115
|
-
const value = maybeWrapCSSVariables(palette.common[key]);
|
|
116
|
-
// Set deprecated token for backwards compatibility
|
|
117
|
-
//@ts-ignore
|
|
118
|
-
style[brand.common[key]] = value;
|
|
119
|
-
// Forward to new brand.common tokens
|
|
120
|
-
//@ts-ignore
|
|
121
|
-
style[commonTokenMapping[key]] = value;
|
|
122
|
-
// Additional system token forwarding for focusOutline
|
|
123
|
-
if (key === 'focusOutline') {
|
|
124
|
-
// system.color.brand.focus.primary -> brand.primary.500 (via brand.common.focus)
|
|
125
|
-
// @ts-ignore
|
|
126
|
-
style[system.color.brand.focus.primary] = value;
|
|
127
|
-
// system.color.brand.border.primary -> brand.primary.500
|
|
128
|
-
// @ts-ignore
|
|
129
|
-
style[system.color.brand.border.primary] = value;
|
|
130
|
-
}
|
|
131
|
-
// Additional system token forwarding for alertInner
|
|
132
|
-
if (key === 'alertInner') {
|
|
133
|
-
// Forward alertInner to system.color.brand.focus.caution.inner
|
|
134
|
-
// This token is used by components (e.g., TextInput with error="caution")
|
|
135
|
-
// for inner focus ring styling. Maps to brand.caution400 via brand.common.caution.inner.
|
|
136
|
-
// This ensures backwards compatibility when users customize alertInner in their theme.
|
|
137
|
-
// @ts-ignore
|
|
138
|
-
style[system.color.brand.focus.caution.inner] = value;
|
|
139
|
-
}
|
|
140
|
-
// Additional system token forwarding for alertOuter
|
|
141
|
-
if (key === 'alertOuter') {
|
|
142
|
-
// Forward alertOuter to system.color.brand.border.caution
|
|
143
|
-
// This token is used by components (e.g., TextInput with error="caution")
|
|
144
|
-
// for border and outer focus ring styling. Maps to brand.caution500 via brand.common.caution.outer.
|
|
145
|
-
// This ensures backwards compatibility when users customize alertOuter in their theme.
|
|
146
|
-
// @ts-ignore
|
|
147
|
-
style[system.color.brand.border.caution] = value;
|
|
148
|
-
}
|
|
149
|
-
// Additional system token forwarding for errorInner
|
|
150
|
-
if (key === 'errorInner') {
|
|
151
|
-
// Forward errorInner to system.color.brand.focus.critical and system.color.brand.border.critical
|
|
152
|
-
// These tokens are used by components (e.g., TextInput with error="error", Switch) for critical
|
|
153
|
-
// focus ring and border styling. Maps to brand.critical500 via brand.common.errorInner.
|
|
154
|
-
// This ensures backwards compatibility when users customize errorInner in their theme.
|
|
155
|
-
// @ts-ignore
|
|
156
|
-
style[system.color.brand.focus.critical] = value;
|
|
157
|
-
// @ts-ignore
|
|
158
|
-
style[system.color.brand.border.critical] = value;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
else {
|
|
164
|
-
['lightest', 'lighter', 'light', 'main', 'dark', 'darkest', 'contrast'].forEach(key => {
|
|
165
|
-
var _a, _b, _c, _d, _e;
|
|
166
|
-
// We only want to set custom colors if they do not match the default. The `defaultBranding` class will take care of the rest.
|
|
167
|
-
//@ts-ignore
|
|
168
|
-
if (palette[color][key] !== defaultCanvasTheme.palette[color][key]) {
|
|
169
|
-
const value = maybeWrapCSSVariables(palette[color][key]);
|
|
170
|
-
// Set deprecated token (e.g., brand.primary.base) for backwards compatibility
|
|
171
|
-
// @ts-ignore
|
|
172
|
-
style[brand[color][mappedKeys[key]]] = value;
|
|
173
|
-
// Forward to new numerical brand tokens (e.g., brand.primary600)
|
|
174
|
-
// Skip 'contrast' as it doesn't map to numerical tokens
|
|
175
|
-
if (key !== 'contrast' && key in numericalTokenMapping) {
|
|
176
|
-
const newBrandColor = brandColorMapping[color];
|
|
177
|
-
const numericalSuffix = numericalTokenMapping[key];
|
|
178
|
-
// @ts-ignore - Dynamically access brand tokens like brand.primary600
|
|
179
|
-
const numericalToken = brand[newBrandColor + numericalSuffix];
|
|
180
|
-
if (numericalToken) {
|
|
181
|
-
// @ts-ignore
|
|
182
|
-
style[numericalToken] = value;
|
|
183
|
-
}
|
|
184
|
-
// Forward to all relevant system.color.brand.* tokens
|
|
185
|
-
// These system tokens reference the numerical brand tokens, so updating them ensures full compatibility
|
|
186
|
-
if (key === 'main') {
|
|
187
|
-
// system.color.brand.accent.{color} -> brand.{color}.600 (except caution -> 400)
|
|
188
|
-
// @ts-ignore
|
|
189
|
-
const systemAccentToken = system.color.brand.accent[newBrandColor];
|
|
190
|
-
if (systemAccentToken) {
|
|
191
|
-
// @ts-ignore
|
|
192
|
-
style[systemAccentToken] = value;
|
|
193
|
-
}
|
|
194
|
-
// system.color.brand.fg.{color}.default -> brand.{color}.600
|
|
195
|
-
// @ts-ignore
|
|
196
|
-
const systemFgToken = (_a = system.color.brand.fg[newBrandColor]) === null || _a === void 0 ? void 0 : _a.default;
|
|
197
|
-
if (systemFgToken) {
|
|
198
|
-
// @ts-ignore
|
|
199
|
-
style[systemFgToken] = value;
|
|
200
|
-
}
|
|
201
|
-
// system.color.brand.focus.primary (maps to brand.primary.500 per docs)
|
|
202
|
-
// For primary only, update focus when 'main' changes — unless focusOutline was customized (it takes precedence)
|
|
203
|
-
if (newBrandColor === 'primary') {
|
|
204
|
-
const focusOutlineCustomized = palette.common.focusOutline !== defaultCanvasTheme.palette.common.focusOutline;
|
|
205
|
-
if (!focusOutlineCustomized) {
|
|
206
|
-
// @ts-ignore
|
|
207
|
-
const focusToken = system.color.brand.focus.primary;
|
|
208
|
-
if (focusToken) {
|
|
209
|
-
// @ts-ignore
|
|
210
|
-
style[focusToken] = value;
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
else if (key === 'dark') {
|
|
216
|
-
// system.color.brand.fg.{color}.strong -> brand.{color}.700
|
|
217
|
-
// @ts-ignore
|
|
218
|
-
const systemFgStrongToken = (_b = system.color.brand.fg[newBrandColor]) === null || _b === void 0 ? void 0 : _b.strong;
|
|
219
|
-
if (systemFgStrongToken) {
|
|
220
|
-
// @ts-ignore
|
|
221
|
-
style[systemFgStrongToken] = value;
|
|
222
|
-
}
|
|
223
|
-
// system.color.brand.fg.selected -> brand.primary.700 (for primary only)
|
|
224
|
-
if (newBrandColor === 'primary') {
|
|
225
|
-
// @ts-ignore
|
|
226
|
-
const selectedToken = system.color.brand.fg.selected;
|
|
227
|
-
if (selectedToken) {
|
|
228
|
-
// @ts-ignore
|
|
229
|
-
style[selectedToken] = value;
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
// system.color.brand.focus.critical & system.color.brand.border.critical -> brand.critical.500 (palette.error.dark)
|
|
233
|
-
if (newBrandColor === 'critical') {
|
|
234
|
-
// @ts-ignore
|
|
235
|
-
const focusCriticalToken = system.color.brand.focus.critical;
|
|
236
|
-
if (focusCriticalToken) {
|
|
237
|
-
// @ts-ignore
|
|
238
|
-
style[focusCriticalToken] = value;
|
|
239
|
-
}
|
|
240
|
-
// @ts-ignore
|
|
241
|
-
const borderCriticalToken = system.color.brand.border.critical;
|
|
242
|
-
if (borderCriticalToken) {
|
|
243
|
-
// @ts-ignore
|
|
244
|
-
style[borderCriticalToken] = value;
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
// system.color.brand.focus.caution.outer & system.color.brand.border.caution -> brand.caution.500 (palette.alert.dark)
|
|
248
|
-
if (newBrandColor === 'caution') {
|
|
249
|
-
// @ts-ignore
|
|
250
|
-
const focusCautionOuterToken = (_c = system.color.brand.focus.caution) === null || _c === void 0 ? void 0 : _c.outer;
|
|
251
|
-
if (focusCautionOuterToken) {
|
|
252
|
-
// @ts-ignore
|
|
253
|
-
style[focusCautionOuterToken] = value;
|
|
254
|
-
}
|
|
255
|
-
// @ts-ignore
|
|
256
|
-
const borderCautionToken = system.color.brand.border.caution;
|
|
257
|
-
if (borderCautionToken) {
|
|
258
|
-
// @ts-ignore
|
|
259
|
-
style[borderCautionToken] = value;
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
else if (key === 'lighter') {
|
|
264
|
-
// system.color.brand.surface.{color}.strong -> brand.{color}.A50
|
|
265
|
-
// Note: A50 tokens are different from regular 50 tokens but we'll forward the lighter value
|
|
266
|
-
// @ts-ignore
|
|
267
|
-
const surfaceStrongToken = (_d = system.color.brand.surface[newBrandColor]) === null || _d === void 0 ? void 0 : _d.strong;
|
|
268
|
-
if (surfaceStrongToken) {
|
|
269
|
-
// @ts-ignore
|
|
270
|
-
style[surfaceStrongToken] = value;
|
|
271
|
-
}
|
|
272
|
-
// system.color.brand.surface.selected -> brand.primary.A50 (for primary only)
|
|
273
|
-
if (newBrandColor === 'primary') {
|
|
274
|
-
// @ts-ignore
|
|
275
|
-
const selectedSurfaceToken = system.color.brand.surface.selected;
|
|
276
|
-
if (selectedSurfaceToken) {
|
|
277
|
-
// @ts-ignore
|
|
278
|
-
style[selectedSurfaceToken] = value;
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
else if (key === 'lightest') {
|
|
283
|
-
// system.color.brand.surface.{color}.default -> brand.{color}.A25
|
|
284
|
-
// @ts-ignore
|
|
285
|
-
const surfaceDefaultToken = (_e = system.color.brand.surface[newBrandColor]) === null || _e === void 0 ? void 0 : _e.default;
|
|
286
|
-
if (surfaceDefaultToken) {
|
|
287
|
-
// @ts-ignore
|
|
288
|
-
style[surfaceDefaultToken] = value;
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
});
|
|
294
|
-
}
|
|
48
|
+
theme, elemProps, themeScope) => {
|
|
49
|
+
const filledTheme = useTheme(isNumericalTheme(theme) ? undefined : theme);
|
|
50
|
+
const resolvedScope = themeScope !== null && themeScope !== void 0 ? themeScope : resolveThemingScope(theme);
|
|
51
|
+
return canvasThemeToCssVars(theme, elemProps, {
|
|
52
|
+
themeScope: resolvedScope,
|
|
53
|
+
filledSemanticTheme: !isNumericalTheme(theme) && resolvedScope === 'full' ? filledTheme : undefined,
|
|
295
54
|
});
|
|
296
|
-
return { ...elemProps, className, style };
|
|
297
55
|
};
|
|
298
|
-
export const CanvasProvider = ({ children, theme
|
|
299
|
-
...props }) => {
|
|
56
|
+
export const CanvasProvider = ({ children, theme, themeScope, ...props }) => {
|
|
300
57
|
var _a;
|
|
301
|
-
|
|
58
|
+
// Add console warning for unnecessary sanaCanvasProviderTheme usage
|
|
59
|
+
React.useEffect(() => {
|
|
60
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
61
|
+
if (theme === sanaCanvasProviderTheme &&
|
|
62
|
+
typeof document !== 'undefined' &&
|
|
63
|
+
document.documentElement.getAttribute('data-theme') === 'sana-canvas') {
|
|
64
|
+
console.warn('Canvas Kit: You are passing sanaCanvasProviderTheme to CanvasProvider but ' +
|
|
65
|
+
'data-theme="sana-canvas" is already set on <html>. The theme prop is not needed ' +
|
|
66
|
+
'in this case and can be removed. Keep sanaCanvasProviderTheme when you cannot ' +
|
|
67
|
+
'control <html> (embedded apps / microfrontends) so popups still get Sana brand ' +
|
|
68
|
+
'variables. See: ' +
|
|
69
|
+
'https://workday.github.io/canvas-kit/?path=/docs/features-theming-overview--docs');
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}, [theme]);
|
|
73
|
+
// Computed className/style win over consumer props — do not re-spread `props` over them.
|
|
74
|
+
const { className, style, ...elemProps } = useCanvasThemeToCssVars(theme, props, themeScope);
|
|
302
75
|
const cache = getCache();
|
|
303
|
-
|
|
304
|
-
|
|
76
|
+
// Read parent context to support nested scoped providers
|
|
77
|
+
const parentBrandStyle = React.useContext(CanvasBrandStyleContext);
|
|
78
|
+
// Popup forwarding only needs CSS custom properties (not consumer layout styles).
|
|
79
|
+
const mergedBrandStyle = React.useMemo(() => {
|
|
80
|
+
const merged = {};
|
|
81
|
+
for (const [key, value] of Object.entries({ ...parentBrandStyle, ...style })) {
|
|
82
|
+
if (key.startsWith('--') && typeof value === 'string') {
|
|
83
|
+
// @ts-ignore - CSS custom property key
|
|
84
|
+
merged[key] = value;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return merged;
|
|
88
|
+
}, [parentBrandStyle, style]);
|
|
89
|
+
const emotionTheme = theme
|
|
90
|
+
? isNumericalTheme(theme)
|
|
91
|
+
? { canvas: defaultCanvasTheme }
|
|
92
|
+
: theme
|
|
93
|
+
: undefined;
|
|
94
|
+
const content = (_jsx("div", { dir: isNumericalTheme(theme)
|
|
95
|
+
? theme.direction || defaultCanvasTheme.direction
|
|
96
|
+
: ((_a = theme === null || theme === void 0 ? void 0 : theme.canvas) === null || _a === void 0 ? void 0 : _a.direction) || defaultCanvasTheme.direction, className: className, ...elemProps, style: style, children: children }));
|
|
97
|
+
const wrappedContent = (_jsx(CanvasBrandStyleContext.Provider, { value: mergedBrandStyle, children: content }));
|
|
98
|
+
return (_jsx(CacheProvider, { value: cache, children: emotionTheme ? (_jsx(ThemeProvider, { theme: emotionTheme, children: wrappedContent })) : (wrappedContent) }));
|
|
305
99
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { createStyles, handleCsProp } from '@workday/canvas-kit-styling';
|
|
3
3
|
import { createComponent } from './utils';
|
|
4
|
-
const ellipsisStyles = createStyles({ name: "
|
|
4
|
+
const ellipsisStyles = createStyles({ name: "4ehrff", styles: "white-space:nowrap;text-overflow:ellipsis;overflow:hidden;" });
|
|
5
5
|
export const EllipsisText = createComponent('span')({
|
|
6
6
|
displayName: 'EllipsisText',
|
|
7
7
|
Component({ children, ...elemProps }, ref, Element) {
|
|
@@ -8,5 +8,5 @@ export const cornerShapeStencil = createStencil({
|
|
|
8
8
|
vars: {
|
|
9
9
|
shape: '',
|
|
10
10
|
},
|
|
11
|
-
base: { name: "
|
|
11
|
+
base: { name: "297zk6", styles: "box-sizing:border-box;border-radius:var(--shape-corner-shape-ccab68);corner-shape:superellipse(1.1);" }
|
|
12
12
|
}, "corner-shape-ccab68");
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { CanvasActionBrandRamp, CanvasBrandRamp, CanvasNeutralBrandRamp, CanvasNumericalBrandTheme, CanvasProviderTheme, CanvasTheme, PartialEmotionCanvasTheme } from './types';
|
|
3
|
+
/** True when a semantic theme intentionally passes a non-empty `canvas.palette`. */
|
|
4
|
+
export declare function hasExplicitSemanticPalette(theme: CanvasProviderTheme): theme is PartialEmotionCanvasTheme;
|
|
5
|
+
/** Tokens that change when a consumer sets only their primary brand color. */
|
|
6
|
+
export declare const BRAND_SCOPE_PRIMARY_BUNDLE: {
|
|
7
|
+
readonly action: readonly ["base", "dark", "darkest", "accent"];
|
|
8
|
+
readonly accent: readonly ["primary", "action"];
|
|
9
|
+
readonly selected: {
|
|
10
|
+
readonly fg: "--cnvs-sys-color-brand-fg-selected";
|
|
11
|
+
readonly surface: "--cnvs-sys-color-brand-surface-selected";
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Independently brandable tokens — writable when explicitly provided,
|
|
16
|
+
* but NEVER derived from primary.main / brand.primary.600.
|
|
17
|
+
*/
|
|
18
|
+
export declare const BRAND_SCOPE_INDEPENDENT: {
|
|
19
|
+
readonly focus: {
|
|
20
|
+
readonly primary: "--cnvs-sys-color-brand-focus-primary";
|
|
21
|
+
readonly brandToken: "--cnvs-brand-primary-500";
|
|
22
|
+
readonly semanticKey: "focusOutline";
|
|
23
|
+
};
|
|
24
|
+
readonly border: {
|
|
25
|
+
readonly primary: "--cnvs-sys-color-brand-border-primary";
|
|
26
|
+
readonly brandToken: "--cnvs-brand-primary-500";
|
|
27
|
+
readonly semanticKey: "focusOutline";
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
type BrandColor = 'primary' | 'critical' | 'caution' | 'positive' | 'neutral';
|
|
31
|
+
/** Maps a numerical brand ramp onto `brand.<color><rampKey>` CSS variables. */
|
|
32
|
+
export declare function writeNumericalBrandRamp(color: BrandColor | 'action', ramp: CanvasBrandRamp | CanvasNeutralBrandRamp | CanvasActionBrandRamp | undefined, style: React.CSSProperties, options?: {
|
|
33
|
+
skipKeys?: Set<string>;
|
|
34
|
+
}): void;
|
|
35
|
+
/** Called when consumer sets only `primary.main` or `brand.primary['600']`. */
|
|
36
|
+
export declare function applyPrimaryBrandBundle(primaryColor: string, style: React.CSSProperties): void;
|
|
37
|
+
/** Called when consumer sets only `error.main` or `brand.critical['600']`. */
|
|
38
|
+
export declare function applyCriticalBrandBundle(criticalColor: string, style: React.CSSProperties): void;
|
|
39
|
+
/** Called when consumer sets only `alert.main` or `brand.caution['400']`. */
|
|
40
|
+
export declare function applyCautionBrandBundle(cautionColor: string, style: React.CSSProperties): void;
|
|
41
|
+
/** Called when consumer sets only `success.main` or `brand.positive['600']`. */
|
|
42
|
+
export declare function applyPositiveBrandBundle(positiveColor: string, style: React.CSSProperties): void;
|
|
43
|
+
/** Called when consumer sets only `neutral.main` or `brand.neutral['600']`. */
|
|
44
|
+
export declare function applyNeutralBrandBundle(neutralColor: string, style: React.CSSProperties): void;
|
|
45
|
+
/** Writes first-class selected shortcuts from numerical theme input. */
|
|
46
|
+
export declare function writeSelectedShortcuts(selected: CanvasNumericalBrandTheme['selected'] | undefined, style: React.CSSProperties): void;
|
|
47
|
+
/** Writes focus/border from explicit common or brand.primary.500 input — never from primary.main. */
|
|
48
|
+
export declare function writeIndependentBrandTokens(theme: CanvasProviderTheme | undefined, style: React.CSSProperties): void;
|
|
49
|
+
/** Walks nested system override object and sets matching system CSS vars. */
|
|
50
|
+
export declare function writeSystemBrandOverrides(systemOverrides: {
|
|
51
|
+
color?: {
|
|
52
|
+
brand?: Record<string, unknown>;
|
|
53
|
+
};
|
|
54
|
+
} | undefined, style: React.CSSProperties): void;
|
|
55
|
+
/** Full-scope semantic writer — filled palette compared against defaults unless `writeAll`. */
|
|
56
|
+
export declare function writeSemanticTheme(palette: CanvasTheme['palette'], style: React.CSSProperties, options?: {
|
|
57
|
+
writeAll?: boolean;
|
|
58
|
+
}): void;
|
|
59
|
+
/** Writes numerical theme — brand scope applies per-family shortcuts; remaining keys write 1:1. */
|
|
60
|
+
export declare function writeNumericalTheme(theme: CanvasNumericalBrandTheme, style: React.CSSProperties, scope: 'brand' | 'full'): void;
|
|
61
|
+
/** Brand-scope semantic path — reads raw input only, not useTheme-filled palette. */
|
|
62
|
+
export declare function writeBrandScopeSemantic(theme: PartialEmotionCanvasTheme, style: React.CSSProperties): void;
|
|
63
|
+
export {};
|
|
64
|
+
//# sourceMappingURL=brandScope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brandScope.d.ts","sourceRoot":"","sources":["../../../../../common/lib/theming/brandScope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,EACL,qBAAqB,EACrB,eAAe,EACf,sBAAsB,EACtB,yBAAyB,EACzB,mBAAmB,EACnB,WAAW,EACX,yBAAyB,EAE1B,MAAM,SAAS,CAAC;AAEjB,oFAAoF;AACpF,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,mBAAmB,GACzB,KAAK,IAAI,yBAAyB,CAMpC;AAED,8EAA8E;AAC9E,eAAO,MAAM,0BAA0B;;;;;;;CAO7B,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;CAW1B,CAAC;AASX,KAAK,UAAU,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC;AAsB9E,+EAA+E;AAC/E,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,UAAU,GAAG,QAAQ,EAC5B,IAAI,EAAE,eAAe,GAAG,sBAAsB,GAAG,qBAAqB,GAAG,SAAS,EAClF,KAAK,EAAE,KAAK,CAAC,aAAa,EAC1B,OAAO,CAAC,EAAE;IAAC,QAAQ,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAAC,QA0BnC;AAED,+EAA+E;AAC/E,wBAAgB,uBAAuB,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,aAAa,QAiDvF;AAED,8EAA8E;AAC9E,wBAAgB,wBAAwB,CAAC,aAAa,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,aAAa,QAmBzF;AAED,6EAA6E;AAC7E,wBAAgB,uBAAuB,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,aAAa,QAsBvF;AAED,gFAAgF;AAChF,wBAAgB,wBAAwB,CAAC,aAAa,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,aAAa,QAYzF;AAED,+EAA+E;AAC/E,wBAAgB,uBAAuB,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,aAAa,QAKvF;AAED,wEAAwE;AACxE,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,yBAAyB,CAAC,UAAU,CAAC,GAAG,SAAS,EAC3D,KAAK,EAAE,KAAK,CAAC,aAAa,QAW3B;AAaD,qGAAqG;AACrG,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,mBAAmB,GAAG,SAAS,EACtC,KAAK,EAAE,KAAK,CAAC,aAAa,QAuD3B;AAED,6EAA6E;AAC7E,wBAAgB,yBAAyB,CACvC,eAAe,EAAE;IAAC,KAAK,CAAC,EAAE;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAC,CAAA;CAAC,GAAG,SAAS,EACxE,KAAK,EAAE,KAAK,CAAC,aAAa,QAyB3B;AAqBD,+FAA+F;AAC/F,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,WAAW,CAAC,SAAS,CAAC,EAC/B,KAAK,EAAE,KAAK,CAAC,aAAa,EAC1B,OAAO,CAAC,EAAE;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAC,QA+G/B;AAED,mGAAmG;AACnG,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,yBAAyB,EAChC,KAAK,EAAE,KAAK,CAAC,aAAa,EAC1B,KAAK,EAAE,OAAO,GAAG,MAAM,QA4CxB;AAED,qFAAqF;AACrF,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,yBAAyB,EAChC,KAAK,EAAE,KAAK,CAAC,aAAa,QAoB3B"}
|