@workday/canvas-kit-labs-react 8.0.0-alpha.253-next.22 → 8.0.0-alpha.428-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 (203) hide show
  1. package/common/lib/theming/index.ts +0 -1
  2. package/common/lib/theming/useThemeRTL.ts +3 -0
  3. package/dist/commonjs/combobox/lib/AutocompleteList.js +31 -52
  4. package/dist/commonjs/combobox/lib/Combobox.js +105 -133
  5. package/dist/commonjs/combobox/lib/Status.js +9 -10
  6. package/dist/commonjs/common/lib/theming/index.d.ts +0 -1
  7. package/dist/commonjs/common/lib/theming/index.d.ts.map +1 -1
  8. package/dist/commonjs/common/lib/theming/index.js +0 -1
  9. package/dist/commonjs/common/lib/theming/useThemeRTL.d.ts +3 -0
  10. package/dist/commonjs/common/lib/theming/useThemeRTL.d.ts.map +1 -1
  11. package/dist/commonjs/common/lib/theming/useThemeRTL.js +19 -42
  12. package/dist/commonjs/expandable/lib/Expandable.d.ts +45 -12
  13. package/dist/commonjs/expandable/lib/Expandable.d.ts.map +1 -1
  14. package/dist/commonjs/expandable/lib/Expandable.js +46 -37
  15. package/dist/commonjs/expandable/lib/ExpandableAvatar.js +7 -30
  16. package/dist/commonjs/expandable/lib/ExpandableContent.d.ts +4 -2
  17. package/dist/commonjs/expandable/lib/ExpandableContent.d.ts.map +1 -1
  18. package/dist/commonjs/expandable/lib/ExpandableContent.js +8 -31
  19. package/dist/commonjs/expandable/lib/ExpandableIcon.d.ts +1 -1
  20. package/dist/commonjs/expandable/lib/ExpandableIcon.d.ts.map +1 -1
  21. package/dist/commonjs/expandable/lib/ExpandableIcon.js +20 -51
  22. package/dist/commonjs/expandable/lib/ExpandableTarget.d.ts +7 -2
  23. package/dist/commonjs/expandable/lib/ExpandableTarget.d.ts.map +1 -1
  24. package/dist/commonjs/expandable/lib/ExpandableTarget.js +18 -34
  25. package/dist/commonjs/expandable/lib/ExpandableTitle.d.ts +3 -1
  26. package/dist/commonjs/expandable/lib/ExpandableTitle.d.ts.map +1 -1
  27. package/dist/commonjs/expandable/lib/ExpandableTitle.js +6 -29
  28. package/dist/commonjs/expandable/lib/hooks/index.d.ts +1 -0
  29. package/dist/commonjs/expandable/lib/hooks/index.d.ts.map +1 -1
  30. package/dist/commonjs/expandable/lib/hooks/index.js +1 -0
  31. package/dist/commonjs/expandable/lib/hooks/useExpandableContent.d.ts +4 -6
  32. package/dist/commonjs/expandable/lib/hooks/useExpandableContent.d.ts.map +1 -1
  33. package/dist/commonjs/expandable/lib/hooks/useExpandableContent.js +3 -4
  34. package/dist/commonjs/expandable/lib/hooks/useExpandableIcon.d.ts +4 -6
  35. package/dist/commonjs/expandable/lib/hooks/useExpandableIcon.d.ts.map +1 -1
  36. package/dist/commonjs/expandable/lib/hooks/useExpandableIcon.js +3 -4
  37. package/dist/{es6/expandable/lib → commonjs/expandable/lib/hooks}/useExpandableModel.d.ts +10 -7
  38. package/dist/commonjs/expandable/lib/hooks/useExpandableModel.d.ts.map +1 -0
  39. package/dist/commonjs/expandable/lib/hooks/useExpandableModel.js +22 -0
  40. package/dist/commonjs/expandable/lib/hooks/useExpandableTarget.d.ts +4 -6
  41. package/dist/commonjs/expandable/lib/hooks/useExpandableTarget.d.ts.map +1 -1
  42. package/dist/commonjs/expandable/lib/hooks/useExpandableTarget.js +4 -5
  43. package/dist/commonjs/index.d.ts +0 -3
  44. package/dist/commonjs/index.d.ts.map +1 -1
  45. package/dist/commonjs/index.js +0 -3
  46. package/dist/commonjs/search-form/lib/SearchForm.d.ts +6 -1
  47. package/dist/commonjs/search-form/lib/SearchForm.d.ts.map +1 -1
  48. package/dist/commonjs/search-form/lib/SearchForm.js +117 -142
  49. package/dist/commonjs/search-form/lib/themes.js +7 -8
  50. package/dist/es6/combobox/lib/AutocompleteList.js +26 -47
  51. package/dist/es6/combobox/lib/Combobox.js +95 -123
  52. package/dist/es6/combobox/lib/Status.js +6 -7
  53. package/dist/es6/common/lib/theming/index.d.ts +0 -1
  54. package/dist/es6/common/lib/theming/index.d.ts.map +1 -1
  55. package/dist/es6/common/lib/theming/index.js +0 -1
  56. package/dist/es6/common/lib/theming/useThemeRTL.d.ts +3 -0
  57. package/dist/es6/common/lib/theming/useThemeRTL.d.ts.map +1 -1
  58. package/dist/es6/common/lib/theming/useThemeRTL.js +16 -39
  59. package/dist/es6/expandable/lib/Expandable.d.ts +45 -12
  60. package/dist/es6/expandable/lib/Expandable.d.ts.map +1 -1
  61. package/dist/es6/expandable/lib/Expandable.js +40 -31
  62. package/dist/es6/expandable/lib/ExpandableAvatar.js +4 -27
  63. package/dist/es6/expandable/lib/ExpandableContent.d.ts +4 -2
  64. package/dist/es6/expandable/lib/ExpandableContent.d.ts.map +1 -1
  65. package/dist/es6/expandable/lib/ExpandableContent.js +5 -28
  66. package/dist/es6/expandable/lib/ExpandableIcon.d.ts +1 -1
  67. package/dist/es6/expandable/lib/ExpandableIcon.d.ts.map +1 -1
  68. package/dist/es6/expandable/lib/ExpandableIcon.js +15 -46
  69. package/dist/es6/expandable/lib/ExpandableTarget.d.ts +7 -2
  70. package/dist/es6/expandable/lib/ExpandableTarget.d.ts.map +1 -1
  71. package/dist/es6/expandable/lib/ExpandableTarget.js +15 -31
  72. package/dist/es6/expandable/lib/ExpandableTitle.d.ts +3 -1
  73. package/dist/es6/expandable/lib/ExpandableTitle.d.ts.map +1 -1
  74. package/dist/es6/expandable/lib/ExpandableTitle.js +3 -26
  75. package/dist/es6/expandable/lib/hooks/index.d.ts +1 -0
  76. package/dist/es6/expandable/lib/hooks/index.d.ts.map +1 -1
  77. package/dist/es6/expandable/lib/hooks/index.js +1 -0
  78. package/dist/es6/expandable/lib/hooks/useExpandableContent.d.ts +4 -6
  79. package/dist/es6/expandable/lib/hooks/useExpandableContent.d.ts.map +1 -1
  80. package/dist/es6/expandable/lib/hooks/useExpandableContent.js +2 -3
  81. package/dist/es6/expandable/lib/hooks/useExpandableIcon.d.ts +4 -6
  82. package/dist/es6/expandable/lib/hooks/useExpandableIcon.d.ts.map +1 -1
  83. package/dist/es6/expandable/lib/hooks/useExpandableIcon.js +2 -3
  84. package/dist/{commonjs/expandable/lib → es6/expandable/lib/hooks}/useExpandableModel.d.ts +10 -7
  85. package/dist/es6/expandable/lib/hooks/useExpandableModel.d.ts.map +1 -0
  86. package/dist/es6/expandable/lib/hooks/useExpandableModel.js +19 -0
  87. package/dist/es6/expandable/lib/hooks/useExpandableTarget.d.ts +4 -6
  88. package/dist/es6/expandable/lib/hooks/useExpandableTarget.d.ts.map +1 -1
  89. package/dist/es6/expandable/lib/hooks/useExpandableTarget.js +3 -4
  90. package/dist/es6/index.d.ts +0 -3
  91. package/dist/es6/index.d.ts.map +1 -1
  92. package/dist/es6/index.js +0 -3
  93. package/dist/es6/search-form/lib/SearchForm.d.ts +6 -1
  94. package/dist/es6/search-form/lib/SearchForm.d.ts.map +1 -1
  95. package/dist/es6/search-form/lib/SearchForm.js +107 -133
  96. package/dist/es6/search-form/lib/themes.js +5 -6
  97. package/expandable/lib/Expandable.tsx +38 -4
  98. package/expandable/lib/ExpandableContent.tsx +4 -4
  99. package/expandable/lib/ExpandableIcon.tsx +2 -1
  100. package/expandable/lib/ExpandableTarget.tsx +3 -3
  101. package/expandable/lib/ExpandableTitle.tsx +6 -8
  102. package/expandable/lib/hooks/index.ts +1 -0
  103. package/expandable/lib/hooks/useExpandableContent.ts +1 -1
  104. package/expandable/lib/hooks/useExpandableIcon.ts +1 -1
  105. package/expandable/lib/{useExpandableModel.tsx → hooks/useExpandableModel.tsx} +3 -0
  106. package/expandable/lib/hooks/useExpandableTarget.ts +1 -1
  107. package/index.ts +0 -3
  108. package/package.json +4 -4
  109. package/search-form/lib/SearchForm.tsx +11 -5
  110. package/common/lib/theming/useThemedRing.ts +0 -82
  111. package/dist/commonjs/common/lib/theming/useThemedRing.d.ts +0 -11
  112. package/dist/commonjs/common/lib/theming/useThemedRing.d.ts.map +0 -1
  113. package/dist/commonjs/common/lib/theming/useThemedRing.js +0 -67
  114. package/dist/commonjs/drawer/index.d.ts +0 -3
  115. package/dist/commonjs/drawer/index.d.ts.map +0 -1
  116. package/dist/commonjs/drawer/index.js +0 -16
  117. package/dist/commonjs/drawer/lib/Drawer.d.ts +0 -74
  118. package/dist/commonjs/drawer/lib/Drawer.d.ts.map +0 -1
  119. package/dist/commonjs/drawer/lib/Drawer.js +0 -142
  120. package/dist/commonjs/drawer/lib/DrawerHeader.d.ts +0 -55
  121. package/dist/commonjs/drawer/lib/DrawerHeader.d.ts.map +0 -1
  122. package/dist/commonjs/drawer/lib/DrawerHeader.js +0 -113
  123. package/dist/commonjs/expandable/lib/useExpandableModel.d.ts.map +0 -1
  124. package/dist/commonjs/expandable/lib/useExpandableModel.js +0 -24
  125. package/dist/commonjs/toast/index.d.ts +0 -3
  126. package/dist/commonjs/toast/index.d.ts.map +0 -1
  127. package/dist/commonjs/toast/index.js +0 -14
  128. package/dist/commonjs/toast/lib/Toast.d.ts +0 -27
  129. package/dist/commonjs/toast/lib/Toast.d.ts.map +0 -1
  130. package/dist/commonjs/toast/lib/Toast.js +0 -78
  131. package/dist/commonjs/toast/lib/ToastBody.d.ts +0 -6
  132. package/dist/commonjs/toast/lib/ToastBody.d.ts.map +0 -1
  133. package/dist/commonjs/toast/lib/ToastBody.js +0 -40
  134. package/dist/commonjs/toast/lib/ToastCloseIcon.d.ts +0 -6
  135. package/dist/commonjs/toast/lib/ToastCloseIcon.d.ts.map +0 -1
  136. package/dist/commonjs/toast/lib/ToastCloseIcon.js +0 -43
  137. package/dist/commonjs/toast/lib/ToastIcon.d.ts +0 -5
  138. package/dist/commonjs/toast/lib/ToastIcon.d.ts.map +0 -1
  139. package/dist/commonjs/toast/lib/ToastIcon.js +0 -26
  140. package/dist/commonjs/toast/lib/ToastLink.d.ts +0 -9
  141. package/dist/commonjs/toast/lib/ToastLink.d.ts.map +0 -1
  142. package/dist/commonjs/toast/lib/ToastLink.js +0 -42
  143. package/dist/commonjs/toast/lib/ToastMessage.d.ts +0 -11
  144. package/dist/commonjs/toast/lib/ToastMessage.d.ts.map +0 -1
  145. package/dist/commonjs/toast/lib/ToastMessage.js +0 -41
  146. package/dist/commonjs/toast/lib/hooks/useToastModel.d.ts +0 -65
  147. package/dist/commonjs/toast/lib/hooks/useToastModel.d.ts.map +0 -1
  148. package/dist/commonjs/toast/lib/hooks/useToastModel.js +0 -35
  149. package/dist/es6/common/lib/theming/useThemedRing.d.ts +0 -11
  150. package/dist/es6/common/lib/theming/useThemedRing.d.ts.map +0 -1
  151. package/dist/es6/common/lib/theming/useThemedRing.js +0 -59
  152. package/dist/es6/drawer/index.d.ts +0 -3
  153. package/dist/es6/drawer/index.d.ts.map +0 -1
  154. package/dist/es6/drawer/index.js +0 -2
  155. package/dist/es6/drawer/lib/Drawer.d.ts +0 -74
  156. package/dist/es6/drawer/lib/Drawer.d.ts.map +0 -1
  157. package/dist/es6/drawer/lib/Drawer.js +0 -117
  158. package/dist/es6/drawer/lib/DrawerHeader.d.ts +0 -55
  159. package/dist/es6/drawer/lib/DrawerHeader.d.ts.map +0 -1
  160. package/dist/es6/drawer/lib/DrawerHeader.js +0 -88
  161. package/dist/es6/expandable/lib/useExpandableModel.d.ts.map +0 -1
  162. package/dist/es6/expandable/lib/useExpandableModel.js +0 -21
  163. package/dist/es6/toast/index.d.ts +0 -3
  164. package/dist/es6/toast/index.d.ts.map +0 -1
  165. package/dist/es6/toast/index.js +0 -2
  166. package/dist/es6/toast/lib/Toast.d.ts +0 -27
  167. package/dist/es6/toast/lib/Toast.d.ts.map +0 -1
  168. package/dist/es6/toast/lib/Toast.js +0 -72
  169. package/dist/es6/toast/lib/ToastBody.d.ts +0 -6
  170. package/dist/es6/toast/lib/ToastBody.d.ts.map +0 -1
  171. package/dist/es6/toast/lib/ToastBody.js +0 -34
  172. package/dist/es6/toast/lib/ToastCloseIcon.d.ts +0 -6
  173. package/dist/es6/toast/lib/ToastCloseIcon.d.ts.map +0 -1
  174. package/dist/es6/toast/lib/ToastCloseIcon.js +0 -37
  175. package/dist/es6/toast/lib/ToastIcon.d.ts +0 -5
  176. package/dist/es6/toast/lib/ToastIcon.d.ts.map +0 -1
  177. package/dist/es6/toast/lib/ToastIcon.js +0 -20
  178. package/dist/es6/toast/lib/ToastLink.d.ts +0 -9
  179. package/dist/es6/toast/lib/ToastLink.d.ts.map +0 -1
  180. package/dist/es6/toast/lib/ToastLink.js +0 -36
  181. package/dist/es6/toast/lib/ToastMessage.d.ts +0 -11
  182. package/dist/es6/toast/lib/ToastMessage.d.ts.map +0 -1
  183. package/dist/es6/toast/lib/ToastMessage.js +0 -35
  184. package/dist/es6/toast/lib/hooks/useToastModel.d.ts +0 -65
  185. package/dist/es6/toast/lib/hooks/useToastModel.d.ts.map +0 -1
  186. package/dist/es6/toast/lib/hooks/useToastModel.js +0 -32
  187. package/drawer/LICENSE +0 -51
  188. package/drawer/README.md +0 -35
  189. package/drawer/index.ts +0 -2
  190. package/drawer/lib/Drawer.tsx +0 -156
  191. package/drawer/lib/DrawerHeader.tsx +0 -133
  192. package/drawer/package.json +0 -6
  193. package/toast/LICENSE +0 -52
  194. package/toast/README.md +0 -5
  195. package/toast/index.ts +0 -2
  196. package/toast/lib/Toast.tsx +0 -63
  197. package/toast/lib/ToastBody.tsx +0 -34
  198. package/toast/lib/ToastCloseIcon.tsx +0 -18
  199. package/toast/lib/ToastIcon.tsx +0 -24
  200. package/toast/lib/ToastLink.tsx +0 -27
  201. package/toast/lib/ToastMessage.tsx +0 -21
  202. package/toast/lib/hooks/useToastModel.tsx +0 -27
  203. package/toast/package.json +0 -6
@@ -1,25 +1,3 @@
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
1
  import React, { useEffect, useLayoutEffect, useRef, useState, useCallback } from 'react';
24
2
  import { jsx, keyframes } from '@emotion/react';
25
3
  import { useForkRef, styled, useIsRTL, useUniqueId, } from '@workday/canvas-kit-react/common';
@@ -30,20 +8,17 @@ import { xSmallIcon } from '@workday/canvas-system-icons-web';
30
8
  import flatten from 'lodash.flatten';
31
9
  import { AutocompleteList } from './AutocompleteList';
32
10
  import { Status } from './Status';
33
- var Container = styled('div')({
11
+ const Container = styled('div')({
34
12
  display: 'inline-block',
35
- }, function (_a) {
36
- var grow = _a.grow;
37
- return ({
38
- width: grow ? '100%' : 'auto',
39
- });
40
- });
41
- var InputContainer = styled('div')({
42
- display: "flex",
43
- alignItems: "center",
13
+ }, ({ grow }) => ({
14
+ width: grow ? '100%' : 'auto',
15
+ }));
16
+ const InputContainer = styled('div')({
17
+ display: `flex`,
18
+ alignItems: `center`,
44
19
  position: 'relative',
45
20
  });
46
- var fadeInKeyframes = keyframes({
21
+ const fadeInKeyframes = keyframes({
47
22
  '0%': {
48
23
  opacity: 0,
49
24
  },
@@ -51,45 +26,40 @@ var fadeInKeyframes = keyframes({
51
26
  opacity: 1,
52
27
  },
53
28
  });
54
- var MenuContainer = styled(Card)({
29
+ const MenuContainer = styled(Card)({
55
30
  position: 'absolute',
56
31
  zIndex: 1,
57
32
  left: 0,
58
33
  top: '100%',
59
34
  borderRadius: borderRadius.m,
60
35
  background: commonColors.background,
61
- border: "none",
62
- marginTop: "-" + borderRadius.m,
36
+ border: `none`,
37
+ marginTop: `-${borderRadius.m}`,
63
38
  width: '100%',
64
39
  minWidth: 0,
65
- animation: fadeInKeyframes + " 200ms ease-out",
40
+ animation: `${fadeInKeyframes} 200ms ease-out`,
66
41
  maxHeight: 200,
67
42
  overflow: 'hidden',
68
43
  });
69
- var ResetButton = styled(TertiaryButton)({
44
+ const ResetButton = styled(TertiaryButton)({
70
45
  position: 'absolute',
71
- margin: "auto " + space.xxxs,
46
+ margin: `auto ${space.xxxs}`,
72
47
  top: 0,
73
48
  bottom: 0,
74
49
  right: 0,
75
50
  padding: 0,
76
51
  zIndex: 2,
77
52
  transition: 'opacity 120ms',
78
- }, function (_a) {
79
- var shouldShow = _a.shouldShow;
80
- return ({
81
- visibility: shouldShow ? 'visible' : 'hidden',
82
- opacity: shouldShow ? 1 : 0,
83
- });
84
- });
85
- export var listBoxIdPart = "listbox";
86
- var optionIdPart = "option";
87
- export var getOptionId = function (baseId, index) {
88
- return baseId + "-" + optionIdPart + "-" + index;
89
- };
90
- export var getTextFromElement = function (children) {
91
- var text = '';
92
- React.Children.map(children, function (child) {
53
+ }, ({ shouldShow }) => ({
54
+ visibility: shouldShow ? 'visible' : 'hidden',
55
+ opacity: shouldShow ? 1 : 0,
56
+ }));
57
+ export const listBoxIdPart = `listbox`;
58
+ const optionIdPart = `option`;
59
+ export const getOptionId = (baseId, index) => `${baseId}-${optionIdPart}-${index}`;
60
+ export const getTextFromElement = (children) => {
61
+ let text = '';
62
+ React.Children.map(children, child => {
93
63
  if (child == null || typeof child === 'boolean') {
94
64
  text += '';
95
65
  }
@@ -105,89 +75,88 @@ export var getTextFromElement = function (children) {
105
75
  });
106
76
  return text;
107
77
  };
108
- var buildStatusString = function (listCount) {
109
- return "There " + (listCount === 1 ? 'is' : 'are') + " " + listCount + " suggestion" + (listCount === 1 ? '' : 's') + ".";
78
+ const buildStatusString = (listCount) => {
79
+ return `There ${listCount === 1 ? 'is' : 'are'} ${listCount} suggestion${listCount === 1 ? '' : 's'}.`;
110
80
  };
111
- var isValidSingleChild = function (child) {
81
+ const isValidSingleChild = (child) => {
112
82
  return React.isValidElement(child) && React.Children.only(child);
113
83
  };
114
- export var Combobox = function (_a) {
115
- var autocompleteItems = _a.autocompleteItems, children = _a.children, grow = _a.grow, initialValue = _a.initialValue, onChange = _a.onChange, onFocus = _a.onFocus, onBlur = _a.onBlur, showClearButton = _a.showClearButton, _b = _a.clearButtonVariant, clearButtonVariant = _b === void 0 ? undefined : _b, _c = _a.clearButtonAriaLabel, clearButtonAriaLabel = _c === void 0 ? "Reset Search Input" : _c, labelId = _a.labelId, _d = _a.getStatusText, getStatusText = _d === void 0 ? buildStatusString : _d, id = _a.id, elemProps = __rest(_a, ["autocompleteItems", "children", "grow", "initialValue", "onChange", "onFocus", "onBlur", "showClearButton", "clearButtonVariant", "clearButtonAriaLabel", "labelId", "getStatusText", "id"]);
116
- var _e = useState(false), isOpened = _e[0], setIsOpened = _e[1];
117
- var _f = useState(''), value = _f[0], _setValue = _f[1]; // Don't call _setValue directly instead call setInputValue to make sure onChange fires correctly
118
- var _g = useState(false), showingAutocomplete = _g[0], setShowingAutocomplete = _g[1];
119
- var _h = useState(null), selectedAutocompleteIndex = _h[0], setSelectedAutocompleteIndex = _h[1];
120
- var _j = useState([]), interactiveAutocompleteItems = _j[0], setInteractiveAutocompleteItems = _j[1];
121
- var _k = useState(''), announcementText = _k[0], setAnnouncementText = _k[1];
84
+ export const Combobox = ({ autocompleteItems, children, grow, initialValue, onChange, onFocus, onBlur, showClearButton, clearButtonVariant = undefined, clearButtonAriaLabel = `Reset Search Input`, labelId, getStatusText = buildStatusString, id, ...elemProps }) => {
85
+ const [isOpened, setIsOpened] = useState(false);
86
+ const [value, _setValue] = useState(''); // Don't call _setValue directly instead call setInputValue to make sure onChange fires correctly
87
+ const [showingAutocomplete, setShowingAutocomplete] = useState(false);
88
+ const [selectedAutocompleteIndex, setSelectedAutocompleteIndex] = useState(null);
89
+ const [interactiveAutocompleteItems, setInteractiveAutocompleteItems] = useState([]);
90
+ const [announcementText, setAnnouncementText] = useState('');
122
91
  // Create a ref to the soon-to-be-created TextInput clone for internal use.
123
92
  // Use useForkRef to combine it with the ref already assigned to the original
124
93
  // TextInput (if it exists) to create a single callback ref which can be
125
94
  // forwarded to the TextInput clone.
126
- var inputRef = useRef(null);
95
+ const inputRef = useRef(null);
127
96
  // We need access to the original TextInput's ref _property_ (not prop) so we
128
97
  // can combine it with the internal inputRef using useForkRef. ref isn't
129
98
  // listed in the ReactElement interface, but it's there, so we cast children
130
99
  // to satisfy TS.
131
- var elementRef = useForkRef(children.ref, inputRef);
132
- var comboboxRef = useRef(null);
133
- var randomComponentId = useUniqueId();
134
- var randomLabelId = useUniqueId();
135
- var componentId = id || randomComponentId;
136
- var formLabelId = labelId || randomLabelId;
137
- var _l = useState(false), showGroupText = _l[0], setShowGroupText = _l[1];
100
+ const elementRef = useForkRef(children.ref, inputRef);
101
+ const comboboxRef = useRef(null);
102
+ const randomComponentId = useUniqueId();
103
+ const randomLabelId = useUniqueId();
104
+ const componentId = id || randomComponentId;
105
+ const formLabelId = labelId || randomLabelId;
106
+ const [showGroupText, setShowGroupText] = useState(false);
138
107
  // We're using LayoutEffect here because of an issue with the Synthetic event system and typing a key
139
108
  // after the listbox has been closed. Somehow the key is ignored unless we use `useLayoutEffect`
140
- useLayoutEffect(function () {
141
- var shouldShow = interactiveAutocompleteItems.length > 0 && isOpened;
109
+ useLayoutEffect(() => {
110
+ const shouldShow = interactiveAutocompleteItems.length > 0 && isOpened;
142
111
  setShowingAutocomplete(shouldShow);
143
112
  if (shouldShow) {
144
113
  setAnnouncementText(getStatusText(interactiveAutocompleteItems.length));
145
114
  }
146
115
  }, [getStatusText, interactiveAutocompleteItems, isOpened]);
147
116
  // Used to set the position of the reset button and the padding direction inside the input container
148
- var isRTL = useIsRTL();
149
- var setInputValue = useCallback(function (newValue) {
117
+ const isRTL = useIsRTL();
118
+ const setInputValue = useCallback((newValue) => {
150
119
  _setValue(newValue);
151
- var inputDomElement = inputRef.current;
120
+ const inputDomElement = inputRef.current;
152
121
  // Changing value prop programmatically doesn't fire an Synthetic event or trigger native onChange.
153
122
  // We can not just update .value= in setState because React library overrides input value setter
154
123
  // but we can call the function directly on the input as context.
155
124
  // This will cause onChange events to fire no matter how value is updated.
156
125
  if (inputDomElement) {
157
- var nativeInputValue = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(inputDomElement), 'value');
126
+ const nativeInputValue = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(inputDomElement), 'value');
158
127
  if (nativeInputValue && nativeInputValue.set) {
159
128
  nativeInputValue.set.call(inputDomElement, newValue);
160
129
  }
161
- var event_1;
130
+ let event;
162
131
  if (typeof Event === 'function') {
163
132
  // modern browsers
164
- event_1 = new Event('input', { bubbles: true });
133
+ event = new Event('input', { bubbles: true });
165
134
  }
166
135
  else {
167
136
  // IE 11
168
- event_1 = document.createEvent('Event');
169
- event_1.initEvent('input', true, true);
137
+ event = document.createEvent('Event');
138
+ event.initEvent('input', true, true);
170
139
  }
171
- inputDomElement.dispatchEvent(event_1);
140
+ inputDomElement.dispatchEvent(event);
172
141
  }
173
142
  }, [inputRef]);
174
- useEffect(function () {
143
+ useEffect(() => {
175
144
  if (initialValue !== null && initialValue !== undefined) {
176
145
  setInputValue(initialValue);
177
146
  }
178
147
  }, [initialValue, setInputValue]);
179
- useEffect(function () {
180
- var getInteractiveAutocompleteItems = function () {
148
+ useEffect(() => {
149
+ const getInteractiveAutocompleteItems = () => {
181
150
  if (autocompleteItems &&
182
151
  autocompleteItems.length &&
183
152
  autocompleteItems[0].hasOwnProperty('header')) {
184
- return flatten(autocompleteItems.map(function (group) { return group.items; }));
153
+ return flatten(autocompleteItems.map(group => group.items));
185
154
  }
186
155
  return autocompleteItems || [];
187
156
  };
188
157
  setInteractiveAutocompleteItems(getInteractiveAutocompleteItems());
189
158
  }, [autocompleteItems]);
190
- var handleAutocompleteClick = function (event, menuItemProps) {
159
+ const handleAutocompleteClick = (event, menuItemProps) => {
191
160
  if (menuItemProps.isDisabled) {
192
161
  return;
193
162
  }
@@ -198,25 +167,25 @@ export var Combobox = function (_a) {
198
167
  menuItemProps.onClick(event);
199
168
  }
200
169
  };
201
- var focusInput = function () {
170
+ const focusInput = () => {
202
171
  if (inputRef.current) {
203
172
  inputRef.current.focus();
204
173
  }
205
174
  };
206
- var handleClick = function (event) {
175
+ const handleClick = (event) => {
207
176
  if (!showingAutocomplete) {
208
177
  setShowingAutocomplete(true);
209
178
  }
210
179
  };
211
- var handleFocus = function (event) {
180
+ const handleFocus = (event) => {
212
181
  setIsOpened(true);
213
182
  if (onFocus) {
214
183
  onFocus(event);
215
184
  }
216
185
  };
217
- var handleBlur = function (event) {
186
+ const handleBlur = (event) => {
218
187
  if (comboboxRef.current) {
219
- var target = event.relatedTarget;
188
+ const target = event.relatedTarget;
220
189
  if (target && comboboxRef.current.contains(target)) {
221
190
  return;
222
191
  }
@@ -226,45 +195,45 @@ export var Combobox = function (_a) {
226
195
  onBlur(event);
227
196
  }
228
197
  };
229
- var resetSearchInput = function () {
198
+ const resetSearchInput = () => {
230
199
  setInputValue('');
231
200
  focusInput();
232
201
  };
233
- var getGroupIndex = function (itemIndex) {
202
+ const getGroupIndex = (itemIndex) => {
234
203
  if (itemIndex != null &&
235
204
  autocompleteItems &&
236
205
  autocompleteItems.length &&
237
206
  autocompleteItems[0].hasOwnProperty('header')) {
238
- var count_1 = 0;
239
- return autocompleteItems.findIndex(function (groups) {
240
- count_1 += groups.items.length;
241
- return count_1 > itemIndex;
207
+ let count = 0;
208
+ return autocompleteItems.findIndex(groups => {
209
+ count += groups.items.length;
210
+ return count > itemIndex;
242
211
  });
243
212
  }
244
213
  else {
245
214
  return -1;
246
215
  }
247
216
  };
248
- var handleKeyboardShortcuts = function (event) {
217
+ const handleKeyboardShortcuts = (event) => {
249
218
  if (event.ctrlKey || event.altKey || event.metaKey || !interactiveAutocompleteItems.length) {
250
219
  return;
251
220
  }
252
- var autoCompleteItemCount = interactiveAutocompleteItems.length;
253
- var firstItem = 0;
254
- var lastItem = autoCompleteItemCount - 1;
255
- var nextIndex = null;
221
+ const autoCompleteItemCount = interactiveAutocompleteItems.length;
222
+ const firstItem = 0;
223
+ const lastItem = autoCompleteItemCount - 1;
224
+ let nextIndex = null;
256
225
  setIsOpened(true);
257
226
  switch (event.key) {
258
227
  case 'ArrowUp':
259
228
  case 'Up': // IE/Edge specific value
260
- var upIndex = selectedAutocompleteIndex !== null ? selectedAutocompleteIndex - 1 : lastItem;
229
+ const upIndex = selectedAutocompleteIndex !== null ? selectedAutocompleteIndex - 1 : lastItem;
261
230
  nextIndex = upIndex < 0 ? lastItem : upIndex;
262
231
  event.stopPropagation();
263
232
  event.preventDefault();
264
233
  break;
265
234
  case 'ArrowDown':
266
235
  case 'Down': // IE/Edge specific value
267
- var downIndex = selectedAutocompleteIndex !== null ? selectedAutocompleteIndex + 1 : firstItem;
236
+ const downIndex = selectedAutocompleteIndex !== null ? selectedAutocompleteIndex + 1 : firstItem;
268
237
  nextIndex = downIndex >= autoCompleteItemCount ? firstItem : downIndex;
269
238
  event.stopPropagation();
270
239
  event.preventDefault();
@@ -275,7 +244,7 @@ export var Combobox = function (_a) {
275
244
  break;
276
245
  case 'Enter':
277
246
  if (selectedAutocompleteIndex != null) {
278
- var item = interactiveAutocompleteItems[selectedAutocompleteIndex];
247
+ const item = interactiveAutocompleteItems[selectedAutocompleteIndex];
279
248
  handleAutocompleteClick(event, item.props);
280
249
  if (item.props.isDisabled) {
281
250
  nextIndex = selectedAutocompleteIndex;
@@ -286,25 +255,27 @@ export var Combobox = function (_a) {
286
255
  break;
287
256
  default:
288
257
  }
289
- var lastGroupIndex = getGroupIndex(selectedAutocompleteIndex);
290
- var nextGroupIndex = getGroupIndex(nextIndex);
258
+ const lastGroupIndex = getGroupIndex(selectedAutocompleteIndex);
259
+ const nextGroupIndex = getGroupIndex(nextIndex);
291
260
  setShowGroupText(lastGroupIndex !== nextGroupIndex);
292
261
  setSelectedAutocompleteIndex(nextIndex);
293
262
  };
294
- var handleSearchInputChange = function (event) {
263
+ const handleSearchInputChange = (event) => {
295
264
  if (onChange) {
296
265
  onChange(event);
297
266
  }
298
267
  _setValue(event.target.value); // Calling set value directly only for on change event
299
268
  };
300
- var renderChildren = function (inputElement) {
301
- var _a;
302
- var cssOverride = { ':focus': { zIndex: 2 } };
269
+ const renderChildren = (inputElement) => {
270
+ let cssOverride = { ':focus': { zIndex: 2 } };
303
271
  if (showClearButton) {
304
- var paddingDirection = isRTL ? 'paddingLeft' : 'paddingRight';
305
- cssOverride = __assign(__assign({}, cssOverride), (_a = {}, _a[paddingDirection] = space.xl, _a));
272
+ const paddingDirection = isRTL ? 'paddingLeft' : 'paddingRight';
273
+ cssOverride = {
274
+ ...cssOverride,
275
+ [paddingDirection]: space.xl,
276
+ };
306
277
  }
307
- var newTextInputProps = {
278
+ const newTextInputProps = {
308
279
  type: 'text',
309
280
  id: componentId,
310
281
  grow: grow,
@@ -321,16 +292,17 @@ export var Combobox = function (_a) {
321
292
  onBlur: handleBlur,
322
293
  css: cssOverride,
323
294
  role: 'combobox',
324
- 'aria-owns': showingAutocomplete ? componentId + "-" + listBoxIdPart : undefined,
295
+ 'aria-owns': showingAutocomplete ? `${componentId}-${listBoxIdPart}` : undefined,
325
296
  'aria-haspopup': true,
326
297
  'aria-expanded': showingAutocomplete,
327
298
  };
328
- var cloneElement = function (element, props) {
329
- return jsx(element.type, __assign(__assign({}, element.props), props));
330
- };
331
- return cloneElement(inputElement, __assign(__assign({}, inputElement.props), newTextInputProps));
299
+ const cloneElement = (element, props) => jsx(element.type, {
300
+ ...element.props,
301
+ ...props,
302
+ });
303
+ return cloneElement(inputElement, { ...inputElement.props, ...newTextInputProps });
332
304
  };
333
- return (React.createElement(Container, __assign({ grow: grow }, elemProps),
305
+ return (React.createElement(Container, Object.assign({ grow: grow }, elemProps),
334
306
  React.createElement(InputContainer, { ref: comboboxRef },
335
307
  isValidSingleChild(children) && React.Children.map(children, renderChildren),
336
308
  showClearButton && (React.createElement(ResetButton, { shouldShow: !!value, "aria-label": clearButtonAriaLabel, icon: xSmallIcon, variant: clearButtonVariant, onClick: resetSearchInput, onBlur: handleBlur, size: "small", type: "button" })),
@@ -1,17 +1,16 @@
1
1
  import React, { useState, useEffect } from 'react';
2
2
  import styled from '@emotion/styled';
3
3
  import { accessibleHide } from '@workday/canvas-kit-react/common';
4
- var Container = styled('div')(accessibleHide);
5
- export var Status = function (_a) {
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
- var _g = useState(announcementText), displayText = _g[0], setDisplayText = _g[1];
8
- useEffect(function () {
4
+ const Container = styled('div')(accessibleHide);
5
+ export const Status = ({ ariaLive = 'polite', role = 'status', ariaRelevant = 'additions', expireMilliseconds = 500, announcementText = '', ariaAtomic, }) => {
6
+ const [displayText, setDisplayText] = useState(announcementText);
7
+ useEffect(() => {
9
8
  if (!announcementText) {
10
9
  return;
11
10
  }
12
11
  setDisplayText(announcementText);
13
- var clearText = setTimeout(function () { return setDisplayText(''); }, expireMilliseconds);
14
- return function () {
12
+ const clearText = setTimeout(() => setDisplayText(''), expireMilliseconds);
13
+ return () => {
15
14
  clearTimeout(clearText);
16
15
  };
17
16
  }, [announcementText, expireMilliseconds]);
@@ -1,3 +1,2 @@
1
1
  export * from './useThemeRTL';
2
- export * from './useThemedRing';
3
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../common/lib/theming/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../common/lib/theming/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
@@ -1,2 +1 @@
1
1
  export * from './useThemeRTL';
2
- export * from './useThemedRing';
@@ -1,6 +1,9 @@
1
1
  import { CSSProperties } from '@workday/canvas-kit-react/tokens';
2
2
  export declare type ComponentStyles = Record<string, CSSProperties>;
3
3
  /**
4
+ * @deprecated Now that IE11 is no longer supported, we encourage consumers to use [CSS logical properties](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Logical_Properties)
5
+ *
6
+ *
4
7
  * A helpful hook for supporting bidirectional styles.
5
8
  * * Read below for more detail or [view the docs](https://github.com/Workday/canvas-kit/blob/master/modules/labs-react/common/README.md#useThemeRTL).
6
9
  *
@@ -1 +1 @@
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"}
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,WAAW;6BAMD,aAAa,EAAE;;EAYxC"}
@@ -1,35 +1,16 @@
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 __spreadArrays = (this && this.__spreadArrays) || function () {
13
- for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
14
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
15
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
16
- r[k] = a[j];
17
- return r;
18
- };
19
1
  import { useIsRTL, useTheme } from '@workday/canvas-kit-react/common';
20
2
  import { useMemo } from 'react';
21
3
  import rtlCSSJS from 'rtl-css-js';
22
- var getDirectionalStyles = function (isRTL) {
23
- var styles = [];
24
- for (var _i = 1; _i < arguments.length; _i++) {
25
- styles[_i - 1] = arguments[_i];
26
- }
4
+ const getDirectionalStyles = (isRTL, ...styles) => {
27
5
  return isRTL ? rtlCSSJS(styles) : styles;
28
6
  };
29
- var getConvertedStyles = function (styles, convertFunc) {
7
+ const getConvertedStyles = (styles, convertFunc) => {
30
8
  return convertFunc ? convertFunc(styles) : styles;
31
9
  };
32
10
  /**
11
+ * @deprecated Now that IE11 is no longer supported, we encourage consumers to use [CSS logical properties](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Logical_Properties)
12
+ *
13
+ *
33
14
  * A helpful hook for supporting bidirectional styles.
34
15
  * * Read below for more detail or [view the docs](https://github.com/Workday/canvas-kit/blob/master/modules/labs-react/common/README.md#useThemeRTL).
35
16
  *
@@ -59,22 +40,18 @@ var getConvertedStyles = function (styles, convertFunc) {
59
40
  * }
60
41
  */
61
42
  export function useThemeRTL() {
62
- var theme = useTheme();
63
- var direction = useIsRTL(theme);
64
- var convertFunc = theme.canvas._styleRewriteFn;
65
- var themeRTL = useMemo(function () {
66
- return function () {
67
- var cssObject = [];
68
- for (var _i = 0; _i < arguments.length; _i++) {
69
- cssObject[_i] = arguments[_i];
70
- }
71
- var styles = getDirectionalStyles.apply(void 0, __spreadArrays([direction], cssObject));
72
- return styles.reduce(function (first, second) {
73
- var convertedFirst = getConvertedStyles(first, convertFunc);
74
- var convertedSecond = getConvertedStyles(second, convertFunc);
75
- return __assign(__assign({}, convertedFirst), convertedSecond);
43
+ const theme = useTheme();
44
+ const direction = useIsRTL(theme);
45
+ const convertFunc = theme.canvas._styleRewriteFn;
46
+ const themeRTL = useMemo(() => {
47
+ return (...cssObject) => {
48
+ const styles = getDirectionalStyles(direction, ...cssObject);
49
+ return styles.reduce((first, second) => {
50
+ const convertedFirst = getConvertedStyles(first, convertFunc);
51
+ const convertedSecond = getConvertedStyles(second, convertFunc);
52
+ return { ...convertedFirst, ...convertedSecond };
76
53
  }, {});
77
54
  };
78
55
  }, [direction, convertFunc]);
79
- return { themeRTL: themeRTL, theme: theme };
56
+ return { themeRTL, theme };
80
57
  }
@@ -8,68 +8,101 @@ export interface ExpandableProps extends ExtractProps<typeof Flex, never> {
8
8
  */
9
9
  children?: React.ReactNode;
10
10
  }
11
+ /**
12
+ * `Expandable` wraps an `Expandable.Target` and an `Expandable.Content`. By default, it provides a
13
+ * `DisclosureModel` for its subcomponents. Alternatively, a model may be passed in using the
14
+ * hoisted model pattern.
15
+ */
11
16
  export declare const Expandable: import("@workday/canvas-kit-react/common").ElementComponentM<"div", ExpandableProps & Partial<{
12
17
  id: string;
13
18
  initialVisibility: import("@workday/canvas-kit-react/disclosure").Visibility;
14
19
  }> & {
15
20
  onShow?: ((data: Event | React.SyntheticEvent<Element, Event> | undefined, prevState: {
16
21
  id: string;
17
- visibility: import("@workday/canvas-kit-react/disclosure").Visibility;
22
+ visibility: "hidden" | "visible";
18
23
  }) => void) | undefined;
19
24
  onHide?: ((data: Event | React.SyntheticEvent<Element, Event> | undefined, prevState: {
20
25
  id: string;
21
- visibility: import("@workday/canvas-kit-react/disclosure").Visibility;
26
+ visibility: "hidden" | "visible";
22
27
  }) => void) | undefined;
23
28
  } & {
24
29
  shouldShow?: ((data: Event | React.SyntheticEvent<Element, Event> | undefined, state: {
25
30
  id: string;
26
- visibility: import("@workday/canvas-kit-react/disclosure").Visibility;
31
+ visibility: "hidden" | "visible";
27
32
  }) => boolean) | undefined;
28
33
  shouldHide?: ((data: Event | React.SyntheticEvent<Element, Event> | undefined, state: {
29
34
  id: string;
30
- visibility: import("@workday/canvas-kit-react/disclosure").Visibility;
35
+ visibility: "hidden" | "visible";
31
36
  }) => boolean) | undefined;
32
37
  }, {
33
38
  state: {
34
39
  id: string;
35
- visibility: import("@workday/canvas-kit-react/disclosure").Visibility;
40
+ visibility: "hidden" | "visible";
36
41
  };
37
42
  events: {
38
43
  show(event?: Event | React.SyntheticEvent<Element, Event> | undefined): void;
39
44
  hide(event?: Event | React.SyntheticEvent<Element, Event> | undefined): void;
40
45
  };
41
46
  }> & {
47
+ /**
48
+ * `Expandable.Target` creates a heading and a button. The heading is a semantic heading to
49
+ * describe the associated content. The button provides users the ability to toggle the
50
+ * associated content.
51
+ *
52
+ * As according to the [W3 disclosure
53
+ * specification](https://www.w3.org/TR/wai-aria-practices-1.1/#disclosure), the button has
54
+ * `aria-expanded` and `aria-controls` attributes set by default
55
+ *
56
+ * This component should hold an `Expandable.Icon`, an optional `Expandable.Avatar`, and an
57
+ * `Expandable.Title`.
58
+ */
42
59
  Target: import("@workday/canvas-kit-react/common").ElementComponentM<"button", import("./ExpandableTarget").ExpandableTargetProps, {
43
60
  state: {
44
61
  id: string;
45
- visibility: import("@workday/canvas-kit-react/disclosure").Visibility;
62
+ visibility: "hidden" | "visible";
46
63
  };
47
64
  events: {
48
65
  show(event?: Event | React.SyntheticEvent<Element, Event> | undefined): void;
49
66
  hide(event?: Event | React.SyntheticEvent<Element, Event> | undefined): void;
50
67
  };
51
68
  }>;
52
- Content: import("@workday/canvas-kit-react/common").ElementComponentM<"div", import("./ExpandableContent").ExpandableContentProps, {
69
+ /**
70
+ * `Expandable.Title` styles the target text that describes the content.
71
+ */
72
+ Title: import("@workday/canvas-kit-react/common").ElementComponent<"div", import("./ExpandableTitle").ExpandableTitleProps>;
73
+ /**
74
+ * `Expandable.Icon` creates an icon to visually indicate the state of the content. It takes an
75
+ * `iconPosition` prop to determine which chevron icon to use.
76
+ */
77
+ Icon: import("@workday/canvas-kit-react/common").ElementComponentM<"span", import("./ExpandableIcon").ExpandableIconProps, {
53
78
  state: {
54
79
  id: string;
55
- visibility: import("@workday/canvas-kit-react/disclosure").Visibility;
80
+ visibility: "hidden" | "visible";
56
81
  };
57
82
  events: {
58
83
  show(event?: Event | React.SyntheticEvent<Element, Event> | undefined): void;
59
84
  hide(event?: Event | React.SyntheticEvent<Element, Event> | undefined): void;
60
85
  };
61
86
  }>;
62
- Icon: import("@workday/canvas-kit-react/common").ElementComponentM<"span", import("./ExpandableIcon").ExpandableIconProps, {
87
+ /**
88
+ * `Expandable.Avatar` is an optional component that creates an `Avatar` to display a decorative
89
+ * image.
90
+ */
91
+ Avatar: import("@workday/canvas-kit-react/common").ElementComponent<"button", import("./ExpandableAvatar").ExpandableAvatarProps>;
92
+ /**
93
+ * `Expandable.Content` holds the content that will be conditionally expanded and collapsed. It
94
+ * has an `id` to ensure the `Expandable.Target` properly set it to the `aria-controls`
95
+ * attribute.
96
+ */
97
+ Content: import("@workday/canvas-kit-react/common").ElementComponentM<"div", import("./ExpandableContent").ExpandableContentProps, {
63
98
  state: {
64
99
  id: string;
65
- visibility: import("@workday/canvas-kit-react/disclosure").Visibility;
100
+ visibility: "hidden" | "visible";
66
101
  };
67
102
  events: {
68
103
  show(event?: Event | React.SyntheticEvent<Element, Event> | undefined): void;
69
104
  hide(event?: Event | React.SyntheticEvent<Element, Event> | undefined): void;
70
105
  };
71
106
  }>;
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
107
  };
75
108
  //# sourceMappingURL=Expandable.d.ts.map