@workday/canvas-kit-react 8.4.0-299-next.0 → 8.4.0-303-next.2

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.
@@ -1,9 +1,30 @@
1
1
  import { FlexProps } from './Flex';
2
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
+ */
3
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
+ */
4
18
  export declare const Stack: import("../../common").ElementComponent<"div", StackProps> & {
5
19
  Item: import("../../common").ElementComponent<"div", import("..").CommonStyleProps>;
6
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
+ */
7
28
  export interface HStackProps extends StackProps {
8
29
  /**
9
30
  * sets the direction for the stack
@@ -11,9 +32,23 @@ export interface HStackProps extends StackProps {
11
32
  * */
12
33
  flexDirection?: 'row' | 'row-reverse';
13
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
+ */
14
42
  export declare const HStack: import("../../common").ElementComponent<"div", HStackProps> & {
15
43
  Item: import("../../common").ElementComponent<"div", import("..").CommonStyleProps>;
16
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
+ */
17
52
  export interface VStackProps extends StackProps {
18
53
  /**
19
54
  * sets the direction for the stack
@@ -21,6 +56,13 @@ export interface VStackProps extends StackProps {
21
56
  * */
22
57
  flexDirection?: 'column' | 'column-reverse';
23
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
+ */
24
66
  export declare const VStack: import("../../common").ElementComponent<"div", VStackProps> & {
25
67
  Item: import("../../common").ElementComponent<"div", import("..").CommonStyleProps>;
26
68
  };
@@ -1 +1 @@
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,oBAAY,UAAU,GAAG,SAAS,GAAG,eAAe,CAAC;AA2BrD,eAAO,MAAM,KAAK;;CAiBhB,CAAC;AAEH,MAAM,WAAW,WAAY,SAAQ,UAAU;IAC7C;;;SAGK;IACL,aAAa,CAAC,EAAE,KAAK,GAAG,aAAa,CAAC;CACvC;AAED,eAAO,MAAM,MAAM;;CAYjB,CAAC;AAEH,MAAM,WAAW,WAAY,SAAQ,UAAU;IAC7C;;;SAGK;IACL,aAAa,CAAC,EAAE,QAAQ,GAAG,gBAAgB,CAAC;CAC7C;AAED,eAAO,MAAM,MAAM;;CAYjB,CAAC"}
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"}
@@ -52,6 +52,13 @@ var Box_1 = require("./Box");
52
52
  var Flex_1 = require("./Flex");
53
53
  var getValidChildren_1 = require("./utils/getValidChildren");
54
54
  var stack_1 = require("./utils/stack");
55
+ /**
56
+ * ### ⚠️ Stack has been soft-deprecated and will be removed in v9 ⚠️
57
+ * - If you would like resolve this now, run this codemod: `npx @workday/canvas-kit-codemod softDeprecate/Stack [path]`
58
+ * - You can learn more about the codemod package [here](https://github.com/Workday/canvas-kit/tree/master/modules/codemod)
59
+ * - There is more context [here]() as to why this decision was made
60
+ * @deprecated
61
+ */
55
62
  var StackItem = common_1.createComponent('div')({
56
63
  displayName: 'Stack.Item',
57
64
  Component: function (_a, ref, Element) {
@@ -64,6 +71,13 @@ var shouldForwardProp = function (prop) {
64
71
  return prop !== 'spacing';
65
72
  };
66
73
  var StyledStack = styled_1.default(Flex_1.Flex, { shouldForwardProp: shouldForwardProp })(stack_1.stack);
74
+ /**
75
+ * ### ⚠️ Stack has been soft-deprecated and will be removed in v9 ⚠️
76
+ * - If you would like resolve this now, run this codemod: `npx @workday/canvas-kit-codemod softDeprecate/Stack [path]`
77
+ * - You can learn more about the codemod package [here](https://github.com/Workday/canvas-kit/tree/master/modules/codemod)
78
+ * - There is more context [here]() as to why this decision was made
79
+ * @deprecated
80
+ */
67
81
  exports.Stack = common_1.createComponent('div')({
68
82
  displayName: 'Stack',
69
83
  Component: function (_a, ref, Element) {
@@ -77,6 +91,13 @@ exports.Stack = common_1.createComponent('div')({
77
91
  Item: StackItem,
78
92
  },
79
93
  });
94
+ /**
95
+ * ### ⚠️ HStack has been soft-deprecated and will be removed in v9 ⚠️
96
+ * - If you would like resolve this now, run this codemod: `npx @workday/canvas-kit-codemod softDeprecate/Stack [path]`
97
+ * - You can learn more about the codemod package [here](https://github.com/Workday/canvas-kit/tree/master/modules/codemod)
98
+ * - There is more context [here]() as to why this decision was made
99
+ * @deprecated
100
+ */
80
101
  exports.HStack = common_1.createComponent('div')({
81
102
  displayName: 'HStack',
82
103
  Component: function (_a, ref, Element) {
@@ -87,6 +108,13 @@ exports.HStack = common_1.createComponent('div')({
87
108
  Item: StackItem,
88
109
  },
89
110
  });
111
+ /**
112
+ * ### ⚠️ VStack has been soft-deprecated and will be removed in v9 ⚠️
113
+ * - If you would like resolve this now, run this codemod: `npx @workday/canvas-kit-codemod softDeprecate/Stack [path]`
114
+ * - You can learn more about the codemod package [here](https://github.com/Workday/canvas-kit/tree/master/modules/codemod)
115
+ * - There is more context [here]() as to why this decision was made
116
+ * @deprecated
117
+ */
90
118
  exports.VStack = common_1.createComponent('div')({
91
119
  displayName: 'VStack',
92
120
  Component: function (_a, ref, Element) {
@@ -1,9 +1,32 @@
1
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
+ */
2
9
  export declare type StackDirection = 'row' | 'column' | 'row-reverse' | 'column-reverse';
3
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
+ */
4
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
+ */
5
26
  export declare type StackStyleProps = {
6
- /** sets space values between child elements (bidirectional support) */
27
+ /** sets space values between child elements (bidirectional support)
28
+ * @deprecated
29
+ */
7
30
  spacing: StackSpacing;
8
31
  /**
9
32
  * sets the direction for the stack
@@ -12,10 +35,18 @@ export declare type StackStyleProps = {
12
35
  flexDirection?: StackDirection;
13
36
  /**
14
37
  * when `true` wraps each child element in a `Stack.Item`
38
+ * @deprecated
15
39
  * @default false
16
40
  * */
17
41
  shouldWrapChildren?: boolean;
18
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
+ */
19
50
  export declare function stack<P extends StackStyleProps>(props: P): {
20
51
  "& > *:not(style) ~ *:not(style)": {};
21
52
  };
@@ -1 +1 @@
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,oBAAY,cAAc,GAAG,KAAK,GAAG,QAAQ,GAAG,aAAa,GAAG,gBAAgB,CAAC;AAEjF,QAAA,MAAM,QAAQ,oCAAoC,CAAC;AAEnD,oBAAY,YAAY,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;AAErD,oBAAY,eAAe,GAAG;IAC5B,uEAAuE;IACvE,OAAO,EAAE,YAAY,CAAC;IACtB;;;SAGK;IACL,aAAa,CAAC,EAAE,cAAc,CAAC;IAC/B;;;SAGK;IACL,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC;AAMF,wBAAgB,KAAK,CAAC,CAAC,SAAS,eAAe,EAAE,KAAK,EAAE,CAAC;;EAuBxD"}
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"}
@@ -6,6 +6,13 @@ var selector = '& > *:not(style) ~ *:not(style)';
6
6
  var getSpace = function (value) {
7
7
  return tokens_1.space[value] || value;
8
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
+ */
9
16
  function stack(props) {
10
17
  var _a;
11
18
  var _b = props.flexDirection, flexDirection = _b === void 0 ? 'row' : _b, spacing = props.spacing;
@@ -229,4 +229,8 @@ export declare const TabsList: import("../../common").ElementComponentM<"div", T
229
229
  navigation: import("../../collection/lib/useCursorListModel").NavigationManager;
230
230
  getId: (item: any) => string;
231
231
  }>;
232
+ export declare const useTouchDirection: () => {
233
+ direction: string;
234
+ isDragging: boolean;
235
+ };
232
236
  //# sourceMappingURL=TabsList.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TabsList.d.ts","sourceRoot":"","sources":["../../../../tabs/lib/TabsList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAIL,YAAY,EAIb,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAC,KAAK,EAAC,MAAM,kCAAkC,CAAC;AAUvD,MAAM,WAAW,YAAY,CAAC,CAAC,GAAG,GAAG,CACnC,SAAQ,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,OAAO,KAAK,EAAE,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC;IACpE;;;;;;;;OAQG;IACH,QAAQ,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC;IAC3D,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAClC;AAED,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAOvB,CAAC;AAgBF,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmBnB,CAAC"}
1
+ {"version":3,"file":"TabsList.d.ts","sourceRoot":"","sources":["../../../../tabs/lib/TabsList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAIL,YAAY,EAIb,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAC,KAAK,EAAC,MAAM,kCAAkC,CAAC;AAUvD,MAAM,WAAW,YAAY,CAAC,CAAC,GAAG,GAAG,CACnC,SAAQ,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,OAAO,KAAK,EAAE,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC;IACpE;;;;;;;;OAQG;IACH,QAAQ,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC;IAC3D,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAClC;AAED,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAOvB,CAAC;AAMF,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2BnB,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;CA+B7B,CAAC"}
@@ -41,7 +41,7 @@ var __rest = (this && this.__rest) || function (s, e) {
41
41
  return t;
42
42
  };
43
43
  Object.defineProperty(exports, "__esModule", { value: true });
44
- exports.TabsList = exports.useTabsList = void 0;
44
+ exports.useTouchDirection = exports.TabsList = exports.useTabsList = void 0;
45
45
  var React = __importStar(require("react"));
46
46
  var tokens_1 = require("@workday/canvas-kit-react/tokens");
47
47
  var common_1 = require("@workday/canvas-kit-react/common");
@@ -52,18 +52,11 @@ exports.useTabsList = common_1.composeHooks(common_1.createElemPropsHook(useTabs
52
52
  var modality = common_1.useModalityType();
53
53
  return { role: 'tablist', overflowX: modality === 'touch' ? 'auto' : undefined };
54
54
  }), collection_1.useOverflowListMeasure, collection_1.useListResetCursorOnBlur);
55
- var StyledStack = common_1.styled(layout_1.Stack)({
56
- '::after': {
57
- content: '""',
58
- position: 'sticky',
59
- height: 52,
60
- minWidth: 30,
61
- background: "linear-gradient(to right,rgba(255,255,255,0),white);",
62
- zIndex: 1,
63
- right: 0,
64
- top: 0,
65
- pointerEvents: 'none',
66
- },
55
+ var StyledStack = common_1.styled(layout_1.Stack)(function (_a) {
56
+ var maskImage = _a.maskImage;
57
+ return ({
58
+ maskImage: maskImage,
59
+ });
67
60
  });
68
61
  exports.TabsList = common_1.createSubcomponent('div')({
69
62
  displayName: 'Tabs.List',
@@ -72,7 +65,42 @@ exports.TabsList = common_1.createSubcomponent('div')({
72
65
  })(function (_a, Element, model) {
73
66
  var children = _a.children, overflowButton = _a.overflowButton, elemProps = __rest(_a, ["children", "overflowButton"]);
74
67
  var modality = common_1.useModalityType();
75
- return (React.createElement(StyledStack, __assign({ as: Element, position: "relative", borderBottom: "1px solid " + tokens_1.commonColors.divider, paddingX: modality === 'touch' ? 'zero' : 'm', spacing: "xxxs" }, elemProps),
68
+ var touchStates = exports.useTouchDirection();
69
+ return (React.createElement(StyledStack, __assign({ as: Element, position: "relative", borderBottom: "1px solid " + tokens_1.commonColors.divider, paddingX: modality === 'touch' ? 'zero' : 'm', spacing: "xs", maskImage: modality === 'touch' && touchStates.isDragging
70
+ ? "linear-gradient(" + (touchStates.direction === 'left' ? 'to left' : 'to right') + ", white 80%, transparent)"
71
+ : undefined }, elemProps),
76
72
  collection_1.useListRenderItems(model, children),
77
73
  overflowButton));
78
74
  });
75
+ var useTouchDirection = function () {
76
+ var _a = React.useState(false), isDragging = _a[0], setIsDragging = _a[1];
77
+ var _b = React.useState('right'), touchDir = _b[0], setTouchDirection = _b[1];
78
+ React.useEffect(function () {
79
+ var prevXPos = window.pageXOffset;
80
+ var handleTouchMove = function (e) {
81
+ var currXPos = e.touches[0].clientX;
82
+ setIsDragging(true);
83
+ if (currXPos > prevXPos) {
84
+ setTouchDirection('left');
85
+ }
86
+ else if (currXPos < prevXPos) {
87
+ setTouchDirection('right');
88
+ }
89
+ prevXPos = currXPos;
90
+ e.preventDefault();
91
+ };
92
+ var handleDragEnd = function () {
93
+ setIsDragging(false);
94
+ };
95
+ window.addEventListener('touchmove', handleTouchMove);
96
+ window.addEventListener('touchstart', handleDragEnd);
97
+ window.addEventListener('touchend', handleDragEnd);
98
+ return function () {
99
+ window.removeEventListener('touchmove', handleTouchMove);
100
+ window.removeEventListener('touchstart', handleDragEnd);
101
+ window.removeEventListener('touchend', handleDragEnd);
102
+ };
103
+ }, []);
104
+ return { direction: touchDir, isDragging: isDragging };
105
+ };
106
+ exports.useTouchDirection = useTouchDirection;
@@ -1,9 +1,30 @@
1
1
  import { FlexProps } from './Flex';
2
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
+ */
3
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
+ */
4
18
  export declare const Stack: import("../../common").ElementComponent<"div", StackProps> & {
5
19
  Item: import("../../common").ElementComponent<"div", import("..").CommonStyleProps>;
6
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
+ */
7
28
  export interface HStackProps extends StackProps {
8
29
  /**
9
30
  * sets the direction for the stack
@@ -11,9 +32,23 @@ export interface HStackProps extends StackProps {
11
32
  * */
12
33
  flexDirection?: 'row' | 'row-reverse';
13
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
+ */
14
42
  export declare const HStack: import("../../common").ElementComponent<"div", HStackProps> & {
15
43
  Item: import("../../common").ElementComponent<"div", import("..").CommonStyleProps>;
16
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
+ */
17
52
  export interface VStackProps extends StackProps {
18
53
  /**
19
54
  * sets the direction for the stack
@@ -21,6 +56,13 @@ export interface VStackProps extends StackProps {
21
56
  * */
22
57
  flexDirection?: 'column' | 'column-reverse';
23
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
+ */
24
66
  export declare const VStack: import("../../common").ElementComponent<"div", VStackProps> & {
25
67
  Item: import("../../common").ElementComponent<"div", import("..").CommonStyleProps>;
26
68
  };
@@ -1 +1 @@
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,oBAAY,UAAU,GAAG,SAAS,GAAG,eAAe,CAAC;AA2BrD,eAAO,MAAM,KAAK;;CAiBhB,CAAC;AAEH,MAAM,WAAW,WAAY,SAAQ,UAAU;IAC7C;;;SAGK;IACL,aAAa,CAAC,EAAE,KAAK,GAAG,aAAa,CAAC;CACvC;AAED,eAAO,MAAM,MAAM;;CAYjB,CAAC;AAEH,MAAM,WAAW,WAAY,SAAQ,UAAU;IAC7C;;;SAGK;IACL,aAAa,CAAC,EAAE,QAAQ,GAAG,gBAAgB,CAAC;CAC7C;AAED,eAAO,MAAM,MAAM;;CAYjB,CAAC"}
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"}
@@ -27,6 +27,13 @@ import { Box } from './Box';
27
27
  import { Flex } from './Flex';
28
28
  import { getValidChildren } from './utils/getValidChildren';
29
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
+ */
30
37
  var StackItem = createComponent('div')({
31
38
  displayName: 'Stack.Item',
32
39
  Component: function (_a, ref, Element) {
@@ -39,6 +46,13 @@ var shouldForwardProp = function (prop) {
39
46
  return prop !== 'spacing';
40
47
  };
41
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
+ */
42
56
  export var Stack = createComponent('div')({
43
57
  displayName: 'Stack',
44
58
  Component: function (_a, ref, Element) {
@@ -52,6 +66,13 @@ export var Stack = createComponent('div')({
52
66
  Item: StackItem,
53
67
  },
54
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
+ */
55
76
  export var HStack = createComponent('div')({
56
77
  displayName: 'HStack',
57
78
  Component: function (_a, ref, Element) {
@@ -62,6 +83,13 @@ export var HStack = createComponent('div')({
62
83
  Item: StackItem,
63
84
  },
64
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
+ */
65
93
  export var VStack = createComponent('div')({
66
94
  displayName: 'VStack',
67
95
  Component: function (_a, ref, Element) {
@@ -1,9 +1,32 @@
1
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
+ */
2
9
  export declare type StackDirection = 'row' | 'column' | 'row-reverse' | 'column-reverse';
3
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
+ */
4
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
+ */
5
26
  export declare type StackStyleProps = {
6
- /** sets space values between child elements (bidirectional support) */
27
+ /** sets space values between child elements (bidirectional support)
28
+ * @deprecated
29
+ */
7
30
  spacing: StackSpacing;
8
31
  /**
9
32
  * sets the direction for the stack
@@ -12,10 +35,18 @@ export declare type StackStyleProps = {
12
35
  flexDirection?: StackDirection;
13
36
  /**
14
37
  * when `true` wraps each child element in a `Stack.Item`
38
+ * @deprecated
15
39
  * @default false
16
40
  * */
17
41
  shouldWrapChildren?: boolean;
18
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
+ */
19
50
  export declare function stack<P extends StackStyleProps>(props: P): {
20
51
  "& > *:not(style) ~ *:not(style)": {};
21
52
  };
@@ -1 +1 @@
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,oBAAY,cAAc,GAAG,KAAK,GAAG,QAAQ,GAAG,aAAa,GAAG,gBAAgB,CAAC;AAEjF,QAAA,MAAM,QAAQ,oCAAoC,CAAC;AAEnD,oBAAY,YAAY,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;AAErD,oBAAY,eAAe,GAAG;IAC5B,uEAAuE;IACvE,OAAO,EAAE,YAAY,CAAC;IACtB;;;SAGK;IACL,aAAa,CAAC,EAAE,cAAc,CAAC;IAC/B;;;SAGK;IACL,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC;AAMF,wBAAgB,KAAK,CAAC,CAAC,SAAS,eAAe,EAAE,KAAK,EAAE,CAAC;;EAuBxD"}
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"}
@@ -3,6 +3,13 @@ var selector = '& > *:not(style) ~ *:not(style)';
3
3
  var getSpace = function (value) {
4
4
  return spaceTokens[value] || value;
5
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
+ */
6
13
  export function stack(props) {
7
14
  var _a;
8
15
  var _b = props.flexDirection, flexDirection = _b === void 0 ? 'row' : _b, spacing = props.spacing;
@@ -229,4 +229,8 @@ export declare const TabsList: import("../../common").ElementComponentM<"div", T
229
229
  navigation: import("../../collection/lib/useCursorListModel").NavigationManager;
230
230
  getId: (item: any) => string;
231
231
  }>;
232
+ export declare const useTouchDirection: () => {
233
+ direction: string;
234
+ isDragging: boolean;
235
+ };
232
236
  //# sourceMappingURL=TabsList.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TabsList.d.ts","sourceRoot":"","sources":["../../../../tabs/lib/TabsList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAIL,YAAY,EAIb,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAC,KAAK,EAAC,MAAM,kCAAkC,CAAC;AAUvD,MAAM,WAAW,YAAY,CAAC,CAAC,GAAG,GAAG,CACnC,SAAQ,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,OAAO,KAAK,EAAE,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC;IACpE;;;;;;;;OAQG;IACH,QAAQ,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC;IAC3D,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAClC;AAED,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAOvB,CAAC;AAgBF,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmBnB,CAAC"}
1
+ {"version":3,"file":"TabsList.d.ts","sourceRoot":"","sources":["../../../../tabs/lib/TabsList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAIL,YAAY,EAIb,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAC,KAAK,EAAC,MAAM,kCAAkC,CAAC;AAUvD,MAAM,WAAW,YAAY,CAAC,CAAC,GAAG,GAAG,CACnC,SAAQ,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,OAAO,KAAK,EAAE,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC;IACpE;;;;;;;;OAQG;IACH,QAAQ,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC;IAC3D,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAClC;AAED,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAOvB,CAAC;AAMF,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2BnB,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;CA+B7B,CAAC"}
@@ -30,18 +30,11 @@ export var useTabsList = composeHooks(createElemPropsHook(useTabsModel)(function
30
30
  var modality = useModalityType();
31
31
  return { role: 'tablist', overflowX: modality === 'touch' ? 'auto' : undefined };
32
32
  }), useOverflowListMeasure, useListResetCursorOnBlur);
33
- var StyledStack = styled(Stack)({
34
- '::after': {
35
- content: '""',
36
- position: 'sticky',
37
- height: 52,
38
- minWidth: 30,
39
- background: "linear-gradient(to right,rgba(255,255,255,0),white);",
40
- zIndex: 1,
41
- right: 0,
42
- top: 0,
43
- pointerEvents: 'none',
44
- },
33
+ var StyledStack = styled(Stack)(function (_a) {
34
+ var maskImage = _a.maskImage;
35
+ return ({
36
+ maskImage: maskImage,
37
+ });
45
38
  });
46
39
  export var TabsList = createSubcomponent('div')({
47
40
  displayName: 'Tabs.List',
@@ -50,7 +43,41 @@ export var TabsList = createSubcomponent('div')({
50
43
  })(function (_a, Element, model) {
51
44
  var children = _a.children, overflowButton = _a.overflowButton, elemProps = __rest(_a, ["children", "overflowButton"]);
52
45
  var modality = useModalityType();
53
- return (React.createElement(StyledStack, __assign({ as: Element, position: "relative", borderBottom: "1px solid " + commonColors.divider, paddingX: modality === 'touch' ? 'zero' : 'm', spacing: "xxxs" }, elemProps),
46
+ var touchStates = useTouchDirection();
47
+ return (React.createElement(StyledStack, __assign({ as: Element, position: "relative", borderBottom: "1px solid " + commonColors.divider, paddingX: modality === 'touch' ? 'zero' : 'm', spacing: "xs", maskImage: modality === 'touch' && touchStates.isDragging
48
+ ? "linear-gradient(" + (touchStates.direction === 'left' ? 'to left' : 'to right') + ", white 80%, transparent)"
49
+ : undefined }, elemProps),
54
50
  useListRenderItems(model, children),
55
51
  overflowButton));
56
52
  });
53
+ export var useTouchDirection = function () {
54
+ var _a = React.useState(false), isDragging = _a[0], setIsDragging = _a[1];
55
+ var _b = React.useState('right'), touchDir = _b[0], setTouchDirection = _b[1];
56
+ React.useEffect(function () {
57
+ var prevXPos = window.pageXOffset;
58
+ var handleTouchMove = function (e) {
59
+ var currXPos = e.touches[0].clientX;
60
+ setIsDragging(true);
61
+ if (currXPos > prevXPos) {
62
+ setTouchDirection('left');
63
+ }
64
+ else if (currXPos < prevXPos) {
65
+ setTouchDirection('right');
66
+ }
67
+ prevXPos = currXPos;
68
+ e.preventDefault();
69
+ };
70
+ var handleDragEnd = function () {
71
+ setIsDragging(false);
72
+ };
73
+ window.addEventListener('touchmove', handleTouchMove);
74
+ window.addEventListener('touchstart', handleDragEnd);
75
+ window.addEventListener('touchend', handleDragEnd);
76
+ return function () {
77
+ window.removeEventListener('touchmove', handleTouchMove);
78
+ window.removeEventListener('touchstart', handleDragEnd);
79
+ window.removeEventListener('touchend', handleDragEnd);
80
+ };
81
+ }, []);
82
+ return { direction: touchDir, isDragging: isDragging };
83
+ };
@@ -6,8 +6,22 @@ import {Flex, FlexProps} from './Flex';
6
6
  import {getValidChildren} from './utils/getValidChildren';
7
7
  import {stack, StackStyleProps} from './utils/stack';
8
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
+ */
9
16
  export type StackProps = FlexProps & StackStyleProps;
10
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
+ */
11
25
  const StackItem = createComponent('div')({
12
26
  displayName: 'Stack.Item',
13
27
  Component: ({children, ...elemProps}: BoxProps, ref, Element) => {
@@ -33,6 +47,13 @@ const shouldForwardProp = (prop: string) => {
33
47
 
34
48
  const StyledStack = styled(Flex, {shouldForwardProp})<StyledType & StackProps>(stack);
35
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
+ */
36
57
  export const Stack = createComponent('div')({
37
58
  displayName: 'Stack',
38
59
  Component: ({children, shouldWrapChildren = false, ...elemProps}: StackProps, ref, Element) => {
@@ -52,6 +73,13 @@ export const Stack = createComponent('div')({
52
73
  },
53
74
  });
54
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
+ */
55
83
  export interface HStackProps extends StackProps {
56
84
  /**
57
85
  * sets the direction for the stack
@@ -60,6 +88,13 @@ export interface HStackProps extends StackProps {
60
88
  flexDirection?: 'row' | 'row-reverse';
61
89
  }
62
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
+ */
63
98
  export const HStack = createComponent('div')({
64
99
  displayName: 'HStack',
65
100
  Component: ({children, flexDirection = 'row', ...elemProps}: HStackProps, ref, Element) => {
@@ -74,6 +109,13 @@ export const HStack = createComponent('div')({
74
109
  },
75
110
  });
76
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
+ */
77
119
  export interface VStackProps extends StackProps {
78
120
  /**
79
121
  * sets the direction for the stack
@@ -82,6 +124,13 @@ export interface VStackProps extends StackProps {
82
124
  flexDirection?: 'column' | 'column-reverse';
83
125
  }
84
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
+ */
85
134
  export const VStack = createComponent('div')({
86
135
  displayName: 'VStack',
87
136
  Component: ({children, flexDirection = 'column', ...elemProps}: VStackProps, ref, Element) => {
@@ -1,14 +1,37 @@
1
1
  import {space as spaceTokens} from '@workday/canvas-kit-react/tokens';
2
2
  import {CanvasSystemPropValues, SystemPropValues} from './systemProps';
3
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
+ */
4
11
  export type StackDirection = 'row' | 'column' | 'row-reverse' | 'column-reverse';
5
12
 
6
13
  const selector = '& > *:not(style) ~ *:not(style)';
7
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
+ */
8
22
  export type StackSpacing = SystemPropValues['space'];
9
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
+ */
10
31
  export type StackStyleProps = {
11
- /** sets space values between child elements (bidirectional support) */
32
+ /** sets space values between child elements (bidirectional support)
33
+ * @deprecated
34
+ */
12
35
  spacing: StackSpacing;
13
36
  /**
14
37
  * sets the direction for the stack
@@ -17,6 +40,7 @@ export type StackStyleProps = {
17
40
  flexDirection?: StackDirection;
18
41
  /**
19
42
  * when `true` wraps each child element in a `Stack.Item`
43
+ * @deprecated
20
44
  * @default false
21
45
  * */
22
46
  shouldWrapChildren?: boolean;
@@ -26,6 +50,13 @@ const getSpace = (value: SystemPropValues['space']) => {
26
50
  return spaceTokens[value as CanvasSystemPropValues['space']] || value;
27
51
  };
28
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
+ */
29
60
  export function stack<P extends StackStyleProps>(props: P) {
30
61
  const {flexDirection = 'row', spacing} = props;
31
62
  let styles = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workday/canvas-kit-react",
3
- "version": "8.4.0-299-next.0+8da934f1",
3
+ "version": "8.4.0-303-next.2+ef9246fe",
4
4
  "description": "The parent module that contains all Workday Canvas Kit React components",
5
5
  "author": "Workday, Inc. (https://www.workday.com)",
6
6
  "license": "Apache-2.0",
@@ -49,7 +49,7 @@
49
49
  "@emotion/styled": "^11.6.0",
50
50
  "@popperjs/core": "^2.5.4",
51
51
  "@workday/canvas-colors-web": "^2.0.0",
52
- "@workday/canvas-kit-popup-stack": "^8.4.0-299-next.0+8da934f1",
52
+ "@workday/canvas-kit-popup-stack": "^8.4.0-303-next.2+ef9246fe",
53
53
  "@workday/canvas-system-icons-web": "^3.0.0",
54
54
  "@workday/design-assets-types": "^0.2.8",
55
55
  "chroma-js": "^2.1.0",
@@ -67,5 +67,5 @@
67
67
  "@workday/canvas-accent-icons-web": "^3.0.0",
68
68
  "@workday/canvas-applet-icons-web": "^2.0.0"
69
69
  },
70
- "gitHead": "8da934f10feb07d111653a1b124edd8a97867366"
70
+ "gitHead": "ef9246fe888c63f6f2603ff35df3b6822d05baa1"
71
71
  }
@@ -44,19 +44,9 @@ export const useTabsList = composeHooks(
44
44
  useListResetCursorOnBlur
45
45
  );
46
46
 
47
- const StyledStack = styled(Stack)<StyledType>({
48
- '::after': {
49
- content: '""',
50
- position: 'sticky',
51
- height: 52,
52
- minWidth: 30,
53
- background: `linear-gradient(to right,rgba(255,255,255,0),white);`,
54
- zIndex: 1,
55
- right: 0,
56
- top: 0,
57
- pointerEvents: 'none',
58
- },
59
- });
47
+ const StyledStack = styled(Stack)<StyledType & {maskImage?: string}>(({maskImage}) => ({
48
+ maskImage: maskImage,
49
+ }));
60
50
 
61
51
  export const TabsList = createSubcomponent('div')({
62
52
  displayName: 'Tabs.List',
@@ -64,13 +54,21 @@ export const TabsList = createSubcomponent('div')({
64
54
  elemPropsHook: useTabsList,
65
55
  })<TabListProps>(({children, overflowButton, ...elemProps}, Element, model) => {
66
56
  const modality = useModalityType();
57
+ const touchStates = useTouchDirection();
67
58
  return (
68
59
  <StyledStack
69
60
  as={Element}
70
61
  position="relative"
71
62
  borderBottom={`1px solid ${commonColors.divider}`}
72
63
  paddingX={modality === 'touch' ? 'zero' : 'm'}
73
- spacing="xxxs"
64
+ spacing="xs"
65
+ maskImage={
66
+ modality === 'touch' && touchStates.isDragging
67
+ ? `linear-gradient(${
68
+ touchStates.direction === 'left' ? 'to left' : 'to right'
69
+ }, white 80%, transparent)`
70
+ : undefined
71
+ }
74
72
  {...elemProps}
75
73
  >
76
74
  {useListRenderItems(model, children)}
@@ -78,3 +76,36 @@ export const TabsList = createSubcomponent('div')({
78
76
  </StyledStack>
79
77
  );
80
78
  });
79
+
80
+ export const useTouchDirection = () => {
81
+ const [isDragging, setIsDragging] = React.useState(false);
82
+ const [touchDir, setTouchDirection] = React.useState('right');
83
+
84
+ React.useEffect(() => {
85
+ let prevXPos = window.pageXOffset;
86
+ const handleTouchMove = function(e: TouchEvent) {
87
+ const currXPos = e.touches[0].clientX;
88
+ setIsDragging(true);
89
+ if (currXPos > prevXPos) {
90
+ setTouchDirection('left');
91
+ } else if (currXPos < prevXPos) {
92
+ setTouchDirection('right');
93
+ }
94
+ prevXPos = currXPos;
95
+ e.preventDefault();
96
+ };
97
+ const handleDragEnd = function() {
98
+ setIsDragging(false);
99
+ };
100
+ window.addEventListener('touchmove', handleTouchMove);
101
+ window.addEventListener('touchstart', handleDragEnd);
102
+ window.addEventListener('touchend', handleDragEnd);
103
+ return () => {
104
+ window.removeEventListener('touchmove', handleTouchMove);
105
+ window.removeEventListener('touchstart', handleDragEnd);
106
+ window.removeEventListener('touchend', handleDragEnd);
107
+ };
108
+ }, []);
109
+
110
+ return {direction: touchDir, isDragging: isDragging};
111
+ };