@workday/canvas-kit-react 8.0.0-alpha.144-next.0 → 8.0.0-alpha.151-next.3

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 (178) hide show
  1. package/banner/lib/Banner.tsx +3 -6
  2. package/card/lib/CardBody.tsx +3 -6
  3. package/card/lib/CardHeading.tsx +13 -10
  4. package/checkbox/index.ts +0 -1
  5. package/checkbox/lib/Checkbox.tsx +9 -24
  6. package/color-picker/index.ts +0 -1
  7. package/dist/commonjs/banner/lib/Banner.d.ts.map +1 -1
  8. package/dist/commonjs/banner/lib/Banner.js +2 -4
  9. package/dist/commonjs/card/lib/Card.d.ts +1 -1
  10. package/dist/commonjs/card/lib/CardBody.d.ts +1 -1
  11. package/dist/commonjs/card/lib/CardBody.d.ts.map +1 -1
  12. package/dist/commonjs/card/lib/CardBody.js +1 -6
  13. package/dist/commonjs/card/lib/CardHeading.d.ts.map +1 -1
  14. package/dist/commonjs/card/lib/CardHeading.js +2 -10
  15. package/dist/commonjs/checkbox/index.d.ts.map +1 -1
  16. package/dist/commonjs/checkbox/lib/Checkbox.d.ts.map +1 -1
  17. package/dist/commonjs/checkbox/lib/Checkbox.js +2 -13
  18. package/dist/commonjs/color-picker/index.d.ts.map +1 -1
  19. package/dist/commonjs/dialog/lib/Dialog.d.ts +1 -1
  20. package/dist/commonjs/form-field/index.d.ts.map +1 -1
  21. package/dist/commonjs/form-field/lib/Hint.d.ts.map +1 -1
  22. package/dist/commonjs/form-field/lib/Hint.js +5 -13
  23. package/dist/commonjs/index.d.ts +1 -0
  24. package/dist/commonjs/index.d.ts.map +1 -1
  25. package/dist/commonjs/index.js +1 -0
  26. package/dist/commonjs/layout/index.d.ts +4 -0
  27. package/dist/commonjs/layout/index.d.ts.map +1 -1
  28. package/dist/commonjs/layout/index.js +3 -0
  29. package/dist/commonjs/layout/lib/Box.d.ts +4 -2
  30. package/dist/commonjs/layout/lib/Box.d.ts.map +1 -1
  31. package/dist/commonjs/layout/lib/Box.js +27 -3
  32. package/dist/commonjs/layout/lib/Flex.d.ts +1 -1
  33. package/dist/commonjs/layout/lib/Flex.d.ts.map +1 -1
  34. package/dist/commonjs/layout/lib/Grid.d.ts +52 -0
  35. package/dist/commonjs/layout/lib/Grid.d.ts.map +1 -0
  36. package/dist/commonjs/layout/lib/Grid.js +117 -0
  37. package/dist/commonjs/layout/lib/Stack.d.ts +4 -4
  38. package/dist/commonjs/layout/lib/Stack.js +4 -4
  39. package/dist/commonjs/layout/lib/utils/color.d.ts.map +1 -1
  40. package/dist/commonjs/layout/lib/utils/color.js +1 -0
  41. package/dist/commonjs/layout/lib/utils/font.d.ts +29 -0
  42. package/dist/commonjs/layout/lib/utils/font.d.ts.map +1 -0
  43. package/dist/commonjs/layout/lib/utils/font.js +57 -0
  44. package/dist/commonjs/layout/lib/utils/grid.d.ts +58 -0
  45. package/dist/commonjs/layout/lib/utils/grid.d.ts.map +1 -0
  46. package/dist/commonjs/layout/lib/utils/grid.js +49 -0
  47. package/dist/commonjs/layout/lib/utils/gridItem.d.ts +39 -0
  48. package/dist/commonjs/layout/lib/utils/gridItem.d.ts.map +1 -0
  49. package/dist/commonjs/layout/lib/utils/gridItem.js +43 -0
  50. package/dist/commonjs/layout/lib/utils/text.d.ts +35 -0
  51. package/dist/commonjs/layout/lib/utils/text.d.ts.map +1 -0
  52. package/dist/commonjs/layout/lib/utils/text.js +48 -0
  53. package/dist/commonjs/modal/lib/Modal.d.ts +1 -1
  54. package/dist/commonjs/pagination/lib/Pagination/AdditionalDetails.d.ts.map +1 -1
  55. package/dist/commonjs/pagination/lib/Pagination/AdditionalDetails.js +5 -4
  56. package/dist/commonjs/pagination/lib/Pagination/GoTo/Label.d.ts.map +1 -1
  57. package/dist/commonjs/pagination/lib/Pagination/GoTo/Label.js +2 -4
  58. package/dist/commonjs/popup/lib/Popup.d.ts +1 -1
  59. package/dist/commonjs/popup/lib/PopupBody.d.ts +1 -1
  60. package/dist/commonjs/popup/lib/PopupCard.d.ts.map +1 -1
  61. package/dist/commonjs/popup/lib/PopupCard.js +2 -2
  62. package/dist/commonjs/radio/lib/Radio.d.ts.map +1 -1
  63. package/dist/commonjs/radio/lib/Radio.js +2 -13
  64. package/dist/commonjs/side-panel/lib/SidePanel.d.ts.map +1 -1
  65. package/dist/commonjs/side-panel/lib/SidePanel.js +2 -2
  66. package/dist/commonjs/tabs/lib/TabsItem.d.ts +1 -1
  67. package/dist/commonjs/text/index.d.ts +4 -0
  68. package/dist/commonjs/text/index.d.ts.map +1 -0
  69. package/dist/commonjs/text/index.js +15 -0
  70. package/dist/commonjs/text/lib/LabelText.d.ts +8 -0
  71. package/dist/commonjs/text/lib/LabelText.d.ts.map +1 -0
  72. package/dist/commonjs/text/lib/LabelText.js +51 -0
  73. package/dist/commonjs/text/lib/Text.d.ts +14 -0
  74. package/dist/commonjs/text/lib/Text.d.ts.map +1 -0
  75. package/dist/commonjs/text/lib/Text.js +90 -0
  76. package/dist/commonjs/text/lib/TypeLevelComponents.d.ts +13 -0
  77. package/dist/commonjs/text/lib/TypeLevelComponents.d.ts.map +1 -0
  78. package/dist/commonjs/text/lib/TypeLevelComponents.js +79 -0
  79. package/dist/commonjs/text-input/index.d.ts.map +1 -1
  80. package/dist/es6/banner/lib/Banner.d.ts.map +1 -1
  81. package/dist/es6/banner/lib/Banner.js +2 -4
  82. package/dist/es6/card/lib/Card.d.ts +1 -1
  83. package/dist/es6/card/lib/CardBody.d.ts +1 -1
  84. package/dist/es6/card/lib/CardBody.d.ts.map +1 -1
  85. package/dist/es6/card/lib/CardBody.js +1 -3
  86. package/dist/es6/card/lib/CardHeading.d.ts.map +1 -1
  87. package/dist/es6/card/lib/CardHeading.js +2 -7
  88. package/dist/es6/checkbox/index.d.ts.map +1 -1
  89. package/dist/es6/checkbox/lib/Checkbox.d.ts.map +1 -1
  90. package/dist/es6/checkbox/lib/Checkbox.js +3 -14
  91. package/dist/es6/color-picker/index.d.ts.map +1 -1
  92. package/dist/es6/dialog/lib/Dialog.d.ts +1 -1
  93. package/dist/es6/form-field/index.d.ts.map +1 -1
  94. package/dist/es6/form-field/lib/Hint.d.ts.map +1 -1
  95. package/dist/es6/form-field/lib/Hint.js +6 -14
  96. package/dist/es6/index.d.ts +1 -0
  97. package/dist/es6/index.d.ts.map +1 -1
  98. package/dist/es6/index.js +1 -0
  99. package/dist/es6/layout/index.d.ts +4 -0
  100. package/dist/es6/layout/index.d.ts.map +1 -1
  101. package/dist/es6/layout/index.js +3 -0
  102. package/dist/es6/layout/lib/Box.d.ts +4 -2
  103. package/dist/es6/layout/lib/Box.d.ts.map +1 -1
  104. package/dist/es6/layout/lib/Box.js +27 -3
  105. package/dist/es6/layout/lib/Flex.d.ts +1 -1
  106. package/dist/es6/layout/lib/Flex.d.ts.map +1 -1
  107. package/dist/es6/layout/lib/Grid.d.ts +52 -0
  108. package/dist/es6/layout/lib/Grid.d.ts.map +1 -0
  109. package/dist/es6/layout/lib/Grid.js +92 -0
  110. package/dist/es6/layout/lib/Stack.d.ts +4 -4
  111. package/dist/es6/layout/lib/Stack.js +4 -4
  112. package/dist/es6/layout/lib/utils/color.d.ts.map +1 -1
  113. package/dist/es6/layout/lib/utils/color.js +2 -1
  114. package/dist/es6/layout/lib/utils/font.d.ts +29 -0
  115. package/dist/es6/layout/lib/utils/font.d.ts.map +1 -0
  116. package/dist/es6/layout/lib/utils/font.js +53 -0
  117. package/dist/es6/layout/lib/utils/grid.d.ts +58 -0
  118. package/dist/es6/layout/lib/utils/grid.d.ts.map +1 -0
  119. package/dist/es6/layout/lib/utils/grid.js +45 -0
  120. package/dist/es6/layout/lib/utils/gridItem.d.ts +39 -0
  121. package/dist/es6/layout/lib/utils/gridItem.d.ts.map +1 -0
  122. package/dist/es6/layout/lib/utils/gridItem.js +39 -0
  123. package/dist/es6/layout/lib/utils/text.d.ts +35 -0
  124. package/dist/es6/layout/lib/utils/text.d.ts.map +1 -0
  125. package/dist/es6/layout/lib/utils/text.js +44 -0
  126. package/dist/es6/modal/lib/Modal.d.ts +1 -1
  127. package/dist/es6/pagination/lib/Pagination/AdditionalDetails.d.ts.map +1 -1
  128. package/dist/es6/pagination/lib/Pagination/AdditionalDetails.js +6 -5
  129. package/dist/es6/pagination/lib/Pagination/GoTo/Label.d.ts.map +1 -1
  130. package/dist/es6/pagination/lib/Pagination/GoTo/Label.js +2 -4
  131. package/dist/es6/popup/lib/Popup.d.ts +1 -1
  132. package/dist/es6/popup/lib/PopupBody.d.ts +1 -1
  133. package/dist/es6/popup/lib/PopupCard.d.ts.map +1 -1
  134. package/dist/es6/popup/lib/PopupCard.js +2 -2
  135. package/dist/es6/radio/lib/Radio.d.ts.map +1 -1
  136. package/dist/es6/radio/lib/Radio.js +3 -14
  137. package/dist/es6/side-panel/lib/SidePanel.d.ts.map +1 -1
  138. package/dist/es6/side-panel/lib/SidePanel.js +3 -3
  139. package/dist/es6/tabs/lib/TabsItem.d.ts +1 -1
  140. package/dist/es6/text/index.d.ts +4 -0
  141. package/dist/es6/text/index.d.ts.map +1 -0
  142. package/dist/es6/text/index.js +3 -0
  143. package/dist/es6/text/lib/LabelText.d.ts +8 -0
  144. package/dist/es6/text/lib/LabelText.d.ts.map +1 -0
  145. package/dist/es6/text/lib/LabelText.js +29 -0
  146. package/dist/es6/text/lib/Text.d.ts +14 -0
  147. package/dist/es6/text/lib/Text.d.ts.map +1 -0
  148. package/dist/es6/text/lib/Text.js +68 -0
  149. package/dist/es6/text/lib/TypeLevelComponents.d.ts +13 -0
  150. package/dist/es6/text/lib/TypeLevelComponents.d.ts.map +1 -0
  151. package/dist/es6/text/lib/TypeLevelComponents.js +57 -0
  152. package/dist/es6/text-input/index.d.ts.map +1 -1
  153. package/form-field/index.ts +0 -1
  154. package/form-field/lib/Hint.tsx +8 -19
  155. package/index.ts +1 -0
  156. package/layout/index.ts +4 -0
  157. package/layout/lib/Box.tsx +34 -4
  158. package/layout/lib/Grid.tsx +88 -0
  159. package/layout/lib/Stack.tsx +4 -4
  160. package/layout/lib/utils/color.ts +7 -2
  161. package/layout/lib/utils/font.ts +67 -0
  162. package/layout/lib/utils/grid.ts +93 -0
  163. package/layout/lib/utils/gridItem.ts +68 -0
  164. package/layout/lib/utils/text.ts +57 -0
  165. package/package.json +5 -5
  166. package/pagination/lib/Pagination/AdditionalDetails.tsx +7 -8
  167. package/pagination/lib/Pagination/GoTo/Label.tsx +3 -11
  168. package/popup/lib/PopupCard.tsx +2 -1
  169. package/radio/lib/Radio.tsx +9 -24
  170. package/side-panel/lib/SidePanel.tsx +7 -7
  171. package/text/LICENSE +52 -0
  172. package/text/README.md +5 -0
  173. package/text/index.ts +3 -0
  174. package/text/lib/LabelText.tsx +25 -0
  175. package/text/lib/Text.tsx +66 -0
  176. package/text/lib/TypeLevelComponents.tsx +43 -0
  177. package/text/package.json +6 -0
  178. package/text-input/index.ts +0 -1
@@ -22,9 +22,10 @@ var __rest = (this && this.__rest) || function (s, e) {
22
22
  };
23
23
  import * as React from 'react';
24
24
  import { createComponent, ErrorType, useUniqueId, focusRing, mouseFocusBehavior, getErrorColors, styled, useTheme, } from '@workday/canvas-kit-react/common';
25
- import { canvas, borderRadius, colors, inputColors, spaceNumbers, } from '@workday/canvas-kit-react/tokens';
25
+ import { borderRadius, colors, inputColors, spaceNumbers } from '@workday/canvas-kit-react/tokens';
26
26
  import { SystemIcon } from '@workday/canvas-kit-react/icon';
27
27
  import { checkSmallIcon } from '@workday/canvas-system-icons-web';
28
+ import { LabelText } from '@workday/canvas-kit-react/text';
28
29
  var checkboxHeight = 18;
29
30
  var checkboxTapArea = spaceNumbers.m;
30
31
  var checkboxContainerHeight = checkboxTapArea;
@@ -209,18 +210,6 @@ var IndeterminateBox = styled('div')({
209
210
  : theme.canvas.palette.primary.contrast,
210
211
  });
211
212
  });
212
- var CheckboxLabel = styled('label')(__assign(__assign({}, canvas.type.levels.subtext.large), { paddingLeft: checkboxLabelDistance }), function (_a) {
213
- var variant = _a.variant;
214
- return (variant === 'inverse' ? { color: colors.frenchVanilla100 } : undefined);
215
- }, function (_a) {
216
- var disabled = _a.disabled, variant = _a.variant;
217
- return disabled
218
- ? {
219
- color: variant === 'inverse' ? colors.frenchVanilla100 : inputColors.disabled.text,
220
- opacity: variant === 'inverse' ? '.4' : '1',
221
- }
222
- : { cursor: 'pointer' };
223
- });
224
213
  export var Checkbox = createComponent('input')({
225
214
  displayName: 'Checkbox',
226
215
  Component: function (_a, ref, Element) {
@@ -240,7 +229,7 @@ export var Checkbox = createComponent('input')({
240
229
  React.createElement(CheckboxCheck, { checked: checked }, indeterminate ? (React.createElement(IndeterminateBox, { variant: variant })) : (React.createElement(SystemIcon, { icon: checkSmallIcon, color: variant === 'inverse'
241
230
  ? theme.canvas.palette.primary.main
242
231
  : theme.canvas.palette.primary.contrast }))))),
243
- label && (React.createElement(CheckboxLabel, { variant: variant, htmlFor: inputId, disabled: disabled }, label))));
232
+ label && (React.createElement(LabelText, { htmlFor: inputId, disabled: disabled, variant: variant, paddingLeft: checkboxLabelDistance }, label))));
244
233
  },
245
234
  subComponents: {
246
235
  ErrorType: ErrorType,
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../color-picker/index.ts"],"names":[],"mappings":"AACA,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../color-picker/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC"}
@@ -88,7 +88,7 @@ export declare const Dialog: import("../../common").ComponentM<DialogProps & Par
88
88
  hide(event?: Event | React.SyntheticEvent<Element, Event> | undefined): void;
89
89
  };
90
90
  }> & {
91
- Body: import("../../common").ElementComponentM<"div", import("../..").BorderShorthandStyleProps & import("../..").BorderColorStyleProps & import("../..").BorderRadiusStyleProps & import("../..").BorderLineStyleProps & import("../..").BorderWidthStyleProps & import("../..").BorderLogicalStyleProps & import("../..").ColorStyleProps & import("../..").DepthStyleProps & import("../..").FlexItemStyleProps & import("../..").LayoutStyleProps & import("../../layout/lib/utils/other").OtherStyleProps & import("../..").PositionStandardProps & import("../..").PositionLogicalProps & import("../../layout/lib/utils/space").SpaceStandardProps & import("../../layout/lib/utils/space").SpaceLogicalProps & React.HTMLAttributes<HTMLDivElement>, {
91
+ Body: import("../../common").ElementComponentM<"div", import("../..").BorderShorthandStyleProps & import("../..").BorderColorStyleProps & import("../..").BorderRadiusStyleProps & import("../..").BorderLineStyleProps & import("../..").BorderWidthStyleProps & import("../..").BorderLogicalStyleProps & import("../..").ColorStyleProps & import("../..").DepthStyleProps & import("../..").FlexItemStyleProps & import("../..").FontStyleProps & import("../..").LayoutStyleProps & import("../../layout/lib/utils/other").OtherStyleProps & import("../..").PositionStandardProps & import("../..").PositionLogicalProps & import("../../layout/lib/utils/space").SpaceStandardProps & import("../../layout/lib/utils/space").SpaceLogicalProps & import("../..").TextStyleProps & React.HTMLAttributes<HTMLDivElement>, {
92
92
  state: {
93
93
  stackRef: React.RefObject<HTMLDivElement>;
94
94
  targetRef: React.RefObject<HTMLButtonElement>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../form-field/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../form-field/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Hint.d.ts","sourceRoot":"","sources":["../../../../form-field/lib/Hint.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAC,SAAS,EAAU,SAAS,EAAC,MAAM,kCAAkC,CAAC;AAG9E,MAAM,WAAW,SAAU,SAAQ,SAAS,EAAE,KAAK,CAAC,cAAc,CAAC,oBAAoB,CAAC;IACtF;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAmBD,cAAM,IAAK,SAAQ,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC;IAC3C,MAAM,CAAC,SAAS,mBAAa;IAEtB,MAAM;CAqBd;AAID,OAAO,EAAC,IAAI,EAAC,CAAC"}
1
+ {"version":3,"file":"Hint.d.ts","sourceRoot":"","sources":["../../../../form-field/lib/Hint.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAC,SAAS,EAAE,SAAS,EAAS,MAAM,kCAAkC,CAAC;AAI9E,MAAM,WAAW,SAAU,SAAQ,SAAS,EAAE,KAAK,CAAC,cAAc,CAAC,oBAAoB,CAAC;IACtF;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAMD,cAAM,IAAK,SAAQ,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC;IAC3C,MAAM,CAAC,SAAS,mBAAa;IAEtB,MAAM;CAsBd;AAID,OAAO,EAAC,IAAI,EAAC,CAAC"}
@@ -24,17 +24,9 @@ var __assign = (this && this.__assign) || function () {
24
24
  };
25
25
  import * as React from 'react';
26
26
  import { ErrorType, styled } from '@workday/canvas-kit-react/common';
27
- import { space, type } from '@workday/canvas-kit-react/tokens';
28
- var Label = styled('span')(type.levels.subtext.medium, {
29
- fontWeight: type.properties.fontWeights.medium,
30
- }, function (_a) {
31
- var error = _a.error, theme = _a.theme;
32
- return error === ErrorType.Error && { color: theme.canvas.palette.error.main };
33
- });
34
- var Message = styled('p')(type.levels.subtext.medium, {
35
- margin: space.xxs + " 0 0",
36
- width: '100%',
37
- }, function (_a) {
27
+ import { space } from '@workday/canvas-kit-react/tokens';
28
+ import { Subtext, Text } from '@workday/canvas-kit-react/text';
29
+ var Message = styled(Subtext)(function (_a) {
38
30
  var error = _a.error, theme = _a.theme;
39
31
  return error === ErrorType.Error && { color: theme.canvas.palette.error.main };
40
32
  });
@@ -55,10 +47,10 @@ var Hint = /** @class */ (function (_super) {
55
47
  break;
56
48
  default:
57
49
  }
58
- return (React.createElement(Message, __assign({}, this.props),
59
- typeof error !== 'undefined' && hintLabel && React.createElement(Label, { error: error },
50
+ return (React.createElement(Message, __assign({ size: "medium", margin: space.xxs + " 0 0", width: "100%" }, this.props),
51
+ typeof error !== 'undefined' && hintLabel && (React.createElement(Text, { fontWeight: "medium" },
60
52
  hintLabel,
61
- ": "),
53
+ ": ")),
62
54
  children));
63
55
  };
64
56
  Hint.ErrorType = ErrorType;
@@ -27,6 +27,7 @@ export * from './status-indicator';
27
27
  export * from './switch';
28
28
  export * from './table';
29
29
  export * from './tabs';
30
+ export * from './text';
30
31
  export * from './text-area';
31
32
  export * from './text-input';
32
33
  export * from './toast';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,qBAAqB,CAAC;AACpC,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,qBAAqB,CAAC;AACpC,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,qBAAqB,CAAC;AACpC,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,qBAAqB,CAAC;AACpC,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC"}
package/dist/es6/index.js CHANGED
@@ -27,6 +27,7 @@ export * from './status-indicator';
27
27
  export * from './switch';
28
28
  export * from './table';
29
29
  export * from './tabs';
30
+ export * from './text';
30
31
  export * from './text-area';
31
32
  export * from './text-input';
32
33
  export * from './toast';
@@ -6,11 +6,15 @@ export * from './lib/utils/border';
6
6
  export * from './lib/utils/color';
7
7
  export { DepthStyleProps } from './lib/utils/depth';
8
8
  export * from './lib/utils/flexItem';
9
+ export * from './lib/utils/font';
9
10
  export * from './lib/utils/layout';
10
11
  export * from './lib/utils/position';
11
12
  export { SpaceStyleProps } from './lib/utils/space';
13
+ export * from './lib/utils/text';
12
14
  export * from './lib/Flex';
15
+ export * from './lib/Grid';
13
16
  export * from './lib/Stack';
14
17
  export type { FlexStyleProps } from './lib/utils/flex';
18
+ export type { GridStyleProps } from './lib/utils/grid';
15
19
  export type { StackSpacing, StackDirection, StackStyleProps } from './lib/utils/stack';
16
20
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../layout/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AACpC,OAAO,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AAEpC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAC,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAClD,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAClD,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
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../layout/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AACpC,OAAO,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AAEpC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAC,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAClD,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAClD,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
@@ -5,7 +5,10 @@ export * from './lib/Box';
5
5
  export * from './lib/utils/border';
6
6
  export * from './lib/utils/color';
7
7
  export * from './lib/utils/flexItem';
8
+ export * from './lib/utils/font';
8
9
  export * from './lib/utils/layout';
9
10
  export * from './lib/utils/position';
11
+ export * from './lib/utils/text';
10
12
  export * from './lib/Flex';
13
+ export * from './lib/Grid';
11
14
  export * from './lib/Stack';
@@ -3,11 +3,13 @@ import { BorderStyleProps } from './utils/border';
3
3
  import { ColorStyleProps } from './utils/color';
4
4
  import { DepthStyleProps } from './utils/depth';
5
5
  import { FlexItemStyleProps } from './utils/flexItem';
6
+ import { FontStyleProps } from './utils/font';
6
7
  import { LayoutStyleProps } from './utils/layout';
7
8
  import { OtherStyleProps } from './utils/other';
8
9
  import { PositionStyleProps } from './utils/position';
9
10
  import { SpaceStyleProps } from './utils/space';
10
- export declare type BoxProps = BorderStyleProps & ColorStyleProps & DepthStyleProps & FlexItemStyleProps & LayoutStyleProps & OtherStyleProps & PositionStyleProps & SpaceStyleProps & {
11
+ import { TextStyleProps } from './utils/text';
12
+ export declare type BoxProps = BorderStyleProps & ColorStyleProps & DepthStyleProps & FlexItemStyleProps & FontStyleProps & LayoutStyleProps & OtherStyleProps & PositionStyleProps & SpaceStyleProps & TextStyleProps & {
11
13
  children?: React.ReactNode;
12
14
  };
13
15
  /**
@@ -44,5 +46,5 @@ export declare const boxStyleFn: <P extends BoxProps>(props: P) => {};
44
46
  * );
45
47
  *
46
48
  */
47
- export declare const Box: import("../../common").ElementComponent<"div", import("./utils/border").BorderShorthandStyleProps & import("./utils/border").BorderColorStyleProps & import("./utils/border").BorderRadiusStyleProps & import("./utils/border").BorderLineStyleProps & import("./utils/border").BorderWidthStyleProps & import("./utils/border").BorderLogicalStyleProps & ColorStyleProps & DepthStyleProps & FlexItemStyleProps & LayoutStyleProps & OtherStyleProps & import("./utils/position").PositionStandardProps & import("./utils/position").PositionLogicalProps & import("./utils/space").SpaceStandardProps & import("./utils/space").SpaceLogicalProps>;
49
+ export declare const Box: import("../../common").ElementComponent<"div", import("./utils/border").BorderShorthandStyleProps & import("./utils/border").BorderColorStyleProps & import("./utils/border").BorderRadiusStyleProps & import("./utils/border").BorderLineStyleProps & import("./utils/border").BorderWidthStyleProps & import("./utils/border").BorderLogicalStyleProps & ColorStyleProps & DepthStyleProps & FlexItemStyleProps & FontStyleProps & LayoutStyleProps & OtherStyleProps & import("./utils/position").PositionStandardProps & import("./utils/position").PositionLogicalProps & import("./utils/space").SpaceStandardProps & import("./utils/space").SpaceLogicalProps & TextStyleProps>;
48
50
  //# sourceMappingURL=Box.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Box.d.ts","sourceRoot":"","sources":["../../../../layout/lib/Box.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,EAAS,gBAAgB,EAAC,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAQ,eAAe,EAAC,MAAM,eAAe,CAAC;AACrD,OAAO,EAAQ,eAAe,EAAC,MAAM,eAAe,CAAC;AACrD,OAAO,EAAW,kBAAkB,EAAC,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAS,gBAAgB,EAAC,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAQ,eAAe,EAAC,MAAM,eAAe,CAAC;AACrD,OAAO,EAAW,kBAAkB,EAAC,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAQ,eAAe,EAAC,MAAM,eAAe,CAAC;AAErD,oBAAY,QAAQ,GAAG,gBAAgB,GACrC,eAAe,GACf,eAAe,GACf,kBAAkB,GAClB,gBAAgB,GAChB,eAAe,GACf,kBAAkB,GAClB,eAAe,GAAG;IAChB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;AAQJ;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,UAAU,sCAsBtB,CAAC;AA+BF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,GAAG,unBAad,CAAC"}
1
+ {"version":3,"file":"Box.d.ts","sourceRoot":"","sources":["../../../../layout/lib/Box.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,EAAS,gBAAgB,EAAC,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAQ,eAAe,EAAC,MAAM,eAAe,CAAC;AACrD,OAAO,EAAQ,eAAe,EAAC,MAAM,eAAe,CAAC;AACrD,OAAO,EAAW,kBAAkB,EAAC,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAO,cAAc,EAAC,MAAM,cAAc,CAAC;AAClD,OAAO,EAAS,gBAAgB,EAAC,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAQ,eAAe,EAAC,MAAM,eAAe,CAAC;AACrD,OAAO,EAAW,kBAAkB,EAAC,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAQ,eAAe,EAAC,MAAM,eAAe,CAAC;AACrD,OAAO,EAAO,cAAc,EAAC,MAAM,cAAc,CAAC;AAElD,oBAAY,QAAQ,GAAG,gBAAgB,GACrC,eAAe,GACf,eAAe,GACf,kBAAkB,GAClB,cAAc,GACd,gBAAgB,GAChB,eAAe,GACf,kBAAkB,GAClB,eAAe,GACf,cAAc,GAAG;IACf,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;AA4BJ;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,UAAU,sCAwBtB,CAAC;AAmCF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,GAAG,ypBAad,CAAC"}
@@ -29,11 +29,33 @@ import { border } from './utils/border';
29
29
  import { color } from './utils/color';
30
30
  import { depth } from './utils/depth';
31
31
  import { flexItem } from './utils/flexItem';
32
+ import { font } from './utils/font';
32
33
  import { layout } from './utils/layout';
33
34
  import { other } from './utils/other';
34
35
  import { position } from './utils/position';
35
36
  import { space } from './utils/space';
36
- var omittedProps = ['display', 'color', 'height', 'overflow', 'width', 'border', 'background'];
37
+ import { text } from './utils/text';
38
+ var omittedProps = [
39
+ 'display',
40
+ 'color',
41
+ 'height',
42
+ 'overflow',
43
+ 'width',
44
+ 'border',
45
+ 'background',
46
+ 'fontSize',
47
+ 'fontWeight',
48
+ 'fontFamily',
49
+ 'letterSpacing',
50
+ 'lineHeight',
51
+ 'textAlign',
52
+ 'textDecoration',
53
+ 'textOverflow',
54
+ 'textTransform',
55
+ 'textShadow',
56
+ 'whiteSpace',
57
+ 'wordBreak',
58
+ ];
37
59
  var shouldForwardProp = function (prop) {
38
60
  return isPropValid(prop) && !omittedProps.includes(prop);
39
61
  };
@@ -62,9 +84,11 @@ export var boxStyleFn = function (props) {
62
84
  color,
63
85
  depth,
64
86
  flexItem,
87
+ font,
65
88
  layout,
66
89
  position,
67
90
  space,
91
+ text,
68
92
  ].reduce(function (result, style) {
69
93
  // @ts-ignore
70
94
  var temp = typeof style === 'function' ? style(props) : style;
@@ -79,11 +103,11 @@ export var boxStyleFn = function (props) {
79
103
  // Meant to be used with elements. The `shouldForwardProps` will remove all style props
80
104
  var StyledBoxElement = styled('div', { shouldForwardProp: shouldForwardProp })({
81
105
  boxSizing: 'border-box',
82
- }, border, color, depth, flexItem, layout, position, space);
106
+ }, border, color, depth, flexItem, font, layout, position, space, text);
83
107
  // Meant to be used with components. There is no `shouldForwardProps` - all props will be forwarded to the component
84
108
  var StyledBoxComponent = styled('div')({
85
109
  boxSizing: 'border-box',
86
- }, border, color, depth, flexItem, layout, other, position, space);
110
+ }, border, color, depth, flexItem, font, layout, other, position, space, text);
87
111
  /**
88
112
  * `Box` is a primitive component that provides a common, ergonomic API around Canvas design tokens.
89
113
  * It is highly flexible, and its primary purpose is to build other components.
@@ -22,5 +22,5 @@ export declare type FlexProps = BoxProps & FlexStyleProps;
22
22
  * );
23
23
  *
24
24
  */
25
- export declare const Flex: import("../../common").ElementComponent<"div", import("..").BorderShorthandStyleProps & import("..").BorderColorStyleProps & import("..").BorderRadiusStyleProps & import("..").BorderLineStyleProps & import("..").BorderWidthStyleProps & import("..").BorderLogicalStyleProps & import("..").ColorStyleProps & import("..").DepthStyleProps & import("..").FlexItemStyleProps & import("..").LayoutStyleProps & import("./utils/other").OtherStyleProps & import("..").PositionStandardProps & import("..").PositionLogicalProps & import("./utils/space").SpaceStandardProps & import("./utils/space").SpaceLogicalProps & FlexStyleProps>;
25
+ export declare const Flex: import("../../common").ElementComponent<"div", import("..").BorderShorthandStyleProps & import("..").BorderColorStyleProps & import("..").BorderRadiusStyleProps & import("..").BorderLineStyleProps & import("..").BorderWidthStyleProps & import("..").BorderLogicalStyleProps & import("..").ColorStyleProps & import("..").DepthStyleProps & import("..").FlexItemStyleProps & import("..").FontStyleProps & import("..").LayoutStyleProps & import("./utils/other").OtherStyleProps & import("..").PositionStandardProps & import("..").PositionLogicalProps & import("./utils/space").SpaceStandardProps & import("./utils/space").SpaceLogicalProps & import("..").TextStyleProps & FlexStyleProps>;
26
26
  //# sourceMappingURL=Flex.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Flex.d.ts","sourceRoot":"","sources":["../../../../layout/lib/Flex.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAM,QAAQ,EAAC,MAAM,OAAO,CAAC;AAEpC,OAAO,EAAO,cAAc,EAAC,MAAM,cAAc,CAAC;AAElD,oBAAY,SAAS,GAAG,QAAQ,GAAG,cAAc,CAAC;AASlD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,IAAI,gnBASf,CAAC"}
1
+ {"version":3,"file":"Flex.d.ts","sourceRoot":"","sources":["../../../../layout/lib/Flex.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAM,QAAQ,EAAC,MAAM,OAAO,CAAC;AAEpC,OAAO,EAAO,cAAc,EAAC,MAAM,cAAc,CAAC;AAElD,oBAAY,SAAS,GAAG,QAAQ,GAAG,cAAc,CAAC;AASlD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,IAAI,4qBASf,CAAC"}
@@ -0,0 +1,52 @@
1
+ import { BoxProps } from './Box';
2
+ import { GridStyleProps } from './utils/grid';
3
+ import { GridItemStyleProps } from './utils/gridItem';
4
+ export declare type GridProps = BoxProps & GridStyleProps;
5
+ export declare type GridItemProps = BoxProps & GridItemStyleProps;
6
+ /**
7
+ * `Grid` is a two-dimensional layout system for the web. It lets you lay content out in rows and columns.
8
+ * It is highly flexible, and can be used on its own or to build other components.
9
+ *
10
+ * @example
11
+ * ```
12
+ * import { Grid } from '@workday/canvas-kit-react/layout';
13
+ * `Grid` is built on top of `Box` and has access to all `BoxProps`.
14
+ *
15
+ * interface CardProps extends GridProps {
16
+ * // card-specific props
17
+ * }
18
+ *
19
+ * // `Card`'s default values are set using `GridProps`
20
+ * const Card = (props: CardProps) => (
21
+ * <Grid gridAutoFlow="row" alignItems="start" depth={1} space="m" {...props}>
22
+ * <h1>Hello, Card!</h1>
23
+ * <p>This card uses grid to set its layout.</p>
24
+ * </Grid>
25
+ * );
26
+ *```
27
+ */
28
+ export declare const Grid: import("../../common").ElementComponent<"div", import("..").BorderShorthandStyleProps & import("..").BorderColorStyleProps & import("..").BorderRadiusStyleProps & import("..").BorderLineStyleProps & import("..").BorderWidthStyleProps & import("..").BorderLogicalStyleProps & import("..").ColorStyleProps & import("..").DepthStyleProps & import("..").FlexItemStyleProps & import("..").FontStyleProps & import("..").LayoutStyleProps & import("./utils/other").OtherStyleProps & import("..").PositionStandardProps & import("..").PositionLogicalProps & import("./utils/space").SpaceStandardProps & import("./utils/space").SpaceLogicalProps & import("..").TextStyleProps & GridStyleProps> & {
29
+ /**
30
+ * `<Grid.Item />` is the child specific sub-component to `<Grid/>`. `<Grid.Item />` gets child specific props, whereas `<Grid./>` gets parent container props.
31
+ *
32
+ * @example
33
+ * ```
34
+ * import { Grid } from '@workday/canvas-kit-react/layout';
35
+ * `Grid` is built on top of `Box` so `<Grid.Item />` gets all `BoxProps` as well.
36
+ *
37
+ * interface CardProps extends GridItemStyleProps {
38
+ * // card-specific props
39
+ * }
40
+ *
41
+ * // `Card`'s default values are set using `GridItemStyleProps`
42
+ * const Card = (props: CardProps) => (
43
+ * <Grid.Item gridRowStart="1" gridArea="Card" {...props}>
44
+ * <h1>Hello, Card!</h1>
45
+ * <p>This card uses grid child specific props to set its layout.</p>
46
+ * </Grid.Item>
47
+ * );
48
+ *```
49
+ */
50
+ Item: import("../../common").ElementComponent<"div", import("..").BorderShorthandStyleProps & import("..").BorderColorStyleProps & import("..").BorderRadiusStyleProps & import("..").BorderLineStyleProps & import("..").BorderWidthStyleProps & import("..").BorderLogicalStyleProps & import("..").ColorStyleProps & import("..").DepthStyleProps & import("..").FlexItemStyleProps & import("..").FontStyleProps & import("..").LayoutStyleProps & import("./utils/other").OtherStyleProps & import("..").PositionStandardProps & import("..").PositionLogicalProps & import("./utils/space").SpaceStandardProps & import("./utils/space").SpaceLogicalProps & import("..").TextStyleProps & GridItemStyleProps>;
51
+ };
52
+ //# sourceMappingURL=Grid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Grid.d.ts","sourceRoot":"","sources":["../../../../layout/lib/Grid.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAM,QAAQ,EAAC,MAAM,OAAO,CAAC;AAEpC,OAAO,EAAO,cAAc,EAAC,MAAM,cAAc,CAAC;AAClD,OAAO,EAAW,kBAAkB,EAAC,MAAM,kBAAkB,CAAC;AAE9D,oBAAY,SAAS,GAAG,QAAQ,GAAG,cAAc,CAAC;AAClD,oBAAY,aAAa,GAAG,QAAQ,GAAG,kBAAkB,CAAC;AAsB1D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,IAAI;IAUb;;;;;;;;;;;;;;;;;;;;OAoBG;;CAIL,CAAC"}
@@ -0,0 +1,92 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import * as React from 'react';
24
+ import styled from '@emotion/styled';
25
+ import { createComponent } from '@workday/canvas-kit-react/common';
26
+ import { Box } from './Box';
27
+ import { grid } from './utils/grid';
28
+ import { gridItem } from './utils/gridItem';
29
+ var StyledGrid = styled(Box)({
30
+ display: 'grid',
31
+ }, grid);
32
+ var StyledGridItem = styled(Box)(gridItem);
33
+ var GridItem = createComponent('div')({
34
+ displayName: 'Grid.Item',
35
+ Component: function (_a, ref, Element) {
36
+ var children = _a.children, elemProps = __rest(_a, ["children"]);
37
+ return (React.createElement(StyledGridItem, __assign({ as: Element, ref: ref }, elemProps), children));
38
+ },
39
+ });
40
+ /**
41
+ * `Grid` is a two-dimensional layout system for the web. It lets you lay content out in rows and columns.
42
+ * It is highly flexible, and can be used on its own or to build other components.
43
+ *
44
+ * @example
45
+ * ```
46
+ * import { Grid } from '@workday/canvas-kit-react/layout';
47
+ * `Grid` is built on top of `Box` and has access to all `BoxProps`.
48
+ *
49
+ * interface CardProps extends GridProps {
50
+ * // card-specific props
51
+ * }
52
+ *
53
+ * // `Card`'s default values are set using `GridProps`
54
+ * const Card = (props: CardProps) => (
55
+ * <Grid gridAutoFlow="row" alignItems="start" depth={1} space="m" {...props}>
56
+ * <h1>Hello, Card!</h1>
57
+ * <p>This card uses grid to set its layout.</p>
58
+ * </Grid>
59
+ * );
60
+ *```
61
+ */
62
+ export var Grid = createComponent('div')({
63
+ displayName: 'Grid',
64
+ Component: function (_a, ref, Element) {
65
+ var children = _a.children, elemProps = __rest(_a, ["children"]);
66
+ return (React.createElement(StyledGrid, __assign({ as: Element, ref: ref }, elemProps), children));
67
+ },
68
+ subComponents: {
69
+ /**
70
+ * `<Grid.Item />` is the child specific sub-component to `<Grid/>`. `<Grid.Item />` gets child specific props, whereas `<Grid./>` gets parent container props.
71
+ *
72
+ * @example
73
+ * ```
74
+ * import { Grid } from '@workday/canvas-kit-react/layout';
75
+ * `Grid` is built on top of `Box` so `<Grid.Item />` gets all `BoxProps` as well.
76
+ *
77
+ * interface CardProps extends GridItemStyleProps {
78
+ * // card-specific props
79
+ * }
80
+ *
81
+ * // `Card`'s default values are set using `GridItemStyleProps`
82
+ * const Card = (props: CardProps) => (
83
+ * <Grid.Item gridRowStart="1" gridArea="Card" {...props}>
84
+ * <h1>Hello, Card!</h1>
85
+ * <p>This card uses grid child specific props to set its layout.</p>
86
+ * </Grid.Item>
87
+ * );
88
+ *```
89
+ */
90
+ Item: GridItem,
91
+ },
92
+ });
@@ -1,8 +1,8 @@
1
1
  import { FlexProps } from './Flex';
2
2
  import { StackStyleProps } from './utils/stack';
3
3
  export declare type StackProps = FlexProps & StackStyleProps;
4
- export declare const Stack: import("../../common").ElementComponent<"div", import("..").BorderShorthandStyleProps & import("..").BorderColorStyleProps & import("..").BorderRadiusStyleProps & import("..").BorderLineStyleProps & import("..").BorderWidthStyleProps & import("..").BorderLogicalStyleProps & import("..").ColorStyleProps & import("..").DepthStyleProps & import("..").FlexItemStyleProps & import("..").LayoutStyleProps & import("./utils/other").OtherStyleProps & import("..").PositionStandardProps & import("..").PositionLogicalProps & import("./utils/space").SpaceStandardProps & import("./utils/space").SpaceLogicalProps & import("..").FlexStyleProps & StackStyleProps> & {
5
- Item: import("../../common").ElementComponent<"div", import("..").BorderShorthandStyleProps & import("..").BorderColorStyleProps & import("..").BorderRadiusStyleProps & import("..").BorderLineStyleProps & import("..").BorderWidthStyleProps & import("..").BorderLogicalStyleProps & import("..").ColorStyleProps & import("..").DepthStyleProps & import("..").FlexItemStyleProps & import("..").LayoutStyleProps & import("./utils/other").OtherStyleProps & import("..").PositionStandardProps & import("..").PositionLogicalProps & import("./utils/space").SpaceStandardProps & import("./utils/space").SpaceLogicalProps>;
4
+ export declare const Stack: import("../../common").ElementComponent<"div", import("..").BorderShorthandStyleProps & import("..").BorderColorStyleProps & import("..").BorderRadiusStyleProps & import("..").BorderLineStyleProps & import("..").BorderWidthStyleProps & import("..").BorderLogicalStyleProps & import("..").ColorStyleProps & import("..").DepthStyleProps & import("..").FlexItemStyleProps & import("..").FontStyleProps & import("..").LayoutStyleProps & import("./utils/other").OtherStyleProps & import("..").PositionStandardProps & import("..").PositionLogicalProps & import("./utils/space").SpaceStandardProps & import("./utils/space").SpaceLogicalProps & import("..").TextStyleProps & import("..").FlexStyleProps & StackStyleProps> & {
5
+ Item: import("../../common").ElementComponent<"div", import("..").BorderShorthandStyleProps & import("..").BorderColorStyleProps & import("..").BorderRadiusStyleProps & import("..").BorderLineStyleProps & import("..").BorderWidthStyleProps & import("..").BorderLogicalStyleProps & import("..").ColorStyleProps & import("..").DepthStyleProps & import("..").FlexItemStyleProps & import("..").FontStyleProps & import("..").LayoutStyleProps & import("./utils/other").OtherStyleProps & import("..").PositionStandardProps & import("..").PositionLogicalProps & import("./utils/space").SpaceStandardProps & import("./utils/space").SpaceLogicalProps & import("..").TextStyleProps>;
6
6
  };
7
7
  export interface HStackProps extends StackProps {
8
8
  /**
@@ -12,7 +12,7 @@ export interface HStackProps extends StackProps {
12
12
  flexDirection?: 'row' | 'row-reverse';
13
13
  }
14
14
  export declare const HStack: import("../../common").ElementComponent<"div", HStackProps> & {
15
- Item: import("../../common").ElementComponent<"div", import("..").BorderShorthandStyleProps & import("..").BorderColorStyleProps & import("..").BorderRadiusStyleProps & import("..").BorderLineStyleProps & import("..").BorderWidthStyleProps & import("..").BorderLogicalStyleProps & import("..").ColorStyleProps & import("..").DepthStyleProps & import("..").FlexItemStyleProps & import("..").LayoutStyleProps & import("./utils/other").OtherStyleProps & import("..").PositionStandardProps & import("..").PositionLogicalProps & import("./utils/space").SpaceStandardProps & import("./utils/space").SpaceLogicalProps>;
15
+ Item: import("../../common").ElementComponent<"div", import("..").BorderShorthandStyleProps & import("..").BorderColorStyleProps & import("..").BorderRadiusStyleProps & import("..").BorderLineStyleProps & import("..").BorderWidthStyleProps & import("..").BorderLogicalStyleProps & import("..").ColorStyleProps & import("..").DepthStyleProps & import("..").FlexItemStyleProps & import("..").FontStyleProps & import("..").LayoutStyleProps & import("./utils/other").OtherStyleProps & import("..").PositionStandardProps & import("..").PositionLogicalProps & import("./utils/space").SpaceStandardProps & import("./utils/space").SpaceLogicalProps & import("..").TextStyleProps>;
16
16
  };
17
17
  export interface VStackProps extends StackProps {
18
18
  /**
@@ -22,6 +22,6 @@ export interface VStackProps extends StackProps {
22
22
  flexDirection?: 'column' | 'column-reverse';
23
23
  }
24
24
  export declare const VStack: import("../../common").ElementComponent<"div", VStackProps> & {
25
- Item: import("../../common").ElementComponent<"div", import("..").BorderShorthandStyleProps & import("..").BorderColorStyleProps & import("..").BorderRadiusStyleProps & import("..").BorderLineStyleProps & import("..").BorderWidthStyleProps & import("..").BorderLogicalStyleProps & import("..").ColorStyleProps & import("..").DepthStyleProps & import("..").FlexItemStyleProps & import("..").LayoutStyleProps & import("./utils/other").OtherStyleProps & import("..").PositionStandardProps & import("..").PositionLogicalProps & import("./utils/space").SpaceStandardProps & import("./utils/space").SpaceLogicalProps>;
25
+ Item: import("../../common").ElementComponent<"div", import("..").BorderShorthandStyleProps & import("..").BorderColorStyleProps & import("..").BorderRadiusStyleProps & import("..").BorderLineStyleProps & import("..").BorderWidthStyleProps & import("..").BorderLogicalStyleProps & import("..").ColorStyleProps & import("..").DepthStyleProps & import("..").FlexItemStyleProps & import("..").FontStyleProps & import("..").LayoutStyleProps & import("./utils/other").OtherStyleProps & import("..").PositionStandardProps & import("..").PositionLogicalProps & import("./utils/space").SpaceStandardProps & import("./utils/space").SpaceLogicalProps & import("..").TextStyleProps>;
26
26
  };
27
27
  //# sourceMappingURL=Stack.d.ts.map
@@ -55,8 +55,8 @@ export var Stack = createComponent('div')({
55
55
  export var HStack = createComponent('div')({
56
56
  displayName: 'HStack',
57
57
  Component: function (_a, ref, Element) {
58
- var children = _a.children, elemProps = __rest(_a, ["children"]);
59
- return (React.createElement(Stack, __assign({ as: Element, ref: ref, flexDirection: "row" }, elemProps), children));
58
+ var children = _a.children, _b = _a.flexDirection, flexDirection = _b === void 0 ? 'row' : _b, elemProps = __rest(_a, ["children", "flexDirection"]);
59
+ return (React.createElement(Stack, __assign({ as: Element, ref: ref, flexDirection: flexDirection }, elemProps), children));
60
60
  },
61
61
  subComponents: {
62
62
  Item: StackItem,
@@ -65,8 +65,8 @@ export var HStack = createComponent('div')({
65
65
  export var VStack = createComponent('div')({
66
66
  displayName: 'VStack',
67
67
  Component: function (_a, ref, Element) {
68
- var children = _a.children, elemProps = __rest(_a, ["children"]);
69
- return (React.createElement(Stack, __assign({ as: Element, ref: ref, flexDirection: "column" }, elemProps), children));
68
+ var children = _a.children, _b = _a.flexDirection, flexDirection = _b === void 0 ? 'column' : _b, elemProps = __rest(_a, ["children", "flexDirection"]);
69
+ return (React.createElement(Stack, __assign({ as: Element, ref: ref, flexDirection: flexDirection }, elemProps), children));
70
70
  },
71
71
  subComponents: {
72
72
  Item: StackItem,
@@ -1 +1 @@
1
- {"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../../../../layout/lib/utils/color.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,IAAI,WAAW,EAAE,WAAW,EAAC,MAAM,kCAAkC,CAAC;AAEpF,oBAAY,WAAW,GAAG,OAAO,WAAW,CAAC;AAE7C,0CAA0C;AAC1C,oBAAY,eAAe,GAAG;IAC5B,iCAAiC;IACjC,UAAU,CAAC,EAAE,WAAW,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IACzC,uCAAuC;IACvC,eAAe,CAAC,EAAE,WAAW,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IAC9C,uCAAuC;IACvC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,4BAA4B;IAC5B,KAAK,CAAC,EAAE,WAAW,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;CACrC,CAAC;AAyBF;;;;;;;;;;GAUG;AACH,wBAAgB,KAAK,CAAC,CAAC,SAAS,eAAe,EAAE,KAAK,EAAE,CAAC,MAWxD"}
1
+ {"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../../../../layout/lib/utils/color.ts"],"names":[],"mappings":"AACA,OAAO,EACL,MAAM,IAAI,WAAW,EACrB,WAAW,EAEZ,MAAM,kCAAkC,CAAC;AAE1C,oBAAY,WAAW,GAAG,OAAO,WAAW,CAAC;AAE7C,0CAA0C;AAC1C,oBAAY,eAAe,GAAG;IAC5B,iCAAiC;IACjC,UAAU,CAAC,EAAE,WAAW,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IACzC,uCAAuC;IACvC,eAAe,CAAC,EAAE,WAAW,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IAC9C,uCAAuC;IACvC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,4BAA4B;IAC5B,KAAK,CAAC,EAAE,WAAW,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;CACrC,CAAC;AAyBF;;;;;;;;;;GAUG;AACH,wBAAgB,KAAK,CAAC,CAAC,SAAS,eAAe,EAAE,KAAK,EAAE,CAAC,MAWxD"}
@@ -9,7 +9,8 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
- import { colors as colorTokens } from '@workday/canvas-kit-react/tokens';
12
+ // type changes no need
13
+ import { colors as colorTokens, } from '@workday/canvas-kit-react/tokens';
13
14
  var getBackground = function (value) { return ({
14
15
  background: colorTokens[value] || value,
15
16
  }); };
@@ -0,0 +1,29 @@
1
+ import { Property } from 'csstype';
2
+ import { CanvasTypeProperties } from '@workday/canvas-kit-react/tokens';
3
+ export declare type FontFamilyTokens = keyof CanvasTypeProperties['fontFamilies'];
4
+ export declare type FontSizeTokens = keyof CanvasTypeProperties['fontSizes'];
5
+ export declare type FontWeightTokens = keyof CanvasTypeProperties['fontWeights'];
6
+ /** style props to for color properties */
7
+ export declare type FontStyleProps = {
8
+ /** sets `font-family` property */
9
+ fontFamily?: Property.FontFamily | FontFamilyTokens;
10
+ /** sets `font-size` property */
11
+ fontSize?: Property.FontSize | FontSizeTokens;
12
+ /** sets `font-style` property */
13
+ fontStyle?: Property.FontStyle;
14
+ /** sets `font-weight` property */
15
+ fontWeight?: Property.FontWeight | FontWeightTokens;
16
+ };
17
+ /**
18
+ * A style prop function that takes components props and returns font styles from canvas token values.
19
+ * If no `FontStyleProps` are found, it returns an empty object.
20
+ *
21
+ * @example
22
+ * // You'll most likely use `font` with low-level, styled components
23
+ * const BoxExample = () => (
24
+ * <Box fontFamily="monospace" fontWeight="medium">Hello, fonts!</Box>
25
+ * );
26
+ *
27
+ */
28
+ export declare function font<P extends FontStyleProps>(props: P): {};
29
+ //# sourceMappingURL=font.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"font.d.ts","sourceRoot":"","sources":["../../../../../layout/lib/utils/font.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AACjC,OAAO,EAAO,oBAAoB,EAAC,MAAM,kCAAkC,CAAC;AAE5E,oBAAY,gBAAgB,GAAG,MAAM,oBAAoB,CAAC,cAAc,CAAC,CAAC;AAC1E,oBAAY,cAAc,GAAG,MAAM,oBAAoB,CAAC,WAAW,CAAC,CAAC;AACrE,oBAAY,gBAAgB,GAAG,MAAM,oBAAoB,CAAC,aAAa,CAAC,CAAC;AAGzE,0CAA0C;AAC1C,oBAAY,cAAc,GAAG;IAC3B,kCAAkC;IAClC,UAAU,CAAC,EAAE,QAAQ,CAAC,UAAU,GAAG,gBAAgB,CAAC;IACpD,gCAAgC;IAChC,QAAQ,CAAC,EAAE,QAAQ,CAAC,QAAQ,GAAG,cAAc,CAAC;IAC9C,iCAAiC;IACjC,SAAS,CAAC,EAAE,QAAQ,CAAC,SAAS,CAAC;IAC/B,kCAAkC;IAClC,UAAU,CAAC,EAAE,QAAQ,CAAC,UAAU,GAAG,gBAAgB,CAAC;CACrD,CAAC;AAyBF;;;;;;;;;;GAUG;AACH,wBAAgB,IAAI,CAAC,CAAC,SAAS,cAAc,EAAE,KAAK,EAAE,CAAC,MAYtD"}
@@ -0,0 +1,53 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { type } from '@workday/canvas-kit-react/tokens';
13
+ var getFontFamily = function (value) { return ({
14
+ fontFamily: type.properties.fontFamilies[value] || value,
15
+ }); };
16
+ var getFontSize = function (value) { return ({
17
+ fontSize: type.properties.fontSizes[value] || value,
18
+ }); };
19
+ var getFontStyle = function (value) { return ({
20
+ fontStyle: value,
21
+ }); };
22
+ var getFontWeight = function (value) { return ({
23
+ fontWeight: type.properties.fontWeights[value] || value,
24
+ }); };
25
+ var fontProps = {
26
+ fontFamily: getFontFamily,
27
+ fontSize: getFontSize,
28
+ fontWeight: getFontWeight,
29
+ fontStyle: getFontStyle,
30
+ };
31
+ /**
32
+ * A style prop function that takes components props and returns font styles from canvas token values.
33
+ * If no `FontStyleProps` are found, it returns an empty object.
34
+ *
35
+ * @example
36
+ * // You'll most likely use `font` with low-level, styled components
37
+ * const BoxExample = () => (
38
+ * <Box fontFamily="monospace" fontWeight="medium">Hello, fonts!</Box>
39
+ * );
40
+ *
41
+ */
42
+ export function font(props) {
43
+ var styles = {};
44
+ for (var key in props) {
45
+ if (key in fontProps) {
46
+ var value = props[key];
47
+ var fontFn = fontProps[key];
48
+ var style = fontFn(value);
49
+ styles = __assign(__assign({}, styles), style);
50
+ }
51
+ }
52
+ return styles;
53
+ }