@planningcenter/tapestry-react 1.4.0 → 2.0.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 (319) 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/Calendar/Calendar.js +5 -3
  5. package/dist/cjs/Card/Card.js +2 -0
  6. package/dist/cjs/Checkbox/Checkbox.js +3 -3
  7. package/dist/cjs/ChurchCenterStatus/ChurchCenterStatus.js +4 -4
  8. package/dist/cjs/ColumnView/ColumnView.js +5 -2
  9. package/dist/cjs/Combobox/ComboboxPopover.js +2 -2
  10. package/dist/cjs/DataTable/components/CheckboxCell.js +4 -4
  11. package/dist/cjs/DataTable/components/ColumnPicker.js +6 -5
  12. package/dist/cjs/DataTable/hooks/useCollapsibleRows.js +1 -1
  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/Dropdown.test.js +194 -19
  19. package/dist/cjs/Dropdown/Link.js +3 -1
  20. package/dist/cjs/EditActions/EditActions.js +9 -3
  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 +10 -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 +1 -0
  33. package/dist/cjs/Modal/Modal.test.js +156 -0
  34. package/dist/cjs/Pagination/Pagination.js +4 -2
  35. package/dist/cjs/Popover/Popover.js +4 -0
  36. package/dist/cjs/Popover/Popover.test.js +65 -0
  37. package/dist/cjs/Popover/rewireTabOrder.js +13 -30
  38. package/dist/cjs/Progress/Progress.js +12 -6
  39. package/dist/cjs/Radio/Radio.js +2 -2
  40. package/dist/cjs/RangeSlider/RangeSlider.js +10 -4
  41. package/dist/cjs/Scrim/Scrim.js +2 -2
  42. package/dist/cjs/Section/Section.js +14 -6
  43. package/dist/cjs/Select/Option.js +1 -1
  44. package/dist/cjs/Select/Select.js +10 -1
  45. package/dist/cjs/Sidebar/Sidebar.js +4 -3
  46. package/dist/cjs/Sortable/SortableItem.js +1 -1
  47. package/dist/cjs/StackView/StackView.js +5 -5
  48. package/dist/cjs/StepperField/StepperField.js +9 -6
  49. package/dist/cjs/StepperProgress/StepperProgress.js +9 -5
  50. package/dist/cjs/Table/ColumnPicker.js +1 -1
  51. package/dist/cjs/Table/DragHandle.js +1 -1
  52. package/dist/cjs/Table/NavigationArrow.js +1 -1
  53. package/dist/cjs/Table/SubRowToggleCell.js +1 -1
  54. package/dist/cjs/Table/Table.js +4 -6
  55. package/dist/cjs/Tabs/Tab.js +1 -0
  56. package/dist/cjs/ThemeProvider/ThemeProvider.js +5 -5
  57. package/dist/cjs/TileView/TileView.js +1 -1
  58. package/dist/cjs/TokenInput/DefaultToken.js +1 -1
  59. package/dist/cjs/Wizard/Wizard.js +2 -1
  60. package/dist/cjs/WrapView/WrapView.js +2 -27
  61. package/dist/cjs/hooks/use-accessibility-violation.js +1 -1
  62. package/dist/cjs/hooks/useConstant.js +23 -0
  63. package/dist/cjs/system/default-theme.js +8 -3
  64. package/dist/cjs/system/utils.js +2 -2
  65. package/dist/cjs/utils.js +3 -3
  66. package/dist/esm/ActionsDropdown/ActionsDropdown.js +3 -3
  67. package/dist/esm/Badge/Badge.js +42 -27
  68. package/dist/esm/Badge/Status.js +2 -2
  69. package/dist/esm/Calendar/Calendar.js +5 -3
  70. package/dist/esm/Card/Card.js +2 -3
  71. package/dist/esm/Checkbox/Checkbox.js +3 -3
  72. package/dist/esm/ChurchCenterStatus/ChurchCenterStatus.js +4 -4
  73. package/dist/esm/ColumnView/ColumnView.js +4 -2
  74. package/dist/esm/Combobox/ComboboxPopover.js +2 -2
  75. package/dist/esm/DataTable/components/CheckboxCell.js +4 -4
  76. package/dist/esm/DataTable/components/ColumnPicker.js +6 -5
  77. package/dist/esm/DataTable/hooks/useCollapsibleRows.js +1 -1
  78. package/dist/esm/DataTable/hooks/useColumnSort.js +1 -1
  79. package/dist/esm/DataTable/utils/getParsedColumns.js +4 -4
  80. package/dist/esm/DateField/DateField.js +1 -1
  81. package/dist/esm/Drawer/Drawer.js +3 -1
  82. package/dist/esm/Dropdown/Dropdown.js +1 -1
  83. package/dist/esm/Dropdown/Dropdown.test.js +158 -17
  84. package/dist/esm/Dropdown/Link.js +3 -1
  85. package/dist/esm/EditActions/EditActions.js +8 -3
  86. package/dist/esm/FieldSet/FieldSet.js +22 -10
  87. package/dist/esm/FilterLayout/FilterLayout.js +2 -1
  88. package/dist/esm/Form/Form.js +1 -1
  89. package/dist/esm/GridView/GridView.js +5 -4
  90. package/dist/esm/Group/Group.js +10 -3
  91. package/dist/esm/HeadingUppercase/HeadingUppercase.js +3 -3
  92. package/dist/esm/HelperDrawer/HelperDrawer.js +1 -1
  93. package/dist/esm/Highlight/Highlight.js +9 -5
  94. package/dist/esm/Icon/Status.js +4 -4
  95. package/dist/esm/Input/InputBox.js +1 -1
  96. package/dist/esm/List/ListItem.js +1 -1
  97. package/dist/esm/Menu/Heading.js +1 -0
  98. package/dist/esm/Modal/Modal.test.js +122 -0
  99. package/dist/esm/Pagination/Pagination.js +4 -2
  100. package/dist/esm/Popover/Popover.js +4 -0
  101. package/dist/esm/Popover/Popover.test.js +51 -0
  102. package/dist/esm/Popover/rewireTabOrder.js +13 -33
  103. package/dist/esm/Progress/Progress.js +10 -6
  104. package/dist/esm/Radio/Radio.js +2 -2
  105. package/dist/esm/RangeSlider/RangeSlider.js +8 -4
  106. package/dist/esm/Scrim/Scrim.js +2 -2
  107. package/dist/esm/Section/Section.js +12 -6
  108. package/dist/esm/Select/Option.js +1 -1
  109. package/dist/esm/Select/Select.js +10 -1
  110. package/dist/esm/Sidebar/Sidebar.js +4 -2
  111. package/dist/esm/Sortable/SortableItem.js +1 -1
  112. package/dist/esm/StackView/StackView.js +4 -5
  113. package/dist/esm/StepperField/StepperField.js +10 -7
  114. package/dist/esm/StepperProgress/StepperProgress.js +8 -5
  115. package/dist/esm/Table/ColumnPicker.js +1 -1
  116. package/dist/esm/Table/DragHandle.js +1 -1
  117. package/dist/esm/Table/NavigationArrow.js +1 -1
  118. package/dist/esm/Table/SubRowToggleCell.js +1 -1
  119. package/dist/esm/Table/Table.js +2 -3
  120. package/dist/esm/Tabs/Tab.js +1 -0
  121. package/dist/esm/ThemeProvider/ThemeProvider.js +1 -1
  122. package/dist/esm/TileView/TileView.js +1 -1
  123. package/dist/esm/TokenInput/DefaultToken.js +1 -1
  124. package/dist/esm/Wizard/Wizard.js +2 -1
  125. package/dist/esm/WrapView/WrapView.js +2 -28
  126. package/dist/esm/hooks/use-accessibility-violation.js +1 -1
  127. package/dist/esm/hooks/useConstant.js +15 -0
  128. package/dist/esm/system/default-theme.js +6 -2
  129. package/dist/esm/system/utils.js +1 -1
  130. package/dist/esm/utils.js +3 -3
  131. package/dist/types/Alert/Alert.d.ts +3 -0
  132. package/dist/types/Box/Box.d.ts +11 -2
  133. package/dist/types/Button/Button.d.ts +9 -1
  134. package/dist/types/Button/Input.d.ts +1 -1
  135. package/dist/types/Card/Card.d.ts +8 -1
  136. package/dist/types/Dropdown/Dropdown.test.d.ts +1 -1
  137. package/dist/types/GridView/GridView.d.ts +16 -4
  138. package/dist/types/Group/Group.d.ts +5 -1
  139. package/dist/types/Modal/Modal.test.d.ts +1 -0
  140. package/dist/types/Popover/Popover.test.d.ts +1 -0
  141. package/dist/types/Scrim/Scrim.d.ts +6 -1
  142. package/dist/types/StackView/StackView.d.ts +11 -0
  143. package/dist/types/Text/Text.d.ts +12 -0
  144. package/dist/types/TileView/TileView.d.ts +15 -7
  145. package/dist/types/WrapView/WrapView.d.ts +2 -1
  146. package/dist/types/hooks/useConstant.d.ts +1 -0
  147. package/package.json +16 -24
  148. package/src/ActionsDropdown/ActionsDropdown.tsx +3 -3
  149. package/src/Alert/Alert.mdx +1 -0
  150. package/src/Alert/Alert.tsx +5 -0
  151. package/src/Avatar/Avatar.mdx +1 -0
  152. package/src/Badge/Badge.js +66 -25
  153. package/src/Badge/Badge.mdx +2 -1
  154. package/src/Badge/Status.js +2 -2
  155. package/src/Badge/Status.mdx +1 -0
  156. package/src/Box/Box.mdx +2 -1
  157. package/src/Box/Box.tsx +13 -2
  158. package/src/Button/Button.mdx +4 -3
  159. package/src/Button/Button.tsx +11 -0
  160. package/src/Button/Input.mdx +2 -2
  161. package/src/Calendar/Calendar.js +8 -3
  162. package/src/Calendar/Calendar.mdx +1 -0
  163. package/src/Card/Card.mdx +1 -0
  164. package/src/Card/Card.tsx +7 -1
  165. package/src/Checkbox/Checkbox.js +8 -3
  166. package/src/Checkbox/Checkbox.mdx +1 -0
  167. package/src/CheckboxCard/CheckboxCard.js +26 -1
  168. package/src/CheckboxCard/CheckboxCard.mdx +1 -0
  169. package/src/CheckboxGroup/CheckboxGroup.js +6 -0
  170. package/src/CheckboxGroup/CheckboxGroup.mdx +1 -0
  171. package/src/ChurchCenterStatus/ChurchCenterStatus.mdx +1 -0
  172. package/src/ChurchCenterStatus/ChurchCenterStatus.tsx +4 -4
  173. package/src/Collapse/Collapse.js +2 -0
  174. package/src/ColumnView/ColumnView.js +7 -3
  175. package/src/ColumnView/ColumnView.mdx +1 -0
  176. package/src/Combobox/Combobox.js +11 -1
  177. package/src/Combobox/Combobox.mdx +2 -1
  178. package/src/Combobox/ComboboxPopover.js +2 -2
  179. package/src/DataTable/DataTable.js +48 -0
  180. package/src/DataTable/DataTable.mdx +2 -2
  181. package/src/DataTable/components/CheckboxCell.js +5 -4
  182. package/src/DataTable/components/ColumnPicker.js +4 -4
  183. package/src/DataTable/hooks/useCollapsibleRows.js +1 -1
  184. package/src/DataTable/hooks/useColumnSort.js +1 -1
  185. package/src/DataTable/utils/getParsedColumns.js +4 -4
  186. package/src/DateField/DateField.js +11 -1
  187. package/src/DateField/DateField.mdx +1 -0
  188. package/src/Divider/Divider.mdx +1 -0
  189. package/src/DragDrop/DragDrop.mdx +23 -9
  190. package/src/Drawer/Drawer.js +3 -0
  191. package/src/Drawer/Drawer.mdx +2 -1
  192. package/src/Dropdown/Dropdown.js +49 -3
  193. package/src/Dropdown/Dropdown.mdx +3 -2
  194. package/src/Dropdown/Dropdown.test.tsx +128 -17
  195. package/src/Dropdown/Link.js +3 -1
  196. package/src/EditActions/EditActions.js +18 -3
  197. package/src/EditActions/EditActions.mdx +1 -0
  198. package/src/Field/Field.js +15 -0
  199. package/src/Field/Field.mdx +1 -0
  200. package/src/FieldSet/FieldSet.js +35 -11
  201. package/src/FieldSet/FieldSet.mdx +1 -0
  202. package/src/FilterLayout/FilterLayout.mdx +1 -0
  203. package/src/FilterLayout/FilterLayout.tsx +4 -1
  204. package/src/Form/Form.js +1 -1
  205. package/src/Form/Form.mdx +26 -24
  206. package/src/GridView/GridView.mdx +2 -1
  207. package/src/GridView/GridView.tsx +27 -8
  208. package/src/Group/Group.mdx +8 -7
  209. package/src/Group/Group.tsx +12 -1
  210. package/src/Heading/Heading.js +6 -2
  211. package/src/Heading/Heading.mdx +1 -0
  212. package/src/HeadingUppercase/HeadingUppercase.js +9 -5
  213. package/src/HeadingUppercase/HeadingUppercase.mdx +1 -0
  214. package/src/HelperDrawer/HelperDrawer.js +10 -2
  215. package/src/HelperDrawer/HelperDrawer.mdx +1 -0
  216. package/src/Highlight/Highlight.js +6 -2
  217. package/src/Highlight/Highlight.mdx +1 -0
  218. package/src/Icon/Icon.js +6 -0
  219. package/src/Icon/Icon.mdx +42 -37
  220. package/src/Icon/Status.js +4 -4
  221. package/src/Input/Inline.js +11 -1
  222. package/src/Input/Inline.mdx +2 -1
  223. package/src/Input/Input.js +119 -1
  224. package/src/Input/Input.mdx +1 -6
  225. package/src/Input/InputBox.js +41 -1
  226. package/src/Input/InputBox.mdx +1 -0
  227. package/src/Input/InputField.js +32 -0
  228. package/src/Input/InputField.mdx +1 -0
  229. package/src/Input/InputLabel.mdx +1 -0
  230. package/src/Link/Link.js +10 -0
  231. package/src/Link/Link.mdx +2 -1
  232. package/src/LinkList/LinkList.js +7 -1
  233. package/src/LinkList/LinkList.mdx +1 -0
  234. package/src/List/List.js +25 -1
  235. package/src/List/List.mdx +1 -0
  236. package/src/List/ListItem.js +1 -1
  237. package/src/Logo/Logo.js +10 -1
  238. package/src/Logo/Logo.mdx +1 -0
  239. package/src/Menu/Heading.js +1 -0
  240. package/src/Menu/Menu.js +7 -1
  241. package/src/Menu/Menu.mdx +2 -1
  242. package/src/Modal/Modal.js +1 -0
  243. package/src/Modal/Modal.mdx +1 -0
  244. package/src/Modal/Modal.test.tsx +113 -0
  245. package/src/NumberField/NumberField.js +19 -0
  246. package/src/Page/Page.mdx +1 -1
  247. package/src/PagerView/PagerView.js +1 -0
  248. package/src/PagerView/PagerView.mdx +9 -8
  249. package/src/Pagination/Pagination.js +2 -2
  250. package/src/Pagination/Pagination.mdx +1 -0
  251. package/src/Popover/Popover.test.tsx +62 -0
  252. package/src/Popover/Popover.tsx +3 -0
  253. package/src/Popover/rewireTabOrder.ts +24 -42
  254. package/src/Progress/Progress.js +8 -3
  255. package/src/Progress/Progress.mdx +1 -0
  256. package/src/Radio/Radio.js +4 -2
  257. package/src/Radio/Radio.mdx +1 -0
  258. package/src/RangeSlider/RangeSlider.js +11 -2
  259. package/src/RangeSlider/RangeSlider.mdx +13 -10
  260. package/src/ScreenReader/ScreenReader.js +6 -1
  261. package/src/ScreenReader/ScreenReader.mdx +1 -0
  262. package/src/Scrim/Scrim.mdx +1 -0
  263. package/src/Scrim/Scrim.tsx +8 -2
  264. package/src/Section/Section.js +15 -3
  265. package/src/Section/Section.mdx +1 -0
  266. package/src/SegmentedControl/SegmentedControl.mdx +3 -2
  267. package/src/SegmentedTabs/SegmentedTabs.js +2 -0
  268. package/src/SegmentedTabs/SegmentedTabs.mdx +1 -0
  269. package/src/Select/Option.js +1 -1
  270. package/src/Select/Select.js +69 -2
  271. package/src/Select/Select.mdx +1 -0
  272. package/src/Sidebar/Sidebar.js +14 -6
  273. package/src/Sidebar/Sidebar.mdx +1 -0
  274. package/src/Sortable/SortableItem.js +1 -1
  275. package/src/Spinner/Spinner.mdx +1 -0
  276. package/src/StackView/StackView.mdx +17 -1
  277. package/src/StackView/StackView.tsx +23 -8
  278. package/src/StepperField/StepperField.js +35 -6
  279. package/src/StepperField/StepperField.mdx +2 -2
  280. package/src/StepperProgress/StepperProgress.js +9 -10
  281. package/src/StepperProgress/StepperProgress.mdx +1 -0
  282. package/src/Summary/Summary.mdx +1 -0
  283. package/src/Tab/Tab.mdx +1 -0
  284. package/src/Table/ColumnPicker.js +1 -1
  285. package/src/Table/DragHandle.js +1 -1
  286. package/src/Table/NavigationArrow.js +1 -1
  287. package/src/Table/SubRowToggleCell.js +1 -1
  288. package/src/Table/Table.js +2 -3
  289. package/src/Table/Table.mdx +2 -2
  290. package/src/Tabs/Tab.js +1 -0
  291. package/src/Tabs/Tabs.js +5 -0
  292. package/src/Tabs/Tabs.mdx +1 -0
  293. package/src/Text/Text.mdx +1 -0
  294. package/src/Text/Text.tsx +12 -0
  295. package/src/TextArea/TextArea.js +7 -1
  296. package/src/TextArea/TextArea.mdx +1 -0
  297. package/src/ThemeProvider/ThemeProvider.tsx +1 -1
  298. package/src/TileView/TileView.mdx +1 -0
  299. package/src/TileView/TileView.tsx +17 -3
  300. package/src/TimeField/TimeField.mdx +1 -0
  301. package/src/TokenInput/DefaultToken.js +1 -1
  302. package/src/TokenInput/TokenInput.js +12 -6
  303. package/src/TokenInput/TokenInput.mdx +1 -0
  304. package/src/Toolbar/Toolbar.mdx +1 -0
  305. package/src/Tooltip/Tooltip.js +39 -0
  306. package/src/Tooltip/Tooltip.mdx +4 -3
  307. package/src/Wizard/Wizard.js +1 -1
  308. package/src/Wizard/Wizard.mdx +7 -2
  309. package/src/WrapView/WrapView.mdx +1 -0
  310. package/src/WrapView/WrapView.tsx +6 -28
  311. package/src/hooks/use-accessibility-violation.tsx +1 -1
  312. package/src/hooks/useConstant.ts +17 -0
  313. package/src/system/default-theme.ts +7 -2
  314. package/src/system/utils.js +1 -1
  315. package/src/utils.js +3 -3
  316. package/src/utils.test.js +29 -0
  317. package/dist/cjs/icons.js +0 -126
  318. package/dist/esm/icons.js +0 -121
  319. package/src/icons.js +0 -121
package/src/Tab/Tab.mdx CHANGED
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: Tab
3
3
  category: General
4
+ propsSummary: Accepts [Text](/text) props.
4
5
  ---
5
6
 
6
7
  ```jsx live
@@ -15,7 +15,7 @@ function ColumnPicker({
15
15
  return (
16
16
  <Dropdown
17
17
  variant="outline"
18
- icon={{ name: 'columns' }}
18
+ icon={{ name: 'general.threeVerticalBars' }}
19
19
  tooltip={{ title: 'Filter Columns' }}
20
20
  placement="bottom-end"
21
21
  closeOnSelect={false}
@@ -3,7 +3,7 @@ import React from 'react'
3
3
  import Icon from '../Icon'
4
4
 
5
5
  const DragHandle = () => (
6
- <Icon name="drag-handle" size="sm" color="foregroundTertiary" cursor="grab" />
6
+ <Icon name="general.dragHandle" size="sm" color="foregroundTertiary" cursor="grab" />
7
7
  )
8
8
 
9
9
  export default DragHandle
@@ -38,7 +38,7 @@ function NavigationArrow({
38
38
  transition: 'all 300ms ease',
39
39
  }
40
40
  const buttonProps = {
41
- icon: { name: `caret-${side}` },
41
+ icon: { name: `general.${side}Chevron` },
42
42
  title: `navigate ${side}`,
43
43
  theme: false,
44
44
  disabled: direction === 1 ? progress >= 0.99 : progress <= 0,
@@ -27,7 +27,7 @@ const SubRowToggleCell = ({
27
27
  // TODO: expose for better accessibility
28
28
  theme={false}
29
29
  title="Toggle row"
30
- icon={{ name: 'arrow-down' }}
30
+ icon={{ name: 'general.downCaret' }}
31
31
  transform={!toggled && 'rotate(-90deg)'}
32
32
  {...restProps}
33
33
  />
@@ -1,8 +1,7 @@
1
1
  // @flow
2
2
  import React, { PureComponent, Children, Fragment } from 'react'
3
3
  import { Global } from '@emotion/core'
4
- import camelCase from 'lodash.camelcase'
5
- import snakeCase from 'lodash.snakecase'
4
+ import { camelCase, snakeCase } from 'lodash'
6
5
 
7
6
  import type { PaginationProps } from '../Pagination/Pagination'
8
7
 
@@ -265,7 +264,7 @@ class Table extends PureComponent<TableProps> {
265
264
  }
266
265
 
267
266
  static getIconDirection(direction) {
268
- return direction === Table.ASC ? 'arrow-up' : 'arrow-down'
267
+ return direction === Table.ASC ? 'general.upCaret' : 'general.downCaret'
269
268
  }
270
269
 
271
270
  static defaultProps = {
@@ -188,7 +188,7 @@ class TableExample extends React.Component {
188
188
  marginLeft: 'auto',
189
189
  position: 'sticky',
190
190
  right: 0,
191
- header: <Icon name="person" />,
191
+ header: <Icon name="general.person" />,
192
192
  label: 'Age',
193
193
  cell: 'age',
194
194
  },
@@ -241,7 +241,7 @@ class TableExample extends React.Component {
241
241
  <Button
242
242
  title="Compact header"
243
243
  iconRight={
244
- this.state.compactHeader ? { name: 'checkmark' } : undefined
244
+ this.state.compactHeader ? { name: 'general.check' } : undefined
245
245
  }
246
246
  variant="outline"
247
247
  onClick={() =>
package/src/Tabs/Tab.js CHANGED
@@ -45,4 +45,5 @@ function Tab(props: Props) {
45
45
  )
46
46
  }
47
47
 
48
+ Tab.displayName = 'Tabs.Tab'
48
49
  export default Tab
package/src/Tabs/Tabs.js CHANGED
@@ -10,6 +10,11 @@ import TabPanel from './TabPanel'
10
10
  import TabPanels, { TABPANELS_DISPLAY_NAME } from './TabPanels'
11
11
 
12
12
  type Props = {
13
+ /**
14
+ * Usually accepts `TabList` and `TabPanel` components.
15
+ */
16
+ children?: React.ReactNode,
17
+
13
18
  /**
14
19
  * Controls the active `Tab` and `TabPanel`.
15
20
  */
package/src/Tabs/Tabs.mdx CHANGED
@@ -2,6 +2,7 @@
2
2
  title: Tabs
3
3
  category: General
4
4
  summary: A single content area with multiple panels, each associated with a header in a list.
5
+ propsSummary: Accepts [StackView](/stackview) props.
5
6
  ---
6
7
 
7
8
  ```jsx live
package/src/Text/Text.mdx CHANGED
@@ -2,6 +2,7 @@
2
2
  title: Text
3
3
  category: Primitives
4
4
  summary: Text is a primitive component that typography components build from.
5
+ propsSummary: Accepts all [style props](/style-props) and valid HTML attributes.
5
6
  order: 2
6
7
  ---
7
8
 
package/src/Text/Text.tsx CHANGED
@@ -58,6 +58,10 @@ const textPlugin = {
58
58
  }
59
59
 
60
60
  export type TextProps = {
61
+ /**
62
+ * Render custom component or HTML element tag. (Defaults to a `<div>` element).
63
+ */
64
+ as?: any
61
65
  /**
62
66
  * Gain access to the internal ref
63
67
  */
@@ -94,6 +98,14 @@ export type TextProps = {
94
98
  * Sets `whiteSpace: nowrap` when `false`
95
99
  */
96
100
  wrap?: boolean
101
+ /**
102
+ * Describes styles at various points in time. [Read about variants](/variants).
103
+ */
104
+ variants?: object
105
+ /**
106
+ * Describes props at different breakpoints. [Read about mediaQueries](/responsive).
107
+ */
108
+ mediaQueries?: object
97
109
  } & BoxProps
98
110
 
99
111
  type Props = React.RefAttributes<any> &
@@ -1,8 +1,14 @@
1
+ // @flow
1
2
  import React from 'react'
2
3
 
3
4
  import InputBox from '../Input/InputBox'
4
5
 
5
- function TextArea(props) {
6
+ export type Props = {
7
+ /** Provides an initial value to the `textarea`. */
8
+ defaultValue?: string,
9
+ }
10
+
11
+ function TextArea(props: Props) {
6
12
  return (
7
13
  <InputBox
8
14
  as="textarea"
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: TextArea
3
3
  category: Forms
4
+ propsSummary: Accepts [Input.InputBox](/Input.InputBox) props.
4
5
  ---
5
6
 
6
7
  ```jsx live
@@ -2,7 +2,7 @@ import React, { useLayoutEffect, useState } from 'react'
2
2
  import { ThemeProvider as EmotionThemeProvider } from 'emotion-theming'
3
3
  import { CacheProvider } from '@emotion/core'
4
4
  import createCache from '@emotion/cache'
5
- import merge from 'deepmerge'
5
+ import { merge } from 'lodash'
6
6
 
7
7
  import defaultTheme from '../system/default-theme'
8
8
  import { flattenPalette } from '../system'
@@ -2,6 +2,7 @@
2
2
  title: TileView
3
3
  category: Layout
4
4
  summary: Auto place children into a grid and let the browser handle columns responsively, showing fewer columns on smaller viewports, and more columns as the viewport increases.
5
+ propsSummary: Accepts all valid HTML attributes.
5
6
  ---
6
7
 
7
8
  ```jsx live
@@ -17,18 +17,32 @@ const tileViewPlugin = {
17
17
  styles.gridTemplateColumns = `repeat(auto-fill, minmax(${parsedMinCellWidth}, 1fr))`
18
18
  }
19
19
  if (spacing !== undefined) {
20
- styles.gridGap = spacingValue(spacing)
20
+ styles.gap = spacingValue(spacing)
21
21
  }
22
22
  return styles
23
23
  },
24
24
  }
25
25
 
26
26
  export type TileViewProps = {
27
+ children?: any
28
+
29
+ /** Render custom component or HTML element tag. (Defaults to a `<div>` element).*/
30
+ as?: any
31
+
27
32
  /** The minimum width a cell must be. */
28
33
  minCellWidth?: number
29
34
 
30
35
  /** The amount of space between children. */
31
- spacing?: number
36
+ spacing?: number | string
37
+
38
+ /** Gain access to the internal ref */
39
+ innerRef?: any
40
+
41
+ /** Describes styles at various points in time. [Read about variants](/variants). */
42
+ variants?: object
43
+
44
+ /** Describes props at different breakpoints. [Read about mediaQueries](/responsive). */
45
+ mediaQueries?: object
32
46
  } & BoxProps
33
47
 
34
48
  type Props = React.RefAttributes<any> &
@@ -39,7 +53,7 @@ type Props = React.RefAttributes<any> &
39
53
 
40
54
  const defaultElement = 'div'
41
55
 
42
- export function TileView({ as, innerRef, ...props }) {
56
+ export function TileView({ as, innerRef, ...props }: Props) {
43
57
  const Element: React.ElementType = as || defaultElement
44
58
  const variant = useVariant()
45
59
  return (
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: TimeField
3
3
  category: Forms
4
+ propsSummary: Accepts [Input](/input) props.
4
5
  ---
5
6
 
6
7
  ```jsx live
@@ -19,7 +19,7 @@ function DefaultToken({
19
19
  size="sm"
20
20
  renderRight={
21
21
  <Icon
22
- name="close"
22
+ name="general.x"
23
23
  size="xs"
24
24
  cursor="pointer"
25
25
  onClick={() => removeToken(false)}
@@ -10,36 +10,42 @@ import DefaultToken from './DefaultToken'
10
10
 
11
11
  type Props = {
12
12
  /**
13
- * > `array` | defaults to `null`
13
+ * `array` | defaults to `null`
14
14
  * Controlled set of tokens.
15
15
  */
16
16
  tokens: Array<any>,
17
17
  /**
18
- * > `function(event: {
18
+ * ```js
19
+ * function(event: {
19
20
  * added: boolean
20
21
  * token: any,
21
22
  * tokenIndex: number,
22
23
  * tokens: array,
23
- * })`
24
+ * })
25
+ * ```
24
26
  * Callback when a token has been added or removed.
25
27
  */
26
28
  onChange: Function,
27
29
  /**
28
- * > `function(token: any, {
30
+ * ```js
31
+ * function(token: any, {
29
32
  * removeToken: func,
30
33
  * selectFirstToken: func,
31
34
  * selectLastToken: func,
32
35
  * selectNextToken: func,
33
36
  * selectPreviousToken: func,
34
37
  * tokenIndex: number
35
- * })`
38
+ * })
39
+ * ```
36
40
  * Control how a token is rendered. As long as this function returns a string,
37
41
  * it will use a default badge, otherwise pass any custom component and
38
42
  * functionality you need.
39
43
  */
40
44
  renderToken?: Function,
41
45
  /**
42
- * > `function(inputProps: object)`
46
+ * ```js
47
+ * function(inputProps: object)
48
+ * ```
43
49
  * Control how the internal input is rendered, `inputProps` must be passed
44
50
  * through to the rendered input.
45
51
  */
@@ -2,6 +2,7 @@
2
2
  title: TokenInput
3
3
  category: Forms
4
4
  summary: Allow users to add and delete multiple items, optionally using autocompletion as they type to find each item when paired with [`Combobox.Popover`](/combobox/#comboboxpopover).
5
+ propsSummary: Accepts [WrapView](/wrapview) props.
5
6
  ---
6
7
 
7
8
  ```jsx live
@@ -2,6 +2,7 @@
2
2
  title: Toolbar
3
3
  category: General
4
4
  summary: Toolbars are used to help separate content that have a title as well as an optional helper drawer and/or section actions.
5
+ propsSummary: Accepts [StackView](/stackview) props.
5
6
  ---
6
7
 
7
8
  ```jsx live
@@ -6,6 +6,10 @@ import Popover from '../Popover'
6
6
  import { composeEvents, pageViewChange } from '../utils'
7
7
 
8
8
  export type Props = {
9
+ /**
10
+ * The child becomes the trigger for the tooltip, unless it is overridden with `popoverProps={{relativeTo: ref}}`.
11
+ */
12
+ children?: any,
9
13
  /**
10
14
  * The amount of time in milliseconds before the tooltip closes.
11
15
  */
@@ -36,10 +40,45 @@ export type Props = {
36
40
  */
37
41
  triggerOnHover: boolean,
38
42
 
43
+ /**
44
+ * Attempts to keep popover in view clipping edges if too large.
45
+ */
46
+ keepInView?: boolean,
47
+
48
+ /**
49
+ * `'top-start'
50
+ | 'top'
51
+ | 'top-end'
52
+ | 'right-start'
53
+ | 'right'
54
+ | 'right-end'
55
+ | 'bottom-start'
56
+ | 'bottom'
57
+ | 'bottom-end'
58
+ | 'left-start'
59
+ | 'left'
60
+ | 'left-end'`
61
+
62
+ * Where to place the popover.
63
+ */
64
+ placement?: string,
65
+
66
+ /**
67
+ * Where to render the composed popover into. Accepts an HTML element or selector.
68
+ * Uses the closest fixed parent or `document.body` by default. This will only
69
+ * be computed once on initial render.
70
+ */
71
+ renderTo?: HTMLElement | string,
72
+
39
73
  /**
40
74
  * Accepts any valid [Popover](/popover) props.
41
75
  */
42
76
  popoverProps?: object,
77
+
78
+ /**
79
+ * Passes props to [Popover](/popover)'s `anchorElement`.
80
+ */
81
+ childProps?: object,
43
82
  }
44
83
 
45
84
  const emitter = mitt()
@@ -1,7 +1,8 @@
1
1
  ---
2
2
  title: Tooltip
3
3
  category: Overlays
4
- summary: Composes [Popover](/popover). Used to display a minimal amount of helpful information.
4
+ summary: Used to display a minimal amount of helpful information.
5
+ propsSummary: Accepts [Popover](/popover) props.
5
6
  ---
6
7
 
7
8
  ```jsx live
@@ -24,7 +25,7 @@ render(
24
25
  <Tooltip placement="right" title="Tooltip">
25
26
  <Box>Right</Box>
26
27
  </Tooltip>
27
- <Button icon={{ name: 'search' }} tooltip={{ title: 'search' }} />
28
+ <Button icon={{ name: 'general.search' }} tooltip={{ title: 'search' }} />
28
29
  </StackView>
29
30
  )
30
31
  ```
@@ -35,7 +36,7 @@ render(
35
36
  title={
36
37
  <StackView width={24} spacing={1} cursor="default">
37
38
  <StackView axis="horizontal" alignment="center" spacing={1}>
38
- <Icon name="exclamation-circle-filled" size="md" color="error" />
39
+ <Icon name="general.exclamationCircle" size="md" color="error" />
39
40
  <Text fontSize={3} weight={500} color="error">
40
41
  Error
41
42
  </Text>
@@ -217,7 +217,7 @@ class Wizard extends Component<Props> {
217
217
  {activeStepIndex > 0 && (
218
218
  <Button
219
219
  disabled={sendingPayload}
220
- iconLeft={{ name: 'caret-left' }}
220
+ iconLeft={{ name: 'general.leftChevron', size: 'sm' }}
221
221
  onClick={() =>
222
222
  this.setState({ activeStepIndex: activeStepIndex - 1 })
223
223
  }
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: Wizard
3
3
  category: General
4
+ propsSummary: Accepts [StackView](/stackview) props.
4
5
  ---
5
6
 
6
7
  ```jsx live
@@ -68,9 +69,13 @@ render(
68
69
  <Wizard
69
70
  buttonProps={{ size: 'sm' }}
70
71
  cancelButtonProps={{ theme: 'error', variant: 'fill' }}
71
- backButtonProps={{ theme: 'dark', variant: 'outline' }}
72
+ backButtonProps={{
73
+ theme: 'dark',
74
+ variant: 'outline',
75
+ iconLeft: { name: 'general.leftChevron', size: 'xxs' }
76
+ }}
72
77
  footerProps={{ backgroundColor: 'grey-2' }}
73
- nextButtonProps={{ iconRight: { name: 'caret-right' } }}
78
+ nextButtonProps={{ iconRight: { name: 'general.rightChevron', size: 'xxs' } }}
74
79
  onCancel={() => console.log('cancel')}
75
80
  onSubmit={() => console.log('submit')}
76
81
  padding={8}
@@ -2,6 +2,7 @@
2
2
  title: WrapView
3
3
  category: Layout
4
4
  summary: Lay out children in a row, wrapping if necessary.
5
+ propsSummary: Accepts all valid HTML attributes, [StackView](/stackview) and [Box](/box) props.
5
6
  ---
6
7
 
7
8
  ```jsx live
@@ -2,49 +2,27 @@ import React from 'react'
2
2
 
3
3
  import { BoxProps } from '../Box'
4
4
  import StackView from '../StackView'
5
+ import { spacingValue } from '../system'
5
6
 
6
7
  export type WrapViewProps = {
8
+ children?: any
9
+
7
10
  /** The amount of space between children. */
8
- spacing?: number
11
+ spacing?: number | string
9
12
  } & BoxProps
10
13
 
11
14
  type Props = React.RefAttributes<any> &
12
15
  React.HTMLAttributes<any> &
13
16
  WrapViewProps
14
17
 
15
- let supportsFlexGap = null
16
-
17
- function getSupportsFlexGap() {
18
- if (typeof document !== 'undefined' && supportsFlexGap === null) {
19
- const div = document.createElement('div')
20
- div.style.display = 'flex'
21
- div.style.flexDirection = 'column'
22
- div.style.gap = '1px'
23
- div.appendChild(document.createElement('div'))
24
- div.appendChild(document.createElement('div'))
25
- document.body.appendChild(div)
26
- supportsFlexGap = div.scrollHeight === 1
27
- document.body.removeChild(div)
28
- }
29
- return supportsFlexGap
30
- }
31
-
32
18
  export function WrapView({ children, spacing, ...restProps }: Props) {
33
- const supportsFlexGap = getSupportsFlexGap()
34
19
  const styles = {
35
20
  basis: '100%',
36
21
  } as any
37
22
  if (spacing) {
38
- if (supportsFlexGap) {
39
- styles.gap = spacing
40
- } else {
41
- styles.marginBottom = -spacing
42
- styles['& > *'] = {
43
- marginRight: spacing,
44
- marginBottom: spacing,
45
- }
46
- }
23
+ styles.gap = spacingValue(spacing)
47
24
  }
25
+
48
26
  return (
49
27
  <StackView axis="horizontal" {...restProps}>
50
28
  <StackView wrap axis="horizontal" css={styles}>
@@ -22,7 +22,7 @@ export function useAccessibilityViolation(
22
22
  title: (
23
23
  <StackView width={32} spacing={1} cursor="default">
24
24
  <StackView axis="horizontal" alignment="center" spacing={1}>
25
- <Icon name="exclamation-circle-filled" size="md" color="error" />
25
+ <Icon name="general.exclamationCircle" size="md" color="error" />
26
26
  <Text fontSize={3} weight={500}>
27
27
  Accessibility Violation
28
28
  </Text>
@@ -0,0 +1,17 @@
1
+ // A copy/paste of the source of the `use-constant` package.
2
+ // https://github.com/Andarist/use-constant/blob/main/src/index.ts
3
+ // This is done to reduce dependencies.
4
+
5
+ import * as React from 'react'
6
+
7
+ type ResultBox<T> = { v: T }
8
+
9
+ export default function useConstant<T>(fn: () => T): T {
10
+ const ref = React.useRef<ResultBox<T>>()
11
+
12
+ if (!ref.current) {
13
+ ref.current = { v: fn() }
14
+ }
15
+
16
+ return ref.current.v
17
+ }
@@ -1,4 +1,6 @@
1
- import icons from '../icons'
1
+ import * as general from "@planningcenter/icons/paths/general"
2
+ import * as tapestry from "@planningcenter/icons/paths/tapestry"
3
+
2
4
  import { Theme } from '../index'
3
5
 
4
6
  import { boxSizes } from './box-sizes'
@@ -16,7 +18,10 @@ const controlStyles = {
16
18
  const defaultTheme: Theme = {
17
19
  boxSizes,
18
20
  colors,
19
- icons,
21
+ icons: {
22
+ general,
23
+ tapestry,
24
+ },
20
25
  breakpoints: { xs: 480, sm: 600, md: 720, lg: 960, xl: 1200 },
21
26
  button: { themes: buttonThemes },
22
27
  calendar: { weekStartsOn: 0 },
@@ -1,7 +1,7 @@
1
1
  import { useContext, useCallback } from 'react'
2
2
  import { ThemeContext } from '@emotion/core'
3
3
  import { darken, getLuminance, lighten, parseToRgb } from 'polished'
4
- import get from 'lodash.get'
4
+ import { get } from 'lodash'
5
5
 
6
6
  import { getColor } from './colors'
7
7
  import defaultTheme from './default-theme'
package/src/utils.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Children, cloneElement } from 'react'
2
2
  import { tabbable } from 'tabbable'
3
- import camelToKebabCase from 'camel-to-kebab'
3
+ import { kebabCase } from 'lodash'
4
4
 
5
5
  /**
6
6
  * Returns true if user platform is an iOS device
@@ -682,12 +682,12 @@ function createCSSProperty(key, value) {
682
682
  if (!createdCSSProperties.has(key)) {
683
683
  createdCSSProperties.add(key)
684
684
  }
685
- return `--${camelToKebabCase(key)}-${camelToKebabCase(value)}`
685
+ return `--${kebabCase(key)}-${kebabCase(value)}`
686
686
  }
687
687
 
688
688
  function getCSSProperty(key, value) {
689
689
  return key && value
690
- ? `var(--${camelToKebabCase(key)}-${camelToKebabCase(value)})`
690
+ ? `var(--${kebabCase(key)}-${kebabCase(value)})`
691
691
  : undefined
692
692
  }
693
693
 
@@ -0,0 +1,29 @@
1
+ import { createCSSProperty, getCSSProperty } from './utils'
2
+
3
+ describe('createCSSProperty', () => {
4
+ test('kebab cases the key and value', () => {
5
+ expect(createCSSProperty('theCamelCasedKey', 'theCamelCasedValue')).toEqual(
6
+ '--the-camel-cased-key-the-camel-cased-value'
7
+ )
8
+ })
9
+
10
+ test("does not mess with already kebab'd keys and values", () => {
11
+ expect(
12
+ createCSSProperty('mixedCamel-and-kebab', 'only-kebab-case')
13
+ ).toEqual('--mixed-camel-and-kebab-only-kebab-case')
14
+ })
15
+ })
16
+
17
+ describe('getCSSProperty', () => {
18
+ test('kebab cases the key and value', () => {
19
+ expect(getCSSProperty('theCamelCasedKey', 'theCamelCasedValue')).toEqual(
20
+ 'var(--the-camel-cased-key-the-camel-cased-value)'
21
+ )
22
+ })
23
+
24
+ test("does not mess with already kebab'd keys and values", () => {
25
+ expect(getCSSProperty('mixedCamel-and-kebab', 'only-kebab-case')).toEqual(
26
+ 'var(--mixed-camel-and-kebab-only-kebab-case)'
27
+ )
28
+ })
29
+ })