@planningcenter/tapestry-react 1.2.0 → 2.0.0-rc.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 (289) hide show
  1. package/dist/cjs/ActionsDropdown/ActionsDropdown.js +3 -3
  2. package/dist/cjs/Badge/Badge.js +41 -26
  3. package/dist/cjs/Badge/Status.js +2 -2
  4. package/dist/cjs/Button/Button.js +6 -1
  5. package/dist/cjs/Calendar/Calendar.js +5 -3
  6. package/dist/cjs/Card/Card.js +2 -0
  7. package/dist/cjs/Checkbox/Checkbox.js +3 -3
  8. package/dist/cjs/ChurchCenterStatus/ChurchCenterStatus.js +29 -16
  9. package/dist/cjs/ColumnView/ColumnView.js +5 -2
  10. package/dist/cjs/Combobox/ComboboxPopover.js +2 -2
  11. package/dist/cjs/DataTable/components/CheckboxCell.js +4 -4
  12. package/dist/cjs/DataTable/components/ColumnPicker.js +6 -5
  13. package/dist/cjs/DataTable/hooks/useColumnSort.js +1 -1
  14. package/dist/cjs/DataTable/utils/getParsedColumns.js +4 -4
  15. package/dist/cjs/DateField/DateField.js +1 -1
  16. package/dist/cjs/Drawer/Drawer.js +4 -1
  17. package/dist/cjs/Dropdown/Dropdown.js +1 -1
  18. package/dist/cjs/Dropdown/Link.js +3 -1
  19. package/dist/cjs/EditActions/EditActions.js +9 -3
  20. package/dist/cjs/Field/Field.js +1 -0
  21. package/dist/cjs/FieldSet/FieldSet.js +24 -10
  22. package/dist/cjs/FilterLayout/FilterLayout.js +2 -1
  23. package/dist/cjs/Form/Form.js +1 -1
  24. package/dist/cjs/GridView/GridView.js +6 -4
  25. package/dist/cjs/Group/Group.js +8 -3
  26. package/dist/cjs/HeadingUppercase/HeadingUppercase.js +2 -2
  27. package/dist/cjs/HelperDrawer/HelperDrawer.js +1 -1
  28. package/dist/cjs/Highlight/Highlight.js +11 -5
  29. package/dist/cjs/Icon/Status.js +4 -4
  30. package/dist/cjs/Input/InputBox.js +1 -1
  31. package/dist/cjs/List/ListItem.js +1 -1
  32. package/dist/cjs/Menu/Heading.js +4 -2
  33. package/dist/cjs/Menu/Item.js +5 -5
  34. package/dist/cjs/Pagination/Pagination.js +4 -2
  35. package/dist/cjs/Progress/Progress.js +12 -6
  36. package/dist/cjs/Radio/Radio.js +2 -2
  37. package/dist/cjs/RangeSlider/RangeSlider.js +10 -4
  38. package/dist/cjs/Scrim/Scrim.js +2 -2
  39. package/dist/cjs/Section/Section.js +14 -6
  40. package/dist/cjs/Select/Option.js +1 -1
  41. package/dist/cjs/Select/Select.js +1 -1
  42. package/dist/cjs/Sortable/SortableItem.js +1 -1
  43. package/dist/cjs/StackView/StackView.js +5 -5
  44. package/dist/cjs/StepperField/StepperField.js +9 -6
  45. package/dist/cjs/StepperProgress/StepperProgress.js +9 -5
  46. package/dist/cjs/Table/ColumnPicker.js +1 -1
  47. package/dist/cjs/Table/DragHandle.js +1 -1
  48. package/dist/cjs/Table/NavigationArrow.js +1 -1
  49. package/dist/cjs/Table/SubRowToggleCell.js +1 -1
  50. package/dist/cjs/Table/Table.js +1 -1
  51. package/dist/cjs/Tabs/Tab.js +1 -0
  52. package/dist/cjs/TileView/TileView.js +1 -1
  53. package/dist/cjs/TokenInput/DefaultToken.js +1 -1
  54. package/dist/cjs/Wizard/Wizard.js +2 -1
  55. package/dist/cjs/WrapView/WrapView.js +2 -27
  56. package/dist/cjs/hooks/use-accessibility-violation.js +1 -1
  57. package/dist/cjs/system/default-theme.js +8 -3
  58. package/dist/esm/ActionsDropdown/ActionsDropdown.js +3 -3
  59. package/dist/esm/Badge/Badge.js +42 -27
  60. package/dist/esm/Badge/Status.js +2 -2
  61. package/dist/esm/Button/Button.js +6 -1
  62. package/dist/esm/Calendar/Calendar.js +5 -3
  63. package/dist/esm/Card/Card.js +2 -3
  64. package/dist/esm/Checkbox/Checkbox.js +3 -3
  65. package/dist/esm/ChurchCenterStatus/ChurchCenterStatus.js +27 -15
  66. package/dist/esm/ColumnView/ColumnView.js +4 -2
  67. package/dist/esm/Combobox/ComboboxPopover.js +2 -2
  68. package/dist/esm/DataTable/components/CheckboxCell.js +4 -4
  69. package/dist/esm/DataTable/components/ColumnPicker.js +6 -5
  70. package/dist/esm/DataTable/hooks/useColumnSort.js +1 -1
  71. package/dist/esm/DataTable/utils/getParsedColumns.js +4 -4
  72. package/dist/esm/DateField/DateField.js +1 -1
  73. package/dist/esm/Drawer/Drawer.js +3 -1
  74. package/dist/esm/Dropdown/Dropdown.js +1 -1
  75. package/dist/esm/Dropdown/Link.js +3 -1
  76. package/dist/esm/EditActions/EditActions.js +8 -3
  77. package/dist/esm/Field/Field.js +1 -0
  78. package/dist/esm/FieldSet/FieldSet.js +22 -10
  79. package/dist/esm/FilterLayout/FilterLayout.js +2 -1
  80. package/dist/esm/Form/Form.js +1 -1
  81. package/dist/esm/GridView/GridView.js +5 -4
  82. package/dist/esm/Group/Group.js +8 -3
  83. package/dist/esm/HeadingUppercase/HeadingUppercase.js +3 -3
  84. package/dist/esm/HelperDrawer/HelperDrawer.js +1 -1
  85. package/dist/esm/Highlight/Highlight.js +9 -5
  86. package/dist/esm/Icon/Status.js +4 -4
  87. package/dist/esm/Input/InputBox.js +1 -1
  88. package/dist/esm/List/ListItem.js +1 -1
  89. package/dist/esm/Menu/Heading.js +4 -2
  90. package/dist/esm/Menu/Item.js +5 -5
  91. package/dist/esm/Pagination/Pagination.js +4 -2
  92. package/dist/esm/Progress/Progress.js +10 -6
  93. package/dist/esm/Radio/Radio.js +2 -2
  94. package/dist/esm/RangeSlider/RangeSlider.js +8 -4
  95. package/dist/esm/Scrim/Scrim.js +2 -2
  96. package/dist/esm/Section/Section.js +12 -6
  97. package/dist/esm/Select/Option.js +1 -1
  98. package/dist/esm/Select/Select.js +1 -1
  99. package/dist/esm/Sortable/SortableItem.js +1 -1
  100. package/dist/esm/StackView/StackView.js +4 -5
  101. package/dist/esm/StepperField/StepperField.js +10 -7
  102. package/dist/esm/StepperProgress/StepperProgress.js +8 -5
  103. package/dist/esm/Table/ColumnPicker.js +1 -1
  104. package/dist/esm/Table/DragHandle.js +1 -1
  105. package/dist/esm/Table/NavigationArrow.js +1 -1
  106. package/dist/esm/Table/SubRowToggleCell.js +1 -1
  107. package/dist/esm/Table/Table.js +1 -1
  108. package/dist/esm/Tabs/Tab.js +1 -0
  109. package/dist/esm/TileView/TileView.js +1 -1
  110. package/dist/esm/TokenInput/DefaultToken.js +1 -1
  111. package/dist/esm/Wizard/Wizard.js +2 -1
  112. package/dist/esm/WrapView/WrapView.js +2 -28
  113. package/dist/esm/hooks/use-accessibility-violation.js +1 -1
  114. package/dist/esm/system/default-theme.js +6 -2
  115. package/dist/types/Alert/Alert.d.ts +3 -0
  116. package/dist/types/Box/Box.d.ts +11 -2
  117. package/dist/types/Button/Button.d.ts +9 -1
  118. package/dist/types/Button/Input.d.ts +1 -1
  119. package/dist/types/Card/Card.d.ts +8 -1
  120. package/dist/types/ChurchCenterStatus/ChurchCenterStatus.d.ts +15 -1
  121. package/dist/types/GridView/GridView.d.ts +16 -4
  122. package/dist/types/Scrim/Scrim.d.ts +6 -1
  123. package/dist/types/StackView/StackView.d.ts +11 -0
  124. package/dist/types/Text/Text.d.ts +12 -0
  125. package/dist/types/TileView/TileView.d.ts +15 -7
  126. package/dist/types/WrapView/WrapView.d.ts +2 -1
  127. package/package.json +4 -3
  128. package/src/ActionsDropdown/ActionsDropdown.tsx +3 -3
  129. package/src/Alert/Alert.mdx +1 -0
  130. package/src/Alert/Alert.tsx +5 -0
  131. package/src/Avatar/Avatar.mdx +1 -0
  132. package/src/Badge/Badge.js +66 -25
  133. package/src/Badge/Badge.mdx +2 -1
  134. package/src/Badge/Status.js +2 -2
  135. package/src/Badge/Status.mdx +1 -0
  136. package/src/Box/Box.mdx +2 -1
  137. package/src/Box/Box.tsx +13 -2
  138. package/src/Button/Button.mdx +4 -3
  139. package/src/Button/Button.tsx +17 -1
  140. package/src/Button/Input.mdx +2 -2
  141. package/src/Calendar/Calendar.js +8 -3
  142. package/src/Calendar/Calendar.mdx +1 -0
  143. package/src/Card/Card.mdx +1 -0
  144. package/src/Card/Card.tsx +7 -1
  145. package/src/Checkbox/Checkbox.js +8 -3
  146. package/src/Checkbox/Checkbox.mdx +1 -0
  147. package/src/CheckboxCard/CheckboxCard.js +26 -1
  148. package/src/CheckboxCard/CheckboxCard.mdx +1 -0
  149. package/src/CheckboxGroup/CheckboxGroup.js +6 -0
  150. package/src/CheckboxGroup/CheckboxGroup.mdx +1 -0
  151. package/src/ChurchCenterStatus/ChurchCenterStatus.mdx +19 -0
  152. package/src/ChurchCenterStatus/ChurchCenterStatus.tsx +52 -20
  153. package/src/Collapse/Collapse.js +2 -0
  154. package/src/ColumnView/ColumnView.js +7 -3
  155. package/src/ColumnView/ColumnView.mdx +1 -0
  156. package/src/Combobox/Combobox.js +11 -1
  157. package/src/Combobox/Combobox.mdx +2 -1
  158. package/src/Combobox/ComboboxPopover.js +2 -2
  159. package/src/DataTable/DataTable.js +48 -0
  160. package/src/DataTable/DataTable.mdx +2 -2
  161. package/src/DataTable/components/CheckboxCell.js +5 -4
  162. package/src/DataTable/components/ColumnPicker.js +4 -4
  163. package/src/DataTable/hooks/useColumnSort.js +1 -1
  164. package/src/DataTable/utils/getParsedColumns.js +4 -4
  165. package/src/DateField/DateField.js +11 -1
  166. package/src/DateField/DateField.mdx +1 -0
  167. package/src/Divider/Divider.mdx +1 -0
  168. package/src/DragDrop/DragDrop.mdx +23 -9
  169. package/src/Drawer/Drawer.js +3 -0
  170. package/src/Drawer/Drawer.mdx +2 -1
  171. package/src/Dropdown/Dropdown.js +49 -3
  172. package/src/Dropdown/Dropdown.mdx +3 -2
  173. package/src/Dropdown/Link.js +3 -1
  174. package/src/EditActions/EditActions.js +18 -3
  175. package/src/EditActions/EditActions.mdx +1 -0
  176. package/src/Field/Field.js +16 -0
  177. package/src/Field/Field.mdx +1 -0
  178. package/src/FieldSet/FieldSet.js +35 -11
  179. package/src/FieldSet/FieldSet.mdx +1 -0
  180. package/src/FilterLayout/FilterLayout.mdx +1 -0
  181. package/src/FilterLayout/FilterLayout.tsx +4 -1
  182. package/src/Form/Form.js +1 -1
  183. package/src/Form/Form.mdx +26 -24
  184. package/src/GridView/GridView.mdx +2 -1
  185. package/src/GridView/GridView.tsx +27 -8
  186. package/src/Group/Group.mdx +8 -7
  187. package/src/Group/Group.tsx +6 -1
  188. package/src/Heading/Heading.js +6 -2
  189. package/src/Heading/Heading.mdx +1 -0
  190. package/src/HeadingUppercase/HeadingUppercase.js +9 -5
  191. package/src/HeadingUppercase/HeadingUppercase.mdx +1 -0
  192. package/src/HelperDrawer/HelperDrawer.js +10 -2
  193. package/src/HelperDrawer/HelperDrawer.mdx +1 -0
  194. package/src/Highlight/Highlight.js +6 -2
  195. package/src/Highlight/Highlight.mdx +1 -0
  196. package/src/Icon/Icon.js +6 -0
  197. package/src/Icon/Icon.mdx +42 -37
  198. package/src/Icon/Status.js +4 -4
  199. package/src/Input/Inline.js +11 -1
  200. package/src/Input/Inline.mdx +2 -1
  201. package/src/Input/Input.js +119 -1
  202. package/src/Input/Input.mdx +1 -6
  203. package/src/Input/InputBox.js +41 -1
  204. package/src/Input/InputBox.mdx +1 -0
  205. package/src/Input/InputField.js +32 -0
  206. package/src/Input/InputField.mdx +1 -0
  207. package/src/Input/InputLabel.mdx +1 -0
  208. package/src/Link/Link.js +10 -0
  209. package/src/Link/Link.mdx +2 -1
  210. package/src/LinkList/LinkList.js +7 -1
  211. package/src/LinkList/LinkList.mdx +1 -0
  212. package/src/List/List.js +25 -1
  213. package/src/List/List.mdx +1 -0
  214. package/src/List/ListItem.js +1 -1
  215. package/src/Logo/Logo.js +10 -1
  216. package/src/Logo/Logo.mdx +1 -0
  217. package/src/Menu/Heading.js +7 -1
  218. package/src/Menu/Item.js +5 -5
  219. package/src/Menu/Menu.js +7 -1
  220. package/src/Menu/Menu.mdx +2 -1
  221. package/src/Modal/Modal.js +1 -0
  222. package/src/Modal/Modal.mdx +1 -0
  223. package/src/NumberField/NumberField.js +19 -0
  224. package/src/Page/Page.mdx +1 -1
  225. package/src/PagerView/PagerView.js +1 -0
  226. package/src/PagerView/PagerView.mdx +9 -8
  227. package/src/Pagination/Pagination.js +2 -2
  228. package/src/Pagination/Pagination.mdx +1 -0
  229. package/src/Progress/Progress.js +8 -3
  230. package/src/Progress/Progress.mdx +1 -0
  231. package/src/Radio/Radio.js +4 -2
  232. package/src/Radio/Radio.mdx +1 -0
  233. package/src/RangeSlider/RangeSlider.js +11 -2
  234. package/src/RangeSlider/RangeSlider.mdx +13 -10
  235. package/src/ScreenReader/ScreenReader.js +6 -1
  236. package/src/ScreenReader/ScreenReader.mdx +1 -0
  237. package/src/Scrim/Scrim.mdx +1 -0
  238. package/src/Scrim/Scrim.tsx +8 -2
  239. package/src/Section/Section.js +15 -3
  240. package/src/Section/Section.mdx +1 -0
  241. package/src/SegmentedControl/SegmentedControl.mdx +3 -2
  242. package/src/SegmentedTabs/SegmentedTabs.js +2 -0
  243. package/src/SegmentedTabs/SegmentedTabs.mdx +1 -0
  244. package/src/Select/Option.js +1 -1
  245. package/src/Select/Select.js +63 -2
  246. package/src/Select/Select.mdx +1 -0
  247. package/src/Sidebar/Sidebar.js +7 -1
  248. package/src/Sidebar/Sidebar.mdx +1 -0
  249. package/src/Sortable/SortableItem.js +1 -1
  250. package/src/Spinner/Spinner.mdx +1 -0
  251. package/src/StackView/StackView.mdx +17 -1
  252. package/src/StackView/StackView.tsx +23 -8
  253. package/src/StepperField/StepperField.js +35 -6
  254. package/src/StepperField/StepperField.mdx +2 -2
  255. package/src/StepperProgress/StepperProgress.js +9 -10
  256. package/src/StepperProgress/StepperProgress.mdx +1 -0
  257. package/src/Summary/Summary.mdx +1 -0
  258. package/src/Tab/Tab.mdx +1 -0
  259. package/src/Table/ColumnPicker.js +1 -1
  260. package/src/Table/DragHandle.js +1 -1
  261. package/src/Table/NavigationArrow.js +1 -1
  262. package/src/Table/SubRowToggleCell.js +1 -1
  263. package/src/Table/Table.js +1 -1
  264. package/src/Table/Table.mdx +2 -2
  265. package/src/Tabs/Tab.js +1 -0
  266. package/src/Tabs/Tabs.js +5 -0
  267. package/src/Tabs/Tabs.mdx +1 -0
  268. package/src/Text/Text.mdx +1 -0
  269. package/src/Text/Text.tsx +12 -0
  270. package/src/TextArea/TextArea.js +7 -1
  271. package/src/TextArea/TextArea.mdx +1 -0
  272. package/src/TileView/TileView.mdx +1 -0
  273. package/src/TileView/TileView.tsx +17 -3
  274. package/src/TimeField/TimeField.mdx +1 -0
  275. package/src/TokenInput/DefaultToken.js +1 -1
  276. package/src/TokenInput/TokenInput.js +12 -6
  277. package/src/TokenInput/TokenInput.mdx +1 -0
  278. package/src/Toolbar/Toolbar.mdx +1 -0
  279. package/src/Tooltip/Tooltip.js +39 -0
  280. package/src/Tooltip/Tooltip.mdx +4 -3
  281. package/src/Wizard/Wizard.js +1 -1
  282. package/src/Wizard/Wizard.mdx +7 -2
  283. package/src/WrapView/WrapView.mdx +1 -0
  284. package/src/WrapView/WrapView.tsx +6 -28
  285. package/src/hooks/use-accessibility-violation.tsx +1 -1
  286. package/src/system/default-theme.ts +7 -2
  287. package/dist/cjs/icons.js +0 -126
  288. package/dist/esm/icons.js +0 -121
  289. package/src/icons.js +0 -121
@@ -12,21 +12,67 @@ import Item, { ITEM_DISPLAY_NAME } from './Item'
12
12
  import Link, { LINK_DISPLAY_NAME, LINK_DATA } from './Link'
13
13
 
14
14
  type Props = {
15
- /** Allows specifying a type or custom element that will be cloned and provided `Dropdown` trigger props. */
15
+ children?: React.ReactNode,
16
+
17
+ /** Allows specifying a type or custom element that will be cloned and provided `Dropdown` trigger props. (Defaults to a [Button](/button).) */
16
18
  triggerElement?: React.ElementType | React.ReactNode,
19
+
20
+ /** Gain access to the internal ref. */
21
+ innerRef?: any,
22
+
17
23
  /** Closes Popover upon selecting a `Dropdown.Item`. */
18
24
  closeOnSelect?: boolean,
25
+
19
26
  /** Forces Popover open for testing purposes. */
20
27
  forceOpen?: boolean,
28
+
21
29
  /** Externally control Popover open state on initial render. */
22
30
  defaultOpen?: boolean,
31
+
23
32
  /** Callback when Popover is opened. */
24
33
  onOpen?: boolean,
34
+
25
35
  /** Callback when Popover is closed. */
26
36
  onClose?: boolean,
37
+
27
38
  /** Overrides the default search function for selecting a dropdown item via keyboard. */
28
39
  onSearch?: func,
29
- /** * Accepts any valid [Popover](/popover) props. */
40
+
41
+ /** Attempts to keep popover in view clipping edges if too large. */
42
+ keepInView?: boolean,
43
+
44
+ /** Locks external scrollbars when open. */
45
+ lockScrollWhileOpen?: boolean,
46
+
47
+ /** Matches anchor and popover widths. */
48
+ matchWidths?: boolean | 'minimum',
49
+
50
+ /**
51
+ * `'top-start'
52
+ | 'top'
53
+ | 'top-end'
54
+ | 'right-start'
55
+ | 'right'
56
+ | 'right-end'
57
+ | 'bottom-start'
58
+ | 'bottom'
59
+ | 'bottom-end'
60
+ | 'left-start'
61
+ | 'left'
62
+ | 'left-end'`
63
+
64
+ * Where to place the popover.
65
+ */
66
+ placement?: string,
67
+
68
+ /**
69
+ * Where to render the popover into. Accepts an HTML element or selector.
70
+ * Uses the closest fixed parent or `document.body` by default. This will only
71
+ * be computed once on initial render.
72
+ */
73
+ renderTo?: HTMLElement | string,
74
+
75
+ /** Accepts any valid [Popover](/popover) props. */
30
76
  popoverProps?: object,
31
77
  }
32
78
 
@@ -169,7 +215,7 @@ class Dropdown extends Component<Props> {
169
215
  'aria-haspopup': true,
170
216
  'aria-expanded': isPopoverOpen,
171
217
  [arrowIconOnly ? 'icon' : 'iconRight']: {
172
- name: isPopoverOpen ? 'arrow-up' : 'arrow-down',
218
+ name: isPopoverOpen ? 'general.upCaret' : 'general.downCaret',
173
219
  size: 'sm',
174
220
  },
175
221
  title: arrowIconOnly ? 'arrow down' : restProps.title,
@@ -1,14 +1,15 @@
1
1
  ---
2
2
  title: Dropdown
3
3
  category: General
4
- summary: A compact way of displaying content or actionable items in a popover. Use [Select](/select) for selectable options if needed. Composes [Button](/button) and [Popover](/popover) components.
4
+ summary: A compact way of displaying content or actionable items in a popover. Use [Select](/select) for selectable options if needed.
5
+ propsSummary: Accepts [Button](/button) and [Popover](/popover) props.
5
6
  ---
6
7
 
7
8
  ### Items
8
9
 
9
10
  ```jsx live
10
11
  render(
11
- <Dropdown icon={{ name: 'cog' }} title="Folder settings" variant="outline">
12
+ <Dropdown icon={{ name: 'general.cog' }} title="Folder settings" variant="outline">
12
13
  <Dropdown.Item onSelect={() => console.log('edit folder')}>
13
14
  Edit Folder
14
15
  </Dropdown.Item>
@@ -7,7 +7,9 @@ export const LINK_DISPLAY_NAME = 'Dropdown.Link'
7
7
  export const LINK_DATA = 'link'
8
8
 
9
9
  class Link extends Component {
10
- static displayName = LINK_DISPLAY_NAME
10
+ // Graphql wasn't picking up the correct displayName when this was
11
+ // assigned to LINK_DISPLAY_NAME, but using a string works
12
+ static displayName = 'Dropdown.Link'
11
13
 
12
14
  render() {
13
15
  const { disabled, external, index, text, to, ...restProps } = this.props
@@ -1,15 +1,29 @@
1
+ // @flow
1
2
  import React, { Children, useEffect, useState } from 'react'
2
3
 
3
4
  import Button from '../Button'
4
5
  import StackView from '../StackView'
5
6
  import { useDocumentEvent, useFocus, useHover } from '../hooks'
7
+ import { useThemeProps } from '../system'
6
8
 
7
- function EditActions({ display, edit, loading, ...restProps }) {
9
+ type Props = {
10
+ /** Renders any custom component or HTML element when not in the edit state. */
11
+ display?: React.ReactNode,
12
+
13
+ /** Renders any custom component or HTML element, usually form elments to capture user values. */
14
+ edit?: React.ReactNode,
15
+
16
+ /** Shows a spinner if true and then optimistically shows a checkmark when false again. */
17
+ loading?: boolean,
18
+ }
19
+
20
+ function EditActions({ display, edit, loading, ...restProps }: Props) {
8
21
  const { focus, focusProps } = useFocus()
9
22
  const { hover, hoverProps } = useHover()
10
23
  const [on, setOn] = useState(false)
11
24
  const [showCheck, setShowCheck] = useState(false)
12
25
  const toggle = () => setOn((bool) => !bool)
26
+ const { buttonProps, ...themeProps } = useThemeProps('editActions', restProps)
13
27
 
14
28
  useEffect(() => {
15
29
  if (loading === false) {
@@ -35,14 +49,14 @@ function EditActions({ display, edit, loading, ...restProps }) {
35
49
  onClick={on ? undefined : () => setOn(true)}
36
50
  {...focusProps}
37
51
  {...hoverProps}
38
- {...restProps}
52
+ {...themeProps}
39
53
  >
40
54
  {Children.toArray(on ? edit : display)}
41
55
  <Button
42
56
  grow={0}
43
57
  title={on ? 'Close' : 'Edit'}
44
58
  icon={{
45
- name: showCheck ? 'checkmark' : on ? 'close' : 'pencil',
59
+ name: showCheck ? 'general.check' : on ? 'general.x' : 'general.pencil',
46
60
  color: showCheck ? 'green' : undefined,
47
61
  }}
48
62
  tooltip={{
@@ -53,6 +67,7 @@ function EditActions({ display, edit, loading, ...restProps }) {
53
67
  onClick={focus || on ? toggle : () => setOn(true)}
54
68
  opacity={focus || hover || on ? 1 : 0}
55
69
  spinner={on && loading ? { color: 'primary' } : undefined}
70
+ {...buttonProps}
56
71
  />
57
72
  </StackView>
58
73
  )
@@ -2,6 +2,7 @@
2
2
  title: EditActions
3
3
  category: General
4
4
  summary: Helper component that manages switching between initial and editing states of inline forms. It uses an optimisitic save that will render a checkmark after the loading prop has been set to `false`.
5
+ propsSummary: Accepts [StackView](/stackview) props.
5
6
  ---
6
7
 
7
8
  ```jsx live
@@ -9,6 +9,12 @@ import StackView from '../StackView'
9
9
  import { cloneChildren, generateId } from '../utils'
10
10
 
11
11
  type Props = {
12
+ /** Usually accepts form fields, such as `input` or `select`. */
13
+ children?: any,
14
+
15
+ /** Gain access to the internal ref. */
16
+ innerRef?: any,
17
+
12
18
  /** Label that describes field[s]. */
13
19
  label?: string | React.ReactNode,
14
20
 
@@ -24,6 +30,9 @@ type Props = {
24
30
  /** Renders label and field[s] inline. */
25
31
  inline?: boolean,
26
32
 
33
+ /** Renders label and field[s] smaller. */
34
+ compact?: boolean,
35
+
27
36
  /** Renders content into a [HelperDrawer](/helperdrawer) next to label. */
28
37
  helpContent?: string | React.ReactNode,
29
38
 
@@ -33,8 +42,14 @@ type Props = {
33
42
  /** Controls spacing between fields. */
34
43
  spacing?: number,
35
44
 
45
+ /** Controls distribution between fields, by [passing this prop to StackView](/stackview#distribution). (Defaults to "fill".) */
46
+ distribution?: number,
47
+
36
48
  /** State of field[s]. */
37
49
  state?: 'success' | 'error',
50
+
51
+ /** Places an icon to the left of the label. */
52
+ icon?: any,
38
53
  }
39
54
 
40
55
  class Field extends Component<Props> {
@@ -113,6 +128,7 @@ class Field extends Component<Props> {
113
128
  order={inline ? 0 : 1}
114
129
  grow={1}
115
130
  marginTop={inline || !label ? undefined : 1}
131
+ maxWidth="100%"
116
132
  spacing={spacing}
117
133
  >
118
134
  {cloneChildren(children, (child, { firstChild }) =>
@@ -2,6 +2,7 @@
2
2
  title: Field
3
3
  category: Forms
4
4
  summary: Composes [InputLabel](/inputlabel) and passes an `id` to the first child to pair labels and controls automatically.
5
+ propsSummary: Accepts [Box](/box) props.
5
6
  ---
6
7
 
7
8
  ```jsx live
@@ -5,8 +5,16 @@ import Heading from '../Heading'
5
5
  import StackView from '../StackView'
6
6
  import TileView from '../TileView'
7
7
  import Toolbar from '../Toolbar'
8
+ import { useThemeProps } from '../system'
8
9
 
9
10
  type Props = {
11
+ children?: any,
12
+
13
+ /**
14
+ * Accepts any valid [Heading](/heading) props.
15
+ */
16
+ headingProps?: object,
17
+
10
18
  /**
11
19
  * Maps to internal `Toolbar` prop.
12
20
  */
@@ -26,28 +34,44 @@ type Props = {
26
34
  * Maps to internal `TileView` prop.
27
35
  */
28
36
  spacing: number,
37
+
38
+ /**
39
+ * Accepts any valid [TileView](/tileview) props.
40
+ */
41
+ tileViewProps?: object,
29
42
  }
30
43
 
31
- function FieldSet({
32
- children,
33
- minCellWidth = 16,
34
- spacing = 1,
35
- helpContent,
36
- legend,
37
- ...restProps
38
- }: Props) {
44
+ function FieldSet({ children, helpContent, legend, ...restProps }: Props) {
45
+ const {
46
+ headingProps,
47
+ tileViewProps,
48
+ spacing = 1,
49
+ minCellWidth = 16,
50
+ ...themeProps
51
+ } = useThemeProps('fieldset', { ...restProps })
52
+
39
53
  return (
40
- <StackView as="fieldset" padding={0} margin={2} {...restProps}>
54
+ <StackView
55
+ as="fieldset"
56
+ padding={0}
57
+ margin={2}
58
+ {...themeProps}
59
+ {...restProps}
60
+ >
41
61
  <Toolbar
42
62
  title={
43
- <Heading as="legend" level={4}>
63
+ <Heading as="legend" level={4} {...headingProps}>
44
64
  {legend}
45
65
  </Heading>
46
66
  }
47
67
  helpContent={helpContent}
48
68
  marginBottom={1}
49
69
  />
50
- <TileView minCellWidth={minCellWidth} spacing={spacing}>
70
+ <TileView
71
+ minCellWidth={minCellWidth}
72
+ spacing={spacing}
73
+ {...tileViewProps}
74
+ >
51
75
  {children}
52
76
  </TileView>
53
77
  </StackView>
@@ -2,6 +2,7 @@
2
2
  title: FieldSet
3
3
  category: Forms
4
4
  summary: Used to group several controls as well as labels within a web form.
5
+ propsSummary: Accepts [StackView](/stackview) props.
5
6
  ---
6
7
 
7
8
  ```jsx live
@@ -2,6 +2,7 @@
2
2
  title: FilterLayout
3
3
  category: General
4
4
  summary: Used to display a filterable content area. Use with [DataTable](/datatable).
5
+ propsSummary: Accepts [Card](/card) props.
5
6
  ---
6
7
 
7
8
  ```jsx live
@@ -59,7 +59,10 @@ export function FilterLayout(props: Props) {
59
59
  radius={0}
60
60
  title="Filter"
61
61
  aria-label={sidebarOpen ? 'close filter' : 'open filter'}
62
- iconRight={{ name: sidebarOpen ? 'caret-left' : 'filter' }}
62
+ iconRight={{
63
+ name: sidebarOpen ? 'general.leftChevron' : 'general.threeReducingHorizontalBars',
64
+ size: sidebarOpen ? 'xs' : 'md'
65
+ }}
63
66
  onClick={toggleSidebar}
64
67
  />
65
68
  <Box visible={!(sidebarOpen && fill)} grow={1} shrink={1}>
package/src/Form/Form.js CHANGED
@@ -130,7 +130,7 @@ class Form extends React.Component<Props> {
130
130
  ...this.state,
131
131
  editButtonProps: {
132
132
  disabled: isSubmitting,
133
- icon: isEditing ? undefined : { name: 'pencil' },
133
+ icon: isEditing ? undefined : { name: 'general.pencil' },
134
134
  onClick: () => {
135
135
  // bail out if we've already triggered a submit in onBlur
136
136
  if (this.submitTimeoutId === null) {
package/src/Form/Form.mdx CHANGED
@@ -7,31 +7,33 @@ category: Forms
7
7
  render(() => {
8
8
  const [value, setValue] = React.useState({ name: "Dave's Band Tag Team" })
9
9
  return (
10
- <Form
11
- initialPayload={value}
12
- onSubmit={(payload, complete) => {
13
- setTimeout(() => {
14
- setValue(payload)
15
- complete()
16
- }, 1600)
17
- }}
18
- >
19
- {({ editButtonProps, getFieldProps }) => (
20
- <StackView
21
- minWidth={64}
22
- padding={2}
23
- spacing={1}
24
- backgroundColor="primary-light"
25
- >
26
- <StackView axis="horizontal" alignment="center" spacing={1}>
27
- <Input.Inline fontSize={0} light {...getFieldProps('name')} />
28
- <Button size="xs" theme="light" {...editButtonProps} />
29
- <Icon name="split" size="md" color="light-6" />
30
- <Icon name="tag" size="md" color="light-6" />
10
+ <ThemeProvider theme={{ icons }}>
11
+ <Form
12
+ initialPayload={value}
13
+ onSubmit={(payload, complete) => {
14
+ setTimeout(() => {
15
+ setValue(payload)
16
+ complete()
17
+ }, 1600)
18
+ }}
19
+ >
20
+ {({ editButtonProps, getFieldProps }) => (
21
+ <StackView
22
+ minWidth={64}
23
+ padding={2}
24
+ spacing={1}
25
+ backgroundColor="primary-light"
26
+ >
27
+ <StackView axis="horizontal" alignment="center" spacing={1}>
28
+ <Input.Inline fontSize={0} light {...getFieldProps('name')} />
29
+ <Button size="xs" theme="light" {...editButtonProps} />
30
+ <Icon name="services.split" size="md" color="light-6" />
31
+ <Icon name="services.tag" size="md" color="light-6" />
32
+ </StackView>
31
33
  </StackView>
32
- </StackView>
33
- )}
34
- </Form>
34
+ )}
35
+ </Form>
36
+ </ThemeProvider>
35
37
  )
36
38
  })
37
39
  ```
@@ -1,7 +1,8 @@
1
1
  ---
2
2
  title: GridView
3
3
  category: Layout
4
- summary: Lay out children in columns and rows. Wraps CSS grid styles in a simple API. Any direct children can use the `column|Start|End` or `row|Start|End` [shorthand properties](/system-props#css-grid) to place themselves on the grid. To learn more about how you can use CSS grid visit [learncssgrid.com](https://learncssgrid.com/).
4
+ summary: Lay out children in columns and rows. Wraps CSS grid styles in a simple API. To learn more about how you can use CSS grid visit [learncssgrid.com](https://learncssgrid.com/).
5
+ propsSummary: Accepts all valid HTML attributes.
5
6
  ---
6
7
 
7
8
  ```jsx live
@@ -5,6 +5,7 @@ import * as React from 'react'
5
5
 
6
6
  import { BoxProps } from '../Box'
7
7
  import splitStyles from '../system/split-styles'
8
+ import { spacingValue } from '../system'
8
9
  import { MediaQueries, Variants } from '../index'
9
10
  import { useVariant } from '../VariantProvider'
10
11
 
@@ -64,19 +65,25 @@ const gridViewPlugin = {
64
65
  styles.justifyItems = distribution
65
66
  }
66
67
  if (columnSpacing !== undefined && styles.gridColumnGap === undefined) {
67
- styles.gridColumnGap = columnSpacing * 8
68
+ styles.gridColumnGap = spacingValue(columnSpacing)
68
69
  }
69
70
  if (rowSpacing !== undefined && styles.gridRowGap === undefined) {
70
- styles.gridRowGap = rowSpacing * 8
71
+ styles.gridRowGap = spacingValue(rowSpacing)
71
72
  }
72
- if (spacing !== undefined && styles.gridGap === undefined) {
73
- styles.gridGap = spacing * 8
73
+ if (spacing !== undefined && styles.gap === undefined) {
74
+ styles.gap = spacingValue(spacing)
74
75
  }
75
76
  return styles
76
77
  },
77
78
  }
78
79
 
79
80
  export type GridViewProps = {
81
+ /** Any direct children can use the `column|Start|End` or `row|Start|End` [shorthand properties](/style-props#grid) to place themselves on the grid. */
82
+ children?: any
83
+
84
+ /** Render custom component or HTML element tag. (Defaults to a `<div>` element). */
85
+ as?: any
86
+
80
87
  /** The algorithm used to implicitly place grid items. Maps to CSS [gridAutoFlow](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-auto-flow) property. */
81
88
  autoFlow?: 'column' | 'row' | 'dense'
82
89
 
@@ -89,20 +96,32 @@ export type GridViewProps = {
89
96
  /** The columns of the grid. Maps to CSS [gridTemplateColumns](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-columns) property. */
90
97
  columns?: Array<any> | string
91
98
 
99
+ /** If true, sets `display: inline-grid`, otherwise it defaults to `display: grid` */
100
+ inline?: boolean
101
+
102
+ /** Gain access to the internal ref */
103
+ innerRef?: any
104
+
92
105
  /** The rows of the grid. Maps to CSS [gridTemplateRows](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-rows) property. */
93
106
  rows?: Array<any> | string
94
107
 
95
108
  /** Aligns content in a grid item along the column axis. Maps to CSS [alignItems](https://developer.mozilla.org/en-US/docs/Web/CSS/align-items) property. */
96
109
  alignment?: 'start' | 'end' | 'center' | 'stretch'
97
110
 
98
- /** The amount of space between children. Maps to CSS [gridGap](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-gap) property. */
99
- spacing?: number
111
+ /** The amount of space between children. Maps to CSS [gap](https://developer.mozilla.org/en-US/docs/Web/CSS/gap) property. */
112
+ spacing?: number | string
100
113
 
101
114
  /** The amount of space between columns. Maps to CSS [gridColumnGap](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column-gap) property. */
102
- columnSpacing?: number
115
+ columnSpacing?: number | string
103
116
 
104
117
  /** The amount of space between rows. Maps to CSS [gridRowGap](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row-gap) property. */
105
- rowSpacing?: number
118
+ rowSpacing?: number | string
119
+
120
+ /** Describes styles at various points in time. [Read about variants](/variants).*/
121
+ variants?: object
122
+
123
+ /** Describes props at different breakpoints. [Read about mediaQueries](/responsive). */
124
+ mediaQueries?: object
106
125
  } & BoxProps
107
126
 
108
127
  type Props = React.RefAttributes<any> &
@@ -2,24 +2,25 @@
2
2
  title: Group
3
3
  category: General
4
4
  summary: Used to lay out groups of elements like cards, buttons, and/or inputs.
5
+ propsSummary: Accepts [StackView](/stackview) props.
5
6
  ---
6
7
 
7
8
  ```jsx live
8
9
  render(
9
10
  <Group>
10
11
  <Button
11
- icon={{ name: 'email' }}
12
+ icon={{ name: 'general.envelope' }}
12
13
  tooltip={{ title: 'Email' }}
13
14
  variant="outline"
14
15
  />
15
16
  <Button
16
- icon={{ name: 'print' }}
17
+ icon={{ name: 'general.printer' }}
17
18
  tooltip={{ title: 'Print' }}
18
19
  variant="outline"
19
20
  />
20
21
  <Button
21
- icon={{ name: 'csv-export' }}
22
- tooltip={{ title: 'CSV Export' }}
22
+ icon={{ name: 'general.thickToBottomArrow' }}
23
+ tooltip={{ title: 'Download' }}
23
24
  variant="outline"
24
25
  />
25
26
  </Group>
@@ -40,7 +41,7 @@ render(
40
41
  color="grey-8"
41
42
  subdued
42
43
  >
43
- <Icon name="info" size="sm" color="grey-6" marginRight={2} />
44
+ <Icon name="general.outlinedInfoCircle" size="sm" color="grey-6" marginRight={2} />
44
45
  <Text>
45
46
  David is an <Link to="#">Organization Administrator</Link> with full
46
47
  Administrator permission everywhere.
@@ -60,7 +61,7 @@ render(
60
61
  <Group size="md">
61
62
  <Button title="Email" variant="outline" />
62
63
  <Button
63
- icon={{ name: 'print', color: 'foregroundSecondary' }}
64
+ icon={{ name: 'general.printer', color: 'foregroundSecondary' }}
64
65
  tooltip={{ title: 'Print' }}
65
66
  />
66
67
  </Group>
@@ -72,7 +73,7 @@ render(
72
73
  render(
73
74
  <Group radius={0} size="lg">
74
75
  <Input placeholder="Search things..." />
75
- <Button icon={{ name: 'search' }} tooltip={{ title: 'Search' }} />
76
+ <Button icon={{ name: 'general.search' }} tooltip={{ title: 'Search' }} />
76
77
  </Group>
77
78
  )
78
79
  ```
@@ -40,12 +40,17 @@ export function Group({
40
40
  const startRadius = isHorizontalLayout ? 'radiusLeft' : 'radiusTop'
41
41
  const endRadius = isHorizontalLayout ? 'radiusRight' : 'radiusBottom'
42
42
 
43
+ const marginBottom = isHorizontalLayout ? 0 : '-1px'
44
+ const marginRight = isHorizontalLayout ? '-1px' : 0
45
+
43
46
  return (
44
- <StackView axis={axis} spacing={-0.125} {...restProps}>
47
+ <StackView axis={axis} {...restProps}>
45
48
  {cloneChildren(children, (child, { firstChild, lastChild }) => ({
46
49
  ...childProps,
47
50
  [startRadius]: firstChild ? radiusValue : 0,
48
51
  [endRadius]: lastChild ? radiusValue : 0,
52
+ ...(!lastChild && { marginBottom }),
53
+ ...(!lastChild && { marginRight }),
49
54
  }))}
50
55
  </StackView>
51
56
  )
@@ -5,8 +5,12 @@ import Text from '../Text'
5
5
  import { useThemeValue } from '../system'
6
6
 
7
7
  type Props = {
8
- /** Sets the heading tag (1-6) and the respective font size corresponding to the index position (level - 1) in theme `fontSizes` */
9
- level?: 1 | 2 | 3 | 4 | 5 | 6,
8
+ children?: any,
9
+
10
+ /** Sets the heading tag (1-6) and the respective font size corresponding to the index position (level - 1) in theme `fontSizes`
11
+ * `1 | 2 | 3 | 4 | 5 | 6`
12
+ */
13
+ level?: number,
10
14
  }
11
15
 
12
16
  function Heading({ level = 1, ...restProps }: Props) {
@@ -2,6 +2,7 @@
2
2
  title: Heading
3
3
  category: General
4
4
  summary: Headings communicate the hierarchy of content to users and assistive technologies.
5
+ propsSummary: Accepts [Text](/text) props.
5
6
  ---
6
7
 
7
8
  ```jsx live
@@ -1,10 +1,15 @@
1
+ // @flow
1
2
  import React from 'react'
2
3
 
3
4
  import Text from '../Text'
4
- import { useThemeValue } from '../system'
5
+ import { useThemeProps } from '../system'
5
6
 
6
- function HeadingUppercase({ children, ...restProps }) {
7
- const themedProps = useThemeValue('HeadingUppercase')
7
+ type Props = {
8
+ children?: any,
9
+ }
10
+
11
+ function HeadingUppercase({ children, ...restProps }: Props) {
12
+ const themeProps = useThemeProps('HeadingUppercase', restProps)
8
13
  return (
9
14
  <Text
10
15
  as="span"
@@ -15,8 +20,7 @@ function HeadingUppercase({ children, ...restProps }) {
15
20
  color="foregroundSecondary"
16
21
  shrink={0}
17
22
  margin={0}
18
- {...themedProps}
19
- {...restProps}
23
+ {...themeProps}
20
24
  >
21
25
  {children}
22
26
  </Text>
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: HeadingUppercase
3
3
  category: General
4
+ propsSummary: Accepts [Text](/text) props.
4
5
  ---
5
6
 
6
7
  ```jsx live
@@ -1,3 +1,4 @@
1
+ // @flow
1
2
  /** @jsxRuntime classic */
2
3
  /** @jsx jsx */
3
4
  import { jsx } from '@emotion/core'
@@ -22,7 +23,7 @@ function Toggle({ drawerId, ...restProps }) {
22
23
  )
23
24
  return (
24
25
  <Button
25
- icon={{ name: 'info' }}
26
+ icon={{ name: 'general.outlinedInfoCircle' }}
26
27
  tooltip={{ title: 'More info' }}
27
28
  size="xs"
28
29
  theme={false}
@@ -35,7 +36,14 @@ function Toggle({ drawerId, ...restProps }) {
35
36
  )
36
37
  }
37
38
 
38
- function HelperDrawer({ children, id, ...restProps }) {
39
+ type Props = {
40
+ children?: any,
41
+
42
+ /** Used by the `HelperDrawer.Toggle` to connect to. */
43
+ id?: string | number,
44
+ }
45
+
46
+ function HelperDrawer({ children, id, ...restProps }: Props) {
39
47
  const [open, setOpen] = useState(false)
40
48
  useEffect(() => {
41
49
  drawerToggles[id] = () => setOpen((open) => !open)
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: HelperDrawer
3
3
  category: General
4
+ propsSummary: Accepts [Text](/text) props.
4
5
  ---
5
6
 
6
7
  ```jsx live