@planningcenter/tapestry-react 1.4.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (319) hide show
  1. package/dist/cjs/ActionsDropdown/ActionsDropdown.js +3 -3
  2. package/dist/cjs/Badge/Badge.js +41 -26
  3. package/dist/cjs/Badge/Status.js +2 -2
  4. package/dist/cjs/Calendar/Calendar.js +5 -3
  5. package/dist/cjs/Card/Card.js +2 -0
  6. package/dist/cjs/Checkbox/Checkbox.js +3 -3
  7. package/dist/cjs/ChurchCenterStatus/ChurchCenterStatus.js +4 -4
  8. package/dist/cjs/ColumnView/ColumnView.js +5 -2
  9. package/dist/cjs/Combobox/ComboboxPopover.js +2 -2
  10. package/dist/cjs/DataTable/components/CheckboxCell.js +4 -4
  11. package/dist/cjs/DataTable/components/ColumnPicker.js +6 -5
  12. package/dist/cjs/DataTable/hooks/useCollapsibleRows.js +1 -1
  13. package/dist/cjs/DataTable/hooks/useColumnSort.js +1 -1
  14. package/dist/cjs/DataTable/utils/getParsedColumns.js +4 -4
  15. package/dist/cjs/DateField/DateField.js +1 -1
  16. package/dist/cjs/Drawer/Drawer.js +4 -1
  17. package/dist/cjs/Dropdown/Dropdown.js +1 -1
  18. package/dist/cjs/Dropdown/Dropdown.test.js +194 -19
  19. package/dist/cjs/Dropdown/Link.js +3 -1
  20. package/dist/cjs/EditActions/EditActions.js +9 -3
  21. package/dist/cjs/FieldSet/FieldSet.js +24 -10
  22. package/dist/cjs/FilterLayout/FilterLayout.js +2 -1
  23. package/dist/cjs/Form/Form.js +1 -1
  24. package/dist/cjs/GridView/GridView.js +6 -4
  25. package/dist/cjs/Group/Group.js +10 -3
  26. package/dist/cjs/HeadingUppercase/HeadingUppercase.js +2 -2
  27. package/dist/cjs/HelperDrawer/HelperDrawer.js +1 -1
  28. package/dist/cjs/Highlight/Highlight.js +11 -5
  29. package/dist/cjs/Icon/Status.js +4 -4
  30. package/dist/cjs/Input/InputBox.js +1 -1
  31. package/dist/cjs/List/ListItem.js +1 -1
  32. package/dist/cjs/Menu/Heading.js +1 -0
  33. package/dist/cjs/Modal/Modal.test.js +156 -0
  34. package/dist/cjs/Pagination/Pagination.js +4 -2
  35. package/dist/cjs/Popover/Popover.js +4 -0
  36. package/dist/cjs/Popover/Popover.test.js +65 -0
  37. package/dist/cjs/Popover/rewireTabOrder.js +13 -30
  38. package/dist/cjs/Progress/Progress.js +12 -6
  39. package/dist/cjs/Radio/Radio.js +2 -2
  40. package/dist/cjs/RangeSlider/RangeSlider.js +10 -4
  41. package/dist/cjs/Scrim/Scrim.js +2 -2
  42. package/dist/cjs/Section/Section.js +14 -6
  43. package/dist/cjs/Select/Option.js +1 -1
  44. package/dist/cjs/Select/Select.js +10 -1
  45. package/dist/cjs/Sidebar/Sidebar.js +4 -3
  46. package/dist/cjs/Sortable/SortableItem.js +1 -1
  47. package/dist/cjs/StackView/StackView.js +5 -5
  48. package/dist/cjs/StepperField/StepperField.js +9 -6
  49. package/dist/cjs/StepperProgress/StepperProgress.js +9 -5
  50. package/dist/cjs/Table/ColumnPicker.js +1 -1
  51. package/dist/cjs/Table/DragHandle.js +1 -1
  52. package/dist/cjs/Table/NavigationArrow.js +1 -1
  53. package/dist/cjs/Table/SubRowToggleCell.js +1 -1
  54. package/dist/cjs/Table/Table.js +4 -6
  55. package/dist/cjs/Tabs/Tab.js +1 -0
  56. package/dist/cjs/ThemeProvider/ThemeProvider.js +5 -5
  57. package/dist/cjs/TileView/TileView.js +1 -1
  58. package/dist/cjs/TokenInput/DefaultToken.js +1 -1
  59. package/dist/cjs/Wizard/Wizard.js +2 -1
  60. package/dist/cjs/WrapView/WrapView.js +2 -27
  61. package/dist/cjs/hooks/use-accessibility-violation.js +1 -1
  62. package/dist/cjs/hooks/useConstant.js +23 -0
  63. package/dist/cjs/system/default-theme.js +8 -3
  64. package/dist/cjs/system/utils.js +2 -2
  65. package/dist/cjs/utils.js +3 -3
  66. package/dist/esm/ActionsDropdown/ActionsDropdown.js +3 -3
  67. package/dist/esm/Badge/Badge.js +42 -27
  68. package/dist/esm/Badge/Status.js +2 -2
  69. package/dist/esm/Calendar/Calendar.js +5 -3
  70. package/dist/esm/Card/Card.js +2 -3
  71. package/dist/esm/Checkbox/Checkbox.js +3 -3
  72. package/dist/esm/ChurchCenterStatus/ChurchCenterStatus.js +4 -4
  73. package/dist/esm/ColumnView/ColumnView.js +4 -2
  74. package/dist/esm/Combobox/ComboboxPopover.js +2 -2
  75. package/dist/esm/DataTable/components/CheckboxCell.js +4 -4
  76. package/dist/esm/DataTable/components/ColumnPicker.js +6 -5
  77. package/dist/esm/DataTable/hooks/useCollapsibleRows.js +1 -1
  78. package/dist/esm/DataTable/hooks/useColumnSort.js +1 -1
  79. package/dist/esm/DataTable/utils/getParsedColumns.js +4 -4
  80. package/dist/esm/DateField/DateField.js +1 -1
  81. package/dist/esm/Drawer/Drawer.js +3 -1
  82. package/dist/esm/Dropdown/Dropdown.js +1 -1
  83. package/dist/esm/Dropdown/Dropdown.test.js +158 -17
  84. package/dist/esm/Dropdown/Link.js +3 -1
  85. package/dist/esm/EditActions/EditActions.js +8 -3
  86. package/dist/esm/FieldSet/FieldSet.js +22 -10
  87. package/dist/esm/FilterLayout/FilterLayout.js +2 -1
  88. package/dist/esm/Form/Form.js +1 -1
  89. package/dist/esm/GridView/GridView.js +5 -4
  90. package/dist/esm/Group/Group.js +10 -3
  91. package/dist/esm/HeadingUppercase/HeadingUppercase.js +3 -3
  92. package/dist/esm/HelperDrawer/HelperDrawer.js +1 -1
  93. package/dist/esm/Highlight/Highlight.js +9 -5
  94. package/dist/esm/Icon/Status.js +4 -4
  95. package/dist/esm/Input/InputBox.js +1 -1
  96. package/dist/esm/List/ListItem.js +1 -1
  97. package/dist/esm/Menu/Heading.js +1 -0
  98. package/dist/esm/Modal/Modal.test.js +122 -0
  99. package/dist/esm/Pagination/Pagination.js +4 -2
  100. package/dist/esm/Popover/Popover.js +4 -0
  101. package/dist/esm/Popover/Popover.test.js +51 -0
  102. package/dist/esm/Popover/rewireTabOrder.js +13 -33
  103. package/dist/esm/Progress/Progress.js +10 -6
  104. package/dist/esm/Radio/Radio.js +2 -2
  105. package/dist/esm/RangeSlider/RangeSlider.js +8 -4
  106. package/dist/esm/Scrim/Scrim.js +2 -2
  107. package/dist/esm/Section/Section.js +12 -6
  108. package/dist/esm/Select/Option.js +1 -1
  109. package/dist/esm/Select/Select.js +10 -1
  110. package/dist/esm/Sidebar/Sidebar.js +4 -2
  111. package/dist/esm/Sortable/SortableItem.js +1 -1
  112. package/dist/esm/StackView/StackView.js +4 -5
  113. package/dist/esm/StepperField/StepperField.js +10 -7
  114. package/dist/esm/StepperProgress/StepperProgress.js +8 -5
  115. package/dist/esm/Table/ColumnPicker.js +1 -1
  116. package/dist/esm/Table/DragHandle.js +1 -1
  117. package/dist/esm/Table/NavigationArrow.js +1 -1
  118. package/dist/esm/Table/SubRowToggleCell.js +1 -1
  119. package/dist/esm/Table/Table.js +2 -3
  120. package/dist/esm/Tabs/Tab.js +1 -0
  121. package/dist/esm/ThemeProvider/ThemeProvider.js +1 -1
  122. package/dist/esm/TileView/TileView.js +1 -1
  123. package/dist/esm/TokenInput/DefaultToken.js +1 -1
  124. package/dist/esm/Wizard/Wizard.js +2 -1
  125. package/dist/esm/WrapView/WrapView.js +2 -28
  126. package/dist/esm/hooks/use-accessibility-violation.js +1 -1
  127. package/dist/esm/hooks/useConstant.js +15 -0
  128. package/dist/esm/system/default-theme.js +6 -2
  129. package/dist/esm/system/utils.js +1 -1
  130. package/dist/esm/utils.js +3 -3
  131. package/dist/types/Alert/Alert.d.ts +3 -0
  132. package/dist/types/Box/Box.d.ts +11 -2
  133. package/dist/types/Button/Button.d.ts +9 -1
  134. package/dist/types/Button/Input.d.ts +1 -1
  135. package/dist/types/Card/Card.d.ts +8 -1
  136. package/dist/types/Dropdown/Dropdown.test.d.ts +1 -1
  137. package/dist/types/GridView/GridView.d.ts +16 -4
  138. package/dist/types/Group/Group.d.ts +5 -1
  139. package/dist/types/Modal/Modal.test.d.ts +1 -0
  140. package/dist/types/Popover/Popover.test.d.ts +1 -0
  141. package/dist/types/Scrim/Scrim.d.ts +6 -1
  142. package/dist/types/StackView/StackView.d.ts +11 -0
  143. package/dist/types/Text/Text.d.ts +12 -0
  144. package/dist/types/TileView/TileView.d.ts +15 -7
  145. package/dist/types/WrapView/WrapView.d.ts +2 -1
  146. package/dist/types/hooks/useConstant.d.ts +1 -0
  147. package/package.json +16 -24
  148. package/src/ActionsDropdown/ActionsDropdown.tsx +3 -3
  149. package/src/Alert/Alert.mdx +1 -0
  150. package/src/Alert/Alert.tsx +5 -0
  151. package/src/Avatar/Avatar.mdx +1 -0
  152. package/src/Badge/Badge.js +66 -25
  153. package/src/Badge/Badge.mdx +2 -1
  154. package/src/Badge/Status.js +2 -2
  155. package/src/Badge/Status.mdx +1 -0
  156. package/src/Box/Box.mdx +2 -1
  157. package/src/Box/Box.tsx +13 -2
  158. package/src/Button/Button.mdx +4 -3
  159. package/src/Button/Button.tsx +11 -0
  160. package/src/Button/Input.mdx +2 -2
  161. package/src/Calendar/Calendar.js +8 -3
  162. package/src/Calendar/Calendar.mdx +1 -0
  163. package/src/Card/Card.mdx +1 -0
  164. package/src/Card/Card.tsx +7 -1
  165. package/src/Checkbox/Checkbox.js +8 -3
  166. package/src/Checkbox/Checkbox.mdx +1 -0
  167. package/src/CheckboxCard/CheckboxCard.js +26 -1
  168. package/src/CheckboxCard/CheckboxCard.mdx +1 -0
  169. package/src/CheckboxGroup/CheckboxGroup.js +6 -0
  170. package/src/CheckboxGroup/CheckboxGroup.mdx +1 -0
  171. package/src/ChurchCenterStatus/ChurchCenterStatus.mdx +1 -0
  172. package/src/ChurchCenterStatus/ChurchCenterStatus.tsx +4 -4
  173. package/src/Collapse/Collapse.js +2 -0
  174. package/src/ColumnView/ColumnView.js +7 -3
  175. package/src/ColumnView/ColumnView.mdx +1 -0
  176. package/src/Combobox/Combobox.js +11 -1
  177. package/src/Combobox/Combobox.mdx +2 -1
  178. package/src/Combobox/ComboboxPopover.js +2 -2
  179. package/src/DataTable/DataTable.js +48 -0
  180. package/src/DataTable/DataTable.mdx +2 -2
  181. package/src/DataTable/components/CheckboxCell.js +5 -4
  182. package/src/DataTable/components/ColumnPicker.js +4 -4
  183. package/src/DataTable/hooks/useCollapsibleRows.js +1 -1
  184. package/src/DataTable/hooks/useColumnSort.js +1 -1
  185. package/src/DataTable/utils/getParsedColumns.js +4 -4
  186. package/src/DateField/DateField.js +11 -1
  187. package/src/DateField/DateField.mdx +1 -0
  188. package/src/Divider/Divider.mdx +1 -0
  189. package/src/DragDrop/DragDrop.mdx +23 -9
  190. package/src/Drawer/Drawer.js +3 -0
  191. package/src/Drawer/Drawer.mdx +2 -1
  192. package/src/Dropdown/Dropdown.js +49 -3
  193. package/src/Dropdown/Dropdown.mdx +3 -2
  194. package/src/Dropdown/Dropdown.test.tsx +128 -17
  195. package/src/Dropdown/Link.js +3 -1
  196. package/src/EditActions/EditActions.js +18 -3
  197. package/src/EditActions/EditActions.mdx +1 -0
  198. package/src/Field/Field.js +15 -0
  199. package/src/Field/Field.mdx +1 -0
  200. package/src/FieldSet/FieldSet.js +35 -11
  201. package/src/FieldSet/FieldSet.mdx +1 -0
  202. package/src/FilterLayout/FilterLayout.mdx +1 -0
  203. package/src/FilterLayout/FilterLayout.tsx +4 -1
  204. package/src/Form/Form.js +1 -1
  205. package/src/Form/Form.mdx +26 -24
  206. package/src/GridView/GridView.mdx +2 -1
  207. package/src/GridView/GridView.tsx +27 -8
  208. package/src/Group/Group.mdx +8 -7
  209. package/src/Group/Group.tsx +12 -1
  210. package/src/Heading/Heading.js +6 -2
  211. package/src/Heading/Heading.mdx +1 -0
  212. package/src/HeadingUppercase/HeadingUppercase.js +9 -5
  213. package/src/HeadingUppercase/HeadingUppercase.mdx +1 -0
  214. package/src/HelperDrawer/HelperDrawer.js +10 -2
  215. package/src/HelperDrawer/HelperDrawer.mdx +1 -0
  216. package/src/Highlight/Highlight.js +6 -2
  217. package/src/Highlight/Highlight.mdx +1 -0
  218. package/src/Icon/Icon.js +6 -0
  219. package/src/Icon/Icon.mdx +42 -37
  220. package/src/Icon/Status.js +4 -4
  221. package/src/Input/Inline.js +11 -1
  222. package/src/Input/Inline.mdx +2 -1
  223. package/src/Input/Input.js +119 -1
  224. package/src/Input/Input.mdx +1 -6
  225. package/src/Input/InputBox.js +41 -1
  226. package/src/Input/InputBox.mdx +1 -0
  227. package/src/Input/InputField.js +32 -0
  228. package/src/Input/InputField.mdx +1 -0
  229. package/src/Input/InputLabel.mdx +1 -0
  230. package/src/Link/Link.js +10 -0
  231. package/src/Link/Link.mdx +2 -1
  232. package/src/LinkList/LinkList.js +7 -1
  233. package/src/LinkList/LinkList.mdx +1 -0
  234. package/src/List/List.js +25 -1
  235. package/src/List/List.mdx +1 -0
  236. package/src/List/ListItem.js +1 -1
  237. package/src/Logo/Logo.js +10 -1
  238. package/src/Logo/Logo.mdx +1 -0
  239. package/src/Menu/Heading.js +1 -0
  240. package/src/Menu/Menu.js +7 -1
  241. package/src/Menu/Menu.mdx +2 -1
  242. package/src/Modal/Modal.js +1 -0
  243. package/src/Modal/Modal.mdx +1 -0
  244. package/src/Modal/Modal.test.tsx +113 -0
  245. package/src/NumberField/NumberField.js +19 -0
  246. package/src/Page/Page.mdx +1 -1
  247. package/src/PagerView/PagerView.js +1 -0
  248. package/src/PagerView/PagerView.mdx +9 -8
  249. package/src/Pagination/Pagination.js +2 -2
  250. package/src/Pagination/Pagination.mdx +1 -0
  251. package/src/Popover/Popover.test.tsx +62 -0
  252. package/src/Popover/Popover.tsx +3 -0
  253. package/src/Popover/rewireTabOrder.ts +24 -42
  254. package/src/Progress/Progress.js +8 -3
  255. package/src/Progress/Progress.mdx +1 -0
  256. package/src/Radio/Radio.js +4 -2
  257. package/src/Radio/Radio.mdx +1 -0
  258. package/src/RangeSlider/RangeSlider.js +11 -2
  259. package/src/RangeSlider/RangeSlider.mdx +13 -10
  260. package/src/ScreenReader/ScreenReader.js +6 -1
  261. package/src/ScreenReader/ScreenReader.mdx +1 -0
  262. package/src/Scrim/Scrim.mdx +1 -0
  263. package/src/Scrim/Scrim.tsx +8 -2
  264. package/src/Section/Section.js +15 -3
  265. package/src/Section/Section.mdx +1 -0
  266. package/src/SegmentedControl/SegmentedControl.mdx +3 -2
  267. package/src/SegmentedTabs/SegmentedTabs.js +2 -0
  268. package/src/SegmentedTabs/SegmentedTabs.mdx +1 -0
  269. package/src/Select/Option.js +1 -1
  270. package/src/Select/Select.js +69 -2
  271. package/src/Select/Select.mdx +1 -0
  272. package/src/Sidebar/Sidebar.js +14 -6
  273. package/src/Sidebar/Sidebar.mdx +1 -0
  274. package/src/Sortable/SortableItem.js +1 -1
  275. package/src/Spinner/Spinner.mdx +1 -0
  276. package/src/StackView/StackView.mdx +17 -1
  277. package/src/StackView/StackView.tsx +23 -8
  278. package/src/StepperField/StepperField.js +35 -6
  279. package/src/StepperField/StepperField.mdx +2 -2
  280. package/src/StepperProgress/StepperProgress.js +9 -10
  281. package/src/StepperProgress/StepperProgress.mdx +1 -0
  282. package/src/Summary/Summary.mdx +1 -0
  283. package/src/Tab/Tab.mdx +1 -0
  284. package/src/Table/ColumnPicker.js +1 -1
  285. package/src/Table/DragHandle.js +1 -1
  286. package/src/Table/NavigationArrow.js +1 -1
  287. package/src/Table/SubRowToggleCell.js +1 -1
  288. package/src/Table/Table.js +2 -3
  289. package/src/Table/Table.mdx +2 -2
  290. package/src/Tabs/Tab.js +1 -0
  291. package/src/Tabs/Tabs.js +5 -0
  292. package/src/Tabs/Tabs.mdx +1 -0
  293. package/src/Text/Text.mdx +1 -0
  294. package/src/Text/Text.tsx +12 -0
  295. package/src/TextArea/TextArea.js +7 -1
  296. package/src/TextArea/TextArea.mdx +1 -0
  297. package/src/ThemeProvider/ThemeProvider.tsx +1 -1
  298. package/src/TileView/TileView.mdx +1 -0
  299. package/src/TileView/TileView.tsx +17 -3
  300. package/src/TimeField/TimeField.mdx +1 -0
  301. package/src/TokenInput/DefaultToken.js +1 -1
  302. package/src/TokenInput/TokenInput.js +12 -6
  303. package/src/TokenInput/TokenInput.mdx +1 -0
  304. package/src/Toolbar/Toolbar.mdx +1 -0
  305. package/src/Tooltip/Tooltip.js +39 -0
  306. package/src/Tooltip/Tooltip.mdx +4 -3
  307. package/src/Wizard/Wizard.js +1 -1
  308. package/src/Wizard/Wizard.mdx +7 -2
  309. package/src/WrapView/WrapView.mdx +1 -0
  310. package/src/WrapView/WrapView.tsx +6 -28
  311. package/src/hooks/use-accessibility-violation.tsx +1 -1
  312. package/src/hooks/useConstant.ts +17 -0
  313. package/src/system/default-theme.ts +7 -2
  314. package/src/system/utils.js +1 -1
  315. package/src/utils.js +3 -3
  316. package/src/utils.test.js +29 -0
  317. package/dist/cjs/icons.js +0 -126
  318. package/dist/esm/icons.js +0 -121
  319. package/src/icons.js +0 -121
@@ -1,10 +1,15 @@
1
+ // @flow
1
2
  import React from 'react'
2
3
 
3
4
  import Text from '../Text'
4
- import { useThemeValue } from '../system'
5
+ import { useThemeProps } from '../system'
5
6
 
6
- function HeadingUppercase({ children, ...restProps }) {
7
- const themedProps = useThemeValue('HeadingUppercase')
7
+ type Props = {
8
+ children?: any,
9
+ }
10
+
11
+ function HeadingUppercase({ children, ...restProps }: Props) {
12
+ const themeProps = useThemeProps('HeadingUppercase', restProps)
8
13
  return (
9
14
  <Text
10
15
  as="span"
@@ -15,8 +20,7 @@ function HeadingUppercase({ children, ...restProps }) {
15
20
  color="foregroundSecondary"
16
21
  shrink={0}
17
22
  margin={0}
18
- {...themedProps}
19
- {...restProps}
23
+ {...themeProps}
20
24
  >
21
25
  {children}
22
26
  </Text>
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: HeadingUppercase
3
3
  category: General
4
+ propsSummary: Accepts [Text](/text) props.
4
5
  ---
5
6
 
6
7
  ```jsx live
@@ -1,3 +1,4 @@
1
+ // @flow
1
2
  /** @jsxRuntime classic */
2
3
  /** @jsx jsx */
3
4
  import { jsx } from '@emotion/core'
@@ -22,7 +23,7 @@ function Toggle({ drawerId, ...restProps }) {
22
23
  )
23
24
  return (
24
25
  <Button
25
- icon={{ name: 'info' }}
26
+ icon={{ name: 'general.outlinedInfoCircle' }}
26
27
  tooltip={{ title: 'More info' }}
27
28
  size="xs"
28
29
  theme={false}
@@ -35,7 +36,14 @@ function Toggle({ drawerId, ...restProps }) {
35
36
  )
36
37
  }
37
38
 
38
- function HelperDrawer({ children, id, ...restProps }) {
39
+ type Props = {
40
+ children?: any,
41
+
42
+ /** Used by the `HelperDrawer.Toggle` to connect to. */
43
+ id?: string | number,
44
+ }
45
+
46
+ function HelperDrawer({ children, id, ...restProps }: Props) {
39
47
  const [open, setOpen] = useState(false)
40
48
  useEffect(() => {
41
49
  drawerToggles[id] = () => setOpen((open) => !open)
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: HelperDrawer
3
3
  category: General
4
+ propsSummary: Accepts [Text](/text) props.
4
5
  ---
5
6
 
6
7
  ```jsx live
@@ -3,6 +3,7 @@ import React from 'react'
3
3
 
4
4
  import Text from '../Text'
5
5
 
6
+ import { useThemeProps } from '../system'
6
7
  import { markFuzzyMatchSubstring, markStartsWithMatchSubstring } from './utils'
7
8
 
8
9
  type Props = {
@@ -31,14 +32,17 @@ type Props = {
31
32
  * Highlight or mark letters in a string using a provided query.
32
33
  */
33
34
  function Highlight({
34
- color = 'primary',
35
35
  marker = markStartsWithMatchSubstring,
36
36
  query,
37
37
  text,
38
38
  ...restProps
39
39
  }: Props) {
40
+ const { color = 'primary', ...themeProps } = useThemeProps(
41
+ 'highlight',
42
+ restProps
43
+ )
40
44
  return (
41
- <Text as="span" {...restProps}>
45
+ <Text as="span" {...themeProps}>
42
46
  {marker(text, query).map((part, index) => (
43
47
  <Text
44
48
  key={index}
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: Highlight
3
3
  category: General
4
+ propsSummary: Accepts [Text](/text) props.
4
5
  ---
5
6
 
6
7
  ```jsx live
package/src/Icon/Icon.js CHANGED
@@ -15,6 +15,12 @@ const sizes = {
15
15
  }
16
16
 
17
17
  type Props = {
18
+ /** Accepts the `Icon.Path` component if a `name` is not provided. */
19
+ children?: React.ReactNode,
20
+
21
+ /** Render custom component or HTML element tag. */
22
+ as?: any,
23
+
18
24
  /** The name of the icon to render. */
19
25
  name: string,
20
26
 
package/src/Icon/Icon.mdx CHANGED
@@ -2,53 +2,58 @@
2
2
  title: Icon
3
3
  category: Primitives
4
4
  summary: Icons are used to help visually communicate actions and information to the end user.
5
+ propsSummary: Accepts [Box](/box) props.
5
6
  order: 3
6
7
  ---
7
8
 
8
9
  ## Single icon sets
9
10
 
11
+ By default, components have access to the `general` icon set. Additional icon groups can be imported through your app's ThemeProvider.
12
+
13
+ Example usage: `general.iconNameCamelCase`
14
+
10
15
  ```jsx live
11
16
  render(() => {
12
17
  const [value, setValue] = React.useState('')
13
- const [appName, setAppName] = React.useState(undefined)
14
- const defaultIcons = designSystem.useThemeValue('icons')
15
- const iconsToRender = appName ? icons[appName] : defaultIcons
18
+ const [appName, setAppName] = React.useState('general')
19
+
16
20
  return (
17
- <StackView grow={1}>
18
- <StackView axis="horizontal" spacing={2}>
19
- <Select
20
- basis={26}
21
- emptyValue="Choose icon set"
22
- onChange={(event) => setAppName(event.value)}
23
- >
24
- {appNames.map((appName) => (
25
- <Select.Option key={appName} value={appName}>
26
- {appName}
27
- </Select.Option>
28
- ))}
29
- </Select>
30
- <Input
31
- grow={1}
32
- autoFocus
33
- renderLeft={<Icon name="search" />}
34
- placeholder="Search by icon name"
35
- value={value}
36
- onChange={(e) => setValue(e.target.value)}
37
- />
38
- </StackView>
39
- <ThemeProvider theme={{ icons: iconsToRender }}>
40
- <TileView minCellWidth={16} margin={4} spacing={4}>
41
- {matchSorter(Object.keys(iconsToRender), value).map((iconName) => (
42
- <StackView key={iconName} alignment="center" spacing={1}>
43
- <Icon key={iconName} name={iconName} size="xl" />
44
- <Text fontSize={5} color="foregroundSecondary">
45
- {iconName}
46
- </Text>
47
- </StackView>
48
- ))}
21
+ <ThemeProvider theme={{ icons }}>
22
+ <StackView grow={1}>
23
+ <StackView axis="horizontal" spacing={2}>
24
+ <Select
25
+ basis={26}
26
+ emptyValue="Choose icon set"
27
+ onChange={(event) => setAppName(event.value)}
28
+ defaultValue={appName}
29
+ >
30
+ {appNames.map((appName) => (
31
+ <Select.Option key={appName} value={appName}>
32
+ {appName}
33
+ </Select.Option>
34
+ ))}
35
+ </Select>
36
+ <Input
37
+ grow={1}
38
+ autoFocus
39
+ renderLeft={<Icon name="general.search" />}
40
+ placeholder="Search by icon name"
41
+ value={value}
42
+ onChange={(e) => setValue(e.target.value)}
43
+ />
44
+ </StackView>
45
+ <TileView minCellWidth={16} spacing={4} margin={4}>
46
+ {matchSorter(Object.keys(icons[appName]), value).map((iconName) => (
47
+ <StackView key={iconName} alignment="center" spacing={1}>
48
+ <Icon key={iconName} name={`${appName}.${iconName}`} size="xl" />
49
+ <Text fontSize={5} color="foregroundSecondary">
50
+ {iconName}
51
+ </Text>
52
+ </StackView>
53
+ ))}
49
54
  </TileView>
50
- </ThemeProvider>
51
- </StackView>
55
+ </StackView>
56
+ </ThemeProvider>
52
57
  )
53
58
  })
54
59
  ```
@@ -5,9 +5,9 @@ import Icon from './Icon'
5
5
  import Path from './Path'
6
6
 
7
7
  const STATUS_VARIANTS = {
8
- confirmed: ['checkmark-circle', 'success'],
9
- unconfirmed: ['question-circle', 'warning'],
10
- declined: ['close-circle', 'error'],
8
+ confirmed: ['general.outlinedCircleCheck', 'success'],
9
+ unconfirmed: ['general.outlinedQuestionCircle', 'warning'],
10
+ declined: ['general.outlinedXCircle', 'error'],
11
11
  }
12
12
 
13
13
  export type Props = {
@@ -33,7 +33,7 @@ function Status(props: Props) {
33
33
  }
34
34
  return (
35
35
  <Icon name={variantName} color={color || variantColor} {...restProps}>
36
- <Path name="radio-0" color={color} />
36
+ <Path name="tapestry.radio0" color={color} />
37
37
  </Icon>
38
38
  )
39
39
  }
@@ -4,8 +4,18 @@ import React from 'react'
4
4
  import InputField from './InputField'
5
5
 
6
6
  type Props = {
7
- /** Controls the color when hovered and focused. */
7
+ /** Controls the color when hovered and focused. (Defaults `light ? 'light-0' : 'highlight'` */
8
8
  highlightColor: string,
9
+
10
+ /**
11
+ * Pass styles for when the input is focused.
12
+ */
13
+ focus?: boolean,
14
+
15
+ /**
16
+ * Sets `backgroundColor: highlightColor` if `readOnly` or `disabled` are not set.
17
+ */
18
+ hover?: boolean,
9
19
  }
10
20
 
11
21
  function Inline({
@@ -2,6 +2,7 @@
2
2
  title: Input.Inline
3
3
  category: Forms
4
4
  summary: Composes [Input.InputField](/input.inputfield) with minimal styling.
5
+ propsSummary: Accepts props for [Input.InputField](/input.inputfield).
5
6
  ---
6
7
 
7
8
  ```jsx live
@@ -25,7 +26,7 @@ function App() {
25
26
  backgroundColor="surfaceTertiary"
26
27
  overflow="auto"
27
28
  >
28
- <Icon name="person" size="xl" />
29
+ <Icon name="general.person" size="xl" />
29
30
  <Input.Inline
30
31
  highlightColor="dark-1"
31
32
  size="xl"
@@ -1,9 +1,127 @@
1
+ // @flow
1
2
  import React, { Component } from 'react'
2
3
 
3
4
  import InputBox from './InputBox'
4
5
  import InputField from './InputField'
5
6
 
6
- class Input extends Component {
7
+ type InputProps = {
8
+ /**
9
+ * Names the input and required to submit the input's `value`.
10
+ */
11
+ name: string,
12
+
13
+ /**
14
+ * Used to identify an input.
15
+ */
16
+ id?: string | number,
17
+
18
+ /** Specifies the type of form control to render. [Learn more on MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types) */
19
+ type?: string,
20
+
21
+ /** Provides an initial value to the input. */
22
+ defaultValue?: string,
23
+
24
+ /** User provided value that is passed to input. */
25
+ value?: string,
26
+
27
+ placeholder?: string,
28
+
29
+ /**
30
+ * Disables the input.
31
+ */
32
+ disabled?: boolean,
33
+
34
+ /**
35
+ * Prevents the user from editing the input, but still submits and receives focus.
36
+ */
37
+ readOnly: boolean,
38
+
39
+ /**
40
+ * Sets the input's width to the exact size of the text plus padding and cursor.
41
+ * Allows a string to be passed for measuring if input value is different from displayed value.
42
+ */
43
+ autoWidth?: boolean | number | string,
44
+
45
+ /**
46
+ * Accepts "on" or "off" values. [Learn more on MDN.](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete)
47
+ */
48
+ autoComplete?: string,
49
+
50
+ /**
51
+ * Input will receive focus on page load. (Limit to one per page.)
52
+ */
53
+ autoFocus?: boolean,
54
+
55
+ /**
56
+ * Pass styles for when the input is focused.
57
+ */
58
+ focus?: object,
59
+
60
+ /**
61
+ * Pass styles for when the input is hovered.
62
+ */
63
+ hover?: object,
64
+
65
+ /**
66
+ * Defines the minimum value that is acceptable and valid for the input. [Learn more on MDN.](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/min)
67
+ */
68
+ min?: string,
69
+
70
+ /**
71
+ * Defines the maximum value that is acceptable and valid for the input. [Learn more on MDN.](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/max)
72
+ */
73
+ max?: string,
74
+
75
+ /**
76
+ * defines the maximum number of characters the input will accept. [Learn more on MDN.](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/minlength)
77
+ */
78
+ minLength?: string,
79
+
80
+ /**
81
+ * defines the maximum number of characters the input will accept. [Learn more on MDN.](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/maxlength)
82
+ */
83
+ maxLength?: string,
84
+
85
+ /**
86
+ * Maps to the internal input's `onChange` prop.
87
+ */
88
+ onChange?: () => null,
89
+
90
+ /**
91
+ * Maps to the internal input's `onFocus` prop.
92
+ */
93
+ onFocus?: () => null,
94
+
95
+ /**
96
+ * Maps to the internal input's `onBlur` prop.
97
+ */
98
+ onBlur?: () => null,
99
+
100
+ onKeyDown?: Funtion,
101
+ onKeyUp?: Funtion,
102
+
103
+ /**
104
+ * Forces the input text to stay fully selected while interacting with it.
105
+ */
106
+ highlightOnInteraction?: boolean,
107
+
108
+ /**
109
+ * Changes background color of the input. Both [theme colors](/colors) and html values are supported.
110
+ */
111
+ backgroundColor?: string,
112
+
113
+ /**
114
+ * Changes color of the input's value. Both [theme colors](/colors) and html values are supported.
115
+ */
116
+ color?: string,
117
+
118
+ /**
119
+ * Changes color of the input's placeholder text. Both [theme colors](/colors) and html values are supported.
120
+ */
121
+ placeholderColor?: string,
122
+ }
123
+
124
+ class Input extends Component<InputProps> {
7
125
  setInputNode = (node) => {
8
126
  this.inputNode = node
9
127
  }
@@ -2,6 +2,7 @@
2
2
  title: Input
3
3
  category: Forms
4
4
  summary: Composes [Input.InputBox](/input.inputbox) and [Input.InputField](/input.inputfield).
5
+ propsSummary: Accepts props for [Input.InputBox](/input.inputbox) _and_ [Input.InputField](/input.inputfield), remaining props are forwarded to `Input.InputBox`.
5
6
  ---
6
7
 
7
8
  ```jsx live
@@ -25,9 +26,3 @@ render(() => (
25
26
  </GridView>
26
27
  ))
27
28
  ```
28
-
29
- ## Props
30
-
31
- ---
32
-
33
- Accepts props for [Input.InputBox](/input.inputbox) _and_ [Input.InputField](/input.inputfield), remaining props are forwarded to `Input.InputBox`.
@@ -25,6 +25,21 @@ export type InputBoxProps = {
25
25
  */
26
26
  evenPadding?: boolean,
27
27
 
28
+ /**
29
+ * Gain access to the internal ref
30
+ */
31
+ innerRef?: any,
32
+
33
+ /**
34
+ * Used to identify an input.
35
+ */
36
+ id?: string | number,
37
+
38
+ /**
39
+ * Typically accepts a form control like `input` or [Input.InputField](/input.inputfield).
40
+ */
41
+ children?: any,
42
+
28
43
  /**
29
44
  * Which child index should be focused when the focus method is called.
30
45
  */
@@ -59,6 +74,16 @@ export type InputBoxProps = {
59
74
  */
60
75
  onClear?: () => void,
61
76
 
77
+ /**
78
+ * Maps to the internal input's `onFocus` prop.
79
+ */
80
+ onFocus?: () => null,
81
+
82
+ /**
83
+ * Maps to the internal input's `onBlur` prop.
84
+ */
85
+ onBlur?: () => null,
86
+
62
87
  /**
63
88
  * Allows rendering any content inside the beginning of the input box.
64
89
  */
@@ -80,10 +105,25 @@ export type InputBoxProps = {
80
105
  */
81
106
  state?: 'error' | 'success',
82
107
 
108
+ /**
109
+ * Determines where in the tab order the input should be placed for focused. (Defaults to `-1`).
110
+ */
111
+ tabIndex?: number,
112
+
83
113
  /**
84
114
  * Applies subdued styling when using `InputBox` as a secondary element.
85
115
  */
86
116
  subdued?: boolean,
117
+
118
+ /**
119
+ * Applies dropshadow while focusing on an input. (Defaults to `true`).
120
+ */
121
+ secondaryStroke?: boolean,
122
+
123
+ /**
124
+ * Changes background color of the input. Both [theme colors](/colors) and html values are supported.
125
+ */
126
+ backgroundColor?: string,
87
127
  }
88
128
 
89
129
  // temporary until InputBox is converted to a functional component
@@ -379,7 +419,7 @@ class InputBox extends Component<InputBoxProps> {
379
419
  <Spinner size={size} />
380
420
  ) : onClear ? (
381
421
  <Button
382
- icon={{ name: 'close' }}
422
+ icon={{ name: 'general.x' }}
383
423
  title="clear input value"
384
424
  size={size}
385
425
  theme={false}
@@ -2,6 +2,7 @@
2
2
  title: Input.InputBox
3
3
  category: Forms
4
4
  summary: A base component used in Input as well as [SegmentedControl](/segmentedcontrol), [Select](/select), and [TokenInput](/tokeninput).
5
+ propsSummary: Accepts [StackView](/stackview) props.
5
6
  ---
6
7
 
7
8
  ```jsx live
@@ -32,6 +32,11 @@ const resetStyles = {
32
32
  }
33
33
 
34
34
  export type InputFieldProps = {
35
+ /**
36
+ * Gain access to the internal ref
37
+ */
38
+ innerRef?: any,
39
+
35
40
  /**
36
41
  * Sets the input's width to the exact size of the text plus padding and cursor.
37
42
  * Allows a string to be passed for measuring if input value is different from displayed value.
@@ -57,6 +62,33 @@ export type InputFieldProps = {
57
62
  * Size of the input font-size, and line-height. Based on [theming sizes](/theming#boxsizes).
58
63
  */
59
64
  size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl',
65
+
66
+ /**
67
+ * Pass styles to base Box component.
68
+ */
69
+ size?: object,
70
+
71
+ /**
72
+ * Disables the input.
73
+ */
74
+ disabled?: boolean,
75
+
76
+ /**
77
+ * Maps to the input's `onChange` prop.
78
+ */
79
+ onChange?: () => null,
80
+
81
+ /**
82
+ * Maps to the input's `onFocus` prop.
83
+ */
84
+ onFocus?: () => null,
85
+
86
+ /**
87
+ * Maps to the input's `onBlur` prop.
88
+ */
89
+ onBlur?: () => null,
90
+
91
+ onKeyDown?: Funtion,
60
92
  }
61
93
 
62
94
  class InputField extends Component<InputFieldProps> {
@@ -2,6 +2,7 @@
2
2
  title: Input.InputField
3
3
  category: Forms
4
4
  summary: The base component used in Input as well as Input.Inline and Combobox.Input. Provides a clean input base to build on top of.
5
+ propsSummary: Accepts [Box](/box) props.
5
6
  ---
6
7
 
7
8
  ```jsx live
@@ -2,6 +2,7 @@
2
2
  title: Input.InputLabel
3
3
  category: Forms
4
4
  summary: Provides accessibility as well as usability improvements for mouse users by allowing the user to click the <InputLabel/> component to focus the respective control. This mimics the browsers native label tag, but allows use with custom components like <Select/>.
5
+ propsSummary: Accepts [Text](/text) props.
5
6
  ---
6
7
 
7
8
  ```jsx live
package/src/Link/Link.js CHANGED
@@ -23,6 +23,16 @@ type Props = {
23
23
  * Show an underline when hovering link. Defaults to `true`.
24
24
  */
25
25
  underline: boolean,
26
+
27
+ /**
28
+ * Accepts hover styles.
29
+ */
30
+ hover?: object,
31
+
32
+ /**
33
+ * Accepts hover styles.
34
+ */
35
+ focus?: object,
26
36
  }
27
37
 
28
38
  function Link({
package/src/Link/Link.mdx CHANGED
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: Link
3
3
  category: General
4
+ propsSummary: Accepts [Text](/text) props.
4
5
  ---
5
6
 
6
7
  ```jsx live
@@ -18,7 +19,7 @@ render(
18
19
  alignment="center"
19
20
  padding={1}
20
21
  backgroundColor="primary"
21
- spacing={<Icon name="caret-right" color="white" marginHorizontal={0.25} />}
22
+ spacing={<Icon name="general.rightChevron" size="xs" color="white" marginHorizontal={0.5} />}
22
23
  >
23
24
  <Link to="#" color="white">
24
25
  First Church Of Carlsbad
@@ -1,10 +1,16 @@
1
+ // @flow
1
2
  import React from 'react'
2
3
 
3
4
  import Divider from '../Divider'
4
5
  import Link from '../Link'
5
6
  import StackView from '../StackView'
6
7
 
7
- function LinkList({ links, ...restProps }) {
8
+ type Props = {
9
+ /** Accepts an array of objects that specify the `name` and `url` for each link. */
10
+ links?: array,
11
+ }
12
+
13
+ function LinkList({ links, ...restProps }: Props) {
8
14
  return (
9
15
  <StackView
10
16
  axis="horizontal"
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: LinkList
3
3
  category: General
4
+ propsSummary: Accepts [StackView](/stackview) props.
4
5
  ---
5
6
 
6
7
  ```jsx live