@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
|
@@ -29,10 +29,8 @@ import { SystemIcon } from '@workday/canvas-kit-react/icon';
|
|
|
29
29
|
import { useListItemRegister, useListItemRovingFocus, isSelected, useListItemSelect, useOverflowListItemMeasure, } from '@workday/canvas-kit-react/collection';
|
|
30
30
|
import { useTabsModel } from './useTabsModel';
|
|
31
31
|
export var StyledTabItem = styled(Box.as('button'))(function (_a) {
|
|
32
|
-
var theme = _a.theme
|
|
33
|
-
return (__assign(__assign(__assign(__assign({}, type.levels.subtext.large), { '
|
|
34
|
-
marginLeft: spacing || space.xxs,
|
|
35
|
-
}, fontWeight: type.properties.fontWeights.medium, border: 'none', backgroundColor: 'transparent', flex: '0 0 auto', alignItems: 'center', padding: space.xs + " " + space.s, height: 52, boxSizing: 'border-box', cursor: 'pointer', color: colors.licorice300, position: 'relative', borderRadius: borderRadius.m + " " + borderRadius.m + " 0px 0px", transition: 'background 150ms ease, color 150ms ease' }), hideMouseFocus), { '.wd-icon-background ~ .wd-icon-accent, .wd-icon-background ~ .wd-icon-accent2': {
|
|
32
|
+
var theme = _a.theme;
|
|
33
|
+
return (__assign(__assign(__assign(__assign({}, type.levels.subtext.large), { fontWeight: type.properties.fontWeights.medium, border: 'none', backgroundColor: 'transparent', flex: '0 0 auto', alignItems: 'center', padding: space.xs + " " + space.s, height: 52, boxSizing: 'border-box', cursor: 'pointer', color: colors.licorice300, position: 'relative', borderRadius: borderRadius.m + " " + borderRadius.m + " 0px 0px", transition: 'background 150ms ease, color 150ms ease' }), hideMouseFocus), { '.wd-icon-background ~ .wd-icon-accent, .wd-icon-background ~ .wd-icon-accent2': {
|
|
36
34
|
fill: iconColors.active,
|
|
37
35
|
}, '&:hover, &:focus': {
|
|
38
36
|
backgroundColor: colors.soap200,
|
|
@@ -78,13 +76,14 @@ export var StyledTabItem = styled(Box.as('button'))(function (_a) {
|
|
|
78
76
|
},
|
|
79
77
|
} }));
|
|
80
78
|
}, function (_a) {
|
|
81
|
-
var children = _a.children;
|
|
79
|
+
var children = _a.children, _b = _a.gap, gap = _b === void 0 ? space.xxs : _b;
|
|
82
80
|
if (typeof children === 'string') {
|
|
83
81
|
return ellipsisStyles;
|
|
84
82
|
}
|
|
85
83
|
else {
|
|
86
84
|
return {
|
|
87
85
|
display: 'flex',
|
|
86
|
+
gap: gap,
|
|
88
87
|
};
|
|
89
88
|
}
|
|
90
89
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ExtractProps } from '@workday/canvas-kit-react/common';
|
|
3
|
-
import {
|
|
4
|
-
export interface TabListProps<T = any> extends Omit<
|
|
3
|
+
import { Flex } from '@workday/canvas-kit-react/layout';
|
|
4
|
+
export interface TabListProps<T = any> extends Omit<ExtractProps<typeof Flex, never>, 'children'> {
|
|
5
5
|
/**
|
|
6
6
|
* If items are passed to a `TabsModel`, the child of `Tabs.List` should be a render prop. The
|
|
7
7
|
* List will determine how and when the item will be rendered.
|
|
@@ -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,
|
|
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,IAAI,EAAC,MAAM,kCAAkC,CAAC;AAStD,MAAM,WAAW,YAAY,CAAC,CAAC,GAAG,GAAG,CAAE,SAAQ,IAAI,CAAC,YAAY,CAAC,OAAO,IAAI,EAAE,KAAK,CAAC,EAAE,UAAU,CAAC;IAC/F;;;;;;;;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"}
|
|
@@ -23,14 +23,14 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
23
23
|
import * as React from 'react';
|
|
24
24
|
import { commonColors } from '@workday/canvas-kit-react/tokens';
|
|
25
25
|
import { composeHooks, createSubcomponent, createElemPropsHook, useModalityType, styled, } from '@workday/canvas-kit-react/common';
|
|
26
|
-
import {
|
|
26
|
+
import { Flex } from '@workday/canvas-kit-react/layout';
|
|
27
27
|
import { useOverflowListMeasure, useListRenderItems, useListResetCursorOnBlur, } from '@workday/canvas-kit-react/collection';
|
|
28
28
|
import { useTabsModel } from './useTabsModel';
|
|
29
29
|
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(
|
|
33
|
+
var StyledStack = styled(Flex)(function (_a) {
|
|
34
34
|
var maskImage = _a.maskImage;
|
|
35
35
|
return ({
|
|
36
36
|
maskImage: maskImage,
|
|
@@ -44,7 +44,7 @@ export var TabsList = createSubcomponent('div')({
|
|
|
44
44
|
var children = _a.children, overflowButton = _a.overflowButton, elemProps = __rest(_a, ["children", "overflowButton"]);
|
|
45
45
|
var modality = useModalityType();
|
|
46
46
|
var touchStates = useTouchDirection();
|
|
47
|
-
return (React.createElement(StyledStack, __assign({ as: Element, position: "relative", borderBottom: "1px solid " + commonColors.divider, paddingX: modality === 'touch' ? 'zero' : 'm',
|
|
47
|
+
return (React.createElement(StyledStack, __assign({ as: Element, position: "relative", borderBottom: "1px solid " + commonColors.divider, paddingX: modality === 'touch' ? 'zero' : 'm', gap: "xs", maskImage: modality === 'touch' && touchStates.isDragging
|
|
48
48
|
? "linear-gradient(" + (touchStates.direction === 'left' ? 'to left' : 'to right') + ", white 80%, transparent)"
|
|
49
49
|
: undefined }, elemProps),
|
|
50
50
|
useListRenderItems(model, children),
|
|
@@ -39,7 +39,7 @@ export var TabsOverflowButton = createSubcomponent('button')({
|
|
|
39
39
|
elemPropsHook: useTabsOverflowButton,
|
|
40
40
|
})(function (_a, Element) {
|
|
41
41
|
var children = _a.children, elemProps = __rest(_a, ["children"]);
|
|
42
|
-
return (React.createElement(StyledTabItem, __assign({ type: "button",
|
|
42
|
+
return (React.createElement(StyledTabItem, __assign({ type: "button", gap: "xxxs", as: Element }, elemProps),
|
|
43
43
|
React.createElement("span", null, children),
|
|
44
44
|
React.createElement(SystemIcon, { icon: chevronDownSmallIcon })));
|
|
45
45
|
});
|
package/layout/index.ts
CHANGED
|
@@ -16,8 +16,7 @@ export {AllStyleProps, CommonStyleProps} from './lib/utils/styleProps';
|
|
|
16
16
|
export * from './lib/utils/text';
|
|
17
17
|
export * from './lib/Flex';
|
|
18
18
|
export * from './lib/Grid';
|
|
19
|
-
export * from './lib/Stack';
|
|
20
19
|
export type { FlexStyleProps } from './lib/utils/flex';
|
|
21
20
|
export type { GridStyleProps } from './lib/utils/grid';
|
|
22
21
|
export type { GridItemStyleProps, gridItemStyleFnConfigs } from './lib/utils/gridItem';
|
|
23
|
-
export
|
|
22
|
+
export * from './lib/utils/systemProps';
|
package/menu/lib/MenuList.tsx
CHANGED
|
@@ -7,12 +7,11 @@ import {
|
|
|
7
7
|
ExtractProps,
|
|
8
8
|
} from '@workday/canvas-kit-react/common';
|
|
9
9
|
import {ListBox} from '@workday/canvas-kit-react/collection';
|
|
10
|
-
import {
|
|
10
|
+
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
11
11
|
|
|
12
12
|
import {useMenuModel} from './useMenuModel';
|
|
13
13
|
|
|
14
|
-
export interface MenuListProps<T = any>
|
|
15
|
-
extends Omit<Partial<ExtractProps<typeof Stack, never>>, 'children'> {
|
|
14
|
+
export interface MenuListProps<T = any> extends Omit<ExtractProps<typeof Flex, never>, 'children'> {
|
|
16
15
|
/**
|
|
17
16
|
* The label text of the MenuList.
|
|
18
17
|
*/
|
|
@@ -39,7 +38,7 @@ export const MenuList = createSubcomponent('div')({
|
|
|
39
38
|
borderRadius="zero"
|
|
40
39
|
padding="zero"
|
|
41
40
|
marginY="xxs"
|
|
42
|
-
|
|
41
|
+
gap="zero"
|
|
43
42
|
overflowY="auto"
|
|
44
43
|
flexDirection={model.state.orientation === 'vertical' ? 'column' : 'row'}
|
|
45
44
|
{...elemProps}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workday/canvas-kit-react",
|
|
3
|
-
"version": "9.0.0-alpha.
|
|
3
|
+
"version": "9.0.0-alpha.336-next.6+d1c0111f",
|
|
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": "^9.0.0-alpha.
|
|
52
|
+
"@workday/canvas-kit-popup-stack": "^9.0.0-alpha.336-next.6+d1c0111f",
|
|
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": "
|
|
70
|
+
"gitHead": "d1c0111f20f012765e9e6bba83aeee320c84f2a6"
|
|
71
71
|
}
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from '@workday/canvas-system-icons-web';
|
|
9
9
|
|
|
10
10
|
import {PaginationModel} from './types';
|
|
11
|
-
import {
|
|
11
|
+
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
12
12
|
import {useRTL} from './common/utils/useRTL';
|
|
13
13
|
|
|
14
14
|
export type ControlButtonProps = TertiaryButtonProps &
|
|
@@ -20,9 +20,9 @@ export type ControlsProps = React.HTMLAttributes<HTMLDivElement>;
|
|
|
20
20
|
|
|
21
21
|
export const Controls = ({children, ...elemProps}: ControlsProps) => {
|
|
22
22
|
return (
|
|
23
|
-
<
|
|
23
|
+
<Flex gap="xxxs" alignItems="center" {...elemProps}>
|
|
24
24
|
{children}
|
|
25
|
-
</
|
|
25
|
+
</Flex>
|
|
26
26
|
);
|
|
27
27
|
};
|
|
28
28
|
|
|
@@ -1,25 +1,22 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import {Flex, FlexProps} from '@workday/canvas-kit-react/layout';
|
|
3
3
|
import {useRTL} from '../common/utils/useRTL';
|
|
4
4
|
|
|
5
|
-
export type GoToFormProps = React.FormHTMLAttributes<HTMLFormElement> &
|
|
6
|
-
Omit<HStackProps, 'spacing'> & {
|
|
7
|
-
spacing?: StackSpacing;
|
|
8
|
-
};
|
|
5
|
+
export type GoToFormProps = React.FormHTMLAttributes<HTMLFormElement> & FlexProps;
|
|
9
6
|
|
|
10
|
-
export const GoToForm = ({children, onSubmit,
|
|
7
|
+
export const GoToForm = ({children, onSubmit, gap = 'xxs', ...elemProps}: GoToFormProps) => {
|
|
11
8
|
const {shouldUseRTL} = useRTL();
|
|
12
9
|
return (
|
|
13
|
-
<
|
|
10
|
+
<Flex
|
|
14
11
|
as="form"
|
|
15
12
|
alignItems="center"
|
|
16
|
-
|
|
13
|
+
gap={gap}
|
|
17
14
|
paddingLeft={shouldUseRTL ? 'xxs' : undefined}
|
|
18
15
|
paddingRight={shouldUseRTL ? 'xxs' : undefined}
|
|
19
16
|
onSubmit={onSubmit}
|
|
20
17
|
{...elemProps}
|
|
21
18
|
>
|
|
22
19
|
{children}
|
|
23
|
-
</
|
|
20
|
+
</Flex>
|
|
24
21
|
);
|
|
25
22
|
};
|
|
@@ -2,26 +2,26 @@ import * as React from 'react';
|
|
|
2
2
|
|
|
3
3
|
import {PaginationModel} from './types';
|
|
4
4
|
import {ListItem, ListItemProps} from './common/List';
|
|
5
|
-
import {
|
|
5
|
+
import {Flex, FlexProps} from '@workday/canvas-kit-react/layout';
|
|
6
6
|
|
|
7
|
-
export interface PageListProps extends Omit<
|
|
7
|
+
export interface PageListProps extends Omit<FlexProps, 'as' | 'children'> {
|
|
8
8
|
model: PaginationModel;
|
|
9
9
|
children?: (model: PaginationModel) => React.ReactNode[] | React.ReactNode;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
export const PageList = ({model, children, ...elemProps}: PageListProps) => {
|
|
13
13
|
return (
|
|
14
|
-
<
|
|
14
|
+
<Flex
|
|
15
15
|
margin="zero"
|
|
16
16
|
as="ol"
|
|
17
17
|
role="list"
|
|
18
18
|
paddingLeft="zero"
|
|
19
19
|
paddingRight="zero"
|
|
20
|
-
|
|
20
|
+
gap="xxxs"
|
|
21
21
|
{...elemProps}
|
|
22
22
|
>
|
|
23
23
|
{typeof children === 'function' ? children(model) : children}
|
|
24
|
-
</
|
|
24
|
+
</Flex>
|
|
25
25
|
);
|
|
26
26
|
};
|
|
27
27
|
|
package/tabs/lib/TabsItem.tsx
CHANGED
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
createSubcomponent,
|
|
15
15
|
useModalityType,
|
|
16
16
|
} from '@workday/canvas-kit-react/common';
|
|
17
|
-
import {Box,
|
|
17
|
+
import {Box, FlexProps} from '@workday/canvas-kit-react/layout';
|
|
18
18
|
import {OverflowTooltip} from '@workday/canvas-kit-react/tooltip';
|
|
19
19
|
import {SystemIcon} from '@workday/canvas-kit-react/icon';
|
|
20
20
|
import {
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
import {useTabsModel} from './useTabsModel';
|
|
29
29
|
export interface TabsItemProps
|
|
30
30
|
extends ExtractProps<typeof Box, never>,
|
|
31
|
-
Partial<Pick<
|
|
31
|
+
Partial<Pick<FlexProps, 'gap'>> {
|
|
32
32
|
/**
|
|
33
33
|
* Optionally pass index to tab item. This should be done if `Tabs.Item` components were created
|
|
34
34
|
* via a `Array::map` function. This index will ensure keyboard navigation works even if items are
|
|
@@ -81,12 +81,9 @@ export interface TabsItemProps
|
|
|
81
81
|
tabIndex?: number;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
export const StyledTabItem = styled(Box.as('button'))<StyledType & Pick<TabsItemProps, '
|
|
85
|
-
({theme
|
|
84
|
+
export const StyledTabItem = styled(Box.as('button'))<StyledType & Pick<TabsItemProps, 'gap'>>(
|
|
85
|
+
({theme}) => ({
|
|
86
86
|
...type.levels.subtext.large,
|
|
87
|
-
'& > *:not(style) ~ *:not(style)': {
|
|
88
|
-
marginLeft: spacing || space.xxs,
|
|
89
|
-
},
|
|
90
87
|
fontWeight: type.properties.fontWeights.medium,
|
|
91
88
|
border: 'none',
|
|
92
89
|
backgroundColor: 'transparent',
|
|
@@ -160,12 +157,13 @@ export const StyledTabItem = styled(Box.as('button'))<StyledType & Pick<TabsItem
|
|
|
160
157
|
},
|
|
161
158
|
},
|
|
162
159
|
}),
|
|
163
|
-
({children}) => {
|
|
160
|
+
({children, gap = space.xxs}) => {
|
|
164
161
|
if (typeof children === 'string') {
|
|
165
162
|
return ellipsisStyles;
|
|
166
163
|
} else {
|
|
167
164
|
return {
|
|
168
165
|
display: 'flex',
|
|
166
|
+
gap,
|
|
169
167
|
};
|
|
170
168
|
}
|
|
171
169
|
}
|
package/tabs/lib/TabsList.tsx
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
styled,
|
|
11
11
|
StyledType,
|
|
12
12
|
} from '@workday/canvas-kit-react/common';
|
|
13
|
-
import {
|
|
13
|
+
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
14
14
|
import {
|
|
15
15
|
useOverflowListMeasure,
|
|
16
16
|
useListRenderItems,
|
|
@@ -19,9 +19,7 @@ import {
|
|
|
19
19
|
|
|
20
20
|
import {useTabsModel} from './useTabsModel';
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
export interface TabListProps<T = any>
|
|
24
|
-
extends Omit<Partial<ExtractProps<typeof Stack, never>>, 'children'> {
|
|
22
|
+
export interface TabListProps<T = any> extends Omit<ExtractProps<typeof Flex, never>, 'children'> {
|
|
25
23
|
/**
|
|
26
24
|
* If items are passed to a `TabsModel`, the child of `Tabs.List` should be a render prop. The
|
|
27
25
|
* List will determine how and when the item will be rendered.
|
|
@@ -44,7 +42,7 @@ export const useTabsList = composeHooks(
|
|
|
44
42
|
useListResetCursorOnBlur
|
|
45
43
|
);
|
|
46
44
|
|
|
47
|
-
const StyledStack = styled(
|
|
45
|
+
const StyledStack = styled(Flex)<StyledType & {maskImage?: string}>(({maskImage}) => ({
|
|
48
46
|
maskImage: maskImage,
|
|
49
47
|
}));
|
|
50
48
|
|
|
@@ -61,7 +59,7 @@ export const TabsList = createSubcomponent('div')({
|
|
|
61
59
|
position="relative"
|
|
62
60
|
borderBottom={`1px solid ${commonColors.divider}`}
|
|
63
61
|
paddingX={modality === 'touch' ? 'zero' : 'm'}
|
|
64
|
-
|
|
62
|
+
gap="xs"
|
|
65
63
|
maskImage={
|
|
66
64
|
modality === 'touch' && touchStates.isDragging
|
|
67
65
|
? `linear-gradient(${
|
|
@@ -37,7 +37,7 @@ export const TabsOverflowButton = createSubcomponent('button')({
|
|
|
37
37
|
elemPropsHook: useTabsOverflowButton,
|
|
38
38
|
})<OverflowButtonProps>(({children, ...elemProps}, Element) => {
|
|
39
39
|
return (
|
|
40
|
-
<StyledTabItem type="button"
|
|
40
|
+
<StyledTabItem type="button" gap="xxxs" as={Element} {...elemProps}>
|
|
41
41
|
<span>{children}</span>
|
|
42
42
|
<SystemIcon icon={chevronDownSmallIcon} />
|
|
43
43
|
</StyledTabItem>
|
|
@@ -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,127 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
16
|
-
}) : (function(o, m, k, k2) {
|
|
17
|
-
if (k2 === undefined) k2 = k;
|
|
18
|
-
o[k2] = m[k];
|
|
19
|
-
}));
|
|
20
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
-
}) : function(o, v) {
|
|
23
|
-
o["default"] = v;
|
|
24
|
-
});
|
|
25
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
26
|
-
if (mod && mod.__esModule) return mod;
|
|
27
|
-
var result = {};
|
|
28
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
29
|
-
__setModuleDefault(result, mod);
|
|
30
|
-
return result;
|
|
31
|
-
};
|
|
32
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
33
|
-
var t = {};
|
|
34
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
35
|
-
t[p] = s[p];
|
|
36
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
37
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
38
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
39
|
-
t[p[i]] = s[p[i]];
|
|
40
|
-
}
|
|
41
|
-
return t;
|
|
42
|
-
};
|
|
43
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
44
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
45
|
-
};
|
|
46
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47
|
-
exports.VStack = exports.HStack = exports.Stack = void 0;
|
|
48
|
-
var React = __importStar(require("react"));
|
|
49
|
-
var styled_1 = __importDefault(require("@emotion/styled"));
|
|
50
|
-
var common_1 = require("@workday/canvas-kit-react/common");
|
|
51
|
-
var Box_1 = require("./Box");
|
|
52
|
-
var Flex_1 = require("./Flex");
|
|
53
|
-
var getValidChildren_1 = require("./utils/getValidChildren");
|
|
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
|
-
*/
|
|
62
|
-
var StackItem = common_1.createComponent('div')({
|
|
63
|
-
displayName: 'Stack.Item',
|
|
64
|
-
Component: function (_a, ref, Element) {
|
|
65
|
-
var children = _a.children, elemProps = __rest(_a, ["children"]);
|
|
66
|
-
return (React.createElement(Box_1.Box, __assign({ as: Element, ref: ref, display: "inline-block", flex: "0 0 auto", minWidth: 0 }, elemProps), children));
|
|
67
|
-
},
|
|
68
|
-
});
|
|
69
|
-
// prevent `spacing` prop from being passed through to the HTML element
|
|
70
|
-
var shouldForwardProp = function (prop) {
|
|
71
|
-
return prop !== 'spacing';
|
|
72
|
-
};
|
|
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
|
-
*/
|
|
81
|
-
exports.Stack = common_1.createComponent('div')({
|
|
82
|
-
displayName: 'Stack',
|
|
83
|
-
Component: function (_a, ref, Element) {
|
|
84
|
-
var children = _a.children, _b = _a.shouldWrapChildren, shouldWrapChildren = _b === void 0 ? false : _b, elemProps = __rest(_a, ["children", "shouldWrapChildren"]);
|
|
85
|
-
var validChildren = getValidChildren_1.getValidChildren(children);
|
|
86
|
-
return (React.createElement(StyledStack, __assign({ as: Element, ref: ref, flexDirection: "row" }, elemProps), shouldWrapChildren
|
|
87
|
-
? validChildren.map(function (child, index) { return (React.createElement(StackItem, { key: child.props.id || index }, child)); })
|
|
88
|
-
: validChildren));
|
|
89
|
-
},
|
|
90
|
-
subComponents: {
|
|
91
|
-
Item: StackItem,
|
|
92
|
-
},
|
|
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
|
-
*/
|
|
101
|
-
exports.HStack = common_1.createComponent('div')({
|
|
102
|
-
displayName: 'HStack',
|
|
103
|
-
Component: function (_a, ref, Element) {
|
|
104
|
-
var children = _a.children, _b = _a.flexDirection, flexDirection = _b === void 0 ? 'row' : _b, elemProps = __rest(_a, ["children", "flexDirection"]);
|
|
105
|
-
return (React.createElement(exports.Stack, __assign({ as: Element, ref: ref, flexDirection: flexDirection }, elemProps), children));
|
|
106
|
-
},
|
|
107
|
-
subComponents: {
|
|
108
|
-
Item: StackItem,
|
|
109
|
-
},
|
|
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
|
-
*/
|
|
118
|
-
exports.VStack = common_1.createComponent('div')({
|
|
119
|
-
displayName: 'VStack',
|
|
120
|
-
Component: function (_a, ref, Element) {
|
|
121
|
-
var children = _a.children, _b = _a.flexDirection, flexDirection = _b === void 0 ? 'column' : _b, elemProps = __rest(_a, ["children", "flexDirection"]);
|
|
122
|
-
return (React.createElement(exports.Stack, __assign({ as: Element, ref: ref, flexDirection: flexDirection }, elemProps), children));
|
|
123
|
-
},
|
|
124
|
-
subComponents: {
|
|
125
|
-
Item: StackItem,
|
|
126
|
-
},
|
|
127
|
-
});
|
|
@@ -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,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.stack = void 0;
|
|
4
|
-
var tokens_1 = require("@workday/canvas-kit-react/tokens");
|
|
5
|
-
var selector = '& > *:not(style) ~ *:not(style)';
|
|
6
|
-
var getSpace = function (value) {
|
|
7
|
-
return tokens_1.space[value] || value;
|
|
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
|
-
function stack(props) {
|
|
17
|
-
var _a;
|
|
18
|
-
var _b = props.flexDirection, flexDirection = _b === void 0 ? 'row' : _b, spacing = props.spacing;
|
|
19
|
-
var styles = {};
|
|
20
|
-
if (flexDirection === 'column') {
|
|
21
|
-
styles = { marginTop: getSpace(spacing) };
|
|
22
|
-
}
|
|
23
|
-
if (flexDirection === 'column-reverse') {
|
|
24
|
-
styles = { marginBottom: getSpace(spacing) };
|
|
25
|
-
}
|
|
26
|
-
if (flexDirection === 'row') {
|
|
27
|
-
styles = { marginInlineStart: getSpace(spacing) };
|
|
28
|
-
}
|
|
29
|
-
if (flexDirection === 'row-reverse') {
|
|
30
|
-
styles = { marginInlineEnd: getSpace(spacing) };
|
|
31
|
-
}
|
|
32
|
-
return _a = {},
|
|
33
|
-
_a[selector] = styles,
|
|
34
|
-
_a;
|
|
35
|
-
}
|
|
36
|
-
exports.stack = stack;
|