@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,310 +1,128 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CanvasProvider = exports.useCanvasThemeToCssVars = exports.defaultBranding = void 0;
|
|
26
|
+
exports.CanvasProvider = exports.useCanvasThemeToCssVars = exports.canvasThemeToCssVars = exports.defaultBranding = exports.CanvasBrandStyleContext = void 0;
|
|
4
27
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
28
|
const react_1 = require("@emotion/react");
|
|
29
|
+
const React = __importStar(require("react"));
|
|
6
30
|
const canvas_kit_styling_1 = require("@workday/canvas-kit-styling");
|
|
7
31
|
const canvas_tokens_web_1 = require("@workday/canvas-tokens-web");
|
|
8
32
|
const theming_1 = require("./theming");
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
lighter: 'lighter',
|
|
12
|
-
light: 'light',
|
|
13
|
-
main: 'base',
|
|
14
|
-
dark: 'dark',
|
|
15
|
-
darkest: 'darkest',
|
|
16
|
-
contrast: 'accent',
|
|
17
|
-
};
|
|
18
|
-
/**
|
|
19
|
-
* Mapping from deprecated theme palette keys to new numerical brand tokens.
|
|
20
|
-
* This ensures backwards compatibility when consumers use the old theme format.
|
|
21
|
-
* For example: palette.primary.main -> brand.primary600
|
|
22
|
-
*/
|
|
23
|
-
const numericalTokenMapping = {
|
|
24
|
-
lightest: '25',
|
|
25
|
-
lighter: '50',
|
|
26
|
-
light: '200',
|
|
27
|
-
main: '600',
|
|
28
|
-
dark: '700',
|
|
29
|
-
darkest: '800',
|
|
30
|
-
};
|
|
33
|
+
const brandScope_1 = require("./theming/brandScope");
|
|
34
|
+
const sanaTheme_1 = require("./theming/sanaTheme");
|
|
31
35
|
/**
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* `success` -> `positive`
|
|
37
|
-
* `alert` -> `caution`
|
|
38
|
-
* `neutral` -> `neutral`
|
|
36
|
+
* Context for providing brand CSS variables to popup containers.
|
|
37
|
+
* This carries the resolved CSS variable style map from CanvasProvider
|
|
38
|
+
* to usePopupStack for proper popup theming, regardless of whether
|
|
39
|
+
* a numerical or legacy theme is used.
|
|
39
40
|
*/
|
|
40
|
-
|
|
41
|
-
primary: 'primary',
|
|
42
|
-
error: 'critical',
|
|
43
|
-
success: 'positive',
|
|
44
|
-
alert: 'caution',
|
|
45
|
-
neutral: 'neutral',
|
|
46
|
-
};
|
|
47
|
-
/**
|
|
48
|
-
* Mapping from deprecated common palette keys to new brand.common tokens.
|
|
49
|
-
*
|
|
50
|
-
* ## Brandable System Tokens
|
|
51
|
-
*
|
|
52
|
-
* These are all the `system.color.brand.*` tokens that can be customized via theming.
|
|
53
|
-
* Each token references a brand token that can be overridden through the CanvasProvider theme prop.
|
|
54
|
-
*
|
|
55
|
-
* ### Focus Tokens
|
|
56
|
-
* - `system.color.brand.focus.primary` → `brand.primary.500` → Controlled by `focusOutline` (separately from `palette.primary.main`, which controls `brand.primary.600`)
|
|
57
|
-
* - `system.color.brand.focus.critical` → `brand.critical.500` → Controlled by `palette.error.dark` or `errorInner`
|
|
58
|
-
* - `system.color.brand.focus.caution.inner` → `brand.caution.400` → Controlled by `palette.alert.main` or `alertInner`
|
|
59
|
-
* - `system.color.brand.focus.caution.outer` → `brand.caution.500` → Controlled by `palette.alert.dark` or `alertOuter`
|
|
60
|
-
*
|
|
61
|
-
* ### Border Tokens
|
|
62
|
-
* - `system.color.brand.border.primary` → `brand.primary.500` → Controlled by `focusOutline` (separately from `palette.primary.main`, which controls `brand.primary.600`)
|
|
63
|
-
* - `system.color.brand.border.critical` → `brand.critical.500` → Controlled by `palette.error.dark` or `errorInner`
|
|
64
|
-
* - `system.color.brand.border.caution` → `brand.caution.500` → Controlled by `palette.alert.dark` or `alertOuter`
|
|
65
|
-
*
|
|
66
|
-
* ### Surface Tokens
|
|
67
|
-
* - `system.color.brand.surface.primary.default` → `brand.primary.A25` → Controlled by `palette.primary.lightest`
|
|
68
|
-
* - `system.color.brand.surface.primary.strong` → `brand.primary.A50` → Controlled by `palette.primary.lighter`
|
|
69
|
-
* - `system.color.brand.surface.critical.default` → `brand.critical.A25` → Controlled by `palette.error.lightest`
|
|
70
|
-
* - `system.color.brand.surface.critical.strong` → `brand.critical.A50` → Controlled by `palette.error.lighter`
|
|
71
|
-
* - `system.color.brand.surface.caution.default` → `brand.caution.A25` → Controlled by `palette.alert.lightest`
|
|
72
|
-
* - `system.color.brand.surface.caution.strong` → `brand.caution.A50` → Controlled by `palette.alert.lighter`
|
|
73
|
-
* - `system.color.brand.surface.positive.default` → `brand.positive.A25` → Controlled by `palette.success.lightest`
|
|
74
|
-
* - `system.color.brand.surface.positive.strong` → `brand.positive.A50` → Controlled by `palette.success.lighter`
|
|
75
|
-
* - `system.color.brand.surface.selected` → `brand.primary.A50` → Controlled by `palette.primary.lighter`
|
|
76
|
-
*
|
|
77
|
-
* ### Accent Tokens
|
|
78
|
-
* - `system.color.brand.accent.primary` → `brand.primary.600` → Controlled by `palette.primary.main`
|
|
79
|
-
* - `system.color.brand.accent.critical` → `brand.critical.600` → Controlled by `palette.error.main`
|
|
80
|
-
* - `system.color.brand.accent.caution` → `brand.caution.400` → Controlled by `palette.alert.main`
|
|
81
|
-
* - `system.color.brand.accent.positive` → `brand.positive.600` → Controlled by `palette.success.main`
|
|
82
|
-
* - `system.color.brand.accent.action` → `brand.primary.600` → Controlled by `palette.primary.main`
|
|
83
|
-
*
|
|
84
|
-
* ### Foreground (Text/Icon) Tokens
|
|
85
|
-
* - `system.color.brand.fg.primary.default` → `brand.primary.600` → Controlled by `palette.primary.main`
|
|
86
|
-
* - `system.color.brand.fg.primary.strong` → `brand.primary.700` → Controlled by `palette.primary.dark`
|
|
87
|
-
* - `system.color.brand.fg.critical.default` → `brand.critical.600` → Controlled by `palette.error.main`
|
|
88
|
-
* - `system.color.brand.fg.critical.strong` → `brand.critical.700` → Controlled by `palette.error.dark`
|
|
89
|
-
* - `system.color.brand.fg.caution.default` → `brand.caution.600` → Controlled by `palette.alert.darkest`
|
|
90
|
-
* - `system.color.brand.fg.caution.strong` → `brand.caution.700` → Controlled by `palette.alert.dark` (Note: no direct mapping, inherits default)
|
|
91
|
-
* - `system.color.brand.fg.positive.default` → `brand.positive.600` → Controlled by `palette.success.main`
|
|
92
|
-
* - `system.color.brand.fg.positive.strong` → `brand.positive.700` → Controlled by `palette.success.dark`
|
|
93
|
-
* - `system.color.brand.fg.selected` → `brand.primary.700` → Controlled by `palette.primary.dark`
|
|
94
|
-
*/
|
|
95
|
-
const commonTokenMapping = {
|
|
96
|
-
focusOutline: canvas_tokens_web_1.brand.common.focus,
|
|
97
|
-
alertInner: canvas_tokens_web_1.brand.common.caution.inner,
|
|
98
|
-
alertOuter: canvas_tokens_web_1.brand.common.caution.outer,
|
|
99
|
-
errorInner: canvas_tokens_web_1.brand.common.critical, // maps to brand.critical500
|
|
100
|
-
};
|
|
41
|
+
exports.CanvasBrandStyleContext = React.createContext({});
|
|
101
42
|
/**
|
|
102
43
|
* If you wish to reset the theme to the default, apply this class on the CanvasProvider.
|
|
103
44
|
*/
|
|
104
|
-
exports.defaultBranding = (0, canvas_kit_styling_1.createStyles)({ name: "
|
|
45
|
+
exports.defaultBranding = (0, canvas_kit_styling_1.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);" });
|
|
46
|
+
/** Pure function — safe to call outside React hooks (e.g. usePopupStack). */
|
|
47
|
+
function canvasThemeToCssVars(theme, elemProps, options) {
|
|
48
|
+
var _a, _b;
|
|
49
|
+
const className = elemProps.className || '';
|
|
50
|
+
const style = { ...(elemProps.style || {}) };
|
|
51
|
+
const scope = (_a = options === null || options === void 0 ? void 0 : options.themeScope) !== null && _a !== void 0 ? _a : (0, theming_1.resolveThemingScope)(theme);
|
|
52
|
+
if (!theme) {
|
|
53
|
+
return { ...elemProps, className, style };
|
|
54
|
+
}
|
|
55
|
+
if ((0, theming_1.isNumericalTheme)(theme)) {
|
|
56
|
+
(0, brandScope_1.writeNumericalTheme)(theme, style, scope);
|
|
57
|
+
}
|
|
58
|
+
else if (!(0, brandScope_1.hasExplicitSemanticPalette)(theme)) {
|
|
59
|
+
// `{canvas: {}}` — no inline overrides; global CSS (e.g. Sana) cascades through.
|
|
60
|
+
}
|
|
61
|
+
else if (scope === 'brand') {
|
|
62
|
+
(0, brandScope_1.writeBrandScopeSemantic)(theme, style);
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
const filledTheme = (_b = options === null || options === void 0 ? void 0 : options.filledSemanticTheme) !== null && _b !== void 0 ? _b : (0, theming_1.getTheme)(theme);
|
|
66
|
+
(0, brandScope_1.writeSemanticTheme)(filledTheme.canvas.palette, style, { writeAll: true });
|
|
67
|
+
}
|
|
68
|
+
return { ...elemProps, className, style };
|
|
69
|
+
}
|
|
70
|
+
exports.canvasThemeToCssVars = canvasThemeToCssVars;
|
|
105
71
|
const useCanvasThemeToCssVars = (
|
|
106
72
|
/**
|
|
107
73
|
* @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).
|
|
108
74
|
*/
|
|
109
|
-
theme, elemProps) => {
|
|
110
|
-
const filledTheme = (0, theming_1.useTheme)(theme);
|
|
111
|
-
const
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
if (color === 'common') {
|
|
116
|
-
['focusOutline', 'alertInner', 'alertOuter', 'errorInner'].forEach(key => {
|
|
117
|
-
if (palette.common[key] !== theming_1.defaultCanvasTheme.palette.common[key]) {
|
|
118
|
-
const value = (0, canvas_kit_styling_1.maybeWrapCSSVariables)(palette.common[key]);
|
|
119
|
-
// Set deprecated token for backwards compatibility
|
|
120
|
-
//@ts-ignore
|
|
121
|
-
style[canvas_tokens_web_1.brand.common[key]] = value;
|
|
122
|
-
// Forward to new brand.common tokens
|
|
123
|
-
//@ts-ignore
|
|
124
|
-
style[commonTokenMapping[key]] = value;
|
|
125
|
-
// Additional system token forwarding for focusOutline
|
|
126
|
-
if (key === 'focusOutline') {
|
|
127
|
-
// system.color.brand.focus.primary -> brand.primary.500 (via brand.common.focus)
|
|
128
|
-
// @ts-ignore
|
|
129
|
-
style[canvas_tokens_web_1.system.color.brand.focus.primary] = value;
|
|
130
|
-
// system.color.brand.border.primary -> brand.primary.500
|
|
131
|
-
// @ts-ignore
|
|
132
|
-
style[canvas_tokens_web_1.system.color.brand.border.primary] = value;
|
|
133
|
-
}
|
|
134
|
-
// Additional system token forwarding for alertInner
|
|
135
|
-
if (key === 'alertInner') {
|
|
136
|
-
// Forward alertInner to system.color.brand.focus.caution.inner
|
|
137
|
-
// This token is used by components (e.g., TextInput with error="caution")
|
|
138
|
-
// for inner focus ring styling. Maps to brand.caution400 via brand.common.caution.inner.
|
|
139
|
-
// This ensures backwards compatibility when users customize alertInner in their theme.
|
|
140
|
-
// @ts-ignore
|
|
141
|
-
style[canvas_tokens_web_1.system.color.brand.focus.caution.inner] = value;
|
|
142
|
-
}
|
|
143
|
-
// Additional system token forwarding for alertOuter
|
|
144
|
-
if (key === 'alertOuter') {
|
|
145
|
-
// Forward alertOuter to system.color.brand.border.caution
|
|
146
|
-
// This token is used by components (e.g., TextInput with error="caution")
|
|
147
|
-
// for border and outer focus ring styling. Maps to brand.caution500 via brand.common.caution.outer.
|
|
148
|
-
// This ensures backwards compatibility when users customize alertOuter in their theme.
|
|
149
|
-
// @ts-ignore
|
|
150
|
-
style[canvas_tokens_web_1.system.color.brand.border.caution] = value;
|
|
151
|
-
}
|
|
152
|
-
// Additional system token forwarding for errorInner
|
|
153
|
-
if (key === 'errorInner') {
|
|
154
|
-
// Forward errorInner to system.color.brand.focus.critical and system.color.brand.border.critical
|
|
155
|
-
// These tokens are used by components (e.g., TextInput with error="error", Switch) for critical
|
|
156
|
-
// focus ring and border styling. Maps to brand.critical500 via brand.common.errorInner.
|
|
157
|
-
// This ensures backwards compatibility when users customize errorInner in their theme.
|
|
158
|
-
// @ts-ignore
|
|
159
|
-
style[canvas_tokens_web_1.system.color.brand.focus.critical] = value;
|
|
160
|
-
// @ts-ignore
|
|
161
|
-
style[canvas_tokens_web_1.system.color.brand.border.critical] = value;
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
else {
|
|
167
|
-
['lightest', 'lighter', 'light', 'main', 'dark', 'darkest', 'contrast'].forEach(key => {
|
|
168
|
-
var _a, _b, _c, _d, _e;
|
|
169
|
-
// We only want to set custom colors if they do not match the default. The `defaultBranding` class will take care of the rest.
|
|
170
|
-
//@ts-ignore
|
|
171
|
-
if (palette[color][key] !== theming_1.defaultCanvasTheme.palette[color][key]) {
|
|
172
|
-
const value = (0, canvas_kit_styling_1.maybeWrapCSSVariables)(palette[color][key]);
|
|
173
|
-
// Set deprecated token (e.g., brand.primary.base) for backwards compatibility
|
|
174
|
-
// @ts-ignore
|
|
175
|
-
style[canvas_tokens_web_1.brand[color][mappedKeys[key]]] = value;
|
|
176
|
-
// Forward to new numerical brand tokens (e.g., brand.primary600)
|
|
177
|
-
// Skip 'contrast' as it doesn't map to numerical tokens
|
|
178
|
-
if (key !== 'contrast' && key in numericalTokenMapping) {
|
|
179
|
-
const newBrandColor = brandColorMapping[color];
|
|
180
|
-
const numericalSuffix = numericalTokenMapping[key];
|
|
181
|
-
// @ts-ignore - Dynamically access brand tokens like brand.primary600
|
|
182
|
-
const numericalToken = canvas_tokens_web_1.brand[newBrandColor + numericalSuffix];
|
|
183
|
-
if (numericalToken) {
|
|
184
|
-
// @ts-ignore
|
|
185
|
-
style[numericalToken] = value;
|
|
186
|
-
}
|
|
187
|
-
// Forward to all relevant system.color.brand.* tokens
|
|
188
|
-
// These system tokens reference the numerical brand tokens, so updating them ensures full compatibility
|
|
189
|
-
if (key === 'main') {
|
|
190
|
-
// system.color.brand.accent.{color} -> brand.{color}.600 (except caution -> 400)
|
|
191
|
-
// @ts-ignore
|
|
192
|
-
const systemAccentToken = canvas_tokens_web_1.system.color.brand.accent[newBrandColor];
|
|
193
|
-
if (systemAccentToken) {
|
|
194
|
-
// @ts-ignore
|
|
195
|
-
style[systemAccentToken] = value;
|
|
196
|
-
}
|
|
197
|
-
// system.color.brand.fg.{color}.default -> brand.{color}.600
|
|
198
|
-
// @ts-ignore
|
|
199
|
-
const systemFgToken = (_a = canvas_tokens_web_1.system.color.brand.fg[newBrandColor]) === null || _a === void 0 ? void 0 : _a.default;
|
|
200
|
-
if (systemFgToken) {
|
|
201
|
-
// @ts-ignore
|
|
202
|
-
style[systemFgToken] = value;
|
|
203
|
-
}
|
|
204
|
-
// system.color.brand.focus.primary (maps to brand.primary.500 per docs)
|
|
205
|
-
// For primary only, update focus when 'main' changes — unless focusOutline was customized (it takes precedence)
|
|
206
|
-
if (newBrandColor === 'primary') {
|
|
207
|
-
const focusOutlineCustomized = palette.common.focusOutline !== theming_1.defaultCanvasTheme.palette.common.focusOutline;
|
|
208
|
-
if (!focusOutlineCustomized) {
|
|
209
|
-
// @ts-ignore
|
|
210
|
-
const focusToken = canvas_tokens_web_1.system.color.brand.focus.primary;
|
|
211
|
-
if (focusToken) {
|
|
212
|
-
// @ts-ignore
|
|
213
|
-
style[focusToken] = value;
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
else if (key === 'dark') {
|
|
219
|
-
// system.color.brand.fg.{color}.strong -> brand.{color}.700
|
|
220
|
-
// @ts-ignore
|
|
221
|
-
const systemFgStrongToken = (_b = canvas_tokens_web_1.system.color.brand.fg[newBrandColor]) === null || _b === void 0 ? void 0 : _b.strong;
|
|
222
|
-
if (systemFgStrongToken) {
|
|
223
|
-
// @ts-ignore
|
|
224
|
-
style[systemFgStrongToken] = value;
|
|
225
|
-
}
|
|
226
|
-
// system.color.brand.fg.selected -> brand.primary.700 (for primary only)
|
|
227
|
-
if (newBrandColor === 'primary') {
|
|
228
|
-
// @ts-ignore
|
|
229
|
-
const selectedToken = canvas_tokens_web_1.system.color.brand.fg.selected;
|
|
230
|
-
if (selectedToken) {
|
|
231
|
-
// @ts-ignore
|
|
232
|
-
style[selectedToken] = value;
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
// system.color.brand.focus.critical & system.color.brand.border.critical -> brand.critical.500 (palette.error.dark)
|
|
236
|
-
if (newBrandColor === 'critical') {
|
|
237
|
-
// @ts-ignore
|
|
238
|
-
const focusCriticalToken = canvas_tokens_web_1.system.color.brand.focus.critical;
|
|
239
|
-
if (focusCriticalToken) {
|
|
240
|
-
// @ts-ignore
|
|
241
|
-
style[focusCriticalToken] = value;
|
|
242
|
-
}
|
|
243
|
-
// @ts-ignore
|
|
244
|
-
const borderCriticalToken = canvas_tokens_web_1.system.color.brand.border.critical;
|
|
245
|
-
if (borderCriticalToken) {
|
|
246
|
-
// @ts-ignore
|
|
247
|
-
style[borderCriticalToken] = value;
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
// system.color.brand.focus.caution.outer & system.color.brand.border.caution -> brand.caution.500 (palette.alert.dark)
|
|
251
|
-
if (newBrandColor === 'caution') {
|
|
252
|
-
// @ts-ignore
|
|
253
|
-
const focusCautionOuterToken = (_c = canvas_tokens_web_1.system.color.brand.focus.caution) === null || _c === void 0 ? void 0 : _c.outer;
|
|
254
|
-
if (focusCautionOuterToken) {
|
|
255
|
-
// @ts-ignore
|
|
256
|
-
style[focusCautionOuterToken] = value;
|
|
257
|
-
}
|
|
258
|
-
// @ts-ignore
|
|
259
|
-
const borderCautionToken = canvas_tokens_web_1.system.color.brand.border.caution;
|
|
260
|
-
if (borderCautionToken) {
|
|
261
|
-
// @ts-ignore
|
|
262
|
-
style[borderCautionToken] = value;
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
else if (key === 'lighter') {
|
|
267
|
-
// system.color.brand.surface.{color}.strong -> brand.{color}.A50
|
|
268
|
-
// Note: A50 tokens are different from regular 50 tokens but we'll forward the lighter value
|
|
269
|
-
// @ts-ignore
|
|
270
|
-
const surfaceStrongToken = (_d = canvas_tokens_web_1.system.color.brand.surface[newBrandColor]) === null || _d === void 0 ? void 0 : _d.strong;
|
|
271
|
-
if (surfaceStrongToken) {
|
|
272
|
-
// @ts-ignore
|
|
273
|
-
style[surfaceStrongToken] = value;
|
|
274
|
-
}
|
|
275
|
-
// system.color.brand.surface.selected -> brand.primary.A50 (for primary only)
|
|
276
|
-
if (newBrandColor === 'primary') {
|
|
277
|
-
// @ts-ignore
|
|
278
|
-
const selectedSurfaceToken = canvas_tokens_web_1.system.color.brand.surface.selected;
|
|
279
|
-
if (selectedSurfaceToken) {
|
|
280
|
-
// @ts-ignore
|
|
281
|
-
style[selectedSurfaceToken] = value;
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
else if (key === 'lightest') {
|
|
286
|
-
// system.color.brand.surface.{color}.default -> brand.{color}.A25
|
|
287
|
-
// @ts-ignore
|
|
288
|
-
const surfaceDefaultToken = (_e = canvas_tokens_web_1.system.color.brand.surface[newBrandColor]) === null || _e === void 0 ? void 0 : _e.default;
|
|
289
|
-
if (surfaceDefaultToken) {
|
|
290
|
-
// @ts-ignore
|
|
291
|
-
style[surfaceDefaultToken] = value;
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
});
|
|
297
|
-
}
|
|
75
|
+
theme, elemProps, themeScope) => {
|
|
76
|
+
const filledTheme = (0, theming_1.useTheme)((0, theming_1.isNumericalTheme)(theme) ? undefined : theme);
|
|
77
|
+
const resolvedScope = themeScope !== null && themeScope !== void 0 ? themeScope : (0, theming_1.resolveThemingScope)(theme);
|
|
78
|
+
return canvasThemeToCssVars(theme, elemProps, {
|
|
79
|
+
themeScope: resolvedScope,
|
|
80
|
+
filledSemanticTheme: !(0, theming_1.isNumericalTheme)(theme) && resolvedScope === 'full' ? filledTheme : undefined,
|
|
298
81
|
});
|
|
299
|
-
return { ...elemProps, className, style };
|
|
300
82
|
};
|
|
301
83
|
exports.useCanvasThemeToCssVars = useCanvasThemeToCssVars;
|
|
302
|
-
const CanvasProvider = ({ children, theme
|
|
303
|
-
...props }) => {
|
|
84
|
+
const CanvasProvider = ({ children, theme, themeScope, ...props }) => {
|
|
304
85
|
var _a;
|
|
305
|
-
|
|
86
|
+
// Add console warning for unnecessary sanaCanvasProviderTheme usage
|
|
87
|
+
React.useEffect(() => {
|
|
88
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
89
|
+
if (theme === sanaTheme_1.sanaCanvasProviderTheme &&
|
|
90
|
+
typeof document !== 'undefined' &&
|
|
91
|
+
document.documentElement.getAttribute('data-theme') === 'sana-canvas') {
|
|
92
|
+
console.warn('Canvas Kit: You are passing sanaCanvasProviderTheme to CanvasProvider but ' +
|
|
93
|
+
'data-theme="sana-canvas" is already set on <html>. The theme prop is not needed ' +
|
|
94
|
+
'in this case and can be removed. Keep sanaCanvasProviderTheme when you cannot ' +
|
|
95
|
+
'control <html> (embedded apps / microfrontends) so popups still get Sana brand ' +
|
|
96
|
+
'variables. See: ' +
|
|
97
|
+
'https://workday.github.io/canvas-kit/?path=/docs/features-theming-overview--docs');
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}, [theme]);
|
|
101
|
+
// Computed className/style win over consumer props — do not re-spread `props` over them.
|
|
102
|
+
const { className, style, ...elemProps } = (0, exports.useCanvasThemeToCssVars)(theme, props, themeScope);
|
|
306
103
|
const cache = (0, canvas_kit_styling_1.getCache)();
|
|
307
|
-
|
|
308
|
-
|
|
104
|
+
// Read parent context to support nested scoped providers
|
|
105
|
+
const parentBrandStyle = React.useContext(exports.CanvasBrandStyleContext);
|
|
106
|
+
// Popup forwarding only needs CSS custom properties (not consumer layout styles).
|
|
107
|
+
const mergedBrandStyle = React.useMemo(() => {
|
|
108
|
+
const merged = {};
|
|
109
|
+
for (const [key, value] of Object.entries({ ...parentBrandStyle, ...style })) {
|
|
110
|
+
if (key.startsWith('--') && typeof value === 'string') {
|
|
111
|
+
// @ts-ignore - CSS custom property key
|
|
112
|
+
merged[key] = value;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return merged;
|
|
116
|
+
}, [parentBrandStyle, style]);
|
|
117
|
+
const emotionTheme = theme
|
|
118
|
+
? (0, theming_1.isNumericalTheme)(theme)
|
|
119
|
+
? { canvas: theming_1.defaultCanvasTheme }
|
|
120
|
+
: theme
|
|
121
|
+
: undefined;
|
|
122
|
+
const content = ((0, jsx_runtime_1.jsx)("div", { dir: (0, theming_1.isNumericalTheme)(theme)
|
|
123
|
+
? theme.direction || theming_1.defaultCanvasTheme.direction
|
|
124
|
+
: ((_a = theme === null || theme === void 0 ? void 0 : theme.canvas) === null || _a === void 0 ? void 0 : _a.direction) || theming_1.defaultCanvasTheme.direction, className: className, ...elemProps, style: style, children: children }));
|
|
125
|
+
const wrappedContent = ((0, jsx_runtime_1.jsx)(exports.CanvasBrandStyleContext.Provider, { value: mergedBrandStyle, children: content }));
|
|
126
|
+
return ((0, jsx_runtime_1.jsx)(react_1.CacheProvider, { value: cache, children: emotionTheme ? ((0, jsx_runtime_1.jsx)(react_1.ThemeProvider, { theme: emotionTheme, children: wrappedContent })) : (wrappedContent) }));
|
|
309
127
|
};
|
|
310
128
|
exports.CanvasProvider = CanvasProvider;
|
|
@@ -4,7 +4,7 @@ exports.EllipsisText = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const canvas_kit_styling_1 = require("@workday/canvas-kit-styling");
|
|
6
6
|
const utils_1 = require("./utils");
|
|
7
|
-
const ellipsisStyles = (0, canvas_kit_styling_1.createStyles)({ name: "
|
|
7
|
+
const ellipsisStyles = (0, canvas_kit_styling_1.createStyles)({ name: "4ehrff", styles: "white-space:nowrap;text-overflow:ellipsis;overflow:hidden;" });
|
|
8
8
|
exports.EllipsisText = (0, utils_1.createComponent)('span')({
|
|
9
9
|
displayName: 'EllipsisText',
|
|
10
10
|
Component({ children, ...elemProps }, ref, Element) {
|
|
@@ -11,5 +11,5 @@ exports.cornerShapeStencil = (0, canvas_kit_styling_1.createStencil)({
|
|
|
11
11
|
vars: {
|
|
12
12
|
shape: '',
|
|
13
13
|
},
|
|
14
|
-
base: { name: "
|
|
14
|
+
base: { name: "297zk6", styles: "box-sizing:border-box;border-radius:var(--shape-corner-shape-ccab68);corner-shape:superellipse(1.1);" }
|
|
15
15
|
}, "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"}
|