@workday/canvas-kit-react 8.0.0-alpha.204-next.4 → 8.0.0-alpha.216-next.4

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 (230) hide show
  1. package/common/lib/utils/elements.ts +4 -4
  2. package/dist/commonjs/card/lib/Card.d.ts +1 -1
  3. package/dist/commonjs/card/lib/CardBody.d.ts +1 -1
  4. package/dist/commonjs/card/lib/CardBody.d.ts.map +1 -1
  5. package/dist/commonjs/common/lib/utils/elements.d.ts +1 -1
  6. package/dist/commonjs/common/lib/utils/elements.d.ts.map +1 -1
  7. package/dist/commonjs/common/lib/utils/elements.js +3 -3
  8. package/dist/commonjs/dialog/lib/Dialog.d.ts +1 -1
  9. package/dist/commonjs/icon/lib/SystemIcon.d.ts +1 -1
  10. package/dist/commonjs/icon/lib/SystemIcon.d.ts.map +1 -1
  11. package/dist/commonjs/layout/index.d.ts +8 -4
  12. package/dist/commonjs/layout/index.d.ts.map +1 -1
  13. package/dist/commonjs/layout/index.js +10 -2
  14. package/dist/commonjs/layout/lib/Box.d.ts +6 -4
  15. package/dist/commonjs/layout/lib/Box.d.ts.map +1 -1
  16. package/dist/commonjs/layout/lib/Box.js +8 -9
  17. package/dist/commonjs/layout/lib/Flex.d.ts +5 -2
  18. package/dist/commonjs/layout/lib/Flex.d.ts.map +1 -1
  19. package/dist/commonjs/layout/lib/Flex.js +5 -1
  20. package/dist/commonjs/layout/lib/Grid.d.ts +5 -6
  21. package/dist/commonjs/layout/lib/Grid.d.ts.map +1 -1
  22. package/dist/commonjs/layout/lib/Grid.js +2 -2
  23. package/dist/commonjs/layout/lib/Stack.d.ts +4 -4
  24. package/dist/commonjs/layout/lib/utils/background.d.ts +44 -0
  25. package/dist/commonjs/layout/lib/utils/background.d.ts.map +1 -0
  26. package/dist/commonjs/layout/lib/utils/background.js +57 -0
  27. package/dist/commonjs/layout/lib/utils/border/color.d.ts +47 -0
  28. package/dist/commonjs/layout/lib/utils/border/color.d.ts.map +1 -0
  29. package/dist/commonjs/layout/lib/utils/border/color.js +42 -0
  30. package/dist/commonjs/layout/lib/utils/border/index.d.ts +26 -0
  31. package/dist/commonjs/layout/lib/utils/border/index.d.ts.map +1 -0
  32. package/dist/commonjs/layout/lib/utils/border/index.js +46 -0
  33. package/dist/commonjs/layout/lib/utils/border/lineStyle.d.ts +38 -0
  34. package/dist/commonjs/layout/lib/utils/border/lineStyle.d.ts.map +1 -0
  35. package/dist/commonjs/layout/lib/utils/border/lineStyle.js +52 -0
  36. package/dist/commonjs/layout/lib/utils/border/radius.d.ts +33 -0
  37. package/dist/commonjs/layout/lib/utils/border/radius.d.ts.map +1 -0
  38. package/dist/commonjs/layout/lib/utils/border/radius.js +32 -0
  39. package/dist/commonjs/layout/lib/utils/border/shorthand.d.ts +34 -0
  40. package/dist/commonjs/layout/lib/utils/border/shorthand.d.ts.map +1 -0
  41. package/dist/commonjs/layout/lib/utils/border/shorthand.js +42 -0
  42. package/dist/commonjs/layout/lib/utils/border/width.d.ts +34 -0
  43. package/dist/commonjs/layout/lib/utils/border/width.d.ts.map +1 -0
  44. package/dist/commonjs/layout/lib/utils/border/width.js +42 -0
  45. package/dist/commonjs/layout/lib/utils/buildStyleFns.d.ts +12 -0
  46. package/dist/commonjs/layout/lib/utils/buildStyleFns.d.ts.map +1 -0
  47. package/dist/commonjs/layout/lib/utils/buildStyleFns.js +90 -0
  48. package/dist/commonjs/layout/lib/utils/color.d.ts +23 -16
  49. package/dist/commonjs/layout/lib/utils/color.d.ts.map +1 -1
  50. package/dist/commonjs/layout/lib/utils/color.js +25 -49
  51. package/dist/commonjs/layout/lib/utils/depth.d.ts +17 -11
  52. package/dist/commonjs/layout/lib/utils/depth.d.ts.map +1 -1
  53. package/dist/commonjs/layout/lib/utils/depth.js +20 -20
  54. package/dist/commonjs/layout/lib/utils/flex.d.ts +31 -12
  55. package/dist/commonjs/layout/lib/utils/flex.d.ts.map +1 -1
  56. package/dist/commonjs/layout/lib/utils/flex.js +58 -25
  57. package/dist/commonjs/layout/lib/utils/flexItem.d.ts +18 -15
  58. package/dist/commonjs/layout/lib/utils/flexItem.d.ts.map +1 -1
  59. package/dist/commonjs/layout/lib/utils/flexItem.js +43 -26
  60. package/dist/commonjs/layout/lib/utils/grid.d.ts +40 -35
  61. package/dist/commonjs/layout/lib/utils/grid.d.ts.map +1 -1
  62. package/dist/commonjs/layout/lib/utils/grid.js +99 -72
  63. package/dist/commonjs/layout/lib/utils/gridItem.d.ts +17 -14
  64. package/dist/commonjs/layout/lib/utils/gridItem.d.ts.map +1 -1
  65. package/dist/commonjs/layout/lib/utils/gridItem.js +58 -30
  66. package/dist/commonjs/layout/lib/utils/layout.d.ts +47 -25
  67. package/dist/commonjs/layout/lib/utils/layout.d.ts.map +1 -1
  68. package/dist/commonjs/layout/lib/utils/layout.js +71 -33
  69. package/dist/commonjs/layout/lib/utils/other.d.ts +44 -2
  70. package/dist/commonjs/layout/lib/utils/other.d.ts.map +1 -1
  71. package/dist/commonjs/layout/lib/utils/other.js +101 -17
  72. package/dist/commonjs/layout/lib/utils/position.d.ts +37 -20
  73. package/dist/commonjs/layout/lib/utils/position.d.ts.map +1 -1
  74. package/dist/commonjs/layout/lib/utils/position.js +49 -66
  75. package/dist/commonjs/layout/lib/utils/space.d.ts +107 -51
  76. package/dist/commonjs/layout/lib/utils/space.d.ts.map +1 -1
  77. package/dist/commonjs/layout/lib/utils/space.js +98 -148
  78. package/dist/commonjs/layout/lib/utils/stack.d.ts +3 -6
  79. package/dist/commonjs/layout/lib/utils/stack.d.ts.map +1 -1
  80. package/dist/commonjs/layout/lib/utils/stack.js +13 -39
  81. package/dist/commonjs/layout/lib/utils/systemProps.d.ts +31 -0
  82. package/dist/commonjs/layout/lib/utils/systemProps.d.ts.map +1 -0
  83. package/dist/commonjs/layout/lib/utils/systemProps.js +2 -0
  84. package/dist/commonjs/layout/lib/utils/text.d.ts +33 -15
  85. package/dist/commonjs/layout/lib/utils/text.d.ts.map +1 -1
  86. package/dist/commonjs/layout/lib/utils/text.js +74 -38
  87. package/dist/commonjs/modal/lib/Modal.d.ts +1 -1
  88. package/dist/commonjs/popup/lib/Popup.d.ts +1 -1
  89. package/dist/commonjs/popup/lib/PopupBody.d.ts +1 -1
  90. package/dist/commonjs/popup/lib/hooks/useReturnFocus.d.ts.map +1 -1
  91. package/dist/commonjs/popup/lib/hooks/useReturnFocus.js +102 -2
  92. package/dist/commonjs/tabs/lib/TabsItem.d.ts +1 -1
  93. package/dist/commonjs/tokens/lib/colors.types.d.ts +4 -6
  94. package/dist/commonjs/tokens/lib/colors.types.d.ts.map +1 -1
  95. package/dist/es6/card/lib/Card.d.ts +1 -1
  96. package/dist/es6/card/lib/CardBody.d.ts +1 -1
  97. package/dist/es6/card/lib/CardBody.d.ts.map +1 -1
  98. package/dist/es6/common/lib/utils/elements.d.ts +1 -1
  99. package/dist/es6/common/lib/utils/elements.d.ts.map +1 -1
  100. package/dist/es6/common/lib/utils/elements.js +3 -3
  101. package/dist/es6/dialog/lib/Dialog.d.ts +1 -1
  102. package/dist/es6/icon/lib/SystemIcon.d.ts +1 -1
  103. package/dist/es6/icon/lib/SystemIcon.d.ts.map +1 -1
  104. package/dist/es6/layout/index.d.ts +8 -4
  105. package/dist/es6/layout/index.d.ts.map +1 -1
  106. package/dist/es6/layout/index.js +7 -1
  107. package/dist/es6/layout/lib/Box.d.ts +6 -4
  108. package/dist/es6/layout/lib/Box.d.ts.map +1 -1
  109. package/dist/es6/layout/lib/Box.js +8 -9
  110. package/dist/es6/layout/lib/Flex.d.ts +5 -2
  111. package/dist/es6/layout/lib/Flex.d.ts.map +1 -1
  112. package/dist/es6/layout/lib/Flex.js +5 -1
  113. package/dist/es6/layout/lib/Grid.d.ts +5 -6
  114. package/dist/es6/layout/lib/Grid.d.ts.map +1 -1
  115. package/dist/es6/layout/lib/Grid.js +2 -2
  116. package/dist/es6/layout/lib/Stack.d.ts +4 -4
  117. package/dist/es6/layout/lib/utils/background.d.ts +44 -0
  118. package/dist/es6/layout/lib/utils/background.d.ts.map +1 -0
  119. package/dist/es6/layout/lib/utils/background.js +54 -0
  120. package/dist/es6/layout/lib/utils/border/color.d.ts +47 -0
  121. package/dist/es6/layout/lib/utils/border/color.d.ts.map +1 -0
  122. package/dist/es6/layout/lib/utils/border/color.js +39 -0
  123. package/dist/es6/layout/lib/utils/border/index.d.ts +26 -0
  124. package/dist/es6/layout/lib/utils/border/index.d.ts.map +1 -0
  125. package/dist/es6/layout/lib/utils/border/index.js +43 -0
  126. package/dist/es6/layout/lib/utils/border/lineStyle.d.ts +38 -0
  127. package/dist/es6/layout/lib/utils/border/lineStyle.d.ts.map +1 -0
  128. package/dist/es6/layout/lib/utils/border/lineStyle.js +49 -0
  129. package/dist/es6/layout/lib/utils/border/radius.d.ts +33 -0
  130. package/dist/es6/layout/lib/utils/border/radius.d.ts.map +1 -0
  131. package/dist/es6/layout/lib/utils/border/radius.js +29 -0
  132. package/dist/es6/layout/lib/utils/border/shorthand.d.ts +34 -0
  133. package/dist/es6/layout/lib/utils/border/shorthand.d.ts.map +1 -0
  134. package/dist/es6/layout/lib/utils/border/shorthand.js +39 -0
  135. package/dist/es6/layout/lib/utils/border/width.d.ts +34 -0
  136. package/dist/es6/layout/lib/utils/border/width.d.ts.map +1 -0
  137. package/dist/es6/layout/lib/utils/border/width.js +39 -0
  138. package/dist/es6/layout/lib/utils/buildStyleFns.d.ts +12 -0
  139. package/dist/es6/layout/lib/utils/buildStyleFns.d.ts.map +1 -0
  140. package/dist/es6/layout/lib/utils/buildStyleFns.js +85 -0
  141. package/dist/es6/layout/lib/utils/color.d.ts +23 -16
  142. package/dist/es6/layout/lib/utils/color.d.ts.map +1 -1
  143. package/dist/es6/layout/lib/utils/color.js +24 -47
  144. package/dist/es6/layout/lib/utils/depth.d.ts +17 -11
  145. package/dist/es6/layout/lib/utils/depth.d.ts.map +1 -1
  146. package/dist/es6/layout/lib/utils/depth.js +19 -18
  147. package/dist/es6/layout/lib/utils/flex.d.ts +31 -12
  148. package/dist/es6/layout/lib/utils/flex.d.ts.map +1 -1
  149. package/dist/es6/layout/lib/utils/flex.js +57 -23
  150. package/dist/es6/layout/lib/utils/flexItem.d.ts +18 -15
  151. package/dist/es6/layout/lib/utils/flexItem.d.ts.map +1 -1
  152. package/dist/es6/layout/lib/utils/flexItem.js +42 -24
  153. package/dist/es6/layout/lib/utils/grid.d.ts +40 -35
  154. package/dist/es6/layout/lib/utils/grid.d.ts.map +1 -1
  155. package/dist/es6/layout/lib/utils/grid.js +98 -70
  156. package/dist/es6/layout/lib/utils/gridItem.d.ts +17 -14
  157. package/dist/es6/layout/lib/utils/gridItem.d.ts.map +1 -1
  158. package/dist/es6/layout/lib/utils/gridItem.js +57 -28
  159. package/dist/es6/layout/lib/utils/layout.d.ts +47 -25
  160. package/dist/es6/layout/lib/utils/layout.d.ts.map +1 -1
  161. package/dist/es6/layout/lib/utils/layout.js +70 -31
  162. package/dist/es6/layout/lib/utils/other.d.ts +44 -2
  163. package/dist/es6/layout/lib/utils/other.d.ts.map +1 -1
  164. package/dist/es6/layout/lib/utils/other.js +100 -15
  165. package/dist/es6/layout/lib/utils/position.d.ts +37 -20
  166. package/dist/es6/layout/lib/utils/position.d.ts.map +1 -1
  167. package/dist/es6/layout/lib/utils/position.js +48 -64
  168. package/dist/es6/layout/lib/utils/space.d.ts +107 -51
  169. package/dist/es6/layout/lib/utils/space.d.ts.map +1 -1
  170. package/dist/es6/layout/lib/utils/space.js +97 -146
  171. package/dist/es6/layout/lib/utils/stack.d.ts +3 -6
  172. package/dist/es6/layout/lib/utils/stack.d.ts.map +1 -1
  173. package/dist/es6/layout/lib/utils/stack.js +13 -39
  174. package/dist/es6/layout/lib/utils/systemProps.d.ts +31 -0
  175. package/dist/es6/layout/lib/utils/systemProps.d.ts.map +1 -0
  176. package/dist/es6/layout/lib/utils/systemProps.js +1 -0
  177. package/dist/es6/layout/lib/utils/text.d.ts +33 -15
  178. package/dist/es6/layout/lib/utils/text.d.ts.map +1 -1
  179. package/dist/es6/layout/lib/utils/text.js +73 -36
  180. package/dist/es6/modal/lib/Modal.d.ts +1 -1
  181. package/dist/es6/popup/lib/Popup.d.ts +1 -1
  182. package/dist/es6/popup/lib/PopupBody.d.ts +1 -1
  183. package/dist/es6/popup/lib/hooks/useReturnFocus.d.ts.map +1 -1
  184. package/dist/es6/popup/lib/hooks/useReturnFocus.js +103 -3
  185. package/dist/es6/tabs/lib/TabsItem.d.ts +1 -1
  186. package/dist/es6/tokens/lib/colors.types.d.ts +4 -6
  187. package/dist/es6/tokens/lib/colors.types.d.ts.map +1 -1
  188. package/icon/lib/SystemIcon.tsx +1 -1
  189. package/layout/index.ts +8 -4
  190. package/layout/lib/Box.tsx +10 -36
  191. package/layout/lib/Flex.tsx +5 -1
  192. package/layout/lib/Grid.tsx +3 -4
  193. package/layout/lib/utils/background.ts +83 -0
  194. package/layout/lib/utils/border/color.ts +85 -0
  195. package/layout/lib/utils/border/index.ts +49 -0
  196. package/layout/lib/utils/border/lineStyle.ts +87 -0
  197. package/layout/lib/utils/border/radius.ts +61 -0
  198. package/layout/lib/utils/border/shorthand.ts +73 -0
  199. package/layout/lib/utils/border/width.ts +73 -0
  200. package/layout/lib/utils/buildStyleFns.ts +117 -0
  201. package/layout/lib/utils/color.ts +40 -55
  202. package/layout/lib/utils/depth.ts +28 -24
  203. package/layout/lib/utils/flex.ts +83 -32
  204. package/layout/lib/utils/flexItem.ts +54 -36
  205. package/layout/lib/utils/grid.ts +131 -94
  206. package/layout/lib/utils/gridItem.ts +69 -41
  207. package/layout/lib/utils/layout.ts +109 -50
  208. package/layout/lib/utils/other.ts +142 -15
  209. package/layout/lib/utils/position.ts +79 -73
  210. package/layout/lib/utils/space.ts +202 -196
  211. package/layout/lib/utils/stack.ts +19 -45
  212. package/layout/lib/utils/systemProps.ts +46 -0
  213. package/layout/lib/utils/text.ts +99 -34
  214. package/package.json +3 -3
  215. package/popup/lib/hooks/useReturnFocus.tsx +117 -4
  216. package/tokens/lib/colors.types.ts +4 -7
  217. package/dist/commonjs/layout/lib/utils/border.d.ts +0 -103
  218. package/dist/commonjs/layout/lib/utils/border.d.ts.map +0 -1
  219. package/dist/commonjs/layout/lib/utils/border.js +0 -153
  220. package/dist/commonjs/layout/lib/utils/font.d.ts +0 -29
  221. package/dist/commonjs/layout/lib/utils/font.d.ts.map +0 -1
  222. package/dist/commonjs/layout/lib/utils/font.js +0 -57
  223. package/dist/es6/layout/lib/utils/border.d.ts +0 -103
  224. package/dist/es6/layout/lib/utils/border.d.ts.map +0 -1
  225. package/dist/es6/layout/lib/utils/border.js +0 -149
  226. package/dist/es6/layout/lib/utils/font.d.ts +0 -29
  227. package/dist/es6/layout/lib/utils/font.d.ts.map +0 -1
  228. package/dist/es6/layout/lib/utils/font.js +0 -53
  229. package/layout/lib/utils/border.ts +0 -263
  230. package/layout/lib/utils/font.ts +0 -67
@@ -1,67 +1,72 @@
1
1
  import { Property } from 'csstype';
2
- import { CanvasSpaceKeys } from '@workday/canvas-kit-react/tokens';
3
- export declare type GridSpacePropsValues = CanvasSpaceKeys | number | (string & {});
4
- /** style props to for grid container properties */
2
+ import { StyleFnConfig } from './buildStyleFns';
3
+ import { SystemPropValues } from './systemProps';
4
+ /** style props to for CSS grid container properties */
5
5
  export declare type GridStyleProps = {
6
- /** sets `align-items` property */
6
+ /** sets [CSS align-items property](https://developer.mozilla.org/en-US/docs/Web/CSS/align-items) */
7
7
  alignItems?: Property.AlignItems;
8
- /** sets `align-content` property */
8
+ /** sets [CSS align-content property](https://developer.mozilla.org/en-US/docs/Web/CSS/align-content) */
9
9
  alignContent?: Property.AlignContent;
10
10
  /**
11
- * sets `display` property
12
- * @default 'grid'
11
+ * - sets [CSS display property](https://developer.mozilla.org/en-US/docs/Web/CSS/display)
12
+ * - @default 'grid'
13
13
  * */
14
14
  display?: 'grid' | 'inline-grid';
15
- /** sets `justify-items` property */
15
+ /** sets [CSS justify-items property](https://developer.mozilla.org/en-US/docs/Web/CSS/justify-items) */
16
16
  justifyItems?: Property.JustifyItems;
17
- /** sets `justify-content` property */
17
+ /** sets [CSS justify-content property](https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content) */
18
18
  justifyContent?: Property.JustifyContent;
19
- /** sets `grid-template` property */
19
+ /** sets [CSS grid-template property](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template) */
20
20
  gridTemplate?: Property.GridTemplate;
21
- /** sets `grid-template-area` property */
21
+ /** sets [CSS grid-template-areas property](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-areas) */
22
22
  gridTemplateAreas?: Property.GridTemplateAreas;
23
- /** sets `grid-template-columns` property */
23
+ /** sets [CSS grid-template-columns property](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-columns) */
24
24
  gridTemplateColumns?: Property.GridTemplateColumns;
25
- /** sets `grid-template-rows` property */
25
+ /** sets [CSS grid-template-rows property](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-rows) */
26
26
  gridTemplateRows?: Property.GridTemplateRows;
27
- /** sets `column-gap` property */
28
- gridColumnGap?: Property.GridColumnGap | GridSpacePropsValues;
29
- /** sets `row-gap` property */
30
- gridRowGap?: Property.GridRowGap | GridSpacePropsValues;
31
- /** sets `gap` property */
32
- gridGap?: Property.GridGap | GridSpacePropsValues;
33
- /** sets `place-items` property */
27
+ /**
28
+ * - sets [CSS column-gap property](https://developer.mozilla.org/en-US/docs/Web/CSS/column-gap)
29
+ * - system tokens: `space`
30
+ * */
31
+ gridColumnGap?: Property.GridColumnGap | SystemPropValues['space'];
32
+ /**
33
+ * - sets [CSS row-gap property](https://developer.mozilla.org/en-US/docs/Web/CSS/row-gap)
34
+ * - system tokens: `space`
35
+ * */
36
+ gridRowGap?: Property.GridRowGap | SystemPropValues['space'];
37
+ /**
38
+ * - sets [CSS grid-gap property](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-gap)
39
+ * - system tokens: `space`
40
+ * */
41
+ gridGap?: Property.GridGap | SystemPropValues['space'];
42
+ /** sets [CSS place-items property](https://developer.mozilla.org/en-US/docs/Web/CSS/place-items) */
34
43
  gridPlaceItems?: Property.PlaceItems;
35
- /** sets `grid-auto-columns` property */
44
+ /** sets [CSS grid-auto-columns property](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-auto-columns) */
36
45
  gridAutoColumns?: Property.GridAutoColumns;
37
- /** sets `grid-auto-rows` property */
46
+ /** sets [CSS grid-auto-rows property](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-auto-rows) */
38
47
  gridAutoRows?: Property.GridAutoRows;
39
- /** sets `grid-area` property */
48
+ /** sets [CSS grid-area property](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-area) */
40
49
  gridArea?: Property.GridArea;
41
- /** sets `grid-auto-flow` property */
50
+ /** sets [CSS grid-auto-flow property](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-auto-flow) */
42
51
  gridAutoFlow?: Property.GridAutoFlow;
43
- /** sets `grid` property */
52
+ /** sets [CSS grid property](https://developer.mozilla.org/en-US/docs/Web/CSS/grid) */
44
53
  grid?: Property.Grid;
45
54
  };
46
- export declare type gridSpaceProps = {
47
- /** sets `gap` property */
48
- gridGap?: Property.GridGap | GridSpacePropsValues;
49
- };
50
- export declare type SpaceStyleProps = gridSpaceProps & GridStyleProps;
55
+ export declare const gridStyleFnConfigs: StyleFnConfig[];
56
+ export declare const gridStyleFns: import("./buildStyleFns").StyleFns;
51
57
  /**
52
58
  * A style prop function that takes component props and returns grid styles.
53
59
  * If no `GridStyleProps` are found, it returns an empty object.
54
- * Space tokens are available for `gridGap`, `gridRowGap`, `gridColumnGap` (`zero`, `xxxs`, `xxs`, `xs`, `s`, `m`, `l`, `xl`, `xxl`, `xxxl`).
55
- * Values: `zero: 0px`, `xxxs: 4px`, `xxs: 8px`, `xs: 12px`, `s: 16px`, `m: 24px`, `l: 32px`, `xl: 40px`, `xxl: 64px`, `xxxl: 80px`.
60
+ * Space tokens are available for gridGap, gridRowGap, gridColumnGap props.
56
61
  *
57
62
  * @example
58
- * // You'll most likely use `grid` with low-level, styled components
63
+ * ```tsx
59
64
  * const GridExample = () => (
60
65
  * <Grid gridAutoFlow="row" justifyContent="center" alignItems="center">
61
66
  * Hello, Grid!
62
67
  * </Grid>
63
68
  * );
64
- *
69
+ * ```
65
70
  */
66
- export declare function grid<P extends SpaceStyleProps>(props: P): {};
71
+ export declare const grid: (props: GridStyleProps) => {};
67
72
  //# sourceMappingURL=grid.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"grid.d.ts","sourceRoot":"","sources":["../../../../../layout/lib/utils/grid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AACjC,OAAO,EAAoC,eAAe,EAAC,MAAM,kCAAkC,CAAC;AAEpG,oBAAY,oBAAoB,GAAG,eAAe,GAAG,MAAM,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAE5E,mDAAmD;AACnD,oBAAY,cAAc,GAAG;IAC3B,kCAAkC;IAClC,UAAU,CAAC,EAAE,QAAQ,CAAC,UAAU,CAAC;IACjC,oCAAoC;IACpC,YAAY,CAAC,EAAE,QAAQ,CAAC,YAAY,CAAC;IACrC;;;SAGK;IACL,OAAO,CAAC,EAAE,MAAM,GAAG,aAAa,CAAC;IACjC,oCAAoC;IACpC,YAAY,CAAC,EAAE,QAAQ,CAAC,YAAY,CAAC;IACrC,sCAAsC;IACtC,cAAc,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC;IAGzC,oCAAoC;IACpC,YAAY,CAAC,EAAE,QAAQ,CAAC,YAAY,CAAC;IACrC,yCAAyC;IACzC,iBAAiB,CAAC,EAAE,QAAQ,CAAC,iBAAiB,CAAC;IAC/C,4CAA4C;IAC5C,mBAAmB,CAAC,EAAE,QAAQ,CAAC,mBAAmB,CAAC;IACnD,yCAAyC;IACzC,gBAAgB,CAAC,EAAE,QAAQ,CAAC,gBAAgB,CAAC;IAC7C,iCAAiC;IACjC,aAAa,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AAkB,EAAE,aAAa,EA2F7C,CAAC;AAEF,eAAO,MAAM,YAAY,oCAAoC,CAAC;AAC9D;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,IAAI,+BAAiD,CAAC"}
@@ -1,85 +1,112 @@
1
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
2
  Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.grid = void 0;
15
- var tokens_1 = require("@workday/canvas-kit-react/tokens");
16
- var gridGap = function (value) {
17
- return { gridGap: tokens_1.space[value] || value };
18
- };
19
- var gridRowGap = function (value) {
20
- return { gridRowGap: tokens_1.space[value] || value };
21
- };
22
- var gridColumnGap = function (value) {
23
- return { gridColumnGap: tokens_1.space[value] || value };
24
- };
25
- var gridSpaceStyleProps = {
26
- gridGap: gridGap,
27
- gridRowGap: gridRowGap,
28
- gridColumnGap: gridColumnGap,
29
- };
30
- var gridProps = {
31
- alignContent: 'alignContent',
32
- alignItems: 'alignItems',
33
- display: 'display',
34
- justifyContent: 'justifyContent',
35
- justifyItems: 'justifyItems',
36
- gridTemplateAreas: 'gridTemplateAreas',
37
- gridTemplate: 'gridTemplate',
38
- gridTemplateColumns: 'gridTemplateColumns',
39
- gridTemplateRows: 'gridTemplateRows',
40
- gridColumnGap: 'gridColumnGap',
41
- gridRowGap: 'gridRowGap',
42
- gridGap: 'gridGap',
43
- gridPlaceItems: 'gridPlaceItems',
44
- gridAutoColumns: 'gridAutoColumns',
45
- gridAutoRows: 'gridAutoRows',
46
- gridAutoFlow: 'gridAutoFlow',
47
- gridArea: 'gridArea',
48
- grid: 'grid',
49
- };
3
+ exports.grid = exports.gridStyleFns = exports.gridStyleFnConfigs = void 0;
4
+ var buildStyleFns_1 = require("./buildStyleFns");
5
+ exports.gridStyleFnConfigs = [
6
+ {
7
+ name: 'gridGap',
8
+ properties: ['gridGap'],
9
+ system: 'space',
10
+ },
11
+ {
12
+ name: 'gridRowGap',
13
+ properties: ['gridRowGap'],
14
+ system: 'space',
15
+ },
16
+ {
17
+ name: 'gridColumnGap',
18
+ properties: ['gridColumnGap'],
19
+ system: 'space',
20
+ },
21
+ {
22
+ name: 'alignContent',
23
+ properties: ['alignContent'],
24
+ system: 'none',
25
+ },
26
+ {
27
+ name: 'alignItems',
28
+ properties: ['alignItems'],
29
+ system: 'none',
30
+ },
31
+ {
32
+ name: 'display',
33
+ properties: ['display'],
34
+ system: 'none',
35
+ },
36
+ {
37
+ name: 'justifyContent',
38
+ properties: ['justifyContent'],
39
+ system: 'none',
40
+ },
41
+ {
42
+ name: 'justifyItems',
43
+ properties: ['justifyItems'],
44
+ system: 'none',
45
+ },
46
+ {
47
+ name: 'gridTemplateAreas',
48
+ properties: ['gridTemplateAreas'],
49
+ system: 'none',
50
+ },
51
+ {
52
+ name: 'gridTemplate',
53
+ properties: ['gridTemplate'],
54
+ system: 'none',
55
+ },
56
+ {
57
+ name: 'gridTemplateColumns',
58
+ properties: ['gridTemplateColumns'],
59
+ system: 'none',
60
+ },
61
+ {
62
+ name: 'gridTemplateRows',
63
+ properties: ['gridTemplateRows'],
64
+ system: 'none',
65
+ },
66
+ {
67
+ name: 'gridPlaceItems',
68
+ properties: ['gridPlaceItems'],
69
+ system: 'none',
70
+ },
71
+ {
72
+ name: 'gridAutoColumns',
73
+ properties: ['gridAutoColumns'],
74
+ system: 'none',
75
+ },
76
+ {
77
+ name: 'gridAutoRows',
78
+ properties: ['gridAutoRows'],
79
+ system: 'none',
80
+ },
81
+ {
82
+ name: 'gridAutoFlow',
83
+ properties: ['gridAutoFlow'],
84
+ system: 'none',
85
+ },
86
+ {
87
+ name: 'gridArea',
88
+ properties: ['gridArea'],
89
+ system: 'none',
90
+ },
91
+ {
92
+ name: 'grid',
93
+ properties: ['grid'],
94
+ system: 'none',
95
+ },
96
+ ];
97
+ exports.gridStyleFns = buildStyleFns_1.buildStyleFns(exports.gridStyleFnConfigs);
50
98
  /**
51
99
  * A style prop function that takes component props and returns grid styles.
52
100
  * If no `GridStyleProps` are found, it returns an empty object.
53
- * Space tokens are available for `gridGap`, `gridRowGap`, `gridColumnGap` (`zero`, `xxxs`, `xxs`, `xs`, `s`, `m`, `l`, `xl`, `xxl`, `xxxl`).
54
- * Values: `zero: 0px`, `xxxs: 4px`, `xxs: 8px`, `xs: 12px`, `s: 16px`, `m: 24px`, `l: 32px`, `xl: 40px`, `xxl: 64px`, `xxxl: 80px`.
101
+ * Space tokens are available for gridGap, gridRowGap, gridColumnGap props.
55
102
  *
56
103
  * @example
57
- * // You'll most likely use `grid` with low-level, styled components
104
+ * ```tsx
58
105
  * const GridExample = () => (
59
106
  * <Grid gridAutoFlow="row" justifyContent="center" alignItems="center">
60
107
  * Hello, Grid!
61
108
  * </Grid>
62
109
  * );
63
- *
110
+ * ```
64
111
  */
65
- function grid(props) {
66
- var styles = {};
67
- for (var key in props) {
68
- if (props.hasOwnProperty(key)) {
69
- if (key in gridProps) {
70
- var attr = gridProps[key];
71
- var value = props[key];
72
- // @ts-ignore TS doesn't like adding a potentially unknown key to an object, but because we own this object, it's fine.
73
- styles[attr] = value;
74
- }
75
- if (key in gridSpaceStyleProps) {
76
- var value = props[key];
77
- var spaceFn = gridSpaceStyleProps[key];
78
- var style = spaceFn(value);
79
- styles = __assign(__assign({}, styles), style);
80
- }
81
- }
82
- }
83
- return styles;
84
- }
85
- exports.grid = grid;
112
+ exports.grid = buildStyleFns_1.buildStylePropFn(exports.gridStyleFns);
@@ -1,39 +1,42 @@
1
1
  import { Property } from 'csstype';
2
- /** style props to for grid item properties */
2
+ import { StyleFnConfig } from './buildStyleFns';
3
+ /** style props to for CSS grid item properties */
3
4
  export declare type GridItemStyleProps = {
4
- /** sets `grid-column-start` property */
5
+ /** sets [CSS grid-column-start property](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column-start) */
5
6
  gridColumnStart?: Property.GridColumnStart;
6
- /** sets `grid-column-end` property */
7
+ /** sets [CSS grid-column-end property](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column-end) */
7
8
  gridColumnEnd?: Property.GridColumnEnd;
8
- /** sets `grid-row-start` property */
9
+ /** sets [CSS grid-row-start property](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row-start) */
9
10
  gridRowStart?: Property.GridRowStart;
10
- /** sets `grid-row-end` property */
11
+ /** sets [CSS grid-row-end property](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row-end) */
11
12
  gridRowEnd?: Property.GridRowEnd;
12
- /** sets `grid-column` property */
13
+ /** sets [CSS grid-column property](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column) */
13
14
  gridColumn?: Property.GridColumn;
14
- /** sets `grid-row` property */
15
+ /** sets [CSS grid-row property](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row) */
15
16
  gridRow?: Property.GridRow;
16
- /** sets `grid-area` property */
17
+ /** sets [CSS grid-area property](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-area) */
17
18
  gridArea?: Property.GridArea;
18
- /** sets `justify-self` property */
19
+ /** sets [CSS justify-self property](https://developer.mozilla.org/en-US/docs/Web/CSS/justify-self) */
19
20
  justifySelf?: Property.JustifySelf;
20
- /** sets `align-self` property */
21
+ /** sets [CSS align-self property](https://developer.mozilla.org/en-US/docs/Web/CSS/align-self) */
21
22
  alignSelf?: Property.AlignSelf;
22
- /** sets `place-self` property */
23
+ /** sets [CSS place-self property](https://developer.mozilla.org/en-US/docs/Web/CSS/place-self) */
23
24
  placeSelf?: Property.PlaceSelf;
24
25
  };
26
+ export declare const gridItemStyleFnConfigs: StyleFnConfig[];
27
+ export declare const gridItemStyleFns: import("./buildStyleFns").StyleFns;
25
28
  /**
26
29
  * A style prop function that takes component props and returns grid styles.
27
30
  * If no `GridItemStyleProps` are found, it returns an empty object.
28
31
  *
29
32
  * @example
30
- * // You'll most likely use `grid item` with low-level, styled components
33
+ * ```tsx
31
34
  * const GridItemExample = () => (
32
35
  * <Grid.Item gridRowStart="1" justifySelf="center" gridArea="Card">
33
36
  * Hello, Grid Item!
34
37
  * </Grid.Item>
35
38
  * );
36
- *
39
+ * ```
37
40
  */
38
- export declare function gridItem<P extends GridItemStyleProps>(props: P): {};
41
+ export declare const gridItem: (props: GridItemStyleProps) => {};
39
42
  //# sourceMappingURL=gridItem.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"gridItem.d.ts","sourceRoot":"","sources":["../../../../../layout/lib/utils/gridItem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AAEjC,8CAA8C;AAC9C,oBAAY,kBAAkB,GAAG;IAE/B,wCAAwC;IACxC,eAAe,CAAC,EAAE,QAAQ,CAAC,eAAe,CAAC;IAC3C,sCAAsC;IACtC,aAAa,CAAC,EAAE,QAAQ,CAAC,aAAa,CAAC;IACvC,qCAAqC;IACrC,YAAY,CAAC,EAAE,QAAQ,CAAC,YAAY,CAAC;IACrC,mCAAmC;IACnC,UAAU,CAAC,EAAE,QAAQ,CAAC,UAAU,CAAC;IACjC,kCAAkC;IAClC,UAAU,CAAC,EAAE,QAAQ,CAAC,UAAU,CAAC;IACjC,+BAA+B;IAC/B,OAAO,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC;IAC3B,gCAAgC;IAChC,QAAQ,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC;IAC7B,mCAAmC;IACnC,WAAW,CAAC,EAAE,QAAQ,CAAC,WAAW,CAAC;IACnC,iCAAiC;IACjC,SAAS,CAAC,EAAE,QAAQ,CAAC,SAAS,CAAC;IAC/B,iCAAiC;IACjC,SAAS,CAAC,EAAE,QAAQ,CAAC,SAAS,CAAC;CAChC,CAAC;AAiBF;;;;;;;;;;;;GAYG;AAEH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,kBAAkB,EAAE,KAAK,EAAE,CAAC,MAW9D"}
1
+ {"version":3,"file":"gridItem.d.ts","sourceRoot":"","sources":["../../../../../layout/lib/utils/gridItem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AAEjC,OAAO,EAAkC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAE/E,kDAAkD;AAClD,oBAAY,kBAAkB,GAAG;IAC/B,gHAAgH;IAChH,eAAe,CAAC,EAAE,QAAQ,CAAC,eAAe,CAAC;IAC3C,4GAA4G;IAC5G,aAAa,CAAC,EAAE,QAAQ,CAAC,aAAa,CAAC;IACvC,0GAA0G;IAC1G,YAAY,CAAC,EAAE,QAAQ,CAAC,YAAY,CAAC;IACrC,sGAAsG;IACtG,UAAU,CAAC,EAAE,QAAQ,CAAC,UAAU,CAAC;IACjC,oGAAoG;IACpG,UAAU,CAAC,EAAE,QAAQ,CAAC,UAAU,CAAC;IACjC,8FAA8F;IAC9F,OAAO,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC;IAC3B,gGAAgG;IAChG,QAAQ,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC;IAC7B,sGAAsG;IACtG,WAAW,CAAC,EAAE,QAAQ,CAAC,WAAW,CAAC;IACnC,kGAAkG;IAClG,SAAS,CAAC,EAAE,QAAQ,CAAC,SAAS,CAAC;IAC/B,kGAAkG;IAClG,SAAS,CAAC,EAAE,QAAQ,CAAC,SAAS,CAAC;CAChC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,aAAa,EAmDjD,CAAC;AAEF,eAAO,MAAM,gBAAgB,oCAAwC,CAAC;AACtE;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,QAAQ,mCAAyD,CAAC"}
@@ -1,43 +1,71 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.gridItem = void 0;
4
- /** style props to for grid item properties */
5
- var gridItemProps = {
6
- //Child Props
7
- gridColumnStart: 'gridColumnStart',
8
- gridColumnEnd: 'gridColumnEnd',
9
- gridRowStart: 'gridRowStart',
10
- gridRowEnd: 'gridRowEnd',
11
- gridColumn: 'gridColumn',
12
- gridRow: 'gridRow',
13
- gridArea: 'gridArea',
14
- justifySelf: 'justifySelf',
15
- alignSelf: 'alignSelf',
16
- placeSelf: 'placeSelf',
17
- };
3
+ exports.gridItem = exports.gridItemStyleFns = exports.gridItemStyleFnConfigs = void 0;
4
+ var buildStyleFns_1 = require("./buildStyleFns");
5
+ exports.gridItemStyleFnConfigs = [
6
+ {
7
+ name: 'gridColumnStart',
8
+ properties: ['gridColumnStart'],
9
+ system: 'none',
10
+ },
11
+ {
12
+ name: 'gridColumnEnd',
13
+ properties: ['gridColumnEnd'],
14
+ system: 'none',
15
+ },
16
+ {
17
+ name: 'gridRowStart',
18
+ properties: ['gridRowStart'],
19
+ system: 'none',
20
+ },
21
+ {
22
+ name: 'gridRowEnd',
23
+ properties: ['gridRowEnd'],
24
+ system: 'none',
25
+ },
26
+ {
27
+ name: 'gridColumn',
28
+ properties: ['gridColumn'],
29
+ system: 'none',
30
+ },
31
+ {
32
+ name: 'gridRow',
33
+ properties: ['gridRow'],
34
+ system: 'none',
35
+ },
36
+ {
37
+ name: 'gridArea',
38
+ properties: ['gridArea'],
39
+ system: 'none',
40
+ },
41
+ {
42
+ name: 'justifySelf',
43
+ properties: ['justifySelf'],
44
+ system: 'none',
45
+ },
46
+ {
47
+ name: 'alignSelf',
48
+ properties: ['alignSelf'],
49
+ system: 'none',
50
+ },
51
+ {
52
+ name: 'placeSelf',
53
+ properties: ['placeSelf'],
54
+ system: 'none',
55
+ },
56
+ ];
57
+ exports.gridItemStyleFns = buildStyleFns_1.buildStyleFns(exports.gridItemStyleFnConfigs);
18
58
  /**
19
59
  * A style prop function that takes component props and returns grid styles.
20
60
  * If no `GridItemStyleProps` are found, it returns an empty object.
21
61
  *
22
62
  * @example
23
- * // You'll most likely use `grid item` with low-level, styled components
63
+ * ```tsx
24
64
  * const GridItemExample = () => (
25
65
  * <Grid.Item gridRowStart="1" justifySelf="center" gridArea="Card">
26
66
  * Hello, Grid Item!
27
67
  * </Grid.Item>
28
68
  * );
29
- *
69
+ * ```
30
70
  */
31
- function gridItem(props) {
32
- var styles = {};
33
- for (var key in props) {
34
- if (key in gridItemProps) {
35
- var attr = gridItemProps[key];
36
- var value = props[key];
37
- // @ts-ignore TS doesn't like adding a potentially unknown key to an object, but because we own this object, it's fine.
38
- styles[attr] = value;
39
- }
40
- }
41
- return styles;
42
- }
43
- exports.gridItem = gridItem;
71
+ exports.gridItem = buildStyleFns_1.buildStylePropFn(exports.gridItemStyleFns);
@@ -1,43 +1,65 @@
1
1
  import { Property } from 'csstype';
2
- /** style props to for layout properties */
2
+ import { StyleFnConfig } from './buildStyleFns';
3
+ import { SystemPropValues } from './systemProps';
4
+ /** style props to for CSS layout properties */
3
5
  export declare type LayoutStyleProps = {
4
- /** sets `display` property */
6
+ /** sets [CSS display property](https://developer.mozilla.org/en-US/docs/Web/CSS/displaydisplay) */
5
7
  display?: Property.Display;
6
- /** sets `height` property */
7
- height?: number | string;
8
- /** sets `list-style property */
8
+ /**
9
+ * - sets [CSS height property](https://developer.mozilla.org/en-US/docs/Web/CSS/height)
10
+ * - system tokens: `space`
11
+ * */
12
+ height?: SystemPropValues['space'];
13
+ /** sets [CSS list-style property](https://developer.mozilla.org/en-US/docs/Web/CSS/list-style) */
9
14
  listStyle?: Property.ListStyle;
10
- /** sets `max-height` property */
11
- maxHeight?: number | string;
12
- /** sets `max-width` property */
13
- maxWidth?: number | string;
14
- /** sets `min-height` property */
15
- minHeight?: number | string;
16
- /** sets `min-width` property */
17
- minWidth?: number | string;
18
- /** sets `overflow` property */
15
+ /**
16
+ * - sets [CSS max-height property](https://developer.mozilla.org/en-US/docs/Web/CSS/max-height)
17
+ * - system tokens: `space`
18
+ * */
19
+ maxHeight?: SystemPropValues['space'];
20
+ /**
21
+ * - sets [CSS max-width property](https://developer.mozilla.org/en-US/docs/Web/CSS/max-width)
22
+ * - system tokens: `space`
23
+ * */
24
+ maxWidth?: SystemPropValues['space'];
25
+ /**
26
+ * - sets [CSS min-height property](https://developer.mozilla.org/en-US/docs/Web/CSS/min-height)
27
+ * - system tokens: `space`
28
+ * */
29
+ minHeight?: SystemPropValues['space'];
30
+ /**
31
+ * - sets [CSS min-width property](https://developer.mozilla.org/en-US/docs/Web/CSS/min-width)
32
+ * - system tokens: `space`
33
+ * */
34
+ minWidth?: SystemPropValues['space'];
35
+ /** sets [CSS overflow property](https://developer.mozilla.org/en-US/docs/Web/CSS/overflow) */
19
36
  overflow?: Property.Overflow;
20
- /** sets `overflow-x` property */
37
+ /** sets [CSS overflow-x property](https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-x) */
21
38
  overflowX?: Property.OverflowX;
22
- /** sets `overflow-y` property */
39
+ /** sets [CSS overflow-y property](https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-y) */
23
40
  overflowY?: Property.OverflowY;
24
- /** sets `vertical-align` property */
41
+ /** sets [CSS vertical-align property](https://developer.mozilla.org/en-US/docs/Web/CSS/vertical-align) */
25
42
  verticalAlign?: Property.VerticalAlign;
26
- /** sets `width` property */
27
- width?: number | string;
43
+ /**
44
+ * - sets [CSS width property](https://developer.mozilla.org/en-US/docs/Web/CSS/width)
45
+ * - system tokens: `space`
46
+ * */
47
+ width?: SystemPropValues['space'];
28
48
  };
49
+ export declare const layoutStyleFnConfigs: StyleFnConfig[];
50
+ export declare const layoutStyleFns: import("./buildStyleFns").StyleFns;
29
51
  /**
30
- * A style prop function that takes components props and returns layout styles.
52
+ * A style prop function that takes component props and returns layout styles.
31
53
  * If no `LayoutStyleProps` are found, it returns an empty object.
32
54
  *
33
55
  * @example
34
- * // You'll most likely use `layout` with low-level, styled components
35
- * const BoxExample = () => (
56
+ * ```tsx
57
+ * const LayoutExample = () => (
36
58
  * <Box display="inline-block" height="50%">
37
- * Hello, positions!
59
+ * Hello, layout!
38
60
  * </Box>
39
61
  * );
40
- *
62
+ * ```
41
63
  */
42
- export declare function layout<P extends LayoutStyleProps>(props: P): {};
64
+ export declare const layout: (props: LayoutStyleProps) => {};
43
65
  //# sourceMappingURL=layout.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../../../layout/lib/utils/layout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AAEjC,2CAA2C;AAC3C,oBAAY,gBAAgB,GAAG;IAC7B,8BAA8B;IAC9B,OAAO,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC;IAC3B,6BAA6B;IAC7B,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,gCAAgC;IAChC,SAAS,CAAC,EAAE,QAAQ,CAAC,SAAS,CAAC;IAC/B,iCAAiC;IACjC,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,gCAAgC;IAChC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,iCAAiC;IACjC,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,gCAAgC;IAChC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC;IAC7B,iCAAiC;IACjC,SAAS,CAAC,EAAE,QAAQ,CAAC,SAAS,CAAC;IAC/B,iCAAiC;IACjC,SAAS,CAAC,EAAE,QAAQ,CAAC,SAAS,CAAC;IAC/B,qCAAqC;IACrC,aAAa,CAAC,EAAE,QAAQ,CAAC,aAAa,CAAC;IACvC,4BAA4B;IAC5B,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB,CAAC;AAiBF;;;;;;;;;;;;GAYG;AACH,wBAAgB,MAAM,CAAC,CAAC,SAAS,gBAAgB,EAAE,KAAK,EAAE,CAAC,MAW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