@planningcenter/tapestry-react 1.0.0 → 1.3.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 (40) hide show
  1. package/dist/cjs/ActionsDropdown/ActionsDropdown.js +9 -8
  2. package/dist/cjs/Button/Button.js +6 -1
  3. package/dist/cjs/ChurchCenterStatus/ChurchCenterStatus.js +25 -12
  4. package/dist/cjs/Menu/Heading.js +3 -2
  5. package/dist/cjs/Menu/Item.js +5 -5
  6. package/dist/cjs/NumberField/NumberField.js +19 -10
  7. package/dist/cjs/Page/PageActions.js +5 -0
  8. package/dist/cjs/Page/PageHeader.js +17 -21
  9. package/dist/cjs/Page/PageTab.js +11 -2
  10. package/dist/cjs/Page/PageTabList.js +5 -10
  11. package/dist/cjs/Page/PageTitle.js +3 -2
  12. package/dist/cjs/Page/PageToolbar.js +30 -6
  13. package/dist/esm/ActionsDropdown/ActionsDropdown.js +9 -8
  14. package/dist/esm/Button/Button.js +6 -1
  15. package/dist/esm/ChurchCenterStatus/ChurchCenterStatus.js +23 -11
  16. package/dist/esm/Menu/Heading.js +3 -2
  17. package/dist/esm/Menu/Item.js +5 -5
  18. package/dist/esm/NumberField/NumberField.js +19 -10
  19. package/dist/esm/Page/PageActions.js +5 -0
  20. package/dist/esm/Page/PageHeader.js +17 -18
  21. package/dist/esm/Page/PageTab.js +10 -2
  22. package/dist/esm/Page/PageTabList.js +5 -8
  23. package/dist/esm/Page/PageTitle.js +3 -2
  24. package/dist/esm/Page/PageToolbar.js +28 -6
  25. package/dist/types/ChurchCenterStatus/ChurchCenterStatus.d.ts +15 -1
  26. package/package.json +1 -1
  27. package/src/ActionsDropdown/ActionsDropdown.tsx +8 -7
  28. package/src/Button/Button.tsx +6 -1
  29. package/src/ChurchCenterStatus/ChurchCenterStatus.mdx +18 -0
  30. package/src/ChurchCenterStatus/ChurchCenterStatus.tsx +48 -16
  31. package/src/Menu/Heading.js +6 -1
  32. package/src/Menu/Item.js +5 -5
  33. package/src/NumberField/NumberField.js +19 -9
  34. package/src/Page/Page.mdx +56 -1
  35. package/src/Page/PageActions.js +12 -1
  36. package/src/Page/PageHeader.js +19 -25
  37. package/src/Page/PageTab.js +15 -1
  38. package/src/Page/PageTabList.js +10 -8
  39. package/src/Page/PageTitle.js +9 -1
  40. package/src/Page/PageToolbar.js +29 -6
@@ -1,41 +1,35 @@
1
- import React, { Children } from 'react'
1
+ import React from 'react'
2
2
 
3
3
  import { useThemeValue } from '../system'
4
4
  import StackView from '../StackView'
5
5
 
6
- import { PAGE_TABLIST_DISPLAY_NAME } from './PageTabList'
7
-
8
6
  function PageHeader({ children, toolbar, ...restProps }) {
9
7
  const themeProps = useThemeValue('pageHeader')
10
- const tabsPresent = toolbar
11
- ? Children.toArray(toolbar.props.children).some(
12
- (child) => child && child.type.displayName === PAGE_TABLIST_DISPLAY_NAME
13
- )
14
- : false
15
- const childrenToRender = toolbar
16
- ? children
17
- ? Children.toArray([
18
- <StackView axis="horizontal" alignment="center" width="100%">
19
- {children}
20
- </StackView>,
21
- toolbar,
22
- ])
23
- : toolbar
24
- : children
25
8
  return (
26
9
  <StackView
27
10
  as="header"
28
- axis={children && toolbar ? 'vertical' : 'horizontal'}
29
- alignment={children && toolbar ? 'start' : 'center'}
30
- paddingHorizontal={3}
31
- paddingTop={1.5}
32
- paddingBottom={tabsPresent ? null : 1.5}
33
- spacing={1.5}
11
+ axis="vertical"
34
12
  backgroundColor="primary-light"
13
+ paddingHorizontal={2}
14
+ minHeight={8}
15
+ mediaQueries={{
16
+ sm: { paddingHorizontal: 3 },
17
+ }}
18
+ spacing={0}
35
19
  {...themeProps}
36
20
  {...restProps}
37
21
  >
38
- {childrenToRender}
22
+ {children && (
23
+ <StackView
24
+ alignment="center"
25
+ axis="horizontal"
26
+ paddingTop={2}
27
+ width="100%"
28
+ >
29
+ {children}
30
+ </StackView>
31
+ )}
32
+ {toolbar}
39
33
  </StackView>
40
34
  )
41
35
  }
@@ -1,9 +1,23 @@
1
1
  import React from 'react'
2
2
 
3
3
  import Tab from '../Tab'
4
+ import { useThemeValue } from '../system'
4
5
 
5
6
  function PageTab(props) {
6
- return <Tab {...props} size="lg" />
7
+ const themeProps = useThemeValue('pageTab')
8
+ return (
9
+ <Tab
10
+ mediaQueries={{
11
+ sm: {
12
+ paddingHorizontal: 3,
13
+ },
14
+ }}
15
+ paddingHorizontal={1.5}
16
+ size="lg"
17
+ {...themeProps}
18
+ {...props}
19
+ />
20
+ )
7
21
  }
8
22
 
9
23
  export default PageTab
@@ -2,12 +2,14 @@ import React from 'react'
2
2
 
3
3
  import StackView from '../StackView'
4
4
 
5
- export const PAGE_TABLIST_DISPLAY_NAME = 'PageTabList'
6
-
7
- function PageTabList(props) {
8
- return <StackView axis="horizontal" spacing={0.5} {...props} />
5
+ export default function PageTabList(props) {
6
+ return (
7
+ <StackView
8
+ axis="horizontal"
9
+ paddingTop={2}
10
+ spacing={0.5}
11
+ alignSelf="end"
12
+ {...props}
13
+ />
14
+ )
9
15
  }
10
-
11
- PageTabList.displayName = PAGE_TABLIST_DISPLAY_NAME
12
-
13
- export default PageTabList
@@ -5,7 +5,15 @@ import Heading from '../Heading'
5
5
 
6
6
  function PageTitle(props) {
7
7
  const themeProps = useThemeValue('pageTitle')
8
- return <Heading level={2} color="white" {...themeProps} {...props} />
8
+ return (
9
+ <Heading
10
+ color="white"
11
+ fontSize="25px"
12
+ level={2}
13
+ {...themeProps}
14
+ {...props}
15
+ />
16
+ )
9
17
  }
10
18
 
11
19
  export default PageTitle
@@ -1,17 +1,40 @@
1
1
  import React from 'react'
2
2
 
3
3
  import StackView from '../StackView'
4
+ import { useThemeValue } from '../system'
5
+
6
+ function PageToolbar({ stackBelow, ...restProps }) {
7
+ const themeBreakpoints = useThemeValue('breakpoints')
8
+ const breakpoint = Object.keys(themeBreakpoints).includes(stackBelow)
9
+ ? stackBelow
10
+ : 'sm'
11
+ const stackProps = stackBelow
12
+ ? {
13
+ axis: 'vertical',
14
+ alignment: 'stretch',
15
+ spacing: 2,
16
+ mediaQueries: {
17
+ [breakpoint]: {
18
+ axis: 'horizontal',
19
+ alignment: 'center',
20
+ paddingBottom: 0,
21
+ spacing: 0,
22
+ },
23
+ },
24
+ }
25
+ : null
4
26
 
5
- function PageToolbar({ children }) {
6
27
  return (
7
28
  <StackView
8
- grow={1}
29
+ alignment="center"
9
30
  axis="horizontal"
10
- alignment="start"
11
31
  distribution="space-between"
12
- >
13
- {children}
14
- </StackView>
32
+ flex={1}
33
+ spacing={2}
34
+ width="100%"
35
+ {...stackProps}
36
+ {...restProps}
37
+ />
15
38
  )
16
39
  }
17
40