@workday/canvas-kit-react 12.0.0-alpha.841-next.0 → 12.0.0-alpha.852-next.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/avatar/lib/Avatar.tsx +1 -0
- package/common/lib/utils/getTranslateFromOrigin.ts +22 -2
- package/dist/commonjs/avatar/lib/Avatar.d.ts.map +1 -1
- package/dist/commonjs/avatar/lib/Avatar.js +1 -1
- package/dist/commonjs/button/lib/BaseButton.d.ts +5 -5
- package/dist/commonjs/button/lib/BaseButton.js +1 -1
- package/dist/commonjs/button/lib/DeleteButton.js +1 -1
- 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 +4 -4
- package/dist/commonjs/checkbox/lib/CheckboxCheck.js +2 -2
- package/dist/commonjs/combobox/lib/hooks/useComboboxInput.d.ts +1 -1
- package/dist/commonjs/common/lib/CanvasProvider.d.ts +6 -6
- package/dist/commonjs/common/lib/utils/getTranslateFromOrigin.d.ts +11 -0
- package/dist/commonjs/common/lib/utils/getTranslateFromOrigin.d.ts.map +1 -1
- package/dist/commonjs/common/lib/utils/getTranslateFromOrigin.js +19 -3
- package/dist/commonjs/icon/lib/SystemIcon.d.ts +2 -1
- package/dist/commonjs/icon/lib/SystemIcon.d.ts.map +1 -1
- package/dist/commonjs/icon/lib/SystemIcon.js +3 -3
- package/dist/commonjs/icon/lib/SystemIconCircle.js +1 -1
- package/dist/commonjs/menu/lib/MenuItem.d.ts +1 -1
- package/dist/commonjs/modal/lib/ModalBody.d.ts +1 -0
- package/dist/commonjs/modal/lib/ModalBody.d.ts.map +1 -1
- package/dist/commonjs/modal/lib/ModalBody.js +8 -12
- package/dist/commonjs/modal/lib/ModalCard.d.ts +1 -0
- package/dist/commonjs/modal/lib/ModalCard.d.ts.map +1 -1
- package/dist/commonjs/modal/lib/ModalCard.js +8 -14
- package/dist/commonjs/modal/lib/ModalHeading.d.ts +1 -0
- package/dist/commonjs/modal/lib/ModalHeading.d.ts.map +1 -1
- package/dist/commonjs/modal/lib/ModalHeading.js +8 -12
- package/dist/commonjs/modal/lib/ModalOverflowOverlay.d.ts +1 -0
- package/dist/commonjs/modal/lib/ModalOverflowOverlay.d.ts.map +1 -1
- package/dist/commonjs/modal/lib/ModalOverflowOverlay.js +7 -9
- package/dist/commonjs/modal/lib/ModalOverlay.d.ts +9 -4
- package/dist/commonjs/modal/lib/ModalOverlay.d.ts.map +1 -1
- package/dist/commonjs/modal/lib/ModalOverlay.js +19 -65
- package/dist/commonjs/popup/lib/Popper.js +2 -4
- package/dist/commonjs/popup/lib/PopupBody.d.ts +1 -0
- package/dist/commonjs/popup/lib/PopupBody.d.ts.map +1 -1
- package/dist/commonjs/popup/lib/PopupBody.js +8 -2
- package/dist/commonjs/popup/lib/PopupCard.d.ts +9 -0
- package/dist/commonjs/popup/lib/PopupCard.d.ts.map +1 -1
- package/dist/commonjs/popup/lib/PopupCard.js +28 -41
- package/dist/commonjs/popup/lib/PopupCloseIcon.d.ts +1 -0
- package/dist/commonjs/popup/lib/PopupCloseIcon.d.ts.map +1 -1
- package/dist/commonjs/popup/lib/PopupCloseIcon.js +8 -3
- package/dist/commonjs/popup/lib/PopupHeading.d.ts +1 -0
- package/dist/commonjs/popup/lib/PopupHeading.d.ts.map +1 -1
- package/dist/commonjs/popup/lib/PopupHeading.js +8 -2
- package/dist/commonjs/select/lib/Select.d.ts.map +1 -1
- package/dist/commonjs/select/lib/Select.js +9 -7
- package/dist/commonjs/select/lib/hooks/useSelectInput.d.ts +1 -1
- package/dist/commonjs/tabs/lib/TabsItem.d.ts +1 -1
- package/dist/commonjs/text-input/index.d.ts +0 -1
- package/dist/commonjs/text-input/index.d.ts.map +1 -1
- package/dist/commonjs/text-input/index.js +0 -1
- package/dist/commonjs/toast/lib/Toast.d.ts.map +1 -1
- package/dist/commonjs/toast/lib/Toast.js +7 -2
- package/dist/commonjs/toast/lib/ToastBody.d.ts +1 -0
- package/dist/commonjs/toast/lib/ToastBody.d.ts.map +1 -1
- package/dist/commonjs/toast/lib/ToastBody.js +7 -2
- package/dist/commonjs/toast/lib/ToastCloseIcon.d.ts +1 -0
- package/dist/commonjs/toast/lib/ToastCloseIcon.d.ts.map +1 -1
- package/dist/commonjs/toast/lib/ToastCloseIcon.js +7 -2
- package/dist/commonjs/toast/lib/ToastIcon.d.ts +1 -0
- package/dist/commonjs/toast/lib/ToastIcon.d.ts.map +1 -1
- package/dist/commonjs/toast/lib/ToastIcon.js +7 -2
- package/dist/commonjs/toast/lib/ToastMessage.d.ts +1 -0
- package/dist/commonjs/toast/lib/ToastMessage.d.ts.map +1 -1
- package/dist/commonjs/toast/lib/ToastMessage.js +8 -2
- package/dist/es6/avatar/lib/Avatar.d.ts.map +1 -1
- package/dist/es6/avatar/lib/Avatar.js +1 -1
- package/dist/es6/button/lib/BaseButton.d.ts +5 -5
- package/dist/es6/button/lib/BaseButton.js +1 -1
- package/dist/es6/button/lib/DeleteButton.js +1 -1
- 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 +4 -4
- package/dist/es6/checkbox/lib/CheckboxCheck.js +2 -2
- package/dist/es6/combobox/lib/hooks/useComboboxInput.d.ts +1 -1
- package/dist/es6/common/lib/CanvasProvider.d.ts +6 -6
- package/dist/es6/common/lib/utils/getTranslateFromOrigin.d.ts +11 -0
- package/dist/es6/common/lib/utils/getTranslateFromOrigin.d.ts.map +1 -1
- package/dist/es6/common/lib/utils/getTranslateFromOrigin.js +17 -2
- package/dist/es6/icon/lib/SystemIcon.d.ts +2 -1
- package/dist/es6/icon/lib/SystemIcon.d.ts.map +1 -1
- package/dist/es6/icon/lib/SystemIcon.js +3 -3
- package/dist/es6/icon/lib/SystemIconCircle.js +1 -1
- package/dist/es6/menu/lib/MenuItem.d.ts +1 -1
- package/dist/es6/modal/lib/ModalBody.d.ts +1 -0
- package/dist/es6/modal/lib/ModalBody.d.ts.map +1 -1
- package/dist/es6/modal/lib/ModalBody.js +8 -12
- package/dist/es6/modal/lib/ModalCard.d.ts +1 -0
- package/dist/es6/modal/lib/ModalCard.d.ts.map +1 -1
- package/dist/es6/modal/lib/ModalCard.js +8 -14
- package/dist/es6/modal/lib/ModalHeading.d.ts +1 -0
- package/dist/es6/modal/lib/ModalHeading.d.ts.map +1 -1
- package/dist/es6/modal/lib/ModalHeading.js +8 -12
- package/dist/es6/modal/lib/ModalOverflowOverlay.d.ts +1 -0
- package/dist/es6/modal/lib/ModalOverflowOverlay.d.ts.map +1 -1
- package/dist/es6/modal/lib/ModalOverflowOverlay.js +6 -5
- package/dist/es6/modal/lib/ModalOverlay.d.ts +9 -4
- package/dist/es6/modal/lib/ModalOverlay.d.ts.map +1 -1
- package/dist/es6/modal/lib/ModalOverlay.js +20 -66
- package/dist/es6/popup/lib/Popper.js +2 -4
- package/dist/es6/popup/lib/PopupBody.d.ts +1 -0
- package/dist/es6/popup/lib/PopupBody.d.ts.map +1 -1
- package/dist/es6/popup/lib/PopupBody.js +7 -1
- package/dist/es6/popup/lib/PopupCard.d.ts +9 -0
- package/dist/es6/popup/lib/PopupCard.d.ts.map +1 -1
- package/dist/es6/popup/lib/PopupCard.js +30 -43
- package/dist/es6/popup/lib/PopupCloseIcon.d.ts +1 -0
- package/dist/es6/popup/lib/PopupCloseIcon.d.ts.map +1 -1
- package/dist/es6/popup/lib/PopupCloseIcon.js +7 -2
- package/dist/es6/popup/lib/PopupHeading.d.ts +1 -0
- package/dist/es6/popup/lib/PopupHeading.d.ts.map +1 -1
- package/dist/es6/popup/lib/PopupHeading.js +7 -1
- package/dist/es6/select/lib/Select.d.ts.map +1 -1
- package/dist/es6/select/lib/Select.js +9 -7
- package/dist/es6/select/lib/hooks/useSelectInput.d.ts +1 -1
- package/dist/es6/tabs/lib/TabsItem.d.ts +1 -1
- package/dist/es6/text-input/index.d.ts +0 -1
- package/dist/es6/text-input/index.d.ts.map +1 -1
- package/dist/es6/text-input/index.js +0 -1
- package/dist/es6/toast/lib/Toast.d.ts.map +1 -1
- package/dist/es6/toast/lib/Toast.js +7 -2
- package/dist/es6/toast/lib/ToastBody.d.ts +1 -0
- package/dist/es6/toast/lib/ToastBody.d.ts.map +1 -1
- package/dist/es6/toast/lib/ToastBody.js +7 -2
- package/dist/es6/toast/lib/ToastCloseIcon.d.ts +1 -0
- package/dist/es6/toast/lib/ToastCloseIcon.d.ts.map +1 -1
- package/dist/es6/toast/lib/ToastCloseIcon.js +6 -1
- package/dist/es6/toast/lib/ToastIcon.d.ts +1 -0
- package/dist/es6/toast/lib/ToastIcon.d.ts.map +1 -1
- package/dist/es6/toast/lib/ToastIcon.js +6 -1
- package/dist/es6/toast/lib/ToastMessage.d.ts +1 -0
- package/dist/es6/toast/lib/ToastMessage.d.ts.map +1 -1
- package/dist/es6/toast/lib/ToastMessage.js +7 -1
- package/icon/lib/SystemIcon.tsx +2 -1
- package/modal/lib/ModalBody.tsx +11 -16
- package/modal/lib/ModalCard.tsx +16 -18
- package/modal/lib/ModalHeading.tsx +11 -16
- package/modal/lib/ModalOverflowOverlay.tsx +9 -5
- package/modal/lib/ModalOverlay.tsx +57 -65
- package/package.json +4 -4
- package/popup/lib/Popper.tsx +2 -4
- package/popup/lib/PopupBody.tsx +11 -1
- package/popup/lib/PopupCard.tsx +64 -63
- package/popup/lib/PopupCloseIcon.tsx +12 -5
- package/popup/lib/PopupHeading.tsx +11 -1
- package/select/lib/Select.tsx +8 -6
- package/text-input/index.ts +0 -1
- package/toast/lib/Toast.tsx +14 -7
- package/toast/lib/ToastBody.tsx +16 -12
- package/toast/lib/ToastCloseIcon.tsx +14 -1
- package/toast/lib/ToastIcon.tsx +10 -11
- package/toast/lib/ToastMessage.tsx +12 -3
- package/dist/commonjs/text-input/lib/InputIconContainer.d.ts +0 -18
- package/dist/commonjs/text-input/lib/InputIconContainer.d.ts.map +0 -1
- package/dist/commonjs/text-input/lib/InputIconContainer.js +0 -46
- package/dist/es6/text-input/lib/InputIconContainer.d.ts +0 -18
- package/dist/es6/text-input/lib/InputIconContainer.d.ts.map +0 -1
- package/dist/es6/text-input/lib/InputIconContainer.js +0 -20
- package/text-input/lib/InputIconContainer.tsx +0 -39
|
@@ -86,7 +86,7 @@ export declare const useSelectInput: import("@workday/canvas-kit-react/common").
|
|
|
86
86
|
readonly onClick: (event: React.MouseEvent<Element, MouseEvent>) => void;
|
|
87
87
|
readonly value: string | undefined;
|
|
88
88
|
readonly role: "combobox";
|
|
89
|
-
readonly 'aria-haspopup': boolean | "
|
|
89
|
+
readonly 'aria-haspopup': boolean | "grid" | "true" | "listbox" | "menu" | "false" | "dialog" | "tree" | undefined;
|
|
90
90
|
readonly 'aria-expanded': boolean;
|
|
91
91
|
readonly 'aria-autocomplete': "list";
|
|
92
92
|
readonly 'aria-controls': `${string}-list`;
|
|
@@ -53,7 +53,7 @@ export interface TabsItemProps extends ExtractProps<typeof Box, never>, Partial<
|
|
|
53
53
|
*/
|
|
54
54
|
tabIndex?: number;
|
|
55
55
|
}
|
|
56
|
-
export declare const StyledTabItem: import("@emotion/styled").StyledComponent<import("@workday/canvas-kit-react/layout").BackgroundStyleProps & import("../../layout/lib/utils/border/color").BorderColorStyleProps & import("../../layout/lib/utils/border/lineStyle").BorderLineStyleProps & import("../../layout/lib/utils/border/radius").BorderRadiusStyleProps & import("../../layout/lib/utils/border/shorthand").BorderShorthandStyleProps & import("../../layout/lib/utils/border/width").BorderWidthStyleProps & import("@workday/canvas-kit-react/layout").ColorStyleProps & import("@workday/canvas-kit-react/layout").DepthStyleProps & import("@workday/canvas-kit-react/layout").FlexItemStyleProps & import("@workday/canvas-kit-react/layout").GridItemStyleProps & import("@workday/canvas-kit-react/layout").LayoutStyleProps & import("@workday/canvas-kit-react/layout").OtherStyleProps & import("@workday/canvas-kit-react/layout").PositionStyleProps & import("@workday/canvas-kit-react/layout").SpaceStyleProps & import("@workday/canvas-kit-react/layout").TextStyleProps & import("@workday/canvas-kit-styling").CSProps & Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "left" | "right" | "top" | "bottom" | "
|
|
56
|
+
export declare const StyledTabItem: import("@emotion/styled").StyledComponent<import("@workday/canvas-kit-react/layout").BackgroundStyleProps & import("../../layout/lib/utils/border/color").BorderColorStyleProps & import("../../layout/lib/utils/border/lineStyle").BorderLineStyleProps & import("../../layout/lib/utils/border/radius").BorderRadiusStyleProps & import("../../layout/lib/utils/border/shorthand").BorderShorthandStyleProps & import("../../layout/lib/utils/border/width").BorderWidthStyleProps & import("@workday/canvas-kit-react/layout").ColorStyleProps & import("@workday/canvas-kit-react/layout").DepthStyleProps & import("@workday/canvas-kit-react/layout").FlexItemStyleProps & import("@workday/canvas-kit-react/layout").GridItemStyleProps & import("@workday/canvas-kit-react/layout").LayoutStyleProps & import("@workday/canvas-kit-react/layout").OtherStyleProps & import("@workday/canvas-kit-react/layout").PositionStyleProps & import("@workday/canvas-kit-react/layout").SpaceStyleProps & import("@workday/canvas-kit-react/layout").TextStyleProps & import("@workday/canvas-kit-styling").CSProps & Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "left" | "right" | "top" | "bottom" | "alignSelf" | "appearance" | "backgroundAttachment" | "backgroundColor" | "backgroundImage" | "backgroundRepeat" | "backgroundSize" | "borderBottomColor" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderBottomStyle" | "borderBottomWidth" | "borderCollapse" | "borderInlineEndColor" | "borderInlineEndStyle" | "borderInlineEndWidth" | "borderInlineStartColor" | "borderInlineStartStyle" | "borderInlineStartWidth" | "borderLeftColor" | "borderLeftStyle" | "borderLeftWidth" | "borderRightColor" | "borderRightStyle" | "borderRightWidth" | "borderSpacing" | "borderTopColor" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderTopStyle" | "borderTopWidth" | "boxShadow" | "boxSizing" | "color" | "content" | "cursor" | "display" | "flexBasis" | "flexGrow" | "flexShrink" | "float" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "gridColumnEnd" | "gridColumnStart" | "gridRowEnd" | "gridRowStart" | "height" | "inset" | "insetInlineEnd" | "insetInlineStart" | "justifySelf" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "objectFit" | "objectPosition" | "opacity" | "order" | "outlineOffset" | "overflowWrap" | "overflowX" | "overflowY" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "pointerEvents" | "position" | "resize" | "scrollMargin" | "scrollMarginBottom" | "scrollMarginInlineEnd" | "scrollMarginInlineStart" | "scrollMarginTop" | "scrollPadding" | "scrollPaddingBottom" | "scrollPaddingInlineEnd" | "scrollPaddingInlineStart" | "scrollPaddingTop" | "scrollSnapAlign" | "scrollSnapStop" | "scrollSnapType" | "textAlign" | "textOverflow" | "textShadow" | "textTransform" | "transform" | "userSelect" | "verticalAlign" | "visibility" | "whiteSpace" | "width" | "wordBreak" | "zIndex" | "animation" | "background" | "backgroundPosition" | "border" | "borderBottom" | "borderColor" | "borderInlineEnd" | "borderInlineStart" | "borderLeft" | "borderRadius" | "borderRight" | "borderStyle" | "borderTop" | "borderWidth" | "flex" | "gridArea" | "gridColumn" | "gridRow" | "listStyle" | "margin" | "outline" | "overflow" | "padding" | "placeSelf" | "textDecoration" | "transition" | "fill" | "stroke" | "cs" | "as" | "depth" | "marginX" | "marginY" | "paddingX" | "paddingY"> & {
|
|
57
57
|
ref?: React.Ref<HTMLButtonElement> | undefined;
|
|
58
58
|
} & {
|
|
59
59
|
theme?: import("@emotion/react").Theme | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../text-input/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../text-input/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAC,UAAU,EAAE,kBAAkB,EAAC,MAAM,kBAAkB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../../../../toast/lib/Toast.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAkB,YAAY,EAAC,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../../../../toast/lib/Toast.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAkB,YAAY,EAAC,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAC,KAAK,EAAC,MAAM,iCAAiC,CAAC;AAYtD,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,YAAY,CAAC,OAAO,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,OAAO,CAAC;CAAG;AA4C5F;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,KAAK;;;;;;;;;;IAId;;;;;;;;;OASG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;;OAGG;;;;;;;;IAEH;;OAEG;;CAYL,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { createContainer } from '@workday/canvas-kit-react/common';
|
|
3
|
-
import { Flex } from '@workday/canvas-kit-react/layout';
|
|
4
3
|
import { Popup } from '@workday/canvas-kit-react/popup';
|
|
5
4
|
import { ToastCloseIcon } from './ToastCloseIcon';
|
|
6
5
|
import { ToastIcon } from './ToastIcon';
|
|
@@ -8,6 +7,9 @@ import { ToastMessage } from './ToastMessage';
|
|
|
8
7
|
import { ToastLink } from './ToastLink';
|
|
9
8
|
import { ToastBody } from './ToastBody';
|
|
10
9
|
import { useToastModel } from './hooks/useToastModel';
|
|
10
|
+
import { calc, createStencil } from '@workday/canvas-kit-styling';
|
|
11
|
+
import { system } from '@workday/canvas-tokens-web';
|
|
12
|
+
import { mergeStyles } from '@workday/canvas-kit-react/layout';
|
|
11
13
|
/**
|
|
12
14
|
* The function helps set the correct aria attributes based on the mode
|
|
13
15
|
* @param mode Defines what aria attributes will be added to the main container
|
|
@@ -39,6 +41,9 @@ const getAriaAttributes = (mode, id) => {
|
|
|
39
41
|
}
|
|
40
42
|
}
|
|
41
43
|
};
|
|
44
|
+
const toastStencil = createStencil({
|
|
45
|
+
base: { name: "cdbf88", styles: "box-sizing:border-box;display:flex;flex-direction:row;width:calc(calc(var(--cnvs-sys-space-x20) * 4) + var(--cnvs-sys-space-x10));padding:var(--cnvs-sys-space-zero);gap:var(--cnvs-sys-space-x1);" }
|
|
46
|
+
}, "toast-55513d");
|
|
42
47
|
/**
|
|
43
48
|
* Toast is a compound component that has different modes based on its contents. The modes add the proper aria attributes for accessibility
|
|
44
49
|
*
|
|
@@ -91,5 +96,5 @@ export const Toast = createContainer('div')({
|
|
|
91
96
|
Link: ToastLink,
|
|
92
97
|
},
|
|
93
98
|
})(({ children, ...elemProps }, _, model) => {
|
|
94
|
-
return (React.createElement(Popup.Card, Object.assign({
|
|
99
|
+
return (React.createElement(Popup.Card, Object.assign({}, getAriaAttributes(model.state.mode, model.state.id), mergeStyles(elemProps, toastStencil())), children));
|
|
95
100
|
});
|
|
@@ -2,5 +2,6 @@ import { ExtractProps } from '@workday/canvas-kit-react/common';
|
|
|
2
2
|
import { Popup } from '@workday/canvas-kit-react/popup';
|
|
3
3
|
export interface ToastBodyProps extends ExtractProps<typeof Popup.Body> {
|
|
4
4
|
}
|
|
5
|
+
export declare const toastBodyStencil: import("@workday/canvas-kit-styling").Stencil<import("@workday/canvas-kit-styling").StencilModifierConfig<{}, never>, {}, never, never>;
|
|
5
6
|
export declare const ToastBody: import("@workday/canvas-kit-react/common").ElementComponent<"div", ToastBodyProps>;
|
|
6
7
|
//# sourceMappingURL=ToastBody.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToastBody.d.ts","sourceRoot":"","sources":["../../../../toast/lib/ToastBody.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAkB,YAAY,EAAC,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAC,KAAK,EAAC,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"ToastBody.d.ts","sourceRoot":"","sources":["../../../../toast/lib/ToastBody.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAkB,YAAY,EAAC,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAC,KAAK,EAAC,MAAM,iCAAiC,CAAC;AAKtD,MAAM,WAAW,cAAe,SAAQ,YAAY,CAAC,OAAO,KAAK,CAAC,IAAI,CAAC;CAAG;AAE1E,eAAO,MAAM,gBAAgB,yIAU3B,CAAC;AAEH,eAAO,MAAM,SAAS,oFASpB,CAAC"}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { createComponent } from '@workday/canvas-kit-react/common';
|
|
3
|
-
import { Flex } from '@workday/canvas-kit-react/layout';
|
|
3
|
+
import { Flex, mergeStyles } from '@workday/canvas-kit-react/layout';
|
|
4
|
+
import { createStencil } from '@workday/canvas-kit-styling';
|
|
5
|
+
import { system } from '@workday/canvas-tokens-web';
|
|
6
|
+
export const toastBodyStencil = createStencil({
|
|
7
|
+
base: { name: "758c52", styles: "box-sizing:border-box;align-items:flex-start;flex-direction:column;justify-content:center;padding-top:var(--cnvs-sys-space-x4);padding-bottom:var(--cnvs-sys-space-x4);flex-grow:1;gap:var(--cnvs-sys-space-x1);" }
|
|
8
|
+
}, "toast-body-7d81ac");
|
|
4
9
|
export const ToastBody = createComponent('div')({
|
|
5
10
|
displayName: 'Toast.Body',
|
|
6
11
|
Component: ({ children, ...elemProps }, ref, Element) => {
|
|
7
|
-
return (React.createElement(Flex, Object.assign({
|
|
12
|
+
return (React.createElement(Flex, Object.assign({ ref: ref, as: Element }, mergeStyles(elemProps, toastBodyStencil())), children));
|
|
8
13
|
},
|
|
9
14
|
});
|
|
@@ -2,5 +2,6 @@ import { ExtractProps } from '@workday/canvas-kit-react/common';
|
|
|
2
2
|
import { Popup } from '@workday/canvas-kit-react/popup';
|
|
3
3
|
export interface ToastCloseIconProps extends ExtractProps<typeof Popup.CloseIcon, never> {
|
|
4
4
|
}
|
|
5
|
+
export declare const toastCloseIconStencil: import("@workday/canvas-kit-styling").Stencil<import("@workday/canvas-kit-styling").StencilModifierConfig<{}, never>, {}, never, never>;
|
|
5
6
|
export declare const ToastCloseIcon: import("@workday/canvas-kit-react/common").ElementComponent<"button", ToastCloseIconProps>;
|
|
6
7
|
//# sourceMappingURL=ToastCloseIcon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToastCloseIcon.d.ts","sourceRoot":"","sources":["../../../../toast/lib/ToastCloseIcon.tsx"],"names":[],"mappings":"AACA,OAAO,EAAkB,YAAY,EAAC,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAC,KAAK,EAAC,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"ToastCloseIcon.d.ts","sourceRoot":"","sources":["../../../../toast/lib/ToastCloseIcon.tsx"],"names":[],"mappings":"AACA,OAAO,EAAkB,YAAY,EAAC,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAC,KAAK,EAAC,MAAM,iCAAiC,CAAC;AAItD,MAAM,WAAW,mBAAoB,SAAQ,YAAY,CAAC,OAAO,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC;CAAG;AAE3F,eAAO,MAAM,qBAAqB,yIAIhC,CAAC;AAEH,eAAO,MAAM,cAAc,4FAYzB,CAAC"}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { createComponent } from '@workday/canvas-kit-react/common';
|
|
3
3
|
import { Popup } from '@workday/canvas-kit-react/popup';
|
|
4
|
+
import { createStencil } from '@workday/canvas-kit-styling';
|
|
5
|
+
import { mergeStyles } from '@workday/canvas-kit-react/layout';
|
|
6
|
+
export const toastCloseIconStencil = createStencil({
|
|
7
|
+
base: { name: "721e6c", styles: "box-sizing:border-box;position:relative;" }
|
|
8
|
+
}, "toast-close-icon-be7e9f");
|
|
4
9
|
export const ToastCloseIcon = createComponent('button')({
|
|
5
10
|
displayName: 'Toast.CloseIcon',
|
|
6
11
|
Component: (elemProps, ref, Element) => {
|
|
7
|
-
return (React.createElement(Popup.CloseIcon, Object.assign({ as: Element, ref: ref, size: "small"
|
|
12
|
+
return (React.createElement(Popup.CloseIcon, Object.assign({ as: Element, ref: ref, size: "small" }, mergeStyles(elemProps, toastCloseIconStencil()))));
|
|
8
13
|
},
|
|
9
14
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { SystemIconProps } from '@workday/canvas-kit-react/icon';
|
|
2
2
|
export interface ToastIconProps extends Omit<SystemIconProps, 'colorHover'> {
|
|
3
3
|
}
|
|
4
|
+
export declare const toastIconStencil: import("@workday/canvas-kit-styling").Stencil<import("@workday/canvas-kit-styling").StencilModifierConfig<{}, never>, {}, never, never>;
|
|
4
5
|
export declare const ToastIcon: import("@workday/canvas-kit-react/common").ElementComponent<"div", ToastIconProps>;
|
|
5
6
|
//# sourceMappingURL=ToastIcon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToastIcon.d.ts","sourceRoot":"","sources":["../../../../toast/lib/ToastIcon.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAa,eAAe,EAAC,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"ToastIcon.d.ts","sourceRoot":"","sources":["../../../../toast/lib/ToastIcon.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAa,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAI3E,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,eAAe,EAAE,YAAY,CAAC;CAAG;AAE9E,eAAO,MAAM,gBAAgB,yIAK3B,CAAC;AAEH,eAAO,MAAM,SAAS,oFAKpB,CAAC"}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { createComponent } from '@workday/canvas-kit-react/common';
|
|
3
3
|
import { SystemIcon } from '@workday/canvas-kit-react/icon';
|
|
4
|
+
import { createStencil, handleCsProp } from '@workday/canvas-kit-styling';
|
|
5
|
+
import { system } from '@workday/canvas-tokens-web';
|
|
6
|
+
export const toastIconStencil = createStencil({
|
|
7
|
+
base: { name: "78413e", styles: "box-sizing:border-box;align-self:start;margin:var(--cnvs-sys-space-x4) var(--cnvs-sys-space-x3);" }
|
|
8
|
+
}, "toast-icon-4b0701");
|
|
4
9
|
export const ToastIcon = createComponent('div')({
|
|
5
10
|
displayName: 'Toast.Icon',
|
|
6
11
|
Component: (elemProps, ref, Element) => {
|
|
7
|
-
return
|
|
12
|
+
return React.createElement(SystemIcon, Object.assign({ ref: ref, as: Element }, handleCsProp(elemProps, toastIconStencil())));
|
|
8
13
|
},
|
|
9
14
|
});
|
|
@@ -2,6 +2,7 @@ import { ExtractProps } from '@workday/canvas-kit-react/common';
|
|
|
2
2
|
import { Subtext } from '@workday/canvas-kit-react/text';
|
|
3
3
|
export interface ToastMessageProps extends Omit<ExtractProps<typeof Subtext>, 'size'> {
|
|
4
4
|
}
|
|
5
|
+
export declare const toastMessageStencil: import("@workday/canvas-kit-styling").Stencil<import("@workday/canvas-kit-styling").StencilModifierConfig<{}, never>, {}, never, never>;
|
|
5
6
|
export declare const ToastMessage: import("@workday/canvas-kit-react/common").ElementComponentM<"p", ToastMessageProps, {
|
|
6
7
|
state: {
|
|
7
8
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToastMessage.d.ts","sourceRoot":"","sources":["../../../../toast/lib/ToastMessage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAqB,YAAY,EAAC,MAAM,kCAAkC,CAAC;AAElF,OAAO,EAAC,OAAO,EAAC,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"ToastMessage.d.ts","sourceRoot":"","sources":["../../../../toast/lib/ToastMessage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAqB,YAAY,EAAC,MAAM,kCAAkC,CAAC;AAElF,OAAO,EAAC,OAAO,EAAC,MAAM,gCAAgC,CAAC;AAKvD,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,YAAY,CAAC,OAAO,OAAO,CAAC,EAAE,MAAM,CAAC;CAAG;AAExF,eAAO,MAAM,mBAAmB,yIAM9B,CAAC;AAEH,eAAO,MAAM,YAAY;;;;;;EAavB,CAAC"}
|
|
@@ -2,8 +2,14 @@ import React from 'react';
|
|
|
2
2
|
import { createSubcomponent } from '@workday/canvas-kit-react/common';
|
|
3
3
|
import { useToastModel } from './hooks/useToastModel';
|
|
4
4
|
import { Subtext } from '@workday/canvas-kit-react/text';
|
|
5
|
+
import { createStencil } from '@workday/canvas-kit-styling';
|
|
6
|
+
import { mergeStyles } from '@workday/canvas-kit-react/layout';
|
|
7
|
+
import { system } from '@workday/canvas-tokens-web';
|
|
8
|
+
export const toastMessageStencil = createStencil({
|
|
9
|
+
base: { name: "d80f47", styles: "box-sizing:border-box;word-break:break-word;margin-block-start:var(--cnvs-sys-space-zero);margin-block-end:var(--cnvs-sys-space-zero);" }
|
|
10
|
+
}, "toast-message-759382");
|
|
5
11
|
export const ToastMessage = createSubcomponent('p')({
|
|
6
12
|
modelHook: useToastModel,
|
|
7
13
|
})(({ children, ...elemProps }, Element, model) => {
|
|
8
|
-
return (React.createElement(Subtext, Object.assign({ size: "large",
|
|
14
|
+
return (React.createElement(Subtext, Object.assign({ size: "large", id: model.state.id, as: Element }, mergeStyles(elemProps, toastMessageStencil())), children));
|
|
9
15
|
});
|
package/icon/lib/SystemIcon.tsx
CHANGED
|
@@ -49,7 +49,8 @@ export interface SystemIconStyles {
|
|
|
49
49
|
/**
|
|
50
50
|
* The hover color of the SystemIcon. This defines `accentHover` and `fillHover`. `colorHover` may be overwritten by `accentHover` and `fillHover`.
|
|
51
51
|
* @default base.licorice200
|
|
52
|
-
* @deprecated `colorHover` is deprecated and will be removed in a future version.
|
|
52
|
+
* @deprecated `colorHover` is deprecated and will be removed in a future version. We have removed the default hover styles on SystemIcon. Please
|
|
53
|
+
* use the following instead in your style overrides:
|
|
53
54
|
* ```tsx
|
|
54
55
|
* '&:hover': {
|
|
55
56
|
* [systemIconStencil.vars.color]: desiredColorHoverColor
|
package/modal/lib/ModalBody.tsx
CHANGED
|
@@ -1,32 +1,27 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
createSubcomponent,
|
|
5
|
-
ExtractProps,
|
|
6
|
-
getTheme,
|
|
7
|
-
styled,
|
|
8
|
-
StyledType,
|
|
9
|
-
} from '@workday/canvas-kit-react/common';
|
|
3
|
+
import {createSubcomponent, ExtractProps} from '@workday/canvas-kit-react/common';
|
|
10
4
|
import {Popup} from '@workday/canvas-kit-react/popup';
|
|
11
|
-
import {space} from '@workday/canvas-kit-react/tokens';
|
|
12
5
|
|
|
13
6
|
import {useModalModel} from './hooks';
|
|
7
|
+
import {createStencil} from '@workday/canvas-kit-styling';
|
|
8
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
9
|
+
import {mergeStyles} from '@workday/canvas-kit-react/layout';
|
|
14
10
|
|
|
15
11
|
export interface ModalBodyProps extends ExtractProps<typeof Popup.Body, never> {}
|
|
16
12
|
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
padding: `${space.xxxs} ${space.xxs} ${space.xxs} ${space.xxs}`,
|
|
13
|
+
export const modalBodyStencil = createStencil({
|
|
14
|
+
base: {
|
|
15
|
+
'@media screen and (max-width: 768px)': {
|
|
16
|
+
marginBlockEnd: system.space.zero,
|
|
17
|
+
padding: `${system.space.x1} ${system.space.x2} ${system.space.x2}`,
|
|
23
18
|
},
|
|
24
|
-
}
|
|
19
|
+
},
|
|
25
20
|
});
|
|
26
21
|
|
|
27
22
|
export const ModalBody = createSubcomponent('div')({
|
|
28
23
|
displayName: 'Modal.Body',
|
|
29
24
|
modelHook: useModalModel,
|
|
30
25
|
})<ModalBodyProps>((elemProps, Element) => {
|
|
31
|
-
return <
|
|
26
|
+
return <Popup.Body as={Element} {...mergeStyles(elemProps, modalBodyStencil())} />;
|
|
32
27
|
});
|
package/modal/lib/ModalCard.tsx
CHANGED
|
@@ -1,29 +1,27 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
createSubcomponent,
|
|
5
|
-
ExtractProps,
|
|
6
|
-
StyledType,
|
|
7
|
-
styled,
|
|
8
|
-
getTheme,
|
|
9
|
-
} from '@workday/canvas-kit-react/common';
|
|
10
|
-
import {space} from '@workday/canvas-kit-react/tokens';
|
|
3
|
+
import {createSubcomponent, ExtractProps} from '@workday/canvas-kit-react/common';
|
|
11
4
|
import {Popup} from '@workday/canvas-kit-react/popup';
|
|
12
5
|
|
|
13
6
|
import {useModalCard, useModalModel} from './hooks';
|
|
7
|
+
import {calc, createStencil} from '@workday/canvas-kit-styling';
|
|
8
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
9
|
+
import {mergeStyles} from '@workday/canvas-kit-react/layout';
|
|
14
10
|
|
|
15
11
|
export interface ModalCardProps extends ExtractProps<typeof Popup.Card, never> {}
|
|
16
12
|
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
13
|
+
export const modalCardStencil = createStencil({
|
|
14
|
+
base: {
|
|
15
|
+
margin: system.space.x10,
|
|
16
|
+
width: calc.add(calc.multiply(system.space.x20, 5), system.space.x10),
|
|
17
|
+
borderWidth: system.space.zero,
|
|
18
|
+
boxShadow: system.depth[6],
|
|
19
|
+
'@media screen and (max-width: 768px)': {
|
|
20
|
+
margin: system.space.x4, // 16px all around margin on smaller screen sizes
|
|
21
|
+
padding: system.space.x4, // brings total padding between edge and content to 24px
|
|
22
|
+
borderRadius: system.space.x6, // 24px border radius on smaller devices.
|
|
25
23
|
},
|
|
26
|
-
}
|
|
24
|
+
},
|
|
27
25
|
});
|
|
28
26
|
|
|
29
27
|
export const ModalCard = createSubcomponent('div')({
|
|
@@ -31,5 +29,5 @@ export const ModalCard = createSubcomponent('div')({
|
|
|
31
29
|
modelHook: useModalModel,
|
|
32
30
|
elemPropsHook: useModalCard,
|
|
33
31
|
})<ModalCardProps>((elemProps, Element) => {
|
|
34
|
-
return <
|
|
32
|
+
return <Popup.Card as={Element} {...mergeStyles(elemProps, modalCardStencil())} />;
|
|
35
33
|
});
|
|
@@ -1,27 +1,22 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
createSubcomponent,
|
|
5
|
-
ExtractProps,
|
|
6
|
-
getTheme,
|
|
7
|
-
styled,
|
|
8
|
-
StyledType,
|
|
9
|
-
} from '@workday/canvas-kit-react/common';
|
|
3
|
+
import {createSubcomponent, ExtractProps} from '@workday/canvas-kit-react/common';
|
|
10
4
|
import {Popup} from '@workday/canvas-kit-react/popup';
|
|
11
|
-
import {space} from '@workday/canvas-kit-react/tokens';
|
|
12
5
|
|
|
13
6
|
import {useModalHeading, useModalModel} from './hooks';
|
|
7
|
+
import {createStencil} from '@workday/canvas-kit-styling';
|
|
8
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
9
|
+
import {mergeStyles} from '@workday/canvas-kit-react/layout';
|
|
14
10
|
|
|
15
11
|
export interface ModalHeadingProps extends ExtractProps<typeof Popup.Heading, never> {}
|
|
16
12
|
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
padding: `${space.xxs} ${space.xxs} ${space.xxxs} ${space.xxs}`,
|
|
13
|
+
export const modalHeadingStencil = createStencil({
|
|
14
|
+
base: {
|
|
15
|
+
'@media screen and (max-width: 768px)': {
|
|
16
|
+
marginBlockEnd: system.space.zero,
|
|
17
|
+
padding: `${system.space.x2} ${system.space.x2} ${system.space.x1}`,
|
|
23
18
|
},
|
|
24
|
-
}
|
|
19
|
+
},
|
|
25
20
|
});
|
|
26
21
|
|
|
27
22
|
export const ModalHeading = createSubcomponent('h2')({
|
|
@@ -29,5 +24,5 @@ export const ModalHeading = createSubcomponent('h2')({
|
|
|
29
24
|
modelHook: useModalModel,
|
|
30
25
|
elemPropsHook: useModalHeading,
|
|
31
26
|
})<ModalHeadingProps>((elemProps, Element) => {
|
|
32
|
-
return <
|
|
27
|
+
return <Popup.Heading as={Element} {...mergeStyles(elemProps, modalHeadingStencil())} />;
|
|
33
28
|
});
|
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
|
-
import {createSubcomponent, ExtractProps
|
|
3
|
+
import {createSubcomponent, ExtractProps} from '@workday/canvas-kit-react/common';
|
|
4
4
|
|
|
5
5
|
import {ModalOverlay} from './ModalOverlay';
|
|
6
|
-
import styled from '@emotion/styled';
|
|
7
6
|
import {useModalModel} from './hooks';
|
|
7
|
+
import {createStencil} from '@workday/canvas-kit-styling';
|
|
8
|
+
import {mergeStyles} from '@workday/canvas-kit-react/layout';
|
|
8
9
|
|
|
9
|
-
const
|
|
10
|
-
|
|
10
|
+
export const modalOverflowOverlayStencil = createStencil({
|
|
11
|
+
base: {
|
|
12
|
+
'& > div': {maxHeight: 'inherit'}, // reset maxHeight of centering div
|
|
13
|
+
overflow: 'hidden auto',
|
|
14
|
+
},
|
|
11
15
|
});
|
|
12
16
|
|
|
13
17
|
export const ModalOverflowOverlay = createSubcomponent('div')({
|
|
14
18
|
displayName: 'Modal.OverflowOverlay',
|
|
15
19
|
modelHook: useModalModel,
|
|
16
20
|
})<ExtractProps<typeof ModalOverlay, never>>((elemProps, Element) => {
|
|
17
|
-
return <
|
|
21
|
+
return <ModalOverlay as={Element} {...mergeStyles(elemProps, modalOverflowOverlayStencil())} />;
|
|
18
22
|
});
|
|
@@ -4,81 +4,62 @@ import ReactDOM from 'react-dom';
|
|
|
4
4
|
import {
|
|
5
5
|
createSubcomponent,
|
|
6
6
|
createElemPropsHook,
|
|
7
|
-
StyledType,
|
|
8
7
|
useWindowSize,
|
|
9
8
|
useForkRef,
|
|
10
|
-
getTheme,
|
|
11
9
|
} from '@workday/canvas-kit-react/common';
|
|
12
10
|
import {usePopupModel, usePopupStack} from '@workday/canvas-kit-react/popup';
|
|
13
|
-
import {
|
|
14
|
-
import styled from '@emotion/styled';
|
|
15
|
-
import {Box, BoxProps} from '@workday/canvas-kit-react/layout';
|
|
11
|
+
import {Box, BoxProps, mergeStyles} from '@workday/canvas-kit-react/layout';
|
|
16
12
|
import {useModalModel} from './hooks';
|
|
13
|
+
import {createStencil, cssVar, keyframes} from '@workday/canvas-kit-styling';
|
|
14
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
17
15
|
|
|
18
16
|
export interface ModalOverlayProps extends BoxProps {}
|
|
19
17
|
|
|
20
|
-
const fadeIn = keyframes
|
|
21
|
-
|
|
22
|
-
background: none
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
background:
|
|
26
|
-
}
|
|
27
|
-
|
|
18
|
+
const fadeIn = keyframes({
|
|
19
|
+
'0%': {
|
|
20
|
+
background: 'none',
|
|
21
|
+
},
|
|
22
|
+
'100%': {
|
|
23
|
+
background: cssVar(system.color.bg.overlay),
|
|
24
|
+
},
|
|
25
|
+
});
|
|
28
26
|
|
|
29
|
-
const
|
|
30
|
-
{
|
|
27
|
+
export const modalOverlayContainerStencil = createStencil({
|
|
28
|
+
vars: {
|
|
29
|
+
containerCenter: '',
|
|
30
|
+
},
|
|
31
|
+
base: ({containerCenter}) => ({
|
|
31
32
|
position: 'fixed',
|
|
32
|
-
top:
|
|
33
|
-
left:
|
|
33
|
+
top: system.space.zero,
|
|
34
|
+
left: system.space.zero,
|
|
34
35
|
width: '100vw',
|
|
35
36
|
height: '100vh',
|
|
36
|
-
background:
|
|
37
|
-
animationName: `${fadeIn}`,
|
|
37
|
+
background: system.color.bg.overlay,
|
|
38
38
|
animationDuration: '0.3s',
|
|
39
|
+
animationName: fadeIn,
|
|
39
40
|
// Allow overriding of animation in special cases
|
|
40
41
|
'.wd-no-animation &': {
|
|
41
42
|
animation: 'none',
|
|
42
43
|
},
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
// Responsive Container
|
|
45
|
+
'& > div': {
|
|
46
|
+
maxHeight: '100%',
|
|
47
|
+
display: 'flex',
|
|
48
|
+
position: 'absolute',
|
|
49
|
+
left: system.space.zero,
|
|
50
|
+
top: system.space.zero,
|
|
51
|
+
justifyContent: 'center',
|
|
52
|
+
alignItems: 'center',
|
|
53
|
+
height: '100%',
|
|
54
|
+
width: containerCenter,
|
|
55
|
+
},
|
|
56
|
+
'@media screen and (max-width: 768px)': {
|
|
57
|
+
height: '100%',
|
|
58
|
+
'& > div': {
|
|
59
|
+
alignItems: 'end',
|
|
49
60
|
},
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
);
|
|
53
|
-
|
|
54
|
-
// This centering container helps fix an issue with Chrome. Chrome doesn't normally do subpixel
|
|
55
|
-
// positioning, but seems to when using flexbox centering. This messes up Popper calculations inside
|
|
56
|
-
// the Modal. The centering container forces a "center" pixel calculation by making sure the width
|
|
57
|
-
// is always an even number
|
|
58
|
-
const ResponsiveContainer = styled('div')(({theme}) => {
|
|
59
|
-
const {canvas: canvasTheme} = getTheme(theme);
|
|
60
|
-
return {
|
|
61
|
-
maxHeight: '100%',
|
|
62
|
-
display: 'flex',
|
|
63
|
-
position: 'absolute',
|
|
64
|
-
left: 0,
|
|
65
|
-
top: 0,
|
|
66
|
-
justifyContent: 'center',
|
|
67
|
-
alignItems: 'center',
|
|
68
|
-
height: '100%',
|
|
69
|
-
[canvasTheme.breakpoints.down('s')]: {
|
|
70
|
-
alignItems: 'end',
|
|
71
61
|
},
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
export const ModalOverlay = createSubcomponent('div')({
|
|
76
|
-
displayName: 'Modal.Overlay',
|
|
77
|
-
modelHook: useModalModel,
|
|
78
|
-
})<ModalOverlayProps>((elemProps, Element, model) => {
|
|
79
|
-
return model.state.visibility !== 'hidden' ? (
|
|
80
|
-
<OpenModalOverlay as={Element} model={model} {...elemProps} />
|
|
81
|
-
) : null;
|
|
62
|
+
}),
|
|
82
63
|
});
|
|
83
64
|
|
|
84
65
|
export const useModalOverlay = createElemPropsHook(usePopupModel)(({state}, ref) => {
|
|
@@ -97,18 +78,20 @@ const OpenModalOverlay = createSubcomponent('div')({
|
|
|
97
78
|
elemPropsHook: useModalOverlay,
|
|
98
79
|
})<ModalOverlayProps>((elemProps, Element, model) => {
|
|
99
80
|
const windowSize = useWindowSize();
|
|
81
|
+
const containerCenter = windowSize.width % 2 === 1 ? 'calc(100vw - 1px)' : '100vw';
|
|
100
82
|
const content = (
|
|
101
|
-
<
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
83
|
+
<Box {...mergeStyles(elemProps, modalOverlayContainerStencil({containerCenter}))}>
|
|
84
|
+
{/* This centering container helps fix an issue with Chrome. Chrome doesn't normally do
|
|
85
|
+
subpixel positioning, but seems to when using flexbox centering. This messes up Popper
|
|
86
|
+
calculations inside the Modal. The centering container forces a "center" pixel calculation
|
|
87
|
+
by making sure the width is always an even number */}
|
|
88
|
+
<Box
|
|
89
|
+
// make sure the centering container is an even number of pixels to avoid sub-pixel
|
|
90
|
+
// inaccuracies due to centering
|
|
108
91
|
>
|
|
109
92
|
{elemProps.children}
|
|
110
|
-
</
|
|
111
|
-
</
|
|
93
|
+
</Box>
|
|
94
|
+
</Box>
|
|
112
95
|
);
|
|
113
96
|
|
|
114
97
|
// only render something on the client
|
|
@@ -118,3 +101,12 @@ const OpenModalOverlay = createSubcomponent('div')({
|
|
|
118
101
|
return null;
|
|
119
102
|
}
|
|
120
103
|
});
|
|
104
|
+
|
|
105
|
+
export const ModalOverlay = createSubcomponent('div')({
|
|
106
|
+
displayName: 'Modal.Overlay',
|
|
107
|
+
modelHook: useModalModel,
|
|
108
|
+
})<ModalOverlayProps>((elemProps, Element, model) => {
|
|
109
|
+
return model.state.visibility !== 'hidden' ? (
|
|
110
|
+
<OpenModalOverlay as={Element} model={model} {...elemProps} />
|
|
111
|
+
) : null;
|
|
112
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workday/canvas-kit-react",
|
|
3
|
-
"version": "12.0.0-alpha.
|
|
3
|
+
"version": "12.0.0-alpha.852-next.0",
|
|
4
4
|
"description": "The parent module that contains all Workday Canvas Kit React components",
|
|
5
5
|
"author": "Workday, Inc. (https://www.workday.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
"@emotion/styled": "^11.6.0",
|
|
50
50
|
"@popperjs/core": "^2.5.4",
|
|
51
51
|
"@workday/canvas-colors-web": "^2.0.0",
|
|
52
|
-
"@workday/canvas-kit-popup-stack": "^12.0.0-alpha.
|
|
53
|
-
"@workday/canvas-kit-styling": "^12.0.0-alpha.
|
|
52
|
+
"@workday/canvas-kit-popup-stack": "^12.0.0-alpha.852-next.0",
|
|
53
|
+
"@workday/canvas-kit-styling": "^12.0.0-alpha.852-next.0",
|
|
54
54
|
"@workday/canvas-system-icons-web": "^3.0.0",
|
|
55
55
|
"@workday/canvas-tokens-web": "^2.0.0",
|
|
56
56
|
"@workday/design-assets-types": "^0.2.8",
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"@workday/canvas-accent-icons-web": "^3.0.0",
|
|
68
68
|
"@workday/canvas-applet-icons-web": "^2.0.0"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "bbd7343aec2a6657b8eff4981a7aa4a6e47af161"
|
|
71
71
|
}
|
package/popup/lib/Popper.tsx
CHANGED
|
@@ -154,10 +154,8 @@ const OpenPopper = React.forwardRef<HTMLDivElement, PopperProps>(
|
|
|
154
154
|
enabled: true,
|
|
155
155
|
phase: 'afterWrite',
|
|
156
156
|
fn({state}) {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
onPlacementChange?.(state.placement);
|
|
160
|
-
}
|
|
157
|
+
setPlacement(state.placement);
|
|
158
|
+
onPlacementChange?.(state.placement);
|
|
161
159
|
},
|
|
162
160
|
};
|
|
163
161
|
}, [setPlacement, onPlacementChange]);
|