@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
@@ -2,6 +2,7 @@
2
2
  title: CheckboxGroup
3
3
  category: Forms
4
4
  summary: Manage a group of checkboxes with one value and one callback.
5
+ propsSummary: Accepts [Card](/card) props.
5
6
  ---
6
7
 
7
8
  ```jsx live
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: ChurchCenterStatus
3
3
  category: General
4
+ propsSummary: Accepts [StackView](/stackview) props.
4
5
  ---
5
6
 
6
7
  ```jsx live
@@ -108,10 +108,10 @@ export function ChurchCenterStatus({
108
108
  !!renderPopoverFooter()
109
109
 
110
110
  const icon = {
111
- check: 'checkmark',
112
- exclamationTriangle: 'exclamation-triangle-filled',
113
- external: 'external',
114
- x: 'close',
111
+ check: 'general.check',
112
+ exclamationTriangle: 'general.exclamationTriangle',
113
+ external: 'general.newWindow',
114
+ x: 'general.x',
115
115
  ...icons,
116
116
  }
117
117
 
@@ -7,6 +7,8 @@ import { useLayoutEffect, useRef, useState } from 'react'
7
7
  const transition = 'height 200ms ease-out'
8
8
 
9
9
  export type Props = {
10
+ children?: any,
11
+
10
12
  /**
11
13
  * Controls whether or not children are visible.
12
14
  */
@@ -2,12 +2,15 @@
2
2
  import React, { Children } from 'react'
3
3
 
4
4
  import StackView from '../StackView'
5
+ import { spacingValue } from '../system'
5
6
 
6
7
  function Column() {
7
8
  return null
8
9
  }
9
10
 
10
11
  export type Props = {
12
+ /** Often wraps the `ColumnView.Column` component. */
13
+ children?: any,
11
14
  /** The amount of columns to be rendered. */
12
15
  sizes?: Array<
13
16
  | {
@@ -19,11 +22,12 @@ export type Props = {
19
22
  | string
20
23
  >,
21
24
  /** The amount of space between columns. */
22
- spacing?: number,
25
+ spacing?: number | string,
23
26
  }
24
27
 
25
28
  function ColumnView(props: Props) {
26
29
  const { children, sizes = [], spacing, ...restProps } = props
30
+ const parsedSpacing = spacingValue(spacing)
27
31
  const sortedColumns = Children.toArray(children)
28
32
  .sort((a, b) => (a.props.order || 0) - (b.props.order || 0))
29
33
  .reduce((columns, cell, index) => {
@@ -45,8 +49,8 @@ function ColumnView(props: Props) {
45
49
  basis={size === 'auto' ? '100%' : size.basis || size}
46
50
  shrink={size === 'auto' ? 1 : size.shrink || 0}
47
51
  grow={size === 'auto' ? 1 : size.grow || 0}
48
- marginLeft={index === 0 ? null : spacing}
49
- spacing={spacing}
52
+ marginLeft={index === 0 ? null : parsedSpacing}
53
+ spacing={parsedSpacing}
50
54
  >
51
55
  {column.map((cell) => cell.props.children)}
52
56
  </StackView>
@@ -2,6 +2,7 @@
2
2
  title: ColumnView
3
3
  category: Layout
4
4
  summary: Place children into different sized columns.
5
+ propsSummary: Accepts [StackView](/stackview) props.
5
6
  ---
6
7
 
7
8
  ```jsx live
@@ -1,3 +1,4 @@
1
+ // @flow
1
2
  import React, { Component } from 'react'
2
3
 
3
4
  import Box from '../Box'
@@ -8,7 +9,16 @@ import ComboboxItem from './ComboboxItem'
8
9
  import ComboboxItems from './ComboboxItems'
9
10
  import ComboboxPopover from './ComboboxPopover'
10
11
 
11
- class Combobox extends Component {
12
+ type ComboboxProps = {
13
+ /**
14
+ * Usually takes `Combobox.Input`, `Combobox.Items` and `Combobox.Item` components.
15
+ */
16
+ children: any,
17
+ onSelect: Function,
18
+ selectedValue: any,
19
+ }
20
+
21
+ class Combobox extends Component<ComboboxProps> {
12
22
  static Input = ComboboxInput
13
23
 
14
24
  static Item = ComboboxItem
@@ -2,6 +2,7 @@
2
2
  title: Combobox
3
3
  category: Forms
4
4
  summary: Used for easily selecting a list of items that are paired with a text input. Composes [Combobox.Input](https://github.com/ministrycentered/tapestry-react/blob/master/packages/tapestry-react/src/Combobox/ComboboxInput.js) and [Popover](/popover).
5
+ propsSummary: Accepts [Box](/box) props.
5
6
  ---
6
7
 
7
8
  ### Combobox
@@ -57,7 +58,7 @@ function App() {
57
58
  >
58
59
  <Combobox.Input
59
60
  autoFocus
60
- renderLeft={<Icon name="search" />}
61
+ renderLeft={<Icon name="general.search" />}
61
62
  placeholder="Search by name, email, or phone number"
62
63
  value={value}
63
64
  onClear={value.length > 0 ? () => setValue('') : null}
@@ -188,7 +188,7 @@ class ComboboxPopover extends Component<Props> {
188
188
  closeButton ? (
189
189
  <Button
190
190
  disabled={disabled}
191
- icon={{ name: 'close' }}
191
+ icon={{ name: 'general.x' }}
192
192
  title="close options"
193
193
  theme={false}
194
194
  {...closeButton}
@@ -197,7 +197,7 @@ class ComboboxPopover extends Component<Props> {
197
197
  <Button
198
198
  disabled={disabled}
199
199
  icon={{
200
- name: isPopoverOpen ? 'close' : 'arrow-down',
200
+ name: isPopoverOpen ? 'general.x' : 'general.downCaret',
201
201
  }}
202
202
  title={
203
203
  isPopoverOpen ? 'close options' : 'open options'
@@ -41,6 +41,11 @@ export type Props = {
41
41
  */
42
42
  innerBodyRef?: Function,
43
43
 
44
+ /**
45
+ * Ref that is passed to `useImperativeHandle` which in turn returns `useCollapsibleRows.
46
+ */
47
+ dataTableRef?: any,
48
+
44
49
  /**
45
50
  * Controls whether or not sub-rows can be collapsed.
46
51
  */
@@ -193,6 +198,32 @@ export type Props = {
193
198
  */
194
199
  keyboardShortcuts?: Object<Function>,
195
200
 
201
+ /**
202
+ * `onDragStart: (event) => void`
203
+ *
204
+ * Called at the start of a child `Draggable` drag.
205
+ */
206
+ onDragStart?: Function,
207
+
208
+ /**
209
+ * `onDragEnd: (event) => void`
210
+ *
211
+ * Called at the end of a child `Draggable` drag.
212
+ */
213
+ onDragEnd?: Function,
214
+
215
+ /**
216
+ * `onDrop: (event) => void`
217
+ *
218
+ * This function will be called when a `Draggable` has been dropped. Returns the `onDragEnd` event with any `Draggable` `data` attached.
219
+ */
220
+ onDrop?: Function,
221
+
222
+ /**
223
+ * This prop controls whether or not the droppable can receive and reorder draggables. If true, draggables may move outside the droppable, but not added.
224
+ */
225
+ sourceOnly?: boolean,
226
+
196
227
  /**
197
228
  * Puts the table in a loading state and shows a spinner in the middle of the table.
198
229
  */
@@ -261,6 +292,23 @@ export type Props = {
261
292
  bodySubCell?: Object | Function,
262
293
  }
263
294
  | Array<Object | boolean>,
295
+
296
+ /**
297
+ * Current visible page number for pagination
298
+ */
299
+ currentPage: number,
300
+
301
+ /**
302
+ * `(nextPage: number) => undefined`
303
+ *
304
+ * Callback when new page is requested for pagination.
305
+ */
306
+ onPageChange: Function,
307
+
308
+ /**
309
+ * Total available pages for pagination.
310
+ */
311
+ totalPages: number,
264
312
  }
265
313
 
266
314
  const defaultHiddenColumnIds = []
@@ -279,7 +279,7 @@ const columns = [
279
279
  {
280
280
  label: 'Age',
281
281
  id: 'age',
282
- header: <Icon name="person" />,
282
+ header: <Icon name="general.person" />,
283
283
  cell: 'age',
284
284
  css: {
285
285
  justifyContent: 'center',
@@ -330,7 +330,7 @@ render(function () {
330
330
  />
331
331
  <Button
332
332
  title="Condensed"
333
- iconRight={condensed ? { name: 'checkmark' } : undefined}
333
+ iconRight={condensed ? { name: 'general.check' } : undefined}
334
334
  variant="outline"
335
335
  onClick={() => setCondensed(!condensed)}
336
336
  />
@@ -1,11 +1,12 @@
1
1
  import React, { useCallback } from 'react'
2
2
 
3
- import Icon from './Icon'
3
+ import Icon from '../../Icon'
4
+
4
5
 
5
6
  const iconPaths = {
6
- fill: 'checkbox-0',
7
- minus: 'checkbox-1',
8
- checked: 'checkbox-2',
7
+ fill: 'tapestry.checkbox0',
8
+ minus: 'tapestry.checkbox1',
9
+ checked: 'tapestry.checkbox2',
9
10
  }
10
11
 
11
12
  const scaleStyles = {
@@ -1,10 +1,8 @@
1
1
  import React from 'react'
2
2
 
3
- // import Checkbox from '../../Checkbox'
4
3
  import Dropdown from '../../Dropdown'
5
4
  import Text from '../../Text'
6
-
7
- import Checkbox from './CheckboxCell'
5
+ import Checkbox from '../../Checkbox'
8
6
 
9
7
  const noop = () => null
10
8
 
@@ -17,7 +15,7 @@ function ColumnPicker({
17
15
  return (
18
16
  <Dropdown
19
17
  variant="outline"
20
- icon={{ name: 'columns' }}
18
+ icon={{ name: 'general.threeVerticalBars' }}
21
19
  tooltip={{ title: 'Filter Columns' }}
22
20
  placement="bottom-end"
23
21
  closeOnSelect={false}
@@ -40,6 +38,8 @@ function ColumnPicker({
40
38
  <Checkbox
41
39
  checked={hiddenColumnIds.indexOf(column.id) === -1}
42
40
  onChange={noop}
41
+ label={null}
42
+ size="md"
43
43
  />
44
44
  <Text marginLeft={1}>{column.label || column.header}</Text>
45
45
  </Dropdown.Item>
@@ -1,5 +1,5 @@
1
1
  import { createContext, useCallback, useContext, useEffect } from 'react'
2
- import useConstant from 'use-constant'
2
+ import useConstant from '../../hooks/useConstant'
3
3
  import create from 'zustand'
4
4
 
5
5
  import { range } from '../../utils'
@@ -4,7 +4,7 @@ export const SORT_ASC = 'ASC'
4
4
  export const SORT_DESC = 'DESC'
5
5
 
6
6
  export function getIconDirection(direction) {
7
- return direction === SORT_ASC ? 'arrow-up' : 'arrow-down'
7
+ return direction === SORT_ASC ? 'general.upCaret' : 'general.downCaret'
8
8
  }
9
9
 
10
10
  export function getOppositeSortDirection(direction) {
@@ -8,7 +8,7 @@ import {
8
8
  useAnySubRowsOpen,
9
9
  } from '../hooks/useCollapsibleRows'
10
10
 
11
- import Icon from '../components/Icon'
11
+ import Icon from '../../Icon'
12
12
 
13
13
  const buttonStyles = {
14
14
  appearance: 'none',
@@ -50,7 +50,7 @@ function CollapseHeader({ accessibility }) {
50
50
  }}
51
51
  >
52
52
  <Icon
53
- name="arrow-down"
53
+ name="general.downCaret"
54
54
  size="sm"
55
55
  style={{
56
56
  transform: anySubRowsOpen ? undefined : 'rotate(-90deg)',
@@ -75,7 +75,7 @@ function CollapseCell({ rowIndex }) {
75
75
  }}
76
76
  >
77
77
  <Icon
78
- name="arrow-down"
78
+ name="general.downCaret"
79
79
  size="sm"
80
80
  style={{
81
81
  transform: isSubRowOpen ? undefined : 'rotate(-90deg)',
@@ -121,7 +121,7 @@ function getParsedColumns({
121
121
  {..._dragHandleProps}
122
122
  >
123
123
  <Icon
124
- name="drag-handle"
124
+ name="general.dragHandle"
125
125
  size="sm"
126
126
  color="foregroundTertiary"
127
127
  style={{ cursor: 'grab' }}
@@ -46,6 +46,16 @@ export type DateFieldProps = {
46
46
  */
47
47
  value: Date,
48
48
 
49
+ /**
50
+ * Locks external scrollbars when open.
51
+ */
52
+ lockScrollWhileOpen?: boolean,
53
+
54
+ /**
55
+ * Attempts to keep popover in view clipping edges if too large.
56
+ */
57
+ keepInView?: boolean,
58
+
49
59
  /**
50
60
  * Accepts any valid [Popover](/popover) props.
51
61
  */
@@ -140,7 +150,7 @@ class DateField extends Component<DateFieldProps> {
140
150
  readOnly
141
151
  value={value ? format(value, formatValue) : ''}
142
152
  renderRight={
143
- <Icon name="calendar" color="foregroundTertiary" />
153
+ <Icon name="general.calendar" color="foregroundTertiary" />
144
154
  }
145
155
  onClick={this.togglePopover}
146
156
  onBlur={requestBlur}
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: DateField
3
3
  category: Forms
4
+ propsSummary: Accepts [Input](/input) props.
4
5
  ---
5
6
 
6
7
  ```jsx live
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: Divider
3
3
  category: General
4
+ propsSummary: Accepts [Box](/box) props.
4
5
  ---
5
6
 
6
7
  ```jsx live
@@ -6,12 +6,12 @@ summary: Custom components that wrap [react-beautiful-dnd](https://github.com/at
6
6
 
7
7
  ```jsx live
8
8
  const navigationItems = [
9
- { icon: 'house', name: 'Home' },
10
- { icon: 'person', name: 'Profile' },
11
- { icon: 'checkmark-circle-filled', name: 'Check-In' },
12
- { icon: 'people', name: 'Groups' },
13
- { icon: 'calendar', name: 'Events' },
14
- { icon: 'search', name: 'Search' },
9
+ { icon: 'general.outlinedLocationPin', name: 'Home' },
10
+ { icon: 'general.person', name: 'Profile' },
11
+ { icon: 'general.checkCircle', name: 'Check-In' },
12
+ { icon: 'general.twoPeople', name: 'Groups' },
13
+ { icon: 'general.calendar', name: 'Events' },
14
+ { icon: 'general.search', name: 'Search' },
15
15
  ]
16
16
  function Item({
17
17
  icon,
@@ -24,6 +24,20 @@ function Item({
24
24
  ...restProps
25
25
  }) {
26
26
  const { hover, hoverProps } = hooks.useHover()
27
+
28
+ const actions = {
29
+ add: {
30
+ icon: "general.plusCircle",
31
+ color: "success",
32
+ label: "Add",
33
+ },
34
+ remove: {
35
+ icon: "general.minusCircle",
36
+ color: "error",
37
+ label: "Remove",
38
+ }
39
+ }
40
+
27
41
  return (
28
42
  <Card
29
43
  axis="horizontal"
@@ -40,10 +54,10 @@ function Item({
40
54
  <Icon name={icon} color="grey-7" />
41
55
  <Text grow={1}>{name}</Text>
42
56
  <Button
43
- title={type === 'remove' ? 'Remove' : 'Add'}
57
+ title={actions.[type].label}
44
58
  icon={{
45
- name: `${type}-circle-filled`,
46
- color: type === 'remove' ? 'error' : 'success',
59
+ name: actions.[type].icon,
60
+ color: actions.[type].color,
47
61
  }}
48
62
  variant="naked"
49
63
  opacity={hover && hoverEnabled ? 1 : 0}
@@ -8,8 +8,10 @@ import React, {
8
8
  } from 'react'
9
9
 
10
10
  import StackView from '../StackView'
11
+ import { useThemeValue } from '../system'
11
12
 
12
13
  function DrawerContents({ shouldClose, onClose, ...restProps }) {
14
+ const themeProps = useThemeValue('drawer')
13
15
  const ref = useRef(null)
14
16
  const [show, setShow] = useState(false)
15
17
 
@@ -51,6 +53,7 @@ function DrawerContents({ shouldClose, onClose, ...restProps }) {
51
53
  boxShadow="-6px 0px 6px -4px rgba(150,150,150,0.25)"
52
54
  backgroundColor="surfaceTertiary"
53
55
  transition="transform 240ms ease-out"
56
+ {...themeProps}
54
57
  {...restProps}
55
58
  />
56
59
  )
@@ -2,6 +2,7 @@
2
2
  title: Drawer
3
3
  category: General
4
4
  summary: Use to add collapsible navigation items or content anchored to the right side of the screen.
5
+ propsSummary: Accepts [StackView](/stackview) props.
5
6
  ---
6
7
 
7
8
  ```jsx live
@@ -26,7 +27,7 @@ render(() => {
26
27
  >
27
28
  <Button
28
29
  title="close drawer"
29
- icon={{ name: 'close', color: 'primary' }}
30
+ icon={{ name: 'general.x', color: 'primary' }}
30
31
  variant="naked"
31
32
  onClick={() => setOpen(false)}
32
33
  />
@@ -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>