@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,8 +1,9 @@
1
1
  import React from 'react';
2
2
  import { BoxProps } from '../Box';
3
3
  export declare type WrapViewProps = {
4
+ children?: any;
4
5
  /** The amount of space between children. */
5
- spacing?: number;
6
+ spacing?: number | string;
6
7
  } & BoxProps;
7
8
  declare type Props = React.RefAttributes<any> & React.HTMLAttributes<any> & WrapViewProps;
8
9
  export declare function WrapView({ children, spacing, ...restProps }: Props): JSX.Element;
@@ -0,0 +1 @@
1
+ export default function useConstant<T>(fn: () => T): T;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@planningcenter/tapestry-react",
3
- "version": "1.4.0",
3
+ "version": "2.0.0",
4
4
  "description": "A collection of flexible React components to help you build resilient, accessible user interfaces quickly and effectively.",
5
5
  "author": "Front End Systems Engineering <frontend@pco.bz>",
6
6
  "main": "dist/cjs/index.js",
@@ -57,8 +57,10 @@
57
57
  "@babel/preset-typescript": "^7.12.17",
58
58
  "@emotion/cache": "10.0.29",
59
59
  "@emotion/core": "10.0.35",
60
+ "@testing-library/jest-dom": "^5.11.9",
60
61
  "@testing-library/react": "^11.2.5",
61
62
  "@testing-library/react-hooks": "5.0.3",
63
+ "@testing-library/user-event": "^13.1.9",
62
64
  "@types/jest": "^26.0.20",
63
65
  "babel-eslint": "10.1.0",
64
66
  "chokidar-cli": "^2.1.0",
@@ -83,40 +85,30 @@
83
85
  "react-dom": "^17.0.1",
84
86
  "react-test-renderer": "17.0.1",
85
87
  "rimraf": "3.0.2",
86
- "semantic-release": "17.3.9",
88
+ "semantic-release": "19.0.3",
87
89
  "svgo": "^2.1.0",
88
90
  "svgson": "4.1.0",
91
+ "type-fest": "^0.21.1",
89
92
  "typescript": "^4.1.5"
90
93
  },
91
94
  "dependencies": {
95
+ "@planningcenter/icons": "^14.0.0",
92
96
  "@popmotion/popcorn": "^0.4.4",
93
- "@popperjs/core": "~2.9.0",
94
- "@testing-library/jest-dom": "^5.11.9",
95
- "@testing-library/user-event": "^13.1.9",
96
- "camel-to-kebab": "^1.1.0",
97
- "csstype": "^3.0.6",
98
- "date-fns": "^2.17.0",
99
- "deepmerge": "^4.2.2",
97
+ "@popperjs/core": "^2.11.6",
98
+ "date-fns": "^2.29.2",
100
99
  "focus-options-polyfill": "^1.6.0",
101
100
  "focus-visible": "^5.2.0",
102
- "lodash.camelcase": "^4.3.0",
103
- "lodash.get": "^4.4.2",
104
- "lodash.snakecase": "^4.1.1",
105
- "match-sorter": "^6.2.0",
106
- "mitt": "^2.1.0",
101
+ "lodash": "^4.17.21",
102
+ "match-sorter": "^6.3.1",
103
+ "mitt": "^3.0.0",
107
104
  "mousetrap": "^1.6.5",
108
- "polished": "^4.1.1",
105
+ "polished": "^4.2.2",
109
106
  "popper-max-size-modifier": "^0.2.0",
110
- "react-beautiful-dnd": "^13.0.0",
111
- "react-sticky-box": "^0.9.3",
112
- "resize-observer-polyfill": "^1.5.1",
107
+ "react-beautiful-dnd": "^13.1.0",
108
+ "react-sticky-box": "^1.0.2",
113
109
  "stylefire": "^7.0.3",
114
- "tabbable": "^5.1.5",
115
- "tiny-invariant": "^1.1.0",
110
+ "tabbable": "^6.0.0",
116
111
  "tiny-spring": "^1.0.0",
117
- "type-fest": "^0.21.1",
118
- "use-constant": "^1.1.0",
119
- "warning": "^4.0.3",
120
- "zustand": "^3.3.2"
112
+ "zustand": "^4.1.1"
121
113
  }
122
114
  }
@@ -83,7 +83,7 @@ export function ActionsDropdown({
83
83
  hasDuplicates || hasInactiveDate
84
84
  ? {
85
85
  color: hasDuplicates ? '#E6A714' : 'white',
86
- name: hasDuplicates ? 'exclamation-triangle-filled' : 'inactive',
86
+ name: hasDuplicates ? 'general.exclamationTriangle' : 'general.inactive',
87
87
  size: 'md',
88
88
  }
89
89
  : undefined
@@ -107,7 +107,7 @@ export function ActionsDropdown({
107
107
  <Icon
108
108
  color="#E6A714"
109
109
  marginTop="3px"
110
- name="exclamation-triangle-filled"
110
+ name="general.exclamationTriangle"
111
111
  />
112
112
  <Text size={4}>
113
113
  There {duplicates.amount > 1 ? 'are' : 'is'} {duplicates.amount}{' '}
@@ -130,7 +130,7 @@ export function ActionsDropdown({
130
130
  {hasInactiveDate ? (
131
131
  <>
132
132
  <StackView axis="horizontal" padding={2} spacing={1}>
133
- <Icon name="inactive" color="grey-8" marginTop="3px" />
133
+ <Icon name="general.inactive" color="grey-8" marginTop="3px" />
134
134
  <Text size={4}>
135
135
  Set inactive on {format(inactive.date, 'MMM dd, yyyy')}
136
136
  {inactive.reason && ` (${inactive.reason})`}.{' '}
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: Alert
3
3
  category: General
4
+ propsSummary: Accepts all valid HTML attributes and [StackView](/stackview) props.
4
5
  ---
5
6
 
6
7
  ```jsx live
@@ -4,8 +4,13 @@ import { MediaQueries } from '../index'
4
4
  import { StackView, StackViewProps } from '../StackView'
5
5
 
6
6
  export type AlertProps = {
7
+ children?: any
8
+
7
9
  /** Sets status theme colors. */
8
10
  type?: 'warning' | 'success' | 'error'
11
+
12
+ /** Describes props at different breakpoints. [Read about mediaQueries](/responsive). */
13
+ mediaQueries?: object
9
14
  } & StackViewProps
10
15
 
11
16
  type Props = React.RefAttributes<any> &
@@ -2,6 +2,7 @@
2
2
  title: Avatar
3
3
  category: Images
4
4
  summary: Avatars are used to show a thumbnail representation of a person.
5
+ propsSummary: Accepts [Box](/box) props.
5
6
  ---
6
7
 
7
8
  ```jsx live
@@ -1,12 +1,14 @@
1
1
  import React, { cloneElement } from 'react'
2
2
 
3
3
  import Box from '../Box'
4
- import { getForegroundColor, useBoxSize } from '../system'
4
+ import { getForegroundColor, useBoxSize, useThemeProps } from '../system'
5
5
  import StackView from '../StackView'
6
6
  import Text from '../Text'
7
7
  import { stopPropagationClick } from '../utils'
8
8
 
9
9
  export type BadgeProps = {
10
+ children?: any,
11
+
10
12
  /**
11
13
  * Background color of the badge, sets an accessible text color
12
14
  */
@@ -26,23 +28,62 @@ export type BadgeProps = {
26
28
  * The text to be rendered
27
29
  */
28
30
  title?: string,
31
+
32
+ /**
33
+ * Allows rendering any content inside the beginning of the badge.
34
+ */
35
+ renderLeft?: string | React.ReactNode,
36
+
37
+ /**
38
+ * Allows rendering any content inside the end of the badge.
39
+ */
40
+ renderRight?: string | React.ReactNode,
41
+
42
+ /**
43
+ * `onClick={stopPropagationClick(onClick)}`
44
+ *
45
+ * Callback passed to `stopPropagationClick` which
46
+ * adds event.stopPropagation() to a component's onClick event.
47
+ * Used to prevent element's onClick from bubbling up the tree.
48
+ */
49
+ onClick?: Function,
50
+
51
+ /**
52
+ * The size of the radius. (Default is 3px).
53
+ */
54
+ radius?: number | string,
29
55
  }
30
56
 
31
57
  function Badge({
32
58
  children,
33
- color = {
34
- foreground: 'foreground',
35
- background: 'surfaceTertiary',
36
- },
37
59
  renderLeft,
38
60
  renderRight,
39
61
  onClick,
40
- radius = 3,
41
- size = 'md',
42
- square,
43
62
  title,
44
63
  ...restProps
45
64
  }: BadgeProps) {
65
+ const {
66
+ color = {
67
+ foreground: 'foreground',
68
+ background: 'surfaceTertiary',
69
+ },
70
+ radius = 3,
71
+ size = 'md',
72
+ square = false,
73
+ ...themeProps
74
+ } = useThemeProps('badge', restProps)
75
+
76
+ let badgeProps = {
77
+ color,
78
+ radius,
79
+ size,
80
+ square,
81
+ ...themeProps,
82
+ }
83
+
84
+ badgeProps.backgroundColor = color.background || color
85
+ badgeProps.color = color.foreground || getForegroundColor(color)
86
+
46
87
  const {
47
88
  boxSize,
48
89
  fontSize,
@@ -50,7 +91,8 @@ function Badge({
50
91
  paddingHorizontal,
51
92
  paddingHorizontalDense,
52
93
  paddingVertical,
53
- } = useBoxSize(size)
94
+ } = useBoxSize(badgeProps.size)
95
+
54
96
  const textStyle = {
55
97
  as: 'span',
56
98
  fontWeight: 'inherit',
@@ -58,26 +100,26 @@ function Badge({
58
100
  color: 'inherit',
59
101
  }
60
102
 
61
- if (square || radius === 'circle') {
62
- restProps.width = boxSize
63
- restProps.height = boxSize
103
+ if (badgeProps.square || badgeProps.radius === 'circle') {
104
+ badgeProps.width = boxSize
105
+ badgeProps.height = boxSize
64
106
  }
65
107
 
66
- if (radius === 'circle') {
108
+ if (badgeProps.radius === 'circle') {
67
109
  textStyle.position = 'absolute'
68
110
  textStyle.top = '50%'
69
111
  textStyle.left = '50%'
70
112
  textStyle.transform = 'translate(-50%, -50%)'
71
113
  }
72
114
 
73
- let spacingLeft = renderLeft
115
+ badgeProps.paddingLeft = renderLeft
74
116
  ? boxSize + 0.5
75
- : radius === 'pill'
117
+ : badgeProps.radius === 'pill'
76
118
  ? paddingHorizontal
77
119
  : paddingHorizontalDense
78
- let spacingRight = renderRight
120
+ badgeProps.paddingRight = renderRight
79
121
  ? boxSize + 0.5
80
- : radius === 'pill'
122
+ : badgeProps.radius === 'pill'
81
123
  ? paddingHorizontal
82
124
  : paddingHorizontalDense
83
125
 
@@ -87,15 +129,10 @@ function Badge({
87
129
  axis="horizontal"
88
130
  alignment="center"
89
131
  distribution="center"
90
- radius={radius}
91
132
  fontSize={fontSize}
92
133
  lineHeight={lineHeight}
93
134
  minHeight={boxSize}
94
- paddingLeft={spacingLeft}
95
- paddingRight={spacingRight}
96
135
  paddingVertical={paddingVertical}
97
- backgroundColor={color.background || color}
98
- color={color.foreground || getForegroundColor(color)}
99
136
  fill="currentColor"
100
137
  textAlign="center"
101
138
  position="relative"
@@ -103,7 +140,7 @@ function Badge({
103
140
  outline={0}
104
141
  focus={{ backgroundColor: 'highlightSecondary' }}
105
142
  onClick={stopPropagationClick(onClick)}
106
- {...restProps}
143
+ {...badgeProps}
107
144
  >
108
145
  {renderLeft && (
109
146
  <Box
@@ -119,7 +156,9 @@ function Badge({
119
156
  {typeof renderLeft === 'string'
120
157
  ? renderLeft
121
158
  : cloneElement(renderLeft, {
122
- size: (renderLeft.props && renderLeft.props.size) || size,
159
+ size:
160
+ (renderLeft.props && renderLeft.props.size) ||
161
+ badgeProps.size,
123
162
  })}
124
163
  </Box>
125
164
  )}
@@ -144,7 +183,9 @@ function Badge({
144
183
  {typeof renderRight === 'string'
145
184
  ? renderRight
146
185
  : cloneElement(renderRight, {
147
- size: (renderRight.props && renderRight.props.size) || size,
186
+ size:
187
+ (renderRight.props && renderRight.props.size) ||
188
+ badgeProps.size,
148
189
  })}
149
190
  </Box>
150
191
  )}
@@ -2,6 +2,7 @@
2
2
  title: Badge
3
3
  category: General
4
4
  summary: Badges are used to inform users of the status of a piece of information or of an action that has been taken.
5
+ propsSummary: Accepts [StackView](/stackview) props.
5
6
  ---
6
7
 
7
8
  ```jsx live
@@ -50,7 +51,7 @@ render(() => (
50
51
  renderRight={
51
52
  <Button
52
53
  title="clear"
53
- icon={{ name: 'close' }}
54
+ icon={{ name: 'general.x' }}
54
55
  radiusLeft={0}
55
56
  onClick={() => alert('clear badge')}
56
57
  />
@@ -9,11 +9,11 @@ import Badge from './Badge'
9
9
  const statuses = {
10
10
  error: {
11
11
  color: 'error',
12
- icon: 'close',
12
+ icon: 'general.x',
13
13
  },
14
14
  success: {
15
15
  color: 'success',
16
- icon: 'checkmark',
16
+ icon: 'general.check',
17
17
  },
18
18
  }
19
19
 
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: Badge.Status
3
3
  category: General
4
+ propsSummary: Accepts [Badge](/badge) props.
4
5
  ---
5
6
 
6
7
  ```jsx live
package/src/Box/Box.mdx CHANGED
@@ -1,7 +1,8 @@
1
1
  ---
2
2
  title: Box
3
3
  category: Primitives
4
- summary: Box is the primitive component that other components build from. It is responsible for processing all [style props](/style-props).
4
+ summary: Box is the primitive component that other components build from.
5
+ propsSummary: Accepts all [style props](/style-props) and valid HTML attributes.
5
6
  order: 1
6
7
  ---
7
8
 
package/src/Box/Box.tsx CHANGED
@@ -8,8 +8,9 @@ import splitStyles from '../system/split-styles'
8
8
  import { useVariant } from '../VariantProvider'
9
9
 
10
10
  export type BoxProps = {
11
+ children?: any
11
12
  /**
12
- * Render custom component or HTML element tag.
13
+ * Render custom component or HTML element tag. (Defaults to a `<div>` element).
13
14
  */
14
15
  as?: any
15
16
 
@@ -19,7 +20,7 @@ export type BoxProps = {
19
20
  innerRef?: any
20
21
 
21
22
  /**
22
- * If true, sets "display: inline-block", otherwise it defaults to "display: block"
23
+ * If true, sets `display: inline-block`, otherwise it defaults to `display: block`
23
24
  */
24
25
  inline?: boolean
25
26
 
@@ -27,6 +28,16 @@ export type BoxProps = {
27
28
  * Controls display property. If `false` sets `display: none`, otherwise defaults to initial display value.
28
29
  */
29
30
  visible?: boolean
31
+
32
+ /**
33
+ * Describes styles at various points in time. [Read about variants](/variants).
34
+ */
35
+ variants?: object
36
+
37
+ /**
38
+ * Describes props at different breakpoints. [Read about mediaQueries](/responsive).
39
+ */
40
+ mediaQueries?: object
30
41
  } & StyleProps
31
42
 
32
43
  type Props = React.RefAttributes<any> &
@@ -2,6 +2,7 @@
2
2
  title: Button
3
3
  category: General
4
4
  summary: Used for any type of user action, including navigation.
5
+ propsSummary: Accepts all valid HTML attributes and [StackView](/stackview) props.
5
6
  ---
6
7
 
7
8
  ```jsx live
@@ -98,7 +99,7 @@ render(
98
99
  key={size}
99
100
  size={size}
100
101
  title="Button"
101
- iconLeft={{ name: 'people' }}
102
+ iconLeft={{ name: 'general.twoPeople' }}
102
103
  />
103
104
  ))}
104
105
  </StackView>
@@ -109,7 +110,7 @@ render(
109
110
  key={size}
110
111
  size={size}
111
112
  title="Button"
112
- iconRight={{ name: 'arrow-down' }}
113
+ iconRight={{ name: 'general.downCaret' }}
113
114
  />
114
115
  ))}
115
116
  </StackView>
@@ -119,7 +120,7 @@ render(
119
120
  <Button
120
121
  key={size}
121
122
  size={size}
122
- icon={{ name: 'person' }}
123
+ icon={{ name: 'general.person' }}
123
124
  tooltip={{ title: 'person' }}
124
125
  radius="circle"
125
126
  />
@@ -13,6 +13,8 @@ import { useAccessibilityViolation } from '../hooks/use-accessibility-violation'
13
13
  import Input from './Input'
14
14
 
15
15
  type ButtonProps = {
16
+ children?: any
17
+
16
18
  /**
17
19
  * Disables button by removing click handlers and making the button transparent.
18
20
  */
@@ -78,6 +80,15 @@ type ButtonProps = {
78
80
  * Determines the modified style of the button.
79
81
  */
80
82
  variant?: 'fill' | 'outline' | 'naked'
83
+
84
+ onClick?: Function
85
+
86
+ onKeyDown?: Function
87
+
88
+ /** Describes props at different breakpoints. [Read about mediaQueries](/responsive). */
89
+ mediaQueries?: object
90
+
91
+
81
92
  } & StackViewProps
82
93
 
83
94
  type Props = React.RefAttributes<any> &
@@ -11,7 +11,7 @@ render(
11
11
  title="Add Person"
12
12
  theme="light"
13
13
  iconLeft={{
14
- name: 'person',
14
+ name: 'general.person',
15
15
  color: 'light-6',
16
16
  }}
17
17
  >
@@ -109,7 +109,7 @@ render(() => {
109
109
  buttonProps={{
110
110
  innerRef: containerRef,
111
111
  title: 'search',
112
- icon: { name: 'topbar-search', color: 'light-9' },
112
+ icon: { name: 'general.search', color: 'light-9' },
113
113
  theme: 'light',
114
114
  onClose: () => setValue(''),
115
115
  }}
@@ -68,6 +68,11 @@ const sizes = {
68
68
  }
69
69
 
70
70
  export type CalendarProps = {
71
+ /**
72
+ * Gain access to the outer wrapping `StackView` ref
73
+ */
74
+ calendarRef?: any,
75
+
71
76
  /**
72
77
  * Used to calculate the month and year.
73
78
  */
@@ -256,7 +261,7 @@ const Calendar = forwardRef(
256
261
  >
257
262
  <Button
258
263
  title="Previous month"
259
- icon={{ name: 'caret-left' }}
264
+ icon={{ name: 'general.leftChevron', size: "xxs" }}
260
265
  disabled={
261
266
  isYearsView
262
267
  ? currentYear <= minYear
@@ -266,12 +271,12 @@ const Calendar = forwardRef(
266
271
  />
267
272
  <Button
268
273
  tooltip={{ title: 'Today' }}
269
- icon={{ name: 'radio-1' }}
274
+ icon={{ name: 'tapestry.radio1' }}
270
275
  onClick={() => setDate(TODAY, true)}
271
276
  />
272
277
  <Button
273
278
  title="Next month"
274
- icon={{ name: 'caret-right' }}
279
+ icon={{ name: 'general.rightChevron', size: "xxs"}}
275
280
  disabled={
276
281
  isYearsView
277
282
  ? currentYear >= maxYear
@@ -2,6 +2,7 @@
2
2
  title: Calendar
3
3
  category: General
4
4
  summary: Render days in a calendar to allow users to pick dates easier.
5
+ propsSummary: Accepts [StackView](/stackview) props.
5
6
  ---
6
7
 
7
8
  ### Simple
package/src/Card/Card.mdx CHANGED
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: Card
3
3
  category: General
4
+ propsSummary: Accepts [StackView](/stackview) props and valid HTML attributes.
4
5
  ---
5
6
 
6
7
  ```jsx live
package/src/Card/Card.tsx CHANGED
@@ -5,13 +5,18 @@ import { StackView, StackViewProps } from '../StackView'
5
5
  import { cloneChildren } from '../utils'
6
6
 
7
7
  export type CardProps = {
8
+ children?: React.ReactNode
9
+
8
10
  /** Adds a slightly higher contrast background. */
9
11
  subdued?: boolean
12
+
13
+ /** The size of the radius. (Default is 3px). */
14
+ radius?: number | string,
10
15
  } & StackViewProps
11
16
 
12
17
  type Props = React.RefAttributes<any> & React.HTMLAttributes<any> & CardProps
13
18
 
14
- function Section({ subdued, ...restProps }: Props) {
19
+ export function Section({ subdued, ...restProps }: Props) {
15
20
  return (
16
21
  <StackView
17
22
  width="100%"
@@ -60,4 +65,5 @@ export function Card({ children, subdued, radius = 3, ...restProps }: Props) {
60
65
  )
61
66
  }
62
67
 
68
+ Section.displayName = 'Card.Section'
63
69
  Card.Section = Section
@@ -14,9 +14,9 @@ import { useAccessibilityViolation } from '../hooks/use-accessibility-violation'
14
14
  import { mergeProps } from '../utils'
15
15
 
16
16
  const iconPaths = {
17
- fill: 'checkbox-0',
18
- minus: 'checkbox-1',
19
- checked: 'checkbox-2',
17
+ fill: 'tapestry.checkbox0',
18
+ minus: 'tapestry.checkbox1',
19
+ checked: 'tapestry.checkbox2',
20
20
  }
21
21
 
22
22
  export type Props = {
@@ -32,6 +32,11 @@ export type Props = {
32
32
  */
33
33
  label?: string | null,
34
34
 
35
+ /**
36
+ * Connects input to its corrospending label's `htmlFor`.
37
+ */
38
+ id?: string | number,
39
+
35
40
  /**
36
41
  * If `true`, puts the checkbox in an indeterminate state.
37
42
  */
@@ -2,6 +2,7 @@
2
2
  title: Checkbox
3
3
  category: Forms
4
4
  summary: Checkboxes are most commonly used to give users a way to make a range of selections (zero, one, or multiple). They may also be used as a way to have a user indicate that they agree to specific terms and conditions.
5
+ propsSummary: Accepts [StackView](/stackview) props.
5
6
  ---
6
7
 
7
8
  ```jsx live
@@ -1,3 +1,4 @@
1
+ // @flow
1
2
  import React, { useState } from 'react'
2
3
 
3
4
  import Box from '../Box'
@@ -5,7 +6,31 @@ import Card from '../Card'
5
6
  import Checkbox from '../Checkbox'
6
7
  import Text from '../Text'
7
8
 
8
- function CheckboxCard({ checked, onChange, subtitle, title, ...restProps }) {
9
+ type Props = {
10
+ /**
11
+ * Checks the checkbox, will be overriden if indeterminate is `true`.
12
+ */
13
+ checked?: boolean,
14
+
15
+ /**
16
+ * Maps to the internal input's `onChange` prop.
17
+ */
18
+ onChange?: () => null,
19
+
20
+ /** First line of text in the card, in a darker color. */
21
+ title?: string,
22
+
23
+ /** Second line of text in the card, in a lighter color. */
24
+ subtitle?: string,
25
+ }
26
+
27
+ function CheckboxCard({
28
+ checked,
29
+ onChange,
30
+ subtitle,
31
+ title,
32
+ ...restProps
33
+ }: Props) {
9
34
  const [localChecked, setLocalChecked] = useState(false)
10
35
  const isActive = checked === undefined ? localChecked : checked
11
36
  return (
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: CheckboxCard
3
3
  category: Forms
4
+ propsSummary: Accepts [Card](/card) props.
4
5
  ---
5
6
 
6
7
  ```jsx live
@@ -6,11 +6,17 @@ import { shallowEqual } from '../utils'
6
6
  import CheckboxGroupContext from './CheckboxGroupContext'
7
7
 
8
8
  type Props = {
9
+ children: any,
9
10
  /**
10
11
  * Accepts an array of strings that match the corresponding `Checkbox` values that should be checked.
11
12
  */
12
13
  value: Array<string>,
13
14
 
15
+ /**
16
+ * Maps to the corresponding `Checkbox` name prop.
17
+ */
18
+ name: string,
19
+
14
20
  /**
15
21
  * Callback when any child `Checkbox` fires its `onChange` callback. Receives new array of values.
16
22
  */