@workday/canvas-kit-labs-react 7.0.0-alpha.0-next.6 → 7.0.0-alpha.0-next.7

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.
Files changed (175) hide show
  1. package/common/index.ts +0 -8
  2. package/dist/commonjs/common/index.d.ts +0 -8
  3. package/dist/commonjs/common/index.d.ts.map +1 -1
  4. package/dist/commonjs/common/index.js +0 -1
  5. package/dist/commonjs/index.d.ts +0 -1
  6. package/dist/commonjs/index.d.ts.map +1 -1
  7. package/dist/commonjs/index.js +0 -1
  8. package/dist/es6/common/index.d.ts +0 -8
  9. package/dist/es6/common/index.d.ts.map +1 -1
  10. package/dist/es6/common/index.js +0 -1
  11. package/dist/es6/index.d.ts +0 -1
  12. package/dist/es6/index.d.ts.map +1 -1
  13. package/dist/es6/index.js +0 -1
  14. package/index.ts +0 -1
  15. package/package.json +4 -6
  16. package/ts3.5/dist/commonjs/common/index.d.ts +0 -8
  17. package/ts3.5/dist/commonjs/index.d.ts +0 -1
  18. package/ts3.5/dist/es6/common/index.d.ts +0 -8
  19. package/ts3.5/dist/es6/index.d.ts +0 -1
  20. package/common/lib/Box.tsx +0 -92
  21. package/common/lib/utils/border.ts +0 -263
  22. package/common/lib/utils/color.ts +0 -62
  23. package/common/lib/utils/depth.ts +0 -37
  24. package/common/lib/utils/flexItem.ts +0 -56
  25. package/common/lib/utils/layout.ts +0 -77
  26. package/common/lib/utils/other.ts +0 -20
  27. package/common/lib/utils/position.ts +0 -96
  28. package/common/lib/utils/space.ts +0 -207
  29. package/common/lib/utils/types.ts +0 -105
  30. package/dist/commonjs/common/lib/Box.d.ts +0 -31
  31. package/dist/commonjs/common/lib/Box.d.ts.map +0 -1
  32. package/dist/commonjs/common/lib/Box.js +0 -99
  33. package/dist/commonjs/common/lib/utils/border.d.ts +0 -103
  34. package/dist/commonjs/common/lib/utils/border.d.ts.map +0 -1
  35. package/dist/commonjs/common/lib/utils/border.js +0 -153
  36. package/dist/commonjs/common/lib/utils/color.d.ts +0 -26
  37. package/dist/commonjs/common/lib/utils/color.d.ts.map +0 -1
  38. package/dist/commonjs/common/lib/utils/color.js +0 -57
  39. package/dist/commonjs/common/lib/utils/depth.d.ts +0 -22
  40. package/dist/commonjs/common/lib/utils/depth.d.ts.map +0 -1
  41. package/dist/commonjs/common/lib/utils/depth.js +0 -29
  42. package/dist/commonjs/common/lib/utils/flexItem.d.ts +0 -33
  43. package/dist/commonjs/common/lib/utils/flexItem.d.ts.map +0 -1
  44. package/dist/commonjs/common/lib/utils/flexItem.js +0 -39
  45. package/dist/commonjs/common/lib/utils/layout.d.ts +0 -43
  46. package/dist/commonjs/common/lib/utils/layout.d.ts.map +0 -1
  47. package/dist/commonjs/common/lib/utils/layout.js +0 -43
  48. package/dist/commonjs/common/lib/utils/other.d.ts +0 -5
  49. package/dist/commonjs/common/lib/utils/other.d.ts.map +0 -1
  50. package/dist/commonjs/common/lib/utils/other.js +0 -19
  51. package/dist/commonjs/common/lib/utils/position.d.ts +0 -41
  52. package/dist/commonjs/common/lib/utils/position.d.ts.map +0 -1
  53. package/dist/commonjs/common/lib/utils/position.js +0 -78
  54. package/dist/commonjs/common/lib/utils/space.d.ts +0 -64
  55. package/dist/commonjs/common/lib/utils/space.d.ts.map +0 -1
  56. package/dist/commonjs/common/lib/utils/space.js +0 -161
  57. package/dist/commonjs/common/lib/utils/types.d.ts +0 -14
  58. package/dist/commonjs/common/lib/utils/types.d.ts.map +0 -1
  59. package/dist/commonjs/common/lib/utils/types.js +0 -2
  60. package/dist/commonjs/layout/index.d.ts +0 -5
  61. package/dist/commonjs/layout/index.d.ts.map +0 -1
  62. package/dist/commonjs/layout/index.js +0 -14
  63. package/dist/commonjs/layout/lib/Flex.d.ts +0 -26
  64. package/dist/commonjs/layout/lib/Flex.d.ts.map +0 -1
  65. package/dist/commonjs/layout/lib/Flex.js +0 -83
  66. package/dist/commonjs/layout/lib/Stack.d.ts +0 -27
  67. package/dist/commonjs/layout/lib/Stack.d.ts.map +0 -1
  68. package/dist/commonjs/layout/lib/Stack.js +0 -99
  69. package/dist/commonjs/layout/lib/utils/flex.d.ts +0 -36
  70. package/dist/commonjs/layout/lib/utils/flex.d.ts.map +0 -1
  71. package/dist/commonjs/layout/lib/utils/flex.js +0 -38
  72. package/dist/commonjs/layout/lib/utils/getValidChildren.d.ts +0 -3
  73. package/dist/commonjs/layout/lib/utils/getValidChildren.d.ts.map +0 -1
  74. package/dist/commonjs/layout/lib/utils/getValidChildren.js +0 -29
  75. package/dist/commonjs/layout/lib/utils/stack.d.ts +0 -26
  76. package/dist/commonjs/layout/lib/utils/stack.d.ts.map +0 -1
  77. package/dist/commonjs/layout/lib/utils/stack.js +0 -55
  78. package/dist/commonjs/layout/lib/utils/types.d.ts +0 -8
  79. package/dist/commonjs/layout/lib/utils/types.d.ts.map +0 -1
  80. package/dist/commonjs/layout/lib/utils/types.js +0 -2
  81. package/dist/es6/common/lib/Box.d.ts +0 -31
  82. package/dist/es6/common/lib/Box.d.ts.map +0 -1
  83. package/dist/es6/common/lib/Box.js +0 -74
  84. package/dist/es6/common/lib/utils/border.d.ts +0 -103
  85. package/dist/es6/common/lib/utils/border.d.ts.map +0 -1
  86. package/dist/es6/common/lib/utils/border.js +0 -149
  87. package/dist/es6/common/lib/utils/color.d.ts +0 -26
  88. package/dist/es6/common/lib/utils/color.d.ts.map +0 -1
  89. package/dist/es6/common/lib/utils/color.js +0 -53
  90. package/dist/es6/common/lib/utils/depth.d.ts +0 -22
  91. package/dist/es6/common/lib/utils/depth.d.ts.map +0 -1
  92. package/dist/es6/common/lib/utils/depth.js +0 -25
  93. package/dist/es6/common/lib/utils/flexItem.d.ts +0 -33
  94. package/dist/es6/common/lib/utils/flexItem.d.ts.map +0 -1
  95. package/dist/es6/common/lib/utils/flexItem.js +0 -35
  96. package/dist/es6/common/lib/utils/layout.d.ts +0 -43
  97. package/dist/es6/common/lib/utils/layout.d.ts.map +0 -1
  98. package/dist/es6/common/lib/utils/layout.js +0 -39
  99. package/dist/es6/common/lib/utils/other.d.ts +0 -5
  100. package/dist/es6/common/lib/utils/other.d.ts.map +0 -1
  101. package/dist/es6/common/lib/utils/other.js +0 -15
  102. package/dist/es6/common/lib/utils/position.d.ts +0 -41
  103. package/dist/es6/common/lib/utils/position.d.ts.map +0 -1
  104. package/dist/es6/common/lib/utils/position.js +0 -74
  105. package/dist/es6/common/lib/utils/space.d.ts +0 -64
  106. package/dist/es6/common/lib/utils/space.d.ts.map +0 -1
  107. package/dist/es6/common/lib/utils/space.js +0 -157
  108. package/dist/es6/common/lib/utils/types.d.ts +0 -14
  109. package/dist/es6/common/lib/utils/types.d.ts.map +0 -1
  110. package/dist/es6/common/lib/utils/types.js +0 -1
  111. package/dist/es6/layout/index.d.ts +0 -5
  112. package/dist/es6/layout/index.d.ts.map +0 -1
  113. package/dist/es6/layout/index.js +0 -2
  114. package/dist/es6/layout/lib/Flex.d.ts +0 -26
  115. package/dist/es6/layout/lib/Flex.d.ts.map +0 -1
  116. package/dist/es6/layout/lib/Flex.js +0 -58
  117. package/dist/es6/layout/lib/Stack.d.ts +0 -27
  118. package/dist/es6/layout/lib/Stack.d.ts.map +0 -1
  119. package/dist/es6/layout/lib/Stack.js +0 -74
  120. package/dist/es6/layout/lib/utils/flex.d.ts +0 -36
  121. package/dist/es6/layout/lib/utils/flex.d.ts.map +0 -1
  122. package/dist/es6/layout/lib/utils/flex.js +0 -34
  123. package/dist/es6/layout/lib/utils/getValidChildren.d.ts +0 -3
  124. package/dist/es6/layout/lib/utils/getValidChildren.d.ts.map +0 -1
  125. package/dist/es6/layout/lib/utils/getValidChildren.js +0 -6
  126. package/dist/es6/layout/lib/utils/stack.d.ts +0 -26
  127. package/dist/es6/layout/lib/utils/stack.d.ts.map +0 -1
  128. package/dist/es6/layout/lib/utils/stack.js +0 -51
  129. package/dist/es6/layout/lib/utils/types.d.ts +0 -8
  130. package/dist/es6/layout/lib/utils/types.d.ts.map +0 -1
  131. package/dist/es6/layout/lib/utils/types.js +0 -1
  132. package/layout/LICENSE +0 -52
  133. package/layout/README.md +0 -16
  134. package/layout/index.ts +0 -4
  135. package/layout/lib/Flex.tsx +0 -47
  136. package/layout/lib/Stack.tsx +0 -95
  137. package/layout/lib/utils/flex.ts +0 -65
  138. package/layout/lib/utils/getValidChildren.ts +0 -7
  139. package/layout/lib/utils/stack.ts +0 -78
  140. package/layout/lib/utils/types.ts +0 -45
  141. package/layout/package.json +0 -5
  142. package/ts3.5/dist/commonjs/common/lib/Box.d.ts +0 -31
  143. package/ts3.5/dist/commonjs/common/lib/utils/border.d.ts +0 -103
  144. package/ts3.5/dist/commonjs/common/lib/utils/color.d.ts +0 -26
  145. package/ts3.5/dist/commonjs/common/lib/utils/depth.d.ts +0 -22
  146. package/ts3.5/dist/commonjs/common/lib/utils/flexItem.d.ts +0 -33
  147. package/ts3.5/dist/commonjs/common/lib/utils/layout.d.ts +0 -43
  148. package/ts3.5/dist/commonjs/common/lib/utils/other.d.ts +0 -5
  149. package/ts3.5/dist/commonjs/common/lib/utils/position.d.ts +0 -41
  150. package/ts3.5/dist/commonjs/common/lib/utils/space.d.ts +0 -64
  151. package/ts3.5/dist/commonjs/common/lib/utils/types.d.ts +0 -14
  152. package/ts3.5/dist/commonjs/layout/index.d.ts +0 -5
  153. package/ts3.5/dist/commonjs/layout/lib/Flex.d.ts +0 -26
  154. package/ts3.5/dist/commonjs/layout/lib/Stack.d.ts +0 -27
  155. package/ts3.5/dist/commonjs/layout/lib/utils/flex.d.ts +0 -36
  156. package/ts3.5/dist/commonjs/layout/lib/utils/getValidChildren.d.ts +0 -3
  157. package/ts3.5/dist/commonjs/layout/lib/utils/stack.d.ts +0 -26
  158. package/ts3.5/dist/commonjs/layout/lib/utils/types.d.ts +0 -8
  159. package/ts3.5/dist/es6/common/lib/Box.d.ts +0 -31
  160. package/ts3.5/dist/es6/common/lib/utils/border.d.ts +0 -103
  161. package/ts3.5/dist/es6/common/lib/utils/color.d.ts +0 -26
  162. package/ts3.5/dist/es6/common/lib/utils/depth.d.ts +0 -22
  163. package/ts3.5/dist/es6/common/lib/utils/flexItem.d.ts +0 -33
  164. package/ts3.5/dist/es6/common/lib/utils/layout.d.ts +0 -43
  165. package/ts3.5/dist/es6/common/lib/utils/other.d.ts +0 -5
  166. package/ts3.5/dist/es6/common/lib/utils/position.d.ts +0 -41
  167. package/ts3.5/dist/es6/common/lib/utils/space.d.ts +0 -64
  168. package/ts3.5/dist/es6/common/lib/utils/types.d.ts +0 -14
  169. package/ts3.5/dist/es6/layout/index.d.ts +0 -5
  170. package/ts3.5/dist/es6/layout/lib/Flex.d.ts +0 -26
  171. package/ts3.5/dist/es6/layout/lib/Stack.d.ts +0 -27
  172. package/ts3.5/dist/es6/layout/lib/utils/flex.d.ts +0 -36
  173. package/ts3.5/dist/es6/layout/lib/utils/getValidChildren.d.ts +0 -3
  174. package/ts3.5/dist/es6/layout/lib/utils/stack.d.ts +0 -26
  175. package/ts3.5/dist/es6/layout/lib/utils/types.d.ts +0 -8
@@ -1 +0,0 @@
1
- {"version":3,"file":"space.d.ts","sourceRoot":"","sources":["../../../../../common/lib/utils/space.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,yBAAyB,EAE1B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAoC,eAAe,EAAC,MAAM,kCAAkC,CAAC;AAEpG,aAAK,eAAe,GAAG,eAAe,GAAG,MAAM,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAEhE,wEAAwE;AACxE,oBAAY,iBAAiB,GAAG;IAC9B,wDAAwD;IACxD,iBAAiB,CAAC,EAAE,eAAe,CAAC;IACpC,yDAAyD;IACzD,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,yDAAyD;IACzD,kBAAkB,CAAC,EAAE,eAAe,CAAC;IACrC,0DAA0D;IAC1D,gBAAgB,CAAC,EAAE,eAAe,CAAC;CACpC,CAAC;AAEF,iEAAiE;AACjE,oBAAY,kBAAkB,GAAG;IAC/B,2BAA2B;IAC3B,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,mDAAmD;IACnD,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,mDAAmD;IACnD,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,+BAA+B;IAC/B,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,4DAA4D;IAC5D,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,kCAAkC;IAClC,YAAY,CAAC,EAAE,eAAe,CAAC;IAC/B,2DAA2D;IAC3D,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B,4BAA4B;IAC5B,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,oDAAoD;IACpD,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,qDAAqD;IACrD,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,gCAAgC;IAChC,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B,6DAA6D;IAC7D,YAAY,CAAC,EAAE,eAAe,CAAC;IAC/B,0BAA0B;IAC1B,aAAa,CAAC,EAAE,eAAe,CAAC;IAChC,4DAA4D;IAC5D,WAAW,CAAC,EAAE,eAAe,CAAC;CAC/B,CAAC;AAEF,oBAAY,eAAe,GAAG,kBAAkB,GAAG,iBAAiB,CAAC;AAoHrE;;;;;;;;;;;;GAYG;AACH,wBAAgB,KAAK,CAAC,CAAC,SAAS,eAAe,GAAG;IAAC,KAAK,CAAC,EAAE,yBAAyB,CAAA;CAAC,EAAE,KAAK,EAAE,CAAC,MAwB9F"}
@@ -1,157 +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
- import { ContentDirection, useTheme, } from '@workday/canvas-kit-react/common';
13
- import { space as spaceTokens } from '@workday/canvas-kit-react/tokens';
14
- var margin = function (value) {
15
- return { margin: spaceTokens[value] || value };
16
- };
17
- var marginX = function (value) {
18
- return {
19
- marginLeft: spaceTokens[value] || value,
20
- marginRight: spaceTokens[value] || value,
21
- };
22
- };
23
- var marginY = function (value) {
24
- return {
25
- marginTop: spaceTokens[value] || value,
26
- marginBottom: spaceTokens[value] || value,
27
- };
28
- };
29
- var marginTop = function (value) {
30
- return {
31
- marginTop: spaceTokens[value] || value,
32
- };
33
- };
34
- var marginRight = function (value, isRTL) {
35
- var _a;
36
- if (isRTL === void 0) { isRTL = false; }
37
- var attr = isRTL ? 'marginLeft' : 'marginRight';
38
- return _a = {},
39
- _a[attr] = spaceTokens[value] || value,
40
- _a;
41
- };
42
- var marginBottom = function (value) {
43
- return {
44
- marginBottom: spaceTokens[value] || value,
45
- };
46
- };
47
- var marginLeft = function (value, isRTL) {
48
- var _a;
49
- if (isRTL === void 0) { isRTL = false; }
50
- var attr = isRTL ? 'marginRight' : 'marginLeft';
51
- return _a = {},
52
- _a[attr] = spaceTokens[value] || value,
53
- _a;
54
- };
55
- var padding = function (value) {
56
- return {
57
- padding: spaceTokens[value] || value,
58
- };
59
- };
60
- var paddingX = function (value) {
61
- return {
62
- paddingLeft: spaceTokens[value] || value,
63
- paddingRight: spaceTokens[value] || value,
64
- };
65
- };
66
- var paddingY = function (value) {
67
- return {
68
- paddingTop: spaceTokens[value] || value,
69
- paddingBottom: spaceTokens[value] || value,
70
- };
71
- };
72
- var paddingTop = function (value) {
73
- return {
74
- paddingTop: spaceTokens[value] || value,
75
- };
76
- };
77
- var paddingRight = function (value, isRTL) {
78
- var _a;
79
- if (isRTL === void 0) { isRTL = false; }
80
- var attr = isRTL ? 'paddingLeft' : 'paddingRight';
81
- return _a = {},
82
- _a[attr] = spaceTokens[value] || value,
83
- _a;
84
- };
85
- var paddingBottom = function (value) {
86
- return {
87
- paddingBottom: spaceTokens[value] || value,
88
- };
89
- };
90
- var paddingLeft = function (value, isRTL) {
91
- var _a;
92
- if (isRTL === void 0) { isRTL = false; }
93
- var attr = isRTL ? 'paddingRight' : 'paddingLeft';
94
- return _a = {},
95
- _a[attr] = spaceTokens[value] || value,
96
- _a;
97
- };
98
- var logicalSpaceStyleProps = {
99
- marginInlineStart: marginLeft,
100
- marginInlineEnd: marginRight,
101
- paddingInlineStart: paddingLeft,
102
- paddingInlineEnd: paddingRight,
103
- };
104
- var standardSpaceStyleProps = {
105
- margin: margin,
106
- marginX: marginX,
107
- marginY: marginY,
108
- marginTop: marginTop,
109
- marginRight: marginRight,
110
- marginBottom: marginBottom,
111
- marginLeft: marginLeft,
112
- padding: padding,
113
- paddingX: paddingX,
114
- paddingY: paddingY,
115
- paddingTop: paddingTop,
116
- paddingRight: paddingRight,
117
- paddingBottom: paddingBottom,
118
- paddingLeft: paddingLeft,
119
- };
120
- /**
121
- * A style prop function that takes component props and returns space styles.
122
- * If no `SpaceStyleProps` are found, it returns an empty object.
123
- *
124
- * @example
125
- * // You'll most likely use `space` with low-level, styled components
126
- * const BoxExample = () => (
127
- * <Box padding="xs" margin="m">
128
- * Hello, space!
129
- * </Box>
130
- * );
131
- *
132
- */
133
- export function space(props) {
134
- // space will always be used within the context of a component, but eslint doesn't know that
135
- // eslint-disable-next-line react-hooks/rules-of-hooks
136
- var canvas = useTheme(props.theme).canvas;
137
- var styles = {};
138
- for (var key in props) {
139
- if (props.hasOwnProperty(key)) {
140
- if (key in standardSpaceStyleProps) {
141
- var value = props[key];
142
- var spaceFn = standardSpaceStyleProps[key];
143
- var style = spaceFn(value);
144
- styles = __assign(__assign({}, styles), style);
145
- continue;
146
- }
147
- if (key in logicalSpaceStyleProps) {
148
- var value = props[key];
149
- var spaceFn = logicalSpaceStyleProps[key];
150
- var isRTL = canvas.direction === ContentDirection.RTL;
151
- var style = spaceFn(value, isRTL);
152
- styles = __assign(__assign({}, styles), style);
153
- }
154
- }
155
- }
156
- return styles;
157
- }
@@ -1,14 +0,0 @@
1
- import { Globals, GlobalsNumber, SelfPosition, DisplayOutside, DisplayInside, DisplayInternal, DisplayLegacy, LineStyle } from 'csstype';
2
- export declare type PropertyBorder = Globals | LineStyle | (string & {});
3
- export declare type PropertyJustifySelf = Globals | SelfPosition | 'auto' | 'baseline' | 'left' | 'normal' | 'right' | 'stretch' | (string & {});
4
- export declare type PropertyAlignSelf = Globals | SelfPosition | 'auto' | 'baseline' | 'normal' | 'stretch' | (string & {});
5
- export declare type PropertyOrder = GlobalsNumber;
6
- export declare type PropertyDisplay = Globals | DisplayOutside | DisplayInside | DisplayInternal | DisplayLegacy | 'contents' | 'list-item' | 'none' | (string & {});
7
- export declare type PropertyListStyle = Globals | 'inside' | 'none' | 'outside' | (string & {});
8
- export declare type PropertyOverflow = Globals | '-moz-hidden-unscrollable' | 'auto' | 'clip' | 'hidden' | 'scroll' | 'visible' | (string & {});
9
- export declare type PropertyOverflowX = Globals | '-moz-hidden-unscrollable' | 'auto' | 'clip' | 'hidden' | 'scroll' | 'visible';
10
- export declare type PropertyOverflowY = Globals | '-moz-hidden-unscrollable' | 'auto' | 'clip' | 'hidden' | 'scroll' | 'visible';
11
- export declare type PropertyVerticalAlign = Globals | 'baseline' | 'bottom' | 'middle' | 'sub' | 'super' | 'text-bottom' | 'text-top' | 'top' | (string & {});
12
- export declare type PropertyPosition = Globals | '-webkit-sticky' | 'absolute' | 'fixed' | 'relative' | 'static' | 'sticky';
13
- export declare type PropertyZIndex = GlobalsNumber | 'auto';
14
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../common/lib/utils/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,aAAa,EACb,YAAY,EACZ,cAAc,EACd,aAAa,EACb,eAAe,EACf,aAAa,EACb,SAAS,EACV,MAAM,SAAS,CAAC;AAMjB,oBAAY,cAAc,GAAG,OAAO,GAAG,SAAS,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAGjE,oBAAY,mBAAmB,GAC3B,OAAO,GACP,YAAY,GACZ,MAAM,GACN,UAAU,GACV,MAAM,GACN,QAAQ,GACR,OAAO,GACP,SAAS,GACT,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAElB,oBAAY,iBAAiB,GACzB,OAAO,GACP,YAAY,GACZ,MAAM,GACN,UAAU,GACV,QAAQ,GACR,SAAS,GACT,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAElB,oBAAY,aAAa,GAAG,aAAa,CAAC;AAG1C,oBAAY,eAAe,GACvB,OAAO,GACP,cAAc,GACd,aAAa,GACb,eAAe,GACf,aAAa,GACb,UAAU,GACV,WAAW,GACX,MAAM,GACN,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAElB,oBAAY,iBAAiB,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAExF,oBAAY,gBAAgB,GACxB,OAAO,GACP,0BAA0B,GAC1B,MAAM,GACN,MAAM,GACN,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAElB,oBAAY,iBAAiB,GACzB,OAAO,GACP,0BAA0B,GAC1B,MAAM,GACN,MAAM,GACN,QAAQ,GACR,QAAQ,GACR,SAAS,CAAC;AAEd,oBAAY,iBAAiB,GACzB,OAAO,GACP,0BAA0B,GAC1B,MAAM,GACN,MAAM,GACN,QAAQ,GACR,QAAQ,GACR,SAAS,CAAC;AAEd,oBAAY,qBAAqB,GAC7B,OAAO,GACP,UAAU,GACV,QAAQ,GACR,QAAQ,GACR,KAAK,GACL,OAAO,GACP,aAAa,GACb,UAAU,GACV,KAAK,GACL,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAGlB,oBAAY,gBAAgB,GACxB,OAAO,GACP,gBAAgB,GAChB,UAAU,GACV,OAAO,GACP,UAAU,GACV,QAAQ,GACR,QAAQ,CAAC;AAEb,oBAAY,cAAc,GAAG,aAAa,GAAG,MAAM,CAAC"}
@@ -1 +0,0 @@
1
- export {};
@@ -1,5 +0,0 @@
1
- export * from './lib/Flex';
2
- export * from './lib/Stack';
3
- export type { FlexStyleProps } from './lib/utils/flex';
4
- export type { StackSpacing, StackDirection, StackStyleProps } from './lib/utils/stack';
5
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../layout/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
@@ -1,2 +0,0 @@
1
- export * from './lib/Flex';
2
- export * from './lib/Stack';
@@ -1,26 +0,0 @@
1
- import { BoxProps } from '@workday/canvas-kit-labs-react/common';
2
- import { FlexStyleProps } from './utils/flex';
3
- export declare type FlexProps = BoxProps & FlexStyleProps;
4
- /**
5
- * `Flex` is a low-level layout component that provides a common, ergonomic API for applying CSS flexbox styles.
6
- * It is highly flexible, and can be used on its own or to build other components.
7
- * `Flex` is built on top of `Box` and has access to all `BoxProps`.
8
- *
9
- * @example
10
- * import { Flex, FlexProps } from '@workday/canvas-kit-labs-react/layout';
11
- *
12
- * interface CardProps extends FlexProps {
13
- * // card-specific props
14
- * }
15
- *
16
- * // `Card`'s default values are set using `FlexProps`
17
- * const Card = (props: CardProps) => (
18
- * <Flex flexDirection="column" alignItems="flex-start" depth={2} space="m" {...props}>
19
- * <h1>Hello, Card!</h1>
20
- * <p>This card uses flexbox to set its layout.</p>
21
- * </Flex>
22
- * );
23
- *
24
- */
25
- export declare const Flex: import("@workday/canvas-kit-react/common").ElementComponent<"div", import("../../common/lib/utils/border").BorderShorthandStyleProps & import("../../common/lib/utils/border").BorderColorStyleProps & import("../../common/lib/utils/border").BorderRadiusStyleProps & import("../../common/lib/utils/border").BorderLineStyleProps & import("../../common/lib/utils/border").BorderWidthStyleProps & import("../../common/lib/utils/border").BorderLogicalStyleProps & import("../../common").ColorStyleProps & import("../../common").DepthStyleProps & import("../../common").FlexItemStyleProps & import("../../common").LayoutStyleProps & import("../../common/lib/utils/other").OtherStyleProps & import("../../common/lib/utils/position").PositionStandardProps & import("../../common/lib/utils/position").PositionLogicalProps & import("../../common/lib/utils/space").SpaceStandardProps & import("../../common/lib/utils/space").SpaceLogicalProps & FlexStyleProps>;
26
- //# sourceMappingURL=Flex.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Flex.d.ts","sourceRoot":"","sources":["../../../../layout/lib/Flex.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAM,QAAQ,EAAC,MAAM,uCAAuC,CAAC;AAEpE,OAAO,EAAO,cAAc,EAAC,MAAM,cAAc,CAAC;AAElD,oBAAY,SAAS,GAAG,QAAQ,GAAG,cAAc,CAAC;AASlD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,IAAI,q7BASf,CAAC"}
@@ -1,58 +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 '@workday/canvas-kit-labs-react/common';
27
- import { flex } from './utils/flex';
28
- var StyledFlex = styled(Box)({
29
- display: 'flex',
30
- }, flex);
31
- /**
32
- * `Flex` is a low-level layout component that provides a common, ergonomic API for applying CSS flexbox styles.
33
- * It is highly flexible, and can be used on its own or to build other components.
34
- * `Flex` is built on top of `Box` and has access to all `BoxProps`.
35
- *
36
- * @example
37
- * import { Flex, FlexProps } from '@workday/canvas-kit-labs-react/layout';
38
- *
39
- * interface CardProps extends FlexProps {
40
- * // card-specific props
41
- * }
42
- *
43
- * // `Card`'s default values are set using `FlexProps`
44
- * const Card = (props: CardProps) => (
45
- * <Flex flexDirection="column" alignItems="flex-start" depth={2} space="m" {...props}>
46
- * <h1>Hello, Card!</h1>
47
- * <p>This card uses flexbox to set its layout.</p>
48
- * </Flex>
49
- * );
50
- *
51
- */
52
- export var Flex = createComponent('div')({
53
- displayName: 'Flex',
54
- Component: function (_a, ref, Element) {
55
- var children = _a.children, elemProps = __rest(_a, ["children"]);
56
- return (React.createElement(StyledFlex, __assign({ as: Element, ref: ref }, elemProps), children));
57
- },
58
- });
@@ -1,27 +0,0 @@
1
- import { FlexProps } from './Flex';
2
- import { StackStyleProps } from './utils/stack';
3
- export declare type StackProps = FlexProps & StackStyleProps;
4
- export declare const Stack: import("@workday/canvas-kit-react/common").ElementComponent<"div", import("../../common/lib/utils/border").BorderShorthandStyleProps & import("../../common/lib/utils/border").BorderColorStyleProps & import("../../common/lib/utils/border").BorderRadiusStyleProps & import("../../common/lib/utils/border").BorderLineStyleProps & import("../../common/lib/utils/border").BorderWidthStyleProps & import("../../common/lib/utils/border").BorderLogicalStyleProps & import("../../common").ColorStyleProps & import("../../common").DepthStyleProps & import("../../common").FlexItemStyleProps & import("../../common").LayoutStyleProps & import("../../common/lib/utils/other").OtherStyleProps & import("../../common/lib/utils/position").PositionStandardProps & import("../../common/lib/utils/position").PositionLogicalProps & import("../../common/lib/utils/space").SpaceStandardProps & import("../../common/lib/utils/space").SpaceLogicalProps & import("..").FlexStyleProps & StackStyleProps> & {
5
- Item: import("@workday/canvas-kit-react/common").ElementComponent<"div", import("../../common/lib/utils/border").BorderShorthandStyleProps & import("../../common/lib/utils/border").BorderColorStyleProps & import("../../common/lib/utils/border").BorderRadiusStyleProps & import("../../common/lib/utils/border").BorderLineStyleProps & import("../../common/lib/utils/border").BorderWidthStyleProps & import("../../common/lib/utils/border").BorderLogicalStyleProps & import("../../common").ColorStyleProps & import("../../common").DepthStyleProps & import("../../common").FlexItemStyleProps & import("../../common").LayoutStyleProps & import("../../common/lib/utils/other").OtherStyleProps & import("../../common/lib/utils/position").PositionStandardProps & import("../../common/lib/utils/position").PositionLogicalProps & import("../../common/lib/utils/space").SpaceStandardProps & import("../../common/lib/utils/space").SpaceLogicalProps>;
6
- };
7
- export interface HStackProps extends StackProps {
8
- /**
9
- * sets the direction for the stack
10
- * @default "row"
11
- * */
12
- flexDirection?: 'row' | 'row-reverse';
13
- }
14
- export declare const HStack: import("@workday/canvas-kit-react/common").ElementComponent<"div", HStackProps> & {
15
- Item: import("@workday/canvas-kit-react/common").ElementComponent<"div", import("../../common/lib/utils/border").BorderShorthandStyleProps & import("../../common/lib/utils/border").BorderColorStyleProps & import("../../common/lib/utils/border").BorderRadiusStyleProps & import("../../common/lib/utils/border").BorderLineStyleProps & import("../../common/lib/utils/border").BorderWidthStyleProps & import("../../common/lib/utils/border").BorderLogicalStyleProps & import("../../common").ColorStyleProps & import("../../common").DepthStyleProps & import("../../common").FlexItemStyleProps & import("../../common").LayoutStyleProps & import("../../common/lib/utils/other").OtherStyleProps & import("../../common/lib/utils/position").PositionStandardProps & import("../../common/lib/utils/position").PositionLogicalProps & import("../../common/lib/utils/space").SpaceStandardProps & import("../../common/lib/utils/space").SpaceLogicalProps>;
16
- };
17
- export interface VStackProps extends StackProps {
18
- /**
19
- * sets the direction for the stack
20
- * @default "column"
21
- * */
22
- flexDirection?: 'column' | 'column-reverse';
23
- }
24
- export declare const VStack: import("@workday/canvas-kit-react/common").ElementComponent<"div", VStackProps> & {
25
- Item: import("@workday/canvas-kit-react/common").ElementComponent<"div", import("../../common/lib/utils/border").BorderShorthandStyleProps & import("../../common/lib/utils/border").BorderColorStyleProps & import("../../common/lib/utils/border").BorderRadiusStyleProps & import("../../common/lib/utils/border").BorderLineStyleProps & import("../../common/lib/utils/border").BorderWidthStyleProps & import("../../common/lib/utils/border").BorderLogicalStyleProps & import("../../common").ColorStyleProps & import("../../common").DepthStyleProps & import("../../common").FlexItemStyleProps & import("../../common").LayoutStyleProps & import("../../common/lib/utils/other").OtherStyleProps & import("../../common/lib/utils/position").PositionStandardProps & import("../../common/lib/utils/position").PositionLogicalProps & import("../../common/lib/utils/space").SpaceStandardProps & import("../../common/lib/utils/space").SpaceLogicalProps>;
26
- };
27
- //# 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,oBAAY,UAAU,GAAG,SAAS,GAAG,eAAe,CAAC;AA2BrD,eAAO,MAAM,KAAK;;CAehB,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,74 +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 '@workday/canvas-kit-labs-react/common';
27
- import { Flex } from './Flex';
28
- import { getValidChildren } from './utils/getValidChildren';
29
- import { stack } from './utils/stack';
30
- var StackItem = createComponent('div')({
31
- displayName: 'Stack.Item',
32
- Component: function (_a, ref, Element) {
33
- var children = _a.children, elemProps = __rest(_a, ["children"]);
34
- return (React.createElement(Box, __assign({ as: Element, ref: ref, display: "inline-block", flex: "0 0 auto", minWidth: 0 }, elemProps), children));
35
- },
36
- });
37
- // prevent `spacing` prop from being passed through to the HTML element
38
- var shouldForwardProp = function (prop) {
39
- return prop !== 'spacing';
40
- };
41
- var StyledStack = styled(Flex, { shouldForwardProp: shouldForwardProp })(stack);
42
- export var Stack = createComponent('div')({
43
- displayName: 'Stack',
44
- Component: function (_a, ref, Element) {
45
- var children = _a.children, _b = _a.shouldWrapChildren, shouldWrapChildren = _b === void 0 ? false : _b, elemProps = __rest(_a, ["children", "shouldWrapChildren"]);
46
- var validChildren = getValidChildren(children);
47
- return (React.createElement(StyledStack, __assign({ as: Element, ref: ref, flexDirection: "row" }, elemProps), shouldWrapChildren
48
- ? validChildren.map(function (child) { return React.createElement(StackItem, null, child); })
49
- : validChildren));
50
- },
51
- subComponents: {
52
- Item: StackItem,
53
- },
54
- });
55
- export var HStack = createComponent('div')({
56
- displayName: 'HStack',
57
- Component: function (_a, ref, Element) {
58
- var children = _a.children, elemProps = __rest(_a, ["children"]);
59
- return (React.createElement(Stack, __assign({ as: Element, ref: ref, flexDirection: "row" }, elemProps), children));
60
- },
61
- subComponents: {
62
- Item: StackItem,
63
- },
64
- });
65
- export var VStack = createComponent('div')({
66
- displayName: 'VStack',
67
- Component: function (_a, ref, Element) {
68
- var children = _a.children, elemProps = __rest(_a, ["children"]);
69
- return (React.createElement(Stack, __assign({ as: Element, ref: ref, flexDirection: "column" }, elemProps), children));
70
- },
71
- subComponents: {
72
- Item: StackItem,
73
- },
74
- });
@@ -1,36 +0,0 @@
1
- import { PropertyAlignItems, PropertyAlignContent, PropertyJustifyItems, PropertyJustifyContent, PropertyFlexWrap, PropertyFlexDirection } from './types';
2
- /** style props to for flexbox container properties */
3
- export declare type FlexStyleProps = {
4
- /** sets `align-items` property */
5
- alignItems?: PropertyAlignItems;
6
- /** sets `align-content` property */
7
- alignContent?: PropertyAlignContent;
8
- /**
9
- * sets `display` property
10
- * @default 'flex'
11
- * */
12
- display?: 'flex' | 'inline-flex';
13
- /** sets `justify-items` property */
14
- justifyItems?: PropertyJustifyItems;
15
- /** sets `justify-content` property */
16
- justifyContent?: PropertyJustifyContent;
17
- /** sets `flex-wrap` property */
18
- flexWrap?: PropertyFlexWrap;
19
- /** sets `flex-direction` property */
20
- flexDirection?: PropertyFlexDirection;
21
- };
22
- /**
23
- * A style prop function that takes component props and returns flexbox styles.
24
- * If no `FlexStyleProps` are found, it returns an empty object.
25
- *
26
- * @example
27
- * // You'll most likely use `flex` with low-level, styled components
28
- * const FlexExample = () => (
29
- * <Flex justifyContent="center" alignItems="center">
30
- * Hello, flex!
31
- * </Flex>
32
- * );
33
- *
34
- */
35
- export declare function flex<P extends FlexStyleProps>(props: P): {};
36
- //# sourceMappingURL=flex.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"flex.d.ts","sourceRoot":"","sources":["../../../../../layout/lib/utils/flex.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,sBAAsB,EACtB,gBAAgB,EAChB,qBAAqB,EACtB,MAAM,SAAS,CAAC;AAEjB,sDAAsD;AACtD,oBAAY,cAAc,GAAG;IAC3B,kCAAkC;IAClC,UAAU,CAAC,EAAE,kBAAkB,CAAC;IAChC,oCAAoC;IACpC,YAAY,CAAC,EAAE,oBAAoB,CAAC;IACpC;;;SAGK;IACL,OAAO,CAAC,EAAE,MAAM,GAAG,aAAa,CAAC;IACjC,oCAAoC;IACpC,YAAY,CAAC,EAAE,oBAAoB,CAAC;IACpC,sCAAsC;IACtC,cAAc,CAAC,EAAE,sBAAsB,CAAC;IACxC,gCAAgC;IAChC,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B,qCAAqC;IACrC,aAAa,CAAC,EAAE,qBAAqB,CAAC;CACvC,CAAC;AAYF;;;;;;;;;;;;GAYG;AACH,wBAAgB,IAAI,CAAC,CAAC,SAAS,cAAc,EAAE,KAAK,EAAE,CAAC,MAWtD"}
@@ -1,34 +0,0 @@
1
- var flexProps = {
2
- alignContent: 'alignContent',
3
- alignItems: 'alignItems',
4
- display: 'display',
5
- flexDirection: 'flexDirection',
6
- flexWrap: 'flexWrap',
7
- justifyContent: 'justifyContent',
8
- justifyItems: 'justifyItems',
9
- };
10
- /**
11
- * A style prop function that takes component props and returns flexbox styles.
12
- * If no `FlexStyleProps` are found, it returns an empty object.
13
- *
14
- * @example
15
- * // You'll most likely use `flex` with low-level, styled components
16
- * const FlexExample = () => (
17
- * <Flex justifyContent="center" alignItems="center">
18
- * Hello, flex!
19
- * </Flex>
20
- * );
21
- *
22
- */
23
- export function flex(props) {
24
- var styles = {};
25
- for (var key in props) {
26
- if (key in flexProps) {
27
- var attr = flexProps[key];
28
- var value = props[key];
29
- // @ts-ignore TS doesn't like adding a potentially unknown key to an object, but because we own this object, it's fine.
30
- styles[attr] = value;
31
- }
32
- }
33
- return styles;
34
- }
@@ -1,3 +0,0 @@
1
- import * as React from 'react';
2
- export declare function getValidChildren(children: React.ReactNode): React.ReactElement<any, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)>[];
3
- //# sourceMappingURL=getValidChildren.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getValidChildren.d.ts","sourceRoot":"","sources":["../../../../../layout/lib/utils/getValidChildren.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,oJAIzD"}
@@ -1,6 +0,0 @@
1
- import * as React from 'react';
2
- export function getValidChildren(children) {
3
- return React.Children.toArray(children).filter(function (child) {
4
- return React.isValidElement(child);
5
- });
6
- }
@@ -1,26 +0,0 @@
1
- import { PartialEmotionCanvasTheme } from '@workday/canvas-kit-react/common';
2
- import { CanvasSpaceKeys } from '@workday/canvas-kit-react/tokens';
3
- export declare type StackDirection = 'row' | 'column' | 'row-reverse' | 'column-reverse';
4
- declare const selector = "& > *:not(style) ~ *:not(style)";
5
- export declare type StackSpacing = CanvasSpaceKeys | number | (string & {});
6
- export declare type StackStyleProps = {
7
- /** sets space values between child elements (bidirectional support) */
8
- spacing: StackSpacing;
9
- /**
10
- * sets the direction for the stack
11
- * @default "row"
12
- * */
13
- flexDirection?: StackDirection;
14
- /**
15
- * when `true` wraps each child element in a `Stack.Item`
16
- * @default false
17
- * */
18
- shouldWrapChildren?: boolean;
19
- };
20
- export declare function stack<P extends StackStyleProps & {
21
- theme?: PartialEmotionCanvasTheme;
22
- }>(props: P): {
23
- "& > *:not(style) ~ *:not(style)": {};
24
- };
25
- export {};
26
- //# sourceMappingURL=stack.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stack.d.ts","sourceRoot":"","sources":["../../../../../layout/lib/utils/stack.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,yBAAyB,EAE1B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAuB,eAAe,EAAC,MAAM,kCAAkC,CAAC;AAEvF,oBAAY,cAAc,GAAG,KAAK,GAAG,QAAQ,GAAG,aAAa,GAAG,gBAAgB,CAAC;AAEjF,QAAA,MAAM,QAAQ,oCAAoC,CAAC;AAEnD,oBAAY,YAAY,GAAG,eAAe,GAAG,MAAM,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAEpE,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;AA+BF,wBAAgB,KAAK,CAAC,CAAC,SAAS,eAAe,GAAG;IAAC,KAAK,CAAC,EAAE,yBAAyB,CAAA;CAAC,EAAE,KAAK,EAAE,CAAC;;EAoB9F"}
@@ -1,51 +0,0 @@
1
- import { ContentDirection, useTheme, } from '@workday/canvas-kit-react/common';
2
- import { space as spaceTokens } from '@workday/canvas-kit-react/tokens';
3
- var selector = '& > *:not(style) ~ *:not(style)';
4
- var column = function (value) { return ({
5
- marginTop: spaceTokens[value] || value,
6
- }); };
7
- var columnReverse = function (value) { return ({
8
- marginBottom: spaceTokens[value] || value,
9
- }); };
10
- var row = function (value, isRTL) {
11
- var _a;
12
- if (isRTL === void 0) { isRTL = false; }
13
- var attr = isRTL ? 'marginRight' : 'marginLeft';
14
- return _a = {},
15
- _a[attr] = spaceTokens[value] || value,
16
- _a;
17
- };
18
- var rowReverse = function (value, isRTL) {
19
- var _a;
20
- if (isRTL === void 0) { isRTL = false; }
21
- var attr = isRTL ? 'marginLeft' : 'marginRight';
22
- return _a = {},
23
- _a[attr] = spaceTokens[value] || value,
24
- _a;
25
- };
26
- var stackDirectionProps = {
27
- column: column,
28
- 'column-reverse': columnReverse,
29
- row: row,
30
- 'row-reverse': rowReverse,
31
- };
32
- export function stack(props) {
33
- var _a;
34
- var styles = {};
35
- var _b = props.flexDirection, flexDirection = _b === void 0 ? 'row' : _b, spacing = props.spacing;
36
- if (flexDirection === 'column' || flexDirection === 'column-reverse') {
37
- var stackFn = stackDirectionProps[flexDirection];
38
- styles = stackFn(spacing);
39
- }
40
- if (flexDirection === 'row' || flexDirection === 'row-reverse') {
41
- // stack will always be used within the context of a component, but eslint doesn't know that
42
- // eslint-disable-next-line react-hooks/rules-of-hooks
43
- var canvas = useTheme(props.theme).canvas;
44
- var stackFn = stackDirectionProps[flexDirection];
45
- var isRTL = canvas.direction === ContentDirection.RTL;
46
- styles = stackFn(spacing, isRTL);
47
- }
48
- return _a = {},
49
- _a[selector] = styles,
50
- _a;
51
- }
@@ -1,8 +0,0 @@
1
- import { Globals, SelfPosition, ContentDistribution, ContentPosition } from 'csstype';
2
- export declare type PropertyAlignItems = Globals | SelfPosition | 'baseline' | 'normal' | 'stretch' | (string & {});
3
- export declare type PropertyAlignContent = Globals | ContentDistribution | ContentPosition | 'baseline' | 'normal' | (string & {});
4
- export declare type PropertyJustifyItems = Globals | SelfPosition | 'baseline' | 'left' | 'legacy' | 'normal' | 'right' | 'stretch' | (string & {});
5
- export declare type PropertyJustifyContent = Globals | ContentDistribution | ContentPosition | 'left' | 'normal' | 'right' | (string & {});
6
- export declare type PropertyFlexWrap = Globals | 'nowrap' | 'wrap' | 'wrap-reverse';
7
- export declare type PropertyFlexDirection = Globals | 'column' | 'column-reverse' | 'row' | 'row-reverse';
8
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../layout/lib/utils/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,eAAe,EAAC,MAAM,SAAS,CAAC;AAMpF,oBAAY,kBAAkB,GAC1B,OAAO,GACP,YAAY,GACZ,UAAU,GACV,QAAQ,GACR,SAAS,GACT,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAElB,oBAAY,oBAAoB,GAC5B,OAAO,GACP,mBAAmB,GACnB,eAAe,GACf,UAAU,GACV,QAAQ,GACR,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAElB,oBAAY,oBAAoB,GAC5B,OAAO,GACP,YAAY,GACZ,UAAU,GACV,MAAM,GACN,QAAQ,GACR,QAAQ,GACR,OAAO,GACP,SAAS,GACT,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAElB,oBAAY,sBAAsB,GAC9B,OAAO,GACP,mBAAmB,GACnB,eAAe,GACf,MAAM,GACN,QAAQ,GACR,OAAO,GACP,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAElB,oBAAY,gBAAgB,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,cAAc,CAAC;AAE5E,oBAAY,qBAAqB,GAAG,OAAO,GAAG,QAAQ,GAAG,gBAAgB,GAAG,KAAK,GAAG,aAAa,CAAC"}
@@ -1 +0,0 @@
1
- export {};