@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
package/src/Menu/Item.js CHANGED
@@ -20,7 +20,7 @@ function Item({
20
20
  minHeight: 4,
21
21
  fontSize: '14px',
22
22
  paddingVertical: 0.75,
23
- paddingHorizontal: 1,
23
+ paddingHorizontal: 2,
24
24
  whiteSpace: 'nowrap',
25
25
  position: 'relative',
26
26
  userSelect: 'none',
@@ -28,11 +28,11 @@ function Item({
28
28
  }
29
29
 
30
30
  if (renderLeft) {
31
- css.paddingLeft = 4
31
+ css.paddingLeft = 5
32
32
  }
33
33
 
34
34
  if (renderRight) {
35
- css.paddingRight = 4
35
+ css.paddingRight = 5
36
36
  }
37
37
 
38
38
  if (isHighlighted) {
@@ -62,7 +62,7 @@ function Item({
62
62
  height="100%"
63
63
  position="absolute"
64
64
  top={0}
65
- left="-1px"
65
+ left={0.5}
66
66
  >
67
67
  {typeof renderLeft === 'function'
68
68
  ? renderRight()
@@ -83,7 +83,7 @@ function Item({
83
83
  height="100%"
84
84
  position="absolute"
85
85
  top={0}
86
- right="-1px"
86
+ right={0.5}
87
87
  >
88
88
  {typeof renderRight === 'function'
89
89
  ? renderRight()
package/src/Menu/Menu.js CHANGED
@@ -1,3 +1,4 @@
1
+ // @flow
1
2
  import React from 'react'
2
3
 
3
4
  import Card from '../Card'
@@ -5,7 +6,12 @@ import Card from '../Card'
5
6
  import Heading from './Heading'
6
7
  import Item from './Item'
7
8
 
8
- function Menu(props) {
9
+ export type Props = {
10
+ /** Often wraps `Menu.Item` and `Menu.Heading` components. */
11
+ children?: any,
12
+ }
13
+
14
+ function Menu(props: Props) {
9
15
  return (
10
16
  <Card
11
17
  paddingVertical={0.5}
package/src/Menu/Menu.mdx CHANGED
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: Menu
3
3
  category: General
4
+ propsSummary: Accepts [Card](/card) props.
4
5
  ---
5
6
 
6
7
  ```jsx live
@@ -19,7 +20,7 @@ render(
19
20
  <Menu.Item isHighlighted>Can be highlighted</Menu.Item>
20
21
  <Menu.Item>Should be used as a child of Menu</Menu.Item>
21
22
  <Menu.Item>
22
- <Icon name="person" marginRight={1} /> Add icons and other things
23
+ <Icon name="general.person" marginRight={1} /> Add icons and other things
23
24
  </Menu.Item>
24
25
  </Menu>
25
26
  )
@@ -7,6 +7,7 @@ import { useDocumentEvent } from '../hooks'
7
7
  import { trapFocus } from '../utils'
8
8
 
9
9
  export type ModalProps = {
10
+ children?: any,
10
11
  /**
11
12
  * Close the modal when clicking outside of it.
12
13
  */
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: Modal
3
3
  category: Overlays
4
+ propsSummary: Accepts [Box](/box) props.
4
5
  ---
5
6
 
6
7
  ```jsx live
@@ -5,6 +5,10 @@ import InputField from '../Input/InputField'
5
5
  import { padNumber, getTabbableSiblings } from '../utils'
6
6
 
7
7
  type Props = {
8
+ /**
9
+ * Render custom component or HTML element tag. (Defaults to a [InputField](/input.inputfield) component.). */
10
+ as?: any,
11
+
8
12
  /**
9
13
  * An array of keys to ignore when pushed.
10
14
  * ex: ["ArrowUp", "ArrowDown"].
@@ -29,11 +33,23 @@ type Props = {
29
33
  */
30
34
  onChange: (value: string) => null,
31
35
 
36
+ /**
37
+ * Maps to the input's `onBlur` prop.
38
+ */
39
+ onBlur?: () => null,
40
+
41
+ onKeyDown?: Function,
42
+
32
43
  /**
33
44
  * The amount of 0s to pad the value with.
34
45
  */
35
46
  pad: number,
36
47
 
48
+ /**
49
+ * Forces the input text to stay fully selected while interacting with it.
50
+ */
51
+ highlightOnInteraction: boolean,
52
+
37
53
  /**
38
54
  * String to display when value is empty.
39
55
  */
@@ -49,6 +65,9 @@ type Props = {
49
65
  * The value of the input.
50
66
  */
51
67
  value: number,
68
+
69
+ autoWidth: boolean,
70
+ moveFocusOnMax: boolean,
52
71
  }
53
72
 
54
73
  const MIN_VALUE = -Infinity
package/src/Page/Page.mdx CHANGED
@@ -102,7 +102,7 @@ render(
102
102
  }
103
103
  >
104
104
  <StackView axis="horizontal" alignment="center" spacing={2}>
105
- <Icon name="person" size="xxl" color="white" />
105
+ <Icon name="general.person" size="xxl" color="white" />
106
106
  <StackView>
107
107
  <Heading level={5} color="light-7">
108
108
  Steingard Tests > Sunday
@@ -48,6 +48,7 @@ function parseTrackValue(value) {
48
48
  const PageViewContext = createContext({})
49
49
 
50
50
  export type Props = {
51
+ children?: any,
51
52
  /**
52
53
  * Which axis the track moves on. Defaults to `horizontal`.
53
54
  */
@@ -1,7 +1,8 @@
1
1
  ---
2
2
  title: PagerView
3
3
  category: Layout
4
- summary: Allows paging between views. Use with the `useRovingIndex` hook to control the [activeViewIndex](#activeViewIndex).
4
+ summary: Allows paging between views. Use with the [useRovingIndex](https://github.com/ministrycentered/tapestry-react/blob/next/packages/tapestry-react/src/hooks/use-roving-index.js) hook to control the [activeViewIndex](#activeViewIndex).
5
+ propsSummary: Accepts [StackView](/stackview) props.
5
6
  ---
6
7
 
7
8
  ```jsx live
@@ -45,14 +46,14 @@ render(() => {
45
46
  <StackView axis="horizontal" distribution="center" spacing={1}>
46
47
  <Button
47
48
  title="Prev"
48
- icon={{ name: 'caret-left' }}
49
+ icon={{ name: 'general.leftChevron', size: 'sm' }}
49
50
  radius="circle"
50
51
  disabled={moveBackwardDisabled}
51
52
  onClick={() => moveActiveIndex(-1)}
52
53
  />
53
54
  <Button
54
55
  title="Next"
55
- icon={{ name: 'caret-right' }}
56
+ icon={{ name: 'general.rightChevron', size: 'sm' }}
56
57
  radius="circle"
57
58
  disabled={moveForwardDisabled}
58
59
  onClick={() => moveActiveIndex(1)}
@@ -83,7 +84,7 @@ function Arrangement({ expanded, expandOrShrink }) {
83
84
  actions={
84
85
  <Button
85
86
  title={expanded ? 'show single-view' : 'show multi-view'}
86
- icon={{ name: expanded ? 'caret-shrink' : 'caret-grow' }}
87
+ icon={{ name: expanded ? 'general.twoInwardChevrons' : 'general.twoOutwardChevrons' }}
87
88
  variant="naked"
88
89
  onClick={expandOrShrink}
89
90
  />
@@ -99,10 +100,10 @@ function Key({ name, expanded, expandOrShrink }) {
99
100
  <Toolbar
100
101
  title={name}
101
102
  actions={[
102
- <Button title="edit" icon={{ name: 'pencil' }} variant="naked" />,
103
+ <Button title="edit" icon={{ name: 'general.pencil' }} variant="naked" />,
103
104
  <Button
104
105
  title={expanded ? 'show single-view' : 'show multi-view'}
105
- icon={{ name: expanded ? 'caret-shrink' : 'caret-grow' }}
106
+ icon={{ name: expanded ? 'general.twoInwardChevrons' : 'general.twoOutwardChevrons' }}
106
107
  variant="naked"
107
108
  onClick={expandOrShrink}
108
109
  />,
@@ -157,7 +158,7 @@ render(() => {
157
158
  <GridView columns="auto 1fr auto" spacing={1}>
158
159
  <Button
159
160
  title="Prev"
160
- icon={{ name: 'caret-left' }}
161
+ icon={{ name: 'general.leftChevron', size: 'sm' }}
161
162
  radius="circle"
162
163
  disabled={moveBackwardDisabled}
163
164
  onClick={() => moveActiveIndex(-1)}
@@ -187,7 +188,7 @@ render(() => {
187
188
  </StackView>
188
189
  <Button
189
190
  title="Next"
190
- icon={{ name: 'caret-right' }}
191
+ icon={{ name: 'general.rightChevron', size: 'sm' }}
191
192
  radius="circle"
192
193
  disabled={moveForwardDisabled}
193
194
  onClick={() => moveActiveIndex(1)}
@@ -123,7 +123,7 @@ class Pagination extends Component<PaginationProps> {
123
123
  <Button
124
124
  onClick={onPageChange.bind(null, currentPage - 1)}
125
125
  disabled={currentPage === 1}
126
- icon={{ name: 'caret-left' }}
126
+ icon={{ name: 'general.leftChevron', size: 'xs' }}
127
127
  tooltip={{ title: 'Previous Page' }}
128
128
  variant="naked"
129
129
  shrink={0}
@@ -132,7 +132,7 @@ class Pagination extends Component<PaginationProps> {
132
132
  <Button
133
133
  onClick={onPageChange.bind(null, currentPage + 1)}
134
134
  disabled={currentPage === totalPages}
135
- icon={{ name: 'caret-right' }}
135
+ icon={{ name: 'general.rightChevron', size: 'xs' }}
136
136
  tooltip={{ title: 'Next Page' }}
137
137
  variant="naked"
138
138
  shrink={0}
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: Pagination
3
3
  category: General
4
+ propsSummary: Accepts [StackView](/stackview) props.
4
5
  ---
5
6
 
6
7
  ```jsx live
@@ -2,6 +2,7 @@
2
2
  import React from 'react'
3
3
 
4
4
  import Box from '../Box'
5
+ import { useThemeProps } from '../system'
5
6
 
6
7
  export type Props = {
7
8
  /**
@@ -14,8 +15,12 @@ export type Props = {
14
15
  activeColor?: string,
15
16
  }
16
17
 
17
- function Progress(props: Props) {
18
- const { value, activeColor = 'primary', ...restProps } = props
18
+ function Progress({ value, ...restProps }: Props) {
19
+ const { activeColor = 'primary', ...themeProps } = useThemeProps(
20
+ 'progress',
21
+ restProps
22
+ )
23
+
19
24
  return (
20
25
  <Box
21
26
  role="progressbar"
@@ -26,7 +31,7 @@ function Progress(props: Props) {
26
31
  position="relative"
27
32
  overflow="hidden"
28
33
  backgroundColor="grey-3"
29
- {...restProps}
34
+ {...themeProps}
30
35
  >
31
36
  <Box
32
37
  position="absolute"
@@ -2,6 +2,7 @@
2
2
  title: Progress
3
3
  category: Indicators
4
4
  summary: Display progress towards the completion of a task. Composes [Box](/box).
5
+ propsSummary: Accepts [Box](/box) props.
5
6
  ---
6
7
 
7
8
  ```jsx live
@@ -10,8 +10,8 @@ import VariantProvider from '../VariantProvider'
10
10
  import { useThemeValue } from '../system'
11
11
 
12
12
  const iconPaths = {
13
- fill: 'radio-0',
14
- checked: 'radio-1',
13
+ fill: 'tapestry.radio0',
14
+ checked: 'tapestry.radio1',
15
15
  }
16
16
 
17
17
  export type Props = {
@@ -25,6 +25,8 @@ export type Props = {
25
25
  */
26
26
  label?: string,
27
27
 
28
+ id?: string | number,
29
+
28
30
  /**
29
31
  * Checks the radio.
30
32
  */
@@ -2,6 +2,7 @@
2
2
  title: Radio
3
3
  category: Forms
4
4
  summary: Use radios to present a list of options where users can only make a single selection.
5
+ propsSummary: Accepts [StackView](/stackview) props.
5
6
  ---
6
7
 
7
8
  ```jsx live
@@ -4,6 +4,7 @@ import { clamp, snap } from '@popmotion/popcorn'
4
4
 
5
5
  import Box from '../Box'
6
6
  import { useMeasure } from '../hooks'
7
+ import { useThemeProps } from '../system'
7
8
 
8
9
  export type Props = {
9
10
  /**
@@ -34,6 +35,10 @@ export type Props = {
34
35
  progress?: Object,
35
36
  thumb?: Object,
36
37
  },
38
+ /**
39
+ * Prevents the slider from being used and lowers its opacity.
40
+ */
41
+ disabled?: boolean,
37
42
  }
38
43
 
39
44
  function RangeSlider(props: Props) {
@@ -44,10 +49,14 @@ function RangeSlider(props: Props) {
44
49
  disabled,
45
50
  value,
46
51
  onChange,
47
- variant = {},
48
52
  ...restProps
49
53
  } = props
50
54
 
55
+ const { variant = {}, ...themeProps } = useThemeProps(
56
+ 'rangeSlider',
57
+ restProps
58
+ )
59
+
51
60
  const snapTo = snap(step)
52
61
  const sliderRef = useRef()
53
62
  const trackRef = useRef()
@@ -185,7 +194,7 @@ function RangeSlider(props: Props) {
185
194
  opacity={disabled ? 0.65 : undefined}
186
195
  onMouseDown={disabled ? undefined : handleTrackPointerDown}
187
196
  onTouchStart={disabled ? undefined : handleTrackPointerDown}
188
- {...restProps}
197
+ {...themeProps}
189
198
  >
190
199
  <Box
191
200
  innerRef={trackRef}
@@ -2,6 +2,7 @@
2
2
  title: RangeSlider
3
3
  category: Forms
4
4
  summary: Allow the user to specify a numeric value which must be no less than a minimum value and no more than a maximum value. Composes [Box](/box).
5
+ propsSummary: Accepts [Box](/box) props.
5
6
  ---
6
7
 
7
8
  ```jsx live
@@ -9,16 +10,18 @@ render(() => {
9
10
  const [volume, setVolume] = React.useState(50)
10
11
  const muted = volume === 0
11
12
  return (
12
- <StackView axis="horizontal" alignment="center" width="25%" spacing={1}>
13
- <Icon>
14
- <Icon.Path name="volume-0" />
15
- <Icon.Path name="volume-1" visible={muted} />
16
- <Icon.Path name="volume-2" visible={!muted} />
17
- <Icon.Path name="volume-3" visible={!muted && volume > 50} />
18
- </Icon>
19
- <RangeSlider value={volume} onChange={setVolume} />
20
- <Text>{volume}</Text>
21
- </StackView>
13
+ <ThemeProvider theme={{ icons }}>
14
+ <StackView axis="horizontal" alignment="center" width="25%" spacing={1}>
15
+ <Icon>
16
+ <Icon.Path name="services.volume0" />
17
+ <Icon.Path name="services.volume1" visible={muted} />
18
+ <Icon.Path name="services.volume2" visible={!muted} />
19
+ <Icon.Path name="services.volume3" visible={!muted && volume > 50} />
20
+ </Icon>
21
+ <RangeSlider value={volume} onChange={setVolume} />
22
+ <Text>{volume}</Text>
23
+ </StackView>
24
+ </ThemeProvider>
22
25
  )
23
26
  })
24
27
  ```
@@ -1,8 +1,13 @@
1
+ // @flow
1
2
  import React from 'react'
2
3
 
3
4
  import Box from '../Box'
4
5
 
5
- function ScreenReader(props) {
6
+ export type Props = {
7
+ children?: any,
8
+ }
9
+
10
+ function ScreenReader(props: Props) {
6
11
  return (
7
12
  <Box
8
13
  css={{
@@ -2,6 +2,7 @@
2
2
  title: ScreenReader
3
3
  category: General
4
4
  summary: Use to display screen reader only content.
5
+ propsSummary: Accepts [Box](/box) props.
5
6
  ---
6
7
 
7
8
  ```jsx live
@@ -2,6 +2,7 @@
2
2
  title: Scrim
3
3
  category: Overlays
4
4
  summary: Scrims are used to display focused content like alerts, modals, or media previews.
5
+ propsSummary: Accepts [StackView](/stackview) props.
5
6
  ---
6
7
 
7
8
  ```jsx live
@@ -2,7 +2,13 @@ import * as React from 'react'
2
2
 
3
3
  import StackView from '../StackView'
4
4
 
5
- const Scrim = React.forwardRef(function (props, ref) {
5
+ type ScrimProps = {
6
+ /** Gain access to the internal ref. */
7
+ ref?: any,
8
+ children?: any,
9
+ }
10
+
11
+ const Scrim = React.forwardRef(function (props: ScrimProps,) {
6
12
  React.useLayoutEffect(() => {
7
13
  document.body.style.overflow = 'hidden'
8
14
  return () => {
@@ -11,7 +17,7 @@ const Scrim = React.forwardRef(function (props, ref) {
11
17
  }, [])
12
18
  return (
13
19
  <StackView
14
- innerRef={ref}
20
+ innerRef={props.ref}
15
21
  position="fixed"
16
22
  top={0}
17
23
  right={0}
@@ -5,6 +5,7 @@ import type { ChildrenArray } from 'react'
5
5
  import Heading from '../Heading'
6
6
  import Toolbar from '../Toolbar'
7
7
  import StackView from '../StackView'
8
+ import { useThemeProps } from '../system'
8
9
 
9
10
  import type { ToolbarProps } from '../Toolbar'
10
11
 
@@ -16,17 +17,27 @@ function Section({
16
17
  actions = [],
17
18
  children,
18
19
  count,
19
- countColor,
20
20
  helpContent,
21
21
  onStatusClearRequest,
22
22
  status,
23
23
  title,
24
24
  ...restProps
25
25
  }: SectionProps) {
26
+ const {
27
+ countColor,
28
+ headingProps,
29
+ toolbarProps,
30
+ ...themeProps
31
+ } = useThemeProps('section', restProps)
32
+
26
33
  return (
27
- <StackView as="section" {...restProps}>
34
+ <StackView as="section" {...themeProps}>
28
35
  <Toolbar
29
- title={<Heading level={3}>{title}</Heading>}
36
+ title={
37
+ <Heading level={3} {...headingProps}>
38
+ {title}
39
+ </Heading>
40
+ }
30
41
  helpContent={helpContent}
31
42
  actions={actions}
32
43
  count={count}
@@ -34,6 +45,7 @@ function Section({
34
45
  status={status}
35
46
  onStatusClearRequest={onStatusClearRequest}
36
47
  marginBottom={2}
48
+ {...toolbarProps}
37
49
  />
38
50
  {children}
39
51
  </StackView>
@@ -2,6 +2,7 @@
2
2
  title: Section
3
3
  category: General
4
4
  summary: Sections are used within `Page` components to break up content into sections that always display a `Toolbar` at the top.
5
+ propsSummary: Accepts [StackView](/stackview) props.
5
6
  ---
6
7
 
7
8
  ```jsx live
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: SegmentedControl
3
3
  category: General
4
+ propsSummary: Accepts [Input.Inputbox](/input.inputbox) props.
4
5
  ---
5
6
 
6
7
  ```jsx live
@@ -61,8 +62,8 @@ render(
61
62
  <SegmentedControl
62
63
  color="default"
63
64
  segments={[
64
- { title: 'Table', icon: { name: 'menu' }, tooltip: { title: 'Table' } },
65
- { title: 'Grid', icon: { name: 'layout' }, tooltip: { title: 'Grid' } },
65
+ { title: 'Table', icon: { name: 'general.showEye' }, tooltip: { title: 'Show' } },
66
+ { title: 'Grid', icon: { name: 'general.hideEye' }, tooltip: { title: 'Hide' } },
66
67
  ]}
67
68
  onChange={(selected) => console.log(selected)}
68
69
  />
@@ -33,6 +33,8 @@ type Props = {
33
33
  getTabLabel?: Function,
34
34
  onChange: Function,
35
35
  tabs: Array<any>,
36
+ /** Passes props to the composed [Tab](/tab) component. */
37
+ tabProps: object,
36
38
  }
37
39
 
38
40
  class SegmentedTabs extends Component<Props> {
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: SegmentedTabs
3
3
  category: General
4
+ propsSummary: Accepts [StackView](/stackview) props.
4
5
  ---
5
6
 
6
7
  ```jsx live
@@ -64,7 +64,7 @@ class Option extends Component<Props> {
64
64
  onChange={noop}
65
65
  />
66
66
  ) : selected ? (
67
- <Icon name="checkmark" size="sm" />
67
+ <Icon name="general.check" size="sm" />
68
68
  ) : (
69
69
  <Box width={2.5} height={2.5} />
70
70
  )
@@ -27,6 +27,14 @@ type Props = {
27
27
  * The value to show when nothing is selected
28
28
  */
29
29
  emptyValue?: any,
30
+ /**
31
+ * Disables the select.
32
+ */
33
+ disabled?: boolean,
34
+ /**
35
+ * Gain access to the internal ref
36
+ */
37
+ innerRef?: any,
30
38
  /**
31
39
  * Controls the initial Popover state: open or closed (default).
32
40
  */
@@ -46,6 +54,24 @@ type Props = {
46
54
  * returns { value, selectedValue }
47
55
  */
48
56
  onChange?: Function,
57
+ /**
58
+ * Maps to the select's `onFocus` prop.
59
+ */
60
+ onFocus?: () => null,
61
+
62
+ /**
63
+ * Maps to the select's `onBlur` prop.
64
+ */
65
+ onBlur?: () => null,
66
+ onClick?: Function,
67
+ onMouseUp?: Funtion,
68
+ onMouseDown?: Funtion,
69
+ onKeyUp?: Funtion,
70
+ onKeyDown?: Funtion,
71
+ /**
72
+ * Usually accepts `Select.OptionGroup` and `Select.Option`.
73
+ */
74
+ children?: any,
49
75
  /**
50
76
  * Pass an object instead of `children` for use when rendering in a non React environment.
51
77
  */
@@ -74,6 +100,41 @@ type Props = {
74
100
  * Initial `value` when component is uncontrolled.
75
101
  */
76
102
  defaultValue?: boolean | string | number | Array<any> | Function,
103
+ /**
104
+ * Locks external scrollbars when open.
105
+ */
106
+ lockScrollWhileOpen?: boolean,
107
+ /**
108
+ * Matches anchor and popover widths.
109
+ */
110
+ matchWidths?: boolean | 'minimum',
111
+ /**
112
+ * Attempts to keep popover in view clipping edges if too large.
113
+ */
114
+ keepInView?: boolean,
115
+ /**
116
+ * `'top-start'
117
+ | 'top'
118
+ | 'top-end'
119
+ | 'right-start'
120
+ | 'right'
121
+ | 'right-end'
122
+ | 'bottom-start'
123
+ | 'bottom'
124
+ | 'bottom-end'
125
+ | 'left-start'
126
+ | 'left'
127
+ | 'left-end'`
128
+
129
+ * Where to place the popover.
130
+ */
131
+ placement?: string,
132
+ /**
133
+ * Where to render the popover into. Accepts an HTML element or selector.
134
+ * Uses the closest fixed parent or `document.body` by default. This will only
135
+ * be computed once on initial render.
136
+ */
137
+ renderTo?: HTMLElement | string,
77
138
  /**
78
139
  * Accepts any valid [Popover](/popover) props.
79
140
  */
@@ -521,8 +582,8 @@ class Select extends Component<Props> {
521
582
  <Icon
522
583
  name={
523
584
  isPopoverVisible
524
- ? 'arrow-up'
525
- : 'arrow-down'
585
+ ? 'general.upCaret'
586
+ : 'general.downCaret'
526
587
  }
527
588
  />
528
589
  }
@@ -2,6 +2,7 @@
2
2
  title: Select
3
3
  category: Forms
4
4
  summary: Provide a list of options that can be selected. Replaces native select menus by using aria roles to enhance accessibility while allowing full customization of the options and what is used in the select popover. Composes [InputBox](/inputbox) and [Popover](/popover).
5
+ propsSummary: Accepts [InputBox](/input.inputbox) props.
5
6
  ---
6
7
 
7
8
  ```jsx live