@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
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: CheckboxCard
3
3
  category: Forms
4
+ propsSummary: Accepts [Card](/card) props.
4
5
  ---
5
6
 
6
7
  ```jsx live
@@ -6,11 +6,17 @@ import { shallowEqual } from '../utils'
6
6
  import CheckboxGroupContext from './CheckboxGroupContext'
7
7
 
8
8
  type Props = {
9
+ children: any,
9
10
  /**
10
11
  * Accepts an array of strings that match the corresponding `Checkbox` values that should be checked.
11
12
  */
12
13
  value: Array<string>,
13
14
 
15
+ /**
16
+ * Maps to the corresponding `Checkbox` name prop.
17
+ */
18
+ name: string,
19
+
14
20
  /**
15
21
  * Callback when any child `Checkbox` fires its `onChange` callback. Receives new array of values.
16
22
  */
@@ -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
@@ -59,6 +60,24 @@ render(
59
60
  )
60
61
  ```
61
62
 
63
+ ```jsx live
64
+ render(
65
+ <ChurchCenterStatus
66
+ ccAppEnabled
67
+ ccPublishingEnabled={false}
68
+ ccWebEnabled
69
+ description="On Church Center, people can browse and register for events."
70
+ destinationLabel="event list"
71
+ productUrl="#product"
72
+ renderPopoverFooter={(buttonProps) => (
73
+ <Button title="Another link!" {...buttonProps} />
74
+ )}
75
+ settingsUrl="#settings"
76
+ showSettingsLink={false}
77
+ />
78
+ )
79
+ ```
80
+
62
81
  ## Custom icons
63
82
 
64
83
  To use the Planning Center General set of icons, import the general set to your theme and define the overrides with the `icons` prop.
@@ -8,6 +8,11 @@ import StackView from '../StackView'
8
8
  import Text from '../Text'
9
9
 
10
10
  type ChurchCenterStatusProps = {
11
+ /**
12
+ * Pass props to the Dropdown buttons.
13
+ */
14
+ buttonProps?: object
15
+
11
16
  /**
12
17
  * Determines status of Church Center App.
13
18
  */
@@ -53,13 +58,26 @@ type ChurchCenterStatusProps = {
53
58
  */
54
59
  productUrl: string
55
60
 
61
+ /**
62
+ * Render nodes at the end of the popover. `buttonProps` is passed as an argument
63
+ * and can be spread on any `<Button />` component to match the style of the other
64
+ * popover links.
65
+ */
66
+ renderPopoverFooter: Function
67
+
56
68
  /**
57
69
  * Where the browser should navigate when settings button is pressed.
58
70
  */
59
71
  settingsUrl: string
72
+
73
+ /**
74
+ * Toggle the settings link display.
75
+ */
76
+ showSettingsLink?: boolean
60
77
  }
61
78
 
62
79
  export function ChurchCenterStatus({
80
+ buttonProps: passedButtonProps = {},
63
81
  ccAppEnabled = false,
64
82
  ccPublishingEnabled = false,
65
83
  ccWebEnabled = false,
@@ -69,7 +87,9 @@ export function ChurchCenterStatus({
69
87
  dropdownProps = {},
70
88
  icons,
71
89
  productUrl,
90
+ renderPopoverFooter = () => {},
72
91
  settingsUrl,
92
+ showSettingsLink = true,
73
93
  ...props
74
94
  }: ChurchCenterStatusProps) {
75
95
  const buttonProps: any = {
@@ -78,15 +98,20 @@ export function ChurchCenterStatus({
78
98
  paddingHorizontal: 2,
79
99
  radius: 0,
80
100
  variant: 'naked',
101
+ ...passedButtonProps,
81
102
  }
82
103
 
83
104
  const ccEnabled = ccAppEnabled || ccWebEnabled
105
+ const hasLinks =
106
+ showSettingsLink ||
107
+ (ccEnabled && ccPublishingEnabled) ||
108
+ !!renderPopoverFooter()
84
109
 
85
110
  const icon = {
86
- check: 'checkmark',
87
- exclamationTriangle: 'exclamation-triangle-filled',
88
- external: 'external',
89
- x: 'close',
111
+ check: 'general.check',
112
+ exclamationTriangle: 'general.exclamationTriangle',
113
+ external: 'general.newWindow',
114
+ x: 'general.x',
90
115
  ...icons,
91
116
  }
92
117
 
@@ -142,25 +167,32 @@ export function ChurchCenterStatus({
142
167
  </StackView>
143
168
  )}
144
169
  </StackView>
145
- <Divider margin={0.5} />
170
+ {hasLinks && <Divider margin={0.5} />}
146
171
  <StackView>
147
- <Button
148
- external
149
- title="Update settings"
150
- to={settingsUrl}
151
- {...buttonProps}
152
- />
172
+ {showSettingsLink && (
173
+ <Button
174
+ external
175
+ title="Update settings"
176
+ to={settingsUrl}
177
+ {...buttonProps}
178
+ />
179
+ )}
153
180
  {ccEnabled && ccPublishingEnabled && (
154
- <Button external to={productUrl} {...buttonProps}>
155
- Visit {destinationLabel}
156
- <Icon
157
- color="primary"
158
- name={icon.external}
159
- marginLeft={1}
160
- size="sm"
161
- />
162
- </Button>
181
+ <Button
182
+ external
183
+ iconRight={{
184
+ color: 'primary',
185
+ name: icon.external,
186
+ marginLeft: 1,
187
+ size: 'xs',
188
+ }}
189
+ title={`Visit ${destinationLabel}`}
190
+ to={productUrl}
191
+ {...buttonProps}
192
+ as="a"
193
+ />
163
194
  )}
195
+ {renderPopoverFooter(buttonProps)}
164
196
  </StackView>
165
197
  </Dropdown>
166
198
  </StackView>
@@ -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>
@@ -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
  />