@workday/canvas-kit-labs-react 8.0.0 → 8.0.1

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 (244) hide show
  1. package/combobox/README.md +4 -4
  2. package/combobox/index.ts +0 -4
  3. package/combobox/lib/AutocompleteList.tsx +5 -8
  4. package/combobox/lib/Combobox.tsx +14 -20
  5. package/combobox/lib/Status.tsx +1 -3
  6. package/common/index.ts +0 -2
  7. package/common/lib/theming/useThemeRTL.ts +11 -13
  8. package/dist/commonjs/combobox/index.d.ts +0 -3
  9. package/dist/commonjs/combobox/index.d.ts.map +1 -1
  10. package/dist/commonjs/combobox/index.js +0 -7
  11. package/dist/commonjs/combobox/lib/AutocompleteList.d.ts +4 -5
  12. package/dist/commonjs/combobox/lib/AutocompleteList.d.ts.map +1 -1
  13. package/dist/commonjs/combobox/lib/AutocompleteList.js +2 -1
  14. package/dist/commonjs/combobox/lib/Combobox.d.ts +4 -6
  15. package/dist/commonjs/combobox/lib/Combobox.d.ts.map +1 -1
  16. package/dist/commonjs/combobox/lib/Combobox.js +8 -12
  17. package/dist/commonjs/combobox/lib/Status.d.ts +1 -2
  18. package/dist/commonjs/combobox/lib/Status.d.ts.map +1 -1
  19. package/dist/commonjs/combobox/lib/Status.js +2 -1
  20. package/dist/commonjs/common/index.d.ts +0 -2
  21. package/dist/commonjs/common/index.d.ts.map +1 -1
  22. package/dist/commonjs/common/index.js +0 -5
  23. package/dist/commonjs/common/lib/theming/useThemeRTL.d.ts.map +1 -1
  24. package/dist/commonjs/common/lib/theming/useThemeRTL.js +6 -8
  25. package/dist/commonjs/drawer/index.d.ts +1 -4
  26. package/dist/commonjs/drawer/index.d.ts.map +1 -1
  27. package/dist/commonjs/drawer/index.js +3 -9
  28. package/dist/commonjs/drawer/lib/Drawer.d.ts +39 -14
  29. package/dist/commonjs/drawer/lib/Drawer.d.ts.map +1 -1
  30. package/dist/commonjs/drawer/lib/Drawer.js +39 -21
  31. package/dist/commonjs/drawer/lib/DrawerHeader.d.ts +24 -7
  32. package/dist/commonjs/drawer/lib/DrawerHeader.d.ts.map +1 -1
  33. package/dist/commonjs/drawer/lib/DrawerHeader.js +22 -14
  34. package/dist/commonjs/expandable/index.d.ts +3 -0
  35. package/dist/commonjs/expandable/index.d.ts.map +1 -0
  36. package/dist/commonjs/expandable/index.js +14 -0
  37. package/dist/commonjs/expandable/lib/Expandable.d.ts +75 -0
  38. package/dist/commonjs/expandable/lib/Expandable.d.ts.map +1 -0
  39. package/dist/commonjs/expandable/lib/Expandable.js +50 -0
  40. package/dist/commonjs/expandable/lib/ExpandableAvatar.d.ts +7 -0
  41. package/dist/commonjs/expandable/lib/ExpandableAvatar.d.ts.map +1 -0
  42. package/dist/commonjs/expandable/lib/ExpandableAvatar.js +46 -0
  43. package/dist/commonjs/expandable/lib/ExpandableContent.d.ts +19 -0
  44. package/dist/commonjs/expandable/lib/ExpandableContent.d.ts.map +1 -0
  45. package/dist/commonjs/expandable/lib/ExpandableContent.js +41 -0
  46. package/dist/commonjs/expandable/lib/ExpandableIcon.d.ts +29 -0
  47. package/dist/commonjs/expandable/lib/ExpandableIcon.d.ts.map +1 -0
  48. package/dist/commonjs/expandable/lib/ExpandableIcon.js +62 -0
  49. package/dist/commonjs/expandable/lib/ExpandableTarget.d.ts +28 -0
  50. package/dist/commonjs/expandable/lib/ExpandableTarget.d.ts.map +1 -0
  51. package/dist/commonjs/expandable/lib/ExpandableTarget.js +48 -0
  52. package/dist/commonjs/expandable/lib/ExpandableTitle.d.ts +9 -0
  53. package/dist/commonjs/expandable/lib/ExpandableTitle.d.ts.map +1 -0
  54. package/dist/commonjs/expandable/lib/ExpandableTitle.js +39 -0
  55. package/dist/commonjs/expandable/lib/hooks/index.d.ts +4 -0
  56. package/dist/commonjs/expandable/lib/hooks/index.d.ts.map +1 -0
  57. package/dist/commonjs/expandable/lib/hooks/index.js +15 -0
  58. package/dist/commonjs/expandable/lib/hooks/useExpandableContent.d.ts +20 -0
  59. package/dist/commonjs/expandable/lib/hooks/useExpandableContent.d.ts.map +1 -0
  60. package/dist/commonjs/expandable/lib/hooks/useExpandableContent.js +12 -0
  61. package/dist/commonjs/expandable/lib/hooks/useExpandableIcon.d.ts +15 -0
  62. package/dist/commonjs/expandable/lib/hooks/useExpandableIcon.d.ts.map +1 -0
  63. package/dist/commonjs/expandable/lib/hooks/useExpandableIcon.js +11 -0
  64. package/dist/commonjs/expandable/lib/hooks/useExpandableTarget.d.ts +17 -0
  65. package/dist/commonjs/expandable/lib/hooks/useExpandableTarget.d.ts.map +1 -0
  66. package/dist/commonjs/expandable/lib/hooks/useExpandableTarget.js +20 -0
  67. package/dist/commonjs/expandable/lib/useExpandableModel.d.ts +50 -0
  68. package/dist/commonjs/expandable/lib/useExpandableModel.d.ts.map +1 -0
  69. package/dist/commonjs/expandable/lib/useExpandableModel.js +24 -0
  70. package/dist/commonjs/index.d.ts +2 -0
  71. package/dist/commonjs/index.d.ts.map +1 -1
  72. package/dist/commonjs/index.js +2 -0
  73. package/dist/commonjs/search-form/lib/SearchForm.d.ts +1 -2
  74. package/dist/commonjs/search-form/lib/SearchForm.d.ts.map +1 -1
  75. package/dist/commonjs/search-form/lib/SearchForm.js +2 -4
  76. package/dist/commonjs/toast/index.d.ts +3 -0
  77. package/dist/commonjs/toast/index.d.ts.map +1 -0
  78. package/dist/commonjs/toast/index.js +14 -0
  79. package/dist/commonjs/toast/lib/Toast.d.ts +27 -0
  80. package/dist/commonjs/toast/lib/Toast.d.ts.map +1 -0
  81. package/dist/commonjs/toast/lib/Toast.js +78 -0
  82. package/dist/commonjs/toast/lib/ToastBody.d.ts +6 -0
  83. package/dist/commonjs/toast/lib/ToastBody.d.ts.map +1 -0
  84. package/dist/commonjs/toast/lib/ToastBody.js +40 -0
  85. package/dist/commonjs/toast/lib/ToastCloseIcon.d.ts +6 -0
  86. package/dist/commonjs/toast/lib/ToastCloseIcon.d.ts.map +1 -0
  87. package/dist/commonjs/toast/lib/ToastCloseIcon.js +43 -0
  88. package/dist/commonjs/toast/lib/ToastIcon.d.ts +5 -0
  89. package/dist/commonjs/toast/lib/ToastIcon.d.ts.map +1 -0
  90. package/dist/commonjs/toast/lib/ToastIcon.js +26 -0
  91. package/dist/commonjs/toast/lib/ToastLink.d.ts +9 -0
  92. package/dist/commonjs/toast/lib/ToastLink.d.ts.map +1 -0
  93. package/dist/commonjs/toast/lib/ToastLink.js +42 -0
  94. package/dist/commonjs/toast/lib/ToastMessage.d.ts +11 -0
  95. package/dist/commonjs/toast/lib/ToastMessage.d.ts.map +1 -0
  96. package/dist/commonjs/toast/lib/ToastMessage.js +41 -0
  97. package/dist/commonjs/toast/lib/hooks/useToastModel.d.ts +65 -0
  98. package/dist/commonjs/toast/lib/hooks/useToastModel.d.ts.map +1 -0
  99. package/dist/commonjs/toast/lib/hooks/useToastModel.js +35 -0
  100. package/dist/es6/combobox/index.d.ts +0 -3
  101. package/dist/es6/combobox/index.d.ts.map +1 -1
  102. package/dist/es6/combobox/index.js +0 -3
  103. package/dist/es6/combobox/lib/AutocompleteList.d.ts +4 -5
  104. package/dist/es6/combobox/lib/AutocompleteList.d.ts.map +1 -1
  105. package/dist/es6/combobox/lib/AutocompleteList.js +1 -2
  106. package/dist/es6/combobox/lib/Combobox.d.ts +4 -6
  107. package/dist/es6/combobox/lib/Combobox.d.ts.map +1 -1
  108. package/dist/es6/combobox/lib/Combobox.js +5 -10
  109. package/dist/es6/combobox/lib/Status.d.ts +1 -2
  110. package/dist/es6/combobox/lib/Status.d.ts.map +1 -1
  111. package/dist/es6/combobox/lib/Status.js +1 -2
  112. package/dist/es6/common/index.d.ts +0 -2
  113. package/dist/es6/common/index.d.ts.map +1 -1
  114. package/dist/es6/common/index.js +0 -2
  115. package/dist/es6/common/lib/theming/useThemeRTL.d.ts.map +1 -1
  116. package/dist/es6/common/lib/theming/useThemeRTL.js +7 -9
  117. package/dist/es6/drawer/index.d.ts +1 -4
  118. package/dist/es6/drawer/index.d.ts.map +1 -1
  119. package/dist/es6/drawer/index.js +1 -4
  120. package/dist/es6/drawer/lib/Drawer.d.ts +39 -14
  121. package/dist/es6/drawer/lib/Drawer.d.ts.map +1 -1
  122. package/dist/es6/drawer/lib/Drawer.js +38 -20
  123. package/dist/es6/drawer/lib/DrawerHeader.d.ts +24 -7
  124. package/dist/es6/drawer/lib/DrawerHeader.d.ts.map +1 -1
  125. package/dist/es6/drawer/lib/DrawerHeader.js +22 -15
  126. package/dist/es6/expandable/index.d.ts +3 -0
  127. package/dist/es6/expandable/index.d.ts.map +1 -0
  128. package/dist/es6/expandable/index.js +2 -0
  129. package/dist/es6/expandable/lib/Expandable.d.ts +75 -0
  130. package/dist/es6/expandable/lib/Expandable.d.ts.map +1 -0
  131. package/dist/es6/expandable/lib/Expandable.js +44 -0
  132. package/dist/es6/expandable/lib/ExpandableAvatar.d.ts +7 -0
  133. package/dist/es6/expandable/lib/ExpandableAvatar.d.ts.map +1 -0
  134. package/dist/es6/expandable/lib/ExpandableAvatar.js +40 -0
  135. package/dist/es6/expandable/lib/ExpandableContent.d.ts +19 -0
  136. package/dist/es6/expandable/lib/ExpandableContent.d.ts.map +1 -0
  137. package/dist/es6/expandable/lib/ExpandableContent.js +35 -0
  138. package/dist/es6/expandable/lib/ExpandableIcon.d.ts +29 -0
  139. package/dist/es6/expandable/lib/ExpandableIcon.d.ts.map +1 -0
  140. package/dist/es6/expandable/lib/ExpandableIcon.js +56 -0
  141. package/dist/es6/expandable/lib/ExpandableTarget.d.ts +28 -0
  142. package/dist/es6/expandable/lib/ExpandableTarget.d.ts.map +1 -0
  143. package/dist/es6/expandable/lib/ExpandableTarget.js +42 -0
  144. package/dist/es6/expandable/lib/ExpandableTitle.d.ts +9 -0
  145. package/dist/es6/expandable/lib/ExpandableTitle.d.ts.map +1 -0
  146. package/dist/es6/expandable/lib/ExpandableTitle.js +33 -0
  147. package/dist/es6/expandable/lib/hooks/index.d.ts +4 -0
  148. package/dist/es6/expandable/lib/hooks/index.d.ts.map +1 -0
  149. package/dist/es6/expandable/lib/hooks/index.js +3 -0
  150. package/dist/es6/expandable/lib/hooks/useExpandableContent.d.ts +20 -0
  151. package/dist/es6/expandable/lib/hooks/useExpandableContent.d.ts.map +1 -0
  152. package/dist/es6/expandable/lib/hooks/useExpandableContent.js +9 -0
  153. package/dist/es6/expandable/lib/hooks/useExpandableIcon.d.ts +15 -0
  154. package/dist/es6/expandable/lib/hooks/useExpandableIcon.d.ts.map +1 -0
  155. package/dist/es6/expandable/lib/hooks/useExpandableIcon.js +8 -0
  156. package/dist/es6/expandable/lib/hooks/useExpandableTarget.d.ts +17 -0
  157. package/dist/es6/expandable/lib/hooks/useExpandableTarget.d.ts.map +1 -0
  158. package/dist/es6/expandable/lib/hooks/useExpandableTarget.js +17 -0
  159. package/dist/es6/expandable/lib/useExpandableModel.d.ts +50 -0
  160. package/dist/es6/expandable/lib/useExpandableModel.d.ts.map +1 -0
  161. package/dist/es6/expandable/lib/useExpandableModel.js +21 -0
  162. package/dist/es6/index.d.ts +2 -0
  163. package/dist/es6/index.d.ts.map +1 -1
  164. package/dist/es6/index.js +2 -0
  165. package/dist/es6/search-form/lib/SearchForm.d.ts +1 -2
  166. package/dist/es6/search-form/lib/SearchForm.d.ts.map +1 -1
  167. package/dist/es6/search-form/lib/SearchForm.js +2 -4
  168. package/dist/es6/toast/index.d.ts +3 -0
  169. package/dist/es6/toast/index.d.ts.map +1 -0
  170. package/dist/es6/toast/index.js +2 -0
  171. package/dist/es6/toast/lib/Toast.d.ts +27 -0
  172. package/dist/es6/toast/lib/Toast.d.ts.map +1 -0
  173. package/dist/es6/toast/lib/Toast.js +72 -0
  174. package/dist/es6/toast/lib/ToastBody.d.ts +6 -0
  175. package/dist/es6/toast/lib/ToastBody.d.ts.map +1 -0
  176. package/dist/es6/toast/lib/ToastBody.js +34 -0
  177. package/dist/es6/toast/lib/ToastCloseIcon.d.ts +6 -0
  178. package/dist/es6/toast/lib/ToastCloseIcon.d.ts.map +1 -0
  179. package/dist/es6/toast/lib/ToastCloseIcon.js +37 -0
  180. package/dist/es6/toast/lib/ToastIcon.d.ts +5 -0
  181. package/dist/es6/toast/lib/ToastIcon.d.ts.map +1 -0
  182. package/dist/es6/toast/lib/ToastIcon.js +20 -0
  183. package/dist/es6/toast/lib/ToastLink.d.ts +9 -0
  184. package/dist/es6/toast/lib/ToastLink.d.ts.map +1 -0
  185. package/dist/es6/toast/lib/ToastLink.js +36 -0
  186. package/dist/es6/toast/lib/ToastMessage.d.ts +11 -0
  187. package/dist/es6/toast/lib/ToastMessage.d.ts.map +1 -0
  188. package/dist/es6/toast/lib/ToastMessage.js +35 -0
  189. package/dist/es6/toast/lib/hooks/useToastModel.d.ts +65 -0
  190. package/dist/es6/toast/lib/hooks/useToastModel.d.ts.map +1 -0
  191. package/dist/es6/toast/lib/hooks/useToastModel.js +32 -0
  192. package/drawer/index.ts +1 -4
  193. package/drawer/lib/Drawer.tsx +61 -24
  194. package/drawer/lib/DrawerHeader.tsx +54 -26
  195. package/expandable/LICENSE +52 -0
  196. package/expandable/README.md +11 -0
  197. package/expandable/index.ts +2 -0
  198. package/expandable/lib/Expandable.tsx +34 -0
  199. package/expandable/lib/ExpandableAvatar.tsx +26 -0
  200. package/expandable/lib/ExpandableContent.tsx +32 -0
  201. package/expandable/lib/ExpandableIcon.tsx +74 -0
  202. package/expandable/lib/ExpandableTarget.tsx +67 -0
  203. package/expandable/lib/ExpandableTitle.tsx +34 -0
  204. package/expandable/lib/hooks/index.ts +3 -0
  205. package/expandable/lib/hooks/useExpandableContent.ts +9 -0
  206. package/expandable/lib/hooks/useExpandableIcon.ts +8 -0
  207. package/expandable/lib/hooks/useExpandableTarget.ts +16 -0
  208. package/expandable/lib/useExpandableModel.tsx +17 -0
  209. package/expandable/package.json +6 -0
  210. package/index.ts +2 -0
  211. package/package.json +5 -5
  212. package/search-form/lib/SearchForm.tsx +2 -6
  213. package/toast/LICENSE +52 -0
  214. package/toast/README.md +5 -0
  215. package/toast/index.ts +2 -0
  216. package/toast/lib/Toast.tsx +63 -0
  217. package/toast/lib/ToastBody.tsx +34 -0
  218. package/toast/lib/ToastCloseIcon.tsx +18 -0
  219. package/toast/lib/ToastIcon.tsx +24 -0
  220. package/toast/lib/ToastLink.tsx +27 -0
  221. package/toast/lib/ToastMessage.tsx +21 -0
  222. package/toast/lib/hooks/useToastModel.tsx +27 -0
  223. package/toast/package.json +6 -0
  224. package/common/lib/storybook-utils/ComponentStatesTable.tsx +0 -80
  225. package/common/lib/storybook-utils/permutateProps.ts +0 -47
  226. package/common/lib/storybook-utils/propTypes.ts +0 -15
  227. package/dist/commonjs/common/lib/storybook-utils/ComponentStatesTable.d.ts +0 -26
  228. package/dist/commonjs/common/lib/storybook-utils/ComponentStatesTable.d.ts.map +0 -1
  229. package/dist/commonjs/common/lib/storybook-utils/ComponentStatesTable.js +0 -48
  230. package/dist/commonjs/common/lib/storybook-utils/permutateProps.d.ts +0 -5
  231. package/dist/commonjs/common/lib/storybook-utils/permutateProps.d.ts.map +0 -1
  232. package/dist/commonjs/common/lib/storybook-utils/permutateProps.js +0 -47
  233. package/dist/commonjs/common/lib/storybook-utils/propTypes.d.ts +0 -15
  234. package/dist/commonjs/common/lib/storybook-utils/propTypes.d.ts.map +0 -1
  235. package/dist/commonjs/common/lib/storybook-utils/propTypes.js +0 -2
  236. package/dist/es6/common/lib/storybook-utils/ComponentStatesTable.d.ts +0 -26
  237. package/dist/es6/common/lib/storybook-utils/ComponentStatesTable.d.ts.map +0 -1
  238. package/dist/es6/common/lib/storybook-utils/ComponentStatesTable.js +0 -41
  239. package/dist/es6/common/lib/storybook-utils/permutateProps.d.ts +0 -5
  240. package/dist/es6/common/lib/storybook-utils/permutateProps.d.ts.map +0 -1
  241. package/dist/es6/common/lib/storybook-utils/permutateProps.js +0 -43
  242. package/dist/es6/common/lib/storybook-utils/propTypes.d.ts +0 -15
  243. package/dist/es6/common/lib/storybook-utils/propTypes.d.ts.map +0 -1
  244. package/dist/es6/common/lib/storybook-utils/propTypes.js +0 -1
@@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react';
2
2
  import styled from '@emotion/styled';
3
3
  import { accessibleHide } from '@workday/canvas-kit-react/common';
4
4
  var Container = styled('div')(accessibleHide);
5
- var Status = function (_a) {
5
+ export var Status = function (_a) {
6
6
  var _b = _a.ariaLive, ariaLive = _b === void 0 ? 'polite' : _b, _c = _a.role, role = _c === void 0 ? 'status' : _c, _d = _a.ariaRelevant, ariaRelevant = _d === void 0 ? 'additions' : _d, _e = _a.expireMilliseconds, expireMilliseconds = _e === void 0 ? 500 : _e, _f = _a.announcementText, announcementText = _f === void 0 ? '' : _f, ariaAtomic = _a.ariaAtomic;
7
7
  var _g = useState(announcementText), displayText = _g[0], setDisplayText = _g[1];
8
8
  useEffect(function () {
@@ -17,4 +17,3 @@ var Status = function (_a) {
17
17
  }, [announcementText, expireMilliseconds]);
18
18
  return (React.createElement(Container, { "aria-live": ariaLive, role: role, "aria-relevant": ariaRelevant, "aria-atomic": ariaAtomic }, displayText));
19
19
  };
20
- export default Status;
@@ -1,4 +1,2 @@
1
1
  export * from './lib/theming';
2
- export { ComponentStatesTable } from './lib/storybook-utils/ComponentStatesTable';
3
- export { permutateProps } from './lib/storybook-utils/permutateProps';
4
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../common/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAC,oBAAoB,EAAC,MAAM,4CAA4C,CAAC;AAChF,OAAO,EAAC,cAAc,EAAC,MAAM,sCAAsC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../common/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
@@ -1,3 +1 @@
1
1
  export * from './lib/theming';
2
- export { ComponentStatesTable } from './lib/storybook-utils/ComponentStatesTable';
3
- export { permutateProps } from './lib/storybook-utils/permutateProps';
@@ -1 +1 @@
1
- {"version":3,"file":"useThemeRTL.d.ts","sourceRoot":"","sources":["../../../../../common/lib/theming/useThemeRTL.ts"],"names":[],"mappings":"AAMA,OAAO,EAAC,aAAa,EAAC,MAAM,kCAAkC,CAAC;AAI/D,oBAAY,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AAW5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,WAAW;6BAMD,aAAa,EAAE;;EAYxC"}
1
+ {"version":3,"file":"useThemeRTL.d.ts","sourceRoot":"","sources":["../../../../../common/lib/theming/useThemeRTL.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,aAAa,EAAC,MAAM,kCAAkC,CAAC;AAI/D,oBAAY,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AAc5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,WAAW;6BAMD,aAAa,EAAE;;EAYxC"}
@@ -16,7 +16,7 @@ var __spreadArrays = (this && this.__spreadArrays) || function () {
16
16
  r[k] = a[j];
17
17
  return r;
18
18
  };
19
- import { convertToStaticStates, useIsRTL, useTheme, } from '@workday/canvas-kit-react/common';
19
+ import { useIsRTL, useTheme } from '@workday/canvas-kit-react/common';
20
20
  import { useMemo } from 'react';
21
21
  import rtlCSSJS from 'rtl-css-js';
22
22
  var getDirectionalStyles = function (isRTL) {
@@ -26,9 +26,8 @@ var getDirectionalStyles = function (isRTL) {
26
26
  }
27
27
  return isRTL ? rtlCSSJS(styles) : styles;
28
28
  };
29
- var getConvertedStyles = function (shouldConvert, styles) {
30
- var _a;
31
- return shouldConvert ? (_a = convertToStaticStates(styles)) !== null && _a !== void 0 ? _a : styles : styles;
29
+ var getConvertedStyles = function (styles, convertFunc) {
30
+ return convertFunc ? convertFunc(styles) : styles;
32
31
  };
33
32
  /**
34
33
  * A helpful hook for supporting bidirectional styles.
@@ -60,10 +59,9 @@ var getConvertedStyles = function (shouldConvert, styles) {
60
59
  * }
61
60
  */
62
61
  export function useThemeRTL() {
63
- var _a;
64
62
  var theme = useTheme();
65
63
  var direction = useIsRTL(theme);
66
- var shouldConvert = (_a = theme.canvas._staticStates) !== null && _a !== void 0 ? _a : false;
64
+ var convertFunc = theme.canvas._styleRewriteFn;
67
65
  var themeRTL = useMemo(function () {
68
66
  return function () {
69
67
  var cssObject = [];
@@ -72,11 +70,11 @@ export function useThemeRTL() {
72
70
  }
73
71
  var styles = getDirectionalStyles.apply(void 0, __spreadArrays([direction], cssObject));
74
72
  return styles.reduce(function (first, second) {
75
- var convertedFirst = shouldConvert ? getConvertedStyles(shouldConvert, first) : first;
76
- var convertedSecond = shouldConvert ? getConvertedStyles(shouldConvert, second) : second;
73
+ var convertedFirst = getConvertedStyles(first, convertFunc);
74
+ var convertedSecond = getConvertedStyles(second, convertFunc);
77
75
  return __assign(__assign({}, convertedFirst), convertedSecond);
78
76
  }, {});
79
77
  };
80
- }, [direction, shouldConvert]);
78
+ }, [direction, convertFunc]);
81
79
  return { themeRTL: themeRTL, theme: theme };
82
80
  }
@@ -1,6 +1,3 @@
1
- import Drawer from './lib/Drawer';
2
- import DrawerHeader from './lib/DrawerHeader';
3
- export { Drawer, DrawerHeader };
4
- export default Drawer;
1
+ export { DeprecatedDrawerHeader } from './lib/DrawerHeader';
5
2
  export * from './lib/Drawer';
6
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../drawer/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,YAAY,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAC,MAAM,EAAE,YAAY,EAAC,CAAC;AAC9B,eAAe,MAAM,CAAC;AACtB,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../drawer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,sBAAsB,EAAC,MAAM,oBAAoB,CAAC;AAC1D,cAAc,cAAc,CAAC"}
@@ -1,5 +1,2 @@
1
- import Drawer from './lib/Drawer';
2
- import DrawerHeader from './lib/DrawerHeader';
3
- export { Drawer, DrawerHeader };
4
- export default Drawer;
1
+ export { DeprecatedDrawerHeader } from './lib/DrawerHeader';
5
2
  export * from './lib/Drawer';
@@ -1,49 +1,74 @@
1
1
  import * as React from 'react';
2
2
  import { CanvasSpaceValues } from '@workday/canvas-kit-react/tokens';
3
- export interface DrawerProps extends React.HTMLAttributes<HTMLDivElement> {
3
+ /**
4
+ * ### Deprecated Drawer Props
5
+ *
6
+ * As of Canvas Kit v8, Drawer is being soft-deprecated.
7
+ * It will be hard-deprecated (completely removed) in v9. Please see the
8
+ * [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
9
+ * for more information.
10
+ */
11
+ export interface DeprecatedDrawerProps extends React.HTMLAttributes<HTMLDivElement> {
4
12
  /**
5
- * The padding of the Drawer contents.
13
+ * The padding of the DeprecatedDrawer contents.
6
14
  * @default space.s
7
15
  */
8
16
  padding?: CanvasSpaceValues;
9
17
  /**
10
- * The direction from which the Drawer opens. Accepts `Left` or `Right`.
11
- * @default DrawerDirection.Right
18
+ * The direction from which the DeprecatedDrawer opens. Accepts `Left` or `Right`.
19
+ * @default DeprecatedDrawerDirection.Right
12
20
  */
13
- openDirection?: DrawerDirection;
21
+ openDirection?: DeprecatedDrawerDirection;
14
22
  /**
15
- * The width of the Drawer in `px`.
23
+ * The width of the DeprecatedDrawer in `px`.
16
24
  * @default 360
17
25
  */
18
26
  width?: number;
19
27
  /**
20
- * If true, render the Drawer with a drop shadow.
28
+ * If true, render the DeprecatedDrawer with a drop shadow.
21
29
  * @default false
22
30
  */
23
31
  showDropShadow?: boolean;
24
32
  /**
25
- * The optional DrawerHeader component of the Drawer. Shows an optional string and close button.
33
+ * The optional DeprecatedDrawerHeader component of the DeprecatedDrawer. Shows an optional string and close button.
26
34
  */
27
35
  header?: React.ReactElement;
28
36
  /**
29
- * The `aria-labelledby` of the Drawer. Set this when there is a `header` for accessibility. The `role` attribute should also be used when this attribute is present. This value should be the same as the `id` attribute of the `header` element.
37
+ * The `aria-labelledby` of the DeprecatedDrawer. Set this when there is a `header` for accessibility. The `role` attribute should also be used when this attribute is present. This value should be the same as the `id` attribute of the `header` element.
30
38
  */
31
39
  'aria-labelledby'?: string;
32
40
  /**
33
- * The `aria-label` for the Drawer. Set this when there is NO `header` for accessibility.
41
+ * The `aria-label` for the DeprecatedDrawer. Set this when there is NO `header` for accessibility.
34
42
  */
35
43
  'aria-label'?: string;
36
44
  /**
37
- * The role of the Drawer. If `role` is provided, you must also set `aria-labelledby` to link `header` to the `role`.
45
+ * The role of the DeprecatedDrawer. If `role` is provided, you must also set `aria-labelledby` to link `header` to the `role`.
38
46
  */
39
47
  role?: string;
40
48
  }
41
- export declare enum DrawerDirection {
49
+ /**
50
+ * ### Deprecated Drawer Direction
51
+ *
52
+ * As of Canvas Kit v8, Drawer is being soft-deprecated.
53
+ * It will be hard-deprecated (completely removed) in v9. Please see the
54
+ * [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
55
+ * for more information.
56
+ */
57
+ export declare enum DeprecatedDrawerDirection {
42
58
  Left = 0,
43
59
  Right = 1
44
60
  }
45
- export default class Drawer extends React.Component<DrawerProps, {}> {
46
- static OpenDirection: typeof DrawerDirection;
61
+ /**
62
+ * ### Deprecated Drawer
63
+ *
64
+ * As of Canvas Kit v8, this component is being soft-deprecated.
65
+ * It will be hard-deprecated (completely removed) in v9. Please see the
66
+ * [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
67
+ * for more information.
68
+ */
69
+ export declare class DeprecatedDrawer extends React.Component<DeprecatedDrawerProps, {}> {
70
+ static OpenDirection: typeof DeprecatedDrawerDirection;
71
+ componentDidMount(): void;
47
72
  render(): JSX.Element;
48
73
  }
49
74
  //# sourceMappingURL=Drawer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../../../drawer/lib/Drawer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAgB,iBAAiB,EAAC,MAAM,kCAAkC,CAAC;AAElF,MAAM,WAAW,WAAY,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACvE;;;OAGG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B;;;OAGG;IACH,aAAa,CAAC,EAAE,eAAe,CAAC;IAChC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IAC5B;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,oBAAY,eAAe;IACzB,IAAI,IAAA;IACJ,KAAK,IAAA;CACN;AA4CD,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,KAAK,CAAC,SAAS,CAAC,WAAW,EAAE,EAAE,CAAC;IAClE,MAAM,CAAC,aAAa,yBAAmB;IAEhC,MAAM;CAyBd"}
1
+ {"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../../../drawer/lib/Drawer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAgB,iBAAiB,EAAC,MAAM,kCAAkC,CAAC;AAElF;;;;;;;GAOG;AAEH,MAAM,WAAW,qBAAsB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACjF;;;OAGG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B;;;OAGG;IACH,aAAa,CAAC,EAAE,yBAAyB,CAAC;IAC1C;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IAC5B;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;GAOG;AAEH,oBAAY,yBAAyB;IACnC,IAAI,IAAA;IACJ,KAAK,IAAA;CACN;AA6CD;;;;;;;GAOG;AAEH,qBAAa,gBAAiB,SAAQ,KAAK,CAAC,SAAS,CAAC,qBAAqB,EAAE,EAAE,CAAC;IAC9E,MAAM,CAAC,aAAa,mCAA6B;IAEjD,iBAAiB;IASV,MAAM;CAyBd"}
@@ -36,11 +36,19 @@ var __rest = (this && this.__rest) || function (s, e) {
36
36
  import * as React from 'react';
37
37
  import styled from '@emotion/styled';
38
38
  import { colors, space } from '@workday/canvas-kit-react/tokens';
39
- export var DrawerDirection;
40
- (function (DrawerDirection) {
41
- DrawerDirection[DrawerDirection["Left"] = 0] = "Left";
42
- DrawerDirection[DrawerDirection["Right"] = 1] = "Right";
43
- })(DrawerDirection || (DrawerDirection = {}));
39
+ /**
40
+ * ### Deprecated Drawer Direction
41
+ *
42
+ * As of Canvas Kit v8, Drawer is being soft-deprecated.
43
+ * It will be hard-deprecated (completely removed) in v9. Please see the
44
+ * [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
45
+ * for more information.
46
+ */
47
+ export var DeprecatedDrawerDirection;
48
+ (function (DeprecatedDrawerDirection) {
49
+ DeprecatedDrawerDirection[DeprecatedDrawerDirection["Left"] = 0] = "Left";
50
+ DeprecatedDrawerDirection[DeprecatedDrawerDirection["Right"] = 1] = "Right";
51
+ })(DeprecatedDrawerDirection || (DeprecatedDrawerDirection = {}));
44
52
  var DrawerContainer = styled('div')({
45
53
  height: '100%',
46
54
  backgroundColor: 'white',
@@ -55,26 +63,25 @@ var DrawerContainer = styled('div')({
55
63
  }, function (_a) {
56
64
  var showDropShadow = _a.showDropShadow, openDirection = _a.openDirection;
57
65
  return ({
58
- boxShadow: openDirection === DrawerDirection.Right && showDropShadow
66
+ boxShadow: openDirection === DeprecatedDrawerDirection.Right && showDropShadow
59
67
  ? '-8px 0px 16px 0 rgba(0,0,0,0.12)'
60
- : openDirection === DrawerDirection.Left && showDropShadow
68
+ : openDirection === DeprecatedDrawerDirection.Left && showDropShadow
61
69
  ? '8px 0px 16px 0 rgba(0,0,0,0.12)'
62
70
  : undefined,
63
71
  });
64
72
  }, function (_a) {
65
73
  var openDirection = _a.openDirection;
66
74
  return ({
67
- borderLeft: openDirection === DrawerDirection.Right ? "1px solid " + colors.soap400 : undefined,
68
- borderRight: openDirection === DrawerDirection.Left ? "1px solid " + colors.soap400 : undefined,
69
- right: openDirection === DrawerDirection.Right ? space.zero : undefined,
70
- left: openDirection === DrawerDirection.Left ? space.zero : undefined,
75
+ borderLeft: openDirection === DeprecatedDrawerDirection.Right ? "1px solid " + colors.soap400 : undefined,
76
+ borderRight: openDirection === DeprecatedDrawerDirection.Left ? "1px solid " + colors.soap400 : undefined,
77
+ right: openDirection === DeprecatedDrawerDirection.Right ? space.zero : undefined,
78
+ left: openDirection === DeprecatedDrawerDirection.Left ? space.zero : undefined,
71
79
  });
72
80
  });
73
81
  var ChildrenContainer = styled('div')({
74
82
  height: '100%',
75
83
  overflowY: 'auto',
76
84
  wordBreak: 'break-word',
77
- wordWrap: 'break-word',
78
85
  position: 'relative',
79
86
  }, function (_a) {
80
87
  var padding = _a.padding;
@@ -82,18 +89,29 @@ var ChildrenContainer = styled('div')({
82
89
  padding: padding,
83
90
  });
84
91
  });
85
- var Drawer = /** @class */ (function (_super) {
86
- __extends(Drawer, _super);
87
- function Drawer() {
92
+ /**
93
+ * ### Deprecated Drawer
94
+ *
95
+ * As of Canvas Kit v8, this component is being soft-deprecated.
96
+ * It will be hard-deprecated (completely removed) in v9. Please see the
97
+ * [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
98
+ * for more information.
99
+ */
100
+ var DeprecatedDrawer = /** @class */ (function (_super) {
101
+ __extends(DeprecatedDrawer, _super);
102
+ function DeprecatedDrawer() {
88
103
  return _super !== null && _super.apply(this, arguments) || this;
89
104
  }
90
- Drawer.prototype.render = function () {
91
- var _a = this.props, _b = _a.padding, padding = _b === void 0 ? space.s : _b, _c = _a.width, width = _c === void 0 ? 360 : _c, _d = _a.openDirection, openDirection = _d === void 0 ? DrawerDirection.Right : _d, _e = _a.showDropShadow, showDropShadow = _e === void 0 ? false : _e, children = _a.children, header = _a.header, role = _a.role, elemProps = __rest(_a, ["padding", "width", "openDirection", "showDropShadow", "children", "header", "role"]);
105
+ DeprecatedDrawer.prototype.componentDidMount = function () {
106
+ console.warn("This component is being deprecated and will be removed in Canvas Kit V9.\n\n For more information, please see the V8 upgrade guide:\n\n https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page\n ");
107
+ };
108
+ DeprecatedDrawer.prototype.render = function () {
109
+ var _a = this.props, _b = _a.padding, padding = _b === void 0 ? space.s : _b, _c = _a.width, width = _c === void 0 ? 360 : _c, _d = _a.openDirection, openDirection = _d === void 0 ? DeprecatedDrawerDirection.Right : _d, _e = _a.showDropShadow, showDropShadow = _e === void 0 ? false : _e, children = _a.children, header = _a.header, role = _a.role, elemProps = __rest(_a, ["padding", "width", "openDirection", "showDropShadow", "children", "header", "role"]);
92
110
  return (React.createElement(DrawerContainer, __assign({ role: role }, elemProps, { showDropShadow: showDropShadow, width: width, openDirection: openDirection }),
93
111
  header,
94
112
  React.createElement(ChildrenContainer, { padding: padding }, children)));
95
113
  };
96
- Drawer.OpenDirection = DrawerDirection;
97
- return Drawer;
114
+ DeprecatedDrawer.OpenDirection = DeprecatedDrawerDirection;
115
+ return DeprecatedDrawer;
98
116
  }(React.Component));
99
- export default Drawer;
117
+ export { DeprecatedDrawer };
@@ -1,12 +1,20 @@
1
1
  import * as React from 'react';
2
2
  import { CanvasColor } from '@workday/canvas-kit-react/tokens';
3
- export interface DrawerHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
3
+ /**
4
+ * ### Deprecated Drawer Header Props
5
+ *
6
+ * As of Canvas Kit v8, this component is being soft-deprecated.
7
+ * It will be hard-deprecated (completely removed) in v9. Please see the
8
+ * [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
9
+ * for more information.
10
+ */
11
+ export interface DeprecatedDrawerHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
4
12
  /**
5
- * The text of the DrawerHeader. This text will also be applied as the `title` attribute of the header element.
13
+ * The text of the DeprecatedDrawerHeader. This text will also be applied as the `title` attribute of the header element.
6
14
  */
7
15
  title?: string;
8
16
  /**
9
- * The function called when the DrawerHeader close button is clicked.
17
+ * The function called when the DeprecatedDrawerHeader close button is clicked.
10
18
  */
11
19
  onClose?: React.MouseEventHandler<HTMLButtonElement>;
12
20
  /**
@@ -15,11 +23,11 @@ export interface DrawerHeaderProps extends React.HTMLAttributes<HTMLDivElement>
15
23
  */
16
24
  closeIconAriaLabel?: string;
17
25
  /**
18
- * The background color of the DrawerHeader.
26
+ * The background color of the DeprecatedDrawerHeader.
19
27
  */
20
28
  headerColor?: CanvasColor | string;
21
29
  /**
22
- * The border color of the DrawerHeader. This should match something close to `headerColor`.
30
+ * The border color of the DeprecatedDrawerHeader. This should match something close to `headerColor`.
23
31
  */
24
32
  borderColor?: CanvasColor | string;
25
33
  /**
@@ -28,11 +36,20 @@ export interface DrawerHeaderProps extends React.HTMLAttributes<HTMLDivElement>
28
36
  */
29
37
  inverse?: boolean;
30
38
  /**
31
- * The unique id of the DrawerHeader for accessibility.
39
+ * The unique id of the DeprecatedDrawerHeader for accessibility.
32
40
  */
33
41
  id?: string;
34
42
  }
35
- export default class DrawerHeader extends React.Component<DrawerHeaderProps, {}> {
43
+ /**
44
+ * ### Deprecated Drawer Header
45
+ *
46
+ * As of Canvas Kit v8, this component is being soft-deprecated.
47
+ * It will be hard-deprecated (completely removed) in v9. Please see the
48
+ * [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
49
+ * for more information.
50
+ */
51
+ export declare class DeprecatedDrawerHeader extends React.Component<DeprecatedDrawerHeaderProps, {}> {
52
+ componentDidMount(): void;
36
53
  render(): JSX.Element;
37
54
  }
38
55
  //# sourceMappingURL=DrawerHeader.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DrawerHeader.d.ts","sourceRoot":"","sources":["../../../../drawer/lib/DrawerHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAsB,WAAW,EAAa,MAAM,kCAAkC,CAAC;AAI9F,MAAM,WAAW,iBAAkB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC7E;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IACrD;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,GAAG,MAAM,CAAC;IACnC;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,GAAG,MAAM,CAAC;IACnC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAsCD,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,KAAK,CAAC,SAAS,CAAC,iBAAiB,EAAE,EAAE,CAAC;IACvE,MAAM;CA4Bd"}
1
+ {"version":3,"file":"DrawerHeader.d.ts","sourceRoot":"","sources":["../../../../drawer/lib/DrawerHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAgB,WAAW,EAAa,MAAM,kCAAkC,CAAC;AAKxF;;;;;;;GAOG;AAEH,MAAM,WAAW,2BAA4B,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACvF;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IACrD;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,GAAG,MAAM,CAAC;IACnC;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,GAAG,MAAM,CAAC;IACnC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AA0BD;;;;;;;GAOG;AAEH,qBAAa,sBAAuB,SAAQ,KAAK,CAAC,SAAS,CAAC,2BAA2B,EAAE,EAAE,CAAC;IAC1F,iBAAiB;IASV,MAAM;CAwCd"}
@@ -35,8 +35,9 @@ var __rest = (this && this.__rest) || function (s, e) {
35
35
  };
36
36
  import * as React from 'react';
37
37
  import styled from '@emotion/styled';
38
- import { colors, space, type, typeColors } from '@workday/canvas-kit-react/tokens';
38
+ import { colors, space, typeColors } from '@workday/canvas-kit-react/tokens';
39
39
  import { TertiaryButton } from '@workday/canvas-kit-react/button';
40
+ import { Text } from '@workday/canvas-kit-react/text';
40
41
  import { xIcon } from '@workday/canvas-system-icons-web';
41
42
  var headerHeight = 56;
42
43
  var HeaderContainer = styled('div')({
@@ -56,26 +57,32 @@ var HeaderContainer = styled('div')({
56
57
  backgroundColor: headerColor,
57
58
  });
58
59
  });
59
- var HeaderTitle = styled('h4')(__assign(__assign({}, type.levels.body.small), { fontWeight: type.properties.fontWeights.bold, whiteSpace: 'nowrap', textOverflow: 'ellipsis', overflow: 'hidden', paddingRight: space.xxxs }), function (_a) {
60
- var inverse = _a.inverse;
61
- return ({
62
- color: inverse ? colors.frenchVanilla100 : typeColors.heading,
63
- });
64
- });
65
60
  var CloseButton = styled(TertiaryButton)({
66
61
  margin: '-8px',
67
62
  });
68
- var DrawerHeader = /** @class */ (function (_super) {
69
- __extends(DrawerHeader, _super);
70
- function DrawerHeader() {
63
+ /**
64
+ * ### Deprecated Drawer Header
65
+ *
66
+ * As of Canvas Kit v8, this component is being soft-deprecated.
67
+ * It will be hard-deprecated (completely removed) in v9. Please see the
68
+ * [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
69
+ * for more information.
70
+ */
71
+ var DeprecatedDrawerHeader = /** @class */ (function (_super) {
72
+ __extends(DeprecatedDrawerHeader, _super);
73
+ function DeprecatedDrawerHeader() {
71
74
  return _super !== null && _super.apply(this, arguments) || this;
72
75
  }
73
- DrawerHeader.prototype.render = function () {
76
+ DeprecatedDrawerHeader.prototype.componentDidMount = function () {
77
+ console.warn("This component is being deprecated and will be removed in Canvas Kit V9.\n\n For more information, please see the V8 upgrade guide:\n\n https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page\n ");
78
+ };
79
+ DeprecatedDrawerHeader.prototype.render = function () {
74
80
  var _a = this.props, _b = _a.closeIconAriaLabel, closeIconAriaLabel = _b === void 0 ? 'Close' : _b, _c = _a.headerColor, headerColor = _c === void 0 ? colors.soap100 : _c, _d = _a.borderColor, borderColor = _d === void 0 ? colors.soap500 : _d, _e = _a.inverse, inverse = _e === void 0 ? false : _e, onClose = _a.onClose, title = _a.title, id = _a.id, elemProps = __rest(_a, ["closeIconAriaLabel", "headerColor", "borderColor", "inverse", "onClose", "title", "id"]);
81
+ var variant = inverse ? 'inverse' : undefined;
75
82
  return (React.createElement(HeaderContainer, __assign({ borderColor: borderColor }, elemProps, { headerColor: headerColor }),
76
- React.createElement(HeaderTitle, { id: id, inverse: inverse, title: title }, title),
77
- onClose && closeIconAriaLabel && (React.createElement(CloseButton, { variant: inverse ? 'inverse' : undefined, onClick: onClose, "aria-label": closeIconAriaLabel, icon: xIcon }))));
83
+ React.createElement(Text, { as: "h4", typeLevel: "body.small", title: title, fontWeight: "bold", color: typeColors.heading, variant: variant, paddingInlineEnd: "xxxs", whiteSpace: "nowrap", textOverflow: "ellipsis", overflow: "hidden" }, title),
84
+ onClose && closeIconAriaLabel && (React.createElement(CloseButton, { variant: variant, onClick: onClose, "aria-label": closeIconAriaLabel, icon: xIcon }))));
78
85
  };
79
- return DrawerHeader;
86
+ return DeprecatedDrawerHeader;
80
87
  }(React.Component));
81
- export default DrawerHeader;
88
+ export { DeprecatedDrawerHeader };
@@ -0,0 +1,3 @@
1
+ export * from './lib/Expandable';
2
+ export * from './lib/hooks';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../expandable/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './lib/Expandable';
2
+ export * from './lib/hooks';
@@ -0,0 +1,75 @@
1
+ import React from 'react';
2
+ import { ExtractProps } from '@workday/canvas-kit-react/common';
3
+ import { Flex } from '@workday/canvas-kit-react/layout';
4
+ export interface ExpandableProps extends ExtractProps<typeof Flex, never> {
5
+ /**
6
+ * The children of the `Expandable` container. This should contain `Expandable.Target` and
7
+ * `Expandable.Container`
8
+ */
9
+ children?: React.ReactNode;
10
+ }
11
+ export declare const Expandable: import("@workday/canvas-kit-react/common").ElementComponentM<"div", ExpandableProps & Partial<{
12
+ id: string;
13
+ initialVisibility: import("@workday/canvas-kit-react/disclosure").Visibility;
14
+ }> & {
15
+ onShow?: ((data: Event | React.SyntheticEvent<Element, Event> | undefined, prevState: {
16
+ id: string;
17
+ visibility: import("@workday/canvas-kit-react/disclosure").Visibility;
18
+ }) => void) | undefined;
19
+ onHide?: ((data: Event | React.SyntheticEvent<Element, Event> | undefined, prevState: {
20
+ id: string;
21
+ visibility: import("@workday/canvas-kit-react/disclosure").Visibility;
22
+ }) => void) | undefined;
23
+ } & {
24
+ shouldShow?: ((data: Event | React.SyntheticEvent<Element, Event> | undefined, state: {
25
+ id: string;
26
+ visibility: import("@workday/canvas-kit-react/disclosure").Visibility;
27
+ }) => boolean) | undefined;
28
+ shouldHide?: ((data: Event | React.SyntheticEvent<Element, Event> | undefined, state: {
29
+ id: string;
30
+ visibility: import("@workday/canvas-kit-react/disclosure").Visibility;
31
+ }) => boolean) | undefined;
32
+ }, {
33
+ state: {
34
+ id: string;
35
+ visibility: import("@workday/canvas-kit-react/disclosure").Visibility;
36
+ };
37
+ events: {
38
+ show(event?: Event | React.SyntheticEvent<Element, Event> | undefined): void;
39
+ hide(event?: Event | React.SyntheticEvent<Element, Event> | undefined): void;
40
+ };
41
+ }> & {
42
+ Target: import("@workday/canvas-kit-react/common").ElementComponentM<"button", import("./ExpandableTarget").ExpandableTargetProps, {
43
+ state: {
44
+ id: string;
45
+ visibility: import("@workday/canvas-kit-react/disclosure").Visibility;
46
+ };
47
+ events: {
48
+ show(event?: Event | React.SyntheticEvent<Element, Event> | undefined): void;
49
+ hide(event?: Event | React.SyntheticEvent<Element, Event> | undefined): void;
50
+ };
51
+ }>;
52
+ Content: import("@workday/canvas-kit-react/common").ElementComponentM<"div", import("./ExpandableContent").ExpandableContentProps, {
53
+ state: {
54
+ id: string;
55
+ visibility: import("@workday/canvas-kit-react/disclosure").Visibility;
56
+ };
57
+ events: {
58
+ show(event?: Event | React.SyntheticEvent<Element, Event> | undefined): void;
59
+ hide(event?: Event | React.SyntheticEvent<Element, Event> | undefined): void;
60
+ };
61
+ }>;
62
+ Icon: import("@workday/canvas-kit-react/common").ElementComponentM<"span", import("./ExpandableIcon").ExpandableIconProps, {
63
+ state: {
64
+ id: string;
65
+ visibility: import("@workday/canvas-kit-react/disclosure").Visibility;
66
+ };
67
+ events: {
68
+ show(event?: Event | React.SyntheticEvent<Element, Event> | undefined): void;
69
+ hide(event?: Event | React.SyntheticEvent<Element, Event> | undefined): void;
70
+ };
71
+ }>;
72
+ Avatar: import("@workday/canvas-kit-react/common").ElementComponent<"button", import("./ExpandableAvatar").ExpandableAvatarProps>;
73
+ Title: import("@workday/canvas-kit-react/common").ElementComponent<"div", import("./ExpandableTitle").ExpandableTitleProps>;
74
+ };
75
+ //# sourceMappingURL=Expandable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Expandable.d.ts","sourceRoot":"","sources":["../../../../expandable/lib/Expandable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAkB,YAAY,EAAC,MAAM,kCAAkC,CAAC;AAO/E,OAAO,EAAC,IAAI,EAAC,MAAM,kCAAkC,CAAC;AAGtD,MAAM,WAAW,eAAgB,SAAQ,YAAY,CAAC,OAAO,IAAI,EAAE,KAAK,CAAC;IACvE;;;OAGG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAarB,CAAC"}
@@ -0,0 +1,44 @@
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 React from 'react';
24
+ import { createContainer } from '@workday/canvas-kit-react/common';
25
+ import { ExpandableContent } from './ExpandableContent';
26
+ import { ExpandableTarget } from './ExpandableTarget';
27
+ import { ExpandableIcon } from './ExpandableIcon';
28
+ import { ExpandableTitle } from './ExpandableTitle';
29
+ import { ExpandableAvatar } from './ExpandableAvatar';
30
+ import { Flex } from '@workday/canvas-kit-react/layout';
31
+ import { useExpandableModel } from './useExpandableModel';
32
+ export var Expandable = createContainer('div')({
33
+ modelHook: useExpandableModel,
34
+ subComponents: {
35
+ Target: ExpandableTarget,
36
+ Content: ExpandableContent,
37
+ Icon: ExpandableIcon,
38
+ Avatar: ExpandableAvatar,
39
+ Title: ExpandableTitle,
40
+ },
41
+ })(function (_a, Element) {
42
+ var children = _a.children, elementProps = __rest(_a, ["children"]);
43
+ return (React.createElement(Flex, __assign({ as: Element, flexDirection: 'column', padding: 'xxs' }, elementProps), children));
44
+ });
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { ExtractProps } from '@workday/canvas-kit-react/common';
3
+ import { Avatar } from '@workday/canvas-kit-react/avatar';
4
+ export interface ExpandableAvatarProps extends Omit<ExtractProps<typeof Avatar, never>, keyof React.ButtonHTMLAttributes<HTMLButtonElement>> {
5
+ }
6
+ export declare const ExpandableAvatar: import("@workday/canvas-kit-react/common").ElementComponent<"button", ExpandableAvatarProps>;
7
+ //# sourceMappingURL=ExpandableAvatar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpandableAvatar.d.ts","sourceRoot":"","sources":["../../../../expandable/lib/ExpandableAvatar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAkB,YAAY,EAAqB,MAAM,kCAAkC,CAAC;AACnG,OAAO,EAAC,MAAM,EAAC,MAAM,kCAAkC,CAAC;AAGxD,MAAM,WAAW,qBACf,SAAQ,IAAI,CACV,YAAY,CAAC,OAAO,MAAM,EAAE,KAAK,CAAC,EAClC,MAAM,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,CACpD;CAAG;AAUN,eAAO,MAAM,gBAAgB,8FAK3B,CAAC"}
@@ -0,0 +1,40 @@
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 React from 'react';
24
+ import { createComponent, styled } from '@workday/canvas-kit-react/common';
25
+ import { Avatar } from '@workday/canvas-kit-react/avatar';
26
+ import { space } from '@workday/canvas-kit-react/tokens';
27
+ var StyledAvatar = styled(Avatar)({
28
+ marginRight: space.xxs,
29
+ flexShrink: 0,
30
+ });
31
+ // When the component is created, it needs to be a button element to match AvatarProps.
32
+ // Once Avatar becomes a `createComponent` we can default the element type to a `div`
33
+ // and the types should be properly extracted
34
+ export var ExpandableAvatar = createComponent('button')({
35
+ displayName: 'Expandable.Avatar',
36
+ Component: function (_a, ref) {
37
+ var altText = _a.altText, elemProps = __rest(_a, ["altText"]);
38
+ return React.createElement(StyledAvatar, __assign({ altText: undefined, as: "div", ref: ref, size: 32 }, elemProps));
39
+ },
40
+ });