@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,17 +1,15 @@
1
- export declare const useExpandableTarget: <P extends {}, R>(model: {
1
+ export declare const useExpandableTarget: import("@workday/canvas-kit-react/common").BehaviorHook<{
2
2
  state: {
3
3
  id: string;
4
- visibility: import("@workday/canvas-kit-react/disclosure").Visibility;
4
+ visibility: "hidden" | "visible";
5
5
  };
6
6
  events: {
7
7
  show(event?: Event | import("react").SyntheticEvent<Element, Event> | undefined): void;
8
8
  hide(event?: Event | import("react").SyntheticEvent<Element, Event> | undefined): void;
9
9
  };
10
- }, elemProps?: P | undefined, ref?: ((instance: R | null) => void) | import("react").RefObject<R> | null | undefined) => {
10
+ }, {
11
11
  'aria-controls': string;
12
12
  'aria-expanded': boolean;
13
13
  onClick: (event: React.MouseEvent) => void;
14
- } & P & (R extends HTMLOrSVGElement ? {
15
- ref: import("react").Ref<R>;
16
- } : {});
14
+ }>;
17
15
  //# sourceMappingURL=useExpandableTarget.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useExpandableTarget.d.ts","sourceRoot":"","sources":["../../../../../expandable/lib/hooks/useExpandableTarget.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,mBAAmB;;;;;;;;;;;;qBAIX,gBAAgB;;;OAQnC,CAAC"}
1
+ {"version":3,"file":"useExpandableTarget.d.ts","sourceRoot":"","sources":["../../../../../expandable/lib/hooks/useExpandableTarget.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,mBAAmB;;;;;;;;;;;;qBAIX,gBAAgB;EAQnC,CAAC"}
@@ -1,11 +1,10 @@
1
1
  import { createElemPropsHook } from '@workday/canvas-kit-react/common';
2
- import { useExpandableModel } from '../useExpandableModel';
3
- export var useExpandableTarget = createElemPropsHook(useExpandableModel)(function (_a) {
4
- var state = _a.state, events = _a.events;
2
+ import { useExpandableModel } from './useExpandableModel';
3
+ export const useExpandableTarget = createElemPropsHook(useExpandableModel)(({ state, events }) => {
5
4
  return {
6
5
  'aria-controls': state.id,
7
6
  'aria-expanded': state.visibility !== 'hidden',
8
- onClick: function (event) {
7
+ onClick: (event) => {
9
8
  if (state.visibility !== 'hidden') {
10
9
  events.hide(event);
11
10
  }
@@ -1,7 +1,4 @@
1
1
  export * from './combobox';
2
- export * from './common';
3
- export * from './drawer';
4
2
  export * from './expandable';
5
3
  export * from './search-form';
6
- export * from './toast';
7
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC"}
package/dist/es6/index.js CHANGED
@@ -1,6 +1,3 @@
1
1
  export * from './combobox';
2
- export * from './common';
3
- export * from './drawer';
4
2
  export * from './expandable';
5
3
  export * from './search-form';
6
- export * from './toast';
@@ -78,6 +78,11 @@ export interface SearchFormProps extends GrowthBehavior, React.FormHTMLAttribute
78
78
  * @default false
79
79
  */
80
80
  allowEmptyStringSearch?: boolean;
81
+ /**
82
+ * Sets the `id` for the label
83
+ * @default unique identifier
84
+ */
85
+ labelId?: string;
81
86
  }
82
87
  export interface SearchFormState {
83
88
  showForm: boolean;
@@ -88,7 +93,7 @@ export declare class SearchForm extends React.Component<SearchFormProps, SearchF
88
93
  static Theme: typeof SearchTheme;
89
94
  private inputRef;
90
95
  private openRef;
91
- private labelId;
96
+ private defaultLabelId;
92
97
  state: Readonly<SearchFormState>;
93
98
  private getTheme;
94
99
  private getThemeColors;
@@ -1 +1 @@
1
- {"version":3,"file":"SearchForm.d.ts","sourceRoot":"","sources":["../../../../search-form/lib/SearchForm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAC,cAAc,EAA2B,MAAM,kCAAkC,CAAC;AAC1F,OAAO,EAAiB,mBAAmB,EAAC,MAAM,kCAAkC,CAAC;AAKrF,OAAO,EAAe,WAAW,EAAE,qBAAqB,EAAC,MAAM,UAAU,CAAC;AAG1E,MAAM,WAAW,eAAgB,SAAQ,cAAc,EAAE,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AC,SAAS,CAAC,CAOpD;IAEF,YAAY,UAAW,MAAM,SAAS,CAAC,eAAe,CAAC,KAAG,IAAI,CAO5D;IAEF,mBAAmB,QAAO,IAAI,CAI5B;IAEF,oBAAoB,QAAO,IAAI,CAI7B;IAEF,kBAAkB,CAAC,SAAS,EAAE,eAAe,EAAE,SAAS,EAAE,eAAe;IAWzE,UAAU,QAAO,IAAI,CAInB;IAEF,SAAS,QAAO,IAAI,CAIlB;IAEF,WAAW,QAAO,IAAI,CAEpB;IAEF,UAAU,QAAO,IAAI,CAEnB;IAEF,uBAAuB,UAAW,MAAM,WAAW,CAAC,gBAAgB,CAAC,KAAG,IAAI,CAM1E;IAEF,MAAM;CAoGP"}
@@ -1,38 +1,3 @@
1
- var __extends = (this && this.__extends) || (function () {
2
- var extendStatics = function (d, b) {
3
- extendStatics = Object.setPrototypeOf ||
4
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
- return extendStatics(d, b);
7
- };
8
- return function (d, b) {
9
- extendStatics(d, b);
10
- function __() { this.constructor = d; }
11
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
12
- };
13
- })();
14
- var __assign = (this && this.__assign) || function () {
15
- __assign = Object.assign || function(t) {
16
- for (var s, i = 1, n = arguments.length; i < n; i++) {
17
- s = arguments[i];
18
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
19
- t[p] = s[p];
20
- }
21
- return t;
22
- };
23
- return __assign.apply(this, arguments);
24
- };
25
- var __rest = (this && this.__rest) || function (s, e) {
26
- var t = {};
27
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
28
- t[p] = s[p];
29
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
30
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
31
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
32
- t[p[i]] = s[p[i]];
33
- }
34
- return t;
35
- };
36
1
  import * as React from 'react';
37
2
  import { colors, space, spaceNumbers } from '@workday/canvas-kit-react/tokens';
38
3
  import { styled, generateUniqueId } from '@workday/canvas-kit-react/common';
@@ -54,19 +19,18 @@ function getInputColors(theme, isFocused) {
54
19
  boxShadow: isFocused && theme.boxShadowFocus ? theme.boxShadowFocus : theme.boxShadow,
55
20
  };
56
21
  }
57
- var formCollapsedBackground = colors.frenchVanilla100;
58
- var maxWidth = 480;
59
- var minWidth = 120;
60
- var StyledSearchForm = styled('form')({
22
+ const formCollapsedBackground = colors.frenchVanilla100;
23
+ const maxWidth = 480;
24
+ const minWidth = 120;
25
+ const StyledSearchForm = styled('form')({
61
26
  position: 'relative',
62
27
  flexGrow: 1,
63
28
  display: 'flex',
64
29
  alignItems: 'center',
65
30
  marginLeft: space.m,
66
31
  minWidth: minWidth,
67
- }, function (_a) {
68
- var isCollapsed = _a.isCollapsed, showForm = _a.showForm, rightAlign = _a.rightAlign, grow = _a.grow;
69
- var collapseStyles = isCollapsed
32
+ }, ({ isCollapsed, showForm, rightAlign, grow }) => {
33
+ const collapseStyles = isCollapsed
70
34
  ? {
71
35
  top: 0,
72
36
  right: 0,
@@ -82,34 +46,30 @@ var StyledSearchForm = styled('form')({
82
46
  zIndex: 1,
83
47
  }
84
48
  : {};
85
- var rightAlignStyles = rightAlign
49
+ const rightAlignStyles = rightAlign
86
50
  ? {
87
51
  textAlign: 'right',
88
52
  maxWidth: grow ? '100%' : maxWidth,
89
53
  }
90
54
  : {};
91
- return __assign(__assign({}, rightAlignStyles), collapseStyles);
55
+ return { ...rightAlignStyles, ...collapseStyles };
92
56
  });
93
- var SearchContainer = styled('div')({
94
- position: "relative",
57
+ const SearchContainer = styled('div')({
58
+ position: `relative`,
95
59
  display: 'flex',
96
60
  alignItems: 'center',
97
- width: "100%",
61
+ width: `100%`,
98
62
  textAlign: 'left',
99
- }, function (_a) {
100
- var height = _a.height;
101
- return ({
102
- minHeight: height,
103
- });
104
- });
105
- var SearchCombobox = styled(Combobox)({
106
- width: "100%",
63
+ }, ({ height }) => ({
64
+ minHeight: height,
65
+ }));
66
+ const SearchCombobox = styled(Combobox)({
67
+ width: `100%`,
107
68
  });
108
- var SearchIcon = styled(TertiaryButton)(function (_a) {
109
- var isCollapsed = _a.isCollapsed, isHidden = _a.isHidden;
69
+ const SearchIcon = styled(TertiaryButton)(({ isCollapsed, isHidden }) => {
110
70
  return {
111
- position: "absolute",
112
- margin: isCollapsed ? "auto " + space.xxs : "auto " + space.xxxs,
71
+ position: `absolute`,
72
+ margin: isCollapsed ? `auto ${space.xxs}` : `auto ${space.xxxs}`,
113
73
  top: 0,
114
74
  bottom: 0,
115
75
  left: 0,
@@ -118,19 +78,25 @@ var SearchIcon = styled(TertiaryButton)(function (_a) {
118
78
  display: isHidden ? 'none' : 'flex',
119
79
  };
120
80
  });
121
- var CloseButton = styled(TertiaryButton)(function (_a) {
122
- var isCollapsed = _a.isCollapsed, showForm = _a.showForm;
123
- var collapseStyles = isCollapsed && showForm
81
+ const CloseButton = styled(TertiaryButton)(({ isCollapsed, showForm }) => {
82
+ const collapseStyles = isCollapsed && showForm
124
83
  ? {
125
84
  display: 'inline-block',
126
85
  }
127
86
  : {
128
87
  display: 'none',
129
88
  };
130
- return __assign({ position: "absolute", top: 0, bottom: 0, right: 0, margin: "auto " + space.xxs, zIndex: 3 }, collapseStyles);
89
+ return {
90
+ position: `absolute`,
91
+ top: 0,
92
+ bottom: 0,
93
+ right: 0,
94
+ margin: `auto ${space.xxs}`,
95
+ zIndex: 3,
96
+ ...collapseStyles,
97
+ };
131
98
  });
132
- var SearchField = styled(FormField)(function (_a) {
133
- var isCollapsed = _a.isCollapsed, showForm = _a.showForm, grow = _a.grow, height = _a.height;
99
+ const SearchField = styled(FormField)(({ isCollapsed, showForm, grow, height }) => {
134
100
  return {
135
101
  display: (isCollapsed && showForm) || !isCollapsed ? 'inline-block' : 'none',
136
102
  width: '100%',
@@ -142,16 +108,15 @@ var SearchField = styled(FormField)(function (_a) {
142
108
  },
143
109
  };
144
110
  });
145
- var SearchInput = styled(TextInput)(function (_a) {
146
- var isCollapsed = _a.isCollapsed, inputColors = _a.inputColors, grow = _a.grow, height = _a.height;
147
- var collapseStyles = isCollapsed
111
+ const SearchInput = styled(TextInput)(({ isCollapsed, inputColors, grow, height }) => {
112
+ const collapseStyles = isCollapsed
148
113
  ? {
149
114
  fontSize: '20px',
150
115
  paddingLeft: spaceNumbers.xl + spaceNumbers.s,
151
116
  paddingRight: spaceNumbers.xl + spaceNumbers.s,
152
117
  maxWidth: 'none',
153
118
  minWidth: 0,
154
- backgroundColor: "rgba(0, 0, 0, 0)",
119
+ backgroundColor: `rgba(0, 0, 0, 0)`,
155
120
  height: height,
156
121
  }
157
122
  : {
@@ -162,11 +127,22 @@ var SearchInput = styled(TextInput)(function (_a) {
162
127
  backgroundColor: inputColors.background,
163
128
  height: height,
164
129
  };
165
- return __assign({ fontSize: '14px', boxShadow: inputColors.boxShadow, color: inputColors.color, border: 'none', WebkitAppearance: 'none', transition: 'background-color 120ms, color 120ms, box-shadow 200ms, border-color 200ms', zIndex: 2, width: '100%', '&::-webkit-search-cancel-button': {
130
+ return {
131
+ fontSize: '14px',
132
+ boxShadow: inputColors.boxShadow,
133
+ color: inputColors.color,
134
+ border: 'none',
135
+ WebkitAppearance: 'none',
136
+ transition: 'background-color 120ms, color 120ms, box-shadow 200ms, border-color 200ms',
137
+ zIndex: 2,
138
+ width: '100%',
139
+ '&::-webkit-search-cancel-button': {
166
140
  display: 'none',
167
- }, '&::placeholder': {
141
+ },
142
+ '&::placeholder': {
168
143
  color: inputColors.placeholderColor,
169
- }, '&:not([disabled])': {
144
+ },
145
+ '&:not([disabled])': {
170
146
  '&:focus, &:active': {
171
147
  outline: 'none',
172
148
  boxShadow: inputColors.boxShadow,
@@ -174,93 +150,93 @@ var SearchInput = styled(TextInput)(function (_a) {
174
150
  '&:hover': {
175
151
  backgroundColor: inputColors.backgroundHover,
176
152
  },
177
- } }, collapseStyles);
153
+ },
154
+ ...collapseStyles,
155
+ };
178
156
  });
179
- var SearchForm = /** @class */ (function (_super) {
180
- __extends(SearchForm, _super);
181
- function SearchForm() {
182
- var _this = _super !== null && _super.apply(this, arguments) || this;
183
- _this.inputRef = React.createRef();
184
- _this.openRef = React.createRef();
185
- _this.labelId = generateUniqueId();
186
- _this.state = {
157
+ export class SearchForm extends React.Component {
158
+ constructor() {
159
+ super(...arguments);
160
+ this.inputRef = React.createRef();
161
+ this.openRef = React.createRef();
162
+ this.defaultLabelId = generateUniqueId();
163
+ this.state = {
187
164
  showForm: false,
188
165
  searchQuery: '',
189
166
  isFocused: false,
190
167
  };
191
- _this.getTheme = function () {
192
- var theme;
193
- if (typeof _this.props.searchTheme === 'number') {
194
- theme = searchThemes[_this.props.searchTheme];
168
+ this.getTheme = () => {
169
+ let theme;
170
+ if (typeof this.props.searchTheme === 'number') {
171
+ theme = searchThemes[this.props.searchTheme];
195
172
  }
196
- else if (_this.props.searchTheme) {
197
- theme = _this.props.searchTheme;
173
+ else if (this.props.searchTheme) {
174
+ theme = this.props.searchTheme;
198
175
  }
199
176
  else {
200
177
  theme = searchThemes[SearchTheme.Light];
201
178
  }
202
179
  return theme;
203
180
  };
204
- _this.getThemeColors = function () {
205
- var theme = _this.props.isCollapsed && _this.state.showForm
181
+ this.getThemeColors = () => {
182
+ const theme = this.props.isCollapsed && this.state.showForm
206
183
  ? searchThemes[SearchTheme.Transparent]
207
- : _this.getTheme();
208
- return getInputColors(theme, _this.state.isFocused);
184
+ : this.getTheme();
185
+ return getInputColors(theme, this.state.isFocused);
209
186
  };
210
- _this.getIconButtonType = function () {
211
- var background = _this.getThemeColors().background || "#fff";
212
- if (_this.props.isCollapsed && _this.state.showForm) {
187
+ this.getIconButtonType = () => {
188
+ let background = this.getThemeColors().background || `#fff`;
189
+ if (this.props.isCollapsed && this.state.showForm) {
213
190
  background = formCollapsedBackground;
214
191
  }
215
- var isDarkBackground = chroma(background).get('lab.l') < 70;
192
+ const isDarkBackground = chroma(background).get('lab.l') < 70;
216
193
  return isDarkBackground ? 'inverse' : undefined;
217
194
  };
218
- _this.handleSubmit = function (event) {
195
+ this.handleSubmit = (event) => {
219
196
  event.preventDefault();
220
- if (_this.props.allowEmptyStringSearch || _this.state.searchQuery.trim()) {
221
- _this.props.onSubmit(event);
197
+ if (this.props.allowEmptyStringSearch || this.state.searchQuery.trim()) {
198
+ this.props.onSubmit(event);
222
199
  }
223
200
  else {
224
- _this.focusInput();
201
+ this.focusInput();
225
202
  }
226
203
  };
227
- _this.openCollapsedSearch = function () {
228
- if (_this.props.isCollapsed && !_this.state.showForm) {
229
- _this.setState({ showForm: true });
204
+ this.openCollapsedSearch = () => {
205
+ if (this.props.isCollapsed && !this.state.showForm) {
206
+ this.setState({ showForm: true });
230
207
  }
231
208
  };
232
- _this.closeCollapsedSearch = function () {
233
- if (_this.props.isCollapsed && _this.state.showForm) {
234
- _this.setState({ showForm: false });
209
+ this.closeCollapsedSearch = () => {
210
+ if (this.props.isCollapsed && this.state.showForm) {
211
+ this.setState({ showForm: false });
235
212
  }
236
213
  };
237
- _this.focusInput = function () {
238
- if (_this.inputRef.current) {
239
- _this.inputRef.current.focus();
214
+ this.focusInput = () => {
215
+ if (this.inputRef.current) {
216
+ this.inputRef.current.focus();
240
217
  }
241
218
  };
242
- _this.focusOpen = function () {
243
- if (_this.openRef.current) {
244
- _this.openRef.current.focus();
219
+ this.focusOpen = () => {
220
+ if (this.openRef.current) {
221
+ this.openRef.current.focus();
245
222
  }
246
223
  };
247
- _this.handleFocus = function () {
248
- _this.setState({ isFocused: true });
224
+ this.handleFocus = () => {
225
+ this.setState({ isFocused: true });
249
226
  };
250
- _this.handleBlur = function () {
251
- _this.setState({ isFocused: false });
227
+ this.handleBlur = () => {
228
+ this.setState({ isFocused: false });
252
229
  };
253
- _this.handleSearchInputChange = function (event) {
230
+ this.handleSearchInputChange = (event) => {
254
231
  event.preventDefault();
255
- _this.setState({ searchQuery: event.target.value });
256
- if (_this.props.onInputChange) {
257
- _this.props.onInputChange(event);
232
+ this.setState({ searchQuery: event.target.value });
233
+ if (this.props.onInputChange) {
234
+ this.props.onInputChange(event);
258
235
  }
259
236
  };
260
- return _this;
261
237
  }
262
- SearchForm.prototype.componentDidUpdate = function (prevProps, prevState) {
263
- var showFormToggled = this.state.showForm !== prevState.showForm;
238
+ componentDidUpdate(prevProps, prevState) {
239
+ const showFormToggled = this.state.showForm !== prevState.showForm;
264
240
  if (showFormToggled) {
265
241
  if (this.state.showForm) {
266
242
  this.focusInput();
@@ -269,19 +245,17 @@ var SearchForm = /** @class */ (function (_super) {
269
245
  this.focusOpen();
270
246
  }
271
247
  }
272
- };
273
- SearchForm.prototype.render = function () {
274
- var _a = this.props, _b = _a.clearButtonAriaLabel, clearButtonAriaLabel = _b === void 0 ? 'Reset Search Form' : _b, _c = _a.placeholder, placeholder = _c === void 0 ? 'Search' : _c, _d = _a.inputLabel, inputLabel = _d === void 0 ? 'Search' : _d, _e = _a.submitAriaLabel, submitAriaLabel = _e === void 0 ? 'Search' : _e, _f = _a.openButtonAriaLabel, openButtonAriaLabel = _f === void 0 ? 'Open Search' : _f, _g = _a.closeButtonAriaLabel, closeButtonAriaLabel = _g === void 0 ? 'Cancel' : _g, _h = _a.showClearButton, showClearButton = _h === void 0 ? true : _h, _j = _a.height, height = _j === void 0 ? 40 : _j, grow = _a.grow, onSubmit = _a.onSubmit, isCollapsed = _a.isCollapsed, onInputChange = _a.onInputChange, autocompleteItems = _a.autocompleteItems, initialValue = _a.initialValue, searchTheme = _a.searchTheme, rightAlign = _a.rightAlign, _k = _a.allowEmptyStringSearch, allowEmptyStringSearch = _k === void 0 ? false : _k, elemProps = __rest(_a, ["clearButtonAriaLabel", "placeholder", "inputLabel", "submitAriaLabel", "openButtonAriaLabel", "closeButtonAriaLabel", "showClearButton", "height", "grow", "onSubmit", "isCollapsed", "onInputChange", "autocompleteItems", "initialValue", "searchTheme", "rightAlign", "allowEmptyStringSearch"]);
275
- return (React.createElement(StyledSearchForm, __assign({ role: "search", action: ".", rightAlign: rightAlign, grow: grow, "aria-labelledby": this.labelId, isCollapsed: isCollapsed, onSubmit: this.handleSubmit, showForm: this.state.showForm }, elemProps),
248
+ }
249
+ render() {
250
+ const { clearButtonAriaLabel = 'Reset Search Form', placeholder = 'Search', inputLabel = 'Search', submitAriaLabel = 'Search', openButtonAriaLabel = 'Open Search', closeButtonAriaLabel = 'Cancel', labelId = this.defaultLabelId, showClearButton = true, height = 40, grow, onSubmit, isCollapsed, onInputChange, autocompleteItems, initialValue, searchTheme, rightAlign, allowEmptyStringSearch = false, ...elemProps } = this.props;
251
+ return (React.createElement(StyledSearchForm, Object.assign({ role: "search", action: ".", rightAlign: rightAlign, grow: grow, "aria-labelledby": labelId, isCollapsed: isCollapsed, onSubmit: this.handleSubmit, showForm: this.state.showForm }, elemProps),
276
252
  React.createElement(SearchContainer, { height: height },
277
253
  React.createElement(SearchIcon, { "aria-label": submitAriaLabel, icon: searchIcon, isCollapsed: isCollapsed, variant: this.getIconButtonType(), type: "submit", isHidden: !!isCollapsed && !this.state.showForm }),
278
254
  React.createElement(SearchIcon, { "aria-label": openButtonAriaLabel, icon: searchIcon, isCollapsed: isCollapsed, variant: this.getIconButtonType(), onClick: this.openCollapsedSearch, ref: this.openRef, type: "button", isHidden: !isCollapsed || (!!isCollapsed && this.state.showForm) }),
279
- React.createElement(SearchField, { grow: grow, id: this.labelId, inputId: "input-" + this.labelId, label: inputLabel, labelPosition: FormFieldLabelPosition.Hidden, useFieldset: false, isCollapsed: isCollapsed, showForm: this.state.showForm, height: height },
280
- React.createElement(SearchCombobox, { initialValue: initialValue, clearButtonVariant: this.getIconButtonType(), autocompleteItems: autocompleteItems, onChange: this.handleSearchInputChange, onFocus: this.handleFocus, onBlur: this.handleBlur, showClearButton: !isCollapsed && showClearButton, clearButtonAriaLabel: clearButtonAriaLabel, labelId: this.labelId },
255
+ React.createElement(SearchField, { grow: grow, id: labelId, inputId: `input-${labelId}`, label: inputLabel, labelPosition: FormFieldLabelPosition.Hidden, useFieldset: false, isCollapsed: isCollapsed, showForm: this.state.showForm, height: height },
256
+ React.createElement(SearchCombobox, { initialValue: initialValue, clearButtonVariant: this.getIconButtonType(), autocompleteItems: autocompleteItems, onChange: this.handleSearchInputChange, onFocus: this.handleFocus, onBlur: this.handleBlur, showClearButton: !isCollapsed && showClearButton, clearButtonAriaLabel: clearButtonAriaLabel, labelId: labelId },
281
257
  React.createElement(SearchInput, { ref: this.inputRef, value: this.state.searchQuery, placeholder: placeholder, isCollapsed: isCollapsed, inputColors: this.getThemeColors(), height: height, name: "search", autoComplete: "off" }))),
282
258
  React.createElement(CloseButton, { "aria-label": closeButtonAriaLabel, icon: xIcon, isCollapsed: isCollapsed, showForm: this.state.showForm, onClick: this.closeCollapsedSearch, type: "button" }))));
283
- };
284
- SearchForm.Theme = SearchTheme;
285
- return SearchForm;
286
- }(React.Component));
287
- export { SearchForm };
259
+ }
260
+ }
261
+ SearchForm.Theme = SearchTheme;
@@ -1,4 +1,3 @@
1
- var _a;
2
1
  import { focusRing } from '@workday/canvas-kit-react/common';
3
2
  import { colors } from '@workday/canvas-kit-react/tokens';
4
3
  export var SearchTheme;
@@ -7,8 +6,8 @@ export var SearchTheme;
7
6
  SearchTheme[SearchTheme["Dark"] = 1] = "Dark";
8
7
  SearchTheme[SearchTheme["Transparent"] = 2] = "Transparent";
9
8
  })(SearchTheme || (SearchTheme = {}));
10
- export var searchThemes = (_a = {},
11
- _a[SearchTheme.Transparent] = {
9
+ export const searchThemes = {
10
+ [SearchTheme.Transparent]: {
12
11
  background: 'rgba(0, 0, 0, 0)',
13
12
  backgroundFocus: 'rgba(0, 0, 0, 0)',
14
13
  color: colors.blackPepper300,
@@ -18,7 +17,7 @@ export var searchThemes = (_a = {},
18
17
  boxShadow: 'none',
19
18
  boxShadowFocus: 'none',
20
19
  },
21
- _a[SearchTheme.Light] = {
20
+ [SearchTheme.Light]: {
22
21
  background: colors.soap200,
23
22
  backgroundFocus: colors.soap200,
24
23
  backgroundHover: colors.soap300,
@@ -27,7 +26,7 @@ export var searchThemes = (_a = {},
27
26
  boxShadow: 'none',
28
27
  boxShadowFocus: focusRing().boxShadow,
29
28
  },
30
- _a[SearchTheme.Dark] = {
29
+ [SearchTheme.Dark]: {
31
30
  background: 'rgba(0, 0, 0, 0.2)',
32
31
  backgroundFocus: colors.frenchVanilla100,
33
32
  color: colors.frenchVanilla100,
@@ -36,4 +35,4 @@ export var searchThemes = (_a = {},
36
35
  placeholderColorFocus: colors.licorice300,
37
36
  boxShadow: 'none',
38
37
  },
39
- _a);
38
+ };
@@ -1,14 +1,14 @@
1
1
  import React from 'react';
2
2
 
3
3
  import {createContainer, ExtractProps} from '@workday/canvas-kit-react/common';
4
+ import {Flex} from '@workday/canvas-kit-react/layout';
4
5
 
5
6
  import {ExpandableContent} from './ExpandableContent';
6
7
  import {ExpandableTarget} from './ExpandableTarget';
7
8
  import {ExpandableIcon} from './ExpandableIcon';
8
9
  import {ExpandableTitle} from './ExpandableTitle';
9
10
  import {ExpandableAvatar} from './ExpandableAvatar';
10
- import {Flex} from '@workday/canvas-kit-react/layout';
11
- import {useExpandableModel} from './useExpandableModel';
11
+ import {useExpandableModel} from './hooks/useExpandableModel';
12
12
 
13
13
  export interface ExpandableProps extends ExtractProps<typeof Flex, never> {
14
14
  /**
@@ -18,14 +18,48 @@ export interface ExpandableProps extends ExtractProps<typeof Flex, never> {
18
18
  children?: React.ReactNode;
19
19
  }
20
20
 
21
+ /**
22
+ * `Expandable` wraps an `Expandable.Target` and an `Expandable.Content`. By default, it provides a
23
+ * `DisclosureModel` for its subcomponents. Alternatively, a model may be passed in using the
24
+ * hoisted model pattern.
25
+ */
21
26
  export const Expandable = createContainer('div')({
27
+ displayName: 'Expandable',
22
28
  modelHook: useExpandableModel,
23
29
  subComponents: {
30
+ /**
31
+ * `Expandable.Target` creates a heading and a button. The heading is a semantic heading to
32
+ * describe the associated content. The button provides users the ability to toggle the
33
+ * associated content.
34
+ *
35
+ * As according to the [W3 disclosure
36
+ * specification](https://www.w3.org/TR/wai-aria-practices-1.1/#disclosure), the button has
37
+ * `aria-expanded` and `aria-controls` attributes set by default
38
+ *
39
+ * This component should hold an `Expandable.Icon`, an optional `Expandable.Avatar`, and an
40
+ * `Expandable.Title`.
41
+ */
24
42
  Target: ExpandableTarget,
25
- Content: ExpandableContent,
43
+ /**
44
+ * `Expandable.Title` styles the target text that describes the content.
45
+ */
46
+ Title: ExpandableTitle,
47
+ /**
48
+ * `Expandable.Icon` creates an icon to visually indicate the state of the content. It takes an
49
+ * `iconPosition` prop to determine which chevron icon to use.
50
+ */
26
51
  Icon: ExpandableIcon,
52
+ /**
53
+ * `Expandable.Avatar` is an optional component that creates an `Avatar` to display a decorative
54
+ * image.
55
+ */
27
56
  Avatar: ExpandableAvatar,
28
- Title: ExpandableTitle,
57
+ /**
58
+ * `Expandable.Content` holds the content that will be conditionally expanded and collapsed. It
59
+ * has an `id` to ensure the `Expandable.Target` properly set it to the `aria-controls`
60
+ * attribute.
61
+ */
62
+ Content: ExpandableContent,
29
63
  },
30
64
  })<ExpandableProps>(({children, ...elementProps}, Element) => (
31
65
  <Flex as={Element} flexDirection={'column'} padding={'xxs'} {...elementProps}>
@@ -1,13 +1,13 @@
1
1
  import React from 'react';
2
2
 
3
3
  import {space} from '@workday/canvas-kit-react/tokens';
4
- import {createSubcomponent} from '@workday/canvas-kit-react/common';
4
+ import {createSubcomponent, ExtractProps} from '@workday/canvas-kit-react/common';
5
+ import {Box} from '@workday/canvas-kit-react/layout';
5
6
 
6
7
  import {useExpandableContent} from './hooks/useExpandableContent';
7
- import {Box} from '@workday/canvas-kit-react/layout';
8
- import {useExpandableModel} from './useExpandableModel';
8
+ import {useExpandableModel} from './hooks/useExpandableModel';
9
9
 
10
- export interface ExpandableContentProps {
10
+ export interface ExpandableContentProps extends ExtractProps<typeof Box, never> {
11
11
  /**
12
12
  * The children of the `Expandable.Content` whose visibility is controlled by the associated
13
13
  * `Expandable.Target`
@@ -12,7 +12,8 @@ import {useExpandableIcon} from './hooks/useExpandableIcon';
12
12
  import {SystemIcon} from '@workday/canvas-kit-react/icon';
13
13
  import {IconPositions} from '@workday/canvas-kit-react/button';
14
14
  import {colors, space} from '@workday/canvas-kit-react/tokens';
15
- import {useExpandableModel} from './useExpandableModel';
15
+
16
+ import {useExpandableModel} from './hooks/useExpandableModel';
16
17
 
17
18
  export interface ExpandableIconProps extends Omit<ExtractProps<typeof SystemIcon, never>, 'icon'> {
18
19
  /**
@@ -8,11 +8,11 @@ import {
8
8
  styled,
9
9
  StyledType,
10
10
  } from '@workday/canvas-kit-react/common';
11
-
12
- import {useExpandableTarget} from './hooks/useExpandableTarget';
13
11
  import {Flex} from '@workday/canvas-kit-react/layout';
14
12
  import {colors} from '@workday/canvas-kit-react/tokens';
15
- import {useExpandableModel} from './useExpandableModel';
13
+
14
+ import {useExpandableTarget} from './hooks/useExpandableTarget';
15
+ import {useExpandableModel} from './hooks/useExpandableModel';
16
16
 
17
17
  export interface ExpandableTargetProps extends ExtractProps<typeof Flex, never> {
18
18
  /**