@workday/canvas-kit-preview-react 8.0.0 → 8.0.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 (354) hide show
  1. package/color-picker/README.md +1 -1
  2. package/color-picker/index.ts +1 -1
  3. package/color-picker/lib/ColorPicker.tsx +2 -3
  4. package/dist/commonjs/color-picker/index.d.ts +1 -1
  5. package/dist/commonjs/color-picker/index.d.ts.map +1 -1
  6. package/dist/commonjs/color-picker/index.js +2 -6
  7. package/dist/commonjs/color-picker/lib/ColorPicker.d.ts +1 -2
  8. package/dist/commonjs/color-picker/lib/ColorPicker.d.ts.map +1 -1
  9. package/dist/commonjs/color-picker/lib/ColorPicker.js +5 -4
  10. package/dist/commonjs/form-field/lib/FormField.d.ts +2 -11
  11. package/dist/commonjs/form-field/lib/FormField.d.ts.map +1 -1
  12. package/dist/commonjs/form-field/lib/FormFieldHint.d.ts +1 -1
  13. package/dist/commonjs/form-field/lib/FormFieldHint.d.ts.map +1 -1
  14. package/dist/commonjs/form-field/lib/FormFieldHint.js +2 -3
  15. package/dist/commonjs/form-field/lib/FormFieldInput.d.ts +1 -1
  16. package/dist/commonjs/form-field/lib/FormFieldLabel.d.ts.map +1 -1
  17. package/dist/commonjs/form-field/lib/FormFieldLabel.js +3 -9
  18. package/dist/commonjs/index.d.ts +2 -1
  19. package/dist/commonjs/index.d.ts.map +1 -1
  20. package/dist/commonjs/index.js +2 -2
  21. package/dist/commonjs/menu/index.d.ts +1 -4
  22. package/dist/commonjs/menu/index.d.ts.map +1 -1
  23. package/dist/commonjs/menu/index.js +1 -9
  24. package/dist/commonjs/menu/lib/Menu.d.ts +37 -13
  25. package/dist/commonjs/menu/lib/Menu.d.ts.map +1 -1
  26. package/dist/commonjs/menu/lib/Menu.js +43 -22
  27. package/dist/commonjs/menu/lib/MenuItem.d.ts +35 -14
  28. package/dist/commonjs/menu/lib/MenuItem.d.ts.map +1 -1
  29. package/dist/commonjs/menu/lib/MenuItem.js +24 -9
  30. package/dist/commonjs/pill/lib/Pill.d.ts +0 -10
  31. package/dist/commonjs/pill/lib/Pill.d.ts.map +1 -1
  32. package/dist/commonjs/segmented-control/index.d.ts +3 -0
  33. package/dist/commonjs/segmented-control/index.d.ts.map +1 -0
  34. package/dist/commonjs/{breadcrumbs → segmented-control}/index.js +2 -5
  35. package/dist/commonjs/segmented-control/lib/SegmentedControl.d.ts +1004 -0
  36. package/dist/commonjs/segmented-control/lib/SegmentedControl.d.ts.map +1 -0
  37. package/dist/commonjs/segmented-control/lib/SegmentedControl.js +22 -0
  38. package/dist/commonjs/segmented-control/lib/SegmentedControlItem.d.ts +103 -0
  39. package/dist/commonjs/segmented-control/lib/SegmentedControlItem.d.ts.map +1 -0
  40. package/dist/commonjs/segmented-control/lib/SegmentedControlItem.js +130 -0
  41. package/dist/commonjs/segmented-control/lib/SegmentedControlList.d.ts +66 -0
  42. package/dist/commonjs/segmented-control/lib/SegmentedControlList.d.ts.map +1 -0
  43. package/dist/commonjs/{breadcrumbs/lib/Breadcrumbs/Dropdown/MenuItemLink.js → segmented-control/lib/SegmentedControlList.js} +21 -28
  44. package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlItem.d.ts +60 -0
  45. package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlItem.d.ts.map +1 -0
  46. package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlItem.js +23 -0
  47. package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlModel.d.ts +1052 -0
  48. package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlModel.d.ts.map +1 -0
  49. package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlModel.js +74 -0
  50. package/dist/commonjs/select/index.d.ts +0 -3
  51. package/dist/commonjs/select/index.d.ts.map +1 -1
  52. package/dist/commonjs/select/index.js +0 -7
  53. package/dist/commonjs/select/lib/Select.d.ts +0 -1
  54. package/dist/commonjs/select/lib/Select.d.ts.map +1 -1
  55. package/dist/commonjs/select/lib/Select.js +2 -6
  56. package/dist/commonjs/select/lib/SelectBase.d.ts +2 -2
  57. package/dist/commonjs/select/lib/SelectBase.d.ts.map +1 -1
  58. package/dist/commonjs/select/lib/SelectBase.js +6 -9
  59. package/dist/commonjs/select/lib/SelectMenu.d.ts +2 -2
  60. package/dist/commonjs/select/lib/SelectMenu.d.ts.map +1 -1
  61. package/dist/commonjs/select/lib/SelectMenu.js +2 -2
  62. package/dist/commonjs/select/lib/SelectOption.d.ts +1 -2
  63. package/dist/commonjs/select/lib/SelectOption.d.ts.map +1 -1
  64. package/dist/commonjs/select/lib/SelectOption.js +2 -1
  65. package/dist/commonjs/side-panel/index.d.ts +0 -3
  66. package/dist/commonjs/side-panel/index.d.ts.map +1 -1
  67. package/dist/commonjs/side-panel/index.js +0 -7
  68. package/dist/commonjs/side-panel/lib/SidePanel.d.ts +1 -2
  69. package/dist/commonjs/side-panel/lib/SidePanel.d.ts.map +1 -1
  70. package/dist/commonjs/side-panel/lib/SidePanel.js +3 -3
  71. package/dist/commonjs/status-indicator/index.d.ts +2 -0
  72. package/dist/commonjs/status-indicator/index.d.ts.map +1 -0
  73. package/dist/commonjs/status-indicator/index.js +13 -0
  74. package/dist/commonjs/status-indicator/lib/StatusIndicator.d.ts +42 -0
  75. package/dist/commonjs/status-indicator/lib/StatusIndicator.d.ts.map +1 -0
  76. package/dist/commonjs/status-indicator/lib/StatusIndicator.js +55 -0
  77. package/dist/commonjs/status-indicator/lib/StatusIndicatorIcon.d.ts +73 -0
  78. package/dist/commonjs/status-indicator/lib/StatusIndicatorIcon.d.ts.map +1 -0
  79. package/dist/commonjs/status-indicator/lib/StatusIndicatorIcon.js +98 -0
  80. package/dist/commonjs/status-indicator/lib/StatusIndicatorLabel.d.ts +5 -0
  81. package/dist/commonjs/status-indicator/lib/StatusIndicatorLabel.d.ts.map +1 -0
  82. package/dist/commonjs/{breadcrumbs/lib/Breadcrumbs/List/index.js → status-indicator/lib/StatusIndicatorLabel.js} +6 -6
  83. package/dist/commonjs/status-indicator/lib/hooks/index.d.ts +2 -0
  84. package/dist/commonjs/status-indicator/lib/hooks/index.d.ts.map +1 -0
  85. package/dist/commonjs/status-indicator/lib/hooks/index.js +13 -0
  86. package/dist/commonjs/status-indicator/lib/hooks/useStatusIndicatorModel.d.ts +75 -0
  87. package/dist/commonjs/status-indicator/lib/hooks/useStatusIndicatorModel.d.ts.map +1 -0
  88. package/dist/commonjs/status-indicator/lib/hooks/useStatusIndicatorModel.js +34 -0
  89. package/dist/commonjs/text-area/lib/TextArea.d.ts +2 -11
  90. package/dist/commonjs/text-area/lib/TextArea.d.ts.map +1 -1
  91. package/dist/commonjs/text-area/lib/TextAreaField.d.ts +1 -1
  92. package/dist/commonjs/text-area/lib/TextAreaField.d.ts.map +1 -1
  93. package/dist/commonjs/text-area/lib/TextAreaField.js +15 -7
  94. package/dist/commonjs/text-input/lib/TextInput.d.ts +2 -11
  95. package/dist/commonjs/text-input/lib/TextInput.d.ts.map +1 -1
  96. package/dist/commonjs/text-input/lib/TextInputField.d.ts +1 -1
  97. package/dist/commonjs/text-input/lib/TextInputField.d.ts.map +1 -1
  98. package/dist/commonjs/text-input/lib/TextInputField.js +14 -7
  99. package/dist/es6/color-picker/index.d.ts +1 -1
  100. package/dist/es6/color-picker/index.d.ts.map +1 -1
  101. package/dist/es6/color-picker/index.js +1 -1
  102. package/dist/es6/color-picker/lib/ColorPicker.d.ts +1 -2
  103. package/dist/es6/color-picker/lib/ColorPicker.d.ts.map +1 -1
  104. package/dist/es6/color-picker/lib/ColorPicker.js +2 -3
  105. package/dist/es6/form-field/lib/FormField.d.ts +2 -11
  106. package/dist/es6/form-field/lib/FormField.d.ts.map +1 -1
  107. package/dist/es6/form-field/lib/FormFieldHint.d.ts +1 -1
  108. package/dist/es6/form-field/lib/FormFieldHint.d.ts.map +1 -1
  109. package/dist/es6/form-field/lib/FormFieldHint.js +4 -5
  110. package/dist/es6/form-field/lib/FormFieldInput.d.ts +1 -1
  111. package/dist/es6/form-field/lib/FormFieldLabel.d.ts.map +1 -1
  112. package/dist/es6/form-field/lib/FormFieldLabel.js +5 -11
  113. package/dist/es6/index.d.ts +2 -1
  114. package/dist/es6/index.d.ts.map +1 -1
  115. package/dist/es6/index.js +2 -2
  116. package/dist/es6/menu/index.d.ts +1 -4
  117. package/dist/es6/menu/index.d.ts.map +1 -1
  118. package/dist/es6/menu/index.js +1 -4
  119. package/dist/es6/menu/lib/Menu.d.ts +37 -13
  120. package/dist/es6/menu/lib/Menu.d.ts.map +1 -1
  121. package/dist/es6/menu/lib/Menu.js +42 -22
  122. package/dist/es6/menu/lib/MenuItem.d.ts +35 -14
  123. package/dist/es6/menu/lib/MenuItem.d.ts.map +1 -1
  124. package/dist/es6/menu/lib/MenuItem.js +23 -9
  125. package/dist/es6/pill/lib/Pill.d.ts +6 -16
  126. package/dist/es6/pill/lib/Pill.d.ts.map +1 -1
  127. package/dist/es6/pill/lib/PillAvatar.d.ts +1 -2
  128. package/dist/es6/pill/lib/PillAvatar.d.ts.map +1 -1
  129. package/dist/es6/pill/lib/PillIcon.d.ts +1 -2
  130. package/dist/es6/pill/lib/PillIcon.d.ts.map +1 -1
  131. package/dist/es6/pill/lib/PillIconButton.d.ts +1 -2
  132. package/dist/es6/pill/lib/PillIconButton.d.ts.map +1 -1
  133. package/dist/es6/pill/lib/PillLabel.d.ts +1 -2
  134. package/dist/es6/pill/lib/PillLabel.d.ts.map +1 -1
  135. package/dist/es6/pill/lib/usePillModel.d.ts +5 -5
  136. package/dist/es6/segmented-control/index.d.ts +3 -0
  137. package/dist/es6/segmented-control/index.d.ts.map +1 -0
  138. package/dist/es6/segmented-control/index.js +2 -0
  139. package/dist/es6/segmented-control/lib/SegmentedControl.d.ts +1004 -0
  140. package/dist/es6/segmented-control/lib/SegmentedControl.d.ts.map +1 -0
  141. package/dist/es6/segmented-control/lib/SegmentedControl.js +16 -0
  142. package/dist/es6/segmented-control/lib/SegmentedControlItem.d.ts +103 -0
  143. package/dist/es6/segmented-control/lib/SegmentedControlItem.d.ts.map +1 -0
  144. package/dist/es6/segmented-control/lib/SegmentedControlItem.js +108 -0
  145. package/dist/es6/segmented-control/lib/SegmentedControlList.d.ts +66 -0
  146. package/dist/es6/segmented-control/lib/SegmentedControlList.d.ts.map +1 -0
  147. package/dist/es6/segmented-control/lib/SegmentedControlList.js +44 -0
  148. package/dist/es6/segmented-control/lib/hooks/useSegmentedControlItem.d.ts +60 -0
  149. package/dist/es6/segmented-control/lib/hooks/useSegmentedControlItem.d.ts.map +1 -0
  150. package/dist/es6/segmented-control/lib/hooks/useSegmentedControlItem.js +20 -0
  151. package/dist/es6/segmented-control/lib/hooks/useSegmentedControlModel.d.ts +1052 -0
  152. package/dist/es6/segmented-control/lib/hooks/useSegmentedControlModel.d.ts.map +1 -0
  153. package/dist/es6/segmented-control/lib/hooks/useSegmentedControlModel.js +68 -0
  154. package/dist/es6/select/index.d.ts +0 -3
  155. package/dist/es6/select/index.d.ts.map +1 -1
  156. package/dist/es6/select/index.js +0 -3
  157. package/dist/es6/select/lib/Select.d.ts +0 -1
  158. package/dist/es6/select/lib/Select.d.ts.map +1 -1
  159. package/dist/es6/select/lib/Select.js +1 -2
  160. package/dist/es6/select/lib/SelectBase.d.ts +2 -2
  161. package/dist/es6/select/lib/SelectBase.d.ts.map +1 -1
  162. package/dist/es6/select/lib/SelectBase.js +3 -4
  163. package/dist/es6/select/lib/SelectMenu.d.ts +2 -2
  164. package/dist/es6/select/lib/SelectMenu.d.ts.map +1 -1
  165. package/dist/es6/select/lib/SelectMenu.js +1 -2
  166. package/dist/es6/select/lib/SelectOption.d.ts +1 -2
  167. package/dist/es6/select/lib/SelectOption.d.ts.map +1 -1
  168. package/dist/es6/select/lib/SelectOption.js +1 -2
  169. package/dist/es6/side-panel/index.d.ts +0 -3
  170. package/dist/es6/side-panel/index.d.ts.map +1 -1
  171. package/dist/es6/side-panel/index.js +0 -3
  172. package/dist/es6/side-panel/lib/SidePanel.d.ts +1 -2
  173. package/dist/es6/side-panel/lib/SidePanel.d.ts.map +1 -1
  174. package/dist/es6/side-panel/lib/SidePanel.js +1 -2
  175. package/dist/es6/status-indicator/index.d.ts +2 -0
  176. package/dist/es6/status-indicator/index.d.ts.map +1 -0
  177. package/dist/es6/status-indicator/index.js +1 -0
  178. package/dist/es6/status-indicator/lib/StatusIndicator.d.ts +42 -0
  179. package/dist/es6/status-indicator/lib/StatusIndicator.d.ts.map +1 -0
  180. package/dist/es6/status-indicator/lib/StatusIndicator.js +49 -0
  181. package/dist/es6/status-indicator/lib/StatusIndicatorIcon.d.ts +73 -0
  182. package/dist/es6/status-indicator/lib/StatusIndicatorIcon.d.ts.map +1 -0
  183. package/dist/es6/status-indicator/lib/StatusIndicatorIcon.js +92 -0
  184. package/dist/es6/status-indicator/lib/StatusIndicatorLabel.d.ts +5 -0
  185. package/dist/es6/status-indicator/lib/StatusIndicatorLabel.d.ts.map +1 -0
  186. package/dist/es6/{breadcrumbs/lib/Breadcrumbs/List/index.js → status-indicator/lib/StatusIndicatorLabel.js} +5 -5
  187. package/dist/es6/status-indicator/lib/hooks/index.d.ts +2 -0
  188. package/dist/es6/status-indicator/lib/hooks/index.d.ts.map +1 -0
  189. package/dist/es6/status-indicator/lib/hooks/index.js +1 -0
  190. package/dist/es6/status-indicator/lib/hooks/useStatusIndicatorModel.d.ts +75 -0
  191. package/dist/es6/status-indicator/lib/hooks/useStatusIndicatorModel.d.ts.map +1 -0
  192. package/dist/es6/status-indicator/lib/hooks/useStatusIndicatorModel.js +31 -0
  193. package/dist/es6/text-area/lib/TextArea.d.ts +2 -11
  194. package/dist/es6/text-area/lib/TextArea.d.ts.map +1 -1
  195. package/dist/es6/text-area/lib/TextAreaField.d.ts +1 -1
  196. package/dist/es6/text-area/lib/TextAreaField.d.ts.map +1 -1
  197. package/dist/es6/text-area/lib/TextAreaField.js +15 -7
  198. package/dist/es6/text-input/lib/TextInput.d.ts +2 -11
  199. package/dist/es6/text-input/lib/TextInput.d.ts.map +1 -1
  200. package/dist/es6/text-input/lib/TextInputField.d.ts +1 -1
  201. package/dist/es6/text-input/lib/TextInputField.d.ts.map +1 -1
  202. package/dist/es6/text-input/lib/TextInputField.js +14 -7
  203. package/form-field/lib/FormFieldHint.tsx +23 -30
  204. package/form-field/lib/FormFieldLabel.tsx +14 -24
  205. package/index.ts +2 -3
  206. package/menu/index.ts +1 -6
  207. package/menu/lib/Menu.tsx +74 -27
  208. package/menu/lib/MenuItem.tsx +51 -18
  209. package/package.json +7 -6
  210. package/segmented-control/LICENSE +126 -0
  211. package/segmented-control/README.md +6 -0
  212. package/segmented-control/index.ts +2 -0
  213. package/segmented-control/lib/SegmentedControl.tsx +21 -0
  214. package/segmented-control/lib/SegmentedControlItem.tsx +175 -0
  215. package/segmented-control/lib/SegmentedControlList.tsx +49 -0
  216. package/segmented-control/lib/hooks/useSegmentedControlItem.tsx +37 -0
  217. package/segmented-control/lib/hooks/useSegmentedControlModel.tsx +75 -0
  218. package/segmented-control/package.json +6 -0
  219. package/select/README.md +7 -7
  220. package/select/index.ts +0 -4
  221. package/select/lib/Select.tsx +1 -3
  222. package/select/lib/SelectBase.tsx +3 -5
  223. package/select/lib/SelectMenu.tsx +1 -3
  224. package/select/lib/SelectOption.tsx +1 -3
  225. package/side-panel/index.ts +0 -4
  226. package/side-panel/lib/SidePanel.tsx +1 -2
  227. package/{breadcrumbs → status-indicator}/LICENSE +1 -1
  228. package/status-indicator/README.md +12 -0
  229. package/status-indicator/index.ts +1 -0
  230. package/status-indicator/lib/StatusIndicator.tsx +49 -0
  231. package/status-indicator/lib/StatusIndicatorIcon.tsx +88 -0
  232. package/status-indicator/lib/StatusIndicatorLabel.tsx +28 -0
  233. package/status-indicator/lib/hooks/index.ts +1 -0
  234. package/status-indicator/lib/hooks/useStatusIndicatorModel.tsx +29 -0
  235. package/status-indicator/package.json +6 -0
  236. package/text-area/lib/TextAreaField.tsx +1 -1
  237. package/text-input/lib/TextInputField.tsx +1 -1
  238. package/breadcrumbs/README.md +0 -7
  239. package/breadcrumbs/index.ts +0 -5
  240. package/breadcrumbs/lib/Breadcrumbs/Dropdown/Button.tsx +0 -85
  241. package/breadcrumbs/lib/Breadcrumbs/Dropdown/Menu.tsx +0 -152
  242. package/breadcrumbs/lib/Breadcrumbs/Dropdown/MenuItemLink.tsx +0 -63
  243. package/breadcrumbs/lib/Breadcrumbs/Dropdown/hooks.ts +0 -109
  244. package/breadcrumbs/lib/Breadcrumbs/Dropdown/index.tsx +0 -38
  245. package/breadcrumbs/lib/Breadcrumbs/List/Collapsible.tsx +0 -66
  246. package/breadcrumbs/lib/Breadcrumbs/List/CurrentItem.tsx +0 -64
  247. package/breadcrumbs/lib/Breadcrumbs/List/Link.tsx +0 -88
  248. package/breadcrumbs/lib/Breadcrumbs/List/ListItem.tsx +0 -30
  249. package/breadcrumbs/lib/Breadcrumbs/List/hooks.ts +0 -114
  250. package/breadcrumbs/lib/Breadcrumbs/List/index.tsx +0 -28
  251. package/breadcrumbs/lib/Breadcrumbs/List/styles.ts +0 -12
  252. package/breadcrumbs/lib/Breadcrumbs/Nav.tsx +0 -14
  253. package/breadcrumbs/lib/Breadcrumbs/hooks.ts +0 -13
  254. package/breadcrumbs/lib/Breadcrumbs/index.tsx +0 -15
  255. package/breadcrumbs/lib/Breadcrumbs/types.ts +0 -7
  256. package/breadcrumbs/package.json +0 -6
  257. package/dist/commonjs/breadcrumbs/index.d.ts +0 -5
  258. package/dist/commonjs/breadcrumbs/index.d.ts.map +0 -1
  259. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/Button.d.ts +0 -20
  260. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/Button.d.ts.map +0 -1
  261. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/Button.js +0 -69
  262. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/Menu.d.ts +0 -38
  263. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/Menu.d.ts.map +0 -1
  264. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/Menu.js +0 -94
  265. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/MenuItemLink.d.ts +0 -14
  266. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/MenuItemLink.d.ts.map +0 -1
  267. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/hooks.d.ts +0 -13
  268. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/hooks.d.ts.map +0 -1
  269. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/hooks.js +0 -77
  270. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/index.d.ts +0 -8
  271. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/index.d.ts.map +0 -1
  272. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/index.js +0 -37
  273. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/Collapsible.d.ts +0 -16
  274. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/Collapsible.d.ts.map +0 -1
  275. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/Collapsible.js +0 -78
  276. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/CurrentItem.d.ts +0 -11
  277. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/CurrentItem.d.ts.map +0 -1
  278. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/CurrentItem.js +0 -49
  279. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/Link.d.ts +0 -19
  280. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/Link.d.ts.map +0 -1
  281. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/Link.js +0 -66
  282. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/ListItem.d.ts +0 -4
  283. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/ListItem.d.ts.map +0 -1
  284. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/ListItem.js +0 -43
  285. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/hooks.d.ts +0 -19
  286. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/hooks.d.ts.map +0 -1
  287. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/hooks.js +0 -116
  288. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/index.d.ts +0 -4
  289. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/index.d.ts.map +0 -1
  290. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/styles.d.ts +0 -3
  291. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/styles.d.ts.map +0 -1
  292. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/styles.js +0 -16
  293. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Nav.d.ts +0 -11
  294. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Nav.d.ts.map +0 -1
  295. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Nav.js +0 -34
  296. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/hooks.d.ts +0 -5
  297. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/hooks.d.ts.map +0 -1
  298. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/hooks.js +0 -12
  299. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/index.d.ts +0 -9
  300. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/index.d.ts.map +0 -1
  301. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/index.js +0 -17
  302. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/types.d.ts +0 -8
  303. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/types.d.ts.map +0 -1
  304. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/types.js +0 -2
  305. package/dist/es6/breadcrumbs/index.d.ts +0 -5
  306. package/dist/es6/breadcrumbs/index.d.ts.map +0 -1
  307. package/dist/es6/breadcrumbs/index.js +0 -4
  308. package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/Button.d.ts +0 -20
  309. package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/Button.d.ts.map +0 -1
  310. package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/Button.js +0 -63
  311. package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/Menu.d.ts +0 -38
  312. package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/Menu.d.ts.map +0 -1
  313. package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/Menu.js +0 -87
  314. package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/MenuItemLink.d.ts +0 -14
  315. package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/MenuItemLink.d.ts.map +0 -1
  316. package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/MenuItemLink.js +0 -51
  317. package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/hooks.d.ts +0 -13
  318. package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/hooks.d.ts.map +0 -1
  319. package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/hooks.js +0 -72
  320. package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/index.d.ts +0 -8
  321. package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/index.d.ts.map +0 -1
  322. package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/index.js +0 -30
  323. package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/Collapsible.d.ts +0 -16
  324. package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/Collapsible.d.ts.map +0 -1
  325. package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/Collapsible.js +0 -55
  326. package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/CurrentItem.d.ts +0 -11
  327. package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/CurrentItem.d.ts.map +0 -1
  328. package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/CurrentItem.js +0 -42
  329. package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/Link.d.ts +0 -19
  330. package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/Link.d.ts.map +0 -1
  331. package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/Link.js +0 -59
  332. package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/ListItem.d.ts +0 -4
  333. package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/ListItem.d.ts.map +0 -1
  334. package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/ListItem.js +0 -36
  335. package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/hooks.d.ts +0 -19
  336. package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/hooks.d.ts.map +0 -1
  337. package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/hooks.js +0 -91
  338. package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/index.d.ts +0 -4
  339. package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/index.d.ts.map +0 -1
  340. package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/styles.d.ts +0 -3
  341. package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/styles.d.ts.map +0 -1
  342. package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/styles.js +0 -12
  343. package/dist/es6/breadcrumbs/lib/Breadcrumbs/Nav.d.ts +0 -11
  344. package/dist/es6/breadcrumbs/lib/Breadcrumbs/Nav.d.ts.map +0 -1
  345. package/dist/es6/breadcrumbs/lib/Breadcrumbs/Nav.js +0 -27
  346. package/dist/es6/breadcrumbs/lib/Breadcrumbs/hooks.d.ts +0 -5
  347. package/dist/es6/breadcrumbs/lib/Breadcrumbs/hooks.d.ts.map +0 -1
  348. package/dist/es6/breadcrumbs/lib/Breadcrumbs/hooks.js +0 -8
  349. package/dist/es6/breadcrumbs/lib/Breadcrumbs/index.d.ts +0 -9
  350. package/dist/es6/breadcrumbs/lib/Breadcrumbs/index.d.ts.map +0 -1
  351. package/dist/es6/breadcrumbs/lib/Breadcrumbs/index.js +0 -14
  352. package/dist/es6/breadcrumbs/lib/Breadcrumbs/types.d.ts +0 -8
  353. package/dist/es6/breadcrumbs/lib/Breadcrumbs/types.d.ts.map +0 -1
  354. package/dist/es6/breadcrumbs/lib/Breadcrumbs/types.js +0 -1
@@ -0,0 +1,175 @@
1
+ import * as React from 'react';
2
+
3
+ import {colors, type, space} from '@workday/canvas-kit-react/tokens';
4
+ import {createSubcomponent, useIsRTL} from '@workday/canvas-kit-react/common';
5
+ import {Tooltip, TooltipProps} from '@workday/canvas-kit-react/tooltip';
6
+ import {
7
+ BaseButton,
8
+ ButtonContainerProps,
9
+ ButtonColors,
10
+ ButtonSizes,
11
+ getMinWidthStyles,
12
+ } from '@workday/canvas-kit-react/button';
13
+ import {CanvasSystemIcon} from '@workday/design-assets-types';
14
+ import {useSegmentedControlModel} from './hooks/useSegmentedControlModel';
15
+ import {Text} from '@workday/canvas-kit-react/text';
16
+ import {useSegmentedControlItem} from './hooks/useSegmentedControlItem';
17
+
18
+ export interface ItemProps extends ButtonContainerProps {
19
+ /**
20
+ * Optionally pass index to the item. This should be done if `SegmentedControl.Item` components were created
21
+ * via a `[Array::map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)` function. This index will ensure keyboard navigation works even if items are
22
+ * inserted out of order.
23
+ */
24
+ index?: number;
25
+ /**
26
+ * The contents of the item. This is text used as the accessible name of the button for screen readers.
27
+ */
28
+ children?: React.ReactNode;
29
+ /**
30
+ * The identifier of the item. This identifier will be used in change events and for `initialTab`.
31
+ * If this property is not provided, it will default to a string representation
32
+ * of the the zero-based index of the item when it was initialized.
33
+ */
34
+ 'data-id'?: string;
35
+ /**
36
+ * Optional id. If not set, it will inherit the ID passed to the `SegmentedControl` component and append the
37
+ * index at the end. Only set this for advanced cases.
38
+ */
39
+ id?: string;
40
+ /**
41
+ * Part of the ARIA specification for buttons. Lets screen readers know which button is active. This
42
+ * should either be `true` or `false`. This is automatically set by the
43
+ * component and should only be used in advanced cases.
44
+ */
45
+ 'aria-pressed'?: boolean;
46
+ /**
47
+ * The icon of the button.
48
+ */
49
+ icon?: CanvasSystemIcon;
50
+ /**
51
+ * Tooltip Props
52
+ */
53
+ tooltipProps?: Omit<TooltipProps, 'children'>;
54
+ }
55
+
56
+ const getButtonSize = (size: ButtonContainerProps['size']) => {
57
+ switch (size) {
58
+ case 'large':
59
+ return 'medium';
60
+ case 'medium':
61
+ return 'small';
62
+ case 'small':
63
+ return 'extraSmall';
64
+ default:
65
+ return 'medium';
66
+ }
67
+ };
68
+
69
+ const getIconButtonColors = (toggled?: boolean): ButtonColors => {
70
+ return {
71
+ default: {
72
+ background: toggled ? colors.frenchVanilla100 : colors.soap200,
73
+ border: toggled ? colors.licorice200 : 'transparent',
74
+ icon: toggled ? colors.blackPepper400 : colors.licorice400,
75
+ label: toggled ? colors.blackPepper400 : colors.licorice400,
76
+ },
77
+ hover: {
78
+ background: toggled ? colors.frenchVanilla100 : colors.soap400,
79
+ icon: colors.licorice400,
80
+ label: colors.licorice400,
81
+ },
82
+ active: {
83
+ background: toggled ? colors.frenchVanilla100 : colors.soap400,
84
+ icon: colors.licorice400,
85
+ label: colors.licorice400,
86
+ },
87
+ focus: {},
88
+ disabled: {
89
+ background: colors.soap200,
90
+ opacity: '1',
91
+ },
92
+ };
93
+ };
94
+
95
+ const getPaddingStyles = (
96
+ children: React.ReactNode,
97
+ size: ButtonContainerProps['size'],
98
+ icon: CanvasSystemIcon | undefined
99
+ ) => {
100
+ if (!children) {
101
+ return 0;
102
+ }
103
+
104
+ switch (size) {
105
+ case 'large':
106
+ return icon ? `0 ${space.m} 0 20px` : `0 ${space.m}`;
107
+
108
+ case 'medium':
109
+ return icon ? `0 20px 0 ${space.s}` : `0 ${space.s}`;
110
+
111
+ case 'small':
112
+ return icon ? `0 ${space.xs} 0 ${space.xxs}` : `0 ${space.xs}`;
113
+
114
+ default:
115
+ return icon ? `0 20px 0 ${space.s}` : `0 ${space.s}`;
116
+ }
117
+ };
118
+
119
+ const geButtonStyles = (size: ButtonSizes, children: React.ReactNode, icon?: CanvasSystemIcon) => {
120
+ const buttonSize = getButtonSize(size);
121
+ const minWidthValue = getMinWidthStyles(children, children ? size : buttonSize);
122
+
123
+ return {
124
+ height: getMinWidthStyles(false, buttonSize),
125
+ minWidth: minWidthValue,
126
+ padding: getPaddingStyles(children, size, icon),
127
+ };
128
+ };
129
+
130
+ const Container = ({
131
+ tooltipProps,
132
+ children,
133
+ }: {
134
+ tooltipProps?: Omit<TooltipProps, 'children'>;
135
+ children: React.ReactElement;
136
+ }) => {
137
+ return tooltipProps ? (
138
+ <Tooltip {...tooltipProps}>{children}</Tooltip>
139
+ ) : (
140
+ <React.Fragment>{children}</React.Fragment>
141
+ );
142
+ };
143
+
144
+ export const SegmentedControlItem = createSubcomponent('button')({
145
+ displayName: 'SegmentedControl.Item',
146
+ modelHook: useSegmentedControlModel,
147
+ elemPropsHook: useSegmentedControlItem,
148
+ })<ItemProps>(({children, icon, tooltipProps, ...elemProps}, Element, {state: {size}}) => {
149
+ const {color, ...textStyles} = type.levels.subtext[size === 'small' ? 'medium' : 'large'];
150
+
151
+ return (
152
+ <Container tooltipProps={tooltipProps}>
153
+ <BaseButton
154
+ as={Element}
155
+ borderRadius="m"
156
+ colors={getIconButtonColors(elemProps['aria-pressed'])}
157
+ {...geButtonStyles(size, children, icon)}
158
+ {...elemProps}
159
+ >
160
+ {icon && (
161
+ <BaseButton.Icon
162
+ size={size === 'small' ? 'extraSmall' : 'medium'}
163
+ icon={icon}
164
+ shouldMirrorIcon={useIsRTL()}
165
+ />
166
+ )}
167
+ {children && (
168
+ <Text {...textStyles} fontWeight="bold" textAlign="left">
169
+ {children}
170
+ </Text>
171
+ )}
172
+ </BaseButton>
173
+ </Container>
174
+ );
175
+ });
@@ -0,0 +1,49 @@
1
+ import * as React from 'react';
2
+
3
+ import {
4
+ createSubcomponent,
5
+ ExtractProps,
6
+ createElemPropsHook,
7
+ } from '@workday/canvas-kit-react/common';
8
+ import {Grid} from '@workday/canvas-kit-react/layout';
9
+ import {useListRenderItems} from '@workday/canvas-kit-react/collection';
10
+ import {useSegmentedControlModel} from './hooks/useSegmentedControlModel';
11
+
12
+ export interface SegmentedControlListProps<T = any>
13
+ extends Omit<Partial<ExtractProps<typeof Grid, never>>, 'children'> {
14
+ 'aria-label': string;
15
+ children: ((item: T) => React.ReactNode) | React.ReactNode;
16
+ }
17
+
18
+ const useSegmentedControlList = createElemPropsHook(useSegmentedControlModel)(
19
+ ({state: {orientation, disabled, items}}) => {
20
+ const directionName = orientation === 'vertical' ? 'Row' : 'Column';
21
+ return {
22
+ [`gridTemplate${directionName}s`]: `repeat(${items.length}, 1fr)`,
23
+ opacity: disabled ? 0.4 : undefined,
24
+ };
25
+ }
26
+ );
27
+
28
+ export const SegmentedControlList = createSubcomponent('div')({
29
+ displayName: 'SegmentedControl.List',
30
+ modelHook: useSegmentedControlModel,
31
+ elemPropsHook: useSegmentedControlList,
32
+ })<SegmentedControlListProps>(({children, ...elemProps}, Element, model) => {
33
+ return (
34
+ <Grid
35
+ as={Element}
36
+ display="inline-grid"
37
+ role="group"
38
+ backgroundColor="soap200"
39
+ border="1px solid transparent"
40
+ borderColor="licorice200"
41
+ borderRadius="l"
42
+ padding="3px"
43
+ gridGap="xxs"
44
+ {...elemProps}
45
+ >
46
+ {useListRenderItems(model, children)}
47
+ </Grid>
48
+ );
49
+ });
@@ -0,0 +1,37 @@
1
+ import * as React from 'react';
2
+
3
+ import {createElemPropsHook, composeHooks} from '@workday/canvas-kit-react/common';
4
+ import {
5
+ useListItemRegister,
6
+ isSelected,
7
+ useListItemSelect,
8
+ } from '@workday/canvas-kit-react/collection';
9
+ import {useSegmentedControlModel} from './useSegmentedControlModel';
10
+
11
+ export const useSegmentedControlItem = composeHooks(
12
+ useListItemSelect,
13
+ createElemPropsHook(useSegmentedControlModel)(
14
+ (
15
+ model,
16
+ _?: React.Ref<HTMLElement>,
17
+ elemProps: {'data-id'?: string; children?: React.ReactNode} = {}
18
+ ) => {
19
+ const name = elemProps['data-id'] || '';
20
+ const selected = !!name && isSelected(name, model.state);
21
+
22
+ return {
23
+ id: `${model.state.id}-${name}`,
24
+ 'aria-pressed': selected,
25
+ };
26
+ }
27
+ ),
28
+ useListItemRegister,
29
+ createElemPropsHook(useSegmentedControlModel)(({state}) => {
30
+ return {
31
+ // override the default disabled functionality of `useListItemRegister`
32
+ // it shouldn't allow to set disabled state only for one button
33
+ // state prop will disable the whole container
34
+ disabled: state.disabled ? true : undefined,
35
+ };
36
+ })
37
+ );
@@ -0,0 +1,75 @@
1
+ import React from 'react';
2
+ import {createModelHook} from '@workday/canvas-kit-react/common';
3
+ import {defaultGetId, useListModel} from '@workday/canvas-kit-react/collection';
4
+
5
+ export const useSegmentedControlModel = createModelHook({
6
+ defaultConfig: {
7
+ ...useListModel.defaultConfig,
8
+ /**
9
+ * Optional id for the whole `SegmentedControl` group. If not provided, a unique id will be created.
10
+ * @default useUniqueId()
11
+ */
12
+ id: '',
13
+ /**
14
+ * An initially selected value. This value must match the `data-id` of the `SegmentedControl.Item` component.
15
+ * If not provided, the first value will be selected.
16
+ */
17
+ initialValue: '',
18
+ /**
19
+ * Sets disabled state for all segmented control buttons
20
+ * @default false
21
+ */
22
+ disabled: false,
23
+ /**
24
+ * Sets the size of the segmented control container and its buttons. Can be `small`, `medium` or `large`.
25
+ * @default 'medium'
26
+ */
27
+ size: 'medium' as 'small' | 'medium' | 'large',
28
+ /**
29
+ * The SegmentedControl can rendered in a horizontal or vertical orientation.
30
+ * We suggest to use the `vertical` orientation only for icon only variant.
31
+ * @default 'horizontal'
32
+ */
33
+ orientation: 'horizontal' as typeof useListModel.defaultConfig.orientation,
34
+ },
35
+ requiredConfig: useListModel.requiredConfig,
36
+ })(config => {
37
+ const getId = config.getId || defaultGetId;
38
+ const initialSelectedRef = React.useRef(config.initialValue);
39
+ const items = config.items;
40
+
41
+ const model = useListModel(
42
+ useListModel.mergeConfig(config, {
43
+ orientation: config.orientation || 'horizontal',
44
+ items,
45
+ onRegisterItem(data) {
46
+ if (!initialSelectedRef.current) {
47
+ initialSelectedRef.current = getId(data.item);
48
+ events.select({id: initialSelectedRef.current});
49
+ }
50
+ },
51
+ initialSelectedIds: config.initialValue
52
+ ? [config.initialValue]
53
+ : config.items?.length
54
+ ? [getId(config.items![0])]
55
+ : [],
56
+ shouldVirtualize: false,
57
+ })
58
+ );
59
+
60
+ const state = {
61
+ ...model.state,
62
+ disabled: config.disabled,
63
+ size: config.size,
64
+ };
65
+
66
+ const events = {
67
+ ...model.events,
68
+ };
69
+
70
+ return {
71
+ ...model,
72
+ state,
73
+ events,
74
+ };
75
+ });
@@ -0,0 +1,6 @@
1
+ {
2
+ "main": "../dist/commonjs/segmented-control",
3
+ "module": "../dist/es6/segmented-control",
4
+ "sideEffects": false,
5
+ "types": "../dist/es6/segmented-control"
6
+ }
package/select/README.md CHANGED
@@ -34,7 +34,7 @@ fully accessible (see below).
34
34
 
35
35
  ```tsx
36
36
  import * as React from 'react';
37
- import Select from '@workday/canvas-kit-preview-react/select';
37
+ import {Select} from '@workday/canvas-kit-preview-react/select';
38
38
 
39
39
  function Example() {
40
40
  const options = [
@@ -58,8 +58,8 @@ function Example() {
58
58
 
59
59
  ```tsx
60
60
  import * as React from 'react';
61
- import Select from '@workday/canvas-kit-preview-react/select';
62
- import FormField from '@workday/canvas-kit-react/form-field';
61
+ import {Select} from '@workday/canvas-kit-preview-react/select';
62
+ import {FormField} from '@workday/canvas-kit-react/form-field';
63
63
 
64
64
  function Example() {
65
65
  const options = [
@@ -89,8 +89,8 @@ function Example() {
89
89
 
90
90
  ```tsx
91
91
  import * as React from 'react';
92
- import Select from '@workday/canvas-kit-preview-react/select';
93
- import FormField from '@workday/canvas-kit-react/form-field';
92
+ import {Select} from '@workday/canvas-kit-preview-react/select';
93
+ import {FormField} from '@workday/canvas-kit-react/form-field';
94
94
 
95
95
  function Example() {
96
96
  const options = ['California', 'Florida', 'New York', 'Pennsylvania', 'Texas'];
@@ -117,8 +117,8 @@ used to customize how each option is rendered.
117
117
 
118
118
  ```tsx
119
119
  import * as React from 'react';
120
- import Select from '@workday/canvas-kit-preview-react/select';
121
- import FormField from '@workday/canvas-kit-react/form-field';
120
+ import {Select} from '@workday/canvas-kit-preview-react/select';
121
+ import {FormField} from '@workday/canvas-kit-react/form-field';
122
122
  import {colors, typeColors} from '@workday/canvas-kit-react/tokens';
123
123
  import {
124
124
  activityStreamIcon,
package/select/index.ts CHANGED
@@ -1,7 +1,3 @@
1
- import Select from './lib/Select';
2
-
3
- export default Select;
4
- export {Select};
5
1
  export * from './lib/Select';
6
2
 
7
3
  export {
@@ -7,7 +7,7 @@ import {
7
7
  generateUniqueId,
8
8
  } from '@workday/canvas-kit-react/common';
9
9
  import {menuAnimationDuration} from './SelectMenu';
10
- import SelectBase, {CoreSelectBaseProps, Option, NormalizedOption} from './SelectBase';
10
+ import {SelectBase, CoreSelectBaseProps, Option, NormalizedOption} from './SelectBase';
11
11
  import {MenuVisibility} from './types';
12
12
  import {getCorrectedIndexByValue} from './utils';
13
13
 
@@ -587,5 +587,3 @@ export const Select = createComponent('button')({
587
587
  ErrorType,
588
588
  },
589
589
  });
590
-
591
- export default Select;
@@ -20,8 +20,8 @@ import {
20
20
  import {caretDownSmallIcon} from '@workday/canvas-system-icons-web';
21
21
  import {SystemIcon} from '@workday/canvas-kit-react/icon';
22
22
 
23
- import SelectMenu from './SelectMenu';
24
- import SelectOption from './SelectOption';
23
+ import {SelectMenu} from './SelectMenu';
24
+ import {SelectOption} from './SelectOption';
25
25
  import {scrollIntoViewIfNeeded} from './scrolling';
26
26
  import {MenuPlacement, MenuVisibility} from './types';
27
27
  import {getCorrectedIndexByValue} from './utils';
@@ -288,7 +288,7 @@ const defaultRenderSelected: RenderSelectedFunction = option => {
288
288
  return option.label;
289
289
  };
290
290
 
291
- const SelectBase = ({
291
+ export const SelectBase = ({
292
292
  'aria-labelledby': ariaLabelledBy,
293
293
  'aria-required': ariaRequired,
294
294
  as,
@@ -475,5 +475,3 @@ const SelectBase = ({
475
475
  </SelectWrapper>
476
476
  );
477
477
  };
478
-
479
- export default SelectBase;
@@ -223,7 +223,7 @@ const generatePopperOptions = (
223
223
  };
224
224
  };
225
225
 
226
- const SelectMenu = ({
226
+ export const SelectMenu = ({
227
227
  buttonRef,
228
228
  children,
229
229
  error,
@@ -294,5 +294,3 @@ const SelectMenu = ({
294
294
  </Popper>
295
295
  );
296
296
  };
297
-
298
- export default SelectMenu;
@@ -105,7 +105,7 @@ const Option = styled('li')<SelectOptionProps>(
105
105
  })
106
106
  );
107
107
 
108
- const SelectOption = ({
108
+ export const SelectOption = ({
109
109
  children,
110
110
  focused = false,
111
111
  interactive = true,
@@ -126,5 +126,3 @@ const SelectOption = ({
126
126
  </Option>
127
127
  );
128
128
  };
129
-
130
- export default SelectOption;
@@ -1,6 +1,2 @@
1
- import SidePanel from './lib/SidePanel';
2
-
3
- export default SidePanel;
4
- export {SidePanel};
5
1
  export * from './lib/hooks';
6
2
  export * from './lib/SidePanel';
@@ -110,7 +110,7 @@ export const SidePanelContext = React.createContext({
110
110
  origin: 'left',
111
111
  });
112
112
 
113
- const SidePanel = ({
113
+ export const SidePanel = ({
114
114
  as = 'section',
115
115
  children,
116
116
  collapsedWidth = 64,
@@ -267,4 +267,3 @@ const ToggleButton = ({
267
267
  };
268
268
 
269
269
  SidePanel.ToggleButton = ToggleButton;
270
- export default SidePanel;
@@ -43,7 +43,7 @@ While redistributing the Work or Derivative Works thereof, You may choose to off
43
43
 
44
44
  END OF TERMS AND CONDITIONS
45
45
 
46
- ©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders.
46
+ ©2021 Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders.
47
47
 
48
48
 
49
49
  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
@@ -0,0 +1,12 @@
1
+ # Canvas Kit Status Indicator
2
+
3
+ <a href="https://github.com/Workday/canvas-kit/tree/master/modules/preview-react/README.md">
4
+ <img src="https://img.shields.io/badge/PREVIEW-beta-blueviolet" alt="PREVIEW: Beta" />
5
+ </a> This component is work in progress and currently in preview.
6
+
7
+ Status Indicators help the user quickly identify the status of a task, action, or page element.
8
+
9
+ View the
10
+ [documentation for Status Indicator](https://workday.github.io/canvas-kit/?path=/docs/preview-status-indicator-react--basic)
11
+ on Storybook.
12
+
@@ -0,0 +1 @@
1
+ export * from './lib/StatusIndicator';
@@ -0,0 +1,49 @@
1
+ import React from 'react';
2
+
3
+ import {ExtractProps, createContainer, createElemPropsHook} from '@workday/canvas-kit-react/common';
4
+ import {HStack} from '@workday/canvas-kit-react/layout';
5
+ import {StatusIndicatorIcon, statusIndicatorColors} from './StatusIndicatorIcon';
6
+ import {StatusIndicatorLabel} from './StatusIndicatorLabel';
7
+ import {useStatusIndicatorModel} from './hooks';
8
+
9
+ export interface StatusIndicatorProps extends Partial<ExtractProps<typeof HStack, never>> {
10
+ /**
11
+ * Children of the `StatusIndicator`. Can contain a `StatusIndicator.Label` and optionally a `StatusIndicator.Icon`.
12
+ */
13
+ children: React.ReactNode;
14
+ }
15
+
16
+ export const useStatusIndicator = createElemPropsHook(useStatusIndicatorModel)(({state}) => {
17
+ const colors = statusIndicatorColors[state.variant][state.emphasis];
18
+ return {
19
+ opacity: state.variant === 'transparent' ? '0.85' : undefined,
20
+ color: colors.text,
21
+ background: colors.background,
22
+ };
23
+ });
24
+
25
+ export const StatusIndicator = createContainer('div')({
26
+ displayName: 'StatusIndicator',
27
+ modelHook: useStatusIndicatorModel,
28
+ elemPropsHook: useStatusIndicator,
29
+ subComponents: {
30
+ Icon: StatusIndicatorIcon,
31
+ Label: StatusIndicatorLabel,
32
+ },
33
+ })<StatusIndicatorProps>(({children, ...elemProps}, Element, model) => {
34
+ return (
35
+ <HStack
36
+ spacing={4}
37
+ as={Element}
38
+ maxWidth={200}
39
+ paddingX="xxxs"
40
+ display="inline-flex"
41
+ alignItems="center"
42
+ height={20}
43
+ borderRadius="s"
44
+ {...elemProps}
45
+ >
46
+ {children}
47
+ </HStack>
48
+ );
49
+ });
@@ -0,0 +1,88 @@
1
+ import React from 'react';
2
+
3
+ import {createElemPropsHook, createSubcomponent} from '@workday/canvas-kit-react/common';
4
+
5
+ import {SystemIcon, SystemIconProps} from '@workday/canvas-kit-react/icon';
6
+ import {useStatusIndicatorModel} from './hooks';
7
+
8
+ export interface StatusIndicatorIconProps extends SystemIconProps {}
9
+
10
+ import {colors} from '@workday/canvas-kit-react/tokens';
11
+
12
+ export const statusIndicatorColors = {
13
+ gray: {
14
+ high: {
15
+ text: colors.frenchVanilla100,
16
+ background: colors.licorice300,
17
+ },
18
+ low: {
19
+ text: colors.licorice400,
20
+ background: colors.soap300,
21
+ },
22
+ },
23
+ orange: {
24
+ high: {
25
+ text: colors.licorice500,
26
+ background: colors.cantaloupe400,
27
+ },
28
+ low: {
29
+ text: colors.toastedMarshmallow600,
30
+ background: colors.cantaloupe100,
31
+ },
32
+ },
33
+ blue: {
34
+ high: {
35
+ text: colors.frenchVanilla100,
36
+ background: colors.blueberry400,
37
+ },
38
+ low: {
39
+ text: colors.blueberry500,
40
+ background: colors.blueberry100,
41
+ },
42
+ },
43
+ green: {
44
+ high: {
45
+ text: colors.frenchVanilla100,
46
+ background: colors.greenApple600,
47
+ },
48
+ low: {
49
+ text: colors.greenApple600,
50
+ background: colors.greenApple100,
51
+ },
52
+ },
53
+ red: {
54
+ high: {
55
+ text: colors.frenchVanilla100,
56
+ background: colors.cinnamon500,
57
+ },
58
+ low: {
59
+ text: colors.cinnamon600,
60
+ background: colors.cinnamon100,
61
+ },
62
+ },
63
+ transparent: {
64
+ high: {
65
+ text: colors.frenchVanilla100,
66
+ background: colors.blackPepper600,
67
+ },
68
+ low: {
69
+ text: colors.frenchVanilla100,
70
+ background: colors.blackPepper600,
71
+ },
72
+ },
73
+ };
74
+
75
+ const useStatusIndicatorIcon = createElemPropsHook(useStatusIndicatorModel)(({state}) => {
76
+ const colors = statusIndicatorColors[state.variant][state.emphasis];
77
+ return {
78
+ color: colors.text,
79
+ colorHover: colors.background,
80
+ };
81
+ });
82
+
83
+ export const StatusIndicatorIcon = createSubcomponent('span')({
84
+ modelHook: useStatusIndicatorModel,
85
+ elemPropsHook: useStatusIndicatorIcon,
86
+ })<StatusIndicatorIconProps>((elemProps, Element, model) => {
87
+ return <SystemIcon as={Element} size={20} role="img" {...elemProps} />;
88
+ });
@@ -0,0 +1,28 @@
1
+ import React from 'react';
2
+
3
+ import {createComponent} from '@workday/canvas-kit-react/common';
4
+ import {Text, TextProps} from '@workday/canvas-kit-react/text';
5
+
6
+ export interface StatusIndicatorLabelProps extends TextProps {}
7
+
8
+ export const StatusIndicatorLabel = createComponent('span')({
9
+ displayName: 'StatusIndicator.Label',
10
+ Component: ({children, ...elemProps}: StatusIndicatorLabelProps, ref, Element) => {
11
+ return (
12
+ <Text
13
+ whiteSpace="nowrap"
14
+ overflow="hidden"
15
+ textOverflow="ellipsis"
16
+ typeLevel="subtext.large"
17
+ fontWeight="bold"
18
+ textTransform="capitalize"
19
+ ref={ref}
20
+ color="inherit"
21
+ as={Element}
22
+ {...elemProps}
23
+ >
24
+ {children}
25
+ </Text>
26
+ );
27
+ },
28
+ });