@planningcenter/tapestry-react 0.0.1-alpha.0 → 1.2.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/ActionsDropdown/ActionsDropdown.js +9 -8
- package/dist/cjs/Button/Button.js +4 -4
- package/dist/cjs/Checkbox/Checkbox.js +2 -2
- package/dist/cjs/DataTable/DataTable.js +3 -3
- package/dist/cjs/DataTable/components/BodyRows.js +2 -2
- package/dist/cjs/DataTable/components/BodySubRows.js +2 -2
- package/dist/cjs/DataTable/components/CheckboxCell.js +10 -10
- package/dist/cjs/DataTable/components/Icon.js +1 -1
- package/dist/cjs/NumberField/NumberField.js +19 -10
- package/dist/cjs/Page/PageActions.js +5 -0
- package/dist/cjs/Page/PageHeader.js +17 -21
- package/dist/cjs/Page/PageTab.js +11 -2
- package/dist/cjs/Page/PageTabList.js +5 -10
- package/dist/cjs/Page/PageTitle.js +3 -2
- package/dist/cjs/Page/PageToolbar.js +30 -6
- package/dist/cjs/Radio/Radio.js +1 -1
- package/dist/cjs/ThemeProvider/ThemeProvider.js +2 -2
- package/dist/cjs/ThemeProvider/styles.js +4 -4
- package/dist/cjs/server.js +1 -1
- package/dist/cjs/system/split-styles.js +1 -1
- package/dist/esm/ActionsDropdown/ActionsDropdown.js +9 -8
- package/dist/esm/Button/Button.js +4 -4
- package/dist/esm/Checkbox/Checkbox.js +2 -2
- package/dist/esm/DataTable/DataTable.js +3 -3
- package/dist/esm/DataTable/components/BodyRows.js +2 -2
- package/dist/esm/DataTable/components/BodySubRows.js +2 -2
- package/dist/esm/DataTable/components/CheckboxCell.js +10 -10
- package/dist/esm/DataTable/components/Icon.js +1 -1
- package/dist/esm/NumberField/NumberField.js +19 -10
- package/dist/esm/Page/PageActions.js +5 -0
- package/dist/esm/Page/PageHeader.js +17 -18
- package/dist/esm/Page/PageTab.js +10 -2
- package/dist/esm/Page/PageTabList.js +5 -8
- package/dist/esm/Page/PageTitle.js +3 -2
- package/dist/esm/Page/PageToolbar.js +28 -6
- package/dist/esm/Radio/Radio.js +1 -1
- package/dist/esm/ThemeProvider/ThemeProvider.js +2 -2
- package/dist/esm/ThemeProvider/styles.js +4 -4
- package/dist/esm/server.js +1 -1
- package/dist/esm/system/split-styles.js +1 -1
- package/package.json +1 -1
- package/src/ActionsDropdown/ActionsDropdown.tsx +8 -7
- package/src/Button/Button.tsx +4 -4
- package/src/Checkbox/Checkbox.js +2 -2
- package/src/Combobox/Combobox.mdx +1 -1
- package/src/DataTable/DataTable.js +3 -3
- package/src/DataTable/components/BodyRows.js +2 -2
- package/src/DataTable/components/BodySubRows.js +2 -2
- package/src/DataTable/components/CheckboxCell.js +10 -10
- package/src/DataTable/components/Icon.js +1 -1
- package/src/Input/InputLabel.js +1 -1
- package/src/NumberField/NumberField.js +19 -9
- package/src/Page/Page.mdx +56 -1
- package/src/Page/PageActions.js +12 -1
- package/src/Page/PageHeader.js +19 -25
- package/src/Page/PageTab.js +15 -1
- package/src/Page/PageTabList.js +10 -8
- package/src/Page/PageTitle.js +9 -1
- package/src/Page/PageToolbar.js +29 -6
- package/src/Radio/Radio.js +1 -1
- package/src/ThemeProvider/ThemeProvider.tsx +2 -2
- package/src/ThemeProvider/styles.ts +6 -6
- package/src/server.js +1 -1
- package/src/system/README.md +2 -2
- package/src/system/split-styles.js +1 -1
|
@@ -18,12 +18,12 @@ const initialStyles = {
|
|
|
18
18
|
flexShrink: 0,
|
|
19
19
|
outline: 0,
|
|
20
20
|
cursor: 'pointer',
|
|
21
|
-
' .
|
|
21
|
+
' .tapestry-react-Checkbox-Fill ': {
|
|
22
22
|
transform: 'scale(1)',
|
|
23
23
|
transformOrigin: 'center center',
|
|
24
24
|
transition: 'all 180ms ease-out',
|
|
25
25
|
},
|
|
26
|
-
' .
|
|
26
|
+
' .tapestry-react-Checkbox-Minus, .tapestry-react-Checkbox-Checked ': {
|
|
27
27
|
fill: '#fff',
|
|
28
28
|
visibility: 'hidden',
|
|
29
29
|
transform: 'scale(0)',
|
|
@@ -31,23 +31,23 @@ const initialStyles = {
|
|
|
31
31
|
transition: 'all 180ms ease-out',
|
|
32
32
|
},
|
|
33
33
|
' &:hover, &:focus ': {
|
|
34
|
-
' .
|
|
34
|
+
' .tapestry-react-Checkbox-Fill ': {
|
|
35
35
|
transform: 'scale(1.125)',
|
|
36
36
|
},
|
|
37
37
|
},
|
|
38
38
|
' &:active ': {
|
|
39
|
-
' .
|
|
39
|
+
' .tapestry-react-Checkbox-Fill ': {
|
|
40
40
|
transform: 'scale(1)',
|
|
41
41
|
},
|
|
42
42
|
},
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
const checkedStyles = {
|
|
46
|
-
' .
|
|
46
|
+
' .tapestry-react-Checkbox-Checked ': scaleStyles,
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
const indeterminateStyles = {
|
|
50
|
-
' .
|
|
50
|
+
' .tapestry-react-Checkbox-Minus ': scaleStyles,
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
function CheckboxCell({
|
|
@@ -87,22 +87,22 @@ function CheckboxCell({
|
|
|
87
87
|
onFocus={onFocus}
|
|
88
88
|
onClick={handleChange}
|
|
89
89
|
onKeyDown={(event) => event.key === ' ' && handleChange(event)}
|
|
90
|
-
className="
|
|
90
|
+
className="tapestry-react-reset tapestry-react-Checkbox"
|
|
91
91
|
css={cssStyles}
|
|
92
92
|
>
|
|
93
93
|
<Icon.Path
|
|
94
94
|
name={iconPaths.fill}
|
|
95
|
-
className="
|
|
95
|
+
className="tapestry-react-reset tapestry-react-Checkbox-Fill"
|
|
96
96
|
fill={checked || indeterminate ? 'primary' : 'surfaceTertiary'}
|
|
97
97
|
stroke={checked || indeterminate ? 'primary' : 'separatorSecondary'}
|
|
98
98
|
/>
|
|
99
99
|
<Icon.Path
|
|
100
100
|
name={iconPaths.minus}
|
|
101
|
-
className="
|
|
101
|
+
className="tapestry-react-reset tapestry-react-Checkbox-Minus"
|
|
102
102
|
/>
|
|
103
103
|
<Icon.Path
|
|
104
104
|
name={iconPaths.checked}
|
|
105
|
-
className="
|
|
105
|
+
className="tapestry-react-reset tapestry-react-Checkbox-Checked"
|
|
106
106
|
/>
|
|
107
107
|
</Icon>
|
|
108
108
|
)
|
package/src/Input/InputLabel.js
CHANGED
|
@@ -8,7 +8,7 @@ import { inputs, inputLabels } from './utils'
|
|
|
8
8
|
|
|
9
9
|
export type InputLabelProps = {
|
|
10
10
|
/**
|
|
11
|
-
* The `id` of the input to control. Compatible with all
|
|
11
|
+
* The `id` of the input to control. Compatible with all Tapestry-React form components.
|
|
12
12
|
*/
|
|
13
13
|
controls: string,
|
|
14
14
|
|
|
@@ -168,13 +168,26 @@ class NumberField extends Component<Props> {
|
|
|
168
168
|
handleInput = (event) => {
|
|
169
169
|
const { maxValue } = this.getParsedValues(event.target.value)
|
|
170
170
|
if (this.props.pad) {
|
|
171
|
-
const
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
171
|
+
const deleteKeyPressed = event.target.value === ''
|
|
172
|
+
const targetValue = deleteKeyPressed
|
|
173
|
+
? event.target.value
|
|
174
|
+
: parseFloat(event.target.value)
|
|
175
175
|
|
|
176
|
-
if (
|
|
176
|
+
if (deleteKeyPressed) {
|
|
177
|
+
const nextValue = `${this.props.value}`.slice(0, -1)
|
|
178
|
+
this.props.onChange(padNumber(nextValue, this.props.pad))
|
|
179
|
+
} else {
|
|
177
180
|
let nextValue = this.clampValue(targetValue)
|
|
181
|
+
const paddedValue = parseFloat(`${this.props.value}${targetValue}`)
|
|
182
|
+
if (
|
|
183
|
+
!this.firstTouch &&
|
|
184
|
+
!isNaN(targetValue) &&
|
|
185
|
+
this.isValueValid(paddedValue)
|
|
186
|
+
) {
|
|
187
|
+
nextValue = paddedValue
|
|
188
|
+
}
|
|
189
|
+
this.firstTouch = false
|
|
190
|
+
|
|
178
191
|
if (this.props.moveFocusOnMax && nextValue / maxValue > 0.1) {
|
|
179
192
|
const { next } = getTabbableSiblings(event.target)
|
|
180
193
|
if (next) {
|
|
@@ -182,10 +195,7 @@ class NumberField extends Component<Props> {
|
|
|
182
195
|
}
|
|
183
196
|
}
|
|
184
197
|
|
|
185
|
-
this.firstTouch = false
|
|
186
198
|
this.changeIfValid(nextValue)
|
|
187
|
-
} else {
|
|
188
|
-
this.props.onChange('')
|
|
189
199
|
}
|
|
190
200
|
} else {
|
|
191
201
|
this.props.onChange(event.target.value)
|
|
@@ -244,7 +254,7 @@ class NumberField extends Component<Props> {
|
|
|
244
254
|
textOverflow: undefined,
|
|
245
255
|
autoComplete: 'off',
|
|
246
256
|
value: numberValue,
|
|
247
|
-
highlightOnInteraction: highlightOnInteraction,
|
|
257
|
+
highlightOnInteraction: highlightOnInteraction || pad,
|
|
248
258
|
onBlur: this.handleBlur,
|
|
249
259
|
onInput: this.handleInput,
|
|
250
260
|
onKeyDown: this.handleKeyDown,
|
package/src/Page/Page.mdx
CHANGED
|
@@ -4,6 +4,27 @@ category: General
|
|
|
4
4
|
summary: Page specific components.
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
+
```jsx live
|
|
8
|
+
render(
|
|
9
|
+
<Box width="100%">
|
|
10
|
+
<PageHeader>
|
|
11
|
+
<PageTitle>People</PageTitle>
|
|
12
|
+
</PageHeader>
|
|
13
|
+
<PageBody
|
|
14
|
+
sidebar={
|
|
15
|
+
<Sidebar grow={0}>
|
|
16
|
+
<Sidebar.Item active>Item 1</Sidebar.Item>
|
|
17
|
+
<Sidebar.Item>Item 2</Sidebar.Item>
|
|
18
|
+
<Sidebar.Item>Item 3</Sidebar.Item>
|
|
19
|
+
</Sidebar>
|
|
20
|
+
}
|
|
21
|
+
>
|
|
22
|
+
Regular body
|
|
23
|
+
</PageBody>
|
|
24
|
+
</Box>
|
|
25
|
+
)
|
|
26
|
+
```
|
|
27
|
+
|
|
7
28
|
```jsx live
|
|
8
29
|
render(
|
|
9
30
|
<Box width="100%">
|
|
@@ -33,6 +54,40 @@ render(
|
|
|
33
54
|
)
|
|
34
55
|
```
|
|
35
56
|
|
|
57
|
+
```jsx live
|
|
58
|
+
render(
|
|
59
|
+
<Box width="100%">
|
|
60
|
+
<PageHeader
|
|
61
|
+
toolbar={
|
|
62
|
+
<PageToolbar>
|
|
63
|
+
<PageTabList>
|
|
64
|
+
<PageTab active>My Schedule</PageTab>
|
|
65
|
+
<PageTab>All Plans</PageTab>
|
|
66
|
+
</PageTabList>
|
|
67
|
+
<PageActions>
|
|
68
|
+
<PageButton title="One" />
|
|
69
|
+
<PageButton title="Two" />
|
|
70
|
+
</PageActions>
|
|
71
|
+
</PageToolbar>
|
|
72
|
+
}
|
|
73
|
+
>
|
|
74
|
+
<PageTitle>People</PageTitle>
|
|
75
|
+
</PageHeader>
|
|
76
|
+
<PageBody
|
|
77
|
+
sidebar={
|
|
78
|
+
<Sidebar grow={0}>
|
|
79
|
+
<Sidebar.Item active>Item 1</Sidebar.Item>
|
|
80
|
+
<Sidebar.Item>Item 2</Sidebar.Item>
|
|
81
|
+
<Sidebar.Item>Item 3</Sidebar.Item>
|
|
82
|
+
</Sidebar>
|
|
83
|
+
}
|
|
84
|
+
>
|
|
85
|
+
Regular body
|
|
86
|
+
</PageBody>
|
|
87
|
+
</Box>
|
|
88
|
+
)
|
|
89
|
+
```
|
|
90
|
+
|
|
36
91
|
```jsx live
|
|
37
92
|
render(
|
|
38
93
|
<Box width="100%">
|
|
@@ -74,7 +129,7 @@ render(
|
|
|
74
129
|
|
|
75
130
|
## Theming
|
|
76
131
|
|
|
77
|
-
Use theme keys `pageBody`, `pageButton`, `pageDropdown`, and `pageTitle` to override `Page` component props.
|
|
132
|
+
Use theme keys `pageBody`, `pageButton`, `pageDropdown`, `pageHeader`, and `pageTitle` to override `Page` component props.
|
|
78
133
|
|
|
79
134
|
```jsx live
|
|
80
135
|
render(
|
package/src/Page/PageActions.js
CHANGED
|
@@ -3,7 +3,18 @@ import React from 'react'
|
|
|
3
3
|
import StackView from '../StackView'
|
|
4
4
|
|
|
5
5
|
function PageActions(props) {
|
|
6
|
-
return
|
|
6
|
+
return (
|
|
7
|
+
<StackView
|
|
8
|
+
alignment="center"
|
|
9
|
+
alignSelf="end"
|
|
10
|
+
axis="horizontal"
|
|
11
|
+
distribution="end"
|
|
12
|
+
flex="1"
|
|
13
|
+
paddingBottom={2}
|
|
14
|
+
spacing={1}
|
|
15
|
+
{...props}
|
|
16
|
+
/>
|
|
17
|
+
)
|
|
7
18
|
}
|
|
8
19
|
|
|
9
20
|
export default PageActions
|
package/src/Page/PageHeader.js
CHANGED
|
@@ -1,41 +1,35 @@
|
|
|
1
|
-
import 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=
|
|
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
|
-
{
|
|
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
|
}
|
package/src/Page/PageTab.js
CHANGED
|
@@ -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
|
-
|
|
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
|
package/src/Page/PageTabList.js
CHANGED
|
@@ -2,12 +2,14 @@ import React from 'react'
|
|
|
2
2
|
|
|
3
3
|
import StackView from '../StackView'
|
|
4
4
|
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
package/src/Page/PageTitle.js
CHANGED
|
@@ -5,7 +5,15 @@ import Heading from '../Heading'
|
|
|
5
5
|
|
|
6
6
|
function PageTitle(props) {
|
|
7
7
|
const themeProps = useThemeValue('pageTitle')
|
|
8
|
-
return
|
|
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
|
package/src/Page/PageToolbar.js
CHANGED
|
@@ -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
|
-
|
|
29
|
+
alignment="center"
|
|
9
30
|
axis="horizontal"
|
|
10
|
-
alignment="start"
|
|
11
31
|
distribution="space-between"
|
|
12
|
-
|
|
13
|
-
{
|
|
14
|
-
|
|
32
|
+
flex={1}
|
|
33
|
+
spacing={2}
|
|
34
|
+
width="100%"
|
|
35
|
+
{...stackProps}
|
|
36
|
+
{...restProps}
|
|
37
|
+
/>
|
|
15
38
|
)
|
|
16
39
|
}
|
|
17
40
|
|
package/src/Radio/Radio.js
CHANGED
|
@@ -10,10 +10,10 @@ import { Theme } from '../index'
|
|
|
10
10
|
import { objectToCSSProperties, shallowEqual } from '../utils'
|
|
11
11
|
import { setRootStyles, styleReset } from './styles'
|
|
12
12
|
|
|
13
|
-
const STORAGE_KEY = '
|
|
13
|
+
const STORAGE_KEY = 'tapestry-react-theme'
|
|
14
14
|
|
|
15
15
|
export const cache = createCache({
|
|
16
|
-
key: '
|
|
16
|
+
key: 'tapestry-react',
|
|
17
17
|
prefix: (key) => {
|
|
18
18
|
switch (key) {
|
|
19
19
|
case 'appearance':
|
|
@@ -9,7 +9,7 @@ const getRootStyles = (styles) => {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
export const setRootStyles = (styles) => {
|
|
12
|
-
const styleElement = <HTMLStyleElement>document.getElementById('
|
|
12
|
+
const styleElement = <HTMLStyleElement>document.getElementById('tapestry-react-style')
|
|
13
13
|
const sheet = <CSSStyleSheet>styleElement.sheet
|
|
14
14
|
const styleString = getRootStyles(styles)
|
|
15
15
|
sheet.deleteRule(0)
|
|
@@ -24,7 +24,7 @@ export const defaultColorProperties = objectToCSSProperties(
|
|
|
24
24
|
export const styleReset = `
|
|
25
25
|
${getRootStyles(defaultColorProperties)}
|
|
26
26
|
|
|
27
|
-
.
|
|
27
|
+
.tapestry-react-reset {
|
|
28
28
|
appearance: none;
|
|
29
29
|
box-sizing: border-box;
|
|
30
30
|
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
|
|
@@ -40,12 +40,12 @@ ${getRootStyles(defaultColorProperties)}
|
|
|
40
40
|
color: inherit;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
.
|
|
43
|
+
.tapestry-react-reset::-moz-focus-inner {
|
|
44
44
|
padding: 0px;
|
|
45
45
|
border: 0px;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
.
|
|
48
|
+
.tapestry-react-reset:focus:not(.focus-visible) {
|
|
49
49
|
outline: 0px;
|
|
50
50
|
}
|
|
51
51
|
`
|
|
@@ -56,9 +56,9 @@ ${getRootStyles(defaultColorProperties)}
|
|
|
56
56
|
// we use our own global style implementation in place of Emotion Global
|
|
57
57
|
// so we can have more control over when styles are injected since multiple
|
|
58
58
|
// Providers can be used on a page
|
|
59
|
-
if (typeof window !== 'undefined' && !document.getElementById('
|
|
59
|
+
if (typeof window !== 'undefined' && !document.getElementById('tapestry-react-style')) {
|
|
60
60
|
const styleElement = document.createElement('style')
|
|
61
|
-
styleElement.id = '
|
|
61
|
+
styleElement.id = 'tapestry-react-style'
|
|
62
62
|
styleElement.innerHTML = styleReset
|
|
63
63
|
document.head.insertAdjacentElement('afterbegin', styleElement)
|
|
64
64
|
}
|
package/src/server.js
CHANGED
package/src/system/README.md
CHANGED
|
@@ -41,7 +41,7 @@ function Box(props) {
|
|
|
41
41
|
|
|
42
42
|
<small>See the [Box](../Box/Box.tsx) component for an actual implementation.</small>
|
|
43
43
|
|
|
44
|
-
The `splitStyles` function will also process any `mediaQueries` and `variants` props that are defined. See [Responsive](https://ministrycentered.github.io/
|
|
44
|
+
The `splitStyles` function will also process any `mediaQueries` and `variants` props that are defined. See [Responsive](https://ministrycentered.github.io/tapestry-react/responsive) and [Variants](https://ministrycentered.github.io/tapestry-react/variants) for more information and examples.
|
|
45
45
|
|
|
46
46
|
### Plugins
|
|
47
47
|
|
|
@@ -90,7 +90,7 @@ function StackView(props) {
|
|
|
90
90
|
A fork of the [CXS](https://github.com/cxs-css/cxs) library is available as an escape hatch if Emotion is performing poorly. This is specifically used to combat performance issues in intensive components like `DataTable`. This is done through a `useCss` hook exported from system:
|
|
91
91
|
|
|
92
92
|
```jsx
|
|
93
|
-
import { designSystem } from '@
|
|
93
|
+
import { designSystem } from '@planningcenter/tapestry-react'
|
|
94
94
|
function Box({ color, ...props }) {
|
|
95
95
|
const css = designSystem.useCss()
|
|
96
96
|
return <div className={css({ color })} {...props} />
|
|
@@ -26,7 +26,7 @@ export default function ({
|
|
|
26
26
|
}
|
|
27
27
|
return {
|
|
28
28
|
...restProps,
|
|
29
|
-
className: className ? `
|
|
29
|
+
className: className ? `tapestry-react-reset ${className}` : `tapestry-react-reset`,
|
|
30
30
|
css: (theme) => {
|
|
31
31
|
const propStyles = {}
|
|
32
32
|
for (const prop in styleProps) {
|