@workday/canvas-kit-react 8.0.0-alpha.204-next.4 → 8.0.0-alpha.216-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/common/lib/utils/elements.ts +4 -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/common/lib/utils/elements.d.ts +1 -1
- package/dist/commonjs/common/lib/utils/elements.d.ts.map +1 -1
- package/dist/commonjs/common/lib/utils/elements.js +3 -3
- package/dist/commonjs/dialog/lib/Dialog.d.ts +1 -1
- package/dist/commonjs/icon/lib/SystemIcon.d.ts +1 -1
- package/dist/commonjs/icon/lib/SystemIcon.d.ts.map +1 -1
- package/dist/commonjs/layout/index.d.ts +8 -4
- package/dist/commonjs/layout/index.d.ts.map +1 -1
- package/dist/commonjs/layout/index.js +10 -2
- package/dist/commonjs/layout/lib/Box.d.ts +6 -4
- package/dist/commonjs/layout/lib/Box.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/Box.js +8 -9
- package/dist/commonjs/layout/lib/Flex.d.ts +5 -2
- package/dist/commonjs/layout/lib/Flex.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/Flex.js +5 -1
- package/dist/commonjs/layout/lib/Grid.d.ts +5 -6
- package/dist/commonjs/layout/lib/Grid.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/Grid.js +2 -2
- package/dist/commonjs/layout/lib/Stack.d.ts +4 -4
- package/dist/commonjs/layout/lib/utils/background.d.ts +44 -0
- package/dist/commonjs/layout/lib/utils/background.d.ts.map +1 -0
- package/dist/commonjs/layout/lib/utils/background.js +57 -0
- package/dist/commonjs/layout/lib/utils/border/color.d.ts +47 -0
- package/dist/commonjs/layout/lib/utils/border/color.d.ts.map +1 -0
- package/dist/commonjs/layout/lib/utils/border/color.js +42 -0
- package/dist/commonjs/layout/lib/utils/border/index.d.ts +26 -0
- package/dist/commonjs/layout/lib/utils/border/index.d.ts.map +1 -0
- package/dist/commonjs/layout/lib/utils/border/index.js +46 -0
- package/dist/commonjs/layout/lib/utils/border/lineStyle.d.ts +38 -0
- package/dist/commonjs/layout/lib/utils/border/lineStyle.d.ts.map +1 -0
- package/dist/commonjs/layout/lib/utils/border/lineStyle.js +52 -0
- package/dist/commonjs/layout/lib/utils/border/radius.d.ts +33 -0
- package/dist/commonjs/layout/lib/utils/border/radius.d.ts.map +1 -0
- package/dist/commonjs/layout/lib/utils/border/radius.js +32 -0
- package/dist/commonjs/layout/lib/utils/border/shorthand.d.ts +34 -0
- package/dist/commonjs/layout/lib/utils/border/shorthand.d.ts.map +1 -0
- package/dist/commonjs/layout/lib/utils/border/shorthand.js +42 -0
- package/dist/commonjs/layout/lib/utils/border/width.d.ts +34 -0
- package/dist/commonjs/layout/lib/utils/border/width.d.ts.map +1 -0
- package/dist/commonjs/layout/lib/utils/border/width.js +42 -0
- package/dist/commonjs/layout/lib/utils/buildStyleFns.d.ts +12 -0
- package/dist/commonjs/layout/lib/utils/buildStyleFns.d.ts.map +1 -0
- package/dist/commonjs/layout/lib/utils/buildStyleFns.js +90 -0
- package/dist/commonjs/layout/lib/utils/color.d.ts +23 -16
- package/dist/commonjs/layout/lib/utils/color.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/utils/color.js +25 -49
- package/dist/commonjs/layout/lib/utils/depth.d.ts +17 -11
- package/dist/commonjs/layout/lib/utils/depth.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/utils/depth.js +20 -20
- package/dist/commonjs/layout/lib/utils/flex.d.ts +31 -12
- package/dist/commonjs/layout/lib/utils/flex.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/utils/flex.js +58 -25
- package/dist/commonjs/layout/lib/utils/flexItem.d.ts +18 -15
- package/dist/commonjs/layout/lib/utils/flexItem.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/utils/flexItem.js +43 -26
- package/dist/commonjs/layout/lib/utils/grid.d.ts +40 -35
- package/dist/commonjs/layout/lib/utils/grid.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/utils/grid.js +99 -72
- package/dist/commonjs/layout/lib/utils/gridItem.d.ts +17 -14
- package/dist/commonjs/layout/lib/utils/gridItem.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/utils/gridItem.js +58 -30
- package/dist/commonjs/layout/lib/utils/layout.d.ts +47 -25
- package/dist/commonjs/layout/lib/utils/layout.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/utils/layout.js +71 -33
- package/dist/commonjs/layout/lib/utils/other.d.ts +44 -2
- package/dist/commonjs/layout/lib/utils/other.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/utils/other.js +101 -17
- package/dist/commonjs/layout/lib/utils/position.d.ts +37 -20
- package/dist/commonjs/layout/lib/utils/position.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/utils/position.js +49 -66
- package/dist/commonjs/layout/lib/utils/space.d.ts +107 -51
- package/dist/commonjs/layout/lib/utils/space.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/utils/space.js +98 -148
- package/dist/commonjs/layout/lib/utils/stack.d.ts +3 -6
- package/dist/commonjs/layout/lib/utils/stack.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/utils/stack.js +13 -39
- package/dist/commonjs/layout/lib/utils/systemProps.d.ts +31 -0
- package/dist/commonjs/layout/lib/utils/systemProps.d.ts.map +1 -0
- package/dist/commonjs/layout/lib/utils/systemProps.js +2 -0
- package/dist/commonjs/layout/lib/utils/text.d.ts +33 -15
- package/dist/commonjs/layout/lib/utils/text.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/utils/text.js +74 -38
- package/dist/commonjs/modal/lib/Modal.d.ts +1 -1
- 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/hooks/useReturnFocus.d.ts.map +1 -1
- package/dist/commonjs/popup/lib/hooks/useReturnFocus.js +102 -2
- package/dist/commonjs/tabs/lib/TabsItem.d.ts +1 -1
- package/dist/commonjs/tokens/lib/colors.types.d.ts +4 -6
- package/dist/commonjs/tokens/lib/colors.types.d.ts.map +1 -1
- 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/common/lib/utils/elements.d.ts +1 -1
- package/dist/es6/common/lib/utils/elements.d.ts.map +1 -1
- package/dist/es6/common/lib/utils/elements.js +3 -3
- package/dist/es6/dialog/lib/Dialog.d.ts +1 -1
- package/dist/es6/icon/lib/SystemIcon.d.ts +1 -1
- package/dist/es6/icon/lib/SystemIcon.d.ts.map +1 -1
- package/dist/es6/layout/index.d.ts +8 -4
- package/dist/es6/layout/index.d.ts.map +1 -1
- package/dist/es6/layout/index.js +7 -1
- package/dist/es6/layout/lib/Box.d.ts +6 -4
- package/dist/es6/layout/lib/Box.d.ts.map +1 -1
- package/dist/es6/layout/lib/Box.js +8 -9
- package/dist/es6/layout/lib/Flex.d.ts +5 -2
- package/dist/es6/layout/lib/Flex.d.ts.map +1 -1
- package/dist/es6/layout/lib/Flex.js +5 -1
- package/dist/es6/layout/lib/Grid.d.ts +5 -6
- package/dist/es6/layout/lib/Grid.d.ts.map +1 -1
- package/dist/es6/layout/lib/Grid.js +2 -2
- package/dist/es6/layout/lib/Stack.d.ts +4 -4
- package/dist/es6/layout/lib/utils/background.d.ts +44 -0
- package/dist/es6/layout/lib/utils/background.d.ts.map +1 -0
- package/dist/es6/layout/lib/utils/background.js +54 -0
- package/dist/es6/layout/lib/utils/border/color.d.ts +47 -0
- package/dist/es6/layout/lib/utils/border/color.d.ts.map +1 -0
- package/dist/es6/layout/lib/utils/border/color.js +39 -0
- package/dist/es6/layout/lib/utils/border/index.d.ts +26 -0
- package/dist/es6/layout/lib/utils/border/index.d.ts.map +1 -0
- package/dist/es6/layout/lib/utils/border/index.js +43 -0
- package/dist/es6/layout/lib/utils/border/lineStyle.d.ts +38 -0
- package/dist/es6/layout/lib/utils/border/lineStyle.d.ts.map +1 -0
- package/dist/es6/layout/lib/utils/border/lineStyle.js +49 -0
- package/dist/es6/layout/lib/utils/border/radius.d.ts +33 -0
- package/dist/es6/layout/lib/utils/border/radius.d.ts.map +1 -0
- package/dist/es6/layout/lib/utils/border/radius.js +29 -0
- package/dist/es6/layout/lib/utils/border/shorthand.d.ts +34 -0
- package/dist/es6/layout/lib/utils/border/shorthand.d.ts.map +1 -0
- package/dist/es6/layout/lib/utils/border/shorthand.js +39 -0
- package/dist/es6/layout/lib/utils/border/width.d.ts +34 -0
- package/dist/es6/layout/lib/utils/border/width.d.ts.map +1 -0
- package/dist/es6/layout/lib/utils/border/width.js +39 -0
- package/dist/es6/layout/lib/utils/buildStyleFns.d.ts +12 -0
- package/dist/es6/layout/lib/utils/buildStyleFns.d.ts.map +1 -0
- package/dist/es6/layout/lib/utils/buildStyleFns.js +85 -0
- package/dist/es6/layout/lib/utils/color.d.ts +23 -16
- package/dist/es6/layout/lib/utils/color.d.ts.map +1 -1
- package/dist/es6/layout/lib/utils/color.js +24 -47
- package/dist/es6/layout/lib/utils/depth.d.ts +17 -11
- package/dist/es6/layout/lib/utils/depth.d.ts.map +1 -1
- package/dist/es6/layout/lib/utils/depth.js +19 -18
- package/dist/es6/layout/lib/utils/flex.d.ts +31 -12
- package/dist/es6/layout/lib/utils/flex.d.ts.map +1 -1
- package/dist/es6/layout/lib/utils/flex.js +57 -23
- package/dist/es6/layout/lib/utils/flexItem.d.ts +18 -15
- package/dist/es6/layout/lib/utils/flexItem.d.ts.map +1 -1
- package/dist/es6/layout/lib/utils/flexItem.js +42 -24
- package/dist/es6/layout/lib/utils/grid.d.ts +40 -35
- package/dist/es6/layout/lib/utils/grid.d.ts.map +1 -1
- package/dist/es6/layout/lib/utils/grid.js +98 -70
- package/dist/es6/layout/lib/utils/gridItem.d.ts +17 -14
- package/dist/es6/layout/lib/utils/gridItem.d.ts.map +1 -1
- package/dist/es6/layout/lib/utils/gridItem.js +57 -28
- package/dist/es6/layout/lib/utils/layout.d.ts +47 -25
- package/dist/es6/layout/lib/utils/layout.d.ts.map +1 -1
- package/dist/es6/layout/lib/utils/layout.js +70 -31
- package/dist/es6/layout/lib/utils/other.d.ts +44 -2
- package/dist/es6/layout/lib/utils/other.d.ts.map +1 -1
- package/dist/es6/layout/lib/utils/other.js +100 -15
- package/dist/es6/layout/lib/utils/position.d.ts +37 -20
- package/dist/es6/layout/lib/utils/position.d.ts.map +1 -1
- package/dist/es6/layout/lib/utils/position.js +48 -64
- package/dist/es6/layout/lib/utils/space.d.ts +107 -51
- package/dist/es6/layout/lib/utils/space.d.ts.map +1 -1
- package/dist/es6/layout/lib/utils/space.js +97 -146
- package/dist/es6/layout/lib/utils/stack.d.ts +3 -6
- package/dist/es6/layout/lib/utils/stack.d.ts.map +1 -1
- package/dist/es6/layout/lib/utils/stack.js +13 -39
- package/dist/es6/layout/lib/utils/systemProps.d.ts +31 -0
- package/dist/es6/layout/lib/utils/systemProps.d.ts.map +1 -0
- package/dist/es6/layout/lib/utils/systemProps.js +1 -0
- package/dist/es6/layout/lib/utils/text.d.ts +33 -15
- package/dist/es6/layout/lib/utils/text.d.ts.map +1 -1
- package/dist/es6/layout/lib/utils/text.js +73 -36
- package/dist/es6/modal/lib/Modal.d.ts +1 -1
- 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/hooks/useReturnFocus.d.ts.map +1 -1
- package/dist/es6/popup/lib/hooks/useReturnFocus.js +103 -3
- package/dist/es6/tabs/lib/TabsItem.d.ts +1 -1
- package/dist/es6/tokens/lib/colors.types.d.ts +4 -6
- package/dist/es6/tokens/lib/colors.types.d.ts.map +1 -1
- package/icon/lib/SystemIcon.tsx +1 -1
- package/layout/index.ts +8 -4
- package/layout/lib/Box.tsx +10 -36
- package/layout/lib/Flex.tsx +5 -1
- package/layout/lib/Grid.tsx +3 -4
- package/layout/lib/utils/background.ts +83 -0
- package/layout/lib/utils/border/color.ts +85 -0
- package/layout/lib/utils/border/index.ts +49 -0
- package/layout/lib/utils/border/lineStyle.ts +87 -0
- package/layout/lib/utils/border/radius.ts +61 -0
- package/layout/lib/utils/border/shorthand.ts +73 -0
- package/layout/lib/utils/border/width.ts +73 -0
- package/layout/lib/utils/buildStyleFns.ts +117 -0
- package/layout/lib/utils/color.ts +40 -55
- package/layout/lib/utils/depth.ts +28 -24
- package/layout/lib/utils/flex.ts +83 -32
- package/layout/lib/utils/flexItem.ts +54 -36
- package/layout/lib/utils/grid.ts +131 -94
- package/layout/lib/utils/gridItem.ts +69 -41
- package/layout/lib/utils/layout.ts +109 -50
- package/layout/lib/utils/other.ts +142 -15
- package/layout/lib/utils/position.ts +79 -73
- package/layout/lib/utils/space.ts +202 -196
- package/layout/lib/utils/stack.ts +19 -45
- package/layout/lib/utils/systemProps.ts +46 -0
- package/layout/lib/utils/text.ts +99 -34
- package/package.json +3 -3
- package/popup/lib/hooks/useReturnFocus.tsx +117 -4
- package/tokens/lib/colors.types.ts +4 -7
- package/dist/commonjs/layout/lib/utils/border.d.ts +0 -103
- package/dist/commonjs/layout/lib/utils/border.d.ts.map +0 -1
- package/dist/commonjs/layout/lib/utils/border.js +0 -153
- package/dist/commonjs/layout/lib/utils/font.d.ts +0 -29
- package/dist/commonjs/layout/lib/utils/font.d.ts.map +0 -1
- package/dist/commonjs/layout/lib/utils/font.js +0 -57
- package/dist/es6/layout/lib/utils/border.d.ts +0 -103
- package/dist/es6/layout/lib/utils/border.d.ts.map +0 -1
- package/dist/es6/layout/lib/utils/border.js +0 -149
- package/dist/es6/layout/lib/utils/font.d.ts +0 -29
- package/dist/es6/layout/lib/utils/font.d.ts.map +0 -1
- package/dist/es6/layout/lib/utils/font.js +0 -53
- package/layout/lib/utils/border.ts +0 -263
- package/layout/lib/utils/font.ts +0 -67
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Is an element focusable? This function performs various tests to see if the element in question
|
|
3
3
|
* can receive focus. Should skip disabled elements as they are not focusable.
|
|
4
4
|
*/
|
|
5
|
-
export const isFocusable = (element:
|
|
5
|
+
export const isFocusable = (element: Element): boolean => {
|
|
6
6
|
if (element.hasAttribute('disabled')) {
|
|
7
|
-
return
|
|
7
|
+
return false;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
const nodeName = element.nodeName.toLowerCase();
|
|
@@ -35,7 +35,7 @@ export const getFirstFocusableElement = (container: HTMLElement): HTMLElement |
|
|
|
35
35
|
|
|
36
36
|
for (let i = 0; i < elements.length; i++) {
|
|
37
37
|
const element = elements.item(i);
|
|
38
|
-
if (element && isFocusable(element
|
|
38
|
+
if (element && isFocusable(element) && element.getAttribute('tabindex') !== '-1') {
|
|
39
39
|
return element as HTMLElement;
|
|
40
40
|
}
|
|
41
41
|
}
|
|
@@ -51,7 +51,7 @@ export const getLastFocusableElement = (container: HTMLElement): HTMLElement | n
|
|
|
51
51
|
|
|
52
52
|
for (let i = elements.length - 1; i >= 0; i--) {
|
|
53
53
|
const element = elements.item(i);
|
|
54
|
-
if (element && isFocusable(element
|
|
54
|
+
if (element && isFocusable(element) && element.getAttribute('tabindex') !== '-1') {
|
|
55
55
|
return element as HTMLElement;
|
|
56
56
|
}
|
|
57
57
|
}
|
|
@@ -8,6 +8,6 @@ export interface CardProps extends BoxProps {
|
|
|
8
8
|
}
|
|
9
9
|
export declare const Card: import("../../common").ElementComponent<"div", CardProps> & {
|
|
10
10
|
Heading: import("../../common").ElementComponent<"h3", import("./CardHeading").CardHeadingProps>;
|
|
11
|
-
Body: import("../../common").ElementComponent<"div", import("../../layout").
|
|
11
|
+
Body: import("../../common").ElementComponent<"div", import("../../layout").BackgroundStyleProps & import("../../layout/lib/utils/border/color").BorderColorStyleProps & import("../../layout/lib/utils/border/lineStyle").BorderLineStyleProps & import("../../layout/lib/utils/border/radius").BorderRadiusStyleProps & import("../../layout/lib/utils/border/shorthand").BorderShorthandStyleProps & import("../../layout/lib/utils/border/width").BorderWidthStyleProps & import("../../layout").ColorStyleProps & import("../../layout").DepthStyleProps & import("../../layout").FlexItemStyleProps & import("../../layout").GridItemStyleProps & import("../../layout").LayoutStyleProps & import("../../layout").OtherStyleProps & import("../../layout").PositionStyleProps & import("../../layout").SpaceStyleProps & import("../../layout").TextStyleProps>;
|
|
12
12
|
};
|
|
13
13
|
//# sourceMappingURL=Card.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const CardBody: import("../../common").ElementComponent<"div", import("../../layout").
|
|
1
|
+
export declare const CardBody: import("../../common").ElementComponent<"div", import("../../layout").BackgroundStyleProps & import("../../layout/lib/utils/border/color").BorderColorStyleProps & import("../../layout/lib/utils/border/lineStyle").BorderLineStyleProps & import("../../layout/lib/utils/border/radius").BorderRadiusStyleProps & import("../../layout/lib/utils/border/shorthand").BorderShorthandStyleProps & import("../../layout/lib/utils/border/width").BorderWidthStyleProps & import("../../layout").ColorStyleProps & import("../../layout").DepthStyleProps & import("../../layout").FlexItemStyleProps & import("../../layout").GridItemStyleProps & import("../../layout").LayoutStyleProps & import("../../layout").OtherStyleProps & import("../../layout").PositionStyleProps & import("../../layout").SpaceStyleProps & import("../../layout").TextStyleProps>;
|
|
2
2
|
//# sourceMappingURL=CardBody.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardBody.d.ts","sourceRoot":"","sources":["../../../../card/lib/CardBody.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"CardBody.d.ts","sourceRoot":"","sources":["../../../../card/lib/CardBody.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,QAAQ,k0BASnB,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Is an element focusable? This function performs various tests to see if the element in question
|
|
3
3
|
* can receive focus. Should skip disabled elements as they are not focusable.
|
|
4
4
|
*/
|
|
5
|
-
export declare const isFocusable: (element:
|
|
5
|
+
export declare const isFocusable: (element: Element) => boolean;
|
|
6
6
|
/**
|
|
7
7
|
* Get the first focusable element in a container.
|
|
8
8
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elements.d.ts","sourceRoot":"","sources":["../../../../../common/lib/utils/elements.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,WAAW,YAAa,
|
|
1
|
+
{"version":3,"file":"elements.d.ts","sourceRoot":"","sources":["../../../../../common/lib/utils/elements.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,WAAW,YAAa,OAAO,KAAG,OAuB9C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wBAAwB,cAAe,WAAW,KAAG,WAAW,GAAG,IAW/E,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,uBAAuB,cAAe,WAAW,KAAG,WAAW,GAAG,IAW9E,CAAC"}
|
|
@@ -7,7 +7,7 @@ exports.getLastFocusableElement = exports.getFirstFocusableElement = exports.isF
|
|
|
7
7
|
*/
|
|
8
8
|
var isFocusable = function (element) {
|
|
9
9
|
if (element.hasAttribute('disabled')) {
|
|
10
|
-
return
|
|
10
|
+
return false;
|
|
11
11
|
}
|
|
12
12
|
var nodeName = element.nodeName.toLowerCase();
|
|
13
13
|
var validInput = nodeName === 'input' && element.getAttribute('type') !== 'hidden';
|
|
@@ -32,7 +32,7 @@ var getFirstFocusableElement = function (container) {
|
|
|
32
32
|
var elements = container.querySelectorAll('*');
|
|
33
33
|
for (var i = 0; i < elements.length; i++) {
|
|
34
34
|
var element = elements.item(i);
|
|
35
|
-
if (element && exports.isFocusable(element)) {
|
|
35
|
+
if (element && exports.isFocusable(element) && element.getAttribute('tabindex') !== '-1') {
|
|
36
36
|
return element;
|
|
37
37
|
}
|
|
38
38
|
}
|
|
@@ -46,7 +46,7 @@ var getLastFocusableElement = function (container) {
|
|
|
46
46
|
var elements = container.querySelectorAll('*');
|
|
47
47
|
for (var i = elements.length - 1; i >= 0; i--) {
|
|
48
48
|
var element = elements.item(i);
|
|
49
|
-
if (element && exports.isFocusable(element)) {
|
|
49
|
+
if (element && exports.isFocusable(element) && element.getAttribute('tabindex') !== '-1') {
|
|
50
50
|
return element;
|
|
51
51
|
}
|
|
52
52
|
}
|
|
@@ -88,7 +88,7 @@ export declare const Dialog: import("../../common").ComponentM<DialogProps & Par
|
|
|
88
88
|
hide(event?: Event | React.SyntheticEvent<Element, Event> | undefined): void;
|
|
89
89
|
};
|
|
90
90
|
}> & {
|
|
91
|
-
Body: import("../../common").ElementComponentM<"div", import("../..").
|
|
91
|
+
Body: import("../../common").ElementComponentM<"div", import("../..").BackgroundStyleProps & import("../../layout/lib/utils/border/color").BorderColorStyleProps & import("../../layout/lib/utils/border/lineStyle").BorderLineStyleProps & import("../../layout/lib/utils/border/radius").BorderRadiusStyleProps & import("../../layout/lib/utils/border/shorthand").BorderShorthandStyleProps & import("../../layout/lib/utils/border/width").BorderWidthStyleProps & import("../..").ColorStyleProps & import("../..").DepthStyleProps & import("../..").FlexItemStyleProps & import("../..").GridItemStyleProps & import("../..").LayoutStyleProps & import("../..").OtherStyleProps & import("../..").PositionStyleProps & import("../..").SpaceStyleProps & import("../..").TextStyleProps & React.HTMLAttributes<HTMLDivElement>, {
|
|
92
92
|
state: {
|
|
93
93
|
stackRef: React.RefObject<HTMLDivElement>;
|
|
94
94
|
targetRef: React.RefObject<HTMLButtonElement>;
|
|
@@ -39,7 +39,7 @@ export interface SystemIconStyles {
|
|
|
39
39
|
*/
|
|
40
40
|
fillHover?: string;
|
|
41
41
|
}
|
|
42
|
-
export interface SystemIconProps extends SystemIconStyles, Omit<IconProps, 'src' | 'color' | 'type' | 'background'> {
|
|
42
|
+
export interface SystemIconProps extends SystemIconStyles, Omit<IconProps, 'src' | 'color' | 'fill' | 'type' | 'background'> {
|
|
43
43
|
/**
|
|
44
44
|
* The icon to display from `@workday/canvas-system-icons-web`.
|
|
45
45
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SystemIcon.d.ts","sourceRoot":"","sources":["../../../../icon/lib/SystemIcon.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAC,gBAAgB,EAAkB,MAAM,8BAA8B,CAAC;AAC/E,OAAO,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAO,SAAS,EAAC,MAAM,QAAQ,CAAC;AAGvC,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,eACf,SAAQ,gBAAgB,EACtB,IAAI,CAAC,SAAS,EAAE,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"SystemIcon.d.ts","sourceRoot":"","sources":["../../../../icon/lib/SystemIcon.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAC,gBAAgB,EAAkB,MAAM,8BAA8B,CAAC;AAC/E,OAAO,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAO,SAAS,EAAC,MAAM,QAAQ,CAAC;AAGvC,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,eACf,SAAQ,gBAAgB,EACtB,IAAI,CAAC,SAAS,EAAE,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,YAAY,CAAC;IACnE;;OAEG;IACH,IAAI,EAAE,gBAAgB,CAAC;IACvB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,gBAAgB,8FAS1B,gBAAgB,KAAG,SAmBpB,CAAC;AAEH,eAAO,MAAM,UAAU,kEA4CrB,CAAC"}
|
|
@@ -2,20 +2,24 @@ import { DeprecatedLayout } from './lib/Layout';
|
|
|
2
2
|
import { DeprecatedColumn } from './lib/Column';
|
|
3
3
|
export { DeprecatedLayout, DeprecatedColumn };
|
|
4
4
|
export * from './lib/Box';
|
|
5
|
+
export * from './lib/utils/background';
|
|
5
6
|
export * from './lib/utils/border';
|
|
6
7
|
export * from './lib/utils/color';
|
|
7
|
-
export { DepthStyleProps } from './lib/utils/depth';
|
|
8
|
+
export { DepthStyleProps, depthStyleFnConfigs } from './lib/utils/depth';
|
|
9
|
+
export * from './lib/utils/flex';
|
|
8
10
|
export * from './lib/utils/flexItem';
|
|
9
|
-
export * from './lib/utils/
|
|
11
|
+
export * from './lib/utils/grid';
|
|
12
|
+
export * from './lib/utils/gridItem';
|
|
10
13
|
export * from './lib/utils/layout';
|
|
14
|
+
export * from './lib/utils/other';
|
|
11
15
|
export * from './lib/utils/position';
|
|
12
|
-
export { SpaceStyleProps } from './lib/utils/space';
|
|
16
|
+
export { SpaceStyleProps, spaceStyleFnConfigs } from './lib/utils/space';
|
|
13
17
|
export * from './lib/utils/text';
|
|
14
18
|
export * from './lib/Flex';
|
|
15
19
|
export * from './lib/Grid';
|
|
16
20
|
export * from './lib/Stack';
|
|
17
21
|
export type { FlexStyleProps } from './lib/utils/flex';
|
|
18
22
|
export type { GridStyleProps } from './lib/utils/grid';
|
|
19
|
-
export type { GridItemStyleProps } from './lib/utils/gridItem';
|
|
23
|
+
export type { GridItemStyleProps, gridItemStyleFnConfigs } from './lib/utils/gridItem';
|
|
20
24
|
export type { StackSpacing, StackDirection, StackStyleProps } from './lib/utils/stack';
|
|
21
25
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../layout/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAC,gBAAgB,EAAC,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAC,CAAC;AAC7C,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../layout/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAC,gBAAgB,EAAC,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAC,CAAC;AAC7C,cAAc,WAAW,CAAC;AAC1B,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAC,eAAe,EAAE,mBAAmB,EAAC,MAAM,mBAAmB,CAAC;AACvE,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAC,eAAe,EAAE,mBAAmB,EAAC,MAAM,mBAAmB,CAAC;AACvE,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,YAAY,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AACvF,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -10,18 +10,26 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
10
10
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.DeprecatedColumn = exports.DeprecatedLayout = void 0;
|
|
13
|
+
exports.spaceStyleFnConfigs = exports.depthStyleFnConfigs = exports.DeprecatedColumn = exports.DeprecatedLayout = void 0;
|
|
14
14
|
var Layout_1 = require("./lib/Layout");
|
|
15
15
|
Object.defineProperty(exports, "DeprecatedLayout", { enumerable: true, get: function () { return Layout_1.DeprecatedLayout; } });
|
|
16
16
|
var Column_1 = require("./lib/Column");
|
|
17
17
|
Object.defineProperty(exports, "DeprecatedColumn", { enumerable: true, get: function () { return Column_1.DeprecatedColumn; } });
|
|
18
18
|
__exportStar(require("./lib/Box"), exports);
|
|
19
|
+
__exportStar(require("./lib/utils/background"), exports);
|
|
19
20
|
__exportStar(require("./lib/utils/border"), exports);
|
|
20
21
|
__exportStar(require("./lib/utils/color"), exports);
|
|
22
|
+
var depth_1 = require("./lib/utils/depth");
|
|
23
|
+
Object.defineProperty(exports, "depthStyleFnConfigs", { enumerable: true, get: function () { return depth_1.depthStyleFnConfigs; } });
|
|
24
|
+
__exportStar(require("./lib/utils/flex"), exports);
|
|
21
25
|
__exportStar(require("./lib/utils/flexItem"), exports);
|
|
22
|
-
__exportStar(require("./lib/utils/
|
|
26
|
+
__exportStar(require("./lib/utils/grid"), exports);
|
|
27
|
+
__exportStar(require("./lib/utils/gridItem"), exports);
|
|
23
28
|
__exportStar(require("./lib/utils/layout"), exports);
|
|
29
|
+
__exportStar(require("./lib/utils/other"), exports);
|
|
24
30
|
__exportStar(require("./lib/utils/position"), exports);
|
|
31
|
+
var space_1 = require("./lib/utils/space");
|
|
32
|
+
Object.defineProperty(exports, "spaceStyleFnConfigs", { enumerable: true, get: function () { return space_1.spaceStyleFnConfigs; } });
|
|
25
33
|
__exportStar(require("./lib/utils/text"), exports);
|
|
26
34
|
__exportStar(require("./lib/Flex"), exports);
|
|
27
35
|
__exportStar(require("./lib/Grid"), exports);
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { BackgroundStyleProps } from './utils/background';
|
|
2
3
|
import { BorderStyleProps } from './utils/border';
|
|
3
4
|
import { ColorStyleProps } from './utils/color';
|
|
4
5
|
import { DepthStyleProps } from './utils/depth';
|
|
5
6
|
import { FlexItemStyleProps } from './utils/flexItem';
|
|
6
7
|
import { GridItemStyleProps } from './utils/gridItem';
|
|
7
|
-
import { FontStyleProps } from './utils/font';
|
|
8
8
|
import { LayoutStyleProps } from './utils/layout';
|
|
9
9
|
import { OtherStyleProps } from './utils/other';
|
|
10
10
|
import { PositionStyleProps } from './utils/position';
|
|
11
11
|
import { SpaceStyleProps } from './utils/space';
|
|
12
12
|
import { TextStyleProps } from './utils/text';
|
|
13
|
-
export declare type BoxProps = BorderStyleProps & ColorStyleProps & DepthStyleProps & FlexItemStyleProps & GridItemStyleProps &
|
|
13
|
+
export declare type BoxProps = BackgroundStyleProps & BorderStyleProps & ColorStyleProps & DepthStyleProps & FlexItemStyleProps & GridItemStyleProps & LayoutStyleProps & OtherStyleProps & PositionStyleProps & SpaceStyleProps & TextStyleProps & {
|
|
14
14
|
children?: React.ReactNode;
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
17
17
|
* A function that allows us to call Box styles on an element and reduce the amount of elements in the React Dom tree.
|
|
18
18
|
* Instead of using the `as` in a styled function, you can just call this instead to pass those props to the styled element
|
|
19
19
|
* @example
|
|
20
|
+
* ```
|
|
20
21
|
* import { boxStyleFn } from '@workday/canvas-kit-react/layout';
|
|
21
22
|
* const StyledHeader = styled('h1')(
|
|
22
23
|
* boxStyleFn,
|
|
@@ -25,9 +26,10 @@ export declare type BoxProps = BorderStyleProps & ColorStyleProps & DepthStylePr
|
|
|
25
26
|
* }
|
|
26
27
|
* )
|
|
27
28
|
*
|
|
28
|
-
*
|
|
29
|
+
* ...
|
|
29
30
|
*
|
|
30
31
|
* <StyledHeader color='red'>Hello World</StyledHeader>
|
|
32
|
+
* ```
|
|
31
33
|
*/
|
|
32
34
|
export declare const boxStyleFn: <P extends BoxProps>(props: P) => {};
|
|
33
35
|
/**
|
|
@@ -47,5 +49,5 @@ export declare const boxStyleFn: <P extends BoxProps>(props: P) => {};
|
|
|
47
49
|
* );
|
|
48
50
|
*
|
|
49
51
|
*/
|
|
50
|
-
export declare const Box: import("../../common").ElementComponent<"div",
|
|
52
|
+
export declare const Box: import("../../common").ElementComponent<"div", BackgroundStyleProps & import("./utils/border/color").BorderColorStyleProps & import("./utils/border/lineStyle").BorderLineStyleProps & import("./utils/border/radius").BorderRadiusStyleProps & import("./utils/border/shorthand").BorderShorthandStyleProps & import("./utils/border/width").BorderWidthStyleProps & ColorStyleProps & DepthStyleProps & FlexItemStyleProps & GridItemStyleProps & LayoutStyleProps & OtherStyleProps & PositionStyleProps & SpaceStyleProps & TextStyleProps>;
|
|
51
53
|
//# sourceMappingURL=Box.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Box.d.ts","sourceRoot":"","sources":["../../../../layout/lib/Box.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,EAAS,gBAAgB,EAAC,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAQ,eAAe,EAAC,MAAM,eAAe,CAAC;AACrD,OAAO,EAAQ,eAAe,EAAC,MAAM,eAAe,CAAC;AACrD,OAAO,EAAW,kBAAkB,EAAC,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAW,kBAAkB,EAAC,MAAM,kBAAkB,CAAC;AAC9D,OAAO,
|
|
1
|
+
{"version":3,"file":"Box.d.ts","sourceRoot":"","sources":["../../../../layout/lib/Box.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,EAAa,oBAAoB,EAAC,MAAM,oBAAoB,CAAC;AACpE,OAAO,EAAS,gBAAgB,EAAC,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAQ,eAAe,EAAC,MAAM,eAAe,CAAC;AACrD,OAAO,EAAQ,eAAe,EAAC,MAAM,eAAe,CAAC;AACrD,OAAO,EAAW,kBAAkB,EAAC,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAW,kBAAkB,EAAC,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAS,gBAAgB,EAAC,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAQ,eAAe,EAAC,MAAM,eAAe,CAAC;AACrD,OAAO,EAAW,kBAAkB,EAAC,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAQ,eAAe,EAAC,MAAM,eAAe,CAAC;AACrD,OAAO,EAAO,cAAc,EAAC,MAAM,cAAc,CAAC;AAElD,oBAAY,QAAQ,GAAG,oBAAoB,GACzC,gBAAgB,GAChB,eAAe,GACf,eAAe,GACf,kBAAkB,GAClB,kBAAkB,GAClB,gBAAgB,GAChB,eAAe,GACf,kBAAkB,GAClB,eAAe,GACf,cAAc,GAAG;IACf,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;AA4BJ;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,UAAU,sCA0BtB,CAAC;AAQF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,GAAG,ihBAad,CAAC"}
|
|
@@ -50,12 +50,12 @@ var styled_1 = __importDefault(require("@emotion/styled"));
|
|
|
50
50
|
var is_prop_valid_1 = __importDefault(require("@emotion/is-prop-valid"));
|
|
51
51
|
var common_1 = require("@workday/canvas-kit-react/common");
|
|
52
52
|
// style props
|
|
53
|
+
var background_1 = require("./utils/background");
|
|
53
54
|
var border_1 = require("./utils/border");
|
|
54
55
|
var color_1 = require("./utils/color");
|
|
55
56
|
var depth_1 = require("./utils/depth");
|
|
56
57
|
var flexItem_1 = require("./utils/flexItem");
|
|
57
58
|
var gridItem_1 = require("./utils/gridItem");
|
|
58
|
-
var font_1 = require("./utils/font");
|
|
59
59
|
var layout_1 = require("./utils/layout");
|
|
60
60
|
var other_1 = require("./utils/other");
|
|
61
61
|
var position_1 = require("./utils/position");
|
|
@@ -89,6 +89,7 @@ var shouldForwardProp = function (prop) {
|
|
|
89
89
|
* A function that allows us to call Box styles on an element and reduce the amount of elements in the React Dom tree.
|
|
90
90
|
* Instead of using the `as` in a styled function, you can just call this instead to pass those props to the styled element
|
|
91
91
|
* @example
|
|
92
|
+
* ```
|
|
92
93
|
* import { boxStyleFn } from '@workday/canvas-kit-react/layout';
|
|
93
94
|
* const StyledHeader = styled('h1')(
|
|
94
95
|
* boxStyleFn,
|
|
@@ -97,22 +98,24 @@ var shouldForwardProp = function (prop) {
|
|
|
97
98
|
* }
|
|
98
99
|
* )
|
|
99
100
|
*
|
|
100
|
-
*
|
|
101
|
+
* ...
|
|
101
102
|
*
|
|
102
103
|
* <StyledHeader color='red'>Hello World</StyledHeader>
|
|
104
|
+
* ```
|
|
103
105
|
*/
|
|
104
106
|
var boxStyleFn = function (props) {
|
|
105
107
|
return [
|
|
106
108
|
{
|
|
107
109
|
boxSizing: 'border-box',
|
|
108
110
|
},
|
|
111
|
+
background_1.background,
|
|
109
112
|
border_1.border,
|
|
110
113
|
color_1.color,
|
|
111
114
|
depth_1.depth,
|
|
112
115
|
flexItem_1.flexItem,
|
|
113
116
|
gridItem_1.gridItem,
|
|
114
|
-
font_1.font,
|
|
115
117
|
layout_1.layout,
|
|
118
|
+
other_1.other,
|
|
116
119
|
position_1.position,
|
|
117
120
|
space_1.space,
|
|
118
121
|
text_1.text,
|
|
@@ -129,13 +132,9 @@ var boxStyleFn = function (props) {
|
|
|
129
132
|
};
|
|
130
133
|
exports.boxStyleFn = boxStyleFn;
|
|
131
134
|
// Meant to be used with elements. The `shouldForwardProps` will remove all style props
|
|
132
|
-
var StyledBoxElement = styled_1.default('div', { shouldForwardProp: shouldForwardProp })(
|
|
133
|
-
boxSizing: 'border-box',
|
|
134
|
-
}, border_1.border, color_1.color, depth_1.depth, flexItem_1.flexItem, gridItem_1.gridItem, font_1.font, layout_1.layout, position_1.position, space_1.space, text_1.text);
|
|
135
|
+
var StyledBoxElement = styled_1.default('div', { shouldForwardProp: shouldForwardProp })(exports.boxStyleFn);
|
|
135
136
|
// Meant to be used with components. There is no `shouldForwardProps` - all props will be forwarded to the component
|
|
136
|
-
var StyledBoxComponent = styled_1.default('div')(
|
|
137
|
-
boxSizing: 'border-box',
|
|
138
|
-
}, border_1.border, color_1.color, depth_1.depth, flexItem_1.flexItem, gridItem_1.gridItem, font_1.font, layout_1.layout, other_1.other, position_1.position, space_1.space, text_1.text);
|
|
137
|
+
var StyledBoxComponent = styled_1.default('div')(exports.boxStyleFn);
|
|
139
138
|
/**
|
|
140
139
|
* `Box` is a primitive component that provides a common, ergonomic API around Canvas design tokens.
|
|
141
140
|
* It is highly flexible, and its primary purpose is to build other components.
|
|
@@ -7,6 +7,7 @@ export declare type FlexProps = BoxProps & FlexStyleProps;
|
|
|
7
7
|
* `Flex` is built on top of `Box` and has access to all `BoxProps`.
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
10
|
+
* ```tsx
|
|
10
11
|
* import { Flex, FlexProps } from '@workday/canvas-kit-react/layout';
|
|
11
12
|
*
|
|
12
13
|
* interface CardProps extends FlexProps {
|
|
@@ -20,7 +21,9 @@ export declare type FlexProps = BoxProps & FlexStyleProps;
|
|
|
20
21
|
* <p>This card uses flexbox to set its layout.</p>
|
|
21
22
|
* </Flex>
|
|
22
23
|
* );
|
|
23
|
-
*
|
|
24
|
+
* ```
|
|
24
25
|
*/
|
|
25
|
-
export declare const Flex: import("../../common").ElementComponent<"div", import("..").
|
|
26
|
+
export declare const Flex: import("../../common").ElementComponent<"div", import("..").BackgroundStyleProps & import("./utils/border/color").BorderColorStyleProps & import("./utils/border/lineStyle").BorderLineStyleProps & import("./utils/border/radius").BorderRadiusStyleProps & import("./utils/border/shorthand").BorderShorthandStyleProps & import("./utils/border/width").BorderWidthStyleProps & import("..").ColorStyleProps & import("..").DepthStyleProps & import("..").FlexItemStyleProps & import("..").GridItemStyleProps & import("..").LayoutStyleProps & import("..").OtherStyleProps & import("..").PositionStyleProps & import("..").SpaceStyleProps & import("..").TextStyleProps & FlexStyleProps> & {
|
|
27
|
+
Item: import("../../common").ElementComponent<"div", import("..").BackgroundStyleProps & import("./utils/border/color").BorderColorStyleProps & import("./utils/border/lineStyle").BorderLineStyleProps & import("./utils/border/radius").BorderRadiusStyleProps & import("./utils/border/shorthand").BorderShorthandStyleProps & import("./utils/border/width").BorderWidthStyleProps & import("..").ColorStyleProps & import("..").DepthStyleProps & import("..").FlexItemStyleProps & import("..").GridItemStyleProps & import("..").LayoutStyleProps & import("..").OtherStyleProps & import("..").PositionStyleProps & import("..").SpaceStyleProps & import("..").TextStyleProps>;
|
|
28
|
+
};
|
|
26
29
|
//# sourceMappingURL=Flex.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Flex.d.ts","sourceRoot":"","sources":["../../../../layout/lib/Flex.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAM,QAAQ,EAAC,MAAM,OAAO,CAAC;AAEpC,OAAO,EAAO,cAAc,EAAC,MAAM,cAAc,CAAC;AAElD,oBAAY,SAAS,GAAG,QAAQ,GAAG,cAAc,CAAC;AASlD
|
|
1
|
+
{"version":3,"file":"Flex.d.ts","sourceRoot":"","sources":["../../../../layout/lib/Flex.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAM,QAAQ,EAAC,MAAM,OAAO,CAAC;AAEpC,OAAO,EAAO,cAAc,EAAC,MAAM,cAAc,CAAC;AAElD,oBAAY,SAAS,GAAG,QAAQ,GAAG,cAAc,CAAC;AASlD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,IAAI;;CAYf,CAAC"}
|
|
@@ -59,6 +59,7 @@ var StyledFlex = styled_1.default(Box_1.Box)({
|
|
|
59
59
|
* `Flex` is built on top of `Box` and has access to all `BoxProps`.
|
|
60
60
|
*
|
|
61
61
|
* @example
|
|
62
|
+
* ```tsx
|
|
62
63
|
* import { Flex, FlexProps } from '@workday/canvas-kit-react/layout';
|
|
63
64
|
*
|
|
64
65
|
* interface CardProps extends FlexProps {
|
|
@@ -72,7 +73,7 @@ var StyledFlex = styled_1.default(Box_1.Box)({
|
|
|
72
73
|
* <p>This card uses flexbox to set its layout.</p>
|
|
73
74
|
* </Flex>
|
|
74
75
|
* );
|
|
75
|
-
*
|
|
76
|
+
* ```
|
|
76
77
|
*/
|
|
77
78
|
exports.Flex = common_1.createComponent('div')({
|
|
78
79
|
displayName: 'Flex',
|
|
@@ -80,4 +81,7 @@ exports.Flex = common_1.createComponent('div')({
|
|
|
80
81
|
var children = _a.children, elemProps = __rest(_a, ["children"]);
|
|
81
82
|
return (React.createElement(StyledFlex, __assign({ as: Element, ref: ref }, elemProps), children));
|
|
82
83
|
},
|
|
84
|
+
subComponents: {
|
|
85
|
+
Item: Box_1.Box,
|
|
86
|
+
},
|
|
83
87
|
});
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { BoxProps } from './Box';
|
|
2
2
|
import { GridStyleProps } from './utils/grid';
|
|
3
|
-
import { GridItemStyleProps } from './utils/gridItem';
|
|
4
3
|
export declare type GridProps = BoxProps & GridStyleProps;
|
|
5
|
-
export declare type GridItemProps = BoxProps
|
|
4
|
+
export declare type GridItemProps = BoxProps;
|
|
6
5
|
/**
|
|
7
6
|
* `Grid` is a two-dimensional layout system for the web. It lets you lay content out in rows and columns.
|
|
8
7
|
* It is highly flexible, and can be used on its own or to build other components.
|
|
8
|
+
* `Grid` is built on top of `Box` and has access to all `BoxProps`.
|
|
9
9
|
*
|
|
10
10
|
* @example
|
|
11
|
-
* ```
|
|
11
|
+
* ```tsx
|
|
12
12
|
* import { Grid } from '@workday/canvas-kit-react/layout';
|
|
13
|
-
* `Grid` is built on top of `Box` and has access to all `BoxProps`.
|
|
14
13
|
*
|
|
15
14
|
* interface CardProps extends GridProps {
|
|
16
15
|
* // card-specific props
|
|
@@ -25,7 +24,7 @@ export declare type GridItemProps = BoxProps & GridItemStyleProps;
|
|
|
25
24
|
* );
|
|
26
25
|
*```
|
|
27
26
|
*/
|
|
28
|
-
export declare const Grid: import("../../common").ElementComponent<"div", import("..").
|
|
27
|
+
export declare const Grid: import("../../common").ElementComponent<"div", import("..").BackgroundStyleProps & import("./utils/border/color").BorderColorStyleProps & import("./utils/border/lineStyle").BorderLineStyleProps & import("./utils/border/radius").BorderRadiusStyleProps & import("./utils/border/shorthand").BorderShorthandStyleProps & import("./utils/border/width").BorderWidthStyleProps & import("..").ColorStyleProps & import("..").DepthStyleProps & import("..").FlexItemStyleProps & import("..").GridItemStyleProps & import("..").LayoutStyleProps & import("..").OtherStyleProps & import("..").PositionStyleProps & import("..").SpaceStyleProps & import("..").TextStyleProps & GridStyleProps> & {
|
|
29
28
|
/**
|
|
30
29
|
* `<Grid.Item />` is the child specific sub-component to `<Grid/>`. `<Grid.Item />` gets child specific props, whereas `<Grid./>` gets parent container props.
|
|
31
30
|
*
|
|
@@ -47,6 +46,6 @@ export declare const Grid: import("../../common").ElementComponent<"div", import
|
|
|
47
46
|
* );
|
|
48
47
|
*```
|
|
49
48
|
*/
|
|
50
|
-
Item: import("../../common").ElementComponent<"div", import("..").
|
|
49
|
+
Item: import("../../common").ElementComponent<"div", import("..").BackgroundStyleProps & import("./utils/border/color").BorderColorStyleProps & import("./utils/border/lineStyle").BorderLineStyleProps & import("./utils/border/radius").BorderRadiusStyleProps & import("./utils/border/shorthand").BorderShorthandStyleProps & import("./utils/border/width").BorderWidthStyleProps & import("..").ColorStyleProps & import("..").DepthStyleProps & import("..").FlexItemStyleProps & import("..").GridItemStyleProps & import("..").LayoutStyleProps & import("..").OtherStyleProps & import("..").PositionStyleProps & import("..").SpaceStyleProps & import("..").TextStyleProps>;
|
|
51
50
|
};
|
|
52
51
|
//# sourceMappingURL=Grid.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Grid.d.ts","sourceRoot":"","sources":["../../../../layout/lib/Grid.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAM,QAAQ,EAAC,MAAM,OAAO,CAAC;AAEpC,OAAO,EAAO,cAAc,EAAC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"Grid.d.ts","sourceRoot":"","sources":["../../../../layout/lib/Grid.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAM,QAAQ,EAAC,MAAM,OAAO,CAAC;AAEpC,OAAO,EAAO,cAAc,EAAC,MAAM,cAAc,CAAC;AAElD,oBAAY,SAAS,GAAG,QAAQ,GAAG,cAAc,CAAC;AAClD,oBAAY,aAAa,GAAG,QAAQ,CAAC;AAoBrC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,IAAI;IAUb;;;;;;;;;;;;;;;;;;;;OAoBG;;CAIL,CAAC"}
|
|
@@ -63,11 +63,11 @@ var GridItem = common_1.createComponent('div')({
|
|
|
63
63
|
/**
|
|
64
64
|
* `Grid` is a two-dimensional layout system for the web. It lets you lay content out in rows and columns.
|
|
65
65
|
* It is highly flexible, and can be used on its own or to build other components.
|
|
66
|
+
* `Grid` is built on top of `Box` and has access to all `BoxProps`.
|
|
66
67
|
*
|
|
67
68
|
* @example
|
|
68
|
-
* ```
|
|
69
|
+
* ```tsx
|
|
69
70
|
* import { Grid } from '@workday/canvas-kit-react/layout';
|
|
70
|
-
* `Grid` is built on top of `Box` and has access to all `BoxProps`.
|
|
71
71
|
*
|
|
72
72
|
* interface CardProps extends GridProps {
|
|
73
73
|
* // card-specific props
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FlexProps } from './Flex';
|
|
2
2
|
import { StackStyleProps } from './utils/stack';
|
|
3
3
|
export declare type StackProps = FlexProps & StackStyleProps;
|
|
4
|
-
export declare const Stack: import("../../common").ElementComponent<"div", import("..").
|
|
5
|
-
Item: import("../../common").ElementComponent<"div", import("..").
|
|
4
|
+
export declare const Stack: import("../../common").ElementComponent<"div", import("..").BackgroundStyleProps & import("./utils/border/color").BorderColorStyleProps & import("./utils/border/lineStyle").BorderLineStyleProps & import("./utils/border/radius").BorderRadiusStyleProps & import("./utils/border/shorthand").BorderShorthandStyleProps & import("./utils/border/width").BorderWidthStyleProps & import("..").ColorStyleProps & import("..").DepthStyleProps & import("..").FlexItemStyleProps & import("..").GridItemStyleProps & import("..").LayoutStyleProps & import("..").OtherStyleProps & import("..").PositionStyleProps & import("..").SpaceStyleProps & import("..").TextStyleProps & import("..").FlexStyleProps & StackStyleProps> & {
|
|
5
|
+
Item: import("../../common").ElementComponent<"div", import("..").BackgroundStyleProps & import("./utils/border/color").BorderColorStyleProps & import("./utils/border/lineStyle").BorderLineStyleProps & import("./utils/border/radius").BorderRadiusStyleProps & import("./utils/border/shorthand").BorderShorthandStyleProps & import("./utils/border/width").BorderWidthStyleProps & import("..").ColorStyleProps & import("..").DepthStyleProps & import("..").FlexItemStyleProps & import("..").GridItemStyleProps & import("..").LayoutStyleProps & import("..").OtherStyleProps & import("..").PositionStyleProps & import("..").SpaceStyleProps & import("..").TextStyleProps>;
|
|
6
6
|
};
|
|
7
7
|
export interface HStackProps extends StackProps {
|
|
8
8
|
/**
|
|
@@ -12,7 +12,7 @@ export interface HStackProps extends StackProps {
|
|
|
12
12
|
flexDirection?: 'row' | 'row-reverse';
|
|
13
13
|
}
|
|
14
14
|
export declare const HStack: import("../../common").ElementComponent<"div", HStackProps> & {
|
|
15
|
-
Item: import("../../common").ElementComponent<"div", import("..").
|
|
15
|
+
Item: import("../../common").ElementComponent<"div", import("..").BackgroundStyleProps & import("./utils/border/color").BorderColorStyleProps & import("./utils/border/lineStyle").BorderLineStyleProps & import("./utils/border/radius").BorderRadiusStyleProps & import("./utils/border/shorthand").BorderShorthandStyleProps & import("./utils/border/width").BorderWidthStyleProps & import("..").ColorStyleProps & import("..").DepthStyleProps & import("..").FlexItemStyleProps & import("..").GridItemStyleProps & import("..").LayoutStyleProps & import("..").OtherStyleProps & import("..").PositionStyleProps & import("..").SpaceStyleProps & import("..").TextStyleProps>;
|
|
16
16
|
};
|
|
17
17
|
export interface VStackProps extends StackProps {
|
|
18
18
|
/**
|
|
@@ -22,6 +22,6 @@ export interface VStackProps extends StackProps {
|
|
|
22
22
|
flexDirection?: 'column' | 'column-reverse';
|
|
23
23
|
}
|
|
24
24
|
export declare const VStack: import("../../common").ElementComponent<"div", VStackProps> & {
|
|
25
|
-
Item: import("../../common").ElementComponent<"div", import("..").
|
|
25
|
+
Item: import("../../common").ElementComponent<"div", import("..").BackgroundStyleProps & import("./utils/border/color").BorderColorStyleProps & import("./utils/border/lineStyle").BorderLineStyleProps & import("./utils/border/radius").BorderRadiusStyleProps & import("./utils/border/shorthand").BorderShorthandStyleProps & import("./utils/border/width").BorderWidthStyleProps & import("..").ColorStyleProps & import("..").DepthStyleProps & import("..").FlexItemStyleProps & import("..").GridItemStyleProps & import("..").LayoutStyleProps & import("..").OtherStyleProps & import("..").PositionStyleProps & import("..").SpaceStyleProps & import("..").TextStyleProps>;
|
|
26
26
|
};
|
|
27
27
|
//# sourceMappingURL=Stack.d.ts.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Property } from 'csstype';
|
|
2
|
+
import { StyleFnConfig } from './buildStyleFns';
|
|
3
|
+
import { SystemPropValues } from './systemProps';
|
|
4
|
+
/** style props to set CSS background properties */
|
|
5
|
+
export declare type BackgroundStyleProps = {
|
|
6
|
+
/**
|
|
7
|
+
* - sets [CSS background property](https://developer.mozilla.org/en-US/docs/Web/CSS/background)
|
|
8
|
+
* - system tokens: `color`
|
|
9
|
+
* */
|
|
10
|
+
background?: SystemPropValues['color'];
|
|
11
|
+
/** sets [CSS background-attachment property](https://developer.mozilla.org/en-US/docs/Web/CSS/) */
|
|
12
|
+
backgroundAttachment?: Property.BackgroundAttachment;
|
|
13
|
+
/**
|
|
14
|
+
* - sets [CSS background-color property](https://developer.mozilla.org/en-US/docs/Web/CSS/background-color)
|
|
15
|
+
* - system tokens: `color`
|
|
16
|
+
* */
|
|
17
|
+
backgroundColor?: SystemPropValues['color'];
|
|
18
|
+
/** sets [CSS background-image property](https://developer.mozilla.org/en-US/docs/Web/CSS/background-image) */
|
|
19
|
+
backgroundImage?: Property.BackgroundImage;
|
|
20
|
+
/** sets [CSS background-position property](https://developer.mozilla.org/en-US/docs/Web/CSS/background-position) */
|
|
21
|
+
backgroundPosition?: Property.BackgroundPosition;
|
|
22
|
+
/** sets [CSS background-repeat property](https://developer.mozilla.org/en-US/docs/Web/CSS/background-repeat) */
|
|
23
|
+
backgroundRepeat?: Property.BackgroundRepeat;
|
|
24
|
+
/** sets [CSS background-size property](https://developer.mozilla.org/en-US/docs/Web/CSS/background-size) */
|
|
25
|
+
backgroundSize?: Property.BackgroundSize;
|
|
26
|
+
};
|
|
27
|
+
export declare const backgroundStyleFnConfigs: StyleFnConfig[];
|
|
28
|
+
export declare const backgroundFns: import("./buildStyleFns").StyleFns;
|
|
29
|
+
/**
|
|
30
|
+
* A style prop function that takes component props and returns border styles.
|
|
31
|
+
* Some props, such as background and backgroundColor, are connected to our design tokens.
|
|
32
|
+
* If no `BackgroundStyleProps` are found, it returns an empty object.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```tsx
|
|
36
|
+
* const BackgroundExample = () => (
|
|
37
|
+
* <Box backgroundColor="blueberry500">
|
|
38
|
+
* Hello, background styles!
|
|
39
|
+
* </Box>
|
|
40
|
+
* );
|
|
41
|
+
*```
|
|
42
|
+
*/
|
|
43
|
+
export declare const background: (props: BackgroundStyleProps) => {};
|
|
44
|
+
//# sourceMappingURL=background.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"background.d.ts","sourceRoot":"","sources":["../../../../../layout/lib/utils/background.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AAEjC,OAAO,EAAkC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAC/E,OAAO,EAAC,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAE/C,mDAAmD;AACnD,oBAAY,oBAAoB,GAAG;IACjC;;;SAGK;IACL,UAAU,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACvC,mGAAmG;IACnG,oBAAoB,CAAC,EAAE,QAAQ,CAAC,oBAAoB,CAAC;IACrD;;;SAGK;IACL,eAAe,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC5C,8GAA8G;IAC9G,eAAe,CAAC,EAAE,QAAQ,CAAC,eAAe,CAAC;IAC3C,oHAAoH;IACpH,kBAAkB,CAAC,EAAE,QAAQ,CAAC,kBAAkB,CAAC;IACjD,gHAAgH;IAChH,gBAAgB,CAAC,EAAE,QAAQ,CAAC,gBAAgB,CAAC;IAC7C,4GAA4G;IAC5G,cAAc,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC;CAC1C,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,aAAa,EAoCnD,CAAC;AAEF,eAAO,MAAM,aAAa,oCAA0C,CAAC;AACrE;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,UAAU,qCAAwD,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.background = exports.backgroundFns = exports.backgroundStyleFnConfigs = void 0;
|
|
4
|
+
var buildStyleFns_1 = require("./buildStyleFns");
|
|
5
|
+
exports.backgroundStyleFnConfigs = [
|
|
6
|
+
{
|
|
7
|
+
name: 'background',
|
|
8
|
+
properties: ['background'],
|
|
9
|
+
system: 'color',
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
name: 'backgroundAttachment',
|
|
13
|
+
properties: ['backgroundAttachment'],
|
|
14
|
+
system: 'none',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: 'backgroundColor',
|
|
18
|
+
properties: ['backgroundColor'],
|
|
19
|
+
system: 'color',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: 'backgroundImage',
|
|
23
|
+
properties: ['backgroundImage'],
|
|
24
|
+
system: 'none',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'backgroundPosition',
|
|
28
|
+
properties: ['backgroundPosition'],
|
|
29
|
+
system: 'none',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: 'backgroundRepeat',
|
|
33
|
+
properties: ['backgroundRepeat'],
|
|
34
|
+
system: 'none',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: 'backgroundSize',
|
|
38
|
+
properties: ['backgroundSize'],
|
|
39
|
+
system: 'none',
|
|
40
|
+
},
|
|
41
|
+
];
|
|
42
|
+
exports.backgroundFns = buildStyleFns_1.buildStyleFns(exports.backgroundStyleFnConfigs);
|
|
43
|
+
/**
|
|
44
|
+
* A style prop function that takes component props and returns border styles.
|
|
45
|
+
* Some props, such as background and backgroundColor, are connected to our design tokens.
|
|
46
|
+
* If no `BackgroundStyleProps` are found, it returns an empty object.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```tsx
|
|
50
|
+
* const BackgroundExample = () => (
|
|
51
|
+
* <Box backgroundColor="blueberry500">
|
|
52
|
+
* Hello, background styles!
|
|
53
|
+
* </Box>
|
|
54
|
+
* );
|
|
55
|
+
*```
|
|
56
|
+
*/
|
|
57
|
+
exports.background = buildStyleFns_1.buildStylePropFn(exports.backgroundFns);
|