@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,3 +1,4 @@
1
+ // @flow
1
2
  /** @jsxRuntime classic */
2
3
  /** @jsx jsx */
3
4
  import { jsx } from '@emotion/core'
@@ -13,7 +14,12 @@ import SidebarItem from './SidebarItem'
13
14
 
14
15
  const flexColumnCss = css({ display: 'flex', flexDirection: 'column' })
15
16
 
16
- function Sidebar({ children, ...restProps }) {
17
+ type Props = {
18
+ /** Only accepts `Sidebar.List` and `Sidebar.Item` components. */
19
+ children?: React.ReactNode,
20
+ }
21
+
22
+ function Sidebar({ children, ...restProps }: Props) {
17
23
  return (
18
24
  <StackView
19
25
  grow={1}
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: Sidebar
3
3
  category: General
4
+ propsSummary: Accepts [StackView](/stackview) props.
4
5
  ---
5
6
 
6
7
  ```jsx live
@@ -42,7 +42,7 @@ function SortableItem({
42
42
  >
43
43
  {!readOnly && (
44
44
  <Box {...provided.dragHandleProps} marginRight={1}>
45
- <Icon name="drag-handle" size="sm" color="foregroundTertiary" />
45
+ <Icon name="general.dragHandle" size="sm" color="foregroundTertiary" />
46
46
  </Box>
47
47
  )}
48
48
  {children}
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: Spinner
3
3
  category: Indicators
4
+ propsSummary: Accepts [Box](/box) props.
4
5
  ---
5
6
 
6
7
  ```jsx live
@@ -2,6 +2,7 @@
2
2
  title: StackView
3
3
  category: Layout
4
4
  summary: Lay out children in either a column or row. Wraps flexbox styles in a simple API inspired by Apple's UIStackView.
5
+ propsSummary: Accepts all valid HTML attributes.
5
6
  ---
6
7
 
7
8
  ```jsx live
@@ -65,7 +66,7 @@ render(() => {
65
66
  <Button
66
67
  size="xs"
67
68
  title="Add item"
68
- icon="add"
69
+ icon="general.plus"
69
70
  onClick={() => setItems([...items, defaultItem])}
70
71
  />
71
72
  </StackView>
@@ -137,3 +138,18 @@ render(
137
138
  </StackView>
138
139
  )
139
140
  ```
141
+
142
+ ## Setting Axis, Alignment and Distribution
143
+
144
+ The standard way of defining these flex settings is via props, but they can appear as:
145
+
146
+ - `StackView.BASELINE`
147
+ - `StackView.CENTER`
148
+ - `StackView.END`
149
+ - `StackView.FILL`
150
+ - `StackView.HORIZONTAL`
151
+ - `StackView.SPACE_BETWEEN`
152
+ - `StackView.SPACE_EVENLY`
153
+ - `StackView.START`
154
+ - `StackView.STRETCH`
155
+ - `StackView.VERTICAL`
@@ -5,6 +5,7 @@ import * as React from 'react'
5
5
 
6
6
  import { BoxProps } from '../Box'
7
7
  import splitStyles from '../system/split-styles'
8
+ import { spacingValue } from '../system'
8
9
  import { MediaQueries, Variants } from '../index'
9
10
  import { joinChildren } from '../utils'
10
11
  import { useVariant } from '../VariantProvider'
@@ -34,17 +35,19 @@ const stackViewPlugin = {
34
35
  } else if (styles.justifyContent === undefined) {
35
36
  styles.justifyContent = distribution
36
37
  }
37
- if (typeof spacing === 'number') {
38
- styles['& > *:not(:last-child)'] = {
39
- [`margin${axis === HORIZONTAL ? 'Right' : 'Bottom'}`]: spacing * 8,
40
- [`margin${axis === HORIZONTAL ? 'Bottom' : 'Right'}`]: 0,
41
- }
38
+ if (typeof spacing === 'number' || typeof spacing === 'string') {
39
+ styles.gap = spacingValue(spacing)
42
40
  }
43
41
  return styles
44
42
  },
45
43
  }
46
44
 
47
45
  export type StackViewProps = {
46
+ children?: any
47
+
48
+ /** Render custom component or HTML element tag. (Defaults to a `<div>` element). */
49
+ as?: any
50
+
48
51
  /** The axis along which children are laid out. */
49
52
  axis?: 'horizontal' | 'vertical'
50
53
 
@@ -60,8 +63,20 @@ export type StackViewProps = {
60
63
  | 'space-between'
61
64
  | 'space-evenly'
62
65
 
66
+ /** If true, sets `display: inline-flex`, otherwise it defaults to `display: flex` */
67
+ inline?: boolean
68
+
69
+ /** Gain access to the internal ref */
70
+ innerRef?: any
71
+
63
72
  /** The amount of space or element that is inserted between each child. */
64
73
  spacing?: number | string | React.ReactNode
74
+
75
+ /** Describes styles at various points in time. [Read about variants](/variants). */
76
+ variants?: object
77
+
78
+ /** Describes props at different breakpoints. [Read about mediaQueries](/responsive). */
79
+ mediaQueries?: object
65
80
  } & BoxProps
66
81
 
67
82
  type Props = React.RefAttributes<any> &
@@ -78,9 +93,9 @@ export function StackView({ as, children, inline, innerRef, ...props }: Props) {
78
93
  const childrenToRender =
79
94
  Element === 'textarea'
80
95
  ? undefined
81
- : typeof props.spacing === 'number' || props.spacing === undefined
82
- ? children
83
- : joinChildren(children, props.spacing)
96
+ : typeof props.spacing === 'object'
97
+ ? joinChildren(children, props.spacing)
98
+ : children
84
99
  return (
85
100
  <Element
86
101
  ref={innerRef}
@@ -1,26 +1,55 @@
1
+ // @flow
1
2
  import React from 'react'
2
3
 
3
4
  import Button from '../Button'
4
- import { useBoxSize } from '../system'
5
+ import { useBoxSize, useThemeProps } from '../system'
5
6
  import NumberField from '../NumberField'
6
7
  import StackView from '../StackView'
7
8
 
9
+ type Props = {
10
+ /**
11
+ * The current value of the stepper.
12
+ */
13
+ value?: number,
14
+ /**
15
+ * Minimum number that can be selected.
16
+ */
17
+ min?: number,
18
+ /**
19
+ * Maximum number that can be selected.
20
+ */
21
+ max?: number,
22
+ /**
23
+ * Specifies the size of each movement when incrementing/decrementing the value. Defaults to `1`.
24
+ */
25
+ step?: number,
26
+ /**
27
+ * Called when incrementing/decrementing the value.
28
+ */
29
+ onChange?: Function,
30
+ }
31
+
8
32
  function StepperField({
9
33
  min = -Infinity,
10
34
  max = Infinity,
11
35
  onChange,
12
- size = 'md',
13
36
  step = 1,
14
37
  value,
15
38
  ...restProps
16
- }) {
39
+ }: Props) {
40
+ const { size = 'md', ...themeProps } = useThemeProps(
41
+ 'stepperField',
42
+ restProps
43
+ )
44
+
17
45
  const { fontSize, paddingHorizontal, navigateSize } = useBoxSize(size)
46
+
18
47
  return (
19
- <StackView axis="horizontal" fontSize={fontSize} {...restProps}>
48
+ <StackView axis="horizontal" fontSize={fontSize} {...themeProps}>
20
49
  <Button
21
50
  size={size}
22
51
  title={`Decrement by ${step}`}
23
- icon={{ name: 'remove', size: navigateSize(size, -1) }}
52
+ icon={{ name: 'general.minus', size: navigateSize(size, -1) }}
24
53
  disabled={value <= min}
25
54
  onClick={() => onChange(Math.max(value - step, min))}
26
55
  />
@@ -37,7 +66,7 @@ function StepperField({
37
66
  <Button
38
67
  size={size}
39
68
  title={`Increment by ${step}`}
40
- icon={{ name: 'add', size: navigateSize(size, -1) }}
69
+ icon={{ name: 'general.plus', size: navigateSize(size, -1) }}
41
70
  disabled={value >= max}
42
71
  onClick={() => onChange(Math.min(value + step), max)}
43
72
  />
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  title: StepperField
3
3
  category: Forms
4
- summary: Number input used to collect numeric information from users with
5
- increment/decrement buttons.
4
+ summary: Number input used to collect numeric information from users with increment/decrement buttons.
5
+ propsSummary: Accepts [StackView](/stackview) props.
6
6
  ---
7
7
 
8
8
  ```jsx live
@@ -2,30 +2,29 @@
2
2
  import React, { Children } from 'react'
3
3
 
4
4
  import GridView from '../GridView'
5
-
6
5
  import StepperProgressContext from './Context'
7
-
8
- const ACTIVE_COLOR = 'primary-light'
6
+ import { useThemeProps } from '../system'
9
7
 
10
8
  export type Props = {
9
+ /** Often accepts `StepperProgress.Step` component. */
10
+ children?: React.ReactNode,
11
11
  /** Highlighted steps from the first step to this step index. */
12
12
  activeStepIndex?: number,
13
13
  /** Active color for each step indicator and line. Defaults to `primary-light`. */
14
14
  activeColor?: string,
15
15
  }
16
16
 
17
- function StepperProgress({
18
- activeStepIndex,
19
- activeColor = ACTIVE_COLOR,
20
- children,
21
- ...restProps
22
- }: Props) {
17
+ function StepperProgress({ activeStepIndex, children, ...restProps }: Props) {
18
+ const { activeColor = 'primary-light', ...themeProps } = useThemeProps(
19
+ 'stepperProgress',
20
+ restProps
21
+ )
23
22
  return (
24
23
  <GridView
25
24
  autoFlow="column"
26
25
  autoColumns="1fr"
27
26
  alignment="center"
28
- {...restProps}
27
+ {...themeProps}
29
28
  >
30
29
  {Children.map(children, (child, stepIndex) => (
31
30
  <StepperProgressContext.Provider
@@ -2,6 +2,7 @@
2
2
  title: StepperProgress
3
3
  category: Indicators
4
4
  summary: Use to convey progress through consecutive steps. Composes [GridView](/gridview).
5
+ propsSummary: Accepts [GridView](/gridview) props.
5
6
  ---
6
7
 
7
8
  ```jsx live
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: Summary
3
3
  category: General
4
+ propsSummary: Accepts [StackView](/stackview) props.
4
5
  ---
5
6
 
6
7
  ```jsx live
package/src/Tab/Tab.mdx CHANGED
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: Tab
3
3
  category: General
4
+ propsSummary: Accepts [Text](/text) props.
4
5
  ---
5
6
 
6
7
  ```jsx live
@@ -15,7 +15,7 @@ function ColumnPicker({
15
15
  return (
16
16
  <Dropdown
17
17
  variant="outline"
18
- icon={{ name: 'columns' }}
18
+ icon={{ name: 'general.threeVerticalBars' }}
19
19
  tooltip={{ title: 'Filter Columns' }}
20
20
  placement="bottom-end"
21
21
  closeOnSelect={false}
@@ -3,7 +3,7 @@ import React from 'react'
3
3
  import Icon from '../Icon'
4
4
 
5
5
  const DragHandle = () => (
6
- <Icon name="drag-handle" size="sm" color="foregroundTertiary" cursor="grab" />
6
+ <Icon name="general.dragHandle" size="sm" color="foregroundTertiary" cursor="grab" />
7
7
  )
8
8
 
9
9
  export default DragHandle
@@ -38,7 +38,7 @@ function NavigationArrow({
38
38
  transition: 'all 300ms ease',
39
39
  }
40
40
  const buttonProps = {
41
- icon: { name: `caret-${side}` },
41
+ icon: { name: `general.${side}Chevron` },
42
42
  title: `navigate ${side}`,
43
43
  theme: false,
44
44
  disabled: direction === 1 ? progress >= 0.99 : progress <= 0,
@@ -27,7 +27,7 @@ const SubRowToggleCell = ({
27
27
  // TODO: expose for better accessibility
28
28
  theme={false}
29
29
  title="Toggle row"
30
- icon={{ name: 'arrow-down' }}
30
+ icon={{ name: 'general.downCaret' }}
31
31
  transform={!toggled && 'rotate(-90deg)'}
32
32
  {...restProps}
33
33
  />
@@ -265,7 +265,7 @@ class Table extends PureComponent<TableProps> {
265
265
  }
266
266
 
267
267
  static getIconDirection(direction) {
268
- return direction === Table.ASC ? 'arrow-up' : 'arrow-down'
268
+ return direction === Table.ASC ? 'general.upCaret' : 'general.downCaret'
269
269
  }
270
270
 
271
271
  static defaultProps = {
@@ -188,7 +188,7 @@ class TableExample extends React.Component {
188
188
  marginLeft: 'auto',
189
189
  position: 'sticky',
190
190
  right: 0,
191
- header: <Icon name="person" />,
191
+ header: <Icon name="general.person" />,
192
192
  label: 'Age',
193
193
  cell: 'age',
194
194
  },
@@ -241,7 +241,7 @@ class TableExample extends React.Component {
241
241
  <Button
242
242
  title="Compact header"
243
243
  iconRight={
244
- this.state.compactHeader ? { name: 'checkmark' } : undefined
244
+ this.state.compactHeader ? { name: 'general.check' } : undefined
245
245
  }
246
246
  variant="outline"
247
247
  onClick={() =>
package/src/Tabs/Tab.js CHANGED
@@ -45,4 +45,5 @@ function Tab(props: Props) {
45
45
  )
46
46
  }
47
47
 
48
+ Tab.displayName = 'Tabs.Tab'
48
49
  export default Tab
package/src/Tabs/Tabs.js CHANGED
@@ -10,6 +10,11 @@ import TabPanel from './TabPanel'
10
10
  import TabPanels, { TABPANELS_DISPLAY_NAME } from './TabPanels'
11
11
 
12
12
  type Props = {
13
+ /**
14
+ * Usually accepts `TabList` and `TabPanel` components.
15
+ */
16
+ children?: React.ReactNode,
17
+
13
18
  /**
14
19
  * Controls the active `Tab` and `TabPanel`.
15
20
  */
package/src/Tabs/Tabs.mdx CHANGED
@@ -2,6 +2,7 @@
2
2
  title: Tabs
3
3
  category: General
4
4
  summary: A single content area with multiple panels, each associated with a header in a list.
5
+ propsSummary: Accepts [StackView](/stackview) props.
5
6
  ---
6
7
 
7
8
  ```jsx live
package/src/Text/Text.mdx CHANGED
@@ -2,6 +2,7 @@
2
2
  title: Text
3
3
  category: Primitives
4
4
  summary: Text is a primitive component that typography components build from.
5
+ propsSummary: Accepts all [style props](/style-props) and valid HTML attributes.
5
6
  order: 2
6
7
  ---
7
8
 
package/src/Text/Text.tsx CHANGED
@@ -58,6 +58,10 @@ const textPlugin = {
58
58
  }
59
59
 
60
60
  export type TextProps = {
61
+ /**
62
+ * Render custom component or HTML element tag. (Defaults to a `<div>` element).
63
+ */
64
+ as?: any
61
65
  /**
62
66
  * Gain access to the internal ref
63
67
  */
@@ -94,6 +98,14 @@ export type TextProps = {
94
98
  * Sets `whiteSpace: nowrap` when `false`
95
99
  */
96
100
  wrap?: boolean
101
+ /**
102
+ * Describes styles at various points in time. [Read about variants](/variants).
103
+ */
104
+ variants?: object
105
+ /**
106
+ * Describes props at different breakpoints. [Read about mediaQueries](/responsive).
107
+ */
108
+ mediaQueries?: object
97
109
  } & BoxProps
98
110
 
99
111
  type Props = React.RefAttributes<any> &
@@ -1,8 +1,14 @@
1
+ // @flow
1
2
  import React from 'react'
2
3
 
3
4
  import InputBox from '../Input/InputBox'
4
5
 
5
- function TextArea(props) {
6
+ export type Props = {
7
+ /** Provides an initial value to the `textarea`. */
8
+ defaultValue?: string,
9
+ }
10
+
11
+ function TextArea(props: Props) {
6
12
  return (
7
13
  <InputBox
8
14
  as="textarea"
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: TextArea
3
3
  category: Forms
4
+ propsSummary: Accepts [Input.InputBox](/Input.InputBox) props.
4
5
  ---
5
6
 
6
7
  ```jsx live
@@ -2,6 +2,7 @@
2
2
  title: TileView
3
3
  category: Layout
4
4
  summary: Auto place children into a grid and let the browser handle columns responsively, showing fewer columns on smaller viewports, and more columns as the viewport increases.
5
+ propsSummary: Accepts all valid HTML attributes.
5
6
  ---
6
7
 
7
8
  ```jsx live
@@ -17,18 +17,32 @@ const tileViewPlugin = {
17
17
  styles.gridTemplateColumns = `repeat(auto-fill, minmax(${parsedMinCellWidth}, 1fr))`
18
18
  }
19
19
  if (spacing !== undefined) {
20
- styles.gridGap = spacingValue(spacing)
20
+ styles.gap = spacingValue(spacing)
21
21
  }
22
22
  return styles
23
23
  },
24
24
  }
25
25
 
26
26
  export type TileViewProps = {
27
+ children?: any
28
+
29
+ /** Render custom component or HTML element tag. (Defaults to a `<div>` element).*/
30
+ as?: any
31
+
27
32
  /** The minimum width a cell must be. */
28
33
  minCellWidth?: number
29
34
 
30
35
  /** The amount of space between children. */
31
- spacing?: number
36
+ spacing?: number | string
37
+
38
+ /** Gain access to the internal ref */
39
+ innerRef?: any
40
+
41
+ /** Describes styles at various points in time. [Read about variants](/variants). */
42
+ variants?: object
43
+
44
+ /** Describes props at different breakpoints. [Read about mediaQueries](/responsive). */
45
+ mediaQueries?: object
32
46
  } & BoxProps
33
47
 
34
48
  type Props = React.RefAttributes<any> &
@@ -39,7 +53,7 @@ type Props = React.RefAttributes<any> &
39
53
 
40
54
  const defaultElement = 'div'
41
55
 
42
- export function TileView({ as, innerRef, ...props }) {
56
+ export function TileView({ as, innerRef, ...props }: Props) {
43
57
  const Element: React.ElementType = as || defaultElement
44
58
  const variant = useVariant()
45
59
  return (
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: TimeField
3
3
  category: Forms
4
+ propsSummary: Accepts [Input](/input) props.
4
5
  ---
5
6
 
6
7
  ```jsx live
@@ -19,7 +19,7 @@ function DefaultToken({
19
19
  size="sm"
20
20
  renderRight={
21
21
  <Icon
22
- name="close"
22
+ name="general.x"
23
23
  size="xs"
24
24
  cursor="pointer"
25
25
  onClick={() => removeToken(false)}
@@ -10,36 +10,42 @@ import DefaultToken from './DefaultToken'
10
10
 
11
11
  type Props = {
12
12
  /**
13
- * > `array` | defaults to `null`
13
+ * `array` | defaults to `null`
14
14
  * Controlled set of tokens.
15
15
  */
16
16
  tokens: Array<any>,
17
17
  /**
18
- * > `function(event: {
18
+ * ```js
19
+ * function(event: {
19
20
  * added: boolean
20
21
  * token: any,
21
22
  * tokenIndex: number,
22
23
  * tokens: array,
23
- * })`
24
+ * })
25
+ * ```
24
26
  * Callback when a token has been added or removed.
25
27
  */
26
28
  onChange: Function,
27
29
  /**
28
- * > `function(token: any, {
30
+ * ```js
31
+ * function(token: any, {
29
32
  * removeToken: func,
30
33
  * selectFirstToken: func,
31
34
  * selectLastToken: func,
32
35
  * selectNextToken: func,
33
36
  * selectPreviousToken: func,
34
37
  * tokenIndex: number
35
- * })`
38
+ * })
39
+ * ```
36
40
  * Control how a token is rendered. As long as this function returns a string,
37
41
  * it will use a default badge, otherwise pass any custom component and
38
42
  * functionality you need.
39
43
  */
40
44
  renderToken?: Function,
41
45
  /**
42
- * > `function(inputProps: object)`
46
+ * ```js
47
+ * function(inputProps: object)
48
+ * ```
43
49
  * Control how the internal input is rendered, `inputProps` must be passed
44
50
  * through to the rendered input.
45
51
  */
@@ -2,6 +2,7 @@
2
2
  title: TokenInput
3
3
  category: Forms
4
4
  summary: Allow users to add and delete multiple items, optionally using autocompletion as they type to find each item when paired with [`Combobox.Popover`](/combobox/#comboboxpopover).
5
+ propsSummary: Accepts [WrapView](/wrapview) props.
5
6
  ---
6
7
 
7
8
  ```jsx live
@@ -2,6 +2,7 @@
2
2
  title: Toolbar
3
3
  category: General
4
4
  summary: Toolbars are used to help separate content that have a title as well as an optional helper drawer and/or section actions.
5
+ propsSummary: Accepts [StackView](/stackview) props.
5
6
  ---
6
7
 
7
8
  ```jsx live
@@ -6,6 +6,10 @@ import Popover from '../Popover'
6
6
  import { composeEvents, pageViewChange } from '../utils'
7
7
 
8
8
  export type Props = {
9
+ /**
10
+ * The child becomes the trigger for the tooltip, unless it is overridden with `popoverProps={{relativeTo: ref}}`.
11
+ */
12
+ children?: any,
9
13
  /**
10
14
  * The amount of time in milliseconds before the tooltip closes.
11
15
  */
@@ -36,10 +40,45 @@ export type Props = {
36
40
  */
37
41
  triggerOnHover: boolean,
38
42
 
43
+ /**
44
+ * Attempts to keep popover in view clipping edges if too large.
45
+ */
46
+ keepInView?: boolean,
47
+
48
+ /**
49
+ * `'top-start'
50
+ | 'top'
51
+ | 'top-end'
52
+ | 'right-start'
53
+ | 'right'
54
+ | 'right-end'
55
+ | 'bottom-start'
56
+ | 'bottom'
57
+ | 'bottom-end'
58
+ | 'left-start'
59
+ | 'left'
60
+ | 'left-end'`
61
+
62
+ * Where to place the popover.
63
+ */
64
+ placement?: string,
65
+
66
+ /**
67
+ * Where to render the composed popover into. Accepts an HTML element or selector.
68
+ * Uses the closest fixed parent or `document.body` by default. This will only
69
+ * be computed once on initial render.
70
+ */
71
+ renderTo?: HTMLElement | string,
72
+
39
73
  /**
40
74
  * Accepts any valid [Popover](/popover) props.
41
75
  */
42
76
  popoverProps?: object,
77
+
78
+ /**
79
+ * Passes props to [Popover](/popover)'s `anchorElement`.
80
+ */
81
+ childProps?: object,
43
82
  }
44
83
 
45
84
  const emitter = mitt()