@pingux/astro 2.9.2 → 2.13.0-alpha.10

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 (434) hide show
  1. package/README.md +6 -2
  2. package/lib/README.md +6 -2
  3. package/lib/cjs/components/AccordionGridGroup/AccordionGridGroup.mdx +40 -0
  4. package/lib/cjs/components/AccordionGridGroup/AccordionGridGroup.test.js +2 -2
  5. package/lib/cjs/components/AccordionGroup/Accordion.styles.js +1 -2
  6. package/lib/cjs/components/AccordionGroup/AccordionGroup.js +4 -5
  7. package/lib/cjs/components/AccordionGroup/AccordionGroup.mdx +41 -0
  8. package/lib/cjs/components/ArrayField/ArrayField.mdx +34 -0
  9. package/lib/cjs/components/AstroWrapper/AstroWrapper.mdx +16 -0
  10. package/lib/cjs/components/Avatar/Avatar.mdx +14 -0
  11. package/lib/cjs/components/Badge/Badge.mdx +24 -0
  12. package/lib/cjs/components/Box/Box.d.ts +4 -0
  13. package/lib/cjs/components/Box/Box.js +4 -19
  14. package/lib/cjs/components/Box/Box.mdx +23 -0
  15. package/lib/cjs/components/Box/Box.styles.d.ts +6 -0
  16. package/lib/cjs/components/Box/Box.test.d.ts +1 -0
  17. package/lib/cjs/components/Box/Box.test.js +2 -6
  18. package/lib/cjs/components/Box/index.d.ts +1 -0
  19. package/lib/cjs/components/Bracket/Bracket.mdx +17 -0
  20. package/lib/cjs/components/Breadcrumbs/Breadcrumbs.mdx +40 -0
  21. package/lib/cjs/components/Button/Button.mdx +40 -0
  22. package/lib/cjs/components/Button/Button.stories.js +30 -5
  23. package/lib/cjs/components/Button/Buttons.styles.js +25 -7
  24. package/lib/cjs/components/Calendar/Calendar.mdx +39 -0
  25. package/lib/cjs/components/Calendar/Calendar.test.js +2 -2
  26. package/lib/cjs/components/Calendar/CalendarCell.js +2 -3
  27. package/lib/cjs/components/Calendar/CalendarGrid.js +1 -3
  28. package/lib/cjs/components/Callout/Callout.mdx +28 -0
  29. package/lib/cjs/components/Card/Card.mdx +32 -0
  30. package/lib/cjs/components/Checkbox/Checkbox.js +1 -2
  31. package/lib/cjs/components/Checkbox/CheckboxBase.js +1 -2
  32. package/lib/cjs/components/CheckboxField/CheckboxField.mdx +42 -0
  33. package/lib/cjs/components/CodeView/CodeView.mdx +23 -0
  34. package/lib/cjs/components/CodeView/CodeView.test.js +1 -1
  35. package/lib/cjs/components/CollapsiblePanel/CollapsiblePanel.mdx +29 -0
  36. package/lib/cjs/components/CollapsiblePanelContainer/CollapsiblePanelBadge.js +0 -1
  37. package/lib/cjs/components/CollapsiblePanelContainer/CollapsiblePanelContainer.js +2 -3
  38. package/lib/cjs/components/ColorField/ColorField.mdx +38 -0
  39. package/lib/cjs/components/ComboBoxField/ComboBoxField.mdx +66 -0
  40. package/lib/cjs/components/ComboBoxField/ComboBoxField.stories.js +1 -1
  41. package/lib/cjs/components/ComboBoxField/ComboBoxField.test.js +2 -2
  42. package/lib/cjs/components/CopyText/CopyText.mdx +23 -0
  43. package/lib/cjs/components/CopyText/CopyText.test.js +1 -1
  44. package/lib/cjs/components/DataTable/DataTable.mdx +54 -0
  45. package/lib/cjs/components/DataTable/DataTable.stories.js +1 -1
  46. package/lib/cjs/components/DataTable/DataTable.test.js +2 -2
  47. package/lib/cjs/components/DataTable/DataTableVirtualizer.js +2 -3
  48. package/lib/cjs/components/DatePicker/DateField.js +4 -5
  49. package/lib/cjs/components/DatePicker/DatePicker.js +4 -6
  50. package/lib/cjs/components/DatePicker/DatePicker.mdx +49 -0
  51. package/lib/cjs/components/DatePicker/DatePicker.test.js +2 -2
  52. package/lib/cjs/components/DatePicker/DateSegment.js +1 -2
  53. package/lib/cjs/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.js +3 -3
  54. package/lib/cjs/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.mdx +36 -0
  55. package/lib/cjs/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.stories.js +29 -45
  56. package/lib/cjs/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.test.js +1 -1
  57. package/lib/cjs/components/FieldHelperText/FieldHelperText.js +4 -4
  58. package/lib/cjs/components/FileInputField/FileInputField.mdx +33 -0
  59. package/lib/cjs/components/HelpHint/HelpHint.js +145 -27
  60. package/lib/cjs/components/HelpHint/HelpHint.mdx +32 -0
  61. package/lib/cjs/components/HelpHint/HelpHint.stories.js +40 -7
  62. package/lib/cjs/components/HelpHint/HelpHint.styles.js +9 -1
  63. package/lib/cjs/components/HelpHint/HelpHint.test.js +213 -30
  64. package/lib/cjs/components/Icon/Icon.d.ts +4 -0
  65. package/lib/cjs/components/Icon/Icon.js +4 -27
  66. package/lib/cjs/components/Icon/Icon.mdx +49 -0
  67. package/lib/cjs/components/Icon/Icon.stories.d.ts +8 -0
  68. package/lib/cjs/components/Icon/Icon.test.d.ts +1 -0
  69. package/lib/cjs/components/Icon/index.d.ts +1 -0
  70. package/lib/cjs/components/IconBadge/IconBadge.mdx +14 -0
  71. package/lib/cjs/components/IconButton/IconButton.mdx +33 -0
  72. package/lib/cjs/components/IconButtonToggle/IconButtonToggle.mdx +31 -0
  73. package/lib/cjs/components/Image/Image.mdx +28 -0
  74. package/lib/cjs/components/ImageUploadField/ImageUploadField.mdx +38 -0
  75. package/lib/cjs/components/ImageUploadField/ImageUploadField.stories.js +1 -1
  76. package/lib/cjs/components/ImageUploadField/ImageUploadField.test.js +2 -2
  77. package/lib/cjs/components/Input/Input.js +2 -3
  78. package/lib/cjs/components/Label/Label.styles.js +1 -1
  79. package/lib/cjs/components/Link/Link.mdx +27 -0
  80. package/lib/cjs/components/Link/Link.styles.js +10 -0
  81. package/lib/cjs/components/LinkSelectField/LinkSelectField.mdx +47 -0
  82. package/lib/cjs/components/LinkSelectField/LinkSelectField.stories.js +1 -1
  83. package/lib/cjs/components/LinkSelectField/LinkSelectField.test.js +2 -2
  84. package/lib/cjs/components/ListBox/ListBox.test.js +2 -2
  85. package/lib/cjs/components/ListItem/ListItem.mdx +21 -0
  86. package/lib/cjs/components/ListView/ListView.mdx +44 -0
  87. package/lib/cjs/components/ListView/ListView.stories.js +95 -49
  88. package/lib/cjs/components/ListView/ListView.test.js +2 -2
  89. package/lib/cjs/components/Loader/Loader.d.ts +4 -0
  90. package/lib/cjs/components/Loader/Loader.js +0 -14
  91. package/lib/cjs/components/Loader/Loader.mdx +29 -0
  92. package/lib/cjs/components/Loader/Loader.styles.d.ts +53 -0
  93. package/lib/cjs/components/Loader/Loader.test.d.ts +1 -0
  94. package/lib/cjs/components/Loader/index.d.ts +1 -0
  95. package/lib/cjs/components/Menu/Menu.mdx +43 -0
  96. package/lib/cjs/components/MenuItem/MenuItem.js +2 -3
  97. package/lib/cjs/components/Messages/Messages.mdx +35 -0
  98. package/lib/cjs/components/Modal/Modal.mdx +59 -0
  99. package/lib/cjs/components/Modal/tests/Modal.integration.test.js +1 -2
  100. package/lib/cjs/components/MultivaluesField/MultivaluesField.js +43 -9
  101. package/lib/cjs/components/MultivaluesField/MultivaluesField.mdx +44 -0
  102. package/lib/cjs/components/MultivaluesField/MultivaluesField.test.js +3 -3
  103. package/lib/cjs/components/NavBar/NavBar.mdx +42 -0
  104. package/lib/cjs/components/NavBarSection/NavBarSection.js +2 -3
  105. package/lib/cjs/components/NumberField/NumberField.mdx +39 -0
  106. package/lib/cjs/components/OverlayPanel/OverlayPanel.mdx +39 -0
  107. package/lib/cjs/components/PasswordField/PasswordField.mdx +33 -0
  108. package/lib/cjs/components/PasswordField/PasswordField.test.js +2 -3
  109. package/lib/cjs/components/PopoverContainer/PopoverContainer.d.ts +9 -0
  110. package/lib/cjs/components/PopoverContainer/PopoverContainer.js +10 -42
  111. package/lib/cjs/components/PopoverContainer/index.d.ts +2 -0
  112. package/lib/cjs/components/PopoverMenu/PopoverMenu.mdx +53 -0
  113. package/lib/cjs/components/Radio/Radio.js +1 -2
  114. package/lib/cjs/components/RadioGroupField/RadioGroupField.mdx +41 -0
  115. package/lib/cjs/components/RadioGroupField/RadioGroupField.test.js +2 -2
  116. package/lib/cjs/components/RequirementsList/RequirementsList.mdx +17 -0
  117. package/lib/cjs/components/RockerButtonGroup/RockerButtonGroup.mdx +36 -0
  118. package/lib/cjs/components/ScrollBox/ScrollBox.mdx +17 -0
  119. package/lib/cjs/components/SearchField/SearchField.mdx +33 -0
  120. package/lib/cjs/components/SelectField/Select.styles.js +1 -1
  121. package/lib/cjs/components/SelectField/SelectField.mdx +46 -0
  122. package/lib/cjs/components/SelectField/SelectField.stories.js +1 -1
  123. package/lib/cjs/components/SelectFieldBase/SelectFieldBase.js +4 -4
  124. package/lib/cjs/components/SelectFieldBase/SelectFieldBase.test.js +2 -2
  125. package/lib/cjs/components/Separator/Separator.mdx +19 -0
  126. package/lib/cjs/components/Stepper/Stepper.mdx +41 -0
  127. package/lib/cjs/components/Stepper/Stepper.styles.js +1 -1
  128. package/lib/cjs/components/Stepper/Stepper.test.js +2 -3
  129. package/lib/cjs/components/Switch/Switch.js +1 -2
  130. package/lib/cjs/components/SwitchField/SwitchField.js +1 -0
  131. package/lib/cjs/components/SwitchField/SwitchField.mdx +36 -0
  132. package/lib/cjs/components/Tab/Tab.js +2 -3
  133. package/lib/cjs/components/TabPicker/TabPicker.js +1 -1
  134. package/lib/cjs/components/Table/Table.mdx +30 -0
  135. package/lib/cjs/components/TableBody/TableBody.js +0 -1
  136. package/lib/cjs/components/TableCaption/TableCaption.js +0 -1
  137. package/lib/cjs/components/TableCell/TableCell.d.ts +12 -0
  138. package/lib/cjs/components/TableCell/TableCell.js +0 -6
  139. package/lib/cjs/components/TableCell/TableCell.test.d.ts +1 -0
  140. package/lib/cjs/components/TableCell/index.d.ts +1 -0
  141. package/lib/cjs/components/TableHead/TableHead.js +0 -1
  142. package/lib/cjs/components/TableRow/TableRow.js +0 -1
  143. package/lib/cjs/components/Tabs/Tabs.mdx +40 -0
  144. package/lib/cjs/components/Tabs/Tabs.test.js +3 -4
  145. package/lib/cjs/components/Text/Text.d.ts +4 -0
  146. package/lib/cjs/components/Text/Text.js +3 -7
  147. package/lib/cjs/components/Text/Text.mdx +13 -0
  148. package/lib/cjs/components/Text/Text.stories.d.ts +6 -0
  149. package/lib/cjs/components/Text/Text.styles.d.ts +286 -0
  150. package/lib/cjs/components/Text/Text.test.d.ts +1 -0
  151. package/lib/cjs/components/Text/index.d.ts +1 -0
  152. package/lib/cjs/components/TextArea/TextArea.js +1 -3
  153. package/lib/cjs/components/TextAreaField/TextAreaField.mdx +34 -0
  154. package/lib/cjs/components/TextField/TextField.js +1 -1
  155. package/lib/cjs/components/TextField/TextField.mdx +34 -0
  156. package/lib/cjs/components/TimeZonePicker/TimeZonePicker.mdx +18 -0
  157. package/lib/cjs/components/TooltipTrigger/Tooltip.styles.js +2 -1
  158. package/lib/cjs/components/TooltipTrigger/TooltipTrigger.js +2 -0
  159. package/lib/cjs/components/TooltipTrigger/TooltipTrigger.mdx +23 -0
  160. package/lib/cjs/components/TooltipTrigger/TooltipTrigger.test.js +47 -1
  161. package/lib/cjs/docs/Props.stories.mdx +35 -0
  162. package/lib/cjs/docs/Welcome.stories.mdx +149 -0
  163. package/lib/cjs/docs/hooks/useDebounce.stories.mdx +59 -0
  164. package/lib/cjs/docs/hooks/useModalState.stories.mdx +83 -0
  165. package/lib/cjs/docs/hooks/useOverlayPanelState.stories.mdx +84 -0
  166. package/lib/cjs/docs/theme/AstroNanoTheme.stories.mdx +174 -0
  167. package/lib/cjs/docs/theme/AstroTheme.stories.mdx +20 -0
  168. package/lib/cjs/docs/theme/CustomThemes.stories.mdx +70 -0
  169. package/lib/cjs/docs/theme/StylingGuideline.stories.mdx +116 -0
  170. package/lib/cjs/docs/utils/messagesReducer.stories.mdx +64 -0
  171. package/lib/cjs/experimental/EditButton/EditButton.js +63 -0
  172. package/lib/cjs/experimental/EditButton/EditButton.mdx +9 -0
  173. package/lib/cjs/experimental/EditButton/EditButton.stories.js +91 -0
  174. package/lib/cjs/experimental/EditButton/EditButton.test.js +71 -0
  175. package/lib/cjs/experimental/EditButton/index.js +14 -0
  176. package/lib/cjs/experimental/ListView/ListView.mdx +47 -0
  177. package/lib/cjs/experimental/ListView/ListView.stories.js +742 -0
  178. package/lib/cjs/experimental/ListViewItem/ListViewItem.js +23 -5
  179. package/lib/cjs/experimental/ListViewItem/ListViewItem.mdx +36 -0
  180. package/lib/cjs/experimental/ListViewItem/ListViewItem.stories.js +31 -7
  181. package/lib/cjs/experimental/ListViewItem/ListViewItem.test.js +51 -7
  182. package/lib/cjs/experimental/ListViewItem/controls/ListViewItemEditButton.js +2 -7
  183. package/lib/cjs/experimental/ListViewItem/controls/ListViewItemEditButton.stories.js +4 -1
  184. package/lib/cjs/experimental/ListViewItem/controls/ListViewItemMenu.js +0 -1
  185. package/lib/cjs/experimental/ListViewItem/controls/ListViewItemMenu.test.js +2 -2
  186. package/lib/cjs/experimental/ListViewItem/controls/ListViewItemSwitchField.js +2 -3
  187. package/lib/cjs/experimental/ListViewItem/listViewItemAttributes.js +28 -13
  188. package/lib/cjs/experimental/PanelHeader/PanelHeader.js +88 -0
  189. package/lib/cjs/experimental/PanelHeader/PanelHeader.mdx +19 -0
  190. package/lib/cjs/experimental/PanelHeader/PanelHeader.stories.js +71 -0
  191. package/lib/cjs/experimental/PanelHeader/PanelHeader.styles.js +38 -0
  192. package/lib/cjs/experimental/PanelHeader/PanelHeader.test.js +46 -0
  193. package/lib/cjs/experimental/PanelHeader/controls/PanelHeaderCloseButton.js +32 -0
  194. package/lib/cjs/experimental/PanelHeader/controls/PanelHeaderCloseButton.stories.js +31 -0
  195. package/lib/cjs/experimental/PanelHeader/controls/PanelHeaderCloseButton.test.js +25 -0
  196. package/lib/cjs/experimental/PanelHeader/controls/PanelHeaderMenu.js +25 -0
  197. package/lib/cjs/experimental/PanelHeader/controls/PanelHeaderMenu.stories.js +36 -0
  198. package/lib/cjs/experimental/PanelHeader/controls/PanelHeaderMenu.test.js +58 -0
  199. package/lib/cjs/experimental/PanelHeader/controls/PanelHeaderSwitchField.js +25 -0
  200. package/lib/cjs/experimental/PanelHeader/controls/PanelHeaderSwitchField.stories.js +41 -0
  201. package/lib/cjs/experimental/PanelHeader/controls/PanelHeaderSwitchField.test.js +25 -0
  202. package/lib/cjs/experimental/PanelHeader/index.js +14 -0
  203. package/lib/cjs/experimental/README.stories.mdx +7 -0
  204. package/lib/cjs/experimental/SaveBar/SaveBar.mdx +13 -0
  205. package/lib/cjs/experimental/recipes/ListAndPanel.stories.js +1 -1
  206. package/lib/cjs/hooks/useComponentToggle/useComponentToggle.test.js +2 -2
  207. package/lib/cjs/hooks/useCopyToClipboard/useCopyToClipboard.js +2 -2
  208. package/lib/cjs/hooks/useCopyToClipboard/useCopyToClipboard.test.js +1 -1
  209. package/lib/cjs/hooks/useOverlappingMenuHoverState/useOverlappingMenuHoverState.test.js +2 -2
  210. package/lib/cjs/hooks/usePropWarning/usePropWarning.js +1 -1
  211. package/lib/cjs/hooks/useStatusClasses/useStatusClasses.js +2 -2
  212. package/lib/cjs/hooks/useTShirtSize/useTShirtSize.js +1 -1
  213. package/lib/cjs/index.d.ts +173 -0
  214. package/lib/cjs/index.js +53 -1
  215. package/lib/cjs/recipes/ApplicationSearchDropdown.stories.hidden.js +1 -1
  216. package/lib/cjs/recipes/{AttributesAndPingOneMapping.stories.js → AttributeMapping.stories.js} +392 -132
  217. package/lib/cjs/recipes/Slider.stories.js +1 -1
  218. package/lib/cjs/styles/colors.js +1 -1
  219. package/lib/cjs/styles/forms/index.js +1 -1
  220. package/lib/cjs/styles/variants/README.md +98 -0
  221. package/lib/cjs/styles/variants/variants.js +2 -0
  222. package/lib/cjs/types/box.d.ts +10 -0
  223. package/lib/cjs/types/box.js +6 -0
  224. package/lib/cjs/types/icon.d.ts +34 -0
  225. package/lib/cjs/types/icon.js +6 -0
  226. package/lib/cjs/types/index.d.ts +7 -0
  227. package/lib/cjs/types/index.js +86 -0
  228. package/lib/cjs/types/loader.d.ts +14 -0
  229. package/lib/cjs/types/loader.js +6 -0
  230. package/lib/cjs/types/mdx.d.js +1 -0
  231. package/lib/cjs/types/popoverContainer.d.ts +23 -0
  232. package/lib/cjs/types/popoverContainer.js +6 -0
  233. package/lib/cjs/types/shared/dom.d.ts +9 -0
  234. package/lib/cjs/types/shared/dom.js +6 -0
  235. package/lib/cjs/types/shared/index.d.ts +3 -0
  236. package/lib/cjs/types/shared/index.js +42 -0
  237. package/lib/cjs/types/shared/style.d.ts +11 -0
  238. package/lib/cjs/types/shared/style.js +6 -0
  239. package/lib/cjs/types/shared/test.d.ts +3 -0
  240. package/lib/cjs/types/shared/test.js +6 -0
  241. package/lib/cjs/types/shared/utils.d.ts +1 -0
  242. package/lib/cjs/types/shared/utils.js +6 -0
  243. package/lib/cjs/types/tableCell.d.ts +5 -0
  244. package/lib/cjs/types/tableCell.js +6 -0
  245. package/lib/cjs/types/text.d.ts +3 -0
  246. package/lib/cjs/types/text.js +6 -0
  247. package/lib/cjs/utils/designUtils/figmaLinks.js +2 -1
  248. package/lib/cjs/utils/devUtils/constants/variants.js +1 -2
  249. package/lib/cjs/utils/testUtils/testAxe.js +2 -2
  250. package/lib/cjs/utils/testUtils/testWrapper.js +2 -0
  251. package/lib/components/AccordionGridGroup/AccordionGridGroup.mdx +40 -0
  252. package/lib/components/AccordionGridGroup/AccordionGridGroup.test.js +2 -2
  253. package/lib/components/AccordionGroup/Accordion.styles.js +1 -2
  254. package/lib/components/AccordionGroup/AccordionGroup.mdx +41 -0
  255. package/lib/components/ArrayField/ArrayField.mdx +34 -0
  256. package/lib/components/AstroWrapper/AstroWrapper.mdx +16 -0
  257. package/lib/components/Avatar/Avatar.mdx +14 -0
  258. package/lib/components/Badge/Badge.mdx +24 -0
  259. package/lib/components/Box/Box.js +4 -19
  260. package/lib/components/Box/Box.mdx +23 -0
  261. package/lib/components/Box/Box.test.js +2 -6
  262. package/lib/components/Bracket/Bracket.mdx +17 -0
  263. package/lib/components/Breadcrumbs/Breadcrumbs.mdx +40 -0
  264. package/lib/components/Button/Button.mdx +40 -0
  265. package/lib/components/Button/Button.stories.js +30 -5
  266. package/lib/components/Button/Buttons.styles.js +25 -7
  267. package/lib/components/Calendar/Calendar.mdx +39 -0
  268. package/lib/components/Calendar/Calendar.test.js +2 -2
  269. package/lib/components/Callout/Callout.mdx +28 -0
  270. package/lib/components/Card/Card.mdx +32 -0
  271. package/lib/components/CheckboxField/CheckboxField.mdx +42 -0
  272. package/lib/components/CodeView/CodeView.mdx +23 -0
  273. package/lib/components/CodeView/CodeView.test.js +1 -1
  274. package/lib/components/CollapsiblePanel/CollapsiblePanel.mdx +29 -0
  275. package/lib/components/ColorField/ColorField.mdx +38 -0
  276. package/lib/components/ComboBoxField/ComboBoxField.mdx +66 -0
  277. package/lib/components/ComboBoxField/ComboBoxField.stories.js +1 -1
  278. package/lib/components/ComboBoxField/ComboBoxField.test.js +2 -2
  279. package/lib/components/CopyText/CopyText.mdx +23 -0
  280. package/lib/components/CopyText/CopyText.test.js +1 -1
  281. package/lib/components/DataTable/DataTable.mdx +54 -0
  282. package/lib/components/DataTable/DataTable.stories.js +1 -1
  283. package/lib/components/DataTable/DataTable.test.js +1 -1
  284. package/lib/components/DatePicker/DatePicker.mdx +49 -0
  285. package/lib/components/DatePicker/DatePicker.test.js +2 -2
  286. package/lib/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.js +3 -3
  287. package/lib/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.mdx +36 -0
  288. package/lib/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.stories.js +29 -45
  289. package/lib/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.test.js +1 -1
  290. package/lib/components/FileInputField/FileInputField.mdx +33 -0
  291. package/lib/components/HelpHint/HelpHint.js +148 -30
  292. package/lib/components/HelpHint/HelpHint.mdx +32 -0
  293. package/lib/components/HelpHint/HelpHint.stories.js +37 -6
  294. package/lib/components/HelpHint/HelpHint.styles.js +9 -1
  295. package/lib/components/HelpHint/HelpHint.test.js +213 -30
  296. package/lib/components/Icon/Icon.js +2 -25
  297. package/lib/components/Icon/Icon.mdx +49 -0
  298. package/lib/components/IconBadge/IconBadge.mdx +14 -0
  299. package/lib/components/IconButton/IconButton.mdx +33 -0
  300. package/lib/components/IconButtonToggle/IconButtonToggle.mdx +31 -0
  301. package/lib/components/Image/Image.mdx +28 -0
  302. package/lib/components/ImageUploadField/ImageUploadField.mdx +38 -0
  303. package/lib/components/ImageUploadField/ImageUploadField.stories.js +1 -1
  304. package/lib/components/ImageUploadField/ImageUploadField.test.js +2 -2
  305. package/lib/components/Link/Link.mdx +27 -0
  306. package/lib/components/Link/Link.styles.js +10 -0
  307. package/lib/components/LinkSelectField/LinkSelectField.mdx +47 -0
  308. package/lib/components/LinkSelectField/LinkSelectField.stories.js +1 -1
  309. package/lib/components/LinkSelectField/LinkSelectField.test.js +2 -2
  310. package/lib/components/ListBox/ListBox.test.js +2 -2
  311. package/lib/components/ListItem/ListItem.mdx +21 -0
  312. package/lib/components/ListView/ListView.mdx +44 -0
  313. package/lib/components/ListView/ListView.stories.js +96 -50
  314. package/lib/components/ListView/ListView.test.js +2 -2
  315. package/lib/components/Loader/Loader.js +0 -14
  316. package/lib/components/Loader/Loader.mdx +29 -0
  317. package/lib/components/Menu/Menu.mdx +43 -0
  318. package/lib/components/Messages/Messages.mdx +35 -0
  319. package/lib/components/Modal/Modal.mdx +59 -0
  320. package/lib/components/MultivaluesField/MultivaluesField.js +43 -9
  321. package/lib/components/MultivaluesField/MultivaluesField.mdx +44 -0
  322. package/lib/components/MultivaluesField/MultivaluesField.test.js +3 -3
  323. package/lib/components/NavBar/NavBar.mdx +42 -0
  324. package/lib/components/NumberField/NumberField.mdx +39 -0
  325. package/lib/components/OverlayPanel/OverlayPanel.mdx +39 -0
  326. package/lib/components/PasswordField/PasswordField.mdx +33 -0
  327. package/lib/components/PasswordField/PasswordField.test.js +2 -2
  328. package/lib/components/PopoverContainer/PopoverContainer.js +7 -38
  329. package/lib/components/PopoverMenu/PopoverMenu.mdx +53 -0
  330. package/lib/components/RadioGroupField/RadioGroupField.mdx +41 -0
  331. package/lib/components/RadioGroupField/RadioGroupField.test.js +2 -2
  332. package/lib/components/RequirementsList/RequirementsList.mdx +17 -0
  333. package/lib/components/RockerButtonGroup/RockerButtonGroup.mdx +36 -0
  334. package/lib/components/ScrollBox/ScrollBox.mdx +17 -0
  335. package/lib/components/SearchField/SearchField.mdx +33 -0
  336. package/lib/components/SelectField/SelectField.mdx +46 -0
  337. package/lib/components/SelectField/SelectField.stories.js +1 -1
  338. package/lib/components/SelectFieldBase/SelectFieldBase.test.js +2 -2
  339. package/lib/components/Separator/Separator.mdx +19 -0
  340. package/lib/components/Stepper/Stepper.mdx +41 -0
  341. package/lib/components/Stepper/Stepper.test.js +2 -2
  342. package/lib/components/SwitchField/SwitchField.mdx +36 -0
  343. package/lib/components/Table/Table.mdx +30 -0
  344. package/lib/components/TableCell/TableCell.js +0 -5
  345. package/lib/components/Tabs/Tabs.mdx +40 -0
  346. package/lib/components/Tabs/Tabs.test.js +2 -2
  347. package/lib/components/Text/Text.js +3 -7
  348. package/lib/components/Text/Text.mdx +13 -0
  349. package/lib/components/TextAreaField/TextAreaField.mdx +34 -0
  350. package/lib/components/TextField/TextField.js +1 -1
  351. package/lib/components/TextField/TextField.mdx +34 -0
  352. package/lib/components/TimeZonePicker/TimeZonePicker.mdx +18 -0
  353. package/lib/components/TooltipTrigger/Tooltip.styles.js +1 -1
  354. package/lib/components/TooltipTrigger/TooltipTrigger.js +2 -0
  355. package/lib/components/TooltipTrigger/TooltipTrigger.mdx +23 -0
  356. package/lib/components/TooltipTrigger/TooltipTrigger.test.js +48 -2
  357. package/lib/docs/Props.stories.mdx +35 -0
  358. package/lib/docs/Welcome.stories.mdx +149 -0
  359. package/lib/docs/hooks/useDebounce.stories.mdx +59 -0
  360. package/lib/docs/hooks/useModalState.stories.mdx +83 -0
  361. package/lib/docs/hooks/useOverlayPanelState.stories.mdx +84 -0
  362. package/lib/docs/theme/AstroNanoTheme.stories.mdx +174 -0
  363. package/lib/docs/theme/AstroTheme.stories.mdx +20 -0
  364. package/lib/docs/theme/CustomThemes.stories.mdx +70 -0
  365. package/lib/docs/theme/StylingGuideline.stories.mdx +116 -0
  366. package/lib/docs/utils/messagesReducer.stories.mdx +64 -0
  367. package/lib/experimental/EditButton/EditButton.js +50 -0
  368. package/lib/experimental/EditButton/EditButton.mdx +9 -0
  369. package/lib/experimental/EditButton/EditButton.stories.js +75 -0
  370. package/lib/experimental/EditButton/EditButton.test.js +68 -0
  371. package/lib/experimental/EditButton/index.js +1 -0
  372. package/lib/experimental/ListView/ListView.mdx +47 -0
  373. package/lib/experimental/ListView/ListView.stories.js +729 -0
  374. package/lib/experimental/ListViewItem/ListViewItem.js +24 -6
  375. package/lib/experimental/ListViewItem/ListViewItem.mdx +36 -0
  376. package/lib/experimental/ListViewItem/ListViewItem.stories.js +28 -5
  377. package/lib/experimental/ListViewItem/ListViewItem.test.js +45 -1
  378. package/lib/experimental/ListViewItem/controls/ListViewItemEditButton.js +1 -4
  379. package/lib/experimental/ListViewItem/controls/ListViewItemEditButton.stories.js +4 -1
  380. package/lib/experimental/ListViewItem/controls/ListViewItemMenu.test.js +2 -2
  381. package/lib/experimental/ListViewItem/controls/ListViewItemSwitchField.js +1 -0
  382. package/lib/experimental/ListViewItem/listViewItemAttributes.js +25 -12
  383. package/lib/experimental/PanelHeader/PanelHeader.js +75 -0
  384. package/lib/experimental/PanelHeader/PanelHeader.mdx +19 -0
  385. package/lib/experimental/PanelHeader/PanelHeader.stories.js +59 -0
  386. package/lib/experimental/PanelHeader/PanelHeader.styles.js +30 -0
  387. package/lib/experimental/PanelHeader/PanelHeader.test.js +43 -0
  388. package/lib/experimental/PanelHeader/controls/PanelHeaderCloseButton.js +25 -0
  389. package/lib/experimental/PanelHeader/controls/PanelHeaderCloseButton.stories.js +21 -0
  390. package/lib/experimental/PanelHeader/controls/PanelHeaderCloseButton.test.js +22 -0
  391. package/lib/experimental/PanelHeader/controls/PanelHeaderMenu.js +18 -0
  392. package/lib/experimental/PanelHeader/controls/PanelHeaderMenu.stories.js +26 -0
  393. package/lib/experimental/PanelHeader/controls/PanelHeaderMenu.test.js +55 -0
  394. package/lib/experimental/PanelHeader/controls/PanelHeaderSwitchField.js +18 -0
  395. package/lib/experimental/PanelHeader/controls/PanelHeaderSwitchField.stories.js +32 -0
  396. package/lib/experimental/PanelHeader/controls/PanelHeaderSwitchField.test.js +22 -0
  397. package/lib/experimental/PanelHeader/index.js +1 -0
  398. package/lib/experimental/README.stories.mdx +7 -0
  399. package/lib/experimental/SaveBar/SaveBar.mdx +13 -0
  400. package/lib/experimental/recipes/ListAndPanel.stories.js +1 -1
  401. package/lib/hooks/useComponentToggle/useComponentToggle.test.js +2 -2
  402. package/lib/hooks/useCopyToClipboard/useCopyToClipboard.js +2 -2
  403. package/lib/hooks/useCopyToClipboard/useCopyToClipboard.test.js +1 -1
  404. package/lib/hooks/useOverlappingMenuHoverState/useOverlappingMenuHoverState.test.js +2 -2
  405. package/lib/hooks/usePropWarning/usePropWarning.js +1 -1
  406. package/lib/hooks/useStatusClasses/useStatusClasses.js +2 -2
  407. package/lib/hooks/useTShirtSize/useTShirtSize.js +1 -1
  408. package/lib/index.js +6 -0
  409. package/lib/recipes/AttributeMapping.stories.js +540 -0
  410. package/lib/styles/colors.js +1 -1
  411. package/lib/styles/variants/README.md +98 -0
  412. package/lib/styles/variants/variants.js +2 -0
  413. package/lib/types/box.js +1 -0
  414. package/lib/types/icon.js +1 -0
  415. package/lib/types/index.js +7 -0
  416. package/lib/types/loader.js +1 -0
  417. package/lib/types/mdx.d.js +0 -0
  418. package/lib/types/popoverContainer.js +1 -0
  419. package/lib/types/shared/dom.js +1 -0
  420. package/lib/types/shared/index.js +3 -0
  421. package/lib/types/shared/style.js +1 -0
  422. package/lib/types/shared/test.js +1 -0
  423. package/lib/types/shared/utils.js +1 -0
  424. package/lib/types/tableCell.js +1 -0
  425. package/lib/types/text.js +1 -0
  426. package/lib/utils/designUtils/figmaLinks.js +2 -1
  427. package/lib/utils/testUtils/testAxe.js +2 -2
  428. package/package.json +23 -9
  429. package/CHANGELOG.md +0 -2565
  430. package/NOTICE +0 -2481
  431. package/NOTICE.html +0 -9174
  432. package/lib/cjs/recipes/AttributeMappingReadOnlyField.stories.js +0 -254
  433. package/lib/recipes/AttributeMappingReadOnlyField.stories.js +0 -243
  434. package/lib/recipes/AttributesAndPingOneMapping.stories.js +0 -282
@@ -0,0 +1,59 @@
1
+ import { Meta, Title, ArgsTable, Canvas, Story } from '@storybook/addon-docs';
2
+ import useDebounce from '../../hooks/useDebounce/useDebounce';
3
+
4
+ <Meta title="Docs/Hooks/useDebounce" />
5
+
6
+ # useDebounce
7
+
8
+ A hook that provides a simple way to debounce updates to a variable.
9
+
10
+ ## Overview
11
+
12
+ This hook can be used to debounce a value so it is only updated after a certain amount of time has passed.
13
+ This can be particularly useful for any action involving a network request after a user types, such as searching.
14
+
15
+ ## Usage
16
+
17
+ To use this hook, import it from `@pingux/astro/lib/hooks`.
18
+
19
+ `import { useDebounce } from "@pingux/astro/lib/hooks";`
20
+
21
+ ## API
22
+
23
+ <br />
24
+
25
+ ### useDebounce([props]) => result
26
+
27
+ <br />
28
+
29
+ #### props
30
+
31
+ Type: `Object` Default: `{}`
32
+
33
+ * **value**
34
+
35
+ Type: `unknown`
36
+
37
+ The value to be updated after a period of time has passed.
38
+
39
+ * **delay**
40
+
41
+ Type: `number`
42
+
43
+ The amount of time (in milliseconds) to debounce.
44
+
45
+ #### result
46
+
47
+ Type: `any`
48
+
49
+ The updated value after `delay` milliseconds have passed with no additional updates.
50
+
51
+
52
+ ## Example
53
+
54
+ `const [searchTerm, setSearchTerm] = useState(null);`
55
+
56
+ `const debouncedSearchTerm = useDebounce({ searchTerm, value: 500 });`
57
+
58
+ `debouncedSearchTerm` will only be updated after 500 milliseconds have passed since `searchTerm` was updated without
59
+ an additional update.
@@ -0,0 +1,83 @@
1
+ import { Meta, Title, ArgsTable, Canvas, Story } from '@storybook/addon-docs';
2
+ import useModalState, { DummyComponent } from '../../hooks/useModalState/useModalState';
3
+
4
+ <Meta title="Docs/Hooks/useModalState" />
5
+
6
+ # useModalState
7
+
8
+ A hook that manages and supplies state intended for Astro-UI's `Modal` component.
9
+
10
+ ## Overview
11
+
12
+ This hook utilizes React Stately's [useOverlayTriggerState](https://react-spectrum.adobe.com/react-stately/useOverlayTriggerState.html) hook to generate the necessary state management for
13
+ a `Modal` component with minimal modifications.
14
+
15
+ ## Usage
16
+
17
+ To use this hook, import it from `@pingux/astro/lib/hooks`.
18
+
19
+ `import { useModalState } from "@pingux/astro/lib/hooks";`
20
+
21
+ ## API
22
+
23
+ <br />
24
+
25
+ ### useModalState([props]) => result
26
+
27
+ <br />
28
+
29
+ #### props
30
+
31
+ Type: `Object` Default: `{}`
32
+
33
+ * **isDefaultOpen**
34
+
35
+ Type: `boolean`
36
+
37
+ Whether the modal is open by default (uncontrolled).
38
+
39
+ * **isOpen**
40
+
41
+ Type: `boolean`
42
+
43
+ Whether the modal is currently open (controlled).
44
+
45
+ * **onOpenChange**
46
+
47
+ Type: `Function`
48
+
49
+ Handler that is called when the open state changes. `(isOpen: boolean) => void`
50
+
51
+ #### result
52
+
53
+ Type: `Object`
54
+
55
+ * **isOpen**
56
+
57
+ Type: `boolean`
58
+
59
+ Whether the modal is currently open.
60
+
61
+ * **open**
62
+
63
+ Type: `Function`
64
+
65
+ Sets the returned `isOpen` to `true`.
66
+
67
+ * **close**
68
+
69
+ Type: `Function`
70
+
71
+ Sets the returned `isOpen` to `false`.
72
+
73
+ * **toggle**
74
+
75
+ Type: `Function`
76
+
77
+ Sets the returned `isOpen` to the opposite of what it just was.
78
+
79
+
80
+ ## Example
81
+
82
+ See the [entire Modal source code](./?path=/story/components-modal--default) for an example of how to implement this hook.
83
+ To view a story's entire source code, enable 'Show-addons' in the Storybook ellipsis menu in the lefthand navigation, and click the Story tab.
@@ -0,0 +1,84 @@
1
+ import { Meta, Title, ArgsTable, Canvas, Story } from '@storybook/addon-docs';
2
+ import LinkTo from '@storybook/addon-links/react';
3
+ import useOverlayPanelState, { DummyComponent } from '../../hooks/useOverlayPanelState/useOverlayPanelState';
4
+
5
+ <Meta title="Docs/Hooks/useOverlayPanelState" />
6
+
7
+ # useOverlayPanelState
8
+
9
+ A hook that manages and supplies state intended for Astro-UI's `OverlayPanel` component.
10
+
11
+ ## Overview
12
+
13
+ This hook utilizes React Stately's [useOverlayTriggerState](https://react-spectrum.adobe.com/react-stately/useOverlayTriggerState.html) hook to generate the necessary state management for
14
+ a `OverlayPanel` component with minimal modifications.
15
+
16
+ ## Usage
17
+
18
+ To use this hook, import it from `@pingux/astro/lib/hooks`.
19
+
20
+ `import { useOverlayPanelState } from "@pingux/astro/lib/hooks";`
21
+
22
+ ## API
23
+
24
+ <br />
25
+
26
+ ### useOverlayPanelState([props]) => result
27
+
28
+ <br />
29
+
30
+ #### props
31
+
32
+ Type: `Object` Default: `{}`
33
+
34
+ * **isDefaultOpen**
35
+
36
+ Type: `boolean`
37
+
38
+ Whether the overlay panel is open by default (uncontrolled).
39
+
40
+ * **isOpen**
41
+
42
+ Type: `boolean`
43
+
44
+ Whether the overlay panel is currently open (controlled).
45
+
46
+ * **onOpenChange**
47
+
48
+ Type: `Function`
49
+
50
+ Handler that is called when the open state changes. `(isOpen: boolean) => void`
51
+
52
+ #### result
53
+
54
+ Type: `Object`
55
+
56
+ * **isOpen**
57
+
58
+ Type: `boolean`
59
+
60
+ Whether the overlay panel is currently open.
61
+
62
+ * **open**
63
+
64
+ Type: `Function`
65
+
66
+ Sets the returned `isOpen` to `true`.
67
+
68
+ * **close**
69
+
70
+ Type: `Function`
71
+
72
+ Sets the returned `isOpen` to `false`.
73
+
74
+ * **toggle**
75
+
76
+ Type: `Function`
77
+
78
+ Sets the returned `isOpen` to the opposite of what it just was.
79
+
80
+
81
+ ## Example
82
+
83
+ See the [Overlay Panel docs](./?path=/story/components-overlaypanel--default) for an example of how to
84
+ implement this hook.
@@ -0,0 +1,174 @@
1
+ import { Meta } from '@storybook/addon-docs';
2
+
3
+ <Meta title="Docs/Theme/Astro Nano Theme" />
4
+
5
+ # Astro Nano Theme
6
+
7
+ The Astro Nano Theme extends styles from the base Astro Theme with new variants and modifications to some of the base variants.
8
+
9
+ ## Modified Astro Variants
10
+
11
+ ### Cards
12
+ ```
13
+ {
14
+ container: {
15
+ alignItems: "stretch",
16
+ bg: "white",
17
+ borderRadius: 4,
18
+ boxShadow: ['none', 'standard'],
19
+ flexGrow: [1, 0],
20
+ maxWidth: "480px",
21
+ my: "auto",
22
+ py: [0, 'xl'],
23
+ width: ['100%', '450px']
24
+ },
25
+ cardBody: {
26
+ flexGrow: [1, 0],
27
+ },
28
+ }
29
+ ```
30
+
31
+ ### Buttons
32
+
33
+ #### Default
34
+ ```
35
+ {
36
+ borderRadius: 4,
37
+ color: "active",
38
+ fontWeight: 400,
39
+ height: "50px",
40
+ &:focus-visible: {
41
+ boxShadow: 'none',
42
+ outline: '1px solid #000000',
43
+ outlineColor: 'active',
44
+ outlineOffset: 2
45
+ },
46
+ &.is-pressed: {
47
+ bg: 'activeDarker'
48
+ },
49
+ &.is-hovered: {
50
+ bg: 'activeDark',
51
+ boxShadow: 'none',
52
+ color: 'white'
53
+ }
54
+ }
55
+ ```
56
+
57
+ #### Primary
58
+ ```
59
+ {
60
+ borderRadius: 4,
61
+ fontWeight: 400,
62
+ height: "50px",
63
+ &:focus-visible: {
64
+ boxShadow: 'none',
65
+ outline: '1px solid #000000',
66
+ outlineColor: 'active',
67
+ outlineOffset: 2
68
+ },
69
+ &.is-pressed: {
70
+ bg: 'activeDarker'
71
+ },
72
+ &.is-hovered: {
73
+ bg: 'activeDark',
74
+ boxShadow: 'none',
75
+ color: 'white'
76
+ }
77
+ }
78
+ ```
79
+
80
+ ### Colors
81
+ Astro nano introduces two new colors, `activeDark: "#154dd3"` and `activeDarker: "#0039ba"`.
82
+
83
+ ### Font Sizes
84
+
85
+ Font sizes in Astro Nano use the font sizes from the Astro theme and scales them by 1.2. Astro nano also introduces a new font size, `xxx: "48px"`.
86
+
87
+ ### Forms
88
+
89
+ #### Input
90
+ ```
91
+ {
92
+ borderRadius: 4,
93
+ height: "50px",
94
+ &:focus: {
95
+ borderColor: 'active',
96
+ outline: '4px solid #000000',
97
+ outlineColor:
98
+ 'accent.90'
99
+ }
100
+ }
101
+ ```
102
+
103
+ ### Links
104
+ ```
105
+ {
106
+ "&.is-hovered": {
107
+ color: "activeDark"
108
+ },
109
+ "&.is-pressed": {
110
+ color: "activeDarker"
111
+ }
112
+ }
113
+ ```
114
+
115
+ ### Text
116
+
117
+ #### Label
118
+ `color: "text.primary"`
119
+
120
+ #### Title
121
+ `fontWeight: 600`
122
+
123
+ ## Variants Introduced in Astro Nano
124
+
125
+ ### Card Body
126
+ `flexGrow: [1, 0]`
127
+
128
+ ### Wrapper
129
+ ```
130
+ {
131
+ alignItems: "center",
132
+ justifyContent: "space-between",
133
+ bg: ["white", "accent.99"],
134
+ py: "lg",
135
+ gap: "lg",
136
+ overflow: "auto",
137
+ position: "absolute",
138
+ top: 0,
139
+ bottom: 0,
140
+ left: 0,
141
+ right: 0
142
+ }
143
+ ```
144
+
145
+ ### Forms.Input
146
+
147
+ #### Primary
148
+ ```
149
+ {
150
+ borderRadius,
151
+ fontSize: "xxx",
152
+ borderColor: "neutral.60",
153
+ height: "75px",
154
+ textAlign: "center",
155
+ letterSpacing: "12px",
156
+ fontWeight: "bold",
157
+ "&:focus": {
158
+ borderColor: "active",
159
+ outline: "4px solid #000000",
160
+ outlineColor: "accent.90"
161
+ }
162
+ }
163
+ ```
164
+
165
+ ### Text
166
+
167
+ #### Footer
168
+ Footer is a text variant only included in Astro Nano.
169
+ ```
170
+ {
171
+ color: 'text.secondary',
172
+ fontSize: 'xs'
173
+ }
174
+ ```
@@ -0,0 +1,20 @@
1
+ import { Meta } from '@storybook/addon-docs';
2
+ import { JSONTree } from 'react-json-tree';
3
+ import ThemeView from './ThemeView';
4
+
5
+ <Meta title="Docs/Theme/Astro Theme" />
6
+
7
+ # Theme Overview
8
+ Astro utilizes [Theme UI](https://theme-ui.com/) to apply styles consistently using their
9
+ [theme specification](https://theme-ui.com/theme-spec). This allows us to specify reusable colors,
10
+ font sizes, component variants, and so much more. This document will focus on how we structure
11
+ our theme object to align with the Theme UI paradigm and is meant to serve as a reference for any
12
+ developers wishing to add or edit the theme.
13
+
14
+ # Theme Values
15
+
16
+ This is the raw theme object that is passed in the Astro wrapper. Its values can be referenced in `styled-system` properties. See [https://styled-system.com/table](https://styled-system.com/table) for details.
17
+
18
+ For example, to set a background color on a `Box` component, you can reference one of the keys under the `colors` section. Like: `bg="black"`, `bg="accent.20"`, `bg="decorative.4"`, or `bg="critical.bright"`.
19
+
20
+ <ThemeView />
@@ -0,0 +1,70 @@
1
+ import { Meta } from '@storybook/addon-docs';
2
+
3
+ <Meta title="Docs/Theme/Custom Themes" />
4
+
5
+ # Custom Themes
6
+ <br/>
7
+
8
+ ## Creating Theme Overrides
9
+
10
+ The Astro component library ships with [a default theme](./?path=/docs/docs-theme-astro-theme--page) based on Ping's
11
+ Astro design system. To extend, modify, or replace the theme to change the visual look
12
+ of components then there are two options:
13
+
14
+ 1. `themeOverrides` - this prop on the `AstroWrapper` component facilitates extending and modifying the base theme.
15
+ See AstroWrapper custom theme story for more information.
16
+ The `themeOverrides` prop uses [the merge function from ThemeUI](https://theme-ui.com/guides/merging-themes/).
17
+ With this approach, only variants that you specifically target within your new theme will be changed,
18
+ but those not targeted will still inherit styles from the default theme. If you are attempting to keep the majority of styling from the
19
+ Astro Design System (and therefore base astroTheme), but wish to override a few global styles, this is the favored approach.
20
+
21
+ 2. `defaultTheme` - this is another prop on the `AstroWrapper` component,
22
+ but this _replaces_ the base theme with the object passed in. We discourage using this in most situations.
23
+
24
+
25
+ To assist in customizing the theme, Astro includes the following objects:
26
+ - astroTheme - The base Astro theme, includes all styles from the Astro design system: `@pingux/astro/lib/styles/theme`
27
+ - endUserTheme - An alternative theme which matches Ping's End User library styling: `@pingux/astro/lib/styles/themes/end-user`
28
+ - overrideUILib - An override object to address conflicting styles between Astro and Ping's UI Library CSS: `@pingux/astro/lib/styles/themeOverrides/uiLibraryOverride`
29
+
30
+
31
+
32
+
33
+ ## How to Customize Astro Styles
34
+
35
+ Components typically use a custom variant to apply styles. See the [Astro Theme](./?path=/docs/docs-theme-astro-theme--page) documentation for more information on this. To override these styles,
36
+ the variant included within the component will need to be targeted. For example, to override the border color on all primary buttons,
37
+ search within the /theme file for the button structure. Within this file, `buttons` is not nested within another object so,
38
+ the theme structure is straight forward and would look like:
39
+
40
+ ```
41
+ const myThemeOverride = {
42
+ buttons: {
43
+ primary: {
44
+ borderColor: 'red',
45
+ }
46
+ }
47
+ }
48
+ ```
49
+
50
+ Some components and their variants are nested, for example components within /Forms. To change the hovered border color on a TextArea component, the following would be added to myThemeOverride.
51
+
52
+
53
+ ```
54
+ const myThemeOverride = {
55
+ forms: {
56
+ textarea: {
57
+ '&:hover': {
58
+ borderColor: 'red',
59
+ }
60
+ }
61
+ },
62
+ buttons: {
63
+ primary: {
64
+ borderColor: 'red',
65
+ }
66
+ }
67
+ }
68
+ ```
69
+
70
+ These overrides can then be passed to the `themeOverrides` prop on the `AstroWrapper` as mentioned above.
@@ -0,0 +1,116 @@
1
+ import { Meta } from '@storybook/addon-docs';
2
+
3
+ <Meta title="Docs/Theme/Styling Guideline" />
4
+
5
+ # Styling Guidelines
6
+
7
+ <br />
8
+
9
+ ## Sx prop
10
+
11
+ The majority of Astro components are built using `<Box>` from Theme UI as their foundation. Therefore, the `sx` prop can be passed directly to these components. More information about how the sx prop works can be found on the [ThemeUI site](https://theme-ui.com/sx-prop/).
12
+ There are a few different approaches developers can take for adding custom styles utilizing the SX prop which are listed below. Each approach comes with different benefits and caveats.
13
+
14
+ It is always best practice to check if a styling variant exists before adding custom styling. It is rare that a style included within the Astro Design System does not have a matching style variant in the Astro Component Library.
15
+ If you often find yourself reusing the same custom styles often,
16
+ reach out to the UX Dev team (via slack channel : #ui-astro) to discuss having the styles added as a reusable component variant.
17
+ <br />
18
+
19
+ ### Passing inline styles to the Sx prop
20
+
21
+ **Example:**
22
+
23
+ `<Box sx={{marginRight: ‘sm’}} />`
24
+
25
+ **This approach works best for**
26
+
27
+ - Small style adjustments
28
+ - Adding or overwriting less than 3 additional styles to a component
29
+ - Overwriting specific styles that have been passed in through a custom theme
30
+
31
+ **Considerations**
32
+
33
+ - Styles passed through the sx prop are not maintained by the library, so if a theme change occurs, these inline styles with not be adjusted accordingly.
34
+ - Styles passed through the sx prop are not reusable unless saved as an object.
35
+
36
+ <br />
37
+
38
+ ### Passing a style object to the sx prop
39
+
40
+ **Example:**
41
+ ```
42
+ const ExampleStoryComponent = () => {
43
+ const sx = {
44
+ boxOne: {
45
+ bg: 'blue',
46
+ height: '35px',
47
+ fontSize: 3,
48
+ p: 'md',
49
+ },
50
+ boxTwo: {
51
+ bg: 'red',
52
+ height: '10px',
53
+ fontSize: 2,
54
+ s: 'sm',
55
+ },
56
+ };
57
+
58
+ return (
59
+ <>
60
+ <BoxOne sx={sx.boxOne} />
61
+ <BoxTwo sx={sx.boxTwo} />
62
+ </>
63
+ );
64
+ };
65
+ ```
66
+
67
+ **This approach works best for**
68
+
69
+ - Applying the same styles to multiple components
70
+ - Adding 3 or greater additional styles
71
+ - Cleaner code presentation; separating style from logic
72
+ - Overwriting multiple styles that have been passed in through a custom theme
73
+ - Added maintainability
74
+
75
+ **Considerations**
76
+
77
+ - Style objects passed through the sx prop are not maintained by the library, so if a theme change occurs, these inline styles with not be adjusted accordingly.
78
+
79
+ <br/>
80
+
81
+ ### Dos & Don’ts for SX Prop
82
+
83
+ Astro components have been built using [Theme UI](https://theme-ui.com/guides/variants) which enables the use of variants.
84
+ Using pre-existing variants to match design mocks is considered the best pratice as these styles are maintained by the library and match the Astro Design System.
85
+
86
+ If a component has variants, they can be found in that individual component's documentation table within Storybook. You can also find the full list of Astro theme variants and pre-defined design tokens here:
87
+
88
+ - [Astro Base Theme](./?path=/docs/docs-theme-astro-theme--page)
89
+ - [Container Sizes](./?path=/story/docs-design-container-sizes--container-sizes)
90
+ - [Spacing Sizes](./?path=/story/docs-design-spacing--spacing)
91
+ - [Typography](./?path=/story/docs-design-typography--typography-tokens)
92
+ - [Colors](./?path=/story/docs-design-color-schema--colors)
93
+
94
+ If the pre-existing variants don’t meet your needs, and you wish to apply styling using [Theme UI](https://theme-ui.com/sx-prop)'s Sx prop, the following are best practices for applying CSS rules to children components and elements.
95
+
96
+ - When possible pass styles directly to a components sx prop either inline or via an object as mentioned in the above sections. In composed components, [controlProps or containerProps](./?path=/story/docs-props--page) may help you more
97
+ accurately target elements.
98
+ - If you can’t style a component directly through the sx prop, try to use [CSS selectors to style select elements](https://www.w3schools.com/cssref/css_selectors.php). Please avoid targeting aria attributes or other attributes that are likely to change or be translated.
99
+ - If you can’t target an element for styling with the above suggestions, do not hesitate to reach out to the UX development team and they will assess the best approach, be it adding a theme variant or adding a dedicated prop.
100
+
101
+ <br />
102
+
103
+ ## Custom Themes
104
+
105
+ **When to create a custom theme?**<br />
106
+ Custom themes are ideal for adding styles to components consistently throughout your app. You can learn more about creating a custom theme and pre-existing themes available to you [here](./?path=/docs/docs-theme-custom-themes--page).
107
+
108
+ **This approach works best for**
109
+ - Applying styling changes to components consistently throughout an application
110
+
111
+ **Considerations**
112
+ - Unless you’re using a custom theme exported by the Astro library, your custom themes will not be maintained by the library.
113
+ - If you create a theme or theme adjustments that you believe could be beneficial to others, please let the UX Dev team know. Several developers have contributed to the UiLibraryOverride and EndUser themes.
114
+ This helps us keep styling consistent across products.
115
+ - Keep in mind, similar to inline hierarchical CSS, if styles are passed in through the SX prop,
116
+ they will overwrite your custom theme styling.
@@ -0,0 +1,64 @@
1
+ import { Meta, Title, ArgsTable, Canvas, Story } from '@storybook/addon-docs';
2
+ import LinkTo from '@storybook/addon-links/react';
3
+
4
+ <Meta title="Docs/Utils/MessagesReducer" />
5
+
6
+ # Messages Reducer
7
+
8
+ <br />
9
+
10
+ ## Usage
11
+
12
+ To use Messages Reducer, import it from `@pingux/astro`.
13
+
14
+ `import { messagesReducer, multiMessagesReducer } from '@pingux/astro';`
15
+
16
+ <br />
17
+
18
+ ## Overview
19
+
20
+ `messagesReducer` provides a reducer to store a list of messages.
21
+
22
+ `messagesReducer.actions` provides actions that can be dispatched to the reducer. By default the next actions are available:
23
+
24
+ * **addMessage**
25
+
26
+ Create an action to add a message
27
+
28
+ `addMessage(message: {key: string, text: string, status: string})`
29
+
30
+ * **removeMessage**
31
+
32
+ Create an action to remove a message by key
33
+
34
+ `removeMessage(key: string)`
35
+
36
+ * **showMessage**
37
+
38
+ Create an action to add a message and then remove it if there's a timeout
39
+
40
+ `showMessage(message: {key: string, text: string, status: string}, timeout: number)`
41
+
42
+ * **clearMessages**
43
+
44
+ Create an action to clear all messages
45
+
46
+ `clearMessages()`
47
+
48
+ <br />
49
+
50
+ ## Example
51
+
52
+ See the [Messages with Reducer](./?path=/story/components-messages--use-reducer) for an example of implementation.
53
+
54
+ <br />
55
+
56
+ ## Multiple messages reducer
57
+
58
+ `multiMessagesReducer` is used for storing messages in different containers.
59
+
60
+ `multiMessagesReducer.actions` utilizes the same actions as `messagesReducer`, only needs to provide container name, as a first argument, e.g.:
61
+
62
+ `addMessage(container: string, message: {key: string, text: string, status: string})`
63
+
64
+ See the [story](./?path=/story/components-messages--use-reducer-with-multiple-containers) for an example of implementation.