@workday/canvas-kit-react 7.0.0-alpha.78-next.6 → 7.0.0-alpha.81-next.9
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/button/lib/BaseButton.tsx +2 -2
- package/button/lib/SecondaryButton.tsx +2 -3
- package/card/lib/Card.tsx +1 -1
- package/dist/commonjs/button/lib/BaseButton.js +2 -2
- package/dist/commonjs/button/lib/SecondaryButton.d.ts.map +1 -1
- package/dist/commonjs/button/lib/SecondaryButton.js +2 -3
- package/dist/commonjs/card/lib/Card.js +1 -1
- package/dist/commonjs/layout/lib/Box.d.ts +1 -1
- package/dist/commonjs/layout/lib/Box.js +1 -1
- package/dist/commonjs/layout/lib/Flex.d.ts +1 -1
- package/dist/commonjs/layout/lib/Flex.js +1 -1
- package/dist/commonjs/modal/lib/ModalCard.js +1 -1
- package/dist/commonjs/popup/lib/Popper.d.ts +1 -9
- package/dist/commonjs/popup/lib/Popper.d.ts.map +1 -1
- package/dist/commonjs/popup/lib/Popper.js +2 -2
- package/dist/commonjs/popup/lib/PopupCard.js +1 -1
- package/dist/commonjs/toast/lib/Toast.d.ts.map +1 -1
- package/dist/commonjs/toast/lib/Toast.js +1 -1
- package/dist/commonjs/tokens/lib/depth.d.ts +48 -17
- package/dist/commonjs/tokens/lib/depth.d.ts.map +1 -1
- package/dist/commonjs/tokens/lib/depth.js +14 -9
- package/dist/es6/button/lib/BaseButton.js +2 -2
- package/dist/es6/button/lib/SecondaryButton.d.ts.map +1 -1
- package/dist/es6/button/lib/SecondaryButton.js +2 -3
- package/dist/es6/card/lib/Card.js +1 -1
- package/dist/es6/layout/lib/Box.d.ts +1 -1
- package/dist/es6/layout/lib/Box.js +1 -1
- package/dist/es6/layout/lib/Flex.d.ts +1 -1
- package/dist/es6/layout/lib/Flex.js +1 -1
- package/dist/es6/modal/lib/ModalCard.js +1 -1
- package/dist/es6/popup/lib/Popper.d.ts +1 -9
- package/dist/es6/popup/lib/Popper.d.ts.map +1 -1
- package/dist/es6/popup/lib/Popper.js +2 -2
- package/dist/es6/popup/lib/PopupCard.js +1 -1
- package/dist/es6/toast/lib/Toast.d.ts.map +1 -1
- package/dist/es6/toast/lib/Toast.js +1 -1
- package/dist/es6/tokens/lib/depth.d.ts +48 -17
- package/dist/es6/tokens/lib/depth.d.ts.map +1 -1
- package/dist/es6/tokens/lib/depth.js +14 -9
- package/layout/lib/Box.tsx +1 -1
- package/layout/lib/Flex.tsx +1 -1
- package/modal/lib/ModalCard.tsx +1 -1
- package/package.json +5 -5
- package/popup/lib/Popper.tsx +2 -11
- package/popup/lib/PopupCard.tsx +1 -1
- package/toast/lib/Toast.tsx +1 -0
- package/tokens/README.md +11 -8
- package/tokens/lib/depth.ts +60 -24
- package/ts3.5/dist/commonjs/layout/lib/Box.d.ts +1 -1
- package/ts3.5/dist/commonjs/layout/lib/Flex.d.ts +1 -1
- package/ts3.5/dist/commonjs/popup/lib/Popper.d.ts +1 -9
- package/ts3.5/dist/commonjs/tokens/lib/depth.d.ts +48 -17
- package/ts3.5/dist/es6/layout/lib/Box.d.ts +1 -1
- package/ts3.5/dist/es6/layout/lib/Flex.d.ts +1 -1
- package/ts3.5/dist/es6/popup/lib/Popper.d.ts +1 -9
- package/ts3.5/dist/es6/tokens/lib/depth.d.ts +48 -17
|
@@ -267,8 +267,8 @@ export const getPaddingStyles = (
|
|
|
267
267
|
case 'small':
|
|
268
268
|
return icon
|
|
269
269
|
? iconPosition === 'start'
|
|
270
|
-
? `0
|
|
271
|
-
: `0 ${space.
|
|
270
|
+
? `0 ${space.s} 0 ${space.xs}`
|
|
271
|
+
: `0 ${space.xs} 0 ${space.s}`
|
|
272
272
|
: `0 ${space.s}`;
|
|
273
273
|
|
|
274
274
|
case 'extraSmall':
|
|
@@ -162,12 +162,11 @@ export const getSecondaryButtonColors = (
|
|
|
162
162
|
focus: {
|
|
163
163
|
background: colors.frenchVanilla100,
|
|
164
164
|
icon: colors.blackPepper500,
|
|
165
|
-
border: colors.blackPepper400,
|
|
166
165
|
label: colors.blackPepper500,
|
|
167
166
|
focusRing: focusRing(
|
|
168
167
|
{
|
|
169
|
-
separation:
|
|
170
|
-
innerColor:
|
|
168
|
+
separation: 2,
|
|
169
|
+
innerColor: 'currentColor',
|
|
171
170
|
outerColor: colors.frenchVanilla100,
|
|
172
171
|
},
|
|
173
172
|
theme
|
package/card/lib/Card.tsx
CHANGED
|
@@ -167,8 +167,8 @@ var getPaddingStyles = function (children, size, icon, iconPosition) {
|
|
|
167
167
|
case 'small':
|
|
168
168
|
return icon
|
|
169
169
|
? iconPosition === 'start'
|
|
170
|
-
? "0
|
|
171
|
-
: "0 " + tokens_1.space.
|
|
170
|
+
? "0 " + tokens_1.space.s + " 0 " + tokens_1.space.xs
|
|
171
|
+
: "0 " + tokens_1.space.xs + " 0 " + tokens_1.space.s
|
|
172
172
|
: "0 " + tokens_1.space.s;
|
|
173
173
|
case 'extraSmall':
|
|
174
174
|
return icon
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SecondaryButton.d.ts","sourceRoot":"","sources":["../../../../button/lib/SecondaryButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EACL,cAAc,EAEd,SAAS,EACT,kBAAkB,EAGnB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAC,YAAY,EAAE,WAAW,EAAE,aAAa,EAAC,MAAM,SAAS,CAAC;AAGjE,MAAM,WAAW,oBAAqB,SAAQ,SAAS,EAAE,cAAc;IACrE;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAChC;;;;;OAKG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB;;;OAGG;IACH,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB;;;;OAIG;IACH,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,eAAO,MAAM,eAAe,yEA+C1B,CAAC;AAEH,eAAO,MAAM,wBAAwB,YAC1B,SAAS,GAAG,SAAS,SACvB,kBAAkB,KACxB,
|
|
1
|
+
{"version":3,"file":"SecondaryButton.d.ts","sourceRoot":"","sources":["../../../../button/lib/SecondaryButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EACL,cAAc,EAEd,SAAS,EACT,kBAAkB,EAGnB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAC,YAAY,EAAE,WAAW,EAAE,aAAa,EAAC,MAAM,SAAS,CAAC;AAGjE,MAAM,WAAW,oBAAqB,SAAQ,SAAS,EAAE,cAAc;IACrE;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAChC;;;;;OAKG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB;;;OAGG;IACH,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB;;;;OAIG;IACH,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,eAAO,MAAM,eAAe,yEA+C1B,CAAC;AAEH,eAAO,MAAM,wBAAwB,YAC1B,SAAS,GAAG,SAAS,SACvB,kBAAkB,KACxB,YAoFF,CAAC"}
|
|
@@ -117,11 +117,10 @@ var getSecondaryButtonColors = function (variant, theme) {
|
|
|
117
117
|
focus: {
|
|
118
118
|
background: tokens_1.colors.frenchVanilla100,
|
|
119
119
|
icon: tokens_1.colors.blackPepper500,
|
|
120
|
-
border: tokens_1.colors.blackPepper400,
|
|
121
120
|
label: tokens_1.colors.blackPepper500,
|
|
122
121
|
focusRing: common_1.focusRing({
|
|
123
|
-
separation:
|
|
124
|
-
innerColor:
|
|
122
|
+
separation: 2,
|
|
123
|
+
innerColor: 'currentColor',
|
|
125
124
|
outerColor: tokens_1.colors.frenchVanilla100,
|
|
126
125
|
}, theme),
|
|
127
126
|
},
|
|
@@ -52,7 +52,7 @@ exports.Card = common_1.createComponent('div')({
|
|
|
52
52
|
displayName: 'Card',
|
|
53
53
|
Component: function (_a, ref, Element) {
|
|
54
54
|
var children = _a.children, elemProps = __rest(_a, ["children"]);
|
|
55
|
-
return (React.createElement(layout_1.Box, __assign({ ref: ref, as: Element, depth:
|
|
55
|
+
return (React.createElement(layout_1.Box, __assign({ ref: ref, as: Element, depth: 1, padding: "l", backgroundColor: "frenchVanilla100", border: "1px solid " + tokens_1.colors.soap500, borderRadius: "l" }, elemProps), children));
|
|
56
56
|
},
|
|
57
57
|
subComponents: {
|
|
58
58
|
Heading: CardHeading_1.CardHeading,
|
|
@@ -40,7 +40,7 @@ export declare const boxStyleFn: <P extends BoxProps>(props: P) => {};
|
|
|
40
40
|
*
|
|
41
41
|
* // `Card`'s default values are set using `BoxProps`
|
|
42
42
|
* const Card = (props: CardProps) => (
|
|
43
|
-
* <Box depth={
|
|
43
|
+
* <Box depth={1} padding="m" borderRadius="l" {...props}>Hello, Card!</Box>
|
|
44
44
|
* );
|
|
45
45
|
*
|
|
46
46
|
*/
|
|
@@ -123,7 +123,7 @@ var StyledBoxComponent = styled_1.default('div')({
|
|
|
123
123
|
*
|
|
124
124
|
* // `Card`'s default values are set using `BoxProps`
|
|
125
125
|
* const Card = (props: CardProps) => (
|
|
126
|
-
* <Box depth={
|
|
126
|
+
* <Box depth={1} padding="m" borderRadius="l" {...props}>Hello, Card!</Box>
|
|
127
127
|
* );
|
|
128
128
|
*
|
|
129
129
|
*/
|
|
@@ -15,7 +15,7 @@ export declare type FlexProps = BoxProps & FlexStyleProps;
|
|
|
15
15
|
*
|
|
16
16
|
* // `Card`'s default values are set using `FlexProps`
|
|
17
17
|
* const Card = (props: CardProps) => (
|
|
18
|
-
* <Flex flexDirection="column" alignItems="flex-start" depth={
|
|
18
|
+
* <Flex flexDirection="column" alignItems="flex-start" depth={1} space="m" {...props}>
|
|
19
19
|
* <h1>Hello, Card!</h1>
|
|
20
20
|
* <p>This card uses flexbox to set its layout.</p>
|
|
21
21
|
* </Flex>
|
|
@@ -67,7 +67,7 @@ var StyledFlex = styled_1.default(layout_1.Box)({
|
|
|
67
67
|
*
|
|
68
68
|
* // `Card`'s default values are set using `FlexProps`
|
|
69
69
|
* const Card = (props: CardProps) => (
|
|
70
|
-
* <Flex flexDirection="column" alignItems="flex-start" depth={
|
|
70
|
+
* <Flex flexDirection="column" alignItems="flex-start" depth={1} space="m" {...props}>
|
|
71
71
|
* <h1>Hello, Card!</h1>
|
|
72
72
|
* <p>This card uses flexbox to set its layout.</p>
|
|
73
73
|
* </Flex>
|
|
@@ -52,6 +52,6 @@ exports.ModalCard = common_1.createComponent('div')({
|
|
|
52
52
|
var children = _a.children, model = _a.model, elemProps = __rest(_a, ["children", "model"]);
|
|
53
53
|
var localModel = common_1.useModelContext(popup_1.PopupModelContext, model);
|
|
54
54
|
var props = hooks_1.useModalCard(localModel, elemProps, ref);
|
|
55
|
-
return (React.createElement(popup_1.Popup.Card, __assign({ as: Element, width: 440, borderWidth: 0, margin: "xl" }, props), children));
|
|
55
|
+
return (React.createElement(popup_1.Popup.Card, __assign({ as: Element, width: 440, borderWidth: 0, margin: "xl", depth: 6 }, props), children));
|
|
56
56
|
},
|
|
57
57
|
});
|
|
@@ -18,14 +18,6 @@ export interface PopperProps {
|
|
|
18
18
|
children: ((props: {
|
|
19
19
|
placement: Placement;
|
|
20
20
|
}) => React.ReactNode) | React.ReactNode;
|
|
21
|
-
/**
|
|
22
|
-
* The element that contains the portal children when `portal` is true. It is best to not define
|
|
23
|
-
* this unless you know what you're doing. Popper works with a PopupStack and in order for
|
|
24
|
-
* z-indexes to work correctly, all Popups on your page should live on the same root element
|
|
25
|
-
* otherwise you risk running into rendering issues:
|
|
26
|
-
* https://philipwalton.com/articles/what-no-one-told-you-about-z-index/
|
|
27
|
-
*/
|
|
28
|
-
containerElement?: Element | null;
|
|
29
21
|
/**
|
|
30
22
|
* When provided, this optional callback will be used to determine positioning for the Popper element
|
|
31
23
|
* instead of calling `getBoundingClientRect` on the `anchorElement` prop. Use this when you need
|
|
@@ -58,7 +50,7 @@ export interface PopperProps {
|
|
|
58
50
|
*/
|
|
59
51
|
popperOptions?: Partial<PopperOptions>;
|
|
60
52
|
/**
|
|
61
|
-
* If
|
|
53
|
+
* If false, render the Popper within the
|
|
62
54
|
* DOM hierarchy of its parent. A non-portal Popper will constrained by the parent container
|
|
63
55
|
* overflows. If you set this to `false`, you may experience issues where you content gets cut off
|
|
64
56
|
* by scrollbars or `overflow: hidden`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popper.d.ts","sourceRoot":"","sources":["../../../../popup/lib/Popper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAE3C,oBAAY,SAAS,GAAG,QAAQ,CAAC,SAAS,CAAC;AAC3C,oBAAY,aAAa,GAAG,QAAQ,CAAC,OAAO,CAAC;AAK7C,MAAM,WAAW,WAAW;IAC1B;;;;OAIG;IACH,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,OAAO,GAAG,IAAI,CAAC;IAC1D;;;;;OAKG;IACH,QAAQ,EAAE,CAAC,CAAC,KAAK,EAAE;QAAC,SAAS,EAAE,SAAS,CAAA;KAAC,KAAK,KAAK,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC;IACjF;;;;;;OAMG;IACH,
|
|
1
|
+
{"version":3,"file":"Popper.d.ts","sourceRoot":"","sources":["../../../../popup/lib/Popper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAE3C,oBAAY,SAAS,GAAG,QAAQ,CAAC,SAAS,CAAC;AAC3C,oBAAY,aAAa,GAAG,QAAQ,CAAC,OAAO,CAAC;AAK7C,MAAM,WAAW,WAAW;IAC1B;;;;OAIG;IACH,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,OAAO,GAAG,IAAI,CAAC;IAC1D;;;;;OAKG;IACH,QAAQ,EAAE,CAAC,CAAC,KAAK,EAAE;QAAC,SAAS,EAAE,SAAS,CAAA;KAAC,KAAK,KAAK,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC;IACjF;;;;;;OAMG;IACH,mBAAmB,CAAC,EAAE,MAAM,OAAO,CAAC;IACpC;;;;OAIG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;;;OAKG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,IAAI,CAAC;IACnD;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IACvC;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;CAClD;AAED,eAAO,MAAM,MAAM,oFAQlB,CAAC"}
|
|
@@ -77,7 +77,7 @@ var defaultPopperOptions = {};
|
|
|
77
77
|
// Popper bails early if `open` is false and React hooks cannot be called conditionally,
|
|
78
78
|
// so we're breaking out the open version into another component.
|
|
79
79
|
var OpenPopper = React.forwardRef(function (_a, ref) {
|
|
80
|
-
var anchorElement = _a.anchorElement, getAnchorClientRect = _a.getAnchorClientRect, _b = _a.popperOptions, popperOptions = _b === void 0 ? defaultPopperOptions : _b, _c = _a.placement, popperPlacement = _c === void 0 ? 'bottom' : _c, onPlacementChange = _a.onPlacementChange, children = _a.children, portal = _a.portal,
|
|
80
|
+
var anchorElement = _a.anchorElement, getAnchorClientRect = _a.getAnchorClientRect, _b = _a.popperOptions, popperOptions = _b === void 0 ? defaultPopperOptions : _b, _c = _a.placement, popperPlacement = _c === void 0 ? 'bottom' : _c, onPlacementChange = _a.onPlacementChange, children = _a.children, portal = _a.portal, popperInstanceRef = _a.popperInstanceRef;
|
|
81
81
|
var firstRender = React.useRef(true);
|
|
82
82
|
var _d = common_1.useLocalRef(popperInstanceRef), localRef = _d.localRef, elementRef = _d.elementRef;
|
|
83
83
|
var _e = React.useState(popperPlacement), placement = _e[0], setPlacement = _e[1];
|
|
@@ -128,7 +128,7 @@ var OpenPopper = React.forwardRef(function (_a, ref) {
|
|
|
128
128
|
if (!portal) {
|
|
129
129
|
return contents;
|
|
130
130
|
}
|
|
131
|
-
return ReactDOM.createPortal(contents,
|
|
131
|
+
return ReactDOM.createPortal(contents, stackRef.current);
|
|
132
132
|
});
|
|
133
133
|
// Typescript threw an error about non-callable signatures. Using typeof as a 'function' returns
|
|
134
134
|
// a type of `Function` which isn't descriptive enough for Typescript. We don't do any detection
|
|
@@ -85,7 +85,7 @@ exports.PopupCard = common_1.createComponent('div')({
|
|
|
85
85
|
}, [localModel.state.placement]);
|
|
86
86
|
// As is a Stack that will render an element of `Element`
|
|
87
87
|
var As = common_1.useConstant(function () { return layout_1.Stack.as(Element); });
|
|
88
|
-
return (React.createElement(StyledPopupCard, __assign({ as: As, transformOrigin: transformOrigin, position: "relative", padding: "l", depth:
|
|
88
|
+
return (React.createElement(StyledPopupCard, __assign({ as: As, transformOrigin: transformOrigin, position: "relative", padding: "l", depth: 5, maxWidth: "calc(100vw - " + tokens_1.space.l + ")", spacing: 0, flexDirection: "column", minHeight: 0, maxHeight: "calc(100vh - " + (elemProps.margin
|
|
89
89
|
? tokens_1.space[elemProps.margin] || elemProps.margin
|
|
90
90
|
: tokens_1.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
|
|
91
91
|
}, props), children));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../../../../toast/lib/Toast.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAC,KAAK,EAAC,MAAM,iCAAiC,CAAC;AACtD,OAAO,EAAsB,WAAW,EAAC,MAAM,kCAAkC,CAAC;AAGlF,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAkB,YAAY,EAAqB,MAAM,kCAAkC,CAAC;AAGnG,MAAM,WAAW,UAAW,SAAQ,YAAY,CAAC,OAAO,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC;IACxE;;;OAGG;IACH,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB;;;OAGG;IACH,SAAS,CAAC,EAAE,WAAW,GAAG,MAAM,CAAC;IACjC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAkCD,eAAO,MAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../../../../toast/lib/Toast.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAC,KAAK,EAAC,MAAM,iCAAiC,CAAC;AACtD,OAAO,EAAsB,WAAW,EAAC,MAAM,kCAAkC,CAAC;AAGlF,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAkB,YAAY,EAAqB,MAAM,kCAAkC,CAAC;AAGnG,MAAM,WAAW,UAAW,SAAQ,YAAY,CAAC,OAAO,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC;IACxE;;;OAGG;IACH,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB;;;OAGG;IACH,SAAS,CAAC,EAAE,WAAW,GAAG,MAAM,CAAC;IACjC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAkCD,eAAO,MAAM,KAAK,4DA8ChB,CAAC"}
|
|
@@ -73,7 +73,7 @@ exports.Toast = common_1.createComponent('div')({
|
|
|
73
73
|
_c = _a.iconColor, // needed for TS2742 - https://github.com/microsoft/TypeScript/issues/29808
|
|
74
74
|
iconColor = _c === void 0 ? tokens_1.colors.greenApple400 : _c, onClose = _a.onClose, onActionClick = _a.onActionClick, actionText = _a.actionText, children = _a.children, elemProps = __rest(_a, ["icon", "iconColor", "onClose", "onActionClick", "actionText", "children"]);
|
|
75
75
|
var isInteractive = onClose || onActionClick;
|
|
76
|
-
return (React.createElement(popup_1.Popup.Card, __assign({ ref: ref, as: Element, width: toastWidth, padding: "s", role: isInteractive ? 'dialog' : 'status', "aria-live": isInteractive ? 'off' : 'polite', "aria-atomic": !isInteractive }, elemProps),
|
|
76
|
+
return (React.createElement(popup_1.Popup.Card, __assign({ ref: ref, as: Element, width: toastWidth, padding: "s", depth: 5, role: isInteractive ? 'dialog' : 'status', "aria-live": isInteractive ? 'off' : 'polite', "aria-atomic": !isInteractive }, elemProps),
|
|
77
77
|
onClose && React.createElement(popup_1.Popup.CloseIcon, { "aria-label": "Close", onClick: onClose, size: "small" }),
|
|
78
78
|
React.createElement(popup_1.Popup.Body, null,
|
|
79
79
|
React.createElement(ToastContentContainer, { onClose: onClose },
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
export declare type CanvasDepth = {
|
|
2
2
|
/**
|
|
3
|
-
* ### Depth
|
|
4
|
-
* Used for
|
|
3
|
+
* ### Depth None
|
|
4
|
+
* Used for removing existing depth
|
|
5
5
|
*
|
|
6
6
|
* @example
|
|
7
7
|
* ```ts
|
|
8
8
|
* import { depth } from '@workday/canvas-kit-react/tokens';
|
|
9
9
|
*
|
|
10
|
-
* const
|
|
11
|
-
* ...depth.
|
|
10
|
+
* const noDepthCardStyles = {
|
|
11
|
+
* ...depth.none,
|
|
12
12
|
* };
|
|
13
13
|
* ```
|
|
14
14
|
*/
|
|
15
|
-
|
|
16
|
-
boxShadow: '
|
|
15
|
+
none: {
|
|
16
|
+
boxShadow: 'none';
|
|
17
17
|
};
|
|
18
18
|
/**
|
|
19
19
|
* ### Depth 1
|
|
20
|
-
* Used for minimal offset
|
|
20
|
+
* Used for minimal offset and Cards
|
|
21
21
|
*
|
|
22
22
|
* @example
|
|
23
23
|
* ```ts
|
|
@@ -29,11 +29,11 @@ export declare type CanvasDepth = {
|
|
|
29
29
|
* ```
|
|
30
30
|
*/
|
|
31
31
|
1: {
|
|
32
|
-
boxShadow: '0px
|
|
32
|
+
boxShadow: '0px 1px 4px rgba(0, 0, 0, 0.2), 0px 2px 8px rgba(0, 0, 0, 0.16)';
|
|
33
33
|
};
|
|
34
34
|
/**
|
|
35
35
|
* ### Depth 2
|
|
36
|
-
* Used for
|
|
36
|
+
* Used for Top navigation, Bottom navigation
|
|
37
37
|
*
|
|
38
38
|
* @example
|
|
39
39
|
* ```ts
|
|
@@ -45,11 +45,11 @@ export declare type CanvasDepth = {
|
|
|
45
45
|
* ```
|
|
46
46
|
*/
|
|
47
47
|
2: {
|
|
48
|
-
boxShadow: '0px
|
|
48
|
+
boxShadow: '0px 2px 8px rgba(0, 0, 0, 0.2), 0px 4px 16px rgba(0, 0, 0, 0.16)';
|
|
49
49
|
};
|
|
50
50
|
/**
|
|
51
51
|
* ### Depth 3
|
|
52
|
-
* Used for
|
|
52
|
+
* Used for FABs, Menus
|
|
53
53
|
*
|
|
54
54
|
* @example
|
|
55
55
|
* ```ts
|
|
@@ -61,11 +61,11 @@ export declare type CanvasDepth = {
|
|
|
61
61
|
* ```
|
|
62
62
|
*/
|
|
63
63
|
3: {
|
|
64
|
-
boxShadow: '0px
|
|
64
|
+
boxShadow: '0px 3px 12px rgba(0, 0, 0, 0.2), 0px 6px 24px rgba(0, 0, 0, 0.16)';
|
|
65
65
|
};
|
|
66
66
|
/**
|
|
67
67
|
* ### Depth 4
|
|
68
|
-
*
|
|
68
|
+
*
|
|
69
69
|
*
|
|
70
70
|
* @example
|
|
71
71
|
* ```ts
|
|
@@ -77,8 +77,39 @@ export declare type CanvasDepth = {
|
|
|
77
77
|
* ```
|
|
78
78
|
*/
|
|
79
79
|
4: {
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
boxShadow: '0px 4px 16px rgba(0, 0, 0, 0.2), 0px 8px 32px rgba(0, 0, 0, 0.16)';
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* ### Depth 5
|
|
84
|
+
* Used for Popups, Toast Messages, Dialogs, Side Panels without opacity overlay behavior
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```ts
|
|
88
|
+
* import { depth } from '@workday/canvas-kit-react/tokens';
|
|
89
|
+
*
|
|
90
|
+
* const cardStyles = {
|
|
91
|
+
* ...depth[5],
|
|
92
|
+
* };
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
95
|
+
5: {
|
|
96
|
+
boxShadow: '0px 5px 20px rgba(0, 0, 0, 0.2), 0px 10px 40px rgba(0, 0, 0, 0.16)';
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* ### Depth 6
|
|
100
|
+
* Used for components with opacity overlay behavior such as Modal or Side Panels
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```ts
|
|
104
|
+
* import { depth } from '@workday/canvas-kit-react/tokens';
|
|
105
|
+
*
|
|
106
|
+
* const cardStyles = {
|
|
107
|
+
* ...depth[6],
|
|
108
|
+
* };
|
|
109
|
+
* ```
|
|
110
|
+
*/
|
|
111
|
+
6: {
|
|
112
|
+
boxShadow: '0px 6px 24px rgba(0, 0, 0, 0.2), 0px 12px 48px rgba(0, 0, 0, 0.16)';
|
|
82
113
|
};
|
|
83
114
|
};
|
|
84
115
|
declare type ValueOf<T> = T[keyof T];
|
|
@@ -88,8 +119,8 @@ export declare type CanvasDepthValues = ValueOf<CanvasDepth>;
|
|
|
88
119
|
*
|
|
89
120
|
* Depth is the relative distance between surfaces in the z-axis.
|
|
90
121
|
* It provides delineation, focus, and priority with shadows and layering.
|
|
91
|
-
* There are
|
|
92
|
-
*
|
|
122
|
+
* There are seven depth levels, `none`, `1`, `2`, `3`, `4`, `5` and `6`.
|
|
123
|
+
* `none` is a special value to remove depth styles. All other levels only apply box-shadow styles.
|
|
93
124
|
*
|
|
94
125
|
* @example
|
|
95
126
|
* ```tsx
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"depth.d.ts","sourceRoot":"","sources":["../../../../tokens/lib/depth.ts"],"names":[],"mappings":"AAAA,oBAAY,WAAW,GAAG;IACxB;;;;;;;;;;;;OAYG;IACH,
|
|
1
|
+
{"version":3,"file":"depth.d.ts","sourceRoot":"","sources":["../../../../tokens/lib/depth.ts"],"names":[],"mappings":"AAAA,oBAAY,WAAW,GAAG;IACxB;;;;;;;;;;;;OAYG;IACH,IAAI,EAAE;QACJ,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IACF;;;;;;;;;;;;OAYG;IACH,CAAC,EAAE;QACD,SAAS,EAAE,iEAAiE,CAAC;KAC9E,CAAC;IACF;;;;;;;;;;;;OAYG;IACH,CAAC,EAAE;QACD,SAAS,EAAE,kEAAkE,CAAC;KAC/E,CAAC;IACF;;;;;;;;;;;;OAYG;IACH,CAAC,EAAE;QACD,SAAS,EAAE,mEAAmE,CAAC;KAChF,CAAC;IACF;;;;;;;;;;;;OAYG;IACH,CAAC,EAAE;QACD,SAAS,EAAE,mEAAmE,CAAC;KAChF,CAAC;IACF;;;;;;;;;;;;OAYG;IACH,CAAC,EAAE;QACD,SAAS,EAAE,oEAAoE,CAAC;KACjF,CAAC;IACF;;;;;;;;;;;;OAYG;IACH,CAAC,EAAE;QACD,SAAS,EAAE,oEAAoE,CAAC;KACjF,CAAC;CACH,CAAC;AAEF,aAAK,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAC7B,oBAAY,iBAAiB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AAErD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,KAAK,EAAE,WAsBnB,CAAC"}
|
|
@@ -6,8 +6,8 @@ exports.depth = void 0;
|
|
|
6
6
|
*
|
|
7
7
|
* Depth is the relative distance between surfaces in the z-axis.
|
|
8
8
|
* It provides delineation, focus, and priority with shadows and layering.
|
|
9
|
-
* There are
|
|
10
|
-
*
|
|
9
|
+
* There are seven depth levels, `none`, `1`, `2`, `3`, `4`, `5` and `6`.
|
|
10
|
+
* `none` is a special value to remove depth styles. All other levels only apply box-shadow styles.
|
|
11
11
|
*
|
|
12
12
|
* @example
|
|
13
13
|
* ```tsx
|
|
@@ -24,20 +24,25 @@ exports.depth = void 0;
|
|
|
24
24
|
*
|
|
25
25
|
*/
|
|
26
26
|
exports.depth = {
|
|
27
|
-
|
|
28
|
-
boxShadow: '
|
|
27
|
+
none: {
|
|
28
|
+
boxShadow: 'none',
|
|
29
29
|
},
|
|
30
30
|
1: {
|
|
31
|
-
boxShadow: '0px
|
|
31
|
+
boxShadow: '0px 1px 4px rgba(0, 0, 0, 0.2), 0px 2px 8px rgba(0, 0, 0, 0.16)',
|
|
32
32
|
},
|
|
33
33
|
2: {
|
|
34
|
-
boxShadow: '0px
|
|
34
|
+
boxShadow: '0px 2px 8px rgba(0, 0, 0, 0.2), 0px 4px 16px rgba(0, 0, 0, 0.16)',
|
|
35
35
|
},
|
|
36
36
|
3: {
|
|
37
|
-
boxShadow: '0px
|
|
37
|
+
boxShadow: '0px 3px 12px rgba(0, 0, 0, 0.2), 0px 6px 24px rgba(0, 0, 0, 0.16)',
|
|
38
38
|
},
|
|
39
39
|
4: {
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
boxShadow: '0px 4px 16px rgba(0, 0, 0, 0.2), 0px 8px 32px rgba(0, 0, 0, 0.16)',
|
|
41
|
+
},
|
|
42
|
+
5: {
|
|
43
|
+
boxShadow: '0px 5px 20px rgba(0, 0, 0, 0.2), 0px 10px 40px rgba(0, 0, 0, 0.16)',
|
|
44
|
+
},
|
|
45
|
+
6: {
|
|
46
|
+
boxShadow: '0px 6px 24px rgba(0, 0, 0, 0.2), 0px 12px 48px rgba(0, 0, 0, 0.16)',
|
|
42
47
|
},
|
|
43
48
|
};
|
|
@@ -144,8 +144,8 @@ export var getPaddingStyles = function (children, size, icon, iconPosition) {
|
|
|
144
144
|
case 'small':
|
|
145
145
|
return icon
|
|
146
146
|
? iconPosition === 'start'
|
|
147
|
-
? "0
|
|
148
|
-
: "0 " + space.
|
|
147
|
+
? "0 " + space.s + " 0 " + space.xs
|
|
148
|
+
: "0 " + space.xs + " 0 " + space.s
|
|
149
149
|
: "0 " + space.s;
|
|
150
150
|
case 'extraSmall':
|
|
151
151
|
return icon
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SecondaryButton.d.ts","sourceRoot":"","sources":["../../../../button/lib/SecondaryButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EACL,cAAc,EAEd,SAAS,EACT,kBAAkB,EAGnB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAC,YAAY,EAAE,WAAW,EAAE,aAAa,EAAC,MAAM,SAAS,CAAC;AAGjE,MAAM,WAAW,oBAAqB,SAAQ,SAAS,EAAE,cAAc;IACrE;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAChC;;;;;OAKG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB;;;OAGG;IACH,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB;;;;OAIG;IACH,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,eAAO,MAAM,eAAe,yEA+C1B,CAAC;AAEH,eAAO,MAAM,wBAAwB,YAC1B,SAAS,GAAG,SAAS,SACvB,kBAAkB,KACxB,
|
|
1
|
+
{"version":3,"file":"SecondaryButton.d.ts","sourceRoot":"","sources":["../../../../button/lib/SecondaryButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EACL,cAAc,EAEd,SAAS,EACT,kBAAkB,EAGnB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAC,YAAY,EAAE,WAAW,EAAE,aAAa,EAAC,MAAM,SAAS,CAAC;AAGjE,MAAM,WAAW,oBAAqB,SAAQ,SAAS,EAAE,cAAc;IACrE;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAChC;;;;;OAKG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB;;;OAGG;IACH,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB;;;;OAIG;IACH,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,eAAO,MAAM,eAAe,yEA+C1B,CAAC;AAEH,eAAO,MAAM,wBAAwB,YAC1B,SAAS,GAAG,SAAS,SACvB,kBAAkB,KACxB,YAoFF,CAAC"}
|
|
@@ -95,11 +95,10 @@ export var getSecondaryButtonColors = function (variant, theme) {
|
|
|
95
95
|
focus: {
|
|
96
96
|
background: colors.frenchVanilla100,
|
|
97
97
|
icon: colors.blackPepper500,
|
|
98
|
-
border: colors.blackPepper400,
|
|
99
98
|
label: colors.blackPepper500,
|
|
100
99
|
focusRing: focusRing({
|
|
101
|
-
separation:
|
|
102
|
-
innerColor:
|
|
100
|
+
separation: 2,
|
|
101
|
+
innerColor: 'currentColor',
|
|
103
102
|
outerColor: colors.frenchVanilla100,
|
|
104
103
|
}, theme),
|
|
105
104
|
},
|
|
@@ -30,7 +30,7 @@ export var Card = createComponent('div')({
|
|
|
30
30
|
displayName: 'Card',
|
|
31
31
|
Component: function (_a, ref, Element) {
|
|
32
32
|
var children = _a.children, elemProps = __rest(_a, ["children"]);
|
|
33
|
-
return (React.createElement(Box, __assign({ ref: ref, as: Element, depth:
|
|
33
|
+
return (React.createElement(Box, __assign({ ref: ref, as: Element, depth: 1, padding: "l", backgroundColor: "frenchVanilla100", border: "1px solid " + colors.soap500, borderRadius: "l" }, elemProps), children));
|
|
34
34
|
},
|
|
35
35
|
subComponents: {
|
|
36
36
|
Heading: CardHeading,
|
|
@@ -40,7 +40,7 @@ export declare const boxStyleFn: <P extends BoxProps>(props: P) => {};
|
|
|
40
40
|
*
|
|
41
41
|
* // `Card`'s default values are set using `BoxProps`
|
|
42
42
|
* const Card = (props: CardProps) => (
|
|
43
|
-
* <Box depth={
|
|
43
|
+
* <Box depth={1} padding="m" borderRadius="l" {...props}>Hello, Card!</Box>
|
|
44
44
|
* );
|
|
45
45
|
*
|
|
46
46
|
*/
|
|
@@ -97,7 +97,7 @@ var StyledBoxComponent = styled('div')({
|
|
|
97
97
|
*
|
|
98
98
|
* // `Card`'s default values are set using `BoxProps`
|
|
99
99
|
* const Card = (props: CardProps) => (
|
|
100
|
-
* <Box depth={
|
|
100
|
+
* <Box depth={1} padding="m" borderRadius="l" {...props}>Hello, Card!</Box>
|
|
101
101
|
* );
|
|
102
102
|
*
|
|
103
103
|
*/
|
|
@@ -15,7 +15,7 @@ export declare type FlexProps = BoxProps & FlexStyleProps;
|
|
|
15
15
|
*
|
|
16
16
|
* // `Card`'s default values are set using `FlexProps`
|
|
17
17
|
* const Card = (props: CardProps) => (
|
|
18
|
-
* <Flex flexDirection="column" alignItems="flex-start" depth={
|
|
18
|
+
* <Flex flexDirection="column" alignItems="flex-start" depth={1} space="m" {...props}>
|
|
19
19
|
* <h1>Hello, Card!</h1>
|
|
20
20
|
* <p>This card uses flexbox to set its layout.</p>
|
|
21
21
|
* </Flex>
|
|
@@ -42,7 +42,7 @@ var StyledFlex = styled(Box)({
|
|
|
42
42
|
*
|
|
43
43
|
* // `Card`'s default values are set using `FlexProps`
|
|
44
44
|
* const Card = (props: CardProps) => (
|
|
45
|
-
* <Flex flexDirection="column" alignItems="flex-start" depth={
|
|
45
|
+
* <Flex flexDirection="column" alignItems="flex-start" depth={1} space="m" {...props}>
|
|
46
46
|
* <h1>Hello, Card!</h1>
|
|
47
47
|
* <p>This card uses flexbox to set its layout.</p>
|
|
48
48
|
* </Flex>
|
|
@@ -30,6 +30,6 @@ export var ModalCard = createComponent('div')({
|
|
|
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 = useModalCard(localModel, elemProps, ref);
|
|
33
|
-
return (React.createElement(Popup.Card, __assign({ as: Element, width: 440, borderWidth: 0, margin: "xl" }, props), children));
|
|
33
|
+
return (React.createElement(Popup.Card, __assign({ as: Element, width: 440, borderWidth: 0, margin: "xl", depth: 6 }, props), children));
|
|
34
34
|
},
|
|
35
35
|
});
|
|
@@ -18,14 +18,6 @@ export interface PopperProps {
|
|
|
18
18
|
children: ((props: {
|
|
19
19
|
placement: Placement;
|
|
20
20
|
}) => React.ReactNode) | React.ReactNode;
|
|
21
|
-
/**
|
|
22
|
-
* The element that contains the portal children when `portal` is true. It is best to not define
|
|
23
|
-
* this unless you know what you're doing. Popper works with a PopupStack and in order for
|
|
24
|
-
* z-indexes to work correctly, all Popups on your page should live on the same root element
|
|
25
|
-
* otherwise you risk running into rendering issues:
|
|
26
|
-
* https://philipwalton.com/articles/what-no-one-told-you-about-z-index/
|
|
27
|
-
*/
|
|
28
|
-
containerElement?: Element | null;
|
|
29
21
|
/**
|
|
30
22
|
* When provided, this optional callback will be used to determine positioning for the Popper element
|
|
31
23
|
* instead of calling `getBoundingClientRect` on the `anchorElement` prop. Use this when you need
|
|
@@ -58,7 +50,7 @@ export interface PopperProps {
|
|
|
58
50
|
*/
|
|
59
51
|
popperOptions?: Partial<PopperOptions>;
|
|
60
52
|
/**
|
|
61
|
-
* If
|
|
53
|
+
* If false, render the Popper within the
|
|
62
54
|
* DOM hierarchy of its parent. A non-portal Popper will constrained by the parent container
|
|
63
55
|
* overflows. If you set this to `false`, you may experience issues where you content gets cut off
|
|
64
56
|
* by scrollbars or `overflow: hidden`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popper.d.ts","sourceRoot":"","sources":["../../../../popup/lib/Popper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAE3C,oBAAY,SAAS,GAAG,QAAQ,CAAC,SAAS,CAAC;AAC3C,oBAAY,aAAa,GAAG,QAAQ,CAAC,OAAO,CAAC;AAK7C,MAAM,WAAW,WAAW;IAC1B;;;;OAIG;IACH,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,OAAO,GAAG,IAAI,CAAC;IAC1D;;;;;OAKG;IACH,QAAQ,EAAE,CAAC,CAAC,KAAK,EAAE;QAAC,SAAS,EAAE,SAAS,CAAA;KAAC,KAAK,KAAK,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC;IACjF;;;;;;OAMG;IACH,
|
|
1
|
+
{"version":3,"file":"Popper.d.ts","sourceRoot":"","sources":["../../../../popup/lib/Popper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAE3C,oBAAY,SAAS,GAAG,QAAQ,CAAC,SAAS,CAAC;AAC3C,oBAAY,aAAa,GAAG,QAAQ,CAAC,OAAO,CAAC;AAK7C,MAAM,WAAW,WAAW;IAC1B;;;;OAIG;IACH,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,OAAO,GAAG,IAAI,CAAC;IAC1D;;;;;OAKG;IACH,QAAQ,EAAE,CAAC,CAAC,KAAK,EAAE;QAAC,SAAS,EAAE,SAAS,CAAA;KAAC,KAAK,KAAK,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC;IACjF;;;;;;OAMG;IACH,mBAAmB,CAAC,EAAE,MAAM,OAAO,CAAC;IACpC;;;;OAIG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;;;OAKG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,IAAI,CAAC;IACnD;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IACvC;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;CAClD;AAED,eAAO,MAAM,MAAM,oFAQlB,CAAC"}
|
|
@@ -55,7 +55,7 @@ var defaultPopperOptions = {};
|
|
|
55
55
|
// Popper bails early if `open` is false and React hooks cannot be called conditionally,
|
|
56
56
|
// so we're breaking out the open version into another component.
|
|
57
57
|
var OpenPopper = React.forwardRef(function (_a, ref) {
|
|
58
|
-
var anchorElement = _a.anchorElement, getAnchorClientRect = _a.getAnchorClientRect, _b = _a.popperOptions, popperOptions = _b === void 0 ? defaultPopperOptions : _b, _c = _a.placement, popperPlacement = _c === void 0 ? 'bottom' : _c, onPlacementChange = _a.onPlacementChange, children = _a.children, portal = _a.portal,
|
|
58
|
+
var anchorElement = _a.anchorElement, getAnchorClientRect = _a.getAnchorClientRect, _b = _a.popperOptions, popperOptions = _b === void 0 ? defaultPopperOptions : _b, _c = _a.placement, popperPlacement = _c === void 0 ? 'bottom' : _c, onPlacementChange = _a.onPlacementChange, children = _a.children, portal = _a.portal, popperInstanceRef = _a.popperInstanceRef;
|
|
59
59
|
var firstRender = React.useRef(true);
|
|
60
60
|
var _d = useLocalRef(popperInstanceRef), localRef = _d.localRef, elementRef = _d.elementRef;
|
|
61
61
|
var _e = React.useState(popperPlacement), placement = _e[0], setPlacement = _e[1];
|
|
@@ -106,7 +106,7 @@ var OpenPopper = React.forwardRef(function (_a, ref) {
|
|
|
106
106
|
if (!portal) {
|
|
107
107
|
return contents;
|
|
108
108
|
}
|
|
109
|
-
return ReactDOM.createPortal(contents,
|
|
109
|
+
return ReactDOM.createPortal(contents, stackRef.current);
|
|
110
110
|
});
|
|
111
111
|
// Typescript threw an error about non-callable signatures. Using typeof as a 'function' returns
|
|
112
112
|
// a type of `Function` which isn't descriptive enough for Typescript. We don't do any detection
|
|
@@ -63,7 +63,7 @@ export var PopupCard = createComponent('div')({
|
|
|
63
63
|
}, [localModel.state.placement]);
|
|
64
64
|
// As is a Stack that will render an element of `Element`
|
|
65
65
|
var As = useConstant(function () { return Stack.as(Element); });
|
|
66
|
-
return (React.createElement(StyledPopupCard, __assign({ as: As, transformOrigin: transformOrigin, position: "relative", padding: "l", depth:
|
|
66
|
+
return (React.createElement(StyledPopupCard, __assign({ as: As, transformOrigin: transformOrigin, position: "relative", padding: "l", depth: 5, maxWidth: "calc(100vw - " + space.l + ")", spacing: 0, flexDirection: "column", minHeight: 0, maxHeight: "calc(100vh - " + (elemProps.margin
|
|
67
67
|
? space[elemProps.margin] || elemProps.margin
|
|
68
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
69
|
}, props), children));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../../../../toast/lib/Toast.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAC,KAAK,EAAC,MAAM,iCAAiC,CAAC;AACtD,OAAO,EAAsB,WAAW,EAAC,MAAM,kCAAkC,CAAC;AAGlF,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAkB,YAAY,EAAqB,MAAM,kCAAkC,CAAC;AAGnG,MAAM,WAAW,UAAW,SAAQ,YAAY,CAAC,OAAO,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC;IACxE;;;OAGG;IACH,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB;;;OAGG;IACH,SAAS,CAAC,EAAE,WAAW,GAAG,MAAM,CAAC;IACjC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAkCD,eAAO,MAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../../../../toast/lib/Toast.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAC,KAAK,EAAC,MAAM,iCAAiC,CAAC;AACtD,OAAO,EAAsB,WAAW,EAAC,MAAM,kCAAkC,CAAC;AAGlF,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAkB,YAAY,EAAqB,MAAM,kCAAkC,CAAC;AAGnG,MAAM,WAAW,UAAW,SAAQ,YAAY,CAAC,OAAO,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC;IACxE;;;OAGG;IACH,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB;;;OAGG;IACH,SAAS,CAAC,EAAE,WAAW,GAAG,MAAM,CAAC;IACjC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAkCD,eAAO,MAAM,KAAK,4DA8ChB,CAAC"}
|
|
@@ -51,7 +51,7 @@ export var Toast = createComponent('div')({
|
|
|
51
51
|
_c = _a.iconColor, // needed for TS2742 - https://github.com/microsoft/TypeScript/issues/29808
|
|
52
52
|
iconColor = _c === void 0 ? colors.greenApple400 : _c, onClose = _a.onClose, onActionClick = _a.onActionClick, actionText = _a.actionText, children = _a.children, elemProps = __rest(_a, ["icon", "iconColor", "onClose", "onActionClick", "actionText", "children"]);
|
|
53
53
|
var isInteractive = onClose || onActionClick;
|
|
54
|
-
return (React.createElement(Popup.Card, __assign({ ref: ref, as: Element, width: toastWidth, padding: "s", role: isInteractive ? 'dialog' : 'status', "aria-live": isInteractive ? 'off' : 'polite', "aria-atomic": !isInteractive }, elemProps),
|
|
54
|
+
return (React.createElement(Popup.Card, __assign({ ref: ref, as: Element, width: toastWidth, padding: "s", depth: 5, role: isInteractive ? 'dialog' : 'status', "aria-live": isInteractive ? 'off' : 'polite', "aria-atomic": !isInteractive }, elemProps),
|
|
55
55
|
onClose && React.createElement(Popup.CloseIcon, { "aria-label": "Close", onClick: onClose, size: "small" }),
|
|
56
56
|
React.createElement(Popup.Body, null,
|
|
57
57
|
React.createElement(ToastContentContainer, { onClose: onClose },
|