@workday/canvas-kit-labs-react 7.0.0-alpha.129-next.3 → 7.0.0-alpha.256-next.2

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 (228) hide show
  1. package/combobox/README.md +4 -4
  2. package/combobox/lib/AutocompleteList.tsx +4 -5
  3. package/combobox/lib/Combobox.tsx +10 -14
  4. package/common/index.ts +0 -2
  5. package/common/lib/theming/useThemeRTL.ts +11 -13
  6. package/dist/commonjs/combobox/lib/AutocompleteList.d.ts +2 -3
  7. package/dist/commonjs/combobox/lib/AutocompleteList.d.ts.map +1 -1
  8. package/dist/commonjs/combobox/lib/Combobox.d.ts +3 -4
  9. package/dist/commonjs/combobox/lib/Combobox.d.ts.map +1 -1
  10. package/dist/commonjs/combobox/lib/Combobox.js +1 -5
  11. package/dist/commonjs/common/index.d.ts +0 -2
  12. package/dist/commonjs/common/index.d.ts.map +1 -1
  13. package/dist/commonjs/common/index.js +0 -5
  14. package/dist/commonjs/common/lib/theming/useThemeRTL.d.ts.map +1 -1
  15. package/dist/commonjs/common/lib/theming/useThemeRTL.js +6 -8
  16. package/dist/commonjs/drawer/index.d.ts +1 -1
  17. package/dist/commonjs/drawer/index.d.ts.map +1 -1
  18. package/dist/commonjs/drawer/index.js +2 -2
  19. package/dist/commonjs/drawer/lib/Drawer.d.ts +39 -14
  20. package/dist/commonjs/drawer/lib/Drawer.d.ts.map +1 -1
  21. package/dist/commonjs/drawer/lib/Drawer.js +39 -21
  22. package/dist/commonjs/drawer/lib/DrawerHeader.d.ts +24 -7
  23. package/dist/commonjs/drawer/lib/DrawerHeader.d.ts.map +1 -1
  24. package/dist/commonjs/drawer/lib/DrawerHeader.js +22 -15
  25. package/dist/commonjs/expandable/index.d.ts +3 -0
  26. package/dist/commonjs/expandable/index.d.ts.map +1 -0
  27. package/dist/commonjs/expandable/index.js +14 -0
  28. package/dist/commonjs/expandable/lib/Expandable.d.ts +75 -0
  29. package/dist/commonjs/expandable/lib/Expandable.d.ts.map +1 -0
  30. package/dist/commonjs/expandable/lib/Expandable.js +50 -0
  31. package/dist/commonjs/expandable/lib/ExpandableAvatar.d.ts +7 -0
  32. package/dist/commonjs/expandable/lib/ExpandableAvatar.d.ts.map +1 -0
  33. package/dist/commonjs/expandable/lib/ExpandableAvatar.js +46 -0
  34. package/dist/commonjs/expandable/lib/ExpandableContent.d.ts +19 -0
  35. package/dist/commonjs/expandable/lib/ExpandableContent.d.ts.map +1 -0
  36. package/dist/commonjs/expandable/lib/ExpandableContent.js +41 -0
  37. package/dist/commonjs/expandable/lib/ExpandableIcon.d.ts +29 -0
  38. package/dist/commonjs/expandable/lib/ExpandableIcon.d.ts.map +1 -0
  39. package/dist/commonjs/expandable/lib/ExpandableIcon.js +62 -0
  40. package/dist/commonjs/expandable/lib/ExpandableTarget.d.ts +28 -0
  41. package/dist/commonjs/expandable/lib/ExpandableTarget.d.ts.map +1 -0
  42. package/dist/commonjs/expandable/lib/ExpandableTarget.js +48 -0
  43. package/dist/commonjs/expandable/lib/ExpandableTitle.d.ts +9 -0
  44. package/dist/commonjs/expandable/lib/ExpandableTitle.d.ts.map +1 -0
  45. package/dist/commonjs/expandable/lib/ExpandableTitle.js +39 -0
  46. package/dist/commonjs/expandable/lib/hooks/index.d.ts +4 -0
  47. package/dist/commonjs/expandable/lib/hooks/index.d.ts.map +1 -0
  48. package/dist/commonjs/expandable/lib/hooks/index.js +15 -0
  49. package/dist/commonjs/expandable/lib/hooks/useExpandableContent.d.ts +20 -0
  50. package/dist/commonjs/expandable/lib/hooks/useExpandableContent.d.ts.map +1 -0
  51. package/dist/commonjs/expandable/lib/hooks/useExpandableContent.js +12 -0
  52. package/dist/commonjs/expandable/lib/hooks/useExpandableIcon.d.ts +15 -0
  53. package/dist/commonjs/expandable/lib/hooks/useExpandableIcon.d.ts.map +1 -0
  54. package/dist/commonjs/expandable/lib/hooks/useExpandableIcon.js +11 -0
  55. package/dist/commonjs/expandable/lib/hooks/useExpandableTarget.d.ts +17 -0
  56. package/dist/commonjs/expandable/lib/hooks/useExpandableTarget.d.ts.map +1 -0
  57. package/dist/commonjs/expandable/lib/hooks/useExpandableTarget.js +20 -0
  58. package/dist/commonjs/expandable/lib/useExpandableModel.d.ts +50 -0
  59. package/dist/commonjs/expandable/lib/useExpandableModel.d.ts.map +1 -0
  60. package/dist/commonjs/expandable/lib/useExpandableModel.js +24 -0
  61. package/dist/commonjs/index.d.ts +2 -0
  62. package/dist/commonjs/index.d.ts.map +1 -1
  63. package/dist/commonjs/index.js +2 -0
  64. package/dist/commonjs/search-form/lib/SearchForm.d.ts +1 -2
  65. package/dist/commonjs/search-form/lib/SearchForm.d.ts.map +1 -1
  66. package/dist/commonjs/search-form/lib/SearchForm.js +2 -4
  67. package/dist/commonjs/toast/index.d.ts +3 -0
  68. package/dist/commonjs/toast/index.d.ts.map +1 -0
  69. package/dist/commonjs/toast/index.js +14 -0
  70. package/dist/commonjs/toast/lib/Toast.d.ts +27 -0
  71. package/dist/commonjs/toast/lib/Toast.d.ts.map +1 -0
  72. package/dist/commonjs/toast/lib/Toast.js +78 -0
  73. package/dist/commonjs/toast/lib/ToastBody.d.ts +6 -0
  74. package/dist/commonjs/toast/lib/ToastBody.d.ts.map +1 -0
  75. package/dist/commonjs/toast/lib/ToastBody.js +40 -0
  76. package/dist/commonjs/toast/lib/ToastCloseIcon.d.ts +6 -0
  77. package/dist/commonjs/toast/lib/ToastCloseIcon.d.ts.map +1 -0
  78. package/dist/commonjs/toast/lib/ToastCloseIcon.js +43 -0
  79. package/dist/commonjs/toast/lib/ToastIcon.d.ts +5 -0
  80. package/dist/commonjs/toast/lib/ToastIcon.d.ts.map +1 -0
  81. package/dist/commonjs/toast/lib/ToastIcon.js +26 -0
  82. package/dist/commonjs/toast/lib/ToastLink.d.ts +9 -0
  83. package/dist/commonjs/toast/lib/ToastLink.d.ts.map +1 -0
  84. package/dist/commonjs/toast/lib/ToastLink.js +42 -0
  85. package/dist/commonjs/toast/lib/ToastMessage.d.ts +11 -0
  86. package/dist/commonjs/toast/lib/ToastMessage.d.ts.map +1 -0
  87. package/dist/commonjs/toast/lib/ToastMessage.js +41 -0
  88. package/dist/commonjs/toast/lib/hooks/useToastModel.d.ts +65 -0
  89. package/dist/commonjs/toast/lib/hooks/useToastModel.d.ts.map +1 -0
  90. package/dist/commonjs/toast/lib/hooks/useToastModel.js +35 -0
  91. package/dist/es6/combobox/lib/AutocompleteList.d.ts +2 -3
  92. package/dist/es6/combobox/lib/AutocompleteList.d.ts.map +1 -1
  93. package/dist/es6/combobox/lib/Combobox.d.ts +3 -4
  94. package/dist/es6/combobox/lib/Combobox.d.ts.map +1 -1
  95. package/dist/es6/combobox/lib/Combobox.js +1 -5
  96. package/dist/es6/common/index.d.ts +0 -2
  97. package/dist/es6/common/index.d.ts.map +1 -1
  98. package/dist/es6/common/index.js +0 -2
  99. package/dist/es6/common/lib/theming/useThemeRTL.d.ts.map +1 -1
  100. package/dist/es6/common/lib/theming/useThemeRTL.js +7 -9
  101. package/dist/es6/drawer/index.d.ts +1 -1
  102. package/dist/es6/drawer/index.d.ts.map +1 -1
  103. package/dist/es6/drawer/index.js +1 -1
  104. package/dist/es6/drawer/lib/Drawer.d.ts +39 -14
  105. package/dist/es6/drawer/lib/Drawer.d.ts.map +1 -1
  106. package/dist/es6/drawer/lib/Drawer.js +38 -20
  107. package/dist/es6/drawer/lib/DrawerHeader.d.ts +24 -7
  108. package/dist/es6/drawer/lib/DrawerHeader.d.ts.map +1 -1
  109. package/dist/es6/drawer/lib/DrawerHeader.js +22 -15
  110. package/dist/es6/expandable/index.d.ts +3 -0
  111. package/dist/es6/expandable/index.d.ts.map +1 -0
  112. package/dist/es6/expandable/index.js +2 -0
  113. package/dist/es6/expandable/lib/Expandable.d.ts +75 -0
  114. package/dist/es6/expandable/lib/Expandable.d.ts.map +1 -0
  115. package/dist/es6/expandable/lib/Expandable.js +44 -0
  116. package/dist/es6/expandable/lib/ExpandableAvatar.d.ts +7 -0
  117. package/dist/es6/expandable/lib/ExpandableAvatar.d.ts.map +1 -0
  118. package/dist/es6/expandable/lib/ExpandableAvatar.js +40 -0
  119. package/dist/es6/expandable/lib/ExpandableContent.d.ts +19 -0
  120. package/dist/es6/expandable/lib/ExpandableContent.d.ts.map +1 -0
  121. package/dist/es6/expandable/lib/ExpandableContent.js +35 -0
  122. package/dist/es6/expandable/lib/ExpandableIcon.d.ts +29 -0
  123. package/dist/es6/expandable/lib/ExpandableIcon.d.ts.map +1 -0
  124. package/dist/es6/expandable/lib/ExpandableIcon.js +56 -0
  125. package/dist/es6/expandable/lib/ExpandableTarget.d.ts +28 -0
  126. package/dist/es6/expandable/lib/ExpandableTarget.d.ts.map +1 -0
  127. package/dist/es6/expandable/lib/ExpandableTarget.js +42 -0
  128. package/dist/es6/expandable/lib/ExpandableTitle.d.ts +9 -0
  129. package/dist/es6/expandable/lib/ExpandableTitle.d.ts.map +1 -0
  130. package/dist/es6/expandable/lib/ExpandableTitle.js +33 -0
  131. package/dist/es6/expandable/lib/hooks/index.d.ts +4 -0
  132. package/dist/es6/expandable/lib/hooks/index.d.ts.map +1 -0
  133. package/dist/es6/expandable/lib/hooks/index.js +3 -0
  134. package/dist/es6/expandable/lib/hooks/useExpandableContent.d.ts +20 -0
  135. package/dist/es6/expandable/lib/hooks/useExpandableContent.d.ts.map +1 -0
  136. package/dist/es6/expandable/lib/hooks/useExpandableContent.js +9 -0
  137. package/dist/es6/expandable/lib/hooks/useExpandableIcon.d.ts +15 -0
  138. package/dist/es6/expandable/lib/hooks/useExpandableIcon.d.ts.map +1 -0
  139. package/dist/es6/expandable/lib/hooks/useExpandableIcon.js +8 -0
  140. package/dist/es6/expandable/lib/hooks/useExpandableTarget.d.ts +17 -0
  141. package/dist/es6/expandable/lib/hooks/useExpandableTarget.d.ts.map +1 -0
  142. package/dist/es6/expandable/lib/hooks/useExpandableTarget.js +17 -0
  143. package/dist/es6/expandable/lib/useExpandableModel.d.ts +50 -0
  144. package/dist/es6/expandable/lib/useExpandableModel.d.ts.map +1 -0
  145. package/dist/es6/expandable/lib/useExpandableModel.js +21 -0
  146. package/dist/es6/index.d.ts +2 -0
  147. package/dist/es6/index.d.ts.map +1 -1
  148. package/dist/es6/index.js +2 -0
  149. package/dist/es6/search-form/lib/SearchForm.d.ts +1 -2
  150. package/dist/es6/search-form/lib/SearchForm.d.ts.map +1 -1
  151. package/dist/es6/search-form/lib/SearchForm.js +2 -4
  152. package/dist/es6/toast/index.d.ts +3 -0
  153. package/dist/es6/toast/index.d.ts.map +1 -0
  154. package/dist/es6/toast/index.js +2 -0
  155. package/dist/es6/toast/lib/Toast.d.ts +27 -0
  156. package/dist/es6/toast/lib/Toast.d.ts.map +1 -0
  157. package/dist/es6/toast/lib/Toast.js +72 -0
  158. package/dist/es6/toast/lib/ToastBody.d.ts +6 -0
  159. package/dist/es6/toast/lib/ToastBody.d.ts.map +1 -0
  160. package/dist/es6/toast/lib/ToastBody.js +34 -0
  161. package/dist/es6/toast/lib/ToastCloseIcon.d.ts +6 -0
  162. package/dist/es6/toast/lib/ToastCloseIcon.d.ts.map +1 -0
  163. package/dist/es6/toast/lib/ToastCloseIcon.js +37 -0
  164. package/dist/es6/toast/lib/ToastIcon.d.ts +5 -0
  165. package/dist/es6/toast/lib/ToastIcon.d.ts.map +1 -0
  166. package/dist/es6/toast/lib/ToastIcon.js +20 -0
  167. package/dist/es6/toast/lib/ToastLink.d.ts +9 -0
  168. package/dist/es6/toast/lib/ToastLink.d.ts.map +1 -0
  169. package/dist/es6/toast/lib/ToastLink.js +36 -0
  170. package/dist/es6/toast/lib/ToastMessage.d.ts +11 -0
  171. package/dist/es6/toast/lib/ToastMessage.d.ts.map +1 -0
  172. package/dist/es6/toast/lib/ToastMessage.js +35 -0
  173. package/dist/es6/toast/lib/hooks/useToastModel.d.ts +65 -0
  174. package/dist/es6/toast/lib/hooks/useToastModel.d.ts.map +1 -0
  175. package/dist/es6/toast/lib/hooks/useToastModel.js +32 -0
  176. package/drawer/index.ts +1 -1
  177. package/drawer/lib/Drawer.tsx +61 -24
  178. package/drawer/lib/DrawerHeader.tsx +54 -26
  179. package/expandable/LICENSE +52 -0
  180. package/expandable/README.md +11 -0
  181. package/expandable/index.ts +2 -0
  182. package/expandable/lib/Expandable.tsx +34 -0
  183. package/expandable/lib/ExpandableAvatar.tsx +26 -0
  184. package/expandable/lib/ExpandableContent.tsx +32 -0
  185. package/expandable/lib/ExpandableIcon.tsx +74 -0
  186. package/expandable/lib/ExpandableTarget.tsx +67 -0
  187. package/expandable/lib/ExpandableTitle.tsx +34 -0
  188. package/expandable/lib/hooks/index.ts +3 -0
  189. package/expandable/lib/hooks/useExpandableContent.ts +9 -0
  190. package/expandable/lib/hooks/useExpandableIcon.ts +8 -0
  191. package/expandable/lib/hooks/useExpandableTarget.ts +16 -0
  192. package/expandable/lib/useExpandableModel.tsx +17 -0
  193. package/expandable/package.json +6 -0
  194. package/index.ts +2 -0
  195. package/package.json +4 -4
  196. package/search-form/lib/SearchForm.tsx +2 -6
  197. package/toast/LICENSE +52 -0
  198. package/toast/README.md +5 -0
  199. package/toast/index.ts +2 -0
  200. package/toast/lib/Toast.tsx +63 -0
  201. package/toast/lib/ToastBody.tsx +34 -0
  202. package/toast/lib/ToastCloseIcon.tsx +18 -0
  203. package/toast/lib/ToastIcon.tsx +24 -0
  204. package/toast/lib/ToastLink.tsx +27 -0
  205. package/toast/lib/ToastMessage.tsx +21 -0
  206. package/toast/lib/hooks/useToastModel.tsx +27 -0
  207. package/toast/package.json +6 -0
  208. package/common/lib/storybook-utils/ComponentStatesTable.tsx +0 -80
  209. package/common/lib/storybook-utils/permutateProps.ts +0 -47
  210. package/common/lib/storybook-utils/propTypes.ts +0 -15
  211. package/dist/commonjs/common/lib/storybook-utils/ComponentStatesTable.d.ts +0 -26
  212. package/dist/commonjs/common/lib/storybook-utils/ComponentStatesTable.d.ts.map +0 -1
  213. package/dist/commonjs/common/lib/storybook-utils/ComponentStatesTable.js +0 -48
  214. package/dist/commonjs/common/lib/storybook-utils/permutateProps.d.ts +0 -5
  215. package/dist/commonjs/common/lib/storybook-utils/permutateProps.d.ts.map +0 -1
  216. package/dist/commonjs/common/lib/storybook-utils/permutateProps.js +0 -47
  217. package/dist/commonjs/common/lib/storybook-utils/propTypes.d.ts +0 -15
  218. package/dist/commonjs/common/lib/storybook-utils/propTypes.d.ts.map +0 -1
  219. package/dist/commonjs/common/lib/storybook-utils/propTypes.js +0 -2
  220. package/dist/es6/common/lib/storybook-utils/ComponentStatesTable.d.ts +0 -26
  221. package/dist/es6/common/lib/storybook-utils/ComponentStatesTable.d.ts.map +0 -1
  222. package/dist/es6/common/lib/storybook-utils/ComponentStatesTable.js +0 -41
  223. package/dist/es6/common/lib/storybook-utils/permutateProps.d.ts +0 -5
  224. package/dist/es6/common/lib/storybook-utils/permutateProps.d.ts.map +0 -1
  225. package/dist/es6/common/lib/storybook-utils/permutateProps.js +0 -43
  226. package/dist/es6/common/lib/storybook-utils/propTypes.d.ts +0 -15
  227. package/dist/es6/common/lib/storybook-utils/propTypes.d.ts.map +0 -1
  228. package/dist/es6/common/lib/storybook-utils/propTypes.js +0 -1
@@ -24,7 +24,7 @@ See here for
24
24
 
25
25
  ```tsx
26
26
  import {Combobox} from '@workday/canvas-kit-labs-react/combobox';
27
- import {MenuItem} from '@workday/canvas-kit-preview-react/menu';
27
+ import {DeprecatedMenuItem} from '@workday/canvas-kit-preview-react/menu';
28
28
  import {TextInput} from '@workday/canvas-kit-react/text-input';
29
29
  import {FormField} from '@workday/canvas-kit-react/form-field';
30
30
 
@@ -32,7 +32,7 @@ const autocompleteCallback = event => console.log('Adjust menu items here')
32
32
 
33
33
  <FormField id='id-123' label='Example'>
34
34
  <Combobox
35
- autocompleteItems={[<MenuItem>Item 1</MenuItem>]}
35
+ autocompleteItems={[<DeprecatedMenuItem>Item 1</DeprecatedMenuItem>]}
36
36
  onChange={autocompleteCallback}
37
37
  onFocus={() => { console.log('focus') }}
38
38
  onBlur={() => { console.log('blur') }}
@@ -84,9 +84,9 @@ Default: `'Reset Search Input'`
84
84
 
85
85
  ---
86
86
 
87
- #### `autocompleteItems: React.ReactElement<MenuItemProps>[] | ComboBoxMenuItemGroup[]`
87
+ #### `autocompleteItems: React.ReactElement<DeprecatedMenuItemProps>[] | ComboBoxMenuItemGroup[]`
88
88
 
89
- > An array of MenuItems to show under the input. You can also optional group the results.
89
+ > An array of DeprecatedMenuItems to show under the input. You can also optional group the results.
90
90
 
91
91
  ---
92
92
 
@@ -2,7 +2,6 @@ import React, {Fragment, useState} from 'react';
2
2
  import styled from '@emotion/styled';
3
3
  import {space} from '@workday/canvas-kit-react/tokens';
4
4
  import {accessibleHide, generateUniqueId} from '@workday/canvas-kit-react/common';
5
- import {MenuItemProps} from '@workday/canvas-kit-preview-react/menu';
6
5
  import {ComboBoxMenuItemGroup, getOptionId, listBoxIdPart, getTextFromElement} from './Combobox';
7
6
 
8
7
  const Autocomplete = styled('ul')({
@@ -19,7 +18,7 @@ interface AutocompleteListProps {
19
18
  /**
20
19
  * The autocomplete items of the Combobox. This array of menu items is shown under the text input.
21
20
  */
22
- autocompleteItems: React.ReactElement<MenuItemProps>[] | ComboBoxMenuItemGroup[];
21
+ autocompleteItems: React.ReactElement<any>[] | ComboBoxMenuItemGroup[];
23
22
  /**
24
23
  * Index of the active autocomplete item
25
24
  */
@@ -29,7 +28,7 @@ interface AutocompleteListProps {
29
28
  */
30
29
  handleAutocompleteClick: (
31
30
  event: React.SyntheticEvent<Element, Event>,
32
- menuItemProps: MenuItemProps
31
+ menuItemProps: any
33
32
  ) => void;
34
33
  /**
35
34
  * The id of the form field.
@@ -65,7 +64,7 @@ export const AutocompleteList = ({
65
64
  };
66
65
 
67
66
  const createListItem = (
68
- listboxItem: React.ReactElement<MenuItemProps>,
67
+ listboxItem: React.ReactElement<any>,
69
68
  itemIndex: number,
70
69
  groupMessage?: string
71
70
  ) => {
@@ -127,7 +126,7 @@ export const AutocompleteList = ({
127
126
  return (
128
127
  <Autocomplete {...listBoxProps}>
129
128
  {(autocompleteItems as React.ReactElement<
130
- MenuItemProps
129
+ any
131
130
  >[]).map((listboxItem: React.ReactElement, index: number) =>
132
131
  createListItem(listboxItem, index)
133
132
  )}
@@ -8,7 +8,6 @@ import {
8
8
  useUniqueId,
9
9
  } from '@workday/canvas-kit-react/common';
10
10
  import {space, commonColors, borderRadius} from '@workday/canvas-kit-react/tokens';
11
- import {MenuItemProps} from '@workday/canvas-kit-preview-react/menu';
12
11
  import {Card} from '@workday/canvas-kit-react/card';
13
12
  import {TertiaryButton, TertiaryButtonProps} from '@workday/canvas-kit-react/button';
14
13
  import {xSmallIcon} from '@workday/canvas-system-icons-web';
@@ -19,9 +18,9 @@ import {Status} from './Status';
19
18
 
20
19
  export interface ComboBoxMenuItemGroup {
21
20
  // A non intractable header that logically separates autocomplete items
22
- header: React.ReactElement<MenuItemProps>;
21
+ header: React.ReactElement<any>;
23
22
  // A group of logically distinct autocomplete items
24
- items: React.ReactElement<MenuItemProps>[];
23
+ items: React.ReactElement<any>[];
25
24
  }
26
25
 
27
26
  export interface ComboboxProps extends GrowthBehavior, React.HTMLAttributes<HTMLElement> {
@@ -50,7 +49,7 @@ export interface ComboboxProps extends GrowthBehavior, React.HTMLAttributes<HTML
50
49
  /**
51
50
  * The autocomplete items of the Combobox. This array of menu items is shown under the text input.
52
51
  */
53
- autocompleteItems?: React.ReactElement<MenuItemProps>[] | ComboBoxMenuItemGroup[];
52
+ autocompleteItems?: React.ReactElement<any>[] | ComboBoxMenuItemGroup[];
54
53
  /**
55
54
  * The function called when the Combobox text input changes.
56
55
  */
@@ -182,7 +181,7 @@ export const Combobox = ({
182
181
  const [showingAutocomplete, setShowingAutocomplete] = useState(false);
183
182
  const [selectedAutocompleteIndex, setSelectedAutocompleteIndex] = useState<number | null>(null);
184
183
  const [interactiveAutocompleteItems, setInteractiveAutocompleteItems] = useState<
185
- React.ReactElement<MenuItemProps>[]
184
+ React.ReactElement<any>[]
186
185
  >([]);
187
186
  const [announcementText, setAnnouncementText] = useState('');
188
187
 
@@ -263,7 +262,7 @@ export const Combobox = ({
263
262
  }, [initialValue, setInputValue]);
264
263
 
265
264
  useEffect(() => {
266
- const getInteractiveAutocompleteItems = (): React.ReactElement<MenuItemProps>[] => {
265
+ const getInteractiveAutocompleteItems = (): React.ReactElement<any>[] => {
267
266
  if (
268
267
  autocompleteItems &&
269
268
  autocompleteItems.length &&
@@ -271,14 +270,14 @@ export const Combobox = ({
271
270
  ) {
272
271
  return flatten((autocompleteItems as ComboBoxMenuItemGroup[]).map(group => group.items));
273
272
  }
274
- return (autocompleteItems as React.ReactElement<MenuItemProps>[]) || [];
273
+ return (autocompleteItems as React.ReactElement<any>[]) || [];
275
274
  };
276
275
  setInteractiveAutocompleteItems(getInteractiveAutocompleteItems());
277
276
  }, [autocompleteItems]);
278
277
 
279
278
  const handleAutocompleteClick = (
280
279
  event: React.SyntheticEvent<Element, Event>,
281
- menuItemProps: MenuItemProps
280
+ menuItemProps: any
282
281
  ): void => {
283
282
  if (menuItemProps.isDisabled) {
284
283
  return;
@@ -313,11 +312,8 @@ export const Combobox = ({
313
312
 
314
313
  const handleBlur = (event: React.FocusEvent) => {
315
314
  if (comboboxRef.current) {
316
- let target: EventTarget | null = event.relatedTarget;
317
- if (target === null) {
318
- // IE11 swaps related and active target before it fires the blur event
319
- target = document.activeElement;
320
- }
315
+ const target: EventTarget | null = event.relatedTarget;
316
+
321
317
  if (target && comboboxRef.current.contains(target as Element)) {
322
318
  return;
323
319
  }
@@ -415,7 +411,7 @@ export const Combobox = ({
415
411
  };
416
412
 
417
413
  const renderChildren = (inputElement: React.ReactElement<TextInputProps>): React.ReactNode => {
418
- let cssOverride: CSSObject = {zIndex: 2};
414
+ let cssOverride: CSSObject = {':focus': {zIndex: 2}};
419
415
  if (showClearButton) {
420
416
  const paddingDirection = isRTL ? 'paddingLeft' : 'paddingRight';
421
417
  cssOverride = {
package/common/index.ts CHANGED
@@ -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,22 +1,20 @@
1
- import {
2
- convertToStaticStates,
3
- CanvasTheme,
4
- useIsRTL,
5
- useTheme,
6
- } from '@workday/canvas-kit-react/common';
1
+ import {CanvasTheme, useIsRTL, useTheme, StyleRewriteFn} from '@workday/canvas-kit-react/common';
7
2
  import {CSSProperties} from '@workday/canvas-kit-react/tokens';
8
3
  import {useMemo} from 'react';
9
4
  import rtlCSSJS from 'rtl-css-js';
10
5
 
11
6
  export type ComponentStyles = Record<string, CSSProperties>;
12
- type ThemeWithStaticStates = CanvasTheme & {_staticStates?: boolean};
7
+ type ThemeWithStaticStates = CanvasTheme & {_styleRewriteFn?: StyleRewriteFn};
13
8
 
14
9
  const getDirectionalStyles = (isRTL: boolean, ...styles: CSSProperties[]) => {
15
10
  return isRTL ? rtlCSSJS(styles) : styles;
16
11
  };
17
12
 
18
- const getConvertedStyles = (shouldConvert: boolean, styles: CSSProperties): CSSProperties => {
19
- return shouldConvert ? convertToStaticStates(styles) ?? styles : styles;
13
+ const getConvertedStyles = (
14
+ styles: CSSProperties,
15
+ convertFunc?: StyleRewriteFn
16
+ ): CSSProperties | undefined => {
17
+ return convertFunc ? convertFunc(styles) : styles;
20
18
  };
21
19
 
22
20
  /**
@@ -51,19 +49,19 @@ const getConvertedStyles = (shouldConvert: boolean, styles: CSSProperties): CSSP
51
49
  export function useThemeRTL() {
52
50
  const theme = useTheme();
53
51
  const direction = useIsRTL(theme);
54
- const shouldConvert = (theme.canvas as ThemeWithStaticStates)._staticStates ?? false;
52
+ const convertFunc = (theme.canvas as ThemeWithStaticStates)._styleRewriteFn;
55
53
 
56
54
  const themeRTL = useMemo(() => {
57
55
  return (...cssObject: CSSProperties[]) => {
58
56
  const styles = getDirectionalStyles(direction, ...cssObject);
59
57
  return styles.reduce((first, second) => {
60
- const convertedFirst = shouldConvert ? getConvertedStyles(shouldConvert, first) : first;
61
- const convertedSecond = shouldConvert ? getConvertedStyles(shouldConvert, second) : second;
58
+ const convertedFirst = getConvertedStyles(first, convertFunc);
59
+ const convertedSecond = getConvertedStyles(second, convertFunc);
62
60
 
63
61
  return {...convertedFirst, ...convertedSecond};
64
62
  }, {});
65
63
  };
66
- }, [direction, shouldConvert]);
64
+ }, [direction, convertFunc]);
67
65
 
68
66
  return {themeRTL, theme};
69
67
  }
@@ -1,11 +1,10 @@
1
1
  import React from 'react';
2
- import { MenuItemProps } from '@workday/canvas-kit-preview-react/menu';
3
2
  import { ComboBoxMenuItemGroup } from './Combobox';
4
3
  interface AutocompleteListProps {
5
4
  /**
6
5
  * The autocomplete items of the Combobox. This array of menu items is shown under the text input.
7
6
  */
8
- autocompleteItems: React.ReactElement<MenuItemProps>[] | ComboBoxMenuItemGroup[];
7
+ autocompleteItems: React.ReactElement<any>[] | ComboBoxMenuItemGroup[];
9
8
  /**
10
9
  * Index of the active autocomplete item
11
10
  */
@@ -13,7 +12,7 @@ interface AutocompleteListProps {
13
12
  /**
14
13
  * The function called when an autocomplete item is selected
15
14
  */
16
- handleAutocompleteClick: (event: React.SyntheticEvent<Element, Event>, menuItemProps: MenuItemProps) => void;
15
+ handleAutocompleteClick: (event: React.SyntheticEvent<Element, Event>, menuItemProps: any) => void;
17
16
  /**
18
17
  * The id of the form field.
19
18
  */
@@ -1 +1 @@
1
- {"version":3,"file":"AutocompleteList.d.ts","sourceRoot":"","sources":["../../../../combobox/lib/AutocompleteList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAIhD,OAAO,EAAC,aAAa,EAAC,MAAM,wCAAwC,CAAC;AACrE,OAAO,EAAC,qBAAqB,EAAiD,MAAM,YAAY,CAAC;AAYjG,UAAU,qBAAqB;IAC7B;;OAEG;IACH,iBAAiB,EAAE,KAAK,CAAC,YAAY,CAAC,aAAa,CAAC,EAAE,GAAG,qBAAqB,EAAE,CAAC;IACjF;;OAEG;IACH,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B;;OAEG;IACH,uBAAuB,EAAE,CACvB,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,EAAE,KAAK,CAAC,EAC3C,aAAa,EAAE,aAAa,KACzB,IAAI,CAAC;IACV;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,eAAO,MAAM,gBAAgB,uGAO1B,qBAAqB,uBAiFvB,CAAC"}
1
+ {"version":3,"file":"AutocompleteList.d.ts","sourceRoot":"","sources":["../../../../combobox/lib/AutocompleteList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAIhD,OAAO,EAAC,qBAAqB,EAAiD,MAAM,YAAY,CAAC;AAYjG,UAAU,qBAAqB;IAC7B;;OAEG;IACH,iBAAiB,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,GAAG,qBAAqB,EAAE,CAAC;IACvE;;OAEG;IACH,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B;;OAEG;IACH,uBAAuB,EAAE,CACvB,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,EAAE,KAAK,CAAC,EAC3C,aAAa,EAAE,GAAG,KACf,IAAI,CAAC;IACV;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,eAAO,MAAM,gBAAgB,uGAO1B,qBAAqB,uBAiFvB,CAAC"}
@@ -1,11 +1,10 @@
1
1
  import React from 'react';
2
2
  import { GrowthBehavior } from '@workday/canvas-kit-react/common';
3
- import { MenuItemProps } from '@workday/canvas-kit-preview-react/menu';
4
3
  import { TertiaryButtonProps } from '@workday/canvas-kit-react/button';
5
4
  import { TextInputProps } from '@workday/canvas-kit-react/text-input';
6
5
  export interface ComboBoxMenuItemGroup {
7
- header: React.ReactElement<MenuItemProps>;
8
- items: React.ReactElement<MenuItemProps>[];
6
+ header: React.ReactElement<any>;
7
+ items: React.ReactElement<any>[];
9
8
  }
10
9
  export interface ComboboxProps extends GrowthBehavior, React.HTMLAttributes<HTMLElement> {
11
10
  /**
@@ -33,7 +32,7 @@ export interface ComboboxProps extends GrowthBehavior, React.HTMLAttributes<HTML
33
32
  /**
34
33
  * The autocomplete items of the Combobox. This array of menu items is shown under the text input.
35
34
  */
36
- autocompleteItems?: React.ReactElement<MenuItemProps>[] | ComboBoxMenuItemGroup[];
35
+ autocompleteItems?: React.ReactElement<any>[] | ComboBoxMenuItemGroup[];
37
36
  /**
38
37
  * The function called when the Combobox text input changes.
39
38
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Combobox.d.ts","sourceRoot":"","sources":["../../../../combobox/lib/Combobox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkE,MAAM,OAAO,CAAC;AAEvF,OAAO,EACL,cAAc,EAKf,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAC,aAAa,EAAC,MAAM,wCAAwC,CAAC;AAErE,OAAO,EAAiB,mBAAmB,EAAC,MAAM,kCAAkC,CAAC;AAErF,OAAO,EAAC,cAAc,EAAC,MAAM,sCAAsC,CAAC;AAKpE,MAAM,WAAW,qBAAqB;IAEpC,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;IAE1C,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC,aAAa,CAAC,EAAE,CAAC;CAC5C;AAED,MAAM,WAAW,aAAc,SAAQ,cAAc,EAAE,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC;IACtF;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC;IAC7C;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,kBAAkB,CAAC,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC;IACpD;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;OAGG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B;;OAEG;IACH,iBAAiB,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,aAAa,CAAC,EAAE,GAAG,qBAAqB,EAAE,CAAC;IAClF;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAC5D;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAClC;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC;IACjC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;CAC/C;AA2DD,eAAO,MAAM,aAAa,YAAY,CAAC;AAEvC,eAAO,MAAM,WAAW,qEACc,CAAC;AAEvC,eAAO,MAAM,kBAAkB,cAAe,MAAM,SAAS,WAc5D,CAAC;AAYF,eAAO,MAAM,QAAQ,wLAelB,aAAa,gBA0Tf,CAAC"}
1
+ {"version":3,"file":"Combobox.d.ts","sourceRoot":"","sources":["../../../../combobox/lib/Combobox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkE,MAAM,OAAO,CAAC;AAEvF,OAAO,EACL,cAAc,EAKf,MAAM,kCAAkC,CAAC;AAG1C,OAAO,EAAiB,mBAAmB,EAAC,MAAM,kCAAkC,CAAC;AAErF,OAAO,EAAC,cAAc,EAAC,MAAM,sCAAsC,CAAC;AAKpE,MAAM,WAAW,qBAAqB;IAEpC,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IAEhC,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC;CAClC;AAED,MAAM,WAAW,aAAc,SAAQ,cAAc,EAAE,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC;IACtF;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC;IAC7C;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,kBAAkB,CAAC,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC;IACpD;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;OAGG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B;;OAEG;IACH,iBAAiB,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,GAAG,qBAAqB,EAAE,CAAC;IACxE;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAC5D;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAClC;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC;IACjC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;CAC/C;AA2DD,eAAO,MAAM,aAAa,YAAY,CAAC;AAEvC,eAAO,MAAM,WAAW,qEACc,CAAC;AAEvC,eAAO,MAAM,kBAAkB,cAAe,MAAM,SAAS,WAc5D,CAAC;AAYF,eAAO,MAAM,QAAQ,wLAelB,aAAa,gBAuTf,CAAC"}
@@ -244,10 +244,6 @@ var Combobox = function (_a) {
244
244
  var handleBlur = function (event) {
245
245
  if (comboboxRef.current) {
246
246
  var target = event.relatedTarget;
247
- if (target === null) {
248
- // IE11 swaps related and active target before it fires the blur event
249
- target = document.activeElement;
250
- }
251
247
  if (target && comboboxRef.current.contains(target)) {
252
248
  return;
253
249
  }
@@ -330,7 +326,7 @@ var Combobox = function (_a) {
330
326
  };
331
327
  var renderChildren = function (inputElement) {
332
328
  var _a;
333
- var cssOverride = { zIndex: 2 };
329
+ var cssOverride = { ':focus': { zIndex: 2 } };
334
330
  if (showClearButton) {
335
331
  var paddingDirection = isRTL ? 'paddingLeft' : 'paddingRight';
336
332
  cssOverride = __assign(__assign({}, cssOverride), (_a = {}, _a[paddingDirection] = tokens_1.space.xl, _a));
@@ -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"}
@@ -10,9 +10,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
10
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.permutateProps = exports.ComponentStatesTable = void 0;
14
13
  __exportStar(require("./lib/theming"), exports);
15
- var ComponentStatesTable_1 = require("./lib/storybook-utils/ComponentStatesTable");
16
- Object.defineProperty(exports, "ComponentStatesTable", { enumerable: true, get: function () { return ComponentStatesTable_1.ComponentStatesTable; } });
17
- var permutateProps_1 = require("./lib/storybook-utils/permutateProps");
18
- Object.defineProperty(exports, "permutateProps", { enumerable: true, get: function () { return permutateProps_1.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"}
@@ -32,9 +32,8 @@ var getDirectionalStyles = function (isRTL) {
32
32
  }
33
33
  return isRTL ? rtl_css_js_1.default(styles) : styles;
34
34
  };
35
- var getConvertedStyles = function (shouldConvert, styles) {
36
- var _a;
37
- return shouldConvert ? (_a = common_1.convertToStaticStates(styles)) !== null && _a !== void 0 ? _a : styles : styles;
35
+ var getConvertedStyles = function (styles, convertFunc) {
36
+ return convertFunc ? convertFunc(styles) : styles;
38
37
  };
39
38
  /**
40
39
  * A helpful hook for supporting bidirectional styles.
@@ -66,10 +65,9 @@ var getConvertedStyles = function (shouldConvert, styles) {
66
65
  * }
67
66
  */
68
67
  function useThemeRTL() {
69
- var _a;
70
68
  var theme = common_1.useTheme();
71
69
  var direction = common_1.useIsRTL(theme);
72
- var shouldConvert = (_a = theme.canvas._staticStates) !== null && _a !== void 0 ? _a : false;
70
+ var convertFunc = theme.canvas._styleRewriteFn;
73
71
  var themeRTL = react_1.useMemo(function () {
74
72
  return function () {
75
73
  var cssObject = [];
@@ -78,12 +76,12 @@ function useThemeRTL() {
78
76
  }
79
77
  var styles = getDirectionalStyles.apply(void 0, __spreadArrays([direction], cssObject));
80
78
  return styles.reduce(function (first, second) {
81
- var convertedFirst = shouldConvert ? getConvertedStyles(shouldConvert, first) : first;
82
- var convertedSecond = shouldConvert ? getConvertedStyles(shouldConvert, second) : second;
79
+ var convertedFirst = getConvertedStyles(first, convertFunc);
80
+ var convertedSecond = getConvertedStyles(second, convertFunc);
83
81
  return __assign(__assign({}, convertedFirst), convertedSecond);
84
82
  }, {});
85
83
  };
86
- }, [direction, shouldConvert]);
84
+ }, [direction, convertFunc]);
87
85
  return { themeRTL: themeRTL, theme: theme };
88
86
  }
89
87
  exports.useThemeRTL = useThemeRTL;
@@ -1,3 +1,3 @@
1
- export { DrawerHeader } from './lib/DrawerHeader';
1
+ export { DeprecatedDrawerHeader } from './lib/DrawerHeader';
2
2
  export * from './lib/Drawer';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../drawer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAChD,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"}
@@ -10,7 +10,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
10
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.DrawerHeader = void 0;
13
+ exports.DeprecatedDrawerHeader = void 0;
14
14
  var DrawerHeader_1 = require("./lib/DrawerHeader");
15
- Object.defineProperty(exports, "DrawerHeader", { enumerable: true, get: function () { return DrawerHeader_1.DrawerHeader; } });
15
+ Object.defineProperty(exports, "DeprecatedDrawerHeader", { enumerable: true, get: function () { return DrawerHeader_1.DeprecatedDrawerHeader; } });
16
16
  __exportStar(require("./lib/Drawer"), exports);
@@ -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 declare 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,qBAAa,MAAO,SAAQ,KAAK,CAAC,SAAS,CAAC,WAAW,EAAE,EAAE,CAAC;IAC1D,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"}
@@ -57,15 +57,23 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
57
57
  return (mod && mod.__esModule) ? mod : { "default": mod };
58
58
  };
59
59
  Object.defineProperty(exports, "__esModule", { value: true });
60
- exports.Drawer = exports.DrawerDirection = void 0;
60
+ exports.DeprecatedDrawer = exports.DeprecatedDrawerDirection = void 0;
61
61
  var React = __importStar(require("react"));
62
62
  var styled_1 = __importDefault(require("@emotion/styled"));
63
63
  var tokens_1 = require("@workday/canvas-kit-react/tokens");
64
- var DrawerDirection;
65
- (function (DrawerDirection) {
66
- DrawerDirection[DrawerDirection["Left"] = 0] = "Left";
67
- DrawerDirection[DrawerDirection["Right"] = 1] = "Right";
68
- })(DrawerDirection = exports.DrawerDirection || (exports.DrawerDirection = {}));
64
+ /**
65
+ * ### Deprecated Drawer Direction
66
+ *
67
+ * As of Canvas Kit v8, Drawer is being soft-deprecated.
68
+ * It will be hard-deprecated (completely removed) in v9. Please see the
69
+ * [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
70
+ * for more information.
71
+ */
72
+ var DeprecatedDrawerDirection;
73
+ (function (DeprecatedDrawerDirection) {
74
+ DeprecatedDrawerDirection[DeprecatedDrawerDirection["Left"] = 0] = "Left";
75
+ DeprecatedDrawerDirection[DeprecatedDrawerDirection["Right"] = 1] = "Right";
76
+ })(DeprecatedDrawerDirection = exports.DeprecatedDrawerDirection || (exports.DeprecatedDrawerDirection = {}));
69
77
  var DrawerContainer = styled_1.default('div')({
70
78
  height: '100%',
71
79
  backgroundColor: 'white',
@@ -80,26 +88,25 @@ var DrawerContainer = styled_1.default('div')({
80
88
  }, function (_a) {
81
89
  var showDropShadow = _a.showDropShadow, openDirection = _a.openDirection;
82
90
  return ({
83
- boxShadow: openDirection === DrawerDirection.Right && showDropShadow
91
+ boxShadow: openDirection === DeprecatedDrawerDirection.Right && showDropShadow
84
92
  ? '-8px 0px 16px 0 rgba(0,0,0,0.12)'
85
- : openDirection === DrawerDirection.Left && showDropShadow
93
+ : openDirection === DeprecatedDrawerDirection.Left && showDropShadow
86
94
  ? '8px 0px 16px 0 rgba(0,0,0,0.12)'
87
95
  : undefined,
88
96
  });
89
97
  }, function (_a) {
90
98
  var openDirection = _a.openDirection;
91
99
  return ({
92
- borderLeft: openDirection === DrawerDirection.Right ? "1px solid " + tokens_1.colors.soap400 : undefined,
93
- borderRight: openDirection === DrawerDirection.Left ? "1px solid " + tokens_1.colors.soap400 : undefined,
94
- right: openDirection === DrawerDirection.Right ? tokens_1.space.zero : undefined,
95
- left: openDirection === DrawerDirection.Left ? tokens_1.space.zero : undefined,
100
+ borderLeft: openDirection === DeprecatedDrawerDirection.Right ? "1px solid " + tokens_1.colors.soap400 : undefined,
101
+ borderRight: openDirection === DeprecatedDrawerDirection.Left ? "1px solid " + tokens_1.colors.soap400 : undefined,
102
+ right: openDirection === DeprecatedDrawerDirection.Right ? tokens_1.space.zero : undefined,
103
+ left: openDirection === DeprecatedDrawerDirection.Left ? tokens_1.space.zero : undefined,
96
104
  });
97
105
  });
98
106
  var ChildrenContainer = styled_1.default('div')({
99
107
  height: '100%',
100
108
  overflowY: 'auto',
101
109
  wordBreak: 'break-word',
102
- wordWrap: 'break-word',
103
110
  position: 'relative',
104
111
  }, function (_a) {
105
112
  var padding = _a.padding;
@@ -107,18 +114,29 @@ var ChildrenContainer = styled_1.default('div')({
107
114
  padding: padding,
108
115
  });
109
116
  });
110
- var Drawer = /** @class */ (function (_super) {
111
- __extends(Drawer, _super);
112
- function Drawer() {
117
+ /**
118
+ * ### Deprecated Drawer
119
+ *
120
+ * As of Canvas Kit v8, this component is being soft-deprecated.
121
+ * It will be hard-deprecated (completely removed) in v9. Please see the
122
+ * [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
123
+ * for more information.
124
+ */
125
+ var DeprecatedDrawer = /** @class */ (function (_super) {
126
+ __extends(DeprecatedDrawer, _super);
127
+ function DeprecatedDrawer() {
113
128
  return _super !== null && _super.apply(this, arguments) || this;
114
129
  }
115
- Drawer.prototype.render = function () {
116
- var _a = this.props, _b = _a.padding, padding = _b === void 0 ? tokens_1.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"]);
130
+ DeprecatedDrawer.prototype.componentDidMount = function () {
131
+ 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 ");
132
+ };
133
+ DeprecatedDrawer.prototype.render = function () {
134
+ var _a = this.props, _b = _a.padding, padding = _b === void 0 ? tokens_1.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"]);
117
135
  return (React.createElement(DrawerContainer, __assign({ role: role }, elemProps, { showDropShadow: showDropShadow, width: width, openDirection: openDirection }),
118
136
  header,
119
137
  React.createElement(ChildrenContainer, { padding: padding }, children)));
120
138
  };
121
- Drawer.OpenDirection = DrawerDirection;
122
- return Drawer;
139
+ DeprecatedDrawer.OpenDirection = DeprecatedDrawerDirection;
140
+ return DeprecatedDrawer;
123
141
  }(React.Component));
124
- exports.Drawer = Drawer;
142
+ exports.DeprecatedDrawer = DeprecatedDrawer;