@workday/canvas-kit-docs 12.0.0-alpha.855-next.0 → 12.0.0-alpha.898-next.0

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 (438) hide show
  1. package/dist/es6/docgen/docParser.d.ts +1 -1
  2. package/dist/es6/docgen/docParser.d.ts.map +1 -1
  3. package/dist/es6/docgen/docParser.js +12 -2
  4. package/dist/es6/docgen/docTypes.d.ts +1 -1
  5. package/dist/es6/docgen/docTypes.d.ts.map +1 -1
  6. package/dist/es6/docgen/plugins/enhancedComponentParser.d.ts +1 -1
  7. package/dist/es6/docgen/plugins/enhancedComponentParser.d.ts.map +1 -1
  8. package/dist/es6/docgen/traverse.d.ts +2 -2
  9. package/dist/es6/docgen/traverse.d.ts.map +1 -1
  10. package/dist/es6/index.d.ts +1 -0
  11. package/dist/es6/index.d.ts.map +1 -1
  12. package/dist/es6/index.js +1 -0
  13. package/dist/es6/lib/ExampleCodeBlock.d.ts +3 -0
  14. package/dist/es6/lib/ExampleCodeBlock.d.ts.map +1 -0
  15. package/dist/es6/lib/ExampleCodeBlock.js +56 -0
  16. package/dist/es6/lib/InformationHighlight/Base.js +1 -1
  17. package/dist/es6/lib/InformationHighlight/Body.js +1 -1
  18. package/dist/es6/lib/InformationHighlight/Heading.js +1 -1
  19. package/dist/es6/lib/InformationHighlight/Icon.d.ts +1 -1
  20. package/dist/es6/lib/InformationHighlight/Icon.d.ts.map +1 -1
  21. package/dist/es6/lib/InformationHighlight/Icon.js +1 -1
  22. package/dist/es6/lib/InformationHighlight/Link.js +1 -1
  23. package/dist/es6/lib/InformationHighlight/index.d.ts +1 -1
  24. package/dist/es6/lib/InformationHighlight/index.d.ts.map +1 -1
  25. package/dist/es6/lib/InformationHighlight/index.js +1 -1
  26. package/dist/es6/lib/InformationHighlight/modelHook.d.ts +1 -1
  27. package/dist/es6/lib/InformationHighlight/modelHook.d.ts.map +1 -1
  28. package/dist/es6/lib/MDXElements.d.ts +2 -1
  29. package/dist/es6/lib/MDXElements.d.ts.map +1 -1
  30. package/dist/es6/lib/MDXElements.js +1 -1
  31. package/dist/es6/lib/MoreTooltip.d.ts +1 -1
  32. package/dist/es6/lib/MoreTooltip.d.ts.map +1 -1
  33. package/dist/es6/lib/MoreTooltip.js +2 -2
  34. package/dist/es6/lib/Specifications.d.ts +2 -1
  35. package/dist/es6/lib/Specifications.d.ts.map +1 -1
  36. package/dist/es6/lib/StylePropsTable.d.ts +3 -2
  37. package/dist/es6/lib/StylePropsTable.d.ts.map +1 -1
  38. package/dist/es6/lib/Table.js +6 -6
  39. package/dist/es6/lib/Value.d.ts +3 -3
  40. package/dist/es6/lib/Value.d.ts.map +1 -1
  41. package/dist/es6/lib/Value.js +4 -2
  42. package/dist/es6/lib/docs.d.ts +3 -3
  43. package/dist/es6/lib/docs.d.ts.map +1 -1
  44. package/dist/es6/lib/docs.js +45199 -40010
  45. package/dist/es6/lib/specs.js +1 -7130
  46. package/dist/es6/lib/widgetUtils.d.ts +5 -5
  47. package/dist/es6/lib/widgetUtils.d.ts.map +1 -1
  48. package/dist/es6/lib/widgetUtils.js +2 -2
  49. package/dist/es6/mdx/installBlock.d.ts +2 -1
  50. package/dist/es6/mdx/installBlock.d.ts.map +1 -1
  51. package/dist/es6/mdx/style-props/examples/Background.d.ts +2 -1
  52. package/dist/es6/mdx/style-props/examples/Background.d.ts.map +1 -1
  53. package/dist/es6/mdx/style-props/examples/Background.js +6 -4
  54. package/dist/es6/mdx/style-props/examples/Border.d.ts +2 -1
  55. package/dist/es6/mdx/style-props/examples/Border.d.ts.map +1 -1
  56. package/dist/es6/mdx/style-props/examples/Border.js +4 -4
  57. package/dist/es6/mdx/style-props/examples/Color.d.ts +2 -1
  58. package/dist/es6/mdx/style-props/examples/Color.d.ts.map +1 -1
  59. package/dist/es6/mdx/style-props/examples/Color.js +4 -4
  60. package/dist/es6/mdx/style-props/examples/Depth.d.ts +2 -1
  61. package/dist/es6/mdx/style-props/examples/Depth.d.ts.map +1 -1
  62. package/dist/es6/mdx/style-props/examples/Depth.js +4 -4
  63. package/dist/es6/mdx/style-props/examples/Flex.d.ts +2 -1
  64. package/dist/es6/mdx/style-props/examples/Flex.d.ts.map +1 -1
  65. package/dist/es6/mdx/style-props/examples/Flex.js +9 -9
  66. package/dist/es6/mdx/style-props/examples/FlexItem.d.ts +2 -1
  67. package/dist/es6/mdx/style-props/examples/FlexItem.d.ts.map +1 -1
  68. package/dist/es6/mdx/style-props/examples/FlexItem.js +9 -9
  69. package/dist/es6/mdx/style-props/examples/Grid.d.ts +2 -1
  70. package/dist/es6/mdx/style-props/examples/Grid.d.ts.map +1 -1
  71. package/dist/es6/mdx/style-props/examples/Grid.js +4 -4
  72. package/dist/es6/mdx/style-props/examples/GridItem.d.ts +2 -1
  73. package/dist/es6/mdx/style-props/examples/GridItem.d.ts.map +1 -1
  74. package/dist/es6/mdx/style-props/examples/GridItem.js +5 -5
  75. package/dist/es6/mdx/style-props/examples/Layout.d.ts +2 -1
  76. package/dist/es6/mdx/style-props/examples/Layout.d.ts.map +1 -1
  77. package/dist/es6/mdx/style-props/examples/Layout.js +4 -4
  78. package/dist/es6/mdx/style-props/examples/Other.d.ts +2 -1
  79. package/dist/es6/mdx/style-props/examples/Other.d.ts.map +1 -1
  80. package/dist/es6/mdx/style-props/examples/Other.js +4 -4
  81. package/dist/es6/mdx/style-props/examples/Position.d.ts +2 -1
  82. package/dist/es6/mdx/style-props/examples/Position.d.ts.map +1 -1
  83. package/dist/es6/mdx/style-props/examples/Position.js +4 -4
  84. package/dist/es6/mdx/style-props/examples/Space.d.ts +2 -1
  85. package/dist/es6/mdx/style-props/examples/Space.d.ts.map +1 -1
  86. package/dist/es6/mdx/style-props/examples/Space.js +4 -4
  87. package/dist/es6/mdx/style-props/examples/Text.d.ts +2 -1
  88. package/dist/es6/mdx/style-props/examples/Text.d.ts.map +1 -1
  89. package/dist/es6/mdx/style-props/examples/Text.js +1 -1
  90. package/dist/es6/mdx/versionsTable.d.ts +2 -1
  91. package/dist/es6/mdx/versionsTable.d.ts.map +1 -1
  92. package/dist/es6/mdx/welcomePage.d.ts +2 -1
  93. package/dist/es6/mdx/welcomePage.d.ts.map +1 -1
  94. package/dist/es6/mdx/welcomePage.js +5 -3
  95. package/dist/mdx/11.0-UPGRADE-GUIDE.mdx +8 -8
  96. package/dist/mdx/12.0-UPGRADE-GUIDE.mdx +356 -35
  97. package/dist/mdx/4.0-UPGRADE-GUIDE.mdx +1 -11
  98. package/dist/mdx/5.0-UPGRADE-GUIDE.mdx +0 -10
  99. package/dist/mdx/6.0-UPGRADE-GUIDE.mdx +0 -10
  100. package/dist/mdx/7.0-UPGRADE-GUIDE.mdx +0 -10
  101. package/dist/mdx/8.0-UPGRADE-GUIDE.mdx +0 -10
  102. package/dist/mdx/API_PATTERN_GUIDELINES.mdx +0 -10
  103. package/dist/mdx/COMPOUND_COMPONENTS.mdx +0 -10
  104. package/dist/mdx/CONTRIBUTING.mdx +0 -10
  105. package/dist/mdx/CREATING_COMPOUND_COMPONENTS.mdx +0 -10
  106. package/dist/mdx/DOCUMENTATION_GUIDELINES.mdx +20 -22
  107. package/dist/mdx/GETTING_STARTED.mdx +0 -9
  108. package/dist/mdx/MAINTAINING.mdx +12 -20
  109. package/dist/mdx/TESTING.mdx +1 -26
  110. package/dist/mdx/changelog.mdx +5 -0
  111. package/dist/mdx/labs-react/combobox/Combobox.mdx +52 -0
  112. package/dist/mdx/labs-react/combobox/examples/Basic.tsx +87 -0
  113. package/dist/mdx/labs-react/combobox/examples/DisabledItem.tsx +87 -0
  114. package/dist/mdx/labs-react/combobox/examples/GroupOfResult.tsx +87 -0
  115. package/dist/mdx/labs-react/combobox/examples/Grow.tsx +87 -0
  116. package/dist/mdx/labs-react/combobox/examples/NoClearButton.tsx +87 -0
  117. package/dist/mdx/labs-react/combobox/examples/RTL.tsx +90 -0
  118. package/dist/mdx/labs-react/expandable/Expandable.mdx +1 -3
  119. package/dist/mdx/labs-react/search-form/SearchForm.mdx +1 -4
  120. package/dist/mdx/preview-react/_examples/mdx/Forms.mdx +9 -0
  121. package/dist/mdx/preview-react/_examples/mdx/FormsWithFormik.mdx +14 -0
  122. package/dist/mdx/preview-react/_examples/{examples → mdx/examples}/SelectWithFormik.tsx +1 -5
  123. package/dist/mdx/preview-react/_examples/{examples → mdx/examples}/TextInputWithReactHookForm.tsx +2 -1
  124. package/dist/mdx/preview-react/divider/Divider.mdx +36 -0
  125. package/dist/mdx/preview-react/divider/examples/Basic.tsx +105 -0
  126. package/dist/mdx/preview-react/divider/examples/CustomSpace.tsx +32 -0
  127. package/dist/mdx/preview-react/loading-sparkles/LoadingSparkles.mdx +1 -2
  128. package/dist/mdx/preview-react/menu/Menu.mdx +2 -9
  129. package/dist/mdx/preview-react/pill/Pill.mdx +1 -3
  130. package/dist/mdx/preview-react/radio/Radio.mdx +1 -3
  131. package/dist/mdx/preview-react/radio/examples/Alert.tsx +26 -11
  132. package/dist/mdx/preview-react/radio/examples/Basic.tsx +29 -19
  133. package/dist/mdx/preview-react/radio/examples/Custom.tsx +32 -30
  134. package/dist/mdx/preview-react/radio/examples/Disabled.tsx +25 -12
  135. package/dist/mdx/preview-react/radio/examples/Error.tsx +26 -11
  136. package/dist/mdx/preview-react/radio/examples/Inverse.tsx +14 -18
  137. package/dist/mdx/preview-react/radio/examples/LabelPosition.tsx +25 -10
  138. package/dist/mdx/preview-react/radio/examples/NoValue.tsx +23 -10
  139. package/dist/mdx/preview-react/radio/examples/RefForwarding.tsx +17 -11
  140. package/dist/mdx/preview-react/radio/examples/Required.tsx +19 -11
  141. package/dist/mdx/preview-react/radio/examples/StandaloneRadio.tsx +6 -6
  142. package/dist/mdx/preview-react/segmented-control/SegmentedControl.mdx +1 -4
  143. package/dist/mdx/preview-react/select/Select.mdx +89 -0
  144. package/dist/mdx/preview-react/select/examples/Left Label/AlertLeft.tsx +18 -0
  145. package/dist/mdx/preview-react/select/examples/Left Label/DefaultLeft.tsx +17 -0
  146. package/dist/mdx/preview-react/select/examples/Left Label/DefaultWithCustomOptionsLeft.tsx +25 -0
  147. package/dist/mdx/preview-react/select/examples/Left Label/DefaultWithSimpleOptionsLeft.tsx +17 -0
  148. package/dist/mdx/preview-react/select/examples/Left Label/DisabledLeft.tsx +19 -0
  149. package/dist/mdx/preview-react/select/examples/Left Label/ErrorLeft.tsx +18 -0
  150. package/dist/mdx/preview-react/select/examples/Left Label/GrowLeft.tsx +17 -0
  151. package/dist/mdx/preview-react/select/examples/Left Label/ScrollableLeft.tsx +17 -0
  152. package/dist/mdx/preview-react/select/examples/Left Label/index.ts +8 -0
  153. package/dist/mdx/preview-react/select/examples/Top Label/Alert.tsx +18 -0
  154. package/dist/mdx/preview-react/select/examples/Top Label/Default.tsx +17 -0
  155. package/dist/mdx/preview-react/select/examples/Top Label/DefaultWithCustomOptions.tsx +25 -0
  156. package/dist/mdx/preview-react/select/examples/Top Label/DefaultWithSimpleOptions.tsx +17 -0
  157. package/dist/mdx/preview-react/select/examples/Top Label/Disabled.tsx +19 -0
  158. package/dist/mdx/preview-react/select/examples/Top Label/Error.tsx +18 -0
  159. package/dist/mdx/preview-react/select/examples/Top Label/Grow.tsx +17 -0
  160. package/dist/mdx/preview-react/select/examples/Top Label/Scrollable.tsx +15 -0
  161. package/dist/mdx/preview-react/select/examples/Top Label/index.ts +8 -0
  162. package/dist/mdx/preview-react/select/examples/storiesData.tsx +93 -0
  163. package/dist/mdx/preview-react/side-panel/SidePanel.mdx +1 -4
  164. package/dist/mdx/preview-react/status-indicator/StatusIndicator.mdx +1 -2
  165. package/dist/mdx/preview-react/text-area/TextArea.mdx +1 -4
  166. package/dist/mdx/preview-react/text-area/examples/Alert.tsx +1 -1
  167. package/dist/mdx/preview-react/text-area/examples/LabelPositionHorizontal.tsx +1 -1
  168. package/dist/mdx/preview-react/text-input/TextInput.mdx +4 -7
  169. package/dist/mdx/preview-react/text-input/examples/LabelPositionHorizontal.tsx +1 -1
  170. package/dist/mdx/react/_examples/{AriaLiveRegions.mdx → mdx/AriaLiveRegions.mdx} +1 -0
  171. package/dist/mdx/react/_examples/{CompoundComponent.mdx → mdx/CompoundComponent.mdx} +2 -0
  172. package/dist/mdx/react/_examples/mdx/CookieBanner.mdx +9 -0
  173. package/dist/mdx/react/_examples/mdx/Density.mdx +11 -0
  174. package/dist/mdx/react/_examples/mdx/Headers.mdx +19 -0
  175. package/dist/mdx/react/_examples/{Layouts.mdx → mdx/Layouts.mdx} +1 -0
  176. package/dist/mdx/react/_examples/{MediaModal.mdx → mdx/MediaModal.mdx} +3 -2
  177. package/dist/mdx/react/_examples/{SearchForm.mdx → mdx/SearchForm.mdx} +1 -0
  178. package/dist/mdx/react/_examples/{SidePanel.mdx → mdx/SidePanel.mdx} +2 -1
  179. package/dist/mdx/react/_examples/{TablesAdvanced.mdx → mdx/TablesAdvanced.mdx} +5 -5
  180. package/dist/mdx/react/_examples/{examples → mdx/examples}/AriaLiveRegions/FilterListWithLiveStatus.tsx +1 -1
  181. package/dist/mdx/react/_examples/{examples → mdx/examples}/AriaLiveRegions/HiddenLiveRegion.tsx +1 -1
  182. package/dist/mdx/react/_examples/{examples → mdx/examples}/AriaLiveRegions/TextInputWithLiveError.tsx +1 -1
  183. package/dist/mdx/react/_examples/{examples → mdx/examples}/AriaLiveRegions/VisibleLiveRegion.tsx +1 -1
  184. package/dist/mdx/react/_examples/mdx/examples/Density.tsx +370 -0
  185. package/dist/mdx/react/_examples/{examples → mdx/examples}/GlobalHeader.tsx +1 -1
  186. package/dist/mdx/react/_examples/{examples → mdx/examples}/SidePanelWithNavigation.tsx +0 -1
  187. package/dist/mdx/react/_examples/{examples → mdx/examples}/Table/WithExpandableRows.tsx +26 -29
  188. package/dist/mdx/react/_examples/mdx/examples/common/FilterListWithLiveStatus.tsx +65 -0
  189. package/dist/mdx/react/_examples/mdx/examples/common/HiddenLiveRegion.tsx +30 -0
  190. package/dist/mdx/react/_examples/mdx/examples/common/IconButtonsWithLiveBadges.tsx +98 -0
  191. package/dist/mdx/react/_examples/mdx/examples/common/TextInputWithLiveError.tsx +25 -0
  192. package/dist/mdx/react/_examples/mdx/examples/common/VisibleLiveRegion.tsx +40 -0
  193. package/dist/mdx/react/action-bar/ActionBar.mdx +1 -5
  194. package/dist/mdx/react/action-bar/examples/Basic.tsx +12 -10
  195. package/dist/mdx/react/action-bar/examples/OverflowActionBar.tsx +13 -10
  196. package/dist/mdx/react/action-bar/examples/index.ts +5 -0
  197. package/dist/mdx/react/avatar/avatar/Avatar.mdx +95 -0
  198. package/dist/mdx/react/avatar/avatar/examples/Basic.tsx +18 -0
  199. package/dist/mdx/react/avatar/avatar/examples/Button.tsx +21 -0
  200. package/dist/mdx/react/avatar/avatar/examples/CustomStyles.tsx +35 -0
  201. package/dist/mdx/react/avatar/avatar/examples/Image.tsx +26 -0
  202. package/dist/mdx/react/avatar/avatar/examples/LazyLoad.tsx +15 -0
  203. package/dist/mdx/react/avatar/avatar/examples/ObjectFit.tsx +25 -0
  204. package/dist/mdx/react/avatar/avatar/examples/Size.tsx +28 -0
  205. package/dist/mdx/react/avatar/avatar/examples/Variant.tsx +11 -0
  206. package/dist/mdx/react/avatar/avatar/examples/test-avatar.png +0 -0
  207. package/dist/mdx/react/badge/CountBadge.mdx +15 -18
  208. package/dist/mdx/react/badge/examples/NotificationBadge.tsx +30 -25
  209. package/dist/mdx/react/banner/Banner.mdx +3 -5
  210. package/dist/mdx/react/breadcrumbs/Breadcrumbs.mdx +1 -5
  211. package/dist/mdx/react/button/button/Button.mdx +6 -1
  212. package/dist/mdx/react/button/button/Hyperlink.mdx +1 -4
  213. package/dist/mdx/react/button/button/examples/CustomStyles.tsx +21 -7
  214. package/dist/mdx/react/button/button/examples/Delete.tsx +1 -1
  215. package/dist/mdx/react/button/button/examples/Primary.tsx +1 -1
  216. package/dist/mdx/react/card/card.mdx +3 -4
  217. package/dist/mdx/react/checkbox/Checkbox.mdx +6 -17
  218. package/dist/mdx/react/checkbox/examples/Alert.tsx +5 -4
  219. package/dist/mdx/react/checkbox/examples/Basic.tsx +14 -1
  220. package/dist/mdx/react/checkbox/examples/Disabled.tsx +13 -6
  221. package/dist/mdx/react/checkbox/examples/Error.tsx +5 -4
  222. package/dist/mdx/react/checkbox/examples/Inverse.tsx +0 -1
  223. package/dist/mdx/react/checkbox/examples/LabelPosition.tsx +11 -9
  224. package/dist/mdx/react/checkbox/examples/RefForwarding.tsx +21 -7
  225. package/dist/mdx/react/checkbox/examples/Required.tsx +10 -8
  226. package/dist/mdx/react/collection/{Collection.mdx → mdx/Collection.mdx} +1 -3
  227. package/dist/mdx/react/color-picker/color-input/ColorInput.mdx +6 -18
  228. package/dist/mdx/react/color-picker/color-input/examples/Alert.tsx +5 -3
  229. package/dist/mdx/react/color-picker/color-input/examples/Basic.tsx +4 -2
  230. package/dist/mdx/react/color-picker/color-input/examples/Checked.tsx +4 -2
  231. package/dist/mdx/react/color-picker/color-input/examples/Disabled.tsx +4 -2
  232. package/dist/mdx/react/color-picker/color-input/examples/Error.tsx +5 -3
  233. package/dist/mdx/react/color-picker/color-input/examples/Grow.tsx +9 -2
  234. package/dist/mdx/react/color-picker/color-input/examples/LabelPosition.tsx +5 -3
  235. package/dist/mdx/react/color-picker/color-input/examples/RefForwarding.tsx +4 -2
  236. package/dist/mdx/react/color-picker/color-input/examples/Required.tsx +4 -2
  237. package/dist/mdx/react/color-picker/color-input/examples/ValidColorChange.tsx +9 -7
  238. package/dist/mdx/react/color-picker/color-preview/ColorPreview.mdx +6 -17
  239. package/dist/mdx/react/color-picker/color-preview/examples/Basic.tsx +9 -1
  240. package/dist/mdx/react/color-picker/color-preview/examples/LabelPosition.tsx +5 -3
  241. package/dist/mdx/react/color-picker/color-preview/examples/RefForwarding.tsx +4 -2
  242. package/dist/mdx/react/combobox/Combobox.mdx +1 -4
  243. package/dist/mdx/react/combobox/examples/Autocomplete.tsx +32 -30
  244. package/dist/mdx/react/common/{CompoundComponentUtilities.mdx → mdx/CompoundComponentUtilities.mdx} +2 -1
  245. package/dist/mdx/react/common/{Responsive.mdx → mdx/Responsive.mdx} +2 -2
  246. package/dist/mdx/react/common/{examples → mdx/examples}/ResponsiveStyles.tsx +1 -1
  247. package/dist/mdx/react/dialog/Dialog.mdx +1 -4
  248. package/dist/mdx/react/dialog/examples/Basic.tsx +1 -1
  249. package/dist/mdx/react/dialog/examples/DialogWithFallbackPlacements.tsx +110 -0
  250. package/dist/mdx/react/dialog/examples/Focus.tsx +1 -1
  251. package/dist/mdx/react/form-field/FormField.mdx +104 -78
  252. package/dist/mdx/react/form-field/examples/Alert.tsx +11 -9
  253. package/dist/mdx/{preview-react → react}/form-field/examples/AllFields.tsx +43 -8
  254. package/dist/mdx/react/form-field/examples/Basic.tsx +9 -4
  255. package/dist/mdx/{preview-react → react}/form-field/examples/Custom.tsx +2 -2
  256. package/dist/mdx/{preview-react → react}/form-field/examples/CustomId.tsx +4 -2
  257. package/dist/mdx/{preview-react → react}/form-field/examples/Disabled.tsx +4 -2
  258. package/dist/mdx/react/form-field/examples/Error.tsx +12 -9
  259. package/dist/mdx/react/form-field/examples/GroupedInputs.tsx +207 -0
  260. package/dist/mdx/react/form-field/examples/Grow.tsx +7 -3
  261. package/dist/mdx/react/form-field/examples/Hint.tsx +11 -8
  262. package/dist/mdx/react/form-field/examples/LabelPositionHorizontalEnd.tsx +32 -0
  263. package/dist/mdx/react/form-field/examples/LabelPositionHorizontalStart.tsx +32 -0
  264. package/dist/mdx/{preview-react → react}/form-field/examples/RefForwarding.tsx +4 -2
  265. package/dist/mdx/react/form-field/examples/Required.tsx +11 -3
  266. package/dist/mdx/{preview-react → react}/form-field/examples/ThemedErrors.tsx +7 -5
  267. package/dist/mdx/react/icon/Assets.mdx +13 -6
  268. package/dist/mdx/react/icon/examples/AccentIconList.tsx +1 -1
  269. package/dist/mdx/react/layout/Box.mdx +1 -3
  270. package/dist/mdx/react/layout/Flex.mdx +8 -7
  271. package/dist/mdx/react/layout/Grid.mdx +2 -4
  272. package/dist/mdx/react/loading-dots/LoadingDots.mdx +1 -3
  273. package/dist/mdx/react/menu/Menu.mdx +1 -4
  274. package/dist/mdx/react/menu/examples/MenuWithFallbackPlacements.tsx +66 -0
  275. package/dist/mdx/react/modal/Modal.mdx +1 -4
  276. package/dist/mdx/react/modal/examples/CustomFocus.tsx +1 -1
  277. package/dist/mdx/react/modal/examples/FormModal.tsx +1 -1
  278. package/dist/mdx/react/modal/examples/IframeTest.tsx +26 -0
  279. package/dist/mdx/react/modal/examples/ModalWithPopup.tsx +66 -0
  280. package/dist/mdx/react/modal/examples/ReturnFocus.tsx +1 -1
  281. package/dist/mdx/react/modal/examples/StackedModals.tsx +56 -0
  282. package/dist/mdx/react/modal/examples/WithRadioButtons.tsx +30 -0
  283. package/dist/mdx/react/modal/examples/WithTooltips.tsx +74 -0
  284. package/dist/mdx/react/pagination/pagination.mdx +1 -5
  285. package/dist/mdx/react/popup/Popup.mdx +30 -6
  286. package/dist/mdx/react/popup/examples/CloseOnTargetHiddenTest.tsx +54 -0
  287. package/dist/mdx/react/popup/examples/ComboboxWithinPopup.tsx +48 -0
  288. package/dist/mdx/react/popup/examples/MixedPopupTypes.tsx +143 -0
  289. package/dist/mdx/react/popup/examples/PopupWithFallbackPlacements.tsx +82 -0
  290. package/dist/mdx/react/popup/examples/PopupWithNonHidablePopup.tsx +42 -0
  291. package/dist/mdx/react/popup/examples/ReturnFocusTest.tsx +68 -0
  292. package/dist/mdx/react/popup/examples/TooltipReturnFocus.tsx +36 -0
  293. package/dist/mdx/react/radio/Radio.mdx +6 -16
  294. package/dist/mdx/react/radio/examples/Alert.tsx +1 -1
  295. package/dist/mdx/react/radio/examples/Basic.tsx +1 -1
  296. package/dist/mdx/react/radio/examples/Disabled.tsx +1 -1
  297. package/dist/mdx/react/radio/examples/Error.tsx +1 -1
  298. package/dist/mdx/react/radio/examples/LabelPosition.tsx +2 -2
  299. package/dist/mdx/react/radio/examples/NoValue.tsx +2 -2
  300. package/dist/mdx/react/radio/examples/RefForwarding.tsx +1 -1
  301. package/dist/mdx/react/radio/examples/Required.tsx +1 -1
  302. package/dist/mdx/react/segmented-control/SegmentedControl.mdx +1 -5
  303. package/dist/mdx/react/select/Select.mdx +18 -28
  304. package/dist/mdx/react/select/examples/Alert.tsx +15 -13
  305. package/dist/mdx/react/select/examples/Basic.tsx +18 -16
  306. package/dist/mdx/react/select/examples/Complex.tsx +14 -12
  307. package/dist/mdx/react/select/examples/Disabled.tsx +21 -19
  308. package/dist/mdx/react/select/examples/DisabledOption.tsx +24 -22
  309. package/dist/mdx/react/select/examples/Error.tsx +21 -19
  310. package/dist/mdx/react/select/examples/FetchingDynamicItems.tsx +23 -19
  311. package/dist/mdx/react/select/examples/Grow.tsx +14 -12
  312. package/dist/mdx/react/select/examples/HoistedModel.tsx +14 -12
  313. package/dist/mdx/react/select/examples/InitialSelectedItem.tsx +18 -15
  314. package/dist/mdx/react/select/examples/LabelPosition.tsx +15 -12
  315. package/dist/mdx/react/select/examples/MenuHeight.tsx +11 -9
  316. package/dist/mdx/react/select/examples/Placeholder.tsx +17 -14
  317. package/dist/mdx/react/select/examples/RefForwarding.tsx +13 -10
  318. package/dist/mdx/react/select/examples/Required.tsx +12 -10
  319. package/dist/mdx/react/select/examples/WithIcons.tsx +25 -23
  320. package/dist/mdx/react/skeleton/Skeleton.mdx +1 -5
  321. package/dist/mdx/react/skeleton/examples/Simulation.tsx +3 -3
  322. package/dist/mdx/react/status-indicator/StatusIndicator.mdx +5 -8
  323. package/dist/mdx/react/switch/Switch.mdx +6 -17
  324. package/dist/mdx/react/switch/examples/Alert.tsx +5 -3
  325. package/dist/mdx/react/switch/examples/Basic.tsx +4 -2
  326. package/dist/mdx/react/switch/examples/Disabled.tsx +4 -2
  327. package/dist/mdx/react/switch/examples/Error.tsx +5 -3
  328. package/dist/mdx/react/switch/examples/LabelPosition.tsx +5 -3
  329. package/dist/mdx/react/switch/examples/RefForwarding.tsx +4 -2
  330. package/dist/mdx/react/table/Table.mdx +1 -4
  331. package/dist/mdx/react/tabs/Tabs.mdx +1 -4
  332. package/dist/mdx/react/testing/Testing.mdx +1 -4
  333. package/dist/mdx/react/text/BodyText.mdx +1 -3
  334. package/dist/mdx/react/text/Heading.mdx +1 -3
  335. package/dist/mdx/react/text/LabelText.mdx +1 -3
  336. package/dist/mdx/react/text/Subtext.mdx +1 -3
  337. package/dist/mdx/react/text/Text.mdx +1 -3
  338. package/dist/mdx/react/text/Title.mdx +1 -3
  339. package/dist/mdx/react/text-area/TextArea.mdx +6 -17
  340. package/dist/mdx/react/text-area/examples/Alert.tsx +5 -3
  341. package/dist/mdx/react/text-area/examples/Basic.tsx +4 -2
  342. package/dist/mdx/react/text-area/examples/Disabled.tsx +4 -2
  343. package/dist/mdx/react/text-area/examples/Error.tsx +5 -3
  344. package/dist/mdx/react/text-area/examples/Grow.tsx +6 -4
  345. package/dist/mdx/react/text-area/examples/LabelPosition.tsx +6 -3
  346. package/dist/mdx/react/text-area/examples/Placeholder.tsx +9 -7
  347. package/dist/mdx/react/text-area/examples/RefForwarding.tsx +4 -2
  348. package/dist/mdx/react/text-area/examples/Required.tsx +4 -2
  349. package/dist/mdx/react/text-area/examples/ResizeConstraints.tsx +9 -7
  350. package/dist/mdx/react/text-input/TextInput.mdx +7 -16
  351. package/dist/mdx/react/text-input/examples/Alert.tsx +5 -3
  352. package/dist/mdx/react/text-input/examples/Basic.tsx +5 -3
  353. package/dist/mdx/react/text-input/examples/Disabled.tsx +4 -2
  354. package/dist/mdx/react/text-input/examples/Error.tsx +5 -3
  355. package/dist/mdx/react/text-input/examples/Grow.tsx +5 -3
  356. package/dist/mdx/react/text-input/examples/Icons.tsx +4 -2
  357. package/dist/mdx/react/text-input/examples/LabelPosition.tsx +6 -3
  358. package/dist/mdx/react/text-input/examples/Placeholder.tsx +9 -7
  359. package/dist/mdx/react/text-input/examples/RefForwarding.tsx +4 -2
  360. package/dist/mdx/react/text-input/examples/Required.tsx +4 -2
  361. package/dist/mdx/react/toast/toast.mdx +5 -6
  362. package/dist/mdx/react/tokens/Tokens.mdx +1 -2
  363. package/dist/mdx/react/tooltip/Tooltip.mdx +1 -5
  364. package/dist/mdx/style-props/STYLE_PROPS.mdx +25 -25
  365. package/dist/mdx/style-props/examples/Background.tsx +15 -22
  366. package/dist/mdx/style-props/examples/Border.tsx +3 -18
  367. package/dist/mdx/style-props/examples/Color.tsx +9 -21
  368. package/dist/mdx/style-props/examples/Flex.tsx +27 -9
  369. package/dist/mdx/style-props/examples/FlexItem.tsx +24 -8
  370. package/dist/mdx/style-props/examples/Position.tsx +1 -1
  371. package/dist/mdx/style-props/examples/Space.tsx +9 -3
  372. package/dist/mdx/welcome.mdx +48 -0
  373. package/index.ts +1 -0
  374. package/lib/ExampleCodeBlock.tsx +83 -0
  375. package/lib/MDXElements.tsx +2 -1
  376. package/lib/Value.tsx +5 -3
  377. package/package.json +9 -8
  378. package/dist/mdx/changelog.stories.mdx +0 -14
  379. package/dist/mdx/preview-react/_examples/SelectWithFormik.mdx +0 -8
  380. package/dist/mdx/preview-react/_examples/TextInputWithFormik.mdx +0 -8
  381. package/dist/mdx/preview-react/_examples/TextInputWithReactHookForm.mdx +0 -8
  382. package/dist/mdx/preview-react/form-field/FormField.mdx +0 -149
  383. package/dist/mdx/preview-react/form-field/examples/Alert.tsx +0 -24
  384. package/dist/mdx/preview-react/form-field/examples/Basic.tsx +0 -21
  385. package/dist/mdx/preview-react/form-field/examples/Error.tsx +0 -25
  386. package/dist/mdx/preview-react/form-field/examples/FieldSet.tsx +0 -29
  387. package/dist/mdx/preview-react/form-field/examples/Grow.tsx +0 -21
  388. package/dist/mdx/preview-react/form-field/examples/Hint.tsx +0 -25
  389. package/dist/mdx/preview-react/form-field/examples/LabelPositionHorizontal.tsx +0 -18
  390. package/dist/mdx/preview-react/form-field/examples/Required.tsx +0 -23
  391. package/dist/mdx/react/_examples/CookieBanner.mdx +0 -8
  392. package/dist/mdx/react/_examples/GlobalHeader.mdx +0 -12
  393. package/dist/mdx/react/_examples/PageHeader.mdx +0 -8
  394. package/dist/mdx/react/form-field/examples/AlertLabel.tsx +0 -23
  395. package/dist/mdx/react/form-field/examples/CustomInputId.tsx +0 -17
  396. package/dist/mdx/react/form-field/examples/ErrorLabel.tsx +0 -23
  397. package/dist/mdx/react/form-field/examples/GroupingInputs.tsx +0 -22
  398. package/dist/mdx/react/form-field/examples/LabelPosition.tsx +0 -17
  399. package/dist/mdx/welcome.stories.mdx +0 -35
  400. /package/dist/mdx/preview-react/_examples/{examples → mdx/examples}/TextInputWithFormik.tsx +0 -0
  401. /package/dist/mdx/react/_examples/{examples → mdx/examples}/AriaLiveRegions/IconButtonsWithLiveBadges.tsx +0 -0
  402. /package/dist/mdx/react/_examples/{examples → mdx/examples}/CookieBanner.tsx +0 -0
  403. /package/dist/mdx/react/_examples/{examples → mdx/examples}/MediaModal.tsx +0 -0
  404. /package/dist/mdx/react/_examples/{examples → mdx/examples}/PageHeader.tsx +0 -0
  405. /package/dist/mdx/react/_examples/{examples → mdx/examples}/SearchFormBasic.tsx +0 -0
  406. /package/dist/mdx/react/_examples/{examples → mdx/examples}/SegmentControlWithText.tsx +0 -0
  407. /package/dist/mdx/react/_examples/{examples → mdx/examples}/SidePanelWithOverlay.tsx +0 -0
  408. /package/dist/mdx/react/_examples/{examples → mdx/examples}/Table/WithSelectableRows.tsx +0 -0
  409. /package/dist/mdx/react/_examples/{examples → mdx/examples}/Table/WithSortableColumnHeaders.tsx +0 -0
  410. /package/dist/mdx/react/_examples/{examples → mdx/examples}/compoundComponent/CustomCard.tsx +0 -0
  411. /package/dist/mdx/react/_examples/{examples → mdx/examples}/layout/AreaColumnPositioning.tsx +0 -0
  412. /package/dist/mdx/react/_examples/{examples → mdx/examples}/layout/CustomColumnPositioning.tsx +0 -0
  413. /package/dist/mdx/react/_examples/{examples → mdx/examples}/layout/CustomColumnWidth.tsx +0 -0
  414. /package/dist/mdx/react/_examples/{examples → mdx/examples}/layout/FullWidthWith3Columns.tsx +0 -0
  415. /package/dist/mdx/react/_examples/{examples → mdx/examples}/layout/FullWidthWith3Columns2Rows.tsx +0 -0
  416. /package/dist/mdx/react/_examples/{examples → mdx/examples}/layout/Masonry.tsx +0 -0
  417. /package/dist/mdx/react/_examples/{examples → mdx/examples}/layout/ResponsiveColumns.tsx +0 -0
  418. /package/dist/mdx/react/_examples/{examples → mdx/examples}/layout/Tiled2and3Columns.tsx +0 -0
  419. /package/dist/mdx/react/_examples/{examples → mdx/examples}/layout/Tiled4and2Columns.tsx +0 -0
  420. /package/dist/mdx/react/collection/{examples → mdx/examples}/Basic.tsx +0 -0
  421. /package/dist/mdx/react/collection/{examples → mdx/examples}/BasicGrid.tsx +0 -0
  422. /package/dist/mdx/react/collection/{examples → mdx/examples}/BasicVirtual.tsx +0 -0
  423. /package/dist/mdx/react/collection/{examples → mdx/examples}/DataLoader.tsx +0 -0
  424. /package/dist/mdx/react/collection/{examples → mdx/examples}/DynamicItemsObjects.tsx +0 -0
  425. /package/dist/mdx/react/collection/{examples → mdx/examples}/DynamicItemsStrings.tsx +0 -0
  426. /package/dist/mdx/react/collection/{examples → mdx/examples}/IdentifiedItems.tsx +0 -0
  427. /package/dist/mdx/react/collection/{examples → mdx/examples}/MultiSelection.tsx +0 -0
  428. /package/dist/mdx/react/collection/{examples → mdx/examples}/RovingFocus.tsx +0 -0
  429. /package/dist/mdx/react/collection/{examples → mdx/examples}/Selection.tsx +0 -0
  430. /package/dist/mdx/react/collection/{examples → mdx/examples}/StringChildren.tsx +0 -0
  431. /package/dist/mdx/react/collection/{examples → mdx/examples}/Virtualization.tsx +0 -0
  432. /package/dist/mdx/react/collection/{examples → mdx/examples}/WrappingGrid.tsx +0 -0
  433. /package/dist/mdx/react/common/{examples → mdx/examples}/CreateComponent.tsx +0 -0
  434. /package/dist/mdx/react/common/{examples → mdx/examples}/CreateContainer.tsx +0 -0
  435. /package/dist/mdx/react/common/{examples → mdx/examples}/CreateElemPropsHook.tsx +0 -0
  436. /package/dist/mdx/react/common/{examples → mdx/examples}/CreateModelHook.tsx +0 -0
  437. /package/dist/mdx/react/common/{examples → mdx/examples}/CreateSubcomponent.tsx +0 -0
  438. /package/dist/mdx/react/common/{examples → mdx/examples}/ResponsiveViewport.tsx +0 -0
@@ -1,6 +1,14 @@
1
1
  import React from 'react';
2
2
  import {ColorPreview} from '@workday/canvas-kit-react/color-picker';
3
+ import {FormField} from '@workday/canvas-kit-react/form-field';
3
4
 
4
5
  export default () => {
5
- return <ColorPreview value="#00ffcc" />;
6
+ return (
7
+ <FormField>
8
+ <FormField.Label>Current Color</FormField.Label>
9
+ <FormField.Field>
10
+ <FormField.Input as={ColorPreview} value="#00ffcc" />
11
+ </FormField.Field>
12
+ </FormField>
13
+ );
6
14
  };
@@ -1,12 +1,14 @@
1
1
  import React from 'react';
2
- import {FormField} from '@workday/canvas-kit-preview-react/form-field';
2
+ import {FormField} from '@workday/canvas-kit-react/form-field';
3
3
  import {ColorPreview} from '@workday/canvas-kit-react/color-picker';
4
4
 
5
5
  export default () => {
6
6
  return (
7
- <FormField orientation="horizontal">
7
+ <FormField orientation="horizontalStart">
8
8
  <FormField.Label>Background Color</FormField.Label>
9
- <FormField.Input as={ColorPreview} value="#00ffcc" />
9
+ <FormField.Field>
10
+ <FormField.Input as={ColorPreview} value="#00ffcc" />
11
+ </FormField.Field>
10
12
  </FormField>
11
13
  );
12
14
  };
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import {PrimaryButton} from '@workday/canvas-kit-react/button';
3
- import {FormField} from '@workday/canvas-kit-preview-react/form-field';
3
+ import {FormField} from '@workday/canvas-kit-react/form-field';
4
4
  import {ColorPreview} from '@workday/canvas-kit-react/color-picker';
5
5
  import {type} from '@workday/canvas-kit-react/tokens';
6
6
 
@@ -16,7 +16,9 @@ export default () => {
16
16
  <>
17
17
  <FormField>
18
18
  <FormField.Label>Background Color</FormField.Label>
19
- <FormField.Input as={ColorPreview} ref={ref} value="#00ffcc" />
19
+ <FormField.Field>
20
+ <FormField.Input as={ColorPreview} ref={ref} value="#00ffcc" />
21
+ </FormField.Field>
20
22
  </FormField>
21
23
  <p style={type.levels.subtext.large}>Width of Color Preview: {width}</p>
22
24
  <PrimaryButton onClick={handleClick}>Calculate Width of Color Preview</PrimaryButton>
@@ -1,9 +1,6 @@
1
- import {SymbolDoc, Specifications} from '@workday/canvas-kit-docs';
2
-
3
- import {Combobox} from '@workday/canvas-kit-react/combobox';
1
+ import {ExampleCodeBlock, SymbolDoc, Specifications} from '@workday/canvas-kit-docs';
4
2
  import Autocomplete from './examples/Autocomplete';
5
3
 
6
-
7
4
  # Combobox
8
5
 
9
6
  Combobox is an _abstract_ compound component - it should not be used on its own, but used as a base
@@ -13,7 +13,7 @@ import {
13
13
  useComboboxLoader,
14
14
  useComboboxInput,
15
15
  } from '@workday/canvas-kit-react/combobox';
16
- import {FormField} from '@workday/canvas-kit-preview-react/form-field';
16
+ import {FormField} from '@workday/canvas-kit-react/form-field';
17
17
  import {StyledMenuItem} from '@workday/canvas-kit-react/menu';
18
18
  import {LoadingDots} from '@workday/canvas-kit-react/loading-dots';
19
19
  import {InputGroup, TextInput} from '@workday/canvas-kit-react/text-input';
@@ -105,36 +105,38 @@ export default () => {
105
105
  );
106
106
 
107
107
  return (
108
- <FormField orientation="horizontal" isRequired>
108
+ <FormField orientation="horizontalStart" isRequired>
109
109
  <FormField.Label>Fruit</FormField.Label>
110
- <Combobox model={model} onChange={event => console.log('input', event.currentTarget.value)}>
111
- <InputGroup>
112
- <InputGroup.Input as={FormField.Input.as(AutoCompleteInput)} />
113
- <InputGroup.InnerEnd
114
- cs={styleOverrides.inputGroupInner}
115
- pointerEvents="none"
116
- style={{opacity: loader.isLoading ? system.opacity.full : system.opacity.zero}}
117
- data-loading={loader.isLoading}
118
- >
119
- <LoadingDots cs={styleOverrides.loadingDots} />
120
- </InputGroup.InnerEnd>
121
- <InputGroup.InnerEnd>
122
- <InputGroup.ClearButton data-testid="clear" />
123
- </InputGroup.InnerEnd>
124
- </InputGroup>
125
- <Combobox.Menu.Popper>
126
- <Combobox.Menu.Card>
127
- {model.state.items.length === 0 && (
128
- <StyledMenuItem as="span">No Results Found</StyledMenuItem>
129
- )}
130
- {model.state.items.length > 0 && (
131
- <Combobox.Menu.List cs={styleOverrides.comboboxMenuList}>
132
- {item => <Combobox.Menu.Item>{item}</Combobox.Menu.Item>}
133
- </Combobox.Menu.List>
134
- )}
135
- </Combobox.Menu.Card>
136
- </Combobox.Menu.Popper>
137
- </Combobox>
110
+ <FormField.Field>
111
+ <Combobox model={model} onChange={event => console.log('input', event.currentTarget.value)}>
112
+ <InputGroup>
113
+ <InputGroup.Input as={FormField.Input.as(AutoCompleteInput)} />
114
+ <InputGroup.InnerEnd
115
+ cs={styleOverrides.inputGroupInner}
116
+ pointerEvents="none"
117
+ style={{opacity: loader.isLoading ? system.opacity.full : system.opacity.zero}}
118
+ data-loading={loader.isLoading}
119
+ >
120
+ <LoadingDots cs={styleOverrides.loadingDots} />
121
+ </InputGroup.InnerEnd>
122
+ <InputGroup.InnerEnd>
123
+ <InputGroup.ClearButton data-testid="clear" />
124
+ </InputGroup.InnerEnd>
125
+ </InputGroup>
126
+ <Combobox.Menu.Popper>
127
+ <Combobox.Menu.Card>
128
+ {model.state.items.length === 0 && (
129
+ <StyledMenuItem as="span">No Results Found</StyledMenuItem>
130
+ )}
131
+ {model.state.items.length > 0 && (
132
+ <Combobox.Menu.List cs={styleOverrides.comboboxMenuList}>
133
+ {item => <Combobox.Menu.Item>{item}</Combobox.Menu.Item>}
134
+ </Combobox.Menu.List>
135
+ )}
136
+ </Combobox.Menu.Card>
137
+ </Combobox.Menu.Popper>
138
+ </Combobox>
139
+ </FormField.Field>
138
140
  </FormField>
139
141
  );
140
142
  };
@@ -1,4 +1,5 @@
1
- import {Specifications} from '@workday/canvas-kit-docs';
1
+ import {ExampleCodeBlock, Specifications} from '@workday/canvas-kit-docs';
2
+
2
3
  import CreateModelHook from './examples/CreateModelHook';
3
4
  import CreateContainer from './examples/CreateContainer';
4
5
  import CreateSubcomponent from './examples/CreateSubcomponent';
@@ -1,5 +1,5 @@
1
- import {Box} from '@workday/canvas-kit-react/layout';
2
- import {useResizeObserver, useResponsiveContainerStyles} from '@workday/canvas-kit-react/common';
1
+ import {ExampleCodeBlock} from '@workday/canvas-kit-docs';
2
+
3
3
  import ResponsiveContainer from './examples/ResponsiveStyles';
4
4
  import ResponsiveViewport from './examples/ResponsiveViewport';
5
5
 
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import {Box, Grid, Flex} from '@workday/canvas-kit-react/layout';
3
3
  import {Text} from '@workday/canvas-kit-react/text';
4
4
  import {useResponsiveContainerStyles, useResizeObserver} from '@workday/canvas-kit-react/common';
5
- import {FormField} from '@workday/canvas-kit-preview-react/form-field';
5
+ import {FormField} from '@workday/canvas-kit-react/form-field';
6
6
  import {Select} from '@workday/canvas-kit-react/select';
7
7
 
8
8
  const HeadingText = ({children, ...props}) => (
@@ -1,10 +1,7 @@
1
- import {SymbolDoc, Specifications} from '@workday/canvas-kit-docs';
2
-
3
- import {Dialog} from '@workday/canvas-kit-react/dialog';
1
+ import {ExampleCodeBlock, SymbolDoc} from '@workday/canvas-kit-docs';
4
2
  import Basic from './examples/Basic';
5
3
  import Focus from './examples/Focus';
6
4
 
7
-
8
5
  # Canvas Kit Dialog
9
6
 
10
7
  A Dialog component is a non-modal type of dialog that will not render the rest of the page inert
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import {FormField} from '@workday/canvas-kit-preview-react/form-field';
2
+ import {FormField} from '@workday/canvas-kit-react/form-field';
3
3
  import {TextInput} from '@workday/canvas-kit-react/text-input';
4
4
  import {Flex} from '@workday/canvas-kit-react/layout';
5
5
  import {Dialog} from '@workday/canvas-kit-react/dialog';
@@ -0,0 +1,110 @@
1
+ import React from 'react';
2
+ import {Dialog} from '@workday/canvas-kit-react/dialog';
3
+ import {PrimaryButton} from '@workday/canvas-kit-react/button';
4
+ import {Flex, Grid} from '@workday/canvas-kit-react/layout';
5
+ import {calc, createStyles} from '@workday/canvas-kit-styling';
6
+ import {system} from '@workday/canvas-tokens-web';
7
+
8
+ export default {
9
+ title: 'Testing/Popups/Dialog',
10
+ component: Dialog,
11
+ };
12
+
13
+ const grid = createStyles({
14
+ gridTemplateAreas: "'topButton topButton''leftButton rightButton''bottomButton bottomButton'",
15
+ height: calc.subtract('100vh', system.space.x16),
16
+ width: calc.subtract('100vw', system.space.x20),
17
+ });
18
+
19
+ const topButton = createStyles({
20
+ gridArea: 'topButton',
21
+ justifySelf: 'center',
22
+ });
23
+ const rightButton = createStyles({
24
+ gridArea: 'rightButton',
25
+ justifySelf: 'right',
26
+ alignSelf: 'center',
27
+ });
28
+ const bottomButton = createStyles({
29
+ gridArea: 'bottomButton',
30
+ justifySelf: 'center',
31
+ alignSelf: 'end',
32
+ });
33
+ const leftButton = createStyles({
34
+ gridArea: 'leftButton',
35
+ justifySelf: 'left',
36
+ alignSelf: 'center',
37
+ });
38
+
39
+ export default () => {
40
+ return (
41
+ <div data-testid="scroll-area-fallback-placement">
42
+ <Grid cs={grid}>
43
+ <Dialog>
44
+ <Dialog.Target cs={topButton} as={PrimaryButton}>
45
+ Placement Top
46
+ </Dialog.Target>
47
+ <Dialog.Popper placement="top">
48
+ <Dialog.Card>
49
+ <Dialog.CloseIcon aria-label="Close" />
50
+ <Dialog.Heading paddingTop="m">This is dialog heading</Dialog.Heading>
51
+ <Dialog.Body>This is dialog body.</Dialog.Body>
52
+ <Flex gap="s" padding="xxs" marginTop="xxs">
53
+ <Dialog.CloseButton as={PrimaryButton}>Submit</Dialog.CloseButton>
54
+ <Dialog.CloseButton>Cancel</Dialog.CloseButton>
55
+ </Flex>
56
+ </Dialog.Card>
57
+ </Dialog.Popper>
58
+ </Dialog>
59
+ <Dialog>
60
+ <Dialog.Target cs={leftButton} as={PrimaryButton}>
61
+ Placement Left
62
+ </Dialog.Target>
63
+ <Dialog.Popper placement="left">
64
+ <Dialog.Card>
65
+ <Dialog.CloseIcon aria-label="Close" />
66
+ <Dialog.Heading paddingTop="m">This is dialog heading</Dialog.Heading>
67
+ <Dialog.Body>This is dialog body.</Dialog.Body>
68
+ <Flex gap="s" padding="xxs" marginTop="xxs">
69
+ <Dialog.CloseButton as={PrimaryButton}>Submit</Dialog.CloseButton>
70
+ <Dialog.CloseButton>Cancel</Dialog.CloseButton>
71
+ </Flex>
72
+ </Dialog.Card>
73
+ </Dialog.Popper>
74
+ </Dialog>
75
+ <Dialog>
76
+ <Dialog.Target cs={rightButton} as={PrimaryButton}>
77
+ Placement Right
78
+ </Dialog.Target>
79
+ <Dialog.Popper placement="right">
80
+ <Dialog.Card>
81
+ <Dialog.CloseIcon aria-label="Close" />
82
+ <Dialog.Heading paddingTop="m">This is dialog heading</Dialog.Heading>
83
+ <Dialog.Body>This is dialog body.</Dialog.Body>
84
+ <Flex gap="s" padding="xxs" marginTop="xxs">
85
+ <Dialog.CloseButton as={PrimaryButton}>Submit</Dialog.CloseButton>
86
+ <Dialog.CloseButton>Cancel</Dialog.CloseButton>
87
+ </Flex>
88
+ </Dialog.Card>
89
+ </Dialog.Popper>
90
+ </Dialog>
91
+ <Dialog>
92
+ <Dialog.Target cs={bottomButton} as={PrimaryButton}>
93
+ Placement Bottom
94
+ </Dialog.Target>
95
+ <Dialog.Popper placement="bottom">
96
+ <Dialog.Card>
97
+ <Dialog.CloseIcon aria-label="Close" />
98
+ <Dialog.Heading paddingTop="m">This is dialog heading</Dialog.Heading>
99
+ <Dialog.Body>This is dialog body.</Dialog.Body>
100
+ <Flex gap="s" padding="xxs" marginTop="xxs">
101
+ <Dialog.CloseButton as={PrimaryButton}>Submit</Dialog.CloseButton>
102
+ <Dialog.CloseButton>Cancel</Dialog.CloseButton>
103
+ </Flex>
104
+ </Dialog.Card>
105
+ </Dialog.Popper>
106
+ </Dialog>
107
+ </Grid>
108
+ </div>
109
+ );
110
+ };
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- import {FormField} from '@workday/canvas-kit-preview-react/form-field';
3
+ import {FormField} from '@workday/canvas-kit-react/form-field';
4
4
  import {TextInput} from '@workday/canvas-kit-react/text-input';
5
5
  import {Flex} from '@workday/canvas-kit-react/layout';
6
6
  import {Dialog} from '@workday/canvas-kit-react/dialog';
@@ -1,33 +1,25 @@
1
- import {SymbolDoc, Specifications} from '@workday/canvas-kit-docs';
2
-
3
- import {FormField} from '@workday/canvas-kit-react/form-field';
4
-
5
- import Alert from './examples/Alert.tsx';
6
- import AlertLabel from './examples/AlertLabel.tsx';
7
- import Basic from './examples/Basic.tsx';
8
- import CustomInputId from './examples/CustomInputId.tsx';
9
- import Error from './examples/Error.tsx';
10
- import ErrorLabel from './examples/ErrorLabel.tsx';
11
- import GroupingInputs from './examples/GroupingInputs.tsx';
12
- import Grow from './examples/Grow.tsx';
13
- import Hint from './examples/Hint.tsx';
14
- import LabelPosition from './examples/LabelPosition.tsx';
15
- import Required from './examples/Required.tsx';
16
- import {StatusIndicator} from '@workday/canvas-kit-preview-react/status-indicator';
1
+ import {ExampleCodeBlock, SymbolDoc} from '@workday/canvas-kit-docs';
2
+ import Basic from './examples/Basic';
3
+ import Alert from './examples/Alert';
4
+ import Error from './examples/Error';
5
+ import Disabled from './examples/Disabled';
6
+ import LabelPositionHorizontalStart from './examples/LabelPositionHorizontalStart';
7
+ import LabelPositionHorizontalEnd from './examples/LabelPositionHorizontalEnd';
8
+ import RefForwarding from './examples/RefForwarding';
9
+ import Required from './examples/Required';
10
+ import Custom from './examples/Custom';
11
+ import CustomId from './examples/CustomId';
12
+ import AllFields from './examples/AllFields';
13
+ import Hint from './examples/Hint';
14
+ import Grow from './examples/Grow';
15
+ import ThemedError from './examples/ThemedErrors';
16
+ import GroupedInputs from './examples/GroupedInputs';
17
17
 
18
18
 
19
19
  # Canvas Kit Form Field
20
20
 
21
- <StatusIndicator variant="red">
22
- <StatusIndicator.Label>Deprecated</StatusIndicator.Label>
23
- </StatusIndicator>
24
-
25
- `FormField` in Main has been deprecated and will be removed in a future major version. Please use
26
- [`FormField` in Preview](https://workday.github.io/canvas-kit/?path=/story/preview-inputs-form-field--basic)
27
- instead.
28
-
29
- Form Field allows users to wrap input components to make them accessible and adds complementary
30
- labels and error messages.
21
+ FormField allows users to wrap input components to make them accessible. You can customize the field
22
+ by passing in `TextInput`, `Select`, `RadioGroup` and other form elements to `FormField.Input`.
31
23
 
32
24
  ## Installation
33
25
 
@@ -37,102 +29,136 @@ yarn add @workday/canvas-kit-react
37
29
 
38
30
  ## Usage
39
31
 
40
- ### Basic Example
32
+ ### Basic
41
33
 
42
34
  Form Field should be used in tandem with most Canvas Kit input components to ensure they meet
43
- accessibility standards.
44
-
45
- Here's an example of Form Field being used with [Text Input](/components/inputs/text-input/).
35
+ accessibility standards. The orientation of the label by default is `vertical`.
46
36
 
47
37
  <ExampleCodeBlock code={Basic} />
48
38
 
49
- ### Custom Input id
39
+ ### Error States
50
40
 
51
- Form Field will automatically generate an HTML `id` for its input element to link it to the
52
- correponding label. Alternatively, you may set the `inputId` prop of the Form Field to specify a
53
- custom `id` for the input element.
41
+ Set the `error` prop of the Form Field or define it in the model to indicate it has an error.
42
+ `error` accepts the following values:
54
43
 
55
- <ExampleCodeBlock code={CustomInputId} />
44
+ `"error" | "alert" | undefined`
56
45
 
57
- ### Grouping Inputs
46
+ ### Alert
58
47
 
59
- Set the `useFieldset` prop of the Form Field to `true` to indicate that it includes multiple input
60
- components. In this case, the Form Field will use
61
- [the method prescribed by the WAI](https://www.w3.org/WAI/tutorials/forms/grouping/) and render
62
- itself using a `fieldset` and a `legend`.
48
+ Use the alert state when a value is valid but there is additional information.
63
49
 
64
- `useFieldset` must be set to `true` when wrapping a [Radio Group](/components/inputs/radio/) since
65
- Radio Groups contain multiple Radio Buttons.
50
+ <ExampleCodeBlock code={Alert} />
66
51
 
67
- <ExampleCodeBlock code={GroupingInputs} />
52
+ ### Error
68
53
 
69
- ### Grow
54
+ Use the error state when the value is no longer valid.
70
55
 
71
- Set the `grow` prop of the Form Field to `true` to configure it (including the wrapped input
72
- component) to expand to the width of its container.
56
+ <ExampleCodeBlock code={Error} />
73
57
 
74
- <ExampleCodeBlock code={Grow} />
58
+ ### Disabled
59
+
60
+ Set the `disabled` prop of `FormField.Input` to prevent users from interacting with it.
61
+
62
+ <ExampleCodeBlock code={Disabled} />
75
63
 
76
64
  ### Hint
77
65
 
78
- Set the `hintText` prop of the Form Field to display a short message below the input component.
66
+ Use `FormField.Hint` to display a short message below the input component and `FormField.Field` to
67
+ ensure proper alignment.
79
68
 
80
69
  <ExampleCodeBlock code={Hint} />
81
70
 
82
71
  ### Label Position
83
72
 
84
- Set the `labelPosition` prop of the Form Field to designate the position of the label relative to
85
- the input component. `labelPosition` accepts the following values:
73
+ Set the `orientation` prop of the Form Field to designate the position of the label relative to the
74
+ input component. By default, the orientation will be set to `vertical`. If you want your label to be
75
+ horizontal, you have two options: `horizontalStart` and `horizontalEnd`.
76
+
77
+ If you want the position of the label at the start of the container, set orientation prop to
78
+ `horizontalStart`.
79
+
80
+ <ExampleCodeBlock code={LabelPositionHorizontalStart} />
81
+
82
+ If you want the position of the label at the end of the container, set orientation prop to
83
+ `horizontalEnd`.
84
+
85
+ <ExampleCodeBlock code={LabelPositionHorizontalEnd} />
86
86
 
87
- - `FormField.LabelPosition.Top` (Default)
88
- - `FormField.LabelPosition.Left`
87
+ ### Grow
88
+
89
+ Set the `grow` prop of the Form Field to `true` to configure it (including the wrapped input
90
+ component) to expand to the width of its container.
91
+
92
+ **Note: This Prop is deprecated and will be removed in a future major version.**
89
93
 
90
- <ExampleCodeBlock code={LabelPosition} />
94
+ <ExampleCodeBlock code={Grow} />
95
+
96
+ ### Ref Forwarding
97
+
98
+ If you need full customization you can use the `FormField` behavior hooks to build your own
99
+ solution. It is also easy it work with custom components or third party libraries and get the CKR
100
+ accessibility guarantees by using the `as` prop.
101
+
102
+ <ExampleCodeBlock code={RefForwarding} />
91
103
 
92
104
  ### Required
93
105
 
94
- Set the `required` prop of the Form Field to `true` to indicate that the field is required. Labels
106
+ Set the `isRequired` prop of the Form Field to `true` to indicate that the field is required. Labels
95
107
  for required fields are suffixed by a red asterisk.
96
108
 
97
109
  <ExampleCodeBlock code={Required} />
98
110
 
99
- ### Error States
111
+ ### Grouped Inputs
100
112
 
101
- Set the `error` prop of the Form Field to indicate it has an error. `error` accepts the following
102
- values:
113
+ Use `FormFieldGroup` when you have a group of inputs that need to be associated to one another, like
114
+ `RadioGroup` or a group of `Checkbox`'s. `FormFieldGroup` renders a `fieldset` element and
115
+ `FormFieldGroup.Label` renders a `legend` element. These elements will allow for correct
116
+ accessibility of grouped inputs.
103
117
 
104
- - `FormField.ErrorType.Alert`
105
- - `FormField.ErrorType.Error`
118
+ `FormFieldGroup` supports the same props of `FormField`:
106
119
 
107
- The `hintText` and `hintId` props of the Form Field are required if `error` is defined. Set
108
- `hintText` to the error message you would like to display and `hintId` to the HTML `id` you would
109
- like to assign to that message (`hintId` is used to link the error message to its corresponding
110
- input element to meet accessibility standards).
120
+ - `error`: `"alert" | "error"` Defines the error around the whole group of inputs.
121
+ - `orientation`: `"horizontal" | "vertical"` Defines the legend placement.
122
+ - `isRequired`: `true` Defines if a group like RadioGroup is required.
111
123
 
112
- #### Alert
124
+ <ExampleCodeBlock code={GroupedInputs} />
113
125
 
114
- <ExampleCodeBlock code={Alert} />
126
+ ### Custom
115
127
 
116
- Set the `alertLabel` prop of the Form Field to override the default "Alert" prefix of the hint. This
117
- is generally only used for translations.
128
+ If you need full customization you can use the `FormField` behavior hooks to build your own
129
+ solution. It is also easy it work with custom components or third party libraries and get the CKR
130
+ accessibility guarantees by using the `as` prop.
118
131
 
119
- <ExampleCodeBlock code={AlertLabel} />
132
+ <ExampleCodeBlock code={Custom} />
120
133
 
121
- #### Error
134
+ ### Custom id
122
135
 
123
- <ExampleCodeBlock code={Error} />
136
+ Form Field will automatically generate an HTML `id` for its input element to link it to the
137
+ correponding label. Alternatively, you may set the `id` prop of the Form Field to specify a custom
138
+ `id` for the input element. The `id` will be appended by `input-${your-unique-id}`.
124
139
 
125
- Set the `errorLabel` prop of the Form Field to override the default "Error" prefix of the hint. This
126
- is generally only used for translations.
140
+ <ExampleCodeBlock code={CustomId} />
127
141
 
128
- <ExampleCodeBlock code={ErrorLabel} />
142
+ ### All Fields
129
143
 
130
- ## Component API
144
+ Form Field should allow you to use it with all `inputs` including `Select`, `TextInput`, `Checkbox`,
145
+ `TextArea`, `Switch`, and `RadioGroup`.
146
+
147
+ <ExampleCodeBlock code={AllFields} />
131
148
 
132
- <SymbolDoc name="FormField" fileName="/react/" />
149
+ ### Themed Errors
133
150
 
134
- Undocumented props are spread to the outermost element rendered by Form Field.
151
+ You can theme your error rings by wrapping an input in a `CanvasProvider` and defining
152
+ `focusOutline` and `error` properties on the `theme`.
135
153
 
136
- ## Specifications
154
+ <ExampleCodeBlock code={ThemedError} />
155
+
156
+ ### Custom Styles
157
+
158
+ Form Field and its subcomponents support custom styling via the `cs` prop. For more information,
159
+ check our
160
+ ["How To Customize Styles"](https://workday.github.io/canvas-kit/?path=/docs/styling-how-to-customize-styles--page).
161
+
162
+ ## Component API
137
163
 
138
- <Specifications file="FormField.spec.ts" name="Form Field" />
164
+ <SymbolDoc name="FormField" fileName="/preview-react/" />
@@ -1,22 +1,24 @@
1
1
  import React from 'react';
2
2
  import {FormField} from '@workday/canvas-kit-react/form-field';
3
3
  import {TextInput} from '@workday/canvas-kit-react/text-input';
4
+ import {Flex} from '@workday/canvas-kit-react/layout';
4
5
 
5
6
  export default () => {
6
- const [value, setValue] = React.useState('invalid@email');
7
+ const [value, setValue] = React.useState('');
7
8
 
8
9
  const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
9
10
  setValue(event.target.value);
10
11
  };
11
12
 
12
13
  return (
13
- <FormField
14
- error={FormField.ErrorType.Alert}
15
- hintId="hint-alert"
16
- hintText="Please enter a valid email."
17
- label="Email"
18
- >
19
- <TextInput onChange={handleChange} value={value} />
20
- </FormField>
14
+ <Flex>
15
+ <FormField error="alert">
16
+ <FormField.Label>First Name</FormField.Label>
17
+ <FormField.Field>
18
+ <FormField.Input as={TextInput} value={value} onChange={handleChange} />
19
+ <FormField.Hint>Cannot contain numbers</FormField.Hint>
20
+ </FormField.Field>
21
+ </FormField>
22
+ </Flex>
21
23
  );
22
24
  };