@planningcenter/tapestry-react 2.0.1-rc.0 → 2.1.1

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 (155) hide show
  1. package/dist/cjs/Avatar/Avatar.js +3 -1
  2. package/dist/cjs/Box/Box.js +2 -2
  3. package/dist/cjs/Button/Button.js +2 -2
  4. package/dist/cjs/Calendar/Day.js +33 -38
  5. package/dist/cjs/Card/Card.js +14 -24
  6. package/dist/cjs/Card/Section.js +28 -0
  7. package/dist/cjs/Checkbox/Checkbox.js +1 -1
  8. package/dist/cjs/Collapse/Collapse.js +10 -9
  9. package/dist/cjs/Collapse/Collapse.test.js +56 -0
  10. package/dist/cjs/DataTable/components/Icon.js +4 -4
  11. package/dist/cjs/DragDrop/DragDrop.js +1 -1
  12. package/dist/cjs/GridView/GridView.js +2 -2
  13. package/dist/cjs/HelperDrawer/HelperDrawer.js +8 -8
  14. package/dist/cjs/Icon/Path.js +1 -0
  15. package/dist/cjs/Icon/Status.js +24 -17
  16. package/dist/cjs/Pagination/Pagination.js +99 -83
  17. package/dist/cjs/Select/Inline.js +1 -0
  18. package/dist/cjs/Select/Option.js +1 -1
  19. package/dist/cjs/Select/OptionGroup.js +1 -3
  20. package/dist/cjs/Select/Value.js +1 -0
  21. package/dist/cjs/Select/constants.js +2 -2
  22. package/dist/cjs/Sidebar/Sidebar.js +5 -5
  23. package/dist/cjs/Spinner/Spinner.js +3 -3
  24. package/dist/cjs/StackView/StackView.js +2 -2
  25. package/dist/cjs/Table/Table.js +2 -2
  26. package/dist/cjs/Text/Text.js +2 -2
  27. package/dist/cjs/ThemeProvider/ThemeProvider.js +4 -18
  28. package/dist/cjs/TileView/TileView.js +2 -2
  29. package/dist/cjs/system/box-sizes.js +6 -3
  30. package/dist/cjs/system/use-css.js +2 -2
  31. package/dist/cjs/system/utils.js +2 -2
  32. package/dist/esm/Avatar/Avatar.js +3 -3
  33. package/dist/esm/Box/Box.js +1 -1
  34. package/dist/esm/Button/Button.js +2 -2
  35. package/dist/esm/Calendar/Day.js +33 -39
  36. package/dist/esm/Card/Card.js +12 -22
  37. package/dist/esm/Card/Section.js +15 -0
  38. package/dist/esm/Checkbox/Checkbox.js +1 -1
  39. package/dist/esm/Collapse/Collapse.js +3 -2
  40. package/dist/esm/Collapse/Collapse.test.js +53 -0
  41. package/dist/esm/DataTable/components/Icon.js +1 -1
  42. package/dist/esm/DragDrop/DragDrop.js +1 -1
  43. package/dist/esm/GridView/GridView.js +1 -1
  44. package/dist/esm/HelperDrawer/HelperDrawer.js +1 -1
  45. package/dist/esm/Icon/Path.js +1 -0
  46. package/dist/esm/Icon/Status.js +24 -17
  47. package/dist/esm/Pagination/Pagination.js +96 -78
  48. package/dist/esm/Select/Inline.js +1 -0
  49. package/dist/esm/Select/Option.js +1 -1
  50. package/dist/esm/Select/OptionGroup.js +1 -2
  51. package/dist/esm/Select/Value.js +1 -0
  52. package/dist/esm/Select/constants.js +2 -2
  53. package/dist/esm/Sidebar/Sidebar.js +1 -1
  54. package/dist/esm/Spinner/Spinner.js +1 -1
  55. package/dist/esm/StackView/StackView.js +1 -1
  56. package/dist/esm/Table/Table.js +1 -1
  57. package/dist/esm/Text/Text.js +1 -1
  58. package/dist/esm/ThemeProvider/ThemeProvider.js +3 -15
  59. package/dist/esm/TileView/TileView.js +1 -1
  60. package/dist/esm/system/box-sizes.js +6 -3
  61. package/dist/esm/system/use-css.js +1 -1
  62. package/dist/esm/system/utils.js +1 -1
  63. package/dist/types/Avatar/Avatar.d.ts +19 -0
  64. package/dist/types/Box/Box.d.ts +5 -2
  65. package/dist/types/Button/Button.d.ts +22 -14
  66. package/dist/types/Button/Input.d.ts +1 -1
  67. package/dist/types/Card/Card.d.ts +2 -8
  68. package/dist/types/Card/Section.d.ts +11 -0
  69. package/dist/types/ChurchCenterStatus/ChurchCenterStatus.d.ts +0 -1
  70. package/dist/types/Collapse/Collapse.test.d.ts +1 -0
  71. package/dist/types/Divider/Divider.d.ts +0 -1
  72. package/dist/types/FilterLayout/FilterLayout.d.ts +0 -1
  73. package/dist/types/GridView/GridView.d.ts +4 -1
  74. package/dist/types/Pagination/Pagination.d.ts +23 -0
  75. package/dist/types/Popover/Popover.d.ts +3 -3
  76. package/dist/types/Portal/Portal.d.ts +4 -3
  77. package/dist/types/Spinner/Spinner.d.ts +0 -1
  78. package/dist/types/StackView/StackView.d.ts +4 -1
  79. package/dist/types/Tab/Tab.d.ts +0 -1
  80. package/dist/types/Text/Text.d.ts +4 -1
  81. package/dist/types/TileView/TileView.d.ts +4 -1
  82. package/package.json +12 -15
  83. package/src/Avatar/Avatar.mdx +2 -2
  84. package/src/Avatar/{Avatar.js → Avatar.tsx} +10 -5
  85. package/src/Badge/Badge.mdx +2 -0
  86. package/src/Badge/Status.mdx +1 -0
  87. package/src/Box/Box.tsx +2 -1
  88. package/src/Button/Button.mdx +1 -0
  89. package/src/Button/Button.tsx +13 -5
  90. package/src/Button/Input.mdx +1 -0
  91. package/src/Calendar/Calendar.mdx +1 -0
  92. package/src/Calendar/Day.js +51 -8
  93. package/src/Calendar/Day.mdx +6 -0
  94. package/src/Card/Card.mdx +1 -10
  95. package/src/Card/Card.tsx +8 -16
  96. package/src/Card/Section.mdx +19 -0
  97. package/src/Card/Section.tsx +25 -0
  98. package/src/Checkbox/Checkbox.js +1 -1
  99. package/src/Collapse/Collapse.js +5 -2
  100. package/src/Collapse/Collapse.test.tsx +42 -0
  101. package/src/Combobox/Combobox.mdx +1 -1
  102. package/src/DataTable/components/Icon.js +1 -1
  103. package/src/DragDrop/DragDrop.js +1 -1
  104. package/src/Drawer/Drawer.mdx +1 -0
  105. package/src/EditActions/EditActions.mdx +1 -0
  106. package/src/FieldSet/FieldSet.mdx +1 -0
  107. package/src/GridView/GridView.tsx +1 -1
  108. package/src/HeadingUppercase/HeadingUppercase.mdx +1 -0
  109. package/src/HelperDrawer/HelperDrawer.js +1 -1
  110. package/src/Highlight/Highlight.mdx +1 -0
  111. package/src/Icon/Icon.mdx +65 -35
  112. package/src/Icon/Path.js +2 -0
  113. package/src/Icon/Path.mdx +34 -0
  114. package/src/Icon/Status.js +24 -15
  115. package/src/Icon/Status.mdx +17 -0
  116. package/src/Input/Inline.mdx +1 -0
  117. package/src/Input/Input.mdx +1 -0
  118. package/src/Input/InputBox.mdx +1 -0
  119. package/src/Input/InputField.mdx +1 -0
  120. package/src/Input/InputLabel.mdx +1 -0
  121. package/src/PagerView/PagerView.mdx +1 -1
  122. package/src/Pagination/Pagination.mdx +0 -1
  123. package/src/Pagination/Pagination.tsx +163 -0
  124. package/src/Popover/Popover.tsx +1 -1
  125. package/src/Portal/Portal.tsx +2 -0
  126. package/src/Progress/Progress.mdx +1 -0
  127. package/src/RangeSlider/RangeSlider.mdx +1 -0
  128. package/src/Scrim/Scrim.tsx +2 -2
  129. package/src/Section/Section.mdx +1 -0
  130. package/src/Select/Inline.js +21 -1
  131. package/src/Select/Inline.mdx +27 -0
  132. package/src/Select/Option.js +1 -1
  133. package/src/Select/Option.mdx +30 -0
  134. package/src/Select/OptionGroup.js +9 -3
  135. package/src/Select/OptionGroup.mdx +25 -0
  136. package/src/Select/Select.mdx +2 -99
  137. package/src/Select/Value.js +2 -0
  138. package/src/Select/Value.mdx +67 -0
  139. package/src/Select/constants.js +2 -2
  140. package/src/Sidebar/Sidebar.js +1 -1
  141. package/src/Spinner/Spinner.mdx +1 -0
  142. package/src/Spinner/Spinner.tsx +1 -1
  143. package/src/StackView/StackView.tsx +1 -1
  144. package/src/StepperField/StepperField.mdx +1 -0
  145. package/src/StepperProgress/StepperProgress.mdx +1 -0
  146. package/src/Table/Table.js +1 -1
  147. package/src/Text/Text.mdx +1 -0
  148. package/src/Text/Text.tsx +1 -1
  149. package/src/ThemeProvider/ThemeProvider.tsx +2 -13
  150. package/src/TileView/TileView.tsx +1 -1
  151. package/src/system/README.md +1 -1
  152. package/src/system/box-sizes.js +6 -3
  153. package/src/system/use-css.js +1 -1
  154. package/src/system/utils.js +1 -1
  155. package/src/Pagination/Pagination.js +0 -145
@@ -1,3 +1,6 @@
1
+ /** @jsxRuntime classic */
2
+ /** @jsx jsx */
3
+ import { jsx } from '@emotion/react';
1
4
  import * as React from 'react';
2
5
  import { BoxProps } from '../Box';
3
6
  import { MediaQueries, Variants } from '../index';
@@ -52,5 +55,5 @@ export declare type TextProps = {
52
55
  mediaQueries?: object;
53
56
  } & BoxProps;
54
57
  declare type Props = React.RefAttributes<any> & React.HTMLAttributes<any> & TextProps & MediaQueries<TextProps> & Variants<TextProps>;
55
- export declare function Text({ as, innerRef, ...props }: Props): JSX.Element;
58
+ export declare function Text({ as, innerRef, ...props }: Props): jsx.JSX.Element;
56
59
  export {};
@@ -1,3 +1,6 @@
1
+ /** @jsxRuntime classic */
2
+ /** @jsx jsx */
3
+ import { jsx } from '@emotion/react';
1
4
  import * as React from 'react';
2
5
  import { BoxProps } from '../Box';
3
6
  import { MediaQueries, Variants } from '../index';
@@ -17,5 +20,5 @@ export declare type TileViewProps = {
17
20
  mediaQueries?: object;
18
21
  } & BoxProps;
19
22
  declare type Props = React.RefAttributes<any> & React.HTMLAttributes<any> & TileViewProps & MediaQueries<TileViewProps> & Variants<TileViewProps>;
20
- export declare function TileView({ as, innerRef, ...props }: Props): JSX.Element;
23
+ export declare function TileView({ as, innerRef, ...props }: Props): jsx.JSX.Element;
21
24
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@planningcenter/tapestry-react",
3
- "version": "2.0.1-rc.0",
3
+ "version": "2.1.1",
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",
@@ -13,7 +13,7 @@
13
13
  ],
14
14
  "repository": {
15
15
  "type": "git",
16
- "url": "https://github.com/ministrycentered/tapestry-react.git"
16
+ "url": "https://github.com/planningcenter/tapestry-react.git"
17
17
  },
18
18
  "license": "UNLICENSED",
19
19
  "publishConfig": {
@@ -24,7 +24,6 @@
24
24
  "test:coverage": "jest --coverage",
25
25
  "test:watch": "jest --watch",
26
26
  "test:debug": "node --inspect-brk ./node_modules/bin/jest --runInBand --watch",
27
- "icons": "node scripts/generate-icons.js",
28
27
  "prebuild": "rimraf dist",
29
28
  "build": "yarn build:cjs && yarn build:esm && yarn build:types",
30
29
  "build:cjs": "NODE_ENV=production BABEL_ENV=cjs babel src -d dist/cjs --extensions '.js,.ts,.tsx' --ignore '**/__tests__/**/*.js','**/*.test.js'",
@@ -34,13 +33,11 @@
34
33
  "develop": "yarn prebuild && yarn build:esm --watch",
35
34
  "develop:yalc": "yalc publish && chokidar src -c 'yalc publish --push --changed'",
36
35
  "lint": "eslint src",
37
- "validate": "yarn lint && yarn prettier --list-different",
38
- "semantic-release": "semantic-release"
36
+ "validate": "yarn lint && yarn prettier --list-different"
39
37
  },
40
38
  "peerDependencies": {
41
39
  "@emotion/cache": "10.x",
42
- "@emotion/core": "10.x",
43
- "emotion-theming": "10.x",
40
+ "@emotion/react": "^11.10.5",
44
41
  "react": "^16.8.0 || ^17.0.0",
45
42
  "react-dom": "^16.8.0 || ^17.0.0"
46
43
  },
@@ -55,19 +52,19 @@
55
52
  "@babel/preset-flow": "7.12.13",
56
53
  "@babel/preset-react": "7.12.13",
57
54
  "@babel/preset-typescript": "^7.12.17",
58
- "@emotion/cache": "10.0.29",
59
- "@emotion/core": "10.0.35",
55
+ "@emotion/cache": "^11.10.5",
56
+ "@emotion/react": "^11.10.5",
60
57
  "@testing-library/jest-dom": "^5.11.9",
61
- "@testing-library/react": "^11.2.5",
62
- "@testing-library/react-hooks": "5.0.3",
58
+ "@testing-library/react": "^12.1.4",
59
+ "@testing-library/react-hooks": "^8.0.1",
63
60
  "@testing-library/user-event": "^13.1.9",
64
61
  "@types/jest": "^26.0.20",
62
+ "@types/react": "^18.0.24",
63
+ "@types/react-dom": "^18.0.8",
65
64
  "babel-eslint": "10.1.0",
66
65
  "chokidar-cli": "^2.1.0",
67
- "commitizen": "^4.2.3",
68
66
  "cz-conventional-changelog": "^3.3.0",
69
67
  "dotenv": "^8.2.0",
70
- "emotion-theming": "10.0.27",
71
68
  "eslint": "7.20.0",
72
69
  "eslint-config-react-app": "6.0.0",
73
70
  "eslint-plugin-flowtype": "5.2.1",
@@ -85,7 +82,6 @@
85
82
  "react-dom": "^17.0.1",
86
83
  "react-test-renderer": "17.0.1",
87
84
  "rimraf": "3.0.2",
88
- "semantic-release": "19.0.3",
89
85
  "svgo": "^2.1.0",
90
86
  "svgson": "4.1.0",
91
87
  "type-fest": "^0.21.1",
@@ -93,8 +89,10 @@
93
89
  },
94
90
  "dependencies": {
95
91
  "@planningcenter/icons": "^14.0.0",
92
+ "@planningcenter/react-beautiful-dnd": "^13.2.1",
96
93
  "@popmotion/popcorn": "^0.4.4",
97
94
  "@popperjs/core": "^2.11.6",
95
+ "@react-hook/window-size": "^3.1.1",
98
96
  "date-fns": "^2.29.2",
99
97
  "focus-options-polyfill": "^1.6.0",
100
98
  "focus-visible": "^5.2.0",
@@ -104,7 +102,6 @@
104
102
  "mousetrap": "^1.6.5",
105
103
  "polished": "^4.2.2",
106
104
  "popper-max-size-modifier": "^0.2.0",
107
- "react-beautiful-dnd": "^13.1.0",
108
105
  "react-sticky-box": "^1.0.2",
109
106
  "stylefire": "^7.0.3",
110
107
  "tabbable": "^6.0.0",
@@ -13,11 +13,11 @@ const statuses = {
13
13
  }
14
14
  function App() {
15
15
  const [status, setStatus] = React.useState(null)
16
- const users = useUsers()
16
+ const users = useUsers(6)
17
17
  return (
18
18
  <StackView alignment="center" spacing={4}>
19
19
  <StackView axis="horizontal" alignment="end" spacing={1}>
20
- {['xs', 'sm', 'md', 'lg', 'xl'].map((size, index) => (
20
+ {['xs', 'sm', 'md', 'lg', 'xl', 'xxl'].map((size, index) => (
21
21
  <StackView key={size} spacing={1} alignment="center">
22
22
  <Avatar
23
23
  size={size}
@@ -1,4 +1,3 @@
1
- // @flow
2
1
  import React from 'react'
3
2
 
4
3
  import Box from '../Box'
@@ -9,14 +8,15 @@ const borderSizes = {
9
8
  sm: 2,
10
9
  md: 3,
11
10
  lg: 4,
12
- xl: 5,
11
+ xl: 4,
12
+ xxl: 4,
13
13
  }
14
14
 
15
- export type Props = {
15
+ type AvatarProps = {
16
16
  /**
17
17
  * Controls the size of the avatar.
18
18
  */
19
- size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl',
19
+ size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl',
20
20
  /**
21
21
  * The source of the image to display.
22
22
  */
@@ -30,7 +30,12 @@ export type Props = {
30
30
  /**
31
31
  * Displays a user's avatar in a circle.
32
32
  */
33
- function Avatar({ size = 'md', source, status, ...restProps }: Props) {
33
+ export function Avatar({
34
+ size = 'md',
35
+ source,
36
+ status,
37
+ ...restProps
38
+ }: AvatarProps) {
34
39
  const { boxSize } = useBoxSize(size)
35
40
  return (
36
41
  <Box
@@ -3,6 +3,8 @@ 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
5
  propsSummary: Accepts [StackView](/stackview) props.
6
+ isParent: true
7
+ themeKey: badge
6
8
  ---
7
9
 
8
10
  ```jsx live
@@ -2,6 +2,7 @@
2
2
  title: Badge.Status
3
3
  category: General
4
4
  propsSummary: Accepts [Badge](/badge) props.
5
+ parent: Badge
5
6
  ---
6
7
 
7
8
  ```jsx live
package/src/Box/Box.tsx CHANGED
@@ -1,6 +1,6 @@
1
1
  /** @jsxRuntime classic */
2
2
  /** @jsx jsx */
3
- import { jsx } from '@emotion/core'
3
+ import { jsx } from '@emotion/react'
4
4
  import * as React from 'react'
5
5
 
6
6
  import { StyleProps, MediaQueries, Variants } from '../index'
@@ -42,6 +42,7 @@ export type BoxProps = {
42
42
 
43
43
  type Props = React.RefAttributes<any> &
44
44
  React.HTMLAttributes<any> &
45
+ React.ImgHTMLAttributes<any> &
45
46
  BoxProps &
46
47
  MediaQueries<BoxProps> &
47
48
  Variants<BoxProps>
@@ -3,6 +3,7 @@ title: Button
3
3
  category: General
4
4
  summary: Used for any type of user action, including navigation.
5
5
  propsSummary: Accepts all valid HTML attributes and [StackView](/stackview) props.
6
+ isParent: true
6
7
  ---
7
8
 
8
9
  ```jsx live
@@ -25,6 +25,16 @@ type ButtonProps = {
25
25
  */
26
26
  external?: boolean
27
27
 
28
+ /**
29
+ * Pass styles for when the button is focused.
30
+ */
31
+ focus?: object
32
+
33
+ /**
34
+ * Pass styles for when the button is hovered.
35
+ */
36
+ hover?: object
37
+
28
38
  /**
29
39
  * Renders an [Icon](/icon) in the center of the button. Pass a string or any valid `Icon` props.
30
40
  * Must pass a [`title`](/button#title) or [`tooltip.title`](/tooltip#title) when using icon-only buttons.
@@ -67,7 +77,7 @@ type ButtonProps = {
67
77
  title?: string | number
68
78
 
69
79
  /**
70
- * Where the browser should navigate to when pressed.
80
+ * Where the browser should navigate to when pressed. If you need any element here other than `<a>`, remember to use the `as` prop.
71
81
  */
72
82
  to?: string
73
83
 
@@ -87,8 +97,6 @@ type ButtonProps = {
87
97
 
88
98
  /** Describes props at different breakpoints. [Read about mediaQueries](/responsive). */
89
99
  mediaQueries?: object
90
-
91
-
92
100
  } & StackViewProps
93
101
 
94
102
  type Props = React.RefAttributes<any> &
@@ -294,7 +302,7 @@ export function Button({
294
302
  Icon only buttons must define either a{' '}
295
303
  <Link
296
304
  external
297
- to="https://ministrycentered.github.io/tapestry-react/button#tooltip"
305
+ to="https://planningcenter.github.io/tapestry-react/button#tooltip"
298
306
  weight={700}
299
307
  >
300
308
  tooltip
@@ -302,7 +310,7 @@ export function Button({
302
310
  or{' '}
303
311
  <Link
304
312
  external
305
- to="https://ministrycentered.github.io/tapestry-react/button#title"
313
+ to="https://planningcenter.github.io/tapestry-react/button#title"
306
314
  weight={700}
307
315
  >
308
316
  title
@@ -2,6 +2,7 @@
2
2
  title: Button.Input
3
3
  category: General
4
4
  summary: Transforms a button into an input. Composes and forwards props to [Button](/button).
5
+ parent: Button
5
6
  ---
6
7
 
7
8
  ```jsx live
@@ -3,6 +3,7 @@ title: Calendar
3
3
  category: General
4
4
  summary: Render days in a calendar to allow users to pick dates easier.
5
5
  propsSummary: Accepts [StackView](/stackview) props.
6
+ isParent: true
6
7
  ---
7
8
 
8
9
  ### Simple
@@ -4,9 +4,45 @@ import Icon from '../Icon'
4
4
  import StackView from '../StackView'
5
5
  import Text from '../Text'
6
6
 
7
- const DayStatus = ({ color, ...restProps }) => (
8
- <Icon.Status size="5px" color={color} {...restProps} />
9
- )
7
+ export type PublicProps = {
8
+ children?: any,
9
+ /**
10
+ * Background color of the container.
11
+ */
12
+ backgroundColor?: string,
13
+ /**
14
+ * Text color of the date.
15
+ */
16
+ color?: string,
17
+ /**
18
+ * Disables the `onClick` callback.
19
+ */
20
+ disabled?: boolean,
21
+ /**
22
+ * Sets the font size of the date.
23
+ */
24
+ fontSize?: number | string,
25
+ /**
26
+ * Sets the font weight of the date.
27
+ */
28
+ fontWeight?: number | string,
29
+ /**
30
+ * Circular background color of the selected date, default's to theme `primary`.
31
+ */
32
+ selectedColor?: string,
33
+ /**
34
+ * Circular background color, default's to `transparent`. Can be used to provide a visual queue for a given day.
35
+ */
36
+ statusColor?: string,
37
+ /**
38
+ * Specifies the `bottom` offset of the status dots, defaults to `15%`.
39
+ */
40
+ statusOffset: string | number,
41
+ /**
42
+ * Accepts an array of color names (theme token or valid html) which render as small colorized dots below the date.
43
+ */
44
+ statuses?: array,
45
+ }
10
46
 
11
47
  const Day = ({
12
48
  backgroundColor,
@@ -28,7 +64,7 @@ const Day = ({
28
64
  statuses,
29
65
  statusOffset = '15%',
30
66
  ...restProps
31
- }) => {
67
+ }: PublicProps) => {
32
68
  const affordance =
33
69
  !disabled &&
34
70
  !isMinDate &&
@@ -61,8 +97,7 @@ const Day = ({
61
97
  {...restProps}
62
98
  >
63
99
  {(isSelected || isToday || statusColor) && (
64
- <Icon.Status
65
- size={cellSize}
100
+ <Icon
66
101
  color={
67
102
  isSelected
68
103
  ? selectedColor
@@ -70,10 +105,12 @@ const Day = ({
70
105
  ? 'surfaceTertiary'
71
106
  : statusColor
72
107
  }
108
+ left="50%"
73
109
  position="absolute"
74
110
  top="50%"
75
- left="50%"
76
111
  transform="translate(-50%, -50%)"
112
+ name="tapestry.radio0"
113
+ size={cellSize}
77
114
  />
78
115
  )}
79
116
  <Text
@@ -96,7 +133,12 @@ const Day = ({
96
133
  spacing={0.25}
97
134
  >
98
135
  {statuses.map((color, index) => (
99
- <DayStatus key={index} color={isSelected ? 'white' : color} />
136
+ <Icon
137
+ color={isSelected ? 'white' : color}
138
+ key={index}
139
+ name="tapestry.radio0"
140
+ size="5px"
141
+ />
100
142
  ))}
101
143
  </StackView>
102
144
  )}
@@ -105,4 +147,5 @@ const Day = ({
105
147
  )
106
148
  }
107
149
 
150
+ Day.displayName = 'Calendar.Day'
108
151
  export default Day
@@ -0,0 +1,6 @@
1
+ ---
2
+ title: Calendar.Day
3
+ category: General
4
+ summary: Provides easier custom day rendering.
5
+ parent: Calendar
6
+ ---
package/src/Card/Card.mdx CHANGED
@@ -2,18 +2,9 @@
2
2
  title: Card
3
3
  category: General
4
4
  propsSummary: Accepts [StackView](/stackview) props and valid HTML attributes.
5
+ isParent: true
5
6
  ---
6
7
 
7
- ```jsx live
8
- render(
9
- <Card spacing={<Divider />}>
10
- {[1, 2, 3].map((index) => (
11
- <Card.Section key={index}>Card {index}</Card.Section>
12
- ))}
13
- </Card>
14
- )
15
- ```
16
-
17
8
  ```jsx live
18
9
  render(
19
10
  <StackView
package/src/Card/Card.tsx CHANGED
@@ -2,6 +2,7 @@ import * as React from 'react'
2
2
 
3
3
  import { useThemeValue } from '../system'
4
4
  import { StackView, StackViewProps } from '../StackView'
5
+ import { Section } from './Section'
5
6
  import { cloneChildren } from '../utils'
6
7
 
7
8
  export type CardProps = {
@@ -11,23 +12,15 @@ export type CardProps = {
11
12
  subdued?: boolean
12
13
 
13
14
  /** The size of the radius. (Default is 3px). */
14
- radius?: number | string,
15
+ radius?: number | string
15
16
  } & StackViewProps
16
17
 
17
- type Props = React.RefAttributes<any> & React.HTMLAttributes<any> & CardProps
18
-
19
- export function Section({ subdued, ...restProps }: Props) {
20
- return (
21
- <StackView
22
- width="100%"
23
- padding={1}
24
- backgroundColor={subdued ? 'surfaceSecondary' : undefined}
25
- {...restProps}
26
- />
27
- )
28
- }
29
-
30
- export function Card({ children, subdued, radius = 3, ...restProps }: Props) {
18
+ export function Card({
19
+ children,
20
+ subdued,
21
+ radius = 3,
22
+ ...restProps
23
+ }: CardProps) {
31
24
  const cardTheme = useThemeValue('card')
32
25
  return (
33
26
  <StackView
@@ -65,5 +58,4 @@ export function Card({ children, subdued, radius = 3, ...restProps }: Props) {
65
58
  )
66
59
  }
67
60
 
68
- Section.displayName = 'Card.Section'
69
61
  Card.Section = Section
@@ -0,0 +1,19 @@
1
+ ---
2
+ title: Card.Section
3
+ category: General
4
+ summary: Used to wrap discrete content within `Card`.
5
+ propsSummary: Accepts all valid HTML attributes and [StackView](/stackview) props.
6
+ parent: Card
7
+ ---
8
+
9
+ ```jsx live
10
+ render(
11
+ <Card spacing={<Divider />}>
12
+ {[1, 2, 3, 4, 5].map((index) => (
13
+ <Card.Section key={index} subdued={index % 2 === 0}>
14
+ Section {index}
15
+ </Card.Section>
16
+ ))}
17
+ </Card>
18
+ )
19
+ ```
@@ -0,0 +1,25 @@
1
+ import * as React from 'react'
2
+
3
+ import { StackView, StackViewProps } from '../StackView'
4
+
5
+ export type SectionProps = {
6
+ children?: React.ReactNode
7
+
8
+ /** Adds a slightly higher contrast background. */
9
+ subdued?: boolean
10
+ } & StackViewProps &
11
+ React.RefAttributes<any> &
12
+ React.HTMLAttributes<any>
13
+
14
+ export function Section({ subdued, ...restProps }: SectionProps) {
15
+ return (
16
+ <StackView
17
+ width="100%"
18
+ padding={1}
19
+ backgroundColor={subdued ? 'surfaceSecondary' : undefined}
20
+ {...restProps}
21
+ />
22
+ )
23
+ }
24
+
25
+ Section.displayName = 'Card.Section'
@@ -110,7 +110,7 @@ function Checkbox({
110
110
  Checkbox must define a{' '}
111
111
  <Link
112
112
  external
113
- to="https://ministrycentered.github.io/tapestry-react/checkbox#label"
113
+ to="https://planningcenter.github.io/tapestry-react/checkbox#label"
114
114
  weight={700}
115
115
  >
116
116
  label
@@ -1,7 +1,7 @@
1
1
  // @flow
2
2
  /** @jsxRuntime classic */
3
3
  /** @jsx jsx */
4
- import { jsx } from '@emotion/core'
4
+ import { jsx } from '@emotion/react'
5
5
  import { useLayoutEffect, useRef, useState } from 'react'
6
6
 
7
7
  const transition = 'height 200ms ease-out'
@@ -109,7 +109,10 @@ function Collapse(props: Props) {
109
109
  return (
110
110
  <div
111
111
  ref={ref}
112
- css={{ transition: instantRender ? undefined : transition }}
112
+ css={{
113
+ transition: instantRender ? undefined : transition,
114
+ visibility: open ? 'visible' : 'hidden',
115
+ }}
113
116
  {...restProps}
114
117
  >
115
118
  {renderChildren ? children : null}
@@ -0,0 +1,42 @@
1
+ import React, { useState } from 'react'
2
+ import { render, screen } from '@testing-library/react'
3
+ import { isInaccessible } from '@testing-library/dom'
4
+ import userEvent from '@testing-library/user-event'
5
+ import '@testing-library/jest-dom/extend-expect'
6
+ import { Box, Button, Collapse } from '..'
7
+
8
+ describe('Collapse', () => {
9
+ describe('Render children', () => {
10
+ const Component = () => {
11
+ const [open, setOpen] = useState(false)
12
+ return (
13
+ <Box>
14
+ <Button data-testid="toggle" onClick={() => setOpen(!open)}>
15
+ Toggle
16
+ </Button>
17
+ <Collapse open={open}>
18
+ <Button data-testid="child" />
19
+ </Collapse>
20
+ </Box>
21
+ )
22
+ }
23
+
24
+ it('should render collapsed children', () => {
25
+ render(<Component />)
26
+ expect(screen.getByTestId('child')).toBeInTheDocument()
27
+ })
28
+
29
+ it('should hide children from accessibility tree when collapsed', () => {
30
+ render(<Component />)
31
+ expect(isInaccessible(screen.getByTestId('toggle'))).toBe(false)
32
+ expect(isInaccessible(screen.getByTestId('child'))).toBe(true)
33
+ })
34
+
35
+ it('should include children in accessibility tree when open', () => {
36
+ render(<Component />)
37
+ userEvent.click(screen.getByTestId('toggle'))
38
+ expect(isInaccessible(screen.getByTestId('toggle'))).toBe(false)
39
+ expect(isInaccessible(screen.getByTestId('child'))).toBe(false)
40
+ })
41
+ })
42
+ })
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  title: Combobox
3
3
  category: Forms
4
- summary: Used for easily selecting a list of items that are paired with a text input. Composes [Combobox.Input](https://github.com/ministrycentered/tapestry-react/blob/master/packages/tapestry-react/src/Combobox/ComboboxInput.js) and [Popover](/popover).
4
+ summary: Used for easily selecting a list of items that are paired with a text input. Composes [Combobox.Input](https://github.com/planningcenter/tapestry-react/blob/master/packages/tapestry-react/src/Combobox/ComboboxInput.js) and [Popover](/popover).
5
5
  propsSummary: Accepts [Box](/box) props.
6
6
  ---
7
7
 
@@ -1,6 +1,6 @@
1
1
  /** @jsxRuntime classic */
2
2
  /** @jsx jsx */
3
- import { jsx } from '@emotion/core'
3
+ import { jsx } from '@emotion/react'
4
4
 
5
5
  import { useThemeValue } from '../../system'
6
6
 
@@ -7,7 +7,7 @@ import React, {
7
7
  useEffect,
8
8
  } from 'react'
9
9
  import { createPortal } from 'react-dom'
10
- import * as RBDND from 'react-beautiful-dnd'
10
+ import * as RBDND from '@planningcenter/react-beautiful-dnd'
11
11
  import mitt from 'mitt'
12
12
 
13
13
  import StackView from '../StackView'
@@ -3,6 +3,7 @@ title: Drawer
3
3
  category: General
4
4
  summary: Use to add collapsible navigation items or content anchored to the right side of the screen.
5
5
  propsSummary: Accepts [StackView](/stackview) props.
6
+ themeKey: drawer
6
7
  ---
7
8
 
8
9
  ```jsx live
@@ -3,6 +3,7 @@ title: EditActions
3
3
  category: General
4
4
  summary: Helper component that manages switching between initial and editing states of inline forms. It uses an optimisitic save that will render a checkmark after the loading prop has been set to `false`.
5
5
  propsSummary: Accepts [StackView](/stackview) props.
6
+ themeKey: editActions
6
7
  ---
7
8
 
8
9
  ```jsx live
@@ -3,6 +3,7 @@ title: FieldSet
3
3
  category: Forms
4
4
  summary: Used to group several controls as well as labels within a web form.
5
5
  propsSummary: Accepts [StackView](/stackview) props.
6
+ themeKey: fieldSet
6
7
  ---
7
8
 
8
9
  ```jsx live
@@ -1,6 +1,6 @@
1
1
  /** @jsxRuntime classic */
2
2
  /** @jsx jsx */
3
- import { jsx } from '@emotion/core'
3
+ import { jsx } from '@emotion/react'
4
4
  import * as React from 'react'
5
5
 
6
6
  import { BoxProps } from '../Box'
@@ -2,6 +2,7 @@
2
2
  title: HeadingUppercase
3
3
  category: General
4
4
  propsSummary: Accepts [Text](/text) props.
5
+ themeKey: HeadingUppercase
5
6
  ---
6
7
 
7
8
  ```jsx live
@@ -1,7 +1,7 @@
1
1
  // @flow
2
2
  /** @jsxRuntime classic */
3
3
  /** @jsx jsx */
4
- import { jsx } from '@emotion/core'
4
+ import { jsx } from '@emotion/react'
5
5
  import { useCallback, useEffect, useState } from 'react'
6
6
 
7
7
  import Button from '../Button'