@workday/canvas-kit-react 9.0.0-alpha.334-next.4 → 9.0.0-alpha.336-next.6
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/action-bar/lib/ActionBarList.tsx +6 -7
- package/breadcrumbs/lib/BreadcrumbsList.tsx +1 -2
- package/dist/commonjs/action-bar/lib/ActionBarList.d.ts +2 -2
- package/dist/commonjs/action-bar/lib/ActionBarList.d.ts.map +1 -1
- package/dist/commonjs/action-bar/lib/ActionBarList.js +2 -2
- package/dist/commonjs/breadcrumbs/lib/BreadcrumbsList.d.ts +1 -1
- package/dist/commonjs/breadcrumbs/lib/BreadcrumbsList.d.ts.map +1 -1
- package/dist/commonjs/layout/index.d.ts +1 -2
- package/dist/commonjs/layout/index.d.ts.map +1 -1
- package/dist/commonjs/layout/index.js +1 -1
- package/dist/commonjs/menu/lib/MenuList.d.ts +2 -2
- package/dist/commonjs/menu/lib/MenuList.d.ts.map +1 -1
- package/dist/commonjs/menu/lib/MenuList.js +1 -1
- package/dist/commonjs/pagination/lib/Pagination/Controls.js +1 -1
- package/dist/commonjs/pagination/lib/Pagination/GoTo/Form.d.ts +3 -5
- package/dist/commonjs/pagination/lib/Pagination/GoTo/Form.d.ts.map +1 -1
- package/dist/commonjs/pagination/lib/Pagination/GoTo/Form.js +2 -2
- package/dist/commonjs/pagination/lib/Pagination/PageList.d.ts +2 -2
- package/dist/commonjs/pagination/lib/Pagination/PageList.d.ts.map +1 -1
- package/dist/commonjs/pagination/lib/Pagination/PageList.js +1 -1
- package/dist/commonjs/tabs/lib/TabsItem.d.ts +3 -3
- package/dist/commonjs/tabs/lib/TabsItem.d.ts.map +1 -1
- package/dist/commonjs/tabs/lib/TabsItem.js +4 -5
- package/dist/commonjs/tabs/lib/TabsList.d.ts +2 -2
- package/dist/commonjs/tabs/lib/TabsList.d.ts.map +1 -1
- package/dist/commonjs/tabs/lib/TabsList.js +2 -2
- package/dist/commonjs/tabs/lib/TabsOverflowButton.js +1 -1
- package/dist/es6/action-bar/lib/ActionBarList.d.ts +2 -2
- package/dist/es6/action-bar/lib/ActionBarList.d.ts.map +1 -1
- package/dist/es6/action-bar/lib/ActionBarList.js +3 -3
- package/dist/es6/breadcrumbs/lib/BreadcrumbsList.d.ts +1 -1
- package/dist/es6/breadcrumbs/lib/BreadcrumbsList.d.ts.map +1 -1
- package/dist/es6/layout/index.d.ts +1 -2
- package/dist/es6/layout/index.d.ts.map +1 -1
- package/dist/es6/layout/index.js +1 -1
- package/dist/es6/menu/lib/MenuList.d.ts +2 -2
- package/dist/es6/menu/lib/MenuList.d.ts.map +1 -1
- package/dist/es6/menu/lib/MenuList.js +1 -1
- package/dist/es6/pagination/lib/Pagination/Controls.js +2 -2
- package/dist/es6/pagination/lib/Pagination/GoTo/Form.d.ts +3 -5
- package/dist/es6/pagination/lib/Pagination/GoTo/Form.d.ts.map +1 -1
- package/dist/es6/pagination/lib/Pagination/GoTo/Form.js +3 -3
- package/dist/es6/pagination/lib/Pagination/PageList.d.ts +2 -2
- package/dist/es6/pagination/lib/Pagination/PageList.d.ts.map +1 -1
- package/dist/es6/pagination/lib/Pagination/PageList.js +2 -2
- package/dist/es6/tabs/lib/TabsItem.d.ts +3 -3
- package/dist/es6/tabs/lib/TabsItem.d.ts.map +1 -1
- package/dist/es6/tabs/lib/TabsItem.js +4 -5
- package/dist/es6/tabs/lib/TabsList.d.ts +2 -2
- package/dist/es6/tabs/lib/TabsList.d.ts.map +1 -1
- package/dist/es6/tabs/lib/TabsList.js +3 -3
- package/dist/es6/tabs/lib/TabsOverflowButton.js +1 -1
- package/layout/index.ts +1 -2
- package/menu/lib/MenuList.tsx +3 -4
- package/package.json +3 -3
- package/pagination/lib/Pagination/Controls.tsx +3 -3
- package/pagination/lib/Pagination/GoTo/Form.tsx +6 -9
- package/pagination/lib/Pagination/PageList.tsx +5 -5
- package/tabs/lib/TabsItem.tsx +6 -8
- package/tabs/lib/TabsList.tsx +4 -6
- package/tabs/lib/TabsOverflowButton.tsx +1 -1
- package/dist/commonjs/layout/lib/Stack.d.ts +0 -69
- package/dist/commonjs/layout/lib/Stack.d.ts.map +0 -1
- package/dist/commonjs/layout/lib/Stack.js +0 -127
- package/dist/commonjs/layout/lib/utils/stack.d.ts +0 -54
- package/dist/commonjs/layout/lib/utils/stack.d.ts.map +0 -1
- package/dist/commonjs/layout/lib/utils/stack.js +0 -36
- package/dist/es6/layout/lib/Stack.d.ts +0 -69
- package/dist/es6/layout/lib/Stack.d.ts.map +0 -1
- package/dist/es6/layout/lib/Stack.js +0 -102
- package/dist/es6/layout/lib/utils/stack.d.ts +0 -54
- package/dist/es6/layout/lib/utils/stack.d.ts.map +0 -1
- package/dist/es6/layout/lib/utils/stack.js +0 -32
- package/layout/lib/Stack.tsx +0 -146
- package/layout/lib/utils/stack.ts +0 -83
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { FlexProps } from './Flex';
|
|
2
|
-
import { StackStyleProps } from './utils/stack';
|
|
3
|
-
/**
|
|
4
|
-
* ### ⚠️ Stack has been soft-deprecated and will be removed in v9 ⚠️
|
|
5
|
-
* - If you would like resolve this now, run this codemod: `npx @workday/canvas-kit-codemod softDeprecate/Stack [path]`
|
|
6
|
-
* - You can learn more about the codemod package [here](https://github.com/Workday/canvas-kit/tree/master/modules/codemod)
|
|
7
|
-
* - There is more context [here]() as to why this decision was made
|
|
8
|
-
* @deprecated
|
|
9
|
-
*/
|
|
10
|
-
export declare type StackProps = FlexProps & StackStyleProps;
|
|
11
|
-
/**
|
|
12
|
-
* ### ⚠️ Stack has been soft-deprecated and will be removed in v9 ⚠️
|
|
13
|
-
* - If you would like resolve this now, run this codemod: `npx @workday/canvas-kit-codemod softDeprecate/Stack [path]`
|
|
14
|
-
* - You can learn more about the codemod package [here](https://github.com/Workday/canvas-kit/tree/master/modules/codemod)
|
|
15
|
-
* - There is more context [here]() as to why this decision was made
|
|
16
|
-
* @deprecated
|
|
17
|
-
*/
|
|
18
|
-
export declare const Stack: import("../../common").ElementComponent<"div", StackProps> & {
|
|
19
|
-
Item: import("../../common").ElementComponent<"div", import("..").CommonStyleProps>;
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* ### ⚠️ Stack has been soft-deprecated and will be removed in v9 ⚠️
|
|
23
|
-
* - If you would like resolve this now, run this codemod: `npx @workday/canvas-kit-codemod softDeprecate/Stack [path]`
|
|
24
|
-
* - You can learn more about the codemod package [here](https://github.com/Workday/canvas-kit/tree/master/modules/codemod)
|
|
25
|
-
* - There is more context [here]() as to why this decision was made
|
|
26
|
-
* @deprecated
|
|
27
|
-
*/
|
|
28
|
-
export interface HStackProps extends StackProps {
|
|
29
|
-
/**
|
|
30
|
-
* sets the direction for the stack
|
|
31
|
-
* @default "row"
|
|
32
|
-
* */
|
|
33
|
-
flexDirection?: 'row' | 'row-reverse';
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* ### ⚠️ HStack has been soft-deprecated and will be removed in v9 ⚠️
|
|
37
|
-
* - If you would like resolve this now, run this codemod: `npx @workday/canvas-kit-codemod softDeprecate/Stack [path]`
|
|
38
|
-
* - You can learn more about the codemod package [here](https://github.com/Workday/canvas-kit/tree/master/modules/codemod)
|
|
39
|
-
* - There is more context [here]() as to why this decision was made
|
|
40
|
-
* @deprecated
|
|
41
|
-
*/
|
|
42
|
-
export declare const HStack: import("../../common").ElementComponent<"div", HStackProps> & {
|
|
43
|
-
Item: import("../../common").ElementComponent<"div", import("..").CommonStyleProps>;
|
|
44
|
-
};
|
|
45
|
-
/**
|
|
46
|
-
* ### ⚠️ Stack has been soft-deprecated and will be removed in v9 ⚠️
|
|
47
|
-
* - If you would like resolve this now, run this codemod: `npx @workday/canvas-kit-codemod softDeprecate/Stack [path]`
|
|
48
|
-
* - You can learn more about the codemod package [here](https://github.com/Workday/canvas-kit/tree/master/modules/codemod)
|
|
49
|
-
* - There is more context [here]() as to why this decision was made
|
|
50
|
-
* @deprecated
|
|
51
|
-
*/
|
|
52
|
-
export interface VStackProps extends StackProps {
|
|
53
|
-
/**
|
|
54
|
-
* sets the direction for the stack
|
|
55
|
-
* @default "column"
|
|
56
|
-
* */
|
|
57
|
-
flexDirection?: 'column' | 'column-reverse';
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* ### ⚠️ VStack has been soft-deprecated and will be removed in v9 ⚠️
|
|
61
|
-
* - If you would like resolve this now, run this codemod: `npx @workday/canvas-kit-codemod softDeprecate/Stack [path]`
|
|
62
|
-
* - You can learn more about the codemod package [here](https://github.com/Workday/canvas-kit/tree/master/modules/codemod)
|
|
63
|
-
* - There is more context [here]() as to why this decision was made
|
|
64
|
-
* @deprecated
|
|
65
|
-
*/
|
|
66
|
-
export declare const VStack: import("../../common").ElementComponent<"div", VStackProps> & {
|
|
67
|
-
Item: import("../../common").ElementComponent<"div", import("..").CommonStyleProps>;
|
|
68
|
-
};
|
|
69
|
-
//# sourceMappingURL=Stack.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Stack.d.ts","sourceRoot":"","sources":["../../../../layout/lib/Stack.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAO,SAAS,EAAC,MAAM,QAAQ,CAAC;AAEvC,OAAO,EAAQ,eAAe,EAAC,MAAM,eAAe,CAAC;AAErD;;;;;;GAMG;AACH,oBAAY,UAAU,GAAG,SAAS,GAAG,eAAe,CAAC;AAkCrD;;;;;;GAMG;AACH,eAAO,MAAM,KAAK;;CAiBhB,CAAC;AAEH;;;;;;GAMG;AACH,MAAM,WAAW,WAAY,SAAQ,UAAU;IAC7C;;;SAGK;IACL,aAAa,CAAC,EAAE,KAAK,GAAG,aAAa,CAAC;CACvC;AAED;;;;;;GAMG;AACH,eAAO,MAAM,MAAM;;CAYjB,CAAC;AAEH;;;;;;GAMG;AACH,MAAM,WAAW,WAAY,SAAQ,UAAU;IAC7C;;;SAGK;IACL,aAAa,CAAC,EAAE,QAAQ,GAAG,gBAAgB,CAAC;CAC7C;AAED;;;;;;GAMG;AACH,eAAO,MAAM,MAAM;;CAYjB,CAAC"}
|
|
@@ -1,102 +0,0 @@
|
|
|
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 styled from '@emotion/styled';
|
|
25
|
-
import { createComponent } from '@workday/canvas-kit-react/common';
|
|
26
|
-
import { Box } from './Box';
|
|
27
|
-
import { Flex } from './Flex';
|
|
28
|
-
import { getValidChildren } from './utils/getValidChildren';
|
|
29
|
-
import { stack } from './utils/stack';
|
|
30
|
-
/**
|
|
31
|
-
* ### ⚠️ Stack has been soft-deprecated and will be removed in v9 ⚠️
|
|
32
|
-
* - If you would like resolve this now, run this codemod: `npx @workday/canvas-kit-codemod softDeprecate/Stack [path]`
|
|
33
|
-
* - You can learn more about the codemod package [here](https://github.com/Workday/canvas-kit/tree/master/modules/codemod)
|
|
34
|
-
* - There is more context [here]() as to why this decision was made
|
|
35
|
-
* @deprecated
|
|
36
|
-
*/
|
|
37
|
-
var StackItem = createComponent('div')({
|
|
38
|
-
displayName: 'Stack.Item',
|
|
39
|
-
Component: function (_a, ref, Element) {
|
|
40
|
-
var children = _a.children, elemProps = __rest(_a, ["children"]);
|
|
41
|
-
return (React.createElement(Box, __assign({ as: Element, ref: ref, display: "inline-block", flex: "0 0 auto", minWidth: 0 }, elemProps), children));
|
|
42
|
-
},
|
|
43
|
-
});
|
|
44
|
-
// prevent `spacing` prop from being passed through to the HTML element
|
|
45
|
-
var shouldForwardProp = function (prop) {
|
|
46
|
-
return prop !== 'spacing';
|
|
47
|
-
};
|
|
48
|
-
var StyledStack = styled(Flex, { shouldForwardProp: shouldForwardProp })(stack);
|
|
49
|
-
/**
|
|
50
|
-
* ### ⚠️ Stack has been soft-deprecated and will be removed in v9 ⚠️
|
|
51
|
-
* - If you would like resolve this now, run this codemod: `npx @workday/canvas-kit-codemod softDeprecate/Stack [path]`
|
|
52
|
-
* - You can learn more about the codemod package [here](https://github.com/Workday/canvas-kit/tree/master/modules/codemod)
|
|
53
|
-
* - There is more context [here]() as to why this decision was made
|
|
54
|
-
* @deprecated
|
|
55
|
-
*/
|
|
56
|
-
export var Stack = createComponent('div')({
|
|
57
|
-
displayName: 'Stack',
|
|
58
|
-
Component: function (_a, ref, Element) {
|
|
59
|
-
var children = _a.children, _b = _a.shouldWrapChildren, shouldWrapChildren = _b === void 0 ? false : _b, elemProps = __rest(_a, ["children", "shouldWrapChildren"]);
|
|
60
|
-
var validChildren = getValidChildren(children);
|
|
61
|
-
return (React.createElement(StyledStack, __assign({ as: Element, ref: ref, flexDirection: "row" }, elemProps), shouldWrapChildren
|
|
62
|
-
? validChildren.map(function (child, index) { return (React.createElement(StackItem, { key: child.props.id || index }, child)); })
|
|
63
|
-
: validChildren));
|
|
64
|
-
},
|
|
65
|
-
subComponents: {
|
|
66
|
-
Item: StackItem,
|
|
67
|
-
},
|
|
68
|
-
});
|
|
69
|
-
/**
|
|
70
|
-
* ### ⚠️ HStack has been soft-deprecated and will be removed in v9 ⚠️
|
|
71
|
-
* - If you would like resolve this now, run this codemod: `npx @workday/canvas-kit-codemod softDeprecate/Stack [path]`
|
|
72
|
-
* - You can learn more about the codemod package [here](https://github.com/Workday/canvas-kit/tree/master/modules/codemod)
|
|
73
|
-
* - There is more context [here]() as to why this decision was made
|
|
74
|
-
* @deprecated
|
|
75
|
-
*/
|
|
76
|
-
export var HStack = createComponent('div')({
|
|
77
|
-
displayName: 'HStack',
|
|
78
|
-
Component: function (_a, ref, Element) {
|
|
79
|
-
var children = _a.children, _b = _a.flexDirection, flexDirection = _b === void 0 ? 'row' : _b, elemProps = __rest(_a, ["children", "flexDirection"]);
|
|
80
|
-
return (React.createElement(Stack, __assign({ as: Element, ref: ref, flexDirection: flexDirection }, elemProps), children));
|
|
81
|
-
},
|
|
82
|
-
subComponents: {
|
|
83
|
-
Item: StackItem,
|
|
84
|
-
},
|
|
85
|
-
});
|
|
86
|
-
/**
|
|
87
|
-
* ### ⚠️ VStack has been soft-deprecated and will be removed in v9 ⚠️
|
|
88
|
-
* - If you would like resolve this now, run this codemod: `npx @workday/canvas-kit-codemod softDeprecate/Stack [path]`
|
|
89
|
-
* - You can learn more about the codemod package [here](https://github.com/Workday/canvas-kit/tree/master/modules/codemod)
|
|
90
|
-
* - There is more context [here]() as to why this decision was made
|
|
91
|
-
* @deprecated
|
|
92
|
-
*/
|
|
93
|
-
export var VStack = createComponent('div')({
|
|
94
|
-
displayName: 'VStack',
|
|
95
|
-
Component: function (_a, ref, Element) {
|
|
96
|
-
var children = _a.children, _b = _a.flexDirection, flexDirection = _b === void 0 ? 'column' : _b, elemProps = __rest(_a, ["children", "flexDirection"]);
|
|
97
|
-
return (React.createElement(Stack, __assign({ as: Element, ref: ref, flexDirection: flexDirection }, elemProps), children));
|
|
98
|
-
},
|
|
99
|
-
subComponents: {
|
|
100
|
-
Item: StackItem,
|
|
101
|
-
},
|
|
102
|
-
});
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { SystemPropValues } from './systemProps';
|
|
2
|
-
/**
|
|
3
|
-
* ### ⚠️ Stack has been soft-deprecated and will be removed in v9 ⚠️
|
|
4
|
-
* - If you would like resolve this now, run this codemod: `npx @workday/canvas-kit-codemod softDeprecate/Stack [path]`
|
|
5
|
-
* - You can learn more about the codemod package [here](https://github.com/Workday/canvas-kit/tree/master/modules/codemod)
|
|
6
|
-
* - There is more context [here]() as to why this decision was made
|
|
7
|
-
* @deprecated
|
|
8
|
-
*/
|
|
9
|
-
export declare type StackDirection = 'row' | 'column' | 'row-reverse' | 'column-reverse';
|
|
10
|
-
declare const selector = "& > *:not(style) ~ *:not(style)";
|
|
11
|
-
/**
|
|
12
|
-
* ### ⚠️ Stack has been soft-deprecated and will be removed in v9 ⚠️
|
|
13
|
-
* - If you would like resolve this now, run this codemod: `npx @workday/canvas-kit-codemod softDeprecate/Stack [path]`
|
|
14
|
-
* - You can learn more about the codemod package [here](https://github.com/Workday/canvas-kit/tree/master/modules/codemod)
|
|
15
|
-
* - There is more context [here]() as to why this decision was made
|
|
16
|
-
* @deprecated
|
|
17
|
-
*/
|
|
18
|
-
export declare type StackSpacing = SystemPropValues['space'];
|
|
19
|
-
/**
|
|
20
|
-
* ### ⚠️ Stack has been soft-deprecated and will be removed in v9 ⚠️
|
|
21
|
-
* - If you would like resolve this now, run this codemod: `npx @workday/canvas-kit-codemod softDeprecate/Stack [path]`
|
|
22
|
-
* - You can learn more about the codemod package [here](https://github.com/Workday/canvas-kit/tree/master/modules/codemod)
|
|
23
|
-
* - There is more context [here]() as to why this decision was made
|
|
24
|
-
* @deprecated
|
|
25
|
-
*/
|
|
26
|
-
export declare type StackStyleProps = {
|
|
27
|
-
/** sets space values between child elements (bidirectional support)
|
|
28
|
-
* @deprecated
|
|
29
|
-
*/
|
|
30
|
-
spacing: StackSpacing;
|
|
31
|
-
/**
|
|
32
|
-
* sets the direction for the stack
|
|
33
|
-
* @default "row"
|
|
34
|
-
* */
|
|
35
|
-
flexDirection?: StackDirection;
|
|
36
|
-
/**
|
|
37
|
-
* when `true` wraps each child element in a `Stack.Item`
|
|
38
|
-
* @deprecated
|
|
39
|
-
* @default false
|
|
40
|
-
* */
|
|
41
|
-
shouldWrapChildren?: boolean;
|
|
42
|
-
};
|
|
43
|
-
/**
|
|
44
|
-
* ### ⚠️ Stack has been soft-deprecated and will be removed in v9 ⚠️
|
|
45
|
-
* - If you would like resolve this now, run this codemod: `npx @workday/canvas-kit-codemod softDeprecate/Stack [path]`
|
|
46
|
-
* - You can learn more about the codemod package [here](https://github.com/Workday/canvas-kit/tree/master/modules/codemod)
|
|
47
|
-
* - There is more context [here]() as to why this decision was made
|
|
48
|
-
* @deprecated
|
|
49
|
-
*/
|
|
50
|
-
export declare function stack<P extends StackStyleProps>(props: P): {
|
|
51
|
-
"& > *:not(style) ~ *:not(style)": {};
|
|
52
|
-
};
|
|
53
|
-
export {};
|
|
54
|
-
//# sourceMappingURL=stack.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stack.d.ts","sourceRoot":"","sources":["../../../../../layout/lib/utils/stack.ts"],"names":[],"mappings":"AACA,OAAO,EAAyB,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAEvE;;;;;;GAMG;AACH,oBAAY,cAAc,GAAG,KAAK,GAAG,QAAQ,GAAG,aAAa,GAAG,gBAAgB,CAAC;AAEjF,QAAA,MAAM,QAAQ,oCAAoC,CAAC;AAEnD;;;;;;GAMG;AACH,oBAAY,YAAY,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;AAErD;;;;;;GAMG;AACH,oBAAY,eAAe,GAAG;IAC5B;;OAEG;IACH,OAAO,EAAE,YAAY,CAAC;IACtB;;;SAGK;IACL,aAAa,CAAC,EAAE,cAAc,CAAC;IAC/B;;;;SAIK;IACL,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC;AAMF;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,CAAC,SAAS,eAAe,EAAE,KAAK,EAAE,CAAC;;EAuBxD"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { space as spaceTokens } from '@workday/canvas-kit-react/tokens';
|
|
2
|
-
var selector = '& > *:not(style) ~ *:not(style)';
|
|
3
|
-
var getSpace = function (value) {
|
|
4
|
-
return spaceTokens[value] || value;
|
|
5
|
-
};
|
|
6
|
-
/**
|
|
7
|
-
* ### ⚠️ Stack has been soft-deprecated and will be removed in v9 ⚠️
|
|
8
|
-
* - If you would like resolve this now, run this codemod: `npx @workday/canvas-kit-codemod softDeprecate/Stack [path]`
|
|
9
|
-
* - You can learn more about the codemod package [here](https://github.com/Workday/canvas-kit/tree/master/modules/codemod)
|
|
10
|
-
* - There is more context [here]() as to why this decision was made
|
|
11
|
-
* @deprecated
|
|
12
|
-
*/
|
|
13
|
-
export function stack(props) {
|
|
14
|
-
var _a;
|
|
15
|
-
var _b = props.flexDirection, flexDirection = _b === void 0 ? 'row' : _b, spacing = props.spacing;
|
|
16
|
-
var styles = {};
|
|
17
|
-
if (flexDirection === 'column') {
|
|
18
|
-
styles = { marginTop: getSpace(spacing) };
|
|
19
|
-
}
|
|
20
|
-
if (flexDirection === 'column-reverse') {
|
|
21
|
-
styles = { marginBottom: getSpace(spacing) };
|
|
22
|
-
}
|
|
23
|
-
if (flexDirection === 'row') {
|
|
24
|
-
styles = { marginInlineStart: getSpace(spacing) };
|
|
25
|
-
}
|
|
26
|
-
if (flexDirection === 'row-reverse') {
|
|
27
|
-
styles = { marginInlineEnd: getSpace(spacing) };
|
|
28
|
-
}
|
|
29
|
-
return _a = {},
|
|
30
|
-
_a[selector] = styles,
|
|
31
|
-
_a;
|
|
32
|
-
}
|
package/layout/lib/Stack.tsx
DELETED
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import styled from '@emotion/styled';
|
|
3
|
-
import {createComponent, StyledType} from '@workday/canvas-kit-react/common';
|
|
4
|
-
import {Box, BoxProps} from './Box';
|
|
5
|
-
import {Flex, FlexProps} from './Flex';
|
|
6
|
-
import {getValidChildren} from './utils/getValidChildren';
|
|
7
|
-
import {stack, StackStyleProps} from './utils/stack';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* ### ⚠️ Stack has been soft-deprecated and will be removed in v9 ⚠️
|
|
11
|
-
* - If you would like resolve this now, run this codemod: `npx @workday/canvas-kit-codemod softDeprecate/Stack [path]`
|
|
12
|
-
* - You can learn more about the codemod package [here](https://github.com/Workday/canvas-kit/tree/master/modules/codemod)
|
|
13
|
-
* - There is more context [here]() as to why this decision was made
|
|
14
|
-
* @deprecated
|
|
15
|
-
*/
|
|
16
|
-
export type StackProps = FlexProps & StackStyleProps;
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* ### ⚠️ Stack has been soft-deprecated and will be removed in v9 ⚠️
|
|
20
|
-
* - If you would like resolve this now, run this codemod: `npx @workday/canvas-kit-codemod softDeprecate/Stack [path]`
|
|
21
|
-
* - You can learn more about the codemod package [here](https://github.com/Workday/canvas-kit/tree/master/modules/codemod)
|
|
22
|
-
* - There is more context [here]() as to why this decision was made
|
|
23
|
-
* @deprecated
|
|
24
|
-
*/
|
|
25
|
-
const StackItem = createComponent('div')({
|
|
26
|
-
displayName: 'Stack.Item',
|
|
27
|
-
Component: ({children, ...elemProps}: BoxProps, ref, Element) => {
|
|
28
|
-
return (
|
|
29
|
-
<Box
|
|
30
|
-
as={Element}
|
|
31
|
-
ref={ref}
|
|
32
|
-
display="inline-block"
|
|
33
|
-
flex="0 0 auto"
|
|
34
|
-
minWidth={0}
|
|
35
|
-
{...elemProps}
|
|
36
|
-
>
|
|
37
|
-
{children}
|
|
38
|
-
</Box>
|
|
39
|
-
);
|
|
40
|
-
},
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
// prevent `spacing` prop from being passed through to the HTML element
|
|
44
|
-
const shouldForwardProp = (prop: string) => {
|
|
45
|
-
return prop !== 'spacing';
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
const StyledStack = styled(Flex, {shouldForwardProp})<StyledType & StackProps>(stack);
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* ### ⚠️ Stack has been soft-deprecated and will be removed in v9 ⚠️
|
|
52
|
-
* - If you would like resolve this now, run this codemod: `npx @workday/canvas-kit-codemod softDeprecate/Stack [path]`
|
|
53
|
-
* - You can learn more about the codemod package [here](https://github.com/Workday/canvas-kit/tree/master/modules/codemod)
|
|
54
|
-
* - There is more context [here]() as to why this decision was made
|
|
55
|
-
* @deprecated
|
|
56
|
-
*/
|
|
57
|
-
export const Stack = createComponent('div')({
|
|
58
|
-
displayName: 'Stack',
|
|
59
|
-
Component: ({children, shouldWrapChildren = false, ...elemProps}: StackProps, ref, Element) => {
|
|
60
|
-
const validChildren = getValidChildren(children);
|
|
61
|
-
return (
|
|
62
|
-
<StyledStack as={Element} ref={ref} flexDirection="row" {...elemProps}>
|
|
63
|
-
{shouldWrapChildren
|
|
64
|
-
? validChildren.map((child, index) => (
|
|
65
|
-
<StackItem key={child.props.id || index}>{child}</StackItem>
|
|
66
|
-
))
|
|
67
|
-
: validChildren}
|
|
68
|
-
</StyledStack>
|
|
69
|
-
);
|
|
70
|
-
},
|
|
71
|
-
subComponents: {
|
|
72
|
-
Item: StackItem,
|
|
73
|
-
},
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* ### ⚠️ Stack has been soft-deprecated and will be removed in v9 ⚠️
|
|
78
|
-
* - If you would like resolve this now, run this codemod: `npx @workday/canvas-kit-codemod softDeprecate/Stack [path]`
|
|
79
|
-
* - You can learn more about the codemod package [here](https://github.com/Workday/canvas-kit/tree/master/modules/codemod)
|
|
80
|
-
* - There is more context [here]() as to why this decision was made
|
|
81
|
-
* @deprecated
|
|
82
|
-
*/
|
|
83
|
-
export interface HStackProps extends StackProps {
|
|
84
|
-
/**
|
|
85
|
-
* sets the direction for the stack
|
|
86
|
-
* @default "row"
|
|
87
|
-
* */
|
|
88
|
-
flexDirection?: 'row' | 'row-reverse';
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* ### ⚠️ HStack has been soft-deprecated and will be removed in v9 ⚠️
|
|
93
|
-
* - If you would like resolve this now, run this codemod: `npx @workday/canvas-kit-codemod softDeprecate/Stack [path]`
|
|
94
|
-
* - You can learn more about the codemod package [here](https://github.com/Workday/canvas-kit/tree/master/modules/codemod)
|
|
95
|
-
* - There is more context [here]() as to why this decision was made
|
|
96
|
-
* @deprecated
|
|
97
|
-
*/
|
|
98
|
-
export const HStack = createComponent('div')({
|
|
99
|
-
displayName: 'HStack',
|
|
100
|
-
Component: ({children, flexDirection = 'row', ...elemProps}: HStackProps, ref, Element) => {
|
|
101
|
-
return (
|
|
102
|
-
<Stack as={Element} ref={ref} flexDirection={flexDirection} {...elemProps}>
|
|
103
|
-
{children}
|
|
104
|
-
</Stack>
|
|
105
|
-
);
|
|
106
|
-
},
|
|
107
|
-
subComponents: {
|
|
108
|
-
Item: StackItem,
|
|
109
|
-
},
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* ### ⚠️ Stack has been soft-deprecated and will be removed in v9 ⚠️
|
|
114
|
-
* - If you would like resolve this now, run this codemod: `npx @workday/canvas-kit-codemod softDeprecate/Stack [path]`
|
|
115
|
-
* - You can learn more about the codemod package [here](https://github.com/Workday/canvas-kit/tree/master/modules/codemod)
|
|
116
|
-
* - There is more context [here]() as to why this decision was made
|
|
117
|
-
* @deprecated
|
|
118
|
-
*/
|
|
119
|
-
export interface VStackProps extends StackProps {
|
|
120
|
-
/**
|
|
121
|
-
* sets the direction for the stack
|
|
122
|
-
* @default "column"
|
|
123
|
-
* */
|
|
124
|
-
flexDirection?: 'column' | 'column-reverse';
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* ### ⚠️ VStack has been soft-deprecated and will be removed in v9 ⚠️
|
|
129
|
-
* - If you would like resolve this now, run this codemod: `npx @workday/canvas-kit-codemod softDeprecate/Stack [path]`
|
|
130
|
-
* - You can learn more about the codemod package [here](https://github.com/Workday/canvas-kit/tree/master/modules/codemod)
|
|
131
|
-
* - There is more context [here]() as to why this decision was made
|
|
132
|
-
* @deprecated
|
|
133
|
-
*/
|
|
134
|
-
export const VStack = createComponent('div')({
|
|
135
|
-
displayName: 'VStack',
|
|
136
|
-
Component: ({children, flexDirection = 'column', ...elemProps}: VStackProps, ref, Element) => {
|
|
137
|
-
return (
|
|
138
|
-
<Stack as={Element} ref={ref} flexDirection={flexDirection} {...elemProps}>
|
|
139
|
-
{children}
|
|
140
|
-
</Stack>
|
|
141
|
-
);
|
|
142
|
-
},
|
|
143
|
-
subComponents: {
|
|
144
|
-
Item: StackItem,
|
|
145
|
-
},
|
|
146
|
-
});
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import {space as spaceTokens} from '@workday/canvas-kit-react/tokens';
|
|
2
|
-
import {CanvasSystemPropValues, SystemPropValues} from './systemProps';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* ### ⚠️ Stack has been soft-deprecated and will be removed in v9 ⚠️
|
|
6
|
-
* - If you would like resolve this now, run this codemod: `npx @workday/canvas-kit-codemod softDeprecate/Stack [path]`
|
|
7
|
-
* - You can learn more about the codemod package [here](https://github.com/Workday/canvas-kit/tree/master/modules/codemod)
|
|
8
|
-
* - There is more context [here]() as to why this decision was made
|
|
9
|
-
* @deprecated
|
|
10
|
-
*/
|
|
11
|
-
export type StackDirection = 'row' | 'column' | 'row-reverse' | 'column-reverse';
|
|
12
|
-
|
|
13
|
-
const selector = '& > *:not(style) ~ *:not(style)';
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* ### ⚠️ Stack has been soft-deprecated and will be removed in v9 ⚠️
|
|
17
|
-
* - If you would like resolve this now, run this codemod: `npx @workday/canvas-kit-codemod softDeprecate/Stack [path]`
|
|
18
|
-
* - You can learn more about the codemod package [here](https://github.com/Workday/canvas-kit/tree/master/modules/codemod)
|
|
19
|
-
* - There is more context [here]() as to why this decision was made
|
|
20
|
-
* @deprecated
|
|
21
|
-
*/
|
|
22
|
-
export type StackSpacing = SystemPropValues['space'];
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* ### ⚠️ Stack has been soft-deprecated and will be removed in v9 ⚠️
|
|
26
|
-
* - If you would like resolve this now, run this codemod: `npx @workday/canvas-kit-codemod softDeprecate/Stack [path]`
|
|
27
|
-
* - You can learn more about the codemod package [here](https://github.com/Workday/canvas-kit/tree/master/modules/codemod)
|
|
28
|
-
* - There is more context [here]() as to why this decision was made
|
|
29
|
-
* @deprecated
|
|
30
|
-
*/
|
|
31
|
-
export type StackStyleProps = {
|
|
32
|
-
/** sets space values between child elements (bidirectional support)
|
|
33
|
-
* @deprecated
|
|
34
|
-
*/
|
|
35
|
-
spacing: StackSpacing;
|
|
36
|
-
/**
|
|
37
|
-
* sets the direction for the stack
|
|
38
|
-
* @default "row"
|
|
39
|
-
* */
|
|
40
|
-
flexDirection?: StackDirection;
|
|
41
|
-
/**
|
|
42
|
-
* when `true` wraps each child element in a `Stack.Item`
|
|
43
|
-
* @deprecated
|
|
44
|
-
* @default false
|
|
45
|
-
* */
|
|
46
|
-
shouldWrapChildren?: boolean;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
const getSpace = (value: SystemPropValues['space']) => {
|
|
50
|
-
return spaceTokens[value as CanvasSystemPropValues['space']] || value;
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* ### ⚠️ Stack has been soft-deprecated and will be removed in v9 ⚠️
|
|
55
|
-
* - If you would like resolve this now, run this codemod: `npx @workday/canvas-kit-codemod softDeprecate/Stack [path]`
|
|
56
|
-
* - You can learn more about the codemod package [here](https://github.com/Workday/canvas-kit/tree/master/modules/codemod)
|
|
57
|
-
* - There is more context [here]() as to why this decision was made
|
|
58
|
-
* @deprecated
|
|
59
|
-
*/
|
|
60
|
-
export function stack<P extends StackStyleProps>(props: P) {
|
|
61
|
-
const {flexDirection = 'row', spacing} = props;
|
|
62
|
-
let styles = {};
|
|
63
|
-
|
|
64
|
-
if (flexDirection === 'column') {
|
|
65
|
-
styles = {marginTop: getSpace(spacing)};
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
if (flexDirection === 'column-reverse') {
|
|
69
|
-
styles = {marginBottom: getSpace(spacing)};
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
if (flexDirection === 'row') {
|
|
73
|
-
styles = {marginInlineStart: getSpace(spacing)};
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
if (flexDirection === 'row-reverse') {
|
|
77
|
-
styles = {marginInlineEnd: getSpace(spacing)};
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
return {
|
|
81
|
-
[selector]: styles,
|
|
82
|
-
};
|
|
83
|
-
}
|