@workday/canvas-kit-react 7.0.0-alpha.0-next.3 → 7.0.0-alpha.0-next.4
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/card/lib/CardHeading.tsx +5 -6
- package/common/lib/utils/index.ts +1 -0
- package/dist/commonjs/card/lib/CardHeading.d.ts +2 -1
- package/dist/commonjs/card/lib/CardHeading.d.ts.map +1 -1
- package/dist/commonjs/card/lib/CardHeading.js +3 -4
- package/dist/commonjs/common/lib/utils/index.d.ts +1 -0
- package/dist/commonjs/common/lib/utils/index.d.ts.map +1 -1
- package/dist/commonjs/common/lib/utils/index.js +1 -0
- package/dist/commonjs/modal/lib/Modal.d.ts +1 -0
- package/dist/commonjs/modal/lib/Modal.d.ts.map +1 -1
- package/dist/commonjs/modal/lib/Modal.js +2 -0
- package/dist/commonjs/modal/lib/ModalCard.js +1 -1
- package/dist/commonjs/modal/lib/ModalOverflowOverlay.d.ts +2 -0
- package/dist/commonjs/modal/lib/ModalOverflowOverlay.d.ts.map +1 -0
- package/dist/commonjs/modal/lib/ModalOverflowOverlay.js +48 -0
- package/dist/commonjs/modal/lib/ModalOverlay.d.ts +2 -1
- package/dist/commonjs/modal/lib/ModalOverlay.d.ts.map +1 -1
- package/dist/commonjs/modal/lib/ModalOverlay.js +9 -2
- package/dist/commonjs/popup/lib/Popup.d.ts.map +1 -1
- package/dist/commonjs/popup/lib/Popup.js +2 -2
- package/dist/commonjs/popup/lib/PopupBody.d.ts +2 -0
- package/dist/commonjs/popup/lib/PopupBody.d.ts.map +1 -0
- package/dist/commonjs/popup/lib/PopupBody.js +29 -0
- package/dist/commonjs/popup/lib/PopupCard.d.ts +2 -1
- package/dist/commonjs/popup/lib/PopupCard.d.ts.map +1 -1
- package/dist/commonjs/popup/lib/PopupCard.js +7 -1
- package/dist/commonjs/popup/lib/PopupHeading.d.ts +3 -1
- package/dist/commonjs/popup/lib/PopupHeading.d.ts.map +1 -1
- package/dist/commonjs/popup/lib/PopupHeading.js +1 -1
- package/dist/es6/card/lib/CardHeading.d.ts +2 -1
- package/dist/es6/card/lib/CardHeading.d.ts.map +1 -1
- package/dist/es6/card/lib/CardHeading.js +4 -5
- package/dist/es6/common/lib/utils/index.d.ts +1 -0
- package/dist/es6/common/lib/utils/index.d.ts.map +1 -1
- package/dist/es6/common/lib/utils/index.js +1 -0
- package/dist/es6/modal/lib/Modal.d.ts +1 -0
- package/dist/es6/modal/lib/Modal.d.ts.map +1 -1
- package/dist/es6/modal/lib/Modal.js +2 -0
- package/dist/es6/modal/lib/ModalCard.js +1 -1
- package/dist/es6/modal/lib/ModalOverflowOverlay.d.ts +2 -0
- package/dist/es6/modal/lib/ModalOverflowOverlay.d.ts.map +1 -0
- package/dist/es6/modal/lib/ModalOverflowOverlay.js +36 -0
- package/dist/es6/modal/lib/ModalOverlay.d.ts +2 -1
- package/dist/es6/modal/lib/ModalOverlay.d.ts.map +1 -1
- package/dist/es6/modal/lib/ModalOverlay.js +9 -2
- package/dist/es6/popup/lib/Popup.d.ts.map +1 -1
- package/dist/es6/popup/lib/Popup.js +2 -2
- package/dist/es6/popup/lib/PopupBody.d.ts +2 -0
- package/dist/es6/popup/lib/PopupBody.d.ts.map +1 -0
- package/dist/es6/popup/lib/PopupBody.js +20 -0
- package/dist/es6/popup/lib/PopupCard.d.ts +2 -1
- package/dist/es6/popup/lib/PopupCard.d.ts.map +1 -1
- package/dist/es6/popup/lib/PopupCard.js +8 -2
- package/dist/es6/popup/lib/PopupHeading.d.ts +3 -1
- package/dist/es6/popup/lib/PopupHeading.d.ts.map +1 -1
- package/dist/es6/popup/lib/PopupHeading.js +1 -1
- package/modal/lib/Modal.tsx +2 -0
- package/modal/lib/ModalCard.tsx +1 -1
- package/modal/lib/ModalOverflowOverlay.tsx +25 -0
- package/modal/lib/ModalOverlay.tsx +11 -3
- package/package.json +5 -5
- package/popup/lib/Popup.tsx +2 -2
- package/popup/lib/PopupBody.tsx +11 -0
- package/popup/lib/PopupCard.tsx +17 -3
- package/popup/lib/PopupHeading.tsx +3 -3
- package/ts3.5/dist/commonjs/card/lib/CardHeading.d.ts +2 -1
- package/ts3.5/dist/commonjs/common/lib/utils/index.d.ts +1 -0
- package/ts3.5/dist/commonjs/modal/lib/Modal.d.ts +1 -0
- package/ts3.5/dist/commonjs/modal/lib/ModalOverflowOverlay.d.ts +2 -0
- package/ts3.5/dist/commonjs/modal/lib/ModalOverlay.d.ts +2 -1
- package/ts3.5/dist/commonjs/popup/lib/PopupBody.d.ts +2 -0
- package/ts3.5/dist/commonjs/popup/lib/PopupCard.d.ts +2 -1
- package/ts3.5/dist/commonjs/popup/lib/PopupHeading.d.ts +3 -1
- package/ts3.5/dist/es6/card/lib/CardHeading.d.ts +2 -1
- package/ts3.5/dist/es6/common/lib/utils/index.d.ts +1 -0
- package/ts3.5/dist/es6/modal/lib/Modal.d.ts +1 -0
- package/ts3.5/dist/es6/modal/lib/ModalOverflowOverlay.d.ts +2 -0
- package/ts3.5/dist/es6/modal/lib/ModalOverlay.d.ts +2 -1
- package/ts3.5/dist/es6/popup/lib/PopupBody.d.ts +2 -0
- package/ts3.5/dist/es6/popup/lib/PopupCard.d.ts +2 -1
- package/ts3.5/dist/es6/popup/lib/PopupHeading.d.ts +3 -1
|
@@ -10,7 +10,6 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
12
|
import * as React from 'react';
|
|
13
|
-
import { Card } from '@workday/canvas-kit-react/card';
|
|
14
13
|
import { createComponent, useDefaultModel } from '@workday/canvas-kit-react/common';
|
|
15
14
|
import { usePopupModel, PopupModelContext } from './hooks';
|
|
16
15
|
import { PopupCard } from './PopupCard';
|
|
@@ -19,6 +18,7 @@ import { PopupPopper } from './PopupPopper';
|
|
|
19
18
|
import { PopupHeading } from './PopupHeading';
|
|
20
19
|
import { PopupCloseIcon } from './PopupCloseIcon';
|
|
21
20
|
import { PopupCloseButton } from './PopupCloseButton';
|
|
21
|
+
import { PopupBody } from './PopupBody';
|
|
22
22
|
export var Popup = createComponent()({
|
|
23
23
|
displayName: 'Popup',
|
|
24
24
|
Component: function (_a) {
|
|
@@ -28,7 +28,7 @@ export var Popup = createComponent()({
|
|
|
28
28
|
},
|
|
29
29
|
subComponents: {
|
|
30
30
|
Heading: PopupHeading,
|
|
31
|
-
Body:
|
|
31
|
+
Body: PopupBody,
|
|
32
32
|
Card: PopupCard,
|
|
33
33
|
CloseIcon: PopupCloseIcon,
|
|
34
34
|
Target: PopupTarget,
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const PopupBody: import("../../common").ElementComponent<"div", import("@workday/canvas-kit-labs-react/common/lib/utils/border").BorderShorthandStyleProps & import("@workday/canvas-kit-labs-react/common/lib/utils/border").BorderColorStyleProps & import("@workday/canvas-kit-labs-react/common/lib/utils/border").BorderRadiusStyleProps & import("@workday/canvas-kit-labs-react/common/lib/utils/border").BorderLineStyleProps & import("@workday/canvas-kit-labs-react/common/lib/utils/border").BorderWidthStyleProps & import("@workday/canvas-kit-labs-react/common/lib/utils/border").BorderLogicalStyleProps & import("@workday/canvas-kit-labs-react").ColorStyleProps & import("@workday/canvas-kit-labs-react").DepthStyleProps & import("@workday/canvas-kit-labs-react").FlexItemStyleProps & import("@workday/canvas-kit-labs-react").LayoutStyleProps & import("@workday/canvas-kit-labs-react/common/lib/utils/other").OtherStyleProps & import("@workday/canvas-kit-labs-react/common/lib/utils/position").PositionStandardProps & import("@workday/canvas-kit-labs-react/common/lib/utils/position").PositionLogicalProps & import("@workday/canvas-kit-labs-react/common/lib/utils/space").SpaceStandardProps & import("@workday/canvas-kit-labs-react/common/lib/utils/space").SpaceLogicalProps>;
|
|
2
|
+
//# sourceMappingURL=PopupBody.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PopupBody.d.ts","sourceRoot":"","sources":["../../../../popup/lib/PopupBody.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,SAAS,2uCAKpB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import * as React from 'react';
|
|
13
|
+
import { createComponent } from '@workday/canvas-kit-react/common';
|
|
14
|
+
import { Card } from '@workday/canvas-kit-react/card';
|
|
15
|
+
export var PopupBody = createComponent('div')({
|
|
16
|
+
displayName: 'Popup.Body',
|
|
17
|
+
Component: function (props, ref) {
|
|
18
|
+
return React.createElement(Card.Body, __assign({ overflowY: "auto" }, props));
|
|
19
|
+
},
|
|
20
|
+
});
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Card } from '@workday/canvas-kit-react/card';
|
|
3
3
|
import { ExtractProps } from '@workday/canvas-kit-react/common';
|
|
4
|
+
import { StackStyleProps } from '@workday/canvas-kit-labs-react/layout';
|
|
4
5
|
import { PopupModel } from './hooks';
|
|
5
|
-
export interface PopupCardProps extends ExtractProps<typeof Card, never> {
|
|
6
|
+
export interface PopupCardProps extends ExtractProps<typeof Card, never>, Partial<StackStyleProps> {
|
|
6
7
|
/**
|
|
7
8
|
* Optionally pass a model directly to this component. Default is to implicitly use the same
|
|
8
9
|
* model as the container component which uses React context. Only use this for advanced use-cases
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PopupCard.d.ts","sourceRoot":"","sources":["../../../../popup/lib/PopupCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAC,IAAI,EAAC,MAAM,gCAAgC,CAAC;AAEpD,OAAO,EAOL,YAAY,
|
|
1
|
+
{"version":3,"file":"PopupCard.d.ts","sourceRoot":"","sources":["../../../../popup/lib/PopupCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAC,IAAI,EAAC,MAAM,gCAAgC,CAAC;AAEpD,OAAO,EAOL,YAAY,EAEb,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAQ,eAAe,EAAC,MAAM,uCAAuC,CAAC;AAG7E,OAAO,EAAe,UAAU,EAAoB,MAAM,SAAS,CAAC;AAEpE,MAAM,WAAW,cAAe,SAAQ,YAAY,CAAC,OAAO,IAAI,EAAE,KAAK,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC;IAChG;;;OAGG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAmCD,eAAO,MAAM,SAAS,gEAmCpB,CAAC"}
|
|
@@ -28,7 +28,8 @@ import * as React from 'react';
|
|
|
28
28
|
import { keyframes } from '@emotion/core';
|
|
29
29
|
import { Card } from '@workday/canvas-kit-react/card';
|
|
30
30
|
import { space, type } from '@workday/canvas-kit-react/tokens';
|
|
31
|
-
import { styled, getTranslateFromOrigin, createComponent, useModelContext, } from '@workday/canvas-kit-react/common';
|
|
31
|
+
import { styled, getTranslateFromOrigin, createComponent, useModelContext, useConstant, } from '@workday/canvas-kit-react/common';
|
|
32
|
+
import { Stack } from '@workday/canvas-kit-labs-react/layout';
|
|
32
33
|
import { getTransformFromPlacement } from './getTransformFromPlacement';
|
|
33
34
|
import { usePopupCard, PopupModelContext } from './hooks';
|
|
34
35
|
var popupAnimation = function (transformOrigin) {
|
|
@@ -60,7 +61,12 @@ export var PopupCard = createComponent('div')({
|
|
|
60
61
|
var transformOrigin = React.useMemo(function () {
|
|
61
62
|
return getTransformFromPlacement(localModel.state.placement || 'bottom');
|
|
62
63
|
}, [localModel.state.placement]);
|
|
63
|
-
|
|
64
|
+
// As is a Stack that will render an element of `Element`
|
|
65
|
+
var As = useConstant(function () { return Stack.as(Element); });
|
|
66
|
+
return (React.createElement(StyledPopupCard, __assign({ as: As, transformOrigin: transformOrigin, position: "relative", padding: "l", depth: 2, maxWidth: "calc(100vw - " + space.l + ")", spacing: 0, flexDirection: "column", minHeight: 0, maxHeight: "calc(100vh - " + (elemProps.margin
|
|
67
|
+
? space[elemProps.margin] || elemProps.margin
|
|
68
|
+
: space.xl) + " * 2)", overflowY: "auto" // force IE11 to limit the flex size of the card. Without this, the body isn't allowed to overflow properly: https://github.com/philipwalton/flexbugs/issues/216#issuecomment-453053557
|
|
69
|
+
}, props), children));
|
|
64
70
|
},
|
|
65
71
|
});
|
|
66
72
|
var templateObject_1;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { ExtractProps } from '@workday/canvas-kit-react/common';
|
|
3
|
+
import { Card } from '@workday/canvas-kit-react/card';
|
|
2
4
|
import { PopupModel } from './hooks';
|
|
3
|
-
export interface PopupHeadingProps {
|
|
5
|
+
export interface PopupHeadingProps extends ExtractProps<typeof Card.Heading, never> {
|
|
4
6
|
/**
|
|
5
7
|
* Optionally pass a model directly to this component. Default is to implicitly use the same
|
|
6
8
|
* model as the container component which uses React context. Only use this for advanced use-cases
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PopupHeading.d.ts","sourceRoot":"","sources":["../../../../popup/lib/PopupHeading.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"PopupHeading.d.ts","sourceRoot":"","sources":["../../../../popup/lib/PopupHeading.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAmC,YAAY,EAAC,MAAM,kCAAkC,CAAC;AAChG,OAAO,EAAC,IAAI,EAAC,MAAM,gCAAgC,CAAC;AAEpD,OAAO,EAAkB,UAAU,EAAoB,MAAM,SAAS,CAAC;AAEvE,MAAM,WAAW,iBAAkB,SAAQ,YAAY,CAAC,OAAO,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC;IACjF;;;OAGG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,eAAO,MAAM,YAAY,kEAYvB,CAAC"}
|
|
@@ -30,6 +30,6 @@ export var PopupHeading = createComponent('h2')({
|
|
|
30
30
|
var children = _a.children, model = _a.model, elemProps = __rest(_a, ["children", "model"]);
|
|
31
31
|
var localModel = useModelContext(PopupModelContext, model);
|
|
32
32
|
var props = usePopupHeading(localModel, elemProps, ref);
|
|
33
|
-
return (React.createElement(Card.Heading, __assign({ as: Element }, props), children));
|
|
33
|
+
return (React.createElement(Card.Heading, __assign({ as: Element, marginBottom: "s" }, props), children));
|
|
34
34
|
},
|
|
35
35
|
});
|
package/modal/lib/Modal.tsx
CHANGED
|
@@ -6,6 +6,7 @@ import {ModalOverlay} from './ModalOverlay';
|
|
|
6
6
|
import {ModalCard} from './ModalCard';
|
|
7
7
|
import {useModalModel} from './hooks';
|
|
8
8
|
import {ModalHeading} from './ModalHeading';
|
|
9
|
+
import {ModalOverflowOverlay} from './ModalOverflowOverlay';
|
|
9
10
|
|
|
10
11
|
export interface ModalProps extends ExtractProps<typeof Dialog, never> {
|
|
11
12
|
/** The contents of the Modal. Can be `Modal` subcomponents or any valid elements. */
|
|
@@ -27,6 +28,7 @@ export const Modal = createComponent()({
|
|
|
27
28
|
Target: Popup.Target,
|
|
28
29
|
Heading: ModalHeading,
|
|
29
30
|
Overlay: ModalOverlay,
|
|
31
|
+
OverflowOverlay: ModalOverflowOverlay,
|
|
30
32
|
CloseButton: Popup.CloseButton,
|
|
31
33
|
},
|
|
32
34
|
});
|
package/modal/lib/ModalCard.tsx
CHANGED
|
@@ -14,7 +14,7 @@ export const ModalCard = createComponent('div')({
|
|
|
14
14
|
|
|
15
15
|
const props = useModalCard(localModel, elemProps, ref);
|
|
16
16
|
return (
|
|
17
|
-
<Popup.Card as={Element} width={440} borderWidth={0} {...props}>
|
|
17
|
+
<Popup.Card as={Element} width={440} borderWidth={0} margin="xl" {...props}>
|
|
18
18
|
{children}
|
|
19
19
|
</Popup.Card>
|
|
20
20
|
);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
import {createComponent, ExtractProps, StyledType} from '@workday/canvas-kit-react/common';
|
|
4
|
+
|
|
5
|
+
import {ModalOverlay} from './ModalOverlay';
|
|
6
|
+
import styled from '@emotion/styled';
|
|
7
|
+
|
|
8
|
+
const StyledOverlay = styled(ModalOverlay)<StyledType>({
|
|
9
|
+
'& > div': {maxHeight: 'inherit'}, // reset maxHeight of centering div
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export const ModalOverflowOverlay = createComponent('div')({
|
|
13
|
+
displayName: 'Modal.OverflowOverlay',
|
|
14
|
+
Component: (
|
|
15
|
+
{children, model, ...elemProps}: ExtractProps<typeof ModalOverlay, never>,
|
|
16
|
+
ref,
|
|
17
|
+
Element
|
|
18
|
+
) => {
|
|
19
|
+
return (
|
|
20
|
+
<StyledOverlay as={Element} ref={ref} overflow="auto" {...elemProps}>
|
|
21
|
+
{children}
|
|
22
|
+
</StyledOverlay>
|
|
23
|
+
);
|
|
24
|
+
},
|
|
25
|
+
});
|
|
@@ -12,8 +12,9 @@ import {
|
|
|
12
12
|
import {PopupModel, PopupModelContext, usePopupStack} from '@workday/canvas-kit-react/popup';
|
|
13
13
|
import {keyframes} from '@emotion/core';
|
|
14
14
|
import styled from '@emotion/styled';
|
|
15
|
+
import {Box, BoxProps} from '@workday/canvas-kit-labs-react/common';
|
|
15
16
|
|
|
16
|
-
export interface ModalOverlayProps {
|
|
17
|
+
export interface ModalOverlayProps extends BoxProps {
|
|
17
18
|
model?: PopupModel;
|
|
18
19
|
children: React.ReactNode;
|
|
19
20
|
}
|
|
@@ -27,7 +28,7 @@ const fadeIn = keyframes`
|
|
|
27
28
|
}
|
|
28
29
|
`;
|
|
29
30
|
|
|
30
|
-
const Container = styled(
|
|
31
|
+
const Container = styled(Box)<StyledType>({
|
|
31
32
|
position: 'fixed',
|
|
32
33
|
top: 0,
|
|
33
34
|
left: 0,
|
|
@@ -47,13 +48,20 @@ const Container = styled('div')<StyledType>({
|
|
|
47
48
|
// the Modal. The centering container forces a "center" pixel calculation by making sure the width
|
|
48
49
|
// is always an even number
|
|
49
50
|
const CenteringContainer = styled('div')({
|
|
50
|
-
|
|
51
|
+
maxHeight: '100vh',
|
|
51
52
|
display: 'flex',
|
|
52
53
|
position: 'absolute',
|
|
53
54
|
left: 0,
|
|
54
55
|
top: 0,
|
|
55
56
|
alignItems: 'center',
|
|
56
57
|
justifyContent: 'center',
|
|
58
|
+
|
|
59
|
+
// IE11 fix for setting min-height in a flex container
|
|
60
|
+
':before': {
|
|
61
|
+
display: 'block',
|
|
62
|
+
content: "''",
|
|
63
|
+
height: '100vh',
|
|
64
|
+
},
|
|
57
65
|
});
|
|
58
66
|
|
|
59
67
|
export const ModalOverlay = createComponent('div')({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workday/canvas-kit-react",
|
|
3
|
-
"version": "7.0.0-alpha.0-next.
|
|
3
|
+
"version": "7.0.0-alpha.0-next.4+bdd1ec94",
|
|
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",
|
|
@@ -57,9 +57,9 @@
|
|
|
57
57
|
"@emotion/styled": "^10.0.27",
|
|
58
58
|
"@popperjs/core": "^2.5.4",
|
|
59
59
|
"@workday/canvas-colors-web": "^2.0.0",
|
|
60
|
-
"@workday/canvas-kit-labs-react": "^7.0.0-alpha.0-next.
|
|
61
|
-
"@workday/canvas-kit-popup-stack": "^7.0.0-alpha.0-next.
|
|
62
|
-
"@workday/canvas-kit-preview-react": "^7.0.0-alpha.0-next.
|
|
60
|
+
"@workday/canvas-kit-labs-react": "^7.0.0-alpha.0-next.4+bdd1ec94",
|
|
61
|
+
"@workday/canvas-kit-popup-stack": "^7.0.0-alpha.0-next.4+bdd1ec94",
|
|
62
|
+
"@workday/canvas-kit-preview-react": "^7.0.0-alpha.0-next.4+bdd1ec94",
|
|
63
63
|
"@workday/canvas-system-icons-web": "1.0.41",
|
|
64
64
|
"@workday/design-assets-types": "^0.2.4",
|
|
65
65
|
"chroma-js": "^2.1.0",
|
|
@@ -77,5 +77,5 @@
|
|
|
77
77
|
"@workday/canvas-accent-icons-web": "^1.0.0",
|
|
78
78
|
"@workday/canvas-applet-icons-web": "^0.17.50"
|
|
79
79
|
},
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "bdd1ec9493a5a2dc4d67e4cc33adcba13efee4b7"
|
|
81
81
|
}
|
package/popup/lib/Popup.tsx
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
|
-
import {Card} from '@workday/canvas-kit-react/card';
|
|
4
3
|
import {createComponent, useDefaultModel} from '@workday/canvas-kit-react/common';
|
|
5
4
|
|
|
6
5
|
import {PopupModel, usePopupModel, PopupModelContext} from './hooks';
|
|
@@ -10,6 +9,7 @@ import {PopupPopper} from './PopupPopper';
|
|
|
10
9
|
import {PopupHeading} from './PopupHeading';
|
|
11
10
|
import {PopupCloseIcon} from './PopupCloseIcon';
|
|
12
11
|
import {PopupCloseButton} from './PopupCloseButton';
|
|
12
|
+
import {PopupBody} from './PopupBody';
|
|
13
13
|
|
|
14
14
|
export interface PopupProps {
|
|
15
15
|
/**
|
|
@@ -30,7 +30,7 @@ export const Popup = createComponent()({
|
|
|
30
30
|
},
|
|
31
31
|
subComponents: {
|
|
32
32
|
Heading: PopupHeading,
|
|
33
|
-
Body:
|
|
33
|
+
Body: PopupBody,
|
|
34
34
|
Card: PopupCard,
|
|
35
35
|
CloseIcon: PopupCloseIcon,
|
|
36
36
|
Target: PopupTarget,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
import {createComponent, ExtractProps} from '@workday/canvas-kit-react/common';
|
|
4
|
+
import {Card} from '@workday/canvas-kit-react/card';
|
|
5
|
+
|
|
6
|
+
export const PopupBody = createComponent('div')({
|
|
7
|
+
displayName: 'Popup.Body',
|
|
8
|
+
Component: (props: ExtractProps<typeof Card.Body, never>, ref) => {
|
|
9
|
+
return <Card.Body overflowY="auto" {...props} />;
|
|
10
|
+
},
|
|
11
|
+
});
|
package/popup/lib/PopupCard.tsx
CHANGED
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import {keyframes} from '@emotion/core';
|
|
3
3
|
|
|
4
4
|
import {Card} from '@workday/canvas-kit-react/card';
|
|
5
|
-
import {space, type} from '@workday/canvas-kit-react/tokens';
|
|
5
|
+
import {space, type, CanvasSpaceKeys} from '@workday/canvas-kit-react/tokens';
|
|
6
6
|
import {
|
|
7
7
|
styled,
|
|
8
8
|
TransformOrigin,
|
|
@@ -11,12 +11,14 @@ import {
|
|
|
11
11
|
StyledType,
|
|
12
12
|
useModelContext,
|
|
13
13
|
ExtractProps,
|
|
14
|
+
useConstant,
|
|
14
15
|
} from '@workday/canvas-kit-react/common';
|
|
16
|
+
import {Stack, StackStyleProps} from '@workday/canvas-kit-labs-react/layout';
|
|
15
17
|
|
|
16
18
|
import {getTransformFromPlacement} from './getTransformFromPlacement';
|
|
17
19
|
import {usePopupCard, PopupModel, PopupModelContext} from './hooks';
|
|
18
20
|
|
|
19
|
-
export interface PopupCardProps extends ExtractProps<typeof Card, never> {
|
|
21
|
+
export interface PopupCardProps extends ExtractProps<typeof Card, never>, Partial<StackStyleProps> {
|
|
20
22
|
/**
|
|
21
23
|
* Optionally pass a model directly to this component. Default is to implicitly use the same
|
|
22
24
|
* model as the container component which uses React context. Only use this for advanced use-cases
|
|
@@ -67,14 +69,26 @@ export const PopupCard = createComponent('div')({
|
|
|
67
69
|
return getTransformFromPlacement(localModel.state.placement || 'bottom');
|
|
68
70
|
}, [localModel.state.placement]);
|
|
69
71
|
|
|
72
|
+
// As is a Stack that will render an element of `Element`
|
|
73
|
+
const As = useConstant(() => Stack.as(Element));
|
|
74
|
+
|
|
70
75
|
return (
|
|
71
76
|
<StyledPopupCard
|
|
72
|
-
as={
|
|
77
|
+
as={As}
|
|
73
78
|
transformOrigin={transformOrigin}
|
|
74
79
|
position="relative"
|
|
75
80
|
padding="l"
|
|
76
81
|
depth={2}
|
|
77
82
|
maxWidth={`calc(100vw - ${space.l})`}
|
|
83
|
+
spacing={0}
|
|
84
|
+
flexDirection="column"
|
|
85
|
+
minHeight={0}
|
|
86
|
+
maxHeight={`calc(100vh - ${
|
|
87
|
+
elemProps.margin
|
|
88
|
+
? space[elemProps.margin as CanvasSpaceKeys] || elemProps.margin
|
|
89
|
+
: space.xl
|
|
90
|
+
} * 2)`}
|
|
91
|
+
overflowY="auto" // force IE11 to limit the flex size of the card. Without this, the body isn't allowed to overflow properly: https://github.com/philipwalton/flexbugs/issues/216#issuecomment-453053557
|
|
78
92
|
{...props}
|
|
79
93
|
>
|
|
80
94
|
{children}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
|
-
import {createComponent, useModelContext} from '@workday/canvas-kit-react/common';
|
|
3
|
+
import {createComponent, useModelContext, ExtractProps} from '@workday/canvas-kit-react/common';
|
|
4
4
|
import {Card} from '@workday/canvas-kit-react/card';
|
|
5
5
|
|
|
6
6
|
import {usePopupHeading, PopupModel, PopupModelContext} from './hooks';
|
|
7
7
|
|
|
8
|
-
export interface PopupHeadingProps {
|
|
8
|
+
export interface PopupHeadingProps extends ExtractProps<typeof Card.Heading, never> {
|
|
9
9
|
/**
|
|
10
10
|
* Optionally pass a model directly to this component. Default is to implicitly use the same
|
|
11
11
|
* model as the container component which uses React context. Only use this for advanced use-cases
|
|
@@ -21,7 +21,7 @@ export const PopupHeading = createComponent('h2')({
|
|
|
21
21
|
|
|
22
22
|
const props = usePopupHeading(localModel, elemProps, ref);
|
|
23
23
|
return (
|
|
24
|
-
<Card.Heading as={Element} {...props}>
|
|
24
|
+
<Card.Heading as={Element} marginBottom="s" {...props}>
|
|
25
25
|
{children}
|
|
26
26
|
</Card.Heading>
|
|
27
27
|
);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
2
|
+
import { BoxProps } from '@workday/canvas-kit-labs-react/common';
|
|
3
|
+
export interface CardHeadingProps extends BoxProps {
|
|
3
4
|
/**
|
|
4
5
|
* The id of the Card heading. Tie this to an `aria-labelledby` for accessibility.
|
|
5
6
|
*/
|
|
@@ -10,6 +10,7 @@ export * from './useMount';
|
|
|
10
10
|
export * from './components';
|
|
11
11
|
export * from './models';
|
|
12
12
|
export * from './elements';
|
|
13
|
+
export * from './useConstant';
|
|
13
14
|
export * from './useIsFullscreen';
|
|
14
15
|
export * from './useWindowSize';
|
|
15
16
|
export * from './useResizeObserver';
|
|
@@ -12,6 +12,7 @@ export declare const Modal: import("../../common").Component<ModalProps> & {
|
|
|
12
12
|
Target: import("../../common").ElementComponent<import("../../common").ElementComponent<"button", import("../..").SecondaryButtonProps>, import("../../popup/lib/PopupTarget").PopupTargetProps>;
|
|
13
13
|
Heading: import("../../common").ElementComponent<"h2", import("./ModalHeading").ModalHeadingProps>;
|
|
14
14
|
Overlay: import("../../common").ElementComponent<"div", import("./ModalOverlay").ModalOverlayProps>;
|
|
15
|
+
OverflowOverlay: import("../../common").ElementComponent<"div", import("./ModalOverlay").ModalOverlayProps>;
|
|
15
16
|
CloseButton: import("../../common").ElementComponent<import("../../common").ElementComponent<"button", import("../..").SecondaryButtonProps>, import("../../popup/lib/PopupCloseButton").PopupCloseButtonProps>;
|
|
16
17
|
};
|
|
17
18
|
//# sourceMappingURL=Modal.d.ts.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { PopupModel } from '@workday/canvas-kit-react/popup';
|
|
3
|
-
|
|
3
|
+
import { BoxProps } from '@workday/canvas-kit-labs-react/common';
|
|
4
|
+
export interface ModalOverlayProps extends BoxProps {
|
|
4
5
|
model?: PopupModel;
|
|
5
6
|
children: React.ReactNode;
|
|
6
7
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const PopupBody: import("../../common").ElementComponent<"div", import("@workday/canvas-kit-labs-react/common/lib/utils/border").BorderShorthandStyleProps & import("@workday/canvas-kit-labs-react/common/lib/utils/border").BorderColorStyleProps & import("@workday/canvas-kit-labs-react/common/lib/utils/border").BorderRadiusStyleProps & import("@workday/canvas-kit-labs-react/common/lib/utils/border").BorderLineStyleProps & import("@workday/canvas-kit-labs-react/common/lib/utils/border").BorderWidthStyleProps & import("@workday/canvas-kit-labs-react/common/lib/utils/border").BorderLogicalStyleProps & import("@workday/canvas-kit-labs-react").ColorStyleProps & import("@workday/canvas-kit-labs-react").DepthStyleProps & import("@workday/canvas-kit-labs-react").FlexItemStyleProps & import("@workday/canvas-kit-labs-react").LayoutStyleProps & import("@workday/canvas-kit-labs-react/common/lib/utils/other").OtherStyleProps & import("@workday/canvas-kit-labs-react/common/lib/utils/position").PositionStandardProps & import("@workday/canvas-kit-labs-react/common/lib/utils/position").PositionLogicalProps & import("@workday/canvas-kit-labs-react/common/lib/utils/space").SpaceStandardProps & import("@workday/canvas-kit-labs-react/common/lib/utils/space").SpaceLogicalProps>;
|
|
2
|
+
//# sourceMappingURL=PopupBody.d.ts.map
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Card } from '@workday/canvas-kit-react/card';
|
|
3
3
|
import { ExtractProps } from '@workday/canvas-kit-react/common';
|
|
4
|
+
import { StackStyleProps } from '@workday/canvas-kit-labs-react/layout';
|
|
4
5
|
import { PopupModel } from './hooks';
|
|
5
|
-
export interface PopupCardProps extends ExtractProps<typeof Card, never> {
|
|
6
|
+
export interface PopupCardProps extends ExtractProps<typeof Card, never>, Partial<StackStyleProps> {
|
|
6
7
|
/**
|
|
7
8
|
* Optionally pass a model directly to this component. Default is to implicitly use the same
|
|
8
9
|
* model as the container component which uses React context. Only use this for advanced use-cases
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { ExtractProps } from '@workday/canvas-kit-react/common';
|
|
3
|
+
import { Card } from '@workday/canvas-kit-react/card';
|
|
2
4
|
import { PopupModel } from './hooks';
|
|
3
|
-
export interface PopupHeadingProps {
|
|
5
|
+
export interface PopupHeadingProps extends ExtractProps<typeof Card.Heading, never> {
|
|
4
6
|
/**
|
|
5
7
|
* Optionally pass a model directly to this component. Default is to implicitly use the same
|
|
6
8
|
* model as the container component which uses React context. Only use this for advanced use-cases
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
2
|
+
import { BoxProps } from '@workday/canvas-kit-labs-react/common';
|
|
3
|
+
export interface CardHeadingProps extends BoxProps {
|
|
3
4
|
/**
|
|
4
5
|
* The id of the Card heading. Tie this to an `aria-labelledby` for accessibility.
|
|
5
6
|
*/
|
|
@@ -10,6 +10,7 @@ export * from './useMount';
|
|
|
10
10
|
export * from './components';
|
|
11
11
|
export * from './models';
|
|
12
12
|
export * from './elements';
|
|
13
|
+
export * from './useConstant';
|
|
13
14
|
export * from './useIsFullscreen';
|
|
14
15
|
export * from './useWindowSize';
|
|
15
16
|
export * from './useResizeObserver';
|
|
@@ -12,6 +12,7 @@ export declare const Modal: import("../../common").Component<ModalProps> & {
|
|
|
12
12
|
Target: import("../../common").ElementComponent<import("../../common").ElementComponent<"button", import("../..").SecondaryButtonProps>, import("../../popup/lib/PopupTarget").PopupTargetProps>;
|
|
13
13
|
Heading: import("../../common").ElementComponent<"h2", import("./ModalHeading").ModalHeadingProps>;
|
|
14
14
|
Overlay: import("../../common").ElementComponent<"div", import("./ModalOverlay").ModalOverlayProps>;
|
|
15
|
+
OverflowOverlay: import("../../common").ElementComponent<"div", import("./ModalOverlay").ModalOverlayProps>;
|
|
15
16
|
CloseButton: import("../../common").ElementComponent<import("../../common").ElementComponent<"button", import("../..").SecondaryButtonProps>, import("../../popup/lib/PopupCloseButton").PopupCloseButtonProps>;
|
|
16
17
|
};
|
|
17
18
|
//# sourceMappingURL=Modal.d.ts.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { PopupModel } from '@workday/canvas-kit-react/popup';
|
|
3
|
-
|
|
3
|
+
import { BoxProps } from '@workday/canvas-kit-labs-react/common';
|
|
4
|
+
export interface ModalOverlayProps extends BoxProps {
|
|
4
5
|
model?: PopupModel;
|
|
5
6
|
children: React.ReactNode;
|
|
6
7
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const PopupBody: import("../../common").ElementComponent<"div", import("@workday/canvas-kit-labs-react/common/lib/utils/border").BorderShorthandStyleProps & import("@workday/canvas-kit-labs-react/common/lib/utils/border").BorderColorStyleProps & import("@workday/canvas-kit-labs-react/common/lib/utils/border").BorderRadiusStyleProps & import("@workday/canvas-kit-labs-react/common/lib/utils/border").BorderLineStyleProps & import("@workday/canvas-kit-labs-react/common/lib/utils/border").BorderWidthStyleProps & import("@workday/canvas-kit-labs-react/common/lib/utils/border").BorderLogicalStyleProps & import("@workday/canvas-kit-labs-react").ColorStyleProps & import("@workday/canvas-kit-labs-react").DepthStyleProps & import("@workday/canvas-kit-labs-react").FlexItemStyleProps & import("@workday/canvas-kit-labs-react").LayoutStyleProps & import("@workday/canvas-kit-labs-react/common/lib/utils/other").OtherStyleProps & import("@workday/canvas-kit-labs-react/common/lib/utils/position").PositionStandardProps & import("@workday/canvas-kit-labs-react/common/lib/utils/position").PositionLogicalProps & import("@workday/canvas-kit-labs-react/common/lib/utils/space").SpaceStandardProps & import("@workday/canvas-kit-labs-react/common/lib/utils/space").SpaceLogicalProps>;
|
|
2
|
+
//# sourceMappingURL=PopupBody.d.ts.map
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Card } from '@workday/canvas-kit-react/card';
|
|
3
3
|
import { ExtractProps } from '@workday/canvas-kit-react/common';
|
|
4
|
+
import { StackStyleProps } from '@workday/canvas-kit-labs-react/layout';
|
|
4
5
|
import { PopupModel } from './hooks';
|
|
5
|
-
export interface PopupCardProps extends ExtractProps<typeof Card, never> {
|
|
6
|
+
export interface PopupCardProps extends ExtractProps<typeof Card, never>, Partial<StackStyleProps> {
|
|
6
7
|
/**
|
|
7
8
|
* Optionally pass a model directly to this component. Default is to implicitly use the same
|
|
8
9
|
* model as the container component which uses React context. Only use this for advanced use-cases
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { ExtractProps } from '@workday/canvas-kit-react/common';
|
|
3
|
+
import { Card } from '@workday/canvas-kit-react/card';
|
|
2
4
|
import { PopupModel } from './hooks';
|
|
3
|
-
export interface PopupHeadingProps {
|
|
5
|
+
export interface PopupHeadingProps extends ExtractProps<typeof Card.Heading, never> {
|
|
4
6
|
/**
|
|
5
7
|
* Optionally pass a model directly to this component. Default is to implicitly use the same
|
|
6
8
|
* model as the container component which uses React context. Only use this for advanced use-cases
|