@workday/canvas-kit-labs-react 7.0.0-alpha.0-next.6 → 7.0.0-alpha.79-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 (197) hide show
  1. package/combobox/README.md +1 -1
  2. package/combobox/lib/Combobox.tsx +7 -11
  3. package/common/index.ts +0 -8
  4. package/dist/commonjs/combobox/lib/Combobox.d.ts +3 -4
  5. package/dist/commonjs/combobox/lib/Combobox.d.ts.map +1 -1
  6. package/dist/commonjs/combobox/lib/Combobox.js +4 -7
  7. package/dist/commonjs/common/index.d.ts +0 -8
  8. package/dist/commonjs/common/index.d.ts.map +1 -1
  9. package/dist/commonjs/common/index.js +0 -1
  10. package/dist/commonjs/drawer/lib/DrawerHeader.js +2 -2
  11. package/dist/commonjs/index.d.ts +0 -1
  12. package/dist/commonjs/index.d.ts.map +1 -1
  13. package/dist/commonjs/index.js +0 -1
  14. package/dist/commonjs/search-form/lib/SearchForm.d.ts +7 -2
  15. package/dist/commonjs/search-form/lib/SearchForm.d.ts.map +1 -1
  16. package/dist/commonjs/search-form/lib/SearchForm.js +16 -22
  17. package/dist/es6/combobox/lib/Combobox.d.ts +3 -4
  18. package/dist/es6/combobox/lib/Combobox.d.ts.map +1 -1
  19. package/dist/es6/combobox/lib/Combobox.js +5 -8
  20. package/dist/es6/common/index.d.ts +0 -8
  21. package/dist/es6/common/index.d.ts.map +1 -1
  22. package/dist/es6/common/index.js +0 -1
  23. package/dist/es6/drawer/lib/DrawerHeader.js +3 -3
  24. package/dist/es6/index.d.ts +0 -1
  25. package/dist/es6/index.d.ts.map +1 -1
  26. package/dist/es6/index.js +0 -1
  27. package/dist/es6/search-form/lib/SearchForm.d.ts +7 -2
  28. package/dist/es6/search-form/lib/SearchForm.d.ts.map +1 -1
  29. package/dist/es6/search-form/lib/SearchForm.js +17 -23
  30. package/drawer/lib/DrawerHeader.tsx +3 -3
  31. package/index.ts +0 -1
  32. package/package.json +4 -6
  33. package/search-form/lib/SearchForm.tsx +25 -37
  34. package/ts3.5/dist/commonjs/combobox/lib/Combobox.d.ts +3 -4
  35. package/ts3.5/dist/commonjs/common/index.d.ts +0 -8
  36. package/ts3.5/dist/commonjs/index.d.ts +0 -1
  37. package/ts3.5/dist/commonjs/search-form/lib/SearchForm.d.ts +7 -2
  38. package/ts3.5/dist/es6/combobox/lib/Combobox.d.ts +3 -4
  39. package/ts3.5/dist/es6/common/index.d.ts +0 -8
  40. package/ts3.5/dist/es6/index.d.ts +0 -1
  41. package/ts3.5/dist/es6/search-form/lib/SearchForm.d.ts +7 -2
  42. package/common/lib/Box.tsx +0 -92
  43. package/common/lib/utils/border.ts +0 -263
  44. package/common/lib/utils/color.ts +0 -62
  45. package/common/lib/utils/depth.ts +0 -37
  46. package/common/lib/utils/flexItem.ts +0 -56
  47. package/common/lib/utils/layout.ts +0 -77
  48. package/common/lib/utils/other.ts +0 -20
  49. package/common/lib/utils/position.ts +0 -96
  50. package/common/lib/utils/space.ts +0 -207
  51. package/common/lib/utils/types.ts +0 -105
  52. package/dist/commonjs/common/lib/Box.d.ts +0 -31
  53. package/dist/commonjs/common/lib/Box.d.ts.map +0 -1
  54. package/dist/commonjs/common/lib/Box.js +0 -99
  55. package/dist/commonjs/common/lib/utils/border.d.ts +0 -103
  56. package/dist/commonjs/common/lib/utils/border.d.ts.map +0 -1
  57. package/dist/commonjs/common/lib/utils/border.js +0 -153
  58. package/dist/commonjs/common/lib/utils/color.d.ts +0 -26
  59. package/dist/commonjs/common/lib/utils/color.d.ts.map +0 -1
  60. package/dist/commonjs/common/lib/utils/color.js +0 -57
  61. package/dist/commonjs/common/lib/utils/depth.d.ts +0 -22
  62. package/dist/commonjs/common/lib/utils/depth.d.ts.map +0 -1
  63. package/dist/commonjs/common/lib/utils/depth.js +0 -29
  64. package/dist/commonjs/common/lib/utils/flexItem.d.ts +0 -33
  65. package/dist/commonjs/common/lib/utils/flexItem.d.ts.map +0 -1
  66. package/dist/commonjs/common/lib/utils/flexItem.js +0 -39
  67. package/dist/commonjs/common/lib/utils/layout.d.ts +0 -43
  68. package/dist/commonjs/common/lib/utils/layout.d.ts.map +0 -1
  69. package/dist/commonjs/common/lib/utils/layout.js +0 -43
  70. package/dist/commonjs/common/lib/utils/other.d.ts +0 -5
  71. package/dist/commonjs/common/lib/utils/other.d.ts.map +0 -1
  72. package/dist/commonjs/common/lib/utils/other.js +0 -19
  73. package/dist/commonjs/common/lib/utils/position.d.ts +0 -41
  74. package/dist/commonjs/common/lib/utils/position.d.ts.map +0 -1
  75. package/dist/commonjs/common/lib/utils/position.js +0 -78
  76. package/dist/commonjs/common/lib/utils/space.d.ts +0 -64
  77. package/dist/commonjs/common/lib/utils/space.d.ts.map +0 -1
  78. package/dist/commonjs/common/lib/utils/space.js +0 -161
  79. package/dist/commonjs/common/lib/utils/types.d.ts +0 -14
  80. package/dist/commonjs/common/lib/utils/types.d.ts.map +0 -1
  81. package/dist/commonjs/common/lib/utils/types.js +0 -2
  82. package/dist/commonjs/layout/index.d.ts +0 -5
  83. package/dist/commonjs/layout/index.d.ts.map +0 -1
  84. package/dist/commonjs/layout/index.js +0 -14
  85. package/dist/commonjs/layout/lib/Flex.d.ts +0 -26
  86. package/dist/commonjs/layout/lib/Flex.d.ts.map +0 -1
  87. package/dist/commonjs/layout/lib/Flex.js +0 -83
  88. package/dist/commonjs/layout/lib/Stack.d.ts +0 -27
  89. package/dist/commonjs/layout/lib/Stack.d.ts.map +0 -1
  90. package/dist/commonjs/layout/lib/Stack.js +0 -99
  91. package/dist/commonjs/layout/lib/utils/flex.d.ts +0 -36
  92. package/dist/commonjs/layout/lib/utils/flex.d.ts.map +0 -1
  93. package/dist/commonjs/layout/lib/utils/flex.js +0 -38
  94. package/dist/commonjs/layout/lib/utils/getValidChildren.d.ts +0 -3
  95. package/dist/commonjs/layout/lib/utils/getValidChildren.d.ts.map +0 -1
  96. package/dist/commonjs/layout/lib/utils/getValidChildren.js +0 -29
  97. package/dist/commonjs/layout/lib/utils/stack.d.ts +0 -26
  98. package/dist/commonjs/layout/lib/utils/stack.d.ts.map +0 -1
  99. package/dist/commonjs/layout/lib/utils/stack.js +0 -55
  100. package/dist/commonjs/layout/lib/utils/types.d.ts +0 -8
  101. package/dist/commonjs/layout/lib/utils/types.d.ts.map +0 -1
  102. package/dist/commonjs/layout/lib/utils/types.js +0 -2
  103. package/dist/es6/common/lib/Box.d.ts +0 -31
  104. package/dist/es6/common/lib/Box.d.ts.map +0 -1
  105. package/dist/es6/common/lib/Box.js +0 -74
  106. package/dist/es6/common/lib/utils/border.d.ts +0 -103
  107. package/dist/es6/common/lib/utils/border.d.ts.map +0 -1
  108. package/dist/es6/common/lib/utils/border.js +0 -149
  109. package/dist/es6/common/lib/utils/color.d.ts +0 -26
  110. package/dist/es6/common/lib/utils/color.d.ts.map +0 -1
  111. package/dist/es6/common/lib/utils/color.js +0 -53
  112. package/dist/es6/common/lib/utils/depth.d.ts +0 -22
  113. package/dist/es6/common/lib/utils/depth.d.ts.map +0 -1
  114. package/dist/es6/common/lib/utils/depth.js +0 -25
  115. package/dist/es6/common/lib/utils/flexItem.d.ts +0 -33
  116. package/dist/es6/common/lib/utils/flexItem.d.ts.map +0 -1
  117. package/dist/es6/common/lib/utils/flexItem.js +0 -35
  118. package/dist/es6/common/lib/utils/layout.d.ts +0 -43
  119. package/dist/es6/common/lib/utils/layout.d.ts.map +0 -1
  120. package/dist/es6/common/lib/utils/layout.js +0 -39
  121. package/dist/es6/common/lib/utils/other.d.ts +0 -5
  122. package/dist/es6/common/lib/utils/other.d.ts.map +0 -1
  123. package/dist/es6/common/lib/utils/other.js +0 -15
  124. package/dist/es6/common/lib/utils/position.d.ts +0 -41
  125. package/dist/es6/common/lib/utils/position.d.ts.map +0 -1
  126. package/dist/es6/common/lib/utils/position.js +0 -74
  127. package/dist/es6/common/lib/utils/space.d.ts +0 -64
  128. package/dist/es6/common/lib/utils/space.d.ts.map +0 -1
  129. package/dist/es6/common/lib/utils/space.js +0 -157
  130. package/dist/es6/common/lib/utils/types.d.ts +0 -14
  131. package/dist/es6/common/lib/utils/types.d.ts.map +0 -1
  132. package/dist/es6/common/lib/utils/types.js +0 -1
  133. package/dist/es6/layout/index.d.ts +0 -5
  134. package/dist/es6/layout/index.d.ts.map +0 -1
  135. package/dist/es6/layout/index.js +0 -2
  136. package/dist/es6/layout/lib/Flex.d.ts +0 -26
  137. package/dist/es6/layout/lib/Flex.d.ts.map +0 -1
  138. package/dist/es6/layout/lib/Flex.js +0 -58
  139. package/dist/es6/layout/lib/Stack.d.ts +0 -27
  140. package/dist/es6/layout/lib/Stack.d.ts.map +0 -1
  141. package/dist/es6/layout/lib/Stack.js +0 -74
  142. package/dist/es6/layout/lib/utils/flex.d.ts +0 -36
  143. package/dist/es6/layout/lib/utils/flex.d.ts.map +0 -1
  144. package/dist/es6/layout/lib/utils/flex.js +0 -34
  145. package/dist/es6/layout/lib/utils/getValidChildren.d.ts +0 -3
  146. package/dist/es6/layout/lib/utils/getValidChildren.d.ts.map +0 -1
  147. package/dist/es6/layout/lib/utils/getValidChildren.js +0 -6
  148. package/dist/es6/layout/lib/utils/stack.d.ts +0 -26
  149. package/dist/es6/layout/lib/utils/stack.d.ts.map +0 -1
  150. package/dist/es6/layout/lib/utils/stack.js +0 -51
  151. package/dist/es6/layout/lib/utils/types.d.ts +0 -8
  152. package/dist/es6/layout/lib/utils/types.d.ts.map +0 -1
  153. package/dist/es6/layout/lib/utils/types.js +0 -1
  154. package/layout/LICENSE +0 -52
  155. package/layout/README.md +0 -16
  156. package/layout/index.ts +0 -4
  157. package/layout/lib/Flex.tsx +0 -47
  158. package/layout/lib/Stack.tsx +0 -95
  159. package/layout/lib/utils/flex.ts +0 -65
  160. package/layout/lib/utils/getValidChildren.ts +0 -7
  161. package/layout/lib/utils/stack.ts +0 -78
  162. package/layout/lib/utils/types.ts +0 -45
  163. package/layout/package.json +0 -5
  164. package/ts3.5/dist/commonjs/common/lib/Box.d.ts +0 -31
  165. package/ts3.5/dist/commonjs/common/lib/utils/border.d.ts +0 -103
  166. package/ts3.5/dist/commonjs/common/lib/utils/color.d.ts +0 -26
  167. package/ts3.5/dist/commonjs/common/lib/utils/depth.d.ts +0 -22
  168. package/ts3.5/dist/commonjs/common/lib/utils/flexItem.d.ts +0 -33
  169. package/ts3.5/dist/commonjs/common/lib/utils/layout.d.ts +0 -43
  170. package/ts3.5/dist/commonjs/common/lib/utils/other.d.ts +0 -5
  171. package/ts3.5/dist/commonjs/common/lib/utils/position.d.ts +0 -41
  172. package/ts3.5/dist/commonjs/common/lib/utils/space.d.ts +0 -64
  173. package/ts3.5/dist/commonjs/common/lib/utils/types.d.ts +0 -14
  174. package/ts3.5/dist/commonjs/layout/index.d.ts +0 -5
  175. package/ts3.5/dist/commonjs/layout/lib/Flex.d.ts +0 -26
  176. package/ts3.5/dist/commonjs/layout/lib/Stack.d.ts +0 -27
  177. package/ts3.5/dist/commonjs/layout/lib/utils/flex.d.ts +0 -36
  178. package/ts3.5/dist/commonjs/layout/lib/utils/getValidChildren.d.ts +0 -3
  179. package/ts3.5/dist/commonjs/layout/lib/utils/stack.d.ts +0 -26
  180. package/ts3.5/dist/commonjs/layout/lib/utils/types.d.ts +0 -8
  181. package/ts3.5/dist/es6/common/lib/Box.d.ts +0 -31
  182. package/ts3.5/dist/es6/common/lib/utils/border.d.ts +0 -103
  183. package/ts3.5/dist/es6/common/lib/utils/color.d.ts +0 -26
  184. package/ts3.5/dist/es6/common/lib/utils/depth.d.ts +0 -22
  185. package/ts3.5/dist/es6/common/lib/utils/flexItem.d.ts +0 -33
  186. package/ts3.5/dist/es6/common/lib/utils/layout.d.ts +0 -43
  187. package/ts3.5/dist/es6/common/lib/utils/other.d.ts +0 -5
  188. package/ts3.5/dist/es6/common/lib/utils/position.d.ts +0 -41
  189. package/ts3.5/dist/es6/common/lib/utils/space.d.ts +0 -64
  190. package/ts3.5/dist/es6/common/lib/utils/types.d.ts +0 -14
  191. package/ts3.5/dist/es6/layout/index.d.ts +0 -5
  192. package/ts3.5/dist/es6/layout/lib/Flex.d.ts +0 -26
  193. package/ts3.5/dist/es6/layout/lib/Stack.d.ts +0 -27
  194. package/ts3.5/dist/es6/layout/lib/utils/flex.d.ts +0 -36
  195. package/ts3.5/dist/es6/layout/lib/utils/getValidChildren.d.ts +0 -3
  196. package/ts3.5/dist/es6/layout/lib/utils/stack.d.ts +0 -26
  197. package/ts3.5/dist/es6/layout/lib/utils/types.d.ts +0 -8
@@ -1,64 +0,0 @@
1
- import { PartialEmotionCanvasTheme } from '@workday/canvas-kit-react/common';
2
- import { CanvasSpaceKeys } from '@workday/canvas-kit-react/tokens';
3
- declare type SpacePropValues = CanvasSpaceKeys | number | (string & {});
4
- /** These props automatically adjust for bidirectionality (LTR & RTL) */
5
- export declare type SpaceLogicalProps = {
6
- /** sets margin-left property (bidirectional support) */
7
- marginInlineStart?: SpacePropValues;
8
- /** sets margin-right property (bidirectional support) */
9
- marginInlineEnd?: SpacePropValues;
10
- /** sets padding-left property (bidirectional support) */
11
- paddingInlineStart?: SpacePropValues;
12
- /** sets padding-right property (bidirectional support) */
13
- paddingInlineEnd?: SpacePropValues;
14
- };
15
- /** These props do not adjust for bidirectionality (LTR & RTL) */
16
- export declare type SpaceStandardProps = {
17
- /** sets margin property */
18
- margin?: SpacePropValues;
19
- /** sets margin-left and margin-right properties */
20
- marginX?: SpacePropValues;
21
- /** sets margin-top and margin-bottom properties */
22
- marginY?: SpacePropValues;
23
- /** sets margin-top property */
24
- marginTop?: SpacePropValues;
25
- /** sets margin-right property (no bidirectional support) */
26
- marginRight?: SpacePropValues;
27
- /** sets margin-bottom property */
28
- marginBottom?: SpacePropValues;
29
- /** sets margin-left property (no bidirectional support) */
30
- marginLeft?: SpacePropValues;
31
- /** sets padding property */
32
- padding?: SpacePropValues;
33
- /** sets padding-left and margin-right properties */
34
- paddingX?: SpacePropValues;
35
- /** sets padding-top and padding-bottom properties */
36
- paddingY?: SpacePropValues;
37
- /** sets padding-top property */
38
- paddingTop?: SpacePropValues;
39
- /** sets padding-right property (no bidirectional support) */
40
- paddingRight?: SpacePropValues;
41
- /** sets padding-bottom */
42
- paddingBottom?: SpacePropValues;
43
- /** sets padding-left property (no bidirectional support) */
44
- paddingLeft?: SpacePropValues;
45
- };
46
- export declare type SpaceStyleProps = SpaceStandardProps & SpaceLogicalProps;
47
- /**
48
- * A style prop function that takes component props and returns space styles.
49
- * If no `SpaceStyleProps` are found, it returns an empty object.
50
- *
51
- * @example
52
- * // You'll most likely use `space` with low-level, styled components
53
- * const BoxExample = () => (
54
- * <Box padding="xs" margin="m">
55
- * Hello, space!
56
- * </Box>
57
- * );
58
- *
59
- */
60
- export declare function space<P extends SpaceStyleProps & {
61
- theme?: PartialEmotionCanvasTheme;
62
- }>(props: P): {};
63
- export {};
64
- //# sourceMappingURL=space.d.ts.map
@@ -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,161 +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
- Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.space = void 0;
15
- var common_1 = require("@workday/canvas-kit-react/common");
16
- var tokens_1 = require("@workday/canvas-kit-react/tokens");
17
- var margin = function (value) {
18
- return { margin: tokens_1.space[value] || value };
19
- };
20
- var marginX = function (value) {
21
- return {
22
- marginLeft: tokens_1.space[value] || value,
23
- marginRight: tokens_1.space[value] || value,
24
- };
25
- };
26
- var marginY = function (value) {
27
- return {
28
- marginTop: tokens_1.space[value] || value,
29
- marginBottom: tokens_1.space[value] || value,
30
- };
31
- };
32
- var marginTop = function (value) {
33
- return {
34
- marginTop: tokens_1.space[value] || value,
35
- };
36
- };
37
- var marginRight = function (value, isRTL) {
38
- var _a;
39
- if (isRTL === void 0) { isRTL = false; }
40
- var attr = isRTL ? 'marginLeft' : 'marginRight';
41
- return _a = {},
42
- _a[attr] = tokens_1.space[value] || value,
43
- _a;
44
- };
45
- var marginBottom = function (value) {
46
- return {
47
- marginBottom: tokens_1.space[value] || value,
48
- };
49
- };
50
- var marginLeft = function (value, isRTL) {
51
- var _a;
52
- if (isRTL === void 0) { isRTL = false; }
53
- var attr = isRTL ? 'marginRight' : 'marginLeft';
54
- return _a = {},
55
- _a[attr] = tokens_1.space[value] || value,
56
- _a;
57
- };
58
- var padding = function (value) {
59
- return {
60
- padding: tokens_1.space[value] || value,
61
- };
62
- };
63
- var paddingX = function (value) {
64
- return {
65
- paddingLeft: tokens_1.space[value] || value,
66
- paddingRight: tokens_1.space[value] || value,
67
- };
68
- };
69
- var paddingY = function (value) {
70
- return {
71
- paddingTop: tokens_1.space[value] || value,
72
- paddingBottom: tokens_1.space[value] || value,
73
- };
74
- };
75
- var paddingTop = function (value) {
76
- return {
77
- paddingTop: tokens_1.space[value] || value,
78
- };
79
- };
80
- var paddingRight = function (value, isRTL) {
81
- var _a;
82
- if (isRTL === void 0) { isRTL = false; }
83
- var attr = isRTL ? 'paddingLeft' : 'paddingRight';
84
- return _a = {},
85
- _a[attr] = tokens_1.space[value] || value,
86
- _a;
87
- };
88
- var paddingBottom = function (value) {
89
- return {
90
- paddingBottom: tokens_1.space[value] || value,
91
- };
92
- };
93
- var paddingLeft = function (value, isRTL) {
94
- var _a;
95
- if (isRTL === void 0) { isRTL = false; }
96
- var attr = isRTL ? 'paddingRight' : 'paddingLeft';
97
- return _a = {},
98
- _a[attr] = tokens_1.space[value] || value,
99
- _a;
100
- };
101
- var logicalSpaceStyleProps = {
102
- marginInlineStart: marginLeft,
103
- marginInlineEnd: marginRight,
104
- paddingInlineStart: paddingLeft,
105
- paddingInlineEnd: paddingRight,
106
- };
107
- var standardSpaceStyleProps = {
108
- margin: margin,
109
- marginX: marginX,
110
- marginY: marginY,
111
- marginTop: marginTop,
112
- marginRight: marginRight,
113
- marginBottom: marginBottom,
114
- marginLeft: marginLeft,
115
- padding: padding,
116
- paddingX: paddingX,
117
- paddingY: paddingY,
118
- paddingTop: paddingTop,
119
- paddingRight: paddingRight,
120
- paddingBottom: paddingBottom,
121
- paddingLeft: paddingLeft,
122
- };
123
- /**
124
- * A style prop function that takes component props and returns space styles.
125
- * If no `SpaceStyleProps` are found, it returns an empty object.
126
- *
127
- * @example
128
- * // You'll most likely use `space` with low-level, styled components
129
- * const BoxExample = () => (
130
- * <Box padding="xs" margin="m">
131
- * Hello, space!
132
- * </Box>
133
- * );
134
- *
135
- */
136
- function space(props) {
137
- // space will always be used within the context of a component, but eslint doesn't know that
138
- // eslint-disable-next-line react-hooks/rules-of-hooks
139
- var canvas = common_1.useTheme(props.theme).canvas;
140
- var styles = {};
141
- for (var key in props) {
142
- if (props.hasOwnProperty(key)) {
143
- if (key in standardSpaceStyleProps) {
144
- var value = props[key];
145
- var spaceFn = standardSpaceStyleProps[key];
146
- var style = spaceFn(value);
147
- styles = __assign(__assign({}, styles), style);
148
- continue;
149
- }
150
- if (key in logicalSpaceStyleProps) {
151
- var value = props[key];
152
- var spaceFn = logicalSpaceStyleProps[key];
153
- var isRTL = canvas.direction === common_1.ContentDirection.RTL;
154
- var style = spaceFn(value, isRTL);
155
- styles = __assign(__assign({}, styles), style);
156
- }
157
- }
158
- }
159
- return styles;
160
- }
161
- exports.space = space;
@@ -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,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -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,14 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
- };
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- __exportStar(require("./lib/Flex"), exports);
14
- __exportStar(require("./lib/Stack"), exports);
@@ -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,83 +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.Flex = 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 common_2 = require("@workday/canvas-kit-labs-react/common");
52
- var flex_1 = require("./utils/flex");
53
- var StyledFlex = styled_1.default(common_2.Box)({
54
- display: 'flex',
55
- }, flex_1.flex);
56
- /**
57
- * `Flex` is a low-level layout component that provides a common, ergonomic API for applying CSS flexbox styles.
58
- * It is highly flexible, and can be used on its own or to build other components.
59
- * `Flex` is built on top of `Box` and has access to all `BoxProps`.
60
- *
61
- * @example
62
- * import { Flex, FlexProps } from '@workday/canvas-kit-labs-react/layout';
63
- *
64
- * interface CardProps extends FlexProps {
65
- * // card-specific props
66
- * }
67
- *
68
- * // `Card`'s default values are set using `FlexProps`
69
- * const Card = (props: CardProps) => (
70
- * <Flex flexDirection="column" alignItems="flex-start" depth={2} space="m" {...props}>
71
- * <h1>Hello, Card!</h1>
72
- * <p>This card uses flexbox to set its layout.</p>
73
- * </Flex>
74
- * );
75
- *
76
- */
77
- exports.Flex = common_1.createComponent('div')({
78
- displayName: 'Flex',
79
- Component: function (_a, ref, Element) {
80
- var children = _a.children, elemProps = __rest(_a, ["children"]);
81
- return (React.createElement(StyledFlex, __assign({ as: Element, ref: ref }, elemProps), children));
82
- },
83
- });
@@ -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,99 +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 common_2 = require("@workday/canvas-kit-labs-react/common");
52
- var Flex_1 = require("./Flex");
53
- var getValidChildren_1 = require("./utils/getValidChildren");
54
- var stack_1 = require("./utils/stack");
55
- var StackItem = common_1.createComponent('div')({
56
- displayName: 'Stack.Item',
57
- Component: function (_a, ref, Element) {
58
- var children = _a.children, elemProps = __rest(_a, ["children"]);
59
- return (React.createElement(common_2.Box, __assign({ as: Element, ref: ref, display: "inline-block", flex: "0 0 auto", minWidth: 0 }, elemProps), children));
60
- },
61
- });
62
- // prevent `spacing` prop from being passed through to the HTML element
63
- var shouldForwardProp = function (prop) {
64
- return prop !== 'spacing';
65
- };
66
- var StyledStack = styled_1.default(Flex_1.Flex, { shouldForwardProp: shouldForwardProp })(stack_1.stack);
67
- exports.Stack = common_1.createComponent('div')({
68
- displayName: 'Stack',
69
- Component: function (_a, ref, Element) {
70
- var children = _a.children, _b = _a.shouldWrapChildren, shouldWrapChildren = _b === void 0 ? false : _b, elemProps = __rest(_a, ["children", "shouldWrapChildren"]);
71
- var validChildren = getValidChildren_1.getValidChildren(children);
72
- return (React.createElement(StyledStack, __assign({ as: Element, ref: ref, flexDirection: "row" }, elemProps), shouldWrapChildren
73
- ? validChildren.map(function (child) { return React.createElement(StackItem, null, child); })
74
- : validChildren));
75
- },
76
- subComponents: {
77
- Item: StackItem,
78
- },
79
- });
80
- exports.HStack = common_1.createComponent('div')({
81
- displayName: 'HStack',
82
- Component: function (_a, ref, Element) {
83
- var children = _a.children, elemProps = __rest(_a, ["children"]);
84
- return (React.createElement(exports.Stack, __assign({ as: Element, ref: ref, flexDirection: "row" }, elemProps), children));
85
- },
86
- subComponents: {
87
- Item: StackItem,
88
- },
89
- });
90
- exports.VStack = common_1.createComponent('div')({
91
- displayName: 'VStack',
92
- Component: function (_a, ref, Element) {
93
- var children = _a.children, elemProps = __rest(_a, ["children"]);
94
- return (React.createElement(exports.Stack, __assign({ as: Element, ref: ref, flexDirection: "column" }, elemProps), children));
95
- },
96
- subComponents: {
97
- Item: StackItem,
98
- },
99
- });
@@ -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,38 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.flex = void 0;
4
- var flexProps = {
5
- alignContent: 'alignContent',
6
- alignItems: 'alignItems',
7
- display: 'display',
8
- flexDirection: 'flexDirection',
9
- flexWrap: 'flexWrap',
10
- justifyContent: 'justifyContent',
11
- justifyItems: 'justifyItems',
12
- };
13
- /**
14
- * A style prop function that takes component props and returns flexbox styles.
15
- * If no `FlexStyleProps` are found, it returns an empty object.
16
- *
17
- * @example
18
- * // You'll most likely use `flex` with low-level, styled components
19
- * const FlexExample = () => (
20
- * <Flex justifyContent="center" alignItems="center">
21
- * Hello, flex!
22
- * </Flex>
23
- * );
24
- *
25
- */
26
- function flex(props) {
27
- var styles = {};
28
- for (var key in props) {
29
- if (key in flexProps) {
30
- var attr = flexProps[key];
31
- var value = props[key];
32
- // @ts-ignore TS doesn't like adding a potentially unknown key to an object, but because we own this object, it's fine.
33
- styles[attr] = value;
34
- }
35
- }
36
- return styles;
37
- }
38
- exports.flex = flex;
@@ -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"}