@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
@@ -0,0 +1,47 @@
1
+ import { StyleFnConfig } from '../buildStyleFns';
2
+ import { SystemPropValues } from '../systemProps';
3
+ /** style props to set CSS border color properties */
4
+ export declare type BorderColorStyleProps = {
5
+ /**
6
+ * - sets [CSS border-color property]((https://developer.mozilla.org/en-US/docs/Web/CSS/border-color)
7
+ * - system tokens: `color`
8
+ */
9
+ borderColor?: SystemPropValues['color'];
10
+ /**
11
+ * - sets [CSS border-top-color property]((https://developer.mozilla.org/en-US/docs/Web/CSS/border-top-color)
12
+ * - system tokens: `color`
13
+ */
14
+ borderTopColor?: SystemPropValues['color'];
15
+ /**
16
+ * - sets [CSS border-right-color property]((https://developer.mozilla.org/en-US/docs/Web/CSS/border-right-color)
17
+ * - no bidirectional support
18
+ * - system tokens: `color`
19
+ */
20
+ borderRightColor?: SystemPropValues['color'];
21
+ /**
22
+ * - sets [CSS border-bottom-color property]((https://developer.mozilla.org/en-US/docs/Web/CSS/border-bottom-color)
23
+ * - system tokens: `color`
24
+ */
25
+ borderBottomColor?: SystemPropValues['color'];
26
+ /**
27
+ * - sets [CSS border-left-color property]((https://developer.mozilla.org/en-US/docs/Web/CSS/border-left-color)
28
+ * - no bidirectional support
29
+ * - system tokens: `color`
30
+ */
31
+ borderLeftColor?: SystemPropValues['color'];
32
+ /**
33
+ * - sets [CSS border-inline-start-color property ]((https://developer.mozilla.org/en-US/docs/Web/CSS/border-inline-start-color)
34
+ * - bidirectional support
35
+ * - system tokens: `color`
36
+ */
37
+ borderInlineStartColor?: SystemPropValues['color'];
38
+ /**
39
+ * - sets [CSS border-inline-end-color property ]((https://developer.mozilla.org/en-US/docs/Web/CSS/border-inline-end-color)
40
+ * - bidirectional support
41
+ * - system tokens: `color`
42
+ */
43
+ borderInlineEndColor?: SystemPropValues['color'];
44
+ };
45
+ export declare const borderColorStyleFnConfigs: StyleFnConfig[];
46
+ export declare const borderColorFns: import("../buildStyleFns").StyleFns;
47
+ //# sourceMappingURL=color.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../../../../../layout/lib/utils/border/color.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAC,gBAAgB,EAAC,MAAM,gBAAgB,CAAC;AAEhD,qDAAqD;AACrD,oBAAY,qBAAqB,GAAG;IAClC;;;OAGG;IACH,WAAW,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACxC;;;OAGG;IACH,cAAc,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC3C;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC7C;;;OAGG;IACH,iBAAiB,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC9C;;;;OAIG;IACH,eAAe,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC5C;;;;OAIG;IACH,sBAAsB,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACnD;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;CAClD,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,aAAa,EAoCpD,CAAC;AAEF,eAAO,MAAM,cAAc,qCAA2C,CAAC"}
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.borderColorFns = exports.borderColorStyleFnConfigs = void 0;
4
+ var buildStyleFns_1 = require("../buildStyleFns");
5
+ exports.borderColorStyleFnConfigs = [
6
+ {
7
+ name: 'borderColor',
8
+ properties: ['borderColor'],
9
+ system: 'color',
10
+ },
11
+ {
12
+ name: 'borderTopColor',
13
+ properties: ['borderTopColor'],
14
+ system: 'color',
15
+ },
16
+ {
17
+ name: 'borderRightColor',
18
+ properties: ['borderRightColor'],
19
+ system: 'color',
20
+ },
21
+ {
22
+ name: 'borderBottomColor',
23
+ properties: ['borderBottomColor'],
24
+ system: 'color',
25
+ },
26
+ {
27
+ name: 'borderLeftColor',
28
+ properties: ['borderLeftColor'],
29
+ system: 'color',
30
+ },
31
+ {
32
+ name: 'borderInlineStartColor',
33
+ properties: ['borderInlineStartColor'],
34
+ system: 'color',
35
+ },
36
+ {
37
+ name: 'borderInlineEndColor',
38
+ properties: ['borderInlineEndColor'],
39
+ system: 'color',
40
+ },
41
+ ];
42
+ exports.borderColorFns = buildStyleFns_1.buildStyleFns(exports.borderColorStyleFnConfigs);
@@ -0,0 +1,26 @@
1
+ import { BorderColorStyleProps } from './color';
2
+ import { BorderLineStyleProps } from './lineStyle';
3
+ import { BorderRadiusStyleProps } from './radius';
4
+ import { BorderShorthandStyleProps } from './shorthand';
5
+ import { BorderWidthStyleProps } from './width';
6
+ export declare type BorderStyleProps = BorderColorStyleProps & BorderLineStyleProps & BorderRadiusStyleProps & BorderShorthandStyleProps & BorderWidthStyleProps;
7
+ /**
8
+ * A style prop function that takes component props and returns border styles. Some props, such as borderRadius and borderColor, are connected to our design tokens.
9
+ * If no `BorderStyleProps` are found, it returns an empty object.
10
+ *
11
+ * @example
12
+ * ```tsx
13
+ * const BorderExample = () => (
14
+ * <Box
15
+ * border="solid 1px"
16
+ * borderColor="soap500"
17
+ * borderRadius="l"
18
+ * >
19
+ * Hello, border styles!
20
+ * </Box>
21
+ * );
22
+ *```
23
+ */
24
+ export declare const border: (props: BorderStyleProps) => {};
25
+ export declare const borderStyleFnConfigs: import("../buildStyleFns").StyleFnConfig[];
26
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../layout/lib/utils/border/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,qBAAqB,EAA4C,MAAM,SAAS,CAAC;AACzF,OAAO,EAAC,oBAAoB,EAA+C,MAAM,aAAa,CAAC;AAC/F,OAAO,EAAC,sBAAsB,EAA8C,MAAM,UAAU,CAAC;AAC7F,OAAO,EACL,yBAAyB,EAG1B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAC,qBAAqB,EAA4C,MAAM,SAAS,CAAC;AAEzF,oBAAY,gBAAgB,GAAG,qBAAqB,GAClD,oBAAoB,GACpB,sBAAsB,GACtB,yBAAyB,GACzB,qBAAqB,CAAC;AAExB;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,MAAM,iCAMjB,CAAC;AAEH,eAAO,MAAM,oBAAoB,4CAMhC,CAAC"}
@@ -0,0 +1,46 @@
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 __spreadArrays = (this && this.__spreadArrays) || function () {
14
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
15
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
16
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
17
+ r[k] = a[j];
18
+ return r;
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ exports.borderStyleFnConfigs = exports.border = void 0;
22
+ var buildStyleFns_1 = require("../buildStyleFns");
23
+ var color_1 = require("./color");
24
+ var lineStyle_1 = require("./lineStyle");
25
+ var radius_1 = require("./radius");
26
+ var shorthand_1 = require("./shorthand");
27
+ var width_1 = require("./width");
28
+ /**
29
+ * A style prop function that takes component props and returns border styles. Some props, such as borderRadius and borderColor, are connected to our design tokens.
30
+ * If no `BorderStyleProps` are found, it returns an empty object.
31
+ *
32
+ * @example
33
+ * ```tsx
34
+ * const BorderExample = () => (
35
+ * <Box
36
+ * border="solid 1px"
37
+ * borderColor="soap500"
38
+ * borderRadius="l"
39
+ * >
40
+ * Hello, border styles!
41
+ * </Box>
42
+ * );
43
+ *```
44
+ */
45
+ exports.border = buildStyleFns_1.buildStylePropFn(__assign(__assign(__assign(__assign(__assign({}, color_1.borderColorFns), lineStyle_1.borderLineStyleFns), radius_1.borderRadiusFns), shorthand_1.borderShorthandFns), width_1.borderWidthFns));
46
+ exports.borderStyleFnConfigs = __spreadArrays(color_1.borderColorStyleFnConfigs, lineStyle_1.borderLineStyleFnConfigs, radius_1.borderRadiusStyleFnConfigs, shorthand_1.borderShorthandStyleFnConfigs, width_1.borderWidthStyleFnConfigs);
@@ -0,0 +1,38 @@
1
+ import { Property } from 'csstype';
2
+ import { StyleFnConfig } from '../buildStyleFns';
3
+ /** style props to set CSS border style properties */
4
+ export declare type BorderLineStyleProps = {
5
+ /** sets [CSS border-collapse property](https://developer.mozilla.org/en-US/docs/Web/CSS/border-collapse) */
6
+ borderCollapse?: Property.BorderCollapse;
7
+ /** sets [CSS border-spacing property](https://developer.mozilla.org/en-US/docs/Web/CSS/border-spacing) */
8
+ borderSpacing?: Property.BorderSpacing;
9
+ /** sets [CSS border-style property](https://developer.mozilla.org/en-US/docs/Web/CSS/border-style) */
10
+ borderStyle?: Property.Border;
11
+ /** sets [CSS border-top-style property](https://developer.mozilla.org/en-US/docs/Web/CSS/border-top-style) */
12
+ borderTopStyle?: Property.Border;
13
+ /**
14
+ * - sets [CSS border-right-style property](https://developer.mozilla.org/en-US/docs/Web/CSS/border-right-style)
15
+ * - no bidirectional support
16
+ */
17
+ borderRightStyle?: Property.Border;
18
+ /** sets [CSS border-bottom-style property](https://developer.mozilla.org/en-US/docs/Web/CSS/border-bottom-style) */
19
+ borderBottomStyle?: Property.Border;
20
+ /**
21
+ * - sets [CSS border-left-style property](https://developer.mozilla.org/en-US/docs/Web/CSS/border-left-style)
22
+ * - no bidirectional support
23
+ */
24
+ borderLeftStyle?: Property.Border;
25
+ /**
26
+ * - sets [CSS border-inline-start-style property](https://developer.mozilla.org/en-US/docs/Web/CSS/border-inline-start-style)
27
+ * - bidirectional support
28
+ */
29
+ borderInlineStartStyle?: Property.Border;
30
+ /**
31
+ * - sets [CSS border-inline-end-style property](https://developer.mozilla.org/en-US/docs/Web/CSS/border-inline-end-style)
32
+ * - bidirectional support
33
+ */
34
+ borderInlineEndStyle?: Property.Border;
35
+ };
36
+ export declare const borderLineStyleFnConfigs: StyleFnConfig[];
37
+ export declare const borderLineStyleFns: import("../buildStyleFns").StyleFns;
38
+ //# sourceMappingURL=lineStyle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lineStyle.d.ts","sourceRoot":"","sources":["../../../../../../layout/lib/utils/border/lineStyle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AAEjC,OAAO,EAAgB,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAE9D,qDAAqD;AACrD,oBAAY,oBAAoB,GAAG;IACjC,4GAA4G;IAC5G,cAAc,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC;IACzC,0GAA0G;IAC1G,aAAa,CAAC,EAAE,QAAQ,CAAC,aAAa,CAAC;IACvC,sGAAsG;IACtG,WAAW,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC;IAC9B,8GAA8G;IAC9G,cAAc,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC;IACjC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC;IACnC,oHAAoH;IACpH,iBAAiB,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC;IACpC;;;OAGG;IACH,eAAe,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC;IAClC;;;OAGG;IACH,sBAAsB,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC;IACzC;;;OAGG;IACH,oBAAoB,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC;CACxC,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,aAAa,EA8CnD,CAAC;AAEF,eAAO,MAAM,kBAAkB,qCAA0C,CAAC"}
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.borderLineStyleFns = exports.borderLineStyleFnConfigs = void 0;
4
+ var buildStyleFns_1 = require("../buildStyleFns");
5
+ exports.borderLineStyleFnConfigs = [
6
+ {
7
+ name: 'borderCollapse',
8
+ properties: ['borderCollapse'],
9
+ system: 'none',
10
+ },
11
+ {
12
+ name: 'borderSpacing',
13
+ properties: ['borderSpacing'],
14
+ system: 'none',
15
+ },
16
+ {
17
+ name: 'borderStyle',
18
+ properties: ['borderStyle'],
19
+ system: 'none',
20
+ },
21
+ {
22
+ name: 'borderTopStyle',
23
+ properties: ['borderTopStyle'],
24
+ system: 'none',
25
+ },
26
+ {
27
+ name: 'borderRightStyle',
28
+ properties: ['borderRightStyle'],
29
+ system: 'none',
30
+ },
31
+ {
32
+ name: 'borderBottomStyle',
33
+ properties: ['borderBottomStyle'],
34
+ system: 'none',
35
+ },
36
+ {
37
+ name: 'borderLeftStyle',
38
+ properties: ['borderLeftStyle'],
39
+ system: 'none',
40
+ },
41
+ {
42
+ name: 'borderInlineStartStyle',
43
+ properties: ['borderInlineStartStyle'],
44
+ system: 'none',
45
+ },
46
+ {
47
+ name: 'borderInlineEndStyle',
48
+ properties: ['borderInlineEndStyle'],
49
+ system: 'none',
50
+ },
51
+ ];
52
+ exports.borderLineStyleFns = buildStyleFns_1.buildStyleFns(exports.borderLineStyleFnConfigs);
@@ -0,0 +1,33 @@
1
+ import { StyleFnConfig } from '../buildStyleFns';
2
+ import { SystemPropValues } from '../systemProps';
3
+ /** style props to set CSS border radius properties */
4
+ export declare type BorderRadiusStyleProps = {
5
+ /**
6
+ * - sets [CSS border-radius property](https://developer.mozilla.org/en-US/docs/Web/CSS/border-radius)
7
+ * - system tokens: `shape`
8
+ * */
9
+ borderRadius?: SystemPropValues['shape'];
10
+ /**
11
+ * - sets [CSS border-top-left-radius property](https://developer.mozilla.org/en-US/docs/Web/CSS/border-top-left-radius)
12
+ * - system tokens: `shape`
13
+ * */
14
+ borderTopLeftRadius?: SystemPropValues['shape'];
15
+ /**
16
+ * - sets [CSS border-top-right-radius property](https://developer.mozilla.org/en-US/docs/Web/CSS/border-top-right-radius)
17
+ * - system tokens: `shape`
18
+ * */
19
+ borderTopRightRadius?: SystemPropValues['shape'];
20
+ /**
21
+ * - sets [CSS border-bottom-left-radius property](https://developer.mozilla.org/en-US/docs/Web/CSS/border-bottom-left-radius)
22
+ * - system tokens: `shape`
23
+ * */
24
+ borderBottomLeftRadius?: SystemPropValues['shape'];
25
+ /**
26
+ * - sets [CSS border-bottom-right-radius property](https://developer.mozilla.org/en-US/docs/Web/CSS/border-bottom-right-radius)
27
+ * - system tokens: `shape`
28
+ * */
29
+ borderBottomRightRadius?: SystemPropValues['shape'];
30
+ };
31
+ export declare const borderRadiusStyleFnConfigs: StyleFnConfig[];
32
+ export declare const borderRadiusFns: import("../buildStyleFns").StyleFns;
33
+ //# sourceMappingURL=radius.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"radius.d.ts","sourceRoot":"","sources":["../../../../../../layout/lib/utils/border/radius.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAC,gBAAgB,EAAC,MAAM,gBAAgB,CAAC;AAEhD,sDAAsD;AACtD,oBAAY,sBAAsB,GAAG;IACnC;;;SAGK;IACL,YAAY,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACzC;;;SAGK;IACL,mBAAmB,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAChD;;;SAGK;IACL,oBAAoB,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACjD;;;SAGK;IACL,sBAAsB,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACnD;;;SAGK;IACL,uBAAuB,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;CACrD,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,aAAa,EA0BrD,CAAC;AAEF,eAAO,MAAM,eAAe,qCAA4C,CAAC"}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.borderRadiusFns = exports.borderRadiusStyleFnConfigs = void 0;
4
+ var buildStyleFns_1 = require("../buildStyleFns");
5
+ exports.borderRadiusStyleFnConfigs = [
6
+ {
7
+ name: 'borderRadius',
8
+ properties: ['borderRadius'],
9
+ system: 'shape',
10
+ },
11
+ {
12
+ name: 'borderTopLeftRadius',
13
+ properties: ['borderTopLeftRadius'],
14
+ system: 'shape',
15
+ },
16
+ {
17
+ name: 'borderTopRightRadius',
18
+ properties: ['borderTopRightRadius'],
19
+ system: 'shape',
20
+ },
21
+ {
22
+ name: 'borderBottomLeftRadius',
23
+ properties: ['borderBottomLeftRadius'],
24
+ system: 'shape',
25
+ },
26
+ {
27
+ name: 'borderBottomRightRadius',
28
+ properties: ['borderBottomRightRadius'],
29
+ system: 'shape',
30
+ },
31
+ ];
32
+ exports.borderRadiusFns = buildStyleFns_1.buildStyleFns(exports.borderRadiusStyleFnConfigs);
@@ -0,0 +1,34 @@
1
+ import { Property } from 'csstype';
2
+ import { StyleFnConfig } from '../buildStyleFns';
3
+ /** style props to set CSS border properties */
4
+ export declare type BorderShorthandStyleProps = {
5
+ /** sets [CSS border property](https://developer.mozilla.org/en-US/docs/Web/CSS/border) */
6
+ border?: Property.Border;
7
+ /** sets [CSS border-top property](https://developer.mozilla.org/en-US/docs/Web/CSS/border-top) */
8
+ borderTop?: Property.BorderTop;
9
+ /**
10
+ * - sets [CSS border-right property](https://developer.mozilla.org/en-US/docs/Web/CSS/border-right)
11
+ * - no bidirectional support
12
+ * */
13
+ borderRight?: Property.BorderRight;
14
+ /** sets [CSS border-bottom property](https://developer.mozilla.org/en-US/docs/Web/CSS/border-bottom) */
15
+ borderBottom?: Property.BorderBottom;
16
+ /**
17
+ * - sets [CSS border-left property](https://developer.mozilla.org/en-US/docs/Web/CSS/border-left)
18
+ * - no bidirectional support
19
+ * */
20
+ borderLeft?: Property.BorderLeft;
21
+ /**
22
+ * - sets [CSS border-inline-start property](https://developer.mozilla.org/en-US/docs/Web/CSS/border-inline-start)
23
+ * - bidirectional support
24
+ * */
25
+ borderInlineStart?: Property.BorderInlineStart;
26
+ /**
27
+ * - sets [CSS border-inline-end property](https://developer.mozilla.org/en-US/docs/Web/CSS/border-inline-end)
28
+ * - bidirectional support
29
+ * */
30
+ borderInlineEnd?: Property.BorderInlineEnd;
31
+ };
32
+ export declare const borderShorthandStyleFnConfigs: StyleFnConfig[];
33
+ export declare const borderShorthandFns: import("../buildStyleFns").StyleFns;
34
+ //# sourceMappingURL=shorthand.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shorthand.d.ts","sourceRoot":"","sources":["../../../../../../layout/lib/utils/border/shorthand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AAEjC,OAAO,EAAgB,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAE9D,+CAA+C;AAC/C,oBAAY,yBAAyB,GAAG;IACtC,0FAA0F;IAC1F,MAAM,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC;IACzB,kGAAkG;IAClG,SAAS,CAAC,EAAE,QAAQ,CAAC,SAAS,CAAC;IAC/B;;;SAGK;IACL,WAAW,CAAC,EAAE,QAAQ,CAAC,WAAW,CAAC;IACnC,wGAAwG;IACxG,YAAY,CAAC,EAAE,QAAQ,CAAC,YAAY,CAAC;IACrC;;;SAGK;IACL,UAAU,CAAC,EAAE,QAAQ,CAAC,UAAU,CAAC;IACjC;;;SAGK;IACL,iBAAiB,CAAC,EAAE,QAAQ,CAAC,iBAAiB,CAAC;IAC/C;;;SAGK;IACL,eAAe,CAAC,EAAE,QAAQ,CAAC,eAAe,CAAC;CAC5C,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,aAAa,EAoCxD,CAAC;AAEF,eAAO,MAAM,kBAAkB,qCAA+C,CAAC"}
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.borderShorthandFns = exports.borderShorthandStyleFnConfigs = void 0;
4
+ var buildStyleFns_1 = require("../buildStyleFns");
5
+ exports.borderShorthandStyleFnConfigs = [
6
+ {
7
+ name: 'border',
8
+ properties: ['border'],
9
+ system: 'none',
10
+ },
11
+ {
12
+ name: 'borderTop',
13
+ properties: ['borderTop'],
14
+ system: 'none',
15
+ },
16
+ {
17
+ name: 'borderRight',
18
+ properties: ['borderRight'],
19
+ system: 'none',
20
+ },
21
+ {
22
+ name: 'borderBottom',
23
+ properties: ['borderBottom'],
24
+ system: 'none',
25
+ },
26
+ {
27
+ name: 'borderLeft',
28
+ properties: ['borderLeft'],
29
+ system: 'none',
30
+ },
31
+ {
32
+ name: 'borderInlineStart',
33
+ properties: ['borderInlineStart'],
34
+ system: 'none',
35
+ },
36
+ {
37
+ name: 'borderInlineEnd',
38
+ properties: ['borderInlineEnd'],
39
+ system: 'none',
40
+ },
41
+ ];
42
+ exports.borderShorthandFns = buildStyleFns_1.buildStyleFns(exports.borderShorthandStyleFnConfigs);
@@ -0,0 +1,34 @@
1
+ import { Property } from 'csstype';
2
+ import { StyleFnConfig } from '../buildStyleFns';
3
+ /** style props to set CSS border width properties */
4
+ export declare type BorderWidthStyleProps = {
5
+ /** sets [CSS border-width property](https://developer.mozilla.org/en-US/docs/Web/CSS/border-width) */
6
+ borderWidth?: Property.BorderWidth | number;
7
+ /** sets [CSS border-top-width property](https://developer.mozilla.org/en-US/docs/Web/CSS/border-top-width) */
8
+ borderTopWidth?: Property.BorderTopWidth | number;
9
+ /**
10
+ * - sets [CSS border-right-width property](https://developer.mozilla.org/en-US/docs/Web/CSS/border-right-width)
11
+ * - no bidirectional support
12
+ * */
13
+ borderRightWidth?: Property.BorderRightWidth | number;
14
+ /** sets [CSS border-bottom-width property](https://developer.mozilla.org/en-US/docs/Web/CSS/border-bottom-width) */
15
+ borderBottomWidth?: Property.BorderBottomWidth | number;
16
+ /**
17
+ * - sets [CSS border-left-width property](https://developer.mozilla.org/en-US/docs/Web/CSS/border-left-width)
18
+ * - no bidirectional support
19
+ * */
20
+ borderLeftWidth?: Property.BorderLeftWidth | number;
21
+ /**
22
+ * - sets [CSS border-inline-start-width property](https://developer.mozilla.org/en-US/docs/Web/CSS/border-inline-start-width)
23
+ * - bidirectional support
24
+ * */
25
+ borderInlineStartWidth?: Property.BorderInlineStartWidth | number;
26
+ /**
27
+ * - sets [CSS border-inline-end property](https://developer.mozilla.org/en-US/docs/Web/CSS/border-inline-end)
28
+ * - bidirectional support
29
+ * */
30
+ borderInlineEndWidth?: Property.BorderInlineEndWidth | number;
31
+ };
32
+ export declare const borderWidthStyleFnConfigs: StyleFnConfig[];
33
+ export declare const borderWidthFns: import("../buildStyleFns").StyleFns;
34
+ //# sourceMappingURL=width.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"width.d.ts","sourceRoot":"","sources":["../../../../../../layout/lib/utils/border/width.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AAEjC,OAAO,EAAgB,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAE9D,qDAAqD;AACrD,oBAAY,qBAAqB,GAAG;IAClC,sGAAsG;IACtG,WAAW,CAAC,EAAE,QAAQ,CAAC,WAAW,GAAG,MAAM,CAAC;IAC5C,8GAA8G;IAC9G,cAAc,CAAC,EAAE,QAAQ,CAAC,cAAc,GAAG,MAAM,CAAC;IAClD;;;SAGK;IACL,gBAAgB,CAAC,EAAE,QAAQ,CAAC,gBAAgB,GAAG,MAAM,CAAC;IACtD,oHAAoH;IACpH,iBAAiB,CAAC,EAAE,QAAQ,CAAC,iBAAiB,GAAG,MAAM,CAAC;IACxD;;;SAGK;IACL,eAAe,CAAC,EAAE,QAAQ,CAAC,eAAe,GAAG,MAAM,CAAC;IACpD;;;SAGK;IACL,sBAAsB,CAAC,EAAE,QAAQ,CAAC,sBAAsB,GAAG,MAAM,CAAC;IAClE;;;SAGK;IACL,oBAAoB,CAAC,EAAE,QAAQ,CAAC,oBAAoB,GAAG,MAAM,CAAC;CAC/D,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,aAAa,EAoCpD,CAAC;AAEF,eAAO,MAAM,cAAc,qCAA2C,CAAC"}
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.borderWidthFns = exports.borderWidthStyleFnConfigs = void 0;
4
+ var buildStyleFns_1 = require("../buildStyleFns");
5
+ exports.borderWidthStyleFnConfigs = [
6
+ {
7
+ name: 'borderWidth',
8
+ properties: ['borderWidth'],
9
+ system: 'none',
10
+ },
11
+ {
12
+ name: 'borderTopWidth',
13
+ properties: ['borderTopWidth'],
14
+ system: 'none',
15
+ },
16
+ {
17
+ name: 'borderRightWidth',
18
+ properties: ['borderRightWidth'],
19
+ system: 'none',
20
+ },
21
+ {
22
+ name: 'borderBottomWidth',
23
+ properties: ['borderBottomWidth'],
24
+ system: 'none',
25
+ },
26
+ {
27
+ name: 'borderLeftWidth',
28
+ properties: ['borderLeftWidth'],
29
+ system: 'none',
30
+ },
31
+ {
32
+ name: 'borderInlineStartWidth',
33
+ properties: ['borderInlineStartWidth'],
34
+ system: 'none',
35
+ },
36
+ {
37
+ name: 'borderInlineEndWidth',
38
+ properties: ['borderInlineEndWidth'],
39
+ system: 'none',
40
+ },
41
+ ];
42
+ exports.borderWidthFns = buildStyleFns_1.buildStyleFns(exports.borderWidthStyleFnConfigs);
@@ -0,0 +1,12 @@
1
+ import { SystemPropNames } from './systemProps';
2
+ export declare type StyleFnConfig = {
3
+ name: string;
4
+ properties: string[];
5
+ system: SystemPropNames | 'none';
6
+ };
7
+ export declare type StyleFns = {
8
+ [key: string]: (value: unknown) => {};
9
+ };
10
+ export declare function buildStyleFns(styleFnConfigs: StyleFnConfig[]): StyleFns;
11
+ export declare function buildStylePropFn<P extends {}>(styleFns: StyleFns): (props: P) => {};
12
+ //# sourceMappingURL=buildStyleFns.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildStyleFns.d.ts","sourceRoot":"","sources":["../../../../../layout/lib/utils/buildStyleFns.ts"],"names":[],"mappings":"AAQA,OAAO,EAAyB,eAAe,EAAmB,MAAM,eAAe,CAAC;AAExF,oBAAY,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,MAAM,EAAE,eAAe,GAAG,MAAM,CAAC;CAClC,CAAC;AAEF,oBAAY,QAAQ,GAAG;IACrB,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,KAAK,EAAE,OAAO,KAAK,EAAE,CAAC;CACvC,CAAC;AA8BF,wBAAgB,aAAa,CAAC,cAAc,EAAE,aAAa,EAAE,GAAG,QAAQ,CAoDvE;AAED,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,QAAQ,WAChD,CAAC,QAajB"}
@@ -0,0 +1,90 @@
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.buildStylePropFn = exports.buildStyleFns = void 0;
15
+ var tokens_1 = require("@workday/canvas-kit-react/tokens");
16
+ var getColor = function (value) {
17
+ return tokens_1.colors[value] || value;
18
+ };
19
+ var getDepth = function (value) {
20
+ return tokens_1.depth[value];
21
+ };
22
+ var getShape = function (value) {
23
+ return tokens_1.borderRadius[value] || value;
24
+ };
25
+ var getSpace = function (value) {
26
+ return tokens_1.space[value] || value;
27
+ };
28
+ var getFont = function (value) {
29
+ return tokens_1.type.properties.fontFamilies[value] || value;
30
+ };
31
+ var getFontSize = function (value) {
32
+ return tokens_1.type.properties.fontSizes[value] || value;
33
+ };
34
+ var getFontWeight = function (value) {
35
+ return tokens_1.type.properties.fontWeights[value] || value;
36
+ };
37
+ function buildStyleFns(styleFnConfigs) {
38
+ return styleFnConfigs.reduce(function (styleFns, styleFnConfig) {
39
+ var _a;
40
+ if (styleFns === void 0) { styleFns = {}; }
41
+ var styleFn = function (value) {
42
+ return styleFnConfig.properties.reduce(function (styles, property) {
43
+ var _a, _b, _c, _d, _e, _f, _g;
44
+ if (styles === void 0) { styles = {}; }
45
+ if (styleFnConfig.system === 'color') {
46
+ return __assign(__assign({}, styles), (_a = {}, _a[property] = getColor(value), _a));
47
+ }
48
+ if (styleFnConfig.system === 'depth') {
49
+ // Depth tokens return the style property (box-shadow) and the value
50
+ var depthStyle = getDepth(value);
51
+ return __assign(__assign({}, styles), depthStyle);
52
+ }
53
+ if (styleFnConfig.system === 'font') {
54
+ return __assign(__assign({}, styles), (_b = {}, _b[property] = getFont(value), _b));
55
+ }
56
+ if (styleFnConfig.system === 'fontSize') {
57
+ return __assign(__assign({}, styles), (_c = {}, _c[property] = getFontSize(value), _c));
58
+ }
59
+ if (styleFnConfig.system === 'fontWeight') {
60
+ return __assign(__assign({}, styles), (_d = {}, _d[property] = getFontWeight(value), _d));
61
+ }
62
+ if (styleFnConfig.system === 'shape') {
63
+ return __assign(__assign({}, styles), (_e = {}, _e[property] = getShape(value), _e));
64
+ }
65
+ if (styleFnConfig.system === 'space') {
66
+ return __assign(__assign({}, styles), (_f = {}, _f[property] = getSpace(value), _f));
67
+ }
68
+ return __assign(__assign({}, styles), (_g = {}, _g[property] = value, _g));
69
+ }, {});
70
+ };
71
+ return __assign(__assign({}, styleFns), (_a = {}, _a[styleFnConfig.name] = styleFn, _a));
72
+ }, {});
73
+ }
74
+ exports.buildStyleFns = buildStyleFns;
75
+ function buildStylePropFn(styleFns) {
76
+ return function (props) {
77
+ var styles = {};
78
+ for (var key in props) {
79
+ if (key in props && key in styleFns) {
80
+ var styleFn = styleFns[key];
81
+ var value = props[key];
82
+ var style = styleFn(value);
83
+ styles = __assign(__assign({}, styles), style);
84
+ continue;
85
+ }
86
+ }
87
+ return styles;
88
+ };
89
+ }
90
+ exports.buildStylePropFn = buildStylePropFn;