@workday/canvas-kit-react 8.0.0-alpha.150-next.2 → 8.0.0-alpha.155-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/banner/lib/Banner.tsx +3 -6
- package/card/lib/CardBody.tsx +3 -6
- package/card/lib/CardHeading.tsx +13 -10
- package/checkbox/lib/Checkbox.tsx +9 -24
- package/common/lib/utils/useModalityType.ts +13 -13
- package/dist/commonjs/banner/lib/Banner.d.ts.map +1 -1
- package/dist/commonjs/banner/lib/Banner.js +2 -4
- package/dist/commonjs/card/lib/Card.d.ts +1 -1
- package/dist/commonjs/card/lib/CardBody.d.ts +1 -1
- package/dist/commonjs/card/lib/CardBody.d.ts.map +1 -1
- package/dist/commonjs/card/lib/CardBody.js +1 -6
- package/dist/commonjs/card/lib/CardHeading.d.ts.map +1 -1
- package/dist/commonjs/card/lib/CardHeading.js +2 -10
- package/dist/commonjs/checkbox/lib/Checkbox.d.ts.map +1 -1
- package/dist/commonjs/checkbox/lib/Checkbox.js +2 -13
- package/dist/commonjs/common/lib/utils/useModalityType.js +13 -13
- package/dist/commonjs/dialog/lib/Dialog.d.ts +1 -1
- package/dist/commonjs/form-field/lib/Hint.d.ts.map +1 -1
- package/dist/commonjs/form-field/lib/Hint.js +5 -13
- package/dist/commonjs/index.d.ts +1 -0
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +1 -0
- package/dist/commonjs/layout/index.d.ts +2 -0
- package/dist/commonjs/layout/index.d.ts.map +1 -1
- package/dist/commonjs/layout/index.js +2 -0
- package/dist/commonjs/layout/lib/Box.d.ts +4 -2
- package/dist/commonjs/layout/lib/Box.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/Box.js +27 -3
- package/dist/commonjs/layout/lib/Flex.d.ts +1 -1
- package/dist/commonjs/layout/lib/Flex.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/Grid.d.ts +2 -2
- package/dist/commonjs/layout/lib/Stack.d.ts +4 -4
- package/dist/commonjs/layout/lib/utils/color.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/utils/color.js +1 -0
- package/dist/commonjs/layout/lib/utils/font.d.ts +29 -0
- package/dist/commonjs/layout/lib/utils/font.d.ts.map +1 -0
- package/dist/commonjs/layout/lib/utils/font.js +57 -0
- package/dist/commonjs/layout/lib/utils/text.d.ts +35 -0
- package/dist/commonjs/layout/lib/utils/text.d.ts.map +1 -0
- package/dist/commonjs/layout/lib/utils/text.js +48 -0
- package/dist/commonjs/modal/lib/Modal.d.ts +1 -1
- package/dist/commonjs/modal/lib/ModalCard.d.ts.map +1 -1
- package/dist/commonjs/modal/lib/ModalCard.js +15 -1
- package/dist/commonjs/modal/lib/ModalOverlay.d.ts.map +1 -1
- package/dist/commonjs/modal/lib/ModalOverlay.js +26 -16
- package/dist/commonjs/modal/lib/hooks/useCloseOnOverlayClick.d.ts.map +1 -1
- package/dist/commonjs/modal/lib/hooks/useCloseOnOverlayClick.js +3 -1
- package/dist/commonjs/pagination/lib/Pagination/AdditionalDetails.d.ts.map +1 -1
- package/dist/commonjs/pagination/lib/Pagination/AdditionalDetails.js +5 -4
- package/dist/commonjs/pagination/lib/Pagination/GoTo/Label.d.ts.map +1 -1
- package/dist/commonjs/pagination/lib/Pagination/GoTo/Label.js +2 -4
- package/dist/commonjs/popup/lib/Popup.d.ts +1 -1
- package/dist/commonjs/popup/lib/PopupBody.d.ts +1 -1
- package/dist/commonjs/popup/lib/PopupCard.d.ts.map +1 -1
- package/dist/commonjs/popup/lib/PopupCard.js +18 -10
- package/dist/commonjs/popup/lib/PopupPopper.d.ts +2 -3
- package/dist/commonjs/popup/lib/PopupPopper.d.ts.map +1 -1
- package/dist/commonjs/radio/lib/Radio.d.ts.map +1 -1
- package/dist/commonjs/radio/lib/Radio.js +2 -13
- package/dist/commonjs/side-panel/lib/SidePanel.d.ts.map +1 -1
- package/dist/commonjs/side-panel/lib/SidePanel.js +2 -2
- package/dist/commonjs/tabs/lib/TabsItem.d.ts +1 -1
- package/dist/commonjs/text/index.d.ts +4 -0
- package/dist/commonjs/text/index.d.ts.map +1 -0
- package/dist/commonjs/text/index.js +15 -0
- package/dist/commonjs/text/lib/LabelText.d.ts +8 -0
- package/dist/commonjs/text/lib/LabelText.d.ts.map +1 -0
- package/dist/commonjs/text/lib/LabelText.js +51 -0
- package/dist/commonjs/text/lib/Text.d.ts +14 -0
- package/dist/commonjs/text/lib/Text.d.ts.map +1 -0
- package/dist/commonjs/text/lib/Text.js +90 -0
- package/dist/commonjs/text/lib/TypeLevelComponents.d.ts +13 -0
- package/dist/commonjs/text/lib/TypeLevelComponents.d.ts.map +1 -0
- package/dist/commonjs/text/lib/TypeLevelComponents.js +79 -0
- package/dist/es6/banner/lib/Banner.d.ts.map +1 -1
- package/dist/es6/banner/lib/Banner.js +2 -4
- package/dist/es6/card/lib/Card.d.ts +1 -1
- package/dist/es6/card/lib/CardBody.d.ts +1 -1
- package/dist/es6/card/lib/CardBody.d.ts.map +1 -1
- package/dist/es6/card/lib/CardBody.js +1 -3
- package/dist/es6/card/lib/CardHeading.d.ts.map +1 -1
- package/dist/es6/card/lib/CardHeading.js +2 -7
- package/dist/es6/checkbox/lib/Checkbox.d.ts.map +1 -1
- package/dist/es6/checkbox/lib/Checkbox.js +3 -14
- package/dist/es6/common/lib/utils/useModalityType.js +13 -13
- package/dist/es6/dialog/lib/Dialog.d.ts +1 -1
- package/dist/es6/form-field/lib/Hint.d.ts.map +1 -1
- package/dist/es6/form-field/lib/Hint.js +6 -14
- package/dist/es6/index.d.ts +1 -0
- package/dist/es6/index.d.ts.map +1 -1
- package/dist/es6/index.js +1 -0
- package/dist/es6/layout/index.d.ts +2 -0
- package/dist/es6/layout/index.d.ts.map +1 -1
- package/dist/es6/layout/index.js +2 -0
- package/dist/es6/layout/lib/Box.d.ts +4 -2
- package/dist/es6/layout/lib/Box.d.ts.map +1 -1
- package/dist/es6/layout/lib/Box.js +27 -3
- package/dist/es6/layout/lib/Flex.d.ts +1 -1
- package/dist/es6/layout/lib/Flex.d.ts.map +1 -1
- package/dist/es6/layout/lib/Grid.d.ts +2 -2
- package/dist/es6/layout/lib/Stack.d.ts +4 -4
- package/dist/es6/layout/lib/utils/color.d.ts.map +1 -1
- package/dist/es6/layout/lib/utils/color.js +2 -1
- package/dist/es6/layout/lib/utils/font.d.ts +29 -0
- package/dist/es6/layout/lib/utils/font.d.ts.map +1 -0
- package/dist/es6/layout/lib/utils/font.js +53 -0
- package/dist/es6/layout/lib/utils/text.d.ts +35 -0
- package/dist/es6/layout/lib/utils/text.d.ts.map +1 -0
- package/dist/es6/layout/lib/utils/text.js +44 -0
- package/dist/es6/modal/lib/Modal.d.ts +1 -1
- package/dist/es6/modal/lib/ModalCard.d.ts.map +1 -1
- package/dist/es6/modal/lib/ModalCard.js +16 -2
- package/dist/es6/modal/lib/ModalOverlay.d.ts.map +1 -1
- package/dist/es6/modal/lib/ModalOverlay.js +26 -16
- package/dist/es6/modal/lib/hooks/useCloseOnOverlayClick.d.ts.map +1 -1
- package/dist/es6/modal/lib/hooks/useCloseOnOverlayClick.js +4 -2
- package/dist/es6/pagination/lib/Pagination/AdditionalDetails.d.ts.map +1 -1
- package/dist/es6/pagination/lib/Pagination/AdditionalDetails.js +6 -5
- package/dist/es6/pagination/lib/Pagination/GoTo/Label.d.ts.map +1 -1
- package/dist/es6/pagination/lib/Pagination/GoTo/Label.js +2 -4
- package/dist/es6/popup/lib/Popup.d.ts +1 -1
- package/dist/es6/popup/lib/PopupBody.d.ts +1 -1
- package/dist/es6/popup/lib/PopupCard.d.ts.map +1 -1
- package/dist/es6/popup/lib/PopupCard.js +18 -10
- package/dist/es6/popup/lib/PopupPopper.d.ts +2 -3
- package/dist/es6/popup/lib/PopupPopper.d.ts.map +1 -1
- package/dist/es6/radio/lib/Radio.d.ts.map +1 -1
- package/dist/es6/radio/lib/Radio.js +3 -14
- package/dist/es6/side-panel/lib/SidePanel.d.ts.map +1 -1
- package/dist/es6/side-panel/lib/SidePanel.js +3 -3
- package/dist/es6/tabs/lib/TabsItem.d.ts +1 -1
- package/dist/es6/text/index.d.ts +4 -0
- package/dist/es6/text/index.d.ts.map +1 -0
- package/dist/es6/text/index.js +3 -0
- package/dist/es6/text/lib/LabelText.d.ts +8 -0
- package/dist/es6/text/lib/LabelText.d.ts.map +1 -0
- package/dist/es6/text/lib/LabelText.js +29 -0
- package/dist/es6/text/lib/Text.d.ts +14 -0
- package/dist/es6/text/lib/Text.d.ts.map +1 -0
- package/dist/es6/text/lib/Text.js +68 -0
- package/dist/es6/text/lib/TypeLevelComponents.d.ts +13 -0
- package/dist/es6/text/lib/TypeLevelComponents.d.ts.map +1 -0
- package/dist/es6/text/lib/TypeLevelComponents.js +57 -0
- package/form-field/lib/Hint.tsx +8 -19
- package/index.ts +1 -0
- package/layout/index.ts +2 -0
- package/layout/lib/Box.tsx +34 -4
- package/layout/lib/utils/color.ts +7 -2
- package/layout/lib/utils/font.ts +67 -0
- package/layout/lib/utils/text.ts +57 -0
- package/modal/lib/ModalCard.tsx +17 -4
- package/modal/lib/ModalOverlay.tsx +11 -8
- package/modal/lib/hooks/useCloseOnOverlayClick.ts +4 -2
- package/package.json +3 -5
- package/pagination/lib/Pagination/AdditionalDetails.tsx +7 -8
- package/pagination/lib/Pagination/GoTo/Label.tsx +3 -11
- package/popup/lib/PopupCard.tsx +9 -1
- package/popup/lib/PopupPopper.tsx +2 -3
- package/radio/lib/Radio.tsx +9 -24
- package/side-panel/lib/SidePanel.tsx +7 -7
- package/text/LICENSE +52 -0
- package/text/README.md +5 -0
- package/text/index.ts +3 -0
- package/text/lib/LabelText.tsx +25 -0
- package/text/lib/Text.tsx +66 -0
- package/text/lib/TypeLevelComponents.tsx +43 -0
- package/text/package.json +6 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Label.d.ts","sourceRoot":"","sources":["../../../../../../pagination/lib/Pagination/GoTo/Label.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Label.d.ts","sourceRoot":"","sources":["../../../../../../pagination/lib/Pagination/GoTo/Label.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAC,eAAe,EAAC,MAAM,UAAU,CAAC;AAGzC,MAAM,WAAW,cACf,SAAQ,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,UAAU,CAAC;IACrE,KAAK,EAAE,eAAe,CAAC;IACvB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC;CAC1E;AAED,eAAO,MAAM,SAAS,sCAAqC,cAAc,gBAMxE,CAAC"}
|
|
@@ -21,10 +21,8 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
23
|
import * as React from 'react';
|
|
24
|
-
import {
|
|
25
|
-
import { styled } from '@workday/canvas-kit-react/common';
|
|
26
|
-
var StyledLabel = styled('label')(__assign(__assign({}, type.levels.subtext.medium), { color: typeColors.hint, whiteSpace: 'nowrap' }));
|
|
24
|
+
import { LabelText } from '@workday/canvas-kit-react/text';
|
|
27
25
|
export var GoToLabel = function (_a) {
|
|
28
26
|
var model = _a.model, children = _a.children, elemProps = __rest(_a, ["model", "children"]);
|
|
29
|
-
return (React.createElement(
|
|
27
|
+
return (React.createElement(LabelText, __assign({ typeLevel: "subtext.medium", variant: "hint", whiteSpace: "nowrap" }, elemProps), typeof children === 'function' ? children(model) : children));
|
|
30
28
|
};
|
|
@@ -106,7 +106,7 @@ export declare const Popup: import("../../common").ComponentM<PopupProps & Parti
|
|
|
106
106
|
hide(event?: Event | React.SyntheticEvent<Element, Event> | undefined): void;
|
|
107
107
|
};
|
|
108
108
|
}>;
|
|
109
|
-
Body: import("../../common").ElementComponentM<"div", import("../..").BorderShorthandStyleProps & import("../..").BorderColorStyleProps & import("../..").BorderRadiusStyleProps & import("../..").BorderLineStyleProps & import("../..").BorderWidthStyleProps & import("../..").BorderLogicalStyleProps & import("../..").ColorStyleProps & import("../..").DepthStyleProps & import("../..").FlexItemStyleProps & import("../..").LayoutStyleProps & import("../../layout/lib/utils/other").OtherStyleProps & import("../..").PositionStandardProps & import("../..").PositionLogicalProps & import("../../layout/lib/utils/space").SpaceStandardProps & import("../../layout/lib/utils/space").SpaceLogicalProps & React.HTMLAttributes<HTMLDivElement>, {
|
|
109
|
+
Body: import("../../common").ElementComponentM<"div", import("../..").BorderShorthandStyleProps & import("../..").BorderColorStyleProps & import("../..").BorderRadiusStyleProps & import("../..").BorderLineStyleProps & import("../..").BorderWidthStyleProps & import("../..").BorderLogicalStyleProps & import("../..").ColorStyleProps & import("../..").DepthStyleProps & import("../..").FlexItemStyleProps & import("../..").FontStyleProps & import("../..").LayoutStyleProps & import("../../layout/lib/utils/other").OtherStyleProps & import("../..").PositionStandardProps & import("../..").PositionLogicalProps & import("../../layout/lib/utils/space").SpaceStandardProps & import("../../layout/lib/utils/space").SpaceLogicalProps & import("../..").TextStyleProps & React.HTMLAttributes<HTMLDivElement>, {
|
|
110
110
|
state: {
|
|
111
111
|
stackRef: React.RefObject<HTMLDivElement>;
|
|
112
112
|
targetRef: React.RefObject<HTMLButtonElement>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
export declare const PopupBody: import("../../common").ElementComponentM<"div", import("../..").BorderShorthandStyleProps & import("../..").BorderColorStyleProps & import("../..").BorderRadiusStyleProps & import("../..").BorderLineStyleProps & import("../..").BorderWidthStyleProps & import("../..").BorderLogicalStyleProps & import("../..").ColorStyleProps & import("../..").DepthStyleProps & import("../..").FlexItemStyleProps & import("../..").LayoutStyleProps & import("../../layout/lib/utils/other").OtherStyleProps & import("../..").PositionStandardProps & import("../..").PositionLogicalProps & import("../../layout/lib/utils/space").SpaceStandardProps & import("../../layout/lib/utils/space").SpaceLogicalProps & React.HTMLAttributes<HTMLDivElement>, {
|
|
2
|
+
export declare const PopupBody: import("../../common").ElementComponentM<"div", import("../..").BorderShorthandStyleProps & import("../..").BorderColorStyleProps & import("../..").BorderRadiusStyleProps & import("../..").BorderLineStyleProps & import("../..").BorderWidthStyleProps & import("../..").BorderLogicalStyleProps & import("../..").ColorStyleProps & import("../..").DepthStyleProps & import("../..").FlexItemStyleProps & import("../..").FontStyleProps & import("../..").LayoutStyleProps & import("../../layout/lib/utils/other").OtherStyleProps & import("../..").PositionStandardProps & import("../..").PositionLogicalProps & import("../../layout/lib/utils/space").SpaceStandardProps & import("../../layout/lib/utils/space").SpaceLogicalProps & import("../..").TextStyleProps & React.HTMLAttributes<HTMLDivElement>, {
|
|
3
3
|
state: {
|
|
4
4
|
stackRef: React.RefObject<HTMLDivElement>;
|
|
5
5
|
targetRef: React.RefObject<HTMLButtonElement>;
|
|
@@ -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,EAKL,YAAY,EAGb,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAQ,eAAe,EAAC,MAAM,kCAAkC,CAAC;AAKxE,MAAM,WAAW,cAAe,SAAQ,YAAY,CAAC,OAAO,IAAI,EAAE,KAAK,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC;IAChG,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;
|
|
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,EAKL,YAAY,EAGb,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAQ,eAAe,EAAC,MAAM,kCAAkC,CAAC;AAKxE,MAAM,WAAW,cAAe,SAAQ,YAAY,CAAC,OAAO,IAAI,EAAE,KAAK,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC;IAChG,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AA0CD,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;EAiCpB,CAAC"}
|
|
@@ -36,21 +36,29 @@ var popupAnimation = function (transformOrigin) {
|
|
|
36
36
|
var translate = getTranslateFromOrigin(transformOrigin, space.xxs);
|
|
37
37
|
return keyframes(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n 0% {\n opacity: 0;\n transform: translate(", "px, ", "px);\n }\n 100% {\n opacity: 1;\n transform: translate(0);\n }\n "], ["\n 0% {\n opacity: 0;\n transform: translate(", "px, ", "px);\n }\n 100% {\n opacity: 1;\n transform: translate(0);\n }\n "])), translate.x, translate.y);
|
|
38
38
|
};
|
|
39
|
-
var StyledPopupCard = styled(Card)(
|
|
40
|
-
var
|
|
39
|
+
var StyledPopupCard = styled(Card)(function (_a) {
|
|
40
|
+
var _b;
|
|
41
|
+
var transformOrigin = _a.transformOrigin, theme = _a.theme;
|
|
41
42
|
if (transformOrigin == null) {
|
|
42
43
|
return {};
|
|
43
44
|
}
|
|
44
|
-
return {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
return _b = {
|
|
46
|
+
animation: popupAnimation(transformOrigin),
|
|
47
|
+
animationDuration: '150ms',
|
|
48
|
+
animationTimingFunction: 'ease-out',
|
|
49
|
+
transformOrigin: transformOrigin.vertical + " " + transformOrigin.horizontal
|
|
50
|
+
},
|
|
51
|
+
_b[theme.canvas.breakpoints.down('s')] = {
|
|
52
|
+
animation: popupAnimation({ vertical: 'bottom', horizontal: 'center' }),
|
|
53
|
+
animationDuration: '150ms',
|
|
54
|
+
animationTimingFunction: 'ease-out',
|
|
55
|
+
transformOrigin: 'bottom center',
|
|
56
|
+
},
|
|
49
57
|
// Allow overriding of animation in special cases
|
|
50
|
-
'.wd-no-animation &'
|
|
58
|
+
_b['.wd-no-animation &'] = {
|
|
51
59
|
animation: 'none',
|
|
52
60
|
},
|
|
53
|
-
|
|
61
|
+
_b;
|
|
54
62
|
});
|
|
55
63
|
export var PopupCard = createSubcomponent('div')({
|
|
56
64
|
displayName: 'Popup.Card',
|
|
@@ -64,6 +72,6 @@ export var PopupCard = createSubcomponent('div')({
|
|
|
64
72
|
// As is a Stack that will render an element of `Element`
|
|
65
73
|
var As = useConstant(function () { return Stack.as(Element); });
|
|
66
74
|
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 ? space[elemProps.margin] || elemProps.margin : 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
|
|
67
|
-
}, elemProps), children));
|
|
75
|
+
}, type.levels.subtext.large, elemProps), children));
|
|
68
76
|
});
|
|
69
77
|
var templateObject_1;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { Placement, PopperOptions } from './Popper';
|
|
3
|
-
export interface PopupPopperProps {
|
|
2
|
+
import { Placement, PopperOptions, PopperProps } from './Popper';
|
|
3
|
+
export interface PopupPopperProps extends PopperProps {
|
|
4
4
|
/**
|
|
5
5
|
* The placement of the `Popper` contents relative to the `anchorElement`. Accepts `auto`, `top`,
|
|
6
6
|
* `right`, `bottom`, or `left`. Each placement can also be modified using any of the following
|
|
@@ -12,7 +12,6 @@ export interface PopupPopperProps {
|
|
|
12
12
|
* The additional options passed to the Popper's `popper.js` instance.
|
|
13
13
|
*/
|
|
14
14
|
popperOptions?: Partial<PopperOptions>;
|
|
15
|
-
children?: React.ReactNode;
|
|
16
15
|
}
|
|
17
16
|
export declare const PopupPopper: import("../../common").ElementComponentM<"div", PopupPopperProps, {
|
|
18
17
|
state: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PopupPopper.d.ts","sourceRoot":"","sources":["../../../../popup/lib/PopupPopper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAAC,SAAS,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"PopupPopper.d.ts","sourceRoot":"","sources":["../../../../popup/lib/PopupPopper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAAC,SAAS,EAAE,aAAa,EAAU,WAAW,EAAC,MAAM,UAAU,CAAC;AAEvE,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD;;;;;OAKG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;CACxC;AAED,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;EAMtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Radio.d.ts","sourceRoot":"","sources":["../../../../radio/lib/Radio.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAML,SAAS,EAEV,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"Radio.d.ts","sourceRoot":"","sources":["../../../../radio/lib/Radio.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAML,SAAS,EAEV,MAAM,kCAAkC,CAAC;AAI1C,MAAM,WAAW,UAAW,SAAQ,SAAS;IAC3C;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAC5D;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CACjC;AAmOD,eAAO,MAAM,KAAK,8DAqDhB,CAAC"}
|
|
@@ -22,7 +22,8 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
22
22
|
};
|
|
23
23
|
import * as React from 'react';
|
|
24
24
|
import { createComponent, focusRing, mouseFocusBehavior, styled, useUniqueId, } from '@workday/canvas-kit-react/common';
|
|
25
|
-
import {
|
|
25
|
+
import { borderRadius, colors, inputColors, spaceNumbers } from '@workday/canvas-kit-react/tokens';
|
|
26
|
+
import { LabelText } from '@workday/canvas-kit-react/text';
|
|
26
27
|
var radioBorderRadius = 9;
|
|
27
28
|
var radioDot = 8;
|
|
28
29
|
var radioHeight = 18;
|
|
@@ -201,18 +202,6 @@ var RadioCheck = styled('div')({
|
|
|
201
202
|
transform: checked ? 'scale(1)' : 'scale(0.5)',
|
|
202
203
|
});
|
|
203
204
|
});
|
|
204
|
-
var RadioLabel = styled('label')(__assign(__assign({}, canvas.type.levels.subtext.large), { paddingLeft: radioLabelDistance }), function (_a) {
|
|
205
|
-
var variant = _a.variant;
|
|
206
|
-
return (variant === 'inverse' ? { color: colors.frenchVanilla100 } : undefined);
|
|
207
|
-
}, function (_a) {
|
|
208
|
-
var disabled = _a.disabled, variant = _a.variant;
|
|
209
|
-
return disabled
|
|
210
|
-
? {
|
|
211
|
-
color: variant === 'inverse' ? colors.frenchVanilla100 : inputColors.disabled.text,
|
|
212
|
-
opacity: variant === 'inverse' ? '.4' : '1',
|
|
213
|
-
}
|
|
214
|
-
: { cursor: 'pointer' };
|
|
215
|
-
});
|
|
216
205
|
export var Radio = createComponent('input')({
|
|
217
206
|
displayName: 'Radio',
|
|
218
207
|
Component: function (_a, ref, Element) {
|
|
@@ -224,6 +213,6 @@ export var Radio = createComponent('input')({
|
|
|
224
213
|
React.createElement(RadioRipple, { variant: variant }),
|
|
225
214
|
React.createElement(RadioBackground, { checked: checked, disabled: disabled, variant: variant },
|
|
226
215
|
React.createElement(RadioCheck, { checked: checked, variant: variant }))),
|
|
227
|
-
label && (React.createElement(
|
|
216
|
+
label && (React.createElement(LabelText, { paddingLeft: radioLabelDistance, htmlFor: inputId, disabled: disabled, variant: variant }, label))));
|
|
228
217
|
},
|
|
229
218
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidePanel.d.ts","sourceRoot":"","sources":["../../../../side-panel/lib/SidePanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,
|
|
1
|
+
{"version":3,"file":"SidePanel.d.ts","sourceRoot":"","sources":["../../../../side-panel/lib/SidePanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAAgB,iBAAiB,EAAC,MAAM,kCAAkC,CAAC;AAKlF,MAAM,WAAW,cAAe,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC1E;;;OAGG;IACH,IAAI,EAAE,OAAO,CAAC;IACd;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IAClC;;;OAGG;IACH,aAAa,CAAC,EAAE,sBAAsB,CAAC;IACvC;;OAEG;IACH,kBAAkB,CAAC,EAAE,CAAC,eAAe,EAAE,OAAO,KAAK,IAAI,CAAC;IACxD;;OAEG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,eAAe,CAAC,EAAE,wBAAwB,CAAC;IAC3C;;;OAGG;IACH,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC;;;OAGG;IACH,uBAAuB,CAAC,EAAE,MAAM,CAAC;CAClC;AAED,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,oBAAY,sBAAsB;IAChC,IAAI,IAAA;IACJ,KAAK,IAAA;CACN;AAED,oBAAY,wBAAwB;IAClC,KAAK,IAAA;IACL,WAAW,IAAA;IACX,IAAI,IAAA;CACL;AAwFD,qBAAa,SAAU,SAAQ,KAAK,CAAC,SAAS,CAAC,cAAc,EAAE,cAAc,CAAC;IAC5E,MAAM,CAAC,aAAa,gCAA0B;IAC9C,MAAM,CAAC,eAAe,kCAA4B;gBAEtC,KAAK,EAAE,cAAc;IAKjC,KAAK;;MAEH;IAEK,iBAAiB;IAGjB,oBAAoB;IAIpB,MAAM;IAgDb,OAAO,CAAC,YAAY,CAWlB;IAEF,OAAO,CAAC,aAAa,CAInB;IAEF,OAAO,CAAC,qBAAqB,CAS3B;CACH"}
|
|
@@ -36,9 +36,10 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
36
36
|
import * as React from 'react';
|
|
37
37
|
import styled from '@emotion/styled';
|
|
38
38
|
import throttle from 'lodash/throttle';
|
|
39
|
-
import { colors, space
|
|
39
|
+
import { colors, space } from '@workday/canvas-kit-react/tokens';
|
|
40
40
|
import { TertiaryButton } from '@workday/canvas-kit-react/button';
|
|
41
41
|
import { chevronLeftIcon, chevronRightIcon } from '@workday/canvas-system-icons-web';
|
|
42
|
+
import { Heading } from '@workday/canvas-kit-react/text';
|
|
42
43
|
export var SidePanelOpenDirection;
|
|
43
44
|
(function (SidePanelOpenDirection) {
|
|
44
45
|
SidePanelOpenDirection[SidePanelOpenDirection["Left"] = 0] = "Left";
|
|
@@ -51,7 +52,6 @@ export var SidePanelBackgroundColor;
|
|
|
51
52
|
SidePanelBackgroundColor[SidePanelBackgroundColor["Gray"] = 2] = "Gray";
|
|
52
53
|
})(SidePanelBackgroundColor || (SidePanelBackgroundColor = {}));
|
|
53
54
|
var closedWidth = space.xxl;
|
|
54
|
-
var Header = styled('h2')(__assign(__assign({}, type.levels.heading.small), { marginTop: space.zero }));
|
|
55
55
|
var SidePanelContainer = styled('div')({
|
|
56
56
|
overflow: 'hidden',
|
|
57
57
|
height: '100%',
|
|
@@ -176,7 +176,7 @@ var SidePanel = /** @class */ (function (_super) {
|
|
|
176
176
|
var _a = this.props, _b = _a.backgroundColor, backgroundColor = _b === void 0 ? SidePanelBackgroundColor.White : _b, _c = _a.openNavigationAriaLabel, openNavigationAriaLabel = _c === void 0 ? 'open navigation' : _c, _d = _a.closeNavigationAriaLabel, closeNavigationAriaLabel = _d === void 0 ? 'close navigation' : _d, _e = _a.openDirection, openDirection = _e === void 0 ? SidePanelOpenDirection.Left : _e, _f = _a.breakpoint, breakpoint = _f === void 0 ? 768 : _f, _g = _a.openWidth, openWidth = _g === void 0 ? 300 : _g, header = _a.header, onToggleClick = _a.onToggleClick, open = _a.open, padding = _a.padding, onBreakpointChange = _a.onBreakpointChange, elemProps = __rest(_a, ["backgroundColor", "openNavigationAriaLabel", "closeNavigationAriaLabel", "openDirection", "breakpoint", "openWidth", "header", "onToggleClick", "open", "padding", "onBreakpointChange"]);
|
|
177
177
|
return (React.createElement(SidePanelContainer, __assign({ role: "region", padding: padding, openDirection: openDirection, openWidth: openWidth, backgroundColor: backgroundColor, open: open }, elemProps),
|
|
178
178
|
React.createElement(ChildrenContainer, { open: open, openWidth: openWidth },
|
|
179
|
-
header && open ? React.createElement(
|
|
179
|
+
header && open ? (React.createElement(Heading, { as: "h2", size: "small", marginTop: "zero" }, header)) : null,
|
|
180
180
|
this.props.children),
|
|
181
181
|
React.createElement(SidePanelFooter, { openWidth: openWidth, open: open }, onToggleClick && (React.createElement(ToggleButton, { openDirection: openDirection, "aria-label": open ? closeNavigationAriaLabel : openNavigationAriaLabel, onClick: this.onToggleClick, icon: this.toggleButtonDirection(open, openDirection) })))));
|
|
182
182
|
};
|
|
@@ -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("../../layout").BorderShorthandStyleProps & import("../../layout").BorderColorStyleProps & import("../../layout").BorderRadiusStyleProps & import("../../layout").BorderLineStyleProps & import("../../layout").BorderWidthStyleProps & import("../../layout").BorderLogicalStyleProps & import("../../layout").ColorStyleProps & import("../../layout").DepthStyleProps & import("../../layout").FlexItemStyleProps & import("../../layout").LayoutStyleProps & import("../../layout/lib/utils/other").OtherStyleProps & import("../../layout").PositionStandardProps & import("../../layout").PositionLogicalProps & import("../../layout/lib/utils/space").SpaceStandardProps & import("../../layout/lib/utils/space").SpaceLogicalProps & Pick<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "name" | "style" | "ref" | "form" | "slot" | "title" | "dir" | "value" | "children" | "hidden" | "type" | "disabled" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget"> & {
|
|
56
|
+
export declare const StyledTabItem: import("@emotion/styled").StyledComponent<import("../../layout").BorderShorthandStyleProps & import("../../layout").BorderColorStyleProps & import("../../layout").BorderRadiusStyleProps & import("../../layout").BorderLineStyleProps & import("../../layout").BorderWidthStyleProps & import("../../layout").BorderLogicalStyleProps & import("../../layout").ColorStyleProps & import("../../layout").DepthStyleProps & import("../../layout").FlexItemStyleProps & import("../../layout").FontStyleProps & import("../../layout").LayoutStyleProps & import("../../layout/lib/utils/other").OtherStyleProps & import("../../layout").PositionStandardProps & import("../../layout").PositionLogicalProps & import("../../layout/lib/utils/space").SpaceStandardProps & import("../../layout/lib/utils/space").SpaceLogicalProps & import("../../layout").TextStyleProps & Pick<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "name" | "style" | "ref" | "form" | "slot" | "title" | "dir" | "value" | "children" | "hidden" | "type" | "disabled" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget"> & {
|
|
57
57
|
ref?: ((instance: HTMLButtonElement | null) => void) | React.RefObject<HTMLButtonElement> | null | undefined;
|
|
58
58
|
} & {
|
|
59
59
|
theme?: import("@emotion/react").Theme | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../text/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Property } from 'csstype';
|
|
2
|
+
import { TextProps } from '@workday/canvas-kit-react/text';
|
|
3
|
+
export interface TypeLabelProps extends TextProps {
|
|
4
|
+
cursor?: Property.Cursor;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const LabelText: import("../../common").ElementComponent<"label", TypeLabelProps>;
|
|
8
|
+
//# sourceMappingURL=LabelText.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LabelText.d.ts","sourceRoot":"","sources":["../../../../text/lib/LabelText.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AAEjC,OAAO,EAAO,SAAS,EAAC,MAAM,gCAAgC,CAAC;AAG/D,MAAM,WAAW,cAAe,SAAQ,SAAS;IAC/C,MAAM,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAUD,eAAO,MAAM,SAAS,kEAKpB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
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, styled } from '@workday/canvas-kit-react/common';
|
|
14
|
+
import { Text } from '@workday/canvas-kit-react/text';
|
|
15
|
+
import { inputColors } from '@workday/canvas-kit-react/tokens';
|
|
16
|
+
var StyledLabel = styled(Text.as('label'))(function (_a) {
|
|
17
|
+
var cursor = _a.cursor, disabled = _a.disabled, variant = _a.variant;
|
|
18
|
+
return ({
|
|
19
|
+
color: disabled && variant !== 'inverse' ? inputColors.disabled.text : undefined,
|
|
20
|
+
cursor: cursor && !disabled ? cursor : 'default',
|
|
21
|
+
opacity: disabled && variant === 'inverse' ? '.4' : '1',
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
export var LabelText = createComponent('label')({
|
|
25
|
+
displayName: 'Label',
|
|
26
|
+
Component: function (elemProps, ref, Element) {
|
|
27
|
+
return React.createElement(StyledLabel, __assign({ ref: ref, as: Element, typeLevel: "subtext.large" }, elemProps));
|
|
28
|
+
},
|
|
29
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CanvasTypeHierarchy, CanvasTypeVariants } from '@workday/canvas-kit-react/tokens';
|
|
2
|
+
import { BoxProps } from '@workday/canvas-kit-react/layout';
|
|
3
|
+
export interface TextProps extends BoxProps {
|
|
4
|
+
/**
|
|
5
|
+
* Type token as string with level and size separated by dot.
|
|
6
|
+
*/
|
|
7
|
+
typeLevel?: `${keyof CanvasTypeHierarchy}.${'large' | 'medium' | 'small'}`;
|
|
8
|
+
/**
|
|
9
|
+
* Type variant token names: `error`, `hint` or `inverse`.
|
|
10
|
+
*/
|
|
11
|
+
variant?: keyof CanvasTypeVariants;
|
|
12
|
+
}
|
|
13
|
+
export declare const Text: import("../../common").ElementComponent<"span", TextProps>;
|
|
14
|
+
//# sourceMappingURL=Text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../../../text/lib/Text.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAO,mBAAmB,EAAE,kBAAkB,EAAC,MAAM,kCAAkC,CAAC;AAC/F,OAAO,EAAM,QAAQ,EAAC,MAAM,kCAAkC,CAAC;AAE/D,MAAM,WAAW,SAAU,SAAQ,QAAQ;IACzC;;OAEG;IACF,SAAS,CAAC,EAAE,GAAG,MAAM,mBAAmB,IAAI,OAAO,GAAC,QAAQ,GAAC,OAAO,EAAE,CAAC;IACxE;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,kBAAkB,CAAC;CACpC;AA2CD,eAAO,MAAM,IAAI,4DAOf,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
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
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import * as React from 'react';
|
|
24
|
+
import { createComponent } from '@workday/canvas-kit-react/common';
|
|
25
|
+
// type changes no need
|
|
26
|
+
import { type } from '@workday/canvas-kit-react/tokens';
|
|
27
|
+
import { Box } from '@workday/canvas-kit-react/layout';
|
|
28
|
+
/**
|
|
29
|
+
* Function returns updated props by token and variant values
|
|
30
|
+
*/
|
|
31
|
+
var validateProps = function (_a) {
|
|
32
|
+
var typeLevel = _a.typeLevel, variant = _a.variant, props = __rest(_a, ["typeLevel", "variant"]);
|
|
33
|
+
var updatedProps = props;
|
|
34
|
+
var tokenPropNames = [
|
|
35
|
+
'color',
|
|
36
|
+
'fontFamily',
|
|
37
|
+
'fontSize',
|
|
38
|
+
'fontWeight',
|
|
39
|
+
'letterSpacing',
|
|
40
|
+
'lineHeight',
|
|
41
|
+
];
|
|
42
|
+
/*
|
|
43
|
+
If token provided it updates undefined values of token styles:
|
|
44
|
+
`fontFamily`, `fontSize`, `lineHeight`, `fontWeight`, `color`
|
|
45
|
+
by replacing them by token value
|
|
46
|
+
*/
|
|
47
|
+
if (typeLevel) {
|
|
48
|
+
var _b = typeLevel.split('.'), level = _b[0], size = _b[1];
|
|
49
|
+
var tokenProps_1 = type.levels[level][size];
|
|
50
|
+
tokenPropNames.forEach(function (item) {
|
|
51
|
+
if (!props[item]) {
|
|
52
|
+
updatedProps[item] = tokenProps_1[item];
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
// If variant provided it updates color value by variant color
|
|
57
|
+
if (variant) {
|
|
58
|
+
updatedProps = __assign(__assign({}, updatedProps), type.variants[variant]);
|
|
59
|
+
}
|
|
60
|
+
return updatedProps;
|
|
61
|
+
};
|
|
62
|
+
export var Text = createComponent('span')({
|
|
63
|
+
displayName: 'Text',
|
|
64
|
+
Component: function (_a, ref, Element) {
|
|
65
|
+
var children = _a.children, elemProps = __rest(_a, ["children"]);
|
|
66
|
+
return (React.createElement(Box, __assign({ ref: ref, as: Element }, validateProps(elemProps)), children));
|
|
67
|
+
},
|
|
68
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TextProps } from '@workday/canvas-kit-react/text';
|
|
2
|
+
/**
|
|
3
|
+
* Props interface for type level specific component:
|
|
4
|
+
* Title, Heading, BodyText, Subtext.
|
|
5
|
+
*/
|
|
6
|
+
export interface TypeLevelProps extends Omit<TextProps, 'typeLevel'> {
|
|
7
|
+
size: 'large' | 'medium' | 'small';
|
|
8
|
+
}
|
|
9
|
+
export declare const Subtext: import("../../common").ElementComponent<"p", TypeLevelProps>;
|
|
10
|
+
export declare const BodyText: import("../../common").ElementComponent<"p", TypeLevelProps>;
|
|
11
|
+
export declare const Heading: import("../../common").ElementComponent<"h2", TypeLevelProps>;
|
|
12
|
+
export declare const Title: import("../../common").ElementComponent<"h1", TypeLevelProps>;
|
|
13
|
+
//# sourceMappingURL=TypeLevelComponents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TypeLevelComponents.d.ts","sourceRoot":"","sources":["../../../../text/lib/TypeLevelComponents.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAO,SAAS,EAAC,MAAM,gCAAgC,CAAC;AAE/D;;;GAGG;AACH,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC;IAClE,IAAI,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;CACpC;AAED,eAAO,MAAM,OAAO,8DAMlB,CAAC;AAEH,eAAO,MAAM,QAAQ,8DAMnB,CAAC;AAEH,eAAO,MAAM,OAAO,+DAMlB,CAAC;AAEH,eAAO,MAAM,KAAK,+DAMhB,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
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
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import * as React from 'react';
|
|
24
|
+
import { createComponent } from '@workday/canvas-kit-react/common';
|
|
25
|
+
import { Text } from '@workday/canvas-kit-react/text';
|
|
26
|
+
export var Subtext = createComponent('p')({
|
|
27
|
+
displayName: 'Subtext',
|
|
28
|
+
Component: function (_a, ref, Element) {
|
|
29
|
+
var size = _a.size, elemProps = __rest(_a, ["size"]);
|
|
30
|
+
var typeLevel = "subtext." + size;
|
|
31
|
+
return React.createElement(Text, __assign({ ref: ref, as: Element, typeLevel: typeLevel }, elemProps));
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
export var BodyText = createComponent('p')({
|
|
35
|
+
displayName: 'BodyText',
|
|
36
|
+
Component: function (_a, ref, Element) {
|
|
37
|
+
var size = _a.size, elemProps = __rest(_a, ["size"]);
|
|
38
|
+
var typeLevel = "body." + size;
|
|
39
|
+
return React.createElement(Text, __assign({ ref: ref, as: Element, typeLevel: typeLevel }, elemProps));
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
export var Heading = createComponent('h2')({
|
|
43
|
+
displayName: 'Heading',
|
|
44
|
+
Component: function (_a, ref, Element) {
|
|
45
|
+
var size = _a.size, elemProps = __rest(_a, ["size"]);
|
|
46
|
+
var typeLevel = "heading." + size;
|
|
47
|
+
return React.createElement(Text, __assign({ ref: ref, as: Element, typeLevel: typeLevel }, elemProps));
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
export var Title = createComponent('h1')({
|
|
51
|
+
displayName: 'Title',
|
|
52
|
+
Component: function (_a, ref, Element) {
|
|
53
|
+
var size = _a.size, elemProps = __rest(_a, ["size"]);
|
|
54
|
+
var typeLevel = "title." + size;
|
|
55
|
+
return React.createElement(Text, __assign({ ref: ref, as: Element, typeLevel: typeLevel }, elemProps));
|
|
56
|
+
},
|
|
57
|
+
});
|
package/form-field/lib/Hint.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {ErrorType,
|
|
3
|
-
import {space
|
|
2
|
+
import {ErrorType, Themeable, styled} from '@workday/canvas-kit-react/common';
|
|
3
|
+
import {space} from '@workday/canvas-kit-react/tokens';
|
|
4
|
+
import {Subtext, Text} from '@workday/canvas-kit-react/text';
|
|
4
5
|
|
|
5
6
|
export interface HintProps extends Themeable, React.HTMLAttributes<HTMLParagraphElement> {
|
|
6
7
|
/**
|
|
@@ -19,20 +20,7 @@ export interface HintProps extends Themeable, React.HTMLAttributes<HTMLParagraph
|
|
|
19
20
|
alertLabel?: string;
|
|
20
21
|
}
|
|
21
22
|
|
|
22
|
-
const
|
|
23
|
-
type.levels.subtext.medium,
|
|
24
|
-
{
|
|
25
|
-
fontWeight: type.properties.fontWeights.medium,
|
|
26
|
-
},
|
|
27
|
-
({error, theme}) => error === ErrorType.Error && {color: theme.canvas.palette.error.main}
|
|
28
|
-
);
|
|
29
|
-
|
|
30
|
-
const Message = styled('p')<Pick<HintProps, 'error'>>(
|
|
31
|
-
type.levels.subtext.medium,
|
|
32
|
-
{
|
|
33
|
-
margin: `${space.xxs} 0 0`,
|
|
34
|
-
width: '100%',
|
|
35
|
-
},
|
|
23
|
+
const Message = styled(Subtext)<Pick<HintProps, 'error'>>(
|
|
36
24
|
({error, theme}) => error === ErrorType.Error && {color: theme.canvas.palette.error.main}
|
|
37
25
|
);
|
|
38
26
|
|
|
@@ -41,7 +29,6 @@ class Hint extends React.Component<HintProps> {
|
|
|
41
29
|
|
|
42
30
|
public render() {
|
|
43
31
|
const {errorLabel = 'Error', alertLabel = 'Alert', children, error} = this.props;
|
|
44
|
-
|
|
45
32
|
let hintLabel: string | undefined;
|
|
46
33
|
switch (error) {
|
|
47
34
|
case Hint.ErrorType.Error:
|
|
@@ -54,8 +41,10 @@ class Hint extends React.Component<HintProps> {
|
|
|
54
41
|
}
|
|
55
42
|
|
|
56
43
|
return (
|
|
57
|
-
<Message {...this.props}>
|
|
58
|
-
{typeof error !== 'undefined' && hintLabel &&
|
|
44
|
+
<Message size="medium" margin={`${space.xxs} 0 0`} width="100%" {...this.props}>
|
|
45
|
+
{typeof error !== 'undefined' && hintLabel && (
|
|
46
|
+
<Text fontWeight="medium">{hintLabel}: </Text>
|
|
47
|
+
)}
|
|
59
48
|
{children}
|
|
60
49
|
</Message>
|
|
61
50
|
);
|
package/index.ts
CHANGED
package/layout/index.ts
CHANGED
|
@@ -7,9 +7,11 @@ export * from './lib/utils/border';
|
|
|
7
7
|
export * from './lib/utils/color';
|
|
8
8
|
export {DepthStyleProps} from './lib/utils/depth';
|
|
9
9
|
export * from './lib/utils/flexItem';
|
|
10
|
+
export * from './lib/utils/font';
|
|
10
11
|
export * from './lib/utils/layout';
|
|
11
12
|
export * from './lib/utils/position';
|
|
12
13
|
export {SpaceStyleProps} from './lib/utils/space';
|
|
14
|
+
export * from './lib/utils/text';
|
|
13
15
|
export * from './lib/Flex';
|
|
14
16
|
export * from './lib/Grid';
|
|
15
17
|
export * from './lib/Stack';
|