@planningcenter/tapestry-react 2.0.0 → 2.1.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.
- package/dist/cjs/Avatar/Avatar.js +3 -1
- package/dist/cjs/Box/Box.js +2 -2
- package/dist/cjs/Button/Button.js +2 -2
- package/dist/cjs/Calendar/Day.js +1 -0
- package/dist/cjs/Card/Card.js +14 -24
- package/dist/cjs/Card/Section.js +28 -0
- package/dist/cjs/Checkbox/Checkbox.js +1 -1
- package/dist/cjs/Collapse/Collapse.js +10 -9
- package/dist/cjs/Collapse/Collapse.test.js +56 -0
- package/dist/cjs/DataTable/components/Icon.js +4 -4
- package/dist/cjs/DragDrop/DragDrop.js +1 -1
- package/dist/cjs/GridView/GridView.js +2 -2
- package/dist/cjs/HelperDrawer/HelperDrawer.js +8 -8
- package/dist/cjs/Icon/Path.js +1 -0
- package/dist/cjs/Icon/Status.js +24 -17
- package/dist/cjs/Pagination/Pagination.js +99 -83
- package/dist/cjs/Scrim/Scrim.js +1 -1
- package/dist/cjs/Select/Inline.js +1 -0
- package/dist/cjs/Select/Option.js +1 -1
- package/dist/cjs/Select/OptionGroup.js +1 -3
- package/dist/cjs/Select/Value.js +1 -0
- package/dist/cjs/Select/constants.js +2 -2
- package/dist/cjs/Sidebar/Sidebar.js +5 -5
- package/dist/cjs/Spinner/Spinner.js +3 -3
- package/dist/cjs/StackView/StackView.js +2 -2
- package/dist/cjs/Table/Table.js +2 -2
- package/dist/cjs/Text/Text.js +2 -2
- package/dist/cjs/ThemeProvider/ThemeProvider.js +4 -18
- package/dist/cjs/TileView/TileView.js +2 -2
- package/dist/cjs/system/box-sizes.js +6 -3
- package/dist/cjs/system/use-css.js +2 -2
- package/dist/cjs/system/utils.js +2 -2
- package/dist/esm/Avatar/Avatar.js +3 -3
- package/dist/esm/Box/Box.js +1 -1
- package/dist/esm/Button/Button.js +2 -2
- package/dist/esm/Calendar/Day.js +1 -0
- package/dist/esm/Card/Card.js +12 -22
- package/dist/esm/Card/Section.js +15 -0
- package/dist/esm/Checkbox/Checkbox.js +1 -1
- package/dist/esm/Collapse/Collapse.js +3 -2
- package/dist/esm/Collapse/Collapse.test.js +53 -0
- package/dist/esm/DataTable/components/Icon.js +1 -1
- package/dist/esm/DragDrop/DragDrop.js +1 -1
- package/dist/esm/GridView/GridView.js +1 -1
- package/dist/esm/HelperDrawer/HelperDrawer.js +1 -1
- package/dist/esm/Icon/Path.js +1 -0
- package/dist/esm/Icon/Status.js +24 -17
- package/dist/esm/Pagination/Pagination.js +96 -78
- package/dist/esm/Scrim/Scrim.js +1 -1
- package/dist/esm/Select/Inline.js +1 -0
- package/dist/esm/Select/Option.js +1 -1
- package/dist/esm/Select/OptionGroup.js +1 -2
- package/dist/esm/Select/Value.js +1 -0
- package/dist/esm/Select/constants.js +2 -2
- package/dist/esm/Sidebar/Sidebar.js +1 -1
- package/dist/esm/Spinner/Spinner.js +1 -1
- package/dist/esm/StackView/StackView.js +1 -1
- package/dist/esm/Table/Table.js +1 -1
- package/dist/esm/Text/Text.js +1 -1
- package/dist/esm/ThemeProvider/ThemeProvider.js +3 -15
- package/dist/esm/TileView/TileView.js +1 -1
- package/dist/esm/system/box-sizes.js +6 -3
- package/dist/esm/system/use-css.js +1 -1
- package/dist/esm/system/utils.js +1 -1
- package/dist/types/Avatar/Avatar.d.ts +19 -0
- package/dist/types/Box/Box.d.ts +5 -2
- package/dist/types/Button/Button.d.ts +22 -14
- package/dist/types/Button/Input.d.ts +1 -1
- package/dist/types/Card/Card.d.ts +2 -8
- package/dist/types/Card/Section.d.ts +11 -0
- package/dist/types/ChurchCenterStatus/ChurchCenterStatus.d.ts +0 -1
- package/dist/types/Collapse/Collapse.test.d.ts +1 -0
- package/dist/types/Divider/Divider.d.ts +0 -1
- package/dist/types/FilterLayout/FilterLayout.d.ts +0 -1
- package/dist/types/GridView/GridView.d.ts +4 -1
- package/dist/types/Pagination/Pagination.d.ts +23 -0
- package/dist/types/Popover/Popover.d.ts +3 -3
- package/dist/types/Portal/Portal.d.ts +4 -3
- package/dist/types/Spinner/Spinner.d.ts +0 -1
- package/dist/types/StackView/StackView.d.ts +4 -1
- package/dist/types/Tab/Tab.d.ts +0 -1
- package/dist/types/Text/Text.d.ts +4 -1
- package/dist/types/TileView/TileView.d.ts +4 -1
- package/package.json +12 -15
- package/src/Avatar/Avatar.mdx +2 -2
- package/src/Avatar/{Avatar.js → Avatar.tsx} +10 -5
- package/src/Badge/Badge.mdx +2 -0
- package/src/Badge/Status.mdx +1 -0
- package/src/Box/Box.tsx +2 -1
- package/src/Button/Button.mdx +1 -0
- package/src/Button/Button.tsx +13 -5
- package/src/Button/Input.mdx +1 -0
- package/src/Calendar/Calendar.mdx +1 -0
- package/src/Calendar/Day.js +42 -2
- package/src/Calendar/Day.mdx +6 -0
- package/src/Card/Card.mdx +1 -10
- package/src/Card/Card.tsx +8 -16
- package/src/Card/Section.mdx +19 -0
- package/src/Card/Section.tsx +25 -0
- package/src/Checkbox/Checkbox.js +1 -1
- package/src/Collapse/Collapse.js +5 -2
- package/src/Collapse/Collapse.test.tsx +42 -0
- package/src/Combobox/Combobox.mdx +1 -1
- package/src/DataTable/components/Icon.js +1 -1
- package/src/DragDrop/DragDrop.js +1 -1
- package/src/Drawer/Drawer.mdx +1 -0
- package/src/EditActions/EditActions.mdx +1 -0
- package/src/FieldSet/FieldSet.mdx +1 -0
- package/src/GridView/GridView.tsx +1 -1
- package/src/HeadingUppercase/HeadingUppercase.mdx +1 -0
- package/src/HelperDrawer/HelperDrawer.js +1 -1
- package/src/Highlight/Highlight.mdx +1 -0
- package/src/Icon/Icon.mdx +65 -35
- package/src/Icon/Path.js +2 -0
- package/src/Icon/Path.mdx +34 -0
- package/src/Icon/Status.js +23 -14
- package/src/Icon/Status.mdx +17 -0
- package/src/Input/Inline.mdx +1 -0
- package/src/Input/Input.mdx +1 -0
- package/src/Input/InputBox.mdx +1 -0
- package/src/Input/InputField.mdx +1 -0
- package/src/Input/InputLabel.mdx +1 -0
- package/src/PagerView/PagerView.mdx +1 -1
- package/src/Pagination/Pagination.mdx +0 -1
- package/src/Pagination/Pagination.tsx +163 -0
- package/src/Popover/Popover.tsx +1 -1
- package/src/Portal/Portal.tsx +2 -0
- package/src/Progress/Progress.mdx +1 -0
- package/src/RangeSlider/RangeSlider.mdx +1 -0
- package/src/Scrim/Scrim.tsx +1 -1
- package/src/Section/Section.mdx +1 -0
- package/src/Select/Inline.js +21 -1
- package/src/Select/Inline.mdx +27 -0
- package/src/Select/Option.js +1 -1
- package/src/Select/Option.mdx +30 -0
- package/src/Select/OptionGroup.js +9 -3
- package/src/Select/OptionGroup.mdx +25 -0
- package/src/Select/Select.mdx +2 -99
- package/src/Select/Value.js +2 -0
- package/src/Select/Value.mdx +67 -0
- package/src/Select/constants.js +2 -2
- package/src/Sidebar/Sidebar.js +1 -1
- package/src/Spinner/Spinner.mdx +1 -0
- package/src/Spinner/Spinner.tsx +1 -1
- package/src/StackView/StackView.tsx +1 -1
- package/src/StepperField/StepperField.mdx +1 -0
- package/src/StepperProgress/StepperProgress.mdx +1 -0
- package/src/Table/Table.js +1 -1
- package/src/Text/Text.mdx +1 -0
- package/src/Text/Text.tsx +1 -1
- package/src/ThemeProvider/ThemeProvider.tsx +2 -13
- package/src/TileView/TileView.tsx +1 -1
- package/src/system/README.md +1 -1
- package/src/system/box-sizes.js +6 -3
- package/src/system/use-css.js +1 -1
- package/src/system/utils.js +1 -1
- package/src/Pagination/Pagination.js +0 -145
|
@@ -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:
|
|
11
|
+
xl: 4,
|
|
12
|
+
xxl: 4,
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
|
|
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({
|
|
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
|
package/src/Badge/Badge.mdx
CHANGED
package/src/Badge/Status.mdx
CHANGED
package/src/Box/Box.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @jsxRuntime classic */
|
|
2
2
|
/** @jsx jsx */
|
|
3
|
-
import { jsx } from '@emotion/
|
|
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>
|
package/src/Button/Button.mdx
CHANGED
package/src/Button/Button.tsx
CHANGED
|
@@ -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://
|
|
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://
|
|
313
|
+
to="https://planningcenter.github.io/tapestry-react/button#title"
|
|
306
314
|
weight={700}
|
|
307
315
|
>
|
|
308
316
|
title
|
package/src/Button/Input.mdx
CHANGED
package/src/Calendar/Day.js
CHANGED
|
@@ -8,6 +8,46 @@ const DayStatus = ({ color, ...restProps }) => (
|
|
|
8
8
|
<Icon.Status size="5px" color={color} {...restProps} />
|
|
9
9
|
)
|
|
10
10
|
|
|
11
|
+
export type PublicProps = {
|
|
12
|
+
children?: any,
|
|
13
|
+
/**
|
|
14
|
+
* Background color of the container.
|
|
15
|
+
*/
|
|
16
|
+
backgroundColor?: string,
|
|
17
|
+
/**
|
|
18
|
+
* Text color of the date.
|
|
19
|
+
*/
|
|
20
|
+
color?: string,
|
|
21
|
+
/**
|
|
22
|
+
* Disables the `onClick` callback.
|
|
23
|
+
*/
|
|
24
|
+
disabled?: boolean,
|
|
25
|
+
/**
|
|
26
|
+
* Sets the font size of the date.
|
|
27
|
+
*/
|
|
28
|
+
fontSize?: number | string,
|
|
29
|
+
/**
|
|
30
|
+
* Sets the font weight of the date.
|
|
31
|
+
*/
|
|
32
|
+
fontWeight?: number | string,
|
|
33
|
+
/**
|
|
34
|
+
* Circular background color of the selected date, default's to theme `primary`.
|
|
35
|
+
*/
|
|
36
|
+
selectedColor?: string,
|
|
37
|
+
/**
|
|
38
|
+
* Circular background color, default's to `transparent`. Can be used to provide a visual queue for a given day.
|
|
39
|
+
*/
|
|
40
|
+
statusColor?: string,
|
|
41
|
+
/**
|
|
42
|
+
* Specifies the `bottom` offset of the `DayStatus` icons, defaults to `15%`.
|
|
43
|
+
*/
|
|
44
|
+
statusOffset: string | number,
|
|
45
|
+
/**
|
|
46
|
+
* Accepts an array of color names (theme token or valid html) which render as small `DayStatus` icons below the date.
|
|
47
|
+
*/
|
|
48
|
+
statuses?: array,
|
|
49
|
+
}
|
|
50
|
+
|
|
11
51
|
const Day = ({
|
|
12
52
|
backgroundColor,
|
|
13
53
|
cellSize,
|
|
@@ -28,7 +68,7 @@ const Day = ({
|
|
|
28
68
|
statuses,
|
|
29
69
|
statusOffset = '15%',
|
|
30
70
|
...restProps
|
|
31
|
-
}) => {
|
|
71
|
+
}: PublicProps) => {
|
|
32
72
|
const affordance =
|
|
33
73
|
!disabled &&
|
|
34
74
|
!isMinDate &&
|
|
@@ -104,5 +144,5 @@ const Day = ({
|
|
|
104
144
|
</StackView>
|
|
105
145
|
)
|
|
106
146
|
}
|
|
107
|
-
|
|
147
|
+
Day.displayName = 'Calendar.Day'
|
|
108
148
|
export default Day
|
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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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'
|
package/src/Checkbox/Checkbox.js
CHANGED
|
@@ -110,7 +110,7 @@ function Checkbox({
|
|
|
110
110
|
Checkbox must define a{' '}
|
|
111
111
|
<Link
|
|
112
112
|
external
|
|
113
|
-
to="https://
|
|
113
|
+
to="https://planningcenter.github.io/tapestry-react/checkbox#label"
|
|
114
114
|
weight={700}
|
|
115
115
|
>
|
|
116
116
|
label
|
package/src/Collapse/Collapse.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
/** @jsxRuntime classic */
|
|
3
3
|
/** @jsx jsx */
|
|
4
|
-
import { jsx } from '@emotion/
|
|
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={{
|
|
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/
|
|
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
|
|
package/src/DragDrop/DragDrop.js
CHANGED
|
@@ -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'
|
package/src/Drawer/Drawer.mdx
CHANGED
|
@@ -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
|
package/src/Icon/Icon.mdx
CHANGED
|
@@ -4,13 +4,67 @@ category: Primitives
|
|
|
4
4
|
summary: Icons are used to help visually communicate actions and information to the end user.
|
|
5
5
|
propsSummary: Accepts [Box](/box) props.
|
|
6
6
|
order: 3
|
|
7
|
+
isParent: true
|
|
7
8
|
---
|
|
8
9
|
|
|
9
|
-
##
|
|
10
|
+
## Icon sets
|
|
10
11
|
|
|
11
|
-
By default, components have access to the `general` icon set
|
|
12
|
+
An "icon set" groups product-specific icon paths together. By default, `tapestry-react` components have access to the `general` icon set, which contains icon paths that multiple products share.
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
### Formatting
|
|
15
|
+
|
|
16
|
+
- Prefix the icon set's name
|
|
17
|
+
- Use dot notation to specify your icon
|
|
18
|
+
- Render the icon name in camelCase
|
|
19
|
+
|
|
20
|
+
```jsx
|
|
21
|
+
// expects: iconSetName.iconName
|
|
22
|
+
|
|
23
|
+
<Icon name="general.outlinedInfoCircle" />
|
|
24
|
+
<Button icon={{ name: "general.outlinedInfoCircle"}} />
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Importing additional icon sets
|
|
28
|
+
|
|
29
|
+
Additional icon sets can be imported from [libraries like `@planningcenter/icons`](https://github.com/planningcenter/icons) and exported through your app's [ThemeProvider](/theming#themeprovider). (You can import all exports [by using an asterisk](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#Import_an_entire_modules_contents).)
|
|
30
|
+
|
|
31
|
+
```jsx
|
|
32
|
+
import * as calendar from '@planningcenter/icons/paths/calendar'
|
|
33
|
+
import * as giving from '@planningcenter/icons/paths/giving'
|
|
34
|
+
import * as people from '@planningcenter/icons/paths/people'
|
|
35
|
+
|
|
36
|
+
const theme = {
|
|
37
|
+
icons: {
|
|
38
|
+
calendar,
|
|
39
|
+
giving,
|
|
40
|
+
people
|
|
41
|
+
},
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
<ThemeProvider theme={theme}>
|
|
45
|
+
<Icon name="calendar.reservationBlock" />
|
|
46
|
+
<Icon name="giving.clockCircleO" />
|
|
47
|
+
<Icon name="people.photoOutline" />
|
|
48
|
+
</ThemeProvider>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
```jsx live
|
|
52
|
+
render(() => {
|
|
53
|
+
return (
|
|
54
|
+
<ThemeProvider theme={{ icons }}>
|
|
55
|
+
<StackView axis="horizontal" spacing={2}>
|
|
56
|
+
<Icon name="calendar.reservationBlock" size="xl" />
|
|
57
|
+
<Icon name="giving.clockCircleO" size="xl" />
|
|
58
|
+
<Icon name="people.photoOutline" size="xl" />
|
|
59
|
+
</StackView>
|
|
60
|
+
</ThemeProvider>
|
|
61
|
+
)
|
|
62
|
+
})
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Preview icons
|
|
66
|
+
|
|
67
|
+
Preview all of the available icon sets and their icon's names from `@planningcenter/icons`.
|
|
14
68
|
|
|
15
69
|
```jsx live
|
|
16
70
|
render(() => {
|
|
@@ -43,41 +97,17 @@ render(() => {
|
|
|
43
97
|
/>
|
|
44
98
|
</StackView>
|
|
45
99
|
<TileView minCellWidth={16} spacing={4} margin={4}>
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
100
|
+
{matchSorter(Object.keys(icons[appName]), value).map((iconName) => (
|
|
101
|
+
<StackView key={iconName} alignment="center" spacing={1}>
|
|
102
|
+
<Icon key={iconName} name={`${appName}.${iconName}`} size="xl" />
|
|
103
|
+
<Text fontSize={5} color="foregroundSecondary">
|
|
104
|
+
{iconName}
|
|
105
|
+
</Text>
|
|
106
|
+
</StackView>
|
|
107
|
+
))}
|
|
54
108
|
</TileView>
|
|
55
109
|
</StackView>
|
|
56
110
|
</ThemeProvider>
|
|
57
111
|
)
|
|
58
112
|
})
|
|
59
113
|
```
|
|
60
|
-
|
|
61
|
-
## Grouped icon sets
|
|
62
|
-
|
|
63
|
-
When using grouped icon sets, you can access deeper path data using dot notation.
|
|
64
|
-
|
|
65
|
-
To import multiple icons from a library like [@planningcenter/icons](https://github.com/planningcenter/icons) you can [import all exports by using an asterisk](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#Import_an_entire_modules_contents):
|
|
66
|
-
|
|
67
|
-
`import * as calendar from '@planningcenter/icons/paths/calendar'`
|
|
68
|
-
`import * as general from '@planningcenter/icons/paths/general'`
|
|
69
|
-
|
|
70
|
-
```jsx live
|
|
71
|
-
render(() => {
|
|
72
|
-
return (
|
|
73
|
-
<ThemeProvider theme={{ icons }}>
|
|
74
|
-
<StackView axis="horizontal" spacing={2}>
|
|
75
|
-
<Icon name="accounts.integrations" size="xl" />
|
|
76
|
-
<Icon name="calendar.kiosk" size="xl" />
|
|
77
|
-
<Icon name="general.heart" size="xl" />
|
|
78
|
-
<Icon name="registrations.bell" size="xl" />
|
|
79
|
-
</StackView>
|
|
80
|
-
</ThemeProvider>
|
|
81
|
-
)
|
|
82
|
-
})
|
|
83
|
-
```
|
package/src/Icon/Path.js
CHANGED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Icon.Path
|
|
3
|
+
category: Primitives
|
|
4
|
+
summary: Path(s) are wrapped by an [Icon](/icon) component allowing for more customization.
|
|
5
|
+
propsSummary: Accepts [Box](/box) props.
|
|
6
|
+
parent: Icon
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
```jsx live
|
|
10
|
+
render(() => {
|
|
11
|
+
const [checked, setChecked] = React.useState(false)
|
|
12
|
+
return (
|
|
13
|
+
<StackView axis="horizontal" spacing={3}>
|
|
14
|
+
<Button
|
|
15
|
+
onClick={() => setChecked(!checked)}
|
|
16
|
+
title="Toggle path"
|
|
17
|
+
variant="outline"
|
|
18
|
+
/>
|
|
19
|
+
<Icon size="xl">
|
|
20
|
+
<Icon.Path
|
|
21
|
+
name="general.checkCircle"
|
|
22
|
+
visible={checked}
|
|
23
|
+
color="success"
|
|
24
|
+
/>
|
|
25
|
+
<Icon.Path
|
|
26
|
+
name="general.outlinedCircleCheck"
|
|
27
|
+
visible={!checked}
|
|
28
|
+
color="grey-5"
|
|
29
|
+
/>
|
|
30
|
+
</Icon>
|
|
31
|
+
</StackView>
|
|
32
|
+
)
|
|
33
|
+
})
|
|
34
|
+
```
|